regsenet.h 178 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508
  1. /*
  2. * Copyright (c) 2012, Freescale Semiconductor, Inc.
  3. * All rights reserved.
  4. *
  5. * THIS SOFTWARE IS PROVIDED BY FREESCALE "AS IS" AND ANY EXPRESS OR IMPLIED
  6. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  7. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
  8. * SHALL FREESCALE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  9. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
  10. * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  11. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  12. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  13. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
  14. * OF SUCH DAMAGE.
  15. */
  16. /*
  17. * WARNING! DO NOT EDIT THIS FILE DIRECTLY!
  18. *
  19. * This file was generated automatically and any changes may be lost.
  20. */
  21. #ifndef __HW_ENET_REGISTERS_H__
  22. #define __HW_ENET_REGISTERS_H__
  23. #include "regs.h"
  24. /*
  25. * i.MX6UL ENET
  26. *
  27. * Ethernet MAC-NET Core
  28. *
  29. * Registers defined in this header file:
  30. * - HW_ENET_EIR - Interrupt Event Register
  31. * - HW_ENET_EIMR - Interrupt Mask Register
  32. * - HW_ENET_RDAR - Receive Descriptor Active Register
  33. * - HW_ENET_TDAR - Transmit Descriptor Active Register
  34. * - HW_ENET_ECR - Ethernet Control Register
  35. * - HW_ENET_MMFR - MII Management Frame Register
  36. * - HW_ENET_MSCR - MII Speed Control Register
  37. * - HW_ENET_MIBC - MIB Control Register
  38. * - HW_ENET_RCR - Receive Control Register
  39. * - HW_ENET_TCR - Transmit Control Register
  40. * - HW_ENET_PALR - Physical Address Lower Register
  41. * - HW_ENET_PAUR - Physical Address Upper Register
  42. * - HW_ENET_OPD - Opcode/Pause Duration Register
  43. * - HW_ENET_IAUR - Descriptor Individual Upper Address Register
  44. * - HW_ENET_IALR - Descriptor Individual Lower Address Register
  45. * - HW_ENET_GAUR - Descriptor Group Upper Address Register
  46. * - HW_ENET_GALR - Descriptor Group Lower Address Register
  47. * - HW_ENET_TFWR - Transmit FIFO Watermark Register
  48. * - HW_ENET_RDSR - Receive Descriptor Ring Start Register
  49. * - HW_ENET_TDSR - Transmit Buffer Descriptor Ring Start Register
  50. * - HW_ENET_MRBR - Maximum Receive Buffer Size Register
  51. * - HW_ENET_RSFL - Receive FIFO Section Full Threshold
  52. * - HW_ENET_RSEM - Receive FIFO Section Empty Threshold
  53. * - HW_ENET_RAEM - Receive FIFO Almost Empty Threshold
  54. * - HW_ENET_RAFL - Receive FIFO Almost Full Threshold
  55. * - HW_ENET_TSEM - Transmit FIFO Section Empty Threshold
  56. * - HW_ENET_TAEM - Transmit FIFO Almost Empty Threshold
  57. * - HW_ENET_TAFL - Transmit FIFO Almost Full Threshold
  58. * - HW_ENET_TIPG - Transmit Inter-Packet Gap
  59. * - HW_ENET_FTRL - Frame Truncation Length
  60. * - HW_ENET_TACC - Transmit Accelerator Function Configuration
  61. * - HW_ENET_RACC - Receive Accelerator Function Configuration
  62. * - HW_ENET_ATCR - Timer Control Register
  63. * - HW_ENET_ATVR - Timer Value Register
  64. * - HW_ENET_ATOFF - Timer Offset Register
  65. * - HW_ENET_ATPER - Timer Period Register
  66. * - HW_ENET_ATCOR - Timer Correction Register
  67. * - HW_ENET_ATINC - Time-Stamping Clock Period Register
  68. * - HW_ENET_ATSTMP - Timestamp of Last Transmitted Frame
  69. *
  70. * - hw_enet_t - Struct containing all module registers.
  71. */
  72. //! @name Module base addresses
  73. //@{
  74. #ifndef REGS_ENET_BASE
  75. #define HW_ENET_INSTANCE_COUNT (1) //!< Number of instances of the ENET module.
  76. #define REGS_ENET_BASE (0x02188000) //!< Base address for ENET.
  77. #endif
  78. //@}
  79. //-------------------------------------------------------------------------------------------
  80. // HW_ENET_EIR - Interrupt Event Register
  81. //-------------------------------------------------------------------------------------------
  82. #ifndef __LANGUAGE_ASM__
  83. /*!
  84. * @brief HW_ENET_EIR - Interrupt Event Register (W1C)
  85. *
  86. * Reset value: 0x00000000
  87. *
  88. * When an event occurs that sets a bit in EIR, an interrupt occurs if the corresponding bit in the
  89. * interrupt mask register (EIMR) is also set. Writing a 1 to an EIR bit clears it; writing 0 has no
  90. * effect. This register is cleared upon hardware reset.
  91. */
  92. typedef union _hw_enet_eir
  93. {
  94. reg32_t U;
  95. struct _hw_enet_eir_bitfields
  96. {
  97. unsigned RESERVED0 : 15; //!< [14:0] Reserved.
  98. unsigned TS_TIMER : 1; //!< [15] Timestamp Timer
  99. unsigned TS_AVAIL : 1; //!< [16] Transmit Timestamp Available
  100. unsigned WAKEUP : 1; //!< [17] Node Wakeup Request Indication
  101. unsigned PLR : 1; //!< [18] Payload Receive Error
  102. unsigned UN : 1; //!< [19] Transmit FIFO Underrun
  103. unsigned RL : 1; //!< [20] Collision Retry Limit
  104. unsigned LC : 1; //!< [21] Late Collision
  105. unsigned EBERR : 1; //!< [22] Ethernet Bus Error
  106. unsigned MII : 1; //!< [23] MII Interrupt.
  107. unsigned RXB : 1; //!< [24] Receive Buffer Interrupt
  108. unsigned RXF : 1; //!< [25] Receive Frame Interrupt
  109. unsigned TXB : 1; //!< [26] Transmit Buffer Interrupt
  110. unsigned TXF : 1; //!< [27] Transmit Frame Interrupt
  111. unsigned GRA : 1; //!< [28] Graceful Stop Complete
  112. unsigned BABT : 1; //!< [29] Babbling Transmit Error
  113. unsigned BABR : 1; //!< [30] Babbling Receive Error
  114. unsigned RESERVED1 : 1; //!< [31]
  115. } B;
  116. } hw_enet_eir_t;
  117. #endif
  118. /*!
  119. * @name Constants and macros for entire ENET_EIR register
  120. */
  121. //@{
  122. #define HW_ENET_EIR_ADDR (REGS_ENET_BASE + 0x4)
  123. #ifndef __LANGUAGE_ASM__
  124. #define HW_ENET_EIR (*(volatile hw_enet_eir_t *) HW_ENET_EIR_ADDR)
  125. #define HW_ENET_EIR_RD() (HW_ENET_EIR.U)
  126. #define HW_ENET_EIR_WR(v) (HW_ENET_EIR.U = (v))
  127. #define HW_ENET_EIR_SET(v) (HW_ENET_EIR_WR(HW_ENET_EIR_RD() | (v)))
  128. #define HW_ENET_EIR_CLR(v) (HW_ENET_EIR_WR(HW_ENET_EIR_RD() & ~(v)))
  129. #define HW_ENET_EIR_TOG(v) (HW_ENET_EIR_WR(HW_ENET_EIR_RD() ^ (v)))
  130. #endif
  131. //@}
  132. /*
  133. * constants & macros for individual ENET_EIR bitfields
  134. */
  135. /*! @name Register ENET_EIR, field TS_TIMER[15] (W1C)
  136. *
  137. * The adjustable timer reached the period event. A period event interrupt can be generated if
  138. * ATCR[PEREN] is set and the timer wraps according to the periodic setting in the ATPER register.
  139. * Set the timer period value before setting ATCR[PEREN].
  140. */
  141. //@{
  142. #define BP_ENET_EIR_TS_TIMER (15) //!< Bit position for ENET_EIR_TS_TIMER.
  143. #define BM_ENET_EIR_TS_TIMER (0x00008000) //!< Bit mask for ENET_EIR_TS_TIMER.
  144. //! @brief Get value of ENET_EIR_TS_TIMER from a register value.
  145. #define BG_ENET_EIR_TS_TIMER(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIR_TS_TIMER) >> BP_ENET_EIR_TS_TIMER)
  146. //! @brief Format value for bitfield ENET_EIR_TS_TIMER.
  147. #define BF_ENET_EIR_TS_TIMER(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIR_TS_TIMER) & BM_ENET_EIR_TS_TIMER)
  148. #ifndef __LANGUAGE_ASM__
  149. //! @brief Set the TS_TIMER field to a new value.
  150. #define BW_ENET_EIR_TS_TIMER(v) (HW_ENET_EIR_WR((HW_ENET_EIR_RD() & ~BM_ENET_EIR_TS_TIMER) | BF_ENET_EIR_TS_TIMER(v)))
  151. #endif
  152. //@}
  153. /*! @name Register ENET_EIR, field TS_AVAIL[16] (W1C)
  154. *
  155. * Indicates that the timestamp of the last transmitted timing frame is available in the ATSTMP
  156. * register.
  157. */
  158. //@{
  159. #define BP_ENET_EIR_TS_AVAIL (16) //!< Bit position for ENET_EIR_TS_AVAIL.
  160. #define BM_ENET_EIR_TS_AVAIL (0x00010000) //!< Bit mask for ENET_EIR_TS_AVAIL.
  161. //! @brief Get value of ENET_EIR_TS_AVAIL from a register value.
  162. #define BG_ENET_EIR_TS_AVAIL(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIR_TS_AVAIL) >> BP_ENET_EIR_TS_AVAIL)
  163. //! @brief Format value for bitfield ENET_EIR_TS_AVAIL.
  164. #define BF_ENET_EIR_TS_AVAIL(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIR_TS_AVAIL) & BM_ENET_EIR_TS_AVAIL)
  165. #ifndef __LANGUAGE_ASM__
  166. //! @brief Set the TS_AVAIL field to a new value.
  167. #define BW_ENET_EIR_TS_AVAIL(v) (HW_ENET_EIR_WR((HW_ENET_EIR_RD() & ~BM_ENET_EIR_TS_AVAIL) | BF_ENET_EIR_TS_AVAIL(v)))
  168. #endif
  169. //@}
  170. /*! @name Register ENET_EIR, field WAKEUP[17] (W1C)
  171. *
  172. * Read-only status bit to indicate that a magic packet has been detected. Will act only if
  173. * ECR[MAGICEN] is set.
  174. */
  175. //@{
  176. #define BP_ENET_EIR_WAKEUP (17) //!< Bit position for ENET_EIR_WAKEUP.
  177. #define BM_ENET_EIR_WAKEUP (0x00020000) //!< Bit mask for ENET_EIR_WAKEUP.
  178. //! @brief Get value of ENET_EIR_WAKEUP from a register value.
  179. #define BG_ENET_EIR_WAKEUP(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIR_WAKEUP) >> BP_ENET_EIR_WAKEUP)
  180. //! @brief Format value for bitfield ENET_EIR_WAKEUP.
  181. #define BF_ENET_EIR_WAKEUP(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIR_WAKEUP) & BM_ENET_EIR_WAKEUP)
  182. #ifndef __LANGUAGE_ASM__
  183. //! @brief Set the WAKEUP field to a new value.
  184. #define BW_ENET_EIR_WAKEUP(v) (HW_ENET_EIR_WR((HW_ENET_EIR_RD() & ~BM_ENET_EIR_WAKEUP) | BF_ENET_EIR_WAKEUP(v)))
  185. #endif
  186. //@}
  187. /*! @name Register ENET_EIR, field PLR[18] (W1C)
  188. *
  189. * Indicates a frame was received with a payload length error. See Frame Length/Type Verification:
  190. * Payload Length Check for more information.
  191. */
  192. //@{
  193. #define BP_ENET_EIR_PLR (18) //!< Bit position for ENET_EIR_PLR.
  194. #define BM_ENET_EIR_PLR (0x00040000) //!< Bit mask for ENET_EIR_PLR.
  195. //! @brief Get value of ENET_EIR_PLR from a register value.
  196. #define BG_ENET_EIR_PLR(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIR_PLR) >> BP_ENET_EIR_PLR)
  197. //! @brief Format value for bitfield ENET_EIR_PLR.
  198. #define BF_ENET_EIR_PLR(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIR_PLR) & BM_ENET_EIR_PLR)
  199. #ifndef __LANGUAGE_ASM__
  200. //! @brief Set the PLR field to a new value.
  201. #define BW_ENET_EIR_PLR(v) (HW_ENET_EIR_WR((HW_ENET_EIR_RD() & ~BM_ENET_EIR_PLR) | BF_ENET_EIR_PLR(v)))
  202. #endif
  203. //@}
  204. /*! @name Register ENET_EIR, field UN[19] (W1C)
  205. *
  206. * Indicates the transmit FIFO became empty before the complete frame was transmitted. A bad CRC is
  207. * appended to the frame fragment and the remainder of the frame is discarded.
  208. */
  209. //@{
  210. #define BP_ENET_EIR_UN (19) //!< Bit position for ENET_EIR_UN.
  211. #define BM_ENET_EIR_UN (0x00080000) //!< Bit mask for ENET_EIR_UN.
  212. //! @brief Get value of ENET_EIR_UN from a register value.
  213. #define BG_ENET_EIR_UN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIR_UN) >> BP_ENET_EIR_UN)
  214. //! @brief Format value for bitfield ENET_EIR_UN.
  215. #define BF_ENET_EIR_UN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIR_UN) & BM_ENET_EIR_UN)
  216. #ifndef __LANGUAGE_ASM__
  217. //! @brief Set the UN field to a new value.
  218. #define BW_ENET_EIR_UN(v) (HW_ENET_EIR_WR((HW_ENET_EIR_RD() & ~BM_ENET_EIR_UN) | BF_ENET_EIR_UN(v)))
  219. #endif
  220. //@}
  221. /*! @name Register ENET_EIR, field RL[20] (W1C)
  222. *
  223. * Indicates a collision occurred on each of 16 successive attempts to transmit the frame. The frame
  224. * is discarded without being transmitted and transmission of the next frame commences. This error
  225. * can only occur in half-duplex mode.
  226. */
  227. //@{
  228. #define BP_ENET_EIR_RL (20) //!< Bit position for ENET_EIR_RL.
  229. #define BM_ENET_EIR_RL (0x00100000) //!< Bit mask for ENET_EIR_RL.
  230. //! @brief Get value of ENET_EIR_RL from a register value.
  231. #define BG_ENET_EIR_RL(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIR_RL) >> BP_ENET_EIR_RL)
  232. //! @brief Format value for bitfield ENET_EIR_RL.
  233. #define BF_ENET_EIR_RL(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIR_RL) & BM_ENET_EIR_RL)
  234. #ifndef __LANGUAGE_ASM__
  235. //! @brief Set the RL field to a new value.
  236. #define BW_ENET_EIR_RL(v) (HW_ENET_EIR_WR((HW_ENET_EIR_RD() & ~BM_ENET_EIR_RL) | BF_ENET_EIR_RL(v)))
  237. #endif
  238. //@}
  239. /*! @name Register ENET_EIR, field LC[21] (W1C)
  240. *
  241. * Indicates a collision occurred beyond the collision window (slot time) in half-duplex mode. The
  242. * frame truncates with a bad CRC and the remainder of the frame is discarded.
  243. */
  244. //@{
  245. #define BP_ENET_EIR_LC (21) //!< Bit position for ENET_EIR_LC.
  246. #define BM_ENET_EIR_LC (0x00200000) //!< Bit mask for ENET_EIR_LC.
  247. //! @brief Get value of ENET_EIR_LC from a register value.
  248. #define BG_ENET_EIR_LC(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIR_LC) >> BP_ENET_EIR_LC)
  249. //! @brief Format value for bitfield ENET_EIR_LC.
  250. #define BF_ENET_EIR_LC(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIR_LC) & BM_ENET_EIR_LC)
  251. #ifndef __LANGUAGE_ASM__
  252. //! @brief Set the LC field to a new value.
  253. #define BW_ENET_EIR_LC(v) (HW_ENET_EIR_WR((HW_ENET_EIR_RD() & ~BM_ENET_EIR_LC) | BF_ENET_EIR_LC(v)))
  254. #endif
  255. //@}
  256. /*! @name Register ENET_EIR, field EBERR[22] (W1C)
  257. *
  258. * Indicates a system bus error occurred when a uDMA transaction is underway. When this bit is set,
  259. * ECR[ETHEREN] is cleared, halting frame processing by the MAC. When this occurs, software must
  260. * ensure proper actions, possibly resetting the system, to resume normal operation.
  261. */
  262. //@{
  263. #define BP_ENET_EIR_EBERR (22) //!< Bit position for ENET_EIR_EBERR.
  264. #define BM_ENET_EIR_EBERR (0x00400000) //!< Bit mask for ENET_EIR_EBERR.
  265. //! @brief Get value of ENET_EIR_EBERR from a register value.
  266. #define BG_ENET_EIR_EBERR(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIR_EBERR) >> BP_ENET_EIR_EBERR)
  267. //! @brief Format value for bitfield ENET_EIR_EBERR.
  268. #define BF_ENET_EIR_EBERR(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIR_EBERR) & BM_ENET_EIR_EBERR)
  269. #ifndef __LANGUAGE_ASM__
  270. //! @brief Set the EBERR field to a new value.
  271. #define BW_ENET_EIR_EBERR(v) (HW_ENET_EIR_WR((HW_ENET_EIR_RD() & ~BM_ENET_EIR_EBERR) | BF_ENET_EIR_EBERR(v)))
  272. #endif
  273. //@}
  274. /*! @name Register ENET_EIR, field MII[23] (W1C)
  275. *
  276. * Indicates that the MII has completed the data transfer requested.
  277. */
  278. //@{
  279. #define BP_ENET_EIR_MII (23) //!< Bit position for ENET_EIR_MII.
  280. #define BM_ENET_EIR_MII (0x00800000) //!< Bit mask for ENET_EIR_MII.
  281. //! @brief Get value of ENET_EIR_MII from a register value.
  282. #define BG_ENET_EIR_MII(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIR_MII) >> BP_ENET_EIR_MII)
  283. //! @brief Format value for bitfield ENET_EIR_MII.
  284. #define BF_ENET_EIR_MII(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIR_MII) & BM_ENET_EIR_MII)
  285. #ifndef __LANGUAGE_ASM__
  286. //! @brief Set the MII field to a new value.
  287. #define BW_ENET_EIR_MII(v) (HW_ENET_EIR_WR((HW_ENET_EIR_RD() & ~BM_ENET_EIR_MII) | BF_ENET_EIR_MII(v)))
  288. #endif
  289. //@}
  290. /*! @name Register ENET_EIR, field RXB[24] (W1C)
  291. *
  292. * Indicates a receive buffer descriptor is not the last in the frame has been updated.
  293. */
  294. //@{
  295. #define BP_ENET_EIR_RXB (24) //!< Bit position for ENET_EIR_RXB.
  296. #define BM_ENET_EIR_RXB (0x01000000) //!< Bit mask for ENET_EIR_RXB.
  297. //! @brief Get value of ENET_EIR_RXB from a register value.
  298. #define BG_ENET_EIR_RXB(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIR_RXB) >> BP_ENET_EIR_RXB)
  299. //! @brief Format value for bitfield ENET_EIR_RXB.
  300. #define BF_ENET_EIR_RXB(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIR_RXB) & BM_ENET_EIR_RXB)
  301. #ifndef __LANGUAGE_ASM__
  302. //! @brief Set the RXB field to a new value.
  303. #define BW_ENET_EIR_RXB(v) (HW_ENET_EIR_WR((HW_ENET_EIR_RD() & ~BM_ENET_EIR_RXB) | BF_ENET_EIR_RXB(v)))
  304. #endif
  305. //@}
  306. /*! @name Register ENET_EIR, field RXF[25] (W1C)
  307. *
  308. * Indicates a frame has been received and the last corresponding buffer descriptor has been
  309. * updated.
  310. */
  311. //@{
  312. #define BP_ENET_EIR_RXF (25) //!< Bit position for ENET_EIR_RXF.
  313. #define BM_ENET_EIR_RXF (0x02000000) //!< Bit mask for ENET_EIR_RXF.
  314. //! @brief Get value of ENET_EIR_RXF from a register value.
  315. #define BG_ENET_EIR_RXF(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIR_RXF) >> BP_ENET_EIR_RXF)
  316. //! @brief Format value for bitfield ENET_EIR_RXF.
  317. #define BF_ENET_EIR_RXF(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIR_RXF) & BM_ENET_EIR_RXF)
  318. #ifndef __LANGUAGE_ASM__
  319. //! @brief Set the RXF field to a new value.
  320. #define BW_ENET_EIR_RXF(v) (HW_ENET_EIR_WR((HW_ENET_EIR_RD() & ~BM_ENET_EIR_RXF) | BF_ENET_EIR_RXF(v)))
  321. #endif
  322. //@}
  323. /*! @name Register ENET_EIR, field TXB[26] (W1C)
  324. *
  325. * Indicates a transmit buffer descriptor has been updated.
  326. */
  327. //@{
  328. #define BP_ENET_EIR_TXB (26) //!< Bit position for ENET_EIR_TXB.
  329. #define BM_ENET_EIR_TXB (0x04000000) //!< Bit mask for ENET_EIR_TXB.
  330. //! @brief Get value of ENET_EIR_TXB from a register value.
  331. #define BG_ENET_EIR_TXB(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIR_TXB) >> BP_ENET_EIR_TXB)
  332. //! @brief Format value for bitfield ENET_EIR_TXB.
  333. #define BF_ENET_EIR_TXB(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIR_TXB) & BM_ENET_EIR_TXB)
  334. #ifndef __LANGUAGE_ASM__
  335. //! @brief Set the TXB field to a new value.
  336. #define BW_ENET_EIR_TXB(v) (HW_ENET_EIR_WR((HW_ENET_EIR_RD() & ~BM_ENET_EIR_TXB) | BF_ENET_EIR_TXB(v)))
  337. #endif
  338. //@}
  339. /*! @name Register ENET_EIR, field TXF[27] (W1C)
  340. *
  341. * Indicates a frame has been transmitted and the last corresponding buffer descriptor has been
  342. * updated.
  343. */
  344. //@{
  345. #define BP_ENET_EIR_TXF (27) //!< Bit position for ENET_EIR_TXF.
  346. #define BM_ENET_EIR_TXF (0x08000000) //!< Bit mask for ENET_EIR_TXF.
  347. //! @brief Get value of ENET_EIR_TXF from a register value.
  348. #define BG_ENET_EIR_TXF(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIR_TXF) >> BP_ENET_EIR_TXF)
  349. //! @brief Format value for bitfield ENET_EIR_TXF.
  350. #define BF_ENET_EIR_TXF(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIR_TXF) & BM_ENET_EIR_TXF)
  351. #ifndef __LANGUAGE_ASM__
  352. //! @brief Set the TXF field to a new value.
  353. #define BW_ENET_EIR_TXF(v) (HW_ENET_EIR_WR((HW_ENET_EIR_RD() & ~BM_ENET_EIR_TXF) | BF_ENET_EIR_TXF(v)))
  354. #endif
  355. //@}
  356. /*! @name Register ENET_EIR, field GRA[28] (W1C)
  357. *
  358. * This interrupt is asserted after the transmitter is put into a pause state after completion of
  359. * the frame currently being transmitted. See Graceful Transmit Stop (GTS) for conditions that lead
  360. * to graceful stop. The GRA interrupt is asserted only when the TX transitions into the stopped
  361. * state. If this bit is cleared by writing 1 and the TX is still stopped, the bit is not set again.
  362. */
  363. //@{
  364. #define BP_ENET_EIR_GRA (28) //!< Bit position for ENET_EIR_GRA.
  365. #define BM_ENET_EIR_GRA (0x10000000) //!< Bit mask for ENET_EIR_GRA.
  366. //! @brief Get value of ENET_EIR_GRA from a register value.
  367. #define BG_ENET_EIR_GRA(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIR_GRA) >> BP_ENET_EIR_GRA)
  368. //! @brief Format value for bitfield ENET_EIR_GRA.
  369. #define BF_ENET_EIR_GRA(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIR_GRA) & BM_ENET_EIR_GRA)
  370. #ifndef __LANGUAGE_ASM__
  371. //! @brief Set the GRA field to a new value.
  372. #define BW_ENET_EIR_GRA(v) (HW_ENET_EIR_WR((HW_ENET_EIR_RD() & ~BM_ENET_EIR_GRA) | BF_ENET_EIR_GRA(v)))
  373. #endif
  374. //@}
  375. /*! @name Register ENET_EIR, field BABT[29] (W1C)
  376. *
  377. * Indicates the transmitted frame length exceeds RCR[MAX_FL] bytes. Usually this condition is
  378. * caused when a frame that is too long is placed into the transmit data buffer(s). Truncation does
  379. * not occur.
  380. */
  381. //@{
  382. #define BP_ENET_EIR_BABT (29) //!< Bit position for ENET_EIR_BABT.
  383. #define BM_ENET_EIR_BABT (0x20000000) //!< Bit mask for ENET_EIR_BABT.
  384. //! @brief Get value of ENET_EIR_BABT from a register value.
  385. #define BG_ENET_EIR_BABT(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIR_BABT) >> BP_ENET_EIR_BABT)
  386. //! @brief Format value for bitfield ENET_EIR_BABT.
  387. #define BF_ENET_EIR_BABT(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIR_BABT) & BM_ENET_EIR_BABT)
  388. #ifndef __LANGUAGE_ASM__
  389. //! @brief Set the BABT field to a new value.
  390. #define BW_ENET_EIR_BABT(v) (HW_ENET_EIR_WR((HW_ENET_EIR_RD() & ~BM_ENET_EIR_BABT) | BF_ENET_EIR_BABT(v)))
  391. #endif
  392. //@}
  393. /*! @name Register ENET_EIR, field BABR[30] (W1C)
  394. *
  395. * Indicates a frame was received with length in excess of RCR[MAX_FL] bytes.
  396. */
  397. //@{
  398. #define BP_ENET_EIR_BABR (30) //!< Bit position for ENET_EIR_BABR.
  399. #define BM_ENET_EIR_BABR (0x40000000) //!< Bit mask for ENET_EIR_BABR.
  400. //! @brief Get value of ENET_EIR_BABR from a register value.
  401. #define BG_ENET_EIR_BABR(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIR_BABR) >> BP_ENET_EIR_BABR)
  402. //! @brief Format value for bitfield ENET_EIR_BABR.
  403. #define BF_ENET_EIR_BABR(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIR_BABR) & BM_ENET_EIR_BABR)
  404. #ifndef __LANGUAGE_ASM__
  405. //! @brief Set the BABR field to a new value.
  406. #define BW_ENET_EIR_BABR(v) (HW_ENET_EIR_WR((HW_ENET_EIR_RD() & ~BM_ENET_EIR_BABR) | BF_ENET_EIR_BABR(v)))
  407. #endif
  408. //@}
  409. //-------------------------------------------------------------------------------------------
  410. // HW_ENET_EIMR - Interrupt Mask Register
  411. //-------------------------------------------------------------------------------------------
  412. #ifndef __LANGUAGE_ASM__
  413. /*!
  414. * @brief HW_ENET_EIMR - Interrupt Mask Register (RW)
  415. *
  416. * Reset value: 0x00000000
  417. *
  418. * EIMR controls which interrupt events are allowed to generate actual interrupts. A hardware reset
  419. * clears this register. If the corresponding bits in the EIR and EIMR registers are set, an
  420. * interrupt is generated. The interrupt signal remains asserted until a 1 is written to the EIR
  421. * field (write 1 to clear) or a 0 is written to the EIMR field.
  422. */
  423. typedef union _hw_enet_eimr
  424. {
  425. reg32_t U;
  426. struct _hw_enet_eimr_bitfields
  427. {
  428. unsigned RESERVED0 : 15; //!< [14:0]
  429. unsigned TS_TIMER : 1; //!< [15] TS_TIMER Interrupt Mask
  430. unsigned TS_AVAIL : 1; //!< [16] TS_AVAIL Interrupt Mask
  431. unsigned WAKEUP : 1; //!< [17] WAKEUP Interrupt Mask
  432. unsigned PLR : 1; //!< [18] PLR Interrupt Mask
  433. unsigned UN : 1; //!< [19] UN Interrupt Mask
  434. unsigned RL : 1; //!< [20] RL Interrupt Mask
  435. unsigned LC : 1; //!< [21] LC Interrupt Mask
  436. unsigned EBERR : 1; //!< [22] EBERR Interrupt Mask
  437. unsigned MII : 1; //!< [23] MII Interrupt Mask
  438. unsigned RXB : 1; //!< [24] RXB Interrupt Mask
  439. unsigned RXF : 1; //!< [25] RXF Interrupt Mask
  440. unsigned TXB : 1; //!< [26] TXB Interrupt Mask
  441. unsigned TXF : 1; //!< [27] TXF Interrupt Mask
  442. unsigned GRA : 1; //!< [28] GRA Interrupt Mask
  443. unsigned BABT : 1; //!< [29] BABT Interrupt Mask
  444. unsigned BABR : 1; //!< [30] BABR Interrupt Mask
  445. unsigned RESERVED1 : 1; //!< [31]
  446. } B;
  447. } hw_enet_eimr_t;
  448. #endif
  449. /*!
  450. * @name Constants and macros for entire ENET_EIMR register
  451. */
  452. //@{
  453. #define HW_ENET_EIMR_ADDR (REGS_ENET_BASE + 0x8)
  454. #ifndef __LANGUAGE_ASM__
  455. #define HW_ENET_EIMR (*(volatile hw_enet_eimr_t *) HW_ENET_EIMR_ADDR)
  456. #define HW_ENET_EIMR_RD() (HW_ENET_EIMR.U)
  457. #define HW_ENET_EIMR_WR(v) (HW_ENET_EIMR.U = (v))
  458. #define HW_ENET_EIMR_SET(v) (HW_ENET_EIMR_WR(HW_ENET_EIMR_RD() | (v)))
  459. #define HW_ENET_EIMR_CLR(v) (HW_ENET_EIMR_WR(HW_ENET_EIMR_RD() & ~(v)))
  460. #define HW_ENET_EIMR_TOG(v) (HW_ENET_EIMR_WR(HW_ENET_EIMR_RD() ^ (v)))
  461. #endif
  462. //@}
  463. /*
  464. * constants & macros for individual ENET_EIMR bitfields
  465. */
  466. /*! @name Register ENET_EIMR, field TS_TIMER[15] (RW)
  467. *
  468. * Corresponds to interrupt source TS_TIMER defined by the EIR register and determines whether an
  469. * interrupt condition can generate an interrupt. At every module clock, the EIR samples the signal
  470. * generated by the interrupting source. The corresponding EIR TS_TIMER field reflects the state of
  471. * the interrupt signal even if the corresponding EIMR field is cleared.
  472. */
  473. //@{
  474. #define BP_ENET_EIMR_TS_TIMER (15) //!< Bit position for ENET_EIMR_TS_TIMER.
  475. #define BM_ENET_EIMR_TS_TIMER (0x00008000) //!< Bit mask for ENET_EIMR_TS_TIMER.
  476. //! @brief Get value of ENET_EIMR_TS_TIMER from a register value.
  477. #define BG_ENET_EIMR_TS_TIMER(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIMR_TS_TIMER) >> BP_ENET_EIMR_TS_TIMER)
  478. //! @brief Format value for bitfield ENET_EIMR_TS_TIMER.
  479. #define BF_ENET_EIMR_TS_TIMER(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIMR_TS_TIMER) & BM_ENET_EIMR_TS_TIMER)
  480. #ifndef __LANGUAGE_ASM__
  481. //! @brief Set the TS_TIMER field to a new value.
  482. #define BW_ENET_EIMR_TS_TIMER(v) (HW_ENET_EIMR_WR((HW_ENET_EIMR_RD() & ~BM_ENET_EIMR_TS_TIMER) | BF_ENET_EIMR_TS_TIMER(v)))
  483. #endif
  484. //@}
  485. /*! @name Register ENET_EIMR, field TS_AVAIL[16] (RW)
  486. *
  487. * Corresponds to interrupt source TS_AVAIL defined by the EIR register and determines whether an
  488. * interrupt condition can generate an interrupt. At every module clock, the EIR samples the signal
  489. * generated by the interrupting source. The corresponding EIR TS_AVAIL field reflects the state of
  490. * the interrupt signal even if the corresponding EIMR field is cleared.
  491. */
  492. //@{
  493. #define BP_ENET_EIMR_TS_AVAIL (16) //!< Bit position for ENET_EIMR_TS_AVAIL.
  494. #define BM_ENET_EIMR_TS_AVAIL (0x00010000) //!< Bit mask for ENET_EIMR_TS_AVAIL.
  495. //! @brief Get value of ENET_EIMR_TS_AVAIL from a register value.
  496. #define BG_ENET_EIMR_TS_AVAIL(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIMR_TS_AVAIL) >> BP_ENET_EIMR_TS_AVAIL)
  497. //! @brief Format value for bitfield ENET_EIMR_TS_AVAIL.
  498. #define BF_ENET_EIMR_TS_AVAIL(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIMR_TS_AVAIL) & BM_ENET_EIMR_TS_AVAIL)
  499. #ifndef __LANGUAGE_ASM__
  500. //! @brief Set the TS_AVAIL field to a new value.
  501. #define BW_ENET_EIMR_TS_AVAIL(v) (HW_ENET_EIMR_WR((HW_ENET_EIMR_RD() & ~BM_ENET_EIMR_TS_AVAIL) | BF_ENET_EIMR_TS_AVAIL(v)))
  502. #endif
  503. //@}
  504. /*! @name Register ENET_EIMR, field WAKEUP[17] (RW)
  505. *
  506. * Corresponds to interrupt source WAKEUP defined by the EIR register and determines whether an
  507. * interrupt condition can generate an interrupt. At every module clock, the EIR samples the signal
  508. * generated by the interrupting source. The corresponding EIR WAKEUP field reflects the state of
  509. * the interrupt signal even if the corresponding EIMR field is cleared.
  510. */
  511. //@{
  512. #define BP_ENET_EIMR_WAKEUP (17) //!< Bit position for ENET_EIMR_WAKEUP.
  513. #define BM_ENET_EIMR_WAKEUP (0x00020000) //!< Bit mask for ENET_EIMR_WAKEUP.
  514. //! @brief Get value of ENET_EIMR_WAKEUP from a register value.
  515. #define BG_ENET_EIMR_WAKEUP(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIMR_WAKEUP) >> BP_ENET_EIMR_WAKEUP)
  516. //! @brief Format value for bitfield ENET_EIMR_WAKEUP.
  517. #define BF_ENET_EIMR_WAKEUP(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIMR_WAKEUP) & BM_ENET_EIMR_WAKEUP)
  518. #ifndef __LANGUAGE_ASM__
  519. //! @brief Set the WAKEUP field to a new value.
  520. #define BW_ENET_EIMR_WAKEUP(v) (HW_ENET_EIMR_WR((HW_ENET_EIMR_RD() & ~BM_ENET_EIMR_WAKEUP) | BF_ENET_EIMR_WAKEUP(v)))
  521. #endif
  522. //@}
  523. /*! @name Register ENET_EIMR, field PLR[18] (RW)
  524. *
  525. * Corresponds to interrupt source PLR defined by the EIR register and determines whether an
  526. * interrupt condition can generate an interrupt. At every module clock, the EIR samples the signal
  527. * generated by the interrupting source. The corresponding EIR PLR field reflects the state of the
  528. * interrupt signal even if the corresponding EIMR field is cleared.
  529. */
  530. //@{
  531. #define BP_ENET_EIMR_PLR (18) //!< Bit position for ENET_EIMR_PLR.
  532. #define BM_ENET_EIMR_PLR (0x00040000) //!< Bit mask for ENET_EIMR_PLR.
  533. //! @brief Get value of ENET_EIMR_PLR from a register value.
  534. #define BG_ENET_EIMR_PLR(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIMR_PLR) >> BP_ENET_EIMR_PLR)
  535. //! @brief Format value for bitfield ENET_EIMR_PLR.
  536. #define BF_ENET_EIMR_PLR(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIMR_PLR) & BM_ENET_EIMR_PLR)
  537. #ifndef __LANGUAGE_ASM__
  538. //! @brief Set the PLR field to a new value.
  539. #define BW_ENET_EIMR_PLR(v) (HW_ENET_EIMR_WR((HW_ENET_EIMR_RD() & ~BM_ENET_EIMR_PLR) | BF_ENET_EIMR_PLR(v)))
  540. #endif
  541. //@}
  542. /*! @name Register ENET_EIMR, field UN[19] (RW)
  543. *
  544. * Corresponds to interrupt source UN defined by the EIR register and determines whether an
  545. * interrupt condition can generate an interrupt. At every module clock, the EIR samples the signal
  546. * generated by the interrupting source. The corresponding EIR UN field reflects the state of the
  547. * interrupt signal even if the corresponding EIMR field is cleared.
  548. */
  549. //@{
  550. #define BP_ENET_EIMR_UN (19) //!< Bit position for ENET_EIMR_UN.
  551. #define BM_ENET_EIMR_UN (0x00080000) //!< Bit mask for ENET_EIMR_UN.
  552. //! @brief Get value of ENET_EIMR_UN from a register value.
  553. #define BG_ENET_EIMR_UN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIMR_UN) >> BP_ENET_EIMR_UN)
  554. //! @brief Format value for bitfield ENET_EIMR_UN.
  555. #define BF_ENET_EIMR_UN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIMR_UN) & BM_ENET_EIMR_UN)
  556. #ifndef __LANGUAGE_ASM__
  557. //! @brief Set the UN field to a new value.
  558. #define BW_ENET_EIMR_UN(v) (HW_ENET_EIMR_WR((HW_ENET_EIMR_RD() & ~BM_ENET_EIMR_UN) | BF_ENET_EIMR_UN(v)))
  559. #endif
  560. //@}
  561. /*! @name Register ENET_EIMR, field RL[20] (RW)
  562. *
  563. * Corresponds to interrupt source RL defined by the EIR register and determines whether an
  564. * interrupt condition can generate an interrupt. At every module clock, the EIR samples the signal
  565. * generated by the interrupting source. The corresponding EIR RL field reflects the state of the
  566. * interrupt signal even if the corresponding EIMR field is cleared.
  567. */
  568. //@{
  569. #define BP_ENET_EIMR_RL (20) //!< Bit position for ENET_EIMR_RL.
  570. #define BM_ENET_EIMR_RL (0x00100000) //!< Bit mask for ENET_EIMR_RL.
  571. //! @brief Get value of ENET_EIMR_RL from a register value.
  572. #define BG_ENET_EIMR_RL(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIMR_RL) >> BP_ENET_EIMR_RL)
  573. //! @brief Format value for bitfield ENET_EIMR_RL.
  574. #define BF_ENET_EIMR_RL(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIMR_RL) & BM_ENET_EIMR_RL)
  575. #ifndef __LANGUAGE_ASM__
  576. //! @brief Set the RL field to a new value.
  577. #define BW_ENET_EIMR_RL(v) (HW_ENET_EIMR_WR((HW_ENET_EIMR_RD() & ~BM_ENET_EIMR_RL) | BF_ENET_EIMR_RL(v)))
  578. #endif
  579. //@}
  580. /*! @name Register ENET_EIMR, field LC[21] (RW)
  581. *
  582. * Corresponds to interrupt source LC defined by the EIR register and determines whether an
  583. * interrupt condition can generate an interrupt. At every module clock, the EIR samples the signal
  584. * generated by the interrupting source. The corresponding EIR LC field reflects the state of the
  585. * interrupt signal even if the corresponding EIMR field is cleared.
  586. */
  587. //@{
  588. #define BP_ENET_EIMR_LC (21) //!< Bit position for ENET_EIMR_LC.
  589. #define BM_ENET_EIMR_LC (0x00200000) //!< Bit mask for ENET_EIMR_LC.
  590. //! @brief Get value of ENET_EIMR_LC from a register value.
  591. #define BG_ENET_EIMR_LC(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIMR_LC) >> BP_ENET_EIMR_LC)
  592. //! @brief Format value for bitfield ENET_EIMR_LC.
  593. #define BF_ENET_EIMR_LC(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIMR_LC) & BM_ENET_EIMR_LC)
  594. #ifndef __LANGUAGE_ASM__
  595. //! @brief Set the LC field to a new value.
  596. #define BW_ENET_EIMR_LC(v) (HW_ENET_EIMR_WR((HW_ENET_EIMR_RD() & ~BM_ENET_EIMR_LC) | BF_ENET_EIMR_LC(v)))
  597. #endif
  598. //@}
  599. /*! @name Register ENET_EIMR, field EBERR[22] (RW)
  600. *
  601. * Corresponds to interrupt source EBERR defined by the EIR register and determines whether an
  602. * interrupt condition can generate an interrupt. At every module clock, the EIR samples the signal
  603. * generated by the interrupting source. The corresponding EIR EBERR field reflects the state of the
  604. * interrupt signal even if the corresponding EIMR field is cleared.
  605. */
  606. //@{
  607. #define BP_ENET_EIMR_EBERR (22) //!< Bit position for ENET_EIMR_EBERR.
  608. #define BM_ENET_EIMR_EBERR (0x00400000) //!< Bit mask for ENET_EIMR_EBERR.
  609. //! @brief Get value of ENET_EIMR_EBERR from a register value.
  610. #define BG_ENET_EIMR_EBERR(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIMR_EBERR) >> BP_ENET_EIMR_EBERR)
  611. //! @brief Format value for bitfield ENET_EIMR_EBERR.
  612. #define BF_ENET_EIMR_EBERR(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIMR_EBERR) & BM_ENET_EIMR_EBERR)
  613. #ifndef __LANGUAGE_ASM__
  614. //! @brief Set the EBERR field to a new value.
  615. #define BW_ENET_EIMR_EBERR(v) (HW_ENET_EIMR_WR((HW_ENET_EIMR_RD() & ~BM_ENET_EIMR_EBERR) | BF_ENET_EIMR_EBERR(v)))
  616. #endif
  617. //@}
  618. /*! @name Register ENET_EIMR, field MII[23] (RW)
  619. *
  620. * Corresponds to interrupt source MII defined by the EIR register and determines whether an
  621. * interrupt condition can generate an interrupt. At every module clock, the EIR samples the signal
  622. * generated by the interrupting source. The corresponding EIR MII field reflects the state of the
  623. * interrupt signal even if the corresponding EIMR field is cleared.
  624. */
  625. //@{
  626. #define BP_ENET_EIMR_MII (23) //!< Bit position for ENET_EIMR_MII.
  627. #define BM_ENET_EIMR_MII (0x00800000) //!< Bit mask for ENET_EIMR_MII.
  628. //! @brief Get value of ENET_EIMR_MII from a register value.
  629. #define BG_ENET_EIMR_MII(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIMR_MII) >> BP_ENET_EIMR_MII)
  630. //! @brief Format value for bitfield ENET_EIMR_MII.
  631. #define BF_ENET_EIMR_MII(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIMR_MII) & BM_ENET_EIMR_MII)
  632. #ifndef __LANGUAGE_ASM__
  633. //! @brief Set the MII field to a new value.
  634. #define BW_ENET_EIMR_MII(v) (HW_ENET_EIMR_WR((HW_ENET_EIMR_RD() & ~BM_ENET_EIMR_MII) | BF_ENET_EIMR_MII(v)))
  635. #endif
  636. //@}
  637. /*! @name Register ENET_EIMR, field RXB[24] (RW)
  638. *
  639. * Corresponds to interrupt source RXB defined by the EIR register and determines whether an
  640. * interrupt condition can generate an interrupt. At every module clock, the EIR samples the signal
  641. * generated by the interrupting source. The corresponding EIR RXB field reflects the state of the
  642. * interrupt signal even if the corresponding EIMR field is cleared.
  643. */
  644. //@{
  645. #define BP_ENET_EIMR_RXB (24) //!< Bit position for ENET_EIMR_RXB.
  646. #define BM_ENET_EIMR_RXB (0x01000000) //!< Bit mask for ENET_EIMR_RXB.
  647. //! @brief Get value of ENET_EIMR_RXB from a register value.
  648. #define BG_ENET_EIMR_RXB(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIMR_RXB) >> BP_ENET_EIMR_RXB)
  649. //! @brief Format value for bitfield ENET_EIMR_RXB.
  650. #define BF_ENET_EIMR_RXB(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIMR_RXB) & BM_ENET_EIMR_RXB)
  651. #ifndef __LANGUAGE_ASM__
  652. //! @brief Set the RXB field to a new value.
  653. #define BW_ENET_EIMR_RXB(v) (HW_ENET_EIMR_WR((HW_ENET_EIMR_RD() & ~BM_ENET_EIMR_RXB) | BF_ENET_EIMR_RXB(v)))
  654. #endif
  655. //@}
  656. /*! @name Register ENET_EIMR, field RXF[25] (RW)
  657. *
  658. * Corresponds to interrupt source RXF defined by the EIR register and determines whether an
  659. * interrupt condition can generate an interrupt. At every module clock, the EIR samples the signal
  660. * generated by the interrupting source. The corresponding EIR RXF field reflects the state of the
  661. * interrupt signal even if the corresponding EIMR field is cleared.
  662. */
  663. //@{
  664. #define BP_ENET_EIMR_RXF (25) //!< Bit position for ENET_EIMR_RXF.
  665. #define BM_ENET_EIMR_RXF (0x02000000) //!< Bit mask for ENET_EIMR_RXF.
  666. //! @brief Get value of ENET_EIMR_RXF from a register value.
  667. #define BG_ENET_EIMR_RXF(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIMR_RXF) >> BP_ENET_EIMR_RXF)
  668. //! @brief Format value for bitfield ENET_EIMR_RXF.
  669. #define BF_ENET_EIMR_RXF(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIMR_RXF) & BM_ENET_EIMR_RXF)
  670. #ifndef __LANGUAGE_ASM__
  671. //! @brief Set the RXF field to a new value.
  672. #define BW_ENET_EIMR_RXF(v) (HW_ENET_EIMR_WR((HW_ENET_EIMR_RD() & ~BM_ENET_EIMR_RXF) | BF_ENET_EIMR_RXF(v)))
  673. #endif
  674. //@}
  675. /*! @name Register ENET_EIMR, field TXB[26] (RW)
  676. *
  677. * Corresponds to interrupt source TXB defined by the EIR register and determines whether an
  678. * interrupt condition can generate an interrupt. At every module clock, the EIR samples the signal
  679. * generated by the interrupting source. The corresponding EIR TXF field reflects the state of the
  680. * interrupt signal even if the corresponding EIMR field is cleared.
  681. *
  682. * Values:
  683. * - 0 - The corresponding interrupt source is masked.
  684. * - 1 - The corresponding interrupt source is not masked.
  685. */
  686. //@{
  687. #define BP_ENET_EIMR_TXB (26) //!< Bit position for ENET_EIMR_TXB.
  688. #define BM_ENET_EIMR_TXB (0x04000000) //!< Bit mask for ENET_EIMR_TXB.
  689. //! @brief Get value of ENET_EIMR_TXB from a register value.
  690. #define BG_ENET_EIMR_TXB(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIMR_TXB) >> BP_ENET_EIMR_TXB)
  691. //! @brief Format value for bitfield ENET_EIMR_TXB.
  692. #define BF_ENET_EIMR_TXB(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIMR_TXB) & BM_ENET_EIMR_TXB)
  693. #ifndef __LANGUAGE_ASM__
  694. //! @brief Set the TXB field to a new value.
  695. #define BW_ENET_EIMR_TXB(v) (HW_ENET_EIMR_WR((HW_ENET_EIMR_RD() & ~BM_ENET_EIMR_TXB) | BF_ENET_EIMR_TXB(v)))
  696. #endif
  697. //@}
  698. /*! @name Register ENET_EIMR, field TXF[27] (RW)
  699. *
  700. * Corresponds to interrupt source TXF defined by the EIR register and determines whether an
  701. * interrupt condition can generate an interrupt. At every module clock, the EIR samples the signal
  702. * generated by the interrupting source. The corresponding EIR TXF field reflects the state of the
  703. * interrupt signal even if the corresponding EIMR field is cleared.
  704. *
  705. * Values:
  706. * - 0 - The corresponding interrupt source is masked.
  707. * - 1 - The corresponding interrupt source is not masked.
  708. */
  709. //@{
  710. #define BP_ENET_EIMR_TXF (27) //!< Bit position for ENET_EIMR_TXF.
  711. #define BM_ENET_EIMR_TXF (0x08000000) //!< Bit mask for ENET_EIMR_TXF.
  712. //! @brief Get value of ENET_EIMR_TXF from a register value.
  713. #define BG_ENET_EIMR_TXF(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIMR_TXF) >> BP_ENET_EIMR_TXF)
  714. //! @brief Format value for bitfield ENET_EIMR_TXF.
  715. #define BF_ENET_EIMR_TXF(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIMR_TXF) & BM_ENET_EIMR_TXF)
  716. #ifndef __LANGUAGE_ASM__
  717. //! @brief Set the TXF field to a new value.
  718. #define BW_ENET_EIMR_TXF(v) (HW_ENET_EIMR_WR((HW_ENET_EIMR_RD() & ~BM_ENET_EIMR_TXF) | BF_ENET_EIMR_TXF(v)))
  719. #endif
  720. //@}
  721. /*! @name Register ENET_EIMR, field GRA[28] (RW)
  722. *
  723. * Corresponds to interrupt source GRA defined by the EIR register and determines whether an
  724. * interrupt condition can generate an interrupt. At every module clock, the EIR samples the signal
  725. * generated by the interrupting source. The corresponding EIR GRA field reflects the state of the
  726. * interrupt signal even if the corresponding EIMR field is cleared.
  727. *
  728. * Values:
  729. * - 0 - The corresponding interrupt source is masked.
  730. * - 1 - The corresponding interrupt source is not masked.
  731. */
  732. //@{
  733. #define BP_ENET_EIMR_GRA (28) //!< Bit position for ENET_EIMR_GRA.
  734. #define BM_ENET_EIMR_GRA (0x10000000) //!< Bit mask for ENET_EIMR_GRA.
  735. //! @brief Get value of ENET_EIMR_GRA from a register value.
  736. #define BG_ENET_EIMR_GRA(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIMR_GRA) >> BP_ENET_EIMR_GRA)
  737. //! @brief Format value for bitfield ENET_EIMR_GRA.
  738. #define BF_ENET_EIMR_GRA(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIMR_GRA) & BM_ENET_EIMR_GRA)
  739. #ifndef __LANGUAGE_ASM__
  740. //! @brief Set the GRA field to a new value.
  741. #define BW_ENET_EIMR_GRA(v) (HW_ENET_EIMR_WR((HW_ENET_EIMR_RD() & ~BM_ENET_EIMR_GRA) | BF_ENET_EIMR_GRA(v)))
  742. #endif
  743. //@}
  744. /*! @name Register ENET_EIMR, field BABT[29] (RW)
  745. *
  746. * Corresponds to interrupt source BABT defined by the EIR register and determines whether an
  747. * interrupt condition can generate an interrupt. At every module clock, the EIR samples the signal
  748. * generated by the interrupting source. The corresponding EIR BABT field reflects the state of the
  749. * interrupt signal even if the corresponding EIMR field is cleared.
  750. *
  751. * Values:
  752. * - 0 - The corresponding interrupt source is masked.
  753. * - 1 - The corresponding interrupt source is not masked.
  754. */
  755. //@{
  756. #define BP_ENET_EIMR_BABT (29) //!< Bit position for ENET_EIMR_BABT.
  757. #define BM_ENET_EIMR_BABT (0x20000000) //!< Bit mask for ENET_EIMR_BABT.
  758. //! @brief Get value of ENET_EIMR_BABT from a register value.
  759. #define BG_ENET_EIMR_BABT(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIMR_BABT) >> BP_ENET_EIMR_BABT)
  760. //! @brief Format value for bitfield ENET_EIMR_BABT.
  761. #define BF_ENET_EIMR_BABT(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIMR_BABT) & BM_ENET_EIMR_BABT)
  762. #ifndef __LANGUAGE_ASM__
  763. //! @brief Set the BABT field to a new value.
  764. #define BW_ENET_EIMR_BABT(v) (HW_ENET_EIMR_WR((HW_ENET_EIMR_RD() & ~BM_ENET_EIMR_BABT) | BF_ENET_EIMR_BABT(v)))
  765. #endif
  766. //@}
  767. /*! @name Register ENET_EIMR, field BABR[30] (RW)
  768. *
  769. * Corresponds to interrupt source BABR defined by the EIR register and determines whether an
  770. * interrupt condition can generate an interrupt. At every module clock, the EIR samples the signal
  771. * generated by the interrupting source. The corresponding EIR BABR field reflects the state of the
  772. * interrupt signal even if the corresponding EIMR field is cleared.
  773. *
  774. * Values:
  775. * - 0 - The corresponding interrupt source is masked.
  776. * - 1 - The corresponding interrupt source is not masked.
  777. */
  778. //@{
  779. #define BP_ENET_EIMR_BABR (30) //!< Bit position for ENET_EIMR_BABR.
  780. #define BM_ENET_EIMR_BABR (0x40000000) //!< Bit mask for ENET_EIMR_BABR.
  781. //! @brief Get value of ENET_EIMR_BABR from a register value.
  782. #define BG_ENET_EIMR_BABR(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_EIMR_BABR) >> BP_ENET_EIMR_BABR)
  783. //! @brief Format value for bitfield ENET_EIMR_BABR.
  784. #define BF_ENET_EIMR_BABR(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_EIMR_BABR) & BM_ENET_EIMR_BABR)
  785. #ifndef __LANGUAGE_ASM__
  786. //! @brief Set the BABR field to a new value.
  787. #define BW_ENET_EIMR_BABR(v) (HW_ENET_EIMR_WR((HW_ENET_EIMR_RD() & ~BM_ENET_EIMR_BABR) | BF_ENET_EIMR_BABR(v)))
  788. #endif
  789. //@}
  790. //-------------------------------------------------------------------------------------------
  791. // HW_ENET_RDAR - Receive Descriptor Active Register
  792. //-------------------------------------------------------------------------------------------
  793. #ifndef __LANGUAGE_ASM__
  794. /*!
  795. * @brief HW_ENET_RDAR - Receive Descriptor Active Register (RW)
  796. *
  797. * Reset value: 0x00000000
  798. *
  799. * RDAR is a command register, written by the user, to indicate that the receive descriptor ring has
  800. * been updated, that is, that the driver produced empty receive buffers with the empty bit set.
  801. */
  802. typedef union _hw_enet_rdar
  803. {
  804. reg32_t U;
  805. struct _hw_enet_rdar_bitfields
  806. {
  807. unsigned RESERVED0 : 24; //!< [23:0]
  808. unsigned RDAR : 1; //!< [24] Receive Descriptor Active
  809. unsigned RESERVED1 : 7; //!< [31:25]
  810. } B;
  811. } hw_enet_rdar_t;
  812. #endif
  813. /*!
  814. * @name Constants and macros for entire ENET_RDAR register
  815. */
  816. //@{
  817. #define HW_ENET_RDAR_ADDR (REGS_ENET_BASE + 0x10)
  818. #ifndef __LANGUAGE_ASM__
  819. #define HW_ENET_RDAR (*(volatile hw_enet_rdar_t *) HW_ENET_RDAR_ADDR)
  820. #define HW_ENET_RDAR_RD() (HW_ENET_RDAR.U)
  821. #define HW_ENET_RDAR_WR(v) (HW_ENET_RDAR.U = (v))
  822. #define HW_ENET_RDAR_SET(v) (HW_ENET_RDAR_WR(HW_ENET_RDAR_RD() | (v)))
  823. #define HW_ENET_RDAR_CLR(v) (HW_ENET_RDAR_WR(HW_ENET_RDAR_RD() & ~(v)))
  824. #define HW_ENET_RDAR_TOG(v) (HW_ENET_RDAR_WR(HW_ENET_RDAR_RD() ^ (v)))
  825. #endif
  826. //@}
  827. /*
  828. * constants & macros for individual ENET_RDAR bitfields
  829. */
  830. /*! @name Register ENET_RDAR, field RDAR[24] (RW)
  831. *
  832. * Always set to 1 when this register is written, regardless of the value written. This field is
  833. * cleared by the MAC device when no additional empty descriptors remain in the receive ring. It is
  834. * also cleared when ECR[ETHEREN] transitions from set to cleared or when ECR[RESET] is set.
  835. */
  836. //@{
  837. #define BP_ENET_RDAR_RDAR (24) //!< Bit position for ENET_RDAR_RDAR.
  838. #define BM_ENET_RDAR_RDAR (0x01000000) //!< Bit mask for ENET_RDAR_RDAR.
  839. //! @brief Get value of ENET_RDAR_RDAR from a register value.
  840. #define BG_ENET_RDAR_RDAR(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_RDAR_RDAR) >> BP_ENET_RDAR_RDAR)
  841. //! @brief Format value for bitfield ENET_RDAR_RDAR.
  842. #define BF_ENET_RDAR_RDAR(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_RDAR_RDAR) & BM_ENET_RDAR_RDAR)
  843. #ifndef __LANGUAGE_ASM__
  844. //! @brief Set the RDAR field to a new value.
  845. #define BW_ENET_RDAR_RDAR(v) (HW_ENET_RDAR_WR((HW_ENET_RDAR_RD() & ~BM_ENET_RDAR_RDAR) | BF_ENET_RDAR_RDAR(v)))
  846. #endif
  847. //@}
  848. //-------------------------------------------------------------------------------------------
  849. // HW_ENET_TDAR - Transmit Descriptor Active Register
  850. //-------------------------------------------------------------------------------------------
  851. #ifndef __LANGUAGE_ASM__
  852. /*!
  853. * @brief HW_ENET_TDAR - Transmit Descriptor Active Register (RW)
  854. *
  855. * Reset value: 0x00000000
  856. *
  857. * The TDAR is a command register that the user writes to indicate that the transmit descriptor ring
  858. * has been updated, that is, that transmit buffers have been produced by the driver with the ready
  859. * bit set in the buffer descriptor. The TDAR register is cleared at reset, when ECR[ETHEREN]
  860. * transitions from set to cleared, or when ECR[RESET] is set.
  861. */
  862. typedef union _hw_enet_tdar
  863. {
  864. reg32_t U;
  865. struct _hw_enet_tdar_bitfields
  866. {
  867. unsigned RESERVED0 : 24; //!< [23:0]
  868. unsigned TDAR : 1; //!< [24] Transmit Descriptor Active
  869. unsigned RESERVED1 : 7; //!< [31:25]
  870. } B;
  871. } hw_enet_tdar_t;
  872. #endif
  873. /*!
  874. * @name Constants and macros for entire ENET_TDAR register
  875. */
  876. //@{
  877. #define HW_ENET_TDAR_ADDR (REGS_ENET_BASE + 0x14)
  878. #ifndef __LANGUAGE_ASM__
  879. #define HW_ENET_TDAR (*(volatile hw_enet_tdar_t *) HW_ENET_TDAR_ADDR)
  880. #define HW_ENET_TDAR_RD() (HW_ENET_TDAR.U)
  881. #define HW_ENET_TDAR_WR(v) (HW_ENET_TDAR.U = (v))
  882. #define HW_ENET_TDAR_SET(v) (HW_ENET_TDAR_WR(HW_ENET_TDAR_RD() | (v)))
  883. #define HW_ENET_TDAR_CLR(v) (HW_ENET_TDAR_WR(HW_ENET_TDAR_RD() & ~(v)))
  884. #define HW_ENET_TDAR_TOG(v) (HW_ENET_TDAR_WR(HW_ENET_TDAR_RD() ^ (v)))
  885. #endif
  886. //@}
  887. /*
  888. * constants & macros for individual ENET_TDAR bitfields
  889. */
  890. /*! @name Register ENET_TDAR, field TDAR[24] (RW)
  891. *
  892. * Always set to 1 when this register is written, regardless of the value written. This bit is
  893. * cleared by the MAC device when no additional ready descriptors remain in the transmit ring. Also
  894. * cleared when ECR[ETHEREN] transitions from set to cleared or when ECR[RESET] is set.
  895. */
  896. //@{
  897. #define BP_ENET_TDAR_TDAR (24) //!< Bit position for ENET_TDAR_TDAR.
  898. #define BM_ENET_TDAR_TDAR (0x01000000) //!< Bit mask for ENET_TDAR_TDAR.
  899. //! @brief Get value of ENET_TDAR_TDAR from a register value.
  900. #define BG_ENET_TDAR_TDAR(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_TDAR_TDAR) >> BP_ENET_TDAR_TDAR)
  901. //! @brief Format value for bitfield ENET_TDAR_TDAR.
  902. #define BF_ENET_TDAR_TDAR(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_TDAR_TDAR) & BM_ENET_TDAR_TDAR)
  903. #ifndef __LANGUAGE_ASM__
  904. //! @brief Set the TDAR field to a new value.
  905. #define BW_ENET_TDAR_TDAR(v) (HW_ENET_TDAR_WR((HW_ENET_TDAR_RD() & ~BM_ENET_TDAR_TDAR) | BF_ENET_TDAR_TDAR(v)))
  906. #endif
  907. //@}
  908. //-------------------------------------------------------------------------------------------
  909. // HW_ENET_ECR - Ethernet Control Register
  910. //-------------------------------------------------------------------------------------------
  911. #ifndef __LANGUAGE_ASM__
  912. /*!
  913. * @brief HW_ENET_ECR - Ethernet Control Register (RW)
  914. *
  915. * Reset value: 0xf0000000
  916. *
  917. * ECR is a read/write user register, though hardware may also alter fields in this register. It
  918. * controls many of the high level features of the Ethernet MAC, including legacy FEC support
  919. * through the EN1588 field.
  920. */
  921. typedef union _hw_enet_ecr
  922. {
  923. reg32_t U;
  924. struct _hw_enet_ecr_bitfields
  925. {
  926. unsigned RESET : 1; //!< [0] Ethernet MAC Reset
  927. unsigned ETHEREN : 1; //!< [1] Ethernet Enable
  928. unsigned MAGICEN : 1; //!< [2] Magic Packet Detection Enable
  929. unsigned SLEEP : 1; //!< [3] Sleep Mode Enable
  930. unsigned EN1588 : 1; //!< [4] EN1588 Enable
  931. unsigned RESERVED0 : 1; //!< [5] Reserved.
  932. unsigned DBGEN : 1; //!< [6] Debug Enable
  933. unsigned STOPEN : 1; //!< [7] STOPEN Signal Control
  934. unsigned RESERVED1 : 24; //!< [31:8] Reserved.
  935. } B;
  936. } hw_enet_ecr_t;
  937. #endif
  938. /*!
  939. * @name Constants and macros for entire ENET_ECR register
  940. */
  941. //@{
  942. #define HW_ENET_ECR_ADDR (REGS_ENET_BASE + 0x24)
  943. #ifndef __LANGUAGE_ASM__
  944. #define HW_ENET_ECR (*(volatile hw_enet_ecr_t *) HW_ENET_ECR_ADDR)
  945. #define HW_ENET_ECR_RD() (HW_ENET_ECR.U)
  946. #define HW_ENET_ECR_WR(v) (HW_ENET_ECR.U = (v))
  947. #define HW_ENET_ECR_SET(v) (HW_ENET_ECR_WR(HW_ENET_ECR_RD() | (v)))
  948. #define HW_ENET_ECR_CLR(v) (HW_ENET_ECR_WR(HW_ENET_ECR_RD() & ~(v)))
  949. #define HW_ENET_ECR_TOG(v) (HW_ENET_ECR_WR(HW_ENET_ECR_RD() ^ (v)))
  950. #endif
  951. //@}
  952. /*
  953. * constants & macros for individual ENET_ECR bitfields
  954. */
  955. /*! @name Register ENET_ECR, field RESET[0] (RW)
  956. *
  957. * When this field is set, it clears the ETHEREN field.
  958. */
  959. //@{
  960. #define BP_ENET_ECR_RESET (0) //!< Bit position for ENET_ECR_RESET.
  961. #define BM_ENET_ECR_RESET (0x00000001) //!< Bit mask for ENET_ECR_RESET.
  962. //! @brief Get value of ENET_ECR_RESET from a register value.
  963. #define BG_ENET_ECR_RESET(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_ECR_RESET) >> BP_ENET_ECR_RESET)
  964. //! @brief Format value for bitfield ENET_ECR_RESET.
  965. #define BF_ENET_ECR_RESET(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_ECR_RESET) & BM_ENET_ECR_RESET)
  966. #ifndef __LANGUAGE_ASM__
  967. //! @brief Set the RESET field to a new value.
  968. #define BW_ENET_ECR_RESET(v) (HW_ENET_ECR_WR((HW_ENET_ECR_RD() & ~BM_ENET_ECR_RESET) | BF_ENET_ECR_RESET(v)))
  969. #endif
  970. //@}
  971. /*! @name Register ENET_ECR, field ETHEREN[1] (RW)
  972. *
  973. * Enables/disables the Ethernet MAC. When the MAC is disabled, the buffer descriptors for an
  974. * aborted transmit frame are not updated. The uDMA, buffer descriptor, and FIFO control logic are
  975. * reset, including the buffer descriptor and FIFO pointers. Hardware clears this field under the
  976. * following conditions: RESET is set by software An error condition causes the EBERR field to set.
  977. * ETHEREN must be set at the very last step during ENET configuration/setup/initialization, only
  978. * after all other ENET-related registers have been configured.
  979. *
  980. * Values:
  981. * - 0 - Reception immediately stops and transmission stops after a bad CRC is appended to any currently
  982. * transmitted frame.
  983. * - 1 - MAC is enabled, and reception and transmission are possible.
  984. */
  985. //@{
  986. #define BP_ENET_ECR_ETHEREN (1) //!< Bit position for ENET_ECR_ETHEREN.
  987. #define BM_ENET_ECR_ETHEREN (0x00000002) //!< Bit mask for ENET_ECR_ETHEREN.
  988. //! @brief Get value of ENET_ECR_ETHEREN from a register value.
  989. #define BG_ENET_ECR_ETHEREN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_ECR_ETHEREN) >> BP_ENET_ECR_ETHEREN)
  990. //! @brief Format value for bitfield ENET_ECR_ETHEREN.
  991. #define BF_ENET_ECR_ETHEREN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_ECR_ETHEREN) & BM_ENET_ECR_ETHEREN)
  992. #ifndef __LANGUAGE_ASM__
  993. //! @brief Set the ETHEREN field to a new value.
  994. #define BW_ENET_ECR_ETHEREN(v) (HW_ENET_ECR_WR((HW_ENET_ECR_RD() & ~BM_ENET_ECR_ETHEREN) | BF_ENET_ECR_ETHEREN(v)))
  995. #endif
  996. //@}
  997. /*! @name Register ENET_ECR, field MAGICEN[2] (RW)
  998. *
  999. * Enables/disables magic packet detection. MAGICEN is relevant only if the SLEEP field is set. If
  1000. * MAGICEN is set, changing the SLEEP field enables/disables sleep mode and magic packet detection.
  1001. *
  1002. * Values:
  1003. * - 0 - Magic detection logic disabled.
  1004. * - 1 - The MAC core detects magic packets and asserts EIR[WAKEUP] when a frame is detected.
  1005. */
  1006. //@{
  1007. #define BP_ENET_ECR_MAGICEN (2) //!< Bit position for ENET_ECR_MAGICEN.
  1008. #define BM_ENET_ECR_MAGICEN (0x00000004) //!< Bit mask for ENET_ECR_MAGICEN.
  1009. //! @brief Get value of ENET_ECR_MAGICEN from a register value.
  1010. #define BG_ENET_ECR_MAGICEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_ECR_MAGICEN) >> BP_ENET_ECR_MAGICEN)
  1011. //! @brief Format value for bitfield ENET_ECR_MAGICEN.
  1012. #define BF_ENET_ECR_MAGICEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_ECR_MAGICEN) & BM_ENET_ECR_MAGICEN)
  1013. #ifndef __LANGUAGE_ASM__
  1014. //! @brief Set the MAGICEN field to a new value.
  1015. #define BW_ENET_ECR_MAGICEN(v) (HW_ENET_ECR_WR((HW_ENET_ECR_RD() & ~BM_ENET_ECR_MAGICEN) | BF_ENET_ECR_MAGICEN(v)))
  1016. #endif
  1017. //@}
  1018. /*! @name Register ENET_ECR, field SLEEP[3] (RW)
  1019. *
  1020. * Values:
  1021. * - 0 - Normal operating mode.
  1022. * - 1 - Sleep mode.
  1023. */
  1024. //@{
  1025. #define BP_ENET_ECR_SLEEP (3) //!< Bit position for ENET_ECR_SLEEP.
  1026. #define BM_ENET_ECR_SLEEP (0x00000008) //!< Bit mask for ENET_ECR_SLEEP.
  1027. //! @brief Get value of ENET_ECR_SLEEP from a register value.
  1028. #define BG_ENET_ECR_SLEEP(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_ECR_SLEEP) >> BP_ENET_ECR_SLEEP)
  1029. //! @brief Format value for bitfield ENET_ECR_SLEEP.
  1030. #define BF_ENET_ECR_SLEEP(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_ECR_SLEEP) & BM_ENET_ECR_SLEEP)
  1031. #ifndef __LANGUAGE_ASM__
  1032. //! @brief Set the SLEEP field to a new value.
  1033. #define BW_ENET_ECR_SLEEP(v) (HW_ENET_ECR_WR((HW_ENET_ECR_RD() & ~BM_ENET_ECR_SLEEP) | BF_ENET_ECR_SLEEP(v)))
  1034. #endif
  1035. //@}
  1036. /*! @name Register ENET_ECR, field EN1588[4] (RW)
  1037. *
  1038. * Enables enhanced functionality of the MAC.
  1039. *
  1040. * Values:
  1041. * - 0 - Legacy FEC buffer descriptors and functions enabled.
  1042. * - 1 - Enhanced frame time-stamping functions enabled.
  1043. */
  1044. //@{
  1045. #define BP_ENET_ECR_EN1588 (4) //!< Bit position for ENET_ECR_EN1588.
  1046. #define BM_ENET_ECR_EN1588 (0x00000010) //!< Bit mask for ENET_ECR_EN1588.
  1047. //! @brief Get value of ENET_ECR_EN1588 from a register value.
  1048. #define BG_ENET_ECR_EN1588(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_ECR_EN1588) >> BP_ENET_ECR_EN1588)
  1049. //! @brief Format value for bitfield ENET_ECR_EN1588.
  1050. #define BF_ENET_ECR_EN1588(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_ECR_EN1588) & BM_ENET_ECR_EN1588)
  1051. #ifndef __LANGUAGE_ASM__
  1052. //! @brief Set the EN1588 field to a new value.
  1053. #define BW_ENET_ECR_EN1588(v) (HW_ENET_ECR_WR((HW_ENET_ECR_RD() & ~BM_ENET_ECR_EN1588) | BF_ENET_ECR_EN1588(v)))
  1054. #endif
  1055. //@}
  1056. /*! @name Register ENET_ECR, field DBGEN[6] (RW)
  1057. *
  1058. * Enables the MAC to enter hardware freeze mode when the device enters debug mode.
  1059. *
  1060. * Values:
  1061. * - 0 - MAC continues operation in debug mode.
  1062. * - 1 - MAC enters hardware freeze mode when the processor is in debug mode.
  1063. */
  1064. //@{
  1065. #define BP_ENET_ECR_DBGEN (6) //!< Bit position for ENET_ECR_DBGEN.
  1066. #define BM_ENET_ECR_DBGEN (0x00000040) //!< Bit mask for ENET_ECR_DBGEN.
  1067. //! @brief Get value of ENET_ECR_DBGEN from a register value.
  1068. #define BG_ENET_ECR_DBGEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_ECR_DBGEN) >> BP_ENET_ECR_DBGEN)
  1069. //! @brief Format value for bitfield ENET_ECR_DBGEN.
  1070. #define BF_ENET_ECR_DBGEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_ECR_DBGEN) & BM_ENET_ECR_DBGEN)
  1071. #ifndef __LANGUAGE_ASM__
  1072. //! @brief Set the DBGEN field to a new value.
  1073. #define BW_ENET_ECR_DBGEN(v) (HW_ENET_ECR_WR((HW_ENET_ECR_RD() & ~BM_ENET_ECR_DBGEN) | BF_ENET_ECR_DBGEN(v)))
  1074. #endif
  1075. //@}
  1076. /*! @name Register ENET_ECR, field STOPEN[7] (RW)
  1077. *
  1078. * Controls device behavior in doze mode. In doze mode, if this field is set then all the clocks of
  1079. * the ENET assembly are disabled, except the RMII clock. Doze mode is similar to a conditional stop
  1080. * mode entry for the ENET assembly depending on ECR[STOPEN]. If module clocks are gated in this
  1081. * mode, the module can still wake the system after receiving a magic packet in stop mode. MAGICEN
  1082. * must be set prior to entering sleep/stop mode.
  1083. */
  1084. //@{
  1085. #define BP_ENET_ECR_STOPEN (7) //!< Bit position for ENET_ECR_STOPEN.
  1086. #define BM_ENET_ECR_STOPEN (0x00000080) //!< Bit mask for ENET_ECR_STOPEN.
  1087. //! @brief Get value of ENET_ECR_STOPEN from a register value.
  1088. #define BG_ENET_ECR_STOPEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_ECR_STOPEN) >> BP_ENET_ECR_STOPEN)
  1089. //! @brief Format value for bitfield ENET_ECR_STOPEN.
  1090. #define BF_ENET_ECR_STOPEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_ECR_STOPEN) & BM_ENET_ECR_STOPEN)
  1091. #ifndef __LANGUAGE_ASM__
  1092. //! @brief Set the STOPEN field to a new value.
  1093. #define BW_ENET_ECR_STOPEN(v) (HW_ENET_ECR_WR((HW_ENET_ECR_RD() & ~BM_ENET_ECR_STOPEN) | BF_ENET_ECR_STOPEN(v)))
  1094. #endif
  1095. //@}
  1096. //-------------------------------------------------------------------------------------------
  1097. // HW_ENET_MMFR - MII Management Frame Register
  1098. //-------------------------------------------------------------------------------------------
  1099. #ifndef __LANGUAGE_ASM__
  1100. /*!
  1101. * @brief HW_ENET_MMFR - MII Management Frame Register (RW)
  1102. *
  1103. * Reset value: 0x00000000
  1104. *
  1105. * Writing to MMFR triggers a management frame transaction to the PHY device unless MSCR is
  1106. * programmed to zero. If MSCR is changed from zero to non-zero during a write to MMFR, an MII frame
  1107. * is generated with the data previously written to the MMFR. This allows MMFR and MSCR to be
  1108. * programmed in either order if MSCR is currently zero. If the MMFR register is written while frame
  1109. * generation is in progress, the frame contents are altered. Software must use the EIR[MII]
  1110. * interrupt indication to avoid writing to the MMFR register while frame generation is in progress.
  1111. */
  1112. typedef union _hw_enet_mmfr
  1113. {
  1114. reg32_t U;
  1115. struct _hw_enet_mmfr_bitfields
  1116. {
  1117. unsigned DATA : 16; //!< [15:0] Management Frame Data
  1118. unsigned TA : 2; //!< [17:16] Turn Around
  1119. unsigned RA : 5; //!< [22:18] Register Address
  1120. unsigned PA : 5; //!< [27:23] PHY Address
  1121. unsigned OP : 2; //!< [29:28] Operation Code
  1122. unsigned ST : 2; //!< [31:30] Start Of Frame Delimiter
  1123. } B;
  1124. } hw_enet_mmfr_t;
  1125. #endif
  1126. /*!
  1127. * @name Constants and macros for entire ENET_MMFR register
  1128. */
  1129. //@{
  1130. #define HW_ENET_MMFR_ADDR (REGS_ENET_BASE + 0x40)
  1131. #ifndef __LANGUAGE_ASM__
  1132. #define HW_ENET_MMFR (*(volatile hw_enet_mmfr_t *) HW_ENET_MMFR_ADDR)
  1133. #define HW_ENET_MMFR_RD() (HW_ENET_MMFR.U)
  1134. #define HW_ENET_MMFR_WR(v) (HW_ENET_MMFR.U = (v))
  1135. #define HW_ENET_MMFR_SET(v) (HW_ENET_MMFR_WR(HW_ENET_MMFR_RD() | (v)))
  1136. #define HW_ENET_MMFR_CLR(v) (HW_ENET_MMFR_WR(HW_ENET_MMFR_RD() & ~(v)))
  1137. #define HW_ENET_MMFR_TOG(v) (HW_ENET_MMFR_WR(HW_ENET_MMFR_RD() ^ (v)))
  1138. #endif
  1139. //@}
  1140. /*
  1141. * constants & macros for individual ENET_MMFR bitfields
  1142. */
  1143. /*! @name Register ENET_MMFR, field DATA[15:0] (RW)
  1144. *
  1145. * This is the field for data to be written to or read from the PHY register.
  1146. */
  1147. //@{
  1148. #define BP_ENET_MMFR_DATA (0) //!< Bit position for ENET_MMFR_DATA.
  1149. #define BM_ENET_MMFR_DATA (0x0000ffff) //!< Bit mask for ENET_MMFR_DATA.
  1150. //! @brief Get value of ENET_MMFR_DATA from a register value.
  1151. #define BG_ENET_MMFR_DATA(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_MMFR_DATA) >> BP_ENET_MMFR_DATA)
  1152. //! @brief Format value for bitfield ENET_MMFR_DATA.
  1153. #define BF_ENET_MMFR_DATA(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_MMFR_DATA) & BM_ENET_MMFR_DATA)
  1154. #ifndef __LANGUAGE_ASM__
  1155. //! @brief Set the DATA field to a new value.
  1156. #define BW_ENET_MMFR_DATA(v) (HW_ENET_MMFR_WR((HW_ENET_MMFR_RD() & ~BM_ENET_MMFR_DATA) | BF_ENET_MMFR_DATA(v)))
  1157. #endif
  1158. //@}
  1159. /*! @name Register ENET_MMFR, field TA[17:16] (RW)
  1160. *
  1161. * This field must be programmed to 10 to generate a valid MII management frame.
  1162. */
  1163. //@{
  1164. #define BP_ENET_MMFR_TA (16) //!< Bit position for ENET_MMFR_TA.
  1165. #define BM_ENET_MMFR_TA (0x00030000) //!< Bit mask for ENET_MMFR_TA.
  1166. //! @brief Get value of ENET_MMFR_TA from a register value.
  1167. #define BG_ENET_MMFR_TA(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_MMFR_TA) >> BP_ENET_MMFR_TA)
  1168. //! @brief Format value for bitfield ENET_MMFR_TA.
  1169. #define BF_ENET_MMFR_TA(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_MMFR_TA) & BM_ENET_MMFR_TA)
  1170. #ifndef __LANGUAGE_ASM__
  1171. //! @brief Set the TA field to a new value.
  1172. #define BW_ENET_MMFR_TA(v) (HW_ENET_MMFR_WR((HW_ENET_MMFR_RD() & ~BM_ENET_MMFR_TA) | BF_ENET_MMFR_TA(v)))
  1173. #endif
  1174. //@}
  1175. /*! @name Register ENET_MMFR, field RA[22:18] (RW)
  1176. *
  1177. * Specifies one of up to 32 registers within the specified PHY device.
  1178. */
  1179. //@{
  1180. #define BP_ENET_MMFR_RA (18) //!< Bit position for ENET_MMFR_RA.
  1181. #define BM_ENET_MMFR_RA (0x007c0000) //!< Bit mask for ENET_MMFR_RA.
  1182. //! @brief Get value of ENET_MMFR_RA from a register value.
  1183. #define BG_ENET_MMFR_RA(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_MMFR_RA) >> BP_ENET_MMFR_RA)
  1184. //! @brief Format value for bitfield ENET_MMFR_RA.
  1185. #define BF_ENET_MMFR_RA(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_MMFR_RA) & BM_ENET_MMFR_RA)
  1186. #ifndef __LANGUAGE_ASM__
  1187. //! @brief Set the RA field to a new value.
  1188. #define BW_ENET_MMFR_RA(v) (HW_ENET_MMFR_WR((HW_ENET_MMFR_RD() & ~BM_ENET_MMFR_RA) | BF_ENET_MMFR_RA(v)))
  1189. #endif
  1190. //@}
  1191. /*! @name Register ENET_MMFR, field PA[27:23] (RW)
  1192. *
  1193. * Specifies one of up to 32 attached PHY devices.
  1194. */
  1195. //@{
  1196. #define BP_ENET_MMFR_PA (23) //!< Bit position for ENET_MMFR_PA.
  1197. #define BM_ENET_MMFR_PA (0x0f800000) //!< Bit mask for ENET_MMFR_PA.
  1198. //! @brief Get value of ENET_MMFR_PA from a register value.
  1199. #define BG_ENET_MMFR_PA(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_MMFR_PA) >> BP_ENET_MMFR_PA)
  1200. //! @brief Format value for bitfield ENET_MMFR_PA.
  1201. #define BF_ENET_MMFR_PA(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_MMFR_PA) & BM_ENET_MMFR_PA)
  1202. #ifndef __LANGUAGE_ASM__
  1203. //! @brief Set the PA field to a new value.
  1204. #define BW_ENET_MMFR_PA(v) (HW_ENET_MMFR_WR((HW_ENET_MMFR_RD() & ~BM_ENET_MMFR_PA) | BF_ENET_MMFR_PA(v)))
  1205. #endif
  1206. //@}
  1207. /*! @name Register ENET_MMFR, field OP[29:28] (RW)
  1208. *
  1209. * Determines the frame operation.
  1210. *
  1211. * Values:
  1212. * - 00 - Write frame operation, but not MII compliant.
  1213. * - 01 - Write frame operation for a valid MII management frame.
  1214. * - 10 - Read frame operation for a valid MII management frame.
  1215. * - 11 - Read frame operation, but not MII compliant.
  1216. */
  1217. //@{
  1218. #define BP_ENET_MMFR_OP (28) //!< Bit position for ENET_MMFR_OP.
  1219. #define BM_ENET_MMFR_OP (0x30000000) //!< Bit mask for ENET_MMFR_OP.
  1220. //! @brief Get value of ENET_MMFR_OP from a register value.
  1221. #define BG_ENET_MMFR_OP(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_MMFR_OP) >> BP_ENET_MMFR_OP)
  1222. //! @brief Format value for bitfield ENET_MMFR_OP.
  1223. #define BF_ENET_MMFR_OP(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_MMFR_OP) & BM_ENET_MMFR_OP)
  1224. #ifndef __LANGUAGE_ASM__
  1225. //! @brief Set the OP field to a new value.
  1226. #define BW_ENET_MMFR_OP(v) (HW_ENET_MMFR_WR((HW_ENET_MMFR_RD() & ~BM_ENET_MMFR_OP) | BF_ENET_MMFR_OP(v)))
  1227. #endif
  1228. //@}
  1229. /*! @name Register ENET_MMFR, field ST[31:30] (RW)
  1230. *
  1231. * These fields must be programmed to 01 for a valid MII management frame.
  1232. */
  1233. //@{
  1234. #define BP_ENET_MMFR_ST (30) //!< Bit position for ENET_MMFR_ST.
  1235. #define BM_ENET_MMFR_ST (0xc0000000) //!< Bit mask for ENET_MMFR_ST.
  1236. //! @brief Get value of ENET_MMFR_ST from a register value.
  1237. #define BG_ENET_MMFR_ST(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_MMFR_ST) >> BP_ENET_MMFR_ST)
  1238. //! @brief Format value for bitfield ENET_MMFR_ST.
  1239. #define BF_ENET_MMFR_ST(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_MMFR_ST) & BM_ENET_MMFR_ST)
  1240. #ifndef __LANGUAGE_ASM__
  1241. //! @brief Set the ST field to a new value.
  1242. #define BW_ENET_MMFR_ST(v) (HW_ENET_MMFR_WR((HW_ENET_MMFR_RD() & ~BM_ENET_MMFR_ST) | BF_ENET_MMFR_ST(v)))
  1243. #endif
  1244. //@}
  1245. //-------------------------------------------------------------------------------------------
  1246. // HW_ENET_MSCR - MII Speed Control Register
  1247. //-------------------------------------------------------------------------------------------
  1248. #ifndef __LANGUAGE_ASM__
  1249. /*!
  1250. * @brief HW_ENET_MSCR - MII Speed Control Register (RW)
  1251. *
  1252. * Reset value: 0x00000000
  1253. *
  1254. * MSCR provides control of the MII clock (MDC pin) frequency and allows a preamble drop on the MII
  1255. * management frame. The MII_SPEED field must be programmed with a value to provide an MDC frequency
  1256. * of less than or equal to 2.5 MHz to be compliant with the IEEE 802.3 MII specification. The
  1257. * MII_SPEED must be set to a non-zero value to source a read or write management frame. After the
  1258. * management frame is complete, the MSCR register may optionally be cleared to turn off MDC. The
  1259. * MDC signal generated has a 50% duty cycle except when MII_SPEED changes during operation. This
  1260. * change takes effect following a rising or falling edge of MDC. If the internal module clock is 25
  1261. * MHz, programming this register to 0x0000_0004 results in an MDC as stated in the following
  1262. * equation: 25 MHz / ((4 + 1) x 2) = 2.5 MHz The following table shows the optimum values for
  1263. * MII_SPEED as a function of internal module clock frequency. Programming Examples for MSCR
  1264. * Internal MAC clock frequency MSCR [MII_SPEED] MDC frequency 25 MHz 0x4 2.50 MHz 33 MHz 0x6 2.36
  1265. * MHz 40 MHz 0x7 2.50 MHz 50 MHz 0x9 2.50 MHz 66 MHz 0xD 2.36 MHz
  1266. */
  1267. typedef union _hw_enet_mscr
  1268. {
  1269. reg32_t U;
  1270. struct _hw_enet_mscr_bitfields
  1271. {
  1272. unsigned RESERVED0 : 1; //!< [0]
  1273. unsigned MII_SPEED : 6; //!< [6:1] MII Speed
  1274. unsigned DIS_PRE : 1; //!< [7] Disable Preamble
  1275. unsigned HOLDTIME : 3; //!< [10:8] Holdtime On MDIO Output
  1276. unsigned RESERVED1 : 21; //!< [31:11]
  1277. } B;
  1278. } hw_enet_mscr_t;
  1279. #endif
  1280. /*!
  1281. * @name Constants and macros for entire ENET_MSCR register
  1282. */
  1283. //@{
  1284. #define HW_ENET_MSCR_ADDR (REGS_ENET_BASE + 0x44)
  1285. #ifndef __LANGUAGE_ASM__
  1286. #define HW_ENET_MSCR (*(volatile hw_enet_mscr_t *) HW_ENET_MSCR_ADDR)
  1287. #define HW_ENET_MSCR_RD() (HW_ENET_MSCR.U)
  1288. #define HW_ENET_MSCR_WR(v) (HW_ENET_MSCR.U = (v))
  1289. #define HW_ENET_MSCR_SET(v) (HW_ENET_MSCR_WR(HW_ENET_MSCR_RD() | (v)))
  1290. #define HW_ENET_MSCR_CLR(v) (HW_ENET_MSCR_WR(HW_ENET_MSCR_RD() & ~(v)))
  1291. #define HW_ENET_MSCR_TOG(v) (HW_ENET_MSCR_WR(HW_ENET_MSCR_RD() ^ (v)))
  1292. #endif
  1293. //@}
  1294. /*
  1295. * constants & macros for individual ENET_MSCR bitfields
  1296. */
  1297. /*! @name Register ENET_MSCR, field MII_SPEED[6:1] (RW)
  1298. *
  1299. * Controls the frequency of the MII management interface clock (MDC) relative to the internal
  1300. * module clock. A value of 0 in this field turns off MDC and leaves it in low voltage state. Any
  1301. * non-zero value results in the MDC frequency of: 1/((MII_SPEED + 1) x 2) of the internal module
  1302. * clock frequency
  1303. */
  1304. //@{
  1305. #define BP_ENET_MSCR_MII_SPEED (1) //!< Bit position for ENET_MSCR_MII_SPEED.
  1306. #define BM_ENET_MSCR_MII_SPEED (0x0000007e) //!< Bit mask for ENET_MSCR_MII_SPEED.
  1307. //! @brief Get value of ENET_MSCR_MII_SPEED from a register value.
  1308. #define BG_ENET_MSCR_MII_SPEED(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_MSCR_MII_SPEED) >> BP_ENET_MSCR_MII_SPEED)
  1309. //! @brief Format value for bitfield ENET_MSCR_MII_SPEED.
  1310. #define BF_ENET_MSCR_MII_SPEED(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_MSCR_MII_SPEED) & BM_ENET_MSCR_MII_SPEED)
  1311. #ifndef __LANGUAGE_ASM__
  1312. //! @brief Set the MII_SPEED field to a new value.
  1313. #define BW_ENET_MSCR_MII_SPEED(v) (HW_ENET_MSCR_WR((HW_ENET_MSCR_RD() & ~BM_ENET_MSCR_MII_SPEED) | BF_ENET_MSCR_MII_SPEED(v)))
  1314. #endif
  1315. //@}
  1316. /*! @name Register ENET_MSCR, field DIS_PRE[7] (RW)
  1317. *
  1318. * Enables/disables prepending a preamble to the MII management frame. The MII standard allows the
  1319. * preamble to be dropped if the attached PHY devices do not require it.
  1320. *
  1321. * Values:
  1322. * - 0 - Preamble enabled.
  1323. * - 1 - Preamble (32 ones) is not prepended to the MII management frame.
  1324. */
  1325. //@{
  1326. #define BP_ENET_MSCR_DIS_PRE (7) //!< Bit position for ENET_MSCR_DIS_PRE.
  1327. #define BM_ENET_MSCR_DIS_PRE (0x00000080) //!< Bit mask for ENET_MSCR_DIS_PRE.
  1328. //! @brief Get value of ENET_MSCR_DIS_PRE from a register value.
  1329. #define BG_ENET_MSCR_DIS_PRE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_MSCR_DIS_PRE) >> BP_ENET_MSCR_DIS_PRE)
  1330. //! @brief Format value for bitfield ENET_MSCR_DIS_PRE.
  1331. #define BF_ENET_MSCR_DIS_PRE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_MSCR_DIS_PRE) & BM_ENET_MSCR_DIS_PRE)
  1332. #ifndef __LANGUAGE_ASM__
  1333. //! @brief Set the DIS_PRE field to a new value.
  1334. #define BW_ENET_MSCR_DIS_PRE(v) (HW_ENET_MSCR_WR((HW_ENET_MSCR_RD() & ~BM_ENET_MSCR_DIS_PRE) | BF_ENET_MSCR_DIS_PRE(v)))
  1335. #endif
  1336. //@}
  1337. /*! @name Register ENET_MSCR, field HOLDTIME[10:8] (RW)
  1338. *
  1339. * IEEE802.3 clause 22 defines a minimum of 10 ns for the holdtime on the MDIO output. Depending on
  1340. * the host bus frequency, the setting may need to be increased.
  1341. *
  1342. * Values:
  1343. * - 000 - 1 internal module clock cycle
  1344. * - 001 - 2 internal module clock cycles
  1345. * - 010 - 3 internal module clock cycles
  1346. * - 111 - 8 internal module clock cycles
  1347. */
  1348. //@{
  1349. #define BP_ENET_MSCR_HOLDTIME (8) //!< Bit position for ENET_MSCR_HOLDTIME.
  1350. #define BM_ENET_MSCR_HOLDTIME (0x00000700) //!< Bit mask for ENET_MSCR_HOLDTIME.
  1351. //! @brief Get value of ENET_MSCR_HOLDTIME from a register value.
  1352. #define BG_ENET_MSCR_HOLDTIME(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_MSCR_HOLDTIME) >> BP_ENET_MSCR_HOLDTIME)
  1353. //! @brief Format value for bitfield ENET_MSCR_HOLDTIME.
  1354. #define BF_ENET_MSCR_HOLDTIME(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_MSCR_HOLDTIME) & BM_ENET_MSCR_HOLDTIME)
  1355. #ifndef __LANGUAGE_ASM__
  1356. //! @brief Set the HOLDTIME field to a new value.
  1357. #define BW_ENET_MSCR_HOLDTIME(v) (HW_ENET_MSCR_WR((HW_ENET_MSCR_RD() & ~BM_ENET_MSCR_HOLDTIME) | BF_ENET_MSCR_HOLDTIME(v)))
  1358. #endif
  1359. //@}
  1360. //-------------------------------------------------------------------------------------------
  1361. // HW_ENET_MIBC - MIB Control Register
  1362. //-------------------------------------------------------------------------------------------
  1363. #ifndef __LANGUAGE_ASM__
  1364. /*!
  1365. * @brief HW_ENET_MIBC - MIB Control Register (RW)
  1366. *
  1367. * Reset value: 0xc0000000
  1368. *
  1369. * MIBC is a read/write register controlling and observing the state of the MIB block. Access this
  1370. * register to disable the MIB block operation or clear the MIB counters. The MIB_DIS field resets
  1371. * to 1.
  1372. */
  1373. typedef union _hw_enet_mibc
  1374. {
  1375. reg32_t U;
  1376. struct _hw_enet_mibc_bitfields
  1377. {
  1378. unsigned RESERVED0 : 29; //!< [28:0]
  1379. unsigned MIB_CLEAR : 1; //!< [29] MIB Clear
  1380. unsigned MIB_IDLE : 1; //!< [30] MIB Idle
  1381. unsigned MIB_DIS : 1; //!< [31] Disable MIB Logic
  1382. } B;
  1383. } hw_enet_mibc_t;
  1384. #endif
  1385. /*!
  1386. * @name Constants and macros for entire ENET_MIBC register
  1387. */
  1388. //@{
  1389. #define HW_ENET_MIBC_ADDR (REGS_ENET_BASE + 0x64)
  1390. #ifndef __LANGUAGE_ASM__
  1391. #define HW_ENET_MIBC (*(volatile hw_enet_mibc_t *) HW_ENET_MIBC_ADDR)
  1392. #define HW_ENET_MIBC_RD() (HW_ENET_MIBC.U)
  1393. #define HW_ENET_MIBC_WR(v) (HW_ENET_MIBC.U = (v))
  1394. #define HW_ENET_MIBC_SET(v) (HW_ENET_MIBC_WR(HW_ENET_MIBC_RD() | (v)))
  1395. #define HW_ENET_MIBC_CLR(v) (HW_ENET_MIBC_WR(HW_ENET_MIBC_RD() & ~(v)))
  1396. #define HW_ENET_MIBC_TOG(v) (HW_ENET_MIBC_WR(HW_ENET_MIBC_RD() ^ (v)))
  1397. #endif
  1398. //@}
  1399. /*
  1400. * constants & macros for individual ENET_MIBC bitfields
  1401. */
  1402. /*! @name Register ENET_MIBC, field MIB_CLEAR[29] (RW)
  1403. *
  1404. * If set, all statistics counters are reset to 0. This field is not self-clearing. To clear the MIB
  1405. * counters set and then clear the field.
  1406. */
  1407. //@{
  1408. #define BP_ENET_MIBC_MIB_CLEAR (29) //!< Bit position for ENET_MIBC_MIB_CLEAR.
  1409. #define BM_ENET_MIBC_MIB_CLEAR (0x20000000) //!< Bit mask for ENET_MIBC_MIB_CLEAR.
  1410. //! @brief Get value of ENET_MIBC_MIB_CLEAR from a register value.
  1411. #define BG_ENET_MIBC_MIB_CLEAR(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_MIBC_MIB_CLEAR) >> BP_ENET_MIBC_MIB_CLEAR)
  1412. //! @brief Format value for bitfield ENET_MIBC_MIB_CLEAR.
  1413. #define BF_ENET_MIBC_MIB_CLEAR(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_MIBC_MIB_CLEAR) & BM_ENET_MIBC_MIB_CLEAR)
  1414. #ifndef __LANGUAGE_ASM__
  1415. //! @brief Set the MIB_CLEAR field to a new value.
  1416. #define BW_ENET_MIBC_MIB_CLEAR(v) (HW_ENET_MIBC_WR((HW_ENET_MIBC_RD() & ~BM_ENET_MIBC_MIB_CLEAR) | BF_ENET_MIBC_MIB_CLEAR(v)))
  1417. #endif
  1418. //@}
  1419. /*! @name Register ENET_MIBC, field MIB_IDLE[30] (RO)
  1420. *
  1421. * If this status field is set, the MIB block is not currently updating any MIB counters.
  1422. */
  1423. //@{
  1424. #define BP_ENET_MIBC_MIB_IDLE (30) //!< Bit position for ENET_MIBC_MIB_IDLE.
  1425. #define BM_ENET_MIBC_MIB_IDLE (0x40000000) //!< Bit mask for ENET_MIBC_MIB_IDLE.
  1426. //! @brief Get value of ENET_MIBC_MIB_IDLE from a register value.
  1427. #define BG_ENET_MIBC_MIB_IDLE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_MIBC_MIB_IDLE) >> BP_ENET_MIBC_MIB_IDLE)
  1428. //@}
  1429. /*! @name Register ENET_MIBC, field MIB_DIS[31] (RW)
  1430. *
  1431. * If this control field is set, the MIB logic halts and does not update any MIB counters.
  1432. */
  1433. //@{
  1434. #define BP_ENET_MIBC_MIB_DIS (31) //!< Bit position for ENET_MIBC_MIB_DIS.
  1435. #define BM_ENET_MIBC_MIB_DIS (0x80000000) //!< Bit mask for ENET_MIBC_MIB_DIS.
  1436. //! @brief Get value of ENET_MIBC_MIB_DIS from a register value.
  1437. #define BG_ENET_MIBC_MIB_DIS(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_MIBC_MIB_DIS) >> BP_ENET_MIBC_MIB_DIS)
  1438. //! @brief Format value for bitfield ENET_MIBC_MIB_DIS.
  1439. #define BF_ENET_MIBC_MIB_DIS(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_MIBC_MIB_DIS) & BM_ENET_MIBC_MIB_DIS)
  1440. #ifndef __LANGUAGE_ASM__
  1441. //! @brief Set the MIB_DIS field to a new value.
  1442. #define BW_ENET_MIBC_MIB_DIS(v) (HW_ENET_MIBC_WR((HW_ENET_MIBC_RD() & ~BM_ENET_MIBC_MIB_DIS) | BF_ENET_MIBC_MIB_DIS(v)))
  1443. #endif
  1444. //@}
  1445. //-------------------------------------------------------------------------------------------
  1446. // HW_ENET_RCR - Receive Control Register
  1447. //-------------------------------------------------------------------------------------------
  1448. #ifndef __LANGUAGE_ASM__
  1449. /*!
  1450. * @brief HW_ENET_RCR - Receive Control Register (RW)
  1451. *
  1452. * Reset value: 0x05ee0001
  1453. */
  1454. typedef union _hw_enet_rcr
  1455. {
  1456. reg32_t U;
  1457. struct _hw_enet_rcr_bitfields
  1458. {
  1459. unsigned LOOP : 1; //!< [0] Internal Loopback
  1460. unsigned DRT : 1; //!< [1] Disable Receive On Transmit
  1461. unsigned MII_MODE : 1; //!< [2] Media Independent Interface Mode
  1462. unsigned PROM : 1; //!< [3] Promiscuous Mode
  1463. unsigned BC_REJ : 1; //!< [4] Broadcast Frame Reject
  1464. unsigned FCE : 1; //!< [5] Flow Control Enable
  1465. unsigned RESERVED0 : 2; //!< [7:6] Reserved.
  1466. unsigned RMII_MODE : 1; //!< [8] RMII Mode Enable
  1467. unsigned RMII_10T : 1; //!< [9] Enables 10-Mbps mode of the RMII .
  1468. unsigned RESERVED1 : 2; //!< [11:10]
  1469. unsigned PADEN : 1; //!< [12] Enable Frame Padding Remove On Receive
  1470. unsigned PAUFWD : 1; //!< [13] Terminate/Forward Pause Frames
  1471. unsigned CRCFWD : 1; //!< [14] Terminate/Forward Received CRC
  1472. unsigned CFEN : 1; //!< [15] MAC Control Frame Enable
  1473. unsigned MAX_FL : 14; //!< [29:16] Maximum Frame Length
  1474. unsigned NLC : 1; //!< [30] Payload Length Check Disable
  1475. unsigned GRS : 1; //!< [31] Graceful Receive Stopped
  1476. } B;
  1477. } hw_enet_rcr_t;
  1478. #endif
  1479. /*!
  1480. * @name Constants and macros for entire ENET_RCR register
  1481. */
  1482. //@{
  1483. #define HW_ENET_RCR_ADDR (REGS_ENET_BASE + 0x84)
  1484. #ifndef __LANGUAGE_ASM__
  1485. #define HW_ENET_RCR (*(volatile hw_enet_rcr_t *) HW_ENET_RCR_ADDR)
  1486. #define HW_ENET_RCR_RD() (HW_ENET_RCR.U)
  1487. #define HW_ENET_RCR_WR(v) (HW_ENET_RCR.U = (v))
  1488. #define HW_ENET_RCR_SET(v) (HW_ENET_RCR_WR(HW_ENET_RCR_RD() | (v)))
  1489. #define HW_ENET_RCR_CLR(v) (HW_ENET_RCR_WR(HW_ENET_RCR_RD() & ~(v)))
  1490. #define HW_ENET_RCR_TOG(v) (HW_ENET_RCR_WR(HW_ENET_RCR_RD() ^ (v)))
  1491. #endif
  1492. //@}
  1493. /*
  1494. * constants & macros for individual ENET_RCR bitfields
  1495. */
  1496. /*! @name Register ENET_RCR, field LOOP[0] (RW)
  1497. *
  1498. * This is an MII internal loopback, therefore MII_MODE must be written to 1 and RMII_MODE must be
  1499. * written to 0.
  1500. *
  1501. * Values:
  1502. * - 0 - Loopback disabled.
  1503. * - 1 - Transmitted frames are looped back internal to the device and transmit MII output signals are not
  1504. * asserted. DRT must be cleared.
  1505. */
  1506. //@{
  1507. #define BP_ENET_RCR_LOOP (0) //!< Bit position for ENET_RCR_LOOP.
  1508. #define BM_ENET_RCR_LOOP (0x00000001) //!< Bit mask for ENET_RCR_LOOP.
  1509. //! @brief Get value of ENET_RCR_LOOP from a register value.
  1510. #define BG_ENET_RCR_LOOP(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_RCR_LOOP) >> BP_ENET_RCR_LOOP)
  1511. //! @brief Format value for bitfield ENET_RCR_LOOP.
  1512. #define BF_ENET_RCR_LOOP(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_RCR_LOOP) & BM_ENET_RCR_LOOP)
  1513. #ifndef __LANGUAGE_ASM__
  1514. //! @brief Set the LOOP field to a new value.
  1515. #define BW_ENET_RCR_LOOP(v) (HW_ENET_RCR_WR((HW_ENET_RCR_RD() & ~BM_ENET_RCR_LOOP) | BF_ENET_RCR_LOOP(v)))
  1516. #endif
  1517. //@}
  1518. /*! @name Register ENET_RCR, field DRT[1] (RW)
  1519. *
  1520. * Values:
  1521. * - 0 - Receive path operates independently of transmit. Used for full-duplex or to monitor transmit
  1522. * activity in half-duplex mode.
  1523. * - 1 - Disable reception of frames while transmitting. Normally used for half-duplex mode.
  1524. */
  1525. //@{
  1526. #define BP_ENET_RCR_DRT (1) //!< Bit position for ENET_RCR_DRT.
  1527. #define BM_ENET_RCR_DRT (0x00000002) //!< Bit mask for ENET_RCR_DRT.
  1528. //! @brief Get value of ENET_RCR_DRT from a register value.
  1529. #define BG_ENET_RCR_DRT(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_RCR_DRT) >> BP_ENET_RCR_DRT)
  1530. //! @brief Format value for bitfield ENET_RCR_DRT.
  1531. #define BF_ENET_RCR_DRT(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_RCR_DRT) & BM_ENET_RCR_DRT)
  1532. #ifndef __LANGUAGE_ASM__
  1533. //! @brief Set the DRT field to a new value.
  1534. #define BW_ENET_RCR_DRT(v) (HW_ENET_RCR_WR((HW_ENET_RCR_RD() & ~BM_ENET_RCR_DRT) | BF_ENET_RCR_DRT(v)))
  1535. #endif
  1536. //@}
  1537. /*! @name Register ENET_RCR, field MII_MODE[2] (RW)
  1538. *
  1539. * This field must always be set.
  1540. *
  1541. * Values:
  1542. * - 0 - Reserved.
  1543. * - 1 - MII or RMII mode, as indicated by the RMII_MODE field.
  1544. */
  1545. //@{
  1546. #define BP_ENET_RCR_MII_MODE (2) //!< Bit position for ENET_RCR_MII_MODE.
  1547. #define BM_ENET_RCR_MII_MODE (0x00000004) //!< Bit mask for ENET_RCR_MII_MODE.
  1548. //! @brief Get value of ENET_RCR_MII_MODE from a register value.
  1549. #define BG_ENET_RCR_MII_MODE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_RCR_MII_MODE) >> BP_ENET_RCR_MII_MODE)
  1550. //! @brief Format value for bitfield ENET_RCR_MII_MODE.
  1551. #define BF_ENET_RCR_MII_MODE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_RCR_MII_MODE) & BM_ENET_RCR_MII_MODE)
  1552. #ifndef __LANGUAGE_ASM__
  1553. //! @brief Set the MII_MODE field to a new value.
  1554. #define BW_ENET_RCR_MII_MODE(v) (HW_ENET_RCR_WR((HW_ENET_RCR_RD() & ~BM_ENET_RCR_MII_MODE) | BF_ENET_RCR_MII_MODE(v)))
  1555. #endif
  1556. //@}
  1557. /*! @name Register ENET_RCR, field PROM[3] (RW)
  1558. *
  1559. * All frames are accepted regardless of address matching.
  1560. *
  1561. * Values:
  1562. * - 0 - Disabled.
  1563. * - 1 - Enabled.
  1564. */
  1565. //@{
  1566. #define BP_ENET_RCR_PROM (3) //!< Bit position for ENET_RCR_PROM.
  1567. #define BM_ENET_RCR_PROM (0x00000008) //!< Bit mask for ENET_RCR_PROM.
  1568. //! @brief Get value of ENET_RCR_PROM from a register value.
  1569. #define BG_ENET_RCR_PROM(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_RCR_PROM) >> BP_ENET_RCR_PROM)
  1570. //! @brief Format value for bitfield ENET_RCR_PROM.
  1571. #define BF_ENET_RCR_PROM(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_RCR_PROM) & BM_ENET_RCR_PROM)
  1572. #ifndef __LANGUAGE_ASM__
  1573. //! @brief Set the PROM field to a new value.
  1574. #define BW_ENET_RCR_PROM(v) (HW_ENET_RCR_WR((HW_ENET_RCR_RD() & ~BM_ENET_RCR_PROM) | BF_ENET_RCR_PROM(v)))
  1575. #endif
  1576. //@}
  1577. /*! @name Register ENET_RCR, field BC_REJ[4] (RW)
  1578. *
  1579. * If set, frames with destination address (DA) equal to 0xFFFF_FFFF_FFFF are rejected unless the
  1580. * PROM field is set. If BC_REJ and PROM are set, frames with broadcast DA are accepted and the MISS
  1581. * (M) is set in the receive buffer descriptor.
  1582. */
  1583. //@{
  1584. #define BP_ENET_RCR_BC_REJ (4) //!< Bit position for ENET_RCR_BC_REJ.
  1585. #define BM_ENET_RCR_BC_REJ (0x00000010) //!< Bit mask for ENET_RCR_BC_REJ.
  1586. //! @brief Get value of ENET_RCR_BC_REJ from a register value.
  1587. #define BG_ENET_RCR_BC_REJ(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_RCR_BC_REJ) >> BP_ENET_RCR_BC_REJ)
  1588. //! @brief Format value for bitfield ENET_RCR_BC_REJ.
  1589. #define BF_ENET_RCR_BC_REJ(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_RCR_BC_REJ) & BM_ENET_RCR_BC_REJ)
  1590. #ifndef __LANGUAGE_ASM__
  1591. //! @brief Set the BC_REJ field to a new value.
  1592. #define BW_ENET_RCR_BC_REJ(v) (HW_ENET_RCR_WR((HW_ENET_RCR_RD() & ~BM_ENET_RCR_BC_REJ) | BF_ENET_RCR_BC_REJ(v)))
  1593. #endif
  1594. //@}
  1595. /*! @name Register ENET_RCR, field FCE[5] (RW)
  1596. *
  1597. * If set, the receiver detects PAUSE frames. Upon PAUSE frame detection, the transmitter stops
  1598. * transmitting data frames for a given duration.
  1599. */
  1600. //@{
  1601. #define BP_ENET_RCR_FCE (5) //!< Bit position for ENET_RCR_FCE.
  1602. #define BM_ENET_RCR_FCE (0x00000020) //!< Bit mask for ENET_RCR_FCE.
  1603. //! @brief Get value of ENET_RCR_FCE from a register value.
  1604. #define BG_ENET_RCR_FCE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_RCR_FCE) >> BP_ENET_RCR_FCE)
  1605. //! @brief Format value for bitfield ENET_RCR_FCE.
  1606. #define BF_ENET_RCR_FCE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_RCR_FCE) & BM_ENET_RCR_FCE)
  1607. #ifndef __LANGUAGE_ASM__
  1608. //! @brief Set the FCE field to a new value.
  1609. #define BW_ENET_RCR_FCE(v) (HW_ENET_RCR_WR((HW_ENET_RCR_RD() & ~BM_ENET_RCR_FCE) | BF_ENET_RCR_FCE(v)))
  1610. #endif
  1611. //@}
  1612. /*! @name Register ENET_RCR, field RMII_MODE[8] (RW)
  1613. *
  1614. * Specifies whether the MAC is configured for MII mode or RMII operation .
  1615. *
  1616. * Values:
  1617. * - 0 - MAC configured for MII mode.
  1618. * - 1 - MAC configured for RMII operation.
  1619. */
  1620. //@{
  1621. #define BP_ENET_RCR_RMII_MODE (8) //!< Bit position for ENET_RCR_RMII_MODE.
  1622. #define BM_ENET_RCR_RMII_MODE (0x00000100) //!< Bit mask for ENET_RCR_RMII_MODE.
  1623. //! @brief Get value of ENET_RCR_RMII_MODE from a register value.
  1624. #define BG_ENET_RCR_RMII_MODE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_RCR_RMII_MODE) >> BP_ENET_RCR_RMII_MODE)
  1625. //! @brief Format value for bitfield ENET_RCR_RMII_MODE.
  1626. #define BF_ENET_RCR_RMII_MODE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_RCR_RMII_MODE) & BM_ENET_RCR_RMII_MODE)
  1627. #ifndef __LANGUAGE_ASM__
  1628. //! @brief Set the RMII_MODE field to a new value.
  1629. #define BW_ENET_RCR_RMII_MODE(v) (HW_ENET_RCR_WR((HW_ENET_RCR_RD() & ~BM_ENET_RCR_RMII_MODE) | BF_ENET_RCR_RMII_MODE(v)))
  1630. #endif
  1631. //@}
  1632. /*! @name Register ENET_RCR, field RMII_10T[9] (RW)
  1633. *
  1634. * Enables 10-Mbps mode of the RMII .
  1635. *
  1636. * Values:
  1637. * - 0 - 100 Mbps operation.
  1638. * - 1 - 10 Mbps operation.
  1639. */
  1640. //@{
  1641. #define BP_ENET_RCR_RMII_10T (9) //!< Bit position for ENET_RCR_RMII_10T.
  1642. #define BM_ENET_RCR_RMII_10T (0x00000200) //!< Bit mask for ENET_RCR_RMII_10T.
  1643. //! @brief Get value of ENET_RCR_RMII_10T from a register value.
  1644. #define BG_ENET_RCR_RMII_10T(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_RCR_RMII_10T) >> BP_ENET_RCR_RMII_10T)
  1645. //! @brief Format value for bitfield ENET_RCR_RMII_10T.
  1646. #define BF_ENET_RCR_RMII_10T(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_RCR_RMII_10T) & BM_ENET_RCR_RMII_10T)
  1647. #ifndef __LANGUAGE_ASM__
  1648. //! @brief Set the RMII_10T field to a new value.
  1649. #define BW_ENET_RCR_RMII_10T(v) (HW_ENET_RCR_WR((HW_ENET_RCR_RD() & ~BM_ENET_RCR_RMII_10T) | BF_ENET_RCR_RMII_10T(v)))
  1650. #endif
  1651. //@}
  1652. /*! @name Register ENET_RCR, field PADEN[12] (RW)
  1653. *
  1654. * Specifies whether the MAC removes padding from received frames.
  1655. *
  1656. * Values:
  1657. * - 0 - No padding is removed on receive by the MAC.
  1658. * - 1 - Padding is removed from received frames.
  1659. */
  1660. //@{
  1661. #define BP_ENET_RCR_PADEN (12) //!< Bit position for ENET_RCR_PADEN.
  1662. #define BM_ENET_RCR_PADEN (0x00001000) //!< Bit mask for ENET_RCR_PADEN.
  1663. //! @brief Get value of ENET_RCR_PADEN from a register value.
  1664. #define BG_ENET_RCR_PADEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_RCR_PADEN) >> BP_ENET_RCR_PADEN)
  1665. //! @brief Format value for bitfield ENET_RCR_PADEN.
  1666. #define BF_ENET_RCR_PADEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_RCR_PADEN) & BM_ENET_RCR_PADEN)
  1667. #ifndef __LANGUAGE_ASM__
  1668. //! @brief Set the PADEN field to a new value.
  1669. #define BW_ENET_RCR_PADEN(v) (HW_ENET_RCR_WR((HW_ENET_RCR_RD() & ~BM_ENET_RCR_PADEN) | BF_ENET_RCR_PADEN(v)))
  1670. #endif
  1671. //@}
  1672. /*! @name Register ENET_RCR, field PAUFWD[13] (RW)
  1673. *
  1674. * Specifies whether pause frames are terminated or forwarded.
  1675. *
  1676. * Values:
  1677. * - 0 - Pause frames are terminated and discarded in the MAC.
  1678. * - 1 - Pause frames are forwarded to the user application.
  1679. */
  1680. //@{
  1681. #define BP_ENET_RCR_PAUFWD (13) //!< Bit position for ENET_RCR_PAUFWD.
  1682. #define BM_ENET_RCR_PAUFWD (0x00002000) //!< Bit mask for ENET_RCR_PAUFWD.
  1683. //! @brief Get value of ENET_RCR_PAUFWD from a register value.
  1684. #define BG_ENET_RCR_PAUFWD(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_RCR_PAUFWD) >> BP_ENET_RCR_PAUFWD)
  1685. //! @brief Format value for bitfield ENET_RCR_PAUFWD.
  1686. #define BF_ENET_RCR_PAUFWD(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_RCR_PAUFWD) & BM_ENET_RCR_PAUFWD)
  1687. #ifndef __LANGUAGE_ASM__
  1688. //! @brief Set the PAUFWD field to a new value.
  1689. #define BW_ENET_RCR_PAUFWD(v) (HW_ENET_RCR_WR((HW_ENET_RCR_RD() & ~BM_ENET_RCR_PAUFWD) | BF_ENET_RCR_PAUFWD(v)))
  1690. #endif
  1691. //@}
  1692. /*! @name Register ENET_RCR, field CRCFWD[14] (RW)
  1693. *
  1694. * Specifies whether the CRC field of received frames is transmitted or stripped. If padding
  1695. * function is enabled (PADEN = 1), CRCFWD is ignored and the CRC field is checked and always
  1696. * terminated and removed.
  1697. *
  1698. * Values:
  1699. * - 0 - The CRC field of received frames is transmitted to the user application.
  1700. * - 1 - The CRC field is stripped from the frame.
  1701. */
  1702. //@{
  1703. #define BP_ENET_RCR_CRCFWD (14) //!< Bit position for ENET_RCR_CRCFWD.
  1704. #define BM_ENET_RCR_CRCFWD (0x00004000) //!< Bit mask for ENET_RCR_CRCFWD.
  1705. //! @brief Get value of ENET_RCR_CRCFWD from a register value.
  1706. #define BG_ENET_RCR_CRCFWD(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_RCR_CRCFWD) >> BP_ENET_RCR_CRCFWD)
  1707. //! @brief Format value for bitfield ENET_RCR_CRCFWD.
  1708. #define BF_ENET_RCR_CRCFWD(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_RCR_CRCFWD) & BM_ENET_RCR_CRCFWD)
  1709. #ifndef __LANGUAGE_ASM__
  1710. //! @brief Set the CRCFWD field to a new value.
  1711. #define BW_ENET_RCR_CRCFWD(v) (HW_ENET_RCR_WR((HW_ENET_RCR_RD() & ~BM_ENET_RCR_CRCFWD) | BF_ENET_RCR_CRCFWD(v)))
  1712. #endif
  1713. //@}
  1714. /*! @name Register ENET_RCR, field CFEN[15] (RW)
  1715. *
  1716. * Enables/disables the MAC control frame.
  1717. *
  1718. * Values:
  1719. * - 0 - MAC control frames with any opcode other than 0x0001 (pause frame) are accepted and forwarded to the
  1720. * client interface.
  1721. * - 1 - MAC control frames with any opcode other than 0x0001 (pause frame) are silently discarded.
  1722. */
  1723. //@{
  1724. #define BP_ENET_RCR_CFEN (15) //!< Bit position for ENET_RCR_CFEN.
  1725. #define BM_ENET_RCR_CFEN (0x00008000) //!< Bit mask for ENET_RCR_CFEN.
  1726. //! @brief Get value of ENET_RCR_CFEN from a register value.
  1727. #define BG_ENET_RCR_CFEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_RCR_CFEN) >> BP_ENET_RCR_CFEN)
  1728. //! @brief Format value for bitfield ENET_RCR_CFEN.
  1729. #define BF_ENET_RCR_CFEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_RCR_CFEN) & BM_ENET_RCR_CFEN)
  1730. #ifndef __LANGUAGE_ASM__
  1731. //! @brief Set the CFEN field to a new value.
  1732. #define BW_ENET_RCR_CFEN(v) (HW_ENET_RCR_WR((HW_ENET_RCR_RD() & ~BM_ENET_RCR_CFEN) | BF_ENET_RCR_CFEN(v)))
  1733. #endif
  1734. //@}
  1735. /*! @name Register ENET_RCR, field MAX_FL[29:16] (RW)
  1736. *
  1737. * Resets to decimal 1518. Length is measured starting at DA and includes the CRC at the end of the
  1738. * frame. Transmit frames longer than MAX_FL cause the BABT interrupt to occur. Receive frames
  1739. * longer than MAX_FL cause the BABR interrupt to occur and set the LG field in the end of frame
  1740. * receive buffer descriptor. The recommended default value to be programmed is 1518 or 1522 if VLAN
  1741. * tags are supported.
  1742. */
  1743. //@{
  1744. #define BP_ENET_RCR_MAX_FL (16) //!< Bit position for ENET_RCR_MAX_FL.
  1745. #define BM_ENET_RCR_MAX_FL (0x3fff0000) //!< Bit mask for ENET_RCR_MAX_FL.
  1746. //! @brief Get value of ENET_RCR_MAX_FL from a register value.
  1747. #define BG_ENET_RCR_MAX_FL(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_RCR_MAX_FL) >> BP_ENET_RCR_MAX_FL)
  1748. //! @brief Format value for bitfield ENET_RCR_MAX_FL.
  1749. #define BF_ENET_RCR_MAX_FL(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_RCR_MAX_FL) & BM_ENET_RCR_MAX_FL)
  1750. #ifndef __LANGUAGE_ASM__
  1751. //! @brief Set the MAX_FL field to a new value.
  1752. #define BW_ENET_RCR_MAX_FL(v) (HW_ENET_RCR_WR((HW_ENET_RCR_RD() & ~BM_ENET_RCR_MAX_FL) | BF_ENET_RCR_MAX_FL(v)))
  1753. #endif
  1754. //@}
  1755. /*! @name Register ENET_RCR, field NLC[30] (RW)
  1756. *
  1757. * Enables/disables a payload length check.
  1758. *
  1759. * Values:
  1760. * - 0 - The payload length check is disabled.
  1761. * - 1 - The core checks the frame's payload length with the frame length/type field. Errors are indicated in
  1762. * the EIR[PLC] field.
  1763. */
  1764. //@{
  1765. #define BP_ENET_RCR_NLC (30) //!< Bit position for ENET_RCR_NLC.
  1766. #define BM_ENET_RCR_NLC (0x40000000) //!< Bit mask for ENET_RCR_NLC.
  1767. //! @brief Get value of ENET_RCR_NLC from a register value.
  1768. #define BG_ENET_RCR_NLC(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_RCR_NLC) >> BP_ENET_RCR_NLC)
  1769. //! @brief Format value for bitfield ENET_RCR_NLC.
  1770. #define BF_ENET_RCR_NLC(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_RCR_NLC) & BM_ENET_RCR_NLC)
  1771. #ifndef __LANGUAGE_ASM__
  1772. //! @brief Set the NLC field to a new value.
  1773. #define BW_ENET_RCR_NLC(v) (HW_ENET_RCR_WR((HW_ENET_RCR_RD() & ~BM_ENET_RCR_NLC) | BF_ENET_RCR_NLC(v)))
  1774. #endif
  1775. //@}
  1776. /*! @name Register ENET_RCR, field GRS[31] (RO)
  1777. *
  1778. * Read-only status indicating that the MAC receive datapath is stopped.
  1779. */
  1780. //@{
  1781. #define BP_ENET_RCR_GRS (31) //!< Bit position for ENET_RCR_GRS.
  1782. #define BM_ENET_RCR_GRS (0x80000000) //!< Bit mask for ENET_RCR_GRS.
  1783. //! @brief Get value of ENET_RCR_GRS from a register value.
  1784. #define BG_ENET_RCR_GRS(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_RCR_GRS) >> BP_ENET_RCR_GRS)
  1785. //@}
  1786. //-------------------------------------------------------------------------------------------
  1787. // HW_ENET_TCR - Transmit Control Register
  1788. //-------------------------------------------------------------------------------------------
  1789. #ifndef __LANGUAGE_ASM__
  1790. /*!
  1791. * @brief HW_ENET_TCR - Transmit Control Register (RW)
  1792. *
  1793. * Reset value: 0x00000000
  1794. *
  1795. * TCR is read/write and configures the transmit block. This register is cleared at system reset.
  1796. * FDEN can only be modified when ECR[ETHEREN] is cleared.
  1797. */
  1798. typedef union _hw_enet_tcr
  1799. {
  1800. reg32_t U;
  1801. struct _hw_enet_tcr_bitfields
  1802. {
  1803. unsigned GTS : 1; //!< [0] Graceful Transmit Stop
  1804. unsigned RESERVED0 : 1; //!< [1]
  1805. unsigned FDEN : 1; //!< [2] Full-Duplex Enable
  1806. unsigned TFC_PAUSE : 1; //!< [3] Transmit Frame Control Pause
  1807. unsigned RFC_PAUSE : 1; //!< [4] Receive Frame Control Pause
  1808. unsigned ADDSEL : 3; //!< [7:5] Source MAC Address Select On Transmit
  1809. unsigned ADDINS : 1; //!< [8] Set MAC Address On Transmit
  1810. unsigned CRCFWD : 1; //!< [9] Forward Frame From Application With CRC
  1811. unsigned RESERVED1 : 22; //!< [31:10]
  1812. } B;
  1813. } hw_enet_tcr_t;
  1814. #endif
  1815. /*!
  1816. * @name Constants and macros for entire ENET_TCR register
  1817. */
  1818. //@{
  1819. #define HW_ENET_TCR_ADDR (REGS_ENET_BASE + 0xc4)
  1820. #ifndef __LANGUAGE_ASM__
  1821. #define HW_ENET_TCR (*(volatile hw_enet_tcr_t *) HW_ENET_TCR_ADDR)
  1822. #define HW_ENET_TCR_RD() (HW_ENET_TCR.U)
  1823. #define HW_ENET_TCR_WR(v) (HW_ENET_TCR.U = (v))
  1824. #define HW_ENET_TCR_SET(v) (HW_ENET_TCR_WR(HW_ENET_TCR_RD() | (v)))
  1825. #define HW_ENET_TCR_CLR(v) (HW_ENET_TCR_WR(HW_ENET_TCR_RD() & ~(v)))
  1826. #define HW_ENET_TCR_TOG(v) (HW_ENET_TCR_WR(HW_ENET_TCR_RD() ^ (v)))
  1827. #endif
  1828. //@}
  1829. /*
  1830. * constants & macros for individual ENET_TCR bitfields
  1831. */
  1832. /*! @name Register ENET_TCR, field GTS[0] (RW)
  1833. *
  1834. * When this field is set, MAC stops transmission after any frame currently transmitted is complete
  1835. * and EIR[GRA] is set. If frame transmission is not currently underway, the GRA interrupt is
  1836. * asserted immediately. After transmission finishes, clear GTS to restart. The next frame in the
  1837. * transmit FIFO is then transmitted. If an early collision occurs during transmission when GTS is
  1838. * set, transmission stops after the collision. The frame is transmitted again after GTS is cleared.
  1839. * There may be old frames in the transmit FIFO that transmit when GTS is reasserted. To avoid this,
  1840. * clear ECR[ETHEREN] following the GRA interrupt.
  1841. */
  1842. //@{
  1843. #define BP_ENET_TCR_GTS (0) //!< Bit position for ENET_TCR_GTS.
  1844. #define BM_ENET_TCR_GTS (0x00000001) //!< Bit mask for ENET_TCR_GTS.
  1845. //! @brief Get value of ENET_TCR_GTS from a register value.
  1846. #define BG_ENET_TCR_GTS(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_TCR_GTS) >> BP_ENET_TCR_GTS)
  1847. //! @brief Format value for bitfield ENET_TCR_GTS.
  1848. #define BF_ENET_TCR_GTS(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_TCR_GTS) & BM_ENET_TCR_GTS)
  1849. #ifndef __LANGUAGE_ASM__
  1850. //! @brief Set the GTS field to a new value.
  1851. #define BW_ENET_TCR_GTS(v) (HW_ENET_TCR_WR((HW_ENET_TCR_RD() & ~BM_ENET_TCR_GTS) | BF_ENET_TCR_GTS(v)))
  1852. #endif
  1853. //@}
  1854. /*! @name Register ENET_TCR, field FDEN[2] (RW)
  1855. *
  1856. * If this field is set, frames transmit independent of carrier sense and collision inputs. Only
  1857. * modify this bit when ECR[ETHEREN] is cleared.
  1858. */
  1859. //@{
  1860. #define BP_ENET_TCR_FDEN (2) //!< Bit position for ENET_TCR_FDEN.
  1861. #define BM_ENET_TCR_FDEN (0x00000004) //!< Bit mask for ENET_TCR_FDEN.
  1862. //! @brief Get value of ENET_TCR_FDEN from a register value.
  1863. #define BG_ENET_TCR_FDEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_TCR_FDEN) >> BP_ENET_TCR_FDEN)
  1864. //! @brief Format value for bitfield ENET_TCR_FDEN.
  1865. #define BF_ENET_TCR_FDEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_TCR_FDEN) & BM_ENET_TCR_FDEN)
  1866. #ifndef __LANGUAGE_ASM__
  1867. //! @brief Set the FDEN field to a new value.
  1868. #define BW_ENET_TCR_FDEN(v) (HW_ENET_TCR_WR((HW_ENET_TCR_RD() & ~BM_ENET_TCR_FDEN) | BF_ENET_TCR_FDEN(v)))
  1869. #endif
  1870. //@}
  1871. /*! @name Register ENET_TCR, field TFC_PAUSE[3] (RW)
  1872. *
  1873. * Pauses frame transmission. When this field is set, EIR[GRA] is set. With transmission of data
  1874. * frames stopped, the MAC transmits a MAC control PAUSE frame. Next, the MAC clears TFC_PAUSE and
  1875. * resumes transmitting data frames. If the transmitter pauses due to user assertion of GTS or
  1876. * reception of a PAUSE frame, the MAC may continue transmitting a MAC control PAUSE frame.
  1877. *
  1878. * Values:
  1879. * - 0 - No PAUSE frame transmitted.
  1880. * - 1 - The MAC stops transmission of data frames after the current transmission is complete.
  1881. */
  1882. //@{
  1883. #define BP_ENET_TCR_TFC_PAUSE (3) //!< Bit position for ENET_TCR_TFC_PAUSE.
  1884. #define BM_ENET_TCR_TFC_PAUSE (0x00000008) //!< Bit mask for ENET_TCR_TFC_PAUSE.
  1885. //! @brief Get value of ENET_TCR_TFC_PAUSE from a register value.
  1886. #define BG_ENET_TCR_TFC_PAUSE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_TCR_TFC_PAUSE) >> BP_ENET_TCR_TFC_PAUSE)
  1887. //! @brief Format value for bitfield ENET_TCR_TFC_PAUSE.
  1888. #define BF_ENET_TCR_TFC_PAUSE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_TCR_TFC_PAUSE) & BM_ENET_TCR_TFC_PAUSE)
  1889. #ifndef __LANGUAGE_ASM__
  1890. //! @brief Set the TFC_PAUSE field to a new value.
  1891. #define BW_ENET_TCR_TFC_PAUSE(v) (HW_ENET_TCR_WR((HW_ENET_TCR_RD() & ~BM_ENET_TCR_TFC_PAUSE) | BF_ENET_TCR_TFC_PAUSE(v)))
  1892. #endif
  1893. //@}
  1894. /*! @name Register ENET_TCR, field RFC_PAUSE[4] (RO)
  1895. *
  1896. * This status field is set when a full-duplex flow control pause frame is received and the
  1897. * transmitter pauses for the duration defined in this pause frame. This field automatically clears
  1898. * when the pause duration is complete.
  1899. */
  1900. //@{
  1901. #define BP_ENET_TCR_RFC_PAUSE (4) //!< Bit position for ENET_TCR_RFC_PAUSE.
  1902. #define BM_ENET_TCR_RFC_PAUSE (0x00000010) //!< Bit mask for ENET_TCR_RFC_PAUSE.
  1903. //! @brief Get value of ENET_TCR_RFC_PAUSE from a register value.
  1904. #define BG_ENET_TCR_RFC_PAUSE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_TCR_RFC_PAUSE) >> BP_ENET_TCR_RFC_PAUSE)
  1905. //@}
  1906. /*! @name Register ENET_TCR, field ADDSEL[7:5] (RW)
  1907. *
  1908. * If ADDINS is set, indicates the MAC address that overwrites the source MAC address.
  1909. *
  1910. * Values:
  1911. * - 000 - Node MAC address programmed on PADDR1/2 registers.
  1912. * - 100 -
  1913. * - 101 -
  1914. * - 110 -
  1915. */
  1916. //@{
  1917. #define BP_ENET_TCR_ADDSEL (5) //!< Bit position for ENET_TCR_ADDSEL.
  1918. #define BM_ENET_TCR_ADDSEL (0x000000e0) //!< Bit mask for ENET_TCR_ADDSEL.
  1919. //! @brief Get value of ENET_TCR_ADDSEL from a register value.
  1920. #define BG_ENET_TCR_ADDSEL(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_TCR_ADDSEL) >> BP_ENET_TCR_ADDSEL)
  1921. //! @brief Format value for bitfield ENET_TCR_ADDSEL.
  1922. #define BF_ENET_TCR_ADDSEL(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_TCR_ADDSEL) & BM_ENET_TCR_ADDSEL)
  1923. #ifndef __LANGUAGE_ASM__
  1924. //! @brief Set the ADDSEL field to a new value.
  1925. #define BW_ENET_TCR_ADDSEL(v) (HW_ENET_TCR_WR((HW_ENET_TCR_RD() & ~BM_ENET_TCR_ADDSEL) | BF_ENET_TCR_ADDSEL(v)))
  1926. #endif
  1927. //@}
  1928. /*! @name Register ENET_TCR, field ADDINS[8] (RW)
  1929. *
  1930. * Values:
  1931. * - 0 - The source MAC address is not modified by the MAC.
  1932. * - 1 - The MAC overwrites the source MAC address with the programmed MAC address according to ADDSEL.
  1933. */
  1934. //@{
  1935. #define BP_ENET_TCR_ADDINS (8) //!< Bit position for ENET_TCR_ADDINS.
  1936. #define BM_ENET_TCR_ADDINS (0x00000100) //!< Bit mask for ENET_TCR_ADDINS.
  1937. //! @brief Get value of ENET_TCR_ADDINS from a register value.
  1938. #define BG_ENET_TCR_ADDINS(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_TCR_ADDINS) >> BP_ENET_TCR_ADDINS)
  1939. //! @brief Format value for bitfield ENET_TCR_ADDINS.
  1940. #define BF_ENET_TCR_ADDINS(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_TCR_ADDINS) & BM_ENET_TCR_ADDINS)
  1941. #ifndef __LANGUAGE_ASM__
  1942. //! @brief Set the ADDINS field to a new value.
  1943. #define BW_ENET_TCR_ADDINS(v) (HW_ENET_TCR_WR((HW_ENET_TCR_RD() & ~BM_ENET_TCR_ADDINS) | BF_ENET_TCR_ADDINS(v)))
  1944. #endif
  1945. //@}
  1946. /*! @name Register ENET_TCR, field CRCFWD[9] (RW)
  1947. *
  1948. * Values:
  1949. * - 0 - TxBD[TC] controls whether the frame has a CRC from the application.
  1950. * - 1 - The transmitter does not append any CRC to transmitted frames, as it is expecting a frame with CRC
  1951. * from the application.
  1952. */
  1953. //@{
  1954. #define BP_ENET_TCR_CRCFWD (9) //!< Bit position for ENET_TCR_CRCFWD.
  1955. #define BM_ENET_TCR_CRCFWD (0x00000200) //!< Bit mask for ENET_TCR_CRCFWD.
  1956. //! @brief Get value of ENET_TCR_CRCFWD from a register value.
  1957. #define BG_ENET_TCR_CRCFWD(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_TCR_CRCFWD) >> BP_ENET_TCR_CRCFWD)
  1958. //! @brief Format value for bitfield ENET_TCR_CRCFWD.
  1959. #define BF_ENET_TCR_CRCFWD(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_TCR_CRCFWD) & BM_ENET_TCR_CRCFWD)
  1960. #ifndef __LANGUAGE_ASM__
  1961. //! @brief Set the CRCFWD field to a new value.
  1962. #define BW_ENET_TCR_CRCFWD(v) (HW_ENET_TCR_WR((HW_ENET_TCR_RD() & ~BM_ENET_TCR_CRCFWD) | BF_ENET_TCR_CRCFWD(v)))
  1963. #endif
  1964. //@}
  1965. //-------------------------------------------------------------------------------------------
  1966. // HW_ENET_PALR - Physical Address Lower Register
  1967. //-------------------------------------------------------------------------------------------
  1968. #ifndef __LANGUAGE_ASM__
  1969. /*!
  1970. * @brief HW_ENET_PALR - Physical Address Lower Register (RW)
  1971. *
  1972. * Reset value: 0x00000000
  1973. *
  1974. * PALR contains the lower 32 bits (bytes 0, 1, 2, 3) of the 48-bit address used in the address
  1975. * recognition process to compare with the destination address (DA) field of receive frames with an
  1976. * individual DA. In addition, this register is used in bytes 0 through 3 of the six-byte source
  1977. * address field when transmitting PAUSE frames. This register is not reset and you must initialize
  1978. * it.
  1979. */
  1980. typedef union _hw_enet_palr
  1981. {
  1982. reg32_t U;
  1983. struct _hw_enet_palr_bitfields
  1984. {
  1985. unsigned PADDR1 : 32; //!< [31:0] Pause Address
  1986. } B;
  1987. } hw_enet_palr_t;
  1988. #endif
  1989. /*!
  1990. * @name Constants and macros for entire ENET_PALR register
  1991. */
  1992. //@{
  1993. #define HW_ENET_PALR_ADDR (REGS_ENET_BASE + 0xe4)
  1994. #ifndef __LANGUAGE_ASM__
  1995. #define HW_ENET_PALR (*(volatile hw_enet_palr_t *) HW_ENET_PALR_ADDR)
  1996. #define HW_ENET_PALR_RD() (HW_ENET_PALR.U)
  1997. #define HW_ENET_PALR_WR(v) (HW_ENET_PALR.U = (v))
  1998. #define HW_ENET_PALR_SET(v) (HW_ENET_PALR_WR(HW_ENET_PALR_RD() | (v)))
  1999. #define HW_ENET_PALR_CLR(v) (HW_ENET_PALR_WR(HW_ENET_PALR_RD() & ~(v)))
  2000. #define HW_ENET_PALR_TOG(v) (HW_ENET_PALR_WR(HW_ENET_PALR_RD() ^ (v)))
  2001. #endif
  2002. //@}
  2003. /*
  2004. * constants & macros for individual ENET_PALR bitfields
  2005. */
  2006. /*! @name Register ENET_PALR, field PADDR1[31:0] (RW)
  2007. *
  2008. * Bytes 0 (bits 31:24), 1 (bits 23:16), 2 (bits 15:8), and 3 (bits 7:0) of the 6-byte individual
  2009. * address are used for exact match and the source address field in PAUSE frames.
  2010. */
  2011. //@{
  2012. #define BP_ENET_PALR_PADDR1 (0) //!< Bit position for ENET_PALR_PADDR1.
  2013. #define BM_ENET_PALR_PADDR1 (0xffffffff) //!< Bit mask for ENET_PALR_PADDR1.
  2014. //! @brief Get value of ENET_PALR_PADDR1 from a register value.
  2015. #define BG_ENET_PALR_PADDR1(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_PALR_PADDR1) >> BP_ENET_PALR_PADDR1)
  2016. //! @brief Format value for bitfield ENET_PALR_PADDR1.
  2017. #define BF_ENET_PALR_PADDR1(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_PALR_PADDR1) & BM_ENET_PALR_PADDR1)
  2018. #ifndef __LANGUAGE_ASM__
  2019. //! @brief Set the PADDR1 field to a new value.
  2020. #define BW_ENET_PALR_PADDR1(v) (HW_ENET_PALR_WR((HW_ENET_PALR_RD() & ~BM_ENET_PALR_PADDR1) | BF_ENET_PALR_PADDR1(v)))
  2021. #endif
  2022. //@}
  2023. //-------------------------------------------------------------------------------------------
  2024. // HW_ENET_PAUR - Physical Address Upper Register
  2025. //-------------------------------------------------------------------------------------------
  2026. #ifndef __LANGUAGE_ASM__
  2027. /*!
  2028. * @brief HW_ENET_PAUR - Physical Address Upper Register (RW)
  2029. *
  2030. * Reset value: 0x00008808
  2031. *
  2032. * PAUR contains the upper 16 bits (bytes 4 and 5) of the 48-bit address used in the address
  2033. * recognition process to compare with the destination address (DA) field of receive frames with an
  2034. * individual DA. In addition, this register is used in bytes 4 and 5 of the six-byte source address
  2035. * field when transmitting PAUSE frames. Bits 15:0 of PAUR contain a constant type field (0x8808)
  2036. * for transmission of PAUSE frames. The upper 16 bits of this register are not reset and you must
  2037. * initialize it.
  2038. */
  2039. typedef union _hw_enet_paur
  2040. {
  2041. reg32_t U;
  2042. struct _hw_enet_paur_bitfields
  2043. {
  2044. unsigned TYPE : 16; //!< [15:0] Type Field In PAUSE Frames
  2045. unsigned PADDR2 : 16; //!< [31:16] Bytes 4 (bits 31:24) and 5 (bits 23:16) of the 6-byte individual address used for exact match, and the source address field in PAUSE frames.
  2046. } B;
  2047. } hw_enet_paur_t;
  2048. #endif
  2049. /*!
  2050. * @name Constants and macros for entire ENET_PAUR register
  2051. */
  2052. //@{
  2053. #define HW_ENET_PAUR_ADDR (REGS_ENET_BASE + 0xe8)
  2054. #ifndef __LANGUAGE_ASM__
  2055. #define HW_ENET_PAUR (*(volatile hw_enet_paur_t *) HW_ENET_PAUR_ADDR)
  2056. #define HW_ENET_PAUR_RD() (HW_ENET_PAUR.U)
  2057. #define HW_ENET_PAUR_WR(v) (HW_ENET_PAUR.U = (v))
  2058. #define HW_ENET_PAUR_SET(v) (HW_ENET_PAUR_WR(HW_ENET_PAUR_RD() | (v)))
  2059. #define HW_ENET_PAUR_CLR(v) (HW_ENET_PAUR_WR(HW_ENET_PAUR_RD() & ~(v)))
  2060. #define HW_ENET_PAUR_TOG(v) (HW_ENET_PAUR_WR(HW_ENET_PAUR_RD() ^ (v)))
  2061. #endif
  2062. //@}
  2063. /*
  2064. * constants & macros for individual ENET_PAUR bitfields
  2065. */
  2066. /*! @name Register ENET_PAUR, field TYPE[15:0] (RO)
  2067. *
  2068. * These fields have a constant value of 0x8808.
  2069. */
  2070. //@{
  2071. #define BP_ENET_PAUR_TYPE (0) //!< Bit position for ENET_PAUR_TYPE.
  2072. #define BM_ENET_PAUR_TYPE (0x0000ffff) //!< Bit mask for ENET_PAUR_TYPE.
  2073. //! @brief Get value of ENET_PAUR_TYPE from a register value.
  2074. #define BG_ENET_PAUR_TYPE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_PAUR_TYPE) >> BP_ENET_PAUR_TYPE)
  2075. //@}
  2076. /*! @name Register ENET_PAUR, field PADDR2[31:16] (RW)
  2077. *
  2078. * Bytes 4 (bits 31:24) and 5 (bits 23:16) of the 6-byte individual address used for exact match,
  2079. * and the source address field in PAUSE frames.
  2080. */
  2081. //@{
  2082. #define BP_ENET_PAUR_PADDR2 (16) //!< Bit position for ENET_PAUR_PADDR2.
  2083. #define BM_ENET_PAUR_PADDR2 (0xffff0000) //!< Bit mask for ENET_PAUR_PADDR2.
  2084. //! @brief Get value of ENET_PAUR_PADDR2 from a register value.
  2085. #define BG_ENET_PAUR_PADDR2(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_PAUR_PADDR2) >> BP_ENET_PAUR_PADDR2)
  2086. //! @brief Format value for bitfield ENET_PAUR_PADDR2.
  2087. #define BF_ENET_PAUR_PADDR2(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_PAUR_PADDR2) & BM_ENET_PAUR_PADDR2)
  2088. #ifndef __LANGUAGE_ASM__
  2089. //! @brief Set the PADDR2 field to a new value.
  2090. #define BW_ENET_PAUR_PADDR2(v) (HW_ENET_PAUR_WR((HW_ENET_PAUR_RD() & ~BM_ENET_PAUR_PADDR2) | BF_ENET_PAUR_PADDR2(v)))
  2091. #endif
  2092. //@}
  2093. //-------------------------------------------------------------------------------------------
  2094. // HW_ENET_OPD - Opcode/Pause Duration Register
  2095. //-------------------------------------------------------------------------------------------
  2096. #ifndef __LANGUAGE_ASM__
  2097. /*!
  2098. * @brief HW_ENET_OPD - Opcode/Pause Duration Register (RW)
  2099. *
  2100. * Reset value: 0x00010000
  2101. *
  2102. * OPD is read/write accessible. This register contains the 16-bit opcode and 16-bit pause duration
  2103. * fields used in transmission of a PAUSE frame. The opcode field is a constant value, 0x0001. When
  2104. * another node detects a PAUSE frame, that node pauses transmission for the duration specified in
  2105. * the pause duration field. The lower 16 bits of this register are not reset and you must
  2106. * initialize it.
  2107. */
  2108. typedef union _hw_enet_opd
  2109. {
  2110. reg32_t U;
  2111. struct _hw_enet_opd_bitfields
  2112. {
  2113. unsigned PAUSE_DUR : 16; //!< [15:0] Pause Duration
  2114. unsigned OPCODE : 16; //!< [31:16] Opcode Field In PAUSE Frames
  2115. } B;
  2116. } hw_enet_opd_t;
  2117. #endif
  2118. /*!
  2119. * @name Constants and macros for entire ENET_OPD register
  2120. */
  2121. //@{
  2122. #define HW_ENET_OPD_ADDR (REGS_ENET_BASE + 0xec)
  2123. #ifndef __LANGUAGE_ASM__
  2124. #define HW_ENET_OPD (*(volatile hw_enet_opd_t *) HW_ENET_OPD_ADDR)
  2125. #define HW_ENET_OPD_RD() (HW_ENET_OPD.U)
  2126. #define HW_ENET_OPD_WR(v) (HW_ENET_OPD.U = (v))
  2127. #define HW_ENET_OPD_SET(v) (HW_ENET_OPD_WR(HW_ENET_OPD_RD() | (v)))
  2128. #define HW_ENET_OPD_CLR(v) (HW_ENET_OPD_WR(HW_ENET_OPD_RD() & ~(v)))
  2129. #define HW_ENET_OPD_TOG(v) (HW_ENET_OPD_WR(HW_ENET_OPD_RD() ^ (v)))
  2130. #endif
  2131. //@}
  2132. /*
  2133. * constants & macros for individual ENET_OPD bitfields
  2134. */
  2135. /*! @name Register ENET_OPD, field PAUSE_DUR[15:0] (RW)
  2136. *
  2137. * Pause duration field used in PAUSE frames.
  2138. */
  2139. //@{
  2140. #define BP_ENET_OPD_PAUSE_DUR (0) //!< Bit position for ENET_OPD_PAUSE_DUR.
  2141. #define BM_ENET_OPD_PAUSE_DUR (0x0000ffff) //!< Bit mask for ENET_OPD_PAUSE_DUR.
  2142. //! @brief Get value of ENET_OPD_PAUSE_DUR from a register value.
  2143. #define BG_ENET_OPD_PAUSE_DUR(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_OPD_PAUSE_DUR) >> BP_ENET_OPD_PAUSE_DUR)
  2144. //! @brief Format value for bitfield ENET_OPD_PAUSE_DUR.
  2145. #define BF_ENET_OPD_PAUSE_DUR(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_OPD_PAUSE_DUR) & BM_ENET_OPD_PAUSE_DUR)
  2146. #ifndef __LANGUAGE_ASM__
  2147. //! @brief Set the PAUSE_DUR field to a new value.
  2148. #define BW_ENET_OPD_PAUSE_DUR(v) (HW_ENET_OPD_WR((HW_ENET_OPD_RD() & ~BM_ENET_OPD_PAUSE_DUR) | BF_ENET_OPD_PAUSE_DUR(v)))
  2149. #endif
  2150. //@}
  2151. /*! @name Register ENET_OPD, field OPCODE[31:16] (RO)
  2152. *
  2153. * These fields have a constant value of 0x0001.
  2154. */
  2155. //@{
  2156. #define BP_ENET_OPD_OPCODE (16) //!< Bit position for ENET_OPD_OPCODE.
  2157. #define BM_ENET_OPD_OPCODE (0xffff0000) //!< Bit mask for ENET_OPD_OPCODE.
  2158. //! @brief Get value of ENET_OPD_OPCODE from a register value.
  2159. #define BG_ENET_OPD_OPCODE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_OPD_OPCODE) >> BP_ENET_OPD_OPCODE)
  2160. //@}
  2161. //-------------------------------------------------------------------------------------------
  2162. // HW_ENET_IAUR - Descriptor Individual Upper Address Register
  2163. //-------------------------------------------------------------------------------------------
  2164. #ifndef __LANGUAGE_ASM__
  2165. /*!
  2166. * @brief HW_ENET_IAUR - Descriptor Individual Upper Address Register (RW)
  2167. *
  2168. * Reset value: 0x00000000
  2169. *
  2170. * IAUR contains the upper 32 bits of the 64-bit individual address hash table. The address
  2171. * recognition process uses this table to check for a possible match with the destination address
  2172. * (DA) field of receive frames with an individual DA. This register is not reset and you must
  2173. * initialize it.
  2174. */
  2175. typedef union _hw_enet_iaur
  2176. {
  2177. reg32_t U;
  2178. struct _hw_enet_iaur_bitfields
  2179. {
  2180. unsigned IADDR1 : 32; //!< [31:0] Contains the upper 32 bits of the 64-bit hash table used in the address recognition process for receive frames with a unicast address.
  2181. } B;
  2182. } hw_enet_iaur_t;
  2183. #endif
  2184. /*!
  2185. * @name Constants and macros for entire ENET_IAUR register
  2186. */
  2187. //@{
  2188. #define HW_ENET_IAUR_ADDR (REGS_ENET_BASE + 0x118)
  2189. #ifndef __LANGUAGE_ASM__
  2190. #define HW_ENET_IAUR (*(volatile hw_enet_iaur_t *) HW_ENET_IAUR_ADDR)
  2191. #define HW_ENET_IAUR_RD() (HW_ENET_IAUR.U)
  2192. #define HW_ENET_IAUR_WR(v) (HW_ENET_IAUR.U = (v))
  2193. #define HW_ENET_IAUR_SET(v) (HW_ENET_IAUR_WR(HW_ENET_IAUR_RD() | (v)))
  2194. #define HW_ENET_IAUR_CLR(v) (HW_ENET_IAUR_WR(HW_ENET_IAUR_RD() & ~(v)))
  2195. #define HW_ENET_IAUR_TOG(v) (HW_ENET_IAUR_WR(HW_ENET_IAUR_RD() ^ (v)))
  2196. #endif
  2197. //@}
  2198. /*
  2199. * constants & macros for individual ENET_IAUR bitfields
  2200. */
  2201. /*! @name Register ENET_IAUR, field IADDR1[31:0] (RW)
  2202. *
  2203. * Contains the upper 32 bits of the 64-bit hash table used in the address recognition process for
  2204. * receive frames with a unicast address. Bit 31 of IADDR1 contains hash index bit 63. Bit 0 of
  2205. * IADDR1 contains hash index bit 32.
  2206. */
  2207. //@{
  2208. #define BP_ENET_IAUR_IADDR1 (0) //!< Bit position for ENET_IAUR_IADDR1.
  2209. #define BM_ENET_IAUR_IADDR1 (0xffffffff) //!< Bit mask for ENET_IAUR_IADDR1.
  2210. //! @brief Get value of ENET_IAUR_IADDR1 from a register value.
  2211. #define BG_ENET_IAUR_IADDR1(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_IAUR_IADDR1) >> BP_ENET_IAUR_IADDR1)
  2212. //! @brief Format value for bitfield ENET_IAUR_IADDR1.
  2213. #define BF_ENET_IAUR_IADDR1(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_IAUR_IADDR1) & BM_ENET_IAUR_IADDR1)
  2214. #ifndef __LANGUAGE_ASM__
  2215. //! @brief Set the IADDR1 field to a new value.
  2216. #define BW_ENET_IAUR_IADDR1(v) (HW_ENET_IAUR_WR((HW_ENET_IAUR_RD() & ~BM_ENET_IAUR_IADDR1) | BF_ENET_IAUR_IADDR1(v)))
  2217. #endif
  2218. //@}
  2219. //-------------------------------------------------------------------------------------------
  2220. // HW_ENET_IALR - Descriptor Individual Lower Address Register
  2221. //-------------------------------------------------------------------------------------------
  2222. #ifndef __LANGUAGE_ASM__
  2223. /*!
  2224. * @brief HW_ENET_IALR - Descriptor Individual Lower Address Register (RW)
  2225. *
  2226. * Reset value: 0x00000000
  2227. *
  2228. * IALR contains the lower 32 bits of the 64-bit individual address hash table. The address
  2229. * recognition process uses this table to check for a possible match with the DA field of receive
  2230. * frames with an individual DA. This register is not reset and you must initialize it.
  2231. */
  2232. typedef union _hw_enet_ialr
  2233. {
  2234. reg32_t U;
  2235. struct _hw_enet_ialr_bitfields
  2236. {
  2237. unsigned IADDR2 : 32; //!< [31:0] Contains the lower 32 bits of the 64-bit hash table used in the address recognition process for receive frames with a unicast address.
  2238. } B;
  2239. } hw_enet_ialr_t;
  2240. #endif
  2241. /*!
  2242. * @name Constants and macros for entire ENET_IALR register
  2243. */
  2244. //@{
  2245. #define HW_ENET_IALR_ADDR (REGS_ENET_BASE + 0x11c)
  2246. #ifndef __LANGUAGE_ASM__
  2247. #define HW_ENET_IALR (*(volatile hw_enet_ialr_t *) HW_ENET_IALR_ADDR)
  2248. #define HW_ENET_IALR_RD() (HW_ENET_IALR.U)
  2249. #define HW_ENET_IALR_WR(v) (HW_ENET_IALR.U = (v))
  2250. #define HW_ENET_IALR_SET(v) (HW_ENET_IALR_WR(HW_ENET_IALR_RD() | (v)))
  2251. #define HW_ENET_IALR_CLR(v) (HW_ENET_IALR_WR(HW_ENET_IALR_RD() & ~(v)))
  2252. #define HW_ENET_IALR_TOG(v) (HW_ENET_IALR_WR(HW_ENET_IALR_RD() ^ (v)))
  2253. #endif
  2254. //@}
  2255. /*
  2256. * constants & macros for individual ENET_IALR bitfields
  2257. */
  2258. /*! @name Register ENET_IALR, field IADDR2[31:0] (RW)
  2259. *
  2260. * Contains the lower 32 bits of the 64-bit hash table used in the address recognition process for
  2261. * receive frames with a unicast address. Bit 31 of IADDR2 contains hash index bit 31. Bit 0 of
  2262. * IADDR2 contains hash index bit 0.
  2263. */
  2264. //@{
  2265. #define BP_ENET_IALR_IADDR2 (0) //!< Bit position for ENET_IALR_IADDR2.
  2266. #define BM_ENET_IALR_IADDR2 (0xffffffff) //!< Bit mask for ENET_IALR_IADDR2.
  2267. //! @brief Get value of ENET_IALR_IADDR2 from a register value.
  2268. #define BG_ENET_IALR_IADDR2(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_IALR_IADDR2) >> BP_ENET_IALR_IADDR2)
  2269. //! @brief Format value for bitfield ENET_IALR_IADDR2.
  2270. #define BF_ENET_IALR_IADDR2(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_IALR_IADDR2) & BM_ENET_IALR_IADDR2)
  2271. #ifndef __LANGUAGE_ASM__
  2272. //! @brief Set the IADDR2 field to a new value.
  2273. #define BW_ENET_IALR_IADDR2(v) (HW_ENET_IALR_WR((HW_ENET_IALR_RD() & ~BM_ENET_IALR_IADDR2) | BF_ENET_IALR_IADDR2(v)))
  2274. #endif
  2275. //@}
  2276. //-------------------------------------------------------------------------------------------
  2277. // HW_ENET_GAUR - Descriptor Group Upper Address Register
  2278. //-------------------------------------------------------------------------------------------
  2279. #ifndef __LANGUAGE_ASM__
  2280. /*!
  2281. * @brief HW_ENET_GAUR - Descriptor Group Upper Address Register (RW)
  2282. *
  2283. * Reset value: 0x00000000
  2284. *
  2285. * GAUR contains the upper 32 bits of the 64-bit hash table used in the address recognition process
  2286. * for receive frames with a multicast address. You must initialize this register.
  2287. */
  2288. typedef union _hw_enet_gaur
  2289. {
  2290. reg32_t U;
  2291. struct _hw_enet_gaur_bitfields
  2292. {
  2293. unsigned GADDR1 : 32; //!< [31:0] Contains the upper 32 bits of the 64-bit hash table used in the address recognition process for receive frames with a multicast address.
  2294. } B;
  2295. } hw_enet_gaur_t;
  2296. #endif
  2297. /*!
  2298. * @name Constants and macros for entire ENET_GAUR register
  2299. */
  2300. //@{
  2301. #define HW_ENET_GAUR_ADDR (REGS_ENET_BASE + 0x120)
  2302. #ifndef __LANGUAGE_ASM__
  2303. #define HW_ENET_GAUR (*(volatile hw_enet_gaur_t *) HW_ENET_GAUR_ADDR)
  2304. #define HW_ENET_GAUR_RD() (HW_ENET_GAUR.U)
  2305. #define HW_ENET_GAUR_WR(v) (HW_ENET_GAUR.U = (v))
  2306. #define HW_ENET_GAUR_SET(v) (HW_ENET_GAUR_WR(HW_ENET_GAUR_RD() | (v)))
  2307. #define HW_ENET_GAUR_CLR(v) (HW_ENET_GAUR_WR(HW_ENET_GAUR_RD() & ~(v)))
  2308. #define HW_ENET_GAUR_TOG(v) (HW_ENET_GAUR_WR(HW_ENET_GAUR_RD() ^ (v)))
  2309. #endif
  2310. //@}
  2311. /*
  2312. * constants & macros for individual ENET_GAUR bitfields
  2313. */
  2314. /*! @name Register ENET_GAUR, field GADDR1[31:0] (RW)
  2315. *
  2316. * Contains the upper 32 bits of the 64-bit hash table used in the address recognition process for
  2317. * receive frames with a multicast address. Bit 31 of GADDR1 contains hash index bit 63. Bit 0 of
  2318. * GADDR1 contains hash index bit 32.
  2319. */
  2320. //@{
  2321. #define BP_ENET_GAUR_GADDR1 (0) //!< Bit position for ENET_GAUR_GADDR1.
  2322. #define BM_ENET_GAUR_GADDR1 (0xffffffff) //!< Bit mask for ENET_GAUR_GADDR1.
  2323. //! @brief Get value of ENET_GAUR_GADDR1 from a register value.
  2324. #define BG_ENET_GAUR_GADDR1(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_GAUR_GADDR1) >> BP_ENET_GAUR_GADDR1)
  2325. //! @brief Format value for bitfield ENET_GAUR_GADDR1.
  2326. #define BF_ENET_GAUR_GADDR1(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_GAUR_GADDR1) & BM_ENET_GAUR_GADDR1)
  2327. #ifndef __LANGUAGE_ASM__
  2328. //! @brief Set the GADDR1 field to a new value.
  2329. #define BW_ENET_GAUR_GADDR1(v) (HW_ENET_GAUR_WR((HW_ENET_GAUR_RD() & ~BM_ENET_GAUR_GADDR1) | BF_ENET_GAUR_GADDR1(v)))
  2330. #endif
  2331. //@}
  2332. //-------------------------------------------------------------------------------------------
  2333. // HW_ENET_GALR - Descriptor Group Lower Address Register
  2334. //-------------------------------------------------------------------------------------------
  2335. #ifndef __LANGUAGE_ASM__
  2336. /*!
  2337. * @brief HW_ENET_GALR - Descriptor Group Lower Address Register (RW)
  2338. *
  2339. * Reset value: 0x00000000
  2340. *
  2341. * GALR contains the lower 32 bits of the 64-bit hash table used in the address recognition process
  2342. * for receive frames with a multicast address. You must initialize this register.
  2343. */
  2344. typedef union _hw_enet_galr
  2345. {
  2346. reg32_t U;
  2347. struct _hw_enet_galr_bitfields
  2348. {
  2349. unsigned GADDR2 : 32; //!< [31:0] Contains the lower 32 bits of the 64-bit hash table used in the address recognition process for receive frames with a multicast address.
  2350. } B;
  2351. } hw_enet_galr_t;
  2352. #endif
  2353. /*!
  2354. * @name Constants and macros for entire ENET_GALR register
  2355. */
  2356. //@{
  2357. #define HW_ENET_GALR_ADDR (REGS_ENET_BASE + 0x124)
  2358. #ifndef __LANGUAGE_ASM__
  2359. #define HW_ENET_GALR (*(volatile hw_enet_galr_t *) HW_ENET_GALR_ADDR)
  2360. #define HW_ENET_GALR_RD() (HW_ENET_GALR.U)
  2361. #define HW_ENET_GALR_WR(v) (HW_ENET_GALR.U = (v))
  2362. #define HW_ENET_GALR_SET(v) (HW_ENET_GALR_WR(HW_ENET_GALR_RD() | (v)))
  2363. #define HW_ENET_GALR_CLR(v) (HW_ENET_GALR_WR(HW_ENET_GALR_RD() & ~(v)))
  2364. #define HW_ENET_GALR_TOG(v) (HW_ENET_GALR_WR(HW_ENET_GALR_RD() ^ (v)))
  2365. #endif
  2366. //@}
  2367. /*
  2368. * constants & macros for individual ENET_GALR bitfields
  2369. */
  2370. /*! @name Register ENET_GALR, field GADDR2[31:0] (RW)
  2371. *
  2372. * Contains the lower 32 bits of the 64-bit hash table used in the address recognition process for
  2373. * receive frames with a multicast address. Bit 31 of GADDR2 contains hash index bit 31. Bit 0 of
  2374. * GADDR2 contains hash index bit 0.
  2375. */
  2376. //@{
  2377. #define BP_ENET_GALR_GADDR2 (0) //!< Bit position for ENET_GALR_GADDR2.
  2378. #define BM_ENET_GALR_GADDR2 (0xffffffff) //!< Bit mask for ENET_GALR_GADDR2.
  2379. //! @brief Get value of ENET_GALR_GADDR2 from a register value.
  2380. #define BG_ENET_GALR_GADDR2(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_GALR_GADDR2) >> BP_ENET_GALR_GADDR2)
  2381. //! @brief Format value for bitfield ENET_GALR_GADDR2.
  2382. #define BF_ENET_GALR_GADDR2(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_GALR_GADDR2) & BM_ENET_GALR_GADDR2)
  2383. #ifndef __LANGUAGE_ASM__
  2384. //! @brief Set the GADDR2 field to a new value.
  2385. #define BW_ENET_GALR_GADDR2(v) (HW_ENET_GALR_WR((HW_ENET_GALR_RD() & ~BM_ENET_GALR_GADDR2) | BF_ENET_GALR_GADDR2(v)))
  2386. #endif
  2387. //@}
  2388. //-------------------------------------------------------------------------------------------
  2389. // HW_ENET_TFWR - Transmit FIFO Watermark Register
  2390. //-------------------------------------------------------------------------------------------
  2391. #ifndef __LANGUAGE_ASM__
  2392. /*!
  2393. * @brief HW_ENET_TFWR - Transmit FIFO Watermark Register (RW)
  2394. *
  2395. * Reset value: 0x00000000
  2396. *
  2397. * If TFR[STRFWD] is cleared, TFWR[TFWR] controls the amount of data required in the transmit FIFO
  2398. * before transmission of a frame can begin. This allows you to minimize transmit latency (TFWR = 00
  2399. * or 01) or allow for larger bus access latency (TFWR = 11) due to contention for the system bus.
  2400. * Setting the watermark to a high value minimizes the risk of transmit FIFO underrun due to
  2401. * contention for the system bus. The byte counts associated with the TFWR field may need to be
  2402. * modified to match a given system requirement. For example, worst case bus access latency by the
  2403. * transmit data DMA channel.
  2404. */
  2405. typedef union _hw_enet_tfwr
  2406. {
  2407. reg32_t U;
  2408. struct _hw_enet_tfwr_bitfields
  2409. {
  2410. unsigned TFWR : 6; //!< [5:0] Transmit FIFO Write
  2411. unsigned RESERVED0 : 2; //!< [7:6]
  2412. unsigned STRFWD : 1; //!< [8] Store And Forward Enable
  2413. unsigned RESERVED1 : 23; //!< [31:9]
  2414. } B;
  2415. } hw_enet_tfwr_t;
  2416. #endif
  2417. /*!
  2418. * @name Constants and macros for entire ENET_TFWR register
  2419. */
  2420. //@{
  2421. #define HW_ENET_TFWR_ADDR (REGS_ENET_BASE + 0x144)
  2422. #ifndef __LANGUAGE_ASM__
  2423. #define HW_ENET_TFWR (*(volatile hw_enet_tfwr_t *) HW_ENET_TFWR_ADDR)
  2424. #define HW_ENET_TFWR_RD() (HW_ENET_TFWR.U)
  2425. #define HW_ENET_TFWR_WR(v) (HW_ENET_TFWR.U = (v))
  2426. #define HW_ENET_TFWR_SET(v) (HW_ENET_TFWR_WR(HW_ENET_TFWR_RD() | (v)))
  2427. #define HW_ENET_TFWR_CLR(v) (HW_ENET_TFWR_WR(HW_ENET_TFWR_RD() & ~(v)))
  2428. #define HW_ENET_TFWR_TOG(v) (HW_ENET_TFWR_WR(HW_ENET_TFWR_RD() ^ (v)))
  2429. #endif
  2430. //@}
  2431. /*
  2432. * constants & macros for individual ENET_TFWR bitfields
  2433. */
  2434. /*! @name Register ENET_TFWR, field TFWR[5:0] (RW)
  2435. *
  2436. * If STRFWD is cleared, this field indicates the number of bytes written to the transmit FIFO
  2437. * before transmission of a frame begins. If a frame with less than the threshold is written, it is
  2438. * still sent independently of this threshold setting. The threshold is relevant only if the frame
  2439. * is larger than the threshold given. This chip may not support the maximum number of bytes written
  2440. * shown below. See the chip-specific information for the ENET module for this value.
  2441. *
  2442. * Values:
  2443. * - 000000 - 64 bytes written.
  2444. * - ... - ...
  2445. * - 000001 - 64 bytes written.
  2446. * - 000010 - 128 bytes written.
  2447. * - 000011 - 192 bytes written.
  2448. * - 111110 - 3968 bytes written.
  2449. * - 111111 - 4032 bytes written.
  2450. */
  2451. //@{
  2452. #define BP_ENET_TFWR_TFWR (0) //!< Bit position for ENET_TFWR_TFWR.
  2453. #define BM_ENET_TFWR_TFWR (0x0000003f) //!< Bit mask for ENET_TFWR_TFWR.
  2454. //! @brief Get value of ENET_TFWR_TFWR from a register value.
  2455. #define BG_ENET_TFWR_TFWR(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_TFWR_TFWR) >> BP_ENET_TFWR_TFWR)
  2456. //! @brief Format value for bitfield ENET_TFWR_TFWR.
  2457. #define BF_ENET_TFWR_TFWR(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_TFWR_TFWR) & BM_ENET_TFWR_TFWR)
  2458. #ifndef __LANGUAGE_ASM__
  2459. //! @brief Set the TFWR field to a new value.
  2460. #define BW_ENET_TFWR_TFWR(v) (HW_ENET_TFWR_WR((HW_ENET_TFWR_RD() & ~BM_ENET_TFWR_TFWR) | BF_ENET_TFWR_TFWR(v)))
  2461. #endif
  2462. //@}
  2463. /*! @name Register ENET_TFWR, field STRFWD[8] (RW)
  2464. *
  2465. * Values:
  2466. * - 0 - Disabled, the transmission start threshold is programmed in TFWR.
  2467. * - 1 - Enabled.
  2468. */
  2469. //@{
  2470. #define BP_ENET_TFWR_STRFWD (8) //!< Bit position for ENET_TFWR_STRFWD.
  2471. #define BM_ENET_TFWR_STRFWD (0x00000100) //!< Bit mask for ENET_TFWR_STRFWD.
  2472. //! @brief Get value of ENET_TFWR_STRFWD from a register value.
  2473. #define BG_ENET_TFWR_STRFWD(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_TFWR_STRFWD) >> BP_ENET_TFWR_STRFWD)
  2474. //! @brief Format value for bitfield ENET_TFWR_STRFWD.
  2475. #define BF_ENET_TFWR_STRFWD(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_TFWR_STRFWD) & BM_ENET_TFWR_STRFWD)
  2476. #ifndef __LANGUAGE_ASM__
  2477. //! @brief Set the STRFWD field to a new value.
  2478. #define BW_ENET_TFWR_STRFWD(v) (HW_ENET_TFWR_WR((HW_ENET_TFWR_RD() & ~BM_ENET_TFWR_STRFWD) | BF_ENET_TFWR_STRFWD(v)))
  2479. #endif
  2480. //@}
  2481. //-------------------------------------------------------------------------------------------
  2482. // HW_ENET_RDSR - Receive Descriptor Ring Start Register
  2483. //-------------------------------------------------------------------------------------------
  2484. #ifndef __LANGUAGE_ASM__
  2485. /*!
  2486. * @brief HW_ENET_RDSR - Receive Descriptor Ring Start Register (RW)
  2487. *
  2488. * Reset value: 0x00000000
  2489. *
  2490. * RDSR points to the beginning of the circular receive buffer descriptor queue in external memory.
  2491. * This pointer must be 64-bit aligned (bits 2–0 must be zero); however, This register must be
  2492. * initialized prior to operation
  2493. */
  2494. typedef union _hw_enet_rdsr
  2495. {
  2496. reg32_t U;
  2497. struct _hw_enet_rdsr_bitfields
  2498. {
  2499. unsigned RESERVED0 : 3; //!< [2:0]
  2500. unsigned R_DES_START : 29; //!< [31:3] Pointer to the beginning of the receive buffer descriptor queue.
  2501. } B;
  2502. } hw_enet_rdsr_t;
  2503. #endif
  2504. /*!
  2505. * @name Constants and macros for entire ENET_RDSR register
  2506. */
  2507. //@{
  2508. #define HW_ENET_RDSR_ADDR (REGS_ENET_BASE + 0x180)
  2509. #ifndef __LANGUAGE_ASM__
  2510. #define HW_ENET_RDSR (*(volatile hw_enet_rdsr_t *) HW_ENET_RDSR_ADDR)
  2511. #define HW_ENET_RDSR_RD() (HW_ENET_RDSR.U)
  2512. #define HW_ENET_RDSR_WR(v) (HW_ENET_RDSR.U = (v))
  2513. #define HW_ENET_RDSR_SET(v) (HW_ENET_RDSR_WR(HW_ENET_RDSR_RD() | (v)))
  2514. #define HW_ENET_RDSR_CLR(v) (HW_ENET_RDSR_WR(HW_ENET_RDSR_RD() & ~(v)))
  2515. #define HW_ENET_RDSR_TOG(v) (HW_ENET_RDSR_WR(HW_ENET_RDSR_RD() ^ (v)))
  2516. #endif
  2517. //@}
  2518. /*
  2519. * constants & macros for individual ENET_RDSR bitfields
  2520. */
  2521. /*! @name Register ENET_RDSR, field R_DES_START[31:3] (RW)
  2522. *
  2523. * Pointer to the beginning of the receive buffer descriptor queue.
  2524. */
  2525. //@{
  2526. #define BP_ENET_RDSR_R_DES_START (3) //!< Bit position for ENET_RDSR_R_DES_START.
  2527. #define BM_ENET_RDSR_R_DES_START (0xfffffff8) //!< Bit mask for ENET_RDSR_R_DES_START.
  2528. //! @brief Get value of ENET_RDSR_R_DES_START from a register value.
  2529. #define BG_ENET_RDSR_R_DES_START(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_RDSR_R_DES_START) >> BP_ENET_RDSR_R_DES_START)
  2530. //! @brief Format value for bitfield ENET_RDSR_R_DES_START.
  2531. #define BF_ENET_RDSR_R_DES_START(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_RDSR_R_DES_START) & BM_ENET_RDSR_R_DES_START)
  2532. #ifndef __LANGUAGE_ASM__
  2533. //! @brief Set the R_DES_START field to a new value.
  2534. #define BW_ENET_RDSR_R_DES_START(v) (HW_ENET_RDSR_WR((HW_ENET_RDSR_RD() & ~BM_ENET_RDSR_R_DES_START) | BF_ENET_RDSR_R_DES_START(v)))
  2535. #endif
  2536. //@}
  2537. //-------------------------------------------------------------------------------------------
  2538. // HW_ENET_TDSR - Transmit Buffer Descriptor Ring Start Register
  2539. //-------------------------------------------------------------------------------------------
  2540. #ifndef __LANGUAGE_ASM__
  2541. /*!
  2542. * @brief HW_ENET_TDSR - Transmit Buffer Descriptor Ring Start Register (RW)
  2543. *
  2544. * Reset value: 0x00000000
  2545. *
  2546. * TDSR provides a pointer to the beginning of the circular transmit buffer descriptor queue in
  2547. * external memory. This pointer must be 64-bit aligned (bits 2–0 must be zero); however, This
  2548. * register must be initialized prior to operation.
  2549. */
  2550. typedef union _hw_enet_tdsr
  2551. {
  2552. reg32_t U;
  2553. struct _hw_enet_tdsr_bitfields
  2554. {
  2555. unsigned RESERVED0 : 3; //!< [2:0]
  2556. unsigned X_DES_START : 29; //!< [31:3] Pointer to the beginning of the transmit buffer descriptor queue.
  2557. } B;
  2558. } hw_enet_tdsr_t;
  2559. #endif
  2560. /*!
  2561. * @name Constants and macros for entire ENET_TDSR register
  2562. */
  2563. //@{
  2564. #define HW_ENET_TDSR_ADDR (REGS_ENET_BASE + 0x184)
  2565. #ifndef __LANGUAGE_ASM__
  2566. #define HW_ENET_TDSR (*(volatile hw_enet_tdsr_t *) HW_ENET_TDSR_ADDR)
  2567. #define HW_ENET_TDSR_RD() (HW_ENET_TDSR.U)
  2568. #define HW_ENET_TDSR_WR(v) (HW_ENET_TDSR.U = (v))
  2569. #define HW_ENET_TDSR_SET(v) (HW_ENET_TDSR_WR(HW_ENET_TDSR_RD() | (v)))
  2570. #define HW_ENET_TDSR_CLR(v) (HW_ENET_TDSR_WR(HW_ENET_TDSR_RD() & ~(v)))
  2571. #define HW_ENET_TDSR_TOG(v) (HW_ENET_TDSR_WR(HW_ENET_TDSR_RD() ^ (v)))
  2572. #endif
  2573. //@}
  2574. /*
  2575. * constants & macros for individual ENET_TDSR bitfields
  2576. */
  2577. /*! @name Register ENET_TDSR, field X_DES_START[31:3] (RW)
  2578. *
  2579. * Pointer to the beginning of the transmit buffer descriptor queue.
  2580. */
  2581. //@{
  2582. #define BP_ENET_TDSR_X_DES_START (3) //!< Bit position for ENET_TDSR_X_DES_START.
  2583. #define BM_ENET_TDSR_X_DES_START (0xfffffff8) //!< Bit mask for ENET_TDSR_X_DES_START.
  2584. //! @brief Get value of ENET_TDSR_X_DES_START from a register value.
  2585. #define BG_ENET_TDSR_X_DES_START(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_TDSR_X_DES_START) >> BP_ENET_TDSR_X_DES_START)
  2586. //! @brief Format value for bitfield ENET_TDSR_X_DES_START.
  2587. #define BF_ENET_TDSR_X_DES_START(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_TDSR_X_DES_START) & BM_ENET_TDSR_X_DES_START)
  2588. #ifndef __LANGUAGE_ASM__
  2589. //! @brief Set the X_DES_START field to a new value.
  2590. #define BW_ENET_TDSR_X_DES_START(v) (HW_ENET_TDSR_WR((HW_ENET_TDSR_RD() & ~BM_ENET_TDSR_X_DES_START) | BF_ENET_TDSR_X_DES_START(v)))
  2591. #endif
  2592. //@}
  2593. //-------------------------------------------------------------------------------------------
  2594. // HW_ENET_MRBR - Maximum Receive Buffer Size Register
  2595. //-------------------------------------------------------------------------------------------
  2596. #ifndef __LANGUAGE_ASM__
  2597. /*!
  2598. * @brief HW_ENET_MRBR - Maximum Receive Buffer Size Register (RW)
  2599. *
  2600. * Reset value: 0x00000000
  2601. *
  2602. * The MRBR is a user-programmable register that dictates the maximum size of all receive buffers.
  2603. * This value should take into consideration that the receive CRC is always written into the last
  2604. * receive buffer. To allow one maximum size frame per buffer, MRBR must be set to RCR[MAX_FL] or
  2605. * larger. To properly align the buffer, MRBR must be evenly divisible by To minimize bus usage
  2606. * (descriptor fetches), set MRBR greater than or equal to 256 bytes. This register must be
  2607. * initialized before operation.
  2608. */
  2609. typedef union _hw_enet_mrbr
  2610. {
  2611. reg32_t U;
  2612. struct _hw_enet_mrbr_bitfields
  2613. {
  2614. unsigned RESERVED0 : 4; //!< [3:0]
  2615. unsigned R_BUF_SIZE : 10; //!< [13:4] Receive buffer size in bytes.
  2616. unsigned RESERVED1 : 18; //!< [31:14]
  2617. } B;
  2618. } hw_enet_mrbr_t;
  2619. #endif
  2620. /*!
  2621. * @name Constants and macros for entire ENET_MRBR register
  2622. */
  2623. //@{
  2624. #define HW_ENET_MRBR_ADDR (REGS_ENET_BASE + 0x188)
  2625. #ifndef __LANGUAGE_ASM__
  2626. #define HW_ENET_MRBR (*(volatile hw_enet_mrbr_t *) HW_ENET_MRBR_ADDR)
  2627. #define HW_ENET_MRBR_RD() (HW_ENET_MRBR.U)
  2628. #define HW_ENET_MRBR_WR(v) (HW_ENET_MRBR.U = (v))
  2629. #define HW_ENET_MRBR_SET(v) (HW_ENET_MRBR_WR(HW_ENET_MRBR_RD() | (v)))
  2630. #define HW_ENET_MRBR_CLR(v) (HW_ENET_MRBR_WR(HW_ENET_MRBR_RD() & ~(v)))
  2631. #define HW_ENET_MRBR_TOG(v) (HW_ENET_MRBR_WR(HW_ENET_MRBR_RD() ^ (v)))
  2632. #endif
  2633. //@}
  2634. /*
  2635. * constants & macros for individual ENET_MRBR bitfields
  2636. */
  2637. /*! @name Register ENET_MRBR, field R_BUF_SIZE[13:4] (RW)
  2638. *
  2639. * Receive buffer size in bytes.
  2640. */
  2641. //@{
  2642. #define BP_ENET_MRBR_R_BUF_SIZE (4) //!< Bit position for ENET_MRBR_R_BUF_SIZE.
  2643. #define BM_ENET_MRBR_R_BUF_SIZE (0x00003ff0) //!< Bit mask for ENET_MRBR_R_BUF_SIZE.
  2644. //! @brief Get value of ENET_MRBR_R_BUF_SIZE from a register value.
  2645. #define BG_ENET_MRBR_R_BUF_SIZE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_MRBR_R_BUF_SIZE) >> BP_ENET_MRBR_R_BUF_SIZE)
  2646. //! @brief Format value for bitfield ENET_MRBR_R_BUF_SIZE.
  2647. #define BF_ENET_MRBR_R_BUF_SIZE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_MRBR_R_BUF_SIZE) & BM_ENET_MRBR_R_BUF_SIZE)
  2648. #ifndef __LANGUAGE_ASM__
  2649. //! @brief Set the R_BUF_SIZE field to a new value.
  2650. #define BW_ENET_MRBR_R_BUF_SIZE(v) (HW_ENET_MRBR_WR((HW_ENET_MRBR_RD() & ~BM_ENET_MRBR_R_BUF_SIZE) | BF_ENET_MRBR_R_BUF_SIZE(v)))
  2651. #endif
  2652. //@}
  2653. //-------------------------------------------------------------------------------------------
  2654. // HW_ENET_RSFL - Receive FIFO Section Full Threshold
  2655. //-------------------------------------------------------------------------------------------
  2656. #ifndef __LANGUAGE_ASM__
  2657. /*!
  2658. * @brief HW_ENET_RSFL - Receive FIFO Section Full Threshold (RW)
  2659. *
  2660. * Reset value: 0x00000000
  2661. */
  2662. typedef union _hw_enet_rsfl
  2663. {
  2664. reg32_t U;
  2665. struct _hw_enet_rsfl_bitfields
  2666. {
  2667. unsigned RESERVED0 : 32; //!< [31:0] Reserved.
  2668. } B;
  2669. } hw_enet_rsfl_t;
  2670. #endif
  2671. /*!
  2672. * @name Constants and macros for entire ENET_RSFL register
  2673. */
  2674. //@{
  2675. #define HW_ENET_RSFL_ADDR (REGS_ENET_BASE + 0x190)
  2676. #ifndef __LANGUAGE_ASM__
  2677. #define HW_ENET_RSFL (*(volatile hw_enet_rsfl_t *) HW_ENET_RSFL_ADDR)
  2678. #define HW_ENET_RSFL_RD() (HW_ENET_RSFL.U)
  2679. #define HW_ENET_RSFL_WR(v) (HW_ENET_RSFL.U = (v))
  2680. #define HW_ENET_RSFL_SET(v) (HW_ENET_RSFL_WR(HW_ENET_RSFL_RD() | (v)))
  2681. #define HW_ENET_RSFL_CLR(v) (HW_ENET_RSFL_WR(HW_ENET_RSFL_RD() & ~(v)))
  2682. #define HW_ENET_RSFL_TOG(v) (HW_ENET_RSFL_WR(HW_ENET_RSFL_RD() ^ (v)))
  2683. #endif
  2684. //@}
  2685. /*
  2686. * constants & macros for individual ENET_RSFL bitfields
  2687. */
  2688. //-------------------------------------------------------------------------------------------
  2689. // HW_ENET_RSEM - Receive FIFO Section Empty Threshold
  2690. //-------------------------------------------------------------------------------------------
  2691. #ifndef __LANGUAGE_ASM__
  2692. /*!
  2693. * @brief HW_ENET_RSEM - Receive FIFO Section Empty Threshold (RW)
  2694. *
  2695. * Reset value: 0x00000000
  2696. */
  2697. typedef union _hw_enet_rsem
  2698. {
  2699. reg32_t U;
  2700. struct _hw_enet_rsem_bitfields
  2701. {
  2702. unsigned RESERVED0 : 32; //!< [31:0] Reserved.
  2703. } B;
  2704. } hw_enet_rsem_t;
  2705. #endif
  2706. /*!
  2707. * @name Constants and macros for entire ENET_RSEM register
  2708. */
  2709. //@{
  2710. #define HW_ENET_RSEM_ADDR (REGS_ENET_BASE + 0x194)
  2711. #ifndef __LANGUAGE_ASM__
  2712. #define HW_ENET_RSEM (*(volatile hw_enet_rsem_t *) HW_ENET_RSEM_ADDR)
  2713. #define HW_ENET_RSEM_RD() (HW_ENET_RSEM.U)
  2714. #define HW_ENET_RSEM_WR(v) (HW_ENET_RSEM.U = (v))
  2715. #define HW_ENET_RSEM_SET(v) (HW_ENET_RSEM_WR(HW_ENET_RSEM_RD() | (v)))
  2716. #define HW_ENET_RSEM_CLR(v) (HW_ENET_RSEM_WR(HW_ENET_RSEM_RD() & ~(v)))
  2717. #define HW_ENET_RSEM_TOG(v) (HW_ENET_RSEM_WR(HW_ENET_RSEM_RD() ^ (v)))
  2718. #endif
  2719. //@}
  2720. /*
  2721. * constants & macros for individual ENET_RSEM bitfields
  2722. */
  2723. //-------------------------------------------------------------------------------------------
  2724. // HW_ENET_RAEM - Receive FIFO Almost Empty Threshold
  2725. //-------------------------------------------------------------------------------------------
  2726. #ifndef __LANGUAGE_ASM__
  2727. /*!
  2728. * @brief HW_ENET_RAEM - Receive FIFO Almost Empty Threshold (RW)
  2729. *
  2730. * Reset value: 0x00000004
  2731. */
  2732. typedef union _hw_enet_raem
  2733. {
  2734. reg32_t U;
  2735. struct _hw_enet_raem_bitfields
  2736. {
  2737. unsigned RESERVED0 : 32; //!< [31:0] Reserved.
  2738. } B;
  2739. } hw_enet_raem_t;
  2740. #endif
  2741. /*!
  2742. * @name Constants and macros for entire ENET_RAEM register
  2743. */
  2744. //@{
  2745. #define HW_ENET_RAEM_ADDR (REGS_ENET_BASE + 0x198)
  2746. #ifndef __LANGUAGE_ASM__
  2747. #define HW_ENET_RAEM (*(volatile hw_enet_raem_t *) HW_ENET_RAEM_ADDR)
  2748. #define HW_ENET_RAEM_RD() (HW_ENET_RAEM.U)
  2749. #define HW_ENET_RAEM_WR(v) (HW_ENET_RAEM.U = (v))
  2750. #define HW_ENET_RAEM_SET(v) (HW_ENET_RAEM_WR(HW_ENET_RAEM_RD() | (v)))
  2751. #define HW_ENET_RAEM_CLR(v) (HW_ENET_RAEM_WR(HW_ENET_RAEM_RD() & ~(v)))
  2752. #define HW_ENET_RAEM_TOG(v) (HW_ENET_RAEM_WR(HW_ENET_RAEM_RD() ^ (v)))
  2753. #endif
  2754. //@}
  2755. /*
  2756. * constants & macros for individual ENET_RAEM bitfields
  2757. */
  2758. //-------------------------------------------------------------------------------------------
  2759. // HW_ENET_RAFL - Receive FIFO Almost Full Threshold
  2760. //-------------------------------------------------------------------------------------------
  2761. #ifndef __LANGUAGE_ASM__
  2762. /*!
  2763. * @brief HW_ENET_RAFL - Receive FIFO Almost Full Threshold (RW)
  2764. *
  2765. * Reset value: 0x00000004
  2766. */
  2767. typedef union _hw_enet_rafl
  2768. {
  2769. reg32_t U;
  2770. struct _hw_enet_rafl_bitfields
  2771. {
  2772. unsigned RESERVED0 : 32; //!< [31:0] Reserved.
  2773. } B;
  2774. } hw_enet_rafl_t;
  2775. #endif
  2776. /*!
  2777. * @name Constants and macros for entire ENET_RAFL register
  2778. */
  2779. //@{
  2780. #define HW_ENET_RAFL_ADDR (REGS_ENET_BASE + 0x19c)
  2781. #ifndef __LANGUAGE_ASM__
  2782. #define HW_ENET_RAFL (*(volatile hw_enet_rafl_t *) HW_ENET_RAFL_ADDR)
  2783. #define HW_ENET_RAFL_RD() (HW_ENET_RAFL.U)
  2784. #define HW_ENET_RAFL_WR(v) (HW_ENET_RAFL.U = (v))
  2785. #define HW_ENET_RAFL_SET(v) (HW_ENET_RAFL_WR(HW_ENET_RAFL_RD() | (v)))
  2786. #define HW_ENET_RAFL_CLR(v) (HW_ENET_RAFL_WR(HW_ENET_RAFL_RD() & ~(v)))
  2787. #define HW_ENET_RAFL_TOG(v) (HW_ENET_RAFL_WR(HW_ENET_RAFL_RD() ^ (v)))
  2788. #endif
  2789. //@}
  2790. /*
  2791. * constants & macros for individual ENET_RAFL bitfields
  2792. */
  2793. //-------------------------------------------------------------------------------------------
  2794. // HW_ENET_TSEM - Transmit FIFO Section Empty Threshold
  2795. //-------------------------------------------------------------------------------------------
  2796. #ifndef __LANGUAGE_ASM__
  2797. /*!
  2798. * @brief HW_ENET_TSEM - Transmit FIFO Section Empty Threshold (RW)
  2799. *
  2800. * Reset value: 0x00000000
  2801. */
  2802. typedef union _hw_enet_tsem
  2803. {
  2804. reg32_t U;
  2805. struct _hw_enet_tsem_bitfields
  2806. {
  2807. unsigned RESERVED0 : 32; //!< [31:0] Reserved.
  2808. } B;
  2809. } hw_enet_tsem_t;
  2810. #endif
  2811. /*!
  2812. * @name Constants and macros for entire ENET_TSEM register
  2813. */
  2814. //@{
  2815. #define HW_ENET_TSEM_ADDR (REGS_ENET_BASE + 0x1a0)
  2816. #ifndef __LANGUAGE_ASM__
  2817. #define HW_ENET_TSEM (*(volatile hw_enet_tsem_t *) HW_ENET_TSEM_ADDR)
  2818. #define HW_ENET_TSEM_RD() (HW_ENET_TSEM.U)
  2819. #define HW_ENET_TSEM_WR(v) (HW_ENET_TSEM.U = (v))
  2820. #define HW_ENET_TSEM_SET(v) (HW_ENET_TSEM_WR(HW_ENET_TSEM_RD() | (v)))
  2821. #define HW_ENET_TSEM_CLR(v) (HW_ENET_TSEM_WR(HW_ENET_TSEM_RD() & ~(v)))
  2822. #define HW_ENET_TSEM_TOG(v) (HW_ENET_TSEM_WR(HW_ENET_TSEM_RD() ^ (v)))
  2823. #endif
  2824. //@}
  2825. /*
  2826. * constants & macros for individual ENET_TSEM bitfields
  2827. */
  2828. //-------------------------------------------------------------------------------------------
  2829. // HW_ENET_TAEM - Transmit FIFO Almost Empty Threshold
  2830. //-------------------------------------------------------------------------------------------
  2831. #ifndef __LANGUAGE_ASM__
  2832. /*!
  2833. * @brief HW_ENET_TAEM - Transmit FIFO Almost Empty Threshold (RW)
  2834. *
  2835. * Reset value: 0x00000004
  2836. */
  2837. typedef union _hw_enet_taem
  2838. {
  2839. reg32_t U;
  2840. struct _hw_enet_taem_bitfields
  2841. {
  2842. unsigned RESERVED0 : 32; //!< [31:0] Reserved.
  2843. } B;
  2844. } hw_enet_taem_t;
  2845. #endif
  2846. /*!
  2847. * @name Constants and macros for entire ENET_TAEM register
  2848. */
  2849. //@{
  2850. #define HW_ENET_TAEM_ADDR (REGS_ENET_BASE + 0x1a4)
  2851. #ifndef __LANGUAGE_ASM__
  2852. #define HW_ENET_TAEM (*(volatile hw_enet_taem_t *) HW_ENET_TAEM_ADDR)
  2853. #define HW_ENET_TAEM_RD() (HW_ENET_TAEM.U)
  2854. #define HW_ENET_TAEM_WR(v) (HW_ENET_TAEM.U = (v))
  2855. #define HW_ENET_TAEM_SET(v) (HW_ENET_TAEM_WR(HW_ENET_TAEM_RD() | (v)))
  2856. #define HW_ENET_TAEM_CLR(v) (HW_ENET_TAEM_WR(HW_ENET_TAEM_RD() & ~(v)))
  2857. #define HW_ENET_TAEM_TOG(v) (HW_ENET_TAEM_WR(HW_ENET_TAEM_RD() ^ (v)))
  2858. #endif
  2859. //@}
  2860. /*
  2861. * constants & macros for individual ENET_TAEM bitfields
  2862. */
  2863. //-------------------------------------------------------------------------------------------
  2864. // HW_ENET_TAFL - Transmit FIFO Almost Full Threshold
  2865. //-------------------------------------------------------------------------------------------
  2866. #ifndef __LANGUAGE_ASM__
  2867. /*!
  2868. * @brief HW_ENET_TAFL - Transmit FIFO Almost Full Threshold (RW)
  2869. *
  2870. * Reset value: 0x00000008
  2871. */
  2872. typedef union _hw_enet_tafl
  2873. {
  2874. reg32_t U;
  2875. struct _hw_enet_tafl_bitfields
  2876. {
  2877. unsigned RESERVED0 : 32; //!< [31:0] Reserved.
  2878. } B;
  2879. } hw_enet_tafl_t;
  2880. #endif
  2881. /*!
  2882. * @name Constants and macros for entire ENET_TAFL register
  2883. */
  2884. //@{
  2885. #define HW_ENET_TAFL_ADDR (REGS_ENET_BASE + 0x1a8)
  2886. #ifndef __LANGUAGE_ASM__
  2887. #define HW_ENET_TAFL (*(volatile hw_enet_tafl_t *) HW_ENET_TAFL_ADDR)
  2888. #define HW_ENET_TAFL_RD() (HW_ENET_TAFL.U)
  2889. #define HW_ENET_TAFL_WR(v) (HW_ENET_TAFL.U = (v))
  2890. #define HW_ENET_TAFL_SET(v) (HW_ENET_TAFL_WR(HW_ENET_TAFL_RD() | (v)))
  2891. #define HW_ENET_TAFL_CLR(v) (HW_ENET_TAFL_WR(HW_ENET_TAFL_RD() & ~(v)))
  2892. #define HW_ENET_TAFL_TOG(v) (HW_ENET_TAFL_WR(HW_ENET_TAFL_RD() ^ (v)))
  2893. #endif
  2894. //@}
  2895. /*
  2896. * constants & macros for individual ENET_TAFL bitfields
  2897. */
  2898. //-------------------------------------------------------------------------------------------
  2899. // HW_ENET_TIPG - Transmit Inter-Packet Gap
  2900. //-------------------------------------------------------------------------------------------
  2901. #ifndef __LANGUAGE_ASM__
  2902. /*!
  2903. * @brief HW_ENET_TIPG - Transmit Inter-Packet Gap (RW)
  2904. *
  2905. * Reset value: 0x0000000c
  2906. */
  2907. typedef union _hw_enet_tipg
  2908. {
  2909. reg32_t U;
  2910. struct _hw_enet_tipg_bitfields
  2911. {
  2912. unsigned IPG : 5; //!< [4:0] Transmit Inter-Packet Gap
  2913. unsigned RESERVED0 : 27; //!< [31:5]
  2914. } B;
  2915. } hw_enet_tipg_t;
  2916. #endif
  2917. /*!
  2918. * @name Constants and macros for entire ENET_TIPG register
  2919. */
  2920. //@{
  2921. #define HW_ENET_TIPG_ADDR (REGS_ENET_BASE + 0x1ac)
  2922. #ifndef __LANGUAGE_ASM__
  2923. #define HW_ENET_TIPG (*(volatile hw_enet_tipg_t *) HW_ENET_TIPG_ADDR)
  2924. #define HW_ENET_TIPG_RD() (HW_ENET_TIPG.U)
  2925. #define HW_ENET_TIPG_WR(v) (HW_ENET_TIPG.U = (v))
  2926. #define HW_ENET_TIPG_SET(v) (HW_ENET_TIPG_WR(HW_ENET_TIPG_RD() | (v)))
  2927. #define HW_ENET_TIPG_CLR(v) (HW_ENET_TIPG_WR(HW_ENET_TIPG_RD() & ~(v)))
  2928. #define HW_ENET_TIPG_TOG(v) (HW_ENET_TIPG_WR(HW_ENET_TIPG_RD() ^ (v)))
  2929. #endif
  2930. //@}
  2931. /*
  2932. * constants & macros for individual ENET_TIPG bitfields
  2933. */
  2934. /*! @name Register ENET_TIPG, field IPG[4:0] (RW)
  2935. *
  2936. * Indicates the IPG, in bytes, between transmitted frames. Valid values range from 8 to 27. If
  2937. * value is less than 8, the IPG is 8. If value is greater than 27, the IPG is 27.
  2938. */
  2939. //@{
  2940. #define BP_ENET_TIPG_IPG (0) //!< Bit position for ENET_TIPG_IPG.
  2941. #define BM_ENET_TIPG_IPG (0x0000001f) //!< Bit mask for ENET_TIPG_IPG.
  2942. //! @brief Get value of ENET_TIPG_IPG from a register value.
  2943. #define BG_ENET_TIPG_IPG(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_TIPG_IPG) >> BP_ENET_TIPG_IPG)
  2944. //! @brief Format value for bitfield ENET_TIPG_IPG.
  2945. #define BF_ENET_TIPG_IPG(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_TIPG_IPG) & BM_ENET_TIPG_IPG)
  2946. #ifndef __LANGUAGE_ASM__
  2947. //! @brief Set the IPG field to a new value.
  2948. #define BW_ENET_TIPG_IPG(v) (HW_ENET_TIPG_WR((HW_ENET_TIPG_RD() & ~BM_ENET_TIPG_IPG) | BF_ENET_TIPG_IPG(v)))
  2949. #endif
  2950. //@}
  2951. //-------------------------------------------------------------------------------------------
  2952. // HW_ENET_FTRL - Frame Truncation Length
  2953. //-------------------------------------------------------------------------------------------
  2954. #ifndef __LANGUAGE_ASM__
  2955. /*!
  2956. * @brief HW_ENET_FTRL - Frame Truncation Length (RW)
  2957. *
  2958. * Reset value: 0x000007ff
  2959. */
  2960. typedef union _hw_enet_ftrl
  2961. {
  2962. reg32_t U;
  2963. struct _hw_enet_ftrl_bitfields
  2964. {
  2965. unsigned TRUNC_FL : 14; //!< [13:0] Frame Truncation Length
  2966. unsigned RESERVED0 : 18; //!< [31:14]
  2967. } B;
  2968. } hw_enet_ftrl_t;
  2969. #endif
  2970. /*!
  2971. * @name Constants and macros for entire ENET_FTRL register
  2972. */
  2973. //@{
  2974. #define HW_ENET_FTRL_ADDR (REGS_ENET_BASE + 0x1b0)
  2975. #ifndef __LANGUAGE_ASM__
  2976. #define HW_ENET_FTRL (*(volatile hw_enet_ftrl_t *) HW_ENET_FTRL_ADDR)
  2977. #define HW_ENET_FTRL_RD() (HW_ENET_FTRL.U)
  2978. #define HW_ENET_FTRL_WR(v) (HW_ENET_FTRL.U = (v))
  2979. #define HW_ENET_FTRL_SET(v) (HW_ENET_FTRL_WR(HW_ENET_FTRL_RD() | (v)))
  2980. #define HW_ENET_FTRL_CLR(v) (HW_ENET_FTRL_WR(HW_ENET_FTRL_RD() & ~(v)))
  2981. #define HW_ENET_FTRL_TOG(v) (HW_ENET_FTRL_WR(HW_ENET_FTRL_RD() ^ (v)))
  2982. #endif
  2983. //@}
  2984. /*
  2985. * constants & macros for individual ENET_FTRL bitfields
  2986. */
  2987. /*! @name Register ENET_FTRL, field TRUNC_FL[13:0] (RW)
  2988. *
  2989. * Indicates the value a receive frame is truncated, if it is greater than this value. Must be
  2990. * greater than or equal to RCR[MAX_FL]. Truncation happens at TRUNC_FL. However, when truncation
  2991. * occurs, the application (FIFO) may receive less data, guaranteeing that it never receives more
  2992. * than the set limit.
  2993. */
  2994. //@{
  2995. #define BP_ENET_FTRL_TRUNC_FL (0) //!< Bit position for ENET_FTRL_TRUNC_FL.
  2996. #define BM_ENET_FTRL_TRUNC_FL (0x00003fff) //!< Bit mask for ENET_FTRL_TRUNC_FL.
  2997. //! @brief Get value of ENET_FTRL_TRUNC_FL from a register value.
  2998. #define BG_ENET_FTRL_TRUNC_FL(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_FTRL_TRUNC_FL) >> BP_ENET_FTRL_TRUNC_FL)
  2999. //! @brief Format value for bitfield ENET_FTRL_TRUNC_FL.
  3000. #define BF_ENET_FTRL_TRUNC_FL(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_FTRL_TRUNC_FL) & BM_ENET_FTRL_TRUNC_FL)
  3001. #ifndef __LANGUAGE_ASM__
  3002. //! @brief Set the TRUNC_FL field to a new value.
  3003. #define BW_ENET_FTRL_TRUNC_FL(v) (HW_ENET_FTRL_WR((HW_ENET_FTRL_RD() & ~BM_ENET_FTRL_TRUNC_FL) | BF_ENET_FTRL_TRUNC_FL(v)))
  3004. #endif
  3005. //@}
  3006. //-------------------------------------------------------------------------------------------
  3007. // HW_ENET_TACC - Transmit Accelerator Function Configuration
  3008. //-------------------------------------------------------------------------------------------
  3009. #ifndef __LANGUAGE_ASM__
  3010. /*!
  3011. * @brief HW_ENET_TACC - Transmit Accelerator Function Configuration (RW)
  3012. *
  3013. * Reset value: 0x00000000
  3014. *
  3015. * TACC controls accelerator actions when sending frames. The register can be changed before or
  3016. * after each frame, but it must remain unmodified during frame writes into the transmit FIFO. The
  3017. * TFWR[STRFWD] field must be set to use the checksum feature.
  3018. */
  3019. typedef union _hw_enet_tacc
  3020. {
  3021. reg32_t U;
  3022. struct _hw_enet_tacc_bitfields
  3023. {
  3024. unsigned SHIFT16 : 1; //!< [0] TX FIFO Shift-16
  3025. unsigned RESERVED0 : 2; //!< [2:1]
  3026. unsigned IPCHK : 1; //!< [3] Enables insertion of IP header checksum.
  3027. unsigned PROCHK : 1; //!< [4] Enables insertion of protocol checksum.
  3028. unsigned RESERVED1 : 27; //!< [31:5]
  3029. } B;
  3030. } hw_enet_tacc_t;
  3031. #endif
  3032. /*!
  3033. * @name Constants and macros for entire ENET_TACC register
  3034. */
  3035. //@{
  3036. #define HW_ENET_TACC_ADDR (REGS_ENET_BASE + 0x1c0)
  3037. #ifndef __LANGUAGE_ASM__
  3038. #define HW_ENET_TACC (*(volatile hw_enet_tacc_t *) HW_ENET_TACC_ADDR)
  3039. #define HW_ENET_TACC_RD() (HW_ENET_TACC.U)
  3040. #define HW_ENET_TACC_WR(v) (HW_ENET_TACC.U = (v))
  3041. #define HW_ENET_TACC_SET(v) (HW_ENET_TACC_WR(HW_ENET_TACC_RD() | (v)))
  3042. #define HW_ENET_TACC_CLR(v) (HW_ENET_TACC_WR(HW_ENET_TACC_RD() & ~(v)))
  3043. #define HW_ENET_TACC_TOG(v) (HW_ENET_TACC_WR(HW_ENET_TACC_RD() ^ (v)))
  3044. #endif
  3045. //@}
  3046. /*
  3047. * constants & macros for individual ENET_TACC bitfields
  3048. */
  3049. /*! @name Register ENET_TACC, field SHIFT16[0] (RW)
  3050. *
  3051. * Values:
  3052. * - 0 - Disabled.
  3053. * - 1 - Indicates to the transmit data FIFO that the written frames contain two additional octets before the
  3054. * frame data. This means the actual frame begins at bit 16 of the first word written into the
  3055. * FIFO. This function allows putting the frame payload on a 32-bit boundary in memory, as the
  3056. * 14-byte Ethernet header is extended to a 16-byte header.
  3057. */
  3058. //@{
  3059. #define BP_ENET_TACC_SHIFT16 (0) //!< Bit position for ENET_TACC_SHIFT16.
  3060. #define BM_ENET_TACC_SHIFT16 (0x00000001) //!< Bit mask for ENET_TACC_SHIFT16.
  3061. //! @brief Get value of ENET_TACC_SHIFT16 from a register value.
  3062. #define BG_ENET_TACC_SHIFT16(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_TACC_SHIFT16) >> BP_ENET_TACC_SHIFT16)
  3063. //! @brief Format value for bitfield ENET_TACC_SHIFT16.
  3064. #define BF_ENET_TACC_SHIFT16(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_TACC_SHIFT16) & BM_ENET_TACC_SHIFT16)
  3065. #ifndef __LANGUAGE_ASM__
  3066. //! @brief Set the SHIFT16 field to a new value.
  3067. #define BW_ENET_TACC_SHIFT16(v) (HW_ENET_TACC_WR((HW_ENET_TACC_RD() & ~BM_ENET_TACC_SHIFT16) | BF_ENET_TACC_SHIFT16(v)))
  3068. #endif
  3069. //@}
  3070. /*! @name Register ENET_TACC, field IPCHK[3] (RW)
  3071. *
  3072. * Enables insertion of IP header checksum.
  3073. *
  3074. * Values:
  3075. * - 0 - Checksum is not inserted.
  3076. * - 1 - If an IP frame is transmitted, the checksum is inserted automatically. The IP header checksum field
  3077. * must be cleared. If a non-IP frame is transmitted the frame is not modified.
  3078. */
  3079. //@{
  3080. #define BP_ENET_TACC_IPCHK (3) //!< Bit position for ENET_TACC_IPCHK.
  3081. #define BM_ENET_TACC_IPCHK (0x00000008) //!< Bit mask for ENET_TACC_IPCHK.
  3082. //! @brief Get value of ENET_TACC_IPCHK from a register value.
  3083. #define BG_ENET_TACC_IPCHK(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_TACC_IPCHK) >> BP_ENET_TACC_IPCHK)
  3084. //! @brief Format value for bitfield ENET_TACC_IPCHK.
  3085. #define BF_ENET_TACC_IPCHK(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_TACC_IPCHK) & BM_ENET_TACC_IPCHK)
  3086. #ifndef __LANGUAGE_ASM__
  3087. //! @brief Set the IPCHK field to a new value.
  3088. #define BW_ENET_TACC_IPCHK(v) (HW_ENET_TACC_WR((HW_ENET_TACC_RD() & ~BM_ENET_TACC_IPCHK) | BF_ENET_TACC_IPCHK(v)))
  3089. #endif
  3090. //@}
  3091. /*! @name Register ENET_TACC, field PROCHK[4] (RW)
  3092. *
  3093. * Enables insertion of protocol checksum.
  3094. *
  3095. * Values:
  3096. * - 0 - Checksum not inserted.
  3097. * - 1 - If an IP frame with a known protocol is transmitted, the checksum is inserted automatically into the
  3098. * frame. The checksum field must be cleared. The other frames are not modified.
  3099. */
  3100. //@{
  3101. #define BP_ENET_TACC_PROCHK (4) //!< Bit position for ENET_TACC_PROCHK.
  3102. #define BM_ENET_TACC_PROCHK (0x00000010) //!< Bit mask for ENET_TACC_PROCHK.
  3103. //! @brief Get value of ENET_TACC_PROCHK from a register value.
  3104. #define BG_ENET_TACC_PROCHK(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_TACC_PROCHK) >> BP_ENET_TACC_PROCHK)
  3105. //! @brief Format value for bitfield ENET_TACC_PROCHK.
  3106. #define BF_ENET_TACC_PROCHK(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_TACC_PROCHK) & BM_ENET_TACC_PROCHK)
  3107. #ifndef __LANGUAGE_ASM__
  3108. //! @brief Set the PROCHK field to a new value.
  3109. #define BW_ENET_TACC_PROCHK(v) (HW_ENET_TACC_WR((HW_ENET_TACC_RD() & ~BM_ENET_TACC_PROCHK) | BF_ENET_TACC_PROCHK(v)))
  3110. #endif
  3111. //@}
  3112. //-------------------------------------------------------------------------------------------
  3113. // HW_ENET_RACC - Receive Accelerator Function Configuration
  3114. //-------------------------------------------------------------------------------------------
  3115. #ifndef __LANGUAGE_ASM__
  3116. /*!
  3117. * @brief HW_ENET_RACC - Receive Accelerator Function Configuration (RW)
  3118. *
  3119. * Reset value: 0x00000000
  3120. */
  3121. typedef union _hw_enet_racc
  3122. {
  3123. reg32_t U;
  3124. struct _hw_enet_racc_bitfields
  3125. {
  3126. unsigned PADREM : 1; //!< [0] Enable Padding Removal For Short IP Frames
  3127. unsigned IPDIS : 1; //!< [1] Enable Discard Of Frames With Wrong IPv4 Header Checksum
  3128. unsigned PRODIS : 1; //!< [2] Enable Discard Of Frames With Wrong Protocol Checksum
  3129. unsigned RESERVED0 : 3; //!< [5:3]
  3130. unsigned LINEDIS : 1; //!< [6] Enable Discard Of Frames With MAC Layer Errors
  3131. unsigned SHIFT16 : 1; //!< [7] RX FIFO Shift-16
  3132. unsigned RESERVED1 : 24; //!< [31:8]
  3133. } B;
  3134. } hw_enet_racc_t;
  3135. #endif
  3136. /*!
  3137. * @name Constants and macros for entire ENET_RACC register
  3138. */
  3139. //@{
  3140. #define HW_ENET_RACC_ADDR (REGS_ENET_BASE + 0x1c4)
  3141. #ifndef __LANGUAGE_ASM__
  3142. #define HW_ENET_RACC (*(volatile hw_enet_racc_t *) HW_ENET_RACC_ADDR)
  3143. #define HW_ENET_RACC_RD() (HW_ENET_RACC.U)
  3144. #define HW_ENET_RACC_WR(v) (HW_ENET_RACC.U = (v))
  3145. #define HW_ENET_RACC_SET(v) (HW_ENET_RACC_WR(HW_ENET_RACC_RD() | (v)))
  3146. #define HW_ENET_RACC_CLR(v) (HW_ENET_RACC_WR(HW_ENET_RACC_RD() & ~(v)))
  3147. #define HW_ENET_RACC_TOG(v) (HW_ENET_RACC_WR(HW_ENET_RACC_RD() ^ (v)))
  3148. #endif
  3149. //@}
  3150. /*
  3151. * constants & macros for individual ENET_RACC bitfields
  3152. */
  3153. /*! @name Register ENET_RACC, field PADREM[0] (RW)
  3154. *
  3155. * Values:
  3156. * - 0 - Padding not removed.
  3157. * - 1 - Any bytes following the IP payload section of the frame are removed from the frame.
  3158. */
  3159. //@{
  3160. #define BP_ENET_RACC_PADREM (0) //!< Bit position for ENET_RACC_PADREM.
  3161. #define BM_ENET_RACC_PADREM (0x00000001) //!< Bit mask for ENET_RACC_PADREM.
  3162. //! @brief Get value of ENET_RACC_PADREM from a register value.
  3163. #define BG_ENET_RACC_PADREM(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_RACC_PADREM) >> BP_ENET_RACC_PADREM)
  3164. //! @brief Format value for bitfield ENET_RACC_PADREM.
  3165. #define BF_ENET_RACC_PADREM(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_RACC_PADREM) & BM_ENET_RACC_PADREM)
  3166. #ifndef __LANGUAGE_ASM__
  3167. //! @brief Set the PADREM field to a new value.
  3168. #define BW_ENET_RACC_PADREM(v) (HW_ENET_RACC_WR((HW_ENET_RACC_RD() & ~BM_ENET_RACC_PADREM) | BF_ENET_RACC_PADREM(v)))
  3169. #endif
  3170. //@}
  3171. /*! @name Register ENET_RACC, field IPDIS[1] (RW)
  3172. *
  3173. * Values:
  3174. * - 0 - Frames with wrong IPv4 header checksum are not discarded.
  3175. * - 1 - If an IPv4 frame is received with a mismatching header checksum, the frame is discarded. IPv6 has no
  3176. * header checksum and is not affected by this setting. Discarding is only available when the RX
  3177. * FIFO operates in store and forward mode (RSFL cleared).
  3178. */
  3179. //@{
  3180. #define BP_ENET_RACC_IPDIS (1) //!< Bit position for ENET_RACC_IPDIS.
  3181. #define BM_ENET_RACC_IPDIS (0x00000002) //!< Bit mask for ENET_RACC_IPDIS.
  3182. //! @brief Get value of ENET_RACC_IPDIS from a register value.
  3183. #define BG_ENET_RACC_IPDIS(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_RACC_IPDIS) >> BP_ENET_RACC_IPDIS)
  3184. //! @brief Format value for bitfield ENET_RACC_IPDIS.
  3185. #define BF_ENET_RACC_IPDIS(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_RACC_IPDIS) & BM_ENET_RACC_IPDIS)
  3186. #ifndef __LANGUAGE_ASM__
  3187. //! @brief Set the IPDIS field to a new value.
  3188. #define BW_ENET_RACC_IPDIS(v) (HW_ENET_RACC_WR((HW_ENET_RACC_RD() & ~BM_ENET_RACC_IPDIS) | BF_ENET_RACC_IPDIS(v)))
  3189. #endif
  3190. //@}
  3191. /*! @name Register ENET_RACC, field PRODIS[2] (RW)
  3192. *
  3193. * Values:
  3194. * - 0 - Frames with wrong checksum are not discarded.
  3195. * - 1 - If a TCP/IP, UDP/IP, or ICMP/IP frame is received that has a wrong TCP, UDP, or ICMP checksum, the
  3196. * frame is discarded. Discarding is only available when the RX FIFO operates in store and
  3197. * forward mode (RSFL cleared).
  3198. */
  3199. //@{
  3200. #define BP_ENET_RACC_PRODIS (2) //!< Bit position for ENET_RACC_PRODIS.
  3201. #define BM_ENET_RACC_PRODIS (0x00000004) //!< Bit mask for ENET_RACC_PRODIS.
  3202. //! @brief Get value of ENET_RACC_PRODIS from a register value.
  3203. #define BG_ENET_RACC_PRODIS(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_RACC_PRODIS) >> BP_ENET_RACC_PRODIS)
  3204. //! @brief Format value for bitfield ENET_RACC_PRODIS.
  3205. #define BF_ENET_RACC_PRODIS(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_RACC_PRODIS) & BM_ENET_RACC_PRODIS)
  3206. #ifndef __LANGUAGE_ASM__
  3207. //! @brief Set the PRODIS field to a new value.
  3208. #define BW_ENET_RACC_PRODIS(v) (HW_ENET_RACC_WR((HW_ENET_RACC_RD() & ~BM_ENET_RACC_PRODIS) | BF_ENET_RACC_PRODIS(v)))
  3209. #endif
  3210. //@}
  3211. /*! @name Register ENET_RACC, field LINEDIS[6] (RW)
  3212. *
  3213. * Values:
  3214. * - 0 - Frames with errors are not discarded.
  3215. * - 1 - Any frame received with a CRC, length, or PHY error is automatically discarded and not forwarded to
  3216. * the user application interface.
  3217. */
  3218. //@{
  3219. #define BP_ENET_RACC_LINEDIS (6) //!< Bit position for ENET_RACC_LINEDIS.
  3220. #define BM_ENET_RACC_LINEDIS (0x00000040) //!< Bit mask for ENET_RACC_LINEDIS.
  3221. //! @brief Get value of ENET_RACC_LINEDIS from a register value.
  3222. #define BG_ENET_RACC_LINEDIS(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_RACC_LINEDIS) >> BP_ENET_RACC_LINEDIS)
  3223. //! @brief Format value for bitfield ENET_RACC_LINEDIS.
  3224. #define BF_ENET_RACC_LINEDIS(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_RACC_LINEDIS) & BM_ENET_RACC_LINEDIS)
  3225. #ifndef __LANGUAGE_ASM__
  3226. //! @brief Set the LINEDIS field to a new value.
  3227. #define BW_ENET_RACC_LINEDIS(v) (HW_ENET_RACC_WR((HW_ENET_RACC_RD() & ~BM_ENET_RACC_LINEDIS) | BF_ENET_RACC_LINEDIS(v)))
  3228. #endif
  3229. //@}
  3230. /*! @name Register ENET_RACC, field SHIFT16[7] (RW)
  3231. *
  3232. * When this field is set, the actual frame data starts at bit 16 of the first word read from the RX
  3233. * FIFO aligning the Ethernet payload on a 32-bit boundary. This function only affects the FIFO
  3234. * storage and has no influence on the statistics, which use the actual length of the frame
  3235. * received.
  3236. *
  3237. * Values:
  3238. * - 0 - Disabled.
  3239. * - 1 - Instructs the MAC to write two additional bytes in front of each frame received into the RX FIFO.
  3240. */
  3241. //@{
  3242. #define BP_ENET_RACC_SHIFT16 (7) //!< Bit position for ENET_RACC_SHIFT16.
  3243. #define BM_ENET_RACC_SHIFT16 (0x00000080) //!< Bit mask for ENET_RACC_SHIFT16.
  3244. //! @brief Get value of ENET_RACC_SHIFT16 from a register value.
  3245. #define BG_ENET_RACC_SHIFT16(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_RACC_SHIFT16) >> BP_ENET_RACC_SHIFT16)
  3246. //! @brief Format value for bitfield ENET_RACC_SHIFT16.
  3247. #define BF_ENET_RACC_SHIFT16(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_RACC_SHIFT16) & BM_ENET_RACC_SHIFT16)
  3248. #ifndef __LANGUAGE_ASM__
  3249. //! @brief Set the SHIFT16 field to a new value.
  3250. #define BW_ENET_RACC_SHIFT16(v) (HW_ENET_RACC_WR((HW_ENET_RACC_RD() & ~BM_ENET_RACC_SHIFT16) | BF_ENET_RACC_SHIFT16(v)))
  3251. #endif
  3252. //@}
  3253. //-------------------------------------------------------------------------------------------
  3254. // HW_ENET_ATCR - Timer Control Register
  3255. //-------------------------------------------------------------------------------------------
  3256. #ifndef __LANGUAGE_ASM__
  3257. /*!
  3258. * @brief HW_ENET_ATCR - Timer Control Register (RW)
  3259. *
  3260. * Reset value: 0x00000000
  3261. *
  3262. * ATCR command fields can trigger the corresponding events directly. It is not necessary to
  3263. * preserve any of the configuration fields when a command field is set in the register, that is, no
  3264. * read-modify-write is required. The fields are automatically cleared after the command completes.
  3265. */
  3266. typedef union _hw_enet_atcr
  3267. {
  3268. reg32_t U;
  3269. struct _hw_enet_atcr_bitfields
  3270. {
  3271. unsigned EN : 1; //!< [0] Enable Timer
  3272. unsigned RESERVED0 : 1; //!< [1]
  3273. unsigned OFFEN : 1; //!< [2] Enable One-Shot Offset Event
  3274. unsigned OFFRST : 1; //!< [3] Reset Timer On Offset Event
  3275. unsigned PEREN : 1; //!< [4] Enable Periodical Event
  3276. unsigned RESERVED1 : 2; //!< [6:5]
  3277. unsigned PINPER : 1; //!< [7] Enables event signal output assertion on period event.
  3278. unsigned RESERVED2 : 1; //!< [8]
  3279. unsigned RESTART : 1; //!< [9] Reset Timer
  3280. unsigned RESERVED3 : 1; //!< [10]
  3281. unsigned CAPTURE : 1; //!< [11] Capture Timer Value
  3282. unsigned RESERVED4 : 1; //!< [12]
  3283. unsigned SLAVE : 1; //!< [13] Enable Timer Slave Mode
  3284. unsigned RESERVED5 : 18; //!< [31:14]
  3285. } B;
  3286. } hw_enet_atcr_t;
  3287. #endif
  3288. /*!
  3289. * @name Constants and macros for entire ENET_ATCR register
  3290. */
  3291. //@{
  3292. #define HW_ENET_ATCR_ADDR (REGS_ENET_BASE + 0x400)
  3293. #ifndef __LANGUAGE_ASM__
  3294. #define HW_ENET_ATCR (*(volatile hw_enet_atcr_t *) HW_ENET_ATCR_ADDR)
  3295. #define HW_ENET_ATCR_RD() (HW_ENET_ATCR.U)
  3296. #define HW_ENET_ATCR_WR(v) (HW_ENET_ATCR.U = (v))
  3297. #define HW_ENET_ATCR_SET(v) (HW_ENET_ATCR_WR(HW_ENET_ATCR_RD() | (v)))
  3298. #define HW_ENET_ATCR_CLR(v) (HW_ENET_ATCR_WR(HW_ENET_ATCR_RD() & ~(v)))
  3299. #define HW_ENET_ATCR_TOG(v) (HW_ENET_ATCR_WR(HW_ENET_ATCR_RD() ^ (v)))
  3300. #endif
  3301. //@}
  3302. /*
  3303. * constants & macros for individual ENET_ATCR bitfields
  3304. */
  3305. /*! @name Register ENET_ATCR, field EN[0] (RW)
  3306. *
  3307. * Values:
  3308. * - 0 - The timer stops at the current value.
  3309. * - 1 - The timer starts incrementing.
  3310. */
  3311. //@{
  3312. #define BP_ENET_ATCR_EN (0) //!< Bit position for ENET_ATCR_EN.
  3313. #define BM_ENET_ATCR_EN (0x00000001) //!< Bit mask for ENET_ATCR_EN.
  3314. //! @brief Get value of ENET_ATCR_EN from a register value.
  3315. #define BG_ENET_ATCR_EN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_ATCR_EN) >> BP_ENET_ATCR_EN)
  3316. //! @brief Format value for bitfield ENET_ATCR_EN.
  3317. #define BF_ENET_ATCR_EN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_ATCR_EN) & BM_ENET_ATCR_EN)
  3318. #ifndef __LANGUAGE_ASM__
  3319. //! @brief Set the EN field to a new value.
  3320. #define BW_ENET_ATCR_EN(v) (HW_ENET_ATCR_WR((HW_ENET_ATCR_RD() & ~BM_ENET_ATCR_EN) | BF_ENET_ATCR_EN(v)))
  3321. #endif
  3322. //@}
  3323. /*! @name Register ENET_ATCR, field OFFEN[2] (RW)
  3324. *
  3325. * Values:
  3326. * - 0 - Disable.
  3327. * - 1 - The timer can be reset to zero when the given offset time is reached (offset event). The field is
  3328. * cleared when the offset event is reached, so no further event occurs until the field is set
  3329. * again. The timer offset value must be set before setting this field.
  3330. */
  3331. //@{
  3332. #define BP_ENET_ATCR_OFFEN (2) //!< Bit position for ENET_ATCR_OFFEN.
  3333. #define BM_ENET_ATCR_OFFEN (0x00000004) //!< Bit mask for ENET_ATCR_OFFEN.
  3334. //! @brief Get value of ENET_ATCR_OFFEN from a register value.
  3335. #define BG_ENET_ATCR_OFFEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_ATCR_OFFEN) >> BP_ENET_ATCR_OFFEN)
  3336. //! @brief Format value for bitfield ENET_ATCR_OFFEN.
  3337. #define BF_ENET_ATCR_OFFEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_ATCR_OFFEN) & BM_ENET_ATCR_OFFEN)
  3338. #ifndef __LANGUAGE_ASM__
  3339. //! @brief Set the OFFEN field to a new value.
  3340. #define BW_ENET_ATCR_OFFEN(v) (HW_ENET_ATCR_WR((HW_ENET_ATCR_RD() & ~BM_ENET_ATCR_OFFEN) | BF_ENET_ATCR_OFFEN(v)))
  3341. #endif
  3342. //@}
  3343. /*! @name Register ENET_ATCR, field OFFRST[3] (RW)
  3344. *
  3345. * Values:
  3346. * - 0 - The timer is not affected and no action occurs, besides clearing OFFEN, when the offset is reached.
  3347. * - 1 - If OFFEN is set, the timer resets to zero when the offset setting is reached. The offset event does
  3348. * not cause a timer interrupt.
  3349. */
  3350. //@{
  3351. #define BP_ENET_ATCR_OFFRST (3) //!< Bit position for ENET_ATCR_OFFRST.
  3352. #define BM_ENET_ATCR_OFFRST (0x00000008) //!< Bit mask for ENET_ATCR_OFFRST.
  3353. //! @brief Get value of ENET_ATCR_OFFRST from a register value.
  3354. #define BG_ENET_ATCR_OFFRST(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_ATCR_OFFRST) >> BP_ENET_ATCR_OFFRST)
  3355. //! @brief Format value for bitfield ENET_ATCR_OFFRST.
  3356. #define BF_ENET_ATCR_OFFRST(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_ATCR_OFFRST) & BM_ENET_ATCR_OFFRST)
  3357. #ifndef __LANGUAGE_ASM__
  3358. //! @brief Set the OFFRST field to a new value.
  3359. #define BW_ENET_ATCR_OFFRST(v) (HW_ENET_ATCR_WR((HW_ENET_ATCR_RD() & ~BM_ENET_ATCR_OFFRST) | BF_ENET_ATCR_OFFRST(v)))
  3360. #endif
  3361. //@}
  3362. /*! @name Register ENET_ATCR, field PEREN[4] (RW)
  3363. *
  3364. * Values:
  3365. * - 0 - Disable.
  3366. * - 1 - A period event interrupt can be generated (EIR[TS_TIMER]) and the event signal output is asserted
  3367. * when the timer wraps around according to the periodic setting ATPER. The timer period value
  3368. * must be set before setting this bit. Not all devices contain the event signal output. See the
  3369. * chip configuration details.
  3370. */
  3371. //@{
  3372. #define BP_ENET_ATCR_PEREN (4) //!< Bit position for ENET_ATCR_PEREN.
  3373. #define BM_ENET_ATCR_PEREN (0x00000010) //!< Bit mask for ENET_ATCR_PEREN.
  3374. //! @brief Get value of ENET_ATCR_PEREN from a register value.
  3375. #define BG_ENET_ATCR_PEREN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_ATCR_PEREN) >> BP_ENET_ATCR_PEREN)
  3376. //! @brief Format value for bitfield ENET_ATCR_PEREN.
  3377. #define BF_ENET_ATCR_PEREN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_ATCR_PEREN) & BM_ENET_ATCR_PEREN)
  3378. #ifndef __LANGUAGE_ASM__
  3379. //! @brief Set the PEREN field to a new value.
  3380. #define BW_ENET_ATCR_PEREN(v) (HW_ENET_ATCR_WR((HW_ENET_ATCR_RD() & ~BM_ENET_ATCR_PEREN) | BF_ENET_ATCR_PEREN(v)))
  3381. #endif
  3382. //@}
  3383. /*! @name Register ENET_ATCR, field PINPER[7] (RW)
  3384. *
  3385. * Enables event signal output assertion on period event. Not all devices contain the event signal
  3386. * output. See the chip configuration details.
  3387. *
  3388. * Values:
  3389. * - 0 - Disable.
  3390. * - 1 - Enable.
  3391. */
  3392. //@{
  3393. #define BP_ENET_ATCR_PINPER (7) //!< Bit position for ENET_ATCR_PINPER.
  3394. #define BM_ENET_ATCR_PINPER (0x00000080) //!< Bit mask for ENET_ATCR_PINPER.
  3395. //! @brief Get value of ENET_ATCR_PINPER from a register value.
  3396. #define BG_ENET_ATCR_PINPER(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_ATCR_PINPER) >> BP_ENET_ATCR_PINPER)
  3397. //! @brief Format value for bitfield ENET_ATCR_PINPER.
  3398. #define BF_ENET_ATCR_PINPER(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_ATCR_PINPER) & BM_ENET_ATCR_PINPER)
  3399. #ifndef __LANGUAGE_ASM__
  3400. //! @brief Set the PINPER field to a new value.
  3401. #define BW_ENET_ATCR_PINPER(v) (HW_ENET_ATCR_WR((HW_ENET_ATCR_RD() & ~BM_ENET_ATCR_PINPER) | BF_ENET_ATCR_PINPER(v)))
  3402. #endif
  3403. //@}
  3404. /*! @name Register ENET_ATCR, field RESTART[9] (RW)
  3405. *
  3406. * Resets the timer to zero. This has no effect on the counter enable. If the counter is enabled
  3407. * when this field is set, the timer is reset to zero and starts counting from there. When set, all
  3408. * other fields are ignored during a write.
  3409. */
  3410. //@{
  3411. #define BP_ENET_ATCR_RESTART (9) //!< Bit position for ENET_ATCR_RESTART.
  3412. #define BM_ENET_ATCR_RESTART (0x00000200) //!< Bit mask for ENET_ATCR_RESTART.
  3413. //! @brief Get value of ENET_ATCR_RESTART from a register value.
  3414. #define BG_ENET_ATCR_RESTART(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_ATCR_RESTART) >> BP_ENET_ATCR_RESTART)
  3415. //! @brief Format value for bitfield ENET_ATCR_RESTART.
  3416. #define BF_ENET_ATCR_RESTART(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_ATCR_RESTART) & BM_ENET_ATCR_RESTART)
  3417. #ifndef __LANGUAGE_ASM__
  3418. //! @brief Set the RESTART field to a new value.
  3419. #define BW_ENET_ATCR_RESTART(v) (HW_ENET_ATCR_WR((HW_ENET_ATCR_RD() & ~BM_ENET_ATCR_RESTART) | BF_ENET_ATCR_RESTART(v)))
  3420. #endif
  3421. //@}
  3422. /*! @name Register ENET_ATCR, field CAPTURE[11] (RW)
  3423. *
  3424. * Values:
  3425. * - 0 - No effect.
  3426. * - 1 - The current time is captured and can be read from the ATVR register.
  3427. */
  3428. //@{
  3429. #define BP_ENET_ATCR_CAPTURE (11) //!< Bit position for ENET_ATCR_CAPTURE.
  3430. #define BM_ENET_ATCR_CAPTURE (0x00000800) //!< Bit mask for ENET_ATCR_CAPTURE.
  3431. //! @brief Get value of ENET_ATCR_CAPTURE from a register value.
  3432. #define BG_ENET_ATCR_CAPTURE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_ATCR_CAPTURE) >> BP_ENET_ATCR_CAPTURE)
  3433. //! @brief Format value for bitfield ENET_ATCR_CAPTURE.
  3434. #define BF_ENET_ATCR_CAPTURE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_ATCR_CAPTURE) & BM_ENET_ATCR_CAPTURE)
  3435. #ifndef __LANGUAGE_ASM__
  3436. //! @brief Set the CAPTURE field to a new value.
  3437. #define BW_ENET_ATCR_CAPTURE(v) (HW_ENET_ATCR_WR((HW_ENET_ATCR_RD() & ~BM_ENET_ATCR_CAPTURE) | BF_ENET_ATCR_CAPTURE(v)))
  3438. #endif
  3439. //@}
  3440. /*! @name Register ENET_ATCR, field SLAVE[13] (RW)
  3441. *
  3442. * Values:
  3443. * - 0 - The timer is active and all configuration fields in this register are relevant.
  3444. * - 1 - The internal timer is disabled and the externally provided timer value is used. All other fields,
  3445. * except CAPTURE, in this register have no effect. CAPTURE can still be used to capture the
  3446. * current timer value.
  3447. */
  3448. //@{
  3449. #define BP_ENET_ATCR_SLAVE (13) //!< Bit position for ENET_ATCR_SLAVE.
  3450. #define BM_ENET_ATCR_SLAVE (0x00002000) //!< Bit mask for ENET_ATCR_SLAVE.
  3451. //! @brief Get value of ENET_ATCR_SLAVE from a register value.
  3452. #define BG_ENET_ATCR_SLAVE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_ATCR_SLAVE) >> BP_ENET_ATCR_SLAVE)
  3453. //! @brief Format value for bitfield ENET_ATCR_SLAVE.
  3454. #define BF_ENET_ATCR_SLAVE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_ATCR_SLAVE) & BM_ENET_ATCR_SLAVE)
  3455. #ifndef __LANGUAGE_ASM__
  3456. //! @brief Set the SLAVE field to a new value.
  3457. #define BW_ENET_ATCR_SLAVE(v) (HW_ENET_ATCR_WR((HW_ENET_ATCR_RD() & ~BM_ENET_ATCR_SLAVE) | BF_ENET_ATCR_SLAVE(v)))
  3458. #endif
  3459. //@}
  3460. //-------------------------------------------------------------------------------------------
  3461. // HW_ENET_ATVR - Timer Value Register
  3462. //-------------------------------------------------------------------------------------------
  3463. #ifndef __LANGUAGE_ASM__
  3464. /*!
  3465. * @brief HW_ENET_ATVR - Timer Value Register (RW)
  3466. *
  3467. * Reset value: 0x00000000
  3468. */
  3469. typedef union _hw_enet_atvr
  3470. {
  3471. reg32_t U;
  3472. struct _hw_enet_atvr_bitfields
  3473. {
  3474. unsigned ATIME : 32; //!< [31:0] A write sets the timer.
  3475. } B;
  3476. } hw_enet_atvr_t;
  3477. #endif
  3478. /*!
  3479. * @name Constants and macros for entire ENET_ATVR register
  3480. */
  3481. //@{
  3482. #define HW_ENET_ATVR_ADDR (REGS_ENET_BASE + 0x404)
  3483. #ifndef __LANGUAGE_ASM__
  3484. #define HW_ENET_ATVR (*(volatile hw_enet_atvr_t *) HW_ENET_ATVR_ADDR)
  3485. #define HW_ENET_ATVR_RD() (HW_ENET_ATVR.U)
  3486. #define HW_ENET_ATVR_WR(v) (HW_ENET_ATVR.U = (v))
  3487. #define HW_ENET_ATVR_SET(v) (HW_ENET_ATVR_WR(HW_ENET_ATVR_RD() | (v)))
  3488. #define HW_ENET_ATVR_CLR(v) (HW_ENET_ATVR_WR(HW_ENET_ATVR_RD() & ~(v)))
  3489. #define HW_ENET_ATVR_TOG(v) (HW_ENET_ATVR_WR(HW_ENET_ATVR_RD() ^ (v)))
  3490. #endif
  3491. //@}
  3492. /*
  3493. * constants & macros for individual ENET_ATVR bitfields
  3494. */
  3495. /*! @name Register ENET_ATVR, field ATIME[31:0] (RW)
  3496. *
  3497. * A write sets the timer. A read returns the last captured value. To read the current value, issue
  3498. * a capture command (set ATCR[CAPTURE]) prior to reading this register.
  3499. */
  3500. //@{
  3501. #define BP_ENET_ATVR_ATIME (0) //!< Bit position for ENET_ATVR_ATIME.
  3502. #define BM_ENET_ATVR_ATIME (0xffffffff) //!< Bit mask for ENET_ATVR_ATIME.
  3503. //! @brief Get value of ENET_ATVR_ATIME from a register value.
  3504. #define BG_ENET_ATVR_ATIME(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_ATVR_ATIME) >> BP_ENET_ATVR_ATIME)
  3505. //! @brief Format value for bitfield ENET_ATVR_ATIME.
  3506. #define BF_ENET_ATVR_ATIME(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_ATVR_ATIME) & BM_ENET_ATVR_ATIME)
  3507. #ifndef __LANGUAGE_ASM__
  3508. //! @brief Set the ATIME field to a new value.
  3509. #define BW_ENET_ATVR_ATIME(v) (HW_ENET_ATVR_WR((HW_ENET_ATVR_RD() & ~BM_ENET_ATVR_ATIME) | BF_ENET_ATVR_ATIME(v)))
  3510. #endif
  3511. //@}
  3512. //-------------------------------------------------------------------------------------------
  3513. // HW_ENET_ATOFF - Timer Offset Register
  3514. //-------------------------------------------------------------------------------------------
  3515. #ifndef __LANGUAGE_ASM__
  3516. /*!
  3517. * @brief HW_ENET_ATOFF - Timer Offset Register (RW)
  3518. *
  3519. * Reset value: 0x00000000
  3520. */
  3521. typedef union _hw_enet_atoff
  3522. {
  3523. reg32_t U;
  3524. struct _hw_enet_atoff_bitfields
  3525. {
  3526. unsigned OFFSET : 32; //!< [31:0] Offset value for one-shot event generation.
  3527. } B;
  3528. } hw_enet_atoff_t;
  3529. #endif
  3530. /*!
  3531. * @name Constants and macros for entire ENET_ATOFF register
  3532. */
  3533. //@{
  3534. #define HW_ENET_ATOFF_ADDR (REGS_ENET_BASE + 0x408)
  3535. #ifndef __LANGUAGE_ASM__
  3536. #define HW_ENET_ATOFF (*(volatile hw_enet_atoff_t *) HW_ENET_ATOFF_ADDR)
  3537. #define HW_ENET_ATOFF_RD() (HW_ENET_ATOFF.U)
  3538. #define HW_ENET_ATOFF_WR(v) (HW_ENET_ATOFF.U = (v))
  3539. #define HW_ENET_ATOFF_SET(v) (HW_ENET_ATOFF_WR(HW_ENET_ATOFF_RD() | (v)))
  3540. #define HW_ENET_ATOFF_CLR(v) (HW_ENET_ATOFF_WR(HW_ENET_ATOFF_RD() & ~(v)))
  3541. #define HW_ENET_ATOFF_TOG(v) (HW_ENET_ATOFF_WR(HW_ENET_ATOFF_RD() ^ (v)))
  3542. #endif
  3543. //@}
  3544. /*
  3545. * constants & macros for individual ENET_ATOFF bitfields
  3546. */
  3547. /*! @name Register ENET_ATOFF, field OFFSET[31:0] (RW)
  3548. *
  3549. * Offset value for one-shot event generation. When the timer reaches the value, an event can be
  3550. * generated to reset the counter. If the increment value in ATINC is given in true nanoseconds,
  3551. * this value is also given in true nanoseconds.
  3552. */
  3553. //@{
  3554. #define BP_ENET_ATOFF_OFFSET (0) //!< Bit position for ENET_ATOFF_OFFSET.
  3555. #define BM_ENET_ATOFF_OFFSET (0xffffffff) //!< Bit mask for ENET_ATOFF_OFFSET.
  3556. //! @brief Get value of ENET_ATOFF_OFFSET from a register value.
  3557. #define BG_ENET_ATOFF_OFFSET(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_ATOFF_OFFSET) >> BP_ENET_ATOFF_OFFSET)
  3558. //! @brief Format value for bitfield ENET_ATOFF_OFFSET.
  3559. #define BF_ENET_ATOFF_OFFSET(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_ATOFF_OFFSET) & BM_ENET_ATOFF_OFFSET)
  3560. #ifndef __LANGUAGE_ASM__
  3561. //! @brief Set the OFFSET field to a new value.
  3562. #define BW_ENET_ATOFF_OFFSET(v) (HW_ENET_ATOFF_WR((HW_ENET_ATOFF_RD() & ~BM_ENET_ATOFF_OFFSET) | BF_ENET_ATOFF_OFFSET(v)))
  3563. #endif
  3564. //@}
  3565. //-------------------------------------------------------------------------------------------
  3566. // HW_ENET_ATPER - Timer Period Register
  3567. //-------------------------------------------------------------------------------------------
  3568. #ifndef __LANGUAGE_ASM__
  3569. /*!
  3570. * @brief HW_ENET_ATPER - Timer Period Register (RW)
  3571. *
  3572. * Reset value: 0x3b9aca00
  3573. */
  3574. typedef union _hw_enet_atper
  3575. {
  3576. reg32_t U;
  3577. struct _hw_enet_atper_bitfields
  3578. {
  3579. unsigned PERIOD : 32; //!< [31:0] Value for generating periodic events.
  3580. } B;
  3581. } hw_enet_atper_t;
  3582. #endif
  3583. /*!
  3584. * @name Constants and macros for entire ENET_ATPER register
  3585. */
  3586. //@{
  3587. #define HW_ENET_ATPER_ADDR (REGS_ENET_BASE + 0x40c)
  3588. #ifndef __LANGUAGE_ASM__
  3589. #define HW_ENET_ATPER (*(volatile hw_enet_atper_t *) HW_ENET_ATPER_ADDR)
  3590. #define HW_ENET_ATPER_RD() (HW_ENET_ATPER.U)
  3591. #define HW_ENET_ATPER_WR(v) (HW_ENET_ATPER.U = (v))
  3592. #define HW_ENET_ATPER_SET(v) (HW_ENET_ATPER_WR(HW_ENET_ATPER_RD() | (v)))
  3593. #define HW_ENET_ATPER_CLR(v) (HW_ENET_ATPER_WR(HW_ENET_ATPER_RD() & ~(v)))
  3594. #define HW_ENET_ATPER_TOG(v) (HW_ENET_ATPER_WR(HW_ENET_ATPER_RD() ^ (v)))
  3595. #endif
  3596. //@}
  3597. /*
  3598. * constants & macros for individual ENET_ATPER bitfields
  3599. */
  3600. /*! @name Register ENET_ATPER, field PERIOD[31:0] (RW)
  3601. *
  3602. * Value for generating periodic events. Each instance the timer reaches this value, the period
  3603. * event occurs and the timer restarts. If the increment value in ATINC is given in true
  3604. * nanoseconds, this value is also given in true nanoseconds. The value should be initialized to
  3605. * 1,000,000,000 (1 x 10 9 ) to represent a timer wrap around of one second. The increment value set
  3606. * in ATINC should be set to the true nanoseconds of the period of clock ts_clk, hence implementing
  3607. * a true 1 second counter.
  3608. */
  3609. //@{
  3610. #define BP_ENET_ATPER_PERIOD (0) //!< Bit position for ENET_ATPER_PERIOD.
  3611. #define BM_ENET_ATPER_PERIOD (0xffffffff) //!< Bit mask for ENET_ATPER_PERIOD.
  3612. //! @brief Get value of ENET_ATPER_PERIOD from a register value.
  3613. #define BG_ENET_ATPER_PERIOD(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_ATPER_PERIOD) >> BP_ENET_ATPER_PERIOD)
  3614. //! @brief Format value for bitfield ENET_ATPER_PERIOD.
  3615. #define BF_ENET_ATPER_PERIOD(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_ATPER_PERIOD) & BM_ENET_ATPER_PERIOD)
  3616. #ifndef __LANGUAGE_ASM__
  3617. //! @brief Set the PERIOD field to a new value.
  3618. #define BW_ENET_ATPER_PERIOD(v) (HW_ENET_ATPER_WR((HW_ENET_ATPER_RD() & ~BM_ENET_ATPER_PERIOD) | BF_ENET_ATPER_PERIOD(v)))
  3619. #endif
  3620. //@}
  3621. //-------------------------------------------------------------------------------------------
  3622. // HW_ENET_ATCOR - Timer Correction Register
  3623. //-------------------------------------------------------------------------------------------
  3624. #ifndef __LANGUAGE_ASM__
  3625. /*!
  3626. * @brief HW_ENET_ATCOR - Timer Correction Register (RW)
  3627. *
  3628. * Reset value: 0x00000000
  3629. */
  3630. typedef union _hw_enet_atcor
  3631. {
  3632. reg32_t U;
  3633. struct _hw_enet_atcor_bitfields
  3634. {
  3635. unsigned COR : 31; //!< [30:0] Correction Counter Wrap-Around Value
  3636. unsigned RESERVED0 : 1; //!< [31]
  3637. } B;
  3638. } hw_enet_atcor_t;
  3639. #endif
  3640. /*!
  3641. * @name Constants and macros for entire ENET_ATCOR register
  3642. */
  3643. //@{
  3644. #define HW_ENET_ATCOR_ADDR (REGS_ENET_BASE + 0x410)
  3645. #ifndef __LANGUAGE_ASM__
  3646. #define HW_ENET_ATCOR (*(volatile hw_enet_atcor_t *) HW_ENET_ATCOR_ADDR)
  3647. #define HW_ENET_ATCOR_RD() (HW_ENET_ATCOR.U)
  3648. #define HW_ENET_ATCOR_WR(v) (HW_ENET_ATCOR.U = (v))
  3649. #define HW_ENET_ATCOR_SET(v) (HW_ENET_ATCOR_WR(HW_ENET_ATCOR_RD() | (v)))
  3650. #define HW_ENET_ATCOR_CLR(v) (HW_ENET_ATCOR_WR(HW_ENET_ATCOR_RD() & ~(v)))
  3651. #define HW_ENET_ATCOR_TOG(v) (HW_ENET_ATCOR_WR(HW_ENET_ATCOR_RD() ^ (v)))
  3652. #endif
  3653. //@}
  3654. /*
  3655. * constants & macros for individual ENET_ATCOR bitfields
  3656. */
  3657. /*! @name Register ENET_ATCOR, field COR[30:0] (RW)
  3658. *
  3659. * Defines after how many timer clock cycles (ts_clk) the correction counter should be reset and
  3660. * trigger a correction increment on the timer. The amount of correction is defined in
  3661. * ATINC[INC_CORR]. A value of 0 disables the correction counter and no corrections occur. This
  3662. * value is given in clock cycles, not in nanoseconds as all other values.
  3663. */
  3664. //@{
  3665. #define BP_ENET_ATCOR_COR (0) //!< Bit position for ENET_ATCOR_COR.
  3666. #define BM_ENET_ATCOR_COR (0x7fffffff) //!< Bit mask for ENET_ATCOR_COR.
  3667. //! @brief Get value of ENET_ATCOR_COR from a register value.
  3668. #define BG_ENET_ATCOR_COR(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_ATCOR_COR) >> BP_ENET_ATCOR_COR)
  3669. //! @brief Format value for bitfield ENET_ATCOR_COR.
  3670. #define BF_ENET_ATCOR_COR(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_ATCOR_COR) & BM_ENET_ATCOR_COR)
  3671. #ifndef __LANGUAGE_ASM__
  3672. //! @brief Set the COR field to a new value.
  3673. #define BW_ENET_ATCOR_COR(v) (HW_ENET_ATCOR_WR((HW_ENET_ATCOR_RD() & ~BM_ENET_ATCOR_COR) | BF_ENET_ATCOR_COR(v)))
  3674. #endif
  3675. //@}
  3676. //-------------------------------------------------------------------------------------------
  3677. // HW_ENET_ATINC - Time-Stamping Clock Period Register
  3678. //-------------------------------------------------------------------------------------------
  3679. #ifndef __LANGUAGE_ASM__
  3680. /*!
  3681. * @brief HW_ENET_ATINC - Time-Stamping Clock Period Register (RW)
  3682. *
  3683. * Reset value: 0x00000000
  3684. */
  3685. typedef union _hw_enet_atinc
  3686. {
  3687. reg32_t U;
  3688. struct _hw_enet_atinc_bitfields
  3689. {
  3690. unsigned INC : 7; //!< [6:0] Clock Period Of The Timestamping Clock (ts_clk) In Nanoseconds
  3691. unsigned RESERVED0 : 1; //!< [7]
  3692. unsigned INC_CORR : 7; //!< [14:8] Correction Increment Value
  3693. unsigned RESERVED1 : 17; //!< [31:15]
  3694. } B;
  3695. } hw_enet_atinc_t;
  3696. #endif
  3697. /*!
  3698. * @name Constants and macros for entire ENET_ATINC register
  3699. */
  3700. //@{
  3701. #define HW_ENET_ATINC_ADDR (REGS_ENET_BASE + 0x414)
  3702. #ifndef __LANGUAGE_ASM__
  3703. #define HW_ENET_ATINC (*(volatile hw_enet_atinc_t *) HW_ENET_ATINC_ADDR)
  3704. #define HW_ENET_ATINC_RD() (HW_ENET_ATINC.U)
  3705. #define HW_ENET_ATINC_WR(v) (HW_ENET_ATINC.U = (v))
  3706. #define HW_ENET_ATINC_SET(v) (HW_ENET_ATINC_WR(HW_ENET_ATINC_RD() | (v)))
  3707. #define HW_ENET_ATINC_CLR(v) (HW_ENET_ATINC_WR(HW_ENET_ATINC_RD() & ~(v)))
  3708. #define HW_ENET_ATINC_TOG(v) (HW_ENET_ATINC_WR(HW_ENET_ATINC_RD() ^ (v)))
  3709. #endif
  3710. //@}
  3711. /*
  3712. * constants & macros for individual ENET_ATINC bitfields
  3713. */
  3714. /*! @name Register ENET_ATINC, field INC[6:0] (RW)
  3715. *
  3716. * The timer increments by this amount each clock cycle. For example, set to 10 for 100 MHz, 8 for
  3717. * 125 MHz, 5 for 200 MHz. For highest precision, use a value that is an integer fraction of the
  3718. * period set in ATPER.
  3719. */
  3720. //@{
  3721. #define BP_ENET_ATINC_INC (0) //!< Bit position for ENET_ATINC_INC.
  3722. #define BM_ENET_ATINC_INC (0x0000007f) //!< Bit mask for ENET_ATINC_INC.
  3723. //! @brief Get value of ENET_ATINC_INC from a register value.
  3724. #define BG_ENET_ATINC_INC(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_ATINC_INC) >> BP_ENET_ATINC_INC)
  3725. //! @brief Format value for bitfield ENET_ATINC_INC.
  3726. #define BF_ENET_ATINC_INC(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_ATINC_INC) & BM_ENET_ATINC_INC)
  3727. #ifndef __LANGUAGE_ASM__
  3728. //! @brief Set the INC field to a new value.
  3729. #define BW_ENET_ATINC_INC(v) (HW_ENET_ATINC_WR((HW_ENET_ATINC_RD() & ~BM_ENET_ATINC_INC) | BF_ENET_ATINC_INC(v)))
  3730. #endif
  3731. //@}
  3732. /*! @name Register ENET_ATINC, field INC_CORR[14:8] (RW)
  3733. *
  3734. * This value is added every time the correction timer expires (every clock cycle given in ATCOR). A
  3735. * value smaller than INC slows the timer, while a value larger than INC speeds the timer.
  3736. */
  3737. //@{
  3738. #define BP_ENET_ATINC_INC_CORR (8) //!< Bit position for ENET_ATINC_INC_CORR.
  3739. #define BM_ENET_ATINC_INC_CORR (0x00007f00) //!< Bit mask for ENET_ATINC_INC_CORR.
  3740. //! @brief Get value of ENET_ATINC_INC_CORR from a register value.
  3741. #define BG_ENET_ATINC_INC_CORR(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_ATINC_INC_CORR) >> BP_ENET_ATINC_INC_CORR)
  3742. //! @brief Format value for bitfield ENET_ATINC_INC_CORR.
  3743. #define BF_ENET_ATINC_INC_CORR(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_ENET_ATINC_INC_CORR) & BM_ENET_ATINC_INC_CORR)
  3744. #ifndef __LANGUAGE_ASM__
  3745. //! @brief Set the INC_CORR field to a new value.
  3746. #define BW_ENET_ATINC_INC_CORR(v) (HW_ENET_ATINC_WR((HW_ENET_ATINC_RD() & ~BM_ENET_ATINC_INC_CORR) | BF_ENET_ATINC_INC_CORR(v)))
  3747. #endif
  3748. //@}
  3749. //-------------------------------------------------------------------------------------------
  3750. // HW_ENET_ATSTMP - Timestamp of Last Transmitted Frame
  3751. //-------------------------------------------------------------------------------------------
  3752. #ifndef __LANGUAGE_ASM__
  3753. /*!
  3754. * @brief HW_ENET_ATSTMP - Timestamp of Last Transmitted Frame (RO)
  3755. *
  3756. * Reset value: 0x00000000
  3757. */
  3758. typedef union _hw_enet_atstmp
  3759. {
  3760. reg32_t U;
  3761. struct _hw_enet_atstmp_bitfields
  3762. {
  3763. unsigned TIMESTAMP : 32; //!< [31:0] Timestamp of the last frame transmitted by the core that had TxBD[TS] set .
  3764. } B;
  3765. } hw_enet_atstmp_t;
  3766. #endif
  3767. /*!
  3768. * @name Constants and macros for entire ENET_ATSTMP register
  3769. */
  3770. //@{
  3771. #define HW_ENET_ATSTMP_ADDR (REGS_ENET_BASE + 0x418)
  3772. #ifndef __LANGUAGE_ASM__
  3773. #define HW_ENET_ATSTMP (*(volatile hw_enet_atstmp_t *) HW_ENET_ATSTMP_ADDR)
  3774. #define HW_ENET_ATSTMP_RD() (HW_ENET_ATSTMP.U)
  3775. #endif
  3776. //@}
  3777. /*
  3778. * constants & macros for individual ENET_ATSTMP bitfields
  3779. */
  3780. /*! @name Register ENET_ATSTMP, field TIMESTAMP[31:0] (RW)
  3781. *
  3782. * Timestamp of the last frame transmitted by the core that had TxBD[TS] set . This register is only
  3783. * valid when EIR[TS_AVAIL] is set.
  3784. */
  3785. //@{
  3786. #define BP_ENET_ATSTMP_TIMESTAMP (0) //!< Bit position for ENET_ATSTMP_TIMESTAMP.
  3787. #define BM_ENET_ATSTMP_TIMESTAMP (0xffffffff) //!< Bit mask for ENET_ATSTMP_TIMESTAMP.
  3788. //! @brief Get value of ENET_ATSTMP_TIMESTAMP from a register value.
  3789. #define BG_ENET_ATSTMP_TIMESTAMP(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_ENET_ATSTMP_TIMESTAMP) >> BP_ENET_ATSTMP_TIMESTAMP)
  3790. //@}
  3791. //-------------------------------------------------------------------------------------------
  3792. // hw_enet_t - module struct
  3793. //-------------------------------------------------------------------------------------------
  3794. /*!
  3795. * @brief All ENET module registers.
  3796. */
  3797. #ifndef __LANGUAGE_ASM__
  3798. #pragma pack(1)
  3799. typedef struct _hw_enet
  3800. {
  3801. reg32_t _reserved0;
  3802. volatile hw_enet_eir_t EIR; //!< Interrupt Event Register
  3803. volatile hw_enet_eimr_t EIMR; //!< Interrupt Mask Register
  3804. reg32_t _reserved1;
  3805. volatile hw_enet_rdar_t RDAR; //!< Receive Descriptor Active Register
  3806. volatile hw_enet_tdar_t TDAR; //!< Transmit Descriptor Active Register
  3807. reg32_t _reserved2[3];
  3808. volatile hw_enet_ecr_t ECR; //!< Ethernet Control Register
  3809. reg32_t _reserved3[6];
  3810. volatile hw_enet_mmfr_t MMFR; //!< MII Management Frame Register
  3811. volatile hw_enet_mscr_t MSCR; //!< MII Speed Control Register
  3812. reg32_t _reserved4[7];
  3813. volatile hw_enet_mibc_t MIBC; //!< MIB Control Register
  3814. reg32_t _reserved5[7];
  3815. volatile hw_enet_rcr_t RCR; //!< Receive Control Register
  3816. reg32_t _reserved6[15];
  3817. volatile hw_enet_tcr_t TCR; //!< Transmit Control Register
  3818. reg32_t _reserved7[7];
  3819. volatile hw_enet_palr_t PALR; //!< Physical Address Lower Register
  3820. volatile hw_enet_paur_t PAUR; //!< Physical Address Upper Register
  3821. volatile hw_enet_opd_t OPD; //!< Opcode/Pause Duration Register
  3822. reg32_t _reserved8[10];
  3823. volatile hw_enet_iaur_t IAUR; //!< Descriptor Individual Upper Address Register
  3824. volatile hw_enet_ialr_t IALR; //!< Descriptor Individual Lower Address Register
  3825. volatile hw_enet_gaur_t GAUR; //!< Descriptor Group Upper Address Register
  3826. volatile hw_enet_galr_t GALR; //!< Descriptor Group Lower Address Register
  3827. reg32_t _reserved9[7];
  3828. volatile hw_enet_tfwr_t TFWR; //!< Transmit FIFO Watermark Register
  3829. reg32_t _reserved10[14];
  3830. volatile hw_enet_rdsr_t RDSR; //!< Receive Descriptor Ring Start Register
  3831. volatile hw_enet_tdsr_t TDSR; //!< Transmit Buffer Descriptor Ring Start Register
  3832. volatile hw_enet_mrbr_t MRBR; //!< Maximum Receive Buffer Size Register
  3833. reg32_t _reserved11;
  3834. volatile hw_enet_rsfl_t RSFL; //!< Receive FIFO Section Full Threshold
  3835. volatile hw_enet_rsem_t RSEM; //!< Receive FIFO Section Empty Threshold
  3836. volatile hw_enet_raem_t RAEM; //!< Receive FIFO Almost Empty Threshold
  3837. volatile hw_enet_rafl_t RAFL; //!< Receive FIFO Almost Full Threshold
  3838. volatile hw_enet_tsem_t TSEM; //!< Transmit FIFO Section Empty Threshold
  3839. volatile hw_enet_taem_t TAEM; //!< Transmit FIFO Almost Empty Threshold
  3840. volatile hw_enet_tafl_t TAFL; //!< Transmit FIFO Almost Full Threshold
  3841. volatile hw_enet_tipg_t TIPG; //!< Transmit Inter-Packet Gap
  3842. volatile hw_enet_ftrl_t FTRL; //!< Frame Truncation Length
  3843. reg32_t _reserved12[3];
  3844. volatile hw_enet_tacc_t TACC; //!< Transmit Accelerator Function Configuration
  3845. volatile hw_enet_racc_t RACC; //!< Receive Accelerator Function Configuration
  3846. reg32_t _reserved13[142];
  3847. volatile hw_enet_atcr_t ATCR; //!< Timer Control Register
  3848. volatile hw_enet_atvr_t ATVR; //!< Timer Value Register
  3849. volatile hw_enet_atoff_t ATOFF; //!< Timer Offset Register
  3850. volatile hw_enet_atper_t ATPER; //!< Timer Period Register
  3851. volatile hw_enet_atcor_t ATCOR; //!< Timer Correction Register
  3852. volatile hw_enet_atinc_t ATINC; //!< Time-Stamping Clock Period Register
  3853. volatile hw_enet_atstmp_t ATSTMP; //!< Timestamp of Last Transmitted Frame
  3854. } hw_enet_t;
  3855. #pragma pack()
  3856. //! @brief Macro to access all ENET registers.
  3857. //! @return Reference (not a pointer) to the registers struct. To get a pointer to the struct,
  3858. //! use the '&' operator, like <code>&HW_ENET</code>.
  3859. #define HW_ENET (*(hw_enet_t *) REGS_ENET_BASE)
  3860. #endif
  3861. #endif // __HW_ENET_REGISTERS_H__
  3862. // v18/121106/1.2.2
  3863. // EOF