stm32f469xx.h 751 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146
  1. /**
  2. ******************************************************************************
  3. * @file stm32f469xx.h
  4. * @author MCD Application Team
  5. * @version V2.4.2
  6. * @date 13-November-2015
  7. * @brief CMSIS STM32F469xx Device Peripheral Access Layer Header File.
  8. *
  9. * This file contains:
  10. * - Data structures and the address mapping for all peripherals
  11. * - Peripheral's registers declarations and bits definition
  12. * - Macros to access peripheral’s registers hardware
  13. *
  14. ******************************************************************************
  15. * @attention
  16. *
  17. * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
  18. *
  19. * Redistribution and use in source and binary forms, with or without modification,
  20. * are permitted provided that the following conditions are met:
  21. * 1. Redistributions of source code must retain the above copyright notice,
  22. * this list of conditions and the following disclaimer.
  23. * 2. Redistributions in binary form must reproduce the above copyright notice,
  24. * this list of conditions and the following disclaimer in the documentation
  25. * and/or other materials provided with the distribution.
  26. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  27. * may be used to endorse or promote products derived from this software
  28. * without specific prior written permission.
  29. *
  30. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  31. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  32. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  33. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  34. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  35. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  36. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  37. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  38. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  39. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  40. *
  41. ******************************************************************************
  42. */
  43. /** @addtogroup CMSIS_Device
  44. * @{
  45. */
  46. /** @addtogroup stm32f469xx
  47. * @{
  48. */
  49. #ifndef __STM32F469xx_H
  50. #define __STM32F469xx_H
  51. #ifdef __cplusplus
  52. extern "C" {
  53. #endif /* __cplusplus */
  54. /** @addtogroup Configuration_section_for_CMSIS
  55. * @{
  56. */
  57. /**
  58. * @brief Configuration of the Cortex-M4 Processor and Core Peripherals
  59. */
  60. #define __CM4_REV 0x0001 /*!< Core revision r0p1 */
  61. #define __MPU_PRESENT 1 /*!< STM32F4XX provides an MPU */
  62. #define __NVIC_PRIO_BITS 4 /*!< STM32F4XX uses 4 Bits for the Priority Levels */
  63. #define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
  64. #define __FPU_PRESENT 1 /*!< FPU present */
  65. /**
  66. * @}
  67. */
  68. /** @addtogroup Peripheral_interrupt_number_definition
  69. * @{
  70. */
  71. /**
  72. * @brief STM32F4XX Interrupt Number Definition, according to the selected device
  73. * in @ref Library_configuration_section
  74. */
  75. typedef enum
  76. {
  77. /****** Cortex-M4 Processor Exceptions Numbers ****************************************************************/
  78. NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */
  79. MemoryManagement_IRQn = -12, /*!< 4 Cortex-M4 Memory Management Interrupt */
  80. BusFault_IRQn = -11, /*!< 5 Cortex-M4 Bus Fault Interrupt */
  81. UsageFault_IRQn = -10, /*!< 6 Cortex-M4 Usage Fault Interrupt */
  82. SVCall_IRQn = -5, /*!< 11 Cortex-M4 SV Call Interrupt */
  83. DebugMonitor_IRQn = -4, /*!< 12 Cortex-M4 Debug Monitor Interrupt */
  84. PendSV_IRQn = -2, /*!< 14 Cortex-M4 Pend SV Interrupt */
  85. SysTick_IRQn = -1, /*!< 15 Cortex-M4 System Tick Interrupt */
  86. /****** STM32 specific Interrupt Numbers **********************************************************************/
  87. WWDG_IRQn = 0, /*!< Window WatchDog Interrupt */
  88. PVD_IRQn = 1, /*!< PVD through EXTI Line detection Interrupt */
  89. TAMP_STAMP_IRQn = 2, /*!< Tamper and TimeStamp interrupts through the EXTI line */
  90. RTC_WKUP_IRQn = 3, /*!< RTC Wakeup interrupt through the EXTI line */
  91. FLASH_IRQn = 4, /*!< FLASH global Interrupt */
  92. RCC_IRQn = 5, /*!< RCC global Interrupt */
  93. EXTI0_IRQn = 6, /*!< EXTI Line0 Interrupt */
  94. EXTI1_IRQn = 7, /*!< EXTI Line1 Interrupt */
  95. EXTI2_IRQn = 8, /*!< EXTI Line2 Interrupt */
  96. EXTI3_IRQn = 9, /*!< EXTI Line3 Interrupt */
  97. EXTI4_IRQn = 10, /*!< EXTI Line4 Interrupt */
  98. DMA1_Stream0_IRQn = 11, /*!< DMA1 Stream 0 global Interrupt */
  99. DMA1_Stream1_IRQn = 12, /*!< DMA1 Stream 1 global Interrupt */
  100. DMA1_Stream2_IRQn = 13, /*!< DMA1 Stream 2 global Interrupt */
  101. DMA1_Stream3_IRQn = 14, /*!< DMA1 Stream 3 global Interrupt */
  102. DMA1_Stream4_IRQn = 15, /*!< DMA1 Stream 4 global Interrupt */
  103. DMA1_Stream5_IRQn = 16, /*!< DMA1 Stream 5 global Interrupt */
  104. DMA1_Stream6_IRQn = 17, /*!< DMA1 Stream 6 global Interrupt */
  105. ADC_IRQn = 18, /*!< ADC1, ADC2 and ADC3 global Interrupts */
  106. CAN1_TX_IRQn = 19, /*!< CAN1 TX Interrupt */
  107. CAN1_RX0_IRQn = 20, /*!< CAN1 RX0 Interrupt */
  108. CAN1_RX1_IRQn = 21, /*!< CAN1 RX1 Interrupt */
  109. CAN1_SCE_IRQn = 22, /*!< CAN1 SCE Interrupt */
  110. EXTI9_5_IRQn = 23, /*!< External Line[9:5] Interrupts */
  111. TIM1_BRK_TIM9_IRQn = 24, /*!< TIM1 Break interrupt and TIM9 global interrupt */
  112. TIM1_UP_TIM10_IRQn = 25, /*!< TIM1 Update Interrupt and TIM10 global interrupt */
  113. TIM1_TRG_COM_TIM11_IRQn = 26, /*!< TIM1 Trigger and Commutation Interrupt and TIM11 global interrupt */
  114. TIM1_CC_IRQn = 27, /*!< TIM1 Capture Compare Interrupt */
  115. TIM2_IRQn = 28, /*!< TIM2 global Interrupt */
  116. TIM3_IRQn = 29, /*!< TIM3 global Interrupt */
  117. TIM4_IRQn = 30, /*!< TIM4 global Interrupt */
  118. I2C1_EV_IRQn = 31, /*!< I2C1 Event Interrupt */
  119. I2C1_ER_IRQn = 32, /*!< I2C1 Error Interrupt */
  120. I2C2_EV_IRQn = 33, /*!< I2C2 Event Interrupt */
  121. I2C2_ER_IRQn = 34, /*!< I2C2 Error Interrupt */
  122. SPI1_IRQn = 35, /*!< SPI1 global Interrupt */
  123. SPI2_IRQn = 36, /*!< SPI2 global Interrupt */
  124. USART1_IRQn = 37, /*!< USART1 global Interrupt */
  125. USART2_IRQn = 38, /*!< USART2 global Interrupt */
  126. USART3_IRQn = 39, /*!< USART3 global Interrupt */
  127. EXTI15_10_IRQn = 40, /*!< External Line[15:10] Interrupts */
  128. RTC_Alarm_IRQn = 41, /*!< RTC Alarm (A and B) through EXTI Line Interrupt */
  129. OTG_FS_WKUP_IRQn = 42, /*!< USB OTG FS Wakeup through EXTI line interrupt */
  130. TIM8_BRK_TIM12_IRQn = 43, /*!< TIM8 Break Interrupt and TIM12 global interrupt */
  131. TIM8_UP_TIM13_IRQn = 44, /*!< TIM8 Update Interrupt and TIM13 global interrupt */
  132. TIM8_TRG_COM_TIM14_IRQn = 45, /*!< TIM8 Trigger and Commutation Interrupt and TIM14 global interrupt */
  133. TIM8_CC_IRQn = 46, /*!< TIM8 Capture Compare global interrupt */
  134. DMA1_Stream7_IRQn = 47, /*!< DMA1 Stream7 Interrupt */
  135. FMC_IRQn = 48, /*!< FMC global Interrupt */
  136. SDIO_IRQn = 49, /*!< SDIO global Interrupt */
  137. TIM5_IRQn = 50, /*!< TIM5 global Interrupt */
  138. SPI3_IRQn = 51, /*!< SPI3 global Interrupt */
  139. UART4_IRQn = 52, /*!< UART4 global Interrupt */
  140. UART5_IRQn = 53, /*!< UART5 global Interrupt */
  141. TIM6_DAC_IRQn = 54, /*!< TIM6 global and DAC1&2 underrun error interrupts */
  142. TIM7_IRQn = 55, /*!< TIM7 global interrupt */
  143. DMA2_Stream0_IRQn = 56, /*!< DMA2 Stream 0 global Interrupt */
  144. DMA2_Stream1_IRQn = 57, /*!< DMA2 Stream 1 global Interrupt */
  145. DMA2_Stream2_IRQn = 58, /*!< DMA2 Stream 2 global Interrupt */
  146. DMA2_Stream3_IRQn = 59, /*!< DMA2 Stream 3 global Interrupt */
  147. DMA2_Stream4_IRQn = 60, /*!< DMA2 Stream 4 global Interrupt */
  148. ETH_IRQn = 61, /*!< Ethernet global Interrupt */
  149. ETH_WKUP_IRQn = 62, /*!< Ethernet Wakeup through EXTI line Interrupt */
  150. CAN2_TX_IRQn = 63, /*!< CAN2 TX Interrupt */
  151. CAN2_RX0_IRQn = 64, /*!< CAN2 RX0 Interrupt */
  152. CAN2_RX1_IRQn = 65, /*!< CAN2 RX1 Interrupt */
  153. CAN2_SCE_IRQn = 66, /*!< CAN2 SCE Interrupt */
  154. OTG_FS_IRQn = 67, /*!< USB OTG FS global Interrupt */
  155. DMA2_Stream5_IRQn = 68, /*!< DMA2 Stream 5 global interrupt */
  156. DMA2_Stream6_IRQn = 69, /*!< DMA2 Stream 6 global interrupt */
  157. DMA2_Stream7_IRQn = 70, /*!< DMA2 Stream 7 global interrupt */
  158. USART6_IRQn = 71, /*!< USART6 global interrupt */
  159. I2C3_EV_IRQn = 72, /*!< I2C3 event interrupt */
  160. I2C3_ER_IRQn = 73, /*!< I2C3 error interrupt */
  161. OTG_HS_EP1_OUT_IRQn = 74, /*!< USB OTG HS End Point 1 Out global interrupt */
  162. OTG_HS_EP1_IN_IRQn = 75, /*!< USB OTG HS End Point 1 In global interrupt */
  163. OTG_HS_WKUP_IRQn = 76, /*!< USB OTG HS Wakeup through EXTI interrupt */
  164. OTG_HS_IRQn = 77, /*!< USB OTG HS global interrupt */
  165. DCMI_IRQn = 78, /*!< DCMI global interrupt */
  166. HASH_RNG_IRQn = 80, /*!< Hash and Rng global interrupt */
  167. FPU_IRQn = 81, /*!< FPU global interrupt */
  168. UART7_IRQn = 82, /*!< UART7 global interrupt */
  169. UART8_IRQn = 83, /*!< UART8 global interrupt */
  170. SPI4_IRQn = 84, /*!< SPI4 global Interrupt */
  171. SPI5_IRQn = 85, /*!< SPI5 global Interrupt */
  172. SPI6_IRQn = 86, /*!< SPI6 global Interrupt */
  173. SAI1_IRQn = 87, /*!< SAI1 global Interrupt */
  174. LTDC_IRQn = 88, /*!< LTDC global Interrupt */
  175. LTDC_ER_IRQn = 89, /*!< LTDC Error global Interrupt */
  176. DMA2D_IRQn = 90, /*!< DMA2D global Interrupt */
  177. QUADSPI_IRQn = 91, /*!< QUADSPI global Interrupt */
  178. DSI_IRQn = 92 /*!< DSI global Interrupt */
  179. } IRQn_Type;
  180. /**
  181. * @}
  182. */
  183. #include "core_cm4.h" /* Cortex-M4 processor and core peripherals */
  184. #include "system_stm32f4xx.h"
  185. #include <stdint.h>
  186. /** @addtogroup Peripheral_registers_structures
  187. * @{
  188. */
  189. /**
  190. * @brief Analog to Digital Converter
  191. */
  192. typedef struct
  193. {
  194. __IO uint32_t SR; /*!< ADC status register, Address offset: 0x00 */
  195. __IO uint32_t CR1; /*!< ADC control register 1, Address offset: 0x04 */
  196. __IO uint32_t CR2; /*!< ADC control register 2, Address offset: 0x08 */
  197. __IO uint32_t SMPR1; /*!< ADC sample time register 1, Address offset: 0x0C */
  198. __IO uint32_t SMPR2; /*!< ADC sample time register 2, Address offset: 0x10 */
  199. __IO uint32_t JOFR1; /*!< ADC injected channel data offset register 1, Address offset: 0x14 */
  200. __IO uint32_t JOFR2; /*!< ADC injected channel data offset register 2, Address offset: 0x18 */
  201. __IO uint32_t JOFR3; /*!< ADC injected channel data offset register 3, Address offset: 0x1C */
  202. __IO uint32_t JOFR4; /*!< ADC injected channel data offset register 4, Address offset: 0x20 */
  203. __IO uint32_t HTR; /*!< ADC watchdog higher threshold register, Address offset: 0x24 */
  204. __IO uint32_t LTR; /*!< ADC watchdog lower threshold register, Address offset: 0x28 */
  205. __IO uint32_t SQR1; /*!< ADC regular sequence register 1, Address offset: 0x2C */
  206. __IO uint32_t SQR2; /*!< ADC regular sequence register 2, Address offset: 0x30 */
  207. __IO uint32_t SQR3; /*!< ADC regular sequence register 3, Address offset: 0x34 */
  208. __IO uint32_t JSQR; /*!< ADC injected sequence register, Address offset: 0x38*/
  209. __IO uint32_t JDR1; /*!< ADC injected data register 1, Address offset: 0x3C */
  210. __IO uint32_t JDR2; /*!< ADC injected data register 2, Address offset: 0x40 */
  211. __IO uint32_t JDR3; /*!< ADC injected data register 3, Address offset: 0x44 */
  212. __IO uint32_t JDR4; /*!< ADC injected data register 4, Address offset: 0x48 */
  213. __IO uint32_t DR; /*!< ADC regular data register, Address offset: 0x4C */
  214. } ADC_TypeDef;
  215. typedef struct
  216. {
  217. __IO uint32_t CSR; /*!< ADC Common status register, Address offset: ADC1 base address + 0x300 */
  218. __IO uint32_t CCR; /*!< ADC common control register, Address offset: ADC1 base address + 0x304 */
  219. __IO uint32_t CDR; /*!< ADC common regular data register for dual
  220. AND triple modes, Address offset: ADC1 base address + 0x308 */
  221. } ADC_Common_TypeDef;
  222. /**
  223. * @brief Controller Area Network TxMailBox
  224. */
  225. typedef struct
  226. {
  227. __IO uint32_t TIR; /*!< CAN TX mailbox identifier register */
  228. __IO uint32_t TDTR; /*!< CAN mailbox data length control and time stamp register */
  229. __IO uint32_t TDLR; /*!< CAN mailbox data low register */
  230. __IO uint32_t TDHR; /*!< CAN mailbox data high register */
  231. } CAN_TxMailBox_TypeDef;
  232. /**
  233. * @brief Controller Area Network FIFOMailBox
  234. */
  235. typedef struct
  236. {
  237. __IO uint32_t RIR; /*!< CAN receive FIFO mailbox identifier register */
  238. __IO uint32_t RDTR; /*!< CAN receive FIFO mailbox data length control and time stamp register */
  239. __IO uint32_t RDLR; /*!< CAN receive FIFO mailbox data low register */
  240. __IO uint32_t RDHR; /*!< CAN receive FIFO mailbox data high register */
  241. } CAN_FIFOMailBox_TypeDef;
  242. /**
  243. * @brief Controller Area Network FilterRegister
  244. */
  245. typedef struct
  246. {
  247. __IO uint32_t FR1; /*!< CAN Filter bank register 1 */
  248. __IO uint32_t FR2; /*!< CAN Filter bank register 1 */
  249. } CAN_FilterRegister_TypeDef;
  250. /**
  251. * @brief Controller Area Network
  252. */
  253. typedef struct
  254. {
  255. __IO uint32_t MCR; /*!< CAN master control register, Address offset: 0x00 */
  256. __IO uint32_t MSR; /*!< CAN master status register, Address offset: 0x04 */
  257. __IO uint32_t TSR; /*!< CAN transmit status register, Address offset: 0x08 */
  258. __IO uint32_t RF0R; /*!< CAN receive FIFO 0 register, Address offset: 0x0C */
  259. __IO uint32_t RF1R; /*!< CAN receive FIFO 1 register, Address offset: 0x10 */
  260. __IO uint32_t IER; /*!< CAN interrupt enable register, Address offset: 0x14 */
  261. __IO uint32_t ESR; /*!< CAN error status register, Address offset: 0x18 */
  262. __IO uint32_t BTR; /*!< CAN bit timing register, Address offset: 0x1C */
  263. uint32_t RESERVED0[88]; /*!< Reserved, 0x020 - 0x17F */
  264. CAN_TxMailBox_TypeDef sTxMailBox[3]; /*!< CAN Tx MailBox, Address offset: 0x180 - 0x1AC */
  265. CAN_FIFOMailBox_TypeDef sFIFOMailBox[2]; /*!< CAN FIFO MailBox, Address offset: 0x1B0 - 0x1CC */
  266. uint32_t RESERVED1[12]; /*!< Reserved, 0x1D0 - 0x1FF */
  267. __IO uint32_t FMR; /*!< CAN filter master register, Address offset: 0x200 */
  268. __IO uint32_t FM1R; /*!< CAN filter mode register, Address offset: 0x204 */
  269. uint32_t RESERVED2; /*!< Reserved, 0x208 */
  270. __IO uint32_t FS1R; /*!< CAN filter scale register, Address offset: 0x20C */
  271. uint32_t RESERVED3; /*!< Reserved, 0x210 */
  272. __IO uint32_t FFA1R; /*!< CAN filter FIFO assignment register, Address offset: 0x214 */
  273. uint32_t RESERVED4; /*!< Reserved, 0x218 */
  274. __IO uint32_t FA1R; /*!< CAN filter activation register, Address offset: 0x21C */
  275. uint32_t RESERVED5[8]; /*!< Reserved, 0x220-0x23F */
  276. CAN_FilterRegister_TypeDef sFilterRegister[28]; /*!< CAN Filter Register, Address offset: 0x240-0x31C */
  277. } CAN_TypeDef;
  278. /**
  279. * @brief CRC calculation unit
  280. */
  281. typedef struct
  282. {
  283. __IO uint32_t DR; /*!< CRC Data register, Address offset: 0x00 */
  284. __IO uint8_t IDR; /*!< CRC Independent data register, Address offset: 0x04 */
  285. uint8_t RESERVED0; /*!< Reserved, 0x05 */
  286. uint16_t RESERVED1; /*!< Reserved, 0x06 */
  287. __IO uint32_t CR; /*!< CRC Control register, Address offset: 0x08 */
  288. } CRC_TypeDef;
  289. /**
  290. * @brief Digital to Analog Converter
  291. */
  292. typedef struct
  293. {
  294. __IO uint32_t CR; /*!< DAC control register, Address offset: 0x00 */
  295. __IO uint32_t SWTRIGR; /*!< DAC software trigger register, Address offset: 0x04 */
  296. __IO uint32_t DHR12R1; /*!< DAC channel1 12-bit right-aligned data holding register, Address offset: 0x08 */
  297. __IO uint32_t DHR12L1; /*!< DAC channel1 12-bit left aligned data holding register, Address offset: 0x0C */
  298. __IO uint32_t DHR8R1; /*!< DAC channel1 8-bit right aligned data holding register, Address offset: 0x10 */
  299. __IO uint32_t DHR12R2; /*!< DAC channel2 12-bit right aligned data holding register, Address offset: 0x14 */
  300. __IO uint32_t DHR12L2; /*!< DAC channel2 12-bit left aligned data holding register, Address offset: 0x18 */
  301. __IO uint32_t DHR8R2; /*!< DAC channel2 8-bit right-aligned data holding register, Address offset: 0x1C */
  302. __IO uint32_t DHR12RD; /*!< Dual DAC 12-bit right-aligned data holding register, Address offset: 0x20 */
  303. __IO uint32_t DHR12LD; /*!< DUAL DAC 12-bit left aligned data holding register, Address offset: 0x24 */
  304. __IO uint32_t DHR8RD; /*!< DUAL DAC 8-bit right aligned data holding register, Address offset: 0x28 */
  305. __IO uint32_t DOR1; /*!< DAC channel1 data output register, Address offset: 0x2C */
  306. __IO uint32_t DOR2; /*!< DAC channel2 data output register, Address offset: 0x30 */
  307. __IO uint32_t SR; /*!< DAC status register, Address offset: 0x34 */
  308. } DAC_TypeDef;
  309. /**
  310. * @brief Debug MCU
  311. */
  312. typedef struct
  313. {
  314. __IO uint32_t IDCODE; /*!< MCU device ID code, Address offset: 0x00 */
  315. __IO uint32_t CR; /*!< Debug MCU configuration register, Address offset: 0x04 */
  316. __IO uint32_t APB1FZ; /*!< Debug MCU APB1 freeze register, Address offset: 0x08 */
  317. __IO uint32_t APB2FZ; /*!< Debug MCU APB2 freeze register, Address offset: 0x0C */
  318. }DBGMCU_TypeDef;
  319. /**
  320. * @brief DCMI
  321. */
  322. typedef struct
  323. {
  324. __IO uint32_t CR; /*!< DCMI control register 1, Address offset: 0x00 */
  325. __IO uint32_t SR; /*!< DCMI status register, Address offset: 0x04 */
  326. __IO uint32_t RISR; /*!< DCMI raw interrupt status register, Address offset: 0x08 */
  327. __IO uint32_t IER; /*!< DCMI interrupt enable register, Address offset: 0x0C */
  328. __IO uint32_t MISR; /*!< DCMI masked interrupt status register, Address offset: 0x10 */
  329. __IO uint32_t ICR; /*!< DCMI interrupt clear register, Address offset: 0x14 */
  330. __IO uint32_t ESCR; /*!< DCMI embedded synchronization code register, Address offset: 0x18 */
  331. __IO uint32_t ESUR; /*!< DCMI embedded synchronization unmask register, Address offset: 0x1C */
  332. __IO uint32_t CWSTRTR; /*!< DCMI crop window start, Address offset: 0x20 */
  333. __IO uint32_t CWSIZER; /*!< DCMI crop window size, Address offset: 0x24 */
  334. __IO uint32_t DR; /*!< DCMI data register, Address offset: 0x28 */
  335. } DCMI_TypeDef;
  336. /**
  337. * @brief DMA Controller
  338. */
  339. typedef struct
  340. {
  341. __IO uint32_t CR; /*!< DMA stream x configuration register */
  342. __IO uint32_t NDTR; /*!< DMA stream x number of data register */
  343. __IO uint32_t PAR; /*!< DMA stream x peripheral address register */
  344. __IO uint32_t M0AR; /*!< DMA stream x memory 0 address register */
  345. __IO uint32_t M1AR; /*!< DMA stream x memory 1 address register */
  346. __IO uint32_t FCR; /*!< DMA stream x FIFO control register */
  347. } DMA_Stream_TypeDef;
  348. typedef struct
  349. {
  350. __IO uint32_t LISR; /*!< DMA low interrupt status register, Address offset: 0x00 */
  351. __IO uint32_t HISR; /*!< DMA high interrupt status register, Address offset: 0x04 */
  352. __IO uint32_t LIFCR; /*!< DMA low interrupt flag clear register, Address offset: 0x08 */
  353. __IO uint32_t HIFCR; /*!< DMA high interrupt flag clear register, Address offset: 0x0C */
  354. } DMA_TypeDef;
  355. /**
  356. * @brief DMA2D Controller
  357. */
  358. typedef struct
  359. {
  360. __IO uint32_t CR; /*!< DMA2D Control Register, Address offset: 0x00 */
  361. __IO uint32_t ISR; /*!< DMA2D Interrupt Status Register, Address offset: 0x04 */
  362. __IO uint32_t IFCR; /*!< DMA2D Interrupt Flag Clear Register, Address offset: 0x08 */
  363. __IO uint32_t FGMAR; /*!< DMA2D Foreground Memory Address Register, Address offset: 0x0C */
  364. __IO uint32_t FGOR; /*!< DMA2D Foreground Offset Register, Address offset: 0x10 */
  365. __IO uint32_t BGMAR; /*!< DMA2D Background Memory Address Register, Address offset: 0x14 */
  366. __IO uint32_t BGOR; /*!< DMA2D Background Offset Register, Address offset: 0x18 */
  367. __IO uint32_t FGPFCCR; /*!< DMA2D Foreground PFC Control Register, Address offset: 0x1C */
  368. __IO uint32_t FGCOLR; /*!< DMA2D Foreground Color Register, Address offset: 0x20 */
  369. __IO uint32_t BGPFCCR; /*!< DMA2D Background PFC Control Register, Address offset: 0x24 */
  370. __IO uint32_t BGCOLR; /*!< DMA2D Background Color Register, Address offset: 0x28 */
  371. __IO uint32_t FGCMAR; /*!< DMA2D Foreground CLUT Memory Address Register, Address offset: 0x2C */
  372. __IO uint32_t BGCMAR; /*!< DMA2D Background CLUT Memory Address Register, Address offset: 0x30 */
  373. __IO uint32_t OPFCCR; /*!< DMA2D Output PFC Control Register, Address offset: 0x34 */
  374. __IO uint32_t OCOLR; /*!< DMA2D Output Color Register, Address offset: 0x38 */
  375. __IO uint32_t OMAR; /*!< DMA2D Output Memory Address Register, Address offset: 0x3C */
  376. __IO uint32_t OOR; /*!< DMA2D Output Offset Register, Address offset: 0x40 */
  377. __IO uint32_t NLR; /*!< DMA2D Number of Line Register, Address offset: 0x44 */
  378. __IO uint32_t LWR; /*!< DMA2D Line Watermark Register, Address offset: 0x48 */
  379. __IO uint32_t AMTCR; /*!< DMA2D AHB Master Timer Configuration Register, Address offset: 0x4C */
  380. uint32_t RESERVED[236]; /*!< Reserved, 0x50-0x3FF */
  381. __IO uint32_t FGCLUT[256]; /*!< DMA2D Foreground CLUT, Address offset:400-7FF */
  382. __IO uint32_t BGCLUT[256]; /*!< DMA2D Background CLUT, Address offset:800-BFF */
  383. } DMA2D_TypeDef;
  384. /**
  385. * @brief DSI Controller
  386. */
  387. typedef struct
  388. {
  389. __IO uint32_t VR; /*!< DSI Host Version Register, Address offset: 0x00 */
  390. __IO uint32_t CR; /*!< DSI Host Control Register, Address offset: 0x04 */
  391. __IO uint32_t CCR; /*!< DSI HOST Clock Control Register, Address offset: 0x08 */
  392. __IO uint32_t LVCIDR; /*!< DSI Host LTDC VCID Register, Address offset: 0x0C */
  393. __IO uint32_t LCOLCR; /*!< DSI Host LTDC Color Coding Register, Address offset: 0x10 */
  394. __IO uint32_t LPCR; /*!< DSI Host LTDC Polarity Configuration Register, Address offset: 0x14 */
  395. __IO uint32_t LPMCR; /*!< DSI Host Low-Power Mode Configuration Register, Address offset: 0x18 */
  396. uint32_t RESERVED0[4]; /*!< Reserved, 0x1C - 0x2B */
  397. __IO uint32_t PCR; /*!< DSI Host Protocol Configuration Register, Address offset: 0x2C */
  398. __IO uint32_t GVCIDR; /*!< DSI Host Generic VCID Register, Address offset: 0x30 */
  399. __IO uint32_t MCR; /*!< DSI Host Mode Configuration Register, Address offset: 0x34 */
  400. __IO uint32_t VMCR; /*!< DSI Host Video Mode Configuration Register, Address offset: 0x38 */
  401. __IO uint32_t VPCR; /*!< DSI Host Video Packet Configuration Register, Address offset: 0x3C */
  402. __IO uint32_t VCCR; /*!< DSI Host Video Chunks Configuration Register, Address offset: 0x40 */
  403. __IO uint32_t VNPCR; /*!< DSI Host Video Null Packet Configuration Register, Address offset: 0x44 */
  404. __IO uint32_t VHSACR; /*!< DSI Host Video HSA Configuration Register, Address offset: 0x48 */
  405. __IO uint32_t VHBPCR; /*!< DSI Host Video HBP Configuration Register, Address offset: 0x4C */
  406. __IO uint32_t VLCR; /*!< DSI Host Video Line Configuration Register, Address offset: 0x50 */
  407. __IO uint32_t VVSACR; /*!< DSI Host Video VSA Configuration Register, Address offset: 0x54 */
  408. __IO uint32_t VVBPCR; /*!< DSI Host Video VBP Configuration Register, Address offset: 0x58 */
  409. __IO uint32_t VVFPCR; /*!< DSI Host Video VFP Configuration Register, Address offset: 0x5C */
  410. __IO uint32_t VVACR; /*!< DSI Host Video VA Configuration Register, Address offset: 0x60 */
  411. __IO uint32_t LCCR; /*!< DSI Host LTDC Command Configuration Register, Address offset: 0x64 */
  412. __IO uint32_t CMCR; /*!< DSI Host Command Mode Configuration Register, Address offset: 0x68 */
  413. __IO uint32_t GHCR; /*!< DSI Host Generic Header Configuration Register, Address offset: 0x6C */
  414. __IO uint32_t GPDR; /*!< DSI Host Generic Payload Data Register, Address offset: 0x70 */
  415. __IO uint32_t GPSR; /*!< DSI Host Generic Packet Status Register, Address offset: 0x74 */
  416. __IO uint32_t TCCR[6]; /*!< DSI Host Timeout Counter Configuration Register, Address offset: 0x78-0x8F */
  417. __IO uint32_t TDCR; /*!< DSI Host 3D Configuration Register, Address offset: 0x90 */
  418. __IO uint32_t CLCR; /*!< DSI Host Clock Lane Configuration Register, Address offset: 0x94 */
  419. __IO uint32_t CLTCR; /*!< DSI Host Clock Lane Timer Configuration Register, Address offset: 0x98 */
  420. __IO uint32_t DLTCR; /*!< DSI Host Data Lane Timer Configuration Register, Address offset: 0x9C */
  421. __IO uint32_t PCTLR; /*!< DSI Host PHY Control Register, Address offset: 0xA0 */
  422. __IO uint32_t PCONFR; /*!< DSI Host PHY Configuration Register, Address offset: 0xA4 */
  423. __IO uint32_t PUCR; /*!< DSI Host PHY ULPS Control Register, Address offset: 0xA8 */
  424. __IO uint32_t PTTCR; /*!< DSI Host PHY TX Triggers Configuration Register, Address offset: 0xAC */
  425. __IO uint32_t PSR; /*!< DSI Host PHY Status Register, Address offset: 0xB0 */
  426. uint32_t RESERVED1[2]; /*!< Reserved, 0xB4 - 0xBB */
  427. __IO uint32_t ISR[2]; /*!< DSI Host Interrupt & Status Register, Address offset: 0xBC-0xC3 */
  428. __IO uint32_t IER[2]; /*!< DSI Host Interrupt Enable Register, Address offset: 0xC4-0xCB */
  429. uint32_t RESERVED2[3]; /*!< Reserved, 0xD0 - 0xD7 */
  430. __IO uint32_t FIR[2]; /*!< DSI Host Force Interrupt Register, Address offset: 0xD8-0xDF */
  431. uint32_t RESERVED3[8]; /*!< Reserved, 0xE0 - 0xFF */
  432. __IO uint32_t VSCR; /*!< DSI Host Video Shadow Control Register, Address offset: 0x100 */
  433. uint32_t RESERVED4[2]; /*!< Reserved, 0x104 - 0x10B */
  434. __IO uint32_t LCVCIDR; /*!< DSI Host LTDC Current VCID Register, Address offset: 0x10C */
  435. __IO uint32_t LCCCR; /*!< DSI Host LTDC Current Color Coding Register, Address offset: 0x110 */
  436. uint32_t RESERVED5; /*!< Reserved, 0x114 */
  437. __IO uint32_t LPMCCR; /*!< DSI Host Low-power Mode Current Configuration Register, Address offset: 0x118 */
  438. uint32_t RESERVED6[7]; /*!< Reserved, 0x11C - 0x137 */
  439. __IO uint32_t VMCCR; /*!< DSI Host Video Mode Current Configuration Register, Address offset: 0x138 */
  440. __IO uint32_t VPCCR; /*!< DSI Host Video Packet Current Configuration Register, Address offset: 0x13C */
  441. __IO uint32_t VCCCR; /*!< DSI Host Video Chuncks Current Configuration Register, Address offset: 0x140 */
  442. __IO uint32_t VNPCCR; /*!< DSI Host Video Null Packet Current Configuration Register, Address offset: 0x144 */
  443. __IO uint32_t VHSACCR; /*!< DSI Host Video HSA Current Configuration Register, Address offset: 0x148 */
  444. __IO uint32_t VHBPCCR; /*!< DSI Host Video HBP Current Configuration Register, Address offset: 0x14C */
  445. __IO uint32_t VLCCR; /*!< DSI Host Video Line Current Configuration Register, Address offset: 0x150 */
  446. __IO uint32_t VVSACCR; /*!< DSI Host Video VSA Current Configuration Register, Address offset: 0x154 */
  447. __IO uint32_t VVBPCCR; /*!< DSI Host Video VBP Current Configuration Register, Address offset: 0x158 */
  448. __IO uint32_t VVFPCCR; /*!< DSI Host Video VFP Current Configuration Register, Address offset: 0x15C */
  449. __IO uint32_t VVACCR; /*!< DSI Host Video VA Current Configuration Register, Address offset: 0x160 */
  450. uint32_t RESERVED7[11]; /*!< Reserved, 0x164 - 0x18F */
  451. __IO uint32_t TDCCR; /*!< DSI Host 3D Current Configuration Register, Address offset: 0x190 */
  452. uint32_t RESERVED8[155]; /*!< Reserved, 0x194 - 0x3FF */
  453. __IO uint32_t WCFGR; /*!< DSI Wrapper Configuration Register, Address offset: 0x400 */
  454. __IO uint32_t WCR; /*!< DSI Wrapper Control Register, Address offset: 0x404 */
  455. __IO uint32_t WIER; /*!< DSI Wrapper Interrupt Enable Register, Address offset: 0x408 */
  456. __IO uint32_t WISR; /*!< DSI Wrapper Interrupt and Status Register, Address offset: 0x40C */
  457. __IO uint32_t WIFCR; /*!< DSI Wrapper Interrupt Flag Clear Register, Address offset: 0x410 */
  458. uint32_t RESERVED9; /*!< Reserved, 0x414 */
  459. __IO uint32_t WPCR[5]; /*!< DSI Wrapper PHY Configuration Register, Address offset: 0x418-0x42B */
  460. uint32_t RESERVED10; /*!< Reserved, 0x42C */
  461. __IO uint32_t WRPCR; /*!< DSI Wrapper Regulator and PLL Control Register, Address offset: 0x430 */
  462. } DSI_TypeDef;
  463. /**
  464. * @brief Ethernet MAC
  465. */
  466. typedef struct
  467. {
  468. __IO uint32_t MACCR;
  469. __IO uint32_t MACFFR;
  470. __IO uint32_t MACHTHR;
  471. __IO uint32_t MACHTLR;
  472. __IO uint32_t MACMIIAR;
  473. __IO uint32_t MACMIIDR;
  474. __IO uint32_t MACFCR;
  475. __IO uint32_t MACVLANTR; /* 8 */
  476. uint32_t RESERVED0[2];
  477. __IO uint32_t MACRWUFFR; /* 11 */
  478. __IO uint32_t MACPMTCSR;
  479. uint32_t RESERVED1[2];
  480. __IO uint32_t MACSR; /* 15 */
  481. __IO uint32_t MACIMR;
  482. __IO uint32_t MACA0HR;
  483. __IO uint32_t MACA0LR;
  484. __IO uint32_t MACA1HR;
  485. __IO uint32_t MACA1LR;
  486. __IO uint32_t MACA2HR;
  487. __IO uint32_t MACA2LR;
  488. __IO uint32_t MACA3HR;
  489. __IO uint32_t MACA3LR; /* 24 */
  490. uint32_t RESERVED2[40];
  491. __IO uint32_t MMCCR; /* 65 */
  492. __IO uint32_t MMCRIR;
  493. __IO uint32_t MMCTIR;
  494. __IO uint32_t MMCRIMR;
  495. __IO uint32_t MMCTIMR; /* 69 */
  496. uint32_t RESERVED3[14];
  497. __IO uint32_t MMCTGFSCCR; /* 84 */
  498. __IO uint32_t MMCTGFMSCCR;
  499. uint32_t RESERVED4[5];
  500. __IO uint32_t MMCTGFCR;
  501. uint32_t RESERVED5[10];
  502. __IO uint32_t MMCRFCECR;
  503. __IO uint32_t MMCRFAECR;
  504. uint32_t RESERVED6[10];
  505. __IO uint32_t MMCRGUFCR;
  506. uint32_t RESERVED7[334];
  507. __IO uint32_t PTPTSCR;
  508. __IO uint32_t PTPSSIR;
  509. __IO uint32_t PTPTSHR;
  510. __IO uint32_t PTPTSLR;
  511. __IO uint32_t PTPTSHUR;
  512. __IO uint32_t PTPTSLUR;
  513. __IO uint32_t PTPTSAR;
  514. __IO uint32_t PTPTTHR;
  515. __IO uint32_t PTPTTLR;
  516. __IO uint32_t RESERVED8;
  517. __IO uint32_t PTPTSSR;
  518. uint32_t RESERVED9[565];
  519. __IO uint32_t DMABMR;
  520. __IO uint32_t DMATPDR;
  521. __IO uint32_t DMARPDR;
  522. __IO uint32_t DMARDLAR;
  523. __IO uint32_t DMATDLAR;
  524. __IO uint32_t DMASR;
  525. __IO uint32_t DMAOMR;
  526. __IO uint32_t DMAIER;
  527. __IO uint32_t DMAMFBOCR;
  528. __IO uint32_t DMARSWTR;
  529. uint32_t RESERVED10[8];
  530. __IO uint32_t DMACHTDR;
  531. __IO uint32_t DMACHRDR;
  532. __IO uint32_t DMACHTBAR;
  533. __IO uint32_t DMACHRBAR;
  534. } ETH_TypeDef;
  535. /**
  536. * @brief External Interrupt/Event Controller
  537. */
  538. typedef struct
  539. {
  540. __IO uint32_t IMR; /*!< EXTI Interrupt mask register, Address offset: 0x00 */
  541. __IO uint32_t EMR; /*!< EXTI Event mask register, Address offset: 0x04 */
  542. __IO uint32_t RTSR; /*!< EXTI Rising trigger selection register, Address offset: 0x08 */
  543. __IO uint32_t FTSR; /*!< EXTI Falling trigger selection register, Address offset: 0x0C */
  544. __IO uint32_t SWIER; /*!< EXTI Software interrupt event register, Address offset: 0x10 */
  545. __IO uint32_t PR; /*!< EXTI Pending register, Address offset: 0x14 */
  546. } EXTI_TypeDef;
  547. /**
  548. * @brief FLASH Registers
  549. */
  550. typedef struct
  551. {
  552. __IO uint32_t ACR; /*!< FLASH access control register, Address offset: 0x00 */
  553. __IO uint32_t KEYR; /*!< FLASH key register, Address offset: 0x04 */
  554. __IO uint32_t OPTKEYR; /*!< FLASH option key register, Address offset: 0x08 */
  555. __IO uint32_t SR; /*!< FLASH status register, Address offset: 0x0C */
  556. __IO uint32_t CR; /*!< FLASH control register, Address offset: 0x10 */
  557. __IO uint32_t OPTCR; /*!< FLASH option control register , Address offset: 0x14 */
  558. __IO uint32_t OPTCR1; /*!< FLASH option control register 1, Address offset: 0x18 */
  559. } FLASH_TypeDef;
  560. /**
  561. * @brief Flexible Memory Controller
  562. */
  563. typedef struct
  564. {
  565. __IO uint32_t BTCR[8]; /*!< NOR/PSRAM chip-select control register(BCR) and chip-select timing register(BTR), Address offset: 0x00-1C */
  566. } FMC_Bank1_TypeDef;
  567. /**
  568. * @brief Flexible Memory Controller Bank1E
  569. */
  570. typedef struct
  571. {
  572. __IO uint32_t BWTR[7]; /*!< NOR/PSRAM write timing registers, Address offset: 0x104-0x11C */
  573. } FMC_Bank1E_TypeDef;
  574. /**
  575. * @brief Flexible Memory Controller Bank3
  576. */
  577. typedef struct
  578. {
  579. __IO uint32_t PCR; /*!< NAND Flash control register, Address offset: 0x80 */
  580. __IO uint32_t SR; /*!< NAND Flash FIFO status and interrupt register, Address offset: 0x84 */
  581. __IO uint32_t PMEM; /*!< NAND Flash Common memory space timing register, Address offset: 0x88 */
  582. __IO uint32_t PATT; /*!< NAND Flash Attribute memory space timing register, Address offset: 0x8C */
  583. uint32_t RESERVED; /*!< Reserved, 0x90 */
  584. __IO uint32_t ECCR; /*!< NAND Flash ECC result registers, Address offset: 0x94 */
  585. } FMC_Bank3_TypeDef;
  586. /**
  587. * @brief Flexible Memory Controller Bank5_6
  588. */
  589. typedef struct
  590. {
  591. __IO uint32_t SDCR[2]; /*!< SDRAM Control registers , Address offset: 0x140-0x144 */
  592. __IO uint32_t SDTR[2]; /*!< SDRAM Timing registers , Address offset: 0x148-0x14C */
  593. __IO uint32_t SDCMR; /*!< SDRAM Command Mode register, Address offset: 0x150 */
  594. __IO uint32_t SDRTR; /*!< SDRAM Refresh Timer register, Address offset: 0x154 */
  595. __IO uint32_t SDSR; /*!< SDRAM Status register, Address offset: 0x158 */
  596. } FMC_Bank5_6_TypeDef;
  597. /**
  598. * @brief General Purpose I/O
  599. */
  600. typedef struct
  601. {
  602. __IO uint32_t MODER; /*!< GPIO port mode register, Address offset: 0x00 */
  603. __IO uint32_t OTYPER; /*!< GPIO port output type register, Address offset: 0x04 */
  604. __IO uint32_t OSPEEDR; /*!< GPIO port output speed register, Address offset: 0x08 */
  605. __IO uint32_t PUPDR; /*!< GPIO port pull-up/pull-down register, Address offset: 0x0C */
  606. __IO uint32_t IDR; /*!< GPIO port input data register, Address offset: 0x10 */
  607. __IO uint32_t ODR; /*!< GPIO port output data register, Address offset: 0x14 */
  608. __IO uint32_t BSRR; /*!< GPIO port bit set/reset register, Address offset: 0x18 */
  609. __IO uint32_t LCKR; /*!< GPIO port configuration lock register, Address offset: 0x1C */
  610. __IO uint32_t AFR[2]; /*!< GPIO alternate function registers, Address offset: 0x20-0x24 */
  611. } GPIO_TypeDef;
  612. /**
  613. * @brief System configuration controller
  614. */
  615. typedef struct
  616. {
  617. __IO uint32_t MEMRMP; /*!< SYSCFG memory remap register, Address offset: 0x00 */
  618. __IO uint32_t PMC; /*!< SYSCFG peripheral mode configuration register, Address offset: 0x04 */
  619. __IO uint32_t EXTICR[4]; /*!< SYSCFG external interrupt configuration registers, Address offset: 0x08-0x14 */
  620. uint32_t RESERVED[2]; /*!< Reserved, 0x18-0x1C */
  621. __IO uint32_t CMPCR; /*!< SYSCFG Compensation cell control register, Address offset: 0x20 */
  622. } SYSCFG_TypeDef;
  623. /**
  624. * @brief Inter-integrated Circuit Interface
  625. */
  626. typedef struct
  627. {
  628. __IO uint32_t CR1; /*!< I2C Control register 1, Address offset: 0x00 */
  629. __IO uint32_t CR2; /*!< I2C Control register 2, Address offset: 0x04 */
  630. __IO uint32_t OAR1; /*!< I2C Own address register 1, Address offset: 0x08 */
  631. __IO uint32_t OAR2; /*!< I2C Own address register 2, Address offset: 0x0C */
  632. __IO uint32_t DR; /*!< I2C Data register, Address offset: 0x10 */
  633. __IO uint32_t SR1; /*!< I2C Status register 1, Address offset: 0x14 */
  634. __IO uint32_t SR2; /*!< I2C Status register 2, Address offset: 0x18 */
  635. __IO uint32_t CCR; /*!< I2C Clock control register, Address offset: 0x1C */
  636. __IO uint32_t TRISE; /*!< I2C TRISE register, Address offset: 0x20 */
  637. __IO uint32_t FLTR; /*!< I2C FLTR register, Address offset: 0x24 */
  638. } I2C_TypeDef;
  639. /**
  640. * @brief Independent WATCHDOG
  641. */
  642. typedef struct
  643. {
  644. __IO uint32_t KR; /*!< IWDG Key register, Address offset: 0x00 */
  645. __IO uint32_t PR; /*!< IWDG Prescaler register, Address offset: 0x04 */
  646. __IO uint32_t RLR; /*!< IWDG Reload register, Address offset: 0x08 */
  647. __IO uint32_t SR; /*!< IWDG Status register, Address offset: 0x0C */
  648. } IWDG_TypeDef;
  649. /**
  650. * @brief LCD-TFT Display Controller
  651. */
  652. typedef struct
  653. {
  654. uint32_t RESERVED0[2]; /*!< Reserved, 0x00-0x04 */
  655. __IO uint32_t SSCR; /*!< LTDC Synchronization Size Configuration Register, Address offset: 0x08 */
  656. __IO uint32_t BPCR; /*!< LTDC Back Porch Configuration Register, Address offset: 0x0C */
  657. __IO uint32_t AWCR; /*!< LTDC Active Width Configuration Register, Address offset: 0x10 */
  658. __IO uint32_t TWCR; /*!< LTDC Total Width Configuration Register, Address offset: 0x14 */
  659. __IO uint32_t GCR; /*!< LTDC Global Control Register, Address offset: 0x18 */
  660. uint32_t RESERVED1[2]; /*!< Reserved, 0x1C-0x20 */
  661. __IO uint32_t SRCR; /*!< LTDC Shadow Reload Configuration Register, Address offset: 0x24 */
  662. uint32_t RESERVED2[1]; /*!< Reserved, 0x28 */
  663. __IO uint32_t BCCR; /*!< LTDC Background Color Configuration Register, Address offset: 0x2C */
  664. uint32_t RESERVED3[1]; /*!< Reserved, 0x30 */
  665. __IO uint32_t IER; /*!< LTDC Interrupt Enable Register, Address offset: 0x34 */
  666. __IO uint32_t ISR; /*!< LTDC Interrupt Status Register, Address offset: 0x38 */
  667. __IO uint32_t ICR; /*!< LTDC Interrupt Clear Register, Address offset: 0x3C */
  668. __IO uint32_t LIPCR; /*!< LTDC Line Interrupt Position Configuration Register, Address offset: 0x40 */
  669. __IO uint32_t CPSR; /*!< LTDC Current Position Status Register, Address offset: 0x44 */
  670. __IO uint32_t CDSR; /*!< LTDC Current Display Status Register, Address offset: 0x48 */
  671. } LTDC_TypeDef;
  672. /**
  673. * @brief LCD-TFT Display layer x Controller
  674. */
  675. typedef struct
  676. {
  677. __IO uint32_t CR; /*!< LTDC Layerx Control Register Address offset: 0x84 */
  678. __IO uint32_t WHPCR; /*!< LTDC Layerx Window Horizontal Position Configuration Register Address offset: 0x88 */
  679. __IO uint32_t WVPCR; /*!< LTDC Layerx Window Vertical Position Configuration Register Address offset: 0x8C */
  680. __IO uint32_t CKCR; /*!< LTDC Layerx Color Keying Configuration Register Address offset: 0x90 */
  681. __IO uint32_t PFCR; /*!< LTDC Layerx Pixel Format Configuration Register Address offset: 0x94 */
  682. __IO uint32_t CACR; /*!< LTDC Layerx Constant Alpha Configuration Register Address offset: 0x98 */
  683. __IO uint32_t DCCR; /*!< LTDC Layerx Default Color Configuration Register Address offset: 0x9C */
  684. __IO uint32_t BFCR; /*!< LTDC Layerx Blending Factors Configuration Register Address offset: 0xA0 */
  685. uint32_t RESERVED0[2]; /*!< Reserved */
  686. __IO uint32_t CFBAR; /*!< LTDC Layerx Color Frame Buffer Address Register Address offset: 0xAC */
  687. __IO uint32_t CFBLR; /*!< LTDC Layerx Color Frame Buffer Length Register Address offset: 0xB0 */
  688. __IO uint32_t CFBLNR; /*!< LTDC Layerx ColorFrame Buffer Line Number Register Address offset: 0xB4 */
  689. uint32_t RESERVED1[3]; /*!< Reserved */
  690. __IO uint32_t CLUTWR; /*!< LTDC Layerx CLUT Write Register Address offset: 0x144 */
  691. } LTDC_Layer_TypeDef;
  692. /**
  693. * @brief Power Control
  694. */
  695. typedef struct
  696. {
  697. __IO uint32_t CR; /*!< PWR power control register, Address offset: 0x00 */
  698. __IO uint32_t CSR; /*!< PWR power control/status register, Address offset: 0x04 */
  699. } PWR_TypeDef;
  700. /**
  701. * @brief Reset and Clock Control
  702. */
  703. typedef struct
  704. {
  705. __IO uint32_t CR; /*!< RCC clock control register, Address offset: 0x00 */
  706. __IO uint32_t PLLCFGR; /*!< RCC PLL configuration register, Address offset: 0x04 */
  707. __IO uint32_t CFGR; /*!< RCC clock configuration register, Address offset: 0x08 */
  708. __IO uint32_t CIR; /*!< RCC clock interrupt register, Address offset: 0x0C */
  709. __IO uint32_t AHB1RSTR; /*!< RCC AHB1 peripheral reset register, Address offset: 0x10 */
  710. __IO uint32_t AHB2RSTR; /*!< RCC AHB2 peripheral reset register, Address offset: 0x14 */
  711. __IO uint32_t AHB3RSTR; /*!< RCC AHB3 peripheral reset register, Address offset: 0x18 */
  712. uint32_t RESERVED0; /*!< Reserved, 0x1C */
  713. __IO uint32_t APB1RSTR; /*!< RCC APB1 peripheral reset register, Address offset: 0x20 */
  714. __IO uint32_t APB2RSTR; /*!< RCC APB2 peripheral reset register, Address offset: 0x24 */
  715. uint32_t RESERVED1[2]; /*!< Reserved, 0x28-0x2C */
  716. __IO uint32_t AHB1ENR; /*!< RCC AHB1 peripheral clock register, Address offset: 0x30 */
  717. __IO uint32_t AHB2ENR; /*!< RCC AHB2 peripheral clock register, Address offset: 0x34 */
  718. __IO uint32_t AHB3ENR; /*!< RCC AHB3 peripheral clock register, Address offset: 0x38 */
  719. uint32_t RESERVED2; /*!< Reserved, 0x3C */
  720. __IO uint32_t APB1ENR; /*!< RCC APB1 peripheral clock enable register, Address offset: 0x40 */
  721. __IO uint32_t APB2ENR; /*!< RCC APB2 peripheral clock enable register, Address offset: 0x44 */
  722. uint32_t RESERVED3[2]; /*!< Reserved, 0x48-0x4C */
  723. __IO uint32_t AHB1LPENR; /*!< RCC AHB1 peripheral clock enable in low power mode register, Address offset: 0x50 */
  724. __IO uint32_t AHB2LPENR; /*!< RCC AHB2 peripheral clock enable in low power mode register, Address offset: 0x54 */
  725. __IO uint32_t AHB3LPENR; /*!< RCC AHB3 peripheral clock enable in low power mode register, Address offset: 0x58 */
  726. uint32_t RESERVED4; /*!< Reserved, 0x5C */
  727. __IO uint32_t APB1LPENR; /*!< RCC APB1 peripheral clock enable in low power mode register, Address offset: 0x60 */
  728. __IO uint32_t APB2LPENR; /*!< RCC APB2 peripheral clock enable in low power mode register, Address offset: 0x64 */
  729. uint32_t RESERVED5[2]; /*!< Reserved, 0x68-0x6C */
  730. __IO uint32_t BDCR; /*!< RCC Backup domain control register, Address offset: 0x70 */
  731. __IO uint32_t CSR; /*!< RCC clock control & status register, Address offset: 0x74 */
  732. uint32_t RESERVED6[2]; /*!< Reserved, 0x78-0x7C */
  733. __IO uint32_t SSCGR; /*!< RCC spread spectrum clock generation register, Address offset: 0x80 */
  734. __IO uint32_t PLLI2SCFGR; /*!< RCC PLLI2S configuration register, Address offset: 0x84 */
  735. __IO uint32_t PLLSAICFGR; /*!< RCC PLLSAI configuration register, Address offset: 0x88 */
  736. __IO uint32_t DCKCFGR; /*!< RCC Dedicated Clocks configuration register, Address offset: 0x8C */
  737. } RCC_TypeDef;
  738. /**
  739. * @brief Real-Time Clock
  740. */
  741. typedef struct
  742. {
  743. __IO uint32_t TR; /*!< RTC time register, Address offset: 0x00 */
  744. __IO uint32_t DR; /*!< RTC date register, Address offset: 0x04 */
  745. __IO uint32_t CR; /*!< RTC control register, Address offset: 0x08 */
  746. __IO uint32_t ISR; /*!< RTC initialization and status register, Address offset: 0x0C */
  747. __IO uint32_t PRER; /*!< RTC prescaler register, Address offset: 0x10 */
  748. __IO uint32_t WUTR; /*!< RTC wakeup timer register, Address offset: 0x14 */
  749. __IO uint32_t CALIBR; /*!< RTC calibration register, Address offset: 0x18 */
  750. __IO uint32_t ALRMAR; /*!< RTC alarm A register, Address offset: 0x1C */
  751. __IO uint32_t ALRMBR; /*!< RTC alarm B register, Address offset: 0x20 */
  752. __IO uint32_t WPR; /*!< RTC write protection register, Address offset: 0x24 */
  753. __IO uint32_t SSR; /*!< RTC sub second register, Address offset: 0x28 */
  754. __IO uint32_t SHIFTR; /*!< RTC shift control register, Address offset: 0x2C */
  755. __IO uint32_t TSTR; /*!< RTC time stamp time register, Address offset: 0x30 */
  756. __IO uint32_t TSDR; /*!< RTC time stamp date register, Address offset: 0x34 */
  757. __IO uint32_t TSSSR; /*!< RTC time-stamp sub second register, Address offset: 0x38 */
  758. __IO uint32_t CALR; /*!< RTC calibration register, Address offset: 0x3C */
  759. __IO uint32_t TAFCR; /*!< RTC tamper and alternate function configuration register, Address offset: 0x40 */
  760. __IO uint32_t ALRMASSR;/*!< RTC alarm A sub second register, Address offset: 0x44 */
  761. __IO uint32_t ALRMBSSR;/*!< RTC alarm B sub second register, Address offset: 0x48 */
  762. uint32_t RESERVED7; /*!< Reserved, 0x4C */
  763. __IO uint32_t BKP0R; /*!< RTC backup register 1, Address offset: 0x50 */
  764. __IO uint32_t BKP1R; /*!< RTC backup register 1, Address offset: 0x54 */
  765. __IO uint32_t BKP2R; /*!< RTC backup register 2, Address offset: 0x58 */
  766. __IO uint32_t BKP3R; /*!< RTC backup register 3, Address offset: 0x5C */
  767. __IO uint32_t BKP4R; /*!< RTC backup register 4, Address offset: 0x60 */
  768. __IO uint32_t BKP5R; /*!< RTC backup register 5, Address offset: 0x64 */
  769. __IO uint32_t BKP6R; /*!< RTC backup register 6, Address offset: 0x68 */
  770. __IO uint32_t BKP7R; /*!< RTC backup register 7, Address offset: 0x6C */
  771. __IO uint32_t BKP8R; /*!< RTC backup register 8, Address offset: 0x70 */
  772. __IO uint32_t BKP9R; /*!< RTC backup register 9, Address offset: 0x74 */
  773. __IO uint32_t BKP10R; /*!< RTC backup register 10, Address offset: 0x78 */
  774. __IO uint32_t BKP11R; /*!< RTC backup register 11, Address offset: 0x7C */
  775. __IO uint32_t BKP12R; /*!< RTC backup register 12, Address offset: 0x80 */
  776. __IO uint32_t BKP13R; /*!< RTC backup register 13, Address offset: 0x84 */
  777. __IO uint32_t BKP14R; /*!< RTC backup register 14, Address offset: 0x88 */
  778. __IO uint32_t BKP15R; /*!< RTC backup register 15, Address offset: 0x8C */
  779. __IO uint32_t BKP16R; /*!< RTC backup register 16, Address offset: 0x90 */
  780. __IO uint32_t BKP17R; /*!< RTC backup register 17, Address offset: 0x94 */
  781. __IO uint32_t BKP18R; /*!< RTC backup register 18, Address offset: 0x98 */
  782. __IO uint32_t BKP19R; /*!< RTC backup register 19, Address offset: 0x9C */
  783. } RTC_TypeDef;
  784. /**
  785. * @brief Serial Audio Interface
  786. */
  787. typedef struct
  788. {
  789. __IO uint32_t GCR; /*!< SAI global configuration register, Address offset: 0x00 */
  790. } SAI_TypeDef;
  791. typedef struct
  792. {
  793. __IO uint32_t CR1; /*!< SAI block x configuration register 1, Address offset: 0x04 */
  794. __IO uint32_t CR2; /*!< SAI block x configuration register 2, Address offset: 0x08 */
  795. __IO uint32_t FRCR; /*!< SAI block x frame configuration register, Address offset: 0x0C */
  796. __IO uint32_t SLOTR; /*!< SAI block x slot register, Address offset: 0x10 */
  797. __IO uint32_t IMR; /*!< SAI block x interrupt mask register, Address offset: 0x14 */
  798. __IO uint32_t SR; /*!< SAI block x status register, Address offset: 0x18 */
  799. __IO uint32_t CLRFR; /*!< SAI block x clear flag register, Address offset: 0x1C */
  800. __IO uint32_t DR; /*!< SAI block x data register, Address offset: 0x20 */
  801. } SAI_Block_TypeDef;
  802. /**
  803. * @brief SD host Interface
  804. */
  805. typedef struct
  806. {
  807. __IO uint32_t POWER; /*!< SDIO power control register, Address offset: 0x00 */
  808. __IO uint32_t CLKCR; /*!< SDI clock control register, Address offset: 0x04 */
  809. __IO uint32_t ARG; /*!< SDIO argument register, Address offset: 0x08 */
  810. __IO uint32_t CMD; /*!< SDIO command register, Address offset: 0x0C */
  811. __I uint32_t RESPCMD; /*!< SDIO command response register, Address offset: 0x10 */
  812. __I uint32_t RESP1; /*!< SDIO response 1 register, Address offset: 0x14 */
  813. __I uint32_t RESP2; /*!< SDIO response 2 register, Address offset: 0x18 */
  814. __I uint32_t RESP3; /*!< SDIO response 3 register, Address offset: 0x1C */
  815. __I uint32_t RESP4; /*!< SDIO response 4 register, Address offset: 0x20 */
  816. __IO uint32_t DTIMER; /*!< SDIO data timer register, Address offset: 0x24 */
  817. __IO uint32_t DLEN; /*!< SDIO data length register, Address offset: 0x28 */
  818. __IO uint32_t DCTRL; /*!< SDIO data control register, Address offset: 0x2C */
  819. __I uint32_t DCOUNT; /*!< SDIO data counter register, Address offset: 0x30 */
  820. __I uint32_t STA; /*!< SDIO status register, Address offset: 0x34 */
  821. __IO uint32_t ICR; /*!< SDIO interrupt clear register, Address offset: 0x38 */
  822. __IO uint32_t MASK; /*!< SDIO mask register, Address offset: 0x3C */
  823. uint32_t RESERVED0[2]; /*!< Reserved, 0x40-0x44 */
  824. __I uint32_t FIFOCNT; /*!< SDIO FIFO counter register, Address offset: 0x48 */
  825. uint32_t RESERVED1[13]; /*!< Reserved, 0x4C-0x7C */
  826. __IO uint32_t FIFO; /*!< SDIO data FIFO register, Address offset: 0x80 */
  827. } SDIO_TypeDef;
  828. /**
  829. * @brief Serial Peripheral Interface
  830. */
  831. typedef struct
  832. {
  833. __IO uint32_t CR1; /*!< SPI control register 1 (not used in I2S mode), Address offset: 0x00 */
  834. __IO uint32_t CR2; /*!< SPI control register 2, Address offset: 0x04 */
  835. __IO uint32_t SR; /*!< SPI status register, Address offset: 0x08 */
  836. __IO uint32_t DR; /*!< SPI data register, Address offset: 0x0C */
  837. __IO uint32_t CRCPR; /*!< SPI CRC polynomial register (not used in I2S mode), Address offset: 0x10 */
  838. __IO uint32_t RXCRCR; /*!< SPI RX CRC register (not used in I2S mode), Address offset: 0x14 */
  839. __IO uint32_t TXCRCR; /*!< SPI TX CRC register (not used in I2S mode), Address offset: 0x18 */
  840. __IO uint32_t I2SCFGR; /*!< SPI_I2S configuration register, Address offset: 0x1C */
  841. __IO uint32_t I2SPR; /*!< SPI_I2S prescaler register, Address offset: 0x20 */
  842. } SPI_TypeDef;
  843. /**
  844. * @brief QUAD Serial Peripheral Interface
  845. */
  846. typedef struct
  847. {
  848. __IO uint32_t CR; /*!< QUADSPI Control register, Address offset: 0x00 */
  849. __IO uint32_t DCR; /*!< QUADSPI Device Configuration register, Address offset: 0x04 */
  850. __IO uint32_t SR; /*!< QUADSPI Status register, Address offset: 0x08 */
  851. __IO uint32_t FCR; /*!< QUADSPI Flag Clear register, Address offset: 0x0C */
  852. __IO uint32_t DLR; /*!< QUADSPI Data Length register, Address offset: 0x10 */
  853. __IO uint32_t CCR; /*!< QUADSPI Communication Configuration register, Address offset: 0x14 */
  854. __IO uint32_t AR; /*!< QUADSPI Address register, Address offset: 0x18 */
  855. __IO uint32_t ABR; /*!< QUADSPI Alternate Bytes register, Address offset: 0x1C */
  856. __IO uint32_t DR; /*!< QUADSPI Data register, Address offset: 0x20 */
  857. __IO uint32_t PSMKR; /*!< QUADSPI Polling Status Mask register, Address offset: 0x24 */
  858. __IO uint32_t PSMAR; /*!< QUADSPI Polling Status Match register, Address offset: 0x28 */
  859. __IO uint32_t PIR; /*!< QUADSPI Polling Interval register, Address offset: 0x2C */
  860. __IO uint32_t LPTR; /*!< QUADSPI Low Power Timeout register, Address offset: 0x30 */
  861. } QUADSPI_TypeDef;
  862. /**
  863. * @brief TIM
  864. */
  865. typedef struct
  866. {
  867. __IO uint32_t CR1; /*!< TIM control register 1, Address offset: 0x00 */
  868. __IO uint32_t CR2; /*!< TIM control register 2, Address offset: 0x04 */
  869. __IO uint32_t SMCR; /*!< TIM slave mode control register, Address offset: 0x08 */
  870. __IO uint32_t DIER; /*!< TIM DMA/interrupt enable register, Address offset: 0x0C */
  871. __IO uint32_t SR; /*!< TIM status register, Address offset: 0x10 */
  872. __IO uint32_t EGR; /*!< TIM event generation register, Address offset: 0x14 */
  873. __IO uint32_t CCMR1; /*!< TIM capture/compare mode register 1, Address offset: 0x18 */
  874. __IO uint32_t CCMR2; /*!< TIM capture/compare mode register 2, Address offset: 0x1C */
  875. __IO uint32_t CCER; /*!< TIM capture/compare enable register, Address offset: 0x20 */
  876. __IO uint32_t CNT; /*!< TIM counter register, Address offset: 0x24 */
  877. __IO uint32_t PSC; /*!< TIM prescaler, Address offset: 0x28 */
  878. __IO uint32_t ARR; /*!< TIM auto-reload register, Address offset: 0x2C */
  879. __IO uint32_t RCR; /*!< TIM repetition counter register, Address offset: 0x30 */
  880. __IO uint32_t CCR1; /*!< TIM capture/compare register 1, Address offset: 0x34 */
  881. __IO uint32_t CCR2; /*!< TIM capture/compare register 2, Address offset: 0x38 */
  882. __IO uint32_t CCR3; /*!< TIM capture/compare register 3, Address offset: 0x3C */
  883. __IO uint32_t CCR4; /*!< TIM capture/compare register 4, Address offset: 0x40 */
  884. __IO uint32_t BDTR; /*!< TIM break and dead-time register, Address offset: 0x44 */
  885. __IO uint32_t DCR; /*!< TIM DMA control register, Address offset: 0x48 */
  886. __IO uint32_t DMAR; /*!< TIM DMA address for full transfer, Address offset: 0x4C */
  887. __IO uint32_t OR; /*!< TIM option register, Address offset: 0x50 */
  888. } TIM_TypeDef;
  889. /**
  890. * @brief Universal Synchronous Asynchronous Receiver Transmitter
  891. */
  892. typedef struct
  893. {
  894. __IO uint32_t SR; /*!< USART Status register, Address offset: 0x00 */
  895. __IO uint32_t DR; /*!< USART Data register, Address offset: 0x04 */
  896. __IO uint32_t BRR; /*!< USART Baud rate register, Address offset: 0x08 */
  897. __IO uint32_t CR1; /*!< USART Control register 1, Address offset: 0x0C */
  898. __IO uint32_t CR2; /*!< USART Control register 2, Address offset: 0x10 */
  899. __IO uint32_t CR3; /*!< USART Control register 3, Address offset: 0x14 */
  900. __IO uint32_t GTPR; /*!< USART Guard time and prescaler register, Address offset: 0x18 */
  901. } USART_TypeDef;
  902. /**
  903. * @brief Window WATCHDOG
  904. */
  905. typedef struct
  906. {
  907. __IO uint32_t CR; /*!< WWDG Control register, Address offset: 0x00 */
  908. __IO uint32_t CFR; /*!< WWDG Configuration register, Address offset: 0x04 */
  909. __IO uint32_t SR; /*!< WWDG Status register, Address offset: 0x08 */
  910. } WWDG_TypeDef;
  911. /**
  912. * @brief RNG
  913. */
  914. typedef struct
  915. {
  916. __IO uint32_t CR; /*!< RNG control register, Address offset: 0x00 */
  917. __IO uint32_t SR; /*!< RNG status register, Address offset: 0x04 */
  918. __IO uint32_t DR; /*!< RNG data register, Address offset: 0x08 */
  919. } RNG_TypeDef;
  920. /**
  921. * @brief USB_OTG_Core_Registers
  922. */
  923. typedef struct
  924. {
  925. __IO uint32_t GOTGCTL; /*!< USB_OTG Control and Status Register 000h */
  926. __IO uint32_t GOTGINT; /*!< USB_OTG Interrupt Register 004h */
  927. __IO uint32_t GAHBCFG; /*!< Core AHB Configuration Register 008h */
  928. __IO uint32_t GUSBCFG; /*!< Core USB Configuration Register 00Ch */
  929. __IO uint32_t GRSTCTL; /*!< Core Reset Register 010h */
  930. __IO uint32_t GINTSTS; /*!< Core Interrupt Register 014h */
  931. __IO uint32_t GINTMSK; /*!< Core Interrupt Mask Register 018h */
  932. __IO uint32_t GRXSTSR; /*!< Receive Sts Q Read Register 01Ch */
  933. __IO uint32_t GRXSTSP; /*!< Receive Sts Q Read & POP Register 020h */
  934. __IO uint32_t GRXFSIZ; /*!< Receive FIFO Size Register 024h */
  935. __IO uint32_t DIEPTXF0_HNPTXFSIZ; /*!< EP0 / Non Periodic Tx FIFO Size Register 028h */
  936. __IO uint32_t HNPTXSTS; /*!< Non Periodic Tx FIFO/Queue Sts reg 02Ch */
  937. uint32_t Reserved30[2]; /*!< Reserved 030h */
  938. __IO uint32_t GCCFG; /*!< General Purpose IO Register 038h */
  939. __IO uint32_t CID; /*!< User ID Register 03Ch */
  940. uint32_t Reserved5[3]; /*!< Reserved 040h-048h */
  941. __IO uint32_t GHWCFG3; /*!< User HW config3 04Ch */
  942. uint32_t Reserved6; /*!< Reserved 050h */
  943. __IO uint32_t GLPMCFG; /*!< LPM Register 054h */
  944. uint32_t Reserved; /*!< Reserved 058h */
  945. __IO uint32_t GDFIFOCFG; /*!< DFIFO Software Config Register 05Ch */
  946. uint32_t Reserved43[40]; /*!< Reserved 058h-0FFh */
  947. __IO uint32_t HPTXFSIZ; /*!< Host Periodic Tx FIFO Size Reg 100h */
  948. __IO uint32_t DIEPTXF[0x0F]; /*!< dev Periodic Transmit FIFO */
  949. } USB_OTG_GlobalTypeDef;
  950. /**
  951. * @brief USB_OTG_device_Registers
  952. */
  953. typedef struct
  954. {
  955. __IO uint32_t DCFG; /*!< dev Configuration Register 800h */
  956. __IO uint32_t DCTL; /*!< dev Control Register 804h */
  957. __IO uint32_t DSTS; /*!< dev Status Register (RO) 808h */
  958. uint32_t Reserved0C; /*!< Reserved 80Ch */
  959. __IO uint32_t DIEPMSK; /*!< dev IN Endpoint Mask 810h */
  960. __IO uint32_t DOEPMSK; /*!< dev OUT Endpoint Mask 814h */
  961. __IO uint32_t DAINT; /*!< dev All Endpoints Itr Reg 818h */
  962. __IO uint32_t DAINTMSK; /*!< dev All Endpoints Itr Mask 81Ch */
  963. uint32_t Reserved20; /*!< Reserved 820h */
  964. uint32_t Reserved9; /*!< Reserved 824h */
  965. __IO uint32_t DVBUSDIS; /*!< dev VBUS discharge Register 828h */
  966. __IO uint32_t DVBUSPULSE; /*!< dev VBUS Pulse Register 82Ch */
  967. __IO uint32_t DTHRCTL; /*!< dev threshold 830h */
  968. __IO uint32_t DIEPEMPMSK; /*!< dev empty msk 834h */
  969. __IO uint32_t DEACHINT; /*!< dedicated EP interrupt 838h */
  970. __IO uint32_t DEACHMSK; /*!< dedicated EP msk 83Ch */
  971. uint32_t Reserved40; /*!< dedicated EP mask 840h */
  972. __IO uint32_t DINEP1MSK; /*!< dedicated EP mask 844h */
  973. uint32_t Reserved44[15]; /*!< Reserved 844-87Ch */
  974. __IO uint32_t DOUTEP1MSK; /*!< dedicated EP msk 884h */
  975. } USB_OTG_DeviceTypeDef;
  976. /**
  977. * @brief USB_OTG_IN_Endpoint-Specific_Register
  978. */
  979. typedef struct
  980. {
  981. __IO uint32_t DIEPCTL; /*!< dev IN Endpoint Control Reg 900h + (ep_num * 20h) + 00h */
  982. uint32_t Reserved04; /*!< Reserved 900h + (ep_num * 20h) + 04h */
  983. __IO uint32_t DIEPINT; /*!< dev IN Endpoint Itr Reg 900h + (ep_num * 20h) + 08h */
  984. uint32_t Reserved0C; /*!< Reserved 900h + (ep_num * 20h) + 0Ch */
  985. __IO uint32_t DIEPTSIZ; /*!< IN Endpoint Txfer Size 900h + (ep_num * 20h) + 10h */
  986. __IO uint32_t DIEPDMA; /*!< IN Endpoint DMA Address Reg 900h + (ep_num * 20h) + 14h */
  987. __IO uint32_t DTXFSTS; /*!< IN Endpoint Tx FIFO Status Reg 900h + (ep_num * 20h) + 18h */
  988. uint32_t Reserved18; /*!< Reserved 900h+(ep_num*20h)+1Ch-900h+ (ep_num * 20h) + 1Ch */
  989. } USB_OTG_INEndpointTypeDef;
  990. /**
  991. * @brief USB_OTG_OUT_Endpoint-Specific_Registers
  992. */
  993. typedef struct
  994. {
  995. __IO uint32_t DOEPCTL; /*!< dev OUT Endpoint Control Reg B00h + (ep_num * 20h) + 00h */
  996. uint32_t Reserved04; /*!< Reserved B00h + (ep_num * 20h) + 04h */
  997. __IO uint32_t DOEPINT; /*!< dev OUT Endpoint Itr Reg B00h + (ep_num * 20h) + 08h */
  998. uint32_t Reserved0C; /*!< Reserved B00h + (ep_num * 20h) + 0Ch */
  999. __IO uint32_t DOEPTSIZ; /*!< dev OUT Endpoint Txfer Size B00h + (ep_num * 20h) + 10h */
  1000. __IO uint32_t DOEPDMA; /*!< dev OUT Endpoint DMA Address B00h + (ep_num * 20h) + 14h */
  1001. uint32_t Reserved18[2]; /*!< Reserved B00h + (ep_num * 20h) + 18h - B00h + (ep_num * 20h) + 1Ch */
  1002. } USB_OTG_OUTEndpointTypeDef;
  1003. /**
  1004. * @brief USB_OTG_Host_Mode_Register_Structures
  1005. */
  1006. typedef struct
  1007. {
  1008. __IO uint32_t HCFG; /*!< Host Configuration Register 400h */
  1009. __IO uint32_t HFIR; /*!< Host Frame Interval Register 404h */
  1010. __IO uint32_t HFNUM; /*!< Host Frame Nbr/Frame Remaining 408h */
  1011. uint32_t Reserved40C; /*!< Reserved 40Ch */
  1012. __IO uint32_t HPTXSTS; /*!< Host Periodic Tx FIFO/ Queue Status 410h */
  1013. __IO uint32_t HAINT; /*!< Host All Channels Interrupt Register 414h */
  1014. __IO uint32_t HAINTMSK; /*!< Host All Channels Interrupt Mask 418h */
  1015. } USB_OTG_HostTypeDef;
  1016. /**
  1017. * @brief USB_OTG_Host_Channel_Specific_Registers
  1018. */
  1019. typedef struct
  1020. {
  1021. __IO uint32_t HCCHAR; /*!< Host Channel Characteristics Register 500h */
  1022. __IO uint32_t HCSPLT; /*!< Host Channel Split Control Register 504h */
  1023. __IO uint32_t HCINT; /*!< Host Channel Interrupt Register 508h */
  1024. __IO uint32_t HCINTMSK; /*!< Host Channel Interrupt Mask Register 50Ch */
  1025. __IO uint32_t HCTSIZ; /*!< Host Channel Transfer Size Register 510h */
  1026. __IO uint32_t HCDMA; /*!< Host Channel DMA Address Register 514h */
  1027. uint32_t Reserved[2]; /*!< Reserved */
  1028. } USB_OTG_HostChannelTypeDef;
  1029. /**
  1030. * @}
  1031. */
  1032. /** @addtogroup Peripheral_memory_map
  1033. * @{
  1034. */
  1035. #define FLASH_BASE ((uint32_t)0x08000000) /*!< FLASH(up to 1 MB) base address in the alias region */
  1036. #define CCMDATARAM_BASE ((uint32_t)0x10000000) /*!< CCM(core coupled memory) data RAM(64 KB) base address in the alias region */
  1037. #define SRAM1_BASE ((uint32_t)0x20000000) /*!< SRAM1(160 KB) base address in the alias region */
  1038. #define SRAM2_BASE ((uint32_t)0x20028000) /*!< SRAM2(32 KB) base address in the alias region */
  1039. #define SRAM3_BASE ((uint32_t)0x20030000) /*!< SRAM3(128 KB) base address in the alias region */
  1040. #define PERIPH_BASE ((uint32_t)0x40000000) /*!< Peripheral base address in the alias region */
  1041. #define BKPSRAM_BASE ((uint32_t)0x40024000) /*!< Backup SRAM(4 KB) base address in the alias region */
  1042. #define FMC_R_BASE ((uint32_t)0xA0000000) /*!< FMC registers base address */
  1043. #define QSPI_R_BASE ((uint32_t)0xA0001000) /*!< QuadSPI registers base address */
  1044. #define SRAM1_BB_BASE ((uint32_t)0x22000000) /*!< SRAM1(112 KB) base address in the bit-band region */
  1045. #define SRAM2_BB_BASE ((uint32_t)0x22500000) /*!< SRAM2(16 KB) base address in the bit-band region */
  1046. #define SRAM3_BB_BASE ((uint32_t)0x22600000) /*!< SRAM3(64 KB) base address in the bit-band region */
  1047. #define PERIPH_BB_BASE ((uint32_t)0x42000000) /*!< Peripheral base address in the bit-band region */
  1048. #define BKPSRAM_BB_BASE ((uint32_t)0x42480000) /*!< Backup SRAM(4 KB) base address in the bit-band region */
  1049. #define FLASH_END ((uint32_t)0x081FFFFF) /*!< FLASH end address */
  1050. #define CCMDATARAM_END ((uint32_t)0x1000FFFF) /*!< CCM data RAM end address */
  1051. /* Legacy defines */
  1052. #define SRAM_BASE SRAM1_BASE
  1053. #define SRAM_BB_BASE SRAM1_BB_BASE
  1054. /*!< Peripheral memory map */
  1055. #define APB1PERIPH_BASE PERIPH_BASE
  1056. #define APB2PERIPH_BASE (PERIPH_BASE + 0x00010000)
  1057. #define AHB1PERIPH_BASE (PERIPH_BASE + 0x00020000)
  1058. #define AHB2PERIPH_BASE (PERIPH_BASE + 0x10000000)
  1059. /*!< APB1 peripherals */
  1060. #define TIM2_BASE (APB1PERIPH_BASE + 0x0000)
  1061. #define TIM3_BASE (APB1PERIPH_BASE + 0x0400)
  1062. #define TIM4_BASE (APB1PERIPH_BASE + 0x0800)
  1063. #define TIM5_BASE (APB1PERIPH_BASE + 0x0C00)
  1064. #define TIM6_BASE (APB1PERIPH_BASE + 0x1000)
  1065. #define TIM7_BASE (APB1PERIPH_BASE + 0x1400)
  1066. #define TIM12_BASE (APB1PERIPH_BASE + 0x1800)
  1067. #define TIM13_BASE (APB1PERIPH_BASE + 0x1C00)
  1068. #define TIM14_BASE (APB1PERIPH_BASE + 0x2000)
  1069. #define RTC_BASE (APB1PERIPH_BASE + 0x2800)
  1070. #define WWDG_BASE (APB1PERIPH_BASE + 0x2C00)
  1071. #define IWDG_BASE (APB1PERIPH_BASE + 0x3000)
  1072. #define I2S2ext_BASE (APB1PERIPH_BASE + 0x3400)
  1073. #define SPI2_BASE (APB1PERIPH_BASE + 0x3800)
  1074. #define SPI3_BASE (APB1PERIPH_BASE + 0x3C00)
  1075. #define I2S3ext_BASE (APB1PERIPH_BASE + 0x4000)
  1076. #define USART2_BASE (APB1PERIPH_BASE + 0x4400)
  1077. #define USART3_BASE (APB1PERIPH_BASE + 0x4800)
  1078. #define UART4_BASE (APB1PERIPH_BASE + 0x4C00)
  1079. #define UART5_BASE (APB1PERIPH_BASE + 0x5000)
  1080. #define I2C1_BASE (APB1PERIPH_BASE + 0x5400)
  1081. #define I2C2_BASE (APB1PERIPH_BASE + 0x5800)
  1082. #define I2C3_BASE (APB1PERIPH_BASE + 0x5C00)
  1083. #define CAN1_BASE (APB1PERIPH_BASE + 0x6400)
  1084. #define CAN2_BASE (APB1PERIPH_BASE + 0x6800)
  1085. #define PWR_BASE (APB1PERIPH_BASE + 0x7000)
  1086. #define DAC_BASE (APB1PERIPH_BASE + 0x7400)
  1087. #define UART7_BASE (APB1PERIPH_BASE + 0x7800)
  1088. #define UART8_BASE (APB1PERIPH_BASE + 0x7C00)
  1089. /*!< APB2 peripherals */
  1090. #define TIM1_BASE (APB2PERIPH_BASE + 0x0000)
  1091. #define TIM8_BASE (APB2PERIPH_BASE + 0x0400)
  1092. #define USART1_BASE (APB2PERIPH_BASE + 0x1000)
  1093. #define USART6_BASE (APB2PERIPH_BASE + 0x1400)
  1094. #define ADC1_BASE (APB2PERIPH_BASE + 0x2000)
  1095. #define ADC2_BASE (APB2PERIPH_BASE + 0x2100)
  1096. #define ADC3_BASE (APB2PERIPH_BASE + 0x2200)
  1097. #define ADC_BASE (APB2PERIPH_BASE + 0x2300)
  1098. #define SDIO_BASE (APB2PERIPH_BASE + 0x2C00)
  1099. #define SPI1_BASE (APB2PERIPH_BASE + 0x3000)
  1100. #define SPI4_BASE (APB2PERIPH_BASE + 0x3400)
  1101. #define SYSCFG_BASE (APB2PERIPH_BASE + 0x3800)
  1102. #define EXTI_BASE (APB2PERIPH_BASE + 0x3C00)
  1103. #define TIM9_BASE (APB2PERIPH_BASE + 0x4000)
  1104. #define TIM10_BASE (APB2PERIPH_BASE + 0x4400)
  1105. #define TIM11_BASE (APB2PERIPH_BASE + 0x4800)
  1106. #define SPI5_BASE (APB2PERIPH_BASE + 0x5000)
  1107. #define SPI6_BASE (APB2PERIPH_BASE + 0x5400)
  1108. #define SAI1_BASE (APB2PERIPH_BASE + 0x5800)
  1109. #define SAI1_Block_A_BASE (SAI1_BASE + 0x004)
  1110. #define SAI1_Block_B_BASE (SAI1_BASE + 0x024)
  1111. #define LTDC_BASE (APB2PERIPH_BASE + 0x6800)
  1112. #define LTDC_Layer1_BASE (LTDC_BASE + 0x84)
  1113. #define LTDC_Layer2_BASE (LTDC_BASE + 0x104)
  1114. #define DSI_BASE (APB2PERIPH_BASE + 0x6C00)
  1115. /*!< AHB1 peripherals */
  1116. #define GPIOA_BASE (AHB1PERIPH_BASE + 0x0000)
  1117. #define GPIOB_BASE (AHB1PERIPH_BASE + 0x0400)
  1118. #define GPIOC_BASE (AHB1PERIPH_BASE + 0x0800)
  1119. #define GPIOD_BASE (AHB1PERIPH_BASE + 0x0C00)
  1120. #define GPIOE_BASE (AHB1PERIPH_BASE + 0x1000)
  1121. #define GPIOF_BASE (AHB1PERIPH_BASE + 0x1400)
  1122. #define GPIOG_BASE (AHB1PERIPH_BASE + 0x1800)
  1123. #define GPIOH_BASE (AHB1PERIPH_BASE + 0x1C00)
  1124. #define GPIOI_BASE (AHB1PERIPH_BASE + 0x2000)
  1125. #define GPIOJ_BASE (AHB1PERIPH_BASE + 0x2400)
  1126. #define GPIOK_BASE (AHB1PERIPH_BASE + 0x2800)
  1127. #define CRC_BASE (AHB1PERIPH_BASE + 0x3000)
  1128. #define RCC_BASE (AHB1PERIPH_BASE + 0x3800)
  1129. #define FLASH_R_BASE (AHB1PERIPH_BASE + 0x3C00)
  1130. #define DMA1_BASE (AHB1PERIPH_BASE + 0x6000)
  1131. #define DMA1_Stream0_BASE (DMA1_BASE + 0x010)
  1132. #define DMA1_Stream1_BASE (DMA1_BASE + 0x028)
  1133. #define DMA1_Stream2_BASE (DMA1_BASE + 0x040)
  1134. #define DMA1_Stream3_BASE (DMA1_BASE + 0x058)
  1135. #define DMA1_Stream4_BASE (DMA1_BASE + 0x070)
  1136. #define DMA1_Stream5_BASE (DMA1_BASE + 0x088)
  1137. #define DMA1_Stream6_BASE (DMA1_BASE + 0x0A0)
  1138. #define DMA1_Stream7_BASE (DMA1_BASE + 0x0B8)
  1139. #define DMA2_BASE (AHB1PERIPH_BASE + 0x6400)
  1140. #define DMA2_Stream0_BASE (DMA2_BASE + 0x010)
  1141. #define DMA2_Stream1_BASE (DMA2_BASE + 0x028)
  1142. #define DMA2_Stream2_BASE (DMA2_BASE + 0x040)
  1143. #define DMA2_Stream3_BASE (DMA2_BASE + 0x058)
  1144. #define DMA2_Stream4_BASE (DMA2_BASE + 0x070)
  1145. #define DMA2_Stream5_BASE (DMA2_BASE + 0x088)
  1146. #define DMA2_Stream6_BASE (DMA2_BASE + 0x0A0)
  1147. #define DMA2_Stream7_BASE (DMA2_BASE + 0x0B8)
  1148. #define ETH_BASE (AHB1PERIPH_BASE + 0x8000)
  1149. #define ETH_MAC_BASE (ETH_BASE)
  1150. #define ETH_MMC_BASE (ETH_BASE + 0x0100)
  1151. #define ETH_PTP_BASE (ETH_BASE + 0x0700)
  1152. #define ETH_DMA_BASE (ETH_BASE + 0x1000)
  1153. #define DMA2D_BASE (AHB1PERIPH_BASE + 0xB000)
  1154. /*!< AHB2 peripherals */
  1155. #define DCMI_BASE (AHB2PERIPH_BASE + 0x50000)
  1156. #define RNG_BASE (AHB2PERIPH_BASE + 0x60800)
  1157. /*!< FMC Bankx registers base address */
  1158. #define FMC_Bank1_R_BASE (FMC_R_BASE + 0x0000)
  1159. #define FMC_Bank1E_R_BASE (FMC_R_BASE + 0x0104)
  1160. #define FMC_Bank3_R_BASE (FMC_R_BASE + 0x0080)
  1161. #define FMC_Bank5_6_R_BASE (FMC_R_BASE + 0x0140)
  1162. /*!< Debug MCU registers base address */
  1163. #define DBGMCU_BASE ((uint32_t )0xE0042000)
  1164. /*!< USB registers base address */
  1165. #define USB_OTG_HS_PERIPH_BASE ((uint32_t )0x40040000)
  1166. #define USB_OTG_FS_PERIPH_BASE ((uint32_t )0x50000000)
  1167. #define USB_OTG_GLOBAL_BASE ((uint32_t )0x000)
  1168. #define USB_OTG_DEVICE_BASE ((uint32_t )0x800)
  1169. #define USB_OTG_IN_ENDPOINT_BASE ((uint32_t )0x900)
  1170. #define USB_OTG_OUT_ENDPOINT_BASE ((uint32_t )0xB00)
  1171. #define USB_OTG_EP_REG_SIZE ((uint32_t )0x20)
  1172. #define USB_OTG_HOST_BASE ((uint32_t )0x400)
  1173. #define USB_OTG_HOST_PORT_BASE ((uint32_t )0x440)
  1174. #define USB_OTG_HOST_CHANNEL_BASE ((uint32_t )0x500)
  1175. #define USB_OTG_HOST_CHANNEL_SIZE ((uint32_t )0x20)
  1176. #define USB_OTG_PCGCCTL_BASE ((uint32_t )0xE00)
  1177. #define USB_OTG_FIFO_BASE ((uint32_t )0x1000)
  1178. #define USB_OTG_FIFO_SIZE ((uint32_t )0x1000)
  1179. /**
  1180. * @}
  1181. */
  1182. /** @addtogroup Peripheral_declaration
  1183. * @{
  1184. */
  1185. #define TIM2 ((TIM_TypeDef *) TIM2_BASE)
  1186. #define TIM3 ((TIM_TypeDef *) TIM3_BASE)
  1187. #define TIM4 ((TIM_TypeDef *) TIM4_BASE)
  1188. #define TIM5 ((TIM_TypeDef *) TIM5_BASE)
  1189. #define TIM6 ((TIM_TypeDef *) TIM6_BASE)
  1190. #define TIM7 ((TIM_TypeDef *) TIM7_BASE)
  1191. #define TIM12 ((TIM_TypeDef *) TIM12_BASE)
  1192. #define TIM13 ((TIM_TypeDef *) TIM13_BASE)
  1193. #define TIM14 ((TIM_TypeDef *) TIM14_BASE)
  1194. #define RTC ((RTC_TypeDef *) RTC_BASE)
  1195. #define WWDG ((WWDG_TypeDef *) WWDG_BASE)
  1196. #define IWDG ((IWDG_TypeDef *) IWDG_BASE)
  1197. #define I2S2ext ((SPI_TypeDef *) I2S2ext_BASE)
  1198. #define SPI2 ((SPI_TypeDef *) SPI2_BASE)
  1199. #define SPI3 ((SPI_TypeDef *) SPI3_BASE)
  1200. #define I2S3ext ((SPI_TypeDef *) I2S3ext_BASE)
  1201. #define USART2 ((USART_TypeDef *) USART2_BASE)
  1202. #define USART3 ((USART_TypeDef *) USART3_BASE)
  1203. #define UART4 ((USART_TypeDef *) UART4_BASE)
  1204. #define UART5 ((USART_TypeDef *) UART5_BASE)
  1205. #define I2C1 ((I2C_TypeDef *) I2C1_BASE)
  1206. #define I2C2 ((I2C_TypeDef *) I2C2_BASE)
  1207. #define I2C3 ((I2C_TypeDef *) I2C3_BASE)
  1208. #define CAN1 ((CAN_TypeDef *) CAN1_BASE)
  1209. #define CAN2 ((CAN_TypeDef *) CAN2_BASE)
  1210. #define PWR ((PWR_TypeDef *) PWR_BASE)
  1211. #define DAC ((DAC_TypeDef *) DAC_BASE)
  1212. #define UART7 ((USART_TypeDef *) UART7_BASE)
  1213. #define UART8 ((USART_TypeDef *) UART8_BASE)
  1214. #define TIM1 ((TIM_TypeDef *) TIM1_BASE)
  1215. #define TIM8 ((TIM_TypeDef *) TIM8_BASE)
  1216. #define USART1 ((USART_TypeDef *) USART1_BASE)
  1217. #define USART6 ((USART_TypeDef *) USART6_BASE)
  1218. #define ADC ((ADC_Common_TypeDef *) ADC_BASE)
  1219. #define ADC1 ((ADC_TypeDef *) ADC1_BASE)
  1220. #define ADC2 ((ADC_TypeDef *) ADC2_BASE)
  1221. #define ADC3 ((ADC_TypeDef *) ADC3_BASE)
  1222. #define SDIO ((SDIO_TypeDef *) SDIO_BASE)
  1223. #define SPI1 ((SPI_TypeDef *) SPI1_BASE)
  1224. #define SPI4 ((SPI_TypeDef *) SPI4_BASE)
  1225. #define SYSCFG ((SYSCFG_TypeDef *) SYSCFG_BASE)
  1226. #define EXTI ((EXTI_TypeDef *) EXTI_BASE)
  1227. #define TIM9 ((TIM_TypeDef *) TIM9_BASE)
  1228. #define TIM10 ((TIM_TypeDef *) TIM10_BASE)
  1229. #define TIM11 ((TIM_TypeDef *) TIM11_BASE)
  1230. #define SPI5 ((SPI_TypeDef *) SPI5_BASE)
  1231. #define SPI6 ((SPI_TypeDef *) SPI6_BASE)
  1232. #define SAI1 ((SAI_TypeDef *) SAI1_BASE)
  1233. #define SAI1_Block_A ((SAI_Block_TypeDef *)SAI1_Block_A_BASE)
  1234. #define SAI1_Block_B ((SAI_Block_TypeDef *)SAI1_Block_B_BASE)
  1235. #define LTDC ((LTDC_TypeDef *)LTDC_BASE)
  1236. #define LTDC_Layer1 ((LTDC_Layer_TypeDef *)LTDC_Layer1_BASE)
  1237. #define LTDC_Layer2 ((LTDC_Layer_TypeDef *)LTDC_Layer2_BASE)
  1238. #define DSI ((DSI_TypeDef *)DSI_BASE)
  1239. #define GPIOA ((GPIO_TypeDef *) GPIOA_BASE)
  1240. #define GPIOB ((GPIO_TypeDef *) GPIOB_BASE)
  1241. #define GPIOC ((GPIO_TypeDef *) GPIOC_BASE)
  1242. #define GPIOD ((GPIO_TypeDef *) GPIOD_BASE)
  1243. #define GPIOE ((GPIO_TypeDef *) GPIOE_BASE)
  1244. #define GPIOF ((GPIO_TypeDef *) GPIOF_BASE)
  1245. #define GPIOG ((GPIO_TypeDef *) GPIOG_BASE)
  1246. #define GPIOH ((GPIO_TypeDef *) GPIOH_BASE)
  1247. #define GPIOI ((GPIO_TypeDef *) GPIOI_BASE)
  1248. #define GPIOJ ((GPIO_TypeDef *) GPIOJ_BASE)
  1249. #define GPIOK ((GPIO_TypeDef *) GPIOK_BASE)
  1250. #define CRC ((CRC_TypeDef *) CRC_BASE)
  1251. #define RCC ((RCC_TypeDef *) RCC_BASE)
  1252. #define FLASH ((FLASH_TypeDef *) FLASH_R_BASE)
  1253. #define DMA1 ((DMA_TypeDef *) DMA1_BASE)
  1254. #define DMA1_Stream0 ((DMA_Stream_TypeDef *) DMA1_Stream0_BASE)
  1255. #define DMA1_Stream1 ((DMA_Stream_TypeDef *) DMA1_Stream1_BASE)
  1256. #define DMA1_Stream2 ((DMA_Stream_TypeDef *) DMA1_Stream2_BASE)
  1257. #define DMA1_Stream3 ((DMA_Stream_TypeDef *) DMA1_Stream3_BASE)
  1258. #define DMA1_Stream4 ((DMA_Stream_TypeDef *) DMA1_Stream4_BASE)
  1259. #define DMA1_Stream5 ((DMA_Stream_TypeDef *) DMA1_Stream5_BASE)
  1260. #define DMA1_Stream6 ((DMA_Stream_TypeDef *) DMA1_Stream6_BASE)
  1261. #define DMA1_Stream7 ((DMA_Stream_TypeDef *) DMA1_Stream7_BASE)
  1262. #define DMA2 ((DMA_TypeDef *) DMA2_BASE)
  1263. #define DMA2_Stream0 ((DMA_Stream_TypeDef *) DMA2_Stream0_BASE)
  1264. #define DMA2_Stream1 ((DMA_Stream_TypeDef *) DMA2_Stream1_BASE)
  1265. #define DMA2_Stream2 ((DMA_Stream_TypeDef *) DMA2_Stream2_BASE)
  1266. #define DMA2_Stream3 ((DMA_Stream_TypeDef *) DMA2_Stream3_BASE)
  1267. #define DMA2_Stream4 ((DMA_Stream_TypeDef *) DMA2_Stream4_BASE)
  1268. #define DMA2_Stream5 ((DMA_Stream_TypeDef *) DMA2_Stream5_BASE)
  1269. #define DMA2_Stream6 ((DMA_Stream_TypeDef *) DMA2_Stream6_BASE)
  1270. #define DMA2_Stream7 ((DMA_Stream_TypeDef *) DMA2_Stream7_BASE)
  1271. #define ETH ((ETH_TypeDef *) ETH_BASE)
  1272. #define DMA2D ((DMA2D_TypeDef *)DMA2D_BASE)
  1273. #define DCMI ((DCMI_TypeDef *) DCMI_BASE)
  1274. #define RNG ((RNG_TypeDef *) RNG_BASE)
  1275. #define FMC_Bank1 ((FMC_Bank1_TypeDef *) FMC_Bank1_R_BASE)
  1276. #define FMC_Bank1E ((FMC_Bank1E_TypeDef *) FMC_Bank1E_R_BASE)
  1277. #define FMC_Bank3 ((FMC_Bank3_TypeDef *) FMC_Bank3_R_BASE)
  1278. #define FMC_Bank5_6 ((FMC_Bank5_6_TypeDef *) FMC_Bank5_6_R_BASE)
  1279. #define QUADSPI ((QUADSPI_TypeDef *) QSPI_R_BASE)
  1280. #define DBGMCU ((DBGMCU_TypeDef *) DBGMCU_BASE)
  1281. #define USB_OTG_FS ((USB_OTG_GlobalTypeDef *) USB_OTG_FS_PERIPH_BASE)
  1282. #define USB_OTG_HS ((USB_OTG_GlobalTypeDef *) USB_OTG_HS_PERIPH_BASE)
  1283. /**
  1284. * @}
  1285. */
  1286. /** @addtogroup Exported_constants
  1287. * @{
  1288. */
  1289. /** @addtogroup Peripheral_Registers_Bits_Definition
  1290. * @{
  1291. */
  1292. /******************************************************************************/
  1293. /* Peripheral Registers_Bits_Definition */
  1294. /******************************************************************************/
  1295. /******************************************************************************/
  1296. /* */
  1297. /* Analog to Digital Converter */
  1298. /* */
  1299. /******************************************************************************/
  1300. /******************** Bit definition for ADC_SR register ********************/
  1301. #define ADC_SR_AWD ((uint32_t)0x00000001) /*!<Analog watchdog flag */
  1302. #define ADC_SR_EOC ((uint32_t)0x00000002) /*!<End of conversion */
  1303. #define ADC_SR_JEOC ((uint32_t)0x00000004) /*!<Injected channel end of conversion */
  1304. #define ADC_SR_JSTRT ((uint32_t)0x00000008) /*!<Injected channel Start flag */
  1305. #define ADC_SR_STRT ((uint32_t)0x00000010) /*!<Regular channel Start flag */
  1306. #define ADC_SR_OVR ((uint32_t)0x00000020) /*!<Overrun flag */
  1307. /******************* Bit definition for ADC_CR1 register ********************/
  1308. #define ADC_CR1_AWDCH ((uint32_t)0x0000001F) /*!<AWDCH[4:0] bits (Analog watchdog channel select bits) */
  1309. #define ADC_CR1_AWDCH_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1310. #define ADC_CR1_AWDCH_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1311. #define ADC_CR1_AWDCH_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1312. #define ADC_CR1_AWDCH_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  1313. #define ADC_CR1_AWDCH_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  1314. #define ADC_CR1_EOCIE ((uint32_t)0x00000020) /*!<Interrupt enable for EOC */
  1315. #define ADC_CR1_AWDIE ((uint32_t)0x00000040) /*!<AAnalog Watchdog interrupt enable */
  1316. #define ADC_CR1_JEOCIE ((uint32_t)0x00000080) /*!<Interrupt enable for injected channels */
  1317. #define ADC_CR1_SCAN ((uint32_t)0x00000100) /*!<Scan mode */
  1318. #define ADC_CR1_AWDSGL ((uint32_t)0x00000200) /*!<Enable the watchdog on a single channel in scan mode */
  1319. #define ADC_CR1_JAUTO ((uint32_t)0x00000400) /*!<Automatic injected group conversion */
  1320. #define ADC_CR1_DISCEN ((uint32_t)0x00000800) /*!<Discontinuous mode on regular channels */
  1321. #define ADC_CR1_JDISCEN ((uint32_t)0x00001000) /*!<Discontinuous mode on injected channels */
  1322. #define ADC_CR1_DISCNUM ((uint32_t)0x0000E000) /*!<DISCNUM[2:0] bits (Discontinuous mode channel count) */
  1323. #define ADC_CR1_DISCNUM_0 ((uint32_t)0x00002000) /*!<Bit 0 */
  1324. #define ADC_CR1_DISCNUM_1 ((uint32_t)0x00004000) /*!<Bit 1 */
  1325. #define ADC_CR1_DISCNUM_2 ((uint32_t)0x00008000) /*!<Bit 2 */
  1326. #define ADC_CR1_JAWDEN ((uint32_t)0x00400000) /*!<Analog watchdog enable on injected channels */
  1327. #define ADC_CR1_AWDEN ((uint32_t)0x00800000) /*!<Analog watchdog enable on regular channels */
  1328. #define ADC_CR1_RES ((uint32_t)0x03000000) /*!<RES[2:0] bits (Resolution) */
  1329. #define ADC_CR1_RES_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  1330. #define ADC_CR1_RES_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  1331. #define ADC_CR1_OVRIE ((uint32_t)0x04000000) /*!<overrun interrupt enable */
  1332. /******************* Bit definition for ADC_CR2 register ********************/
  1333. #define ADC_CR2_ADON ((uint32_t)0x00000001) /*!<A/D Converter ON / OFF */
  1334. #define ADC_CR2_CONT ((uint32_t)0x00000002) /*!<Continuous Conversion */
  1335. #define ADC_CR2_DMA ((uint32_t)0x00000100) /*!<Direct Memory access mode */
  1336. #define ADC_CR2_DDS ((uint32_t)0x00000200) /*!<DMA disable selection (Single ADC) */
  1337. #define ADC_CR2_EOCS ((uint32_t)0x00000400) /*!<End of conversion selection */
  1338. #define ADC_CR2_ALIGN ((uint32_t)0x00000800) /*!<Data Alignment */
  1339. #define ADC_CR2_JEXTSEL ((uint32_t)0x000F0000) /*!<JEXTSEL[3:0] bits (External event select for injected group) */
  1340. #define ADC_CR2_JEXTSEL_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  1341. #define ADC_CR2_JEXTSEL_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  1342. #define ADC_CR2_JEXTSEL_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  1343. #define ADC_CR2_JEXTSEL_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  1344. #define ADC_CR2_JEXTEN ((uint32_t)0x00300000) /*!<JEXTEN[1:0] bits (External Trigger Conversion mode for injected channelsp) */
  1345. #define ADC_CR2_JEXTEN_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  1346. #define ADC_CR2_JEXTEN_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  1347. #define ADC_CR2_JSWSTART ((uint32_t)0x00400000) /*!<Start Conversion of injected channels */
  1348. #define ADC_CR2_EXTSEL ((uint32_t)0x0F000000) /*!<EXTSEL[3:0] bits (External Event Select for regular group) */
  1349. #define ADC_CR2_EXTSEL_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  1350. #define ADC_CR2_EXTSEL_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  1351. #define ADC_CR2_EXTSEL_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  1352. #define ADC_CR2_EXTSEL_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  1353. #define ADC_CR2_EXTEN ((uint32_t)0x30000000) /*!<EXTEN[1:0] bits (External Trigger Conversion mode for regular channelsp) */
  1354. #define ADC_CR2_EXTEN_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  1355. #define ADC_CR2_EXTEN_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  1356. #define ADC_CR2_SWSTART ((uint32_t)0x40000000) /*!<Start Conversion of regular channels */
  1357. /****************** Bit definition for ADC_SMPR1 register *******************/
  1358. #define ADC_SMPR1_SMP10 ((uint32_t)0x00000007) /*!<SMP10[2:0] bits (Channel 10 Sample time selection) */
  1359. #define ADC_SMPR1_SMP10_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1360. #define ADC_SMPR1_SMP10_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1361. #define ADC_SMPR1_SMP10_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1362. #define ADC_SMPR1_SMP11 ((uint32_t)0x00000038) /*!<SMP11[2:0] bits (Channel 11 Sample time selection) */
  1363. #define ADC_SMPR1_SMP11_0 ((uint32_t)0x00000008) /*!<Bit 0 */
  1364. #define ADC_SMPR1_SMP11_1 ((uint32_t)0x00000010) /*!<Bit 1 */
  1365. #define ADC_SMPR1_SMP11_2 ((uint32_t)0x00000020) /*!<Bit 2 */
  1366. #define ADC_SMPR1_SMP12 ((uint32_t)0x000001C0) /*!<SMP12[2:0] bits (Channel 12 Sample time selection) */
  1367. #define ADC_SMPR1_SMP12_0 ((uint32_t)0x00000040) /*!<Bit 0 */
  1368. #define ADC_SMPR1_SMP12_1 ((uint32_t)0x00000080) /*!<Bit 1 */
  1369. #define ADC_SMPR1_SMP12_2 ((uint32_t)0x00000100) /*!<Bit 2 */
  1370. #define ADC_SMPR1_SMP13 ((uint32_t)0x00000E00) /*!<SMP13[2:0] bits (Channel 13 Sample time selection) */
  1371. #define ADC_SMPR1_SMP13_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  1372. #define ADC_SMPR1_SMP13_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  1373. #define ADC_SMPR1_SMP13_2 ((uint32_t)0x00000800) /*!<Bit 2 */
  1374. #define ADC_SMPR1_SMP14 ((uint32_t)0x00007000) /*!<SMP14[2:0] bits (Channel 14 Sample time selection) */
  1375. #define ADC_SMPR1_SMP14_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  1376. #define ADC_SMPR1_SMP14_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  1377. #define ADC_SMPR1_SMP14_2 ((uint32_t)0x00004000) /*!<Bit 2 */
  1378. #define ADC_SMPR1_SMP15 ((uint32_t)0x00038000) /*!<SMP15[2:0] bits (Channel 15 Sample time selection) */
  1379. #define ADC_SMPR1_SMP15_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  1380. #define ADC_SMPR1_SMP15_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  1381. #define ADC_SMPR1_SMP15_2 ((uint32_t)0x00020000) /*!<Bit 2 */
  1382. #define ADC_SMPR1_SMP16 ((uint32_t)0x001C0000) /*!<SMP16[2:0] bits (Channel 16 Sample time selection) */
  1383. #define ADC_SMPR1_SMP16_0 ((uint32_t)0x00040000) /*!<Bit 0 */
  1384. #define ADC_SMPR1_SMP16_1 ((uint32_t)0x00080000) /*!<Bit 1 */
  1385. #define ADC_SMPR1_SMP16_2 ((uint32_t)0x00100000) /*!<Bit 2 */
  1386. #define ADC_SMPR1_SMP17 ((uint32_t)0x00E00000) /*!<SMP17[2:0] bits (Channel 17 Sample time selection) */
  1387. #define ADC_SMPR1_SMP17_0 ((uint32_t)0x00200000) /*!<Bit 0 */
  1388. #define ADC_SMPR1_SMP17_1 ((uint32_t)0x00400000) /*!<Bit 1 */
  1389. #define ADC_SMPR1_SMP17_2 ((uint32_t)0x00800000) /*!<Bit 2 */
  1390. #define ADC_SMPR1_SMP18 ((uint32_t)0x07000000) /*!<SMP18[2:0] bits (Channel 18 Sample time selection) */
  1391. #define ADC_SMPR1_SMP18_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  1392. #define ADC_SMPR1_SMP18_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  1393. #define ADC_SMPR1_SMP18_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  1394. /****************** Bit definition for ADC_SMPR2 register *******************/
  1395. #define ADC_SMPR2_SMP0 ((uint32_t)0x00000007) /*!<SMP0[2:0] bits (Channel 0 Sample time selection) */
  1396. #define ADC_SMPR2_SMP0_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1397. #define ADC_SMPR2_SMP0_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1398. #define ADC_SMPR2_SMP0_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1399. #define ADC_SMPR2_SMP1 ((uint32_t)0x00000038) /*!<SMP1[2:0] bits (Channel 1 Sample time selection) */
  1400. #define ADC_SMPR2_SMP1_0 ((uint32_t)0x00000008) /*!<Bit 0 */
  1401. #define ADC_SMPR2_SMP1_1 ((uint32_t)0x00000010) /*!<Bit 1 */
  1402. #define ADC_SMPR2_SMP1_2 ((uint32_t)0x00000020) /*!<Bit 2 */
  1403. #define ADC_SMPR2_SMP2 ((uint32_t)0x000001C0) /*!<SMP2[2:0] bits (Channel 2 Sample time selection) */
  1404. #define ADC_SMPR2_SMP2_0 ((uint32_t)0x00000040) /*!<Bit 0 */
  1405. #define ADC_SMPR2_SMP2_1 ((uint32_t)0x00000080) /*!<Bit 1 */
  1406. #define ADC_SMPR2_SMP2_2 ((uint32_t)0x00000100) /*!<Bit 2 */
  1407. #define ADC_SMPR2_SMP3 ((uint32_t)0x00000E00) /*!<SMP3[2:0] bits (Channel 3 Sample time selection) */
  1408. #define ADC_SMPR2_SMP3_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  1409. #define ADC_SMPR2_SMP3_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  1410. #define ADC_SMPR2_SMP3_2 ((uint32_t)0x00000800) /*!<Bit 2 */
  1411. #define ADC_SMPR2_SMP4 ((uint32_t)0x00007000) /*!<SMP4[2:0] bits (Channel 4 Sample time selection) */
  1412. #define ADC_SMPR2_SMP4_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  1413. #define ADC_SMPR2_SMP4_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  1414. #define ADC_SMPR2_SMP4_2 ((uint32_t)0x00004000) /*!<Bit 2 */
  1415. #define ADC_SMPR2_SMP5 ((uint32_t)0x00038000) /*!<SMP5[2:0] bits (Channel 5 Sample time selection) */
  1416. #define ADC_SMPR2_SMP5_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  1417. #define ADC_SMPR2_SMP5_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  1418. #define ADC_SMPR2_SMP5_2 ((uint32_t)0x00020000) /*!<Bit 2 */
  1419. #define ADC_SMPR2_SMP6 ((uint32_t)0x001C0000) /*!<SMP6[2:0] bits (Channel 6 Sample time selection) */
  1420. #define ADC_SMPR2_SMP6_0 ((uint32_t)0x00040000) /*!<Bit 0 */
  1421. #define ADC_SMPR2_SMP6_1 ((uint32_t)0x00080000) /*!<Bit 1 */
  1422. #define ADC_SMPR2_SMP6_2 ((uint32_t)0x00100000) /*!<Bit 2 */
  1423. #define ADC_SMPR2_SMP7 ((uint32_t)0x00E00000) /*!<SMP7[2:0] bits (Channel 7 Sample time selection) */
  1424. #define ADC_SMPR2_SMP7_0 ((uint32_t)0x00200000) /*!<Bit 0 */
  1425. #define ADC_SMPR2_SMP7_1 ((uint32_t)0x00400000) /*!<Bit 1 */
  1426. #define ADC_SMPR2_SMP7_2 ((uint32_t)0x00800000) /*!<Bit 2 */
  1427. #define ADC_SMPR2_SMP8 ((uint32_t)0x07000000) /*!<SMP8[2:0] bits (Channel 8 Sample time selection) */
  1428. #define ADC_SMPR2_SMP8_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  1429. #define ADC_SMPR2_SMP8_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  1430. #define ADC_SMPR2_SMP8_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  1431. #define ADC_SMPR2_SMP9 ((uint32_t)0x38000000) /*!<SMP9[2:0] bits (Channel 9 Sample time selection) */
  1432. #define ADC_SMPR2_SMP9_0 ((uint32_t)0x08000000) /*!<Bit 0 */
  1433. #define ADC_SMPR2_SMP9_1 ((uint32_t)0x10000000) /*!<Bit 1 */
  1434. #define ADC_SMPR2_SMP9_2 ((uint32_t)0x20000000) /*!<Bit 2 */
  1435. /****************** Bit definition for ADC_JOFR1 register *******************/
  1436. #define ADC_JOFR1_JOFFSET1 ((uint32_t)0x0FFF) /*!<Data offset for injected channel 1 */
  1437. /****************** Bit definition for ADC_JOFR2 register *******************/
  1438. #define ADC_JOFR2_JOFFSET2 ((uint32_t)0x0FFF) /*!<Data offset for injected channel 2 */
  1439. /****************** Bit definition for ADC_JOFR3 register *******************/
  1440. #define ADC_JOFR3_JOFFSET3 ((uint32_t)0x0FFF) /*!<Data offset for injected channel 3 */
  1441. /****************** Bit definition for ADC_JOFR4 register *******************/
  1442. #define ADC_JOFR4_JOFFSET4 ((uint32_t)0x0FFF) /*!<Data offset for injected channel 4 */
  1443. /******************* Bit definition for ADC_HTR register ********************/
  1444. #define ADC_HTR_HT ((uint32_t)0x0FFF) /*!<Analog watchdog high threshold */
  1445. /******************* Bit definition for ADC_LTR register ********************/
  1446. #define ADC_LTR_LT ((uint32_t)0x0FFF) /*!<Analog watchdog low threshold */
  1447. /******************* Bit definition for ADC_SQR1 register *******************/
  1448. #define ADC_SQR1_SQ13 ((uint32_t)0x0000001F) /*!<SQ13[4:0] bits (13th conversion in regular sequence) */
  1449. #define ADC_SQR1_SQ13_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1450. #define ADC_SQR1_SQ13_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1451. #define ADC_SQR1_SQ13_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1452. #define ADC_SQR1_SQ13_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  1453. #define ADC_SQR1_SQ13_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  1454. #define ADC_SQR1_SQ14 ((uint32_t)0x000003E0) /*!<SQ14[4:0] bits (14th conversion in regular sequence) */
  1455. #define ADC_SQR1_SQ14_0 ((uint32_t)0x00000020) /*!<Bit 0 */
  1456. #define ADC_SQR1_SQ14_1 ((uint32_t)0x00000040) /*!<Bit 1 */
  1457. #define ADC_SQR1_SQ14_2 ((uint32_t)0x00000080) /*!<Bit 2 */
  1458. #define ADC_SQR1_SQ14_3 ((uint32_t)0x00000100) /*!<Bit 3 */
  1459. #define ADC_SQR1_SQ14_4 ((uint32_t)0x00000200) /*!<Bit 4 */
  1460. #define ADC_SQR1_SQ15 ((uint32_t)0x00007C00) /*!<SQ15[4:0] bits (15th conversion in regular sequence) */
  1461. #define ADC_SQR1_SQ15_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  1462. #define ADC_SQR1_SQ15_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  1463. #define ADC_SQR1_SQ15_2 ((uint32_t)0x00001000) /*!<Bit 2 */
  1464. #define ADC_SQR1_SQ15_3 ((uint32_t)0x00002000) /*!<Bit 3 */
  1465. #define ADC_SQR1_SQ15_4 ((uint32_t)0x00004000) /*!<Bit 4 */
  1466. #define ADC_SQR1_SQ16 ((uint32_t)0x000F8000) /*!<SQ16[4:0] bits (16th conversion in regular sequence) */
  1467. #define ADC_SQR1_SQ16_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  1468. #define ADC_SQR1_SQ16_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  1469. #define ADC_SQR1_SQ16_2 ((uint32_t)0x00020000) /*!<Bit 2 */
  1470. #define ADC_SQR1_SQ16_3 ((uint32_t)0x00040000) /*!<Bit 3 */
  1471. #define ADC_SQR1_SQ16_4 ((uint32_t)0x00080000) /*!<Bit 4 */
  1472. #define ADC_SQR1_L ((uint32_t)0x00F00000) /*!<L[3:0] bits (Regular channel sequence length) */
  1473. #define ADC_SQR1_L_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  1474. #define ADC_SQR1_L_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  1475. #define ADC_SQR1_L_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  1476. #define ADC_SQR1_L_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  1477. /******************* Bit definition for ADC_SQR2 register *******************/
  1478. #define ADC_SQR2_SQ7 ((uint32_t)0x0000001F) /*!<SQ7[4:0] bits (7th conversion in regular sequence) */
  1479. #define ADC_SQR2_SQ7_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1480. #define ADC_SQR2_SQ7_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1481. #define ADC_SQR2_SQ7_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1482. #define ADC_SQR2_SQ7_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  1483. #define ADC_SQR2_SQ7_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  1484. #define ADC_SQR2_SQ8 ((uint32_t)0x000003E0) /*!<SQ8[4:0] bits (8th conversion in regular sequence) */
  1485. #define ADC_SQR2_SQ8_0 ((uint32_t)0x00000020) /*!<Bit 0 */
  1486. #define ADC_SQR2_SQ8_1 ((uint32_t)0x00000040) /*!<Bit 1 */
  1487. #define ADC_SQR2_SQ8_2 ((uint32_t)0x00000080) /*!<Bit 2 */
  1488. #define ADC_SQR2_SQ8_3 ((uint32_t)0x00000100) /*!<Bit 3 */
  1489. #define ADC_SQR2_SQ8_4 ((uint32_t)0x00000200) /*!<Bit 4 */
  1490. #define ADC_SQR2_SQ9 ((uint32_t)0x00007C00) /*!<SQ9[4:0] bits (9th conversion in regular sequence) */
  1491. #define ADC_SQR2_SQ9_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  1492. #define ADC_SQR2_SQ9_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  1493. #define ADC_SQR2_SQ9_2 ((uint32_t)0x00001000) /*!<Bit 2 */
  1494. #define ADC_SQR2_SQ9_3 ((uint32_t)0x00002000) /*!<Bit 3 */
  1495. #define ADC_SQR2_SQ9_4 ((uint32_t)0x00004000) /*!<Bit 4 */
  1496. #define ADC_SQR2_SQ10 ((uint32_t)0x000F8000) /*!<SQ10[4:0] bits (10th conversion in regular sequence) */
  1497. #define ADC_SQR2_SQ10_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  1498. #define ADC_SQR2_SQ10_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  1499. #define ADC_SQR2_SQ10_2 ((uint32_t)0x00020000) /*!<Bit 2 */
  1500. #define ADC_SQR2_SQ10_3 ((uint32_t)0x00040000) /*!<Bit 3 */
  1501. #define ADC_SQR2_SQ10_4 ((uint32_t)0x00080000) /*!<Bit 4 */
  1502. #define ADC_SQR2_SQ11 ((uint32_t)0x01F00000) /*!<SQ11[4:0] bits (11th conversion in regular sequence) */
  1503. #define ADC_SQR2_SQ11_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  1504. #define ADC_SQR2_SQ11_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  1505. #define ADC_SQR2_SQ11_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  1506. #define ADC_SQR2_SQ11_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  1507. #define ADC_SQR2_SQ11_4 ((uint32_t)0x01000000) /*!<Bit 4 */
  1508. #define ADC_SQR2_SQ12 ((uint32_t)0x3E000000) /*!<SQ12[4:0] bits (12th conversion in regular sequence) */
  1509. #define ADC_SQR2_SQ12_0 ((uint32_t)0x02000000) /*!<Bit 0 */
  1510. #define ADC_SQR2_SQ12_1 ((uint32_t)0x04000000) /*!<Bit 1 */
  1511. #define ADC_SQR2_SQ12_2 ((uint32_t)0x08000000) /*!<Bit 2 */
  1512. #define ADC_SQR2_SQ12_3 ((uint32_t)0x10000000) /*!<Bit 3 */
  1513. #define ADC_SQR2_SQ12_4 ((uint32_t)0x20000000) /*!<Bit 4 */
  1514. /******************* Bit definition for ADC_SQR3 register *******************/
  1515. #define ADC_SQR3_SQ1 ((uint32_t)0x0000001F) /*!<SQ1[4:0] bits (1st conversion in regular sequence) */
  1516. #define ADC_SQR3_SQ1_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1517. #define ADC_SQR3_SQ1_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1518. #define ADC_SQR3_SQ1_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1519. #define ADC_SQR3_SQ1_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  1520. #define ADC_SQR3_SQ1_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  1521. #define ADC_SQR3_SQ2 ((uint32_t)0x000003E0) /*!<SQ2[4:0] bits (2nd conversion in regular sequence) */
  1522. #define ADC_SQR3_SQ2_0 ((uint32_t)0x00000020) /*!<Bit 0 */
  1523. #define ADC_SQR3_SQ2_1 ((uint32_t)0x00000040) /*!<Bit 1 */
  1524. #define ADC_SQR3_SQ2_2 ((uint32_t)0x00000080) /*!<Bit 2 */
  1525. #define ADC_SQR3_SQ2_3 ((uint32_t)0x00000100) /*!<Bit 3 */
  1526. #define ADC_SQR3_SQ2_4 ((uint32_t)0x00000200) /*!<Bit 4 */
  1527. #define ADC_SQR3_SQ3 ((uint32_t)0x00007C00) /*!<SQ3[4:0] bits (3rd conversion in regular sequence) */
  1528. #define ADC_SQR3_SQ3_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  1529. #define ADC_SQR3_SQ3_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  1530. #define ADC_SQR3_SQ3_2 ((uint32_t)0x00001000) /*!<Bit 2 */
  1531. #define ADC_SQR3_SQ3_3 ((uint32_t)0x00002000) /*!<Bit 3 */
  1532. #define ADC_SQR3_SQ3_4 ((uint32_t)0x00004000) /*!<Bit 4 */
  1533. #define ADC_SQR3_SQ4 ((uint32_t)0x000F8000) /*!<SQ4[4:0] bits (4th conversion in regular sequence) */
  1534. #define ADC_SQR3_SQ4_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  1535. #define ADC_SQR3_SQ4_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  1536. #define ADC_SQR3_SQ4_2 ((uint32_t)0x00020000) /*!<Bit 2 */
  1537. #define ADC_SQR3_SQ4_3 ((uint32_t)0x00040000) /*!<Bit 3 */
  1538. #define ADC_SQR3_SQ4_4 ((uint32_t)0x00080000) /*!<Bit 4 */
  1539. #define ADC_SQR3_SQ5 ((uint32_t)0x01F00000) /*!<SQ5[4:0] bits (5th conversion in regular sequence) */
  1540. #define ADC_SQR3_SQ5_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  1541. #define ADC_SQR3_SQ5_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  1542. #define ADC_SQR3_SQ5_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  1543. #define ADC_SQR3_SQ5_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  1544. #define ADC_SQR3_SQ5_4 ((uint32_t)0x01000000) /*!<Bit 4 */
  1545. #define ADC_SQR3_SQ6 ((uint32_t)0x3E000000) /*!<SQ6[4:0] bits (6th conversion in regular sequence) */
  1546. #define ADC_SQR3_SQ6_0 ((uint32_t)0x02000000) /*!<Bit 0 */
  1547. #define ADC_SQR3_SQ6_1 ((uint32_t)0x04000000) /*!<Bit 1 */
  1548. #define ADC_SQR3_SQ6_2 ((uint32_t)0x08000000) /*!<Bit 2 */
  1549. #define ADC_SQR3_SQ6_3 ((uint32_t)0x10000000) /*!<Bit 3 */
  1550. #define ADC_SQR3_SQ6_4 ((uint32_t)0x20000000) /*!<Bit 4 */
  1551. /******************* Bit definition for ADC_JSQR register *******************/
  1552. #define ADC_JSQR_JSQ1 ((uint32_t)0x0000001F) /*!<JSQ1[4:0] bits (1st conversion in injected sequence) */
  1553. #define ADC_JSQR_JSQ1_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1554. #define ADC_JSQR_JSQ1_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1555. #define ADC_JSQR_JSQ1_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1556. #define ADC_JSQR_JSQ1_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  1557. #define ADC_JSQR_JSQ1_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  1558. #define ADC_JSQR_JSQ2 ((uint32_t)0x000003E0) /*!<JSQ2[4:0] bits (2nd conversion in injected sequence) */
  1559. #define ADC_JSQR_JSQ2_0 ((uint32_t)0x00000020) /*!<Bit 0 */
  1560. #define ADC_JSQR_JSQ2_1 ((uint32_t)0x00000040) /*!<Bit 1 */
  1561. #define ADC_JSQR_JSQ2_2 ((uint32_t)0x00000080) /*!<Bit 2 */
  1562. #define ADC_JSQR_JSQ2_3 ((uint32_t)0x00000100) /*!<Bit 3 */
  1563. #define ADC_JSQR_JSQ2_4 ((uint32_t)0x00000200) /*!<Bit 4 */
  1564. #define ADC_JSQR_JSQ3 ((uint32_t)0x00007C00) /*!<JSQ3[4:0] bits (3rd conversion in injected sequence) */
  1565. #define ADC_JSQR_JSQ3_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  1566. #define ADC_JSQR_JSQ3_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  1567. #define ADC_JSQR_JSQ3_2 ((uint32_t)0x00001000) /*!<Bit 2 */
  1568. #define ADC_JSQR_JSQ3_3 ((uint32_t)0x00002000) /*!<Bit 3 */
  1569. #define ADC_JSQR_JSQ3_4 ((uint32_t)0x00004000) /*!<Bit 4 */
  1570. #define ADC_JSQR_JSQ4 ((uint32_t)0x000F8000) /*!<JSQ4[4:0] bits (4th conversion in injected sequence) */
  1571. #define ADC_JSQR_JSQ4_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  1572. #define ADC_JSQR_JSQ4_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  1573. #define ADC_JSQR_JSQ4_2 ((uint32_t)0x00020000) /*!<Bit 2 */
  1574. #define ADC_JSQR_JSQ4_3 ((uint32_t)0x00040000) /*!<Bit 3 */
  1575. #define ADC_JSQR_JSQ4_4 ((uint32_t)0x00080000) /*!<Bit 4 */
  1576. #define ADC_JSQR_JL ((uint32_t)0x00300000) /*!<JL[1:0] bits (Injected Sequence length) */
  1577. #define ADC_JSQR_JL_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  1578. #define ADC_JSQR_JL_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  1579. /******************* Bit definition for ADC_JDR1 register *******************/
  1580. #define ADC_JDR1_JDATA ((uint32_t)0xFFFF) /*!<Injected data */
  1581. /******************* Bit definition for ADC_JDR2 register *******************/
  1582. #define ADC_JDR2_JDATA ((uint32_t)0xFFFF) /*!<Injected data */
  1583. /******************* Bit definition for ADC_JDR3 register *******************/
  1584. #define ADC_JDR3_JDATA ((uint32_t)0xFFFF) /*!<Injected data */
  1585. /******************* Bit definition for ADC_JDR4 register *******************/
  1586. #define ADC_JDR4_JDATA ((uint32_t)0xFFFF) /*!<Injected data */
  1587. /******************** Bit definition for ADC_DR register ********************/
  1588. #define ADC_DR_DATA ((uint32_t)0x0000FFFF) /*!<Regular data */
  1589. #define ADC_DR_ADC2DATA ((uint32_t)0xFFFF0000) /*!<ADC2 data */
  1590. /******************* Bit definition for ADC_CSR register ********************/
  1591. #define ADC_CSR_AWD1 ((uint32_t)0x00000001) /*!<ADC1 Analog watchdog flag */
  1592. #define ADC_CSR_EOC1 ((uint32_t)0x00000002) /*!<ADC1 End of conversion */
  1593. #define ADC_CSR_JEOC1 ((uint32_t)0x00000004) /*!<ADC1 Injected channel end of conversion */
  1594. #define ADC_CSR_JSTRT1 ((uint32_t)0x00000008) /*!<ADC1 Injected channel Start flag */
  1595. #define ADC_CSR_STRT1 ((uint32_t)0x00000010) /*!<ADC1 Regular channel Start flag */
  1596. #define ADC_CSR_DOVR1 ((uint32_t)0x00000020) /*!<ADC1 DMA overrun flag */
  1597. #define ADC_CSR_AWD2 ((uint32_t)0x00000100) /*!<ADC2 Analog watchdog flag */
  1598. #define ADC_CSR_EOC2 ((uint32_t)0x00000200) /*!<ADC2 End of conversion */
  1599. #define ADC_CSR_JEOC2 ((uint32_t)0x00000400) /*!<ADC2 Injected channel end of conversion */
  1600. #define ADC_CSR_JSTRT2 ((uint32_t)0x00000800) /*!<ADC2 Injected channel Start flag */
  1601. #define ADC_CSR_STRT2 ((uint32_t)0x00001000) /*!<ADC2 Regular channel Start flag */
  1602. #define ADC_CSR_DOVR2 ((uint32_t)0x00002000) /*!<ADC2 DMA overrun flag */
  1603. #define ADC_CSR_AWD3 ((uint32_t)0x00010000) /*!<ADC3 Analog watchdog flag */
  1604. #define ADC_CSR_EOC3 ((uint32_t)0x00020000) /*!<ADC3 End of conversion */
  1605. #define ADC_CSR_JEOC3 ((uint32_t)0x00040000) /*!<ADC3 Injected channel end of conversion */
  1606. #define ADC_CSR_JSTRT3 ((uint32_t)0x00080000) /*!<ADC3 Injected channel Start flag */
  1607. #define ADC_CSR_STRT3 ((uint32_t)0x00100000) /*!<ADC3 Regular channel Start flag */
  1608. #define ADC_CSR_DOVR3 ((uint32_t)0x00200000) /*!<ADC3 DMA overrun flag */
  1609. /******************* Bit definition for ADC_CCR register ********************/
  1610. #define ADC_CCR_MULTI ((uint32_t)0x0000001F) /*!<MULTI[4:0] bits (Multi-ADC mode selection) */
  1611. #define ADC_CCR_MULTI_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1612. #define ADC_CCR_MULTI_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1613. #define ADC_CCR_MULTI_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1614. #define ADC_CCR_MULTI_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  1615. #define ADC_CCR_MULTI_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  1616. #define ADC_CCR_DELAY ((uint32_t)0x00000F00) /*!<DELAY[3:0] bits (Delay between 2 sampling phases) */
  1617. #define ADC_CCR_DELAY_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  1618. #define ADC_CCR_DELAY_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  1619. #define ADC_CCR_DELAY_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  1620. #define ADC_CCR_DELAY_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  1621. #define ADC_CCR_DDS ((uint32_t)0x00002000) /*!<DMA disable selection (Multi-ADC mode) */
  1622. #define ADC_CCR_DMA ((uint32_t)0x0000C000) /*!<DMA[1:0] bits (Direct Memory Access mode for multimode) */
  1623. #define ADC_CCR_DMA_0 ((uint32_t)0x00004000) /*!<Bit 0 */
  1624. #define ADC_CCR_DMA_1 ((uint32_t)0x00008000) /*!<Bit 1 */
  1625. #define ADC_CCR_ADCPRE ((uint32_t)0x00030000) /*!<ADCPRE[1:0] bits (ADC prescaler) */
  1626. #define ADC_CCR_ADCPRE_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  1627. #define ADC_CCR_ADCPRE_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  1628. #define ADC_CCR_VBATE ((uint32_t)0x00400000) /*!<VBAT Enable */
  1629. #define ADC_CCR_TSVREFE ((uint32_t)0x00800000) /*!<Temperature Sensor and VREFINT Enable */
  1630. /******************* Bit definition for ADC_CDR register ********************/
  1631. #define ADC_CDR_DATA1 ((uint32_t)0x0000FFFF) /*!<1st data of a pair of regular conversions */
  1632. #define ADC_CDR_DATA2 ((uint32_t)0xFFFF0000) /*!<2nd data of a pair of regular conversions */
  1633. /******************************************************************************/
  1634. /* */
  1635. /* Controller Area Network */
  1636. /* */
  1637. /******************************************************************************/
  1638. /*!<CAN control and status registers */
  1639. /******************* Bit definition for CAN_MCR register ********************/
  1640. #define CAN_MCR_INRQ ((uint32_t)0x00000001) /*!<Initialization Request */
  1641. #define CAN_MCR_SLEEP ((uint32_t)0x00000002) /*!<Sleep Mode Request */
  1642. #define CAN_MCR_TXFP ((uint32_t)0x00000004) /*!<Transmit FIFO Priority */
  1643. #define CAN_MCR_RFLM ((uint32_t)0x00000008) /*!<Receive FIFO Locked Mode */
  1644. #define CAN_MCR_NART ((uint32_t)0x00000010) /*!<No Automatic Retransmission */
  1645. #define CAN_MCR_AWUM ((uint32_t)0x00000020) /*!<Automatic Wakeup Mode */
  1646. #define CAN_MCR_ABOM ((uint32_t)0x00000040) /*!<Automatic Bus-Off Management */
  1647. #define CAN_MCR_TTCM ((uint32_t)0x00000080) /*!<Time Triggered Communication Mode */
  1648. #define CAN_MCR_RESET ((uint32_t)0x00008000) /*!<bxCAN software master reset */
  1649. #define CAN_MCR_DBF ((uint32_t)0x00010000) /*!<bxCAN Debug freeze */
  1650. /******************* Bit definition for CAN_MSR register ********************/
  1651. #define CAN_MSR_INAK ((uint32_t)0x0001) /*!<Initialization Acknowledge */
  1652. #define CAN_MSR_SLAK ((uint32_t)0x0002) /*!<Sleep Acknowledge */
  1653. #define CAN_MSR_ERRI ((uint32_t)0x0004) /*!<Error Interrupt */
  1654. #define CAN_MSR_WKUI ((uint32_t)0x0008) /*!<Wakeup Interrupt */
  1655. #define CAN_MSR_SLAKI ((uint32_t)0x0010) /*!<Sleep Acknowledge Interrupt */
  1656. #define CAN_MSR_TXM ((uint32_t)0x0100) /*!<Transmit Mode */
  1657. #define CAN_MSR_RXM ((uint32_t)0x0200) /*!<Receive Mode */
  1658. #define CAN_MSR_SAMP ((uint32_t)0x0400) /*!<Last Sample Point */
  1659. #define CAN_MSR_RX ((uint32_t)0x0800) /*!<CAN Rx Signal */
  1660. /******************* Bit definition for CAN_TSR register ********************/
  1661. #define CAN_TSR_RQCP0 ((uint32_t)0x00000001) /*!<Request Completed Mailbox0 */
  1662. #define CAN_TSR_TXOK0 ((uint32_t)0x00000002) /*!<Transmission OK of Mailbox0 */
  1663. #define CAN_TSR_ALST0 ((uint32_t)0x00000004) /*!<Arbitration Lost for Mailbox0 */
  1664. #define CAN_TSR_TERR0 ((uint32_t)0x00000008) /*!<Transmission Error of Mailbox0 */
  1665. #define CAN_TSR_ABRQ0 ((uint32_t)0x00000080) /*!<Abort Request for Mailbox0 */
  1666. #define CAN_TSR_RQCP1 ((uint32_t)0x00000100) /*!<Request Completed Mailbox1 */
  1667. #define CAN_TSR_TXOK1 ((uint32_t)0x00000200) /*!<Transmission OK of Mailbox1 */
  1668. #define CAN_TSR_ALST1 ((uint32_t)0x00000400) /*!<Arbitration Lost for Mailbox1 */
  1669. #define CAN_TSR_TERR1 ((uint32_t)0x00000800) /*!<Transmission Error of Mailbox1 */
  1670. #define CAN_TSR_ABRQ1 ((uint32_t)0x00008000) /*!<Abort Request for Mailbox 1 */
  1671. #define CAN_TSR_RQCP2 ((uint32_t)0x00010000) /*!<Request Completed Mailbox2 */
  1672. #define CAN_TSR_TXOK2 ((uint32_t)0x00020000) /*!<Transmission OK of Mailbox 2 */
  1673. #define CAN_TSR_ALST2 ((uint32_t)0x00040000) /*!<Arbitration Lost for mailbox 2 */
  1674. #define CAN_TSR_TERR2 ((uint32_t)0x00080000) /*!<Transmission Error of Mailbox 2 */
  1675. #define CAN_TSR_ABRQ2 ((uint32_t)0x00800000) /*!<Abort Request for Mailbox 2 */
  1676. #define CAN_TSR_CODE ((uint32_t)0x03000000) /*!<Mailbox Code */
  1677. #define CAN_TSR_TME ((uint32_t)0x1C000000) /*!<TME[2:0] bits */
  1678. #define CAN_TSR_TME0 ((uint32_t)0x04000000) /*!<Transmit Mailbox 0 Empty */
  1679. #define CAN_TSR_TME1 ((uint32_t)0x08000000) /*!<Transmit Mailbox 1 Empty */
  1680. #define CAN_TSR_TME2 ((uint32_t)0x10000000) /*!<Transmit Mailbox 2 Empty */
  1681. #define CAN_TSR_LOW ((uint32_t)0xE0000000) /*!<LOW[2:0] bits */
  1682. #define CAN_TSR_LOW0 ((uint32_t)0x20000000) /*!<Lowest Priority Flag for Mailbox 0 */
  1683. #define CAN_TSR_LOW1 ((uint32_t)0x40000000) /*!<Lowest Priority Flag for Mailbox 1 */
  1684. #define CAN_TSR_LOW2 ((uint32_t)0x80000000) /*!<Lowest Priority Flag for Mailbox 2 */
  1685. /******************* Bit definition for CAN_RF0R register *******************/
  1686. #define CAN_RF0R_FMP0 ((uint32_t)0x03) /*!<FIFO 0 Message Pending */
  1687. #define CAN_RF0R_FULL0 ((uint32_t)0x08) /*!<FIFO 0 Full */
  1688. #define CAN_RF0R_FOVR0 ((uint32_t)0x10) /*!<FIFO 0 Overrun */
  1689. #define CAN_RF0R_RFOM0 ((uint32_t)0x20) /*!<Release FIFO 0 Output Mailbox */
  1690. /******************* Bit definition for CAN_RF1R register *******************/
  1691. #define CAN_RF1R_FMP1 ((uint32_t)0x03) /*!<FIFO 1 Message Pending */
  1692. #define CAN_RF1R_FULL1 ((uint32_t)0x08) /*!<FIFO 1 Full */
  1693. #define CAN_RF1R_FOVR1 ((uint32_t)0x10) /*!<FIFO 1 Overrun */
  1694. #define CAN_RF1R_RFOM1 ((uint32_t)0x20) /*!<Release FIFO 1 Output Mailbox */
  1695. /******************** Bit definition for CAN_IER register *******************/
  1696. #define CAN_IER_TMEIE ((uint32_t)0x00000001) /*!<Transmit Mailbox Empty Interrupt Enable */
  1697. #define CAN_IER_FMPIE0 ((uint32_t)0x00000002) /*!<FIFO Message Pending Interrupt Enable */
  1698. #define CAN_IER_FFIE0 ((uint32_t)0x00000004) /*!<FIFO Full Interrupt Enable */
  1699. #define CAN_IER_FOVIE0 ((uint32_t)0x00000008) /*!<FIFO Overrun Interrupt Enable */
  1700. #define CAN_IER_FMPIE1 ((uint32_t)0x00000010) /*!<FIFO Message Pending Interrupt Enable */
  1701. #define CAN_IER_FFIE1 ((uint32_t)0x00000020) /*!<FIFO Full Interrupt Enable */
  1702. #define CAN_IER_FOVIE1 ((uint32_t)0x00000040) /*!<FIFO Overrun Interrupt Enable */
  1703. #define CAN_IER_EWGIE ((uint32_t)0x00000100) /*!<Error Warning Interrupt Enable */
  1704. #define CAN_IER_EPVIE ((uint32_t)0x00000200) /*!<Error Passive Interrupt Enable */
  1705. #define CAN_IER_BOFIE ((uint32_t)0x00000400) /*!<Bus-Off Interrupt Enable */
  1706. #define CAN_IER_LECIE ((uint32_t)0x00000800) /*!<Last Error Code Interrupt Enable */
  1707. #define CAN_IER_ERRIE ((uint32_t)0x00008000) /*!<Error Interrupt Enable */
  1708. #define CAN_IER_WKUIE ((uint32_t)0x00010000) /*!<Wakeup Interrupt Enable */
  1709. #define CAN_IER_SLKIE ((uint32_t)0x00020000) /*!<Sleep Interrupt Enable */
  1710. #define CAN_IER_EWGIE ((uint32_t)0x00000100) /*!<Error warning interrupt enable */
  1711. #define CAN_IER_EPVIE ((uint32_t)0x00000200) /*!<Error passive interrupt enable */
  1712. #define CAN_IER_BOFIE ((uint32_t)0x00000400) /*!<Bus-off interrupt enable */
  1713. #define CAN_IER_LECIE ((uint32_t)0x00000800) /*!<Last error code interrupt enable */
  1714. #define CAN_IER_ERRIE ((uint32_t)0x00008000) /*!<Error interrupt enable */
  1715. /******************** Bit definition for CAN_ESR register *******************/
  1716. #define CAN_ESR_EWGF ((uint32_t)0x00000001) /*!<Error Warning Flag */
  1717. #define CAN_ESR_EPVF ((uint32_t)0x00000002) /*!<Error Passive Flag */
  1718. #define CAN_ESR_BOFF ((uint32_t)0x00000004) /*!<Bus-Off Flag */
  1719. #define CAN_ESR_LEC ((uint32_t)0x00000070) /*!<LEC[2:0] bits (Last Error Code) */
  1720. #define CAN_ESR_LEC_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  1721. #define CAN_ESR_LEC_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  1722. #define CAN_ESR_LEC_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  1723. #define CAN_ESR_TEC ((uint32_t)0x00FF0000) /*!<Least significant byte of the 9-bit Transmit Error Counter */
  1724. #define CAN_ESR_REC ((uint32_t)0xFF000000) /*!<Receive Error Counter */
  1725. /******************* Bit definition for CAN_BTR register ********************/
  1726. #define CAN_BTR_BRP ((uint32_t)0x000003FF) /*!<Baud Rate Prescaler */
  1727. #define CAN_BTR_TS1 ((uint32_t)0x000F0000) /*!<Time Segment 1 */
  1728. #define CAN_BTR_TS1_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  1729. #define CAN_BTR_TS1_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  1730. #define CAN_BTR_TS1_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  1731. #define CAN_BTR_TS1_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  1732. #define CAN_BTR_TS2 ((uint32_t)0x00700000) /*!<Time Segment 2 */
  1733. #define CAN_BTR_TS2_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  1734. #define CAN_BTR_TS2_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  1735. #define CAN_BTR_TS2_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  1736. #define CAN_BTR_SJW ((uint32_t)0x03000000) /*!<Resynchronization Jump Width */
  1737. #define CAN_BTR_SJW_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  1738. #define CAN_BTR_SJW_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  1739. #define CAN_BTR_LBKM ((uint32_t)0x40000000) /*!<Loop Back Mode (Debug) */
  1740. #define CAN_BTR_SILM ((uint32_t)0x80000000) /*!<Silent Mode */
  1741. /*!<Mailbox registers */
  1742. /****************** Bit definition for CAN_TI0R register ********************/
  1743. #define CAN_TI0R_TXRQ ((uint32_t)0x00000001) /*!<Transmit Mailbox Request */
  1744. #define CAN_TI0R_RTR ((uint32_t)0x00000002) /*!<Remote Transmission Request */
  1745. #define CAN_TI0R_IDE ((uint32_t)0x00000004) /*!<Identifier Extension */
  1746. #define CAN_TI0R_EXID ((uint32_t)0x001FFFF8) /*!<Extended Identifier */
  1747. #define CAN_TI0R_STID ((uint32_t)0xFFE00000) /*!<Standard Identifier or Extended Identifier */
  1748. /****************** Bit definition for CAN_TDT0R register *******************/
  1749. #define CAN_TDT0R_DLC ((uint32_t)0x0000000F) /*!<Data Length Code */
  1750. #define CAN_TDT0R_TGT ((uint32_t)0x00000100) /*!<Transmit Global Time */
  1751. #define CAN_TDT0R_TIME ((uint32_t)0xFFFF0000) /*!<Message Time Stamp */
  1752. /****************** Bit definition for CAN_TDL0R register *******************/
  1753. #define CAN_TDL0R_DATA0 ((uint32_t)0x000000FF) /*!<Data byte 0 */
  1754. #define CAN_TDL0R_DATA1 ((uint32_t)0x0000FF00) /*!<Data byte 1 */
  1755. #define CAN_TDL0R_DATA2 ((uint32_t)0x00FF0000) /*!<Data byte 2 */
  1756. #define CAN_TDL0R_DATA3 ((uint32_t)0xFF000000) /*!<Data byte 3 */
  1757. /****************** Bit definition for CAN_TDH0R register *******************/
  1758. #define CAN_TDH0R_DATA4 ((uint32_t)0x000000FF) /*!<Data byte 4 */
  1759. #define CAN_TDH0R_DATA5 ((uint32_t)0x0000FF00) /*!<Data byte 5 */
  1760. #define CAN_TDH0R_DATA6 ((uint32_t)0x00FF0000) /*!<Data byte 6 */
  1761. #define CAN_TDH0R_DATA7 ((uint32_t)0xFF000000) /*!<Data byte 7 */
  1762. /******************* Bit definition for CAN_TI1R register *******************/
  1763. #define CAN_TI1R_TXRQ ((uint32_t)0x00000001) /*!<Transmit Mailbox Request */
  1764. #define CAN_TI1R_RTR ((uint32_t)0x00000002) /*!<Remote Transmission Request */
  1765. #define CAN_TI1R_IDE ((uint32_t)0x00000004) /*!<Identifier Extension */
  1766. #define CAN_TI1R_EXID ((uint32_t)0x001FFFF8) /*!<Extended Identifier */
  1767. #define CAN_TI1R_STID ((uint32_t)0xFFE00000) /*!<Standard Identifier or Extended Identifier */
  1768. /******************* Bit definition for CAN_TDT1R register ******************/
  1769. #define CAN_TDT1R_DLC ((uint32_t)0x0000000F) /*!<Data Length Code */
  1770. #define CAN_TDT1R_TGT ((uint32_t)0x00000100) /*!<Transmit Global Time */
  1771. #define CAN_TDT1R_TIME ((uint32_t)0xFFFF0000) /*!<Message Time Stamp */
  1772. /******************* Bit definition for CAN_TDL1R register ******************/
  1773. #define CAN_TDL1R_DATA0 ((uint32_t)0x000000FF) /*!<Data byte 0 */
  1774. #define CAN_TDL1R_DATA1 ((uint32_t)0x0000FF00) /*!<Data byte 1 */
  1775. #define CAN_TDL1R_DATA2 ((uint32_t)0x00FF0000) /*!<Data byte 2 */
  1776. #define CAN_TDL1R_DATA3 ((uint32_t)0xFF000000) /*!<Data byte 3 */
  1777. /******************* Bit definition for CAN_TDH1R register ******************/
  1778. #define CAN_TDH1R_DATA4 ((uint32_t)0x000000FF) /*!<Data byte 4 */
  1779. #define CAN_TDH1R_DATA5 ((uint32_t)0x0000FF00) /*!<Data byte 5 */
  1780. #define CAN_TDH1R_DATA6 ((uint32_t)0x00FF0000) /*!<Data byte 6 */
  1781. #define CAN_TDH1R_DATA7 ((uint32_t)0xFF000000) /*!<Data byte 7 */
  1782. /******************* Bit definition for CAN_TI2R register *******************/
  1783. #define CAN_TI2R_TXRQ ((uint32_t)0x00000001) /*!<Transmit Mailbox Request */
  1784. #define CAN_TI2R_RTR ((uint32_t)0x00000002) /*!<Remote Transmission Request */
  1785. #define CAN_TI2R_IDE ((uint32_t)0x00000004) /*!<Identifier Extension */
  1786. #define CAN_TI2R_EXID ((uint32_t)0x001FFFF8) /*!<Extended identifier */
  1787. #define CAN_TI2R_STID ((uint32_t)0xFFE00000) /*!<Standard Identifier or Extended Identifier */
  1788. /******************* Bit definition for CAN_TDT2R register ******************/
  1789. #define CAN_TDT2R_DLC ((uint32_t)0x0000000F) /*!<Data Length Code */
  1790. #define CAN_TDT2R_TGT ((uint32_t)0x00000100) /*!<Transmit Global Time */
  1791. #define CAN_TDT2R_TIME ((uint32_t)0xFFFF0000) /*!<Message Time Stamp */
  1792. /******************* Bit definition for CAN_TDL2R register ******************/
  1793. #define CAN_TDL2R_DATA0 ((uint32_t)0x000000FF) /*!<Data byte 0 */
  1794. #define CAN_TDL2R_DATA1 ((uint32_t)0x0000FF00) /*!<Data byte 1 */
  1795. #define CAN_TDL2R_DATA2 ((uint32_t)0x00FF0000) /*!<Data byte 2 */
  1796. #define CAN_TDL2R_DATA3 ((uint32_t)0xFF000000) /*!<Data byte 3 */
  1797. /******************* Bit definition for CAN_TDH2R register ******************/
  1798. #define CAN_TDH2R_DATA4 ((uint32_t)0x000000FF) /*!<Data byte 4 */
  1799. #define CAN_TDH2R_DATA5 ((uint32_t)0x0000FF00) /*!<Data byte 5 */
  1800. #define CAN_TDH2R_DATA6 ((uint32_t)0x00FF0000) /*!<Data byte 6 */
  1801. #define CAN_TDH2R_DATA7 ((uint32_t)0xFF000000) /*!<Data byte 7 */
  1802. /******************* Bit definition for CAN_RI0R register *******************/
  1803. #define CAN_RI0R_RTR ((uint32_t)0x00000002) /*!<Remote Transmission Request */
  1804. #define CAN_RI0R_IDE ((uint32_t)0x00000004) /*!<Identifier Extension */
  1805. #define CAN_RI0R_EXID ((uint32_t)0x001FFFF8) /*!<Extended Identifier */
  1806. #define CAN_RI0R_STID ((uint32_t)0xFFE00000) /*!<Standard Identifier or Extended Identifier */
  1807. /******************* Bit definition for CAN_RDT0R register ******************/
  1808. #define CAN_RDT0R_DLC ((uint32_t)0x0000000F) /*!<Data Length Code */
  1809. #define CAN_RDT0R_FMI ((uint32_t)0x0000FF00) /*!<Filter Match Index */
  1810. #define CAN_RDT0R_TIME ((uint32_t)0xFFFF0000) /*!<Message Time Stamp */
  1811. /******************* Bit definition for CAN_RDL0R register ******************/
  1812. #define CAN_RDL0R_DATA0 ((uint32_t)0x000000FF) /*!<Data byte 0 */
  1813. #define CAN_RDL0R_DATA1 ((uint32_t)0x0000FF00) /*!<Data byte 1 */
  1814. #define CAN_RDL0R_DATA2 ((uint32_t)0x00FF0000) /*!<Data byte 2 */
  1815. #define CAN_RDL0R_DATA3 ((uint32_t)0xFF000000) /*!<Data byte 3 */
  1816. /******************* Bit definition for CAN_RDH0R register ******************/
  1817. #define CAN_RDH0R_DATA4 ((uint32_t)0x000000FF) /*!<Data byte 4 */
  1818. #define CAN_RDH0R_DATA5 ((uint32_t)0x0000FF00) /*!<Data byte 5 */
  1819. #define CAN_RDH0R_DATA6 ((uint32_t)0x00FF0000) /*!<Data byte 6 */
  1820. #define CAN_RDH0R_DATA7 ((uint32_t)0xFF000000) /*!<Data byte 7 */
  1821. /******************* Bit definition for CAN_RI1R register *******************/
  1822. #define CAN_RI1R_RTR ((uint32_t)0x00000002) /*!<Remote Transmission Request */
  1823. #define CAN_RI1R_IDE ((uint32_t)0x00000004) /*!<Identifier Extension */
  1824. #define CAN_RI1R_EXID ((uint32_t)0x001FFFF8) /*!<Extended identifier */
  1825. #define CAN_RI1R_STID ((uint32_t)0xFFE00000) /*!<Standard Identifier or Extended Identifier */
  1826. /******************* Bit definition for CAN_RDT1R register ******************/
  1827. #define CAN_RDT1R_DLC ((uint32_t)0x0000000F) /*!<Data Length Code */
  1828. #define CAN_RDT1R_FMI ((uint32_t)0x0000FF00) /*!<Filter Match Index */
  1829. #define CAN_RDT1R_TIME ((uint32_t)0xFFFF0000) /*!<Message Time Stamp */
  1830. /******************* Bit definition for CAN_RDL1R register ******************/
  1831. #define CAN_RDL1R_DATA0 ((uint32_t)0x000000FF) /*!<Data byte 0 */
  1832. #define CAN_RDL1R_DATA1 ((uint32_t)0x0000FF00) /*!<Data byte 1 */
  1833. #define CAN_RDL1R_DATA2 ((uint32_t)0x00FF0000) /*!<Data byte 2 */
  1834. #define CAN_RDL1R_DATA3 ((uint32_t)0xFF000000) /*!<Data byte 3 */
  1835. /******************* Bit definition for CAN_RDH1R register ******************/
  1836. #define CAN_RDH1R_DATA4 ((uint32_t)0x000000FF) /*!<Data byte 4 */
  1837. #define CAN_RDH1R_DATA5 ((uint32_t)0x0000FF00) /*!<Data byte 5 */
  1838. #define CAN_RDH1R_DATA6 ((uint32_t)0x00FF0000) /*!<Data byte 6 */
  1839. #define CAN_RDH1R_DATA7 ((uint32_t)0xFF000000) /*!<Data byte 7 */
  1840. /*!<CAN filter registers */
  1841. /******************* Bit definition for CAN_FMR register ********************/
  1842. #define CAN_FMR_FINIT ((uint32_t)0x01) /*!<Filter Init Mode */
  1843. #define CAN_FMR_CAN2SB ((uint32_t)0x00003F00) /*!<CAN2 start bank */
  1844. /******************* Bit definition for CAN_FM1R register *******************/
  1845. #define CAN_FM1R_FBM ((uint32_t)0x0FFFFFFF) /*!<Filter Mode */
  1846. #define CAN_FM1R_FBM0 ((uint32_t)0x00000001) /*!<Filter Init Mode bit 0 */
  1847. #define CAN_FM1R_FBM1 ((uint32_t)0x00000002) /*!<Filter Init Mode bit 1 */
  1848. #define CAN_FM1R_FBM2 ((uint32_t)0x00000004) /*!<Filter Init Mode bit 2 */
  1849. #define CAN_FM1R_FBM3 ((uint32_t)0x00000008) /*!<Filter Init Mode bit 3 */
  1850. #define CAN_FM1R_FBM4 ((uint32_t)0x00000010) /*!<Filter Init Mode bit 4 */
  1851. #define CAN_FM1R_FBM5 ((uint32_t)0x00000020) /*!<Filter Init Mode bit 5 */
  1852. #define CAN_FM1R_FBM6 ((uint32_t)0x00000040) /*!<Filter Init Mode bit 6 */
  1853. #define CAN_FM1R_FBM7 ((uint32_t)0x00000080) /*!<Filter Init Mode bit 7 */
  1854. #define CAN_FM1R_FBM8 ((uint32_t)0x00000100) /*!<Filter Init Mode bit 8 */
  1855. #define CAN_FM1R_FBM9 ((uint32_t)0x00000200) /*!<Filter Init Mode bit 9 */
  1856. #define CAN_FM1R_FBM10 ((uint32_t)0x00000400) /*!<Filter Init Mode bit 10 */
  1857. #define CAN_FM1R_FBM11 ((uint32_t)0x00000800) /*!<Filter Init Mode bit 11 */
  1858. #define CAN_FM1R_FBM12 ((uint32_t)0x00001000) /*!<Filter Init Mode bit 12 */
  1859. #define CAN_FM1R_FBM13 ((uint32_t)0x00002000) /*!<Filter Init Mode bit 13 */
  1860. #define CAN_FM1R_FBM14 ((uint32_t)0x00004000) /*!<Filter Init Mode bit 14 */
  1861. #define CAN_FM1R_FBM15 ((uint32_t)0x00008000) /*!<Filter Init Mode bit 15 */
  1862. #define CAN_FM1R_FBM16 ((uint32_t)0x00010000) /*!<Filter Init Mode bit 16 */
  1863. #define CAN_FM1R_FBM17 ((uint32_t)0x00020000) /*!<Filter Init Mode bit 17 */
  1864. #define CAN_FM1R_FBM18 ((uint32_t)0x00040000) /*!<Filter Init Mode bit 18 */
  1865. #define CAN_FM1R_FBM19 ((uint32_t)0x00080000) /*!<Filter Init Mode bit 19 */
  1866. #define CAN_FM1R_FBM20 ((uint32_t)0x00100000) /*!<Filter Init Mode bit 20 */
  1867. #define CAN_FM1R_FBM21 ((uint32_t)0x00200000) /*!<Filter Init Mode bit 21 */
  1868. #define CAN_FM1R_FBM22 ((uint32_t)0x00400000) /*!<Filter Init Mode bit 22 */
  1869. #define CAN_FM1R_FBM23 ((uint32_t)0x00800000) /*!<Filter Init Mode bit 23 */
  1870. #define CAN_FM1R_FBM24 ((uint32_t)0x01000000) /*!<Filter Init Mode bit 24 */
  1871. #define CAN_FM1R_FBM25 ((uint32_t)0x02000000) /*!<Filter Init Mode bit 25 */
  1872. #define CAN_FM1R_FBM26 ((uint32_t)0x04000000) /*!<Filter Init Mode bit 26 */
  1873. #define CAN_FM1R_FBM27 ((uint32_t)0x08000000) /*!<Filter Init Mode bit 27 */
  1874. /******************* Bit definition for CAN_FS1R register *******************/
  1875. #define CAN_FS1R_FSC ((uint32_t)0x0FFFFFFF) /*!<Filter Scale Configuration */
  1876. #define CAN_FS1R_FSC0 ((uint32_t)0x00000001) /*!<Filter Scale Configuration bit 0 */
  1877. #define CAN_FS1R_FSC1 ((uint32_t)0x00000002) /*!<Filter Scale Configuration bit 1 */
  1878. #define CAN_FS1R_FSC2 ((uint32_t)0x00000004) /*!<Filter Scale Configuration bit 2 */
  1879. #define CAN_FS1R_FSC3 ((uint32_t)0x00000008) /*!<Filter Scale Configuration bit 3 */
  1880. #define CAN_FS1R_FSC4 ((uint32_t)0x00000010) /*!<Filter Scale Configuration bit 4 */
  1881. #define CAN_FS1R_FSC5 ((uint32_t)0x00000020) /*!<Filter Scale Configuration bit 5 */
  1882. #define CAN_FS1R_FSC6 ((uint32_t)0x00000040) /*!<Filter Scale Configuration bit 6 */
  1883. #define CAN_FS1R_FSC7 ((uint32_t)0x00000080) /*!<Filter Scale Configuration bit 7 */
  1884. #define CAN_FS1R_FSC8 ((uint32_t)0x00000100) /*!<Filter Scale Configuration bit 8 */
  1885. #define CAN_FS1R_FSC9 ((uint32_t)0x00000200) /*!<Filter Scale Configuration bit 9 */
  1886. #define CAN_FS1R_FSC10 ((uint32_t)0x00000400) /*!<Filter Scale Configuration bit 10 */
  1887. #define CAN_FS1R_FSC11 ((uint32_t)0x00000800) /*!<Filter Scale Configuration bit 11 */
  1888. #define CAN_FS1R_FSC12 ((uint32_t)0x00001000) /*!<Filter Scale Configuration bit 12 */
  1889. #define CAN_FS1R_FSC13 ((uint32_t)0x00002000) /*!<Filter Scale Configuration bit 13 */
  1890. #define CAN_FS1R_FSC14 ((uint32_t)0x00004000) /*!<Filter Scale Configuration bit 14 */
  1891. #define CAN_FS1R_FSC15 ((uint32_t)0x00008000) /*!<Filter Scale Configuration bit 15 */
  1892. #define CAN_FS1R_FSC16 ((uint32_t)0x00010000) /*!<Filter Scale Configuration bit 16 */
  1893. #define CAN_FS1R_FSC17 ((uint32_t)0x00020000) /*!<Filter Scale Configuration bit 17 */
  1894. #define CAN_FS1R_FSC18 ((uint32_t)0x00040000) /*!<Filter Scale Configuration bit 18 */
  1895. #define CAN_FS1R_FSC19 ((uint32_t)0x00080000) /*!<Filter Scale Configuration bit 19 */
  1896. #define CAN_FS1R_FSC20 ((uint32_t)0x00100000) /*!<Filter Scale Configuration bit 20 */
  1897. #define CAN_FS1R_FSC21 ((uint32_t)0x00200000) /*!<Filter Scale Configuration bit 21 */
  1898. #define CAN_FS1R_FSC22 ((uint32_t)0x00400000) /*!<Filter Scale Configuration bit 22 */
  1899. #define CAN_FS1R_FSC23 ((uint32_t)0x00800000) /*!<Filter Scale Configuration bit 23 */
  1900. #define CAN_FS1R_FSC24 ((uint32_t)0x01000000) /*!<Filter Scale Configuration bit 24 */
  1901. #define CAN_FS1R_FSC25 ((uint32_t)0x02000000) /*!<Filter Scale Configuration bit 25 */
  1902. #define CAN_FS1R_FSC26 ((uint32_t)0x04000000) /*!<Filter Scale Configuration bit 26 */
  1903. #define CAN_FS1R_FSC27 ((uint32_t)0x08000000) /*!<Filter Scale Configuration bit 27 */
  1904. /****************** Bit definition for CAN_FFA1R register *******************/
  1905. #define CAN_FFA1R_FFA ((uint32_t)0x0FFFFFFF) /*!<Filter FIFO Assignment */
  1906. #define CAN_FFA1R_FFA0 ((uint32_t)0x00000001) /*!<Filter FIFO Assignment bit 0 */
  1907. #define CAN_FFA1R_FFA1 ((uint32_t)0x00000002) /*!<Filter FIFO Assignment bit 1 */
  1908. #define CAN_FFA1R_FFA2 ((uint32_t)0x00000004) /*!<Filter FIFO Assignment bit 2 */
  1909. #define CAN_FFA1R_FFA3 ((uint32_t)0x00000008) /*!<Filter FIFO Assignment bit 3 */
  1910. #define CAN_FFA1R_FFA4 ((uint32_t)0x00000010) /*!<Filter FIFO Assignment bit 4 */
  1911. #define CAN_FFA1R_FFA5 ((uint32_t)0x00000020) /*!<Filter FIFO Assignment bit 5 */
  1912. #define CAN_FFA1R_FFA6 ((uint32_t)0x00000040) /*!<Filter FIFO Assignment bit 6 */
  1913. #define CAN_FFA1R_FFA7 ((uint32_t)0x00000080) /*!<Filter FIFO Assignment bit 7 */
  1914. #define CAN_FFA1R_FFA8 ((uint32_t)0x00000100) /*!<Filter FIFO Assignment bit 8 */
  1915. #define CAN_FFA1R_FFA9 ((uint32_t)0x00000200) /*!<Filter FIFO Assignment bit 9 */
  1916. #define CAN_FFA1R_FFA10 ((uint32_t)0x00000400) /*!<Filter FIFO Assignment bit 10 */
  1917. #define CAN_FFA1R_FFA11 ((uint32_t)0x00000800) /*!<Filter FIFO Assignment bit 11 */
  1918. #define CAN_FFA1R_FFA12 ((uint32_t)0x00001000) /*!<Filter FIFO Assignment bit 12 */
  1919. #define CAN_FFA1R_FFA13 ((uint32_t)0x00002000) /*!<Filter FIFO Assignment bit 13 */
  1920. #define CAN_FFA1R_FFA14 ((uint32_t)0x00004000) /*!<Filter FIFO Assignment bit 14 */
  1921. #define CAN_FFA1R_FFA15 ((uint32_t)0x00008000) /*!<Filter FIFO Assignment bit 15 */
  1922. #define CAN_FFA1R_FFA16 ((uint32_t)0x00010000) /*!<Filter FIFO Assignment bit 16 */
  1923. #define CAN_FFA1R_FFA17 ((uint32_t)0x00020000) /*!<Filter FIFO Assignment bit 17 */
  1924. #define CAN_FFA1R_FFA18 ((uint32_t)0x00040000) /*!<Filter FIFO Assignment bit 18 */
  1925. #define CAN_FFA1R_FFA19 ((uint32_t)0x00080000) /*!<Filter FIFO Assignment bit 19 */
  1926. #define CAN_FFA1R_FFA20 ((uint32_t)0x00100000) /*!<Filter FIFO Assignment bit 20 */
  1927. #define CAN_FFA1R_FFA21 ((uint32_t)0x00200000) /*!<Filter FIFO Assignment bit 21 */
  1928. #define CAN_FFA1R_FFA22 ((uint32_t)0x00400000) /*!<Filter FIFO Assignment bit 22 */
  1929. #define CAN_FFA1R_FFA23 ((uint32_t)0x00800000) /*!<Filter FIFO Assignment bit 23 */
  1930. #define CAN_FFA1R_FFA24 ((uint32_t)0x01000000) /*!<Filter FIFO Assignment bit 24 */
  1931. #define CAN_FFA1R_FFA25 ((uint32_t)0x02000000) /*!<Filter FIFO Assignment bit 25 */
  1932. #define CAN_FFA1R_FFA26 ((uint32_t)0x04000000) /*!<Filter FIFO Assignment bit 26 */
  1933. #define CAN_FFA1R_FFA27 ((uint32_t)0x08000000) /*!<Filter FIFO Assignment bit 27 */
  1934. /******************* Bit definition for CAN_FA1R register *******************/
  1935. #define CAN_FA1R_FACT ((uint32_t)0x0FFFFFFF) /*!<Filter Active */
  1936. #define CAN_FA1R_FACT0 ((uint32_t)0x00000001) /*!<Filter Active bit 0 */
  1937. #define CAN_FA1R_FACT1 ((uint32_t)0x00000002) /*!<Filter Active bit 1 */
  1938. #define CAN_FA1R_FACT2 ((uint32_t)0x00000004) /*!<Filter Active bit 2 */
  1939. #define CAN_FA1R_FACT3 ((uint32_t)0x00000008) /*!<Filter Active bit 3 */
  1940. #define CAN_FA1R_FACT4 ((uint32_t)0x00000010) /*!<Filter Active bit 4 */
  1941. #define CAN_FA1R_FACT5 ((uint32_t)0x00000020) /*!<Filter Active bit 5 */
  1942. #define CAN_FA1R_FACT6 ((uint32_t)0x00000040) /*!<Filter Active bit 6 */
  1943. #define CAN_FA1R_FACT7 ((uint32_t)0x00000080) /*!<Filter Active bit 7 */
  1944. #define CAN_FA1R_FACT8 ((uint32_t)0x00000100) /*!<Filter Active bit 8 */
  1945. #define CAN_FA1R_FACT9 ((uint32_t)0x00000200) /*!<Filter Active bit 9 */
  1946. #define CAN_FA1R_FACT10 ((uint32_t)0x00000400) /*!<Filter Active bit 10 */
  1947. #define CAN_FA1R_FACT11 ((uint32_t)0x00000800) /*!<Filter Active bit 11 */
  1948. #define CAN_FA1R_FACT12 ((uint32_t)0x00001000) /*!<Filter Active bit 12 */
  1949. #define CAN_FA1R_FACT13 ((uint32_t)0x00002000) /*!<Filter Active bit 13 */
  1950. #define CAN_FA1R_FACT14 ((uint32_t)0x00004000) /*!<Filter Active bit 14 */
  1951. #define CAN_FA1R_FACT15 ((uint32_t)0x00008000) /*!<Filter Active bit 15 */
  1952. #define CAN_FA1R_FACT16 ((uint32_t)0x00010000) /*!<Filter Active bit 16 */
  1953. #define CAN_FA1R_FACT17 ((uint32_t)0x00020000) /*!<Filter Active bit 17 */
  1954. #define CAN_FA1R_FACT18 ((uint32_t)0x00040000) /*!<Filter Active bit 18 */
  1955. #define CAN_FA1R_FACT19 ((uint32_t)0x00080000) /*!<Filter Active bit 19 */
  1956. #define CAN_FA1R_FACT20 ((uint32_t)0x00100000) /*!<Filter Active bit 20 */
  1957. #define CAN_FA1R_FACT21 ((uint32_t)0x00200000) /*!<Filter Active bit 21 */
  1958. #define CAN_FA1R_FACT22 ((uint32_t)0x00400000) /*!<Filter Active bit 22 */
  1959. #define CAN_FA1R_FACT23 ((uint32_t)0x00800000) /*!<Filter Active bit 23 */
  1960. #define CAN_FA1R_FACT24 ((uint32_t)0x01000000) /*!<Filter Active bit 24 */
  1961. #define CAN_FA1R_FACT25 ((uint32_t)0x02000000) /*!<Filter Active bit 25 */
  1962. #define CAN_FA1R_FACT26 ((uint32_t)0x04000000) /*!<Filter Active bit 26 */
  1963. #define CAN_FA1R_FACT27 ((uint32_t)0x08000000) /*!<Filter Active bit 27 */
  1964. /******************* Bit definition for CAN_F0R1 register *******************/
  1965. #define CAN_F0R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  1966. #define CAN_F0R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  1967. #define CAN_F0R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  1968. #define CAN_F0R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  1969. #define CAN_F0R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  1970. #define CAN_F0R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  1971. #define CAN_F0R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  1972. #define CAN_F0R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  1973. #define CAN_F0R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  1974. #define CAN_F0R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  1975. #define CAN_F0R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  1976. #define CAN_F0R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  1977. #define CAN_F0R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  1978. #define CAN_F0R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  1979. #define CAN_F0R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  1980. #define CAN_F0R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  1981. #define CAN_F0R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  1982. #define CAN_F0R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  1983. #define CAN_F0R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  1984. #define CAN_F0R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  1985. #define CAN_F0R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  1986. #define CAN_F0R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  1987. #define CAN_F0R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  1988. #define CAN_F0R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  1989. #define CAN_F0R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  1990. #define CAN_F0R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  1991. #define CAN_F0R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  1992. #define CAN_F0R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  1993. #define CAN_F0R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  1994. #define CAN_F0R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  1995. #define CAN_F0R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  1996. #define CAN_F0R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  1997. /******************* Bit definition for CAN_F1R1 register *******************/
  1998. #define CAN_F1R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  1999. #define CAN_F1R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2000. #define CAN_F1R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2001. #define CAN_F1R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2002. #define CAN_F1R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2003. #define CAN_F1R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2004. #define CAN_F1R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2005. #define CAN_F1R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2006. #define CAN_F1R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2007. #define CAN_F1R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2008. #define CAN_F1R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2009. #define CAN_F1R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2010. #define CAN_F1R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2011. #define CAN_F1R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2012. #define CAN_F1R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2013. #define CAN_F1R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2014. #define CAN_F1R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2015. #define CAN_F1R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2016. #define CAN_F1R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2017. #define CAN_F1R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2018. #define CAN_F1R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2019. #define CAN_F1R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2020. #define CAN_F1R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2021. #define CAN_F1R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2022. #define CAN_F1R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2023. #define CAN_F1R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2024. #define CAN_F1R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2025. #define CAN_F1R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2026. #define CAN_F1R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2027. #define CAN_F1R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2028. #define CAN_F1R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2029. #define CAN_F1R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2030. /******************* Bit definition for CAN_F2R1 register *******************/
  2031. #define CAN_F2R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2032. #define CAN_F2R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2033. #define CAN_F2R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2034. #define CAN_F2R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2035. #define CAN_F2R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2036. #define CAN_F2R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2037. #define CAN_F2R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2038. #define CAN_F2R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2039. #define CAN_F2R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2040. #define CAN_F2R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2041. #define CAN_F2R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2042. #define CAN_F2R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2043. #define CAN_F2R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2044. #define CAN_F2R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2045. #define CAN_F2R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2046. #define CAN_F2R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2047. #define CAN_F2R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2048. #define CAN_F2R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2049. #define CAN_F2R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2050. #define CAN_F2R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2051. #define CAN_F2R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2052. #define CAN_F2R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2053. #define CAN_F2R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2054. #define CAN_F2R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2055. #define CAN_F2R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2056. #define CAN_F2R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2057. #define CAN_F2R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2058. #define CAN_F2R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2059. #define CAN_F2R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2060. #define CAN_F2R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2061. #define CAN_F2R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2062. #define CAN_F2R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2063. /******************* Bit definition for CAN_F3R1 register *******************/
  2064. #define CAN_F3R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2065. #define CAN_F3R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2066. #define CAN_F3R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2067. #define CAN_F3R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2068. #define CAN_F3R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2069. #define CAN_F3R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2070. #define CAN_F3R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2071. #define CAN_F3R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2072. #define CAN_F3R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2073. #define CAN_F3R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2074. #define CAN_F3R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2075. #define CAN_F3R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2076. #define CAN_F3R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2077. #define CAN_F3R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2078. #define CAN_F3R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2079. #define CAN_F3R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2080. #define CAN_F3R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2081. #define CAN_F3R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2082. #define CAN_F3R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2083. #define CAN_F3R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2084. #define CAN_F3R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2085. #define CAN_F3R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2086. #define CAN_F3R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2087. #define CAN_F3R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2088. #define CAN_F3R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2089. #define CAN_F3R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2090. #define CAN_F3R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2091. #define CAN_F3R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2092. #define CAN_F3R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2093. #define CAN_F3R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2094. #define CAN_F3R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2095. #define CAN_F3R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2096. /******************* Bit definition for CAN_F4R1 register *******************/
  2097. #define CAN_F4R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2098. #define CAN_F4R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2099. #define CAN_F4R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2100. #define CAN_F4R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2101. #define CAN_F4R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2102. #define CAN_F4R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2103. #define CAN_F4R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2104. #define CAN_F4R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2105. #define CAN_F4R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2106. #define CAN_F4R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2107. #define CAN_F4R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2108. #define CAN_F4R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2109. #define CAN_F4R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2110. #define CAN_F4R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2111. #define CAN_F4R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2112. #define CAN_F4R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2113. #define CAN_F4R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2114. #define CAN_F4R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2115. #define CAN_F4R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2116. #define CAN_F4R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2117. #define CAN_F4R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2118. #define CAN_F4R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2119. #define CAN_F4R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2120. #define CAN_F4R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2121. #define CAN_F4R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2122. #define CAN_F4R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2123. #define CAN_F4R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2124. #define CAN_F4R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2125. #define CAN_F4R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2126. #define CAN_F4R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2127. #define CAN_F4R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2128. #define CAN_F4R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2129. /******************* Bit definition for CAN_F5R1 register *******************/
  2130. #define CAN_F5R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2131. #define CAN_F5R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2132. #define CAN_F5R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2133. #define CAN_F5R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2134. #define CAN_F5R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2135. #define CAN_F5R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2136. #define CAN_F5R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2137. #define CAN_F5R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2138. #define CAN_F5R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2139. #define CAN_F5R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2140. #define CAN_F5R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2141. #define CAN_F5R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2142. #define CAN_F5R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2143. #define CAN_F5R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2144. #define CAN_F5R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2145. #define CAN_F5R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2146. #define CAN_F5R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2147. #define CAN_F5R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2148. #define CAN_F5R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2149. #define CAN_F5R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2150. #define CAN_F5R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2151. #define CAN_F5R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2152. #define CAN_F5R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2153. #define CAN_F5R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2154. #define CAN_F5R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2155. #define CAN_F5R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2156. #define CAN_F5R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2157. #define CAN_F5R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2158. #define CAN_F5R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2159. #define CAN_F5R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2160. #define CAN_F5R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2161. #define CAN_F5R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2162. /******************* Bit definition for CAN_F6R1 register *******************/
  2163. #define CAN_F6R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2164. #define CAN_F6R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2165. #define CAN_F6R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2166. #define CAN_F6R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2167. #define CAN_F6R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2168. #define CAN_F6R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2169. #define CAN_F6R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2170. #define CAN_F6R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2171. #define CAN_F6R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2172. #define CAN_F6R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2173. #define CAN_F6R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2174. #define CAN_F6R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2175. #define CAN_F6R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2176. #define CAN_F6R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2177. #define CAN_F6R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2178. #define CAN_F6R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2179. #define CAN_F6R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2180. #define CAN_F6R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2181. #define CAN_F6R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2182. #define CAN_F6R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2183. #define CAN_F6R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2184. #define CAN_F6R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2185. #define CAN_F6R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2186. #define CAN_F6R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2187. #define CAN_F6R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2188. #define CAN_F6R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2189. #define CAN_F6R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2190. #define CAN_F6R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2191. #define CAN_F6R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2192. #define CAN_F6R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2193. #define CAN_F6R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2194. #define CAN_F6R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2195. /******************* Bit definition for CAN_F7R1 register *******************/
  2196. #define CAN_F7R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2197. #define CAN_F7R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2198. #define CAN_F7R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2199. #define CAN_F7R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2200. #define CAN_F7R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2201. #define CAN_F7R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2202. #define CAN_F7R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2203. #define CAN_F7R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2204. #define CAN_F7R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2205. #define CAN_F7R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2206. #define CAN_F7R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2207. #define CAN_F7R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2208. #define CAN_F7R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2209. #define CAN_F7R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2210. #define CAN_F7R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2211. #define CAN_F7R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2212. #define CAN_F7R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2213. #define CAN_F7R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2214. #define CAN_F7R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2215. #define CAN_F7R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2216. #define CAN_F7R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2217. #define CAN_F7R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2218. #define CAN_F7R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2219. #define CAN_F7R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2220. #define CAN_F7R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2221. #define CAN_F7R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2222. #define CAN_F7R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2223. #define CAN_F7R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2224. #define CAN_F7R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2225. #define CAN_F7R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2226. #define CAN_F7R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2227. #define CAN_F7R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2228. /******************* Bit definition for CAN_F8R1 register *******************/
  2229. #define CAN_F8R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2230. #define CAN_F8R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2231. #define CAN_F8R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2232. #define CAN_F8R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2233. #define CAN_F8R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2234. #define CAN_F8R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2235. #define CAN_F8R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2236. #define CAN_F8R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2237. #define CAN_F8R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2238. #define CAN_F8R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2239. #define CAN_F8R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2240. #define CAN_F8R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2241. #define CAN_F8R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2242. #define CAN_F8R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2243. #define CAN_F8R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2244. #define CAN_F8R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2245. #define CAN_F8R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2246. #define CAN_F8R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2247. #define CAN_F8R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2248. #define CAN_F8R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2249. #define CAN_F8R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2250. #define CAN_F8R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2251. #define CAN_F8R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2252. #define CAN_F8R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2253. #define CAN_F8R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2254. #define CAN_F8R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2255. #define CAN_F8R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2256. #define CAN_F8R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2257. #define CAN_F8R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2258. #define CAN_F8R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2259. #define CAN_F8R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2260. #define CAN_F8R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2261. /******************* Bit definition for CAN_F9R1 register *******************/
  2262. #define CAN_F9R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2263. #define CAN_F9R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2264. #define CAN_F9R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2265. #define CAN_F9R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2266. #define CAN_F9R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2267. #define CAN_F9R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2268. #define CAN_F9R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2269. #define CAN_F9R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2270. #define CAN_F9R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2271. #define CAN_F9R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2272. #define CAN_F9R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2273. #define CAN_F9R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2274. #define CAN_F9R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2275. #define CAN_F9R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2276. #define CAN_F9R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2277. #define CAN_F9R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2278. #define CAN_F9R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2279. #define CAN_F9R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2280. #define CAN_F9R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2281. #define CAN_F9R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2282. #define CAN_F9R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2283. #define CAN_F9R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2284. #define CAN_F9R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2285. #define CAN_F9R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2286. #define CAN_F9R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2287. #define CAN_F9R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2288. #define CAN_F9R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2289. #define CAN_F9R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2290. #define CAN_F9R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2291. #define CAN_F9R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2292. #define CAN_F9R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2293. #define CAN_F9R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2294. /******************* Bit definition for CAN_F10R1 register ******************/
  2295. #define CAN_F10R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2296. #define CAN_F10R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2297. #define CAN_F10R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2298. #define CAN_F10R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2299. #define CAN_F10R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2300. #define CAN_F10R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2301. #define CAN_F10R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2302. #define CAN_F10R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2303. #define CAN_F10R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2304. #define CAN_F10R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2305. #define CAN_F10R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2306. #define CAN_F10R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2307. #define CAN_F10R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2308. #define CAN_F10R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2309. #define CAN_F10R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2310. #define CAN_F10R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2311. #define CAN_F10R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2312. #define CAN_F10R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2313. #define CAN_F10R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2314. #define CAN_F10R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2315. #define CAN_F10R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2316. #define CAN_F10R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2317. #define CAN_F10R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2318. #define CAN_F10R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2319. #define CAN_F10R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2320. #define CAN_F10R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2321. #define CAN_F10R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2322. #define CAN_F10R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2323. #define CAN_F10R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2324. #define CAN_F10R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2325. #define CAN_F10R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2326. #define CAN_F10R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2327. /******************* Bit definition for CAN_F11R1 register ******************/
  2328. #define CAN_F11R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2329. #define CAN_F11R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2330. #define CAN_F11R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2331. #define CAN_F11R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2332. #define CAN_F11R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2333. #define CAN_F11R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2334. #define CAN_F11R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2335. #define CAN_F11R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2336. #define CAN_F11R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2337. #define CAN_F11R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2338. #define CAN_F11R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2339. #define CAN_F11R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2340. #define CAN_F11R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2341. #define CAN_F11R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2342. #define CAN_F11R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2343. #define CAN_F11R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2344. #define CAN_F11R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2345. #define CAN_F11R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2346. #define CAN_F11R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2347. #define CAN_F11R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2348. #define CAN_F11R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2349. #define CAN_F11R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2350. #define CAN_F11R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2351. #define CAN_F11R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2352. #define CAN_F11R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2353. #define CAN_F11R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2354. #define CAN_F11R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2355. #define CAN_F11R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2356. #define CAN_F11R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2357. #define CAN_F11R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2358. #define CAN_F11R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2359. #define CAN_F11R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2360. /******************* Bit definition for CAN_F12R1 register ******************/
  2361. #define CAN_F12R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2362. #define CAN_F12R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2363. #define CAN_F12R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2364. #define CAN_F12R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2365. #define CAN_F12R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2366. #define CAN_F12R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2367. #define CAN_F12R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2368. #define CAN_F12R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2369. #define CAN_F12R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2370. #define CAN_F12R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2371. #define CAN_F12R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2372. #define CAN_F12R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2373. #define CAN_F12R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2374. #define CAN_F12R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2375. #define CAN_F12R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2376. #define CAN_F12R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2377. #define CAN_F12R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2378. #define CAN_F12R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2379. #define CAN_F12R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2380. #define CAN_F12R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2381. #define CAN_F12R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2382. #define CAN_F12R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2383. #define CAN_F12R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2384. #define CAN_F12R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2385. #define CAN_F12R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2386. #define CAN_F12R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2387. #define CAN_F12R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2388. #define CAN_F12R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2389. #define CAN_F12R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2390. #define CAN_F12R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2391. #define CAN_F12R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2392. #define CAN_F12R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2393. /******************* Bit definition for CAN_F13R1 register ******************/
  2394. #define CAN_F13R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2395. #define CAN_F13R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2396. #define CAN_F13R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2397. #define CAN_F13R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2398. #define CAN_F13R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2399. #define CAN_F13R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2400. #define CAN_F13R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2401. #define CAN_F13R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2402. #define CAN_F13R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2403. #define CAN_F13R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2404. #define CAN_F13R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2405. #define CAN_F13R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2406. #define CAN_F13R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2407. #define CAN_F13R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2408. #define CAN_F13R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2409. #define CAN_F13R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2410. #define CAN_F13R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2411. #define CAN_F13R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2412. #define CAN_F13R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2413. #define CAN_F13R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2414. #define CAN_F13R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2415. #define CAN_F13R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2416. #define CAN_F13R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2417. #define CAN_F13R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2418. #define CAN_F13R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2419. #define CAN_F13R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2420. #define CAN_F13R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2421. #define CAN_F13R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2422. #define CAN_F13R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2423. #define CAN_F13R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2424. #define CAN_F13R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2425. #define CAN_F13R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2426. /******************* Bit definition for CAN_F0R2 register *******************/
  2427. #define CAN_F0R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2428. #define CAN_F0R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2429. #define CAN_F0R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2430. #define CAN_F0R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2431. #define CAN_F0R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2432. #define CAN_F0R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2433. #define CAN_F0R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2434. #define CAN_F0R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2435. #define CAN_F0R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2436. #define CAN_F0R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2437. #define CAN_F0R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2438. #define CAN_F0R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2439. #define CAN_F0R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2440. #define CAN_F0R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2441. #define CAN_F0R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2442. #define CAN_F0R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2443. #define CAN_F0R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2444. #define CAN_F0R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2445. #define CAN_F0R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2446. #define CAN_F0R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2447. #define CAN_F0R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2448. #define CAN_F0R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2449. #define CAN_F0R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2450. #define CAN_F0R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2451. #define CAN_F0R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2452. #define CAN_F0R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2453. #define CAN_F0R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2454. #define CAN_F0R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2455. #define CAN_F0R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2456. #define CAN_F0R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2457. #define CAN_F0R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2458. #define CAN_F0R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2459. /******************* Bit definition for CAN_F1R2 register *******************/
  2460. #define CAN_F1R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2461. #define CAN_F1R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2462. #define CAN_F1R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2463. #define CAN_F1R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2464. #define CAN_F1R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2465. #define CAN_F1R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2466. #define CAN_F1R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2467. #define CAN_F1R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2468. #define CAN_F1R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2469. #define CAN_F1R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2470. #define CAN_F1R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2471. #define CAN_F1R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2472. #define CAN_F1R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2473. #define CAN_F1R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2474. #define CAN_F1R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2475. #define CAN_F1R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2476. #define CAN_F1R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2477. #define CAN_F1R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2478. #define CAN_F1R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2479. #define CAN_F1R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2480. #define CAN_F1R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2481. #define CAN_F1R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2482. #define CAN_F1R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2483. #define CAN_F1R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2484. #define CAN_F1R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2485. #define CAN_F1R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2486. #define CAN_F1R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2487. #define CAN_F1R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2488. #define CAN_F1R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2489. #define CAN_F1R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2490. #define CAN_F1R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2491. #define CAN_F1R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2492. /******************* Bit definition for CAN_F2R2 register *******************/
  2493. #define CAN_F2R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2494. #define CAN_F2R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2495. #define CAN_F2R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2496. #define CAN_F2R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2497. #define CAN_F2R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2498. #define CAN_F2R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2499. #define CAN_F2R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2500. #define CAN_F2R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2501. #define CAN_F2R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2502. #define CAN_F2R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2503. #define CAN_F2R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2504. #define CAN_F2R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2505. #define CAN_F2R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2506. #define CAN_F2R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2507. #define CAN_F2R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2508. #define CAN_F2R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2509. #define CAN_F2R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2510. #define CAN_F2R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2511. #define CAN_F2R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2512. #define CAN_F2R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2513. #define CAN_F2R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2514. #define CAN_F2R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2515. #define CAN_F2R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2516. #define CAN_F2R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2517. #define CAN_F2R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2518. #define CAN_F2R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2519. #define CAN_F2R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2520. #define CAN_F2R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2521. #define CAN_F2R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2522. #define CAN_F2R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2523. #define CAN_F2R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2524. #define CAN_F2R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2525. /******************* Bit definition for CAN_F3R2 register *******************/
  2526. #define CAN_F3R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2527. #define CAN_F3R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2528. #define CAN_F3R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2529. #define CAN_F3R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2530. #define CAN_F3R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2531. #define CAN_F3R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2532. #define CAN_F3R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2533. #define CAN_F3R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2534. #define CAN_F3R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2535. #define CAN_F3R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2536. #define CAN_F3R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2537. #define CAN_F3R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2538. #define CAN_F3R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2539. #define CAN_F3R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2540. #define CAN_F3R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2541. #define CAN_F3R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2542. #define CAN_F3R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2543. #define CAN_F3R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2544. #define CAN_F3R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2545. #define CAN_F3R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2546. #define CAN_F3R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2547. #define CAN_F3R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2548. #define CAN_F3R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2549. #define CAN_F3R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2550. #define CAN_F3R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2551. #define CAN_F3R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2552. #define CAN_F3R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2553. #define CAN_F3R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2554. #define CAN_F3R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2555. #define CAN_F3R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2556. #define CAN_F3R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2557. #define CAN_F3R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2558. /******************* Bit definition for CAN_F4R2 register *******************/
  2559. #define CAN_F4R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2560. #define CAN_F4R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2561. #define CAN_F4R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2562. #define CAN_F4R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2563. #define CAN_F4R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2564. #define CAN_F4R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2565. #define CAN_F4R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2566. #define CAN_F4R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2567. #define CAN_F4R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2568. #define CAN_F4R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2569. #define CAN_F4R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2570. #define CAN_F4R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2571. #define CAN_F4R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2572. #define CAN_F4R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2573. #define CAN_F4R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2574. #define CAN_F4R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2575. #define CAN_F4R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2576. #define CAN_F4R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2577. #define CAN_F4R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2578. #define CAN_F4R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2579. #define CAN_F4R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2580. #define CAN_F4R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2581. #define CAN_F4R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2582. #define CAN_F4R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2583. #define CAN_F4R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2584. #define CAN_F4R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2585. #define CAN_F4R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2586. #define CAN_F4R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2587. #define CAN_F4R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2588. #define CAN_F4R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2589. #define CAN_F4R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2590. #define CAN_F4R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2591. /******************* Bit definition for CAN_F5R2 register *******************/
  2592. #define CAN_F5R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2593. #define CAN_F5R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2594. #define CAN_F5R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2595. #define CAN_F5R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2596. #define CAN_F5R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2597. #define CAN_F5R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2598. #define CAN_F5R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2599. #define CAN_F5R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2600. #define CAN_F5R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2601. #define CAN_F5R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2602. #define CAN_F5R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2603. #define CAN_F5R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2604. #define CAN_F5R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2605. #define CAN_F5R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2606. #define CAN_F5R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2607. #define CAN_F5R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2608. #define CAN_F5R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2609. #define CAN_F5R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2610. #define CAN_F5R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2611. #define CAN_F5R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2612. #define CAN_F5R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2613. #define CAN_F5R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2614. #define CAN_F5R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2615. #define CAN_F5R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2616. #define CAN_F5R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2617. #define CAN_F5R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2618. #define CAN_F5R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2619. #define CAN_F5R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2620. #define CAN_F5R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2621. #define CAN_F5R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2622. #define CAN_F5R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2623. #define CAN_F5R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2624. /******************* Bit definition for CAN_F6R2 register *******************/
  2625. #define CAN_F6R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2626. #define CAN_F6R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2627. #define CAN_F6R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2628. #define CAN_F6R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2629. #define CAN_F6R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2630. #define CAN_F6R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2631. #define CAN_F6R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2632. #define CAN_F6R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2633. #define CAN_F6R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2634. #define CAN_F6R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2635. #define CAN_F6R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2636. #define CAN_F6R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2637. #define CAN_F6R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2638. #define CAN_F6R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2639. #define CAN_F6R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2640. #define CAN_F6R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2641. #define CAN_F6R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2642. #define CAN_F6R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2643. #define CAN_F6R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2644. #define CAN_F6R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2645. #define CAN_F6R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2646. #define CAN_F6R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2647. #define CAN_F6R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2648. #define CAN_F6R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2649. #define CAN_F6R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2650. #define CAN_F6R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2651. #define CAN_F6R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2652. #define CAN_F6R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2653. #define CAN_F6R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2654. #define CAN_F6R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2655. #define CAN_F6R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2656. #define CAN_F6R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2657. /******************* Bit definition for CAN_F7R2 register *******************/
  2658. #define CAN_F7R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2659. #define CAN_F7R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2660. #define CAN_F7R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2661. #define CAN_F7R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2662. #define CAN_F7R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2663. #define CAN_F7R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2664. #define CAN_F7R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2665. #define CAN_F7R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2666. #define CAN_F7R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2667. #define CAN_F7R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2668. #define CAN_F7R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2669. #define CAN_F7R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2670. #define CAN_F7R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2671. #define CAN_F7R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2672. #define CAN_F7R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2673. #define CAN_F7R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2674. #define CAN_F7R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2675. #define CAN_F7R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2676. #define CAN_F7R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2677. #define CAN_F7R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2678. #define CAN_F7R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2679. #define CAN_F7R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2680. #define CAN_F7R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2681. #define CAN_F7R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2682. #define CAN_F7R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2683. #define CAN_F7R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2684. #define CAN_F7R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2685. #define CAN_F7R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2686. #define CAN_F7R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2687. #define CAN_F7R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2688. #define CAN_F7R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2689. #define CAN_F7R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2690. /******************* Bit definition for CAN_F8R2 register *******************/
  2691. #define CAN_F8R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2692. #define CAN_F8R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2693. #define CAN_F8R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2694. #define CAN_F8R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2695. #define CAN_F8R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2696. #define CAN_F8R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2697. #define CAN_F8R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2698. #define CAN_F8R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2699. #define CAN_F8R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2700. #define CAN_F8R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2701. #define CAN_F8R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2702. #define CAN_F8R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2703. #define CAN_F8R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2704. #define CAN_F8R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2705. #define CAN_F8R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2706. #define CAN_F8R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2707. #define CAN_F8R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2708. #define CAN_F8R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2709. #define CAN_F8R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2710. #define CAN_F8R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2711. #define CAN_F8R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2712. #define CAN_F8R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2713. #define CAN_F8R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2714. #define CAN_F8R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2715. #define CAN_F8R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2716. #define CAN_F8R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2717. #define CAN_F8R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2718. #define CAN_F8R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2719. #define CAN_F8R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2720. #define CAN_F8R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2721. #define CAN_F8R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2722. #define CAN_F8R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2723. /******************* Bit definition for CAN_F9R2 register *******************/
  2724. #define CAN_F9R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2725. #define CAN_F9R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2726. #define CAN_F9R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2727. #define CAN_F9R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2728. #define CAN_F9R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2729. #define CAN_F9R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2730. #define CAN_F9R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2731. #define CAN_F9R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2732. #define CAN_F9R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2733. #define CAN_F9R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2734. #define CAN_F9R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2735. #define CAN_F9R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2736. #define CAN_F9R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2737. #define CAN_F9R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2738. #define CAN_F9R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2739. #define CAN_F9R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2740. #define CAN_F9R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2741. #define CAN_F9R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2742. #define CAN_F9R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2743. #define CAN_F9R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2744. #define CAN_F9R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2745. #define CAN_F9R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2746. #define CAN_F9R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2747. #define CAN_F9R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2748. #define CAN_F9R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2749. #define CAN_F9R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2750. #define CAN_F9R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2751. #define CAN_F9R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2752. #define CAN_F9R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2753. #define CAN_F9R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2754. #define CAN_F9R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2755. #define CAN_F9R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2756. /******************* Bit definition for CAN_F10R2 register ******************/
  2757. #define CAN_F10R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2758. #define CAN_F10R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2759. #define CAN_F10R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2760. #define CAN_F10R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2761. #define CAN_F10R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2762. #define CAN_F10R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2763. #define CAN_F10R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2764. #define CAN_F10R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2765. #define CAN_F10R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2766. #define CAN_F10R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2767. #define CAN_F10R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2768. #define CAN_F10R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2769. #define CAN_F10R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2770. #define CAN_F10R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2771. #define CAN_F10R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2772. #define CAN_F10R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2773. #define CAN_F10R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2774. #define CAN_F10R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2775. #define CAN_F10R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2776. #define CAN_F10R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2777. #define CAN_F10R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2778. #define CAN_F10R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2779. #define CAN_F10R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2780. #define CAN_F10R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2781. #define CAN_F10R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2782. #define CAN_F10R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2783. #define CAN_F10R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2784. #define CAN_F10R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2785. #define CAN_F10R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2786. #define CAN_F10R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2787. #define CAN_F10R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2788. #define CAN_F10R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2789. /******************* Bit definition for CAN_F11R2 register ******************/
  2790. #define CAN_F11R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2791. #define CAN_F11R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2792. #define CAN_F11R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2793. #define CAN_F11R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2794. #define CAN_F11R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2795. #define CAN_F11R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2796. #define CAN_F11R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2797. #define CAN_F11R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2798. #define CAN_F11R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2799. #define CAN_F11R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2800. #define CAN_F11R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2801. #define CAN_F11R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2802. #define CAN_F11R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2803. #define CAN_F11R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2804. #define CAN_F11R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2805. #define CAN_F11R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2806. #define CAN_F11R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2807. #define CAN_F11R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2808. #define CAN_F11R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2809. #define CAN_F11R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2810. #define CAN_F11R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2811. #define CAN_F11R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2812. #define CAN_F11R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2813. #define CAN_F11R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2814. #define CAN_F11R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2815. #define CAN_F11R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2816. #define CAN_F11R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2817. #define CAN_F11R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2818. #define CAN_F11R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2819. #define CAN_F11R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2820. #define CAN_F11R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2821. #define CAN_F11R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2822. /******************* Bit definition for CAN_F12R2 register ******************/
  2823. #define CAN_F12R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2824. #define CAN_F12R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2825. #define CAN_F12R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2826. #define CAN_F12R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2827. #define CAN_F12R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2828. #define CAN_F12R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2829. #define CAN_F12R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2830. #define CAN_F12R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2831. #define CAN_F12R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2832. #define CAN_F12R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2833. #define CAN_F12R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2834. #define CAN_F12R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2835. #define CAN_F12R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2836. #define CAN_F12R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2837. #define CAN_F12R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2838. #define CAN_F12R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2839. #define CAN_F12R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2840. #define CAN_F12R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2841. #define CAN_F12R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2842. #define CAN_F12R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2843. #define CAN_F12R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2844. #define CAN_F12R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2845. #define CAN_F12R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2846. #define CAN_F12R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2847. #define CAN_F12R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2848. #define CAN_F12R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2849. #define CAN_F12R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2850. #define CAN_F12R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2851. #define CAN_F12R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2852. #define CAN_F12R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2853. #define CAN_F12R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2854. #define CAN_F12R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2855. /******************* Bit definition for CAN_F13R2 register ******************/
  2856. #define CAN_F13R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2857. #define CAN_F13R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2858. #define CAN_F13R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2859. #define CAN_F13R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2860. #define CAN_F13R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2861. #define CAN_F13R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2862. #define CAN_F13R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2863. #define CAN_F13R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2864. #define CAN_F13R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2865. #define CAN_F13R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2866. #define CAN_F13R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2867. #define CAN_F13R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2868. #define CAN_F13R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2869. #define CAN_F13R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2870. #define CAN_F13R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2871. #define CAN_F13R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2872. #define CAN_F13R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2873. #define CAN_F13R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2874. #define CAN_F13R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2875. #define CAN_F13R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2876. #define CAN_F13R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2877. #define CAN_F13R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2878. #define CAN_F13R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2879. #define CAN_F13R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2880. #define CAN_F13R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2881. #define CAN_F13R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2882. #define CAN_F13R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2883. #define CAN_F13R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2884. #define CAN_F13R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2885. #define CAN_F13R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2886. #define CAN_F13R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2887. #define CAN_F13R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2888. /******************************************************************************/
  2889. /* */
  2890. /* CRC calculation unit */
  2891. /* */
  2892. /******************************************************************************/
  2893. /******************* Bit definition for CRC_DR register *********************/
  2894. #define CRC_DR_DR ((uint32_t)0xFFFFFFFF) /*!< Data register bits */
  2895. /******************* Bit definition for CRC_IDR register ********************/
  2896. #define CRC_IDR_IDR ((uint32_t)0xFF) /*!< General-purpose 8-bit data register bits */
  2897. /******************** Bit definition for CRC_CR register ********************/
  2898. #define CRC_CR_RESET ((uint32_t)0x01) /*!< RESET bit */
  2899. /******************************************************************************/
  2900. /* */
  2901. /* Digital to Analog Converter */
  2902. /* */
  2903. /******************************************************************************/
  2904. /******************** Bit definition for DAC_CR register ********************/
  2905. #define DAC_CR_EN1 ((uint32_t)0x00000001) /*!<DAC channel1 enable */
  2906. #define DAC_CR_BOFF1 ((uint32_t)0x00000002) /*!<DAC channel1 output buffer disable */
  2907. #define DAC_CR_TEN1 ((uint32_t)0x00000004) /*!<DAC channel1 Trigger enable */
  2908. #define DAC_CR_TSEL1 ((uint32_t)0x00000038) /*!<TSEL1[2:0] (DAC channel1 Trigger selection) */
  2909. #define DAC_CR_TSEL1_0 ((uint32_t)0x00000008) /*!<Bit 0 */
  2910. #define DAC_CR_TSEL1_1 ((uint32_t)0x00000010) /*!<Bit 1 */
  2911. #define DAC_CR_TSEL1_2 ((uint32_t)0x00000020) /*!<Bit 2 */
  2912. #define DAC_CR_WAVE1 ((uint32_t)0x000000C0) /*!<WAVE1[1:0] (DAC channel1 noise/triangle wave generation enable) */
  2913. #define DAC_CR_WAVE1_0 ((uint32_t)0x00000040) /*!<Bit 0 */
  2914. #define DAC_CR_WAVE1_1 ((uint32_t)0x00000080) /*!<Bit 1 */
  2915. #define DAC_CR_MAMP1 ((uint32_t)0x00000F00) /*!<MAMP1[3:0] (DAC channel1 Mask/Amplitude selector) */
  2916. #define DAC_CR_MAMP1_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  2917. #define DAC_CR_MAMP1_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  2918. #define DAC_CR_MAMP1_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  2919. #define DAC_CR_MAMP1_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  2920. #define DAC_CR_DMAEN1 ((uint32_t)0x00001000) /*!<DAC channel1 DMA enable */
  2921. #define DAC_CR_EN2 ((uint32_t)0x00010000) /*!<DAC channel2 enable */
  2922. #define DAC_CR_BOFF2 ((uint32_t)0x00020000) /*!<DAC channel2 output buffer disable */
  2923. #define DAC_CR_TEN2 ((uint32_t)0x00040000) /*!<DAC channel2 Trigger enable */
  2924. #define DAC_CR_TSEL2 ((uint32_t)0x00380000) /*!<TSEL2[2:0] (DAC channel2 Trigger selection) */
  2925. #define DAC_CR_TSEL2_0 ((uint32_t)0x00080000) /*!<Bit 0 */
  2926. #define DAC_CR_TSEL2_1 ((uint32_t)0x00100000) /*!<Bit 1 */
  2927. #define DAC_CR_TSEL2_2 ((uint32_t)0x00200000) /*!<Bit 2 */
  2928. #define DAC_CR_WAVE2 ((uint32_t)0x00C00000) /*!<WAVE2[1:0] (DAC channel2 noise/triangle wave generation enable) */
  2929. #define DAC_CR_WAVE2_0 ((uint32_t)0x00400000) /*!<Bit 0 */
  2930. #define DAC_CR_WAVE2_1 ((uint32_t)0x00800000) /*!<Bit 1 */
  2931. #define DAC_CR_MAMP2 ((uint32_t)0x0F000000) /*!<MAMP2[3:0] (DAC channel2 Mask/Amplitude selector) */
  2932. #define DAC_CR_MAMP2_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  2933. #define DAC_CR_MAMP2_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  2934. #define DAC_CR_MAMP2_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  2935. #define DAC_CR_MAMP2_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  2936. #define DAC_CR_DMAEN2 ((uint32_t)0x10000000) /*!<DAC channel2 DMA enabled */
  2937. /***************** Bit definition for DAC_SWTRIGR register ******************/
  2938. #define DAC_SWTRIGR_SWTRIG1 ((uint32_t)0x01) /*!<DAC channel1 software trigger */
  2939. #define DAC_SWTRIGR_SWTRIG2 ((uint32_t)0x02) /*!<DAC channel2 software trigger */
  2940. /***************** Bit definition for DAC_DHR12R1 register ******************/
  2941. #define DAC_DHR12R1_DACC1DHR ((uint32_t)0x0FFF) /*!<DAC channel1 12-bit Right aligned data */
  2942. /***************** Bit definition for DAC_DHR12L1 register ******************/
  2943. #define DAC_DHR12L1_DACC1DHR ((uint32_t)0xFFF0) /*!<DAC channel1 12-bit Left aligned data */
  2944. /****************** Bit definition for DAC_DHR8R1 register ******************/
  2945. #define DAC_DHR8R1_DACC1DHR ((uint32_t)0xFF) /*!<DAC channel1 8-bit Right aligned data */
  2946. /***************** Bit definition for DAC_DHR12R2 register ******************/
  2947. #define DAC_DHR12R2_DACC2DHR ((uint32_t)0x0FFF) /*!<DAC channel2 12-bit Right aligned data */
  2948. /***************** Bit definition for DAC_DHR12L2 register ******************/
  2949. #define DAC_DHR12L2_DACC2DHR ((uint32_t)0xFFF0) /*!<DAC channel2 12-bit Left aligned data */
  2950. /****************** Bit definition for DAC_DHR8R2 register ******************/
  2951. #define DAC_DHR8R2_DACC2DHR ((uint32_t)0xFF) /*!<DAC channel2 8-bit Right aligned data */
  2952. /***************** Bit definition for DAC_DHR12RD register ******************/
  2953. #define DAC_DHR12RD_DACC1DHR ((uint32_t)0x00000FFF) /*!<DAC channel1 12-bit Right aligned data */
  2954. #define DAC_DHR12RD_DACC2DHR ((uint32_t)0x0FFF0000) /*!<DAC channel2 12-bit Right aligned data */
  2955. /***************** Bit definition for DAC_DHR12LD register ******************/
  2956. #define DAC_DHR12LD_DACC1DHR ((uint32_t)0x0000FFF0) /*!<DAC channel1 12-bit Left aligned data */
  2957. #define DAC_DHR12LD_DACC2DHR ((uint32_t)0xFFF00000) /*!<DAC channel2 12-bit Left aligned data */
  2958. /****************** Bit definition for DAC_DHR8RD register ******************/
  2959. #define DAC_DHR8RD_DACC1DHR ((uint32_t)0x00FF) /*!<DAC channel1 8-bit Right aligned data */
  2960. #define DAC_DHR8RD_DACC2DHR ((uint32_t)0xFF00) /*!<DAC channel2 8-bit Right aligned data */
  2961. /******************* Bit definition for DAC_DOR1 register *******************/
  2962. #define DAC_DOR1_DACC1DOR ((uint32_t)0x0FFF) /*!<DAC channel1 data output */
  2963. /******************* Bit definition for DAC_DOR2 register *******************/
  2964. #define DAC_DOR2_DACC2DOR ((uint32_t)0x0FFF) /*!<DAC channel2 data output */
  2965. /******************** Bit definition for DAC_SR register ********************/
  2966. #define DAC_SR_DMAUDR1 ((uint32_t)0x00002000) /*!<DAC channel1 DMA underrun flag */
  2967. #define DAC_SR_DMAUDR2 ((uint32_t)0x20000000) /*!<DAC channel2 DMA underrun flag */
  2968. /******************************************************************************/
  2969. /* */
  2970. /* Debug MCU */
  2971. /* */
  2972. /******************************************************************************/
  2973. /******************************************************************************/
  2974. /* */
  2975. /* DCMI */
  2976. /* */
  2977. /******************************************************************************/
  2978. /******************** Bits definition for DCMI_CR register ******************/
  2979. #define DCMI_CR_CAPTURE ((uint32_t)0x00000001)
  2980. #define DCMI_CR_CM ((uint32_t)0x00000002)
  2981. #define DCMI_CR_CROP ((uint32_t)0x00000004)
  2982. #define DCMI_CR_JPEG ((uint32_t)0x00000008)
  2983. #define DCMI_CR_ESS ((uint32_t)0x00000010)
  2984. #define DCMI_CR_PCKPOL ((uint32_t)0x00000020)
  2985. #define DCMI_CR_HSPOL ((uint32_t)0x00000040)
  2986. #define DCMI_CR_VSPOL ((uint32_t)0x00000080)
  2987. #define DCMI_CR_FCRC_0 ((uint32_t)0x00000100)
  2988. #define DCMI_CR_FCRC_1 ((uint32_t)0x00000200)
  2989. #define DCMI_CR_EDM_0 ((uint32_t)0x00000400)
  2990. #define DCMI_CR_EDM_1 ((uint32_t)0x00000800)
  2991. #define DCMI_CR_OUTEN ((uint32_t)0x00002000)
  2992. #define DCMI_CR_ENABLE ((uint32_t)0x00004000)
  2993. #define DCMI_CR_BSM_0 ((uint32_t)0x00010000)
  2994. #define DCMI_CR_BSM_1 ((uint32_t)0x00020000)
  2995. #define DCMI_CR_OEBS ((uint32_t)0x00040000)
  2996. #define DCMI_CR_LSM ((uint32_t)0x00080000)
  2997. #define DCMI_CR_OELS ((uint32_t)0x00100000)
  2998. /******************** Bits definition for DCMI_SR register ******************/
  2999. #define DCMI_SR_HSYNC ((uint32_t)0x00000001)
  3000. #define DCMI_SR_VSYNC ((uint32_t)0x00000002)
  3001. #define DCMI_SR_FNE ((uint32_t)0x00000004)
  3002. /******************** Bits definition for DCMI_RISR register ****************/
  3003. #define DCMI_RISR_FRAME_RIS ((uint32_t)0x00000001)
  3004. #define DCMI_RISR_OVF_RIS ((uint32_t)0x00000002)
  3005. #define DCMI_RISR_ERR_RIS ((uint32_t)0x00000004)
  3006. #define DCMI_RISR_VSYNC_RIS ((uint32_t)0x00000008)
  3007. #define DCMI_RISR_LINE_RIS ((uint32_t)0x00000010)
  3008. /******************** Bits definition for DCMI_IER register *****************/
  3009. #define DCMI_IER_FRAME_IE ((uint32_t)0x00000001)
  3010. #define DCMI_IER_OVF_IE ((uint32_t)0x00000002)
  3011. #define DCMI_IER_ERR_IE ((uint32_t)0x00000004)
  3012. #define DCMI_IER_VSYNC_IE ((uint32_t)0x00000008)
  3013. #define DCMI_IER_LINE_IE ((uint32_t)0x00000010)
  3014. /******************** Bits definition for DCMI_MISR register ****************/
  3015. #define DCMI_MISR_FRAME_MIS ((uint32_t)0x00000001)
  3016. #define DCMI_MISR_OVF_MIS ((uint32_t)0x00000002)
  3017. #define DCMI_MISR_ERR_MIS ((uint32_t)0x00000004)
  3018. #define DCMI_MISR_VSYNC_MIS ((uint32_t)0x00000008)
  3019. #define DCMI_MISR_LINE_MIS ((uint32_t)0x00000010)
  3020. /******************** Bits definition for DCMI_ICR register *****************/
  3021. #define DCMI_ICR_FRAME_ISC ((uint32_t)0x00000001)
  3022. #define DCMI_ICR_OVF_ISC ((uint32_t)0x00000002)
  3023. #define DCMI_ICR_ERR_ISC ((uint32_t)0x00000004)
  3024. #define DCMI_ICR_VSYNC_ISC ((uint32_t)0x00000008)
  3025. #define DCMI_ICR_LINE_ISC ((uint32_t)0x00000010)
  3026. /******************************************************************************/
  3027. /* */
  3028. /* DMA Controller */
  3029. /* */
  3030. /******************************************************************************/
  3031. /******************** Bits definition for DMA_SxCR register *****************/
  3032. #define DMA_SxCR_CHSEL ((uint32_t)0x0E000000)
  3033. #define DMA_SxCR_CHSEL_0 ((uint32_t)0x02000000)
  3034. #define DMA_SxCR_CHSEL_1 ((uint32_t)0x04000000)
  3035. #define DMA_SxCR_CHSEL_2 ((uint32_t)0x08000000)
  3036. #define DMA_SxCR_MBURST ((uint32_t)0x01800000)
  3037. #define DMA_SxCR_MBURST_0 ((uint32_t)0x00800000)
  3038. #define DMA_SxCR_MBURST_1 ((uint32_t)0x01000000)
  3039. #define DMA_SxCR_PBURST ((uint32_t)0x00600000)
  3040. #define DMA_SxCR_PBURST_0 ((uint32_t)0x00200000)
  3041. #define DMA_SxCR_PBURST_1 ((uint32_t)0x00400000)
  3042. #define DMA_SxCR_ACK ((uint32_t)0x00100000)
  3043. #define DMA_SxCR_CT ((uint32_t)0x00080000)
  3044. #define DMA_SxCR_DBM ((uint32_t)0x00040000)
  3045. #define DMA_SxCR_PL ((uint32_t)0x00030000)
  3046. #define DMA_SxCR_PL_0 ((uint32_t)0x00010000)
  3047. #define DMA_SxCR_PL_1 ((uint32_t)0x00020000)
  3048. #define DMA_SxCR_PINCOS ((uint32_t)0x00008000)
  3049. #define DMA_SxCR_MSIZE ((uint32_t)0x00006000)
  3050. #define DMA_SxCR_MSIZE_0 ((uint32_t)0x00002000)
  3051. #define DMA_SxCR_MSIZE_1 ((uint32_t)0x00004000)
  3052. #define DMA_SxCR_PSIZE ((uint32_t)0x00001800)
  3053. #define DMA_SxCR_PSIZE_0 ((uint32_t)0x00000800)
  3054. #define DMA_SxCR_PSIZE_1 ((uint32_t)0x00001000)
  3055. #define DMA_SxCR_MINC ((uint32_t)0x00000400)
  3056. #define DMA_SxCR_PINC ((uint32_t)0x00000200)
  3057. #define DMA_SxCR_CIRC ((uint32_t)0x00000100)
  3058. #define DMA_SxCR_DIR ((uint32_t)0x000000C0)
  3059. #define DMA_SxCR_DIR_0 ((uint32_t)0x00000040)
  3060. #define DMA_SxCR_DIR_1 ((uint32_t)0x00000080)
  3061. #define DMA_SxCR_PFCTRL ((uint32_t)0x00000020)
  3062. #define DMA_SxCR_TCIE ((uint32_t)0x00000010)
  3063. #define DMA_SxCR_HTIE ((uint32_t)0x00000008)
  3064. #define DMA_SxCR_TEIE ((uint32_t)0x00000004)
  3065. #define DMA_SxCR_DMEIE ((uint32_t)0x00000002)
  3066. #define DMA_SxCR_EN ((uint32_t)0x00000001)
  3067. /******************** Bits definition for DMA_SxCNDTR register **************/
  3068. #define DMA_SxNDT ((uint32_t)0x0000FFFF)
  3069. #define DMA_SxNDT_0 ((uint32_t)0x00000001)
  3070. #define DMA_SxNDT_1 ((uint32_t)0x00000002)
  3071. #define DMA_SxNDT_2 ((uint32_t)0x00000004)
  3072. #define DMA_SxNDT_3 ((uint32_t)0x00000008)
  3073. #define DMA_SxNDT_4 ((uint32_t)0x00000010)
  3074. #define DMA_SxNDT_5 ((uint32_t)0x00000020)
  3075. #define DMA_SxNDT_6 ((uint32_t)0x00000040)
  3076. #define DMA_SxNDT_7 ((uint32_t)0x00000080)
  3077. #define DMA_SxNDT_8 ((uint32_t)0x00000100)
  3078. #define DMA_SxNDT_9 ((uint32_t)0x00000200)
  3079. #define DMA_SxNDT_10 ((uint32_t)0x00000400)
  3080. #define DMA_SxNDT_11 ((uint32_t)0x00000800)
  3081. #define DMA_SxNDT_12 ((uint32_t)0x00001000)
  3082. #define DMA_SxNDT_13 ((uint32_t)0x00002000)
  3083. #define DMA_SxNDT_14 ((uint32_t)0x00004000)
  3084. #define DMA_SxNDT_15 ((uint32_t)0x00008000)
  3085. /******************** Bits definition for DMA_SxFCR register ****************/
  3086. #define DMA_SxFCR_FEIE ((uint32_t)0x00000080)
  3087. #define DMA_SxFCR_FS ((uint32_t)0x00000038)
  3088. #define DMA_SxFCR_FS_0 ((uint32_t)0x00000008)
  3089. #define DMA_SxFCR_FS_1 ((uint32_t)0x00000010)
  3090. #define DMA_SxFCR_FS_2 ((uint32_t)0x00000020)
  3091. #define DMA_SxFCR_DMDIS ((uint32_t)0x00000004)
  3092. #define DMA_SxFCR_FTH ((uint32_t)0x00000003)
  3093. #define DMA_SxFCR_FTH_0 ((uint32_t)0x00000001)
  3094. #define DMA_SxFCR_FTH_1 ((uint32_t)0x00000002)
  3095. /******************** Bits definition for DMA_LISR register *****************/
  3096. #define DMA_LISR_TCIF3 ((uint32_t)0x08000000)
  3097. #define DMA_LISR_HTIF3 ((uint32_t)0x04000000)
  3098. #define DMA_LISR_TEIF3 ((uint32_t)0x02000000)
  3099. #define DMA_LISR_DMEIF3 ((uint32_t)0x01000000)
  3100. #define DMA_LISR_FEIF3 ((uint32_t)0x00400000)
  3101. #define DMA_LISR_TCIF2 ((uint32_t)0x00200000)
  3102. #define DMA_LISR_HTIF2 ((uint32_t)0x00100000)
  3103. #define DMA_LISR_TEIF2 ((uint32_t)0x00080000)
  3104. #define DMA_LISR_DMEIF2 ((uint32_t)0x00040000)
  3105. #define DMA_LISR_FEIF2 ((uint32_t)0x00010000)
  3106. #define DMA_LISR_TCIF1 ((uint32_t)0x00000800)
  3107. #define DMA_LISR_HTIF1 ((uint32_t)0x00000400)
  3108. #define DMA_LISR_TEIF1 ((uint32_t)0x00000200)
  3109. #define DMA_LISR_DMEIF1 ((uint32_t)0x00000100)
  3110. #define DMA_LISR_FEIF1 ((uint32_t)0x00000040)
  3111. #define DMA_LISR_TCIF0 ((uint32_t)0x00000020)
  3112. #define DMA_LISR_HTIF0 ((uint32_t)0x00000010)
  3113. #define DMA_LISR_TEIF0 ((uint32_t)0x00000008)
  3114. #define DMA_LISR_DMEIF0 ((uint32_t)0x00000004)
  3115. #define DMA_LISR_FEIF0 ((uint32_t)0x00000001)
  3116. /******************** Bits definition for DMA_HISR register *****************/
  3117. #define DMA_HISR_TCIF7 ((uint32_t)0x08000000)
  3118. #define DMA_HISR_HTIF7 ((uint32_t)0x04000000)
  3119. #define DMA_HISR_TEIF7 ((uint32_t)0x02000000)
  3120. #define DMA_HISR_DMEIF7 ((uint32_t)0x01000000)
  3121. #define DMA_HISR_FEIF7 ((uint32_t)0x00400000)
  3122. #define DMA_HISR_TCIF6 ((uint32_t)0x00200000)
  3123. #define DMA_HISR_HTIF6 ((uint32_t)0x00100000)
  3124. #define DMA_HISR_TEIF6 ((uint32_t)0x00080000)
  3125. #define DMA_HISR_DMEIF6 ((uint32_t)0x00040000)
  3126. #define DMA_HISR_FEIF6 ((uint32_t)0x00010000)
  3127. #define DMA_HISR_TCIF5 ((uint32_t)0x00000800)
  3128. #define DMA_HISR_HTIF5 ((uint32_t)0x00000400)
  3129. #define DMA_HISR_TEIF5 ((uint32_t)0x00000200)
  3130. #define DMA_HISR_DMEIF5 ((uint32_t)0x00000100)
  3131. #define DMA_HISR_FEIF5 ((uint32_t)0x00000040)
  3132. #define DMA_HISR_TCIF4 ((uint32_t)0x00000020)
  3133. #define DMA_HISR_HTIF4 ((uint32_t)0x00000010)
  3134. #define DMA_HISR_TEIF4 ((uint32_t)0x00000008)
  3135. #define DMA_HISR_DMEIF4 ((uint32_t)0x00000004)
  3136. #define DMA_HISR_FEIF4 ((uint32_t)0x00000001)
  3137. /******************** Bits definition for DMA_LIFCR register ****************/
  3138. #define DMA_LIFCR_CTCIF3 ((uint32_t)0x08000000)
  3139. #define DMA_LIFCR_CHTIF3 ((uint32_t)0x04000000)
  3140. #define DMA_LIFCR_CTEIF3 ((uint32_t)0x02000000)
  3141. #define DMA_LIFCR_CDMEIF3 ((uint32_t)0x01000000)
  3142. #define DMA_LIFCR_CFEIF3 ((uint32_t)0x00400000)
  3143. #define DMA_LIFCR_CTCIF2 ((uint32_t)0x00200000)
  3144. #define DMA_LIFCR_CHTIF2 ((uint32_t)0x00100000)
  3145. #define DMA_LIFCR_CTEIF2 ((uint32_t)0x00080000)
  3146. #define DMA_LIFCR_CDMEIF2 ((uint32_t)0x00040000)
  3147. #define DMA_LIFCR_CFEIF2 ((uint32_t)0x00010000)
  3148. #define DMA_LIFCR_CTCIF1 ((uint32_t)0x00000800)
  3149. #define DMA_LIFCR_CHTIF1 ((uint32_t)0x00000400)
  3150. #define DMA_LIFCR_CTEIF1 ((uint32_t)0x00000200)
  3151. #define DMA_LIFCR_CDMEIF1 ((uint32_t)0x00000100)
  3152. #define DMA_LIFCR_CFEIF1 ((uint32_t)0x00000040)
  3153. #define DMA_LIFCR_CTCIF0 ((uint32_t)0x00000020)
  3154. #define DMA_LIFCR_CHTIF0 ((uint32_t)0x00000010)
  3155. #define DMA_LIFCR_CTEIF0 ((uint32_t)0x00000008)
  3156. #define DMA_LIFCR_CDMEIF0 ((uint32_t)0x00000004)
  3157. #define DMA_LIFCR_CFEIF0 ((uint32_t)0x00000001)
  3158. /******************** Bits definition for DMA_HIFCR register ****************/
  3159. #define DMA_HIFCR_CTCIF7 ((uint32_t)0x08000000)
  3160. #define DMA_HIFCR_CHTIF7 ((uint32_t)0x04000000)
  3161. #define DMA_HIFCR_CTEIF7 ((uint32_t)0x02000000)
  3162. #define DMA_HIFCR_CDMEIF7 ((uint32_t)0x01000000)
  3163. #define DMA_HIFCR_CFEIF7 ((uint32_t)0x00400000)
  3164. #define DMA_HIFCR_CTCIF6 ((uint32_t)0x00200000)
  3165. #define DMA_HIFCR_CHTIF6 ((uint32_t)0x00100000)
  3166. #define DMA_HIFCR_CTEIF6 ((uint32_t)0x00080000)
  3167. #define DMA_HIFCR_CDMEIF6 ((uint32_t)0x00040000)
  3168. #define DMA_HIFCR_CFEIF6 ((uint32_t)0x00010000)
  3169. #define DMA_HIFCR_CTCIF5 ((uint32_t)0x00000800)
  3170. #define DMA_HIFCR_CHTIF5 ((uint32_t)0x00000400)
  3171. #define DMA_HIFCR_CTEIF5 ((uint32_t)0x00000200)
  3172. #define DMA_HIFCR_CDMEIF5 ((uint32_t)0x00000100)
  3173. #define DMA_HIFCR_CFEIF5 ((uint32_t)0x00000040)
  3174. #define DMA_HIFCR_CTCIF4 ((uint32_t)0x00000020)
  3175. #define DMA_HIFCR_CHTIF4 ((uint32_t)0x00000010)
  3176. #define DMA_HIFCR_CTEIF4 ((uint32_t)0x00000008)
  3177. #define DMA_HIFCR_CDMEIF4 ((uint32_t)0x00000004)
  3178. #define DMA_HIFCR_CFEIF4 ((uint32_t)0x00000001)
  3179. /******************************************************************************/
  3180. /* */
  3181. /* AHB Master DMA2D Controller (DMA2D) */
  3182. /* */
  3183. /******************************************************************************/
  3184. /******************** Bit definition for DMA2D_CR register ******************/
  3185. #define DMA2D_CR_START ((uint32_t)0x00000001) /*!< Start transfer */
  3186. #define DMA2D_CR_SUSP ((uint32_t)0x00000002) /*!< Suspend transfer */
  3187. #define DMA2D_CR_ABORT ((uint32_t)0x00000004) /*!< Abort transfer */
  3188. #define DMA2D_CR_TEIE ((uint32_t)0x00000100) /*!< Transfer Error Interrupt Enable */
  3189. #define DMA2D_CR_TCIE ((uint32_t)0x00000200) /*!< Transfer Complete Interrupt Enable */
  3190. #define DMA2D_CR_TWIE ((uint32_t)0x00000400) /*!< Transfer Watermark Interrupt Enable */
  3191. #define DMA2D_CR_CAEIE ((uint32_t)0x00000800) /*!< CLUT Access Error Interrupt Enable */
  3192. #define DMA2D_CR_CTCIE ((uint32_t)0x00001000) /*!< CLUT Transfer Complete Interrupt Enable */
  3193. #define DMA2D_CR_CEIE ((uint32_t)0x00002000) /*!< Configuration Error Interrupt Enable */
  3194. #define DMA2D_CR_MODE ((uint32_t)0x00030000) /*!< DMA2D Mode */
  3195. /******************** Bit definition for DMA2D_ISR register *****************/
  3196. #define DMA2D_ISR_TEIF ((uint32_t)0x00000001) /*!< Transfer Error Interrupt Flag */
  3197. #define DMA2D_ISR_TCIF ((uint32_t)0x00000002) /*!< Transfer Complete Interrupt Flag */
  3198. #define DMA2D_ISR_TWIF ((uint32_t)0x00000004) /*!< Transfer Watermark Interrupt Flag */
  3199. #define DMA2D_ISR_CAEIF ((uint32_t)0x00000008) /*!< CLUT Access Error Interrupt Flag */
  3200. #define DMA2D_ISR_CTCIF ((uint32_t)0x00000010) /*!< CLUT Transfer Complete Interrupt Flag */
  3201. #define DMA2D_ISR_CEIF ((uint32_t)0x00000020) /*!< Configuration Error Interrupt Flag */
  3202. /******************** Bit definition for DMA2D_IFSR register ****************/
  3203. #define DMA2D_IFSR_CTEIF ((uint32_t)0x00000001) /*!< Clears Transfer Error Interrupt Flag */
  3204. #define DMA2D_IFSR_CTCIF ((uint32_t)0x00000002) /*!< Clears Transfer Complete Interrupt Flag */
  3205. #define DMA2D_IFSR_CTWIF ((uint32_t)0x00000004) /*!< Clears Transfer Watermark Interrupt Flag */
  3206. #define DMA2D_IFSR_CCAEIF ((uint32_t)0x00000008) /*!< Clears CLUT Access Error Interrupt Flag */
  3207. #define DMA2D_IFSR_CCTCIF ((uint32_t)0x00000010) /*!< Clears CLUT Transfer Complete Interrupt Flag */
  3208. #define DMA2D_IFSR_CCEIF ((uint32_t)0x00000020) /*!< Clears Configuration Error Interrupt Flag */
  3209. /******************** Bit definition for DMA2D_FGMAR register ***************/
  3210. #define DMA2D_FGMAR_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  3211. /******************** Bit definition for DMA2D_FGOR register ****************/
  3212. #define DMA2D_FGOR_LO ((uint32_t)0x00003FFF) /*!< Line Offset */
  3213. /******************** Bit definition for DMA2D_BGMAR register ***************/
  3214. #define DMA2D_BGMAR_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  3215. /******************** Bit definition for DMA2D_BGOR register ****************/
  3216. #define DMA2D_BGOR_LO ((uint32_t)0x00003FFF) /*!< Line Offset */
  3217. /******************** Bit definition for DMA2D_FGPFCCR register *************/
  3218. #define DMA2D_FGPFCCR_CM ((uint32_t)0x0000000F) /*!< Color mode */
  3219. #define DMA2D_FGPFCCR_CCM ((uint32_t)0x00000010) /*!< CLUT Color mode */
  3220. #define DMA2D_FGPFCCR_START ((uint32_t)0x00000020) /*!< Start */
  3221. #define DMA2D_FGPFCCR_CS ((uint32_t)0x0000FF00) /*!< CLUT size */
  3222. #define DMA2D_FGPFCCR_AM ((uint32_t)0x00030000) /*!< Alpha mode */
  3223. #define DMA2D_FGPFCCR_ALPHA ((uint32_t)0xFF000000) /*!< Alpha value */
  3224. /******************** Bit definition for DMA2D_FGCOLR register **************/
  3225. #define DMA2D_FGCOLR_BLUE ((uint32_t)0x000000FF) /*!< Blue Value */
  3226. #define DMA2D_FGCOLR_GREEN ((uint32_t)0x0000FF00) /*!< Green Value */
  3227. #define DMA2D_FGCOLR_RED ((uint32_t)0x00FF0000) /*!< Red Value */
  3228. /******************** Bit definition for DMA2D_BGPFCCR register *************/
  3229. #define DMA2D_BGPFCCR_CM ((uint32_t)0x0000000F) /*!< Color mode */
  3230. #define DMA2D_BGPFCCR_CCM ((uint32_t)0x00000010) /*!< CLUT Color mode */
  3231. #define DMA2D_BGPFCCR_START ((uint32_t)0x00000020) /*!< Start */
  3232. #define DMA2D_BGPFCCR_CS ((uint32_t)0x0000FF00) /*!< CLUT size */
  3233. #define DMA2D_BGPFCCR_AM ((uint32_t)0x00030000) /*!< Alpha Mode */
  3234. #define DMA2D_BGPFCCR_ALPHA ((uint32_t)0xFF000000) /*!< Alpha value */
  3235. /******************** Bit definition for DMA2D_BGCOLR register **************/
  3236. #define DMA2D_BGCOLR_BLUE ((uint32_t)0x000000FF) /*!< Blue Value */
  3237. #define DMA2D_BGCOLR_GREEN ((uint32_t)0x0000FF00) /*!< Green Value */
  3238. #define DMA2D_BGCOLR_RED ((uint32_t)0x00FF0000) /*!< Red Value */
  3239. /******************** Bit definition for DMA2D_FGCMAR register **************/
  3240. #define DMA2D_FGCMAR_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  3241. /******************** Bit definition for DMA2D_BGCMAR register **************/
  3242. #define DMA2D_BGCMAR_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  3243. /******************** Bit definition for DMA2D_OPFCCR register **************/
  3244. #define DMA2D_OPFCCR_CM ((uint32_t)0x00000007) /*!< Color mode */
  3245. /******************** Bit definition for DMA2D_OCOLR register ***************/
  3246. /*!<Mode_ARGB8888/RGB888 */
  3247. #define DMA2D_OCOLR_BLUE_1 ((uint32_t)0x000000FF) /*!< BLUE Value */
  3248. #define DMA2D_OCOLR_GREEN_1 ((uint32_t)0x0000FF00) /*!< GREEN Value */
  3249. #define DMA2D_OCOLR_RED_1 ((uint32_t)0x00FF0000) /*!< Red Value */
  3250. #define DMA2D_OCOLR_ALPHA_1 ((uint32_t)0xFF000000) /*!< Alpha Channel Value */
  3251. /*!<Mode_RGB565 */
  3252. #define DMA2D_OCOLR_BLUE_2 ((uint32_t)0x0000001F) /*!< BLUE Value */
  3253. #define DMA2D_OCOLR_GREEN_2 ((uint32_t)0x000007E0) /*!< GREEN Value */
  3254. #define DMA2D_OCOLR_RED_2 ((uint32_t)0x0000F800) /*!< Red Value */
  3255. /*!<Mode_ARGB1555 */
  3256. #define DMA2D_OCOLR_BLUE_3 ((uint32_t)0x0000001F) /*!< BLUE Value */
  3257. #define DMA2D_OCOLR_GREEN_3 ((uint32_t)0x000003E0) /*!< GREEN Value */
  3258. #define DMA2D_OCOLR_RED_3 ((uint32_t)0x00007C00) /*!< Red Value */
  3259. #define DMA2D_OCOLR_ALPHA_3 ((uint32_t)0x00008000) /*!< Alpha Channel Value */
  3260. /*!<Mode_ARGB4444 */
  3261. #define DMA2D_OCOLR_BLUE_4 ((uint32_t)0x0000000F) /*!< BLUE Value */
  3262. #define DMA2D_OCOLR_GREEN_4 ((uint32_t)0x000000F0) /*!< GREEN Value */
  3263. #define DMA2D_OCOLR_RED_4 ((uint32_t)0x00000F00) /*!< Red Value */
  3264. #define DMA2D_OCOLR_ALPHA_4 ((uint32_t)0x0000F000) /*!< Alpha Channel Value */
  3265. /******************** Bit definition for DMA2D_OMAR register ****************/
  3266. #define DMA2D_OMAR_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  3267. /******************** Bit definition for DMA2D_OOR register *****************/
  3268. #define DMA2D_OOR_LO ((uint32_t)0x00003FFF) /*!< Line Offset */
  3269. /******************** Bit definition for DMA2D_NLR register *****************/
  3270. #define DMA2D_NLR_NL ((uint32_t)0x0000FFFF) /*!< Number of Lines */
  3271. #define DMA2D_NLR_PL ((uint32_t)0x3FFF0000) /*!< Pixel per Lines */
  3272. /******************** Bit definition for DMA2D_LWR register *****************/
  3273. #define DMA2D_LWR_LW ((uint32_t)0x0000FFFF) /*!< Line Watermark */
  3274. /******************** Bit definition for DMA2D_AMTCR register ***************/
  3275. #define DMA2D_AMTCR_EN ((uint32_t)0x00000001) /*!< Enable */
  3276. #define DMA2D_AMTCR_DT ((uint32_t)0x0000FF00) /*!< Dead Time */
  3277. /******************** Bit definition for DMA2D_FGCLUT register **************/
  3278. /******************** Bit definition for DMA2D_BGCLUT register **************/
  3279. /******************************************************************************/
  3280. /* */
  3281. /* Display Serial Interface (DSI) */
  3282. /* */
  3283. /******************************************************************************/
  3284. /******************* Bit definition for DSI_VR register *****************/
  3285. #define DSI_VR ((uint32_t)0x3133302A) /*!< DSI Host Version */
  3286. /******************* Bit definition for DSI_CR register *****************/
  3287. #define DSI_CR_EN ((uint32_t)0x00000001) /*!< DSI Host power up and reset */
  3288. /******************* Bit definition for DSI_CCR register ****************/
  3289. #define DSI_CCR_TXECKDIV ((uint32_t)0x000000FF) /*!< TX Escape Clock Division */
  3290. #define DSI_CCR_TXECKDIV0 ((uint32_t)0x00000001)
  3291. #define DSI_CCR_TXECKDIV1 ((uint32_t)0x00000002)
  3292. #define DSI_CCR_TXECKDIV2 ((uint32_t)0x00000004)
  3293. #define DSI_CCR_TXECKDIV3 ((uint32_t)0x00000008)
  3294. #define DSI_CCR_TXECKDIV4 ((uint32_t)0x00000010)
  3295. #define DSI_CCR_TXECKDIV5 ((uint32_t)0x00000020)
  3296. #define DSI_CCR_TXECKDIV6 ((uint32_t)0x00000040)
  3297. #define DSI_CCR_TXECKDIV7 ((uint32_t)0x00000080)
  3298. #define DSI_CCR_TOCKDIV ((uint32_t)0x0000FF00) /*!< Timeout Clock Division */
  3299. #define DSI_CCR_TOCKDIV0 ((uint32_t)0x00000100)
  3300. #define DSI_CCR_TOCKDIV1 ((uint32_t)0x00000200)
  3301. #define DSI_CCR_TOCKDIV2 ((uint32_t)0x00000400)
  3302. #define DSI_CCR_TOCKDIV3 ((uint32_t)0x00000800)
  3303. #define DSI_CCR_TOCKDIV4 ((uint32_t)0x00001000)
  3304. #define DSI_CCR_TOCKDIV5 ((uint32_t)0x00002000)
  3305. #define DSI_CCR_TOCKDIV6 ((uint32_t)0x00004000)
  3306. #define DSI_CCR_TOCKDIV7 ((uint32_t)0x00008000)
  3307. /******************* Bit definition for DSI_LVCIDR register *************/
  3308. #define DSI_LVCIDR_VCID ((uint32_t)0x00000003) /*!< Virtual Channel ID */
  3309. #define DSI_LVCIDR_VCID0 ((uint32_t)0x00000001)
  3310. #define DSI_LVCIDR_VCID1 ((uint32_t)0x00000002)
  3311. /******************* Bit definition for DSI_LCOLCR register *************/
  3312. #define DSI_LCOLCR_COLC ((uint32_t)0x0000000F) /*!< Color Coding */
  3313. #define DSI_LCOLCR_COLC0 ((uint32_t)0x00000001)
  3314. #define DSI_LCOLCR_COLC1 ((uint32_t)0x00000020)
  3315. #define DSI_LCOLCR_COLC2 ((uint32_t)0x00000040)
  3316. #define DSI_LCOLCR_COLC3 ((uint32_t)0x00000080)
  3317. #define DSI_LCOLCR_LPE ((uint32_t)0x00000100) /*!< Loosly Packet Enable */
  3318. /******************* Bit definition for DSI_LPCR register ***************/
  3319. #define DSI_LPCR_DEP ((uint32_t)0x00000001) /*!< Data Enable Polarity */
  3320. #define DSI_LPCR_VSP ((uint32_t)0x00000002) /*!< VSYNC Polarity */
  3321. #define DSI_LPCR_HSP ((uint32_t)0x00000004) /*!< HSYNC Polarity */
  3322. /******************* Bit definition for DSI_LPMCR register **************/
  3323. #define DSI_LPMCR_VLPSIZE ((uint32_t)0x000000FF) /*!< VACT Largest Packet Size */
  3324. #define DSI_LPMCR_VLPSIZE0 ((uint32_t)0x00000001)
  3325. #define DSI_LPMCR_VLPSIZE1 ((uint32_t)0x00000002)
  3326. #define DSI_LPMCR_VLPSIZE2 ((uint32_t)0x00000004)
  3327. #define DSI_LPMCR_VLPSIZE3 ((uint32_t)0x00000008)
  3328. #define DSI_LPMCR_VLPSIZE4 ((uint32_t)0x00000010)
  3329. #define DSI_LPMCR_VLPSIZE5 ((uint32_t)0x00000020)
  3330. #define DSI_LPMCR_VLPSIZE6 ((uint32_t)0x00000040)
  3331. #define DSI_LPMCR_VLPSIZE7 ((uint32_t)0x00000080)
  3332. #define DSI_LPMCR_LPSIZE ((uint32_t)0x00FF0000) /*!< Largest Packet Size */
  3333. #define DSI_LPMCR_LPSIZE0 ((uint32_t)0x00010000)
  3334. #define DSI_LPMCR_LPSIZE1 ((uint32_t)0x00020000)
  3335. #define DSI_LPMCR_LPSIZE2 ((uint32_t)0x00040000)
  3336. #define DSI_LPMCR_LPSIZE3 ((uint32_t)0x00080000)
  3337. #define DSI_LPMCR_LPSIZE4 ((uint32_t)0x00100000)
  3338. #define DSI_LPMCR_LPSIZE5 ((uint32_t)0x00200000)
  3339. #define DSI_LPMCR_LPSIZE6 ((uint32_t)0x00400000)
  3340. #define DSI_LPMCR_LPSIZE7 ((uint32_t)0x00800000)
  3341. /******************* Bit definition for DSI_PCR register ****************/
  3342. #define DSI_PCR_ETTXE ((uint32_t)0x00000001) /*!< EoTp Transmission Enable */
  3343. #define DSI_PCR_ETRXE ((uint32_t)0x00000002) /*!< EoTp Reception Enable */
  3344. #define DSI_PCR_BTAE ((uint32_t)0x00000004) /*!< Bus Turn Around Enable */
  3345. #define DSI_PCR_ECCRXE ((uint32_t)0x00000008) /*!< ECC Reception Enable */
  3346. #define DSI_PCR_CRCRXE ((uint32_t)0x00000010) /*!< CRC Reception Enable */
  3347. /******************* Bit definition for DSI_GVCIDR register *************/
  3348. #define DSI_GVCIDR_VCID ((uint32_t)0x00000003) /*!< Virtual Channel ID */
  3349. #define DSI_GVCIDR_VCID0 ((uint32_t)0x00000001)
  3350. #define DSI_GVCIDR_VCID1 ((uint32_t)0x00000002)
  3351. /******************* Bit definition for DSI_MCR register ****************/
  3352. #define DSI_MCR_CMDM ((uint32_t)0x00000001) /*!< Command Mode */
  3353. /******************* Bit definition for DSI_VMCR register ***************/
  3354. #define DSI_VMCR_VMT ((uint32_t)0x00000003) /*!< Video Mode Type */
  3355. #define DSI_VMCR_VMT0 ((uint32_t)0x00000001)
  3356. #define DSI_VMCR_VMT1 ((uint32_t)0x00000002)
  3357. #define DSI_VMCR_LPVSAE ((uint32_t)0x00000100) /*!< Low-Power Vertical Sync Active Enable */
  3358. #define DSI_VMCR_LPVBPE ((uint32_t)0x00000200) /*!< Low-power Vertical Back-Porch Enable */
  3359. #define DSI_VMCR_LPVFPE ((uint32_t)0x00000400) /*!< Low-power Vertical Front-porch Enable */
  3360. #define DSI_VMCR_LPVAE ((uint32_t)0x00000800) /*!< Low-Power Vertical Active Enable */
  3361. #define DSI_VMCR_LPHBPE ((uint32_t)0x00001000) /*!< Low-Power Horizontal Back-Porch Enable */
  3362. #define DSI_VMCR_LPHFPE ((uint32_t)0x00002000) /*!< Low-Power Horizontal Front-Porch Enable */
  3363. #define DSI_VMCR_FBTAAE ((uint32_t)0x00004000) /*!< Frame Bus-Turn-Around Acknowledge Enable */
  3364. #define DSI_VMCR_LPCE ((uint32_t)0x00008000) /*!< Low-Power Command Enable */
  3365. #define DSI_VMCR_PGE ((uint32_t)0x00010000) /*!< Pattern Generator Enable */
  3366. #define DSI_VMCR_PGM ((uint32_t)0x00100000) /*!< Pattern Generator Mode */
  3367. #define DSI_VMCR_PGO ((uint32_t)0x01000000) /*!< Pattern Generator Orientation */
  3368. /******************* Bit definition for DSI_VPCR register ***************/
  3369. #define DSI_VPCR_VPSIZE ((uint32_t)0x00003FFF) /*!< Video Packet Size */
  3370. #define DSI_VPCR_VPSIZE0 ((uint32_t)0x00000001)
  3371. #define DSI_VPCR_VPSIZE1 ((uint32_t)0x00000002)
  3372. #define DSI_VPCR_VPSIZE2 ((uint32_t)0x00000004)
  3373. #define DSI_VPCR_VPSIZE3 ((uint32_t)0x00000008)
  3374. #define DSI_VPCR_VPSIZE4 ((uint32_t)0x00000010)
  3375. #define DSI_VPCR_VPSIZE5 ((uint32_t)0x00000020)
  3376. #define DSI_VPCR_VPSIZE6 ((uint32_t)0x00000040)
  3377. #define DSI_VPCR_VPSIZE7 ((uint32_t)0x00000080)
  3378. #define DSI_VPCR_VPSIZE8 ((uint32_t)0x00000100)
  3379. #define DSI_VPCR_VPSIZE9 ((uint32_t)0x00000200)
  3380. #define DSI_VPCR_VPSIZE10 ((uint32_t)0x00000400)
  3381. #define DSI_VPCR_VPSIZE11 ((uint32_t)0x00000800)
  3382. #define DSI_VPCR_VPSIZE12 ((uint32_t)0x00001000)
  3383. #define DSI_VPCR_VPSIZE13 ((uint32_t)0x00002000)
  3384. /******************* Bit definition for DSI_VCCR register ***************/
  3385. #define DSI_VCCR_NUMC ((uint32_t)0x00001FFF) /*!< Number of Chunks */
  3386. #define DSI_VCCR_NUMC0 ((uint32_t)0x00000001)
  3387. #define DSI_VCCR_NUMC1 ((uint32_t)0x00000002)
  3388. #define DSI_VCCR_NUMC2 ((uint32_t)0x00000004)
  3389. #define DSI_VCCR_NUMC3 ((uint32_t)0x00000008)
  3390. #define DSI_VCCR_NUMC4 ((uint32_t)0x00000010)
  3391. #define DSI_VCCR_NUMC5 ((uint32_t)0x00000020)
  3392. #define DSI_VCCR_NUMC6 ((uint32_t)0x00000040)
  3393. #define DSI_VCCR_NUMC7 ((uint32_t)0x00000080)
  3394. #define DSI_VCCR_NUMC8 ((uint32_t)0x00000100)
  3395. #define DSI_VCCR_NUMC9 ((uint32_t)0x00000200)
  3396. #define DSI_VCCR_NUMC10 ((uint32_t)0x00000400)
  3397. #define DSI_VCCR_NUMC11 ((uint32_t)0x00000800)
  3398. #define DSI_VCCR_NUMC12 ((uint32_t)0x00001000)
  3399. /******************* Bit definition for DSI_VNPCR register **************/
  3400. #define DSI_VNPCR_NPSIZE ((uint32_t)0x00001FFF) /*!< Null Packet Size */
  3401. #define DSI_VNPCR_NPSIZE0 ((uint32_t)0x00000001)
  3402. #define DSI_VNPCR_NPSIZE1 ((uint32_t)0x00000002)
  3403. #define DSI_VNPCR_NPSIZE2 ((uint32_t)0x00000004)
  3404. #define DSI_VNPCR_NPSIZE3 ((uint32_t)0x00000008)
  3405. #define DSI_VNPCR_NPSIZE4 ((uint32_t)0x00000010)
  3406. #define DSI_VNPCR_NPSIZE5 ((uint32_t)0x00000020)
  3407. #define DSI_VNPCR_NPSIZE6 ((uint32_t)0x00000040)
  3408. #define DSI_VNPCR_NPSIZE7 ((uint32_t)0x00000080)
  3409. #define DSI_VNPCR_NPSIZE8 ((uint32_t)0x00000100)
  3410. #define DSI_VNPCR_NPSIZE9 ((uint32_t)0x00000200)
  3411. #define DSI_VNPCR_NPSIZE10 ((uint32_t)0x00000400)
  3412. #define DSI_VNPCR_NPSIZE11 ((uint32_t)0x00000800)
  3413. #define DSI_VNPCR_NPSIZE12 ((uint32_t)0x00001000)
  3414. /******************* Bit definition for DSI_VHSACR register *************/
  3415. #define DSI_VHSACR_HSA ((uint32_t)0x00000FFF) /*!< Horizontal Synchronism Active duration */
  3416. #define DSI_VHSACR_HSA0 ((uint32_t)0x00000001)
  3417. #define DSI_VHSACR_HSA1 ((uint32_t)0x00000002)
  3418. #define DSI_VHSACR_HSA2 ((uint32_t)0x00000004)
  3419. #define DSI_VHSACR_HSA3 ((uint32_t)0x00000008)
  3420. #define DSI_VHSACR_HSA4 ((uint32_t)0x00000010)
  3421. #define DSI_VHSACR_HSA5 ((uint32_t)0x00000020)
  3422. #define DSI_VHSACR_HSA6 ((uint32_t)0x00000040)
  3423. #define DSI_VHSACR_HSA7 ((uint32_t)0x00000080)
  3424. #define DSI_VHSACR_HSA8 ((uint32_t)0x00000100)
  3425. #define DSI_VHSACR_HSA9 ((uint32_t)0x00000200)
  3426. #define DSI_VHSACR_HSA10 ((uint32_t)0x00000400)
  3427. #define DSI_VHSACR_HSA11 ((uint32_t)0x00000800)
  3428. /******************* Bit definition for DSI_VHBPCR register *************/
  3429. #define DSI_VHBPCR_HBP ((uint32_t)0x00000FFF) /*!< Horizontal Back-Porch duration */
  3430. #define DSI_VHBPCR_HBP0 ((uint32_t)0x00000001)
  3431. #define DSI_VHBPCR_HBP1 ((uint32_t)0x00000002)
  3432. #define DSI_VHBPCR_HBP2 ((uint32_t)0x00000004)
  3433. #define DSI_VHBPCR_HBP3 ((uint32_t)0x00000008)
  3434. #define DSI_VHBPCR_HBP4 ((uint32_t)0x00000010)
  3435. #define DSI_VHBPCR_HBP5 ((uint32_t)0x00000020)
  3436. #define DSI_VHBPCR_HBP6 ((uint32_t)0x00000040)
  3437. #define DSI_VHBPCR_HBP7 ((uint32_t)0x00000080)
  3438. #define DSI_VHBPCR_HBP8 ((uint32_t)0x00000100)
  3439. #define DSI_VHBPCR_HBP9 ((uint32_t)0x00000200)
  3440. #define DSI_VHBPCR_HBP10 ((uint32_t)0x00000400)
  3441. #define DSI_VHBPCR_HBP11 ((uint32_t)0x00000800)
  3442. /******************* Bit definition for DSI_VLCR register ***************/
  3443. #define DSI_VLCR_HLINE ((uint32_t)0x00007FFF) /*!< Horizontal Line duration */
  3444. #define DSI_VLCR_HLINE0 ((uint32_t)0x00000001)
  3445. #define DSI_VLCR_HLINE1 ((uint32_t)0x00000002)
  3446. #define DSI_VLCR_HLINE2 ((uint32_t)0x00000004)
  3447. #define DSI_VLCR_HLINE3 ((uint32_t)0x00000008)
  3448. #define DSI_VLCR_HLINE4 ((uint32_t)0x00000010)
  3449. #define DSI_VLCR_HLINE5 ((uint32_t)0x00000020)
  3450. #define DSI_VLCR_HLINE6 ((uint32_t)0x00000040)
  3451. #define DSI_VLCR_HLINE7 ((uint32_t)0x00000080)
  3452. #define DSI_VLCR_HLINE8 ((uint32_t)0x00000100)
  3453. #define DSI_VLCR_HLINE9 ((uint32_t)0x00000200)
  3454. #define DSI_VLCR_HLINE10 ((uint32_t)0x00000400)
  3455. #define DSI_VLCR_HLINE11 ((uint32_t)0x00000800)
  3456. #define DSI_VLCR_HLINE12 ((uint32_t)0x00001000)
  3457. #define DSI_VLCR_HLINE13 ((uint32_t)0x00002000)
  3458. #define DSI_VLCR_HLINE14 ((uint32_t)0x00004000)
  3459. /******************* Bit definition for DSI_VVSACR register *************/
  3460. #define DSI_VVSACR_VSA ((uint32_t)0x000003FF) /*!< Vertical Synchronism Active duration */
  3461. #define DSI_VVSACR_VSA0 ((uint32_t)0x00000001)
  3462. #define DSI_VVSACR_VSA1 ((uint32_t)0x00000002)
  3463. #define DSI_VVSACR_VSA2 ((uint32_t)0x00000004)
  3464. #define DSI_VVSACR_VSA3 ((uint32_t)0x00000008)
  3465. #define DSI_VVSACR_VSA4 ((uint32_t)0x00000010)
  3466. #define DSI_VVSACR_VSA5 ((uint32_t)0x00000020)
  3467. #define DSI_VVSACR_VSA6 ((uint32_t)0x00000040)
  3468. #define DSI_VVSACR_VSA7 ((uint32_t)0x00000080)
  3469. #define DSI_VVSACR_VSA8 ((uint32_t)0x00000100)
  3470. #define DSI_VVSACR_VSA9 ((uint32_t)0x00000200)
  3471. /******************* Bit definition for DSI_VVBPCR register *************/
  3472. #define DSI_VVBPCR_VBP ((uint32_t)0x000003FF) /*!< Vertical Back-Porch duration */
  3473. #define DSI_VVBPCR_VBP0 ((uint32_t)0x00000001)
  3474. #define DSI_VVBPCR_VBP1 ((uint32_t)0x00000002)
  3475. #define DSI_VVBPCR_VBP2 ((uint32_t)0x00000004)
  3476. #define DSI_VVBPCR_VBP3 ((uint32_t)0x00000008)
  3477. #define DSI_VVBPCR_VBP4 ((uint32_t)0x00000010)
  3478. #define DSI_VVBPCR_VBP5 ((uint32_t)0x00000020)
  3479. #define DSI_VVBPCR_VBP6 ((uint32_t)0x00000040)
  3480. #define DSI_VVBPCR_VBP7 ((uint32_t)0x00000080)
  3481. #define DSI_VVBPCR_VBP8 ((uint32_t)0x00000100)
  3482. #define DSI_VVBPCR_VBP9 ((uint32_t)0x00000200)
  3483. /******************* Bit definition for DSI_VVFPCR register *************/
  3484. #define DSI_VVFPCR_VFP ((uint32_t)0x000003FF) /*!< Vertical Front-Porch duration */
  3485. #define DSI_VVFPCR_VFP0 ((uint32_t)0x00000001)
  3486. #define DSI_VVFPCR_VFP1 ((uint32_t)0x00000002)
  3487. #define DSI_VVFPCR_VFP2 ((uint32_t)0x00000004)
  3488. #define DSI_VVFPCR_VFP3 ((uint32_t)0x00000008)
  3489. #define DSI_VVFPCR_VFP4 ((uint32_t)0x00000010)
  3490. #define DSI_VVFPCR_VFP5 ((uint32_t)0x00000020)
  3491. #define DSI_VVFPCR_VFP6 ((uint32_t)0x00000040)
  3492. #define DSI_VVFPCR_VFP7 ((uint32_t)0x00000080)
  3493. #define DSI_VVFPCR_VFP8 ((uint32_t)0x00000100)
  3494. #define DSI_VVFPCR_VFP9 ((uint32_t)0x00000200)
  3495. /******************* Bit definition for DSI_VVACR register **************/
  3496. #define DSI_VVACR_VA ((uint32_t)0x00003FFF) /*!< Vertical Active duration */
  3497. #define DSI_VVACR_VA0 ((uint32_t)0x00000001)
  3498. #define DSI_VVACR_VA1 ((uint32_t)0x00000002)
  3499. #define DSI_VVACR_VA2 ((uint32_t)0x00000004)
  3500. #define DSI_VVACR_VA3 ((uint32_t)0x00000008)
  3501. #define DSI_VVACR_VA4 ((uint32_t)0x00000010)
  3502. #define DSI_VVACR_VA5 ((uint32_t)0x00000020)
  3503. #define DSI_VVACR_VA6 ((uint32_t)0x00000040)
  3504. #define DSI_VVACR_VA7 ((uint32_t)0x00000080)
  3505. #define DSI_VVACR_VA8 ((uint32_t)0x00000100)
  3506. #define DSI_VVACR_VA9 ((uint32_t)0x00000200)
  3507. #define DSI_VVACR_VA10 ((uint32_t)0x00000400)
  3508. #define DSI_VVACR_VA11 ((uint32_t)0x00000800)
  3509. #define DSI_VVACR_VA12 ((uint32_t)0x00001000)
  3510. #define DSI_VVACR_VA13 ((uint32_t)0x00002000)
  3511. /******************* Bit definition for DSI_LCCR register ***************/
  3512. #define DSI_LCCR_CMDSIZE ((uint32_t)0x0000FFFF) /*!< Command Size */
  3513. #define DSI_LCCR_CMDSIZE0 ((uint32_t)0x00000001)
  3514. #define DSI_LCCR_CMDSIZE1 ((uint32_t)0x00000002)
  3515. #define DSI_LCCR_CMDSIZE2 ((uint32_t)0x00000004)
  3516. #define DSI_LCCR_CMDSIZE3 ((uint32_t)0x00000008)
  3517. #define DSI_LCCR_CMDSIZE4 ((uint32_t)0x00000010)
  3518. #define DSI_LCCR_CMDSIZE5 ((uint32_t)0x00000020)
  3519. #define DSI_LCCR_CMDSIZE6 ((uint32_t)0x00000040)
  3520. #define DSI_LCCR_CMDSIZE7 ((uint32_t)0x00000080)
  3521. #define DSI_LCCR_CMDSIZE8 ((uint32_t)0x00000100)
  3522. #define DSI_LCCR_CMDSIZE9 ((uint32_t)0x00000200)
  3523. #define DSI_LCCR_CMDSIZE10 ((uint32_t)0x00000400)
  3524. #define DSI_LCCR_CMDSIZE11 ((uint32_t)0x00000800)
  3525. #define DSI_LCCR_CMDSIZE12 ((uint32_t)0x00001000)
  3526. #define DSI_LCCR_CMDSIZE13 ((uint32_t)0x00002000)
  3527. #define DSI_LCCR_CMDSIZE14 ((uint32_t)0x00004000)
  3528. #define DSI_LCCR_CMDSIZE15 ((uint32_t)0x00008000)
  3529. /******************* Bit definition for DSI_CMCR register ***************/
  3530. #define DSI_CMCR_TEARE ((uint32_t)0x00000001) /*!< Tearing Effect Acknowledge Request Enable */
  3531. #define DSI_CMCR_ARE ((uint32_t)0x00000002) /*!< Acknowledge Request Enable */
  3532. #define DSI_CMCR_GSW0TX ((uint32_t)0x00000100) /*!< Generic Short Write Zero parameters Transmission */
  3533. #define DSI_CMCR_GSW1TX ((uint32_t)0x00000200) /*!< Generic Short Write One parameters Transmission */
  3534. #define DSI_CMCR_GSW2TX ((uint32_t)0x00000400) /*!< Generic Short Write Two parameters Transmission */
  3535. #define DSI_CMCR_GSR0TX ((uint32_t)0x00000800) /*!< Generic Short Read Zero parameters Transmission */
  3536. #define DSI_CMCR_GSR1TX ((uint32_t)0x00001000) /*!< Generic Short Read One parameters Transmission */
  3537. #define DSI_CMCR_GSR2TX ((uint32_t)0x00002000) /*!< Generic Short Read Two parameters Transmission */
  3538. #define DSI_CMCR_GLWTX ((uint32_t)0x00004000) /*!< Generic Long Write Transmission */
  3539. #define DSI_CMCR_DSW0TX ((uint32_t)0x00010000) /*!< DCS Short Write Zero parameter Transmission */
  3540. #define DSI_CMCR_DSW1TX ((uint32_t)0x00020000) /*!< DCS Short Read One parameter Transmission */
  3541. #define DSI_CMCR_DSR0TX ((uint32_t)0x00040000) /*!< DCS Short Read Zero parameter Transmission */
  3542. #define DSI_CMCR_DLWTX ((uint32_t)0x00080000) /*!< DCS Long Write Transmission */
  3543. #define DSI_CMCR_MRDPS ((uint32_t)0x01000000) /*!< Maximum Read Packet Size */
  3544. /******************* Bit definition for DSI_GHCR register ***************/
  3545. #define DSI_GHCR_DT ((uint32_t)0x0000003F) /*!< Type */
  3546. #define DSI_GHCR_DT0 ((uint32_t)0x00000001)
  3547. #define DSI_GHCR_DT1 ((uint32_t)0x00000002)
  3548. #define DSI_GHCR_DT2 ((uint32_t)0x00000004)
  3549. #define DSI_GHCR_DT3 ((uint32_t)0x00000008)
  3550. #define DSI_GHCR_DT4 ((uint32_t)0x00000010)
  3551. #define DSI_GHCR_DT5 ((uint32_t)0x00000020)
  3552. #define DSI_GHCR_VCID ((uint32_t)0x000000C0) /*!< Channel */
  3553. #define DSI_GHCR_VCID0 ((uint32_t)0x00000040)
  3554. #define DSI_GHCR_VCID1 ((uint32_t)0x00000080)
  3555. #define DSI_GHCR_WCLSB ((uint32_t)0x0000FF00) /*!< WordCount LSB */
  3556. #define DSI_GHCR_WCLSB0 ((uint32_t)0x00000100)
  3557. #define DSI_GHCR_WCLSB1 ((uint32_t)0x00000200)
  3558. #define DSI_GHCR_WCLSB2 ((uint32_t)0x00000400)
  3559. #define DSI_GHCR_WCLSB3 ((uint32_t)0x00000800)
  3560. #define DSI_GHCR_WCLSB4 ((uint32_t)0x00001000)
  3561. #define DSI_GHCR_WCLSB5 ((uint32_t)0x00002000)
  3562. #define DSI_GHCR_WCLSB6 ((uint32_t)0x00004000)
  3563. #define DSI_GHCR_WCLSB7 ((uint32_t)0x00008000)
  3564. #define DSI_GHCR_WCMSB ((uint32_t)0x00FF0000) /*!< WordCount MSB */
  3565. #define DSI_GHCR_WCMSB0 ((uint32_t)0x00010000)
  3566. #define DSI_GHCR_WCMSB1 ((uint32_t)0x00020000)
  3567. #define DSI_GHCR_WCMSB2 ((uint32_t)0x00040000)
  3568. #define DSI_GHCR_WCMSB3 ((uint32_t)0x00080000)
  3569. #define DSI_GHCR_WCMSB4 ((uint32_t)0x00100000)
  3570. #define DSI_GHCR_WCMSB5 ((uint32_t)0x00200000)
  3571. #define DSI_GHCR_WCMSB6 ((uint32_t)0x00400000)
  3572. #define DSI_GHCR_WCMSB7 ((uint32_t)0x00800000)
  3573. /******************* Bit definition for DSI_GPDR register ***************/
  3574. #define DSI_GPDR_DATA1 ((uint32_t)0x000000FF) /*!< Payload Byte 1 */
  3575. #define DSI_GPDR_DATA1_0 ((uint32_t)0x00000001)
  3576. #define DSI_GPDR_DATA1_1 ((uint32_t)0x00000002)
  3577. #define DSI_GPDR_DATA1_2 ((uint32_t)0x00000004)
  3578. #define DSI_GPDR_DATA1_3 ((uint32_t)0x00000008)
  3579. #define DSI_GPDR_DATA1_4 ((uint32_t)0x00000010)
  3580. #define DSI_GPDR_DATA1_5 ((uint32_t)0x00000020)
  3581. #define DSI_GPDR_DATA1_6 ((uint32_t)0x00000040)
  3582. #define DSI_GPDR_DATA1_7 ((uint32_t)0x00000080)
  3583. #define DSI_GPDR_DATA2 ((uint32_t)0x0000FF00) /*!< Payload Byte 2 */
  3584. #define DSI_GPDR_DATA2_0 ((uint32_t)0x00000100)
  3585. #define DSI_GPDR_DATA2_1 ((uint32_t)0x00000200)
  3586. #define DSI_GPDR_DATA2_2 ((uint32_t)0x00000400)
  3587. #define DSI_GPDR_DATA2_3 ((uint32_t)0x00000800)
  3588. #define DSI_GPDR_DATA2_4 ((uint32_t)0x00001000)
  3589. #define DSI_GPDR_DATA2_5 ((uint32_t)0x00002000)
  3590. #define DSI_GPDR_DATA2_6 ((uint32_t)0x00004000)
  3591. #define DSI_GPDR_DATA2_7 ((uint32_t)0x00008000)
  3592. #define DSI_GPDR_DATA3 ((uint32_t)0x00FF0000) /*!< Payload Byte 3 */
  3593. #define DSI_GPDR_DATA3_0 ((uint32_t)0x00010000)
  3594. #define DSI_GPDR_DATA3_1 ((uint32_t)0x00020000)
  3595. #define DSI_GPDR_DATA3_2 ((uint32_t)0x00040000)
  3596. #define DSI_GPDR_DATA3_3 ((uint32_t)0x00080000)
  3597. #define DSI_GPDR_DATA3_4 ((uint32_t)0x00100000)
  3598. #define DSI_GPDR_DATA3_5 ((uint32_t)0x00200000)
  3599. #define DSI_GPDR_DATA3_6 ((uint32_t)0x00400000)
  3600. #define DSI_GPDR_DATA3_7 ((uint32_t)0x00800000)
  3601. #define DSI_GPDR_DATA4 ((uint32_t)0xFF000000) /*!< Payload Byte 4 */
  3602. #define DSI_GPDR_DATA4_0 ((uint32_t)0x01000000)
  3603. #define DSI_GPDR_DATA4_1 ((uint32_t)0x02000000)
  3604. #define DSI_GPDR_DATA4_2 ((uint32_t)0x04000000)
  3605. #define DSI_GPDR_DATA4_3 ((uint32_t)0x08000000)
  3606. #define DSI_GPDR_DATA4_4 ((uint32_t)0x10000000)
  3607. #define DSI_GPDR_DATA4_5 ((uint32_t)0x20000000)
  3608. #define DSI_GPDR_DATA4_6 ((uint32_t)0x40000000)
  3609. #define DSI_GPDR_DATA4_7 ((uint32_t)0x80000000)
  3610. /******************* Bit definition for DSI_GPSR register ***************/
  3611. #define DSI_GPSR_CMDFE ((uint32_t)0x00000001) /*!< Command FIFO Empty */
  3612. #define DSI_GPSR_CMDFF ((uint32_t)0x00000002) /*!< Command FIFO Full */
  3613. #define DSI_GPSR_PWRFE ((uint32_t)0x00000004) /*!< Payload Write FIFO Empty */
  3614. #define DSI_GPSR_PWRFF ((uint32_t)0x00000008) /*!< Payload Write FIFO Full */
  3615. #define DSI_GPSR_PRDFE ((uint32_t)0x00000010) /*!< Payload Read FIFO Empty */
  3616. #define DSI_GPSR_PRDFF ((uint32_t)0x00000020) /*!< Payload Read FIFO Full */
  3617. #define DSI_GPSR_RCB ((uint32_t)0x00000040) /*!< Read Command Busy */
  3618. /******************* Bit definition for DSI_TCCR0 register **************/
  3619. #define DSI_TCCR0_LPRX_TOCNT ((uint32_t)0x0000FFFF) /*!< Low-power Reception Timeout Counter */
  3620. #define DSI_TCCR0_LPRX_TOCNT0 ((uint32_t)0x00000001)
  3621. #define DSI_TCCR0_LPRX_TOCNT1 ((uint32_t)0x00000002)
  3622. #define DSI_TCCR0_LPRX_TOCNT2 ((uint32_t)0x00000004)
  3623. #define DSI_TCCR0_LPRX_TOCNT3 ((uint32_t)0x00000008)
  3624. #define DSI_TCCR0_LPRX_TOCNT4 ((uint32_t)0x00000010)
  3625. #define DSI_TCCR0_LPRX_TOCNT5 ((uint32_t)0x00000020)
  3626. #define DSI_TCCR0_LPRX_TOCNT6 ((uint32_t)0x00000040)
  3627. #define DSI_TCCR0_LPRX_TOCNT7 ((uint32_t)0x00000080)
  3628. #define DSI_TCCR0_LPRX_TOCNT8 ((uint32_t)0x00000100)
  3629. #define DSI_TCCR0_LPRX_TOCNT9 ((uint32_t)0x00000200)
  3630. #define DSI_TCCR0_LPRX_TOCNT10 ((uint32_t)0x00000400)
  3631. #define DSI_TCCR0_LPRX_TOCNT11 ((uint32_t)0x00000800)
  3632. #define DSI_TCCR0_LPRX_TOCNT12 ((uint32_t)0x00001000)
  3633. #define DSI_TCCR0_LPRX_TOCNT13 ((uint32_t)0x00002000)
  3634. #define DSI_TCCR0_LPRX_TOCNT14 ((uint32_t)0x00004000)
  3635. #define DSI_TCCR0_LPRX_TOCNT15 ((uint32_t)0x00008000)
  3636. #define DSI_TCCR0_HSTX_TOCNT ((uint32_t)0xFFFF0000) /*!< High-Speed Transmission Timeout Counter */
  3637. #define DSI_TCCR0_HSTX_TOCNT0 ((uint32_t)0x00010000)
  3638. #define DSI_TCCR0_HSTX_TOCNT1 ((uint32_t)0x00020000)
  3639. #define DSI_TCCR0_HSTX_TOCNT2 ((uint32_t)0x00040000)
  3640. #define DSI_TCCR0_HSTX_TOCNT3 ((uint32_t)0x00080000)
  3641. #define DSI_TCCR0_HSTX_TOCNT4 ((uint32_t)0x00100000)
  3642. #define DSI_TCCR0_HSTX_TOCNT5 ((uint32_t)0x00200000)
  3643. #define DSI_TCCR0_HSTX_TOCNT6 ((uint32_t)0x00400000)
  3644. #define DSI_TCCR0_HSTX_TOCNT7 ((uint32_t)0x00800000)
  3645. #define DSI_TCCR0_HSTX_TOCNT8 ((uint32_t)0x01000000)
  3646. #define DSI_TCCR0_HSTX_TOCNT9 ((uint32_t)0x02000000)
  3647. #define DSI_TCCR0_HSTX_TOCNT10 ((uint32_t)0x04000000)
  3648. #define DSI_TCCR0_HSTX_TOCNT11 ((uint32_t)0x08000000)
  3649. #define DSI_TCCR0_HSTX_TOCNT12 ((uint32_t)0x10000000)
  3650. #define DSI_TCCR0_HSTX_TOCNT13 ((uint32_t)0x20000000)
  3651. #define DSI_TCCR0_HSTX_TOCNT14 ((uint32_t)0x40000000)
  3652. #define DSI_TCCR0_HSTX_TOCNT15 ((uint32_t)0x80000000)
  3653. /******************* Bit definition for DSI_TCCR1 register **************/
  3654. #define DSI_TCCR1_HSRD_TOCNT ((uint32_t)0x0000FFFF) /*!< High-Speed Read Timeout Counter */
  3655. #define DSI_TCCR1_HSRD_TOCNT0 ((uint32_t)0x00000001)
  3656. #define DSI_TCCR1_HSRD_TOCNT1 ((uint32_t)0x00000002)
  3657. #define DSI_TCCR1_HSRD_TOCNT2 ((uint32_t)0x00000004)
  3658. #define DSI_TCCR1_HSRD_TOCNT3 ((uint32_t)0x00000008)
  3659. #define DSI_TCCR1_HSRD_TOCNT4 ((uint32_t)0x00000010)
  3660. #define DSI_TCCR1_HSRD_TOCNT5 ((uint32_t)0x00000020)
  3661. #define DSI_TCCR1_HSRD_TOCNT6 ((uint32_t)0x00000040)
  3662. #define DSI_TCCR1_HSRD_TOCNT7 ((uint32_t)0x00000080)
  3663. #define DSI_TCCR1_HSRD_TOCNT8 ((uint32_t)0x00000100)
  3664. #define DSI_TCCR1_HSRD_TOCNT9 ((uint32_t)0x00000200)
  3665. #define DSI_TCCR1_HSRD_TOCNT10 ((uint32_t)0x00000400)
  3666. #define DSI_TCCR1_HSRD_TOCNT11 ((uint32_t)0x00000800)
  3667. #define DSI_TCCR1_HSRD_TOCNT12 ((uint32_t)0x00001000)
  3668. #define DSI_TCCR1_HSRD_TOCNT13 ((uint32_t)0x00002000)
  3669. #define DSI_TCCR1_HSRD_TOCNT14 ((uint32_t)0x00004000)
  3670. #define DSI_TCCR1_HSRD_TOCNT15 ((uint32_t)0x00008000)
  3671. /******************* Bit definition for DSI_TCCR2 register **************/
  3672. #define DSI_TCCR2_LPRD_TOCNT ((uint32_t)0x0000FFFF) /*!< Low-Power Read Timeout Counter */
  3673. #define DSI_TCCR2_LPRD_TOCNT0 ((uint32_t)0x00000001)
  3674. #define DSI_TCCR2_LPRD_TOCNT1 ((uint32_t)0x00000002)
  3675. #define DSI_TCCR2_LPRD_TOCNT2 ((uint32_t)0x00000004)
  3676. #define DSI_TCCR2_LPRD_TOCNT3 ((uint32_t)0x00000008)
  3677. #define DSI_TCCR2_LPRD_TOCNT4 ((uint32_t)0x00000010)
  3678. #define DSI_TCCR2_LPRD_TOCNT5 ((uint32_t)0x00000020)
  3679. #define DSI_TCCR2_LPRD_TOCNT6 ((uint32_t)0x00000040)
  3680. #define DSI_TCCR2_LPRD_TOCNT7 ((uint32_t)0x00000080)
  3681. #define DSI_TCCR2_LPRD_TOCNT8 ((uint32_t)0x00000100)
  3682. #define DSI_TCCR2_LPRD_TOCNT9 ((uint32_t)0x00000200)
  3683. #define DSI_TCCR2_LPRD_TOCNT10 ((uint32_t)0x00000400)
  3684. #define DSI_TCCR2_LPRD_TOCNT11 ((uint32_t)0x00000800)
  3685. #define DSI_TCCR2_LPRD_TOCNT12 ((uint32_t)0x00001000)
  3686. #define DSI_TCCR2_LPRD_TOCNT13 ((uint32_t)0x00002000)
  3687. #define DSI_TCCR2_LPRD_TOCNT14 ((uint32_t)0x00004000)
  3688. #define DSI_TCCR2_LPRD_TOCNT15 ((uint32_t)0x00008000)
  3689. /******************* Bit definition for DSI_TCCR3 register **************/
  3690. #define DSI_TCCR3_HSWR_TOCNT ((uint32_t)0x0000FFFF) /*!< High-Speed Write Timeout Counter */
  3691. #define DSI_TCCR3_HSWR_TOCNT0 ((uint32_t)0x00000001)
  3692. #define DSI_TCCR3_HSWR_TOCNT1 ((uint32_t)0x00000002)
  3693. #define DSI_TCCR3_HSWR_TOCNT2 ((uint32_t)0x00000004)
  3694. #define DSI_TCCR3_HSWR_TOCNT3 ((uint32_t)0x00000008)
  3695. #define DSI_TCCR3_HSWR_TOCNT4 ((uint32_t)0x00000010)
  3696. #define DSI_TCCR3_HSWR_TOCNT5 ((uint32_t)0x00000020)
  3697. #define DSI_TCCR3_HSWR_TOCNT6 ((uint32_t)0x00000040)
  3698. #define DSI_TCCR3_HSWR_TOCNT7 ((uint32_t)0x00000080)
  3699. #define DSI_TCCR3_HSWR_TOCNT8 ((uint32_t)0x00000100)
  3700. #define DSI_TCCR3_HSWR_TOCNT9 ((uint32_t)0x00000200)
  3701. #define DSI_TCCR3_HSWR_TOCNT10 ((uint32_t)0x00000400)
  3702. #define DSI_TCCR3_HSWR_TOCNT11 ((uint32_t)0x00000800)
  3703. #define DSI_TCCR3_HSWR_TOCNT12 ((uint32_t)0x00001000)
  3704. #define DSI_TCCR3_HSWR_TOCNT13 ((uint32_t)0x00002000)
  3705. #define DSI_TCCR3_HSWR_TOCNT14 ((uint32_t)0x00004000)
  3706. #define DSI_TCCR3_HSWR_TOCNT15 ((uint32_t)0x00008000)
  3707. #define DSI_TCCR3_PM ((uint32_t)0x01000000) /*!< Presp Mode */
  3708. /******************* Bit definition for DSI_TCCR4 register **************/
  3709. #define DSI_TCCR4_LPWR_TOCNT ((uint32_t)0x0000FFFF) /*!< Low-Power Write Timeout Counter */
  3710. #define DSI_TCCR4_LPWR_TOCNT0 ((uint32_t)0x00000001)
  3711. #define DSI_TCCR4_LPWR_TOCNT1 ((uint32_t)0x00000002)
  3712. #define DSI_TCCR4_LPWR_TOCNT2 ((uint32_t)0x00000004)
  3713. #define DSI_TCCR4_LPWR_TOCNT3 ((uint32_t)0x00000008)
  3714. #define DSI_TCCR4_LPWR_TOCNT4 ((uint32_t)0x00000010)
  3715. #define DSI_TCCR4_LPWR_TOCNT5 ((uint32_t)0x00000020)
  3716. #define DSI_TCCR4_LPWR_TOCNT6 ((uint32_t)0x00000040)
  3717. #define DSI_TCCR4_LPWR_TOCNT7 ((uint32_t)0x00000080)
  3718. #define DSI_TCCR4_LPWR_TOCNT8 ((uint32_t)0x00000100)
  3719. #define DSI_TCCR4_LPWR_TOCNT9 ((uint32_t)0x00000200)
  3720. #define DSI_TCCR4_LPWR_TOCNT10 ((uint32_t)0x00000400)
  3721. #define DSI_TCCR4_LPWR_TOCNT11 ((uint32_t)0x00000800)
  3722. #define DSI_TCCR4_LPWR_TOCNT12 ((uint32_t)0x00001000)
  3723. #define DSI_TCCR4_LPWR_TOCNT13 ((uint32_t)0x00002000)
  3724. #define DSI_TCCR4_LPWR_TOCNT14 ((uint32_t)0x00004000)
  3725. #define DSI_TCCR4_LPWR_TOCNT15 ((uint32_t)0x00008000)
  3726. /******************* Bit definition for DSI_TCCR5 register **************/
  3727. #define DSI_TCCR5_BTA_TOCNT ((uint32_t)0x0000FFFF) /*!< Bus-Turn-Around Timeout Counter */
  3728. #define DSI_TCCR5_BTA_TOCNT0 ((uint32_t)0x00000001)
  3729. #define DSI_TCCR5_BTA_TOCNT1 ((uint32_t)0x00000002)
  3730. #define DSI_TCCR5_BTA_TOCNT2 ((uint32_t)0x00000004)
  3731. #define DSI_TCCR5_BTA_TOCNT3 ((uint32_t)0x00000008)
  3732. #define DSI_TCCR5_BTA_TOCNT4 ((uint32_t)0x00000010)
  3733. #define DSI_TCCR5_BTA_TOCNT5 ((uint32_t)0x00000020)
  3734. #define DSI_TCCR5_BTA_TOCNT6 ((uint32_t)0x00000040)
  3735. #define DSI_TCCR5_BTA_TOCNT7 ((uint32_t)0x00000080)
  3736. #define DSI_TCCR5_BTA_TOCNT8 ((uint32_t)0x00000100)
  3737. #define DSI_TCCR5_BTA_TOCNT9 ((uint32_t)0x00000200)
  3738. #define DSI_TCCR5_BTA_TOCNT10 ((uint32_t)0x00000400)
  3739. #define DSI_TCCR5_BTA_TOCNT11 ((uint32_t)0x00000800)
  3740. #define DSI_TCCR5_BTA_TOCNT12 ((uint32_t)0x00001000)
  3741. #define DSI_TCCR5_BTA_TOCNT13 ((uint32_t)0x00002000)
  3742. #define DSI_TCCR5_BTA_TOCNT14 ((uint32_t)0x00004000)
  3743. #define DSI_TCCR5_BTA_TOCNT15 ((uint32_t)0x00008000)
  3744. /******************* Bit definition for DSI_TDCR register ***************/
  3745. #define DSI_TDCR_3DM ((uint32_t)0x00000003) /*!< 3D Mode */
  3746. #define DSI_TDCR_3DM0 ((uint32_t)0x00000001)
  3747. #define DSI_TDCR_3DM1 ((uint32_t)0x00000002)
  3748. #define DSI_TDCR_3DF ((uint32_t)0x0000000C) /*!< 3D Format */
  3749. #define DSI_TDCR_3DF0 ((uint32_t)0x00000004)
  3750. #define DSI_TDCR_3DF1 ((uint32_t)0x00000008)
  3751. #define DSI_TDCR_SVS ((uint32_t)0x00000010) /*!< Second VSYNC */
  3752. #define DSI_TDCR_RF ((uint32_t)0x00000020) /*!< Right First */
  3753. #define DSI_TDCR_S3DC ((uint32_t)0x00010000) /*!< Send 3D Control */
  3754. /******************* Bit definition for DSI_CLCR register ***************/
  3755. #define DSI_CLCR_DPCC ((uint32_t)0x00000001) /*!< D-PHY Clock Control */
  3756. #define DSI_CLCR_ACR ((uint32_t)0x00000002) /*!< Automatic Clocklane Control */
  3757. /******************* Bit definition for DSI_CLTCR register **************/
  3758. #define DSI_CLTCR_LP2HS_TIME ((uint32_t)0x000003FF) /*!< Low-Power to High-Speed Time */
  3759. #define DSI_CLTCR_LP2HS_TIME0 ((uint32_t)0x00000001)
  3760. #define DSI_CLTCR_LP2HS_TIME1 ((uint32_t)0x00000002)
  3761. #define DSI_CLTCR_LP2HS_TIME2 ((uint32_t)0x00000004)
  3762. #define DSI_CLTCR_LP2HS_TIME3 ((uint32_t)0x00000008)
  3763. #define DSI_CLTCR_LP2HS_TIME4 ((uint32_t)0x00000010)
  3764. #define DSI_CLTCR_LP2HS_TIME5 ((uint32_t)0x00000020)
  3765. #define DSI_CLTCR_LP2HS_TIME6 ((uint32_t)0x00000040)
  3766. #define DSI_CLTCR_LP2HS_TIME7 ((uint32_t)0x00000080)
  3767. #define DSI_CLTCR_LP2HS_TIME8 ((uint32_t)0x00000100)
  3768. #define DSI_CLTCR_LP2HS_TIME9 ((uint32_t)0x00000200)
  3769. #define DSI_CLTCR_HS2LP_TIME ((uint32_t)0x03FF0000) /*!< High-Speed to Low-Power Time */
  3770. #define DSI_CLTCR_HS2LP_TIME0 ((uint32_t)0x00010000)
  3771. #define DSI_CLTCR_HS2LP_TIME1 ((uint32_t)0x00020000)
  3772. #define DSI_CLTCR_HS2LP_TIME2 ((uint32_t)0x00040000)
  3773. #define DSI_CLTCR_HS2LP_TIME3 ((uint32_t)0x00080000)
  3774. #define DSI_CLTCR_HS2LP_TIME4 ((uint32_t)0x00100000)
  3775. #define DSI_CLTCR_HS2LP_TIME5 ((uint32_t)0x00200000)
  3776. #define DSI_CLTCR_HS2LP_TIME6 ((uint32_t)0x00400000)
  3777. #define DSI_CLTCR_HS2LP_TIME7 ((uint32_t)0x00800000)
  3778. #define DSI_CLTCR_HS2LP_TIME8 ((uint32_t)0x01000000)
  3779. #define DSI_CLTCR_HS2LP_TIME9 ((uint32_t)0x02000000)
  3780. /******************* Bit definition for DSI_DLTCR register **************/
  3781. #define DSI_DLTCR_MRD_TIME ((uint32_t)0x00007FFF) /*!< Maximum Read Time */
  3782. #define DSI_DLTCR_MRD_TIME0 ((uint32_t)0x00000001)
  3783. #define DSI_DLTCR_MRD_TIME1 ((uint32_t)0x00000002)
  3784. #define DSI_DLTCR_MRD_TIME2 ((uint32_t)0x00000004)
  3785. #define DSI_DLTCR_MRD_TIME3 ((uint32_t)0x00000008)
  3786. #define DSI_DLTCR_MRD_TIME4 ((uint32_t)0x00000010)
  3787. #define DSI_DLTCR_MRD_TIME5 ((uint32_t)0x00000020)
  3788. #define DSI_DLTCR_MRD_TIME6 ((uint32_t)0x00000040)
  3789. #define DSI_DLTCR_MRD_TIME7 ((uint32_t)0x00000080)
  3790. #define DSI_DLTCR_MRD_TIME8 ((uint32_t)0x00000100)
  3791. #define DSI_DLTCR_MRD_TIME9 ((uint32_t)0x00000200)
  3792. #define DSI_DLTCR_MRD_TIME10 ((uint32_t)0x00000400)
  3793. #define DSI_DLTCR_MRD_TIME11 ((uint32_t)0x00000800)
  3794. #define DSI_DLTCR_MRD_TIME12 ((uint32_t)0x00001000)
  3795. #define DSI_DLTCR_MRD_TIME13 ((uint32_t)0x00002000)
  3796. #define DSI_DLTCR_MRD_TIME14 ((uint32_t)0x00004000)
  3797. #define DSI_DLTCR_LP2HS_TIME ((uint32_t)0x00FF0000) /*!< Low-Power To High-Speed Time */
  3798. #define DSI_DLTCR_LP2HS_TIME0 ((uint32_t)0x00010000)
  3799. #define DSI_DLTCR_LP2HS_TIME1 ((uint32_t)0x00020000)
  3800. #define DSI_DLTCR_LP2HS_TIME2 ((uint32_t)0x00040000)
  3801. #define DSI_DLTCR_LP2HS_TIME3 ((uint32_t)0x00080000)
  3802. #define DSI_DLTCR_LP2HS_TIME4 ((uint32_t)0x00100000)
  3803. #define DSI_DLTCR_LP2HS_TIME5 ((uint32_t)0x00200000)
  3804. #define DSI_DLTCR_LP2HS_TIME6 ((uint32_t)0x00400000)
  3805. #define DSI_DLTCR_LP2HS_TIME7 ((uint32_t)0x00800000)
  3806. #define DSI_DLTCR_HS2LP_TIME ((uint32_t)0xFF000000) /*!< High-Speed To Low-Power Time */
  3807. #define DSI_DLTCR_HS2LP_TIME0 ((uint32_t)0x01000000)
  3808. #define DSI_DLTCR_HS2LP_TIME1 ((uint32_t)0x02000000)
  3809. #define DSI_DLTCR_HS2LP_TIME2 ((uint32_t)0x04000000)
  3810. #define DSI_DLTCR_HS2LP_TIME3 ((uint32_t)0x08000000)
  3811. #define DSI_DLTCR_HS2LP_TIME4 ((uint32_t)0x10000000)
  3812. #define DSI_DLTCR_HS2LP_TIME5 ((uint32_t)0x20000000)
  3813. #define DSI_DLTCR_HS2LP_TIME6 ((uint32_t)0x40000000)
  3814. #define DSI_DLTCR_HS2LP_TIME7 ((uint32_t)0x80000000)
  3815. /******************* Bit definition for DSI_PCTLR register **************/
  3816. #define DSI_PCTLR_DEN ((uint32_t)0x00000002) /*!< Digital Enable */
  3817. #define DSI_PCTLR_CKE ((uint32_t)0x00000004) /*!< Clock Enable */
  3818. /******************* Bit definition for DSI_PCONFR register *************/
  3819. #define DSI_PCONFR_NL ((uint32_t)0x00000003) /*!< Number of Lanes */
  3820. #define DSI_PCONFR_NL0 ((uint32_t)0x00000001)
  3821. #define DSI_PCONFR_NL1 ((uint32_t)0x00000002)
  3822. #define DSI_PCONFR_SW_TIME ((uint32_t)0x0000FF00) /*!< Stop Wait Time */
  3823. #define DSI_PCONFR_SW_TIME0 ((uint32_t)0x00000100)
  3824. #define DSI_PCONFR_SW_TIME1 ((uint32_t)0x00000200)
  3825. #define DSI_PCONFR_SW_TIME2 ((uint32_t)0x00000400)
  3826. #define DSI_PCONFR_SW_TIME3 ((uint32_t)0x00000800)
  3827. #define DSI_PCONFR_SW_TIME4 ((uint32_t)0x00001000)
  3828. #define DSI_PCONFR_SW_TIME5 ((uint32_t)0x00002000)
  3829. #define DSI_PCONFR_SW_TIME6 ((uint32_t)0x00004000)
  3830. #define DSI_PCONFR_SW_TIME7 ((uint32_t)0x00008000)
  3831. /******************* Bit definition for DSI_PUCR register ***************/
  3832. #define DSI_PUCR_URCL ((uint32_t)0x00000001) /*!< ULPS Request on Clock Lane */
  3833. #define DSI_PUCR_UECL ((uint32_t)0x00000002) /*!< ULPS Exit on Clock Lane */
  3834. #define DSI_PUCR_URDL ((uint32_t)0x00000004) /*!< ULPS Request on Data Lane */
  3835. #define DSI_PUCR_UEDL ((uint32_t)0x00000008) /*!< ULPS Exit on Data Lane */
  3836. /******************* Bit definition for DSI_PTTCR register **************/
  3837. #define DSI_PTTCR_TX_TRIG ((uint32_t)0x0000000F) /*!< Transmission Trigger */
  3838. #define DSI_PTTCR_TX_TRIG0 ((uint32_t)0x00000001)
  3839. #define DSI_PTTCR_TX_TRIG1 ((uint32_t)0x00000002)
  3840. #define DSI_PTTCR_TX_TRIG2 ((uint32_t)0x00000004)
  3841. #define DSI_PTTCR_TX_TRIG3 ((uint32_t)0x00000008)
  3842. /******************* Bit definition for DSI_PSR register ****************/
  3843. #define DSI_PSR_PD ((uint32_t)0x00000002) /*!< PHY Direction */
  3844. #define DSI_PSR_PSSC ((uint32_t)0x00000004) /*!< PHY Stop State Clock lane */
  3845. #define DSI_PSR_UANC ((uint32_t)0x00000008) /*!< ULPS Active Not Clock lane */
  3846. #define DSI_PSR_PSS0 ((uint32_t)0x00000010) /*!< PHY Stop State lane 0 */
  3847. #define DSI_PSR_UAN0 ((uint32_t)0x00000020) /*!< ULPS Active Not lane 0 */
  3848. #define DSI_PSR_RUE0 ((uint32_t)0x00000040) /*!< RX ULPS Escape lane 0 */
  3849. #define DSI_PSR_PSS1 ((uint32_t)0x00000080) /*!< PHY Stop State lane 1 */
  3850. #define DSI_PSR_UAN1 ((uint32_t)0x00000100) /*!< ULPS Active Not lane 1 */
  3851. /******************* Bit definition for DSI_ISR0 register ***************/
  3852. #define DSI_ISR0_AE0 ((uint32_t)0x00000001) /*!< Acknowledge Error 0 */
  3853. #define DSI_ISR0_AE1 ((uint32_t)0x00000002) /*!< Acknowledge Error 1 */
  3854. #define DSI_ISR0_AE2 ((uint32_t)0x00000004) /*!< Acknowledge Error 2 */
  3855. #define DSI_ISR0_AE3 ((uint32_t)0x00000008) /*!< Acknowledge Error 3 */
  3856. #define DSI_ISR0_AE4 ((uint32_t)0x00000010) /*!< Acknowledge Error 4 */
  3857. #define DSI_ISR0_AE5 ((uint32_t)0x00000020) /*!< Acknowledge Error 5 */
  3858. #define DSI_ISR0_AE6 ((uint32_t)0x00000040) /*!< Acknowledge Error 6 */
  3859. #define DSI_ISR0_AE7 ((uint32_t)0x00000080) /*!< Acknowledge Error 7 */
  3860. #define DSI_ISR0_AE8 ((uint32_t)0x00000100) /*!< Acknowledge Error 8 */
  3861. #define DSI_ISR0_AE9 ((uint32_t)0x00000200) /*!< Acknowledge Error 9 */
  3862. #define DSI_ISR0_AE10 ((uint32_t)0x00000400) /*!< Acknowledge Error 10 */
  3863. #define DSI_ISR0_AE11 ((uint32_t)0x00000800) /*!< Acknowledge Error 11 */
  3864. #define DSI_ISR0_AE12 ((uint32_t)0x00001000) /*!< Acknowledge Error 12 */
  3865. #define DSI_ISR0_AE13 ((uint32_t)0x00002000) /*!< Acknowledge Error 13 */
  3866. #define DSI_ISR0_AE14 ((uint32_t)0x00004000) /*!< Acknowledge Error 14 */
  3867. #define DSI_ISR0_AE15 ((uint32_t)0x00008000) /*!< Acknowledge Error 15 */
  3868. #define DSI_ISR0_PE0 ((uint32_t)0x00010000) /*!< PHY Error 0 */
  3869. #define DSI_ISR0_PE1 ((uint32_t)0x00020000) /*!< PHY Error 1 */
  3870. #define DSI_ISR0_PE2 ((uint32_t)0x00040000) /*!< PHY Error 2 */
  3871. #define DSI_ISR0_PE3 ((uint32_t)0x00080000) /*!< PHY Error 3 */
  3872. #define DSI_ISR0_PE4 ((uint32_t)0x00100000) /*!< PHY Error 4 */
  3873. /******************* Bit definition for DSI_ISR1 register ***************/
  3874. #define DSI_ISR1_TOHSTX ((uint32_t)0x00000001) /*!< Timeout High-Speed Transmission */
  3875. #define DSI_ISR1_TOLPRX ((uint32_t)0x00000002) /*!< Timeout Low-Power Reception */
  3876. #define DSI_ISR1_ECCSE ((uint32_t)0x00000004) /*!< ECC Single-bit Error */
  3877. #define DSI_ISR1_ECCME ((uint32_t)0x00000008) /*!< ECC Multi-bit Error */
  3878. #define DSI_ISR1_CRCE ((uint32_t)0x00000010) /*!< CRC Error */
  3879. #define DSI_ISR1_PSE ((uint32_t)0x00000020) /*!< Packet Size Error */
  3880. #define DSI_ISR1_EOTPE ((uint32_t)0x00000040) /*!< EoTp Error */
  3881. #define DSI_ISR1_LPWRE ((uint32_t)0x00000080) /*!< LTDC Payload Write Error */
  3882. #define DSI_ISR1_GCWRE ((uint32_t)0x00000100) /*!< Generic Command Write Error */
  3883. #define DSI_ISR1_GPWRE ((uint32_t)0x00000200) /*!< Generic Payload Write Error */
  3884. #define DSI_ISR1_GPTXE ((uint32_t)0x00000400) /*!< Generic Payload Transmit Error */
  3885. #define DSI_ISR1_GPRDE ((uint32_t)0x00000800) /*!< Generic Payload Read Error */
  3886. #define DSI_ISR1_GPRXE ((uint32_t)0x00001000) /*!< Generic Payload Receive Error */
  3887. /******************* Bit definition for DSI_IER0 register ***************/
  3888. #define DSI_IER0_AE0IE ((uint32_t)0x00000001) /*!< Acknowledge Error 0 Interrupt Enable */
  3889. #define DSI_IER0_AE1IE ((uint32_t)0x00000002) /*!< Acknowledge Error 1 Interrupt Enable */
  3890. #define DSI_IER0_AE2IE ((uint32_t)0x00000004) /*!< Acknowledge Error 2 Interrupt Enable */
  3891. #define DSI_IER0_AE3IE ((uint32_t)0x00000008) /*!< Acknowledge Error 3 Interrupt Enable */
  3892. #define DSI_IER0_AE4IE ((uint32_t)0x00000010) /*!< Acknowledge Error 4 Interrupt Enable */
  3893. #define DSI_IER0_AE5IE ((uint32_t)0x00000020) /*!< Acknowledge Error 5 Interrupt Enable */
  3894. #define DSI_IER0_AE6IE ((uint32_t)0x00000040) /*!< Acknowledge Error 6 Interrupt Enable */
  3895. #define DSI_IER0_AE7IE ((uint32_t)0x00000080) /*!< Acknowledge Error 7 Interrupt Enable */
  3896. #define DSI_IER0_AE8IE ((uint32_t)0x00000100) /*!< Acknowledge Error 8 Interrupt Enable */
  3897. #define DSI_IER0_AE9IE ((uint32_t)0x00000200) /*!< Acknowledge Error 9 Interrupt Enable */
  3898. #define DSI_IER0_AE10IE ((uint32_t)0x00000400) /*!< Acknowledge Error 10 Interrupt Enable */
  3899. #define DSI_IER0_AE11IE ((uint32_t)0x00000800) /*!< Acknowledge Error 11 Interrupt Enable */
  3900. #define DSI_IER0_AE12IE ((uint32_t)0x00001000) /*!< Acknowledge Error 12 Interrupt Enable */
  3901. #define DSI_IER0_AE13IE ((uint32_t)0x00002000) /*!< Acknowledge Error 13 Interrupt Enable */
  3902. #define DSI_IER0_AE14IE ((uint32_t)0x00004000) /*!< Acknowledge Error 14 Interrupt Enable */
  3903. #define DSI_IER0_AE15IE ((uint32_t)0x00008000) /*!< Acknowledge Error 15 Interrupt Enable */
  3904. #define DSI_IER0_PE0IE ((uint32_t)0x00010000) /*!< PHY Error 0 Interrupt Enable */
  3905. #define DSI_IER0_PE1IE ((uint32_t)0x00020000) /*!< PHY Error 1 Interrupt Enable */
  3906. #define DSI_IER0_PE2IE ((uint32_t)0x00040000) /*!< PHY Error 2 Interrupt Enable */
  3907. #define DSI_IER0_PE3IE ((uint32_t)0x00080000) /*!< PHY Error 3 Interrupt Enable */
  3908. #define DSI_IER0_PE4IE ((uint32_t)0x00100000) /*!< PHY Error 4 Interrupt Enable */
  3909. /******************* Bit definition for DSI_IER1 register ***************/
  3910. #define DSI_IER1_TOHSTXIE ((uint32_t)0x00000001) /*!< Timeout High-Speed Transmission Interrupt Enable */
  3911. #define DSI_IER1_TOLPRXIE ((uint32_t)0x00000002) /*!< Timeout Low-Power Reception Interrupt Enable */
  3912. #define DSI_IER1_ECCSEIE ((uint32_t)0x00000004) /*!< ECC Single-bit Error Interrupt Enable */
  3913. #define DSI_IER1_ECCMEIE ((uint32_t)0x00000008) /*!< ECC Multi-bit Error Interrupt Enable */
  3914. #define DSI_IER1_CRCEIE ((uint32_t)0x00000010) /*!< CRC Error Interrupt Enable */
  3915. #define DSI_IER1_PSEIE ((uint32_t)0x00000020) /*!< Packet Size Error Interrupt Enable */
  3916. #define DSI_IER1_EOTPEIE ((uint32_t)0x00000040) /*!< EoTp Error Interrupt Enable */
  3917. #define DSI_IER1_LPWREIE ((uint32_t)0x00000080) /*!< LTDC Payload Write Error Interrupt Enable */
  3918. #define DSI_IER1_GCWREIE ((uint32_t)0x00000100) /*!< Generic Command Write Error Interrupt Enable */
  3919. #define DSI_IER1_GPWREIE ((uint32_t)0x00000200) /*!< Generic Payload Write Error Interrupt Enable */
  3920. #define DSI_IER1_GPTXEIE ((uint32_t)0x00000400) /*!< Generic Payload Transmit Error Interrupt Enable */
  3921. #define DSI_IER1_GPRDEIE ((uint32_t)0x00000800) /*!< Generic Payload Read Error Interrupt Enable */
  3922. #define DSI_IER1_GPRXEIE ((uint32_t)0x00001000) /*!< Generic Payload Receive Error Interrupt Enable */
  3923. /******************* Bit definition for DSI_FIR0 register ***************/
  3924. #define DSI_FIR0_FAE0 ((uint32_t)0x00000001) /*!< Force Acknowledge Error 0 */
  3925. #define DSI_FIR0_FAE1 ((uint32_t)0x00000002) /*!< Force Acknowledge Error 1 */
  3926. #define DSI_FIR0_FAE2 ((uint32_t)0x00000004) /*!< Force Acknowledge Error 2 */
  3927. #define DSI_FIR0_FAE3 ((uint32_t)0x00000008) /*!< Force Acknowledge Error 3 */
  3928. #define DSI_FIR0_FAE4 ((uint32_t)0x00000010) /*!< Force Acknowledge Error 4 */
  3929. #define DSI_FIR0_FAE5 ((uint32_t)0x00000020) /*!< Force Acknowledge Error 5 */
  3930. #define DSI_FIR0_FAE6 ((uint32_t)0x00000040) /*!< Force Acknowledge Error 6 */
  3931. #define DSI_FIR0_FAE7 ((uint32_t)0x00000080) /*!< Force Acknowledge Error 7 */
  3932. #define DSI_FIR0_FAE8 ((uint32_t)0x00000100) /*!< Force Acknowledge Error 8 */
  3933. #define DSI_FIR0_FAE9 ((uint32_t)0x00000200) /*!< Force Acknowledge Error 9 */
  3934. #define DSI_FIR0_FAE10 ((uint32_t)0x00000400) /*!< Force Acknowledge Error 10 */
  3935. #define DSI_FIR0_FAE11 ((uint32_t)0x00000800) /*!< Force Acknowledge Error 11 */
  3936. #define DSI_FIR0_FAE12 ((uint32_t)0x00001000) /*!< Force Acknowledge Error 12 */
  3937. #define DSI_FIR0_FAE13 ((uint32_t)0x00002000) /*!< Force Acknowledge Error 13 */
  3938. #define DSI_FIR0_FAE14 ((uint32_t)0x00004000) /*!< Force Acknowledge Error 14 */
  3939. #define DSI_FIR0_FAE15 ((uint32_t)0x00008000) /*!< Force Acknowledge Error 15 */
  3940. #define DSI_FIR0_FPE0 ((uint32_t)0x00010000) /*!< Force PHY Error 0 */
  3941. #define DSI_FIR0_FPE1 ((uint32_t)0x00020000) /*!< Force PHY Error 1 */
  3942. #define DSI_FIR0_FPE2 ((uint32_t)0x00040000) /*!< Force PHY Error 2 */
  3943. #define DSI_FIR0_FPE3 ((uint32_t)0x00080000) /*!< Force PHY Error 3 */
  3944. #define DSI_FIR0_FPE4 ((uint32_t)0x00100000) /*!< Force PHY Error 4 */
  3945. /******************* Bit definition for DSI_FIR1 register ***************/
  3946. #define DSI_FIR1_FTOHSTX ((uint32_t)0x00000001) /*!< Force Timeout High-Speed Transmission */
  3947. #define DSI_FIR1_FTOLPRX ((uint32_t)0x00000002) /*!< Force Timeout Low-Power Reception */
  3948. #define DSI_FIR1_FECCSE ((uint32_t)0x00000004) /*!< Force ECC Single-bit Error */
  3949. #define DSI_FIR1_FECCME ((uint32_t)0x00000008) /*!< Force ECC Multi-bit Error */
  3950. #define DSI_FIR1_FCRCE ((uint32_t)0x00000010) /*!< Force CRC Error */
  3951. #define DSI_FIR1_FPSE ((uint32_t)0x00000020) /*!< Force Packet Size Error */
  3952. #define DSI_FIR1_FEOTPE ((uint32_t)0x00000040) /*!< Force EoTp Error */
  3953. #define DSI_FIR1_FLPWRE ((uint32_t)0x00000080) /*!< Force LTDC Payload Write Error */
  3954. #define DSI_FIR1_FGCWRE ((uint32_t)0x00000100) /*!< Force Generic Command Write Error */
  3955. #define DSI_FIR1_FGPWRE ((uint32_t)0x00000200) /*!< Force Generic Payload Write Error */
  3956. #define DSI_FIR1_FGPTXE ((uint32_t)0x00000400) /*!< Force Generic Payload Transmit Error */
  3957. #define DSI_FIR1_FGPRDE ((uint32_t)0x00000800) /*!< Force Generic Payload Read Error */
  3958. #define DSI_FIR1_FGPRXE ((uint32_t)0x00001000) /*!< Force Generic Payload Receive Error */
  3959. /******************* Bit definition for DSI_VSCR register ***************/
  3960. #define DSI_VSCR_EN ((uint32_t)0x00000001) /*!< Enable */
  3961. #define DSI_VSCR_UR ((uint32_t)0x00000100) /*!< Update Register */
  3962. /******************* Bit definition for DSI_LCVCIDR register ************/
  3963. #define DSI_LCVCIDR_VCID ((uint32_t)0x00000003) /*!< Virtual Channel ID */
  3964. #define DSI_LCVCIDR_VCID0 ((uint32_t)0x00000001)
  3965. #define DSI_LCVCIDR_VCID1 ((uint32_t)0x00000002)
  3966. /******************* Bit definition for DSI_LCCCR register **************/
  3967. #define DSI_LCCCR_COLC ((uint32_t)0x0000000F) /*!< Color Coding */
  3968. #define DSI_LCCCR_COLC0 ((uint32_t)0x00000001)
  3969. #define DSI_LCCCR_COLC1 ((uint32_t)0x00000002)
  3970. #define DSI_LCCCR_COLC2 ((uint32_t)0x00000004)
  3971. #define DSI_LCCCR_COLC3 ((uint32_t)0x00000008)
  3972. #define DSI_LCCCR_LPE ((uint32_t)0x00000100) /*!< Loosely Packed Enable */
  3973. /******************* Bit definition for DSI_LPMCCR register *************/
  3974. #define DSI_LPMCCR_VLPSIZE ((uint32_t)0x000000FF) /*!< VACT Largest Packet Size */
  3975. #define DSI_LPMCCR_VLPSIZE0 ((uint32_t)0x00000001)
  3976. #define DSI_LPMCCR_VLPSIZE1 ((uint32_t)0x00000002)
  3977. #define DSI_LPMCCR_VLPSIZE2 ((uint32_t)0x00000004)
  3978. #define DSI_LPMCCR_VLPSIZE3 ((uint32_t)0x00000008)
  3979. #define DSI_LPMCCR_VLPSIZE4 ((uint32_t)0x00000010)
  3980. #define DSI_LPMCCR_VLPSIZE5 ((uint32_t)0x00000020)
  3981. #define DSI_LPMCCR_VLPSIZE6 ((uint32_t)0x00000040)
  3982. #define DSI_LPMCCR_VLPSIZE7 ((uint32_t)0x00000080)
  3983. #define DSI_LPMCCR_LPSIZE ((uint32_t)0x00FF0000) /*!< Largest Packet Size */
  3984. #define DSI_LPMCCR_LPSIZE0 ((uint32_t)0x00010000)
  3985. #define DSI_LPMCCR_LPSIZE1 ((uint32_t)0x00020000)
  3986. #define DSI_LPMCCR_LPSIZE2 ((uint32_t)0x00040000)
  3987. #define DSI_LPMCCR_LPSIZE3 ((uint32_t)0x00080000)
  3988. #define DSI_LPMCCR_LPSIZE4 ((uint32_t)0x00100000)
  3989. #define DSI_LPMCCR_LPSIZE5 ((uint32_t)0x00200000)
  3990. #define DSI_LPMCCR_LPSIZE6 ((uint32_t)0x00400000)
  3991. #define DSI_LPMCCR_LPSIZE7 ((uint32_t)0x00800000)
  3992. /******************* Bit definition for DSI_VMCCR register **************/
  3993. #define DSI_VMCCR_VMT ((uint32_t)0x00000003) /*!< Video Mode Type */
  3994. #define DSI_VMCCR_VMT0 ((uint32_t)0x00000001)
  3995. #define DSI_VMCCR_VMT1 ((uint32_t)0x00000002)
  3996. #define DSI_VMCCR_LPVSAE ((uint32_t)0x00000100) /*!< Low-power Vertical Sync time Enable */
  3997. #define DSI_VMCCR_LPVBPE ((uint32_t)0x00000200) /*!< Low-power Vertical Back-porch Enable */
  3998. #define DSI_VMCCR_LPVFPE ((uint32_t)0x00000400) /*!< Low-power Vertical Front-porch Enable */
  3999. #define DSI_VMCCR_LPVAE ((uint32_t)0x00000800) /*!< Low-power Vertical Active Enable */
  4000. #define DSI_VMCCR_LPHBPE ((uint32_t)0x00001000) /*!< Low-power Horizontal Back-porch Enable */
  4001. #define DSI_VMCCR_LPHFE ((uint32_t)0x00002000) /*!< Low-power Horizontal Front-porch Enable */
  4002. #define DSI_VMCCR_FBTAAE ((uint32_t)0x00004000) /*!< Frame BTA Acknowledge Enable */
  4003. #define DSI_VMCCR_LPCE ((uint32_t)0x00008000) /*!< Low-power Command Enable */
  4004. /******************* Bit definition for DSI_VPCCR register **************/
  4005. #define DSI_VPCCR_VPSIZE ((uint32_t)0x00003FFF) /*!< Video Packet Size */
  4006. #define DSI_VPCCR_VPSIZE0 ((uint32_t)0x00000001)
  4007. #define DSI_VPCCR_VPSIZE1 ((uint32_t)0x00000002)
  4008. #define DSI_VPCCR_VPSIZE2 ((uint32_t)0x00000004)
  4009. #define DSI_VPCCR_VPSIZE3 ((uint32_t)0x00000008)
  4010. #define DSI_VPCCR_VPSIZE4 ((uint32_t)0x00000010)
  4011. #define DSI_VPCCR_VPSIZE5 ((uint32_t)0x00000020)
  4012. #define DSI_VPCCR_VPSIZE6 ((uint32_t)0x00000040)
  4013. #define DSI_VPCCR_VPSIZE7 ((uint32_t)0x00000080)
  4014. #define DSI_VPCCR_VPSIZE8 ((uint32_t)0x00000100)
  4015. #define DSI_VPCCR_VPSIZE9 ((uint32_t)0x00000200)
  4016. #define DSI_VPCCR_VPSIZE10 ((uint32_t)0x00000400)
  4017. #define DSI_VPCCR_VPSIZE11 ((uint32_t)0x00000800)
  4018. #define DSI_VPCCR_VPSIZE12 ((uint32_t)0x00001000)
  4019. #define DSI_VPCCR_VPSIZE13 ((uint32_t)0x00002000)
  4020. /******************* Bit definition for DSI_VCCCR register **************/
  4021. #define DSI_VCCCR_NUMC ((uint32_t)0x00001FFF) /*!< Number of Chunks */
  4022. #define DSI_VCCCR_NUMC0 ((uint32_t)0x00000001)
  4023. #define DSI_VCCCR_NUMC1 ((uint32_t)0x00000002)
  4024. #define DSI_VCCCR_NUMC2 ((uint32_t)0x00000004)
  4025. #define DSI_VCCCR_NUMC3 ((uint32_t)0x00000008)
  4026. #define DSI_VCCCR_NUMC4 ((uint32_t)0x00000010)
  4027. #define DSI_VCCCR_NUMC5 ((uint32_t)0x00000020)
  4028. #define DSI_VCCCR_NUMC6 ((uint32_t)0x00000040)
  4029. #define DSI_VCCCR_NUMC7 ((uint32_t)0x00000080)
  4030. #define DSI_VCCCR_NUMC8 ((uint32_t)0x00000100)
  4031. #define DSI_VCCCR_NUMC9 ((uint32_t)0x00000200)
  4032. #define DSI_VCCCR_NUMC10 ((uint32_t)0x00000400)
  4033. #define DSI_VCCCR_NUMC11 ((uint32_t)0x00000800)
  4034. #define DSI_VCCCR_NUMC12 ((uint32_t)0x00001000)
  4035. /******************* Bit definition for DSI_VNPCCR register *************/
  4036. #define DSI_VNPCCR_NPSIZE ((uint32_t)0x00001FFF) /*!< Number of Chunks */
  4037. #define DSI_VNPCCR_NPSIZE0 ((uint32_t)0x00000001)
  4038. #define DSI_VNPCCR_NPSIZE1 ((uint32_t)0x00000002)
  4039. #define DSI_VNPCCR_NPSIZE2 ((uint32_t)0x00000004)
  4040. #define DSI_VNPCCR_NPSIZE3 ((uint32_t)0x00000008)
  4041. #define DSI_VNPCCR_NPSIZE4 ((uint32_t)0x00000010)
  4042. #define DSI_VNPCCR_NPSIZE5 ((uint32_t)0x00000020)
  4043. #define DSI_VNPCCR_NPSIZE6 ((uint32_t)0x00000040)
  4044. #define DSI_VNPCCR_NPSIZE7 ((uint32_t)0x00000080)
  4045. #define DSI_VNPCCR_NPSIZE8 ((uint32_t)0x00000100)
  4046. #define DSI_VNPCCR_NPSIZE9 ((uint32_t)0x00000200)
  4047. #define DSI_VNPCCR_NPSIZE10 ((uint32_t)0x00000400)
  4048. #define DSI_VNPCCR_NPSIZE11 ((uint32_t)0x00000800)
  4049. #define DSI_VNPCCR_NPSIZE12 ((uint32_t)0x00001000)
  4050. /******************* Bit definition for DSI_VHSACCR register ************/
  4051. #define DSI_VHSACCR_HSA ((uint32_t)0x00000FFF) /*!< Horizontal Synchronism Active duration */
  4052. #define DSI_VHSACCR_HSA0 ((uint32_t)0x00000001)
  4053. #define DSI_VHSACCR_HSA1 ((uint32_t)0x00000002)
  4054. #define DSI_VHSACCR_HSA2 ((uint32_t)0x00000004)
  4055. #define DSI_VHSACCR_HSA3 ((uint32_t)0x00000008)
  4056. #define DSI_VHSACCR_HSA4 ((uint32_t)0x00000010)
  4057. #define DSI_VHSACCR_HSA5 ((uint32_t)0x00000020)
  4058. #define DSI_VHSACCR_HSA6 ((uint32_t)0x00000040)
  4059. #define DSI_VHSACCR_HSA7 ((uint32_t)0x00000080)
  4060. #define DSI_VHSACCR_HSA8 ((uint32_t)0x00000100)
  4061. #define DSI_VHSACCR_HSA9 ((uint32_t)0x00000200)
  4062. #define DSI_VHSACCR_HSA10 ((uint32_t)0x00000400)
  4063. #define DSI_VHSACCR_HSA11 ((uint32_t)0x00000800)
  4064. /******************* Bit definition for DSI_VHBPCCR register ************/
  4065. #define DSI_VHBPCCR_HBP ((uint32_t)0x00000FFF) /*!< Horizontal Back-Porch duration */
  4066. #define DSI_VHBPCCR_HBP0 ((uint32_t)0x00000001)
  4067. #define DSI_VHBPCCR_HBP1 ((uint32_t)0x00000002)
  4068. #define DSI_VHBPCCR_HBP2 ((uint32_t)0x00000004)
  4069. #define DSI_VHBPCCR_HBP3 ((uint32_t)0x00000008)
  4070. #define DSI_VHBPCCR_HBP4 ((uint32_t)0x00000010)
  4071. #define DSI_VHBPCCR_HBP5 ((uint32_t)0x00000020)
  4072. #define DSI_VHBPCCR_HBP6 ((uint32_t)0x00000040)
  4073. #define DSI_VHBPCCR_HBP7 ((uint32_t)0x00000080)
  4074. #define DSI_VHBPCCR_HBP8 ((uint32_t)0x00000100)
  4075. #define DSI_VHBPCCR_HBP9 ((uint32_t)0x00000200)
  4076. #define DSI_VHBPCCR_HBP10 ((uint32_t)0x00000400)
  4077. #define DSI_VHBPCCR_HBP11 ((uint32_t)0x00000800)
  4078. /******************* Bit definition for DSI_VLCCR register **************/
  4079. #define DSI_VLCCR_HLINE ((uint32_t)0x00007FFF) /*!< Horizontal Line duration */
  4080. #define DSI_VLCCR_HLINE0 ((uint32_t)0x00000001)
  4081. #define DSI_VLCCR_HLINE1 ((uint32_t)0x00000002)
  4082. #define DSI_VLCCR_HLINE2 ((uint32_t)0x00000004)
  4083. #define DSI_VLCCR_HLINE3 ((uint32_t)0x00000008)
  4084. #define DSI_VLCCR_HLINE4 ((uint32_t)0x00000010)
  4085. #define DSI_VLCCR_HLINE5 ((uint32_t)0x00000020)
  4086. #define DSI_VLCCR_HLINE6 ((uint32_t)0x00000040)
  4087. #define DSI_VLCCR_HLINE7 ((uint32_t)0x00000080)
  4088. #define DSI_VLCCR_HLINE8 ((uint32_t)0x00000100)
  4089. #define DSI_VLCCR_HLINE9 ((uint32_t)0x00000200)
  4090. #define DSI_VLCCR_HLINE10 ((uint32_t)0x00000400)
  4091. #define DSI_VLCCR_HLINE11 ((uint32_t)0x00000800)
  4092. #define DSI_VLCCR_HLINE12 ((uint32_t)0x00001000)
  4093. #define DSI_VLCCR_HLINE13 ((uint32_t)0x00002000)
  4094. #define DSI_VLCCR_HLINE14 ((uint32_t)0x00004000)
  4095. /******************* Bit definition for DSI_VVSACCR register ***************/
  4096. #define DSI_VVSACCR_VSA ((uint32_t)0x000003FF) /*!< Vertical Synchronism Active duration */
  4097. #define DSI_VVSACCR_VSA0 ((uint32_t)0x00000001)
  4098. #define DSI_VVSACCR_VSA1 ((uint32_t)0x00000002)
  4099. #define DSI_VVSACCR_VSA2 ((uint32_t)0x00000004)
  4100. #define DSI_VVSACCR_VSA3 ((uint32_t)0x00000008)
  4101. #define DSI_VVSACCR_VSA4 ((uint32_t)0x00000010)
  4102. #define DSI_VVSACCR_VSA5 ((uint32_t)0x00000020)
  4103. #define DSI_VVSACCR_VSA6 ((uint32_t)0x00000040)
  4104. #define DSI_VVSACCR_VSA7 ((uint32_t)0x00000080)
  4105. #define DSI_VVSACCR_VSA8 ((uint32_t)0x00000100)
  4106. #define DSI_VVSACCR_VSA9 ((uint32_t)0x00000200)
  4107. /******************* Bit definition for DSI_VVBPCCR register ************/
  4108. #define DSI_VVBPCCR_VBP ((uint32_t)0x000003FF) /*!< Vertical Back-Porch duration */
  4109. #define DSI_VVBPCCR_VBP0 ((uint32_t)0x00000001)
  4110. #define DSI_VVBPCCR_VBP1 ((uint32_t)0x00000002)
  4111. #define DSI_VVBPCCR_VBP2 ((uint32_t)0x00000004)
  4112. #define DSI_VVBPCCR_VBP3 ((uint32_t)0x00000008)
  4113. #define DSI_VVBPCCR_VBP4 ((uint32_t)0x00000010)
  4114. #define DSI_VVBPCCR_VBP5 ((uint32_t)0x00000020)
  4115. #define DSI_VVBPCCR_VBP6 ((uint32_t)0x00000040)
  4116. #define DSI_VVBPCCR_VBP7 ((uint32_t)0x00000080)
  4117. #define DSI_VVBPCCR_VBP8 ((uint32_t)0x00000100)
  4118. #define DSI_VVBPCCR_VBP9 ((uint32_t)0x00000200)
  4119. /******************* Bit definition for DSI_VVFPCCR register ************/
  4120. #define DSI_VVFPCCR_VFP ((uint32_t)0x000003FF) /*!< Vertical Front-Porch duration */
  4121. #define DSI_VVFPCCR_VFP0 ((uint32_t)0x00000001)
  4122. #define DSI_VVFPCCR_VFP1 ((uint32_t)0x00000002)
  4123. #define DSI_VVFPCCR_VFP2 ((uint32_t)0x00000004)
  4124. #define DSI_VVFPCCR_VFP3 ((uint32_t)0x00000008)
  4125. #define DSI_VVFPCCR_VFP4 ((uint32_t)0x00000010)
  4126. #define DSI_VVFPCCR_VFP5 ((uint32_t)0x00000020)
  4127. #define DSI_VVFPCCR_VFP6 ((uint32_t)0x00000040)
  4128. #define DSI_VVFPCCR_VFP7 ((uint32_t)0x00000080)
  4129. #define DSI_VVFPCCR_VFP8 ((uint32_t)0x00000100)
  4130. #define DSI_VVFPCCR_VFP9 ((uint32_t)0x00000200)
  4131. /******************* Bit definition for DSI_VVACCR register *************/
  4132. #define DSI_VVACCR_VA ((uint32_t)0x00003FFF) /*!< Vertical Active duration */
  4133. #define DSI_VVACCR_VA0 ((uint32_t)0x00000001)
  4134. #define DSI_VVACCR_VA1 ((uint32_t)0x00000002)
  4135. #define DSI_VVACCR_VA2 ((uint32_t)0x00000004)
  4136. #define DSI_VVACCR_VA3 ((uint32_t)0x00000008)
  4137. #define DSI_VVACCR_VA4 ((uint32_t)0x00000010)
  4138. #define DSI_VVACCR_VA5 ((uint32_t)0x00000020)
  4139. #define DSI_VVACCR_VA6 ((uint32_t)0x00000040)
  4140. #define DSI_VVACCR_VA7 ((uint32_t)0x00000080)
  4141. #define DSI_VVACCR_VA8 ((uint32_t)0x00000100)
  4142. #define DSI_VVACCR_VA9 ((uint32_t)0x00000200)
  4143. #define DSI_VVACCR_VA10 ((uint32_t)0x00000400)
  4144. #define DSI_VVACCR_VA11 ((uint32_t)0x00000800)
  4145. #define DSI_VVACCR_VA12 ((uint32_t)0x00001000)
  4146. #define DSI_VVACCR_VA13 ((uint32_t)0x00002000)
  4147. /******************* Bit definition for DSI_TDCCR register **************/
  4148. #define DSI_TDCCR_3DM ((uint32_t)0x00000003) /*!< 3D Mode */
  4149. #define DSI_TDCCR_3DM0 ((uint32_t)0x00000001)
  4150. #define DSI_TDCCR_3DM1 ((uint32_t)0x00000002)
  4151. #define DSI_TDCCR_3DF ((uint32_t)0x0000000C) /*!< 3D Format */
  4152. #define DSI_TDCCR_3DF0 ((uint32_t)0x00000004)
  4153. #define DSI_TDCCR_3DF1 ((uint32_t)0x00000008)
  4154. #define DSI_TDCCR_SVS ((uint32_t)0x00000010) /*!< Second VSYNC */
  4155. #define DSI_TDCCR_RF ((uint32_t)0x00000020) /*!< Right First */
  4156. #define DSI_TDCCR_S3DC ((uint32_t)0x00010000) /*!< Send 3D Control */
  4157. /******************* Bit definition for DSI_WCFGR register ***************/
  4158. #define DSI_WCFGR_DSIM ((uint32_t)0x00000001) /*!< DSI Mode */
  4159. #define DSI_WCFGR_COLMUX ((uint32_t)0x0000000E) /*!< Color Multiplexing */
  4160. #define DSI_WCFGR_COLMUX0 ((uint32_t)0x00000002)
  4161. #define DSI_WCFGR_COLMUX1 ((uint32_t)0x00000004)
  4162. #define DSI_WCFGR_COLMUX2 ((uint32_t)0x00000008)
  4163. #define DSI_WCFGR_TESRC ((uint32_t)0x00000010) /*!< Tearing Effect Source */
  4164. #define DSI_WCFGR_TEPOL ((uint32_t)0x00000020) /*!< Tearing Effect Polarity */
  4165. #define DSI_WCFGR_AR ((uint32_t)0x00000040) /*!< Automatic Refresh */
  4166. #define DSI_WCFGR_VSPOL ((uint32_t)0x00000080) /*!< VSync Polarity */
  4167. /******************* Bit definition for DSI_WCR register *****************/
  4168. #define DSI_WCR_COLM ((uint32_t)0x00000001) /*!< Color Mode */
  4169. #define DSI_WCR_SHTDN ((uint32_t)0x00000002) /*!< Shutdown */
  4170. #define DSI_WCR_LTDCEN ((uint32_t)0x00000004) /*!< LTDC Enable */
  4171. #define DSI_WCR_DSIEN ((uint32_t)0x00000008) /*!< DSI Enable */
  4172. /******************* Bit definition for DSI_WIER register ****************/
  4173. #define DSI_WIER_TEIE ((uint32_t)0x00000001) /*!< Tearing Effect Interrupt Enable */
  4174. #define DSI_WIER_ERIE ((uint32_t)0x00000002) /*!< End of Refresh Interrupt Enable */
  4175. #define DSI_WIER_PLLLIE ((uint32_t)0x00000200) /*!< PLL Lock Interrupt Enable */
  4176. #define DSI_WIER_PLLUIE ((uint32_t)0x00000400) /*!< PLL Unlock Interrupt Enable */
  4177. #define DSI_WIER_RRIE ((uint32_t)0x00002000) /*!< Regulator Ready Interrupt Enable */
  4178. /******************* Bit definition for DSI_WISR register ****************/
  4179. #define DSI_WISR_TEIF ((uint32_t)0x00000001) /*!< Tearing Effect Interrupt Flag */
  4180. #define DSI_WISR_ERIF ((uint32_t)0x00000002) /*!< End of Refresh Interrupt Flag */
  4181. #define DSI_WISR_BUSY ((uint32_t)0x00000004) /*!< Busy Flag */
  4182. #define DSI_WISR_PLLLS ((uint32_t)0x00000100) /*!< PLL Lock Status */
  4183. #define DSI_WISR_PLLLIF ((uint32_t)0x00000200) /*!< PLL Lock Interrupt Flag */
  4184. #define DSI_WISR_PLLUIF ((uint32_t)0x00000400) /*!< PLL Unlock Interrupt Flag */
  4185. #define DSI_WISR_RRS ((uint32_t)0x00001000) /*!< Regulator Ready Flag */
  4186. #define DSI_WISR_RRIF ((uint32_t)0x00002000) /*!< Regulator Ready Interrupt Flag */
  4187. /******************* Bit definition for DSI_WIFCR register ***************/
  4188. #define DSI_WIFCR_CTEIF ((uint32_t)0x00000001) /*!< Clear Tearing Effect Interrupt Flag */
  4189. #define DSI_WIFCR_CERIF ((uint32_t)0x00000002) /*!< Clear End of Refresh Interrupt Flag */
  4190. #define DSI_WIFCR_CPLLLIF ((uint32_t)0x00000200) /*!< Clear PLL Lock Interrupt Flag */
  4191. #define DSI_WIFCR_CPLLUIF ((uint32_t)0x00000400) /*!< Clear PLL Unlock Interrupt Flag */
  4192. #define DSI_WIFCR_CRRIF ((uint32_t)0x00002000) /*!< Clear Regulator Ready Interrupt Flag */
  4193. /******************* Bit definition for DSI_WPCR0 register ***************/
  4194. #define DSI_WPCR0_UIX4 ((uint32_t)0x0000003F) /*!< Unit Interval multiplied by 4 */
  4195. #define DSI_WPCR0_UIX4_0 ((uint32_t)0x00000001)
  4196. #define DSI_WPCR0_UIX4_1 ((uint32_t)0x00000002)
  4197. #define DSI_WPCR0_UIX4_2 ((uint32_t)0x00000004)
  4198. #define DSI_WPCR0_UIX4_3 ((uint32_t)0x00000008)
  4199. #define DSI_WPCR0_UIX4_4 ((uint32_t)0x00000010)
  4200. #define DSI_WPCR0_UIX4_5 ((uint32_t)0x00000020)
  4201. #define DSI_WPCR0_SWCL ((uint32_t)0x00000040) /*!< Swap pins on clock lane */
  4202. #define DSI_WPCR0_SWDL0 ((uint32_t)0x00000080) /*!< Swap pins on data lane 1 */
  4203. #define DSI_WPCR0_SWDL1 ((uint32_t)0x00000100) /*!< Swap pins on data lane 2 */
  4204. #define DSI_WPCR0_HSICL ((uint32_t)0x00000200) /*!< Invert the high-speed data signal on clock lane */
  4205. #define DSI_WPCR0_HSIDL0 ((uint32_t)0x00000400) /*!< Invert the high-speed data signal on lane 1 */
  4206. #define DSI_WPCR0_HSIDL1 ((uint32_t)0x00000800) /*!< Invert the high-speed data signal on lane 2 */
  4207. #define DSI_WPCR0_FTXSMCL ((uint32_t)0x00001000) /*!< Force clock lane in TX stop mode */
  4208. #define DSI_WPCR0_FTXSMDL ((uint32_t)0x00002000) /*!< Force data lanes in TX stop mode */
  4209. #define DSI_WPCR0_CDOFFDL ((uint32_t)0x00004000) /*!< Contention detection OFF */
  4210. #define DSI_WPCR0_TDDL ((uint32_t)0x00010000) /*!< Turn Disable Data Lanes */
  4211. #define DSI_WPCR0_PDEN ((uint32_t)0x00040000) /*!< Pull-Down Enable */
  4212. #define DSI_WPCR0_TCLKPREPEN ((uint32_t)0x00080000) /*!< Timer for t-CLKPREP Enable */
  4213. #define DSI_WPCR0_TCLKZEROEN ((uint32_t)0x00100000) /*!< Timer for t-CLKZERO Enable */
  4214. #define DSI_WPCR0_THSPREPEN ((uint32_t)0x00200000) /*!< Timer for t-HSPREP Enable */
  4215. #define DSI_WPCR0_THSTRAILEN ((uint32_t)0x00400000) /*!< Timer for t-HSTRAIL Enable */
  4216. #define DSI_WPCR0_THSZEROEN ((uint32_t)0x00800000) /*!< Timer for t-HSZERO Enable */
  4217. #define DSI_WPCR0_TLPXDEN ((uint32_t)0x01000000) /*!< Timer for t-LPXD Enable */
  4218. #define DSI_WPCR0_THSEXITEN ((uint32_t)0x02000000) /*!< Timer for t-HSEXIT Enable */
  4219. #define DSI_WPCR0_TLPXCEN ((uint32_t)0x04000000) /*!< Timer for t-LPXC Enable */
  4220. #define DSI_WPCR0_TCLKPOSTEN ((uint32_t)0x08000000) /*!< Timer for t-CLKPOST Enable */
  4221. /******************* Bit definition for DSI_WPCR1 register ***************/
  4222. #define DSI_WPCR1_HSTXDCL ((uint32_t)0x00000003) /*!< High-Speed Transmission Delay on Clock Lane */
  4223. #define DSI_WPCR1_HSTXDCL0 ((uint32_t)0x00000001)
  4224. #define DSI_WPCR1_HSTXDCL1 ((uint32_t)0x00000002)
  4225. #define DSI_WPCR1_HSTXDDL ((uint32_t)0x0000000C) /*!< High-Speed Transmission Delay on Data Lane */
  4226. #define DSI_WPCR1_HSTXDDL0 ((uint32_t)0x00000004)
  4227. #define DSI_WPCR1_HSTXDDL1 ((uint32_t)0x00000008)
  4228. #define DSI_WPCR1_LPSRCCL ((uint32_t)0x000000C0) /*!< Low-Power transmission Slew Rate Compensation on Clock Lane */
  4229. #define DSI_WPCR1_LPSRCCL0 ((uint32_t)0x00000040)
  4230. #define DSI_WPCR1_LPSRCCL1 ((uint32_t)0x00000080)
  4231. #define DSI_WPCR1_LPSRCDL ((uint32_t)0x00000300) /*!< Low-Power transmission Slew Rate Compensation on Data Lane */
  4232. #define DSI_WPCR1_LPSRCDL0 ((uint32_t)0x00000100)
  4233. #define DSI_WPCR1_LPSRCDL1 ((uint32_t)0x00000200)
  4234. #define DSI_WPCR1_SDDC ((uint32_t)0x00001000) /*!< SDD Control */
  4235. #define DSI_WPCR1_LPRXVCDL ((uint32_t)0x0000C000) /*!< Low-Power Reception V-IL Compensation on Data Lanes */
  4236. #define DSI_WPCR1_LPRXVCDL0 ((uint32_t)0x00004000)
  4237. #define DSI_WPCR1_LPRXVCDL1 ((uint32_t)0x00008000)
  4238. #define DSI_WPCR1_HSTXSRCCL ((uint32_t)0x00030000) /*!< High-Speed Transmission Delay on Clock Lane */
  4239. #define DSI_WPCR1_HSTXSRCCL0 ((uint32_t)0x00010000)
  4240. #define DSI_WPCR1_HSTXSRCCL1 ((uint32_t)0x00020000)
  4241. #define DSI_WPCR1_HSTXSRCDL ((uint32_t)0x000C0000) /*!< High-Speed Transmission Delay on Data Lane */
  4242. #define DSI_WPCR1_HSTXSRCDL0 ((uint32_t)0x00040000)
  4243. #define DSI_WPCR1_HSTXSRCDL1 ((uint32_t)0x00080000)
  4244. #define DSI_WPCR1_FLPRXLPM ((uint32_t)0x00400000) /*!< Forces LP Receiver in Low-Power Mode */
  4245. #define DSI_WPCR1_LPRXFT ((uint32_t)0x06000000) /*!< Low-Power RX low-pass Filtering Tuning */
  4246. #define DSI_WPCR1_LPRXFT0 ((uint32_t)0x02000000)
  4247. #define DSI_WPCR1_LPRXFT1 ((uint32_t)0x04000000)
  4248. /******************* Bit definition for DSI_WPCR2 register ***************/
  4249. #define DSI_WPCR2_TCLKPREP ((uint32_t)0x000000FF) /*!< t-CLKPREP */
  4250. #define DSI_WPCR2_TCLKPREP0 ((uint32_t)0x00000001)
  4251. #define DSI_WPCR2_TCLKPREP1 ((uint32_t)0x00000002)
  4252. #define DSI_WPCR2_TCLKPREP2 ((uint32_t)0x00000004)
  4253. #define DSI_WPCR2_TCLKPREP3 ((uint32_t)0x00000008)
  4254. #define DSI_WPCR2_TCLKPREP4 ((uint32_t)0x00000010)
  4255. #define DSI_WPCR2_TCLKPREP5 ((uint32_t)0x00000020)
  4256. #define DSI_WPCR2_TCLKPREP6 ((uint32_t)0x00000040)
  4257. #define DSI_WPCR2_TCLKPREP7 ((uint32_t)0x00000080)
  4258. #define DSI_WPCR2_TCLKZERO ((uint32_t)0x0000FF00) /*!< t-CLKZERO */
  4259. #define DSI_WPCR2_TCLKZERO0 ((uint32_t)0x00000100)
  4260. #define DSI_WPCR2_TCLKZERO1 ((uint32_t)0x00000200)
  4261. #define DSI_WPCR2_TCLKZERO2 ((uint32_t)0x00000400)
  4262. #define DSI_WPCR2_TCLKZERO3 ((uint32_t)0x00000800)
  4263. #define DSI_WPCR2_TCLKZERO4 ((uint32_t)0x00001000)
  4264. #define DSI_WPCR2_TCLKZERO5 ((uint32_t)0x00002000)
  4265. #define DSI_WPCR2_TCLKZERO6 ((uint32_t)0x00004000)
  4266. #define DSI_WPCR2_TCLKZERO7 ((uint32_t)0x00008000)
  4267. #define DSI_WPCR2_THSPREP ((uint32_t)0x00FF0000) /*!< t-HSPREP */
  4268. #define DSI_WPCR2_THSPREP0 ((uint32_t)0x00010000)
  4269. #define DSI_WPCR2_THSPREP1 ((uint32_t)0x00020000)
  4270. #define DSI_WPCR2_THSPREP2 ((uint32_t)0x00040000)
  4271. #define DSI_WPCR2_THSPREP3 ((uint32_t)0x00080000)
  4272. #define DSI_WPCR2_THSPREP4 ((uint32_t)0x00100000)
  4273. #define DSI_WPCR2_THSPREP5 ((uint32_t)0x00200000)
  4274. #define DSI_WPCR2_THSPREP6 ((uint32_t)0x00400000)
  4275. #define DSI_WPCR2_THSPREP7 ((uint32_t)0x00800000)
  4276. #define DSI_WPCR2_THSTRAIL ((uint32_t)0xFF000000) /*!< t-HSTRAIL */
  4277. #define DSI_WPCR2_THSTRAIL0 ((uint32_t)0x01000000)
  4278. #define DSI_WPCR2_THSTRAIL1 ((uint32_t)0x02000000)
  4279. #define DSI_WPCR2_THSTRAIL2 ((uint32_t)0x04000000)
  4280. #define DSI_WPCR2_THSTRAIL3 ((uint32_t)0x08000000)
  4281. #define DSI_WPCR2_THSTRAIL4 ((uint32_t)0x10000000)
  4282. #define DSI_WPCR2_THSTRAIL5 ((uint32_t)0x20000000)
  4283. #define DSI_WPCR2_THSTRAIL6 ((uint32_t)0x40000000)
  4284. #define DSI_WPCR2_THSTRAIL7 ((uint32_t)0x80000000)
  4285. /******************* Bit definition for DSI_WPCR3 register ***************/
  4286. #define DSI_WPCR3_THSZERO ((uint32_t)0x000000FF) /*!< t-HSZERO */
  4287. #define DSI_WPCR3_THSZERO0 ((uint32_t)0x00000001)
  4288. #define DSI_WPCR3_THSZERO1 ((uint32_t)0x00000002)
  4289. #define DSI_WPCR3_THSZERO2 ((uint32_t)0x00000004)
  4290. #define DSI_WPCR3_THSZERO3 ((uint32_t)0x00000008)
  4291. #define DSI_WPCR3_THSZERO4 ((uint32_t)0x00000010)
  4292. #define DSI_WPCR3_THSZERO5 ((uint32_t)0x00000020)
  4293. #define DSI_WPCR3_THSZERO6 ((uint32_t)0x00000040)
  4294. #define DSI_WPCR3_THSZERO7 ((uint32_t)0x00000080)
  4295. #define DSI_WPCR3_TLPXD ((uint32_t)0x0000FF00) /*!< t-LPXD */
  4296. #define DSI_WPCR3_TLPXD0 ((uint32_t)0x00000100)
  4297. #define DSI_WPCR3_TLPXD1 ((uint32_t)0x00000200)
  4298. #define DSI_WPCR3_TLPXD2 ((uint32_t)0x00000400)
  4299. #define DSI_WPCR3_TLPXD3 ((uint32_t)0x00000800)
  4300. #define DSI_WPCR3_TLPXD4 ((uint32_t)0x00001000)
  4301. #define DSI_WPCR3_TLPXD5 ((uint32_t)0x00002000)
  4302. #define DSI_WPCR3_TLPXD6 ((uint32_t)0x00004000)
  4303. #define DSI_WPCR3_TLPXD7 ((uint32_t)0x00008000)
  4304. #define DSI_WPCR3_THSEXIT ((uint32_t)0x00FF0000) /*!< t-HSEXIT */
  4305. #define DSI_WPCR3_THSEXIT0 ((uint32_t)0x00010000)
  4306. #define DSI_WPCR3_THSEXIT1 ((uint32_t)0x00020000)
  4307. #define DSI_WPCR3_THSEXIT2 ((uint32_t)0x00040000)
  4308. #define DSI_WPCR3_THSEXIT3 ((uint32_t)0x00080000)
  4309. #define DSI_WPCR3_THSEXIT4 ((uint32_t)0x00100000)
  4310. #define DSI_WPCR3_THSEXIT5 ((uint32_t)0x00200000)
  4311. #define DSI_WPCR3_THSEXIT6 ((uint32_t)0x00400000)
  4312. #define DSI_WPCR3_THSEXIT7 ((uint32_t)0x00800000)
  4313. #define DSI_WPCR3_TLPXC ((uint32_t)0xFF000000) /*!< t-LPXC */
  4314. #define DSI_WPCR3_TLPXC0 ((uint32_t)0x01000000)
  4315. #define DSI_WPCR3_TLPXC1 ((uint32_t)0x02000000)
  4316. #define DSI_WPCR3_TLPXC2 ((uint32_t)0x04000000)
  4317. #define DSI_WPCR3_TLPXC3 ((uint32_t)0x08000000)
  4318. #define DSI_WPCR3_TLPXC4 ((uint32_t)0x10000000)
  4319. #define DSI_WPCR3_TLPXC5 ((uint32_t)0x20000000)
  4320. #define DSI_WPCR3_TLPXC6 ((uint32_t)0x40000000)
  4321. #define DSI_WPCR3_TLPXC7 ((uint32_t)0x80000000)
  4322. /******************* Bit definition for DSI_WPCR4 register ***************/
  4323. #define DSI_WPCR4_TCLKPOST ((uint32_t)0x000000FF) /*!< t-CLKPOST */
  4324. #define DSI_WPCR4_TCLKPOST0 ((uint32_t)0x00000001)
  4325. #define DSI_WPCR4_TCLKPOST1 ((uint32_t)0x00000002)
  4326. #define DSI_WPCR4_TCLKPOST2 ((uint32_t)0x00000004)
  4327. #define DSI_WPCR4_TCLKPOST3 ((uint32_t)0x00000008)
  4328. #define DSI_WPCR4_TCLKPOST4 ((uint32_t)0x00000010)
  4329. #define DSI_WPCR4_TCLKPOST5 ((uint32_t)0x00000020)
  4330. #define DSI_WPCR4_TCLKPOST6 ((uint32_t)0x00000040)
  4331. #define DSI_WPCR4_TCLKPOST7 ((uint32_t)0x00000080)
  4332. /******************* Bit definition for DSI_WRPCR register ***************/
  4333. #define DSI_WRPCR_PLLEN ((uint32_t)0x00000001) /*!< PLL Enable */
  4334. #define DSI_WRPCR_PLL_NDIV ((uint32_t)0x000001FC) /*!< PLL Loop Division Factor */
  4335. #define DSI_WRPCR_PLL_NDIV0 ((uint32_t)0x00000004)
  4336. #define DSI_WRPCR_PLL_NDIV1 ((uint32_t)0x00000008)
  4337. #define DSI_WRPCR_PLL_NDIV2 ((uint32_t)0x00000010)
  4338. #define DSI_WRPCR_PLL_NDIV3 ((uint32_t)0x00000020)
  4339. #define DSI_WRPCR_PLL_NDIV4 ((uint32_t)0x00000040)
  4340. #define DSI_WRPCR_PLL_NDIV5 ((uint32_t)0x00000080)
  4341. #define DSI_WRPCR_PLL_NDIV6 ((uint32_t)0x00000100)
  4342. #define DSI_WRPCR_PLL_IDF ((uint32_t)0x00007800) /*!< PLL Input Division Factor */
  4343. #define DSI_WRPCR_PLL_IDF0 ((uint32_t)0x00000800)
  4344. #define DSI_WRPCR_PLL_IDF1 ((uint32_t)0x00001000)
  4345. #define DSI_WRPCR_PLL_IDF2 ((uint32_t)0x00002000)
  4346. #define DSI_WRPCR_PLL_IDF3 ((uint32_t)0x00004000)
  4347. #define DSI_WRPCR_PLL_ODF ((uint32_t)0x00030000) /*!< PLL Output Division Factor */
  4348. #define DSI_WRPCR_PLL_ODF0 ((uint32_t)0x00010000)
  4349. #define DSI_WRPCR_PLL_ODF1 ((uint32_t)0x00020000)
  4350. #define DSI_WRPCR_REGEN ((uint32_t)0x01000000) /*!< Regulator Enable */
  4351. /******************************************************************************/
  4352. /* */
  4353. /* External Interrupt/Event Controller */
  4354. /* */
  4355. /******************************************************************************/
  4356. /******************* Bit definition for EXTI_IMR register *******************/
  4357. #define EXTI_IMR_MR0 ((uint32_t)0x00000001) /*!< Interrupt Mask on line 0 */
  4358. #define EXTI_IMR_MR1 ((uint32_t)0x00000002) /*!< Interrupt Mask on line 1 */
  4359. #define EXTI_IMR_MR2 ((uint32_t)0x00000004) /*!< Interrupt Mask on line 2 */
  4360. #define EXTI_IMR_MR3 ((uint32_t)0x00000008) /*!< Interrupt Mask on line 3 */
  4361. #define EXTI_IMR_MR4 ((uint32_t)0x00000010) /*!< Interrupt Mask on line 4 */
  4362. #define EXTI_IMR_MR5 ((uint32_t)0x00000020) /*!< Interrupt Mask on line 5 */
  4363. #define EXTI_IMR_MR6 ((uint32_t)0x00000040) /*!< Interrupt Mask on line 6 */
  4364. #define EXTI_IMR_MR7 ((uint32_t)0x00000080) /*!< Interrupt Mask on line 7 */
  4365. #define EXTI_IMR_MR8 ((uint32_t)0x00000100) /*!< Interrupt Mask on line 8 */
  4366. #define EXTI_IMR_MR9 ((uint32_t)0x00000200) /*!< Interrupt Mask on line 9 */
  4367. #define EXTI_IMR_MR10 ((uint32_t)0x00000400) /*!< Interrupt Mask on line 10 */
  4368. #define EXTI_IMR_MR11 ((uint32_t)0x00000800) /*!< Interrupt Mask on line 11 */
  4369. #define EXTI_IMR_MR12 ((uint32_t)0x00001000) /*!< Interrupt Mask on line 12 */
  4370. #define EXTI_IMR_MR13 ((uint32_t)0x00002000) /*!< Interrupt Mask on line 13 */
  4371. #define EXTI_IMR_MR14 ((uint32_t)0x00004000) /*!< Interrupt Mask on line 14 */
  4372. #define EXTI_IMR_MR15 ((uint32_t)0x00008000) /*!< Interrupt Mask on line 15 */
  4373. #define EXTI_IMR_MR16 ((uint32_t)0x00010000) /*!< Interrupt Mask on line 16 */
  4374. #define EXTI_IMR_MR17 ((uint32_t)0x00020000) /*!< Interrupt Mask on line 17 */
  4375. #define EXTI_IMR_MR18 ((uint32_t)0x00040000) /*!< Interrupt Mask on line 18 */
  4376. #define EXTI_IMR_MR19 ((uint32_t)0x00080000) /*!< Interrupt Mask on line 19 */
  4377. #define EXTI_IMR_MR20 ((uint32_t)0x00100000) /*!< Interrupt Mask on line 20 */
  4378. #define EXTI_IMR_MR21 ((uint32_t)0x00200000) /*!< Interrupt Mask on line 21 */
  4379. #define EXTI_IMR_MR22 ((uint32_t)0x00400000) /*!< Interrupt Mask on line 22 */
  4380. /******************* Bit definition for EXTI_EMR register *******************/
  4381. #define EXTI_EMR_MR0 ((uint32_t)0x00000001) /*!< Event Mask on line 0 */
  4382. #define EXTI_EMR_MR1 ((uint32_t)0x00000002) /*!< Event Mask on line 1 */
  4383. #define EXTI_EMR_MR2 ((uint32_t)0x00000004) /*!< Event Mask on line 2 */
  4384. #define EXTI_EMR_MR3 ((uint32_t)0x00000008) /*!< Event Mask on line 3 */
  4385. #define EXTI_EMR_MR4 ((uint32_t)0x00000010) /*!< Event Mask on line 4 */
  4386. #define EXTI_EMR_MR5 ((uint32_t)0x00000020) /*!< Event Mask on line 5 */
  4387. #define EXTI_EMR_MR6 ((uint32_t)0x00000040) /*!< Event Mask on line 6 */
  4388. #define EXTI_EMR_MR7 ((uint32_t)0x00000080) /*!< Event Mask on line 7 */
  4389. #define EXTI_EMR_MR8 ((uint32_t)0x00000100) /*!< Event Mask on line 8 */
  4390. #define EXTI_EMR_MR9 ((uint32_t)0x00000200) /*!< Event Mask on line 9 */
  4391. #define EXTI_EMR_MR10 ((uint32_t)0x00000400) /*!< Event Mask on line 10 */
  4392. #define EXTI_EMR_MR11 ((uint32_t)0x00000800) /*!< Event Mask on line 11 */
  4393. #define EXTI_EMR_MR12 ((uint32_t)0x00001000) /*!< Event Mask on line 12 */
  4394. #define EXTI_EMR_MR13 ((uint32_t)0x00002000) /*!< Event Mask on line 13 */
  4395. #define EXTI_EMR_MR14 ((uint32_t)0x00004000) /*!< Event Mask on line 14 */
  4396. #define EXTI_EMR_MR15 ((uint32_t)0x00008000) /*!< Event Mask on line 15 */
  4397. #define EXTI_EMR_MR16 ((uint32_t)0x00010000) /*!< Event Mask on line 16 */
  4398. #define EXTI_EMR_MR17 ((uint32_t)0x00020000) /*!< Event Mask on line 17 */
  4399. #define EXTI_EMR_MR18 ((uint32_t)0x00040000) /*!< Event Mask on line 18 */
  4400. #define EXTI_EMR_MR19 ((uint32_t)0x00080000) /*!< Event Mask on line 19 */
  4401. #define EXTI_EMR_MR20 ((uint32_t)0x00100000) /*!< Event Mask on line 20 */
  4402. #define EXTI_EMR_MR21 ((uint32_t)0x00200000) /*!< Event Mask on line 21 */
  4403. #define EXTI_EMR_MR22 ((uint32_t)0x00400000) /*!< Event Mask on line 22 */
  4404. /****************** Bit definition for EXTI_RTSR register *******************/
  4405. #define EXTI_RTSR_TR0 ((uint32_t)0x00000001) /*!< Rising trigger event configuration bit of line 0 */
  4406. #define EXTI_RTSR_TR1 ((uint32_t)0x00000002) /*!< Rising trigger event configuration bit of line 1 */
  4407. #define EXTI_RTSR_TR2 ((uint32_t)0x00000004) /*!< Rising trigger event configuration bit of line 2 */
  4408. #define EXTI_RTSR_TR3 ((uint32_t)0x00000008) /*!< Rising trigger event configuration bit of line 3 */
  4409. #define EXTI_RTSR_TR4 ((uint32_t)0x00000010) /*!< Rising trigger event configuration bit of line 4 */
  4410. #define EXTI_RTSR_TR5 ((uint32_t)0x00000020) /*!< Rising trigger event configuration bit of line 5 */
  4411. #define EXTI_RTSR_TR6 ((uint32_t)0x00000040) /*!< Rising trigger event configuration bit of line 6 */
  4412. #define EXTI_RTSR_TR7 ((uint32_t)0x00000080) /*!< Rising trigger event configuration bit of line 7 */
  4413. #define EXTI_RTSR_TR8 ((uint32_t)0x00000100) /*!< Rising trigger event configuration bit of line 8 */
  4414. #define EXTI_RTSR_TR9 ((uint32_t)0x00000200) /*!< Rising trigger event configuration bit of line 9 */
  4415. #define EXTI_RTSR_TR10 ((uint32_t)0x00000400) /*!< Rising trigger event configuration bit of line 10 */
  4416. #define EXTI_RTSR_TR11 ((uint32_t)0x00000800) /*!< Rising trigger event configuration bit of line 11 */
  4417. #define EXTI_RTSR_TR12 ((uint32_t)0x00001000) /*!< Rising trigger event configuration bit of line 12 */
  4418. #define EXTI_RTSR_TR13 ((uint32_t)0x00002000) /*!< Rising trigger event configuration bit of line 13 */
  4419. #define EXTI_RTSR_TR14 ((uint32_t)0x00004000) /*!< Rising trigger event configuration bit of line 14 */
  4420. #define EXTI_RTSR_TR15 ((uint32_t)0x00008000) /*!< Rising trigger event configuration bit of line 15 */
  4421. #define EXTI_RTSR_TR16 ((uint32_t)0x00010000) /*!< Rising trigger event configuration bit of line 16 */
  4422. #define EXTI_RTSR_TR17 ((uint32_t)0x00020000) /*!< Rising trigger event configuration bit of line 17 */
  4423. #define EXTI_RTSR_TR18 ((uint32_t)0x00040000) /*!< Rising trigger event configuration bit of line 18 */
  4424. #define EXTI_RTSR_TR19 ((uint32_t)0x00080000) /*!< Rising trigger event configuration bit of line 19 */
  4425. #define EXTI_RTSR_TR20 ((uint32_t)0x00100000) /*!< Rising trigger event configuration bit of line 20 */
  4426. #define EXTI_RTSR_TR21 ((uint32_t)0x00200000) /*!< Rising trigger event configuration bit of line 21 */
  4427. #define EXTI_RTSR_TR22 ((uint32_t)0x00400000) /*!< Rising trigger event configuration bit of line 22 */
  4428. /****************** Bit definition for EXTI_FTSR register *******************/
  4429. #define EXTI_FTSR_TR0 ((uint32_t)0x00000001) /*!< Falling trigger event configuration bit of line 0 */
  4430. #define EXTI_FTSR_TR1 ((uint32_t)0x00000002) /*!< Falling trigger event configuration bit of line 1 */
  4431. #define EXTI_FTSR_TR2 ((uint32_t)0x00000004) /*!< Falling trigger event configuration bit of line 2 */
  4432. #define EXTI_FTSR_TR3 ((uint32_t)0x00000008) /*!< Falling trigger event configuration bit of line 3 */
  4433. #define EXTI_FTSR_TR4 ((uint32_t)0x00000010) /*!< Falling trigger event configuration bit of line 4 */
  4434. #define EXTI_FTSR_TR5 ((uint32_t)0x00000020) /*!< Falling trigger event configuration bit of line 5 */
  4435. #define EXTI_FTSR_TR6 ((uint32_t)0x00000040) /*!< Falling trigger event configuration bit of line 6 */
  4436. #define EXTI_FTSR_TR7 ((uint32_t)0x00000080) /*!< Falling trigger event configuration bit of line 7 */
  4437. #define EXTI_FTSR_TR8 ((uint32_t)0x00000100) /*!< Falling trigger event configuration bit of line 8 */
  4438. #define EXTI_FTSR_TR9 ((uint32_t)0x00000200) /*!< Falling trigger event configuration bit of line 9 */
  4439. #define EXTI_FTSR_TR10 ((uint32_t)0x00000400) /*!< Falling trigger event configuration bit of line 10 */
  4440. #define EXTI_FTSR_TR11 ((uint32_t)0x00000800) /*!< Falling trigger event configuration bit of line 11 */
  4441. #define EXTI_FTSR_TR12 ((uint32_t)0x00001000) /*!< Falling trigger event configuration bit of line 12 */
  4442. #define EXTI_FTSR_TR13 ((uint32_t)0x00002000) /*!< Falling trigger event configuration bit of line 13 */
  4443. #define EXTI_FTSR_TR14 ((uint32_t)0x00004000) /*!< Falling trigger event configuration bit of line 14 */
  4444. #define EXTI_FTSR_TR15 ((uint32_t)0x00008000) /*!< Falling trigger event configuration bit of line 15 */
  4445. #define EXTI_FTSR_TR16 ((uint32_t)0x00010000) /*!< Falling trigger event configuration bit of line 16 */
  4446. #define EXTI_FTSR_TR17 ((uint32_t)0x00020000) /*!< Falling trigger event configuration bit of line 17 */
  4447. #define EXTI_FTSR_TR18 ((uint32_t)0x00040000) /*!< Falling trigger event configuration bit of line 18 */
  4448. #define EXTI_FTSR_TR19 ((uint32_t)0x00080000) /*!< Falling trigger event configuration bit of line 19 */
  4449. #define EXTI_FTSR_TR20 ((uint32_t)0x00100000) /*!< Falling trigger event configuration bit of line 20 */
  4450. #define EXTI_FTSR_TR21 ((uint32_t)0x00200000) /*!< Falling trigger event configuration bit of line 21 */
  4451. #define EXTI_FTSR_TR22 ((uint32_t)0x00400000) /*!< Falling trigger event configuration bit of line 22 */
  4452. /****************** Bit definition for EXTI_SWIER register ******************/
  4453. #define EXTI_SWIER_SWIER0 ((uint32_t)0x00000001) /*!< Software Interrupt on line 0 */
  4454. #define EXTI_SWIER_SWIER1 ((uint32_t)0x00000002) /*!< Software Interrupt on line 1 */
  4455. #define EXTI_SWIER_SWIER2 ((uint32_t)0x00000004) /*!< Software Interrupt on line 2 */
  4456. #define EXTI_SWIER_SWIER3 ((uint32_t)0x00000008) /*!< Software Interrupt on line 3 */
  4457. #define EXTI_SWIER_SWIER4 ((uint32_t)0x00000010) /*!< Software Interrupt on line 4 */
  4458. #define EXTI_SWIER_SWIER5 ((uint32_t)0x00000020) /*!< Software Interrupt on line 5 */
  4459. #define EXTI_SWIER_SWIER6 ((uint32_t)0x00000040) /*!< Software Interrupt on line 6 */
  4460. #define EXTI_SWIER_SWIER7 ((uint32_t)0x00000080) /*!< Software Interrupt on line 7 */
  4461. #define EXTI_SWIER_SWIER8 ((uint32_t)0x00000100) /*!< Software Interrupt on line 8 */
  4462. #define EXTI_SWIER_SWIER9 ((uint32_t)0x00000200) /*!< Software Interrupt on line 9 */
  4463. #define EXTI_SWIER_SWIER10 ((uint32_t)0x00000400) /*!< Software Interrupt on line 10 */
  4464. #define EXTI_SWIER_SWIER11 ((uint32_t)0x00000800) /*!< Software Interrupt on line 11 */
  4465. #define EXTI_SWIER_SWIER12 ((uint32_t)0x00001000) /*!< Software Interrupt on line 12 */
  4466. #define EXTI_SWIER_SWIER13 ((uint32_t)0x00002000) /*!< Software Interrupt on line 13 */
  4467. #define EXTI_SWIER_SWIER14 ((uint32_t)0x00004000) /*!< Software Interrupt on line 14 */
  4468. #define EXTI_SWIER_SWIER15 ((uint32_t)0x00008000) /*!< Software Interrupt on line 15 */
  4469. #define EXTI_SWIER_SWIER16 ((uint32_t)0x00010000) /*!< Software Interrupt on line 16 */
  4470. #define EXTI_SWIER_SWIER17 ((uint32_t)0x00020000) /*!< Software Interrupt on line 17 */
  4471. #define EXTI_SWIER_SWIER18 ((uint32_t)0x00040000) /*!< Software Interrupt on line 18 */
  4472. #define EXTI_SWIER_SWIER19 ((uint32_t)0x00080000) /*!< Software Interrupt on line 19 */
  4473. #define EXTI_SWIER_SWIER20 ((uint32_t)0x00100000) /*!< Software Interrupt on line 20 */
  4474. #define EXTI_SWIER_SWIER21 ((uint32_t)0x00200000) /*!< Software Interrupt on line 21 */
  4475. #define EXTI_SWIER_SWIER22 ((uint32_t)0x00400000) /*!< Software Interrupt on line 22 */
  4476. /******************* Bit definition for EXTI_PR register ********************/
  4477. #define EXTI_PR_PR0 ((uint32_t)0x00000001) /*!< Pending bit for line 0 */
  4478. #define EXTI_PR_PR1 ((uint32_t)0x00000002) /*!< Pending bit for line 1 */
  4479. #define EXTI_PR_PR2 ((uint32_t)0x00000004) /*!< Pending bit for line 2 */
  4480. #define EXTI_PR_PR3 ((uint32_t)0x00000008) /*!< Pending bit for line 3 */
  4481. #define EXTI_PR_PR4 ((uint32_t)0x00000010) /*!< Pending bit for line 4 */
  4482. #define EXTI_PR_PR5 ((uint32_t)0x00000020) /*!< Pending bit for line 5 */
  4483. #define EXTI_PR_PR6 ((uint32_t)0x00000040) /*!< Pending bit for line 6 */
  4484. #define EXTI_PR_PR7 ((uint32_t)0x00000080) /*!< Pending bit for line 7 */
  4485. #define EXTI_PR_PR8 ((uint32_t)0x00000100) /*!< Pending bit for line 8 */
  4486. #define EXTI_PR_PR9 ((uint32_t)0x00000200) /*!< Pending bit for line 9 */
  4487. #define EXTI_PR_PR10 ((uint32_t)0x00000400) /*!< Pending bit for line 10 */
  4488. #define EXTI_PR_PR11 ((uint32_t)0x00000800) /*!< Pending bit for line 11 */
  4489. #define EXTI_PR_PR12 ((uint32_t)0x00001000) /*!< Pending bit for line 12 */
  4490. #define EXTI_PR_PR13 ((uint32_t)0x00002000) /*!< Pending bit for line 13 */
  4491. #define EXTI_PR_PR14 ((uint32_t)0x00004000) /*!< Pending bit for line 14 */
  4492. #define EXTI_PR_PR15 ((uint32_t)0x00008000) /*!< Pending bit for line 15 */
  4493. #define EXTI_PR_PR16 ((uint32_t)0x00010000) /*!< Pending bit for line 16 */
  4494. #define EXTI_PR_PR17 ((uint32_t)0x00020000) /*!< Pending bit for line 17 */
  4495. #define EXTI_PR_PR18 ((uint32_t)0x00040000) /*!< Pending bit for line 18 */
  4496. #define EXTI_PR_PR19 ((uint32_t)0x00080000) /*!< Pending bit for line 19 */
  4497. #define EXTI_PR_PR20 ((uint32_t)0x00100000) /*!< Pending bit for line 20 */
  4498. #define EXTI_PR_PR21 ((uint32_t)0x00200000) /*!< Pending bit for line 21 */
  4499. #define EXTI_PR_PR22 ((uint32_t)0x00400000) /*!< Pending bit for line 22 */
  4500. /******************************************************************************/
  4501. /* */
  4502. /* FLASH */
  4503. /* */
  4504. /******************************************************************************/
  4505. /******************* Bits definition for FLASH_ACR register *****************/
  4506. #define FLASH_ACR_LATENCY ((uint32_t)0x0000000F)
  4507. #define FLASH_ACR_LATENCY_0WS ((uint32_t)0x00000000)
  4508. #define FLASH_ACR_LATENCY_1WS ((uint32_t)0x00000001)
  4509. #define FLASH_ACR_LATENCY_2WS ((uint32_t)0x00000002)
  4510. #define FLASH_ACR_LATENCY_3WS ((uint32_t)0x00000003)
  4511. #define FLASH_ACR_LATENCY_4WS ((uint32_t)0x00000004)
  4512. #define FLASH_ACR_LATENCY_5WS ((uint32_t)0x00000005)
  4513. #define FLASH_ACR_LATENCY_6WS ((uint32_t)0x00000006)
  4514. #define FLASH_ACR_LATENCY_7WS ((uint32_t)0x00000007)
  4515. #define FLASH_ACR_LATENCY_8WS ((uint32_t)0x00000008)
  4516. #define FLASH_ACR_LATENCY_9WS ((uint32_t)0x00000009)
  4517. #define FLASH_ACR_LATENCY_10WS ((uint32_t)0x0000000A)
  4518. #define FLASH_ACR_LATENCY_11WS ((uint32_t)0x0000000B)
  4519. #define FLASH_ACR_LATENCY_12WS ((uint32_t)0x0000000C)
  4520. #define FLASH_ACR_LATENCY_13WS ((uint32_t)0x0000000D)
  4521. #define FLASH_ACR_LATENCY_14WS ((uint32_t)0x0000000E)
  4522. #define FLASH_ACR_LATENCY_15WS ((uint32_t)0x0000000F)
  4523. #define FLASH_ACR_PRFTEN ((uint32_t)0x00000100)
  4524. #define FLASH_ACR_ICEN ((uint32_t)0x00000200)
  4525. #define FLASH_ACR_DCEN ((uint32_t)0x00000400)
  4526. #define FLASH_ACR_ICRST ((uint32_t)0x00000800)
  4527. #define FLASH_ACR_DCRST ((uint32_t)0x00001000)
  4528. #define FLASH_ACR_BYTE0_ADDRESS ((uint32_t)0x40023C00)
  4529. #define FLASH_ACR_BYTE2_ADDRESS ((uint32_t)0x40023C03)
  4530. /******************* Bits definition for FLASH_SR register ******************/
  4531. #define FLASH_SR_EOP ((uint32_t)0x00000001)
  4532. #define FLASH_SR_SOP ((uint32_t)0x00000002)
  4533. #define FLASH_SR_WRPERR ((uint32_t)0x00000010)
  4534. #define FLASH_SR_PGAERR ((uint32_t)0x00000020)
  4535. #define FLASH_SR_PGPERR ((uint32_t)0x00000040)
  4536. #define FLASH_SR_PGSERR ((uint32_t)0x00000080)
  4537. #define FLASH_SR_BSY ((uint32_t)0x00010000)
  4538. /******************* Bits definition for FLASH_CR register ******************/
  4539. #define FLASH_CR_PG ((uint32_t)0x00000001)
  4540. #define FLASH_CR_SER ((uint32_t)0x00000002)
  4541. #define FLASH_CR_MER ((uint32_t)0x00000004)
  4542. #define FLASH_CR_MER1 FLASH_CR_MER
  4543. #define FLASH_CR_SNB ((uint32_t)0x000000F8)
  4544. #define FLASH_CR_SNB_0 ((uint32_t)0x00000008)
  4545. #define FLASH_CR_SNB_1 ((uint32_t)0x00000010)
  4546. #define FLASH_CR_SNB_2 ((uint32_t)0x00000020)
  4547. #define FLASH_CR_SNB_3 ((uint32_t)0x00000040)
  4548. #define FLASH_CR_SNB_4 ((uint32_t)0x00000080)
  4549. #define FLASH_CR_PSIZE ((uint32_t)0x00000300)
  4550. #define FLASH_CR_PSIZE_0 ((uint32_t)0x00000100)
  4551. #define FLASH_CR_PSIZE_1 ((uint32_t)0x00000200)
  4552. #define FLASH_CR_MER2 ((uint32_t)0x00008000)
  4553. #define FLASH_CR_STRT ((uint32_t)0x00010000)
  4554. #define FLASH_CR_EOPIE ((uint32_t)0x01000000)
  4555. #define FLASH_CR_LOCK ((uint32_t)0x80000000)
  4556. /******************* Bits definition for FLASH_OPTCR register ***************/
  4557. #define FLASH_OPTCR_OPTLOCK ((uint32_t)0x00000001)
  4558. #define FLASH_OPTCR_OPTSTRT ((uint32_t)0x00000002)
  4559. #define FLASH_OPTCR_BOR_LEV_0 ((uint32_t)0x00000004)
  4560. #define FLASH_OPTCR_BOR_LEV_1 ((uint32_t)0x00000008)
  4561. #define FLASH_OPTCR_BOR_LEV ((uint32_t)0x0000000C)
  4562. #define FLASH_OPTCR_BFB2 ((uint32_t)0x00000010)
  4563. #define FLASH_OPTCR_WDG_SW ((uint32_t)0x00000020)
  4564. #define FLASH_OPTCR_nRST_STOP ((uint32_t)0x00000040)
  4565. #define FLASH_OPTCR_nRST_STDBY ((uint32_t)0x00000080)
  4566. #define FLASH_OPTCR_RDP ((uint32_t)0x0000FF00)
  4567. #define FLASH_OPTCR_RDP_0 ((uint32_t)0x00000100)
  4568. #define FLASH_OPTCR_RDP_1 ((uint32_t)0x00000200)
  4569. #define FLASH_OPTCR_RDP_2 ((uint32_t)0x00000400)
  4570. #define FLASH_OPTCR_RDP_3 ((uint32_t)0x00000800)
  4571. #define FLASH_OPTCR_RDP_4 ((uint32_t)0x00001000)
  4572. #define FLASH_OPTCR_RDP_5 ((uint32_t)0x00002000)
  4573. #define FLASH_OPTCR_RDP_6 ((uint32_t)0x00004000)
  4574. #define FLASH_OPTCR_RDP_7 ((uint32_t)0x00008000)
  4575. #define FLASH_OPTCR_nWRP ((uint32_t)0x0FFF0000)
  4576. #define FLASH_OPTCR_nWRP_0 ((uint32_t)0x00010000)
  4577. #define FLASH_OPTCR_nWRP_1 ((uint32_t)0x00020000)
  4578. #define FLASH_OPTCR_nWRP_2 ((uint32_t)0x00040000)
  4579. #define FLASH_OPTCR_nWRP_3 ((uint32_t)0x00080000)
  4580. #define FLASH_OPTCR_nWRP_4 ((uint32_t)0x00100000)
  4581. #define FLASH_OPTCR_nWRP_5 ((uint32_t)0x00200000)
  4582. #define FLASH_OPTCR_nWRP_6 ((uint32_t)0x00400000)
  4583. #define FLASH_OPTCR_nWRP_7 ((uint32_t)0x00800000)
  4584. #define FLASH_OPTCR_nWRP_8 ((uint32_t)0x01000000)
  4585. #define FLASH_OPTCR_nWRP_9 ((uint32_t)0x02000000)
  4586. #define FLASH_OPTCR_nWRP_10 ((uint32_t)0x04000000)
  4587. #define FLASH_OPTCR_nWRP_11 ((uint32_t)0x08000000)
  4588. #define FLASH_OPTCR_DB1M ((uint32_t)0x40000000)
  4589. #define FLASH_OPTCR_SPRMOD ((uint32_t)0x80000000)
  4590. /****************** Bits definition for FLASH_OPTCR1 register ***************/
  4591. #define FLASH_OPTCR1_nWRP ((uint32_t)0x0FFF0000)
  4592. #define FLASH_OPTCR1_nWRP_0 ((uint32_t)0x00010000)
  4593. #define FLASH_OPTCR1_nWRP_1 ((uint32_t)0x00020000)
  4594. #define FLASH_OPTCR1_nWRP_2 ((uint32_t)0x00040000)
  4595. #define FLASH_OPTCR1_nWRP_3 ((uint32_t)0x00080000)
  4596. #define FLASH_OPTCR1_nWRP_4 ((uint32_t)0x00100000)
  4597. #define FLASH_OPTCR1_nWRP_5 ((uint32_t)0x00200000)
  4598. #define FLASH_OPTCR1_nWRP_6 ((uint32_t)0x00400000)
  4599. #define FLASH_OPTCR1_nWRP_7 ((uint32_t)0x00800000)
  4600. #define FLASH_OPTCR1_nWRP_8 ((uint32_t)0x01000000)
  4601. #define FLASH_OPTCR1_nWRP_9 ((uint32_t)0x02000000)
  4602. #define FLASH_OPTCR1_nWRP_10 ((uint32_t)0x04000000)
  4603. #define FLASH_OPTCR1_nWRP_11 ((uint32_t)0x08000000)
  4604. /******************************************************************************/
  4605. /* */
  4606. /* Flexible Memory Controller */
  4607. /* */
  4608. /******************************************************************************/
  4609. /****************** Bit definition for FMC_BCR1 register *******************/
  4610. #define FMC_BCR1_MBKEN ((uint32_t)0x00000001) /*!<Memory bank enable bit */
  4611. #define FMC_BCR1_MUXEN ((uint32_t)0x00000002) /*!<Address/data multiplexing enable bit */
  4612. #define FMC_BCR1_MTYP ((uint32_t)0x0000000C) /*!<MTYP[1:0] bits (Memory type) */
  4613. #define FMC_BCR1_MTYP_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  4614. #define FMC_BCR1_MTYP_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  4615. #define FMC_BCR1_MWID ((uint32_t)0x00000030) /*!<MWID[1:0] bits (Memory data bus width) */
  4616. #define FMC_BCR1_MWID_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4617. #define FMC_BCR1_MWID_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4618. #define FMC_BCR1_FACCEN ((uint32_t)0x00000040) /*!<Flash access enable */
  4619. #define FMC_BCR1_BURSTEN ((uint32_t)0x00000100) /*!<Burst enable bit */
  4620. #define FMC_BCR1_WAITPOL ((uint32_t)0x00000200) /*!<Wait signal polarity bit */
  4621. #define FMC_BCR1_WAITCFG ((uint32_t)0x00000800) /*!<Wait timing configuration */
  4622. #define FMC_BCR1_WREN ((uint32_t)0x00001000) /*!<Write enable bit */
  4623. #define FMC_BCR1_WAITEN ((uint32_t)0x00002000) /*!<Wait enable bit */
  4624. #define FMC_BCR1_EXTMOD ((uint32_t)0x00004000) /*!<Extended mode enable */
  4625. #define FMC_BCR1_ASYNCWAIT ((uint32_t)0x00008000) /*!<Asynchronous wait */
  4626. #define FMC_BCR1_CPSIZE ((uint32_t)0x00070000) /*!<CRAM page size */
  4627. #define FMC_BCR1_CPSIZE_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  4628. #define FMC_BCR1_CPSIZE_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  4629. #define FMC_BCR1_CPSIZE_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  4630. #define FMC_BCR1_CBURSTRW ((uint32_t)0x00080000) /*!<Write burst enable */
  4631. #define FMC_BCR1_CCLKEN ((uint32_t)0x00100000) /*!<Continous clock enable */
  4632. #define FMC_BCR1_WFDIS ((uint32_t)0x00200000) /*!<Write FIFO Disable */
  4633. /****************** Bit definition for FMC_BCR2 register *******************/
  4634. #define FMC_BCR2_MBKEN ((uint32_t)0x00000001) /*!<Memory bank enable bit */
  4635. #define FMC_BCR2_MUXEN ((uint32_t)0x00000002) /*!<Address/data multiplexing enable bit */
  4636. #define FMC_BCR2_MTYP ((uint32_t)0x0000000C) /*!<MTYP[1:0] bits (Memory type) */
  4637. #define FMC_BCR2_MTYP_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  4638. #define FMC_BCR2_MTYP_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  4639. #define FMC_BCR2_MWID ((uint32_t)0x00000030) /*!<MWID[1:0] bits (Memory data bus width) */
  4640. #define FMC_BCR2_MWID_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4641. #define FMC_BCR2_MWID_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4642. #define FMC_BCR2_FACCEN ((uint32_t)0x00000040) /*!<Flash access enable */
  4643. #define FMC_BCR2_BURSTEN ((uint32_t)0x00000100) /*!<Burst enable bit */
  4644. #define FMC_BCR2_WAITPOL ((uint32_t)0x00000200) /*!<Wait signal polarity bit */
  4645. #define FMC_BCR2_WAITCFG ((uint32_t)0x00000800) /*!<Wait timing configuration */
  4646. #define FMC_BCR2_WREN ((uint32_t)0x00001000) /*!<Write enable bit */
  4647. #define FMC_BCR2_WAITEN ((uint32_t)0x00002000) /*!<Wait enable bit */
  4648. #define FMC_BCR2_EXTMOD ((uint32_t)0x00004000) /*!<Extended mode enable */
  4649. #define FMC_BCR2_ASYNCWAIT ((uint32_t)0x00008000) /*!<Asynchronous wait */
  4650. #define FMC_BCR2_CBURSTRW ((uint32_t)0x00080000) /*!<Write burst enable */
  4651. /****************** Bit definition for FMC_BCR3 register *******************/
  4652. #define FMC_BCR3_MBKEN ((uint32_t)0x00000001) /*!<Memory bank enable bit */
  4653. #define FMC_BCR3_MUXEN ((uint32_t)0x00000002) /*!<Address/data multiplexing enable bit */
  4654. #define FMC_BCR3_MTYP ((uint32_t)0x0000000C) /*!<MTYP[1:0] bits (Memory type) */
  4655. #define FMC_BCR3_MTYP_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  4656. #define FMC_BCR3_MTYP_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  4657. #define FMC_BCR3_MWID ((uint32_t)0x00000030) /*!<MWID[1:0] bits (Memory data bus width) */
  4658. #define FMC_BCR3_MWID_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4659. #define FMC_BCR3_MWID_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4660. #define FMC_BCR3_FACCEN ((uint32_t)0x00000040) /*!<Flash access enable */
  4661. #define FMC_BCR3_BURSTEN ((uint32_t)0x00000100) /*!<Burst enable bit */
  4662. #define FMC_BCR3_WAITPOL ((uint32_t)0x00000200) /*!<Wait signal polarity bit */
  4663. #define FMC_BCR3_WAITCFG ((uint32_t)0x00000800) /*!<Wait timing configuration */
  4664. #define FMC_BCR3_WREN ((uint32_t)0x00001000) /*!<Write enable bit */
  4665. #define FMC_BCR3_WAITEN ((uint32_t)0x00002000) /*!<Wait enable bit */
  4666. #define FMC_BCR3_EXTMOD ((uint32_t)0x00004000) /*!<Extended mode enable */
  4667. #define FMC_BCR3_ASYNCWAIT ((uint32_t)0x00008000) /*!<Asynchronous wait */
  4668. #define FMC_BCR3_CBURSTRW ((uint32_t)0x00080000) /*!<Write burst enable */
  4669. /****************** Bit definition for FMC_BCR4 register *******************/
  4670. #define FMC_BCR4_MBKEN ((uint32_t)0x00000001) /*!<Memory bank enable bit */
  4671. #define FMC_BCR4_MUXEN ((uint32_t)0x00000002) /*!<Address/data multiplexing enable bit */
  4672. #define FMC_BCR4_MTYP ((uint32_t)0x0000000C) /*!<MTYP[1:0] bits (Memory type) */
  4673. #define FMC_BCR4_MTYP_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  4674. #define FMC_BCR4_MTYP_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  4675. #define FMC_BCR4_MWID ((uint32_t)0x00000030) /*!<MWID[1:0] bits (Memory data bus width) */
  4676. #define FMC_BCR4_MWID_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4677. #define FMC_BCR4_MWID_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4678. #define FMC_BCR4_FACCEN ((uint32_t)0x00000040) /*!<Flash access enable */
  4679. #define FMC_BCR4_BURSTEN ((uint32_t)0x00000100) /*!<Burst enable bit */
  4680. #define FMC_BCR4_WAITPOL ((uint32_t)0x00000200) /*!<Wait signal polarity bit */
  4681. #define FMC_BCR4_WAITCFG ((uint32_t)0x00000800) /*!<Wait timing configuration */
  4682. #define FMC_BCR4_WREN ((uint32_t)0x00001000) /*!<Write enable bit */
  4683. #define FMC_BCR4_WAITEN ((uint32_t)0x00002000) /*!<Wait enable bit */
  4684. #define FMC_BCR4_EXTMOD ((uint32_t)0x00004000) /*!<Extended mode enable */
  4685. #define FMC_BCR4_ASYNCWAIT ((uint32_t)0x00008000) /*!<Asynchronous wait */
  4686. #define FMC_BCR4_CBURSTRW ((uint32_t)0x00080000) /*!<Write burst enable */
  4687. /****************** Bit definition for FMC_BTR1 register ******************/
  4688. #define FMC_BTR1_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  4689. #define FMC_BTR1_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4690. #define FMC_BTR1_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4691. #define FMC_BTR1_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  4692. #define FMC_BTR1_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  4693. #define FMC_BTR1_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  4694. #define FMC_BTR1_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4695. #define FMC_BTR1_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4696. #define FMC_BTR1_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  4697. #define FMC_BTR1_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  4698. #define FMC_BTR1_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  4699. #define FMC_BTR1_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  4700. #define FMC_BTR1_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  4701. #define FMC_BTR1_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  4702. #define FMC_BTR1_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  4703. #define FMC_BTR1_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  4704. #define FMC_BTR1_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  4705. #define FMC_BTR1_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  4706. #define FMC_BTR1_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  4707. #define FMC_BTR1_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround phase duration) */
  4708. #define FMC_BTR1_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  4709. #define FMC_BTR1_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  4710. #define FMC_BTR1_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  4711. #define FMC_BTR1_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  4712. #define FMC_BTR1_CLKDIV ((uint32_t)0x00F00000) /*!<CLKDIV[3:0] bits (Clock divide ratio) */
  4713. #define FMC_BTR1_CLKDIV_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  4714. #define FMC_BTR1_CLKDIV_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  4715. #define FMC_BTR1_CLKDIV_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  4716. #define FMC_BTR1_CLKDIV_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  4717. #define FMC_BTR1_DATLAT ((uint32_t)0x0F000000) /*!<DATLA[3:0] bits (Data latency) */
  4718. #define FMC_BTR1_DATLAT_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  4719. #define FMC_BTR1_DATLAT_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  4720. #define FMC_BTR1_DATLAT_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  4721. #define FMC_BTR1_DATLAT_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  4722. #define FMC_BTR1_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  4723. #define FMC_BTR1_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  4724. #define FMC_BTR1_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  4725. /****************** Bit definition for FMC_BTR2 register *******************/
  4726. #define FMC_BTR2_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  4727. #define FMC_BTR2_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4728. #define FMC_BTR2_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4729. #define FMC_BTR2_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  4730. #define FMC_BTR2_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  4731. #define FMC_BTR2_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  4732. #define FMC_BTR2_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4733. #define FMC_BTR2_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4734. #define FMC_BTR2_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  4735. #define FMC_BTR2_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  4736. #define FMC_BTR2_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  4737. #define FMC_BTR2_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  4738. #define FMC_BTR2_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  4739. #define FMC_BTR2_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  4740. #define FMC_BTR2_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  4741. #define FMC_BTR2_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  4742. #define FMC_BTR2_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  4743. #define FMC_BTR2_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  4744. #define FMC_BTR2_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  4745. #define FMC_BTR2_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround phase duration) */
  4746. #define FMC_BTR2_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  4747. #define FMC_BTR2_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  4748. #define FMC_BTR2_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  4749. #define FMC_BTR2_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  4750. #define FMC_BTR2_CLKDIV ((uint32_t)0x00F00000) /*!<CLKDIV[3:0] bits (Clock divide ratio) */
  4751. #define FMC_BTR2_CLKDIV_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  4752. #define FMC_BTR2_CLKDIV_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  4753. #define FMC_BTR2_CLKDIV_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  4754. #define FMC_BTR2_CLKDIV_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  4755. #define FMC_BTR2_DATLAT ((uint32_t)0x0F000000) /*!<DATLA[3:0] bits (Data latency) */
  4756. #define FMC_BTR2_DATLAT_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  4757. #define FMC_BTR2_DATLAT_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  4758. #define FMC_BTR2_DATLAT_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  4759. #define FMC_BTR2_DATLAT_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  4760. #define FMC_BTR2_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  4761. #define FMC_BTR2_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  4762. #define FMC_BTR2_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  4763. /******************* Bit definition for FMC_BTR3 register *******************/
  4764. #define FMC_BTR3_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  4765. #define FMC_BTR3_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4766. #define FMC_BTR3_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4767. #define FMC_BTR3_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  4768. #define FMC_BTR3_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  4769. #define FMC_BTR3_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  4770. #define FMC_BTR3_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4771. #define FMC_BTR3_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4772. #define FMC_BTR3_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  4773. #define FMC_BTR3_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  4774. #define FMC_BTR3_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  4775. #define FMC_BTR3_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  4776. #define FMC_BTR3_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  4777. #define FMC_BTR3_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  4778. #define FMC_BTR3_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  4779. #define FMC_BTR3_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  4780. #define FMC_BTR3_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  4781. #define FMC_BTR3_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  4782. #define FMC_BTR3_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  4783. #define FMC_BTR3_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround phase duration) */
  4784. #define FMC_BTR3_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  4785. #define FMC_BTR3_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  4786. #define FMC_BTR3_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  4787. #define FMC_BTR3_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  4788. #define FMC_BTR3_CLKDIV ((uint32_t)0x00F00000) /*!<CLKDIV[3:0] bits (Clock divide ratio) */
  4789. #define FMC_BTR3_CLKDIV_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  4790. #define FMC_BTR3_CLKDIV_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  4791. #define FMC_BTR3_CLKDIV_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  4792. #define FMC_BTR3_CLKDIV_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  4793. #define FMC_BTR3_DATLAT ((uint32_t)0x0F000000) /*!<DATLA[3:0] bits (Data latency) */
  4794. #define FMC_BTR3_DATLAT_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  4795. #define FMC_BTR3_DATLAT_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  4796. #define FMC_BTR3_DATLAT_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  4797. #define FMC_BTR3_DATLAT_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  4798. #define FMC_BTR3_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  4799. #define FMC_BTR3_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  4800. #define FMC_BTR3_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  4801. /****************** Bit definition for FMC_BTR4 register *******************/
  4802. #define FMC_BTR4_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  4803. #define FMC_BTR4_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4804. #define FMC_BTR4_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4805. #define FMC_BTR4_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  4806. #define FMC_BTR4_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  4807. #define FMC_BTR4_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  4808. #define FMC_BTR4_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4809. #define FMC_BTR4_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4810. #define FMC_BTR4_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  4811. #define FMC_BTR4_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  4812. #define FMC_BTR4_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  4813. #define FMC_BTR4_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  4814. #define FMC_BTR4_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  4815. #define FMC_BTR4_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  4816. #define FMC_BTR4_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  4817. #define FMC_BTR4_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  4818. #define FMC_BTR4_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  4819. #define FMC_BTR4_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  4820. #define FMC_BTR4_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  4821. #define FMC_BTR4_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround phase duration) */
  4822. #define FMC_BTR4_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  4823. #define FMC_BTR4_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  4824. #define FMC_BTR4_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  4825. #define FMC_BTR4_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  4826. #define FMC_BTR4_CLKDIV ((uint32_t)0x00F00000) /*!<CLKDIV[3:0] bits (Clock divide ratio) */
  4827. #define FMC_BTR4_CLKDIV_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  4828. #define FMC_BTR4_CLKDIV_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  4829. #define FMC_BTR4_CLKDIV_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  4830. #define FMC_BTR4_CLKDIV_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  4831. #define FMC_BTR4_DATLAT ((uint32_t)0x0F000000) /*!<DATLA[3:0] bits (Data latency) */
  4832. #define FMC_BTR4_DATLAT_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  4833. #define FMC_BTR4_DATLAT_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  4834. #define FMC_BTR4_DATLAT_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  4835. #define FMC_BTR4_DATLAT_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  4836. #define FMC_BTR4_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  4837. #define FMC_BTR4_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  4838. #define FMC_BTR4_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  4839. /****************** Bit definition for FMC_BWTR1 register ******************/
  4840. #define FMC_BWTR1_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  4841. #define FMC_BWTR1_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4842. #define FMC_BWTR1_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4843. #define FMC_BWTR1_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  4844. #define FMC_BWTR1_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  4845. #define FMC_BWTR1_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  4846. #define FMC_BWTR1_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4847. #define FMC_BWTR1_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4848. #define FMC_BWTR1_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  4849. #define FMC_BWTR1_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  4850. #define FMC_BWTR1_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  4851. #define FMC_BWTR1_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  4852. #define FMC_BWTR1_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  4853. #define FMC_BWTR1_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  4854. #define FMC_BWTR1_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  4855. #define FMC_BWTR1_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  4856. #define FMC_BWTR1_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  4857. #define FMC_BWTR1_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  4858. #define FMC_BWTR1_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  4859. #define FMC_BWTR1_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround duration) */
  4860. #define FMC_BWTR1_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  4861. #define FMC_BWTR1_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  4862. #define FMC_BWTR1_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  4863. #define FMC_BWTR1_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  4864. #define FMC_BWTR1_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  4865. #define FMC_BWTR1_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  4866. #define FMC_BWTR1_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  4867. /****************** Bit definition for FMC_BWTR2 register ******************/
  4868. #define FMC_BWTR2_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  4869. #define FMC_BWTR2_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4870. #define FMC_BWTR2_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4871. #define FMC_BWTR2_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  4872. #define FMC_BWTR2_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  4873. #define FMC_BWTR2_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  4874. #define FMC_BWTR2_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4875. #define FMC_BWTR2_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4876. #define FMC_BWTR2_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  4877. #define FMC_BWTR2_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  4878. #define FMC_BWTR2_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  4879. #define FMC_BWTR2_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  4880. #define FMC_BWTR2_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  4881. #define FMC_BWTR2_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  4882. #define FMC_BWTR2_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  4883. #define FMC_BWTR2_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  4884. #define FMC_BWTR2_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  4885. #define FMC_BWTR2_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  4886. #define FMC_BWTR2_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  4887. #define FMC_BWTR2_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround duration) */
  4888. #define FMC_BWTR2_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  4889. #define FMC_BWTR2_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  4890. #define FMC_BWTR2_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  4891. #define FMC_BWTR2_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  4892. #define FMC_BWTR2_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  4893. #define FMC_BWTR2_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  4894. #define FMC_BWTR2_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  4895. /****************** Bit definition for FMC_BWTR3 register ******************/
  4896. #define FMC_BWTR3_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  4897. #define FMC_BWTR3_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4898. #define FMC_BWTR3_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4899. #define FMC_BWTR3_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  4900. #define FMC_BWTR3_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  4901. #define FMC_BWTR3_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  4902. #define FMC_BWTR3_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4903. #define FMC_BWTR3_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4904. #define FMC_BWTR3_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  4905. #define FMC_BWTR3_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  4906. #define FMC_BWTR3_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  4907. #define FMC_BWTR3_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  4908. #define FMC_BWTR3_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  4909. #define FMC_BWTR3_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  4910. #define FMC_BWTR3_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  4911. #define FMC_BWTR3_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  4912. #define FMC_BWTR3_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  4913. #define FMC_BWTR3_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  4914. #define FMC_BWTR3_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  4915. #define FMC_BWTR3_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround duration) */
  4916. #define FMC_BWTR3_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  4917. #define FMC_BWTR3_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  4918. #define FMC_BWTR3_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  4919. #define FMC_BWTR3_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  4920. #define FMC_BWTR3_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  4921. #define FMC_BWTR3_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  4922. #define FMC_BWTR3_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  4923. /****************** Bit definition for FMC_BWTR4 register ******************/
  4924. #define FMC_BWTR4_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  4925. #define FMC_BWTR4_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4926. #define FMC_BWTR4_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4927. #define FMC_BWTR4_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  4928. #define FMC_BWTR4_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  4929. #define FMC_BWTR4_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  4930. #define FMC_BWTR4_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4931. #define FMC_BWTR4_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4932. #define FMC_BWTR4_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  4933. #define FMC_BWTR4_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  4934. #define FMC_BWTR4_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  4935. #define FMC_BWTR4_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  4936. #define FMC_BWTR4_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  4937. #define FMC_BWTR4_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  4938. #define FMC_BWTR4_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  4939. #define FMC_BWTR4_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  4940. #define FMC_BWTR4_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  4941. #define FMC_BWTR4_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  4942. #define FMC_BWTR4_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  4943. #define FMC_BWTR4_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround duration) */
  4944. #define FMC_BWTR4_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  4945. #define FMC_BWTR4_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  4946. #define FMC_BWTR4_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  4947. #define FMC_BWTR4_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  4948. #define FMC_BWTR4_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  4949. #define FMC_BWTR4_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  4950. #define FMC_BWTR4_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  4951. /****************** Bit definition for FMC_PCR register *******************/
  4952. #define FMC_PCR_PWAITEN ((uint32_t)0x00000002) /*!<Wait feature enable bit */
  4953. #define FMC_PCR_PBKEN ((uint32_t)0x00000004) /*!<PC Card/NAND Flash memory bank enable bit */
  4954. #define FMC_PCR_PTYP ((uint32_t)0x00000008) /*!<Memory type */
  4955. #define FMC_PCR_PWID ((uint32_t)0x00000030) /*!<PWID[1:0] bits (NAND Flash databus width) */
  4956. #define FMC_PCR_PWID_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4957. #define FMC_PCR_PWID_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4958. #define FMC_PCR_ECCEN ((uint32_t)0x00000040) /*!<ECC computation logic enable bit */
  4959. #define FMC_PCR_TCLR ((uint32_t)0x00001E00) /*!<TCLR[3:0] bits (CLE to RE delay) */
  4960. #define FMC_PCR_TCLR_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  4961. #define FMC_PCR_TCLR_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  4962. #define FMC_PCR_TCLR_2 ((uint32_t)0x00000800) /*!<Bit 2 */
  4963. #define FMC_PCR_TCLR_3 ((uint32_t)0x00001000) /*!<Bit 3 */
  4964. #define FMC_PCR_TAR ((uint32_t)0x0001E000) /*!<TAR[3:0] bits (ALE to RE delay) */
  4965. #define FMC_PCR_TAR_0 ((uint32_t)0x00002000) /*!<Bit 0 */
  4966. #define FMC_PCR_TAR_1 ((uint32_t)0x00004000) /*!<Bit 1 */
  4967. #define FMC_PCR_TAR_2 ((uint32_t)0x00008000) /*!<Bit 2 */
  4968. #define FMC_PCR_TAR_3 ((uint32_t)0x00010000) /*!<Bit 3 */
  4969. #define FMC_PCR_ECCPS ((uint32_t)0x000E0000) /*!<ECCPS[1:0] bits (ECC page size) */
  4970. #define FMC_PCR_ECCPS_0 ((uint32_t)0x00020000) /*!<Bit 0 */
  4971. #define FMC_PCR_ECCPS_1 ((uint32_t)0x00040000) /*!<Bit 1 */
  4972. #define FMC_PCR_ECCPS_2 ((uint32_t)0x00080000) /*!<Bit 2 */
  4973. /******************* Bit definition for FMC_SR register *******************/
  4974. #define FMC_SR_IRS ((uint32_t)0x01) /*!<Interrupt Rising Edge status */
  4975. #define FMC_SR_ILS ((uint32_t)0x02) /*!<Interrupt Level status */
  4976. #define FMC_SR_IFS ((uint32_t)0x04) /*!<Interrupt Falling Edge status */
  4977. #define FMC_SR_IREN ((uint32_t)0x08) /*!<Interrupt Rising Edge detection Enable bit */
  4978. #define FMC_SR_ILEN ((uint32_t)0x10) /*!<Interrupt Level detection Enable bit */
  4979. #define FMC_SR_IFEN ((uint32_t)0x20) /*!<Interrupt Falling Edge detection Enable bit */
  4980. #define FMC_SR_FEMPT ((uint32_t)0x40) /*!<FIFO empty */
  4981. /****************** Bit definition for FMC_PMEM register ******************/
  4982. #define FMC_PMEM_MEMSET2 ((uint32_t)0x000000FF) /*!<MEMSET2[7:0] bits (Common memory 2 setup time) */
  4983. #define FMC_PMEM_MEMSET2_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4984. #define FMC_PMEM_MEMSET2_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4985. #define FMC_PMEM_MEMSET2_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  4986. #define FMC_PMEM_MEMSET2_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  4987. #define FMC_PMEM_MEMSET2_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  4988. #define FMC_PMEM_MEMSET2_5 ((uint32_t)0x00000020) /*!<Bit 5 */
  4989. #define FMC_PMEM_MEMSET2_6 ((uint32_t)0x00000040) /*!<Bit 6 */
  4990. #define FMC_PMEM_MEMSET2_7 ((uint32_t)0x00000080) /*!<Bit 7 */
  4991. #define FMC_PMEM_MEMWAIT2 ((uint32_t)0x0000FF00) /*!<MEMWAIT2[7:0] bits (Common memory 2 wait time) */
  4992. #define FMC_PMEM_MEMWAIT2_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  4993. #define FMC_PMEM_MEMWAIT2_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  4994. #define FMC_PMEM_MEMWAIT2_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  4995. #define FMC_PMEM_MEMWAIT2_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  4996. #define FMC_PMEM_MEMWAIT2_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  4997. #define FMC_PMEM_MEMWAIT2_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  4998. #define FMC_PMEM_MEMWAIT2_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  4999. #define FMC_PMEM_MEMWAIT2_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  5000. #define FMC_PMEM_MEMHOLD2 ((uint32_t)0x00FF0000) /*!<MEMHOLD2[7:0] bits (Common memory 2 hold time) */
  5001. #define FMC_PMEM_MEMHOLD2_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  5002. #define FMC_PMEM_MEMHOLD2_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  5003. #define FMC_PMEM_MEMHOLD2_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  5004. #define FMC_PMEM_MEMHOLD2_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  5005. #define FMC_PMEM_MEMHOLD2_4 ((uint32_t)0x00100000) /*!<Bit 4 */
  5006. #define FMC_PMEM_MEMHOLD2_5 ((uint32_t)0x00200000) /*!<Bit 5 */
  5007. #define FMC_PMEM_MEMHOLD2_6 ((uint32_t)0x00400000) /*!<Bit 6 */
  5008. #define FMC_PMEM_MEMHOLD2_7 ((uint32_t)0x00800000) /*!<Bit 7 */
  5009. #define FMC_PMEM_MEMHIZ2 ((uint32_t)0xFF000000) /*!<MEMHIZ2[7:0] bits (Common memory 2 databus HiZ time) */
  5010. #define FMC_PMEM_MEMHIZ2_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  5011. #define FMC_PMEM_MEMHIZ2_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  5012. #define FMC_PMEM_MEMHIZ2_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  5013. #define FMC_PMEM_MEMHIZ2_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  5014. #define FMC_PMEM_MEMHIZ2_4 ((uint32_t)0x10000000) /*!<Bit 4 */
  5015. #define FMC_PMEM_MEMHIZ2_5 ((uint32_t)0x20000000) /*!<Bit 5 */
  5016. #define FMC_PMEM_MEMHIZ2_6 ((uint32_t)0x40000000) /*!<Bit 6 */
  5017. #define FMC_PMEM_MEMHIZ2_7 ((uint32_t)0x80000000) /*!<Bit 7 */
  5018. /****************** Bit definition for FMC_PATT register ******************/
  5019. #define FMC_PATT_ATTSET2 ((uint32_t)0x000000FF) /*!<ATTSET2[7:0] bits (Attribute memory 2 setup time) */
  5020. #define FMC_PATT_ATTSET2_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  5021. #define FMC_PATT_ATTSET2_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  5022. #define FMC_PATT_ATTSET2_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  5023. #define FMC_PATT_ATTSET2_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  5024. #define FMC_PATT_ATTSET2_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  5025. #define FMC_PATT_ATTSET2_5 ((uint32_t)0x00000020) /*!<Bit 5 */
  5026. #define FMC_PATT_ATTSET2_6 ((uint32_t)0x00000040) /*!<Bit 6 */
  5027. #define FMC_PATT_ATTSET2_7 ((uint32_t)0x00000080) /*!<Bit 7 */
  5028. #define FMC_PATT_ATTWAIT2 ((uint32_t)0x0000FF00) /*!<ATTWAIT2[7:0] bits (Attribute memory 2 wait time) */
  5029. #define FMC_PATT_ATTWAIT2_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  5030. #define FMC_PATT_ATTWAIT2_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  5031. #define FMC_PATT_ATTWAIT2_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  5032. #define FMC_PATT_ATTWAIT2_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  5033. #define FMC_PATT_ATTWAIT2_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  5034. #define FMC_PATT_ATTWAIT2_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  5035. #define FMC_PATT_ATTWAIT2_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  5036. #define FMC_PATT_ATTWAIT2_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  5037. #define FMC_PATT_ATTHOLD2 ((uint32_t)0x00FF0000) /*!<ATTHOLD2[7:0] bits (Attribute memory 2 hold time) */
  5038. #define FMC_PATT_ATTHOLD2_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  5039. #define FMC_PATT_ATTHOLD2_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  5040. #define FMC_PATT_ATTHOLD2_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  5041. #define FMC_PATT_ATTHOLD2_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  5042. #define FMC_PATT_ATTHOLD2_4 ((uint32_t)0x00100000) /*!<Bit 4 */
  5043. #define FMC_PATT_ATTHOLD2_5 ((uint32_t)0x00200000) /*!<Bit 5 */
  5044. #define FMC_PATT_ATTHOLD2_6 ((uint32_t)0x00400000) /*!<Bit 6 */
  5045. #define FMC_PATT_ATTHOLD2_7 ((uint32_t)0x00800000) /*!<Bit 7 */
  5046. #define FMC_PATT_ATTHIZ2 ((uint32_t)0xFF000000) /*!<ATTHIZ2[7:0] bits (Attribute memory 2 databus HiZ time) */
  5047. #define FMC_PATT_ATTHIZ2_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  5048. #define FMC_PATT_ATTHIZ2_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  5049. #define FMC_PATT_ATTHIZ2_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  5050. #define FMC_PATT_ATTHIZ2_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  5051. #define FMC_PATT_ATTHIZ2_4 ((uint32_t)0x10000000) /*!<Bit 4 */
  5052. #define FMC_PATT_ATTHIZ2_5 ((uint32_t)0x20000000) /*!<Bit 5 */
  5053. #define FMC_PATT_ATTHIZ2_6 ((uint32_t)0x40000000) /*!<Bit 6 */
  5054. #define FMC_PATT_ATTHIZ2_7 ((uint32_t)0x80000000) /*!<Bit 7 */
  5055. /****************** Bit definition for FMC_ECCR register ******************/
  5056. #define FMC_ECCR_ECC2 ((uint32_t)0xFFFFFFFF) /*!<ECC result */
  5057. /****************** Bit definition for FMC_SDCR1 register ******************/
  5058. #define FMC_SDCR1_NC ((uint32_t)0x00000003) /*!<NC[1:0] bits (Number of column bits) */
  5059. #define FMC_SDCR1_NC_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  5060. #define FMC_SDCR1_NC_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  5061. #define FMC_SDCR1_NR ((uint32_t)0x0000000C) /*!<NR[1:0] bits (Number of row bits) */
  5062. #define FMC_SDCR1_NR_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  5063. #define FMC_SDCR1_NR_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  5064. #define FMC_SDCR1_MWID ((uint32_t)0x00000030) /*!<NR[1:0] bits (Number of row bits) */
  5065. #define FMC_SDCR1_MWID_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  5066. #define FMC_SDCR1_MWID_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  5067. #define FMC_SDCR1_NB ((uint32_t)0x00000040) /*!<Number of internal bank */
  5068. #define FMC_SDCR1_CAS ((uint32_t)0x00000180) /*!<CAS[1:0] bits (CAS latency) */
  5069. #define FMC_SDCR1_CAS_0 ((uint32_t)0x00000080) /*!<Bit 0 */
  5070. #define FMC_SDCR1_CAS_1 ((uint32_t)0x00000100) /*!<Bit 1 */
  5071. #define FMC_SDCR1_WP ((uint32_t)0x00000200) /*!<Write protection */
  5072. #define FMC_SDCR1_SDCLK ((uint32_t)0x00000C00) /*!<SDRAM clock configuration */
  5073. #define FMC_SDCR1_SDCLK_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  5074. #define FMC_SDCR1_SDCLK_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  5075. #define FMC_SDCR1_RBURST ((uint32_t)0x00001000) /*!<Read burst */
  5076. #define FMC_SDCR1_RPIPE ((uint32_t)0x00006000) /*!<Write protection */
  5077. #define FMC_SDCR1_RPIPE_0 ((uint32_t)0x00002000) /*!<Bit 0 */
  5078. #define FMC_SDCR1_RPIPE_1 ((uint32_t)0x00004000) /*!<Bit 1 */
  5079. /****************** Bit definition for FMC_SDCR2 register ******************/
  5080. #define FMC_SDCR2_NC ((uint32_t)0x00000003) /*!<NC[1:0] bits (Number of column bits) */
  5081. #define FMC_SDCR2_NC_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  5082. #define FMC_SDCR2_NC_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  5083. #define FMC_SDCR2_NR ((uint32_t)0x0000000C) /*!<NR[1:0] bits (Number of row bits) */
  5084. #define FMC_SDCR2_NR_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  5085. #define FMC_SDCR2_NR_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  5086. #define FMC_SDCR2_MWID ((uint32_t)0x00000030) /*!<NR[1:0] bits (Number of row bits) */
  5087. #define FMC_SDCR2_MWID_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  5088. #define FMC_SDCR2_MWID_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  5089. #define FMC_SDCR2_NB ((uint32_t)0x00000040) /*!<Number of internal bank */
  5090. #define FMC_SDCR2_CAS ((uint32_t)0x00000180) /*!<CAS[1:0] bits (CAS latency) */
  5091. #define FMC_SDCR2_CAS_0 ((uint32_t)0x00000080) /*!<Bit 0 */
  5092. #define FMC_SDCR2_CAS_1 ((uint32_t)0x00000100) /*!<Bit 1 */
  5093. #define FMC_SDCR2_WP ((uint32_t)0x00000200) /*!<Write protection */
  5094. #define FMC_SDCR2_SDCLK ((uint32_t)0x00000C00) /*!<SDCLK[1:0] (SDRAM clock configuration) */
  5095. #define FMC_SDCR2_SDCLK_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  5096. #define FMC_SDCR2_SDCLK_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  5097. #define FMC_SDCR2_RBURST ((uint32_t)0x00001000) /*!<Read burst */
  5098. #define FMC_SDCR2_RPIPE ((uint32_t)0x00006000) /*!<RPIPE[1:0](Read pipe) */
  5099. #define FMC_SDCR2_RPIPE_0 ((uint32_t)0x00002000) /*!<Bit 0 */
  5100. #define FMC_SDCR2_RPIPE_1 ((uint32_t)0x00004000) /*!<Bit 1 */
  5101. /****************** Bit definition for FMC_SDTR1 register ******************/
  5102. #define FMC_SDTR1_TMRD ((uint32_t)0x0000000F) /*!<TMRD[3:0] bits (Load mode register to active) */
  5103. #define FMC_SDTR1_TMRD_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  5104. #define FMC_SDTR1_TMRD_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  5105. #define FMC_SDTR1_TMRD_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  5106. #define FMC_SDTR1_TMRD_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  5107. #define FMC_SDTR1_TXSR ((uint32_t)0x000000F0) /*!<TXSR[3:0] bits (Exit self refresh) */
  5108. #define FMC_SDTR1_TXSR_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  5109. #define FMC_SDTR1_TXSR_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  5110. #define FMC_SDTR1_TXSR_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  5111. #define FMC_SDTR1_TXSR_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  5112. #define FMC_SDTR1_TRAS ((uint32_t)0x00000F00) /*!<TRAS[3:0] bits (Self refresh time) */
  5113. #define FMC_SDTR1_TRAS_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  5114. #define FMC_SDTR1_TRAS_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  5115. #define FMC_SDTR1_TRAS_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  5116. #define FMC_SDTR1_TRAS_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  5117. #define FMC_SDTR1_TRC ((uint32_t)0x0000F000) /*!<TRC[2:0] bits (Row cycle delay) */
  5118. #define FMC_SDTR1_TRC_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  5119. #define FMC_SDTR1_TRC_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  5120. #define FMC_SDTR1_TRC_2 ((uint32_t)0x00004000) /*!<Bit 2 */
  5121. #define FMC_SDTR1_TWR ((uint32_t)0x000F0000) /*!<TRC[2:0] bits (Write recovery delay) */
  5122. #define FMC_SDTR1_TWR_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  5123. #define FMC_SDTR1_TWR_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  5124. #define FMC_SDTR1_TWR_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  5125. #define FMC_SDTR1_TRP ((uint32_t)0x00F00000) /*!<TRP[2:0] bits (Row precharge delay) */
  5126. #define FMC_SDTR1_TRP_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  5127. #define FMC_SDTR1_TRP_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  5128. #define FMC_SDTR1_TRP_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  5129. #define FMC_SDTR1_TRCD ((uint32_t)0x0F000000) /*!<TRP[2:0] bits (Row to column delay) */
  5130. #define FMC_SDTR1_TRCD_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  5131. #define FMC_SDTR1_TRCD_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  5132. #define FMC_SDTR1_TRCD_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  5133. /****************** Bit definition for FMC_SDTR2 register ******************/
  5134. #define FMC_SDTR2_TMRD ((uint32_t)0x0000000F) /*!<TMRD[3:0] bits (Load mode register to active) */
  5135. #define FMC_SDTR2_TMRD_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  5136. #define FMC_SDTR2_TMRD_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  5137. #define FMC_SDTR2_TMRD_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  5138. #define FMC_SDTR2_TMRD_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  5139. #define FMC_SDTR2_TXSR ((uint32_t)0x000000F0) /*!<TXSR[3:0] bits (Exit self refresh) */
  5140. #define FMC_SDTR2_TXSR_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  5141. #define FMC_SDTR2_TXSR_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  5142. #define FMC_SDTR2_TXSR_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  5143. #define FMC_SDTR2_TXSR_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  5144. #define FMC_SDTR2_TRAS ((uint32_t)0x00000F00) /*!<TRAS[3:0] bits (Self refresh time) */
  5145. #define FMC_SDTR2_TRAS_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  5146. #define FMC_SDTR2_TRAS_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  5147. #define FMC_SDTR2_TRAS_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  5148. #define FMC_SDTR2_TRAS_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  5149. #define FMC_SDTR2_TRC ((uint32_t)0x0000F000) /*!<TRC[2:0] bits (Row cycle delay) */
  5150. #define FMC_SDTR2_TRC_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  5151. #define FMC_SDTR2_TRC_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  5152. #define FMC_SDTR2_TRC_2 ((uint32_t)0x00004000) /*!<Bit 2 */
  5153. #define FMC_SDTR2_TWR ((uint32_t)0x000F0000) /*!<TRC[2:0] bits (Write recovery delay) */
  5154. #define FMC_SDTR2_TWR_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  5155. #define FMC_SDTR2_TWR_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  5156. #define FMC_SDTR2_TWR_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  5157. #define FMC_SDTR2_TRP ((uint32_t)0x00F00000) /*!<TRP[2:0] bits (Row precharge delay) */
  5158. #define FMC_SDTR2_TRP_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  5159. #define FMC_SDTR2_TRP_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  5160. #define FMC_SDTR2_TRP_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  5161. #define FMC_SDTR2_TRCD ((uint32_t)0x0F000000) /*!<TRP[2:0] bits (Row to column delay) */
  5162. #define FMC_SDTR2_TRCD_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  5163. #define FMC_SDTR2_TRCD_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  5164. #define FMC_SDTR2_TRCD_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  5165. /****************** Bit definition for FMC_SDCMR register ******************/
  5166. #define FMC_SDCMR_MODE ((uint32_t)0x00000007) /*!<MODE[2:0] bits (Command mode) */
  5167. #define FMC_SDCMR_MODE_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  5168. #define FMC_SDCMR_MODE_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  5169. #define FMC_SDCMR_MODE_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  5170. #define FMC_SDCMR_CTB2 ((uint32_t)0x00000008) /*!<Command target 2 */
  5171. #define FMC_SDCMR_CTB1 ((uint32_t)0x00000010) /*!<Command target 1 */
  5172. #define FMC_SDCMR_NRFS ((uint32_t)0x000001E0) /*!<NRFS[3:0] bits (Number of auto-refresh) */
  5173. #define FMC_SDCMR_NRFS_0 ((uint32_t)0x00000020) /*!<Bit 0 */
  5174. #define FMC_SDCMR_NRFS_1 ((uint32_t)0x00000040) /*!<Bit 1 */
  5175. #define FMC_SDCMR_NRFS_2 ((uint32_t)0x00000080) /*!<Bit 2 */
  5176. #define FMC_SDCMR_NRFS_3 ((uint32_t)0x00000100) /*!<Bit 3 */
  5177. #define FMC_SDCMR_MRD ((uint32_t)0x003FFE00) /*!<MRD[12:0] bits (Mode register definition) */
  5178. /****************** Bit definition for FMC_SDRTR register ******************/
  5179. #define FMC_SDRTR_CRE ((uint32_t)0x00000001) /*!<Clear refresh error flag */
  5180. #define FMC_SDRTR_COUNT ((uint32_t)0x00003FFE) /*!<COUNT[12:0] bits (Refresh timer count) */
  5181. #define FMC_SDRTR_REIE ((uint32_t)0x00004000) /*!<RES interupt enable */
  5182. /****************** Bit definition for FMC_SDSR register ******************/
  5183. #define FMC_SDSR_RE ((uint32_t)0x00000001) /*!<Refresh error flag */
  5184. #define FMC_SDSR_MODES1 ((uint32_t)0x00000006) /*!<MODES1[1:0]bits (Status mode for bank 1) */
  5185. #define FMC_SDSR_MODES1_0 ((uint32_t)0x00000002) /*!<Bit 0 */
  5186. #define FMC_SDSR_MODES1_1 ((uint32_t)0x00000004) /*!<Bit 1 */
  5187. #define FMC_SDSR_MODES2 ((uint32_t)0x00000018) /*!<MODES2[1:0]bits (Status mode for bank 2) */
  5188. #define FMC_SDSR_MODES2_0 ((uint32_t)0x00000008) /*!<Bit 0 */
  5189. #define FMC_SDSR_MODES2_1 ((uint32_t)0x00000010) /*!<Bit 1 */
  5190. #define FMC_SDSR_BUSY ((uint32_t)0x00000020) /*!<Busy status */
  5191. /******************************************************************************/
  5192. /* */
  5193. /* General Purpose I/O */
  5194. /* */
  5195. /******************************************************************************/
  5196. /****************** Bits definition for GPIO_MODER register *****************/
  5197. #define GPIO_MODER_MODER0 ((uint32_t)0x00000003)
  5198. #define GPIO_MODER_MODER0_0 ((uint32_t)0x00000001)
  5199. #define GPIO_MODER_MODER0_1 ((uint32_t)0x00000002)
  5200. #define GPIO_MODER_MODER1 ((uint32_t)0x0000000C)
  5201. #define GPIO_MODER_MODER1_0 ((uint32_t)0x00000004)
  5202. #define GPIO_MODER_MODER1_1 ((uint32_t)0x00000008)
  5203. #define GPIO_MODER_MODER2 ((uint32_t)0x00000030)
  5204. #define GPIO_MODER_MODER2_0 ((uint32_t)0x00000010)
  5205. #define GPIO_MODER_MODER2_1 ((uint32_t)0x00000020)
  5206. #define GPIO_MODER_MODER3 ((uint32_t)0x000000C0)
  5207. #define GPIO_MODER_MODER3_0 ((uint32_t)0x00000040)
  5208. #define GPIO_MODER_MODER3_1 ((uint32_t)0x00000080)
  5209. #define GPIO_MODER_MODER4 ((uint32_t)0x00000300)
  5210. #define GPIO_MODER_MODER4_0 ((uint32_t)0x00000100)
  5211. #define GPIO_MODER_MODER4_1 ((uint32_t)0x00000200)
  5212. #define GPIO_MODER_MODER5 ((uint32_t)0x00000C00)
  5213. #define GPIO_MODER_MODER5_0 ((uint32_t)0x00000400)
  5214. #define GPIO_MODER_MODER5_1 ((uint32_t)0x00000800)
  5215. #define GPIO_MODER_MODER6 ((uint32_t)0x00003000)
  5216. #define GPIO_MODER_MODER6_0 ((uint32_t)0x00001000)
  5217. #define GPIO_MODER_MODER6_1 ((uint32_t)0x00002000)
  5218. #define GPIO_MODER_MODER7 ((uint32_t)0x0000C000)
  5219. #define GPIO_MODER_MODER7_0 ((uint32_t)0x00004000)
  5220. #define GPIO_MODER_MODER7_1 ((uint32_t)0x00008000)
  5221. #define GPIO_MODER_MODER8 ((uint32_t)0x00030000)
  5222. #define GPIO_MODER_MODER8_0 ((uint32_t)0x00010000)
  5223. #define GPIO_MODER_MODER8_1 ((uint32_t)0x00020000)
  5224. #define GPIO_MODER_MODER9 ((uint32_t)0x000C0000)
  5225. #define GPIO_MODER_MODER9_0 ((uint32_t)0x00040000)
  5226. #define GPIO_MODER_MODER9_1 ((uint32_t)0x00080000)
  5227. #define GPIO_MODER_MODER10 ((uint32_t)0x00300000)
  5228. #define GPIO_MODER_MODER10_0 ((uint32_t)0x00100000)
  5229. #define GPIO_MODER_MODER10_1 ((uint32_t)0x00200000)
  5230. #define GPIO_MODER_MODER11 ((uint32_t)0x00C00000)
  5231. #define GPIO_MODER_MODER11_0 ((uint32_t)0x00400000)
  5232. #define GPIO_MODER_MODER11_1 ((uint32_t)0x00800000)
  5233. #define GPIO_MODER_MODER12 ((uint32_t)0x03000000)
  5234. #define GPIO_MODER_MODER12_0 ((uint32_t)0x01000000)
  5235. #define GPIO_MODER_MODER12_1 ((uint32_t)0x02000000)
  5236. #define GPIO_MODER_MODER13 ((uint32_t)0x0C000000)
  5237. #define GPIO_MODER_MODER13_0 ((uint32_t)0x04000000)
  5238. #define GPIO_MODER_MODER13_1 ((uint32_t)0x08000000)
  5239. #define GPIO_MODER_MODER14 ((uint32_t)0x30000000)
  5240. #define GPIO_MODER_MODER14_0 ((uint32_t)0x10000000)
  5241. #define GPIO_MODER_MODER14_1 ((uint32_t)0x20000000)
  5242. #define GPIO_MODER_MODER15 ((uint32_t)0xC0000000)
  5243. #define GPIO_MODER_MODER15_0 ((uint32_t)0x40000000)
  5244. #define GPIO_MODER_MODER15_1 ((uint32_t)0x80000000)
  5245. /****************** Bits definition for GPIO_OTYPER register ****************/
  5246. #define GPIO_OTYPER_OT_0 ((uint32_t)0x00000001)
  5247. #define GPIO_OTYPER_OT_1 ((uint32_t)0x00000002)
  5248. #define GPIO_OTYPER_OT_2 ((uint32_t)0x00000004)
  5249. #define GPIO_OTYPER_OT_3 ((uint32_t)0x00000008)
  5250. #define GPIO_OTYPER_OT_4 ((uint32_t)0x00000010)
  5251. #define GPIO_OTYPER_OT_5 ((uint32_t)0x00000020)
  5252. #define GPIO_OTYPER_OT_6 ((uint32_t)0x00000040)
  5253. #define GPIO_OTYPER_OT_7 ((uint32_t)0x00000080)
  5254. #define GPIO_OTYPER_OT_8 ((uint32_t)0x00000100)
  5255. #define GPIO_OTYPER_OT_9 ((uint32_t)0x00000200)
  5256. #define GPIO_OTYPER_OT_10 ((uint32_t)0x00000400)
  5257. #define GPIO_OTYPER_OT_11 ((uint32_t)0x00000800)
  5258. #define GPIO_OTYPER_OT_12 ((uint32_t)0x00001000)
  5259. #define GPIO_OTYPER_OT_13 ((uint32_t)0x00002000)
  5260. #define GPIO_OTYPER_OT_14 ((uint32_t)0x00004000)
  5261. #define GPIO_OTYPER_OT_15 ((uint32_t)0x00008000)
  5262. /****************** Bits definition for GPIO_OSPEEDR register ***************/
  5263. #define GPIO_OSPEEDER_OSPEEDR0 ((uint32_t)0x00000003)
  5264. #define GPIO_OSPEEDER_OSPEEDR0_0 ((uint32_t)0x00000001)
  5265. #define GPIO_OSPEEDER_OSPEEDR0_1 ((uint32_t)0x00000002)
  5266. #define GPIO_OSPEEDER_OSPEEDR1 ((uint32_t)0x0000000C)
  5267. #define GPIO_OSPEEDER_OSPEEDR1_0 ((uint32_t)0x00000004)
  5268. #define GPIO_OSPEEDER_OSPEEDR1_1 ((uint32_t)0x00000008)
  5269. #define GPIO_OSPEEDER_OSPEEDR2 ((uint32_t)0x00000030)
  5270. #define GPIO_OSPEEDER_OSPEEDR2_0 ((uint32_t)0x00000010)
  5271. #define GPIO_OSPEEDER_OSPEEDR2_1 ((uint32_t)0x00000020)
  5272. #define GPIO_OSPEEDER_OSPEEDR3 ((uint32_t)0x000000C0)
  5273. #define GPIO_OSPEEDER_OSPEEDR3_0 ((uint32_t)0x00000040)
  5274. #define GPIO_OSPEEDER_OSPEEDR3_1 ((uint32_t)0x00000080)
  5275. #define GPIO_OSPEEDER_OSPEEDR4 ((uint32_t)0x00000300)
  5276. #define GPIO_OSPEEDER_OSPEEDR4_0 ((uint32_t)0x00000100)
  5277. #define GPIO_OSPEEDER_OSPEEDR4_1 ((uint32_t)0x00000200)
  5278. #define GPIO_OSPEEDER_OSPEEDR5 ((uint32_t)0x00000C00)
  5279. #define GPIO_OSPEEDER_OSPEEDR5_0 ((uint32_t)0x00000400)
  5280. #define GPIO_OSPEEDER_OSPEEDR5_1 ((uint32_t)0x00000800)
  5281. #define GPIO_OSPEEDER_OSPEEDR6 ((uint32_t)0x00003000)
  5282. #define GPIO_OSPEEDER_OSPEEDR6_0 ((uint32_t)0x00001000)
  5283. #define GPIO_OSPEEDER_OSPEEDR6_1 ((uint32_t)0x00002000)
  5284. #define GPIO_OSPEEDER_OSPEEDR7 ((uint32_t)0x0000C000)
  5285. #define GPIO_OSPEEDER_OSPEEDR7_0 ((uint32_t)0x00004000)
  5286. #define GPIO_OSPEEDER_OSPEEDR7_1 ((uint32_t)0x00008000)
  5287. #define GPIO_OSPEEDER_OSPEEDR8 ((uint32_t)0x00030000)
  5288. #define GPIO_OSPEEDER_OSPEEDR8_0 ((uint32_t)0x00010000)
  5289. #define GPIO_OSPEEDER_OSPEEDR8_1 ((uint32_t)0x00020000)
  5290. #define GPIO_OSPEEDER_OSPEEDR9 ((uint32_t)0x000C0000)
  5291. #define GPIO_OSPEEDER_OSPEEDR9_0 ((uint32_t)0x00040000)
  5292. #define GPIO_OSPEEDER_OSPEEDR9_1 ((uint32_t)0x00080000)
  5293. #define GPIO_OSPEEDER_OSPEEDR10 ((uint32_t)0x00300000)
  5294. #define GPIO_OSPEEDER_OSPEEDR10_0 ((uint32_t)0x00100000)
  5295. #define GPIO_OSPEEDER_OSPEEDR10_1 ((uint32_t)0x00200000)
  5296. #define GPIO_OSPEEDER_OSPEEDR11 ((uint32_t)0x00C00000)
  5297. #define GPIO_OSPEEDER_OSPEEDR11_0 ((uint32_t)0x00400000)
  5298. #define GPIO_OSPEEDER_OSPEEDR11_1 ((uint32_t)0x00800000)
  5299. #define GPIO_OSPEEDER_OSPEEDR12 ((uint32_t)0x03000000)
  5300. #define GPIO_OSPEEDER_OSPEEDR12_0 ((uint32_t)0x01000000)
  5301. #define GPIO_OSPEEDER_OSPEEDR12_1 ((uint32_t)0x02000000)
  5302. #define GPIO_OSPEEDER_OSPEEDR13 ((uint32_t)0x0C000000)
  5303. #define GPIO_OSPEEDER_OSPEEDR13_0 ((uint32_t)0x04000000)
  5304. #define GPIO_OSPEEDER_OSPEEDR13_1 ((uint32_t)0x08000000)
  5305. #define GPIO_OSPEEDER_OSPEEDR14 ((uint32_t)0x30000000)
  5306. #define GPIO_OSPEEDER_OSPEEDR14_0 ((uint32_t)0x10000000)
  5307. #define GPIO_OSPEEDER_OSPEEDR14_1 ((uint32_t)0x20000000)
  5308. #define GPIO_OSPEEDER_OSPEEDR15 ((uint32_t)0xC0000000)
  5309. #define GPIO_OSPEEDER_OSPEEDR15_0 ((uint32_t)0x40000000)
  5310. #define GPIO_OSPEEDER_OSPEEDR15_1 ((uint32_t)0x80000000)
  5311. /****************** Bits definition for GPIO_PUPDR register *****************/
  5312. #define GPIO_PUPDR_PUPDR0 ((uint32_t)0x00000003)
  5313. #define GPIO_PUPDR_PUPDR0_0 ((uint32_t)0x00000001)
  5314. #define GPIO_PUPDR_PUPDR0_1 ((uint32_t)0x00000002)
  5315. #define GPIO_PUPDR_PUPDR1 ((uint32_t)0x0000000C)
  5316. #define GPIO_PUPDR_PUPDR1_0 ((uint32_t)0x00000004)
  5317. #define GPIO_PUPDR_PUPDR1_1 ((uint32_t)0x00000008)
  5318. #define GPIO_PUPDR_PUPDR2 ((uint32_t)0x00000030)
  5319. #define GPIO_PUPDR_PUPDR2_0 ((uint32_t)0x00000010)
  5320. #define GPIO_PUPDR_PUPDR2_1 ((uint32_t)0x00000020)
  5321. #define GPIO_PUPDR_PUPDR3 ((uint32_t)0x000000C0)
  5322. #define GPIO_PUPDR_PUPDR3_0 ((uint32_t)0x00000040)
  5323. #define GPIO_PUPDR_PUPDR3_1 ((uint32_t)0x00000080)
  5324. #define GPIO_PUPDR_PUPDR4 ((uint32_t)0x00000300)
  5325. #define GPIO_PUPDR_PUPDR4_0 ((uint32_t)0x00000100)
  5326. #define GPIO_PUPDR_PUPDR4_1 ((uint32_t)0x00000200)
  5327. #define GPIO_PUPDR_PUPDR5 ((uint32_t)0x00000C00)
  5328. #define GPIO_PUPDR_PUPDR5_0 ((uint32_t)0x00000400)
  5329. #define GPIO_PUPDR_PUPDR5_1 ((uint32_t)0x00000800)
  5330. #define GPIO_PUPDR_PUPDR6 ((uint32_t)0x00003000)
  5331. #define GPIO_PUPDR_PUPDR6_0 ((uint32_t)0x00001000)
  5332. #define GPIO_PUPDR_PUPDR6_1 ((uint32_t)0x00002000)
  5333. #define GPIO_PUPDR_PUPDR7 ((uint32_t)0x0000C000)
  5334. #define GPIO_PUPDR_PUPDR7_0 ((uint32_t)0x00004000)
  5335. #define GPIO_PUPDR_PUPDR7_1 ((uint32_t)0x00008000)
  5336. #define GPIO_PUPDR_PUPDR8 ((uint32_t)0x00030000)
  5337. #define GPIO_PUPDR_PUPDR8_0 ((uint32_t)0x00010000)
  5338. #define GPIO_PUPDR_PUPDR8_1 ((uint32_t)0x00020000)
  5339. #define GPIO_PUPDR_PUPDR9 ((uint32_t)0x000C0000)
  5340. #define GPIO_PUPDR_PUPDR9_0 ((uint32_t)0x00040000)
  5341. #define GPIO_PUPDR_PUPDR9_1 ((uint32_t)0x00080000)
  5342. #define GPIO_PUPDR_PUPDR10 ((uint32_t)0x00300000)
  5343. #define GPIO_PUPDR_PUPDR10_0 ((uint32_t)0x00100000)
  5344. #define GPIO_PUPDR_PUPDR10_1 ((uint32_t)0x00200000)
  5345. #define GPIO_PUPDR_PUPDR11 ((uint32_t)0x00C00000)
  5346. #define GPIO_PUPDR_PUPDR11_0 ((uint32_t)0x00400000)
  5347. #define GPIO_PUPDR_PUPDR11_1 ((uint32_t)0x00800000)
  5348. #define GPIO_PUPDR_PUPDR12 ((uint32_t)0x03000000)
  5349. #define GPIO_PUPDR_PUPDR12_0 ((uint32_t)0x01000000)
  5350. #define GPIO_PUPDR_PUPDR12_1 ((uint32_t)0x02000000)
  5351. #define GPIO_PUPDR_PUPDR13 ((uint32_t)0x0C000000)
  5352. #define GPIO_PUPDR_PUPDR13_0 ((uint32_t)0x04000000)
  5353. #define GPIO_PUPDR_PUPDR13_1 ((uint32_t)0x08000000)
  5354. #define GPIO_PUPDR_PUPDR14 ((uint32_t)0x30000000)
  5355. #define GPIO_PUPDR_PUPDR14_0 ((uint32_t)0x10000000)
  5356. #define GPIO_PUPDR_PUPDR14_1 ((uint32_t)0x20000000)
  5357. #define GPIO_PUPDR_PUPDR15 ((uint32_t)0xC0000000)
  5358. #define GPIO_PUPDR_PUPDR15_0 ((uint32_t)0x40000000)
  5359. #define GPIO_PUPDR_PUPDR15_1 ((uint32_t)0x80000000)
  5360. /****************** Bits definition for GPIO_IDR register *******************/
  5361. #define GPIO_IDR_IDR_0 ((uint32_t)0x00000001)
  5362. #define GPIO_IDR_IDR_1 ((uint32_t)0x00000002)
  5363. #define GPIO_IDR_IDR_2 ((uint32_t)0x00000004)
  5364. #define GPIO_IDR_IDR_3 ((uint32_t)0x00000008)
  5365. #define GPIO_IDR_IDR_4 ((uint32_t)0x00000010)
  5366. #define GPIO_IDR_IDR_5 ((uint32_t)0x00000020)
  5367. #define GPIO_IDR_IDR_6 ((uint32_t)0x00000040)
  5368. #define GPIO_IDR_IDR_7 ((uint32_t)0x00000080)
  5369. #define GPIO_IDR_IDR_8 ((uint32_t)0x00000100)
  5370. #define GPIO_IDR_IDR_9 ((uint32_t)0x00000200)
  5371. #define GPIO_IDR_IDR_10 ((uint32_t)0x00000400)
  5372. #define GPIO_IDR_IDR_11 ((uint32_t)0x00000800)
  5373. #define GPIO_IDR_IDR_12 ((uint32_t)0x00001000)
  5374. #define GPIO_IDR_IDR_13 ((uint32_t)0x00002000)
  5375. #define GPIO_IDR_IDR_14 ((uint32_t)0x00004000)
  5376. #define GPIO_IDR_IDR_15 ((uint32_t)0x00008000)
  5377. /* Old GPIO_IDR register bits definition, maintained for legacy purpose */
  5378. #define GPIO_OTYPER_IDR_0 GPIO_IDR_IDR_0
  5379. #define GPIO_OTYPER_IDR_1 GPIO_IDR_IDR_1
  5380. #define GPIO_OTYPER_IDR_2 GPIO_IDR_IDR_2
  5381. #define GPIO_OTYPER_IDR_3 GPIO_IDR_IDR_3
  5382. #define GPIO_OTYPER_IDR_4 GPIO_IDR_IDR_4
  5383. #define GPIO_OTYPER_IDR_5 GPIO_IDR_IDR_5
  5384. #define GPIO_OTYPER_IDR_6 GPIO_IDR_IDR_6
  5385. #define GPIO_OTYPER_IDR_7 GPIO_IDR_IDR_7
  5386. #define GPIO_OTYPER_IDR_8 GPIO_IDR_IDR_8
  5387. #define GPIO_OTYPER_IDR_9 GPIO_IDR_IDR_9
  5388. #define GPIO_OTYPER_IDR_10 GPIO_IDR_IDR_10
  5389. #define GPIO_OTYPER_IDR_11 GPIO_IDR_IDR_11
  5390. #define GPIO_OTYPER_IDR_12 GPIO_IDR_IDR_12
  5391. #define GPIO_OTYPER_IDR_13 GPIO_IDR_IDR_13
  5392. #define GPIO_OTYPER_IDR_14 GPIO_IDR_IDR_14
  5393. #define GPIO_OTYPER_IDR_15 GPIO_IDR_IDR_15
  5394. /****************** Bits definition for GPIO_ODR register *******************/
  5395. #define GPIO_ODR_ODR_0 ((uint32_t)0x00000001)
  5396. #define GPIO_ODR_ODR_1 ((uint32_t)0x00000002)
  5397. #define GPIO_ODR_ODR_2 ((uint32_t)0x00000004)
  5398. #define GPIO_ODR_ODR_3 ((uint32_t)0x00000008)
  5399. #define GPIO_ODR_ODR_4 ((uint32_t)0x00000010)
  5400. #define GPIO_ODR_ODR_5 ((uint32_t)0x00000020)
  5401. #define GPIO_ODR_ODR_6 ((uint32_t)0x00000040)
  5402. #define GPIO_ODR_ODR_7 ((uint32_t)0x00000080)
  5403. #define GPIO_ODR_ODR_8 ((uint32_t)0x00000100)
  5404. #define GPIO_ODR_ODR_9 ((uint32_t)0x00000200)
  5405. #define GPIO_ODR_ODR_10 ((uint32_t)0x00000400)
  5406. #define GPIO_ODR_ODR_11 ((uint32_t)0x00000800)
  5407. #define GPIO_ODR_ODR_12 ((uint32_t)0x00001000)
  5408. #define GPIO_ODR_ODR_13 ((uint32_t)0x00002000)
  5409. #define GPIO_ODR_ODR_14 ((uint32_t)0x00004000)
  5410. #define GPIO_ODR_ODR_15 ((uint32_t)0x00008000)
  5411. /* Old GPIO_ODR register bits definition, maintained for legacy purpose */
  5412. #define GPIO_OTYPER_ODR_0 GPIO_ODR_ODR_0
  5413. #define GPIO_OTYPER_ODR_1 GPIO_ODR_ODR_1
  5414. #define GPIO_OTYPER_ODR_2 GPIO_ODR_ODR_2
  5415. #define GPIO_OTYPER_ODR_3 GPIO_ODR_ODR_3
  5416. #define GPIO_OTYPER_ODR_4 GPIO_ODR_ODR_4
  5417. #define GPIO_OTYPER_ODR_5 GPIO_ODR_ODR_5
  5418. #define GPIO_OTYPER_ODR_6 GPIO_ODR_ODR_6
  5419. #define GPIO_OTYPER_ODR_7 GPIO_ODR_ODR_7
  5420. #define GPIO_OTYPER_ODR_8 GPIO_ODR_ODR_8
  5421. #define GPIO_OTYPER_ODR_9 GPIO_ODR_ODR_9
  5422. #define GPIO_OTYPER_ODR_10 GPIO_ODR_ODR_10
  5423. #define GPIO_OTYPER_ODR_11 GPIO_ODR_ODR_11
  5424. #define GPIO_OTYPER_ODR_12 GPIO_ODR_ODR_12
  5425. #define GPIO_OTYPER_ODR_13 GPIO_ODR_ODR_13
  5426. #define GPIO_OTYPER_ODR_14 GPIO_ODR_ODR_14
  5427. #define GPIO_OTYPER_ODR_15 GPIO_ODR_ODR_15
  5428. /****************** Bits definition for GPIO_BSRR register ******************/
  5429. #define GPIO_BSRR_BS_0 ((uint32_t)0x00000001)
  5430. #define GPIO_BSRR_BS_1 ((uint32_t)0x00000002)
  5431. #define GPIO_BSRR_BS_2 ((uint32_t)0x00000004)
  5432. #define GPIO_BSRR_BS_3 ((uint32_t)0x00000008)
  5433. #define GPIO_BSRR_BS_4 ((uint32_t)0x00000010)
  5434. #define GPIO_BSRR_BS_5 ((uint32_t)0x00000020)
  5435. #define GPIO_BSRR_BS_6 ((uint32_t)0x00000040)
  5436. #define GPIO_BSRR_BS_7 ((uint32_t)0x00000080)
  5437. #define GPIO_BSRR_BS_8 ((uint32_t)0x00000100)
  5438. #define GPIO_BSRR_BS_9 ((uint32_t)0x00000200)
  5439. #define GPIO_BSRR_BS_10 ((uint32_t)0x00000400)
  5440. #define GPIO_BSRR_BS_11 ((uint32_t)0x00000800)
  5441. #define GPIO_BSRR_BS_12 ((uint32_t)0x00001000)
  5442. #define GPIO_BSRR_BS_13 ((uint32_t)0x00002000)
  5443. #define GPIO_BSRR_BS_14 ((uint32_t)0x00004000)
  5444. #define GPIO_BSRR_BS_15 ((uint32_t)0x00008000)
  5445. #define GPIO_BSRR_BR_0 ((uint32_t)0x00010000)
  5446. #define GPIO_BSRR_BR_1 ((uint32_t)0x00020000)
  5447. #define GPIO_BSRR_BR_2 ((uint32_t)0x00040000)
  5448. #define GPIO_BSRR_BR_3 ((uint32_t)0x00080000)
  5449. #define GPIO_BSRR_BR_4 ((uint32_t)0x00100000)
  5450. #define GPIO_BSRR_BR_5 ((uint32_t)0x00200000)
  5451. #define GPIO_BSRR_BR_6 ((uint32_t)0x00400000)
  5452. #define GPIO_BSRR_BR_7 ((uint32_t)0x00800000)
  5453. #define GPIO_BSRR_BR_8 ((uint32_t)0x01000000)
  5454. #define GPIO_BSRR_BR_9 ((uint32_t)0x02000000)
  5455. #define GPIO_BSRR_BR_10 ((uint32_t)0x04000000)
  5456. #define GPIO_BSRR_BR_11 ((uint32_t)0x08000000)
  5457. #define GPIO_BSRR_BR_12 ((uint32_t)0x10000000)
  5458. #define GPIO_BSRR_BR_13 ((uint32_t)0x20000000)
  5459. #define GPIO_BSRR_BR_14 ((uint32_t)0x40000000)
  5460. #define GPIO_BSRR_BR_15 ((uint32_t)0x80000000)
  5461. /****************** Bit definition for GPIO_LCKR register *********************/
  5462. #define GPIO_LCKR_LCK0 ((uint32_t)0x00000001)
  5463. #define GPIO_LCKR_LCK1 ((uint32_t)0x00000002)
  5464. #define GPIO_LCKR_LCK2 ((uint32_t)0x00000004)
  5465. #define GPIO_LCKR_LCK3 ((uint32_t)0x00000008)
  5466. #define GPIO_LCKR_LCK4 ((uint32_t)0x00000010)
  5467. #define GPIO_LCKR_LCK5 ((uint32_t)0x00000020)
  5468. #define GPIO_LCKR_LCK6 ((uint32_t)0x00000040)
  5469. #define GPIO_LCKR_LCK7 ((uint32_t)0x00000080)
  5470. #define GPIO_LCKR_LCK8 ((uint32_t)0x00000100)
  5471. #define GPIO_LCKR_LCK9 ((uint32_t)0x00000200)
  5472. #define GPIO_LCKR_LCK10 ((uint32_t)0x00000400)
  5473. #define GPIO_LCKR_LCK11 ((uint32_t)0x00000800)
  5474. #define GPIO_LCKR_LCK12 ((uint32_t)0x00001000)
  5475. #define GPIO_LCKR_LCK13 ((uint32_t)0x00002000)
  5476. #define GPIO_LCKR_LCK14 ((uint32_t)0x00004000)
  5477. #define GPIO_LCKR_LCK15 ((uint32_t)0x00008000)
  5478. #define GPIO_LCKR_LCKK ((uint32_t)0x00010000)
  5479. /******************************************************************************/
  5480. /* */
  5481. /* Inter-integrated Circuit Interface */
  5482. /* */
  5483. /******************************************************************************/
  5484. /******************* Bit definition for I2C_CR1 register ********************/
  5485. #define I2C_CR1_PE ((uint32_t)0x00000001) /*!<Peripheral Enable */
  5486. #define I2C_CR1_SMBUS ((uint32_t)0x00000002) /*!<SMBus Mode */
  5487. #define I2C_CR1_SMBTYPE ((uint32_t)0x00000008) /*!<SMBus Type */
  5488. #define I2C_CR1_ENARP ((uint32_t)0x00000010) /*!<ARP Enable */
  5489. #define I2C_CR1_ENPEC ((uint32_t)0x00000020) /*!<PEC Enable */
  5490. #define I2C_CR1_ENGC ((uint32_t)0x00000040) /*!<General Call Enable */
  5491. #define I2C_CR1_NOSTRETCH ((uint32_t)0x00000080) /*!<Clock Stretching Disable (Slave mode) */
  5492. #define I2C_CR1_START ((uint32_t)0x00000100) /*!<Start Generation */
  5493. #define I2C_CR1_STOP ((uint32_t)0x00000200) /*!<Stop Generation */
  5494. #define I2C_CR1_ACK ((uint32_t)0x00000400) /*!<Acknowledge Enable */
  5495. #define I2C_CR1_POS ((uint32_t)0x00000800) /*!<Acknowledge/PEC Position (for data reception) */
  5496. #define I2C_CR1_PEC ((uint32_t)0x00001000) /*!<Packet Error Checking */
  5497. #define I2C_CR1_ALERT ((uint32_t)0x00002000) /*!<SMBus Alert */
  5498. #define I2C_CR1_SWRST ((uint32_t)0x00008000) /*!<Software Reset */
  5499. /******************* Bit definition for I2C_CR2 register ********************/
  5500. #define I2C_CR2_FREQ ((uint32_t)0x0000003F) /*!<FREQ[5:0] bits (Peripheral Clock Frequency) */
  5501. #define I2C_CR2_FREQ_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  5502. #define I2C_CR2_FREQ_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  5503. #define I2C_CR2_FREQ_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  5504. #define I2C_CR2_FREQ_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  5505. #define I2C_CR2_FREQ_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  5506. #define I2C_CR2_FREQ_5 ((uint32_t)0x00000020) /*!<Bit 5 */
  5507. #define I2C_CR2_ITERREN ((uint32_t)0x00000100) /*!<Error Interrupt Enable */
  5508. #define I2C_CR2_ITEVTEN ((uint32_t)0x00000200) /*!<Event Interrupt Enable */
  5509. #define I2C_CR2_ITBUFEN ((uint32_t)0x00000400) /*!<Buffer Interrupt Enable */
  5510. #define I2C_CR2_DMAEN ((uint32_t)0x00000800) /*!<DMA Requests Enable */
  5511. #define I2C_CR2_LAST ((uint32_t)0x00001000) /*!<DMA Last Transfer */
  5512. /******************* Bit definition for I2C_OAR1 register *******************/
  5513. #define I2C_OAR1_ADD1_7 ((uint32_t)0x000000FE) /*!<Interface Address */
  5514. #define I2C_OAR1_ADD8_9 ((uint32_t)0x00000300) /*!<Interface Address */
  5515. #define I2C_OAR1_ADD0 ((uint32_t)0x00000001) /*!<Bit 0 */
  5516. #define I2C_OAR1_ADD1 ((uint32_t)0x00000002) /*!<Bit 1 */
  5517. #define I2C_OAR1_ADD2 ((uint32_t)0x00000004) /*!<Bit 2 */
  5518. #define I2C_OAR1_ADD3 ((uint32_t)0x00000008) /*!<Bit 3 */
  5519. #define I2C_OAR1_ADD4 ((uint32_t)0x00000010) /*!<Bit 4 */
  5520. #define I2C_OAR1_ADD5 ((uint32_t)0x00000020) /*!<Bit 5 */
  5521. #define I2C_OAR1_ADD6 ((uint32_t)0x00000040) /*!<Bit 6 */
  5522. #define I2C_OAR1_ADD7 ((uint32_t)0x00000080) /*!<Bit 7 */
  5523. #define I2C_OAR1_ADD8 ((uint32_t)0x00000100) /*!<Bit 8 */
  5524. #define I2C_OAR1_ADD9 ((uint32_t)0x00000200) /*!<Bit 9 */
  5525. #define I2C_OAR1_ADDMODE ((uint32_t)0x00008000) /*!<Addressing Mode (Slave mode) */
  5526. /******************* Bit definition for I2C_OAR2 register *******************/
  5527. #define I2C_OAR2_ENDUAL ((uint32_t)0x00000001) /*!<Dual addressing mode enable */
  5528. #define I2C_OAR2_ADD2 ((uint32_t)0x000000FE) /*!<Interface address */
  5529. /******************** Bit definition for I2C_DR register ********************/
  5530. #define I2C_DR_DR ((uint32_t)0x000000FF) /*!<8-bit Data Register */
  5531. /******************* Bit definition for I2C_SR1 register ********************/
  5532. #define I2C_SR1_SB ((uint32_t)0x00000001) /*!<Start Bit (Master mode) */
  5533. #define I2C_SR1_ADDR ((uint32_t)0x00000002) /*!<Address sent (master mode)/matched (slave mode) */
  5534. #define I2C_SR1_BTF ((uint32_t)0x00000004) /*!<Byte Transfer Finished */
  5535. #define I2C_SR1_ADD10 ((uint32_t)0x00000008) /*!<10-bit header sent (Master mode) */
  5536. #define I2C_SR1_STOPF ((uint32_t)0x00000010) /*!<Stop detection (Slave mode) */
  5537. #define I2C_SR1_RXNE ((uint32_t)0x00000040) /*!<Data Register not Empty (receivers) */
  5538. #define I2C_SR1_TXE ((uint32_t)0x00000080) /*!<Data Register Empty (transmitters) */
  5539. #define I2C_SR1_BERR ((uint32_t)0x00000100) /*!<Bus Error */
  5540. #define I2C_SR1_ARLO ((uint32_t)0x00000200) /*!<Arbitration Lost (master mode) */
  5541. #define I2C_SR1_AF ((uint32_t)0x00000400) /*!<Acknowledge Failure */
  5542. #define I2C_SR1_OVR ((uint32_t)0x00000800) /*!<Overrun/Underrun */
  5543. #define I2C_SR1_PECERR ((uint32_t)0x00001000) /*!<PEC Error in reception */
  5544. #define I2C_SR1_TIMEOUT ((uint32_t)0x00004000) /*!<Timeout or Tlow Error */
  5545. #define I2C_SR1_SMBALERT ((uint32_t)0x00008000) /*!<SMBus Alert */
  5546. /******************* Bit definition for I2C_SR2 register ********************/
  5547. #define I2C_SR2_MSL ((uint32_t)0x00000001) /*!<Master/Slave */
  5548. #define I2C_SR2_BUSY ((uint32_t)0x00000002) /*!<Bus Busy */
  5549. #define I2C_SR2_TRA ((uint32_t)0x00000004) /*!<Transmitter/Receiver */
  5550. #define I2C_SR2_GENCALL ((uint32_t)0x00000010) /*!<General Call Address (Slave mode) */
  5551. #define I2C_SR2_SMBDEFAULT ((uint32_t)0x00000020) /*!<SMBus Device Default Address (Slave mode) */
  5552. #define I2C_SR2_SMBHOST ((uint32_t)0x00000040) /*!<SMBus Host Header (Slave mode) */
  5553. #define I2C_SR2_DUALF ((uint32_t)0x00000080) /*!<Dual Flag (Slave mode) */
  5554. #define I2C_SR2_PEC ((uint32_t)0x0000FF00) /*!<Packet Error Checking Register */
  5555. /******************* Bit definition for I2C_CCR register ********************/
  5556. #define I2C_CCR_CCR ((uint32_t)0x00000FFF) /*!<Clock Control Register in Fast/Standard mode (Master mode) */
  5557. #define I2C_CCR_DUTY ((uint32_t)0x00004000) /*!<Fast Mode Duty Cycle */
  5558. #define I2C_CCR_FS ((uint32_t)0x00008000) /*!<I2C Master Mode Selection */
  5559. /****************** Bit definition for I2C_TRISE register *******************/
  5560. #define I2C_TRISE_TRISE ((uint32_t)0x0000003F) /*!<Maximum Rise Time in Fast/Standard mode (Master mode) */
  5561. /****************** Bit definition for I2C_FLTR register *******************/
  5562. #define I2C_FLTR_DNF ((uint32_t)0x0000000F) /*!<Digital Noise Filter */
  5563. #define I2C_FLTR_ANOFF ((uint32_t)0x00000010) /*!<Analog Noise Filter OFF */
  5564. /******************************************************************************/
  5565. /* */
  5566. /* Independent WATCHDOG */
  5567. /* */
  5568. /******************************************************************************/
  5569. /******************* Bit definition for IWDG_KR register ********************/
  5570. #define IWDG_KR_KEY ((uint32_t)0xFFFF) /*!<Key value (write only, read 0000h) */
  5571. /******************* Bit definition for IWDG_PR register ********************/
  5572. #define IWDG_PR_PR ((uint32_t)0x07) /*!<PR[2:0] (Prescaler divider) */
  5573. #define IWDG_PR_PR_0 ((uint32_t)0x01) /*!<Bit 0 */
  5574. #define IWDG_PR_PR_1 ((uint32_t)0x02) /*!<Bit 1 */
  5575. #define IWDG_PR_PR_2 ((uint32_t)0x04) /*!<Bit 2 */
  5576. /******************* Bit definition for IWDG_RLR register *******************/
  5577. #define IWDG_RLR_RL ((uint32_t)0x0FFF) /*!<Watchdog counter reload value */
  5578. /******************* Bit definition for IWDG_SR register ********************/
  5579. #define IWDG_SR_PVU ((uint32_t)0x01) /*!<Watchdog prescaler value update */
  5580. #define IWDG_SR_RVU ((uint32_t)0x02) /*!<Watchdog counter reload value update */
  5581. /******************************************************************************/
  5582. /* */
  5583. /* LCD-TFT Display Controller (LTDC) */
  5584. /* */
  5585. /******************************************************************************/
  5586. /******************** Bit definition for LTDC_SSCR register *****************/
  5587. #define LTDC_SSCR_VSH ((uint32_t)0x000007FF) /*!< Vertical Synchronization Height */
  5588. #define LTDC_SSCR_HSW ((uint32_t)0x0FFF0000) /*!< Horizontal Synchronization Width */
  5589. /******************** Bit definition for LTDC_BPCR register *****************/
  5590. #define LTDC_BPCR_AVBP ((uint32_t)0x000007FF) /*!< Accumulated Vertical Back Porch */
  5591. #define LTDC_BPCR_AHBP ((uint32_t)0x0FFF0000) /*!< Accumulated Horizontal Back Porch */
  5592. /******************** Bit definition for LTDC_AWCR register *****************/
  5593. #define LTDC_AWCR_AAH ((uint32_t)0x000007FF) /*!< Accumulated Active heigh */
  5594. #define LTDC_AWCR_AAW ((uint32_t)0x0FFF0000) /*!< Accumulated Active Width */
  5595. /******************** Bit definition for LTDC_TWCR register *****************/
  5596. #define LTDC_TWCR_TOTALH ((uint32_t)0x000007FF) /*!< Total Heigh */
  5597. #define LTDC_TWCR_TOTALW ((uint32_t)0x0FFF0000) /*!< Total Width */
  5598. /******************** Bit definition for LTDC_GCR register ******************/
  5599. #define LTDC_GCR_LTDCEN ((uint32_t)0x00000001) /*!< LCD-TFT controller enable bit */
  5600. #define LTDC_GCR_DBW ((uint32_t)0x00000070) /*!< Dither Blue Width */
  5601. #define LTDC_GCR_DGW ((uint32_t)0x00000700) /*!< Dither Green Width */
  5602. #define LTDC_GCR_DRW ((uint32_t)0x00007000) /*!< Dither Red Width */
  5603. #define LTDC_GCR_DTEN ((uint32_t)0x00010000) /*!< Dither Enable */
  5604. #define LTDC_GCR_PCPOL ((uint32_t)0x10000000) /*!< Pixel Clock Polarity */
  5605. #define LTDC_GCR_DEPOL ((uint32_t)0x20000000) /*!< Data Enable Polarity */
  5606. #define LTDC_GCR_VSPOL ((uint32_t)0x40000000) /*!< Vertical Synchronization Polarity */
  5607. #define LTDC_GCR_HSPOL ((uint32_t)0x80000000) /*!< Horizontal Synchronization Polarity */
  5608. /******************** Bit definition for LTDC_SRCR register *****************/
  5609. #define LTDC_SRCR_IMR ((uint32_t)0x00000001) /*!< Immediate Reload */
  5610. #define LTDC_SRCR_VBR ((uint32_t)0x00000002) /*!< Vertical Blanking Reload */
  5611. /******************** Bit definition for LTDC_BCCR register *****************/
  5612. #define LTDC_BCCR_BCBLUE ((uint32_t)0x000000FF) /*!< Background Blue value */
  5613. #define LTDC_BCCR_BCGREEN ((uint32_t)0x0000FF00) /*!< Background Green value */
  5614. #define LTDC_BCCR_BCRED ((uint32_t)0x00FF0000) /*!< Background Red value */
  5615. /******************** Bit definition for LTDC_IER register ******************/
  5616. #define LTDC_IER_LIE ((uint32_t)0x00000001) /*!< Line Interrupt Enable */
  5617. #define LTDC_IER_FUIE ((uint32_t)0x00000002) /*!< FIFO Underrun Interrupt Enable */
  5618. #define LTDC_IER_TERRIE ((uint32_t)0x00000004) /*!< Transfer Error Interrupt Enable */
  5619. #define LTDC_IER_RRIE ((uint32_t)0x00000008) /*!< Register Reload interrupt enable */
  5620. /******************** Bit definition for LTDC_ISR register ******************/
  5621. #define LTDC_ISR_LIF ((uint32_t)0x00000001) /*!< Line Interrupt Flag */
  5622. #define LTDC_ISR_FUIF ((uint32_t)0x00000002) /*!< FIFO Underrun Interrupt Flag */
  5623. #define LTDC_ISR_TERRIF ((uint32_t)0x00000004) /*!< Transfer Error Interrupt Flag */
  5624. #define LTDC_ISR_RRIF ((uint32_t)0x00000008) /*!< Register Reload interrupt Flag */
  5625. /******************** Bit definition for LTDC_ICR register ******************/
  5626. #define LTDC_ICR_CLIF ((uint32_t)0x00000001) /*!< Clears the Line Interrupt Flag */
  5627. #define LTDC_ICR_CFUIF ((uint32_t)0x00000002) /*!< Clears the FIFO Underrun Interrupt Flag */
  5628. #define LTDC_ICR_CTERRIF ((uint32_t)0x00000004) /*!< Clears the Transfer Error Interrupt Flag */
  5629. #define LTDC_ICR_CRRIF ((uint32_t)0x00000008) /*!< Clears Register Reload interrupt Flag */
  5630. /******************** Bit definition for LTDC_LIPCR register ****************/
  5631. #define LTDC_LIPCR_LIPOS ((uint32_t)0x000007FF) /*!< Line Interrupt Position */
  5632. /******************** Bit definition for LTDC_CPSR register *****************/
  5633. #define LTDC_CPSR_CYPOS ((uint32_t)0x0000FFFF) /*!< Current Y Position */
  5634. #define LTDC_CPSR_CXPOS ((uint32_t)0xFFFF0000) /*!< Current X Position */
  5635. /******************** Bit definition for LTDC_CDSR register *****************/
  5636. #define LTDC_CDSR_VDES ((uint32_t)0x00000001) /*!< Vertical Data Enable Status */
  5637. #define LTDC_CDSR_HDES ((uint32_t)0x00000002) /*!< Horizontal Data Enable Status */
  5638. #define LTDC_CDSR_VSYNCS ((uint32_t)0x00000004) /*!< Vertical Synchronization Status */
  5639. #define LTDC_CDSR_HSYNCS ((uint32_t)0x00000008) /*!< Horizontal Synchronization Status */
  5640. /******************** Bit definition for LTDC_LxCR register *****************/
  5641. #define LTDC_LxCR_LEN ((uint32_t)0x00000001) /*!< Layer Enable */
  5642. #define LTDC_LxCR_COLKEN ((uint32_t)0x00000002) /*!< Color Keying Enable */
  5643. #define LTDC_LxCR_CLUTEN ((uint32_t)0x00000010) /*!< Color Lockup Table Enable */
  5644. /******************** Bit definition for LTDC_LxWHPCR register **************/
  5645. #define LTDC_LxWHPCR_WHSTPOS ((uint32_t)0x00000FFF) /*!< Window Horizontal Start Position */
  5646. #define LTDC_LxWHPCR_WHSPPOS ((uint32_t)0xFFFF0000) /*!< Window Horizontal Stop Position */
  5647. /******************** Bit definition for LTDC_LxWVPCR register **************/
  5648. #define LTDC_LxWVPCR_WVSTPOS ((uint32_t)0x00000FFF) /*!< Window Vertical Start Position */
  5649. #define LTDC_LxWVPCR_WVSPPOS ((uint32_t)0xFFFF0000) /*!< Window Vertical Stop Position */
  5650. /******************** Bit definition for LTDC_LxCKCR register ***************/
  5651. #define LTDC_LxCKCR_CKBLUE ((uint32_t)0x000000FF) /*!< Color Key Blue value */
  5652. #define LTDC_LxCKCR_CKGREEN ((uint32_t)0x0000FF00) /*!< Color Key Green value */
  5653. #define LTDC_LxCKCR_CKRED ((uint32_t)0x00FF0000) /*!< Color Key Red value */
  5654. /******************** Bit definition for LTDC_LxPFCR register ***************/
  5655. #define LTDC_LxPFCR_PF ((uint32_t)0x00000007) /*!< Pixel Format */
  5656. /******************** Bit definition for LTDC_LxCACR register ***************/
  5657. #define LTDC_LxCACR_CONSTA ((uint32_t)0x000000FF) /*!< Constant Alpha */
  5658. /******************** Bit definition for LTDC_LxDCCR register ***************/
  5659. #define LTDC_LxDCCR_DCBLUE ((uint32_t)0x000000FF) /*!< Default Color Blue */
  5660. #define LTDC_LxDCCR_DCGREEN ((uint32_t)0x0000FF00) /*!< Default Color Green */
  5661. #define LTDC_LxDCCR_DCRED ((uint32_t)0x00FF0000) /*!< Default Color Red */
  5662. #define LTDC_LxDCCR_DCALPHA ((uint32_t)0xFF000000) /*!< Default Color Alpha */
  5663. /******************** Bit definition for LTDC_LxBFCR register ***************/
  5664. #define LTDC_LxBFCR_BF2 ((uint32_t)0x00000007) /*!< Blending Factor 2 */
  5665. #define LTDC_LxBFCR_BF1 ((uint32_t)0x00000700) /*!< Blending Factor 1 */
  5666. /******************** Bit definition for LTDC_LxCFBAR register **************/
  5667. #define LTDC_LxCFBAR_CFBADD ((uint32_t)0xFFFFFFFF) /*!< Color Frame Buffer Start Address */
  5668. /******************** Bit definition for LTDC_LxCFBLR register **************/
  5669. #define LTDC_LxCFBLR_CFBLL ((uint32_t)0x00001FFF) /*!< Color Frame Buffer Line Length */
  5670. #define LTDC_LxCFBLR_CFBP ((uint32_t)0x1FFF0000) /*!< Color Frame Buffer Pitch in bytes */
  5671. /******************** Bit definition for LTDC_LxCFBLNR register *************/
  5672. #define LTDC_LxCFBLNR_CFBLNBR ((uint32_t)0x000007FF) /*!< Frame Buffer Line Number */
  5673. /******************** Bit definition for LTDC_LxCLUTWR register *************/
  5674. #define LTDC_LxCLUTWR_BLUE ((uint32_t)0x000000FF) /*!< Blue value */
  5675. #define LTDC_LxCLUTWR_GREEN ((uint32_t)0x0000FF00) /*!< Green value */
  5676. #define LTDC_LxCLUTWR_RED ((uint32_t)0x00FF0000) /*!< Red value */
  5677. #define LTDC_LxCLUTWR_CLUTADD ((uint32_t)0xFF000000) /*!< CLUT address */
  5678. /******************************************************************************/
  5679. /* */
  5680. /* Power Control */
  5681. /* */
  5682. /******************************************************************************/
  5683. /******************** Bit definition for PWR_CR register ********************/
  5684. #define PWR_CR_LPDS ((uint32_t)0x00000001) /*!< Low-Power Deepsleep */
  5685. #define PWR_CR_PDDS ((uint32_t)0x00000002) /*!< Power Down Deepsleep */
  5686. #define PWR_CR_CWUF ((uint32_t)0x00000004) /*!< Clear Wakeup Flag */
  5687. #define PWR_CR_CSBF ((uint32_t)0x00000008) /*!< Clear Standby Flag */
  5688. #define PWR_CR_PVDE ((uint32_t)0x00000010) /*!< Power Voltage Detector Enable */
  5689. #define PWR_CR_PLS ((uint32_t)0x000000E0) /*!< PLS[2:0] bits (PVD Level Selection) */
  5690. #define PWR_CR_PLS_0 ((uint32_t)0x00000020) /*!< Bit 0 */
  5691. #define PWR_CR_PLS_1 ((uint32_t)0x00000040) /*!< Bit 1 */
  5692. #define PWR_CR_PLS_2 ((uint32_t)0x00000080) /*!< Bit 2 */
  5693. /*!< PVD level configuration */
  5694. #define PWR_CR_PLS_LEV0 ((uint32_t)0x00000000) /*!< PVD level 0 */
  5695. #define PWR_CR_PLS_LEV1 ((uint32_t)0x00000020) /*!< PVD level 1 */
  5696. #define PWR_CR_PLS_LEV2 ((uint32_t)0x00000040) /*!< PVD level 2 */
  5697. #define PWR_CR_PLS_LEV3 ((uint32_t)0x00000060) /*!< PVD level 3 */
  5698. #define PWR_CR_PLS_LEV4 ((uint32_t)0x00000080) /*!< PVD level 4 */
  5699. #define PWR_CR_PLS_LEV5 ((uint32_t)0x000000A0) /*!< PVD level 5 */
  5700. #define PWR_CR_PLS_LEV6 ((uint32_t)0x000000C0) /*!< PVD level 6 */
  5701. #define PWR_CR_PLS_LEV7 ((uint32_t)0x000000E0) /*!< PVD level 7 */
  5702. #define PWR_CR_DBP ((uint32_t)0x00000100) /*!< Disable Backup Domain write protection */
  5703. #define PWR_CR_FPDS ((uint32_t)0x00000200) /*!< Flash power down in Stop mode */
  5704. #define PWR_CR_LPLVDS ((uint32_t)0x00000400) /*!< Low-Power Regulator Low Voltage Scaling in Stop mode */
  5705. #define PWR_CR_MRLVDS ((uint32_t)0x00000800) /*!< Main regulator Low Voltage Scaling in Stop mode */
  5706. #define PWR_CR_ADCDC1 ((uint32_t)0x00002000) /*!< Refer to AN4073 on how to use this bit */
  5707. #define PWR_CR_VOS ((uint32_t)0x0000C000) /*!< VOS[1:0] bits (Regulator voltage scaling output selection) */
  5708. #define PWR_CR_VOS_0 ((uint32_t)0x00004000) /*!< Bit 0 */
  5709. #define PWR_CR_VOS_1 ((uint32_t)0x00008000) /*!< Bit 1 */
  5710. #define PWR_CR_ODEN ((uint32_t)0x00010000) /*!< Over Drive enable */
  5711. #define PWR_CR_ODSWEN ((uint32_t)0x00020000) /*!< Over Drive switch enabled */
  5712. #define PWR_CR_UDEN ((uint32_t)0x000C0000) /*!< Under Drive enable in stop mode */
  5713. #define PWR_CR_UDEN_0 ((uint32_t)0x00040000) /*!< Bit 0 */
  5714. #define PWR_CR_UDEN_1 ((uint32_t)0x00080000) /*!< Bit 1 */
  5715. /* Legacy define */
  5716. #define PWR_CR_PMODE PWR_CR_VOS
  5717. #define PWR_CR_LPUDS PWR_CR_LPLVDS /*!< Low-Power Regulator in deepsleep under-drive mode */
  5718. #define PWR_CR_MRUDS PWR_CR_MRLVDS /*!< Main regulator in deepsleep under-drive mode */
  5719. /******************* Bit definition for PWR_CSR register ********************/
  5720. #define PWR_CSR_WUF ((uint32_t)0x00000001) /*!< Wakeup Flag */
  5721. #define PWR_CSR_SBF ((uint32_t)0x00000002) /*!< Standby Flag */
  5722. #define PWR_CSR_PVDO ((uint32_t)0x00000004) /*!< PVD Output */
  5723. #define PWR_CSR_BRR ((uint32_t)0x00000008) /*!< Backup regulator ready */
  5724. #define PWR_CSR_WUPP ((uint32_t)0x00000080) /*!< WKUP pin Polarity */
  5725. #define PWR_CSR_EWUP ((uint32_t)0x00000100) /*!< Enable WKUP pin */
  5726. #define PWR_CSR_BRE ((uint32_t)0x00000200) /*!< Backup regulator enable */
  5727. #define PWR_CSR_VOSRDY ((uint32_t)0x00004000) /*!< Regulator voltage scaling output selection ready */
  5728. #define PWR_CSR_ODRDY ((uint32_t)0x00010000) /*!< Over Drive generator ready */
  5729. #define PWR_CSR_ODSWRDY ((uint32_t)0x00020000) /*!< Over Drive Switch ready */
  5730. #define PWR_CSR_UDSWRDY ((uint32_t)0x000C0000) /*!< Under Drive ready */
  5731. /* Legacy define */
  5732. #define PWR_CSR_REGRDY PWR_CSR_VOSRDY
  5733. /******************************************************************************/
  5734. /* */
  5735. /* QUADSPI */
  5736. /* */
  5737. /******************************************************************************/
  5738. /***************** Bit definition for QUADSPI_CR register *******************/
  5739. #define QUADSPI_CR_EN ((uint32_t)0x00000001) /*!< Enable */
  5740. #define QUADSPI_CR_ABORT ((uint32_t)0x00000002) /*!< Abort request */
  5741. #define QUADSPI_CR_DMAEN ((uint32_t)0x00000004) /*!< DMA Enable */
  5742. #define QUADSPI_CR_TCEN ((uint32_t)0x00000008) /*!< Timeout Counter Enable */
  5743. #define QUADSPI_CR_SSHIFT ((uint32_t)0x00000010) /*!< SSHIFT Sample Shift */
  5744. #define QUADSPI_CR_DFM ((uint32_t)0x00000040) /*!< Dual Flash Mode */
  5745. #define QUADSPI_CR_FSEL ((uint32_t)0x00000080) /*!< Flash Select */
  5746. #define QUADSPI_CR_FTHRES ((uint32_t)0x00000F00) /*!< FTHRES[3:0] FIFO Level */
  5747. #define QUADSPI_CR_FTHRES_0 ((uint32_t)0x00000100) /*!< Bit 0 */
  5748. #define QUADSPI_CR_FTHRES_1 ((uint32_t)0x00000200) /*!< Bit 1 */
  5749. #define QUADSPI_CR_FTHRES_2 ((uint32_t)0x00000400) /*!< Bit 2 */
  5750. #define QUADSPI_CR_FTHRES_3 ((uint32_t)0x00000800) /*!< Bit 3 */
  5751. #define QUADSPI_CR_TEIE ((uint32_t)0x00010000) /*!< Transfer Error Interrupt Enable */
  5752. #define QUADSPI_CR_TCIE ((uint32_t)0x00020000) /*!< Transfer Complete Interrupt Enable */
  5753. #define QUADSPI_CR_FTIE ((uint32_t)0x00040000) /*!< FIFO Threshold Interrupt Enable */
  5754. #define QUADSPI_CR_SMIE ((uint32_t)0x00080000) /*!< Status Match Interrupt Enable */
  5755. #define QUADSPI_CR_TOIE ((uint32_t)0x00100000) /*!< TimeOut Interrupt Enable */
  5756. #define QUADSPI_CR_APMS ((uint32_t)0x00400000) /*!< Bit 1 */
  5757. #define QUADSPI_CR_PMM ((uint32_t)0x00800000) /*!< Polling Match Mode */
  5758. #define QUADSPI_CR_PRESCALER ((uint32_t)0xFF000000) /*!< PRESCALER[7:0] Clock prescaler */
  5759. #define QUADSPI_CR_PRESCALER_0 ((uint32_t)0x01000000) /*!< Bit 0 */
  5760. #define QUADSPI_CR_PRESCALER_1 ((uint32_t)0x02000000) /*!< Bit 1 */
  5761. #define QUADSPI_CR_PRESCALER_2 ((uint32_t)0x04000000) /*!< Bit 2 */
  5762. #define QUADSPI_CR_PRESCALER_3 ((uint32_t)0x08000000) /*!< Bit 3 */
  5763. #define QUADSPI_CR_PRESCALER_4 ((uint32_t)0x10000000) /*!< Bit 4 */
  5764. #define QUADSPI_CR_PRESCALER_5 ((uint32_t)0x20000000) /*!< Bit 5 */
  5765. #define QUADSPI_CR_PRESCALER_6 ((uint32_t)0x40000000) /*!< Bit 6 */
  5766. #define QUADSPI_CR_PRESCALER_7 ((uint32_t)0x80000000) /*!< Bit 7 */
  5767. /***************** Bit definition for QUADSPI_DCR register ******************/
  5768. #define QUADSPI_DCR_CKMODE ((uint32_t)0x00000001) /*!< Mode 0 / Mode 3 */
  5769. #define QUADSPI_DCR_CSHT ((uint32_t)0x00000700) /*!< CSHT[2:0]: ChipSelect High Time */
  5770. #define QUADSPI_DCR_CSHT_0 ((uint32_t)0x00000100) /*!< Bit 0 */
  5771. #define QUADSPI_DCR_CSHT_1 ((uint32_t)0x00000200) /*!< Bit 1 */
  5772. #define QUADSPI_DCR_CSHT_2 ((uint32_t)0x00000400) /*!< Bit 2 */
  5773. #define QUADSPI_DCR_FSIZE ((uint32_t)0x001F0000) /*!< FSIZE[4:0]: Flash Size */
  5774. #define QUADSPI_DCR_FSIZE_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  5775. #define QUADSPI_DCR_FSIZE_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  5776. #define QUADSPI_DCR_FSIZE_2 ((uint32_t)0x00040000) /*!< Bit 2 */
  5777. #define QUADSPI_DCR_FSIZE_3 ((uint32_t)0x00080000) /*!< Bit 3 */
  5778. #define QUADSPI_DCR_FSIZE_4 ((uint32_t)0x00100000) /*!< Bit 4 */
  5779. /****************** Bit definition for QUADSPI_SR register *******************/
  5780. #define QUADSPI_SR_TEF ((uint32_t)0x00000001) /*!< Transfer Error Flag */
  5781. #define QUADSPI_SR_TCF ((uint32_t)0x00000002) /*!< Transfer Complete Flag */
  5782. #define QUADSPI_SR_FTF ((uint32_t)0x00000004) /*!< FIFO Threshlod Flag */
  5783. #define QUADSPI_SR_SMF ((uint32_t)0x00000008) /*!< Status Match Flag */
  5784. #define QUADSPI_SR_TOF ((uint32_t)0x00000010) /*!< Timeout Flag */
  5785. #define QUADSPI_SR_BUSY ((uint32_t)0x00000020) /*!< Busy */
  5786. #define QUADSPI_SR_FLEVEL ((uint32_t)0x00003F00) /*!< FIFO Threshlod Flag */
  5787. #define QUADSPI_SR_FLEVEL_0 ((uint32_t)0x00000100) /*!< Bit 0 */
  5788. #define QUADSPI_SR_FLEVEL_1 ((uint32_t)0x00000200) /*!< Bit 1 */
  5789. #define QUADSPI_SR_FLEVEL_2 ((uint32_t)0x00000400) /*!< Bit 2 */
  5790. #define QUADSPI_SR_FLEVEL_3 ((uint32_t)0x00000800) /*!< Bit 3 */
  5791. #define QUADSPI_SR_FLEVEL_4 ((uint32_t)0x00001000) /*!< Bit 4 */
  5792. #define QUADSPI_SR_FLEVEL_5 ((uint32_t)0x00002000) /*!< Bit 5 */
  5793. /****************** Bit definition for QUADSPI_FCR register ******************/
  5794. #define QUADSPI_FCR_CTEF ((uint32_t)0x00000001) /*!< Clear Transfer Error Flag */
  5795. #define QUADSPI_FCR_CTCF ((uint32_t)0x00000002) /*!< Clear Transfer Complete Flag */
  5796. #define QUADSPI_FCR_CSMF ((uint32_t)0x00000008) /*!< Clear Status Match Flag */
  5797. #define QUADSPI_FCR_CTOF ((uint32_t)0x00000010) /*!< Clear Timeout Flag */
  5798. /****************** Bit definition for QUADSPI_DLR register ******************/
  5799. #define QUADSPI_DLR_DL ((uint32_t)0xFFFFFFFF) /*!< DL[31:0]: Data Length */
  5800. /****************** Bit definition for QUADSPI_CCR register ******************/
  5801. #define QUADSPI_CCR_INSTRUCTION ((uint32_t)0x000000FF) /*!< INSTRUCTION[7:0]: Instruction */
  5802. #define QUADSPI_CCR_INSTRUCTION_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  5803. #define QUADSPI_CCR_INSTRUCTION_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  5804. #define QUADSPI_CCR_INSTRUCTION_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  5805. #define QUADSPI_CCR_INSTRUCTION_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  5806. #define QUADSPI_CCR_INSTRUCTION_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  5807. #define QUADSPI_CCR_INSTRUCTION_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  5808. #define QUADSPI_CCR_INSTRUCTION_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  5809. #define QUADSPI_CCR_INSTRUCTION_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  5810. #define QUADSPI_CCR_IMODE ((uint32_t)0x00000300) /*!< IMODE[1:0]: Instruction Mode */
  5811. #define QUADSPI_CCR_IMODE_0 ((uint32_t)0x00000100) /*!< Bit 0 */
  5812. #define QUADSPI_CCR_IMODE_1 ((uint32_t)0x00000200) /*!< Bit 1 */
  5813. #define QUADSPI_CCR_ADMODE ((uint32_t)0x00000C00) /*!< ADMODE[1:0]: Address Mode */
  5814. #define QUADSPI_CCR_ADMODE_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  5815. #define QUADSPI_CCR_ADMODE_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  5816. #define QUADSPI_CCR_ADSIZE ((uint32_t)0x00003000) /*!< ADSIZE[1:0]: Address Size */
  5817. #define QUADSPI_CCR_ADSIZE_0 ((uint32_t)0x00001000) /*!< Bit 0 */
  5818. #define QUADSPI_CCR_ADSIZE_1 ((uint32_t)0x00002000) /*!< Bit 1 */
  5819. #define QUADSPI_CCR_ABMODE ((uint32_t)0x0000C000) /*!< ABMODE[1:0]: Alternate Bytes Mode */
  5820. #define QUADSPI_CCR_ABMODE_0 ((uint32_t)0x00004000) /*!< Bit 0 */
  5821. #define QUADSPI_CCR_ABMODE_1 ((uint32_t)0x00008000) /*!< Bit 1 */
  5822. #define QUADSPI_CCR_ABSIZE ((uint32_t)0x00030000) /*!< ABSIZE[1:0]: Instruction Mode */
  5823. #define QUADSPI_CCR_ABSIZE_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  5824. #define QUADSPI_CCR_ABSIZE_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  5825. #define QUADSPI_CCR_DCYC ((uint32_t)0x007C0000) /*!< DCYC[4:0]: Dummy Cycles */
  5826. #define QUADSPI_CCR_DCYC_0 ((uint32_t)0x00040000) /*!< Bit 0 */
  5827. #define QUADSPI_CCR_DCYC_1 ((uint32_t)0x00080000) /*!< Bit 1 */
  5828. #define QUADSPI_CCR_DCYC_2 ((uint32_t)0x00100000) /*!< Bit 2 */
  5829. #define QUADSPI_CCR_DCYC_3 ((uint32_t)0x00200000) /*!< Bit 3 */
  5830. #define QUADSPI_CCR_DCYC_4 ((uint32_t)0x00400000) /*!< Bit 4 */
  5831. #define QUADSPI_CCR_DMODE ((uint32_t)0x03000000) /*!< DMODE[1:0]: Data Mode */
  5832. #define QUADSPI_CCR_DMODE_0 ((uint32_t)0x01000000) /*!< Bit 0 */
  5833. #define QUADSPI_CCR_DMODE_1 ((uint32_t)0x02000000) /*!< Bit 1 */
  5834. #define QUADSPI_CCR_FMODE ((uint32_t)0x0C000000) /*!< FMODE[1:0]: Functional Mode */
  5835. #define QUADSPI_CCR_FMODE_0 ((uint32_t)0x04000000) /*!< Bit 0 */
  5836. #define QUADSPI_CCR_FMODE_1 ((uint32_t)0x08000000) /*!< Bit 1 */
  5837. #define QUADSPI_CCR_SIOO ((uint32_t)0x10000000) /*!< SIOO: Send Instruction Only Once Mode */
  5838. #define QUADSPI_CCR_DHHC ((uint32_t)0x40000000) /*!< DHHC: Delay Half Hclk Cycle */
  5839. #define QUADSPI_CCR_DDRM ((uint32_t)0x80000000) /*!< DDRM: Double Data Rate Mode */
  5840. /****************** Bit definition for QUADSPI_AR register *******************/
  5841. #define QUADSPI_AR_ADDRESS ((uint32_t)0xFFFFFFFF) /*!< ADDRESS[31:0]: Address */
  5842. /****************** Bit definition for QUADSPI_ABR register ******************/
  5843. #define QUADSPI_ABR_ALTERNATE ((uint32_t)0xFFFFFFFF) /*!< ALTERNATE[31:0]: Alternate Bytes */
  5844. /****************** Bit definition for QUADSPI_DR register *******************/
  5845. #define QUADSPI_DR_DATA ((uint32_t)0xFFFFFFFF) /*!< DATA[31:0]: Data */
  5846. /****************** Bit definition for QUADSPI_PSMKR register ****************/
  5847. #define QUADSPI_PSMKR_MASK ((uint32_t)0xFFFFFFFF) /*!< MASK[31:0]: Status Mask */
  5848. /****************** Bit definition for QUADSPI_PSMAR register ****************/
  5849. #define QUADSPI_PSMAR_MATCH ((uint32_t)0xFFFFFFFF) /*!< MATCH[31:0]: Status Match */
  5850. /****************** Bit definition for QUADSPI_PIR register *****************/
  5851. #define QUADSPI_PIR_INTERVAL ((uint32_t)0x0000FFFF) /*!< INTERVAL[15:0]: Polling Interval */
  5852. /****************** Bit definition for QUADSPI_LPTR register *****************/
  5853. #define QUADSPI_LPTR_TIMEOUT ((uint32_t)0x0000FFFF) /*!< TIMEOUT[15:0]: Timeout period */
  5854. /******************************************************************************/
  5855. /* */
  5856. /* Reset and Clock Control */
  5857. /* */
  5858. /******************************************************************************/
  5859. /******************** Bit definition for RCC_CR register ********************/
  5860. #define RCC_CR_HSION ((uint32_t)0x00000001)
  5861. #define RCC_CR_HSIRDY ((uint32_t)0x00000002)
  5862. #define RCC_CR_HSITRIM ((uint32_t)0x000000F8)
  5863. #define RCC_CR_HSITRIM_0 ((uint32_t)0x00000008)/*!<Bit 0 */
  5864. #define RCC_CR_HSITRIM_1 ((uint32_t)0x00000010)/*!<Bit 1 */
  5865. #define RCC_CR_HSITRIM_2 ((uint32_t)0x00000020)/*!<Bit 2 */
  5866. #define RCC_CR_HSITRIM_3 ((uint32_t)0x00000040)/*!<Bit 3 */
  5867. #define RCC_CR_HSITRIM_4 ((uint32_t)0x00000080)/*!<Bit 4 */
  5868. #define RCC_CR_HSICAL ((uint32_t)0x0000FF00)
  5869. #define RCC_CR_HSICAL_0 ((uint32_t)0x00000100)/*!<Bit 0 */
  5870. #define RCC_CR_HSICAL_1 ((uint32_t)0x00000200)/*!<Bit 1 */
  5871. #define RCC_CR_HSICAL_2 ((uint32_t)0x00000400)/*!<Bit 2 */
  5872. #define RCC_CR_HSICAL_3 ((uint32_t)0x00000800)/*!<Bit 3 */
  5873. #define RCC_CR_HSICAL_4 ((uint32_t)0x00001000)/*!<Bit 4 */
  5874. #define RCC_CR_HSICAL_5 ((uint32_t)0x00002000)/*!<Bit 5 */
  5875. #define RCC_CR_HSICAL_6 ((uint32_t)0x00004000)/*!<Bit 6 */
  5876. #define RCC_CR_HSICAL_7 ((uint32_t)0x00008000)/*!<Bit 7 */
  5877. #define RCC_CR_HSEON ((uint32_t)0x00010000)
  5878. #define RCC_CR_HSERDY ((uint32_t)0x00020000)
  5879. #define RCC_CR_HSEBYP ((uint32_t)0x00040000)
  5880. #define RCC_CR_CSSON ((uint32_t)0x00080000)
  5881. #define RCC_CR_PLLON ((uint32_t)0x01000000)
  5882. #define RCC_CR_PLLRDY ((uint32_t)0x02000000)
  5883. #define RCC_CR_PLLI2SON ((uint32_t)0x04000000)
  5884. #define RCC_CR_PLLI2SRDY ((uint32_t)0x08000000)
  5885. #define RCC_CR_PLLSAION ((uint32_t)0x10000000)
  5886. #define RCC_CR_PLLSAIRDY ((uint32_t)0x20000000)
  5887. /******************** Bit definition for RCC_PLLCFGR register ***************/
  5888. #define RCC_PLLCFGR_PLLM ((uint32_t)0x0000003F)
  5889. #define RCC_PLLCFGR_PLLM_0 ((uint32_t)0x00000001)
  5890. #define RCC_PLLCFGR_PLLM_1 ((uint32_t)0x00000002)
  5891. #define RCC_PLLCFGR_PLLM_2 ((uint32_t)0x00000004)
  5892. #define RCC_PLLCFGR_PLLM_3 ((uint32_t)0x00000008)
  5893. #define RCC_PLLCFGR_PLLM_4 ((uint32_t)0x00000010)
  5894. #define RCC_PLLCFGR_PLLM_5 ((uint32_t)0x00000020)
  5895. #define RCC_PLLCFGR_PLLN ((uint32_t)0x00007FC0)
  5896. #define RCC_PLLCFGR_PLLN_0 ((uint32_t)0x00000040)
  5897. #define RCC_PLLCFGR_PLLN_1 ((uint32_t)0x00000080)
  5898. #define RCC_PLLCFGR_PLLN_2 ((uint32_t)0x00000100)
  5899. #define RCC_PLLCFGR_PLLN_3 ((uint32_t)0x00000200)
  5900. #define RCC_PLLCFGR_PLLN_4 ((uint32_t)0x00000400)
  5901. #define RCC_PLLCFGR_PLLN_5 ((uint32_t)0x00000800)
  5902. #define RCC_PLLCFGR_PLLN_6 ((uint32_t)0x00001000)
  5903. #define RCC_PLLCFGR_PLLN_7 ((uint32_t)0x00002000)
  5904. #define RCC_PLLCFGR_PLLN_8 ((uint32_t)0x00004000)
  5905. #define RCC_PLLCFGR_PLLP ((uint32_t)0x00030000)
  5906. #define RCC_PLLCFGR_PLLP_0 ((uint32_t)0x00010000)
  5907. #define RCC_PLLCFGR_PLLP_1 ((uint32_t)0x00020000)
  5908. #define RCC_PLLCFGR_PLLSRC ((uint32_t)0x00400000)
  5909. #define RCC_PLLCFGR_PLLSRC_HSE ((uint32_t)0x00400000)
  5910. #define RCC_PLLCFGR_PLLSRC_HSI ((uint32_t)0x00000000)
  5911. #define RCC_PLLCFGR_PLLQ ((uint32_t)0x0F000000)
  5912. #define RCC_PLLCFGR_PLLQ_0 ((uint32_t)0x01000000)
  5913. #define RCC_PLLCFGR_PLLQ_1 ((uint32_t)0x02000000)
  5914. #define RCC_PLLCFGR_PLLQ_2 ((uint32_t)0x04000000)
  5915. #define RCC_PLLCFGR_PLLQ_3 ((uint32_t)0x08000000)
  5916. #define RCC_PLLCFGR_PLLR ((uint32_t)0x70000000)
  5917. #define RCC_PLLCFGR_PLLR_0 ((uint32_t)0x10000000)
  5918. #define RCC_PLLCFGR_PLLR_1 ((uint32_t)0x20000000)
  5919. #define RCC_PLLCFGR_PLLR_2 ((uint32_t)0x40000000)
  5920. /******************** Bit definition for RCC_CFGR register ******************/
  5921. /*!< SW configuration */
  5922. #define RCC_CFGR_SW ((uint32_t)0x00000003) /*!< SW[1:0] bits (System clock Switch) */
  5923. #define RCC_CFGR_SW_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  5924. #define RCC_CFGR_SW_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  5925. #define RCC_CFGR_SW_HSI ((uint32_t)0x00000000) /*!< HSI selected as system clock */
  5926. #define RCC_CFGR_SW_HSE ((uint32_t)0x00000001) /*!< HSE selected as system clock */
  5927. #define RCC_CFGR_SW_PLL ((uint32_t)0x00000002) /*!< PLL selected as system clock */
  5928. /*!< SWS configuration */
  5929. #define RCC_CFGR_SWS ((uint32_t)0x0000000C) /*!< SWS[1:0] bits (System Clock Switch Status) */
  5930. #define RCC_CFGR_SWS_0 ((uint32_t)0x00000004) /*!< Bit 0 */
  5931. #define RCC_CFGR_SWS_1 ((uint32_t)0x00000008) /*!< Bit 1 */
  5932. #define RCC_CFGR_SWS_HSI ((uint32_t)0x00000000) /*!< HSI oscillator used as system clock */
  5933. #define RCC_CFGR_SWS_HSE ((uint32_t)0x00000004) /*!< HSE oscillator used as system clock */
  5934. #define RCC_CFGR_SWS_PLL ((uint32_t)0x00000008) /*!< PLL used as system clock */
  5935. /*!< HPRE configuration */
  5936. #define RCC_CFGR_HPRE ((uint32_t)0x000000F0) /*!< HPRE[3:0] bits (AHB prescaler) */
  5937. #define RCC_CFGR_HPRE_0 ((uint32_t)0x00000010) /*!< Bit 0 */
  5938. #define RCC_CFGR_HPRE_1 ((uint32_t)0x00000020) /*!< Bit 1 */
  5939. #define RCC_CFGR_HPRE_2 ((uint32_t)0x00000040) /*!< Bit 2 */
  5940. #define RCC_CFGR_HPRE_3 ((uint32_t)0x00000080) /*!< Bit 3 */
  5941. #define RCC_CFGR_HPRE_DIV1 ((uint32_t)0x00000000) /*!< SYSCLK not divided */
  5942. #define RCC_CFGR_HPRE_DIV2 ((uint32_t)0x00000080) /*!< SYSCLK divided by 2 */
  5943. #define RCC_CFGR_HPRE_DIV4 ((uint32_t)0x00000090) /*!< SYSCLK divided by 4 */
  5944. #define RCC_CFGR_HPRE_DIV8 ((uint32_t)0x000000A0) /*!< SYSCLK divided by 8 */
  5945. #define RCC_CFGR_HPRE_DIV16 ((uint32_t)0x000000B0) /*!< SYSCLK divided by 16 */
  5946. #define RCC_CFGR_HPRE_DIV64 ((uint32_t)0x000000C0) /*!< SYSCLK divided by 64 */
  5947. #define RCC_CFGR_HPRE_DIV128 ((uint32_t)0x000000D0) /*!< SYSCLK divided by 128 */
  5948. #define RCC_CFGR_HPRE_DIV256 ((uint32_t)0x000000E0) /*!< SYSCLK divided by 256 */
  5949. #define RCC_CFGR_HPRE_DIV512 ((uint32_t)0x000000F0) /*!< SYSCLK divided by 512 */
  5950. /*!< PPRE1 configuration */
  5951. #define RCC_CFGR_PPRE1 ((uint32_t)0x00001C00) /*!< PRE1[2:0] bits (APB1 prescaler) */
  5952. #define RCC_CFGR_PPRE1_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  5953. #define RCC_CFGR_PPRE1_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  5954. #define RCC_CFGR_PPRE1_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  5955. #define RCC_CFGR_PPRE1_DIV1 ((uint32_t)0x00000000) /*!< HCLK not divided */
  5956. #define RCC_CFGR_PPRE1_DIV2 ((uint32_t)0x00001000) /*!< HCLK divided by 2 */
  5957. #define RCC_CFGR_PPRE1_DIV4 ((uint32_t)0x00001400) /*!< HCLK divided by 4 */
  5958. #define RCC_CFGR_PPRE1_DIV8 ((uint32_t)0x00001800) /*!< HCLK divided by 8 */
  5959. #define RCC_CFGR_PPRE1_DIV16 ((uint32_t)0x00001C00) /*!< HCLK divided by 16 */
  5960. /*!< PPRE2 configuration */
  5961. #define RCC_CFGR_PPRE2 ((uint32_t)0x0000E000) /*!< PRE2[2:0] bits (APB2 prescaler) */
  5962. #define RCC_CFGR_PPRE2_0 ((uint32_t)0x00002000) /*!< Bit 0 */
  5963. #define RCC_CFGR_PPRE2_1 ((uint32_t)0x00004000) /*!< Bit 1 */
  5964. #define RCC_CFGR_PPRE2_2 ((uint32_t)0x00008000) /*!< Bit 2 */
  5965. #define RCC_CFGR_PPRE2_DIV1 ((uint32_t)0x00000000) /*!< HCLK not divided */
  5966. #define RCC_CFGR_PPRE2_DIV2 ((uint32_t)0x00008000) /*!< HCLK divided by 2 */
  5967. #define RCC_CFGR_PPRE2_DIV4 ((uint32_t)0x0000A000) /*!< HCLK divided by 4 */
  5968. #define RCC_CFGR_PPRE2_DIV8 ((uint32_t)0x0000C000) /*!< HCLK divided by 8 */
  5969. #define RCC_CFGR_PPRE2_DIV16 ((uint32_t)0x0000E000) /*!< HCLK divided by 16 */
  5970. /*!< RTCPRE configuration */
  5971. #define RCC_CFGR_RTCPRE ((uint32_t)0x001F0000)
  5972. #define RCC_CFGR_RTCPRE_0 ((uint32_t)0x00010000)
  5973. #define RCC_CFGR_RTCPRE_1 ((uint32_t)0x00020000)
  5974. #define RCC_CFGR_RTCPRE_2 ((uint32_t)0x00040000)
  5975. #define RCC_CFGR_RTCPRE_3 ((uint32_t)0x00080000)
  5976. #define RCC_CFGR_RTCPRE_4 ((uint32_t)0x00100000)
  5977. /*!< MCO1 configuration */
  5978. #define RCC_CFGR_MCO1 ((uint32_t)0x00600000)
  5979. #define RCC_CFGR_MCO1_0 ((uint32_t)0x00200000)
  5980. #define RCC_CFGR_MCO1_1 ((uint32_t)0x00400000)
  5981. #define RCC_CFGR_I2SSRC ((uint32_t)0x00800000)
  5982. #define RCC_CFGR_MCO1PRE ((uint32_t)0x07000000)
  5983. #define RCC_CFGR_MCO1PRE_0 ((uint32_t)0x01000000)
  5984. #define RCC_CFGR_MCO1PRE_1 ((uint32_t)0x02000000)
  5985. #define RCC_CFGR_MCO1PRE_2 ((uint32_t)0x04000000)
  5986. #define RCC_CFGR_MCO2PRE ((uint32_t)0x38000000)
  5987. #define RCC_CFGR_MCO2PRE_0 ((uint32_t)0x08000000)
  5988. #define RCC_CFGR_MCO2PRE_1 ((uint32_t)0x10000000)
  5989. #define RCC_CFGR_MCO2PRE_2 ((uint32_t)0x20000000)
  5990. #define RCC_CFGR_MCO2 ((uint32_t)0xC0000000)
  5991. #define RCC_CFGR_MCO2_0 ((uint32_t)0x40000000)
  5992. #define RCC_CFGR_MCO2_1 ((uint32_t)0x80000000)
  5993. /******************** Bit definition for RCC_CIR register *******************/
  5994. #define RCC_CIR_LSIRDYF ((uint32_t)0x00000001)
  5995. #define RCC_CIR_LSERDYF ((uint32_t)0x00000002)
  5996. #define RCC_CIR_HSIRDYF ((uint32_t)0x00000004)
  5997. #define RCC_CIR_HSERDYF ((uint32_t)0x00000008)
  5998. #define RCC_CIR_PLLRDYF ((uint32_t)0x00000010)
  5999. #define RCC_CIR_PLLI2SRDYF ((uint32_t)0x00000020)
  6000. #define RCC_CIR_PLLSAIRDYF ((uint32_t)0x00000040)
  6001. #define RCC_CIR_CSSF ((uint32_t)0x00000080)
  6002. #define RCC_CIR_LSIRDYIE ((uint32_t)0x00000100)
  6003. #define RCC_CIR_LSERDYIE ((uint32_t)0x00000200)
  6004. #define RCC_CIR_HSIRDYIE ((uint32_t)0x00000400)
  6005. #define RCC_CIR_HSERDYIE ((uint32_t)0x00000800)
  6006. #define RCC_CIR_PLLRDYIE ((uint32_t)0x00001000)
  6007. #define RCC_CIR_PLLI2SRDYIE ((uint32_t)0x00002000)
  6008. #define RCC_CIR_PLLSAIRDYIE ((uint32_t)0x00004000)
  6009. #define RCC_CIR_LSIRDYC ((uint32_t)0x00010000)
  6010. #define RCC_CIR_LSERDYC ((uint32_t)0x00020000)
  6011. #define RCC_CIR_HSIRDYC ((uint32_t)0x00040000)
  6012. #define RCC_CIR_HSERDYC ((uint32_t)0x00080000)
  6013. #define RCC_CIR_PLLRDYC ((uint32_t)0x00100000)
  6014. #define RCC_CIR_PLLI2SRDYC ((uint32_t)0x00200000)
  6015. #define RCC_CIR_PLLSAIRDYC ((uint32_t)0x00400000)
  6016. #define RCC_CIR_CSSC ((uint32_t)0x00800000)
  6017. /******************** Bit definition for RCC_AHB1RSTR register **************/
  6018. #define RCC_AHB1RSTR_GPIOARST ((uint32_t)0x00000001)
  6019. #define RCC_AHB1RSTR_GPIOBRST ((uint32_t)0x00000002)
  6020. #define RCC_AHB1RSTR_GPIOCRST ((uint32_t)0x00000004)
  6021. #define RCC_AHB1RSTR_GPIODRST ((uint32_t)0x00000008)
  6022. #define RCC_AHB1RSTR_GPIOERST ((uint32_t)0x00000010)
  6023. #define RCC_AHB1RSTR_GPIOFRST ((uint32_t)0x00000020)
  6024. #define RCC_AHB1RSTR_GPIOGRST ((uint32_t)0x00000040)
  6025. #define RCC_AHB1RSTR_GPIOHRST ((uint32_t)0x00000080)
  6026. #define RCC_AHB1RSTR_GPIOIRST ((uint32_t)0x00000100)
  6027. #define RCC_AHB1RSTR_GPIOJRST ((uint32_t)0x00000200)
  6028. #define RCC_AHB1RSTR_GPIOKRST ((uint32_t)0x00000400)
  6029. #define RCC_AHB1RSTR_CRCRST ((uint32_t)0x00001000)
  6030. #define RCC_AHB1RSTR_DMA1RST ((uint32_t)0x00200000)
  6031. #define RCC_AHB1RSTR_DMA2RST ((uint32_t)0x00400000)
  6032. #define RCC_AHB1RSTR_DMA2DRST ((uint32_t)0x00800000)
  6033. #define RCC_AHB1RSTR_ETHMACRST ((uint32_t)0x02000000)
  6034. #define RCC_AHB1RSTR_OTGHRST ((uint32_t)0x20000000)
  6035. /******************** Bit definition for RCC_AHB2RSTR register **************/
  6036. #define RCC_AHB2RSTR_DCMIRST ((uint32_t)0x00000001)
  6037. #define RCC_AHB2RSTR_RNGRST ((uint32_t)0x00000040)
  6038. #define RCC_AHB2RSTR_OTGFSRST ((uint32_t)0x00000080)
  6039. /******************** Bit definition for RCC_AHB3RSTR register **************/
  6040. #define RCC_AHB3RSTR_FMCRST ((uint32_t)0x00000001)
  6041. #define RCC_AHB3RSTR_QSPIRST ((uint32_t)0x00000002)
  6042. /******************** Bit definition for RCC_APB1RSTR register **************/
  6043. #define RCC_APB1RSTR_TIM2RST ((uint32_t)0x00000001)
  6044. #define RCC_APB1RSTR_TIM3RST ((uint32_t)0x00000002)
  6045. #define RCC_APB1RSTR_TIM4RST ((uint32_t)0x00000004)
  6046. #define RCC_APB1RSTR_TIM5RST ((uint32_t)0x00000008)
  6047. #define RCC_APB1RSTR_TIM6RST ((uint32_t)0x00000010)
  6048. #define RCC_APB1RSTR_TIM7RST ((uint32_t)0x00000020)
  6049. #define RCC_APB1RSTR_TIM12RST ((uint32_t)0x00000040)
  6050. #define RCC_APB1RSTR_TIM13RST ((uint32_t)0x00000080)
  6051. #define RCC_APB1RSTR_TIM14RST ((uint32_t)0x00000100)
  6052. #define RCC_APB1RSTR_WWDGRST ((uint32_t)0x00000800)
  6053. #define RCC_APB1RSTR_SPI2RST ((uint32_t)0x00004000)
  6054. #define RCC_APB1RSTR_SPI3RST ((uint32_t)0x00008000)
  6055. #define RCC_APB1RSTR_USART2RST ((uint32_t)0x00020000)
  6056. #define RCC_APB1RSTR_USART3RST ((uint32_t)0x00040000)
  6057. #define RCC_APB1RSTR_UART4RST ((uint32_t)0x00080000)
  6058. #define RCC_APB1RSTR_UART5RST ((uint32_t)0x00100000)
  6059. #define RCC_APB1RSTR_I2C1RST ((uint32_t)0x00200000)
  6060. #define RCC_APB1RSTR_I2C2RST ((uint32_t)0x00400000)
  6061. #define RCC_APB1RSTR_I2C3RST ((uint32_t)0x00800000)
  6062. #define RCC_APB1RSTR_CAN1RST ((uint32_t)0x02000000)
  6063. #define RCC_APB1RSTR_CAN2RST ((uint32_t)0x04000000)
  6064. #define RCC_APB1RSTR_PWRRST ((uint32_t)0x10000000)
  6065. #define RCC_APB1RSTR_DACRST ((uint32_t)0x20000000)
  6066. #define RCC_APB1RSTR_UART7RST ((uint32_t)0x40000000)
  6067. #define RCC_APB1RSTR_UART8RST ((uint32_t)0x80000000)
  6068. /******************** Bit definition for RCC_APB2RSTR register **************/
  6069. #define RCC_APB2RSTR_TIM1RST ((uint32_t)0x00000001)
  6070. #define RCC_APB2RSTR_TIM8RST ((uint32_t)0x00000002)
  6071. #define RCC_APB2RSTR_USART1RST ((uint32_t)0x00000010)
  6072. #define RCC_APB2RSTR_USART6RST ((uint32_t)0x00000020)
  6073. #define RCC_APB2RSTR_ADCRST ((uint32_t)0x00000100)
  6074. #define RCC_APB2RSTR_SDIORST ((uint32_t)0x00000800)
  6075. #define RCC_APB2RSTR_SPI1RST ((uint32_t)0x00001000)
  6076. #define RCC_APB2RSTR_SPI4RST ((uint32_t)0x00002000)
  6077. #define RCC_APB2RSTR_SYSCFGRST ((uint32_t)0x00004000)
  6078. #define RCC_APB2RSTR_TIM9RST ((uint32_t)0x00010000)
  6079. #define RCC_APB2RSTR_TIM10RST ((uint32_t)0x00020000)
  6080. #define RCC_APB2RSTR_TIM11RST ((uint32_t)0x00040000)
  6081. #define RCC_APB2RSTR_SPI5RST ((uint32_t)0x00100000)
  6082. #define RCC_APB2RSTR_SPI6RST ((uint32_t)0x00200000)
  6083. #define RCC_APB2RSTR_SAI1RST ((uint32_t)0x00400000)
  6084. #define RCC_APB2RSTR_LTDCRST ((uint32_t)0x04000000)
  6085. #define RCC_APB2RSTR_DSIRST ((uint32_t)0x08000000)
  6086. /* Old SPI1RST bit definition, maintained for legacy purpose */
  6087. #define RCC_APB2RSTR_SPI1 RCC_APB2RSTR_SPI1RST
  6088. /******************** Bit definition for RCC_AHB1ENR register ***************/
  6089. #define RCC_AHB1ENR_GPIOAEN ((uint32_t)0x00000001)
  6090. #define RCC_AHB1ENR_GPIOBEN ((uint32_t)0x00000002)
  6091. #define RCC_AHB1ENR_GPIOCEN ((uint32_t)0x00000004)
  6092. #define RCC_AHB1ENR_GPIODEN ((uint32_t)0x00000008)
  6093. #define RCC_AHB1ENR_GPIOEEN ((uint32_t)0x00000010)
  6094. #define RCC_AHB1ENR_GPIOFEN ((uint32_t)0x00000020)
  6095. #define RCC_AHB1ENR_GPIOGEN ((uint32_t)0x00000040)
  6096. #define RCC_AHB1ENR_GPIOHEN ((uint32_t)0x00000080)
  6097. #define RCC_AHB1ENR_GPIOIEN ((uint32_t)0x00000100)
  6098. #define RCC_AHB1ENR_GPIOJEN ((uint32_t)0x00000200)
  6099. #define RCC_AHB1ENR_GPIOKEN ((uint32_t)0x00000400)
  6100. #define RCC_AHB1ENR_CRCEN ((uint32_t)0x00001000)
  6101. #define RCC_AHB1ENR_BKPSRAMEN ((uint32_t)0x00040000)
  6102. #define RCC_AHB1ENR_CCMDATARAMEN ((uint32_t)0x00100000)
  6103. #define RCC_AHB1ENR_DMA1EN ((uint32_t)0x00200000)
  6104. #define RCC_AHB1ENR_DMA2EN ((uint32_t)0x00400000)
  6105. #define RCC_AHB1ENR_DMA2DEN ((uint32_t)0x00800000)
  6106. #define RCC_AHB1ENR_ETHMACEN ((uint32_t)0x02000000)
  6107. #define RCC_AHB1ENR_ETHMACTXEN ((uint32_t)0x04000000)
  6108. #define RCC_AHB1ENR_ETHMACRXEN ((uint32_t)0x08000000)
  6109. #define RCC_AHB1ENR_ETHMACPTPEN ((uint32_t)0x10000000)
  6110. #define RCC_AHB1ENR_OTGHSEN ((uint32_t)0x20000000)
  6111. #define RCC_AHB1ENR_OTGHSULPIEN ((uint32_t)0x40000000)
  6112. /******************** Bit definition for RCC_AHB2ENR register ***************/
  6113. #define RCC_AHB2ENR_DCMIEN ((uint32_t)0x00000001)
  6114. #define RCC_AHB2ENR_RNGEN ((uint32_t)0x00000040)
  6115. #define RCC_AHB2ENR_OTGFSEN ((uint32_t)0x00000080)
  6116. /******************** Bit definition for RCC_AHB3ENR register ***************/
  6117. #define RCC_AHB3ENR_FMCEN ((uint32_t)0x00000001)
  6118. #define RCC_AHB3ENR_QSPIEN ((uint32_t)0x00000002)
  6119. /******************** Bit definition for RCC_APB1ENR register ***************/
  6120. #define RCC_APB1ENR_TIM2EN ((uint32_t)0x00000001)
  6121. #define RCC_APB1ENR_TIM3EN ((uint32_t)0x00000002)
  6122. #define RCC_APB1ENR_TIM4EN ((uint32_t)0x00000004)
  6123. #define RCC_APB1ENR_TIM5EN ((uint32_t)0x00000008)
  6124. #define RCC_APB1ENR_TIM6EN ((uint32_t)0x00000010)
  6125. #define RCC_APB1ENR_TIM7EN ((uint32_t)0x00000020)
  6126. #define RCC_APB1ENR_TIM12EN ((uint32_t)0x00000040)
  6127. #define RCC_APB1ENR_TIM13EN ((uint32_t)0x00000080)
  6128. #define RCC_APB1ENR_TIM14EN ((uint32_t)0x00000100)
  6129. #define RCC_APB1ENR_WWDGEN ((uint32_t)0x00000800)
  6130. #define RCC_APB1ENR_SPI2EN ((uint32_t)0x00004000)
  6131. #define RCC_APB1ENR_SPI3EN ((uint32_t)0x00008000)
  6132. #define RCC_APB1ENR_USART2EN ((uint32_t)0x00020000)
  6133. #define RCC_APB1ENR_USART3EN ((uint32_t)0x00040000)
  6134. #define RCC_APB1ENR_UART4EN ((uint32_t)0x00080000)
  6135. #define RCC_APB1ENR_UART5EN ((uint32_t)0x00100000)
  6136. #define RCC_APB1ENR_I2C1EN ((uint32_t)0x00200000)
  6137. #define RCC_APB1ENR_I2C2EN ((uint32_t)0x00400000)
  6138. #define RCC_APB1ENR_I2C3EN ((uint32_t)0x00800000)
  6139. #define RCC_APB1ENR_CAN1EN ((uint32_t)0x02000000)
  6140. #define RCC_APB1ENR_CAN2EN ((uint32_t)0x04000000)
  6141. #define RCC_APB1ENR_PWREN ((uint32_t)0x10000000)
  6142. #define RCC_APB1ENR_DACEN ((uint32_t)0x20000000)
  6143. #define RCC_APB1ENR_UART7EN ((uint32_t)0x40000000)
  6144. #define RCC_APB1ENR_UART8EN ((uint32_t)0x80000000)
  6145. /******************** Bit definition for RCC_APB2ENR register ***************/
  6146. #define RCC_APB2ENR_TIM1EN ((uint32_t)0x00000001)
  6147. #define RCC_APB2ENR_TIM8EN ((uint32_t)0x00000002)
  6148. #define RCC_APB2ENR_USART1EN ((uint32_t)0x00000010)
  6149. #define RCC_APB2ENR_USART6EN ((uint32_t)0x00000020)
  6150. #define RCC_APB2ENR_ADC1EN ((uint32_t)0x00000100)
  6151. #define RCC_APB2ENR_ADC2EN ((uint32_t)0x00000200)
  6152. #define RCC_APB2ENR_ADC3EN ((uint32_t)0x00000400)
  6153. #define RCC_APB2ENR_SDIOEN ((uint32_t)0x00000800)
  6154. #define RCC_APB2ENR_SPI1EN ((uint32_t)0x00001000)
  6155. #define RCC_APB2ENR_SPI4EN ((uint32_t)0x00002000)
  6156. #define RCC_APB2ENR_SYSCFGEN ((uint32_t)0x00004000)
  6157. #define RCC_APB2ENR_TIM9EN ((uint32_t)0x00010000)
  6158. #define RCC_APB2ENR_TIM10EN ((uint32_t)0x00020000)
  6159. #define RCC_APB2ENR_TIM11EN ((uint32_t)0x00040000)
  6160. #define RCC_APB2ENR_SPI5EN ((uint32_t)0x00100000)
  6161. #define RCC_APB2ENR_SPI6EN ((uint32_t)0x00200000)
  6162. #define RCC_APB2ENR_SAI1EN ((uint32_t)0x00400000)
  6163. #define RCC_APB2ENR_LTDCEN ((uint32_t)0x04000000)
  6164. #define RCC_APB2ENR_DSIEN ((uint32_t)0x08000000)
  6165. /******************** Bit definition for RCC_AHB1LPENR register *************/
  6166. #define RCC_AHB1LPENR_GPIOALPEN ((uint32_t)0x00000001)
  6167. #define RCC_AHB1LPENR_GPIOBLPEN ((uint32_t)0x00000002)
  6168. #define RCC_AHB1LPENR_GPIOCLPEN ((uint32_t)0x00000004)
  6169. #define RCC_AHB1LPENR_GPIODLPEN ((uint32_t)0x00000008)
  6170. #define RCC_AHB1LPENR_GPIOELPEN ((uint32_t)0x00000010)
  6171. #define RCC_AHB1LPENR_GPIOFLPEN ((uint32_t)0x00000020)
  6172. #define RCC_AHB1LPENR_GPIOGLPEN ((uint32_t)0x00000040)
  6173. #define RCC_AHB1LPENR_GPIOHLPEN ((uint32_t)0x00000080)
  6174. #define RCC_AHB1LPENR_GPIOILPEN ((uint32_t)0x00000100)
  6175. #define RCC_AHB1LPENR_GPIOJLPEN ((uint32_t)0x00000200)
  6176. #define RCC_AHB1LPENR_GPIOKLPEN ((uint32_t)0x00000400)
  6177. #define RCC_AHB1LPENR_CRCLPEN ((uint32_t)0x00001000)
  6178. #define RCC_AHB1LPENR_FLITFLPEN ((uint32_t)0x00008000)
  6179. #define RCC_AHB1LPENR_SRAM1LPEN ((uint32_t)0x00010000)
  6180. #define RCC_AHB1LPENR_SRAM2LPEN ((uint32_t)0x00020000)
  6181. #define RCC_AHB1LPENR_BKPSRAMLPEN ((uint32_t)0x00040000)
  6182. #define RCC_AHB1LPENR_SRAM3LPEN ((uint32_t)0x00080000)
  6183. #define RCC_AHB1LPENR_DMA1LPEN ((uint32_t)0x00200000)
  6184. #define RCC_AHB1LPENR_DMA2LPEN ((uint32_t)0x00400000)
  6185. #define RCC_AHB1LPENR_DMA2DLPEN ((uint32_t)0x00800000)
  6186. #define RCC_AHB1LPENR_ETHMACLPEN ((uint32_t)0x02000000)
  6187. #define RCC_AHB1LPENR_ETHMACTXLPEN ((uint32_t)0x04000000)
  6188. #define RCC_AHB1LPENR_ETHMACRXLPEN ((uint32_t)0x08000000)
  6189. #define RCC_AHB1LPENR_ETHMACPTPLPEN ((uint32_t)0x10000000)
  6190. #define RCC_AHB1LPENR_OTGHSLPEN ((uint32_t)0x20000000)
  6191. #define RCC_AHB1LPENR_OTGHSULPILPEN ((uint32_t)0x40000000)
  6192. /******************** Bit definition for RCC_AHB2LPENR register *************/
  6193. #define RCC_AHB2LPENR_DCMILPEN ((uint32_t)0x00000001)
  6194. #define RCC_AHB2LPENR_RNGLPEN ((uint32_t)0x00000040)
  6195. #define RCC_AHB2LPENR_OTGFSLPEN ((uint32_t)0x00000080)
  6196. /******************** Bit definition for RCC_AHB3LPENR register *************/
  6197. #define RCC_AHB3LPENR_FMCLPEN ((uint32_t)0x00000001)
  6198. #define RCC_AHB3LPENR_QSPILPEN ((uint32_t)0x00000002)
  6199. /******************** Bit definition for RCC_APB1LPENR register *************/
  6200. #define RCC_APB1LPENR_TIM2LPEN ((uint32_t)0x00000001)
  6201. #define RCC_APB1LPENR_TIM3LPEN ((uint32_t)0x00000002)
  6202. #define RCC_APB1LPENR_TIM4LPEN ((uint32_t)0x00000004)
  6203. #define RCC_APB1LPENR_TIM5LPEN ((uint32_t)0x00000008)
  6204. #define RCC_APB1LPENR_TIM6LPEN ((uint32_t)0x00000010)
  6205. #define RCC_APB1LPENR_TIM7LPEN ((uint32_t)0x00000020)
  6206. #define RCC_APB1LPENR_TIM12LPEN ((uint32_t)0x00000040)
  6207. #define RCC_APB1LPENR_TIM13LPEN ((uint32_t)0x00000080)
  6208. #define RCC_APB1LPENR_TIM14LPEN ((uint32_t)0x00000100)
  6209. #define RCC_APB1LPENR_WWDGLPEN ((uint32_t)0x00000800)
  6210. #define RCC_APB1LPENR_SPI2LPEN ((uint32_t)0x00004000)
  6211. #define RCC_APB1LPENR_SPI3LPEN ((uint32_t)0x00008000)
  6212. #define RCC_APB1LPENR_USART2LPEN ((uint32_t)0x00020000)
  6213. #define RCC_APB1LPENR_USART3LPEN ((uint32_t)0x00040000)
  6214. #define RCC_APB1LPENR_UART4LPEN ((uint32_t)0x00080000)
  6215. #define RCC_APB1LPENR_UART5LPEN ((uint32_t)0x00100000)
  6216. #define RCC_APB1LPENR_I2C1LPEN ((uint32_t)0x00200000)
  6217. #define RCC_APB1LPENR_I2C2LPEN ((uint32_t)0x00400000)
  6218. #define RCC_APB1LPENR_I2C3LPEN ((uint32_t)0x00800000)
  6219. #define RCC_APB1LPENR_CAN1LPEN ((uint32_t)0x02000000)
  6220. #define RCC_APB1LPENR_CAN2LPEN ((uint32_t)0x04000000)
  6221. #define RCC_APB1LPENR_PWRLPEN ((uint32_t)0x10000000)
  6222. #define RCC_APB1LPENR_DACLPEN ((uint32_t)0x20000000)
  6223. #define RCC_APB1LPENR_UART7LPEN ((uint32_t)0x40000000)
  6224. #define RCC_APB1LPENR_UART8LPEN ((uint32_t)0x80000000)
  6225. /******************** Bit definition for RCC_APB2LPENR register *************/
  6226. #define RCC_APB2LPENR_TIM1LPEN ((uint32_t)0x00000001)
  6227. #define RCC_APB2LPENR_TIM8LPEN ((uint32_t)0x00000002)
  6228. #define RCC_APB2LPENR_USART1LPEN ((uint32_t)0x00000010)
  6229. #define RCC_APB2LPENR_USART6LPEN ((uint32_t)0x00000020)
  6230. #define RCC_APB2LPENR_ADC1LPEN ((uint32_t)0x00000100)
  6231. #define RCC_APB2LPENR_ADC2LPEN ((uint32_t)0x00000200)
  6232. #define RCC_APB2LPENR_ADC3LPEN ((uint32_t)0x00000400)
  6233. #define RCC_APB2LPENR_SDIOLPEN ((uint32_t)0x00000800)
  6234. #define RCC_APB2LPENR_SPI1LPEN ((uint32_t)0x00001000)
  6235. #define RCC_APB2LPENR_SPI4LPEN ((uint32_t)0x00002000)
  6236. #define RCC_APB2LPENR_SYSCFGLPEN ((uint32_t)0x00004000)
  6237. #define RCC_APB2LPENR_TIM9LPEN ((uint32_t)0x00010000)
  6238. #define RCC_APB2LPENR_TIM10LPEN ((uint32_t)0x00020000)
  6239. #define RCC_APB2LPENR_TIM11LPEN ((uint32_t)0x00040000)
  6240. #define RCC_APB2LPENR_SPI5LPEN ((uint32_t)0x00100000)
  6241. #define RCC_APB2LPENR_SPI6LPEN ((uint32_t)0x00200000)
  6242. #define RCC_APB2LPENR_SAI1LPEN ((uint32_t)0x00400000)
  6243. #define RCC_APB2LPENR_LTDCLPEN ((uint32_t)0x04000000)
  6244. #define RCC_APB2LPENR_DSILPEN ((uint32_t)0x08000000)
  6245. /******************** Bit definition for RCC_BDCR register ******************/
  6246. #define RCC_BDCR_LSEON ((uint32_t)0x00000001)
  6247. #define RCC_BDCR_LSERDY ((uint32_t)0x00000002)
  6248. #define RCC_BDCR_LSEBYP ((uint32_t)0x00000004)
  6249. #define RCC_BDCR_LSEMOD ((uint32_t)0x00000008)
  6250. #define RCC_BDCR_RTCSEL ((uint32_t)0x00000300)
  6251. #define RCC_BDCR_RTCSEL_0 ((uint32_t)0x00000100)
  6252. #define RCC_BDCR_RTCSEL_1 ((uint32_t)0x00000200)
  6253. #define RCC_BDCR_RTCEN ((uint32_t)0x00008000)
  6254. #define RCC_BDCR_BDRST ((uint32_t)0x00010000)
  6255. /******************** Bit definition for RCC_CSR register *******************/
  6256. #define RCC_CSR_LSION ((uint32_t)0x00000001)
  6257. #define RCC_CSR_LSIRDY ((uint32_t)0x00000002)
  6258. #define RCC_CSR_RMVF ((uint32_t)0x01000000)
  6259. #define RCC_CSR_BORRSTF ((uint32_t)0x02000000)
  6260. #define RCC_CSR_PADRSTF ((uint32_t)0x04000000)
  6261. #define RCC_CSR_PORRSTF ((uint32_t)0x08000000)
  6262. #define RCC_CSR_SFTRSTF ((uint32_t)0x10000000)
  6263. #define RCC_CSR_WDGRSTF ((uint32_t)0x20000000)
  6264. #define RCC_CSR_WWDGRSTF ((uint32_t)0x40000000)
  6265. #define RCC_CSR_LPWRRSTF ((uint32_t)0x80000000)
  6266. /******************** Bit definition for RCC_SSCGR register *****************/
  6267. #define RCC_SSCGR_MODPER ((uint32_t)0x00001FFF)
  6268. #define RCC_SSCGR_INCSTEP ((uint32_t)0x0FFFE000)
  6269. #define RCC_SSCGR_SPREADSEL ((uint32_t)0x40000000)
  6270. #define RCC_SSCGR_SSCGEN ((uint32_t)0x80000000)
  6271. /******************** Bit definition for RCC_PLLI2SCFGR register ************/
  6272. #define RCC_PLLI2SCFGR_PLLI2SN ((uint32_t)0x00007FC0)
  6273. #define RCC_PLLI2SCFGR_PLLI2SN_0 ((uint32_t)0x00000040)
  6274. #define RCC_PLLI2SCFGR_PLLI2SN_1 ((uint32_t)0x00000080)
  6275. #define RCC_PLLI2SCFGR_PLLI2SN_2 ((uint32_t)0x00000100)
  6276. #define RCC_PLLI2SCFGR_PLLI2SN_3 ((uint32_t)0x00000200)
  6277. #define RCC_PLLI2SCFGR_PLLI2SN_4 ((uint32_t)0x00000400)
  6278. #define RCC_PLLI2SCFGR_PLLI2SN_5 ((uint32_t)0x00000800)
  6279. #define RCC_PLLI2SCFGR_PLLI2SN_6 ((uint32_t)0x00001000)
  6280. #define RCC_PLLI2SCFGR_PLLI2SN_7 ((uint32_t)0x00002000)
  6281. #define RCC_PLLI2SCFGR_PLLI2SN_8 ((uint32_t)0x00004000)
  6282. #define RCC_PLLI2SCFGR_PLLI2SQ ((uint32_t)0x0F000000)
  6283. #define RCC_PLLI2SCFGR_PLLI2SQ_0 ((uint32_t)0x01000000)
  6284. #define RCC_PLLI2SCFGR_PLLI2SQ_1 ((uint32_t)0x02000000)
  6285. #define RCC_PLLI2SCFGR_PLLI2SQ_2 ((uint32_t)0x04000000)
  6286. #define RCC_PLLI2SCFGR_PLLI2SQ_3 ((uint32_t)0x08000000)
  6287. #define RCC_PLLI2SCFGR_PLLI2SR ((uint32_t)0x70000000)
  6288. #define RCC_PLLI2SCFGR_PLLI2SR_0 ((uint32_t)0x10000000)
  6289. #define RCC_PLLI2SCFGR_PLLI2SR_1 ((uint32_t)0x20000000)
  6290. #define RCC_PLLI2SCFGR_PLLI2SR_2 ((uint32_t)0x40000000)
  6291. /******************** Bit definition for RCC_PLLSAICFGR register ************/
  6292. #define RCC_PLLSAICFGR_PLLSAIN ((uint32_t)0x00007FC0)
  6293. #define RCC_PLLSAICFGR_PLLSAIN_0 ((uint32_t)0x00000040)
  6294. #define RCC_PLLSAICFGR_PLLSAIN_1 ((uint32_t)0x00000080)
  6295. #define RCC_PLLSAICFGR_PLLSAIN_2 ((uint32_t)0x00000100)
  6296. #define RCC_PLLSAICFGR_PLLSAIN_3 ((uint32_t)0x00000200)
  6297. #define RCC_PLLSAICFGR_PLLSAIN_4 ((uint32_t)0x00000400)
  6298. #define RCC_PLLSAICFGR_PLLSAIN_5 ((uint32_t)0x00000800)
  6299. #define RCC_PLLSAICFGR_PLLSAIN_6 ((uint32_t)0x00001000)
  6300. #define RCC_PLLSAICFGR_PLLSAIN_7 ((uint32_t)0x00002000)
  6301. #define RCC_PLLSAICFGR_PLLSAIN_8 ((uint32_t)0x00004000)
  6302. #define RCC_PLLSAICFGR_PLLSAIP ((uint32_t)0x00030000)
  6303. #define RCC_PLLSAICFGR_PLLSAIP_0 ((uint32_t)0x00010000)
  6304. #define RCC_PLLSAICFGR_PLLSAIP_1 ((uint32_t)0x00020000)
  6305. #define RCC_PLLSAICFGR_PLLSAIQ ((uint32_t)0x0F000000)
  6306. #define RCC_PLLSAICFGR_PLLSAIQ_0 ((uint32_t)0x01000000)
  6307. #define RCC_PLLSAICFGR_PLLSAIQ_1 ((uint32_t)0x02000000)
  6308. #define RCC_PLLSAICFGR_PLLSAIQ_2 ((uint32_t)0x04000000)
  6309. #define RCC_PLLSAICFGR_PLLSAIQ_3 ((uint32_t)0x08000000)
  6310. #define RCC_PLLSAICFGR_PLLSAIR ((uint32_t)0x70000000)
  6311. #define RCC_PLLSAICFGR_PLLSAIR_0 ((uint32_t)0x10000000)
  6312. #define RCC_PLLSAICFGR_PLLSAIR_1 ((uint32_t)0x20000000)
  6313. #define RCC_PLLSAICFGR_PLLSAIR_2 ((uint32_t)0x40000000)
  6314. /******************** Bit definition for RCC_DCKCFGR register ***************/
  6315. #define RCC_DCKCFGR_PLLI2SDIVQ ((uint32_t)0x0000001F)
  6316. #define RCC_DCKCFGR_PLLSAIDIVQ ((uint32_t)0x00001F00)
  6317. #define RCC_DCKCFGR_PLLSAIDIVR ((uint32_t)0x00030000)
  6318. #define RCC_DCKCFGR_SAI1ASRC ((uint32_t)0x00300000)
  6319. #define RCC_DCKCFGR_SAI1ASRC_0 ((uint32_t)0x00100000)
  6320. #define RCC_DCKCFGR_SAI1ASRC_1 ((uint32_t)0x00200000)
  6321. #define RCC_DCKCFGR_SAI1BSRC ((uint32_t)0x00C00000)
  6322. #define RCC_DCKCFGR_SAI1BSRC_0 ((uint32_t)0x00400000)
  6323. #define RCC_DCKCFGR_SAI1BSRC_1 ((uint32_t)0x00800000)
  6324. #define RCC_DCKCFGR_TIMPRE ((uint32_t)0x01000000)
  6325. #define RCC_DCKCFGR_CK48MSEL ((uint32_t)0x08000000)
  6326. #define RCC_DCKCFGR_SDIOSEL ((uint32_t)0x10000000)
  6327. #define RCC_DCKCFGR_DSISEL ((uint32_t)0x20000000)
  6328. /******************************************************************************/
  6329. /* */
  6330. /* RNG */
  6331. /* */
  6332. /******************************************************************************/
  6333. /******************** Bits definition for RNG_CR register *******************/
  6334. #define RNG_CR_RNGEN ((uint32_t)0x00000004)
  6335. #define RNG_CR_IE ((uint32_t)0x00000008)
  6336. /******************** Bits definition for RNG_SR register *******************/
  6337. #define RNG_SR_DRDY ((uint32_t)0x00000001)
  6338. #define RNG_SR_CECS ((uint32_t)0x00000002)
  6339. #define RNG_SR_SECS ((uint32_t)0x00000004)
  6340. #define RNG_SR_CEIS ((uint32_t)0x00000020)
  6341. #define RNG_SR_SEIS ((uint32_t)0x00000040)
  6342. /******************************************************************************/
  6343. /* */
  6344. /* Real-Time Clock (RTC) */
  6345. /* */
  6346. /******************************************************************************/
  6347. /******************** Bits definition for RTC_TR register *******************/
  6348. #define RTC_TR_PM ((uint32_t)0x00400000)
  6349. #define RTC_TR_HT ((uint32_t)0x00300000)
  6350. #define RTC_TR_HT_0 ((uint32_t)0x00100000)
  6351. #define RTC_TR_HT_1 ((uint32_t)0x00200000)
  6352. #define RTC_TR_HU ((uint32_t)0x000F0000)
  6353. #define RTC_TR_HU_0 ((uint32_t)0x00010000)
  6354. #define RTC_TR_HU_1 ((uint32_t)0x00020000)
  6355. #define RTC_TR_HU_2 ((uint32_t)0x00040000)
  6356. #define RTC_TR_HU_3 ((uint32_t)0x00080000)
  6357. #define RTC_TR_MNT ((uint32_t)0x00007000)
  6358. #define RTC_TR_MNT_0 ((uint32_t)0x00001000)
  6359. #define RTC_TR_MNT_1 ((uint32_t)0x00002000)
  6360. #define RTC_TR_MNT_2 ((uint32_t)0x00004000)
  6361. #define RTC_TR_MNU ((uint32_t)0x00000F00)
  6362. #define RTC_TR_MNU_0 ((uint32_t)0x00000100)
  6363. #define RTC_TR_MNU_1 ((uint32_t)0x00000200)
  6364. #define RTC_TR_MNU_2 ((uint32_t)0x00000400)
  6365. #define RTC_TR_MNU_3 ((uint32_t)0x00000800)
  6366. #define RTC_TR_ST ((uint32_t)0x00000070)
  6367. #define RTC_TR_ST_0 ((uint32_t)0x00000010)
  6368. #define RTC_TR_ST_1 ((uint32_t)0x00000020)
  6369. #define RTC_TR_ST_2 ((uint32_t)0x00000040)
  6370. #define RTC_TR_SU ((uint32_t)0x0000000F)
  6371. #define RTC_TR_SU_0 ((uint32_t)0x00000001)
  6372. #define RTC_TR_SU_1 ((uint32_t)0x00000002)
  6373. #define RTC_TR_SU_2 ((uint32_t)0x00000004)
  6374. #define RTC_TR_SU_3 ((uint32_t)0x00000008)
  6375. /******************** Bits definition for RTC_DR register *******************/
  6376. #define RTC_DR_YT ((uint32_t)0x00F00000)
  6377. #define RTC_DR_YT_0 ((uint32_t)0x00100000)
  6378. #define RTC_DR_YT_1 ((uint32_t)0x00200000)
  6379. #define RTC_DR_YT_2 ((uint32_t)0x00400000)
  6380. #define RTC_DR_YT_3 ((uint32_t)0x00800000)
  6381. #define RTC_DR_YU ((uint32_t)0x000F0000)
  6382. #define RTC_DR_YU_0 ((uint32_t)0x00010000)
  6383. #define RTC_DR_YU_1 ((uint32_t)0x00020000)
  6384. #define RTC_DR_YU_2 ((uint32_t)0x00040000)
  6385. #define RTC_DR_YU_3 ((uint32_t)0x00080000)
  6386. #define RTC_DR_WDU ((uint32_t)0x0000E000)
  6387. #define RTC_DR_WDU_0 ((uint32_t)0x00002000)
  6388. #define RTC_DR_WDU_1 ((uint32_t)0x00004000)
  6389. #define RTC_DR_WDU_2 ((uint32_t)0x00008000)
  6390. #define RTC_DR_MT ((uint32_t)0x00001000)
  6391. #define RTC_DR_MU ((uint32_t)0x00000F00)
  6392. #define RTC_DR_MU_0 ((uint32_t)0x00000100)
  6393. #define RTC_DR_MU_1 ((uint32_t)0x00000200)
  6394. #define RTC_DR_MU_2 ((uint32_t)0x00000400)
  6395. #define RTC_DR_MU_3 ((uint32_t)0x00000800)
  6396. #define RTC_DR_DT ((uint32_t)0x00000030)
  6397. #define RTC_DR_DT_0 ((uint32_t)0x00000010)
  6398. #define RTC_DR_DT_1 ((uint32_t)0x00000020)
  6399. #define RTC_DR_DU ((uint32_t)0x0000000F)
  6400. #define RTC_DR_DU_0 ((uint32_t)0x00000001)
  6401. #define RTC_DR_DU_1 ((uint32_t)0x00000002)
  6402. #define RTC_DR_DU_2 ((uint32_t)0x00000004)
  6403. #define RTC_DR_DU_3 ((uint32_t)0x00000008)
  6404. /******************** Bits definition for RTC_CR register *******************/
  6405. #define RTC_CR_COE ((uint32_t)0x00800000)
  6406. #define RTC_CR_OSEL ((uint32_t)0x00600000)
  6407. #define RTC_CR_OSEL_0 ((uint32_t)0x00200000)
  6408. #define RTC_CR_OSEL_1 ((uint32_t)0x00400000)
  6409. #define RTC_CR_POL ((uint32_t)0x00100000)
  6410. #define RTC_CR_COSEL ((uint32_t)0x00080000)
  6411. #define RTC_CR_BCK ((uint32_t)0x00040000)
  6412. #define RTC_CR_SUB1H ((uint32_t)0x00020000)
  6413. #define RTC_CR_ADD1H ((uint32_t)0x00010000)
  6414. #define RTC_CR_TSIE ((uint32_t)0x00008000)
  6415. #define RTC_CR_WUTIE ((uint32_t)0x00004000)
  6416. #define RTC_CR_ALRBIE ((uint32_t)0x00002000)
  6417. #define RTC_CR_ALRAIE ((uint32_t)0x00001000)
  6418. #define RTC_CR_TSE ((uint32_t)0x00000800)
  6419. #define RTC_CR_WUTE ((uint32_t)0x00000400)
  6420. #define RTC_CR_ALRBE ((uint32_t)0x00000200)
  6421. #define RTC_CR_ALRAE ((uint32_t)0x00000100)
  6422. #define RTC_CR_DCE ((uint32_t)0x00000080)
  6423. #define RTC_CR_FMT ((uint32_t)0x00000040)
  6424. #define RTC_CR_BYPSHAD ((uint32_t)0x00000020)
  6425. #define RTC_CR_REFCKON ((uint32_t)0x00000010)
  6426. #define RTC_CR_TSEDGE ((uint32_t)0x00000008)
  6427. #define RTC_CR_WUCKSEL ((uint32_t)0x00000007)
  6428. #define RTC_CR_WUCKSEL_0 ((uint32_t)0x00000001)
  6429. #define RTC_CR_WUCKSEL_1 ((uint32_t)0x00000002)
  6430. #define RTC_CR_WUCKSEL_2 ((uint32_t)0x00000004)
  6431. /******************** Bits definition for RTC_ISR register ******************/
  6432. #define RTC_ISR_RECALPF ((uint32_t)0x00010000)
  6433. #define RTC_ISR_TAMP1F ((uint32_t)0x00002000)
  6434. #define RTC_ISR_TAMP2F ((uint32_t)0x00004000)
  6435. #define RTC_ISR_TSOVF ((uint32_t)0x00001000)
  6436. #define RTC_ISR_TSF ((uint32_t)0x00000800)
  6437. #define RTC_ISR_WUTF ((uint32_t)0x00000400)
  6438. #define RTC_ISR_ALRBF ((uint32_t)0x00000200)
  6439. #define RTC_ISR_ALRAF ((uint32_t)0x00000100)
  6440. #define RTC_ISR_INIT ((uint32_t)0x00000080)
  6441. #define RTC_ISR_INITF ((uint32_t)0x00000040)
  6442. #define RTC_ISR_RSF ((uint32_t)0x00000020)
  6443. #define RTC_ISR_INITS ((uint32_t)0x00000010)
  6444. #define RTC_ISR_SHPF ((uint32_t)0x00000008)
  6445. #define RTC_ISR_WUTWF ((uint32_t)0x00000004)
  6446. #define RTC_ISR_ALRBWF ((uint32_t)0x00000002)
  6447. #define RTC_ISR_ALRAWF ((uint32_t)0x00000001)
  6448. /******************** Bits definition for RTC_PRER register *****************/
  6449. #define RTC_PRER_PREDIV_A ((uint32_t)0x007F0000)
  6450. #define RTC_PRER_PREDIV_S ((uint32_t)0x00007FFF)
  6451. /******************** Bits definition for RTC_WUTR register *****************/
  6452. #define RTC_WUTR_WUT ((uint32_t)0x0000FFFF)
  6453. /******************** Bits definition for RTC_CALIBR register ***************/
  6454. #define RTC_CALIBR_DCS ((uint32_t)0x00000080)
  6455. #define RTC_CALIBR_DC ((uint32_t)0x0000001F)
  6456. /******************** Bits definition for RTC_ALRMAR register ***************/
  6457. #define RTC_ALRMAR_MSK4 ((uint32_t)0x80000000)
  6458. #define RTC_ALRMAR_WDSEL ((uint32_t)0x40000000)
  6459. #define RTC_ALRMAR_DT ((uint32_t)0x30000000)
  6460. #define RTC_ALRMAR_DT_0 ((uint32_t)0x10000000)
  6461. #define RTC_ALRMAR_DT_1 ((uint32_t)0x20000000)
  6462. #define RTC_ALRMAR_DU ((uint32_t)0x0F000000)
  6463. #define RTC_ALRMAR_DU_0 ((uint32_t)0x01000000)
  6464. #define RTC_ALRMAR_DU_1 ((uint32_t)0x02000000)
  6465. #define RTC_ALRMAR_DU_2 ((uint32_t)0x04000000)
  6466. #define RTC_ALRMAR_DU_3 ((uint32_t)0x08000000)
  6467. #define RTC_ALRMAR_MSK3 ((uint32_t)0x00800000)
  6468. #define RTC_ALRMAR_PM ((uint32_t)0x00400000)
  6469. #define RTC_ALRMAR_HT ((uint32_t)0x00300000)
  6470. #define RTC_ALRMAR_HT_0 ((uint32_t)0x00100000)
  6471. #define RTC_ALRMAR_HT_1 ((uint32_t)0x00200000)
  6472. #define RTC_ALRMAR_HU ((uint32_t)0x000F0000)
  6473. #define RTC_ALRMAR_HU_0 ((uint32_t)0x00010000)
  6474. #define RTC_ALRMAR_HU_1 ((uint32_t)0x00020000)
  6475. #define RTC_ALRMAR_HU_2 ((uint32_t)0x00040000)
  6476. #define RTC_ALRMAR_HU_3 ((uint32_t)0x00080000)
  6477. #define RTC_ALRMAR_MSK2 ((uint32_t)0x00008000)
  6478. #define RTC_ALRMAR_MNT ((uint32_t)0x00007000)
  6479. #define RTC_ALRMAR_MNT_0 ((uint32_t)0x00001000)
  6480. #define RTC_ALRMAR_MNT_1 ((uint32_t)0x00002000)
  6481. #define RTC_ALRMAR_MNT_2 ((uint32_t)0x00004000)
  6482. #define RTC_ALRMAR_MNU ((uint32_t)0x00000F00)
  6483. #define RTC_ALRMAR_MNU_0 ((uint32_t)0x00000100)
  6484. #define RTC_ALRMAR_MNU_1 ((uint32_t)0x00000200)
  6485. #define RTC_ALRMAR_MNU_2 ((uint32_t)0x00000400)
  6486. #define RTC_ALRMAR_MNU_3 ((uint32_t)0x00000800)
  6487. #define RTC_ALRMAR_MSK1 ((uint32_t)0x00000080)
  6488. #define RTC_ALRMAR_ST ((uint32_t)0x00000070)
  6489. #define RTC_ALRMAR_ST_0 ((uint32_t)0x00000010)
  6490. #define RTC_ALRMAR_ST_1 ((uint32_t)0x00000020)
  6491. #define RTC_ALRMAR_ST_2 ((uint32_t)0x00000040)
  6492. #define RTC_ALRMAR_SU ((uint32_t)0x0000000F)
  6493. #define RTC_ALRMAR_SU_0 ((uint32_t)0x00000001)
  6494. #define RTC_ALRMAR_SU_1 ((uint32_t)0x00000002)
  6495. #define RTC_ALRMAR_SU_2 ((uint32_t)0x00000004)
  6496. #define RTC_ALRMAR_SU_3 ((uint32_t)0x00000008)
  6497. /******************** Bits definition for RTC_ALRMBR register ***************/
  6498. #define RTC_ALRMBR_MSK4 ((uint32_t)0x80000000)
  6499. #define RTC_ALRMBR_WDSEL ((uint32_t)0x40000000)
  6500. #define RTC_ALRMBR_DT ((uint32_t)0x30000000)
  6501. #define RTC_ALRMBR_DT_0 ((uint32_t)0x10000000)
  6502. #define RTC_ALRMBR_DT_1 ((uint32_t)0x20000000)
  6503. #define RTC_ALRMBR_DU ((uint32_t)0x0F000000)
  6504. #define RTC_ALRMBR_DU_0 ((uint32_t)0x01000000)
  6505. #define RTC_ALRMBR_DU_1 ((uint32_t)0x02000000)
  6506. #define RTC_ALRMBR_DU_2 ((uint32_t)0x04000000)
  6507. #define RTC_ALRMBR_DU_3 ((uint32_t)0x08000000)
  6508. #define RTC_ALRMBR_MSK3 ((uint32_t)0x00800000)
  6509. #define RTC_ALRMBR_PM ((uint32_t)0x00400000)
  6510. #define RTC_ALRMBR_HT ((uint32_t)0x00300000)
  6511. #define RTC_ALRMBR_HT_0 ((uint32_t)0x00100000)
  6512. #define RTC_ALRMBR_HT_1 ((uint32_t)0x00200000)
  6513. #define RTC_ALRMBR_HU ((uint32_t)0x000F0000)
  6514. #define RTC_ALRMBR_HU_0 ((uint32_t)0x00010000)
  6515. #define RTC_ALRMBR_HU_1 ((uint32_t)0x00020000)
  6516. #define RTC_ALRMBR_HU_2 ((uint32_t)0x00040000)
  6517. #define RTC_ALRMBR_HU_3 ((uint32_t)0x00080000)
  6518. #define RTC_ALRMBR_MSK2 ((uint32_t)0x00008000)
  6519. #define RTC_ALRMBR_MNT ((uint32_t)0x00007000)
  6520. #define RTC_ALRMBR_MNT_0 ((uint32_t)0x00001000)
  6521. #define RTC_ALRMBR_MNT_1 ((uint32_t)0x00002000)
  6522. #define RTC_ALRMBR_MNT_2 ((uint32_t)0x00004000)
  6523. #define RTC_ALRMBR_MNU ((uint32_t)0x00000F00)
  6524. #define RTC_ALRMBR_MNU_0 ((uint32_t)0x00000100)
  6525. #define RTC_ALRMBR_MNU_1 ((uint32_t)0x00000200)
  6526. #define RTC_ALRMBR_MNU_2 ((uint32_t)0x00000400)
  6527. #define RTC_ALRMBR_MNU_3 ((uint32_t)0x00000800)
  6528. #define RTC_ALRMBR_MSK1 ((uint32_t)0x00000080)
  6529. #define RTC_ALRMBR_ST ((uint32_t)0x00000070)
  6530. #define RTC_ALRMBR_ST_0 ((uint32_t)0x00000010)
  6531. #define RTC_ALRMBR_ST_1 ((uint32_t)0x00000020)
  6532. #define RTC_ALRMBR_ST_2 ((uint32_t)0x00000040)
  6533. #define RTC_ALRMBR_SU ((uint32_t)0x0000000F)
  6534. #define RTC_ALRMBR_SU_0 ((uint32_t)0x00000001)
  6535. #define RTC_ALRMBR_SU_1 ((uint32_t)0x00000002)
  6536. #define RTC_ALRMBR_SU_2 ((uint32_t)0x00000004)
  6537. #define RTC_ALRMBR_SU_3 ((uint32_t)0x00000008)
  6538. /******************** Bits definition for RTC_WPR register ******************/
  6539. #define RTC_WPR_KEY ((uint32_t)0x000000FF)
  6540. /******************** Bits definition for RTC_SSR register ******************/
  6541. #define RTC_SSR_SS ((uint32_t)0x0000FFFF)
  6542. /******************** Bits definition for RTC_SHIFTR register ***************/
  6543. #define RTC_SHIFTR_SUBFS ((uint32_t)0x00007FFF)
  6544. #define RTC_SHIFTR_ADD1S ((uint32_t)0x80000000)
  6545. /******************** Bits definition for RTC_TSTR register *****************/
  6546. #define RTC_TSTR_PM ((uint32_t)0x00400000)
  6547. #define RTC_TSTR_HT ((uint32_t)0x00300000)
  6548. #define RTC_TSTR_HT_0 ((uint32_t)0x00100000)
  6549. #define RTC_TSTR_HT_1 ((uint32_t)0x00200000)
  6550. #define RTC_TSTR_HU ((uint32_t)0x000F0000)
  6551. #define RTC_TSTR_HU_0 ((uint32_t)0x00010000)
  6552. #define RTC_TSTR_HU_1 ((uint32_t)0x00020000)
  6553. #define RTC_TSTR_HU_2 ((uint32_t)0x00040000)
  6554. #define RTC_TSTR_HU_3 ((uint32_t)0x00080000)
  6555. #define RTC_TSTR_MNT ((uint32_t)0x00007000)
  6556. #define RTC_TSTR_MNT_0 ((uint32_t)0x00001000)
  6557. #define RTC_TSTR_MNT_1 ((uint32_t)0x00002000)
  6558. #define RTC_TSTR_MNT_2 ((uint32_t)0x00004000)
  6559. #define RTC_TSTR_MNU ((uint32_t)0x00000F00)
  6560. #define RTC_TSTR_MNU_0 ((uint32_t)0x00000100)
  6561. #define RTC_TSTR_MNU_1 ((uint32_t)0x00000200)
  6562. #define RTC_TSTR_MNU_2 ((uint32_t)0x00000400)
  6563. #define RTC_TSTR_MNU_3 ((uint32_t)0x00000800)
  6564. #define RTC_TSTR_ST ((uint32_t)0x00000070)
  6565. #define RTC_TSTR_ST_0 ((uint32_t)0x00000010)
  6566. #define RTC_TSTR_ST_1 ((uint32_t)0x00000020)
  6567. #define RTC_TSTR_ST_2 ((uint32_t)0x00000040)
  6568. #define RTC_TSTR_SU ((uint32_t)0x0000000F)
  6569. #define RTC_TSTR_SU_0 ((uint32_t)0x00000001)
  6570. #define RTC_TSTR_SU_1 ((uint32_t)0x00000002)
  6571. #define RTC_TSTR_SU_2 ((uint32_t)0x00000004)
  6572. #define RTC_TSTR_SU_3 ((uint32_t)0x00000008)
  6573. /******************** Bits definition for RTC_TSDR register *****************/
  6574. #define RTC_TSDR_WDU ((uint32_t)0x0000E000)
  6575. #define RTC_TSDR_WDU_0 ((uint32_t)0x00002000)
  6576. #define RTC_TSDR_WDU_1 ((uint32_t)0x00004000)
  6577. #define RTC_TSDR_WDU_2 ((uint32_t)0x00008000)
  6578. #define RTC_TSDR_MT ((uint32_t)0x00001000)
  6579. #define RTC_TSDR_MU ((uint32_t)0x00000F00)
  6580. #define RTC_TSDR_MU_0 ((uint32_t)0x00000100)
  6581. #define RTC_TSDR_MU_1 ((uint32_t)0x00000200)
  6582. #define RTC_TSDR_MU_2 ((uint32_t)0x00000400)
  6583. #define RTC_TSDR_MU_3 ((uint32_t)0x00000800)
  6584. #define RTC_TSDR_DT ((uint32_t)0x00000030)
  6585. #define RTC_TSDR_DT_0 ((uint32_t)0x00000010)
  6586. #define RTC_TSDR_DT_1 ((uint32_t)0x00000020)
  6587. #define RTC_TSDR_DU ((uint32_t)0x0000000F)
  6588. #define RTC_TSDR_DU_0 ((uint32_t)0x00000001)
  6589. #define RTC_TSDR_DU_1 ((uint32_t)0x00000002)
  6590. #define RTC_TSDR_DU_2 ((uint32_t)0x00000004)
  6591. #define RTC_TSDR_DU_3 ((uint32_t)0x00000008)
  6592. /******************** Bits definition for RTC_TSSSR register ****************/
  6593. #define RTC_TSSSR_SS ((uint32_t)0x0000FFFF)
  6594. /******************** Bits definition for RTC_CAL register *****************/
  6595. #define RTC_CALR_CALP ((uint32_t)0x00008000)
  6596. #define RTC_CALR_CALW8 ((uint32_t)0x00004000)
  6597. #define RTC_CALR_CALW16 ((uint32_t)0x00002000)
  6598. #define RTC_CALR_CALM ((uint32_t)0x000001FF)
  6599. #define RTC_CALR_CALM_0 ((uint32_t)0x00000001)
  6600. #define RTC_CALR_CALM_1 ((uint32_t)0x00000002)
  6601. #define RTC_CALR_CALM_2 ((uint32_t)0x00000004)
  6602. #define RTC_CALR_CALM_3 ((uint32_t)0x00000008)
  6603. #define RTC_CALR_CALM_4 ((uint32_t)0x00000010)
  6604. #define RTC_CALR_CALM_5 ((uint32_t)0x00000020)
  6605. #define RTC_CALR_CALM_6 ((uint32_t)0x00000040)
  6606. #define RTC_CALR_CALM_7 ((uint32_t)0x00000080)
  6607. #define RTC_CALR_CALM_8 ((uint32_t)0x00000100)
  6608. /******************** Bits definition for RTC_TAFCR register ****************/
  6609. #define RTC_TAFCR_ALARMOUTTYPE ((uint32_t)0x00040000)
  6610. #define RTC_TAFCR_TSINSEL ((uint32_t)0x00020000)
  6611. #define RTC_TAFCR_TAMPINSEL ((uint32_t)0x00010000)
  6612. #define RTC_TAFCR_TAMPPUDIS ((uint32_t)0x00008000)
  6613. #define RTC_TAFCR_TAMPPRCH ((uint32_t)0x00006000)
  6614. #define RTC_TAFCR_TAMPPRCH_0 ((uint32_t)0x00002000)
  6615. #define RTC_TAFCR_TAMPPRCH_1 ((uint32_t)0x00004000)
  6616. #define RTC_TAFCR_TAMPFLT ((uint32_t)0x00001800)
  6617. #define RTC_TAFCR_TAMPFLT_0 ((uint32_t)0x00000800)
  6618. #define RTC_TAFCR_TAMPFLT_1 ((uint32_t)0x00001000)
  6619. #define RTC_TAFCR_TAMPFREQ ((uint32_t)0x00000700)
  6620. #define RTC_TAFCR_TAMPFREQ_0 ((uint32_t)0x00000100)
  6621. #define RTC_TAFCR_TAMPFREQ_1 ((uint32_t)0x00000200)
  6622. #define RTC_TAFCR_TAMPFREQ_2 ((uint32_t)0x00000400)
  6623. #define RTC_TAFCR_TAMPTS ((uint32_t)0x00000080)
  6624. #define RTC_TAFCR_TAMP2TRG ((uint32_t)0x00000010)
  6625. #define RTC_TAFCR_TAMP2E ((uint32_t)0x00000008)
  6626. #define RTC_TAFCR_TAMPIE ((uint32_t)0x00000004)
  6627. #define RTC_TAFCR_TAMP1TRG ((uint32_t)0x00000002)
  6628. #define RTC_TAFCR_TAMP1E ((uint32_t)0x00000001)
  6629. /******************** Bits definition for RTC_ALRMASSR register *************/
  6630. #define RTC_ALRMASSR_MASKSS ((uint32_t)0x0F000000)
  6631. #define RTC_ALRMASSR_MASKSS_0 ((uint32_t)0x01000000)
  6632. #define RTC_ALRMASSR_MASKSS_1 ((uint32_t)0x02000000)
  6633. #define RTC_ALRMASSR_MASKSS_2 ((uint32_t)0x04000000)
  6634. #define RTC_ALRMASSR_MASKSS_3 ((uint32_t)0x08000000)
  6635. #define RTC_ALRMASSR_SS ((uint32_t)0x00007FFF)
  6636. /******************** Bits definition for RTC_ALRMBSSR register *************/
  6637. #define RTC_ALRMBSSR_MASKSS ((uint32_t)0x0F000000)
  6638. #define RTC_ALRMBSSR_MASKSS_0 ((uint32_t)0x01000000)
  6639. #define RTC_ALRMBSSR_MASKSS_1 ((uint32_t)0x02000000)
  6640. #define RTC_ALRMBSSR_MASKSS_2 ((uint32_t)0x04000000)
  6641. #define RTC_ALRMBSSR_MASKSS_3 ((uint32_t)0x08000000)
  6642. #define RTC_ALRMBSSR_SS ((uint32_t)0x00007FFF)
  6643. /******************** Bits definition for RTC_BKP0R register ****************/
  6644. #define RTC_BKP0R ((uint32_t)0xFFFFFFFF)
  6645. /******************** Bits definition for RTC_BKP1R register ****************/
  6646. #define RTC_BKP1R ((uint32_t)0xFFFFFFFF)
  6647. /******************** Bits definition for RTC_BKP2R register ****************/
  6648. #define RTC_BKP2R ((uint32_t)0xFFFFFFFF)
  6649. /******************** Bits definition for RTC_BKP3R register ****************/
  6650. #define RTC_BKP3R ((uint32_t)0xFFFFFFFF)
  6651. /******************** Bits definition for RTC_BKP4R register ****************/
  6652. #define RTC_BKP4R ((uint32_t)0xFFFFFFFF)
  6653. /******************** Bits definition for RTC_BKP5R register ****************/
  6654. #define RTC_BKP5R ((uint32_t)0xFFFFFFFF)
  6655. /******************** Bits definition for RTC_BKP6R register ****************/
  6656. #define RTC_BKP6R ((uint32_t)0xFFFFFFFF)
  6657. /******************** Bits definition for RTC_BKP7R register ****************/
  6658. #define RTC_BKP7R ((uint32_t)0xFFFFFFFF)
  6659. /******************** Bits definition for RTC_BKP8R register ****************/
  6660. #define RTC_BKP8R ((uint32_t)0xFFFFFFFF)
  6661. /******************** Bits definition for RTC_BKP9R register ****************/
  6662. #define RTC_BKP9R ((uint32_t)0xFFFFFFFF)
  6663. /******************** Bits definition for RTC_BKP10R register ***************/
  6664. #define RTC_BKP10R ((uint32_t)0xFFFFFFFF)
  6665. /******************** Bits definition for RTC_BKP11R register ***************/
  6666. #define RTC_BKP11R ((uint32_t)0xFFFFFFFF)
  6667. /******************** Bits definition for RTC_BKP12R register ***************/
  6668. #define RTC_BKP12R ((uint32_t)0xFFFFFFFF)
  6669. /******************** Bits definition for RTC_BKP13R register ***************/
  6670. #define RTC_BKP13R ((uint32_t)0xFFFFFFFF)
  6671. /******************** Bits definition for RTC_BKP14R register ***************/
  6672. #define RTC_BKP14R ((uint32_t)0xFFFFFFFF)
  6673. /******************** Bits definition for RTC_BKP15R register ***************/
  6674. #define RTC_BKP15R ((uint32_t)0xFFFFFFFF)
  6675. /******************** Bits definition for RTC_BKP16R register ***************/
  6676. #define RTC_BKP16R ((uint32_t)0xFFFFFFFF)
  6677. /******************** Bits definition for RTC_BKP17R register ***************/
  6678. #define RTC_BKP17R ((uint32_t)0xFFFFFFFF)
  6679. /******************** Bits definition for RTC_BKP18R register ***************/
  6680. #define RTC_BKP18R ((uint32_t)0xFFFFFFFF)
  6681. /******************** Bits definition for RTC_BKP19R register ***************/
  6682. #define RTC_BKP19R ((uint32_t)0xFFFFFFFF)
  6683. /******************************************************************************/
  6684. /* */
  6685. /* Serial Audio Interface */
  6686. /* */
  6687. /******************************************************************************/
  6688. /******************** Bit definition for SAI_GCR register *******************/
  6689. #define SAI_GCR_SYNCIN ((uint32_t)0x00000003) /*!<SYNCIN[1:0] bits (Synchronization Inputs) */
  6690. #define SAI_GCR_SYNCIN_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  6691. #define SAI_GCR_SYNCIN_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  6692. #define SAI_GCR_SYNCOUT ((uint32_t)0x00000030) /*!<SYNCOUT[1:0] bits (Synchronization Outputs) */
  6693. #define SAI_GCR_SYNCOUT_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  6694. #define SAI_GCR_SYNCOUT_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  6695. /******************* Bit definition for SAI_xCR1 register *******************/
  6696. #define SAI_xCR1_MODE ((uint32_t)0x00000003) /*!<MODE[1:0] bits (Audio Block Mode) */
  6697. #define SAI_xCR1_MODE_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  6698. #define SAI_xCR1_MODE_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  6699. #define SAI_xCR1_PRTCFG ((uint32_t)0x0000000C) /*!<PRTCFG[1:0] bits (Protocol Configuration) */
  6700. #define SAI_xCR1_PRTCFG_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  6701. #define SAI_xCR1_PRTCFG_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  6702. #define SAI_xCR1_DS ((uint32_t)0x000000E0) /*!<DS[1:0] bits (Data Size) */
  6703. #define SAI_xCR1_DS_0 ((uint32_t)0x00000020) /*!<Bit 0 */
  6704. #define SAI_xCR1_DS_1 ((uint32_t)0x00000040) /*!<Bit 1 */
  6705. #define SAI_xCR1_DS_2 ((uint32_t)0x00000080) /*!<Bit 2 */
  6706. #define SAI_xCR1_LSBFIRST ((uint32_t)0x00000100) /*!<LSB First Configuration */
  6707. #define SAI_xCR1_CKSTR ((uint32_t)0x00000200) /*!<ClocK STRobing edge */
  6708. #define SAI_xCR1_SYNCEN ((uint32_t)0x00000C00) /*!<SYNCEN[1:0](SYNChronization ENable) */
  6709. #define SAI_xCR1_SYNCEN_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  6710. #define SAI_xCR1_SYNCEN_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  6711. #define SAI_xCR1_MONO ((uint32_t)0x00001000) /*!<Mono mode */
  6712. #define SAI_xCR1_OUTDRIV ((uint32_t)0x00002000) /*!<Output Drive */
  6713. #define SAI_xCR1_SAIEN ((uint32_t)0x00010000) /*!<Audio Block enable */
  6714. #define SAI_xCR1_DMAEN ((uint32_t)0x00020000) /*!<DMA enable */
  6715. #define SAI_xCR1_NODIV ((uint32_t)0x00080000) /*!<No Divider Configuration */
  6716. #define SAI_xCR1_MCKDIV ((uint32_t)0x00F00000) /*!<MCKDIV[3:0] (Master ClocK Divider) */
  6717. #define SAI_xCR1_MCKDIV_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  6718. #define SAI_xCR1_MCKDIV_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  6719. #define SAI_xCR1_MCKDIV_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  6720. #define SAI_xCR1_MCKDIV_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  6721. /******************* Bit definition for SAI_xCR2 register *******************/
  6722. #define SAI_xCR2_FTH ((uint32_t)0x00000007) /*!<FTH[2:0](Fifo THreshold) */
  6723. #define SAI_xCR2_FTH_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  6724. #define SAI_xCR2_FTH_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  6725. #define SAI_xCR2_FTH_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  6726. #define SAI_xCR2_FFLUSH ((uint32_t)0x00000008) /*!<Fifo FLUSH */
  6727. #define SAI_xCR2_TRIS ((uint32_t)0x00000010) /*!<TRIState Management on data line */
  6728. #define SAI_xCR2_MUTE ((uint32_t)0x00000020) /*!<Mute mode */
  6729. #define SAI_xCR2_MUTEVAL ((uint32_t)0x00000040) /*!<Muate value */
  6730. #define SAI_xCR2_MUTECNT ((uint32_t)0x00001F80) /*!<MUTECNT[5:0] (MUTE counter) */
  6731. #define SAI_xCR2_MUTECNT_0 ((uint32_t)0x00000080) /*!<Bit 0 */
  6732. #define SAI_xCR2_MUTECNT_1 ((uint32_t)0x00000100) /*!<Bit 1 */
  6733. #define SAI_xCR2_MUTECNT_2 ((uint32_t)0x00000200) /*!<Bit 2 */
  6734. #define SAI_xCR2_MUTECNT_3 ((uint32_t)0x00000400) /*!<Bit 3 */
  6735. #define SAI_xCR2_MUTECNT_4 ((uint32_t)0x00000800) /*!<Bit 4 */
  6736. #define SAI_xCR2_MUTECNT_5 ((uint32_t)0x00001000) /*!<Bit 5 */
  6737. #define SAI_xCR2_CPL ((uint32_t)0x00080000) /*!< Complement Bit */
  6738. #define SAI_xCR2_COMP ((uint32_t)0x0000C000) /*!<COMP[1:0] (Companding mode) */
  6739. #define SAI_xCR2_COMP_0 ((uint32_t)0x00004000) /*!<Bit 0 */
  6740. #define SAI_xCR2_COMP_1 ((uint32_t)0x00008000) /*!<Bit 1 */
  6741. /****************** Bit definition for SAI_xFRCR register *******************/
  6742. #define SAI_xFRCR_FRL ((uint32_t)0x000000FF) /*!<FRL[1:0](Frame length) */
  6743. #define SAI_xFRCR_FRL_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  6744. #define SAI_xFRCR_FRL_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  6745. #define SAI_xFRCR_FRL_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  6746. #define SAI_xFRCR_FRL_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  6747. #define SAI_xFRCR_FRL_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  6748. #define SAI_xFRCR_FRL_5 ((uint32_t)0x00000020) /*!<Bit 5 */
  6749. #define SAI_xFRCR_FRL_6 ((uint32_t)0x00000040) /*!<Bit 6 */
  6750. #define SAI_xFRCR_FRL_7 ((uint32_t)0x00000080) /*!<Bit 7 */
  6751. #define SAI_xFRCR_FSALL ((uint32_t)0x00007F00) /*!<FRL[1:0] (Frame synchronization active level length) */
  6752. #define SAI_xFRCR_FSALL_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  6753. #define SAI_xFRCR_FSALL_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  6754. #define SAI_xFRCR_FSALL_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  6755. #define SAI_xFRCR_FSALL_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  6756. #define SAI_xFRCR_FSALL_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  6757. #define SAI_xFRCR_FSALL_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  6758. #define SAI_xFRCR_FSALL_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  6759. #define SAI_xFRCR_FSDEF ((uint32_t)0x00010000) /*!< Frame Synchronization Definition */
  6760. #define SAI_xFRCR_FSPO ((uint32_t)0x00020000) /*!<Frame Synchronization POLarity */
  6761. #define SAI_xFRCR_FSOFF ((uint32_t)0x00040000) /*!<Frame Synchronization OFFset */
  6762. /****************** Bit definition for SAI_xSLOTR register *******************/
  6763. #define SAI_xSLOTR_FBOFF ((uint32_t)0x0000001F) /*!<FRL[4:0](First Bit Offset) */
  6764. #define SAI_xSLOTR_FBOFF_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  6765. #define SAI_xSLOTR_FBOFF_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  6766. #define SAI_xSLOTR_FBOFF_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  6767. #define SAI_xSLOTR_FBOFF_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  6768. #define SAI_xSLOTR_FBOFF_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  6769. #define SAI_xSLOTR_SLOTSZ ((uint32_t)0x000000C0) /*!<SLOTSZ[1:0] (Slot size) */
  6770. #define SAI_xSLOTR_SLOTSZ_0 ((uint32_t)0x00000040) /*!<Bit 0 */
  6771. #define SAI_xSLOTR_SLOTSZ_1 ((uint32_t)0x00000080) /*!<Bit 1 */
  6772. #define SAI_xSLOTR_NBSLOT ((uint32_t)0x00000F00) /*!<NBSLOT[3:0] (Number of Slot in audio Frame) */
  6773. #define SAI_xSLOTR_NBSLOT_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  6774. #define SAI_xSLOTR_NBSLOT_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  6775. #define SAI_xSLOTR_NBSLOT_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  6776. #define SAI_xSLOTR_NBSLOT_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  6777. #define SAI_xSLOTR_SLOTEN ((uint32_t)0xFFFF0000) /*!<SLOTEN[15:0] (Slot Enable) */
  6778. /******************* Bit definition for SAI_xIMR register *******************/
  6779. #define SAI_xIMR_OVRUDRIE ((uint32_t)0x00000001) /*!<Overrun underrun interrupt enable */
  6780. #define SAI_xIMR_MUTEDETIE ((uint32_t)0x00000002) /*!<Mute detection interrupt enable */
  6781. #define SAI_xIMR_WCKCFGIE ((uint32_t)0x00000004) /*!<Wrong Clock Configuration interrupt enable */
  6782. #define SAI_xIMR_FREQIE ((uint32_t)0x00000008) /*!<FIFO request interrupt enable */
  6783. #define SAI_xIMR_CNRDYIE ((uint32_t)0x00000010) /*!<Codec not ready interrupt enable */
  6784. #define SAI_xIMR_AFSDETIE ((uint32_t)0x00000020) /*!<Anticipated frame synchronization detection interrupt enable */
  6785. #define SAI_xIMR_LFSDETIE ((uint32_t)0x00000040) /*!<Late frame synchronization detection interrupt enable */
  6786. /******************** Bit definition for SAI_xSR register *******************/
  6787. #define SAI_xSR_OVRUDR ((uint32_t)0x00000001) /*!<Overrun underrun */
  6788. #define SAI_xSR_MUTEDET ((uint32_t)0x00000002) /*!<Mute detection */
  6789. #define SAI_xSR_WCKCFG ((uint32_t)0x00000004) /*!<Wrong Clock Configuration */
  6790. #define SAI_xSR_FREQ ((uint32_t)0x00000008) /*!<FIFO request */
  6791. #define SAI_xSR_CNRDY ((uint32_t)0x00000010) /*!<Codec not ready */
  6792. #define SAI_xSR_AFSDET ((uint32_t)0x00000020) /*!<Anticipated frame synchronization detection */
  6793. #define SAI_xSR_LFSDET ((uint32_t)0x00000040) /*!<Late frame synchronization detection */
  6794. #define SAI_xSR_FLVL ((uint32_t)0x00070000) /*!<FLVL[2:0] (FIFO Level Threshold) */
  6795. #define SAI_xSR_FLVL_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  6796. #define SAI_xSR_FLVL_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  6797. #define SAI_xSR_FLVL_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  6798. /****************** Bit definition for SAI_xCLRFR register ******************/
  6799. #define SAI_xCLRFR_COVRUDR ((uint32_t)0x00000001) /*!<Clear Overrun underrun */
  6800. #define SAI_xCLRFR_CMUTEDET ((uint32_t)0x00000002) /*!<Clear Mute detection */
  6801. #define SAI_xCLRFR_CWCKCFG ((uint32_t)0x00000004) /*!<Clear Wrong Clock Configuration */
  6802. #define SAI_xCLRFR_CFREQ ((uint32_t)0x00000008) /*!<Clear FIFO request */
  6803. #define SAI_xCLRFR_CCNRDY ((uint32_t)0x00000010) /*!<Clear Codec not ready */
  6804. #define SAI_xCLRFR_CAFSDET ((uint32_t)0x00000020) /*!<Clear Anticipated frame synchronization detection */
  6805. #define SAI_xCLRFR_CLFSDET ((uint32_t)0x00000040) /*!<Clear Late frame synchronization detection */
  6806. /****************** Bit definition for SAI_xDR register ******************/
  6807. #define SAI_xDR_DATA ((uint32_t)0xFFFFFFFF)
  6808. /******************************************************************************/
  6809. /* */
  6810. /* SD host Interface */
  6811. /* */
  6812. /******************************************************************************/
  6813. /****************** Bit definition for SDIO_POWER register ******************/
  6814. #define SDIO_POWER_PWRCTRL ((uint32_t)0x03) /*!<PWRCTRL[1:0] bits (Power supply control bits) */
  6815. #define SDIO_POWER_PWRCTRL_0 ((uint32_t)0x01) /*!<Bit 0 */
  6816. #define SDIO_POWER_PWRCTRL_1 ((uint32_t)0x02) /*!<Bit 1 */
  6817. /****************** Bit definition for SDIO_CLKCR register ******************/
  6818. #define SDIO_CLKCR_CLKDIV ((uint32_t)0x00FF) /*!<Clock divide factor */
  6819. #define SDIO_CLKCR_CLKEN ((uint32_t)0x0100) /*!<Clock enable bit */
  6820. #define SDIO_CLKCR_PWRSAV ((uint32_t)0x0200) /*!<Power saving configuration bit */
  6821. #define SDIO_CLKCR_BYPASS ((uint32_t)0x0400) /*!<Clock divider bypass enable bit */
  6822. #define SDIO_CLKCR_WIDBUS ((uint32_t)0x1800) /*!<WIDBUS[1:0] bits (Wide bus mode enable bit) */
  6823. #define SDIO_CLKCR_WIDBUS_0 ((uint32_t)0x0800) /*!<Bit 0 */
  6824. #define SDIO_CLKCR_WIDBUS_1 ((uint32_t)0x1000) /*!<Bit 1 */
  6825. #define SDIO_CLKCR_NEGEDGE ((uint32_t)0x2000) /*!<SDIO_CK dephasing selection bit */
  6826. #define SDIO_CLKCR_HWFC_EN ((uint32_t)0x4000) /*!<HW Flow Control enable */
  6827. /******************* Bit definition for SDIO_ARG register *******************/
  6828. #define SDIO_ARG_CMDARG ((uint32_t)0xFFFFFFFF) /*!<Command argument */
  6829. /******************* Bit definition for SDIO_CMD register *******************/
  6830. #define SDIO_CMD_CMDINDEX ((uint32_t)0x003F) /*!<Command Index */
  6831. #define SDIO_CMD_WAITRESP ((uint32_t)0x00C0) /*!<WAITRESP[1:0] bits (Wait for response bits) */
  6832. #define SDIO_CMD_WAITRESP_0 ((uint32_t)0x0040) /*!< Bit 0 */
  6833. #define SDIO_CMD_WAITRESP_1 ((uint32_t)0x0080) /*!< Bit 1 */
  6834. #define SDIO_CMD_WAITINT ((uint32_t)0x0100) /*!<CPSM Waits for Interrupt Request */
  6835. #define SDIO_CMD_WAITPEND ((uint32_t)0x0200) /*!<CPSM Waits for ends of data transfer (CmdPend internal signal) */
  6836. #define SDIO_CMD_CPSMEN ((uint32_t)0x0400) /*!<Command path state machine (CPSM) Enable bit */
  6837. #define SDIO_CMD_SDIOSUSPEND ((uint32_t)0x0800) /*!<SD I/O suspend command */
  6838. /***************** Bit definition for SDIO_RESPCMD register *****************/
  6839. #define SDIO_RESPCMD_RESPCMD ((uint32_t)0x3F) /*!<Response command index */
  6840. /****************** Bit definition for SDIO_RESP0 register ******************/
  6841. #define SDIO_RESP0_CARDSTATUS0 ((uint32_t)0xFFFFFFFF) /*!<Card Status */
  6842. /****************** Bit definition for SDIO_RESP1 register ******************/
  6843. #define SDIO_RESP1_CARDSTATUS1 ((uint32_t)0xFFFFFFFF) /*!<Card Status */
  6844. /****************** Bit definition for SDIO_RESP2 register ******************/
  6845. #define SDIO_RESP2_CARDSTATUS2 ((uint32_t)0xFFFFFFFF) /*!<Card Status */
  6846. /****************** Bit definition for SDIO_RESP3 register ******************/
  6847. #define SDIO_RESP3_CARDSTATUS3 ((uint32_t)0xFFFFFFFF) /*!<Card Status */
  6848. /****************** Bit definition for SDIO_RESP4 register ******************/
  6849. #define SDIO_RESP4_CARDSTATUS4 ((uint32_t)0xFFFFFFFF) /*!<Card Status */
  6850. /****************** Bit definition for SDIO_DTIMER register *****************/
  6851. #define SDIO_DTIMER_DATATIME ((uint32_t)0xFFFFFFFF) /*!<Data timeout period. */
  6852. /****************** Bit definition for SDIO_DLEN register *******************/
  6853. #define SDIO_DLEN_DATALENGTH ((uint32_t)0x01FFFFFF) /*!<Data length value */
  6854. /****************** Bit definition for SDIO_DCTRL register ******************/
  6855. #define SDIO_DCTRL_DTEN ((uint32_t)0x0001) /*!<Data transfer enabled bit */
  6856. #define SDIO_DCTRL_DTDIR ((uint32_t)0x0002) /*!<Data transfer direction selection */
  6857. #define SDIO_DCTRL_DTMODE ((uint32_t)0x0004) /*!<Data transfer mode selection */
  6858. #define SDIO_DCTRL_DMAEN ((uint32_t)0x0008) /*!<DMA enabled bit */
  6859. #define SDIO_DCTRL_DBLOCKSIZE ((uint32_t)0x00F0) /*!<DBLOCKSIZE[3:0] bits (Data block size) */
  6860. #define SDIO_DCTRL_DBLOCKSIZE_0 ((uint32_t)0x0010) /*!<Bit 0 */
  6861. #define SDIO_DCTRL_DBLOCKSIZE_1 ((uint32_t)0x0020) /*!<Bit 1 */
  6862. #define SDIO_DCTRL_DBLOCKSIZE_2 ((uint32_t)0x0040) /*!<Bit 2 */
  6863. #define SDIO_DCTRL_DBLOCKSIZE_3 ((uint32_t)0x0080) /*!<Bit 3 */
  6864. #define SDIO_DCTRL_RWSTART ((uint32_t)0x0100) /*!<Read wait start */
  6865. #define SDIO_DCTRL_RWSTOP ((uint32_t)0x0200) /*!<Read wait stop */
  6866. #define SDIO_DCTRL_RWMOD ((uint32_t)0x0400) /*!<Read wait mode */
  6867. #define SDIO_DCTRL_SDIOEN ((uint32_t)0x0800) /*!<SD I/O enable functions */
  6868. /****************** Bit definition for SDIO_DCOUNT register *****************/
  6869. #define SDIO_DCOUNT_DATACOUNT ((uint32_t)0x01FFFFFF) /*!<Data count value */
  6870. /****************** Bit definition for SDIO_STA register ********************/
  6871. #define SDIO_STA_CCRCFAIL ((uint32_t)0x00000001) /*!<Command response received (CRC check failed) */
  6872. #define SDIO_STA_DCRCFAIL ((uint32_t)0x00000002) /*!<Data block sent/received (CRC check failed) */
  6873. #define SDIO_STA_CTIMEOUT ((uint32_t)0x00000004) /*!<Command response timeout */
  6874. #define SDIO_STA_DTIMEOUT ((uint32_t)0x00000008) /*!<Data timeout */
  6875. #define SDIO_STA_TXUNDERR ((uint32_t)0x00000010) /*!<Transmit FIFO underrun error */
  6876. #define SDIO_STA_RXOVERR ((uint32_t)0x00000020) /*!<Received FIFO overrun error */
  6877. #define SDIO_STA_CMDREND ((uint32_t)0x00000040) /*!<Command response received (CRC check passed) */
  6878. #define SDIO_STA_CMDSENT ((uint32_t)0x00000080) /*!<Command sent (no response required) */
  6879. #define SDIO_STA_DATAEND ((uint32_t)0x00000100) /*!<Data end (data counter, SDIDCOUNT, is zero) */
  6880. #define SDIO_STA_DBCKEND ((uint32_t)0x00000400) /*!<Data block sent/received (CRC check passed) */
  6881. #define SDIO_STA_CMDACT ((uint32_t)0x00000800) /*!<Command transfer in progress */
  6882. #define SDIO_STA_TXACT ((uint32_t)0x00001000) /*!<Data transmit in progress */
  6883. #define SDIO_STA_RXACT ((uint32_t)0x00002000) /*!<Data receive in progress */
  6884. #define SDIO_STA_TXFIFOHE ((uint32_t)0x00004000) /*!<Transmit FIFO Half Empty: at least 8 words can be written into the FIFO */
  6885. #define SDIO_STA_RXFIFOHF ((uint32_t)0x00008000) /*!<Receive FIFO Half Full: there are at least 8 words in the FIFO */
  6886. #define SDIO_STA_TXFIFOF ((uint32_t)0x00010000) /*!<Transmit FIFO full */
  6887. #define SDIO_STA_RXFIFOF ((uint32_t)0x00020000) /*!<Receive FIFO full */
  6888. #define SDIO_STA_TXFIFOE ((uint32_t)0x00040000) /*!<Transmit FIFO empty */
  6889. #define SDIO_STA_RXFIFOE ((uint32_t)0x00080000) /*!<Receive FIFO empty */
  6890. #define SDIO_STA_TXDAVL ((uint32_t)0x00100000) /*!<Data available in transmit FIFO */
  6891. #define SDIO_STA_RXDAVL ((uint32_t)0x00200000) /*!<Data available in receive FIFO */
  6892. #define SDIO_STA_SDIOIT ((uint32_t)0x00400000) /*!<SDIO interrupt received */
  6893. /******************* Bit definition for SDIO_ICR register *******************/
  6894. #define SDIO_ICR_CCRCFAILC ((uint32_t)0x00000001) /*!<CCRCFAIL flag clear bit */
  6895. #define SDIO_ICR_DCRCFAILC ((uint32_t)0x00000002) /*!<DCRCFAIL flag clear bit */
  6896. #define SDIO_ICR_CTIMEOUTC ((uint32_t)0x00000004) /*!<CTIMEOUT flag clear bit */
  6897. #define SDIO_ICR_DTIMEOUTC ((uint32_t)0x00000008) /*!<DTIMEOUT flag clear bit */
  6898. #define SDIO_ICR_TXUNDERRC ((uint32_t)0x00000010) /*!<TXUNDERR flag clear bit */
  6899. #define SDIO_ICR_RXOVERRC ((uint32_t)0x00000020) /*!<RXOVERR flag clear bit */
  6900. #define SDIO_ICR_CMDRENDC ((uint32_t)0x00000040) /*!<CMDREND flag clear bit */
  6901. #define SDIO_ICR_CMDSENTC ((uint32_t)0x00000080) /*!<CMDSENT flag clear bit */
  6902. #define SDIO_ICR_DATAENDC ((uint32_t)0x00000100) /*!<DATAEND flag clear bit */
  6903. #define SDIO_ICR_DBCKENDC ((uint32_t)0x00000400) /*!<DBCKEND flag clear bit */
  6904. #define SDIO_ICR_SDIOITC ((uint32_t)0x00400000) /*!<SDIOIT flag clear bit */
  6905. /****************** Bit definition for SDIO_MASK register *******************/
  6906. #define SDIO_MASK_CCRCFAILIE ((uint32_t)0x00000001) /*!<Command CRC Fail Interrupt Enable */
  6907. #define SDIO_MASK_DCRCFAILIE ((uint32_t)0x00000002) /*!<Data CRC Fail Interrupt Enable */
  6908. #define SDIO_MASK_CTIMEOUTIE ((uint32_t)0x00000004) /*!<Command TimeOut Interrupt Enable */
  6909. #define SDIO_MASK_DTIMEOUTIE ((uint32_t)0x00000008) /*!<Data TimeOut Interrupt Enable */
  6910. #define SDIO_MASK_TXUNDERRIE ((uint32_t)0x00000010) /*!<Tx FIFO UnderRun Error Interrupt Enable */
  6911. #define SDIO_MASK_RXOVERRIE ((uint32_t)0x00000020) /*!<Rx FIFO OverRun Error Interrupt Enable */
  6912. #define SDIO_MASK_CMDRENDIE ((uint32_t)0x00000040) /*!<Command Response Received Interrupt Enable */
  6913. #define SDIO_MASK_CMDSENTIE ((uint32_t)0x00000080) /*!<Command Sent Interrupt Enable */
  6914. #define SDIO_MASK_DATAENDIE ((uint32_t)0x00000100) /*!<Data End Interrupt Enable */
  6915. #define SDIO_MASK_DBCKENDIE ((uint32_t)0x00000400) /*!<Data Block End Interrupt Enable */
  6916. #define SDIO_MASK_CMDACTIE ((uint32_t)0x00000800) /*!<CCommand Acting Interrupt Enable */
  6917. #define SDIO_MASK_TXACTIE ((uint32_t)0x00001000) /*!<Data Transmit Acting Interrupt Enable */
  6918. #define SDIO_MASK_RXACTIE ((uint32_t)0x00002000) /*!<Data receive acting interrupt enabled */
  6919. #define SDIO_MASK_TXFIFOHEIE ((uint32_t)0x00004000) /*!<Tx FIFO Half Empty interrupt Enable */
  6920. #define SDIO_MASK_RXFIFOHFIE ((uint32_t)0x00008000) /*!<Rx FIFO Half Full interrupt Enable */
  6921. #define SDIO_MASK_TXFIFOFIE ((uint32_t)0x00010000) /*!<Tx FIFO Full interrupt Enable */
  6922. #define SDIO_MASK_RXFIFOFIE ((uint32_t)0x00020000) /*!<Rx FIFO Full interrupt Enable */
  6923. #define SDIO_MASK_TXFIFOEIE ((uint32_t)0x00040000) /*!<Tx FIFO Empty interrupt Enable */
  6924. #define SDIO_MASK_RXFIFOEIE ((uint32_t)0x00080000) /*!<Rx FIFO Empty interrupt Enable */
  6925. #define SDIO_MASK_TXDAVLIE ((uint32_t)0x00100000) /*!<Data available in Tx FIFO interrupt Enable */
  6926. #define SDIO_MASK_RXDAVLIE ((uint32_t)0x00200000) /*!<Data available in Rx FIFO interrupt Enable */
  6927. #define SDIO_MASK_SDIOITIE ((uint32_t)0x00400000) /*!<SDIO Mode Interrupt Received interrupt Enable */
  6928. /***************** Bit definition for SDIO_FIFOCNT register *****************/
  6929. #define SDIO_FIFOCNT_FIFOCOUNT ((uint32_t)0x00FFFFFF) /*!<Remaining number of words to be written to or read from the FIFO */
  6930. /****************** Bit definition for SDIO_FIFO register *******************/
  6931. #define SDIO_FIFO_FIFODATA ((uint32_t)0xFFFFFFFF) /*!<Receive and transmit FIFO data */
  6932. /******************************************************************************/
  6933. /* */
  6934. /* Serial Peripheral Interface */
  6935. /* */
  6936. /******************************************************************************/
  6937. /******************* Bit definition for SPI_CR1 register ********************/
  6938. #define SPI_CR1_CPHA ((uint32_t)0x00000001) /*!<Clock Phase */
  6939. #define SPI_CR1_CPOL ((uint32_t)0x00000002) /*!<Clock Polarity */
  6940. #define SPI_CR1_MSTR ((uint32_t)0x00000004) /*!<Master Selection */
  6941. #define SPI_CR1_BR ((uint32_t)0x00000038) /*!<BR[2:0] bits (Baud Rate Control) */
  6942. #define SPI_CR1_BR_0 ((uint32_t)0x00000008) /*!<Bit 0 */
  6943. #define SPI_CR1_BR_1 ((uint32_t)0x00000010) /*!<Bit 1 */
  6944. #define SPI_CR1_BR_2 ((uint32_t)0x00000020) /*!<Bit 2 */
  6945. #define SPI_CR1_SPE ((uint32_t)0x00000040) /*!<SPI Enable */
  6946. #define SPI_CR1_LSBFIRST ((uint32_t)0x00000080) /*!<Frame Format */
  6947. #define SPI_CR1_SSI ((uint32_t)0x00000100) /*!<Internal slave select */
  6948. #define SPI_CR1_SSM ((uint32_t)0x00000200) /*!<Software slave management */
  6949. #define SPI_CR1_RXONLY ((uint32_t)0x00000400) /*!<Receive only */
  6950. #define SPI_CR1_DFF ((uint32_t)0x00000800) /*!<Data Frame Format */
  6951. #define SPI_CR1_CRCNEXT ((uint32_t)0x00001000) /*!<Transmit CRC next */
  6952. #define SPI_CR1_CRCEN ((uint32_t)0x00002000) /*!<Hardware CRC calculation enable */
  6953. #define SPI_CR1_BIDIOE ((uint32_t)0x00004000) /*!<Output enable in bidirectional mode */
  6954. #define SPI_CR1_BIDIMODE ((uint32_t)0x00008000) /*!<Bidirectional data mode enable */
  6955. /******************* Bit definition for SPI_CR2 register ********************/
  6956. #define SPI_CR2_RXDMAEN ((uint32_t)0x00000001) /*!<Rx Buffer DMA Enable */
  6957. #define SPI_CR2_TXDMAEN ((uint32_t)0x00000002) /*!<Tx Buffer DMA Enable */
  6958. #define SPI_CR2_SSOE ((uint32_t)0x00000004) /*!<SS Output Enable */
  6959. #define SPI_CR2_FRF ((uint32_t)0x00000010) /*!<Frame Format */
  6960. #define SPI_CR2_ERRIE ((uint32_t)0x00000020) /*!<Error Interrupt Enable */
  6961. #define SPI_CR2_RXNEIE ((uint32_t)0x00000040) /*!<RX buffer Not Empty Interrupt Enable */
  6962. #define SPI_CR2_TXEIE ((uint32_t)0x00000080) /*!<Tx buffer Empty Interrupt Enable */
  6963. /******************** Bit definition for SPI_SR register ********************/
  6964. #define SPI_SR_RXNE ((uint32_t)0x00000001) /*!<Receive buffer Not Empty */
  6965. #define SPI_SR_TXE ((uint32_t)0x00000002) /*!<Transmit buffer Empty */
  6966. #define SPI_SR_CHSIDE ((uint32_t)0x00000004) /*!<Channel side */
  6967. #define SPI_SR_UDR ((uint32_t)0x00000008) /*!<Underrun flag */
  6968. #define SPI_SR_CRCERR ((uint32_t)0x00000010) /*!<CRC Error flag */
  6969. #define SPI_SR_MODF ((uint32_t)0x00000020) /*!<Mode fault */
  6970. #define SPI_SR_OVR ((uint32_t)0x00000040) /*!<Overrun flag */
  6971. #define SPI_SR_BSY ((uint32_t)0x00000080) /*!<Busy flag */
  6972. #define SPI_SR_FRE ((uint32_t)0x00000100) /*!<Frame format error flag */
  6973. /******************** Bit definition for SPI_DR register ********************/
  6974. #define SPI_DR_DR ((uint32_t)0x0000FFFF) /*!<Data Register */
  6975. /******************* Bit definition for SPI_CRCPR register ******************/
  6976. #define SPI_CRCPR_CRCPOLY ((uint32_t)0x0000FFFF) /*!<CRC polynomial register */
  6977. /****************** Bit definition for SPI_RXCRCR register ******************/
  6978. #define SPI_RXCRCR_RXCRC ((uint32_t)0x0000FFFF) /*!<Rx CRC Register */
  6979. /****************** Bit definition for SPI_TXCRCR register ******************/
  6980. #define SPI_TXCRCR_TXCRC ((uint32_t)0x0000FFFF) /*!<Tx CRC Register */
  6981. /****************** Bit definition for SPI_I2SCFGR register *****************/
  6982. #define SPI_I2SCFGR_CHLEN ((uint32_t)0x00000001) /*!<Channel length (number of bits per audio channel) */
  6983. #define SPI_I2SCFGR_DATLEN ((uint32_t)0x00000006) /*!<DATLEN[1:0] bits (Data length to be transferred) */
  6984. #define SPI_I2SCFGR_DATLEN_0 ((uint32_t)0x00000002) /*!<Bit 0 */
  6985. #define SPI_I2SCFGR_DATLEN_1 ((uint32_t)0x00000004) /*!<Bit 1 */
  6986. #define SPI_I2SCFGR_CKPOL ((uint32_t)0x00000008) /*!<steady state clock polarity */
  6987. #define SPI_I2SCFGR_I2SSTD ((uint32_t)0x00000030) /*!<I2SSTD[1:0] bits (I2S standard selection) */
  6988. #define SPI_I2SCFGR_I2SSTD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  6989. #define SPI_I2SCFGR_I2SSTD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  6990. #define SPI_I2SCFGR_PCMSYNC ((uint32_t)0x00000080) /*!<PCM frame synchronization */
  6991. #define SPI_I2SCFGR_I2SCFG ((uint32_t)0x00000300) /*!<I2SCFG[1:0] bits (I2S configuration mode) */
  6992. #define SPI_I2SCFGR_I2SCFG_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  6993. #define SPI_I2SCFGR_I2SCFG_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  6994. #define SPI_I2SCFGR_I2SE ((uint32_t)0x00000400) /*!<I2S Enable */
  6995. #define SPI_I2SCFGR_I2SMOD ((uint32_t)0x00000800) /*!<I2S mode selection */
  6996. #define SPI_I2SCFGR_ASTRTEN ((uint32_t)0x00001000) /*!<Asynchronous start enable */
  6997. /****************** Bit definition for SPI_I2SPR register *******************/
  6998. #define SPI_I2SPR_I2SDIV ((uint32_t)0x000000FF) /*!<I2S Linear prescaler */
  6999. #define SPI_I2SPR_ODD ((uint32_t)0x00000100) /*!<Odd factor for the prescaler */
  7000. #define SPI_I2SPR_MCKOE ((uint32_t)0x00000200) /*!<Master Clock Output Enable */
  7001. /******************************************************************************/
  7002. /* */
  7003. /* SYSCFG */
  7004. /* */
  7005. /******************************************************************************/
  7006. /****************** Bit definition for SYSCFG_MEMRMP register ***************/
  7007. #define SYSCFG_MEMRMP_MEM_MODE ((uint32_t)0x00000007) /*!< SYSCFG_Memory Remap Config */
  7008. #define SYSCFG_MEMRMP_MEM_MODE_0 ((uint32_t)0x00000001)
  7009. #define SYSCFG_MEMRMP_MEM_MODE_1 ((uint32_t)0x00000002)
  7010. #define SYSCFG_MEMRMP_MEM_MODE_2 ((uint32_t)0x00000004)
  7011. #define SYSCFG_MEMRMP_UFB_MODE ((uint32_t)0x00000100) /*!< User Flash Bank mode */
  7012. #define SYSCFG_SWP_FMC ((uint32_t)0x00000C00) /*!< FMC memory mapping swap */
  7013. /****************** Bit definition for SYSCFG_PMC register ******************/
  7014. #define SYSCFG_PMC_ADCxDC2 ((uint32_t)0x00070000) /*!< Refer to AN4073 on how to use this bit */
  7015. #define SYSCFG_PMC_ADC1DC2 ((uint32_t)0x00010000) /*!< Refer to AN4073 on how to use this bit */
  7016. #define SYSCFG_PMC_ADC2DC2 ((uint32_t)0x00020000) /*!< Refer to AN4073 on how to use this bit */
  7017. #define SYSCFG_PMC_ADC3DC2 ((uint32_t)0x00040000) /*!< Refer to AN4073 on how to use this bit */
  7018. #define SYSCFG_PMC_MII_RMII_SEL ((uint32_t)0x00800000) /*!<Ethernet PHY interface selection */
  7019. /***************** Bit definition for SYSCFG_EXTICR1 register ***************/
  7020. #define SYSCFG_EXTICR1_EXTI0 ((uint32_t)0x000F) /*!<EXTI 0 configuration */
  7021. #define SYSCFG_EXTICR1_EXTI1 ((uint32_t)0x00F0) /*!<EXTI 1 configuration */
  7022. #define SYSCFG_EXTICR1_EXTI2 ((uint32_t)0x0F00) /*!<EXTI 2 configuration */
  7023. #define SYSCFG_EXTICR1_EXTI3 ((uint32_t)0xF000) /*!<EXTI 3 configuration */
  7024. /**
  7025. * @brief EXTI0 configuration
  7026. */
  7027. #define SYSCFG_EXTICR1_EXTI0_PA ((uint32_t)0x0000) /*!<PA[0] pin */
  7028. #define SYSCFG_EXTICR1_EXTI0_PB ((uint32_t)0x0001) /*!<PB[0] pin */
  7029. #define SYSCFG_EXTICR1_EXTI0_PC ((uint32_t)0x0002) /*!<PC[0] pin */
  7030. #define SYSCFG_EXTICR1_EXTI0_PD ((uint32_t)0x0003) /*!<PD[0] pin */
  7031. #define SYSCFG_EXTICR1_EXTI0_PE ((uint32_t)0x0004) /*!<PE[0] pin */
  7032. #define SYSCFG_EXTICR1_EXTI0_PF ((uint32_t)0x0005) /*!<PF[0] pin */
  7033. #define SYSCFG_EXTICR1_EXTI0_PG ((uint32_t)0x0006) /*!<PG[0] pin */
  7034. #define SYSCFG_EXTICR1_EXTI0_PH ((uint32_t)0x0007) /*!<PH[0] pin */
  7035. #define SYSCFG_EXTICR1_EXTI0_PI ((uint32_t)0x0008) /*!<PI[0] pin */
  7036. #define SYSCFG_EXTICR1_EXTI0_PJ ((uint32_t)0x0009) /*!<PJ[0] pin */
  7037. #define SYSCFG_EXTICR1_EXTI0_PK ((uint32_t)0x000A) /*!<PK[0] pin */
  7038. /**
  7039. * @brief EXTI1 configuration
  7040. */
  7041. #define SYSCFG_EXTICR1_EXTI1_PA ((uint32_t)0x0000) /*!<PA[1] pin */
  7042. #define SYSCFG_EXTICR1_EXTI1_PB ((uint32_t)0x0010) /*!<PB[1] pin */
  7043. #define SYSCFG_EXTICR1_EXTI1_PC ((uint32_t)0x0020) /*!<PC[1] pin */
  7044. #define SYSCFG_EXTICR1_EXTI1_PD ((uint32_t)0x0030) /*!<PD[1] pin */
  7045. #define SYSCFG_EXTICR1_EXTI1_PE ((uint32_t)0x0040) /*!<PE[1] pin */
  7046. #define SYSCFG_EXTICR1_EXTI1_PF ((uint32_t)0x0050) /*!<PF[1] pin */
  7047. #define SYSCFG_EXTICR1_EXTI1_PG ((uint32_t)0x0060) /*!<PG[1] pin */
  7048. #define SYSCFG_EXTICR1_EXTI1_PH ((uint32_t)0x0070) /*!<PH[1] pin */
  7049. #define SYSCFG_EXTICR1_EXTI1_PI ((uint32_t)0x0080) /*!<PI[1] pin */
  7050. #define SYSCFG_EXTICR1_EXTI1_PJ ((uint32_t)0x0090) /*!<PJ[1] pin */
  7051. #define SYSCFG_EXTICR1_EXTI1_PK ((uint32_t)0x00A0) /*!<PK[1] pin */
  7052. /**
  7053. * @brief EXTI2 configuration
  7054. */
  7055. #define SYSCFG_EXTICR1_EXTI2_PA ((uint32_t)0x0000) /*!<PA[2] pin */
  7056. #define SYSCFG_EXTICR1_EXTI2_PB ((uint32_t)0x0100) /*!<PB[2] pin */
  7057. #define SYSCFG_EXTICR1_EXTI2_PC ((uint32_t)0x0200) /*!<PC[2] pin */
  7058. #define SYSCFG_EXTICR1_EXTI2_PD ((uint32_t)0x0300) /*!<PD[2] pin */
  7059. #define SYSCFG_EXTICR1_EXTI2_PE ((uint32_t)0x0400) /*!<PE[2] pin */
  7060. #define SYSCFG_EXTICR1_EXTI2_PF ((uint32_t)0x0500) /*!<PF[2] pin */
  7061. #define SYSCFG_EXTICR1_EXTI2_PG ((uint32_t)0x0600) /*!<PG[2] pin */
  7062. #define SYSCFG_EXTICR1_EXTI2_PH ((uint32_t)0x0700) /*!<PH[2] pin */
  7063. #define SYSCFG_EXTICR1_EXTI2_PI ((uint32_t)0x0800) /*!<PI[2] pin */
  7064. #define SYSCFG_EXTICR1_EXTI2_PJ ((uint32_t)0x0900) /*!<PJ[2] pin */
  7065. #define SYSCFG_EXTICR1_EXTI2_PK ((uint32_t)0x0A00) /*!<PK[2] pin */
  7066. /**
  7067. * @brief EXTI3 configuration
  7068. */
  7069. #define SYSCFG_EXTICR1_EXTI3_PA ((uint32_t)0x0000) /*!<PA[3] pin */
  7070. #define SYSCFG_EXTICR1_EXTI3_PB ((uint32_t)0x1000) /*!<PB[3] pin */
  7071. #define SYSCFG_EXTICR1_EXTI3_PC ((uint32_t)0x2000) /*!<PC[3] pin */
  7072. #define SYSCFG_EXTICR1_EXTI3_PD ((uint32_t)0x3000) /*!<PD[3] pin */
  7073. #define SYSCFG_EXTICR1_EXTI3_PE ((uint32_t)0x4000) /*!<PE[3] pin */
  7074. #define SYSCFG_EXTICR1_EXTI3_PF ((uint32_t)0x5000) /*!<PF[3] pin */
  7075. #define SYSCFG_EXTICR1_EXTI3_PG ((uint32_t)0x6000) /*!<PG[3] pin */
  7076. #define SYSCFG_EXTICR1_EXTI3_PH ((uint32_t)0x7000) /*!<PH[3] pin */
  7077. #define SYSCFG_EXTICR1_EXTI3_PI ((uint32_t)0x8000) /*!<PI[3] pin */
  7078. #define SYSCFG_EXTICR1_EXTI3_PJ ((uint32_t)0x9000) /*!<PJ[3] pin */
  7079. #define SYSCFG_EXTICR1_EXTI3_PK ((uint32_t)0xA000) /*!<PK[3] pin */
  7080. /***************** Bit definition for SYSCFG_EXTICR2 register ***************/
  7081. #define SYSCFG_EXTICR2_EXTI4 ((uint32_t)0x000F) /*!<EXTI 4 configuration */
  7082. #define SYSCFG_EXTICR2_EXTI5 ((uint32_t)0x00F0) /*!<EXTI 5 configuration */
  7083. #define SYSCFG_EXTICR2_EXTI6 ((uint32_t)0x0F00) /*!<EXTI 6 configuration */
  7084. #define SYSCFG_EXTICR2_EXTI7 ((uint32_t)0xF000) /*!<EXTI 7 configuration */
  7085. /**
  7086. * @brief EXTI4 configuration
  7087. */
  7088. #define SYSCFG_EXTICR2_EXTI4_PA ((uint32_t)0x0000) /*!<PA[4] pin */
  7089. #define SYSCFG_EXTICR2_EXTI4_PB ((uint32_t)0x0001) /*!<PB[4] pin */
  7090. #define SYSCFG_EXTICR2_EXTI4_PC ((uint32_t)0x0002) /*!<PC[4] pin */
  7091. #define SYSCFG_EXTICR2_EXTI4_PD ((uint32_t)0x0003) /*!<PD[4] pin */
  7092. #define SYSCFG_EXTICR2_EXTI4_PE ((uint32_t)0x0004) /*!<PE[4] pin */
  7093. #define SYSCFG_EXTICR2_EXTI4_PF ((uint32_t)0x0005) /*!<PF[4] pin */
  7094. #define SYSCFG_EXTICR2_EXTI4_PG ((uint32_t)0x0006) /*!<PG[4] pin */
  7095. #define SYSCFG_EXTICR2_EXTI4_PH ((uint32_t)0x0007) /*!<PH[4] pin */
  7096. #define SYSCFG_EXTICR2_EXTI4_PI ((uint32_t)0x0008) /*!<PI[4] pin */
  7097. #define SYSCFG_EXTICR2_EXTI4_PJ ((uint32_t)0x0009) /*!<PJ[4] pin */
  7098. #define SYSCFG_EXTICR2_EXTI4_PK ((uint32_t)0x000A) /*!<PK[4] pin */
  7099. /**
  7100. * @brief EXTI5 configuration
  7101. */
  7102. #define SYSCFG_EXTICR2_EXTI5_PA ((uint32_t)0x0000) /*!<PA[5] pin */
  7103. #define SYSCFG_EXTICR2_EXTI5_PB ((uint32_t)0x0010) /*!<PB[5] pin */
  7104. #define SYSCFG_EXTICR2_EXTI5_PC ((uint32_t)0x0020) /*!<PC[5] pin */
  7105. #define SYSCFG_EXTICR2_EXTI5_PD ((uint32_t)0x0030) /*!<PD[5] pin */
  7106. #define SYSCFG_EXTICR2_EXTI5_PE ((uint32_t)0x0040) /*!<PE[5] pin */
  7107. #define SYSCFG_EXTICR2_EXTI5_PF ((uint32_t)0x0050) /*!<PF[5] pin */
  7108. #define SYSCFG_EXTICR2_EXTI5_PG ((uint32_t)0x0060) /*!<PG[5] pin */
  7109. #define SYSCFG_EXTICR2_EXTI5_PH ((uint32_t)0x0070) /*!<PH[5] pin */
  7110. #define SYSCFG_EXTICR2_EXTI5_PI ((uint32_t)0x0080) /*!<PI[5] pin */
  7111. #define SYSCFG_EXTICR2_EXTI5_PJ ((uint32_t)0x0090) /*!<PJ[5] pin */
  7112. #define SYSCFG_EXTICR2_EXTI5_PK ((uint32_t)0x00A0) /*!<PK[5] pin */
  7113. /**
  7114. * @brief EXTI6 configuration
  7115. */
  7116. #define SYSCFG_EXTICR2_EXTI6_PA ((uint32_t)0x0000) /*!<PA[6] pin */
  7117. #define SYSCFG_EXTICR2_EXTI6_PB ((uint32_t)0x0100) /*!<PB[6] pin */
  7118. #define SYSCFG_EXTICR2_EXTI6_PC ((uint32_t)0x0200) /*!<PC[6] pin */
  7119. #define SYSCFG_EXTICR2_EXTI6_PD ((uint32_t)0x0300) /*!<PD[6] pin */
  7120. #define SYSCFG_EXTICR2_EXTI6_PE ((uint32_t)0x0400) /*!<PE[6] pin */
  7121. #define SYSCFG_EXTICR2_EXTI6_PF ((uint32_t)0x0500) /*!<PF[6] pin */
  7122. #define SYSCFG_EXTICR2_EXTI6_PG ((uint32_t)0x0600) /*!<PG[6] pin */
  7123. #define SYSCFG_EXTICR2_EXTI6_PH ((uint32_t)0x0700) /*!<PH[6] pin */
  7124. #define SYSCFG_EXTICR2_EXTI6_PI ((uint32_t)0x0800) /*!<PI[6] pin */
  7125. #define SYSCFG_EXTICR2_EXTI6_PJ ((uint32_t)0x0900) /*!<PJ[6] pin */
  7126. #define SYSCFG_EXTICR2_EXTI6_PK ((uint32_t)0x0A00) /*!<PK[6] pin */
  7127. /**
  7128. * @brief EXTI7 configuration
  7129. */
  7130. #define SYSCFG_EXTICR2_EXTI7_PA ((uint32_t)0x0000) /*!<PA[7] pin */
  7131. #define SYSCFG_EXTICR2_EXTI7_PB ((uint32_t)0x1000) /*!<PB[7] pin */
  7132. #define SYSCFG_EXTICR2_EXTI7_PC ((uint32_t)0x2000) /*!<PC[7] pin */
  7133. #define SYSCFG_EXTICR2_EXTI7_PD ((uint32_t)0x3000) /*!<PD[7] pin */
  7134. #define SYSCFG_EXTICR2_EXTI7_PE ((uint32_t)0x4000) /*!<PE[7] pin */
  7135. #define SYSCFG_EXTICR2_EXTI7_PF ((uint32_t)0x5000) /*!<PF[7] pin */
  7136. #define SYSCFG_EXTICR2_EXTI7_PG ((uint32_t)0x6000) /*!<PG[7] pin */
  7137. #define SYSCFG_EXTICR2_EXTI7_PH ((uint32_t)0x7000) /*!<PH[7] pin */
  7138. #define SYSCFG_EXTICR2_EXTI7_PI ((uint32_t)0x8000) /*!<PI[7] pin */
  7139. #define SYSCFG_EXTICR2_EXTI7_PJ ((uint32_t)0x9000) /*!<PJ[7] pin */
  7140. #define SYSCFG_EXTICR2_EXTI7_PK ((uint32_t)0xA000) /*!<PK[7] pin */
  7141. /***************** Bit definition for SYSCFG_EXTICR3 register ***************/
  7142. #define SYSCFG_EXTICR3_EXTI8 ((uint32_t)0x000F) /*!<EXTI 8 configuration */
  7143. #define SYSCFG_EXTICR3_EXTI9 ((uint32_t)0x00F0) /*!<EXTI 9 configuration */
  7144. #define SYSCFG_EXTICR3_EXTI10 ((uint32_t)0x0F00) /*!<EXTI 10 configuration */
  7145. #define SYSCFG_EXTICR3_EXTI11 ((uint32_t)0xF000) /*!<EXTI 11 configuration */
  7146. /**
  7147. * @brief EXTI8 configuration
  7148. */
  7149. #define SYSCFG_EXTICR3_EXTI8_PA ((uint32_t)0x0000) /*!<PA[8] pin */
  7150. #define SYSCFG_EXTICR3_EXTI8_PB ((uint32_t)0x0001) /*!<PB[8] pin */
  7151. #define SYSCFG_EXTICR3_EXTI8_PC ((uint32_t)0x0002) /*!<PC[8] pin */
  7152. #define SYSCFG_EXTICR3_EXTI8_PD ((uint32_t)0x0003) /*!<PD[8] pin */
  7153. #define SYSCFG_EXTICR3_EXTI8_PE ((uint32_t)0x0004) /*!<PE[8] pin */
  7154. #define SYSCFG_EXTICR3_EXTI8_PF ((uint32_t)0x0005) /*!<PF[8] pin */
  7155. #define SYSCFG_EXTICR3_EXTI8_PG ((uint32_t)0x0006) /*!<PG[8] pin */
  7156. #define SYSCFG_EXTICR3_EXTI8_PH ((uint32_t)0x0007) /*!<PH[8] pin */
  7157. #define SYSCFG_EXTICR3_EXTI8_PI ((uint32_t)0x0008) /*!<PI[8] pin */
  7158. #define SYSCFG_EXTICR3_EXTI8_PJ ((uint32_t)0x0009) /*!<PJ[8] pin */
  7159. /**
  7160. * @brief EXTI9 configuration
  7161. */
  7162. #define SYSCFG_EXTICR3_EXTI9_PA ((uint32_t)0x0000) /*!<PA[9] pin */
  7163. #define SYSCFG_EXTICR3_EXTI9_PB ((uint32_t)0x0010) /*!<PB[9] pin */
  7164. #define SYSCFG_EXTICR3_EXTI9_PC ((uint32_t)0x0020) /*!<PC[9] pin */
  7165. #define SYSCFG_EXTICR3_EXTI9_PD ((uint32_t)0x0030) /*!<PD[9] pin */
  7166. #define SYSCFG_EXTICR3_EXTI9_PE ((uint32_t)0x0040) /*!<PE[9] pin */
  7167. #define SYSCFG_EXTICR3_EXTI9_PF ((uint32_t)0x0050) /*!<PF[9] pin */
  7168. #define SYSCFG_EXTICR3_EXTI9_PG ((uint32_t)0x0060) /*!<PG[9] pin */
  7169. #define SYSCFG_EXTICR3_EXTI9_PH ((uint32_t)0x0070) /*!<PH[9] pin */
  7170. #define SYSCFG_EXTICR3_EXTI9_PI ((uint32_t)0x0080) /*!<PI[9] pin */
  7171. #define SYSCFG_EXTICR3_EXTI9_PJ ((uint32_t)0x0090) /*!<PJ[9] pin */
  7172. /**
  7173. * @brief EXTI10 configuration
  7174. */
  7175. #define SYSCFG_EXTICR3_EXTI10_PA ((uint32_t)0x0000) /*!<PA[10] pin */
  7176. #define SYSCFG_EXTICR3_EXTI10_PB ((uint32_t)0x0100) /*!<PB[10] pin */
  7177. #define SYSCFG_EXTICR3_EXTI10_PC ((uint32_t)0x0200) /*!<PC[10] pin */
  7178. #define SYSCFG_EXTICR3_EXTI10_PD ((uint32_t)0x0300) /*!<PD[10] pin */
  7179. #define SYSCFG_EXTICR3_EXTI10_PE ((uint32_t)0x0400) /*!<PE[10] pin */
  7180. #define SYSCFG_EXTICR3_EXTI10_PF ((uint32_t)0x0500) /*!<PF[10] pin */
  7181. #define SYSCFG_EXTICR3_EXTI10_PG ((uint32_t)0x0600) /*!<PG[10] pin */
  7182. #define SYSCFG_EXTICR3_EXTI10_PH ((uint32_t)0x0700) /*!<PH[10] pin */
  7183. #define SYSCFG_EXTICR3_EXTI10_PI ((uint32_t)0x0800) /*!<PI[10] pin */
  7184. #define SYSCFG_EXTICR3_EXTI10_PJ ((uint32_t)0x0900) /*!<PJ[10] pin */
  7185. /**
  7186. * @brief EXTI11 configuration
  7187. */
  7188. #define SYSCFG_EXTICR3_EXTI11_PA ((uint32_t)0x0000) /*!<PA[11] pin */
  7189. #define SYSCFG_EXTICR3_EXTI11_PB ((uint32_t)0x1000) /*!<PB[11] pin */
  7190. #define SYSCFG_EXTICR3_EXTI11_PC ((uint32_t)0x2000) /*!<PC[11] pin */
  7191. #define SYSCFG_EXTICR3_EXTI11_PD ((uint32_t)0x3000) /*!<PD[11] pin */
  7192. #define SYSCFG_EXTICR3_EXTI11_PE ((uint32_t)0x4000) /*!<PE[11] pin */
  7193. #define SYSCFG_EXTICR3_EXTI11_PF ((uint32_t)0x5000) /*!<PF[11] pin */
  7194. #define SYSCFG_EXTICR3_EXTI11_PG ((uint32_t)0x6000) /*!<PG[11] pin */
  7195. #define SYSCFG_EXTICR3_EXTI11_PH ((uint32_t)0x7000) /*!<PH[11] pin */
  7196. #define SYSCFG_EXTICR3_EXTI11_PI ((uint32_t)0x8000) /*!<PI[11] pin */
  7197. #define SYSCFG_EXTICR3_EXTI11_PJ ((uint32_t)0x9000) /*!<PJ[11] pin */
  7198. /***************** Bit definition for SYSCFG_EXTICR4 register ***************/
  7199. #define SYSCFG_EXTICR4_EXTI12 ((uint32_t)0x000F) /*!<EXTI 12 configuration */
  7200. #define SYSCFG_EXTICR4_EXTI13 ((uint32_t)0x00F0) /*!<EXTI 13 configuration */
  7201. #define SYSCFG_EXTICR4_EXTI14 ((uint32_t)0x0F00) /*!<EXTI 14 configuration */
  7202. #define SYSCFG_EXTICR4_EXTI15 ((uint32_t)0xF000) /*!<EXTI 15 configuration */
  7203. /**
  7204. * @brief EXTI12 configuration
  7205. */
  7206. #define SYSCFG_EXTICR4_EXTI12_PA ((uint32_t)0x0000) /*!<PA[12] pin */
  7207. #define SYSCFG_EXTICR4_EXTI12_PB ((uint32_t)0x0001) /*!<PB[12] pin */
  7208. #define SYSCFG_EXTICR4_EXTI12_PC ((uint32_t)0x0002) /*!<PC[12] pin */
  7209. #define SYSCFG_EXTICR4_EXTI12_PD ((uint32_t)0x0003) /*!<PD[12] pin */
  7210. #define SYSCFG_EXTICR4_EXTI12_PE ((uint32_t)0x0004) /*!<PE[12] pin */
  7211. #define SYSCFG_EXTICR4_EXTI12_PF ((uint32_t)0x0005) /*!<PF[12] pin */
  7212. #define SYSCFG_EXTICR4_EXTI12_PG ((uint32_t)0x0006) /*!<PG[12] pin */
  7213. #define SYSCFG_EXTICR4_EXTI12_PH ((uint32_t)0x0007) /*!<PH[12] pin */
  7214. #define SYSCFG_EXTICR4_EXTI12_PI ((uint32_t)0x0008) /*!<PI[12] pin */
  7215. #define SYSCFG_EXTICR4_EXTI12_PJ ((uint32_t)0x0009) /*!<PJ[12] pin */
  7216. /**
  7217. * @brief EXTI13 configuration
  7218. */
  7219. #define SYSCFG_EXTICR4_EXTI13_PA ((uint32_t)0x0000) /*!<PA[13] pin */
  7220. #define SYSCFG_EXTICR4_EXTI13_PB ((uint32_t)0x0010) /*!<PB[13] pin */
  7221. #define SYSCFG_EXTICR4_EXTI13_PC ((uint32_t)0x0020) /*!<PC[13] pin */
  7222. #define SYSCFG_EXTICR4_EXTI13_PD ((uint32_t)0x0030) /*!<PD[13] pin */
  7223. #define SYSCFG_EXTICR4_EXTI13_PE ((uint32_t)0x0040) /*!<PE[13] pin */
  7224. #define SYSCFG_EXTICR4_EXTI13_PF ((uint32_t)0x0050) /*!<PF[13] pin */
  7225. #define SYSCFG_EXTICR4_EXTI13_PG ((uint32_t)0x0060) /*!<PG[13] pin */
  7226. #define SYSCFG_EXTICR4_EXTI13_PH ((uint32_t)0x0070) /*!<PH[13] pin */
  7227. #define SYSCFG_EXTICR4_EXTI13_PI ((uint32_t)0x0008) /*!<PI[13] pin */
  7228. #define SYSCFG_EXTICR4_EXTI13_PJ ((uint32_t)0x0009) /*!<PJ[13] pin */
  7229. /**
  7230. * @brief EXTI14 configuration
  7231. */
  7232. #define SYSCFG_EXTICR4_EXTI14_PA ((uint32_t)0x0000) /*!<PA[14] pin */
  7233. #define SYSCFG_EXTICR4_EXTI14_PB ((uint32_t)0x0100) /*!<PB[14] pin */
  7234. #define SYSCFG_EXTICR4_EXTI14_PC ((uint32_t)0x0200) /*!<PC[14] pin */
  7235. #define SYSCFG_EXTICR4_EXTI14_PD ((uint32_t)0x0300) /*!<PD[14] pin */
  7236. #define SYSCFG_EXTICR4_EXTI14_PE ((uint32_t)0x0400) /*!<PE[14] pin */
  7237. #define SYSCFG_EXTICR4_EXTI14_PF ((uint32_t)0x0500) /*!<PF[14] pin */
  7238. #define SYSCFG_EXTICR4_EXTI14_PG ((uint32_t)0x0600) /*!<PG[14] pin */
  7239. #define SYSCFG_EXTICR4_EXTI14_PH ((uint32_t)0x0700) /*!<PH[14] pin */
  7240. #define SYSCFG_EXTICR4_EXTI14_PI ((uint32_t)0x0800) /*!<PI[14] pin */
  7241. #define SYSCFG_EXTICR4_EXTI14_PJ ((uint32_t)0x0900) /*!<PJ[14] pin */
  7242. /**
  7243. * @brief EXTI15 configuration
  7244. */
  7245. #define SYSCFG_EXTICR4_EXTI15_PA ((uint32_t)0x0000) /*!<PA[15] pin */
  7246. #define SYSCFG_EXTICR4_EXTI15_PB ((uint32_t)0x1000) /*!<PB[15] pin */
  7247. #define SYSCFG_EXTICR4_EXTI15_PC ((uint32_t)0x2000) /*!<PC[15] pin */
  7248. #define SYSCFG_EXTICR4_EXTI15_PD ((uint32_t)0x3000) /*!<PD[15] pin */
  7249. #define SYSCFG_EXTICR4_EXTI15_PE ((uint32_t)0x4000) /*!<PE[15] pin */
  7250. #define SYSCFG_EXTICR4_EXTI15_PF ((uint32_t)0x5000) /*!<PF[15] pin */
  7251. #define SYSCFG_EXTICR4_EXTI15_PG ((uint32_t)0x6000) /*!<PG[15] pin */
  7252. #define SYSCFG_EXTICR4_EXTI15_PH ((uint32_t)0x7000) /*!<PH[15] pin */
  7253. #define SYSCFG_EXTICR4_EXTI15_PI ((uint32_t)0x8000) /*!<PI[15] pin */
  7254. #define SYSCFG_EXTICR4_EXTI15_PJ ((uint32_t)0x9000) /*!<PJ[15] pin */
  7255. /****************** Bit definition for SYSCFG_CMPCR register ****************/
  7256. #define SYSCFG_CMPCR_CMP_PD ((uint32_t)0x00000001) /*!<Compensation cell ready flag */
  7257. #define SYSCFG_CMPCR_READY ((uint32_t)0x00000100) /*!<Compensation cell power-down */
  7258. /******************************************************************************/
  7259. /* */
  7260. /* TIM */
  7261. /* */
  7262. /******************************************************************************/
  7263. /******************* Bit definition for TIM_CR1 register ********************/
  7264. #define TIM_CR1_CEN ((uint32_t)0x0001) /*!<Counter enable */
  7265. #define TIM_CR1_UDIS ((uint32_t)0x0002) /*!<Update disable */
  7266. #define TIM_CR1_URS ((uint32_t)0x0004) /*!<Update request source */
  7267. #define TIM_CR1_OPM ((uint32_t)0x0008) /*!<One pulse mode */
  7268. #define TIM_CR1_DIR ((uint32_t)0x0010) /*!<Direction */
  7269. #define TIM_CR1_CMS ((uint32_t)0x0060) /*!<CMS[1:0] bits (Center-aligned mode selection) */
  7270. #define TIM_CR1_CMS_0 ((uint32_t)0x0020) /*!<Bit 0 */
  7271. #define TIM_CR1_CMS_1 ((uint32_t)0x0040) /*!<Bit 1 */
  7272. #define TIM_CR1_ARPE ((uint32_t)0x0080) /*!<Auto-reload preload enable */
  7273. #define TIM_CR1_CKD ((uint32_t)0x0300) /*!<CKD[1:0] bits (clock division) */
  7274. #define TIM_CR1_CKD_0 ((uint32_t)0x0100) /*!<Bit 0 */
  7275. #define TIM_CR1_CKD_1 ((uint32_t)0x0200) /*!<Bit 1 */
  7276. /******************* Bit definition for TIM_CR2 register ********************/
  7277. #define TIM_CR2_CCPC ((uint32_t)0x0001) /*!<Capture/Compare Preloaded Control */
  7278. #define TIM_CR2_CCUS ((uint32_t)0x0004) /*!<Capture/Compare Control Update Selection */
  7279. #define TIM_CR2_CCDS ((uint32_t)0x0008) /*!<Capture/Compare DMA Selection */
  7280. #define TIM_CR2_MMS ((uint32_t)0x0070) /*!<MMS[2:0] bits (Master Mode Selection) */
  7281. #define TIM_CR2_MMS_0 ((uint32_t)0x0010) /*!<Bit 0 */
  7282. #define TIM_CR2_MMS_1 ((uint32_t)0x0020) /*!<Bit 1 */
  7283. #define TIM_CR2_MMS_2 ((uint32_t)0x0040) /*!<Bit 2 */
  7284. #define TIM_CR2_TI1S ((uint32_t)0x0080) /*!<TI1 Selection */
  7285. #define TIM_CR2_OIS1 ((uint32_t)0x0100) /*!<Output Idle state 1 (OC1 output) */
  7286. #define TIM_CR2_OIS1N ((uint32_t)0x0200) /*!<Output Idle state 1 (OC1N output) */
  7287. #define TIM_CR2_OIS2 ((uint32_t)0x0400) /*!<Output Idle state 2 (OC2 output) */
  7288. #define TIM_CR2_OIS2N ((uint32_t)0x0800) /*!<Output Idle state 2 (OC2N output) */
  7289. #define TIM_CR2_OIS3 ((uint32_t)0x1000) /*!<Output Idle state 3 (OC3 output) */
  7290. #define TIM_CR2_OIS3N ((uint32_t)0x2000) /*!<Output Idle state 3 (OC3N output) */
  7291. #define TIM_CR2_OIS4 ((uint32_t)0x4000) /*!<Output Idle state 4 (OC4 output) */
  7292. /******************* Bit definition for TIM_SMCR register *******************/
  7293. #define TIM_SMCR_SMS ((uint32_t)0x0007) /*!<SMS[2:0] bits (Slave mode selection) */
  7294. #define TIM_SMCR_SMS_0 ((uint32_t)0x0001) /*!<Bit 0 */
  7295. #define TIM_SMCR_SMS_1 ((uint32_t)0x0002) /*!<Bit 1 */
  7296. #define TIM_SMCR_SMS_2 ((uint32_t)0x0004) /*!<Bit 2 */
  7297. #define TIM_SMCR_TS ((uint32_t)0x0070) /*!<TS[2:0] bits (Trigger selection) */
  7298. #define TIM_SMCR_TS_0 ((uint32_t)0x0010) /*!<Bit 0 */
  7299. #define TIM_SMCR_TS_1 ((uint32_t)0x0020) /*!<Bit 1 */
  7300. #define TIM_SMCR_TS_2 ((uint32_t)0x0040) /*!<Bit 2 */
  7301. #define TIM_SMCR_MSM ((uint32_t)0x0080) /*!<Master/slave mode */
  7302. #define TIM_SMCR_ETF ((uint32_t)0x0F00) /*!<ETF[3:0] bits (External trigger filter) */
  7303. #define TIM_SMCR_ETF_0 ((uint32_t)0x0100) /*!<Bit 0 */
  7304. #define TIM_SMCR_ETF_1 ((uint32_t)0x0200) /*!<Bit 1 */
  7305. #define TIM_SMCR_ETF_2 ((uint32_t)0x0400) /*!<Bit 2 */
  7306. #define TIM_SMCR_ETF_3 ((uint32_t)0x0800) /*!<Bit 3 */
  7307. #define TIM_SMCR_ETPS ((uint32_t)0x3000) /*!<ETPS[1:0] bits (External trigger prescaler) */
  7308. #define TIM_SMCR_ETPS_0 ((uint32_t)0x1000) /*!<Bit 0 */
  7309. #define TIM_SMCR_ETPS_1 ((uint32_t)0x2000) /*!<Bit 1 */
  7310. #define TIM_SMCR_ECE ((uint32_t)0x4000) /*!<External clock enable */
  7311. #define TIM_SMCR_ETP ((uint32_t)0x8000) /*!<External trigger polarity */
  7312. /******************* Bit definition for TIM_DIER register *******************/
  7313. #define TIM_DIER_UIE ((uint32_t)0x0001) /*!<Update interrupt enable */
  7314. #define TIM_DIER_CC1IE ((uint32_t)0x0002) /*!<Capture/Compare 1 interrupt enable */
  7315. #define TIM_DIER_CC2IE ((uint32_t)0x0004) /*!<Capture/Compare 2 interrupt enable */
  7316. #define TIM_DIER_CC3IE ((uint32_t)0x0008) /*!<Capture/Compare 3 interrupt enable */
  7317. #define TIM_DIER_CC4IE ((uint32_t)0x0010) /*!<Capture/Compare 4 interrupt enable */
  7318. #define TIM_DIER_COMIE ((uint32_t)0x0020) /*!<COM interrupt enable */
  7319. #define TIM_DIER_TIE ((uint32_t)0x0040) /*!<Trigger interrupt enable */
  7320. #define TIM_DIER_BIE ((uint32_t)0x0080) /*!<Break interrupt enable */
  7321. #define TIM_DIER_UDE ((uint32_t)0x0100) /*!<Update DMA request enable */
  7322. #define TIM_DIER_CC1DE ((uint32_t)0x0200) /*!<Capture/Compare 1 DMA request enable */
  7323. #define TIM_DIER_CC2DE ((uint32_t)0x0400) /*!<Capture/Compare 2 DMA request enable */
  7324. #define TIM_DIER_CC3DE ((uint32_t)0x0800) /*!<Capture/Compare 3 DMA request enable */
  7325. #define TIM_DIER_CC4DE ((uint32_t)0x1000) /*!<Capture/Compare 4 DMA request enable */
  7326. #define TIM_DIER_COMDE ((uint32_t)0x2000) /*!<COM DMA request enable */
  7327. #define TIM_DIER_TDE ((uint32_t)0x4000) /*!<Trigger DMA request enable */
  7328. /******************** Bit definition for TIM_SR register ********************/
  7329. #define TIM_SR_UIF ((uint32_t)0x0001) /*!<Update interrupt Flag */
  7330. #define TIM_SR_CC1IF ((uint32_t)0x0002) /*!<Capture/Compare 1 interrupt Flag */
  7331. #define TIM_SR_CC2IF ((uint32_t)0x0004) /*!<Capture/Compare 2 interrupt Flag */
  7332. #define TIM_SR_CC3IF ((uint32_t)0x0008) /*!<Capture/Compare 3 interrupt Flag */
  7333. #define TIM_SR_CC4IF ((uint32_t)0x0010) /*!<Capture/Compare 4 interrupt Flag */
  7334. #define TIM_SR_COMIF ((uint32_t)0x0020) /*!<COM interrupt Flag */
  7335. #define TIM_SR_TIF ((uint32_t)0x0040) /*!<Trigger interrupt Flag */
  7336. #define TIM_SR_BIF ((uint32_t)0x0080) /*!<Break interrupt Flag */
  7337. #define TIM_SR_CC1OF ((uint32_t)0x0200) /*!<Capture/Compare 1 Overcapture Flag */
  7338. #define TIM_SR_CC2OF ((uint32_t)0x0400) /*!<Capture/Compare 2 Overcapture Flag */
  7339. #define TIM_SR_CC3OF ((uint32_t)0x0800) /*!<Capture/Compare 3 Overcapture Flag */
  7340. #define TIM_SR_CC4OF ((uint32_t)0x1000) /*!<Capture/Compare 4 Overcapture Flag */
  7341. /******************* Bit definition for TIM_EGR register ********************/
  7342. #define TIM_EGR_UG ((uint32_t)0x01) /*!<Update Generation */
  7343. #define TIM_EGR_CC1G ((uint32_t)0x02) /*!<Capture/Compare 1 Generation */
  7344. #define TIM_EGR_CC2G ((uint32_t)0x04) /*!<Capture/Compare 2 Generation */
  7345. #define TIM_EGR_CC3G ((uint32_t)0x08) /*!<Capture/Compare 3 Generation */
  7346. #define TIM_EGR_CC4G ((uint32_t)0x10) /*!<Capture/Compare 4 Generation */
  7347. #define TIM_EGR_COMG ((uint32_t)0x20) /*!<Capture/Compare Control Update Generation */
  7348. #define TIM_EGR_TG ((uint32_t)0x40) /*!<Trigger Generation */
  7349. #define TIM_EGR_BG ((uint32_t)0x80) /*!<Break Generation */
  7350. /****************** Bit definition for TIM_CCMR1 register *******************/
  7351. #define TIM_CCMR1_CC1S ((uint32_t)0x0003) /*!<CC1S[1:0] bits (Capture/Compare 1 Selection) */
  7352. #define TIM_CCMR1_CC1S_0 ((uint32_t)0x0001) /*!<Bit 0 */
  7353. #define TIM_CCMR1_CC1S_1 ((uint32_t)0x0002) /*!<Bit 1 */
  7354. #define TIM_CCMR1_OC1FE ((uint32_t)0x0004) /*!<Output Compare 1 Fast enable */
  7355. #define TIM_CCMR1_OC1PE ((uint32_t)0x0008) /*!<Output Compare 1 Preload enable */
  7356. #define TIM_CCMR1_OC1M ((uint32_t)0x0070) /*!<OC1M[2:0] bits (Output Compare 1 Mode) */
  7357. #define TIM_CCMR1_OC1M_0 ((uint32_t)0x0010) /*!<Bit 0 */
  7358. #define TIM_CCMR1_OC1M_1 ((uint32_t)0x0020) /*!<Bit 1 */
  7359. #define TIM_CCMR1_OC1M_2 ((uint32_t)0x0040) /*!<Bit 2 */
  7360. #define TIM_CCMR1_OC1CE ((uint32_t)0x0080) /*!<Output Compare 1Clear Enable */
  7361. #define TIM_CCMR1_CC2S ((uint32_t)0x0300) /*!<CC2S[1:0] bits (Capture/Compare 2 Selection) */
  7362. #define TIM_CCMR1_CC2S_0 ((uint32_t)0x0100) /*!<Bit 0 */
  7363. #define TIM_CCMR1_CC2S_1 ((uint32_t)0x0200) /*!<Bit 1 */
  7364. #define TIM_CCMR1_OC2FE ((uint32_t)0x0400) /*!<Output Compare 2 Fast enable */
  7365. #define TIM_CCMR1_OC2PE ((uint32_t)0x0800) /*!<Output Compare 2 Preload enable */
  7366. #define TIM_CCMR1_OC2M ((uint32_t)0x7000) /*!<OC2M[2:0] bits (Output Compare 2 Mode) */
  7367. #define TIM_CCMR1_OC2M_0 ((uint32_t)0x1000) /*!<Bit 0 */
  7368. #define TIM_CCMR1_OC2M_1 ((uint32_t)0x2000) /*!<Bit 1 */
  7369. #define TIM_CCMR1_OC2M_2 ((uint32_t)0x4000) /*!<Bit 2 */
  7370. #define TIM_CCMR1_OC2CE ((uint32_t)0x8000) /*!<Output Compare 2 Clear Enable */
  7371. /*----------------------------------------------------------------------------*/
  7372. #define TIM_CCMR1_IC1PSC ((uint32_t)0x000C) /*!<IC1PSC[1:0] bits (Input Capture 1 Prescaler) */
  7373. #define TIM_CCMR1_IC1PSC_0 ((uint32_t)0x0004) /*!<Bit 0 */
  7374. #define TIM_CCMR1_IC1PSC_1 ((uint32_t)0x0008) /*!<Bit 1 */
  7375. #define TIM_CCMR1_IC1F ((uint32_t)0x00F0) /*!<IC1F[3:0] bits (Input Capture 1 Filter) */
  7376. #define TIM_CCMR1_IC1F_0 ((uint32_t)0x0010) /*!<Bit 0 */
  7377. #define TIM_CCMR1_IC1F_1 ((uint32_t)0x0020) /*!<Bit 1 */
  7378. #define TIM_CCMR1_IC1F_2 ((uint32_t)0x0040) /*!<Bit 2 */
  7379. #define TIM_CCMR1_IC1F_3 ((uint32_t)0x0080) /*!<Bit 3 */
  7380. #define TIM_CCMR1_IC2PSC ((uint32_t)0x0C00) /*!<IC2PSC[1:0] bits (Input Capture 2 Prescaler) */
  7381. #define TIM_CCMR1_IC2PSC_0 ((uint32_t)0x0400) /*!<Bit 0 */
  7382. #define TIM_CCMR1_IC2PSC_1 ((uint32_t)0x0800) /*!<Bit 1 */
  7383. #define TIM_CCMR1_IC2F ((uint32_t)0xF000) /*!<IC2F[3:0] bits (Input Capture 2 Filter) */
  7384. #define TIM_CCMR1_IC2F_0 ((uint32_t)0x1000) /*!<Bit 0 */
  7385. #define TIM_CCMR1_IC2F_1 ((uint32_t)0x2000) /*!<Bit 1 */
  7386. #define TIM_CCMR1_IC2F_2 ((uint32_t)0x4000) /*!<Bit 2 */
  7387. #define TIM_CCMR1_IC2F_3 ((uint32_t)0x8000) /*!<Bit 3 */
  7388. /****************** Bit definition for TIM_CCMR2 register *******************/
  7389. #define TIM_CCMR2_CC3S ((uint32_t)0x0003) /*!<CC3S[1:0] bits (Capture/Compare 3 Selection) */
  7390. #define TIM_CCMR2_CC3S_0 ((uint32_t)0x0001) /*!<Bit 0 */
  7391. #define TIM_CCMR2_CC3S_1 ((uint32_t)0x0002) /*!<Bit 1 */
  7392. #define TIM_CCMR2_OC3FE ((uint32_t)0x0004) /*!<Output Compare 3 Fast enable */
  7393. #define TIM_CCMR2_OC3PE ((uint32_t)0x0008) /*!<Output Compare 3 Preload enable */
  7394. #define TIM_CCMR2_OC3M ((uint32_t)0x0070) /*!<OC3M[2:0] bits (Output Compare 3 Mode) */
  7395. #define TIM_CCMR2_OC3M_0 ((uint32_t)0x0010) /*!<Bit 0 */
  7396. #define TIM_CCMR2_OC3M_1 ((uint32_t)0x0020) /*!<Bit 1 */
  7397. #define TIM_CCMR2_OC3M_2 ((uint32_t)0x0040) /*!<Bit 2 */
  7398. #define TIM_CCMR2_OC3CE ((uint32_t)0x0080) /*!<Output Compare 3 Clear Enable */
  7399. #define TIM_CCMR2_CC4S ((uint32_t)0x0300) /*!<CC4S[1:0] bits (Capture/Compare 4 Selection) */
  7400. #define TIM_CCMR2_CC4S_0 ((uint32_t)0x0100) /*!<Bit 0 */
  7401. #define TIM_CCMR2_CC4S_1 ((uint32_t)0x0200) /*!<Bit 1 */
  7402. #define TIM_CCMR2_OC4FE ((uint32_t)0x0400) /*!<Output Compare 4 Fast enable */
  7403. #define TIM_CCMR2_OC4PE ((uint32_t)0x0800) /*!<Output Compare 4 Preload enable */
  7404. #define TIM_CCMR2_OC4M ((uint32_t)0x7000) /*!<OC4M[2:0] bits (Output Compare 4 Mode) */
  7405. #define TIM_CCMR2_OC4M_0 ((uint32_t)0x1000) /*!<Bit 0 */
  7406. #define TIM_CCMR2_OC4M_1 ((uint32_t)0x2000) /*!<Bit 1 */
  7407. #define TIM_CCMR2_OC4M_2 ((uint32_t)0x4000) /*!<Bit 2 */
  7408. #define TIM_CCMR2_OC4CE ((uint32_t)0x8000) /*!<Output Compare 4 Clear Enable */
  7409. /*----------------------------------------------------------------------------*/
  7410. #define TIM_CCMR2_IC3PSC ((uint32_t)0x000C) /*!<IC3PSC[1:0] bits (Input Capture 3 Prescaler) */
  7411. #define TIM_CCMR2_IC3PSC_0 ((uint32_t)0x0004) /*!<Bit 0 */
  7412. #define TIM_CCMR2_IC3PSC_1 ((uint32_t)0x0008) /*!<Bit 1 */
  7413. #define TIM_CCMR2_IC3F ((uint32_t)0x00F0) /*!<IC3F[3:0] bits (Input Capture 3 Filter) */
  7414. #define TIM_CCMR2_IC3F_0 ((uint32_t)0x0010) /*!<Bit 0 */
  7415. #define TIM_CCMR2_IC3F_1 ((uint32_t)0x0020) /*!<Bit 1 */
  7416. #define TIM_CCMR2_IC3F_2 ((uint32_t)0x0040) /*!<Bit 2 */
  7417. #define TIM_CCMR2_IC3F_3 ((uint32_t)0x0080) /*!<Bit 3 */
  7418. #define TIM_CCMR2_IC4PSC ((uint32_t)0x0C00) /*!<IC4PSC[1:0] bits (Input Capture 4 Prescaler) */
  7419. #define TIM_CCMR2_IC4PSC_0 ((uint32_t)0x0400) /*!<Bit 0 */
  7420. #define TIM_CCMR2_IC4PSC_1 ((uint32_t)0x0800) /*!<Bit 1 */
  7421. #define TIM_CCMR2_IC4F ((uint32_t)0xF000) /*!<IC4F[3:0] bits (Input Capture 4 Filter) */
  7422. #define TIM_CCMR2_IC4F_0 ((uint32_t)0x1000) /*!<Bit 0 */
  7423. #define TIM_CCMR2_IC4F_1 ((uint32_t)0x2000) /*!<Bit 1 */
  7424. #define TIM_CCMR2_IC4F_2 ((uint32_t)0x4000) /*!<Bit 2 */
  7425. #define TIM_CCMR2_IC4F_3 ((uint32_t)0x8000) /*!<Bit 3 */
  7426. /******************* Bit definition for TIM_CCER register *******************/
  7427. #define TIM_CCER_CC1E ((uint32_t)0x0001) /*!<Capture/Compare 1 output enable */
  7428. #define TIM_CCER_CC1P ((uint32_t)0x0002) /*!<Capture/Compare 1 output Polarity */
  7429. #define TIM_CCER_CC1NE ((uint32_t)0x0004) /*!<Capture/Compare 1 Complementary output enable */
  7430. #define TIM_CCER_CC1NP ((uint32_t)0x0008) /*!<Capture/Compare 1 Complementary output Polarity */
  7431. #define TIM_CCER_CC2E ((uint32_t)0x0010) /*!<Capture/Compare 2 output enable */
  7432. #define TIM_CCER_CC2P ((uint32_t)0x0020) /*!<Capture/Compare 2 output Polarity */
  7433. #define TIM_CCER_CC2NE ((uint32_t)0x0040) /*!<Capture/Compare 2 Complementary output enable */
  7434. #define TIM_CCER_CC2NP ((uint32_t)0x0080) /*!<Capture/Compare 2 Complementary output Polarity */
  7435. #define TIM_CCER_CC3E ((uint32_t)0x0100) /*!<Capture/Compare 3 output enable */
  7436. #define TIM_CCER_CC3P ((uint32_t)0x0200) /*!<Capture/Compare 3 output Polarity */
  7437. #define TIM_CCER_CC3NE ((uint32_t)0x0400) /*!<Capture/Compare 3 Complementary output enable */
  7438. #define TIM_CCER_CC3NP ((uint32_t)0x0800) /*!<Capture/Compare 3 Complementary output Polarity */
  7439. #define TIM_CCER_CC4E ((uint32_t)0x1000) /*!<Capture/Compare 4 output enable */
  7440. #define TIM_CCER_CC4P ((uint32_t)0x2000) /*!<Capture/Compare 4 output Polarity */
  7441. #define TIM_CCER_CC4NP ((uint32_t)0x8000) /*!<Capture/Compare 4 Complementary output Polarity */
  7442. /******************* Bit definition for TIM_CNT register ********************/
  7443. #define TIM_CNT_CNT ((uint32_t)0xFFFF) /*!<Counter Value */
  7444. /******************* Bit definition for TIM_PSC register ********************/
  7445. #define TIM_PSC_PSC ((uint32_t)0xFFFF) /*!<Prescaler Value */
  7446. /******************* Bit definition for TIM_ARR register ********************/
  7447. #define TIM_ARR_ARR ((uint32_t)0xFFFF) /*!<actual auto-reload Value */
  7448. /******************* Bit definition for TIM_RCR register ********************/
  7449. #define TIM_RCR_REP ((uint32_t)0xFF) /*!<Repetition Counter Value */
  7450. /******************* Bit definition for TIM_CCR1 register *******************/
  7451. #define TIM_CCR1_CCR1 ((uint32_t)0xFFFF) /*!<Capture/Compare 1 Value */
  7452. /******************* Bit definition for TIM_CCR2 register *******************/
  7453. #define TIM_CCR2_CCR2 ((uint32_t)0xFFFF) /*!<Capture/Compare 2 Value */
  7454. /******************* Bit definition for TIM_CCR3 register *******************/
  7455. #define TIM_CCR3_CCR3 ((uint32_t)0xFFFF) /*!<Capture/Compare 3 Value */
  7456. /******************* Bit definition for TIM_CCR4 register *******************/
  7457. #define TIM_CCR4_CCR4 ((uint32_t)0xFFFF) /*!<Capture/Compare 4 Value */
  7458. /******************* Bit definition for TIM_BDTR register *******************/
  7459. #define TIM_BDTR_DTG ((uint32_t)0x00FF) /*!<DTG[0:7] bits (Dead-Time Generator set-up) */
  7460. #define TIM_BDTR_DTG_0 ((uint32_t)0x0001) /*!<Bit 0 */
  7461. #define TIM_BDTR_DTG_1 ((uint32_t)0x0002) /*!<Bit 1 */
  7462. #define TIM_BDTR_DTG_2 ((uint32_t)0x0004) /*!<Bit 2 */
  7463. #define TIM_BDTR_DTG_3 ((uint32_t)0x0008) /*!<Bit 3 */
  7464. #define TIM_BDTR_DTG_4 ((uint32_t)0x0010) /*!<Bit 4 */
  7465. #define TIM_BDTR_DTG_5 ((uint32_t)0x0020) /*!<Bit 5 */
  7466. #define TIM_BDTR_DTG_6 ((uint32_t)0x0040) /*!<Bit 6 */
  7467. #define TIM_BDTR_DTG_7 ((uint32_t)0x0080) /*!<Bit 7 */
  7468. #define TIM_BDTR_LOCK ((uint32_t)0x0300) /*!<LOCK[1:0] bits (Lock Configuration) */
  7469. #define TIM_BDTR_LOCK_0 ((uint32_t)0x0100) /*!<Bit 0 */
  7470. #define TIM_BDTR_LOCK_1 ((uint32_t)0x0200) /*!<Bit 1 */
  7471. #define TIM_BDTR_OSSI ((uint32_t)0x0400) /*!<Off-State Selection for Idle mode */
  7472. #define TIM_BDTR_OSSR ((uint32_t)0x0800) /*!<Off-State Selection for Run mode */
  7473. #define TIM_BDTR_BKE ((uint32_t)0x1000) /*!<Break enable */
  7474. #define TIM_BDTR_BKP ((uint32_t)0x2000) /*!<Break Polarity */
  7475. #define TIM_BDTR_AOE ((uint32_t)0x4000) /*!<Automatic Output enable */
  7476. #define TIM_BDTR_MOE ((uint32_t)0x8000) /*!<Main Output enable */
  7477. /******************* Bit definition for TIM_DCR register ********************/
  7478. #define TIM_DCR_DBA ((uint32_t)0x001F) /*!<DBA[4:0] bits (DMA Base Address) */
  7479. #define TIM_DCR_DBA_0 ((uint32_t)0x0001) /*!<Bit 0 */
  7480. #define TIM_DCR_DBA_1 ((uint32_t)0x0002) /*!<Bit 1 */
  7481. #define TIM_DCR_DBA_2 ((uint32_t)0x0004) /*!<Bit 2 */
  7482. #define TIM_DCR_DBA_3 ((uint32_t)0x0008) /*!<Bit 3 */
  7483. #define TIM_DCR_DBA_4 ((uint32_t)0x0010) /*!<Bit 4 */
  7484. #define TIM_DCR_DBL ((uint32_t)0x1F00) /*!<DBL[4:0] bits (DMA Burst Length) */
  7485. #define TIM_DCR_DBL_0 ((uint32_t)0x0100) /*!<Bit 0 */
  7486. #define TIM_DCR_DBL_1 ((uint32_t)0x0200) /*!<Bit 1 */
  7487. #define TIM_DCR_DBL_2 ((uint32_t)0x0400) /*!<Bit 2 */
  7488. #define TIM_DCR_DBL_3 ((uint32_t)0x0800) /*!<Bit 3 */
  7489. #define TIM_DCR_DBL_4 ((uint32_t)0x1000) /*!<Bit 4 */
  7490. /******************* Bit definition for TIM_DMAR register *******************/
  7491. #define TIM_DMAR_DMAB ((uint32_t)0xFFFF) /*!<DMA register for burst accesses */
  7492. /******************* Bit definition for TIM_OR register *********************/
  7493. #define TIM_OR_TI4_RMP ((uint32_t)0x00C0) /*!<TI4_RMP[1:0] bits (TIM5 Input 4 remap) */
  7494. #define TIM_OR_TI4_RMP_0 ((uint32_t)0x0040) /*!<Bit 0 */
  7495. #define TIM_OR_TI4_RMP_1 ((uint32_t)0x0080) /*!<Bit 1 */
  7496. #define TIM_OR_ITR1_RMP ((uint32_t)0x0C00) /*!<ITR1_RMP[1:0] bits (TIM2 Internal trigger 1 remap) */
  7497. #define TIM_OR_ITR1_RMP_0 ((uint32_t)0x0400) /*!<Bit 0 */
  7498. #define TIM_OR_ITR1_RMP_1 ((uint32_t)0x0800) /*!<Bit 1 */
  7499. /******************************************************************************/
  7500. /* */
  7501. /* Universal Synchronous Asynchronous Receiver Transmitter */
  7502. /* */
  7503. /******************************************************************************/
  7504. /******************* Bit definition for USART_SR register *******************/
  7505. #define USART_SR_PE ((uint32_t)0x0001) /*!<Parity Error */
  7506. #define USART_SR_FE ((uint32_t)0x0002) /*!<Framing Error */
  7507. #define USART_SR_NE ((uint32_t)0x0004) /*!<Noise Error Flag */
  7508. #define USART_SR_ORE ((uint32_t)0x0008) /*!<OverRun Error */
  7509. #define USART_SR_IDLE ((uint32_t)0x0010) /*!<IDLE line detected */
  7510. #define USART_SR_RXNE ((uint32_t)0x0020) /*!<Read Data Register Not Empty */
  7511. #define USART_SR_TC ((uint32_t)0x0040) /*!<Transmission Complete */
  7512. #define USART_SR_TXE ((uint32_t)0x0080) /*!<Transmit Data Register Empty */
  7513. #define USART_SR_LBD ((uint32_t)0x0100) /*!<LIN Break Detection Flag */
  7514. #define USART_SR_CTS ((uint32_t)0x0200) /*!<CTS Flag */
  7515. /******************* Bit definition for USART_DR register *******************/
  7516. #define USART_DR_DR ((uint32_t)0x01FF) /*!<Data value */
  7517. /****************** Bit definition for USART_BRR register *******************/
  7518. #define USART_BRR_DIV_Fraction ((uint32_t)0x000F) /*!<Fraction of USARTDIV */
  7519. #define USART_BRR_DIV_Mantissa ((uint32_t)0xFFF0) /*!<Mantissa of USARTDIV */
  7520. /****************** Bit definition for USART_CR1 register *******************/
  7521. #define USART_CR1_SBK ((uint32_t)0x0001) /*!<Send Break */
  7522. #define USART_CR1_RWU ((uint32_t)0x0002) /*!<Receiver wakeup */
  7523. #define USART_CR1_RE ((uint32_t)0x0004) /*!<Receiver Enable */
  7524. #define USART_CR1_TE ((uint32_t)0x0008) /*!<Transmitter Enable */
  7525. #define USART_CR1_IDLEIE ((uint32_t)0x0010) /*!<IDLE Interrupt Enable */
  7526. #define USART_CR1_RXNEIE ((uint32_t)0x0020) /*!<RXNE Interrupt Enable */
  7527. #define USART_CR1_TCIE ((uint32_t)0x0040) /*!<Transmission Complete Interrupt Enable */
  7528. #define USART_CR1_TXEIE ((uint32_t)0x0080) /*!<PE Interrupt Enable */
  7529. #define USART_CR1_PEIE ((uint32_t)0x0100) /*!<PE Interrupt Enable */
  7530. #define USART_CR1_PS ((uint32_t)0x0200) /*!<Parity Selection */
  7531. #define USART_CR1_PCE ((uint32_t)0x0400) /*!<Parity Control Enable */
  7532. #define USART_CR1_WAKE ((uint32_t)0x0800) /*!<Wakeup method */
  7533. #define USART_CR1_M ((uint32_t)0x1000) /*!<Word length */
  7534. #define USART_CR1_UE ((uint32_t)0x2000) /*!<USART Enable */
  7535. #define USART_CR1_OVER8 ((uint32_t)0x8000) /*!<USART Oversampling by 8 enable */
  7536. /****************** Bit definition for USART_CR2 register *******************/
  7537. #define USART_CR2_ADD ((uint32_t)0x000F) /*!<Address of the USART node */
  7538. #define USART_CR2_LBDL ((uint32_t)0x0020) /*!<LIN Break Detection Length */
  7539. #define USART_CR2_LBDIE ((uint32_t)0x0040) /*!<LIN Break Detection Interrupt Enable */
  7540. #define USART_CR2_LBCL ((uint32_t)0x0100) /*!<Last Bit Clock pulse */
  7541. #define USART_CR2_CPHA ((uint32_t)0x0200) /*!<Clock Phase */
  7542. #define USART_CR2_CPOL ((uint32_t)0x0400) /*!<Clock Polarity */
  7543. #define USART_CR2_CLKEN ((uint32_t)0x0800) /*!<Clock Enable */
  7544. #define USART_CR2_STOP ((uint32_t)0x3000) /*!<STOP[1:0] bits (STOP bits) */
  7545. #define USART_CR2_STOP_0 ((uint32_t)0x1000) /*!<Bit 0 */
  7546. #define USART_CR2_STOP_1 ((uint32_t)0x2000) /*!<Bit 1 */
  7547. #define USART_CR2_LINEN ((uint32_t)0x4000) /*!<LIN mode enable */
  7548. /****************** Bit definition for USART_CR3 register *******************/
  7549. #define USART_CR3_EIE ((uint32_t)0x0001) /*!<Error Interrupt Enable */
  7550. #define USART_CR3_IREN ((uint32_t)0x0002) /*!<IrDA mode Enable */
  7551. #define USART_CR3_IRLP ((uint32_t)0x0004) /*!<IrDA Low-Power */
  7552. #define USART_CR3_HDSEL ((uint32_t)0x0008) /*!<Half-Duplex Selection */
  7553. #define USART_CR3_NACK ((uint32_t)0x0010) /*!<Smartcard NACK enable */
  7554. #define USART_CR3_SCEN ((uint32_t)0x0020) /*!<Smartcard mode enable */
  7555. #define USART_CR3_DMAR ((uint32_t)0x0040) /*!<DMA Enable Receiver */
  7556. #define USART_CR3_DMAT ((uint32_t)0x0080) /*!<DMA Enable Transmitter */
  7557. #define USART_CR3_RTSE ((uint32_t)0x0100) /*!<RTS Enable */
  7558. #define USART_CR3_CTSE ((uint32_t)0x0200) /*!<CTS Enable */
  7559. #define USART_CR3_CTSIE ((uint32_t)0x0400) /*!<CTS Interrupt Enable */
  7560. #define USART_CR3_ONEBIT ((uint32_t)0x0800) /*!<USART One bit method enable */
  7561. /****************** Bit definition for USART_GTPR register ******************/
  7562. #define USART_GTPR_PSC ((uint32_t)0x00FF) /*!<PSC[7:0] bits (Prescaler value) */
  7563. #define USART_GTPR_PSC_0 ((uint32_t)0x0001) /*!<Bit 0 */
  7564. #define USART_GTPR_PSC_1 ((uint32_t)0x0002) /*!<Bit 1 */
  7565. #define USART_GTPR_PSC_2 ((uint32_t)0x0004) /*!<Bit 2 */
  7566. #define USART_GTPR_PSC_3 ((uint32_t)0x0008) /*!<Bit 3 */
  7567. #define USART_GTPR_PSC_4 ((uint32_t)0x0010) /*!<Bit 4 */
  7568. #define USART_GTPR_PSC_5 ((uint32_t)0x0020) /*!<Bit 5 */
  7569. #define USART_GTPR_PSC_6 ((uint32_t)0x0040) /*!<Bit 6 */
  7570. #define USART_GTPR_PSC_7 ((uint32_t)0x0080) /*!<Bit 7 */
  7571. #define USART_GTPR_GT ((uint32_t)0xFF00) /*!<Guard time value */
  7572. /******************************************************************************/
  7573. /* */
  7574. /* Window WATCHDOG */
  7575. /* */
  7576. /******************************************************************************/
  7577. /******************* Bit definition for WWDG_CR register ********************/
  7578. #define WWDG_CR_T ((uint32_t)0x7F) /*!<T[6:0] bits (7-Bit counter (MSB to LSB)) */
  7579. #define WWDG_CR_T0 ((uint32_t)0x01) /*!<Bit 0 */
  7580. #define WWDG_CR_T1 ((uint32_t)0x02) /*!<Bit 1 */
  7581. #define WWDG_CR_T2 ((uint32_t)0x04) /*!<Bit 2 */
  7582. #define WWDG_CR_T3 ((uint32_t)0x08) /*!<Bit 3 */
  7583. #define WWDG_CR_T4 ((uint32_t)0x10) /*!<Bit 4 */
  7584. #define WWDG_CR_T5 ((uint32_t)0x20) /*!<Bit 5 */
  7585. #define WWDG_CR_T6 ((uint32_t)0x40) /*!<Bit 6 */
  7586. #define WWDG_CR_WDGA ((uint32_t)0x80) /*!<Activation bit */
  7587. /******************* Bit definition for WWDG_CFR register *******************/
  7588. #define WWDG_CFR_W ((uint32_t)0x007F) /*!<W[6:0] bits (7-bit window value) */
  7589. #define WWDG_CFR_W0 ((uint32_t)0x0001) /*!<Bit 0 */
  7590. #define WWDG_CFR_W1 ((uint32_t)0x0002) /*!<Bit 1 */
  7591. #define WWDG_CFR_W2 ((uint32_t)0x0004) /*!<Bit 2 */
  7592. #define WWDG_CFR_W3 ((uint32_t)0x0008) /*!<Bit 3 */
  7593. #define WWDG_CFR_W4 ((uint32_t)0x0010) /*!<Bit 4 */
  7594. #define WWDG_CFR_W5 ((uint32_t)0x0020) /*!<Bit 5 */
  7595. #define WWDG_CFR_W6 ((uint32_t)0x0040) /*!<Bit 6 */
  7596. #define WWDG_CFR_WDGTB ((uint32_t)0x0180) /*!<WDGTB[1:0] bits (Timer Base) */
  7597. #define WWDG_CFR_WDGTB0 ((uint32_t)0x0080) /*!<Bit 0 */
  7598. #define WWDG_CFR_WDGTB1 ((uint32_t)0x0100) /*!<Bit 1 */
  7599. #define WWDG_CFR_EWI ((uint32_t)0x0200) /*!<Early Wakeup Interrupt */
  7600. /******************* Bit definition for WWDG_SR register ********************/
  7601. #define WWDG_SR_EWIF ((uint32_t)0x01) /*!<Early Wakeup Interrupt Flag */
  7602. /******************************************************************************/
  7603. /* */
  7604. /* DBG */
  7605. /* */
  7606. /******************************************************************************/
  7607. /******************** Bit definition for DBGMCU_IDCODE register *************/
  7608. #define DBGMCU_IDCODE_DEV_ID ((uint32_t)0x00000FFF)
  7609. #define DBGMCU_IDCODE_REV_ID ((uint32_t)0xFFFF0000)
  7610. /******************** Bit definition for DBGMCU_CR register *****************/
  7611. #define DBGMCU_CR_DBG_SLEEP ((uint32_t)0x00000001)
  7612. #define DBGMCU_CR_DBG_STOP ((uint32_t)0x00000002)
  7613. #define DBGMCU_CR_DBG_STANDBY ((uint32_t)0x00000004)
  7614. #define DBGMCU_CR_TRACE_IOEN ((uint32_t)0x00000020)
  7615. #define DBGMCU_CR_TRACE_MODE ((uint32_t)0x000000C0)
  7616. #define DBGMCU_CR_TRACE_MODE_0 ((uint32_t)0x00000040)/*!<Bit 0 */
  7617. #define DBGMCU_CR_TRACE_MODE_1 ((uint32_t)0x00000080)/*!<Bit 1 */
  7618. /******************** Bit definition for DBGMCU_APB1_FZ register ************/
  7619. #define DBGMCU_APB1_FZ_DBG_TIM2_STOP ((uint32_t)0x00000001)
  7620. #define DBGMCU_APB1_FZ_DBG_TIM3_STOP ((uint32_t)0x00000002)
  7621. #define DBGMCU_APB1_FZ_DBG_TIM4_STOP ((uint32_t)0x00000004)
  7622. #define DBGMCU_APB1_FZ_DBG_TIM5_STOP ((uint32_t)0x00000008)
  7623. #define DBGMCU_APB1_FZ_DBG_TIM6_STOP ((uint32_t)0x00000010)
  7624. #define DBGMCU_APB1_FZ_DBG_TIM7_STOP ((uint32_t)0x00000020)
  7625. #define DBGMCU_APB1_FZ_DBG_TIM12_STOP ((uint32_t)0x00000040)
  7626. #define DBGMCU_APB1_FZ_DBG_TIM13_STOP ((uint32_t)0x00000080)
  7627. #define DBGMCU_APB1_FZ_DBG_TIM14_STOP ((uint32_t)0x00000100)
  7628. #define DBGMCU_APB1_FZ_DBG_RTC_STOP ((uint32_t)0x00000400)
  7629. #define DBGMCU_APB1_FZ_DBG_WWDG_STOP ((uint32_t)0x00000800)
  7630. #define DBGMCU_APB1_FZ_DBG_IWDG_STOP ((uint32_t)0x00001000)
  7631. #define DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT ((uint32_t)0x00200000)
  7632. #define DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT ((uint32_t)0x00400000)
  7633. #define DBGMCU_APB1_FZ_DBG_I2C3_SMBUS_TIMEOUT ((uint32_t)0x00800000)
  7634. #define DBGMCU_APB1_FZ_DBG_CAN1_STOP ((uint32_t)0x02000000)
  7635. #define DBGMCU_APB1_FZ_DBG_CAN2_STOP ((uint32_t)0x04000000)
  7636. /* Old IWDGSTOP bit definition, maintained for legacy purpose */
  7637. #define DBGMCU_APB1_FZ_DBG_IWDEG_STOP DBGMCU_APB1_FZ_DBG_IWDG_STOP
  7638. /******************** Bit definition for DBGMCU_APB2_FZ register ************/
  7639. #define DBGMCU_APB2_FZ_DBG_TIM1_STOP ((uint32_t)0x00000001)
  7640. #define DBGMCU_APB2_FZ_DBG_TIM8_STOP ((uint32_t)0x00000002)
  7641. #define DBGMCU_APB2_FZ_DBG_TIM9_STOP ((uint32_t)0x00010000)
  7642. #define DBGMCU_APB2_FZ_DBG_TIM10_STOP ((uint32_t)0x00020000)
  7643. #define DBGMCU_APB2_FZ_DBG_TIM11_STOP ((uint32_t)0x00040000)
  7644. /******************************************************************************/
  7645. /* */
  7646. /* Ethernet MAC Registers bits definitions */
  7647. /* */
  7648. /******************************************************************************/
  7649. /* Bit definition for Ethernet MAC Control Register register */
  7650. #define ETH_MACCR_WD ((uint32_t)0x00800000) /* Watchdog disable */
  7651. #define ETH_MACCR_JD ((uint32_t)0x00400000) /* Jabber disable */
  7652. #define ETH_MACCR_IFG ((uint32_t)0x000E0000) /* Inter-frame gap */
  7653. #define ETH_MACCR_IFG_96Bit ((uint32_t)0x00000000) /* Minimum IFG between frames during transmission is 96Bit */
  7654. #define ETH_MACCR_IFG_88Bit ((uint32_t)0x00020000) /* Minimum IFG between frames during transmission is 88Bit */
  7655. #define ETH_MACCR_IFG_80Bit ((uint32_t)0x00040000) /* Minimum IFG between frames during transmission is 80Bit */
  7656. #define ETH_MACCR_IFG_72Bit ((uint32_t)0x00060000) /* Minimum IFG between frames during transmission is 72Bit */
  7657. #define ETH_MACCR_IFG_64Bit ((uint32_t)0x00080000) /* Minimum IFG between frames during transmission is 64Bit */
  7658. #define ETH_MACCR_IFG_56Bit ((uint32_t)0x000A0000) /* Minimum IFG between frames during transmission is 56Bit */
  7659. #define ETH_MACCR_IFG_48Bit ((uint32_t)0x000C0000) /* Minimum IFG between frames during transmission is 48Bit */
  7660. #define ETH_MACCR_IFG_40Bit ((uint32_t)0x000E0000) /* Minimum IFG between frames during transmission is 40Bit */
  7661. #define ETH_MACCR_CSD ((uint32_t)0x00010000) /* Carrier sense disable (during transmission) */
  7662. #define ETH_MACCR_FES ((uint32_t)0x00004000) /* Fast ethernet speed */
  7663. #define ETH_MACCR_ROD ((uint32_t)0x00002000) /* Receive own disable */
  7664. #define ETH_MACCR_LM ((uint32_t)0x00001000) /* loopback mode */
  7665. #define ETH_MACCR_DM ((uint32_t)0x00000800) /* Duplex mode */
  7666. #define ETH_MACCR_IPCO ((uint32_t)0x00000400) /* IP Checksum offload */
  7667. #define ETH_MACCR_RD ((uint32_t)0x00000200) /* Retry disable */
  7668. #define ETH_MACCR_APCS ((uint32_t)0x00000080) /* Automatic Pad/CRC stripping */
  7669. #define ETH_MACCR_BL ((uint32_t)0x00000060) /* Back-off limit: random integer number (r) of slot time delays before rescheduling
  7670. a transmission attempt during retries after a collision: 0 =< r <2^k */
  7671. #define ETH_MACCR_BL_10 ((uint32_t)0x00000000) /* k = min (n, 10) */
  7672. #define ETH_MACCR_BL_8 ((uint32_t)0x00000020) /* k = min (n, 8) */
  7673. #define ETH_MACCR_BL_4 ((uint32_t)0x00000040) /* k = min (n, 4) */
  7674. #define ETH_MACCR_BL_1 ((uint32_t)0x00000060) /* k = min (n, 1) */
  7675. #define ETH_MACCR_DC ((uint32_t)0x00000010) /* Defferal check */
  7676. #define ETH_MACCR_TE ((uint32_t)0x00000008) /* Transmitter enable */
  7677. #define ETH_MACCR_RE ((uint32_t)0x00000004) /* Receiver enable */
  7678. /* Bit definition for Ethernet MAC Frame Filter Register */
  7679. #define ETH_MACFFR_RA ((uint32_t)0x80000000) /* Receive all */
  7680. #define ETH_MACFFR_HPF ((uint32_t)0x00000400) /* Hash or perfect filter */
  7681. #define ETH_MACFFR_SAF ((uint32_t)0x00000200) /* Source address filter enable */
  7682. #define ETH_MACFFR_SAIF ((uint32_t)0x00000100) /* SA inverse filtering */
  7683. #define ETH_MACFFR_PCF ((uint32_t)0x000000C0) /* Pass control frames: 3 cases */
  7684. #define ETH_MACFFR_PCF_BlockAll ((uint32_t)0x00000040) /* MAC filters all control frames from reaching the application */
  7685. #define ETH_MACFFR_PCF_ForwardAll ((uint32_t)0x00000080) /* MAC forwards all control frames to application even if they fail the Address Filter */
  7686. #define ETH_MACFFR_PCF_ForwardPassedAddrFilter ((uint32_t)0x000000C0) /* MAC forwards control frames that pass the Address Filter. */
  7687. #define ETH_MACFFR_BFD ((uint32_t)0x00000020) /* Broadcast frame disable */
  7688. #define ETH_MACFFR_PAM ((uint32_t)0x00000010) /* Pass all mutlicast */
  7689. #define ETH_MACFFR_DAIF ((uint32_t)0x00000008) /* DA Inverse filtering */
  7690. #define ETH_MACFFR_HM ((uint32_t)0x00000004) /* Hash multicast */
  7691. #define ETH_MACFFR_HU ((uint32_t)0x00000002) /* Hash unicast */
  7692. #define ETH_MACFFR_PM ((uint32_t)0x00000001) /* Promiscuous mode */
  7693. /* Bit definition for Ethernet MAC Hash Table High Register */
  7694. #define ETH_MACHTHR_HTH ((uint32_t)0xFFFFFFFF) /* Hash table high */
  7695. /* Bit definition for Ethernet MAC Hash Table Low Register */
  7696. #define ETH_MACHTLR_HTL ((uint32_t)0xFFFFFFFF) /* Hash table low */
  7697. /* Bit definition for Ethernet MAC MII Address Register */
  7698. #define ETH_MACMIIAR_PA ((uint32_t)0x0000F800) /* Physical layer address */
  7699. #define ETH_MACMIIAR_MR ((uint32_t)0x000007C0) /* MII register in the selected PHY */
  7700. #define ETH_MACMIIAR_CR ((uint32_t)0x0000001C) /* CR clock range: 6 cases */
  7701. #define ETH_MACMIIAR_CR_Div42 ((uint32_t)0x00000000) /* HCLK:60-100 MHz; MDC clock= HCLK/42 */
  7702. #define ETH_MACMIIAR_CR_Div62 ((uint32_t)0x00000004) /* HCLK:100-150 MHz; MDC clock= HCLK/62 */
  7703. #define ETH_MACMIIAR_CR_Div16 ((uint32_t)0x00000008) /* HCLK:20-35 MHz; MDC clock= HCLK/16 */
  7704. #define ETH_MACMIIAR_CR_Div26 ((uint32_t)0x0000000C) /* HCLK:35-60 MHz; MDC clock= HCLK/26 */
  7705. #define ETH_MACMIIAR_CR_Div102 ((uint32_t)0x00000010) /* HCLK:150-168 MHz; MDC clock= HCLK/102 */
  7706. #define ETH_MACMIIAR_MW ((uint32_t)0x00000002) /* MII write */
  7707. #define ETH_MACMIIAR_MB ((uint32_t)0x00000001) /* MII busy */
  7708. /* Bit definition for Ethernet MAC MII Data Register */
  7709. #define ETH_MACMIIDR_MD ((uint32_t)0x0000FFFF) /* MII data: read/write data from/to PHY */
  7710. /* Bit definition for Ethernet MAC Flow Control Register */
  7711. #define ETH_MACFCR_PT ((uint32_t)0xFFFF0000) /* Pause time */
  7712. #define ETH_MACFCR_ZQPD ((uint32_t)0x00000080) /* Zero-quanta pause disable */
  7713. #define ETH_MACFCR_PLT ((uint32_t)0x00000030) /* Pause low threshold: 4 cases */
  7714. #define ETH_MACFCR_PLT_Minus4 ((uint32_t)0x00000000) /* Pause time minus 4 slot times */
  7715. #define ETH_MACFCR_PLT_Minus28 ((uint32_t)0x00000010) /* Pause time minus 28 slot times */
  7716. #define ETH_MACFCR_PLT_Minus144 ((uint32_t)0x00000020) /* Pause time minus 144 slot times */
  7717. #define ETH_MACFCR_PLT_Minus256 ((uint32_t)0x00000030) /* Pause time minus 256 slot times */
  7718. #define ETH_MACFCR_UPFD ((uint32_t)0x00000008) /* Unicast pause frame detect */
  7719. #define ETH_MACFCR_RFCE ((uint32_t)0x00000004) /* Receive flow control enable */
  7720. #define ETH_MACFCR_TFCE ((uint32_t)0x00000002) /* Transmit flow control enable */
  7721. #define ETH_MACFCR_FCBBPA ((uint32_t)0x00000001) /* Flow control busy/backpressure activate */
  7722. /* Bit definition for Ethernet MAC VLAN Tag Register */
  7723. #define ETH_MACVLANTR_VLANTC ((uint32_t)0x00010000) /* 12-bit VLAN tag comparison */
  7724. #define ETH_MACVLANTR_VLANTI ((uint32_t)0x0000FFFF) /* VLAN tag identifier (for receive frames) */
  7725. /* Bit definition for Ethernet MAC Remote Wake-UpFrame Filter Register */
  7726. #define ETH_MACRWUFFR_D ((uint32_t)0xFFFFFFFF) /* Wake-up frame filter register data */
  7727. /* Eight sequential Writes to this address (offset 0x28) will write all Wake-UpFrame Filter Registers.
  7728. Eight sequential Reads from this address (offset 0x28) will read all Wake-UpFrame Filter Registers. */
  7729. /* Wake-UpFrame Filter Reg0 : Filter 0 Byte Mask
  7730. Wake-UpFrame Filter Reg1 : Filter 1 Byte Mask
  7731. Wake-UpFrame Filter Reg2 : Filter 2 Byte Mask
  7732. Wake-UpFrame Filter Reg3 : Filter 3 Byte Mask
  7733. Wake-UpFrame Filter Reg4 : RSVD - Filter3 Command - RSVD - Filter2 Command -
  7734. RSVD - Filter1 Command - RSVD - Filter0 Command
  7735. Wake-UpFrame Filter Re5 : Filter3 Offset - Filter2 Offset - Filter1 Offset - Filter0 Offset
  7736. Wake-UpFrame Filter Re6 : Filter1 CRC16 - Filter0 CRC16
  7737. Wake-UpFrame Filter Re7 : Filter3 CRC16 - Filter2 CRC16 */
  7738. /* Bit definition for Ethernet MAC PMT Control and Status Register */
  7739. #define ETH_MACPMTCSR_WFFRPR ((uint32_t)0x80000000) /* Wake-Up Frame Filter Register Pointer Reset */
  7740. #define ETH_MACPMTCSR_GU ((uint32_t)0x00000200) /* Global Unicast */
  7741. #define ETH_MACPMTCSR_WFR ((uint32_t)0x00000040) /* Wake-Up Frame Received */
  7742. #define ETH_MACPMTCSR_MPR ((uint32_t)0x00000020) /* Magic Packet Received */
  7743. #define ETH_MACPMTCSR_WFE ((uint32_t)0x00000004) /* Wake-Up Frame Enable */
  7744. #define ETH_MACPMTCSR_MPE ((uint32_t)0x00000002) /* Magic Packet Enable */
  7745. #define ETH_MACPMTCSR_PD ((uint32_t)0x00000001) /* Power Down */
  7746. /* Bit definition for Ethernet MAC Status Register */
  7747. #define ETH_MACSR_TSTS ((uint32_t)0x00000200) /* Time stamp trigger status */
  7748. #define ETH_MACSR_MMCTS ((uint32_t)0x00000040) /* MMC transmit status */
  7749. #define ETH_MACSR_MMMCRS ((uint32_t)0x00000020) /* MMC receive status */
  7750. #define ETH_MACSR_MMCS ((uint32_t)0x00000010) /* MMC status */
  7751. #define ETH_MACSR_PMTS ((uint32_t)0x00000008) /* PMT status */
  7752. /* Bit definition for Ethernet MAC Interrupt Mask Register */
  7753. #define ETH_MACIMR_TSTIM ((uint32_t)0x00000200) /* Time stamp trigger interrupt mask */
  7754. #define ETH_MACIMR_PMTIM ((uint32_t)0x00000008) /* PMT interrupt mask */
  7755. /* Bit definition for Ethernet MAC Address0 High Register */
  7756. #define ETH_MACA0HR_MACA0H ((uint32_t)0x0000FFFF) /* MAC address0 high */
  7757. /* Bit definition for Ethernet MAC Address0 Low Register */
  7758. #define ETH_MACA0LR_MACA0L ((uint32_t)0xFFFFFFFF) /* MAC address0 low */
  7759. /* Bit definition for Ethernet MAC Address1 High Register */
  7760. #define ETH_MACA1HR_AE ((uint32_t)0x80000000) /* Address enable */
  7761. #define ETH_MACA1HR_SA ((uint32_t)0x40000000) /* Source address */
  7762. #define ETH_MACA1HR_MBC ((uint32_t)0x3F000000) /* Mask byte control: bits to mask for comparison of the MAC Address bytes */
  7763. #define ETH_MACA1HR_MBC_HBits15_8 ((uint32_t)0x20000000) /* Mask MAC Address high reg bits [15:8] */
  7764. #define ETH_MACA1HR_MBC_HBits7_0 ((uint32_t)0x10000000) /* Mask MAC Address high reg bits [7:0] */
  7765. #define ETH_MACA1HR_MBC_LBits31_24 ((uint32_t)0x08000000) /* Mask MAC Address low reg bits [31:24] */
  7766. #define ETH_MACA1HR_MBC_LBits23_16 ((uint32_t)0x04000000) /* Mask MAC Address low reg bits [23:16] */
  7767. #define ETH_MACA1HR_MBC_LBits15_8 ((uint32_t)0x02000000) /* Mask MAC Address low reg bits [15:8] */
  7768. #define ETH_MACA1HR_MBC_LBits7_0 ((uint32_t)0x01000000) /* Mask MAC Address low reg bits [7:0] */
  7769. #define ETH_MACA1HR_MACA1H ((uint32_t)0x0000FFFF) /* MAC address1 high */
  7770. /* Bit definition for Ethernet MAC Address1 Low Register */
  7771. #define ETH_MACA1LR_MACA1L ((uint32_t)0xFFFFFFFF) /* MAC address1 low */
  7772. /* Bit definition for Ethernet MAC Address2 High Register */
  7773. #define ETH_MACA2HR_AE ((uint32_t)0x80000000) /* Address enable */
  7774. #define ETH_MACA2HR_SA ((uint32_t)0x40000000) /* Source address */
  7775. #define ETH_MACA2HR_MBC ((uint32_t)0x3F000000) /* Mask byte control */
  7776. #define ETH_MACA2HR_MBC_HBits15_8 ((uint32_t)0x20000000) /* Mask MAC Address high reg bits [15:8] */
  7777. #define ETH_MACA2HR_MBC_HBits7_0 ((uint32_t)0x10000000) /* Mask MAC Address high reg bits [7:0] */
  7778. #define ETH_MACA2HR_MBC_LBits31_24 ((uint32_t)0x08000000) /* Mask MAC Address low reg bits [31:24] */
  7779. #define ETH_MACA2HR_MBC_LBits23_16 ((uint32_t)0x04000000) /* Mask MAC Address low reg bits [23:16] */
  7780. #define ETH_MACA2HR_MBC_LBits15_8 ((uint32_t)0x02000000) /* Mask MAC Address low reg bits [15:8] */
  7781. #define ETH_MACA2HR_MBC_LBits7_0 ((uint32_t)0x01000000) /* Mask MAC Address low reg bits [70] */
  7782. #define ETH_MACA2HR_MACA2H ((uint32_t)0x0000FFFF) /* MAC address1 high */
  7783. /* Bit definition for Ethernet MAC Address2 Low Register */
  7784. #define ETH_MACA2LR_MACA2L ((uint32_t)0xFFFFFFFF) /* MAC address2 low */
  7785. /* Bit definition for Ethernet MAC Address3 High Register */
  7786. #define ETH_MACA3HR_AE ((uint32_t)0x80000000) /* Address enable */
  7787. #define ETH_MACA3HR_SA ((uint32_t)0x40000000) /* Source address */
  7788. #define ETH_MACA3HR_MBC ((uint32_t)0x3F000000) /* Mask byte control */
  7789. #define ETH_MACA3HR_MBC_HBits15_8 ((uint32_t)0x20000000) /* Mask MAC Address high reg bits [15:8] */
  7790. #define ETH_MACA3HR_MBC_HBits7_0 ((uint32_t)0x10000000) /* Mask MAC Address high reg bits [7:0] */
  7791. #define ETH_MACA3HR_MBC_LBits31_24 ((uint32_t)0x08000000) /* Mask MAC Address low reg bits [31:24] */
  7792. #define ETH_MACA3HR_MBC_LBits23_16 ((uint32_t)0x04000000) /* Mask MAC Address low reg bits [23:16] */
  7793. #define ETH_MACA3HR_MBC_LBits15_8 ((uint32_t)0x02000000) /* Mask MAC Address low reg bits [15:8] */
  7794. #define ETH_MACA3HR_MBC_LBits7_0 ((uint32_t)0x01000000) /* Mask MAC Address low reg bits [70] */
  7795. #define ETH_MACA3HR_MACA3H ((uint32_t)0x0000FFFF) /* MAC address3 high */
  7796. /* Bit definition for Ethernet MAC Address3 Low Register */
  7797. #define ETH_MACA3LR_MACA3L ((uint32_t)0xFFFFFFFF) /* MAC address3 low */
  7798. /******************************************************************************/
  7799. /* Ethernet MMC Registers bits definition */
  7800. /******************************************************************************/
  7801. /* Bit definition for Ethernet MMC Contol Register */
  7802. #define ETH_MMCCR_MCFHP ((uint32_t)0x00000020) /* MMC counter Full-Half preset */
  7803. #define ETH_MMCCR_MCP ((uint32_t)0x00000010) /* MMC counter preset */
  7804. #define ETH_MMCCR_MCF ((uint32_t)0x00000008) /* MMC Counter Freeze */
  7805. #define ETH_MMCCR_ROR ((uint32_t)0x00000004) /* Reset on Read */
  7806. #define ETH_MMCCR_CSR ((uint32_t)0x00000002) /* Counter Stop Rollover */
  7807. #define ETH_MMCCR_CR ((uint32_t)0x00000001) /* Counters Reset */
  7808. /* Bit definition for Ethernet MMC Receive Interrupt Register */
  7809. #define ETH_MMCRIR_RGUFS ((uint32_t)0x00020000) /* Set when Rx good unicast frames counter reaches half the maximum value */
  7810. #define ETH_MMCRIR_RFAES ((uint32_t)0x00000040) /* Set when Rx alignment error counter reaches half the maximum value */
  7811. #define ETH_MMCRIR_RFCES ((uint32_t)0x00000020) /* Set when Rx crc error counter reaches half the maximum value */
  7812. /* Bit definition for Ethernet MMC Transmit Interrupt Register */
  7813. #define ETH_MMCTIR_TGFS ((uint32_t)0x00200000) /* Set when Tx good frame count counter reaches half the maximum value */
  7814. #define ETH_MMCTIR_TGFMSCS ((uint32_t)0x00008000) /* Set when Tx good multi col counter reaches half the maximum value */
  7815. #define ETH_MMCTIR_TGFSCS ((uint32_t)0x00004000) /* Set when Tx good single col counter reaches half the maximum value */
  7816. /* Bit definition for Ethernet MMC Receive Interrupt Mask Register */
  7817. #define ETH_MMCRIMR_RGUFM ((uint32_t)0x00020000) /* Mask the interrupt when Rx good unicast frames counter reaches half the maximum value */
  7818. #define ETH_MMCRIMR_RFAEM ((uint32_t)0x00000040) /* Mask the interrupt when when Rx alignment error counter reaches half the maximum value */
  7819. #define ETH_MMCRIMR_RFCEM ((uint32_t)0x00000020) /* Mask the interrupt when Rx crc error counter reaches half the maximum value */
  7820. /* Bit definition for Ethernet MMC Transmit Interrupt Mask Register */
  7821. #define ETH_MMCTIMR_TGFM ((uint32_t)0x00200000) /* Mask the interrupt when Tx good frame count counter reaches half the maximum value */
  7822. #define ETH_MMCTIMR_TGFMSCM ((uint32_t)0x00008000) /* Mask the interrupt when Tx good multi col counter reaches half the maximum value */
  7823. #define ETH_MMCTIMR_TGFSCM ((uint32_t)0x00004000) /* Mask the interrupt when Tx good single col counter reaches half the maximum value */
  7824. /* Bit definition for Ethernet MMC Transmitted Good Frames after Single Collision Counter Register */
  7825. #define ETH_MMCTGFSCCR_TGFSCC ((uint32_t)0xFFFFFFFF) /* Number of successfully transmitted frames after a single collision in Half-duplex mode. */
  7826. /* Bit definition for Ethernet MMC Transmitted Good Frames after More than a Single Collision Counter Register */
  7827. #define ETH_MMCTGFMSCCR_TGFMSCC ((uint32_t)0xFFFFFFFF) /* Number of successfully transmitted frames after more than a single collision in Half-duplex mode. */
  7828. /* Bit definition for Ethernet MMC Transmitted Good Frames Counter Register */
  7829. #define ETH_MMCTGFCR_TGFC ((uint32_t)0xFFFFFFFF) /* Number of good frames transmitted. */
  7830. /* Bit definition for Ethernet MMC Received Frames with CRC Error Counter Register */
  7831. #define ETH_MMCRFCECR_RFCEC ((uint32_t)0xFFFFFFFF) /* Number of frames received with CRC error. */
  7832. /* Bit definition for Ethernet MMC Received Frames with Alignement Error Counter Register */
  7833. #define ETH_MMCRFAECR_RFAEC ((uint32_t)0xFFFFFFFF) /* Number of frames received with alignment (dribble) error */
  7834. /* Bit definition for Ethernet MMC Received Good Unicast Frames Counter Register */
  7835. #define ETH_MMCRGUFCR_RGUFC ((uint32_t)0xFFFFFFFF) /* Number of good unicast frames received. */
  7836. /******************************************************************************/
  7837. /* Ethernet PTP Registers bits definition */
  7838. /******************************************************************************/
  7839. /* Bit definition for Ethernet PTP Time Stamp Contol Register */
  7840. #define ETH_PTPTSCR_TSCNT ((uint32_t)0x00030000) /* Time stamp clock node type */
  7841. #define ETH_PTPTSSR_TSSMRME ((uint32_t)0x00008000) /* Time stamp snapshot for message relevant to master enable */
  7842. #define ETH_PTPTSSR_TSSEME ((uint32_t)0x00004000) /* Time stamp snapshot for event message enable */
  7843. #define ETH_PTPTSSR_TSSIPV4FE ((uint32_t)0x00002000) /* Time stamp snapshot for IPv4 frames enable */
  7844. #define ETH_PTPTSSR_TSSIPV6FE ((uint32_t)0x00001000) /* Time stamp snapshot for IPv6 frames enable */
  7845. #define ETH_PTPTSSR_TSSPTPOEFE ((uint32_t)0x00000800) /* Time stamp snapshot for PTP over ethernet frames enable */
  7846. #define ETH_PTPTSSR_TSPTPPSV2E ((uint32_t)0x00000400) /* Time stamp PTP packet snooping for version2 format enable */
  7847. #define ETH_PTPTSSR_TSSSR ((uint32_t)0x00000200) /* Time stamp Sub-seconds rollover */
  7848. #define ETH_PTPTSSR_TSSARFE ((uint32_t)0x00000100) /* Time stamp snapshot for all received frames enable */
  7849. #define ETH_PTPTSCR_TSARU ((uint32_t)0x00000020) /* Addend register update */
  7850. #define ETH_PTPTSCR_TSITE ((uint32_t)0x00000010) /* Time stamp interrupt trigger enable */
  7851. #define ETH_PTPTSCR_TSSTU ((uint32_t)0x00000008) /* Time stamp update */
  7852. #define ETH_PTPTSCR_TSSTI ((uint32_t)0x00000004) /* Time stamp initialize */
  7853. #define ETH_PTPTSCR_TSFCU ((uint32_t)0x00000002) /* Time stamp fine or coarse update */
  7854. #define ETH_PTPTSCR_TSE ((uint32_t)0x00000001) /* Time stamp enable */
  7855. /* Bit definition for Ethernet PTP Sub-Second Increment Register */
  7856. #define ETH_PTPSSIR_STSSI ((uint32_t)0x000000FF) /* System time Sub-second increment value */
  7857. /* Bit definition for Ethernet PTP Time Stamp High Register */
  7858. #define ETH_PTPTSHR_STS ((uint32_t)0xFFFFFFFF) /* System Time second */
  7859. /* Bit definition for Ethernet PTP Time Stamp Low Register */
  7860. #define ETH_PTPTSLR_STPNS ((uint32_t)0x80000000) /* System Time Positive or negative time */
  7861. #define ETH_PTPTSLR_STSS ((uint32_t)0x7FFFFFFF) /* System Time sub-seconds */
  7862. /* Bit definition for Ethernet PTP Time Stamp High Update Register */
  7863. #define ETH_PTPTSHUR_TSUS ((uint32_t)0xFFFFFFFF) /* Time stamp update seconds */
  7864. /* Bit definition for Ethernet PTP Time Stamp Low Update Register */
  7865. #define ETH_PTPTSLUR_TSUPNS ((uint32_t)0x80000000) /* Time stamp update Positive or negative time */
  7866. #define ETH_PTPTSLUR_TSUSS ((uint32_t)0x7FFFFFFF) /* Time stamp update sub-seconds */
  7867. /* Bit definition for Ethernet PTP Time Stamp Addend Register */
  7868. #define ETH_PTPTSAR_TSA ((uint32_t)0xFFFFFFFF) /* Time stamp addend */
  7869. /* Bit definition for Ethernet PTP Target Time High Register */
  7870. #define ETH_PTPTTHR_TTSH ((uint32_t)0xFFFFFFFF) /* Target time stamp high */
  7871. /* Bit definition for Ethernet PTP Target Time Low Register */
  7872. #define ETH_PTPTTLR_TTSL ((uint32_t)0xFFFFFFFF) /* Target time stamp low */
  7873. /* Bit definition for Ethernet PTP Time Stamp Status Register */
  7874. #define ETH_PTPTSSR_TSTTR ((uint32_t)0x00000020) /* Time stamp target time reached */
  7875. #define ETH_PTPTSSR_TSSO ((uint32_t)0x00000010) /* Time stamp seconds overflow */
  7876. /******************************************************************************/
  7877. /* Ethernet DMA Registers bits definition */
  7878. /******************************************************************************/
  7879. /* Bit definition for Ethernet DMA Bus Mode Register */
  7880. #define ETH_DMABMR_AAB ((uint32_t)0x02000000) /* Address-Aligned beats */
  7881. #define ETH_DMABMR_FPM ((uint32_t)0x01000000) /* 4xPBL mode */
  7882. #define ETH_DMABMR_USP ((uint32_t)0x00800000) /* Use separate PBL */
  7883. #define ETH_DMABMR_RDP ((uint32_t)0x007E0000) /* RxDMA PBL */
  7884. #define ETH_DMABMR_RDP_1Beat ((uint32_t)0x00020000) /* maximum number of beats to be transferred in one RxDMA transaction is 1 */
  7885. #define ETH_DMABMR_RDP_2Beat ((uint32_t)0x00040000) /* maximum number of beats to be transferred in one RxDMA transaction is 2 */
  7886. #define ETH_DMABMR_RDP_4Beat ((uint32_t)0x00080000) /* maximum number of beats to be transferred in one RxDMA transaction is 4 */
  7887. #define ETH_DMABMR_RDP_8Beat ((uint32_t)0x00100000) /* maximum number of beats to be transferred in one RxDMA transaction is 8 */
  7888. #define ETH_DMABMR_RDP_16Beat ((uint32_t)0x00200000) /* maximum number of beats to be transferred in one RxDMA transaction is 16 */
  7889. #define ETH_DMABMR_RDP_32Beat ((uint32_t)0x00400000) /* maximum number of beats to be transferred in one RxDMA transaction is 32 */
  7890. #define ETH_DMABMR_RDP_4xPBL_4Beat ((uint32_t)0x01020000) /* maximum number of beats to be transferred in one RxDMA transaction is 4 */
  7891. #define ETH_DMABMR_RDP_4xPBL_8Beat ((uint32_t)0x01040000) /* maximum number of beats to be transferred in one RxDMA transaction is 8 */
  7892. #define ETH_DMABMR_RDP_4xPBL_16Beat ((uint32_t)0x01080000) /* maximum number of beats to be transferred in one RxDMA transaction is 16 */
  7893. #define ETH_DMABMR_RDP_4xPBL_32Beat ((uint32_t)0x01100000) /* maximum number of beats to be transferred in one RxDMA transaction is 32 */
  7894. #define ETH_DMABMR_RDP_4xPBL_64Beat ((uint32_t)0x01200000) /* maximum number of beats to be transferred in one RxDMA transaction is 64 */
  7895. #define ETH_DMABMR_RDP_4xPBL_128Beat ((uint32_t)0x01400000) /* maximum number of beats to be transferred in one RxDMA transaction is 128 */
  7896. #define ETH_DMABMR_FB ((uint32_t)0x00010000) /* Fixed Burst */
  7897. #define ETH_DMABMR_RTPR ((uint32_t)0x0000C000) /* Rx Tx priority ratio */
  7898. #define ETH_DMABMR_RTPR_1_1 ((uint32_t)0x00000000) /* Rx Tx priority ratio */
  7899. #define ETH_DMABMR_RTPR_2_1 ((uint32_t)0x00004000) /* Rx Tx priority ratio */
  7900. #define ETH_DMABMR_RTPR_3_1 ((uint32_t)0x00008000) /* Rx Tx priority ratio */
  7901. #define ETH_DMABMR_RTPR_4_1 ((uint32_t)0x0000C000) /* Rx Tx priority ratio */
  7902. #define ETH_DMABMR_PBL ((uint32_t)0x00003F00) /* Programmable burst length */
  7903. #define ETH_DMABMR_PBL_1Beat ((uint32_t)0x00000100) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 1 */
  7904. #define ETH_DMABMR_PBL_2Beat ((uint32_t)0x00000200) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 2 */
  7905. #define ETH_DMABMR_PBL_4Beat ((uint32_t)0x00000400) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 4 */
  7906. #define ETH_DMABMR_PBL_8Beat ((uint32_t)0x00000800) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 8 */
  7907. #define ETH_DMABMR_PBL_16Beat ((uint32_t)0x00001000) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 16 */
  7908. #define ETH_DMABMR_PBL_32Beat ((uint32_t)0x00002000) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 32 */
  7909. #define ETH_DMABMR_PBL_4xPBL_4Beat ((uint32_t)0x01000100) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 4 */
  7910. #define ETH_DMABMR_PBL_4xPBL_8Beat ((uint32_t)0x01000200) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 8 */
  7911. #define ETH_DMABMR_PBL_4xPBL_16Beat ((uint32_t)0x01000400) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 16 */
  7912. #define ETH_DMABMR_PBL_4xPBL_32Beat ((uint32_t)0x01000800) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 32 */
  7913. #define ETH_DMABMR_PBL_4xPBL_64Beat ((uint32_t)0x01001000) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 64 */
  7914. #define ETH_DMABMR_PBL_4xPBL_128Beat ((uint32_t)0x01002000) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 128 */
  7915. #define ETH_DMABMR_EDE ((uint32_t)0x00000080) /* Enhanced Descriptor Enable */
  7916. #define ETH_DMABMR_DSL ((uint32_t)0x0000007C) /* Descriptor Skip Length */
  7917. #define ETH_DMABMR_DA ((uint32_t)0x00000002) /* DMA arbitration scheme */
  7918. #define ETH_DMABMR_SR ((uint32_t)0x00000001) /* Software reset */
  7919. /* Bit definition for Ethernet DMA Transmit Poll Demand Register */
  7920. #define ETH_DMATPDR_TPD ((uint32_t)0xFFFFFFFF) /* Transmit poll demand */
  7921. /* Bit definition for Ethernet DMA Receive Poll Demand Register */
  7922. #define ETH_DMARPDR_RPD ((uint32_t)0xFFFFFFFF) /* Receive poll demand */
  7923. /* Bit definition for Ethernet DMA Receive Descriptor List Address Register */
  7924. #define ETH_DMARDLAR_SRL ((uint32_t)0xFFFFFFFF) /* Start of receive list */
  7925. /* Bit definition for Ethernet DMA Transmit Descriptor List Address Register */
  7926. #define ETH_DMATDLAR_STL ((uint32_t)0xFFFFFFFF) /* Start of transmit list */
  7927. /* Bit definition for Ethernet DMA Status Register */
  7928. #define ETH_DMASR_TSTS ((uint32_t)0x20000000) /* Time-stamp trigger status */
  7929. #define ETH_DMASR_PMTS ((uint32_t)0x10000000) /* PMT status */
  7930. #define ETH_DMASR_MMCS ((uint32_t)0x08000000) /* MMC status */
  7931. #define ETH_DMASR_EBS ((uint32_t)0x03800000) /* Error bits status */
  7932. /* combination with EBS[2:0] for GetFlagStatus function */
  7933. #define ETH_DMASR_EBS_DescAccess ((uint32_t)0x02000000) /* Error bits 0-data buffer, 1-desc. access */
  7934. #define ETH_DMASR_EBS_ReadTransf ((uint32_t)0x01000000) /* Error bits 0-write trnsf, 1-read transfr */
  7935. #define ETH_DMASR_EBS_DataTransfTx ((uint32_t)0x00800000) /* Error bits 0-Rx DMA, 1-Tx DMA */
  7936. #define ETH_DMASR_TPS ((uint32_t)0x00700000) /* Transmit process state */
  7937. #define ETH_DMASR_TPS_Stopped ((uint32_t)0x00000000) /* Stopped - Reset or Stop Tx Command issued */
  7938. #define ETH_DMASR_TPS_Fetching ((uint32_t)0x00100000) /* Running - fetching the Tx descriptor */
  7939. #define ETH_DMASR_TPS_Waiting ((uint32_t)0x00200000) /* Running - waiting for status */
  7940. #define ETH_DMASR_TPS_Reading ((uint32_t)0x00300000) /* Running - reading the data from host memory */
  7941. #define ETH_DMASR_TPS_Suspended ((uint32_t)0x00600000) /* Suspended - Tx Descriptor unavailabe */
  7942. #define ETH_DMASR_TPS_Closing ((uint32_t)0x00700000) /* Running - closing Rx descriptor */
  7943. #define ETH_DMASR_RPS ((uint32_t)0x000E0000) /* Receive process state */
  7944. #define ETH_DMASR_RPS_Stopped ((uint32_t)0x00000000) /* Stopped - Reset or Stop Rx Command issued */
  7945. #define ETH_DMASR_RPS_Fetching ((uint32_t)0x00020000) /* Running - fetching the Rx descriptor */
  7946. #define ETH_DMASR_RPS_Waiting ((uint32_t)0x00060000) /* Running - waiting for packet */
  7947. #define ETH_DMASR_RPS_Suspended ((uint32_t)0x00080000) /* Suspended - Rx Descriptor unavailable */
  7948. #define ETH_DMASR_RPS_Closing ((uint32_t)0x000A0000) /* Running - closing descriptor */
  7949. #define ETH_DMASR_RPS_Queuing ((uint32_t)0x000E0000) /* Running - queuing the recieve frame into host memory */
  7950. #define ETH_DMASR_NIS ((uint32_t)0x00010000) /* Normal interrupt summary */
  7951. #define ETH_DMASR_AIS ((uint32_t)0x00008000) /* Abnormal interrupt summary */
  7952. #define ETH_DMASR_ERS ((uint32_t)0x00004000) /* Early receive status */
  7953. #define ETH_DMASR_FBES ((uint32_t)0x00002000) /* Fatal bus error status */
  7954. #define ETH_DMASR_ETS ((uint32_t)0x00000400) /* Early transmit status */
  7955. #define ETH_DMASR_RWTS ((uint32_t)0x00000200) /* Receive watchdog timeout status */
  7956. #define ETH_DMASR_RPSS ((uint32_t)0x00000100) /* Receive process stopped status */
  7957. #define ETH_DMASR_RBUS ((uint32_t)0x00000080) /* Receive buffer unavailable status */
  7958. #define ETH_DMASR_RS ((uint32_t)0x00000040) /* Receive status */
  7959. #define ETH_DMASR_TUS ((uint32_t)0x00000020) /* Transmit underflow status */
  7960. #define ETH_DMASR_ROS ((uint32_t)0x00000010) /* Receive overflow status */
  7961. #define ETH_DMASR_TJTS ((uint32_t)0x00000008) /* Transmit jabber timeout status */
  7962. #define ETH_DMASR_TBUS ((uint32_t)0x00000004) /* Transmit buffer unavailable status */
  7963. #define ETH_DMASR_TPSS ((uint32_t)0x00000002) /* Transmit process stopped status */
  7964. #define ETH_DMASR_TS ((uint32_t)0x00000001) /* Transmit status */
  7965. /* Bit definition for Ethernet DMA Operation Mode Register */
  7966. #define ETH_DMAOMR_DTCEFD ((uint32_t)0x04000000) /* Disable Dropping of TCP/IP checksum error frames */
  7967. #define ETH_DMAOMR_RSF ((uint32_t)0x02000000) /* Receive store and forward */
  7968. #define ETH_DMAOMR_DFRF ((uint32_t)0x01000000) /* Disable flushing of received frames */
  7969. #define ETH_DMAOMR_TSF ((uint32_t)0x00200000) /* Transmit store and forward */
  7970. #define ETH_DMAOMR_FTF ((uint32_t)0x00100000) /* Flush transmit FIFO */
  7971. #define ETH_DMAOMR_TTC ((uint32_t)0x0001C000) /* Transmit threshold control */
  7972. #define ETH_DMAOMR_TTC_64Bytes ((uint32_t)0x00000000) /* threshold level of the MTL Transmit FIFO is 64 Bytes */
  7973. #define ETH_DMAOMR_TTC_128Bytes ((uint32_t)0x00004000) /* threshold level of the MTL Transmit FIFO is 128 Bytes */
  7974. #define ETH_DMAOMR_TTC_192Bytes ((uint32_t)0x00008000) /* threshold level of the MTL Transmit FIFO is 192 Bytes */
  7975. #define ETH_DMAOMR_TTC_256Bytes ((uint32_t)0x0000C000) /* threshold level of the MTL Transmit FIFO is 256 Bytes */
  7976. #define ETH_DMAOMR_TTC_40Bytes ((uint32_t)0x00010000) /* threshold level of the MTL Transmit FIFO is 40 Bytes */
  7977. #define ETH_DMAOMR_TTC_32Bytes ((uint32_t)0x00014000) /* threshold level of the MTL Transmit FIFO is 32 Bytes */
  7978. #define ETH_DMAOMR_TTC_24Bytes ((uint32_t)0x00018000) /* threshold level of the MTL Transmit FIFO is 24 Bytes */
  7979. #define ETH_DMAOMR_TTC_16Bytes ((uint32_t)0x0001C000) /* threshold level of the MTL Transmit FIFO is 16 Bytes */
  7980. #define ETH_DMAOMR_ST ((uint32_t)0x00002000) /* Start/stop transmission command */
  7981. #define ETH_DMAOMR_FEF ((uint32_t)0x00000080) /* Forward error frames */
  7982. #define ETH_DMAOMR_FUGF ((uint32_t)0x00000040) /* Forward undersized good frames */
  7983. #define ETH_DMAOMR_RTC ((uint32_t)0x00000018) /* receive threshold control */
  7984. #define ETH_DMAOMR_RTC_64Bytes ((uint32_t)0x00000000) /* threshold level of the MTL Receive FIFO is 64 Bytes */
  7985. #define ETH_DMAOMR_RTC_32Bytes ((uint32_t)0x00000008) /* threshold level of the MTL Receive FIFO is 32 Bytes */
  7986. #define ETH_DMAOMR_RTC_96Bytes ((uint32_t)0x00000010) /* threshold level of the MTL Receive FIFO is 96 Bytes */
  7987. #define ETH_DMAOMR_RTC_128Bytes ((uint32_t)0x00000018) /* threshold level of the MTL Receive FIFO is 128 Bytes */
  7988. #define ETH_DMAOMR_OSF ((uint32_t)0x00000004) /* operate on second frame */
  7989. #define ETH_DMAOMR_SR ((uint32_t)0x00000002) /* Start/stop receive */
  7990. /* Bit definition for Ethernet DMA Interrupt Enable Register */
  7991. #define ETH_DMAIER_NISE ((uint32_t)0x00010000) /* Normal interrupt summary enable */
  7992. #define ETH_DMAIER_AISE ((uint32_t)0x00008000) /* Abnormal interrupt summary enable */
  7993. #define ETH_DMAIER_ERIE ((uint32_t)0x00004000) /* Early receive interrupt enable */
  7994. #define ETH_DMAIER_FBEIE ((uint32_t)0x00002000) /* Fatal bus error interrupt enable */
  7995. #define ETH_DMAIER_ETIE ((uint32_t)0x00000400) /* Early transmit interrupt enable */
  7996. #define ETH_DMAIER_RWTIE ((uint32_t)0x00000200) /* Receive watchdog timeout interrupt enable */
  7997. #define ETH_DMAIER_RPSIE ((uint32_t)0x00000100) /* Receive process stopped interrupt enable */
  7998. #define ETH_DMAIER_RBUIE ((uint32_t)0x00000080) /* Receive buffer unavailable interrupt enable */
  7999. #define ETH_DMAIER_RIE ((uint32_t)0x00000040) /* Receive interrupt enable */
  8000. #define ETH_DMAIER_TUIE ((uint32_t)0x00000020) /* Transmit Underflow interrupt enable */
  8001. #define ETH_DMAIER_ROIE ((uint32_t)0x00000010) /* Receive Overflow interrupt enable */
  8002. #define ETH_DMAIER_TJTIE ((uint32_t)0x00000008) /* Transmit jabber timeout interrupt enable */
  8003. #define ETH_DMAIER_TBUIE ((uint32_t)0x00000004) /* Transmit buffer unavailable interrupt enable */
  8004. #define ETH_DMAIER_TPSIE ((uint32_t)0x00000002) /* Transmit process stopped interrupt enable */
  8005. #define ETH_DMAIER_TIE ((uint32_t)0x00000001) /* Transmit interrupt enable */
  8006. /* Bit definition for Ethernet DMA Missed Frame and Buffer Overflow Counter Register */
  8007. #define ETH_DMAMFBOCR_OFOC ((uint32_t)0x10000000) /* Overflow bit for FIFO overflow counter */
  8008. #define ETH_DMAMFBOCR_MFA ((uint32_t)0x0FFE0000) /* Number of frames missed by the application */
  8009. #define ETH_DMAMFBOCR_OMFC ((uint32_t)0x00010000) /* Overflow bit for missed frame counter */
  8010. #define ETH_DMAMFBOCR_MFC ((uint32_t)0x0000FFFF) /* Number of frames missed by the controller */
  8011. /* Bit definition for Ethernet DMA Current Host Transmit Descriptor Register */
  8012. #define ETH_DMACHTDR_HTDAP ((uint32_t)0xFFFFFFFF) /* Host transmit descriptor address pointer */
  8013. /* Bit definition for Ethernet DMA Current Host Receive Descriptor Register */
  8014. #define ETH_DMACHRDR_HRDAP ((uint32_t)0xFFFFFFFF) /* Host receive descriptor address pointer */
  8015. /* Bit definition for Ethernet DMA Current Host Transmit Buffer Address Register */
  8016. #define ETH_DMACHTBAR_HTBAP ((uint32_t)0xFFFFFFFF) /* Host transmit buffer address pointer */
  8017. /* Bit definition for Ethernet DMA Current Host Receive Buffer Address Register */
  8018. #define ETH_DMACHRBAR_HRBAP ((uint32_t)0xFFFFFFFF) /* Host receive buffer address pointer */
  8019. /******************************************************************************/
  8020. /* */
  8021. /* USB_OTG */
  8022. /* */
  8023. /******************************************************************************/
  8024. /******************** Bit definition forUSB_OTG_GOTGCTL register ********************/
  8025. #define USB_OTG_GOTGCTL_SRQSCS ((uint32_t)0x00000001) /*!< Session request success */
  8026. #define USB_OTG_GOTGCTL_SRQ ((uint32_t)0x00000002) /*!< Session request */
  8027. #define USB_OTG_GOTGCTL_VBVALOEN ((uint32_t)0x00000004) /*!< VBUS valid override enable */
  8028. #define USB_OTG_GOTGCTL_VBVALOVAL ((uint32_t)0x00000008) /*!< VBUS valid override value */
  8029. #define USB_OTG_GOTGCTL_AVALOEN ((uint32_t)0x00000010) /*!< A-peripheral session valid override enable */
  8030. #define USB_OTG_GOTGCTL_AVALOVAL ((uint32_t)0x00000020) /*!< A-peripheral session valid override value */
  8031. #define USB_OTG_GOTGCTL_BVALOEN ((uint32_t)0x00000040) /*!< B-peripheral session valid override enable */
  8032. #define USB_OTG_GOTGCTL_BVALOVAL ((uint32_t)0x00000080) /*!< B-peripheral session valid override value */
  8033. #define USB_OTG_GOTGCTL_HNGSCS ((uint32_t)0x00000100) /*!< Host set HNP enable */
  8034. #define USB_OTG_GOTGCTL_HNPRQ ((uint32_t)0x00000200) /*!< HNP request */
  8035. #define USB_OTG_GOTGCTL_HSHNPEN ((uint32_t)0x00000400) /*!< Host set HNP enable */
  8036. #define USB_OTG_GOTGCTL_DHNPEN ((uint32_t)0x00000800) /*!< Device HNP enabled */
  8037. #define USB_OTG_GOTGCTL_EHEN ((uint32_t)0x00001000) /*!< Embedded host enable */
  8038. #define USB_OTG_GOTGCTL_CIDSTS ((uint32_t)0x00010000) /*!< Connector ID status */
  8039. #define USB_OTG_GOTGCTL_DBCT ((uint32_t)0x00020000) /*!< Long/short debounce time */
  8040. #define USB_OTG_GOTGCTL_ASVLD ((uint32_t)0x00040000) /*!< A-session valid */
  8041. #define USB_OTG_GOTGCTL_BSESVLD ((uint32_t)0x00080000) /*!< B-session valid */
  8042. #define USB_OTG_GOTGCTL_OTGVER ((uint32_t)0x00100000) /*!< OTG version */
  8043. /******************** Bit definition forUSB_OTG_HCFG register ********************/
  8044. #define USB_OTG_HCFG_FSLSPCS ((uint32_t)0x00000003) /*!< FS/LS PHY clock select */
  8045. #define USB_OTG_HCFG_FSLSPCS_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  8046. #define USB_OTG_HCFG_FSLSPCS_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  8047. #define USB_OTG_HCFG_FSLSS ((uint32_t)0x00000004) /*!< FS- and LS-only support */
  8048. /******************** Bit definition forUSB_OTG_DCFG register ********************/
  8049. #define USB_OTG_DCFG_DSPD ((uint32_t)0x00000003) /*!< Device speed */
  8050. #define USB_OTG_DCFG_DSPD_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  8051. #define USB_OTG_DCFG_DSPD_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  8052. #define USB_OTG_DCFG_NZLSOHSK ((uint32_t)0x00000004) /*!< Nonzero-length status OUT handshake */
  8053. #define USB_OTG_DCFG_DAD ((uint32_t)0x000007F0) /*!< Device address */
  8054. #define USB_OTG_DCFG_DAD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  8055. #define USB_OTG_DCFG_DAD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  8056. #define USB_OTG_DCFG_DAD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  8057. #define USB_OTG_DCFG_DAD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  8058. #define USB_OTG_DCFG_DAD_4 ((uint32_t)0x00000100) /*!<Bit 4 */
  8059. #define USB_OTG_DCFG_DAD_5 ((uint32_t)0x00000200) /*!<Bit 5 */
  8060. #define USB_OTG_DCFG_DAD_6 ((uint32_t)0x00000400) /*!<Bit 6 */
  8061. #define USB_OTG_DCFG_PFIVL ((uint32_t)0x00001800) /*!< Periodic (micro)frame interval */
  8062. #define USB_OTG_DCFG_PFIVL_0 ((uint32_t)0x00000800) /*!<Bit 0 */
  8063. #define USB_OTG_DCFG_PFIVL_1 ((uint32_t)0x00001000) /*!<Bit 1 */
  8064. #define USB_OTG_DCFG_PERSCHIVL ((uint32_t)0x03000000) /*!< Periodic scheduling interval */
  8065. #define USB_OTG_DCFG_PERSCHIVL_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  8066. #define USB_OTG_DCFG_PERSCHIVL_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  8067. /******************** Bit definition forUSB_OTG_PCGCR register ********************/
  8068. #define USB_OTG_PCGCR_STPPCLK ((uint32_t)0x00000001) /*!< Stop PHY clock */
  8069. #define USB_OTG_PCGCR_GATEHCLK ((uint32_t)0x00000002) /*!< Gate HCLK */
  8070. #define USB_OTG_PCGCR_PHYSUSP ((uint32_t)0x00000010) /*!< PHY suspended */
  8071. /******************** Bit definition forUSB_OTG_GOTGINT register ********************/
  8072. #define USB_OTG_GOTGINT_SEDET ((uint32_t)0x00000004) /*!< Session end detected */
  8073. #define USB_OTG_GOTGINT_SRSSCHG ((uint32_t)0x00000100) /*!< Session request success status change */
  8074. #define USB_OTG_GOTGINT_HNSSCHG ((uint32_t)0x00000200) /*!< Host negotiation success status change */
  8075. #define USB_OTG_GOTGINT_HNGDET ((uint32_t)0x00020000) /*!< Host negotiation detected */
  8076. #define USB_OTG_GOTGINT_ADTOCHG ((uint32_t)0x00040000) /*!< A-device timeout change */
  8077. #define USB_OTG_GOTGINT_DBCDNE ((uint32_t)0x00080000) /*!< Debounce done */
  8078. #define USB_OTG_GOTGINT_IDCHNG ((uint32_t)0x00100000) /*!< Change in ID pin input value */
  8079. /******************** Bit definition forUSB_OTG_DCTL register ********************/
  8080. #define USB_OTG_DCTL_RWUSIG ((uint32_t)0x00000001) /*!< Remote wakeup signaling */
  8081. #define USB_OTG_DCTL_SDIS ((uint32_t)0x00000002) /*!< Soft disconnect */
  8082. #define USB_OTG_DCTL_GINSTS ((uint32_t)0x00000004) /*!< Global IN NAK status */
  8083. #define USB_OTG_DCTL_GONSTS ((uint32_t)0x00000008) /*!< Global OUT NAK status */
  8084. #define USB_OTG_DCTL_TCTL ((uint32_t)0x00000070) /*!< Test control */
  8085. #define USB_OTG_DCTL_TCTL_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  8086. #define USB_OTG_DCTL_TCTL_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  8087. #define USB_OTG_DCTL_TCTL_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  8088. #define USB_OTG_DCTL_SGINAK ((uint32_t)0x00000080) /*!< Set global IN NAK */
  8089. #define USB_OTG_DCTL_CGINAK ((uint32_t)0x00000100) /*!< Clear global IN NAK */
  8090. #define USB_OTG_DCTL_SGONAK ((uint32_t)0x00000200) /*!< Set global OUT NAK */
  8091. #define USB_OTG_DCTL_CGONAK ((uint32_t)0x00000400) /*!< Clear global OUT NAK */
  8092. #define USB_OTG_DCTL_POPRGDNE ((uint32_t)0x00000800) /*!< Power-on programming done */
  8093. /******************** Bit definition forUSB_OTG_HFIR register ********************/
  8094. #define USB_OTG_HFIR_FRIVL ((uint32_t)0x0000FFFF) /*!< Frame interval */
  8095. /******************** Bit definition forUSB_OTG_HFNUM register ********************/
  8096. #define USB_OTG_HFNUM_FRNUM ((uint32_t)0x0000FFFF) /*!< Frame number */
  8097. #define USB_OTG_HFNUM_FTREM ((uint32_t)0xFFFF0000) /*!< Frame time remaining */
  8098. /******************** Bit definition forUSB_OTG_DSTS register ********************/
  8099. #define USB_OTG_DSTS_SUSPSTS ((uint32_t)0x00000001) /*!< Suspend status */
  8100. #define USB_OTG_DSTS_ENUMSPD ((uint32_t)0x00000006) /*!< Enumerated speed */
  8101. #define USB_OTG_DSTS_ENUMSPD_0 ((uint32_t)0x00000002) /*!<Bit 0 */
  8102. #define USB_OTG_DSTS_ENUMSPD_1 ((uint32_t)0x00000004) /*!<Bit 1 */
  8103. #define USB_OTG_DSTS_EERR ((uint32_t)0x00000008) /*!< Erratic error */
  8104. #define USB_OTG_DSTS_FNSOF ((uint32_t)0x003FFF00) /*!< Frame number of the received SOF */
  8105. /******************** Bit definition forUSB_OTG_GAHBCFG register ********************/
  8106. #define USB_OTG_GAHBCFG_GINT ((uint32_t)0x00000001) /*!< Global interrupt mask */
  8107. #define USB_OTG_GAHBCFG_HBSTLEN ((uint32_t)0x0000001E) /*!< Burst length/type */
  8108. #define USB_OTG_GAHBCFG_HBSTLEN_0 ((uint32_t)0x00000002) /*!<Bit 0 */
  8109. #define USB_OTG_GAHBCFG_HBSTLEN_1 ((uint32_t)0x00000004) /*!<Bit 1 */
  8110. #define USB_OTG_GAHBCFG_HBSTLEN_2 ((uint32_t)0x00000008) /*!<Bit 2 */
  8111. #define USB_OTG_GAHBCFG_HBSTLEN_3 ((uint32_t)0x00000010) /*!<Bit 3 */
  8112. #define USB_OTG_GAHBCFG_DMAEN ((uint32_t)0x00000020) /*!< DMA enable */
  8113. #define USB_OTG_GAHBCFG_TXFELVL ((uint32_t)0x00000080) /*!< TxFIFO empty level */
  8114. #define USB_OTG_GAHBCFG_PTXFELVL ((uint32_t)0x00000100) /*!< Periodic TxFIFO empty level */
  8115. /******************** Bit definition forUSB_OTG_GUSBCFG register ********************/
  8116. #define USB_OTG_GUSBCFG_TOCAL ((uint32_t)0x00000007) /*!< FS timeout calibration */
  8117. #define USB_OTG_GUSBCFG_TOCAL_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  8118. #define USB_OTG_GUSBCFG_TOCAL_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  8119. #define USB_OTG_GUSBCFG_TOCAL_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  8120. #define USB_OTG_GUSBCFG_PHYSEL ((uint32_t)0x00000040) /*!< USB 2.0 high-speed ULPI PHY or USB 1.1 full-speed serial transceiver select */
  8121. #define USB_OTG_GUSBCFG_SRPCAP ((uint32_t)0x00000100) /*!< SRP-capable */
  8122. #define USB_OTG_GUSBCFG_HNPCAP ((uint32_t)0x00000200) /*!< HNP-capable */
  8123. #define USB_OTG_GUSBCFG_TRDT ((uint32_t)0x00003C00) /*!< USB turnaround time */
  8124. #define USB_OTG_GUSBCFG_TRDT_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  8125. #define USB_OTG_GUSBCFG_TRDT_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  8126. #define USB_OTG_GUSBCFG_TRDT_2 ((uint32_t)0x00001000) /*!<Bit 2 */
  8127. #define USB_OTG_GUSBCFG_TRDT_3 ((uint32_t)0x00002000) /*!<Bit 3 */
  8128. #define USB_OTG_GUSBCFG_PHYLPCS ((uint32_t)0x00008000) /*!< PHY Low-power clock select */
  8129. #define USB_OTG_GUSBCFG_ULPIFSLS ((uint32_t)0x00020000) /*!< ULPI FS/LS select */
  8130. #define USB_OTG_GUSBCFG_ULPIAR ((uint32_t)0x00040000) /*!< ULPI Auto-resume */
  8131. #define USB_OTG_GUSBCFG_ULPICSM ((uint32_t)0x00080000) /*!< ULPI Clock SuspendM */
  8132. #define USB_OTG_GUSBCFG_ULPIEVBUSD ((uint32_t)0x00100000) /*!< ULPI External VBUS Drive */
  8133. #define USB_OTG_GUSBCFG_ULPIEVBUSI ((uint32_t)0x00200000) /*!< ULPI external VBUS indicator */
  8134. #define USB_OTG_GUSBCFG_TSDPS ((uint32_t)0x00400000) /*!< TermSel DLine pulsing selection */
  8135. #define USB_OTG_GUSBCFG_PCCI ((uint32_t)0x00800000) /*!< Indicator complement */
  8136. #define USB_OTG_GUSBCFG_PTCI ((uint32_t)0x01000000) /*!< Indicator pass through */
  8137. #define USB_OTG_GUSBCFG_ULPIIPD ((uint32_t)0x02000000) /*!< ULPI interface protect disable */
  8138. #define USB_OTG_GUSBCFG_FHMOD ((uint32_t)0x20000000) /*!< Forced host mode */
  8139. #define USB_OTG_GUSBCFG_FDMOD ((uint32_t)0x40000000) /*!< Forced peripheral mode */
  8140. #define USB_OTG_GUSBCFG_CTXPKT ((uint32_t)0x80000000) /*!< Corrupt Tx packet */
  8141. /******************** Bit definition forUSB_OTG_GRSTCTL register ********************/
  8142. #define USB_OTG_GRSTCTL_CSRST ((uint32_t)0x00000001) /*!< Core soft reset */
  8143. #define USB_OTG_GRSTCTL_HSRST ((uint32_t)0x00000002) /*!< HCLK soft reset */
  8144. #define USB_OTG_GRSTCTL_FCRST ((uint32_t)0x00000004) /*!< Host frame counter reset */
  8145. #define USB_OTG_GRSTCTL_RXFFLSH ((uint32_t)0x00000010) /*!< RxFIFO flush */
  8146. #define USB_OTG_GRSTCTL_TXFFLSH ((uint32_t)0x00000020) /*!< TxFIFO flush */
  8147. #define USB_OTG_GRSTCTL_TXFNUM ((uint32_t)0x000007C0) /*!< TxFIFO number */
  8148. #define USB_OTG_GRSTCTL_TXFNUM_0 ((uint32_t)0x00000040) /*!<Bit 0 */
  8149. #define USB_OTG_GRSTCTL_TXFNUM_1 ((uint32_t)0x00000080) /*!<Bit 1 */
  8150. #define USB_OTG_GRSTCTL_TXFNUM_2 ((uint32_t)0x00000100) /*!<Bit 2 */
  8151. #define USB_OTG_GRSTCTL_TXFNUM_3 ((uint32_t)0x00000200) /*!<Bit 3 */
  8152. #define USB_OTG_GRSTCTL_TXFNUM_4 ((uint32_t)0x00000400) /*!<Bit 4 */
  8153. #define USB_OTG_GRSTCTL_DMAREQ ((uint32_t)0x40000000) /*!< DMA request signal */
  8154. #define USB_OTG_GRSTCTL_AHBIDL ((uint32_t)0x80000000) /*!< AHB master idle */
  8155. /******************** Bit definition forUSB_OTG_DIEPMSK register ********************/
  8156. #define USB_OTG_DIEPMSK_XFRCM ((uint32_t)0x00000001) /*!< Transfer completed interrupt mask */
  8157. #define USB_OTG_DIEPMSK_EPDM ((uint32_t)0x00000002) /*!< Endpoint disabled interrupt mask */
  8158. #define USB_OTG_DIEPMSK_TOM ((uint32_t)0x00000008) /*!< Timeout condition mask (nonisochronous endpoints) */
  8159. #define USB_OTG_DIEPMSK_ITTXFEMSK ((uint32_t)0x00000010) /*!< IN token received when TxFIFO empty mask */
  8160. #define USB_OTG_DIEPMSK_INEPNMM ((uint32_t)0x00000020) /*!< IN token received with EP mismatch mask */
  8161. #define USB_OTG_DIEPMSK_INEPNEM ((uint32_t)0x00000040) /*!< IN endpoint NAK effective mask */
  8162. #define USB_OTG_DIEPMSK_TXFURM ((uint32_t)0x00000100) /*!< FIFO underrun mask */
  8163. #define USB_OTG_DIEPMSK_BIM ((uint32_t)0x00000200) /*!< BNA interrupt mask */
  8164. /******************** Bit definition forUSB_OTG_HPTXSTS register ********************/
  8165. #define USB_OTG_HPTXSTS_PTXFSAVL ((uint32_t)0x0000FFFF) /*!< Periodic transmit data FIFO space available */
  8166. #define USB_OTG_HPTXSTS_PTXQSAV ((uint32_t)0x00FF0000) /*!< Periodic transmit request queue space available */
  8167. #define USB_OTG_HPTXSTS_PTXQSAV_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  8168. #define USB_OTG_HPTXSTS_PTXQSAV_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  8169. #define USB_OTG_HPTXSTS_PTXQSAV_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  8170. #define USB_OTG_HPTXSTS_PTXQSAV_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  8171. #define USB_OTG_HPTXSTS_PTXQSAV_4 ((uint32_t)0x00100000) /*!<Bit 4 */
  8172. #define USB_OTG_HPTXSTS_PTXQSAV_5 ((uint32_t)0x00200000) /*!<Bit 5 */
  8173. #define USB_OTG_HPTXSTS_PTXQSAV_6 ((uint32_t)0x00400000) /*!<Bit 6 */
  8174. #define USB_OTG_HPTXSTS_PTXQSAV_7 ((uint32_t)0x00800000) /*!<Bit 7 */
  8175. #define USB_OTG_HPTXSTS_PTXQTOP ((uint32_t)0xFF000000) /*!< Top of the periodic transmit request queue */
  8176. #define USB_OTG_HPTXSTS_PTXQTOP_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  8177. #define USB_OTG_HPTXSTS_PTXQTOP_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  8178. #define USB_OTG_HPTXSTS_PTXQTOP_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  8179. #define USB_OTG_HPTXSTS_PTXQTOP_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  8180. #define USB_OTG_HPTXSTS_PTXQTOP_4 ((uint32_t)0x10000000) /*!<Bit 4 */
  8181. #define USB_OTG_HPTXSTS_PTXQTOP_5 ((uint32_t)0x20000000) /*!<Bit 5 */
  8182. #define USB_OTG_HPTXSTS_PTXQTOP_6 ((uint32_t)0x40000000) /*!<Bit 6 */
  8183. #define USB_OTG_HPTXSTS_PTXQTOP_7 ((uint32_t)0x80000000) /*!<Bit 7 */
  8184. /******************** Bit definition forUSB_OTG_HAINT register ********************/
  8185. #define USB_OTG_HAINT_HAINT ((uint32_t)0x0000FFFF) /*!< Channel interrupts */
  8186. /******************** Bit definition forUSB_OTG_DOEPMSK register ********************/
  8187. #define USB_OTG_DOEPMSK_XFRCM ((uint32_t)0x00000001) /*!< Transfer completed interrupt mask */
  8188. #define USB_OTG_DOEPMSK_EPDM ((uint32_t)0x00000002) /*!< Endpoint disabled interrupt mask */
  8189. #define USB_OTG_DOEPMSK_STUPM ((uint32_t)0x00000008) /*!< SETUP phase done mask */
  8190. #define USB_OTG_DOEPMSK_OTEPDM ((uint32_t)0x00000010) /*!< OUT token received when endpoint disabled mask */
  8191. #define USB_OTG_DOEPMSK_OTEPSPRM ((uint32_t)0x00000020) /*!< Status Phase Received mask */
  8192. #define USB_OTG_DOEPMSK_B2BSTUP ((uint32_t)0x00000040) /*!< Back-to-back SETUP packets received mask */
  8193. #define USB_OTG_DOEPMSK_OPEM ((uint32_t)0x00000100) /*!< OUT packet error mask */
  8194. #define USB_OTG_DOEPMSK_BOIM ((uint32_t)0x00000200) /*!< BNA interrupt mask */
  8195. /******************** Bit definition forUSB_OTG_GINTSTS register ********************/
  8196. #define USB_OTG_GINTSTS_CMOD ((uint32_t)0x00000001) /*!< Current mode of operation */
  8197. #define USB_OTG_GINTSTS_MMIS ((uint32_t)0x00000002) /*!< Mode mismatch interrupt */
  8198. #define USB_OTG_GINTSTS_OTGINT ((uint32_t)0x00000004) /*!< OTG interrupt */
  8199. #define USB_OTG_GINTSTS_SOF ((uint32_t)0x00000008) /*!< Start of frame */
  8200. #define USB_OTG_GINTSTS_RXFLVL ((uint32_t)0x00000010) /*!< RxFIFO nonempty */
  8201. #define USB_OTG_GINTSTS_NPTXFE ((uint32_t)0x00000020) /*!< Nonperiodic TxFIFO empty */
  8202. #define USB_OTG_GINTSTS_GINAKEFF ((uint32_t)0x00000040) /*!< Global IN nonperiodic NAK effective */
  8203. #define USB_OTG_GINTSTS_BOUTNAKEFF ((uint32_t)0x00000080) /*!< Global OUT NAK effective */
  8204. #define USB_OTG_GINTSTS_ESUSP ((uint32_t)0x00000400) /*!< Early suspend */
  8205. #define USB_OTG_GINTSTS_USBSUSP ((uint32_t)0x00000800) /*!< USB suspend */
  8206. #define USB_OTG_GINTSTS_USBRST ((uint32_t)0x00001000) /*!< USB reset */
  8207. #define USB_OTG_GINTSTS_ENUMDNE ((uint32_t)0x00002000) /*!< Enumeration done */
  8208. #define USB_OTG_GINTSTS_ISOODRP ((uint32_t)0x00004000) /*!< Isochronous OUT packet dropped interrupt */
  8209. #define USB_OTG_GINTSTS_EOPF ((uint32_t)0x00008000) /*!< End of periodic frame interrupt */
  8210. #define USB_OTG_GINTSTS_IEPINT ((uint32_t)0x00040000) /*!< IN endpoint interrupt */
  8211. #define USB_OTG_GINTSTS_OEPINT ((uint32_t)0x00080000) /*!< OUT endpoint interrupt */
  8212. #define USB_OTG_GINTSTS_IISOIXFR ((uint32_t)0x00100000) /*!< Incomplete isochronous IN transfer */
  8213. #define USB_OTG_GINTSTS_PXFR_INCOMPISOOUT ((uint32_t)0x00200000) /*!< Incomplete periodic transfer */
  8214. #define USB_OTG_GINTSTS_DATAFSUSP ((uint32_t)0x00400000) /*!< Data fetch suspended */
  8215. #define USB_OTG_GINTSTS_RSTDET ((uint32_t)0x00800000) /*!< Reset detected interrupt */
  8216. #define USB_OTG_GINTSTS_HPRTINT ((uint32_t)0x01000000) /*!< Host port interrupt */
  8217. #define USB_OTG_GINTSTS_HCINT ((uint32_t)0x02000000) /*!< Host channels interrupt */
  8218. #define USB_OTG_GINTSTS_PTXFE ((uint32_t)0x04000000) /*!< Periodic TxFIFO empty */
  8219. #define USB_OTG_GINTSTS_LPMINT ((uint32_t)0x08000000) /*!< LPM interrupt */
  8220. #define USB_OTG_GINTSTS_CIDSCHG ((uint32_t)0x10000000) /*!< Connector ID status change */
  8221. #define USB_OTG_GINTSTS_DISCINT ((uint32_t)0x20000000) /*!< Disconnect detected interrupt */
  8222. #define USB_OTG_GINTSTS_SRQINT ((uint32_t)0x40000000) /*!< Session request/new session detected interrupt */
  8223. #define USB_OTG_GINTSTS_WKUINT ((uint32_t)0x80000000) /*!< Resume/remote wakeup detected interrupt */
  8224. /******************** Bit definition forUSB_OTG_GINTMSK register ********************/
  8225. #define USB_OTG_GINTMSK_MMISM ((uint32_t)0x00000002) /*!< Mode mismatch interrupt mask */
  8226. #define USB_OTG_GINTMSK_OTGINT ((uint32_t)0x00000004) /*!< OTG interrupt mask */
  8227. #define USB_OTG_GINTMSK_SOFM ((uint32_t)0x00000008) /*!< Start of frame mask */
  8228. #define USB_OTG_GINTMSK_RXFLVLM ((uint32_t)0x00000010) /*!< Receive FIFO nonempty mask */
  8229. #define USB_OTG_GINTMSK_NPTXFEM ((uint32_t)0x00000020) /*!< Nonperiodic TxFIFO empty mask */
  8230. #define USB_OTG_GINTMSK_GINAKEFFM ((uint32_t)0x00000040) /*!< Global nonperiodic IN NAK effective mask */
  8231. #define USB_OTG_GINTMSK_GONAKEFFM ((uint32_t)0x00000080) /*!< Global OUT NAK effective mask */
  8232. #define USB_OTG_GINTMSK_ESUSPM ((uint32_t)0x00000400) /*!< Early suspend mask */
  8233. #define USB_OTG_GINTMSK_USBSUSPM ((uint32_t)0x00000800) /*!< USB suspend mask */
  8234. #define USB_OTG_GINTMSK_USBRST ((uint32_t)0x00001000) /*!< USB reset mask */
  8235. #define USB_OTG_GINTMSK_ENUMDNEM ((uint32_t)0x00002000) /*!< Enumeration done mask */
  8236. #define USB_OTG_GINTMSK_ISOODRPM ((uint32_t)0x00004000) /*!< Isochronous OUT packet dropped interrupt mask */
  8237. #define USB_OTG_GINTMSK_EOPFM ((uint32_t)0x00008000) /*!< End of periodic frame interrupt mask */
  8238. #define USB_OTG_GINTMSK_EPMISM ((uint32_t)0x00020000) /*!< Endpoint mismatch interrupt mask */
  8239. #define USB_OTG_GINTMSK_IEPINT ((uint32_t)0x00040000) /*!< IN endpoints interrupt mask */
  8240. #define USB_OTG_GINTMSK_OEPINT ((uint32_t)0x00080000) /*!< OUT endpoints interrupt mask */
  8241. #define USB_OTG_GINTMSK_IISOIXFRM ((uint32_t)0x00100000) /*!< Incomplete isochronous IN transfer mask */
  8242. #define USB_OTG_GINTMSK_PXFRM_IISOOXFRM ((uint32_t)0x00200000) /*!< Incomplete periodic transfer mask */
  8243. #define USB_OTG_GINTMSK_FSUSPM ((uint32_t)0x00400000) /*!< Data fetch suspended mask */
  8244. #define USB_OTG_GINTMSK_RSTDEM ((uint32_t)0x00800000) /*!< Reset detected interrupt mask */
  8245. #define USB_OTG_GINTMSK_PRTIM ((uint32_t)0x01000000) /*!< Host port interrupt mask */
  8246. #define USB_OTG_GINTMSK_HCIM ((uint32_t)0x02000000) /*!< Host channels interrupt mask */
  8247. #define USB_OTG_GINTMSK_PTXFEM ((uint32_t)0x04000000) /*!< Periodic TxFIFO empty mask */
  8248. #define USB_OTG_GINTMSK_LPMINTM ((uint32_t)0x08000000) /*!< LPM interrupt Mask */
  8249. #define USB_OTG_GINTMSK_CIDSCHGM ((uint32_t)0x10000000) /*!< Connector ID status change mask */
  8250. #define USB_OTG_GINTMSK_DISCINT ((uint32_t)0x20000000) /*!< Disconnect detected interrupt mask */
  8251. #define USB_OTG_GINTMSK_SRQIM ((uint32_t)0x40000000) /*!< Session request/new session detected interrupt mask */
  8252. #define USB_OTG_GINTMSK_WUIM ((uint32_t)0x80000000) /*!< Resume/remote wakeup detected interrupt mask */
  8253. /******************** Bit definition forUSB_OTG_DAINT register ********************/
  8254. #define USB_OTG_DAINT_IEPINT ((uint32_t)0x0000FFFF) /*!< IN endpoint interrupt bits */
  8255. #define USB_OTG_DAINT_OEPINT ((uint32_t)0xFFFF0000) /*!< OUT endpoint interrupt bits */
  8256. /******************** Bit definition forUSB_OTG_HAINTMSK register ********************/
  8257. #define USB_OTG_HAINTMSK_HAINTM ((uint32_t)0x0000FFFF) /*!< Channel interrupt mask */
  8258. /******************** Bit definition for USB_OTG_GRXSTSP register ********************/
  8259. #define USB_OTG_GRXSTSP_EPNUM ((uint32_t)0x0000000F) /*!< IN EP interrupt mask bits */
  8260. #define USB_OTG_GRXSTSP_BCNT ((uint32_t)0x00007FF0) /*!< OUT EP interrupt mask bits */
  8261. #define USB_OTG_GRXSTSP_DPID ((uint32_t)0x00018000) /*!< OUT EP interrupt mask bits */
  8262. #define USB_OTG_GRXSTSP_PKTSTS ((uint32_t)0x001E0000) /*!< OUT EP interrupt mask bits */
  8263. /******************** Bit definition forUSB_OTG_DAINTMSK register ********************/
  8264. #define USB_OTG_DAINTMSK_IEPM ((uint32_t)0x0000FFFF) /*!< IN EP interrupt mask bits */
  8265. #define USB_OTG_DAINTMSK_OEPM ((uint32_t)0xFFFF0000) /*!< OUT EP interrupt mask bits */
  8266. /******************** Bit definition for OTG register ********************/
  8267. #define USB_OTG_CHNUM ((uint32_t)0x0000000F) /*!< Channel number */
  8268. #define USB_OTG_CHNUM_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  8269. #define USB_OTG_CHNUM_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  8270. #define USB_OTG_CHNUM_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  8271. #define USB_OTG_CHNUM_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  8272. #define USB_OTG_BCNT ((uint32_t)0x00007FF0) /*!< Byte count */
  8273. #define USB_OTG_DPID ((uint32_t)0x00018000) /*!< Data PID */
  8274. #define USB_OTG_DPID_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  8275. #define USB_OTG_DPID_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  8276. #define USB_OTG_PKTSTS ((uint32_t)0x001E0000) /*!< Packet status */
  8277. #define USB_OTG_PKTSTS_0 ((uint32_t)0x00020000) /*!<Bit 0 */
  8278. #define USB_OTG_PKTSTS_1 ((uint32_t)0x00040000) /*!<Bit 1 */
  8279. #define USB_OTG_PKTSTS_2 ((uint32_t)0x00080000) /*!<Bit 2 */
  8280. #define USB_OTG_PKTSTS_3 ((uint32_t)0x00100000) /*!<Bit 3 */
  8281. #define USB_OTG_EPNUM ((uint32_t)0x0000000F) /*!< Endpoint number */
  8282. #define USB_OTG_EPNUM_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  8283. #define USB_OTG_EPNUM_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  8284. #define USB_OTG_EPNUM_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  8285. #define USB_OTG_EPNUM_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  8286. #define USB_OTG_FRMNUM ((uint32_t)0x01E00000) /*!< Frame number */
  8287. #define USB_OTG_FRMNUM_0 ((uint32_t)0x00200000) /*!<Bit 0 */
  8288. #define USB_OTG_FRMNUM_1 ((uint32_t)0x00400000) /*!<Bit 1 */
  8289. #define USB_OTG_FRMNUM_2 ((uint32_t)0x00800000) /*!<Bit 2 */
  8290. #define USB_OTG_FRMNUM_3 ((uint32_t)0x01000000) /*!<Bit 3 */
  8291. /******************** Bit definition for OTG register ********************/
  8292. #define USB_OTG_CHNUM ((uint32_t)0x0000000F) /*!< Channel number */
  8293. #define USB_OTG_CHNUM_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  8294. #define USB_OTG_CHNUM_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  8295. #define USB_OTG_CHNUM_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  8296. #define USB_OTG_CHNUM_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  8297. #define USB_OTG_BCNT ((uint32_t)0x00007FF0) /*!< Byte count */
  8298. #define USB_OTG_DPID ((uint32_t)0x00018000) /*!< Data PID */
  8299. #define USB_OTG_DPID_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  8300. #define USB_OTG_DPID_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  8301. #define USB_OTG_PKTSTS ((uint32_t)0x001E0000) /*!< Packet status */
  8302. #define USB_OTG_PKTSTS_0 ((uint32_t)0x00020000) /*!<Bit 0 */
  8303. #define USB_OTG_PKTSTS_1 ((uint32_t)0x00040000) /*!<Bit 1 */
  8304. #define USB_OTG_PKTSTS_2 ((uint32_t)0x00080000) /*!<Bit 2 */
  8305. #define USB_OTG_PKTSTS_3 ((uint32_t)0x00100000) /*!<Bit 3 */
  8306. #define USB_OTG_EPNUM ((uint32_t)0x0000000F) /*!< Endpoint number */
  8307. #define USB_OTG_EPNUM_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  8308. #define USB_OTG_EPNUM_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  8309. #define USB_OTG_EPNUM_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  8310. #define USB_OTG_EPNUM_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  8311. #define USB_OTG_FRMNUM ((uint32_t)0x01E00000) /*!< Frame number */
  8312. #define USB_OTG_FRMNUM_0 ((uint32_t)0x00200000) /*!<Bit 0 */
  8313. #define USB_OTG_FRMNUM_1 ((uint32_t)0x00400000) /*!<Bit 1 */
  8314. #define USB_OTG_FRMNUM_2 ((uint32_t)0x00800000) /*!<Bit 2 */
  8315. #define USB_OTG_FRMNUM_3 ((uint32_t)0x01000000) /*!<Bit 3 */
  8316. /******************** Bit definition forUSB_OTG_GRXFSIZ register ********************/
  8317. #define USB_OTG_GRXFSIZ_RXFD ((uint32_t)0x0000FFFF) /*!< RxFIFO depth */
  8318. /******************** Bit definition forUSB_OTG_DVBUSDIS register ********************/
  8319. #define USB_OTG_DVBUSDIS_VBUSDT ((uint32_t)0x0000FFFF) /*!< Device VBUS discharge time */
  8320. /******************** Bit definition for OTG register ********************/
  8321. #define USB_OTG_NPTXFSA ((uint32_t)0x0000FFFF) /*!< Nonperiodic transmit RAM start address */
  8322. #define USB_OTG_NPTXFD ((uint32_t)0xFFFF0000) /*!< Nonperiodic TxFIFO depth */
  8323. #define USB_OTG_TX0FSA ((uint32_t)0x0000FFFF) /*!< Endpoint 0 transmit RAM start address */
  8324. #define USB_OTG_TX0FD ((uint32_t)0xFFFF0000) /*!< Endpoint 0 TxFIFO depth */
  8325. /******************** Bit definition forUSB_OTG_DVBUSPULSE register ********************/
  8326. #define USB_OTG_DVBUSPULSE_DVBUSP ((uint32_t)0x00000FFF) /*!< Device VBUS pulsing time */
  8327. /******************** Bit definition forUSB_OTG_GNPTXSTS register ********************/
  8328. #define USB_OTG_GNPTXSTS_NPTXFSAV ((uint32_t)0x0000FFFF) /*!< Nonperiodic TxFIFO space available */
  8329. #define USB_OTG_GNPTXSTS_NPTQXSAV ((uint32_t)0x00FF0000) /*!< Nonperiodic transmit request queue space available */
  8330. #define USB_OTG_GNPTXSTS_NPTQXSAV_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  8331. #define USB_OTG_GNPTXSTS_NPTQXSAV_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  8332. #define USB_OTG_GNPTXSTS_NPTQXSAV_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  8333. #define USB_OTG_GNPTXSTS_NPTQXSAV_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  8334. #define USB_OTG_GNPTXSTS_NPTQXSAV_4 ((uint32_t)0x00100000) /*!<Bit 4 */
  8335. #define USB_OTG_GNPTXSTS_NPTQXSAV_5 ((uint32_t)0x00200000) /*!<Bit 5 */
  8336. #define USB_OTG_GNPTXSTS_NPTQXSAV_6 ((uint32_t)0x00400000) /*!<Bit 6 */
  8337. #define USB_OTG_GNPTXSTS_NPTQXSAV_7 ((uint32_t)0x00800000) /*!<Bit 7 */
  8338. #define USB_OTG_GNPTXSTS_NPTXQTOP ((uint32_t)0x7F000000) /*!< Top of the nonperiodic transmit request queue */
  8339. #define USB_OTG_GNPTXSTS_NPTXQTOP_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  8340. #define USB_OTG_GNPTXSTS_NPTXQTOP_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  8341. #define USB_OTG_GNPTXSTS_NPTXQTOP_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  8342. #define USB_OTG_GNPTXSTS_NPTXQTOP_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  8343. #define USB_OTG_GNPTXSTS_NPTXQTOP_4 ((uint32_t)0x10000000) /*!<Bit 4 */
  8344. #define USB_OTG_GNPTXSTS_NPTXQTOP_5 ((uint32_t)0x20000000) /*!<Bit 5 */
  8345. #define USB_OTG_GNPTXSTS_NPTXQTOP_6 ((uint32_t)0x40000000) /*!<Bit 6 */
  8346. /******************** Bit definition forUSB_OTG_DTHRCTL register ********************/
  8347. #define USB_OTG_DTHRCTL_NONISOTHREN ((uint32_t)0x00000001) /*!< Nonisochronous IN endpoints threshold enable */
  8348. #define USB_OTG_DTHRCTL_ISOTHREN ((uint32_t)0x00000002) /*!< ISO IN endpoint threshold enable */
  8349. #define USB_OTG_DTHRCTL_TXTHRLEN ((uint32_t)0x000007FC) /*!< Transmit threshold length */
  8350. #define USB_OTG_DTHRCTL_TXTHRLEN_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  8351. #define USB_OTG_DTHRCTL_TXTHRLEN_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  8352. #define USB_OTG_DTHRCTL_TXTHRLEN_2 ((uint32_t)0x00000010) /*!<Bit 2 */
  8353. #define USB_OTG_DTHRCTL_TXTHRLEN_3 ((uint32_t)0x00000020) /*!<Bit 3 */
  8354. #define USB_OTG_DTHRCTL_TXTHRLEN_4 ((uint32_t)0x00000040) /*!<Bit 4 */
  8355. #define USB_OTG_DTHRCTL_TXTHRLEN_5 ((uint32_t)0x00000080) /*!<Bit 5 */
  8356. #define USB_OTG_DTHRCTL_TXTHRLEN_6 ((uint32_t)0x00000100) /*!<Bit 6 */
  8357. #define USB_OTG_DTHRCTL_TXTHRLEN_7 ((uint32_t)0x00000200) /*!<Bit 7 */
  8358. #define USB_OTG_DTHRCTL_TXTHRLEN_8 ((uint32_t)0x00000400) /*!<Bit 8 */
  8359. #define USB_OTG_DTHRCTL_RXTHREN ((uint32_t)0x00010000) /*!< Receive threshold enable */
  8360. #define USB_OTG_DTHRCTL_RXTHRLEN ((uint32_t)0x03FE0000) /*!< Receive threshold length */
  8361. #define USB_OTG_DTHRCTL_RXTHRLEN_0 ((uint32_t)0x00020000) /*!<Bit 0 */
  8362. #define USB_OTG_DTHRCTL_RXTHRLEN_1 ((uint32_t)0x00040000) /*!<Bit 1 */
  8363. #define USB_OTG_DTHRCTL_RXTHRLEN_2 ((uint32_t)0x00080000) /*!<Bit 2 */
  8364. #define USB_OTG_DTHRCTL_RXTHRLEN_3 ((uint32_t)0x00100000) /*!<Bit 3 */
  8365. #define USB_OTG_DTHRCTL_RXTHRLEN_4 ((uint32_t)0x00200000) /*!<Bit 4 */
  8366. #define USB_OTG_DTHRCTL_RXTHRLEN_5 ((uint32_t)0x00400000) /*!<Bit 5 */
  8367. #define USB_OTG_DTHRCTL_RXTHRLEN_6 ((uint32_t)0x00800000) /*!<Bit 6 */
  8368. #define USB_OTG_DTHRCTL_RXTHRLEN_7 ((uint32_t)0x01000000) /*!<Bit 7 */
  8369. #define USB_OTG_DTHRCTL_RXTHRLEN_8 ((uint32_t)0x02000000) /*!<Bit 8 */
  8370. #define USB_OTG_DTHRCTL_ARPEN ((uint32_t)0x08000000) /*!< Arbiter parking enable */
  8371. /******************** Bit definition forUSB_OTG_DIEPEMPMSK register ********************/
  8372. #define USB_OTG_DIEPEMPMSK_INEPTXFEM ((uint32_t)0x0000FFFF) /*!< IN EP Tx FIFO empty interrupt mask bits */
  8373. /******************** Bit definition forUSB_OTG_DEACHINT register ********************/
  8374. #define USB_OTG_DEACHINT_IEP1INT ((uint32_t)0x00000002) /*!< IN endpoint 1interrupt bit */
  8375. #define USB_OTG_DEACHINT_OEP1INT ((uint32_t)0x00020000) /*!< OUT endpoint 1 interrupt bit */
  8376. /******************** Bit definition forUSB_OTG_GCCFG register ********************/
  8377. #define USB_OTG_GCCFG_PWRDWN ((uint32_t)0x00010000) /*!< Power down */
  8378. #define USB_OTG_GCCFG_VBDEN ((uint32_t)0x00200000) /*!< USB VBUS Detection Enable */
  8379. /******************** Bit definition forUSB_OTG_DEACHINTMSK register ********************/
  8380. #define USB_OTG_DEACHINTMSK_IEP1INTM ((uint32_t)0x00000002) /*!< IN Endpoint 1 interrupt mask bit */
  8381. #define USB_OTG_DEACHINTMSK_OEP1INTM ((uint32_t)0x00020000) /*!< OUT Endpoint 1 interrupt mask bit */
  8382. /******************** Bit definition forUSB_OTG_CID register ********************/
  8383. #define USB_OTG_CID_PRODUCT_ID ((uint32_t)0xFFFFFFFF) /*!< Product ID field */
  8384. /******************** Bit definition for USB_OTG_GLPMCFG register ********************/
  8385. #define USB_OTG_GLPMCFG_LPMEN ((uint32_t)0x00000001) /*!< LPM support enable */
  8386. #define USB_OTG_GLPMCFG_LPMACK ((uint32_t)0x00000002) /*!< LPM Token acknowledge enable */
  8387. #define USB_OTG_GLPMCFG_BESL ((uint32_t)0x0000003C) /*!< BESL value received with last ACKed LPM Token */
  8388. #define USB_OTG_GLPMCFG_REMWAKE ((uint32_t)0x00000040) /*!< bRemoteWake value received with last ACKed LPM Token */
  8389. #define USB_OTG_GLPMCFG_L1SSEN ((uint32_t)0x00000080) /*!< L1 shallow sleep enable */
  8390. #define USB_OTG_GLPMCFG_BESLTHRS ((uint32_t)0x00000F00) /*!< BESL threshold */
  8391. #define USB_OTG_GLPMCFG_L1DSEN ((uint32_t)0x00001000) /*!< L1 deep sleep enable */
  8392. #define USB_OTG_GLPMCFG_LPMRSP ((uint32_t)0x00006000) /*!< LPM response */
  8393. #define USB_OTG_GLPMCFG_SLPSTS ((uint32_t)0x00008000) /*!< Port sleep status */
  8394. #define USB_OTG_GLPMCFG_L1RSMOK ((uint32_t)0x00010000) /*!< Sleep State Resume OK */
  8395. #define USB_OTG_GLPMCFG_LPMCHIDX ((uint32_t)0x001E0000) /*!< LPM Channel Index */
  8396. #define USB_OTG_GLPMCFG_LPMRCNT ((uint32_t)0x00E00000) /*!< LPM retry count */
  8397. #define USB_OTG_GLPMCFG_SNDLPM ((uint32_t)0x01000000) /*!< Send LPM transaction */
  8398. #define USB_OTG_GLPMCFG_LPMRCNTSTS ((uint32_t)0x0E000000) /*!< LPM retry count status */
  8399. #define USB_OTG_GLPMCFG_ENBESL ((uint32_t)0x10000000) /*!< Enable best effort service latency */
  8400. /******************** Bit definition forUSB_OTG_DIEPEACHMSK1 register ********************/
  8401. #define USB_OTG_DIEPEACHMSK1_XFRCM ((uint32_t)0x00000001) /*!< Transfer completed interrupt mask */
  8402. #define USB_OTG_DIEPEACHMSK1_EPDM ((uint32_t)0x00000002) /*!< Endpoint disabled interrupt mask */
  8403. #define USB_OTG_DIEPEACHMSK1_TOM ((uint32_t)0x00000008) /*!< Timeout condition mask (nonisochronous endpoints) */
  8404. #define USB_OTG_DIEPEACHMSK1_ITTXFEMSK ((uint32_t)0x00000010) /*!< IN token received when TxFIFO empty mask */
  8405. #define USB_OTG_DIEPEACHMSK1_INEPNMM ((uint32_t)0x00000020) /*!< IN token received with EP mismatch mask */
  8406. #define USB_OTG_DIEPEACHMSK1_INEPNEM ((uint32_t)0x00000040) /*!< IN endpoint NAK effective mask */
  8407. #define USB_OTG_DIEPEACHMSK1_TXFURM ((uint32_t)0x00000100) /*!< FIFO underrun mask */
  8408. #define USB_OTG_DIEPEACHMSK1_BIM ((uint32_t)0x00000200) /*!< BNA interrupt mask */
  8409. #define USB_OTG_DIEPEACHMSK1_NAKM ((uint32_t)0x00002000) /*!< NAK interrupt mask */
  8410. /******************** Bit definition forUSB_OTG_HPRT register ********************/
  8411. #define USB_OTG_HPRT_PCSTS ((uint32_t)0x00000001) /*!< Port connect status */
  8412. #define USB_OTG_HPRT_PCDET ((uint32_t)0x00000002) /*!< Port connect detected */
  8413. #define USB_OTG_HPRT_PENA ((uint32_t)0x00000004) /*!< Port enable */
  8414. #define USB_OTG_HPRT_PENCHNG ((uint32_t)0x00000008) /*!< Port enable/disable change */
  8415. #define USB_OTG_HPRT_POCA ((uint32_t)0x00000010) /*!< Port overcurrent active */
  8416. #define USB_OTG_HPRT_POCCHNG ((uint32_t)0x00000020) /*!< Port overcurrent change */
  8417. #define USB_OTG_HPRT_PRES ((uint32_t)0x00000040) /*!< Port resume */
  8418. #define USB_OTG_HPRT_PSUSP ((uint32_t)0x00000080) /*!< Port suspend */
  8419. #define USB_OTG_HPRT_PRST ((uint32_t)0x00000100) /*!< Port reset */
  8420. #define USB_OTG_HPRT_PLSTS ((uint32_t)0x00000C00) /*!< Port line status */
  8421. #define USB_OTG_HPRT_PLSTS_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  8422. #define USB_OTG_HPRT_PLSTS_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  8423. #define USB_OTG_HPRT_PPWR ((uint32_t)0x00001000) /*!< Port power */
  8424. #define USB_OTG_HPRT_PTCTL ((uint32_t)0x0001E000) /*!< Port test control */
  8425. #define USB_OTG_HPRT_PTCTL_0 ((uint32_t)0x00002000) /*!<Bit 0 */
  8426. #define USB_OTG_HPRT_PTCTL_1 ((uint32_t)0x00004000) /*!<Bit 1 */
  8427. #define USB_OTG_HPRT_PTCTL_2 ((uint32_t)0x00008000) /*!<Bit 2 */
  8428. #define USB_OTG_HPRT_PTCTL_3 ((uint32_t)0x00010000) /*!<Bit 3 */
  8429. #define USB_OTG_HPRT_PSPD ((uint32_t)0x00060000) /*!< Port speed */
  8430. #define USB_OTG_HPRT_PSPD_0 ((uint32_t)0x00020000) /*!<Bit 0 */
  8431. #define USB_OTG_HPRT_PSPD_1 ((uint32_t)0x00040000) /*!<Bit 1 */
  8432. /******************** Bit definition forUSB_OTG_DOEPEACHMSK1 register ********************/
  8433. #define USB_OTG_DOEPEACHMSK1_XFRCM ((uint32_t)0x00000001) /*!< Transfer completed interrupt mask */
  8434. #define USB_OTG_DOEPEACHMSK1_EPDM ((uint32_t)0x00000002) /*!< Endpoint disabled interrupt mask */
  8435. #define USB_OTG_DOEPEACHMSK1_TOM ((uint32_t)0x00000008) /*!< Timeout condition mask */
  8436. #define USB_OTG_DOEPEACHMSK1_ITTXFEMSK ((uint32_t)0x00000010) /*!< IN token received when TxFIFO empty mask */
  8437. #define USB_OTG_DOEPEACHMSK1_INEPNMM ((uint32_t)0x00000020) /*!< IN token received with EP mismatch mask */
  8438. #define USB_OTG_DOEPEACHMSK1_INEPNEM ((uint32_t)0x00000040) /*!< IN endpoint NAK effective mask */
  8439. #define USB_OTG_DOEPEACHMSK1_TXFURM ((uint32_t)0x00000100) /*!< OUT packet error mask */
  8440. #define USB_OTG_DOEPEACHMSK1_BIM ((uint32_t)0x00000200) /*!< BNA interrupt mask */
  8441. #define USB_OTG_DOEPEACHMSK1_BERRM ((uint32_t)0x00001000) /*!< Bubble error interrupt mask */
  8442. #define USB_OTG_DOEPEACHMSK1_NAKM ((uint32_t)0x00002000) /*!< NAK interrupt mask */
  8443. #define USB_OTG_DOEPEACHMSK1_NYETM ((uint32_t)0x00004000) /*!< NYET interrupt mask */
  8444. /******************** Bit definition forUSB_OTG_HPTXFSIZ register ********************/
  8445. #define USB_OTG_HPTXFSIZ_PTXSA ((uint32_t)0x0000FFFF) /*!< Host periodic TxFIFO start address */
  8446. #define USB_OTG_HPTXFSIZ_PTXFD ((uint32_t)0xFFFF0000) /*!< Host periodic TxFIFO depth */
  8447. /******************** Bit definition forUSB_OTG_DIEPCTL register ********************/
  8448. #define USB_OTG_DIEPCTL_MPSIZ ((uint32_t)0x000007FF) /*!< Maximum packet size */
  8449. #define USB_OTG_DIEPCTL_USBAEP ((uint32_t)0x00008000) /*!< USB active endpoint */
  8450. #define USB_OTG_DIEPCTL_EONUM_DPID ((uint32_t)0x00010000) /*!< Even/odd frame */
  8451. #define USB_OTG_DIEPCTL_NAKSTS ((uint32_t)0x00020000) /*!< NAK status */
  8452. #define USB_OTG_DIEPCTL_EPTYP ((uint32_t)0x000C0000) /*!< Endpoint type */
  8453. #define USB_OTG_DIEPCTL_EPTYP_0 ((uint32_t)0x00040000) /*!<Bit 0 */
  8454. #define USB_OTG_DIEPCTL_EPTYP_1 ((uint32_t)0x00080000) /*!<Bit 1 */
  8455. #define USB_OTG_DIEPCTL_STALL ((uint32_t)0x00200000) /*!< STALL handshake */
  8456. #define USB_OTG_DIEPCTL_TXFNUM ((uint32_t)0x03C00000) /*!< TxFIFO number */
  8457. #define USB_OTG_DIEPCTL_TXFNUM_0 ((uint32_t)0x00400000) /*!<Bit 0 */
  8458. #define USB_OTG_DIEPCTL_TXFNUM_1 ((uint32_t)0x00800000) /*!<Bit 1 */
  8459. #define USB_OTG_DIEPCTL_TXFNUM_2 ((uint32_t)0x01000000) /*!<Bit 2 */
  8460. #define USB_OTG_DIEPCTL_TXFNUM_3 ((uint32_t)0x02000000) /*!<Bit 3 */
  8461. #define USB_OTG_DIEPCTL_CNAK ((uint32_t)0x04000000) /*!< Clear NAK */
  8462. #define USB_OTG_DIEPCTL_SNAK ((uint32_t)0x08000000) /*!< Set NAK */
  8463. #define USB_OTG_DIEPCTL_SD0PID_SEVNFRM ((uint32_t)0x10000000) /*!< Set DATA0 PID */
  8464. #define USB_OTG_DIEPCTL_SODDFRM ((uint32_t)0x20000000) /*!< Set odd frame */
  8465. #define USB_OTG_DIEPCTL_EPDIS ((uint32_t)0x40000000) /*!< Endpoint disable */
  8466. #define USB_OTG_DIEPCTL_EPENA ((uint32_t)0x80000000) /*!< Endpoint enable */
  8467. /******************** Bit definition forUSB_OTG_HCCHAR register ********************/
  8468. #define USB_OTG_HCCHAR_MPSIZ ((uint32_t)0x000007FF) /*!< Maximum packet size */
  8469. #define USB_OTG_HCCHAR_EPNUM ((uint32_t)0x00007800) /*!< Endpoint number */
  8470. #define USB_OTG_HCCHAR_EPNUM_0 ((uint32_t)0x00000800) /*!<Bit 0 */
  8471. #define USB_OTG_HCCHAR_EPNUM_1 ((uint32_t)0x00001000) /*!<Bit 1 */
  8472. #define USB_OTG_HCCHAR_EPNUM_2 ((uint32_t)0x00002000) /*!<Bit 2 */
  8473. #define USB_OTG_HCCHAR_EPNUM_3 ((uint32_t)0x00004000) /*!<Bit 3 */
  8474. #define USB_OTG_HCCHAR_EPDIR ((uint32_t)0x00008000) /*!< Endpoint direction */
  8475. #define USB_OTG_HCCHAR_LSDEV ((uint32_t)0x00020000) /*!< Low-speed device */
  8476. #define USB_OTG_HCCHAR_EPTYP ((uint32_t)0x000C0000) /*!< Endpoint type */
  8477. #define USB_OTG_HCCHAR_EPTYP_0 ((uint32_t)0x00040000) /*!<Bit 0 */
  8478. #define USB_OTG_HCCHAR_EPTYP_1 ((uint32_t)0x00080000) /*!<Bit 1 */
  8479. #define USB_OTG_HCCHAR_MC ((uint32_t)0x00300000) /*!< Multi Count (MC) / Error Count (EC) */
  8480. #define USB_OTG_HCCHAR_MC_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  8481. #define USB_OTG_HCCHAR_MC_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  8482. #define USB_OTG_HCCHAR_DAD ((uint32_t)0x1FC00000) /*!< Device address */
  8483. #define USB_OTG_HCCHAR_DAD_0 ((uint32_t)0x00400000) /*!<Bit 0 */
  8484. #define USB_OTG_HCCHAR_DAD_1 ((uint32_t)0x00800000) /*!<Bit 1 */
  8485. #define USB_OTG_HCCHAR_DAD_2 ((uint32_t)0x01000000) /*!<Bit 2 */
  8486. #define USB_OTG_HCCHAR_DAD_3 ((uint32_t)0x02000000) /*!<Bit 3 */
  8487. #define USB_OTG_HCCHAR_DAD_4 ((uint32_t)0x04000000) /*!<Bit 4 */
  8488. #define USB_OTG_HCCHAR_DAD_5 ((uint32_t)0x08000000) /*!<Bit 5 */
  8489. #define USB_OTG_HCCHAR_DAD_6 ((uint32_t)0x10000000) /*!<Bit 6 */
  8490. #define USB_OTG_HCCHAR_ODDFRM ((uint32_t)0x20000000) /*!< Odd frame */
  8491. #define USB_OTG_HCCHAR_CHDIS ((uint32_t)0x40000000) /*!< Channel disable */
  8492. #define USB_OTG_HCCHAR_CHENA ((uint32_t)0x80000000) /*!< Channel enable */
  8493. /******************** Bit definition forUSB_OTG_HCSPLT register ********************/
  8494. #define USB_OTG_HCSPLT_PRTADDR ((uint32_t)0x0000007F) /*!< Port address */
  8495. #define USB_OTG_HCSPLT_PRTADDR_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  8496. #define USB_OTG_HCSPLT_PRTADDR_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  8497. #define USB_OTG_HCSPLT_PRTADDR_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  8498. #define USB_OTG_HCSPLT_PRTADDR_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  8499. #define USB_OTG_HCSPLT_PRTADDR_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  8500. #define USB_OTG_HCSPLT_PRTADDR_5 ((uint32_t)0x00000020) /*!<Bit 5 */
  8501. #define USB_OTG_HCSPLT_PRTADDR_6 ((uint32_t)0x00000040) /*!<Bit 6 */
  8502. #define USB_OTG_HCSPLT_HUBADDR ((uint32_t)0x00003F80) /*!< Hub address */
  8503. #define USB_OTG_HCSPLT_HUBADDR_0 ((uint32_t)0x00000080) /*!<Bit 0 */
  8504. #define USB_OTG_HCSPLT_HUBADDR_1 ((uint32_t)0x00000100) /*!<Bit 1 */
  8505. #define USB_OTG_HCSPLT_HUBADDR_2 ((uint32_t)0x00000200) /*!<Bit 2 */
  8506. #define USB_OTG_HCSPLT_HUBADDR_3 ((uint32_t)0x00000400) /*!<Bit 3 */
  8507. #define USB_OTG_HCSPLT_HUBADDR_4 ((uint32_t)0x00000800) /*!<Bit 4 */
  8508. #define USB_OTG_HCSPLT_HUBADDR_5 ((uint32_t)0x00001000) /*!<Bit 5 */
  8509. #define USB_OTG_HCSPLT_HUBADDR_6 ((uint32_t)0x00002000) /*!<Bit 6 */
  8510. #define USB_OTG_HCSPLT_XACTPOS ((uint32_t)0x0000C000) /*!< XACTPOS */
  8511. #define USB_OTG_HCSPLT_XACTPOS_0 ((uint32_t)0x00004000) /*!<Bit 0 */
  8512. #define USB_OTG_HCSPLT_XACTPOS_1 ((uint32_t)0x00008000) /*!<Bit 1 */
  8513. #define USB_OTG_HCSPLT_COMPLSPLT ((uint32_t)0x00010000) /*!< Do complete split */
  8514. #define USB_OTG_HCSPLT_SPLITEN ((uint32_t)0x80000000) /*!< Split enable */
  8515. /******************** Bit definition forUSB_OTG_HCINT register ********************/
  8516. #define USB_OTG_HCINT_XFRC ((uint32_t)0x00000001) /*!< Transfer completed */
  8517. #define USB_OTG_HCINT_CHH ((uint32_t)0x00000002) /*!< Channel halted */
  8518. #define USB_OTG_HCINT_AHBERR ((uint32_t)0x00000004) /*!< AHB error */
  8519. #define USB_OTG_HCINT_STALL ((uint32_t)0x00000008) /*!< STALL response received interrupt */
  8520. #define USB_OTG_HCINT_NAK ((uint32_t)0x00000010) /*!< NAK response received interrupt */
  8521. #define USB_OTG_HCINT_ACK ((uint32_t)0x00000020) /*!< ACK response received/transmitted interrupt */
  8522. #define USB_OTG_HCINT_NYET ((uint32_t)0x00000040) /*!< Response received interrupt */
  8523. #define USB_OTG_HCINT_TXERR ((uint32_t)0x00000080) /*!< Transaction error */
  8524. #define USB_OTG_HCINT_BBERR ((uint32_t)0x00000100) /*!< Babble error */
  8525. #define USB_OTG_HCINT_FRMOR ((uint32_t)0x00000200) /*!< Frame overrun */
  8526. #define USB_OTG_HCINT_DTERR ((uint32_t)0x00000400) /*!< Data toggle error */
  8527. /******************** Bit definition forUSB_OTG_DIEPINT register ********************/
  8528. #define USB_OTG_DIEPINT_XFRC ((uint32_t)0x00000001) /*!< Transfer completed interrupt */
  8529. #define USB_OTG_DIEPINT_EPDISD ((uint32_t)0x00000002) /*!< Endpoint disabled interrupt */
  8530. #define USB_OTG_DIEPINT_TOC ((uint32_t)0x00000008) /*!< Timeout condition */
  8531. #define USB_OTG_DIEPINT_ITTXFE ((uint32_t)0x00000010) /*!< IN token received when TxFIFO is empty */
  8532. #define USB_OTG_DIEPINT_INEPNE ((uint32_t)0x00000040) /*!< IN endpoint NAK effective */
  8533. #define USB_OTG_DIEPINT_TXFE ((uint32_t)0x00000080) /*!< Transmit FIFO empty */
  8534. #define USB_OTG_DIEPINT_TXFIFOUDRN ((uint32_t)0x00000100) /*!< Transmit Fifo Underrun */
  8535. #define USB_OTG_DIEPINT_BNA ((uint32_t)0x00000200) /*!< Buffer not available interrupt */
  8536. #define USB_OTG_DIEPINT_PKTDRPSTS ((uint32_t)0x00000800) /*!< Packet dropped status */
  8537. #define USB_OTG_DIEPINT_BERR ((uint32_t)0x00001000) /*!< Babble error interrupt */
  8538. #define USB_OTG_DIEPINT_NAK ((uint32_t)0x00002000) /*!< NAK interrupt */
  8539. /******************** Bit definition forUSB_OTG_HCINTMSK register ********************/
  8540. #define USB_OTG_HCINTMSK_XFRCM ((uint32_t)0x00000001) /*!< Transfer completed mask */
  8541. #define USB_OTG_HCINTMSK_CHHM ((uint32_t)0x00000002) /*!< Channel halted mask */
  8542. #define USB_OTG_HCINTMSK_AHBERR ((uint32_t)0x00000004) /*!< AHB error */
  8543. #define USB_OTG_HCINTMSK_STALLM ((uint32_t)0x00000008) /*!< STALL response received interrupt mask */
  8544. #define USB_OTG_HCINTMSK_NAKM ((uint32_t)0x00000010) /*!< NAK response received interrupt mask */
  8545. #define USB_OTG_HCINTMSK_ACKM ((uint32_t)0x00000020) /*!< ACK response received/transmitted interrupt mask */
  8546. #define USB_OTG_HCINTMSK_NYET ((uint32_t)0x00000040) /*!< response received interrupt mask */
  8547. #define USB_OTG_HCINTMSK_TXERRM ((uint32_t)0x00000080) /*!< Transaction error mask */
  8548. #define USB_OTG_HCINTMSK_BBERRM ((uint32_t)0x00000100) /*!< Babble error mask */
  8549. #define USB_OTG_HCINTMSK_FRMORM ((uint32_t)0x00000200) /*!< Frame overrun mask */
  8550. #define USB_OTG_HCINTMSK_DTERRM ((uint32_t)0x00000400) /*!< Data toggle error mask */
  8551. /******************** Bit definition for USB_OTG_DIEPTSIZ register ********************/
  8552. #define USB_OTG_DIEPTSIZ_XFRSIZ ((uint32_t)0x0007FFFF) /*!< Transfer size */
  8553. #define USB_OTG_DIEPTSIZ_PKTCNT ((uint32_t)0x1FF80000) /*!< Packet count */
  8554. #define USB_OTG_DIEPTSIZ_MULCNT ((uint32_t)0x60000000) /*!< Packet count */
  8555. /******************** Bit definition forUSB_OTG_HCTSIZ register ********************/
  8556. #define USB_OTG_HCTSIZ_XFRSIZ ((uint32_t)0x0007FFFF) /*!< Transfer size */
  8557. #define USB_OTG_HCTSIZ_PKTCNT ((uint32_t)0x1FF80000) /*!< Packet count */
  8558. #define USB_OTG_HCTSIZ_DOPING ((uint32_t)0x80000000) /*!< Do PING */
  8559. #define USB_OTG_HCTSIZ_DPID ((uint32_t)0x60000000) /*!< Data PID */
  8560. #define USB_OTG_HCTSIZ_DPID_0 ((uint32_t)0x20000000) /*!<Bit 0 */
  8561. #define USB_OTG_HCTSIZ_DPID_1 ((uint32_t)0x40000000) /*!<Bit 1 */
  8562. /******************** Bit definition forUSB_OTG_DIEPDMA register ********************/
  8563. #define USB_OTG_DIEPDMA_DMAADDR ((uint32_t)0xFFFFFFFF) /*!< DMA address */
  8564. /******************** Bit definition forUSB_OTG_HCDMA register ********************/
  8565. #define USB_OTG_HCDMA_DMAADDR ((uint32_t)0xFFFFFFFF) /*!< DMA address */
  8566. /******************** Bit definition forUSB_OTG_DTXFSTS register ********************/
  8567. #define USB_OTG_DTXFSTS_INEPTFSAV ((uint32_t)0x0000FFFF) /*!< IN endpoint TxFIFO space available */
  8568. /******************** Bit definition forUSB_OTG_DIEPTXF register ********************/
  8569. #define USB_OTG_DIEPTXF_INEPTXSA ((uint32_t)0x0000FFFF) /*!< IN endpoint FIFOx transmit RAM start address */
  8570. #define USB_OTG_DIEPTXF_INEPTXFD ((uint32_t)0xFFFF0000) /*!< IN endpoint TxFIFO depth */
  8571. /******************** Bit definition forUSB_OTG_DOEPCTL register ********************/
  8572. #define USB_OTG_DOEPCTL_MPSIZ ((uint32_t)0x000007FF) /*!< Maximum packet size */ /*!<Bit 1 */
  8573. #define USB_OTG_DOEPCTL_USBAEP ((uint32_t)0x00008000) /*!< USB active endpoint */
  8574. #define USB_OTG_DOEPCTL_NAKSTS ((uint32_t)0x00020000) /*!< NAK status */
  8575. #define USB_OTG_DOEPCTL_SD0PID_SEVNFRM ((uint32_t)0x10000000) /*!< Set DATA0 PID */
  8576. #define USB_OTG_DOEPCTL_SODDFRM ((uint32_t)0x20000000) /*!< Set odd frame */
  8577. #define USB_OTG_DOEPCTL_EPTYP ((uint32_t)0x000C0000) /*!< Endpoint type */
  8578. #define USB_OTG_DOEPCTL_EPTYP_0 ((uint32_t)0x00040000) /*!<Bit 0 */
  8579. #define USB_OTG_DOEPCTL_EPTYP_1 ((uint32_t)0x00080000) /*!<Bit 1 */
  8580. #define USB_OTG_DOEPCTL_SNPM ((uint32_t)0x00100000) /*!< Snoop mode */
  8581. #define USB_OTG_DOEPCTL_STALL ((uint32_t)0x00200000) /*!< STALL handshake */
  8582. #define USB_OTG_DOEPCTL_CNAK ((uint32_t)0x04000000) /*!< Clear NAK */
  8583. #define USB_OTG_DOEPCTL_SNAK ((uint32_t)0x08000000) /*!< Set NAK */
  8584. #define USB_OTG_DOEPCTL_EPDIS ((uint32_t)0x40000000) /*!< Endpoint disable */
  8585. #define USB_OTG_DOEPCTL_EPENA ((uint32_t)0x80000000) /*!< Endpoint enable */
  8586. /******************** Bit definition forUSB_OTG_DOEPINT register ********************/
  8587. #define USB_OTG_DOEPINT_XFRC ((uint32_t)0x00000001) /*!< Transfer completed interrupt */
  8588. #define USB_OTG_DOEPINT_EPDISD ((uint32_t)0x00000002) /*!< Endpoint disabled interrupt */
  8589. #define USB_OTG_DOEPINT_STUP ((uint32_t)0x00000008) /*!< SETUP phase done */
  8590. #define USB_OTG_DOEPINT_OTEPDIS ((uint32_t)0x00000010) /*!< OUT token received when endpoint disabled */
  8591. #define USB_OTG_DOEPINT_OTEPSPR ((uint32_t)0x00000020) /*!< Status Phase Received For Control Write */
  8592. #define USB_OTG_DOEPINT_B2BSTUP ((uint32_t)0x00000040) /*!< Back-to-back SETUP packets received */
  8593. #define USB_OTG_DOEPINT_NYET ((uint32_t)0x00004000) /*!< NYET interrupt */
  8594. /******************** Bit definition forUSB_OTG_DOEPTSIZ register ********************/
  8595. #define USB_OTG_DOEPTSIZ_XFRSIZ ((uint32_t)0x0007FFFF) /*!< Transfer size */
  8596. #define USB_OTG_DOEPTSIZ_PKTCNT ((uint32_t)0x1FF80000) /*!< Packet count */
  8597. #define USB_OTG_DOEPTSIZ_STUPCNT ((uint32_t)0x60000000) /*!< SETUP packet count */
  8598. #define USB_OTG_DOEPTSIZ_STUPCNT_0 ((uint32_t)0x20000000) /*!<Bit 0 */
  8599. #define USB_OTG_DOEPTSIZ_STUPCNT_1 ((uint32_t)0x40000000) /*!<Bit 1 */
  8600. /******************** Bit definition for PCGCCTL register ********************/
  8601. #define USB_OTG_PCGCCTL_STOPCLK ((uint32_t)0x00000001) /*!< SETUP packet count */
  8602. #define USB_OTG_PCGCCTL_GATECLK ((uint32_t)0x00000002) /*!<Bit 0 */
  8603. #define USB_OTG_PCGCCTL_PHYSUSP ((uint32_t)0x00000010) /*!<Bit 1 */
  8604. /**
  8605. * @}
  8606. */
  8607. /**
  8608. * @}
  8609. */
  8610. /** @addtogroup Exported_macros
  8611. * @{
  8612. */
  8613. /******************************* ADC Instances ********************************/
  8614. #define IS_ADC_ALL_INSTANCE(INSTANCE) (((INSTANCE) == ADC1) || \
  8615. ((INSTANCE) == ADC2) || \
  8616. ((INSTANCE) == ADC3))
  8617. /******************************* CAN Instances ********************************/
  8618. #define IS_CAN_ALL_INSTANCE(INSTANCE) (((INSTANCE) == CAN1) || \
  8619. ((INSTANCE) == CAN2))
  8620. /******************************* CRC Instances ********************************/
  8621. #define IS_CRC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CRC)
  8622. /******************************* DAC Instances ********************************/
  8623. #define IS_DAC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == DAC)
  8624. /******************************* DCMI Instances *******************************/
  8625. #define IS_DCMI_ALL_INSTANCE(INSTANCE) ((INSTANCE) == DCMI)
  8626. /******************************* DMA2D Instances *******************************/
  8627. #define IS_DMA2D_ALL_INSTANCE(INSTANCE) ((INSTANCE) == DMA2D)
  8628. /******************************** DMA Instances *******************************/
  8629. #define IS_DMA_STREAM_ALL_INSTANCE(INSTANCE) (((INSTANCE) == DMA1_Stream0) || \
  8630. ((INSTANCE) == DMA1_Stream1) || \
  8631. ((INSTANCE) == DMA1_Stream2) || \
  8632. ((INSTANCE) == DMA1_Stream3) || \
  8633. ((INSTANCE) == DMA1_Stream4) || \
  8634. ((INSTANCE) == DMA1_Stream5) || \
  8635. ((INSTANCE) == DMA1_Stream6) || \
  8636. ((INSTANCE) == DMA1_Stream7) || \
  8637. ((INSTANCE) == DMA2_Stream0) || \
  8638. ((INSTANCE) == DMA2_Stream1) || \
  8639. ((INSTANCE) == DMA2_Stream2) || \
  8640. ((INSTANCE) == DMA2_Stream3) || \
  8641. ((INSTANCE) == DMA2_Stream4) || \
  8642. ((INSTANCE) == DMA2_Stream5) || \
  8643. ((INSTANCE) == DMA2_Stream6) || \
  8644. ((INSTANCE) == DMA2_Stream7))
  8645. /******************************* GPIO Instances *******************************/
  8646. #define IS_GPIO_ALL_INSTANCE(INSTANCE) (((INSTANCE) == GPIOA) || \
  8647. ((INSTANCE) == GPIOB) || \
  8648. ((INSTANCE) == GPIOC) || \
  8649. ((INSTANCE) == GPIOD) || \
  8650. ((INSTANCE) == GPIOE) || \
  8651. ((INSTANCE) == GPIOF) || \
  8652. ((INSTANCE) == GPIOG) || \
  8653. ((INSTANCE) == GPIOH) || \
  8654. ((INSTANCE) == GPIOI) || \
  8655. ((INSTANCE) == GPIOJ) || \
  8656. ((INSTANCE) == GPIOK))
  8657. /******************************** I2C Instances *******************************/
  8658. #define IS_I2C_ALL_INSTANCE(INSTANCE) (((INSTANCE) == I2C1) || \
  8659. ((INSTANCE) == I2C2) || \
  8660. ((INSTANCE) == I2C3))
  8661. /******************************** I2S Instances *******************************/
  8662. #define IS_I2S_ALL_INSTANCE(INSTANCE) (((INSTANCE) == SPI2) || \
  8663. ((INSTANCE) == SPI3))
  8664. /*************************** I2S Extended Instances ***************************/
  8665. #define IS_I2S_ALL_INSTANCE_EXT(PERIPH) (((INSTANCE) == SPI2) || \
  8666. ((INSTANCE) == SPI3) || \
  8667. ((INSTANCE) == I2S2ext) || \
  8668. ((INSTANCE) == I2S3ext))
  8669. /****************************** LTDC Instances ********************************/
  8670. #define IS_LTDC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == LTDC)
  8671. /******************************* RNG Instances ********************************/
  8672. #define IS_RNG_ALL_INSTANCE(INSTANCE) ((INSTANCE) == RNG)
  8673. /****************************** RTC Instances *********************************/
  8674. #define IS_RTC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == RTC)
  8675. /******************************* SAI Instances ********************************/
  8676. #define IS_SAI_BLOCK_PERIPH(PERIPH) (((PERIPH) == SAI1_Block_A) || \
  8677. ((PERIPH) == SAI1_Block_B))
  8678. /******************************** SPI Instances *******************************/
  8679. #define IS_SPI_ALL_INSTANCE(INSTANCE) (((INSTANCE) == SPI1) || \
  8680. ((INSTANCE) == SPI2) || \
  8681. ((INSTANCE) == SPI3) || \
  8682. ((INSTANCE) == SPI4) || \
  8683. ((INSTANCE) == SPI5) || \
  8684. ((INSTANCE) == SPI6))
  8685. /*************************** SPI Extended Instances ***************************/
  8686. #define IS_SPI_ALL_INSTANCE_EXT(INSTANCE) (((INSTANCE) == SPI1) || \
  8687. ((INSTANCE) == SPI2) || \
  8688. ((INSTANCE) == SPI3) || \
  8689. ((INSTANCE) == SPI4) || \
  8690. ((INSTANCE) == SPI5) || \
  8691. ((INSTANCE) == SPI6) || \
  8692. ((INSTANCE) == I2S2ext) || \
  8693. ((INSTANCE) == I2S3ext))
  8694. /****************** TIM Instances : All supported instances *******************/
  8695. #define IS_TIM_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  8696. ((INSTANCE) == TIM2) || \
  8697. ((INSTANCE) == TIM3) || \
  8698. ((INSTANCE) == TIM4) || \
  8699. ((INSTANCE) == TIM5) || \
  8700. ((INSTANCE) == TIM6) || \
  8701. ((INSTANCE) == TIM7) || \
  8702. ((INSTANCE) == TIM8) || \
  8703. ((INSTANCE) == TIM9) || \
  8704. ((INSTANCE) == TIM10) || \
  8705. ((INSTANCE) == TIM11) || \
  8706. ((INSTANCE) == TIM12) || \
  8707. ((INSTANCE) == TIM13) || \
  8708. ((INSTANCE) == TIM14))
  8709. /************* TIM Instances : at least 1 capture/compare channel *************/
  8710. #define IS_TIM_CC1_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  8711. ((INSTANCE) == TIM2) || \
  8712. ((INSTANCE) == TIM3) || \
  8713. ((INSTANCE) == TIM4) || \
  8714. ((INSTANCE) == TIM5) || \
  8715. ((INSTANCE) == TIM8) || \
  8716. ((INSTANCE) == TIM9) || \
  8717. ((INSTANCE) == TIM10) || \
  8718. ((INSTANCE) == TIM11) || \
  8719. ((INSTANCE) == TIM12) || \
  8720. ((INSTANCE) == TIM13) || \
  8721. ((INSTANCE) == TIM14))
  8722. /************ TIM Instances : at least 2 capture/compare channels *************/
  8723. #define IS_TIM_CC2_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  8724. ((INSTANCE) == TIM2) || \
  8725. ((INSTANCE) == TIM3) || \
  8726. ((INSTANCE) == TIM4) || \
  8727. ((INSTANCE) == TIM5) || \
  8728. ((INSTANCE) == TIM8) || \
  8729. ((INSTANCE) == TIM9) || \
  8730. ((INSTANCE) == TIM12))
  8731. /************ TIM Instances : at least 3 capture/compare channels *************/
  8732. #define IS_TIM_CC3_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  8733. ((INSTANCE) == TIM2) || \
  8734. ((INSTANCE) == TIM3) || \
  8735. ((INSTANCE) == TIM4) || \
  8736. ((INSTANCE) == TIM5) || \
  8737. ((INSTANCE) == TIM8))
  8738. /************ TIM Instances : at least 4 capture/compare channels *************/
  8739. #define IS_TIM_CC4_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  8740. ((INSTANCE) == TIM2) || \
  8741. ((INSTANCE) == TIM3) || \
  8742. ((INSTANCE) == TIM4) || \
  8743. ((INSTANCE) == TIM5) || \
  8744. ((INSTANCE) == TIM8))
  8745. /******************** TIM Instances : Advanced-control timers *****************/
  8746. #define IS_TIM_ADVANCED_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  8747. ((INSTANCE) == TIM8))
  8748. /******************* TIM Instances : Timer input XOR function *****************/
  8749. #define IS_TIM_XOR_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  8750. ((INSTANCE) == TIM2) || \
  8751. ((INSTANCE) == TIM3) || \
  8752. ((INSTANCE) == TIM4) || \
  8753. ((INSTANCE) == TIM5) || \
  8754. ((INSTANCE) == TIM8))
  8755. /****************** TIM Instances : DMA requests generation (UDE) *************/
  8756. #define IS_TIM_DMA_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  8757. ((INSTANCE) == TIM2) || \
  8758. ((INSTANCE) == TIM3) || \
  8759. ((INSTANCE) == TIM4) || \
  8760. ((INSTANCE) == TIM5) || \
  8761. ((INSTANCE) == TIM6) || \
  8762. ((INSTANCE) == TIM7) || \
  8763. ((INSTANCE) == TIM8))
  8764. /************ TIM Instances : DMA requests generation (CCxDE) *****************/
  8765. #define IS_TIM_DMA_CC_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  8766. ((INSTANCE) == TIM2) || \
  8767. ((INSTANCE) == TIM3) || \
  8768. ((INSTANCE) == TIM4) || \
  8769. ((INSTANCE) == TIM5) || \
  8770. ((INSTANCE) == TIM8))
  8771. /************ TIM Instances : DMA requests generation (COMDE) *****************/
  8772. #define IS_TIM_CCDMA_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  8773. ((INSTANCE) == TIM2) || \
  8774. ((INSTANCE) == TIM3) || \
  8775. ((INSTANCE) == TIM4) || \
  8776. ((INSTANCE) == TIM5) || \
  8777. ((INSTANCE) == TIM8))
  8778. /******************** TIM Instances : DMA burst feature ***********************/
  8779. #define IS_TIM_DMABURST_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  8780. ((INSTANCE) == TIM2) || \
  8781. ((INSTANCE) == TIM3) || \
  8782. ((INSTANCE) == TIM4) || \
  8783. ((INSTANCE) == TIM5) || \
  8784. ((INSTANCE) == TIM8))
  8785. /****** TIM Instances : master mode available (TIMx_CR2.MMS available )********/
  8786. #define IS_TIM_MASTER_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  8787. ((INSTANCE) == TIM2) || \
  8788. ((INSTANCE) == TIM3) || \
  8789. ((INSTANCE) == TIM4) || \
  8790. ((INSTANCE) == TIM5) || \
  8791. ((INSTANCE) == TIM6) || \
  8792. ((INSTANCE) == TIM7) || \
  8793. ((INSTANCE) == TIM8) || \
  8794. ((INSTANCE) == TIM9) || \
  8795. ((INSTANCE) == TIM12))
  8796. /*********** TIM Instances : Slave mode available (TIMx_SMCR available )*******/
  8797. #define IS_TIM_SLAVE_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  8798. ((INSTANCE) == TIM2) || \
  8799. ((INSTANCE) == TIM3) || \
  8800. ((INSTANCE) == TIM4) || \
  8801. ((INSTANCE) == TIM5) || \
  8802. ((INSTANCE) == TIM8) || \
  8803. ((INSTANCE) == TIM9) || \
  8804. ((INSTANCE) == TIM12))
  8805. /********************** TIM Instances : 32 bit Counter ************************/
  8806. #define IS_TIM_32B_COUNTER_INSTANCE(INSTANCE)(((INSTANCE) == TIM2) || \
  8807. ((INSTANCE) == TIM5))
  8808. /***************** TIM Instances : external trigger input availabe ************/
  8809. #define IS_TIM_ETR_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  8810. ((INSTANCE) == TIM2) || \
  8811. ((INSTANCE) == TIM3) || \
  8812. ((INSTANCE) == TIM4) || \
  8813. ((INSTANCE) == TIM5) || \
  8814. ((INSTANCE) == TIM8))
  8815. /****************** TIM Instances : remapping capability **********************/
  8816. #define IS_TIM_REMAP_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  8817. ((INSTANCE) == TIM5) || \
  8818. ((INSTANCE) == TIM11))
  8819. /******************* TIM Instances : output(s) available **********************/
  8820. #define IS_TIM_CCX_INSTANCE(INSTANCE, CHANNEL) \
  8821. ((((INSTANCE) == TIM1) && \
  8822. (((CHANNEL) == TIM_CHANNEL_1) || \
  8823. ((CHANNEL) == TIM_CHANNEL_2) || \
  8824. ((CHANNEL) == TIM_CHANNEL_3) || \
  8825. ((CHANNEL) == TIM_CHANNEL_4))) \
  8826. || \
  8827. (((INSTANCE) == TIM2) && \
  8828. (((CHANNEL) == TIM_CHANNEL_1) || \
  8829. ((CHANNEL) == TIM_CHANNEL_2) || \
  8830. ((CHANNEL) == TIM_CHANNEL_3) || \
  8831. ((CHANNEL) == TIM_CHANNEL_4))) \
  8832. || \
  8833. (((INSTANCE) == TIM3) && \
  8834. (((CHANNEL) == TIM_CHANNEL_1) || \
  8835. ((CHANNEL) == TIM_CHANNEL_2) || \
  8836. ((CHANNEL) == TIM_CHANNEL_3) || \
  8837. ((CHANNEL) == TIM_CHANNEL_4))) \
  8838. || \
  8839. (((INSTANCE) == TIM4) && \
  8840. (((CHANNEL) == TIM_CHANNEL_1) || \
  8841. ((CHANNEL) == TIM_CHANNEL_2) || \
  8842. ((CHANNEL) == TIM_CHANNEL_3) || \
  8843. ((CHANNEL) == TIM_CHANNEL_4))) \
  8844. || \
  8845. (((INSTANCE) == TIM5) && \
  8846. (((CHANNEL) == TIM_CHANNEL_1) || \
  8847. ((CHANNEL) == TIM_CHANNEL_2) || \
  8848. ((CHANNEL) == TIM_CHANNEL_3) || \
  8849. ((CHANNEL) == TIM_CHANNEL_4))) \
  8850. || \
  8851. (((INSTANCE) == TIM8) && \
  8852. (((CHANNEL) == TIM_CHANNEL_1) || \
  8853. ((CHANNEL) == TIM_CHANNEL_2) || \
  8854. ((CHANNEL) == TIM_CHANNEL_3) || \
  8855. ((CHANNEL) == TIM_CHANNEL_4))) \
  8856. || \
  8857. (((INSTANCE) == TIM9) && \
  8858. (((CHANNEL) == TIM_CHANNEL_1) || \
  8859. ((CHANNEL) == TIM_CHANNEL_2))) \
  8860. || \
  8861. (((INSTANCE) == TIM10) && \
  8862. (((CHANNEL) == TIM_CHANNEL_1))) \
  8863. || \
  8864. (((INSTANCE) == TIM11) && \
  8865. (((CHANNEL) == TIM_CHANNEL_1))) \
  8866. || \
  8867. (((INSTANCE) == TIM12) && \
  8868. (((CHANNEL) == TIM_CHANNEL_1) || \
  8869. ((CHANNEL) == TIM_CHANNEL_2))) \
  8870. || \
  8871. (((INSTANCE) == TIM13) && \
  8872. (((CHANNEL) == TIM_CHANNEL_1))) \
  8873. || \
  8874. (((INSTANCE) == TIM14) && \
  8875. (((CHANNEL) == TIM_CHANNEL_1))))
  8876. /************ TIM Instances : complementary output(s) available ***************/
  8877. #define IS_TIM_CCXN_INSTANCE(INSTANCE, CHANNEL) \
  8878. ((((INSTANCE) == TIM1) && \
  8879. (((CHANNEL) == TIM_CHANNEL_1) || \
  8880. ((CHANNEL) == TIM_CHANNEL_2) || \
  8881. ((CHANNEL) == TIM_CHANNEL_3))) \
  8882. || \
  8883. (((INSTANCE) == TIM8) && \
  8884. (((CHANNEL) == TIM_CHANNEL_1) || \
  8885. ((CHANNEL) == TIM_CHANNEL_2) || \
  8886. ((CHANNEL) == TIM_CHANNEL_3))))
  8887. /******************** USART Instances : Synchronous mode **********************/
  8888. #define IS_USART_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  8889. ((INSTANCE) == USART2) || \
  8890. ((INSTANCE) == USART3) || \
  8891. ((INSTANCE) == USART6))
  8892. /******************** UART Instances : Asynchronous mode **********************/
  8893. #define IS_UART_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  8894. ((INSTANCE) == USART2) || \
  8895. ((INSTANCE) == USART3) || \
  8896. ((INSTANCE) == UART4) || \
  8897. ((INSTANCE) == UART5) || \
  8898. ((INSTANCE) == USART6) || \
  8899. ((INSTANCE) == UART7) || \
  8900. ((INSTANCE) == UART8))
  8901. /****************** UART Instances : Hardware Flow control ********************/
  8902. #define IS_UART_HWFLOW_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  8903. ((INSTANCE) == USART2) || \
  8904. ((INSTANCE) == USART3) || \
  8905. ((INSTANCE) == USART6))
  8906. /********************* UART Instances : Smard card mode ***********************/
  8907. #define IS_SMARTCARD_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  8908. ((INSTANCE) == USART2) || \
  8909. ((INSTANCE) == USART3) || \
  8910. ((INSTANCE) == USART6))
  8911. /*********************** UART Instances : IRDA mode ***************************/
  8912. #define IS_IRDA_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  8913. ((INSTANCE) == USART2) || \
  8914. ((INSTANCE) == USART3) || \
  8915. ((INSTANCE) == UART4) || \
  8916. ((INSTANCE) == UART5) || \
  8917. ((INSTANCE) == USART6) || \
  8918. ((INSTANCE) == UART7) || \
  8919. ((INSTANCE) == UART8))
  8920. /*********************** PCD Instances ****************************************/
  8921. #define IS_PCD_ALL_INSTANCE(INSTANCE) (((INSTANCE) == USB_OTG_FS) || \
  8922. ((INSTANCE) == USB_OTG_HS))
  8923. /*********************** HCD Instances ****************************************/
  8924. #define IS_HCD_ALL_INSTANCE(INSTANCE) (((INSTANCE) == USB_OTG_FS) || \
  8925. ((INSTANCE) == USB_OTG_HS))
  8926. /****************************** SDIO Instances ********************************/
  8927. #define IS_SDIO_ALL_INSTANCE(INSTANCE) ((INSTANCE) == SDIO)
  8928. /****************************** IWDG Instances ********************************/
  8929. #define IS_IWDG_ALL_INSTANCE(INSTANCE) ((INSTANCE) == IWDG)
  8930. /****************************** WWDG Instances ********************************/
  8931. #define IS_WWDG_ALL_INSTANCE(INSTANCE) ((INSTANCE) == WWDG)
  8932. /****************************** QSPI Instances ********************************/
  8933. #define IS_QSPI_ALL_INSTANCE(__INSTANCE__) ((__INSTANCE__) == QUADSPI)
  8934. /****************************** USB Exported Constants ************************/
  8935. #define USB_OTG_FS_HOST_MAX_CHANNEL_NBR 12
  8936. #define USB_OTG_FS_MAX_IN_ENDPOINTS 6 /* Including EP0 */
  8937. #define USB_OTG_FS_MAX_OUT_ENDPOINTS 6 /* Including EP0 */
  8938. #define USB_OTG_FS_TOTAL_FIFO_SIZE 1280 /* in Bytes */
  8939. #define USB_OTG_HS_HOST_MAX_CHANNEL_NBR 16
  8940. #define USB_OTG_HS_MAX_IN_ENDPOINTS 8 /* Including EP0 */
  8941. #define USB_OTG_HS_MAX_IN_ENDPOINTS 8 /* Including EP0 */
  8942. #define USB_OTG_HS_TOTAL_FIFO_SIZE 4096 /* in Bytes */
  8943. /**
  8944. * @}
  8945. */
  8946. /**
  8947. * @}
  8948. */
  8949. /**
  8950. * @}
  8951. */
  8952. #ifdef __cplusplus
  8953. }
  8954. #endif /* __cplusplus */
  8955. #endif /* __STM32F469xx_H */
  8956. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/