esc_register.h 158 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552
  1. /*
  2. * Copyright (c) 2021-2025 HPMicro
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. *
  6. */
  7. #ifndef ESC_REGISTER_H
  8. #define ESC_REGISTER_H
  9. #define __R volatile const /* Define "read-only" permission */
  10. #define __RW volatile /* Define "read-write" permission */
  11. #define __W volatile /* Define "write-only" permission */
  12. typedef struct {
  13. __R uint8_t TYPE; /* 0x0: Type of EtherCAT controller */
  14. __R uint8_t REVISION; /* 0x1: Revision of EtherCAT controller */
  15. __R uint16_t BUILD; /* 0x2: Build of EtherCAT controller */
  16. __R uint8_t FMMU_NUM; /* 0x4: FMMU supported */
  17. __R uint8_t SYNCM_NUM; /* 0x5: SyncManagers supported */
  18. __R uint8_t RAM_SIZE; /* 0x6: RAM Size */
  19. __R uint8_t PORT_DESC; /* 0x7: Port Descriptor */
  20. __R uint16_t FEATURE; /* 0x8: ESC Feature supported */
  21. __R uint8_t RESERVED0[6]; /* 0xA - 0xF: Reserved */
  22. __R uint16_t STATION_ADDR; /* 0x10: Configured Station Address */
  23. __RW uint16_t STATION_ALS; /* 0x12: Configured Station Alias */
  24. __R uint8_t RESERVED1[12]; /* 0x14 - 0x1F: Reserved */
  25. __R uint8_t REG_WEN; /* 0x20: Register Write Enable */
  26. __R uint8_t REG_WP; /* 0x21: Register Write Protection */
  27. __R uint8_t RESERVED2[14]; /* 0x22 - 0x2F: Reserved */
  28. __R uint8_t ESC_WEN; /* 0x30: ESC Write Enable */
  29. __R uint8_t ESC_WP; /* 0x31: ESC Write Protection */
  30. __R uint8_t RESERVED3[14]; /* 0x32 - 0x3F: Reserved */
  31. __R uint8_t ESC_RST_ECAT; /* 0x40: ESC Reset ECAT */
  32. __RW uint8_t ESC_RST_PDI; /* 0x41: ESC Reset PDI */
  33. __R uint8_t RESERVED4[190]; /* 0x42 - 0xFF: Reserved */
  34. __R uint32_t ESC_DL_CTRL; /* 0x100: ESC DL Control */
  35. __R uint8_t RESERVED5[4]; /* 0x104 - 0x107: Reserved */
  36. __R uint16_t PHYSICAL_RW_OFFSET; /* 0x108: Physical Read/Write Offset */
  37. __R uint8_t RESERVED6[6]; /* 0x10A - 0x10F: Reserved */
  38. __R uint16_t ESC_DL_STAT; /* 0x110: ESC DL Status */
  39. __R uint8_t RESERVED7[14]; /* 0x112 - 0x11F: Reserved */
  40. __RW uint16_t AL_CTRL; /* 0x120: AL Control */
  41. __R uint8_t RESERVED8[14]; /* 0x122 - 0x12F: Reserved */
  42. __RW uint16_t AL_STAT; /* 0x130: AL Status */
  43. __R uint8_t RESERVED9[2]; /* 0x132 - 0x133: Reserved */
  44. __RW uint16_t AL_STAT_CODE; /* 0x134: AL Status Code */
  45. __R uint8_t RESERVED10[2]; /* 0x136 - 0x137: Reserved */
  46. __RW uint8_t RUN_LED_OVRD; /* 0x138: RUN LED Override */
  47. __RW uint8_t ERR_LED_OVRD; /* 0x139: ERR LED Override */
  48. __R uint8_t RESERVED11[6]; /* 0x13A - 0x13F: Reserved */
  49. __R uint8_t PDI_CTRL; /* 0x140: PDI Control */
  50. __R uint8_t ESC_CFG; /* 0x141: ESC Configuration */
  51. __R uint8_t RESERVED12[12]; /* 0x142 - 0x14D: Reserved */
  52. __R uint16_t PDI_INFO; /* 0x14E: PDI Information */
  53. __R uint8_t PDI_CFG; /* 0x150: PDI Configuration */
  54. __R uint8_t PDI_SL_CFG; /* 0x151: PDI Sync/Latch[1:0] Configuration */
  55. __RW uint16_t PDI_EXT_CFG; /* 0x152: PDI Extended Configuration */
  56. __R uint8_t RESERVED13[172]; /* 0x154 - 0x1FF: Reserved */
  57. __R uint16_t ECAT_EVT_MSK; /* 0x200: ECAT Event Mask */
  58. __R uint8_t RESERVED14[2]; /* 0x202 - 0x203: Reserved */
  59. __RW uint32_t PDI_AL_EVT_MSK; /* 0x204: PDI AL Event Mask */
  60. __R uint8_t RESERVED15[8]; /* 0x208 - 0x20F: Reserved */
  61. __R uint16_t ECAT_EVT_REQ; /* 0x210: ECAT Event Request */
  62. __R uint8_t RESERVED16[14]; /* 0x212 - 0x21F: Reserved */
  63. __R uint32_t AL_EVT_REQ; /* 0x220: AL Event Request */
  64. __R uint8_t RESERVED17[220]; /* 0x224 - 0x2FF: Reserved */
  65. __R uint16_t RX_ERR_CNT[4]; /* 0x300 - 0x306: RX Error Counter */
  66. __R uint8_t FWD_RX_ERR_CNT[4]; /* 0x308 - 0x30B: Forwarded RX Error Counter */
  67. __R uint8_t ECAT_PU_ERR_CNT; /* 0x30C: ECAT Processing Unit Error Counter */
  68. __R uint8_t PDI_ERR_CNT; /* 0x30D: PDI Error Counter */
  69. __R uint8_t RESERVED18[2]; /* 0x30E - 0x30F: Reserved */
  70. __R uint8_t LOST_LINK_CNT[4]; /* 0x310 - 0x313: Lost Link Counter */
  71. __R uint8_t RESERVED19[236]; /* 0x314 - 0x3FF: Reserved */
  72. __R uint16_t WDG_DIV; /* 0x400: Watchdog Divider */
  73. __R uint8_t RESERVED20[14]; /* 0x402 - 0x40F: Reserved */
  74. __R uint16_t WDG_TIME_PDI; /* 0x410: Watchdog Time PDI */
  75. __R uint8_t RESERVED21[14]; /* 0x412 - 0x41F: Reserved */
  76. __R uint16_t WDG_TIME_PDAT; /* 0x420: Watchdog Time Process Data */
  77. __R uint8_t RESERVED22[30]; /* 0x422 - 0x43F: Reserved */
  78. __RW uint16_t WDG_STAT_PDAT; /* 0x440: Watchdog Status Process Data */
  79. __R uint8_t WDG_CNT_PDAT; /* 0x442: Watchdog Counter Process Data */
  80. __R uint8_t WDG_CNT_PDI; /* 0x443: Watchdog Counter PDI */
  81. __R uint8_t RESERVED23[188]; /* 0x444 - 0x4FF: Reserved */
  82. __R uint8_t EEPROM_CFG; /* 0x500: EEPROM Configuration */
  83. __RW uint8_t EEPROM_PDI_ACC_STAT; /* 0x501: EEPROM PDI Access State */
  84. __RW uint16_t EEPROM_CTRL_STAT; /* 0x502: EEPROM Control/Status */
  85. __RW uint32_t EEPROM_ADDR; /* 0x504: EEPROM Address */
  86. __RW uint64_t EEPROM_DATA; /* 0x508: EEPROM Data */
  87. __RW uint16_t MII_MNG_CS; /* 0x510: MII Management Control/Status */
  88. __RW uint8_t PHY_ADDR; /* 0x512: PHY Address */
  89. __RW uint8_t PHY_REG_ADDR; /* 0x513: PHY Register Address */
  90. __RW uint16_t PHY_DATA; /* 0x514: PHY Data */
  91. __R uint8_t MIIM_ECAT_ACC_STAT; /* 0x516: MII Management ECAT Access State */
  92. __RW uint8_t MIIM_PDI_ACC_STAT; /* 0x517: MII Management PDI Access State */
  93. __RW uint8_t PHY_STAT[4]; /* 0x518 - 0x51B: PHY Port */
  94. __R uint8_t RESERVED24[228]; /* 0x51C - 0x5FF: Reserved */
  95. struct {
  96. __R uint32_t LOGIC_START_ADDR; /* 0x600: Logical Start Address */
  97. __R uint16_t LENGTH; /* 0x604: Length */
  98. __R uint8_t LOGIC_START_BIT; /* 0x606: Logical Start Bit */
  99. __R uint8_t LOGIC_STOP_BIT; /* 0x607: Logical Stop Bit */
  100. __R uint16_t PHYSICAL_START_ADDR; /* 0x608: Physical Start Address */
  101. __R uint8_t PHYSICAL_START_BIT; /* 0x60A: Physical Start Bit */
  102. __R uint8_t TYPE; /* 0x60B: Type */
  103. __R uint8_t ACTIVATE; /* 0x60C: Activate */
  104. __R uint8_t RESERVED0[3]; /* 0x60D - 0x60F: Reserved */
  105. } FMMU[8];
  106. __R uint8_t RESERVED25[384]; /* 0x680 - 0x7FF: Reserved */
  107. struct {
  108. __R uint16_t PHYSICAL_START_ADDR; /* 0x800: Physical Start Address */
  109. __R uint16_t LENGTH; /* 0x802: Length */
  110. __R uint8_t CONTROL; /* 0x804: Control */
  111. __R uint8_t STATUS; /* 0x805: Status */
  112. __RW uint8_t ACTIVATE; /* 0x806: Activate */
  113. __RW uint8_t PDI_CTRL; /* 0x807: PDI Control */
  114. } SYNCM[8];
  115. __R uint8_t RESERVED26[192]; /* 0x840 - 0x8FF: Reserved */
  116. __R uint32_t RCV_TIME[4]; /* 0x900 - 0x90C: Receive Time */
  117. __RW uint64_t SYS_TIME; /* 0x910: System Time */
  118. __R uint64_t RCVT_ECAT_PU; /* 0x918: Receive Time ECAT Processing Unit */
  119. __RW uint64_t SYS_TIME_OFFSET; /* 0x920: System Time Offset */
  120. __RW uint32_t SYS_TIME_DELAY; /* 0x928: System Time Delay */
  121. __R uint32_t SYS_TIME_DIFF; /* 0x92C: System Time Difference */
  122. __RW uint16_t SPD_CNT_START; /* 0x930: Speed Counter Start */
  123. __R uint16_t SPD_CNT_DIFF; /* 0x932: Speed Counter Diff */
  124. __RW uint8_t SYS_TIME_DIFF_FD; /* 0x934: System Time Difference Filter Depth */
  125. __RW uint8_t SPD_CNT_FD; /* 0x935: Speed Counter Filter Depth */
  126. __R uint8_t RCV_TIME_LM; /* 0x936: Receive Time Latch Mode */
  127. __R uint8_t RESERVED27[73]; /* 0x937 - 0x97F: Reserved */
  128. __R uint8_t CYC_UNIT_CTRL; /* 0x980: Cyclic Unit Control */
  129. __RW uint8_t SYNCO_ACT; /* 0x981: SYNC Out Unit Activation */
  130. __R uint16_t PULSE_LEN; /* 0x982: Pulse Length of SyncSignals */
  131. __R uint8_t ACT_STAT; /* 0x984: Activation Status */
  132. __R uint8_t RESERVED28[9]; /* 0x985 - 0x98D: Reserved */
  133. __RW uint8_t SYNC0_STAT; /* 0x98E: SYNC0 Status */
  134. __RW uint8_t SYNC1_STAT; /* 0x98F: SYNC1 Status */
  135. __RW uint64_t START_TIME_CO; /* 0x990: Start Time Cyclic Operation */
  136. __R uint64_t NXT_SYNC1_PULSE; /* 0x998: Next SYNC1 Pulse */
  137. __RW uint32_t SYNC0_CYC_TIME; /* 0x9A0: SYNC0 Cycle Time */
  138. __RW uint32_t SYNC1_CYC_TIME; /* 0x9A4: SYNC1 Cycle Time */
  139. __RW uint8_t LATCH0_CTRL; /* 0x9A8: Latch0 Control */
  140. __RW uint8_t LATCH1_CTRL; /* 0x9A9: Latch1 Control */
  141. __R uint8_t RESERVED29[4]; /* 0x9AA - 0x9AD: Reserved */
  142. __R uint8_t LATCH0_STAT; /* 0x9AE: Latch0 Status */
  143. __R uint8_t LATCH1_STAT; /* 0x9AF: Latch1 Status */
  144. __RW uint64_t LATCH0_TIME_PE; /* 0x9B0: Latch0 Time Positive Edge */
  145. __RW uint64_t LATCH0_TIME_NE; /* 0x9B8: Latch0 Time Negative Edge */
  146. __RW uint64_t LATCH1_TIME_PE; /* 0x9C0: Latch1 Time Positive Edge */
  147. __RW uint64_t LATCH1_TIME_NE; /* 0x9C8: Latch1 Time Negative Edge */
  148. __R uint8_t RESERVED30[32]; /* 0x9D0 - 0x9EF: Reserved */
  149. __R uint32_t ECAT_BUF_CET; /* 0x9F0: EtherCAT Buffer Change Event Time */
  150. __R uint8_t RESERVED31[4]; /* 0x9F4 - 0x9F7: Reserved */
  151. __R uint32_t PDI_BUF_SET; /* 0x9F8: PDI Buffer Start Event Time */
  152. __R uint32_t PDI_BUF_CET; /* 0x9FC: PDI Buffer Change Event Time */
  153. __R uint8_t RESERVED32[1024]; /* 0xA00 - 0xDFF: Reserved */
  154. __R uint64_t PID; /* 0xE00: Product ID */
  155. __R uint64_t VID; /* 0xE08: Vendor ID */
  156. __R uint8_t RESERVED33[240]; /* 0xE10 - 0xEFF: Reserved */
  157. __R uint32_t DIO_OUT_DATA; /* 0xF00: Digital I/O Output Data */
  158. __R uint8_t RESERVED34[12]; /* 0xF04 - 0xF0F: Reserved */
  159. __RW uint64_t GPO; /* 0xF10: General Purpose Outputs */
  160. __R uint64_t GPI; /* 0xF18: General Purpose Inputs */
  161. __R uint8_t RESERVED35[96]; /* 0xF20 - 0xF7F: Reserved */
  162. __RW uint8_t USER_RAM_BYTE0; /* 0xF80: User Ram Byte 0 */
  163. __RW uint8_t USER_RAM_BYTE1; /* 0xF81: User Ram Byte 1 */
  164. __RW uint8_t USER_RAM_BYTE2; /* 0xF82: User Ram Byte 2 */
  165. __RW uint8_t USER_RAM_BYTE3; /* 0xF83: User Ram Byte 3 */
  166. __RW uint8_t USER_RAM_BYTE4; /* 0xF84: User Ram Byte 4 */
  167. __RW uint8_t USER_RAM_BYTE5; /* 0xF85: User Ram Byte 5 */
  168. __RW uint8_t USER_RAM_BYTE6; /* 0xF86: User Ram Byte 6 */
  169. __RW uint8_t USER_RAM_BYTE7; /* 0xF87: User Ram Byte 7 */
  170. __RW uint8_t USER_RAM_BYTE8; /* 0xF88: User Ram Byte 8 */
  171. __RW uint8_t USER_RAM_BYTE9; /* 0xF89: User Ram Byte 9 */
  172. __RW uint8_t USER_RAM_BYTE10; /* 0xF8A: User Ram Byte 10 */
  173. __RW uint8_t USER_RAM_BYTE11; /* 0xF8B: User Ram Byte 11 */
  174. __R uint8_t RESERVED36[2]; /* 0xF8C - 0xF8D: Reserved */
  175. __RW uint8_t USER_RAM_BYTE14; /* 0xF8E: User Ram Byte 14 */
  176. __RW uint8_t USER_RAM_BYTE15; /* 0xF8F: User Ram Byte 15 */
  177. __R uint8_t RESERVED37[3]; /* 0xF90 - 0xF92: Reserved */
  178. __RW uint8_t USER_RAM_BYTE19; /* 0xF93: User Ram Byte 19 */
  179. __R uint8_t RESERVED38[108]; /* 0xF94 - 0xFFF: Reserved */
  180. __RW uint32_t PDRAM; /* 0x1000: Process Data Ram */
  181. __R uint8_t RESERVED39[61436]; /* 0x1004 - 0xFFFF: Reserved */
  182. __RW uint32_t PDRAM_ALS; /* 0x10000: Process Data Ram Alias */
  183. __R uint8_t RESERVED40[61436]; /* 0x10004 - 0x1EFFF: Reserved */
  184. __RW uint32_t GPR_CFG0; /* 0x1F000: General Purpose Configure 0 */
  185. __RW uint32_t GPR_CFG1; /* 0x1F004: General Purpose Configure 1 */
  186. __RW uint32_t GPR_CFG2; /* 0x1F008: General Purpose Configure 2 */
  187. __R uint8_t RESERVED41[4]; /* 0x1F00C - 0x1F00F: Reserved */
  188. __RW uint32_t PHY_CFG0; /* 0x1F010: PHY Configure 0 */
  189. __RW uint32_t PHY_CFG1; /* 0x1F014: PHY Configure 1 */
  190. __R uint8_t RESERVED42[8]; /* 0x1F018 - 0x1F01F: Reserved */
  191. __RW uint32_t GPIO_CTRL; /* 0x1F020: GPIO Output Enable */
  192. __R uint8_t RESERVED43[12]; /* 0x1F024 - 0x1F02F: Reserved */
  193. __RW uint32_t GPI_OVERRIDE0; /* 0x1F030: GPI low word Override value */
  194. __RW uint32_t GPI_OVERRIDE1; /* 0x1F034: GPI high word Override value */
  195. __R uint32_t GPO_REG0; /* 0x1F038: GPO low word read value */
  196. __R uint32_t GPO_REG1; /* 0x1F03C: GPO high word read value */
  197. __R uint32_t GPI_REG0; /* 0x1F040: GPI low word read value */
  198. __R uint32_t GPI_REG1; /* 0x1F044: GPI high word read value */
  199. __R uint8_t RESERVED44[24]; /* 0x1F048 - 0x1F05F: Reserved */
  200. __R uint32_t GPR_STATUS; /* 0x1F060: global status register */
  201. __R uint8_t RESERVED45[28]; /* 0x1F064 - 0x1F07F: Reserved */
  202. __RW uint32_t IO_CFG[9]; /* 0x1F080 - 0x1F0A0: CTR IO Configure */
  203. } ESC_t;
  204. #define ESCREG_BASE (0x00000000UL) /* Base address of ESC peripheral */
  205. #define ESCREG ((ESC_t *) ESCREG_BASE) /* Pointer to ESC peripheral */
  206. #define ESCREG_OF(n) ((size_t)&(n)) /* offset of ESC peripheral */
  207. /* Bitfield definition for register: TYPE */
  208. /*
  209. * TYPE (RO)
  210. *
  211. * Controller type
  212. */
  213. #define ESC_TYPE_TYPE_MASK (0xFFU)
  214. #define ESC_TYPE_TYPE_SHIFT (0U)
  215. #define ESC_TYPE_TYPE_GET(x) (((uint8_t)(x) & ESC_TYPE_TYPE_MASK) >> ESC_TYPE_TYPE_SHIFT)
  216. /* Bitfield definition for register: REVISION */
  217. /*
  218. * X (RO)
  219. *
  220. * major version X
  221. */
  222. #define ESC_REVISION_X_MASK (0xFFU)
  223. #define ESC_REVISION_X_SHIFT (0U)
  224. #define ESC_REVISION_X_GET(x) (((uint8_t)(x) & ESC_REVISION_X_MASK) >> ESC_REVISION_X_SHIFT)
  225. /* Bitfield definition for register: BUILD */
  226. /*
  227. * BUILD (RO)
  228. *
  229. */
  230. #define ESC_BUILD_BUILD_MASK (0xFF00U)
  231. #define ESC_BUILD_BUILD_SHIFT (8U)
  232. #define ESC_BUILD_BUILD_GET(x) (((uint16_t)(x) & ESC_BUILD_BUILD_MASK) >> ESC_BUILD_BUILD_SHIFT)
  233. /*
  234. * Y (RO)
  235. *
  236. * minor version Y
  237. */
  238. #define ESC_BUILD_Y_MASK (0xF0U)
  239. #define ESC_BUILD_Y_SHIFT (4U)
  240. #define ESC_BUILD_Y_GET(x) (((uint16_t)(x) & ESC_BUILD_Y_MASK) >> ESC_BUILD_Y_SHIFT)
  241. /*
  242. * Z (RO)
  243. *
  244. * maintenance version Z
  245. */
  246. #define ESC_BUILD_Z_MASK (0xFU)
  247. #define ESC_BUILD_Z_SHIFT (0U)
  248. #define ESC_BUILD_Z_GET(x) (((uint16_t)(x) & ESC_BUILD_Z_MASK) >> ESC_BUILD_Z_SHIFT)
  249. /* Bitfield definition for register: FMMU_NUM */
  250. /*
  251. * NUM (RO)
  252. *
  253. * Number of supported FMMU channels (or entities)
  254. */
  255. #define ESC_FMMU_NUM_NUM_MASK (0xFFU)
  256. #define ESC_FMMU_NUM_NUM_SHIFT (0U)
  257. #define ESC_FMMU_NUM_NUM_GET(x) (((uint8_t)(x) & ESC_FMMU_NUM_NUM_MASK) >> ESC_FMMU_NUM_NUM_SHIFT)
  258. /* Bitfield definition for register: SYNCM_NUM */
  259. /*
  260. * NUM (RO)
  261. *
  262. * Number of supported SyncManager channels (or entities)
  263. */
  264. #define ESC_SYNCM_NUM_NUM_MASK (0xFFU)
  265. #define ESC_SYNCM_NUM_NUM_SHIFT (0U)
  266. #define ESC_SYNCM_NUM_NUM_GET(x) (((uint8_t)(x) & ESC_SYNCM_NUM_NUM_MASK) >> ESC_SYNCM_NUM_NUM_SHIFT)
  267. /* Bitfield definition for register: RAM_SIZE */
  268. /*
  269. * SIZE (RO)
  270. *
  271. * Process Data RAM size supported in KByte
  272. */
  273. #define ESC_RAM_SIZE_SIZE_MASK (0xFFU)
  274. #define ESC_RAM_SIZE_SIZE_SHIFT (0U)
  275. #define ESC_RAM_SIZE_SIZE_GET(x) (((uint8_t)(x) & ESC_RAM_SIZE_SIZE_MASK) >> ESC_RAM_SIZE_SIZE_SHIFT)
  276. /* Bitfield definition for register: PORT_DESC */
  277. /*
  278. * PORT3 (RO)
  279. *
  280. * Port configuration:
  281. * 00:Not implemented
  282. * 01:Not configured (SII EEPROM)
  283. * 10:EBUS
  284. * 11:MII/RMII/RGMII
  285. */
  286. #define ESC_PORT_DESC_PORT3_MASK (0xC0U)
  287. #define ESC_PORT_DESC_PORT3_SHIFT (6U)
  288. #define ESC_PORT_DESC_PORT3_GET(x) (((uint8_t)(x) & ESC_PORT_DESC_PORT3_MASK) >> ESC_PORT_DESC_PORT3_SHIFT)
  289. /*
  290. * PORT2 (RO)
  291. *
  292. * Port configuration:
  293. * 00:Not implemented
  294. * 01:Not configured (SII EEPROM)
  295. * 10:EBUS
  296. * 11:MII/RMII/RGMII
  297. */
  298. #define ESC_PORT_DESC_PORT2_MASK (0x30U)
  299. #define ESC_PORT_DESC_PORT2_SHIFT (4U)
  300. #define ESC_PORT_DESC_PORT2_GET(x) (((uint8_t)(x) & ESC_PORT_DESC_PORT2_MASK) >> ESC_PORT_DESC_PORT2_SHIFT)
  301. /*
  302. * PORT1 (RO)
  303. *
  304. * Port configuration:
  305. * 00:Not implemented
  306. * 01:Not configured (SII EEPROM)
  307. * 10:EBUS
  308. * 11:MII/RMII/RGMII
  309. */
  310. #define ESC_PORT_DESC_PORT1_MASK (0xCU)
  311. #define ESC_PORT_DESC_PORT1_SHIFT (2U)
  312. #define ESC_PORT_DESC_PORT1_GET(x) (((uint8_t)(x) & ESC_PORT_DESC_PORT1_MASK) >> ESC_PORT_DESC_PORT1_SHIFT)
  313. /*
  314. * PORT0 (RO)
  315. *
  316. * Port configuration:
  317. * 00:Not implemented
  318. * 01:Not configured (SII EEPROM)
  319. * 10:EBUS
  320. * 11:MII/RMII/RGMII
  321. */
  322. #define ESC_PORT_DESC_PORT0_MASK (0x3U)
  323. #define ESC_PORT_DESC_PORT0_SHIFT (0U)
  324. #define ESC_PORT_DESC_PORT0_GET(x) (((uint8_t)(x) & ESC_PORT_DESC_PORT0_MASK) >> ESC_PORT_DESC_PORT0_SHIFT)
  325. /* Bitfield definition for register: FEATURE */
  326. /*
  327. * FFSC (RO)
  328. *
  329. * Fixed FMMU/SyncManager configuration:
  330. * 0:Variable configuration
  331. * 1:Fixed configuration (refer to documentation of supporting ESCs)
  332. */
  333. #define ESC_FEATURE_FFSC_MASK (0x800U)
  334. #define ESC_FEATURE_FFSC_SHIFT (11U)
  335. #define ESC_FEATURE_FFSC_GET(x) (((uint16_t)(x) & ESC_FEATURE_FFSC_MASK) >> ESC_FEATURE_FFSC_SHIFT)
  336. /*
  337. * RWC (RO)
  338. *
  339. * EtherCAT read/write command support(BRW,APRW,FPRW):
  340. * 0:Supported
  341. * 1:Not supported
  342. */
  343. #define ESC_FEATURE_RWC_MASK (0x400U)
  344. #define ESC_FEATURE_RWC_SHIFT (10U)
  345. #define ESC_FEATURE_RWC_GET(x) (((uint16_t)(x) & ESC_FEATURE_RWC_MASK) >> ESC_FEATURE_RWC_SHIFT)
  346. /*
  347. * LRW (RO)
  348. *
  349. * EtherCAT LRW command support:
  350. * 0:Supported
  351. * 1:Not supported
  352. */
  353. #define ESC_FEATURE_LRW_MASK (0x200U)
  354. #define ESC_FEATURE_LRW_SHIFT (9U)
  355. #define ESC_FEATURE_LRW_GET(x) (((uint16_t)(x) & ESC_FEATURE_LRW_MASK) >> ESC_FEATURE_LRW_SHIFT)
  356. /*
  357. * EDSA (RO)
  358. *
  359. * Enhanced DC SYNC Activation:
  360. * 0:Not available
  361. * 1:Available
  362. * Note:This feature refers to registers 0x981[7:3] and 0x0984
  363. */
  364. #define ESC_FEATURE_EDSA_MASK (0x100U)
  365. #define ESC_FEATURE_EDSA_SHIFT (8U)
  366. #define ESC_FEATURE_EDSA_GET(x) (((uint16_t)(x) & ESC_FEATURE_EDSA_MASK) >> ESC_FEATURE_EDSA_SHIFT)
  367. /*
  368. * SHFE (RO)
  369. *
  370. * Seperate Handling of FCS Errors:
  371. * 0:Not supported
  372. * 1:Supported, frames with wrong FCS and additional nibble will be counted separately in Forwarded RX Error Counter
  373. */
  374. #define ESC_FEATURE_SHFE_MASK (0x80U)
  375. #define ESC_FEATURE_SHFE_SHIFT (7U)
  376. #define ESC_FEATURE_SHFE_GET(x) (((uint16_t)(x) & ESC_FEATURE_SHFE_MASK) >> ESC_FEATURE_SHFE_SHIFT)
  377. /*
  378. * ELDM (RO)
  379. *
  380. * Enhanced Link Detection MII:
  381. * 0:Not available
  382. * 1:Available
  383. */
  384. #define ESC_FEATURE_ELDM_MASK (0x40U)
  385. #define ESC_FEATURE_ELDM_SHIFT (6U)
  386. #define ESC_FEATURE_ELDM_GET(x) (((uint16_t)(x) & ESC_FEATURE_ELDM_MASK) >> ESC_FEATURE_ELDM_SHIFT)
  387. /*
  388. * DCW (RO)
  389. *
  390. * Distributed Clocks width:
  391. * 0:32 bit
  392. * 1:64 bit
  393. */
  394. #define ESC_FEATURE_DCW_MASK (0x8U)
  395. #define ESC_FEATURE_DCW_SHIFT (3U)
  396. #define ESC_FEATURE_DCW_GET(x) (((uint16_t)(x) & ESC_FEATURE_DCW_MASK) >> ESC_FEATURE_DCW_SHIFT)
  397. /*
  398. * DC (RO)
  399. *
  400. * Distributed Clocks:
  401. * 0:Not available
  402. * 1:Available
  403. */
  404. #define ESC_FEATURE_DC_MASK (0x4U)
  405. #define ESC_FEATURE_DC_SHIFT (2U)
  406. #define ESC_FEATURE_DC_GET(x) (((uint16_t)(x) & ESC_FEATURE_DC_MASK) >> ESC_FEATURE_DC_SHIFT)
  407. /*
  408. * FMMU (RO)
  409. *
  410. * FMMU Operation:
  411. * 0:Bit oriented
  412. * 1:Byte oriented
  413. */
  414. #define ESC_FEATURE_FMMU_MASK (0x1U)
  415. #define ESC_FEATURE_FMMU_SHIFT (0U)
  416. #define ESC_FEATURE_FMMU_GET(x) (((uint16_t)(x) & ESC_FEATURE_FMMU_MASK) >> ESC_FEATURE_FMMU_SHIFT)
  417. /* Bitfield definition for register: STATION_ADDR */
  418. /*
  419. * ADDR (RO)
  420. *
  421. * Address used for node addressing
  422. * (FPRD/FPWR/FPRW/FRMW commands)
  423. */
  424. #define ESC_STATION_ADDR_ADDR_MASK (0xFFFFU)
  425. #define ESC_STATION_ADDR_ADDR_SHIFT (0U)
  426. #define ESC_STATION_ADDR_ADDR_GET(x) (((uint16_t)(x) & ESC_STATION_ADDR_ADDR_MASK) >> ESC_STATION_ADDR_ADDR_SHIFT)
  427. /* Bitfield definition for register: STATION_ALS */
  428. /*
  429. * ADDR (RW)
  430. *
  431. * Alias Address used for node addressing
  432. * (FPRD/FPWR/FPRW/FRMW commands).
  433. * The use of this alias is activated by Register
  434. * DL Control Bit 0x0100[24].
  435. * NOTE:EEPROM value is only transferred into this
  436. * register at first EEPROM load after power-on or
  437. * reset.
  438. * ESC20 exception:EEPROM value is transferred
  439. * into this register after each EEPROM reload
  440. * command.
  441. */
  442. #define ESC_STATION_ALS_ADDR_MASK (0xFFFFU)
  443. #define ESC_STATION_ALS_ADDR_SHIFT (0U)
  444. #define ESC_STATION_ALS_ADDR_SET(x) (((uint16_t)(x) << ESC_STATION_ALS_ADDR_SHIFT) & ESC_STATION_ALS_ADDR_MASK)
  445. #define ESC_STATION_ALS_ADDR_GET(x) (((uint16_t)(x) & ESC_STATION_ALS_ADDR_MASK) >> ESC_STATION_ALS_ADDR_SHIFT)
  446. /* Bitfield definition for register: REG_WEN */
  447. /*
  448. * EN (RO)
  449. *
  450. * If register write protection is enabled, this
  451. * register has to be written in the same
  452. * Ethernet frame (value does not matter)
  453. * before other writes to this station are allowed.
  454. * This bit is self-clearing at the beginning of the
  455. * next frame (SOF), or if Register Write
  456. * Protection is disabled.
  457. */
  458. #define ESC_REG_WEN_EN_MASK (0x1U)
  459. #define ESC_REG_WEN_EN_SHIFT (0U)
  460. #define ESC_REG_WEN_EN_GET(x) (((uint8_t)(x) & ESC_REG_WEN_EN_MASK) >> ESC_REG_WEN_EN_SHIFT)
  461. /* Bitfield definition for register: REG_WP */
  462. /*
  463. * WP (RO)
  464. *
  465. * Register write protection:
  466. * 0:Protection disabled
  467. * 1:Protection enabled
  468. * Registers 0x0000:0x0F7F are write-protected,
  469. * except for 0x0020 and 0x0030
  470. */
  471. #define ESC_REG_WP_WP_MASK (0x1U)
  472. #define ESC_REG_WP_WP_SHIFT (0U)
  473. #define ESC_REG_WP_WP_GET(x) (((uint8_t)(x) & ESC_REG_WP_WP_MASK) >> ESC_REG_WP_WP_SHIFT)
  474. /* Bitfield definition for register: ESC_WEN */
  475. /*
  476. * EN (RO)
  477. *
  478. * If ESC write protection is enabled, this
  479. * register has to be written in the same
  480. * Ethernet frame (value does not matter)
  481. * before other writes to this station are allowed.
  482. * This bit is self-clearing at the beginning of the
  483. * next frame (SOF), or if ESC Write Protection
  484. * is disabled.
  485. */
  486. #define ESC_ESC_WEN_EN_MASK (0x1U)
  487. #define ESC_ESC_WEN_EN_SHIFT (0U)
  488. #define ESC_ESC_WEN_EN_GET(x) (((uint8_t)(x) & ESC_ESC_WEN_EN_MASK) >> ESC_ESC_WEN_EN_SHIFT)
  489. /* Bitfield definition for register: ESC_WP */
  490. /*
  491. * WP (RO)
  492. *
  493. * Write protect:
  494. * 0:Protection disabled
  495. * 1:Protection enabled
  496. * All areas are write-protected, except for 0x0030.
  497. */
  498. #define ESC_ESC_WP_WP_MASK (0x1U)
  499. #define ESC_ESC_WP_WP_SHIFT (0U)
  500. #define ESC_ESC_WP_WP_GET(x) (((uint8_t)(x) & ESC_ESC_WP_WP_MASK) >> ESC_ESC_WP_WP_SHIFT)
  501. /* Bitfield definition for register: ESC_RST_ECAT */
  502. /*
  503. * PR (RO)
  504. *
  505. * Progress of the reset procedure:
  506. * 00:initial/reset state
  507. * 01:after writing 0x52 ('R'), when previous
  508. * state was 00
  509. * 10:after writing 0x45 ('E'), when previous
  510. * state was 01
  511. * 11:after writing 0x53 ('S'), when previous
  512. * state was 10.
  513. * This value must not be observed
  514. * because the ESC enters reset when this
  515. * state is reached, resulting in state 00
  516. */
  517. #define ESC_ESC_RST_ECAT_PR_MASK (0x3U)
  518. #define ESC_ESC_RST_ECAT_PR_SHIFT (0U)
  519. #define ESC_ESC_RST_ECAT_PR_GET(x) (((uint8_t)(x) & ESC_ESC_RST_ECAT_PR_MASK) >> ESC_ESC_RST_ECAT_PR_SHIFT)
  520. /* Bitfield definition for register: ESC_RST_PDI */
  521. /*
  522. * RST (RW)
  523. *
  524. * A reset is asserted after writing the reset
  525. * sequence 0x52 ('R'), 0x45 ('E') and 0x53 ('S')
  526. * in this register with 3 consecutive commands.
  527. * Any other command which does not continue
  528. * the sequence by writing the next expected
  529. * value will cancel the reset procedure
  530. */
  531. #define ESC_ESC_RST_PDI_RST_MASK (0xFFU)
  532. #define ESC_ESC_RST_PDI_RST_SHIFT (0U)
  533. #define ESC_ESC_RST_PDI_RST_SET(x) (((uint8_t)(x) << ESC_ESC_RST_PDI_RST_SHIFT) & ESC_ESC_RST_PDI_RST_MASK)
  534. #define ESC_ESC_RST_PDI_RST_GET(x) (((uint8_t)(x) & ESC_ESC_RST_PDI_RST_MASK) >> ESC_ESC_RST_PDI_RST_SHIFT)
  535. /* Bitfield definition for register: ESC_DL_CTRL */
  536. /*
  537. * SA (RO)
  538. *
  539. * Station alias:
  540. * 0:Ignore Station Alias
  541. * 1:Alias can be used for all configured
  542. * address comm
  543. */
  544. #define ESC_ESC_DL_CTRL_SA_MASK (0x1000000UL)
  545. #define ESC_ESC_DL_CTRL_SA_SHIFT (24U)
  546. #define ESC_ESC_DL_CTRL_SA_GET(x) (((uint32_t)(x) & ESC_ESC_DL_CTRL_SA_MASK) >> ESC_ESC_DL_CTRL_SA_SHIFT)
  547. /*
  548. * RFS (RO)
  549. *
  550. * RX FIFO Size (ESC delays start of
  551. * forwarding until FIFO is at least half full).
  552. * RX FIFO Size/RX delay reduction** :
  553. * Value:EBUS:MII:
  554. * 0:-50 ns -40 ns (-80 ns***)
  555. * 1:-40 ns -40 ns (-80 ns***)
  556. * 2:-30 ns -40 ns
  557. * 3:-20 ns -40 ns
  558. * 4:-10 ns no change
  559. * 5:no change no change
  560. * 6:no change no change
  561. * 7:default default
  562. * NOTE:EEPROM value is only taken over at first
  563. * EEPROM load after power-on or reset
  564. */
  565. #define ESC_ESC_DL_CTRL_RFS_MASK (0x70000UL)
  566. #define ESC_ESC_DL_CTRL_RFS_SHIFT (16U)
  567. #define ESC_ESC_DL_CTRL_RFS_GET(x) (((uint32_t)(x) & ESC_ESC_DL_CTRL_RFS_MASK) >> ESC_ESC_DL_CTRL_RFS_SHIFT)
  568. /*
  569. * LP3 (RO)
  570. *
  571. * Loop Port 3:
  572. * 00:Auto
  573. * 01:Auto Close
  574. * 10:Open
  575. * 11:Closed
  576. */
  577. #define ESC_ESC_DL_CTRL_LP3_MASK (0xC000U)
  578. #define ESC_ESC_DL_CTRL_LP3_SHIFT (14U)
  579. #define ESC_ESC_DL_CTRL_LP3_GET(x) (((uint32_t)(x) & ESC_ESC_DL_CTRL_LP3_MASK) >> ESC_ESC_DL_CTRL_LP3_SHIFT)
  580. /*
  581. * LP2 (RO)
  582. *
  583. * Loop Port 2:
  584. * 00:Auto
  585. * 01:Auto Close
  586. * 10:Open
  587. * 11:Closed
  588. */
  589. #define ESC_ESC_DL_CTRL_LP2_MASK (0x3000U)
  590. #define ESC_ESC_DL_CTRL_LP2_SHIFT (12U)
  591. #define ESC_ESC_DL_CTRL_LP2_GET(x) (((uint32_t)(x) & ESC_ESC_DL_CTRL_LP2_MASK) >> ESC_ESC_DL_CTRL_LP2_SHIFT)
  592. /*
  593. * LP1 (RO)
  594. *
  595. * Loop Port 1:
  596. * 00:Auto
  597. * 01:Auto Close
  598. * 10:Open
  599. * 11:Closed
  600. */
  601. #define ESC_ESC_DL_CTRL_LP1_MASK (0xC00U)
  602. #define ESC_ESC_DL_CTRL_LP1_SHIFT (10U)
  603. #define ESC_ESC_DL_CTRL_LP1_GET(x) (((uint32_t)(x) & ESC_ESC_DL_CTRL_LP1_MASK) >> ESC_ESC_DL_CTRL_LP1_SHIFT)
  604. /*
  605. * LP0 (RO)
  606. *
  607. * Loop Port 0:
  608. * 00:Auto
  609. * 01:Auto Close
  610. * 10:Open
  611. * 11:Closed
  612. * NOTE:
  613. * Loop open means sending/receiving over this port
  614. * is enabled, loop closed means sending/receiving
  615. * is disabled and frames are forwarded to the next
  616. * open port internally.
  617. * Auto:loop closed at link down, opened at link up
  618. * Auto Close:loop closed at link down, opened with
  619. * writing 01 again after link up (or receiving a valid
  620. * Ethernet frame at the closed port)
  621. * Open:loop open regardless of link state
  622. * Closed:loop closed regardless of link state
  623. */
  624. #define ESC_ESC_DL_CTRL_LP0_MASK (0x300U)
  625. #define ESC_ESC_DL_CTRL_LP0_SHIFT (8U)
  626. #define ESC_ESC_DL_CTRL_LP0_GET(x) (((uint32_t)(x) & ESC_ESC_DL_CTRL_LP0_MASK) >> ESC_ESC_DL_CTRL_LP0_SHIFT)
  627. /*
  628. * TU (RO)
  629. *
  630. * Temporary use of settings in
  631. * 0x0100:0x0103[8:15]:
  632. * 0:permanent use
  633. * 1:use for about 1 second, then revert to
  634. * previous settings
  635. */
  636. #define ESC_ESC_DL_CTRL_TU_MASK (0x2U)
  637. #define ESC_ESC_DL_CTRL_TU_SHIFT (1U)
  638. #define ESC_ESC_DL_CTRL_TU_GET(x) (((uint32_t)(x) & ESC_ESC_DL_CTRL_TU_MASK) >> ESC_ESC_DL_CTRL_TU_SHIFT)
  639. /*
  640. * FR (RO)
  641. *
  642. * Forwarding rule:
  643. * 0:Forward non-EtherCAT frames:
  644. * EtherCAT frames are processed,
  645. * non-EtherCAT frames are forwarded
  646. * without processing or modification.
  647. * The source MAC address is not
  648. * changed for any frame.
  649. * 1:Destroy non-EtherCAT frames:
  650. * EtherCAT frames are processed, non-EtherCAT frames are destroyed.
  651. * The source MAC address is changed by
  652. * the Processing Unit for every frame
  653. * (SOURCE_MAC[1] is set
  654. */
  655. #define ESC_ESC_DL_CTRL_FR_MASK (0x1U)
  656. #define ESC_ESC_DL_CTRL_FR_SHIFT (0U)
  657. #define ESC_ESC_DL_CTRL_FR_GET(x) (((uint32_t)(x) & ESC_ESC_DL_CTRL_FR_MASK) >> ESC_ESC_DL_CTRL_FR_SHIFT)
  658. /* Bitfield definition for register: PHYSICAL_RW_OFFSET */
  659. /*
  660. * OFFSET (RO)
  661. *
  662. * This register is used for ReadWrite
  663. * commands in Device Addressing mode
  664. * (FPRW, APRW, BRW).
  665. * The internal read address is directly taken
  666. * from the offset address field of the EtherCAT
  667. * datagram header, while the internal write
  668. * address is calculated by adding the Physical
  669. * Read/Write Offset value to the offset address
  670. * field.
  671. * Internal read address = ADR,
  672. * internal write address = ADR + R/W-Offset
  673. */
  674. #define ESC_PHYSICAL_RW_OFFSET_OFFSET_MASK (0xFFFFU)
  675. #define ESC_PHYSICAL_RW_OFFSET_OFFSET_SHIFT (0U)
  676. #define ESC_PHYSICAL_RW_OFFSET_OFFSET_GET(x) (((uint16_t)(x) & ESC_PHYSICAL_RW_OFFSET_OFFSET_MASK) >> ESC_PHYSICAL_RW_OFFSET_OFFSET_SHIFT)
  677. /* Bitfield definition for register: ESC_DL_STAT */
  678. /*
  679. * CP3 (RO)
  680. *
  681. * Communication on Port 3:
  682. * 0:No stable communication
  683. * 1:Communication established
  684. */
  685. #define ESC_ESC_DL_STAT_CP3_MASK (0x8000U)
  686. #define ESC_ESC_DL_STAT_CP3_SHIFT (15U)
  687. #define ESC_ESC_DL_STAT_CP3_GET(x) (((uint16_t)(x) & ESC_ESC_DL_STAT_CP3_MASK) >> ESC_ESC_DL_STAT_CP3_SHIFT)
  688. /*
  689. * LP3 (RO)
  690. *
  691. * Loop Port 3:
  692. * 0:Open
  693. * 1:Closed
  694. */
  695. #define ESC_ESC_DL_STAT_LP3_MASK (0x4000U)
  696. #define ESC_ESC_DL_STAT_LP3_SHIFT (14U)
  697. #define ESC_ESC_DL_STAT_LP3_GET(x) (((uint16_t)(x) & ESC_ESC_DL_STAT_LP3_MASK) >> ESC_ESC_DL_STAT_LP3_SHIFT)
  698. /*
  699. * CP2 (RO)
  700. *
  701. * Communication on Port 2:
  702. * 0:No stable communication
  703. * 1:Communication established
  704. */
  705. #define ESC_ESC_DL_STAT_CP2_MASK (0x2000U)
  706. #define ESC_ESC_DL_STAT_CP2_SHIFT (13U)
  707. #define ESC_ESC_DL_STAT_CP2_GET(x) (((uint16_t)(x) & ESC_ESC_DL_STAT_CP2_MASK) >> ESC_ESC_DL_STAT_CP2_SHIFT)
  708. /*
  709. * LP2 (RO)
  710. *
  711. * Loop Port 2:
  712. * 0:Open
  713. * 1:Closed
  714. */
  715. #define ESC_ESC_DL_STAT_LP2_MASK (0x1000U)
  716. #define ESC_ESC_DL_STAT_LP2_SHIFT (12U)
  717. #define ESC_ESC_DL_STAT_LP2_GET(x) (((uint16_t)(x) & ESC_ESC_DL_STAT_LP2_MASK) >> ESC_ESC_DL_STAT_LP2_SHIFT)
  718. /*
  719. * CP1 (RO)
  720. *
  721. * Communication on Port 1:
  722. * 0:No stable communication
  723. * 1:Communication established
  724. */
  725. #define ESC_ESC_DL_STAT_CP1_MASK (0x800U)
  726. #define ESC_ESC_DL_STAT_CP1_SHIFT (11U)
  727. #define ESC_ESC_DL_STAT_CP1_GET(x) (((uint16_t)(x) & ESC_ESC_DL_STAT_CP1_MASK) >> ESC_ESC_DL_STAT_CP1_SHIFT)
  728. /*
  729. * LP1 (RO)
  730. *
  731. * Loop Port 1:
  732. * 0:Open
  733. * 1:Closed
  734. */
  735. #define ESC_ESC_DL_STAT_LP1_MASK (0x400U)
  736. #define ESC_ESC_DL_STAT_LP1_SHIFT (10U)
  737. #define ESC_ESC_DL_STAT_LP1_GET(x) (((uint16_t)(x) & ESC_ESC_DL_STAT_LP1_MASK) >> ESC_ESC_DL_STAT_LP1_SHIFT)
  738. /*
  739. * CP0 (RO)
  740. *
  741. * Communication on Port 0:
  742. * 0:No stable communication
  743. * 1:Communication established
  744. */
  745. #define ESC_ESC_DL_STAT_CP0_MASK (0x200U)
  746. #define ESC_ESC_DL_STAT_CP0_SHIFT (9U)
  747. #define ESC_ESC_DL_STAT_CP0_GET(x) (((uint16_t)(x) & ESC_ESC_DL_STAT_CP0_MASK) >> ESC_ESC_DL_STAT_CP0_SHIFT)
  748. /*
  749. * LP0 (RO)
  750. *
  751. * Loop Port 0:
  752. * 0:Open
  753. * 1:Closed
  754. */
  755. #define ESC_ESC_DL_STAT_LP0_MASK (0x100U)
  756. #define ESC_ESC_DL_STAT_LP0_SHIFT (8U)
  757. #define ESC_ESC_DL_STAT_LP0_GET(x) (((uint16_t)(x) & ESC_ESC_DL_STAT_LP0_MASK) >> ESC_ESC_DL_STAT_LP0_SHIFT)
  758. /*
  759. * PLP3 (RO)
  760. *
  761. * Physical link on Port 3:
  762. * 0:No link
  763. * 1:Link detected
  764. */
  765. #define ESC_ESC_DL_STAT_PLP3_MASK (0x80U)
  766. #define ESC_ESC_DL_STAT_PLP3_SHIFT (7U)
  767. #define ESC_ESC_DL_STAT_PLP3_GET(x) (((uint16_t)(x) & ESC_ESC_DL_STAT_PLP3_MASK) >> ESC_ESC_DL_STAT_PLP3_SHIFT)
  768. /*
  769. * PLP2 (RO)
  770. *
  771. * Physical link on Port 2:
  772. * 0:No link
  773. * 1:Link detected
  774. */
  775. #define ESC_ESC_DL_STAT_PLP2_MASK (0x40U)
  776. #define ESC_ESC_DL_STAT_PLP2_SHIFT (6U)
  777. #define ESC_ESC_DL_STAT_PLP2_GET(x) (((uint16_t)(x) & ESC_ESC_DL_STAT_PLP2_MASK) >> ESC_ESC_DL_STAT_PLP2_SHIFT)
  778. /*
  779. * PLP1 (RO)
  780. *
  781. * Physical link on Port 1:
  782. * 0:No link
  783. * 1:Link detected
  784. */
  785. #define ESC_ESC_DL_STAT_PLP1_MASK (0x20U)
  786. #define ESC_ESC_DL_STAT_PLP1_SHIFT (5U)
  787. #define ESC_ESC_DL_STAT_PLP1_GET(x) (((uint16_t)(x) & ESC_ESC_DL_STAT_PLP1_MASK) >> ESC_ESC_DL_STAT_PLP1_SHIFT)
  788. /*
  789. * PLP0 (RO)
  790. *
  791. * Physical link on Port 0:
  792. * 0:No link
  793. * 1:Link detected
  794. */
  795. #define ESC_ESC_DL_STAT_PLP0_MASK (0x10U)
  796. #define ESC_ESC_DL_STAT_PLP0_SHIFT (4U)
  797. #define ESC_ESC_DL_STAT_PLP0_GET(x) (((uint16_t)(x) & ESC_ESC_DL_STAT_PLP0_MASK) >> ESC_ESC_DL_STAT_PLP0_SHIFT)
  798. /*
  799. * ELD (RO)
  800. *
  801. * Enhanced Link detection:
  802. * 0:Deactivated for all ports
  803. * 1:Activated for at least one port
  804. * NOTE:EEPROM value is only transferred into this
  805. * register at first EEPROM load after power-on or
  806. * reset
  807. */
  808. #define ESC_ESC_DL_STAT_ELD_MASK (0x4U)
  809. #define ESC_ESC_DL_STAT_ELD_SHIFT (2U)
  810. #define ESC_ESC_DL_STAT_ELD_GET(x) (((uint16_t)(x) & ESC_ESC_DL_STAT_ELD_MASK) >> ESC_ESC_DL_STAT_ELD_SHIFT)
  811. /*
  812. * WDS (RO)
  813. *
  814. * PDI Watchdog Status:
  815. * 0:Watchdog expired
  816. * 1:Watchdog reloaded
  817. */
  818. #define ESC_ESC_DL_STAT_WDS_MASK (0x2U)
  819. #define ESC_ESC_DL_STAT_WDS_SHIFT (1U)
  820. #define ESC_ESC_DL_STAT_WDS_GET(x) (((uint16_t)(x) & ESC_ESC_DL_STAT_WDS_MASK) >> ESC_ESC_DL_STAT_WDS_SHIFT)
  821. /*
  822. * EPLC (RO)
  823. *
  824. * PDI operational/EEPROM loaded correctly:
  825. * 0:EEPROM not loaded, PDI not
  826. * operational (no access to Process Data
  827. * RAM)
  828. * 1:EEPROM loaded correctly, PDI
  829. * operational (access to Process Data
  830. * RAM)
  831. */
  832. #define ESC_ESC_DL_STAT_EPLC_MASK (0x1U)
  833. #define ESC_ESC_DL_STAT_EPLC_SHIFT (0U)
  834. #define ESC_ESC_DL_STAT_EPLC_GET(x) (((uint16_t)(x) & ESC_ESC_DL_STAT_EPLC_MASK) >> ESC_ESC_DL_STAT_EPLC_SHIFT)
  835. /* Bitfield definition for register: AL_CTRL */
  836. /*
  837. * DI (RW)
  838. *
  839. * Device Identification:
  840. * 0:No request
  841. * 1:Device Identification request
  842. */
  843. #define ESC_AL_CTRL_DI_MASK (0x20U)
  844. #define ESC_AL_CTRL_DI_SHIFT (5U)
  845. #define ESC_AL_CTRL_DI_SET(x) (((uint16_t)(x) << ESC_AL_CTRL_DI_SHIFT) & ESC_AL_CTRL_DI_MASK)
  846. #define ESC_AL_CTRL_DI_GET(x) (((uint16_t)(x) & ESC_AL_CTRL_DI_MASK) >> ESC_AL_CTRL_DI_SHIFT)
  847. /*
  848. * EIA (RW)
  849. *
  850. * Error Ind Ack:
  851. * 0:No Ack of Error Ind in AL status register
  852. * 1:Ack of Error Ind in AL status register
  853. */
  854. #define ESC_AL_CTRL_EIA_MASK (0x10U)
  855. #define ESC_AL_CTRL_EIA_SHIFT (4U)
  856. #define ESC_AL_CTRL_EIA_SET(x) (((uint16_t)(x) << ESC_AL_CTRL_EIA_SHIFT) & ESC_AL_CTRL_EIA_MASK)
  857. #define ESC_AL_CTRL_EIA_GET(x) (((uint16_t)(x) & ESC_AL_CTRL_EIA_MASK) >> ESC_AL_CTRL_EIA_SHIFT)
  858. /*
  859. * IST (RW)
  860. *
  861. * Initiate State Transition of the Device State
  862. * Machine:
  863. * 1:Request Init State
  864. * 3:Request Bootstrap State
  865. * 2:Request Pre-Operational State
  866. * 4:Request Safe-Operational State
  867. * 8:Request Operational State
  868. */
  869. #define ESC_AL_CTRL_IST_MASK (0xFU)
  870. #define ESC_AL_CTRL_IST_SHIFT (0U)
  871. #define ESC_AL_CTRL_IST_SET(x) (((uint16_t)(x) << ESC_AL_CTRL_IST_SHIFT) & ESC_AL_CTRL_IST_MASK)
  872. #define ESC_AL_CTRL_IST_GET(x) (((uint16_t)(x) & ESC_AL_CTRL_IST_MASK) >> ESC_AL_CTRL_IST_SHIFT)
  873. /* Bitfield definition for register: AL_STAT */
  874. /*
  875. * DI (RW)
  876. *
  877. * Device Identification:
  878. * 0:Device Identification not valid
  879. * 1:Device Identification loaded
  880. */
  881. #define ESC_AL_STAT_DI_MASK (0x20U)
  882. #define ESC_AL_STAT_DI_SHIFT (5U)
  883. #define ESC_AL_STAT_DI_SET(x) (((uint16_t)(x) << ESC_AL_STAT_DI_SHIFT) & ESC_AL_STAT_DI_MASK)
  884. #define ESC_AL_STAT_DI_GET(x) (((uint16_t)(x) & ESC_AL_STAT_DI_MASK) >> ESC_AL_STAT_DI_SHIFT)
  885. /*
  886. * EI (RW)
  887. *
  888. * Error Ind:
  889. * 0:Device is in State as requested or Flag
  890. * cleared by command
  891. * 1:Device has not entered requested State
  892. * or changed State as result of a local
  893. * action
  894. */
  895. #define ESC_AL_STAT_EI_MASK (0x10U)
  896. #define ESC_AL_STAT_EI_SHIFT (4U)
  897. #define ESC_AL_STAT_EI_SET(x) (((uint16_t)(x) << ESC_AL_STAT_EI_SHIFT) & ESC_AL_STAT_EI_MASK)
  898. #define ESC_AL_STAT_EI_GET(x) (((uint16_t)(x) & ESC_AL_STAT_EI_MASK) >> ESC_AL_STAT_EI_SHIFT)
  899. /*
  900. * AS (RW)
  901. *
  902. * Actual State of the Device State Machine:
  903. * 1:Init State
  904. * 3:Bootstrap State
  905. * 2:Pre-Operational State
  906. * 4:Safe-Operational State
  907. * 8:Operational State
  908. */
  909. #define ESC_AL_STAT_AS_MASK (0xFU)
  910. #define ESC_AL_STAT_AS_SHIFT (0U)
  911. #define ESC_AL_STAT_AS_SET(x) (((uint16_t)(x) << ESC_AL_STAT_AS_SHIFT) & ESC_AL_STAT_AS_MASK)
  912. #define ESC_AL_STAT_AS_GET(x) (((uint16_t)(x) & ESC_AL_STAT_AS_MASK) >> ESC_AL_STAT_AS_SHIFT)
  913. /* Bitfield definition for register: AL_STAT_CODE */
  914. /*
  915. * CODE (RW)
  916. *
  917. * AL Status Code
  918. */
  919. #define ESC_AL_STAT_CODE_CODE_MASK (0xFFFFU)
  920. #define ESC_AL_STAT_CODE_CODE_SHIFT (0U)
  921. #define ESC_AL_STAT_CODE_CODE_SET(x) (((uint16_t)(x) << ESC_AL_STAT_CODE_CODE_SHIFT) & ESC_AL_STAT_CODE_CODE_MASK)
  922. #define ESC_AL_STAT_CODE_CODE_GET(x) (((uint16_t)(x) & ESC_AL_STAT_CODE_CODE_MASK) >> ESC_AL_STAT_CODE_CODE_SHIFT)
  923. /* Bitfield definition for register: RUN_LED_OVRD */
  924. /*
  925. * EN_OVRD (RW)
  926. *
  927. * Enable Override:
  928. * 0:Override disabled
  929. * 1:Override enabled
  930. */
  931. #define ESC_RUN_LED_OVRD_EN_OVRD_MASK (0x10U)
  932. #define ESC_RUN_LED_OVRD_EN_OVRD_SHIFT (4U)
  933. #define ESC_RUN_LED_OVRD_EN_OVRD_SET(x) (((uint8_t)(x) << ESC_RUN_LED_OVRD_EN_OVRD_SHIFT) & ESC_RUN_LED_OVRD_EN_OVRD_MASK)
  934. #define ESC_RUN_LED_OVRD_EN_OVRD_GET(x) (((uint8_t)(x) & ESC_RUN_LED_OVRD_EN_OVRD_MASK) >> ESC_RUN_LED_OVRD_EN_OVRD_SHIFT)
  935. /*
  936. * LED_CODE (RW)
  937. *
  938. * LED code:
  939. * 0x0:Off
  940. * 0x1:Flash 1x
  941. * 0x2-0xC:Flash 2x – 12x
  942. * 0xD:Blinking
  943. * 0xE:Flickering
  944. * 0xF:On
  945. */
  946. #define ESC_RUN_LED_OVRD_LED_CODE_MASK (0xFU)
  947. #define ESC_RUN_LED_OVRD_LED_CODE_SHIFT (0U)
  948. #define ESC_RUN_LED_OVRD_LED_CODE_SET(x) (((uint8_t)(x) << ESC_RUN_LED_OVRD_LED_CODE_SHIFT) & ESC_RUN_LED_OVRD_LED_CODE_MASK)
  949. #define ESC_RUN_LED_OVRD_LED_CODE_GET(x) (((uint8_t)(x) & ESC_RUN_LED_OVRD_LED_CODE_MASK) >> ESC_RUN_LED_OVRD_LED_CODE_SHIFT)
  950. /* Bitfield definition for register: ERR_LED_OVRD */
  951. /*
  952. * EN_OVRD (RW)
  953. *
  954. * Enable Override:
  955. * 0:Override disabled
  956. * 1:Override enabled
  957. */
  958. #define ESC_ERR_LED_OVRD_EN_OVRD_MASK (0x10U)
  959. #define ESC_ERR_LED_OVRD_EN_OVRD_SHIFT (4U)
  960. #define ESC_ERR_LED_OVRD_EN_OVRD_SET(x) (((uint8_t)(x) << ESC_ERR_LED_OVRD_EN_OVRD_SHIFT) & ESC_ERR_LED_OVRD_EN_OVRD_MASK)
  961. #define ESC_ERR_LED_OVRD_EN_OVRD_GET(x) (((uint8_t)(x) & ESC_ERR_LED_OVRD_EN_OVRD_MASK) >> ESC_ERR_LED_OVRD_EN_OVRD_SHIFT)
  962. /*
  963. * LED_CODE (RW)
  964. *
  965. * LED code:
  966. * 0x0:Off
  967. * 0x1-0xC:Flash 1x – 12x
  968. * 0xD:Blinking
  969. * 0xE:Flickering
  970. * 0xF:On
  971. */
  972. #define ESC_ERR_LED_OVRD_LED_CODE_MASK (0xFU)
  973. #define ESC_ERR_LED_OVRD_LED_CODE_SHIFT (0U)
  974. #define ESC_ERR_LED_OVRD_LED_CODE_SET(x) (((uint8_t)(x) << ESC_ERR_LED_OVRD_LED_CODE_SHIFT) & ESC_ERR_LED_OVRD_LED_CODE_MASK)
  975. #define ESC_ERR_LED_OVRD_LED_CODE_GET(x) (((uint8_t)(x) & ESC_ERR_LED_OVRD_LED_CODE_MASK) >> ESC_ERR_LED_OVRD_LED_CODE_SHIFT)
  976. /* Bitfield definition for register: PDI_CTRL */
  977. /*
  978. * PDI (RO)
  979. *
  980. * Process data interface:
  981. * 0x00:Interface deactivated (no PDI)
  982. * 0x01:4 Digital Input
  983. * 0x02:4 Digital Output
  984. * 0x03:2 Digital Input and 2 Digital Output
  985. * 0x04:Digital I/O
  986. * 0x05:SPI Slave
  987. * 0x06:Oversampling I/O
  988. * 0x07:EtherCAT Bridge (port 3)
  989. * 0x08:16 Bit asynchronous Microcontroller
  990. * interface
  991. * 0x09:8 Bit asynchronous Microcontroller
  992. * interface
  993. * 0x0A:16 Bit synchronous Microcontroller
  994. * interface
  995. * 0x0B:8 Bit synchronous Microcontroller
  996. * interface
  997. * 0x10:32 Digital Input and 0 Digital Output
  998. * 0x11:24 Digital Input and 8 Digital Output
  999. * 0x12:16 Digital Input and 16 Digital Output
  1000. * 0x13:8 Digital Input and 24 Digital Output
  1001. * 0x14:0 Digital Input and 32 Digital Output
  1002. * 0x80:On-chip bus
  1003. * Others:Reserved
  1004. */
  1005. #define ESC_PDI_CTRL_PDI_MASK (0xFFU)
  1006. #define ESC_PDI_CTRL_PDI_SHIFT (0U)
  1007. #define ESC_PDI_CTRL_PDI_GET(x) (((uint8_t)(x) & ESC_PDI_CTRL_PDI_MASK) >> ESC_PDI_CTRL_PDI_SHIFT)
  1008. /* Bitfield definition for register: ESC_CFG */
  1009. /*
  1010. * ELP3 (RO)
  1011. *
  1012. * Enhanced Link port 3:
  1013. * 0:disabled (if bit 1=0)
  1014. * 1:enabled
  1015. */
  1016. #define ESC_ESC_CFG_ELP3_MASK (0x80U)
  1017. #define ESC_ESC_CFG_ELP3_SHIFT (7U)
  1018. #define ESC_ESC_CFG_ELP3_GET(x) (((uint8_t)(x) & ESC_ESC_CFG_ELP3_MASK) >> ESC_ESC_CFG_ELP3_SHIFT)
  1019. /*
  1020. * ELP2 (RO)
  1021. *
  1022. * Enhanced Link port 2:
  1023. * 0:disabled (if bit 1=0)
  1024. * 1:enabled
  1025. */
  1026. #define ESC_ESC_CFG_ELP2_MASK (0x40U)
  1027. #define ESC_ESC_CFG_ELP2_SHIFT (6U)
  1028. #define ESC_ESC_CFG_ELP2_GET(x) (((uint8_t)(x) & ESC_ESC_CFG_ELP2_MASK) >> ESC_ESC_CFG_ELP2_SHIFT)
  1029. /*
  1030. * ELP1 (RO)
  1031. *
  1032. * Enhanced Link port 1:
  1033. * 0:disabled (if bit 1=0)
  1034. * 1:enabled
  1035. */
  1036. #define ESC_ESC_CFG_ELP1_MASK (0x20U)
  1037. #define ESC_ESC_CFG_ELP1_SHIFT (5U)
  1038. #define ESC_ESC_CFG_ELP1_GET(x) (((uint8_t)(x) & ESC_ESC_CFG_ELP1_MASK) >> ESC_ESC_CFG_ELP1_SHIFT)
  1039. /*
  1040. * ELP0 (RO)
  1041. *
  1042. * Enhanced Link port 0:
  1043. * 0:disabled (if bit 1=0)
  1044. * 1:enabled
  1045. */
  1046. #define ESC_ESC_CFG_ELP0_MASK (0x10U)
  1047. #define ESC_ESC_CFG_ELP0_SHIFT (4U)
  1048. #define ESC_ESC_CFG_ELP0_GET(x) (((uint8_t)(x) & ESC_ESC_CFG_ELP0_MASK) >> ESC_ESC_CFG_ELP0_SHIFT)
  1049. /*
  1050. * CDLIU (RO)
  1051. *
  1052. * Distributed Clocks Latch In Unit:
  1053. * 0:disabled (power saving)
  1054. * 1:enabled
  1055. */
  1056. #define ESC_ESC_CFG_CDLIU_MASK (0x8U)
  1057. #define ESC_ESC_CFG_CDLIU_SHIFT (3U)
  1058. #define ESC_ESC_CFG_CDLIU_GET(x) (((uint8_t)(x) & ESC_ESC_CFG_CDLIU_MASK) >> ESC_ESC_CFG_CDLIU_SHIFT)
  1059. /*
  1060. * DCSOU (RO)
  1061. *
  1062. * Distributed Clocks SYNC Out Unit:
  1063. * 0:disabled (power saving)
  1064. * 1:enabled
  1065. */
  1066. #define ESC_ESC_CFG_DCSOU_MASK (0x4U)
  1067. #define ESC_ESC_CFG_DCSOU_SHIFT (2U)
  1068. #define ESC_ESC_CFG_DCSOU_GET(x) (((uint8_t)(x) & ESC_ESC_CFG_DCSOU_MASK) >> ESC_ESC_CFG_DCSOU_SHIFT)
  1069. /*
  1070. * ELDAP (RO)
  1071. *
  1072. * Enhanced Link detection all ports:
  1073. * 0:disabled (if bits [7:4]=0)
  1074. * 1:enabled at all ports (overrides bits [7:4])
  1075. */
  1076. #define ESC_ESC_CFG_ELDAP_MASK (0x2U)
  1077. #define ESC_ESC_CFG_ELDAP_SHIFT (1U)
  1078. #define ESC_ESC_CFG_ELDAP_GET(x) (((uint8_t)(x) & ESC_ESC_CFG_ELDAP_MASK) >> ESC_ESC_CFG_ELDAP_SHIFT)
  1079. /*
  1080. * DEV_EMU (RO)
  1081. *
  1082. * Device emulation (control of AL status):
  1083. * 0:AL status register has to be set by PDI
  1084. * 1:AL status register will be set to value
  1085. * written to AL control register
  1086. */
  1087. #define ESC_ESC_CFG_DEV_EMU_MASK (0x1U)
  1088. #define ESC_ESC_CFG_DEV_EMU_SHIFT (0U)
  1089. #define ESC_ESC_CFG_DEV_EMU_GET(x) (((uint8_t)(x) & ESC_ESC_CFG_DEV_EMU_MASK) >> ESC_ESC_CFG_DEV_EMU_SHIFT)
  1090. /* Bitfield definition for register: PDI_INFO */
  1091. /*
  1092. * PDICN (RO)
  1093. *
  1094. * PDI configuration invalid:
  1095. * 0:PDI configuration ok
  1096. * 1:PDI configuration invalid
  1097. */
  1098. #define ESC_PDI_INFO_PDICN_MASK (0x8U)
  1099. #define ESC_PDI_INFO_PDICN_SHIFT (3U)
  1100. #define ESC_PDI_INFO_PDICN_GET(x) (((uint16_t)(x) & ESC_PDI_INFO_PDICN_MASK) >> ESC_PDI_INFO_PDICN_SHIFT)
  1101. /*
  1102. * PDIA (RO)
  1103. *
  1104. * PDI active:
  1105. * 0:PDI not active
  1106. * 1:PDI active
  1107. */
  1108. #define ESC_PDI_INFO_PDIA_MASK (0x4U)
  1109. #define ESC_PDI_INFO_PDIA_SHIFT (2U)
  1110. #define ESC_PDI_INFO_PDIA_GET(x) (((uint16_t)(x) & ESC_PDI_INFO_PDIA_MASK) >> ESC_PDI_INFO_PDIA_SHIFT)
  1111. /*
  1112. * ECLFE (RO)
  1113. *
  1114. * ESC configuration area loaded from
  1115. * EEPROM:
  1116. * 0:not loaded
  1117. * 1:loaded
  1118. */
  1119. #define ESC_PDI_INFO_ECLFE_MASK (0x2U)
  1120. #define ESC_PDI_INFO_ECLFE_SHIFT (1U)
  1121. #define ESC_PDI_INFO_ECLFE_GET(x) (((uint16_t)(x) & ESC_PDI_INFO_ECLFE_MASK) >> ESC_PDI_INFO_ECLFE_SHIFT)
  1122. /*
  1123. * PFABW (RO)
  1124. *
  1125. * DI function acknowledge by write:
  1126. * 0:Disabled
  1127. * 1:Enabled
  1128. */
  1129. #define ESC_PDI_INFO_PFABW_MASK (0x1U)
  1130. #define ESC_PDI_INFO_PFABW_SHIFT (0U)
  1131. #define ESC_PDI_INFO_PFABW_GET(x) (((uint16_t)(x) & ESC_PDI_INFO_PFABW_MASK) >> ESC_PDI_INFO_PFABW_SHIFT)
  1132. /* Bitfield definition for register: PDI_CFG */
  1133. /*
  1134. * BUS (RO)
  1135. *
  1136. * On-chip bus:
  1137. * 000:Intel® Avalon®
  1138. * 001:AXI®
  1139. * 010:Xilinx® PLB v4.6
  1140. * 100:Xilinx OPB
  1141. * others:reserved
  1142. */
  1143. #define ESC_PDI_CFG_BUS_MASK (0xE0U)
  1144. #define ESC_PDI_CFG_BUS_SHIFT (5U)
  1145. #define ESC_PDI_CFG_BUS_GET(x) (((uint8_t)(x) & ESC_PDI_CFG_BUS_MASK) >> ESC_PDI_CFG_BUS_SHIFT)
  1146. /*
  1147. * CLK (RO)
  1148. *
  1149. * On-chip bus clock:
  1150. * 0:asynchronous
  1151. * 1-31:synchronous multiplication factor
  1152. * (N * 25 MHz)
  1153. */
  1154. #define ESC_PDI_CFG_CLK_MASK (0x1FU)
  1155. #define ESC_PDI_CFG_CLK_SHIFT (0U)
  1156. #define ESC_PDI_CFG_CLK_GET(x) (((uint8_t)(x) & ESC_PDI_CFG_CLK_MASK) >> ESC_PDI_CFG_CLK_SHIFT)
  1157. /* Bitfield definition for register: PDI_SL_CFG */
  1158. /*
  1159. * SYNC1_MAER (RO)
  1160. *
  1161. * SYNC1 mapped to AL Event Request
  1162. * register 0x0220[3]:
  1163. * 0:Disabled
  1164. * 1:Enabled
  1165. */
  1166. #define ESC_PDI_SL_CFG_SYNC1_MAER_MASK (0x80U)
  1167. #define ESC_PDI_SL_CFG_SYNC1_MAER_SHIFT (7U)
  1168. #define ESC_PDI_SL_CFG_SYNC1_MAER_GET(x) (((uint8_t)(x) & ESC_PDI_SL_CFG_SYNC1_MAER_MASK) >> ESC_PDI_SL_CFG_SYNC1_MAER_SHIFT)
  1169. /*
  1170. * SYNC1_CFG (RO)
  1171. *
  1172. * SYNC1/LATCH1 configuration*:
  1173. * 0:LATCH1 input
  1174. * 1:SYNC1 output
  1175. */
  1176. #define ESC_PDI_SL_CFG_SYNC1_CFG_MASK (0x40U)
  1177. #define ESC_PDI_SL_CFG_SYNC1_CFG_SHIFT (6U)
  1178. #define ESC_PDI_SL_CFG_SYNC1_CFG_GET(x) (((uint8_t)(x) & ESC_PDI_SL_CFG_SYNC1_CFG_MASK) >> ESC_PDI_SL_CFG_SYNC1_CFG_SHIFT)
  1179. /*
  1180. * SYNC1_ODP (RO)
  1181. *
  1182. * SYNC1 output driver/polarity:
  1183. * 00:Push-Pull active low
  1184. * 01:Open Drain (active low)
  1185. * 10:Push-Pull active high
  1186. * 11:Open Source (active high)
  1187. */
  1188. #define ESC_PDI_SL_CFG_SYNC1_ODP_MASK (0x30U)
  1189. #define ESC_PDI_SL_CFG_SYNC1_ODP_SHIFT (4U)
  1190. #define ESC_PDI_SL_CFG_SYNC1_ODP_GET(x) (((uint8_t)(x) & ESC_PDI_SL_CFG_SYNC1_ODP_MASK) >> ESC_PDI_SL_CFG_SYNC1_ODP_SHIFT)
  1191. /*
  1192. * SYNC0_MAER (RO)
  1193. *
  1194. * SYNC0 mapped to AL Event Request
  1195. * register 0x0220[2]:
  1196. * 0:Disabled
  1197. * 1:Enabled
  1198. */
  1199. #define ESC_PDI_SL_CFG_SYNC0_MAER_MASK (0x8U)
  1200. #define ESC_PDI_SL_CFG_SYNC0_MAER_SHIFT (3U)
  1201. #define ESC_PDI_SL_CFG_SYNC0_MAER_GET(x) (((uint8_t)(x) & ESC_PDI_SL_CFG_SYNC0_MAER_MASK) >> ESC_PDI_SL_CFG_SYNC0_MAER_SHIFT)
  1202. /*
  1203. * SYNC0_CFG (RO)
  1204. *
  1205. * SYNC0/LATCH0 configuration*:
  1206. * 0:LATCH0 Input
  1207. * 1:SYNC0 Output
  1208. */
  1209. #define ESC_PDI_SL_CFG_SYNC0_CFG_MASK (0x4U)
  1210. #define ESC_PDI_SL_CFG_SYNC0_CFG_SHIFT (2U)
  1211. #define ESC_PDI_SL_CFG_SYNC0_CFG_GET(x) (((uint8_t)(x) & ESC_PDI_SL_CFG_SYNC0_CFG_MASK) >> ESC_PDI_SL_CFG_SYNC0_CFG_SHIFT)
  1212. /*
  1213. * SYNC0_ODP (RO)
  1214. *
  1215. * SYNC0 output driver/polarity:
  1216. * 00:Push-Pull active low
  1217. * 01:Open Drain (active low)
  1218. * 10:Push-Pull active high
  1219. * 11:Open Source (active high)
  1220. */
  1221. #define ESC_PDI_SL_CFG_SYNC0_ODP_MASK (0x3U)
  1222. #define ESC_PDI_SL_CFG_SYNC0_ODP_SHIFT (0U)
  1223. #define ESC_PDI_SL_CFG_SYNC0_ODP_GET(x) (((uint8_t)(x) & ESC_PDI_SL_CFG_SYNC0_ODP_MASK) >> ESC_PDI_SL_CFG_SYNC0_ODP_SHIFT)
  1224. /* Bitfield definition for register: PDI_EXT_CFG */
  1225. /*
  1226. * OCBST (RW)
  1227. *
  1228. * On-chip bus sub-type for AXI:
  1229. * 000:AXI3
  1230. * 001:AXI4
  1231. * 010:AXI4 LITE
  1232. * others:reserved
  1233. */
  1234. #define ESC_PDI_EXT_CFG_OCBST_MASK (0x700U)
  1235. #define ESC_PDI_EXT_CFG_OCBST_SHIFT (8U)
  1236. #define ESC_PDI_EXT_CFG_OCBST_SET(x) (((uint16_t)(x) << ESC_PDI_EXT_CFG_OCBST_SHIFT) & ESC_PDI_EXT_CFG_OCBST_MASK)
  1237. #define ESC_PDI_EXT_CFG_OCBST_GET(x) (((uint16_t)(x) & ESC_PDI_EXT_CFG_OCBST_MASK) >> ESC_PDI_EXT_CFG_OCBST_SHIFT)
  1238. /*
  1239. * RPS (RO)
  1240. *
  1241. * Read prefetch size (in cycles of PDI width):
  1242. * 0:4 cycles
  1243. * 1:1 cycle (typical)
  1244. * 2:2 cycles
  1245. * 3:Reserved
  1246. */
  1247. #define ESC_PDI_EXT_CFG_RPS_MASK (0x3U)
  1248. #define ESC_PDI_EXT_CFG_RPS_SHIFT (0U)
  1249. #define ESC_PDI_EXT_CFG_RPS_GET(x) (((uint16_t)(x) & ESC_PDI_EXT_CFG_RPS_MASK) >> ESC_PDI_EXT_CFG_RPS_SHIFT)
  1250. /* Bitfield definition for register: ECAT_EVT_MSK */
  1251. /*
  1252. * MASK (RO)
  1253. *
  1254. * ECAT Event masking of the ECAT Event
  1255. * Request Events for mapping into ECAT event
  1256. * field of EtherCAT frames:
  1257. * 0:Corresponding ECAT Event Request
  1258. * register bit is not mapped
  1259. * 1:Corresponding ECAT Event Request
  1260. * register bit is mapped
  1261. */
  1262. #define ESC_ECAT_EVT_MSK_MASK_MASK (0xFFFFU)
  1263. #define ESC_ECAT_EVT_MSK_MASK_SHIFT (0U)
  1264. #define ESC_ECAT_EVT_MSK_MASK_GET(x) (((uint16_t)(x) & ESC_ECAT_EVT_MSK_MASK_MASK) >> ESC_ECAT_EVT_MSK_MASK_SHIFT)
  1265. /* Bitfield definition for register: PDI_AL_EVT_MSK */
  1266. /*
  1267. * MASK (RW)
  1268. *
  1269. * AL Event masking of the AL Event Request
  1270. * register Events for mapping to PDI IRQ
  1271. * signal:
  1272. * 0:Corresponding AL Event Request
  1273. * register bit is not mapped
  1274. * 1:Corresponding AL Event Request
  1275. * register bit is mapped
  1276. */
  1277. #define ESC_PDI_AL_EVT_MSK_MASK_MASK (0xFFFFFFFFUL)
  1278. #define ESC_PDI_AL_EVT_MSK_MASK_SHIFT (0U)
  1279. #define ESC_PDI_AL_EVT_MSK_MASK_SET(x) (((uint32_t)(x) << ESC_PDI_AL_EVT_MSK_MASK_SHIFT) & ESC_PDI_AL_EVT_MSK_MASK_MASK)
  1280. #define ESC_PDI_AL_EVT_MSK_MASK_GET(x) (((uint32_t)(x) & ESC_PDI_AL_EVT_MSK_MASK_MASK) >> ESC_PDI_AL_EVT_MSK_MASK_SHIFT)
  1281. /* Bitfield definition for register: ECAT_EVT_REQ */
  1282. /*
  1283. * MV (RO)
  1284. *
  1285. * Mirrors values of each SyncManager Status:
  1286. * 0:No Sync Channel 0 event
  1287. * 1:Sync Channel 0 event pending
  1288. * 0:No Sync Channel 1 event
  1289. * 1:Sync Channel 1 event pending
  1290. * …
  1291. * 0:No Sync Channel 7 event
  1292. * 1:Sync Channel 7 event pending
  1293. */
  1294. #define ESC_ECAT_EVT_REQ_MV_MASK (0xFF0U)
  1295. #define ESC_ECAT_EVT_REQ_MV_SHIFT (4U)
  1296. #define ESC_ECAT_EVT_REQ_MV_GET(x) (((uint16_t)(x) & ESC_ECAT_EVT_REQ_MV_MASK) >> ESC_ECAT_EVT_REQ_MV_SHIFT)
  1297. /*
  1298. * ALS_EVT (RO)
  1299. *
  1300. * AL Status event:
  1301. * 0:No change in AL Status
  1302. * 1:AL Status change
  1303. * (Bit is cleared by reading out AL Status
  1304. * 0x0130:0x0131 from ECAT)
  1305. */
  1306. #define ESC_ECAT_EVT_REQ_ALS_EVT_MASK (0x8U)
  1307. #define ESC_ECAT_EVT_REQ_ALS_EVT_SHIFT (3U)
  1308. #define ESC_ECAT_EVT_REQ_ALS_EVT_GET(x) (((uint16_t)(x) & ESC_ECAT_EVT_REQ_ALS_EVT_MASK) >> ESC_ECAT_EVT_REQ_ALS_EVT_SHIFT)
  1309. /*
  1310. * DLS_EVT (RO)
  1311. *
  1312. * DL Status event:
  1313. * 0:No change in DL Status
  1314. * 1:DL Status change
  1315. * (Bit is cleared by reading out DL Status
  1316. * 0x0110:0x0111 from ECAT)
  1317. */
  1318. #define ESC_ECAT_EVT_REQ_DLS_EVT_MASK (0x4U)
  1319. #define ESC_ECAT_EVT_REQ_DLS_EVT_SHIFT (2U)
  1320. #define ESC_ECAT_EVT_REQ_DLS_EVT_GET(x) (((uint16_t)(x) & ESC_ECAT_EVT_REQ_DLS_EVT_MASK) >> ESC_ECAT_EVT_REQ_DLS_EVT_SHIFT)
  1321. /*
  1322. * DCL_EVT (RO)
  1323. *
  1324. * DC Latch event:
  1325. * 0:No change on DC Latch Inputs
  1326. * 1:At least one change on DC Latch Inputs
  1327. * (Bit is cleared by reading DC Latch event
  1328. * times from ECAT for ECAT-controlled Latch
  1329. * Units, so that Latch 0/1 Status
  1330. * 0x09AE:0x09AF indicates no event)
  1331. */
  1332. #define ESC_ECAT_EVT_REQ_DCL_EVT_MASK (0x1U)
  1333. #define ESC_ECAT_EVT_REQ_DCL_EVT_SHIFT (0U)
  1334. #define ESC_ECAT_EVT_REQ_DCL_EVT_GET(x) (((uint16_t)(x) & ESC_ECAT_EVT_REQ_DCL_EVT_MASK) >> ESC_ECAT_EVT_REQ_DCL_EVT_SHIFT)
  1335. /* Bitfield definition for register: AL_EVT_REQ */
  1336. /*
  1337. * SM_INT (RO)
  1338. *
  1339. * SyncManager interrupts (SyncManager
  1340. * register offset 0x5, bit [0] or [1]):
  1341. * 0:No SyncManager 0 interrupt
  1342. * 1:SyncManager 0 interrupt pending
  1343. * 0:No SyncManager 1 interrupt
  1344. * 1:SyncManager 1 interrupt pending
  1345. * …
  1346. * 0:No SyncManager 15 interrupt
  1347. * 1:SyncManager 15 interrupt pending
  1348. */
  1349. #define ESC_AL_EVT_REQ_SM_INT_MASK (0xFFFF00UL)
  1350. #define ESC_AL_EVT_REQ_SM_INT_SHIFT (8U)
  1351. #define ESC_AL_EVT_REQ_SM_INT_GET(x) (((uint32_t)(x) & ESC_AL_EVT_REQ_SM_INT_MASK) >> ESC_AL_EVT_REQ_SM_INT_SHIFT)
  1352. /*
  1353. * WDG_PD (RO)
  1354. *
  1355. * Watchdog Process Data:
  1356. * 0:Has not expired
  1357. * 1:Has expired
  1358. * (Bit is cleared by reading Watchdog Status
  1359. * Process Data 0x0440 from PDI)
  1360. */
  1361. #define ESC_AL_EVT_REQ_WDG_PD_MASK (0x40U)
  1362. #define ESC_AL_EVT_REQ_WDG_PD_SHIFT (6U)
  1363. #define ESC_AL_EVT_REQ_WDG_PD_GET(x) (((uint32_t)(x) & ESC_AL_EVT_REQ_WDG_PD_MASK) >> ESC_AL_EVT_REQ_WDG_PD_SHIFT)
  1364. /*
  1365. * EE_EMU (RO)
  1366. *
  1367. * EEPROM Emulation:
  1368. * 0:No command pending
  1369. * 1:EEPROM command pending
  1370. * (Bit is cleared by acknowledging the
  1371. * command in EEPROM Control/Status
  1372. * register 0x0502:0x0503[10:8] from PDI)
  1373. */
  1374. #define ESC_AL_EVT_REQ_EE_EMU_MASK (0x20U)
  1375. #define ESC_AL_EVT_REQ_EE_EMU_SHIFT (5U)
  1376. #define ESC_AL_EVT_REQ_EE_EMU_GET(x) (((uint32_t)(x) & ESC_AL_EVT_REQ_EE_EMU_MASK) >> ESC_AL_EVT_REQ_EE_EMU_SHIFT)
  1377. /*
  1378. * SM_ACT (RO)
  1379. *
  1380. * SyncManager activation register
  1381. * (SyncManager register offset 0x6) changed:
  1382. * 0:No change in any SyncManager
  1383. * 1:At least one SyncManager changed
  1384. * (Bit is cleared by reading SyncManager
  1385. * Activation registers 0x0806 etc. from PDI)
  1386. */
  1387. #define ESC_AL_EVT_REQ_SM_ACT_MASK (0x10U)
  1388. #define ESC_AL_EVT_REQ_SM_ACT_SHIFT (4U)
  1389. #define ESC_AL_EVT_REQ_SM_ACT_GET(x) (((uint32_t)(x) & ESC_AL_EVT_REQ_SM_ACT_MASK) >> ESC_AL_EVT_REQ_SM_ACT_SHIFT)
  1390. /*
  1391. * ST_DC_SYNC1 (RO)
  1392. *
  1393. * State of DC SYNC1 (if register
  1394. * 0x0151[7]=1):
  1395. * (Bit is cleared by reading of SYNC1 status
  1396. * 0x098F from PDI, use only in Acknowledge
  1397. * mode)
  1398. */
  1399. #define ESC_AL_EVT_REQ_ST_DC_SYNC1_MASK (0x8U)
  1400. #define ESC_AL_EVT_REQ_ST_DC_SYNC1_SHIFT (3U)
  1401. #define ESC_AL_EVT_REQ_ST_DC_SYNC1_GET(x) (((uint32_t)(x) & ESC_AL_EVT_REQ_ST_DC_SYNC1_MASK) >> ESC_AL_EVT_REQ_ST_DC_SYNC1_SHIFT)
  1402. /*
  1403. * ST_DC_SYNC0 (RO)
  1404. *
  1405. * State of DC SYNC0 (if register
  1406. * 0x0151[3]=1):
  1407. * (Bit is cleared by reading SYNC0 status
  1408. * 0x098E from PDI, use only in Acknowledge
  1409. * mode)
  1410. */
  1411. #define ESC_AL_EVT_REQ_ST_DC_SYNC0_MASK (0x4U)
  1412. #define ESC_AL_EVT_REQ_ST_DC_SYNC0_SHIFT (2U)
  1413. #define ESC_AL_EVT_REQ_ST_DC_SYNC0_GET(x) (((uint32_t)(x) & ESC_AL_EVT_REQ_ST_DC_SYNC0_MASK) >> ESC_AL_EVT_REQ_ST_DC_SYNC0_SHIFT)
  1414. /*
  1415. * DCL_EVT (RO)
  1416. *
  1417. * DC Latch event:
  1418. * 0:No change on DC Latch Inputs
  1419. * 1:At least one change on DC Latch Inputs
  1420. * (Bit is cleared by reading DC Latch event
  1421. * times from PDI, so that Latch 0/1 Status
  1422. * 0x09AE:0x09AF indicates no event. Available
  1423. * if Latch Unit is PDI-controlled)
  1424. */
  1425. #define ESC_AL_EVT_REQ_DCL_EVT_MASK (0x2U)
  1426. #define ESC_AL_EVT_REQ_DCL_EVT_SHIFT (1U)
  1427. #define ESC_AL_EVT_REQ_DCL_EVT_GET(x) (((uint32_t)(x) & ESC_AL_EVT_REQ_DCL_EVT_MASK) >> ESC_AL_EVT_REQ_DCL_EVT_SHIFT)
  1428. /*
  1429. * ALC_EVT (RO)
  1430. *
  1431. * AL Control event:
  1432. * 0:No AL Control Register change
  1433. * 1:AL Control Register has been written3
  1434. * (Bit is cleared by reading AL Control register
  1435. * 0x0120:0x0121 from PDI)
  1436. */
  1437. #define ESC_AL_EVT_REQ_ALC_EVT_MASK (0x1U)
  1438. #define ESC_AL_EVT_REQ_ALC_EVT_SHIFT (0U)
  1439. #define ESC_AL_EVT_REQ_ALC_EVT_GET(x) (((uint32_t)(x) & ESC_AL_EVT_REQ_ALC_EVT_MASK) >> ESC_AL_EVT_REQ_ALC_EVT_SHIFT)
  1440. /* Bitfield definition for register array: RX_ERR_CNT */
  1441. /*
  1442. * RX_ERR (RO)
  1443. *
  1444. * RX Error counter of Port y (counting is
  1445. * stopped when 0xFF is reached).
  1446. */
  1447. #define ESC_RX_ERR_CNT_RX_ERR_MASK (0xFF00U)
  1448. #define ESC_RX_ERR_CNT_RX_ERR_SHIFT (8U)
  1449. #define ESC_RX_ERR_CNT_RX_ERR_GET(x) (((uint16_t)(x) & ESC_RX_ERR_CNT_RX_ERR_MASK) >> ESC_RX_ERR_CNT_RX_ERR_SHIFT)
  1450. /*
  1451. * IVD_FRM (RO)
  1452. *
  1453. * Invalid frame counter of Port y (counting is
  1454. * stopped when 0xFF is reached).
  1455. */
  1456. #define ESC_RX_ERR_CNT_IVD_FRM_MASK (0xFFU)
  1457. #define ESC_RX_ERR_CNT_IVD_FRM_SHIFT (0U)
  1458. #define ESC_RX_ERR_CNT_IVD_FRM_GET(x) (((uint16_t)(x) & ESC_RX_ERR_CNT_IVD_FRM_MASK) >> ESC_RX_ERR_CNT_IVD_FRM_SHIFT)
  1459. /* Bitfield definition for register array: FWD_RX_ERR_CNT */
  1460. /*
  1461. * ERR_CNT (RO)
  1462. *
  1463. * Forwarded error counter of Port y (counting is
  1464. * stopped when 0xFF is reached).
  1465. */
  1466. #define ESC_FWD_RX_ERR_CNT_ERR_CNT_MASK (0xFFU)
  1467. #define ESC_FWD_RX_ERR_CNT_ERR_CNT_SHIFT (0U)
  1468. #define ESC_FWD_RX_ERR_CNT_ERR_CNT_GET(x) (((uint8_t)(x) & ESC_FWD_RX_ERR_CNT_ERR_CNT_MASK) >> ESC_FWD_RX_ERR_CNT_ERR_CNT_SHIFT)
  1469. /* Bitfield definition for register: ECAT_PU_ERR_CNT */
  1470. /*
  1471. * CNT (RO)
  1472. *
  1473. * ECAT Processing Unit error counter
  1474. * (counting is stopped when 0xFF is reached).
  1475. * Counts errors of frames passing the
  1476. * Processing Unit.
  1477. */
  1478. #define ESC_ECAT_PU_ERR_CNT_CNT_MASK (0xFFU)
  1479. #define ESC_ECAT_PU_ERR_CNT_CNT_SHIFT (0U)
  1480. #define ESC_ECAT_PU_ERR_CNT_CNT_GET(x) (((uint8_t)(x) & ESC_ECAT_PU_ERR_CNT_CNT_MASK) >> ESC_ECAT_PU_ERR_CNT_CNT_SHIFT)
  1481. /* Bitfield definition for register: PDI_ERR_CNT */
  1482. /*
  1483. * CNT (RO)
  1484. *
  1485. * PDI Error counter (counting is stopped when
  1486. * 0xFF is reached). Counts if a PDI access has
  1487. * an interface error.
  1488. */
  1489. #define ESC_PDI_ERR_CNT_CNT_MASK (0xFFU)
  1490. #define ESC_PDI_ERR_CNT_CNT_SHIFT (0U)
  1491. #define ESC_PDI_ERR_CNT_CNT_GET(x) (((uint8_t)(x) & ESC_PDI_ERR_CNT_CNT_MASK) >> ESC_PDI_ERR_CNT_CNT_SHIFT)
  1492. /* Bitfield definition for register array: LOST_LINK_CNT */
  1493. /*
  1494. * CNT (RO)
  1495. *
  1496. * Lost Link counter of Port y (counting is
  1497. * stopped when 0xff is reached). Counts only if
  1498. * port is open and loop is Auto.
  1499. */
  1500. #define ESC_LOST_LINK_CNT_CNT_MASK (0xFFU)
  1501. #define ESC_LOST_LINK_CNT_CNT_SHIFT (0U)
  1502. #define ESC_LOST_LINK_CNT_CNT_GET(x) (((uint8_t)(x) & ESC_LOST_LINK_CNT_CNT_MASK) >> ESC_LOST_LINK_CNT_CNT_SHIFT)
  1503. /* Bitfield definition for register: WDG_DIV */
  1504. /*
  1505. * DIV (RO)
  1506. *
  1507. * Watchdog divider:Number of 25 MHz tics
  1508. * (minus 2) that represent the basic watchdog
  1509. * increment. (Default value is 100µs = 2498)
  1510. */
  1511. #define ESC_WDG_DIV_DIV_MASK (0xFFFFU)
  1512. #define ESC_WDG_DIV_DIV_SHIFT (0U)
  1513. #define ESC_WDG_DIV_DIV_GET(x) (((uint16_t)(x) & ESC_WDG_DIV_DIV_MASK) >> ESC_WDG_DIV_DIV_SHIFT)
  1514. /* Bitfield definition for register: WDG_TIME_PDI */
  1515. /*
  1516. * TIME (RO)
  1517. *
  1518. * Watchdog Time PDI:number of basic
  1519. * watchdog increments
  1520. * (Default value with Watchdog divider 100µs
  1521. * means 100ms Watchdog)
  1522. */
  1523. #define ESC_WDG_TIME_PDI_TIME_MASK (0xFFFFU)
  1524. #define ESC_WDG_TIME_PDI_TIME_SHIFT (0U)
  1525. #define ESC_WDG_TIME_PDI_TIME_GET(x) (((uint16_t)(x) & ESC_WDG_TIME_PDI_TIME_MASK) >> ESC_WDG_TIME_PDI_TIME_SHIFT)
  1526. /* Bitfield definition for register: WDG_TIME_PDAT */
  1527. /*
  1528. * TIME (RO)
  1529. *
  1530. * Watchdog Time Process Data:number of
  1531. * basic watchdog increments
  1532. * (Default value with Watchdog divider 100µs
  1533. * means 100ms Watchdog)
  1534. */
  1535. #define ESC_WDG_TIME_PDAT_TIME_MASK (0xFFFFU)
  1536. #define ESC_WDG_TIME_PDAT_TIME_SHIFT (0U)
  1537. #define ESC_WDG_TIME_PDAT_TIME_GET(x) (((uint16_t)(x) & ESC_WDG_TIME_PDAT_TIME_MASK) >> ESC_WDG_TIME_PDAT_TIME_SHIFT)
  1538. /* Bitfield definition for register: WDG_STAT_PDAT */
  1539. /*
  1540. * ST (RW)
  1541. *
  1542. * Watchdog Status of Process Data (triggered
  1543. * by SyncManagers)
  1544. * 0:Watchdog Process Data expired
  1545. * 1:Watchdog Process Data is active or
  1546. * disabled
  1547. */
  1548. #define ESC_WDG_STAT_PDAT_ST_MASK (0x1U)
  1549. #define ESC_WDG_STAT_PDAT_ST_SHIFT (0U)
  1550. #define ESC_WDG_STAT_PDAT_ST_SET(x) (((uint16_t)(x) << ESC_WDG_STAT_PDAT_ST_SHIFT) & ESC_WDG_STAT_PDAT_ST_MASK)
  1551. #define ESC_WDG_STAT_PDAT_ST_GET(x) (((uint16_t)(x) & ESC_WDG_STAT_PDAT_ST_MASK) >> ESC_WDG_STAT_PDAT_ST_SHIFT)
  1552. /* Bitfield definition for register: WDG_CNT_PDAT */
  1553. /*
  1554. * CNT (RO)
  1555. *
  1556. * Watchdog Counter Process Data (counting is
  1557. * stopped when 0xFF is reached). Counts if
  1558. * Process Data Watchdog expires.
  1559. */
  1560. #define ESC_WDG_CNT_PDAT_CNT_MASK (0xFFU)
  1561. #define ESC_WDG_CNT_PDAT_CNT_SHIFT (0U)
  1562. #define ESC_WDG_CNT_PDAT_CNT_GET(x) (((uint8_t)(x) & ESC_WDG_CNT_PDAT_CNT_MASK) >> ESC_WDG_CNT_PDAT_CNT_SHIFT)
  1563. /* Bitfield definition for register: WDG_CNT_PDI */
  1564. /*
  1565. * CNT (RO)
  1566. *
  1567. * Watchdog PDI counter (counting is stopped
  1568. * when 0xFF is reached). Counts if PDI
  1569. * Watchdog expires.
  1570. */
  1571. #define ESC_WDG_CNT_PDI_CNT_MASK (0xFFU)
  1572. #define ESC_WDG_CNT_PDI_CNT_SHIFT (0U)
  1573. #define ESC_WDG_CNT_PDI_CNT_GET(x) (((uint8_t)(x) & ESC_WDG_CNT_PDI_CNT_MASK) >> ESC_WDG_CNT_PDI_CNT_SHIFT)
  1574. /* Bitfield definition for register: EEPROM_CFG */
  1575. /*
  1576. * FORCE_ECAT (RO)
  1577. *
  1578. * Force ECAT access:
  1579. * 0:Do not change Bit 0x0501[0]
  1580. * 1:Reset Bit 0x0501[0] to 0
  1581. */
  1582. #define ESC_EEPROM_CFG_FORCE_ECAT_MASK (0x2U)
  1583. #define ESC_EEPROM_CFG_FORCE_ECAT_SHIFT (1U)
  1584. #define ESC_EEPROM_CFG_FORCE_ECAT_GET(x) (((uint8_t)(x) & ESC_EEPROM_CFG_FORCE_ECAT_MASK) >> ESC_EEPROM_CFG_FORCE_ECAT_SHIFT)
  1585. /*
  1586. * PDI (RO)
  1587. *
  1588. * EEPROM control is offered to PDI:
  1589. * 0:no
  1590. * 1:yes (PDI has EEPROM control)
  1591. */
  1592. #define ESC_EEPROM_CFG_PDI_MASK (0x1U)
  1593. #define ESC_EEPROM_CFG_PDI_SHIFT (0U)
  1594. #define ESC_EEPROM_CFG_PDI_GET(x) (((uint8_t)(x) & ESC_EEPROM_CFG_PDI_MASK) >> ESC_EEPROM_CFG_PDI_SHIFT)
  1595. /* Bitfield definition for register: EEPROM_PDI_ACC_STAT */
  1596. /*
  1597. * ACCESS (RW)
  1598. *
  1599. * Access to EEPROM:
  1600. * 0:PDI releases EEPROM access
  1601. * 1:PDI takes EEPROM access (PDI has
  1602. * EEPROM control)
  1603. */
  1604. #define ESC_EEPROM_PDI_ACC_STAT_ACCESS_MASK (0x1U)
  1605. #define ESC_EEPROM_PDI_ACC_STAT_ACCESS_SHIFT (0U)
  1606. #define ESC_EEPROM_PDI_ACC_STAT_ACCESS_SET(x) (((uint8_t)(x) << ESC_EEPROM_PDI_ACC_STAT_ACCESS_SHIFT) & ESC_EEPROM_PDI_ACC_STAT_ACCESS_MASK)
  1607. #define ESC_EEPROM_PDI_ACC_STAT_ACCESS_GET(x) (((uint8_t)(x) & ESC_EEPROM_PDI_ACC_STAT_ACCESS_MASK) >> ESC_EEPROM_PDI_ACC_STAT_ACCESS_SHIFT)
  1608. /* Bitfield definition for register: EEPROM_CTRL_STAT */
  1609. /*
  1610. * BUSY (RO)
  1611. *
  1612. * Busy:
  1613. * 0:EEPROM Interface is idle
  1614. * 1:EEPROM Interface is busy
  1615. */
  1616. #define ESC_EEPROM_CTRL_STAT_BUSY_MASK (0x8000U)
  1617. #define ESC_EEPROM_CTRL_STAT_BUSY_SHIFT (15U)
  1618. #define ESC_EEPROM_CTRL_STAT_BUSY_GET(x) (((uint16_t)(x) & ESC_EEPROM_CTRL_STAT_BUSY_MASK) >> ESC_EEPROM_CTRL_STAT_BUSY_SHIFT)
  1619. /*
  1620. * ERR_WEN (RO)
  1621. *
  1622. * Error Write Enable*3
  1623. * :
  1624. * 0:No error
  1625. * 1:Write Command without Write enable
  1626. */
  1627. #define ESC_EEPROM_CTRL_STAT_ERR_WEN_MASK (0x4000U)
  1628. #define ESC_EEPROM_CTRL_STAT_ERR_WEN_SHIFT (14U)
  1629. #define ESC_EEPROM_CTRL_STAT_ERR_WEN_GET(x) (((uint16_t)(x) & ESC_EEPROM_CTRL_STAT_ERR_WEN_MASK) >> ESC_EEPROM_CTRL_STAT_ERR_WEN_SHIFT)
  1630. /*
  1631. * ERR_ACK_CMD (RW)
  1632. *
  1633. * Error Acknowledge/Command*3
  1634. * :
  1635. * 0:No error
  1636. * 1:Missing EEPROM acknowledge or invalid
  1637. * command
  1638. * EEPROM emulation only:PDI writes 1 if a temporary
  1639. * failure has occurred.
  1640. */
  1641. #define ESC_EEPROM_CTRL_STAT_ERR_ACK_CMD_MASK (0x2000U)
  1642. #define ESC_EEPROM_CTRL_STAT_ERR_ACK_CMD_SHIFT (13U)
  1643. #define ESC_EEPROM_CTRL_STAT_ERR_ACK_CMD_SET(x) (((uint16_t)(x) << ESC_EEPROM_CTRL_STAT_ERR_ACK_CMD_SHIFT) & ESC_EEPROM_CTRL_STAT_ERR_ACK_CMD_MASK)
  1644. #define ESC_EEPROM_CTRL_STAT_ERR_ACK_CMD_GET(x) (((uint16_t)(x) & ESC_EEPROM_CTRL_STAT_ERR_ACK_CMD_MASK) >> ESC_EEPROM_CTRL_STAT_ERR_ACK_CMD_SHIFT)
  1645. /*
  1646. * EE_LDS (RO)
  1647. *
  1648. * EEPROM loading status:
  1649. * 0:EEPROM loaded, device information ok
  1650. * 1:EEPROM not loaded, device information not
  1651. * available (EEPROM loading in progress or
  1652. * finished with a failure)
  1653. */
  1654. #define ESC_EEPROM_CTRL_STAT_EE_LDS_MASK (0x1000U)
  1655. #define ESC_EEPROM_CTRL_STAT_EE_LDS_SHIFT (12U)
  1656. #define ESC_EEPROM_CTRL_STAT_EE_LDS_GET(x) (((uint16_t)(x) & ESC_EEPROM_CTRL_STAT_EE_LDS_MASK) >> ESC_EEPROM_CTRL_STAT_EE_LDS_SHIFT)
  1657. /*
  1658. * CKSM_ERR (RW)
  1659. *
  1660. * Checksum Error in ESC Configuration Area:
  1661. * 0:Checksum ok
  1662. * 1:Checksum error
  1663. * EEPROM emulation for IP Core only:PDI writes 1 if a
  1664. * CRC failure has occurred for a reload command.
  1665. */
  1666. #define ESC_EEPROM_CTRL_STAT_CKSM_ERR_MASK (0x800U)
  1667. #define ESC_EEPROM_CTRL_STAT_CKSM_ERR_SHIFT (11U)
  1668. #define ESC_EEPROM_CTRL_STAT_CKSM_ERR_SET(x) (((uint16_t)(x) << ESC_EEPROM_CTRL_STAT_CKSM_ERR_SHIFT) & ESC_EEPROM_CTRL_STAT_CKSM_ERR_MASK)
  1669. #define ESC_EEPROM_CTRL_STAT_CKSM_ERR_GET(x) (((uint16_t)(x) & ESC_EEPROM_CTRL_STAT_CKSM_ERR_MASK) >> ESC_EEPROM_CTRL_STAT_CKSM_ERR_SHIFT)
  1670. /*
  1671. * CMD (RW)
  1672. *
  1673. * Command register*2:
  1674. * Write:Initiate command.
  1675. * Read:Currently executed command
  1676. * Commands:
  1677. * 000:No command/EEPROM idle (clear error bits)
  1678. * 001:Read
  1679. * 010:Write
  1680. * 100:Reload
  1681. * Others:Reserved/invalid commands (do not issue)
  1682. * EEPROM emulation only:after execution, PDI writes
  1683. * command value to indicate operation is ready.
  1684. */
  1685. #define ESC_EEPROM_CTRL_STAT_CMD_MASK (0x700U)
  1686. #define ESC_EEPROM_CTRL_STAT_CMD_SHIFT (8U)
  1687. #define ESC_EEPROM_CTRL_STAT_CMD_SET(x) (((uint16_t)(x) << ESC_EEPROM_CTRL_STAT_CMD_SHIFT) & ESC_EEPROM_CTRL_STAT_CMD_MASK)
  1688. #define ESC_EEPROM_CTRL_STAT_CMD_GET(x) (((uint16_t)(x) & ESC_EEPROM_CTRL_STAT_CMD_MASK) >> ESC_EEPROM_CTRL_STAT_CMD_SHIFT)
  1689. /*
  1690. * EE_ALGM (RO)
  1691. *
  1692. * Selected EEPROM Algorithm:
  1693. * 0:1 address byte (1Kbit – 16Kbit EEPROMs)
  1694. * 1:2 address bytes (32Kbit – 4 Mbit EEPROMs)
  1695. */
  1696. #define ESC_EEPROM_CTRL_STAT_EE_ALGM_MASK (0x80U)
  1697. #define ESC_EEPROM_CTRL_STAT_EE_ALGM_SHIFT (7U)
  1698. #define ESC_EEPROM_CTRL_STAT_EE_ALGM_GET(x) (((uint16_t)(x) & ESC_EEPROM_CTRL_STAT_EE_ALGM_MASK) >> ESC_EEPROM_CTRL_STAT_EE_ALGM_SHIFT)
  1699. /*
  1700. * NUM_RD_BYTE (RO)
  1701. *
  1702. * Supported number of EEPROM read bytes:
  1703. * 0:4 Bytes
  1704. * 1:8 Bytes
  1705. */
  1706. #define ESC_EEPROM_CTRL_STAT_NUM_RD_BYTE_MASK (0x40U)
  1707. #define ESC_EEPROM_CTRL_STAT_NUM_RD_BYTE_SHIFT (6U)
  1708. #define ESC_EEPROM_CTRL_STAT_NUM_RD_BYTE_GET(x) (((uint16_t)(x) & ESC_EEPROM_CTRL_STAT_NUM_RD_BYTE_MASK) >> ESC_EEPROM_CTRL_STAT_NUM_RD_BYTE_SHIFT)
  1709. /*
  1710. * EE_EMU (RO)
  1711. *
  1712. * EPROM emulation:
  1713. * 0:Normal operation (I²C interface used)
  1714. * 1:PDI emulates EEPROM (I²C not used)
  1715. */
  1716. #define ESC_EEPROM_CTRL_STAT_EE_EMU_MASK (0x20U)
  1717. #define ESC_EEPROM_CTRL_STAT_EE_EMU_SHIFT (5U)
  1718. #define ESC_EEPROM_CTRL_STAT_EE_EMU_GET(x) (((uint16_t)(x) & ESC_EEPROM_CTRL_STAT_EE_EMU_MASK) >> ESC_EEPROM_CTRL_STAT_EE_EMU_SHIFT)
  1719. /*
  1720. * ECAT_WEN (RO)
  1721. *
  1722. * ECAT write enable*2
  1723. * :
  1724. * 0:Write requests are disabled
  1725. * 1:Write requests are enabled
  1726. * This bit is always 1 if PDI has EEPROM control.
  1727. */
  1728. #define ESC_EEPROM_CTRL_STAT_ECAT_WEN_MASK (0x1U)
  1729. #define ESC_EEPROM_CTRL_STAT_ECAT_WEN_SHIFT (0U)
  1730. #define ESC_EEPROM_CTRL_STAT_ECAT_WEN_GET(x) (((uint16_t)(x) & ESC_EEPROM_CTRL_STAT_ECAT_WEN_MASK) >> ESC_EEPROM_CTRL_STAT_ECAT_WEN_SHIFT)
  1731. /* Bitfield definition for register: EEPROM_ADDR */
  1732. /*
  1733. * ADDR (RW)
  1734. *
  1735. * EEPROM Address
  1736. * 0:First word (= 16 bit)
  1737. * 1:Second word
  1738. * …
  1739. * Actually used EEPROM Address bits:
  1740. * 9-0: EEPROM size up to 16 Kbit
  1741. * 17-0: EEPROM size 32 Kbit – 4 Mbit
  1742. * 31-0: EEPROM Emulation
  1743. */
  1744. #define ESC_EEPROM_ADDR_ADDR_MASK (0xFFFFFFFFUL)
  1745. #define ESC_EEPROM_ADDR_ADDR_SHIFT (0U)
  1746. #define ESC_EEPROM_ADDR_ADDR_SET(x) (((uint32_t)(x) << ESC_EEPROM_ADDR_ADDR_SHIFT) & ESC_EEPROM_ADDR_ADDR_MASK)
  1747. #define ESC_EEPROM_ADDR_ADDR_GET(x) (((uint32_t)(x) & ESC_EEPROM_ADDR_ADDR_MASK) >> ESC_EEPROM_ADDR_ADDR_SHIFT)
  1748. /* Bitfield definition for register: EEPROM_DATA */
  1749. /*
  1750. * HI (RW)
  1751. *
  1752. * EEPROM Read data (data read from
  1753. * EEPROM, higher bytes)
  1754. */
  1755. #define ESC_EEPROM_DATA_HI_MASK (0xFFFFFFFFFFFF0000ULL)
  1756. #define ESC_EEPROM_DATA_HI_SHIFT (16U)
  1757. #define ESC_EEPROM_DATA_HI_SET(x) (((uint64_t)(x) << ESC_EEPROM_DATA_HI_SHIFT) & ESC_EEPROM_DATA_HI_MASK)
  1758. #define ESC_EEPROM_DATA_HI_GET(x) (((uint64_t)(x) & ESC_EEPROM_DATA_HI_MASK) >> ESC_EEPROM_DATA_HI_SHIFT)
  1759. /*
  1760. * LO (RW)
  1761. *
  1762. * EEPROM Write data (data to be written to
  1763. * EEPROM) or
  1764. * EEPROM Read data (data read from
  1765. * EEPROM, lower bytes)
  1766. */
  1767. #define ESC_EEPROM_DATA_LO_MASK (0xFFFFU)
  1768. #define ESC_EEPROM_DATA_LO_SHIFT (0U)
  1769. #define ESC_EEPROM_DATA_LO_SET(x) (((uint64_t)(x) << ESC_EEPROM_DATA_LO_SHIFT) & ESC_EEPROM_DATA_LO_MASK)
  1770. #define ESC_EEPROM_DATA_LO_GET(x) (((uint64_t)(x) & ESC_EEPROM_DATA_LO_MASK) >> ESC_EEPROM_DATA_LO_SHIFT)
  1771. /* Bitfield definition for register: MII_MNG_CS */
  1772. /*
  1773. * BUSY (RO)
  1774. *
  1775. * Busy:
  1776. * 0:MII Management Interface is idle
  1777. * 1:MII Management Interface is busy
  1778. */
  1779. #define ESC_MII_MNG_CS_BUSY_MASK (0x8000U)
  1780. #define ESC_MII_MNG_CS_BUSY_SHIFT (15U)
  1781. #define ESC_MII_MNG_CS_BUSY_GET(x) (((uint16_t)(x) & ESC_MII_MNG_CS_BUSY_MASK) >> ESC_MII_MNG_CS_BUSY_SHIFT)
  1782. /*
  1783. * CMD_ERR (RO)
  1784. *
  1785. * Command error:
  1786. * 0:Last Command was successful
  1787. * 1:Invalid command or write command
  1788. * without Write Enable
  1789. * Cleared by executing a valid command or by
  1790. * writing “00” to Command register bits [9:8].
  1791. */
  1792. #define ESC_MII_MNG_CS_CMD_ERR_MASK (0x4000U)
  1793. #define ESC_MII_MNG_CS_CMD_ERR_SHIFT (14U)
  1794. #define ESC_MII_MNG_CS_CMD_ERR_GET(x) (((uint16_t)(x) & ESC_MII_MNG_CS_CMD_ERR_MASK) >> ESC_MII_MNG_CS_CMD_ERR_SHIFT)
  1795. /*
  1796. * RD_ERR (RO)
  1797. *
  1798. * Read error:
  1799. * 0:No read error
  1800. * 1:Read error occurred (PHY or register
  1801. * not available)
  1802. * Cleared by writing to register 0x0511
  1803. */
  1804. #define ESC_MII_MNG_CS_RD_ERR_MASK (0x2000U)
  1805. #define ESC_MII_MNG_CS_RD_ERR_SHIFT (13U)
  1806. #define ESC_MII_MNG_CS_RD_ERR_GET(x) (((uint16_t)(x) & ESC_MII_MNG_CS_RD_ERR_MASK) >> ESC_MII_MNG_CS_RD_ERR_SHIFT)
  1807. /*
  1808. * CMD (RW)
  1809. *
  1810. * Command register*:
  1811. * Write:Initiate command.
  1812. * Read:Currently executed command
  1813. * 00:No command/MI idle (clear error bits)
  1814. * 01:Read
  1815. * 10:Write
  1816. * Others:Reserved/invalid command (do not
  1817. * issue)
  1818. */
  1819. #define ESC_MII_MNG_CS_CMD_MASK (0x300U)
  1820. #define ESC_MII_MNG_CS_CMD_SHIFT (8U)
  1821. #define ESC_MII_MNG_CS_CMD_SET(x) (((uint16_t)(x) << ESC_MII_MNG_CS_CMD_SHIFT) & ESC_MII_MNG_CS_CMD_MASK)
  1822. #define ESC_MII_MNG_CS_CMD_GET(x) (((uint16_t)(x) & ESC_MII_MNG_CS_CMD_MASK) >> ESC_MII_MNG_CS_CMD_SHIFT)
  1823. /*
  1824. * PHY_ADDR (RO)
  1825. *
  1826. * PHY address of port 0
  1827. * (this is equal to the PHY address offset, if the
  1828. * PHY addresses are consecutive)
  1829. * IP Core since V3.0.0/3.00c:
  1830. * Translation 0x0512[7]=0:
  1831. * Register 0x0510[7:3] shows PHY address of
  1832. * port 0
  1833. * Translation 0x0512[7]=1:
  1834. * Register 0x0510[7:3] shows the PHY address
  1835. * which will be used for port 0-3 as requested
  1836. * by 0x0512[4:0] (valid values 0-3)
  1837. */
  1838. #define ESC_MII_MNG_CS_PHY_ADDR_MASK (0xF8U)
  1839. #define ESC_MII_MNG_CS_PHY_ADDR_SHIFT (3U)
  1840. #define ESC_MII_MNG_CS_PHY_ADDR_GET(x) (((uint16_t)(x) & ESC_MII_MNG_CS_PHY_ADDR_MASK) >> ESC_MII_MNG_CS_PHY_ADDR_SHIFT)
  1841. /*
  1842. * LINK_DC (RO)
  1843. *
  1844. * MI link detection and configuration:
  1845. * 0:Disabled for all ports
  1846. * 1:Enabled for at least one MII port, refer
  1847. * to PHY Port Status (0x0518 ff.) for
  1848. * details
  1849. */
  1850. #define ESC_MII_MNG_CS_LINK_DC_MASK (0x4U)
  1851. #define ESC_MII_MNG_CS_LINK_DC_SHIFT (2U)
  1852. #define ESC_MII_MNG_CS_LINK_DC_GET(x) (((uint16_t)(x) & ESC_MII_MNG_CS_LINK_DC_MASK) >> ESC_MII_MNG_CS_LINK_DC_SHIFT)
  1853. /*
  1854. * PDI (RO)
  1855. *
  1856. * Management Interface can be controlled by
  1857. * PDI (registers 0x0516-0x0517):
  1858. * 0:Only ECAT control
  1859. * 1:PDI control possible
  1860. */
  1861. #define ESC_MII_MNG_CS_PDI_MASK (0x2U)
  1862. #define ESC_MII_MNG_CS_PDI_SHIFT (1U)
  1863. #define ESC_MII_MNG_CS_PDI_GET(x) (((uint16_t)(x) & ESC_MII_MNG_CS_PDI_MASK) >> ESC_MII_MNG_CS_PDI_SHIFT)
  1864. /*
  1865. * WEN (RO)
  1866. *
  1867. * Write enable*:
  1868. * 0:Write disabled
  1869. * 1:Write enabled
  1870. * This bit is always 1 if PDI has MI control.
  1871. * ET1100-0000/-0001 exception:
  1872. * Bit is not always 1 if PDI has MI control, and
  1873. * bit is writable by PDI.
  1874. */
  1875. #define ESC_MII_MNG_CS_WEN_MASK (0x1U)
  1876. #define ESC_MII_MNG_CS_WEN_SHIFT (0U)
  1877. #define ESC_MII_MNG_CS_WEN_GET(x) (((uint16_t)(x) & ESC_MII_MNG_CS_WEN_MASK) >> ESC_MII_MNG_CS_WEN_SHIFT)
  1878. /* Bitfield definition for register: PHY_ADDR */
  1879. /*
  1880. * SHOW (RW)
  1881. *
  1882. * Target PHY Address translation:
  1883. * 0:Enabled
  1884. * 1:Disabled
  1885. * Refer to 0x0512[4:0] and 0x0510[7:3] for
  1886. * details.
  1887. */
  1888. #define ESC_PHY_ADDR_SHOW_MASK (0x80U)
  1889. #define ESC_PHY_ADDR_SHOW_SHIFT (7U)
  1890. #define ESC_PHY_ADDR_SHOW_SET(x) (((uint8_t)(x) << ESC_PHY_ADDR_SHOW_SHIFT) & ESC_PHY_ADDR_SHOW_MASK)
  1891. #define ESC_PHY_ADDR_SHOW_GET(x) (((uint8_t)(x) & ESC_PHY_ADDR_SHOW_MASK) >> ESC_PHY_ADDR_SHOW_SHIFT)
  1892. /*
  1893. * ADDR (RW)
  1894. *
  1895. * Target PHY Address
  1896. * Translation 0x0512[7]=0:
  1897. * 0-3:Target PHY Addresses 0-3 are used
  1898. * to access the PHYs at port 0-3, when
  1899. * the PHY addresses are properly
  1900. * configured
  1901. * 4-31:The configured PHY address of port 0
  1902. * (PHY address offset) is added to the
  1903. * Target PHY Address values 4-31
  1904. * when accessing a PHY
  1905. * Translation 0x0512[7]=1:
  1906. * 0-31:Target PHY Addresses is used when
  1907. * accessing a PHY without translation
  1908. */
  1909. #define ESC_PHY_ADDR_ADDR_MASK (0x1FU)
  1910. #define ESC_PHY_ADDR_ADDR_SHIFT (0U)
  1911. #define ESC_PHY_ADDR_ADDR_SET(x) (((uint8_t)(x) << ESC_PHY_ADDR_ADDR_SHIFT) & ESC_PHY_ADDR_ADDR_MASK)
  1912. #define ESC_PHY_ADDR_ADDR_GET(x) (((uint8_t)(x) & ESC_PHY_ADDR_ADDR_MASK) >> ESC_PHY_ADDR_ADDR_SHIFT)
  1913. /* Bitfield definition for register: PHY_REG_ADDR */
  1914. /*
  1915. * ADDR (RW)
  1916. *
  1917. * Address of PHY Register that shall be
  1918. * read/written
  1919. */
  1920. #define ESC_PHY_REG_ADDR_ADDR_MASK (0x1FU)
  1921. #define ESC_PHY_REG_ADDR_ADDR_SHIFT (0U)
  1922. #define ESC_PHY_REG_ADDR_ADDR_SET(x) (((uint8_t)(x) << ESC_PHY_REG_ADDR_ADDR_SHIFT) & ESC_PHY_REG_ADDR_ADDR_MASK)
  1923. #define ESC_PHY_REG_ADDR_ADDR_GET(x) (((uint8_t)(x) & ESC_PHY_REG_ADDR_ADDR_MASK) >> ESC_PHY_REG_ADDR_ADDR_SHIFT)
  1924. /* Bitfield definition for register: PHY_DATA */
  1925. /*
  1926. * DATA (RW)
  1927. *
  1928. * PHY Read/Write Data
  1929. */
  1930. #define ESC_PHY_DATA_DATA_MASK (0xFFFFU)
  1931. #define ESC_PHY_DATA_DATA_SHIFT (0U)
  1932. #define ESC_PHY_DATA_DATA_SET(x) (((uint16_t)(x) << ESC_PHY_DATA_DATA_SHIFT) & ESC_PHY_DATA_DATA_MASK)
  1933. #define ESC_PHY_DATA_DATA_GET(x) (((uint16_t)(x) & ESC_PHY_DATA_DATA_MASK) >> ESC_PHY_DATA_DATA_SHIFT)
  1934. /* Bitfield definition for register: MIIM_ECAT_ACC_STAT */
  1935. /*
  1936. * ACC (RO)
  1937. *
  1938. * Access to MII management:
  1939. * 0:ECAT enables PDI takeover of MII
  1940. * management interface
  1941. * 1:ECAT claims exclusive access to MII
  1942. * management interface
  1943. */
  1944. #define ESC_MIIM_ECAT_ACC_STAT_ACC_MASK (0x1U)
  1945. #define ESC_MIIM_ECAT_ACC_STAT_ACC_SHIFT (0U)
  1946. #define ESC_MIIM_ECAT_ACC_STAT_ACC_GET(x) (((uint8_t)(x) & ESC_MIIM_ECAT_ACC_STAT_ACC_MASK) >> ESC_MIIM_ECAT_ACC_STAT_ACC_SHIFT)
  1947. /* Bitfield definition for register: MIIM_PDI_ACC_STAT */
  1948. /*
  1949. * FORCE (RO)
  1950. *
  1951. * Force PDI Access State:
  1952. * 0:Do not change Bit 0x0517[0]
  1953. * 1:Reset Bit 0x0517[0] to 0
  1954. */
  1955. #define ESC_MIIM_PDI_ACC_STAT_FORCE_MASK (0x2U)
  1956. #define ESC_MIIM_PDI_ACC_STAT_FORCE_SHIFT (1U)
  1957. #define ESC_MIIM_PDI_ACC_STAT_FORCE_GET(x) (((uint8_t)(x) & ESC_MIIM_PDI_ACC_STAT_FORCE_MASK) >> ESC_MIIM_PDI_ACC_STAT_FORCE_SHIFT)
  1958. /*
  1959. * ACC (RW)
  1960. *
  1961. * Access to MII management:
  1962. * 0:ECAT has access to MII management
  1963. * 1:PDI has access to MII management
  1964. */
  1965. #define ESC_MIIM_PDI_ACC_STAT_ACC_MASK (0x1U)
  1966. #define ESC_MIIM_PDI_ACC_STAT_ACC_SHIFT (0U)
  1967. #define ESC_MIIM_PDI_ACC_STAT_ACC_SET(x) (((uint8_t)(x) << ESC_MIIM_PDI_ACC_STAT_ACC_SHIFT) & ESC_MIIM_PDI_ACC_STAT_ACC_MASK)
  1968. #define ESC_MIIM_PDI_ACC_STAT_ACC_GET(x) (((uint8_t)(x) & ESC_MIIM_PDI_ACC_STAT_ACC_MASK) >> ESC_MIIM_PDI_ACC_STAT_ACC_SHIFT)
  1969. /* Bitfield definition for register array: PHY_STAT */
  1970. /*
  1971. * PCU (RW)
  1972. *
  1973. * PHY configuration updated:
  1974. * 0:No update
  1975. * 1:PHY configuration was updated
  1976. * Cleared by writing any value to at least one
  1977. * of the PHY Port y Status registers.
  1978. */
  1979. #define ESC_PHY_STAT_PCU_MASK (0x20U)
  1980. #define ESC_PHY_STAT_PCU_SHIFT (5U)
  1981. #define ESC_PHY_STAT_PCU_SET(x) (((uint8_t)(x) << ESC_PHY_STAT_PCU_SHIFT) & ESC_PHY_STAT_PCU_MASK)
  1982. #define ESC_PHY_STAT_PCU_GET(x) (((uint8_t)(x) & ESC_PHY_STAT_PCU_MASK) >> ESC_PHY_STAT_PCU_SHIFT)
  1983. /*
  1984. * LPE (RO)
  1985. *
  1986. * Link partner error:
  1987. * 0:No error detected
  1988. * 1:Link partner error
  1989. */
  1990. #define ESC_PHY_STAT_LPE_MASK (0x10U)
  1991. #define ESC_PHY_STAT_LPE_SHIFT (4U)
  1992. #define ESC_PHY_STAT_LPE_GET(x) (((uint8_t)(x) & ESC_PHY_STAT_LPE_MASK) >> ESC_PHY_STAT_LPE_SHIFT)
  1993. /*
  1994. * RE (RW)
  1995. *
  1996. * Read error:
  1997. * 0:No read error occurred
  1998. * 1:A read error has occurred
  1999. * Cleared by writing any value to at least one
  2000. * of the PHY Port y Status registers.
  2001. */
  2002. #define ESC_PHY_STAT_RE_MASK (0x8U)
  2003. #define ESC_PHY_STAT_RE_SHIFT (3U)
  2004. #define ESC_PHY_STAT_RE_SET(x) (((uint8_t)(x) << ESC_PHY_STAT_RE_SHIFT) & ESC_PHY_STAT_RE_MASK)
  2005. #define ESC_PHY_STAT_RE_GET(x) (((uint8_t)(x) & ESC_PHY_STAT_RE_MASK) >> ESC_PHY_STAT_RE_SHIFT)
  2006. /*
  2007. * LSE (RO)
  2008. *
  2009. * Link status error:
  2010. * 0:No error
  2011. * 1:Link error, link inhibited
  2012. */
  2013. #define ESC_PHY_STAT_LSE_MASK (0x4U)
  2014. #define ESC_PHY_STAT_LSE_SHIFT (2U)
  2015. #define ESC_PHY_STAT_LSE_GET(x) (((uint8_t)(x) & ESC_PHY_STAT_LSE_MASK) >> ESC_PHY_STAT_LSE_SHIFT)
  2016. /*
  2017. * LS (RO)
  2018. *
  2019. * Link status (100 Mbit/s, Full Duplex, Auto
  2020. * negotiation):
  2021. * 0:No link
  2022. * 1:Link detected
  2023. */
  2024. #define ESC_PHY_STAT_LS_MASK (0x2U)
  2025. #define ESC_PHY_STAT_LS_SHIFT (1U)
  2026. #define ESC_PHY_STAT_LS_GET(x) (((uint8_t)(x) & ESC_PHY_STAT_LS_MASK) >> ESC_PHY_STAT_LS_SHIFT)
  2027. /*
  2028. * PLS (RO)
  2029. *
  2030. * Physical link status (PHY status register 1.2):
  2031. * 0:No physical link
  2032. * 1:Physical link detected
  2033. */
  2034. #define ESC_PHY_STAT_PLS_MASK (0x1U)
  2035. #define ESC_PHY_STAT_PLS_SHIFT (0U)
  2036. #define ESC_PHY_STAT_PLS_GET(x) (((uint8_t)(x) & ESC_PHY_STAT_PLS_MASK) >> ESC_PHY_STAT_PLS_SHIFT)
  2037. /* Bitfield definition for register of struct array FMMU: LOGIC_START_ADDR */
  2038. /*
  2039. * ADDR (RO)
  2040. *
  2041. * Logical start address within the EtherCAT
  2042. * Address Space.
  2043. */
  2044. #define ESC_FMMU_LOGIC_START_ADDR_ADDR_MASK (0xFFFFFFFFUL)
  2045. #define ESC_FMMU_LOGIC_START_ADDR_ADDR_SHIFT (0U)
  2046. #define ESC_FMMU_LOGIC_START_ADDR_ADDR_GET(x) (((uint32_t)(x) & ESC_FMMU_LOGIC_START_ADDR_ADDR_MASK) >> ESC_FMMU_LOGIC_START_ADDR_ADDR_SHIFT)
  2047. /* Bitfield definition for register of struct array FMMU: LENGTH */
  2048. /*
  2049. * OFFSET (RO)
  2050. *
  2051. * Offset from the first logical FMMU byte to the
  2052. * last FMMU byte + 1 (e.g., if two bytes are
  2053. * used, then this parameter shall contain 2)
  2054. */
  2055. #define ESC_FMMU_LENGTH_OFFSET_MASK (0xFFFFU)
  2056. #define ESC_FMMU_LENGTH_OFFSET_SHIFT (0U)
  2057. #define ESC_FMMU_LENGTH_OFFSET_GET(x) (((uint16_t)(x) & ESC_FMMU_LENGTH_OFFSET_MASK) >> ESC_FMMU_LENGTH_OFFSET_SHIFT)
  2058. /* Bitfield definition for register of struct array FMMU: LOGIC_START_BIT */
  2059. /*
  2060. * START (RO)
  2061. *
  2062. * Logical starting bit that shall be mapped (bits
  2063. * are counted from least significant bit 0 to
  2064. * most significant bit 7)
  2065. */
  2066. #define ESC_FMMU_LOGIC_START_BIT_START_MASK (0x7U)
  2067. #define ESC_FMMU_LOGIC_START_BIT_START_SHIFT (0U)
  2068. #define ESC_FMMU_LOGIC_START_BIT_START_GET(x) (((uint8_t)(x) & ESC_FMMU_LOGIC_START_BIT_START_MASK) >> ESC_FMMU_LOGIC_START_BIT_START_SHIFT)
  2069. /* Bitfield definition for register of struct array FMMU: LOGIC_STOP_BIT */
  2070. /*
  2071. * STOP (RO)
  2072. *
  2073. * Last logical bit that shall be mapped (bits are
  2074. * counted from least significant bit 0 to most
  2075. * significant bit 7)
  2076. */
  2077. #define ESC_FMMU_LOGIC_STOP_BIT_STOP_MASK (0x7U)
  2078. #define ESC_FMMU_LOGIC_STOP_BIT_STOP_SHIFT (0U)
  2079. #define ESC_FMMU_LOGIC_STOP_BIT_STOP_GET(x) (((uint8_t)(x) & ESC_FMMU_LOGIC_STOP_BIT_STOP_MASK) >> ESC_FMMU_LOGIC_STOP_BIT_STOP_SHIFT)
  2080. /* Bitfield definition for register of struct array FMMU: PHYSICAL_START_ADDR */
  2081. /*
  2082. * ADDR (RO)
  2083. *
  2084. * Physical Start Address (mapped to logical
  2085. * Start address)
  2086. */
  2087. #define ESC_FMMU_PHYSICAL_START_ADDR_ADDR_MASK (0xFFFFU)
  2088. #define ESC_FMMU_PHYSICAL_START_ADDR_ADDR_SHIFT (0U)
  2089. #define ESC_FMMU_PHYSICAL_START_ADDR_ADDR_GET(x) (((uint16_t)(x) & ESC_FMMU_PHYSICAL_START_ADDR_ADDR_MASK) >> ESC_FMMU_PHYSICAL_START_ADDR_ADDR_SHIFT)
  2090. /* Bitfield definition for register of struct array FMMU: PHYSICAL_START_BIT */
  2091. /*
  2092. * START (RO)
  2093. *
  2094. * Physical starting bit as target of logical start
  2095. * bit mapping (bits are counted from least
  2096. * significant bit 0 to most significant bit 7)
  2097. */
  2098. #define ESC_FMMU_PHYSICAL_START_BIT_START_MASK (0x7U)
  2099. #define ESC_FMMU_PHYSICAL_START_BIT_START_SHIFT (0U)
  2100. #define ESC_FMMU_PHYSICAL_START_BIT_START_GET(x) (((uint8_t)(x) & ESC_FMMU_PHYSICAL_START_BIT_START_MASK) >> ESC_FMMU_PHYSICAL_START_BIT_START_SHIFT)
  2101. /* Bitfield definition for register of struct array FMMU: TYPE */
  2102. /*
  2103. * MAP_WR (RO)
  2104. *
  2105. * 0:Ignore mapping for write accesses
  2106. * 1:Use mapping for write accesses
  2107. */
  2108. #define ESC_FMMU_TYPE_MAP_WR_MASK (0x2U)
  2109. #define ESC_FMMU_TYPE_MAP_WR_SHIFT (1U)
  2110. #define ESC_FMMU_TYPE_MAP_WR_GET(x) (((uint8_t)(x) & ESC_FMMU_TYPE_MAP_WR_MASK) >> ESC_FMMU_TYPE_MAP_WR_SHIFT)
  2111. /*
  2112. * MAP_RD (RO)
  2113. *
  2114. * 0:Ignore mapping for read accesses
  2115. * 1:Use mapping for read accesses
  2116. */
  2117. #define ESC_FMMU_TYPE_MAP_RD_MASK (0x1U)
  2118. #define ESC_FMMU_TYPE_MAP_RD_SHIFT (0U)
  2119. #define ESC_FMMU_TYPE_MAP_RD_GET(x) (((uint8_t)(x) & ESC_FMMU_TYPE_MAP_RD_MASK) >> ESC_FMMU_TYPE_MAP_RD_SHIFT)
  2120. /* Bitfield definition for register of struct array FMMU: ACTIVATE */
  2121. /*
  2122. * ACT (RO)
  2123. *
  2124. * 0:FMMU deactivated
  2125. * 1:FMMU activated. FMMU checks
  2126. * logically addressed blocks to be
  2127. * mapped according to configured
  2128. * mapping
  2129. */
  2130. #define ESC_FMMU_ACTIVATE_ACT_MASK (0x1U)
  2131. #define ESC_FMMU_ACTIVATE_ACT_SHIFT (0U)
  2132. #define ESC_FMMU_ACTIVATE_ACT_GET(x) (((uint8_t)(x) & ESC_FMMU_ACTIVATE_ACT_MASK) >> ESC_FMMU_ACTIVATE_ACT_SHIFT)
  2133. /* Bitfield definition for register of struct array SYNCM: PHYSICAL_START_ADDR */
  2134. /*
  2135. * ADDR (RO)
  2136. *
  2137. * First byte that will be handled by
  2138. * SyncManager
  2139. */
  2140. #define ESC_SYNCM_PHYSICAL_START_ADDR_ADDR_MASK (0xFFFFU)
  2141. #define ESC_SYNCM_PHYSICAL_START_ADDR_ADDR_SHIFT (0U)
  2142. #define ESC_SYNCM_PHYSICAL_START_ADDR_ADDR_GET(x) (((uint16_t)(x) & ESC_SYNCM_PHYSICAL_START_ADDR_ADDR_MASK) >> ESC_SYNCM_PHYSICAL_START_ADDR_ADDR_SHIFT)
  2143. /* Bitfield definition for register of struct array SYNCM: LENGTH */
  2144. /*
  2145. * LEN (RO)
  2146. *
  2147. * Number of bytes assigned to SyncManager
  2148. * (shall be greater than 1, otherwise
  2149. * SyncManager is not activated. If set to 1, only
  2150. * Watchdog Trigger is generated if configured)
  2151. */
  2152. #define ESC_SYNCM_LENGTH_LEN_MASK (0xFFFFU)
  2153. #define ESC_SYNCM_LENGTH_LEN_SHIFT (0U)
  2154. #define ESC_SYNCM_LENGTH_LEN_GET(x) (((uint16_t)(x) & ESC_SYNCM_LENGTH_LEN_MASK) >> ESC_SYNCM_LENGTH_LEN_SHIFT)
  2155. /* Bitfield definition for register of struct array SYNCM: CONTROL */
  2156. /*
  2157. * WDG_TRG_EN (RO)
  2158. *
  2159. * Watchdog Trigger Enable:
  2160. * 0:Disabled
  2161. * 1:Enabled
  2162. */
  2163. #define ESC_SYNCM_CONTROL_WDG_TRG_EN_MASK (0x40U)
  2164. #define ESC_SYNCM_CONTROL_WDG_TRG_EN_SHIFT (6U)
  2165. #define ESC_SYNCM_CONTROL_WDG_TRG_EN_GET(x) (((uint8_t)(x) & ESC_SYNCM_CONTROL_WDG_TRG_EN_MASK) >> ESC_SYNCM_CONTROL_WDG_TRG_EN_SHIFT)
  2166. /*
  2167. * INT_AL (RO)
  2168. *
  2169. * Interrupt in AL Event Request Register:
  2170. * 0:Disabled
  2171. * 1:Enabled
  2172. */
  2173. #define ESC_SYNCM_CONTROL_INT_AL_MASK (0x20U)
  2174. #define ESC_SYNCM_CONTROL_INT_AL_SHIFT (5U)
  2175. #define ESC_SYNCM_CONTROL_INT_AL_GET(x) (((uint8_t)(x) & ESC_SYNCM_CONTROL_INT_AL_MASK) >> ESC_SYNCM_CONTROL_INT_AL_SHIFT)
  2176. /*
  2177. * INT_ECAT (RO)
  2178. *
  2179. * Interrupt in ECAT Event Request Register:
  2180. * 0:Disabled
  2181. * 1:Enabled
  2182. */
  2183. #define ESC_SYNCM_CONTROL_INT_ECAT_MASK (0x10U)
  2184. #define ESC_SYNCM_CONTROL_INT_ECAT_SHIFT (4U)
  2185. #define ESC_SYNCM_CONTROL_INT_ECAT_GET(x) (((uint8_t)(x) & ESC_SYNCM_CONTROL_INT_ECAT_MASK) >> ESC_SYNCM_CONTROL_INT_ECAT_SHIFT)
  2186. /*
  2187. * DIR (RO)
  2188. *
  2189. * Direction:
  2190. * 00:Read:ECAT read access, PDI write
  2191. * access.
  2192. * 01:Write:ECAT write access, PDI read
  2193. * access.
  2194. * 10:Reserved
  2195. * 11:Reserved
  2196. */
  2197. #define ESC_SYNCM_CONTROL_DIR_MASK (0xCU)
  2198. #define ESC_SYNCM_CONTROL_DIR_SHIFT (2U)
  2199. #define ESC_SYNCM_CONTROL_DIR_GET(x) (((uint8_t)(x) & ESC_SYNCM_CONTROL_DIR_MASK) >> ESC_SYNCM_CONTROL_DIR_SHIFT)
  2200. /*
  2201. * OP_MODE (RO)
  2202. *
  2203. * Operation Mode:
  2204. * 00:Buffered (3 buffer mode)
  2205. * 01:Reserved
  2206. * 10:Mailbox (Single buffer mode)
  2207. * 11:Reserved
  2208. */
  2209. #define ESC_SYNCM_CONTROL_OP_MODE_MASK (0x3U)
  2210. #define ESC_SYNCM_CONTROL_OP_MODE_SHIFT (0U)
  2211. #define ESC_SYNCM_CONTROL_OP_MODE_GET(x) (((uint8_t)(x) & ESC_SYNCM_CONTROL_OP_MODE_MASK) >> ESC_SYNCM_CONTROL_OP_MODE_SHIFT)
  2212. /* Bitfield definition for register of struct array SYNCM: STATUS */
  2213. /*
  2214. * WB_INUSE (RO)
  2215. *
  2216. * Write buffer in use (opened)
  2217. */
  2218. #define ESC_SYNCM_STATUS_WB_INUSE_MASK (0x80U)
  2219. #define ESC_SYNCM_STATUS_WB_INUSE_SHIFT (7U)
  2220. #define ESC_SYNCM_STATUS_WB_INUSE_GET(x) (((uint8_t)(x) & ESC_SYNCM_STATUS_WB_INUSE_MASK) >> ESC_SYNCM_STATUS_WB_INUSE_SHIFT)
  2221. /*
  2222. * RB_INUSE (RO)
  2223. *
  2224. * Read buffer in use (opened)
  2225. */
  2226. #define ESC_SYNCM_STATUS_RB_INUSE_MASK (0x40U)
  2227. #define ESC_SYNCM_STATUS_RB_INUSE_SHIFT (6U)
  2228. #define ESC_SYNCM_STATUS_RB_INUSE_GET(x) (((uint8_t)(x) & ESC_SYNCM_STATUS_RB_INUSE_MASK) >> ESC_SYNCM_STATUS_RB_INUSE_SHIFT)
  2229. /*
  2230. * BUF_MODE (RO)
  2231. *
  2232. * Buffered mode:buffer status (last written
  2233. * buffer):
  2234. * 00:1
  2235. * st buffer
  2236. * 01:2
  2237. * nd buffer
  2238. * 10:3
  2239. * rd buffer
  2240. * 11:(no buffer written)
  2241. * Mailbox mode:reserved
  2242. */
  2243. #define ESC_SYNCM_STATUS_BUF_MODE_MASK (0x30U)
  2244. #define ESC_SYNCM_STATUS_BUF_MODE_SHIFT (4U)
  2245. #define ESC_SYNCM_STATUS_BUF_MODE_GET(x) (((uint8_t)(x) & ESC_SYNCM_STATUS_BUF_MODE_MASK) >> ESC_SYNCM_STATUS_BUF_MODE_SHIFT)
  2246. /*
  2247. * MBX_MODE (RO)
  2248. *
  2249. * Mailbox mode:mailbox status:
  2250. * 0:Mailbox empty
  2251. * 1:Mailbox full
  2252. * Buffered mode:reserved
  2253. */
  2254. #define ESC_SYNCM_STATUS_MBX_MODE_MASK (0x8U)
  2255. #define ESC_SYNCM_STATUS_MBX_MODE_SHIFT (3U)
  2256. #define ESC_SYNCM_STATUS_MBX_MODE_GET(x) (((uint8_t)(x) & ESC_SYNCM_STATUS_MBX_MODE_MASK) >> ESC_SYNCM_STATUS_MBX_MODE_SHIFT)
  2257. /*
  2258. * INT_RD (RO)
  2259. *
  2260. * Interrupt Read:
  2261. * 1:Interrupt after buffer was completely and
  2262. * successfully read
  2263. * 0:Interrupt cleared after first byte of buffer
  2264. * was written
  2265. * NOTE:This interrupt is signalled to the writing
  2266. * side if enabled in the SM Control register
  2267. */
  2268. #define ESC_SYNCM_STATUS_INT_RD_MASK (0x2U)
  2269. #define ESC_SYNCM_STATUS_INT_RD_SHIFT (1U)
  2270. #define ESC_SYNCM_STATUS_INT_RD_GET(x) (((uint8_t)(x) & ESC_SYNCM_STATUS_INT_RD_MASK) >> ESC_SYNCM_STATUS_INT_RD_SHIFT)
  2271. /*
  2272. * INT_WR (RO)
  2273. *
  2274. * Interrupt Write:
  2275. * 1:Interrupt after buffer was completely and
  2276. * successfully written
  2277. * 0:Interrupt cleared after first byte of buffer
  2278. * was read
  2279. * NOTE:This interrupt is signalled to the reading
  2280. * side if enabled in the SM Control register
  2281. */
  2282. #define ESC_SYNCM_STATUS_INT_WR_MASK (0x1U)
  2283. #define ESC_SYNCM_STATUS_INT_WR_SHIFT (0U)
  2284. #define ESC_SYNCM_STATUS_INT_WR_GET(x) (((uint8_t)(x) & ESC_SYNCM_STATUS_INT_WR_MASK) >> ESC_SYNCM_STATUS_INT_WR_SHIFT)
  2285. /* Bitfield definition for register of struct array SYNCM: ACTIVATE */
  2286. /*
  2287. * LATCH_PDI (RO)
  2288. *
  2289. * Latch Event PDI:
  2290. * 0:No
  2291. * 1:Generate Latch events when PDI issues
  2292. * a buffer exchange or when PDI
  2293. * accesses buffer start address
  2294. */
  2295. #define ESC_SYNCM_ACTIVATE_LATCH_PDI_MASK (0x80U)
  2296. #define ESC_SYNCM_ACTIVATE_LATCH_PDI_SHIFT (7U)
  2297. #define ESC_SYNCM_ACTIVATE_LATCH_PDI_GET(x) (((uint8_t)(x) & ESC_SYNCM_ACTIVATE_LATCH_PDI_MASK) >> ESC_SYNCM_ACTIVATE_LATCH_PDI_SHIFT)
  2298. /*
  2299. * LATCH_ECAT (RO)
  2300. *
  2301. * Latch Event ECAT:
  2302. * 0:No
  2303. * 1:Generate Latch event when EtherCAT
  2304. * master issues a buffer exchange
  2305. */
  2306. #define ESC_SYNCM_ACTIVATE_LATCH_ECAT_MASK (0x40U)
  2307. #define ESC_SYNCM_ACTIVATE_LATCH_ECAT_SHIFT (6U)
  2308. #define ESC_SYNCM_ACTIVATE_LATCH_ECAT_GET(x) (((uint8_t)(x) & ESC_SYNCM_ACTIVATE_LATCH_ECAT_MASK) >> ESC_SYNCM_ACTIVATE_LATCH_ECAT_SHIFT)
  2309. /*
  2310. * REPEAT (RO)
  2311. *
  2312. * Repeat Request:
  2313. * A toggle of Repeat Request means that a
  2314. * mailbox retry is needed (primarily used in
  2315. * conjunction with ECAT Read Mailbox)
  2316. */
  2317. #define ESC_SYNCM_ACTIVATE_REPEAT_MASK (0x2U)
  2318. #define ESC_SYNCM_ACTIVATE_REPEAT_SHIFT (1U)
  2319. #define ESC_SYNCM_ACTIVATE_REPEAT_GET(x) (((uint8_t)(x) & ESC_SYNCM_ACTIVATE_REPEAT_MASK) >> ESC_SYNCM_ACTIVATE_REPEAT_SHIFT)
  2320. /*
  2321. * EN (RW)
  2322. *
  2323. * SyncManager Enable/Disable:
  2324. * 0:Disable:Access to Memory without
  2325. * SyncManager control
  2326. * 1:Enable:SyncManager is active and
  2327. * controls Memory area set in
  2328. * configuration
  2329. */
  2330. #define ESC_SYNCM_ACTIVATE_EN_MASK (0x1U)
  2331. #define ESC_SYNCM_ACTIVATE_EN_SHIFT (0U)
  2332. #define ESC_SYNCM_ACTIVATE_EN_SET(x) (((uint8_t)(x) << ESC_SYNCM_ACTIVATE_EN_SHIFT) & ESC_SYNCM_ACTIVATE_EN_MASK)
  2333. #define ESC_SYNCM_ACTIVATE_EN_GET(x) (((uint8_t)(x) & ESC_SYNCM_ACTIVATE_EN_MASK) >> ESC_SYNCM_ACTIVATE_EN_SHIFT)
  2334. /* Bitfield definition for register of struct array SYNCM: PDI_CTRL */
  2335. /*
  2336. * REPEAT_ACK (RW)
  2337. *
  2338. * Repeat Ack:
  2339. * If this is set to the same value as that set by
  2340. * Repeat Request, the PDI acknowledges the
  2341. * execution of a previous set Repeat request.
  2342. */
  2343. #define ESC_SYNCM_PDI_CTRL_REPEAT_ACK_MASK (0x2U)
  2344. #define ESC_SYNCM_PDI_CTRL_REPEAT_ACK_SHIFT (1U)
  2345. #define ESC_SYNCM_PDI_CTRL_REPEAT_ACK_SET(x) (((uint8_t)(x) << ESC_SYNCM_PDI_CTRL_REPEAT_ACK_SHIFT) & ESC_SYNCM_PDI_CTRL_REPEAT_ACK_MASK)
  2346. #define ESC_SYNCM_PDI_CTRL_REPEAT_ACK_GET(x) (((uint8_t)(x) & ESC_SYNCM_PDI_CTRL_REPEAT_ACK_MASK) >> ESC_SYNCM_PDI_CTRL_REPEAT_ACK_SHIFT)
  2347. /*
  2348. * DEACT (RW)
  2349. *
  2350. * Deactivate SyncManager:
  2351. * Read:
  2352. * 0:Normal operation, SyncManager
  2353. * activated.
  2354. * 1:SyncManager deactivated and reset.
  2355. * SyncManager locks access to Memory
  2356. * area.
  2357. * Write:
  2358. * 0:Activate SyncManager
  2359. * 1:Request SyncManager deactivation
  2360. * NOTE:Writing 1 is delayed until the end of the
  2361. * frame, which is currently processed.
  2362. */
  2363. #define ESC_SYNCM_PDI_CTRL_DEACT_MASK (0x1U)
  2364. #define ESC_SYNCM_PDI_CTRL_DEACT_SHIFT (0U)
  2365. #define ESC_SYNCM_PDI_CTRL_DEACT_SET(x) (((uint8_t)(x) << ESC_SYNCM_PDI_CTRL_DEACT_SHIFT) & ESC_SYNCM_PDI_CTRL_DEACT_MASK)
  2366. #define ESC_SYNCM_PDI_CTRL_DEACT_GET(x) (((uint8_t)(x) & ESC_SYNCM_PDI_CTRL_DEACT_MASK) >> ESC_SYNCM_PDI_CTRL_DEACT_SHIFT)
  2367. /* Bitfield definition for register array: RCV_TIME */
  2368. /*
  2369. * LT (RO)
  2370. *
  2371. * Local time at the beginning of the last receive
  2372. * frame containing a write access to register
  2373. * 0x0900.
  2374. */
  2375. #define ESC_RCV_TIME_LT_MASK (0xFFFFFF00UL)
  2376. #define ESC_RCV_TIME_LT_SHIFT (8U)
  2377. #define ESC_RCV_TIME_LT_GET(x) (((uint32_t)(x) & ESC_RCV_TIME_LT_MASK) >> ESC_RCV_TIME_LT_SHIFT)
  2378. /*
  2379. * REQ (RO)
  2380. *
  2381. * Write:
  2382. * A write access to register 0x0900 with
  2383. * BWR or FPWR latches the local time at
  2384. * the beginning of the receive frame (start
  2385. * first bit of preamble) at each port.
  2386. * Write (ESC20, ET1200 exception):
  2387. * A write access latches the local time at
  2388. * the beginning of the receive frame at
  2389. * port 0. It enables the time stamping at
  2390. * the other ports.
  2391. * Read:
  2392. * Local time at the beginning of the last
  2393. * receive frame containing a write access
  2394. * to this register.
  2395. * NOTE:FPWR requires an address match for
  2396. * accessing this register like any FPWR command.
  2397. * All write commands with address match will
  2398. * increment the working counter (e.g., APWR), but
  2399. * they will not trigger receive time latching.
  2400. */
  2401. #define ESC_RCV_TIME_REQ_MASK (0xFFU)
  2402. #define ESC_RCV_TIME_REQ_SHIFT (0U)
  2403. #define ESC_RCV_TIME_REQ_GET(x) (((uint32_t)(x) & ESC_RCV_TIME_REQ_MASK) >> ESC_RCV_TIME_REQ_SHIFT)
  2404. /* Bitfield definition for register: SYS_TIME */
  2405. /*
  2406. * ST (RW)
  2407. *
  2408. */
  2409. #define ESC_SYS_TIME_ST_MASK (0xFFFFFFFFFFFFFFFFULL)
  2410. #define ESC_SYS_TIME_ST_SHIFT (0U)
  2411. #define ESC_SYS_TIME_ST_SET(x) (((uint64_t)(x) << ESC_SYS_TIME_ST_SHIFT) & ESC_SYS_TIME_ST_MASK)
  2412. #define ESC_SYS_TIME_ST_GET(x) (((uint64_t)(x) & ESC_SYS_TIME_ST_MASK) >> ESC_SYS_TIME_ST_SHIFT)
  2413. /* Bitfield definition for register: RCVT_ECAT_PU */
  2414. /*
  2415. * LT (RO)
  2416. *
  2417. * Local time at the beginning of a frame (start
  2418. * first bit of preamble) received at the ECAT
  2419. * Processing Unit containing a write access to
  2420. * register 0x0900
  2421. * NOTE:E.g., if port 0 is open, this register reflects
  2422. * the Receive Time Port 0 as a 64 Bit value.
  2423. * Any valid EtherCAT write access to register
  2424. * 0x0900 triggers latching, not only BWR/FPWR
  2425. * commands as with register 0x0900.
  2426. */
  2427. #define ESC_RCVT_ECAT_PU_LT_MASK (0xFFFFFFFFFFFFFFFFULL)
  2428. #define ESC_RCVT_ECAT_PU_LT_SHIFT (0U)
  2429. #define ESC_RCVT_ECAT_PU_LT_GET(x) (((uint64_t)(x) & ESC_RCVT_ECAT_PU_LT_MASK) >> ESC_RCVT_ECAT_PU_LT_SHIFT)
  2430. /* Bitfield definition for register: SYS_TIME_OFFSET */
  2431. /*
  2432. * OFFSET (RW)
  2433. *
  2434. * Difference between local time and System
  2435. * Time. Offset is added to the local time.
  2436. */
  2437. #define ESC_SYS_TIME_OFFSET_OFFSET_MASK (0xFFFFFFFFFFFFFFFFULL)
  2438. #define ESC_SYS_TIME_OFFSET_OFFSET_SHIFT (0U)
  2439. #define ESC_SYS_TIME_OFFSET_OFFSET_SET(x) (((uint64_t)(x) << ESC_SYS_TIME_OFFSET_OFFSET_SHIFT) & ESC_SYS_TIME_OFFSET_OFFSET_MASK)
  2440. #define ESC_SYS_TIME_OFFSET_OFFSET_GET(x) (((uint64_t)(x) & ESC_SYS_TIME_OFFSET_OFFSET_MASK) >> ESC_SYS_TIME_OFFSET_OFFSET_SHIFT)
  2441. /* Bitfield definition for register: SYS_TIME_DELAY */
  2442. /*
  2443. * DLY (RW)
  2444. *
  2445. * Delay between Reference Clock and the
  2446. * ESC
  2447. */
  2448. #define ESC_SYS_TIME_DELAY_DLY_MASK (0xFFFFFFFFUL)
  2449. #define ESC_SYS_TIME_DELAY_DLY_SHIFT (0U)
  2450. #define ESC_SYS_TIME_DELAY_DLY_SET(x) (((uint32_t)(x) << ESC_SYS_TIME_DELAY_DLY_SHIFT) & ESC_SYS_TIME_DELAY_DLY_MASK)
  2451. #define ESC_SYS_TIME_DELAY_DLY_GET(x) (((uint32_t)(x) & ESC_SYS_TIME_DELAY_DLY_MASK) >> ESC_SYS_TIME_DELAY_DLY_SHIFT)
  2452. /* Bitfield definition for register: SYS_TIME_DIFF */
  2453. /*
  2454. * DIFF (RO)
  2455. *
  2456. * 0:Local copy of System Time less than
  2457. * received System Time
  2458. * 1:Local copy of System Time greater than
  2459. * or equal to received System Time
  2460. */
  2461. #define ESC_SYS_TIME_DIFF_DIFF_MASK (0x80000000UL)
  2462. #define ESC_SYS_TIME_DIFF_DIFF_SHIFT (31U)
  2463. #define ESC_SYS_TIME_DIFF_DIFF_GET(x) (((uint32_t)(x) & ESC_SYS_TIME_DIFF_DIFF_MASK) >> ESC_SYS_TIME_DIFF_DIFF_SHIFT)
  2464. /*
  2465. * NUM (RO)
  2466. *
  2467. * Mean difference between local copy of
  2468. * System Time and received System Time
  2469. * values
  2470. * Difference = Received System Time –
  2471. * local copy of System Time
  2472. */
  2473. #define ESC_SYS_TIME_DIFF_NUM_MASK (0x7FFFFFFFUL)
  2474. #define ESC_SYS_TIME_DIFF_NUM_SHIFT (0U)
  2475. #define ESC_SYS_TIME_DIFF_NUM_GET(x) (((uint32_t)(x) & ESC_SYS_TIME_DIFF_NUM_MASK) >> ESC_SYS_TIME_DIFF_NUM_SHIFT)
  2476. /* Bitfield definition for register: SPD_CNT_START */
  2477. /*
  2478. * BW (RW)
  2479. *
  2480. * Bandwidth for adjustment of local copy of
  2481. * System Time (larger values → smaller
  2482. * bandwidth and smoother adjustment)
  2483. * A write access resets System Time
  2484. * Difference (0x092C:0x092F) and Speed
  2485. * Counter Diff (0x0932:0x0933).
  2486. * Valid values:0x0080 to 0x3FFF
  2487. */
  2488. #define ESC_SPD_CNT_START_BW_MASK (0x7FFFU)
  2489. #define ESC_SPD_CNT_START_BW_SHIFT (0U)
  2490. #define ESC_SPD_CNT_START_BW_SET(x) (((uint16_t)(x) << ESC_SPD_CNT_START_BW_SHIFT) & ESC_SPD_CNT_START_BW_MASK)
  2491. #define ESC_SPD_CNT_START_BW_GET(x) (((uint16_t)(x) & ESC_SPD_CNT_START_BW_MASK) >> ESC_SPD_CNT_START_BW_SHIFT)
  2492. /* Bitfield definition for register: SPD_CNT_DIFF */
  2493. /*
  2494. * DIFF (RO)
  2495. *
  2496. * Representation of the deviation between
  2497. * local clock period and Reference Clock's
  2498. * clock period (representation:two's
  2499. * complement)
  2500. * Range:±(Speed Counter Start – 0x7F)
  2501. */
  2502. #define ESC_SPD_CNT_DIFF_DIFF_MASK (0xFFFFU)
  2503. #define ESC_SPD_CNT_DIFF_DIFF_SHIFT (0U)
  2504. #define ESC_SPD_CNT_DIFF_DIFF_GET(x) (((uint16_t)(x) & ESC_SPD_CNT_DIFF_DIFF_MASK) >> ESC_SPD_CNT_DIFF_DIFF_SHIFT)
  2505. /* Bitfield definition for register: SYS_TIME_DIFF_FD */
  2506. /*
  2507. * DEPTH (RW)
  2508. *
  2509. * Filter depth for averaging the received
  2510. * System Time deviation
  2511. * IP Core since V2.2.0/V2.02a:
  2512. * A write access resets System Time
  2513. * Difference (0x092C:0x092F)
  2514. */
  2515. #define ESC_SYS_TIME_DIFF_FD_DEPTH_MASK (0xFU)
  2516. #define ESC_SYS_TIME_DIFF_FD_DEPTH_SHIFT (0U)
  2517. #define ESC_SYS_TIME_DIFF_FD_DEPTH_SET(x) (((uint8_t)(x) << ESC_SYS_TIME_DIFF_FD_DEPTH_SHIFT) & ESC_SYS_TIME_DIFF_FD_DEPTH_MASK)
  2518. #define ESC_SYS_TIME_DIFF_FD_DEPTH_GET(x) (((uint8_t)(x) & ESC_SYS_TIME_DIFF_FD_DEPTH_MASK) >> ESC_SYS_TIME_DIFF_FD_DEPTH_SHIFT)
  2519. /* Bitfield definition for register: SPD_CNT_FD */
  2520. /*
  2521. * DEPTH (RW)
  2522. *
  2523. * Filter depth for averaging the clock period
  2524. * deviation
  2525. * IP Core since V2.2.0/V2.02a:
  2526. * A write access resets the internal speed
  2527. * counter filter
  2528. */
  2529. #define ESC_SPD_CNT_FD_DEPTH_MASK (0xFU)
  2530. #define ESC_SPD_CNT_FD_DEPTH_SHIFT (0U)
  2531. #define ESC_SPD_CNT_FD_DEPTH_SET(x) (((uint8_t)(x) << ESC_SPD_CNT_FD_DEPTH_SHIFT) & ESC_SPD_CNT_FD_DEPTH_MASK)
  2532. #define ESC_SPD_CNT_FD_DEPTH_GET(x) (((uint8_t)(x) & ESC_SPD_CNT_FD_DEPTH_MASK) >> ESC_SPD_CNT_FD_DEPTH_SHIFT)
  2533. /* Bitfield definition for register: RCV_TIME_LM */
  2534. /*
  2535. * LATCH_MODE (RO)
  2536. *
  2537. * Receive Time Latch Mode:
  2538. * 0:Forwarding mode (used if frames are
  2539. * entering the ESC at port 0 first):
  2540. * Receive time stamps of ports 1-3 are
  2541. * enabled after the write access to
  2542. * 0x0900, so the following frame at ports
  2543. * 1-3 will be time stamped (this is typically
  2544. * the write frame to 0x0900 coming back
  2545. * from the network behind the ESC).
  2546. * 1:Reverse mode (used if frames are
  2547. * entering ESC at port 1-3 first):
  2548. * Receive time stamps of ports 1-3 are
  2549. * immediately taken over from the internal
  2550. * hidden time stamp registers, so the
  2551. * previous frame entering the ESC at
  2552. * ports 1-3 will be time stamped when the
  2553. * write frame to 0x0900 enters port 0 (the
  2554. * previous frame at ports 1-3 is typically
  2555. * the write frame to 0x0900 coming from
  2556. * the master, which will enable time
  2557. * stamp
  2558. */
  2559. #define ESC_RCV_TIME_LM_LATCH_MODE_MASK (0x1U)
  2560. #define ESC_RCV_TIME_LM_LATCH_MODE_SHIFT (0U)
  2561. #define ESC_RCV_TIME_LM_LATCH_MODE_GET(x) (((uint8_t)(x) & ESC_RCV_TIME_LM_LATCH_MODE_MASK) >> ESC_RCV_TIME_LM_LATCH_MODE_SHIFT)
  2562. /* Bitfield definition for register: CYC_UNIT_CTRL */
  2563. /*
  2564. * LATCHI1 (RO)
  2565. *
  2566. * Latch In unit 1:
  2567. * 0:ECAT-controlled
  2568. * 1:PDI-controlled
  2569. * NOTE:Latch interrupt is routed to ECAT/PDI
  2570. * depending on this setting
  2571. */
  2572. #define ESC_CYC_UNIT_CTRL_LATCHI1_MASK (0x20U)
  2573. #define ESC_CYC_UNIT_CTRL_LATCHI1_SHIFT (5U)
  2574. #define ESC_CYC_UNIT_CTRL_LATCHI1_GET(x) (((uint8_t)(x) & ESC_CYC_UNIT_CTRL_LATCHI1_MASK) >> ESC_CYC_UNIT_CTRL_LATCHI1_SHIFT)
  2575. /*
  2576. * LATCHI0 (RO)
  2577. *
  2578. * Latch In unit 0:
  2579. * 0:ECAT-controlled
  2580. * 1:PDI-controlled
  2581. * NOTE:Latch interrupt is routed to ECAT/PDI
  2582. * depending on this setting.
  2583. * Always 1 (PDI-controlled) if System Time is PDIcontrolled.
  2584. */
  2585. #define ESC_CYC_UNIT_CTRL_LATCHI0_MASK (0x10U)
  2586. #define ESC_CYC_UNIT_CTRL_LATCHI0_SHIFT (4U)
  2587. #define ESC_CYC_UNIT_CTRL_LATCHI0_GET(x) (((uint8_t)(x) & ESC_CYC_UNIT_CTRL_LATCHI0_MASK) >> ESC_CYC_UNIT_CTRL_LATCHI0_SHIFT)
  2588. /*
  2589. * SYNCO (RO)
  2590. *
  2591. * Cyclic Unit and SYNC0 out unit control:
  2592. * 0:ECAT-controlled
  2593. * 1:PDI-controlled
  2594. */
  2595. #define ESC_CYC_UNIT_CTRL_SYNCO_MASK (0x1U)
  2596. #define ESC_CYC_UNIT_CTRL_SYNCO_SHIFT (0U)
  2597. #define ESC_CYC_UNIT_CTRL_SYNCO_GET(x) (((uint8_t)(x) & ESC_CYC_UNIT_CTRL_SYNCO_MASK) >> ESC_CYC_UNIT_CTRL_SYNCO_SHIFT)
  2598. /* Bitfield definition for register: SYNCO_ACT */
  2599. /*
  2600. * SSDP (RW)
  2601. *
  2602. * SyncSignal debug pulse (Vasily bit):
  2603. * 0:Deactivated
  2604. * 1:Immediately generate one ping only on
  2605. * SYNC0-1 according to 0x0981[2:1 for
  2606. * debugging
  2607. * This bit is self-clearing, always read 0.
  2608. * All pulses are generated at the same time,
  2609. * the cycle time is ignored. The configured
  2610. * pulse length is used.
  2611. */
  2612. #define ESC_SYNCO_ACT_SSDP_MASK (0x80U)
  2613. #define ESC_SYNCO_ACT_SSDP_SHIFT (7U)
  2614. #define ESC_SYNCO_ACT_SSDP_SET(x) (((uint8_t)(x) << ESC_SYNCO_ACT_SSDP_SHIFT) & ESC_SYNCO_ACT_SSDP_MASK)
  2615. #define ESC_SYNCO_ACT_SSDP_GET(x) (((uint8_t)(x) & ESC_SYNCO_ACT_SSDP_MASK) >> ESC_SYNCO_ACT_SSDP_SHIFT)
  2616. /*
  2617. * NFC (RW)
  2618. *
  2619. * Near future configuration (approx.):
  2620. * 0:½ DC width future (231 ns or 263 ns)
  2621. * 1:~2.1 sec. future (231 ns)
  2622. */
  2623. #define ESC_SYNCO_ACT_NFC_MASK (0x40U)
  2624. #define ESC_SYNCO_ACT_NFC_SHIFT (6U)
  2625. #define ESC_SYNCO_ACT_NFC_SET(x) (((uint8_t)(x) << ESC_SYNCO_ACT_NFC_SHIFT) & ESC_SYNCO_ACT_NFC_MASK)
  2626. #define ESC_SYNCO_ACT_NFC_GET(x) (((uint8_t)(x) & ESC_SYNCO_ACT_NFC_MASK) >> ESC_SYNCO_ACT_NFC_SHIFT)
  2627. /*
  2628. * STPC (RW)
  2629. *
  2630. * Start Time plausibility check:
  2631. * 0:Disabled. SyncSignal generation if Start
  2632. * Time is reached.
  2633. * 1:Immediate SyncSignal generation if
  2634. * Start Time is outside near future (see
  2635. * 0x0981[6])
  2636. */
  2637. #define ESC_SYNCO_ACT_STPC_MASK (0x20U)
  2638. #define ESC_SYNCO_ACT_STPC_SHIFT (5U)
  2639. #define ESC_SYNCO_ACT_STPC_SET(x) (((uint8_t)(x) << ESC_SYNCO_ACT_STPC_SHIFT) & ESC_SYNCO_ACT_STPC_MASK)
  2640. #define ESC_SYNCO_ACT_STPC_GET(x) (((uint8_t)(x) & ESC_SYNCO_ACT_STPC_MASK) >> ESC_SYNCO_ACT_STPC_SHIFT)
  2641. /*
  2642. * EXT (RW)
  2643. *
  2644. * Extension of Start Time Cyclic Operation
  2645. * (0x0990:0x0993):
  2646. * 0:No extension
  2647. * 1:Extend 32 bit written Start Time to 64 bit
  2648. */
  2649. #define ESC_SYNCO_ACT_EXT_MASK (0x10U)
  2650. #define ESC_SYNCO_ACT_EXT_SHIFT (4U)
  2651. #define ESC_SYNCO_ACT_EXT_SET(x) (((uint8_t)(x) << ESC_SYNCO_ACT_EXT_SHIFT) & ESC_SYNCO_ACT_EXT_MASK)
  2652. #define ESC_SYNCO_ACT_EXT_GET(x) (((uint8_t)(x) & ESC_SYNCO_ACT_EXT_MASK) >> ESC_SYNCO_ACT_EXT_SHIFT)
  2653. /*
  2654. * AC (RW)
  2655. *
  2656. * Auto-activation by writing Start Time Cyclic
  2657. * Operation (0x0990:0x0997):
  2658. * 0:Disabled
  2659. * 1:Auto-activation enabled. 0x0981[0] is
  2660. * set automatically after Start Time is
  2661. * written.
  2662. */
  2663. #define ESC_SYNCO_ACT_AC_MASK (0x8U)
  2664. #define ESC_SYNCO_ACT_AC_SHIFT (3U)
  2665. #define ESC_SYNCO_ACT_AC_SET(x) (((uint8_t)(x) << ESC_SYNCO_ACT_AC_SHIFT) & ESC_SYNCO_ACT_AC_MASK)
  2666. #define ESC_SYNCO_ACT_AC_GET(x) (((uint8_t)(x) & ESC_SYNCO_ACT_AC_MASK) >> ESC_SYNCO_ACT_AC_SHIFT)
  2667. /*
  2668. * SYNC1_GEN (RW)
  2669. *
  2670. * SYNC1 generation:
  2671. * 0:Deactivated
  2672. * 1:SYNC1 pulse is generated
  2673. */
  2674. #define ESC_SYNCO_ACT_SYNC1_GEN_MASK (0x4U)
  2675. #define ESC_SYNCO_ACT_SYNC1_GEN_SHIFT (2U)
  2676. #define ESC_SYNCO_ACT_SYNC1_GEN_SET(x) (((uint8_t)(x) << ESC_SYNCO_ACT_SYNC1_GEN_SHIFT) & ESC_SYNCO_ACT_SYNC1_GEN_MASK)
  2677. #define ESC_SYNCO_ACT_SYNC1_GEN_GET(x) (((uint8_t)(x) & ESC_SYNCO_ACT_SYNC1_GEN_MASK) >> ESC_SYNCO_ACT_SYNC1_GEN_SHIFT)
  2678. /*
  2679. * SYNC0_GEN (RW)
  2680. *
  2681. * SYNC0 generation:
  2682. * 0:Deactivated
  2683. * 1:SYNC0 pulse is generated
  2684. */
  2685. #define ESC_SYNCO_ACT_SYNC0_GEN_MASK (0x2U)
  2686. #define ESC_SYNCO_ACT_SYNC0_GEN_SHIFT (1U)
  2687. #define ESC_SYNCO_ACT_SYNC0_GEN_SET(x) (((uint8_t)(x) << ESC_SYNCO_ACT_SYNC0_GEN_SHIFT) & ESC_SYNCO_ACT_SYNC0_GEN_MASK)
  2688. #define ESC_SYNCO_ACT_SYNC0_GEN_GET(x) (((uint8_t)(x) & ESC_SYNCO_ACT_SYNC0_GEN_MASK) >> ESC_SYNCO_ACT_SYNC0_GEN_SHIFT)
  2689. /*
  2690. * SOUA (RW)
  2691. *
  2692. * Sync Out Unit activation:
  2693. * 0:Deactivated
  2694. * 1:Activated
  2695. */
  2696. #define ESC_SYNCO_ACT_SOUA_MASK (0x1U)
  2697. #define ESC_SYNCO_ACT_SOUA_SHIFT (0U)
  2698. #define ESC_SYNCO_ACT_SOUA_SET(x) (((uint8_t)(x) << ESC_SYNCO_ACT_SOUA_SHIFT) & ESC_SYNCO_ACT_SOUA_MASK)
  2699. #define ESC_SYNCO_ACT_SOUA_GET(x) (((uint8_t)(x) & ESC_SYNCO_ACT_SOUA_MASK) >> ESC_SYNCO_ACT_SOUA_SHIFT)
  2700. /* Bitfield definition for register: PULSE_LEN */
  2701. /*
  2702. * LEN (RO)
  2703. *
  2704. * Pulse length of SyncSignals (in Units of
  2705. * 10ns)
  2706. * 0:Acknowledge mode:SyncSignal will be
  2707. * cleared by reading SYNC[1:0] Status
  2708. * register
  2709. */
  2710. #define ESC_PULSE_LEN_LEN_MASK (0xFFFFU)
  2711. #define ESC_PULSE_LEN_LEN_SHIFT (0U)
  2712. #define ESC_PULSE_LEN_LEN_GET(x) (((uint16_t)(x) & ESC_PULSE_LEN_LEN_MASK) >> ESC_PULSE_LEN_LEN_SHIFT)
  2713. /* Bitfield definition for register: ACT_STAT */
  2714. /*
  2715. * CHK_RSLT (RO)
  2716. *
  2717. * Start Time Cyclic Operation (0x0990:0x0997)
  2718. * plausibility check result when Sync Out Unit
  2719. * was activated:
  2720. * 0:Start Time was within near future
  2721. * 1:Start Time was out of near future
  2722. * (0x0981[6])
  2723. */
  2724. #define ESC_ACT_STAT_CHK_RSLT_MASK (0x4U)
  2725. #define ESC_ACT_STAT_CHK_RSLT_SHIFT (2U)
  2726. #define ESC_ACT_STAT_CHK_RSLT_GET(x) (((uint8_t)(x) & ESC_ACT_STAT_CHK_RSLT_MASK) >> ESC_ACT_STAT_CHK_RSLT_SHIFT)
  2727. /*
  2728. * SYNC1 (RO)
  2729. *
  2730. * SYNC1 activation state:
  2731. * 0:First SYNC1 pulse is not pending
  2732. * 1:First SYNC1 pulse is pending
  2733. */
  2734. #define ESC_ACT_STAT_SYNC1_MASK (0x2U)
  2735. #define ESC_ACT_STAT_SYNC1_SHIFT (1U)
  2736. #define ESC_ACT_STAT_SYNC1_GET(x) (((uint8_t)(x) & ESC_ACT_STAT_SYNC1_MASK) >> ESC_ACT_STAT_SYNC1_SHIFT)
  2737. /*
  2738. * SYNC0 (RO)
  2739. *
  2740. * SYNC0 activation state:
  2741. * 0:First SYNC0 pulse is not pending
  2742. * 1:First SYNC0 pulse is pending
  2743. */
  2744. #define ESC_ACT_STAT_SYNC0_MASK (0x1U)
  2745. #define ESC_ACT_STAT_SYNC0_SHIFT (0U)
  2746. #define ESC_ACT_STAT_SYNC0_GET(x) (((uint8_t)(x) & ESC_ACT_STAT_SYNC0_MASK) >> ESC_ACT_STAT_SYNC0_SHIFT)
  2747. /* Bitfield definition for register: SYNC0_STAT */
  2748. /*
  2749. * ACK (RW)
  2750. *
  2751. * SYNC0 state for Acknowledge mode.
  2752. * SYNC0 in Acknowledge mode is cleared by
  2753. * reading this register from PDI, use only in
  2754. * Acknowledge mode
  2755. */
  2756. #define ESC_SYNC0_STAT_ACK_MASK (0x1U)
  2757. #define ESC_SYNC0_STAT_ACK_SHIFT (0U)
  2758. #define ESC_SYNC0_STAT_ACK_SET(x) (((uint8_t)(x) << ESC_SYNC0_STAT_ACK_SHIFT) & ESC_SYNC0_STAT_ACK_MASK)
  2759. #define ESC_SYNC0_STAT_ACK_GET(x) (((uint8_t)(x) & ESC_SYNC0_STAT_ACK_MASK) >> ESC_SYNC0_STAT_ACK_SHIFT)
  2760. /* Bitfield definition for register: SYNC1_STAT */
  2761. /*
  2762. * ACK (RW)
  2763. *
  2764. * SYNC1 state for Acknowledge mode.
  2765. * SYNC1 in Acknowledge mode is cleared by
  2766. * reading this register from PDI, use only in
  2767. * Acknowledge mode
  2768. */
  2769. #define ESC_SYNC1_STAT_ACK_MASK (0x1U)
  2770. #define ESC_SYNC1_STAT_ACK_SHIFT (0U)
  2771. #define ESC_SYNC1_STAT_ACK_SET(x) (((uint8_t)(x) << ESC_SYNC1_STAT_ACK_SHIFT) & ESC_SYNC1_STAT_ACK_MASK)
  2772. #define ESC_SYNC1_STAT_ACK_GET(x) (((uint8_t)(x) & ESC_SYNC1_STAT_ACK_MASK) >> ESC_SYNC1_STAT_ACK_SHIFT)
  2773. /* Bitfield definition for register: START_TIME_CO */
  2774. /*
  2775. * ST (RW)
  2776. *
  2777. * Write:Start time (System time) of cyclic
  2778. * operation in ns
  2779. * Read:System time of next SYNC0 pulse in
  2780. * ns
  2781. */
  2782. #define ESC_START_TIME_CO_ST_MASK (0xFFFFFFFFFFFFFFFFULL)
  2783. #define ESC_START_TIME_CO_ST_SHIFT (0U)
  2784. #define ESC_START_TIME_CO_ST_SET(x) (((uint64_t)(x) << ESC_START_TIME_CO_ST_SHIFT) & ESC_START_TIME_CO_ST_MASK)
  2785. #define ESC_START_TIME_CO_ST_GET(x) (((uint64_t)(x) & ESC_START_TIME_CO_ST_MASK) >> ESC_START_TIME_CO_ST_SHIFT)
  2786. /* Bitfield definition for register: NXT_SYNC1_PULSE */
  2787. /*
  2788. * TIME (RO)
  2789. *
  2790. * System time of next SYNC1 pulse in ns
  2791. */
  2792. #define ESC_NXT_SYNC1_PULSE_TIME_MASK (0xFFFFFFFFFFFFFFFFULL)
  2793. #define ESC_NXT_SYNC1_PULSE_TIME_SHIFT (0U)
  2794. #define ESC_NXT_SYNC1_PULSE_TIME_GET(x) (((uint64_t)(x) & ESC_NXT_SYNC1_PULSE_TIME_MASK) >> ESC_NXT_SYNC1_PULSE_TIME_SHIFT)
  2795. /* Bitfield definition for register: SYNC0_CYC_TIME */
  2796. /*
  2797. * CYC (RW)
  2798. *
  2799. * Time between two consecutive SYNC0
  2800. * pulses in ns.
  2801. * 0:Single shot mode, generate only one
  2802. * SYNC0 pulse.
  2803. */
  2804. #define ESC_SYNC0_CYC_TIME_CYC_MASK (0xFFFFFFFFUL)
  2805. #define ESC_SYNC0_CYC_TIME_CYC_SHIFT (0U)
  2806. #define ESC_SYNC0_CYC_TIME_CYC_SET(x) (((uint32_t)(x) << ESC_SYNC0_CYC_TIME_CYC_SHIFT) & ESC_SYNC0_CYC_TIME_CYC_MASK)
  2807. #define ESC_SYNC0_CYC_TIME_CYC_GET(x) (((uint32_t)(x) & ESC_SYNC0_CYC_TIME_CYC_MASK) >> ESC_SYNC0_CYC_TIME_CYC_SHIFT)
  2808. /* Bitfield definition for register: SYNC1_CYC_TIME */
  2809. /*
  2810. * CYC (RW)
  2811. *
  2812. * Time between SYNC0 pulse and SYNC1
  2813. * pulse in ns
  2814. */
  2815. #define ESC_SYNC1_CYC_TIME_CYC_MASK (0xFFFFFFFFUL)
  2816. #define ESC_SYNC1_CYC_TIME_CYC_SHIFT (0U)
  2817. #define ESC_SYNC1_CYC_TIME_CYC_SET(x) (((uint32_t)(x) << ESC_SYNC1_CYC_TIME_CYC_SHIFT) & ESC_SYNC1_CYC_TIME_CYC_MASK)
  2818. #define ESC_SYNC1_CYC_TIME_CYC_GET(x) (((uint32_t)(x) & ESC_SYNC1_CYC_TIME_CYC_MASK) >> ESC_SYNC1_CYC_TIME_CYC_SHIFT)
  2819. /* Bitfield definition for register: LATCH0_CTRL */
  2820. /*
  2821. * NEG_EDGE (RW)
  2822. *
  2823. * Latch0 negative edge:
  2824. * 0:Continuous Latch active
  2825. * 1:Single event (only first event active)
  2826. */
  2827. #define ESC_LATCH0_CTRL_NEG_EDGE_MASK (0x2U)
  2828. #define ESC_LATCH0_CTRL_NEG_EDGE_SHIFT (1U)
  2829. #define ESC_LATCH0_CTRL_NEG_EDGE_SET(x) (((uint8_t)(x) << ESC_LATCH0_CTRL_NEG_EDGE_SHIFT) & ESC_LATCH0_CTRL_NEG_EDGE_MASK)
  2830. #define ESC_LATCH0_CTRL_NEG_EDGE_GET(x) (((uint8_t)(x) & ESC_LATCH0_CTRL_NEG_EDGE_MASK) >> ESC_LATCH0_CTRL_NEG_EDGE_SHIFT)
  2831. /*
  2832. * POS_EDGE (RW)
  2833. *
  2834. * Latch0 positive edge:
  2835. * 0:Continuous Latch active
  2836. * 1:Single event (only first event active)
  2837. */
  2838. #define ESC_LATCH0_CTRL_POS_EDGE_MASK (0x1U)
  2839. #define ESC_LATCH0_CTRL_POS_EDGE_SHIFT (0U)
  2840. #define ESC_LATCH0_CTRL_POS_EDGE_SET(x) (((uint8_t)(x) << ESC_LATCH0_CTRL_POS_EDGE_SHIFT) & ESC_LATCH0_CTRL_POS_EDGE_MASK)
  2841. #define ESC_LATCH0_CTRL_POS_EDGE_GET(x) (((uint8_t)(x) & ESC_LATCH0_CTRL_POS_EDGE_MASK) >> ESC_LATCH0_CTRL_POS_EDGE_SHIFT)
  2842. /* Bitfield definition for register: LATCH1_CTRL */
  2843. /*
  2844. * NEG_EDGE (RW)
  2845. *
  2846. * Latch1 negative edge:
  2847. * 0:Continuous Latch active
  2848. * 1:Single event (only first event active)
  2849. */
  2850. #define ESC_LATCH1_CTRL_NEG_EDGE_MASK (0x2U)
  2851. #define ESC_LATCH1_CTRL_NEG_EDGE_SHIFT (1U)
  2852. #define ESC_LATCH1_CTRL_NEG_EDGE_SET(x) (((uint8_t)(x) << ESC_LATCH1_CTRL_NEG_EDGE_SHIFT) & ESC_LATCH1_CTRL_NEG_EDGE_MASK)
  2853. #define ESC_LATCH1_CTRL_NEG_EDGE_GET(x) (((uint8_t)(x) & ESC_LATCH1_CTRL_NEG_EDGE_MASK) >> ESC_LATCH1_CTRL_NEG_EDGE_SHIFT)
  2854. /*
  2855. * POS_EDGE (RW)
  2856. *
  2857. * Latch1 positive edge:
  2858. * 0:Continuous Latch active
  2859. * 1:Single event (only first event active)
  2860. */
  2861. #define ESC_LATCH1_CTRL_POS_EDGE_MASK (0x1U)
  2862. #define ESC_LATCH1_CTRL_POS_EDGE_SHIFT (0U)
  2863. #define ESC_LATCH1_CTRL_POS_EDGE_SET(x) (((uint8_t)(x) << ESC_LATCH1_CTRL_POS_EDGE_SHIFT) & ESC_LATCH1_CTRL_POS_EDGE_MASK)
  2864. #define ESC_LATCH1_CTRL_POS_EDGE_GET(x) (((uint8_t)(x) & ESC_LATCH1_CTRL_POS_EDGE_MASK) >> ESC_LATCH1_CTRL_POS_EDGE_SHIFT)
  2865. /* Bitfield definition for register: LATCH0_STAT */
  2866. /*
  2867. * PIN_STAT (RO)
  2868. *
  2869. * Latch0 pin state
  2870. */
  2871. #define ESC_LATCH0_STAT_PIN_STAT_MASK (0x4U)
  2872. #define ESC_LATCH0_STAT_PIN_STAT_SHIFT (2U)
  2873. #define ESC_LATCH0_STAT_PIN_STAT_GET(x) (((uint8_t)(x) & ESC_LATCH0_STAT_PIN_STAT_MASK) >> ESC_LATCH0_STAT_PIN_STAT_SHIFT)
  2874. /*
  2875. * NEG_EDGE (RO)
  2876. *
  2877. * Event Latch0 negative edge.
  2878. * 0:Negative edge not detected or
  2879. * continuous mode
  2880. * 1:Negative edge detected in single event
  2881. * mode only.
  2882. * Flag cleared by reading out Latch0 Time
  2883. * Negative Edge.
  2884. */
  2885. #define ESC_LATCH0_STAT_NEG_EDGE_MASK (0x2U)
  2886. #define ESC_LATCH0_STAT_NEG_EDGE_SHIFT (1U)
  2887. #define ESC_LATCH0_STAT_NEG_EDGE_GET(x) (((uint8_t)(x) & ESC_LATCH0_STAT_NEG_EDGE_MASK) >> ESC_LATCH0_STAT_NEG_EDGE_SHIFT)
  2888. /*
  2889. * POS_EDGE (RO)
  2890. *
  2891. * Event Latch0 positive edge.
  2892. * 0:Positive edge not detected or
  2893. * continuous mode
  2894. * 1:Positive edge detected in single event
  2895. * mode only.
  2896. * Flag cleared by reading out Latch0 Time
  2897. * Positive Edge.
  2898. */
  2899. #define ESC_LATCH0_STAT_POS_EDGE_MASK (0x1U)
  2900. #define ESC_LATCH0_STAT_POS_EDGE_SHIFT (0U)
  2901. #define ESC_LATCH0_STAT_POS_EDGE_GET(x) (((uint8_t)(x) & ESC_LATCH0_STAT_POS_EDGE_MASK) >> ESC_LATCH0_STAT_POS_EDGE_SHIFT)
  2902. /* Bitfield definition for register: LATCH1_STAT */
  2903. /*
  2904. * PIN_STAT (RO)
  2905. *
  2906. * Latch1 pin state
  2907. */
  2908. #define ESC_LATCH1_STAT_PIN_STAT_MASK (0x4U)
  2909. #define ESC_LATCH1_STAT_PIN_STAT_SHIFT (2U)
  2910. #define ESC_LATCH1_STAT_PIN_STAT_GET(x) (((uint8_t)(x) & ESC_LATCH1_STAT_PIN_STAT_MASK) >> ESC_LATCH1_STAT_PIN_STAT_SHIFT)
  2911. /*
  2912. * NEG_EDGE (RO)
  2913. *
  2914. * Event Latch1 negative edge.
  2915. * 0:Negative edge not detected or
  2916. * continuous mode
  2917. * 1:Negative edge detected in single event
  2918. * mode only.
  2919. * Flag cleared by reading out Latch1 Time
  2920. * Negative Edge.
  2921. */
  2922. #define ESC_LATCH1_STAT_NEG_EDGE_MASK (0x2U)
  2923. #define ESC_LATCH1_STAT_NEG_EDGE_SHIFT (1U)
  2924. #define ESC_LATCH1_STAT_NEG_EDGE_GET(x) (((uint8_t)(x) & ESC_LATCH1_STAT_NEG_EDGE_MASK) >> ESC_LATCH1_STAT_NEG_EDGE_SHIFT)
  2925. /*
  2926. * POS_EDGE (RO)
  2927. *
  2928. * Event Latch1 positive edge.
  2929. * 0:Positive edge not detected or
  2930. * continuous mode
  2931. * 1:Positive edge detected in single event
  2932. * mode only.
  2933. * Flag cleared by reading out Latch1 Time
  2934. * Positive Edge.
  2935. */
  2936. #define ESC_LATCH1_STAT_POS_EDGE_MASK (0x1U)
  2937. #define ESC_LATCH1_STAT_POS_EDGE_SHIFT (0U)
  2938. #define ESC_LATCH1_STAT_POS_EDGE_GET(x) (((uint8_t)(x) & ESC_LATCH1_STAT_POS_EDGE_MASK) >> ESC_LATCH1_STAT_POS_EDGE_SHIFT)
  2939. /* Bitfield definition for register: LATCH0_TIME_PE */
  2940. /*
  2941. * TIME (RW)
  2942. *
  2943. * System time at the positive edge of the
  2944. * Latch0 signal.
  2945. */
  2946. #define ESC_LATCH0_TIME_PE_TIME_MASK (0xFFFFFFFFFFFFFFFFULL)
  2947. #define ESC_LATCH0_TIME_PE_TIME_SHIFT (0U)
  2948. #define ESC_LATCH0_TIME_PE_TIME_SET(x) (((uint64_t)(x) << ESC_LATCH0_TIME_PE_TIME_SHIFT) & ESC_LATCH0_TIME_PE_TIME_MASK)
  2949. #define ESC_LATCH0_TIME_PE_TIME_GET(x) (((uint64_t)(x) & ESC_LATCH0_TIME_PE_TIME_MASK) >> ESC_LATCH0_TIME_PE_TIME_SHIFT)
  2950. /* Bitfield definition for register: LATCH0_TIME_NE */
  2951. /*
  2952. * TIME (RW)
  2953. *
  2954. * System time at the negative edge of the
  2955. * Latch0 signal.
  2956. */
  2957. #define ESC_LATCH0_TIME_NE_TIME_MASK (0xFFFFFFFFFFFFFFFFULL)
  2958. #define ESC_LATCH0_TIME_NE_TIME_SHIFT (0U)
  2959. #define ESC_LATCH0_TIME_NE_TIME_SET(x) (((uint64_t)(x) << ESC_LATCH0_TIME_NE_TIME_SHIFT) & ESC_LATCH0_TIME_NE_TIME_MASK)
  2960. #define ESC_LATCH0_TIME_NE_TIME_GET(x) (((uint64_t)(x) & ESC_LATCH0_TIME_NE_TIME_MASK) >> ESC_LATCH0_TIME_NE_TIME_SHIFT)
  2961. /* Bitfield definition for register: LATCH1_TIME_PE */
  2962. /*
  2963. * TIME (RW)
  2964. *
  2965. * System time at the positive edge of the
  2966. * Latch1 signal.
  2967. */
  2968. #define ESC_LATCH1_TIME_PE_TIME_MASK (0xFFFFFFFFFFFFFFFFULL)
  2969. #define ESC_LATCH1_TIME_PE_TIME_SHIFT (0U)
  2970. #define ESC_LATCH1_TIME_PE_TIME_SET(x) (((uint64_t)(x) << ESC_LATCH1_TIME_PE_TIME_SHIFT) & ESC_LATCH1_TIME_PE_TIME_MASK)
  2971. #define ESC_LATCH1_TIME_PE_TIME_GET(x) (((uint64_t)(x) & ESC_LATCH1_TIME_PE_TIME_MASK) >> ESC_LATCH1_TIME_PE_TIME_SHIFT)
  2972. /* Bitfield definition for register: LATCH1_TIME_NE */
  2973. /*
  2974. * TIME (RW)
  2975. *
  2976. * System time at the negative edge of the
  2977. * Latch1 signal.
  2978. */
  2979. #define ESC_LATCH1_TIME_NE_TIME_MASK (0xFFFFFFFFFFFFFFFFULL)
  2980. #define ESC_LATCH1_TIME_NE_TIME_SHIFT (0U)
  2981. #define ESC_LATCH1_TIME_NE_TIME_SET(x) (((uint64_t)(x) << ESC_LATCH1_TIME_NE_TIME_SHIFT) & ESC_LATCH1_TIME_NE_TIME_MASK)
  2982. #define ESC_LATCH1_TIME_NE_TIME_GET(x) (((uint64_t)(x) & ESC_LATCH1_TIME_NE_TIME_MASK) >> ESC_LATCH1_TIME_NE_TIME_SHIFT)
  2983. /* Bitfield definition for register: ECAT_BUF_CET */
  2984. /*
  2985. * TIME (RO)
  2986. *
  2987. * Local time at the beginning of the frame
  2988. * which causes at least one SyncManager to
  2989. * assert an ECAT event
  2990. */
  2991. #define ESC_ECAT_BUF_CET_TIME_MASK (0xFFFFFFFFUL)
  2992. #define ESC_ECAT_BUF_CET_TIME_SHIFT (0U)
  2993. #define ESC_ECAT_BUF_CET_TIME_GET(x) (((uint32_t)(x) & ESC_ECAT_BUF_CET_TIME_MASK) >> ESC_ECAT_BUF_CET_TIME_SHIFT)
  2994. /* Bitfield definition for register: PDI_BUF_SET */
  2995. /*
  2996. * TIME (RO)
  2997. *
  2998. * Local time when at least one SyncManager
  2999. * asserts a PDI buffer start event
  3000. */
  3001. #define ESC_PDI_BUF_SET_TIME_MASK (0xFFFFFFFFUL)
  3002. #define ESC_PDI_BUF_SET_TIME_SHIFT (0U)
  3003. #define ESC_PDI_BUF_SET_TIME_GET(x) (((uint32_t)(x) & ESC_PDI_BUF_SET_TIME_MASK) >> ESC_PDI_BUF_SET_TIME_SHIFT)
  3004. /* Bitfield definition for register: PDI_BUF_CET */
  3005. /*
  3006. * TIME (RO)
  3007. *
  3008. * Local time when at least one SyncManager
  3009. * asserts a PDI buffer change event
  3010. */
  3011. #define ESC_PDI_BUF_CET_TIME_MASK (0xFFFFFFFFUL)
  3012. #define ESC_PDI_BUF_CET_TIME_SHIFT (0U)
  3013. #define ESC_PDI_BUF_CET_TIME_GET(x) (((uint32_t)(x) & ESC_PDI_BUF_CET_TIME_MASK) >> ESC_PDI_BUF_CET_TIME_SHIFT)
  3014. /* Bitfield definition for register: PID */
  3015. /*
  3016. * PID (RO)
  3017. *
  3018. * Product ID
  3019. */
  3020. #define ESC_PID_PID_MASK (0xFFFFFFFFFFFFFFFFULL)
  3021. #define ESC_PID_PID_SHIFT (0U)
  3022. #define ESC_PID_PID_GET(x) (((uint64_t)(x) & ESC_PID_PID_MASK) >> ESC_PID_PID_SHIFT)
  3023. /* Bitfield definition for register: VID */
  3024. /*
  3025. * VID (RO)
  3026. *
  3027. * Vendor ID:
  3028. * 23-0: Company
  3029. * 31-24: Department
  3030. * NOTE:Test Vendor IDs have [31:28]=0xE
  3031. */
  3032. #define ESC_VID_VID_MASK (0xFFFFFFFFFFFFFFFFULL)
  3033. #define ESC_VID_VID_SHIFT (0U)
  3034. #define ESC_VID_VID_GET(x) (((uint64_t)(x) & ESC_VID_VID_MASK) >> ESC_VID_VID_SHIFT)
  3035. /* Bitfield definition for register: DIO_OUT_DATA */
  3036. /*
  3037. * OD (RO)
  3038. *
  3039. * Output Data
  3040. */
  3041. #define ESC_DIO_OUT_DATA_OD_MASK (0xFFFFFFFFUL)
  3042. #define ESC_DIO_OUT_DATA_OD_SHIFT (0U)
  3043. #define ESC_DIO_OUT_DATA_OD_GET(x) (((uint32_t)(x) & ESC_DIO_OUT_DATA_OD_MASK) >> ESC_DIO_OUT_DATA_OD_SHIFT)
  3044. /* Bitfield definition for register: GPO */
  3045. /*
  3046. * GPOD (RW)
  3047. *
  3048. * General Purpose Output Data
  3049. */
  3050. #define ESC_GPO_GPOD_MASK (0xFFFFFFFFFFFFFFFFULL)
  3051. #define ESC_GPO_GPOD_SHIFT (0U)
  3052. #define ESC_GPO_GPOD_SET(x) (((uint64_t)(x) << ESC_GPO_GPOD_SHIFT) & ESC_GPO_GPOD_MASK)
  3053. #define ESC_GPO_GPOD_GET(x) (((uint64_t)(x) & ESC_GPO_GPOD_MASK) >> ESC_GPO_GPOD_SHIFT)
  3054. /* Bitfield definition for register: GPI */
  3055. /*
  3056. * GPID (RO)
  3057. *
  3058. * General Purpose Input Data
  3059. */
  3060. #define ESC_GPI_GPID_MASK (0xFFFFFFFFFFFFFFFFULL)
  3061. #define ESC_GPI_GPID_SHIFT (0U)
  3062. #define ESC_GPI_GPID_GET(x) (((uint64_t)(x) & ESC_GPI_GPID_MASK) >> ESC_GPI_GPID_SHIFT)
  3063. /* Bitfield definition for register: USER_RAM_BYTE0 */
  3064. /*
  3065. * EXTF (RW)
  3066. *
  3067. * Number of extended feature bits
  3068. */
  3069. #define ESC_USER_RAM_BYTE0_EXTF_MASK (0xFFU)
  3070. #define ESC_USER_RAM_BYTE0_EXTF_SHIFT (0U)
  3071. #define ESC_USER_RAM_BYTE0_EXTF_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE0_EXTF_SHIFT) & ESC_USER_RAM_BYTE0_EXTF_MASK)
  3072. #define ESC_USER_RAM_BYTE0_EXTF_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE0_EXTF_MASK) >> ESC_USER_RAM_BYTE0_EXTF_SHIFT)
  3073. /* Bitfield definition for register: USER_RAM_BYTE1 */
  3074. /*
  3075. * PRWO (RW)
  3076. *
  3077. * Physical Read/Write Offset (0x0108:0x0109)
  3078. */
  3079. #define ESC_USER_RAM_BYTE1_PRWO_MASK (0x80U)
  3080. #define ESC_USER_RAM_BYTE1_PRWO_SHIFT (7U)
  3081. #define ESC_USER_RAM_BYTE1_PRWO_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE1_PRWO_SHIFT) & ESC_USER_RAM_BYTE1_PRWO_MASK)
  3082. #define ESC_USER_RAM_BYTE1_PRWO_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE1_PRWO_MASK) >> ESC_USER_RAM_BYTE1_PRWO_SHIFT)
  3083. /*
  3084. * AEMW (RW)
  3085. *
  3086. * AL Event Mask writable (0x0204:0x0207)
  3087. */
  3088. #define ESC_USER_RAM_BYTE1_AEMW_MASK (0x40U)
  3089. #define ESC_USER_RAM_BYTE1_AEMW_SHIFT (6U)
  3090. #define ESC_USER_RAM_BYTE1_AEMW_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE1_AEMW_SHIFT) & ESC_USER_RAM_BYTE1_AEMW_MASK)
  3091. #define ESC_USER_RAM_BYTE1_AEMW_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE1_AEMW_MASK) >> ESC_USER_RAM_BYTE1_AEMW_SHIFT)
  3092. /*
  3093. * GPO (RW)
  3094. *
  3095. * General Purpose Outputs (0x0F10:0x0F17)
  3096. */
  3097. #define ESC_USER_RAM_BYTE1_GPO_MASK (0x20U)
  3098. #define ESC_USER_RAM_BYTE1_GPO_SHIFT (5U)
  3099. #define ESC_USER_RAM_BYTE1_GPO_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE1_GPO_SHIFT) & ESC_USER_RAM_BYTE1_GPO_MASK)
  3100. #define ESC_USER_RAM_BYTE1_GPO_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE1_GPO_MASK) >> ESC_USER_RAM_BYTE1_GPO_SHIFT)
  3101. /*
  3102. * GPI (RW)
  3103. *
  3104. * General Purpose Inputs (0x0F18:0x0F1F)
  3105. */
  3106. #define ESC_USER_RAM_BYTE1_GPI_MASK (0x10U)
  3107. #define ESC_USER_RAM_BYTE1_GPI_SHIFT (4U)
  3108. #define ESC_USER_RAM_BYTE1_GPI_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE1_GPI_SHIFT) & ESC_USER_RAM_BYTE1_GPI_MASK)
  3109. #define ESC_USER_RAM_BYTE1_GPI_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE1_GPI_MASK) >> ESC_USER_RAM_BYTE1_GPI_SHIFT)
  3110. /*
  3111. * CSA (RW)
  3112. *
  3113. * Configured Station Alias (0x0012:0x0013)
  3114. */
  3115. #define ESC_USER_RAM_BYTE1_CSA_MASK (0x8U)
  3116. #define ESC_USER_RAM_BYTE1_CSA_SHIFT (3U)
  3117. #define ESC_USER_RAM_BYTE1_CSA_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE1_CSA_SHIFT) & ESC_USER_RAM_BYTE1_CSA_MASK)
  3118. #define ESC_USER_RAM_BYTE1_CSA_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE1_CSA_MASK) >> ESC_USER_RAM_BYTE1_CSA_SHIFT)
  3119. /*
  3120. * EIM (RW)
  3121. *
  3122. * ECAT Interrupt Mask (0x0200:0x0201)
  3123. */
  3124. #define ESC_USER_RAM_BYTE1_EIM_MASK (0x4U)
  3125. #define ESC_USER_RAM_BYTE1_EIM_SHIFT (2U)
  3126. #define ESC_USER_RAM_BYTE1_EIM_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE1_EIM_SHIFT) & ESC_USER_RAM_BYTE1_EIM_MASK)
  3127. #define ESC_USER_RAM_BYTE1_EIM_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE1_EIM_MASK) >> ESC_USER_RAM_BYTE1_EIM_SHIFT)
  3128. /*
  3129. * ALSCR (RW)
  3130. *
  3131. * AL Status Code Register (0x0134:0x0135)
  3132. */
  3133. #define ESC_USER_RAM_BYTE1_ALSCR_MASK (0x2U)
  3134. #define ESC_USER_RAM_BYTE1_ALSCR_SHIFT (1U)
  3135. #define ESC_USER_RAM_BYTE1_ALSCR_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE1_ALSCR_SHIFT) & ESC_USER_RAM_BYTE1_ALSCR_MASK)
  3136. #define ESC_USER_RAM_BYTE1_ALSCR_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE1_ALSCR_MASK) >> ESC_USER_RAM_BYTE1_ALSCR_SHIFT)
  3137. /*
  3138. * EDLCR (RW)
  3139. *
  3140. * Extended DL Control Register (0x0102:0x0103)
  3141. */
  3142. #define ESC_USER_RAM_BYTE1_EDLCR_MASK (0x1U)
  3143. #define ESC_USER_RAM_BYTE1_EDLCR_SHIFT (0U)
  3144. #define ESC_USER_RAM_BYTE1_EDLCR_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE1_EDLCR_SHIFT) & ESC_USER_RAM_BYTE1_EDLCR_MASK)
  3145. #define ESC_USER_RAM_BYTE1_EDLCR_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE1_EDLCR_MASK) >> ESC_USER_RAM_BYTE1_EDLCR_SHIFT)
  3146. /* Bitfield definition for register: USER_RAM_BYTE2 */
  3147. /*
  3148. * ESCFG (RW)
  3149. *
  3150. * EEPROM Size configurable (0x0502[7]):
  3151. * 0:EEPROM Size fixed to sizes up to 16 Kbit
  3152. * 1:EEPROM Size configurable
  3153. */
  3154. #define ESC_USER_RAM_BYTE2_ESCFG_MASK (0x80U)
  3155. #define ESC_USER_RAM_BYTE2_ESCFG_SHIFT (7U)
  3156. #define ESC_USER_RAM_BYTE2_ESCFG_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE2_ESCFG_SHIFT) & ESC_USER_RAM_BYTE2_ESCFG_MASK)
  3157. #define ESC_USER_RAM_BYTE2_ESCFG_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE2_ESCFG_MASK) >> ESC_USER_RAM_BYTE2_ESCFG_SHIFT)
  3158. /*
  3159. * EPUPEC (RW)
  3160. *
  3161. * ECAT Processing Unit/PDI Error Counter
  3162. * (0x030C:0x030D)
  3163. */
  3164. #define ESC_USER_RAM_BYTE2_EPUPEC_MASK (0x40U)
  3165. #define ESC_USER_RAM_BYTE2_EPUPEC_SHIFT (6U)
  3166. #define ESC_USER_RAM_BYTE2_EPUPEC_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE2_EPUPEC_SHIFT) & ESC_USER_RAM_BYTE2_EPUPEC_MASK)
  3167. #define ESC_USER_RAM_BYTE2_EPUPEC_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE2_EPUPEC_MASK) >> ESC_USER_RAM_BYTE2_EPUPEC_SHIFT)
  3168. /*
  3169. * DCSMET (RW)
  3170. *
  3171. * DC SyncManager Event Times (0x09F0:0x09FF)
  3172. */
  3173. #define ESC_USER_RAM_BYTE2_DCSMET_MASK (0x20U)
  3174. #define ESC_USER_RAM_BYTE2_DCSMET_SHIFT (5U)
  3175. #define ESC_USER_RAM_BYTE2_DCSMET_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE2_DCSMET_SHIFT) & ESC_USER_RAM_BYTE2_DCSMET_MASK)
  3176. #define ESC_USER_RAM_BYTE2_DCSMET_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE2_DCSMET_MASK) >> ESC_USER_RAM_BYTE2_DCSMET_SHIFT)
  3177. /*
  3178. * RESET (RW)
  3179. *
  3180. * Reset (0x0040:0x0041)
  3181. */
  3182. #define ESC_USER_RAM_BYTE2_RESET_MASK (0x8U)
  3183. #define ESC_USER_RAM_BYTE2_RESET_SHIFT (3U)
  3184. #define ESC_USER_RAM_BYTE2_RESET_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE2_RESET_SHIFT) & ESC_USER_RAM_BYTE2_RESET_MASK)
  3185. #define ESC_USER_RAM_BYTE2_RESET_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE2_RESET_MASK) >> ESC_USER_RAM_BYTE2_RESET_SHIFT)
  3186. /*
  3187. * WP (RW)
  3188. *
  3189. * Write Protection (0x0020:0x0031)
  3190. */
  3191. #define ESC_USER_RAM_BYTE2_WP_MASK (0x4U)
  3192. #define ESC_USER_RAM_BYTE2_WP_SHIFT (2U)
  3193. #define ESC_USER_RAM_BYTE2_WP_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE2_WP_SHIFT) & ESC_USER_RAM_BYTE2_WP_MASK)
  3194. #define ESC_USER_RAM_BYTE2_WP_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE2_WP_MASK) >> ESC_USER_RAM_BYTE2_WP_SHIFT)
  3195. /*
  3196. * WDGCNT (RW)
  3197. *
  3198. * Watchdog counters (0x0442:0x0443)
  3199. */
  3200. #define ESC_USER_RAM_BYTE2_WDGCNT_MASK (0x2U)
  3201. #define ESC_USER_RAM_BYTE2_WDGCNT_SHIFT (1U)
  3202. #define ESC_USER_RAM_BYTE2_WDGCNT_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE2_WDGCNT_SHIFT) & ESC_USER_RAM_BYTE2_WDGCNT_MASK)
  3203. #define ESC_USER_RAM_BYTE2_WDGCNT_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE2_WDGCNT_MASK) >> ESC_USER_RAM_BYTE2_WDGCNT_SHIFT)
  3204. /*
  3205. * WDW (RW)
  3206. *
  3207. * Watchdog divider writable (0x0400:0x0401) and
  3208. * Watchdog PDI (0x0410:0x0411)
  3209. */
  3210. #define ESC_USER_RAM_BYTE2_WDW_MASK (0x1U)
  3211. #define ESC_USER_RAM_BYTE2_WDW_SHIFT (0U)
  3212. #define ESC_USER_RAM_BYTE2_WDW_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE2_WDW_SHIFT) & ESC_USER_RAM_BYTE2_WDW_MASK)
  3213. #define ESC_USER_RAM_BYTE2_WDW_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE2_WDW_MASK) >> ESC_USER_RAM_BYTE2_WDW_SHIFT)
  3214. /* Bitfield definition for register: USER_RAM_BYTE3 */
  3215. /*
  3216. * RLED (RW)
  3217. *
  3218. * Run LED (DEV_STATE LED)
  3219. */
  3220. #define ESC_USER_RAM_BYTE3_RLED_MASK (0x80U)
  3221. #define ESC_USER_RAM_BYTE3_RLED_SHIFT (7U)
  3222. #define ESC_USER_RAM_BYTE3_RLED_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE3_RLED_SHIFT) & ESC_USER_RAM_BYTE3_RLED_MASK)
  3223. #define ESC_USER_RAM_BYTE3_RLED_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE3_RLED_MASK) >> ESC_USER_RAM_BYTE3_RLED_SHIFT)
  3224. /*
  3225. * ELDE (RW)
  3226. *
  3227. * Enhanced Link Detection EBUS
  3228. */
  3229. #define ESC_USER_RAM_BYTE3_ELDE_MASK (0x40U)
  3230. #define ESC_USER_RAM_BYTE3_ELDE_SHIFT (6U)
  3231. #define ESC_USER_RAM_BYTE3_ELDE_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE3_ELDE_SHIFT) & ESC_USER_RAM_BYTE3_ELDE_MASK)
  3232. #define ESC_USER_RAM_BYTE3_ELDE_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE3_ELDE_MASK) >> ESC_USER_RAM_BYTE3_ELDE_SHIFT)
  3233. /*
  3234. * ELDM (RW)
  3235. *
  3236. * Enhanced Link Detection MII
  3237. */
  3238. #define ESC_USER_RAM_BYTE3_ELDM_MASK (0x20U)
  3239. #define ESC_USER_RAM_BYTE3_ELDM_SHIFT (5U)
  3240. #define ESC_USER_RAM_BYTE3_ELDM_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE3_ELDM_SHIFT) & ESC_USER_RAM_BYTE3_ELDM_MASK)
  3241. #define ESC_USER_RAM_BYTE3_ELDM_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE3_ELDM_MASK) >> ESC_USER_RAM_BYTE3_ELDM_SHIFT)
  3242. /*
  3243. * MMI (RW)
  3244. *
  3245. * MII Management Interface (0x0510:0x0515)
  3246. */
  3247. #define ESC_USER_RAM_BYTE3_MMI_MASK (0x10U)
  3248. #define ESC_USER_RAM_BYTE3_MMI_SHIFT (4U)
  3249. #define ESC_USER_RAM_BYTE3_MMI_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE3_MMI_SHIFT) & ESC_USER_RAM_BYTE3_MMI_MASK)
  3250. #define ESC_USER_RAM_BYTE3_MMI_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE3_MMI_MASK) >> ESC_USER_RAM_BYTE3_MMI_SHIFT)
  3251. /*
  3252. * LLC (RW)
  3253. *
  3254. * Lost Link Counter (0x0310:0x0313)
  3255. */
  3256. #define ESC_USER_RAM_BYTE3_LLC_MASK (0x8U)
  3257. #define ESC_USER_RAM_BYTE3_LLC_SHIFT (3U)
  3258. #define ESC_USER_RAM_BYTE3_LLC_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE3_LLC_SHIFT) & ESC_USER_RAM_BYTE3_LLC_MASK)
  3259. #define ESC_USER_RAM_BYTE3_LLC_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE3_LLC_MASK) >> ESC_USER_RAM_BYTE3_LLC_SHIFT)
  3260. /* Bitfield definition for register: USER_RAM_BYTE4 */
  3261. /*
  3262. * LDCM (RW)
  3263. *
  3264. * Link detection and configuration by MI
  3265. */
  3266. #define ESC_USER_RAM_BYTE4_LDCM_MASK (0x80U)
  3267. #define ESC_USER_RAM_BYTE4_LDCM_SHIFT (7U)
  3268. #define ESC_USER_RAM_BYTE4_LDCM_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE4_LDCM_SHIFT) & ESC_USER_RAM_BYTE4_LDCM_MASK)
  3269. #define ESC_USER_RAM_BYTE4_LDCM_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE4_LDCM_MASK) >> ESC_USER_RAM_BYTE4_LDCM_SHIFT)
  3270. /*
  3271. * DTLC (RW)
  3272. *
  3273. * DC Time loop control assigned to PDI
  3274. */
  3275. #define ESC_USER_RAM_BYTE4_DTLC_MASK (0x40U)
  3276. #define ESC_USER_RAM_BYTE4_DTLC_SHIFT (6U)
  3277. #define ESC_USER_RAM_BYTE4_DTLC_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE4_DTLC_SHIFT) & ESC_USER_RAM_BYTE4_DTLC_MASK)
  3278. #define ESC_USER_RAM_BYTE4_DTLC_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE4_DTLC_MASK) >> ESC_USER_RAM_BYTE4_DTLC_SHIFT)
  3279. /*
  3280. * DSOU (RW)
  3281. *
  3282. * DC Sync Out Unit
  3283. */
  3284. #define ESC_USER_RAM_BYTE4_DSOU_MASK (0x20U)
  3285. #define ESC_USER_RAM_BYTE4_DSOU_SHIFT (5U)
  3286. #define ESC_USER_RAM_BYTE4_DSOU_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE4_DSOU_SHIFT) & ESC_USER_RAM_BYTE4_DSOU_MASK)
  3287. #define ESC_USER_RAM_BYTE4_DSOU_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE4_DSOU_MASK) >> ESC_USER_RAM_BYTE4_DSOU_SHIFT)
  3288. /*
  3289. * DLIU (RW)
  3290. *
  3291. * DC Latch In Unit
  3292. */
  3293. #define ESC_USER_RAM_BYTE4_DLIU_MASK (0x8U)
  3294. #define ESC_USER_RAM_BYTE4_DLIU_SHIFT (3U)
  3295. #define ESC_USER_RAM_BYTE4_DLIU_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE4_DLIU_SHIFT) & ESC_USER_RAM_BYTE4_DLIU_MASK)
  3296. #define ESC_USER_RAM_BYTE4_DLIU_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE4_DLIU_MASK) >> ESC_USER_RAM_BYTE4_DLIU_SHIFT)
  3297. /*
  3298. * LALED (RW)
  3299. *
  3300. * Link/Activity LED
  3301. */
  3302. #define ESC_USER_RAM_BYTE4_LALED_MASK (0x1U)
  3303. #define ESC_USER_RAM_BYTE4_LALED_SHIFT (0U)
  3304. #define ESC_USER_RAM_BYTE4_LALED_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE4_LALED_SHIFT) & ESC_USER_RAM_BYTE4_LALED_MASK)
  3305. #define ESC_USER_RAM_BYTE4_LALED_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE4_LALED_MASK) >> ESC_USER_RAM_BYTE4_LALED_SHIFT)
  3306. /* Bitfield definition for register: USER_RAM_BYTE5 */
  3307. /*
  3308. * DDIOR (RW)
  3309. *
  3310. * Disable Digital I/O register (0x0F00:0x0F03)
  3311. */
  3312. #define ESC_USER_RAM_BYTE5_DDIOR_MASK (0x20U)
  3313. #define ESC_USER_RAM_BYTE5_DDIOR_SHIFT (5U)
  3314. #define ESC_USER_RAM_BYTE5_DDIOR_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE5_DDIOR_SHIFT) & ESC_USER_RAM_BYTE5_DDIOR_MASK)
  3315. #define ESC_USER_RAM_BYTE5_DDIOR_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE5_DDIOR_MASK) >> ESC_USER_RAM_BYTE5_DDIOR_SHIFT)
  3316. /*
  3317. * EEU (RW)
  3318. *
  3319. * EEPROM emulation by µController
  3320. */
  3321. #define ESC_USER_RAM_BYTE5_EEU_MASK (0x4U)
  3322. #define ESC_USER_RAM_BYTE5_EEU_SHIFT (2U)
  3323. #define ESC_USER_RAM_BYTE5_EEU_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE5_EEU_SHIFT) & ESC_USER_RAM_BYTE5_EEU_MASK)
  3324. #define ESC_USER_RAM_BYTE5_EEU_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE5_EEU_MASK) >> ESC_USER_RAM_BYTE5_EEU_SHIFT)
  3325. /*
  3326. * ATS (RW)
  3327. *
  3328. * Automatic TX shift
  3329. */
  3330. #define ESC_USER_RAM_BYTE5_ATS_MASK (0x2U)
  3331. #define ESC_USER_RAM_BYTE5_ATS_SHIFT (1U)
  3332. #define ESC_USER_RAM_BYTE5_ATS_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE5_ATS_SHIFT) & ESC_USER_RAM_BYTE5_ATS_MASK)
  3333. #define ESC_USER_RAM_BYTE5_ATS_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE5_ATS_MASK) >> ESC_USER_RAM_BYTE5_ATS_SHIFT)
  3334. /*
  3335. * MCPP (RW)
  3336. *
  3337. * MI control by PDI possible
  3338. */
  3339. #define ESC_USER_RAM_BYTE5_MCPP_MASK (0x1U)
  3340. #define ESC_USER_RAM_BYTE5_MCPP_SHIFT (0U)
  3341. #define ESC_USER_RAM_BYTE5_MCPP_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE5_MCPP_SHIFT) & ESC_USER_RAM_BYTE5_MCPP_MASK)
  3342. #define ESC_USER_RAM_BYTE5_MCPP_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE5_MCPP_MASK) >> ESC_USER_RAM_BYTE5_MCPP_SHIFT)
  3343. /* Bitfield definition for register: USER_RAM_BYTE6 */
  3344. /*
  3345. * RELEDOR (RW)
  3346. *
  3347. * RUN/ERR LED Override (0x0138:0x0139)
  3348. */
  3349. #define ESC_USER_RAM_BYTE6_RELEDOR_MASK (0x4U)
  3350. #define ESC_USER_RAM_BYTE6_RELEDOR_SHIFT (2U)
  3351. #define ESC_USER_RAM_BYTE6_RELEDOR_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE6_RELEDOR_SHIFT) & ESC_USER_RAM_BYTE6_RELEDOR_MASK)
  3352. #define ESC_USER_RAM_BYTE6_RELEDOR_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE6_RELEDOR_MASK) >> ESC_USER_RAM_BYTE6_RELEDOR_SHIFT)
  3353. /* Bitfield definition for register: USER_RAM_BYTE7 */
  3354. /*
  3355. * DCST (RW)
  3356. *
  3357. * DC System Time (0x0910:0x0936)
  3358. */
  3359. #define ESC_USER_RAM_BYTE7_DCST_MASK (0x80U)
  3360. #define ESC_USER_RAM_BYTE7_DCST_SHIFT (7U)
  3361. #define ESC_USER_RAM_BYTE7_DCST_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE7_DCST_SHIFT) & ESC_USER_RAM_BYTE7_DCST_MASK)
  3362. #define ESC_USER_RAM_BYTE7_DCST_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE7_DCST_MASK) >> ESC_USER_RAM_BYTE7_DCST_SHIFT)
  3363. /*
  3364. * DCRT (RW)
  3365. *
  3366. * DC Receive Times (0x0900:0x090F)
  3367. */
  3368. #define ESC_USER_RAM_BYTE7_DCRT_MASK (0x40U)
  3369. #define ESC_USER_RAM_BYTE7_DCRT_SHIFT (6U)
  3370. #define ESC_USER_RAM_BYTE7_DCRT_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE7_DCRT_SHIFT) & ESC_USER_RAM_BYTE7_DCRT_MASK)
  3371. #define ESC_USER_RAM_BYTE7_DCRT_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE7_DCRT_MASK) >> ESC_USER_RAM_BYTE7_DCRT_SHIFT)
  3372. /*
  3373. * DCS1D (RW)
  3374. *
  3375. * DC Sync1 disable
  3376. */
  3377. #define ESC_USER_RAM_BYTE7_DCS1D_MASK (0x8U)
  3378. #define ESC_USER_RAM_BYTE7_DCS1D_SHIFT (3U)
  3379. #define ESC_USER_RAM_BYTE7_DCS1D_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE7_DCS1D_SHIFT) & ESC_USER_RAM_BYTE7_DCS1D_MASK)
  3380. #define ESC_USER_RAM_BYTE7_DCS1D_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE7_DCS1D_MASK) >> ESC_USER_RAM_BYTE7_DCS1D_SHIFT)
  3381. /* Bitfield definition for register: USER_RAM_BYTE8 */
  3382. /*
  3383. * PPDI (RW)
  3384. *
  3385. * PLB PDI
  3386. */
  3387. #define ESC_USER_RAM_BYTE8_PPDI_MASK (0x20U)
  3388. #define ESC_USER_RAM_BYTE8_PPDI_SHIFT (5U)
  3389. #define ESC_USER_RAM_BYTE8_PPDI_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE8_PPDI_SHIFT) & ESC_USER_RAM_BYTE8_PPDI_MASK)
  3390. #define ESC_USER_RAM_BYTE8_PPDI_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE8_PPDI_MASK) >> ESC_USER_RAM_BYTE8_PPDI_SHIFT)
  3391. /*
  3392. * OPDI (RW)
  3393. *
  3394. * OPB PDI
  3395. */
  3396. #define ESC_USER_RAM_BYTE8_OPDI_MASK (0x10U)
  3397. #define ESC_USER_RAM_BYTE8_OPDI_SHIFT (4U)
  3398. #define ESC_USER_RAM_BYTE8_OPDI_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE8_OPDI_SHIFT) & ESC_USER_RAM_BYTE8_OPDI_MASK)
  3399. #define ESC_USER_RAM_BYTE8_OPDI_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE8_OPDI_MASK) >> ESC_USER_RAM_BYTE8_OPDI_SHIFT)
  3400. /*
  3401. * APDI (RW)
  3402. *
  3403. * Avalon PDI
  3404. */
  3405. #define ESC_USER_RAM_BYTE8_APDI_MASK (0x8U)
  3406. #define ESC_USER_RAM_BYTE8_APDI_SHIFT (3U)
  3407. #define ESC_USER_RAM_BYTE8_APDI_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE8_APDI_SHIFT) & ESC_USER_RAM_BYTE8_APDI_MASK)
  3408. #define ESC_USER_RAM_BYTE8_APDI_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE8_APDI_MASK) >> ESC_USER_RAM_BYTE8_APDI_SHIFT)
  3409. /*
  3410. * PDICEC (RW)
  3411. *
  3412. * PDI clears error counter
  3413. */
  3414. #define ESC_USER_RAM_BYTE8_PDICEC_MASK (0x4U)
  3415. #define ESC_USER_RAM_BYTE8_PDICEC_SHIFT (2U)
  3416. #define ESC_USER_RAM_BYTE8_PDICEC_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE8_PDICEC_SHIFT) & ESC_USER_RAM_BYTE8_PDICEC_MASK)
  3417. #define ESC_USER_RAM_BYTE8_PDICEC_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE8_PDICEC_MASK) >> ESC_USER_RAM_BYTE8_PDICEC_SHIFT)
  3418. /*
  3419. * DC64 (RW)
  3420. *
  3421. * DC 64 bit
  3422. */
  3423. #define ESC_USER_RAM_BYTE8_DC64_MASK (0x1U)
  3424. #define ESC_USER_RAM_BYTE8_DC64_SHIFT (0U)
  3425. #define ESC_USER_RAM_BYTE8_DC64_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE8_DC64_SHIFT) & ESC_USER_RAM_BYTE8_DC64_MASK)
  3426. #define ESC_USER_RAM_BYTE8_DC64_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE8_DC64_MASK) >> ESC_USER_RAM_BYTE8_DC64_SHIFT)
  3427. /* Bitfield definition for register: USER_RAM_BYTE9 */
  3428. /*
  3429. * DR (RW)
  3430. *
  3431. * Direct RESET
  3432. */
  3433. #define ESC_USER_RAM_BYTE9_DR_MASK (0x80U)
  3434. #define ESC_USER_RAM_BYTE9_DR_SHIFT (7U)
  3435. #define ESC_USER_RAM_BYTE9_DR_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE9_DR_SHIFT) & ESC_USER_RAM_BYTE9_DR_MASK)
  3436. #define ESC_USER_RAM_BYTE9_DR_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE9_DR_MASK) >> ESC_USER_RAM_BYTE9_DR_SHIFT)
  3437. /* Bitfield definition for register: USER_RAM_BYTE10 */
  3438. /*
  3439. * PDIIR (RW)
  3440. *
  3441. * PDI Information register (0x014E:0x014F)
  3442. */
  3443. #define ESC_USER_RAM_BYTE10_PDIIR_MASK (0x80U)
  3444. #define ESC_USER_RAM_BYTE10_PDIIR_SHIFT (7U)
  3445. #define ESC_USER_RAM_BYTE10_PDIIR_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE10_PDIIR_SHIFT) & ESC_USER_RAM_BYTE10_PDIIR_MASK)
  3446. #define ESC_USER_RAM_BYTE10_PDIIR_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE10_PDIIR_MASK) >> ESC_USER_RAM_BYTE10_PDIIR_SHIFT)
  3447. /*
  3448. * PDIFA (RW)
  3449. *
  3450. * PDI function acknowledge by PDI write
  3451. */
  3452. #define ESC_USER_RAM_BYTE10_PDIFA_MASK (0x40U)
  3453. #define ESC_USER_RAM_BYTE10_PDIFA_SHIFT (6U)
  3454. #define ESC_USER_RAM_BYTE10_PDIFA_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE10_PDIFA_SHIFT) & ESC_USER_RAM_BYTE10_PDIFA_MASK)
  3455. #define ESC_USER_RAM_BYTE10_PDIFA_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE10_PDIFA_MASK) >> ESC_USER_RAM_BYTE10_PDIFA_SHIFT)
  3456. /*
  3457. * APDI (RW)
  3458. *
  3459. * AXI PDI
  3460. */
  3461. #define ESC_USER_RAM_BYTE10_APDI_MASK (0x8U)
  3462. #define ESC_USER_RAM_BYTE10_APDI_SHIFT (3U)
  3463. #define ESC_USER_RAM_BYTE10_APDI_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE10_APDI_SHIFT) & ESC_USER_RAM_BYTE10_APDI_MASK)
  3464. #define ESC_USER_RAM_BYTE10_APDI_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE10_APDI_MASK) >> ESC_USER_RAM_BYTE10_APDI_SHIFT)
  3465. /*
  3466. * DCL1D (RW)
  3467. *
  3468. * DC Latch1 disable
  3469. */
  3470. #define ESC_USER_RAM_BYTE10_DCL1D_MASK (0x4U)
  3471. #define ESC_USER_RAM_BYTE10_DCL1D_SHIFT (2U)
  3472. #define ESC_USER_RAM_BYTE10_DCL1D_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE10_DCL1D_SHIFT) & ESC_USER_RAM_BYTE10_DCL1D_MASK)
  3473. #define ESC_USER_RAM_BYTE10_DCL1D_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE10_DCL1D_MASK) >> ESC_USER_RAM_BYTE10_DCL1D_SHIFT)
  3474. /* Bitfield definition for register: USER_RAM_BYTE11 */
  3475. /*
  3476. * LEDTST (RW)
  3477. *
  3478. * LED test
  3479. */
  3480. #define ESC_USER_RAM_BYTE11_LEDTST_MASK (0x8U)
  3481. #define ESC_USER_RAM_BYTE11_LEDTST_SHIFT (3U)
  3482. #define ESC_USER_RAM_BYTE11_LEDTST_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE11_LEDTST_SHIFT) & ESC_USER_RAM_BYTE11_LEDTST_MASK)
  3483. #define ESC_USER_RAM_BYTE11_LEDTST_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE11_LEDTST_MASK) >> ESC_USER_RAM_BYTE11_LEDTST_SHIFT)
  3484. /* Bitfield definition for register: USER_RAM_BYTE14 */
  3485. /*
  3486. * DIOBS (RW)
  3487. *
  3488. * Digital I/O PDI byte size
  3489. */
  3490. #define ESC_USER_RAM_BYTE14_DIOBS_MASK (0xC0U)
  3491. #define ESC_USER_RAM_BYTE14_DIOBS_SHIFT (6U)
  3492. #define ESC_USER_RAM_BYTE14_DIOBS_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE14_DIOBS_SHIFT) & ESC_USER_RAM_BYTE14_DIOBS_MASK)
  3493. #define ESC_USER_RAM_BYTE14_DIOBS_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE14_DIOBS_MASK) >> ESC_USER_RAM_BYTE14_DIOBS_SHIFT)
  3494. /* Bitfield definition for register: USER_RAM_BYTE15 */
  3495. /*
  3496. * AUCPDI (RW)
  3497. *
  3498. * Asynchronous µC PDI
  3499. */
  3500. #define ESC_USER_RAM_BYTE15_AUCPDI_MASK (0x10U)
  3501. #define ESC_USER_RAM_BYTE15_AUCPDI_SHIFT (4U)
  3502. #define ESC_USER_RAM_BYTE15_AUCPDI_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE15_AUCPDI_SHIFT) & ESC_USER_RAM_BYTE15_AUCPDI_MASK)
  3503. #define ESC_USER_RAM_BYTE15_AUCPDI_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE15_AUCPDI_MASK) >> ESC_USER_RAM_BYTE15_AUCPDI_SHIFT)
  3504. /*
  3505. * SSPDI (RW)
  3506. *
  3507. * SPI Slave PDI
  3508. */
  3509. #define ESC_USER_RAM_BYTE15_SSPDI_MASK (0x8U)
  3510. #define ESC_USER_RAM_BYTE15_SSPDI_SHIFT (3U)
  3511. #define ESC_USER_RAM_BYTE15_SSPDI_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE15_SSPDI_SHIFT) & ESC_USER_RAM_BYTE15_SSPDI_MASK)
  3512. #define ESC_USER_RAM_BYTE15_SSPDI_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE15_SSPDI_MASK) >> ESC_USER_RAM_BYTE15_SSPDI_SHIFT)
  3513. /*
  3514. * DIOPDI (RW)
  3515. *
  3516. * Digital I/O PDI
  3517. */
  3518. #define ESC_USER_RAM_BYTE15_DIOPDI_MASK (0x4U)
  3519. #define ESC_USER_RAM_BYTE15_DIOPDI_SHIFT (2U)
  3520. #define ESC_USER_RAM_BYTE15_DIOPDI_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE15_DIOPDI_SHIFT) & ESC_USER_RAM_BYTE15_DIOPDI_MASK)
  3521. #define ESC_USER_RAM_BYTE15_DIOPDI_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE15_DIOPDI_MASK) >> ESC_USER_RAM_BYTE15_DIOPDI_SHIFT)
  3522. /* Bitfield definition for register: USER_RAM_BYTE19 */
  3523. /*
  3524. * SCP (RW)
  3525. *
  3526. * Security CPLD protection
  3527. */
  3528. #define ESC_USER_RAM_BYTE19_SCP_MASK (0x40U)
  3529. #define ESC_USER_RAM_BYTE19_SCP_SHIFT (6U)
  3530. #define ESC_USER_RAM_BYTE19_SCP_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE19_SCP_SHIFT) & ESC_USER_RAM_BYTE19_SCP_MASK)
  3531. #define ESC_USER_RAM_BYTE19_SCP_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE19_SCP_MASK) >> ESC_USER_RAM_BYTE19_SCP_SHIFT)
  3532. /*
  3533. * RMII (RW)
  3534. *
  3535. * RMII
  3536. */
  3537. #define ESC_USER_RAM_BYTE19_RMII_MASK (0x20U)
  3538. #define ESC_USER_RAM_BYTE19_RMII_SHIFT (5U)
  3539. #define ESC_USER_RAM_BYTE19_RMII_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE19_RMII_SHIFT) & ESC_USER_RAM_BYTE19_RMII_MASK)
  3540. #define ESC_USER_RAM_BYTE19_RMII_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE19_RMII_MASK) >> ESC_USER_RAM_BYTE19_RMII_SHIFT)
  3541. /*
  3542. * URGP (RW)
  3543. *
  3544. * Use RGMII GTX_CLK phase shifted clock input
  3545. */
  3546. #define ESC_USER_RAM_BYTE19_URGP_MASK (0x10U)
  3547. #define ESC_USER_RAM_BYTE19_URGP_SHIFT (4U)
  3548. #define ESC_USER_RAM_BYTE19_URGP_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE19_URGP_SHIFT) & ESC_USER_RAM_BYTE19_URGP_MASK)
  3549. #define ESC_USER_RAM_BYTE19_URGP_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE19_URGP_MASK) >> ESC_USER_RAM_BYTE19_URGP_SHIFT)
  3550. /*
  3551. * CIA (RW)
  3552. *
  3553. * CLK_PDI_EXT is asynchronous
  3554. */
  3555. #define ESC_USER_RAM_BYTE19_CIA_MASK (0x4U)
  3556. #define ESC_USER_RAM_BYTE19_CIA_SHIFT (2U)
  3557. #define ESC_USER_RAM_BYTE19_CIA_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE19_CIA_SHIFT) & ESC_USER_RAM_BYTE19_CIA_MASK)
  3558. #define ESC_USER_RAM_BYTE19_CIA_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE19_CIA_MASK) >> ESC_USER_RAM_BYTE19_CIA_SHIFT)
  3559. /*
  3560. * IPARO (RW)
  3561. *
  3562. * Individual PHY address read out (0x0510[7:3])
  3563. */
  3564. #define ESC_USER_RAM_BYTE19_IPARO_MASK (0x2U)
  3565. #define ESC_USER_RAM_BYTE19_IPARO_SHIFT (1U)
  3566. #define ESC_USER_RAM_BYTE19_IPARO_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE19_IPARO_SHIFT) & ESC_USER_RAM_BYTE19_IPARO_MASK)
  3567. #define ESC_USER_RAM_BYTE19_IPARO_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE19_IPARO_MASK) >> ESC_USER_RAM_BYTE19_IPARO_SHIFT)
  3568. /*
  3569. * RGMII (RW)
  3570. *
  3571. * RGMII
  3572. */
  3573. #define ESC_USER_RAM_BYTE19_RGMII_MASK (0x1U)
  3574. #define ESC_USER_RAM_BYTE19_RGMII_SHIFT (0U)
  3575. #define ESC_USER_RAM_BYTE19_RGMII_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE19_RGMII_SHIFT) & ESC_USER_RAM_BYTE19_RGMII_MASK)
  3576. #define ESC_USER_RAM_BYTE19_RGMII_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE19_RGMII_MASK) >> ESC_USER_RAM_BYTE19_RGMII_SHIFT)
  3577. /* Bitfield definition for register: PDRAM */
  3578. /*
  3579. * DATA (RW)
  3580. *
  3581. * Input Data
  3582. */
  3583. #define ESC_PDRAM_DATA_MASK (0xFFFFFFFFUL)
  3584. #define ESC_PDRAM_DATA_SHIFT (0U)
  3585. #define ESC_PDRAM_DATA_SET(x) (((uint32_t)(x) << ESC_PDRAM_DATA_SHIFT) & ESC_PDRAM_DATA_MASK)
  3586. #define ESC_PDRAM_DATA_GET(x) (((uint32_t)(x) & ESC_PDRAM_DATA_MASK) >> ESC_PDRAM_DATA_SHIFT)
  3587. /* Bitfield definition for register: PDRAM_ALS */
  3588. /*
  3589. * DATA (RW)
  3590. *
  3591. */
  3592. #define ESC_PDRAM_ALS_DATA_MASK (0xFFFFFFFFUL)
  3593. #define ESC_PDRAM_ALS_DATA_SHIFT (0U)
  3594. #define ESC_PDRAM_ALS_DATA_SET(x) (((uint32_t)(x) << ESC_PDRAM_ALS_DATA_SHIFT) & ESC_PDRAM_ALS_DATA_MASK)
  3595. #define ESC_PDRAM_ALS_DATA_GET(x) (((uint32_t)(x) & ESC_PDRAM_ALS_DATA_MASK) >> ESC_PDRAM_ALS_DATA_SHIFT)
  3596. /* Bitfield definition for register: GPR_CFG0 */
  3597. /*
  3598. * CLK100_EN (RW)
  3599. *
  3600. */
  3601. #define ESC_GPR_CFG0_CLK100_EN_MASK (0x2000U)
  3602. #define ESC_GPR_CFG0_CLK100_EN_SHIFT (13U)
  3603. #define ESC_GPR_CFG0_CLK100_EN_SET(x) (((uint32_t)(x) << ESC_GPR_CFG0_CLK100_EN_SHIFT) & ESC_GPR_CFG0_CLK100_EN_MASK)
  3604. #define ESC_GPR_CFG0_CLK100_EN_GET(x) (((uint32_t)(x) & ESC_GPR_CFG0_CLK100_EN_MASK) >> ESC_GPR_CFG0_CLK100_EN_SHIFT)
  3605. /*
  3606. * EEPROM_EMU (RW)
  3607. *
  3608. * 1 is EEPROM emulation mode (default)
  3609. */
  3610. #define ESC_GPR_CFG0_EEPROM_EMU_MASK (0x1000U)
  3611. #define ESC_GPR_CFG0_EEPROM_EMU_SHIFT (12U)
  3612. #define ESC_GPR_CFG0_EEPROM_EMU_SET(x) (((uint32_t)(x) << ESC_GPR_CFG0_EEPROM_EMU_SHIFT) & ESC_GPR_CFG0_EEPROM_EMU_MASK)
  3613. #define ESC_GPR_CFG0_EEPROM_EMU_GET(x) (((uint32_t)(x) & ESC_GPR_CFG0_EEPROM_EMU_MASK) >> ESC_GPR_CFG0_EEPROM_EMU_SHIFT)
  3614. /*
  3615. * I2C_SCLK_EN (RW)
  3616. *
  3617. */
  3618. #define ESC_GPR_CFG0_I2C_SCLK_EN_MASK (0x8U)
  3619. #define ESC_GPR_CFG0_I2C_SCLK_EN_SHIFT (3U)
  3620. #define ESC_GPR_CFG0_I2C_SCLK_EN_SET(x) (((uint32_t)(x) << ESC_GPR_CFG0_I2C_SCLK_EN_SHIFT) & ESC_GPR_CFG0_I2C_SCLK_EN_MASK)
  3621. #define ESC_GPR_CFG0_I2C_SCLK_EN_GET(x) (((uint32_t)(x) & ESC_GPR_CFG0_I2C_SCLK_EN_MASK) >> ESC_GPR_CFG0_I2C_SCLK_EN_SHIFT)
  3622. /*
  3623. * PROM_SIZE (RW)
  3624. *
  3625. * Sets EEPROM size:
  3626. * 0:up to 16 kbit EEPROM
  3627. * 1:32 kbit-4Mbit EEPROM
  3628. */
  3629. #define ESC_GPR_CFG0_PROM_SIZE_MASK (0x1U)
  3630. #define ESC_GPR_CFG0_PROM_SIZE_SHIFT (0U)
  3631. #define ESC_GPR_CFG0_PROM_SIZE_SET(x) (((uint32_t)(x) << ESC_GPR_CFG0_PROM_SIZE_SHIFT) & ESC_GPR_CFG0_PROM_SIZE_MASK)
  3632. #define ESC_GPR_CFG0_PROM_SIZE_GET(x) (((uint32_t)(x) & ESC_GPR_CFG0_PROM_SIZE_MASK) >> ESC_GPR_CFG0_PROM_SIZE_SHIFT)
  3633. /* Bitfield definition for register: GPR_CFG1 */
  3634. /*
  3635. * SYNC1_IRQ_EN (RW)
  3636. *
  3637. */
  3638. #define ESC_GPR_CFG1_SYNC1_IRQ_EN_MASK (0x80000000UL)
  3639. #define ESC_GPR_CFG1_SYNC1_IRQ_EN_SHIFT (31U)
  3640. #define ESC_GPR_CFG1_SYNC1_IRQ_EN_SET(x) (((uint32_t)(x) << ESC_GPR_CFG1_SYNC1_IRQ_EN_SHIFT) & ESC_GPR_CFG1_SYNC1_IRQ_EN_MASK)
  3641. #define ESC_GPR_CFG1_SYNC1_IRQ_EN_GET(x) (((uint32_t)(x) & ESC_GPR_CFG1_SYNC1_IRQ_EN_MASK) >> ESC_GPR_CFG1_SYNC1_IRQ_EN_SHIFT)
  3642. /*
  3643. * SYNC0_IRQ_EN (RW)
  3644. *
  3645. */
  3646. #define ESC_GPR_CFG1_SYNC0_IRQ_EN_MASK (0x40000000UL)
  3647. #define ESC_GPR_CFG1_SYNC0_IRQ_EN_SHIFT (30U)
  3648. #define ESC_GPR_CFG1_SYNC0_IRQ_EN_SET(x) (((uint32_t)(x) << ESC_GPR_CFG1_SYNC0_IRQ_EN_SHIFT) & ESC_GPR_CFG1_SYNC0_IRQ_EN_MASK)
  3649. #define ESC_GPR_CFG1_SYNC0_IRQ_EN_GET(x) (((uint32_t)(x) & ESC_GPR_CFG1_SYNC0_IRQ_EN_MASK) >> ESC_GPR_CFG1_SYNC0_IRQ_EN_SHIFT)
  3650. /*
  3651. * RSTO_IRQ_EN (RW)
  3652. *
  3653. */
  3654. #define ESC_GPR_CFG1_RSTO_IRQ_EN_MASK (0x20000000UL)
  3655. #define ESC_GPR_CFG1_RSTO_IRQ_EN_SHIFT (29U)
  3656. #define ESC_GPR_CFG1_RSTO_IRQ_EN_SET(x) (((uint32_t)(x) << ESC_GPR_CFG1_RSTO_IRQ_EN_SHIFT) & ESC_GPR_CFG1_RSTO_IRQ_EN_MASK)
  3657. #define ESC_GPR_CFG1_RSTO_IRQ_EN_GET(x) (((uint32_t)(x) & ESC_GPR_CFG1_RSTO_IRQ_EN_MASK) >> ESC_GPR_CFG1_RSTO_IRQ_EN_SHIFT)
  3658. /*
  3659. * SYNC1_DMA_EN (RW)
  3660. *
  3661. */
  3662. #define ESC_GPR_CFG1_SYNC1_DMA_EN_MASK (0x2000U)
  3663. #define ESC_GPR_CFG1_SYNC1_DMA_EN_SHIFT (13U)
  3664. #define ESC_GPR_CFG1_SYNC1_DMA_EN_SET(x) (((uint32_t)(x) << ESC_GPR_CFG1_SYNC1_DMA_EN_SHIFT) & ESC_GPR_CFG1_SYNC1_DMA_EN_MASK)
  3665. #define ESC_GPR_CFG1_SYNC1_DMA_EN_GET(x) (((uint32_t)(x) & ESC_GPR_CFG1_SYNC1_DMA_EN_MASK) >> ESC_GPR_CFG1_SYNC1_DMA_EN_SHIFT)
  3666. /*
  3667. * SYNC0_DMA_EN (RW)
  3668. *
  3669. */
  3670. #define ESC_GPR_CFG1_SYNC0_DMA_EN_MASK (0x1000U)
  3671. #define ESC_GPR_CFG1_SYNC0_DMA_EN_SHIFT (12U)
  3672. #define ESC_GPR_CFG1_SYNC0_DMA_EN_SET(x) (((uint32_t)(x) << ESC_GPR_CFG1_SYNC0_DMA_EN_SHIFT) & ESC_GPR_CFG1_SYNC0_DMA_EN_MASK)
  3673. #define ESC_GPR_CFG1_SYNC0_DMA_EN_GET(x) (((uint32_t)(x) & ESC_GPR_CFG1_SYNC0_DMA_EN_MASK) >> ESC_GPR_CFG1_SYNC0_DMA_EN_SHIFT)
  3674. /*
  3675. * LATCH1_FROM_IO (RW)
  3676. *
  3677. * 0:from NTM
  3678. */
  3679. #define ESC_GPR_CFG1_LATCH1_FROM_IO_MASK (0x200U)
  3680. #define ESC_GPR_CFG1_LATCH1_FROM_IO_SHIFT (9U)
  3681. #define ESC_GPR_CFG1_LATCH1_FROM_IO_SET(x) (((uint32_t)(x) << ESC_GPR_CFG1_LATCH1_FROM_IO_SHIFT) & ESC_GPR_CFG1_LATCH1_FROM_IO_MASK)
  3682. #define ESC_GPR_CFG1_LATCH1_FROM_IO_GET(x) (((uint32_t)(x) & ESC_GPR_CFG1_LATCH1_FROM_IO_MASK) >> ESC_GPR_CFG1_LATCH1_FROM_IO_SHIFT)
  3683. /*
  3684. * LATCH0_FROM_IO (RW)
  3685. *
  3686. * 0:from TRIGGER_MUX
  3687. */
  3688. #define ESC_GPR_CFG1_LATCH0_FROM_IO_MASK (0x100U)
  3689. #define ESC_GPR_CFG1_LATCH0_FROM_IO_SHIFT (8U)
  3690. #define ESC_GPR_CFG1_LATCH0_FROM_IO_SET(x) (((uint32_t)(x) << ESC_GPR_CFG1_LATCH0_FROM_IO_SHIFT) & ESC_GPR_CFG1_LATCH0_FROM_IO_MASK)
  3691. #define ESC_GPR_CFG1_LATCH0_FROM_IO_GET(x) (((uint32_t)(x) & ESC_GPR_CFG1_LATCH0_FROM_IO_MASK) >> ESC_GPR_CFG1_LATCH0_FROM_IO_SHIFT)
  3692. /*
  3693. * RSTO_OVRD (RW)
  3694. *
  3695. */
  3696. #define ESC_GPR_CFG1_RSTO_OVRD_MASK (0x80U)
  3697. #define ESC_GPR_CFG1_RSTO_OVRD_SHIFT (7U)
  3698. #define ESC_GPR_CFG1_RSTO_OVRD_SET(x) (((uint32_t)(x) << ESC_GPR_CFG1_RSTO_OVRD_SHIFT) & ESC_GPR_CFG1_RSTO_OVRD_MASK)
  3699. #define ESC_GPR_CFG1_RSTO_OVRD_GET(x) (((uint32_t)(x) & ESC_GPR_CFG1_RSTO_OVRD_MASK) >> ESC_GPR_CFG1_RSTO_OVRD_SHIFT)
  3700. /*
  3701. * RSTO_OVRD_ENJ (RW)
  3702. *
  3703. */
  3704. #define ESC_GPR_CFG1_RSTO_OVRD_ENJ_MASK (0x40U)
  3705. #define ESC_GPR_CFG1_RSTO_OVRD_ENJ_SHIFT (6U)
  3706. #define ESC_GPR_CFG1_RSTO_OVRD_ENJ_SET(x) (((uint32_t)(x) << ESC_GPR_CFG1_RSTO_OVRD_ENJ_SHIFT) & ESC_GPR_CFG1_RSTO_OVRD_ENJ_MASK)
  3707. #define ESC_GPR_CFG1_RSTO_OVRD_ENJ_GET(x) (((uint32_t)(x) & ESC_GPR_CFG1_RSTO_OVRD_ENJ_MASK) >> ESC_GPR_CFG1_RSTO_OVRD_ENJ_SHIFT)
  3708. /* Bitfield definition for register: GPR_CFG2 */
  3709. /*
  3710. * NMII_LINK2_FROM_IO (RW)
  3711. *
  3712. */
  3713. #define ESC_GPR_CFG2_NMII_LINK2_FROM_IO_MASK (0x20000000UL)
  3714. #define ESC_GPR_CFG2_NMII_LINK2_FROM_IO_SHIFT (29U)
  3715. #define ESC_GPR_CFG2_NMII_LINK2_FROM_IO_SET(x) (((uint32_t)(x) << ESC_GPR_CFG2_NMII_LINK2_FROM_IO_SHIFT) & ESC_GPR_CFG2_NMII_LINK2_FROM_IO_MASK)
  3716. #define ESC_GPR_CFG2_NMII_LINK2_FROM_IO_GET(x) (((uint32_t)(x) & ESC_GPR_CFG2_NMII_LINK2_FROM_IO_MASK) >> ESC_GPR_CFG2_NMII_LINK2_FROM_IO_SHIFT)
  3717. /*
  3718. * NMII_LINK2_GPR (RW)
  3719. *
  3720. */
  3721. #define ESC_GPR_CFG2_NMII_LINK2_GPR_MASK (0x10000000UL)
  3722. #define ESC_GPR_CFG2_NMII_LINK2_GPR_SHIFT (28U)
  3723. #define ESC_GPR_CFG2_NMII_LINK2_GPR_SET(x) (((uint32_t)(x) << ESC_GPR_CFG2_NMII_LINK2_GPR_SHIFT) & ESC_GPR_CFG2_NMII_LINK2_GPR_MASK)
  3724. #define ESC_GPR_CFG2_NMII_LINK2_GPR_GET(x) (((uint32_t)(x) & ESC_GPR_CFG2_NMII_LINK2_GPR_MASK) >> ESC_GPR_CFG2_NMII_LINK2_GPR_SHIFT)
  3725. /*
  3726. * NMII_LINK1_FROM_IO (RW)
  3727. *
  3728. */
  3729. #define ESC_GPR_CFG2_NMII_LINK1_FROM_IO_MASK (0x2000000UL)
  3730. #define ESC_GPR_CFG2_NMII_LINK1_FROM_IO_SHIFT (25U)
  3731. #define ESC_GPR_CFG2_NMII_LINK1_FROM_IO_SET(x) (((uint32_t)(x) << ESC_GPR_CFG2_NMII_LINK1_FROM_IO_SHIFT) & ESC_GPR_CFG2_NMII_LINK1_FROM_IO_MASK)
  3732. #define ESC_GPR_CFG2_NMII_LINK1_FROM_IO_GET(x) (((uint32_t)(x) & ESC_GPR_CFG2_NMII_LINK1_FROM_IO_MASK) >> ESC_GPR_CFG2_NMII_LINK1_FROM_IO_SHIFT)
  3733. /*
  3734. * NMII_LINK1_GPR (RW)
  3735. *
  3736. */
  3737. #define ESC_GPR_CFG2_NMII_LINK1_GPR_MASK (0x1000000UL)
  3738. #define ESC_GPR_CFG2_NMII_LINK1_GPR_SHIFT (24U)
  3739. #define ESC_GPR_CFG2_NMII_LINK1_GPR_SET(x) (((uint32_t)(x) << ESC_GPR_CFG2_NMII_LINK1_GPR_SHIFT) & ESC_GPR_CFG2_NMII_LINK1_GPR_MASK)
  3740. #define ESC_GPR_CFG2_NMII_LINK1_GPR_GET(x) (((uint32_t)(x) & ESC_GPR_CFG2_NMII_LINK1_GPR_MASK) >> ESC_GPR_CFG2_NMII_LINK1_GPR_SHIFT)
  3741. /*
  3742. * NMII_LINK0_FROM_IO (RW)
  3743. *
  3744. */
  3745. #define ESC_GPR_CFG2_NMII_LINK0_FROM_IO_MASK (0x200000UL)
  3746. #define ESC_GPR_CFG2_NMII_LINK0_FROM_IO_SHIFT (21U)
  3747. #define ESC_GPR_CFG2_NMII_LINK0_FROM_IO_SET(x) (((uint32_t)(x) << ESC_GPR_CFG2_NMII_LINK0_FROM_IO_SHIFT) & ESC_GPR_CFG2_NMII_LINK0_FROM_IO_MASK)
  3748. #define ESC_GPR_CFG2_NMII_LINK0_FROM_IO_GET(x) (((uint32_t)(x) & ESC_GPR_CFG2_NMII_LINK0_FROM_IO_MASK) >> ESC_GPR_CFG2_NMII_LINK0_FROM_IO_SHIFT)
  3749. /*
  3750. * NMII_LINK0_GPR (RW)
  3751. *
  3752. */
  3753. #define ESC_GPR_CFG2_NMII_LINK0_GPR_MASK (0x100000UL)
  3754. #define ESC_GPR_CFG2_NMII_LINK0_GPR_SHIFT (20U)
  3755. #define ESC_GPR_CFG2_NMII_LINK0_GPR_SET(x) (((uint32_t)(x) << ESC_GPR_CFG2_NMII_LINK0_GPR_SHIFT) & ESC_GPR_CFG2_NMII_LINK0_GPR_MASK)
  3756. #define ESC_GPR_CFG2_NMII_LINK0_GPR_GET(x) (((uint32_t)(x) & ESC_GPR_CFG2_NMII_LINK0_GPR_MASK) >> ESC_GPR_CFG2_NMII_LINK0_GPR_SHIFT)
  3757. /* Bitfield definition for register: PHY_CFG0 */
  3758. /*
  3759. * MAC_SPEED (RW)
  3760. *
  3761. * 1:100M
  3762. */
  3763. #define ESC_PHY_CFG0_MAC_SPEED_MASK (0x40000000UL)
  3764. #define ESC_PHY_CFG0_MAC_SPEED_SHIFT (30U)
  3765. #define ESC_PHY_CFG0_MAC_SPEED_SET(x) (((uint32_t)(x) << ESC_PHY_CFG0_MAC_SPEED_SHIFT) & ESC_PHY_CFG0_MAC_SPEED_MASK)
  3766. #define ESC_PHY_CFG0_MAC_SPEED_GET(x) (((uint32_t)(x) & ESC_PHY_CFG0_MAC_SPEED_MASK) >> ESC_PHY_CFG0_MAC_SPEED_SHIFT)
  3767. /*
  3768. * PHY_OFFSET_VAL (RW)
  3769. *
  3770. */
  3771. #define ESC_PHY_CFG0_PHY_OFFSET_VAL_MASK (0x1F000000UL)
  3772. #define ESC_PHY_CFG0_PHY_OFFSET_VAL_SHIFT (24U)
  3773. #define ESC_PHY_CFG0_PHY_OFFSET_VAL_SET(x) (((uint32_t)(x) << ESC_PHY_CFG0_PHY_OFFSET_VAL_SHIFT) & ESC_PHY_CFG0_PHY_OFFSET_VAL_MASK)
  3774. #define ESC_PHY_CFG0_PHY_OFFSET_VAL_GET(x) (((uint32_t)(x) & ESC_PHY_CFG0_PHY_OFFSET_VAL_MASK) >> ESC_PHY_CFG0_PHY_OFFSET_VAL_SHIFT)
  3775. /*
  3776. * PORT2_RMII_EN (RW)
  3777. *
  3778. */
  3779. #define ESC_PHY_CFG0_PORT2_RMII_EN_MASK (0x800000UL)
  3780. #define ESC_PHY_CFG0_PORT2_RMII_EN_SHIFT (23U)
  3781. #define ESC_PHY_CFG0_PORT2_RMII_EN_SET(x) (((uint32_t)(x) << ESC_PHY_CFG0_PORT2_RMII_EN_SHIFT) & ESC_PHY_CFG0_PORT2_RMII_EN_MASK)
  3782. #define ESC_PHY_CFG0_PORT2_RMII_EN_GET(x) (((uint32_t)(x) & ESC_PHY_CFG0_PORT2_RMII_EN_MASK) >> ESC_PHY_CFG0_PORT2_RMII_EN_SHIFT)
  3783. /*
  3784. * PORT1_RMII_EN (RW)
  3785. *
  3786. */
  3787. #define ESC_PHY_CFG0_PORT1_RMII_EN_MASK (0x8000U)
  3788. #define ESC_PHY_CFG0_PORT1_RMII_EN_SHIFT (15U)
  3789. #define ESC_PHY_CFG0_PORT1_RMII_EN_SET(x) (((uint32_t)(x) << ESC_PHY_CFG0_PORT1_RMII_EN_SHIFT) & ESC_PHY_CFG0_PORT1_RMII_EN_MASK)
  3790. #define ESC_PHY_CFG0_PORT1_RMII_EN_GET(x) (((uint32_t)(x) & ESC_PHY_CFG0_PORT1_RMII_EN_MASK) >> ESC_PHY_CFG0_PORT1_RMII_EN_SHIFT)
  3791. /*
  3792. * PORT0_RMII_EN (RW)
  3793. *
  3794. */
  3795. #define ESC_PHY_CFG0_PORT0_RMII_EN_MASK (0x80U)
  3796. #define ESC_PHY_CFG0_PORT0_RMII_EN_SHIFT (7U)
  3797. #define ESC_PHY_CFG0_PORT0_RMII_EN_SET(x) (((uint32_t)(x) << ESC_PHY_CFG0_PORT0_RMII_EN_SHIFT) & ESC_PHY_CFG0_PORT0_RMII_EN_MASK)
  3798. #define ESC_PHY_CFG0_PORT0_RMII_EN_GET(x) (((uint32_t)(x) & ESC_PHY_CFG0_PORT0_RMII_EN_MASK) >> ESC_PHY_CFG0_PORT0_RMII_EN_SHIFT)
  3799. /* Bitfield definition for register: PHY_CFG1 */
  3800. /*
  3801. * RMII_REFCLK_SEL (RW)
  3802. *
  3803. * 0:use RXCK as 50M refclk. 1:use TXCK as 50M refclk
  3804. */
  3805. #define ESC_PHY_CFG1_RMII_REFCLK_SEL_MASK (0x700U)
  3806. #define ESC_PHY_CFG1_RMII_REFCLK_SEL_SHIFT (8U)
  3807. #define ESC_PHY_CFG1_RMII_REFCLK_SEL_SET(x) (((uint32_t)(x) << ESC_PHY_CFG1_RMII_REFCLK_SEL_SHIFT) & ESC_PHY_CFG1_RMII_REFCLK_SEL_MASK)
  3808. #define ESC_PHY_CFG1_RMII_REFCLK_SEL_GET(x) (((uint32_t)(x) & ESC_PHY_CFG1_RMII_REFCLK_SEL_MASK) >> ESC_PHY_CFG1_RMII_REFCLK_SEL_SHIFT)
  3809. /*
  3810. * REFCK_25M_INV (RW)
  3811. *
  3812. */
  3813. #define ESC_PHY_CFG1_REFCK_25M_INV_MASK (0x80U)
  3814. #define ESC_PHY_CFG1_REFCK_25M_INV_SHIFT (7U)
  3815. #define ESC_PHY_CFG1_REFCK_25M_INV_SET(x) (((uint32_t)(x) << ESC_PHY_CFG1_REFCK_25M_INV_SHIFT) & ESC_PHY_CFG1_REFCK_25M_INV_MASK)
  3816. #define ESC_PHY_CFG1_REFCK_25M_INV_GET(x) (((uint32_t)(x) & ESC_PHY_CFG1_REFCK_25M_INV_MASK) >> ESC_PHY_CFG1_REFCK_25M_INV_SHIFT)
  3817. /*
  3818. * RMII_P2_TXCK_REFCLK_OE (RW)
  3819. *
  3820. */
  3821. #define ESC_PHY_CFG1_RMII_P2_TXCK_REFCLK_OE_MASK (0x40U)
  3822. #define ESC_PHY_CFG1_RMII_P2_TXCK_REFCLK_OE_SHIFT (6U)
  3823. #define ESC_PHY_CFG1_RMII_P2_TXCK_REFCLK_OE_SET(x) (((uint32_t)(x) << ESC_PHY_CFG1_RMII_P2_TXCK_REFCLK_OE_SHIFT) & ESC_PHY_CFG1_RMII_P2_TXCK_REFCLK_OE_MASK)
  3824. #define ESC_PHY_CFG1_RMII_P2_TXCK_REFCLK_OE_GET(x) (((uint32_t)(x) & ESC_PHY_CFG1_RMII_P2_TXCK_REFCLK_OE_MASK) >> ESC_PHY_CFG1_RMII_P2_TXCK_REFCLK_OE_SHIFT)
  3825. /*
  3826. * RMII_P1_TXCK_REFCLK_OE (RW)
  3827. *
  3828. */
  3829. #define ESC_PHY_CFG1_RMII_P1_TXCK_REFCLK_OE_MASK (0x20U)
  3830. #define ESC_PHY_CFG1_RMII_P1_TXCK_REFCLK_OE_SHIFT (5U)
  3831. #define ESC_PHY_CFG1_RMII_P1_TXCK_REFCLK_OE_SET(x) (((uint32_t)(x) << ESC_PHY_CFG1_RMII_P1_TXCK_REFCLK_OE_SHIFT) & ESC_PHY_CFG1_RMII_P1_TXCK_REFCLK_OE_MASK)
  3832. #define ESC_PHY_CFG1_RMII_P1_TXCK_REFCLK_OE_GET(x) (((uint32_t)(x) & ESC_PHY_CFG1_RMII_P1_TXCK_REFCLK_OE_MASK) >> ESC_PHY_CFG1_RMII_P1_TXCK_REFCLK_OE_SHIFT)
  3833. /*
  3834. * RMII_P0_TXCK_REFCLK_OE (RW)
  3835. *
  3836. */
  3837. #define ESC_PHY_CFG1_RMII_P0_TXCK_REFCLK_OE_MASK (0x10U)
  3838. #define ESC_PHY_CFG1_RMII_P0_TXCK_REFCLK_OE_SHIFT (4U)
  3839. #define ESC_PHY_CFG1_RMII_P0_TXCK_REFCLK_OE_SET(x) (((uint32_t)(x) << ESC_PHY_CFG1_RMII_P0_TXCK_REFCLK_OE_SHIFT) & ESC_PHY_CFG1_RMII_P0_TXCK_REFCLK_OE_MASK)
  3840. #define ESC_PHY_CFG1_RMII_P0_TXCK_REFCLK_OE_GET(x) (((uint32_t)(x) & ESC_PHY_CFG1_RMII_P0_TXCK_REFCLK_OE_MASK) >> ESC_PHY_CFG1_RMII_P0_TXCK_REFCLK_OE_SHIFT)
  3841. /*
  3842. * REFCK_25M_OE (RW)
  3843. *
  3844. */
  3845. #define ESC_PHY_CFG1_REFCK_25M_OE_MASK (0x8U)
  3846. #define ESC_PHY_CFG1_REFCK_25M_OE_SHIFT (3U)
  3847. #define ESC_PHY_CFG1_REFCK_25M_OE_SET(x) (((uint32_t)(x) << ESC_PHY_CFG1_REFCK_25M_OE_SHIFT) & ESC_PHY_CFG1_REFCK_25M_OE_MASK)
  3848. #define ESC_PHY_CFG1_REFCK_25M_OE_GET(x) (((uint32_t)(x) & ESC_PHY_CFG1_REFCK_25M_OE_MASK) >> ESC_PHY_CFG1_REFCK_25M_OE_SHIFT)
  3849. /*
  3850. * RMII_P2_RXCK_REFCLK_OE (RW)
  3851. *
  3852. */
  3853. #define ESC_PHY_CFG1_RMII_P2_RXCK_REFCLK_OE_MASK (0x4U)
  3854. #define ESC_PHY_CFG1_RMII_P2_RXCK_REFCLK_OE_SHIFT (2U)
  3855. #define ESC_PHY_CFG1_RMII_P2_RXCK_REFCLK_OE_SET(x) (((uint32_t)(x) << ESC_PHY_CFG1_RMII_P2_RXCK_REFCLK_OE_SHIFT) & ESC_PHY_CFG1_RMII_P2_RXCK_REFCLK_OE_MASK)
  3856. #define ESC_PHY_CFG1_RMII_P2_RXCK_REFCLK_OE_GET(x) (((uint32_t)(x) & ESC_PHY_CFG1_RMII_P2_RXCK_REFCLK_OE_MASK) >> ESC_PHY_CFG1_RMII_P2_RXCK_REFCLK_OE_SHIFT)
  3857. /*
  3858. * RMII_P1_RXCK_REFCLK_OE (RW)
  3859. *
  3860. */
  3861. #define ESC_PHY_CFG1_RMII_P1_RXCK_REFCLK_OE_MASK (0x2U)
  3862. #define ESC_PHY_CFG1_RMII_P1_RXCK_REFCLK_OE_SHIFT (1U)
  3863. #define ESC_PHY_CFG1_RMII_P1_RXCK_REFCLK_OE_SET(x) (((uint32_t)(x) << ESC_PHY_CFG1_RMII_P1_RXCK_REFCLK_OE_SHIFT) & ESC_PHY_CFG1_RMII_P1_RXCK_REFCLK_OE_MASK)
  3864. #define ESC_PHY_CFG1_RMII_P1_RXCK_REFCLK_OE_GET(x) (((uint32_t)(x) & ESC_PHY_CFG1_RMII_P1_RXCK_REFCLK_OE_MASK) >> ESC_PHY_CFG1_RMII_P1_RXCK_REFCLK_OE_SHIFT)
  3865. /*
  3866. * RMII_P0_RXCK_REFCLK_OE (RW)
  3867. *
  3868. */
  3869. #define ESC_PHY_CFG1_RMII_P0_RXCK_REFCLK_OE_MASK (0x1U)
  3870. #define ESC_PHY_CFG1_RMII_P0_RXCK_REFCLK_OE_SHIFT (0U)
  3871. #define ESC_PHY_CFG1_RMII_P0_RXCK_REFCLK_OE_SET(x) (((uint32_t)(x) << ESC_PHY_CFG1_RMII_P0_RXCK_REFCLK_OE_SHIFT) & ESC_PHY_CFG1_RMII_P0_RXCK_REFCLK_OE_MASK)
  3872. #define ESC_PHY_CFG1_RMII_P0_RXCK_REFCLK_OE_GET(x) (((uint32_t)(x) & ESC_PHY_CFG1_RMII_P0_RXCK_REFCLK_OE_MASK) >> ESC_PHY_CFG1_RMII_P0_RXCK_REFCLK_OE_SHIFT)
  3873. /* Bitfield definition for register: GPIO_CTRL */
  3874. /*
  3875. * SW_LATCH_GPI (WO)
  3876. *
  3877. * if gpi_trig_sel is set to 4'b1001, setting this bit will latch GPI to gpi_reg0/1
  3878. */
  3879. #define ESC_GPIO_CTRL_SW_LATCH_GPI_MASK (0x80000000UL)
  3880. #define ESC_GPIO_CTRL_SW_LATCH_GPI_SHIFT (31U)
  3881. #define ESC_GPIO_CTRL_SW_LATCH_GPI_SET(x) (((uint32_t)(x) << ESC_GPIO_CTRL_SW_LATCH_GPI_SHIFT) & ESC_GPIO_CTRL_SW_LATCH_GPI_MASK)
  3882. #define ESC_GPIO_CTRL_SW_LATCH_GPI_GET(x) (((uint32_t)(x) & ESC_GPIO_CTRL_SW_LATCH_GPI_MASK) >> ESC_GPIO_CTRL_SW_LATCH_GPI_SHIFT)
  3883. /*
  3884. * SW_LATCH_GPO (WO)
  3885. *
  3886. * if gpo_trig_sel is set to 4'b1001, setting this bit will latch GPO to gpo_reg0/1
  3887. */
  3888. #define ESC_GPIO_CTRL_SW_LATCH_GPO_MASK (0x40000000UL)
  3889. #define ESC_GPIO_CTRL_SW_LATCH_GPO_SHIFT (30U)
  3890. #define ESC_GPIO_CTRL_SW_LATCH_GPO_SET(x) (((uint32_t)(x) << ESC_GPIO_CTRL_SW_LATCH_GPO_SHIFT) & ESC_GPIO_CTRL_SW_LATCH_GPO_MASK)
  3891. #define ESC_GPIO_CTRL_SW_LATCH_GPO_GET(x) (((uint32_t)(x) & ESC_GPIO_CTRL_SW_LATCH_GPO_MASK) >> ESC_GPIO_CTRL_SW_LATCH_GPO_SHIFT)
  3892. /*
  3893. * GPI_OVERRIDE_EN (RW)
  3894. *
  3895. * set this bit will use GPI from the software register gpi_override0/1
  3896. * clr to use GPI from pad directly
  3897. */
  3898. #define ESC_GPIO_CTRL_GPI_OVERRIDE_EN_MASK (0x2000U)
  3899. #define ESC_GPIO_CTRL_GPI_OVERRIDE_EN_SHIFT (13U)
  3900. #define ESC_GPIO_CTRL_GPI_OVERRIDE_EN_SET(x) (((uint32_t)(x) << ESC_GPIO_CTRL_GPI_OVERRIDE_EN_SHIFT) & ESC_GPIO_CTRL_GPI_OVERRIDE_EN_MASK)
  3901. #define ESC_GPIO_CTRL_GPI_OVERRIDE_EN_GET(x) (((uint32_t)(x) & ESC_GPIO_CTRL_GPI_OVERRIDE_EN_MASK) >> ESC_GPIO_CTRL_GPI_OVERRIDE_EN_SHIFT)
  3902. /*
  3903. * GPI_TRIG_EN (RW)
  3904. *
  3905. * use gpi_trig_sel can select the trigger event to latch GPI signal(from reg or pad)
  3906. * set to use triggered signal;
  3907. * clr to use signals direclty(from reg or pad)
  3908. * assign pdi_gpi = gpi_trig_en ? gpi_reg :
  3909. * (gpi_override_en ? gpi_override :pad_di_ecat_gpi);
  3910. */
  3911. #define ESC_GPIO_CTRL_GPI_TRIG_EN_MASK (0x1000U)
  3912. #define ESC_GPIO_CTRL_GPI_TRIG_EN_SHIFT (12U)
  3913. #define ESC_GPIO_CTRL_GPI_TRIG_EN_SET(x) (((uint32_t)(x) << ESC_GPIO_CTRL_GPI_TRIG_EN_SHIFT) & ESC_GPIO_CTRL_GPI_TRIG_EN_MASK)
  3914. #define ESC_GPIO_CTRL_GPI_TRIG_EN_GET(x) (((uint32_t)(x) & ESC_GPIO_CTRL_GPI_TRIG_EN_MASK) >> ESC_GPIO_CTRL_GPI_TRIG_EN_SHIFT)
  3915. /*
  3916. * GPI_TRIG_SEL (RW)
  3917. *
  3918. * select the trigger signal to latch GPI.
  3919. * 0000: SOF; 0001: EOF; 0010: pos of SYNC0; 0011: pos of SYNC1;
  3920. * 0100: pos of LATCH0; 0101: pos of LATCH1; 0110: neg of LATCH0; 0111: neg of LATCH1
  3921. * 1000: wdog trigger; 1001: sw set gpio_ctrl[31];
  3922. * others no trigger
  3923. */
  3924. #define ESC_GPIO_CTRL_GPI_TRIG_SEL_MASK (0xF00U)
  3925. #define ESC_GPIO_CTRL_GPI_TRIG_SEL_SHIFT (8U)
  3926. #define ESC_GPIO_CTRL_GPI_TRIG_SEL_SET(x) (((uint32_t)(x) << ESC_GPIO_CTRL_GPI_TRIG_SEL_SHIFT) & ESC_GPIO_CTRL_GPI_TRIG_SEL_MASK)
  3927. #define ESC_GPIO_CTRL_GPI_TRIG_SEL_GET(x) (((uint32_t)(x) & ESC_GPIO_CTRL_GPI_TRIG_SEL_MASK) >> ESC_GPIO_CTRL_GPI_TRIG_SEL_SHIFT)
  3928. /*
  3929. * GPO_TRIG_EN (RW)
  3930. *
  3931. * use gpo_trig_sel can select the trigger event to latch GPO signal(from core)
  3932. * set to use triggered signal;
  3933. * clr to use GPO signals direclty(from reg or pad)
  3934. */
  3935. #define ESC_GPIO_CTRL_GPO_TRIG_EN_MASK (0x10U)
  3936. #define ESC_GPIO_CTRL_GPO_TRIG_EN_SHIFT (4U)
  3937. #define ESC_GPIO_CTRL_GPO_TRIG_EN_SET(x) (((uint32_t)(x) << ESC_GPIO_CTRL_GPO_TRIG_EN_SHIFT) & ESC_GPIO_CTRL_GPO_TRIG_EN_MASK)
  3938. #define ESC_GPIO_CTRL_GPO_TRIG_EN_GET(x) (((uint32_t)(x) & ESC_GPIO_CTRL_GPO_TRIG_EN_MASK) >> ESC_GPIO_CTRL_GPO_TRIG_EN_SHIFT)
  3939. /*
  3940. * GPO_TRIG_SEL (RW)
  3941. *
  3942. * select the trigger signal to latch GPO.
  3943. * 0000: SOF; 0001: EOF; 0010: pos of SYNC0; 0011: pos of SYNC1;
  3944. * 0100: pos of LATCH0; 0101: pos of LATCH1; 0110: neg of LATCH0; 0111: neg of LATCH1
  3945. * 1000: wdog trigger; 1001: sw set gpio_ctrl[30];
  3946. * others no trigger
  3947. */
  3948. #define ESC_GPIO_CTRL_GPO_TRIG_SEL_MASK (0xFU)
  3949. #define ESC_GPIO_CTRL_GPO_TRIG_SEL_SHIFT (0U)
  3950. #define ESC_GPIO_CTRL_GPO_TRIG_SEL_SET(x) (((uint32_t)(x) << ESC_GPIO_CTRL_GPO_TRIG_SEL_SHIFT) & ESC_GPIO_CTRL_GPO_TRIG_SEL_MASK)
  3951. #define ESC_GPIO_CTRL_GPO_TRIG_SEL_GET(x) (((uint32_t)(x) & ESC_GPIO_CTRL_GPO_TRIG_SEL_MASK) >> ESC_GPIO_CTRL_GPO_TRIG_SEL_SHIFT)
  3952. /* Bitfield definition for register: GPI_OVERRIDE0 */
  3953. /*
  3954. * GPR_OVERRIDE_LOW (RW)
  3955. *
  3956. */
  3957. #define ESC_GPI_OVERRIDE0_GPR_OVERRIDE_LOW_MASK (0xFFFFFFFFUL)
  3958. #define ESC_GPI_OVERRIDE0_GPR_OVERRIDE_LOW_SHIFT (0U)
  3959. #define ESC_GPI_OVERRIDE0_GPR_OVERRIDE_LOW_SET(x) (((uint32_t)(x) << ESC_GPI_OVERRIDE0_GPR_OVERRIDE_LOW_SHIFT) & ESC_GPI_OVERRIDE0_GPR_OVERRIDE_LOW_MASK)
  3960. #define ESC_GPI_OVERRIDE0_GPR_OVERRIDE_LOW_GET(x) (((uint32_t)(x) & ESC_GPI_OVERRIDE0_GPR_OVERRIDE_LOW_MASK) >> ESC_GPI_OVERRIDE0_GPR_OVERRIDE_LOW_SHIFT)
  3961. /* Bitfield definition for register: GPI_OVERRIDE1 */
  3962. /*
  3963. * GPR_OVERRIDE_HIGH (RW)
  3964. *
  3965. */
  3966. #define ESC_GPI_OVERRIDE1_GPR_OVERRIDE_HIGH_MASK (0xFFFFFFFFUL)
  3967. #define ESC_GPI_OVERRIDE1_GPR_OVERRIDE_HIGH_SHIFT (0U)
  3968. #define ESC_GPI_OVERRIDE1_GPR_OVERRIDE_HIGH_SET(x) (((uint32_t)(x) << ESC_GPI_OVERRIDE1_GPR_OVERRIDE_HIGH_SHIFT) & ESC_GPI_OVERRIDE1_GPR_OVERRIDE_HIGH_MASK)
  3969. #define ESC_GPI_OVERRIDE1_GPR_OVERRIDE_HIGH_GET(x) (((uint32_t)(x) & ESC_GPI_OVERRIDE1_GPR_OVERRIDE_HIGH_MASK) >> ESC_GPI_OVERRIDE1_GPR_OVERRIDE_HIGH_SHIFT)
  3970. /* Bitfield definition for register: GPO_REG0 */
  3971. /*
  3972. * VALUE (RO)
  3973. *
  3974. */
  3975. #define ESC_GPO_REG0_VALUE_MASK (0xFFFFFFFFUL)
  3976. #define ESC_GPO_REG0_VALUE_SHIFT (0U)
  3977. #define ESC_GPO_REG0_VALUE_GET(x) (((uint32_t)(x) & ESC_GPO_REG0_VALUE_MASK) >> ESC_GPO_REG0_VALUE_SHIFT)
  3978. /* Bitfield definition for register: GPO_REG1 */
  3979. /*
  3980. * VALUE (RO)
  3981. *
  3982. */
  3983. #define ESC_GPO_REG1_VALUE_MASK (0xFFFFFFFFUL)
  3984. #define ESC_GPO_REG1_VALUE_SHIFT (0U)
  3985. #define ESC_GPO_REG1_VALUE_GET(x) (((uint32_t)(x) & ESC_GPO_REG1_VALUE_MASK) >> ESC_GPO_REG1_VALUE_SHIFT)
  3986. /* Bitfield definition for register: GPI_REG0 */
  3987. /*
  3988. * VALUE (RO)
  3989. *
  3990. */
  3991. #define ESC_GPI_REG0_VALUE_MASK (0xFFFFFFFFUL)
  3992. #define ESC_GPI_REG0_VALUE_SHIFT (0U)
  3993. #define ESC_GPI_REG0_VALUE_GET(x) (((uint32_t)(x) & ESC_GPI_REG0_VALUE_MASK) >> ESC_GPI_REG0_VALUE_SHIFT)
  3994. /* Bitfield definition for register: GPI_REG1 */
  3995. /*
  3996. * VALUE (RO)
  3997. *
  3998. */
  3999. #define ESC_GPI_REG1_VALUE_MASK (0xFFFFFFFFUL)
  4000. #define ESC_GPI_REG1_VALUE_SHIFT (0U)
  4001. #define ESC_GPI_REG1_VALUE_GET(x) (((uint32_t)(x) & ESC_GPI_REG1_VALUE_MASK) >> ESC_GPI_REG1_VALUE_SHIFT)
  4002. /* Bitfield definition for register: GPR_STATUS */
  4003. /*
  4004. * NLINK2_PADSEL (RO)
  4005. *
  4006. */
  4007. #define ESC_GPR_STATUS_NLINK2_PADSEL_MASK (0xF0000000UL)
  4008. #define ESC_GPR_STATUS_NLINK2_PADSEL_SHIFT (28U)
  4009. #define ESC_GPR_STATUS_NLINK2_PADSEL_GET(x) (((uint32_t)(x) & ESC_GPR_STATUS_NLINK2_PADSEL_MASK) >> ESC_GPR_STATUS_NLINK2_PADSEL_SHIFT)
  4010. /*
  4011. * NLINK1_PADSEL (RO)
  4012. *
  4013. */
  4014. #define ESC_GPR_STATUS_NLINK1_PADSEL_MASK (0xF000000UL)
  4015. #define ESC_GPR_STATUS_NLINK1_PADSEL_SHIFT (24U)
  4016. #define ESC_GPR_STATUS_NLINK1_PADSEL_GET(x) (((uint32_t)(x) & ESC_GPR_STATUS_NLINK1_PADSEL_MASK) >> ESC_GPR_STATUS_NLINK1_PADSEL_SHIFT)
  4017. /*
  4018. * NLINK0_PADSEL (RO)
  4019. *
  4020. */
  4021. #define ESC_GPR_STATUS_NLINK0_PADSEL_MASK (0xF00000UL)
  4022. #define ESC_GPR_STATUS_NLINK0_PADSEL_SHIFT (20U)
  4023. #define ESC_GPR_STATUS_NLINK0_PADSEL_GET(x) (((uint32_t)(x) & ESC_GPR_STATUS_NLINK0_PADSEL_MASK) >> ESC_GPR_STATUS_NLINK0_PADSEL_SHIFT)
  4024. /*
  4025. * PDI_SOF (RO)
  4026. *
  4027. */
  4028. #define ESC_GPR_STATUS_PDI_SOF_MASK (0x80000UL)
  4029. #define ESC_GPR_STATUS_PDI_SOF_SHIFT (19U)
  4030. #define ESC_GPR_STATUS_PDI_SOF_GET(x) (((uint32_t)(x) & ESC_GPR_STATUS_PDI_SOF_MASK) >> ESC_GPR_STATUS_PDI_SOF_SHIFT)
  4031. /*
  4032. * PDI_EOF (RO)
  4033. *
  4034. */
  4035. #define ESC_GPR_STATUS_PDI_EOF_MASK (0x40000UL)
  4036. #define ESC_GPR_STATUS_PDI_EOF_SHIFT (18U)
  4037. #define ESC_GPR_STATUS_PDI_EOF_GET(x) (((uint32_t)(x) & ESC_GPR_STATUS_PDI_EOF_MASK) >> ESC_GPR_STATUS_PDI_EOF_SHIFT)
  4038. /*
  4039. * PDI_WD_TRIGGER (RO)
  4040. *
  4041. */
  4042. #define ESC_GPR_STATUS_PDI_WD_TRIGGER_MASK (0x20000UL)
  4043. #define ESC_GPR_STATUS_PDI_WD_TRIGGER_SHIFT (17U)
  4044. #define ESC_GPR_STATUS_PDI_WD_TRIGGER_GET(x) (((uint32_t)(x) & ESC_GPR_STATUS_PDI_WD_TRIGGER_MASK) >> ESC_GPR_STATUS_PDI_WD_TRIGGER_SHIFT)
  4045. /*
  4046. * PDI_WD_STATE (RO)
  4047. *
  4048. */
  4049. #define ESC_GPR_STATUS_PDI_WD_STATE_MASK (0x10000UL)
  4050. #define ESC_GPR_STATUS_PDI_WD_STATE_SHIFT (16U)
  4051. #define ESC_GPR_STATUS_PDI_WD_STATE_GET(x) (((uint32_t)(x) & ESC_GPR_STATUS_PDI_WD_STATE_MASK) >> ESC_GPR_STATUS_PDI_WD_STATE_SHIFT)
  4052. /*
  4053. * SYNC_OUT1 (RO)
  4054. *
  4055. */
  4056. #define ESC_GPR_STATUS_SYNC_OUT1_MASK (0x200U)
  4057. #define ESC_GPR_STATUS_SYNC_OUT1_SHIFT (9U)
  4058. #define ESC_GPR_STATUS_SYNC_OUT1_GET(x) (((uint32_t)(x) & ESC_GPR_STATUS_SYNC_OUT1_MASK) >> ESC_GPR_STATUS_SYNC_OUT1_SHIFT)
  4059. /*
  4060. * SYNC_OUT0 (RO)
  4061. *
  4062. */
  4063. #define ESC_GPR_STATUS_SYNC_OUT0_MASK (0x100U)
  4064. #define ESC_GPR_STATUS_SYNC_OUT0_SHIFT (8U)
  4065. #define ESC_GPR_STATUS_SYNC_OUT0_GET(x) (((uint32_t)(x) & ESC_GPR_STATUS_SYNC_OUT0_MASK) >> ESC_GPR_STATUS_SYNC_OUT0_SHIFT)
  4066. /*
  4067. * LED_STATE_RUN (RO)
  4068. *
  4069. */
  4070. #define ESC_GPR_STATUS_LED_STATE_RUN_MASK (0x40U)
  4071. #define ESC_GPR_STATUS_LED_STATE_RUN_SHIFT (6U)
  4072. #define ESC_GPR_STATUS_LED_STATE_RUN_GET(x) (((uint32_t)(x) & ESC_GPR_STATUS_LED_STATE_RUN_MASK) >> ESC_GPR_STATUS_LED_STATE_RUN_SHIFT)
  4073. /*
  4074. * LED_ERR (RO)
  4075. *
  4076. */
  4077. #define ESC_GPR_STATUS_LED_ERR_MASK (0x20U)
  4078. #define ESC_GPR_STATUS_LED_ERR_SHIFT (5U)
  4079. #define ESC_GPR_STATUS_LED_ERR_GET(x) (((uint32_t)(x) & ESC_GPR_STATUS_LED_ERR_MASK) >> ESC_GPR_STATUS_LED_ERR_SHIFT)
  4080. /*
  4081. * LED_RUN (RO)
  4082. *
  4083. */
  4084. #define ESC_GPR_STATUS_LED_RUN_MASK (0x10U)
  4085. #define ESC_GPR_STATUS_LED_RUN_SHIFT (4U)
  4086. #define ESC_GPR_STATUS_LED_RUN_GET(x) (((uint32_t)(x) & ESC_GPR_STATUS_LED_RUN_MASK) >> ESC_GPR_STATUS_LED_RUN_SHIFT)
  4087. /*
  4088. * DEV_STATE (RO)
  4089. *
  4090. */
  4091. #define ESC_GPR_STATUS_DEV_STATE_MASK (0x8U)
  4092. #define ESC_GPR_STATUS_DEV_STATE_SHIFT (3U)
  4093. #define ESC_GPR_STATUS_DEV_STATE_GET(x) (((uint32_t)(x) & ESC_GPR_STATUS_DEV_STATE_MASK) >> ESC_GPR_STATUS_DEV_STATE_SHIFT)
  4094. /*
  4095. * LINK_ACT (RO)
  4096. *
  4097. */
  4098. #define ESC_GPR_STATUS_LINK_ACT_MASK (0x7U)
  4099. #define ESC_GPR_STATUS_LINK_ACT_SHIFT (0U)
  4100. #define ESC_GPR_STATUS_LINK_ACT_GET(x) (((uint32_t)(x) & ESC_GPR_STATUS_LINK_ACT_MASK) >> ESC_GPR_STATUS_LINK_ACT_SHIFT)
  4101. /* Bitfield definition for register array: IO_CFG */
  4102. /*
  4103. * INVERT (RW)
  4104. *
  4105. * 1:invert the IO
  4106. */
  4107. #define ESC_IO_CFG_INVERT_MASK (0x10U)
  4108. #define ESC_IO_CFG_INVERT_SHIFT (4U)
  4109. #define ESC_IO_CFG_INVERT_SET(x) (((uint32_t)(x) << ESC_IO_CFG_INVERT_SHIFT) & ESC_IO_CFG_INVERT_MASK)
  4110. #define ESC_IO_CFG_INVERT_GET(x) (((uint32_t)(x) & ESC_IO_CFG_INVERT_MASK) >> ESC_IO_CFG_INVERT_SHIFT)
  4111. /*
  4112. * FUNC_ALT (RW)
  4113. *
  4114. * IO usage:
  4115. * 0:NMII_LINK0
  4116. * 1:NMII_LINK1
  4117. * 2:NMII_LINK2
  4118. * 3:LINK_ACT0
  4119. * 4:LINK_ACT1
  4120. * 5:LINK_ACT2
  4121. * 6:LED_RUN
  4122. * 7:LED_ERR
  4123. * 8:RESET_OUT
  4124. */
  4125. #define ESC_IO_CFG_FUNC_ALT_MASK (0xFU)
  4126. #define ESC_IO_CFG_FUNC_ALT_SHIFT (0U)
  4127. #define ESC_IO_CFG_FUNC_ALT_SET(x) (((uint32_t)(x) << ESC_IO_CFG_FUNC_ALT_SHIFT) & ESC_IO_CFG_FUNC_ALT_MASK)
  4128. #define ESC_IO_CFG_FUNC_ALT_GET(x) (((uint32_t)(x) & ESC_IO_CFG_FUNC_ALT_MASK) >> ESC_IO_CFG_FUNC_ALT_SHIFT)
  4129. /* RX_ERR_CNT register group index macro definition */
  4130. #define ESC_RX_ERR_CNT_PORT0 (0UL)
  4131. #define ESC_RX_ERR_CNT_PORT1 (1UL)
  4132. #define ESC_RX_ERR_CNT_PORT2 (2UL)
  4133. #define ESC_RX_ERR_CNT_PORT3 (3UL)
  4134. /* FWD_RX_ERR_CNT register group index macro definition */
  4135. #define ESC_FWD_RX_ERR_CNT_PORT0 (0UL)
  4136. #define ESC_FWD_RX_ERR_CNT_PORT1 (1UL)
  4137. #define ESC_FWD_RX_ERR_CNT_PORT2 (2UL)
  4138. #define ESC_FWD_RX_ERR_CNT_PORT3 (3UL)
  4139. /* LOST_LINK_CNT register group index macro definition */
  4140. #define ESC_LOST_LINK_CNT_PORT0 (0UL)
  4141. #define ESC_LOST_LINK_CNT_PORT1 (1UL)
  4142. #define ESC_LOST_LINK_CNT_PORT2 (2UL)
  4143. #define ESC_LOST_LINK_CNT_PORT3 (3UL)
  4144. /* PHY_STAT register group index macro definition */
  4145. #define ESC_PHY_STAT_PORT0 (0UL)
  4146. #define ESC_PHY_STAT_PORT1 (1UL)
  4147. #define ESC_PHY_STAT_PORT2 (2UL)
  4148. #define ESC_PHY_STAT_PORT3 (3UL)
  4149. /* FMMU register group index macro definition */
  4150. #define ESC_FMMU_0 (0UL)
  4151. #define ESC_FMMU_1 (1UL)
  4152. #define ESC_FMMU_2 (2UL)
  4153. #define ESC_FMMU_3 (3UL)
  4154. #define ESC_FMMU_4 (4UL)
  4155. #define ESC_FMMU_5 (5UL)
  4156. #define ESC_FMMU_6 (6UL)
  4157. #define ESC_FMMU_7 (7UL)
  4158. /* SYNCM register group index macro definition */
  4159. #define ESC_SYNCM_0 (0UL)
  4160. #define ESC_SYNCM_1 (1UL)
  4161. #define ESC_SYNCM_2 (2UL)
  4162. #define ESC_SYNCM_3 (3UL)
  4163. #define ESC_SYNCM_4 (4UL)
  4164. #define ESC_SYNCM_5 (5UL)
  4165. #define ESC_SYNCM_6 (6UL)
  4166. #define ESC_SYNCM_7 (7UL)
  4167. /* RCV_TIME register group index macro definition */
  4168. #define ESC_RCV_TIME_PORT0 (0UL)
  4169. #define ESC_RCV_TIME_PORT1 (1UL)
  4170. #define ESC_RCV_TIME_PORT2 (2UL)
  4171. #define ESC_RCV_TIME_PORT3 (3UL)
  4172. /* IO_CFG register group index macro definition */
  4173. #define ESC_IO_CFG_CTR0 (0UL)
  4174. #define ESC_IO_CFG_CTR1 (1UL)
  4175. #define ESC_IO_CFG_CTR2 (2UL)
  4176. #define ESC_IO_CFG_CTR3 (3UL)
  4177. #define ESC_IO_CFG_CTR4 (4UL)
  4178. #define ESC_IO_CFG_CTR5 (5UL)
  4179. #define ESC_IO_CFG_CTR6 (6UL)
  4180. #define ESC_IO_CFG_CTR7 (7UL)
  4181. #define ESC_IO_CFG_CTR8 (8UL)
  4182. #endif /* HPM_ESC_H */