teensy-3-6-control-registers.h 663 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732
  1. #pragma once
  2. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  3. #include <stdint.h>
  4. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  5. // Peripheral FTFE_FlashConfig
  6. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  7. //-------------------- Backdoor Comparison Key 3.
  8. #define FTFE_FlashConfig_BACKKEY3 (* ((const volatile uint8_t *) (0x400 + 0)))
  9. //-------------------- Backdoor Comparison Key 2.
  10. #define FTFE_FlashConfig_BACKKEY2 (* ((const volatile uint8_t *) (0x400 + 0x1)))
  11. //-------------------- Backdoor Comparison Key 1.
  12. #define FTFE_FlashConfig_BACKKEY1 (* ((const volatile uint8_t *) (0x400 + 0x2)))
  13. //-------------------- Backdoor Comparison Key 0.
  14. #define FTFE_FlashConfig_BACKKEY0 (* ((const volatile uint8_t *) (0x400 + 0x3)))
  15. //-------------------- Backdoor Comparison Key 7.
  16. #define FTFE_FlashConfig_BACKKEY7 (* ((const volatile uint8_t *) (0x400 + 0x4)))
  17. //-------------------- Backdoor Comparison Key 6.
  18. #define FTFE_FlashConfig_BACKKEY6 (* ((const volatile uint8_t *) (0x400 + 0x5)))
  19. //-------------------- Backdoor Comparison Key 5.
  20. #define FTFE_FlashConfig_BACKKEY5 (* ((const volatile uint8_t *) (0x400 + 0x6)))
  21. //-------------------- Backdoor Comparison Key 4.
  22. #define FTFE_FlashConfig_BACKKEY4 (* ((const volatile uint8_t *) (0x400 + 0x7)))
  23. //-------------------- Non-volatile P-Flash Protection 1 - Low Register
  24. #define FTFE_FlashConfig_FPROT3 (* ((const volatile uint8_t *) (0x400 + 0x8)))
  25. //-------------------- Non-volatile P-Flash Protection 1 - High Register
  26. #define FTFE_FlashConfig_FPROT2 (* ((const volatile uint8_t *) (0x400 + 0x9)))
  27. //-------------------- Non-volatile P-Flash Protection 0 - Low Register
  28. #define FTFE_FlashConfig_FPROT1 (* ((const volatile uint8_t *) (0x400 + 0xA)))
  29. //-------------------- Non-volatile P-Flash Protection 0 - High Register
  30. #define FTFE_FlashConfig_FPROT0 (* ((const volatile uint8_t *) (0x400 + 0xB)))
  31. //-------------------- Non-volatile Flash Security Register
  32. #define FTFE_FlashConfig_FSEC (* ((const volatile uint8_t *) (0x400 + 0xC)))
  33. // Field (width: 2 bits): Flash Security
  34. inline uint8_t FTFE_FlashConfig_FSEC_SEC (const uint8_t inValue) { return (inValue & 3U) << 0 ; }
  35. // Field (width: 2 bits): Freescale Failure Analysis Access Code
  36. inline uint8_t FTFE_FlashConfig_FSEC_FSLACC (const uint8_t inValue) { return (inValue & 3U) << 2 ; }
  37. // Field (width: 2 bits): no description available
  38. inline uint8_t FTFE_FlashConfig_FSEC_MEEN (const uint8_t inValue) { return (inValue & 3U) << 4 ; }
  39. // Field (width: 2 bits): Backdoor Key Security Enable
  40. inline uint8_t FTFE_FlashConfig_FSEC_KEYEN (const uint8_t inValue) { return (inValue & 3U) << 6 ; }
  41. //-------------------- Non-volatile Flash Option Register
  42. #define FTFE_FlashConfig_FOPT (* ((const volatile uint8_t *) (0x400 + 0xD)))
  43. // Boolean field: no description available
  44. static const uint8_t FTFE_FlashConfig_FOPT_LPBOOT = 1U << 0 ;
  45. // Boolean field: no description available
  46. static const uint8_t FTFE_FlashConfig_FOPT_EZPORT_DIS = 1U << 1 ;
  47. // Boolean field: no description available
  48. static const uint8_t FTFE_FlashConfig_FOPT_NMI_DIS = 1U << 2 ;
  49. //-------------------- Non-volatile EERAM Protection Register
  50. #define FTFE_FlashConfig_FEPROT (* ((const volatile uint8_t *) (0x400 + 0xE)))
  51. //-------------------- Non-volatile D-Flash Protection Register
  52. #define FTFE_FlashConfig_FDPROT (* ((const volatile uint8_t *) (0x400 + 0xF)))
  53. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  54. // Peripheral AXBS
  55. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  56. //-------------------- Priority Registers Slave (idx = 0 ... 4)
  57. #define AXBS_PRS(idx) (* ((volatile uint32_t *) (0x40004000 + 0 + 0x100 * (idx))))
  58. // Field (width: 3 bits): Master 0 Priority. Sets the arbitration priority for this port on the associated slave port.
  59. inline uint32_t AXBS_PRS_M0 (const uint32_t inValue) { return (inValue & 7U) << 0 ; }
  60. // Field (width: 3 bits): Master 1 Priority. Sets the arbitration priority for this port on the associated slave port.
  61. inline uint32_t AXBS_PRS_M1 (const uint32_t inValue) { return (inValue & 7U) << 4 ; }
  62. // Field (width: 3 bits): Master 2 Priority. Sets the arbitration priority for this port on the associated slave port.
  63. inline uint32_t AXBS_PRS_M2 (const uint32_t inValue) { return (inValue & 7U) << 8 ; }
  64. // Field (width: 3 bits): Master 3 Priority. Sets the arbitration priority for this port on the associated slave port.
  65. inline uint32_t AXBS_PRS_M3 (const uint32_t inValue) { return (inValue & 7U) << 12 ; }
  66. // Field (width: 3 bits): Master 4 Priority. Sets the arbitration priority for this port on the associated slave port.
  67. inline uint32_t AXBS_PRS_M4 (const uint32_t inValue) { return (inValue & 7U) << 16 ; }
  68. // Field (width: 3 bits): Master 5 Priority. Sets the arbitration priority for this port on the associated slave port.
  69. inline uint32_t AXBS_PRS_M5 (const uint32_t inValue) { return (inValue & 7U) << 20 ; }
  70. // Field (width: 3 bits): Master 6 Priority. Sets the arbitration priority for this port on the associated slave port.
  71. inline uint32_t AXBS_PRS_M6 (const uint32_t inValue) { return (inValue & 7U) << 24 ; }
  72. //-------------------- Control Register (idx = 0 ... 4)
  73. #define AXBS_CRS(idx) (* ((volatile uint32_t *) (0x40004000 + 0x10 + 0x100 * (idx))))
  74. // Field (width: 3 bits): Park
  75. inline uint32_t AXBS_CRS_PARK (const uint32_t inValue) { return (inValue & 7U) << 0 ; }
  76. // Field (width: 2 bits): Parking Control
  77. inline uint32_t AXBS_CRS_PCTL (const uint32_t inValue) { return (inValue & 3U) << 4 ; }
  78. // Field (width: 2 bits): Arbitration Mode
  79. inline uint32_t AXBS_CRS_ARB (const uint32_t inValue) { return (inValue & 3U) << 8 ; }
  80. // Boolean field: Halt Low Priority
  81. static const uint32_t AXBS_CRS_HLP = 1U << 30 ;
  82. // Boolean field: Read Only
  83. static const uint32_t AXBS_CRS_RO = 1U << 31 ;
  84. //-------------------- Master General Purpose Control Register (idx = 0 ... 6)
  85. #define AXBS_MGPCR(idx) (* ((volatile uint32_t *) (0x40004000 + 0x800 + 0x100 * (idx))))
  86. // Field (width: 3 bits): Arbitrates On Undefined Length Bursts
  87. inline uint32_t AXBS_MGPCR_AULB (const uint32_t inValue) { return (inValue & 7U) << 0 ; }
  88. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  89. // Peripheral DMA
  90. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  91. //-------------------- Control Register
  92. #define DMA_CR (* ((volatile uint32_t *) (0x40008000 + 0)))
  93. // Boolean field: Enable Debug
  94. static const uint32_t DMA_CR_EDBG = 1U << 1 ;
  95. // Boolean field: Enable Round Robin Channel Arbitration
  96. static const uint32_t DMA_CR_ERCA = 1U << 2 ;
  97. // Boolean field: Enable Round Robin Group Arbitration
  98. static const uint32_t DMA_CR_ERGA = 1U << 3 ;
  99. // Boolean field: Halt On Error
  100. static const uint32_t DMA_CR_HOE = 1U << 4 ;
  101. // Boolean field: Halt DMA Operations
  102. static const uint32_t DMA_CR_HALT = 1U << 5 ;
  103. // Boolean field: Continuous Link Mode
  104. static const uint32_t DMA_CR_CLM = 1U << 6 ;
  105. // Boolean field: Enable Minor Loop Mapping
  106. static const uint32_t DMA_CR_EMLM = 1U << 7 ;
  107. // Boolean field: Channel Group 0 Priority
  108. static const uint32_t DMA_CR_GRP0PRI = 1U << 8 ;
  109. // Boolean field: Channel Group 1 Priority
  110. static const uint32_t DMA_CR_GRP1PRI = 1U << 10 ;
  111. // Boolean field: Error Cancel Transfer
  112. static const uint32_t DMA_CR_ECX = 1U << 16 ;
  113. // Boolean field: Cancel Transfer
  114. static const uint32_t DMA_CR_CX = 1U << 17 ;
  115. //-------------------- Error Status Register
  116. #define DMA_ES (* ((const volatile uint32_t *) (0x40008000 + 0x4)))
  117. // Boolean field: Destination Bus Error
  118. static const uint32_t DMA_ES_DBE = 1U << 0 ;
  119. // Boolean field: Source Bus Error
  120. static const uint32_t DMA_ES_SBE = 1U << 1 ;
  121. // Boolean field: Scatter/Gather Configuration Error
  122. static const uint32_t DMA_ES_SGE = 1U << 2 ;
  123. // Boolean field: NBYTES/CITER Configuration Error
  124. static const uint32_t DMA_ES_NCE = 1U << 3 ;
  125. // Boolean field: Destination Offset Error
  126. static const uint32_t DMA_ES_DOE = 1U << 4 ;
  127. // Boolean field: Destination Address Error
  128. static const uint32_t DMA_ES_DAE = 1U << 5 ;
  129. // Boolean field: Source Offset Error
  130. static const uint32_t DMA_ES_SOE = 1U << 6 ;
  131. // Boolean field: Source Address Error
  132. static const uint32_t DMA_ES_SAE = 1U << 7 ;
  133. // Field (width: 5 bits): Error Channel Number or Canceled Channel Number
  134. inline uint32_t DMA_ES_ERRCHN (const uint32_t inValue) { return (inValue & 31U) << 8 ; }
  135. // Boolean field: Channel Priority Error
  136. static const uint32_t DMA_ES_CPE = 1U << 14 ;
  137. // Boolean field: Group Priority Error
  138. static const uint32_t DMA_ES_GPE = 1U << 15 ;
  139. // Boolean field: Transfer Canceled
  140. static const uint32_t DMA_ES_ECX = 1U << 16 ;
  141. // Boolean field: Logical OR of all ERR status bits
  142. static const uint32_t DMA_ES_VLD = 1U << 31 ;
  143. //-------------------- Enable Request Register
  144. #define DMA_ERQ (* ((volatile uint32_t *) (0x40008000 + 0xC)))
  145. // Boolean field: Enable DMA Request 0
  146. static const uint32_t DMA_ERQ_ERQ0 = 1U << 0 ;
  147. // Boolean field: Enable DMA Request 1
  148. static const uint32_t DMA_ERQ_ERQ1 = 1U << 1 ;
  149. // Boolean field: Enable DMA Request 2
  150. static const uint32_t DMA_ERQ_ERQ2 = 1U << 2 ;
  151. // Boolean field: Enable DMA Request 3
  152. static const uint32_t DMA_ERQ_ERQ3 = 1U << 3 ;
  153. // Boolean field: Enable DMA Request 4
  154. static const uint32_t DMA_ERQ_ERQ4 = 1U << 4 ;
  155. // Boolean field: Enable DMA Request 5
  156. static const uint32_t DMA_ERQ_ERQ5 = 1U << 5 ;
  157. // Boolean field: Enable DMA Request 6
  158. static const uint32_t DMA_ERQ_ERQ6 = 1U << 6 ;
  159. // Boolean field: Enable DMA Request 7
  160. static const uint32_t DMA_ERQ_ERQ7 = 1U << 7 ;
  161. // Boolean field: Enable DMA Request 8
  162. static const uint32_t DMA_ERQ_ERQ8 = 1U << 8 ;
  163. // Boolean field: Enable DMA Request 9
  164. static const uint32_t DMA_ERQ_ERQ9 = 1U << 9 ;
  165. // Boolean field: Enable DMA Request 10
  166. static const uint32_t DMA_ERQ_ERQ10 = 1U << 10 ;
  167. // Boolean field: Enable DMA Request 11
  168. static const uint32_t DMA_ERQ_ERQ11 = 1U << 11 ;
  169. // Boolean field: Enable DMA Request 12
  170. static const uint32_t DMA_ERQ_ERQ12 = 1U << 12 ;
  171. // Boolean field: Enable DMA Request 13
  172. static const uint32_t DMA_ERQ_ERQ13 = 1U << 13 ;
  173. // Boolean field: Enable DMA Request 14
  174. static const uint32_t DMA_ERQ_ERQ14 = 1U << 14 ;
  175. // Boolean field: Enable DMA Request 15
  176. static const uint32_t DMA_ERQ_ERQ15 = 1U << 15 ;
  177. // Boolean field: Enable DMA Request 16
  178. static const uint32_t DMA_ERQ_ERQ16 = 1U << 16 ;
  179. // Boolean field: Enable DMA Request 17
  180. static const uint32_t DMA_ERQ_ERQ17 = 1U << 17 ;
  181. // Boolean field: Enable DMA Request 18
  182. static const uint32_t DMA_ERQ_ERQ18 = 1U << 18 ;
  183. // Boolean field: Enable DMA Request 19
  184. static const uint32_t DMA_ERQ_ERQ19 = 1U << 19 ;
  185. // Boolean field: Enable DMA Request 20
  186. static const uint32_t DMA_ERQ_ERQ20 = 1U << 20 ;
  187. // Boolean field: Enable DMA Request 21
  188. static const uint32_t DMA_ERQ_ERQ21 = 1U << 21 ;
  189. // Boolean field: Enable DMA Request 22
  190. static const uint32_t DMA_ERQ_ERQ22 = 1U << 22 ;
  191. // Boolean field: Enable DMA Request 23
  192. static const uint32_t DMA_ERQ_ERQ23 = 1U << 23 ;
  193. // Boolean field: Enable DMA Request 24
  194. static const uint32_t DMA_ERQ_ERQ24 = 1U << 24 ;
  195. // Boolean field: Enable DMA Request 25
  196. static const uint32_t DMA_ERQ_ERQ25 = 1U << 25 ;
  197. // Boolean field: Enable DMA Request 26
  198. static const uint32_t DMA_ERQ_ERQ26 = 1U << 26 ;
  199. // Boolean field: Enable DMA Request 27
  200. static const uint32_t DMA_ERQ_ERQ27 = 1U << 27 ;
  201. // Boolean field: Enable DMA Request 28
  202. static const uint32_t DMA_ERQ_ERQ28 = 1U << 28 ;
  203. // Boolean field: Enable DMA Request 29
  204. static const uint32_t DMA_ERQ_ERQ29 = 1U << 29 ;
  205. // Boolean field: Enable DMA Request 30
  206. static const uint32_t DMA_ERQ_ERQ30 = 1U << 30 ;
  207. // Boolean field: Enable DMA Request 31
  208. static const uint32_t DMA_ERQ_ERQ31 = 1U << 31 ;
  209. //-------------------- Enable Error Interrupt Register
  210. #define DMA_EEI (* ((volatile uint32_t *) (0x40008000 + 0x14)))
  211. // Boolean field: Enable Error Interrupt 0
  212. static const uint32_t DMA_EEI_EEI0 = 1U << 0 ;
  213. // Boolean field: Enable Error Interrupt 1
  214. static const uint32_t DMA_EEI_EEI1 = 1U << 1 ;
  215. // Boolean field: Enable Error Interrupt 2
  216. static const uint32_t DMA_EEI_EEI2 = 1U << 2 ;
  217. // Boolean field: Enable Error Interrupt 3
  218. static const uint32_t DMA_EEI_EEI3 = 1U << 3 ;
  219. // Boolean field: Enable Error Interrupt 4
  220. static const uint32_t DMA_EEI_EEI4 = 1U << 4 ;
  221. // Boolean field: Enable Error Interrupt 5
  222. static const uint32_t DMA_EEI_EEI5 = 1U << 5 ;
  223. // Boolean field: Enable Error Interrupt 6
  224. static const uint32_t DMA_EEI_EEI6 = 1U << 6 ;
  225. // Boolean field: Enable Error Interrupt 7
  226. static const uint32_t DMA_EEI_EEI7 = 1U << 7 ;
  227. // Boolean field: Enable Error Interrupt 8
  228. static const uint32_t DMA_EEI_EEI8 = 1U << 8 ;
  229. // Boolean field: Enable Error Interrupt 9
  230. static const uint32_t DMA_EEI_EEI9 = 1U << 9 ;
  231. // Boolean field: Enable Error Interrupt 10
  232. static const uint32_t DMA_EEI_EEI10 = 1U << 10 ;
  233. // Boolean field: Enable Error Interrupt 11
  234. static const uint32_t DMA_EEI_EEI11 = 1U << 11 ;
  235. // Boolean field: Enable Error Interrupt 12
  236. static const uint32_t DMA_EEI_EEI12 = 1U << 12 ;
  237. // Boolean field: Enable Error Interrupt 13
  238. static const uint32_t DMA_EEI_EEI13 = 1U << 13 ;
  239. // Boolean field: Enable Error Interrupt 14
  240. static const uint32_t DMA_EEI_EEI14 = 1U << 14 ;
  241. // Boolean field: Enable Error Interrupt 15
  242. static const uint32_t DMA_EEI_EEI15 = 1U << 15 ;
  243. // Boolean field: Enable Error Interrupt 16
  244. static const uint32_t DMA_EEI_EEI16 = 1U << 16 ;
  245. // Boolean field: Enable Error Interrupt 17
  246. static const uint32_t DMA_EEI_EEI17 = 1U << 17 ;
  247. // Boolean field: Enable Error Interrupt 18
  248. static const uint32_t DMA_EEI_EEI18 = 1U << 18 ;
  249. // Boolean field: Enable Error Interrupt 19
  250. static const uint32_t DMA_EEI_EEI19 = 1U << 19 ;
  251. // Boolean field: Enable Error Interrupt 20
  252. static const uint32_t DMA_EEI_EEI20 = 1U << 20 ;
  253. // Boolean field: Enable Error Interrupt 21
  254. static const uint32_t DMA_EEI_EEI21 = 1U << 21 ;
  255. // Boolean field: Enable Error Interrupt 22
  256. static const uint32_t DMA_EEI_EEI22 = 1U << 22 ;
  257. // Boolean field: Enable Error Interrupt 23
  258. static const uint32_t DMA_EEI_EEI23 = 1U << 23 ;
  259. // Boolean field: Enable Error Interrupt 24
  260. static const uint32_t DMA_EEI_EEI24 = 1U << 24 ;
  261. // Boolean field: Enable Error Interrupt 25
  262. static const uint32_t DMA_EEI_EEI25 = 1U << 25 ;
  263. // Boolean field: Enable Error Interrupt 26
  264. static const uint32_t DMA_EEI_EEI26 = 1U << 26 ;
  265. // Boolean field: Enable Error Interrupt 27
  266. static const uint32_t DMA_EEI_EEI27 = 1U << 27 ;
  267. // Boolean field: Enable Error Interrupt 28
  268. static const uint32_t DMA_EEI_EEI28 = 1U << 28 ;
  269. // Boolean field: Enable Error Interrupt 29
  270. static const uint32_t DMA_EEI_EEI29 = 1U << 29 ;
  271. // Boolean field: Enable Error Interrupt 30
  272. static const uint32_t DMA_EEI_EEI30 = 1U << 30 ;
  273. // Boolean field: Enable Error Interrupt 31
  274. static const uint32_t DMA_EEI_EEI31 = 1U << 31 ;
  275. //-------------------- Clear Enable Error Interrupt Register
  276. #define DMA_CEEI (* ((volatile uint8_t *) (0x40008000 + 0x18)))
  277. // Field (width: 5 bits): Clear Enable Error Interrupt
  278. inline uint8_t DMA_CEEI_CEEI (const uint8_t inValue) { return (inValue & 31U) << 0 ; }
  279. // Boolean field: Clear All Enable Error Interrupts
  280. static const uint8_t DMA_CEEI_CAEE = 1U << 6 ;
  281. // Boolean field: No Op enable
  282. static const uint8_t DMA_CEEI_NOP = 1U << 7 ;
  283. //-------------------- Set Enable Error Interrupt Register
  284. #define DMA_SEEI (* ((volatile uint8_t *) (0x40008000 + 0x19)))
  285. // Field (width: 5 bits): Set Enable Error Interrupt
  286. inline uint8_t DMA_SEEI_SEEI (const uint8_t inValue) { return (inValue & 31U) << 0 ; }
  287. // Boolean field: Sets All Enable Error Interrupts
  288. static const uint8_t DMA_SEEI_SAEE = 1U << 6 ;
  289. // Boolean field: No Op enable
  290. static const uint8_t DMA_SEEI_NOP = 1U << 7 ;
  291. //-------------------- Clear Enable Request Register
  292. #define DMA_CERQ (* ((volatile uint8_t *) (0x40008000 + 0x1A)))
  293. // Field (width: 5 bits): Clear Enable Request
  294. inline uint8_t DMA_CERQ_CERQ (const uint8_t inValue) { return (inValue & 31U) << 0 ; }
  295. // Boolean field: Clear All Enable Requests
  296. static const uint8_t DMA_CERQ_CAER = 1U << 6 ;
  297. // Boolean field: No Op enable
  298. static const uint8_t DMA_CERQ_NOP = 1U << 7 ;
  299. //-------------------- Set Enable Request Register
  300. #define DMA_SERQ (* ((volatile uint8_t *) (0x40008000 + 0x1B)))
  301. // Field (width: 5 bits): Set Enable Request
  302. inline uint8_t DMA_SERQ_SERQ (const uint8_t inValue) { return (inValue & 31U) << 0 ; }
  303. // Boolean field: Set All Enable Requests
  304. static const uint8_t DMA_SERQ_SAER = 1U << 6 ;
  305. // Boolean field: No Op enable
  306. static const uint8_t DMA_SERQ_NOP = 1U << 7 ;
  307. //-------------------- Clear DONE Status Bit Register
  308. #define DMA_CDNE (* ((volatile uint8_t *) (0x40008000 + 0x1C)))
  309. // Field (width: 5 bits): Clear DONE Bit
  310. inline uint8_t DMA_CDNE_CDNE (const uint8_t inValue) { return (inValue & 31U) << 0 ; }
  311. // Boolean field: Clears All DONE Bits
  312. static const uint8_t DMA_CDNE_CADN = 1U << 6 ;
  313. // Boolean field: No Op enable
  314. static const uint8_t DMA_CDNE_NOP = 1U << 7 ;
  315. //-------------------- Set START Bit Register
  316. #define DMA_SSRT (* ((volatile uint8_t *) (0x40008000 + 0x1D)))
  317. // Field (width: 5 bits): Set START Bit
  318. inline uint8_t DMA_SSRT_SSRT (const uint8_t inValue) { return (inValue & 31U) << 0 ; }
  319. // Boolean field: Set All START Bits (activates all channels)
  320. static const uint8_t DMA_SSRT_SAST = 1U << 6 ;
  321. // Boolean field: No Op enable
  322. static const uint8_t DMA_SSRT_NOP = 1U << 7 ;
  323. //-------------------- Clear Error Register
  324. #define DMA_CERR (* ((volatile uint8_t *) (0x40008000 + 0x1E)))
  325. // Field (width: 5 bits): Clear Error Indicator
  326. inline uint8_t DMA_CERR_CERR (const uint8_t inValue) { return (inValue & 31U) << 0 ; }
  327. // Boolean field: Clear All Error Indicators
  328. static const uint8_t DMA_CERR_CAEI = 1U << 6 ;
  329. // Boolean field: No Op enable
  330. static const uint8_t DMA_CERR_NOP = 1U << 7 ;
  331. //-------------------- Clear Interrupt Request Register
  332. #define DMA_CINT (* ((volatile uint8_t *) (0x40008000 + 0x1F)))
  333. // Field (width: 5 bits): Clear Interrupt Request
  334. inline uint8_t DMA_CINT_CINT (const uint8_t inValue) { return (inValue & 31U) << 0 ; }
  335. // Boolean field: Clear All Interrupt Requests
  336. static const uint8_t DMA_CINT_CAIR = 1U << 6 ;
  337. // Boolean field: No Op enable
  338. static const uint8_t DMA_CINT_NOP = 1U << 7 ;
  339. //-------------------- Interrupt Request Register
  340. #define DMA_INT (* ((volatile uint32_t *) (0x40008000 + 0x24)))
  341. // Boolean field: Interrupt Request 0
  342. static const uint32_t DMA_INT_INT0 = 1U << 0 ;
  343. // Boolean field: Interrupt Request 1
  344. static const uint32_t DMA_INT_INT1 = 1U << 1 ;
  345. // Boolean field: Interrupt Request 2
  346. static const uint32_t DMA_INT_INT2 = 1U << 2 ;
  347. // Boolean field: Interrupt Request 3
  348. static const uint32_t DMA_INT_INT3 = 1U << 3 ;
  349. // Boolean field: Interrupt Request 4
  350. static const uint32_t DMA_INT_INT4 = 1U << 4 ;
  351. // Boolean field: Interrupt Request 5
  352. static const uint32_t DMA_INT_INT5 = 1U << 5 ;
  353. // Boolean field: Interrupt Request 6
  354. static const uint32_t DMA_INT_INT6 = 1U << 6 ;
  355. // Boolean field: Interrupt Request 7
  356. static const uint32_t DMA_INT_INT7 = 1U << 7 ;
  357. // Boolean field: Interrupt Request 8
  358. static const uint32_t DMA_INT_INT8 = 1U << 8 ;
  359. // Boolean field: Interrupt Request 9
  360. static const uint32_t DMA_INT_INT9 = 1U << 9 ;
  361. // Boolean field: Interrupt Request 10
  362. static const uint32_t DMA_INT_INT10 = 1U << 10 ;
  363. // Boolean field: Interrupt Request 11
  364. static const uint32_t DMA_INT_INT11 = 1U << 11 ;
  365. // Boolean field: Interrupt Request 12
  366. static const uint32_t DMA_INT_INT12 = 1U << 12 ;
  367. // Boolean field: Interrupt Request 13
  368. static const uint32_t DMA_INT_INT13 = 1U << 13 ;
  369. // Boolean field: Interrupt Request 14
  370. static const uint32_t DMA_INT_INT14 = 1U << 14 ;
  371. // Boolean field: Interrupt Request 15
  372. static const uint32_t DMA_INT_INT15 = 1U << 15 ;
  373. // Boolean field: Interrupt Request 16
  374. static const uint32_t DMA_INT_INT16 = 1U << 16 ;
  375. // Boolean field: Interrupt Request 17
  376. static const uint32_t DMA_INT_INT17 = 1U << 17 ;
  377. // Boolean field: Interrupt Request 18
  378. static const uint32_t DMA_INT_INT18 = 1U << 18 ;
  379. // Boolean field: Interrupt Request 19
  380. static const uint32_t DMA_INT_INT19 = 1U << 19 ;
  381. // Boolean field: Interrupt Request 20
  382. static const uint32_t DMA_INT_INT20 = 1U << 20 ;
  383. // Boolean field: Interrupt Request 21
  384. static const uint32_t DMA_INT_INT21 = 1U << 21 ;
  385. // Boolean field: Interrupt Request 22
  386. static const uint32_t DMA_INT_INT22 = 1U << 22 ;
  387. // Boolean field: Interrupt Request 23
  388. static const uint32_t DMA_INT_INT23 = 1U << 23 ;
  389. // Boolean field: Interrupt Request 24
  390. static const uint32_t DMA_INT_INT24 = 1U << 24 ;
  391. // Boolean field: Interrupt Request 25
  392. static const uint32_t DMA_INT_INT25 = 1U << 25 ;
  393. // Boolean field: Interrupt Request 26
  394. static const uint32_t DMA_INT_INT26 = 1U << 26 ;
  395. // Boolean field: Interrupt Request 27
  396. static const uint32_t DMA_INT_INT27 = 1U << 27 ;
  397. // Boolean field: Interrupt Request 28
  398. static const uint32_t DMA_INT_INT28 = 1U << 28 ;
  399. // Boolean field: Interrupt Request 29
  400. static const uint32_t DMA_INT_INT29 = 1U << 29 ;
  401. // Boolean field: Interrupt Request 30
  402. static const uint32_t DMA_INT_INT30 = 1U << 30 ;
  403. // Boolean field: Interrupt Request 31
  404. static const uint32_t DMA_INT_INT31 = 1U << 31 ;
  405. //-------------------- Error Register
  406. #define DMA_ERR (* ((volatile uint32_t *) (0x40008000 + 0x2C)))
  407. // Boolean field: Error In Channel 0
  408. static const uint32_t DMA_ERR_ERR0 = 1U << 0 ;
  409. // Boolean field: Error In Channel 1
  410. static const uint32_t DMA_ERR_ERR1 = 1U << 1 ;
  411. // Boolean field: Error In Channel 2
  412. static const uint32_t DMA_ERR_ERR2 = 1U << 2 ;
  413. // Boolean field: Error In Channel 3
  414. static const uint32_t DMA_ERR_ERR3 = 1U << 3 ;
  415. // Boolean field: Error In Channel 4
  416. static const uint32_t DMA_ERR_ERR4 = 1U << 4 ;
  417. // Boolean field: Error In Channel 5
  418. static const uint32_t DMA_ERR_ERR5 = 1U << 5 ;
  419. // Boolean field: Error In Channel 6
  420. static const uint32_t DMA_ERR_ERR6 = 1U << 6 ;
  421. // Boolean field: Error In Channel 7
  422. static const uint32_t DMA_ERR_ERR7 = 1U << 7 ;
  423. // Boolean field: Error In Channel 8
  424. static const uint32_t DMA_ERR_ERR8 = 1U << 8 ;
  425. // Boolean field: Error In Channel 9
  426. static const uint32_t DMA_ERR_ERR9 = 1U << 9 ;
  427. // Boolean field: Error In Channel 10
  428. static const uint32_t DMA_ERR_ERR10 = 1U << 10 ;
  429. // Boolean field: Error In Channel 11
  430. static const uint32_t DMA_ERR_ERR11 = 1U << 11 ;
  431. // Boolean field: Error In Channel 12
  432. static const uint32_t DMA_ERR_ERR12 = 1U << 12 ;
  433. // Boolean field: Error In Channel 13
  434. static const uint32_t DMA_ERR_ERR13 = 1U << 13 ;
  435. // Boolean field: Error In Channel 14
  436. static const uint32_t DMA_ERR_ERR14 = 1U << 14 ;
  437. // Boolean field: Error In Channel 15
  438. static const uint32_t DMA_ERR_ERR15 = 1U << 15 ;
  439. // Boolean field: Error In Channel 16
  440. static const uint32_t DMA_ERR_ERR16 = 1U << 16 ;
  441. // Boolean field: Error In Channel 17
  442. static const uint32_t DMA_ERR_ERR17 = 1U << 17 ;
  443. // Boolean field: Error In Channel 18
  444. static const uint32_t DMA_ERR_ERR18 = 1U << 18 ;
  445. // Boolean field: Error In Channel 19
  446. static const uint32_t DMA_ERR_ERR19 = 1U << 19 ;
  447. // Boolean field: Error In Channel 20
  448. static const uint32_t DMA_ERR_ERR20 = 1U << 20 ;
  449. // Boolean field: Error In Channel 21
  450. static const uint32_t DMA_ERR_ERR21 = 1U << 21 ;
  451. // Boolean field: Error In Channel 22
  452. static const uint32_t DMA_ERR_ERR22 = 1U << 22 ;
  453. // Boolean field: Error In Channel 23
  454. static const uint32_t DMA_ERR_ERR23 = 1U << 23 ;
  455. // Boolean field: Error In Channel 24
  456. static const uint32_t DMA_ERR_ERR24 = 1U << 24 ;
  457. // Boolean field: Error In Channel 25
  458. static const uint32_t DMA_ERR_ERR25 = 1U << 25 ;
  459. // Boolean field: Error In Channel 26
  460. static const uint32_t DMA_ERR_ERR26 = 1U << 26 ;
  461. // Boolean field: Error In Channel 27
  462. static const uint32_t DMA_ERR_ERR27 = 1U << 27 ;
  463. // Boolean field: Error In Channel 28
  464. static const uint32_t DMA_ERR_ERR28 = 1U << 28 ;
  465. // Boolean field: Error In Channel 29
  466. static const uint32_t DMA_ERR_ERR29 = 1U << 29 ;
  467. // Boolean field: Error In Channel 30
  468. static const uint32_t DMA_ERR_ERR30 = 1U << 30 ;
  469. // Boolean field: Error In Channel 31
  470. static const uint32_t DMA_ERR_ERR31 = 1U << 31 ;
  471. //-------------------- Hardware Request Status Register
  472. #define DMA_HRS (* ((const volatile uint32_t *) (0x40008000 + 0x34)))
  473. // Boolean field: Hardware Request Status Channel 0
  474. static const uint32_t DMA_HRS_HRS0 = 1U << 0 ;
  475. // Boolean field: Hardware Request Status Channel 1
  476. static const uint32_t DMA_HRS_HRS1 = 1U << 1 ;
  477. // Boolean field: Hardware Request Status Channel 2
  478. static const uint32_t DMA_HRS_HRS2 = 1U << 2 ;
  479. // Boolean field: Hardware Request Status Channel 3
  480. static const uint32_t DMA_HRS_HRS3 = 1U << 3 ;
  481. // Boolean field: Hardware Request Status Channel 4
  482. static const uint32_t DMA_HRS_HRS4 = 1U << 4 ;
  483. // Boolean field: Hardware Request Status Channel 5
  484. static const uint32_t DMA_HRS_HRS5 = 1U << 5 ;
  485. // Boolean field: Hardware Request Status Channel 6
  486. static const uint32_t DMA_HRS_HRS6 = 1U << 6 ;
  487. // Boolean field: Hardware Request Status Channel 7
  488. static const uint32_t DMA_HRS_HRS7 = 1U << 7 ;
  489. // Boolean field: Hardware Request Status Channel 8
  490. static const uint32_t DMA_HRS_HRS8 = 1U << 8 ;
  491. // Boolean field: Hardware Request Status Channel 9
  492. static const uint32_t DMA_HRS_HRS9 = 1U << 9 ;
  493. // Boolean field: Hardware Request Status Channel 10
  494. static const uint32_t DMA_HRS_HRS10 = 1U << 10 ;
  495. // Boolean field: Hardware Request Status Channel 11
  496. static const uint32_t DMA_HRS_HRS11 = 1U << 11 ;
  497. // Boolean field: Hardware Request Status Channel 12
  498. static const uint32_t DMA_HRS_HRS12 = 1U << 12 ;
  499. // Boolean field: Hardware Request Status Channel 13
  500. static const uint32_t DMA_HRS_HRS13 = 1U << 13 ;
  501. // Boolean field: Hardware Request Status Channel 14
  502. static const uint32_t DMA_HRS_HRS14 = 1U << 14 ;
  503. // Boolean field: Hardware Request Status Channel 15
  504. static const uint32_t DMA_HRS_HRS15 = 1U << 15 ;
  505. // Boolean field: Hardware Request Status Channel 16
  506. static const uint32_t DMA_HRS_HRS16 = 1U << 16 ;
  507. // Boolean field: Hardware Request Status Channel 17
  508. static const uint32_t DMA_HRS_HRS17 = 1U << 17 ;
  509. // Boolean field: Hardware Request Status Channel 18
  510. static const uint32_t DMA_HRS_HRS18 = 1U << 18 ;
  511. // Boolean field: Hardware Request Status Channel 19
  512. static const uint32_t DMA_HRS_HRS19 = 1U << 19 ;
  513. // Boolean field: Hardware Request Status Channel 20
  514. static const uint32_t DMA_HRS_HRS20 = 1U << 20 ;
  515. // Boolean field: Hardware Request Status Channel 21
  516. static const uint32_t DMA_HRS_HRS21 = 1U << 21 ;
  517. // Boolean field: Hardware Request Status Channel 22
  518. static const uint32_t DMA_HRS_HRS22 = 1U << 22 ;
  519. // Boolean field: Hardware Request Status Channel 23
  520. static const uint32_t DMA_HRS_HRS23 = 1U << 23 ;
  521. // Boolean field: Hardware Request Status Channel 24
  522. static const uint32_t DMA_HRS_HRS24 = 1U << 24 ;
  523. // Boolean field: Hardware Request Status Channel 25
  524. static const uint32_t DMA_HRS_HRS25 = 1U << 25 ;
  525. // Boolean field: Hardware Request Status Channel 26
  526. static const uint32_t DMA_HRS_HRS26 = 1U << 26 ;
  527. // Boolean field: Hardware Request Status Channel 27
  528. static const uint32_t DMA_HRS_HRS27 = 1U << 27 ;
  529. // Boolean field: Hardware Request Status Channel 28
  530. static const uint32_t DMA_HRS_HRS28 = 1U << 28 ;
  531. // Boolean field: Hardware Request Status Channel 29
  532. static const uint32_t DMA_HRS_HRS29 = 1U << 29 ;
  533. // Boolean field: Hardware Request Status Channel 30
  534. static const uint32_t DMA_HRS_HRS30 = 1U << 30 ;
  535. // Boolean field: Hardware Request Status Channel 31
  536. static const uint32_t DMA_HRS_HRS31 = 1U << 31 ;
  537. //-------------------- Enable Asynchronous Request in Stop Register
  538. #define DMA_EARS (* ((volatile uint32_t *) (0x40008000 + 0x44)))
  539. // Boolean field: Enable asynchronous DMA request in stop mode for channel 0.
  540. static const uint32_t DMA_EARS_EDREQ_0 = 1U << 0 ;
  541. // Boolean field: Enable asynchronous DMA request in stop mode for channel 1.
  542. static const uint32_t DMA_EARS_EDREQ_1 = 1U << 1 ;
  543. // Boolean field: Enable asynchronous DMA request in stop mode for channel 2.
  544. static const uint32_t DMA_EARS_EDREQ_2 = 1U << 2 ;
  545. // Boolean field: Enable asynchronous DMA request in stop mode for channel 3.
  546. static const uint32_t DMA_EARS_EDREQ_3 = 1U << 3 ;
  547. // Boolean field: Enable asynchronous DMA request in stop mode for channel 4
  548. static const uint32_t DMA_EARS_EDREQ_4 = 1U << 4 ;
  549. // Boolean field: Enable asynchronous DMA request in stop mode for channel 5
  550. static const uint32_t DMA_EARS_EDREQ_5 = 1U << 5 ;
  551. // Boolean field: Enable asynchronous DMA request in stop mode for channel 6
  552. static const uint32_t DMA_EARS_EDREQ_6 = 1U << 6 ;
  553. // Boolean field: Enable asynchronous DMA request in stop mode for channel 7
  554. static const uint32_t DMA_EARS_EDREQ_7 = 1U << 7 ;
  555. // Boolean field: Enable asynchronous DMA request in stop mode for channel 8
  556. static const uint32_t DMA_EARS_EDREQ_8 = 1U << 8 ;
  557. // Boolean field: Enable asynchronous DMA request in stop mode for channel 9
  558. static const uint32_t DMA_EARS_EDREQ_9 = 1U << 9 ;
  559. // Boolean field: Enable asynchronous DMA request in stop mode for channel 10
  560. static const uint32_t DMA_EARS_EDREQ_10 = 1U << 10 ;
  561. // Boolean field: Enable asynchronous DMA request in stop mode for channel 11
  562. static const uint32_t DMA_EARS_EDREQ_11 = 1U << 11 ;
  563. // Boolean field: Enable asynchronous DMA request in stop mode for channel 12
  564. static const uint32_t DMA_EARS_EDREQ_12 = 1U << 12 ;
  565. // Boolean field: Enable asynchronous DMA request in stop mode for channel 13
  566. static const uint32_t DMA_EARS_EDREQ_13 = 1U << 13 ;
  567. // Boolean field: Enable asynchronous DMA request in stop mode for channel 14
  568. static const uint32_t DMA_EARS_EDREQ_14 = 1U << 14 ;
  569. // Boolean field: Enable asynchronous DMA request in stop mode for channel 15
  570. static const uint32_t DMA_EARS_EDREQ_15 = 1U << 15 ;
  571. // Boolean field: Enable asynchronous DMA request in stop mode for channel 16
  572. static const uint32_t DMA_EARS_EDREQ_16 = 1U << 16 ;
  573. // Boolean field: Enable asynchronous DMA request in stop mode for channel 17
  574. static const uint32_t DMA_EARS_EDREQ_17 = 1U << 17 ;
  575. // Boolean field: Enable asynchronous DMA request in stop mode for channel 18
  576. static const uint32_t DMA_EARS_EDREQ_18 = 1U << 18 ;
  577. // Boolean field: Enable asynchronous DMA request in stop mode for channel 19
  578. static const uint32_t DMA_EARS_EDREQ_19 = 1U << 19 ;
  579. // Boolean field: Enable asynchronous DMA request in stop mode for channel 20
  580. static const uint32_t DMA_EARS_EDREQ_20 = 1U << 20 ;
  581. // Boolean field: Enable asynchronous DMA request in stop mode for channel 21
  582. static const uint32_t DMA_EARS_EDREQ_21 = 1U << 21 ;
  583. // Boolean field: Enable asynchronous DMA request in stop mode for channel 22
  584. static const uint32_t DMA_EARS_EDREQ_22 = 1U << 22 ;
  585. // Boolean field: Enable asynchronous DMA request in stop mode for channel 23
  586. static const uint32_t DMA_EARS_EDREQ_23 = 1U << 23 ;
  587. // Boolean field: Enable asynchronous DMA request in stop mode for channel 24
  588. static const uint32_t DMA_EARS_EDREQ_24 = 1U << 24 ;
  589. // Boolean field: Enable asynchronous DMA request in stop mode for channel 25
  590. static const uint32_t DMA_EARS_EDREQ_25 = 1U << 25 ;
  591. // Boolean field: Enable asynchronous DMA request in stop mode for channel 26
  592. static const uint32_t DMA_EARS_EDREQ_26 = 1U << 26 ;
  593. // Boolean field: Enable asynchronous DMA request in stop mode for channel 27
  594. static const uint32_t DMA_EARS_EDREQ_27 = 1U << 27 ;
  595. // Boolean field: Enable asynchronous DMA request in stop mode for channel 28
  596. static const uint32_t DMA_EARS_EDREQ_28 = 1U << 28 ;
  597. // Boolean field: Enable asynchronous DMA request in stop mode for channel 29
  598. static const uint32_t DMA_EARS_EDREQ_29 = 1U << 29 ;
  599. // Boolean field: Enable asynchronous DMA request in stop mode for channel 30
  600. static const uint32_t DMA_EARS_EDREQ_30 = 1U << 30 ;
  601. // Boolean field: Enable asynchronous DMA request in stop mode for channel 31
  602. static const uint32_t DMA_EARS_EDREQ_31 = 1U << 31 ;
  603. //-------------------- Channel n Priority Register (idx = 0 ... 31)
  604. #define DMA_DCHPRI(idx) (* ((volatile uint8_t *) (0x40008000 + 0x100 + 0x1 * (idx))))
  605. // Field (width: 4 bits): Channel n Arbitration Priority
  606. inline uint8_t DMA_DCHPRI_CHPRI (const uint8_t inValue) { return (inValue & 15U) << 0 ; }
  607. // Field (width: 2 bits): Channel n Current Group Priority
  608. inline uint8_t DMA_DCHPRI_GRPPRI (const uint8_t inValue) { return (inValue & 3U) << 4 ; }
  609. // Boolean field: Disable Preempt Ability.
  610. static const uint8_t DMA_DCHPRI_DPA = 1U << 6 ;
  611. // Boolean field: Enable Channel Preemption.
  612. static const uint8_t DMA_DCHPRI_ECP = 1U << 7 ;
  613. //-------------------- TCD Source Address (idx = 0 ... 31)
  614. #define DMA_TCD_SADDR(idx) (* ((volatile uint32_t *) (0x40008000 + 0x1000 + 0x20 * (idx))))
  615. //-------------------- TCD Signed Source Address Offset (idx = 0 ... 31)
  616. #define DMA_TCD_SOFF(idx) (* ((volatile uint16_t *) (0x40008000 + 0x1004 + 0x20 * (idx))))
  617. //-------------------- TCD Transfer Attributes (idx = 0 ... 31)
  618. #define DMA_TCD_ATTR(idx) (* ((volatile uint16_t *) (0x40008000 + 0x1006 + 0x20 * (idx))))
  619. // Field (width: 3 bits): Destination data transfer size
  620. inline uint16_t DMA_TCD_ATTR_DSIZE (const uint16_t inValue) { return (inValue & 7U) << 0 ; }
  621. // Field (width: 5 bits): Destination Address Modulo
  622. inline uint16_t DMA_TCD_ATTR_DMOD (const uint16_t inValue) { return (inValue & 31U) << 3 ; }
  623. // Field (width: 3 bits): Source data transfer size
  624. inline uint16_t DMA_TCD_ATTR_SSIZE (const uint16_t inValue) { return (inValue & 7U) << 8 ; }
  625. // Field (width: 5 bits): Source Address Modulo
  626. inline uint16_t DMA_TCD_ATTR_SMOD (const uint16_t inValue) { return (inValue & 31U) << 11 ; }
  627. //-------------------- TCD Minor Byte Count (Minor Loop Mapping Disabled) (idx = 0 ... 31)
  628. #define DMA_TCD_NBYTES_MLNO(idx) (* ((volatile uint32_t *) (0x40008000 + 0x1008 + 0x20 * (idx))))
  629. //-------------------- TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled) (idx = 0 ... 31)
  630. #define DMA_TCD_NBYTES_MLOFFNO(idx) (* ((volatile uint32_t *) (0x40008000 + 0x1008 + 0x20 * (idx))))
  631. // Field (width: 30 bits): Minor Byte Transfer Count
  632. inline uint32_t DMA_TCD_NBYTES_MLOFFNO_NBYTES (const uint32_t inValue) { return (inValue & 1073741823U) << 0 ; }
  633. // Boolean field: Destination Minor Loop Offset enable
  634. static const uint32_t DMA_TCD_NBYTES_MLOFFNO_DMLOE = 1U << 30 ;
  635. // Boolean field: Source Minor Loop Offset Enable
  636. static const uint32_t DMA_TCD_NBYTES_MLOFFNO_SMLOE = 1U << 31 ;
  637. //-------------------- TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled) (idx = 0 ... 31)
  638. #define DMA_TCD_NBYTES_MLOFFYES(idx) (* ((volatile uint32_t *) (0x40008000 + 0x1008 + 0x20 * (idx))))
  639. // Field (width: 10 bits): Minor Byte Transfer Count
  640. inline uint32_t DMA_TCD_NBYTES_MLOFFYES_NBYTES (const uint32_t inValue) { return (inValue & 1023U) << 0 ; }
  641. // Field (width: 20 bits): If SMLOE or DMLOE is set, this field represents a sign-extended offset applied to the source or destination address to form the next-state value after the minor loop completes.
  642. inline uint32_t DMA_TCD_NBYTES_MLOFFYES_MLOFF (const uint32_t inValue) { return (inValue & 1048575U) << 10 ; }
  643. // Boolean field: Destination Minor Loop Offset enable
  644. static const uint32_t DMA_TCD_NBYTES_MLOFFYES_DMLOE = 1U << 30 ;
  645. // Boolean field: Source Minor Loop Offset Enable
  646. static const uint32_t DMA_TCD_NBYTES_MLOFFYES_SMLOE = 1U << 31 ;
  647. //-------------------- TCD Last Source Address Adjustment (idx = 0 ... 31)
  648. #define DMA_TCD_SLAST(idx) (* ((volatile uint32_t *) (0x40008000 + 0x100C + 0x20 * (idx))))
  649. //-------------------- TCD Destination Address (idx = 0 ... 31)
  650. #define DMA_TCD_DADDR(idx) (* ((volatile uint32_t *) (0x40008000 + 0x1010 + 0x20 * (idx))))
  651. //-------------------- TCD Signed Destination Address Offset (idx = 0 ... 31)
  652. #define DMA_TCD_DOFF(idx) (* ((volatile uint16_t *) (0x40008000 + 0x1014 + 0x20 * (idx))))
  653. //-------------------- TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled) (idx = 0 ... 31)
  654. #define DMA_TCD_CITER_ELINKNO(idx) (* ((volatile uint16_t *) (0x40008000 + 0x1016 + 0x20 * (idx))))
  655. // Field (width: 15 bits): Current Major Iteration Count
  656. inline uint16_t DMA_TCD_CITER_ELINKNO_CITER (const uint16_t inValue) { return (inValue & 32767U) << 0 ; }
  657. // Boolean field: Enable channel-to-channel linking on minor-loop complete
  658. static const uint16_t DMA_TCD_CITER_ELINKNO_ELINK = 1U << 15 ;
  659. //-------------------- TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled) (idx = 0 ... 31)
  660. #define DMA_TCD_CITER_ELINKYES(idx) (* ((volatile uint16_t *) (0x40008000 + 0x1016 + 0x20 * (idx))))
  661. // Field (width: 9 bits): Current Major Iteration Count
  662. inline uint16_t DMA_TCD_CITER_ELINKYES_CITER (const uint16_t inValue) { return (inValue & 511U) << 0 ; }
  663. // Field (width: 5 bits): Minor Loop Link Channel Number
  664. inline uint16_t DMA_TCD_CITER_ELINKYES_LINKCH (const uint16_t inValue) { return (inValue & 31U) << 9 ; }
  665. // Boolean field: Enable channel-to-channel linking on minor-loop complete
  666. static const uint16_t DMA_TCD_CITER_ELINKYES_ELINK = 1U << 15 ;
  667. //-------------------- TCD Last Destination Address Adjustment/Scatter Gather Address (idx = 0 ... 31)
  668. #define DMA_TCD_DLASTSGA(idx) (* ((volatile uint32_t *) (0x40008000 + 0x1018 + 0x20 * (idx))))
  669. //-------------------- TCD Control and Status (idx = 0 ... 31)
  670. #define DMA_TCD_CSR(idx) (* ((volatile uint16_t *) (0x40008000 + 0x101C + 0x20 * (idx))))
  671. // Boolean field: Channel Start
  672. static const uint16_t DMA_TCD_CSR_START = 1U << 0 ;
  673. // Boolean field: Enable an interrupt when major iteration count completes.
  674. static const uint16_t DMA_TCD_CSR_INTMAJOR = 1U << 1 ;
  675. // Boolean field: Enable an interrupt when major counter is half complete.
  676. static const uint16_t DMA_TCD_CSR_INTHALF = 1U << 2 ;
  677. // Boolean field: Disable Request
  678. static const uint16_t DMA_TCD_CSR_DREQ = 1U << 3 ;
  679. // Boolean field: Enable Scatter/Gather Processing
  680. static const uint16_t DMA_TCD_CSR_ESG = 1U << 4 ;
  681. // Boolean field: Enable channel-to-channel linking on major loop complete
  682. static const uint16_t DMA_TCD_CSR_MAJORELINK = 1U << 5 ;
  683. // Boolean field: Channel Active
  684. static const uint16_t DMA_TCD_CSR_ACTIVE = 1U << 6 ;
  685. // Boolean field: Channel Done
  686. static const uint16_t DMA_TCD_CSR_DONE = 1U << 7 ;
  687. // Field (width: 5 bits): Major Loop Link Channel Number
  688. inline uint16_t DMA_TCD_CSR_MAJORLINKCH (const uint16_t inValue) { return (inValue & 31U) << 8 ; }
  689. // Field (width: 2 bits): Bandwidth Control
  690. inline uint16_t DMA_TCD_CSR_BWC (const uint16_t inValue) { return (inValue & 3U) << 14 ; }
  691. //-------------------- TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled) (idx = 0 ... 31)
  692. #define DMA_TCD_BITER_ELINKNO(idx) (* ((volatile uint16_t *) (0x40008000 + 0x101E + 0x20 * (idx))))
  693. // Field (width: 15 bits): Starting Major Iteration Count
  694. inline uint16_t DMA_TCD_BITER_ELINKNO_BITER (const uint16_t inValue) { return (inValue & 32767U) << 0 ; }
  695. // Boolean field: Enables channel-to-channel linking on minor loop complete
  696. static const uint16_t DMA_TCD_BITER_ELINKNO_ELINK = 1U << 15 ;
  697. //-------------------- TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled) (idx = 0 ... 31)
  698. #define DMA_TCD_BITER_ELINKYES(idx) (* ((volatile uint16_t *) (0x40008000 + 0x101E + 0x20 * (idx))))
  699. // Field (width: 9 bits): Starting major iteration count
  700. inline uint16_t DMA_TCD_BITER_ELINKYES_BITER (const uint16_t inValue) { return (inValue & 511U) << 0 ; }
  701. // Field (width: 5 bits): Link Channel Number
  702. inline uint16_t DMA_TCD_BITER_ELINKYES_LINKCH (const uint16_t inValue) { return (inValue & 31U) << 9 ; }
  703. // Boolean field: Enables channel-to-channel linking on minor loop complete
  704. static const uint16_t DMA_TCD_BITER_ELINKYES_ELINK = 1U << 15 ;
  705. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  706. // Peripheral FB
  707. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  708. //-------------------- Chip Select Address Register (idx = 0 ... 5)
  709. #define FB_CSAR(idx) (* ((volatile uint32_t *) (0x4000C000 + 0 + 0xC * (idx))))
  710. // Field (width: 16 bits): Base Address
  711. inline uint32_t FB_CSAR_BA (const uint32_t inValue) { return (inValue & 65535U) << 16 ; }
  712. //-------------------- Chip Select Mask Register (idx = 0 ... 5)
  713. #define FB_CSMR(idx) (* ((volatile uint32_t *) (0x4000C000 + 0x4 + 0xC * (idx))))
  714. // Boolean field: Valid
  715. static const uint32_t FB_CSMR_V = 1U << 0 ;
  716. // Boolean field: Write Protect
  717. static const uint32_t FB_CSMR_WP = 1U << 8 ;
  718. // Field (width: 16 bits): Base Address Mask
  719. inline uint32_t FB_CSMR_BAM (const uint32_t inValue) { return (inValue & 65535U) << 16 ; }
  720. //-------------------- Chip Select Control Register (idx = 0 ... 5)
  721. #define FB_CSCR(idx) (* ((volatile uint32_t *) (0x4000C000 + 0x8 + 0xC * (idx))))
  722. // Boolean field: Burst-Write Enable
  723. static const uint32_t FB_CSCR_BSTW = 1U << 3 ;
  724. // Boolean field: Burst-Read Enable
  725. static const uint32_t FB_CSCR_BSTR = 1U << 4 ;
  726. // Boolean field: Byte-Enable Mode
  727. static const uint32_t FB_CSCR_BEM = 1U << 5 ;
  728. // Field (width: 2 bits): Port Size
  729. inline uint32_t FB_CSCR_PS (const uint32_t inValue) { return (inValue & 3U) << 6 ; }
  730. // Boolean field: Auto-Acknowledge Enable
  731. static const uint32_t FB_CSCR_AA = 1U << 8 ;
  732. // Boolean field: Byte-Lane Shift
  733. static const uint32_t FB_CSCR_BLS = 1U << 9 ;
  734. // Field (width: 6 bits): Wait States
  735. inline uint32_t FB_CSCR_WS (const uint32_t inValue) { return (inValue & 63U) << 10 ; }
  736. // Field (width: 2 bits): Write Address Hold or Deselect
  737. inline uint32_t FB_CSCR_WRAH (const uint32_t inValue) { return (inValue & 3U) << 16 ; }
  738. // Field (width: 2 bits): Read Address Hold or Deselect
  739. inline uint32_t FB_CSCR_RDAH (const uint32_t inValue) { return (inValue & 3U) << 18 ; }
  740. // Field (width: 2 bits): Address Setup
  741. inline uint32_t FB_CSCR_ASET (const uint32_t inValue) { return (inValue & 3U) << 20 ; }
  742. // Boolean field: Extended Transfer Start/Extended Address Latch Enable Controls how long FB_TS /FB_ALE is asserted.
  743. static const uint32_t FB_CSCR_EXTS = 1U << 22 ;
  744. // Boolean field: Secondary Wait State Enable
  745. static const uint32_t FB_CSCR_SWSEN = 1U << 23 ;
  746. // Field (width: 6 bits): Secondary Wait States
  747. inline uint32_t FB_CSCR_SWS (const uint32_t inValue) { return (inValue & 63U) << 26 ; }
  748. //-------------------- Chip Select port Multiplexing Control Register
  749. #define FB_CSPMCR (* ((volatile uint32_t *) (0x4000C000 + 0x60)))
  750. // Field (width: 4 bits): FlexBus Signal Group 5 Multiplex control
  751. inline uint32_t FB_CSPMCR_GROUP5 (const uint32_t inValue) { return (inValue & 15U) << 12 ; }
  752. // Field (width: 4 bits): FlexBus Signal Group 4 Multiplex control
  753. inline uint32_t FB_CSPMCR_GROUP4 (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  754. // Field (width: 4 bits): FlexBus Signal Group 3 Multiplex control
  755. inline uint32_t FB_CSPMCR_GROUP3 (const uint32_t inValue) { return (inValue & 15U) << 20 ; }
  756. // Field (width: 4 bits): FlexBus Signal Group 2 Multiplex control
  757. inline uint32_t FB_CSPMCR_GROUP2 (const uint32_t inValue) { return (inValue & 15U) << 24 ; }
  758. // Field (width: 4 bits): FlexBus Signal Group 1 Multiplex control
  759. inline uint32_t FB_CSPMCR_GROUP1 (const uint32_t inValue) { return (inValue & 15U) << 28 ; }
  760. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  761. // Peripheral MPU
  762. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  763. //-------------------- Control/Error Status Register
  764. #define MPU_CESR (* ((volatile uint32_t *) (0x4000D000 + 0)))
  765. // Boolean field: Valid
  766. static const uint32_t MPU_CESR_VLD = 1U << 0 ;
  767. // Field (width: 4 bits): Number Of Region Descriptors
  768. inline uint32_t MPU_CESR_NRGD (const uint32_t inValue) { return (inValue & 15U) << 8 ; }
  769. // Field (width: 4 bits): Number Of Slave Ports
  770. inline uint32_t MPU_CESR_NSP (const uint32_t inValue) { return (inValue & 15U) << 12 ; }
  771. // Field (width: 4 bits): Hardware Revision Level
  772. inline uint32_t MPU_CESR_HRL (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  773. // Field (width: 5 bits): Slave Port n Error
  774. inline uint32_t MPU_CESR_SPERR (const uint32_t inValue) { return (inValue & 31U) << 27 ; }
  775. //-------------------- Error Address Register, slave port n (idx = 0 ... 4)
  776. #define MPU_EAR(idx) (* ((const volatile uint32_t *) (0x4000D000 + 0x10 + 0x8 * (idx))))
  777. //-------------------- Error Detail Register, slave port n (idx = 0 ... 4)
  778. #define MPU_EDR(idx) (* ((const volatile uint32_t *) (0x4000D000 + 0x14 + 0x8 * (idx))))
  779. // Boolean field: Error Read/Write
  780. static const uint32_t MPU_EDR_ERW = 1U << 0 ;
  781. // Field (width: 3 bits): Error Attributes
  782. inline uint32_t MPU_EDR_EATTR (const uint32_t inValue) { return (inValue & 7U) << 1 ; }
  783. // Field (width: 4 bits): Error Master Number
  784. inline uint32_t MPU_EDR_EMN (const uint32_t inValue) { return (inValue & 15U) << 4 ; }
  785. // Field (width: 8 bits): Error Process Identification
  786. inline uint32_t MPU_EDR_EPID (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  787. // Field (width: 16 bits): Error Access Control Detail
  788. inline uint32_t MPU_EDR_EACD (const uint32_t inValue) { return (inValue & 65535U) << 16 ; }
  789. //-------------------- Region Descriptor n, Word 0 (idx = 0 ... 11)
  790. #define MPU_RGD_WORD0(idx) (* ((volatile uint32_t *) (0x4000D000 + 0x400 + 0x10 * (idx))))
  791. // Field (width: 27 bits): Start Address
  792. inline uint32_t MPU_RGD_WORD0_SRTADDR (const uint32_t inValue) { return (inValue & 134217727U) << 5 ; }
  793. //-------------------- Region Descriptor n, Word 1 (idx = 0 ... 11)
  794. #define MPU_RGD_WORD1(idx) (* ((volatile uint32_t *) (0x4000D000 + 0x404 + 0x10 * (idx))))
  795. // Field (width: 27 bits): End Address
  796. inline uint32_t MPU_RGD_WORD1_ENDADDR (const uint32_t inValue) { return (inValue & 134217727U) << 5 ; }
  797. //-------------------- Region Descriptor n, Word 2 (idx = 0 ... 11)
  798. #define MPU_RGD_WORD2(idx) (* ((volatile uint32_t *) (0x4000D000 + 0x408 + 0x10 * (idx))))
  799. // Field (width: 3 bits): Bus Master 0 User Mode Access Control
  800. inline uint32_t MPU_RGD_WORD2_M0UM (const uint32_t inValue) { return (inValue & 7U) << 0 ; }
  801. // Field (width: 2 bits): Bus Master 0 Supervisor Mode Access Control
  802. inline uint32_t MPU_RGD_WORD2_M0SM (const uint32_t inValue) { return (inValue & 3U) << 3 ; }
  803. // Boolean field: Bus Master 0 Process Identifier enable
  804. static const uint32_t MPU_RGD_WORD2_M0PE = 1U << 5 ;
  805. // Field (width: 3 bits): Bus Master 1 User Mode Access Control
  806. inline uint32_t MPU_RGD_WORD2_M1UM (const uint32_t inValue) { return (inValue & 7U) << 6 ; }
  807. // Field (width: 2 bits): Bus Master 1 Supervisor Mode Access Control
  808. inline uint32_t MPU_RGD_WORD2_M1SM (const uint32_t inValue) { return (inValue & 3U) << 9 ; }
  809. // Boolean field: Bus Master 1 Process Identifier enable
  810. static const uint32_t MPU_RGD_WORD2_M1PE = 1U << 11 ;
  811. // Field (width: 3 bits): Bus Master 2 User Mode Access control
  812. inline uint32_t MPU_RGD_WORD2_M2UM (const uint32_t inValue) { return (inValue & 7U) << 12 ; }
  813. // Field (width: 2 bits): Bus Master 2 Supervisor Mode Access Control
  814. inline uint32_t MPU_RGD_WORD2_M2SM (const uint32_t inValue) { return (inValue & 3U) << 15 ; }
  815. // Boolean field: Bus Master 2 Process Identifier Enable
  816. static const uint32_t MPU_RGD_WORD2_M2PE = 1U << 17 ;
  817. // Field (width: 3 bits): Bus Master 3 User Mode Access Control
  818. inline uint32_t MPU_RGD_WORD2_M3UM (const uint32_t inValue) { return (inValue & 7U) << 18 ; }
  819. // Field (width: 2 bits): Bus Master 3 Supervisor Mode Access Control
  820. inline uint32_t MPU_RGD_WORD2_M3SM (const uint32_t inValue) { return (inValue & 3U) << 21 ; }
  821. // Boolean field: Bus Master 3 Process Identifier Enable
  822. static const uint32_t MPU_RGD_WORD2_M3PE = 1U << 23 ;
  823. // Boolean field: Bus Master 4 Write Enable
  824. static const uint32_t MPU_RGD_WORD2_M4WE = 1U << 24 ;
  825. // Boolean field: Bus Master 4 Read Enable
  826. static const uint32_t MPU_RGD_WORD2_M4RE = 1U << 25 ;
  827. // Boolean field: Bus Master 5 Write Enable
  828. static const uint32_t MPU_RGD_WORD2_M5WE = 1U << 26 ;
  829. // Boolean field: Bus Master 5 Read Enable
  830. static const uint32_t MPU_RGD_WORD2_M5RE = 1U << 27 ;
  831. // Boolean field: Bus Master 6 Write Enable
  832. static const uint32_t MPU_RGD_WORD2_M6WE = 1U << 28 ;
  833. // Boolean field: Bus Master 6 Read Enable
  834. static const uint32_t MPU_RGD_WORD2_M6RE = 1U << 29 ;
  835. // Boolean field: Bus Master 7 Write Enable
  836. static const uint32_t MPU_RGD_WORD2_M7WE = 1U << 30 ;
  837. // Boolean field: Bus Master 7 Read Enable
  838. static const uint32_t MPU_RGD_WORD2_M7RE = 1U << 31 ;
  839. //-------------------- Region Descriptor n, Word 3 (idx = 0 ... 11)
  840. #define MPU_RGD_WORD3(idx) (* ((volatile uint32_t *) (0x4000D000 + 0x40C + 0x10 * (idx))))
  841. // Boolean field: Valid
  842. static const uint32_t MPU_RGD_WORD3_VLD = 1U << 0 ;
  843. // Field (width: 8 bits): Process Identifier Mask
  844. inline uint32_t MPU_RGD_WORD3_PIDMASK (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  845. // Field (width: 8 bits): Process Identifier
  846. inline uint32_t MPU_RGD_WORD3_PID (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  847. //-------------------- Region Descriptor Alternate Access Control n (idx = 0 ... 11)
  848. #define MPU_RGDAAC(idx) (* ((volatile uint32_t *) (0x4000D000 + 0x800 + 0x4 * (idx))))
  849. // Field (width: 3 bits): Bus Master 0 User Mode Access Control
  850. inline uint32_t MPU_RGDAAC_M0UM (const uint32_t inValue) { return (inValue & 7U) << 0 ; }
  851. // Field (width: 2 bits): Bus Master 0 Supervisor Mode Access Control
  852. inline uint32_t MPU_RGDAAC_M0SM (const uint32_t inValue) { return (inValue & 3U) << 3 ; }
  853. // Boolean field: Bus Master 0 Process Identifier Enable
  854. static const uint32_t MPU_RGDAAC_M0PE = 1U << 5 ;
  855. // Field (width: 3 bits): Bus Master 1 User Mode Access Control
  856. inline uint32_t MPU_RGDAAC_M1UM (const uint32_t inValue) { return (inValue & 7U) << 6 ; }
  857. // Field (width: 2 bits): Bus Master 1 Supervisor Mode Access Control
  858. inline uint32_t MPU_RGDAAC_M1SM (const uint32_t inValue) { return (inValue & 3U) << 9 ; }
  859. // Boolean field: Bus Master 1 Process Identifier Enable
  860. static const uint32_t MPU_RGDAAC_M1PE = 1U << 11 ;
  861. // Field (width: 3 bits): Bus Master 2 User Mode Access Control
  862. inline uint32_t MPU_RGDAAC_M2UM (const uint32_t inValue) { return (inValue & 7U) << 12 ; }
  863. // Field (width: 2 bits): Bus Master 2 Supervisor Mode Access Control
  864. inline uint32_t MPU_RGDAAC_M2SM (const uint32_t inValue) { return (inValue & 3U) << 15 ; }
  865. // Boolean field: Bus Master 2 Process Identifier Enable
  866. static const uint32_t MPU_RGDAAC_M2PE = 1U << 17 ;
  867. // Field (width: 3 bits): Bus Master 3 User Mode Access Control
  868. inline uint32_t MPU_RGDAAC_M3UM (const uint32_t inValue) { return (inValue & 7U) << 18 ; }
  869. // Field (width: 2 bits): Bus Master 3 Supervisor Mode Access Control
  870. inline uint32_t MPU_RGDAAC_M3SM (const uint32_t inValue) { return (inValue & 3U) << 21 ; }
  871. // Boolean field: Bus Master 3 Process Identifier Enable
  872. static const uint32_t MPU_RGDAAC_M3PE = 1U << 23 ;
  873. // Boolean field: Bus Master 4 Write Enable
  874. static const uint32_t MPU_RGDAAC_M4WE = 1U << 24 ;
  875. // Boolean field: Bus Master 4 Read Enable
  876. static const uint32_t MPU_RGDAAC_M4RE = 1U << 25 ;
  877. // Boolean field: Bus Master 5 Write Enable
  878. static const uint32_t MPU_RGDAAC_M5WE = 1U << 26 ;
  879. // Boolean field: Bus Master 5 Read Enable
  880. static const uint32_t MPU_RGDAAC_M5RE = 1U << 27 ;
  881. // Boolean field: Bus Master 6 Write Enable
  882. static const uint32_t MPU_RGDAAC_M6WE = 1U << 28 ;
  883. // Boolean field: Bus Master 6 Read Enable
  884. static const uint32_t MPU_RGDAAC_M6RE = 1U << 29 ;
  885. // Boolean field: Bus Master 7 Write Enable
  886. static const uint32_t MPU_RGDAAC_M7WE = 1U << 30 ;
  887. // Boolean field: Bus Master 7 Read Enable
  888. static const uint32_t MPU_RGDAAC_M7RE = 1U << 31 ;
  889. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  890. // Peripheral SDRAM
  891. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  892. //-------------------- Control Register
  893. #define SDRAM_CTRL (* ((volatile uint16_t *) (0x4000F000 + 0x42)))
  894. // Field (width: 9 bits): Refresh count
  895. inline uint16_t SDRAM_CTRL_RC (const uint16_t inValue) { return (inValue & 511U) << 0 ; }
  896. // Field (width: 2 bits): Refresh timing
  897. inline uint16_t SDRAM_CTRL_RTIM (const uint16_t inValue) { return (inValue & 3U) << 9 ; }
  898. // Boolean field: Initiate self-refresh command.
  899. static const uint16_t SDRAM_CTRL_IS = 1U << 11 ;
  900. //-------------------- Address and Control Register (idx = 0 ... 1)
  901. #define SDRAM_AC(idx) (* ((volatile uint32_t *) (0x4000F000 + 0x48 + 0x8 * (idx))))
  902. // Boolean field: Initiate precharge all (pall) command.
  903. static const uint32_t SDRAM_AC_IP = 1U << 3 ;
  904. // Field (width: 2 bits): Port size.
  905. inline uint32_t SDRAM_AC_PS (const uint32_t inValue) { return (inValue & 3U) << 4 ; }
  906. // Boolean field: Initiate mode register set (mrs) command.
  907. static const uint32_t SDRAM_AC_IMRS = 1U << 6 ;
  908. // Field (width: 3 bits): Command bit location
  909. inline uint32_t SDRAM_AC_CBM (const uint32_t inValue) { return (inValue & 7U) << 8 ; }
  910. // Field (width: 2 bits): CAS Latency
  911. inline uint32_t SDRAM_AC_CASL (const uint32_t inValue) { return (inValue & 3U) << 12 ; }
  912. // Boolean field: Refresh enable
  913. static const uint32_t SDRAM_AC_RE = 1U << 15 ;
  914. // Field (width: 14 bits): Base address register.
  915. inline uint32_t SDRAM_AC_BA (const uint32_t inValue) { return (inValue & 16383U) << 18 ; }
  916. //-------------------- Control Mask (idx = 0 ... 1)
  917. #define SDRAM_CM(idx) (* ((volatile uint32_t *) (0x4000F000 + 0x4C + 0x8 * (idx))))
  918. // Boolean field: Valid.
  919. static const uint32_t SDRAM_CM_V = 1U << 0 ;
  920. // Boolean field: Write protect.
  921. static const uint32_t SDRAM_CM_WP = 1U << 8 ;
  922. // Field (width: 14 bits): Base address mask.
  923. inline uint32_t SDRAM_CM_BAM (const uint32_t inValue) { return (inValue & 16383U) << 18 ; }
  924. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  925. // Peripheral FMC
  926. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  927. //-------------------- Flash Access Protection Register
  928. #define FMC_PFAPR (* ((volatile uint32_t *) (0x4001F000 + 0)))
  929. // Field (width: 2 bits): Master 0 Access Protection
  930. inline uint32_t FMC_PFAPR_M0AP (const uint32_t inValue) { return (inValue & 3U) << 0 ; }
  931. // Field (width: 2 bits): Master 1 Access Protection
  932. inline uint32_t FMC_PFAPR_M1AP (const uint32_t inValue) { return (inValue & 3U) << 2 ; }
  933. // Field (width: 2 bits): Master 2 Access Protection
  934. inline uint32_t FMC_PFAPR_M2AP (const uint32_t inValue) { return (inValue & 3U) << 4 ; }
  935. // Field (width: 2 bits): Master 3 Access Protection
  936. inline uint32_t FMC_PFAPR_M3AP (const uint32_t inValue) { return (inValue & 3U) << 6 ; }
  937. // Field (width: 2 bits): Master 4 Access Protection
  938. inline uint32_t FMC_PFAPR_M4AP (const uint32_t inValue) { return (inValue & 3U) << 8 ; }
  939. // Field (width: 2 bits): Master 5 Access Protection
  940. inline uint32_t FMC_PFAPR_M5AP (const uint32_t inValue) { return (inValue & 3U) << 10 ; }
  941. // Field (width: 2 bits): Master 6 Access Protection
  942. inline uint32_t FMC_PFAPR_M6AP (const uint32_t inValue) { return (inValue & 3U) << 12 ; }
  943. // Field (width: 2 bits): Master 7 Access Protection
  944. inline uint32_t FMC_PFAPR_M7AP (const uint32_t inValue) { return (inValue & 3U) << 14 ; }
  945. // Boolean field: Master 0 Prefetch Disable
  946. static const uint32_t FMC_PFAPR_M0PFD = 1U << 16 ;
  947. // Boolean field: Master 1 Prefetch Disable
  948. static const uint32_t FMC_PFAPR_M1PFD = 1U << 17 ;
  949. // Boolean field: Master 2 Prefetch Disable
  950. static const uint32_t FMC_PFAPR_M2PFD = 1U << 18 ;
  951. // Boolean field: Master 3 Prefetch Disable
  952. static const uint32_t FMC_PFAPR_M3PFD = 1U << 19 ;
  953. // Boolean field: Master 4 Prefetch Disable
  954. static const uint32_t FMC_PFAPR_M4PFD = 1U << 20 ;
  955. // Boolean field: Master 5 Prefetch Disable
  956. static const uint32_t FMC_PFAPR_M5PFD = 1U << 21 ;
  957. // Boolean field: Master 6 Prefetch Disable
  958. static const uint32_t FMC_PFAPR_M6PFD = 1U << 22 ;
  959. // Boolean field: Master 7 Prefetch Disable
  960. static const uint32_t FMC_PFAPR_M7PFD = 1U << 23 ;
  961. //-------------------- Flash Bank 0-1 Control Register
  962. #define FMC_PFB01CR (* ((volatile uint32_t *) (0x4001F000 + 0x4)))
  963. // Boolean field: Reserved for future use
  964. static const uint32_t FMC_PFB01CR_RFU = 1U << 0 ;
  965. // Boolean field: Bank 0 Instruction Prefetch Enable
  966. static const uint32_t FMC_PFB01CR_B0IPE = 1U << 1 ;
  967. // Boolean field: Bank 0 Data Prefetch Enable
  968. static const uint32_t FMC_PFB01CR_B0DPE = 1U << 2 ;
  969. // Boolean field: Bank 0 Instruction Cache Enable
  970. static const uint32_t FMC_PFB01CR_B0ICE = 1U << 3 ;
  971. // Boolean field: Bank 0 Data Cache Enable
  972. static const uint32_t FMC_PFB01CR_B0DCE = 1U << 4 ;
  973. // Field (width: 3 bits): Cache Replacement Control
  974. inline uint32_t FMC_PFB01CR_CRC (const uint32_t inValue) { return (inValue & 7U) << 5 ; }
  975. // Field (width: 2 bits): Bank 0 Memory Width
  976. inline uint32_t FMC_PFB01CR_B0MW (const uint32_t inValue) { return (inValue & 3U) << 17 ; }
  977. // Boolean field: Invalidate Prefetch Speculation Buffer
  978. static const uint32_t FMC_PFB01CR_S_B_INV = 1U << 19 ;
  979. // Field (width: 4 bits): Cache Invalidate Way x
  980. inline uint32_t FMC_PFB01CR_CINV_WAY (const uint32_t inValue) { return (inValue & 15U) << 20 ; }
  981. // Field (width: 4 bits): Cache Lock Way x
  982. inline uint32_t FMC_PFB01CR_CLCK_WAY (const uint32_t inValue) { return (inValue & 15U) << 24 ; }
  983. // Field (width: 4 bits): Bank 0 Read Wait State Control
  984. inline uint32_t FMC_PFB01CR_B0RWSC (const uint32_t inValue) { return (inValue & 15U) << 28 ; }
  985. //-------------------- Flash Bank 2-3 Control Register
  986. #define FMC_PFB23CR (* ((volatile uint32_t *) (0x4001F000 + 0x8)))
  987. // Boolean field: Reserved for future use
  988. static const uint32_t FMC_PFB23CR_RFU = 1U << 0 ;
  989. // Boolean field: Bank 1 Instruction Prefetch Enable
  990. static const uint32_t FMC_PFB23CR_B1IPE = 1U << 1 ;
  991. // Boolean field: Bank 1 Data Prefetch Enable
  992. static const uint32_t FMC_PFB23CR_B1DPE = 1U << 2 ;
  993. // Boolean field: Bank 1 Instruction Cache Enable
  994. static const uint32_t FMC_PFB23CR_B1ICE = 1U << 3 ;
  995. // Boolean field: Bank 1 Data Cache Enable
  996. static const uint32_t FMC_PFB23CR_B1DCE = 1U << 4 ;
  997. // Field (width: 2 bits): Bank 1 Memory Width
  998. inline uint32_t FMC_PFB23CR_B1MW (const uint32_t inValue) { return (inValue & 3U) << 17 ; }
  999. // Field (width: 4 bits): Bank 1 Read Wait State Control
  1000. inline uint32_t FMC_PFB23CR_B1RWSC (const uint32_t inValue) { return (inValue & 15U) << 28 ; }
  1001. //-------------------- Cache Tag Storage (idx = 0 ... 3)
  1002. #define FMC_TAGVDW0S(idx) (* ((volatile uint32_t *) (0x4001F000 + 0x100 + 0x4 * (idx))))
  1003. // Boolean field: 1-bit valid for cache entry
  1004. static const uint32_t FMC_TAGVDW0S_valid = 1U << 0 ;
  1005. // Field (width: 16 bits): 16-bit tag for cache entry
  1006. inline uint32_t FMC_TAGVDW0S_tag (const uint32_t inValue) { return (inValue & 65535U) << 6 ; }
  1007. //-------------------- Cache Tag Storage (idx = 0 ... 3)
  1008. #define FMC_TAGVDW1S(idx) (* ((volatile uint32_t *) (0x4001F000 + 0x110 + 0x4 * (idx))))
  1009. // Boolean field: 1-bit valid for cache entry
  1010. static const uint32_t FMC_TAGVDW1S_valid = 1U << 0 ;
  1011. // Field (width: 16 bits): 16-bit tag for cache entry
  1012. inline uint32_t FMC_TAGVDW1S_tag (const uint32_t inValue) { return (inValue & 65535U) << 6 ; }
  1013. //-------------------- Cache Tag Storage (idx = 0 ... 3)
  1014. #define FMC_TAGVDW2S(idx) (* ((volatile uint32_t *) (0x4001F000 + 0x120 + 0x4 * (idx))))
  1015. // Boolean field: 1-bit valid for cache entry
  1016. static const uint32_t FMC_TAGVDW2S_valid = 1U << 0 ;
  1017. // Field (width: 16 bits): 16-bit tag for cache entry
  1018. inline uint32_t FMC_TAGVDW2S_tag (const uint32_t inValue) { return (inValue & 65535U) << 6 ; }
  1019. //-------------------- Cache Tag Storage (idx = 0 ... 3)
  1020. #define FMC_TAGVDW3S(idx) (* ((volatile uint32_t *) (0x4001F000 + 0x130 + 0x4 * (idx))))
  1021. // Boolean field: 1-bit valid for cache entry
  1022. static const uint32_t FMC_TAGVDW3S_valid = 1U << 0 ;
  1023. // Field (width: 16 bits): 16-bit tag for cache entry
  1024. inline uint32_t FMC_TAGVDW3S_tag (const uint32_t inValue) { return (inValue & 65535U) << 6 ; }
  1025. //-------------------- Cache Data Storage (uppermost word) (idx = 0 ... 3)
  1026. #define FMC_DATAW0SUM(idx) (* ((volatile uint32_t *) (0x4001F000 + 0x200 + 0x10 * (idx))))
  1027. //-------------------- Cache Data Storage (mid-upper word) (idx = 0 ... 3)
  1028. #define FMC_DATAW0SMU(idx) (* ((volatile uint32_t *) (0x4001F000 + 0x204 + 0x10 * (idx))))
  1029. //-------------------- Cache Data Storage (mid-lower word) (idx = 0 ... 3)
  1030. #define FMC_DATAW0SML(idx) (* ((volatile uint32_t *) (0x4001F000 + 0x208 + 0x10 * (idx))))
  1031. //-------------------- Cache Data Storage (lowermost word) (idx = 0 ... 3)
  1032. #define FMC_DATAW0SLM(idx) (* ((volatile uint32_t *) (0x4001F000 + 0x20C + 0x10 * (idx))))
  1033. //-------------------- Cache Data Storage (uppermost word) (idx = 0 ... 3)
  1034. #define FMC_DATAW1SUM(idx) (* ((volatile uint32_t *) (0x4001F000 + 0x240 + 0x10 * (idx))))
  1035. //-------------------- Cache Data Storage (mid-upper word) (idx = 0 ... 3)
  1036. #define FMC_DATAW1SMU(idx) (* ((volatile uint32_t *) (0x4001F000 + 0x244 + 0x10 * (idx))))
  1037. //-------------------- Cache Data Storage (mid-lower word) (idx = 0 ... 3)
  1038. #define FMC_DATAW1SML(idx) (* ((volatile uint32_t *) (0x4001F000 + 0x248 + 0x10 * (idx))))
  1039. //-------------------- Cache Data Storage (lowermost word) (idx = 0 ... 3)
  1040. #define FMC_DATAW1SLM(idx) (* ((volatile uint32_t *) (0x4001F000 + 0x24C + 0x10 * (idx))))
  1041. //-------------------- Cache Data Storage (uppermost word) (idx = 0 ... 3)
  1042. #define FMC_DATAW2SUM(idx) (* ((volatile uint32_t *) (0x4001F000 + 0x280 + 0x10 * (idx))))
  1043. //-------------------- Cache Data Storage (mid-upper word) (idx = 0 ... 3)
  1044. #define FMC_DATAW2SMU(idx) (* ((volatile uint32_t *) (0x4001F000 + 0x284 + 0x10 * (idx))))
  1045. //-------------------- Cache Data Storage (mid-lower word) (idx = 0 ... 3)
  1046. #define FMC_DATAW2SML(idx) (* ((volatile uint32_t *) (0x4001F000 + 0x288 + 0x10 * (idx))))
  1047. //-------------------- Cache Data Storage (lowermost word) (idx = 0 ... 3)
  1048. #define FMC_DATAW2SLM(idx) (* ((volatile uint32_t *) (0x4001F000 + 0x28C + 0x10 * (idx))))
  1049. //-------------------- Cache Data Storage (uppermost word) (idx = 0 ... 3)
  1050. #define FMC_DATAW3SUM(idx) (* ((volatile uint32_t *) (0x4001F000 + 0x2C0 + 0x10 * (idx))))
  1051. //-------------------- Cache Data Storage (mid-upper word) (idx = 0 ... 3)
  1052. #define FMC_DATAW3SMU(idx) (* ((volatile uint32_t *) (0x4001F000 + 0x2C4 + 0x10 * (idx))))
  1053. //-------------------- Cache Data Storage (mid-lower word) (idx = 0 ... 3)
  1054. #define FMC_DATAW3SML(idx) (* ((volatile uint32_t *) (0x4001F000 + 0x2C8 + 0x10 * (idx))))
  1055. //-------------------- Cache Data Storage (lowermost word) (idx = 0 ... 3)
  1056. #define FMC_DATAW3SLM(idx) (* ((volatile uint32_t *) (0x4001F000 + 0x2CC + 0x10 * (idx))))
  1057. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  1058. // Peripheral FTFE
  1059. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  1060. //-------------------- Flash Status Register
  1061. #define FTFE_FSTAT (* ((volatile uint8_t *) (0x40020000 + 0)))
  1062. // Boolean field: Memory Controller Command Completion Status Flag
  1063. static const uint8_t FTFE_FSTAT_MGSTAT0 = 1U << 0 ;
  1064. // Boolean field: Flash Protection Violation Flag
  1065. static const uint8_t FTFE_FSTAT_FPVIOL = 1U << 4 ;
  1066. // Boolean field: Flash Access Error Flag
  1067. static const uint8_t FTFE_FSTAT_ACCERR = 1U << 5 ;
  1068. // Boolean field: FTFE Read Collision Error Flag
  1069. static const uint8_t FTFE_FSTAT_RDCOLERR = 1U << 6 ;
  1070. // Boolean field: Command Complete Interrupt Flag
  1071. static const uint8_t FTFE_FSTAT_CCIF = 1U << 7 ;
  1072. //-------------------- Flash Configuration Register
  1073. #define FTFE_FCNFG (* ((volatile uint8_t *) (0x40020000 + 0x1)))
  1074. // Boolean field: For devices with FlexNVM: This flag indicates if the EEPROM backup data has been copied to the FlexRAM and is therefore available for read access
  1075. static const uint8_t FTFE_FCNFG_EEERDY = 1U << 0 ;
  1076. // Boolean field: RAM Ready
  1077. static const uint8_t FTFE_FCNFG_RAMRDY = 1U << 1 ;
  1078. // Boolean field: FTFE configuration
  1079. static const uint8_t FTFE_FCNFG_PFLSH = 1U << 2 ;
  1080. // Boolean field: Swap
  1081. static const uint8_t FTFE_FCNFG_SWAP = 1U << 3 ;
  1082. // Boolean field: Erase Suspend
  1083. static const uint8_t FTFE_FCNFG_ERSSUSP = 1U << 4 ;
  1084. // Boolean field: Erase All Request
  1085. static const uint8_t FTFE_FCNFG_ERSAREQ = 1U << 5 ;
  1086. // Boolean field: Read Collision Error Interrupt Enable
  1087. static const uint8_t FTFE_FCNFG_RDCOLLIE = 1U << 6 ;
  1088. // Boolean field: Command Complete Interrupt Enable
  1089. static const uint8_t FTFE_FCNFG_CCIE = 1U << 7 ;
  1090. //-------------------- Flash Security Register
  1091. #define FTFE_FSEC (* ((const volatile uint8_t *) (0x40020000 + 0x2)))
  1092. // Field (width: 2 bits): Flash Security
  1093. inline uint8_t FTFE_FSEC_SEC (const uint8_t inValue) { return (inValue & 3U) << 0 ; }
  1094. // Field (width: 2 bits): Freescale Failure Analysis Access Code
  1095. inline uint8_t FTFE_FSEC_FSLACC (const uint8_t inValue) { return (inValue & 3U) << 2 ; }
  1096. // Field (width: 2 bits): Mass Erase Enable Bits
  1097. inline uint8_t FTFE_FSEC_MEEN (const uint8_t inValue) { return (inValue & 3U) << 4 ; }
  1098. // Field (width: 2 bits): Backdoor Key Security Enable
  1099. inline uint8_t FTFE_FSEC_KEYEN (const uint8_t inValue) { return (inValue & 3U) << 6 ; }
  1100. //-------------------- Flash Option Register
  1101. #define FTFE_FOPT (* ((const volatile uint8_t *) (0x40020000 + 0x3)))
  1102. //-------------------- Flash Common Command Object Registers (0 ... 3)
  1103. #define FTFE_FCCOB_0_3 (* ((volatile uint32_t *) (0x40020000 + 0x4)))
  1104. //-------------------- Flash Common Command Object Registers (4 ... 7)
  1105. #define FTFE_FCCOB_4_7 (* ((volatile uint32_t *) (0x40020000 + 0x8)))
  1106. //-------------------- Flash Common Command Object Registers (8 ... 11)
  1107. #define FTFE_FCCOB_8_11 (* ((volatile uint32_t *) (0x40020000 + 0xC)))
  1108. //-------------------- Program Flash Protection Registers (idx = 0 ... 3)
  1109. #define FTFE_FPROT(idx) (* ((volatile uint8_t *) (0x40020000 + 0x10 + 0x1 * (idx))))
  1110. //-------------------- EEPROM Protection Register
  1111. #define FTFE_FEPROT (* ((volatile uint8_t *) (0x40020000 + 0x16)))
  1112. //-------------------- Data Flash Protection Register
  1113. #define FTFE_FDPROT (* ((volatile uint8_t *) (0x40020000 + 0x17)))
  1114. //-------------------- Execute-only Access Registers (idx = 0 ... 7)
  1115. #define FTFE_XACC(idx) (* ((const volatile uint8_t *) (0x40020000 + 0x18 + 0x1 * (idx))))
  1116. //-------------------- Supervisor-only Access Registers (idx = 0 ... 7)
  1117. #define FTFE_SACC(idx) (* ((const volatile uint8_t *) (0x40020000 + 0x20 + 0x1 * (idx))))
  1118. //-------------------- Flash Access Segment Size Register
  1119. #define FTFE_FACSS (* ((const volatile uint8_t *) (0x40020000 + 0x28)))
  1120. //-------------------- Flash Access Segment Number Register
  1121. #define FTFE_FACSN (* ((const volatile uint8_t *) (0x40020000 + 0x2B)))
  1122. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  1123. // Peripheral DMAMUX
  1124. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  1125. //-------------------- Channel Configuration register (idx = 0 ... 31)
  1126. #define DMAMUX_CHCFG(idx) (* ((volatile uint8_t *) (0x40021000 + 0 + 0x1 * (idx))))
  1127. // Field (width: 6 bits): DMA Channel Source (Slot)
  1128. inline uint8_t DMAMUX_CHCFG_SOURCE (const uint8_t inValue) { return (inValue & 63U) << 0 ; }
  1129. // Boolean field: DMA Channel Trigger Enable
  1130. static const uint8_t DMAMUX_CHCFG_TRIG = 1U << 6 ;
  1131. // Boolean field: DMA Channel Enable
  1132. static const uint8_t DMAMUX_CHCFG_ENBL = 1U << 7 ;
  1133. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  1134. // Peripheral I2S0
  1135. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  1136. //-------------------- SAI Transmit Control Register
  1137. #define I2S0_TCSR (* ((volatile uint32_t *) (0x4002F000 + 0)))
  1138. // Boolean field: FIFO Request DMA Enable
  1139. static const uint32_t I2S0_TCSR_FRDE = 1U << 0 ;
  1140. // Boolean field: FIFO Warning DMA Enable
  1141. static const uint32_t I2S0_TCSR_FWDE = 1U << 1 ;
  1142. // Boolean field: FIFO Request Interrupt Enable
  1143. static const uint32_t I2S0_TCSR_FRIE = 1U << 8 ;
  1144. // Boolean field: FIFO Warning Interrupt Enable
  1145. static const uint32_t I2S0_TCSR_FWIE = 1U << 9 ;
  1146. // Boolean field: FIFO Error Interrupt Enable
  1147. static const uint32_t I2S0_TCSR_FEIE = 1U << 10 ;
  1148. // Boolean field: Sync Error Interrupt Enable
  1149. static const uint32_t I2S0_TCSR_SEIE = 1U << 11 ;
  1150. // Boolean field: Word Start Interrupt Enable
  1151. static const uint32_t I2S0_TCSR_WSIE = 1U << 12 ;
  1152. // Boolean field: FIFO Request Flag
  1153. static const uint32_t I2S0_TCSR_FRF = 1U << 16 ;
  1154. // Boolean field: FIFO Warning Flag
  1155. static const uint32_t I2S0_TCSR_FWF = 1U << 17 ;
  1156. // Boolean field: FIFO Error Flag
  1157. static const uint32_t I2S0_TCSR_FEF = 1U << 18 ;
  1158. // Boolean field: Sync Error Flag
  1159. static const uint32_t I2S0_TCSR_SEF = 1U << 19 ;
  1160. // Boolean field: Word Start Flag
  1161. static const uint32_t I2S0_TCSR_WSF = 1U << 20 ;
  1162. // Boolean field: Software Reset
  1163. static const uint32_t I2S0_TCSR_SR = 1U << 24 ;
  1164. // Boolean field: FIFO Reset
  1165. static const uint32_t I2S0_TCSR_FR = 1U << 25 ;
  1166. // Boolean field: Bit Clock Enable
  1167. static const uint32_t I2S0_TCSR_BCE = 1U << 28 ;
  1168. // Boolean field: Debug Enable
  1169. static const uint32_t I2S0_TCSR_DBGE = 1U << 29 ;
  1170. // Boolean field: Stop Enable
  1171. static const uint32_t I2S0_TCSR_STOPE = 1U << 30 ;
  1172. // Boolean field: Transmitter Enable
  1173. static const uint32_t I2S0_TCSR_TE = 1U << 31 ;
  1174. //-------------------- SAI Transmit Configuration 1 Register
  1175. #define I2S0_TCR1 (* ((volatile uint32_t *) (0x4002F000 + 0x4)))
  1176. // Field (width: 3 bits): Transmit FIFO Watermark
  1177. inline uint32_t I2S0_TCR1_TFW (const uint32_t inValue) { return (inValue & 7U) << 0 ; }
  1178. //-------------------- SAI Transmit Configuration 2 Register
  1179. #define I2S0_TCR2 (* ((volatile uint32_t *) (0x4002F000 + 0x8)))
  1180. // Field (width: 8 bits): Bit Clock Divide
  1181. inline uint32_t I2S0_TCR2_DIV (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  1182. // Boolean field: Bit Clock Direction
  1183. static const uint32_t I2S0_TCR2_BCD = 1U << 24 ;
  1184. // Boolean field: Bit Clock Polarity
  1185. static const uint32_t I2S0_TCR2_BCP = 1U << 25 ;
  1186. // Field (width: 2 bits): MCLK Select
  1187. inline uint32_t I2S0_TCR2_MSEL (const uint32_t inValue) { return (inValue & 3U) << 26 ; }
  1188. // Boolean field: Bit Clock Input
  1189. static const uint32_t I2S0_TCR2_BCI = 1U << 28 ;
  1190. // Boolean field: Bit Clock Swap
  1191. static const uint32_t I2S0_TCR2_BCS = 1U << 29 ;
  1192. // Field (width: 2 bits): Synchronous Mode
  1193. inline uint32_t I2S0_TCR2_SYNC (const uint32_t inValue) { return (inValue & 3U) << 30 ; }
  1194. //-------------------- SAI Transmit Configuration 3 Register
  1195. #define I2S0_TCR3 (* ((volatile uint32_t *) (0x4002F000 + 0xC)))
  1196. // Field (width: 5 bits): Word Flag Configuration
  1197. inline uint32_t I2S0_TCR3_WDFL (const uint32_t inValue) { return (inValue & 31U) << 0 ; }
  1198. // Field (width: 2 bits): Transmit Channel Enable
  1199. inline uint32_t I2S0_TCR3_TCE (const uint32_t inValue) { return (inValue & 3U) << 16 ; }
  1200. // Field (width: 2 bits): Channel FIFO Reset
  1201. inline uint32_t I2S0_TCR3_CFR (const uint32_t inValue) { return (inValue & 3U) << 24 ; }
  1202. //-------------------- SAI Transmit Configuration 4 Register
  1203. #define I2S0_TCR4 (* ((volatile uint32_t *) (0x4002F000 + 0x10)))
  1204. // Boolean field: Frame Sync Direction
  1205. static const uint32_t I2S0_TCR4_FSD = 1U << 0 ;
  1206. // Boolean field: Frame Sync Polarity
  1207. static const uint32_t I2S0_TCR4_FSP = 1U << 1 ;
  1208. // Boolean field: On Demand Mode
  1209. static const uint32_t I2S0_TCR4_ONDEM = 1U << 2 ;
  1210. // Boolean field: Frame Sync Early
  1211. static const uint32_t I2S0_TCR4_FSE = 1U << 3 ;
  1212. // Boolean field: MSB First
  1213. static const uint32_t I2S0_TCR4_MF = 1U << 4 ;
  1214. // Field (width: 5 bits): Sync Width
  1215. inline uint32_t I2S0_TCR4_SYWD (const uint32_t inValue) { return (inValue & 31U) << 8 ; }
  1216. // Field (width: 5 bits): Frame size
  1217. inline uint32_t I2S0_TCR4_FRSZ (const uint32_t inValue) { return (inValue & 31U) << 16 ; }
  1218. // Field (width: 2 bits): FIFO Packing Mode
  1219. inline uint32_t I2S0_TCR4_FPACK (const uint32_t inValue) { return (inValue & 3U) << 24 ; }
  1220. // Field (width: 2 bits): FIFO Combine Mode
  1221. inline uint32_t I2S0_TCR4_FCOMB (const uint32_t inValue) { return (inValue & 3U) << 26 ; }
  1222. // Boolean field: FIFO Continue on Error
  1223. static const uint32_t I2S0_TCR4_FCONT = 1U << 28 ;
  1224. //-------------------- SAI Transmit Configuration 5 Register
  1225. #define I2S0_TCR5 (* ((volatile uint32_t *) (0x4002F000 + 0x14)))
  1226. // Field (width: 5 bits): First Bit Shifted
  1227. inline uint32_t I2S0_TCR5_FBT (const uint32_t inValue) { return (inValue & 31U) << 8 ; }
  1228. // Field (width: 5 bits): Word 0 Width
  1229. inline uint32_t I2S0_TCR5_W0W (const uint32_t inValue) { return (inValue & 31U) << 16 ; }
  1230. // Field (width: 5 bits): Word N Width
  1231. inline uint32_t I2S0_TCR5_WNW (const uint32_t inValue) { return (inValue & 31U) << 24 ; }
  1232. //-------------------- SAI Transmit Data Register (idx = 0 ... 1)
  1233. #define I2S0_TDR(idx) (* ((volatile uint32_t *) (0x4002F000 + 0x20 + 0x4 * (idx))))
  1234. //-------------------- SAI Transmit FIFO Register (idx = 0 ... 1)
  1235. #define I2S0_TFR(idx) (* ((const volatile uint32_t *) (0x4002F000 + 0x40 + 0x4 * (idx))))
  1236. // Field (width: 4 bits): Read FIFO Pointer
  1237. inline uint32_t I2S0_TFR_RFP (const uint32_t inValue) { return (inValue & 15U) << 0 ; }
  1238. // Field (width: 4 bits): Write FIFO Pointer
  1239. inline uint32_t I2S0_TFR_WFP (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  1240. // Boolean field: Write Channel Pointer
  1241. static const uint32_t I2S0_TFR_WCP = 1U << 31 ;
  1242. //-------------------- SAI Transmit Mask Register
  1243. #define I2S0_TMR (* ((volatile uint32_t *) (0x4002F000 + 0x60)))
  1244. //-------------------- SAI Receive Control Register
  1245. #define I2S0_RCSR (* ((volatile uint32_t *) (0x4002F000 + 0x80)))
  1246. // Boolean field: FIFO Request DMA Enable
  1247. static const uint32_t I2S0_RCSR_FRDE = 1U << 0 ;
  1248. // Boolean field: FIFO Warning DMA Enable
  1249. static const uint32_t I2S0_RCSR_FWDE = 1U << 1 ;
  1250. // Boolean field: FIFO Request Interrupt Enable
  1251. static const uint32_t I2S0_RCSR_FRIE = 1U << 8 ;
  1252. // Boolean field: FIFO Warning Interrupt Enable
  1253. static const uint32_t I2S0_RCSR_FWIE = 1U << 9 ;
  1254. // Boolean field: FIFO Error Interrupt Enable
  1255. static const uint32_t I2S0_RCSR_FEIE = 1U << 10 ;
  1256. // Boolean field: Sync Error Interrupt Enable
  1257. static const uint32_t I2S0_RCSR_SEIE = 1U << 11 ;
  1258. // Boolean field: Word Start Interrupt Enable
  1259. static const uint32_t I2S0_RCSR_WSIE = 1U << 12 ;
  1260. // Boolean field: FIFO Request Flag
  1261. static const uint32_t I2S0_RCSR_FRF = 1U << 16 ;
  1262. // Boolean field: FIFO Warning Flag
  1263. static const uint32_t I2S0_RCSR_FWF = 1U << 17 ;
  1264. // Boolean field: FIFO Error Flag
  1265. static const uint32_t I2S0_RCSR_FEF = 1U << 18 ;
  1266. // Boolean field: Sync Error Flag
  1267. static const uint32_t I2S0_RCSR_SEF = 1U << 19 ;
  1268. // Boolean field: Word Start Flag
  1269. static const uint32_t I2S0_RCSR_WSF = 1U << 20 ;
  1270. // Boolean field: Software Reset
  1271. static const uint32_t I2S0_RCSR_SR = 1U << 24 ;
  1272. // Boolean field: FIFO Reset
  1273. static const uint32_t I2S0_RCSR_FR = 1U << 25 ;
  1274. // Boolean field: Bit Clock Enable
  1275. static const uint32_t I2S0_RCSR_BCE = 1U << 28 ;
  1276. // Boolean field: Debug Enable
  1277. static const uint32_t I2S0_RCSR_DBGE = 1U << 29 ;
  1278. // Boolean field: Stop Enable
  1279. static const uint32_t I2S0_RCSR_STOPE = 1U << 30 ;
  1280. // Boolean field: Receiver Enable
  1281. static const uint32_t I2S0_RCSR_RE = 1U << 31 ;
  1282. //-------------------- SAI Receive Configuration 1 Register
  1283. #define I2S0_RCR1 (* ((volatile uint32_t *) (0x4002F000 + 0x84)))
  1284. // Field (width: 3 bits): Receive FIFO Watermark
  1285. inline uint32_t I2S0_RCR1_RFW (const uint32_t inValue) { return (inValue & 7U) << 0 ; }
  1286. //-------------------- SAI Receive Configuration 2 Register
  1287. #define I2S0_RCR2 (* ((volatile uint32_t *) (0x4002F000 + 0x88)))
  1288. // Field (width: 8 bits): Bit Clock Divide
  1289. inline uint32_t I2S0_RCR2_DIV (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  1290. // Boolean field: Bit Clock Direction
  1291. static const uint32_t I2S0_RCR2_BCD = 1U << 24 ;
  1292. // Boolean field: Bit Clock Polarity
  1293. static const uint32_t I2S0_RCR2_BCP = 1U << 25 ;
  1294. // Field (width: 2 bits): MCLK Select
  1295. inline uint32_t I2S0_RCR2_MSEL (const uint32_t inValue) { return (inValue & 3U) << 26 ; }
  1296. // Boolean field: Bit Clock Input
  1297. static const uint32_t I2S0_RCR2_BCI = 1U << 28 ;
  1298. // Boolean field: Bit Clock Swap
  1299. static const uint32_t I2S0_RCR2_BCS = 1U << 29 ;
  1300. // Field (width: 2 bits): Synchronous Mode
  1301. inline uint32_t I2S0_RCR2_SYNC (const uint32_t inValue) { return (inValue & 3U) << 30 ; }
  1302. //-------------------- SAI Receive Configuration 3 Register
  1303. #define I2S0_RCR3 (* ((volatile uint32_t *) (0x4002F000 + 0x8C)))
  1304. // Field (width: 5 bits): Word Flag Configuration
  1305. inline uint32_t I2S0_RCR3_WDFL (const uint32_t inValue) { return (inValue & 31U) << 0 ; }
  1306. // Field (width: 2 bits): Receive Channel Enable
  1307. inline uint32_t I2S0_RCR3_RCE (const uint32_t inValue) { return (inValue & 3U) << 16 ; }
  1308. // Field (width: 2 bits): Channel FIFO Reset
  1309. inline uint32_t I2S0_RCR3_CFR (const uint32_t inValue) { return (inValue & 3U) << 24 ; }
  1310. //-------------------- SAI Receive Configuration 4 Register
  1311. #define I2S0_RCR4 (* ((volatile uint32_t *) (0x4002F000 + 0x90)))
  1312. // Boolean field: Frame Sync Direction
  1313. static const uint32_t I2S0_RCR4_FSD = 1U << 0 ;
  1314. // Boolean field: Frame Sync Polarity
  1315. static const uint32_t I2S0_RCR4_FSP = 1U << 1 ;
  1316. // Boolean field: On Demand Mode
  1317. static const uint32_t I2S0_RCR4_ONDEM = 1U << 2 ;
  1318. // Boolean field: Frame Sync Early
  1319. static const uint32_t I2S0_RCR4_FSE = 1U << 3 ;
  1320. // Boolean field: MSB First
  1321. static const uint32_t I2S0_RCR4_MF = 1U << 4 ;
  1322. // Field (width: 5 bits): Sync Width
  1323. inline uint32_t I2S0_RCR4_SYWD (const uint32_t inValue) { return (inValue & 31U) << 8 ; }
  1324. // Field (width: 5 bits): Frame Size
  1325. inline uint32_t I2S0_RCR4_FRSZ (const uint32_t inValue) { return (inValue & 31U) << 16 ; }
  1326. // Field (width: 2 bits): FIFO Packing Mode
  1327. inline uint32_t I2S0_RCR4_FPACK (const uint32_t inValue) { return (inValue & 3U) << 24 ; }
  1328. // Field (width: 2 bits): FIFO Combine Mode
  1329. inline uint32_t I2S0_RCR4_FCOMB (const uint32_t inValue) { return (inValue & 3U) << 26 ; }
  1330. // Boolean field: FIFO Continue on Error
  1331. static const uint32_t I2S0_RCR4_FCONT = 1U << 28 ;
  1332. //-------------------- SAI Receive Configuration 5 Register
  1333. #define I2S0_RCR5 (* ((volatile uint32_t *) (0x4002F000 + 0x94)))
  1334. // Field (width: 5 bits): First Bit Shifted
  1335. inline uint32_t I2S0_RCR5_FBT (const uint32_t inValue) { return (inValue & 31U) << 8 ; }
  1336. // Field (width: 5 bits): Word 0 Width
  1337. inline uint32_t I2S0_RCR5_W0W (const uint32_t inValue) { return (inValue & 31U) << 16 ; }
  1338. // Field (width: 5 bits): Word N Width
  1339. inline uint32_t I2S0_RCR5_WNW (const uint32_t inValue) { return (inValue & 31U) << 24 ; }
  1340. //-------------------- SAI Receive Data Register (idx = 0 ... 1)
  1341. #define I2S0_RDR(idx) (* ((const volatile uint32_t *) (0x4002F000 + 0xA0 + 0x4 * (idx))))
  1342. //-------------------- SAI Receive FIFO Register (idx = 0 ... 1)
  1343. #define I2S0_RFR(idx) (* ((const volatile uint32_t *) (0x4002F000 + 0xC0 + 0x4 * (idx))))
  1344. // Field (width: 4 bits): Read FIFO Pointer
  1345. inline uint32_t I2S0_RFR_RFP (const uint32_t inValue) { return (inValue & 15U) << 0 ; }
  1346. // Boolean field: Receive Channel Pointer
  1347. static const uint32_t I2S0_RFR_RCP = 1U << 15 ;
  1348. // Field (width: 4 bits): Write FIFO Pointer
  1349. inline uint32_t I2S0_RFR_WFP (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  1350. //-------------------- SAI Receive Mask Register
  1351. #define I2S0_RMR (* ((volatile uint32_t *) (0x4002F000 + 0xE0)))
  1352. //-------------------- SAI MCLK Control Register
  1353. #define I2S0_MCR (* ((volatile uint32_t *) (0x4002F000 + 0x100)))
  1354. // Field (width: 2 bits): MCLK Input Clock Select
  1355. inline uint32_t I2S0_MCR_MICS (const uint32_t inValue) { return (inValue & 3U) << 24 ; }
  1356. // Boolean field: MCLK Output Enable
  1357. static const uint32_t I2S0_MCR_MOE = 1U << 30 ;
  1358. // Boolean field: Divider Update Flag
  1359. static const uint32_t I2S0_MCR_DUF = 1U << 31 ;
  1360. //-------------------- SAI MCLK Divide Register
  1361. #define I2S0_MDR (* ((volatile uint32_t *) (0x4002F000 + 0x104)))
  1362. // Field (width: 12 bits): MCLK Divide
  1363. inline uint32_t I2S0_MDR_DIVIDE (const uint32_t inValue) { return (inValue & 4095U) << 0 ; }
  1364. // Field (width: 8 bits): MCLK Fraction
  1365. inline uint32_t I2S0_MDR_FRACT (const uint32_t inValue) { return (inValue & 255U) << 12 ; }
  1366. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  1367. // Peripheral CRC
  1368. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  1369. //-------------------- CRC Data register
  1370. #define CRC_DATA (* ((volatile uint32_t *) (0x40032000 + 0)))
  1371. // Field (width: 8 bits): CRC Low Lower Byte
  1372. inline uint32_t CRC_DATA_LL (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  1373. // Field (width: 8 bits): CRC Low Upper Byte
  1374. inline uint32_t CRC_DATA_LU (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  1375. // Field (width: 8 bits): CRC High Lower Byte
  1376. inline uint32_t CRC_DATA_HL (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  1377. // Field (width: 8 bits): CRC High Upper Byte
  1378. inline uint32_t CRC_DATA_HU (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  1379. //-------------------- CRC_DATAL register.
  1380. #define CRC_DATAL (* ((volatile uint16_t *) (0x40032000 + 0)))
  1381. //-------------------- CRC_DATALL register.
  1382. #define CRC_DATALL (* ((volatile uint8_t *) (0x40032000 + 0)))
  1383. //-------------------- CRC_DATALU register.
  1384. #define CRC_DATALU (* ((volatile uint8_t *) (0x40032000 + 0x1)))
  1385. //-------------------- CRC_DATAH register.
  1386. #define CRC_DATAH (* ((volatile uint16_t *) (0x40032000 + 0x2)))
  1387. //-------------------- CRC_DATAHL register.
  1388. #define CRC_DATAHL (* ((volatile uint8_t *) (0x40032000 + 0x2)))
  1389. //-------------------- CRC_DATAHU register.
  1390. #define CRC_DATAHU (* ((volatile uint8_t *) (0x40032000 + 0x3)))
  1391. //-------------------- CRC Polynomial register
  1392. #define CRC_GPOLY (* ((volatile uint32_t *) (0x40032000 + 0x4)))
  1393. // Field (width: 16 bits): Low Polynominal Half-word
  1394. inline uint32_t CRC_GPOLY_LOW (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  1395. // Field (width: 16 bits): High Polynominal Half-word
  1396. inline uint32_t CRC_GPOLY_HIGH (const uint32_t inValue) { return (inValue & 65535U) << 16 ; }
  1397. //-------------------- CRC_GPOLYL register.
  1398. #define CRC_GPOLYL (* ((volatile uint16_t *) (0x40032000 + 0x4)))
  1399. //-------------------- CRC_GPOLYLL register.
  1400. #define CRC_GPOLYLL (* ((volatile uint8_t *) (0x40032000 + 0x4)))
  1401. //-------------------- CRC_GPOLYLU register.
  1402. #define CRC_GPOLYLU (* ((volatile uint8_t *) (0x40032000 + 0x5)))
  1403. //-------------------- CRC_GPOLYH register.
  1404. #define CRC_GPOLYH (* ((volatile uint16_t *) (0x40032000 + 0x6)))
  1405. //-------------------- CRC_GPOLYHL register.
  1406. #define CRC_GPOLYHL (* ((volatile uint8_t *) (0x40032000 + 0x6)))
  1407. //-------------------- CRC_GPOLYHU register.
  1408. #define CRC_GPOLYHU (* ((volatile uint8_t *) (0x40032000 + 0x7)))
  1409. //-------------------- CRC Control register
  1410. #define CRC_CTRL (* ((volatile uint32_t *) (0x40032000 + 0x8)))
  1411. // Boolean field: Width of CRC protocol.
  1412. static const uint32_t CRC_CTRL_TCRC = 1U << 24 ;
  1413. // Boolean field: Write CRC Data Register As Seed
  1414. static const uint32_t CRC_CTRL_WAS = 1U << 25 ;
  1415. // Boolean field: Complement Read Of CRC Data Register
  1416. static const uint32_t CRC_CTRL_FXOR = 1U << 26 ;
  1417. // Field (width: 2 bits): Type Of Transpose For Read
  1418. inline uint32_t CRC_CTRL_TOTR (const uint32_t inValue) { return (inValue & 3U) << 28 ; }
  1419. // Field (width: 2 bits): Type Of Transpose For Writes
  1420. inline uint32_t CRC_CTRL_TOT (const uint32_t inValue) { return (inValue & 3U) << 30 ; }
  1421. //-------------------- CRC_CTRLHU register.
  1422. #define CRC_CTRLHU (* ((volatile uint8_t *) (0x40032000 + 0xB)))
  1423. // Boolean field: no description available
  1424. static const uint8_t CRC_CTRLHU_TCRC = 1U << 0 ;
  1425. // Boolean field: no description available
  1426. static const uint8_t CRC_CTRLHU_WAS = 1U << 1 ;
  1427. // Boolean field: no description available
  1428. static const uint8_t CRC_CTRLHU_FXOR = 1U << 2 ;
  1429. // Field (width: 2 bits): no description available
  1430. inline uint8_t CRC_CTRLHU_TOTR (const uint8_t inValue) { return (inValue & 3U) << 4 ; }
  1431. // Field (width: 2 bits): no description available
  1432. inline uint8_t CRC_CTRLHU_TOT (const uint8_t inValue) { return (inValue & 3U) << 6 ; }
  1433. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  1434. // Peripheral USBDCD
  1435. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  1436. //-------------------- Control register
  1437. #define USBDCD_CONTROL (* ((volatile uint32_t *) (0x40035000 + 0)))
  1438. // Boolean field: Interrupt Acknowledge
  1439. static const uint32_t USBDCD_CONTROL_IACK = 1U << 0 ;
  1440. // Boolean field: Interrupt Flag
  1441. static const uint32_t USBDCD_CONTROL_IF = 1U << 8 ;
  1442. // Boolean field: Interrupt Enable
  1443. static const uint32_t USBDCD_CONTROL_IE = 1U << 16 ;
  1444. // Boolean field: BC1.2 compatibility. This bit cannot be changed after start detection.
  1445. static const uint32_t USBDCD_CONTROL_BC12 = 1U << 17 ;
  1446. // Boolean field: Start Change Detection Sequence
  1447. static const uint32_t USBDCD_CONTROL_START = 1U << 24 ;
  1448. // Boolean field: Software Reset
  1449. static const uint32_t USBDCD_CONTROL_SR = 1U << 25 ;
  1450. //-------------------- Clock register
  1451. #define USBDCD_CLOCK (* ((volatile uint32_t *) (0x40035000 + 0x4)))
  1452. // Boolean field: Unit of Measurement Encoding for Clock Speed
  1453. static const uint32_t USBDCD_CLOCK_CLOCK_UNIT = 1U << 0 ;
  1454. // Field (width: 10 bits): Numerical Value of Clock Speed in Binary
  1455. inline uint32_t USBDCD_CLOCK_CLOCK_SPEED (const uint32_t inValue) { return (inValue & 1023U) << 2 ; }
  1456. //-------------------- Status register
  1457. #define USBDCD_STATUS (* ((const volatile uint32_t *) (0x40035000 + 0x8)))
  1458. // Field (width: 2 bits): Charger Detection Sequence Results
  1459. inline uint32_t USBDCD_STATUS_SEQ_RES (const uint32_t inValue) { return (inValue & 3U) << 16 ; }
  1460. // Field (width: 2 bits): Charger Detection Sequence Status
  1461. inline uint32_t USBDCD_STATUS_SEQ_STAT (const uint32_t inValue) { return (inValue & 3U) << 18 ; }
  1462. // Boolean field: Error Flag
  1463. static const uint32_t USBDCD_STATUS_ERR = 1U << 20 ;
  1464. // Boolean field: Timeout Flag
  1465. static const uint32_t USBDCD_STATUS_TO = 1U << 21 ;
  1466. // Boolean field: Active Status Indicator
  1467. static const uint32_t USBDCD_STATUS_ACTIVE = 1U << 22 ;
  1468. //-------------------- Signal Override Register
  1469. #define USBDCD_SIGNAL_OVERRIDE (* ((volatile uint32_t *) (0x40035000 + 0xC)))
  1470. // Field (width: 2 bits): Phase Selection
  1471. inline uint32_t USBDCD_SIGNAL_OVERRIDE_PS (const uint32_t inValue) { return (inValue & 3U) << 0 ; }
  1472. //-------------------- TIMER0 register
  1473. #define USBDCD_TIMER0 (* ((volatile uint32_t *) (0x40035000 + 0x10)))
  1474. // Field (width: 12 bits): Unit Connection Timer Elapse (in ms)
  1475. inline uint32_t USBDCD_TIMER0_TUNITCON (const uint32_t inValue) { return (inValue & 4095U) << 0 ; }
  1476. // Field (width: 10 bits): Sequence Initiation Time
  1477. inline uint32_t USBDCD_TIMER0_TSEQ_INIT (const uint32_t inValue) { return (inValue & 1023U) << 16 ; }
  1478. //-------------------- TIMER1 register
  1479. #define USBDCD_TIMER1 (* ((volatile uint32_t *) (0x40035000 + 0x14)))
  1480. // Field (width: 10 bits): Time Period Comparator Enabled
  1481. inline uint32_t USBDCD_TIMER1_TVDPSRC_ON (const uint32_t inValue) { return (inValue & 1023U) << 0 ; }
  1482. // Field (width: 10 bits): Time Period to Debounce D+ Signal
  1483. inline uint32_t USBDCD_TIMER1_TDCD_DBNC (const uint32_t inValue) { return (inValue & 1023U) << 16 ; }
  1484. //-------------------- TIMER2_BC11 register
  1485. #define USBDCD_TIMER2_BC11 (* ((volatile uint32_t *) (0x40035000 + 0x18)))
  1486. // Field (width: 4 bits): Time Before Check of D- Line
  1487. inline uint32_t USBDCD_TIMER2_BC11_CHECK_DM (const uint32_t inValue) { return (inValue & 15U) << 0 ; }
  1488. // Field (width: 10 bits): Time Period Before Enabling D+ Pullup
  1489. inline uint32_t USBDCD_TIMER2_BC11_TVDPSRC_CON (const uint32_t inValue) { return (inValue & 1023U) << 16 ; }
  1490. //-------------------- TIMER2_BC12 register
  1491. #define USBDCD_TIMER2_BC12 (* ((volatile uint32_t *) (0x40035000 + 0x18)))
  1492. // Field (width: 10 bits): Sets the amount of time (in ms) that the module enables the VDM_SRC. Valid values are 0-40ms.
  1493. inline uint32_t USBDCD_TIMER2_BC12_TVDMSRC_ON (const uint32_t inValue) { return (inValue & 1023U) << 0 ; }
  1494. // Field (width: 10 bits): Sets the amount of time (in ms) that the module waits after primary detection before start to secondary detection
  1495. inline uint32_t USBDCD_TIMER2_BC12_TWAIT_AFTER_PRD (const uint32_t inValue) { return (inValue & 1023U) << 16 ; }
  1496. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  1497. // Peripheral PDB0
  1498. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  1499. //-------------------- Status and Control register
  1500. #define PDB0_SC (* ((volatile uint32_t *) (0x40036000 + 0)))
  1501. // Boolean field: Load OK
  1502. static const uint32_t PDB0_SC_LDOK = 1U << 0 ;
  1503. // Boolean field: Continuous Mode Enable
  1504. static const uint32_t PDB0_SC_CONT = 1U << 1 ;
  1505. // Field (width: 2 bits): Multiplication Factor Select for Prescaler
  1506. inline uint32_t PDB0_SC_MULT (const uint32_t inValue) { return (inValue & 3U) << 2 ; }
  1507. // Boolean field: PDB Interrupt Enable
  1508. static const uint32_t PDB0_SC_PDBIE = 1U << 5 ;
  1509. // Boolean field: PDB Interrupt Flag
  1510. static const uint32_t PDB0_SC_PDBIF = 1U << 6 ;
  1511. // Boolean field: PDB Enable
  1512. static const uint32_t PDB0_SC_PDBEN = 1U << 7 ;
  1513. // Field (width: 4 bits): Trigger Input Source Select
  1514. inline uint32_t PDB0_SC_TRGSEL (const uint32_t inValue) { return (inValue & 15U) << 8 ; }
  1515. // Field (width: 3 bits): Prescaler Divider Select
  1516. inline uint32_t PDB0_SC_PRESCALER (const uint32_t inValue) { return (inValue & 7U) << 12 ; }
  1517. // Boolean field: DMA Enable
  1518. static const uint32_t PDB0_SC_DMAEN = 1U << 15 ;
  1519. // Boolean field: Software Trigger
  1520. static const uint32_t PDB0_SC_SWTRIG = 1U << 16 ;
  1521. // Boolean field: PDB Sequence Error Interrupt Enable
  1522. static const uint32_t PDB0_SC_PDBEIE = 1U << 17 ;
  1523. // Field (width: 2 bits): Load Mode Select
  1524. inline uint32_t PDB0_SC_LDMOD (const uint32_t inValue) { return (inValue & 3U) << 18 ; }
  1525. //-------------------- Modulus register
  1526. #define PDB0_MOD (* ((volatile uint32_t *) (0x40036000 + 0x4)))
  1527. // Field (width: 16 bits): PDB Modulus
  1528. inline uint32_t PDB0_MOD_MOD (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  1529. //-------------------- Counter register
  1530. #define PDB0_CNT (* ((const volatile uint32_t *) (0x40036000 + 0x8)))
  1531. // Field (width: 16 bits): PDB Counter
  1532. inline uint32_t PDB0_CNT_CNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  1533. //-------------------- Interrupt Delay register
  1534. #define PDB0_IDLY (* ((volatile uint32_t *) (0x40036000 + 0xC)))
  1535. // Field (width: 16 bits): PDB Interrupt Delay
  1536. inline uint32_t PDB0_IDLY_IDLY (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  1537. //-------------------- Channel n Control register 1 (idx = 0 ... 1)
  1538. #define PDB0_CHC1(idx) (* ((volatile uint32_t *) (0x40036000 + 0x10 + 0x28 * (idx))))
  1539. // Field (width: 8 bits): PDB Channel Pre-Trigger Enable
  1540. inline uint32_t PDB0_CHC1_EN (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  1541. // Field (width: 8 bits): PDB Channel Pre-Trigger Output Select
  1542. inline uint32_t PDB0_CHC1_TOS (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  1543. // Field (width: 8 bits): PDB Channel Pre-Trigger Back-to-Back Operation Enable
  1544. inline uint32_t PDB0_CHC1_BB (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  1545. //-------------------- Channel n Status register (idx = 0 ... 1)
  1546. #define PDB0_CHS(idx) (* ((volatile uint32_t *) (0x40036000 + 0x14 + 0x28 * (idx))))
  1547. // Field (width: 8 bits): PDB Channel Sequence Error Flags
  1548. inline uint32_t PDB0_CHS_ERR (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  1549. // Field (width: 8 bits): PDB Channel Flags
  1550. inline uint32_t PDB0_CHS_CF (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  1551. //-------------------- Channel n Delay 0 register (idx = 0 ... 1)
  1552. #define PDB0_CHDLY0(idx) (* ((volatile uint32_t *) (0x40036000 + 0x18 + 0x28 * (idx))))
  1553. // Field (width: 16 bits): PDB Channel Delay
  1554. inline uint32_t PDB0_CHDLY0_DLY (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  1555. //-------------------- Channel n Delay 1 register (idx = 0 ... 1)
  1556. #define PDB0_CHDLY1(idx) (* ((volatile uint32_t *) (0x40036000 + 0x1C + 0x28 * (idx))))
  1557. // Field (width: 16 bits): PDB Channel Delay
  1558. inline uint32_t PDB0_CHDLY1_DLY (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  1559. //-------------------- DAC Interval Trigger n Control register (idx = 0 ... 1)
  1560. #define PDB0_DACINTC(idx) (* ((volatile uint32_t *) (0x40036000 + 0x150 + 0x8 * (idx))))
  1561. // Boolean field: DAC Interval Trigger Enable
  1562. static const uint32_t PDB0_DACINTC_TOE = 1U << 0 ;
  1563. // Boolean field: DAC External Trigger Input Enable
  1564. static const uint32_t PDB0_DACINTC_EXT = 1U << 1 ;
  1565. //-------------------- DAC Interval n register (idx = 0 ... 1)
  1566. #define PDB0_DACINT(idx) (* ((volatile uint32_t *) (0x40036000 + 0x154 + 0x8 * (idx))))
  1567. // Field (width: 16 bits): DAC Interval
  1568. inline uint32_t PDB0_DACINT_INT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  1569. //-------------------- Pulse-Out n Enable register
  1570. #define PDB0_POEN (* ((volatile uint32_t *) (0x40036000 + 0x190)))
  1571. // Field (width: 8 bits): PDB Pulse-Out Enable
  1572. inline uint32_t PDB0_POEN_POEN (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  1573. //-------------------- Pulse-Out n Delay register (idx = 0 ... 3)
  1574. #define PDB0_PODLY(idx) (* ((volatile uint32_t *) (0x40036000 + 0x194 + 0x4 * (idx))))
  1575. // Field (width: 16 bits): PDB Pulse-Out Delay 2
  1576. inline uint32_t PDB0_PODLY_DLY2 (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  1577. // Field (width: 16 bits): PDB Pulse-Out Delay 1
  1578. inline uint32_t PDB0_PODLY_DLY1 (const uint32_t inValue) { return (inValue & 65535U) << 16 ; }
  1579. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  1580. // Peripheral PIT
  1581. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  1582. //-------------------- PIT Module Control Register
  1583. #define PIT_MCR (* ((volatile uint32_t *) (0x40037000 + 0)))
  1584. // Boolean field: Freeze
  1585. static const uint32_t PIT_MCR_FRZ = 1U << 0 ;
  1586. // Boolean field: Module Disable - (PIT section)
  1587. static const uint32_t PIT_MCR_MDIS = 1U << 1 ;
  1588. //-------------------- PIT Upper Lifetime Timer Register
  1589. #define PIT_LTMR64H (* ((const volatile uint32_t *) (0x40037000 + 0xE0)))
  1590. //-------------------- PIT Lower Lifetime Timer Register
  1591. #define PIT_LTMR64L (* ((const volatile uint32_t *) (0x40037000 + 0xE4)))
  1592. //-------------------- Timer Load Value Register (idx = 0 ... 3)
  1593. #define PIT_LDVAL(idx) (* ((volatile uint32_t *) (0x40037000 + 0x100 + 0x10 * (idx))))
  1594. //-------------------- Current Timer Value Register (idx = 0 ... 3)
  1595. #define PIT_CVAL(idx) (* ((const volatile uint32_t *) (0x40037000 + 0x104 + 0x10 * (idx))))
  1596. //-------------------- Timer Control Register (idx = 0 ... 3)
  1597. #define PIT_TCTRL(idx) (* ((volatile uint32_t *) (0x40037000 + 0x108 + 0x10 * (idx))))
  1598. // Boolean field: Timer Enable
  1599. static const uint32_t PIT_TCTRL_TEN = 1U << 0 ;
  1600. // Boolean field: Timer Interrupt Enable
  1601. static const uint32_t PIT_TCTRL_TIE = 1U << 1 ;
  1602. // Boolean field: Chain Mode
  1603. static const uint32_t PIT_TCTRL_CHN = 1U << 2 ;
  1604. //-------------------- Timer Flag Register (idx = 0 ... 3)
  1605. #define PIT_TFLG(idx) (* ((volatile uint32_t *) (0x40037000 + 0x10C + 0x10 * (idx))))
  1606. // Boolean field: Timer Interrupt Flag
  1607. static const uint32_t PIT_TFLG_TIF = 1U << 0 ;
  1608. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  1609. // Peripheral RTC
  1610. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  1611. //-------------------- RTC Time Seconds Register
  1612. #define RTC_TSR (* ((volatile uint32_t *) (0x4003D000 + 0)))
  1613. //-------------------- RTC Time Prescaler Register
  1614. #define RTC_TPR (* ((volatile uint32_t *) (0x4003D000 + 0x4)))
  1615. // Field (width: 16 bits): Time Prescaler Register
  1616. inline uint32_t RTC_TPR_TPR (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  1617. //-------------------- RTC Time Alarm Register
  1618. #define RTC_TAR (* ((volatile uint32_t *) (0x4003D000 + 0x8)))
  1619. //-------------------- RTC Time Compensation Register
  1620. #define RTC_TCR (* ((volatile uint32_t *) (0x4003D000 + 0xC)))
  1621. // Field (width: 8 bits): Time Compensation Register
  1622. inline uint32_t RTC_TCR_TCR (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  1623. // Field (width: 8 bits): Compensation Interval Register
  1624. inline uint32_t RTC_TCR_CIR (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  1625. // Field (width: 8 bits): Time Compensation Value
  1626. inline uint32_t RTC_TCR_TCV (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  1627. // Field (width: 8 bits): Compensation Interval Counter
  1628. inline uint32_t RTC_TCR_CIC (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  1629. //-------------------- RTC Control Register
  1630. #define RTC_CR (* ((volatile uint32_t *) (0x4003D000 + 0x10)))
  1631. // Boolean field: Software Reset
  1632. static const uint32_t RTC_CR_SWR = 1U << 0 ;
  1633. // Boolean field: Wakeup Pin Enable
  1634. static const uint32_t RTC_CR_WPE = 1U << 1 ;
  1635. // Boolean field: Supervisor Access
  1636. static const uint32_t RTC_CR_SUP = 1U << 2 ;
  1637. // Boolean field: Update Mode
  1638. static const uint32_t RTC_CR_UM = 1U << 3 ;
  1639. // Boolean field: Wakeup Pin Select
  1640. static const uint32_t RTC_CR_WPS = 1U << 4 ;
  1641. // Boolean field: Oscillator Enable
  1642. static const uint32_t RTC_CR_OSCE = 1U << 8 ;
  1643. // Boolean field: Clock Output
  1644. static const uint32_t RTC_CR_CLKO = 1U << 9 ;
  1645. // Boolean field: Oscillator 16pF Load Configure
  1646. static const uint32_t RTC_CR_SC16P = 1U << 10 ;
  1647. // Boolean field: Oscillator 8pF Load Configure
  1648. static const uint32_t RTC_CR_SC8P = 1U << 11 ;
  1649. // Boolean field: Oscillator 4pF Load Configure
  1650. static const uint32_t RTC_CR_SC4P = 1U << 12 ;
  1651. // Boolean field: Oscillator 2pF Load Configure
  1652. static const uint32_t RTC_CR_SC2P = 1U << 13 ;
  1653. //-------------------- RTC Status Register
  1654. #define RTC_SR (* ((volatile uint32_t *) (0x4003D000 + 0x14)))
  1655. // Boolean field: Time Invalid Flag
  1656. static const uint32_t RTC_SR_TIF = 1U << 0 ;
  1657. // Boolean field: Time Overflow Flag
  1658. static const uint32_t RTC_SR_TOF = 1U << 1 ;
  1659. // Boolean field: Time Alarm Flag
  1660. static const uint32_t RTC_SR_TAF = 1U << 2 ;
  1661. // Boolean field: Monotonic Overflow Flag
  1662. static const uint32_t RTC_SR_MOF = 1U << 3 ;
  1663. // Boolean field: Time Counter Enable
  1664. static const uint32_t RTC_SR_TCE = 1U << 4 ;
  1665. //-------------------- RTC Lock Register
  1666. #define RTC_LR (* ((volatile uint32_t *) (0x4003D000 + 0x18)))
  1667. // Boolean field: Time Compensation Lock
  1668. static const uint32_t RTC_LR_TCL = 1U << 3 ;
  1669. // Boolean field: Control Register Lock
  1670. static const uint32_t RTC_LR_CRL = 1U << 4 ;
  1671. // Boolean field: Status Register Lock
  1672. static const uint32_t RTC_LR_SRL = 1U << 5 ;
  1673. // Boolean field: Lock Register Lock
  1674. static const uint32_t RTC_LR_LRL = 1U << 6 ;
  1675. // Boolean field: Tamper Time Seconds Lock
  1676. static const uint32_t RTC_LR_TTSL = 1U << 8 ;
  1677. // Boolean field: Monotonic Enable Lock
  1678. static const uint32_t RTC_LR_MEL = 1U << 9 ;
  1679. // Boolean field: Monotonic Counter Low Lock
  1680. static const uint32_t RTC_LR_MCLL = 1U << 10 ;
  1681. // Boolean field: Monotonic Counter High Lock
  1682. static const uint32_t RTC_LR_MCHL = 1U << 11 ;
  1683. //-------------------- RTC Interrupt Enable Register
  1684. #define RTC_IER (* ((volatile uint32_t *) (0x4003D000 + 0x1C)))
  1685. // Boolean field: Time Invalid Interrupt Enable
  1686. static const uint32_t RTC_IER_TIIE = 1U << 0 ;
  1687. // Boolean field: Time Overflow Interrupt Enable
  1688. static const uint32_t RTC_IER_TOIE = 1U << 1 ;
  1689. // Boolean field: Time Alarm Interrupt Enable
  1690. static const uint32_t RTC_IER_TAIE = 1U << 2 ;
  1691. // Boolean field: Monotonic Overflow Interrupt Enable
  1692. static const uint32_t RTC_IER_MOIE = 1U << 3 ;
  1693. // Boolean field: Time Seconds Interrupt Enable
  1694. static const uint32_t RTC_IER_TSIE = 1U << 4 ;
  1695. // Boolean field: Wakeup Pin On
  1696. static const uint32_t RTC_IER_WPON = 1U << 7 ;
  1697. //-------------------- RTC Tamper Time Seconds Register
  1698. #define RTC_TTSR (* ((const volatile uint32_t *) (0x4003D000 + 0x20)))
  1699. //-------------------- RTC Monotonic Enable Register
  1700. #define RTC_MER (* ((volatile uint32_t *) (0x4003D000 + 0x24)))
  1701. // Boolean field: Monotonic Counter Enable
  1702. static const uint32_t RTC_MER_MCE = 1U << 4 ;
  1703. //-------------------- RTC Monotonic Counter Low Register
  1704. #define RTC_MCLR (* ((volatile uint32_t *) (0x4003D000 + 0x28)))
  1705. //-------------------- RTC Monotonic Counter High Register
  1706. #define RTC_MCHR (* ((volatile uint32_t *) (0x4003D000 + 0x2C)))
  1707. //-------------------- RTC Write Access Register
  1708. #define RTC_WAR (* ((volatile uint32_t *) (0x4003D000 + 0x800)))
  1709. // Boolean field: Time Seconds Register Write
  1710. static const uint32_t RTC_WAR_TSRW = 1U << 0 ;
  1711. // Boolean field: Time Prescaler Register Write
  1712. static const uint32_t RTC_WAR_TPRW = 1U << 1 ;
  1713. // Boolean field: Time Alarm Register Write
  1714. static const uint32_t RTC_WAR_TARW = 1U << 2 ;
  1715. // Boolean field: Time Compensation Register Write
  1716. static const uint32_t RTC_WAR_TCRW = 1U << 3 ;
  1717. // Boolean field: Control Register Write
  1718. static const uint32_t RTC_WAR_CRW = 1U << 4 ;
  1719. // Boolean field: Status Register Write
  1720. static const uint32_t RTC_WAR_SRW = 1U << 5 ;
  1721. // Boolean field: Lock Register Write
  1722. static const uint32_t RTC_WAR_LRW = 1U << 6 ;
  1723. // Boolean field: Interrupt Enable Register Write
  1724. static const uint32_t RTC_WAR_IERW = 1U << 7 ;
  1725. // Boolean field: Tamper Time Seconds Write
  1726. static const uint32_t RTC_WAR_TTSW = 1U << 8 ;
  1727. // Boolean field: Monotonic Enable Register Write
  1728. static const uint32_t RTC_WAR_MERW = 1U << 9 ;
  1729. // Boolean field: Monotonic Counter Low Write
  1730. static const uint32_t RTC_WAR_MCLW = 1U << 10 ;
  1731. // Boolean field: Monotonic Counter High Write
  1732. static const uint32_t RTC_WAR_MCHW = 1U << 11 ;
  1733. //-------------------- RTC Read Access Register
  1734. #define RTC_RAR (* ((volatile uint32_t *) (0x4003D000 + 0x804)))
  1735. // Boolean field: Time Seconds Register Read
  1736. static const uint32_t RTC_RAR_TSRR = 1U << 0 ;
  1737. // Boolean field: Time Prescaler Register Read
  1738. static const uint32_t RTC_RAR_TPRR = 1U << 1 ;
  1739. // Boolean field: Time Alarm Register Read
  1740. static const uint32_t RTC_RAR_TARR = 1U << 2 ;
  1741. // Boolean field: Time Compensation Register Read
  1742. static const uint32_t RTC_RAR_TCRR = 1U << 3 ;
  1743. // Boolean field: Control Register Read
  1744. static const uint32_t RTC_RAR_CRR = 1U << 4 ;
  1745. // Boolean field: Status Register Read
  1746. static const uint32_t RTC_RAR_SRR = 1U << 5 ;
  1747. // Boolean field: Lock Register Read
  1748. static const uint32_t RTC_RAR_LRR = 1U << 6 ;
  1749. // Boolean field: Interrupt Enable Register Read
  1750. static const uint32_t RTC_RAR_IERR = 1U << 7 ;
  1751. // Boolean field: Tamper Time Seconds Read
  1752. static const uint32_t RTC_RAR_TTSR = 1U << 8 ;
  1753. // Boolean field: Monotonic Enable Register Read
  1754. static const uint32_t RTC_RAR_MERR = 1U << 9 ;
  1755. // Boolean field: Monotonic Counter Low Read
  1756. static const uint32_t RTC_RAR_MCLR = 1U << 10 ;
  1757. // Boolean field: Monotonic Counter High Read
  1758. static const uint32_t RTC_RAR_MCHR = 1U << 11 ;
  1759. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  1760. // Peripheral RFVBAT
  1761. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  1762. //-------------------- VBAT register file register (idx = 0 ... 7)
  1763. #define RFVBAT_REG(idx) (* ((volatile uint32_t *) (0x4003E000 + 0 + 0x4 * (idx))))
  1764. // Field (width: 8 bits): Low lower byte
  1765. inline uint32_t RFVBAT_REG_LL (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  1766. // Field (width: 8 bits): Low higher byte
  1767. inline uint32_t RFVBAT_REG_LH (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  1768. // Field (width: 8 bits): High lower byte
  1769. inline uint32_t RFVBAT_REG_HL (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  1770. // Field (width: 8 bits): High higher byte
  1771. inline uint32_t RFVBAT_REG_HH (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  1772. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  1773. // Peripheral LPTMR0
  1774. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  1775. //-------------------- Low Power Timer Control Status Register
  1776. #define LPTMR0_CSR (* ((volatile uint32_t *) (0x40040000 + 0)))
  1777. // Boolean field: Timer Enable
  1778. static const uint32_t LPTMR0_CSR_TEN = 1U << 0 ;
  1779. // Boolean field: Timer Mode Select
  1780. static const uint32_t LPTMR0_CSR_TMS = 1U << 1 ;
  1781. // Boolean field: Timer Free-Running Counter
  1782. static const uint32_t LPTMR0_CSR_TFC = 1U << 2 ;
  1783. // Boolean field: Timer Pin Polarity
  1784. static const uint32_t LPTMR0_CSR_TPP = 1U << 3 ;
  1785. // Field (width: 2 bits): Timer Pin Select
  1786. inline uint32_t LPTMR0_CSR_TPS (const uint32_t inValue) { return (inValue & 3U) << 4 ; }
  1787. // Boolean field: Timer Interrupt Enable
  1788. static const uint32_t LPTMR0_CSR_TIE = 1U << 6 ;
  1789. // Boolean field: Timer Compare Flag
  1790. static const uint32_t LPTMR0_CSR_TCF = 1U << 7 ;
  1791. //-------------------- Low Power Timer Prescale Register
  1792. #define LPTMR0_PSR (* ((volatile uint32_t *) (0x40040000 + 0x4)))
  1793. // Field (width: 2 bits): Prescaler Clock Select
  1794. inline uint32_t LPTMR0_PSR_PCS (const uint32_t inValue) { return (inValue & 3U) << 0 ; }
  1795. // Boolean field: Prescaler Bypass
  1796. static const uint32_t LPTMR0_PSR_PBYP = 1U << 2 ;
  1797. // Field (width: 4 bits): Prescale Value
  1798. inline uint32_t LPTMR0_PSR_PRESCALE (const uint32_t inValue) { return (inValue & 15U) << 3 ; }
  1799. //-------------------- Low Power Timer Compare Register
  1800. #define LPTMR0_CMR (* ((volatile uint32_t *) (0x40040000 + 0x8)))
  1801. // Field (width: 16 bits): Compare Value
  1802. inline uint32_t LPTMR0_CMR_COMPARE (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  1803. //-------------------- Low Power Timer Counter Register
  1804. #define LPTMR0_CNR (* ((volatile uint32_t *) (0x40040000 + 0xC)))
  1805. // Field (width: 16 bits): Counter Value
  1806. inline uint32_t LPTMR0_CNR_COUNTER (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  1807. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  1808. // Peripheral RFSYS
  1809. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  1810. //-------------------- Register file register (idx = 0 ... 7)
  1811. #define RFSYS_REG(idx) (* ((volatile uint32_t *) (0x40041000 + 0 + 0x4 * (idx))))
  1812. // Field (width: 8 bits): Low lower byte
  1813. inline uint32_t RFSYS_REG_LL (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  1814. // Field (width: 8 bits): Low higher byte
  1815. inline uint32_t RFSYS_REG_LH (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  1816. // Field (width: 8 bits): High lower byte
  1817. inline uint32_t RFSYS_REG_HL (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  1818. // Field (width: 8 bits): High higher byte
  1819. inline uint32_t RFSYS_REG_HH (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  1820. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  1821. // Peripheral TSI0
  1822. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  1823. //-------------------- TSI General Control and Status Register
  1824. #define TSI0_GENCS (* ((volatile uint32_t *) (0x40045000 + 0)))
  1825. // Boolean field: End-of-Scan DMA Transfer Request Enable Only
  1826. static const uint32_t TSI0_GENCS_EOSDMEO = 1U << 0 ;
  1827. // Boolean field: CURSW
  1828. static const uint32_t TSI0_GENCS_CURSW = 1U << 1 ;
  1829. // Boolean field: End of Scan Flag
  1830. static const uint32_t TSI0_GENCS_EOSF = 1U << 2 ;
  1831. // Boolean field: Scan In Progress Status
  1832. static const uint32_t TSI0_GENCS_SCNIP = 1U << 3 ;
  1833. // Boolean field: Scan Trigger Mode
  1834. static const uint32_t TSI0_GENCS_STM = 1U << 4 ;
  1835. // Boolean field: TSI STOP Enable
  1836. static const uint32_t TSI0_GENCS_STPE = 1U << 5 ;
  1837. // Boolean field: Touch Sensing Input Interrupt Enable
  1838. static const uint32_t TSI0_GENCS_TSIIEN = 1U << 6 ;
  1839. // Boolean field: Touch Sensing Input Module Enable
  1840. static const uint32_t TSI0_GENCS_TSIEN = 1U << 7 ;
  1841. // Field (width: 5 bits): NSCN
  1842. inline uint32_t TSI0_GENCS_NSCN (const uint32_t inValue) { return (inValue & 31U) << 8 ; }
  1843. // Field (width: 3 bits): PS
  1844. inline uint32_t TSI0_GENCS_PS (const uint32_t inValue) { return (inValue & 7U) << 13 ; }
  1845. // Field (width: 3 bits): EXTCHRG
  1846. inline uint32_t TSI0_GENCS_EXTCHRG (const uint32_t inValue) { return (inValue & 7U) << 16 ; }
  1847. // Field (width: 2 bits): DVOLT
  1848. inline uint32_t TSI0_GENCS_DVOLT (const uint32_t inValue) { return (inValue & 3U) << 19 ; }
  1849. // Field (width: 3 bits): REFCHRG
  1850. inline uint32_t TSI0_GENCS_REFCHRG (const uint32_t inValue) { return (inValue & 7U) << 21 ; }
  1851. // Field (width: 4 bits): TSI analog modes setup and status bits.
  1852. inline uint32_t TSI0_GENCS_MODE (const uint32_t inValue) { return (inValue & 15U) << 24 ; }
  1853. // Boolean field: End-of-scan or Out-of-Range Interrupt Selection
  1854. static const uint32_t TSI0_GENCS_ESOR = 1U << 28 ;
  1855. // Boolean field: Out of Range Flag.
  1856. static const uint32_t TSI0_GENCS_OUTRGF = 1U << 31 ;
  1857. //-------------------- TSI DATA Register
  1858. #define TSI0_DATA (* ((volatile uint32_t *) (0x40045000 + 0x4)))
  1859. // Field (width: 16 bits): TSI Conversion Counter Value
  1860. inline uint32_t TSI0_DATA_TSICNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  1861. // Boolean field: Software Trigger Start
  1862. static const uint32_t TSI0_DATA_SWTS = 1U << 22 ;
  1863. // Boolean field: DMA Transfer Enabled
  1864. static const uint32_t TSI0_DATA_DMAEN = 1U << 23 ;
  1865. // Field (width: 4 bits): TSICH
  1866. inline uint32_t TSI0_DATA_TSICH (const uint32_t inValue) { return (inValue & 15U) << 28 ; }
  1867. //-------------------- TSI Threshold Register
  1868. #define TSI0_TSHD (* ((volatile uint32_t *) (0x40045000 + 0x8)))
  1869. // Field (width: 16 bits): TSI Wakeup Channel Low-threshold
  1870. inline uint32_t TSI0_TSHD_THRESL (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  1871. // Field (width: 16 bits): TSI Wakeup Channel High-threshold
  1872. inline uint32_t TSI0_TSHD_THRESH (const uint32_t inValue) { return (inValue & 65535U) << 16 ; }
  1873. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  1874. // Peripheral SIM
  1875. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  1876. //-------------------- System Options Register 1
  1877. #define SIM_SOPT1 (* ((volatile uint32_t *) (0x40047000 + 0)))
  1878. // Field (width: 4 bits): RAM size
  1879. inline uint32_t SIM_SOPT1_RAMSIZE (const uint32_t inValue) { return (inValue & 15U) << 12 ; }
  1880. // Field (width: 2 bits): 32K oscillator clock select
  1881. inline uint32_t SIM_SOPT1_OSC32KSEL (const uint32_t inValue) { return (inValue & 3U) << 18 ; }
  1882. // Boolean field: USB voltage regulator in standby mode during VLPR and VLPW modes
  1883. static const uint32_t SIM_SOPT1_USBVSTBY = 1U << 29 ;
  1884. // Boolean field: USB voltage regulator in standby mode during Stop, VLPS, LLS and VLLS modes.
  1885. static const uint32_t SIM_SOPT1_USBSSTBY = 1U << 30 ;
  1886. // Boolean field: USB voltage regulator enable
  1887. static const uint32_t SIM_SOPT1_USBREGEN = 1U << 31 ;
  1888. //-------------------- SOPT1 Configuration Register
  1889. #define SIM_SOPT1CFG (* ((volatile uint32_t *) (0x40047000 + 0x4)))
  1890. // Boolean field: USB voltage regulator enable write enable
  1891. static const uint32_t SIM_SOPT1CFG_URWE = 1U << 24 ;
  1892. // Boolean field: USB voltage regulator VLP standby write enable
  1893. static const uint32_t SIM_SOPT1CFG_UVSWE = 1U << 25 ;
  1894. // Boolean field: USB voltage regulator stop standby write enable
  1895. static const uint32_t SIM_SOPT1CFG_USSWE = 1U << 26 ;
  1896. //-------------------- USB PHY Control Register
  1897. #define SIM_USBPHYCTL (* ((volatile uint32_t *) (0x40047000 + 0x8)))
  1898. // Boolean field: Selects the default input voltage source to the USB Regulator in case both VREG_IN0 and VREG_IN1 are powered
  1899. static const uint32_t SIM_USBPHYCTL_USBVREGSEL = 1U << 8 ;
  1900. // Boolean field: Enables the pulldown on the output of the USB Regulator.
  1901. static const uint32_t SIM_USBPHYCTL_USBVREGPD = 1U << 9 ;
  1902. // Field (width: 3 bits): USB 3.3V Output Target
  1903. inline uint32_t SIM_USBPHYCTL_USB3VOUTTRG (const uint32_t inValue) { return (inValue & 7U) << 20 ; }
  1904. // Boolean field: USB Disable Inrush Current Limit
  1905. static const uint32_t SIM_USBPHYCTL_USBDISILIM = 1U << 23 ;
  1906. //-------------------- System Options Register 2
  1907. #define SIM_SOPT2 (* ((volatile uint32_t *) (0x40047000 + 0x1004)))
  1908. // Boolean field: USB Slow Clock Source
  1909. static const uint32_t SIM_SOPT2_USBSLSRC = 1U << 0 ;
  1910. // Boolean field: USB PHY PLL Regulator Enable
  1911. static const uint32_t SIM_SOPT2_USBREGEN = 1U << 1 ;
  1912. // Boolean field: RTC clock out select
  1913. static const uint32_t SIM_SOPT2_RTCCLKOUTSEL = 1U << 4 ;
  1914. // Field (width: 3 bits): CLKOUT select
  1915. inline uint32_t SIM_SOPT2_CLKOUTSEL (const uint32_t inValue) { return (inValue & 7U) << 5 ; }
  1916. // Field (width: 2 bits): FlexBus security level
  1917. inline uint32_t SIM_SOPT2_FBSL (const uint32_t inValue) { return (inValue & 3U) << 8 ; }
  1918. // Boolean field: Debug trace clock select
  1919. static const uint32_t SIM_SOPT2_TRACECLKSEL = 1U << 12 ;
  1920. // Field (width: 2 bits): PLL/FLL clock select
  1921. inline uint32_t SIM_SOPT2_PLLFLLSEL (const uint32_t inValue) { return (inValue & 3U) << 16 ; }
  1922. // Boolean field: USB clock source select
  1923. static const uint32_t SIM_SOPT2_USBSRC = 1U << 18 ;
  1924. // Boolean field: RMII clock source select
  1925. static const uint32_t SIM_SOPT2_RMIISRC = 1U << 19 ;
  1926. // Field (width: 2 bits): IEEE 1588 timestamp clock source select
  1927. inline uint32_t SIM_SOPT2_TIMESRC (const uint32_t inValue) { return (inValue & 3U) << 20 ; }
  1928. // Field (width: 2 bits): TPM clock source select
  1929. inline uint32_t SIM_SOPT2_TPMSRC (const uint32_t inValue) { return (inValue & 3U) << 24 ; }
  1930. // Field (width: 2 bits): LPUART clock source select
  1931. inline uint32_t SIM_SOPT2_LPUARTSRC (const uint32_t inValue) { return (inValue & 3U) << 26 ; }
  1932. // Field (width: 2 bits): SDHC clock source select
  1933. inline uint32_t SIM_SOPT2_SDHCSRC (const uint32_t inValue) { return (inValue & 3U) << 28 ; }
  1934. //-------------------- System Options Register 4
  1935. #define SIM_SOPT4 (* ((volatile uint32_t *) (0x40047000 + 0x100C)))
  1936. // Boolean field: FTM0 Fault 0 Select
  1937. static const uint32_t SIM_SOPT4_FTM0FLT0 = 1U << 0 ;
  1938. // Boolean field: FTM0 Fault 1 Select
  1939. static const uint32_t SIM_SOPT4_FTM0FLT1 = 1U << 1 ;
  1940. // Boolean field: FTM0 Fault 2 Select
  1941. static const uint32_t SIM_SOPT4_FTM0FLT2 = 1U << 2 ;
  1942. // Boolean field: FTM0 Fault 3 Select
  1943. static const uint32_t SIM_SOPT4_FTM0FLT3 = 1U << 3 ;
  1944. // Boolean field: FTM1 Fault 0 Select
  1945. static const uint32_t SIM_SOPT4_FTM1FLT0 = 1U << 4 ;
  1946. // Boolean field: FTM2 Fault 0 Select
  1947. static const uint32_t SIM_SOPT4_FTM2FLT0 = 1U << 8 ;
  1948. // Boolean field: FTM3 Fault 0 Select
  1949. static const uint32_t SIM_SOPT4_FTM3FLT0 = 1U << 12 ;
  1950. // Field (width: 2 bits): FTM1 channel 0 input capture source select
  1951. inline uint32_t SIM_SOPT4_FTM1CH0SRC (const uint32_t inValue) { return (inValue & 3U) << 18 ; }
  1952. // Field (width: 2 bits): FTM2 channel 0 input capture source select
  1953. inline uint32_t SIM_SOPT4_FTM2CH0SRC (const uint32_t inValue) { return (inValue & 3U) << 20 ; }
  1954. // Boolean field: FTM2 channel 1 input capture source select
  1955. static const uint32_t SIM_SOPT4_FTM2CH1SRC = 1U << 22 ;
  1956. // Boolean field: FlexTimer 0 External Clock Pin Select
  1957. static const uint32_t SIM_SOPT4_FTM0CLKSEL = 1U << 24 ;
  1958. // Boolean field: FTM1 External Clock Pin Select
  1959. static const uint32_t SIM_SOPT4_FTM1CLKSEL = 1U << 25 ;
  1960. // Boolean field: FlexTimer 2 External Clock Pin Select
  1961. static const uint32_t SIM_SOPT4_FTM2CLKSEL = 1U << 26 ;
  1962. // Boolean field: FlexTimer 3 External Clock Pin Select
  1963. static const uint32_t SIM_SOPT4_FTM3CLKSEL = 1U << 27 ;
  1964. // Boolean field: FlexTimer 0 Hardware Trigger 0 Source Select
  1965. static const uint32_t SIM_SOPT4_FTM0TRG0SRC = 1U << 28 ;
  1966. // Boolean field: FlexTimer 0 Hardware Trigger 1 Source Select
  1967. static const uint32_t SIM_SOPT4_FTM0TRG1SRC = 1U << 29 ;
  1968. // Boolean field: FlexTimer 3 Hardware Trigger 0 Source Select
  1969. static const uint32_t SIM_SOPT4_FTM3TRG0SRC = 1U << 30 ;
  1970. // Boolean field: FlexTimer 3 Hardware Trigger 1 Source Select
  1971. static const uint32_t SIM_SOPT4_FTM3TRG1SRC = 1U << 31 ;
  1972. //-------------------- System Options Register 5
  1973. #define SIM_SOPT5 (* ((volatile uint32_t *) (0x40047000 + 0x1010)))
  1974. // Field (width: 2 bits): UART 0 transmit data source select
  1975. inline uint32_t SIM_SOPT5_UART0TXSRC (const uint32_t inValue) { return (inValue & 3U) << 0 ; }
  1976. // Field (width: 2 bits): UART 0 receive data source select
  1977. inline uint32_t SIM_SOPT5_UART0RXSRC (const uint32_t inValue) { return (inValue & 3U) << 2 ; }
  1978. // Field (width: 2 bits): UART 1 transmit data source select
  1979. inline uint32_t SIM_SOPT5_UART1TXSRC (const uint32_t inValue) { return (inValue & 3U) << 4 ; }
  1980. // Field (width: 2 bits): UART 1 receive data source select
  1981. inline uint32_t SIM_SOPT5_UART1RXSRC (const uint32_t inValue) { return (inValue & 3U) << 6 ; }
  1982. // Field (width: 2 bits): LPUART0 transmit data source select
  1983. inline uint32_t SIM_SOPT5_LPUART0TXSRC (const uint32_t inValue) { return (inValue & 3U) << 16 ; }
  1984. // Field (width: 2 bits): LPUART0 receive data source select
  1985. inline uint32_t SIM_SOPT5_LPUART0RXSRC (const uint32_t inValue) { return (inValue & 3U) << 18 ; }
  1986. //-------------------- System Options Register 7
  1987. #define SIM_SOPT7 (* ((volatile uint32_t *) (0x40047000 + 0x1018)))
  1988. // Field (width: 4 bits): ADC0 trigger select
  1989. inline uint32_t SIM_SOPT7_ADC0TRGSEL (const uint32_t inValue) { return (inValue & 15U) << 0 ; }
  1990. // Boolean field: ADC0 pretrigger select
  1991. static const uint32_t SIM_SOPT7_ADC0PRETRGSEL = 1U << 4 ;
  1992. // Boolean field: ADC0 alternate trigger enable
  1993. static const uint32_t SIM_SOPT7_ADC0ALTTRGEN = 1U << 7 ;
  1994. // Field (width: 4 bits): ADC1 trigger select
  1995. inline uint32_t SIM_SOPT7_ADC1TRGSEL (const uint32_t inValue) { return (inValue & 15U) << 8 ; }
  1996. // Boolean field: ADC1 pre-trigger select
  1997. static const uint32_t SIM_SOPT7_ADC1PRETRGSEL = 1U << 12 ;
  1998. // Boolean field: ADC1 alternate trigger enable
  1999. static const uint32_t SIM_SOPT7_ADC1ALTTRGEN = 1U << 15 ;
  2000. //-------------------- System Options Register 8
  2001. #define SIM_SOPT8 (* ((volatile uint32_t *) (0x40047000 + 0x101C)))
  2002. // Boolean field: FTM0 Hardware Trigger 0 Software Synchronization
  2003. static const uint32_t SIM_SOPT8_FTM0SYNCBIT = 1U << 0 ;
  2004. // Boolean field: FTM1 Hardware Trigger 0 Software Synchronization
  2005. static const uint32_t SIM_SOPT8_FTM1SYNCBIT = 1U << 1 ;
  2006. // Boolean field: FTM2 Hardware Trigger 0 Software Synchronization
  2007. static const uint32_t SIM_SOPT8_FTM2SYNCBIT = 1U << 2 ;
  2008. // Boolean field: FTM3 Hardware Trigger 0 Software Synchronization
  2009. static const uint32_t SIM_SOPT8_FTM3SYNCBIT = 1U << 3 ;
  2010. // Boolean field: FTM0 channel 0 output source
  2011. static const uint32_t SIM_SOPT8_FTM0OCH0SRC = 1U << 16 ;
  2012. // Boolean field: FTM0 channel 1 output source
  2013. static const uint32_t SIM_SOPT8_FTM0OCH1SRC = 1U << 17 ;
  2014. // Boolean field: FTM0 channel 2 output source
  2015. static const uint32_t SIM_SOPT8_FTM0OCH2SRC = 1U << 18 ;
  2016. // Boolean field: FTM0 channel 3 output source
  2017. static const uint32_t SIM_SOPT8_FTM0OCH3SRC = 1U << 19 ;
  2018. // Boolean field: FTM0 channel 4 output source
  2019. static const uint32_t SIM_SOPT8_FTM0OCH4SRC = 1U << 20 ;
  2020. // Boolean field: FTM0 channel 5 output source
  2021. static const uint32_t SIM_SOPT8_FTM0OCH5SRC = 1U << 21 ;
  2022. // Boolean field: FTM0 channel 6 output source
  2023. static const uint32_t SIM_SOPT8_FTM0OCH6SRC = 1U << 22 ;
  2024. // Boolean field: FTM0 channel 7 output source
  2025. static const uint32_t SIM_SOPT8_FTM0OCH7SRC = 1U << 23 ;
  2026. // Boolean field: FTM3 channel 0 output source
  2027. static const uint32_t SIM_SOPT8_FTM3OCH0SRC = 1U << 24 ;
  2028. // Boolean field: FTM3 channel 1 output source
  2029. static const uint32_t SIM_SOPT8_FTM3OCH1SRC = 1U << 25 ;
  2030. // Boolean field: FTM3 channel 2 output source
  2031. static const uint32_t SIM_SOPT8_FTM3OCH2SRC = 1U << 26 ;
  2032. // Boolean field: FTM3 channel 3 output source
  2033. static const uint32_t SIM_SOPT8_FTM3OCH3SRC = 1U << 27 ;
  2034. // Boolean field: FTM3 channel 4 output source
  2035. static const uint32_t SIM_SOPT8_FTM3OCH4SRC = 1U << 28 ;
  2036. // Boolean field: FTM3 channel 5 output source
  2037. static const uint32_t SIM_SOPT8_FTM3OCH5SRC = 1U << 29 ;
  2038. // Boolean field: FTM3 channel 6 output source
  2039. static const uint32_t SIM_SOPT8_FTM3OCH6SRC = 1U << 30 ;
  2040. // Boolean field: FTM3 channel 7 output source
  2041. static const uint32_t SIM_SOPT8_FTM3OCH7SRC = 1U << 31 ;
  2042. //-------------------- System Options Register 9
  2043. #define SIM_SOPT9 (* ((volatile uint32_t *) (0x40047000 + 0x1020)))
  2044. // Field (width: 2 bits): TPM1 channel 0 input capture source select
  2045. inline uint32_t SIM_SOPT9_TPM1CH0SRC (const uint32_t inValue) { return (inValue & 3U) << 18 ; }
  2046. // Field (width: 2 bits): TPM2 channel 0 input capture source select
  2047. inline uint32_t SIM_SOPT9_TPM2CH0SRC (const uint32_t inValue) { return (inValue & 3U) << 20 ; }
  2048. // Boolean field: TPM1 External Clock Pin Select
  2049. static const uint32_t SIM_SOPT9_TPM1CLKSEL = 1U << 25 ;
  2050. // Boolean field: TPM2 External Clock Pin Select
  2051. static const uint32_t SIM_SOPT9_TPM2CLKSEL = 1U << 26 ;
  2052. //-------------------- System Device Identification Register
  2053. #define SIM_SDID (* ((const volatile uint32_t *) (0x40047000 + 0x1024)))
  2054. // Field (width: 4 bits): Pincount identification
  2055. inline uint32_t SIM_SDID_PINID (const uint32_t inValue) { return (inValue & 15U) << 0 ; }
  2056. // Field (width: 3 bits): Kinetis family identification
  2057. inline uint32_t SIM_SDID_FAMID (const uint32_t inValue) { return (inValue & 7U) << 4 ; }
  2058. // Field (width: 5 bits): Device Die ID
  2059. inline uint32_t SIM_SDID_DIEID (const uint32_t inValue) { return (inValue & 31U) << 7 ; }
  2060. // Field (width: 4 bits): Device revision number
  2061. inline uint32_t SIM_SDID_REVID (const uint32_t inValue) { return (inValue & 15U) << 12 ; }
  2062. // Field (width: 4 bits): Kinetis Series ID
  2063. inline uint32_t SIM_SDID_SERIESID (const uint32_t inValue) { return (inValue & 15U) << 20 ; }
  2064. // Field (width: 4 bits): Kinetis Sub-Family ID
  2065. inline uint32_t SIM_SDID_SUBFAMID (const uint32_t inValue) { return (inValue & 15U) << 24 ; }
  2066. // Field (width: 4 bits): Kinetis Family ID
  2067. inline uint32_t SIM_SDID_FAMILYID (const uint32_t inValue) { return (inValue & 15U) << 28 ; }
  2068. //-------------------- System Clock Gating Control Register 1
  2069. #define SIM_SCGC1 (* ((volatile uint32_t *) (0x40047000 + 0x1028)))
  2070. // Boolean field: I2C2 Clock Gate Control
  2071. static const uint32_t SIM_SCGC1_I2C2 = 1U << 6 ;
  2072. // Boolean field: I2C3 Clock Gate Control
  2073. static const uint32_t SIM_SCGC1_I2C3 = 1U << 7 ;
  2074. // Boolean field: UART4 Clock Gate Control
  2075. static const uint32_t SIM_SCGC1_UART4 = 1U << 10 ;
  2076. //-------------------- System Clock Gating Control Register 2
  2077. #define SIM_SCGC2 (* ((volatile uint32_t *) (0x40047000 + 0x102C)))
  2078. // Boolean field: ENET Clock Gate Control
  2079. static const uint32_t SIM_SCGC2_ENET = 1U << 0 ;
  2080. // Boolean field: LPUART0 Clock Gate Control
  2081. static const uint32_t SIM_SCGC2_LPUART0 = 1U << 4 ;
  2082. // Boolean field: TPM1 Clock Gate Control
  2083. static const uint32_t SIM_SCGC2_TPM1 = 1U << 9 ;
  2084. // Boolean field: TPM2 Clock Gate Control
  2085. static const uint32_t SIM_SCGC2_TPM2 = 1U << 10 ;
  2086. // Boolean field: DAC0 Clock Gate Control
  2087. static const uint32_t SIM_SCGC2_DAC0 = 1U << 12 ;
  2088. // Boolean field: DAC1 Clock Gate Control
  2089. static const uint32_t SIM_SCGC2_DAC1 = 1U << 13 ;
  2090. //-------------------- System Clock Gating Control Register 3
  2091. #define SIM_SCGC3 (* ((volatile uint32_t *) (0x40047000 + 0x1030)))
  2092. // Boolean field: RNGA Clock Gate Control
  2093. static const uint32_t SIM_SCGC3_RNGA = 1U << 0 ;
  2094. // Boolean field: USBHS Clock Gate Control
  2095. static const uint32_t SIM_SCGC3_USBHS = 1U << 1 ;
  2096. // Boolean field: USBHS PHY Clock Gate Control
  2097. static const uint32_t SIM_SCGC3_USBHSPHY = 1U << 2 ;
  2098. // Boolean field: USBHS DCD Clock Gate Control
  2099. static const uint32_t SIM_SCGC3_USBHSDCD = 1U << 3 ;
  2100. // Boolean field: FlexCAN1 Clock Gate Control
  2101. static const uint32_t SIM_SCGC3_FLEXCAN1 = 1U << 4 ;
  2102. // Boolean field: SPI2 Clock Gate Control
  2103. static const uint32_t SIM_SCGC3_SPI2 = 1U << 12 ;
  2104. // Boolean field: SDHC Clock Gate Control
  2105. static const uint32_t SIM_SCGC3_SDHC = 1U << 17 ;
  2106. // Boolean field: FTM2 Clock Gate Control
  2107. static const uint32_t SIM_SCGC3_FTM2 = 1U << 24 ;
  2108. // Boolean field: FTM3 Clock Gate Control
  2109. static const uint32_t SIM_SCGC3_FTM3 = 1U << 25 ;
  2110. // Boolean field: ADC1 Clock Gate Control
  2111. static const uint32_t SIM_SCGC3_ADC1 = 1U << 27 ;
  2112. //-------------------- System Clock Gating Control Register 4
  2113. #define SIM_SCGC4 (* ((volatile uint32_t *) (0x40047000 + 0x1034)))
  2114. // Boolean field: EWM Clock Gate Control
  2115. static const uint32_t SIM_SCGC4_EWM = 1U << 1 ;
  2116. // Boolean field: CMT Clock Gate Control
  2117. static const uint32_t SIM_SCGC4_CMT = 1U << 2 ;
  2118. // Boolean field: I2C0 Clock Gate Control
  2119. static const uint32_t SIM_SCGC4_I2C0 = 1U << 6 ;
  2120. // Boolean field: I2C1 Clock Gate Control
  2121. static const uint32_t SIM_SCGC4_I2C1 = 1U << 7 ;
  2122. // Boolean field: UART0 Clock Gate Control
  2123. static const uint32_t SIM_SCGC4_UART0 = 1U << 10 ;
  2124. // Boolean field: UART1 Clock Gate Control
  2125. static const uint32_t SIM_SCGC4_UART1 = 1U << 11 ;
  2126. // Boolean field: UART2 Clock Gate Control
  2127. static const uint32_t SIM_SCGC4_UART2 = 1U << 12 ;
  2128. // Boolean field: UART3 Clock Gate Control
  2129. static const uint32_t SIM_SCGC4_UART3 = 1U << 13 ;
  2130. // Boolean field: USB Clock Gate Control
  2131. static const uint32_t SIM_SCGC4_USBOTG = 1U << 18 ;
  2132. // Boolean field: Comparator Clock Gate Control
  2133. static const uint32_t SIM_SCGC4_CMP = 1U << 19 ;
  2134. // Boolean field: VREF Clock Gate Control
  2135. static const uint32_t SIM_SCGC4_VREF = 1U << 20 ;
  2136. //-------------------- System Clock Gating Control Register 5
  2137. #define SIM_SCGC5 (* ((volatile uint32_t *) (0x40047000 + 0x1038)))
  2138. // Boolean field: Low Power Timer Access Control
  2139. static const uint32_t SIM_SCGC5_LPTMR = 1U << 0 ;
  2140. // Boolean field: TSI Clock Gate Control
  2141. static const uint32_t SIM_SCGC5_TSI = 1U << 5 ;
  2142. // Boolean field: Port A Clock Gate Control
  2143. static const uint32_t SIM_SCGC5_PORTA = 1U << 9 ;
  2144. // Boolean field: Port B Clock Gate Control
  2145. static const uint32_t SIM_SCGC5_PORTB = 1U << 10 ;
  2146. // Boolean field: Port C Clock Gate Control
  2147. static const uint32_t SIM_SCGC5_PORTC = 1U << 11 ;
  2148. // Boolean field: Port D Clock Gate Control
  2149. static const uint32_t SIM_SCGC5_PORTD = 1U << 12 ;
  2150. // Boolean field: Port E Clock Gate Control
  2151. static const uint32_t SIM_SCGC5_PORTE = 1U << 13 ;
  2152. //-------------------- System Clock Gating Control Register 6
  2153. #define SIM_SCGC6 (* ((volatile uint32_t *) (0x40047000 + 0x103C)))
  2154. // Boolean field: Flash Memory Clock Gate Control
  2155. static const uint32_t SIM_SCGC6_FTF = 1U << 0 ;
  2156. // Boolean field: DMA Mux Clock Gate Control
  2157. static const uint32_t SIM_SCGC6_DMAMUX = 1U << 1 ;
  2158. // Boolean field: FlexCAN0 Clock Gate Control
  2159. static const uint32_t SIM_SCGC6_FLEXCAN0 = 1U << 4 ;
  2160. // Boolean field: RNGA Clock Gate Control
  2161. static const uint32_t SIM_SCGC6_RNGA = 1U << 9 ;
  2162. // Boolean field: SPI0 Clock Gate Control
  2163. static const uint32_t SIM_SCGC6_SPI0 = 1U << 12 ;
  2164. // Boolean field: SPI1 Clock Gate Control
  2165. static const uint32_t SIM_SCGC6_SPI1 = 1U << 13 ;
  2166. // Boolean field: I2S Clock Gate Control
  2167. static const uint32_t SIM_SCGC6_I2S = 1U << 15 ;
  2168. // Boolean field: CRC Clock Gate Control
  2169. static const uint32_t SIM_SCGC6_CRC = 1U << 18 ;
  2170. // Boolean field: USB DCD Clock Gate Control
  2171. static const uint32_t SIM_SCGC6_USBDCD = 1U << 21 ;
  2172. // Boolean field: PDB Clock Gate Control
  2173. static const uint32_t SIM_SCGC6_PDB = 1U << 22 ;
  2174. // Boolean field: PIT Clock Gate Control
  2175. static const uint32_t SIM_SCGC6_PIT = 1U << 23 ;
  2176. // Boolean field: FTM0 Clock Gate Control
  2177. static const uint32_t SIM_SCGC6_FTM0 = 1U << 24 ;
  2178. // Boolean field: FTM1 Clock Gate Control
  2179. static const uint32_t SIM_SCGC6_FTM1 = 1U << 25 ;
  2180. // Boolean field: FTM2 Clock Gate Control
  2181. static const uint32_t SIM_SCGC6_FTM2 = 1U << 26 ;
  2182. // Boolean field: ADC0 Clock Gate Control
  2183. static const uint32_t SIM_SCGC6_ADC0 = 1U << 27 ;
  2184. // Boolean field: RTC Access Control
  2185. static const uint32_t SIM_SCGC6_RTC = 1U << 29 ;
  2186. // Boolean field: DAC0 Clock Gate Control
  2187. static const uint32_t SIM_SCGC6_DAC0 = 1U << 31 ;
  2188. //-------------------- System Clock Gating Control Register 7
  2189. #define SIM_SCGC7 (* ((volatile uint32_t *) (0x40047000 + 0x1040)))
  2190. // Boolean field: FlexBus Clock Gate Control
  2191. static const uint32_t SIM_SCGC7_FLEXBUS = 1U << 0 ;
  2192. // Boolean field: DMA Clock Gate Control
  2193. static const uint32_t SIM_SCGC7_DMA = 1U << 1 ;
  2194. // Boolean field: MPU Clock Gate Control
  2195. static const uint32_t SIM_SCGC7_MPU = 1U << 2 ;
  2196. // Boolean field: SDRAMC Clock Gate Control
  2197. static const uint32_t SIM_SCGC7_SDRAMC = 1U << 3 ;
  2198. //-------------------- System Clock Divider Register 1
  2199. #define SIM_CLKDIV1 (* ((volatile uint32_t *) (0x40047000 + 0x1044)))
  2200. // Field (width: 4 bits): Clock 4 output divider value
  2201. inline uint32_t SIM_CLKDIV1_OUTDIV4 (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  2202. // Field (width: 4 bits): Clock 3 output divider value
  2203. inline uint32_t SIM_CLKDIV1_OUTDIV3 (const uint32_t inValue) { return (inValue & 15U) << 20 ; }
  2204. // Field (width: 4 bits): Clock 2 output divider value
  2205. inline uint32_t SIM_CLKDIV1_OUTDIV2 (const uint32_t inValue) { return (inValue & 15U) << 24 ; }
  2206. // Field (width: 4 bits): Clock 1 output divider value
  2207. inline uint32_t SIM_CLKDIV1_OUTDIV1 (const uint32_t inValue) { return (inValue & 15U) << 28 ; }
  2208. //-------------------- System Clock Divider Register 2
  2209. #define SIM_CLKDIV2 (* ((volatile uint32_t *) (0x40047000 + 0x1048)))
  2210. // Boolean field: USB clock divider fraction
  2211. static const uint32_t SIM_CLKDIV2_USBFRAC = 1U << 0 ;
  2212. // Field (width: 3 bits): USB clock divider divisor
  2213. inline uint32_t SIM_CLKDIV2_USBDIV (const uint32_t inValue) { return (inValue & 7U) << 1 ; }
  2214. //-------------------- Flash Configuration Register 1
  2215. #define SIM_FCFG1 (* ((volatile uint32_t *) (0x40047000 + 0x104C)))
  2216. // Boolean field: Flash Disable
  2217. static const uint32_t SIM_FCFG1_FLASHDIS = 1U << 0 ;
  2218. // Boolean field: Flash Doze
  2219. static const uint32_t SIM_FCFG1_FLASHDOZE = 1U << 1 ;
  2220. // Field (width: 4 bits): FlexNVM partition
  2221. inline uint32_t SIM_FCFG1_DEPART (const uint32_t inValue) { return (inValue & 15U) << 8 ; }
  2222. // Field (width: 4 bits): EEPROM size
  2223. inline uint32_t SIM_FCFG1_EESIZE (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  2224. // Field (width: 4 bits): Program flash size
  2225. inline uint32_t SIM_FCFG1_PFSIZE (const uint32_t inValue) { return (inValue & 15U) << 24 ; }
  2226. // Field (width: 4 bits): FlexNVM size
  2227. inline uint32_t SIM_FCFG1_NVMSIZE (const uint32_t inValue) { return (inValue & 15U) << 28 ; }
  2228. //-------------------- Flash Configuration Register 2
  2229. #define SIM_FCFG2 (* ((const volatile uint32_t *) (0x40047000 + 0x1050)))
  2230. // Field (width: 7 bits): Max address block 1
  2231. inline uint32_t SIM_FCFG2_MAXADDR1 (const uint32_t inValue) { return (inValue & 127U) << 16 ; }
  2232. // Boolean field: Program flash only
  2233. static const uint32_t SIM_FCFG2_PFLSH = 1U << 23 ;
  2234. // Field (width: 7 bits): Max address block 0
  2235. inline uint32_t SIM_FCFG2_MAXADDR0 (const uint32_t inValue) { return (inValue & 127U) << 24 ; }
  2236. // Boolean field: Swap program flash
  2237. static const uint32_t SIM_FCFG2_SWAPPFLSH = 1U << 31 ;
  2238. //-------------------- Unique Identification Register High
  2239. #define SIM_UIDH (* ((const volatile uint32_t *) (0x40047000 + 0x1054)))
  2240. //-------------------- Unique Identification Register Mid-High
  2241. #define SIM_UIDMH (* ((const volatile uint32_t *) (0x40047000 + 0x1058)))
  2242. //-------------------- Unique Identification Register Mid Low
  2243. #define SIM_UIDML (* ((const volatile uint32_t *) (0x40047000 + 0x105C)))
  2244. //-------------------- Unique Identification Register Low
  2245. #define SIM_UIDL (* ((const volatile uint32_t *) (0x40047000 + 0x1060)))
  2246. //-------------------- System Clock Divider Register 3
  2247. #define SIM_CLKDIV3 (* ((volatile uint32_t *) (0x40047000 + 0x1064)))
  2248. // Boolean field: PLLFLL clock divider fraction
  2249. static const uint32_t SIM_CLKDIV3_PLLFLLFRAC = 1U << 0 ;
  2250. // Field (width: 3 bits): PLLFLL clock divider divisor
  2251. inline uint32_t SIM_CLKDIV3_PLLFLLDIV (const uint32_t inValue) { return (inValue & 7U) << 1 ; }
  2252. //-------------------- System Clock Divider Register 4
  2253. #define SIM_CLKDIV4 (* ((volatile uint32_t *) (0x40047000 + 0x1068)))
  2254. // Boolean field: Trace clock divider fraction
  2255. static const uint32_t SIM_CLKDIV4_TRACEFRAC = 1U << 0 ;
  2256. // Field (width: 3 bits): Trace clock divider divisor
  2257. inline uint32_t SIM_CLKDIV4_TRACEDIV (const uint32_t inValue) { return (inValue & 7U) << 1 ; }
  2258. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  2259. // Peripheral WDOG
  2260. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  2261. //-------------------- Watchdog Status and Control Register High
  2262. #define WDOG_STCTRLH (* ((volatile uint16_t *) (0x40052000 + 0)))
  2263. // Boolean field: Enables or disables the WDOG's operation
  2264. static const uint16_t WDOG_STCTRLH_WDOGEN = 1U << 0 ;
  2265. // Boolean field: Selects clock source for the WDOG timer and other internal timing operations.
  2266. static const uint16_t WDOG_STCTRLH_CLKSRC = 1U << 1 ;
  2267. // Boolean field: Used to enable the debug breadcrumbs feature
  2268. static const uint16_t WDOG_STCTRLH_IRQRSTEN = 1U << 2 ;
  2269. // Boolean field: Enables Windowing mode.
  2270. static const uint16_t WDOG_STCTRLH_WINEN = 1U << 3 ;
  2271. // Boolean field: Enables updates to watchdog write-once registers, after the reset-triggered initial configuration window (WCT) closes, through unlock sequence
  2272. static const uint16_t WDOG_STCTRLH_ALLOWUPDATE = 1U << 4 ;
  2273. // Boolean field: Enables or disables WDOG in Debug mode.
  2274. static const uint16_t WDOG_STCTRLH_DBGEN = 1U << 5 ;
  2275. // Boolean field: Enables or disables WDOG in Stop mode.
  2276. static const uint16_t WDOG_STCTRLH_STOPEN = 1U << 6 ;
  2277. // Boolean field: Enables or disables WDOG in Wait mode.
  2278. static const uint16_t WDOG_STCTRLH_WAITEN = 1U << 7 ;
  2279. // Boolean field: Puts the watchdog in the functional test mode
  2280. static const uint16_t WDOG_STCTRLH_TESTWDOG = 1U << 10 ;
  2281. // Boolean field: Effective only if TESTWDOG is set. Selects the test to be run on the watchdog timer.
  2282. static const uint16_t WDOG_STCTRLH_TESTSEL = 1U << 11 ;
  2283. // Field (width: 2 bits): This 2-bit field selects the byte to be tested when the watchdog is in the byte test mode.
  2284. inline uint16_t WDOG_STCTRLH_BYTESEL (const uint16_t inValue) { return (inValue & 3U) << 12 ; }
  2285. // Boolean field: Allows the WDOG's functional test mode to be disabled permanently
  2286. static const uint16_t WDOG_STCTRLH_DISTESTWDOG = 1U << 14 ;
  2287. //-------------------- Watchdog Status and Control Register Low
  2288. #define WDOG_STCTRLL (* ((volatile uint16_t *) (0x40052000 + 0x2)))
  2289. // Boolean field: Interrupt flag
  2290. static const uint16_t WDOG_STCTRLL_INTFLG = 1U << 15 ;
  2291. //-------------------- Watchdog Time-out Value Register High
  2292. #define WDOG_TOVALH (* ((volatile uint16_t *) (0x40052000 + 0x4)))
  2293. //-------------------- Watchdog Time-out Value Register Low
  2294. #define WDOG_TOVALL (* ((volatile uint16_t *) (0x40052000 + 0x6)))
  2295. //-------------------- Watchdog Window Register High
  2296. #define WDOG_WINH (* ((volatile uint16_t *) (0x40052000 + 0x8)))
  2297. //-------------------- Watchdog Window Register Low
  2298. #define WDOG_WINL (* ((volatile uint16_t *) (0x40052000 + 0xA)))
  2299. //-------------------- Watchdog Refresh register
  2300. #define WDOG_REFRESH (* ((volatile uint16_t *) (0x40052000 + 0xC)))
  2301. //-------------------- Watchdog Unlock register
  2302. #define WDOG_UNLOCK (* ((volatile uint16_t *) (0x40052000 + 0xE)))
  2303. //-------------------- Watchdog Timer Output Register High
  2304. #define WDOG_TMROUTH (* ((volatile uint16_t *) (0x40052000 + 0x10)))
  2305. //-------------------- Watchdog Timer Output Register Low
  2306. #define WDOG_TMROUTL (* ((volatile uint16_t *) (0x40052000 + 0x12)))
  2307. //-------------------- Watchdog Reset Count register
  2308. #define WDOG_RSTCNT (* ((volatile uint16_t *) (0x40052000 + 0x14)))
  2309. //-------------------- Watchdog Prescaler register
  2310. #define WDOG_PRESC (* ((volatile uint16_t *) (0x40052000 + 0x16)))
  2311. // Field (width: 3 bits): 3-bit prescaler for the watchdog clock source
  2312. inline uint16_t WDOG_PRESC_PRESCVAL (const uint16_t inValue) { return (inValue & 7U) << 8 ; }
  2313. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  2314. // Peripheral EWM
  2315. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  2316. //-------------------- Control Register
  2317. #define EWM_CTRL (* ((volatile uint8_t *) (0x40061000 + 0)))
  2318. // Boolean field: EWM enable.
  2319. static const uint8_t EWM_CTRL_EWMEN = 1U << 0 ;
  2320. // Boolean field: EWM_in's Assertion State Select.
  2321. static const uint8_t EWM_CTRL_ASSIN = 1U << 1 ;
  2322. // Boolean field: Input Enable.
  2323. static const uint8_t EWM_CTRL_INEN = 1U << 2 ;
  2324. // Boolean field: Interrupt Enable.
  2325. static const uint8_t EWM_CTRL_INTEN = 1U << 3 ;
  2326. //-------------------- Service Register
  2327. #define EWM_SERV (* ((volatile uint8_t *) (0x40061000 + 0x1)))
  2328. //-------------------- Compare Low Register
  2329. #define EWM_CMPL (* ((volatile uint8_t *) (0x40061000 + 0x2)))
  2330. //-------------------- Compare High Register
  2331. #define EWM_CMPH (* ((volatile uint8_t *) (0x40061000 + 0x3)))
  2332. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  2333. // Peripheral CMT
  2334. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  2335. //-------------------- CMT Carrier Generator High Data Register 1
  2336. #define CMT_CGH1 (* ((volatile uint8_t *) (0x40062000 + 0)))
  2337. //-------------------- CMT Carrier Generator Low Data Register 1
  2338. #define CMT_CGL1 (* ((volatile uint8_t *) (0x40062000 + 0x1)))
  2339. //-------------------- CMT Carrier Generator High Data Register 2
  2340. #define CMT_CGH2 (* ((volatile uint8_t *) (0x40062000 + 0x2)))
  2341. //-------------------- CMT Carrier Generator Low Data Register 2
  2342. #define CMT_CGL2 (* ((volatile uint8_t *) (0x40062000 + 0x3)))
  2343. //-------------------- CMT Output Control Register
  2344. #define CMT_OC (* ((volatile uint8_t *) (0x40062000 + 0x4)))
  2345. // Boolean field: IRO Pin Enable
  2346. static const uint8_t CMT_OC_IROPEN = 1U << 5 ;
  2347. // Boolean field: CMT Output Polarity
  2348. static const uint8_t CMT_OC_CMTPOL = 1U << 6 ;
  2349. // Boolean field: IRO Latch Control
  2350. static const uint8_t CMT_OC_IROL = 1U << 7 ;
  2351. //-------------------- CMT Modulator Status and Control Register
  2352. #define CMT_MSC (* ((volatile uint8_t *) (0x40062000 + 0x5)))
  2353. // Boolean field: Modulator and Carrier Generator Enable
  2354. static const uint8_t CMT_MSC_MCGEN = 1U << 0 ;
  2355. // Boolean field: End of Cycle Interrupt Enable
  2356. static const uint8_t CMT_MSC_EOCIE = 1U << 1 ;
  2357. // Boolean field: FSK Mode Select
  2358. static const uint8_t CMT_MSC_FSK = 1U << 2 ;
  2359. // Boolean field: Baseband Enable
  2360. static const uint8_t CMT_MSC_BASE = 1U << 3 ;
  2361. // Boolean field: Extended Space Enable
  2362. static const uint8_t CMT_MSC_EXSPC = 1U << 4 ;
  2363. // Field (width: 2 bits): CMT Clock Divide Prescaler
  2364. inline uint8_t CMT_MSC_CMTDIV (const uint8_t inValue) { return (inValue & 3U) << 5 ; }
  2365. // Boolean field: End Of Cycle Status Flag
  2366. static const uint8_t CMT_MSC_EOCF = 1U << 7 ;
  2367. //-------------------- CMT Modulator Data Register Mark High
  2368. #define CMT_CMD1 (* ((volatile uint8_t *) (0x40062000 + 0x6)))
  2369. //-------------------- CMT Modulator Data Register Mark Low
  2370. #define CMT_CMD2 (* ((volatile uint8_t *) (0x40062000 + 0x7)))
  2371. //-------------------- CMT Modulator Data Register Space High
  2372. #define CMT_CMD3 (* ((volatile uint8_t *) (0x40062000 + 0x8)))
  2373. //-------------------- CMT Modulator Data Register Space Low
  2374. #define CMT_CMD4 (* ((volatile uint8_t *) (0x40062000 + 0x9)))
  2375. //-------------------- CMT Primary Prescaler Register
  2376. #define CMT_PPS (* ((volatile uint8_t *) (0x40062000 + 0xA)))
  2377. // Field (width: 4 bits): Primary Prescaler Divider
  2378. inline uint8_t CMT_PPS_PPSDIV (const uint8_t inValue) { return (inValue & 15U) << 0 ; }
  2379. //-------------------- CMT Direct Memory Access Register
  2380. #define CMT_DMA (* ((volatile uint8_t *) (0x40062000 + 0xB)))
  2381. // Boolean field: DMA Enable
  2382. static const uint8_t CMT_DMA_DMA = 1U << 0 ;
  2383. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  2384. // Peripheral MCG
  2385. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  2386. //-------------------- MCG Control 1 Register
  2387. #define MCG_C1 (* ((volatile uint8_t *) (0x40064000 + 0)))
  2388. // Boolean field: Internal Reference Stop Enable
  2389. static const uint8_t MCG_C1_IREFSTEN = 1U << 0 ;
  2390. // Boolean field: Internal Reference Clock Enable
  2391. static const uint8_t MCG_C1_IRCLKEN = 1U << 1 ;
  2392. // Boolean field: Internal Reference Select
  2393. static const uint8_t MCG_C1_IREFS = 1U << 2 ;
  2394. // Field (width: 3 bits): FLL External Reference Divider
  2395. inline uint8_t MCG_C1_FRDIV (const uint8_t inValue) { return (inValue & 7U) << 3 ; }
  2396. // Field (width: 2 bits): Clock Source Select
  2397. inline uint8_t MCG_C1_CLKS (const uint8_t inValue) { return (inValue & 3U) << 6 ; }
  2398. //-------------------- MCG Control 2 Register
  2399. #define MCG_C2 (* ((volatile uint8_t *) (0x40064000 + 0x1)))
  2400. // Boolean field: Internal Reference Clock Select
  2401. static const uint8_t MCG_C2_IRCS = 1U << 0 ;
  2402. // Boolean field: Low Power Select
  2403. static const uint8_t MCG_C2_LP = 1U << 1 ;
  2404. // Boolean field: External Reference Select
  2405. static const uint8_t MCG_C2_EREFS = 1U << 2 ;
  2406. // Boolean field: High Gain Oscillator Select
  2407. static const uint8_t MCG_C2_HGO = 1U << 3 ;
  2408. // Field (width: 2 bits): Frequency Range Select
  2409. inline uint8_t MCG_C2_RANGE (const uint8_t inValue) { return (inValue & 3U) << 4 ; }
  2410. // Boolean field: Fast Internal Reference Clock Fine Trim
  2411. static const uint8_t MCG_C2_FCFTRIM = 1U << 6 ;
  2412. // Boolean field: Loss of Clock Reset Enable
  2413. static const uint8_t MCG_C2_LOCRE0 = 1U << 7 ;
  2414. //-------------------- MCG Control 3 Register
  2415. #define MCG_C3 (* ((volatile uint8_t *) (0x40064000 + 0x2)))
  2416. //-------------------- MCG Control 4 Register
  2417. #define MCG_C4 (* ((volatile uint8_t *) (0x40064000 + 0x3)))
  2418. // Boolean field: Slow Internal Reference Clock Fine Trim
  2419. static const uint8_t MCG_C4_SCFTRIM = 1U << 0 ;
  2420. // Field (width: 4 bits): Fast Internal Reference Clock Trim Setting
  2421. inline uint8_t MCG_C4_FCTRIM (const uint8_t inValue) { return (inValue & 15U) << 1 ; }
  2422. // Field (width: 2 bits): DCO Range Select
  2423. inline uint8_t MCG_C4_DRST_DRS (const uint8_t inValue) { return (inValue & 3U) << 5 ; }
  2424. // Boolean field: DCO Maximum Frequency with 32.768 kHz Reference
  2425. static const uint8_t MCG_C4_DMX32 = 1U << 7 ;
  2426. //-------------------- MCG Control 5 Register
  2427. #define MCG_C5 (* ((volatile uint8_t *) (0x40064000 + 0x4)))
  2428. // Field (width: 3 bits): PLL External Reference Divider
  2429. inline uint8_t MCG_C5_PRDIV (const uint8_t inValue) { return (inValue & 7U) << 0 ; }
  2430. // Boolean field: PLL Stop Enable
  2431. static const uint8_t MCG_C5_PLLSTEN = 1U << 5 ;
  2432. // Boolean field: PLL Clock Enable
  2433. static const uint8_t MCG_C5_PLLCLKEN = 1U << 6 ;
  2434. //-------------------- MCG Control 6 Register
  2435. #define MCG_C6 (* ((volatile uint8_t *) (0x40064000 + 0x5)))
  2436. // Field (width: 5 bits): VCO Divider
  2437. inline uint8_t MCG_C6_VDIV (const uint8_t inValue) { return (inValue & 31U) << 0 ; }
  2438. // Boolean field: Clock Monitor Enable
  2439. static const uint8_t MCG_C6_CME0 = 1U << 5 ;
  2440. // Boolean field: PLL Select
  2441. static const uint8_t MCG_C6_PLLS = 1U << 6 ;
  2442. // Boolean field: Loss of Lock Interrrupt Enable
  2443. static const uint8_t MCG_C6_LOLIE0 = 1U << 7 ;
  2444. //-------------------- MCG Status Register
  2445. #define MCG_S (* ((volatile uint8_t *) (0x40064000 + 0x6)))
  2446. // Boolean field: Internal Reference Clock Status
  2447. static const uint8_t MCG_S_IRCST = 1U << 0 ;
  2448. // Boolean field: OSC Initialization
  2449. static const uint8_t MCG_S_OSCINIT0 = 1U << 1 ;
  2450. // Field (width: 2 bits): Clock Mode Status
  2451. inline uint8_t MCG_S_CLKST (const uint8_t inValue) { return (inValue & 3U) << 2 ; }
  2452. // Boolean field: Internal Reference Status
  2453. static const uint8_t MCG_S_IREFST = 1U << 4 ;
  2454. // Boolean field: PLL Select Status
  2455. static const uint8_t MCG_S_PLLST = 1U << 5 ;
  2456. // Boolean field: Lock Status
  2457. static const uint8_t MCG_S_LOCK0 = 1U << 6 ;
  2458. // Boolean field: Loss of Lock Status
  2459. static const uint8_t MCG_S_LOLS0 = 1U << 7 ;
  2460. //-------------------- MCG Status and Control Register
  2461. #define MCG_SC (* ((volatile uint8_t *) (0x40064000 + 0x8)))
  2462. // Boolean field: OSC0 Loss of Clock Status
  2463. static const uint8_t MCG_SC_LOCS0 = 1U << 0 ;
  2464. // Field (width: 3 bits): Fast Clock Internal Reference Divider
  2465. inline uint8_t MCG_SC_FCRDIV (const uint8_t inValue) { return (inValue & 7U) << 1 ; }
  2466. // Boolean field: FLL Filter Preserve Enable
  2467. static const uint8_t MCG_SC_FLTPRSRV = 1U << 4 ;
  2468. // Boolean field: Automatic Trim Machine Fail Flag
  2469. static const uint8_t MCG_SC_ATMF = 1U << 5 ;
  2470. // Boolean field: Automatic Trim Machine Select
  2471. static const uint8_t MCG_SC_ATMS = 1U << 6 ;
  2472. // Boolean field: Automatic Trim Machine Enable
  2473. static const uint8_t MCG_SC_ATME = 1U << 7 ;
  2474. //-------------------- MCG Auto Trim Compare Value High Register
  2475. #define MCG_ATCVH (* ((volatile uint8_t *) (0x40064000 + 0xA)))
  2476. //-------------------- MCG Auto Trim Compare Value Low Register
  2477. #define MCG_ATCVL (* ((volatile uint8_t *) (0x40064000 + 0xB)))
  2478. //-------------------- MCG Control 7 Register
  2479. #define MCG_C7 (* ((volatile uint8_t *) (0x40064000 + 0xC)))
  2480. // Field (width: 2 bits): MCG OSC Clock Select
  2481. inline uint8_t MCG_C7_OSCSEL (const uint8_t inValue) { return (inValue & 3U) << 0 ; }
  2482. //-------------------- MCG Control 8 Register
  2483. #define MCG_C8 (* ((volatile uint8_t *) (0x40064000 + 0xD)))
  2484. // Boolean field: RTC Loss of Clock Status
  2485. static const uint8_t MCG_C8_LOCS1 = 1U << 0 ;
  2486. // Boolean field: Clock Monitor Enable1
  2487. static const uint8_t MCG_C8_CME1 = 1U << 5 ;
  2488. // Boolean field: PLL Loss of Lock Reset Enable
  2489. static const uint8_t MCG_C8_LOLRE = 1U << 6 ;
  2490. // Boolean field: Loss of Clock Reset Enable
  2491. static const uint8_t MCG_C8_LOCRE1 = 1U << 7 ;
  2492. //-------------------- MCG Control 9 Register
  2493. #define MCG_C9 (* ((volatile uint8_t *) (0x40064000 + 0xE)))
  2494. // Boolean field: External PLL Loss of Clock Status
  2495. static const uint8_t MCG_C9_EXT_PLL_LOCS = 1U << 0 ;
  2496. // Boolean field: MCG External PLL Loss of Clock Reset Enable
  2497. static const uint8_t MCG_C9_PLL_LOCRE = 1U << 4 ;
  2498. // Boolean field: MCG External PLL Clock Monitor Enable
  2499. static const uint8_t MCG_C9_PLL_CME = 1U << 5 ;
  2500. //-------------------- MCG Control 11 Register
  2501. #define MCG_C11 (* ((volatile uint8_t *) (0x40064000 + 0x10)))
  2502. // Boolean field: PLL Clock Select
  2503. static const uint8_t MCG_C11_PLLCS = 1U << 4 ;
  2504. //-------------------- MCG Status 2 Register
  2505. #define MCG_S2 (* ((const volatile uint8_t *) (0x40064000 + 0x12)))
  2506. // Boolean field: PLL Clock Select Status
  2507. static const uint8_t MCG_S2_PLLCST = 1U << 4 ;
  2508. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  2509. // Peripheral OSC
  2510. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  2511. //-------------------- OSC Control Register
  2512. #define OSC_CR (* ((volatile uint8_t *) (0x40065000 + 0)))
  2513. // Boolean field: Oscillator 16 pF Capacitor Load Configure
  2514. static const uint8_t OSC_CR_SC16P = 1U << 0 ;
  2515. // Boolean field: Oscillator 8 pF Capacitor Load Configure
  2516. static const uint8_t OSC_CR_SC8P = 1U << 1 ;
  2517. // Boolean field: Oscillator 4 pF Capacitor Load Configure
  2518. static const uint8_t OSC_CR_SC4P = 1U << 2 ;
  2519. // Boolean field: Oscillator 2 pF Capacitor Load Configure
  2520. static const uint8_t OSC_CR_SC2P = 1U << 3 ;
  2521. // Boolean field: External Reference Stop Enable
  2522. static const uint8_t OSC_CR_EREFSTEN = 1U << 5 ;
  2523. // Boolean field: External Reference Enable
  2524. static const uint8_t OSC_CR_ERCLKEN = 1U << 7 ;
  2525. //-------------------- OSC_DIV
  2526. #define OSC_DIV (* ((volatile uint8_t *) (0x40065000 + 0x2)))
  2527. // Field (width: 2 bits): ERCLK prescaler
  2528. inline uint8_t OSC_DIV_ERPS (const uint8_t inValue) { return (inValue & 3U) << 6 ; }
  2529. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  2530. // Peripheral USB0
  2531. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  2532. //-------------------- Peripheral ID register
  2533. #define USB0_PERID (* ((const volatile uint8_t *) (0x40072000 + 0)))
  2534. // Field (width: 6 bits): Peripheral Identification
  2535. inline uint8_t USB0_PERID_ID (const uint8_t inValue) { return (inValue & 63U) << 0 ; }
  2536. //-------------------- Peripheral ID Complement register
  2537. #define USB0_IDCOMP (* ((const volatile uint8_t *) (0x40072000 + 0x4)))
  2538. // Field (width: 6 bits): Ones' complement of PERID[ID]. bits.
  2539. inline uint8_t USB0_IDCOMP_NID (const uint8_t inValue) { return (inValue & 63U) << 0 ; }
  2540. //-------------------- Peripheral Revision register
  2541. #define USB0_REV (* ((const volatile uint8_t *) (0x40072000 + 0x8)))
  2542. //-------------------- Peripheral Additional Info register
  2543. #define USB0_ADDINFO (* ((const volatile uint8_t *) (0x40072000 + 0xC)))
  2544. // Boolean field: This bit is set if host mode is enabled.
  2545. static const uint8_t USB0_ADDINFO_IEHOST = 1U << 0 ;
  2546. //-------------------- OTG Interrupt Status register
  2547. #define USB0_OTGISTAT (* ((volatile uint8_t *) (0x40072000 + 0x10)))
  2548. // Boolean field: This bit is set when a change in VBUS is detected on an A device.
  2549. static const uint8_t USB0_OTGISTAT_AVBUSCHG = 1U << 0 ;
  2550. // Boolean field: This bit is set when a change in VBUS is detected on a B device.
  2551. static const uint8_t USB0_OTGISTAT_B_SESS_CHG = 1U << 2 ;
  2552. // Boolean field: This bit is set when a change in VBUS is detected indicating a session valid or a session no longer valid
  2553. static const uint8_t USB0_OTGISTAT_SESSVLDCHG = 1U << 3 ;
  2554. // Boolean field: This interrupt is set when the USB line state (CTL[SE0] and CTL[JSTATE] bits) are stable without change for 1 millisecond, and the value of the line state is different from the last time when the line state was stable
  2555. static const uint8_t USB0_OTGISTAT_LINE_STATE_CHG = 1U << 5 ;
  2556. // Boolean field: This bit is set when the 1 millisecond timer expires
  2557. static const uint8_t USB0_OTGISTAT_ONEMSEC = 1U << 6 ;
  2558. // Boolean field: This bit is set when a change in the ID Signal from the USB connector is sensed.
  2559. static const uint8_t USB0_OTGISTAT_IDCHG = 1U << 7 ;
  2560. //-------------------- OTG Interrupt Control register
  2561. #define USB0_OTGICR (* ((volatile uint8_t *) (0x40072000 + 0x14)))
  2562. // Boolean field: A VBUS Valid Interrupt Enable
  2563. static const uint8_t USB0_OTGICR_AVBUSEN = 1U << 0 ;
  2564. // Boolean field: B Session END Interrupt Enable
  2565. static const uint8_t USB0_OTGICR_BSESSEN = 1U << 2 ;
  2566. // Boolean field: Session Valid Interrupt Enable
  2567. static const uint8_t USB0_OTGICR_SESSVLDEN = 1U << 3 ;
  2568. // Boolean field: Line State Change Interrupt Enable
  2569. static const uint8_t USB0_OTGICR_LINESTATEEN = 1U << 5 ;
  2570. // Boolean field: One Millisecond Interrupt Enable
  2571. static const uint8_t USB0_OTGICR_ONEMSECEN = 1U << 6 ;
  2572. // Boolean field: ID Interrupt Enable
  2573. static const uint8_t USB0_OTGICR_IDEN = 1U << 7 ;
  2574. //-------------------- OTG Status register
  2575. #define USB0_OTGSTAT (* ((volatile uint8_t *) (0x40072000 + 0x18)))
  2576. // Boolean field: A VBUS Valid
  2577. static const uint8_t USB0_OTGSTAT_AVBUSVLD = 1U << 0 ;
  2578. // Boolean field: B Session End
  2579. static const uint8_t USB0_OTGSTAT_BSESSEND = 1U << 2 ;
  2580. // Boolean field: Session Valid
  2581. static const uint8_t USB0_OTGSTAT_SESS_VLD = 1U << 3 ;
  2582. // Boolean field: Indicates that the internal signals that control the LINE_STATE_CHG field of OTGISTAT are stable for at least 1 ms
  2583. static const uint8_t USB0_OTGSTAT_LINESTATESTABLE = 1U << 5 ;
  2584. // Boolean field: This bit is reserved for the 1ms count, but it is not useful to software.
  2585. static const uint8_t USB0_OTGSTAT_ONEMSECEN = 1U << 6 ;
  2586. // Boolean field: Indicates the current state of the ID pin on the USB connector
  2587. static const uint8_t USB0_OTGSTAT_ID = 1U << 7 ;
  2588. //-------------------- OTG Control register
  2589. #define USB0_OTGCTL (* ((volatile uint8_t *) (0x40072000 + 0x1C)))
  2590. // Boolean field: On-The-Go pullup/pulldown resistor enable
  2591. static const uint8_t USB0_OTGCTL_OTGEN = 1U << 2 ;
  2592. // Boolean field: D- Data Line pull-down resistor enable
  2593. static const uint8_t USB0_OTGCTL_DMLOW = 1U << 4 ;
  2594. // Boolean field: D+ Data Line pull-down resistor enable
  2595. static const uint8_t USB0_OTGCTL_DPLOW = 1U << 5 ;
  2596. // Boolean field: D+ Data Line pullup resistor enable
  2597. static const uint8_t USB0_OTGCTL_DPHIGH = 1U << 7 ;
  2598. //-------------------- Interrupt Status register
  2599. #define USB0_ISTAT (* ((volatile uint8_t *) (0x40072000 + 0x80)))
  2600. // Boolean field: This bit is set when the USB Module has decoded a valid USB reset
  2601. static const uint8_t USB0_ISTAT_USBRST = 1U << 0 ;
  2602. // Boolean field: This bit is set when any of the error conditions within Error Interrupt Status (ERRSTAT) register occur
  2603. static const uint8_t USB0_ISTAT_ERROR = 1U << 1 ;
  2604. // Boolean field: This bit is set when the USB Module receives a Start Of Frame (SOF) token
  2605. static const uint8_t USB0_ISTAT_SOFTOK = 1U << 2 ;
  2606. // Boolean field: This bit is set when the current token being processed has completed
  2607. static const uint8_t USB0_ISTAT_TOKDNE = 1U << 3 ;
  2608. // Boolean field: This bit is set when the USB Module detects a constant idle on the USB bus for 3 ms
  2609. static const uint8_t USB0_ISTAT_SLEEP = 1U << 4 ;
  2610. // Boolean field: This bit is set when a K-state is observed on the DP/DM signals for 2
  2611. static const uint8_t USB0_ISTAT_RESUME = 1U << 5 ;
  2612. // Boolean field: Attach Interrupt
  2613. static const uint8_t USB0_ISTAT_ATTACH = 1U << 6 ;
  2614. // Boolean field: Stall Interrupt
  2615. static const uint8_t USB0_ISTAT_STALL = 1U << 7 ;
  2616. //-------------------- Interrupt Enable register
  2617. #define USB0_INTEN (* ((volatile uint8_t *) (0x40072000 + 0x84)))
  2618. // Boolean field: USBRST Interrupt Enable
  2619. static const uint8_t USB0_INTEN_USBRSTEN = 1U << 0 ;
  2620. // Boolean field: ERROR Interrupt Enable
  2621. static const uint8_t USB0_INTEN_ERROREN = 1U << 1 ;
  2622. // Boolean field: SOFTOK Interrupt Enable
  2623. static const uint8_t USB0_INTEN_SOFTOKEN = 1U << 2 ;
  2624. // Boolean field: TOKDNE Interrupt Enable
  2625. static const uint8_t USB0_INTEN_TOKDNEEN = 1U << 3 ;
  2626. // Boolean field: SLEEP Interrupt Enable
  2627. static const uint8_t USB0_INTEN_SLEEPEN = 1U << 4 ;
  2628. // Boolean field: RESUME Interrupt Enable
  2629. static const uint8_t USB0_INTEN_RESUMEEN = 1U << 5 ;
  2630. // Boolean field: ATTACH Interrupt Enable
  2631. static const uint8_t USB0_INTEN_ATTACHEN = 1U << 6 ;
  2632. // Boolean field: STALL Interrupt Enable
  2633. static const uint8_t USB0_INTEN_STALLEN = 1U << 7 ;
  2634. //-------------------- Error Interrupt Status register
  2635. #define USB0_ERRSTAT (* ((volatile uint8_t *) (0x40072000 + 0x88)))
  2636. // Boolean field: This bit is set when the PID check field fails.
  2637. static const uint8_t USB0_ERRSTAT_PIDERR = 1U << 0 ;
  2638. // Boolean field: This error interrupt has two functions
  2639. static const uint8_t USB0_ERRSTAT_CRC5EOF = 1U << 1 ;
  2640. // Boolean field: This bit is set when a data packet is rejected due to a CRC16 error.
  2641. static const uint8_t USB0_ERRSTAT_CRC16 = 1U << 2 ;
  2642. // Boolean field: This bit is set if the data field received was not 8 bits in length
  2643. static const uint8_t USB0_ERRSTAT_DFN8 = 1U << 3 ;
  2644. // Boolean field: This bit is set when a bus turnaround timeout error occurs
  2645. static const uint8_t USB0_ERRSTAT_BTOERR = 1U << 4 ;
  2646. // Boolean field: This bit is set if the USB Module has requested a DMA access to read a new BDT but has not been given the bus before it needs to receive or transmit data
  2647. static const uint8_t USB0_ERRSTAT_DMAERR = 1U << 5 ;
  2648. // Boolean field: This bit is set when a bit stuff error is detected
  2649. static const uint8_t USB0_ERRSTAT_BTSERR = 1U << 7 ;
  2650. //-------------------- Error Interrupt Enable register
  2651. #define USB0_ERREN (* ((volatile uint8_t *) (0x40072000 + 0x8C)))
  2652. // Boolean field: PIDERR Interrupt Enable
  2653. static const uint8_t USB0_ERREN_PIDERREN = 1U << 0 ;
  2654. // Boolean field: CRC5/EOF Interrupt Enable
  2655. static const uint8_t USB0_ERREN_CRC5EOFEN = 1U << 1 ;
  2656. // Boolean field: CRC16 Interrupt Enable
  2657. static const uint8_t USB0_ERREN_CRC16EN = 1U << 2 ;
  2658. // Boolean field: DFN8 Interrupt Enable
  2659. static const uint8_t USB0_ERREN_DFN8EN = 1U << 3 ;
  2660. // Boolean field: BTOERR Interrupt Enable
  2661. static const uint8_t USB0_ERREN_BTOERREN = 1U << 4 ;
  2662. // Boolean field: DMAERR Interrupt Enable
  2663. static const uint8_t USB0_ERREN_DMAERREN = 1U << 5 ;
  2664. // Boolean field: BTSERR Interrupt Enable
  2665. static const uint8_t USB0_ERREN_BTSERREN = 1U << 7 ;
  2666. //-------------------- Status register
  2667. #define USB0_STAT (* ((const volatile uint8_t *) (0x40072000 + 0x90)))
  2668. // Boolean field: This bit is set if the last buffer descriptor updated was in the odd bank of the BDT.
  2669. static const uint8_t USB0_STAT_ODD = 1U << 2 ;
  2670. // Boolean field: Transmit Indicator
  2671. static const uint8_t USB0_STAT_TX = 1U << 3 ;
  2672. // Field (width: 4 bits): This four-bit field encodes the endpoint address that received or transmitted the previous token
  2673. inline uint8_t USB0_STAT_ENDP (const uint8_t inValue) { return (inValue & 15U) << 4 ; }
  2674. //-------------------- Control register
  2675. #define USB0_CTL (* ((volatile uint8_t *) (0x40072000 + 0x94)))
  2676. // Boolean field: USB Enable
  2677. static const uint8_t USB0_CTL_USBENSOFEN = 1U << 0 ;
  2678. // Boolean field: Setting this bit to 1 resets all the BDT ODD ping/pong fields to 0, which then specifies the EVEN BDT bank
  2679. static const uint8_t USB0_CTL_ODDRST = 1U << 1 ;
  2680. // Boolean field: When set to 1 this bit enables the USB Module to execute resume signaling
  2681. static const uint8_t USB0_CTL_RESUME = 1U << 2 ;
  2682. // Boolean field: When set to 1, this bit enables the USB Module to operate in Host mode
  2683. static const uint8_t USB0_CTL_HOSTMODEEN = 1U << 3 ;
  2684. // Boolean field: Setting this bit enables the USB Module to generate USB reset signaling
  2685. static const uint8_t USB0_CTL_RESET = 1U << 4 ;
  2686. // Boolean field: In Host mode, TOKEN_BUSY is set when the USB module is busy executing a USB token
  2687. static const uint8_t USB0_CTL_TXSUSPENDTOKENBUSY = 1U << 5 ;
  2688. // Boolean field: Live USB Single Ended Zero signal
  2689. static const uint8_t USB0_CTL_SE0 = 1U << 6 ;
  2690. // Boolean field: Live USB differential receiver JSTATE signal
  2691. static const uint8_t USB0_CTL_JSTATE = 1U << 7 ;
  2692. //-------------------- Address register
  2693. #define USB0_ADDR (* ((volatile uint8_t *) (0x40072000 + 0x98)))
  2694. // Field (width: 7 bits): USB Address
  2695. inline uint8_t USB0_ADDR_ADDR (const uint8_t inValue) { return (inValue & 127U) << 0 ; }
  2696. // Boolean field: Low Speed Enable bit
  2697. static const uint8_t USB0_ADDR_LSEN = 1U << 7 ;
  2698. //-------------------- BDT Page register 1
  2699. #define USB0_BDTPAGE1 (* ((volatile uint8_t *) (0x40072000 + 0x9C)))
  2700. // Field (width: 7 bits): Provides address bits 15 through 9 of the BDT base address.
  2701. inline uint8_t USB0_BDTPAGE1_BDTBA (const uint8_t inValue) { return (inValue & 127U) << 1 ; }
  2702. //-------------------- Frame Number register Low
  2703. #define USB0_FRMNUML (* ((volatile uint8_t *) (0x40072000 + 0xA0)))
  2704. //-------------------- Frame Number register High
  2705. #define USB0_FRMNUMH (* ((volatile uint8_t *) (0x40072000 + 0xA4)))
  2706. // Field (width: 3 bits): This 3-bit field and the 8-bit field in the Frame Number Register Low are used to compute the address where the current Buffer Descriptor Table (BDT) resides in system memory
  2707. inline uint8_t USB0_FRMNUMH_FRM (const uint8_t inValue) { return (inValue & 7U) << 0 ; }
  2708. //-------------------- Token register
  2709. #define USB0_TOKEN (* ((volatile uint8_t *) (0x40072000 + 0xA8)))
  2710. // Field (width: 4 bits): Holds the Endpoint address for the token command
  2711. inline uint8_t USB0_TOKEN_TOKENENDPT (const uint8_t inValue) { return (inValue & 15U) << 0 ; }
  2712. // Field (width: 4 bits): Contains the token type executed by the USB module.
  2713. inline uint8_t USB0_TOKEN_TOKENPID (const uint8_t inValue) { return (inValue & 15U) << 4 ; }
  2714. //-------------------- SOF Threshold register
  2715. #define USB0_SOFTHLD (* ((volatile uint8_t *) (0x40072000 + 0xAC)))
  2716. //-------------------- BDT Page Register 2
  2717. #define USB0_BDTPAGE2 (* ((volatile uint8_t *) (0x40072000 + 0xB0)))
  2718. //-------------------- BDT Page Register 3
  2719. #define USB0_BDTPAGE3 (* ((volatile uint8_t *) (0x40072000 + 0xB4)))
  2720. //-------------------- Endpoint Control register (idx = 0 ... 15)
  2721. #define USB0_ENDPT(idx) (* ((volatile uint8_t *) (0x40072000 + 0xC0 + 0x4 * (idx))))
  2722. // Boolean field: When set this bit enables an endpoint to perform handshaking during a transaction to this endpoint
  2723. static const uint8_t USB0_ENDPT_EPHSHK = 1U << 0 ;
  2724. // Boolean field: When set this bit indicates that the endpoint is called
  2725. static const uint8_t USB0_ENDPT_EPSTALL = 1U << 1 ;
  2726. // Boolean field: This bit, when set, enables the endpoint for TX transfers. See
  2727. static const uint8_t USB0_ENDPT_EPTXEN = 1U << 2 ;
  2728. // Boolean field: This bit, when set, enables the endpoint for RX transfers. See
  2729. static const uint8_t USB0_ENDPT_EPRXEN = 1U << 3 ;
  2730. // Boolean field: This bit, when set, disables control (SETUP) transfers
  2731. static const uint8_t USB0_ENDPT_EPCTLDIS = 1U << 4 ;
  2732. // Boolean field: This is a Host mode only bit and is present in the control register for endpoint 0 (ENDPT0) only
  2733. static const uint8_t USB0_ENDPT_RETRYDIS = 1U << 6 ;
  2734. // Boolean field: Host without a hub This is a Host mode only field and is present in the control register for endpoint 0 (ENDPT0) only
  2735. static const uint8_t USB0_ENDPT_HOSTWOHUB = 1U << 7 ;
  2736. //-------------------- USB Control register
  2737. #define USB0_USBCTRL (* ((volatile uint8_t *) (0x40072000 + 0x100)))
  2738. // Boolean field: Enables the weak pulldowns on the USB transceiver.
  2739. static const uint8_t USB0_USBCTRL_PDE = 1U << 6 ;
  2740. // Boolean field: Places the USB transceiver into the suspend state.
  2741. static const uint8_t USB0_USBCTRL_SUSP = 1U << 7 ;
  2742. //-------------------- USB OTG Observe register
  2743. #define USB0_OBSERVE (* ((const volatile uint8_t *) (0x40072000 + 0x104)))
  2744. // Boolean field: Provides observability of the D- Pulldown enable at the USB transceiver.
  2745. static const uint8_t USB0_OBSERVE_DMPD = 1U << 4 ;
  2746. // Boolean field: Provides observability of the D+ Pulldown enable at the USB transceiver.
  2747. static const uint8_t USB0_OBSERVE_DPPD = 1U << 6 ;
  2748. // Boolean field: Provides observability of the D+ Pullup enable at the USB transceiver.
  2749. static const uint8_t USB0_OBSERVE_DPPU = 1U << 7 ;
  2750. //-------------------- USB OTG Control register
  2751. #define USB0_CONTROL (* ((volatile uint8_t *) (0x40072000 + 0x108)))
  2752. // Boolean field: Provides control of the DP Pullup in USBOTG, if USB is configured in non-OTG device mode.
  2753. static const uint8_t USB0_CONTROL_DPPULLUPNONOTG = 1U << 4 ;
  2754. //-------------------- USB Transceiver Control register 0
  2755. #define USB0_USBTRC0 (* ((volatile uint8_t *) (0x40072000 + 0x10C)))
  2756. // Boolean field: USB Asynchronous Interrupt
  2757. static const uint8_t USB0_USBTRC0_USB_RESUME_INT = 1U << 0 ;
  2758. // Boolean field: Synchronous USB Interrupt Detect
  2759. static const uint8_t USB0_USBTRC0_SYNC_DET = 1U << 1 ;
  2760. // Boolean field: Combined USB Clock Recovery interrupt status
  2761. static const uint8_t USB0_USBTRC0_USB_CLK_RECOVERY_INT = 1U << 2 ;
  2762. // Boolean field: Asynchronous Resume Interrupt Enable
  2763. static const uint8_t USB0_USBTRC0_USBRESMEN = 1U << 5 ;
  2764. // Boolean field: USB Reset
  2765. static const uint8_t USB0_USBTRC0_USBRESET = 1U << 7 ;
  2766. //-------------------- Frame Adjust Register
  2767. #define USB0_USBFRMADJUST (* ((volatile uint8_t *) (0x40072000 + 0x114)))
  2768. //-------------------- USB Clock recovery control
  2769. #define USB0_CLK_RECOVER_CTRL (* ((volatile uint8_t *) (0x40072000 + 0x140)))
  2770. // Boolean field: Restart from IFR trim value
  2771. static const uint8_t USB0_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN = 1U << 5 ;
  2772. // Boolean field: Reset/resume to rough phase enable
  2773. static const uint8_t USB0_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN = 1U << 6 ;
  2774. // Boolean field: Crystal-less USB enable
  2775. static const uint8_t USB0_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN = 1U << 7 ;
  2776. //-------------------- IRC48M oscillator enable register
  2777. #define USB0_CLK_RECOVER_IRC_EN (* ((volatile uint8_t *) (0x40072000 + 0x144)))
  2778. // Boolean field: IRC48M regulator enable
  2779. static const uint8_t USB0_CLK_RECOVER_IRC_EN_REG_EN = 1U << 0 ;
  2780. // Boolean field: IRC48M enable
  2781. static const uint8_t USB0_CLK_RECOVER_IRC_EN_IRC_EN = 1U << 1 ;
  2782. //-------------------- Clock recovery combined interrupt enable
  2783. #define USB0_CLK_RECOVER_INT_EN (* ((volatile uint8_t *) (0x40072000 + 0x154)))
  2784. // Boolean field: Determines whether OVF_ERROR condition signal is used in generation of USB_CLK_RECOVERY_INT.
  2785. static const uint8_t USB0_CLK_RECOVER_INT_EN_OVF_ERROR_EN = 1U << 4 ;
  2786. //-------------------- Clock recovery separated interrupt status
  2787. #define USB0_CLK_RECOVER_INT_STATUS (* ((volatile uint8_t *) (0x40072000 + 0x15C)))
  2788. // Boolean field: Indicates that the USB clock recovery algorithm has detected that the frequency trim adjustment needed for the IRC48M output clock is outside the available TRIM_FINE adjustment range for the IRC48M module
  2789. static const uint8_t USB0_CLK_RECOVER_INT_STATUS_OVF_ERROR = 1U << 4 ;
  2790. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  2791. // Peripheral VREF
  2792. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  2793. //-------------------- VREF Trim Register
  2794. #define VREF_TRM (* ((volatile uint8_t *) (0x40074000 + 0)))
  2795. // Field (width: 6 bits): Trim bits
  2796. inline uint8_t VREF_TRM_TRIM (const uint8_t inValue) { return (inValue & 63U) << 0 ; }
  2797. // Boolean field: Chop oscillator enable. When set, internal chopping operation is enabled and the internal analog offset will be minimized.
  2798. static const uint8_t VREF_TRM_CHOPEN = 1U << 6 ;
  2799. //-------------------- VREF Status and Control Register
  2800. #define VREF_SC (* ((volatile uint8_t *) (0x40074000 + 0x1)))
  2801. // Field (width: 2 bits): Buffer Mode selection
  2802. inline uint8_t VREF_SC_MODE_LV (const uint8_t inValue) { return (inValue & 3U) << 0 ; }
  2803. // Boolean field: Internal Voltage Reference stable
  2804. static const uint8_t VREF_SC_VREFST = 1U << 2 ;
  2805. // Boolean field: Second order curvature compensation enable
  2806. static const uint8_t VREF_SC_ICOMPEN = 1U << 5 ;
  2807. // Boolean field: Regulator enable
  2808. static const uint8_t VREF_SC_REGEN = 1U << 6 ;
  2809. // Boolean field: Internal Voltage Reference enable
  2810. static const uint8_t VREF_SC_VREFEN = 1U << 7 ;
  2811. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  2812. // Peripheral LLWU
  2813. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  2814. //-------------------- LLWU Pin Enable 1 register
  2815. #define LLWU_PE1 (* ((volatile uint8_t *) (0x4007C000 + 0)))
  2816. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P0
  2817. inline uint8_t LLWU_PE1_WUPE0 (const uint8_t inValue) { return (inValue & 3U) << 0 ; }
  2818. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P1
  2819. inline uint8_t LLWU_PE1_WUPE1 (const uint8_t inValue) { return (inValue & 3U) << 2 ; }
  2820. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P2
  2821. inline uint8_t LLWU_PE1_WUPE2 (const uint8_t inValue) { return (inValue & 3U) << 4 ; }
  2822. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P3
  2823. inline uint8_t LLWU_PE1_WUPE3 (const uint8_t inValue) { return (inValue & 3U) << 6 ; }
  2824. //-------------------- LLWU Pin Enable 2 register
  2825. #define LLWU_PE2 (* ((volatile uint8_t *) (0x4007C000 + 0x1)))
  2826. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P4
  2827. inline uint8_t LLWU_PE2_WUPE4 (const uint8_t inValue) { return (inValue & 3U) << 0 ; }
  2828. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P5
  2829. inline uint8_t LLWU_PE2_WUPE5 (const uint8_t inValue) { return (inValue & 3U) << 2 ; }
  2830. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P6
  2831. inline uint8_t LLWU_PE2_WUPE6 (const uint8_t inValue) { return (inValue & 3U) << 4 ; }
  2832. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P7
  2833. inline uint8_t LLWU_PE2_WUPE7 (const uint8_t inValue) { return (inValue & 3U) << 6 ; }
  2834. //-------------------- LLWU Pin Enable 3 register
  2835. #define LLWU_PE3 (* ((volatile uint8_t *) (0x4007C000 + 0x2)))
  2836. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P8
  2837. inline uint8_t LLWU_PE3_WUPE8 (const uint8_t inValue) { return (inValue & 3U) << 0 ; }
  2838. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P9
  2839. inline uint8_t LLWU_PE3_WUPE9 (const uint8_t inValue) { return (inValue & 3U) << 2 ; }
  2840. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P10
  2841. inline uint8_t LLWU_PE3_WUPE10 (const uint8_t inValue) { return (inValue & 3U) << 4 ; }
  2842. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P11
  2843. inline uint8_t LLWU_PE3_WUPE11 (const uint8_t inValue) { return (inValue & 3U) << 6 ; }
  2844. //-------------------- LLWU Pin Enable 4 register
  2845. #define LLWU_PE4 (* ((volatile uint8_t *) (0x4007C000 + 0x3)))
  2846. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P12
  2847. inline uint8_t LLWU_PE4_WUPE12 (const uint8_t inValue) { return (inValue & 3U) << 0 ; }
  2848. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P13
  2849. inline uint8_t LLWU_PE4_WUPE13 (const uint8_t inValue) { return (inValue & 3U) << 2 ; }
  2850. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P14
  2851. inline uint8_t LLWU_PE4_WUPE14 (const uint8_t inValue) { return (inValue & 3U) << 4 ; }
  2852. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P15
  2853. inline uint8_t LLWU_PE4_WUPE15 (const uint8_t inValue) { return (inValue & 3U) << 6 ; }
  2854. //-------------------- LLWU Pin Enable 5 register
  2855. #define LLWU_PE5 (* ((volatile uint8_t *) (0x4007C000 + 0x4)))
  2856. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P16
  2857. inline uint8_t LLWU_PE5_WUPE16 (const uint8_t inValue) { return (inValue & 3U) << 0 ; }
  2858. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P17
  2859. inline uint8_t LLWU_PE5_WUPE17 (const uint8_t inValue) { return (inValue & 3U) << 2 ; }
  2860. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P18
  2861. inline uint8_t LLWU_PE5_WUPE18 (const uint8_t inValue) { return (inValue & 3U) << 4 ; }
  2862. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P19
  2863. inline uint8_t LLWU_PE5_WUPE19 (const uint8_t inValue) { return (inValue & 3U) << 6 ; }
  2864. //-------------------- LLWU Pin Enable 6 register
  2865. #define LLWU_PE6 (* ((volatile uint8_t *) (0x4007C000 + 0x5)))
  2866. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P20
  2867. inline uint8_t LLWU_PE6_WUPE20 (const uint8_t inValue) { return (inValue & 3U) << 0 ; }
  2868. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P21
  2869. inline uint8_t LLWU_PE6_WUPE21 (const uint8_t inValue) { return (inValue & 3U) << 2 ; }
  2870. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P22
  2871. inline uint8_t LLWU_PE6_WUPE22 (const uint8_t inValue) { return (inValue & 3U) << 4 ; }
  2872. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P23
  2873. inline uint8_t LLWU_PE6_WUPE23 (const uint8_t inValue) { return (inValue & 3U) << 6 ; }
  2874. //-------------------- LLWU Pin Enable 7 register
  2875. #define LLWU_PE7 (* ((volatile uint8_t *) (0x4007C000 + 0x6)))
  2876. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P24
  2877. inline uint8_t LLWU_PE7_WUPE24 (const uint8_t inValue) { return (inValue & 3U) << 0 ; }
  2878. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P25
  2879. inline uint8_t LLWU_PE7_WUPE25 (const uint8_t inValue) { return (inValue & 3U) << 2 ; }
  2880. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P26
  2881. inline uint8_t LLWU_PE7_WUPE26 (const uint8_t inValue) { return (inValue & 3U) << 4 ; }
  2882. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P27
  2883. inline uint8_t LLWU_PE7_WUPE27 (const uint8_t inValue) { return (inValue & 3U) << 6 ; }
  2884. //-------------------- LLWU Pin Enable 8 register
  2885. #define LLWU_PE8 (* ((volatile uint8_t *) (0x4007C000 + 0x7)))
  2886. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P28
  2887. inline uint8_t LLWU_PE8_WUPE28 (const uint8_t inValue) { return (inValue & 3U) << 0 ; }
  2888. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P29
  2889. inline uint8_t LLWU_PE8_WUPE29 (const uint8_t inValue) { return (inValue & 3U) << 2 ; }
  2890. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P30
  2891. inline uint8_t LLWU_PE8_WUPE30 (const uint8_t inValue) { return (inValue & 3U) << 4 ; }
  2892. // Field (width: 2 bits): Wakeup Pin Enable For LLWU_P31
  2893. inline uint8_t LLWU_PE8_WUPE31 (const uint8_t inValue) { return (inValue & 3U) << 6 ; }
  2894. //-------------------- LLWU Module Enable register
  2895. #define LLWU_ME (* ((volatile uint8_t *) (0x4007C000 + 0x8)))
  2896. // Boolean field: Wakeup Module Enable For Module 0
  2897. static const uint8_t LLWU_ME_WUME0 = 1U << 0 ;
  2898. // Boolean field: Wakeup Module Enable for Module 1
  2899. static const uint8_t LLWU_ME_WUME1 = 1U << 1 ;
  2900. // Boolean field: Wakeup Module Enable For Module 2
  2901. static const uint8_t LLWU_ME_WUME2 = 1U << 2 ;
  2902. // Boolean field: Wakeup Module Enable For Module 3
  2903. static const uint8_t LLWU_ME_WUME3 = 1U << 3 ;
  2904. // Boolean field: Wakeup Module Enable For Module 4
  2905. static const uint8_t LLWU_ME_WUME4 = 1U << 4 ;
  2906. // Boolean field: Wakeup Module Enable For Module 5
  2907. static const uint8_t LLWU_ME_WUME5 = 1U << 5 ;
  2908. // Boolean field: Wakeup Module Enable For Module 6
  2909. static const uint8_t LLWU_ME_WUME6 = 1U << 6 ;
  2910. // Boolean field: Wakeup Module Enable For Module 7
  2911. static const uint8_t LLWU_ME_WUME7 = 1U << 7 ;
  2912. //-------------------- LLWU Pin Flag 1 register
  2913. #define LLWU_PF1 (* ((volatile uint8_t *) (0x4007C000 + 0x9)))
  2914. // Boolean field: Wakeup Flag For LLWU_P0
  2915. static const uint8_t LLWU_PF1_WUF0 = 1U << 0 ;
  2916. // Boolean field: Wakeup Flag For LLWU_P1
  2917. static const uint8_t LLWU_PF1_WUF1 = 1U << 1 ;
  2918. // Boolean field: Wakeup Flag For LLWU_P2
  2919. static const uint8_t LLWU_PF1_WUF2 = 1U << 2 ;
  2920. // Boolean field: Wakeup Flag For LLWU_P3
  2921. static const uint8_t LLWU_PF1_WUF3 = 1U << 3 ;
  2922. // Boolean field: Wakeup Flag For LLWU_P4
  2923. static const uint8_t LLWU_PF1_WUF4 = 1U << 4 ;
  2924. // Boolean field: Wakeup Flag For LLWU_P5
  2925. static const uint8_t LLWU_PF1_WUF5 = 1U << 5 ;
  2926. // Boolean field: Wakeup Flag For LLWU_P6
  2927. static const uint8_t LLWU_PF1_WUF6 = 1U << 6 ;
  2928. // Boolean field: Wakeup Flag For LLWU_P7
  2929. static const uint8_t LLWU_PF1_WUF7 = 1U << 7 ;
  2930. //-------------------- LLWU Pin Flag 2 register
  2931. #define LLWU_PF2 (* ((volatile uint8_t *) (0x4007C000 + 0xA)))
  2932. // Boolean field: Wakeup Flag For LLWU_P8
  2933. static const uint8_t LLWU_PF2_WUF8 = 1U << 0 ;
  2934. // Boolean field: Wakeup Flag For LLWU_P9
  2935. static const uint8_t LLWU_PF2_WUF9 = 1U << 1 ;
  2936. // Boolean field: Wakeup Flag For LLWU_P10
  2937. static const uint8_t LLWU_PF2_WUF10 = 1U << 2 ;
  2938. // Boolean field: Wakeup Flag For LLWU_P11
  2939. static const uint8_t LLWU_PF2_WUF11 = 1U << 3 ;
  2940. // Boolean field: Wakeup Flag For LLWU_P12
  2941. static const uint8_t LLWU_PF2_WUF12 = 1U << 4 ;
  2942. // Boolean field: Wakeup Flag For LLWU_P13
  2943. static const uint8_t LLWU_PF2_WUF13 = 1U << 5 ;
  2944. // Boolean field: Wakeup Flag For LLWU_P14
  2945. static const uint8_t LLWU_PF2_WUF14 = 1U << 6 ;
  2946. // Boolean field: Wakeup Flag For LLWU_P15
  2947. static const uint8_t LLWU_PF2_WUF15 = 1U << 7 ;
  2948. //-------------------- LLWU Pin Flag 3 register
  2949. #define LLWU_PF3 (* ((volatile uint8_t *) (0x4007C000 + 0xB)))
  2950. // Boolean field: Wakeup Flag For LLWU_P16
  2951. static const uint8_t LLWU_PF3_WUF16 = 1U << 0 ;
  2952. // Boolean field: Wakeup Flag For LLWU_P17
  2953. static const uint8_t LLWU_PF3_WUF17 = 1U << 1 ;
  2954. // Boolean field: Wakeup Flag For LLWU_P18
  2955. static const uint8_t LLWU_PF3_WUF18 = 1U << 2 ;
  2956. // Boolean field: Wakeup Flag For LLWU_P19
  2957. static const uint8_t LLWU_PF3_WUF19 = 1U << 3 ;
  2958. // Boolean field: Wakeup Flag For LLWU_P20
  2959. static const uint8_t LLWU_PF3_WUF20 = 1U << 4 ;
  2960. // Boolean field: Wakeup Flag For LLWU_P21
  2961. static const uint8_t LLWU_PF3_WUF21 = 1U << 5 ;
  2962. // Boolean field: Wakeup Flag For LLWU_P22
  2963. static const uint8_t LLWU_PF3_WUF22 = 1U << 6 ;
  2964. // Boolean field: Wakeup Flag For LLWU_P23
  2965. static const uint8_t LLWU_PF3_WUF23 = 1U << 7 ;
  2966. //-------------------- LLWU Pin Flag 4 register
  2967. #define LLWU_PF4 (* ((volatile uint8_t *) (0x4007C000 + 0xC)))
  2968. // Boolean field: Wakeup Flag For LLWU_P24
  2969. static const uint8_t LLWU_PF4_WUF24 = 1U << 0 ;
  2970. // Boolean field: Wakeup Flag For LLWU_P25
  2971. static const uint8_t LLWU_PF4_WUF25 = 1U << 1 ;
  2972. // Boolean field: Wakeup Flag For LLWU_P26
  2973. static const uint8_t LLWU_PF4_WUF26 = 1U << 2 ;
  2974. // Boolean field: Wakeup Flag For LLWU_P27
  2975. static const uint8_t LLWU_PF4_WUF27 = 1U << 3 ;
  2976. // Boolean field: Wakeup Flag For LLWU_P28
  2977. static const uint8_t LLWU_PF4_WUF28 = 1U << 4 ;
  2978. // Boolean field: Wakeup Flag For LLWU_P29
  2979. static const uint8_t LLWU_PF4_WUF29 = 1U << 5 ;
  2980. // Boolean field: Wakeup Flag For LLWU_P30
  2981. static const uint8_t LLWU_PF4_WUF30 = 1U << 6 ;
  2982. // Boolean field: Wakeup Flag For LLWU_P31
  2983. static const uint8_t LLWU_PF4_WUF31 = 1U << 7 ;
  2984. //-------------------- LLWU Module Flag 5 register
  2985. #define LLWU_MF5 (* ((const volatile uint8_t *) (0x4007C000 + 0xD)))
  2986. // Boolean field: Wakeup flag For module 0
  2987. static const uint8_t LLWU_MF5_MWUF0 = 1U << 0 ;
  2988. // Boolean field: Wakeup flag For module 1
  2989. static const uint8_t LLWU_MF5_MWUF1 = 1U << 1 ;
  2990. // Boolean field: Wakeup flag For module 2
  2991. static const uint8_t LLWU_MF5_MWUF2 = 1U << 2 ;
  2992. // Boolean field: Wakeup flag For module 3
  2993. static const uint8_t LLWU_MF5_MWUF3 = 1U << 3 ;
  2994. // Boolean field: Wakeup flag For module 4
  2995. static const uint8_t LLWU_MF5_MWUF4 = 1U << 4 ;
  2996. // Boolean field: Wakeup flag For module 5
  2997. static const uint8_t LLWU_MF5_MWUF5 = 1U << 5 ;
  2998. // Boolean field: Wakeup flag For module 6
  2999. static const uint8_t LLWU_MF5_MWUF6 = 1U << 6 ;
  3000. // Boolean field: Wakeup flag For module 7
  3001. static const uint8_t LLWU_MF5_MWUF7 = 1U << 7 ;
  3002. //-------------------- LLWU Pin Filter 1 register
  3003. #define LLWU_FILT1 (* ((volatile uint8_t *) (0x4007C000 + 0xE)))
  3004. // Field (width: 5 bits): Filter Pin Select
  3005. inline uint8_t LLWU_FILT1_FILTSEL (const uint8_t inValue) { return (inValue & 31U) << 0 ; }
  3006. // Field (width: 2 bits): Digital Filter On External Pin
  3007. inline uint8_t LLWU_FILT1_FILTE (const uint8_t inValue) { return (inValue & 3U) << 5 ; }
  3008. // Boolean field: Filter Detect Flag
  3009. static const uint8_t LLWU_FILT1_FILTF = 1U << 7 ;
  3010. //-------------------- LLWU Pin Filter 2 register
  3011. #define LLWU_FILT2 (* ((volatile uint8_t *) (0x4007C000 + 0xF)))
  3012. // Field (width: 5 bits): Filter Pin Select
  3013. inline uint8_t LLWU_FILT2_FILTSEL (const uint8_t inValue) { return (inValue & 31U) << 0 ; }
  3014. // Field (width: 2 bits): Digital Filter On External Pin
  3015. inline uint8_t LLWU_FILT2_FILTE (const uint8_t inValue) { return (inValue & 3U) << 5 ; }
  3016. // Boolean field: Filter Detect Flag
  3017. static const uint8_t LLWU_FILT2_FILTF = 1U << 7 ;
  3018. //-------------------- LLWU Pin Filter 3 register
  3019. #define LLWU_FILT3 (* ((volatile uint8_t *) (0x4007C000 + 0x10)))
  3020. // Field (width: 5 bits): Filter Pin Select
  3021. inline uint8_t LLWU_FILT3_FILTSEL (const uint8_t inValue) { return (inValue & 31U) << 0 ; }
  3022. // Field (width: 2 bits): Digital Filter On External Pin
  3023. inline uint8_t LLWU_FILT3_FILTE (const uint8_t inValue) { return (inValue & 3U) << 5 ; }
  3024. // Boolean field: Filter Detect Flag
  3025. static const uint8_t LLWU_FILT3_FILTF = 1U << 7 ;
  3026. //-------------------- LLWU Pin Filter 4 register
  3027. #define LLWU_FILT4 (* ((volatile uint8_t *) (0x4007C000 + 0x11)))
  3028. // Field (width: 5 bits): Filter Pin Select
  3029. inline uint8_t LLWU_FILT4_FILTSEL (const uint8_t inValue) { return (inValue & 31U) << 0 ; }
  3030. // Field (width: 2 bits): Digital Filter On External Pin
  3031. inline uint8_t LLWU_FILT4_FILTE (const uint8_t inValue) { return (inValue & 3U) << 5 ; }
  3032. // Boolean field: Filter Detect Flag
  3033. static const uint8_t LLWU_FILT4_FILTF = 1U << 7 ;
  3034. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  3035. // Peripheral PMC
  3036. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  3037. //-------------------- Low Voltage Detect Status And Control 1 register
  3038. #define PMC_LVDSC1 (* ((volatile uint8_t *) (0x4007D000 + 0)))
  3039. // Field (width: 2 bits): Low-Voltage Detect Voltage Select
  3040. inline uint8_t PMC_LVDSC1_LVDV (const uint8_t inValue) { return (inValue & 3U) << 0 ; }
  3041. // Boolean field: Low-Voltage Detect Reset Enable
  3042. static const uint8_t PMC_LVDSC1_LVDRE = 1U << 4 ;
  3043. // Boolean field: Low-Voltage Detect Interrupt Enable
  3044. static const uint8_t PMC_LVDSC1_LVDIE = 1U << 5 ;
  3045. // Boolean field: Low-Voltage Detect Acknowledge
  3046. static const uint8_t PMC_LVDSC1_LVDACK = 1U << 6 ;
  3047. // Boolean field: Low-Voltage Detect Flag
  3048. static const uint8_t PMC_LVDSC1_LVDF = 1U << 7 ;
  3049. //-------------------- Low Voltage Detect Status And Control 2 register
  3050. #define PMC_LVDSC2 (* ((volatile uint8_t *) (0x4007D000 + 0x1)))
  3051. // Field (width: 2 bits): Low-Voltage Warning Voltage Select
  3052. inline uint8_t PMC_LVDSC2_LVWV (const uint8_t inValue) { return (inValue & 3U) << 0 ; }
  3053. // Boolean field: Low-Voltage Warning Interrupt Enable
  3054. static const uint8_t PMC_LVDSC2_LVWIE = 1U << 5 ;
  3055. // Boolean field: Low-Voltage Warning Acknowledge
  3056. static const uint8_t PMC_LVDSC2_LVWACK = 1U << 6 ;
  3057. // Boolean field: Low-Voltage Warning Flag
  3058. static const uint8_t PMC_LVDSC2_LVWF = 1U << 7 ;
  3059. //-------------------- Regulator Status And Control register
  3060. #define PMC_REGSC (* ((volatile uint8_t *) (0x4007D000 + 0x2)))
  3061. // Boolean field: Bandgap Buffer Enable
  3062. static const uint8_t PMC_REGSC_BGBE = 1U << 0 ;
  3063. // Boolean field: Regulator In Run Regulation Status
  3064. static const uint8_t PMC_REGSC_REGONS = 1U << 2 ;
  3065. // Boolean field: Acknowledge Isolation
  3066. static const uint8_t PMC_REGSC_ACKISO = 1U << 3 ;
  3067. // Boolean field: Bandgap Enable In VLPx Operation
  3068. static const uint8_t PMC_REGSC_BGEN = 1U << 4 ;
  3069. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  3070. // Peripheral SMC
  3071. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  3072. //-------------------- Power Mode Protection register
  3073. #define SMC_PMPROT (* ((volatile uint8_t *) (0x4007E000 + 0)))
  3074. // Boolean field: Allow Very-Low-Leakage Stop Mode
  3075. static const uint8_t SMC_PMPROT_AVLLS = 1U << 1 ;
  3076. // Boolean field: Allow Low-Leakage Stop Mode
  3077. static const uint8_t SMC_PMPROT_ALLS = 1U << 3 ;
  3078. // Boolean field: Allow Very-Low-Power Modes
  3079. static const uint8_t SMC_PMPROT_AVLP = 1U << 5 ;
  3080. // Boolean field: Allow High Speed Run mode
  3081. static const uint8_t SMC_PMPROT_AHSRUN = 1U << 7 ;
  3082. //-------------------- Power Mode Control register
  3083. #define SMC_PMCTRL (* ((volatile uint8_t *) (0x4007E000 + 0x1)))
  3084. // Field (width: 3 bits): Stop Mode Control
  3085. inline uint8_t SMC_PMCTRL_STOPM (const uint8_t inValue) { return (inValue & 7U) << 0 ; }
  3086. // Boolean field: Stop Aborted
  3087. static const uint8_t SMC_PMCTRL_STOPA = 1U << 3 ;
  3088. // Field (width: 2 bits): Run Mode Control
  3089. inline uint8_t SMC_PMCTRL_RUNM (const uint8_t inValue) { return (inValue & 3U) << 5 ; }
  3090. //-------------------- Stop Control Register
  3091. #define SMC_STOPCTRL (* ((volatile uint8_t *) (0x4007E000 + 0x2)))
  3092. // Field (width: 3 bits): LLS or VLLS Mode Control
  3093. inline uint8_t SMC_STOPCTRL_LLSM (const uint8_t inValue) { return (inValue & 7U) << 0 ; }
  3094. // Boolean field: RAM2 Power Option
  3095. static const uint8_t SMC_STOPCTRL_RAM2PO = 1U << 4 ;
  3096. // Boolean field: POR Power Option
  3097. static const uint8_t SMC_STOPCTRL_PORPO = 1U << 5 ;
  3098. // Field (width: 2 bits): Partial Stop Option
  3099. inline uint8_t SMC_STOPCTRL_PSTOPO (const uint8_t inValue) { return (inValue & 3U) << 6 ; }
  3100. //-------------------- Power Mode Status register
  3101. #define SMC_PMSTAT (* ((const volatile uint8_t *) (0x4007E000 + 0x3)))
  3102. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  3103. // Peripheral RCM
  3104. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  3105. //-------------------- System Reset Status Register 0
  3106. #define RCM_SRS0 (* ((const volatile uint8_t *) (0x4007F000 + 0)))
  3107. // Boolean field: Low Leakage Wakeup Reset
  3108. static const uint8_t RCM_SRS0_WAKEUP = 1U << 0 ;
  3109. // Boolean field: Low-Voltage Detect Reset
  3110. static const uint8_t RCM_SRS0_LVD = 1U << 1 ;
  3111. // Boolean field: Loss-of-Clock Reset
  3112. static const uint8_t RCM_SRS0_LOC = 1U << 2 ;
  3113. // Boolean field: Loss-of-Lock Reset
  3114. static const uint8_t RCM_SRS0_LOL = 1U << 3 ;
  3115. // Boolean field: Watchdog
  3116. static const uint8_t RCM_SRS0_WDOG = 1U << 5 ;
  3117. // Boolean field: External Reset Pin
  3118. static const uint8_t RCM_SRS0_PIN = 1U << 6 ;
  3119. // Boolean field: Power-On Reset
  3120. static const uint8_t RCM_SRS0_POR = 1U << 7 ;
  3121. //-------------------- System Reset Status Register 1
  3122. #define RCM_SRS1 (* ((const volatile uint8_t *) (0x4007F000 + 0x1)))
  3123. // Boolean field: JTAG Generated Reset
  3124. static const uint8_t RCM_SRS1_JTAG = 1U << 0 ;
  3125. // Boolean field: Core Lockup
  3126. static const uint8_t RCM_SRS1_LOCKUP = 1U << 1 ;
  3127. // Boolean field: Software
  3128. static const uint8_t RCM_SRS1_SW = 1U << 2 ;
  3129. // Boolean field: MDM-AP System Reset Request
  3130. static const uint8_t RCM_SRS1_MDM_AP = 1U << 3 ;
  3131. // Boolean field: EzPort Reset
  3132. static const uint8_t RCM_SRS1_EZPT = 1U << 4 ;
  3133. // Boolean field: Stop Mode Acknowledge Error Reset
  3134. static const uint8_t RCM_SRS1_SACKERR = 1U << 5 ;
  3135. //-------------------- Reset Pin Filter Control register
  3136. #define RCM_RPFC (* ((volatile uint8_t *) (0x4007F000 + 0x4)))
  3137. // Field (width: 2 bits): Reset Pin Filter Select in Run and Wait Modes
  3138. inline uint8_t RCM_RPFC_RSTFLTSRW (const uint8_t inValue) { return (inValue & 3U) << 0 ; }
  3139. // Boolean field: Reset Pin Filter Select in Stop Mode
  3140. static const uint8_t RCM_RPFC_RSTFLTSS = 1U << 2 ;
  3141. //-------------------- Reset Pin Filter Width register
  3142. #define RCM_RPFW (* ((volatile uint8_t *) (0x4007F000 + 0x5)))
  3143. // Field (width: 5 bits): Reset Pin Filter Bus Clock Select
  3144. inline uint8_t RCM_RPFW_RSTFLTSEL (const uint8_t inValue) { return (inValue & 31U) << 0 ; }
  3145. //-------------------- Mode Register
  3146. #define RCM_MR (* ((const volatile uint8_t *) (0x4007F000 + 0x7)))
  3147. // Boolean field: EZP_MS_B pin state
  3148. static const uint8_t RCM_MR_EZP_MS = 1U << 1 ;
  3149. //-------------------- Sticky System Reset Status Register 0
  3150. #define RCM_SSRS0 (* ((volatile uint8_t *) (0x4007F000 + 0x8)))
  3151. // Boolean field: Sticky Low Leakage Wakeup Reset
  3152. static const uint8_t RCM_SSRS0_SWAKEUP = 1U << 0 ;
  3153. // Boolean field: Sticky Low-Voltage Detect Reset
  3154. static const uint8_t RCM_SSRS0_SLVD = 1U << 1 ;
  3155. // Boolean field: Sticky Loss-of-Clock Reset
  3156. static const uint8_t RCM_SSRS0_SLOC = 1U << 2 ;
  3157. // Boolean field: Sticky Loss-of-Lock Reset
  3158. static const uint8_t RCM_SSRS0_SLOL = 1U << 3 ;
  3159. // Boolean field: Sticky Watchdog
  3160. static const uint8_t RCM_SSRS0_SWDOG = 1U << 5 ;
  3161. // Boolean field: Sticky External Reset Pin
  3162. static const uint8_t RCM_SSRS0_SPIN = 1U << 6 ;
  3163. // Boolean field: Sticky Power-On Reset
  3164. static const uint8_t RCM_SSRS0_SPOR = 1U << 7 ;
  3165. //-------------------- Sticky System Reset Status Register 1
  3166. #define RCM_SSRS1 (* ((volatile uint8_t *) (0x4007F000 + 0x9)))
  3167. // Boolean field: Sticky JTAG Generated Reset
  3168. static const uint8_t RCM_SSRS1_SJTAG = 1U << 0 ;
  3169. // Boolean field: Sticky Core Lockup
  3170. static const uint8_t RCM_SSRS1_SLOCKUP = 1U << 1 ;
  3171. // Boolean field: Sticky Software
  3172. static const uint8_t RCM_SSRS1_SSW = 1U << 2 ;
  3173. // Boolean field: Sticky MDM-AP System Reset Request
  3174. static const uint8_t RCM_SSRS1_SMDM_AP = 1U << 3 ;
  3175. // Boolean field: Sticky EzPort Reset
  3176. static const uint8_t RCM_SSRS1_SEZPT = 1U << 4 ;
  3177. // Boolean field: Sticky Stop Mode Acknowledge Error Reset
  3178. static const uint8_t RCM_SSRS1_SSACKERR = 1U << 5 ;
  3179. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  3180. // Peripheral RNG
  3181. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  3182. //-------------------- RNGA Control Register
  3183. #define RNG_CR (* ((volatile uint32_t *) (0x400A0000 + 0)))
  3184. // Boolean field: Go
  3185. static const uint32_t RNG_CR_GO = 1U << 0 ;
  3186. // Boolean field: High Assurance
  3187. static const uint32_t RNG_CR_HA = 1U << 1 ;
  3188. // Boolean field: Interrupt Mask
  3189. static const uint32_t RNG_CR_INTM = 1U << 2 ;
  3190. // Boolean field: Clear Interrupt
  3191. static const uint32_t RNG_CR_CLRI = 1U << 3 ;
  3192. // Boolean field: Sleep
  3193. static const uint32_t RNG_CR_SLP = 1U << 4 ;
  3194. //-------------------- RNGA Status Register
  3195. #define RNG_SR (* ((const volatile uint32_t *) (0x400A0000 + 0x4)))
  3196. // Boolean field: Security Violation
  3197. static const uint32_t RNG_SR_SECV = 1U << 0 ;
  3198. // Boolean field: Last Read Status
  3199. static const uint32_t RNG_SR_LRS = 1U << 1 ;
  3200. // Boolean field: Output Register Underflow
  3201. static const uint32_t RNG_SR_ORU = 1U << 2 ;
  3202. // Boolean field: Error Interrupt
  3203. static const uint32_t RNG_SR_ERRI = 1U << 3 ;
  3204. // Boolean field: Sleep
  3205. static const uint32_t RNG_SR_SLP = 1U << 4 ;
  3206. // Field (width: 8 bits): Output Register Level
  3207. inline uint32_t RNG_SR_OREG_LVL (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  3208. // Field (width: 8 bits): Output Register Size
  3209. inline uint32_t RNG_SR_OREG_SIZE (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  3210. //-------------------- RNGA Entropy Register
  3211. #define RNG_ER (* ((volatile uint32_t *) (0x400A0000 + 0x8)))
  3212. //-------------------- RNGA Output Register
  3213. #define RNG_OR (* ((const volatile uint32_t *) (0x400A0000 + 0xC)))
  3214. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  3215. // Peripheral USBHS
  3216. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  3217. //-------------------- Identification Register
  3218. #define USBHS_ID (* ((const volatile uint32_t *) (0x400A1000 + 0)))
  3219. // Field (width: 6 bits): Configuration number
  3220. inline uint32_t USBHS_ID_ID (const uint32_t inValue) { return (inValue & 63U) << 0 ; }
  3221. // Field (width: 6 bits): Ones complement version of ID.
  3222. inline uint32_t USBHS_ID_NID (const uint32_t inValue) { return (inValue & 63U) << 8 ; }
  3223. // Field (width: 5 bits): Tag
  3224. inline uint32_t USBHS_ID_TAG (const uint32_t inValue) { return (inValue & 31U) << 16 ; }
  3225. // Field (width: 4 bits): Revision
  3226. inline uint32_t USBHS_ID_REVISION (const uint32_t inValue) { return (inValue & 15U) << 21 ; }
  3227. // Field (width: 4 bits): Version
  3228. inline uint32_t USBHS_ID_VERSION (const uint32_t inValue) { return (inValue & 15U) << 25 ; }
  3229. // Field (width: 3 bits): Version ID
  3230. inline uint32_t USBHS_ID_VERSIONID (const uint32_t inValue) { return (inValue & 7U) << 29 ; }
  3231. //-------------------- General Hardware Parameters Register
  3232. #define USBHS_HWGENERAL (* ((const volatile uint32_t *) (0x400A1000 + 0x4)))
  3233. // Field (width: 2 bits): PHY Width
  3234. inline uint32_t USBHS_HWGENERAL_PHYW (const uint32_t inValue) { return (inValue & 3U) << 4 ; }
  3235. // Field (width: 3 bits): PHY Mode
  3236. inline uint32_t USBHS_HWGENERAL_PHYM (const uint32_t inValue) { return (inValue & 7U) << 6 ; }
  3237. // Field (width: 2 bits): Serial mode
  3238. inline uint32_t USBHS_HWGENERAL_SM (const uint32_t inValue) { return (inValue & 3U) << 9 ; }
  3239. //-------------------- Host Hardware Parameters Register
  3240. #define USBHS_HWHOST (* ((const volatile uint32_t *) (0x400A1000 + 0x8)))
  3241. // Boolean field: Host Capable
  3242. static const uint32_t USBHS_HWHOST_HC = 1U << 0 ;
  3243. // Field (width: 3 bits): Number of Ports
  3244. inline uint32_t USBHS_HWHOST_NPORT (const uint32_t inValue) { return (inValue & 7U) << 1 ; }
  3245. // Field (width: 8 bits): Transaction translator contexts.
  3246. inline uint32_t USBHS_HWHOST_TTASY (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  3247. // Field (width: 8 bits): Transaction translator periodic contexts.
  3248. inline uint32_t USBHS_HWHOST_TTPER (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  3249. //-------------------- Device Hardware Parameters Register
  3250. #define USBHS_HWDEVICE (* ((const volatile uint32_t *) (0x400A1000 + 0xC)))
  3251. // Boolean field: Device Capable
  3252. static const uint32_t USBHS_HWDEVICE_DC = 1U << 0 ;
  3253. // Field (width: 5 bits): Device endpoints.
  3254. inline uint32_t USBHS_HWDEVICE_DEVEP (const uint32_t inValue) { return (inValue & 31U) << 1 ; }
  3255. //-------------------- Transmit Buffer Hardware Parameters Register
  3256. #define USBHS_HWTXBUF (* ((const volatile uint32_t *) (0x400A1000 + 0x10)))
  3257. // Field (width: 8 bits): Transmit Burst.
  3258. inline uint32_t USBHS_HWTXBUF_TXBURST (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  3259. // Field (width: 8 bits): Transmit Address.
  3260. inline uint32_t USBHS_HWTXBUF_TXADD (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  3261. // Field (width: 8 bits): Transmit Channel Address
  3262. inline uint32_t USBHS_HWTXBUF_TXCHANADD (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  3263. // Boolean field: Transmit local Context Registers
  3264. static const uint32_t USBHS_HWTXBUF_TXLC = 1U << 31 ;
  3265. //-------------------- Receive Buffer Hardware Parameters Register
  3266. #define USBHS_HWRXBUF (* ((const volatile uint32_t *) (0x400A1000 + 0x14)))
  3267. // Field (width: 8 bits): Receive Burst.
  3268. inline uint32_t USBHS_HWRXBUF_RXBURST (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  3269. // Field (width: 8 bits): Receive Address.
  3270. inline uint32_t USBHS_HWRXBUF_RXADD (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  3271. //-------------------- General Purpose Timer n Load Register (idx = 0 ... 1)
  3272. #define USBHS_GPTIMERLD(idx) (* ((volatile uint32_t *) (0x400A1000 + 0x80 + 0x8 * (idx))))
  3273. // Field (width: 24 bits): Specifies the value to be loaded into the countdown timer on a reset
  3274. inline uint32_t USBHS_GPTIMERLD_GPTLD (const uint32_t inValue) { return (inValue & 16777215U) << 0 ; }
  3275. //-------------------- General Purpose Timer n Control Register (idx = 0 ... 1)
  3276. #define USBHS_GPTIMERCTL(idx) (* ((volatile uint32_t *) (0x400A1000 + 0x84 + 0x8 * (idx))))
  3277. // Field (width: 24 bits): Timer Count
  3278. inline uint32_t USBHS_GPTIMERCTL_GPTCNT (const uint32_t inValue) { return (inValue & 16777215U) << 0 ; }
  3279. // Boolean field: Timer Mode
  3280. static const uint32_t USBHS_GPTIMERCTL_MODE = 1U << 24 ;
  3281. // Boolean field: Timer Reset
  3282. static const uint32_t USBHS_GPTIMERCTL_RST = 1U << 30 ;
  3283. // Boolean field: Timer Run
  3284. static const uint32_t USBHS_GPTIMERCTL_RUN = 1U << 31 ;
  3285. //-------------------- System Bus Interface Configuration Register
  3286. #define USBHS_USB_SBUSCFG (* ((volatile uint32_t *) (0x400A1000 + 0x90)))
  3287. // Field (width: 3 bits): Burst mode
  3288. inline uint32_t USBHS_USB_SBUSCFG_BURSTMODE (const uint32_t inValue) { return (inValue & 7U) << 0 ; }
  3289. //-------------------- Host Controller Interface Version and Capability Registers Length Register
  3290. #define USBHS_HCIVERSION (* ((const volatile uint32_t *) (0x400A1000 + 0x100)))
  3291. // Field (width: 8 bits): Capability registers length
  3292. inline uint32_t USBHS_HCIVERSION_CAPLENGTH (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  3293. // Field (width: 16 bits): EHCI revision number
  3294. inline uint32_t USBHS_HCIVERSION_HCIVERSION (const uint32_t inValue) { return (inValue & 65535U) << 16 ; }
  3295. //-------------------- Host Controller Structural Parameters Register
  3296. #define USBHS_HCSPARAMS (* ((const volatile uint32_t *) (0x400A1000 + 0x104)))
  3297. // Field (width: 4 bits): Number of Ports
  3298. inline uint32_t USBHS_HCSPARAMS_N_PORTS (const uint32_t inValue) { return (inValue & 15U) << 0 ; }
  3299. // Boolean field: Power Port Control
  3300. static const uint32_t USBHS_HCSPARAMS_PPC = 1U << 4 ;
  3301. // Field (width: 4 bits): Number Ports per CC
  3302. inline uint32_t USBHS_HCSPARAMS_N_PCC (const uint32_t inValue) { return (inValue & 15U) << 8 ; }
  3303. // Field (width: 4 bits): Number of Companion Controllers
  3304. inline uint32_t USBHS_HCSPARAMS_N_CC (const uint32_t inValue) { return (inValue & 15U) << 12 ; }
  3305. // Boolean field: Port Indicators
  3306. static const uint32_t USBHS_HCSPARAMS_PI = 1U << 16 ;
  3307. // Field (width: 4 bits): Ports per Transaction Translator
  3308. inline uint32_t USBHS_HCSPARAMS_N_PTT (const uint32_t inValue) { return (inValue & 15U) << 20 ; }
  3309. // Field (width: 4 bits): Number of Transaction Translators.
  3310. inline uint32_t USBHS_HCSPARAMS_N_TT (const uint32_t inValue) { return (inValue & 15U) << 24 ; }
  3311. //-------------------- Host Controller Capability Parameters Register
  3312. #define USBHS_HCCPARAMS (* ((const volatile uint32_t *) (0x400A1000 + 0x108)))
  3313. // Boolean field: 64-bit addressing capability.
  3314. static const uint32_t USBHS_HCCPARAMS_ADC = 1U << 0 ;
  3315. // Boolean field: Programmable Frame List flag
  3316. static const uint32_t USBHS_HCCPARAMS_PFL = 1U << 1 ;
  3317. // Boolean field: Asynchronous Schedule Park capability
  3318. static const uint32_t USBHS_HCCPARAMS_ASP = 1U << 2 ;
  3319. // Field (width: 4 bits): Isochronous Scheduling Threshold
  3320. inline uint32_t USBHS_HCCPARAMS_IST (const uint32_t inValue) { return (inValue & 15U) << 4 ; }
  3321. // Field (width: 8 bits): EHCI Extended Capabilities Pointer
  3322. inline uint32_t USBHS_HCCPARAMS_EECP (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  3323. //-------------------- Device Controller Interface Version
  3324. #define USBHS_DCIVERSION (* ((const volatile uint16_t *) (0x400A1000 + 0x122)))
  3325. //-------------------- Device Controller Capability Parameters
  3326. #define USBHS_DCCPARAMS (* ((const volatile uint32_t *) (0x400A1000 + 0x124)))
  3327. // Field (width: 5 bits): Device Endpoint Number
  3328. inline uint32_t USBHS_DCCPARAMS_DEN (const uint32_t inValue) { return (inValue & 31U) << 0 ; }
  3329. // Boolean field: Device Capable
  3330. static const uint32_t USBHS_DCCPARAMS_DC = 1U << 7 ;
  3331. // Boolean field: Host Capable
  3332. static const uint32_t USBHS_DCCPARAMS_HC = 1U << 8 ;
  3333. //-------------------- USB Command Register
  3334. #define USBHS_USBCMD (* ((volatile uint32_t *) (0x400A1000 + 0x140)))
  3335. // Boolean field: Run/Stop
  3336. static const uint32_t USBHS_USBCMD_RS = 1U << 0 ;
  3337. // Boolean field: Controller Reset
  3338. static const uint32_t USBHS_USBCMD_RST = 1U << 1 ;
  3339. // Field (width: 2 bits): Frame list Size
  3340. inline uint32_t USBHS_USBCMD_FS (const uint32_t inValue) { return (inValue & 3U) << 2 ; }
  3341. // Boolean field: Periodic Schedule Enable
  3342. static const uint32_t USBHS_USBCMD_PSE = 1U << 4 ;
  3343. // Boolean field: Asynchronous Schedule Enable
  3344. static const uint32_t USBHS_USBCMD_ASE = 1U << 5 ;
  3345. // Boolean field: Interrupt on Async Advance doorbell
  3346. static const uint32_t USBHS_USBCMD_IAA = 1U << 6 ;
  3347. // Field (width: 2 bits): Asynchronous Schedule Park mode count
  3348. inline uint32_t USBHS_USBCMD_ASP (const uint32_t inValue) { return (inValue & 3U) << 8 ; }
  3349. // Boolean field: Asynchronous Schedule Park mode Enable
  3350. static const uint32_t USBHS_USBCMD_ASPE = 1U << 11 ;
  3351. // Boolean field: Setup TripWire
  3352. static const uint32_t USBHS_USBCMD_SUTW = 1U << 13 ;
  3353. // Boolean field: Add dTD TripWire
  3354. static const uint32_t USBHS_USBCMD_ATDTW = 1U << 14 ;
  3355. // Boolean field: Frame list Size 2
  3356. static const uint32_t USBHS_USBCMD_FS2 = 1U << 15 ;
  3357. // Field (width: 8 bits): Interrupt Threshold Control
  3358. inline uint32_t USBHS_USBCMD_ITC (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  3359. //-------------------- USB Status Register
  3360. #define USBHS_USBSTS (* ((volatile uint32_t *) (0x400A1000 + 0x144)))
  3361. // Boolean field: USB Interrupt (USBINT)
  3362. static const uint32_t USBHS_USBSTS_UI = 1U << 0 ;
  3363. // Boolean field: USB Error Interrupt
  3364. static const uint32_t USBHS_USBSTS_UEI = 1U << 1 ;
  3365. // Boolean field: Port Change detect
  3366. static const uint32_t USBHS_USBSTS_PCI = 1U << 2 ;
  3367. // Boolean field: Frame-list Rollover
  3368. static const uint32_t USBHS_USBSTS_FRI = 1U << 3 ;
  3369. // Boolean field: System Error
  3370. static const uint32_t USBHS_USBSTS_SEI = 1U << 4 ;
  3371. // Boolean field: Interrupt on Async Advance
  3372. static const uint32_t USBHS_USBSTS_AAI = 1U << 5 ;
  3373. // Boolean field: USB Reset received
  3374. static const uint32_t USBHS_USBSTS_URI = 1U << 6 ;
  3375. // Boolean field: SOF Received
  3376. static const uint32_t USBHS_USBSTS_SRI = 1U << 7 ;
  3377. // Boolean field: Device-controller suspend
  3378. static const uint32_t USBHS_USBSTS_SLI = 1U << 8 ;
  3379. // Boolean field: Host Controller Halted
  3380. static const uint32_t USBHS_USBSTS_HCH = 1U << 12 ;
  3381. // Boolean field: Reclamation
  3382. static const uint32_t USBHS_USBSTS_RCL = 1U << 13 ;
  3383. // Boolean field: Periodic schedule Status
  3384. static const uint32_t USBHS_USBSTS_PS = 1U << 14 ;
  3385. // Boolean field: Asynchronous schedule Status
  3386. static const uint32_t USBHS_USBSTS_AS = 1U << 15 ;
  3387. // Boolean field: NAK Interrupt
  3388. static const uint32_t USBHS_USBSTS_NAKI = 1U << 16 ;
  3389. // Boolean field: USB host Asynchronous Interrupt
  3390. static const uint32_t USBHS_USBSTS_UAI = 1U << 18 ;
  3391. // Boolean field: USB host Periodic Interrupt
  3392. static const uint32_t USBHS_USBSTS_UPI = 1U << 19 ;
  3393. // Boolean field: General purpose Timer 0 Interrupt
  3394. static const uint32_t USBHS_USBSTS_TI0 = 1U << 24 ;
  3395. // Boolean field: General purpose Timer 1 Interrupt
  3396. static const uint32_t USBHS_USBSTS_TI1 = 1U << 25 ;
  3397. //-------------------- USB Interrupt Enable Register
  3398. #define USBHS_USBINTR (* ((volatile uint32_t *) (0x400A1000 + 0x148)))
  3399. // Boolean field: USB interrupt Enable
  3400. static const uint32_t USBHS_USBINTR_UE = 1U << 0 ;
  3401. // Boolean field: USB Error interrupt Enable
  3402. static const uint32_t USBHS_USBINTR_UEE = 1U << 1 ;
  3403. // Boolean field: Port Change detect Enable
  3404. static const uint32_t USBHS_USBINTR_PCE = 1U << 2 ;
  3405. // Boolean field: Frame list Rollover Enable
  3406. static const uint32_t USBHS_USBINTR_FRE = 1U << 3 ;
  3407. // Boolean field: System Error Enable
  3408. static const uint32_t USBHS_USBINTR_SEE = 1U << 4 ;
  3409. // Boolean field: Interrupt on Async advance Enable
  3410. static const uint32_t USBHS_USBINTR_AAE = 1U << 5 ;
  3411. // Boolean field: USB-Reset Enable
  3412. static const uint32_t USBHS_USBINTR_URE = 1U << 6 ;
  3413. // Boolean field: SOF-Received Enable
  3414. static const uint32_t USBHS_USBINTR_SRE = 1U << 7 ;
  3415. // Boolean field: Sleep (DC suspend) Enable
  3416. static const uint32_t USBHS_USBINTR_SLE = 1U << 8 ;
  3417. // Boolean field: NAK Interrupt Enable
  3418. static const uint32_t USBHS_USBINTR_NAKE = 1U << 16 ;
  3419. // Boolean field: USB host Asynchronous Interrupt Enable
  3420. static const uint32_t USBHS_USBINTR_UAIE = 1U << 18 ;
  3421. // Boolean field: USB host Periodic Interrupt Enable
  3422. static const uint32_t USBHS_USBINTR_UPIE = 1U << 19 ;
  3423. // Boolean field: General purpose Timer 0 Interrupt Enable
  3424. static const uint32_t USBHS_USBINTR_TIE0 = 1U << 24 ;
  3425. // Boolean field: General purpose Timer 1 Interrupt Enable
  3426. static const uint32_t USBHS_USBINTR_TIE1 = 1U << 25 ;
  3427. //-------------------- Frame Index Register
  3428. #define USBHS_FRINDEX (* ((volatile uint32_t *) (0x400A1000 + 0x14C)))
  3429. // Field (width: 14 bits): Frame Index
  3430. inline uint32_t USBHS_FRINDEX_FRINDEX (const uint32_t inValue) { return (inValue & 16383U) << 0 ; }
  3431. // Field (width: 18 bits): Reserved
  3432. inline uint32_t USBHS_FRINDEX_Reerved (const uint32_t inValue) { return (inValue & 262143U) << 14 ; }
  3433. //-------------------- Device Address Register
  3434. #define USBHS_DEVICEADDR (* ((volatile uint32_t *) (0x400A1000 + 0x154)))
  3435. // Boolean field: Device Address Advance
  3436. static const uint32_t USBHS_DEVICEADDR_USBADRA = 1U << 24 ;
  3437. // Field (width: 7 bits): Device Address
  3438. inline uint32_t USBHS_DEVICEADDR_USBADR (const uint32_t inValue) { return (inValue & 127U) << 25 ; }
  3439. //-------------------- Periodic Frame List Base Address Register
  3440. #define USBHS_PERIODICLISTBASE (* ((volatile uint32_t *) (0x400A1000 + 0x154)))
  3441. // Field (width: 20 bits): Base address
  3442. inline uint32_t USBHS_PERIODICLISTBASE_PERBASE (const uint32_t inValue) { return (inValue & 1048575U) << 12 ; }
  3443. //-------------------- Current Asynchronous List Address Register
  3444. #define USBHS_ASYNCLISTADDR (* ((volatile uint32_t *) (0x400A1000 + 0x158)))
  3445. // Field (width: 27 bits): Link pointer low (LPL)
  3446. inline uint32_t USBHS_ASYNCLISTADDR_ASYBASE (const uint32_t inValue) { return (inValue & 134217727U) << 5 ; }
  3447. //-------------------- Endpoint List Address Register
  3448. #define USBHS_EPLISTADDR (* ((volatile uint32_t *) (0x400A1000 + 0x158)))
  3449. // Field (width: 21 bits): Endpoint list address
  3450. inline uint32_t USBHS_EPLISTADDR_EPBASE (const uint32_t inValue) { return (inValue & 2097151U) << 11 ; }
  3451. //-------------------- Host TT Asynchronous Buffer Control
  3452. #define USBHS_TTCTRL (* ((const volatile uint32_t *) (0x400A1000 + 0x15C)))
  3453. // Field (width: 7 bits): TT Hub Address
  3454. inline uint32_t USBHS_TTCTRL_TTHA (const uint32_t inValue) { return (inValue & 127U) << 24 ; }
  3455. // Boolean field: Reserved
  3456. static const uint32_t USBHS_TTCTRL_Reerved = 1U << 31 ;
  3457. //-------------------- Master Interface Data Burst Size Register
  3458. #define USBHS_BURSTSIZE (* ((volatile uint32_t *) (0x400A1000 + 0x160)))
  3459. // Field (width: 8 bits): Programable RX Burst length
  3460. inline uint32_t USBHS_BURSTSIZE_RXPBURST (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  3461. // Field (width: 8 bits): Programable TX Burst length
  3462. inline uint32_t USBHS_BURSTSIZE_TXPBURST (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  3463. //-------------------- Transmit FIFO Tuning Control Register
  3464. #define USBHS_TXFILLTUNING (* ((volatile uint32_t *) (0x400A1000 + 0x164)))
  3465. // Field (width: 7 bits): Scheduler Overhead
  3466. inline uint32_t USBHS_TXFILLTUNING_TXSCHOH (const uint32_t inValue) { return (inValue & 127U) << 0 ; }
  3467. // Field (width: 5 bits): Scheduler Health counter
  3468. inline uint32_t USBHS_TXFILLTUNING_TXSCHHEALTH (const uint32_t inValue) { return (inValue & 31U) << 8 ; }
  3469. // Field (width: 6 bits): FIFO burst Threshold
  3470. inline uint32_t USBHS_TXFILLTUNING_TXFIFOTHRES (const uint32_t inValue) { return (inValue & 63U) << 16 ; }
  3471. //-------------------- Endpoint NAK Register
  3472. #define USBHS_ENDPTNAK (* ((volatile uint32_t *) (0x400A1000 + 0x178)))
  3473. // Field (width: 4 bits): RX Endpoint NAK
  3474. inline uint32_t USBHS_ENDPTNAK_EPRN (const uint32_t inValue) { return (inValue & 15U) << 0 ; }
  3475. // Field (width: 4 bits): TX Endpoint NAK
  3476. inline uint32_t USBHS_ENDPTNAK_EPTN (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  3477. //-------------------- Endpoint NAK Enable Register
  3478. #define USBHS_ENDPTNAKEN (* ((volatile uint32_t *) (0x400A1000 + 0x17C)))
  3479. // Field (width: 4 bits): RX Endpoint NAK
  3480. inline uint32_t USBHS_ENDPTNAKEN_EPRNE (const uint32_t inValue) { return (inValue & 15U) << 0 ; }
  3481. // Field (width: 4 bits): TX Endpoint NAK
  3482. inline uint32_t USBHS_ENDPTNAKEN_EPTNE (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  3483. //-------------------- Configure Flag Register
  3484. #define USBHS_CONFIGFLAG (* ((const volatile uint32_t *) (0x400A1000 + 0x180)))
  3485. //-------------------- Port Status and Control Registers
  3486. #define USBHS_PORTSC1 (* ((volatile uint32_t *) (0x400A1000 + 0x184)))
  3487. // Boolean field: Current Connect Status
  3488. static const uint32_t USBHS_PORTSC1_CCS = 1U << 0 ;
  3489. // Boolean field: Connect Change Status
  3490. static const uint32_t USBHS_PORTSC1_CSC = 1U << 1 ;
  3491. // Boolean field: Port Enabled/disabled
  3492. static const uint32_t USBHS_PORTSC1_PE = 1U << 2 ;
  3493. // Boolean field: Port Enable/disable Change
  3494. static const uint32_t USBHS_PORTSC1_PEC = 1U << 3 ;
  3495. // Boolean field: Over-current active
  3496. static const uint32_t USBHS_PORTSC1_OCA = 1U << 4 ;
  3497. // Boolean field: Over-Current Change
  3498. static const uint32_t USBHS_PORTSC1_OCC = 1U << 5 ;
  3499. // Boolean field: Force Port Resume
  3500. static const uint32_t USBHS_PORTSC1_FPR = 1U << 6 ;
  3501. // Boolean field: Suspend
  3502. static const uint32_t USBHS_PORTSC1_SUSP = 1U << 7 ;
  3503. // Boolean field: Port Reset
  3504. static const uint32_t USBHS_PORTSC1_PR = 1U << 8 ;
  3505. // Boolean field: High Speed Port.
  3506. static const uint32_t USBHS_PORTSC1_HSP = 1U << 9 ;
  3507. // Field (width: 2 bits): Line Status
  3508. inline uint32_t USBHS_PORTSC1_LS (const uint32_t inValue) { return (inValue & 3U) << 10 ; }
  3509. // Boolean field: Port Power
  3510. static const uint32_t USBHS_PORTSC1_PP = 1U << 12 ;
  3511. // Boolean field: Port Owner
  3512. static const uint32_t USBHS_PORTSC1_PO = 1U << 13 ;
  3513. // Field (width: 2 bits): Port Indicator Control
  3514. inline uint32_t USBHS_PORTSC1_PIC (const uint32_t inValue) { return (inValue & 3U) << 14 ; }
  3515. // Field (width: 4 bits): Port Test Control
  3516. inline uint32_t USBHS_PORTSC1_PTC (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  3517. // Boolean field: Wake on Connect enable
  3518. static const uint32_t USBHS_PORTSC1_WKCN = 1U << 20 ;
  3519. // Boolean field: Wake on Disconnect enable
  3520. static const uint32_t USBHS_PORTSC1_WKDS = 1U << 21 ;
  3521. // Boolean field: Wake on Over-Current enable
  3522. static const uint32_t USBHS_PORTSC1_WKOC = 1U << 22 ;
  3523. // Boolean field: PHY low power suspend
  3524. static const uint32_t USBHS_PORTSC1_PHCD = 1U << 23 ;
  3525. // Boolean field: Port force Full-Speed Connect
  3526. static const uint32_t USBHS_PORTSC1_PFSC = 1U << 24 ;
  3527. // Boolean field: Port Transceiver Select [2]
  3528. static const uint32_t USBHS_PORTSC1_PTS2 = 1U << 25 ;
  3529. // Field (width: 2 bits): Port Speed
  3530. inline uint32_t USBHS_PORTSC1_PSPD (const uint32_t inValue) { return (inValue & 3U) << 26 ; }
  3531. // Field (width: 2 bits): Port Transceiver Select [1:0]
  3532. inline uint32_t USBHS_PORTSC1_PTS (const uint32_t inValue) { return (inValue & 3U) << 30 ; }
  3533. //-------------------- On-the-Go Status and Control Register
  3534. #define USBHS_OTGSC (* ((volatile uint32_t *) (0x400A1000 + 0x1A4)))
  3535. // Boolean field: VBUS Discharge
  3536. static const uint32_t USBHS_OTGSC_VD = 1U << 0 ;
  3537. // Boolean field: VBUS Charge
  3538. static const uint32_t USBHS_OTGSC_VC = 1U << 1 ;
  3539. // Boolean field: Hardware Assist Auto-Reset
  3540. static const uint32_t USBHS_OTGSC_HAAR = 1U << 2 ;
  3541. // Boolean field: OTG Termination
  3542. static const uint32_t USBHS_OTGSC_OT = 1U << 3 ;
  3543. // Boolean field: Data Pulsing
  3544. static const uint32_t USBHS_OTGSC_DP = 1U << 4 ;
  3545. // Boolean field: ID Pull-Up
  3546. static const uint32_t USBHS_OTGSC_IDPU = 1U << 5 ;
  3547. // Boolean field: Hardware Assist B-Disconnect to A-connect
  3548. static const uint32_t USBHS_OTGSC_HABA = 1U << 7 ;
  3549. // Boolean field: USB ID
  3550. static const uint32_t USBHS_OTGSC_ID = 1U << 8 ;
  3551. // Boolean field: A VBus Valid
  3552. static const uint32_t USBHS_OTGSC_AVV = 1U << 9 ;
  3553. // Boolean field: A Session Valid
  3554. static const uint32_t USBHS_OTGSC_ASV = 1U << 10 ;
  3555. // Boolean field: B Session Valid
  3556. static const uint32_t USBHS_OTGSC_BSV = 1U << 11 ;
  3557. // Boolean field: B Session End
  3558. static const uint32_t USBHS_OTGSC_BSE = 1U << 12 ;
  3559. // Boolean field: 1 Milli-Second timer Toggle
  3560. static const uint32_t USBHS_OTGSC_MST = 1U << 13 ;
  3561. // Boolean field: Data bus Pulsing Status
  3562. static const uint32_t USBHS_OTGSC_DPS = 1U << 14 ;
  3563. // Boolean field: USB ID Interrupt Status
  3564. static const uint32_t USBHS_OTGSC_IDIS = 1U << 16 ;
  3565. // Boolean field: A VBUS Valid Interrupt Status
  3566. static const uint32_t USBHS_OTGSC_AVVIS = 1U << 17 ;
  3567. // Boolean field: A Session Valid Interrupt Status
  3568. static const uint32_t USBHS_OTGSC_ASVIS = 1U << 18 ;
  3569. // Boolean field: B Session Valid Interrupt Status
  3570. static const uint32_t USBHS_OTGSC_BSVIS = 1U << 19 ;
  3571. // Boolean field: B Session End Interrupt Status
  3572. static const uint32_t USBHS_OTGSC_BSEIS = 1U << 20 ;
  3573. // Boolean field: 1 Milli-Second timer interrupt Status
  3574. static const uint32_t USBHS_OTGSC_MSS = 1U << 21 ;
  3575. // Boolean field: Data Pulse interrupt Status
  3576. static const uint32_t USBHS_OTGSC_DPIS = 1U << 22 ;
  3577. // Boolean field: USB ID Interrupt Enable
  3578. static const uint32_t USBHS_OTGSC_IDIE = 1U << 24 ;
  3579. // Boolean field: A VBUS Valid Interrupt Enable
  3580. static const uint32_t USBHS_OTGSC_AVVIE = 1U << 25 ;
  3581. // Boolean field: A Session Valid Interrupt Enable
  3582. static const uint32_t USBHS_OTGSC_ASVIE = 1U << 26 ;
  3583. // Boolean field: B Session Valid Interrupt Enable
  3584. static const uint32_t USBHS_OTGSC_BSVIE = 1U << 27 ;
  3585. // Boolean field: B Session End Interrupt Enable
  3586. static const uint32_t USBHS_OTGSC_BSEIE = 1U << 28 ;
  3587. // Boolean field: 1 Milli-Second timer interrupt Enable
  3588. static const uint32_t USBHS_OTGSC_MSE = 1U << 29 ;
  3589. // Boolean field: Data Pulse Interrupt Enable
  3590. static const uint32_t USBHS_OTGSC_DPIE = 1U << 30 ;
  3591. //-------------------- USB Mode Register
  3592. #define USBHS_USBMODE (* ((volatile uint32_t *) (0x400A1000 + 0x1A8)))
  3593. // Field (width: 2 bits): Controller Mode
  3594. inline uint32_t USBHS_USBMODE_CM (const uint32_t inValue) { return (inValue & 3U) << 0 ; }
  3595. // Boolean field: Endian Select
  3596. static const uint32_t USBHS_USBMODE_ES = 1U << 2 ;
  3597. // Boolean field: Setup Lock-Out Mode
  3598. static const uint32_t USBHS_USBMODE_SLOM = 1U << 3 ;
  3599. // Boolean field: Stream DISable
  3600. static const uint32_t USBHS_USBMODE_SDIS = 1U << 4 ;
  3601. // Field (width: 3 bits): Tx to Tx HS Delay
  3602. inline uint32_t USBHS_USBMODE_TXHSD (const uint32_t inValue) { return (inValue & 7U) << 12 ; }
  3603. //-------------------- Endpoint Setup Status Register
  3604. #define USBHS_EPSETUPSR (* ((volatile uint32_t *) (0x400A1000 + 0x1AC)))
  3605. // Field (width: 4 bits): Setup Endpoint Status
  3606. inline uint32_t USBHS_EPSETUPSR_EPSETUPSTAT (const uint32_t inValue) { return (inValue & 15U) << 0 ; }
  3607. //-------------------- Endpoint Initialization Register
  3608. #define USBHS_EPPRIME (* ((volatile uint32_t *) (0x400A1000 + 0x1B0)))
  3609. // Field (width: 4 bits): Prime Endpoint Receive Buffer
  3610. inline uint32_t USBHS_EPPRIME_PERB (const uint32_t inValue) { return (inValue & 15U) << 0 ; }
  3611. // Field (width: 4 bits): Prime Endpoint tTansmit Buffer
  3612. inline uint32_t USBHS_EPPRIME_PETB (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  3613. //-------------------- Endpoint Flush Register
  3614. #define USBHS_EPFLUSH (* ((volatile uint32_t *) (0x400A1000 + 0x1B4)))
  3615. // Field (width: 4 bits): Flush Endpoint Receive Buffer
  3616. inline uint32_t USBHS_EPFLUSH_FERB (const uint32_t inValue) { return (inValue & 15U) << 0 ; }
  3617. // Field (width: 4 bits): Flush Endpoint Transmit Buffer
  3618. inline uint32_t USBHS_EPFLUSH_FETB (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  3619. //-------------------- Endpoint Status Register
  3620. #define USBHS_EPSR (* ((const volatile uint32_t *) (0x400A1000 + 0x1B8)))
  3621. // Field (width: 4 bits): Endpoint Receive Buffer Ready
  3622. inline uint32_t USBHS_EPSR_ERBR (const uint32_t inValue) { return (inValue & 15U) << 0 ; }
  3623. // Field (width: 4 bits): Endpoint Transmit Buffer Ready
  3624. inline uint32_t USBHS_EPSR_ETBR (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  3625. //-------------------- Endpoint Complete Register
  3626. #define USBHS_EPCOMPLETE (* ((volatile uint32_t *) (0x400A1000 + 0x1BC)))
  3627. // Field (width: 4 bits): Endpoint Receive Complete Event
  3628. inline uint32_t USBHS_EPCOMPLETE_ERCE (const uint32_t inValue) { return (inValue & 15U) << 0 ; }
  3629. // Field (width: 4 bits): Endpoint Transmit Complete Event
  3630. inline uint32_t USBHS_EPCOMPLETE_ETCE (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  3631. //-------------------- Endpoint Control Register 0
  3632. #define USBHS_EPCR0 (* ((volatile uint32_t *) (0x400A1000 + 0x1C0)))
  3633. // Boolean field: RX endpoint Stall
  3634. static const uint32_t USBHS_EPCR0_RXS = 1U << 0 ;
  3635. // Field (width: 2 bits): RX endpoint Type
  3636. inline uint32_t USBHS_EPCR0_RXT (const uint32_t inValue) { return (inValue & 3U) << 2 ; }
  3637. // Boolean field: RX endpoint Enable
  3638. static const uint32_t USBHS_EPCR0_RXE = 1U << 7 ;
  3639. // Boolean field: TX Endpoint Stall
  3640. static const uint32_t USBHS_EPCR0_TXS = 1U << 16 ;
  3641. // Field (width: 2 bits): TX Endpoint Type
  3642. inline uint32_t USBHS_EPCR0_TXT (const uint32_t inValue) { return (inValue & 3U) << 18 ; }
  3643. // Boolean field: TX Endpoint Enable
  3644. static const uint32_t USBHS_EPCR0_TXE = 1U << 23 ;
  3645. //-------------------- Endpoint Control Register n (idx = 0 ... 6)
  3646. #define USBHS_EPCR(idx) (* ((volatile uint32_t *) (0x400A1000 + 0x1C4 + 0x4 * (idx))))
  3647. // Boolean field: RX endpoint Stall
  3648. static const uint32_t USBHS_EPCR_RXS = 1U << 0 ;
  3649. // Boolean field: RX endpoint Data sink
  3650. static const uint32_t USBHS_EPCR_RXD = 1U << 1 ;
  3651. // Field (width: 2 bits): RX endpoint Type
  3652. inline uint32_t USBHS_EPCR_RXT (const uint32_t inValue) { return (inValue & 3U) << 2 ; }
  3653. // Boolean field: RX data toggle Inhibit
  3654. static const uint32_t USBHS_EPCR_RXI = 1U << 5 ;
  3655. // Boolean field: RX data toggle Reset
  3656. static const uint32_t USBHS_EPCR_RXR = 1U << 6 ;
  3657. // Boolean field: RX endpoint Enable
  3658. static const uint32_t USBHS_EPCR_RXE = 1U << 7 ;
  3659. // Boolean field: TX endpoint Stall
  3660. static const uint32_t USBHS_EPCR_TXS = 1U << 16 ;
  3661. // Boolean field: TX endpoint Data source
  3662. static const uint32_t USBHS_EPCR_TXD = 1U << 17 ;
  3663. // Field (width: 2 bits): TX endpoint Type
  3664. inline uint32_t USBHS_EPCR_TXT (const uint32_t inValue) { return (inValue & 3U) << 18 ; }
  3665. // Boolean field: TX data toggle Inhibit
  3666. static const uint32_t USBHS_EPCR_TXI = 1U << 21 ;
  3667. // Boolean field: TX data toggle Reset
  3668. static const uint32_t USBHS_EPCR_TXR = 1U << 22 ;
  3669. // Boolean field: TX endpoint Enable
  3670. static const uint32_t USBHS_EPCR_TXE = 1U << 23 ;
  3671. //-------------------- USB General Control Register
  3672. #define USBHS_USBGENCTRL (* ((volatile uint32_t *) (0x400A1000 + 0x200)))
  3673. // Boolean field: Wakeup Interrupt Enable
  3674. static const uint32_t USBHS_USBGENCTRL_WU_IE = 1U << 0 ;
  3675. // Boolean field: Wakeup Interrupt Clear
  3676. static const uint32_t USBHS_USBGENCTRL_WU_INT_CLR = 1U << 5 ;
  3677. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  3678. // Peripheral USBPHY
  3679. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  3680. //-------------------- USB PHY Power-Down Register
  3681. #define USBPHY_PWD (* ((volatile uint32_t *) (0x400A2000 + 0)))
  3682. // Boolean field: Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of USBPHY_CTRL is enabled
  3683. static const uint32_t USBPHY_PWD_TXPWDFS = 1U << 10 ;
  3684. // Boolean field: Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of USBPHY_CTRL is enabled
  3685. static const uint32_t USBPHY_PWD_TXPWDIBIAS = 1U << 11 ;
  3686. // Boolean field: Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of USBPHY_CTRL is enabled
  3687. static const uint32_t USBPHY_PWD_TXPWDV2I = 1U << 12 ;
  3688. // Boolean field: Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of USBPHY_CTRL is enabled
  3689. static const uint32_t USBPHY_PWD_RXPWDENV = 1U << 17 ;
  3690. // Boolean field: Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of USBPHY_CTRL is enabled
  3691. static const uint32_t USBPHY_PWD_RXPWD1PT1 = 1U << 18 ;
  3692. // Boolean field: Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of USBPHY_CTRL is enabled
  3693. static const uint32_t USBPHY_PWD_RXPWDDIFF = 1U << 19 ;
  3694. // Boolean field: This bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of USBPHY_CTRL is enabled
  3695. static const uint32_t USBPHY_PWD_RXPWDRX = 1U << 20 ;
  3696. //-------------------- USB PHY Power-Down Register
  3697. #define USBPHY_PWD_SET (* ((volatile uint32_t *) (0x400A2000 + 0x4)))
  3698. // Boolean field: Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of USBPHY_CTRL is enabled
  3699. static const uint32_t USBPHY_PWD_SET_TXPWDFS = 1U << 10 ;
  3700. // Boolean field: Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of USBPHY_CTRL is enabled
  3701. static const uint32_t USBPHY_PWD_SET_TXPWDIBIAS = 1U << 11 ;
  3702. // Boolean field: Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of USBPHY_CTRL is enabled
  3703. static const uint32_t USBPHY_PWD_SET_TXPWDV2I = 1U << 12 ;
  3704. // Boolean field: Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of USBPHY_CTRL is enabled
  3705. static const uint32_t USBPHY_PWD_SET_RXPWDENV = 1U << 17 ;
  3706. // Boolean field: Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of USBPHY_CTRL is enabled
  3707. static const uint32_t USBPHY_PWD_SET_RXPWD1PT1 = 1U << 18 ;
  3708. // Boolean field: Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of USBPHY_CTRL is enabled
  3709. static const uint32_t USBPHY_PWD_SET_RXPWDDIFF = 1U << 19 ;
  3710. // Boolean field: This bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of USBPHY_CTRL is enabled
  3711. static const uint32_t USBPHY_PWD_SET_RXPWDRX = 1U << 20 ;
  3712. //-------------------- USB PHY Power-Down Register
  3713. #define USBPHY_PWD_CLR (* ((volatile uint32_t *) (0x400A2000 + 0x8)))
  3714. // Boolean field: Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of USBPHY_CTRL is enabled
  3715. static const uint32_t USBPHY_PWD_CLR_TXPWDFS = 1U << 10 ;
  3716. // Boolean field: Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of USBPHY_CTRL is enabled
  3717. static const uint32_t USBPHY_PWD_CLR_TXPWDIBIAS = 1U << 11 ;
  3718. // Boolean field: Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of USBPHY_CTRL is enabled
  3719. static const uint32_t USBPHY_PWD_CLR_TXPWDV2I = 1U << 12 ;
  3720. // Boolean field: Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of USBPHY_CTRL is enabled
  3721. static const uint32_t USBPHY_PWD_CLR_RXPWDENV = 1U << 17 ;
  3722. // Boolean field: Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of USBPHY_CTRL is enabled
  3723. static const uint32_t USBPHY_PWD_CLR_RXPWD1PT1 = 1U << 18 ;
  3724. // Boolean field: Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of USBPHY_CTRL is enabled
  3725. static const uint32_t USBPHY_PWD_CLR_RXPWDDIFF = 1U << 19 ;
  3726. // Boolean field: This bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of USBPHY_CTRL is enabled
  3727. static const uint32_t USBPHY_PWD_CLR_RXPWDRX = 1U << 20 ;
  3728. //-------------------- USB PHY Power-Down Register
  3729. #define USBPHY_PWD_TOG (* ((volatile uint32_t *) (0x400A2000 + 0xC)))
  3730. // Boolean field: Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of USBPHY_CTRL is enabled
  3731. static const uint32_t USBPHY_PWD_TOG_TXPWDFS = 1U << 10 ;
  3732. // Boolean field: Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of USBPHY_CTRL is enabled
  3733. static const uint32_t USBPHY_PWD_TOG_TXPWDIBIAS = 1U << 11 ;
  3734. // Boolean field: Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of USBPHY_CTRL is enabled
  3735. static const uint32_t USBPHY_PWD_TOG_TXPWDV2I = 1U << 12 ;
  3736. // Boolean field: Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of USBPHY_CTRL is enabled
  3737. static const uint32_t USBPHY_PWD_TOG_RXPWDENV = 1U << 17 ;
  3738. // Boolean field: Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of USBPHY_CTRL is enabled
  3739. static const uint32_t USBPHY_PWD_TOG_RXPWD1PT1 = 1U << 18 ;
  3740. // Boolean field: Note that this bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of USBPHY_CTRL is enabled
  3741. static const uint32_t USBPHY_PWD_TOG_RXPWDDIFF = 1U << 19 ;
  3742. // Boolean field: This bit will be auto cleared if there is USB wakeup event while ENAUTOCLR_PHY_PWD bit of USBPHY_CTRL is enabled
  3743. static const uint32_t USBPHY_PWD_TOG_RXPWDRX = 1U << 20 ;
  3744. //-------------------- USB PHY Transmitter Control Register
  3745. #define USBPHY_TX (* ((volatile uint32_t *) (0x400A2000 + 0x10)))
  3746. // Field (width: 4 bits): Decode to trim the nominal 17
  3747. inline uint32_t USBPHY_TX_D_CAL (const uint32_t inValue) { return (inValue & 15U) << 0 ; }
  3748. // Field (width: 4 bits): Decode to trim the nominal 45ohm series termination resistance to the USB_DM output pin
  3749. inline uint32_t USBPHY_TX_TXCAL45DM (const uint32_t inValue) { return (inValue & 15U) << 8 ; }
  3750. // Field (width: 4 bits): Decode to trim the nominal 45ohm series termination resistance to the USB_DP output pin
  3751. inline uint32_t USBPHY_TX_TXCAL45DP (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  3752. // Field (width: 3 bits): Controls the edge-rate of the current sensing transistors used in HS transmit
  3753. inline uint32_t USBPHY_TX_USBPHY_TX_EDGECTRL (const uint32_t inValue) { return (inValue & 7U) << 26 ; }
  3754. //-------------------- USB PHY Transmitter Control Register
  3755. #define USBPHY_TX_SET (* ((volatile uint32_t *) (0x400A2000 + 0x14)))
  3756. // Field (width: 4 bits): Decode to trim the nominal 17
  3757. inline uint32_t USBPHY_TX_SET_D_CAL (const uint32_t inValue) { return (inValue & 15U) << 0 ; }
  3758. // Field (width: 4 bits): Decode to trim the nominal 45ohm series termination resistance to the USB_DM output pin
  3759. inline uint32_t USBPHY_TX_SET_TXCAL45DM (const uint32_t inValue) { return (inValue & 15U) << 8 ; }
  3760. // Field (width: 4 bits): Decode to trim the nominal 45ohm series termination resistance to the USB_DP output pin
  3761. inline uint32_t USBPHY_TX_SET_TXCAL45DP (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  3762. // Field (width: 3 bits): Controls the edge-rate of the current sensing transistors used in HS transmit
  3763. inline uint32_t USBPHY_TX_SET_USBPHY_TX_EDGECTRL (const uint32_t inValue) { return (inValue & 7U) << 26 ; }
  3764. //-------------------- USB PHY Transmitter Control Register
  3765. #define USBPHY_TX_CLR (* ((volatile uint32_t *) (0x400A2000 + 0x18)))
  3766. // Field (width: 4 bits): Decode to trim the nominal 17
  3767. inline uint32_t USBPHY_TX_CLR_D_CAL (const uint32_t inValue) { return (inValue & 15U) << 0 ; }
  3768. // Field (width: 4 bits): Decode to trim the nominal 45ohm series termination resistance to the USB_DM output pin
  3769. inline uint32_t USBPHY_TX_CLR_TXCAL45DM (const uint32_t inValue) { return (inValue & 15U) << 8 ; }
  3770. // Field (width: 4 bits): Decode to trim the nominal 45ohm series termination resistance to the USB_DP output pin
  3771. inline uint32_t USBPHY_TX_CLR_TXCAL45DP (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  3772. // Field (width: 3 bits): Controls the edge-rate of the current sensing transistors used in HS transmit
  3773. inline uint32_t USBPHY_TX_CLR_USBPHY_TX_EDGECTRL (const uint32_t inValue) { return (inValue & 7U) << 26 ; }
  3774. //-------------------- USB PHY Transmitter Control Register
  3775. #define USBPHY_TX_TOG (* ((volatile uint32_t *) (0x400A2000 + 0x1C)))
  3776. // Field (width: 4 bits): Decode to trim the nominal 17
  3777. inline uint32_t USBPHY_TX_TOG_D_CAL (const uint32_t inValue) { return (inValue & 15U) << 0 ; }
  3778. // Field (width: 4 bits): Decode to trim the nominal 45ohm series termination resistance to the USB_DM output pin
  3779. inline uint32_t USBPHY_TX_TOG_TXCAL45DM (const uint32_t inValue) { return (inValue & 15U) << 8 ; }
  3780. // Field (width: 4 bits): Decode to trim the nominal 45ohm series termination resistance to the USB_DP output pin
  3781. inline uint32_t USBPHY_TX_TOG_TXCAL45DP (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  3782. // Field (width: 3 bits): Controls the edge-rate of the current sensing transistors used in HS transmit
  3783. inline uint32_t USBPHY_TX_TOG_USBPHY_TX_EDGECTRL (const uint32_t inValue) { return (inValue & 7U) << 26 ; }
  3784. //-------------------- USB PHY Receiver Control Register
  3785. #define USBPHY_RX (* ((volatile uint32_t *) (0x400A2000 + 0x20)))
  3786. // Field (width: 3 bits): The ENVADJ field adjusts the trip point for the envelope detector
  3787. inline uint32_t USBPHY_RX_ENVADJ (const uint32_t inValue) { return (inValue & 7U) << 0 ; }
  3788. // Field (width: 3 bits): The DISCONADJ field adjusts the trip point for the disconnect detector.
  3789. inline uint32_t USBPHY_RX_DISCONADJ (const uint32_t inValue) { return (inValue & 7U) << 4 ; }
  3790. // Boolean field: This test mode is intended for lab use only, replace FS differential receiver with DP single ended receiver
  3791. static const uint32_t USBPHY_RX_RXDBYPASS = 1U << 22 ;
  3792. //-------------------- USB PHY Receiver Control Register
  3793. #define USBPHY_RX_SET (* ((volatile uint32_t *) (0x400A2000 + 0x24)))
  3794. // Field (width: 3 bits): The ENVADJ field adjusts the trip point for the envelope detector
  3795. inline uint32_t USBPHY_RX_SET_ENVADJ (const uint32_t inValue) { return (inValue & 7U) << 0 ; }
  3796. // Field (width: 3 bits): The DISCONADJ field adjusts the trip point for the disconnect detector.
  3797. inline uint32_t USBPHY_RX_SET_DISCONADJ (const uint32_t inValue) { return (inValue & 7U) << 4 ; }
  3798. // Boolean field: This test mode is intended for lab use only, replace FS differential receiver with DP single ended receiver
  3799. static const uint32_t USBPHY_RX_SET_RXDBYPASS = 1U << 22 ;
  3800. //-------------------- USB PHY Receiver Control Register
  3801. #define USBPHY_RX_CLR (* ((volatile uint32_t *) (0x400A2000 + 0x28)))
  3802. // Field (width: 3 bits): The ENVADJ field adjusts the trip point for the envelope detector
  3803. inline uint32_t USBPHY_RX_CLR_ENVADJ (const uint32_t inValue) { return (inValue & 7U) << 0 ; }
  3804. // Field (width: 3 bits): The DISCONADJ field adjusts the trip point for the disconnect detector.
  3805. inline uint32_t USBPHY_RX_CLR_DISCONADJ (const uint32_t inValue) { return (inValue & 7U) << 4 ; }
  3806. // Boolean field: This test mode is intended for lab use only, replace FS differential receiver with DP single ended receiver
  3807. static const uint32_t USBPHY_RX_CLR_RXDBYPASS = 1U << 22 ;
  3808. //-------------------- USB PHY Receiver Control Register
  3809. #define USBPHY_RX_TOG (* ((volatile uint32_t *) (0x400A2000 + 0x2C)))
  3810. // Field (width: 3 bits): The ENVADJ field adjusts the trip point for the envelope detector
  3811. inline uint32_t USBPHY_RX_TOG_ENVADJ (const uint32_t inValue) { return (inValue & 7U) << 0 ; }
  3812. // Field (width: 3 bits): The DISCONADJ field adjusts the trip point for the disconnect detector.
  3813. inline uint32_t USBPHY_RX_TOG_DISCONADJ (const uint32_t inValue) { return (inValue & 7U) << 4 ; }
  3814. // Boolean field: This test mode is intended for lab use only, replace FS differential receiver with DP single ended receiver
  3815. static const uint32_t USBPHY_RX_TOG_RXDBYPASS = 1U << 22 ;
  3816. //-------------------- USB PHY General Control Register
  3817. #define USBPHY_CTRL (* ((volatile uint32_t *) (0x400A2000 + 0x30)))
  3818. // Boolean field: For host mode, enables high-speed disconnect detector
  3819. static const uint32_t USBPHY_CTRL_ENHOSTDISCONDETECT = 1U << 1 ;
  3820. // Boolean field: Indicates that the device has disconnected in High-Speed mode
  3821. static const uint32_t USBPHY_CTRL_HOSTDISCONDETECT_IRQ = 1U << 3 ;
  3822. // Boolean field: Enables non-standard resistive plugged-in detection
  3823. static const uint32_t USBPHY_CTRL_ENDEVPLUGINDET = 1U << 4 ;
  3824. // Boolean field: Indicates that the device is connected
  3825. static const uint32_t USBPHY_CTRL_DEVPLUGIN_IRQ = 1U << 12 ;
  3826. // Boolean field: Enables UTMI+ Level 2 operation for the USB HS PHY
  3827. static const uint32_t USBPHY_CTRL_ENUTMILEVEL2 = 1U << 14 ;
  3828. // Boolean field: Enables UTMI+ Level 3 operation for the USB HS PHY
  3829. static const uint32_t USBPHY_CTRL_ENUTMILEVEL3 = 1U << 15 ;
  3830. // Boolean field: Enable the auto resume feature, when set, HW will use 32KHz clock to send Resume to respond to the device remote wakeup(for host mode only)
  3831. static const uint32_t USBPHY_CTRL_AUTORESUME_EN = 1U << 18 ;
  3832. // Boolean field: Enables the feature to auto-clear the CLKGATE bit if there is wakeup event while USB is suspended
  3833. static const uint32_t USBPHY_CTRL_ENAUTOCLR_CLKGATE = 1U << 19 ;
  3834. // Boolean field: Enables the feature to auto-clear the PWD register bits in USBPHY_PWD if there is wakeup event while USB is suspended
  3835. static const uint32_t USBPHY_CTRL_ENAUTOCLR_PHY_PWD = 1U << 20 ;
  3836. // Boolean field: Enables the feature to reset the FSDLL lock detection logic at the end of each TX packet.
  3837. static const uint32_t USBPHY_CTRL_FSDLL_RST_EN = 1U << 24 ;
  3838. // Boolean field: Indicates the results of USB_ID pin while monitoring the cable plugged into the Micro- or Mini-AB receptacle
  3839. static const uint32_t USBPHY_CTRL_OTG_ID_VALUE = 1U << 27 ;
  3840. // Boolean field: Forces the next FS packet that is transmitted to have a EOP with low-speed timing
  3841. static const uint32_t USBPHY_CTRL_HOST_FORCE_LS_SE0 = 1U << 28 ;
  3842. // Boolean field: Used by the PHY to indicate a powered-down state
  3843. static const uint32_t USBPHY_CTRL_UTMI_SUSPENDM = 1U << 29 ;
  3844. // Boolean field: Gate UTMI Clocks
  3845. static const uint32_t USBPHY_CTRL_CLKGATE = 1U << 30 ;
  3846. // Boolean field: Writing a 1 to this bit will soft-reset the USBPHY_PWD, USBPHY_TX, USBPHY_RX, and USBPHY_CTRL registers
  3847. static const uint32_t USBPHY_CTRL_SFTRST = 1U << 31 ;
  3848. //-------------------- USB PHY General Control Register
  3849. #define USBPHY_CTRL_SET (* ((volatile uint32_t *) (0x400A2000 + 0x34)))
  3850. // Boolean field: For host mode, enables high-speed disconnect detector
  3851. static const uint32_t USBPHY_CTRL_SET_ENHOSTDISCONDETECT = 1U << 1 ;
  3852. // Boolean field: Indicates that the device has disconnected in High-Speed mode
  3853. static const uint32_t USBPHY_CTRL_SET_HOSTDISCONDETECT_IRQ = 1U << 3 ;
  3854. // Boolean field: Enables non-standard resistive plugged-in detection
  3855. static const uint32_t USBPHY_CTRL_SET_ENDEVPLUGINDET = 1U << 4 ;
  3856. // Boolean field: Indicates that the device is connected
  3857. static const uint32_t USBPHY_CTRL_SET_DEVPLUGIN_IRQ = 1U << 12 ;
  3858. // Boolean field: Enables UTMI+ Level 2 operation for the USB HS PHY
  3859. static const uint32_t USBPHY_CTRL_SET_ENUTMILEVEL2 = 1U << 14 ;
  3860. // Boolean field: Enables UTMI+ Level 3 operation for the USB HS PHY
  3861. static const uint32_t USBPHY_CTRL_SET_ENUTMILEVEL3 = 1U << 15 ;
  3862. // Boolean field: Enable the auto resume feature, when set, HW will use 32KHz clock to send Resume to respond to the device remote wakeup(for host mode only)
  3863. static const uint32_t USBPHY_CTRL_SET_AUTORESUME_EN = 1U << 18 ;
  3864. // Boolean field: Enables the feature to auto-clear the CLKGATE bit if there is wakeup event while USB is suspended
  3865. static const uint32_t USBPHY_CTRL_SET_ENAUTOCLR_CLKGATE = 1U << 19 ;
  3866. // Boolean field: Enables the feature to auto-clear the PWD register bits in USBPHY_PWD if there is wakeup event while USB is suspended
  3867. static const uint32_t USBPHY_CTRL_SET_ENAUTOCLR_PHY_PWD = 1U << 20 ;
  3868. // Boolean field: Enables the feature to reset the FSDLL lock detection logic at the end of each TX packet.
  3869. static const uint32_t USBPHY_CTRL_SET_FSDLL_RST_EN = 1U << 24 ;
  3870. // Boolean field: Indicates the results of USB_ID pin while monitoring the cable plugged into the Micro- or Mini-AB receptacle
  3871. static const uint32_t USBPHY_CTRL_SET_OTG_ID_VALUE = 1U << 27 ;
  3872. // Boolean field: Forces the next FS packet that is transmitted to have a EOP with low-speed timing
  3873. static const uint32_t USBPHY_CTRL_SET_HOST_FORCE_LS_SE0 = 1U << 28 ;
  3874. // Boolean field: Used by the PHY to indicate a powered-down state
  3875. static const uint32_t USBPHY_CTRL_SET_UTMI_SUSPENDM = 1U << 29 ;
  3876. // Boolean field: Gate UTMI Clocks
  3877. static const uint32_t USBPHY_CTRL_SET_CLKGATE = 1U << 30 ;
  3878. // Boolean field: Writing a 1 to this bit will soft-reset the USBPHY_PWD, USBPHY_TX, USBPHY_RX, and USBPHY_CTRL registers
  3879. static const uint32_t USBPHY_CTRL_SET_SFTRST = 1U << 31 ;
  3880. //-------------------- USB PHY General Control Register
  3881. #define USBPHY_CTRL_CLR (* ((volatile uint32_t *) (0x400A2000 + 0x38)))
  3882. // Boolean field: For host mode, enables high-speed disconnect detector
  3883. static const uint32_t USBPHY_CTRL_CLR_ENHOSTDISCONDETECT = 1U << 1 ;
  3884. // Boolean field: Indicates that the device has disconnected in High-Speed mode
  3885. static const uint32_t USBPHY_CTRL_CLR_HOSTDISCONDETECT_IRQ = 1U << 3 ;
  3886. // Boolean field: Enables non-standard resistive plugged-in detection
  3887. static const uint32_t USBPHY_CTRL_CLR_ENDEVPLUGINDET = 1U << 4 ;
  3888. // Boolean field: Indicates that the device is connected
  3889. static const uint32_t USBPHY_CTRL_CLR_DEVPLUGIN_IRQ = 1U << 12 ;
  3890. // Boolean field: Enables UTMI+ Level 2 operation for the USB HS PHY
  3891. static const uint32_t USBPHY_CTRL_CLR_ENUTMILEVEL2 = 1U << 14 ;
  3892. // Boolean field: Enables UTMI+ Level 3 operation for the USB HS PHY
  3893. static const uint32_t USBPHY_CTRL_CLR_ENUTMILEVEL3 = 1U << 15 ;
  3894. // Boolean field: Enable the auto resume feature, when set, HW will use 32KHz clock to send Resume to respond to the device remote wakeup(for host mode only)
  3895. static const uint32_t USBPHY_CTRL_CLR_AUTORESUME_EN = 1U << 18 ;
  3896. // Boolean field: Enables the feature to auto-clear the CLKGATE bit if there is wakeup event while USB is suspended
  3897. static const uint32_t USBPHY_CTRL_CLR_ENAUTOCLR_CLKGATE = 1U << 19 ;
  3898. // Boolean field: Enables the feature to auto-clear the PWD register bits in USBPHY_PWD if there is wakeup event while USB is suspended
  3899. static const uint32_t USBPHY_CTRL_CLR_ENAUTOCLR_PHY_PWD = 1U << 20 ;
  3900. // Boolean field: Enables the feature to reset the FSDLL lock detection logic at the end of each TX packet.
  3901. static const uint32_t USBPHY_CTRL_CLR_FSDLL_RST_EN = 1U << 24 ;
  3902. // Boolean field: Indicates the results of USB_ID pin while monitoring the cable plugged into the Micro- or Mini-AB receptacle
  3903. static const uint32_t USBPHY_CTRL_CLR_OTG_ID_VALUE = 1U << 27 ;
  3904. // Boolean field: Forces the next FS packet that is transmitted to have a EOP with low-speed timing
  3905. static const uint32_t USBPHY_CTRL_CLR_HOST_FORCE_LS_SE0 = 1U << 28 ;
  3906. // Boolean field: Used by the PHY to indicate a powered-down state
  3907. static const uint32_t USBPHY_CTRL_CLR_UTMI_SUSPENDM = 1U << 29 ;
  3908. // Boolean field: Gate UTMI Clocks
  3909. static const uint32_t USBPHY_CTRL_CLR_CLKGATE = 1U << 30 ;
  3910. // Boolean field: Writing a 1 to this bit will soft-reset the USBPHY_PWD, USBPHY_TX, USBPHY_RX, and USBPHY_CTRL registers
  3911. static const uint32_t USBPHY_CTRL_CLR_SFTRST = 1U << 31 ;
  3912. //-------------------- USB PHY General Control Register
  3913. #define USBPHY_CTRL_TOG (* ((volatile uint32_t *) (0x400A2000 + 0x3C)))
  3914. // Boolean field: For host mode, enables high-speed disconnect detector
  3915. static const uint32_t USBPHY_CTRL_TOG_ENHOSTDISCONDETECT = 1U << 1 ;
  3916. // Boolean field: Indicates that the device has disconnected in High-Speed mode
  3917. static const uint32_t USBPHY_CTRL_TOG_HOSTDISCONDETECT_IRQ = 1U << 3 ;
  3918. // Boolean field: Enables non-standard resistive plugged-in detection
  3919. static const uint32_t USBPHY_CTRL_TOG_ENDEVPLUGINDET = 1U << 4 ;
  3920. // Boolean field: Indicates that the device is connected
  3921. static const uint32_t USBPHY_CTRL_TOG_DEVPLUGIN_IRQ = 1U << 12 ;
  3922. // Boolean field: Enables UTMI+ Level 2 operation for the USB HS PHY
  3923. static const uint32_t USBPHY_CTRL_TOG_ENUTMILEVEL2 = 1U << 14 ;
  3924. // Boolean field: Enables UTMI+ Level 3 operation for the USB HS PHY
  3925. static const uint32_t USBPHY_CTRL_TOG_ENUTMILEVEL3 = 1U << 15 ;
  3926. // Boolean field: Enable the auto resume feature, when set, HW will use 32KHz clock to send Resume to respond to the device remote wakeup(for host mode only)
  3927. static const uint32_t USBPHY_CTRL_TOG_AUTORESUME_EN = 1U << 18 ;
  3928. // Boolean field: Enables the feature to auto-clear the CLKGATE bit if there is wakeup event while USB is suspended
  3929. static const uint32_t USBPHY_CTRL_TOG_ENAUTOCLR_CLKGATE = 1U << 19 ;
  3930. // Boolean field: Enables the feature to auto-clear the PWD register bits in USBPHY_PWD if there is wakeup event while USB is suspended
  3931. static const uint32_t USBPHY_CTRL_TOG_ENAUTOCLR_PHY_PWD = 1U << 20 ;
  3932. // Boolean field: Enables the feature to reset the FSDLL lock detection logic at the end of each TX packet.
  3933. static const uint32_t USBPHY_CTRL_TOG_FSDLL_RST_EN = 1U << 24 ;
  3934. // Boolean field: Indicates the results of USB_ID pin while monitoring the cable plugged into the Micro- or Mini-AB receptacle
  3935. static const uint32_t USBPHY_CTRL_TOG_OTG_ID_VALUE = 1U << 27 ;
  3936. // Boolean field: Forces the next FS packet that is transmitted to have a EOP with low-speed timing
  3937. static const uint32_t USBPHY_CTRL_TOG_HOST_FORCE_LS_SE0 = 1U << 28 ;
  3938. // Boolean field: Used by the PHY to indicate a powered-down state
  3939. static const uint32_t USBPHY_CTRL_TOG_UTMI_SUSPENDM = 1U << 29 ;
  3940. // Boolean field: Gate UTMI Clocks
  3941. static const uint32_t USBPHY_CTRL_TOG_CLKGATE = 1U << 30 ;
  3942. // Boolean field: Writing a 1 to this bit will soft-reset the USBPHY_PWD, USBPHY_TX, USBPHY_RX, and USBPHY_CTRL registers
  3943. static const uint32_t USBPHY_CTRL_TOG_SFTRST = 1U << 31 ;
  3944. //-------------------- USB PHY Status Register
  3945. #define USBPHY_STATUS (* ((volatile uint32_t *) (0x400A2000 + 0x40)))
  3946. // Boolean field: Indicates at the local host (downstream) port that the remote device has disconnected while in High-Speed mode
  3947. static const uint32_t USBPHY_STATUS_HOSTDISCONDETECT_STATUS = 1U << 3 ;
  3948. // Boolean field: Status indicator for non-standard resistive plugged-in detection
  3949. static const uint32_t USBPHY_STATUS_DEVPLUGIN_STATUS = 1U << 6 ;
  3950. // Boolean field: Indicates the results of USB_ID pin on the USB cable plugged into the local Micro- or Mini-AB receptacle
  3951. static const uint32_t USBPHY_STATUS_OTGID_STATUS = 1U << 8 ;
  3952. // Boolean field: Indicates that the host is sending a wake-up after Suspend and has triggered an interrupt.
  3953. static const uint32_t USBPHY_STATUS_RESUME_STATUS = 1U << 10 ;
  3954. //-------------------- USB PHY Debug Register
  3955. #define USBPHY_DEBUG (* ((volatile uint32_t *) (0x400A2000 + 0x50)))
  3956. // Boolean field: Once OTG ID from USBPHY_STATUS_OTGID_STATUS is sampled, use this to hold the value
  3957. static const uint32_t USBPHY_DEBUG_OTGIDPIOLOCK = 1U << 0 ;
  3958. // Boolean field: Use holding registers to assist in timing for external UTMI interface.
  3959. static const uint32_t USBPHY_DEBUG_DEBUG_INTERFACE_HOLD = 1U << 1 ;
  3960. // Field (width: 2 bits): This bit field selects whether to connect pulldown resistors on the USB_DP/USB_DM pins if the corresponding pulldown overdrive mode is enabled through USBPHY_DEBUG[5:4} Set bit 3 to value 1'b1 to connect the 15ohm pulldown on USB_DP line
  3961. inline uint32_t USBPHY_DEBUG_HSTPULLDOWN (const uint32_t inValue) { return (inValue & 3U) << 2 ; }
  3962. // Field (width: 2 bits): This bit field selects host pulldown overdrive mode
  3963. inline uint32_t USBPHY_DEBUG_ENHSTPULLDOWN (const uint32_t inValue) { return (inValue & 3U) << 4 ; }
  3964. // Field (width: 4 bits): Delay in between the end of transmit to the beginning of receive
  3965. inline uint32_t USBPHY_DEBUG_TX2RXCOUNT (const uint32_t inValue) { return (inValue & 15U) << 8 ; }
  3966. // Boolean field: Set this bit to allow a countdown to transition in between TX and RX.
  3967. static const uint32_t USBPHY_DEBUG_ENTX2RXCOUNT = 1U << 12 ;
  3968. // Field (width: 5 bits): Delay in between the detection of squelch to the reset of high-speed RX.
  3969. inline uint32_t USBPHY_DEBUG_SQUELCHRESETCOUNT (const uint32_t inValue) { return (inValue & 31U) << 16 ; }
  3970. // Boolean field: Set bit to allow squelch to reset high-speed receive.
  3971. static const uint32_t USBPHY_DEBUG_ENSQUELCHRESET = 1U << 24 ;
  3972. // Field (width: 4 bits): Duration of RESET in terms of the number of 480-MHz cycles.
  3973. inline uint32_t USBPHY_DEBUG_SQUELCHRESETLENGTH (const uint32_t inValue) { return (inValue & 15U) << 25 ; }
  3974. // Boolean field: Choose to trigger the host resume SE0 with HOST_FORCE_LS_SE0 = 0 or UTMI_SUSPEND = 1.
  3975. static const uint32_t USBPHY_DEBUG_HOST_RESUME_DEBUG = 1U << 29 ;
  3976. // Boolean field: Gate Test Clocks
  3977. static const uint32_t USBPHY_DEBUG_CLKGATE = 1U << 30 ;
  3978. //-------------------- USB PHY Debug Register
  3979. #define USBPHY_DEBUG_SET (* ((volatile uint32_t *) (0x400A2000 + 0x54)))
  3980. // Boolean field: Once OTG ID from USBPHY_STATUS_OTGID_STATUS is sampled, use this to hold the value
  3981. static const uint32_t USBPHY_DEBUG_SET_OTGIDPIOLOCK = 1U << 0 ;
  3982. // Boolean field: Use holding registers to assist in timing for external UTMI interface.
  3983. static const uint32_t USBPHY_DEBUG_SET_DEBUG_INTERFACE_HOLD = 1U << 1 ;
  3984. // Field (width: 2 bits): This bit field selects whether to connect pulldown resistors on the USB_DP/USB_DM pins if the corresponding pulldown overdrive mode is enabled through USBPHY_DEBUG[5:4} Set bit 3 to value 1'b1 to connect the 15ohm pulldown on USB_DP line
  3985. inline uint32_t USBPHY_DEBUG_SET_HSTPULLDOWN (const uint32_t inValue) { return (inValue & 3U) << 2 ; }
  3986. // Field (width: 2 bits): This bit field selects host pulldown overdrive mode
  3987. inline uint32_t USBPHY_DEBUG_SET_ENHSTPULLDOWN (const uint32_t inValue) { return (inValue & 3U) << 4 ; }
  3988. // Field (width: 4 bits): Delay in between the end of transmit to the beginning of receive
  3989. inline uint32_t USBPHY_DEBUG_SET_TX2RXCOUNT (const uint32_t inValue) { return (inValue & 15U) << 8 ; }
  3990. // Boolean field: Set this bit to allow a countdown to transition in between TX and RX.
  3991. static const uint32_t USBPHY_DEBUG_SET_ENTX2RXCOUNT = 1U << 12 ;
  3992. // Field (width: 5 bits): Delay in between the detection of squelch to the reset of high-speed RX.
  3993. inline uint32_t USBPHY_DEBUG_SET_SQUELCHRESETCOUNT (const uint32_t inValue) { return (inValue & 31U) << 16 ; }
  3994. // Boolean field: Set bit to allow squelch to reset high-speed receive.
  3995. static const uint32_t USBPHY_DEBUG_SET_ENSQUELCHRESET = 1U << 24 ;
  3996. // Field (width: 4 bits): Duration of RESET in terms of the number of 480-MHz cycles.
  3997. inline uint32_t USBPHY_DEBUG_SET_SQUELCHRESETLENGTH (const uint32_t inValue) { return (inValue & 15U) << 25 ; }
  3998. // Boolean field: Choose to trigger the host resume SE0 with HOST_FORCE_LS_SE0 = 0 or UTMI_SUSPEND = 1.
  3999. static const uint32_t USBPHY_DEBUG_SET_HOST_RESUME_DEBUG = 1U << 29 ;
  4000. // Boolean field: Gate Test Clocks
  4001. static const uint32_t USBPHY_DEBUG_SET_CLKGATE = 1U << 30 ;
  4002. //-------------------- USB PHY Debug Register
  4003. #define USBPHY_DEBUG_CLR (* ((volatile uint32_t *) (0x400A2000 + 0x58)))
  4004. // Boolean field: Once OTG ID from USBPHY_STATUS_OTGID_STATUS is sampled, use this to hold the value
  4005. static const uint32_t USBPHY_DEBUG_CLR_OTGIDPIOLOCK = 1U << 0 ;
  4006. // Boolean field: Use holding registers to assist in timing for external UTMI interface.
  4007. static const uint32_t USBPHY_DEBUG_CLR_DEBUG_INTERFACE_HOLD = 1U << 1 ;
  4008. // Field (width: 2 bits): This bit field selects whether to connect pulldown resistors on the USB_DP/USB_DM pins if the corresponding pulldown overdrive mode is enabled through USBPHY_DEBUG[5:4} Set bit 3 to value 1'b1 to connect the 15ohm pulldown on USB_DP line
  4009. inline uint32_t USBPHY_DEBUG_CLR_HSTPULLDOWN (const uint32_t inValue) { return (inValue & 3U) << 2 ; }
  4010. // Field (width: 2 bits): This bit field selects host pulldown overdrive mode
  4011. inline uint32_t USBPHY_DEBUG_CLR_ENHSTPULLDOWN (const uint32_t inValue) { return (inValue & 3U) << 4 ; }
  4012. // Field (width: 4 bits): Delay in between the end of transmit to the beginning of receive
  4013. inline uint32_t USBPHY_DEBUG_CLR_TX2RXCOUNT (const uint32_t inValue) { return (inValue & 15U) << 8 ; }
  4014. // Boolean field: Set this bit to allow a countdown to transition in between TX and RX.
  4015. static const uint32_t USBPHY_DEBUG_CLR_ENTX2RXCOUNT = 1U << 12 ;
  4016. // Field (width: 5 bits): Delay in between the detection of squelch to the reset of high-speed RX.
  4017. inline uint32_t USBPHY_DEBUG_CLR_SQUELCHRESETCOUNT (const uint32_t inValue) { return (inValue & 31U) << 16 ; }
  4018. // Boolean field: Set bit to allow squelch to reset high-speed receive.
  4019. static const uint32_t USBPHY_DEBUG_CLR_ENSQUELCHRESET = 1U << 24 ;
  4020. // Field (width: 4 bits): Duration of RESET in terms of the number of 480-MHz cycles.
  4021. inline uint32_t USBPHY_DEBUG_CLR_SQUELCHRESETLENGTH (const uint32_t inValue) { return (inValue & 15U) << 25 ; }
  4022. // Boolean field: Choose to trigger the host resume SE0 with HOST_FORCE_LS_SE0 = 0 or UTMI_SUSPEND = 1.
  4023. static const uint32_t USBPHY_DEBUG_CLR_HOST_RESUME_DEBUG = 1U << 29 ;
  4024. // Boolean field: Gate Test Clocks
  4025. static const uint32_t USBPHY_DEBUG_CLR_CLKGATE = 1U << 30 ;
  4026. //-------------------- USB PHY Debug Register
  4027. #define USBPHY_DEBUG_TOG (* ((volatile uint32_t *) (0x400A2000 + 0x5C)))
  4028. // Boolean field: Once OTG ID from USBPHY_STATUS_OTGID_STATUS is sampled, use this to hold the value
  4029. static const uint32_t USBPHY_DEBUG_TOG_OTGIDPIOLOCK = 1U << 0 ;
  4030. // Boolean field: Use holding registers to assist in timing for external UTMI interface.
  4031. static const uint32_t USBPHY_DEBUG_TOG_DEBUG_INTERFACE_HOLD = 1U << 1 ;
  4032. // Field (width: 2 bits): This bit field selects whether to connect pulldown resistors on the USB_DP/USB_DM pins if the corresponding pulldown overdrive mode is enabled through USBPHY_DEBUG[5:4} Set bit 3 to value 1'b1 to connect the 15ohm pulldown on USB_DP line
  4033. inline uint32_t USBPHY_DEBUG_TOG_HSTPULLDOWN (const uint32_t inValue) { return (inValue & 3U) << 2 ; }
  4034. // Field (width: 2 bits): This bit field selects host pulldown overdrive mode
  4035. inline uint32_t USBPHY_DEBUG_TOG_ENHSTPULLDOWN (const uint32_t inValue) { return (inValue & 3U) << 4 ; }
  4036. // Field (width: 4 bits): Delay in between the end of transmit to the beginning of receive
  4037. inline uint32_t USBPHY_DEBUG_TOG_TX2RXCOUNT (const uint32_t inValue) { return (inValue & 15U) << 8 ; }
  4038. // Boolean field: Set this bit to allow a countdown to transition in between TX and RX.
  4039. static const uint32_t USBPHY_DEBUG_TOG_ENTX2RXCOUNT = 1U << 12 ;
  4040. // Field (width: 5 bits): Delay in between the detection of squelch to the reset of high-speed RX.
  4041. inline uint32_t USBPHY_DEBUG_TOG_SQUELCHRESETCOUNT (const uint32_t inValue) { return (inValue & 31U) << 16 ; }
  4042. // Boolean field: Set bit to allow squelch to reset high-speed receive.
  4043. static const uint32_t USBPHY_DEBUG_TOG_ENSQUELCHRESET = 1U << 24 ;
  4044. // Field (width: 4 bits): Duration of RESET in terms of the number of 480-MHz cycles.
  4045. inline uint32_t USBPHY_DEBUG_TOG_SQUELCHRESETLENGTH (const uint32_t inValue) { return (inValue & 15U) << 25 ; }
  4046. // Boolean field: Choose to trigger the host resume SE0 with HOST_FORCE_LS_SE0 = 0 or UTMI_SUSPEND = 1.
  4047. static const uint32_t USBPHY_DEBUG_TOG_HOST_RESUME_DEBUG = 1U << 29 ;
  4048. // Boolean field: Gate Test Clocks
  4049. static const uint32_t USBPHY_DEBUG_TOG_CLKGATE = 1U << 30 ;
  4050. //-------------------- UTMI Debug Status Register 0
  4051. #define USBPHY_DEBUG0_STATUS (* ((const volatile uint32_t *) (0x400A2000 + 0x60)))
  4052. // Field (width: 16 bits): Running count of the failed pseudo-random generator loopback
  4053. inline uint32_t USBPHY_DEBUG0_STATUS_LOOP_BACK_FAIL_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  4054. // Field (width: 10 bits): Running count of the UTMI_RXERROR.
  4055. inline uint32_t USBPHY_DEBUG0_STATUS_UTMI_RXERROR_FAIL_COUNT (const uint32_t inValue) { return (inValue & 1023U) << 16 ; }
  4056. // Field (width: 6 bits): Running count of the squelch reset instead of normal end for HS RX.
  4057. inline uint32_t USBPHY_DEBUG0_STATUS_SQUELCH_COUNT (const uint32_t inValue) { return (inValue & 63U) << 26 ; }
  4058. //-------------------- UTMI Debug Status Register 1
  4059. #define USBPHY_DEBUG1 (* ((volatile uint32_t *) (0x400A2000 + 0x70)))
  4060. // Field (width: 2 bits): Delay increment of the rise of squelch:
  4061. inline uint32_t USBPHY_DEBUG1_ENTAILADJVD (const uint32_t inValue) { return (inValue & 3U) << 13 ; }
  4062. //-------------------- UTMI Debug Status Register 1
  4063. #define USBPHY_DEBUG1_SET (* ((volatile uint32_t *) (0x400A2000 + 0x74)))
  4064. // Field (width: 2 bits): Delay increment of the rise of squelch:
  4065. inline uint32_t USBPHY_DEBUG1_SET_ENTAILADJVD (const uint32_t inValue) { return (inValue & 3U) << 13 ; }
  4066. //-------------------- UTMI Debug Status Register 1
  4067. #define USBPHY_DEBUG1_CLR (* ((volatile uint32_t *) (0x400A2000 + 0x78)))
  4068. // Field (width: 2 bits): Delay increment of the rise of squelch:
  4069. inline uint32_t USBPHY_DEBUG1_CLR_ENTAILADJVD (const uint32_t inValue) { return (inValue & 3U) << 13 ; }
  4070. //-------------------- UTMI Debug Status Register 1
  4071. #define USBPHY_DEBUG1_TOG (* ((volatile uint32_t *) (0x400A2000 + 0x7C)))
  4072. // Field (width: 2 bits): Delay increment of the rise of squelch:
  4073. inline uint32_t USBPHY_DEBUG1_TOG_ENTAILADJVD (const uint32_t inValue) { return (inValue & 3U) << 13 ; }
  4074. //-------------------- UTMI RTL Version
  4075. #define USBPHY_VERSION (* ((const volatile uint32_t *) (0x400A2000 + 0x80)))
  4076. // Field (width: 16 bits): Fixed read-only value reflecting the stepping of the RTL version.
  4077. inline uint32_t USBPHY_VERSION_STEP (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  4078. // Field (width: 8 bits): Fixed read-only value reflecting the MINOR field of the RTL version.
  4079. inline uint32_t USBPHY_VERSION_MINOR (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  4080. // Field (width: 8 bits): Fixed read-only value reflecting the MAJOR field of the RTL version.
  4081. inline uint32_t USBPHY_VERSION_MAJOR (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  4082. //-------------------- USB PHY PLL Control/Status Register
  4083. #define USBPHY_PLL_SIC (* ((volatile uint32_t *) (0x400A2000 + 0xA0)))
  4084. // Field (width: 2 bits): This field controls the USB PLL feedback loop divider
  4085. inline uint32_t USBPHY_PLL_SIC_PLL_DIV_SEL (const uint32_t inValue) { return (inValue & 3U) << 0 ; }
  4086. // Boolean field: Enable the USB clock output from the USB PHY PLL.
  4087. static const uint32_t USBPHY_PLL_SIC_PLL_EN_USB_CLKS = 1U << 6 ;
  4088. // Boolean field: Analog debug bit
  4089. static const uint32_t USBPHY_PLL_SIC_PLL_HOLD_RING_OFF = 1U << 11 ;
  4090. // Boolean field: Power up the USB PLL.
  4091. static const uint32_t USBPHY_PLL_SIC_PLL_POWER = 1U << 12 ;
  4092. // Boolean field: Enable the clock output from the USB PLL.
  4093. static const uint32_t USBPHY_PLL_SIC_PLL_ENABLE = 1U << 13 ;
  4094. // Boolean field: Bypass the USB PLL.
  4095. static const uint32_t USBPHY_PLL_SIC_PLL_BYPASS = 1U << 16 ;
  4096. // Boolean field: USB PLL lock status indicator
  4097. static const uint32_t USBPHY_PLL_SIC_PLL_LOCK = 1U << 31 ;
  4098. //-------------------- USB PHY PLL Control/Status Register
  4099. #define USBPHY_PLL_SIC_SET (* ((volatile uint32_t *) (0x400A2000 + 0xA4)))
  4100. // Field (width: 2 bits): This field controls the USB PLL feedback loop divider
  4101. inline uint32_t USBPHY_PLL_SIC_SET_PLL_DIV_SEL (const uint32_t inValue) { return (inValue & 3U) << 0 ; }
  4102. // Boolean field: Enable the USB clock output from the USB PHY PLL.
  4103. static const uint32_t USBPHY_PLL_SIC_SET_PLL_EN_USB_CLKS = 1U << 6 ;
  4104. // Boolean field: Analog debug bit
  4105. static const uint32_t USBPHY_PLL_SIC_SET_PLL_HOLD_RING_OFF = 1U << 11 ;
  4106. // Boolean field: Power up the USB PLL.
  4107. static const uint32_t USBPHY_PLL_SIC_SET_PLL_POWER = 1U << 12 ;
  4108. // Boolean field: Enable the clock output from the USB PLL.
  4109. static const uint32_t USBPHY_PLL_SIC_SET_PLL_ENABLE = 1U << 13 ;
  4110. // Boolean field: Bypass the USB PLL.
  4111. static const uint32_t USBPHY_PLL_SIC_SET_PLL_BYPASS = 1U << 16 ;
  4112. // Boolean field: USB PLL lock status indicator
  4113. static const uint32_t USBPHY_PLL_SIC_SET_PLL_LOCK = 1U << 31 ;
  4114. //-------------------- USB PHY PLL Control/Status Register
  4115. #define USBPHY_PLL_SIC_CLR (* ((volatile uint32_t *) (0x400A2000 + 0xA8)))
  4116. // Field (width: 2 bits): This field controls the USB PLL feedback loop divider
  4117. inline uint32_t USBPHY_PLL_SIC_CLR_PLL_DIV_SEL (const uint32_t inValue) { return (inValue & 3U) << 0 ; }
  4118. // Boolean field: Enable the USB clock output from the USB PHY PLL.
  4119. static const uint32_t USBPHY_PLL_SIC_CLR_PLL_EN_USB_CLKS = 1U << 6 ;
  4120. // Boolean field: Analog debug bit
  4121. static const uint32_t USBPHY_PLL_SIC_CLR_PLL_HOLD_RING_OFF = 1U << 11 ;
  4122. // Boolean field: Power up the USB PLL.
  4123. static const uint32_t USBPHY_PLL_SIC_CLR_PLL_POWER = 1U << 12 ;
  4124. // Boolean field: Enable the clock output from the USB PLL.
  4125. static const uint32_t USBPHY_PLL_SIC_CLR_PLL_ENABLE = 1U << 13 ;
  4126. // Boolean field: Bypass the USB PLL.
  4127. static const uint32_t USBPHY_PLL_SIC_CLR_PLL_BYPASS = 1U << 16 ;
  4128. // Boolean field: USB PLL lock status indicator
  4129. static const uint32_t USBPHY_PLL_SIC_CLR_PLL_LOCK = 1U << 31 ;
  4130. //-------------------- USB PHY PLL Control/Status Register
  4131. #define USBPHY_PLL_SIC_TOG (* ((volatile uint32_t *) (0x400A2000 + 0xAC)))
  4132. // Field (width: 2 bits): This field controls the USB PLL feedback loop divider
  4133. inline uint32_t USBPHY_PLL_SIC_TOG_PLL_DIV_SEL (const uint32_t inValue) { return (inValue & 3U) << 0 ; }
  4134. // Boolean field: Enable the USB clock output from the USB PHY PLL.
  4135. static const uint32_t USBPHY_PLL_SIC_TOG_PLL_EN_USB_CLKS = 1U << 6 ;
  4136. // Boolean field: Analog debug bit
  4137. static const uint32_t USBPHY_PLL_SIC_TOG_PLL_HOLD_RING_OFF = 1U << 11 ;
  4138. // Boolean field: Power up the USB PLL.
  4139. static const uint32_t USBPHY_PLL_SIC_TOG_PLL_POWER = 1U << 12 ;
  4140. // Boolean field: Enable the clock output from the USB PLL.
  4141. static const uint32_t USBPHY_PLL_SIC_TOG_PLL_ENABLE = 1U << 13 ;
  4142. // Boolean field: Bypass the USB PLL.
  4143. static const uint32_t USBPHY_PLL_SIC_TOG_PLL_BYPASS = 1U << 16 ;
  4144. // Boolean field: USB PLL lock status indicator
  4145. static const uint32_t USBPHY_PLL_SIC_TOG_PLL_LOCK = 1U << 31 ;
  4146. //-------------------- USB PHY VBUS Detect Control Register
  4147. #define USBPHY_USB1_VBUS_DETECT (* ((volatile uint32_t *) (0x400A2000 + 0xC0)))
  4148. // Field (width: 3 bits): Sets the threshold for the VBUSVALID comparator
  4149. inline uint32_t USBPHY_USB1_VBUS_DETECT_VBUSVALID_THRESH (const uint32_t inValue) { return (inValue & 7U) << 0 ; }
  4150. // Boolean field: VBUS detect signal override enable
  4151. static const uint32_t USBPHY_USB1_VBUS_DETECT_VBUS_OVERRIDE_EN = 1U << 3 ;
  4152. // Boolean field: Override value for SESSEND
  4153. static const uint32_t USBPHY_USB1_VBUS_DETECT_SESSEND_OVERRIDE = 1U << 4 ;
  4154. // Boolean field: Override value for B-Device Session Valid
  4155. static const uint32_t USBPHY_USB1_VBUS_DETECT_BVALID_OVERRIDE = 1U << 5 ;
  4156. // Boolean field: Override value for A-Device Session Valid
  4157. static const uint32_t USBPHY_USB1_VBUS_DETECT_AVALID_OVERRIDE = 1U << 6 ;
  4158. // Boolean field: Override value for VBUS_VALID signal sent to USB controller
  4159. static const uint32_t USBPHY_USB1_VBUS_DETECT_VBUSVALID_OVERRIDE = 1U << 7 ;
  4160. // Boolean field: Selects the source of the VBUS_VALID signal reported to the USB controller
  4161. static const uint32_t USBPHY_USB1_VBUS_DETECT_VBUSVALID_SEL = 1U << 8 ;
  4162. // Field (width: 2 bits): Selects the source of the VBUS_VALID signal reported to the USB controller
  4163. inline uint32_t USBPHY_USB1_VBUS_DETECT_VBUS_SOURCE_SEL (const uint32_t inValue) { return (inValue & 3U) << 9 ; }
  4164. // Boolean field: Selects the comparator used for VBUS_VALID
  4165. static const uint32_t USBPHY_USB1_VBUS_DETECT_VBUSVALID_TO_SESSVALID = 1U << 18 ;
  4166. // Boolean field: Enables the VBUS_VALID comparator
  4167. static const uint32_t USBPHY_USB1_VBUS_DETECT_PWRUP_CMPS = 1U << 20 ;
  4168. // Boolean field: Controls VBUS discharge resistor
  4169. static const uint32_t USBPHY_USB1_VBUS_DETECT_DISCHARGE_VBUS = 1U << 26 ;
  4170. // Boolean field: Enables resistors used for an older method of resistive battery charger detection
  4171. static const uint32_t USBPHY_USB1_VBUS_DETECT_EN_CHARGER_RESISTOR = 1U << 31 ;
  4172. //-------------------- USB PHY VBUS Detect Control Register
  4173. #define USBPHY_USB1_VBUS_DETECT_SET (* ((volatile uint32_t *) (0x400A2000 + 0xC4)))
  4174. // Field (width: 3 bits): Sets the threshold for the VBUSVALID comparator
  4175. inline uint32_t USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_THRESH (const uint32_t inValue) { return (inValue & 7U) << 0 ; }
  4176. // Boolean field: VBUS detect signal override enable
  4177. static const uint32_t USBPHY_USB1_VBUS_DETECT_SET_VBUS_OVERRIDE_EN = 1U << 3 ;
  4178. // Boolean field: Override value for SESSEND
  4179. static const uint32_t USBPHY_USB1_VBUS_DETECT_SET_SESSEND_OVERRIDE = 1U << 4 ;
  4180. // Boolean field: Override value for B-Device Session Valid
  4181. static const uint32_t USBPHY_USB1_VBUS_DETECT_SET_BVALID_OVERRIDE = 1U << 5 ;
  4182. // Boolean field: Override value for A-Device Session Valid
  4183. static const uint32_t USBPHY_USB1_VBUS_DETECT_SET_AVALID_OVERRIDE = 1U << 6 ;
  4184. // Boolean field: Override value for VBUS_VALID signal sent to USB controller
  4185. static const uint32_t USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_OVERRIDE = 1U << 7 ;
  4186. // Boolean field: Selects the source of the VBUS_VALID signal reported to the USB controller
  4187. static const uint32_t USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_SEL = 1U << 8 ;
  4188. // Field (width: 2 bits): Selects the source of the VBUS_VALID signal reported to the USB controller
  4189. inline uint32_t USBPHY_USB1_VBUS_DETECT_SET_VBUS_SOURCE_SEL (const uint32_t inValue) { return (inValue & 3U) << 9 ; }
  4190. // Boolean field: Selects the comparator used for VBUS_VALID
  4191. static const uint32_t USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_TO_SESSVALID = 1U << 18 ;
  4192. // Boolean field: Enables the VBUS_VALID comparator
  4193. static const uint32_t USBPHY_USB1_VBUS_DETECT_SET_PWRUP_CMPS = 1U << 20 ;
  4194. // Boolean field: Controls VBUS discharge resistor
  4195. static const uint32_t USBPHY_USB1_VBUS_DETECT_SET_DISCHARGE_VBUS = 1U << 26 ;
  4196. // Boolean field: Enables resistors used for an older method of resistive battery charger detection
  4197. static const uint32_t USBPHY_USB1_VBUS_DETECT_SET_EN_CHARGER_RESISTOR = 1U << 31 ;
  4198. //-------------------- USB PHY VBUS Detect Control Register
  4199. #define USBPHY_USB1_VBUS_DETECT_CLR (* ((volatile uint32_t *) (0x400A2000 + 0xC8)))
  4200. // Field (width: 3 bits): Sets the threshold for the VBUSVALID comparator
  4201. inline uint32_t USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_THRESH (const uint32_t inValue) { return (inValue & 7U) << 0 ; }
  4202. // Boolean field: VBUS detect signal override enable
  4203. static const uint32_t USBPHY_USB1_VBUS_DETECT_CLR_VBUS_OVERRIDE_EN = 1U << 3 ;
  4204. // Boolean field: Override value for SESSEND
  4205. static const uint32_t USBPHY_USB1_VBUS_DETECT_CLR_SESSEND_OVERRIDE = 1U << 4 ;
  4206. // Boolean field: Override value for B-Device Session Valid
  4207. static const uint32_t USBPHY_USB1_VBUS_DETECT_CLR_BVALID_OVERRIDE = 1U << 5 ;
  4208. // Boolean field: Override value for A-Device Session Valid
  4209. static const uint32_t USBPHY_USB1_VBUS_DETECT_CLR_AVALID_OVERRIDE = 1U << 6 ;
  4210. // Boolean field: Override value for VBUS_VALID signal sent to USB controller
  4211. static const uint32_t USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_OVERRIDE = 1U << 7 ;
  4212. // Boolean field: Selects the source of the VBUS_VALID signal reported to the USB controller
  4213. static const uint32_t USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_SEL = 1U << 8 ;
  4214. // Field (width: 2 bits): Selects the source of the VBUS_VALID signal reported to the USB controller
  4215. inline uint32_t USBPHY_USB1_VBUS_DETECT_CLR_VBUS_SOURCE_SEL (const uint32_t inValue) { return (inValue & 3U) << 9 ; }
  4216. // Boolean field: Selects the comparator used for VBUS_VALID
  4217. static const uint32_t USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_TO_SESSVALID = 1U << 18 ;
  4218. // Boolean field: Enables the VBUS_VALID comparator
  4219. static const uint32_t USBPHY_USB1_VBUS_DETECT_CLR_PWRUP_CMPS = 1U << 20 ;
  4220. // Boolean field: Controls VBUS discharge resistor
  4221. static const uint32_t USBPHY_USB1_VBUS_DETECT_CLR_DISCHARGE_VBUS = 1U << 26 ;
  4222. // Boolean field: Enables resistors used for an older method of resistive battery charger detection
  4223. static const uint32_t USBPHY_USB1_VBUS_DETECT_CLR_EN_CHARGER_RESISTOR = 1U << 31 ;
  4224. //-------------------- USB PHY VBUS Detect Control Register
  4225. #define USBPHY_USB1_VBUS_DETECT_TOG (* ((volatile uint32_t *) (0x400A2000 + 0xCC)))
  4226. // Field (width: 3 bits): Sets the threshold for the VBUSVALID comparator
  4227. inline uint32_t USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_THRESH (const uint32_t inValue) { return (inValue & 7U) << 0 ; }
  4228. // Boolean field: VBUS detect signal override enable
  4229. static const uint32_t USBPHY_USB1_VBUS_DETECT_TOG_VBUS_OVERRIDE_EN = 1U << 3 ;
  4230. // Boolean field: Override value for SESSEND
  4231. static const uint32_t USBPHY_USB1_VBUS_DETECT_TOG_SESSEND_OVERRIDE = 1U << 4 ;
  4232. // Boolean field: Override value for B-Device Session Valid
  4233. static const uint32_t USBPHY_USB1_VBUS_DETECT_TOG_BVALID_OVERRIDE = 1U << 5 ;
  4234. // Boolean field: Override value for A-Device Session Valid
  4235. static const uint32_t USBPHY_USB1_VBUS_DETECT_TOG_AVALID_OVERRIDE = 1U << 6 ;
  4236. // Boolean field: Override value for VBUS_VALID signal sent to USB controller
  4237. static const uint32_t USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_OVERRIDE = 1U << 7 ;
  4238. // Boolean field: Selects the source of the VBUS_VALID signal reported to the USB controller
  4239. static const uint32_t USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_SEL = 1U << 8 ;
  4240. // Field (width: 2 bits): Selects the source of the VBUS_VALID signal reported to the USB controller
  4241. inline uint32_t USBPHY_USB1_VBUS_DETECT_TOG_VBUS_SOURCE_SEL (const uint32_t inValue) { return (inValue & 3U) << 9 ; }
  4242. // Boolean field: Selects the comparator used for VBUS_VALID
  4243. static const uint32_t USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_TO_SESSVALID = 1U << 18 ;
  4244. // Boolean field: Enables the VBUS_VALID comparator
  4245. static const uint32_t USBPHY_USB1_VBUS_DETECT_TOG_PWRUP_CMPS = 1U << 20 ;
  4246. // Boolean field: Controls VBUS discharge resistor
  4247. static const uint32_t USBPHY_USB1_VBUS_DETECT_TOG_DISCHARGE_VBUS = 1U << 26 ;
  4248. // Boolean field: Enables resistors used for an older method of resistive battery charger detection
  4249. static const uint32_t USBPHY_USB1_VBUS_DETECT_TOG_EN_CHARGER_RESISTOR = 1U << 31 ;
  4250. //-------------------- USB PHY VBUS Detector Status Register
  4251. #define USBPHY_USB1_VBUS_DET_STAT (* ((const volatile uint32_t *) (0x400A2000 + 0xD0)))
  4252. // Boolean field: Session End indicator
  4253. static const uint32_t USBPHY_USB1_VBUS_DET_STAT_SESSEND = 1U << 0 ;
  4254. // Boolean field: B-Device Session Valid status
  4255. static const uint32_t USBPHY_USB1_VBUS_DET_STAT_BVALID = 1U << 1 ;
  4256. // Boolean field: A-Device Session Valid status
  4257. static const uint32_t USBPHY_USB1_VBUS_DET_STAT_AVALID = 1U << 2 ;
  4258. // Boolean field: VBUS voltage status
  4259. static const uint32_t USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID = 1U << 3 ;
  4260. // Boolean field: VBUS_VALID_3V detector status
  4261. static const uint32_t USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID_3V = 1U << 4 ;
  4262. //-------------------- USB PHY Charger Detect Status Register
  4263. #define USBPHY_USB1_CHRG_DET_STAT (* ((const volatile uint32_t *) (0x400A2000 + 0xF0)))
  4264. // Boolean field: Battery Charging Data Contact Detection phase output
  4265. static const uint32_t USBPHY_USB1_CHRG_DET_STAT_PLUG_CONTACT = 1U << 0 ;
  4266. // Boolean field: Battery Charging Primary Detection phase output
  4267. static const uint32_t USBPHY_USB1_CHRG_DET_STAT_CHRG_DETECTED = 1U << 1 ;
  4268. // Boolean field: Single ended receiver output for the USB_DM pin, from charger detection circuits.
  4269. static const uint32_t USBPHY_USB1_CHRG_DET_STAT_DM_STATE = 1U << 2 ;
  4270. // Boolean field: Single ended receiver output for the USB_DP pin, from charger detection circuits.
  4271. static const uint32_t USBPHY_USB1_CHRG_DET_STAT_DP_STATE = 1U << 3 ;
  4272. // Boolean field: Battery Charging Secondary Detection phase output
  4273. static const uint32_t USBPHY_USB1_CHRG_DET_STAT_SECDET_DCP = 1U << 4 ;
  4274. //-------------------- USB PHY Analog Control Register
  4275. #define USBPHY_ANACTRL (* ((volatile uint32_t *) (0x400A2000 + 0x100)))
  4276. // Boolean field: Test clock selection to analog test
  4277. static const uint32_t USBPHY_ANACTRL_TESTCLK_SEL = 1U << 0 ;
  4278. // Boolean field: This bit field controls clock gating (disabling) for the PFD pfd_clk output for power savings when the PFD is not used
  4279. static const uint32_t USBPHY_ANACTRL_PFD_CLKGATE = 1U << 1 ;
  4280. // Field (width: 2 bits): This bit field for the PFD selects the frequency relationship between the local pfd_clk output and the exported USB1PFDCLK
  4281. inline uint32_t USBPHY_ANACTRL_PFD_CLK_SEL (const uint32_t inValue) { return (inValue & 3U) << 2 ; }
  4282. // Field (width: 6 bits): PFD fractional divider setting used to select the pfd_clk output frequency
  4283. inline uint32_t USBPHY_ANACTRL_PFD_FRAC (const uint32_t inValue) { return (inValue & 63U) << 4 ; }
  4284. // Boolean field: Setting this field to 1'b1 will enable the 15kohm pulldown resistors on both USB_DP and USB_DM pins
  4285. static const uint32_t USBPHY_ANACTRL_DEV_PULLDOWN = 1U << 10 ;
  4286. // Field (width: 2 bits): Controls pre-emphasis time duration for the High Speed TX drivers after each data transition when the USBPHY_ANACTRL[EMPH_EN] bit is set high to 1'b1
  4287. inline uint32_t USBPHY_ANACTRL_EMPH_PULSE_CTRL (const uint32_t inValue) { return (inValue & 3U) << 11 ; }
  4288. // Boolean field: Enables pre-emphasis for the High-Speed TX drivers
  4289. static const uint32_t USBPHY_ANACTRL_EMPH_EN = 1U << 13 ;
  4290. // Field (width: 2 bits): Controls the amount of pre-emphasis current added for the High-Speed TX drivers after each data transition when the USBPHY_ANACTRL[EMPH_EN] bit is set high to 1'b1
  4291. inline uint32_t USBPHY_ANACTRL_EMPH_CUR_CTRL (const uint32_t inValue) { return (inValue & 3U) << 14 ; }
  4292. // Boolean field: PFD stable signal from the Phase Fractional Divider.
  4293. static const uint32_t USBPHY_ANACTRL_PFD_STABLE = 1U << 31 ;
  4294. //-------------------- USB PHY Analog Control Register
  4295. #define USBPHY_ANACTRL_SET (* ((volatile uint32_t *) (0x400A2000 + 0x104)))
  4296. // Boolean field: Test clock selection to analog test
  4297. static const uint32_t USBPHY_ANACTRL_SET_TESTCLK_SEL = 1U << 0 ;
  4298. // Boolean field: This bit field controls clock gating (disabling) for the PFD pfd_clk output for power savings when the PFD is not used
  4299. static const uint32_t USBPHY_ANACTRL_SET_PFD_CLKGATE = 1U << 1 ;
  4300. // Field (width: 2 bits): This bit field for the PFD selects the frequency relationship between the local pfd_clk output and the exported USB1PFDCLK
  4301. inline uint32_t USBPHY_ANACTRL_SET_PFD_CLK_SEL (const uint32_t inValue) { return (inValue & 3U) << 2 ; }
  4302. // Field (width: 6 bits): PFD fractional divider setting used to select the pfd_clk output frequency
  4303. inline uint32_t USBPHY_ANACTRL_SET_PFD_FRAC (const uint32_t inValue) { return (inValue & 63U) << 4 ; }
  4304. // Boolean field: Setting this field to 1'b1 will enable the 15kohm pulldown resistors on both USB_DP and USB_DM pins
  4305. static const uint32_t USBPHY_ANACTRL_SET_DEV_PULLDOWN = 1U << 10 ;
  4306. // Field (width: 2 bits): Controls pre-emphasis time duration for the High Speed TX drivers after each data transition when the USBPHY_ANACTRL[EMPH_EN] bit is set high to 1'b1
  4307. inline uint32_t USBPHY_ANACTRL_SET_EMPH_PULSE_CTRL (const uint32_t inValue) { return (inValue & 3U) << 11 ; }
  4308. // Boolean field: Enables pre-emphasis for the High-Speed TX drivers
  4309. static const uint32_t USBPHY_ANACTRL_SET_EMPH_EN = 1U << 13 ;
  4310. // Field (width: 2 bits): Controls the amount of pre-emphasis current added for the High-Speed TX drivers after each data transition when the USBPHY_ANACTRL[EMPH_EN] bit is set high to 1'b1
  4311. inline uint32_t USBPHY_ANACTRL_SET_EMPH_CUR_CTRL (const uint32_t inValue) { return (inValue & 3U) << 14 ; }
  4312. // Boolean field: PFD stable signal from the Phase Fractional Divider.
  4313. static const uint32_t USBPHY_ANACTRL_SET_PFD_STABLE = 1U << 31 ;
  4314. //-------------------- USB PHY Analog Control Register
  4315. #define USBPHY_ANACTRL_CLR (* ((volatile uint32_t *) (0x400A2000 + 0x108)))
  4316. // Boolean field: Test clock selection to analog test
  4317. static const uint32_t USBPHY_ANACTRL_CLR_TESTCLK_SEL = 1U << 0 ;
  4318. // Boolean field: This bit field controls clock gating (disabling) for the PFD pfd_clk output for power savings when the PFD is not used
  4319. static const uint32_t USBPHY_ANACTRL_CLR_PFD_CLKGATE = 1U << 1 ;
  4320. // Field (width: 2 bits): This bit field for the PFD selects the frequency relationship between the local pfd_clk output and the exported USB1PFDCLK
  4321. inline uint32_t USBPHY_ANACTRL_CLR_PFD_CLK_SEL (const uint32_t inValue) { return (inValue & 3U) << 2 ; }
  4322. // Field (width: 6 bits): PFD fractional divider setting used to select the pfd_clk output frequency
  4323. inline uint32_t USBPHY_ANACTRL_CLR_PFD_FRAC (const uint32_t inValue) { return (inValue & 63U) << 4 ; }
  4324. // Boolean field: Setting this field to 1'b1 will enable the 15kohm pulldown resistors on both USB_DP and USB_DM pins
  4325. static const uint32_t USBPHY_ANACTRL_CLR_DEV_PULLDOWN = 1U << 10 ;
  4326. // Field (width: 2 bits): Controls pre-emphasis time duration for the High Speed TX drivers after each data transition when the USBPHY_ANACTRL[EMPH_EN] bit is set high to 1'b1
  4327. inline uint32_t USBPHY_ANACTRL_CLR_EMPH_PULSE_CTRL (const uint32_t inValue) { return (inValue & 3U) << 11 ; }
  4328. // Boolean field: Enables pre-emphasis for the High-Speed TX drivers
  4329. static const uint32_t USBPHY_ANACTRL_CLR_EMPH_EN = 1U << 13 ;
  4330. // Field (width: 2 bits): Controls the amount of pre-emphasis current added for the High-Speed TX drivers after each data transition when the USBPHY_ANACTRL[EMPH_EN] bit is set high to 1'b1
  4331. inline uint32_t USBPHY_ANACTRL_CLR_EMPH_CUR_CTRL (const uint32_t inValue) { return (inValue & 3U) << 14 ; }
  4332. // Boolean field: PFD stable signal from the Phase Fractional Divider.
  4333. static const uint32_t USBPHY_ANACTRL_CLR_PFD_STABLE = 1U << 31 ;
  4334. //-------------------- USB PHY Analog Control Register
  4335. #define USBPHY_ANACTRL_TOG (* ((volatile uint32_t *) (0x400A2000 + 0x10C)))
  4336. // Boolean field: Test clock selection to analog test
  4337. static const uint32_t USBPHY_ANACTRL_TOG_TESTCLK_SEL = 1U << 0 ;
  4338. // Boolean field: This bit field controls clock gating (disabling) for the PFD pfd_clk output for power savings when the PFD is not used
  4339. static const uint32_t USBPHY_ANACTRL_TOG_PFD_CLKGATE = 1U << 1 ;
  4340. // Field (width: 2 bits): This bit field for the PFD selects the frequency relationship between the local pfd_clk output and the exported USB1PFDCLK
  4341. inline uint32_t USBPHY_ANACTRL_TOG_PFD_CLK_SEL (const uint32_t inValue) { return (inValue & 3U) << 2 ; }
  4342. // Field (width: 6 bits): PFD fractional divider setting used to select the pfd_clk output frequency
  4343. inline uint32_t USBPHY_ANACTRL_TOG_PFD_FRAC (const uint32_t inValue) { return (inValue & 63U) << 4 ; }
  4344. // Boolean field: Setting this field to 1'b1 will enable the 15kohm pulldown resistors on both USB_DP and USB_DM pins
  4345. static const uint32_t USBPHY_ANACTRL_TOG_DEV_PULLDOWN = 1U << 10 ;
  4346. // Field (width: 2 bits): Controls pre-emphasis time duration for the High Speed TX drivers after each data transition when the USBPHY_ANACTRL[EMPH_EN] bit is set high to 1'b1
  4347. inline uint32_t USBPHY_ANACTRL_TOG_EMPH_PULSE_CTRL (const uint32_t inValue) { return (inValue & 3U) << 11 ; }
  4348. // Boolean field: Enables pre-emphasis for the High-Speed TX drivers
  4349. static const uint32_t USBPHY_ANACTRL_TOG_EMPH_EN = 1U << 13 ;
  4350. // Field (width: 2 bits): Controls the amount of pre-emphasis current added for the High-Speed TX drivers after each data transition when the USBPHY_ANACTRL[EMPH_EN] bit is set high to 1'b1
  4351. inline uint32_t USBPHY_ANACTRL_TOG_EMPH_CUR_CTRL (const uint32_t inValue) { return (inValue & 3U) << 14 ; }
  4352. // Boolean field: PFD stable signal from the Phase Fractional Divider.
  4353. static const uint32_t USBPHY_ANACTRL_TOG_PFD_STABLE = 1U << 31 ;
  4354. //-------------------- USB PHY Loopback Control/Status Register
  4355. #define USBPHY_USB1_LOOPBACK (* ((volatile uint32_t *) (0x400A2000 + 0x110)))
  4356. // Boolean field: This bit enables the USB loopback test.
  4357. static const uint32_t USBPHY_USB1_LOOPBACK_UTMI_TESTSTART = 1U << 0 ;
  4358. // Boolean field: Mode control for USB loopback test
  4359. static const uint32_t USBPHY_USB1_LOOPBACK_UTMI_DIG_TST0 = 1U << 1 ;
  4360. // Boolean field: Mode control for USB loopback test
  4361. static const uint32_t USBPHY_USB1_LOOPBACK_UTMI_DIG_TST1 = 1U << 2 ;
  4362. // Boolean field: Select HS or FS mode for USB loopback testing
  4363. static const uint32_t USBPHY_USB1_LOOPBACK_TSTI_TX_HS_MODE = 1U << 3 ;
  4364. // Boolean field: Set to value 1'b1 to choose LS for USB loopback testing, set to value 1'b0 to choose HS or FS mode which is defined by TSTI1_TX_HS
  4365. static const uint32_t USBPHY_USB1_LOOPBACK_TSTI_TX_LS_MODE = 1U << 4 ;
  4366. // Boolean field: Enable TX for USB loopback test.
  4367. static const uint32_t USBPHY_USB1_LOOPBACK_TSTI_TX_EN = 1U << 5 ;
  4368. // Boolean field: Sets TX Hi-Z for USB loopback test.
  4369. static const uint32_t USBPHY_USB1_LOOPBACK_TSTI_TX_HIZ = 1U << 6 ;
  4370. // Boolean field: This read-only bit is a status bit for USB loopback test results
  4371. static const uint32_t USBPHY_USB1_LOOPBACK_UTMO_DIG_TST0 = 1U << 7 ;
  4372. // Boolean field: This read-only bit is a status bit for USB loopback test
  4373. static const uint32_t USBPHY_USB1_LOOPBACK_UTMO_DIG_TST1 = 1U << 8 ;
  4374. // Boolean field: Setting this bit field to value 1'b1 will enable the loopback test to dynamically change the packet speed
  4375. static const uint32_t USBPHY_USB1_LOOPBACK_TSTI_HSFS_MODE_EN = 1U << 15 ;
  4376. // Field (width: 8 bits): Selects the packet data byte used for USB loopback testing in Pulse mode
  4377. inline uint32_t USBPHY_USB1_LOOPBACK_TSTPKT (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  4378. //-------------------- USB PHY Loopback Control/Status Register
  4379. #define USBPHY_USB1_LOOPBACK_SET (* ((volatile uint32_t *) (0x400A2000 + 0x114)))
  4380. // Boolean field: This bit enables the USB loopback test.
  4381. static const uint32_t USBPHY_USB1_LOOPBACK_SET_UTMI_TESTSTART = 1U << 0 ;
  4382. // Boolean field: Mode control for USB loopback test
  4383. static const uint32_t USBPHY_USB1_LOOPBACK_SET_UTMI_DIG_TST0 = 1U << 1 ;
  4384. // Boolean field: Mode control for USB loopback test
  4385. static const uint32_t USBPHY_USB1_LOOPBACK_SET_UTMI_DIG_TST1 = 1U << 2 ;
  4386. // Boolean field: Select HS or FS mode for USB loopback testing
  4387. static const uint32_t USBPHY_USB1_LOOPBACK_SET_TSTI_TX_HS_MODE = 1U << 3 ;
  4388. // Boolean field: Set to value 1'b1 to choose LS for USB loopback testing, set to value 1'b0 to choose HS or FS mode which is defined by TSTI1_TX_HS
  4389. static const uint32_t USBPHY_USB1_LOOPBACK_SET_TSTI_TX_LS_MODE = 1U << 4 ;
  4390. // Boolean field: Enable TX for USB loopback test.
  4391. static const uint32_t USBPHY_USB1_LOOPBACK_SET_TSTI_TX_EN = 1U << 5 ;
  4392. // Boolean field: Sets TX Hi-Z for USB loopback test.
  4393. static const uint32_t USBPHY_USB1_LOOPBACK_SET_TSTI_TX_HIZ = 1U << 6 ;
  4394. // Boolean field: This read-only bit is a status bit for USB loopback test results
  4395. static const uint32_t USBPHY_USB1_LOOPBACK_SET_UTMO_DIG_TST0 = 1U << 7 ;
  4396. // Boolean field: This read-only bit is a status bit for USB loopback test
  4397. static const uint32_t USBPHY_USB1_LOOPBACK_SET_UTMO_DIG_TST1 = 1U << 8 ;
  4398. // Boolean field: Setting this bit field to value 1'b1 will enable the loopback test to dynamically change the packet speed
  4399. static const uint32_t USBPHY_USB1_LOOPBACK_SET_TSTI_HSFS_MODE_EN = 1U << 15 ;
  4400. // Field (width: 8 bits): Selects the packet data byte used for USB loopback testing in Pulse mode
  4401. inline uint32_t USBPHY_USB1_LOOPBACK_SET_TSTPKT (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  4402. //-------------------- USB PHY Loopback Control/Status Register
  4403. #define USBPHY_USB1_LOOPBACK_CLR (* ((volatile uint32_t *) (0x400A2000 + 0x118)))
  4404. // Boolean field: This bit enables the USB loopback test.
  4405. static const uint32_t USBPHY_USB1_LOOPBACK_CLR_UTMI_TESTSTART = 1U << 0 ;
  4406. // Boolean field: Mode control for USB loopback test
  4407. static const uint32_t USBPHY_USB1_LOOPBACK_CLR_UTMI_DIG_TST0 = 1U << 1 ;
  4408. // Boolean field: Mode control for USB loopback test
  4409. static const uint32_t USBPHY_USB1_LOOPBACK_CLR_UTMI_DIG_TST1 = 1U << 2 ;
  4410. // Boolean field: Select HS or FS mode for USB loopback testing
  4411. static const uint32_t USBPHY_USB1_LOOPBACK_CLR_TSTI_TX_HS_MODE = 1U << 3 ;
  4412. // Boolean field: Set to value 1'b1 to choose LS for USB loopback testing, set to value 1'b0 to choose HS or FS mode which is defined by TSTI1_TX_HS
  4413. static const uint32_t USBPHY_USB1_LOOPBACK_CLR_TSTI_TX_LS_MODE = 1U << 4 ;
  4414. // Boolean field: Enable TX for USB loopback test.
  4415. static const uint32_t USBPHY_USB1_LOOPBACK_CLR_TSTI_TX_EN = 1U << 5 ;
  4416. // Boolean field: Sets TX Hi-Z for USB loopback test.
  4417. static const uint32_t USBPHY_USB1_LOOPBACK_CLR_TSTI_TX_HIZ = 1U << 6 ;
  4418. // Boolean field: This read-only bit is a status bit for USB loopback test results
  4419. static const uint32_t USBPHY_USB1_LOOPBACK_CLR_UTMO_DIG_TST0 = 1U << 7 ;
  4420. // Boolean field: This read-only bit is a status bit for USB loopback test
  4421. static const uint32_t USBPHY_USB1_LOOPBACK_CLR_UTMO_DIG_TST1 = 1U << 8 ;
  4422. // Boolean field: Setting this bit field to value 1'b1 will enable the loopback test to dynamically change the packet speed
  4423. static const uint32_t USBPHY_USB1_LOOPBACK_CLR_TSTI_HSFS_MODE_EN = 1U << 15 ;
  4424. // Field (width: 8 bits): Selects the packet data byte used for USB loopback testing in Pulse mode
  4425. inline uint32_t USBPHY_USB1_LOOPBACK_CLR_TSTPKT (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  4426. //-------------------- USB PHY Loopback Control/Status Register
  4427. #define USBPHY_USB1_LOOPBACK_TOG (* ((volatile uint32_t *) (0x400A2000 + 0x11C)))
  4428. // Boolean field: This bit enables the USB loopback test.
  4429. static const uint32_t USBPHY_USB1_LOOPBACK_TOG_UTMI_TESTSTART = 1U << 0 ;
  4430. // Boolean field: Mode control for USB loopback test
  4431. static const uint32_t USBPHY_USB1_LOOPBACK_TOG_UTMI_DIG_TST0 = 1U << 1 ;
  4432. // Boolean field: Mode control for USB loopback test
  4433. static const uint32_t USBPHY_USB1_LOOPBACK_TOG_UTMI_DIG_TST1 = 1U << 2 ;
  4434. // Boolean field: Select HS or FS mode for USB loopback testing
  4435. static const uint32_t USBPHY_USB1_LOOPBACK_TOG_TSTI_TX_HS_MODE = 1U << 3 ;
  4436. // Boolean field: Set to value 1'b1 to choose LS for USB loopback testing, set to value 1'b0 to choose HS or FS mode which is defined by TSTI1_TX_HS
  4437. static const uint32_t USBPHY_USB1_LOOPBACK_TOG_TSTI_TX_LS_MODE = 1U << 4 ;
  4438. // Boolean field: Enable TX for USB loopback test.
  4439. static const uint32_t USBPHY_USB1_LOOPBACK_TOG_TSTI_TX_EN = 1U << 5 ;
  4440. // Boolean field: Sets TX Hi-Z for USB loopback test.
  4441. static const uint32_t USBPHY_USB1_LOOPBACK_TOG_TSTI_TX_HIZ = 1U << 6 ;
  4442. // Boolean field: This read-only bit is a status bit for USB loopback test results
  4443. static const uint32_t USBPHY_USB1_LOOPBACK_TOG_UTMO_DIG_TST0 = 1U << 7 ;
  4444. // Boolean field: This read-only bit is a status bit for USB loopback test
  4445. static const uint32_t USBPHY_USB1_LOOPBACK_TOG_UTMO_DIG_TST1 = 1U << 8 ;
  4446. // Boolean field: Setting this bit field to value 1'b1 will enable the loopback test to dynamically change the packet speed
  4447. static const uint32_t USBPHY_USB1_LOOPBACK_TOG_TSTI_HSFS_MODE_EN = 1U << 15 ;
  4448. // Field (width: 8 bits): Selects the packet data byte used for USB loopback testing in Pulse mode
  4449. inline uint32_t USBPHY_USB1_LOOPBACK_TOG_TSTPKT (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  4450. //-------------------- USB PHY Loopback Packet Number Select Register
  4451. #define USBPHY_USB1_LOOPBACK_HSFSCNT (* ((volatile uint32_t *) (0x400A2000 + 0x120)))
  4452. // Field (width: 16 bits): High speed packet number, used when USBPHY_USB1_LOOPBACK[TSTI_HSFS_MODE_EN] is set to value 1'b1.
  4453. inline uint32_t USBPHY_USB1_LOOPBACK_HSFSCNT_TSTI_HS_NUMBER (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  4454. // Field (width: 16 bits): Full speed packet number, used when USBPHY_USB1_LOOPBACK[TSTI_HSFS_MODE_EN] is set to value 1'b1.
  4455. inline uint32_t USBPHY_USB1_LOOPBACK_HSFSCNT_TSTI_FS_NUMBER (const uint32_t inValue) { return (inValue & 65535U) << 16 ; }
  4456. //-------------------- USB PHY Loopback Packet Number Select Register
  4457. #define USBPHY_USB1_LOOPBACK_HSFSCNT_SET (* ((volatile uint32_t *) (0x400A2000 + 0x124)))
  4458. // Field (width: 16 bits): High speed packet number, used when USBPHY_USB1_LOOPBACK[TSTI_HSFS_MODE_EN] is set to value 1'b1.
  4459. inline uint32_t USBPHY_USB1_LOOPBACK_HSFSCNT_SET_TSTI_HS_NUMBER (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  4460. // Field (width: 16 bits): Full speed packet number, used when USBPHY_USB1_LOOPBACK[TSTI_HSFS_MODE_EN] is set to value 1'b1.
  4461. inline uint32_t USBPHY_USB1_LOOPBACK_HSFSCNT_SET_TSTI_FS_NUMBER (const uint32_t inValue) { return (inValue & 65535U) << 16 ; }
  4462. //-------------------- USB PHY Loopback Packet Number Select Register
  4463. #define USBPHY_USB1_LOOPBACK_HSFSCNT_CLR (* ((volatile uint32_t *) (0x400A2000 + 0x128)))
  4464. // Field (width: 16 bits): High speed packet number, used when USBPHY_USB1_LOOPBACK[TSTI_HSFS_MODE_EN] is set to value 1'b1.
  4465. inline uint32_t USBPHY_USB1_LOOPBACK_HSFSCNT_CLR_TSTI_HS_NUMBER (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  4466. // Field (width: 16 bits): Full speed packet number, used when USBPHY_USB1_LOOPBACK[TSTI_HSFS_MODE_EN] is set to value 1'b1.
  4467. inline uint32_t USBPHY_USB1_LOOPBACK_HSFSCNT_CLR_TSTI_FS_NUMBER (const uint32_t inValue) { return (inValue & 65535U) << 16 ; }
  4468. //-------------------- USB PHY Loopback Packet Number Select Register
  4469. #define USBPHY_USB1_LOOPBACK_HSFSCNT_TOG (* ((volatile uint32_t *) (0x400A2000 + 0x12C)))
  4470. // Field (width: 16 bits): High speed packet number, used when USBPHY_USB1_LOOPBACK[TSTI_HSFS_MODE_EN] is set to value 1'b1.
  4471. inline uint32_t USBPHY_USB1_LOOPBACK_HSFSCNT_TOG_TSTI_HS_NUMBER (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  4472. // Field (width: 16 bits): Full speed packet number, used when USBPHY_USB1_LOOPBACK[TSTI_HSFS_MODE_EN] is set to value 1'b1.
  4473. inline uint32_t USBPHY_USB1_LOOPBACK_HSFSCNT_TOG_TSTI_FS_NUMBER (const uint32_t inValue) { return (inValue & 65535U) << 16 ; }
  4474. //-------------------- USB PHY Trim Override Enable Register
  4475. #define USBPHY_TRIM_OVERRIDE_EN (* ((volatile uint32_t *) (0x400A2000 + 0x130)))
  4476. // Boolean field: Override enable for PLL_DIV_SEL, when set, the register value in USBPHY_PLL_SIC[1:0] will be used.
  4477. static const uint32_t USBPHY_TRIM_OVERRIDE_EN_TRIM_DIV_SEL_OVERRIDE = 1U << 0 ;
  4478. // Boolean field: Override enable for ENV_TAIL_ADJ, when set, the register value in USBPHY_DEBUG1[14:13] will be used
  4479. static const uint32_t USBPHY_TRIM_OVERRIDE_EN_TRIM_ENV_TAIL_ADJ_VD_OVERRIDE = 1U << 1 ;
  4480. // Boolean field: Override enable for TX_D_CAL, when set, the register value in USBPHY_TX[3:0] will be used.
  4481. static const uint32_t USBPHY_TRIM_OVERRIDE_EN_TRIM_TX_D_CAL_OVERRIDE = 1U << 2 ;
  4482. // Boolean field: Override enable for TX_CAL45DP, when set, the register value in USBPHY_TX[19:16] will be used.
  4483. static const uint32_t USBPHY_TRIM_OVERRIDE_EN_TRIM_TX_CAL45DP_OVERRIDE = 1U << 3 ;
  4484. // Boolean field: Override enable for TX_CAL45DM, when set, the register value in USBPHY_TX[11:8] will be used.
  4485. static const uint32_t USBPHY_TRIM_OVERRIDE_EN_TRIM_TX_CAL45DM_OVERRIDE = 1U << 4 ;
  4486. // Field (width: 2 bits): IFR value of PLL_DIV_SEL.
  4487. inline uint32_t USBPHY_TRIM_OVERRIDE_EN_TRIM_PLL_CTRL0_DIV_SEL (const uint32_t inValue) { return (inValue & 3U) << 16 ; }
  4488. // Field (width: 2 bits): IFR value of ENV_TAIL_ADJ.
  4489. inline uint32_t USBPHY_TRIM_OVERRIDE_EN_TRIM_USB_REG_ENV_TAIL_ADJ_VD (const uint32_t inValue) { return (inValue & 3U) << 18 ; }
  4490. // Field (width: 4 bits): IFR value of TX_D_CAL.
  4491. inline uint32_t USBPHY_TRIM_OVERRIDE_EN_TRIM_USBPHY_TX_D_CAL (const uint32_t inValue) { return (inValue & 15U) << 20 ; }
  4492. // Field (width: 4 bits): IFR value of TX_CAL45DP.
  4493. inline uint32_t USBPHY_TRIM_OVERRIDE_EN_TRIM_USBPHY_TX_CAL45DP (const uint32_t inValue) { return (inValue & 15U) << 24 ; }
  4494. // Field (width: 4 bits): IFR value of TX_CAL45DM.
  4495. inline uint32_t USBPHY_TRIM_OVERRIDE_EN_TRIM_USBPHY_TX_CAL45DM (const uint32_t inValue) { return (inValue & 15U) << 28 ; }
  4496. //-------------------- USB PHY Trim Override Enable Register
  4497. #define USBPHY_TRIM_OVERRIDE_EN_SET (* ((volatile uint32_t *) (0x400A2000 + 0x134)))
  4498. // Boolean field: Override enable for PLL_DIV_SEL, when set, the register value in USBPHY_PLL_SIC[1:0] will be used.
  4499. static const uint32_t USBPHY_TRIM_OVERRIDE_EN_SET_TRIM_DIV_SEL_OVERRIDE = 1U << 0 ;
  4500. // Boolean field: Override enable for ENV_TAIL_ADJ, when set, the register value in USBPHY_DEBUG1[14:13] will be used
  4501. static const uint32_t USBPHY_TRIM_OVERRIDE_EN_SET_TRIM_ENV_TAIL_ADJ_VD_OVERRIDE = 1U << 1 ;
  4502. // Boolean field: Override enable for TX_D_CAL, when set, the register value in USBPHY_TX[3:0] will be used.
  4503. static const uint32_t USBPHY_TRIM_OVERRIDE_EN_SET_TRIM_TX_D_CAL_OVERRIDE = 1U << 2 ;
  4504. // Boolean field: Override enable for TX_CAL45DP, when set, the register value in USBPHY_TX[19:16] will be used.
  4505. static const uint32_t USBPHY_TRIM_OVERRIDE_EN_SET_TRIM_TX_CAL45DP_OVERRIDE = 1U << 3 ;
  4506. // Boolean field: Override enable for TX_CAL45DM, when set, the register value in USBPHY_TX[11:8] will be used.
  4507. static const uint32_t USBPHY_TRIM_OVERRIDE_EN_SET_TRIM_TX_CAL45DM_OVERRIDE = 1U << 4 ;
  4508. // Field (width: 2 bits): IFR value of PLL_DIV_SEL.
  4509. inline uint32_t USBPHY_TRIM_OVERRIDE_EN_SET_TRIM_PLL_CTRL0_DIV_SEL (const uint32_t inValue) { return (inValue & 3U) << 16 ; }
  4510. // Field (width: 2 bits): IFR value of ENV_TAIL_ADJ.
  4511. inline uint32_t USBPHY_TRIM_OVERRIDE_EN_SET_TRIM_USB_REG_ENV_TAIL_ADJ_VD (const uint32_t inValue) { return (inValue & 3U) << 18 ; }
  4512. // Field (width: 4 bits): IFR value of TX_D_CAL.
  4513. inline uint32_t USBPHY_TRIM_OVERRIDE_EN_SET_TRIM_USBPHY_TX_D_CAL (const uint32_t inValue) { return (inValue & 15U) << 20 ; }
  4514. // Field (width: 4 bits): IFR value of TX_CAL45DP.
  4515. inline uint32_t USBPHY_TRIM_OVERRIDE_EN_SET_TRIM_USBPHY_TX_CAL45DP (const uint32_t inValue) { return (inValue & 15U) << 24 ; }
  4516. // Field (width: 4 bits): IFR value of TX_CAL45DM.
  4517. inline uint32_t USBPHY_TRIM_OVERRIDE_EN_SET_TRIM_USBPHY_TX_CAL45DM (const uint32_t inValue) { return (inValue & 15U) << 28 ; }
  4518. //-------------------- USB PHY Trim Override Enable Register
  4519. #define USBPHY_TRIM_OVERRIDE_EN_CLR (* ((volatile uint32_t *) (0x400A2000 + 0x138)))
  4520. // Boolean field: Override enable for PLL_DIV_SEL, when set, the register value in USBPHY_PLL_SIC[1:0] will be used.
  4521. static const uint32_t USBPHY_TRIM_OVERRIDE_EN_CLR_TRIM_DIV_SEL_OVERRIDE = 1U << 0 ;
  4522. // Boolean field: Override enable for ENV_TAIL_ADJ, when set, the register value in USBPHY_DEBUG1[14:13] will be used
  4523. static const uint32_t USBPHY_TRIM_OVERRIDE_EN_CLR_TRIM_ENV_TAIL_ADJ_VD_OVERRIDE = 1U << 1 ;
  4524. // Boolean field: Override enable for TX_D_CAL, when set, the register value in USBPHY_TX[3:0] will be used.
  4525. static const uint32_t USBPHY_TRIM_OVERRIDE_EN_CLR_TRIM_TX_D_CAL_OVERRIDE = 1U << 2 ;
  4526. // Boolean field: Override enable for TX_CAL45DP, when set, the register value in USBPHY_TX[19:16] will be used.
  4527. static const uint32_t USBPHY_TRIM_OVERRIDE_EN_CLR_TRIM_TX_CAL45DP_OVERRIDE = 1U << 3 ;
  4528. // Boolean field: Override enable for TX_CAL45DM, when set, the register value in USBPHY_TX[11:8] will be used.
  4529. static const uint32_t USBPHY_TRIM_OVERRIDE_EN_CLR_TRIM_TX_CAL45DM_OVERRIDE = 1U << 4 ;
  4530. // Field (width: 2 bits): IFR value of PLL_DIV_SEL.
  4531. inline uint32_t USBPHY_TRIM_OVERRIDE_EN_CLR_TRIM_PLL_CTRL0_DIV_SEL (const uint32_t inValue) { return (inValue & 3U) << 16 ; }
  4532. // Field (width: 2 bits): IFR value of ENV_TAIL_ADJ.
  4533. inline uint32_t USBPHY_TRIM_OVERRIDE_EN_CLR_TRIM_USB_REG_ENV_TAIL_ADJ_VD (const uint32_t inValue) { return (inValue & 3U) << 18 ; }
  4534. // Field (width: 4 bits): IFR value of TX_D_CAL.
  4535. inline uint32_t USBPHY_TRIM_OVERRIDE_EN_CLR_TRIM_USBPHY_TX_D_CAL (const uint32_t inValue) { return (inValue & 15U) << 20 ; }
  4536. // Field (width: 4 bits): IFR value of TX_CAL45DP.
  4537. inline uint32_t USBPHY_TRIM_OVERRIDE_EN_CLR_TRIM_USBPHY_TX_CAL45DP (const uint32_t inValue) { return (inValue & 15U) << 24 ; }
  4538. // Field (width: 4 bits): IFR value of TX_CAL45DM.
  4539. inline uint32_t USBPHY_TRIM_OVERRIDE_EN_CLR_TRIM_USBPHY_TX_CAL45DM (const uint32_t inValue) { return (inValue & 15U) << 28 ; }
  4540. //-------------------- USB PHY Trim Override Enable Register
  4541. #define USBPHY_TRIM_OVERRIDE_EN_TOG (* ((volatile uint32_t *) (0x400A2000 + 0x13C)))
  4542. // Boolean field: Override enable for PLL_DIV_SEL, when set, the register value in USBPHY_PLL_SIC[1:0] will be used.
  4543. static const uint32_t USBPHY_TRIM_OVERRIDE_EN_TOG_TRIM_DIV_SEL_OVERRIDE = 1U << 0 ;
  4544. // Boolean field: Override enable for ENV_TAIL_ADJ, when set, the register value in USBPHY_DEBUG1[14:13] will be used
  4545. static const uint32_t USBPHY_TRIM_OVERRIDE_EN_TOG_TRIM_ENV_TAIL_ADJ_VD_OVERRIDE = 1U << 1 ;
  4546. // Boolean field: Override enable for TX_D_CAL, when set, the register value in USBPHY_TX[3:0] will be used.
  4547. static const uint32_t USBPHY_TRIM_OVERRIDE_EN_TOG_TRIM_TX_D_CAL_OVERRIDE = 1U << 2 ;
  4548. // Boolean field: Override enable for TX_CAL45DP, when set, the register value in USBPHY_TX[19:16] will be used.
  4549. static const uint32_t USBPHY_TRIM_OVERRIDE_EN_TOG_TRIM_TX_CAL45DP_OVERRIDE = 1U << 3 ;
  4550. // Boolean field: Override enable for TX_CAL45DM, when set, the register value in USBPHY_TX[11:8] will be used.
  4551. static const uint32_t USBPHY_TRIM_OVERRIDE_EN_TOG_TRIM_TX_CAL45DM_OVERRIDE = 1U << 4 ;
  4552. // Field (width: 2 bits): IFR value of PLL_DIV_SEL.
  4553. inline uint32_t USBPHY_TRIM_OVERRIDE_EN_TOG_TRIM_PLL_CTRL0_DIV_SEL (const uint32_t inValue) { return (inValue & 3U) << 16 ; }
  4554. // Field (width: 2 bits): IFR value of ENV_TAIL_ADJ.
  4555. inline uint32_t USBPHY_TRIM_OVERRIDE_EN_TOG_TRIM_USB_REG_ENV_TAIL_ADJ_VD (const uint32_t inValue) { return (inValue & 3U) << 18 ; }
  4556. // Field (width: 4 bits): IFR value of TX_D_CAL.
  4557. inline uint32_t USBPHY_TRIM_OVERRIDE_EN_TOG_TRIM_USBPHY_TX_D_CAL (const uint32_t inValue) { return (inValue & 15U) << 20 ; }
  4558. // Field (width: 4 bits): IFR value of TX_CAL45DP.
  4559. inline uint32_t USBPHY_TRIM_OVERRIDE_EN_TOG_TRIM_USBPHY_TX_CAL45DP (const uint32_t inValue) { return (inValue & 15U) << 24 ; }
  4560. // Field (width: 4 bits): IFR value of TX_CAL45DM.
  4561. inline uint32_t USBPHY_TRIM_OVERRIDE_EN_TOG_TRIM_USBPHY_TX_CAL45DM (const uint32_t inValue) { return (inValue & 15U) << 28 ; }
  4562. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  4563. // Peripheral USBHSDCD
  4564. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  4565. //-------------------- Control register
  4566. #define USBHSDCD_CONTROL (* ((volatile uint32_t *) (0x400A3000 + 0)))
  4567. // Boolean field: Interrupt Acknowledge
  4568. static const uint32_t USBHSDCD_CONTROL_IACK = 1U << 0 ;
  4569. // Boolean field: Interrupt Flag
  4570. static const uint32_t USBHSDCD_CONTROL_IF = 1U << 8 ;
  4571. // Boolean field: Interrupt Enable
  4572. static const uint32_t USBHSDCD_CONTROL_IE = 1U << 16 ;
  4573. // Boolean field: BC1.2 compatibility. This bit cannot be changed after start detection.
  4574. static const uint32_t USBHSDCD_CONTROL_BC12 = 1U << 17 ;
  4575. // Boolean field: Start Change Detection Sequence
  4576. static const uint32_t USBHSDCD_CONTROL_START = 1U << 24 ;
  4577. // Boolean field: Software Reset
  4578. static const uint32_t USBHSDCD_CONTROL_SR = 1U << 25 ;
  4579. //-------------------- Clock register
  4580. #define USBHSDCD_CLOCK (* ((volatile uint32_t *) (0x400A3000 + 0x4)))
  4581. // Boolean field: Unit of Measurement Encoding for Clock Speed
  4582. static const uint32_t USBHSDCD_CLOCK_CLOCK_UNIT = 1U << 0 ;
  4583. // Field (width: 10 bits): Numerical Value of Clock Speed in Binary
  4584. inline uint32_t USBHSDCD_CLOCK_CLOCK_SPEED (const uint32_t inValue) { return (inValue & 1023U) << 2 ; }
  4585. //-------------------- Status register
  4586. #define USBHSDCD_STATUS (* ((const volatile uint32_t *) (0x400A3000 + 0x8)))
  4587. // Field (width: 2 bits): Charger Detection Sequence Results
  4588. inline uint32_t USBHSDCD_STATUS_SEQ_RES (const uint32_t inValue) { return (inValue & 3U) << 16 ; }
  4589. // Field (width: 2 bits): Charger Detection Sequence Status
  4590. inline uint32_t USBHSDCD_STATUS_SEQ_STAT (const uint32_t inValue) { return (inValue & 3U) << 18 ; }
  4591. // Boolean field: Error Flag
  4592. static const uint32_t USBHSDCD_STATUS_ERR = 1U << 20 ;
  4593. // Boolean field: Timeout Flag
  4594. static const uint32_t USBHSDCD_STATUS_TO = 1U << 21 ;
  4595. // Boolean field: Active Status Indicator
  4596. static const uint32_t USBHSDCD_STATUS_ACTIVE = 1U << 22 ;
  4597. //-------------------- Signal Override Register
  4598. #define USBHSDCD_SIGNAL_OVERRIDE (* ((volatile uint32_t *) (0x400A3000 + 0xC)))
  4599. // Field (width: 2 bits): Phase Selection
  4600. inline uint32_t USBHSDCD_SIGNAL_OVERRIDE_PS (const uint32_t inValue) { return (inValue & 3U) << 0 ; }
  4601. //-------------------- TIMER0 register
  4602. #define USBHSDCD_TIMER0 (* ((volatile uint32_t *) (0x400A3000 + 0x10)))
  4603. // Field (width: 12 bits): Unit Connection Timer Elapse (in ms)
  4604. inline uint32_t USBHSDCD_TIMER0_TUNITCON (const uint32_t inValue) { return (inValue & 4095U) << 0 ; }
  4605. // Field (width: 10 bits): Sequence Initiation Time
  4606. inline uint32_t USBHSDCD_TIMER0_TSEQ_INIT (const uint32_t inValue) { return (inValue & 1023U) << 16 ; }
  4607. //-------------------- TIMER1 register
  4608. #define USBHSDCD_TIMER1 (* ((volatile uint32_t *) (0x400A3000 + 0x14)))
  4609. // Field (width: 10 bits): Time Period Comparator Enabled
  4610. inline uint32_t USBHSDCD_TIMER1_TVDPSRC_ON (const uint32_t inValue) { return (inValue & 1023U) << 0 ; }
  4611. // Field (width: 10 bits): Time Period to Debounce D+ Signal
  4612. inline uint32_t USBHSDCD_TIMER1_TDCD_DBNC (const uint32_t inValue) { return (inValue & 1023U) << 16 ; }
  4613. //-------------------- TIMER2_BC11 register
  4614. #define USBHSDCD_TIMER2_BC11 (* ((volatile uint32_t *) (0x400A3000 + 0x18)))
  4615. // Field (width: 4 bits): Time Before Check of D- Line
  4616. inline uint32_t USBHSDCD_TIMER2_BC11_CHECK_DM (const uint32_t inValue) { return (inValue & 15U) << 0 ; }
  4617. // Field (width: 10 bits): Time Period Before Enabling D+ Pullup
  4618. inline uint32_t USBHSDCD_TIMER2_BC11_TVDPSRC_CON (const uint32_t inValue) { return (inValue & 1023U) << 16 ; }
  4619. //-------------------- TIMER2_BC12 register
  4620. #define USBHSDCD_TIMER2_BC12 (* ((volatile uint32_t *) (0x400A3000 + 0x18)))
  4621. // Field (width: 10 bits): Sets the amount of time (in ms) that the module enables the VDM_SRC. Valid values are 0-40ms.
  4622. inline uint32_t USBHSDCD_TIMER2_BC12_TVDMSRC_ON (const uint32_t inValue) { return (inValue & 1023U) << 0 ; }
  4623. // Field (width: 10 bits): Sets the amount of time (in ms) that the module waits after primary detection before start to secondary detection
  4624. inline uint32_t USBHSDCD_TIMER2_BC12_TWAIT_AFTER_PRD (const uint32_t inValue) { return (inValue & 1023U) << 16 ; }
  4625. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  4626. // Peripheral SDHC
  4627. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  4628. //-------------------- DMA System Address register
  4629. #define SDHC_DSADDR (* ((volatile uint32_t *) (0x400B1000 + 0)))
  4630. // Field (width: 30 bits): DMA System Address
  4631. inline uint32_t SDHC_DSADDR_DSADDR (const uint32_t inValue) { return (inValue & 1073741823U) << 2 ; }
  4632. //-------------------- Block Attributes register
  4633. #define SDHC_BLKATTR (* ((volatile uint32_t *) (0x400B1000 + 0x4)))
  4634. // Field (width: 13 bits): Transfer Block Size
  4635. inline uint32_t SDHC_BLKATTR_BLKSIZE (const uint32_t inValue) { return (inValue & 8191U) << 0 ; }
  4636. // Field (width: 16 bits): Blocks Count For Current Transfer
  4637. inline uint32_t SDHC_BLKATTR_BLKCNT (const uint32_t inValue) { return (inValue & 65535U) << 16 ; }
  4638. //-------------------- Command Argument register
  4639. #define SDHC_CMDARG (* ((volatile uint32_t *) (0x400B1000 + 0x8)))
  4640. //-------------------- Transfer Type register
  4641. #define SDHC_XFERTYP (* ((volatile uint32_t *) (0x400B1000 + 0xC)))
  4642. // Boolean field: DMA Enable
  4643. static const uint32_t SDHC_XFERTYP_DMAEN = 1U << 0 ;
  4644. // Boolean field: Block Count Enable
  4645. static const uint32_t SDHC_XFERTYP_BCEN = 1U << 1 ;
  4646. // Boolean field: Auto CMD12 Enable
  4647. static const uint32_t SDHC_XFERTYP_AC12EN = 1U << 2 ;
  4648. // Boolean field: Data Transfer Direction Select
  4649. static const uint32_t SDHC_XFERTYP_DTDSEL = 1U << 4 ;
  4650. // Boolean field: Multi/Single Block Select
  4651. static const uint32_t SDHC_XFERTYP_MSBSEL = 1U << 5 ;
  4652. // Field (width: 2 bits): Response Type Select
  4653. inline uint32_t SDHC_XFERTYP_RSPTYP (const uint32_t inValue) { return (inValue & 3U) << 16 ; }
  4654. // Boolean field: Command CRC Check Enable
  4655. static const uint32_t SDHC_XFERTYP_CCCEN = 1U << 19 ;
  4656. // Boolean field: Command Index Check Enable
  4657. static const uint32_t SDHC_XFERTYP_CICEN = 1U << 20 ;
  4658. // Boolean field: Data Present Select
  4659. static const uint32_t SDHC_XFERTYP_DPSEL = 1U << 21 ;
  4660. // Field (width: 2 bits): Command Type
  4661. inline uint32_t SDHC_XFERTYP_CMDTYP (const uint32_t inValue) { return (inValue & 3U) << 22 ; }
  4662. // Field (width: 6 bits): Command Index
  4663. inline uint32_t SDHC_XFERTYP_CMDINX (const uint32_t inValue) { return (inValue & 63U) << 24 ; }
  4664. //-------------------- Command Response 0
  4665. #define SDHC_CMDRSP0 (* ((const volatile uint32_t *) (0x400B1000 + 0x10)))
  4666. //-------------------- Command Response 1
  4667. #define SDHC_CMDRSP1 (* ((const volatile uint32_t *) (0x400B1000 + 0x14)))
  4668. //-------------------- Command Response 2
  4669. #define SDHC_CMDRSP2 (* ((const volatile uint32_t *) (0x400B1000 + 0x18)))
  4670. //-------------------- Command Response 3
  4671. #define SDHC_CMDRSP3 (* ((const volatile uint32_t *) (0x400B1000 + 0x1C)))
  4672. //-------------------- Buffer Data Port register
  4673. #define SDHC_DATPORT (* ((volatile uint32_t *) (0x400B1000 + 0x20)))
  4674. //-------------------- Present State register
  4675. #define SDHC_PRSSTAT (* ((const volatile uint32_t *) (0x400B1000 + 0x24)))
  4676. // Boolean field: Command Inhibit (CMD)
  4677. static const uint32_t SDHC_PRSSTAT_CIHB = 1U << 0 ;
  4678. // Boolean field: Command Inhibit (DAT)
  4679. static const uint32_t SDHC_PRSSTAT_CDIHB = 1U << 1 ;
  4680. // Boolean field: Data Line Active
  4681. static const uint32_t SDHC_PRSSTAT_DLA = 1U << 2 ;
  4682. // Boolean field: SD Clock Stable
  4683. static const uint32_t SDHC_PRSSTAT_SDSTB = 1U << 3 ;
  4684. // Boolean field: Bus Clock Gated Off Internally
  4685. static const uint32_t SDHC_PRSSTAT_IPGOFF = 1U << 4 ;
  4686. // Boolean field: System Clock Gated Off Internally
  4687. static const uint32_t SDHC_PRSSTAT_HCKOFF = 1U << 5 ;
  4688. // Boolean field: SDHC clock Gated Off Internally
  4689. static const uint32_t SDHC_PRSSTAT_PEROFF = 1U << 6 ;
  4690. // Boolean field: SD Clock Gated Off Internally
  4691. static const uint32_t SDHC_PRSSTAT_SDOFF = 1U << 7 ;
  4692. // Boolean field: Write Transfer Active
  4693. static const uint32_t SDHC_PRSSTAT_WTA = 1U << 8 ;
  4694. // Boolean field: Read Transfer Active
  4695. static const uint32_t SDHC_PRSSTAT_RTA = 1U << 9 ;
  4696. // Boolean field: Buffer Write Enable
  4697. static const uint32_t SDHC_PRSSTAT_BWEN = 1U << 10 ;
  4698. // Boolean field: Buffer Read Enable
  4699. static const uint32_t SDHC_PRSSTAT_BREN = 1U << 11 ;
  4700. // Boolean field: Card Inserted
  4701. static const uint32_t SDHC_PRSSTAT_CINS = 1U << 16 ;
  4702. // Boolean field: CMD Line Signal Level
  4703. static const uint32_t SDHC_PRSSTAT_CLSL = 1U << 23 ;
  4704. // Field (width: 8 bits): DAT Line Signal Level
  4705. inline uint32_t SDHC_PRSSTAT_DLSL (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  4706. //-------------------- Protocol Control register
  4707. #define SDHC_PROCTL (* ((volatile uint32_t *) (0x400B1000 + 0x28)))
  4708. // Boolean field: LED Control
  4709. static const uint32_t SDHC_PROCTL_LCTL = 1U << 0 ;
  4710. // Field (width: 2 bits): Data Transfer Width
  4711. inline uint32_t SDHC_PROCTL_DTW (const uint32_t inValue) { return (inValue & 3U) << 1 ; }
  4712. // Boolean field: DAT3 As Card Detection Pin
  4713. static const uint32_t SDHC_PROCTL_D3CD = 1U << 3 ;
  4714. // Field (width: 2 bits): Endian Mode
  4715. inline uint32_t SDHC_PROCTL_EMODE (const uint32_t inValue) { return (inValue & 3U) << 4 ; }
  4716. // Boolean field: Card Detect Test Level
  4717. static const uint32_t SDHC_PROCTL_CDTL = 1U << 6 ;
  4718. // Boolean field: Card Detect Signal Selection
  4719. static const uint32_t SDHC_PROCTL_CDSS = 1U << 7 ;
  4720. // Field (width: 2 bits): DMA Select
  4721. inline uint32_t SDHC_PROCTL_DMAS (const uint32_t inValue) { return (inValue & 3U) << 8 ; }
  4722. // Boolean field: Stop At Block Gap Request
  4723. static const uint32_t SDHC_PROCTL_SABGREQ = 1U << 16 ;
  4724. // Boolean field: Continue Request
  4725. static const uint32_t SDHC_PROCTL_CREQ = 1U << 17 ;
  4726. // Boolean field: Read Wait Control
  4727. static const uint32_t SDHC_PROCTL_RWCTL = 1U << 18 ;
  4728. // Boolean field: Interrupt At Block Gap
  4729. static const uint32_t SDHC_PROCTL_IABG = 1U << 19 ;
  4730. // Boolean field: Wakeup Event Enable On Card Interrupt
  4731. static const uint32_t SDHC_PROCTL_WECINT = 1U << 24 ;
  4732. // Boolean field: Wakeup Event Enable On SD Card Insertion
  4733. static const uint32_t SDHC_PROCTL_WECINS = 1U << 25 ;
  4734. // Boolean field: Wakeup Event Enable On SD Card Removal
  4735. static const uint32_t SDHC_PROCTL_WECRM = 1U << 26 ;
  4736. //-------------------- System Control register
  4737. #define SDHC_SYSCTL (* ((volatile uint32_t *) (0x400B1000 + 0x2C)))
  4738. // Boolean field: IPG Clock Enable
  4739. static const uint32_t SDHC_SYSCTL_IPGEN = 1U << 0 ;
  4740. // Boolean field: System Clock Enable
  4741. static const uint32_t SDHC_SYSCTL_HCKEN = 1U << 1 ;
  4742. // Boolean field: Peripheral Clock Enable
  4743. static const uint32_t SDHC_SYSCTL_PEREN = 1U << 2 ;
  4744. // Boolean field: SD Clock Enable
  4745. static const uint32_t SDHC_SYSCTL_SDCLKEN = 1U << 3 ;
  4746. // Field (width: 4 bits): Divisor
  4747. inline uint32_t SDHC_SYSCTL_DVS (const uint32_t inValue) { return (inValue & 15U) << 4 ; }
  4748. // Field (width: 8 bits): SDCLK Frequency Select
  4749. inline uint32_t SDHC_SYSCTL_SDCLKFS (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  4750. // Field (width: 4 bits): Data Timeout Counter Value
  4751. inline uint32_t SDHC_SYSCTL_DTOCV (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  4752. // Boolean field: Software Reset For ALL
  4753. static const uint32_t SDHC_SYSCTL_RSTA = 1U << 24 ;
  4754. // Boolean field: Software Reset For CMD Line
  4755. static const uint32_t SDHC_SYSCTL_RSTC = 1U << 25 ;
  4756. // Boolean field: Software Reset For DAT Line
  4757. static const uint32_t SDHC_SYSCTL_RSTD = 1U << 26 ;
  4758. // Boolean field: Initialization Active
  4759. static const uint32_t SDHC_SYSCTL_INITA = 1U << 27 ;
  4760. //-------------------- Interrupt Status register
  4761. #define SDHC_IRQSTAT (* ((volatile uint32_t *) (0x400B1000 + 0x30)))
  4762. // Boolean field: Command Complete
  4763. static const uint32_t SDHC_IRQSTAT_CC = 1U << 0 ;
  4764. // Boolean field: Transfer Complete
  4765. static const uint32_t SDHC_IRQSTAT_TC = 1U << 1 ;
  4766. // Boolean field: Block Gap Event
  4767. static const uint32_t SDHC_IRQSTAT_BGE = 1U << 2 ;
  4768. // Boolean field: DMA Interrupt
  4769. static const uint32_t SDHC_IRQSTAT_DINT = 1U << 3 ;
  4770. // Boolean field: Buffer Write Ready
  4771. static const uint32_t SDHC_IRQSTAT_BWR = 1U << 4 ;
  4772. // Boolean field: Buffer Read Ready
  4773. static const uint32_t SDHC_IRQSTAT_BRR = 1U << 5 ;
  4774. // Boolean field: Card Insertion
  4775. static const uint32_t SDHC_IRQSTAT_CINS = 1U << 6 ;
  4776. // Boolean field: Card Removal
  4777. static const uint32_t SDHC_IRQSTAT_CRM = 1U << 7 ;
  4778. // Boolean field: Card Interrupt
  4779. static const uint32_t SDHC_IRQSTAT_CINT = 1U << 8 ;
  4780. // Boolean field: Command Timeout Error
  4781. static const uint32_t SDHC_IRQSTAT_CTOE = 1U << 16 ;
  4782. // Boolean field: Command CRC Error
  4783. static const uint32_t SDHC_IRQSTAT_CCE = 1U << 17 ;
  4784. // Boolean field: Command End Bit Error
  4785. static const uint32_t SDHC_IRQSTAT_CEBE = 1U << 18 ;
  4786. // Boolean field: Command Index Error
  4787. static const uint32_t SDHC_IRQSTAT_CIE = 1U << 19 ;
  4788. // Boolean field: Data Timeout Error
  4789. static const uint32_t SDHC_IRQSTAT_DTOE = 1U << 20 ;
  4790. // Boolean field: Data CRC Error
  4791. static const uint32_t SDHC_IRQSTAT_DCE = 1U << 21 ;
  4792. // Boolean field: Data End Bit Error
  4793. static const uint32_t SDHC_IRQSTAT_DEBE = 1U << 22 ;
  4794. // Boolean field: Auto CMD12 Error
  4795. static const uint32_t SDHC_IRQSTAT_AC12E = 1U << 24 ;
  4796. // Boolean field: DMA Error
  4797. static const uint32_t SDHC_IRQSTAT_DMAE = 1U << 28 ;
  4798. //-------------------- Interrupt Status Enable register
  4799. #define SDHC_IRQSTATEN (* ((volatile uint32_t *) (0x400B1000 + 0x34)))
  4800. // Boolean field: Command Complete Status Enable
  4801. static const uint32_t SDHC_IRQSTATEN_CCSEN = 1U << 0 ;
  4802. // Boolean field: Transfer Complete Status Enable
  4803. static const uint32_t SDHC_IRQSTATEN_TCSEN = 1U << 1 ;
  4804. // Boolean field: Block Gap Event Status Enable
  4805. static const uint32_t SDHC_IRQSTATEN_BGESEN = 1U << 2 ;
  4806. // Boolean field: DMA Interrupt Status Enable
  4807. static const uint32_t SDHC_IRQSTATEN_DINTSEN = 1U << 3 ;
  4808. // Boolean field: Buffer Write Ready Status Enable
  4809. static const uint32_t SDHC_IRQSTATEN_BWRSEN = 1U << 4 ;
  4810. // Boolean field: Buffer Read Ready Status Enable
  4811. static const uint32_t SDHC_IRQSTATEN_BRRSEN = 1U << 5 ;
  4812. // Boolean field: Card Insertion Status Enable
  4813. static const uint32_t SDHC_IRQSTATEN_CINSEN = 1U << 6 ;
  4814. // Boolean field: Card Removal Status Enable
  4815. static const uint32_t SDHC_IRQSTATEN_CRMSEN = 1U << 7 ;
  4816. // Boolean field: Card Interrupt Status Enable
  4817. static const uint32_t SDHC_IRQSTATEN_CINTSEN = 1U << 8 ;
  4818. // Boolean field: Command Timeout Error Status Enable
  4819. static const uint32_t SDHC_IRQSTATEN_CTOESEN = 1U << 16 ;
  4820. // Boolean field: Command CRC Error Status Enable
  4821. static const uint32_t SDHC_IRQSTATEN_CCESEN = 1U << 17 ;
  4822. // Boolean field: Command End Bit Error Status Enable
  4823. static const uint32_t SDHC_IRQSTATEN_CEBESEN = 1U << 18 ;
  4824. // Boolean field: Command Index Error Status Enable
  4825. static const uint32_t SDHC_IRQSTATEN_CIESEN = 1U << 19 ;
  4826. // Boolean field: Data Timeout Error Status Enable
  4827. static const uint32_t SDHC_IRQSTATEN_DTOESEN = 1U << 20 ;
  4828. // Boolean field: Data CRC Error Status Enable
  4829. static const uint32_t SDHC_IRQSTATEN_DCESEN = 1U << 21 ;
  4830. // Boolean field: Data End Bit Error Status Enable
  4831. static const uint32_t SDHC_IRQSTATEN_DEBESEN = 1U << 22 ;
  4832. // Boolean field: Auto CMD12 Error Status Enable
  4833. static const uint32_t SDHC_IRQSTATEN_AC12ESEN = 1U << 24 ;
  4834. // Boolean field: DMA Error Status Enable
  4835. static const uint32_t SDHC_IRQSTATEN_DMAESEN = 1U << 28 ;
  4836. //-------------------- Interrupt Signal Enable register
  4837. #define SDHC_IRQSIGEN (* ((volatile uint32_t *) (0x400B1000 + 0x38)))
  4838. // Boolean field: Command Complete Interrupt Enable
  4839. static const uint32_t SDHC_IRQSIGEN_CCIEN = 1U << 0 ;
  4840. // Boolean field: Transfer Complete Interrupt Enable
  4841. static const uint32_t SDHC_IRQSIGEN_TCIEN = 1U << 1 ;
  4842. // Boolean field: Block Gap Event Interrupt Enable
  4843. static const uint32_t SDHC_IRQSIGEN_BGEIEN = 1U << 2 ;
  4844. // Boolean field: DMA Interrupt Enable
  4845. static const uint32_t SDHC_IRQSIGEN_DINTIEN = 1U << 3 ;
  4846. // Boolean field: Buffer Write Ready Interrupt Enable
  4847. static const uint32_t SDHC_IRQSIGEN_BWRIEN = 1U << 4 ;
  4848. // Boolean field: Buffer Read Ready Interrupt Enable
  4849. static const uint32_t SDHC_IRQSIGEN_BRRIEN = 1U << 5 ;
  4850. // Boolean field: Card Insertion Interrupt Enable
  4851. static const uint32_t SDHC_IRQSIGEN_CINSIEN = 1U << 6 ;
  4852. // Boolean field: Card Removal Interrupt Enable
  4853. static const uint32_t SDHC_IRQSIGEN_CRMIEN = 1U << 7 ;
  4854. // Boolean field: Card Interrupt Enable
  4855. static const uint32_t SDHC_IRQSIGEN_CINTIEN = 1U << 8 ;
  4856. // Boolean field: Command Timeout Error Interrupt Enable
  4857. static const uint32_t SDHC_IRQSIGEN_CTOEIEN = 1U << 16 ;
  4858. // Boolean field: Command CRC Error Interrupt Enable
  4859. static const uint32_t SDHC_IRQSIGEN_CCEIEN = 1U << 17 ;
  4860. // Boolean field: Command End Bit Error Interrupt Enable
  4861. static const uint32_t SDHC_IRQSIGEN_CEBEIEN = 1U << 18 ;
  4862. // Boolean field: Command Index Error Interrupt Enable
  4863. static const uint32_t SDHC_IRQSIGEN_CIEIEN = 1U << 19 ;
  4864. // Boolean field: Data Timeout Error Interrupt Enable
  4865. static const uint32_t SDHC_IRQSIGEN_DTOEIEN = 1U << 20 ;
  4866. // Boolean field: Data CRC Error Interrupt Enable
  4867. static const uint32_t SDHC_IRQSIGEN_DCEIEN = 1U << 21 ;
  4868. // Boolean field: Data End Bit Error Interrupt Enable
  4869. static const uint32_t SDHC_IRQSIGEN_DEBEIEN = 1U << 22 ;
  4870. // Boolean field: Auto CMD12 Error Interrupt Enable
  4871. static const uint32_t SDHC_IRQSIGEN_AC12EIEN = 1U << 24 ;
  4872. // Boolean field: DMA Error Interrupt Enable
  4873. static const uint32_t SDHC_IRQSIGEN_DMAEIEN = 1U << 28 ;
  4874. //-------------------- Auto CMD12 Error Status Register
  4875. #define SDHC_AC12ERR (* ((const volatile uint32_t *) (0x400B1000 + 0x3C)))
  4876. // Boolean field: Auto CMD12 Not Executed
  4877. static const uint32_t SDHC_AC12ERR_AC12NE = 1U << 0 ;
  4878. // Boolean field: Auto CMD12 Timeout Error
  4879. static const uint32_t SDHC_AC12ERR_AC12TOE = 1U << 1 ;
  4880. // Boolean field: Auto CMD12 End Bit Error
  4881. static const uint32_t SDHC_AC12ERR_AC12EBE = 1U << 2 ;
  4882. // Boolean field: Auto CMD12 CRC Error
  4883. static const uint32_t SDHC_AC12ERR_AC12CE = 1U << 3 ;
  4884. // Boolean field: Auto CMD12 Index Error
  4885. static const uint32_t SDHC_AC12ERR_AC12IE = 1U << 4 ;
  4886. // Boolean field: Command Not Issued By Auto CMD12 Error
  4887. static const uint32_t SDHC_AC12ERR_CNIBAC12E = 1U << 7 ;
  4888. //-------------------- Host Controller Capabilities
  4889. #define SDHC_HTCAPBLT (* ((const volatile uint32_t *) (0x400B1000 + 0x40)))
  4890. // Field (width: 3 bits): Max Block Length
  4891. inline uint32_t SDHC_HTCAPBLT_MBL (const uint32_t inValue) { return (inValue & 7U) << 16 ; }
  4892. // Boolean field: ADMA Support
  4893. static const uint32_t SDHC_HTCAPBLT_ADMAS = 1U << 20 ;
  4894. // Boolean field: High Speed Support
  4895. static const uint32_t SDHC_HTCAPBLT_HSS = 1U << 21 ;
  4896. // Boolean field: DMA Support
  4897. static const uint32_t SDHC_HTCAPBLT_DMAS = 1U << 22 ;
  4898. // Boolean field: Suspend/Resume Support
  4899. static const uint32_t SDHC_HTCAPBLT_SRS = 1U << 23 ;
  4900. // Boolean field: Voltage Support 3.3 V
  4901. static const uint32_t SDHC_HTCAPBLT_VS33 = 1U << 24 ;
  4902. //-------------------- Watermark Level Register
  4903. #define SDHC_WML (* ((volatile uint32_t *) (0x400B1000 + 0x44)))
  4904. // Field (width: 8 bits): Read Watermark Level
  4905. inline uint32_t SDHC_WML_RDWML (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  4906. // Field (width: 8 bits): Write Watermark Level
  4907. inline uint32_t SDHC_WML_WRWML (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  4908. //-------------------- Force Event register
  4909. #define SDHC_FEVT (* ((volatile uint32_t *) (0x400B1000 + 0x50)))
  4910. // Boolean field: Force Event Auto Command 12 Not Executed
  4911. static const uint32_t SDHC_FEVT_AC12NE = 1U << 0 ;
  4912. // Boolean field: Force Event Auto Command 12 Time Out Error
  4913. static const uint32_t SDHC_FEVT_AC12TOE = 1U << 1 ;
  4914. // Boolean field: Force Event Auto Command 12 CRC Error
  4915. static const uint32_t SDHC_FEVT_AC12CE = 1U << 2 ;
  4916. // Boolean field: Force Event Auto Command 12 End Bit Error
  4917. static const uint32_t SDHC_FEVT_AC12EBE = 1U << 3 ;
  4918. // Boolean field: Force Event Auto Command 12 Index Error
  4919. static const uint32_t SDHC_FEVT_AC12IE = 1U << 4 ;
  4920. // Boolean field: Force Event Command Not Executed By Auto Command 12 Error
  4921. static const uint32_t SDHC_FEVT_CNIBAC12E = 1U << 7 ;
  4922. // Boolean field: Force Event Command Time Out Error
  4923. static const uint32_t SDHC_FEVT_CTOE = 1U << 16 ;
  4924. // Boolean field: Force Event Command CRC Error
  4925. static const uint32_t SDHC_FEVT_CCE = 1U << 17 ;
  4926. // Boolean field: Force Event Command End Bit Error
  4927. static const uint32_t SDHC_FEVT_CEBE = 1U << 18 ;
  4928. // Boolean field: Force Event Command Index Error
  4929. static const uint32_t SDHC_FEVT_CIE = 1U << 19 ;
  4930. // Boolean field: Force Event Data Time Out Error
  4931. static const uint32_t SDHC_FEVT_DTOE = 1U << 20 ;
  4932. // Boolean field: Force Event Data CRC Error
  4933. static const uint32_t SDHC_FEVT_DCE = 1U << 21 ;
  4934. // Boolean field: Force Event Data End Bit Error
  4935. static const uint32_t SDHC_FEVT_DEBE = 1U << 22 ;
  4936. // Boolean field: Force Event Auto Command 12 Error
  4937. static const uint32_t SDHC_FEVT_AC12E = 1U << 24 ;
  4938. // Boolean field: Force Event DMA Error
  4939. static const uint32_t SDHC_FEVT_DMAE = 1U << 28 ;
  4940. // Boolean field: Force Event Card Interrupt
  4941. static const uint32_t SDHC_FEVT_CINT = 1U << 31 ;
  4942. //-------------------- ADMA Error Status register
  4943. #define SDHC_ADMAES (* ((const volatile uint32_t *) (0x400B1000 + 0x54)))
  4944. // Field (width: 2 bits): ADMA Error State (When ADMA Error Is Occurred.)
  4945. inline uint32_t SDHC_ADMAES_ADMAES (const uint32_t inValue) { return (inValue & 3U) << 0 ; }
  4946. // Boolean field: ADMA Length Mismatch Error
  4947. static const uint32_t SDHC_ADMAES_ADMALME = 1U << 2 ;
  4948. // Boolean field: ADMA Descriptor Error
  4949. static const uint32_t SDHC_ADMAES_ADMADCE = 1U << 3 ;
  4950. //-------------------- ADMA System Addressregister
  4951. #define SDHC_ADSADDR (* ((volatile uint32_t *) (0x400B1000 + 0x58)))
  4952. // Field (width: 30 bits): ADMA System Address
  4953. inline uint32_t SDHC_ADSADDR_ADSADDR (const uint32_t inValue) { return (inValue & 1073741823U) << 2 ; }
  4954. //-------------------- Vendor Specific register
  4955. #define SDHC_VENDOR (* ((volatile uint32_t *) (0x400B1000 + 0xC0)))
  4956. // Boolean field: Exact Block Number Block Read Enable For SDIO CMD53
  4957. static const uint32_t SDHC_VENDOR_EXBLKNU = 1U << 1 ;
  4958. // Field (width: 8 bits): Internal State Value
  4959. inline uint32_t SDHC_VENDOR_INTSTVAL (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  4960. //-------------------- MMC Boot register
  4961. #define SDHC_MMCBOOT (* ((volatile uint32_t *) (0x400B1000 + 0xC4)))
  4962. // Field (width: 4 bits): Boot ACK Time Out Counter Value
  4963. inline uint32_t SDHC_MMCBOOT_DTOCVACK (const uint32_t inValue) { return (inValue & 15U) << 0 ; }
  4964. // Boolean field: Boot Ack Mode Select
  4965. static const uint32_t SDHC_MMCBOOT_BOOTACK = 1U << 4 ;
  4966. // Boolean field: Boot Mode Select
  4967. static const uint32_t SDHC_MMCBOOT_BOOTMODE = 1U << 5 ;
  4968. // Boolean field: Boot Mode Enable
  4969. static const uint32_t SDHC_MMCBOOT_BOOTEN = 1U << 6 ;
  4970. // Boolean field: When boot, enable auto stop at block gap function
  4971. static const uint32_t SDHC_MMCBOOT_AUTOSABGEN = 1U << 7 ;
  4972. // Field (width: 16 bits): Defines the stop at block gap value of automatic mode
  4973. inline uint32_t SDHC_MMCBOOT_BOOTBLKCNT (const uint32_t inValue) { return (inValue & 65535U) << 16 ; }
  4974. //-------------------- Host Controller Version
  4975. #define SDHC_HOSTVER (* ((const volatile uint32_t *) (0x400B1000 + 0xFC)))
  4976. // Field (width: 8 bits): Specification Version Number
  4977. inline uint32_t SDHC_HOSTVER_SVN (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  4978. // Field (width: 8 bits): Vendor Version Number
  4979. inline uint32_t SDHC_HOSTVER_VVN (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  4980. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  4981. // Peripheral ENET
  4982. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  4983. //-------------------- Interrupt Event Register
  4984. #define ENET_EIR (* ((volatile uint32_t *) (0x400C0000 + 0x4)))
  4985. // Boolean field: Timestamp Timer
  4986. static const uint32_t ENET_EIR_TS_TIMER = 1U << 15 ;
  4987. // Boolean field: Transmit Timestamp Available
  4988. static const uint32_t ENET_EIR_TS_AVAIL = 1U << 16 ;
  4989. // Boolean field: Node Wakeup Request Indication
  4990. static const uint32_t ENET_EIR_WAKEUP = 1U << 17 ;
  4991. // Boolean field: Payload Receive Error
  4992. static const uint32_t ENET_EIR_PLR = 1U << 18 ;
  4993. // Boolean field: Transmit FIFO Underrun
  4994. static const uint32_t ENET_EIR_UN = 1U << 19 ;
  4995. // Boolean field: Collision Retry Limit
  4996. static const uint32_t ENET_EIR_RL = 1U << 20 ;
  4997. // Boolean field: Late Collision
  4998. static const uint32_t ENET_EIR_LC = 1U << 21 ;
  4999. // Boolean field: Ethernet Bus Error
  5000. static const uint32_t ENET_EIR_EBERR = 1U << 22 ;
  5001. // Boolean field: MII Interrupt.
  5002. static const uint32_t ENET_EIR_MII = 1U << 23 ;
  5003. // Boolean field: Receive Buffer Interrupt
  5004. static const uint32_t ENET_EIR_RXB = 1U << 24 ;
  5005. // Boolean field: Receive Frame Interrupt
  5006. static const uint32_t ENET_EIR_RXF = 1U << 25 ;
  5007. // Boolean field: Transmit Buffer Interrupt
  5008. static const uint32_t ENET_EIR_TXB = 1U << 26 ;
  5009. // Boolean field: Transmit Frame Interrupt
  5010. static const uint32_t ENET_EIR_TXF = 1U << 27 ;
  5011. // Boolean field: Graceful Stop Complete
  5012. static const uint32_t ENET_EIR_GRA = 1U << 28 ;
  5013. // Boolean field: Babbling Transmit Error
  5014. static const uint32_t ENET_EIR_BABT = 1U << 29 ;
  5015. // Boolean field: Babbling Receive Error
  5016. static const uint32_t ENET_EIR_BABR = 1U << 30 ;
  5017. //-------------------- Interrupt Mask Register
  5018. #define ENET_EIMR (* ((volatile uint32_t *) (0x400C0000 + 0x8)))
  5019. // Boolean field: TS_TIMER Interrupt Mask
  5020. static const uint32_t ENET_EIMR_TS_TIMER = 1U << 15 ;
  5021. // Boolean field: TS_AVAIL Interrupt Mask
  5022. static const uint32_t ENET_EIMR_TS_AVAIL = 1U << 16 ;
  5023. // Boolean field: WAKEUP Interrupt Mask
  5024. static const uint32_t ENET_EIMR_WAKEUP = 1U << 17 ;
  5025. // Boolean field: PLR Interrupt Mask
  5026. static const uint32_t ENET_EIMR_PLR = 1U << 18 ;
  5027. // Boolean field: UN Interrupt Mask
  5028. static const uint32_t ENET_EIMR_UN = 1U << 19 ;
  5029. // Boolean field: RL Interrupt Mask
  5030. static const uint32_t ENET_EIMR_RL = 1U << 20 ;
  5031. // Boolean field: LC Interrupt Mask
  5032. static const uint32_t ENET_EIMR_LC = 1U << 21 ;
  5033. // Boolean field: EBERR Interrupt Mask
  5034. static const uint32_t ENET_EIMR_EBERR = 1U << 22 ;
  5035. // Boolean field: MII Interrupt Mask
  5036. static const uint32_t ENET_EIMR_MII = 1U << 23 ;
  5037. // Boolean field: RXB Interrupt Mask
  5038. static const uint32_t ENET_EIMR_RXB = 1U << 24 ;
  5039. // Boolean field: RXF Interrupt Mask
  5040. static const uint32_t ENET_EIMR_RXF = 1U << 25 ;
  5041. // Boolean field: TXB Interrupt Mask
  5042. static const uint32_t ENET_EIMR_TXB = 1U << 26 ;
  5043. // Boolean field: TXF Interrupt Mask
  5044. static const uint32_t ENET_EIMR_TXF = 1U << 27 ;
  5045. // Boolean field: GRA Interrupt Mask
  5046. static const uint32_t ENET_EIMR_GRA = 1U << 28 ;
  5047. // Boolean field: BABT Interrupt Mask
  5048. static const uint32_t ENET_EIMR_BABT = 1U << 29 ;
  5049. // Boolean field: BABR Interrupt Mask
  5050. static const uint32_t ENET_EIMR_BABR = 1U << 30 ;
  5051. //-------------------- Receive Descriptor Active Register
  5052. #define ENET_RDAR (* ((volatile uint32_t *) (0x400C0000 + 0x10)))
  5053. // Boolean field: Receive Descriptor Active
  5054. static const uint32_t ENET_RDAR_RDAR = 1U << 24 ;
  5055. //-------------------- Transmit Descriptor Active Register
  5056. #define ENET_TDAR (* ((volatile uint32_t *) (0x400C0000 + 0x14)))
  5057. // Boolean field: Transmit Descriptor Active
  5058. static const uint32_t ENET_TDAR_TDAR = 1U << 24 ;
  5059. //-------------------- Ethernet Control Register
  5060. #define ENET_ECR (* ((volatile uint32_t *) (0x400C0000 + 0x24)))
  5061. // Boolean field: Ethernet MAC Reset
  5062. static const uint32_t ENET_ECR_RESET = 1U << 0 ;
  5063. // Boolean field: Ethernet Enable
  5064. static const uint32_t ENET_ECR_ETHEREN = 1U << 1 ;
  5065. // Boolean field: Magic Packet Detection Enable
  5066. static const uint32_t ENET_ECR_MAGICEN = 1U << 2 ;
  5067. // Boolean field: Sleep Mode Enable
  5068. static const uint32_t ENET_ECR_SLEEP = 1U << 3 ;
  5069. // Boolean field: EN1588 Enable
  5070. static const uint32_t ENET_ECR_EN1588 = 1U << 4 ;
  5071. // Boolean field: Debug Enable
  5072. static const uint32_t ENET_ECR_DBGEN = 1U << 6 ;
  5073. // Boolean field: STOPEN Signal Control
  5074. static const uint32_t ENET_ECR_STOPEN = 1U << 7 ;
  5075. // Boolean field: Descriptor Byte Swapping Enable
  5076. static const uint32_t ENET_ECR_DBSWP = 1U << 8 ;
  5077. //-------------------- MII Management Frame Register
  5078. #define ENET_MMFR (* ((volatile uint32_t *) (0x400C0000 + 0x40)))
  5079. // Field (width: 16 bits): Management Frame Data
  5080. inline uint32_t ENET_MMFR_DATA (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5081. // Field (width: 2 bits): Turn Around
  5082. inline uint32_t ENET_MMFR_TA (const uint32_t inValue) { return (inValue & 3U) << 16 ; }
  5083. // Field (width: 5 bits): Register Address
  5084. inline uint32_t ENET_MMFR_RA (const uint32_t inValue) { return (inValue & 31U) << 18 ; }
  5085. // Field (width: 5 bits): PHY Address
  5086. inline uint32_t ENET_MMFR_PA (const uint32_t inValue) { return (inValue & 31U) << 23 ; }
  5087. // Field (width: 2 bits): Operation Code
  5088. inline uint32_t ENET_MMFR_OP (const uint32_t inValue) { return (inValue & 3U) << 28 ; }
  5089. // Field (width: 2 bits): Start Of Frame Delimiter
  5090. inline uint32_t ENET_MMFR_ST (const uint32_t inValue) { return (inValue & 3U) << 30 ; }
  5091. //-------------------- MII Speed Control Register
  5092. #define ENET_MSCR (* ((volatile uint32_t *) (0x400C0000 + 0x44)))
  5093. // Field (width: 6 bits): MII Speed
  5094. inline uint32_t ENET_MSCR_MII_SPEED (const uint32_t inValue) { return (inValue & 63U) << 1 ; }
  5095. // Boolean field: Disable Preamble
  5096. static const uint32_t ENET_MSCR_DIS_PRE = 1U << 7 ;
  5097. // Field (width: 3 bits): Hold time On MDIO Output
  5098. inline uint32_t ENET_MSCR_HOLDTIME (const uint32_t inValue) { return (inValue & 7U) << 8 ; }
  5099. //-------------------- MIB Control Register
  5100. #define ENET_MIBC (* ((volatile uint32_t *) (0x400C0000 + 0x64)))
  5101. // Boolean field: MIB Clear
  5102. static const uint32_t ENET_MIBC_MIB_CLEAR = 1U << 29 ;
  5103. // Boolean field: MIB Idle
  5104. static const uint32_t ENET_MIBC_MIB_IDLE = 1U << 30 ;
  5105. // Boolean field: Disable MIB Logic
  5106. static const uint32_t ENET_MIBC_MIB_DIS = 1U << 31 ;
  5107. //-------------------- Receive Control Register
  5108. #define ENET_RCR (* ((volatile uint32_t *) (0x400C0000 + 0x84)))
  5109. // Boolean field: Internal Loopback
  5110. static const uint32_t ENET_RCR_LOOP = 1U << 0 ;
  5111. // Boolean field: Disable Receive On Transmit
  5112. static const uint32_t ENET_RCR_DRT = 1U << 1 ;
  5113. // Boolean field: Media Independent Interface Mode
  5114. static const uint32_t ENET_RCR_MII_MODE = 1U << 2 ;
  5115. // Boolean field: Promiscuous Mode
  5116. static const uint32_t ENET_RCR_PROM = 1U << 3 ;
  5117. // Boolean field: Broadcast Frame Reject
  5118. static const uint32_t ENET_RCR_BC_REJ = 1U << 4 ;
  5119. // Boolean field: Flow Control Enable
  5120. static const uint32_t ENET_RCR_FCE = 1U << 5 ;
  5121. // Boolean field: RMII Mode Enable
  5122. static const uint32_t ENET_RCR_RMII_MODE = 1U << 8 ;
  5123. // Boolean field: Enables 10-Mbps mode of the RMII .
  5124. static const uint32_t ENET_RCR_RMII_10T = 1U << 9 ;
  5125. // Boolean field: Enable Frame Padding Remove On Receive
  5126. static const uint32_t ENET_RCR_PADEN = 1U << 12 ;
  5127. // Boolean field: Terminate/Forward Pause Frames
  5128. static const uint32_t ENET_RCR_PAUFWD = 1U << 13 ;
  5129. // Boolean field: Terminate/Forward Received CRC
  5130. static const uint32_t ENET_RCR_CRCFWD = 1U << 14 ;
  5131. // Boolean field: MAC Control Frame Enable
  5132. static const uint32_t ENET_RCR_CFEN = 1U << 15 ;
  5133. // Field (width: 14 bits): Maximum Frame Length
  5134. inline uint32_t ENET_RCR_MAX_FL (const uint32_t inValue) { return (inValue & 16383U) << 16 ; }
  5135. // Boolean field: Payload Length Check Disable
  5136. static const uint32_t ENET_RCR_NLC = 1U << 30 ;
  5137. // Boolean field: Graceful Receive Stopped
  5138. static const uint32_t ENET_RCR_GRS = 1U << 31 ;
  5139. //-------------------- Transmit Control Register
  5140. #define ENET_TCR (* ((volatile uint32_t *) (0x400C0000 + 0xC4)))
  5141. // Boolean field: Graceful Transmit Stop
  5142. static const uint32_t ENET_TCR_GTS = 1U << 0 ;
  5143. // Boolean field: Full-Duplex Enable
  5144. static const uint32_t ENET_TCR_FDEN = 1U << 2 ;
  5145. // Boolean field: Transmit Frame Control Pause
  5146. static const uint32_t ENET_TCR_TFC_PAUSE = 1U << 3 ;
  5147. // Boolean field: Receive Frame Control Pause
  5148. static const uint32_t ENET_TCR_RFC_PAUSE = 1U << 4 ;
  5149. // Field (width: 3 bits): Source MAC Address Select On Transmit
  5150. inline uint32_t ENET_TCR_ADDSEL (const uint32_t inValue) { return (inValue & 7U) << 5 ; }
  5151. // Boolean field: Set MAC Address On Transmit
  5152. static const uint32_t ENET_TCR_ADDINS = 1U << 8 ;
  5153. // Boolean field: Forward Frame From Application With CRC
  5154. static const uint32_t ENET_TCR_CRCFWD = 1U << 9 ;
  5155. //-------------------- Physical Address Lower Register
  5156. #define ENET_PALR (* ((volatile uint32_t *) (0x400C0000 + 0xE4)))
  5157. //-------------------- Physical Address Upper Register
  5158. #define ENET_PAUR (* ((volatile uint32_t *) (0x400C0000 + 0xE8)))
  5159. // Field (width: 16 bits): Type Field In PAUSE Frames
  5160. inline uint32_t ENET_PAUR_TYPE (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5161. // Field (width: 16 bits): Bytes 4 (bits 31:24) and 5 (bits 23:16) of the 6-byte individual address used for exact match, and the source address field in PAUSE frames
  5162. inline uint32_t ENET_PAUR_PADDR2 (const uint32_t inValue) { return (inValue & 65535U) << 16 ; }
  5163. //-------------------- Opcode/Pause Duration Register
  5164. #define ENET_OPD (* ((volatile uint32_t *) (0x400C0000 + 0xEC)))
  5165. // Field (width: 16 bits): Pause Duration
  5166. inline uint32_t ENET_OPD_PAUSE_DUR (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5167. // Field (width: 16 bits): Opcode Field In PAUSE Frames
  5168. inline uint32_t ENET_OPD_OPCODE (const uint32_t inValue) { return (inValue & 65535U) << 16 ; }
  5169. //-------------------- Descriptor Individual Upper Address Register
  5170. #define ENET_IAUR (* ((volatile uint32_t *) (0x400C0000 + 0x118)))
  5171. //-------------------- Descriptor Individual Lower Address Register
  5172. #define ENET_IALR (* ((volatile uint32_t *) (0x400C0000 + 0x11C)))
  5173. //-------------------- Descriptor Group Upper Address Register
  5174. #define ENET_GAUR (* ((volatile uint32_t *) (0x400C0000 + 0x120)))
  5175. //-------------------- Descriptor Group Lower Address Register
  5176. #define ENET_GALR (* ((volatile uint32_t *) (0x400C0000 + 0x124)))
  5177. //-------------------- Transmit FIFO Watermark Register
  5178. #define ENET_TFWR (* ((volatile uint32_t *) (0x400C0000 + 0x144)))
  5179. // Field (width: 6 bits): Transmit FIFO Write
  5180. inline uint32_t ENET_TFWR_TFWR (const uint32_t inValue) { return (inValue & 63U) << 0 ; }
  5181. // Boolean field: Store And Forward Enable
  5182. static const uint32_t ENET_TFWR_STRFWD = 1U << 8 ;
  5183. //-------------------- Receive Descriptor Ring Start Register
  5184. #define ENET_RDSR (* ((volatile uint32_t *) (0x400C0000 + 0x180)))
  5185. // Field (width: 29 bits): Pointer to the beginning of the receive buffer descriptor queue.
  5186. inline uint32_t ENET_RDSR_R_DES_START (const uint32_t inValue) { return (inValue & 536870911U) << 3 ; }
  5187. //-------------------- Transmit Buffer Descriptor Ring Start Register
  5188. #define ENET_TDSR (* ((volatile uint32_t *) (0x400C0000 + 0x184)))
  5189. // Field (width: 29 bits): Pointer to the beginning of the transmit buffer descriptor queue.
  5190. inline uint32_t ENET_TDSR_X_DES_START (const uint32_t inValue) { return (inValue & 536870911U) << 3 ; }
  5191. //-------------------- Maximum Receive Buffer Size Register
  5192. #define ENET_MRBR (* ((volatile uint32_t *) (0x400C0000 + 0x188)))
  5193. // Field (width: 7 bits): Receive buffer size in bytes
  5194. inline uint32_t ENET_MRBR_R_BUF_SIZE (const uint32_t inValue) { return (inValue & 127U) << 4 ; }
  5195. //-------------------- Receive FIFO Section Full Threshold
  5196. #define ENET_RSFL (* ((volatile uint32_t *) (0x400C0000 + 0x190)))
  5197. // Field (width: 8 bits): Value Of Receive FIFO Section Full Threshold
  5198. inline uint32_t ENET_RSFL_RX_SECTION_FULL (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  5199. //-------------------- Receive FIFO Section Empty Threshold
  5200. #define ENET_RSEM (* ((volatile uint32_t *) (0x400C0000 + 0x194)))
  5201. // Field (width: 8 bits): Value Of The Receive FIFO Section Empty Threshold
  5202. inline uint32_t ENET_RSEM_RX_SECTION_EMPTY (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  5203. // Field (width: 5 bits): RX Status FIFO Section Empty Threshold
  5204. inline uint32_t ENET_RSEM_STAT_SECTION_EMPTY (const uint32_t inValue) { return (inValue & 31U) << 16 ; }
  5205. //-------------------- Receive FIFO Almost Empty Threshold
  5206. #define ENET_RAEM (* ((volatile uint32_t *) (0x400C0000 + 0x198)))
  5207. // Field (width: 8 bits): Value Of The Receive FIFO Almost Empty Threshold
  5208. inline uint32_t ENET_RAEM_RX_ALMOST_EMPTY (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  5209. //-------------------- Receive FIFO Almost Full Threshold
  5210. #define ENET_RAFL (* ((volatile uint32_t *) (0x400C0000 + 0x19C)))
  5211. // Field (width: 8 bits): Value Of The Receive FIFO Almost Full Threshold
  5212. inline uint32_t ENET_RAFL_RX_ALMOST_FULL (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  5213. //-------------------- Transmit FIFO Section Empty Threshold
  5214. #define ENET_TSEM (* ((volatile uint32_t *) (0x400C0000 + 0x1A0)))
  5215. // Field (width: 8 bits): Value Of The Transmit FIFO Section Empty Threshold
  5216. inline uint32_t ENET_TSEM_TX_SECTION_EMPTY (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  5217. //-------------------- Transmit FIFO Almost Empty Threshold
  5218. #define ENET_TAEM (* ((volatile uint32_t *) (0x400C0000 + 0x1A4)))
  5219. // Field (width: 8 bits): Value of Transmit FIFO Almost Empty Threshold
  5220. inline uint32_t ENET_TAEM_TX_ALMOST_EMPTY (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  5221. //-------------------- Transmit FIFO Almost Full Threshold
  5222. #define ENET_TAFL (* ((volatile uint32_t *) (0x400C0000 + 0x1A8)))
  5223. // Field (width: 8 bits): Value Of The Transmit FIFO Almost Full Threshold
  5224. inline uint32_t ENET_TAFL_TX_ALMOST_FULL (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  5225. //-------------------- Transmit Inter-Packet Gap
  5226. #define ENET_TIPG (* ((volatile uint32_t *) (0x400C0000 + 0x1AC)))
  5227. // Field (width: 5 bits): Transmit Inter-Packet Gap
  5228. inline uint32_t ENET_TIPG_IPG (const uint32_t inValue) { return (inValue & 31U) << 0 ; }
  5229. //-------------------- Frame Truncation Length
  5230. #define ENET_FTRL (* ((volatile uint32_t *) (0x400C0000 + 0x1B0)))
  5231. // Field (width: 14 bits): Frame Truncation Length
  5232. inline uint32_t ENET_FTRL_TRUNC_FL (const uint32_t inValue) { return (inValue & 16383U) << 0 ; }
  5233. //-------------------- Transmit Accelerator Function Configuration
  5234. #define ENET_TACC (* ((volatile uint32_t *) (0x400C0000 + 0x1C0)))
  5235. // Boolean field: TX FIFO Shift-16
  5236. static const uint32_t ENET_TACC_SHIFT16 = 1U << 0 ;
  5237. // Boolean field: Enables insertion of IP header checksum.
  5238. static const uint32_t ENET_TACC_IPCHK = 1U << 3 ;
  5239. // Boolean field: Enables insertion of protocol checksum.
  5240. static const uint32_t ENET_TACC_PROCHK = 1U << 4 ;
  5241. //-------------------- Receive Accelerator Function Configuration
  5242. #define ENET_RACC (* ((volatile uint32_t *) (0x400C0000 + 0x1C4)))
  5243. // Boolean field: Enable Padding Removal For Short IP Frames
  5244. static const uint32_t ENET_RACC_PADREM = 1U << 0 ;
  5245. // Boolean field: Enable Discard Of Frames With Wrong IPv4 Header Checksum
  5246. static const uint32_t ENET_RACC_IPDIS = 1U << 1 ;
  5247. // Boolean field: Enable Discard Of Frames With Wrong Protocol Checksum
  5248. static const uint32_t ENET_RACC_PRODIS = 1U << 2 ;
  5249. // Boolean field: Enable Discard Of Frames With MAC Layer Errors
  5250. static const uint32_t ENET_RACC_LINEDIS = 1U << 6 ;
  5251. // Boolean field: RX FIFO Shift-16
  5252. static const uint32_t ENET_RACC_SHIFT16 = 1U << 7 ;
  5253. //-------------------- Reserved Statistic Register
  5254. #define ENET_RMON_T_DROP (* ((const volatile uint32_t *) (0x400C0000 + 0x200)))
  5255. //-------------------- Tx Packet Count Statistic Register
  5256. #define ENET_RMON_T_PACKETS (* ((const volatile uint32_t *) (0x400C0000 + 0x204)))
  5257. // Field (width: 16 bits): Packet count
  5258. inline uint32_t ENET_RMON_T_PACKETS_TXPKTS (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5259. //-------------------- Tx Broadcast Packets Statistic Register
  5260. #define ENET_RMON_T_BC_PKT (* ((const volatile uint32_t *) (0x400C0000 + 0x208)))
  5261. // Field (width: 16 bits): Broadcast packets
  5262. inline uint32_t ENET_RMON_T_BC_PKT_TXPKTS (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5263. //-------------------- Tx Multicast Packets Statistic Register
  5264. #define ENET_RMON_T_MC_PKT (* ((const volatile uint32_t *) (0x400C0000 + 0x20C)))
  5265. // Field (width: 16 bits): Multicast packets
  5266. inline uint32_t ENET_RMON_T_MC_PKT_TXPKTS (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5267. //-------------------- Tx Packets with CRC/Align Error Statistic Register
  5268. #define ENET_RMON_T_CRC_ALIGN (* ((const volatile uint32_t *) (0x400C0000 + 0x210)))
  5269. // Field (width: 16 bits): Packets with CRC/align error
  5270. inline uint32_t ENET_RMON_T_CRC_ALIGN_TXPKTS (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5271. //-------------------- Tx Packets Less Than Bytes and Good CRC Statistic Register
  5272. #define ENET_RMON_T_UNDERSIZE (* ((const volatile uint32_t *) (0x400C0000 + 0x214)))
  5273. // Field (width: 16 bits): Number of transmit packets less than 64 bytes with good CRC
  5274. inline uint32_t ENET_RMON_T_UNDERSIZE_TXPKTS (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5275. //-------------------- Tx Packets GT MAX_FL bytes and Good CRC Statistic Register
  5276. #define ENET_RMON_T_OVERSIZE (* ((const volatile uint32_t *) (0x400C0000 + 0x218)))
  5277. // Field (width: 16 bits): Number of transmit packets greater than MAX_FL bytes with good CRC
  5278. inline uint32_t ENET_RMON_T_OVERSIZE_TXPKTS (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5279. //-------------------- Tx Packets Less Than 64 Bytes and Bad CRC Statistic Register
  5280. #define ENET_RMON_T_FRAG (* ((const volatile uint32_t *) (0x400C0000 + 0x21C)))
  5281. // Field (width: 16 bits): Number of packets less than 64 bytes with bad CRC
  5282. inline uint32_t ENET_RMON_T_FRAG_TXPKTS (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5283. //-------------------- Tx Packets Greater Than MAX_FL bytes and Bad CRC Statistic Register
  5284. #define ENET_RMON_T_JAB (* ((const volatile uint32_t *) (0x400C0000 + 0x220)))
  5285. // Field (width: 16 bits): Number of transmit packets greater than MAX_FL bytes and bad CRC
  5286. inline uint32_t ENET_RMON_T_JAB_TXPKTS (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5287. //-------------------- Tx Collision Count Statistic Register
  5288. #define ENET_RMON_T_COL (* ((const volatile uint32_t *) (0x400C0000 + 0x224)))
  5289. // Field (width: 16 bits): Number of transmit collisions
  5290. inline uint32_t ENET_RMON_T_COL_TXPKTS (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5291. //-------------------- Tx 64-Byte Packets Statistic Register
  5292. #define ENET_RMON_T_P64 (* ((const volatile uint32_t *) (0x400C0000 + 0x228)))
  5293. // Field (width: 16 bits): Number of 64-byte transmit packets
  5294. inline uint32_t ENET_RMON_T_P64_TXPKTS (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5295. //-------------------- Tx 65- to 127-byte Packets Statistic Register
  5296. #define ENET_RMON_T_P65TO127 (* ((const volatile uint32_t *) (0x400C0000 + 0x22C)))
  5297. // Field (width: 16 bits): Number of 65- to 127-byte transmit packets
  5298. inline uint32_t ENET_RMON_T_P65TO127_TXPKTS (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5299. //-------------------- Tx 128- to 255-byte Packets Statistic Register
  5300. #define ENET_RMON_T_P128TO255 (* ((const volatile uint32_t *) (0x400C0000 + 0x230)))
  5301. // Field (width: 16 bits): Number of 128- to 255-byte transmit packets
  5302. inline uint32_t ENET_RMON_T_P128TO255_TXPKTS (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5303. //-------------------- Tx 256- to 511-byte Packets Statistic Register
  5304. #define ENET_RMON_T_P256TO511 (* ((const volatile uint32_t *) (0x400C0000 + 0x234)))
  5305. // Field (width: 16 bits): Number of 256- to 511-byte transmit packets
  5306. inline uint32_t ENET_RMON_T_P256TO511_TXPKTS (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5307. //-------------------- Tx 512- to 1023-byte Packets Statistic Register
  5308. #define ENET_RMON_T_P512TO1023 (* ((const volatile uint32_t *) (0x400C0000 + 0x238)))
  5309. // Field (width: 16 bits): Number of 512- to 1023-byte transmit packets
  5310. inline uint32_t ENET_RMON_T_P512TO1023_TXPKTS (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5311. //-------------------- Tx 1024- to 2047-byte Packets Statistic Register
  5312. #define ENET_RMON_T_P1024TO2047 (* ((const volatile uint32_t *) (0x400C0000 + 0x23C)))
  5313. // Field (width: 16 bits): Number of 1024- to 2047-byte transmit packets
  5314. inline uint32_t ENET_RMON_T_P1024TO2047_TXPKTS (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5315. //-------------------- Tx Packets Greater Than 2048 Bytes Statistic Register
  5316. #define ENET_RMON_T_P_GTE2048 (* ((const volatile uint32_t *) (0x400C0000 + 0x240)))
  5317. // Field (width: 16 bits): Number of transmit packets greater than 2048 bytes
  5318. inline uint32_t ENET_RMON_T_P_GTE2048_TXPKTS (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5319. //-------------------- Tx Octets Statistic Register
  5320. #define ENET_RMON_T_OCTETS (* ((const volatile uint32_t *) (0x400C0000 + 0x244)))
  5321. //-------------------- IEEE_T_DROP Reserved Statistic Register
  5322. #define ENET_IEEE_T_DROP (* ((const volatile uint32_t *) (0x400C0000 + 0x248)))
  5323. //-------------------- Frames Transmitted OK Statistic Register
  5324. #define ENET_IEEE_T_FRAME_OK (* ((const volatile uint32_t *) (0x400C0000 + 0x24C)))
  5325. // Field (width: 16 bits): Number of frames transmitted OK
  5326. inline uint32_t ENET_IEEE_T_FRAME_OK_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5327. //-------------------- Frames Transmitted with Single Collision Statistic Register
  5328. #define ENET_IEEE_T_1COL (* ((const volatile uint32_t *) (0x400C0000 + 0x250)))
  5329. // Field (width: 16 bits): Number of frames transmitted with one collision
  5330. inline uint32_t ENET_IEEE_T_1COL_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5331. //-------------------- Frames Transmitted with Multiple Collisions Statistic Register
  5332. #define ENET_IEEE_T_MCOL (* ((const volatile uint32_t *) (0x400C0000 + 0x254)))
  5333. // Field (width: 16 bits): Number of frames transmitted with multiple collisions
  5334. inline uint32_t ENET_IEEE_T_MCOL_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5335. //-------------------- Frames Transmitted after Deferral Delay Statistic Register
  5336. #define ENET_IEEE_T_DEF (* ((const volatile uint32_t *) (0x400C0000 + 0x258)))
  5337. // Field (width: 16 bits): Number of frames transmitted with deferral delay
  5338. inline uint32_t ENET_IEEE_T_DEF_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5339. //-------------------- Frames Transmitted with Late Collision Statistic Register
  5340. #define ENET_IEEE_T_LCOL (* ((const volatile uint32_t *) (0x400C0000 + 0x25C)))
  5341. // Field (width: 16 bits): Number of frames transmitted with late collision
  5342. inline uint32_t ENET_IEEE_T_LCOL_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5343. //-------------------- Frames Transmitted with Excessive Collisions Statistic Register
  5344. #define ENET_IEEE_T_EXCOL (* ((const volatile uint32_t *) (0x400C0000 + 0x260)))
  5345. // Field (width: 16 bits): Number of frames transmitted with excessive collisions
  5346. inline uint32_t ENET_IEEE_T_EXCOL_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5347. //-------------------- Frames Transmitted with Tx FIFO Underrun Statistic Register
  5348. #define ENET_IEEE_T_MACERR (* ((const volatile uint32_t *) (0x400C0000 + 0x264)))
  5349. // Field (width: 16 bits): Number of frames transmitted with transmit FIFO underrun
  5350. inline uint32_t ENET_IEEE_T_MACERR_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5351. //-------------------- Frames Transmitted with Carrier Sense Error Statistic Register
  5352. #define ENET_IEEE_T_CSERR (* ((const volatile uint32_t *) (0x400C0000 + 0x268)))
  5353. // Field (width: 16 bits): Number of frames transmitted with carrier sense error
  5354. inline uint32_t ENET_IEEE_T_CSERR_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5355. //-------------------- no description available
  5356. #define ENET_IEEE_T_SQE (* ((const volatile uint32_t *) (0x400C0000 + 0x26C)))
  5357. // Field (width: 16 bits): Number of frames transmitted with SQE error
  5358. inline uint32_t ENET_IEEE_T_SQE_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5359. //-------------------- Flow Control Pause Frames Transmitted Statistic Register
  5360. #define ENET_IEEE_T_FDXFC (* ((const volatile uint32_t *) (0x400C0000 + 0x270)))
  5361. // Field (width: 16 bits): Number of flow-control pause frames transmitted
  5362. inline uint32_t ENET_IEEE_T_FDXFC_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5363. //-------------------- Octet Count for Frames Transmitted w/o Error Statistic Register
  5364. #define ENET_IEEE_T_OCTETS_OK (* ((const volatile uint32_t *) (0x400C0000 + 0x274)))
  5365. //-------------------- Rx Packet Count Statistic Register
  5366. #define ENET_RMON_R_PACKETS (* ((const volatile uint32_t *) (0x400C0000 + 0x284)))
  5367. // Field (width: 16 bits): Number of packets received
  5368. inline uint32_t ENET_RMON_R_PACKETS_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5369. //-------------------- Rx Broadcast Packets Statistic Register
  5370. #define ENET_RMON_R_BC_PKT (* ((const volatile uint32_t *) (0x400C0000 + 0x288)))
  5371. // Field (width: 16 bits): Number of receive broadcast packets
  5372. inline uint32_t ENET_RMON_R_BC_PKT_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5373. //-------------------- Rx Multicast Packets Statistic Register
  5374. #define ENET_RMON_R_MC_PKT (* ((const volatile uint32_t *) (0x400C0000 + 0x28C)))
  5375. // Field (width: 16 bits): Number of receive multicast packets
  5376. inline uint32_t ENET_RMON_R_MC_PKT_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5377. //-------------------- Rx Packets with CRC/Align Error Statistic Register
  5378. #define ENET_RMON_R_CRC_ALIGN (* ((const volatile uint32_t *) (0x400C0000 + 0x290)))
  5379. // Field (width: 16 bits): Number of receive packets with CRC or align error
  5380. inline uint32_t ENET_RMON_R_CRC_ALIGN_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5381. //-------------------- Rx Packets with Less Than 64 Bytes and Good CRC Statistic Register
  5382. #define ENET_RMON_R_UNDERSIZE (* ((const volatile uint32_t *) (0x400C0000 + 0x294)))
  5383. // Field (width: 16 bits): Number of receive packets with less than 64 bytes and good CRC
  5384. inline uint32_t ENET_RMON_R_UNDERSIZE_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5385. //-------------------- Rx Packets Greater Than MAX_FL and Good CRC Statistic Register
  5386. #define ENET_RMON_R_OVERSIZE (* ((const volatile uint32_t *) (0x400C0000 + 0x298)))
  5387. // Field (width: 16 bits): Number of receive packets greater than MAX_FL and good CRC
  5388. inline uint32_t ENET_RMON_R_OVERSIZE_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5389. //-------------------- Rx Packets Less Than 64 Bytes and Bad CRC Statistic Register
  5390. #define ENET_RMON_R_FRAG (* ((const volatile uint32_t *) (0x400C0000 + 0x29C)))
  5391. // Field (width: 16 bits): Number of receive packets with less than 64 bytes and bad CRC
  5392. inline uint32_t ENET_RMON_R_FRAG_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5393. //-------------------- Rx Packets Greater Than MAX_FL Bytes and Bad CRC Statistic Register
  5394. #define ENET_RMON_R_JAB (* ((const volatile uint32_t *) (0x400C0000 + 0x2A0)))
  5395. // Field (width: 16 bits): Number of receive packets greater than MAX_FL and bad CRC
  5396. inline uint32_t ENET_RMON_R_JAB_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5397. //-------------------- Reserved Statistic Register
  5398. #define ENET_RMON_R_RESVD_0 (* ((const volatile uint32_t *) (0x400C0000 + 0x2A4)))
  5399. //-------------------- Rx 64-Byte Packets Statistic Register
  5400. #define ENET_RMON_R_P64 (* ((const volatile uint32_t *) (0x400C0000 + 0x2A8)))
  5401. // Field (width: 16 bits): Number of 64-byte receive packets
  5402. inline uint32_t ENET_RMON_R_P64_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5403. //-------------------- Rx 65- to 127-Byte Packets Statistic Register
  5404. #define ENET_RMON_R_P65TO127 (* ((const volatile uint32_t *) (0x400C0000 + 0x2AC)))
  5405. // Field (width: 16 bits): Number of 65- to 127-byte recieve packets
  5406. inline uint32_t ENET_RMON_R_P65TO127_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5407. //-------------------- Rx 128- to 255-Byte Packets Statistic Register
  5408. #define ENET_RMON_R_P128TO255 (* ((const volatile uint32_t *) (0x400C0000 + 0x2B0)))
  5409. // Field (width: 16 bits): Number of 128- to 255-byte recieve packets
  5410. inline uint32_t ENET_RMON_R_P128TO255_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5411. //-------------------- Rx 256- to 511-Byte Packets Statistic Register
  5412. #define ENET_RMON_R_P256TO511 (* ((const volatile uint32_t *) (0x400C0000 + 0x2B4)))
  5413. // Field (width: 16 bits): Number of 256- to 511-byte recieve packets
  5414. inline uint32_t ENET_RMON_R_P256TO511_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5415. //-------------------- Rx 512- to 1023-Byte Packets Statistic Register
  5416. #define ENET_RMON_R_P512TO1023 (* ((const volatile uint32_t *) (0x400C0000 + 0x2B8)))
  5417. // Field (width: 16 bits): Number of 512- to 1023-byte recieve packets
  5418. inline uint32_t ENET_RMON_R_P512TO1023_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5419. //-------------------- Rx 1024- to 2047-Byte Packets Statistic Register
  5420. #define ENET_RMON_R_P1024TO2047 (* ((const volatile uint32_t *) (0x400C0000 + 0x2BC)))
  5421. // Field (width: 16 bits): Number of 1024- to 2047-byte recieve packets
  5422. inline uint32_t ENET_RMON_R_P1024TO2047_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5423. //-------------------- Rx Packets Greater than 2048 Bytes Statistic Register
  5424. #define ENET_RMON_R_P_GTE2048 (* ((const volatile uint32_t *) (0x400C0000 + 0x2C0)))
  5425. // Field (width: 16 bits): Number of greater-than-2048-byte recieve packets
  5426. inline uint32_t ENET_RMON_R_P_GTE2048_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5427. //-------------------- Rx Octets Statistic Register
  5428. #define ENET_RMON_R_OCTETS (* ((const volatile uint32_t *) (0x400C0000 + 0x2C4)))
  5429. //-------------------- Frames not Counted Correctly Statistic Register
  5430. #define ENET_IEEE_R_DROP (* ((const volatile uint32_t *) (0x400C0000 + 0x2C8)))
  5431. // Field (width: 16 bits): Frame count
  5432. inline uint32_t ENET_IEEE_R_DROP_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5433. //-------------------- Frames Received OK Statistic Register
  5434. #define ENET_IEEE_R_FRAME_OK (* ((const volatile uint32_t *) (0x400C0000 + 0x2CC)))
  5435. // Field (width: 16 bits): Number of frames received OK
  5436. inline uint32_t ENET_IEEE_R_FRAME_OK_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5437. //-------------------- Frames Received with CRC Error Statistic Register
  5438. #define ENET_IEEE_R_CRC (* ((const volatile uint32_t *) (0x400C0000 + 0x2D0)))
  5439. // Field (width: 16 bits): Number of frames received with CRC error
  5440. inline uint32_t ENET_IEEE_R_CRC_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5441. //-------------------- Frames Received with Alignment Error Statistic Register
  5442. #define ENET_IEEE_R_ALIGN (* ((const volatile uint32_t *) (0x400C0000 + 0x2D4)))
  5443. // Field (width: 16 bits): Number of frames received with alignment error
  5444. inline uint32_t ENET_IEEE_R_ALIGN_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5445. //-------------------- Receive FIFO Overflow Count Statistic Register
  5446. #define ENET_IEEE_R_MACERR (* ((const volatile uint32_t *) (0x400C0000 + 0x2D8)))
  5447. // Field (width: 16 bits): Receive FIFO overflow count
  5448. inline uint32_t ENET_IEEE_R_MACERR_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5449. //-------------------- Flow Control Pause Frames Received Statistic Register
  5450. #define ENET_IEEE_R_FDXFC (* ((const volatile uint32_t *) (0x400C0000 + 0x2DC)))
  5451. // Field (width: 16 bits): Number of flow-control pause frames received
  5452. inline uint32_t ENET_IEEE_R_FDXFC_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  5453. //-------------------- Octet Count for Frames Received without Error Statistic Register
  5454. #define ENET_IEEE_R_OCTETS_OK (* ((const volatile uint32_t *) (0x400C0000 + 0x2E0)))
  5455. //-------------------- Adjustable Timer Control Register
  5456. #define ENET_ATCR (* ((volatile uint32_t *) (0x400C0000 + 0x400)))
  5457. // Boolean field: Enable Timer
  5458. static const uint32_t ENET_ATCR_EN = 1U << 0 ;
  5459. // Boolean field: Enable One-Shot Offset Event
  5460. static const uint32_t ENET_ATCR_OFFEN = 1U << 2 ;
  5461. // Boolean field: Reset Timer On Offset Event
  5462. static const uint32_t ENET_ATCR_OFFRST = 1U << 3 ;
  5463. // Boolean field: Enable Periodical Event
  5464. static const uint32_t ENET_ATCR_PEREN = 1U << 4 ;
  5465. // Boolean field: Enables event signal output assertion on period event
  5466. static const uint32_t ENET_ATCR_PINPER = 1U << 7 ;
  5467. // Boolean field: Reset Timer
  5468. static const uint32_t ENET_ATCR_RESTART = 1U << 9 ;
  5469. // Boolean field: Capture Timer Value
  5470. static const uint32_t ENET_ATCR_CAPTURE = 1U << 11 ;
  5471. // Boolean field: Enable Timer Slave Mode
  5472. static const uint32_t ENET_ATCR_SLAVE = 1U << 13 ;
  5473. //-------------------- Timer Value Register
  5474. #define ENET_ATVR (* ((volatile uint32_t *) (0x400C0000 + 0x404)))
  5475. //-------------------- Timer Offset Register
  5476. #define ENET_ATOFF (* ((volatile uint32_t *) (0x400C0000 + 0x408)))
  5477. //-------------------- Timer Period Register
  5478. #define ENET_ATPER (* ((volatile uint32_t *) (0x400C0000 + 0x40C)))
  5479. //-------------------- Timer Correction Register
  5480. #define ENET_ATCOR (* ((volatile uint32_t *) (0x400C0000 + 0x410)))
  5481. // Field (width: 31 bits): Correction Counter Wrap-Around Value
  5482. inline uint32_t ENET_ATCOR_COR (const uint32_t inValue) { return (inValue & 2147483647U) << 0 ; }
  5483. //-------------------- Time-Stamping Clock Period Register
  5484. #define ENET_ATINC (* ((volatile uint32_t *) (0x400C0000 + 0x414)))
  5485. // Field (width: 7 bits): Clock Period Of The Timestamping Clock (ts_clk) In Nanoseconds
  5486. inline uint32_t ENET_ATINC_INC (const uint32_t inValue) { return (inValue & 127U) << 0 ; }
  5487. // Field (width: 7 bits): Correction Increment Value
  5488. inline uint32_t ENET_ATINC_INC_CORR (const uint32_t inValue) { return (inValue & 127U) << 8 ; }
  5489. //-------------------- Timestamp of Last Transmitted Frame
  5490. #define ENET_ATSTMP (* ((const volatile uint32_t *) (0x400C0000 + 0x418)))
  5491. //-------------------- Timer Global Status Register
  5492. #define ENET_TGSR (* ((volatile uint32_t *) (0x400C0000 + 0x604)))
  5493. // Boolean field: Copy Of Timer Flag For Channel 0
  5494. static const uint32_t ENET_TGSR_TF0 = 1U << 0 ;
  5495. // Boolean field: Copy Of Timer Flag For Channel 1
  5496. static const uint32_t ENET_TGSR_TF1 = 1U << 1 ;
  5497. // Boolean field: Copy Of Timer Flag For Channel 2
  5498. static const uint32_t ENET_TGSR_TF2 = 1U << 2 ;
  5499. // Boolean field: Copy Of Timer Flag For Channel 3
  5500. static const uint32_t ENET_TGSR_TF3 = 1U << 3 ;
  5501. //-------------------- Timer Control Status Register (idx = 0 ... 3)
  5502. #define ENET_TCSR(idx) (* ((volatile uint32_t *) (0x400C0000 + 0x608 + 0x8 * (idx))))
  5503. // Boolean field: Timer DMA Request Enable
  5504. static const uint32_t ENET_TCSR_TDRE = 1U << 0 ;
  5505. // Field (width: 4 bits): Timer Mode
  5506. inline uint32_t ENET_TCSR_TMODE (const uint32_t inValue) { return (inValue & 15U) << 2 ; }
  5507. // Boolean field: Timer Interrupt Enable
  5508. static const uint32_t ENET_TCSR_TIE = 1U << 6 ;
  5509. // Boolean field: Timer Flag
  5510. static const uint32_t ENET_TCSR_TF = 1U << 7 ;
  5511. //-------------------- Timer Compare Capture Register (idx = 0 ... 3)
  5512. #define ENET_TCCR(idx) (* ((volatile uint32_t *) (0x400C0000 + 0x60C + 0x8 * (idx))))
  5513. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  5514. // Peripheral LPUART0
  5515. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  5516. //-------------------- LPUART Baud Rate Register
  5517. #define LPUART0_BAUD (* ((volatile uint32_t *) (0x400C4000 + 0)))
  5518. // Field (width: 13 bits): Baud Rate Modulo Divisor.
  5519. inline uint32_t LPUART0_BAUD_SBR (const uint32_t inValue) { return (inValue & 8191U) << 0 ; }
  5520. // Boolean field: Stop Bit Number Select
  5521. static const uint32_t LPUART0_BAUD_SBNS = 1U << 13 ;
  5522. // Boolean field: RX Input Active Edge Interrupt Enable
  5523. static const uint32_t LPUART0_BAUD_RXEDGIE = 1U << 14 ;
  5524. // Boolean field: LIN Break Detect Interrupt Enable
  5525. static const uint32_t LPUART0_BAUD_LBKDIE = 1U << 15 ;
  5526. // Boolean field: Resynchronization Disable
  5527. static const uint32_t LPUART0_BAUD_RESYNCDIS = 1U << 16 ;
  5528. // Boolean field: Both Edge Sampling
  5529. static const uint32_t LPUART0_BAUD_BOTHEDGE = 1U << 17 ;
  5530. // Field (width: 2 bits): Match Configuration
  5531. inline uint32_t LPUART0_BAUD_MATCFG (const uint32_t inValue) { return (inValue & 3U) << 18 ; }
  5532. // Boolean field: Receiver Full DMA Enable
  5533. static const uint32_t LPUART0_BAUD_RDMAE = 1U << 21 ;
  5534. // Boolean field: Transmitter DMA Enable
  5535. static const uint32_t LPUART0_BAUD_TDMAE = 1U << 23 ;
  5536. // Field (width: 5 bits): Over Sampling Ratio
  5537. inline uint32_t LPUART0_BAUD_OSR (const uint32_t inValue) { return (inValue & 31U) << 24 ; }
  5538. // Boolean field: 10-bit Mode select
  5539. static const uint32_t LPUART0_BAUD_M10 = 1U << 29 ;
  5540. // Boolean field: Match Address Mode Enable 2
  5541. static const uint32_t LPUART0_BAUD_MAEN2 = 1U << 30 ;
  5542. // Boolean field: Match Address Mode Enable 1
  5543. static const uint32_t LPUART0_BAUD_MAEN1 = 1U << 31 ;
  5544. //-------------------- LPUART Status Register
  5545. #define LPUART0_STAT (* ((volatile uint32_t *) (0x400C4000 + 0x4)))
  5546. // Boolean field: Match 2 Flag
  5547. static const uint32_t LPUART0_STAT_MA2F = 1U << 14 ;
  5548. // Boolean field: Match 1 Flag
  5549. static const uint32_t LPUART0_STAT_MA1F = 1U << 15 ;
  5550. // Boolean field: Parity Error Flag
  5551. static const uint32_t LPUART0_STAT_PF = 1U << 16 ;
  5552. // Boolean field: Framing Error Flag
  5553. static const uint32_t LPUART0_STAT_FE = 1U << 17 ;
  5554. // Boolean field: Noise Flag
  5555. static const uint32_t LPUART0_STAT_NF = 1U << 18 ;
  5556. // Boolean field: Receiver Overrun Flag
  5557. static const uint32_t LPUART0_STAT_OR = 1U << 19 ;
  5558. // Boolean field: Idle Line Flag
  5559. static const uint32_t LPUART0_STAT_IDLE = 1U << 20 ;
  5560. // Boolean field: Receive Data Register Full Flag
  5561. static const uint32_t LPUART0_STAT_RDRF = 1U << 21 ;
  5562. // Boolean field: Transmission Complete Flag
  5563. static const uint32_t LPUART0_STAT_TC = 1U << 22 ;
  5564. // Boolean field: Transmit Data Register Empty Flag
  5565. static const uint32_t LPUART0_STAT_TDRE = 1U << 23 ;
  5566. // Boolean field: Receiver Active Flag
  5567. static const uint32_t LPUART0_STAT_RAF = 1U << 24 ;
  5568. // Boolean field: LIN Break Detection Enable
  5569. static const uint32_t LPUART0_STAT_LBKDE = 1U << 25 ;
  5570. // Boolean field: Break Character Generation Length
  5571. static const uint32_t LPUART0_STAT_BRK13 = 1U << 26 ;
  5572. // Boolean field: Receive Wake Up Idle Detect
  5573. static const uint32_t LPUART0_STAT_RWUID = 1U << 27 ;
  5574. // Boolean field: Receive Data Inversion
  5575. static const uint32_t LPUART0_STAT_RXINV = 1U << 28 ;
  5576. // Boolean field: MSB First
  5577. static const uint32_t LPUART0_STAT_MSBF = 1U << 29 ;
  5578. // Boolean field: LPUART_RX Pin Active Edge Interrupt Flag
  5579. static const uint32_t LPUART0_STAT_RXEDGIF = 1U << 30 ;
  5580. // Boolean field: LIN Break Detect Interrupt Flag
  5581. static const uint32_t LPUART0_STAT_LBKDIF = 1U << 31 ;
  5582. //-------------------- LPUART Control Register
  5583. #define LPUART0_CTRL (* ((volatile uint32_t *) (0x400C4000 + 0x8)))
  5584. // Boolean field: Parity Type
  5585. static const uint32_t LPUART0_CTRL_PT = 1U << 0 ;
  5586. // Boolean field: Parity Enable
  5587. static const uint32_t LPUART0_CTRL_PE = 1U << 1 ;
  5588. // Boolean field: Idle Line Type Select
  5589. static const uint32_t LPUART0_CTRL_ILT = 1U << 2 ;
  5590. // Boolean field: Receiver Wakeup Method Select
  5591. static const uint32_t LPUART0_CTRL_WAKE = 1U << 3 ;
  5592. // Boolean field: 9-Bit or 8-Bit Mode Select
  5593. static const uint32_t LPUART0_CTRL_M = 1U << 4 ;
  5594. // Boolean field: Receiver Source Select
  5595. static const uint32_t LPUART0_CTRL_RSRC = 1U << 5 ;
  5596. // Boolean field: Doze Enable
  5597. static const uint32_t LPUART0_CTRL_DOZEEN = 1U << 6 ;
  5598. // Boolean field: Loop Mode Select
  5599. static const uint32_t LPUART0_CTRL_LOOPS = 1U << 7 ;
  5600. // Field (width: 3 bits): Idle Configuration
  5601. inline uint32_t LPUART0_CTRL_IDLECFG (const uint32_t inValue) { return (inValue & 7U) << 8 ; }
  5602. // Boolean field: Match 2 Interrupt Enable
  5603. static const uint32_t LPUART0_CTRL_MA2IE = 1U << 14 ;
  5604. // Boolean field: Match 1 Interrupt Enable
  5605. static const uint32_t LPUART0_CTRL_MA1IE = 1U << 15 ;
  5606. // Boolean field: Send Break
  5607. static const uint32_t LPUART0_CTRL_SBK = 1U << 16 ;
  5608. // Boolean field: Receiver Wakeup Control
  5609. static const uint32_t LPUART0_CTRL_RWU = 1U << 17 ;
  5610. // Boolean field: Receiver Enable
  5611. static const uint32_t LPUART0_CTRL_RE = 1U << 18 ;
  5612. // Boolean field: Transmitter Enable
  5613. static const uint32_t LPUART0_CTRL_TE = 1U << 19 ;
  5614. // Boolean field: Idle Line Interrupt Enable
  5615. static const uint32_t LPUART0_CTRL_ILIE = 1U << 20 ;
  5616. // Boolean field: Receiver Interrupt Enable
  5617. static const uint32_t LPUART0_CTRL_RIE = 1U << 21 ;
  5618. // Boolean field: Transmission Complete Interrupt Enable for
  5619. static const uint32_t LPUART0_CTRL_TCIE = 1U << 22 ;
  5620. // Boolean field: Transmit Interrupt Enable
  5621. static const uint32_t LPUART0_CTRL_TIE = 1U << 23 ;
  5622. // Boolean field: Parity Error Interrupt Enable
  5623. static const uint32_t LPUART0_CTRL_PEIE = 1U << 24 ;
  5624. // Boolean field: Framing Error Interrupt Enable
  5625. static const uint32_t LPUART0_CTRL_FEIE = 1U << 25 ;
  5626. // Boolean field: Noise Error Interrupt Enable
  5627. static const uint32_t LPUART0_CTRL_NEIE = 1U << 26 ;
  5628. // Boolean field: Overrun Interrupt Enable
  5629. static const uint32_t LPUART0_CTRL_ORIE = 1U << 27 ;
  5630. // Boolean field: Transmit Data Inversion
  5631. static const uint32_t LPUART0_CTRL_TXINV = 1U << 28 ;
  5632. // Boolean field: LPUART_TX Pin Direction in Single-Wire Mode
  5633. static const uint32_t LPUART0_CTRL_TXDIR = 1U << 29 ;
  5634. // Boolean field: Receive Bit 9 / Transmit Bit 8
  5635. static const uint32_t LPUART0_CTRL_R9T8 = 1U << 30 ;
  5636. // Boolean field: Receive Bit 8 / Transmit Bit 9
  5637. static const uint32_t LPUART0_CTRL_R8T9 = 1U << 31 ;
  5638. //-------------------- LPUART Data Register
  5639. #define LPUART0_DATA (* ((volatile uint32_t *) (0x400C4000 + 0xC)))
  5640. // Boolean field: Read receive data buffer 0 or write transmit data buffer 0.
  5641. static const uint32_t LPUART0_DATA_R0T0 = 1U << 0 ;
  5642. // Boolean field: Read receive data buffer 1 or write transmit data buffer 1.
  5643. static const uint32_t LPUART0_DATA_R1T1 = 1U << 1 ;
  5644. // Boolean field: Read receive data buffer 2 or write transmit data buffer 2.
  5645. static const uint32_t LPUART0_DATA_R2T2 = 1U << 2 ;
  5646. // Boolean field: Read receive data buffer 3 or write transmit data buffer 3.
  5647. static const uint32_t LPUART0_DATA_R3T3 = 1U << 3 ;
  5648. // Boolean field: Read receive data buffer 4 or write transmit data buffer 4.
  5649. static const uint32_t LPUART0_DATA_R4T4 = 1U << 4 ;
  5650. // Boolean field: Read receive data buffer 5 or write transmit data buffer 5.
  5651. static const uint32_t LPUART0_DATA_R5T5 = 1U << 5 ;
  5652. // Boolean field: Read receive data buffer 6 or write transmit data buffer 6.
  5653. static const uint32_t LPUART0_DATA_R6T6 = 1U << 6 ;
  5654. // Boolean field: Read receive data buffer 7 or write transmit data buffer 7.
  5655. static const uint32_t LPUART0_DATA_R7T7 = 1U << 7 ;
  5656. // Boolean field: Read receive data buffer 8 or write transmit data buffer 8.
  5657. static const uint32_t LPUART0_DATA_R8T8 = 1U << 8 ;
  5658. // Boolean field: Read receive data buffer 9 or write transmit data buffer 9.
  5659. static const uint32_t LPUART0_DATA_R9T9 = 1U << 9 ;
  5660. // Boolean field: Idle Line
  5661. static const uint32_t LPUART0_DATA_IDLINE = 1U << 11 ;
  5662. // Boolean field: Receive Buffer Empty
  5663. static const uint32_t LPUART0_DATA_RXEMPT = 1U << 12 ;
  5664. // Boolean field: Frame Error / Transmit Special Character
  5665. static const uint32_t LPUART0_DATA_FRETSC = 1U << 13 ;
  5666. // Boolean field: The current received dataword contained in DATA[R9:R0] was received with a parity error.
  5667. static const uint32_t LPUART0_DATA_PARITYE = 1U << 14 ;
  5668. // Boolean field: The current received dataword contained in DATA[R9:R0] was received with noise.
  5669. static const uint32_t LPUART0_DATA_NOISY = 1U << 15 ;
  5670. //-------------------- LPUART Match Address Register
  5671. #define LPUART0_MATCH (* ((volatile uint32_t *) (0x400C4000 + 0x10)))
  5672. // Field (width: 10 bits): Match Address 1
  5673. inline uint32_t LPUART0_MATCH_MA1 (const uint32_t inValue) { return (inValue & 1023U) << 0 ; }
  5674. // Field (width: 10 bits): Match Address 2
  5675. inline uint32_t LPUART0_MATCH_MA2 (const uint32_t inValue) { return (inValue & 1023U) << 16 ; }
  5676. //-------------------- LPUART Modem IrDA Register
  5677. #define LPUART0_MODIR (* ((volatile uint32_t *) (0x400C4000 + 0x14)))
  5678. // Boolean field: Transmitter clear-to-send enable
  5679. static const uint32_t LPUART0_MODIR_TXCTSE = 1U << 0 ;
  5680. // Boolean field: Transmitter request-to-send enable
  5681. static const uint32_t LPUART0_MODIR_TXRTSE = 1U << 1 ;
  5682. // Boolean field: Transmitter request-to-send polarity
  5683. static const uint32_t LPUART0_MODIR_TXRTSPOL = 1U << 2 ;
  5684. // Boolean field: Receiver request-to-send enable
  5685. static const uint32_t LPUART0_MODIR_RXRTSE = 1U << 3 ;
  5686. // Boolean field: Transmit CTS Configuration
  5687. static const uint32_t LPUART0_MODIR_TXCTSC = 1U << 4 ;
  5688. // Boolean field: Transmit CTS Source
  5689. static const uint32_t LPUART0_MODIR_TXCTSSRC = 1U << 5 ;
  5690. // Field (width: 2 bits): Transmitter narrow pulse
  5691. inline uint32_t LPUART0_MODIR_TNP (const uint32_t inValue) { return (inValue & 3U) << 16 ; }
  5692. // Boolean field: Infrared enable
  5693. static const uint32_t LPUART0_MODIR_IREN = 1U << 18 ;
  5694. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  5695. // Peripheral MCM
  5696. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  5697. //-------------------- Crossbar Switch (AXBS) Slave Configuration
  5698. #define MCM_PLASC (* ((const volatile uint16_t *) (0xE0080000 + 0x8)))
  5699. // Field (width: 8 bits): Each bit in the ASC field indicates whether there is a corresponding connection to the crossbar switch's slave input port.
  5700. inline uint16_t MCM_PLASC_ASC (const uint16_t inValue) { return (inValue & 255U) << 0 ; }
  5701. //-------------------- Crossbar Switch (AXBS) Master Configuration
  5702. #define MCM_PLAMC (* ((const volatile uint16_t *) (0xE0080000 + 0xA)))
  5703. // Field (width: 8 bits): Each bit in the AMC field indicates whether there is a corresponding connection to the AXBS master input port.
  5704. inline uint16_t MCM_PLAMC_AMC (const uint16_t inValue) { return (inValue & 255U) << 0 ; }
  5705. //-------------------- Control Register
  5706. #define MCM_CR (* ((volatile uint32_t *) (0xE0080000 + 0xC)))
  5707. // Field (width: 2 bits): SRAM_U arbitration priority
  5708. inline uint32_t MCM_CR_SRAMUAP (const uint32_t inValue) { return (inValue & 3U) << 24 ; }
  5709. // Boolean field: SRAM_U write protect
  5710. static const uint32_t MCM_CR_SRAMUWP = 1U << 26 ;
  5711. // Field (width: 2 bits): SRAM_L arbitration priority
  5712. inline uint32_t MCM_CR_SRAMLAP (const uint32_t inValue) { return (inValue & 3U) << 28 ; }
  5713. // Boolean field: SRAM_L Write Protect
  5714. static const uint32_t MCM_CR_SRAMLWP = 1U << 30 ;
  5715. //-------------------- Interrupt Status Register
  5716. #define MCM_ISCR (* ((volatile uint32_t *) (0xE0080000 + 0x10)))
  5717. // Boolean field: Normal Interrupt Pending
  5718. static const uint32_t MCM_ISCR_IRQ = 1U << 1 ;
  5719. // Boolean field: Non-maskable Interrupt Pending
  5720. static const uint32_t MCM_ISCR_NMI = 1U << 2 ;
  5721. // Boolean field: Debug Halt Request Indicator
  5722. static const uint32_t MCM_ISCR_DHREQ = 1U << 3 ;
  5723. // Boolean field: FPU invalid operation interrupt status
  5724. static const uint32_t MCM_ISCR_FIOC = 1U << 8 ;
  5725. // Boolean field: FPU divide-by-zero interrupt status
  5726. static const uint32_t MCM_ISCR_FDZC = 1U << 9 ;
  5727. // Boolean field: FPU overflow interrupt status
  5728. static const uint32_t MCM_ISCR_FOFC = 1U << 10 ;
  5729. // Boolean field: FPU underflow interrupt status
  5730. static const uint32_t MCM_ISCR_FUFC = 1U << 11 ;
  5731. // Boolean field: FPU inexact interrupt status
  5732. static const uint32_t MCM_ISCR_FIXC = 1U << 12 ;
  5733. // Boolean field: FPU input denormal interrupt status
  5734. static const uint32_t MCM_ISCR_FIDC = 1U << 15 ;
  5735. // Boolean field: FPU invalid operation interrupt enable
  5736. static const uint32_t MCM_ISCR_FIOCE = 1U << 24 ;
  5737. // Boolean field: FPU divide-by-zero interrupt enable
  5738. static const uint32_t MCM_ISCR_FDZCE = 1U << 25 ;
  5739. // Boolean field: FPU overflow interrupt enable
  5740. static const uint32_t MCM_ISCR_FOFCE = 1U << 26 ;
  5741. // Boolean field: FPU underflow interrupt enable
  5742. static const uint32_t MCM_ISCR_FUFCE = 1U << 27 ;
  5743. // Boolean field: FPU inexact interrupt enable
  5744. static const uint32_t MCM_ISCR_FIXCE = 1U << 28 ;
  5745. // Boolean field: FPU input denormal interrupt enable
  5746. static const uint32_t MCM_ISCR_FIDCE = 1U << 31 ;
  5747. //-------------------- ETB Counter Control register
  5748. #define MCM_ETBCC (* ((volatile uint32_t *) (0xE0080000 + 0x14)))
  5749. // Boolean field: Counter Enable
  5750. static const uint32_t MCM_ETBCC_CNTEN = 1U << 0 ;
  5751. // Field (width: 2 bits): Response Type
  5752. inline uint32_t MCM_ETBCC_RSPT (const uint32_t inValue) { return (inValue & 3U) << 1 ; }
  5753. // Boolean field: Reload Request
  5754. static const uint32_t MCM_ETBCC_RLRQ = 1U << 3 ;
  5755. // Boolean field: ETM-To-TPIU Disable
  5756. static const uint32_t MCM_ETBCC_ETDIS = 1U << 4 ;
  5757. // Boolean field: ITM-To-TPIU Disable
  5758. static const uint32_t MCM_ETBCC_ITDIS = 1U << 5 ;
  5759. //-------------------- ETB Reload register
  5760. #define MCM_ETBRL (* ((volatile uint32_t *) (0xE0080000 + 0x18)))
  5761. // Field (width: 11 bits): Byte Count Reload Value
  5762. inline uint32_t MCM_ETBRL_RELOAD (const uint32_t inValue) { return (inValue & 2047U) << 0 ; }
  5763. //-------------------- ETB Counter Value register
  5764. #define MCM_ETBCNT (* ((const volatile uint32_t *) (0xE0080000 + 0x1C)))
  5765. // Field (width: 11 bits): Byte Count Counter Value
  5766. inline uint32_t MCM_ETBCNT_COUNTER (const uint32_t inValue) { return (inValue & 2047U) << 0 ; }
  5767. //-------------------- Fault address register
  5768. #define MCM_FADR (* ((const volatile uint32_t *) (0xE0080000 + 0x20)))
  5769. //-------------------- Fault attributes register
  5770. #define MCM_FATR (* ((const volatile uint32_t *) (0xE0080000 + 0x24)))
  5771. // Boolean field: Bus error access type
  5772. static const uint32_t MCM_FATR_BEDA = 1U << 0 ;
  5773. // Boolean field: Bus error privilege level
  5774. static const uint32_t MCM_FATR_BEMD = 1U << 1 ;
  5775. // Field (width: 2 bits): Bus error size
  5776. inline uint32_t MCM_FATR_BESZ (const uint32_t inValue) { return (inValue & 3U) << 4 ; }
  5777. // Boolean field: Bus error write
  5778. static const uint32_t MCM_FATR_BEWT = 1U << 7 ;
  5779. // Field (width: 4 bits): Bus error master number
  5780. inline uint32_t MCM_FATR_BEMN (const uint32_t inValue) { return (inValue & 15U) << 8 ; }
  5781. // Boolean field: Bus error overrun
  5782. static const uint32_t MCM_FATR_BEOVR = 1U << 31 ;
  5783. //-------------------- Fault data register
  5784. #define MCM_FDR (* ((const volatile uint32_t *) (0xE0080000 + 0x28)))
  5785. //-------------------- Process ID register
  5786. #define MCM_PID (* ((volatile uint32_t *) (0xE0080000 + 0x30)))
  5787. // Field (width: 8 bits): M0_PID And M1_PID For MPU
  5788. inline uint32_t MCM_PID_PID (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  5789. //-------------------- Compute Operation Control Register
  5790. #define MCM_CPO (* ((volatile uint32_t *) (0xE0080000 + 0x40)))
  5791. // Boolean field: Compute Operation request
  5792. static const uint32_t MCM_CPO_CPOREQ = 1U << 0 ;
  5793. // Boolean field: Compute Operation acknowledge
  5794. static const uint32_t MCM_CPO_CPOACK = 1U << 1 ;
  5795. // Boolean field: Compute Operation wakeup on interrupt
  5796. static const uint32_t MCM_CPO_CPOWOI = 1U << 2 ;
  5797. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  5798. // Peripheral CAU
  5799. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  5800. //-------------------- Direct access register 0
  5801. #define CAU_CAU_DIRECT0 (* ((volatile uint32_t *) (0xE0081000 + 0)))
  5802. //-------------------- Direct access register 1
  5803. #define CAU_CAU_DIRECT1 (* ((volatile uint32_t *) (0xE0081000 + 0x4)))
  5804. //-------------------- Direct access register 2
  5805. #define CAU_CAU_DIRECT2 (* ((volatile uint32_t *) (0xE0081000 + 0x8)))
  5806. //-------------------- Direct access register 3
  5807. #define CAU_CAU_DIRECT3 (* ((volatile uint32_t *) (0xE0081000 + 0xC)))
  5808. //-------------------- Direct access register 4
  5809. #define CAU_CAU_DIRECT4 (* ((volatile uint32_t *) (0xE0081000 + 0x10)))
  5810. //-------------------- Direct access register 5
  5811. #define CAU_CAU_DIRECT5 (* ((volatile uint32_t *) (0xE0081000 + 0x14)))
  5812. //-------------------- Direct access register 6
  5813. #define CAU_CAU_DIRECT6 (* ((volatile uint32_t *) (0xE0081000 + 0x18)))
  5814. //-------------------- Direct access register 7
  5815. #define CAU_CAU_DIRECT7 (* ((volatile uint32_t *) (0xE0081000 + 0x1C)))
  5816. //-------------------- Direct access register 8
  5817. #define CAU_CAU_DIRECT8 (* ((volatile uint32_t *) (0xE0081000 + 0x20)))
  5818. //-------------------- Direct access register 9
  5819. #define CAU_CAU_DIRECT9 (* ((volatile uint32_t *) (0xE0081000 + 0x24)))
  5820. //-------------------- Direct access register 10
  5821. #define CAU_CAU_DIRECT10 (* ((volatile uint32_t *) (0xE0081000 + 0x28)))
  5822. //-------------------- Direct access register 11
  5823. #define CAU_CAU_DIRECT11 (* ((volatile uint32_t *) (0xE0081000 + 0x2C)))
  5824. //-------------------- Direct access register 12
  5825. #define CAU_CAU_DIRECT12 (* ((volatile uint32_t *) (0xE0081000 + 0x30)))
  5826. //-------------------- Direct access register 13
  5827. #define CAU_CAU_DIRECT13 (* ((volatile uint32_t *) (0xE0081000 + 0x34)))
  5828. //-------------------- Direct access register 14
  5829. #define CAU_CAU_DIRECT14 (* ((volatile uint32_t *) (0xE0081000 + 0x38)))
  5830. //-------------------- Direct access register 15
  5831. #define CAU_CAU_DIRECT15 (* ((volatile uint32_t *) (0xE0081000 + 0x3C)))
  5832. //-------------------- Status register - Load Register command
  5833. #define CAU_CAU_LDR_CASR (* ((volatile uint32_t *) (0xE0081000 + 0x840)))
  5834. // Boolean field: no description available
  5835. static const uint32_t CAU_CAU_LDR_CASR_IC = 1U << 0 ;
  5836. // Boolean field: no description available
  5837. static const uint32_t CAU_CAU_LDR_CASR_DPE = 1U << 1 ;
  5838. // Field (width: 4 bits): CAU version
  5839. inline uint32_t CAU_CAU_LDR_CASR_VER (const uint32_t inValue) { return (inValue & 15U) << 28 ; }
  5840. //-------------------- Accumulator register - Load Register command
  5841. #define CAU_CAU_LDR_CAA (* ((volatile uint32_t *) (0xE0081000 + 0x844)))
  5842. //-------------------- General Purpose Register 0 - Load Register command
  5843. #define CAU_CAU_LDR_CA0 (* ((volatile uint32_t *) (0xE0081000 + 0x848)))
  5844. //-------------------- General Purpose Register 1 - Load Register command
  5845. #define CAU_CAU_LDR_CA1 (* ((volatile uint32_t *) (0xE0081000 + 0x84C)))
  5846. //-------------------- General Purpose Register 2 - Load Register command
  5847. #define CAU_CAU_LDR_CA2 (* ((volatile uint32_t *) (0xE0081000 + 0x850)))
  5848. //-------------------- General Purpose Register 3 - Load Register command
  5849. #define CAU_CAU_LDR_CA3 (* ((volatile uint32_t *) (0xE0081000 + 0x854)))
  5850. //-------------------- General Purpose Register 4 - Load Register command
  5851. #define CAU_CAU_LDR_CA4 (* ((volatile uint32_t *) (0xE0081000 + 0x858)))
  5852. //-------------------- General Purpose Register 5 - Load Register command
  5853. #define CAU_CAU_LDR_CA5 (* ((volatile uint32_t *) (0xE0081000 + 0x85C)))
  5854. //-------------------- General Purpose Register 6 - Load Register command
  5855. #define CAU_CAU_LDR_CA6 (* ((volatile uint32_t *) (0xE0081000 + 0x860)))
  5856. //-------------------- General Purpose Register 7 - Load Register command
  5857. #define CAU_CAU_LDR_CA7 (* ((volatile uint32_t *) (0xE0081000 + 0x864)))
  5858. //-------------------- General Purpose Register 8 - Load Register command
  5859. #define CAU_CAU_LDR_CA8 (* ((volatile uint32_t *) (0xE0081000 + 0x868)))
  5860. //-------------------- Status register - Store Register command
  5861. #define CAU_CAU_STR_CASR (* ((const volatile uint32_t *) (0xE0081000 + 0x880)))
  5862. // Boolean field: no description available
  5863. static const uint32_t CAU_CAU_STR_CASR_IC = 1U << 0 ;
  5864. // Boolean field: no description available
  5865. static const uint32_t CAU_CAU_STR_CASR_DPE = 1U << 1 ;
  5866. // Field (width: 4 bits): CAU version
  5867. inline uint32_t CAU_CAU_STR_CASR_VER (const uint32_t inValue) { return (inValue & 15U) << 28 ; }
  5868. //-------------------- Accumulator register - Store Register command
  5869. #define CAU_CAU_STR_CAA (* ((const volatile uint32_t *) (0xE0081000 + 0x884)))
  5870. //-------------------- General Purpose Register 0 - Store Register command
  5871. #define CAU_CAU_STR_CA0 (* ((const volatile uint32_t *) (0xE0081000 + 0x888)))
  5872. //-------------------- General Purpose Register 1 - Store Register command
  5873. #define CAU_CAU_STR_CA1 (* ((const volatile uint32_t *) (0xE0081000 + 0x88C)))
  5874. //-------------------- General Purpose Register 2 - Store Register command
  5875. #define CAU_CAU_STR_CA2 (* ((const volatile uint32_t *) (0xE0081000 + 0x890)))
  5876. //-------------------- General Purpose Register 3 - Store Register command
  5877. #define CAU_CAU_STR_CA3 (* ((const volatile uint32_t *) (0xE0081000 + 0x894)))
  5878. //-------------------- General Purpose Register 4 - Store Register command
  5879. #define CAU_CAU_STR_CA4 (* ((const volatile uint32_t *) (0xE0081000 + 0x898)))
  5880. //-------------------- General Purpose Register 5 - Store Register command
  5881. #define CAU_CAU_STR_CA5 (* ((const volatile uint32_t *) (0xE0081000 + 0x89C)))
  5882. //-------------------- General Purpose Register 6 - Store Register command
  5883. #define CAU_CAU_STR_CA6 (* ((const volatile uint32_t *) (0xE0081000 + 0x8A0)))
  5884. //-------------------- General Purpose Register 7 - Store Register command
  5885. #define CAU_CAU_STR_CA7 (* ((const volatile uint32_t *) (0xE0081000 + 0x8A4)))
  5886. //-------------------- General Purpose Register 8 - Store Register command
  5887. #define CAU_CAU_STR_CA8 (* ((const volatile uint32_t *) (0xE0081000 + 0x8A8)))
  5888. //-------------------- Status register - Add Register command
  5889. #define CAU_CAU_ADR_CASR (* ((volatile uint32_t *) (0xE0081000 + 0x8C0)))
  5890. // Boolean field: no description available
  5891. static const uint32_t CAU_CAU_ADR_CASR_IC = 1U << 0 ;
  5892. // Boolean field: no description available
  5893. static const uint32_t CAU_CAU_ADR_CASR_DPE = 1U << 1 ;
  5894. // Field (width: 4 bits): CAU version
  5895. inline uint32_t CAU_CAU_ADR_CASR_VER (const uint32_t inValue) { return (inValue & 15U) << 28 ; }
  5896. //-------------------- Accumulator register - Add to register command
  5897. #define CAU_CAU_ADR_CAA (* ((volatile uint32_t *) (0xE0081000 + 0x8C4)))
  5898. //-------------------- General Purpose Register 0 - Add to register command
  5899. #define CAU_CAU_ADR_CA0 (* ((volatile uint32_t *) (0xE0081000 + 0x8C8)))
  5900. //-------------------- General Purpose Register 1 - Add to register command
  5901. #define CAU_CAU_ADR_CA1 (* ((volatile uint32_t *) (0xE0081000 + 0x8CC)))
  5902. //-------------------- General Purpose Register 2 - Add to register command
  5903. #define CAU_CAU_ADR_CA2 (* ((volatile uint32_t *) (0xE0081000 + 0x8D0)))
  5904. //-------------------- General Purpose Register 3 - Add to register command
  5905. #define CAU_CAU_ADR_CA3 (* ((volatile uint32_t *) (0xE0081000 + 0x8D4)))
  5906. //-------------------- General Purpose Register 4 - Add to register command
  5907. #define CAU_CAU_ADR_CA4 (* ((volatile uint32_t *) (0xE0081000 + 0x8D8)))
  5908. //-------------------- General Purpose Register 5 - Add to register command
  5909. #define CAU_CAU_ADR_CA5 (* ((volatile uint32_t *) (0xE0081000 + 0x8DC)))
  5910. //-------------------- General Purpose Register 6 - Add to register command
  5911. #define CAU_CAU_ADR_CA6 (* ((volatile uint32_t *) (0xE0081000 + 0x8E0)))
  5912. //-------------------- General Purpose Register 7 - Add to register command
  5913. #define CAU_CAU_ADR_CA7 (* ((volatile uint32_t *) (0xE0081000 + 0x8E4)))
  5914. //-------------------- General Purpose Register 8 - Add to register command
  5915. #define CAU_CAU_ADR_CA8 (* ((volatile uint32_t *) (0xE0081000 + 0x8E8)))
  5916. //-------------------- Status register - Reverse and Add to Register command
  5917. #define CAU_CAU_RADR_CASR (* ((volatile uint32_t *) (0xE0081000 + 0x900)))
  5918. // Boolean field: no description available
  5919. static const uint32_t CAU_CAU_RADR_CASR_IC = 1U << 0 ;
  5920. // Boolean field: no description available
  5921. static const uint32_t CAU_CAU_RADR_CASR_DPE = 1U << 1 ;
  5922. // Field (width: 4 bits): CAU version
  5923. inline uint32_t CAU_CAU_RADR_CASR_VER (const uint32_t inValue) { return (inValue & 15U) << 28 ; }
  5924. //-------------------- Accumulator register - Reverse and Add to Register command
  5925. #define CAU_CAU_RADR_CAA (* ((volatile uint32_t *) (0xE0081000 + 0x904)))
  5926. //-------------------- General Purpose Register 0 - Reverse and Add to Register command
  5927. #define CAU_CAU_RADR_CA0 (* ((volatile uint32_t *) (0xE0081000 + 0x908)))
  5928. //-------------------- General Purpose Register 1 - Reverse and Add to Register command
  5929. #define CAU_CAU_RADR_CA1 (* ((volatile uint32_t *) (0xE0081000 + 0x90C)))
  5930. //-------------------- General Purpose Register 2 - Reverse and Add to Register command
  5931. #define CAU_CAU_RADR_CA2 (* ((volatile uint32_t *) (0xE0081000 + 0x910)))
  5932. //-------------------- General Purpose Register 3 - Reverse and Add to Register command
  5933. #define CAU_CAU_RADR_CA3 (* ((volatile uint32_t *) (0xE0081000 + 0x914)))
  5934. //-------------------- General Purpose Register 4 - Reverse and Add to Register command
  5935. #define CAU_CAU_RADR_CA4 (* ((volatile uint32_t *) (0xE0081000 + 0x918)))
  5936. //-------------------- General Purpose Register 5 - Reverse and Add to Register command
  5937. #define CAU_CAU_RADR_CA5 (* ((volatile uint32_t *) (0xE0081000 + 0x91C)))
  5938. //-------------------- General Purpose Register 6 - Reverse and Add to Register command
  5939. #define CAU_CAU_RADR_CA6 (* ((volatile uint32_t *) (0xE0081000 + 0x920)))
  5940. //-------------------- General Purpose Register 7 - Reverse and Add to Register command
  5941. #define CAU_CAU_RADR_CA7 (* ((volatile uint32_t *) (0xE0081000 + 0x924)))
  5942. //-------------------- General Purpose Register 8 - Reverse and Add to Register command
  5943. #define CAU_CAU_RADR_CA8 (* ((volatile uint32_t *) (0xE0081000 + 0x928)))
  5944. //-------------------- Status register - Exclusive Or command
  5945. #define CAU_CAU_XOR_CASR (* ((volatile uint32_t *) (0xE0081000 + 0x980)))
  5946. // Boolean field: no description available
  5947. static const uint32_t CAU_CAU_XOR_CASR_IC = 1U << 0 ;
  5948. // Boolean field: no description available
  5949. static const uint32_t CAU_CAU_XOR_CASR_DPE = 1U << 1 ;
  5950. // Field (width: 4 bits): CAU version
  5951. inline uint32_t CAU_CAU_XOR_CASR_VER (const uint32_t inValue) { return (inValue & 15U) << 28 ; }
  5952. //-------------------- Accumulator register - Exclusive Or command
  5953. #define CAU_CAU_XOR_CAA (* ((volatile uint32_t *) (0xE0081000 + 0x984)))
  5954. //-------------------- General Purpose Register 0 - Exclusive Or command
  5955. #define CAU_CAU_XOR_CA0 (* ((volatile uint32_t *) (0xE0081000 + 0x988)))
  5956. //-------------------- General Purpose Register 1 - Exclusive Or command
  5957. #define CAU_CAU_XOR_CA1 (* ((volatile uint32_t *) (0xE0081000 + 0x98C)))
  5958. //-------------------- General Purpose Register 2 - Exclusive Or command
  5959. #define CAU_CAU_XOR_CA2 (* ((volatile uint32_t *) (0xE0081000 + 0x990)))
  5960. //-------------------- General Purpose Register 3 - Exclusive Or command
  5961. #define CAU_CAU_XOR_CA3 (* ((volatile uint32_t *) (0xE0081000 + 0x994)))
  5962. //-------------------- General Purpose Register 4 - Exclusive Or command
  5963. #define CAU_CAU_XOR_CA4 (* ((volatile uint32_t *) (0xE0081000 + 0x998)))
  5964. //-------------------- General Purpose Register 5 - Exclusive Or command
  5965. #define CAU_CAU_XOR_CA5 (* ((volatile uint32_t *) (0xE0081000 + 0x99C)))
  5966. //-------------------- General Purpose Register 6 - Exclusive Or command
  5967. #define CAU_CAU_XOR_CA6 (* ((volatile uint32_t *) (0xE0081000 + 0x9A0)))
  5968. //-------------------- General Purpose Register 7 - Exclusive Or command
  5969. #define CAU_CAU_XOR_CA7 (* ((volatile uint32_t *) (0xE0081000 + 0x9A4)))
  5970. //-------------------- General Purpose Register 8 - Exclusive Or command
  5971. #define CAU_CAU_XOR_CA8 (* ((volatile uint32_t *) (0xE0081000 + 0x9A8)))
  5972. //-------------------- Status register - Rotate Left command
  5973. #define CAU_CAU_ROTL_CASR (* ((volatile uint32_t *) (0xE0081000 + 0x9C0)))
  5974. // Boolean field: no description available
  5975. static const uint32_t CAU_CAU_ROTL_CASR_IC = 1U << 0 ;
  5976. // Boolean field: no description available
  5977. static const uint32_t CAU_CAU_ROTL_CASR_DPE = 1U << 1 ;
  5978. // Field (width: 4 bits): CAU version
  5979. inline uint32_t CAU_CAU_ROTL_CASR_VER (const uint32_t inValue) { return (inValue & 15U) << 28 ; }
  5980. //-------------------- Accumulator register - Rotate Left command
  5981. #define CAU_CAU_ROTL_CAA (* ((volatile uint32_t *) (0xE0081000 + 0x9C4)))
  5982. //-------------------- General Purpose Register 0 - Rotate Left command
  5983. #define CAU_CAU_ROTL_CA0 (* ((volatile uint32_t *) (0xE0081000 + 0x9C8)))
  5984. //-------------------- General Purpose Register 1 - Rotate Left command
  5985. #define CAU_CAU_ROTL_CA1 (* ((volatile uint32_t *) (0xE0081000 + 0x9CC)))
  5986. //-------------------- General Purpose Register 2 - Rotate Left command
  5987. #define CAU_CAU_ROTL_CA2 (* ((volatile uint32_t *) (0xE0081000 + 0x9D0)))
  5988. //-------------------- General Purpose Register 3 - Rotate Left command
  5989. #define CAU_CAU_ROTL_CA3 (* ((volatile uint32_t *) (0xE0081000 + 0x9D4)))
  5990. //-------------------- General Purpose Register 4 - Rotate Left command
  5991. #define CAU_CAU_ROTL_CA4 (* ((volatile uint32_t *) (0xE0081000 + 0x9D8)))
  5992. //-------------------- General Purpose Register 5 - Rotate Left command
  5993. #define CAU_CAU_ROTL_CA5 (* ((volatile uint32_t *) (0xE0081000 + 0x9DC)))
  5994. //-------------------- General Purpose Register 6 - Rotate Left command
  5995. #define CAU_CAU_ROTL_CA6 (* ((volatile uint32_t *) (0xE0081000 + 0x9E0)))
  5996. //-------------------- General Purpose Register 7 - Rotate Left command
  5997. #define CAU_CAU_ROTL_CA7 (* ((volatile uint32_t *) (0xE0081000 + 0x9E4)))
  5998. //-------------------- General Purpose Register 8 - Rotate Left command
  5999. #define CAU_CAU_ROTL_CA8 (* ((volatile uint32_t *) (0xE0081000 + 0x9E8)))
  6000. //-------------------- Status register - AES Column Operation command
  6001. #define CAU_CAU_AESC_CASR (* ((volatile uint32_t *) (0xE0081000 + 0xB00)))
  6002. // Boolean field: no description available
  6003. static const uint32_t CAU_CAU_AESC_CASR_IC = 1U << 0 ;
  6004. // Boolean field: no description available
  6005. static const uint32_t CAU_CAU_AESC_CASR_DPE = 1U << 1 ;
  6006. // Field (width: 4 bits): CAU version
  6007. inline uint32_t CAU_CAU_AESC_CASR_VER (const uint32_t inValue) { return (inValue & 15U) << 28 ; }
  6008. //-------------------- Accumulator register - AES Column Operation command
  6009. #define CAU_CAU_AESC_CAA (* ((volatile uint32_t *) (0xE0081000 + 0xB04)))
  6010. //-------------------- General Purpose Register 0 - AES Column Operation command
  6011. #define CAU_CAU_AESC_CA0 (* ((volatile uint32_t *) (0xE0081000 + 0xB08)))
  6012. //-------------------- General Purpose Register 1 - AES Column Operation command
  6013. #define CAU_CAU_AESC_CA1 (* ((volatile uint32_t *) (0xE0081000 + 0xB0C)))
  6014. //-------------------- General Purpose Register 2 - AES Column Operation command
  6015. #define CAU_CAU_AESC_CA2 (* ((volatile uint32_t *) (0xE0081000 + 0xB10)))
  6016. //-------------------- General Purpose Register 3 - AES Column Operation command
  6017. #define CAU_CAU_AESC_CA3 (* ((volatile uint32_t *) (0xE0081000 + 0xB14)))
  6018. //-------------------- General Purpose Register 4 - AES Column Operation command
  6019. #define CAU_CAU_AESC_CA4 (* ((volatile uint32_t *) (0xE0081000 + 0xB18)))
  6020. //-------------------- General Purpose Register 5 - AES Column Operation command
  6021. #define CAU_CAU_AESC_CA5 (* ((volatile uint32_t *) (0xE0081000 + 0xB1C)))
  6022. //-------------------- General Purpose Register 6 - AES Column Operation command
  6023. #define CAU_CAU_AESC_CA6 (* ((volatile uint32_t *) (0xE0081000 + 0xB20)))
  6024. //-------------------- General Purpose Register 7 - AES Column Operation command
  6025. #define CAU_CAU_AESC_CA7 (* ((volatile uint32_t *) (0xE0081000 + 0xB24)))
  6026. //-------------------- General Purpose Register 8 - AES Column Operation command
  6027. #define CAU_CAU_AESC_CA8 (* ((volatile uint32_t *) (0xE0081000 + 0xB28)))
  6028. //-------------------- Status register - AES Inverse Column Operation command
  6029. #define CAU_CAU_AESIC_CASR (* ((volatile uint32_t *) (0xE0081000 + 0xB40)))
  6030. // Boolean field: no description available
  6031. static const uint32_t CAU_CAU_AESIC_CASR_IC = 1U << 0 ;
  6032. // Boolean field: no description available
  6033. static const uint32_t CAU_CAU_AESIC_CASR_DPE = 1U << 1 ;
  6034. // Field (width: 4 bits): CAU version
  6035. inline uint32_t CAU_CAU_AESIC_CASR_VER (const uint32_t inValue) { return (inValue & 15U) << 28 ; }
  6036. //-------------------- Accumulator register - AES Inverse Column Operation command
  6037. #define CAU_CAU_AESIC_CAA (* ((volatile uint32_t *) (0xE0081000 + 0xB44)))
  6038. //-------------------- General Purpose Register 0 - AES Inverse Column Operation command
  6039. #define CAU_CAU_AESIC_CA0 (* ((volatile uint32_t *) (0xE0081000 + 0xB48)))
  6040. //-------------------- General Purpose Register 1 - AES Inverse Column Operation command
  6041. #define CAU_CAU_AESIC_CA1 (* ((volatile uint32_t *) (0xE0081000 + 0xB4C)))
  6042. //-------------------- General Purpose Register 2 - AES Inverse Column Operation command
  6043. #define CAU_CAU_AESIC_CA2 (* ((volatile uint32_t *) (0xE0081000 + 0xB50)))
  6044. //-------------------- General Purpose Register 3 - AES Inverse Column Operation command
  6045. #define CAU_CAU_AESIC_CA3 (* ((volatile uint32_t *) (0xE0081000 + 0xB54)))
  6046. //-------------------- General Purpose Register 4 - AES Inverse Column Operation command
  6047. #define CAU_CAU_AESIC_CA4 (* ((volatile uint32_t *) (0xE0081000 + 0xB58)))
  6048. //-------------------- General Purpose Register 5 - AES Inverse Column Operation command
  6049. #define CAU_CAU_AESIC_CA5 (* ((volatile uint32_t *) (0xE0081000 + 0xB5C)))
  6050. //-------------------- General Purpose Register 6 - AES Inverse Column Operation command
  6051. #define CAU_CAU_AESIC_CA6 (* ((volatile uint32_t *) (0xE0081000 + 0xB60)))
  6052. //-------------------- General Purpose Register 7 - AES Inverse Column Operation command
  6053. #define CAU_CAU_AESIC_CA7 (* ((volatile uint32_t *) (0xE0081000 + 0xB64)))
  6054. //-------------------- General Purpose Register 8 - AES Inverse Column Operation command
  6055. #define CAU_CAU_AESIC_CA8 (* ((volatile uint32_t *) (0xE0081000 + 0xB68)))
  6056. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  6057. // Peripheral LMEM
  6058. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  6059. //-------------------- Cache control register
  6060. #define LMEM_PCCCR (* ((volatile uint32_t *) (0xE0082000 + 0)))
  6061. // Boolean field: Cache enable
  6062. static const uint32_t LMEM_PCCCR_ENCACHE = 1U << 0 ;
  6063. // Boolean field: Enable Write Buffer
  6064. static const uint32_t LMEM_PCCCR_ENWRBUF = 1U << 1 ;
  6065. // Boolean field: Forces all cacheable spaces to write through
  6066. static const uint32_t LMEM_PCCCR_PCCR2 = 1U << 2 ;
  6067. // Boolean field: Forces no allocation on cache misses (must also have PCCR2 asserted)
  6068. static const uint32_t LMEM_PCCCR_PCCR3 = 1U << 3 ;
  6069. // Boolean field: Invalidate Way 0
  6070. static const uint32_t LMEM_PCCCR_INVW0 = 1U << 24 ;
  6071. // Boolean field: Push Way 0
  6072. static const uint32_t LMEM_PCCCR_PUSHW0 = 1U << 25 ;
  6073. // Boolean field: Invalidate Way 1
  6074. static const uint32_t LMEM_PCCCR_INVW1 = 1U << 26 ;
  6075. // Boolean field: Push Way 1
  6076. static const uint32_t LMEM_PCCCR_PUSHW1 = 1U << 27 ;
  6077. // Boolean field: Initiate Cache Command
  6078. static const uint32_t LMEM_PCCCR_GO = 1U << 31 ;
  6079. //-------------------- Cache line control register
  6080. #define LMEM_PCCLCR (* ((volatile uint32_t *) (0xE0082000 + 0x4)))
  6081. // Boolean field: Initiate Cache Line Command
  6082. static const uint32_t LMEM_PCCLCR_LGO = 1U << 0 ;
  6083. // Field (width: 10 bits): Cache address
  6084. inline uint32_t LMEM_PCCLCR_CACHEADDR (const uint32_t inValue) { return (inValue & 1023U) << 2 ; }
  6085. // Boolean field: Way select
  6086. static const uint32_t LMEM_PCCLCR_WSEL = 1U << 14 ;
  6087. // Boolean field: Tag/Data Select
  6088. static const uint32_t LMEM_PCCLCR_TDSEL = 1U << 16 ;
  6089. // Boolean field: Line Command Initial Valid Bit
  6090. static const uint32_t LMEM_PCCLCR_LCIVB = 1U << 20 ;
  6091. // Boolean field: Line Command Initial Modified Bit
  6092. static const uint32_t LMEM_PCCLCR_LCIMB = 1U << 21 ;
  6093. // Boolean field: Line Command Way
  6094. static const uint32_t LMEM_PCCLCR_LCWAY = 1U << 22 ;
  6095. // Field (width: 2 bits): Line Command
  6096. inline uint32_t LMEM_PCCLCR_LCMD (const uint32_t inValue) { return (inValue & 3U) << 24 ; }
  6097. // Boolean field: Line Address Select
  6098. static const uint32_t LMEM_PCCLCR_LADSEL = 1U << 26 ;
  6099. // Boolean field: Line access type
  6100. static const uint32_t LMEM_PCCLCR_LACC = 1U << 27 ;
  6101. //-------------------- Cache search address register
  6102. #define LMEM_PCCSAR (* ((volatile uint32_t *) (0xE0082000 + 0x8)))
  6103. // Boolean field: Initiate Cache Line Command
  6104. static const uint32_t LMEM_PCCSAR_LGO = 1U << 0 ;
  6105. // Field (width: 30 bits): Physical Address
  6106. inline uint32_t LMEM_PCCSAR_PHYADDR (const uint32_t inValue) { return (inValue & 1073741823U) << 2 ; }
  6107. //-------------------- Cache read/write value register
  6108. #define LMEM_PCCCVR (* ((volatile uint32_t *) (0xE0082000 + 0xC)))
  6109. //-------------------- Cache regions mode register
  6110. #define LMEM_PCCRMR (* ((volatile uint32_t *) (0xE0082000 + 0x20)))
  6111. // Field (width: 2 bits): Region 15 mode
  6112. inline uint32_t LMEM_PCCRMR_R15 (const uint32_t inValue) { return (inValue & 3U) << 0 ; }
  6113. // Field (width: 2 bits): Region 14 mode
  6114. inline uint32_t LMEM_PCCRMR_R14 (const uint32_t inValue) { return (inValue & 3U) << 2 ; }
  6115. // Field (width: 2 bits): Region 13 mode
  6116. inline uint32_t LMEM_PCCRMR_R13 (const uint32_t inValue) { return (inValue & 3U) << 4 ; }
  6117. // Field (width: 2 bits): Region 12 mode
  6118. inline uint32_t LMEM_PCCRMR_R12 (const uint32_t inValue) { return (inValue & 3U) << 6 ; }
  6119. // Field (width: 2 bits): Region 11 mode
  6120. inline uint32_t LMEM_PCCRMR_R11 (const uint32_t inValue) { return (inValue & 3U) << 8 ; }
  6121. // Field (width: 2 bits): Region 10 mode
  6122. inline uint32_t LMEM_PCCRMR_R10 (const uint32_t inValue) { return (inValue & 3U) << 10 ; }
  6123. // Field (width: 2 bits): Region 9 mode
  6124. inline uint32_t LMEM_PCCRMR_R9 (const uint32_t inValue) { return (inValue & 3U) << 12 ; }
  6125. // Field (width: 2 bits): Region 8 mode
  6126. inline uint32_t LMEM_PCCRMR_R8 (const uint32_t inValue) { return (inValue & 3U) << 14 ; }
  6127. // Field (width: 2 bits): Region 7 mode
  6128. inline uint32_t LMEM_PCCRMR_R7 (const uint32_t inValue) { return (inValue & 3U) << 16 ; }
  6129. // Field (width: 2 bits): Region 6 mode
  6130. inline uint32_t LMEM_PCCRMR_R6 (const uint32_t inValue) { return (inValue & 3U) << 18 ; }
  6131. // Field (width: 2 bits): Region 5 mode
  6132. inline uint32_t LMEM_PCCRMR_R5 (const uint32_t inValue) { return (inValue & 3U) << 20 ; }
  6133. // Field (width: 2 bits): Region 4 mode
  6134. inline uint32_t LMEM_PCCRMR_R4 (const uint32_t inValue) { return (inValue & 3U) << 22 ; }
  6135. // Field (width: 2 bits): Region 3 mode
  6136. inline uint32_t LMEM_PCCRMR_R3 (const uint32_t inValue) { return (inValue & 3U) << 24 ; }
  6137. // Field (width: 2 bits): Region 2 mode
  6138. inline uint32_t LMEM_PCCRMR_R2 (const uint32_t inValue) { return (inValue & 3U) << 26 ; }
  6139. // Field (width: 2 bits): Region 1 mode
  6140. inline uint32_t LMEM_PCCRMR_R1 (const uint32_t inValue) { return (inValue & 3U) << 28 ; }
  6141. // Field (width: 2 bits): Region 0 mode
  6142. inline uint32_t LMEM_PCCRMR_R0 (const uint32_t inValue) { return (inValue & 3U) << 30 ; }
  6143. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  6144. // Peripheral group ADC
  6145. // ADC0 at 0x4003B000
  6146. // ADC1 at 0x400BB000
  6147. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  6148. static const uint32_t kBaseAddress_ADC [2] = {0x4003B000, 0x400BB000} ;
  6149. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  6150. //-------------------- ADC Minus-Side General Calibration Value Register
  6151. #define ADC_CLMD(group) (* ((volatile uint32_t *) (kBaseAddress_ADC [group] + 0x54)))
  6152. #define ADC0_CLMD (* ((volatile uint32_t *) (0x4003B000 + 0x54)))
  6153. #define ADC1_CLMD (* ((volatile uint32_t *) (0x400BB000 + 0x54)))
  6154. // Field (width: 6 bits): Calibration Value
  6155. inline uint32_t ADC_CLMD_CLMD (const uint32_t inValue) { return (inValue & 63U) << 0 ; }
  6156. //-------------------- ADC Configuration Register 2
  6157. #define ADC_CFG2(group) (* ((volatile uint32_t *) (kBaseAddress_ADC [group] + 0xC)))
  6158. #define ADC0_CFG2 (* ((volatile uint32_t *) (0x4003B000 + 0xC)))
  6159. #define ADC1_CFG2 (* ((volatile uint32_t *) (0x400BB000 + 0xC)))
  6160. // Boolean field: ADC Mux Select
  6161. static const uint32_t ADC_CFG2_MUXSEL = 1U << 4 ;
  6162. // Field (width: 2 bits): Long Sample Time Select
  6163. inline uint32_t ADC_CFG2_ADLSTS (const uint32_t inValue) { return (inValue & 3U) << 0 ; }
  6164. // Boolean field: High-Speed Configuration
  6165. static const uint32_t ADC_CFG2_ADHSC = 1U << 2 ;
  6166. // Boolean field: Asynchronous Clock Output Enable
  6167. static const uint32_t ADC_CFG2_ADACKEN = 1U << 3 ;
  6168. //-------------------- ADC Plus-Side General Calibration Value Register
  6169. #define ADC_CLPS(group) (* ((volatile uint32_t *) (kBaseAddress_ADC [group] + 0x38)))
  6170. #define ADC0_CLPS (* ((volatile uint32_t *) (0x4003B000 + 0x38)))
  6171. #define ADC1_CLPS (* ((volatile uint32_t *) (0x400BB000 + 0x38)))
  6172. // Field (width: 6 bits): Calibration Value
  6173. inline uint32_t ADC_CLPS_CLPS (const uint32_t inValue) { return (inValue & 63U) << 0 ; }
  6174. //-------------------- ADC Configuration Register 1
  6175. #define ADC_CFG1(group) (* ((volatile uint32_t *) (kBaseAddress_ADC [group] + 0x8)))
  6176. #define ADC0_CFG1 (* ((volatile uint32_t *) (0x4003B000 + 0x8)))
  6177. #define ADC1_CFG1 (* ((volatile uint32_t *) (0x400BB000 + 0x8)))
  6178. // Boolean field: Sample Time Configuration
  6179. static const uint32_t ADC_CFG1_ADLSMP = 1U << 4 ;
  6180. // Field (width: 2 bits): Clock Divide Select
  6181. inline uint32_t ADC_CFG1_ADIV (const uint32_t inValue) { return (inValue & 3U) << 5 ; }
  6182. // Field (width: 2 bits): Conversion mode selection
  6183. inline uint32_t ADC_CFG1_MODE (const uint32_t inValue) { return (inValue & 3U) << 2 ; }
  6184. // Field (width: 2 bits): Input Clock Select
  6185. inline uint32_t ADC_CFG1_ADICLK (const uint32_t inValue) { return (inValue & 3U) << 0 ; }
  6186. // Boolean field: Low-Power Configuration
  6187. static const uint32_t ADC_CFG1_ADLPC = 1U << 7 ;
  6188. //-------------------- ADC Minus-Side General Calibration Value Register
  6189. #define ADC_CLMS(group) (* ((volatile uint32_t *) (kBaseAddress_ADC [group] + 0x58)))
  6190. #define ADC0_CLMS (* ((volatile uint32_t *) (0x4003B000 + 0x58)))
  6191. #define ADC1_CLMS (* ((volatile uint32_t *) (0x400BB000 + 0x58)))
  6192. // Field (width: 6 bits): Calibration Value
  6193. inline uint32_t ADC_CLMS_CLMS (const uint32_t inValue) { return (inValue & 63U) << 0 ; }
  6194. //-------------------- ADC Plus-Side General Calibration Value Register
  6195. #define ADC_CLPD(group) (* ((volatile uint32_t *) (kBaseAddress_ADC [group] + 0x34)))
  6196. #define ADC0_CLPD (* ((volatile uint32_t *) (0x4003B000 + 0x34)))
  6197. #define ADC1_CLPD (* ((volatile uint32_t *) (0x400BB000 + 0x34)))
  6198. // Field (width: 6 bits): Calibration Value
  6199. inline uint32_t ADC_CLPD_CLPD (const uint32_t inValue) { return (inValue & 63U) << 0 ; }
  6200. //-------------------- ADC Status and Control Registers 1 (idx = 0 ... 1)
  6201. #define ADC_SC1(group,idx) (* ((volatile uint32_t *) (kBaseAddress_ADC [group] + 0 + 0x4 * (idx))))
  6202. #define ADC0_SC1(idx) (* ((volatile uint32_t *) (0x4003B000 + 0 + 0x4 * (idx))))
  6203. #define ADC1_SC1(idx) (* ((volatile uint32_t *) (0x400BB000 + 0 + 0x4 * (idx))))
  6204. // Boolean field: Conversion Complete Flag
  6205. static const uint32_t ADC_SC1_COCO = 1U << 7 ;
  6206. // Boolean field: Differential Mode Enable
  6207. static const uint32_t ADC_SC1_DIFF = 1U << 5 ;
  6208. // Boolean field: Interrupt Enable
  6209. static const uint32_t ADC_SC1_AIEN = 1U << 6 ;
  6210. // Field (width: 5 bits): Input channel select
  6211. inline uint32_t ADC_SC1_ADCH (const uint32_t inValue) { return (inValue & 31U) << 0 ; }
  6212. //-------------------- Compare Value Registers (idx = 0 ... 1)
  6213. #define ADC_CV(group,idx) (* ((volatile uint32_t *) (kBaseAddress_ADC [group] + 0x18 + 0x4 * (idx))))
  6214. #define ADC0_CV(idx) (* ((volatile uint32_t *) (0x4003B000 + 0x18 + 0x4 * (idx))))
  6215. #define ADC1_CV(idx) (* ((volatile uint32_t *) (0x400BB000 + 0x18 + 0x4 * (idx))))
  6216. // Field (width: 16 bits): Compare Value.
  6217. inline uint32_t ADC_CV_CV (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  6218. //-------------------- ADC Plus-Side Gain Register
  6219. #define ADC_PG(group) (* ((volatile uint32_t *) (kBaseAddress_ADC [group] + 0x2C)))
  6220. #define ADC0_PG (* ((volatile uint32_t *) (0x4003B000 + 0x2C)))
  6221. #define ADC1_PG (* ((volatile uint32_t *) (0x400BB000 + 0x2C)))
  6222. // Field (width: 16 bits): Plus-Side Gain
  6223. inline uint32_t ADC_PG_PG (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  6224. //-------------------- ADC Data Result Register (idx = 0 ... 1)
  6225. #define ADC_R(group,idx) (* ((const volatile uint32_t *) (kBaseAddress_ADC [group] + 0x10 + 0x4 * (idx))))
  6226. #define ADC0_R(idx) (* ((const volatile uint32_t *) (0x4003B000 + 0x10 + 0x4 * (idx))))
  6227. #define ADC1_R(idx) (* ((const volatile uint32_t *) (0x400BB000 + 0x10 + 0x4 * (idx))))
  6228. // Field (width: 16 bits): Data result
  6229. inline uint32_t ADC_R_D (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  6230. //-------------------- ADC Offset Correction Register
  6231. #define ADC_OFS(group) (* ((volatile uint32_t *) (kBaseAddress_ADC [group] + 0x28)))
  6232. #define ADC0_OFS (* ((volatile uint32_t *) (0x4003B000 + 0x28)))
  6233. #define ADC1_OFS (* ((volatile uint32_t *) (0x400BB000 + 0x28)))
  6234. // Field (width: 16 bits): Offset Error Correction Value
  6235. inline uint32_t ADC_OFS_OFS (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  6236. //-------------------- Status and Control Register 3
  6237. #define ADC_SC3(group) (* ((volatile uint32_t *) (kBaseAddress_ADC [group] + 0x24)))
  6238. #define ADC0_SC3 (* ((volatile uint32_t *) (0x4003B000 + 0x24)))
  6239. #define ADC1_SC3 (* ((volatile uint32_t *) (0x400BB000 + 0x24)))
  6240. // Boolean field: Hardware Average Enable
  6241. static const uint32_t ADC_SC3_AVGE = 1U << 2 ;
  6242. // Boolean field: Continuous Conversion Enable
  6243. static const uint32_t ADC_SC3_ADCO = 1U << 3 ;
  6244. // Boolean field: Calibration
  6245. static const uint32_t ADC_SC3_CAL = 1U << 7 ;
  6246. // Boolean field: Calibration Failed Flag
  6247. static const uint32_t ADC_SC3_CALF = 1U << 6 ;
  6248. // Field (width: 2 bits): Hardware Average Select
  6249. inline uint32_t ADC_SC3_AVGS (const uint32_t inValue) { return (inValue & 3U) << 0 ; }
  6250. //-------------------- Status and Control Register 2
  6251. #define ADC_SC2(group) (* ((volatile uint32_t *) (kBaseAddress_ADC [group] + 0x20)))
  6252. #define ADC0_SC2 (* ((volatile uint32_t *) (0x4003B000 + 0x20)))
  6253. #define ADC1_SC2 (* ((volatile uint32_t *) (0x400BB000 + 0x20)))
  6254. // Boolean field: DMA Enable
  6255. static const uint32_t ADC_SC2_DMAEN = 1U << 2 ;
  6256. // Field (width: 2 bits): Voltage Reference Selection
  6257. inline uint32_t ADC_SC2_REFSEL (const uint32_t inValue) { return (inValue & 3U) << 0 ; }
  6258. // Boolean field: Conversion Active
  6259. static const uint32_t ADC_SC2_ADACT = 1U << 7 ;
  6260. // Boolean field: Compare Function Greater Than Enable
  6261. static const uint32_t ADC_SC2_ACFGT = 1U << 4 ;
  6262. // Boolean field: Conversion Trigger Select
  6263. static const uint32_t ADC_SC2_ADTRG = 1U << 6 ;
  6264. // Boolean field: Compare Function Range Enable
  6265. static const uint32_t ADC_SC2_ACREN = 1U << 3 ;
  6266. // Boolean field: Compare Function Enable
  6267. static const uint32_t ADC_SC2_ACFE = 1U << 5 ;
  6268. //-------------------- ADC Minus-Side Gain Register
  6269. #define ADC_MG(group) (* ((volatile uint32_t *) (kBaseAddress_ADC [group] + 0x30)))
  6270. #define ADC0_MG (* ((volatile uint32_t *) (0x4003B000 + 0x30)))
  6271. #define ADC1_MG (* ((volatile uint32_t *) (0x400BB000 + 0x30)))
  6272. // Field (width: 16 bits): Minus-Side Gain
  6273. inline uint32_t ADC_MG_MG (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  6274. //-------------------- ADC Plus-Side General Calibration Value Register
  6275. #define ADC_CLP1(group) (* ((volatile uint32_t *) (kBaseAddress_ADC [group] + 0x48)))
  6276. #define ADC0_CLP1 (* ((volatile uint32_t *) (0x4003B000 + 0x48)))
  6277. #define ADC1_CLP1 (* ((volatile uint32_t *) (0x400BB000 + 0x48)))
  6278. // Field (width: 7 bits): Calibration Value
  6279. inline uint32_t ADC_CLP1_CLP1 (const uint32_t inValue) { return (inValue & 127U) << 0 ; }
  6280. //-------------------- ADC Plus-Side General Calibration Value Register
  6281. #define ADC_CLP0(group) (* ((volatile uint32_t *) (kBaseAddress_ADC [group] + 0x4C)))
  6282. #define ADC0_CLP0 (* ((volatile uint32_t *) (0x4003B000 + 0x4C)))
  6283. #define ADC1_CLP0 (* ((volatile uint32_t *) (0x400BB000 + 0x4C)))
  6284. // Field (width: 6 bits): Calibration Value
  6285. inline uint32_t ADC_CLP0_CLP0 (const uint32_t inValue) { return (inValue & 63U) << 0 ; }
  6286. //-------------------- ADC Plus-Side General Calibration Value Register
  6287. #define ADC_CLP3(group) (* ((volatile uint32_t *) (kBaseAddress_ADC [group] + 0x40)))
  6288. #define ADC0_CLP3 (* ((volatile uint32_t *) (0x4003B000 + 0x40)))
  6289. #define ADC1_CLP3 (* ((volatile uint32_t *) (0x400BB000 + 0x40)))
  6290. // Field (width: 9 bits): Calibration Value
  6291. inline uint32_t ADC_CLP3_CLP3 (const uint32_t inValue) { return (inValue & 511U) << 0 ; }
  6292. //-------------------- ADC Plus-Side General Calibration Value Register
  6293. #define ADC_CLP2(group) (* ((volatile uint32_t *) (kBaseAddress_ADC [group] + 0x44)))
  6294. #define ADC0_CLP2 (* ((volatile uint32_t *) (0x4003B000 + 0x44)))
  6295. #define ADC1_CLP2 (* ((volatile uint32_t *) (0x400BB000 + 0x44)))
  6296. // Field (width: 8 bits): Calibration Value
  6297. inline uint32_t ADC_CLP2_CLP2 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  6298. //-------------------- ADC Plus-Side General Calibration Value Register
  6299. #define ADC_CLP4(group) (* ((volatile uint32_t *) (kBaseAddress_ADC [group] + 0x3C)))
  6300. #define ADC0_CLP4 (* ((volatile uint32_t *) (0x4003B000 + 0x3C)))
  6301. #define ADC1_CLP4 (* ((volatile uint32_t *) (0x400BB000 + 0x3C)))
  6302. // Field (width: 10 bits): Calibration Value
  6303. inline uint32_t ADC_CLP4_CLP4 (const uint32_t inValue) { return (inValue & 1023U) << 0 ; }
  6304. //-------------------- ADC Minus-Side General Calibration Value Register
  6305. #define ADC_CLM2(group) (* ((volatile uint32_t *) (kBaseAddress_ADC [group] + 0x64)))
  6306. #define ADC0_CLM2 (* ((volatile uint32_t *) (0x4003B000 + 0x64)))
  6307. #define ADC1_CLM2 (* ((volatile uint32_t *) (0x400BB000 + 0x64)))
  6308. // Field (width: 8 bits): Calibration Value
  6309. inline uint32_t ADC_CLM2_CLM2 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  6310. //-------------------- ADC Minus-Side General Calibration Value Register
  6311. #define ADC_CLM3(group) (* ((volatile uint32_t *) (kBaseAddress_ADC [group] + 0x60)))
  6312. #define ADC0_CLM3 (* ((volatile uint32_t *) (0x4003B000 + 0x60)))
  6313. #define ADC1_CLM3 (* ((volatile uint32_t *) (0x400BB000 + 0x60)))
  6314. // Field (width: 9 bits): Calibration Value
  6315. inline uint32_t ADC_CLM3_CLM3 (const uint32_t inValue) { return (inValue & 511U) << 0 ; }
  6316. //-------------------- ADC Minus-Side General Calibration Value Register
  6317. #define ADC_CLM0(group) (* ((volatile uint32_t *) (kBaseAddress_ADC [group] + 0x6C)))
  6318. #define ADC0_CLM0 (* ((volatile uint32_t *) (0x4003B000 + 0x6C)))
  6319. #define ADC1_CLM0 (* ((volatile uint32_t *) (0x400BB000 + 0x6C)))
  6320. // Field (width: 6 bits): Calibration Value
  6321. inline uint32_t ADC_CLM0_CLM0 (const uint32_t inValue) { return (inValue & 63U) << 0 ; }
  6322. //-------------------- ADC Minus-Side General Calibration Value Register
  6323. #define ADC_CLM1(group) (* ((volatile uint32_t *) (kBaseAddress_ADC [group] + 0x68)))
  6324. #define ADC0_CLM1 (* ((volatile uint32_t *) (0x4003B000 + 0x68)))
  6325. #define ADC1_CLM1 (* ((volatile uint32_t *) (0x400BB000 + 0x68)))
  6326. // Field (width: 7 bits): Calibration Value
  6327. inline uint32_t ADC_CLM1_CLM1 (const uint32_t inValue) { return (inValue & 127U) << 0 ; }
  6328. //-------------------- ADC Minus-Side General Calibration Value Register
  6329. #define ADC_CLM4(group) (* ((volatile uint32_t *) (kBaseAddress_ADC [group] + 0x5C)))
  6330. #define ADC0_CLM4 (* ((volatile uint32_t *) (0x4003B000 + 0x5C)))
  6331. #define ADC1_CLM4 (* ((volatile uint32_t *) (0x400BB000 + 0x5C)))
  6332. // Field (width: 10 bits): Calibration Value
  6333. inline uint32_t ADC_CLM4_CLM4 (const uint32_t inValue) { return (inValue & 1023U) << 0 ; }
  6334. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  6335. // Peripheral group AIPS
  6336. // AIPS0 at 0x40000000
  6337. // AIPS1 at 0x40080000
  6338. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  6339. static const uint32_t kBaseAddress_AIPS [2] = {0x40000000, 0x40080000} ;
  6340. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  6341. //-------------------- Master Privilege Register A
  6342. #define AIPS_MPRA(group) (* ((volatile uint32_t *) (kBaseAddress_AIPS [group] + 0)))
  6343. #define AIPS0_MPRA (* ((volatile uint32_t *) (0x40000000 + 0)))
  6344. #define AIPS1_MPRA (* ((volatile uint32_t *) (0x40080000 + 0)))
  6345. // Boolean field: Master 6 Privilege Level
  6346. static const uint32_t AIPS_MPRA_MPL6 = 1U << 4 ;
  6347. // Boolean field: Master 5 Privilege Level
  6348. static const uint32_t AIPS_MPRA_MPL5 = 1U << 8 ;
  6349. // Boolean field: Master 4 Privilege Level
  6350. static const uint32_t AIPS_MPRA_MPL4 = 1U << 12 ;
  6351. // Boolean field: Master 3 Privilege Level
  6352. static const uint32_t AIPS_MPRA_MPL3 = 1U << 16 ;
  6353. // Boolean field: Master 2 Privilege Level
  6354. static const uint32_t AIPS_MPRA_MPL2 = 1U << 20 ;
  6355. // Boolean field: Master 1 Privilege Level
  6356. static const uint32_t AIPS_MPRA_MPL1 = 1U << 24 ;
  6357. // Boolean field: Master 0 Privilege Level
  6358. static const uint32_t AIPS_MPRA_MPL0 = 1U << 28 ;
  6359. // Boolean field: Master 5 Trusted For Read
  6360. static const uint32_t AIPS_MPRA_MTR5 = 1U << 10 ;
  6361. // Boolean field: Master 4 Trusted For Read
  6362. static const uint32_t AIPS_MPRA_MTR4 = 1U << 14 ;
  6363. // Boolean field: Master 6 Trusted for Read
  6364. static const uint32_t AIPS_MPRA_MTR6 = 1U << 6 ;
  6365. // Boolean field: Master 1 Trusted for Read
  6366. static const uint32_t AIPS_MPRA_MTR1 = 1U << 26 ;
  6367. // Boolean field: Master 0 Trusted For Read
  6368. static const uint32_t AIPS_MPRA_MTR0 = 1U << 30 ;
  6369. // Boolean field: Master 3 Trusted For Read
  6370. static const uint32_t AIPS_MPRA_MTR3 = 1U << 18 ;
  6371. // Boolean field: Master 2 Trusted For Read
  6372. static const uint32_t AIPS_MPRA_MTR2 = 1U << 22 ;
  6373. // Boolean field: Master 6 Trusted for Writes
  6374. static const uint32_t AIPS_MPRA_MTW6 = 1U << 5 ;
  6375. // Boolean field: Master 4 Trusted For Writes
  6376. static const uint32_t AIPS_MPRA_MTW4 = 1U << 13 ;
  6377. // Boolean field: Master 5 Trusted For Writes
  6378. static const uint32_t AIPS_MPRA_MTW5 = 1U << 9 ;
  6379. // Boolean field: Master 2 Trusted For Writes
  6380. static const uint32_t AIPS_MPRA_MTW2 = 1U << 21 ;
  6381. // Boolean field: Master 3 Trusted For Writes
  6382. static const uint32_t AIPS_MPRA_MTW3 = 1U << 17 ;
  6383. // Boolean field: Master 0 Trusted For Writes
  6384. static const uint32_t AIPS_MPRA_MTW0 = 1U << 29 ;
  6385. // Boolean field: Master 1 Trusted for Writes
  6386. static const uint32_t AIPS_MPRA_MTW1 = 1U << 25 ;
  6387. //-------------------- Peripheral Access Control Register
  6388. #define AIPS_PACRB(group) (* ((volatile uint32_t *) (kBaseAddress_AIPS [group] + 0x24)))
  6389. #define AIPS0_PACRB (* ((volatile uint32_t *) (0x40000000 + 0x24)))
  6390. #define AIPS1_PACRB (* ((volatile uint32_t *) (0x40080000 + 0x24)))
  6391. // Boolean field: Write Protect
  6392. static const uint32_t AIPS_PACRB_WP0 = 1U << 29 ;
  6393. // Boolean field: Trusted Protect
  6394. static const uint32_t AIPS_PACRB_TP0 = 1U << 28 ;
  6395. // Boolean field: Trusted Protect
  6396. static const uint32_t AIPS_PACRB_TP7 = 1U << 0 ;
  6397. // Boolean field: Trusted Protect
  6398. static const uint32_t AIPS_PACRB_TP6 = 1U << 4 ;
  6399. // Boolean field: Trusted Protect
  6400. static const uint32_t AIPS_PACRB_TP5 = 1U << 8 ;
  6401. // Boolean field: Trusted Protect
  6402. static const uint32_t AIPS_PACRB_TP4 = 1U << 12 ;
  6403. // Boolean field: Trusted Protect
  6404. static const uint32_t AIPS_PACRB_TP3 = 1U << 16 ;
  6405. // Boolean field: Trusted Protect
  6406. static const uint32_t AIPS_PACRB_TP2 = 1U << 20 ;
  6407. // Boolean field: Trusted Protect
  6408. static const uint32_t AIPS_PACRB_TP1 = 1U << 24 ;
  6409. // Boolean field: Supervisor Protect
  6410. static const uint32_t AIPS_PACRB_SP1 = 1U << 26 ;
  6411. // Boolean field: Supervisor Protect
  6412. static const uint32_t AIPS_PACRB_SP2 = 1U << 22 ;
  6413. // Boolean field: Write Protect
  6414. static const uint32_t AIPS_PACRB_WP7 = 1U << 1 ;
  6415. // Boolean field: Write Protect
  6416. static const uint32_t AIPS_PACRB_WP4 = 1U << 13 ;
  6417. // Boolean field: Write Protect
  6418. static const uint32_t AIPS_PACRB_WP5 = 1U << 9 ;
  6419. // Boolean field: Write Protect
  6420. static const uint32_t AIPS_PACRB_WP6 = 1U << 5 ;
  6421. // Boolean field: Supervisor Protect
  6422. static const uint32_t AIPS_PACRB_SP3 = 1U << 18 ;
  6423. // Boolean field: Supervisor Protect
  6424. static const uint32_t AIPS_PACRB_SP4 = 1U << 14 ;
  6425. // Boolean field: Write Protect
  6426. static const uint32_t AIPS_PACRB_WP1 = 1U << 25 ;
  6427. // Boolean field: Write Protect
  6428. static const uint32_t AIPS_PACRB_WP2 = 1U << 21 ;
  6429. // Boolean field: Supervisor Protect
  6430. static const uint32_t AIPS_PACRB_SP5 = 1U << 10 ;
  6431. // Boolean field: Supervisor Protect
  6432. static const uint32_t AIPS_PACRB_SP6 = 1U << 6 ;
  6433. // Boolean field: Supervisor Protect
  6434. static const uint32_t AIPS_PACRB_SP7 = 1U << 2 ;
  6435. // Boolean field: Write Protect
  6436. static const uint32_t AIPS_PACRB_WP3 = 1U << 17 ;
  6437. // Boolean field: Supervisor Protect
  6438. static const uint32_t AIPS_PACRB_SP0 = 1U << 30 ;
  6439. //-------------------- Peripheral Access Control Register
  6440. #define AIPS_PACRA(group) (* ((volatile uint32_t *) (kBaseAddress_AIPS [group] + 0x20)))
  6441. #define AIPS0_PACRA (* ((volatile uint32_t *) (0x40000000 + 0x20)))
  6442. #define AIPS1_PACRA (* ((volatile uint32_t *) (0x40080000 + 0x20)))
  6443. // Boolean field: Write Protect
  6444. static const uint32_t AIPS_PACRA_WP0 = 1U << 29 ;
  6445. // Boolean field: Trusted Protect
  6446. static const uint32_t AIPS_PACRA_TP0 = 1U << 28 ;
  6447. // Boolean field: Trusted Protect
  6448. static const uint32_t AIPS_PACRA_TP7 = 1U << 0 ;
  6449. // Boolean field: Trusted Protect
  6450. static const uint32_t AIPS_PACRA_TP6 = 1U << 4 ;
  6451. // Boolean field: Trusted Protect
  6452. static const uint32_t AIPS_PACRA_TP5 = 1U << 8 ;
  6453. // Boolean field: Trusted Protect
  6454. static const uint32_t AIPS_PACRA_TP4 = 1U << 12 ;
  6455. // Boolean field: Trusted Protect
  6456. static const uint32_t AIPS_PACRA_TP3 = 1U << 16 ;
  6457. // Boolean field: Trusted Protect
  6458. static const uint32_t AIPS_PACRA_TP2 = 1U << 20 ;
  6459. // Boolean field: Trusted Protect
  6460. static const uint32_t AIPS_PACRA_TP1 = 1U << 24 ;
  6461. // Boolean field: Supervisor Protect
  6462. static const uint32_t AIPS_PACRA_SP1 = 1U << 26 ;
  6463. // Boolean field: Supervisor Protect
  6464. static const uint32_t AIPS_PACRA_SP2 = 1U << 22 ;
  6465. // Boolean field: Write Protect
  6466. static const uint32_t AIPS_PACRA_WP7 = 1U << 1 ;
  6467. // Boolean field: Write Protect
  6468. static const uint32_t AIPS_PACRA_WP4 = 1U << 13 ;
  6469. // Boolean field: Write Protect
  6470. static const uint32_t AIPS_PACRA_WP5 = 1U << 9 ;
  6471. // Boolean field: Write Protect
  6472. static const uint32_t AIPS_PACRA_WP6 = 1U << 5 ;
  6473. // Boolean field: Supervisor Protect
  6474. static const uint32_t AIPS_PACRA_SP3 = 1U << 18 ;
  6475. // Boolean field: Supervisor Protect
  6476. static const uint32_t AIPS_PACRA_SP4 = 1U << 14 ;
  6477. // Boolean field: Write Protect
  6478. static const uint32_t AIPS_PACRA_WP1 = 1U << 25 ;
  6479. // Boolean field: Write Protect
  6480. static const uint32_t AIPS_PACRA_WP2 = 1U << 21 ;
  6481. // Boolean field: Supervisor Protect
  6482. static const uint32_t AIPS_PACRA_SP5 = 1U << 10 ;
  6483. // Boolean field: Supervisor Protect
  6484. static const uint32_t AIPS_PACRA_SP6 = 1U << 6 ;
  6485. // Boolean field: Supervisor Protect
  6486. static const uint32_t AIPS_PACRA_SP7 = 1U << 2 ;
  6487. // Boolean field: Write Protect
  6488. static const uint32_t AIPS_PACRA_WP3 = 1U << 17 ;
  6489. // Boolean field: Supervisor Protect
  6490. static const uint32_t AIPS_PACRA_SP0 = 1U << 30 ;
  6491. //-------------------- Peripheral Access Control Register
  6492. #define AIPS_PACRG(group) (* ((volatile uint32_t *) (kBaseAddress_AIPS [group] + 0x48)))
  6493. #define AIPS0_PACRG (* ((volatile uint32_t *) (0x40000000 + 0x48)))
  6494. #define AIPS1_PACRG (* ((volatile uint32_t *) (0x40080000 + 0x48)))
  6495. // Boolean field: Write Protect
  6496. static const uint32_t AIPS_PACRG_WP0 = 1U << 29 ;
  6497. // Boolean field: Trusted Protect
  6498. static const uint32_t AIPS_PACRG_TP0 = 1U << 28 ;
  6499. // Boolean field: Trusted Protect
  6500. static const uint32_t AIPS_PACRG_TP7 = 1U << 0 ;
  6501. // Boolean field: Trusted Protect
  6502. static const uint32_t AIPS_PACRG_TP6 = 1U << 4 ;
  6503. // Boolean field: Trusted Protect
  6504. static const uint32_t AIPS_PACRG_TP5 = 1U << 8 ;
  6505. // Boolean field: Trusted Protect
  6506. static const uint32_t AIPS_PACRG_TP4 = 1U << 12 ;
  6507. // Boolean field: Trusted Protect
  6508. static const uint32_t AIPS_PACRG_TP3 = 1U << 16 ;
  6509. // Boolean field: Trusted Protect
  6510. static const uint32_t AIPS_PACRG_TP2 = 1U << 20 ;
  6511. // Boolean field: Trusted Protect
  6512. static const uint32_t AIPS_PACRG_TP1 = 1U << 24 ;
  6513. // Boolean field: Supervisor Protect
  6514. static const uint32_t AIPS_PACRG_SP1 = 1U << 26 ;
  6515. // Boolean field: Supervisor Protect
  6516. static const uint32_t AIPS_PACRG_SP2 = 1U << 22 ;
  6517. // Boolean field: Write Protect
  6518. static const uint32_t AIPS_PACRG_WP7 = 1U << 1 ;
  6519. // Boolean field: Write Protect
  6520. static const uint32_t AIPS_PACRG_WP4 = 1U << 13 ;
  6521. // Boolean field: Write Protect
  6522. static const uint32_t AIPS_PACRG_WP5 = 1U << 9 ;
  6523. // Boolean field: Write Protect
  6524. static const uint32_t AIPS_PACRG_WP6 = 1U << 5 ;
  6525. // Boolean field: Supervisor Protect
  6526. static const uint32_t AIPS_PACRG_SP3 = 1U << 18 ;
  6527. // Boolean field: Supervisor Protect
  6528. static const uint32_t AIPS_PACRG_SP4 = 1U << 14 ;
  6529. // Boolean field: Write Protect
  6530. static const uint32_t AIPS_PACRG_WP1 = 1U << 25 ;
  6531. // Boolean field: Write Protect
  6532. static const uint32_t AIPS_PACRG_WP2 = 1U << 21 ;
  6533. // Boolean field: Supervisor Protect
  6534. static const uint32_t AIPS_PACRG_SP5 = 1U << 10 ;
  6535. // Boolean field: Supervisor Protect
  6536. static const uint32_t AIPS_PACRG_SP6 = 1U << 6 ;
  6537. // Boolean field: Supervisor Protect
  6538. static const uint32_t AIPS_PACRG_SP7 = 1U << 2 ;
  6539. // Boolean field: Write Protect
  6540. static const uint32_t AIPS_PACRG_WP3 = 1U << 17 ;
  6541. // Boolean field: Supervisor Protect
  6542. static const uint32_t AIPS_PACRG_SP0 = 1U << 30 ;
  6543. //-------------------- Peripheral Access Control Register
  6544. #define AIPS_PACRF(group) (* ((volatile uint32_t *) (kBaseAddress_AIPS [group] + 0x44)))
  6545. #define AIPS0_PACRF (* ((volatile uint32_t *) (0x40000000 + 0x44)))
  6546. #define AIPS1_PACRF (* ((volatile uint32_t *) (0x40080000 + 0x44)))
  6547. // Boolean field: Write Protect
  6548. static const uint32_t AIPS_PACRF_WP0 = 1U << 29 ;
  6549. // Boolean field: Trusted Protect
  6550. static const uint32_t AIPS_PACRF_TP0 = 1U << 28 ;
  6551. // Boolean field: Trusted Protect
  6552. static const uint32_t AIPS_PACRF_TP7 = 1U << 0 ;
  6553. // Boolean field: Trusted Protect
  6554. static const uint32_t AIPS_PACRF_TP6 = 1U << 4 ;
  6555. // Boolean field: Trusted Protect
  6556. static const uint32_t AIPS_PACRF_TP5 = 1U << 8 ;
  6557. // Boolean field: Trusted Protect
  6558. static const uint32_t AIPS_PACRF_TP4 = 1U << 12 ;
  6559. // Boolean field: Trusted Protect
  6560. static const uint32_t AIPS_PACRF_TP3 = 1U << 16 ;
  6561. // Boolean field: Trusted Protect
  6562. static const uint32_t AIPS_PACRF_TP2 = 1U << 20 ;
  6563. // Boolean field: Trusted Protect
  6564. static const uint32_t AIPS_PACRF_TP1 = 1U << 24 ;
  6565. // Boolean field: Supervisor Protect
  6566. static const uint32_t AIPS_PACRF_SP1 = 1U << 26 ;
  6567. // Boolean field: Supervisor Protect
  6568. static const uint32_t AIPS_PACRF_SP2 = 1U << 22 ;
  6569. // Boolean field: Write Protect
  6570. static const uint32_t AIPS_PACRF_WP7 = 1U << 1 ;
  6571. // Boolean field: Write Protect
  6572. static const uint32_t AIPS_PACRF_WP4 = 1U << 13 ;
  6573. // Boolean field: Write Protect
  6574. static const uint32_t AIPS_PACRF_WP5 = 1U << 9 ;
  6575. // Boolean field: Write Protect
  6576. static const uint32_t AIPS_PACRF_WP6 = 1U << 5 ;
  6577. // Boolean field: Supervisor Protect
  6578. static const uint32_t AIPS_PACRF_SP3 = 1U << 18 ;
  6579. // Boolean field: Supervisor Protect
  6580. static const uint32_t AIPS_PACRF_SP4 = 1U << 14 ;
  6581. // Boolean field: Write Protect
  6582. static const uint32_t AIPS_PACRF_WP1 = 1U << 25 ;
  6583. // Boolean field: Write Protect
  6584. static const uint32_t AIPS_PACRF_WP2 = 1U << 21 ;
  6585. // Boolean field: Supervisor Protect
  6586. static const uint32_t AIPS_PACRF_SP5 = 1U << 10 ;
  6587. // Boolean field: Supervisor Protect
  6588. static const uint32_t AIPS_PACRF_SP6 = 1U << 6 ;
  6589. // Boolean field: Supervisor Protect
  6590. static const uint32_t AIPS_PACRF_SP7 = 1U << 2 ;
  6591. // Boolean field: Write Protect
  6592. static const uint32_t AIPS_PACRF_WP3 = 1U << 17 ;
  6593. // Boolean field: Supervisor Protect
  6594. static const uint32_t AIPS_PACRF_SP0 = 1U << 30 ;
  6595. //-------------------- Peripheral Access Control Register
  6596. #define AIPS_PACRE(group) (* ((volatile uint32_t *) (kBaseAddress_AIPS [group] + 0x40)))
  6597. #define AIPS0_PACRE (* ((volatile uint32_t *) (0x40000000 + 0x40)))
  6598. #define AIPS1_PACRE (* ((volatile uint32_t *) (0x40080000 + 0x40)))
  6599. // Boolean field: Write Protect
  6600. static const uint32_t AIPS_PACRE_WP0 = 1U << 29 ;
  6601. // Boolean field: Trusted Protect
  6602. static const uint32_t AIPS_PACRE_TP0 = 1U << 28 ;
  6603. // Boolean field: Trusted Protect
  6604. static const uint32_t AIPS_PACRE_TP7 = 1U << 0 ;
  6605. // Boolean field: Trusted Protect
  6606. static const uint32_t AIPS_PACRE_TP6 = 1U << 4 ;
  6607. // Boolean field: Trusted Protect
  6608. static const uint32_t AIPS_PACRE_TP5 = 1U << 8 ;
  6609. // Boolean field: Trusted Protect
  6610. static const uint32_t AIPS_PACRE_TP4 = 1U << 12 ;
  6611. // Boolean field: Trusted Protect
  6612. static const uint32_t AIPS_PACRE_TP3 = 1U << 16 ;
  6613. // Boolean field: Trusted Protect
  6614. static const uint32_t AIPS_PACRE_TP2 = 1U << 20 ;
  6615. // Boolean field: Trusted Protect
  6616. static const uint32_t AIPS_PACRE_TP1 = 1U << 24 ;
  6617. // Boolean field: Supervisor Protect
  6618. static const uint32_t AIPS_PACRE_SP1 = 1U << 26 ;
  6619. // Boolean field: Supervisor Protect
  6620. static const uint32_t AIPS_PACRE_SP2 = 1U << 22 ;
  6621. // Boolean field: Write Protect
  6622. static const uint32_t AIPS_PACRE_WP7 = 1U << 1 ;
  6623. // Boolean field: Write Protect
  6624. static const uint32_t AIPS_PACRE_WP4 = 1U << 13 ;
  6625. // Boolean field: Write Protect
  6626. static const uint32_t AIPS_PACRE_WP5 = 1U << 9 ;
  6627. // Boolean field: Write Protect
  6628. static const uint32_t AIPS_PACRE_WP6 = 1U << 5 ;
  6629. // Boolean field: Supervisor Protect
  6630. static const uint32_t AIPS_PACRE_SP3 = 1U << 18 ;
  6631. // Boolean field: Supervisor Protect
  6632. static const uint32_t AIPS_PACRE_SP4 = 1U << 14 ;
  6633. // Boolean field: Write Protect
  6634. static const uint32_t AIPS_PACRE_WP1 = 1U << 25 ;
  6635. // Boolean field: Write Protect
  6636. static const uint32_t AIPS_PACRE_WP2 = 1U << 21 ;
  6637. // Boolean field: Supervisor Protect
  6638. static const uint32_t AIPS_PACRE_SP5 = 1U << 10 ;
  6639. // Boolean field: Supervisor Protect
  6640. static const uint32_t AIPS_PACRE_SP6 = 1U << 6 ;
  6641. // Boolean field: Supervisor Protect
  6642. static const uint32_t AIPS_PACRE_SP7 = 1U << 2 ;
  6643. // Boolean field: Write Protect
  6644. static const uint32_t AIPS_PACRE_WP3 = 1U << 17 ;
  6645. // Boolean field: Supervisor Protect
  6646. static const uint32_t AIPS_PACRE_SP0 = 1U << 30 ;
  6647. //-------------------- Peripheral Access Control Register
  6648. #define AIPS_PACRD(group) (* ((volatile uint32_t *) (kBaseAddress_AIPS [group] + 0x2C)))
  6649. #define AIPS0_PACRD (* ((volatile uint32_t *) (0x40000000 + 0x2C)))
  6650. #define AIPS1_PACRD (* ((volatile uint32_t *) (0x40080000 + 0x2C)))
  6651. // Boolean field: Write Protect
  6652. static const uint32_t AIPS_PACRD_WP0 = 1U << 29 ;
  6653. // Boolean field: Trusted Protect
  6654. static const uint32_t AIPS_PACRD_TP0 = 1U << 28 ;
  6655. // Boolean field: Trusted Protect
  6656. static const uint32_t AIPS_PACRD_TP7 = 1U << 0 ;
  6657. // Boolean field: Trusted Protect
  6658. static const uint32_t AIPS_PACRD_TP6 = 1U << 4 ;
  6659. // Boolean field: Trusted Protect
  6660. static const uint32_t AIPS_PACRD_TP5 = 1U << 8 ;
  6661. // Boolean field: Trusted Protect
  6662. static const uint32_t AIPS_PACRD_TP4 = 1U << 12 ;
  6663. // Boolean field: Trusted Protect
  6664. static const uint32_t AIPS_PACRD_TP3 = 1U << 16 ;
  6665. // Boolean field: Trusted Protect
  6666. static const uint32_t AIPS_PACRD_TP2 = 1U << 20 ;
  6667. // Boolean field: Trusted Protect
  6668. static const uint32_t AIPS_PACRD_TP1 = 1U << 24 ;
  6669. // Boolean field: Supervisor Protect
  6670. static const uint32_t AIPS_PACRD_SP1 = 1U << 26 ;
  6671. // Boolean field: Supervisor Protect
  6672. static const uint32_t AIPS_PACRD_SP2 = 1U << 22 ;
  6673. // Boolean field: Write Protect
  6674. static const uint32_t AIPS_PACRD_WP7 = 1U << 1 ;
  6675. // Boolean field: Write Protect
  6676. static const uint32_t AIPS_PACRD_WP4 = 1U << 13 ;
  6677. // Boolean field: Write Protect
  6678. static const uint32_t AIPS_PACRD_WP5 = 1U << 9 ;
  6679. // Boolean field: Write Protect
  6680. static const uint32_t AIPS_PACRD_WP6 = 1U << 5 ;
  6681. // Boolean field: Supervisor Protect
  6682. static const uint32_t AIPS_PACRD_SP3 = 1U << 18 ;
  6683. // Boolean field: Supervisor Protect
  6684. static const uint32_t AIPS_PACRD_SP4 = 1U << 14 ;
  6685. // Boolean field: Write Protect
  6686. static const uint32_t AIPS_PACRD_WP1 = 1U << 25 ;
  6687. // Boolean field: Write Protect
  6688. static const uint32_t AIPS_PACRD_WP2 = 1U << 21 ;
  6689. // Boolean field: Supervisor Protect
  6690. static const uint32_t AIPS_PACRD_SP5 = 1U << 10 ;
  6691. // Boolean field: Supervisor Protect
  6692. static const uint32_t AIPS_PACRD_SP6 = 1U << 6 ;
  6693. // Boolean field: Supervisor Protect
  6694. static const uint32_t AIPS_PACRD_SP7 = 1U << 2 ;
  6695. // Boolean field: Write Protect
  6696. static const uint32_t AIPS_PACRD_WP3 = 1U << 17 ;
  6697. // Boolean field: Supervisor Protect
  6698. static const uint32_t AIPS_PACRD_SP0 = 1U << 30 ;
  6699. //-------------------- Peripheral Access Control Register
  6700. #define AIPS_PACRK(group) (* ((volatile uint32_t *) (kBaseAddress_AIPS [group] + 0x58)))
  6701. #define AIPS0_PACRK (* ((volatile uint32_t *) (0x40000000 + 0x58)))
  6702. #define AIPS1_PACRK (* ((volatile uint32_t *) (0x40080000 + 0x58)))
  6703. // Boolean field: Write Protect
  6704. static const uint32_t AIPS_PACRK_WP0 = 1U << 29 ;
  6705. // Boolean field: Trusted Protect
  6706. static const uint32_t AIPS_PACRK_TP0 = 1U << 28 ;
  6707. // Boolean field: Trusted Protect
  6708. static const uint32_t AIPS_PACRK_TP7 = 1U << 0 ;
  6709. // Boolean field: Trusted Protect
  6710. static const uint32_t AIPS_PACRK_TP6 = 1U << 4 ;
  6711. // Boolean field: Trusted Protect
  6712. static const uint32_t AIPS_PACRK_TP5 = 1U << 8 ;
  6713. // Boolean field: Trusted Protect
  6714. static const uint32_t AIPS_PACRK_TP4 = 1U << 12 ;
  6715. // Boolean field: Trusted Protect
  6716. static const uint32_t AIPS_PACRK_TP3 = 1U << 16 ;
  6717. // Boolean field: Trusted Protect
  6718. static const uint32_t AIPS_PACRK_TP2 = 1U << 20 ;
  6719. // Boolean field: Trusted Protect
  6720. static const uint32_t AIPS_PACRK_TP1 = 1U << 24 ;
  6721. // Boolean field: Supervisor Protect
  6722. static const uint32_t AIPS_PACRK_SP1 = 1U << 26 ;
  6723. // Boolean field: Supervisor Protect
  6724. static const uint32_t AIPS_PACRK_SP2 = 1U << 22 ;
  6725. // Boolean field: Write Protect
  6726. static const uint32_t AIPS_PACRK_WP7 = 1U << 1 ;
  6727. // Boolean field: Write Protect
  6728. static const uint32_t AIPS_PACRK_WP4 = 1U << 13 ;
  6729. // Boolean field: Write Protect
  6730. static const uint32_t AIPS_PACRK_WP5 = 1U << 9 ;
  6731. // Boolean field: Write Protect
  6732. static const uint32_t AIPS_PACRK_WP6 = 1U << 5 ;
  6733. // Boolean field: Supervisor Protect
  6734. static const uint32_t AIPS_PACRK_SP3 = 1U << 18 ;
  6735. // Boolean field: Supervisor Protect
  6736. static const uint32_t AIPS_PACRK_SP4 = 1U << 14 ;
  6737. // Boolean field: Write Protect
  6738. static const uint32_t AIPS_PACRK_WP1 = 1U << 25 ;
  6739. // Boolean field: Write Protect
  6740. static const uint32_t AIPS_PACRK_WP2 = 1U << 21 ;
  6741. // Boolean field: Supervisor Protect
  6742. static const uint32_t AIPS_PACRK_SP5 = 1U << 10 ;
  6743. // Boolean field: Supervisor Protect
  6744. static const uint32_t AIPS_PACRK_SP6 = 1U << 6 ;
  6745. // Boolean field: Supervisor Protect
  6746. static const uint32_t AIPS_PACRK_SP7 = 1U << 2 ;
  6747. // Boolean field: Write Protect
  6748. static const uint32_t AIPS_PACRK_WP3 = 1U << 17 ;
  6749. // Boolean field: Supervisor Protect
  6750. static const uint32_t AIPS_PACRK_SP0 = 1U << 30 ;
  6751. //-------------------- Peripheral Access Control Register
  6752. #define AIPS_PACRJ(group) (* ((volatile uint32_t *) (kBaseAddress_AIPS [group] + 0x54)))
  6753. #define AIPS0_PACRJ (* ((volatile uint32_t *) (0x40000000 + 0x54)))
  6754. #define AIPS1_PACRJ (* ((volatile uint32_t *) (0x40080000 + 0x54)))
  6755. // Boolean field: Write Protect
  6756. static const uint32_t AIPS_PACRJ_WP0 = 1U << 29 ;
  6757. // Boolean field: Trusted Protect
  6758. static const uint32_t AIPS_PACRJ_TP0 = 1U << 28 ;
  6759. // Boolean field: Trusted Protect
  6760. static const uint32_t AIPS_PACRJ_TP7 = 1U << 0 ;
  6761. // Boolean field: Trusted Protect
  6762. static const uint32_t AIPS_PACRJ_TP6 = 1U << 4 ;
  6763. // Boolean field: Trusted Protect
  6764. static const uint32_t AIPS_PACRJ_TP5 = 1U << 8 ;
  6765. // Boolean field: Trusted Protect
  6766. static const uint32_t AIPS_PACRJ_TP4 = 1U << 12 ;
  6767. // Boolean field: Trusted Protect
  6768. static const uint32_t AIPS_PACRJ_TP3 = 1U << 16 ;
  6769. // Boolean field: Trusted Protect
  6770. static const uint32_t AIPS_PACRJ_TP2 = 1U << 20 ;
  6771. // Boolean field: Trusted Protect
  6772. static const uint32_t AIPS_PACRJ_TP1 = 1U << 24 ;
  6773. // Boolean field: Supervisor Protect
  6774. static const uint32_t AIPS_PACRJ_SP1 = 1U << 26 ;
  6775. // Boolean field: Supervisor Protect
  6776. static const uint32_t AIPS_PACRJ_SP2 = 1U << 22 ;
  6777. // Boolean field: Write Protect
  6778. static const uint32_t AIPS_PACRJ_WP7 = 1U << 1 ;
  6779. // Boolean field: Write Protect
  6780. static const uint32_t AIPS_PACRJ_WP4 = 1U << 13 ;
  6781. // Boolean field: Write Protect
  6782. static const uint32_t AIPS_PACRJ_WP5 = 1U << 9 ;
  6783. // Boolean field: Write Protect
  6784. static const uint32_t AIPS_PACRJ_WP6 = 1U << 5 ;
  6785. // Boolean field: Supervisor Protect
  6786. static const uint32_t AIPS_PACRJ_SP3 = 1U << 18 ;
  6787. // Boolean field: Supervisor Protect
  6788. static const uint32_t AIPS_PACRJ_SP4 = 1U << 14 ;
  6789. // Boolean field: Write Protect
  6790. static const uint32_t AIPS_PACRJ_WP1 = 1U << 25 ;
  6791. // Boolean field: Write Protect
  6792. static const uint32_t AIPS_PACRJ_WP2 = 1U << 21 ;
  6793. // Boolean field: Supervisor Protect
  6794. static const uint32_t AIPS_PACRJ_SP5 = 1U << 10 ;
  6795. // Boolean field: Supervisor Protect
  6796. static const uint32_t AIPS_PACRJ_SP6 = 1U << 6 ;
  6797. // Boolean field: Supervisor Protect
  6798. static const uint32_t AIPS_PACRJ_SP7 = 1U << 2 ;
  6799. // Boolean field: Write Protect
  6800. static const uint32_t AIPS_PACRJ_WP3 = 1U << 17 ;
  6801. // Boolean field: Supervisor Protect
  6802. static const uint32_t AIPS_PACRJ_SP0 = 1U << 30 ;
  6803. //-------------------- Peripheral Access Control Register
  6804. #define AIPS_PACRI(group) (* ((volatile uint32_t *) (kBaseAddress_AIPS [group] + 0x50)))
  6805. #define AIPS0_PACRI (* ((volatile uint32_t *) (0x40000000 + 0x50)))
  6806. #define AIPS1_PACRI (* ((volatile uint32_t *) (0x40080000 + 0x50)))
  6807. // Boolean field: Write Protect
  6808. static const uint32_t AIPS_PACRI_WP0 = 1U << 29 ;
  6809. // Boolean field: Trusted Protect
  6810. static const uint32_t AIPS_PACRI_TP0 = 1U << 28 ;
  6811. // Boolean field: Trusted Protect
  6812. static const uint32_t AIPS_PACRI_TP7 = 1U << 0 ;
  6813. // Boolean field: Trusted Protect
  6814. static const uint32_t AIPS_PACRI_TP6 = 1U << 4 ;
  6815. // Boolean field: Trusted Protect
  6816. static const uint32_t AIPS_PACRI_TP5 = 1U << 8 ;
  6817. // Boolean field: Trusted Protect
  6818. static const uint32_t AIPS_PACRI_TP4 = 1U << 12 ;
  6819. // Boolean field: Trusted Protect
  6820. static const uint32_t AIPS_PACRI_TP3 = 1U << 16 ;
  6821. // Boolean field: Trusted Protect
  6822. static const uint32_t AIPS_PACRI_TP2 = 1U << 20 ;
  6823. // Boolean field: Trusted Protect
  6824. static const uint32_t AIPS_PACRI_TP1 = 1U << 24 ;
  6825. // Boolean field: Supervisor Protect
  6826. static const uint32_t AIPS_PACRI_SP1 = 1U << 26 ;
  6827. // Boolean field: Supervisor Protect
  6828. static const uint32_t AIPS_PACRI_SP2 = 1U << 22 ;
  6829. // Boolean field: Write Protect
  6830. static const uint32_t AIPS_PACRI_WP7 = 1U << 1 ;
  6831. // Boolean field: Write Protect
  6832. static const uint32_t AIPS_PACRI_WP4 = 1U << 13 ;
  6833. // Boolean field: Write Protect
  6834. static const uint32_t AIPS_PACRI_WP5 = 1U << 9 ;
  6835. // Boolean field: Write Protect
  6836. static const uint32_t AIPS_PACRI_WP6 = 1U << 5 ;
  6837. // Boolean field: Supervisor Protect
  6838. static const uint32_t AIPS_PACRI_SP3 = 1U << 18 ;
  6839. // Boolean field: Supervisor Protect
  6840. static const uint32_t AIPS_PACRI_SP4 = 1U << 14 ;
  6841. // Boolean field: Write Protect
  6842. static const uint32_t AIPS_PACRI_WP1 = 1U << 25 ;
  6843. // Boolean field: Write Protect
  6844. static const uint32_t AIPS_PACRI_WP2 = 1U << 21 ;
  6845. // Boolean field: Supervisor Protect
  6846. static const uint32_t AIPS_PACRI_SP5 = 1U << 10 ;
  6847. // Boolean field: Supervisor Protect
  6848. static const uint32_t AIPS_PACRI_SP6 = 1U << 6 ;
  6849. // Boolean field: Supervisor Protect
  6850. static const uint32_t AIPS_PACRI_SP7 = 1U << 2 ;
  6851. // Boolean field: Write Protect
  6852. static const uint32_t AIPS_PACRI_WP3 = 1U << 17 ;
  6853. // Boolean field: Supervisor Protect
  6854. static const uint32_t AIPS_PACRI_SP0 = 1U << 30 ;
  6855. //-------------------- Peripheral Access Control Register
  6856. #define AIPS_PACRH(group) (* ((volatile uint32_t *) (kBaseAddress_AIPS [group] + 0x4C)))
  6857. #define AIPS0_PACRH (* ((volatile uint32_t *) (0x40000000 + 0x4C)))
  6858. #define AIPS1_PACRH (* ((volatile uint32_t *) (0x40080000 + 0x4C)))
  6859. // Boolean field: Write Protect
  6860. static const uint32_t AIPS_PACRH_WP0 = 1U << 29 ;
  6861. // Boolean field: Trusted Protect
  6862. static const uint32_t AIPS_PACRH_TP0 = 1U << 28 ;
  6863. // Boolean field: Trusted Protect
  6864. static const uint32_t AIPS_PACRH_TP7 = 1U << 0 ;
  6865. // Boolean field: Trusted Protect
  6866. static const uint32_t AIPS_PACRH_TP6 = 1U << 4 ;
  6867. // Boolean field: Trusted Protect
  6868. static const uint32_t AIPS_PACRH_TP5 = 1U << 8 ;
  6869. // Boolean field: Trusted Protect
  6870. static const uint32_t AIPS_PACRH_TP4 = 1U << 12 ;
  6871. // Boolean field: Trusted Protect
  6872. static const uint32_t AIPS_PACRH_TP3 = 1U << 16 ;
  6873. // Boolean field: Trusted Protect
  6874. static const uint32_t AIPS_PACRH_TP2 = 1U << 20 ;
  6875. // Boolean field: Trusted Protect
  6876. static const uint32_t AIPS_PACRH_TP1 = 1U << 24 ;
  6877. // Boolean field: Supervisor Protect
  6878. static const uint32_t AIPS_PACRH_SP1 = 1U << 26 ;
  6879. // Boolean field: Supervisor Protect
  6880. static const uint32_t AIPS_PACRH_SP2 = 1U << 22 ;
  6881. // Boolean field: Write Protect
  6882. static const uint32_t AIPS_PACRH_WP7 = 1U << 1 ;
  6883. // Boolean field: Write Protect
  6884. static const uint32_t AIPS_PACRH_WP4 = 1U << 13 ;
  6885. // Boolean field: Write Protect
  6886. static const uint32_t AIPS_PACRH_WP5 = 1U << 9 ;
  6887. // Boolean field: Write Protect
  6888. static const uint32_t AIPS_PACRH_WP6 = 1U << 5 ;
  6889. // Boolean field: Supervisor Protect
  6890. static const uint32_t AIPS_PACRH_SP3 = 1U << 18 ;
  6891. // Boolean field: Supervisor Protect
  6892. static const uint32_t AIPS_PACRH_SP4 = 1U << 14 ;
  6893. // Boolean field: Write Protect
  6894. static const uint32_t AIPS_PACRH_WP1 = 1U << 25 ;
  6895. // Boolean field: Write Protect
  6896. static const uint32_t AIPS_PACRH_WP2 = 1U << 21 ;
  6897. // Boolean field: Supervisor Protect
  6898. static const uint32_t AIPS_PACRH_SP5 = 1U << 10 ;
  6899. // Boolean field: Supervisor Protect
  6900. static const uint32_t AIPS_PACRH_SP6 = 1U << 6 ;
  6901. // Boolean field: Supervisor Protect
  6902. static const uint32_t AIPS_PACRH_SP7 = 1U << 2 ;
  6903. // Boolean field: Write Protect
  6904. static const uint32_t AIPS_PACRH_WP3 = 1U << 17 ;
  6905. // Boolean field: Supervisor Protect
  6906. static const uint32_t AIPS_PACRH_SP0 = 1U << 30 ;
  6907. //-------------------- Peripheral Access Control Register
  6908. #define AIPS_PACRO(group) (* ((volatile uint32_t *) (kBaseAddress_AIPS [group] + 0x68)))
  6909. #define AIPS0_PACRO (* ((volatile uint32_t *) (0x40000000 + 0x68)))
  6910. #define AIPS1_PACRO (* ((volatile uint32_t *) (0x40080000 + 0x68)))
  6911. // Boolean field: Write Protect
  6912. static const uint32_t AIPS_PACRO_WP0 = 1U << 29 ;
  6913. // Boolean field: Trusted Protect
  6914. static const uint32_t AIPS_PACRO_TP0 = 1U << 28 ;
  6915. // Boolean field: Trusted Protect
  6916. static const uint32_t AIPS_PACRO_TP7 = 1U << 0 ;
  6917. // Boolean field: Trusted Protect
  6918. static const uint32_t AIPS_PACRO_TP6 = 1U << 4 ;
  6919. // Boolean field: Trusted Protect
  6920. static const uint32_t AIPS_PACRO_TP5 = 1U << 8 ;
  6921. // Boolean field: Trusted Protect
  6922. static const uint32_t AIPS_PACRO_TP4 = 1U << 12 ;
  6923. // Boolean field: Trusted Protect
  6924. static const uint32_t AIPS_PACRO_TP3 = 1U << 16 ;
  6925. // Boolean field: Trusted Protect
  6926. static const uint32_t AIPS_PACRO_TP2 = 1U << 20 ;
  6927. // Boolean field: Trusted Protect
  6928. static const uint32_t AIPS_PACRO_TP1 = 1U << 24 ;
  6929. // Boolean field: Supervisor Protect
  6930. static const uint32_t AIPS_PACRO_SP1 = 1U << 26 ;
  6931. // Boolean field: Supervisor Protect
  6932. static const uint32_t AIPS_PACRO_SP2 = 1U << 22 ;
  6933. // Boolean field: Write Protect
  6934. static const uint32_t AIPS_PACRO_WP7 = 1U << 1 ;
  6935. // Boolean field: Write Protect
  6936. static const uint32_t AIPS_PACRO_WP4 = 1U << 13 ;
  6937. // Boolean field: Write Protect
  6938. static const uint32_t AIPS_PACRO_WP5 = 1U << 9 ;
  6939. // Boolean field: Write Protect
  6940. static const uint32_t AIPS_PACRO_WP6 = 1U << 5 ;
  6941. // Boolean field: Supervisor Protect
  6942. static const uint32_t AIPS_PACRO_SP3 = 1U << 18 ;
  6943. // Boolean field: Supervisor Protect
  6944. static const uint32_t AIPS_PACRO_SP4 = 1U << 14 ;
  6945. // Boolean field: Write Protect
  6946. static const uint32_t AIPS_PACRO_WP1 = 1U << 25 ;
  6947. // Boolean field: Write Protect
  6948. static const uint32_t AIPS_PACRO_WP2 = 1U << 21 ;
  6949. // Boolean field: Supervisor Protect
  6950. static const uint32_t AIPS_PACRO_SP5 = 1U << 10 ;
  6951. // Boolean field: Supervisor Protect
  6952. static const uint32_t AIPS_PACRO_SP6 = 1U << 6 ;
  6953. // Boolean field: Supervisor Protect
  6954. static const uint32_t AIPS_PACRO_SP7 = 1U << 2 ;
  6955. // Boolean field: Write Protect
  6956. static const uint32_t AIPS_PACRO_WP3 = 1U << 17 ;
  6957. // Boolean field: Supervisor Protect
  6958. static const uint32_t AIPS_PACRO_SP0 = 1U << 30 ;
  6959. //-------------------- Peripheral Access Control Register
  6960. #define AIPS_PACRN(group) (* ((volatile uint32_t *) (kBaseAddress_AIPS [group] + 0x64)))
  6961. #define AIPS0_PACRN (* ((volatile uint32_t *) (0x40000000 + 0x64)))
  6962. #define AIPS1_PACRN (* ((volatile uint32_t *) (0x40080000 + 0x64)))
  6963. // Boolean field: Write Protect
  6964. static const uint32_t AIPS_PACRN_WP0 = 1U << 29 ;
  6965. // Boolean field: Trusted Protect
  6966. static const uint32_t AIPS_PACRN_TP0 = 1U << 28 ;
  6967. // Boolean field: Trusted Protect
  6968. static const uint32_t AIPS_PACRN_TP7 = 1U << 0 ;
  6969. // Boolean field: Trusted Protect
  6970. static const uint32_t AIPS_PACRN_TP6 = 1U << 4 ;
  6971. // Boolean field: Trusted Protect
  6972. static const uint32_t AIPS_PACRN_TP5 = 1U << 8 ;
  6973. // Boolean field: Trusted Protect
  6974. static const uint32_t AIPS_PACRN_TP4 = 1U << 12 ;
  6975. // Boolean field: Trusted Protect
  6976. static const uint32_t AIPS_PACRN_TP3 = 1U << 16 ;
  6977. // Boolean field: Trusted Protect
  6978. static const uint32_t AIPS_PACRN_TP2 = 1U << 20 ;
  6979. // Boolean field: Trusted Protect
  6980. static const uint32_t AIPS_PACRN_TP1 = 1U << 24 ;
  6981. // Boolean field: Supervisor Protect
  6982. static const uint32_t AIPS_PACRN_SP1 = 1U << 26 ;
  6983. // Boolean field: Supervisor Protect
  6984. static const uint32_t AIPS_PACRN_SP2 = 1U << 22 ;
  6985. // Boolean field: Write Protect
  6986. static const uint32_t AIPS_PACRN_WP7 = 1U << 1 ;
  6987. // Boolean field: Write Protect
  6988. static const uint32_t AIPS_PACRN_WP4 = 1U << 13 ;
  6989. // Boolean field: Write Protect
  6990. static const uint32_t AIPS_PACRN_WP5 = 1U << 9 ;
  6991. // Boolean field: Write Protect
  6992. static const uint32_t AIPS_PACRN_WP6 = 1U << 5 ;
  6993. // Boolean field: Supervisor Protect
  6994. static const uint32_t AIPS_PACRN_SP3 = 1U << 18 ;
  6995. // Boolean field: Supervisor Protect
  6996. static const uint32_t AIPS_PACRN_SP4 = 1U << 14 ;
  6997. // Boolean field: Write Protect
  6998. static const uint32_t AIPS_PACRN_WP1 = 1U << 25 ;
  6999. // Boolean field: Write Protect
  7000. static const uint32_t AIPS_PACRN_WP2 = 1U << 21 ;
  7001. // Boolean field: Supervisor Protect
  7002. static const uint32_t AIPS_PACRN_SP5 = 1U << 10 ;
  7003. // Boolean field: Supervisor Protect
  7004. static const uint32_t AIPS_PACRN_SP6 = 1U << 6 ;
  7005. // Boolean field: Supervisor Protect
  7006. static const uint32_t AIPS_PACRN_SP7 = 1U << 2 ;
  7007. // Boolean field: Write Protect
  7008. static const uint32_t AIPS_PACRN_WP3 = 1U << 17 ;
  7009. // Boolean field: Supervisor Protect
  7010. static const uint32_t AIPS_PACRN_SP0 = 1U << 30 ;
  7011. //-------------------- Peripheral Access Control Register
  7012. #define AIPS_PACRM(group) (* ((volatile uint32_t *) (kBaseAddress_AIPS [group] + 0x60)))
  7013. #define AIPS0_PACRM (* ((volatile uint32_t *) (0x40000000 + 0x60)))
  7014. #define AIPS1_PACRM (* ((volatile uint32_t *) (0x40080000 + 0x60)))
  7015. // Boolean field: Write Protect
  7016. static const uint32_t AIPS_PACRM_WP0 = 1U << 29 ;
  7017. // Boolean field: Trusted Protect
  7018. static const uint32_t AIPS_PACRM_TP0 = 1U << 28 ;
  7019. // Boolean field: Trusted Protect
  7020. static const uint32_t AIPS_PACRM_TP7 = 1U << 0 ;
  7021. // Boolean field: Trusted Protect
  7022. static const uint32_t AIPS_PACRM_TP6 = 1U << 4 ;
  7023. // Boolean field: Trusted Protect
  7024. static const uint32_t AIPS_PACRM_TP5 = 1U << 8 ;
  7025. // Boolean field: Trusted Protect
  7026. static const uint32_t AIPS_PACRM_TP4 = 1U << 12 ;
  7027. // Boolean field: Trusted Protect
  7028. static const uint32_t AIPS_PACRM_TP3 = 1U << 16 ;
  7029. // Boolean field: Trusted Protect
  7030. static const uint32_t AIPS_PACRM_TP2 = 1U << 20 ;
  7031. // Boolean field: Trusted Protect
  7032. static const uint32_t AIPS_PACRM_TP1 = 1U << 24 ;
  7033. // Boolean field: Supervisor Protect
  7034. static const uint32_t AIPS_PACRM_SP1 = 1U << 26 ;
  7035. // Boolean field: Supervisor Protect
  7036. static const uint32_t AIPS_PACRM_SP2 = 1U << 22 ;
  7037. // Boolean field: Write Protect
  7038. static const uint32_t AIPS_PACRM_WP7 = 1U << 1 ;
  7039. // Boolean field: Write Protect
  7040. static const uint32_t AIPS_PACRM_WP4 = 1U << 13 ;
  7041. // Boolean field: Write Protect
  7042. static const uint32_t AIPS_PACRM_WP5 = 1U << 9 ;
  7043. // Boolean field: Write Protect
  7044. static const uint32_t AIPS_PACRM_WP6 = 1U << 5 ;
  7045. // Boolean field: Supervisor Protect
  7046. static const uint32_t AIPS_PACRM_SP3 = 1U << 18 ;
  7047. // Boolean field: Supervisor Protect
  7048. static const uint32_t AIPS_PACRM_SP4 = 1U << 14 ;
  7049. // Boolean field: Write Protect
  7050. static const uint32_t AIPS_PACRM_WP1 = 1U << 25 ;
  7051. // Boolean field: Write Protect
  7052. static const uint32_t AIPS_PACRM_WP2 = 1U << 21 ;
  7053. // Boolean field: Supervisor Protect
  7054. static const uint32_t AIPS_PACRM_SP5 = 1U << 10 ;
  7055. // Boolean field: Supervisor Protect
  7056. static const uint32_t AIPS_PACRM_SP6 = 1U << 6 ;
  7057. // Boolean field: Supervisor Protect
  7058. static const uint32_t AIPS_PACRM_SP7 = 1U << 2 ;
  7059. // Boolean field: Write Protect
  7060. static const uint32_t AIPS_PACRM_WP3 = 1U << 17 ;
  7061. // Boolean field: Supervisor Protect
  7062. static const uint32_t AIPS_PACRM_SP0 = 1U << 30 ;
  7063. //-------------------- Peripheral Access Control Register
  7064. #define AIPS_PACRL(group) (* ((volatile uint32_t *) (kBaseAddress_AIPS [group] + 0x5C)))
  7065. #define AIPS0_PACRL (* ((volatile uint32_t *) (0x40000000 + 0x5C)))
  7066. #define AIPS1_PACRL (* ((volatile uint32_t *) (0x40080000 + 0x5C)))
  7067. // Boolean field: Write Protect
  7068. static const uint32_t AIPS_PACRL_WP0 = 1U << 29 ;
  7069. // Boolean field: Trusted Protect
  7070. static const uint32_t AIPS_PACRL_TP0 = 1U << 28 ;
  7071. // Boolean field: Trusted Protect
  7072. static const uint32_t AIPS_PACRL_TP7 = 1U << 0 ;
  7073. // Boolean field: Trusted Protect
  7074. static const uint32_t AIPS_PACRL_TP6 = 1U << 4 ;
  7075. // Boolean field: Trusted Protect
  7076. static const uint32_t AIPS_PACRL_TP5 = 1U << 8 ;
  7077. // Boolean field: Trusted Protect
  7078. static const uint32_t AIPS_PACRL_TP4 = 1U << 12 ;
  7079. // Boolean field: Trusted Protect
  7080. static const uint32_t AIPS_PACRL_TP3 = 1U << 16 ;
  7081. // Boolean field: Trusted Protect
  7082. static const uint32_t AIPS_PACRL_TP2 = 1U << 20 ;
  7083. // Boolean field: Trusted Protect
  7084. static const uint32_t AIPS_PACRL_TP1 = 1U << 24 ;
  7085. // Boolean field: Supervisor Protect
  7086. static const uint32_t AIPS_PACRL_SP1 = 1U << 26 ;
  7087. // Boolean field: Supervisor Protect
  7088. static const uint32_t AIPS_PACRL_SP2 = 1U << 22 ;
  7089. // Boolean field: Write Protect
  7090. static const uint32_t AIPS_PACRL_WP7 = 1U << 1 ;
  7091. // Boolean field: Write Protect
  7092. static const uint32_t AIPS_PACRL_WP4 = 1U << 13 ;
  7093. // Boolean field: Write Protect
  7094. static const uint32_t AIPS_PACRL_WP5 = 1U << 9 ;
  7095. // Boolean field: Write Protect
  7096. static const uint32_t AIPS_PACRL_WP6 = 1U << 5 ;
  7097. // Boolean field: Supervisor Protect
  7098. static const uint32_t AIPS_PACRL_SP3 = 1U << 18 ;
  7099. // Boolean field: Supervisor Protect
  7100. static const uint32_t AIPS_PACRL_SP4 = 1U << 14 ;
  7101. // Boolean field: Write Protect
  7102. static const uint32_t AIPS_PACRL_WP1 = 1U << 25 ;
  7103. // Boolean field: Write Protect
  7104. static const uint32_t AIPS_PACRL_WP2 = 1U << 21 ;
  7105. // Boolean field: Supervisor Protect
  7106. static const uint32_t AIPS_PACRL_SP5 = 1U << 10 ;
  7107. // Boolean field: Supervisor Protect
  7108. static const uint32_t AIPS_PACRL_SP6 = 1U << 6 ;
  7109. // Boolean field: Supervisor Protect
  7110. static const uint32_t AIPS_PACRL_SP7 = 1U << 2 ;
  7111. // Boolean field: Write Protect
  7112. static const uint32_t AIPS_PACRL_WP3 = 1U << 17 ;
  7113. // Boolean field: Supervisor Protect
  7114. static const uint32_t AIPS_PACRL_SP0 = 1U << 30 ;
  7115. //-------------------- Peripheral Access Control Register
  7116. #define AIPS_PACRP(group) (* ((volatile uint32_t *) (kBaseAddress_AIPS [group] + 0x6C)))
  7117. #define AIPS0_PACRP (* ((volatile uint32_t *) (0x40000000 + 0x6C)))
  7118. #define AIPS1_PACRP (* ((volatile uint32_t *) (0x40080000 + 0x6C)))
  7119. // Boolean field: Write Protect
  7120. static const uint32_t AIPS_PACRP_WP0 = 1U << 29 ;
  7121. // Boolean field: Trusted Protect
  7122. static const uint32_t AIPS_PACRP_TP0 = 1U << 28 ;
  7123. // Boolean field: Trusted Protect
  7124. static const uint32_t AIPS_PACRP_TP7 = 1U << 0 ;
  7125. // Boolean field: Trusted Protect
  7126. static const uint32_t AIPS_PACRP_TP6 = 1U << 4 ;
  7127. // Boolean field: Trusted Protect
  7128. static const uint32_t AIPS_PACRP_TP5 = 1U << 8 ;
  7129. // Boolean field: Trusted Protect
  7130. static const uint32_t AIPS_PACRP_TP4 = 1U << 12 ;
  7131. // Boolean field: Trusted Protect
  7132. static const uint32_t AIPS_PACRP_TP3 = 1U << 16 ;
  7133. // Boolean field: Trusted Protect
  7134. static const uint32_t AIPS_PACRP_TP2 = 1U << 20 ;
  7135. // Boolean field: Trusted Protect
  7136. static const uint32_t AIPS_PACRP_TP1 = 1U << 24 ;
  7137. // Boolean field: Supervisor Protect
  7138. static const uint32_t AIPS_PACRP_SP1 = 1U << 26 ;
  7139. // Boolean field: Supervisor Protect
  7140. static const uint32_t AIPS_PACRP_SP2 = 1U << 22 ;
  7141. // Boolean field: Write Protect
  7142. static const uint32_t AIPS_PACRP_WP7 = 1U << 1 ;
  7143. // Boolean field: Write Protect
  7144. static const uint32_t AIPS_PACRP_WP4 = 1U << 13 ;
  7145. // Boolean field: Write Protect
  7146. static const uint32_t AIPS_PACRP_WP5 = 1U << 9 ;
  7147. // Boolean field: Write Protect
  7148. static const uint32_t AIPS_PACRP_WP6 = 1U << 5 ;
  7149. // Boolean field: Supervisor Protect
  7150. static const uint32_t AIPS_PACRP_SP3 = 1U << 18 ;
  7151. // Boolean field: Supervisor Protect
  7152. static const uint32_t AIPS_PACRP_SP4 = 1U << 14 ;
  7153. // Boolean field: Write Protect
  7154. static const uint32_t AIPS_PACRP_WP1 = 1U << 25 ;
  7155. // Boolean field: Write Protect
  7156. static const uint32_t AIPS_PACRP_WP2 = 1U << 21 ;
  7157. // Boolean field: Supervisor Protect
  7158. static const uint32_t AIPS_PACRP_SP5 = 1U << 10 ;
  7159. // Boolean field: Supervisor Protect
  7160. static const uint32_t AIPS_PACRP_SP6 = 1U << 6 ;
  7161. // Boolean field: Supervisor Protect
  7162. static const uint32_t AIPS_PACRP_SP7 = 1U << 2 ;
  7163. // Boolean field: Write Protect
  7164. static const uint32_t AIPS_PACRP_WP3 = 1U << 17 ;
  7165. // Boolean field: Supervisor Protect
  7166. static const uint32_t AIPS_PACRP_SP0 = 1U << 30 ;
  7167. //-------------------- Peripheral Access Control Register
  7168. #define AIPS_PACRC(group) (* ((volatile uint32_t *) (kBaseAddress_AIPS [group] + 0x28)))
  7169. #define AIPS0_PACRC (* ((volatile uint32_t *) (0x40000000 + 0x28)))
  7170. #define AIPS1_PACRC (* ((volatile uint32_t *) (0x40080000 + 0x28)))
  7171. // Boolean field: Write Protect
  7172. static const uint32_t AIPS_PACRC_WP0 = 1U << 29 ;
  7173. // Boolean field: Trusted Protect
  7174. static const uint32_t AIPS_PACRC_TP0 = 1U << 28 ;
  7175. // Boolean field: Trusted Protect
  7176. static const uint32_t AIPS_PACRC_TP7 = 1U << 0 ;
  7177. // Boolean field: Trusted Protect
  7178. static const uint32_t AIPS_PACRC_TP6 = 1U << 4 ;
  7179. // Boolean field: Trusted Protect
  7180. static const uint32_t AIPS_PACRC_TP5 = 1U << 8 ;
  7181. // Boolean field: Trusted Protect
  7182. static const uint32_t AIPS_PACRC_TP4 = 1U << 12 ;
  7183. // Boolean field: Trusted Protect
  7184. static const uint32_t AIPS_PACRC_TP3 = 1U << 16 ;
  7185. // Boolean field: Trusted Protect
  7186. static const uint32_t AIPS_PACRC_TP2 = 1U << 20 ;
  7187. // Boolean field: Trusted Protect
  7188. static const uint32_t AIPS_PACRC_TP1 = 1U << 24 ;
  7189. // Boolean field: Supervisor Protect
  7190. static const uint32_t AIPS_PACRC_SP1 = 1U << 26 ;
  7191. // Boolean field: Supervisor Protect
  7192. static const uint32_t AIPS_PACRC_SP2 = 1U << 22 ;
  7193. // Boolean field: Write Protect
  7194. static const uint32_t AIPS_PACRC_WP7 = 1U << 1 ;
  7195. // Boolean field: Write Protect
  7196. static const uint32_t AIPS_PACRC_WP4 = 1U << 13 ;
  7197. // Boolean field: Write Protect
  7198. static const uint32_t AIPS_PACRC_WP5 = 1U << 9 ;
  7199. // Boolean field: Write Protect
  7200. static const uint32_t AIPS_PACRC_WP6 = 1U << 5 ;
  7201. // Boolean field: Supervisor Protect
  7202. static const uint32_t AIPS_PACRC_SP3 = 1U << 18 ;
  7203. // Boolean field: Supervisor Protect
  7204. static const uint32_t AIPS_PACRC_SP4 = 1U << 14 ;
  7205. // Boolean field: Write Protect
  7206. static const uint32_t AIPS_PACRC_WP1 = 1U << 25 ;
  7207. // Boolean field: Write Protect
  7208. static const uint32_t AIPS_PACRC_WP2 = 1U << 21 ;
  7209. // Boolean field: Supervisor Protect
  7210. static const uint32_t AIPS_PACRC_SP5 = 1U << 10 ;
  7211. // Boolean field: Supervisor Protect
  7212. static const uint32_t AIPS_PACRC_SP6 = 1U << 6 ;
  7213. // Boolean field: Supervisor Protect
  7214. static const uint32_t AIPS_PACRC_SP7 = 1U << 2 ;
  7215. // Boolean field: Write Protect
  7216. static const uint32_t AIPS_PACRC_WP3 = 1U << 17 ;
  7217. // Boolean field: Supervisor Protect
  7218. static const uint32_t AIPS_PACRC_SP0 = 1U << 30 ;
  7219. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  7220. // Peripheral group CAN
  7221. // CAN0 at 0x40024000
  7222. // CAN1 at 0x400A4000
  7223. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  7224. static const uint32_t kBaseAddress_CAN [2] = {0x40024000, 0x400A4000} ;
  7225. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  7226. //-------------------- Message Buffer 5 WORD1 Register
  7227. #define CAN_WORD15(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0xDC)))
  7228. #define CAN0_WORD15 (* ((volatile uint32_t *) (0x40024000 + 0xDC)))
  7229. #define CAN1_WORD15 (* ((volatile uint32_t *) (0x400A4000 + 0xDC)))
  7230. // Field (width: 8 bits): Data byte 7 of Rx/Tx frame.
  7231. inline uint32_t CAN_WORD15_DATA_BYTE_7 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7232. // Field (width: 8 bits): Data byte 6 of Rx/Tx frame.
  7233. inline uint32_t CAN_WORD15_DATA_BYTE_6 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7234. // Field (width: 8 bits): Data byte 5 of Rx/Tx frame.
  7235. inline uint32_t CAN_WORD15_DATA_BYTE_5 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  7236. // Field (width: 8 bits): Data byte 4 of Rx/Tx frame.
  7237. inline uint32_t CAN_WORD15_DATA_BYTE_4 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  7238. //-------------------- Message Buffer 4 WORD1 Register
  7239. #define CAN_WORD14(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0xCC)))
  7240. #define CAN0_WORD14 (* ((volatile uint32_t *) (0x40024000 + 0xCC)))
  7241. #define CAN1_WORD14 (* ((volatile uint32_t *) (0x400A4000 + 0xCC)))
  7242. // Field (width: 8 bits): Data byte 7 of Rx/Tx frame.
  7243. inline uint32_t CAN_WORD14_DATA_BYTE_7 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7244. // Field (width: 8 bits): Data byte 6 of Rx/Tx frame.
  7245. inline uint32_t CAN_WORD14_DATA_BYTE_6 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7246. // Field (width: 8 bits): Data byte 5 of Rx/Tx frame.
  7247. inline uint32_t CAN_WORD14_DATA_BYTE_5 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  7248. // Field (width: 8 bits): Data byte 4 of Rx/Tx frame.
  7249. inline uint32_t CAN_WORD14_DATA_BYTE_4 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  7250. //-------------------- Message Buffer 7 WORD1 Register
  7251. #define CAN_WORD17(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0xFC)))
  7252. #define CAN0_WORD17 (* ((volatile uint32_t *) (0x40024000 + 0xFC)))
  7253. #define CAN1_WORD17 (* ((volatile uint32_t *) (0x400A4000 + 0xFC)))
  7254. // Field (width: 8 bits): Data byte 7 of Rx/Tx frame.
  7255. inline uint32_t CAN_WORD17_DATA_BYTE_7 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7256. // Field (width: 8 bits): Data byte 6 of Rx/Tx frame.
  7257. inline uint32_t CAN_WORD17_DATA_BYTE_6 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7258. // Field (width: 8 bits): Data byte 5 of Rx/Tx frame.
  7259. inline uint32_t CAN_WORD17_DATA_BYTE_5 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  7260. // Field (width: 8 bits): Data byte 4 of Rx/Tx frame.
  7261. inline uint32_t CAN_WORD17_DATA_BYTE_4 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  7262. //-------------------- Message Buffer 5 ID Register
  7263. #define CAN_ID5(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0xD4)))
  7264. #define CAN0_ID5 (* ((volatile uint32_t *) (0x40024000 + 0xD4)))
  7265. #define CAN1_ID5 (* ((volatile uint32_t *) (0x400A4000 + 0xD4)))
  7266. // Field (width: 11 bits): Contains standard/extended (HIGH word) identifier of message buffer.
  7267. inline uint32_t CAN_ID5_STD (const uint32_t inValue) { return (inValue & 2047U) << 18 ; }
  7268. // Field (width: 18 bits): Contains extended (LOW word) identifier of message buffer.
  7269. inline uint32_t CAN_ID5_EXT (const uint32_t inValue) { return (inValue & 262143U) << 0 ; }
  7270. // Field (width: 3 bits): Local priority. This 3-bit fieldis only used when LPRIO_EN bit is set in MCR and it only makes sense for Tx buffers. These bits are not transmitted. They are appended to the regular ID to define the transmission priority.
  7271. inline uint32_t CAN_ID5_PRIO (const uint32_t inValue) { return (inValue & 7U) << 29 ; }
  7272. //-------------------- Message Buffer 1 WORD1 Register
  7273. #define CAN_WORD11(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x9C)))
  7274. #define CAN0_WORD11 (* ((volatile uint32_t *) (0x40024000 + 0x9C)))
  7275. #define CAN1_WORD11 (* ((volatile uint32_t *) (0x400A4000 + 0x9C)))
  7276. // Field (width: 8 bits): Data byte 7 of Rx/Tx frame.
  7277. inline uint32_t CAN_WORD11_DATA_BYTE_7 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7278. // Field (width: 8 bits): Data byte 6 of Rx/Tx frame.
  7279. inline uint32_t CAN_WORD11_DATA_BYTE_6 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7280. // Field (width: 8 bits): Data byte 5 of Rx/Tx frame.
  7281. inline uint32_t CAN_WORD11_DATA_BYTE_5 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  7282. // Field (width: 8 bits): Data byte 4 of Rx/Tx frame.
  7283. inline uint32_t CAN_WORD11_DATA_BYTE_4 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  7284. //-------------------- Message Buffer 0 WORD1 Register
  7285. #define CAN_WORD10(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x8C)))
  7286. #define CAN0_WORD10 (* ((volatile uint32_t *) (0x40024000 + 0x8C)))
  7287. #define CAN1_WORD10 (* ((volatile uint32_t *) (0x400A4000 + 0x8C)))
  7288. // Field (width: 8 bits): Data byte 7 of Rx/Tx frame.
  7289. inline uint32_t CAN_WORD10_DATA_BYTE_7 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7290. // Field (width: 8 bits): Data byte 6 of Rx/Tx frame.
  7291. inline uint32_t CAN_WORD10_DATA_BYTE_6 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7292. // Field (width: 8 bits): Data byte 5 of Rx/Tx frame.
  7293. inline uint32_t CAN_WORD10_DATA_BYTE_5 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  7294. // Field (width: 8 bits): Data byte 4 of Rx/Tx frame.
  7295. inline uint32_t CAN_WORD10_DATA_BYTE_4 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  7296. //-------------------- Message Buffer 3 WORD1 Register
  7297. #define CAN_WORD13(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0xBC)))
  7298. #define CAN0_WORD13 (* ((volatile uint32_t *) (0x40024000 + 0xBC)))
  7299. #define CAN1_WORD13 (* ((volatile uint32_t *) (0x400A4000 + 0xBC)))
  7300. // Field (width: 8 bits): Data byte 7 of Rx/Tx frame.
  7301. inline uint32_t CAN_WORD13_DATA_BYTE_7 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7302. // Field (width: 8 bits): Data byte 6 of Rx/Tx frame.
  7303. inline uint32_t CAN_WORD13_DATA_BYTE_6 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7304. // Field (width: 8 bits): Data byte 5 of Rx/Tx frame.
  7305. inline uint32_t CAN_WORD13_DATA_BYTE_5 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  7306. // Field (width: 8 bits): Data byte 4 of Rx/Tx frame.
  7307. inline uint32_t CAN_WORD13_DATA_BYTE_4 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  7308. //-------------------- Message Buffer 2 WORD1 Register
  7309. #define CAN_WORD12(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0xAC)))
  7310. #define CAN0_WORD12 (* ((volatile uint32_t *) (0x40024000 + 0xAC)))
  7311. #define CAN1_WORD12 (* ((volatile uint32_t *) (0x400A4000 + 0xAC)))
  7312. // Field (width: 8 bits): Data byte 7 of Rx/Tx frame.
  7313. inline uint32_t CAN_WORD12_DATA_BYTE_7 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7314. // Field (width: 8 bits): Data byte 6 of Rx/Tx frame.
  7315. inline uint32_t CAN_WORD12_DATA_BYTE_6 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7316. // Field (width: 8 bits): Data byte 5 of Rx/Tx frame.
  7317. inline uint32_t CAN_WORD12_DATA_BYTE_5 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  7318. // Field (width: 8 bits): Data byte 4 of Rx/Tx frame.
  7319. inline uint32_t CAN_WORD12_DATA_BYTE_4 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  7320. //-------------------- Module Configuration Register
  7321. #define CAN_MCR(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0)))
  7322. #define CAN0_MCR (* ((volatile uint32_t *) (0x40024000 + 0)))
  7323. #define CAN1_MCR (* ((volatile uint32_t *) (0x400A4000 + 0)))
  7324. // Boolean field: Halt FlexCAN
  7325. static const uint32_t CAN_MCR_HALT = 1U << 28 ;
  7326. // Boolean field: Soft Reset
  7327. static const uint32_t CAN_MCR_SOFTRST = 1U << 25 ;
  7328. // Boolean field: Wake Up Source
  7329. static const uint32_t CAN_MCR_WAKSRC = 1U << 19 ;
  7330. // Boolean field: Warning Interrupt Enable
  7331. static const uint32_t CAN_MCR_WRNEN = 1U << 21 ;
  7332. // Boolean field: Freeze Mode Acknowledge
  7333. static const uint32_t CAN_MCR_FRZACK = 1U << 24 ;
  7334. // Boolean field: Local Priority Enable
  7335. static const uint32_t CAN_MCR_LPRIOEN = 1U << 13 ;
  7336. // Boolean field: Self Wake Up
  7337. static const uint32_t CAN_MCR_SLFWAK = 1U << 22 ;
  7338. // Boolean field: Supervisor Mode
  7339. static const uint32_t CAN_MCR_SUPV = 1U << 23 ;
  7340. // Boolean field: Freeze Enable
  7341. static const uint32_t CAN_MCR_FRZ = 1U << 30 ;
  7342. // Boolean field: Low-Power Mode Acknowledge
  7343. static const uint32_t CAN_MCR_LPMACK = 1U << 20 ;
  7344. // Boolean field: Rx FIFO Enable
  7345. static const uint32_t CAN_MCR_RFEN = 1U << 29 ;
  7346. // Boolean field: Individual Rx Masking And Queue Enable
  7347. static const uint32_t CAN_MCR_IRMQ = 1U << 16 ;
  7348. // Boolean field: FlexCAN Not Ready
  7349. static const uint32_t CAN_MCR_NOTRDY = 1U << 27 ;
  7350. // Boolean field: Self Reception Disable
  7351. static const uint32_t CAN_MCR_SRXDIS = 1U << 17 ;
  7352. // Boolean field: Module Disable
  7353. static const uint32_t CAN_MCR_MDIS = 1U << 31 ;
  7354. // Boolean field: Wake Up Interrupt Mask
  7355. static const uint32_t CAN_MCR_WAKMSK = 1U << 26 ;
  7356. // Field (width: 2 bits): ID Acceptance Mode
  7357. inline uint32_t CAN_MCR_IDAM (const uint32_t inValue) { return (inValue & 3U) << 8 ; }
  7358. // Field (width: 7 bits): Number Of The Last Message Buffer
  7359. inline uint32_t CAN_MCR_MAXMB (const uint32_t inValue) { return (inValue & 127U) << 0 ; }
  7360. // Boolean field: Abort Enable
  7361. static const uint32_t CAN_MCR_AEN = 1U << 12 ;
  7362. //-------------------- Message Buffer 9 WORD1 Register
  7363. #define CAN_WORD19(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x11C)))
  7364. #define CAN0_WORD19 (* ((volatile uint32_t *) (0x40024000 + 0x11C)))
  7365. #define CAN1_WORD19 (* ((volatile uint32_t *) (0x400A4000 + 0x11C)))
  7366. // Field (width: 8 bits): Data byte 7 of Rx/Tx frame.
  7367. inline uint32_t CAN_WORD19_DATA_BYTE_7 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7368. // Field (width: 8 bits): Data byte 6 of Rx/Tx frame.
  7369. inline uint32_t CAN_WORD19_DATA_BYTE_6 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7370. // Field (width: 8 bits): Data byte 5 of Rx/Tx frame.
  7371. inline uint32_t CAN_WORD19_DATA_BYTE_5 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  7372. // Field (width: 8 bits): Data byte 4 of Rx/Tx frame.
  7373. inline uint32_t CAN_WORD19_DATA_BYTE_4 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  7374. //-------------------- Message Buffer 8 WORD1 Register
  7375. #define CAN_WORD18(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x10C)))
  7376. #define CAN0_WORD18 (* ((volatile uint32_t *) (0x40024000 + 0x10C)))
  7377. #define CAN1_WORD18 (* ((volatile uint32_t *) (0x400A4000 + 0x10C)))
  7378. // Field (width: 8 bits): Data byte 7 of Rx/Tx frame.
  7379. inline uint32_t CAN_WORD18_DATA_BYTE_7 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7380. // Field (width: 8 bits): Data byte 6 of Rx/Tx frame.
  7381. inline uint32_t CAN_WORD18_DATA_BYTE_6 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7382. // Field (width: 8 bits): Data byte 5 of Rx/Tx frame.
  7383. inline uint32_t CAN_WORD18_DATA_BYTE_5 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  7384. // Field (width: 8 bits): Data byte 4 of Rx/Tx frame.
  7385. inline uint32_t CAN_WORD18_DATA_BYTE_4 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  7386. //-------------------- Rx FIFO Information Register
  7387. #define CAN_RXFIR(group) (* ((const volatile uint32_t *) (kBaseAddress_CAN [group] + 0x4C)))
  7388. #define CAN0_RXFIR (* ((const volatile uint32_t *) (0x40024000 + 0x4C)))
  7389. #define CAN1_RXFIR (* ((const volatile uint32_t *) (0x400A4000 + 0x4C)))
  7390. // Field (width: 9 bits): Identifier Acceptance Filter Hit Indicator
  7391. inline uint32_t CAN_RXFIR_IDHIT (const uint32_t inValue) { return (inValue & 511U) << 0 ; }
  7392. //-------------------- Message Buffer 8 CS Register
  7393. #define CAN_CS8(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x100)))
  7394. #define CAN0_CS8 (* ((volatile uint32_t *) (0x40024000 + 0x100)))
  7395. #define CAN1_CS8 (* ((volatile uint32_t *) (0x400A4000 + 0x100)))
  7396. // Field (width: 4 bits): Length of the data to be stored/transmitted.
  7397. inline uint32_t CAN_CS8_DLC (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  7398. // Field (width: 4 bits): Reserved
  7399. inline uint32_t CAN_CS8_CODE (const uint32_t inValue) { return (inValue & 15U) << 24 ; }
  7400. // Boolean field: Substitute Remote Request. Contains a fixed recessive bit.
  7401. static const uint32_t CAN_CS8_SRR = 1U << 22 ;
  7402. // Boolean field: Remote Transmission Request. One/zero for remote/data frame.
  7403. static const uint32_t CAN_CS8_RTR = 1U << 20 ;
  7404. // Field (width: 16 bits): Free-Running Counter Time stamp. This 16-bit field is a copy of the Free-Running Timer, captured for Tx and Rx frames at the time when the beginning of the Identifier field appears on the CAN bus.
  7405. inline uint32_t CAN_CS8_TIME_STAMP (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  7406. // Boolean field: ID Extended. One/zero for extended/standard format frame.
  7407. static const uint32_t CAN_CS8_IDE = 1U << 21 ;
  7408. //-------------------- Message Buffer 11 WORD0 Register
  7409. #define CAN_WORD011(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x138)))
  7410. #define CAN0_WORD011 (* ((volatile uint32_t *) (0x40024000 + 0x138)))
  7411. #define CAN1_WORD011 (* ((volatile uint32_t *) (0x400A4000 + 0x138)))
  7412. // Field (width: 8 bits): Data byte 3 of Rx/Tx frame.
  7413. inline uint32_t CAN_WORD011_DATA_BYTE_3 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7414. // Field (width: 8 bits): Data byte 2 of Rx/Tx frame.
  7415. inline uint32_t CAN_WORD011_DATA_BYTE_2 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7416. // Field (width: 8 bits): Data byte 1 of Rx/Tx frame.
  7417. inline uint32_t CAN_WORD011_DATA_BYTE_1 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  7418. // Field (width: 8 bits): Data byte 0 of Rx/Tx frame.
  7419. inline uint32_t CAN_WORD011_DATA_BYTE_0 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  7420. //-------------------- Message Buffer 6 WORD1 Register
  7421. #define CAN_WORD16(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0xEC)))
  7422. #define CAN0_WORD16 (* ((volatile uint32_t *) (0x40024000 + 0xEC)))
  7423. #define CAN1_WORD16 (* ((volatile uint32_t *) (0x400A4000 + 0xEC)))
  7424. // Field (width: 8 bits): Data byte 7 of Rx/Tx frame.
  7425. inline uint32_t CAN_WORD16_DATA_BYTE_7 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7426. // Field (width: 8 bits): Data byte 6 of Rx/Tx frame.
  7427. inline uint32_t CAN_WORD16_DATA_BYTE_6 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7428. // Field (width: 8 bits): Data byte 5 of Rx/Tx frame.
  7429. inline uint32_t CAN_WORD16_DATA_BYTE_5 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  7430. // Field (width: 8 bits): Data byte 4 of Rx/Tx frame.
  7431. inline uint32_t CAN_WORD16_DATA_BYTE_4 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  7432. //-------------------- Message Buffer 13 CS Register
  7433. #define CAN_CS13(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x150)))
  7434. #define CAN0_CS13 (* ((volatile uint32_t *) (0x40024000 + 0x150)))
  7435. #define CAN1_CS13 (* ((volatile uint32_t *) (0x400A4000 + 0x150)))
  7436. // Field (width: 4 bits): Length of the data to be stored/transmitted.
  7437. inline uint32_t CAN_CS13_DLC (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  7438. // Field (width: 4 bits): Reserved
  7439. inline uint32_t CAN_CS13_CODE (const uint32_t inValue) { return (inValue & 15U) << 24 ; }
  7440. // Boolean field: Substitute Remote Request. Contains a fixed recessive bit.
  7441. static const uint32_t CAN_CS13_SRR = 1U << 22 ;
  7442. // Boolean field: Remote Transmission Request. One/zero for remote/data frame.
  7443. static const uint32_t CAN_CS13_RTR = 1U << 20 ;
  7444. // Field (width: 16 bits): Free-Running Counter Time stamp. This 16-bit field is a copy of the Free-Running Timer, captured for Tx and Rx frames at the time when the beginning of the Identifier field appears on the CAN bus.
  7445. inline uint32_t CAN_CS13_TIME_STAMP (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  7446. // Boolean field: ID Extended. One/zero for extended/standard format frame.
  7447. static const uint32_t CAN_CS13_IDE = 1U << 21 ;
  7448. //-------------------- Message Buffer 14 WORD0 Register
  7449. #define CAN_WORD014(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x168)))
  7450. #define CAN0_WORD014 (* ((volatile uint32_t *) (0x40024000 + 0x168)))
  7451. #define CAN1_WORD014 (* ((volatile uint32_t *) (0x400A4000 + 0x168)))
  7452. // Field (width: 8 bits): Data byte 3 of Rx/Tx frame.
  7453. inline uint32_t CAN_WORD014_DATA_BYTE_3 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7454. // Field (width: 8 bits): Data byte 2 of Rx/Tx frame.
  7455. inline uint32_t CAN_WORD014_DATA_BYTE_2 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7456. // Field (width: 8 bits): Data byte 1 of Rx/Tx frame.
  7457. inline uint32_t CAN_WORD014_DATA_BYTE_1 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  7458. // Field (width: 8 bits): Data byte 0 of Rx/Tx frame.
  7459. inline uint32_t CAN_WORD014_DATA_BYTE_0 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  7460. //-------------------- Message Buffer 15 WORD0 Register
  7461. #define CAN_WORD015(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x178)))
  7462. #define CAN0_WORD015 (* ((volatile uint32_t *) (0x40024000 + 0x178)))
  7463. #define CAN1_WORD015 (* ((volatile uint32_t *) (0x400A4000 + 0x178)))
  7464. // Field (width: 8 bits): Data byte 3 of Rx/Tx frame.
  7465. inline uint32_t CAN_WORD015_DATA_BYTE_3 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7466. // Field (width: 8 bits): Data byte 2 of Rx/Tx frame.
  7467. inline uint32_t CAN_WORD015_DATA_BYTE_2 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7468. // Field (width: 8 bits): Data byte 1 of Rx/Tx frame.
  7469. inline uint32_t CAN_WORD015_DATA_BYTE_1 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  7470. // Field (width: 8 bits): Data byte 0 of Rx/Tx frame.
  7471. inline uint32_t CAN_WORD015_DATA_BYTE_0 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  7472. //-------------------- Message Buffer 14 WORD1 Register
  7473. #define CAN_WORD114(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x16C)))
  7474. #define CAN0_WORD114 (* ((volatile uint32_t *) (0x40024000 + 0x16C)))
  7475. #define CAN1_WORD114 (* ((volatile uint32_t *) (0x400A4000 + 0x16C)))
  7476. // Field (width: 8 bits): Data byte 7 of Rx/Tx frame.
  7477. inline uint32_t CAN_WORD114_DATA_BYTE_7 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7478. // Field (width: 8 bits): Data byte 6 of Rx/Tx frame.
  7479. inline uint32_t CAN_WORD114_DATA_BYTE_6 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7480. // Field (width: 8 bits): Data byte 5 of Rx/Tx frame.
  7481. inline uint32_t CAN_WORD114_DATA_BYTE_5 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  7482. // Field (width: 8 bits): Data byte 4 of Rx/Tx frame.
  7483. inline uint32_t CAN_WORD114_DATA_BYTE_4 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  7484. //-------------------- Message Buffer 10 WORD0 Register
  7485. #define CAN_WORD010(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x128)))
  7486. #define CAN0_WORD010 (* ((volatile uint32_t *) (0x40024000 + 0x128)))
  7487. #define CAN1_WORD010 (* ((volatile uint32_t *) (0x400A4000 + 0x128)))
  7488. // Field (width: 8 bits): Data byte 3 of Rx/Tx frame.
  7489. inline uint32_t CAN_WORD010_DATA_BYTE_3 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7490. // Field (width: 8 bits): Data byte 2 of Rx/Tx frame.
  7491. inline uint32_t CAN_WORD010_DATA_BYTE_2 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7492. // Field (width: 8 bits): Data byte 1 of Rx/Tx frame.
  7493. inline uint32_t CAN_WORD010_DATA_BYTE_1 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  7494. // Field (width: 8 bits): Data byte 0 of Rx/Tx frame.
  7495. inline uint32_t CAN_WORD010_DATA_BYTE_0 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  7496. //-------------------- Rx Individual Mask Registers (idx = 0 ... 15)
  7497. #define CAN_RXIMR(group,idx) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x880 + 0x4 * (idx))))
  7498. #define CAN0_RXIMR(idx) (* ((volatile uint32_t *) (0x40024000 + 0x880 + 0x4 * (idx))))
  7499. #define CAN1_RXIMR(idx) (* ((volatile uint32_t *) (0x400A4000 + 0x880 + 0x4 * (idx))))
  7500. //-------------------- Message Buffer 11 WORD1 Register
  7501. #define CAN_WORD111(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x13C)))
  7502. #define CAN0_WORD111 (* ((volatile uint32_t *) (0x40024000 + 0x13C)))
  7503. #define CAN1_WORD111 (* ((volatile uint32_t *) (0x400A4000 + 0x13C)))
  7504. // Field (width: 8 bits): Data byte 7 of Rx/Tx frame.
  7505. inline uint32_t CAN_WORD111_DATA_BYTE_7 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7506. // Field (width: 8 bits): Data byte 6 of Rx/Tx frame.
  7507. inline uint32_t CAN_WORD111_DATA_BYTE_6 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7508. // Field (width: 8 bits): Data byte 5 of Rx/Tx frame.
  7509. inline uint32_t CAN_WORD111_DATA_BYTE_5 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  7510. // Field (width: 8 bits): Data byte 4 of Rx/Tx frame.
  7511. inline uint32_t CAN_WORD111_DATA_BYTE_4 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  7512. //-------------------- Message Buffer 10 WORD1 Register
  7513. #define CAN_WORD110(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x12C)))
  7514. #define CAN0_WORD110 (* ((volatile uint32_t *) (0x40024000 + 0x12C)))
  7515. #define CAN1_WORD110 (* ((volatile uint32_t *) (0x400A4000 + 0x12C)))
  7516. // Field (width: 8 bits): Data byte 7 of Rx/Tx frame.
  7517. inline uint32_t CAN_WORD110_DATA_BYTE_7 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7518. // Field (width: 8 bits): Data byte 6 of Rx/Tx frame.
  7519. inline uint32_t CAN_WORD110_DATA_BYTE_6 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7520. // Field (width: 8 bits): Data byte 5 of Rx/Tx frame.
  7521. inline uint32_t CAN_WORD110_DATA_BYTE_5 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  7522. // Field (width: 8 bits): Data byte 4 of Rx/Tx frame.
  7523. inline uint32_t CAN_WORD110_DATA_BYTE_4 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  7524. //-------------------- Message Buffer 13 WORD1 Register
  7525. #define CAN_WORD113(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x15C)))
  7526. #define CAN0_WORD113 (* ((volatile uint32_t *) (0x40024000 + 0x15C)))
  7527. #define CAN1_WORD113 (* ((volatile uint32_t *) (0x400A4000 + 0x15C)))
  7528. // Field (width: 8 bits): Data byte 7 of Rx/Tx frame.
  7529. inline uint32_t CAN_WORD113_DATA_BYTE_7 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7530. // Field (width: 8 bits): Data byte 6 of Rx/Tx frame.
  7531. inline uint32_t CAN_WORD113_DATA_BYTE_6 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7532. // Field (width: 8 bits): Data byte 5 of Rx/Tx frame.
  7533. inline uint32_t CAN_WORD113_DATA_BYTE_5 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  7534. // Field (width: 8 bits): Data byte 4 of Rx/Tx frame.
  7535. inline uint32_t CAN_WORD113_DATA_BYTE_4 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  7536. //-------------------- Message Buffer 12 WORD1 Register
  7537. #define CAN_WORD112(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x14C)))
  7538. #define CAN0_WORD112 (* ((volatile uint32_t *) (0x40024000 + 0x14C)))
  7539. #define CAN1_WORD112 (* ((volatile uint32_t *) (0x400A4000 + 0x14C)))
  7540. // Field (width: 8 bits): Data byte 7 of Rx/Tx frame.
  7541. inline uint32_t CAN_WORD112_DATA_BYTE_7 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7542. // Field (width: 8 bits): Data byte 6 of Rx/Tx frame.
  7543. inline uint32_t CAN_WORD112_DATA_BYTE_6 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7544. // Field (width: 8 bits): Data byte 5 of Rx/Tx frame.
  7545. inline uint32_t CAN_WORD112_DATA_BYTE_5 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  7546. // Field (width: 8 bits): Data byte 4 of Rx/Tx frame.
  7547. inline uint32_t CAN_WORD112_DATA_BYTE_4 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  7548. //-------------------- Message Buffer 9 CS Register
  7549. #define CAN_CS9(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x110)))
  7550. #define CAN0_CS9 (* ((volatile uint32_t *) (0x40024000 + 0x110)))
  7551. #define CAN1_CS9 (* ((volatile uint32_t *) (0x400A4000 + 0x110)))
  7552. // Field (width: 4 bits): Length of the data to be stored/transmitted.
  7553. inline uint32_t CAN_CS9_DLC (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  7554. // Field (width: 4 bits): Reserved
  7555. inline uint32_t CAN_CS9_CODE (const uint32_t inValue) { return (inValue & 15U) << 24 ; }
  7556. // Boolean field: Substitute Remote Request. Contains a fixed recessive bit.
  7557. static const uint32_t CAN_CS9_SRR = 1U << 22 ;
  7558. // Boolean field: Remote Transmission Request. One/zero for remote/data frame.
  7559. static const uint32_t CAN_CS9_RTR = 1U << 20 ;
  7560. // Field (width: 16 bits): Free-Running Counter Time stamp. This 16-bit field is a copy of the Free-Running Timer, captured for Tx and Rx frames at the time when the beginning of the Identifier field appears on the CAN bus.
  7561. inline uint32_t CAN_CS9_TIME_STAMP (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  7562. // Boolean field: ID Extended. One/zero for extended/standard format frame.
  7563. static const uint32_t CAN_CS9_IDE = 1U << 21 ;
  7564. //-------------------- Error Counter
  7565. #define CAN_ECR(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x1C)))
  7566. #define CAN0_ECR (* ((volatile uint32_t *) (0x40024000 + 0x1C)))
  7567. #define CAN1_ECR (* ((volatile uint32_t *) (0x400A4000 + 0x1C)))
  7568. // Field (width: 8 bits): Receive Error Counter
  7569. inline uint32_t CAN_ECR_RXERRCNT (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7570. // Field (width: 8 bits): Transmit Error Counter
  7571. inline uint32_t CAN_ECR_TXERRCNT (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7572. //-------------------- Message Buffer 12 WORD0 Register
  7573. #define CAN_WORD012(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x148)))
  7574. #define CAN0_WORD012 (* ((volatile uint32_t *) (0x40024000 + 0x148)))
  7575. #define CAN1_WORD012 (* ((volatile uint32_t *) (0x400A4000 + 0x148)))
  7576. // Field (width: 8 bits): Data byte 3 of Rx/Tx frame.
  7577. inline uint32_t CAN_WORD012_DATA_BYTE_3 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7578. // Field (width: 8 bits): Data byte 2 of Rx/Tx frame.
  7579. inline uint32_t CAN_WORD012_DATA_BYTE_2 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7580. // Field (width: 8 bits): Data byte 1 of Rx/Tx frame.
  7581. inline uint32_t CAN_WORD012_DATA_BYTE_1 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  7582. // Field (width: 8 bits): Data byte 0 of Rx/Tx frame.
  7583. inline uint32_t CAN_WORD012_DATA_BYTE_0 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  7584. //-------------------- Message Buffer 13 WORD0 Register
  7585. #define CAN_WORD013(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x158)))
  7586. #define CAN0_WORD013 (* ((volatile uint32_t *) (0x40024000 + 0x158)))
  7587. #define CAN1_WORD013 (* ((volatile uint32_t *) (0x400A4000 + 0x158)))
  7588. // Field (width: 8 bits): Data byte 3 of Rx/Tx frame.
  7589. inline uint32_t CAN_WORD013_DATA_BYTE_3 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7590. // Field (width: 8 bits): Data byte 2 of Rx/Tx frame.
  7591. inline uint32_t CAN_WORD013_DATA_BYTE_2 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7592. // Field (width: 8 bits): Data byte 1 of Rx/Tx frame.
  7593. inline uint32_t CAN_WORD013_DATA_BYTE_1 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  7594. // Field (width: 8 bits): Data byte 0 of Rx/Tx frame.
  7595. inline uint32_t CAN_WORD013_DATA_BYTE_0 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  7596. //-------------------- Interrupt Masks 1 register
  7597. #define CAN_IMASK1(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x28)))
  7598. #define CAN0_IMASK1 (* ((volatile uint32_t *) (0x40024000 + 0x28)))
  7599. #define CAN1_IMASK1 (* ((volatile uint32_t *) (0x400A4000 + 0x28)))
  7600. //-------------------- Message Buffer 4 CS Register
  7601. #define CAN_CS4(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0xC0)))
  7602. #define CAN0_CS4 (* ((volatile uint32_t *) (0x40024000 + 0xC0)))
  7603. #define CAN1_CS4 (* ((volatile uint32_t *) (0x400A4000 + 0xC0)))
  7604. // Field (width: 4 bits): Length of the data to be stored/transmitted.
  7605. inline uint32_t CAN_CS4_DLC (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  7606. // Field (width: 4 bits): Reserved
  7607. inline uint32_t CAN_CS4_CODE (const uint32_t inValue) { return (inValue & 15U) << 24 ; }
  7608. // Boolean field: Substitute Remote Request. Contains a fixed recessive bit.
  7609. static const uint32_t CAN_CS4_SRR = 1U << 22 ;
  7610. // Boolean field: Remote Transmission Request. One/zero for remote/data frame.
  7611. static const uint32_t CAN_CS4_RTR = 1U << 20 ;
  7612. // Field (width: 16 bits): Free-Running Counter Time stamp. This 16-bit field is a copy of the Free-Running Timer, captured for Tx and Rx frames at the time when the beginning of the Identifier field appears on the CAN bus.
  7613. inline uint32_t CAN_CS4_TIME_STAMP (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  7614. // Boolean field: ID Extended. One/zero for extended/standard format frame.
  7615. static const uint32_t CAN_CS4_IDE = 1U << 21 ;
  7616. //-------------------- Message Buffer 7 CS Register
  7617. #define CAN_CS7(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0xF0)))
  7618. #define CAN0_CS7 (* ((volatile uint32_t *) (0x40024000 + 0xF0)))
  7619. #define CAN1_CS7 (* ((volatile uint32_t *) (0x400A4000 + 0xF0)))
  7620. // Field (width: 4 bits): Length of the data to be stored/transmitted.
  7621. inline uint32_t CAN_CS7_DLC (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  7622. // Field (width: 4 bits): Reserved
  7623. inline uint32_t CAN_CS7_CODE (const uint32_t inValue) { return (inValue & 15U) << 24 ; }
  7624. // Boolean field: Substitute Remote Request. Contains a fixed recessive bit.
  7625. static const uint32_t CAN_CS7_SRR = 1U << 22 ;
  7626. // Boolean field: Remote Transmission Request. One/zero for remote/data frame.
  7627. static const uint32_t CAN_CS7_RTR = 1U << 20 ;
  7628. // Field (width: 16 bits): Free-Running Counter Time stamp. This 16-bit field is a copy of the Free-Running Timer, captured for Tx and Rx frames at the time when the beginning of the Identifier field appears on the CAN bus.
  7629. inline uint32_t CAN_CS7_TIME_STAMP (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  7630. // Boolean field: ID Extended. One/zero for extended/standard format frame.
  7631. static const uint32_t CAN_CS7_IDE = 1U << 21 ;
  7632. //-------------------- Message Buffer 6 CS Register
  7633. #define CAN_CS6(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0xE0)))
  7634. #define CAN0_CS6 (* ((volatile uint32_t *) (0x40024000 + 0xE0)))
  7635. #define CAN1_CS6 (* ((volatile uint32_t *) (0x400A4000 + 0xE0)))
  7636. // Field (width: 4 bits): Length of the data to be stored/transmitted.
  7637. inline uint32_t CAN_CS6_DLC (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  7638. // Field (width: 4 bits): Reserved
  7639. inline uint32_t CAN_CS6_CODE (const uint32_t inValue) { return (inValue & 15U) << 24 ; }
  7640. // Boolean field: Substitute Remote Request. Contains a fixed recessive bit.
  7641. static const uint32_t CAN_CS6_SRR = 1U << 22 ;
  7642. // Boolean field: Remote Transmission Request. One/zero for remote/data frame.
  7643. static const uint32_t CAN_CS6_RTR = 1U << 20 ;
  7644. // Field (width: 16 bits): Free-Running Counter Time stamp. This 16-bit field is a copy of the Free-Running Timer, captured for Tx and Rx frames at the time when the beginning of the Identifier field appears on the CAN bus.
  7645. inline uint32_t CAN_CS6_TIME_STAMP (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  7646. // Boolean field: ID Extended. One/zero for extended/standard format frame.
  7647. static const uint32_t CAN_CS6_IDE = 1U << 21 ;
  7648. //-------------------- Message Buffer 1 CS Register
  7649. #define CAN_CS1(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x90)))
  7650. #define CAN0_CS1 (* ((volatile uint32_t *) (0x40024000 + 0x90)))
  7651. #define CAN1_CS1 (* ((volatile uint32_t *) (0x400A4000 + 0x90)))
  7652. // Field (width: 4 bits): Length of the data to be stored/transmitted.
  7653. inline uint32_t CAN_CS1_DLC (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  7654. // Field (width: 4 bits): Reserved
  7655. inline uint32_t CAN_CS1_CODE (const uint32_t inValue) { return (inValue & 15U) << 24 ; }
  7656. // Boolean field: Substitute Remote Request. Contains a fixed recessive bit.
  7657. static const uint32_t CAN_CS1_SRR = 1U << 22 ;
  7658. // Boolean field: Remote Transmission Request. One/zero for remote/data frame.
  7659. static const uint32_t CAN_CS1_RTR = 1U << 20 ;
  7660. // Field (width: 16 bits): Free-Running Counter Time stamp. This 16-bit field is a copy of the Free-Running Timer, captured for Tx and Rx frames at the time when the beginning of the Identifier field appears on the CAN bus.
  7661. inline uint32_t CAN_CS1_TIME_STAMP (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  7662. // Boolean field: ID Extended. One/zero for extended/standard format frame.
  7663. static const uint32_t CAN_CS1_IDE = 1U << 21 ;
  7664. //-------------------- Message Buffer 0 CS Register
  7665. #define CAN_CS0(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x80)))
  7666. #define CAN0_CS0 (* ((volatile uint32_t *) (0x40024000 + 0x80)))
  7667. #define CAN1_CS0 (* ((volatile uint32_t *) (0x400A4000 + 0x80)))
  7668. // Field (width: 4 bits): Length of the data to be stored/transmitted.
  7669. inline uint32_t CAN_CS0_DLC (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  7670. // Field (width: 4 bits): Reserved
  7671. inline uint32_t CAN_CS0_CODE (const uint32_t inValue) { return (inValue & 15U) << 24 ; }
  7672. // Boolean field: Substitute Remote Request. Contains a fixed recessive bit.
  7673. static const uint32_t CAN_CS0_SRR = 1U << 22 ;
  7674. // Boolean field: Remote Transmission Request. One/zero for remote/data frame.
  7675. static const uint32_t CAN_CS0_RTR = 1U << 20 ;
  7676. // Field (width: 16 bits): Free-Running Counter Time stamp. This 16-bit field is a copy of the Free-Running Timer, captured for Tx and Rx frames at the time when the beginning of the Identifier field appears on the CAN bus.
  7677. inline uint32_t CAN_CS0_TIME_STAMP (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  7678. // Boolean field: ID Extended. One/zero for extended/standard format frame.
  7679. static const uint32_t CAN_CS0_IDE = 1U << 21 ;
  7680. //-------------------- Message Buffer 3 CS Register
  7681. #define CAN_CS3(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0xB0)))
  7682. #define CAN0_CS3 (* ((volatile uint32_t *) (0x40024000 + 0xB0)))
  7683. #define CAN1_CS3 (* ((volatile uint32_t *) (0x400A4000 + 0xB0)))
  7684. // Field (width: 4 bits): Length of the data to be stored/transmitted.
  7685. inline uint32_t CAN_CS3_DLC (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  7686. // Field (width: 4 bits): Reserved
  7687. inline uint32_t CAN_CS3_CODE (const uint32_t inValue) { return (inValue & 15U) << 24 ; }
  7688. // Boolean field: Substitute Remote Request. Contains a fixed recessive bit.
  7689. static const uint32_t CAN_CS3_SRR = 1U << 22 ;
  7690. // Boolean field: Remote Transmission Request. One/zero for remote/data frame.
  7691. static const uint32_t CAN_CS3_RTR = 1U << 20 ;
  7692. // Field (width: 16 bits): Free-Running Counter Time stamp. This 16-bit field is a copy of the Free-Running Timer, captured for Tx and Rx frames at the time when the beginning of the Identifier field appears on the CAN bus.
  7693. inline uint32_t CAN_CS3_TIME_STAMP (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  7694. // Boolean field: ID Extended. One/zero for extended/standard format frame.
  7695. static const uint32_t CAN_CS3_IDE = 1U << 21 ;
  7696. //-------------------- Rx FIFO Global Mask register
  7697. #define CAN_RXFGMASK(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x48)))
  7698. #define CAN0_RXFGMASK (* ((volatile uint32_t *) (0x40024000 + 0x48)))
  7699. #define CAN1_RXFGMASK (* ((volatile uint32_t *) (0x400A4000 + 0x48)))
  7700. //-------------------- Message Buffer 6 WORD0 Register
  7701. #define CAN_WORD06(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0xE8)))
  7702. #define CAN0_WORD06 (* ((volatile uint32_t *) (0x40024000 + 0xE8)))
  7703. #define CAN1_WORD06 (* ((volatile uint32_t *) (0x400A4000 + 0xE8)))
  7704. // Field (width: 8 bits): Data byte 3 of Rx/Tx frame.
  7705. inline uint32_t CAN_WORD06_DATA_BYTE_3 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7706. // Field (width: 8 bits): Data byte 2 of Rx/Tx frame.
  7707. inline uint32_t CAN_WORD06_DATA_BYTE_2 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7708. // Field (width: 8 bits): Data byte 1 of Rx/Tx frame.
  7709. inline uint32_t CAN_WORD06_DATA_BYTE_1 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  7710. // Field (width: 8 bits): Data byte 0 of Rx/Tx frame.
  7711. inline uint32_t CAN_WORD06_DATA_BYTE_0 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  7712. //-------------------- Message Buffer 7 WORD0 Register
  7713. #define CAN_WORD07(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0xF8)))
  7714. #define CAN0_WORD07 (* ((volatile uint32_t *) (0x40024000 + 0xF8)))
  7715. #define CAN1_WORD07 (* ((volatile uint32_t *) (0x400A4000 + 0xF8)))
  7716. // Field (width: 8 bits): Data byte 3 of Rx/Tx frame.
  7717. inline uint32_t CAN_WORD07_DATA_BYTE_3 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7718. // Field (width: 8 bits): Data byte 2 of Rx/Tx frame.
  7719. inline uint32_t CAN_WORD07_DATA_BYTE_2 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7720. // Field (width: 8 bits): Data byte 1 of Rx/Tx frame.
  7721. inline uint32_t CAN_WORD07_DATA_BYTE_1 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  7722. // Field (width: 8 bits): Data byte 0 of Rx/Tx frame.
  7723. inline uint32_t CAN_WORD07_DATA_BYTE_0 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  7724. //-------------------- Message Buffer 4 WORD0 Register
  7725. #define CAN_WORD04(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0xC8)))
  7726. #define CAN0_WORD04 (* ((volatile uint32_t *) (0x40024000 + 0xC8)))
  7727. #define CAN1_WORD04 (* ((volatile uint32_t *) (0x400A4000 + 0xC8)))
  7728. // Field (width: 8 bits): Data byte 3 of Rx/Tx frame.
  7729. inline uint32_t CAN_WORD04_DATA_BYTE_3 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7730. // Field (width: 8 bits): Data byte 2 of Rx/Tx frame.
  7731. inline uint32_t CAN_WORD04_DATA_BYTE_2 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7732. // Field (width: 8 bits): Data byte 1 of Rx/Tx frame.
  7733. inline uint32_t CAN_WORD04_DATA_BYTE_1 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  7734. // Field (width: 8 bits): Data byte 0 of Rx/Tx frame.
  7735. inline uint32_t CAN_WORD04_DATA_BYTE_0 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  7736. //-------------------- Message Buffer 5 WORD0 Register
  7737. #define CAN_WORD05(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0xD8)))
  7738. #define CAN0_WORD05 (* ((volatile uint32_t *) (0x40024000 + 0xD8)))
  7739. #define CAN1_WORD05 (* ((volatile uint32_t *) (0x400A4000 + 0xD8)))
  7740. // Field (width: 8 bits): Data byte 3 of Rx/Tx frame.
  7741. inline uint32_t CAN_WORD05_DATA_BYTE_3 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7742. // Field (width: 8 bits): Data byte 2 of Rx/Tx frame.
  7743. inline uint32_t CAN_WORD05_DATA_BYTE_2 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7744. // Field (width: 8 bits): Data byte 1 of Rx/Tx frame.
  7745. inline uint32_t CAN_WORD05_DATA_BYTE_1 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  7746. // Field (width: 8 bits): Data byte 0 of Rx/Tx frame.
  7747. inline uint32_t CAN_WORD05_DATA_BYTE_0 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  7748. //-------------------- Message Buffer 2 WORD0 Register
  7749. #define CAN_WORD02(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0xA8)))
  7750. #define CAN0_WORD02 (* ((volatile uint32_t *) (0x40024000 + 0xA8)))
  7751. #define CAN1_WORD02 (* ((volatile uint32_t *) (0x400A4000 + 0xA8)))
  7752. // Field (width: 8 bits): Data byte 3 of Rx/Tx frame.
  7753. inline uint32_t CAN_WORD02_DATA_BYTE_3 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7754. // Field (width: 8 bits): Data byte 2 of Rx/Tx frame.
  7755. inline uint32_t CAN_WORD02_DATA_BYTE_2 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7756. // Field (width: 8 bits): Data byte 1 of Rx/Tx frame.
  7757. inline uint32_t CAN_WORD02_DATA_BYTE_1 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  7758. // Field (width: 8 bits): Data byte 0 of Rx/Tx frame.
  7759. inline uint32_t CAN_WORD02_DATA_BYTE_0 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  7760. //-------------------- Message Buffer 3 WORD0 Register
  7761. #define CAN_WORD03(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0xB8)))
  7762. #define CAN0_WORD03 (* ((volatile uint32_t *) (0x40024000 + 0xB8)))
  7763. #define CAN1_WORD03 (* ((volatile uint32_t *) (0x400A4000 + 0xB8)))
  7764. // Field (width: 8 bits): Data byte 3 of Rx/Tx frame.
  7765. inline uint32_t CAN_WORD03_DATA_BYTE_3 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7766. // Field (width: 8 bits): Data byte 2 of Rx/Tx frame.
  7767. inline uint32_t CAN_WORD03_DATA_BYTE_2 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7768. // Field (width: 8 bits): Data byte 1 of Rx/Tx frame.
  7769. inline uint32_t CAN_WORD03_DATA_BYTE_1 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  7770. // Field (width: 8 bits): Data byte 0 of Rx/Tx frame.
  7771. inline uint32_t CAN_WORD03_DATA_BYTE_0 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  7772. //-------------------- Message Buffer 0 WORD0 Register
  7773. #define CAN_WORD00(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x88)))
  7774. #define CAN0_WORD00 (* ((volatile uint32_t *) (0x40024000 + 0x88)))
  7775. #define CAN1_WORD00 (* ((volatile uint32_t *) (0x400A4000 + 0x88)))
  7776. // Field (width: 8 bits): Data byte 3 of Rx/Tx frame.
  7777. inline uint32_t CAN_WORD00_DATA_BYTE_3 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7778. // Field (width: 8 bits): Data byte 2 of Rx/Tx frame.
  7779. inline uint32_t CAN_WORD00_DATA_BYTE_2 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7780. // Field (width: 8 bits): Data byte 1 of Rx/Tx frame.
  7781. inline uint32_t CAN_WORD00_DATA_BYTE_1 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  7782. // Field (width: 8 bits): Data byte 0 of Rx/Tx frame.
  7783. inline uint32_t CAN_WORD00_DATA_BYTE_0 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  7784. //-------------------- Message Buffer 1 WORD0 Register
  7785. #define CAN_WORD01(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x98)))
  7786. #define CAN0_WORD01 (* ((volatile uint32_t *) (0x40024000 + 0x98)))
  7787. #define CAN1_WORD01 (* ((volatile uint32_t *) (0x400A4000 + 0x98)))
  7788. // Field (width: 8 bits): Data byte 3 of Rx/Tx frame.
  7789. inline uint32_t CAN_WORD01_DATA_BYTE_3 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7790. // Field (width: 8 bits): Data byte 2 of Rx/Tx frame.
  7791. inline uint32_t CAN_WORD01_DATA_BYTE_2 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7792. // Field (width: 8 bits): Data byte 1 of Rx/Tx frame.
  7793. inline uint32_t CAN_WORD01_DATA_BYTE_1 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  7794. // Field (width: 8 bits): Data byte 0 of Rx/Tx frame.
  7795. inline uint32_t CAN_WORD01_DATA_BYTE_0 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  7796. //-------------------- Message Buffer 11 CS Register
  7797. #define CAN_CS11(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x130)))
  7798. #define CAN0_CS11 (* ((volatile uint32_t *) (0x40024000 + 0x130)))
  7799. #define CAN1_CS11 (* ((volatile uint32_t *) (0x400A4000 + 0x130)))
  7800. // Field (width: 4 bits): Length of the data to be stored/transmitted.
  7801. inline uint32_t CAN_CS11_DLC (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  7802. // Field (width: 4 bits): Reserved
  7803. inline uint32_t CAN_CS11_CODE (const uint32_t inValue) { return (inValue & 15U) << 24 ; }
  7804. // Boolean field: Substitute Remote Request. Contains a fixed recessive bit.
  7805. static const uint32_t CAN_CS11_SRR = 1U << 22 ;
  7806. // Boolean field: Remote Transmission Request. One/zero for remote/data frame.
  7807. static const uint32_t CAN_CS11_RTR = 1U << 20 ;
  7808. // Field (width: 16 bits): Free-Running Counter Time stamp. This 16-bit field is a copy of the Free-Running Timer, captured for Tx and Rx frames at the time when the beginning of the Identifier field appears on the CAN bus.
  7809. inline uint32_t CAN_CS11_TIME_STAMP (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  7810. // Boolean field: ID Extended. One/zero for extended/standard format frame.
  7811. static const uint32_t CAN_CS11_IDE = 1U << 21 ;
  7812. //-------------------- Message Buffer 10 CS Register
  7813. #define CAN_CS10(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x120)))
  7814. #define CAN0_CS10 (* ((volatile uint32_t *) (0x40024000 + 0x120)))
  7815. #define CAN1_CS10 (* ((volatile uint32_t *) (0x400A4000 + 0x120)))
  7816. // Field (width: 4 bits): Length of the data to be stored/transmitted.
  7817. inline uint32_t CAN_CS10_DLC (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  7818. // Field (width: 4 bits): Reserved
  7819. inline uint32_t CAN_CS10_CODE (const uint32_t inValue) { return (inValue & 15U) << 24 ; }
  7820. // Boolean field: Substitute Remote Request. Contains a fixed recessive bit.
  7821. static const uint32_t CAN_CS10_SRR = 1U << 22 ;
  7822. // Boolean field: Remote Transmission Request. One/zero for remote/data frame.
  7823. static const uint32_t CAN_CS10_RTR = 1U << 20 ;
  7824. // Field (width: 16 bits): Free-Running Counter Time stamp. This 16-bit field is a copy of the Free-Running Timer, captured for Tx and Rx frames at the time when the beginning of the Identifier field appears on the CAN bus.
  7825. inline uint32_t CAN_CS10_TIME_STAMP (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  7826. // Boolean field: ID Extended. One/zero for extended/standard format frame.
  7827. static const uint32_t CAN_CS10_IDE = 1U << 21 ;
  7828. //-------------------- Rx Mailboxes Global Mask Register
  7829. #define CAN_RXMGMASK(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x10)))
  7830. #define CAN0_RXMGMASK (* ((volatile uint32_t *) (0x40024000 + 0x10)))
  7831. #define CAN1_RXMGMASK (* ((volatile uint32_t *) (0x400A4000 + 0x10)))
  7832. //-------------------- Message Buffer 12 CS Register
  7833. #define CAN_CS12(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x140)))
  7834. #define CAN0_CS12 (* ((volatile uint32_t *) (0x40024000 + 0x140)))
  7835. #define CAN1_CS12 (* ((volatile uint32_t *) (0x400A4000 + 0x140)))
  7836. // Field (width: 4 bits): Length of the data to be stored/transmitted.
  7837. inline uint32_t CAN_CS12_DLC (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  7838. // Field (width: 4 bits): Reserved
  7839. inline uint32_t CAN_CS12_CODE (const uint32_t inValue) { return (inValue & 15U) << 24 ; }
  7840. // Boolean field: Substitute Remote Request. Contains a fixed recessive bit.
  7841. static const uint32_t CAN_CS12_SRR = 1U << 22 ;
  7842. // Boolean field: Remote Transmission Request. One/zero for remote/data frame.
  7843. static const uint32_t CAN_CS12_RTR = 1U << 20 ;
  7844. // Field (width: 16 bits): Free-Running Counter Time stamp. This 16-bit field is a copy of the Free-Running Timer, captured for Tx and Rx frames at the time when the beginning of the Identifier field appears on the CAN bus.
  7845. inline uint32_t CAN_CS12_TIME_STAMP (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  7846. // Boolean field: ID Extended. One/zero for extended/standard format frame.
  7847. static const uint32_t CAN_CS12_IDE = 1U << 21 ;
  7848. //-------------------- Message Buffer 15 CS Register
  7849. #define CAN_CS15(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x170)))
  7850. #define CAN0_CS15 (* ((volatile uint32_t *) (0x40024000 + 0x170)))
  7851. #define CAN1_CS15 (* ((volatile uint32_t *) (0x400A4000 + 0x170)))
  7852. // Field (width: 4 bits): Length of the data to be stored/transmitted.
  7853. inline uint32_t CAN_CS15_DLC (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  7854. // Field (width: 4 bits): Reserved
  7855. inline uint32_t CAN_CS15_CODE (const uint32_t inValue) { return (inValue & 15U) << 24 ; }
  7856. // Boolean field: Substitute Remote Request. Contains a fixed recessive bit.
  7857. static const uint32_t CAN_CS15_SRR = 1U << 22 ;
  7858. // Boolean field: Remote Transmission Request. One/zero for remote/data frame.
  7859. static const uint32_t CAN_CS15_RTR = 1U << 20 ;
  7860. // Field (width: 16 bits): Free-Running Counter Time stamp. This 16-bit field is a copy of the Free-Running Timer, captured for Tx and Rx frames at the time when the beginning of the Identifier field appears on the CAN bus.
  7861. inline uint32_t CAN_CS15_TIME_STAMP (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  7862. // Boolean field: ID Extended. One/zero for extended/standard format frame.
  7863. static const uint32_t CAN_CS15_IDE = 1U << 21 ;
  7864. //-------------------- Message Buffer 14 CS Register
  7865. #define CAN_CS14(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x160)))
  7866. #define CAN0_CS14 (* ((volatile uint32_t *) (0x40024000 + 0x160)))
  7867. #define CAN1_CS14 (* ((volatile uint32_t *) (0x400A4000 + 0x160)))
  7868. // Field (width: 4 bits): Length of the data to be stored/transmitted.
  7869. inline uint32_t CAN_CS14_DLC (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  7870. // Field (width: 4 bits): Reserved
  7871. inline uint32_t CAN_CS14_CODE (const uint32_t inValue) { return (inValue & 15U) << 24 ; }
  7872. // Boolean field: Substitute Remote Request. Contains a fixed recessive bit.
  7873. static const uint32_t CAN_CS14_SRR = 1U << 22 ;
  7874. // Boolean field: Remote Transmission Request. One/zero for remote/data frame.
  7875. static const uint32_t CAN_CS14_RTR = 1U << 20 ;
  7876. // Field (width: 16 bits): Free-Running Counter Time stamp. This 16-bit field is a copy of the Free-Running Timer, captured for Tx and Rx frames at the time when the beginning of the Identifier field appears on the CAN bus.
  7877. inline uint32_t CAN_CS14_TIME_STAMP (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  7878. // Boolean field: ID Extended. One/zero for extended/standard format frame.
  7879. static const uint32_t CAN_CS14_IDE = 1U << 21 ;
  7880. //-------------------- Free Running Timer
  7881. #define CAN_TIMER(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x8)))
  7882. #define CAN0_TIMER (* ((volatile uint32_t *) (0x40024000 + 0x8)))
  7883. #define CAN1_TIMER (* ((volatile uint32_t *) (0x400A4000 + 0x8)))
  7884. // Field (width: 16 bits): Timer Value
  7885. inline uint32_t CAN_TIMER_TIMER (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  7886. //-------------------- Message Buffer 9 ID Register
  7887. #define CAN_ID9(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x114)))
  7888. #define CAN0_ID9 (* ((volatile uint32_t *) (0x40024000 + 0x114)))
  7889. #define CAN1_ID9 (* ((volatile uint32_t *) (0x400A4000 + 0x114)))
  7890. // Field (width: 11 bits): Contains standard/extended (HIGH word) identifier of message buffer.
  7891. inline uint32_t CAN_ID9_STD (const uint32_t inValue) { return (inValue & 2047U) << 18 ; }
  7892. // Field (width: 18 bits): Contains extended (LOW word) identifier of message buffer.
  7893. inline uint32_t CAN_ID9_EXT (const uint32_t inValue) { return (inValue & 262143U) << 0 ; }
  7894. // Field (width: 3 bits): Local priority. This 3-bit fieldis only used when LPRIO_EN bit is set in MCR and it only makes sense for Tx buffers. These bits are not transmitted. They are appended to the regular ID to define the transmission priority.
  7895. inline uint32_t CAN_ID9_PRIO (const uint32_t inValue) { return (inValue & 7U) << 29 ; }
  7896. //-------------------- Rx 14 Mask register
  7897. #define CAN_RX14MASK(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x14)))
  7898. #define CAN0_RX14MASK (* ((volatile uint32_t *) (0x40024000 + 0x14)))
  7899. #define CAN1_RX14MASK (* ((volatile uint32_t *) (0x400A4000 + 0x14)))
  7900. //-------------------- Interrupt Flags 1 register
  7901. #define CAN_IFLAG1(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x30)))
  7902. #define CAN0_IFLAG1 (* ((volatile uint32_t *) (0x40024000 + 0x30)))
  7903. #define CAN1_IFLAG1 (* ((volatile uint32_t *) (0x400A4000 + 0x30)))
  7904. // Field (width: 4 bits): Buffer MB i Interrupt Or "reserved"
  7905. inline uint32_t CAN_IFLAG1_BUF4TO1I (const uint32_t inValue) { return (inValue & 15U) << 1 ; }
  7906. // Field (width: 24 bits): Buffer MBi Interrupt
  7907. inline uint32_t CAN_IFLAG1_BUF31TO8I (const uint32_t inValue) { return (inValue & 16777215U) << 8 ; }
  7908. // Boolean field: Buffer MB0 Interrupt Or "reserved"
  7909. static const uint32_t CAN_IFLAG1_BUF0I = 1U << 0 ;
  7910. // Boolean field: Buffer MB6 Interrupt Or "Rx FIFO Warning"
  7911. static const uint32_t CAN_IFLAG1_BUF6I = 1U << 6 ;
  7912. // Boolean field: Buffer MB7 Interrupt Or "Rx FIFO Overflow"
  7913. static const uint32_t CAN_IFLAG1_BUF7I = 1U << 7 ;
  7914. // Boolean field: Buffer MB5 Interrupt Or "Frames available in Rx FIFO"
  7915. static const uint32_t CAN_IFLAG1_BUF5I = 1U << 5 ;
  7916. //-------------------- Message Buffer 8 WORD0 Register
  7917. #define CAN_WORD08(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x108)))
  7918. #define CAN0_WORD08 (* ((volatile uint32_t *) (0x40024000 + 0x108)))
  7919. #define CAN1_WORD08 (* ((volatile uint32_t *) (0x400A4000 + 0x108)))
  7920. // Field (width: 8 bits): Data byte 3 of Rx/Tx frame.
  7921. inline uint32_t CAN_WORD08_DATA_BYTE_3 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7922. // Field (width: 8 bits): Data byte 2 of Rx/Tx frame.
  7923. inline uint32_t CAN_WORD08_DATA_BYTE_2 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7924. // Field (width: 8 bits): Data byte 1 of Rx/Tx frame.
  7925. inline uint32_t CAN_WORD08_DATA_BYTE_1 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  7926. // Field (width: 8 bits): Data byte 0 of Rx/Tx frame.
  7927. inline uint32_t CAN_WORD08_DATA_BYTE_0 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  7928. //-------------------- Message Buffer 9 WORD0 Register
  7929. #define CAN_WORD09(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x118)))
  7930. #define CAN0_WORD09 (* ((volatile uint32_t *) (0x40024000 + 0x118)))
  7931. #define CAN1_WORD09 (* ((volatile uint32_t *) (0x400A4000 + 0x118)))
  7932. // Field (width: 8 bits): Data byte 3 of Rx/Tx frame.
  7933. inline uint32_t CAN_WORD09_DATA_BYTE_3 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  7934. // Field (width: 8 bits): Data byte 2 of Rx/Tx frame.
  7935. inline uint32_t CAN_WORD09_DATA_BYTE_2 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  7936. // Field (width: 8 bits): Data byte 1 of Rx/Tx frame.
  7937. inline uint32_t CAN_WORD09_DATA_BYTE_1 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  7938. // Field (width: 8 bits): Data byte 0 of Rx/Tx frame.
  7939. inline uint32_t CAN_WORD09_DATA_BYTE_0 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  7940. //-------------------- CRC Register
  7941. #define CAN_CRCR(group) (* ((const volatile uint32_t *) (kBaseAddress_CAN [group] + 0x44)))
  7942. #define CAN0_CRCR (* ((const volatile uint32_t *) (0x40024000 + 0x44)))
  7943. #define CAN1_CRCR (* ((const volatile uint32_t *) (0x400A4000 + 0x44)))
  7944. // Field (width: 15 bits): CRC Transmitted
  7945. inline uint32_t CAN_CRCR_TXCRC (const uint32_t inValue) { return (inValue & 32767U) << 0 ; }
  7946. // Field (width: 7 bits): CRC Mailbox
  7947. inline uint32_t CAN_CRCR_MBCRC (const uint32_t inValue) { return (inValue & 127U) << 16 ; }
  7948. //-------------------- Error and Status 2 register
  7949. #define CAN_ESR2(group) (* ((const volatile uint32_t *) (kBaseAddress_CAN [group] + 0x38)))
  7950. #define CAN0_ESR2 (* ((const volatile uint32_t *) (0x40024000 + 0x38)))
  7951. #define CAN1_ESR2 (* ((const volatile uint32_t *) (0x400A4000 + 0x38)))
  7952. // Field (width: 7 bits): Lowest Priority Tx Mailbox
  7953. inline uint32_t CAN_ESR2_LPTM (const uint32_t inValue) { return (inValue & 127U) << 16 ; }
  7954. // Boolean field: Inactive Mailbox
  7955. static const uint32_t CAN_ESR2_IMB = 1U << 13 ;
  7956. // Boolean field: Valid Priority Status
  7957. static const uint32_t CAN_ESR2_VPS = 1U << 14 ;
  7958. //-------------------- Message Buffer 8 ID Register
  7959. #define CAN_ID8(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x104)))
  7960. #define CAN0_ID8 (* ((volatile uint32_t *) (0x40024000 + 0x104)))
  7961. #define CAN1_ID8 (* ((volatile uint32_t *) (0x400A4000 + 0x104)))
  7962. // Field (width: 11 bits): Contains standard/extended (HIGH word) identifier of message buffer.
  7963. inline uint32_t CAN_ID8_STD (const uint32_t inValue) { return (inValue & 2047U) << 18 ; }
  7964. // Field (width: 18 bits): Contains extended (LOW word) identifier of message buffer.
  7965. inline uint32_t CAN_ID8_EXT (const uint32_t inValue) { return (inValue & 262143U) << 0 ; }
  7966. // Field (width: 3 bits): Local priority. This 3-bit fieldis only used when LPRIO_EN bit is set in MCR and it only makes sense for Tx buffers. These bits are not transmitted. They are appended to the regular ID to define the transmission priority.
  7967. inline uint32_t CAN_ID8_PRIO (const uint32_t inValue) { return (inValue & 7U) << 29 ; }
  7968. //-------------------- Error and Status 1 register
  7969. #define CAN_ESR1(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x20)))
  7970. #define CAN0_ESR1 (* ((volatile uint32_t *) (0x40024000 + 0x20)))
  7971. #define CAN1_ESR1 (* ((volatile uint32_t *) (0x400A4000 + 0x20)))
  7972. // Boolean field: TX Error Warning
  7973. static const uint32_t CAN_ESR1_TXWRN = 1U << 9 ;
  7974. // Boolean field: Rx Error Warning
  7975. static const uint32_t CAN_ESR1_RXWRN = 1U << 8 ;
  7976. // Boolean field: Error Interrupt
  7977. static const uint32_t CAN_ESR1_ERRINT = 1U << 1 ;
  7978. // Boolean field: FlexCAN In Transmission
  7979. static const uint32_t CAN_ESR1_TX = 1U << 6 ;
  7980. // Boolean field: Form Error
  7981. static const uint32_t CAN_ESR1_FRMERR = 1U << 11 ;
  7982. // Boolean field: Bit1 Error
  7983. static const uint32_t CAN_ESR1_BIT1ERR = 1U << 15 ;
  7984. // Boolean field: FlexCAN In Reception
  7985. static const uint32_t CAN_ESR1_RX = 1U << 3 ;
  7986. // Boolean field: Tx Warning Interrupt Flag
  7987. static const uint32_t CAN_ESR1_TWRNINT = 1U << 17 ;
  7988. // Boolean field: Acknowledge Error
  7989. static const uint32_t CAN_ESR1_ACKERR = 1U << 13 ;
  7990. // Boolean field: Rx Warning Interrupt Flag
  7991. static const uint32_t CAN_ESR1_RWRNINT = 1U << 16 ;
  7992. // Boolean field: This bit indicates when CAN bus is in IDLE state
  7993. static const uint32_t CAN_ESR1_IDLE = 1U << 7 ;
  7994. // Boolean field: Bus Off Interrupt
  7995. static const uint32_t CAN_ESR1_BOFFINT = 1U << 2 ;
  7996. // Boolean field: Stuffing Error
  7997. static const uint32_t CAN_ESR1_STFERR = 1U << 10 ;
  7998. // Boolean field: Cyclic Redundancy Check Error
  7999. static const uint32_t CAN_ESR1_CRCERR = 1U << 12 ;
  8000. // Boolean field: CAN Synchronization Status
  8001. static const uint32_t CAN_ESR1_SYNCH = 1U << 18 ;
  8002. // Field (width: 2 bits): Fault Confinement State
  8003. inline uint32_t CAN_ESR1_FLTCONF (const uint32_t inValue) { return (inValue & 3U) << 4 ; }
  8004. // Boolean field: Wake-Up Interrupt
  8005. static const uint32_t CAN_ESR1_WAKINT = 1U << 0 ;
  8006. // Boolean field: Bit0 Error
  8007. static const uint32_t CAN_ESR1_BIT0ERR = 1U << 14 ;
  8008. //-------------------- Message Buffer 6 ID Register
  8009. #define CAN_ID6(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0xE4)))
  8010. #define CAN0_ID6 (* ((volatile uint32_t *) (0x40024000 + 0xE4)))
  8011. #define CAN1_ID6 (* ((volatile uint32_t *) (0x400A4000 + 0xE4)))
  8012. // Field (width: 11 bits): Contains standard/extended (HIGH word) identifier of message buffer.
  8013. inline uint32_t CAN_ID6_STD (const uint32_t inValue) { return (inValue & 2047U) << 18 ; }
  8014. // Field (width: 18 bits): Contains extended (LOW word) identifier of message buffer.
  8015. inline uint32_t CAN_ID6_EXT (const uint32_t inValue) { return (inValue & 262143U) << 0 ; }
  8016. // Field (width: 3 bits): Local priority. This 3-bit fieldis only used when LPRIO_EN bit is set in MCR and it only makes sense for Tx buffers. These bits are not transmitted. They are appended to the regular ID to define the transmission priority.
  8017. inline uint32_t CAN_ID6_PRIO (const uint32_t inValue) { return (inValue & 7U) << 29 ; }
  8018. //-------------------- Message Buffer 7 ID Register
  8019. #define CAN_ID7(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0xF4)))
  8020. #define CAN0_ID7 (* ((volatile uint32_t *) (0x40024000 + 0xF4)))
  8021. #define CAN1_ID7 (* ((volatile uint32_t *) (0x400A4000 + 0xF4)))
  8022. // Field (width: 11 bits): Contains standard/extended (HIGH word) identifier of message buffer.
  8023. inline uint32_t CAN_ID7_STD (const uint32_t inValue) { return (inValue & 2047U) << 18 ; }
  8024. // Field (width: 18 bits): Contains extended (LOW word) identifier of message buffer.
  8025. inline uint32_t CAN_ID7_EXT (const uint32_t inValue) { return (inValue & 262143U) << 0 ; }
  8026. // Field (width: 3 bits): Local priority. This 3-bit fieldis only used when LPRIO_EN bit is set in MCR and it only makes sense for Tx buffers. These bits are not transmitted. They are appended to the regular ID to define the transmission priority.
  8027. inline uint32_t CAN_ID7_PRIO (const uint32_t inValue) { return (inValue & 7U) << 29 ; }
  8028. //-------------------- Message Buffer 4 ID Register
  8029. #define CAN_ID4(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0xC4)))
  8030. #define CAN0_ID4 (* ((volatile uint32_t *) (0x40024000 + 0xC4)))
  8031. #define CAN1_ID4 (* ((volatile uint32_t *) (0x400A4000 + 0xC4)))
  8032. // Field (width: 11 bits): Contains standard/extended (HIGH word) identifier of message buffer.
  8033. inline uint32_t CAN_ID4_STD (const uint32_t inValue) { return (inValue & 2047U) << 18 ; }
  8034. // Field (width: 18 bits): Contains extended (LOW word) identifier of message buffer.
  8035. inline uint32_t CAN_ID4_EXT (const uint32_t inValue) { return (inValue & 262143U) << 0 ; }
  8036. // Field (width: 3 bits): Local priority. This 3-bit fieldis only used when LPRIO_EN bit is set in MCR and it only makes sense for Tx buffers. These bits are not transmitted. They are appended to the regular ID to define the transmission priority.
  8037. inline uint32_t CAN_ID4_PRIO (const uint32_t inValue) { return (inValue & 7U) << 29 ; }
  8038. //-------------------- Message Buffer 5 CS Register
  8039. #define CAN_CS5(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0xD0)))
  8040. #define CAN0_CS5 (* ((volatile uint32_t *) (0x40024000 + 0xD0)))
  8041. #define CAN1_CS5 (* ((volatile uint32_t *) (0x400A4000 + 0xD0)))
  8042. // Field (width: 4 bits): Length of the data to be stored/transmitted.
  8043. inline uint32_t CAN_CS5_DLC (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  8044. // Field (width: 4 bits): Reserved
  8045. inline uint32_t CAN_CS5_CODE (const uint32_t inValue) { return (inValue & 15U) << 24 ; }
  8046. // Boolean field: Substitute Remote Request. Contains a fixed recessive bit.
  8047. static const uint32_t CAN_CS5_SRR = 1U << 22 ;
  8048. // Boolean field: Remote Transmission Request. One/zero for remote/data frame.
  8049. static const uint32_t CAN_CS5_RTR = 1U << 20 ;
  8050. // Field (width: 16 bits): Free-Running Counter Time stamp. This 16-bit field is a copy of the Free-Running Timer, captured for Tx and Rx frames at the time when the beginning of the Identifier field appears on the CAN bus.
  8051. inline uint32_t CAN_CS5_TIME_STAMP (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  8052. // Boolean field: ID Extended. One/zero for extended/standard format frame.
  8053. static const uint32_t CAN_CS5_IDE = 1U << 21 ;
  8054. //-------------------- Message Buffer 2 ID Register
  8055. #define CAN_ID2(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0xA4)))
  8056. #define CAN0_ID2 (* ((volatile uint32_t *) (0x40024000 + 0xA4)))
  8057. #define CAN1_ID2 (* ((volatile uint32_t *) (0x400A4000 + 0xA4)))
  8058. // Field (width: 11 bits): Contains standard/extended (HIGH word) identifier of message buffer.
  8059. inline uint32_t CAN_ID2_STD (const uint32_t inValue) { return (inValue & 2047U) << 18 ; }
  8060. // Field (width: 18 bits): Contains extended (LOW word) identifier of message buffer.
  8061. inline uint32_t CAN_ID2_EXT (const uint32_t inValue) { return (inValue & 262143U) << 0 ; }
  8062. // Field (width: 3 bits): Local priority. This 3-bit fieldis only used when LPRIO_EN bit is set in MCR and it only makes sense for Tx buffers. These bits are not transmitted. They are appended to the regular ID to define the transmission priority.
  8063. inline uint32_t CAN_ID2_PRIO (const uint32_t inValue) { return (inValue & 7U) << 29 ; }
  8064. //-------------------- Message Buffer 3 ID Register
  8065. #define CAN_ID3(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0xB4)))
  8066. #define CAN0_ID3 (* ((volatile uint32_t *) (0x40024000 + 0xB4)))
  8067. #define CAN1_ID3 (* ((volatile uint32_t *) (0x400A4000 + 0xB4)))
  8068. // Field (width: 11 bits): Contains standard/extended (HIGH word) identifier of message buffer.
  8069. inline uint32_t CAN_ID3_STD (const uint32_t inValue) { return (inValue & 2047U) << 18 ; }
  8070. // Field (width: 18 bits): Contains extended (LOW word) identifier of message buffer.
  8071. inline uint32_t CAN_ID3_EXT (const uint32_t inValue) { return (inValue & 262143U) << 0 ; }
  8072. // Field (width: 3 bits): Local priority. This 3-bit fieldis only used when LPRIO_EN bit is set in MCR and it only makes sense for Tx buffers. These bits are not transmitted. They are appended to the regular ID to define the transmission priority.
  8073. inline uint32_t CAN_ID3_PRIO (const uint32_t inValue) { return (inValue & 7U) << 29 ; }
  8074. //-------------------- Message Buffer 0 ID Register
  8075. #define CAN_ID0(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x84)))
  8076. #define CAN0_ID0 (* ((volatile uint32_t *) (0x40024000 + 0x84)))
  8077. #define CAN1_ID0 (* ((volatile uint32_t *) (0x400A4000 + 0x84)))
  8078. // Field (width: 11 bits): Contains standard/extended (HIGH word) identifier of message buffer.
  8079. inline uint32_t CAN_ID0_STD (const uint32_t inValue) { return (inValue & 2047U) << 18 ; }
  8080. // Field (width: 18 bits): Contains extended (LOW word) identifier of message buffer.
  8081. inline uint32_t CAN_ID0_EXT (const uint32_t inValue) { return (inValue & 262143U) << 0 ; }
  8082. // Field (width: 3 bits): Local priority. This 3-bit fieldis only used when LPRIO_EN bit is set in MCR and it only makes sense for Tx buffers. These bits are not transmitted. They are appended to the regular ID to define the transmission priority.
  8083. inline uint32_t CAN_ID0_PRIO (const uint32_t inValue) { return (inValue & 7U) << 29 ; }
  8084. //-------------------- Message Buffer 1 ID Register
  8085. #define CAN_ID1(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x94)))
  8086. #define CAN0_ID1 (* ((volatile uint32_t *) (0x40024000 + 0x94)))
  8087. #define CAN1_ID1 (* ((volatile uint32_t *) (0x400A4000 + 0x94)))
  8088. // Field (width: 11 bits): Contains standard/extended (HIGH word) identifier of message buffer.
  8089. inline uint32_t CAN_ID1_STD (const uint32_t inValue) { return (inValue & 2047U) << 18 ; }
  8090. // Field (width: 18 bits): Contains extended (LOW word) identifier of message buffer.
  8091. inline uint32_t CAN_ID1_EXT (const uint32_t inValue) { return (inValue & 262143U) << 0 ; }
  8092. // Field (width: 3 bits): Local priority. This 3-bit fieldis only used when LPRIO_EN bit is set in MCR and it only makes sense for Tx buffers. These bits are not transmitted. They are appended to the regular ID to define the transmission priority.
  8093. inline uint32_t CAN_ID1_PRIO (const uint32_t inValue) { return (inValue & 7U) << 29 ; }
  8094. //-------------------- Message Buffer 10 ID Register
  8095. #define CAN_ID10(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x124)))
  8096. #define CAN0_ID10 (* ((volatile uint32_t *) (0x40024000 + 0x124)))
  8097. #define CAN1_ID10 (* ((volatile uint32_t *) (0x400A4000 + 0x124)))
  8098. // Field (width: 11 bits): Contains standard/extended (HIGH word) identifier of message buffer.
  8099. inline uint32_t CAN_ID10_STD (const uint32_t inValue) { return (inValue & 2047U) << 18 ; }
  8100. // Field (width: 18 bits): Contains extended (LOW word) identifier of message buffer.
  8101. inline uint32_t CAN_ID10_EXT (const uint32_t inValue) { return (inValue & 262143U) << 0 ; }
  8102. // Field (width: 3 bits): Local priority. This 3-bit fieldis only used when LPRIO_EN bit is set in MCR and it only makes sense for Tx buffers. These bits are not transmitted. They are appended to the regular ID to define the transmission priority.
  8103. inline uint32_t CAN_ID10_PRIO (const uint32_t inValue) { return (inValue & 7U) << 29 ; }
  8104. //-------------------- Message Buffer 11 ID Register
  8105. #define CAN_ID11(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x134)))
  8106. #define CAN0_ID11 (* ((volatile uint32_t *) (0x40024000 + 0x134)))
  8107. #define CAN1_ID11 (* ((volatile uint32_t *) (0x400A4000 + 0x134)))
  8108. // Field (width: 11 bits): Contains standard/extended (HIGH word) identifier of message buffer.
  8109. inline uint32_t CAN_ID11_STD (const uint32_t inValue) { return (inValue & 2047U) << 18 ; }
  8110. // Field (width: 18 bits): Contains extended (LOW word) identifier of message buffer.
  8111. inline uint32_t CAN_ID11_EXT (const uint32_t inValue) { return (inValue & 262143U) << 0 ; }
  8112. // Field (width: 3 bits): Local priority. This 3-bit fieldis only used when LPRIO_EN bit is set in MCR and it only makes sense for Tx buffers. These bits are not transmitted. They are appended to the regular ID to define the transmission priority.
  8113. inline uint32_t CAN_ID11_PRIO (const uint32_t inValue) { return (inValue & 7U) << 29 ; }
  8114. //-------------------- Message Buffer 12 ID Register
  8115. #define CAN_ID12(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x144)))
  8116. #define CAN0_ID12 (* ((volatile uint32_t *) (0x40024000 + 0x144)))
  8117. #define CAN1_ID12 (* ((volatile uint32_t *) (0x400A4000 + 0x144)))
  8118. // Field (width: 11 bits): Contains standard/extended (HIGH word) identifier of message buffer.
  8119. inline uint32_t CAN_ID12_STD (const uint32_t inValue) { return (inValue & 2047U) << 18 ; }
  8120. // Field (width: 18 bits): Contains extended (LOW word) identifier of message buffer.
  8121. inline uint32_t CAN_ID12_EXT (const uint32_t inValue) { return (inValue & 262143U) << 0 ; }
  8122. // Field (width: 3 bits): Local priority. This 3-bit fieldis only used when LPRIO_EN bit is set in MCR and it only makes sense for Tx buffers. These bits are not transmitted. They are appended to the regular ID to define the transmission priority.
  8123. inline uint32_t CAN_ID12_PRIO (const uint32_t inValue) { return (inValue & 7U) << 29 ; }
  8124. //-------------------- Message Buffer 13 ID Register
  8125. #define CAN_ID13(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x154)))
  8126. #define CAN0_ID13 (* ((volatile uint32_t *) (0x40024000 + 0x154)))
  8127. #define CAN1_ID13 (* ((volatile uint32_t *) (0x400A4000 + 0x154)))
  8128. // Field (width: 11 bits): Contains standard/extended (HIGH word) identifier of message buffer.
  8129. inline uint32_t CAN_ID13_STD (const uint32_t inValue) { return (inValue & 2047U) << 18 ; }
  8130. // Field (width: 18 bits): Contains extended (LOW word) identifier of message buffer.
  8131. inline uint32_t CAN_ID13_EXT (const uint32_t inValue) { return (inValue & 262143U) << 0 ; }
  8132. // Field (width: 3 bits): Local priority. This 3-bit fieldis only used when LPRIO_EN bit is set in MCR and it only makes sense for Tx buffers. These bits are not transmitted. They are appended to the regular ID to define the transmission priority.
  8133. inline uint32_t CAN_ID13_PRIO (const uint32_t inValue) { return (inValue & 7U) << 29 ; }
  8134. //-------------------- Message Buffer 14 ID Register
  8135. #define CAN_ID14(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x164)))
  8136. #define CAN0_ID14 (* ((volatile uint32_t *) (0x40024000 + 0x164)))
  8137. #define CAN1_ID14 (* ((volatile uint32_t *) (0x400A4000 + 0x164)))
  8138. // Field (width: 11 bits): Contains standard/extended (HIGH word) identifier of message buffer.
  8139. inline uint32_t CAN_ID14_STD (const uint32_t inValue) { return (inValue & 2047U) << 18 ; }
  8140. // Field (width: 18 bits): Contains extended (LOW word) identifier of message buffer.
  8141. inline uint32_t CAN_ID14_EXT (const uint32_t inValue) { return (inValue & 262143U) << 0 ; }
  8142. // Field (width: 3 bits): Local priority. This 3-bit fieldis only used when LPRIO_EN bit is set in MCR and it only makes sense for Tx buffers. These bits are not transmitted. They are appended to the regular ID to define the transmission priority.
  8143. inline uint32_t CAN_ID14_PRIO (const uint32_t inValue) { return (inValue & 7U) << 29 ; }
  8144. //-------------------- Message Buffer 15 ID Register
  8145. #define CAN_ID15(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x174)))
  8146. #define CAN0_ID15 (* ((volatile uint32_t *) (0x40024000 + 0x174)))
  8147. #define CAN1_ID15 (* ((volatile uint32_t *) (0x400A4000 + 0x174)))
  8148. // Field (width: 11 bits): Contains standard/extended (HIGH word) identifier of message buffer.
  8149. inline uint32_t CAN_ID15_STD (const uint32_t inValue) { return (inValue & 2047U) << 18 ; }
  8150. // Field (width: 18 bits): Contains extended (LOW word) identifier of message buffer.
  8151. inline uint32_t CAN_ID15_EXT (const uint32_t inValue) { return (inValue & 262143U) << 0 ; }
  8152. // Field (width: 3 bits): Local priority. This 3-bit fieldis only used when LPRIO_EN bit is set in MCR and it only makes sense for Tx buffers. These bits are not transmitted. They are appended to the regular ID to define the transmission priority.
  8153. inline uint32_t CAN_ID15_PRIO (const uint32_t inValue) { return (inValue & 7U) << 29 ; }
  8154. //-------------------- Message Buffer 15 WORD1 Register
  8155. #define CAN_WORD115(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x17C)))
  8156. #define CAN0_WORD115 (* ((volatile uint32_t *) (0x40024000 + 0x17C)))
  8157. #define CAN1_WORD115 (* ((volatile uint32_t *) (0x400A4000 + 0x17C)))
  8158. // Field (width: 8 bits): Data byte 7 of Rx/Tx frame.
  8159. inline uint32_t CAN_WORD115_DATA_BYTE_7 (const uint32_t inValue) { return (inValue & 255U) << 0 ; }
  8160. // Field (width: 8 bits): Data byte 6 of Rx/Tx frame.
  8161. inline uint32_t CAN_WORD115_DATA_BYTE_6 (const uint32_t inValue) { return (inValue & 255U) << 8 ; }
  8162. // Field (width: 8 bits): Data byte 5 of Rx/Tx frame.
  8163. inline uint32_t CAN_WORD115_DATA_BYTE_5 (const uint32_t inValue) { return (inValue & 255U) << 16 ; }
  8164. // Field (width: 8 bits): Data byte 4 of Rx/Tx frame.
  8165. inline uint32_t CAN_WORD115_DATA_BYTE_4 (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  8166. //-------------------- Message Buffer 2 CS Register
  8167. #define CAN_CS2(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0xA0)))
  8168. #define CAN0_CS2 (* ((volatile uint32_t *) (0x40024000 + 0xA0)))
  8169. #define CAN1_CS2 (* ((volatile uint32_t *) (0x400A4000 + 0xA0)))
  8170. // Field (width: 4 bits): Length of the data to be stored/transmitted.
  8171. inline uint32_t CAN_CS2_DLC (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  8172. // Field (width: 4 bits): Reserved
  8173. inline uint32_t CAN_CS2_CODE (const uint32_t inValue) { return (inValue & 15U) << 24 ; }
  8174. // Boolean field: Substitute Remote Request. Contains a fixed recessive bit.
  8175. static const uint32_t CAN_CS2_SRR = 1U << 22 ;
  8176. // Boolean field: Remote Transmission Request. One/zero for remote/data frame.
  8177. static const uint32_t CAN_CS2_RTR = 1U << 20 ;
  8178. // Field (width: 16 bits): Free-Running Counter Time stamp. This 16-bit field is a copy of the Free-Running Timer, captured for Tx and Rx frames at the time when the beginning of the Identifier field appears on the CAN bus.
  8179. inline uint32_t CAN_CS2_TIME_STAMP (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  8180. // Boolean field: ID Extended. One/zero for extended/standard format frame.
  8181. static const uint32_t CAN_CS2_IDE = 1U << 21 ;
  8182. //-------------------- Rx 15 Mask register
  8183. #define CAN_RX15MASK(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x18)))
  8184. #define CAN0_RX15MASK (* ((volatile uint32_t *) (0x40024000 + 0x18)))
  8185. #define CAN1_RX15MASK (* ((volatile uint32_t *) (0x400A4000 + 0x18)))
  8186. //-------------------- Control 1 register
  8187. #define CAN_CTRL1(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x4)))
  8188. #define CAN0_CTRL1 (* ((volatile uint32_t *) (0x40024000 + 0x4)))
  8189. #define CAN1_CTRL1 (* ((volatile uint32_t *) (0x400A4000 + 0x4)))
  8190. // Field (width: 2 bits): Resync Jump Width
  8191. inline uint32_t CAN_CTRL1_RJW (const uint32_t inValue) { return (inValue & 3U) << 22 ; }
  8192. // Boolean field: Rx Warning Interrupt Mask
  8193. static const uint32_t CAN_CTRL1_RWRNMSK = 1U << 10 ;
  8194. // Boolean field: Timer Sync
  8195. static const uint32_t CAN_CTRL1_TSYN = 1U << 5 ;
  8196. // Field (width: 3 bits): Phase Segment 1
  8197. inline uint32_t CAN_CTRL1_PSEG1 (const uint32_t inValue) { return (inValue & 7U) << 19 ; }
  8198. // Boolean field: CAN Engine Clock Source
  8199. static const uint32_t CAN_CTRL1_CLKSRC = 1U << 13 ;
  8200. // Boolean field: Bus Off Mask
  8201. static const uint32_t CAN_CTRL1_BOFFMSK = 1U << 15 ;
  8202. // Boolean field: Tx Warning Interrupt Mask
  8203. static const uint32_t CAN_CTRL1_TWRNMSK = 1U << 11 ;
  8204. // Boolean field: CAN Bit Sampling
  8205. static const uint32_t CAN_CTRL1_SMP = 1U << 7 ;
  8206. // Boolean field: Error Mask
  8207. static const uint32_t CAN_CTRL1_ERRMSK = 1U << 14 ;
  8208. // Field (width: 8 bits): Prescaler Division Factor
  8209. inline uint32_t CAN_CTRL1_PRESDIV (const uint32_t inValue) { return (inValue & 255U) << 24 ; }
  8210. // Boolean field: Bus Off Recovery
  8211. static const uint32_t CAN_CTRL1_BOFFREC = 1U << 6 ;
  8212. // Boolean field: Lowest Buffer Transmitted First
  8213. static const uint32_t CAN_CTRL1_LBUF = 1U << 4 ;
  8214. // Field (width: 3 bits): Propagation Segment
  8215. inline uint32_t CAN_CTRL1_PROPSEG (const uint32_t inValue) { return (inValue & 7U) << 0 ; }
  8216. // Boolean field: Listen-Only Mode
  8217. static const uint32_t CAN_CTRL1_LOM = 1U << 3 ;
  8218. // Boolean field: Loop Back Mode
  8219. static const uint32_t CAN_CTRL1_LPB = 1U << 12 ;
  8220. // Field (width: 3 bits): Phase Segment 2
  8221. inline uint32_t CAN_CTRL1_PSEG2 (const uint32_t inValue) { return (inValue & 7U) << 16 ; }
  8222. //-------------------- Control 2 register
  8223. #define CAN_CTRL2(group) (* ((volatile uint32_t *) (kBaseAddress_CAN [group] + 0x34)))
  8224. #define CAN0_CTRL2 (* ((volatile uint32_t *) (0x40024000 + 0x34)))
  8225. #define CAN1_CTRL2 (* ((volatile uint32_t *) (0x400A4000 + 0x34)))
  8226. // Boolean field: Write-Access To Memory In Freeze Mode
  8227. static const uint32_t CAN_CTRL2_WRMFRZ = 1U << 28 ;
  8228. // Field (width: 4 bits): Number Of Rx FIFO Filters
  8229. inline uint32_t CAN_CTRL2_RFFN (const uint32_t inValue) { return (inValue & 15U) << 24 ; }
  8230. // Field (width: 5 bits): Tx Arbitration Start Delay
  8231. inline uint32_t CAN_CTRL2_TASD (const uint32_t inValue) { return (inValue & 31U) << 19 ; }
  8232. // Boolean field: Mailboxes Reception Priority
  8233. static const uint32_t CAN_CTRL2_MRP = 1U << 18 ;
  8234. // Boolean field: Entire Frame Arbitration Field Comparison Enable For Rx Mailboxes
  8235. static const uint32_t CAN_CTRL2_EACEN = 1U << 16 ;
  8236. // Boolean field: Remote Request Storing
  8237. static const uint32_t CAN_CTRL2_RRS = 1U << 17 ;
  8238. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  8239. // Peripheral group CMP
  8240. // CMP0 at 0x40073000
  8241. // CMP1 at 0x40073008
  8242. // CMP2 at 0x40073010
  8243. // CMP3 at 0x40073018
  8244. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  8245. static const uint32_t kBaseAddress_CMP [4] = {0x40073000, 0x40073008, 0x40073010, 0x40073018} ;
  8246. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  8247. //-------------------- CMP Control Register 0
  8248. #define CMP_CR0(group) (* ((volatile uint8_t *) (kBaseAddress_CMP [group] + 0)))
  8249. #define CMP0_CR0 (* ((volatile uint8_t *) (0x40073000 + 0)))
  8250. #define CMP1_CR0 (* ((volatile uint8_t *) (0x40073008 + 0)))
  8251. #define CMP2_CR0 (* ((volatile uint8_t *) (0x40073010 + 0)))
  8252. #define CMP3_CR0 (* ((volatile uint8_t *) (0x40073018 + 0)))
  8253. // Field (width: 3 bits): Filter Sample Count
  8254. inline uint8_t CMP_CR0_FILTER_CNT (const uint8_t inValue) { return (inValue & 7U) << 4 ; }
  8255. // Field (width: 2 bits): Comparator hard block hysteresis control
  8256. inline uint8_t CMP_CR0_HYSTCTR (const uint8_t inValue) { return (inValue & 3U) << 0 ; }
  8257. //-------------------- CMP Control Register 1
  8258. #define CMP_CR1(group) (* ((volatile uint8_t *) (kBaseAddress_CMP [group] + 0x1)))
  8259. #define CMP0_CR1 (* ((volatile uint8_t *) (0x40073000 + 0x1)))
  8260. #define CMP1_CR1 (* ((volatile uint8_t *) (0x40073008 + 0x1)))
  8261. #define CMP2_CR1 (* ((volatile uint8_t *) (0x40073010 + 0x1)))
  8262. #define CMP3_CR1 (* ((volatile uint8_t *) (0x40073018 + 0x1)))
  8263. // Boolean field: Comparator Output Select
  8264. static const uint8_t CMP_CR1_COS = 1U << 2 ;
  8265. // Boolean field: Comparator Module Enable
  8266. static const uint8_t CMP_CR1_EN = 1U << 0 ;
  8267. // Boolean field: Power Mode Select
  8268. static const uint8_t CMP_CR1_PMODE = 1U << 4 ;
  8269. // Boolean field: Comparator INVERT
  8270. static const uint8_t CMP_CR1_INV = 1U << 3 ;
  8271. // Boolean field: Trigger Mode Enable
  8272. static const uint8_t CMP_CR1_TRIGM = 1U << 5 ;
  8273. // Boolean field: Comparator Output Pin Enable
  8274. static const uint8_t CMP_CR1_OPE = 1U << 1 ;
  8275. // Boolean field: Sample Enable
  8276. static const uint8_t CMP_CR1_SE = 1U << 7 ;
  8277. // Boolean field: Windowing Enable
  8278. static const uint8_t CMP_CR1_WE = 1U << 6 ;
  8279. //-------------------- MUX Control Register
  8280. #define CMP_MUXCR(group) (* ((volatile uint8_t *) (kBaseAddress_CMP [group] + 0x5)))
  8281. #define CMP0_MUXCR (* ((volatile uint8_t *) (0x40073000 + 0x5)))
  8282. #define CMP1_MUXCR (* ((volatile uint8_t *) (0x40073008 + 0x5)))
  8283. #define CMP2_MUXCR (* ((volatile uint8_t *) (0x40073010 + 0x5)))
  8284. #define CMP3_MUXCR (* ((volatile uint8_t *) (0x40073018 + 0x5)))
  8285. // Field (width: 3 bits): Minus Input Mux Control
  8286. inline uint8_t CMP_MUXCR_MSEL (const uint8_t inValue) { return (inValue & 7U) << 0 ; }
  8287. // Field (width: 3 bits): Plus Input Mux Control
  8288. inline uint8_t CMP_MUXCR_PSEL (const uint8_t inValue) { return (inValue & 7U) << 3 ; }
  8289. // Boolean field: Pass Through Mode Enable
  8290. static const uint8_t CMP_MUXCR_PSTM = 1U << 7 ;
  8291. //-------------------- CMP Filter Period Register
  8292. #define CMP_FPR(group) (* ((volatile uint8_t *) (kBaseAddress_CMP [group] + 0x2)))
  8293. #define CMP0_FPR (* ((volatile uint8_t *) (0x40073000 + 0x2)))
  8294. #define CMP1_FPR (* ((volatile uint8_t *) (0x40073008 + 0x2)))
  8295. #define CMP2_FPR (* ((volatile uint8_t *) (0x40073010 + 0x2)))
  8296. #define CMP3_FPR (* ((volatile uint8_t *) (0x40073018 + 0x2)))
  8297. //-------------------- DAC Control Register
  8298. #define CMP_DACCR(group) (* ((volatile uint8_t *) (kBaseAddress_CMP [group] + 0x4)))
  8299. #define CMP0_DACCR (* ((volatile uint8_t *) (0x40073000 + 0x4)))
  8300. #define CMP1_DACCR (* ((volatile uint8_t *) (0x40073008 + 0x4)))
  8301. #define CMP2_DACCR (* ((volatile uint8_t *) (0x40073010 + 0x4)))
  8302. #define CMP3_DACCR (* ((volatile uint8_t *) (0x40073018 + 0x4)))
  8303. // Boolean field: DAC Enable
  8304. static const uint8_t CMP_DACCR_DACEN = 1U << 7 ;
  8305. // Field (width: 6 bits): DAC Output Voltage Select
  8306. inline uint8_t CMP_DACCR_VOSEL (const uint8_t inValue) { return (inValue & 63U) << 0 ; }
  8307. // Boolean field: Supply Voltage Reference Source Select
  8308. static const uint8_t CMP_DACCR_VRSEL = 1U << 6 ;
  8309. //-------------------- CMP Status and Control Register
  8310. #define CMP_SCR(group) (* ((volatile uint8_t *) (kBaseAddress_CMP [group] + 0x3)))
  8311. #define CMP0_SCR (* ((volatile uint8_t *) (0x40073000 + 0x3)))
  8312. #define CMP1_SCR (* ((volatile uint8_t *) (0x40073008 + 0x3)))
  8313. #define CMP2_SCR (* ((volatile uint8_t *) (0x40073010 + 0x3)))
  8314. #define CMP3_SCR (* ((volatile uint8_t *) (0x40073018 + 0x3)))
  8315. // Boolean field: DMA Enable Control
  8316. static const uint8_t CMP_SCR_DMAEN = 1U << 6 ;
  8317. // Boolean field: Analog Comparator Output
  8318. static const uint8_t CMP_SCR_COUT = 1U << 0 ;
  8319. // Boolean field: Analog Comparator Flag Falling
  8320. static const uint8_t CMP_SCR_CFF = 1U << 1 ;
  8321. // Boolean field: Comparator Interrupt Enable Rising
  8322. static const uint8_t CMP_SCR_IER = 1U << 4 ;
  8323. // Boolean field: Analog Comparator Flag Rising
  8324. static const uint8_t CMP_SCR_CFR = 1U << 2 ;
  8325. // Boolean field: Comparator Interrupt Enable Falling
  8326. static const uint8_t CMP_SCR_IEF = 1U << 3 ;
  8327. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  8328. // Peripheral group DAC
  8329. // DAC0 at 0x400CC000
  8330. // DAC1 at 0x400CD000
  8331. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  8332. static const uint32_t kBaseAddress_DAC [2] = {0x400CC000, 0x400CD000} ;
  8333. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  8334. //-------------------- DAC Data High Register (idx = 0 ... 15)
  8335. #define DAC_DATH(group,idx) (* ((volatile uint8_t *) (kBaseAddress_DAC [group] + 0x1 + 0x2 * (idx))))
  8336. #define DAC0_DATH(idx) (* ((volatile uint8_t *) (0x400CC000 + 0x1 + 0x2 * (idx))))
  8337. #define DAC1_DATH(idx) (* ((volatile uint8_t *) (0x400CD000 + 0x1 + 0x2 * (idx))))
  8338. // Field (width: 4 bits): DATA1
  8339. inline uint8_t DAC_DATH_DATA1 (const uint8_t inValue) { return (inValue & 15U) << 0 ; }
  8340. //-------------------- DAC Status Register
  8341. #define DAC_SR(group) (* ((volatile uint8_t *) (kBaseAddress_DAC [group] + 0x20)))
  8342. #define DAC0_SR (* ((volatile uint8_t *) (0x400CC000 + 0x20)))
  8343. #define DAC1_SR (* ((volatile uint8_t *) (0x400CD000 + 0x20)))
  8344. // Boolean field: DAC Buffer Read Pointer Top Position Flag
  8345. static const uint8_t DAC_SR_DACBFRPTF = 1U << 1 ;
  8346. // Boolean field: DAC Buffer Watermark Flag
  8347. static const uint8_t DAC_SR_DACBFWMF = 1U << 2 ;
  8348. // Boolean field: DAC Buffer Read Pointer Bottom Position Flag
  8349. static const uint8_t DAC_SR_DACBFRPBF = 1U << 0 ;
  8350. //-------------------- DAC Control Register 2
  8351. #define DAC_C2(group) (* ((volatile uint8_t *) (kBaseAddress_DAC [group] + 0x23)))
  8352. #define DAC0_C2 (* ((volatile uint8_t *) (0x400CC000 + 0x23)))
  8353. #define DAC1_C2 (* ((volatile uint8_t *) (0x400CD000 + 0x23)))
  8354. // Field (width: 4 bits): DAC Buffer Upper Limit
  8355. inline uint8_t DAC_C2_DACBFUP (const uint8_t inValue) { return (inValue & 15U) << 0 ; }
  8356. // Field (width: 4 bits): DAC Buffer Read Pointer
  8357. inline uint8_t DAC_C2_DACBFRP (const uint8_t inValue) { return (inValue & 15U) << 4 ; }
  8358. //-------------------- DAC Control Register 1
  8359. #define DAC_C1(group) (* ((volatile uint8_t *) (kBaseAddress_DAC [group] + 0x22)))
  8360. #define DAC0_C1 (* ((volatile uint8_t *) (0x400CC000 + 0x22)))
  8361. #define DAC1_C1 (* ((volatile uint8_t *) (0x400CD000 + 0x22)))
  8362. // Field (width: 2 bits): DAC Buffer Work Mode Select
  8363. inline uint8_t DAC_C1_DACBFMD (const uint8_t inValue) { return (inValue & 3U) << 1 ; }
  8364. // Boolean field: DAC Buffer Enable
  8365. static const uint8_t DAC_C1_DACBFEN = 1U << 0 ;
  8366. // Field (width: 2 bits): DAC Buffer Watermark Select
  8367. inline uint8_t DAC_C1_DACBFWM (const uint8_t inValue) { return (inValue & 3U) << 3 ; }
  8368. // Boolean field: DMA Enable Select
  8369. static const uint8_t DAC_C1_DMAEN = 1U << 7 ;
  8370. //-------------------- DAC Control Register
  8371. #define DAC_C0(group) (* ((volatile uint8_t *) (kBaseAddress_DAC [group] + 0x21)))
  8372. #define DAC0_C0 (* ((volatile uint8_t *) (0x400CC000 + 0x21)))
  8373. #define DAC1_C0 (* ((volatile uint8_t *) (0x400CD000 + 0x21)))
  8374. // Boolean field: DAC Low Power Control
  8375. static const uint8_t DAC_C0_LPEN = 1U << 3 ;
  8376. // Boolean field: DAC Buffer Read Pointer Bottom Flag Interrupt Enable
  8377. static const uint8_t DAC_C0_DACBBIEN = 1U << 0 ;
  8378. // Boolean field: DAC Reference Select
  8379. static const uint8_t DAC_C0_DACRFS = 1U << 6 ;
  8380. // Boolean field: DAC Software Trigger
  8381. static const uint8_t DAC_C0_DACSWTRG = 1U << 4 ;
  8382. // Boolean field: DAC Trigger Select
  8383. static const uint8_t DAC_C0_DACTRGSEL = 1U << 5 ;
  8384. // Boolean field: DAC Enable
  8385. static const uint8_t DAC_C0_DACEN = 1U << 7 ;
  8386. // Boolean field: DAC Buffer Read Pointer Top Flag Interrupt Enable
  8387. static const uint8_t DAC_C0_DACBTIEN = 1U << 1 ;
  8388. // Boolean field: DAC Buffer Watermark Interrupt Enable
  8389. static const uint8_t DAC_C0_DACBWIEN = 1U << 2 ;
  8390. //-------------------- DAC Data Low Register (idx = 0 ... 15)
  8391. #define DAC_DATL(group,idx) (* ((volatile uint8_t *) (kBaseAddress_DAC [group] + 0 + 0x2 * (idx))))
  8392. #define DAC0_DATL(idx) (* ((volatile uint8_t *) (0x400CC000 + 0 + 0x2 * (idx))))
  8393. #define DAC1_DATL(idx) (* ((volatile uint8_t *) (0x400CD000 + 0 + 0x2 * (idx))))
  8394. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  8395. // Peripheral group FTM
  8396. // FTM0 at 0x40038000
  8397. // FTM1 at 0x40039000
  8398. // FTM2 at 0x4003A000
  8399. // FTM3 at 0x400B9000
  8400. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  8401. static const uint32_t kBaseAddress_FTM [4] = {0x40038000, 0x40039000, 0x4003A000, 0x400B9000} ;
  8402. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  8403. //-------------------- Synchronization
  8404. #define FTM_SYNC(group) (* ((volatile uint32_t *) (kBaseAddress_FTM [group] + 0x58)))
  8405. #define FTM0_SYNC (* ((volatile uint32_t *) (0x40038000 + 0x58)))
  8406. #define FTM1_SYNC (* ((volatile uint32_t *) (0x40039000 + 0x58)))
  8407. #define FTM2_SYNC (* ((volatile uint32_t *) (0x4003A000 + 0x58)))
  8408. #define FTM3_SYNC (* ((volatile uint32_t *) (0x400B9000 + 0x58)))
  8409. // Boolean field: Minimum Loading Point Enable
  8410. static const uint32_t FTM_SYNC_CNTMIN = 1U << 0 ;
  8411. // Boolean field: Output Mask Synchronization
  8412. static const uint32_t FTM_SYNC_SYNCHOM = 1U << 3 ;
  8413. // Boolean field: FTM Counter Reinitialization By Synchronization (FTM counter synchronization)
  8414. static const uint32_t FTM_SYNC_REINIT = 1U << 2 ;
  8415. // Boolean field: PWM Synchronization Software Trigger
  8416. static const uint32_t FTM_SYNC_SWSYNC = 1U << 7 ;
  8417. // Boolean field: Maximum Loading Point Enable
  8418. static const uint32_t FTM_SYNC_CNTMAX = 1U << 1 ;
  8419. // Boolean field: PWM Synchronization Hardware Trigger 2
  8420. static const uint32_t FTM_SYNC_TRIG2 = 1U << 6 ;
  8421. // Boolean field: PWM Synchronization Hardware Trigger 1
  8422. static const uint32_t FTM_SYNC_TRIG1 = 1U << 5 ;
  8423. // Boolean field: PWM Synchronization Hardware Trigger 0
  8424. static const uint32_t FTM_SYNC_TRIG0 = 1U << 4 ;
  8425. //-------------------- Function For Linked Channels
  8426. #define FTM_COMBINE(group) (* ((volatile uint32_t *) (kBaseAddress_FTM [group] + 0x64)))
  8427. #define FTM0_COMBINE (* ((volatile uint32_t *) (0x40038000 + 0x64)))
  8428. #define FTM1_COMBINE (* ((volatile uint32_t *) (0x40039000 + 0x64)))
  8429. #define FTM2_COMBINE (* ((volatile uint32_t *) (0x4003A000 + 0x64)))
  8430. #define FTM3_COMBINE (* ((volatile uint32_t *) (0x400B9000 + 0x64)))
  8431. // Boolean field: Synchronization Enable For n = 6
  8432. static const uint32_t FTM_COMBINE_SYNCEN3 = 1U << 29 ;
  8433. // Boolean field: Synchronization Enable For n = 4
  8434. static const uint32_t FTM_COMBINE_SYNCEN2 = 1U << 21 ;
  8435. // Boolean field: Synchronization Enable For n = 2
  8436. static const uint32_t FTM_COMBINE_SYNCEN1 = 1U << 13 ;
  8437. // Boolean field: Synchronization Enable For n = 0
  8438. static const uint32_t FTM_COMBINE_SYNCEN0 = 1U << 5 ;
  8439. // Boolean field: Deadtime Enable For n = 4
  8440. static const uint32_t FTM_COMBINE_DTEN2 = 1U << 20 ;
  8441. // Boolean field: Deadtime Enable For n = 6
  8442. static const uint32_t FTM_COMBINE_DTEN3 = 1U << 28 ;
  8443. // Boolean field: Deadtime Enable For n = 0
  8444. static const uint32_t FTM_COMBINE_DTEN0 = 1U << 4 ;
  8445. // Boolean field: Deadtime Enable For n = 2
  8446. static const uint32_t FTM_COMBINE_DTEN1 = 1U << 12 ;
  8447. // Boolean field: Complement Of Channel (n) For n = 4
  8448. static const uint32_t FTM_COMBINE_COMP2 = 1U << 17 ;
  8449. // Boolean field: Complement Of Channel (n) for n = 6
  8450. static const uint32_t FTM_COMBINE_COMP3 = 1U << 25 ;
  8451. // Boolean field: Complement Of Channel (n) For n = 0
  8452. static const uint32_t FTM_COMBINE_COMP0 = 1U << 1 ;
  8453. // Boolean field: Complement Of Channel (n) For n = 2
  8454. static const uint32_t FTM_COMBINE_COMP1 = 1U << 9 ;
  8455. // Boolean field: Combine Channels For n = 2
  8456. static const uint32_t FTM_COMBINE_COMBINE1 = 1U << 8 ;
  8457. // Boolean field: Combine Channels For n = 0
  8458. static const uint32_t FTM_COMBINE_COMBINE0 = 1U << 0 ;
  8459. // Boolean field: Combine Channels For n = 6
  8460. static const uint32_t FTM_COMBINE_COMBINE3 = 1U << 24 ;
  8461. // Boolean field: Combine Channels For n = 4
  8462. static const uint32_t FTM_COMBINE_COMBINE2 = 1U << 16 ;
  8463. // Boolean field: Dual Edge Capture Mode Captures For n = 6
  8464. static const uint32_t FTM_COMBINE_DECAP3 = 1U << 27 ;
  8465. // Boolean field: Dual Edge Capture Mode Captures For n = 4
  8466. static const uint32_t FTM_COMBINE_DECAP2 = 1U << 19 ;
  8467. // Boolean field: Dual Edge Capture Mode Captures For n = 2
  8468. static const uint32_t FTM_COMBINE_DECAP1 = 1U << 11 ;
  8469. // Boolean field: Dual Edge Capture Mode Captures For n = 0
  8470. static const uint32_t FTM_COMBINE_DECAP0 = 1U << 3 ;
  8471. // Boolean field: Dual Edge Capture Mode Enable For n = 4
  8472. static const uint32_t FTM_COMBINE_DECAPEN2 = 1U << 18 ;
  8473. // Boolean field: Dual Edge Capture Mode Enable For n = 6
  8474. static const uint32_t FTM_COMBINE_DECAPEN3 = 1U << 26 ;
  8475. // Boolean field: Dual Edge Capture Mode Enable For n = 0
  8476. static const uint32_t FTM_COMBINE_DECAPEN0 = 1U << 2 ;
  8477. // Boolean field: Dual Edge Capture Mode Enable For n = 2
  8478. static const uint32_t FTM_COMBINE_DECAPEN1 = 1U << 10 ;
  8479. // Boolean field: Fault Control Enable For n = 6
  8480. static const uint32_t FTM_COMBINE_FAULTEN3 = 1U << 30 ;
  8481. // Boolean field: Fault Control Enable For n = 4
  8482. static const uint32_t FTM_COMBINE_FAULTEN2 = 1U << 22 ;
  8483. // Boolean field: Fault Control Enable For n = 2
  8484. static const uint32_t FTM_COMBINE_FAULTEN1 = 1U << 14 ;
  8485. // Boolean field: Fault Control Enable For n = 0
  8486. static const uint32_t FTM_COMBINE_FAULTEN0 = 1U << 6 ;
  8487. //-------------------- Counter Initial Value
  8488. #define FTM_CNTIN(group) (* ((volatile uint32_t *) (kBaseAddress_FTM [group] + 0x4C)))
  8489. #define FTM0_CNTIN (* ((volatile uint32_t *) (0x40038000 + 0x4C)))
  8490. #define FTM1_CNTIN (* ((volatile uint32_t *) (0x40039000 + 0x4C)))
  8491. #define FTM2_CNTIN (* ((volatile uint32_t *) (0x4003A000 + 0x4C)))
  8492. #define FTM3_CNTIN (* ((volatile uint32_t *) (0x400B9000 + 0x4C)))
  8493. // Field (width: 16 bits): Initial Value Of The FTM Counter
  8494. inline uint32_t FTM_CNTIN_INIT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  8495. //-------------------- Configuration
  8496. #define FTM_CONF(group) (* ((volatile uint32_t *) (kBaseAddress_FTM [group] + 0x84)))
  8497. #define FTM0_CONF (* ((volatile uint32_t *) (0x40038000 + 0x84)))
  8498. #define FTM1_CONF (* ((volatile uint32_t *) (0x40039000 + 0x84)))
  8499. #define FTM2_CONF (* ((volatile uint32_t *) (0x4003A000 + 0x84)))
  8500. #define FTM3_CONF (* ((volatile uint32_t *) (0x400B9000 + 0x84)))
  8501. // Boolean field: Global Time Base Output
  8502. static const uint32_t FTM_CONF_GTBEOUT = 1U << 10 ;
  8503. // Field (width: 5 bits): TOF Frequency
  8504. inline uint32_t FTM_CONF_NUMTOF (const uint32_t inValue) { return (inValue & 31U) << 0 ; }
  8505. // Field (width: 2 bits): BDM Mode
  8506. inline uint32_t FTM_CONF_BDMMODE (const uint32_t inValue) { return (inValue & 3U) << 6 ; }
  8507. // Boolean field: Global Time Base Enable
  8508. static const uint32_t FTM_CONF_GTBEEN = 1U << 9 ;
  8509. //-------------------- Synchronization Configuration
  8510. #define FTM_SYNCONF(group) (* ((volatile uint32_t *) (kBaseAddress_FTM [group] + 0x8C)))
  8511. #define FTM0_SYNCONF (* ((volatile uint32_t *) (0x40038000 + 0x8C)))
  8512. #define FTM1_SYNCONF (* ((volatile uint32_t *) (0x40039000 + 0x8C)))
  8513. #define FTM2_SYNCONF (* ((volatile uint32_t *) (0x4003A000 + 0x8C)))
  8514. #define FTM3_SYNCONF (* ((volatile uint32_t *) (0x400B9000 + 0x8C)))
  8515. // Boolean field: FTM counter synchronization is activated by the software trigger.
  8516. static const uint32_t FTM_SYNCONF_SWRSTCNT = 1U << 8 ;
  8517. // Boolean field: Synchronization Mode
  8518. static const uint32_t FTM_SYNCONF_SYNCMODE = 1U << 7 ;
  8519. // Boolean field: Output mask synchronization is activated by the software trigger.
  8520. static const uint32_t FTM_SYNCONF_SWOM = 1U << 10 ;
  8521. // Boolean field: SWOCTRL Register Synchronization
  8522. static const uint32_t FTM_SYNCONF_SWOC = 1U << 5 ;
  8523. // Boolean field: Software output control synchronization is activated by the software trigger.
  8524. static const uint32_t FTM_SYNCONF_SWSOC = 1U << 12 ;
  8525. // Boolean field: Inverting control synchronization is activated by the software trigger.
  8526. static const uint32_t FTM_SYNCONF_SWINVC = 1U << 11 ;
  8527. // Boolean field: Hardware Trigger Mode
  8528. static const uint32_t FTM_SYNCONF_HWTRIGMODE = 1U << 0 ;
  8529. // Boolean field: Output mask synchronization is activated by a hardware trigger.
  8530. static const uint32_t FTM_SYNCONF_HWOM = 1U << 18 ;
  8531. // Boolean field: FTM counter synchronization is activated by a hardware trigger.
  8532. static const uint32_t FTM_SYNCONF_HWRSTCNT = 1U << 16 ;
  8533. // Boolean field: CNTIN Register Synchronization
  8534. static const uint32_t FTM_SYNCONF_CNTINC = 1U << 2 ;
  8535. // Boolean field: MOD, CNTIN, and CV registers synchronization is activated by the software trigger.
  8536. static const uint32_t FTM_SYNCONF_SWWRBUF = 1U << 9 ;
  8537. // Boolean field: MOD, CNTIN, and CV registers synchronization is activated by a hardware trigger.
  8538. static const uint32_t FTM_SYNCONF_HWWRBUF = 1U << 17 ;
  8539. // Boolean field: INVCTRL Register Synchronization
  8540. static const uint32_t FTM_SYNCONF_INVC = 1U << 4 ;
  8541. // Boolean field: Software output control synchronization is activated by a hardware trigger.
  8542. static const uint32_t FTM_SYNCONF_HWSOC = 1U << 20 ;
  8543. // Boolean field: Inverting control synchronization is activated by a hardware trigger.
  8544. static const uint32_t FTM_SYNCONF_HWINVC = 1U << 19 ;
  8545. //-------------------- Channel (n) Status And Control (idx = 0 ... 7)
  8546. #define FTM_CSC(group,idx) (* ((volatile uint32_t *) (kBaseAddress_FTM [group] + 0xC + 0x8 * (idx))))
  8547. #define FTM0_CSC(idx) (* ((volatile uint32_t *) (0x40038000 + 0xC + 0x8 * (idx))))
  8548. #define FTM1_CSC(idx) (* ((volatile uint32_t *) (0x40039000 + 0xC + 0x8 * (idx))))
  8549. #define FTM2_CSC(idx) (* ((volatile uint32_t *) (0x4003A000 + 0xC + 0x8 * (idx))))
  8550. #define FTM3_CSC(idx) (* ((volatile uint32_t *) (0x400B9000 + 0xC + 0x8 * (idx))))
  8551. // Boolean field: DMA Enable
  8552. static const uint32_t FTM_CSC_DMA = 1U << 0 ;
  8553. // Boolean field: Channel Flag
  8554. static const uint32_t FTM_CSC_CHF = 1U << 7 ;
  8555. // Boolean field: Edge or Level Select
  8556. static const uint32_t FTM_CSC_ELSB = 1U << 3 ;
  8557. // Boolean field: Edge or Level Select
  8558. static const uint32_t FTM_CSC_ELSA = 1U << 2 ;
  8559. // Boolean field: Channel Mode Select
  8560. static const uint32_t FTM_CSC_MSB = 1U << 5 ;
  8561. // Boolean field: Channel Mode Select
  8562. static const uint32_t FTM_CSC_MSA = 1U << 4 ;
  8563. // Boolean field: Channel Interrupt Enable
  8564. static const uint32_t FTM_CSC_CHIE = 1U << 6 ;
  8565. //-------------------- Channels Polarity
  8566. #define FTM_POL(group) (* ((volatile uint32_t *) (kBaseAddress_FTM [group] + 0x70)))
  8567. #define FTM0_POL (* ((volatile uint32_t *) (0x40038000 + 0x70)))
  8568. #define FTM1_POL (* ((volatile uint32_t *) (0x40039000 + 0x70)))
  8569. #define FTM2_POL (* ((volatile uint32_t *) (0x4003A000 + 0x70)))
  8570. #define FTM3_POL (* ((volatile uint32_t *) (0x400B9000 + 0x70)))
  8571. // Boolean field: Channel 7 Polarity
  8572. static const uint32_t FTM_POL_POL7 = 1U << 7 ;
  8573. // Boolean field: Channel 6 Polarity
  8574. static const uint32_t FTM_POL_POL6 = 1U << 6 ;
  8575. // Boolean field: Channel 5 Polarity
  8576. static const uint32_t FTM_POL_POL5 = 1U << 5 ;
  8577. // Boolean field: Channel 4 Polarity
  8578. static const uint32_t FTM_POL_POL4 = 1U << 4 ;
  8579. // Boolean field: Channel 3 Polarity
  8580. static const uint32_t FTM_POL_POL3 = 1U << 3 ;
  8581. // Boolean field: Channel 2 Polarity
  8582. static const uint32_t FTM_POL_POL2 = 1U << 2 ;
  8583. // Boolean field: Channel 1 Polarity
  8584. static const uint32_t FTM_POL_POL1 = 1U << 1 ;
  8585. // Boolean field: Channel 0 Polarity
  8586. static const uint32_t FTM_POL_POL0 = 1U << 0 ;
  8587. //-------------------- Features Mode Selection
  8588. #define FTM_MODE(group) (* ((volatile uint32_t *) (kBaseAddress_FTM [group] + 0x54)))
  8589. #define FTM0_MODE (* ((volatile uint32_t *) (0x40038000 + 0x54)))
  8590. #define FTM1_MODE (* ((volatile uint32_t *) (0x40039000 + 0x54)))
  8591. #define FTM2_MODE (* ((volatile uint32_t *) (0x4003A000 + 0x54)))
  8592. #define FTM3_MODE (* ((volatile uint32_t *) (0x400B9000 + 0x54)))
  8593. // Boolean field: FTM Enable
  8594. static const uint32_t FTM_MODE_FTMEN = 1U << 0 ;
  8595. // Boolean field: Fault Interrupt Enable
  8596. static const uint32_t FTM_MODE_FAULTIE = 1U << 7 ;
  8597. // Boolean field: PWM Synchronization Mode
  8598. static const uint32_t FTM_MODE_PWMSYNC = 1U << 3 ;
  8599. // Field (width: 2 bits): Fault Control Mode
  8600. inline uint32_t FTM_MODE_FAULTM (const uint32_t inValue) { return (inValue & 3U) << 5 ; }
  8601. // Boolean field: Initialize The Channels Output
  8602. static const uint32_t FTM_MODE_INIT = 1U << 1 ;
  8603. // Boolean field: Capture Test Mode Enable
  8604. static const uint32_t FTM_MODE_CAPTEST = 1U << 4 ;
  8605. // Boolean field: Write Protection Disable
  8606. static const uint32_t FTM_MODE_WPDIS = 1U << 2 ;
  8607. //-------------------- FTM Inverting Control
  8608. #define FTM_INVCTRL(group) (* ((volatile uint32_t *) (kBaseAddress_FTM [group] + 0x90)))
  8609. #define FTM0_INVCTRL (* ((volatile uint32_t *) (0x40038000 + 0x90)))
  8610. #define FTM1_INVCTRL (* ((volatile uint32_t *) (0x40039000 + 0x90)))
  8611. #define FTM2_INVCTRL (* ((volatile uint32_t *) (0x4003A000 + 0x90)))
  8612. #define FTM3_INVCTRL (* ((volatile uint32_t *) (0x400B9000 + 0x90)))
  8613. // Boolean field: Pair Channels 1 Inverting Enable
  8614. static const uint32_t FTM_INVCTRL_INV1EN = 1U << 1 ;
  8615. // Boolean field: Pair Channels 2 Inverting Enable
  8616. static const uint32_t FTM_INVCTRL_INV2EN = 1U << 2 ;
  8617. // Boolean field: Pair Channels 0 Inverting Enable
  8618. static const uint32_t FTM_INVCTRL_INV0EN = 1U << 0 ;
  8619. // Boolean field: Pair Channels 3 Inverting Enable
  8620. static const uint32_t FTM_INVCTRL_INV3EN = 1U << 3 ;
  8621. //-------------------- Capture And Compare Status
  8622. #define FTM_STATUS(group) (* ((volatile uint32_t *) (kBaseAddress_FTM [group] + 0x50)))
  8623. #define FTM0_STATUS (* ((volatile uint32_t *) (0x40038000 + 0x50)))
  8624. #define FTM1_STATUS (* ((volatile uint32_t *) (0x40039000 + 0x50)))
  8625. #define FTM2_STATUS (* ((volatile uint32_t *) (0x4003A000 + 0x50)))
  8626. #define FTM3_STATUS (* ((volatile uint32_t *) (0x400B9000 + 0x50)))
  8627. // Boolean field: Channel 5 Flag
  8628. static const uint32_t FTM_STATUS_CH5F = 1U << 5 ;
  8629. // Boolean field: Channel 4 Flag
  8630. static const uint32_t FTM_STATUS_CH4F = 1U << 4 ;
  8631. // Boolean field: Channel 2 Flag
  8632. static const uint32_t FTM_STATUS_CH2F = 1U << 2 ;
  8633. // Boolean field: Channel 3 Flag
  8634. static const uint32_t FTM_STATUS_CH3F = 1U << 3 ;
  8635. // Boolean field: Channel 1 Flag
  8636. static const uint32_t FTM_STATUS_CH1F = 1U << 1 ;
  8637. // Boolean field: Channel 0 Flag
  8638. static const uint32_t FTM_STATUS_CH0F = 1U << 0 ;
  8639. // Boolean field: Channel 6 Flag
  8640. static const uint32_t FTM_STATUS_CH6F = 1U << 6 ;
  8641. // Boolean field: Channel 7 Flag
  8642. static const uint32_t FTM_STATUS_CH7F = 1U << 7 ;
  8643. //-------------------- Counter
  8644. #define FTM_CNT(group) (* ((volatile uint32_t *) (kBaseAddress_FTM [group] + 0x4)))
  8645. #define FTM0_CNT (* ((volatile uint32_t *) (0x40038000 + 0x4)))
  8646. #define FTM1_CNT (* ((volatile uint32_t *) (0x40039000 + 0x4)))
  8647. #define FTM2_CNT (* ((volatile uint32_t *) (0x4003A000 + 0x4)))
  8648. #define FTM3_CNT (* ((volatile uint32_t *) (0x400B9000 + 0x4)))
  8649. // Field (width: 16 bits): Counter Value
  8650. inline uint32_t FTM_CNT_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  8651. //-------------------- Output Mask
  8652. #define FTM_OUTMASK(group) (* ((volatile uint32_t *) (kBaseAddress_FTM [group] + 0x60)))
  8653. #define FTM0_OUTMASK (* ((volatile uint32_t *) (0x40038000 + 0x60)))
  8654. #define FTM1_OUTMASK (* ((volatile uint32_t *) (0x40039000 + 0x60)))
  8655. #define FTM2_OUTMASK (* ((volatile uint32_t *) (0x4003A000 + 0x60)))
  8656. #define FTM3_OUTMASK (* ((volatile uint32_t *) (0x400B9000 + 0x60)))
  8657. // Boolean field: Channel 1 Output Mask
  8658. static const uint32_t FTM_OUTMASK_CH1OM = 1U << 1 ;
  8659. // Boolean field: Channel 0 Output Mask
  8660. static const uint32_t FTM_OUTMASK_CH0OM = 1U << 0 ;
  8661. // Boolean field: Channel 5 Output Mask
  8662. static const uint32_t FTM_OUTMASK_CH5OM = 1U << 5 ;
  8663. // Boolean field: Channel 7 Output Mask
  8664. static const uint32_t FTM_OUTMASK_CH7OM = 1U << 7 ;
  8665. // Boolean field: Channel 3 Output Mask
  8666. static const uint32_t FTM_OUTMASK_CH3OM = 1U << 3 ;
  8667. // Boolean field: Channel 4 Output Mask
  8668. static const uint32_t FTM_OUTMASK_CH4OM = 1U << 4 ;
  8669. // Boolean field: Channel 6 Output Mask
  8670. static const uint32_t FTM_OUTMASK_CH6OM = 1U << 6 ;
  8671. // Boolean field: Channel 2 Output Mask
  8672. static const uint32_t FTM_OUTMASK_CH2OM = 1U << 2 ;
  8673. //-------------------- Fault Mode Status
  8674. #define FTM_FMS(group) (* ((volatile uint32_t *) (kBaseAddress_FTM [group] + 0x74)))
  8675. #define FTM0_FMS (* ((volatile uint32_t *) (0x40038000 + 0x74)))
  8676. #define FTM1_FMS (* ((volatile uint32_t *) (0x40039000 + 0x74)))
  8677. #define FTM2_FMS (* ((volatile uint32_t *) (0x4003A000 + 0x74)))
  8678. #define FTM3_FMS (* ((volatile uint32_t *) (0x400B9000 + 0x74)))
  8679. // Boolean field: Write Protection Enable
  8680. static const uint32_t FTM_FMS_WPEN = 1U << 6 ;
  8681. // Boolean field: Fault Inputs
  8682. static const uint32_t FTM_FMS_FAULTIN = 1U << 5 ;
  8683. // Boolean field: Fault Detection Flag 1
  8684. static const uint32_t FTM_FMS_FAULTF1 = 1U << 1 ;
  8685. // Boolean field: Fault Detection Flag 0
  8686. static const uint32_t FTM_FMS_FAULTF0 = 1U << 0 ;
  8687. // Boolean field: Fault Detection Flag 3
  8688. static const uint32_t FTM_FMS_FAULTF3 = 1U << 3 ;
  8689. // Boolean field: Fault Detection Flag 2
  8690. static const uint32_t FTM_FMS_FAULTF2 = 1U << 2 ;
  8691. // Boolean field: Fault Detection Flag
  8692. static const uint32_t FTM_FMS_FAULTF = 1U << 7 ;
  8693. //-------------------- FTM Software Output Control
  8694. #define FTM_SWOCTRL(group) (* ((volatile uint32_t *) (kBaseAddress_FTM [group] + 0x94)))
  8695. #define FTM0_SWOCTRL (* ((volatile uint32_t *) (0x40038000 + 0x94)))
  8696. #define FTM1_SWOCTRL (* ((volatile uint32_t *) (0x40039000 + 0x94)))
  8697. #define FTM2_SWOCTRL (* ((volatile uint32_t *) (0x4003A000 + 0x94)))
  8698. #define FTM3_SWOCTRL (* ((volatile uint32_t *) (0x400B9000 + 0x94)))
  8699. // Boolean field: Channel 5 Software Output Control Enable
  8700. static const uint32_t FTM_SWOCTRL_CH5OC = 1U << 5 ;
  8701. // Boolean field: Channel 0 Software Output Control Enable
  8702. static const uint32_t FTM_SWOCTRL_CH0OC = 1U << 0 ;
  8703. // Boolean field: Channel 4 Software Output Control Value
  8704. static const uint32_t FTM_SWOCTRL_CH4OCV = 1U << 12 ;
  8705. // Boolean field: Channel 1 Software Output Control Value
  8706. static const uint32_t FTM_SWOCTRL_CH1OCV = 1U << 9 ;
  8707. // Boolean field: Channel 6 Software Output Control Value
  8708. static const uint32_t FTM_SWOCTRL_CH6OCV = 1U << 14 ;
  8709. // Boolean field: Channel 3 Software Output Control Value
  8710. static const uint32_t FTM_SWOCTRL_CH3OCV = 1U << 11 ;
  8711. // Boolean field: Channel 1 Software Output Control Enable
  8712. static const uint32_t FTM_SWOCTRL_CH1OC = 1U << 1 ;
  8713. // Boolean field: Channel 2 Software Output Control Enable
  8714. static const uint32_t FTM_SWOCTRL_CH2OC = 1U << 2 ;
  8715. // Boolean field: Channel 0 Software Output Control Value
  8716. static const uint32_t FTM_SWOCTRL_CH0OCV = 1U << 8 ;
  8717. // Boolean field: Channel 2 Software Output Control Value
  8718. static const uint32_t FTM_SWOCTRL_CH2OCV = 1U << 10 ;
  8719. // Boolean field: Channel 6 Software Output Control Enable
  8720. static const uint32_t FTM_SWOCTRL_CH6OC = 1U << 6 ;
  8721. // Boolean field: Channel 4 Software Output Control Enable
  8722. static const uint32_t FTM_SWOCTRL_CH4OC = 1U << 4 ;
  8723. // Boolean field: Channel 3 Software Output Control Enable
  8724. static const uint32_t FTM_SWOCTRL_CH3OC = 1U << 3 ;
  8725. // Boolean field: Channel 5 Software Output Control Value
  8726. static const uint32_t FTM_SWOCTRL_CH5OCV = 1U << 13 ;
  8727. // Boolean field: Channel 7 Software Output Control Value
  8728. static const uint32_t FTM_SWOCTRL_CH7OCV = 1U << 15 ;
  8729. // Boolean field: Channel 7 Software Output Control Enable
  8730. static const uint32_t FTM_SWOCTRL_CH7OC = 1U << 7 ;
  8731. //-------------------- Fault Control
  8732. #define FTM_FLTCTRL(group) (* ((volatile uint32_t *) (kBaseAddress_FTM [group] + 0x7C)))
  8733. #define FTM0_FLTCTRL (* ((volatile uint32_t *) (0x40038000 + 0x7C)))
  8734. #define FTM1_FLTCTRL (* ((volatile uint32_t *) (0x40039000 + 0x7C)))
  8735. #define FTM2_FLTCTRL (* ((volatile uint32_t *) (0x4003A000 + 0x7C)))
  8736. #define FTM3_FLTCTRL (* ((volatile uint32_t *) (0x400B9000 + 0x7C)))
  8737. // Boolean field: Fault Input 3 Enable
  8738. static const uint32_t FTM_FLTCTRL_FAULT3EN = 1U << 3 ;
  8739. // Boolean field: Fault Input 1 Enable
  8740. static const uint32_t FTM_FLTCTRL_FAULT1EN = 1U << 1 ;
  8741. // Boolean field: Fault Input 1 Filter Enable
  8742. static const uint32_t FTM_FLTCTRL_FFLTR1EN = 1U << 5 ;
  8743. // Boolean field: Fault Input 0 Enable
  8744. static const uint32_t FTM_FLTCTRL_FAULT0EN = 1U << 0 ;
  8745. // Boolean field: Fault Input 2 Filter Enable
  8746. static const uint32_t FTM_FLTCTRL_FFLTR2EN = 1U << 6 ;
  8747. // Boolean field: Fault Input 2 Enable
  8748. static const uint32_t FTM_FLTCTRL_FAULT2EN = 1U << 2 ;
  8749. // Field (width: 4 bits): Fault Input Filter
  8750. inline uint32_t FTM_FLTCTRL_FFVAL (const uint32_t inValue) { return (inValue & 15U) << 8 ; }
  8751. // Boolean field: Fault Input 0 Filter Enable
  8752. static const uint32_t FTM_FLTCTRL_FFLTR0EN = 1U << 4 ;
  8753. // Boolean field: Fault Input 3 Filter Enable
  8754. static const uint32_t FTM_FLTCTRL_FFLTR3EN = 1U << 7 ;
  8755. //-------------------- FTM PWM Load
  8756. #define FTM_PWMLOAD(group) (* ((volatile uint32_t *) (kBaseAddress_FTM [group] + 0x98)))
  8757. #define FTM0_PWMLOAD (* ((volatile uint32_t *) (0x40038000 + 0x98)))
  8758. #define FTM1_PWMLOAD (* ((volatile uint32_t *) (0x40039000 + 0x98)))
  8759. #define FTM2_PWMLOAD (* ((volatile uint32_t *) (0x4003A000 + 0x98)))
  8760. #define FTM3_PWMLOAD (* ((volatile uint32_t *) (0x400B9000 + 0x98)))
  8761. // Boolean field: Load Enable
  8762. static const uint32_t FTM_PWMLOAD_LDOK = 1U << 9 ;
  8763. // Boolean field: Channel 2 Select
  8764. static const uint32_t FTM_PWMLOAD_CH2SEL = 1U << 2 ;
  8765. // Boolean field: Channel 5 Select
  8766. static const uint32_t FTM_PWMLOAD_CH5SEL = 1U << 5 ;
  8767. // Boolean field: Channel 6 Select
  8768. static const uint32_t FTM_PWMLOAD_CH6SEL = 1U << 6 ;
  8769. // Boolean field: Channel 3 Select
  8770. static const uint32_t FTM_PWMLOAD_CH3SEL = 1U << 3 ;
  8771. // Boolean field: Channel 7 Select
  8772. static const uint32_t FTM_PWMLOAD_CH7SEL = 1U << 7 ;
  8773. // Boolean field: Channel 1 Select
  8774. static const uint32_t FTM_PWMLOAD_CH1SEL = 1U << 1 ;
  8775. // Boolean field: Channel 0 Select
  8776. static const uint32_t FTM_PWMLOAD_CH0SEL = 1U << 0 ;
  8777. // Boolean field: Channel 4 Select
  8778. static const uint32_t FTM_PWMLOAD_CH4SEL = 1U << 4 ;
  8779. //-------------------- FTM Fault Input Polarity
  8780. #define FTM_FLTPOL(group) (* ((volatile uint32_t *) (kBaseAddress_FTM [group] + 0x88)))
  8781. #define FTM0_FLTPOL (* ((volatile uint32_t *) (0x40038000 + 0x88)))
  8782. #define FTM1_FLTPOL (* ((volatile uint32_t *) (0x40039000 + 0x88)))
  8783. #define FTM2_FLTPOL (* ((volatile uint32_t *) (0x4003A000 + 0x88)))
  8784. #define FTM3_FLTPOL (* ((volatile uint32_t *) (0x400B9000 + 0x88)))
  8785. // Boolean field: Fault Input 3 Polarity
  8786. static const uint32_t FTM_FLTPOL_FLT3POL = 1U << 3 ;
  8787. // Boolean field: Fault Input 0 Polarity
  8788. static const uint32_t FTM_FLTPOL_FLT0POL = 1U << 0 ;
  8789. // Boolean field: Fault Input 2 Polarity
  8790. static const uint32_t FTM_FLTPOL_FLT2POL = 1U << 2 ;
  8791. // Boolean field: Fault Input 1 Polarity
  8792. static const uint32_t FTM_FLTPOL_FLT1POL = 1U << 1 ;
  8793. //-------------------- Quadrature Decoder Control And Status
  8794. #define FTM_QDCTRL(group) (* ((volatile uint32_t *) (kBaseAddress_FTM [group] + 0x80)))
  8795. #define FTM0_QDCTRL (* ((volatile uint32_t *) (0x40038000 + 0x80)))
  8796. #define FTM1_QDCTRL (* ((volatile uint32_t *) (0x40039000 + 0x80)))
  8797. #define FTM2_QDCTRL (* ((volatile uint32_t *) (0x4003A000 + 0x80)))
  8798. #define FTM3_QDCTRL (* ((volatile uint32_t *) (0x400B9000 + 0x80)))
  8799. // Boolean field: Phase A Input Polarity
  8800. static const uint32_t FTM_QDCTRL_PHAPOL = 1U << 5 ;
  8801. // Boolean field: Phase B Input Polarity
  8802. static const uint32_t FTM_QDCTRL_PHBPOL = 1U << 4 ;
  8803. // Boolean field: Phase B Input Filter Enable
  8804. static const uint32_t FTM_QDCTRL_PHBFLTREN = 1U << 6 ;
  8805. // Boolean field: FTM Counter Direction In Quadrature Decoder Mode
  8806. static const uint32_t FTM_QDCTRL_QUADIR = 1U << 2 ;
  8807. // Boolean field: Phase A Input Filter Enable
  8808. static const uint32_t FTM_QDCTRL_PHAFLTREN = 1U << 7 ;
  8809. // Boolean field: Timer Overflow Direction In Quadrature Decoder Mode
  8810. static const uint32_t FTM_QDCTRL_TOFDIR = 1U << 1 ;
  8811. // Boolean field: Quadrature Decoder Mode
  8812. static const uint32_t FTM_QDCTRL_QUADMODE = 1U << 3 ;
  8813. // Boolean field: Quadrature Decoder Mode Enable
  8814. static const uint32_t FTM_QDCTRL_QUADEN = 1U << 0 ;
  8815. //-------------------- Input Capture Filter Control
  8816. #define FTM_FILTER(group) (* ((volatile uint32_t *) (kBaseAddress_FTM [group] + 0x78)))
  8817. #define FTM0_FILTER (* ((volatile uint32_t *) (0x40038000 + 0x78)))
  8818. #define FTM1_FILTER (* ((volatile uint32_t *) (0x40039000 + 0x78)))
  8819. #define FTM2_FILTER (* ((volatile uint32_t *) (0x4003A000 + 0x78)))
  8820. #define FTM3_FILTER (* ((volatile uint32_t *) (0x400B9000 + 0x78)))
  8821. // Field (width: 4 bits): Channel 1 Input Filter
  8822. inline uint32_t FTM_FILTER_CH1FVAL (const uint32_t inValue) { return (inValue & 15U) << 4 ; }
  8823. // Field (width: 4 bits): Channel 0 Input Filter
  8824. inline uint32_t FTM_FILTER_CH0FVAL (const uint32_t inValue) { return (inValue & 15U) << 0 ; }
  8825. // Field (width: 4 bits): Channel 3 Input Filter
  8826. inline uint32_t FTM_FILTER_CH3FVAL (const uint32_t inValue) { return (inValue & 15U) << 12 ; }
  8827. // Field (width: 4 bits): Channel 2 Input Filter
  8828. inline uint32_t FTM_FILTER_CH2FVAL (const uint32_t inValue) { return (inValue & 15U) << 8 ; }
  8829. //-------------------- FTM External Trigger
  8830. #define FTM_EXTTRIG(group) (* ((volatile uint32_t *) (kBaseAddress_FTM [group] + 0x6C)))
  8831. #define FTM0_EXTTRIG (* ((volatile uint32_t *) (0x40038000 + 0x6C)))
  8832. #define FTM1_EXTTRIG (* ((volatile uint32_t *) (0x40039000 + 0x6C)))
  8833. #define FTM2_EXTTRIG (* ((volatile uint32_t *) (0x4003A000 + 0x6C)))
  8834. #define FTM3_EXTTRIG (* ((volatile uint32_t *) (0x400B9000 + 0x6C)))
  8835. // Boolean field: Channel 0 Trigger Enable
  8836. static const uint32_t FTM_EXTTRIG_CH0TRIG = 1U << 4 ;
  8837. // Boolean field: Initialization Trigger Enable
  8838. static const uint32_t FTM_EXTTRIG_INITTRIGEN = 1U << 6 ;
  8839. // Boolean field: Channel Trigger Flag
  8840. static const uint32_t FTM_EXTTRIG_TRIGF = 1U << 7 ;
  8841. // Boolean field: Channel 5 Trigger Enable
  8842. static const uint32_t FTM_EXTTRIG_CH5TRIG = 1U << 3 ;
  8843. // Boolean field: Channel 2 Trigger Enable
  8844. static const uint32_t FTM_EXTTRIG_CH2TRIG = 1U << 0 ;
  8845. // Boolean field: Channel 3 Trigger Enable
  8846. static const uint32_t FTM_EXTTRIG_CH3TRIG = 1U << 1 ;
  8847. // Boolean field: Channel 4 Trigger Enable
  8848. static const uint32_t FTM_EXTTRIG_CH4TRIG = 1U << 2 ;
  8849. // Boolean field: Channel 1 Trigger Enable
  8850. static const uint32_t FTM_EXTTRIG_CH1TRIG = 1U << 5 ;
  8851. //-------------------- Initial State For Channels Output
  8852. #define FTM_OUTINIT(group) (* ((volatile uint32_t *) (kBaseAddress_FTM [group] + 0x5C)))
  8853. #define FTM0_OUTINIT (* ((volatile uint32_t *) (0x40038000 + 0x5C)))
  8854. #define FTM1_OUTINIT (* ((volatile uint32_t *) (0x40039000 + 0x5C)))
  8855. #define FTM2_OUTINIT (* ((volatile uint32_t *) (0x4003A000 + 0x5C)))
  8856. #define FTM3_OUTINIT (* ((volatile uint32_t *) (0x400B9000 + 0x5C)))
  8857. // Boolean field: Channel 1 Output Initialization Value
  8858. static const uint32_t FTM_OUTINIT_CH1OI = 1U << 1 ;
  8859. // Boolean field: Channel 5 Output Initialization Value
  8860. static const uint32_t FTM_OUTINIT_CH5OI = 1U << 5 ;
  8861. // Boolean field: Channel 0 Output Initialization Value
  8862. static const uint32_t FTM_OUTINIT_CH0OI = 1U << 0 ;
  8863. // Boolean field: Channel 3 Output Initialization Value
  8864. static const uint32_t FTM_OUTINIT_CH3OI = 1U << 3 ;
  8865. // Boolean field: Channel 4 Output Initialization Value
  8866. static const uint32_t FTM_OUTINIT_CH4OI = 1U << 4 ;
  8867. // Boolean field: Channel 7 Output Initialization Value
  8868. static const uint32_t FTM_OUTINIT_CH7OI = 1U << 7 ;
  8869. // Boolean field: Channel 2 Output Initialization Value
  8870. static const uint32_t FTM_OUTINIT_CH2OI = 1U << 2 ;
  8871. // Boolean field: Channel 6 Output Initialization Value
  8872. static const uint32_t FTM_OUTINIT_CH6OI = 1U << 6 ;
  8873. //-------------------- Channel (n) Value (idx = 0 ... 7)
  8874. #define FTM_CV(group,idx) (* ((volatile uint32_t *) (kBaseAddress_FTM [group] + 0x10 + 0x8 * (idx))))
  8875. #define FTM0_CV(idx) (* ((volatile uint32_t *) (0x40038000 + 0x10 + 0x8 * (idx))))
  8876. #define FTM1_CV(idx) (* ((volatile uint32_t *) (0x40039000 + 0x10 + 0x8 * (idx))))
  8877. #define FTM2_CV(idx) (* ((volatile uint32_t *) (0x4003A000 + 0x10 + 0x8 * (idx))))
  8878. #define FTM3_CV(idx) (* ((volatile uint32_t *) (0x400B9000 + 0x10 + 0x8 * (idx))))
  8879. // Field (width: 16 bits): Channel Value
  8880. inline uint32_t FTM_CV_VAL (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  8881. //-------------------- Status And Control
  8882. #define FTM_SC(group) (* ((volatile uint32_t *) (kBaseAddress_FTM [group] + 0)))
  8883. #define FTM0_SC (* ((volatile uint32_t *) (0x40038000 + 0)))
  8884. #define FTM1_SC (* ((volatile uint32_t *) (0x40039000 + 0)))
  8885. #define FTM2_SC (* ((volatile uint32_t *) (0x4003A000 + 0)))
  8886. #define FTM3_SC (* ((volatile uint32_t *) (0x400B9000 + 0)))
  8887. // Field (width: 3 bits): Prescale Factor Selection
  8888. inline uint32_t FTM_SC_PS (const uint32_t inValue) { return (inValue & 7U) << 0 ; }
  8889. // Field (width: 2 bits): Clock Source Selection
  8890. inline uint32_t FTM_SC_CLKS (const uint32_t inValue) { return (inValue & 3U) << 3 ; }
  8891. // Boolean field: Timer Overflow Flag
  8892. static const uint32_t FTM_SC_TOF = 1U << 7 ;
  8893. // Boolean field: Center-Aligned PWM Select
  8894. static const uint32_t FTM_SC_CPWMS = 1U << 5 ;
  8895. // Boolean field: Timer Overflow Interrupt Enable
  8896. static const uint32_t FTM_SC_TOIE = 1U << 6 ;
  8897. //-------------------- Modulo
  8898. #define FTM_MOD(group) (* ((volatile uint32_t *) (kBaseAddress_FTM [group] + 0x8)))
  8899. #define FTM0_MOD (* ((volatile uint32_t *) (0x40038000 + 0x8)))
  8900. #define FTM1_MOD (* ((volatile uint32_t *) (0x40039000 + 0x8)))
  8901. #define FTM2_MOD (* ((volatile uint32_t *) (0x4003A000 + 0x8)))
  8902. #define FTM3_MOD (* ((volatile uint32_t *) (0x400B9000 + 0x8)))
  8903. // Field (width: 16 bits): Modulo Value
  8904. inline uint32_t FTM_MOD_MOD (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  8905. //-------------------- Deadtime Insertion Control
  8906. #define FTM_DEADTIME(group) (* ((volatile uint32_t *) (kBaseAddress_FTM [group] + 0x68)))
  8907. #define FTM0_DEADTIME (* ((volatile uint32_t *) (0x40038000 + 0x68)))
  8908. #define FTM1_DEADTIME (* ((volatile uint32_t *) (0x40039000 + 0x68)))
  8909. #define FTM2_DEADTIME (* ((volatile uint32_t *) (0x4003A000 + 0x68)))
  8910. #define FTM3_DEADTIME (* ((volatile uint32_t *) (0x400B9000 + 0x68)))
  8911. // Field (width: 6 bits): Deadtime Value
  8912. inline uint32_t FTM_DEADTIME_DTVAL (const uint32_t inValue) { return (inValue & 63U) << 0 ; }
  8913. // Field (width: 2 bits): Deadtime Prescaler Value
  8914. inline uint32_t FTM_DEADTIME_DTPS (const uint32_t inValue) { return (inValue & 3U) << 6 ; }
  8915. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  8916. // Peripheral group GPIO
  8917. // GPIOA at 0x400FF000
  8918. // GPIOB at 0x400FF040
  8919. // GPIOC at 0x400FF080
  8920. // GPIOD at 0x400FF0C0
  8921. // GPIOE at 0x400FF100
  8922. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  8923. static const uint32_t kBaseAddress_GPIO [5] = {0x400FF000, 0x400FF040, 0x400FF080, 0x400FF0C0, 0x400FF100} ;
  8924. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  8925. //-------------------- Port Set Output Register
  8926. #define GPIO_PSOR(group) (* ((volatile uint32_t *) (kBaseAddress_GPIO [group] + 0x4)))
  8927. #define GPIOA_PSOR (* ((volatile uint32_t *) (0x400FF000 + 0x4)))
  8928. #define GPIOB_PSOR (* ((volatile uint32_t *) (0x400FF040 + 0x4)))
  8929. #define GPIOC_PSOR (* ((volatile uint32_t *) (0x400FF080 + 0x4)))
  8930. #define GPIOD_PSOR (* ((volatile uint32_t *) (0x400FF0C0 + 0x4)))
  8931. #define GPIOE_PSOR (* ((volatile uint32_t *) (0x400FF100 + 0x4)))
  8932. //-------------------- Port Data Input Register
  8933. #define GPIO_PDIR(group) (* ((const volatile uint32_t *) (kBaseAddress_GPIO [group] + 0x10)))
  8934. #define GPIOA_PDIR (* ((const volatile uint32_t *) (0x400FF000 + 0x10)))
  8935. #define GPIOB_PDIR (* ((const volatile uint32_t *) (0x400FF040 + 0x10)))
  8936. #define GPIOC_PDIR (* ((const volatile uint32_t *) (0x400FF080 + 0x10)))
  8937. #define GPIOD_PDIR (* ((const volatile uint32_t *) (0x400FF0C0 + 0x10)))
  8938. #define GPIOE_PDIR (* ((const volatile uint32_t *) (0x400FF100 + 0x10)))
  8939. //-------------------- Port Data Output Register
  8940. #define GPIO_PDOR(group) (* ((volatile uint32_t *) (kBaseAddress_GPIO [group] + 0)))
  8941. #define GPIOA_PDOR (* ((volatile uint32_t *) (0x400FF000 + 0)))
  8942. #define GPIOB_PDOR (* ((volatile uint32_t *) (0x400FF040 + 0)))
  8943. #define GPIOC_PDOR (* ((volatile uint32_t *) (0x400FF080 + 0)))
  8944. #define GPIOD_PDOR (* ((volatile uint32_t *) (0x400FF0C0 + 0)))
  8945. #define GPIOE_PDOR (* ((volatile uint32_t *) (0x400FF100 + 0)))
  8946. //-------------------- Port Clear Output Register
  8947. #define GPIO_PCOR(group) (* ((volatile uint32_t *) (kBaseAddress_GPIO [group] + 0x8)))
  8948. #define GPIOA_PCOR (* ((volatile uint32_t *) (0x400FF000 + 0x8)))
  8949. #define GPIOB_PCOR (* ((volatile uint32_t *) (0x400FF040 + 0x8)))
  8950. #define GPIOC_PCOR (* ((volatile uint32_t *) (0x400FF080 + 0x8)))
  8951. #define GPIOD_PCOR (* ((volatile uint32_t *) (0x400FF0C0 + 0x8)))
  8952. #define GPIOE_PCOR (* ((volatile uint32_t *) (0x400FF100 + 0x8)))
  8953. //-------------------- Port Data Direction Register
  8954. #define GPIO_PDDR(group) (* ((volatile uint32_t *) (kBaseAddress_GPIO [group] + 0x14)))
  8955. #define GPIOA_PDDR (* ((volatile uint32_t *) (0x400FF000 + 0x14)))
  8956. #define GPIOB_PDDR (* ((volatile uint32_t *) (0x400FF040 + 0x14)))
  8957. #define GPIOC_PDDR (* ((volatile uint32_t *) (0x400FF080 + 0x14)))
  8958. #define GPIOD_PDDR (* ((volatile uint32_t *) (0x400FF0C0 + 0x14)))
  8959. #define GPIOE_PDDR (* ((volatile uint32_t *) (0x400FF100 + 0x14)))
  8960. //-------------------- Port Toggle Output Register
  8961. #define GPIO_PTOR(group) (* ((volatile uint32_t *) (kBaseAddress_GPIO [group] + 0xC)))
  8962. #define GPIOA_PTOR (* ((volatile uint32_t *) (0x400FF000 + 0xC)))
  8963. #define GPIOB_PTOR (* ((volatile uint32_t *) (0x400FF040 + 0xC)))
  8964. #define GPIOC_PTOR (* ((volatile uint32_t *) (0x400FF080 + 0xC)))
  8965. #define GPIOD_PTOR (* ((volatile uint32_t *) (0x400FF0C0 + 0xC)))
  8966. #define GPIOE_PTOR (* ((volatile uint32_t *) (0x400FF100 + 0xC)))
  8967. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  8968. // Peripheral group I2C
  8969. // I2C0 at 0x40066000
  8970. // I2C1 at 0x40067000
  8971. // I2C2 at 0x400E6000
  8972. // I2C3 at 0x400E7000
  8973. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  8974. static const uint32_t kBaseAddress_I2C [4] = {0x40066000, 0x40067000, 0x400E6000, 0x400E7000} ;
  8975. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  8976. //-------------------- I2C Data I/O register
  8977. #define I2C_D(group) (* ((volatile uint8_t *) (kBaseAddress_I2C [group] + 0x4)))
  8978. #define I2C0_D (* ((volatile uint8_t *) (0x40066000 + 0x4)))
  8979. #define I2C1_D (* ((volatile uint8_t *) (0x40067000 + 0x4)))
  8980. #define I2C2_D (* ((volatile uint8_t *) (0x400E6000 + 0x4)))
  8981. #define I2C3_D (* ((volatile uint8_t *) (0x400E7000 + 0x4)))
  8982. //-------------------- I2C Frequency Divider register
  8983. #define I2C_F(group) (* ((volatile uint8_t *) (kBaseAddress_I2C [group] + 0x1)))
  8984. #define I2C0_F (* ((volatile uint8_t *) (0x40066000 + 0x1)))
  8985. #define I2C1_F (* ((volatile uint8_t *) (0x40067000 + 0x1)))
  8986. #define I2C2_F (* ((volatile uint8_t *) (0x400E6000 + 0x1)))
  8987. #define I2C3_F (* ((volatile uint8_t *) (0x400E7000 + 0x1)))
  8988. // Field (width: 6 bits): ClockRate
  8989. inline uint8_t I2C_F_ICR (const uint8_t inValue) { return (inValue & 63U) << 0 ; }
  8990. // Field (width: 2 bits): Multiplier Factor
  8991. inline uint8_t I2C_F_MULT (const uint8_t inValue) { return (inValue & 3U) << 6 ; }
  8992. //-------------------- I2C SCL Low Timeout Register Low
  8993. #define I2C_SLTL(group) (* ((volatile uint8_t *) (kBaseAddress_I2C [group] + 0xB)))
  8994. #define I2C0_SLTL (* ((volatile uint8_t *) (0x40066000 + 0xB)))
  8995. #define I2C1_SLTL (* ((volatile uint8_t *) (0x40067000 + 0xB)))
  8996. #define I2C2_SLTL (* ((volatile uint8_t *) (0x400E6000 + 0xB)))
  8997. #define I2C3_SLTL (* ((volatile uint8_t *) (0x400E7000 + 0xB)))
  8998. //-------------------- I2C Programmable Input Glitch Filter Register
  8999. #define I2C_FLT(group) (* ((volatile uint8_t *) (kBaseAddress_I2C [group] + 0x6)))
  9000. #define I2C0_FLT (* ((volatile uint8_t *) (0x40066000 + 0x6)))
  9001. #define I2C1_FLT (* ((volatile uint8_t *) (0x40067000 + 0x6)))
  9002. #define I2C2_FLT (* ((volatile uint8_t *) (0x400E6000 + 0x6)))
  9003. #define I2C3_FLT (* ((volatile uint8_t *) (0x400E7000 + 0x6)))
  9004. // Boolean field: Stop Hold Enable
  9005. static const uint8_t I2C_FLT_SHEN = 1U << 7 ;
  9006. // Boolean field: I2C Bus Stop or Start Interrupt Enable
  9007. static const uint8_t I2C_FLT_SSIE = 1U << 5 ;
  9008. // Boolean field: I2C Bus Stop Detect Flag
  9009. static const uint8_t I2C_FLT_STOPF = 1U << 6 ;
  9010. // Boolean field: I2C Bus Start Detect Flag
  9011. static const uint8_t I2C_FLT_STARTF = 1U << 4 ;
  9012. // Field (width: 4 bits): I2C Programmable Filter Factor
  9013. inline uint8_t I2C_FLT_FLT (const uint8_t inValue) { return (inValue & 15U) << 0 ; }
  9014. //-------------------- I2C SCL Low Timeout Register High
  9015. #define I2C_SLTH(group) (* ((volatile uint8_t *) (kBaseAddress_I2C [group] + 0xA)))
  9016. #define I2C0_SLTH (* ((volatile uint8_t *) (0x40066000 + 0xA)))
  9017. #define I2C1_SLTH (* ((volatile uint8_t *) (0x40067000 + 0xA)))
  9018. #define I2C2_SLTH (* ((volatile uint8_t *) (0x400E6000 + 0xA)))
  9019. #define I2C3_SLTH (* ((volatile uint8_t *) (0x400E7000 + 0xA)))
  9020. //-------------------- I2C Address Register 1
  9021. #define I2C_A1(group) (* ((volatile uint8_t *) (kBaseAddress_I2C [group] + 0)))
  9022. #define I2C0_A1 (* ((volatile uint8_t *) (0x40066000 + 0)))
  9023. #define I2C1_A1 (* ((volatile uint8_t *) (0x40067000 + 0)))
  9024. #define I2C2_A1 (* ((volatile uint8_t *) (0x400E6000 + 0)))
  9025. #define I2C3_A1 (* ((volatile uint8_t *) (0x400E7000 + 0)))
  9026. // Field (width: 7 bits): Address
  9027. inline uint8_t I2C_A1_AD (const uint8_t inValue) { return (inValue & 127U) << 1 ; }
  9028. //-------------------- I2C Status register
  9029. #define I2C_S(group) (* ((volatile uint8_t *) (kBaseAddress_I2C [group] + 0x3)))
  9030. #define I2C0_S (* ((volatile uint8_t *) (0x40066000 + 0x3)))
  9031. #define I2C1_S (* ((volatile uint8_t *) (0x40067000 + 0x3)))
  9032. #define I2C2_S (* ((volatile uint8_t *) (0x400E6000 + 0x3)))
  9033. #define I2C3_S (* ((volatile uint8_t *) (0x400E7000 + 0x3)))
  9034. // Boolean field: Interrupt Flag
  9035. static const uint8_t I2C_S_IICIF = 1U << 1 ;
  9036. // Boolean field: Bus Busy
  9037. static const uint8_t I2C_S_BUSY = 1U << 5 ;
  9038. // Boolean field: Range Address Match
  9039. static const uint8_t I2C_S_RAM = 1U << 3 ;
  9040. // Boolean field: Receive Acknowledge
  9041. static const uint8_t I2C_S_RXAK = 1U << 0 ;
  9042. // Boolean field: Slave Read/Write
  9043. static const uint8_t I2C_S_SRW = 1U << 2 ;
  9044. // Boolean field: Transfer Complete Flag
  9045. static const uint8_t I2C_S_TCF = 1U << 7 ;
  9046. // Boolean field: Addressed As A Slave
  9047. static const uint8_t I2C_S_IAAS = 1U << 6 ;
  9048. // Boolean field: Arbitration Lost
  9049. static const uint8_t I2C_S_ARBL = 1U << 4 ;
  9050. //-------------------- I2C Address Register 2
  9051. #define I2C_A2(group) (* ((volatile uint8_t *) (kBaseAddress_I2C [group] + 0x9)))
  9052. #define I2C0_A2 (* ((volatile uint8_t *) (0x40066000 + 0x9)))
  9053. #define I2C1_A2 (* ((volatile uint8_t *) (0x40067000 + 0x9)))
  9054. #define I2C2_A2 (* ((volatile uint8_t *) (0x400E6000 + 0x9)))
  9055. #define I2C3_A2 (* ((volatile uint8_t *) (0x400E7000 + 0x9)))
  9056. // Field (width: 7 bits): SMBus Address
  9057. inline uint8_t I2C_A2_SAD (const uint8_t inValue) { return (inValue & 127U) << 1 ; }
  9058. //-------------------- I2C Range Address register
  9059. #define I2C_RA(group) (* ((volatile uint8_t *) (kBaseAddress_I2C [group] + 0x7)))
  9060. #define I2C0_RA (* ((volatile uint8_t *) (0x40066000 + 0x7)))
  9061. #define I2C1_RA (* ((volatile uint8_t *) (0x40067000 + 0x7)))
  9062. #define I2C2_RA (* ((volatile uint8_t *) (0x400E6000 + 0x7)))
  9063. #define I2C3_RA (* ((volatile uint8_t *) (0x400E7000 + 0x7)))
  9064. // Field (width: 7 bits): Range Slave Address
  9065. inline uint8_t I2C_RA_RAD (const uint8_t inValue) { return (inValue & 127U) << 1 ; }
  9066. //-------------------- I2C Control Register 2
  9067. #define I2C_C2(group) (* ((volatile uint8_t *) (kBaseAddress_I2C [group] + 0x5)))
  9068. #define I2C0_C2 (* ((volatile uint8_t *) (0x40066000 + 0x5)))
  9069. #define I2C1_C2 (* ((volatile uint8_t *) (0x40067000 + 0x5)))
  9070. #define I2C2_C2 (* ((volatile uint8_t *) (0x400E6000 + 0x5)))
  9071. #define I2C3_C2 (* ((volatile uint8_t *) (0x400E7000 + 0x5)))
  9072. // Boolean field: High Drive Select
  9073. static const uint8_t I2C_C2_HDRS = 1U << 5 ;
  9074. // Boolean field: Address Extension
  9075. static const uint8_t I2C_C2_ADEXT = 1U << 6 ;
  9076. // Boolean field: Slave Baud Rate Control
  9077. static const uint8_t I2C_C2_SBRC = 1U << 4 ;
  9078. // Boolean field: General Call Address Enable
  9079. static const uint8_t I2C_C2_GCAEN = 1U << 7 ;
  9080. // Boolean field: Range Address Matching Enable
  9081. static const uint8_t I2C_C2_RMEN = 1U << 3 ;
  9082. // Field (width: 3 bits): Slave Address
  9083. inline uint8_t I2C_C2_AD (const uint8_t inValue) { return (inValue & 7U) << 0 ; }
  9084. //-------------------- I2C Control Register 1
  9085. #define I2C_C1(group) (* ((volatile uint8_t *) (kBaseAddress_I2C [group] + 0x2)))
  9086. #define I2C0_C1 (* ((volatile uint8_t *) (0x40066000 + 0x2)))
  9087. #define I2C1_C1 (* ((volatile uint8_t *) (0x40067000 + 0x2)))
  9088. #define I2C2_C1 (* ((volatile uint8_t *) (0x400E6000 + 0x2)))
  9089. #define I2C3_C1 (* ((volatile uint8_t *) (0x400E7000 + 0x2)))
  9090. // Boolean field: DMA Enable
  9091. static const uint8_t I2C_C1_DMAEN = 1U << 0 ;
  9092. // Boolean field: I2C Enable
  9093. static const uint8_t I2C_C1_IICEN = 1U << 7 ;
  9094. // Boolean field: Transmit Mode Select
  9095. static const uint8_t I2C_C1_TX = 1U << 4 ;
  9096. // Boolean field: Transmit Acknowledge Enable
  9097. static const uint8_t I2C_C1_TXAK = 1U << 3 ;
  9098. // Boolean field: Master Mode Select
  9099. static const uint8_t I2C_C1_MST = 1U << 5 ;
  9100. // Boolean field: I2C Interrupt Enable
  9101. static const uint8_t I2C_C1_IICIE = 1U << 6 ;
  9102. // Boolean field: Repeat START
  9103. static const uint8_t I2C_C1_RSTA = 1U << 2 ;
  9104. // Boolean field: Wakeup Enable
  9105. static const uint8_t I2C_C1_WUEN = 1U << 1 ;
  9106. //-------------------- I2C SMBus Control and Status register
  9107. #define I2C_SMB(group) (* ((volatile uint8_t *) (kBaseAddress_I2C [group] + 0x8)))
  9108. #define I2C0_SMB (* ((volatile uint8_t *) (0x40066000 + 0x8)))
  9109. #define I2C1_SMB (* ((volatile uint8_t *) (0x40067000 + 0x8)))
  9110. #define I2C2_SMB (* ((volatile uint8_t *) (0x400E6000 + 0x8)))
  9111. #define I2C3_SMB (* ((volatile uint8_t *) (0x400E7000 + 0x8)))
  9112. // Boolean field: Fast NACK/ACK Enable
  9113. static const uint8_t I2C_SMB_FACK = 1U << 7 ;
  9114. // Boolean field: SCL Low Timeout Flag
  9115. static const uint8_t I2C_SMB_SLTF = 1U << 3 ;
  9116. // Boolean field: Timeout Counter Clock Select
  9117. static const uint8_t I2C_SMB_TCKSEL = 1U << 4 ;
  9118. // Boolean field: SCL High Timeout Flag 1
  9119. static const uint8_t I2C_SMB_SHTF1 = 1U << 2 ;
  9120. // Boolean field: SCL High Timeout Flag 2
  9121. static const uint8_t I2C_SMB_SHTF2 = 1U << 1 ;
  9122. // Boolean field: Second I2C Address Enable
  9123. static const uint8_t I2C_SMB_SIICAEN = 1U << 5 ;
  9124. // Boolean field: SMBus Alert Response Address Enable
  9125. static const uint8_t I2C_SMB_ALERTEN = 1U << 6 ;
  9126. // Boolean field: SHTF2 Interrupt Enable
  9127. static const uint8_t I2C_SMB_SHTF2IE = 1U << 0 ;
  9128. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  9129. // Peripheral group PORT
  9130. // PORTA at 0x40049000
  9131. // PORTB at 0x4004A000
  9132. // PORTC at 0x4004B000
  9133. // PORTD at 0x4004C000
  9134. // PORTE at 0x4004D000
  9135. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  9136. static const uint32_t kBaseAddress_PORT [5] = {0x40049000, 0x4004A000, 0x4004B000, 0x4004C000, 0x4004D000} ;
  9137. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  9138. //-------------------- Digital Filter Clock Register
  9139. #define PORT_DFCR(group) (* ((volatile uint32_t *) (kBaseAddress_PORT [group] + 0xC4)))
  9140. #define PORTA_DFCR (* ((volatile uint32_t *) (0x40049000 + 0xC4)))
  9141. #define PORTB_DFCR (* ((volatile uint32_t *) (0x4004A000 + 0xC4)))
  9142. #define PORTC_DFCR (* ((volatile uint32_t *) (0x4004B000 + 0xC4)))
  9143. #define PORTD_DFCR (* ((volatile uint32_t *) (0x4004C000 + 0xC4)))
  9144. #define PORTE_DFCR (* ((volatile uint32_t *) (0x4004D000 + 0xC4)))
  9145. // Boolean field: Clock Source
  9146. static const uint32_t PORT_DFCR_CS = 1U << 0 ;
  9147. //-------------------- Digital Filter Enable Register
  9148. #define PORT_DFER(group) (* ((volatile uint32_t *) (kBaseAddress_PORT [group] + 0xC0)))
  9149. #define PORTA_DFER (* ((volatile uint32_t *) (0x40049000 + 0xC0)))
  9150. #define PORTB_DFER (* ((volatile uint32_t *) (0x4004A000 + 0xC0)))
  9151. #define PORTC_DFER (* ((volatile uint32_t *) (0x4004B000 + 0xC0)))
  9152. #define PORTD_DFER (* ((volatile uint32_t *) (0x4004C000 + 0xC0)))
  9153. #define PORTE_DFER (* ((volatile uint32_t *) (0x4004D000 + 0xC0)))
  9154. //-------------------- Interrupt Status Flag Register
  9155. #define PORT_ISFR(group) (* ((volatile uint32_t *) (kBaseAddress_PORT [group] + 0xA0)))
  9156. #define PORTA_ISFR (* ((volatile uint32_t *) (0x40049000 + 0xA0)))
  9157. #define PORTB_ISFR (* ((volatile uint32_t *) (0x4004A000 + 0xA0)))
  9158. #define PORTC_ISFR (* ((volatile uint32_t *) (0x4004B000 + 0xA0)))
  9159. #define PORTD_ISFR (* ((volatile uint32_t *) (0x4004C000 + 0xA0)))
  9160. #define PORTE_ISFR (* ((volatile uint32_t *) (0x4004D000 + 0xA0)))
  9161. //-------------------- Digital Filter Width Register
  9162. #define PORT_DFWR(group) (* ((volatile uint32_t *) (kBaseAddress_PORT [group] + 0xC8)))
  9163. #define PORTA_DFWR (* ((volatile uint32_t *) (0x40049000 + 0xC8)))
  9164. #define PORTB_DFWR (* ((volatile uint32_t *) (0x4004A000 + 0xC8)))
  9165. #define PORTC_DFWR (* ((volatile uint32_t *) (0x4004B000 + 0xC8)))
  9166. #define PORTD_DFWR (* ((volatile uint32_t *) (0x4004C000 + 0xC8)))
  9167. #define PORTE_DFWR (* ((volatile uint32_t *) (0x4004D000 + 0xC8)))
  9168. // Field (width: 5 bits): Filter Length
  9169. inline uint32_t PORT_DFWR_FILT (const uint32_t inValue) { return (inValue & 31U) << 0 ; }
  9170. //-------------------- Global Pin Control Low Register
  9171. #define PORT_GPCLR(group) (* ((volatile uint32_t *) (kBaseAddress_PORT [group] + 0x80)))
  9172. #define PORTA_GPCLR (* ((volatile uint32_t *) (0x40049000 + 0x80)))
  9173. #define PORTB_GPCLR (* ((volatile uint32_t *) (0x4004A000 + 0x80)))
  9174. #define PORTC_GPCLR (* ((volatile uint32_t *) (0x4004B000 + 0x80)))
  9175. #define PORTD_GPCLR (* ((volatile uint32_t *) (0x4004C000 + 0x80)))
  9176. #define PORTE_GPCLR (* ((volatile uint32_t *) (0x4004D000 + 0x80)))
  9177. // Field (width: 16 bits): Global Pin Write Data
  9178. inline uint32_t PORT_GPCLR_GPWD (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  9179. // Field (width: 16 bits): Global Pin Write Enable
  9180. inline uint32_t PORT_GPCLR_GPWE (const uint32_t inValue) { return (inValue & 65535U) << 16 ; }
  9181. //-------------------- Global Pin Control High Register
  9182. #define PORT_GPCHR(group) (* ((volatile uint32_t *) (kBaseAddress_PORT [group] + 0x84)))
  9183. #define PORTA_GPCHR (* ((volatile uint32_t *) (0x40049000 + 0x84)))
  9184. #define PORTB_GPCHR (* ((volatile uint32_t *) (0x4004A000 + 0x84)))
  9185. #define PORTC_GPCHR (* ((volatile uint32_t *) (0x4004B000 + 0x84)))
  9186. #define PORTD_GPCHR (* ((volatile uint32_t *) (0x4004C000 + 0x84)))
  9187. #define PORTE_GPCHR (* ((volatile uint32_t *) (0x4004D000 + 0x84)))
  9188. // Field (width: 16 bits): Global Pin Write Data
  9189. inline uint32_t PORT_GPCHR_GPWD (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  9190. // Field (width: 16 bits): Global Pin Write Enable
  9191. inline uint32_t PORT_GPCHR_GPWE (const uint32_t inValue) { return (inValue & 65535U) << 16 ; }
  9192. //-------------------- Pin Control Register n (idx = 0 ... 31)
  9193. #define PORT_PCR(group,idx) (* ((volatile uint32_t *) (kBaseAddress_PORT [group] + 0 + 0x4 * (idx))))
  9194. #define PORTA_PCR(idx) (* ((volatile uint32_t *) (0x40049000 + 0 + 0x4 * (idx))))
  9195. #define PORTB_PCR(idx) (* ((volatile uint32_t *) (0x4004A000 + 0 + 0x4 * (idx))))
  9196. #define PORTC_PCR(idx) (* ((volatile uint32_t *) (0x4004B000 + 0 + 0x4 * (idx))))
  9197. #define PORTD_PCR(idx) (* ((volatile uint32_t *) (0x4004C000 + 0 + 0x4 * (idx))))
  9198. #define PORTE_PCR(idx) (* ((volatile uint32_t *) (0x4004D000 + 0 + 0x4 * (idx))))
  9199. // Boolean field: Pull Select
  9200. static const uint32_t PORT_PCR_PS = 1U << 0 ;
  9201. // Boolean field: Passive Filter Enable
  9202. static const uint32_t PORT_PCR_PFE = 1U << 4 ;
  9203. // Boolean field: Interrupt Status Flag
  9204. static const uint32_t PORT_PCR_ISF = 1U << 24 ;
  9205. // Boolean field: Slew Rate Enable
  9206. static const uint32_t PORT_PCR_SRE = 1U << 2 ;
  9207. // Field (width: 3 bits): Pin Mux Control
  9208. inline uint32_t PORT_PCR_MUX (const uint32_t inValue) { return (inValue & 7U) << 8 ; }
  9209. // Boolean field: Lock Register
  9210. static const uint32_t PORT_PCR_LK = 1U << 15 ;
  9211. // Boolean field: Pull Enable
  9212. static const uint32_t PORT_PCR_PE = 1U << 1 ;
  9213. // Field (width: 4 bits): Interrupt Configuration
  9214. inline uint32_t PORT_PCR_IRQC (const uint32_t inValue) { return (inValue & 15U) << 16 ; }
  9215. // Boolean field: Drive Strength Enable
  9216. static const uint32_t PORT_PCR_DSE = 1U << 6 ;
  9217. // Boolean field: Open Drain Enable
  9218. static const uint32_t PORT_PCR_ODE = 1U << 5 ;
  9219. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  9220. // Peripheral group SPI
  9221. // SPI0 at 0x4002C000
  9222. // SPI1 at 0x4002D000
  9223. // SPI2 at 0x400AC000
  9224. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  9225. static const uint32_t kBaseAddress_SPI [3] = {0x4002C000, 0x4002D000, 0x400AC000} ;
  9226. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  9227. //-------------------- Receive FIFO Registers (idx = 0 ... 3)
  9228. #define SPI_RXFR(group,idx) (* ((const volatile uint32_t *) (kBaseAddress_SPI [group] + 0x7C + 0x4 * (idx))))
  9229. #define SPI0_RXFR(idx) (* ((const volatile uint32_t *) (0x4002C000 + 0x7C + 0x4 * (idx))))
  9230. #define SPI1_RXFR(idx) (* ((const volatile uint32_t *) (0x4002D000 + 0x7C + 0x4 * (idx))))
  9231. #define SPI2_RXFR(idx) (* ((const volatile uint32_t *) (0x400AC000 + 0x7C + 0x4 * (idx))))
  9232. //-------------------- PUSH TX FIFO Register In Slave Mode
  9233. #define SPI_PUSHR_SLAVE(group) (* ((volatile uint32_t *) (kBaseAddress_SPI [group] + 0x34)))
  9234. #define SPI0_PUSHR_SLAVE (* ((volatile uint32_t *) (0x4002C000 + 0x34)))
  9235. #define SPI1_PUSHR_SLAVE (* ((volatile uint32_t *) (0x4002D000 + 0x34)))
  9236. #define SPI2_PUSHR_SLAVE (* ((volatile uint32_t *) (0x400AC000 + 0x34)))
  9237. //-------------------- PUSH TX FIFO Register In Master Mode
  9238. #define SPI_PUSHR(group) (* ((volatile uint32_t *) (kBaseAddress_SPI [group] + 0x34)))
  9239. #define SPI0_PUSHR (* ((volatile uint32_t *) (0x4002C000 + 0x34)))
  9240. #define SPI1_PUSHR (* ((volatile uint32_t *) (0x4002D000 + 0x34)))
  9241. #define SPI2_PUSHR (* ((volatile uint32_t *) (0x400AC000 + 0x34)))
  9242. // Boolean field: Continuous Peripheral Chip Select Enable
  9243. static const uint32_t SPI_PUSHR_CONT = 1U << 31 ;
  9244. // Boolean field: Clear Transfer Counter
  9245. static const uint32_t SPI_PUSHR_CTCNT = 1U << 26 ;
  9246. // Field (width: 6 bits): Select which PCS signals are to be asserted for the transfer
  9247. inline uint32_t SPI_PUSHR_PCS (const uint32_t inValue) { return (inValue & 63U) << 16 ; }
  9248. // Boolean field: End Of Queue
  9249. static const uint32_t SPI_PUSHR_EOQ = 1U << 27 ;
  9250. // Field (width: 3 bits): Clock and Transfer Attributes Select
  9251. inline uint32_t SPI_PUSHR_CTAS (const uint32_t inValue) { return (inValue & 7U) << 28 ; }
  9252. // Field (width: 16 bits): Transmit Data
  9253. inline uint32_t SPI_PUSHR_TXDATA (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  9254. //-------------------- DMA/Interrupt Request Select and Enable Register
  9255. #define SPI_RSER(group) (* ((volatile uint32_t *) (kBaseAddress_SPI [group] + 0x30)))
  9256. #define SPI0_RSER (* ((volatile uint32_t *) (0x4002C000 + 0x30)))
  9257. #define SPI1_RSER (* ((volatile uint32_t *) (0x4002D000 + 0x30)))
  9258. #define SPI2_RSER (* ((volatile uint32_t *) (0x400AC000 + 0x30)))
  9259. // Boolean field: Receive FIFO Drain Request Enable
  9260. static const uint32_t SPI_RSER_RFDF_RE = 1U << 17 ;
  9261. // Boolean field: Transmit FIFO Fill DMA or Interrupt Request Select
  9262. static const uint32_t SPI_RSER_TFFF_DIRS = 1U << 24 ;
  9263. // Boolean field: Receive FIFO Overflow Request Enable
  9264. static const uint32_t SPI_RSER_RFOF_RE = 1U << 19 ;
  9265. // Boolean field: Transmission Complete Request Enable
  9266. static const uint32_t SPI_RSER_TCF_RE = 1U << 31 ;
  9267. // Boolean field: Finished Request Enable
  9268. static const uint32_t SPI_RSER_EOQF_RE = 1U << 28 ;
  9269. // Boolean field: Transmit FIFO Fill Request Enable
  9270. static const uint32_t SPI_RSER_TFFF_RE = 1U << 25 ;
  9271. // Boolean field: Transmit FIFO Underflow Request Enable
  9272. static const uint32_t SPI_RSER_TFUF_RE = 1U << 27 ;
  9273. // Boolean field: Receive FIFO Drain DMA or Interrupt Request Select
  9274. static const uint32_t SPI_RSER_RFDF_DIRS = 1U << 16 ;
  9275. //-------------------- Status Register
  9276. #define SPI_SR(group) (* ((volatile uint32_t *) (kBaseAddress_SPI [group] + 0x2C)))
  9277. #define SPI0_SR (* ((volatile uint32_t *) (0x4002C000 + 0x2C)))
  9278. #define SPI1_SR (* ((volatile uint32_t *) (0x4002D000 + 0x2C)))
  9279. #define SPI2_SR (* ((volatile uint32_t *) (0x400AC000 + 0x2C)))
  9280. // Boolean field: TX and RX Status
  9281. static const uint32_t SPI_SR_TXRXS = 1U << 30 ;
  9282. // Boolean field: End of Queue Flag
  9283. static const uint32_t SPI_SR_EOQF = 1U << 28 ;
  9284. // Boolean field: Transmit FIFO Underflow Flag
  9285. static const uint32_t SPI_SR_TFUF = 1U << 27 ;
  9286. // Field (width: 4 bits): Transmit Next Pointer
  9287. inline uint32_t SPI_SR_TXNXTPTR (const uint32_t inValue) { return (inValue & 15U) << 8 ; }
  9288. // Field (width: 4 bits): Pop Next Pointer
  9289. inline uint32_t SPI_SR_POPNXTPTR (const uint32_t inValue) { return (inValue & 15U) << 0 ; }
  9290. // Field (width: 4 bits): RX FIFO Counter
  9291. inline uint32_t SPI_SR_RXCTR (const uint32_t inValue) { return (inValue & 15U) << 4 ; }
  9292. // Boolean field: Transfer Complete Flag
  9293. static const uint32_t SPI_SR_TCF = 1U << 31 ;
  9294. // Field (width: 4 bits): TX FIFO Counter
  9295. inline uint32_t SPI_SR_TXCTR (const uint32_t inValue) { return (inValue & 15U) << 12 ; }
  9296. // Boolean field: Transmit FIFO Fill Flag
  9297. static const uint32_t SPI_SR_TFFF = 1U << 25 ;
  9298. // Boolean field: Receive FIFO Drain Flag
  9299. static const uint32_t SPI_SR_RFDF = 1U << 17 ;
  9300. // Boolean field: Receive FIFO Overflow Flag
  9301. static const uint32_t SPI_SR_RFOF = 1U << 19 ;
  9302. //-------------------- Clock and Transfer Attributes Register (In Master Mode) (idx = 0 ... 1)
  9303. #define SPI_CTAR(group,idx) (* ((volatile uint32_t *) (kBaseAddress_SPI [group] + 0xC + 0x4 * (idx))))
  9304. #define SPI0_CTAR(idx) (* ((volatile uint32_t *) (0x4002C000 + 0xC + 0x4 * (idx))))
  9305. #define SPI1_CTAR(idx) (* ((volatile uint32_t *) (0x4002D000 + 0xC + 0x4 * (idx))))
  9306. #define SPI2_CTAR(idx) (* ((volatile uint32_t *) (0x400AC000 + 0xC + 0x4 * (idx))))
  9307. // Field (width: 2 bits): PCS to SCK Delay Prescaler
  9308. inline uint32_t SPI_CTAR_PCSSCK (const uint32_t inValue) { return (inValue & 3U) << 22 ; }
  9309. // Boolean field: Clock Polarity
  9310. static const uint32_t SPI_CTAR_CPOL = 1U << 26 ;
  9311. // Field (width: 2 bits): Baud Rate Prescaler
  9312. inline uint32_t SPI_CTAR_PBR (const uint32_t inValue) { return (inValue & 3U) << 16 ; }
  9313. // Field (width: 2 bits): Delay after Transfer Prescaler
  9314. inline uint32_t SPI_CTAR_PDT (const uint32_t inValue) { return (inValue & 3U) << 18 ; }
  9315. // Boolean field: Clock Phase
  9316. static const uint32_t SPI_CTAR_CPHA = 1U << 25 ;
  9317. // Field (width: 4 bits): After SCK Delay Scaler
  9318. inline uint32_t SPI_CTAR_ASC (const uint32_t inValue) { return (inValue & 15U) << 8 ; }
  9319. // Field (width: 4 bits): PCS to SCK Delay Scaler
  9320. inline uint32_t SPI_CTAR_CSSCK (const uint32_t inValue) { return (inValue & 15U) << 12 ; }
  9321. // Field (width: 4 bits): Frame Size
  9322. inline uint32_t SPI_CTAR_FMSZ (const uint32_t inValue) { return (inValue & 15U) << 27 ; }
  9323. // Field (width: 4 bits): Baud Rate Scaler
  9324. inline uint32_t SPI_CTAR_BR (const uint32_t inValue) { return (inValue & 15U) << 0 ; }
  9325. // Boolean field: LSB First
  9326. static const uint32_t SPI_CTAR_LSBFE = 1U << 24 ;
  9327. // Field (width: 4 bits): Delay After Transfer Scaler
  9328. inline uint32_t SPI_CTAR_DT (const uint32_t inValue) { return (inValue & 15U) << 4 ; }
  9329. // Boolean field: Double Baud Rate
  9330. static const uint32_t SPI_CTAR_DBR = 1U << 31 ;
  9331. // Field (width: 2 bits): After SCK Delay Prescaler
  9332. inline uint32_t SPI_CTAR_PASC (const uint32_t inValue) { return (inValue & 3U) << 20 ; }
  9333. //-------------------- Transfer Count Register
  9334. #define SPI_TCR(group) (* ((volatile uint32_t *) (kBaseAddress_SPI [group] + 0x8)))
  9335. #define SPI0_TCR (* ((volatile uint32_t *) (0x4002C000 + 0x8)))
  9336. #define SPI1_TCR (* ((volatile uint32_t *) (0x4002D000 + 0x8)))
  9337. #define SPI2_TCR (* ((volatile uint32_t *) (0x400AC000 + 0x8)))
  9338. // Field (width: 16 bits): SPI Transfer Counter
  9339. inline uint32_t SPI_TCR_SPI_TCNT (const uint32_t inValue) { return (inValue & 65535U) << 16 ; }
  9340. //-------------------- POP RX FIFO Register
  9341. #define SPI_POPR(group) (* ((const volatile uint32_t *) (kBaseAddress_SPI [group] + 0x38)))
  9342. #define SPI0_POPR (* ((const volatile uint32_t *) (0x4002C000 + 0x38)))
  9343. #define SPI1_POPR (* ((const volatile uint32_t *) (0x4002D000 + 0x38)))
  9344. #define SPI2_POPR (* ((const volatile uint32_t *) (0x400AC000 + 0x38)))
  9345. //-------------------- Clock and Transfer Attributes Register (In Slave Mode)
  9346. #define SPI_CTAR_SLAVE(group) (* ((volatile uint32_t *) (kBaseAddress_SPI [group] + 0xC)))
  9347. #define SPI0_CTAR_SLAVE (* ((volatile uint32_t *) (0x4002C000 + 0xC)))
  9348. #define SPI1_CTAR_SLAVE (* ((volatile uint32_t *) (0x4002D000 + 0xC)))
  9349. #define SPI2_CTAR_SLAVE (* ((volatile uint32_t *) (0x400AC000 + 0xC)))
  9350. // Boolean field: Clock Polarity
  9351. static const uint32_t SPI_CTAR_SLAVE_CPOL = 1U << 26 ;
  9352. // Boolean field: Clock Phase
  9353. static const uint32_t SPI_CTAR_SLAVE_CPHA = 1U << 25 ;
  9354. // Field (width: 4 bits): Frame Size
  9355. inline uint32_t SPI_CTAR_SLAVE_FMSZ (const uint32_t inValue) { return (inValue & 15U) << 27 ; }
  9356. //-------------------- Transmit FIFO Registers (idx = 0 ... 3)
  9357. #define SPI_TXFR(group,idx) (* ((const volatile uint32_t *) (kBaseAddress_SPI [group] + 0x3C + 0x4 * (idx))))
  9358. #define SPI0_TXFR(idx) (* ((const volatile uint32_t *) (0x4002C000 + 0x3C + 0x4 * (idx))))
  9359. #define SPI1_TXFR(idx) (* ((const volatile uint32_t *) (0x4002D000 + 0x3C + 0x4 * (idx))))
  9360. #define SPI2_TXFR(idx) (* ((const volatile uint32_t *) (0x400AC000 + 0x3C + 0x4 * (idx))))
  9361. // Field (width: 16 bits): Transmit Data
  9362. inline uint32_t SPI_TXFR_TXDATA (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  9363. // Field (width: 16 bits): Transmit Command or Transmit Data
  9364. inline uint32_t SPI_TXFR_TXCMD_TXDATA (const uint32_t inValue) { return (inValue & 65535U) << 16 ; }
  9365. //-------------------- Module Configuration Register
  9366. #define SPI_MCR(group) (* ((volatile uint32_t *) (kBaseAddress_SPI [group] + 0)))
  9367. #define SPI0_MCR (* ((volatile uint32_t *) (0x4002C000 + 0)))
  9368. #define SPI1_MCR (* ((volatile uint32_t *) (0x4002D000 + 0)))
  9369. #define SPI2_MCR (* ((volatile uint32_t *) (0x400AC000 + 0)))
  9370. // Boolean field: Disable Receive FIFO
  9371. static const uint32_t SPI_MCR_DIS_RXF = 1U << 12 ;
  9372. // Field (width: 6 bits): Peripheral Chip Select x Inactive State
  9373. inline uint32_t SPI_MCR_PCSIS (const uint32_t inValue) { return (inValue & 63U) << 16 ; }
  9374. // Boolean field: Halt
  9375. static const uint32_t SPI_MCR_HALT = 1U << 0 ;
  9376. // Boolean field: Peripheral Chip Select Strobe Enable
  9377. static const uint32_t SPI_MCR_PCSSE = 1U << 25 ;
  9378. // Boolean field: Modified Transfer Format Enable
  9379. static const uint32_t SPI_MCR_MTFE = 1U << 26 ;
  9380. // Boolean field: Continuous SCK Enable
  9381. static const uint32_t SPI_MCR_CONT_SCKE = 1U << 30 ;
  9382. // Boolean field: Receive FIFO Overflow Overwrite Enable
  9383. static const uint32_t SPI_MCR_ROOE = 1U << 24 ;
  9384. // Boolean field: Master/Slave Mode Select
  9385. static const uint32_t SPI_MCR_MSTR = 1U << 31 ;
  9386. // Boolean field: CLR_RXF
  9387. static const uint32_t SPI_MCR_CLR_RXF = 1U << 10 ;
  9388. // Boolean field: Disable Transmit FIFO
  9389. static const uint32_t SPI_MCR_DIS_TXF = 1U << 13 ;
  9390. // Boolean field: Clear TX FIFO
  9391. static const uint32_t SPI_MCR_CLR_TXF = 1U << 11 ;
  9392. // Boolean field: Module Disable
  9393. static const uint32_t SPI_MCR_MDIS = 1U << 14 ;
  9394. // Boolean field: Doze Enable
  9395. static const uint32_t SPI_MCR_DOZE = 1U << 15 ;
  9396. // Boolean field: Freeze
  9397. static const uint32_t SPI_MCR_FRZ = 1U << 27 ;
  9398. // Field (width: 2 bits): SPI Configuration.
  9399. inline uint32_t SPI_MCR_DCONF (const uint32_t inValue) { return (inValue & 3U) << 28 ; }
  9400. // Field (width: 2 bits): Sample Point
  9401. inline uint32_t SPI_MCR_SMPL_PT (const uint32_t inValue) { return (inValue & 3U) << 8 ; }
  9402. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  9403. // Peripheral group TPM
  9404. // TPM1 at 0x400C9000
  9405. // TPM2 at 0x400CA000
  9406. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  9407. static const uint32_t kBaseAddress_TPM [2] = {0x400C9000, 0x400CA000} ;
  9408. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  9409. //-------------------- Capture and Compare Status
  9410. #define TPM_STATUS(group) (* ((volatile uint32_t *) (kBaseAddress_TPM [group] + 0x50)))
  9411. #define TPM1_STATUS (* ((volatile uint32_t *) (0x400C9000 + 0x50)))
  9412. #define TPM2_STATUS (* ((volatile uint32_t *) (0x400CA000 + 0x50)))
  9413. // Boolean field: Timer Overflow Flag
  9414. static const uint32_t TPM_STATUS_TOF = 1U << 8 ;
  9415. // Boolean field: Channel 0 Flag
  9416. static const uint32_t TPM_STATUS_CH0F = 1U << 0 ;
  9417. // Boolean field: Channel 1 Flag
  9418. static const uint32_t TPM_STATUS_CH1F = 1U << 1 ;
  9419. //-------------------- Counter
  9420. #define TPM_CNT(group) (* ((volatile uint32_t *) (kBaseAddress_TPM [group] + 0x4)))
  9421. #define TPM1_CNT (* ((volatile uint32_t *) (0x400C9000 + 0x4)))
  9422. #define TPM2_CNT (* ((volatile uint32_t *) (0x400CA000 + 0x4)))
  9423. // Field (width: 16 bits): Counter value
  9424. inline uint32_t TPM_CNT_COUNT (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  9425. //-------------------- Channel (n) Status and Control (idx = 0 ... 7)
  9426. #define TPM_CSC(group,idx) (* ((volatile uint32_t *) (kBaseAddress_TPM [group] + 0xC + 0x8 * (idx))))
  9427. #define TPM1_CSC(idx) (* ((volatile uint32_t *) (0x400C9000 + 0xC + 0x8 * (idx))))
  9428. #define TPM2_CSC(idx) (* ((volatile uint32_t *) (0x400CA000 + 0xC + 0x8 * (idx))))
  9429. // Boolean field: DMA Enable
  9430. static const uint32_t TPM_CSC_DMA = 1U << 0 ;
  9431. // Boolean field: Channel Flag
  9432. static const uint32_t TPM_CSC_CHF = 1U << 7 ;
  9433. // Boolean field: Edge or Level Select
  9434. static const uint32_t TPM_CSC_ELSB = 1U << 3 ;
  9435. // Boolean field: Edge or Level Select
  9436. static const uint32_t TPM_CSC_ELSA = 1U << 2 ;
  9437. // Boolean field: Channel Mode Select
  9438. static const uint32_t TPM_CSC_MSB = 1U << 5 ;
  9439. // Boolean field: Channel Mode Select
  9440. static const uint32_t TPM_CSC_MSA = 1U << 4 ;
  9441. // Boolean field: Channel Interrupt Enable
  9442. static const uint32_t TPM_CSC_CHIE = 1U << 6 ;
  9443. //-------------------- Quadrature Decoder Control and Status
  9444. #define TPM_QDCTRL(group) (* ((volatile uint32_t *) (kBaseAddress_TPM [group] + 0x80)))
  9445. #define TPM1_QDCTRL (* ((volatile uint32_t *) (0x400C9000 + 0x80)))
  9446. #define TPM2_QDCTRL (* ((volatile uint32_t *) (0x400CA000 + 0x80)))
  9447. // Boolean field: Quadrature Decoder Mode
  9448. static const uint32_t TPM_QDCTRL_QUADMODE = 1U << 3 ;
  9449. // Boolean field: Indicates if the TOF bit was set on the top or the bottom of counting.
  9450. static const uint32_t TPM_QDCTRL_TOFDIR = 1U << 1 ;
  9451. // Boolean field: Counter Direction in Quadrature Decode Mode
  9452. static const uint32_t TPM_QDCTRL_QUADIR = 1U << 2 ;
  9453. // Boolean field: Enables the quadrature decoder mode
  9454. static const uint32_t TPM_QDCTRL_QUADEN = 1U << 0 ;
  9455. //-------------------- Filter Control
  9456. #define TPM_FILTER(group) (* ((volatile uint32_t *) (kBaseAddress_TPM [group] + 0x78)))
  9457. #define TPM1_FILTER (* ((volatile uint32_t *) (0x400C9000 + 0x78)))
  9458. #define TPM2_FILTER (* ((volatile uint32_t *) (0x400CA000 + 0x78)))
  9459. // Field (width: 4 bits): Channel 1 Filter Value
  9460. inline uint32_t TPM_FILTER_CH1FVAL (const uint32_t inValue) { return (inValue & 15U) << 4 ; }
  9461. // Field (width: 4 bits): Channel 0 Filter Value
  9462. inline uint32_t TPM_FILTER_CH0FVAL (const uint32_t inValue) { return (inValue & 15U) << 0 ; }
  9463. //-------------------- Channel Polarity
  9464. #define TPM_POL(group) (* ((volatile uint32_t *) (kBaseAddress_TPM [group] + 0x70)))
  9465. #define TPM1_POL (* ((volatile uint32_t *) (0x400C9000 + 0x70)))
  9466. #define TPM2_POL (* ((volatile uint32_t *) (0x400CA000 + 0x70)))
  9467. // Boolean field: Channel 1 Polarity
  9468. static const uint32_t TPM_POL_POL1 = 1U << 1 ;
  9469. // Boolean field: Channel 0 Polarity
  9470. static const uint32_t TPM_POL_POL0 = 1U << 0 ;
  9471. //-------------------- Combine Channel Register
  9472. #define TPM_COMBINE(group) (* ((volatile uint32_t *) (kBaseAddress_TPM [group] + 0x64)))
  9473. #define TPM1_COMBINE (* ((volatile uint32_t *) (0x400C9000 + 0x64)))
  9474. #define TPM2_COMBINE (* ((volatile uint32_t *) (0x400CA000 + 0x64)))
  9475. // Boolean field: Combine Channels 0 and 1
  9476. static const uint32_t TPM_COMBINE_COMBINE0 = 1U << 0 ;
  9477. // Boolean field: Combine Channel 0 and 1 Swap
  9478. static const uint32_t TPM_COMBINE_COMSWAP0 = 1U << 1 ;
  9479. //-------------------- Configuration
  9480. #define TPM_CONF(group) (* ((volatile uint32_t *) (kBaseAddress_TPM [group] + 0x84)))
  9481. #define TPM1_CONF (* ((volatile uint32_t *) (0x400C9000 + 0x84)))
  9482. #define TPM2_CONF (* ((volatile uint32_t *) (0x400CA000 + 0x84)))
  9483. // Field (width: 4 bits): Trigger Select
  9484. inline uint32_t TPM_CONF_TRGSEL (const uint32_t inValue) { return (inValue & 15U) << 24 ; }
  9485. // Boolean field: Global Time Base Synchronization
  9486. static const uint32_t TPM_CONF_GTBSYNC = 1U << 8 ;
  9487. // Field (width: 2 bits): Debug Mode
  9488. inline uint32_t TPM_CONF_DBGMODE (const uint32_t inValue) { return (inValue & 3U) << 6 ; }
  9489. // Boolean field: Counter Stop On Overflow
  9490. static const uint32_t TPM_CONF_CSOO = 1U << 17 ;
  9491. // Boolean field: Counter Reload On Trigger
  9492. static const uint32_t TPM_CONF_CROT = 1U << 18 ;
  9493. // Boolean field: Global time base enable
  9494. static const uint32_t TPM_CONF_GTBEEN = 1U << 9 ;
  9495. // Boolean field: Trigger Source
  9496. static const uint32_t TPM_CONF_TRGSRC = 1U << 23 ;
  9497. // Boolean field: Counter Start on Trigger
  9498. static const uint32_t TPM_CONF_CSOT = 1U << 16 ;
  9499. // Boolean field: Trigger Polarity
  9500. static const uint32_t TPM_CONF_TRGPOL = 1U << 22 ;
  9501. // Boolean field: Doze Enable
  9502. static const uint32_t TPM_CONF_DOZEEN = 1U << 5 ;
  9503. // Boolean field: Counter Pause On Trigger
  9504. static const uint32_t TPM_CONF_CPOT = 1U << 19 ;
  9505. //-------------------- Channel (n) Value (idx = 0 ... 1)
  9506. #define TPM_CV(group,idx) (* ((volatile uint32_t *) (kBaseAddress_TPM [group] + 0x10 + 0x8 * (idx))))
  9507. #define TPM1_CV(idx) (* ((volatile uint32_t *) (0x400C9000 + 0x10 + 0x8 * (idx))))
  9508. #define TPM2_CV(idx) (* ((volatile uint32_t *) (0x400CA000 + 0x10 + 0x8 * (idx))))
  9509. // Field (width: 16 bits): Channel Value
  9510. inline uint32_t TPM_CV_VAL (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  9511. //-------------------- Status and Control
  9512. #define TPM_SC(group) (* ((volatile uint32_t *) (kBaseAddress_TPM [group] + 0)))
  9513. #define TPM1_SC (* ((volatile uint32_t *) (0x400C9000 + 0)))
  9514. #define TPM2_SC (* ((volatile uint32_t *) (0x400CA000 + 0)))
  9515. // Boolean field: DMA Enable
  9516. static const uint32_t TPM_SC_DMA = 1U << 8 ;
  9517. // Field (width: 3 bits): Prescale Factor Selection
  9518. inline uint32_t TPM_SC_PS (const uint32_t inValue) { return (inValue & 7U) << 0 ; }
  9519. // Field (width: 2 bits): Clock Mode Selection
  9520. inline uint32_t TPM_SC_CMOD (const uint32_t inValue) { return (inValue & 3U) << 3 ; }
  9521. // Boolean field: Timer Overflow Interrupt Enable
  9522. static const uint32_t TPM_SC_TOIE = 1U << 6 ;
  9523. // Boolean field: Timer Overflow Flag
  9524. static const uint32_t TPM_SC_TOF = 1U << 7 ;
  9525. // Boolean field: Center-Aligned PWM Select
  9526. static const uint32_t TPM_SC_CPWMS = 1U << 5 ;
  9527. //-------------------- Modulo
  9528. #define TPM_MOD(group) (* ((volatile uint32_t *) (kBaseAddress_TPM [group] + 0x8)))
  9529. #define TPM1_MOD (* ((volatile uint32_t *) (0x400C9000 + 0x8)))
  9530. #define TPM2_MOD (* ((volatile uint32_t *) (0x400CA000 + 0x8)))
  9531. // Field (width: 16 bits): Modulo value
  9532. inline uint32_t TPM_MOD_MOD (const uint32_t inValue) { return (inValue & 65535U) << 0 ; }
  9533. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  9534. // Peripheral group UART
  9535. // UART0 at 0x4006A000
  9536. // UART1 at 0x4006B000
  9537. // UART2 at 0x4006C000
  9538. // UART3 at 0x4006D000
  9539. // UART4 at 0x400EA000
  9540. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  9541. static const uint32_t kBaseAddress_UART [5] = {0x4006A000, 0x4006B000, 0x4006C000, 0x4006D000, 0x400EA000} ;
  9542. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  9543. //-------------------- UART Match Address Registers 1
  9544. #define UART_MA1(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0x8)))
  9545. #define UART0_MA1 (* ((volatile uint8_t *) (0x4006A000 + 0x8)))
  9546. #define UART1_MA1 (* ((volatile uint8_t *) (0x4006B000 + 0x8)))
  9547. #define UART2_MA1 (* ((volatile uint8_t *) (0x4006C000 + 0x8)))
  9548. #define UART3_MA1 (* ((volatile uint8_t *) (0x4006D000 + 0x8)))
  9549. #define UART4_MA1 (* ((volatile uint8_t *) (0x400EA000 + 0x8)))
  9550. //-------------------- UART Match Address Registers 2
  9551. #define UART_MA2(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0x9)))
  9552. #define UART0_MA2 (* ((volatile uint8_t *) (0x4006A000 + 0x9)))
  9553. #define UART1_MA2 (* ((volatile uint8_t *) (0x4006B000 + 0x9)))
  9554. #define UART2_MA2 (* ((volatile uint8_t *) (0x4006C000 + 0x9)))
  9555. #define UART3_MA2 (* ((volatile uint8_t *) (0x4006D000 + 0x9)))
  9556. #define UART4_MA2 (* ((volatile uint8_t *) (0x400EA000 + 0x9)))
  9557. //-------------------- UART FIFO Status Register
  9558. #define UART_SFIFO(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0x12)))
  9559. #define UART0_SFIFO (* ((volatile uint8_t *) (0x4006A000 + 0x12)))
  9560. #define UART1_SFIFO (* ((volatile uint8_t *) (0x4006B000 + 0x12)))
  9561. #define UART2_SFIFO (* ((volatile uint8_t *) (0x4006C000 + 0x12)))
  9562. #define UART3_SFIFO (* ((volatile uint8_t *) (0x4006D000 + 0x12)))
  9563. #define UART4_SFIFO (* ((volatile uint8_t *) (0x400EA000 + 0x12)))
  9564. // Boolean field: Receive Buffer/FIFO Empty
  9565. static const uint8_t UART_SFIFO_RXEMPT = 1U << 6 ;
  9566. // Boolean field: Transmitter Buffer Overflow Flag
  9567. static const uint8_t UART_SFIFO_TXOF = 1U << 1 ;
  9568. // Boolean field: Transmit Buffer/FIFO Empty
  9569. static const uint8_t UART_SFIFO_TXEMPT = 1U << 7 ;
  9570. // Boolean field: Receiver Buffer Overflow Flag
  9571. static const uint8_t UART_SFIFO_RXOF = 1U << 2 ;
  9572. // Boolean field: Receiver Buffer Underflow Flag
  9573. static const uint8_t UART_SFIFO_RXUF = 1U << 0 ;
  9574. //-------------------- UART Status Register 2
  9575. #define UART_S2(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0x5)))
  9576. #define UART0_S2 (* ((volatile uint8_t *) (0x4006A000 + 0x5)))
  9577. #define UART1_S2 (* ((volatile uint8_t *) (0x4006B000 + 0x5)))
  9578. #define UART2_S2 (* ((volatile uint8_t *) (0x4006C000 + 0x5)))
  9579. #define UART3_S2 (* ((volatile uint8_t *) (0x4006D000 + 0x5)))
  9580. #define UART4_S2 (* ((volatile uint8_t *) (0x400EA000 + 0x5)))
  9581. // Boolean field: Receiver Active Flag
  9582. static const uint8_t UART_S2_RAF = 1U << 0 ;
  9583. // Boolean field: Receive Wakeup Idle Detect
  9584. static const uint8_t UART_S2_RWUID = 1U << 3 ;
  9585. // Boolean field: Receive Data Inversion
  9586. static const uint8_t UART_S2_RXINV = 1U << 4 ;
  9587. // Boolean field: Break Transmit Character Length
  9588. static const uint8_t UART_S2_BRK13 = 1U << 2 ;
  9589. // Boolean field: LIN Break Detect Interrupt Flag
  9590. static const uint8_t UART_S2_LBKDIF = 1U << 7 ;
  9591. // Boolean field: LIN Break Detection Enable
  9592. static const uint8_t UART_S2_LBKDE = 1U << 1 ;
  9593. // Boolean field: RxD Pin Active Edge Interrupt Flag
  9594. static const uint8_t UART_S2_RXEDGIF = 1U << 6 ;
  9595. // Boolean field: Most Significant Bit First
  9596. static const uint8_t UART_S2_MSBF = 1U << 5 ;
  9597. //-------------------- UART Status Register 1
  9598. #define UART_S1(group) (* ((const volatile uint8_t *) (kBaseAddress_UART [group] + 0x4)))
  9599. #define UART0_S1 (* ((const volatile uint8_t *) (0x4006A000 + 0x4)))
  9600. #define UART1_S1 (* ((const volatile uint8_t *) (0x4006B000 + 0x4)))
  9601. #define UART2_S1 (* ((const volatile uint8_t *) (0x4006C000 + 0x4)))
  9602. #define UART3_S1 (* ((const volatile uint8_t *) (0x4006D000 + 0x4)))
  9603. #define UART4_S1 (* ((const volatile uint8_t *) (0x400EA000 + 0x4)))
  9604. // Boolean field: Noise Flag
  9605. static const uint8_t UART_S1_NF = 1U << 2 ;
  9606. // Boolean field: Receive Data Register Full Flag
  9607. static const uint8_t UART_S1_RDRF = 1U << 5 ;
  9608. // Boolean field: Transmit Complete Flag
  9609. static const uint8_t UART_S1_TC = 1U << 6 ;
  9610. // Boolean field: Idle Line Flag
  9611. static const uint8_t UART_S1_IDLE = 1U << 4 ;
  9612. // Boolean field: Parity Error Flag
  9613. static const uint8_t UART_S1_PF = 1U << 0 ;
  9614. // Boolean field: Framing Error Flag
  9615. static const uint8_t UART_S1_FE = 1U << 1 ;
  9616. // Boolean field: Transmit Data Register Empty Flag
  9617. static const uint8_t UART_S1_TDRE = 1U << 7 ;
  9618. // Boolean field: Receiver Overrun Flag
  9619. static const uint8_t UART_S1_OR = 1U << 3 ;
  9620. //-------------------- UART 7816 Wait Parameter Register B
  9621. #define UART_WP7816B_T0(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0x3D)))
  9622. #define UART0_WP7816B_T0 (* ((volatile uint8_t *) (0x4006A000 + 0x3D)))
  9623. #define UART1_WP7816B_T0 (* ((volatile uint8_t *) (0x4006B000 + 0x3D)))
  9624. #define UART2_WP7816B_T0 (* ((volatile uint8_t *) (0x4006C000 + 0x3D)))
  9625. #define UART3_WP7816B_T0 (* ((volatile uint8_t *) (0x4006D000 + 0x3D)))
  9626. #define UART4_WP7816B_T0 (* ((volatile uint8_t *) (0x400EA000 + 0x3D)))
  9627. //-------------------- UART 7816 Wait Parameter Register B
  9628. #define UART_WP7816B_T1(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0x3D)))
  9629. #define UART0_WP7816B_T1 (* ((volatile uint8_t *) (0x4006A000 + 0x3D)))
  9630. #define UART1_WP7816B_T1 (* ((volatile uint8_t *) (0x4006B000 + 0x3D)))
  9631. #define UART2_WP7816B_T1 (* ((volatile uint8_t *) (0x4006C000 + 0x3D)))
  9632. #define UART3_WP7816B_T1 (* ((volatile uint8_t *) (0x4006D000 + 0x3D)))
  9633. #define UART4_WP7816B_T1 (* ((volatile uint8_t *) (0x400EA000 + 0x3D)))
  9634. //-------------------- UART 7816 ATR Duration Timer Register B
  9635. #define UART_AP7816B_T0(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0x3B)))
  9636. #define UART0_AP7816B_T0 (* ((volatile uint8_t *) (0x4006A000 + 0x3B)))
  9637. #define UART1_AP7816B_T0 (* ((volatile uint8_t *) (0x4006B000 + 0x3B)))
  9638. #define UART2_AP7816B_T0 (* ((volatile uint8_t *) (0x4006C000 + 0x3B)))
  9639. #define UART3_AP7816B_T0 (* ((volatile uint8_t *) (0x4006D000 + 0x3B)))
  9640. #define UART4_AP7816B_T0 (* ((volatile uint8_t *) (0x400EA000 + 0x3B)))
  9641. //-------------------- UART FIFO Transmit Count
  9642. #define UART_TCFIFO(group) (* ((const volatile uint8_t *) (kBaseAddress_UART [group] + 0x14)))
  9643. #define UART0_TCFIFO (* ((const volatile uint8_t *) (0x4006A000 + 0x14)))
  9644. #define UART1_TCFIFO (* ((const volatile uint8_t *) (0x4006B000 + 0x14)))
  9645. #define UART2_TCFIFO (* ((const volatile uint8_t *) (0x4006C000 + 0x14)))
  9646. #define UART3_TCFIFO (* ((const volatile uint8_t *) (0x4006D000 + 0x14)))
  9647. #define UART4_TCFIFO (* ((const volatile uint8_t *) (0x400EA000 + 0x14)))
  9648. //-------------------- UART 7816 Interrupt Enable Register
  9649. #define UART_IE7816(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0x19)))
  9650. #define UART0_IE7816 (* ((volatile uint8_t *) (0x4006A000 + 0x19)))
  9651. #define UART1_IE7816 (* ((volatile uint8_t *) (0x4006B000 + 0x19)))
  9652. #define UART2_IE7816 (* ((volatile uint8_t *) (0x4006C000 + 0x19)))
  9653. #define UART3_IE7816 (* ((volatile uint8_t *) (0x4006D000 + 0x19)))
  9654. #define UART4_IE7816 (* ((volatile uint8_t *) (0x400EA000 + 0x19)))
  9655. // Boolean field: ATR Duration Timer Interrupt Enable
  9656. static const uint8_t UART_IE7816_ADTE = 1U << 3 ;
  9657. // Boolean field: Transmit Threshold Exceeded Interrupt Enable
  9658. static const uint8_t UART_IE7816_TXTE = 1U << 1 ;
  9659. // Boolean field: Character Wait Timer Interrupt Enable
  9660. static const uint8_t UART_IE7816_CWTE = 1U << 6 ;
  9661. // Boolean field: Initial Character Detected Interrupt Enable
  9662. static const uint8_t UART_IE7816_INITDE = 1U << 4 ;
  9663. // Boolean field: Block Wait Timer Interrupt Enable
  9664. static const uint8_t UART_IE7816_BWTE = 1U << 5 ;
  9665. // Boolean field: Wait Timer Interrupt Enable
  9666. static const uint8_t UART_IE7816_WTE = 1U << 7 ;
  9667. // Boolean field: Receive Threshold Exceeded Interrupt Enable
  9668. static const uint8_t UART_IE7816_RXTE = 1U << 0 ;
  9669. // Boolean field: Guard Timer Violated Interrupt Enable
  9670. static const uint8_t UART_IE7816_GTVE = 1U << 2 ;
  9671. //-------------------- UART 7816 Wait FD Register
  9672. #define UART_WF7816(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0x1D)))
  9673. #define UART0_WF7816 (* ((volatile uint8_t *) (0x4006A000 + 0x1D)))
  9674. #define UART1_WF7816 (* ((volatile uint8_t *) (0x4006B000 + 0x1D)))
  9675. #define UART2_WF7816 (* ((volatile uint8_t *) (0x4006C000 + 0x1D)))
  9676. #define UART3_WF7816 (* ((volatile uint8_t *) (0x4006D000 + 0x1D)))
  9677. #define UART4_WF7816 (* ((volatile uint8_t *) (0x400EA000 + 0x1D)))
  9678. //-------------------- UART FIFO Receive Count
  9679. #define UART_RCFIFO(group) (* ((const volatile uint8_t *) (kBaseAddress_UART [group] + 0x16)))
  9680. #define UART0_RCFIFO (* ((const volatile uint8_t *) (0x4006A000 + 0x16)))
  9681. #define UART1_RCFIFO (* ((const volatile uint8_t *) (0x4006B000 + 0x16)))
  9682. #define UART2_RCFIFO (* ((const volatile uint8_t *) (0x4006C000 + 0x16)))
  9683. #define UART3_RCFIFO (* ((const volatile uint8_t *) (0x4006D000 + 0x16)))
  9684. #define UART4_RCFIFO (* ((const volatile uint8_t *) (0x400EA000 + 0x16)))
  9685. //-------------------- UART Modem Register
  9686. #define UART_MODEM(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0xD)))
  9687. #define UART0_MODEM (* ((volatile uint8_t *) (0x4006A000 + 0xD)))
  9688. #define UART1_MODEM (* ((volatile uint8_t *) (0x4006B000 + 0xD)))
  9689. #define UART2_MODEM (* ((volatile uint8_t *) (0x4006C000 + 0xD)))
  9690. #define UART3_MODEM (* ((volatile uint8_t *) (0x4006D000 + 0xD)))
  9691. #define UART4_MODEM (* ((volatile uint8_t *) (0x400EA000 + 0xD)))
  9692. // Boolean field: Transmitter request-to-send enable
  9693. static const uint8_t UART_MODEM_TXRTSE = 1U << 1 ;
  9694. // Boolean field: Transmitter clear-to-send enable
  9695. static const uint8_t UART_MODEM_TXCTSE = 1U << 0 ;
  9696. // Boolean field: Receiver request-to-send enable
  9697. static const uint8_t UART_MODEM_RXRTSE = 1U << 3 ;
  9698. // Boolean field: Transmitter request-to-send polarity
  9699. static const uint8_t UART_MODEM_TXRTSPOL = 1U << 2 ;
  9700. //-------------------- UART 7816 Wait N Register
  9701. #define UART_WN7816(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0x1C)))
  9702. #define UART0_WN7816 (* ((volatile uint8_t *) (0x4006A000 + 0x1C)))
  9703. #define UART1_WN7816 (* ((volatile uint8_t *) (0x4006B000 + 0x1C)))
  9704. #define UART2_WN7816 (* ((volatile uint8_t *) (0x4006C000 + 0x1C)))
  9705. #define UART3_WN7816 (* ((volatile uint8_t *) (0x4006D000 + 0x1C)))
  9706. #define UART4_WN7816 (* ((volatile uint8_t *) (0x400EA000 + 0x1C)))
  9707. //-------------------- UART 7816 Transmit Length Register
  9708. #define UART_TL7816(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0x1F)))
  9709. #define UART0_TL7816 (* ((volatile uint8_t *) (0x4006A000 + 0x1F)))
  9710. #define UART1_TL7816 (* ((volatile uint8_t *) (0x4006B000 + 0x1F)))
  9711. #define UART2_TL7816 (* ((volatile uint8_t *) (0x4006C000 + 0x1F)))
  9712. #define UART3_TL7816 (* ((volatile uint8_t *) (0x4006D000 + 0x1F)))
  9713. #define UART4_TL7816 (* ((volatile uint8_t *) (0x400EA000 + 0x1F)))
  9714. //-------------------- UART Baud Rate Registers: Low
  9715. #define UART_BDL(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0x1)))
  9716. #define UART0_BDL (* ((volatile uint8_t *) (0x4006A000 + 0x1)))
  9717. #define UART1_BDL (* ((volatile uint8_t *) (0x4006B000 + 0x1)))
  9718. #define UART2_BDL (* ((volatile uint8_t *) (0x4006C000 + 0x1)))
  9719. #define UART3_BDL (* ((volatile uint8_t *) (0x4006D000 + 0x1)))
  9720. #define UART4_BDL (* ((volatile uint8_t *) (0x400EA000 + 0x1)))
  9721. //-------------------- UART Control Register 3
  9722. #define UART_C3(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0x6)))
  9723. #define UART0_C3 (* ((volatile uint8_t *) (0x4006A000 + 0x6)))
  9724. #define UART1_C3 (* ((volatile uint8_t *) (0x4006B000 + 0x6)))
  9725. #define UART2_C3 (* ((volatile uint8_t *) (0x4006C000 + 0x6)))
  9726. #define UART3_C3 (* ((volatile uint8_t *) (0x4006D000 + 0x6)))
  9727. #define UART4_C3 (* ((volatile uint8_t *) (0x400EA000 + 0x6)))
  9728. // Boolean field: Parity Error Interrupt Enable
  9729. static const uint8_t UART_C3_PEIE = 1U << 0 ;
  9730. // Boolean field: Transmitter Pin Data Direction in Single-Wire mode
  9731. static const uint8_t UART_C3_TXDIR = 1U << 5 ;
  9732. // Boolean field: Framing Error Interrupt Enable
  9733. static const uint8_t UART_C3_FEIE = 1U << 1 ;
  9734. // Boolean field: Transmit Bit 8
  9735. static const uint8_t UART_C3_T8 = 1U << 6 ;
  9736. // Boolean field: Received Bit 8
  9737. static const uint8_t UART_C3_R8 = 1U << 7 ;
  9738. // Boolean field: Noise Error Interrupt Enable
  9739. static const uint8_t UART_C3_NEIE = 1U << 2 ;
  9740. // Boolean field: Transmit Data Inversion.
  9741. static const uint8_t UART_C3_TXINV = 1U << 4 ;
  9742. // Boolean field: Overrun Error Interrupt Enable
  9743. static const uint8_t UART_C3_ORIE = 1U << 3 ;
  9744. //-------------------- UART Control Register 2
  9745. #define UART_C2(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0x3)))
  9746. #define UART0_C2 (* ((volatile uint8_t *) (0x4006A000 + 0x3)))
  9747. #define UART1_C2 (* ((volatile uint8_t *) (0x4006B000 + 0x3)))
  9748. #define UART2_C2 (* ((volatile uint8_t *) (0x4006C000 + 0x3)))
  9749. #define UART3_C2 (* ((volatile uint8_t *) (0x4006D000 + 0x3)))
  9750. #define UART4_C2 (* ((volatile uint8_t *) (0x400EA000 + 0x3)))
  9751. // Boolean field: Transmitter Enable
  9752. static const uint8_t UART_C2_TE = 1U << 3 ;
  9753. // Boolean field: Idle Line Interrupt Enable
  9754. static const uint8_t UART_C2_ILIE = 1U << 4 ;
  9755. // Boolean field: Receiver Enable
  9756. static const uint8_t UART_C2_RE = 1U << 2 ;
  9757. // Boolean field: Receiver Wakeup Control
  9758. static const uint8_t UART_C2_RWU = 1U << 1 ;
  9759. // Boolean field: Transmitter Interrupt or DMA Transfer Enable.
  9760. static const uint8_t UART_C2_TIE = 1U << 7 ;
  9761. // Boolean field: Send Break
  9762. static const uint8_t UART_C2_SBK = 1U << 0 ;
  9763. // Boolean field: Receiver Full Interrupt or DMA Transfer Enable
  9764. static const uint8_t UART_C2_RIE = 1U << 5 ;
  9765. // Boolean field: Transmission Complete Interrupt Enable
  9766. static const uint8_t UART_C2_TCIE = 1U << 6 ;
  9767. //-------------------- UART Control Register 1
  9768. #define UART_C1(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0x2)))
  9769. #define UART0_C1 (* ((volatile uint8_t *) (0x4006A000 + 0x2)))
  9770. #define UART1_C1 (* ((volatile uint8_t *) (0x4006B000 + 0x2)))
  9771. #define UART2_C1 (* ((volatile uint8_t *) (0x4006C000 + 0x2)))
  9772. #define UART3_C1 (* ((volatile uint8_t *) (0x4006D000 + 0x2)))
  9773. #define UART4_C1 (* ((volatile uint8_t *) (0x400EA000 + 0x2)))
  9774. // Boolean field: UART Stops in Wait Mode
  9775. static const uint8_t UART_C1_UARTSWAI = 1U << 6 ;
  9776. // Boolean field: Parity Type
  9777. static const uint8_t UART_C1_PT = 1U << 0 ;
  9778. // Boolean field: 9-bit or 8-bit Mode Select
  9779. static const uint8_t UART_C1_M = 1U << 4 ;
  9780. // Boolean field: Receiver Source Select
  9781. static const uint8_t UART_C1_RSRC = 1U << 5 ;
  9782. // Boolean field: Idle Line Type Select
  9783. static const uint8_t UART_C1_ILT = 1U << 2 ;
  9784. // Boolean field: Receiver Wakeup Method Select
  9785. static const uint8_t UART_C1_WAKE = 1U << 3 ;
  9786. // Boolean field: Parity Enable
  9787. static const uint8_t UART_C1_PE = 1U << 1 ;
  9788. // Boolean field: Loop Mode Select
  9789. static const uint8_t UART_C1_LOOPS = 1U << 7 ;
  9790. //-------------------- UART Control Register 5
  9791. #define UART_C5(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0xB)))
  9792. #define UART0_C5 (* ((volatile uint8_t *) (0x4006A000 + 0xB)))
  9793. #define UART1_C5 (* ((volatile uint8_t *) (0x4006B000 + 0xB)))
  9794. #define UART2_C5 (* ((volatile uint8_t *) (0x4006C000 + 0xB)))
  9795. #define UART3_C5 (* ((volatile uint8_t *) (0x4006D000 + 0xB)))
  9796. #define UART4_C5 (* ((volatile uint8_t *) (0x400EA000 + 0xB)))
  9797. // Boolean field: Transmitter DMA Select
  9798. static const uint8_t UART_C5_TDMAS = 1U << 7 ;
  9799. // Boolean field: Receiver Full DMA Select
  9800. static const uint8_t UART_C5_RDMAS = 1U << 5 ;
  9801. //-------------------- UART Control Register 4
  9802. #define UART_C4(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0xA)))
  9803. #define UART0_C4 (* ((volatile uint8_t *) (0x4006A000 + 0xA)))
  9804. #define UART1_C4 (* ((volatile uint8_t *) (0x4006B000 + 0xA)))
  9805. #define UART2_C4 (* ((volatile uint8_t *) (0x4006C000 + 0xA)))
  9806. #define UART3_C4 (* ((volatile uint8_t *) (0x4006D000 + 0xA)))
  9807. #define UART4_C4 (* ((volatile uint8_t *) (0x400EA000 + 0xA)))
  9808. // Boolean field: 10-bit Mode select
  9809. static const uint8_t UART_C4_M10 = 1U << 5 ;
  9810. // Field (width: 5 bits): Baud Rate Fine Adjust
  9811. inline uint8_t UART_C4_BRFA (const uint8_t inValue) { return (inValue & 31U) << 0 ; }
  9812. // Boolean field: Match Address Mode Enable 1
  9813. static const uint8_t UART_C4_MAEN1 = 1U << 7 ;
  9814. // Boolean field: Match Address Mode Enable 2
  9815. static const uint8_t UART_C4_MAEN2 = 1U << 6 ;
  9816. //-------------------- UART 7816 Wait Parameter Register
  9817. #define UART_WP7816(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0x1B)))
  9818. #define UART0_WP7816 (* ((volatile uint8_t *) (0x4006A000 + 0x1B)))
  9819. #define UART1_WP7816 (* ((volatile uint8_t *) (0x4006B000 + 0x1B)))
  9820. #define UART2_WP7816 (* ((volatile uint8_t *) (0x4006C000 + 0x1B)))
  9821. #define UART3_WP7816 (* ((volatile uint8_t *) (0x4006D000 + 0x1B)))
  9822. #define UART4_WP7816 (* ((volatile uint8_t *) (0x400EA000 + 0x1B)))
  9823. //-------------------- UART Data Register
  9824. #define UART_D(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0x7)))
  9825. #define UART0_D (* ((volatile uint8_t *) (0x4006A000 + 0x7)))
  9826. #define UART1_D (* ((volatile uint8_t *) (0x4006B000 + 0x7)))
  9827. #define UART2_D (* ((volatile uint8_t *) (0x4006C000 + 0x7)))
  9828. #define UART3_D (* ((volatile uint8_t *) (0x4006D000 + 0x7)))
  9829. #define UART4_D (* ((volatile uint8_t *) (0x400EA000 + 0x7)))
  9830. //-------------------- UART Extended Data Register
  9831. #define UART_ED(group) (* ((const volatile uint8_t *) (kBaseAddress_UART [group] + 0xC)))
  9832. #define UART0_ED (* ((const volatile uint8_t *) (0x4006A000 + 0xC)))
  9833. #define UART1_ED (* ((const volatile uint8_t *) (0x4006B000 + 0xC)))
  9834. #define UART2_ED (* ((const volatile uint8_t *) (0x4006C000 + 0xC)))
  9835. #define UART3_ED (* ((const volatile uint8_t *) (0x4006D000 + 0xC)))
  9836. #define UART4_ED (* ((const volatile uint8_t *) (0x400EA000 + 0xC)))
  9837. // Boolean field: The current received dataword contained in D and C3[R8] was received with noise.
  9838. static const uint8_t UART_ED_NOISY = 1U << 7 ;
  9839. // Boolean field: The current received dataword contained in D and C3[R8] was received with a parity error.
  9840. static const uint8_t UART_ED_PARITYE = 1U << 6 ;
  9841. //-------------------- UART Infrared Register
  9842. #define UART_IR(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0xE)))
  9843. #define UART0_IR (* ((volatile uint8_t *) (0x4006A000 + 0xE)))
  9844. #define UART1_IR (* ((volatile uint8_t *) (0x4006B000 + 0xE)))
  9845. #define UART2_IR (* ((volatile uint8_t *) (0x4006C000 + 0xE)))
  9846. #define UART3_IR (* ((volatile uint8_t *) (0x4006D000 + 0xE)))
  9847. #define UART4_IR (* ((volatile uint8_t *) (0x400EA000 + 0xE)))
  9848. // Boolean field: Infrared enable
  9849. static const uint8_t UART_IR_IREN = 1U << 2 ;
  9850. // Field (width: 2 bits): Transmitter narrow pulse
  9851. inline uint8_t UART_IR_TNP (const uint8_t inValue) { return (inValue & 3U) << 0 ; }
  9852. //-------------------- UART Baud Rate Registers: High
  9853. #define UART_BDH(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0)))
  9854. #define UART0_BDH (* ((volatile uint8_t *) (0x4006A000 + 0)))
  9855. #define UART1_BDH (* ((volatile uint8_t *) (0x4006B000 + 0)))
  9856. #define UART2_BDH (* ((volatile uint8_t *) (0x4006C000 + 0)))
  9857. #define UART3_BDH (* ((volatile uint8_t *) (0x4006D000 + 0)))
  9858. #define UART4_BDH (* ((volatile uint8_t *) (0x400EA000 + 0)))
  9859. // Field (width: 5 bits): UART Baud Rate Bits
  9860. inline uint8_t UART_BDH_SBR (const uint8_t inValue) { return (inValue & 31U) << 0 ; }
  9861. // Boolean field: Stop Bit Number Select
  9862. static const uint8_t UART_BDH_SBNS = 1U << 5 ;
  9863. // Boolean field: RxD Input Active Edge Interrupt Enable
  9864. static const uint8_t UART_BDH_RXEDGIE = 1U << 6 ;
  9865. // Boolean field: LIN Break Detect Interrupt Enable
  9866. static const uint8_t UART_BDH_LBKDIE = 1U << 7 ;
  9867. //-------------------- UART FIFO Receive Watermark
  9868. #define UART_RWFIFO(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0x15)))
  9869. #define UART0_RWFIFO (* ((volatile uint8_t *) (0x4006A000 + 0x15)))
  9870. #define UART1_RWFIFO (* ((volatile uint8_t *) (0x4006B000 + 0x15)))
  9871. #define UART2_RWFIFO (* ((volatile uint8_t *) (0x4006C000 + 0x15)))
  9872. #define UART3_RWFIFO (* ((volatile uint8_t *) (0x4006D000 + 0x15)))
  9873. #define UART4_RWFIFO (* ((volatile uint8_t *) (0x400EA000 + 0x15)))
  9874. //-------------------- UART 7816 Control Register
  9875. #define UART_C7816(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0x18)))
  9876. #define UART0_C7816 (* ((volatile uint8_t *) (0x4006A000 + 0x18)))
  9877. #define UART1_C7816 (* ((volatile uint8_t *) (0x4006B000 + 0x18)))
  9878. #define UART2_C7816 (* ((volatile uint8_t *) (0x4006C000 + 0x18)))
  9879. #define UART3_C7816 (* ((volatile uint8_t *) (0x4006D000 + 0x18)))
  9880. #define UART4_C7816 (* ((volatile uint8_t *) (0x400EA000 + 0x18)))
  9881. // Boolean field: Transfer Type
  9882. static const uint8_t UART_C7816_TTYPE = 1U << 1 ;
  9883. // Boolean field: Detect Initial Character
  9884. static const uint8_t UART_C7816_INIT = 1U << 2 ;
  9885. // Boolean field: Generate NACK on Error
  9886. static const uint8_t UART_C7816_ANACK = 1U << 3 ;
  9887. // Boolean field: ISO-7816 Functionality Enabled
  9888. static const uint8_t UART_C7816_ISO_7816E = 1U << 0 ;
  9889. // Boolean field: Generate NACK on Overflow
  9890. static const uint8_t UART_C7816_ONACK = 1U << 4 ;
  9891. //-------------------- UART 7816 ATR Duration Timer Register A
  9892. #define UART_AP7816A_T0(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0x3A)))
  9893. #define UART0_AP7816A_T0 (* ((volatile uint8_t *) (0x4006A000 + 0x3A)))
  9894. #define UART1_AP7816A_T0 (* ((volatile uint8_t *) (0x4006B000 + 0x3A)))
  9895. #define UART2_AP7816A_T0 (* ((volatile uint8_t *) (0x4006C000 + 0x3A)))
  9896. #define UART3_AP7816A_T0 (* ((volatile uint8_t *) (0x4006D000 + 0x3A)))
  9897. #define UART4_AP7816A_T0 (* ((volatile uint8_t *) (0x400EA000 + 0x3A)))
  9898. //-------------------- UART 7816 Wait Parameter Register A
  9899. #define UART_WP7816A_T1(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0x3C)))
  9900. #define UART0_WP7816A_T1 (* ((volatile uint8_t *) (0x4006A000 + 0x3C)))
  9901. #define UART1_WP7816A_T1 (* ((volatile uint8_t *) (0x4006B000 + 0x3C)))
  9902. #define UART2_WP7816A_T1 (* ((volatile uint8_t *) (0x4006C000 + 0x3C)))
  9903. #define UART3_WP7816A_T1 (* ((volatile uint8_t *) (0x4006D000 + 0x3C)))
  9904. #define UART4_WP7816A_T1 (* ((volatile uint8_t *) (0x400EA000 + 0x3C)))
  9905. //-------------------- UART 7816 Wait Parameter Register A
  9906. #define UART_WP7816A_T0(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0x3C)))
  9907. #define UART0_WP7816A_T0 (* ((volatile uint8_t *) (0x4006A000 + 0x3C)))
  9908. #define UART1_WP7816A_T0 (* ((volatile uint8_t *) (0x4006B000 + 0x3C)))
  9909. #define UART2_WP7816A_T0 (* ((volatile uint8_t *) (0x4006C000 + 0x3C)))
  9910. #define UART3_WP7816A_T0 (* ((volatile uint8_t *) (0x4006D000 + 0x3C)))
  9911. #define UART4_WP7816A_T0 (* ((volatile uint8_t *) (0x400EA000 + 0x3C)))
  9912. //-------------------- UART FIFO Parameters
  9913. #define UART_PFIFO(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0x10)))
  9914. #define UART0_PFIFO (* ((volatile uint8_t *) (0x4006A000 + 0x10)))
  9915. #define UART1_PFIFO (* ((volatile uint8_t *) (0x4006B000 + 0x10)))
  9916. #define UART2_PFIFO (* ((volatile uint8_t *) (0x4006C000 + 0x10)))
  9917. #define UART3_PFIFO (* ((volatile uint8_t *) (0x4006D000 + 0x10)))
  9918. #define UART4_PFIFO (* ((volatile uint8_t *) (0x400EA000 + 0x10)))
  9919. // Boolean field: Transmit FIFO Enable
  9920. static const uint8_t UART_PFIFO_TXFE = 1U << 7 ;
  9921. // Field (width: 3 bits): Transmit FIFO. Buffer Depth
  9922. inline uint8_t UART_PFIFO_TXFIFOSIZE (const uint8_t inValue) { return (inValue & 7U) << 4 ; }
  9923. // Field (width: 3 bits): Receive FIFO. Buffer Depth
  9924. inline uint8_t UART_PFIFO_RXFIFOSIZE (const uint8_t inValue) { return (inValue & 7U) << 0 ; }
  9925. // Boolean field: Receive FIFO Enable
  9926. static const uint8_t UART_PFIFO_RXFE = 1U << 3 ;
  9927. //-------------------- UART 7816 Wait and Guard Parameter Register
  9928. #define UART_WGP7816_T1(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0x3E)))
  9929. #define UART0_WGP7816_T1 (* ((volatile uint8_t *) (0x4006A000 + 0x3E)))
  9930. #define UART1_WGP7816_T1 (* ((volatile uint8_t *) (0x4006B000 + 0x3E)))
  9931. #define UART2_WGP7816_T1 (* ((volatile uint8_t *) (0x4006C000 + 0x3E)))
  9932. #define UART3_WGP7816_T1 (* ((volatile uint8_t *) (0x4006D000 + 0x3E)))
  9933. #define UART4_WGP7816_T1 (* ((volatile uint8_t *) (0x400EA000 + 0x3E)))
  9934. // Field (width: 4 bits): Block Guard Time Integer (C7816[TTYPE] = 1)
  9935. inline uint8_t UART_WGP7816_T1_BGI (const uint8_t inValue) { return (inValue & 15U) << 0 ; }
  9936. // Field (width: 4 bits): Character Wait Time Integer 1 (C7816[TTYPE] = 1)
  9937. inline uint8_t UART_WGP7816_T1_CWI1 (const uint8_t inValue) { return (inValue & 15U) << 4 ; }
  9938. //-------------------- UART FIFO Control Register
  9939. #define UART_CFIFO(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0x11)))
  9940. #define UART0_CFIFO (* ((volatile uint8_t *) (0x4006A000 + 0x11)))
  9941. #define UART1_CFIFO (* ((volatile uint8_t *) (0x4006B000 + 0x11)))
  9942. #define UART2_CFIFO (* ((volatile uint8_t *) (0x4006C000 + 0x11)))
  9943. #define UART3_CFIFO (* ((volatile uint8_t *) (0x4006D000 + 0x11)))
  9944. #define UART4_CFIFO (* ((volatile uint8_t *) (0x400EA000 + 0x11)))
  9945. // Boolean field: Receive FIFO Underflow Interrupt Enable
  9946. static const uint8_t UART_CFIFO_RXUFE = 1U << 0 ;
  9947. // Boolean field: Receive FIFO Overflow Interrupt Enable
  9948. static const uint8_t UART_CFIFO_RXOFE = 1U << 2 ;
  9949. // Boolean field: Transmit FIFO Overflow Interrupt Enable
  9950. static const uint8_t UART_CFIFO_TXOFE = 1U << 1 ;
  9951. // Boolean field: Receive FIFO/Buffer Flush
  9952. static const uint8_t UART_CFIFO_RXFLUSH = 1U << 6 ;
  9953. // Boolean field: Transmit FIFO/Buffer Flush
  9954. static const uint8_t UART_CFIFO_TXFLUSH = 1U << 7 ;
  9955. //-------------------- UART 7816 Wait Parameter Register C
  9956. #define UART_WP7816C_T1(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0x3F)))
  9957. #define UART0_WP7816C_T1 (* ((volatile uint8_t *) (0x4006A000 + 0x3F)))
  9958. #define UART1_WP7816C_T1 (* ((volatile uint8_t *) (0x4006B000 + 0x3F)))
  9959. #define UART2_WP7816C_T1 (* ((volatile uint8_t *) (0x4006C000 + 0x3F)))
  9960. #define UART3_WP7816C_T1 (* ((volatile uint8_t *) (0x4006D000 + 0x3F)))
  9961. #define UART4_WP7816C_T1 (* ((volatile uint8_t *) (0x400EA000 + 0x3F)))
  9962. // Field (width: 5 bits): Character Wait Time Integer 2 (C7816[TTYPE] = 1)
  9963. inline uint8_t UART_WP7816C_T1_CWI2 (const uint8_t inValue) { return (inValue & 31U) << 0 ; }
  9964. //-------------------- UART 7816 Interrupt Status Register
  9965. #define UART_IS7816(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0x1A)))
  9966. #define UART0_IS7816 (* ((volatile uint8_t *) (0x4006A000 + 0x1A)))
  9967. #define UART1_IS7816 (* ((volatile uint8_t *) (0x4006B000 + 0x1A)))
  9968. #define UART2_IS7816 (* ((volatile uint8_t *) (0x4006C000 + 0x1A)))
  9969. #define UART3_IS7816 (* ((volatile uint8_t *) (0x4006D000 + 0x1A)))
  9970. #define UART4_IS7816 (* ((volatile uint8_t *) (0x400EA000 + 0x1A)))
  9971. // Boolean field: ATR Duration Time Interrupt
  9972. static const uint8_t UART_IS7816_ADT = 1U << 3 ;
  9973. // Boolean field: Initial Character Detected Interrupt
  9974. static const uint8_t UART_IS7816_INITD = 1U << 4 ;
  9975. // Boolean field: Block Wait Timer Interrupt
  9976. static const uint8_t UART_IS7816_BWT = 1U << 5 ;
  9977. // Boolean field: Character Wait Timer Interrupt
  9978. static const uint8_t UART_IS7816_CWT = 1U << 6 ;
  9979. // Boolean field: Wait Timer Interrupt
  9980. static const uint8_t UART_IS7816_WT = 1U << 7 ;
  9981. // Boolean field: Guard Timer Violated Interrupt
  9982. static const uint8_t UART_IS7816_GTV = 1U << 2 ;
  9983. // Boolean field: Transmit Threshold Exceeded Interrupt
  9984. static const uint8_t UART_IS7816_TXT = 1U << 1 ;
  9985. // Boolean field: Receive Threshold Exceeded Interrupt
  9986. static const uint8_t UART_IS7816_RXT = 1U << 0 ;
  9987. //-------------------- UART 7816 Error Threshold Register
  9988. #define UART_ET7816(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0x1E)))
  9989. #define UART0_ET7816 (* ((volatile uint8_t *) (0x4006A000 + 0x1E)))
  9990. #define UART1_ET7816 (* ((volatile uint8_t *) (0x4006B000 + 0x1E)))
  9991. #define UART2_ET7816 (* ((volatile uint8_t *) (0x4006C000 + 0x1E)))
  9992. #define UART3_ET7816 (* ((volatile uint8_t *) (0x4006D000 + 0x1E)))
  9993. #define UART4_ET7816 (* ((volatile uint8_t *) (0x400EA000 + 0x1E)))
  9994. // Field (width: 4 bits): Receive NACK Threshold
  9995. inline uint8_t UART_ET7816_RXTHRESHOLD (const uint8_t inValue) { return (inValue & 15U) << 0 ; }
  9996. // Field (width: 4 bits): Transmit NACK Threshold
  9997. inline uint8_t UART_ET7816_TXTHRESHOLD (const uint8_t inValue) { return (inValue & 15U) << 4 ; }
  9998. //-------------------- UART FIFO Transmit Watermark
  9999. #define UART_TWFIFO(group) (* ((volatile uint8_t *) (kBaseAddress_UART [group] + 0x13)))
  10000. #define UART0_TWFIFO (* ((volatile uint8_t *) (0x4006A000 + 0x13)))
  10001. #define UART1_TWFIFO (* ((volatile uint8_t *) (0x4006B000 + 0x13)))
  10002. #define UART2_TWFIFO (* ((volatile uint8_t *) (0x4006C000 + 0x13)))
  10003. #define UART3_TWFIFO (* ((volatile uint8_t *) (0x4006D000 + 0x13)))
  10004. #define UART4_TWFIFO (* ((volatile uint8_t *) (0x400EA000 + 0x13)))
  10005. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  10006. // INTERRUPTS
  10007. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  10008. enum class ISRSlot : uint8_t {
  10009. ADC0 = 39,
  10010. ADC1 = 73,
  10011. CAN0_Bus_Off = 76,
  10012. CAN0_Error = 77,
  10013. CAN0_ORed_Message_buffer = 75,
  10014. CAN0_Rx_Warning = 79,
  10015. CAN0_Tx_Warning = 78,
  10016. CAN0_Wake_Up = 80,
  10017. CAN1_Bus_Off = 95,
  10018. CAN1_Error = 96,
  10019. CAN1_ORed_Message_buffer = 94,
  10020. CAN1_Rx_Warning = 98,
  10021. CAN1_Tx_Warning = 97,
  10022. CAN1_Wake_Up = 99,
  10023. CMP0 = 40,
  10024. CMP1 = 41,
  10025. CMP2 = 70,
  10026. CMP3 = 92,
  10027. CMT = 45,
  10028. DAC0 = 56,
  10029. DAC1 = 72,
  10030. DMA0_DMA16 = 0,
  10031. DMA10_DMA26 = 10,
  10032. DMA11_DMA27 = 11,
  10033. DMA12_DMA28 = 12,
  10034. DMA13_DMA29 = 13,
  10035. DMA14_DMA30 = 14,
  10036. DMA15_DMA31 = 15,
  10037. DMA1_DMA17 = 1,
  10038. DMA2_DMA18 = 2,
  10039. DMA3_DMA19 = 3,
  10040. DMA4_DMA20 = 4,
  10041. DMA5_DMA21 = 5,
  10042. DMA6_DMA22 = 6,
  10043. DMA7_DMA23 = 7,
  10044. DMA8_DMA24 = 8,
  10045. DMA9_DMA25 = 9,
  10046. DMA_Error = 16,
  10047. ENET_1588_Timer = 82,
  10048. ENET_Error = 85,
  10049. ENET_Receive = 84,
  10050. ENET_Transmit = 83,
  10051. FTFE = 18,
  10052. FTM0 = 42,
  10053. FTM1 = 43,
  10054. FTM2 = 44,
  10055. FTM3 = 71,
  10056. I2C0 = 24,
  10057. I2C1 = 25,
  10058. I2C2 = 74,
  10059. I2C3 = 91,
  10060. I2S0_Rx = 29,
  10061. I2S0_Tx = 28,
  10062. LLWU = 21,
  10063. LPTMR0 = 58,
  10064. LPUART0 = 86,
  10065. LVD_LVW = 20,
  10066. MCG = 57,
  10067. MCM = 17,
  10068. PDB0 = 52,
  10069. PIT0 = 48,
  10070. PIT1 = 49,
  10071. PIT2 = 50,
  10072. PIT3 = 51,
  10073. PORTA = 59,
  10074. PORTB = 60,
  10075. PORTC = 61,
  10076. PORTD = 62,
  10077. PORTE = 63,
  10078. RNG = 23,
  10079. RTC = 46,
  10080. RTC_Seconds = 47,
  10081. Read_Collision = 19,
  10082. SDHC = 81,
  10083. SPI0 = 26,
  10084. SPI1 = 27,
  10085. SPI2 = 65,
  10086. TPM1 = 88,
  10087. TPM2 = 89,
  10088. TSI0 = 87,
  10089. UART0_ERR = 32,
  10090. UART0_RX_TX = 31,
  10091. UART1_ERR = 34,
  10092. UART1_RX_TX = 33,
  10093. UART2_ERR = 36,
  10094. UART2_RX_TX = 35,
  10095. UART3_ERR = 38,
  10096. UART3_RX_TX = 37,
  10097. UART4_ERR = 67,
  10098. UART4_RX_TX = 66,
  10099. USB0 = 53,
  10100. USBDCD = 54,
  10101. USBHS = 93,
  10102. USBHSDCD = 90,
  10103. WDOG_EWM = 22,
  10104. } ;
  10105. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  10106. inline void NVIC_ENABLE_IRQ (const ISRSlot inInterrupt) {
  10107. const uint32_t it = static_cast <uint32_t> (inInterrupt) ;
  10108. *((volatile uint32_t *) (0xE000E100 + 4 * (it >> 5))) = 1U << (it & 31) ;
  10109. }
  10110. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  10111. inline void NVIC_DISABLE_IRQ (const ISRSlot inInterrupt) {
  10112. const uint32_t it = static_cast <uint32_t> (inInterrupt) ;
  10113. *((volatile uint32_t *) (0xE000E180 + 4 * (it >> 5))) = 1U << (it & 31) ;
  10114. }
  10115. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  10116. // BITBAND
  10117. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  10118. inline void bitband32 (const volatile uint32_t & inRegister, const uint8_t inBit, const bool inValue) {
  10119. const uint32_t address = ((uint32_t) &inRegister - 0x40000000) * 32 + ((uint32_t) inBit) * 4 + 0x42000000 ;
  10120. volatile uint32_t * ptr = (volatile uint32_t *) address ;
  10121. *ptr = (uint32_t) inValue ;
  10122. }
  10123. //——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————