stm32l162xc.h 422 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880
  1. /**
  2. ******************************************************************************
  3. * @file stm32l162xc.h
  4. * @author MCD Application Team
  5. * @version V2.0.0
  6. * @date 5-September-2014
  7. * @brief CMSIS Cortex-M3 Device Peripheral Access Layer Header File.
  8. * This file contains all the peripheral register's definitions, bits
  9. * definitions and memory mapping for STM32L1xx devices.
  10. *
  11. * This file contains:
  12. * - Data structures and the address mapping for all peripherals
  13. * - Peripheral's registers declarations and bits definition
  14. * - Macros to access peripheral’s registers hardware
  15. *
  16. ******************************************************************************
  17. * @attention
  18. *
  19. * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
  20. *
  21. * Redistribution and use in source and binary forms, with or without modification,
  22. * are permitted provided that the following conditions are met:
  23. * 1. Redistributions of source code must retain the above copyright notice,
  24. * this list of conditions and the following disclaimer.
  25. * 2. Redistributions in binary form must reproduce the above copyright notice,
  26. * this list of conditions and the following disclaimer in the documentation
  27. * and/or other materials provided with the distribution.
  28. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  29. * may be used to endorse or promote products derived from this software
  30. * without specific prior written permission.
  31. *
  32. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  33. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  34. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  35. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  36. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  37. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  38. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  39. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  40. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  41. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  42. *
  43. ******************************************************************************
  44. */
  45. /** @addtogroup CMSIS
  46. * @{
  47. */
  48. /** @addtogroup stm32l162xc
  49. * @{
  50. */
  51. #ifndef __STM32L162xC_H
  52. #define __STM32L162xC_H
  53. #ifdef __cplusplus
  54. extern "C" {
  55. #endif
  56. /** @addtogroup Configuration_section_for_CMSIS
  57. * @{
  58. */
  59. /**
  60. * @brief Configuration of the Cortex-M3 Processor and Core Peripherals
  61. */
  62. #define __CM3_REV 0x200 /*!< Cortex-M3 Revision r2p0 */
  63. #define __MPU_PRESENT 1 /*!< STM32L1xx provides MPU */
  64. #define __NVIC_PRIO_BITS 4 /*!< STM32L1xx uses 4 Bits for the Priority Levels */
  65. #define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
  66. /**
  67. * @}
  68. */
  69. /** @addtogroup Peripheral_interrupt_number_definition
  70. * @{
  71. */
  72. /**
  73. * @brief STM32L1xx Interrupt Number Definition, according to the selected device
  74. * in @ref Library_configuration_section
  75. */
  76. /*!< Interrupt Number Definition */
  77. typedef enum
  78. {
  79. /****** Cortex-M3 Processor Exceptions Numbers ******************************************************/
  80. NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */
  81. MemoryManagement_IRQn = -12, /*!< 4 Cortex-M3 Memory Management Interrupt */
  82. BusFault_IRQn = -11, /*!< 5 Cortex-M3 Bus Fault Interrupt */
  83. UsageFault_IRQn = -10, /*!< 6 Cortex-M3 Usage Fault Interrupt */
  84. SVC_IRQn = -5, /*!< 11 Cortex-M3 SV Call Interrupt */
  85. DebugMonitor_IRQn = -4, /*!< 12 Cortex-M3 Debug Monitor Interrupt */
  86. PendSV_IRQn = -2, /*!< 14 Cortex-M3 Pend SV Interrupt */
  87. SysTick_IRQn = -1, /*!< 15 Cortex-M3 System Tick Interrupt */
  88. /****** STM32L specific Interrupt Numbers ***********************************************************/
  89. WWDG_IRQn = 0, /*!< Window WatchDog Interrupt */
  90. PVD_IRQn = 1, /*!< PVD through EXTI Line detection Interrupt */
  91. TAMPER_STAMP_IRQn = 2, /*!< Tamper and TimeStamp interrupts through the EXTI line */
  92. RTC_WKUP_IRQn = 3, /*!< RTC Wakeup Timer through EXTI Line Interrupt */
  93. FLASH_IRQn = 4, /*!< FLASH global Interrupt */
  94. RCC_IRQn = 5, /*!< RCC global Interrupt */
  95. EXTI0_IRQn = 6, /*!< EXTI Line0 Interrupt */
  96. EXTI1_IRQn = 7, /*!< EXTI Line1 Interrupt */
  97. EXTI2_IRQn = 8, /*!< EXTI Line2 Interrupt */
  98. EXTI3_IRQn = 9, /*!< EXTI Line3 Interrupt */
  99. EXTI4_IRQn = 10, /*!< EXTI Line4 Interrupt */
  100. DMA1_Channel1_IRQn = 11, /*!< DMA1 Channel 1 global Interrupt */
  101. DMA1_Channel2_IRQn = 12, /*!< DMA1 Channel 2 global Interrupt */
  102. DMA1_Channel3_IRQn = 13, /*!< DMA1 Channel 3 global Interrupt */
  103. DMA1_Channel4_IRQn = 14, /*!< DMA1 Channel 4 global Interrupt */
  104. DMA1_Channel5_IRQn = 15, /*!< DMA1 Channel 5 global Interrupt */
  105. DMA1_Channel6_IRQn = 16, /*!< DMA1 Channel 6 global Interrupt */
  106. DMA1_Channel7_IRQn = 17, /*!< DMA1 Channel 7 global Interrupt */
  107. ADC1_IRQn = 18, /*!< ADC1 global Interrupt */
  108. USB_HP_IRQn = 19, /*!< USB High Priority Interrupt */
  109. USB_LP_IRQn = 20, /*!< USB Low Priority Interrupt */
  110. DAC_IRQn = 21, /*!< DAC Interrupt */
  111. COMP_IRQn = 22, /*!< Comparator through EXTI Line Interrupt */
  112. EXTI9_5_IRQn = 23, /*!< External Line[9:5] Interrupts */
  113. LCD_IRQn = 24, /*!< LCD Interrupt */
  114. TIM9_IRQn = 25, /*!< TIM9 global Interrupt */
  115. TIM10_IRQn = 26, /*!< TIM10 global Interrupt */
  116. TIM11_IRQn = 27, /*!< TIM11 global Interrupt */
  117. TIM2_IRQn = 28, /*!< TIM2 global Interrupt */
  118. TIM3_IRQn = 29, /*!< TIM3 global Interrupt */
  119. TIM4_IRQn = 30, /*!< TIM4 global Interrupt */
  120. I2C1_EV_IRQn = 31, /*!< I2C1 Event Interrupt */
  121. I2C1_ER_IRQn = 32, /*!< I2C1 Error Interrupt */
  122. I2C2_EV_IRQn = 33, /*!< I2C2 Event Interrupt */
  123. I2C2_ER_IRQn = 34, /*!< I2C2 Error Interrupt */
  124. SPI1_IRQn = 35, /*!< SPI1 global Interrupt */
  125. SPI2_IRQn = 36, /*!< SPI2 global Interrupt */
  126. USART1_IRQn = 37, /*!< USART1 global Interrupt */
  127. USART2_IRQn = 38, /*!< USART2 global Interrupt */
  128. USART3_IRQn = 39, /*!< USART3 global Interrupt */
  129. EXTI15_10_IRQn = 40, /*!< External Line[15:10] Interrupts */
  130. RTC_Alarm_IRQn = 41, /*!< RTC Alarm through EXTI Line Interrupt */
  131. USB_FS_WKUP_IRQn = 42, /*!< USB FS WakeUp from suspend through EXTI Line Interrupt */
  132. TIM6_IRQn = 43, /*!< TIM6 global Interrupt */
  133. TIM7_IRQn = 44, /*!< TIM7 global Interrupt */
  134. TIM5_IRQn = 46, /*!< TIM5 global Interrupt */
  135. SPI3_IRQn = 47, /*!< SPI3 global Interrupt */
  136. DMA2_Channel1_IRQn = 50, /*!< DMA2 Channel 1 global Interrupt */
  137. DMA2_Channel2_IRQn = 51, /*!< DMA2 Channel 2 global Interrupt */
  138. DMA2_Channel3_IRQn = 52, /*!< DMA2 Channel 3 global Interrupt */
  139. DMA2_Channel4_IRQn = 53, /*!< DMA2 Channel 4 global Interrupt */
  140. DMA2_Channel5_IRQn = 54, /*!< DMA2 Channel 5 global Interrupt */
  141. AES_IRQn = 55, /*!< AES global Interrupt */
  142. COMP_ACQ_IRQn = 56 /*!< Comparator Channel Acquisition global Interrupt */
  143. } IRQn_Type;
  144. /**
  145. * @}
  146. */
  147. #include "core_cm3.h"
  148. #include "system_stm32l1xx.h"
  149. #include <stdint.h>
  150. /** @addtogroup Peripheral_registers_structures
  151. * @{
  152. */
  153. /**
  154. * @brief Analog to Digital Converter
  155. */
  156. typedef struct
  157. {
  158. __IO uint32_t SR; /*!< ADC status register, Address offset: 0x00 */
  159. __IO uint32_t CR1; /*!< ADC control register 1, Address offset: 0x04 */
  160. __IO uint32_t CR2; /*!< ADC control register 2, Address offset: 0x08 */
  161. __IO uint32_t SMPR1; /*!< ADC sample time register 1, Address offset: 0x0C */
  162. __IO uint32_t SMPR2; /*!< ADC sample time register 2, Address offset: 0x10 */
  163. __IO uint32_t SMPR3; /*!< ADC sample time register 3, Address offset: 0x14 */
  164. __IO uint32_t JOFR1; /*!< ADC injected channel data offset register 1, Address offset: 0x18 */
  165. __IO uint32_t JOFR2; /*!< ADC injected channel data offset register 2, Address offset: 0x1C */
  166. __IO uint32_t JOFR3; /*!< ADC injected channel data offset register 3, Address offset: 0x20 */
  167. __IO uint32_t JOFR4; /*!< ADC injected channel data offset register 4, Address offset: 0x24 */
  168. __IO uint32_t HTR; /*!< ADC watchdog higher threshold register, Address offset: 0x28 */
  169. __IO uint32_t LTR; /*!< ADC watchdog lower threshold register, Address offset: 0x2C */
  170. __IO uint32_t SQR1; /*!< ADC regular sequence register 1, Address offset: 0x30 */
  171. __IO uint32_t SQR2; /*!< ADC regular sequence register 2, Address offset: 0x34 */
  172. __IO uint32_t SQR3; /*!< ADC regular sequence register 3, Address offset: 0x38 */
  173. __IO uint32_t SQR4; /*!< ADC regular sequence register 4, Address offset: 0x3C */
  174. __IO uint32_t SQR5; /*!< ADC regular sequence register 5, Address offset: 0x40 */
  175. __IO uint32_t JSQR; /*!< ADC injected sequence register, Address offset: 0x44 */
  176. __IO uint32_t JDR1; /*!< ADC injected data register 1, Address offset: 0x48 */
  177. __IO uint32_t JDR2; /*!< ADC injected data register 2, Address offset: 0x4C */
  178. __IO uint32_t JDR3; /*!< ADC injected data register 3, Address offset: 0x50 */
  179. __IO uint32_t JDR4; /*!< ADC injected data register 4, Address offset: 0x54 */
  180. __IO uint32_t DR; /*!< ADC regular data register, Address offset: 0x58 */
  181. uint32_t RESERVED; /*!< Reserved, Address offset: 0x5C */
  182. } ADC_TypeDef;
  183. typedef struct
  184. {
  185. __IO uint32_t CSR; /*!< ADC common status register, Address offset: ADC1 base address + 0x300 */
  186. __IO uint32_t CCR; /*!< ADC common control register, Address offset: ADC1 base address + 0x304 */
  187. } ADC_Common_TypeDef;
  188. /**
  189. * @brief AES hardware accelerator
  190. */
  191. typedef struct
  192. {
  193. __IO uint32_t CR; /*!< AES control register, Address offset: 0x00 */
  194. __IO uint32_t SR; /*!< AES status register, Address offset: 0x04 */
  195. __IO uint32_t DINR; /*!< AES data input register, Address offset: 0x08 */
  196. __IO uint32_t DOUTR; /*!< AES data output register, Address offset: 0x0C */
  197. __IO uint32_t KEYR0; /*!< AES key register 0, Address offset: 0x10 */
  198. __IO uint32_t KEYR1; /*!< AES key register 1, Address offset: 0x14 */
  199. __IO uint32_t KEYR2; /*!< AES key register 2, Address offset: 0x18 */
  200. __IO uint32_t KEYR3; /*!< AES key register 3, Address offset: 0x1C */
  201. __IO uint32_t IVR0; /*!< AES initialization vector register 0, Address offset: 0x20 */
  202. __IO uint32_t IVR1; /*!< AES initialization vector register 1, Address offset: 0x24 */
  203. __IO uint32_t IVR2; /*!< AES initialization vector register 2, Address offset: 0x28 */
  204. __IO uint32_t IVR3; /*!< AES initialization vector register 3, Address offset: 0x2C */
  205. } AES_TypeDef;
  206. /**
  207. * @brief Comparator
  208. */
  209. typedef struct
  210. {
  211. __IO uint32_t CSR; /*!< COMP comparator control and status register, Address offset: 0x00 */
  212. } COMP_TypeDef;
  213. /**
  214. * @brief CRC calculation unit
  215. */
  216. typedef struct
  217. {
  218. __IO uint32_t DR; /*!< CRC Data register, Address offset: 0x00 */
  219. __IO uint32_t IDR; /*!< CRC Independent data register, Address offset: 0x04 */
  220. __IO uint32_t CR; /*!< CRC Control register, Address offset: 0x08 */
  221. } CRC_TypeDef;
  222. /**
  223. * @brief Digital to Analog Converter
  224. */
  225. typedef struct
  226. {
  227. __IO uint32_t CR; /*!< DAC control register, Address offset: 0x00 */
  228. __IO uint32_t SWTRIGR; /*!< DAC software trigger register, Address offset: 0x04 */
  229. __IO uint32_t DHR12R1; /*!< DAC channel1 12-bit right-aligned data holding register, Address offset: 0x08 */
  230. __IO uint32_t DHR12L1; /*!< DAC channel1 12-bit left aligned data holding register, Address offset: 0x0C */
  231. __IO uint32_t DHR8R1; /*!< DAC channel1 8-bit right aligned data holding register, Address offset: 0x10 */
  232. __IO uint32_t DHR12R2; /*!< DAC channel2 12-bit right aligned data holding register, Address offset: 0x14 */
  233. __IO uint32_t DHR12L2; /*!< DAC channel2 12-bit left aligned data holding register, Address offset: 0x18 */
  234. __IO uint32_t DHR8R2; /*!< DAC channel2 8-bit right-aligned data holding register, Address offset: 0x1C */
  235. __IO uint32_t DHR12RD; /*!< Dual DAC 12-bit right-aligned data holding register, Address offset: 0x20 */
  236. __IO uint32_t DHR12LD; /*!< DUAL DAC 12-bit left aligned data holding register, Address offset: 0x24 */
  237. __IO uint32_t DHR8RD; /*!< DUAL DAC 8-bit right aligned data holding register, Address offset: 0x28 */
  238. __IO uint32_t DOR1; /*!< DAC channel1 data output register, Address offset: 0x2C */
  239. __IO uint32_t DOR2; /*!< DAC channel2 data output register, Address offset: 0x30 */
  240. __IO uint32_t SR; /*!< DAC status register, Address offset: 0x34 */
  241. } DAC_TypeDef;
  242. /**
  243. * @brief Debug MCU
  244. */
  245. typedef struct
  246. {
  247. __IO uint32_t IDCODE; /*!< MCU device ID code, Address offset: 0x00 */
  248. __IO uint32_t CR; /*!< Debug MCU configuration register, Address offset: 0x04 */
  249. __IO uint32_t APB1FZ; /*!< Debug MCU APB1 freeze register, Address offset: 0x08 */
  250. __IO uint32_t APB2FZ; /*!< Debug MCU APB2 freeze register, Address offset: 0x0C */
  251. }DBGMCU_TypeDef;
  252. /**
  253. * @brief DMA Controller
  254. */
  255. typedef struct
  256. {
  257. __IO uint32_t CCR; /*!< DMA channel x configuration register */
  258. __IO uint32_t CNDTR; /*!< DMA channel x number of data register */
  259. __IO uint32_t CPAR; /*!< DMA channel x peripheral address register */
  260. __IO uint32_t CMAR; /*!< DMA channel x memory address register */
  261. } DMA_Channel_TypeDef;
  262. typedef struct
  263. {
  264. __IO uint32_t ISR; /*!< DMA interrupt status register, Address offset: 0x00 */
  265. __IO uint32_t IFCR; /*!< DMA interrupt flag clear register, Address offset: 0x04 */
  266. } DMA_TypeDef;
  267. /**
  268. * @brief External Interrupt/Event Controller
  269. */
  270. typedef struct
  271. {
  272. __IO uint32_t IMR; /*!<EXTI Interrupt mask register, Address offset: 0x00 */
  273. __IO uint32_t EMR; /*!<EXTI Event mask register, Address offset: 0x04 */
  274. __IO uint32_t RTSR; /*!<EXTI Rising trigger selection register , Address offset: 0x08 */
  275. __IO uint32_t FTSR; /*!<EXTI Falling trigger selection register, Address offset: 0x0C */
  276. __IO uint32_t SWIER; /*!<EXTI Software interrupt event register, Address offset: 0x10 */
  277. __IO uint32_t PR; /*!<EXTI Pending register, Address offset: 0x14 */
  278. } EXTI_TypeDef;
  279. /**
  280. * @brief FLASH Registers
  281. */
  282. typedef struct
  283. {
  284. __IO uint32_t ACR; /*!< Access control register, Address offset: 0x00 */
  285. __IO uint32_t PECR; /*!< Program/erase control register, Address offset: 0x04 */
  286. __IO uint32_t PDKEYR; /*!< Power down key register, Address offset: 0x08 */
  287. __IO uint32_t PEKEYR; /*!< Program/erase key register, Address offset: 0x0c */
  288. __IO uint32_t PRGKEYR; /*!< Program memory key register, Address offset: 0x10 */
  289. __IO uint32_t OPTKEYR; /*!< Option byte key register, Address offset: 0x14 */
  290. __IO uint32_t SR; /*!< Status register, Address offset: 0x18 */
  291. __IO uint32_t OBR; /*!< Option byte register, Address offset: 0x1c */
  292. __IO uint32_t WRPR1; /*!< Write protection register 1, Address offset: 0x20 */
  293. uint32_t RESERVED[23]; /*!< Reserved, Address offset: 0x24 */
  294. __IO uint32_t WRPR2; /*!< Write protection register 2, Address offset: 0x80 */
  295. } FLASH_TypeDef;
  296. /**
  297. * @brief Option Bytes Registers
  298. */
  299. typedef struct
  300. {
  301. __IO uint32_t RDP; /*!< Read protection register, Address offset: 0x00 */
  302. __IO uint32_t USER; /*!< user register, Address offset: 0x04 */
  303. __IO uint32_t WRP01; /*!< write protection register 0 1, Address offset: 0x08 */
  304. __IO uint32_t WRP23; /*!< write protection register 2 3, Address offset: 0x0C */
  305. __IO uint32_t WRP45; /*!< write protection register 4 5, Address offset: 0x10 */
  306. __IO uint32_t WRP67; /*!< write protection register 6 7, Address offset: 0x14 */
  307. } OB_TypeDef;
  308. /**
  309. * @brief Operational Amplifier (OPAMP)
  310. */
  311. typedef struct
  312. {
  313. __IO uint32_t CSR; /*!< OPAMP control/status register, Address offset: 0x00 */
  314. __IO uint32_t OTR; /*!< OPAMP offset trimming register for normal mode, Address offset: 0x04 */
  315. __IO uint32_t LPOTR; /*!< OPAMP offset trimming register for low power mode, Address offset: 0x08 */
  316. } OPAMP_TypeDef;
  317. /**
  318. * @brief General Purpose IO
  319. */
  320. typedef struct
  321. {
  322. __IO uint32_t MODER; /*!< GPIO port mode register, Address offset: 0x00 */
  323. __IO uint32_t OTYPER; /*!< GPIO port output type register, Address offset: 0x04 */
  324. __IO uint32_t OSPEEDR; /*!< GPIO port output speed register, Address offset: 0x08 */
  325. __IO uint32_t PUPDR; /*!< GPIO port pull-up/pull-down register, Address offset: 0x0C */
  326. __IO uint32_t IDR; /*!< GPIO port input data register, Address offset: 0x10 */
  327. __IO uint32_t ODR; /*!< GPIO port output data register, Address offset: 0x14 */
  328. __IO uint32_t BSRR; /*!< GPIO port bit set/reset registerBSRR, Address offset: 0x18 */
  329. __IO uint32_t LCKR; /*!< GPIO port configuration lock register, Address offset: 0x1C */
  330. __IO uint32_t AFR[2]; /*!< GPIO alternate function register, Address offset: 0x20-0x24 */
  331. __IO uint32_t BRR; /*!< GPIO bit reset register, Address offset: 0x28 */
  332. } GPIO_TypeDef;
  333. /**
  334. * @brief SysTem Configuration
  335. */
  336. typedef struct
  337. {
  338. __IO uint32_t MEMRMP; /*!< SYSCFG memory remap register, Address offset: 0x00 */
  339. __IO uint32_t PMC; /*!< SYSCFG peripheral mode configuration register, Address offset: 0x04 */
  340. __IO uint32_t EXTICR[4]; /*!< SYSCFG external interrupt configuration registers, Address offset: 0x08-0x14 */
  341. } SYSCFG_TypeDef;
  342. /**
  343. * @brief Inter-integrated Circuit Interface
  344. */
  345. typedef struct
  346. {
  347. __IO uint32_t CR1; /*!< I2C Control register 1, Address offset: 0x00 */
  348. __IO uint32_t CR2; /*!< I2C Control register 2, Address offset: 0x04 */
  349. __IO uint32_t OAR1; /*!< I2C Own address register 1, Address offset: 0x08 */
  350. __IO uint32_t OAR2; /*!< I2C Own address register 2, Address offset: 0x0C */
  351. __IO uint32_t DR; /*!< I2C Data register, Address offset: 0x10 */
  352. __IO uint32_t SR1; /*!< I2C Status register 1, Address offset: 0x14 */
  353. __IO uint32_t SR2; /*!< I2C Status register 2, Address offset: 0x18 */
  354. __IO uint32_t CCR; /*!< I2C Clock control register, Address offset: 0x1C */
  355. __IO uint32_t TRISE; /*!< I2C TRISE register, Address offset: 0x20 */
  356. } I2C_TypeDef;
  357. /**
  358. * @brief Independent WATCHDOG
  359. */
  360. typedef struct
  361. {
  362. __IO uint32_t KR; /*!< Key register, Address offset: 0x00 */
  363. __IO uint32_t PR; /*!< Prescaler register, Address offset: 0x04 */
  364. __IO uint32_t RLR; /*!< Reload register, Address offset: 0x08 */
  365. __IO uint32_t SR; /*!< Status register, Address offset: 0x0C */
  366. } IWDG_TypeDef;
  367. /**
  368. * @brief LCD
  369. */
  370. typedef struct
  371. {
  372. __IO uint32_t CR; /*!< LCD control register, Address offset: 0x00 */
  373. __IO uint32_t FCR; /*!< LCD frame control register, Address offset: 0x04 */
  374. __IO uint32_t SR; /*!< LCD status register, Address offset: 0x08 */
  375. __IO uint32_t CLR; /*!< LCD clear register, Address offset: 0x0C */
  376. uint32_t RESERVED; /*!< Reserved, Address offset: 0x10 */
  377. __IO uint32_t RAM[16]; /*!< LCD display memory, Address offset: 0x14-0x50 */
  378. } LCD_TypeDef;
  379. /**
  380. * @brief Power Control
  381. */
  382. typedef struct
  383. {
  384. __IO uint32_t CR; /*!< PWR power control register, Address offset: 0x00 */
  385. __IO uint32_t CSR; /*!< PWR power control/status register, Address offset: 0x04 */
  386. } PWR_TypeDef;
  387. /**
  388. * @brief Reset and Clock Control
  389. */
  390. typedef struct
  391. {
  392. __IO uint32_t CR; /*!< RCC clock control register, Address offset: 0x00 */
  393. __IO uint32_t ICSCR; /*!< RCC Internal clock sources calibration register, Address offset: 0x04 */
  394. __IO uint32_t CFGR; /*!< RCC Clock configuration register, Address offset: 0x08 */
  395. __IO uint32_t CIR; /*!< RCC Clock interrupt register, Address offset: 0x0C */
  396. __IO uint32_t AHBRSTR; /*!< RCC AHB peripheral reset register, Address offset: 0x10 */
  397. __IO uint32_t APB2RSTR; /*!< RCC APB2 peripheral reset register, Address offset: 0x14 */
  398. __IO uint32_t APB1RSTR; /*!< RCC APB1 peripheral reset register, Address offset: 0x18 */
  399. __IO uint32_t AHBENR; /*!< RCC AHB peripheral clock enable register, Address offset: 0x1C */
  400. __IO uint32_t APB2ENR; /*!< RCC APB2 peripheral clock enable register, Address offset: 0x20 */
  401. __IO uint32_t APB1ENR; /*!< RCC APB1 peripheral clock enable register, Address offset: 0x24 */
  402. __IO uint32_t AHBLPENR; /*!< RCC AHB peripheral clock enable in low power mode register, Address offset: 0x28 */
  403. __IO uint32_t APB2LPENR; /*!< RCC APB2 peripheral clock enable in low power mode register, Address offset: 0x2C */
  404. __IO uint32_t APB1LPENR; /*!< RCC APB1 peripheral clock enable in low power mode register, Address offset: 0x30 */
  405. __IO uint32_t CSR; /*!< RCC Control/status register, Address offset: 0x34 */
  406. } RCC_TypeDef;
  407. /**
  408. * @brief Routing Interface
  409. */
  410. typedef struct
  411. {
  412. __IO uint32_t ICR; /*!< RI input capture register, Address offset: 0x00 */
  413. __IO uint32_t ASCR1; /*!< RI analog switches control register, Address offset: 0x04 */
  414. __IO uint32_t ASCR2; /*!< RI analog switch control register 2, Address offset: 0x08 */
  415. __IO uint32_t HYSCR1; /*!< RI hysteresis control register, Address offset: 0x0C */
  416. __IO uint32_t HYSCR2; /*!< RI Hysteresis control register, Address offset: 0x10 */
  417. __IO uint32_t HYSCR3; /*!< RI Hysteresis control register, Address offset: 0x14 */
  418. uint32_t RESERVED1; /*!< Reserved, 0x18 */
  419. __IO uint32_t ASMR1; /*!< RI Analog switch mode register 1, Address offset: 0x1C */
  420. __IO uint32_t CMR1; /*!< RI Channel mask register 1, Address offset: 0x20 */
  421. __IO uint32_t CICR1; /*!< RI Channel Iden for capture register 1, Address offset: 0x24 */
  422. __IO uint32_t ASMR2; /*!< RI Analog switch mode register 2, Address offset: 0x28 */
  423. __IO uint32_t CMR2; /*!< RI Channel mask register 2, Address offset: 0x2C */
  424. __IO uint32_t CICR2; /*!< RI Channel Iden for capture register 2, Address offset: 0x30 */
  425. __IO uint32_t ASMR3; /*!< RI Analog switch mode register 3, Address offset: 0x34 */
  426. __IO uint32_t CMR3; /*!< RI Channel mask register 3, Address offset: 0x38 */
  427. __IO uint32_t CICR3; /*!< RI Channel Iden for capture register 3, Address offset: 0x3C */
  428. } RI_TypeDef;
  429. /**
  430. * @brief Real-Time Clock
  431. */
  432. typedef struct
  433. {
  434. __IO uint32_t TR; /*!< RTC time register, Address offset: 0x00 */
  435. __IO uint32_t DR; /*!< RTC date register, Address offset: 0x04 */
  436. __IO uint32_t CR; /*!< RTC control register, Address offset: 0x08 */
  437. __IO uint32_t ISR; /*!< RTC initialization and status register, Address offset: 0x0C */
  438. __IO uint32_t PRER; /*!< RTC prescaler register, Address offset: 0x10 */
  439. __IO uint32_t WUTR; /*!< RTC wakeup timer register, Address offset: 0x14 */
  440. __IO uint32_t CALIBR; /*!< RTC calibration register, Address offset: 0x18 */
  441. __IO uint32_t ALRMAR; /*!< RTC alarm A register, Address offset: 0x1C */
  442. __IO uint32_t ALRMBR; /*!< RTC alarm B register, Address offset: 0x20 */
  443. __IO uint32_t WPR; /*!< RTC write protection register, Address offset: 0x24 */
  444. __IO uint32_t SSR; /*!< RTC sub second register, Address offset: 0x28 */
  445. __IO uint32_t SHIFTR; /*!< RTC shift control register, Address offset: 0x2C */
  446. __IO uint32_t TSTR; /*!< RTC time stamp time register, Address offset: 0x30 */
  447. __IO uint32_t TSDR; /*!< RTC time stamp date register, Address offset: 0x34 */
  448. __IO uint32_t TSSSR; /*!< RTC time-stamp sub second register, Address offset: 0x38 */
  449. __IO uint32_t CALR; /*!< RRTC calibration register, Address offset: 0x3C */
  450. __IO uint32_t TAFCR; /*!< RTC tamper and alternate function configuration register, Address offset: 0x40 */
  451. __IO uint32_t ALRMASSR; /*!< RTC alarm A sub second register, Address offset: 0x44 */
  452. __IO uint32_t ALRMBSSR; /*!< RTC alarm B sub second register, Address offset: 0x48 */
  453. uint32_t RESERVED7; /*!< Reserved, 0x4C */
  454. __IO uint32_t BKP0R; /*!< RTC backup register 0, Address offset: 0x50 */
  455. __IO uint32_t BKP1R; /*!< RTC backup register 1, Address offset: 0x54 */
  456. __IO uint32_t BKP2R; /*!< RTC backup register 2, Address offset: 0x58 */
  457. __IO uint32_t BKP3R; /*!< RTC backup register 3, Address offset: 0x5C */
  458. __IO uint32_t BKP4R; /*!< RTC backup register 4, Address offset: 0x60 */
  459. __IO uint32_t BKP5R; /*!< RTC backup register 5, Address offset: 0x64 */
  460. __IO uint32_t BKP6R; /*!< RTC backup register 6, Address offset: 0x68 */
  461. __IO uint32_t BKP7R; /*!< RTC backup register 7, Address offset: 0x6C */
  462. __IO uint32_t BKP8R; /*!< RTC backup register 8, Address offset: 0x70 */
  463. __IO uint32_t BKP9R; /*!< RTC backup register 9, Address offset: 0x74 */
  464. __IO uint32_t BKP10R; /*!< RTC backup register 10, Address offset: 0x78 */
  465. __IO uint32_t BKP11R; /*!< RTC backup register 11, Address offset: 0x7C */
  466. __IO uint32_t BKP12R; /*!< RTC backup register 12, Address offset: 0x80 */
  467. __IO uint32_t BKP13R; /*!< RTC backup register 13, Address offset: 0x84 */
  468. __IO uint32_t BKP14R; /*!< RTC backup register 14, Address offset: 0x88 */
  469. __IO uint32_t BKP15R; /*!< RTC backup register 15, Address offset: 0x8C */
  470. __IO uint32_t BKP16R; /*!< RTC backup register 16, Address offset: 0x90 */
  471. __IO uint32_t BKP17R; /*!< RTC backup register 17, Address offset: 0x94 */
  472. __IO uint32_t BKP18R; /*!< RTC backup register 18, Address offset: 0x98 */
  473. __IO uint32_t BKP19R; /*!< RTC backup register 19, Address offset: 0x9C */
  474. __IO uint32_t BKP20R; /*!< RTC backup register 20, Address offset: 0xA0 */
  475. __IO uint32_t BKP21R; /*!< RTC backup register 21, Address offset: 0xA4 */
  476. __IO uint32_t BKP22R; /*!< RTC backup register 22, Address offset: 0xA8 */
  477. __IO uint32_t BKP23R; /*!< RTC backup register 23, Address offset: 0xAC */
  478. __IO uint32_t BKP24R; /*!< RTC backup register 24, Address offset: 0xB0 */
  479. __IO uint32_t BKP25R; /*!< RTC backup register 25, Address offset: 0xB4 */
  480. __IO uint32_t BKP26R; /*!< RTC backup register 26, Address offset: 0xB8 */
  481. __IO uint32_t BKP27R; /*!< RTC backup register 27, Address offset: 0xBC */
  482. __IO uint32_t BKP28R; /*!< RTC backup register 28, Address offset: 0xC0 */
  483. __IO uint32_t BKP29R; /*!< RTC backup register 29, Address offset: 0xC4 */
  484. __IO uint32_t BKP30R; /*!< RTC backup register 30, Address offset: 0xC8 */
  485. __IO uint32_t BKP31R; /*!< RTC backup register 31, Address offset: 0xCC */
  486. } RTC_TypeDef;
  487. /**
  488. * @brief Serial Peripheral Interface
  489. */
  490. typedef struct
  491. {
  492. __IO uint32_t CR1; /*!< SPI Control register 1 (not used in I2S mode), Address offset: 0x00 */
  493. __IO uint32_t CR2; /*!< SPI Control register 2, Address offset: 0x04 */
  494. __IO uint32_t SR; /*!< SPI Status register, Address offset: 0x08 */
  495. __IO uint32_t DR; /*!< SPI data register, Address offset: 0x0C */
  496. __IO uint32_t CRCPR; /*!< SPI CRC polynomial register (not used in I2S mode), Address offset: 0x10 */
  497. __IO uint32_t RXCRCR; /*!< SPI Rx CRC register (not used in I2S mode), Address offset: 0x14 */
  498. __IO uint32_t TXCRCR; /*!< SPI Tx CRC register (not used in I2S mode), Address offset: 0x18 */
  499. __IO uint32_t I2SCFGR; /*!< SPI_I2S configuration register, Address offset: 0x1C */
  500. __IO uint32_t I2SPR; /*!< SPI_I2S prescaler register, Address offset: 0x20 */
  501. } SPI_TypeDef;
  502. /**
  503. * @brief TIM
  504. */
  505. typedef struct
  506. {
  507. __IO uint32_t CR1; /*!< TIM control register 1, Address offset: 0x00 */
  508. __IO uint32_t CR2; /*!< TIM control register 2, Address offset: 0x04 */
  509. __IO uint32_t SMCR; /*!< TIM slave Mode Control register, Address offset: 0x08 */
  510. __IO uint32_t DIER; /*!< TIM DMA/interrupt enable register, Address offset: 0x0C */
  511. __IO uint32_t SR; /*!< TIM status register, Address offset: 0x10 */
  512. __IO uint32_t EGR; /*!< TIM event generation register, Address offset: 0x14 */
  513. __IO uint32_t CCMR1; /*!< TIM capture/compare mode register 1, Address offset: 0x18 */
  514. __IO uint32_t CCMR2; /*!< TIM capture/compare mode register 2, Address offset: 0x1C */
  515. __IO uint32_t CCER; /*!< TIM capture/compare enable register, Address offset: 0x20 */
  516. __IO uint32_t CNT; /*!< TIM counter register, Address offset: 0x24 */
  517. __IO uint32_t PSC; /*!< TIM prescaler register, Address offset: 0x28 */
  518. __IO uint32_t ARR; /*!< TIM auto-reload register, Address offset: 0x2C */
  519. uint32_t RESERVED12; /*!< Reserved, 0x30 */
  520. __IO uint32_t CCR1; /*!< TIM capture/compare register 1, Address offset: 0x34 */
  521. __IO uint32_t CCR2; /*!< TIM capture/compare register 2, Address offset: 0x38 */
  522. __IO uint32_t CCR3; /*!< TIM capture/compare register 3, Address offset: 0x3C */
  523. __IO uint32_t CCR4; /*!< TIM capture/compare register 4, Address offset: 0x40 */
  524. uint32_t RESERVED17; /*!< Reserved, 0x44 */
  525. __IO uint32_t DCR; /*!< TIM DMA control register, Address offset: 0x48 */
  526. __IO uint32_t DMAR; /*!< TIM DMA address for full transfer, Address offset: 0x4C */
  527. __IO uint32_t OR; /*!< TIM option register, Address offset: 0x50 */
  528. } TIM_TypeDef;
  529. /**
  530. * @brief Universal Synchronous Asynchronous Receiver Transmitter
  531. */
  532. typedef struct
  533. {
  534. __IO uint32_t SR; /*!< USART Status register, Address offset: 0x00 */
  535. __IO uint32_t DR; /*!< USART Data register, Address offset: 0x04 */
  536. __IO uint32_t BRR; /*!< USART Baud rate register, Address offset: 0x08 */
  537. __IO uint32_t CR1; /*!< USART Control register 1, Address offset: 0x0C */
  538. __IO uint32_t CR2; /*!< USART Control register 2, Address offset: 0x10 */
  539. __IO uint32_t CR3; /*!< USART Control register 3, Address offset: 0x14 */
  540. __IO uint32_t GTPR; /*!< USART Guard time and prescaler register, Address offset: 0x18 */
  541. } USART_TypeDef;
  542. /**
  543. * @brief Universal Serial Bus Full Speed Device
  544. */
  545. typedef struct
  546. {
  547. __IO uint16_t EP0R; /*!< USB Endpoint 0 register, Address offset: 0x00 */
  548. __IO uint16_t RESERVED0; /*!< Reserved */
  549. __IO uint16_t EP1R; /*!< USB Endpoint 1 register, Address offset: 0x04 */
  550. __IO uint16_t RESERVED1; /*!< Reserved */
  551. __IO uint16_t EP2R; /*!< USB Endpoint 2 register, Address offset: 0x08 */
  552. __IO uint16_t RESERVED2; /*!< Reserved */
  553. __IO uint16_t EP3R; /*!< USB Endpoint 3 register, Address offset: 0x0C */
  554. __IO uint16_t RESERVED3; /*!< Reserved */
  555. __IO uint16_t EP4R; /*!< USB Endpoint 4 register, Address offset: 0x10 */
  556. __IO uint16_t RESERVED4; /*!< Reserved */
  557. __IO uint16_t EP5R; /*!< USB Endpoint 5 register, Address offset: 0x14 */
  558. __IO uint16_t RESERVED5; /*!< Reserved */
  559. __IO uint16_t EP6R; /*!< USB Endpoint 6 register, Address offset: 0x18 */
  560. __IO uint16_t RESERVED6; /*!< Reserved */
  561. __IO uint16_t EP7R; /*!< USB Endpoint 7 register, Address offset: 0x1C */
  562. __IO uint16_t RESERVED7[17]; /*!< Reserved */
  563. __IO uint16_t CNTR; /*!< Control register, Address offset: 0x40 */
  564. __IO uint16_t RESERVED8; /*!< Reserved */
  565. __IO uint16_t ISTR; /*!< Interrupt status register, Address offset: 0x44 */
  566. __IO uint16_t RESERVED9; /*!< Reserved */
  567. __IO uint16_t FNR; /*!< Frame number register, Address offset: 0x48 */
  568. __IO uint16_t RESERVEDA; /*!< Reserved */
  569. __IO uint16_t DADDR; /*!< Device address register, Address offset: 0x4C */
  570. __IO uint16_t RESERVEDB; /*!< Reserved */
  571. __IO uint16_t BTABLE; /*!< Buffer Table address register, Address offset: 0x50 */
  572. __IO uint16_t RESERVEDC; /*!< Reserved */
  573. } USB_TypeDef;
  574. /**
  575. * @brief Window WATCHDOG
  576. */
  577. typedef struct
  578. {
  579. __IO uint32_t CR; /*!< WWDG Control register, Address offset: 0x00 */
  580. __IO uint32_t CFR; /*!< WWDG Configuration register, Address offset: 0x04 */
  581. __IO uint32_t SR; /*!< WWDG Status register, Address offset: 0x08 */
  582. } WWDG_TypeDef;
  583. /**
  584. * @brief Universal Serial Bus Full Speed Device
  585. */
  586. /**
  587. * @}
  588. */
  589. /** @addtogroup Peripheral_memory_map
  590. * @{
  591. */
  592. #define FLASH_BASE ((uint32_t)0x08000000) /*!< FLASH base address in the alias region */
  593. #define FLASH_EEPROM_BASE ((uint32_t)(FLASH_BASE + 0x80000)) /*!< FLASH EEPROM base address in the alias region */
  594. #define SRAM_BASE ((uint32_t)0x20000000) /*!< SRAM base address in the alias region */
  595. #define PERIPH_BASE ((uint32_t)0x40000000) /*!< Peripheral base address in the alias region */
  596. #define SRAM_BB_BASE ((uint32_t)0x22000000) /*!< SRAM base address in the bit-band region */
  597. #define PERIPH_BB_BASE ((uint32_t)0x42000000) /*!< Peripheral base address in the bit-band region */
  598. #define FLASH_END ((uint32_t)0x0803FFFF) /*!< Program end FLASH address for Cat3 */
  599. #define FLASH_EEPROM_END ((uint32_t)0x08081FFF) /*!< FLASH EEPROM end address (8KB) */
  600. /*!< Peripheral memory map */
  601. #define APB1PERIPH_BASE PERIPH_BASE
  602. #define APB2PERIPH_BASE (PERIPH_BASE + 0x00010000)
  603. #define AHBPERIPH_BASE (PERIPH_BASE + 0x00020000)
  604. /*!< APB1 peripherals */
  605. #define TIM2_BASE (APB1PERIPH_BASE + 0x00000000)
  606. #define TIM3_BASE (APB1PERIPH_BASE + 0x00000400)
  607. #define TIM4_BASE (APB1PERIPH_BASE + 0x00000800)
  608. #define TIM5_BASE (APB1PERIPH_BASE + 0x00000C00)
  609. #define TIM6_BASE (APB1PERIPH_BASE + 0x00001000)
  610. #define TIM7_BASE (APB1PERIPH_BASE + 0x00001400)
  611. #define LCD_BASE (APB1PERIPH_BASE + 0x00002400)
  612. #define RTC_BASE (APB1PERIPH_BASE + 0x00002800)
  613. #define WWDG_BASE (APB1PERIPH_BASE + 0x00002C00)
  614. #define IWDG_BASE (APB1PERIPH_BASE + 0x00003000)
  615. #define SPI2_BASE (APB1PERIPH_BASE + 0x00003800)
  616. #define SPI3_BASE (APB1PERIPH_BASE + 0x00003C00)
  617. #define USART2_BASE (APB1PERIPH_BASE + 0x00004400)
  618. #define USART3_BASE (APB1PERIPH_BASE + 0x00004800)
  619. #define I2C1_BASE (APB1PERIPH_BASE + 0x00005400)
  620. #define I2C2_BASE (APB1PERIPH_BASE + 0x00005800)
  621. /* USB device FS */
  622. #define USB_BASE (APB1PERIPH_BASE + 0x00005C00) /*!< USB_IP Peripheral Registers base address */
  623. #define USB_PMAADDR (APB1PERIPH_BASE + 0x00006000) /*!< USB_IP Packet Memory Area base address */
  624. /* USB device FS SRAM */
  625. #define PWR_BASE (APB1PERIPH_BASE + 0x00007000)
  626. #define DAC_BASE (APB1PERIPH_BASE + 0x00007400)
  627. #define COMP_BASE (APB1PERIPH_BASE + 0x00007C00)
  628. #define RI_BASE (APB1PERIPH_BASE + 0x00007C04)
  629. #define OPAMP_BASE (APB1PERIPH_BASE + 0x00007C5C)
  630. /*!< APB2 peripherals */
  631. #define SYSCFG_BASE (APB2PERIPH_BASE + 0x00000000)
  632. #define EXTI_BASE (APB2PERIPH_BASE + 0x00000400)
  633. #define TIM9_BASE (APB2PERIPH_BASE + 0x00000800)
  634. #define TIM10_BASE (APB2PERIPH_BASE + 0x00000C00)
  635. #define TIM11_BASE (APB2PERIPH_BASE + 0x00001000)
  636. #define ADC1_BASE (APB2PERIPH_BASE + 0x00002400)
  637. #define ADC_BASE (APB2PERIPH_BASE + 0x00002700)
  638. #define SPI1_BASE (APB2PERIPH_BASE + 0x00003000)
  639. #define USART1_BASE (APB2PERIPH_BASE + 0x00003800)
  640. /*!< AHB peripherals */
  641. #define GPIOA_BASE (AHBPERIPH_BASE + 0x00000000)
  642. #define GPIOB_BASE (AHBPERIPH_BASE + 0x00000400)
  643. #define GPIOC_BASE (AHBPERIPH_BASE + 0x00000800)
  644. #define GPIOD_BASE (AHBPERIPH_BASE + 0x00000C00)
  645. #define GPIOE_BASE (AHBPERIPH_BASE + 0x00001000)
  646. #define GPIOH_BASE (AHBPERIPH_BASE + 0x00001400)
  647. #define CRC_BASE (AHBPERIPH_BASE + 0x00003000)
  648. #define RCC_BASE (AHBPERIPH_BASE + 0x00003800)
  649. #define FLASH_R_BASE (AHBPERIPH_BASE + 0x00003C00) /*!< FLASH registers base address */
  650. #define OB_BASE ((uint32_t)0x1FF80000) /*!< FLASH Option Bytes base address */
  651. #define DMA1_BASE (AHBPERIPH_BASE + 0x00006000)
  652. #define DMA1_Channel1_BASE (DMA1_BASE + 0x00000008)
  653. #define DMA1_Channel2_BASE (DMA1_BASE + 0x0000001C)
  654. #define DMA1_Channel3_BASE (DMA1_BASE + 0x00000030)
  655. #define DMA1_Channel4_BASE (DMA1_BASE + 0x00000044)
  656. #define DMA1_Channel5_BASE (DMA1_BASE + 0x00000058)
  657. #define DMA1_Channel6_BASE (DMA1_BASE + 0x0000006C)
  658. #define DMA1_Channel7_BASE (DMA1_BASE + 0x00000080)
  659. #define DMA2_BASE (AHBPERIPH_BASE + 0x00006400)
  660. #define DMA2_Channel1_BASE (DMA2_BASE + 0x00000008)
  661. #define DMA2_Channel2_BASE (DMA2_BASE + 0x0000001C)
  662. #define DMA2_Channel3_BASE (DMA2_BASE + 0x00000030)
  663. #define DMA2_Channel4_BASE (DMA2_BASE + 0x00000044)
  664. #define DMA2_Channel5_BASE (DMA2_BASE + 0x00000058)
  665. #define AES_BASE ((uint32_t)0x50060000)
  666. #define DBGMCU_BASE ((uint32_t)0xE0042000) /*!< Debug MCU registers base address */
  667. /**
  668. * @}
  669. */
  670. /** @addtogroup Peripheral_declaration
  671. * @{
  672. */
  673. #define TIM2 ((TIM_TypeDef *) TIM2_BASE)
  674. #define TIM3 ((TIM_TypeDef *) TIM3_BASE)
  675. #define TIM4 ((TIM_TypeDef *) TIM4_BASE)
  676. #define TIM5 ((TIM_TypeDef *) TIM5_BASE)
  677. #define TIM6 ((TIM_TypeDef *) TIM6_BASE)
  678. #define TIM7 ((TIM_TypeDef *) TIM7_BASE)
  679. #define LCD ((LCD_TypeDef *) LCD_BASE)
  680. #define RTC ((RTC_TypeDef *) RTC_BASE)
  681. #define WWDG ((WWDG_TypeDef *) WWDG_BASE)
  682. #define IWDG ((IWDG_TypeDef *) IWDG_BASE)
  683. #define SPI2 ((SPI_TypeDef *) SPI2_BASE)
  684. #define SPI3 ((SPI_TypeDef *) SPI3_BASE)
  685. #define USART2 ((USART_TypeDef *) USART2_BASE)
  686. #define USART3 ((USART_TypeDef *) USART3_BASE)
  687. #define I2C1 ((I2C_TypeDef *) I2C1_BASE)
  688. #define I2C2 ((I2C_TypeDef *) I2C2_BASE)
  689. /* USB device FS */
  690. #define USB ((USB_TypeDef *) USB_BASE)
  691. /* USB device FS SRAM */
  692. #define PWR ((PWR_TypeDef *) PWR_BASE)
  693. #define DAC ((DAC_TypeDef *) DAC_BASE)
  694. #define COMP ((COMP_TypeDef *) COMP_BASE)
  695. #define COMP1 ((COMP_TypeDef *) COMP_BASE)
  696. #define COMP2 ((COMP_TypeDef *) (COMP_BASE + 0x00000001))
  697. #define RI ((RI_TypeDef *) RI_BASE)
  698. #define OPAMP ((OPAMP_TypeDef *) OPAMP_BASE)
  699. #define OPAMP1 ((OPAMP_TypeDef *) OPAMP_BASE)
  700. #define OPAMP2 ((OPAMP_TypeDef *) (OPAMP_BASE + 0x00000001))
  701. #define SYSCFG ((SYSCFG_TypeDef *) SYSCFG_BASE)
  702. #define EXTI ((EXTI_TypeDef *) EXTI_BASE)
  703. #define TIM9 ((TIM_TypeDef *) TIM9_BASE)
  704. #define TIM10 ((TIM_TypeDef *) TIM10_BASE)
  705. #define TIM11 ((TIM_TypeDef *) TIM11_BASE)
  706. #define ADC1 ((ADC_TypeDef *) ADC1_BASE)
  707. #define ADC ((ADC_Common_TypeDef *) ADC_BASE)
  708. #define SPI1 ((SPI_TypeDef *) SPI1_BASE)
  709. #define USART1 ((USART_TypeDef *) USART1_BASE)
  710. #define GPIOA ((GPIO_TypeDef *) GPIOA_BASE)
  711. #define GPIOB ((GPIO_TypeDef *) GPIOB_BASE)
  712. #define GPIOC ((GPIO_TypeDef *) GPIOC_BASE)
  713. #define GPIOD ((GPIO_TypeDef *) GPIOD_BASE)
  714. #define GPIOE ((GPIO_TypeDef *) GPIOE_BASE)
  715. #define GPIOH ((GPIO_TypeDef *) GPIOH_BASE)
  716. #define CRC ((CRC_TypeDef *) CRC_BASE)
  717. #define RCC ((RCC_TypeDef *) RCC_BASE)
  718. #define FLASH ((FLASH_TypeDef *) FLASH_R_BASE)
  719. #define OB ((OB_TypeDef *) OB_BASE)
  720. #define DMA1 ((DMA_TypeDef *) DMA1_BASE)
  721. #define DMA1_Channel1 ((DMA_Channel_TypeDef *) DMA1_Channel1_BASE)
  722. #define DMA1_Channel2 ((DMA_Channel_TypeDef *) DMA1_Channel2_BASE)
  723. #define DMA1_Channel3 ((DMA_Channel_TypeDef *) DMA1_Channel3_BASE)
  724. #define DMA1_Channel4 ((DMA_Channel_TypeDef *) DMA1_Channel4_BASE)
  725. #define DMA1_Channel5 ((DMA_Channel_TypeDef *) DMA1_Channel5_BASE)
  726. #define DMA1_Channel6 ((DMA_Channel_TypeDef *) DMA1_Channel6_BASE)
  727. #define DMA1_Channel7 ((DMA_Channel_TypeDef *) DMA1_Channel7_BASE)
  728. #define DMA2 ((DMA_TypeDef *) DMA2_BASE)
  729. #define DMA2_Channel1 ((DMA_Channel_TypeDef *) DMA2_Channel1_BASE)
  730. #define DMA2_Channel2 ((DMA_Channel_TypeDef *) DMA2_Channel2_BASE)
  731. #define DMA2_Channel3 ((DMA_Channel_TypeDef *) DMA2_Channel3_BASE)
  732. #define DMA2_Channel4 ((DMA_Channel_TypeDef *) DMA2_Channel4_BASE)
  733. #define DMA2_Channel5 ((DMA_Channel_TypeDef *) DMA2_Channel5_BASE)
  734. #define AES ((AES_TypeDef *) AES_BASE)
  735. #define DBGMCU ((DBGMCU_TypeDef *) DBGMCU_BASE)
  736. /**
  737. * @}
  738. */
  739. /** @addtogroup Exported_constants
  740. * @{
  741. */
  742. /** @addtogroup Peripheral_Registers_Bits_Definition
  743. * @{
  744. */
  745. /******************************************************************************/
  746. /* Peripheral Registers Bits Definition */
  747. /******************************************************************************/
  748. /******************************************************************************/
  749. /* */
  750. /* Analog to Digital Converter (ADC) */
  751. /* */
  752. /******************************************************************************/
  753. /******************** Bit definition for ADC_SR register ********************/
  754. #define ADC_SR_AWD ((uint32_t)0x00000001) /*!< Analog watchdog flag */
  755. #define ADC_SR_EOC ((uint32_t)0x00000002) /*!< End of conversion */
  756. #define ADC_SR_JEOC ((uint32_t)0x00000004) /*!< Injected channel end of conversion */
  757. #define ADC_SR_JSTRT ((uint32_t)0x00000008) /*!< Injected channel Start flag */
  758. #define ADC_SR_STRT ((uint32_t)0x00000010) /*!< Regular channel Start flag */
  759. #define ADC_SR_OVR ((uint32_t)0x00000020) /*!< Overrun flag */
  760. #define ADC_SR_ADONS ((uint32_t)0x00000040) /*!< ADC ON status */
  761. #define ADC_SR_RCNR ((uint32_t)0x00000100) /*!< Regular channel not ready flag */
  762. #define ADC_SR_JCNR ((uint32_t)0x00000200) /*!< Injected channel not ready flag */
  763. /******************* Bit definition for ADC_CR1 register ********************/
  764. #define ADC_CR1_AWDCH ((uint32_t)0x0000001F) /*!< AWDCH[4:0] bits (Analog watchdog channel select bits) */
  765. #define ADC_CR1_AWDCH_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  766. #define ADC_CR1_AWDCH_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  767. #define ADC_CR1_AWDCH_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  768. #define ADC_CR1_AWDCH_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  769. #define ADC_CR1_AWDCH_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  770. #define ADC_CR1_EOCIE ((uint32_t)0x00000020) /*!< Interrupt enable for EOC */
  771. #define ADC_CR1_AWDIE ((uint32_t)0x00000040) /*!< Analog Watchdog interrupt enable */
  772. #define ADC_CR1_JEOCIE ((uint32_t)0x00000080) /*!< Interrupt enable for injected channels */
  773. #define ADC_CR1_SCAN ((uint32_t)0x00000100) /*!< Scan mode */
  774. #define ADC_CR1_AWDSGL ((uint32_t)0x00000200) /*!< Enable the watchdog on a single channel in scan mode */
  775. #define ADC_CR1_JAUTO ((uint32_t)0x00000400) /*!< Automatic injected group conversion */
  776. #define ADC_CR1_DISCEN ((uint32_t)0x00000800) /*!< Discontinuous mode on regular channels */
  777. #define ADC_CR1_JDISCEN ((uint32_t)0x00001000) /*!< Discontinuous mode on injected channels */
  778. #define ADC_CR1_DISCNUM ((uint32_t)0x0000E000) /*!< DISCNUM[2:0] bits (Discontinuous mode channel count) */
  779. #define ADC_CR1_DISCNUM_0 ((uint32_t)0x00002000) /*!< Bit 0 */
  780. #define ADC_CR1_DISCNUM_1 ((uint32_t)0x00004000) /*!< Bit 1 */
  781. #define ADC_CR1_DISCNUM_2 ((uint32_t)0x00008000) /*!< Bit 2 */
  782. #define ADC_CR1_PDD ((uint32_t)0x00010000) /*!< Power Down during Delay phase */
  783. #define ADC_CR1_PDI ((uint32_t)0x00020000) /*!< Power Down during Idle phase */
  784. #define ADC_CR1_JAWDEN ((uint32_t)0x00400000) /*!< Analog watchdog enable on injected channels */
  785. #define ADC_CR1_AWDEN ((uint32_t)0x00800000) /*!< Analog watchdog enable on regular channels */
  786. #define ADC_CR1_RES ((uint32_t)0x03000000) /*!< RES[1:0] bits (Resolution) */
  787. #define ADC_CR1_RES_0 ((uint32_t)0x01000000) /*!< Bit 0 */
  788. #define ADC_CR1_RES_1 ((uint32_t)0x02000000) /*!< Bit 1 */
  789. #define ADC_CR1_OVRIE ((uint32_t)0x04000000) /*!< Overrun interrupt enable */
  790. /******************* Bit definition for ADC_CR2 register ********************/
  791. #define ADC_CR2_ADON ((uint32_t)0x00000001) /*!< A/D Converter ON / OFF */
  792. #define ADC_CR2_CONT ((uint32_t)0x00000002) /*!< Continuous Conversion */
  793. #define ADC_CR2_CFG ((uint32_t)0x00000004) /*!< ADC Configuration */
  794. #define ADC_CR2_DELS ((uint32_t)0x00000070) /*!< DELS[2:0] bits (Delay selection) */
  795. #define ADC_CR2_DELS_0 ((uint32_t)0x00000010) /*!< Bit 0 */
  796. #define ADC_CR2_DELS_1 ((uint32_t)0x00000020) /*!< Bit 1 */
  797. #define ADC_CR2_DELS_2 ((uint32_t)0x00000040) /*!< Bit 2 */
  798. #define ADC_CR2_DMA ((uint32_t)0x00000100) /*!< Direct Memory access mode */
  799. #define ADC_CR2_DDS ((uint32_t)0x00000200) /*!< DMA disable selection (Single ADC) */
  800. #define ADC_CR2_EOCS ((uint32_t)0x00000400) /*!< End of conversion selection */
  801. #define ADC_CR2_ALIGN ((uint32_t)0x00000800) /*!< Data Alignment */
  802. #define ADC_CR2_JEXTSEL ((uint32_t)0x000F0000) /*!< JEXTSEL[3:0] bits (External event select for injected group) */
  803. #define ADC_CR2_JEXTSEL_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  804. #define ADC_CR2_JEXTSEL_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  805. #define ADC_CR2_JEXTSEL_2 ((uint32_t)0x00040000) /*!< Bit 2 */
  806. #define ADC_CR2_JEXTSEL_3 ((uint32_t)0x00080000) /*!< Bit 3 */
  807. #define ADC_CR2_JEXTEN ((uint32_t)0x00300000) /*!< JEXTEN[1:0] bits (External Trigger Conversion mode for injected channels) */
  808. #define ADC_CR2_JEXTEN_0 ((uint32_t)0x00100000) /*!< Bit 0 */
  809. #define ADC_CR2_JEXTEN_1 ((uint32_t)0x00200000) /*!< Bit 1 */
  810. #define ADC_CR2_JSWSTART ((uint32_t)0x00400000) /*!< Start Conversion of injected channels */
  811. #define ADC_CR2_EXTSEL ((uint32_t)0x0F000000) /*!< EXTSEL[3:0] bits (External Event Select for regular group) */
  812. #define ADC_CR2_EXTSEL_0 ((uint32_t)0x01000000) /*!< Bit 0 */
  813. #define ADC_CR2_EXTSEL_1 ((uint32_t)0x02000000) /*!< Bit 1 */
  814. #define ADC_CR2_EXTSEL_2 ((uint32_t)0x04000000) /*!< Bit 2 */
  815. #define ADC_CR2_EXTSEL_3 ((uint32_t)0x08000000) /*!< Bit 3 */
  816. #define ADC_CR2_EXTEN ((uint32_t)0x30000000) /*!< EXTEN[1:0] bits (External Trigger Conversion mode for regular channels) */
  817. #define ADC_CR2_EXTEN_0 ((uint32_t)0x10000000) /*!< Bit 0 */
  818. #define ADC_CR2_EXTEN_1 ((uint32_t)0x20000000) /*!< Bit 1 */
  819. #define ADC_CR2_SWSTART ((uint32_t)0x40000000) /*!< Start Conversion of regular channels */
  820. /****************** Bit definition for ADC_SMPR1 register *******************/
  821. #define ADC_SMPR1_SMP20 ((uint32_t)0x00000007) /*!< SMP20[2:0] bits (Channel 20 Sample time selection) */
  822. #define ADC_SMPR1_SMP20_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  823. #define ADC_SMPR1_SMP20_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  824. #define ADC_SMPR1_SMP20_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  825. #define ADC_SMPR1_SMP21 ((uint32_t)0x00000038) /*!< SMP21[2:0] bits (Channel 21 Sample time selection) */
  826. #define ADC_SMPR1_SMP21_0 ((uint32_t)0x00000008) /*!< Bit 0 */
  827. #define ADC_SMPR1_SMP21_1 ((uint32_t)0x00000010) /*!< Bit 1 */
  828. #define ADC_SMPR1_SMP21_2 ((uint32_t)0x00000020) /*!< Bit 2 */
  829. #define ADC_SMPR1_SMP22 ((uint32_t)0x000001C0) /*!< SMP22[2:0] bits (Channel 22 Sample time selection) */
  830. #define ADC_SMPR1_SMP22_0 ((uint32_t)0x00000040) /*!< Bit 0 */
  831. #define ADC_SMPR1_SMP22_1 ((uint32_t)0x00000080) /*!< Bit 1 */
  832. #define ADC_SMPR1_SMP22_2 ((uint32_t)0x00000100) /*!< Bit 2 */
  833. #define ADC_SMPR1_SMP23 ((uint32_t)0x00000E00) /*!< SMP23[2:0] bits (Channel 23 Sample time selection) */
  834. #define ADC_SMPR1_SMP23_0 ((uint32_t)0x00000200) /*!< Bit 0 */
  835. #define ADC_SMPR1_SMP23_1 ((uint32_t)0x00000400) /*!< Bit 1 */
  836. #define ADC_SMPR1_SMP23_2 ((uint32_t)0x00000800) /*!< Bit 2 */
  837. #define ADC_SMPR1_SMP24 ((uint32_t)0x00007000) /*!< SMP24[2:0] bits (Channel 24 Sample time selection) */
  838. #define ADC_SMPR1_SMP24_0 ((uint32_t)0x00001000) /*!< Bit 0 */
  839. #define ADC_SMPR1_SMP24_1 ((uint32_t)0x00002000) /*!< Bit 1 */
  840. #define ADC_SMPR1_SMP24_2 ((uint32_t)0x00004000) /*!< Bit 2 */
  841. #define ADC_SMPR1_SMP25 ((uint32_t)0x00038000) /*!< SMP25[2:0] bits (Channel 25 Sample time selection) */
  842. #define ADC_SMPR1_SMP25_0 ((uint32_t)0x00008000) /*!< Bit 0 */
  843. #define ADC_SMPR1_SMP25_1 ((uint32_t)0x00010000) /*!< Bit 1 */
  844. #define ADC_SMPR1_SMP25_2 ((uint32_t)0x00020000) /*!< Bit 2 */
  845. #define ADC_SMPR1_SMP26 ((uint32_t)0x001C0000) /*!< SMP26[2:0] bits (Channel 26 Sample time selection) */
  846. #define ADC_SMPR1_SMP26_0 ((uint32_t)0x00040000) /*!< Bit 0 */
  847. #define ADC_SMPR1_SMP26_1 ((uint32_t)0x00080000) /*!< Bit 1 */
  848. #define ADC_SMPR1_SMP26_2 ((uint32_t)0x00100000) /*!< Bit 2 */
  849. #define ADC_SMPR1_SMP27 ((uint32_t)0x00E00000) /*!< SMP27[2:0] bits (Channel 27 Sample time selection) */
  850. #define ADC_SMPR1_SMP27_0 ((uint32_t)0x00200000) /*!< Bit 0 */
  851. #define ADC_SMPR1_SMP27_1 ((uint32_t)0x00400000) /*!< Bit 1 */
  852. #define ADC_SMPR1_SMP27_2 ((uint32_t)0x00800000) /*!< Bit 2 */
  853. #define ADC_SMPR1_SMP28 ((uint32_t)0x07000000) /*!< SMP28[2:0] bits (Channel 28 Sample time selection) */
  854. #define ADC_SMPR1_SMP28_0 ((uint32_t)0x01000000) /*!< Bit 0 */
  855. #define ADC_SMPR1_SMP28_1 ((uint32_t)0x02000000) /*!< Bit 1 */
  856. #define ADC_SMPR1_SMP28_2 ((uint32_t)0x04000000) /*!< Bit 2 */
  857. #define ADC_SMPR1_SMP29 ((uint32_t)0x38000000) /*!< SMP29[2:0] bits (Channel 29 Sample time selection) */
  858. #define ADC_SMPR1_SMP29_0 ((uint32_t)0x08000000) /*!< Bit 0 */
  859. #define ADC_SMPR1_SMP29_1 ((uint32_t)0x10000000) /*!< Bit 1 */
  860. #define ADC_SMPR1_SMP29_2 ((uint32_t)0x20000000) /*!< Bit 2 */
  861. /****************** Bit definition for ADC_SMPR2 register *******************/
  862. #define ADC_SMPR2_SMP10 ((uint32_t)0x00000007) /*!< SMP10[2:0] bits (Channel 10 Sample time selection) */
  863. #define ADC_SMPR2_SMP10_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  864. #define ADC_SMPR2_SMP10_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  865. #define ADC_SMPR2_SMP10_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  866. #define ADC_SMPR2_SMP11 ((uint32_t)0x00000038) /*!< SMP11[2:0] bits (Channel 11 Sample time selection) */
  867. #define ADC_SMPR2_SMP11_0 ((uint32_t)0x00000008) /*!< Bit 0 */
  868. #define ADC_SMPR2_SMP11_1 ((uint32_t)0x00000010) /*!< Bit 1 */
  869. #define ADC_SMPR2_SMP11_2 ((uint32_t)0x00000020) /*!< Bit 2 */
  870. #define ADC_SMPR2_SMP12 ((uint32_t)0x000001C0) /*!< SMP12[2:0] bits (Channel 12 Sample time selection) */
  871. #define ADC_SMPR2_SMP12_0 ((uint32_t)0x00000040) /*!< Bit 0 */
  872. #define ADC_SMPR2_SMP12_1 ((uint32_t)0x00000080) /*!< Bit 1 */
  873. #define ADC_SMPR2_SMP12_2 ((uint32_t)0x00000100) /*!< Bit 2 */
  874. #define ADC_SMPR2_SMP13 ((uint32_t)0x00000E00) /*!< SMP13[2:0] bits (Channel 13 Sample time selection) */
  875. #define ADC_SMPR2_SMP13_0 ((uint32_t)0x00000200) /*!< Bit 0 */
  876. #define ADC_SMPR2_SMP13_1 ((uint32_t)0x00000400) /*!< Bit 1 */
  877. #define ADC_SMPR2_SMP13_2 ((uint32_t)0x00000800) /*!< Bit 2 */
  878. #define ADC_SMPR2_SMP14 ((uint32_t)0x00007000) /*!< SMP14[2:0] bits (Channel 14 Sample time selection) */
  879. #define ADC_SMPR2_SMP14_0 ((uint32_t)0x00001000) /*!< Bit 0 */
  880. #define ADC_SMPR2_SMP14_1 ((uint32_t)0x00002000) /*!< Bit 1 */
  881. #define ADC_SMPR2_SMP14_2 ((uint32_t)0x00004000) /*!< Bit 2 */
  882. #define ADC_SMPR2_SMP15 ((uint32_t)0x00038000) /*!< SMP15[2:0] bits (Channel 5 Sample time selection) */
  883. #define ADC_SMPR2_SMP15_0 ((uint32_t)0x00008000) /*!< Bit 0 */
  884. #define ADC_SMPR2_SMP15_1 ((uint32_t)0x00010000) /*!< Bit 1 */
  885. #define ADC_SMPR2_SMP15_2 ((uint32_t)0x00020000) /*!< Bit 2 */
  886. #define ADC_SMPR2_SMP16 ((uint32_t)0x001C0000) /*!< SMP16[2:0] bits (Channel 16 Sample time selection) */
  887. #define ADC_SMPR2_SMP16_0 ((uint32_t)0x00040000) /*!< Bit 0 */
  888. #define ADC_SMPR2_SMP16_1 ((uint32_t)0x00080000) /*!< Bit 1 */
  889. #define ADC_SMPR2_SMP16_2 ((uint32_t)0x00100000) /*!< Bit 2 */
  890. #define ADC_SMPR2_SMP17 ((uint32_t)0x00E00000) /*!< SMP17[2:0] bits (Channel 17 Sample time selection) */
  891. #define ADC_SMPR2_SMP17_0 ((uint32_t)0x00200000) /*!< Bit 0 */
  892. #define ADC_SMPR2_SMP17_1 ((uint32_t)0x00400000) /*!< Bit 1 */
  893. #define ADC_SMPR2_SMP17_2 ((uint32_t)0x00800000) /*!< Bit 2 */
  894. #define ADC_SMPR2_SMP18 ((uint32_t)0x07000000) /*!< SMP18[2:0] bits (Channel 18 Sample time selection) */
  895. #define ADC_SMPR2_SMP18_0 ((uint32_t)0x01000000) /*!< Bit 0 */
  896. #define ADC_SMPR2_SMP18_1 ((uint32_t)0x02000000) /*!< Bit 1 */
  897. #define ADC_SMPR2_SMP18_2 ((uint32_t)0x04000000) /*!< Bit 2 */
  898. #define ADC_SMPR2_SMP19 ((uint32_t)0x38000000) /*!< SMP19[2:0] bits (Channel 19 Sample time selection) */
  899. #define ADC_SMPR2_SMP19_0 ((uint32_t)0x08000000) /*!< Bit 0 */
  900. #define ADC_SMPR2_SMP19_1 ((uint32_t)0x10000000) /*!< Bit 1 */
  901. #define ADC_SMPR2_SMP19_2 ((uint32_t)0x20000000) /*!< Bit 2 */
  902. /****************** Bit definition for ADC_SMPR3 register *******************/
  903. #define ADC_SMPR3_SMP0 ((uint32_t)0x00000007) /*!< SMP0[2:0] bits (Channel 0 Sample time selection) */
  904. #define ADC_SMPR3_SMP0_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  905. #define ADC_SMPR3_SMP0_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  906. #define ADC_SMPR3_SMP0_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  907. #define ADC_SMPR3_SMP1 ((uint32_t)0x00000038) /*!< SMP1[2:0] bits (Channel 1 Sample time selection) */
  908. #define ADC_SMPR3_SMP1_0 ((uint32_t)0x00000008) /*!< Bit 0 */
  909. #define ADC_SMPR3_SMP1_1 ((uint32_t)0x00000010) /*!< Bit 1 */
  910. #define ADC_SMPR3_SMP1_2 ((uint32_t)0x00000020) /*!< Bit 2 */
  911. #define ADC_SMPR3_SMP2 ((uint32_t)0x000001C0) /*!< SMP2[2:0] bits (Channel 2 Sample time selection) */
  912. #define ADC_SMPR3_SMP2_0 ((uint32_t)0x00000040) /*!< Bit 0 */
  913. #define ADC_SMPR3_SMP2_1 ((uint32_t)0x00000080) /*!< Bit 1 */
  914. #define ADC_SMPR3_SMP2_2 ((uint32_t)0x00000100) /*!< Bit 2 */
  915. #define ADC_SMPR3_SMP3 ((uint32_t)0x00000E00) /*!< SMP3[2:0] bits (Channel 3 Sample time selection) */
  916. #define ADC_SMPR3_SMP3_0 ((uint32_t)0x00000200) /*!< Bit 0 */
  917. #define ADC_SMPR3_SMP3_1 ((uint32_t)0x00000400) /*!< Bit 1 */
  918. #define ADC_SMPR3_SMP3_2 ((uint32_t)0x00000800) /*!< Bit 2 */
  919. #define ADC_SMPR3_SMP4 ((uint32_t)0x00007000) /*!< SMP4[2:0] bits (Channel 4 Sample time selection) */
  920. #define ADC_SMPR3_SMP4_0 ((uint32_t)0x00001000) /*!< Bit 0 */
  921. #define ADC_SMPR3_SMP4_1 ((uint32_t)0x00002000) /*!< Bit 1 */
  922. #define ADC_SMPR3_SMP4_2 ((uint32_t)0x00004000) /*!< Bit 2 */
  923. #define ADC_SMPR3_SMP5 ((uint32_t)0x00038000) /*!< SMP5[2:0] bits (Channel 5 Sample time selection) */
  924. #define ADC_SMPR3_SMP5_0 ((uint32_t)0x00008000) /*!< Bit 0 */
  925. #define ADC_SMPR3_SMP5_1 ((uint32_t)0x00010000) /*!< Bit 1 */
  926. #define ADC_SMPR3_SMP5_2 ((uint32_t)0x00020000) /*!< Bit 2 */
  927. #define ADC_SMPR3_SMP6 ((uint32_t)0x001C0000) /*!< SMP6[2:0] bits (Channel 6 Sample time selection) */
  928. #define ADC_SMPR3_SMP6_0 ((uint32_t)0x00040000) /*!< Bit 0 */
  929. #define ADC_SMPR3_SMP6_1 ((uint32_t)0x00080000) /*!< Bit 1 */
  930. #define ADC_SMPR3_SMP6_2 ((uint32_t)0x00100000) /*!< Bit 2 */
  931. #define ADC_SMPR3_SMP7 ((uint32_t)0x00E00000) /*!< SMP7[2:0] bits (Channel 7 Sample time selection) */
  932. #define ADC_SMPR3_SMP7_0 ((uint32_t)0x00200000) /*!< Bit 0 */
  933. #define ADC_SMPR3_SMP7_1 ((uint32_t)0x00400000) /*!< Bit 1 */
  934. #define ADC_SMPR3_SMP7_2 ((uint32_t)0x00800000) /*!< Bit 2 */
  935. #define ADC_SMPR3_SMP8 ((uint32_t)0x07000000) /*!< SMP8[2:0] bits (Channel 8 Sample time selection) */
  936. #define ADC_SMPR3_SMP8_0 ((uint32_t)0x01000000) /*!< Bit 0 */
  937. #define ADC_SMPR3_SMP8_1 ((uint32_t)0x02000000) /*!< Bit 1 */
  938. #define ADC_SMPR3_SMP8_2 ((uint32_t)0x04000000) /*!< Bit 2 */
  939. #define ADC_SMPR3_SMP9 ((uint32_t)0x38000000) /*!< SMP9[2:0] bits (Channel 9 Sample time selection) */
  940. #define ADC_SMPR3_SMP9_0 ((uint32_t)0x08000000) /*!< Bit 0 */
  941. #define ADC_SMPR3_SMP9_1 ((uint32_t)0x10000000) /*!< Bit 1 */
  942. #define ADC_SMPR3_SMP9_2 ((uint32_t)0x20000000) /*!< Bit 2 */
  943. /****************** Bit definition for ADC_JOFR1 register *******************/
  944. #define ADC_JOFR1_JOFFSET1 ((uint32_t)0x00000FFF) /*!< Data offset for injected channel 1 */
  945. /****************** Bit definition for ADC_JOFR2 register *******************/
  946. #define ADC_JOFR2_JOFFSET2 ((uint32_t)0x00000FFF) /*!< Data offset for injected channel 2 */
  947. /****************** Bit definition for ADC_JOFR3 register *******************/
  948. #define ADC_JOFR3_JOFFSET3 ((uint32_t)0x00000FFF) /*!< Data offset for injected channel 3 */
  949. /****************** Bit definition for ADC_JOFR4 register *******************/
  950. #define ADC_JOFR4_JOFFSET4 ((uint32_t)0x00000FFF) /*!< Data offset for injected channel 4 */
  951. /******************* Bit definition for ADC_HTR register ********************/
  952. #define ADC_HTR_HT ((uint32_t)0x00000FFF) /*!< Analog watchdog high threshold */
  953. /******************* Bit definition for ADC_LTR register ********************/
  954. #define ADC_LTR_LT ((uint32_t)0x00000FFF) /*!< Analog watchdog low threshold */
  955. /******************* Bit definition for ADC_SQR1 register *******************/
  956. #define ADC_SQR1_L ((uint32_t)0x01F00000) /*!< L[4:0] bits (Regular channel sequence length) */
  957. #define ADC_SQR1_L_0 ((uint32_t)0x00100000) /*!< Bit 0 */
  958. #define ADC_SQR1_L_1 ((uint32_t)0x00200000) /*!< Bit 1 */
  959. #define ADC_SQR1_L_2 ((uint32_t)0x00400000) /*!< Bit 2 */
  960. #define ADC_SQR1_L_3 ((uint32_t)0x00800000) /*!< Bit 3 */
  961. #define ADC_SQR1_L_4 ((uint32_t)0x01000000) /*!< Bit 4 */
  962. #define ADC_SQR1_SQ28 ((uint32_t)0x000F8000) /*!< SQ28[4:0] bits (25th conversion in regular sequence) */
  963. #define ADC_SQR1_SQ28_0 ((uint32_t)0x00008000) /*!< Bit 0 */
  964. #define ADC_SQR1_SQ28_1 ((uint32_t)0x00010000) /*!< Bit 1 */
  965. #define ADC_SQR1_SQ28_2 ((uint32_t)0x00020000) /*!< Bit 2 */
  966. #define ADC_SQR1_SQ28_3 ((uint32_t)0x00040000) /*!< Bit 3 */
  967. #define ADC_SQR1_SQ28_4 ((uint32_t)0x00080000) /*!< Bit 4 */
  968. #define ADC_SQR1_SQ27 ((uint32_t)0x00007C00) /*!< SQ27[4:0] bits (27th conversion in regular sequence) */
  969. #define ADC_SQR1_SQ27_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  970. #define ADC_SQR1_SQ27_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  971. #define ADC_SQR1_SQ27_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  972. #define ADC_SQR1_SQ27_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  973. #define ADC_SQR1_SQ27_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  974. #define ADC_SQR1_SQ26 ((uint32_t)0x000003E0) /*!< SQ26[4:0] bits (26th conversion in regular sequence) */
  975. #define ADC_SQR1_SQ26_0 ((uint32_t)0x00000020) /*!< Bit 0 */
  976. #define ADC_SQR1_SQ26_1 ((uint32_t)0x00000040) /*!< Bit 1 */
  977. #define ADC_SQR1_SQ26_2 ((uint32_t)0x00000080) /*!< Bit 2 */
  978. #define ADC_SQR1_SQ26_3 ((uint32_t)0x00000100) /*!< Bit 3 */
  979. #define ADC_SQR1_SQ26_4 ((uint32_t)0x00000200) /*!< Bit 4 */
  980. #define ADC_SQR1_SQ25 ((uint32_t)0x0000001F) /*!< SQ25[4:0] bits (25th conversion in regular sequence) */
  981. #define ADC_SQR1_SQ25_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  982. #define ADC_SQR1_SQ25_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  983. #define ADC_SQR1_SQ25_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  984. #define ADC_SQR1_SQ25_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  985. #define ADC_SQR1_SQ25_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  986. /******************* Bit definition for ADC_SQR2 register *******************/
  987. #define ADC_SQR2_SQ19 ((uint32_t)0x0000001F) /*!< SQ19[4:0] bits (19th conversion in regular sequence) */
  988. #define ADC_SQR2_SQ19_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  989. #define ADC_SQR2_SQ19_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  990. #define ADC_SQR2_SQ19_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  991. #define ADC_SQR2_SQ19_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  992. #define ADC_SQR2_SQ19_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  993. #define ADC_SQR2_SQ20 ((uint32_t)0x000003E0) /*!< SQ20[4:0] bits (20th conversion in regular sequence) */
  994. #define ADC_SQR2_SQ20_0 ((uint32_t)0x00000020) /*!< Bit 0 */
  995. #define ADC_SQR2_SQ20_1 ((uint32_t)0x00000040) /*!< Bit 1 */
  996. #define ADC_SQR2_SQ20_2 ((uint32_t)0x00000080) /*!< Bit 2 */
  997. #define ADC_SQR2_SQ20_3 ((uint32_t)0x00000100) /*!< Bit 3 */
  998. #define ADC_SQR2_SQ20_4 ((uint32_t)0x00000200) /*!< Bit 4 */
  999. #define ADC_SQR2_SQ21 ((uint32_t)0x00007C00) /*!< SQ21[4:0] bits (21th conversion in regular sequence) */
  1000. #define ADC_SQR2_SQ21_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  1001. #define ADC_SQR2_SQ21_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  1002. #define ADC_SQR2_SQ21_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  1003. #define ADC_SQR2_SQ21_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  1004. #define ADC_SQR2_SQ21_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  1005. #define ADC_SQR2_SQ22 ((uint32_t)0x000F8000) /*!< SQ22[4:0] bits (22th conversion in regular sequence) */
  1006. #define ADC_SQR2_SQ22_0 ((uint32_t)0x00008000) /*!< Bit 0 */
  1007. #define ADC_SQR2_SQ22_1 ((uint32_t)0x00010000) /*!< Bit 1 */
  1008. #define ADC_SQR2_SQ22_2 ((uint32_t)0x00020000) /*!< Bit 2 */
  1009. #define ADC_SQR2_SQ22_3 ((uint32_t)0x00040000) /*!< Bit 3 */
  1010. #define ADC_SQR2_SQ22_4 ((uint32_t)0x00080000) /*!< Bit 4 */
  1011. #define ADC_SQR2_SQ23 ((uint32_t)0x01F00000) /*!< SQ23[4:0] bits (23th conversion in regular sequence) */
  1012. #define ADC_SQR2_SQ23_0 ((uint32_t)0x00100000) /*!< Bit 0 */
  1013. #define ADC_SQR2_SQ23_1 ((uint32_t)0x00200000) /*!< Bit 1 */
  1014. #define ADC_SQR2_SQ23_2 ((uint32_t)0x00400000) /*!< Bit 2 */
  1015. #define ADC_SQR2_SQ23_3 ((uint32_t)0x00800000) /*!< Bit 3 */
  1016. #define ADC_SQR2_SQ23_4 ((uint32_t)0x01000000) /*!< Bit 4 */
  1017. #define ADC_SQR2_SQ24 ((uint32_t)0x3E000000) /*!< SQ24[4:0] bits (24th conversion in regular sequence) */
  1018. #define ADC_SQR2_SQ24_0 ((uint32_t)0x02000000) /*!< Bit 0 */
  1019. #define ADC_SQR2_SQ24_1 ((uint32_t)0x04000000) /*!< Bit 1 */
  1020. #define ADC_SQR2_SQ24_2 ((uint32_t)0x08000000) /*!< Bit 2 */
  1021. #define ADC_SQR2_SQ24_3 ((uint32_t)0x10000000) /*!< Bit 3 */
  1022. #define ADC_SQR2_SQ24_4 ((uint32_t)0x20000000) /*!< Bit 4 */
  1023. /******************* Bit definition for ADC_SQR3 register *******************/
  1024. #define ADC_SQR3_SQ13 ((uint32_t)0x0000001F) /*!< SQ13[4:0] bits (13th conversion in regular sequence) */
  1025. #define ADC_SQR3_SQ13_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  1026. #define ADC_SQR3_SQ13_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  1027. #define ADC_SQR3_SQ13_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  1028. #define ADC_SQR3_SQ13_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  1029. #define ADC_SQR3_SQ13_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  1030. #define ADC_SQR3_SQ14 ((uint32_t)0x000003E0) /*!< SQ14[4:0] bits (14th conversion in regular sequence) */
  1031. #define ADC_SQR3_SQ14_0 ((uint32_t)0x00000020) /*!< Bit 0 */
  1032. #define ADC_SQR3_SQ14_1 ((uint32_t)0x00000040) /*!< Bit 1 */
  1033. #define ADC_SQR3_SQ14_2 ((uint32_t)0x00000080) /*!< Bit 2 */
  1034. #define ADC_SQR3_SQ14_3 ((uint32_t)0x00000100) /*!< Bit 3 */
  1035. #define ADC_SQR3_SQ14_4 ((uint32_t)0x00000200) /*!< Bit 4 */
  1036. #define ADC_SQR3_SQ15 ((uint32_t)0x00007C00) /*!< SQ15[4:0] bits (15th conversion in regular sequence) */
  1037. #define ADC_SQR3_SQ15_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  1038. #define ADC_SQR3_SQ15_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  1039. #define ADC_SQR3_SQ15_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  1040. #define ADC_SQR3_SQ15_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  1041. #define ADC_SQR3_SQ15_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  1042. #define ADC_SQR3_SQ16 ((uint32_t)0x000F8000) /*!< SQ16[4:0] bits (16th conversion in regular sequence) */
  1043. #define ADC_SQR3_SQ16_0 ((uint32_t)0x00008000) /*!< Bit 0 */
  1044. #define ADC_SQR3_SQ16_1 ((uint32_t)0x00010000) /*!< Bit 1 */
  1045. #define ADC_SQR3_SQ16_2 ((uint32_t)0x00020000) /*!< Bit 2 */
  1046. #define ADC_SQR3_SQ16_3 ((uint32_t)0x00040000) /*!< Bit 3 */
  1047. #define ADC_SQR3_SQ16_4 ((uint32_t)0x00080000) /*!< Bit 4 */
  1048. #define ADC_SQR3_SQ17 ((uint32_t)0x01F00000) /*!< SQ17[4:0] bits (17th conversion in regular sequence) */
  1049. #define ADC_SQR3_SQ17_0 ((uint32_t)0x00100000) /*!< Bit 0 */
  1050. #define ADC_SQR3_SQ17_1 ((uint32_t)0x00200000) /*!< Bit 1 */
  1051. #define ADC_SQR3_SQ17_2 ((uint32_t)0x00400000) /*!< Bit 2 */
  1052. #define ADC_SQR3_SQ17_3 ((uint32_t)0x00800000) /*!< Bit 3 */
  1053. #define ADC_SQR3_SQ17_4 ((uint32_t)0x01000000) /*!< Bit 4 */
  1054. #define ADC_SQR3_SQ18 ((uint32_t)0x3E000000) /*!< SQ18[4:0] bits (18th conversion in regular sequence) */
  1055. #define ADC_SQR3_SQ18_0 ((uint32_t)0x02000000) /*!< Bit 0 */
  1056. #define ADC_SQR3_SQ18_1 ((uint32_t)0x04000000) /*!< Bit 1 */
  1057. #define ADC_SQR3_SQ18_2 ((uint32_t)0x08000000) /*!< Bit 2 */
  1058. #define ADC_SQR3_SQ18_3 ((uint32_t)0x10000000) /*!< Bit 3 */
  1059. #define ADC_SQR3_SQ18_4 ((uint32_t)0x20000000) /*!< Bit 4 */
  1060. /******************* Bit definition for ADC_SQR4 register *******************/
  1061. #define ADC_SQR4_SQ7 ((uint32_t)0x0000001F) /*!< SQ7[4:0] bits (7th conversion in regular sequence) */
  1062. #define ADC_SQR4_SQ7_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  1063. #define ADC_SQR4_SQ7_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  1064. #define ADC_SQR4_SQ7_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  1065. #define ADC_SQR4_SQ7_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  1066. #define ADC_SQR4_SQ7_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  1067. #define ADC_SQR4_SQ8 ((uint32_t)0x000003E0) /*!< SQ8[4:0] bits (8th conversion in regular sequence) */
  1068. #define ADC_SQR4_SQ8_0 ((uint32_t)0x00000020) /*!< Bit 0 */
  1069. #define ADC_SQR4_SQ8_1 ((uint32_t)0x00000040) /*!< Bit 1 */
  1070. #define ADC_SQR4_SQ8_2 ((uint32_t)0x00000080) /*!< Bit 2 */
  1071. #define ADC_SQR4_SQ8_3 ((uint32_t)0x00000100) /*!< Bit 3 */
  1072. #define ADC_SQR4_SQ8_4 ((uint32_t)0x00000200) /*!< Bit 4 */
  1073. #define ADC_SQR4_SQ9 ((uint32_t)0x00007C00) /*!< SQ9[4:0] bits (9th conversion in regular sequence) */
  1074. #define ADC_SQR4_SQ9_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  1075. #define ADC_SQR4_SQ9_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  1076. #define ADC_SQR4_SQ9_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  1077. #define ADC_SQR4_SQ9_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  1078. #define ADC_SQR4_SQ9_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  1079. #define ADC_SQR4_SQ10 ((uint32_t)0x000F8000) /*!< SQ10[4:0] bits (10th conversion in regular sequence) */
  1080. #define ADC_SQR4_SQ10_0 ((uint32_t)0x00008000) /*!< Bit 0 */
  1081. #define ADC_SQR4_SQ10_1 ((uint32_t)0x00010000) /*!< Bit 1 */
  1082. #define ADC_SQR4_SQ10_2 ((uint32_t)0x00020000) /*!< Bit 2 */
  1083. #define ADC_SQR4_SQ10_3 ((uint32_t)0x00040000) /*!< Bit 3 */
  1084. #define ADC_SQR4_SQ10_4 ((uint32_t)0x00080000) /*!< Bit 4 */
  1085. #define ADC_SQR4_SQ11 ((uint32_t)0x01F00000) /*!< SQ11[4:0] bits (11th conversion in regular sequence) */
  1086. #define ADC_SQR4_SQ11_0 ((uint32_t)0x00100000) /*!< Bit 0 */
  1087. #define ADC_SQR4_SQ11_1 ((uint32_t)0x00200000) /*!< Bit 1 */
  1088. #define ADC_SQR4_SQ11_2 ((uint32_t)0x00400000) /*!< Bit 2 */
  1089. #define ADC_SQR4_SQ11_3 ((uint32_t)0x00800000) /*!< Bit 3 */
  1090. #define ADC_SQR4_SQ11_4 ((uint32_t)0x01000000) /*!< Bit 4 */
  1091. #define ADC_SQR4_SQ12 ((uint32_t)0x3E000000) /*!< SQ12[4:0] bits (12th conversion in regular sequence) */
  1092. #define ADC_SQR4_SQ12_0 ((uint32_t)0x02000000) /*!< Bit 0 */
  1093. #define ADC_SQR4_SQ12_1 ((uint32_t)0x04000000) /*!< Bit 1 */
  1094. #define ADC_SQR4_SQ12_2 ((uint32_t)0x08000000) /*!< Bit 2 */
  1095. #define ADC_SQR4_SQ12_3 ((uint32_t)0x10000000) /*!< Bit 3 */
  1096. #define ADC_SQR4_SQ12_4 ((uint32_t)0x20000000) /*!< Bit 4 */
  1097. /******************* Bit definition for ADC_SQR5 register *******************/
  1098. #define ADC_SQR5_SQ1 ((uint32_t)0x0000001F) /*!< SQ1[4:0] bits (1st conversion in regular sequence) */
  1099. #define ADC_SQR5_SQ1_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  1100. #define ADC_SQR5_SQ1_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  1101. #define ADC_SQR5_SQ1_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  1102. #define ADC_SQR5_SQ1_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  1103. #define ADC_SQR5_SQ1_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  1104. #define ADC_SQR5_SQ2 ((uint32_t)0x000003E0) /*!< SQ2[4:0] bits (2nd conversion in regular sequence) */
  1105. #define ADC_SQR5_SQ2_0 ((uint32_t)0x00000020) /*!< Bit 0 */
  1106. #define ADC_SQR5_SQ2_1 ((uint32_t)0x00000040) /*!< Bit 1 */
  1107. #define ADC_SQR5_SQ2_2 ((uint32_t)0x00000080) /*!< Bit 2 */
  1108. #define ADC_SQR5_SQ2_3 ((uint32_t)0x00000100) /*!< Bit 3 */
  1109. #define ADC_SQR5_SQ2_4 ((uint32_t)0x00000200) /*!< Bit 4 */
  1110. #define ADC_SQR5_SQ3 ((uint32_t)0x00007C00) /*!< SQ3[4:0] bits (3rd conversion in regular sequence) */
  1111. #define ADC_SQR5_SQ3_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  1112. #define ADC_SQR5_SQ3_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  1113. #define ADC_SQR5_SQ3_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  1114. #define ADC_SQR5_SQ3_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  1115. #define ADC_SQR5_SQ3_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  1116. #define ADC_SQR5_SQ4 ((uint32_t)0x000F8000) /*!< SQ4[4:0] bits (4th conversion in regular sequence) */
  1117. #define ADC_SQR5_SQ4_0 ((uint32_t)0x00008000) /*!< Bit 0 */
  1118. #define ADC_SQR5_SQ4_1 ((uint32_t)0x00010000) /*!< Bit 1 */
  1119. #define ADC_SQR5_SQ4_2 ((uint32_t)0x00020000) /*!< Bit 2 */
  1120. #define ADC_SQR5_SQ4_3 ((uint32_t)0x00040000) /*!< Bit 3 */
  1121. #define ADC_SQR5_SQ4_4 ((uint32_t)0x00080000) /*!< Bit 4 */
  1122. #define ADC_SQR5_SQ5 ((uint32_t)0x01F00000) /*!< SQ5[4:0] bits (5th conversion in regular sequence) */
  1123. #define ADC_SQR5_SQ5_0 ((uint32_t)0x00100000) /*!< Bit 0 */
  1124. #define ADC_SQR5_SQ5_1 ((uint32_t)0x00200000) /*!< Bit 1 */
  1125. #define ADC_SQR5_SQ5_2 ((uint32_t)0x00400000) /*!< Bit 2 */
  1126. #define ADC_SQR5_SQ5_3 ((uint32_t)0x00800000) /*!< Bit 3 */
  1127. #define ADC_SQR5_SQ5_4 ((uint32_t)0x01000000) /*!< Bit 4 */
  1128. #define ADC_SQR5_SQ6 ((uint32_t)0x3E000000) /*!< SQ6[4:0] bits (6th conversion in regular sequence) */
  1129. #define ADC_SQR5_SQ6_0 ((uint32_t)0x02000000) /*!< Bit 0 */
  1130. #define ADC_SQR5_SQ6_1 ((uint32_t)0x04000000) /*!< Bit 1 */
  1131. #define ADC_SQR5_SQ6_2 ((uint32_t)0x08000000) /*!< Bit 2 */
  1132. #define ADC_SQR5_SQ6_3 ((uint32_t)0x10000000) /*!< Bit 3 */
  1133. #define ADC_SQR5_SQ6_4 ((uint32_t)0x20000000) /*!< Bit 4 */
  1134. /******************* Bit definition for ADC_JSQR register *******************/
  1135. #define ADC_JSQR_JSQ1 ((uint32_t)0x0000001F) /*!< JSQ1[4:0] bits (1st conversion in injected sequence) */
  1136. #define ADC_JSQR_JSQ1_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  1137. #define ADC_JSQR_JSQ1_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  1138. #define ADC_JSQR_JSQ1_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  1139. #define ADC_JSQR_JSQ1_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  1140. #define ADC_JSQR_JSQ1_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  1141. #define ADC_JSQR_JSQ2 ((uint32_t)0x000003E0) /*!< JSQ2[4:0] bits (2nd conversion in injected sequence) */
  1142. #define ADC_JSQR_JSQ2_0 ((uint32_t)0x00000020) /*!< Bit 0 */
  1143. #define ADC_JSQR_JSQ2_1 ((uint32_t)0x00000040) /*!< Bit 1 */
  1144. #define ADC_JSQR_JSQ2_2 ((uint32_t)0x00000080) /*!< Bit 2 */
  1145. #define ADC_JSQR_JSQ2_3 ((uint32_t)0x00000100) /*!< Bit 3 */
  1146. #define ADC_JSQR_JSQ2_4 ((uint32_t)0x00000200) /*!< Bit 4 */
  1147. #define ADC_JSQR_JSQ3 ((uint32_t)0x00007C00) /*!< JSQ3[4:0] bits (3rd conversion in injected sequence) */
  1148. #define ADC_JSQR_JSQ3_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  1149. #define ADC_JSQR_JSQ3_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  1150. #define ADC_JSQR_JSQ3_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  1151. #define ADC_JSQR_JSQ3_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  1152. #define ADC_JSQR_JSQ3_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  1153. #define ADC_JSQR_JSQ4 ((uint32_t)0x000F8000) /*!< JSQ4[4:0] bits (4th conversion in injected sequence) */
  1154. #define ADC_JSQR_JSQ4_0 ((uint32_t)0x00008000) /*!< Bit 0 */
  1155. #define ADC_JSQR_JSQ4_1 ((uint32_t)0x00010000) /*!< Bit 1 */
  1156. #define ADC_JSQR_JSQ4_2 ((uint32_t)0x00020000) /*!< Bit 2 */
  1157. #define ADC_JSQR_JSQ4_3 ((uint32_t)0x00040000) /*!< Bit 3 */
  1158. #define ADC_JSQR_JSQ4_4 ((uint32_t)0x00080000) /*!< Bit 4 */
  1159. #define ADC_JSQR_JL ((uint32_t)0x00300000) /*!< JL[1:0] bits (Injected Sequence length) */
  1160. #define ADC_JSQR_JL_0 ((uint32_t)0x00100000) /*!< Bit 0 */
  1161. #define ADC_JSQR_JL_1 ((uint32_t)0x00200000) /*!< Bit 1 */
  1162. /******************* Bit definition for ADC_JDR1 register *******************/
  1163. #define ADC_JDR1_JDATA ((uint32_t)0x0000FFFF) /*!< Injected data */
  1164. /******************* Bit definition for ADC_JDR2 register *******************/
  1165. #define ADC_JDR2_JDATA ((uint32_t)0x0000FFFF) /*!< Injected data */
  1166. /******************* Bit definition for ADC_JDR3 register *******************/
  1167. #define ADC_JDR3_JDATA ((uint32_t)0x0000FFFF) /*!< Injected data */
  1168. /******************* Bit definition for ADC_JDR4 register *******************/
  1169. #define ADC_JDR4_JDATA ((uint32_t)0x0000FFFF) /*!< Injected data */
  1170. /******************** Bit definition for ADC_DR register ********************/
  1171. #define ADC_DR_DATA ((uint32_t)0x0000FFFF) /*!< Regular data */
  1172. /******************* Bit definition for ADC_CSR register ********************/
  1173. #define ADC_CSR_AWD1 ((uint32_t)0x00000001) /*!< ADC1 Analog watchdog flag */
  1174. #define ADC_CSR_EOC1 ((uint32_t)0x00000002) /*!< ADC1 End of conversion */
  1175. #define ADC_CSR_JEOC1 ((uint32_t)0x00000004) /*!< ADC1 Injected channel end of conversion */
  1176. #define ADC_CSR_JSTRT1 ((uint32_t)0x00000008) /*!< ADC1 Injected channel Start flag */
  1177. #define ADC_CSR_STRT1 ((uint32_t)0x00000010) /*!< ADC1 Regular channel Start flag */
  1178. #define ADC_CSR_OVR1 ((uint32_t)0x00000020) /*!< ADC1 overrun flag */
  1179. #define ADC_CSR_ADONS1 ((uint32_t)0x00000040) /*!< ADON status of ADC1 */
  1180. /******************* Bit definition for ADC_CCR register ********************/
  1181. #define ADC_CCR_ADCPRE ((uint32_t)0x00030000) /*!< ADC prescaler*/
  1182. #define ADC_CCR_ADCPRE_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  1183. #define ADC_CCR_ADCPRE_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  1184. #define ADC_CCR_TSVREFE ((uint32_t)0x00800000) /*!< Temperature Sensor and VREFINT Enable */
  1185. /******************************************************************************/
  1186. /* */
  1187. /* Advanced Encryption Standard (AES) */
  1188. /* */
  1189. /******************************************************************************/
  1190. /******************* Bit definition for AES_CR register *********************/
  1191. #define AES_CR_EN ((uint32_t)0x00000001) /*!< AES Enable */
  1192. #define AES_CR_DATATYPE ((uint32_t)0x00000006) /*!< Data type selection */
  1193. #define AES_CR_DATATYPE_0 ((uint32_t)0x00000002) /*!< Bit 0 */
  1194. #define AES_CR_DATATYPE_1 ((uint32_t)0x00000004) /*!< Bit 1 */
  1195. #define AES_CR_MODE ((uint32_t)0x00000018) /*!< AES Mode Of Operation */
  1196. #define AES_CR_MODE_0 ((uint32_t)0x00000008) /*!< Bit 0 */
  1197. #define AES_CR_MODE_1 ((uint32_t)0x00000010) /*!< Bit 1 */
  1198. #define AES_CR_CHMOD ((uint32_t)0x00000060) /*!< AES Chaining Mode */
  1199. #define AES_CR_CHMOD_0 ((uint32_t)0x00000020) /*!< Bit 0 */
  1200. #define AES_CR_CHMOD_1 ((uint32_t)0x00000040) /*!< Bit 1 */
  1201. #define AES_CR_CCFC ((uint32_t)0x00000080) /*!< Computation Complete Flag Clear */
  1202. #define AES_CR_ERRC ((uint32_t)0x00000100) /*!< Error Clear */
  1203. #define AES_CR_CCIE ((uint32_t)0x00000200) /*!< Computation Complete Interrupt Enable */
  1204. #define AES_CR_ERRIE ((uint32_t)0x00000400) /*!< Error Interrupt Enable */
  1205. #define AES_CR_DMAINEN ((uint32_t)0x00000800) /*!< DMA ENable managing the data input phase */
  1206. #define AES_CR_DMAOUTEN ((uint32_t)0x00001000) /*!< DMA Enable managing the data output phase */
  1207. /******************* Bit definition for AES_SR register *********************/
  1208. #define AES_SR_CCF ((uint32_t)0x00000001) /*!< Computation Complete Flag */
  1209. #define AES_SR_RDERR ((uint32_t)0x00000002) /*!< Read Error Flag */
  1210. #define AES_SR_WRERR ((uint32_t)0x00000004) /*!< Write Error Flag */
  1211. /******************* Bit definition for AES_DINR register *******************/
  1212. #define AES_DINR ((uint32_t)0x0000FFFF) /*!< AES Data Input Register */
  1213. /******************* Bit definition for AES_DOUTR register ******************/
  1214. #define AES_DOUTR ((uint32_t)0x0000FFFF) /*!< AES Data Output Register */
  1215. /******************* Bit definition for AES_KEYR0 register ******************/
  1216. #define AES_KEYR0 ((uint32_t)0x0000FFFF) /*!< AES Key Register 0 */
  1217. /******************* Bit definition for AES_KEYR1 register ******************/
  1218. #define AES_KEYR1 ((uint32_t)0x0000FFFF) /*!< AES Key Register 1 */
  1219. /******************* Bit definition for AES_KEYR2 register ******************/
  1220. #define AES_KEYR2 ((uint32_t)0x0000FFFF) /*!< AES Key Register 2 */
  1221. /******************* Bit definition for AES_KEYR3 register ******************/
  1222. #define AES_KEYR3 ((uint32_t)0x0000FFFF) /*!< AES Key Register 3 */
  1223. /******************* Bit definition for AES_IVR0 register *******************/
  1224. #define AES_IVR0 ((uint32_t)0x0000FFFF) /*!< AES Initialization Vector Register 0 */
  1225. /******************* Bit definition for AES_IVR1 register *******************/
  1226. #define AES_IVR1 ((uint32_t)0x0000FFFF) /*!< AES Initialization Vector Register 1 */
  1227. /******************* Bit definition for AES_IVR2 register *******************/
  1228. #define AES_IVR2 ((uint32_t)0x0000FFFF) /*!< AES Initialization Vector Register 2 */
  1229. /******************* Bit definition for AES_IVR3 register *******************/
  1230. #define AES_IVR3 ((uint32_t)0x0000FFFF) /*!< AES Initialization Vector Register 3 */
  1231. /******************************************************************************/
  1232. /* */
  1233. /* Analog Comparators (COMP) */
  1234. /* */
  1235. /******************************************************************************/
  1236. /****************** Bit definition for COMP_CSR register ********************/
  1237. #define COMP_CSR_10KPU ((uint32_t)0x00000001) /*!< 10K pull-up resistor */
  1238. #define COMP_CSR_400KPU ((uint32_t)0x00000002) /*!< 400K pull-up resistor */
  1239. #define COMP_CSR_10KPD ((uint32_t)0x00000004) /*!< 10K pull-down resistor */
  1240. #define COMP_CSR_400KPD ((uint32_t)0x00000008) /*!< 400K pull-down resistor */
  1241. #define COMP_CSR_CMP1EN ((uint32_t)0x00000010) /*!< Comparator 1 enable */
  1242. #define COMP_CSR_CMP1OUT ((uint32_t)0x00000080) /*!< Comparator 1 output */
  1243. #define COMP_CSR_SPEED ((uint32_t)0x00001000) /*!< Comparator 2 speed */
  1244. #define COMP_CSR_CMP2OUT ((uint32_t)0x00002000) /*!< Comparator 2 ouput */
  1245. #define COMP_CSR_VREFOUTEN ((uint32_t)0x00010000) /*!< Comparator Vref Enable */
  1246. #define COMP_CSR_WNDWE ((uint32_t)0x00020000) /*!< Window mode enable */
  1247. #define COMP_CSR_INSEL ((uint32_t)0x001C0000) /*!< INSEL[2:0] Inversion input Selection */
  1248. #define COMP_CSR_INSEL_0 ((uint32_t)0x00040000) /*!< Bit 0 */
  1249. #define COMP_CSR_INSEL_1 ((uint32_t)0x00080000) /*!< Bit 1 */
  1250. #define COMP_CSR_INSEL_2 ((uint32_t)0x00100000) /*!< Bit 2 */
  1251. #define COMP_CSR_OUTSEL ((uint32_t)0x00E00000) /*!< OUTSEL[2:0] comparator 2 output redirection */
  1252. #define COMP_CSR_OUTSEL_0 ((uint32_t)0x00200000) /*!< Bit 0 */
  1253. #define COMP_CSR_OUTSEL_1 ((uint32_t)0x00400000) /*!< Bit 1 */
  1254. #define COMP_CSR_OUTSEL_2 ((uint32_t)0x00800000) /*!< Bit 2 */
  1255. #define COMP_CSR_FCH3 ((uint32_t)0x04000000) /*!< Bit 26 */
  1256. #define COMP_CSR_FCH8 ((uint32_t)0x08000000) /*!< Bit 27 */
  1257. #define COMP_CSR_RCH13 ((uint32_t)0x10000000) /*!< Bit 28 */
  1258. #define COMP_CSR_CAIE ((uint32_t)0x20000000) /*!< Bit 29 */
  1259. #define COMP_CSR_CAIF ((uint32_t)0x40000000) /*!< Bit 30 */
  1260. #define COMP_CSR_TSUSP ((uint32_t)0x80000000) /*!< Bit 31 */
  1261. /******************************************************************************/
  1262. /* */
  1263. /* Operational Amplifier (OPAMP) */
  1264. /* */
  1265. /******************************************************************************/
  1266. /******************* Bit definition for OPAMP_CSR register ******************/
  1267. #define OPAMP_CSR_OPA1PD ((uint32_t)0x00000001) /*!< OPAMP1 disable */
  1268. #define OPAMP_CSR_S3SEL1 ((uint32_t)0x00000002) /*!< Switch 3 for OPAMP1 Enable */
  1269. #define OPAMP_CSR_S4SEL1 ((uint32_t)0x00000004) /*!< Switch 4 for OPAMP1 Enable */
  1270. #define OPAMP_CSR_S5SEL1 ((uint32_t)0x00000008) /*!< Switch 5 for OPAMP1 Enable */
  1271. #define OPAMP_CSR_S6SEL1 ((uint32_t)0x00000010) /*!< Switch 6 for OPAMP1 Enable */
  1272. #define OPAMP_CSR_OPA1CAL_L ((uint32_t)0x00000020) /*!< OPAMP1 Offset calibration for P differential pair */
  1273. #define OPAMP_CSR_OPA1CAL_H ((uint32_t)0x00000040) /*!< OPAMP1 Offset calibration for N differential pair */
  1274. #define OPAMP_CSR_OPA1LPM ((uint32_t)0x00000080) /*!< OPAMP1 Low power enable */
  1275. #define OPAMP_CSR_OPA2PD ((uint32_t)0x00000100) /*!< OPAMP2 disable */
  1276. #define OPAMP_CSR_S3SEL2 ((uint32_t)0x00000200) /*!< Switch 3 for OPAMP2 Enable */
  1277. #define OPAMP_CSR_S4SEL2 ((uint32_t)0x00000400) /*!< Switch 4 for OPAMP2 Enable */
  1278. #define OPAMP_CSR_S5SEL2 ((uint32_t)0x00000800) /*!< Switch 5 for OPAMP2 Enable */
  1279. #define OPAMP_CSR_S6SEL2 ((uint32_t)0x00001000) /*!< Switch 6 for OPAMP2 Enable */
  1280. #define OPAMP_CSR_OPA2CAL_L ((uint32_t)0x00002000) /*!< OPAMP2 Offset calibration for P differential pair */
  1281. #define OPAMP_CSR_OPA2CAL_H ((uint32_t)0x00004000) /*!< OPAMP2 Offset calibration for N differential pair */
  1282. #define OPAMP_CSR_OPA2LPM ((uint32_t)0x00008000) /*!< OPAMP2 Low power enable */
  1283. #define OPAMP_CSR_ANAWSEL1 ((uint32_t)0x01000000) /*!< Switch ANA Enable for OPAMP1 */
  1284. #define OPAMP_CSR_ANAWSEL2 ((uint32_t)0x02000000) /*!< Switch ANA Enable for OPAMP2 */
  1285. #define OPAMP_CSR_S7SEL2 ((uint32_t)0x08000000) /*!< Switch 7 for OPAMP2 Enable */
  1286. #define OPAMP_CSR_AOP_RANGE ((uint32_t)0x10000000) /*!< Power range selection */
  1287. #define OPAMP_CSR_OPA1CALOUT ((uint32_t)0x20000000) /*!< OPAMP1 calibration output */
  1288. #define OPAMP_CSR_OPA2CALOUT ((uint32_t)0x40000000) /*!< OPAMP2 calibration output */
  1289. /******************* Bit definition for OPAMP_OTR register ******************/
  1290. #define OPAMP_OTR_AO1_OPT_OFFSET_TRIM_LOW ((uint32_t)0x0000001F) /*!< Offset trim for transistors differential pair PMOS of OPAMP1 */
  1291. #define OPAMP_OTR_AO1_OPT_OFFSET_TRIM_HIGH ((uint32_t)0x000003E0) /*!< Offset trim for transistors differential pair NMOS of OPAMP1 */
  1292. #define OPAMP_OTR_AO2_OPT_OFFSET_TRIM_LOW ((uint32_t)0x00007C00) /*!< Offset trim for transistors differential pair PMOS of OPAMP2 */
  1293. #define OPAMP_OTR_AO2_OPT_OFFSET_TRIM_HIGH ((uint32_t)0x000F8000) /*!< Offset trim for transistors differential pair NMOS of OPAMP2 */
  1294. #define OPAMP_OTR_OT_USER ((uint32_t)0x80000000) /*!< Switch to OPAMP offset user trimmed values */
  1295. /******************* Bit definition for OPAMP_LPOTR register ****************/
  1296. #define OPAMP_OTR_AO1_OPT_OFFSET_TRIM_LP_LOW ((uint32_t)0x0000001F) /*!< Offset trim for transistors differential pair PMOS of OPAMP1 */
  1297. #define OPAMP_OTR_AO1_OPT_OFFSET_TRIM_LP_HIGH ((uint32_t)0x000003E0) /*!< Offset trim for transistors differential pair NMOS of OPAMP1 */
  1298. #define OPAMP_OTR_AO2_OPT_OFFSET_TRIM_LP_LOW ((uint32_t)0x00007C00) /*!< Offset trim for transistors differential pair PMOS of OPAMP2 */
  1299. #define OPAMP_OTR_AO2_OPT_OFFSET_TRIM_LP_HIGH ((uint32_t)0x000F8000) /*!< Offset trim for transistors differential pair NMOS of OPAMP2 */
  1300. /******************************************************************************/
  1301. /* */
  1302. /* CRC calculation unit (CRC) */
  1303. /* */
  1304. /******************************************************************************/
  1305. /******************* Bit definition for CRC_DR register *********************/
  1306. #define CRC_DR_DR ((uint32_t)0xFFFFFFFF) /*!< Data register bits */
  1307. /******************* Bit definition for CRC_IDR register ********************/
  1308. #define CRC_IDR_IDR ((uint32_t)0x000000FF) /*!< General-purpose 8-bit data register bits */
  1309. /******************** Bit definition for CRC_CR register ********************/
  1310. #define CRC_CR_RESET ((uint32_t)0x00000001) /*!< RESET bit */
  1311. /******************************************************************************/
  1312. /* */
  1313. /* Digital to Analog Converter (DAC) */
  1314. /* */
  1315. /******************************************************************************/
  1316. /******************** Bit definition for DAC_CR register ********************/
  1317. #define DAC_CR_EN1 ((uint32_t)0x00000001) /*!<DAC channel1 enable */
  1318. #define DAC_CR_BOFF1 ((uint32_t)0x00000002) /*!<DAC channel1 output buffer disable */
  1319. #define DAC_CR_TEN1 ((uint32_t)0x00000004) /*!<DAC channel1 Trigger enable */
  1320. #define DAC_CR_TSEL1 ((uint32_t)0x00000038) /*!<TSEL1[2:0] (DAC channel1 Trigger selection) */
  1321. #define DAC_CR_TSEL1_0 ((uint32_t)0x00000008) /*!<Bit 0 */
  1322. #define DAC_CR_TSEL1_1 ((uint32_t)0x00000010) /*!<Bit 1 */
  1323. #define DAC_CR_TSEL1_2 ((uint32_t)0x00000020) /*!<Bit 2 */
  1324. #define DAC_CR_WAVE1 ((uint32_t)0x000000C0) /*!<WAVE1[1:0] (DAC channel1 noise/triangle wave generation enable) */
  1325. #define DAC_CR_WAVE1_0 ((uint32_t)0x00000040) /*!<Bit 0 */
  1326. #define DAC_CR_WAVE1_1 ((uint32_t)0x00000080) /*!<Bit 1 */
  1327. #define DAC_CR_MAMP1 ((uint32_t)0x00000F00) /*!<MAMP1[3:0] (DAC channel1 Mask/Amplitude selector) */
  1328. #define DAC_CR_MAMP1_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  1329. #define DAC_CR_MAMP1_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  1330. #define DAC_CR_MAMP1_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  1331. #define DAC_CR_MAMP1_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  1332. #define DAC_CR_DMAEN1 ((uint32_t)0x00001000) /*!<DAC channel1 DMA enable */
  1333. #define DAC_CR_DMAUDRIE1 ((uint32_t)0x00002000) /*!<DAC channel1 DMA Interrupt enable */
  1334. #define DAC_CR_EN2 ((uint32_t)0x00010000) /*!<DAC channel2 enable */
  1335. #define DAC_CR_BOFF2 ((uint32_t)0x00020000) /*!<DAC channel2 output buffer disable */
  1336. #define DAC_CR_TEN2 ((uint32_t)0x00040000) /*!<DAC channel2 Trigger enable */
  1337. #define DAC_CR_TSEL2 ((uint32_t)0x00380000) /*!<TSEL2[2:0] (DAC channel2 Trigger selection) */
  1338. #define DAC_CR_TSEL2_0 ((uint32_t)0x00080000) /*!<Bit 0 */
  1339. #define DAC_CR_TSEL2_1 ((uint32_t)0x00100000) /*!<Bit 1 */
  1340. #define DAC_CR_TSEL2_2 ((uint32_t)0x00200000) /*!<Bit 2 */
  1341. #define DAC_CR_WAVE2 ((uint32_t)0x00C00000) /*!<WAVE2[1:0] (DAC channel2 noise/triangle wave generation enable) */
  1342. #define DAC_CR_WAVE2_0 ((uint32_t)0x00400000) /*!<Bit 0 */
  1343. #define DAC_CR_WAVE2_1 ((uint32_t)0x00800000) /*!<Bit 1 */
  1344. #define DAC_CR_MAMP2 ((uint32_t)0x0F000000) /*!<MAMP2[3:0] (DAC channel2 Mask/Amplitude selector) */
  1345. #define DAC_CR_MAMP2_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  1346. #define DAC_CR_MAMP2_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  1347. #define DAC_CR_MAMP2_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  1348. #define DAC_CR_MAMP2_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  1349. #define DAC_CR_DMAEN2 ((uint32_t)0x10000000) /*!<DAC channel2 DMA enabled */
  1350. #define DAC_CR_DMAUDRIE2 ((uint32_t)0x20000000) /*!<DAC channel2 DMA underrun interrupt enable */
  1351. /***************** Bit definition for DAC_SWTRIGR register ******************/
  1352. #define DAC_SWTRIGR_SWTRIG1 ((uint32_t)0x00000001) /*!<DAC channel1 software trigger */
  1353. #define DAC_SWTRIGR_SWTRIG2 ((uint32_t)0x00000002) /*!<DAC channel2 software trigger */
  1354. /***************** Bit definition for DAC_DHR12R1 register ******************/
  1355. #define DAC_DHR12R1_DACC1DHR ((uint32_t)0x00000FFF) /*!<DAC channel1 12-bit Right aligned data */
  1356. /***************** Bit definition for DAC_DHR12L1 register ******************/
  1357. #define DAC_DHR12L1_DACC1DHR ((uint32_t)0x0000FFF0) /*!<DAC channel1 12-bit Left aligned data */
  1358. /****************** Bit definition for DAC_DHR8R1 register ******************/
  1359. #define DAC_DHR8R1_DACC1DHR ((uint32_t)0x000000FF) /*!<DAC channel1 8-bit Right aligned data */
  1360. /***************** Bit definition for DAC_DHR12R2 register ******************/
  1361. #define DAC_DHR12R2_DACC2DHR ((uint32_t)0x00000FFF) /*!<DAC channel2 12-bit Right aligned data */
  1362. /***************** Bit definition for DAC_DHR12L2 register ******************/
  1363. #define DAC_DHR12L2_DACC2DHR ((uint32_t)0x0000FFF0) /*!<DAC channel2 12-bit Left aligned data */
  1364. /****************** Bit definition for DAC_DHR8R2 register ******************/
  1365. #define DAC_DHR8R2_DACC2DHR ((uint32_t)0x000000FF) /*!<DAC channel2 8-bit Right aligned data */
  1366. /***************** Bit definition for DAC_DHR12RD register ******************/
  1367. #define DAC_DHR12RD_DACC1DHR ((uint32_t)0x00000FFF) /*!<DAC channel1 12-bit Right aligned data */
  1368. #define DAC_DHR12RD_DACC2DHR ((uint32_t)0x0FFF0000) /*!<DAC channel2 12-bit Right aligned data */
  1369. /***************** Bit definition for DAC_DHR12LD register ******************/
  1370. #define DAC_DHR12LD_DACC1DHR ((uint32_t)0x0000FFF0) /*!<DAC channel1 12-bit Left aligned data */
  1371. #define DAC_DHR12LD_DACC2DHR ((uint32_t)0xFFF00000) /*!<DAC channel2 12-bit Left aligned data */
  1372. /****************** Bit definition for DAC_DHR8RD register ******************/
  1373. #define DAC_DHR8RD_DACC1DHR ((uint32_t)0x000000FF) /*!<DAC channel1 8-bit Right aligned data */
  1374. #define DAC_DHR8RD_DACC2DHR ((uint32_t)0x0000FF00) /*!<DAC channel2 8-bit Right aligned data */
  1375. /******************* Bit definition for DAC_DOR1 register *******************/
  1376. #define DAC_DOR1_DACC1DOR ((uint32_t)0x00000FFF) /*!<DAC channel1 data output */
  1377. /******************* Bit definition for DAC_DOR2 register *******************/
  1378. #define DAC_DOR2_DACC2DOR ((uint_t)0x00000FFF) /*!<DAC channel2 data output */
  1379. /******************** Bit definition for DAC_SR register ********************/
  1380. #define DAC_SR_DMAUDR1 ((uint32_t)0x00002000) /*!<DAC channel1 DMA underrun flag */
  1381. #define DAC_SR_DMAUDR2 ((uint32_t)0x20000000) /*!<DAC channel2 DMA underrun flag */
  1382. /******************************************************************************/
  1383. /* */
  1384. /* Debug MCU (DBGMCU) */
  1385. /* */
  1386. /******************************************************************************/
  1387. /**************** Bit definition for DBGMCU_IDCODE register *****************/
  1388. #define DBGMCU_IDCODE_DEV_ID ((uint32_t)0x00000FFF) /*!< Device Identifier */
  1389. #define DBGMCU_IDCODE_REV_ID ((uint32_t)0xFFFF0000) /*!< REV_ID[15:0] bits (Revision Identifier) */
  1390. #define DBGMCU_IDCODE_REV_ID_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  1391. #define DBGMCU_IDCODE_REV_ID_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  1392. #define DBGMCU_IDCODE_REV_ID_2 ((uint32_t)0x00040000) /*!< Bit 2 */
  1393. #define DBGMCU_IDCODE_REV_ID_3 ((uint32_t)0x00080000) /*!< Bit 3 */
  1394. #define DBGMCU_IDCODE_REV_ID_4 ((uint32_t)0x00100000) /*!< Bit 4 */
  1395. #define DBGMCU_IDCODE_REV_ID_5 ((uint32_t)0x00200000) /*!< Bit 5 */
  1396. #define DBGMCU_IDCODE_REV_ID_6 ((uint32_t)0x00400000) /*!< Bit 6 */
  1397. #define DBGMCU_IDCODE_REV_ID_7 ((uint32_t)0x00800000) /*!< Bit 7 */
  1398. #define DBGMCU_IDCODE_REV_ID_8 ((uint32_t)0x01000000) /*!< Bit 8 */
  1399. #define DBGMCU_IDCODE_REV_ID_9 ((uint32_t)0x02000000) /*!< Bit 9 */
  1400. #define DBGMCU_IDCODE_REV_ID_10 ((uint32_t)0x04000000) /*!< Bit 10 */
  1401. #define DBGMCU_IDCODE_REV_ID_11 ((uint32_t)0x08000000) /*!< Bit 11 */
  1402. #define DBGMCU_IDCODE_REV_ID_12 ((uint32_t)0x10000000) /*!< Bit 12 */
  1403. #define DBGMCU_IDCODE_REV_ID_13 ((uint32_t)0x20000000) /*!< Bit 13 */
  1404. #define DBGMCU_IDCODE_REV_ID_14 ((uint32_t)0x40000000) /*!< Bit 14 */
  1405. #define DBGMCU_IDCODE_REV_ID_15 ((uint32_t)0x80000000) /*!< Bit 15 */
  1406. /****************** Bit definition for DBGMCU_CR register *******************/
  1407. #define DBGMCU_CR_DBG_SLEEP ((uint32_t)0x00000001) /*!< Debug Sleep Mode */
  1408. #define DBGMCU_CR_DBG_STOP ((uint32_t)0x00000002) /*!< Debug Stop Mode */
  1409. #define DBGMCU_CR_DBG_STANDBY ((uint32_t)0x00000004) /*!< Debug Standby mode */
  1410. #define DBGMCU_CR_TRACE_IOEN ((uint32_t)0x00000020) /*!< Trace Pin Assignment Control */
  1411. #define DBGMCU_CR_TRACE_MODE ((uint32_t)0x000000C0) /*!< TRACE_MODE[1:0] bits (Trace Pin Assignment Control) */
  1412. #define DBGMCU_CR_TRACE_MODE_0 ((uint32_t)0x00000040) /*!< Bit 0 */
  1413. #define DBGMCU_CR_TRACE_MODE_1 ((uint32_t)0x00000080) /*!< Bit 1 */
  1414. /****************** Bit definition for DBGMCU_APB1_FZ register **************/
  1415. #define DBGMCU_APB1_FZ_DBG_TIM2_STOP ((uint32_t)0x00000001) /*!< TIM2 counter stopped when core is halted */
  1416. #define DBGMCU_APB1_FZ_DBG_TIM3_STOP ((uint32_t)0x00000002) /*!< TIM3 counter stopped when core is halted */
  1417. #define DBGMCU_APB1_FZ_DBG_TIM4_STOP ((uint32_t)0x00000004) /*!< TIM4 counter stopped when core is halted */
  1418. #define DBGMCU_APB1_FZ_DBG_TIM5_STOP ((uint32_t)0x00000008) /*!< TIM5 counter stopped when core is halted */
  1419. #define DBGMCU_APB1_FZ_DBG_TIM6_STOP ((uint32_t)0x00000010) /*!< TIM6 counter stopped when core is halted */
  1420. #define DBGMCU_APB1_FZ_DBG_TIM7_STOP ((uint32_t)0x00000020) /*!< TIM7 counter stopped when core is halted */
  1421. #define DBGMCU_APB1_FZ_DBG_RTC_STOP ((uint32_t)0x00000400) /*!< RTC Counter stopped when Core is halted */
  1422. #define DBGMCU_APB1_FZ_DBG_WWDG_STOP ((uint32_t)0x00000800) /*!< Debug Window Watchdog stopped when Core is halted */
  1423. #define DBGMCU_APB1_FZ_DBG_IWDG_STOP ((uint32_t)0x00001000) /*!< Debug Independent Watchdog stopped when Core is halted */
  1424. #define DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT ((uint32_t)0x00200000) /*!< SMBUS timeout mode stopped when Core is halted */
  1425. #define DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT ((uint32_t)0x00400000) /*!< SMBUS timeout mode stopped when Core is halted */
  1426. /****************** Bit definition for DBGMCU_APB2_FZ register **************/
  1427. #define DBGMCU_APB2_FZ_DBG_TIM9_STOP ((uint32_t)0x00000004) /*!< TIM9 counter stopped when core is halted */
  1428. #define DBGMCU_APB2_FZ_DBG_TIM10_STOP ((uint32_t)0x00000008) /*!< TIM10 counter stopped when core is halted */
  1429. #define DBGMCU_APB2_FZ_DBG_TIM11_STOP ((uint32_t)0x00000010) /*!< TIM11 counter stopped when core is halted */
  1430. /******************************************************************************/
  1431. /* */
  1432. /* DMA Controller (DMA) */
  1433. /* */
  1434. /******************************************************************************/
  1435. /******************* Bit definition for DMA_ISR register ********************/
  1436. #define DMA_ISR_GIF1 ((uint32_t)0x00000001) /*!< Channel 1 Global interrupt flag */
  1437. #define DMA_ISR_TCIF1 ((uint32_t)0x00000002) /*!< Channel 1 Transfer Complete flag */
  1438. #define DMA_ISR_HTIF1 ((uint32_t)0x00000004) /*!< Channel 1 Half Transfer flag */
  1439. #define DMA_ISR_TEIF1 ((uint32_t)0x00000008) /*!< Channel 1 Transfer Error flag */
  1440. #define DMA_ISR_GIF2 ((uint32_t)0x00000010) /*!< Channel 2 Global interrupt flag */
  1441. #define DMA_ISR_TCIF2 ((uint32_t)0x00000020) /*!< Channel 2 Transfer Complete flag */
  1442. #define DMA_ISR_HTIF2 ((uint32_t)0x00000040) /*!< Channel 2 Half Transfer flag */
  1443. #define DMA_ISR_TEIF2 ((uint32_t)0x00000080) /*!< Channel 2 Transfer Error flag */
  1444. #define DMA_ISR_GIF3 ((uint32_t)0x00000100) /*!< Channel 3 Global interrupt flag */
  1445. #define DMA_ISR_TCIF3 ((uint32_t)0x00000200) /*!< Channel 3 Transfer Complete flag */
  1446. #define DMA_ISR_HTIF3 ((uint32_t)0x00000400) /*!< Channel 3 Half Transfer flag */
  1447. #define DMA_ISR_TEIF3 ((uint32_t)0x00000800) /*!< Channel 3 Transfer Error flag */
  1448. #define DMA_ISR_GIF4 ((uint32_t)0x00001000) /*!< Channel 4 Global interrupt flag */
  1449. #define DMA_ISR_TCIF4 ((uint32_t)0x00002000) /*!< Channel 4 Transfer Complete flag */
  1450. #define DMA_ISR_HTIF4 ((uint32_t)0x00004000) /*!< Channel 4 Half Transfer flag */
  1451. #define DMA_ISR_TEIF4 ((uint32_t)0x00008000) /*!< Channel 4 Transfer Error flag */
  1452. #define DMA_ISR_GIF5 ((uint32_t)0x00010000) /*!< Channel 5 Global interrupt flag */
  1453. #define DMA_ISR_TCIF5 ((uint32_t)0x00020000) /*!< Channel 5 Transfer Complete flag */
  1454. #define DMA_ISR_HTIF5 ((uint32_t)0x00040000) /*!< Channel 5 Half Transfer flag */
  1455. #define DMA_ISR_TEIF5 ((uint32_t)0x00080000) /*!< Channel 5 Transfer Error flag */
  1456. #define DMA_ISR_GIF6 ((uint32_t)0x00100000) /*!< Channel 6 Global interrupt flag */
  1457. #define DMA_ISR_TCIF6 ((uint32_t)0x00200000) /*!< Channel 6 Transfer Complete flag */
  1458. #define DMA_ISR_HTIF6 ((uint32_t)0x00400000) /*!< Channel 6 Half Transfer flag */
  1459. #define DMA_ISR_TEIF6 ((uint32_t)0x00800000) /*!< Channel 6 Transfer Error flag */
  1460. #define DMA_ISR_GIF7 ((uint32_t)0x01000000) /*!< Channel 7 Global interrupt flag */
  1461. #define DMA_ISR_TCIF7 ((uint32_t)0x02000000) /*!< Channel 7 Transfer Complete flag */
  1462. #define DMA_ISR_HTIF7 ((uint32_t)0x04000000) /*!< Channel 7 Half Transfer flag */
  1463. #define DMA_ISR_TEIF7 ((uint32_t)0x08000000) /*!< Channel 7 Transfer Error flag */
  1464. /******************* Bit definition for DMA_IFCR register *******************/
  1465. #define DMA_IFCR_CGIF1 ((uint32_t)0x00000001) /*!< Channel 1 Global interrupt clear */
  1466. #define DMA_IFCR_CTCIF1 ((uint32_t)0x00000002) /*!< Channel 1 Transfer Complete clear */
  1467. #define DMA_IFCR_CHTIF1 ((uint32_t)0x00000004) /*!< Channel 1 Half Transfer clear */
  1468. #define DMA_IFCR_CTEIF1 ((uint32_t)0x00000008) /*!< Channel 1 Transfer Error clear */
  1469. #define DMA_IFCR_CGIF2 ((uint32_t)0x00000010) /*!< Channel 2 Global interrupt clear */
  1470. #define DMA_IFCR_CTCIF2 ((uint32_t)0x00000020) /*!< Channel 2 Transfer Complete clear */
  1471. #define DMA_IFCR_CHTIF2 ((uint32_t)0x00000040) /*!< Channel 2 Half Transfer clear */
  1472. #define DMA_IFCR_CTEIF2 ((uint32_t)0x00000080) /*!< Channel 2 Transfer Error clear */
  1473. #define DMA_IFCR_CGIF3 ((uint32_t)0x00000100) /*!< Channel 3 Global interrupt clear */
  1474. #define DMA_IFCR_CTCIF3 ((uint32_t)0x00000200) /*!< Channel 3 Transfer Complete clear */
  1475. #define DMA_IFCR_CHTIF3 ((uint32_t)0x00000400) /*!< Channel 3 Half Transfer clear */
  1476. #define DMA_IFCR_CTEIF3 ((uint32_t)0x00000800) /*!< Channel 3 Transfer Error clear */
  1477. #define DMA_IFCR_CGIF4 ((uint32_t)0x00001000) /*!< Channel 4 Global interrupt clear */
  1478. #define DMA_IFCR_CTCIF4 ((uint32_t)0x00002000) /*!< Channel 4 Transfer Complete clear */
  1479. #define DMA_IFCR_CHTIF4 ((uint32_t)0x00004000) /*!< Channel 4 Half Transfer clear */
  1480. #define DMA_IFCR_CTEIF4 ((uint32_t)0x00008000) /*!< Channel 4 Transfer Error clear */
  1481. #define DMA_IFCR_CGIF5 ((uint32_t)0x00010000) /*!< Channel 5 Global interrupt clear */
  1482. #define DMA_IFCR_CTCIF5 ((uint32_t)0x00020000) /*!< Channel 5 Transfer Complete clear */
  1483. #define DMA_IFCR_CHTIF5 ((uint32_t)0x00040000) /*!< Channel 5 Half Transfer clear */
  1484. #define DMA_IFCR_CTEIF5 ((uint32_t)0x00080000) /*!< Channel 5 Transfer Error clear */
  1485. #define DMA_IFCR_CGIF6 ((uint32_t)0x00100000) /*!< Channel 6 Global interrupt clear */
  1486. #define DMA_IFCR_CTCIF6 ((uint32_t)0x00200000) /*!< Channel 6 Transfer Complete clear */
  1487. #define DMA_IFCR_CHTIF6 ((uint32_t)0x00400000) /*!< Channel 6 Half Transfer clear */
  1488. #define DMA_IFCR_CTEIF6 ((uint32_t)0x00800000) /*!< Channel 6 Transfer Error clear */
  1489. #define DMA_IFCR_CGIF7 ((uint32_t)0x01000000) /*!< Channel 7 Global interrupt clear */
  1490. #define DMA_IFCR_CTCIF7 ((uint32_t)0x02000000) /*!< Channel 7 Transfer Complete clear */
  1491. #define DMA_IFCR_CHTIF7 ((uint32_t)0x04000000) /*!< Channel 7 Half Transfer clear */
  1492. #define DMA_IFCR_CTEIF7 ((uint32_t)0x08000000) /*!< Channel 7 Transfer Error clear */
  1493. /******************* Bit definition for DMA_CCR register *******************/
  1494. #define DMA_CCR_EN ((uint32_t)0x00000001) /*!< Channel enable*/
  1495. #define DMA_CCR_TCIE ((uint32_t)0x00000002) /*!< Transfer complete interrupt enable */
  1496. #define DMA_CCR_HTIE ((uint32_t)0x00000004) /*!< Half Transfer interrupt enable */
  1497. #define DMA_CCR_TEIE ((uint32_t)0x00000008) /*!< Transfer error interrupt enable */
  1498. #define DMA_CCR_DIR ((uint32_t)0x00000010) /*!< Data transfer direction */
  1499. #define DMA_CCR_CIRC ((uint32_t)0x00000020) /*!< Circular mode */
  1500. #define DMA_CCR_PINC ((uint32_t)0x00000040) /*!< Peripheral increment mode */
  1501. #define DMA_CCR_MINC ((uint32_t)0x00000080) /*!< Memory increment mode */
  1502. #define DMA_CCR_PSIZE ((uint32_t)0x00000300) /*!< PSIZE[1:0] bits (Peripheral size) */
  1503. #define DMA_CCR_PSIZE_0 ((uint32_t)0x00000100) /*!< Bit 0 */
  1504. #define DMA_CCR_PSIZE_1 ((uint32_t)0x00000200) /*!< Bit 1 */
  1505. #define DMA_CCR_MSIZE ((uint32_t)0x00000C00) /*!< MSIZE[1:0] bits (Memory size) */
  1506. #define DMA_CCR_MSIZE_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  1507. #define DMA_CCR_MSIZE_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  1508. #define DMA_CCR_PL ((uint32_t)0x00003000) /*!< PL[1:0] bits(Channel Priority level) */
  1509. #define DMA_CCR_PL_0 ((uint32_t)0x00001000) /*!< Bit 0 */
  1510. #define DMA_CCR_PL_1 ((uint32_t)0x00002000) /*!< Bit 1 */
  1511. #define DMA_CCR_MEM2MEM ((uint32_t)0x00004000) /*!< Memory to memory mode */
  1512. /****************** Bit definition for DMA_CNDTR1 register ******************/
  1513. #define DMA_CNDTR1_NDT ((uint32_t)0x0000FFFF) /*!< Number of data to Transfer */
  1514. /****************** Bit definition for DMA_CNDTR2 register ******************/
  1515. #define DMA_CNDTR2_NDT ((uint32_t)0x0000FFFF) /*!< Number of data to Transfer */
  1516. /****************** Bit definition for DMA_CNDTR3 register ******************/
  1517. #define DMA_CNDTR3_NDT ((uint32_t)0x0000FFFF) /*!< Number of data to Transfer */
  1518. /****************** Bit definition for DMA_CNDTR4 register ******************/
  1519. #define DMA_CNDTR4_NDT ((uint32_t)0x0000FFFF) /*!< Number of data to Transfer */
  1520. /****************** Bit definition for DMA_CNDTR5 register ******************/
  1521. #define DMA_CNDTR5_NDT ((uint32_t)0x0000FFFF) /*!< Number of data to Transfer */
  1522. /****************** Bit definition for DMA_CNDTR6 register ******************/
  1523. #define DMA_CNDTR6_NDT ((uint32_t)0x0000FFFF) /*!< Number of data to Transfer */
  1524. /****************** Bit definition for DMA_CNDTR7 register ******************/
  1525. #define DMA_CNDTR7_NDT ((uint32_t)0x0000FFFF) /*!< Number of data to Transfer */
  1526. /****************** Bit definition for DMA_CPAR1 register *******************/
  1527. #define DMA_CPAR1_PA ((uint32_t)0xFFFFFFFF) /*!< Peripheral Address */
  1528. /****************** Bit definition for DMA_CPAR2 register *******************/
  1529. #define DMA_CPAR2_PA ((uint32_t)0xFFFFFFFF) /*!< Peripheral Address */
  1530. /****************** Bit definition for DMA_CPAR3 register *******************/
  1531. #define DMA_CPAR3_PA ((uint32_t)0xFFFFFFFF) /*!< Peripheral Address */
  1532. /****************** Bit definition for DMA_CPAR4 register *******************/
  1533. #define DMA_CPAR4_PA ((uint32_t)0xFFFFFFFF) /*!< Peripheral Address */
  1534. /****************** Bit definition for DMA_CPAR5 register *******************/
  1535. #define DMA_CPAR5_PA ((uint32_t)0xFFFFFFFF) /*!< Peripheral Address */
  1536. /****************** Bit definition for DMA_CPAR6 register *******************/
  1537. #define DMA_CPAR6_PA ((uint32_t)0xFFFFFFFF) /*!< Peripheral Address */
  1538. /****************** Bit definition for DMA_CPAR7 register *******************/
  1539. #define DMA_CPAR7_PA ((uint32_t)0xFFFFFFFF) /*!< Peripheral Address */
  1540. /****************** Bit definition for DMA_CMAR1 register *******************/
  1541. #define DMA_CMAR1_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  1542. /****************** Bit definition for DMA_CMAR2 register *******************/
  1543. #define DMA_CMAR2_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  1544. /****************** Bit definition for DMA_CMAR3 register *******************/
  1545. #define DMA_CMAR3_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  1546. /****************** Bit definition for DMA_CMAR4 register *******************/
  1547. #define DMA_CMAR4_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  1548. /****************** Bit definition for DMA_CMAR5 register *******************/
  1549. #define DMA_CMAR5_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  1550. /****************** Bit definition for DMA_CMAR6 register *******************/
  1551. #define DMA_CMAR6_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  1552. /****************** Bit definition for DMA_CMAR7 register *******************/
  1553. #define DMA_CMAR7_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  1554. /******************************************************************************/
  1555. /* */
  1556. /* External Interrupt/Event Controller (EXTI) */
  1557. /* */
  1558. /******************************************************************************/
  1559. /******************* Bit definition for EXTI_IMR register *******************/
  1560. #define EXTI_IMR_MR0 ((uint32_t)0x00000001) /*!< Interrupt Mask on line 0 */
  1561. #define EXTI_IMR_MR1 ((uint32_t)0x00000002) /*!< Interrupt Mask on line 1 */
  1562. #define EXTI_IMR_MR2 ((uint32_t)0x00000004) /*!< Interrupt Mask on line 2 */
  1563. #define EXTI_IMR_MR3 ((uint32_t)0x00000008) /*!< Interrupt Mask on line 3 */
  1564. #define EXTI_IMR_MR4 ((uint32_t)0x00000010) /*!< Interrupt Mask on line 4 */
  1565. #define EXTI_IMR_MR5 ((uint32_t)0x00000020) /*!< Interrupt Mask on line 5 */
  1566. #define EXTI_IMR_MR6 ((uint32_t)0x00000040) /*!< Interrupt Mask on line 6 */
  1567. #define EXTI_IMR_MR7 ((uint32_t)0x00000080) /*!< Interrupt Mask on line 7 */
  1568. #define EXTI_IMR_MR8 ((uint32_t)0x00000100) /*!< Interrupt Mask on line 8 */
  1569. #define EXTI_IMR_MR9 ((uint32_t)0x00000200) /*!< Interrupt Mask on line 9 */
  1570. #define EXTI_IMR_MR10 ((uint32_t)0x00000400) /*!< Interrupt Mask on line 10 */
  1571. #define EXTI_IMR_MR11 ((uint32_t)0x00000800) /*!< Interrupt Mask on line 11 */
  1572. #define EXTI_IMR_MR12 ((uint32_t)0x00001000) /*!< Interrupt Mask on line 12 */
  1573. #define EXTI_IMR_MR13 ((uint32_t)0x00002000) /*!< Interrupt Mask on line 13 */
  1574. #define EXTI_IMR_MR14 ((uint32_t)0x00004000) /*!< Interrupt Mask on line 14 */
  1575. #define EXTI_IMR_MR15 ((uint32_t)0x00008000) /*!< Interrupt Mask on line 15 */
  1576. #define EXTI_IMR_MR16 ((uint32_t)0x00010000) /*!< Interrupt Mask on line 16 */
  1577. #define EXTI_IMR_MR17 ((uint32_t)0x00020000) /*!< Interrupt Mask on line 17 */
  1578. #define EXTI_IMR_MR18 ((uint32_t)0x00040000) /*!< Interrupt Mask on line 18 */
  1579. #define EXTI_IMR_MR19 ((uint32_t)0x00080000) /*!< Interrupt Mask on line 19 */
  1580. #define EXTI_IMR_MR20 ((uint32_t)0x00100000) /*!< Interrupt Mask on line 20 */
  1581. #define EXTI_IMR_MR21 ((uint32_t)0x00200000) /*!< Interrupt Mask on line 21 */
  1582. #define EXTI_IMR_MR22 ((uint32_t)0x00400000) /*!< Interrupt Mask on line 22 */
  1583. #define EXTI_IMR_MR23 ((uint32_t)0x00800000) /*!< Interrupt Mask on line 23 */
  1584. /******************* Bit definition for EXTI_EMR register *******************/
  1585. #define EXTI_EMR_MR0 ((uint32_t)0x00000001) /*!< Event Mask on line 0 */
  1586. #define EXTI_EMR_MR1 ((uint32_t)0x00000002) /*!< Event Mask on line 1 */
  1587. #define EXTI_EMR_MR2 ((uint32_t)0x00000004) /*!< Event Mask on line 2 */
  1588. #define EXTI_EMR_MR3 ((uint32_t)0x00000008) /*!< Event Mask on line 3 */
  1589. #define EXTI_EMR_MR4 ((uint32_t)0x00000010) /*!< Event Mask on line 4 */
  1590. #define EXTI_EMR_MR5 ((uint32_t)0x00000020) /*!< Event Mask on line 5 */
  1591. #define EXTI_EMR_MR6 ((uint32_t)0x00000040) /*!< Event Mask on line 6 */
  1592. #define EXTI_EMR_MR7 ((uint32_t)0x00000080) /*!< Event Mask on line 7 */
  1593. #define EXTI_EMR_MR8 ((uint32_t)0x00000100) /*!< Event Mask on line 8 */
  1594. #define EXTI_EMR_MR9 ((uint32_t)0x00000200) /*!< Event Mask on line 9 */
  1595. #define EXTI_EMR_MR10 ((uint32_t)0x00000400) /*!< Event Mask on line 10 */
  1596. #define EXTI_EMR_MR11 ((uint32_t)0x00000800) /*!< Event Mask on line 11 */
  1597. #define EXTI_EMR_MR12 ((uint32_t)0x00001000) /*!< Event Mask on line 12 */
  1598. #define EXTI_EMR_MR13 ((uint32_t)0x00002000) /*!< Event Mask on line 13 */
  1599. #define EXTI_EMR_MR14 ((uint32_t)0x00004000) /*!< Event Mask on line 14 */
  1600. #define EXTI_EMR_MR15 ((uint32_t)0x00008000) /*!< Event Mask on line 15 */
  1601. #define EXTI_EMR_MR16 ((uint32_t)0x00010000) /*!< Event Mask on line 16 */
  1602. #define EXTI_EMR_MR17 ((uint32_t)0x00020000) /*!< Event Mask on line 17 */
  1603. #define EXTI_EMR_MR18 ((uint32_t)0x00040000) /*!< Event Mask on line 18 */
  1604. #define EXTI_EMR_MR19 ((uint32_t)0x00080000) /*!< Event Mask on line 19 */
  1605. #define EXTI_EMR_MR20 ((uint32_t)0x00100000) /*!< Event Mask on line 20 */
  1606. #define EXTI_EMR_MR21 ((uint32_t)0x00200000) /*!< Event Mask on line 21 */
  1607. #define EXTI_EMR_MR22 ((uint32_t)0x00400000) /*!< Event Mask on line 22 */
  1608. #define EXTI_EMR_MR23 ((uint32_t)0x00800000) /*!< Event Mask on line 23 */
  1609. /****************** Bit definition for EXTI_RTSR register *******************/
  1610. #define EXTI_RTSR_TR0 ((uint32_t)0x00000001) /*!< Rising trigger event configuration bit of line 0 */
  1611. #define EXTI_RTSR_TR1 ((uint32_t)0x00000002) /*!< Rising trigger event configuration bit of line 1 */
  1612. #define EXTI_RTSR_TR2 ((uint32_t)0x00000004) /*!< Rising trigger event configuration bit of line 2 */
  1613. #define EXTI_RTSR_TR3 ((uint32_t)0x00000008) /*!< Rising trigger event configuration bit of line 3 */
  1614. #define EXTI_RTSR_TR4 ((uint32_t)0x00000010) /*!< Rising trigger event configuration bit of line 4 */
  1615. #define EXTI_RTSR_TR5 ((uint32_t)0x00000020) /*!< Rising trigger event configuration bit of line 5 */
  1616. #define EXTI_RTSR_TR6 ((uint32_t)0x00000040) /*!< Rising trigger event configuration bit of line 6 */
  1617. #define EXTI_RTSR_TR7 ((uint32_t)0x00000080) /*!< Rising trigger event configuration bit of line 7 */
  1618. #define EXTI_RTSR_TR8 ((uint32_t)0x00000100) /*!< Rising trigger event configuration bit of line 8 */
  1619. #define EXTI_RTSR_TR9 ((uint32_t)0x00000200) /*!< Rising trigger event configuration bit of line 9 */
  1620. #define EXTI_RTSR_TR10 ((uint32_t)0x00000400) /*!< Rising trigger event configuration bit of line 10 */
  1621. #define EXTI_RTSR_TR11 ((uint32_t)0x00000800) /*!< Rising trigger event configuration bit of line 11 */
  1622. #define EXTI_RTSR_TR12 ((uint32_t)0x00001000) /*!< Rising trigger event configuration bit of line 12 */
  1623. #define EXTI_RTSR_TR13 ((uint32_t)0x00002000) /*!< Rising trigger event configuration bit of line 13 */
  1624. #define EXTI_RTSR_TR14 ((uint32_t)0x00004000) /*!< Rising trigger event configuration bit of line 14 */
  1625. #define EXTI_RTSR_TR15 ((uint32_t)0x00008000) /*!< Rising trigger event configuration bit of line 15 */
  1626. #define EXTI_RTSR_TR16 ((uint32_t)0x00010000) /*!< Rising trigger event configuration bit of line 16 */
  1627. #define EXTI_RTSR_TR17 ((uint32_t)0x00020000) /*!< Rising trigger event configuration bit of line 17 */
  1628. #define EXTI_RTSR_TR18 ((uint32_t)0x00040000) /*!< Rising trigger event configuration bit of line 18 */
  1629. #define EXTI_RTSR_TR19 ((uint32_t)0x00080000) /*!< Rising trigger event configuration bit of line 19 */
  1630. #define EXTI_RTSR_TR20 ((uint32_t)0x00100000) /*!< Rising trigger event configuration bit of line 20 */
  1631. #define EXTI_RTSR_TR21 ((uint32_t)0x00200000) /*!< Rising trigger event configuration bit of line 21 */
  1632. #define EXTI_RTSR_TR22 ((uint32_t)0x00400000) /*!< Rising trigger event configuration bit of line 22 */
  1633. #define EXTI_RTSR_TR23 ((uint32_t)0x00800000) /*!< Rising trigger event configuration bit of line 23 */
  1634. /****************** Bit definition for EXTI_FTSR register *******************/
  1635. #define EXTI_FTSR_TR0 ((uint32_t)0x00000001) /*!< Falling trigger event configuration bit of line 0 */
  1636. #define EXTI_FTSR_TR1 ((uint32_t)0x00000002) /*!< Falling trigger event configuration bit of line 1 */
  1637. #define EXTI_FTSR_TR2 ((uint32_t)0x00000004) /*!< Falling trigger event configuration bit of line 2 */
  1638. #define EXTI_FTSR_TR3 ((uint32_t)0x00000008) /*!< Falling trigger event configuration bit of line 3 */
  1639. #define EXTI_FTSR_TR4 ((uint32_t)0x00000010) /*!< Falling trigger event configuration bit of line 4 */
  1640. #define EXTI_FTSR_TR5 ((uint32_t)0x00000020) /*!< Falling trigger event configuration bit of line 5 */
  1641. #define EXTI_FTSR_TR6 ((uint32_t)0x00000040) /*!< Falling trigger event configuration bit of line 6 */
  1642. #define EXTI_FTSR_TR7 ((uint32_t)0x00000080) /*!< Falling trigger event configuration bit of line 7 */
  1643. #define EXTI_FTSR_TR8 ((uint32_t)0x00000100) /*!< Falling trigger event configuration bit of line 8 */
  1644. #define EXTI_FTSR_TR9 ((uint32_t)0x00000200) /*!< Falling trigger event configuration bit of line 9 */
  1645. #define EXTI_FTSR_TR10 ((uint32_t)0x00000400) /*!< Falling trigger event configuration bit of line 10 */
  1646. #define EXTI_FTSR_TR11 ((uint32_t)0x00000800) /*!< Falling trigger event configuration bit of line 11 */
  1647. #define EXTI_FTSR_TR12 ((uint32_t)0x00001000) /*!< Falling trigger event configuration bit of line 12 */
  1648. #define EXTI_FTSR_TR13 ((uint32_t)0x00002000) /*!< Falling trigger event configuration bit of line 13 */
  1649. #define EXTI_FTSR_TR14 ((uint32_t)0x00004000) /*!< Falling trigger event configuration bit of line 14 */
  1650. #define EXTI_FTSR_TR15 ((uint32_t)0x00008000) /*!< Falling trigger event configuration bit of line 15 */
  1651. #define EXTI_FTSR_TR16 ((uint32_t)0x00010000) /*!< Falling trigger event configuration bit of line 16 */
  1652. #define EXTI_FTSR_TR17 ((uint32_t)0x00020000) /*!< Falling trigger event configuration bit of line 17 */
  1653. #define EXTI_FTSR_TR18 ((uint32_t)0x00040000) /*!< Falling trigger event configuration bit of line 18 */
  1654. #define EXTI_FTSR_TR19 ((uint32_t)0x00080000) /*!< Falling trigger event configuration bit of line 19 */
  1655. #define EXTI_FTSR_TR20 ((uint32_t)0x00100000) /*!< Falling trigger event configuration bit of line 20 */
  1656. #define EXTI_FTSR_TR21 ((uint32_t)0x00200000) /*!< Falling trigger event configuration bit of line 21 */
  1657. #define EXTI_FTSR_TR22 ((uint32_t)0x00400000) /*!< Falling trigger event configuration bit of line 22 */
  1658. #define EXTI_FTSR_TR23 ((uint32_t)0x00800000) /*!< Falling trigger event configuration bit of line 23 */
  1659. /****************** Bit definition for EXTI_SWIER register ******************/
  1660. #define EXTI_SWIER_SWIER0 ((uint32_t)0x00000001) /*!< Software Interrupt on line 0 */
  1661. #define EXTI_SWIER_SWIER1 ((uint32_t)0x00000002) /*!< Software Interrupt on line 1 */
  1662. #define EXTI_SWIER_SWIER2 ((uint32_t)0x00000004) /*!< Software Interrupt on line 2 */
  1663. #define EXTI_SWIER_SWIER3 ((uint32_t)0x00000008) /*!< Software Interrupt on line 3 */
  1664. #define EXTI_SWIER_SWIER4 ((uint32_t)0x00000010) /*!< Software Interrupt on line 4 */
  1665. #define EXTI_SWIER_SWIER5 ((uint32_t)0x00000020) /*!< Software Interrupt on line 5 */
  1666. #define EXTI_SWIER_SWIER6 ((uint32_t)0x00000040) /*!< Software Interrupt on line 6 */
  1667. #define EXTI_SWIER_SWIER7 ((uint32_t)0x00000080) /*!< Software Interrupt on line 7 */
  1668. #define EXTI_SWIER_SWIER8 ((uint32_t)0x00000100) /*!< Software Interrupt on line 8 */
  1669. #define EXTI_SWIER_SWIER9 ((uint32_t)0x00000200) /*!< Software Interrupt on line 9 */
  1670. #define EXTI_SWIER_SWIER10 ((uint32_t)0x00000400) /*!< Software Interrupt on line 10 */
  1671. #define EXTI_SWIER_SWIER11 ((uint32_t)0x00000800) /*!< Software Interrupt on line 11 */
  1672. #define EXTI_SWIER_SWIER12 ((uint32_t)0x00001000) /*!< Software Interrupt on line 12 */
  1673. #define EXTI_SWIER_SWIER13 ((uint32_t)0x00002000) /*!< Software Interrupt on line 13 */
  1674. #define EXTI_SWIER_SWIER14 ((uint32_t)0x00004000) /*!< Software Interrupt on line 14 */
  1675. #define EXTI_SWIER_SWIER15 ((uint32_t)0x00008000) /*!< Software Interrupt on line 15 */
  1676. #define EXTI_SWIER_SWIER16 ((uint32_t)0x00010000) /*!< Software Interrupt on line 16 */
  1677. #define EXTI_SWIER_SWIER17 ((uint32_t)0x00020000) /*!< Software Interrupt on line 17 */
  1678. #define EXTI_SWIER_SWIER18 ((uint32_t)0x00040000) /*!< Software Interrupt on line 18 */
  1679. #define EXTI_SWIER_SWIER19 ((uint32_t)0x00080000) /*!< Software Interrupt on line 19 */
  1680. #define EXTI_SWIER_SWIER20 ((uint32_t)0x00100000) /*!< Software Interrupt on line 20 */
  1681. #define EXTI_SWIER_SWIER21 ((uint32_t)0x00200000) /*!< Software Interrupt on line 21 */
  1682. #define EXTI_SWIER_SWIER22 ((uint32_t)0x00400000) /*!< Software Interrupt on line 22 */
  1683. #define EXTI_SWIER_SWIER23 ((uint32_t)0x00800000) /*!< Software Interrupt on line 23 */
  1684. /******************* Bit definition for EXTI_PR register ********************/
  1685. #define EXTI_PR_PR0 ((uint32_t)0x00000001) /*!< Pending bit 0 */
  1686. #define EXTI_PR_PR1 ((uint32_t)0x00000002) /*!< Pending bit 1 */
  1687. #define EXTI_PR_PR2 ((uint32_t)0x00000004) /*!< Pending bit 2 */
  1688. #define EXTI_PR_PR3 ((uint32_t)0x00000008) /*!< Pending bit 3 */
  1689. #define EXTI_PR_PR4 ((uint32_t)0x00000010) /*!< Pending bit 4 */
  1690. #define EXTI_PR_PR5 ((uint32_t)0x00000020) /*!< Pending bit 5 */
  1691. #define EXTI_PR_PR6 ((uint32_t)0x00000040) /*!< Pending bit 6 */
  1692. #define EXTI_PR_PR7 ((uint32_t)0x00000080) /*!< Pending bit 7 */
  1693. #define EXTI_PR_PR8 ((uint32_t)0x00000100) /*!< Pending bit 8 */
  1694. #define EXTI_PR_PR9 ((uint32_t)0x00000200) /*!< Pending bit 9 */
  1695. #define EXTI_PR_PR10 ((uint32_t)0x00000400) /*!< Pending bit 10 */
  1696. #define EXTI_PR_PR11 ((uint32_t)0x00000800) /*!< Pending bit 11 */
  1697. #define EXTI_PR_PR12 ((uint32_t)0x00001000) /*!< Pending bit 12 */
  1698. #define EXTI_PR_PR13 ((uint32_t)0x00002000) /*!< Pending bit 13 */
  1699. #define EXTI_PR_PR14 ((uint32_t)0x00004000) /*!< Pending bit 14 */
  1700. #define EXTI_PR_PR15 ((uint32_t)0x00008000) /*!< Pending bit 15 */
  1701. #define EXTI_PR_PR16 ((uint32_t)0x00010000) /*!< Pending bit 16 */
  1702. #define EXTI_PR_PR17 ((uint32_t)0x00020000) /*!< Pending bit 17 */
  1703. #define EXTI_PR_PR18 ((uint32_t)0x00040000) /*!< Pending bit 18 */
  1704. #define EXTI_PR_PR19 ((uint32_t)0x00080000) /*!< Pending bit 19 */
  1705. #define EXTI_PR_PR20 ((uint32_t)0x00100000) /*!< Pending bit 20 */
  1706. #define EXTI_PR_PR21 ((uint32_t)0x00200000) /*!< Pending bit 21 */
  1707. #define EXTI_PR_PR22 ((uint32_t)0x00400000) /*!< Pending bit 22 */
  1708. #define EXTI_PR_PR23 ((uint32_t)0x00800000) /*!< Pending bit 23 */
  1709. /******************************************************************************/
  1710. /* */
  1711. /* FLASH, DATA EEPROM and Option Bytes Registers */
  1712. /* (FLASH, DATA_EEPROM, OB) */
  1713. /* */
  1714. /******************************************************************************/
  1715. /******************* Bit definition for FLASH_ACR register ******************/
  1716. #define FLASH_ACR_LATENCY ((uint32_t)0x00000001) /*!< Latency */
  1717. #define FLASH_ACR_PRFTEN ((uint32_t)0x00000002) /*!< Prefetch Buffer Enable */
  1718. #define FLASH_ACR_ACC64 ((uint32_t)0x00000004) /*!< Access 64 bits */
  1719. #define FLASH_ACR_SLEEP_PD ((uint32_t)0x00000008) /*!< Flash mode during sleep mode */
  1720. #define FLASH_ACR_RUN_PD ((uint32_t)0x00000010) /*!< Flash mode during RUN mode */
  1721. /******************* Bit definition for FLASH_PECR register ******************/
  1722. #define FLASH_PECR_PELOCK ((uint32_t)0x00000001) /*!< FLASH_PECR and Flash data Lock */
  1723. #define FLASH_PECR_PRGLOCK ((uint32_t)0x00000002) /*!< Program matrix Lock */
  1724. #define FLASH_PECR_OPTLOCK ((uint32_t)0x00000004) /*!< Option byte matrix Lock */
  1725. #define FLASH_PECR_PROG ((uint32_t)0x00000008) /*!< Program matrix selection */
  1726. #define FLASH_PECR_DATA ((uint32_t)0x00000010) /*!< Data matrix selection */
  1727. #define FLASH_PECR_FTDW ((uint32_t)0x00000100) /*!< Fixed Time Data write for Word/Half Word/Byte programming */
  1728. #define FLASH_PECR_ERASE ((uint32_t)0x00000200) /*!< Page erasing mode */
  1729. #define FLASH_PECR_FPRG ((uint32_t)0x00000400) /*!< Fast Page/Half Page programming mode */
  1730. #define FLASH_PECR_EOPIE ((uint32_t)0x00010000) /*!< End of programming interrupt */
  1731. #define FLASH_PECR_ERRIE ((uint32_t)0x00020000) /*!< Error interrupt */
  1732. #define FLASH_PECR_OBL_LAUNCH ((uint32_t)0x00040000) /*!< Launch the option byte loading */
  1733. /****************** Bit definition for FLASH_PDKEYR register ******************/
  1734. #define FLASH_PDKEYR_PDKEYR ((uint32_t)0xFFFFFFFF) /*!< FLASH_PEC and data matrix Key */
  1735. /****************** Bit definition for FLASH_PEKEYR register ******************/
  1736. #define FLASH_PEKEYR_PEKEYR ((uint32_t)0xFFFFFFFF) /*!< FLASH_PEC and data matrix Key */
  1737. /****************** Bit definition for FLASH_PRGKEYR register ******************/
  1738. #define FLASH_PRGKEYR_PRGKEYR ((uint32_t)0xFFFFFFFF) /*!< Program matrix Key */
  1739. /****************** Bit definition for FLASH_OPTKEYR register ******************/
  1740. #define FLASH_OPTKEYR_OPTKEYR ((uint32_t)0xFFFFFFFF) /*!< Option bytes matrix Key */
  1741. /****************** Bit definition for FLASH_SR register *******************/
  1742. #define FLASH_SR_BSY ((uint32_t)0x00000001) /*!< Busy */
  1743. #define FLASH_SR_EOP ((uint32_t)0x00000002) /*!< End Of Programming*/
  1744. #define FLASH_SR_ENDHV ((uint32_t)0x00000004) /*!< End of high voltage */
  1745. #define FLASH_SR_READY ((uint32_t)0x00000008) /*!< Flash ready after low power mode */
  1746. #define FLASH_SR_WRPERR ((uint32_t)0x00000100) /*!< Write protected error */
  1747. #define FLASH_SR_PGAERR ((uint32_t)0x00000200) /*!< Programming Alignment Error */
  1748. #define FLASH_SR_SIZERR ((uint32_t)0x00000400) /*!< Size error */
  1749. #define FLASH_SR_OPTVERR ((uint32_t)0x00000800) /*!< Option validity error */
  1750. #define FLASH_SR_OPTVERRUSR ((uint32_t)0x00001000) /*!< Option User validity error */
  1751. #define FLASH_SR_RDERR ((uint32_t)0x00002000) /*!< Read protected error */
  1752. /****************** Bit definition for FLASH_OBR register *******************/
  1753. #define FLASH_OBR_RDPRT ((uint32_t)0x000000FF) /*!< Read Protection */
  1754. #define FLASH_OBR_SPRMOD ((uint32_t)0x00000100) /*!< Selection of protection mode of WPRi bits */
  1755. #define FLASH_OBR_BOR_LEV ((uint32_t)0x000F0000) /*!< BOR_LEV[3:0] Brown Out Reset Threshold Level*/
  1756. #define FLASH_OBR_USER ((uint32_t)0x00700000) /*!< User Option Bytes */
  1757. #define FLASH_OBR_IWDG_SW ((uint32_t)0x00100000) /*!< IWDG_SW */
  1758. #define FLASH_OBR_nRST_STOP ((uint32_t)0x00200000) /*!< nRST_STOP */
  1759. #define FLASH_OBR_nRST_STDBY ((uint32_t)0x00400000) /*!< nRST_STDBY */
  1760. /****************** Bit definition for FLASH_WRPR register ******************/
  1761. #define FLASH_WRPR1_WRP ((uint32_t)0xFFFFFFFF) /*!< Write Protect */
  1762. #define FLASH_WRPR2_WRP ((uint32_t)0xFFFFFFFF) /*!< Write Protect */
  1763. /******************************************************************************/
  1764. /* */
  1765. /* General Purpose I/O */
  1766. /* */
  1767. /******************************************************************************/
  1768. /****************** Bits definition for GPIO_MODER register *****************/
  1769. #define GPIO_MODER_MODER0 ((uint32_t)0x00000003)
  1770. #define GPIO_MODER_MODER0_0 ((uint32_t)0x00000001)
  1771. #define GPIO_MODER_MODER0_1 ((uint32_t)0x00000002)
  1772. #define GPIO_MODER_MODER1 ((uint32_t)0x0000000C)
  1773. #define GPIO_MODER_MODER1_0 ((uint32_t)0x00000004)
  1774. #define GPIO_MODER_MODER1_1 ((uint32_t)0x00000008)
  1775. #define GPIO_MODER_MODER2 ((uint32_t)0x00000030)
  1776. #define GPIO_MODER_MODER2_0 ((uint32_t)0x00000010)
  1777. #define GPIO_MODER_MODER2_1 ((uint32_t)0x00000020)
  1778. #define GPIO_MODER_MODER3 ((uint32_t)0x000000C0)
  1779. #define GPIO_MODER_MODER3_0 ((uint32_t)0x00000040)
  1780. #define GPIO_MODER_MODER3_1 ((uint32_t)0x00000080)
  1781. #define GPIO_MODER_MODER4 ((uint32_t)0x00000300)
  1782. #define GPIO_MODER_MODER4_0 ((uint32_t)0x00000100)
  1783. #define GPIO_MODER_MODER4_1 ((uint32_t)0x00000200)
  1784. #define GPIO_MODER_MODER5 ((uint32_t)0x00000C00)
  1785. #define GPIO_MODER_MODER5_0 ((uint32_t)0x00000400)
  1786. #define GPIO_MODER_MODER5_1 ((uint32_t)0x00000800)
  1787. #define GPIO_MODER_MODER6 ((uint32_t)0x00003000)
  1788. #define GPIO_MODER_MODER6_0 ((uint32_t)0x00001000)
  1789. #define GPIO_MODER_MODER6_1 ((uint32_t)0x00002000)
  1790. #define GPIO_MODER_MODER7 ((uint32_t)0x0000C000)
  1791. #define GPIO_MODER_MODER7_0 ((uint32_t)0x00004000)
  1792. #define GPIO_MODER_MODER7_1 ((uint32_t)0x00008000)
  1793. #define GPIO_MODER_MODER8 ((uint32_t)0x00030000)
  1794. #define GPIO_MODER_MODER8_0 ((uint32_t)0x00010000)
  1795. #define GPIO_MODER_MODER8_1 ((uint32_t)0x00020000)
  1796. #define GPIO_MODER_MODER9 ((uint32_t)0x000C0000)
  1797. #define GPIO_MODER_MODER9_0 ((uint32_t)0x00040000)
  1798. #define GPIO_MODER_MODER9_1 ((uint32_t)0x00080000)
  1799. #define GPIO_MODER_MODER10 ((uint32_t)0x00300000)
  1800. #define GPIO_MODER_MODER10_0 ((uint32_t)0x00100000)
  1801. #define GPIO_MODER_MODER10_1 ((uint32_t)0x00200000)
  1802. #define GPIO_MODER_MODER11 ((uint32_t)0x00C00000)
  1803. #define GPIO_MODER_MODER11_0 ((uint32_t)0x00400000)
  1804. #define GPIO_MODER_MODER11_1 ((uint32_t)0x00800000)
  1805. #define GPIO_MODER_MODER12 ((uint32_t)0x03000000)
  1806. #define GPIO_MODER_MODER12_0 ((uint32_t)0x01000000)
  1807. #define GPIO_MODER_MODER12_1 ((uint32_t)0x02000000)
  1808. #define GPIO_MODER_MODER13 ((uint32_t)0x0C000000)
  1809. #define GPIO_MODER_MODER13_0 ((uint32_t)0x04000000)
  1810. #define GPIO_MODER_MODER13_1 ((uint32_t)0x08000000)
  1811. #define GPIO_MODER_MODER14 ((uint32_t)0x30000000)
  1812. #define GPIO_MODER_MODER14_0 ((uint32_t)0x10000000)
  1813. #define GPIO_MODER_MODER14_1 ((uint32_t)0x20000000)
  1814. #define GPIO_MODER_MODER15 ((uint32_t)0xC0000000)
  1815. #define GPIO_MODER_MODER15_0 ((uint32_t)0x40000000)
  1816. #define GPIO_MODER_MODER15_1 ((uint32_t)0x80000000)
  1817. /****************** Bits definition for GPIO_OTYPER register ****************/
  1818. #define GPIO_OTYPER_OT_0 ((uint32_t)0x00000001)
  1819. #define GPIO_OTYPER_OT_1 ((uint32_t)0x00000002)
  1820. #define GPIO_OTYPER_OT_2 ((uint32_t)0x00000004)
  1821. #define GPIO_OTYPER_OT_3 ((uint32_t)0x00000008)
  1822. #define GPIO_OTYPER_OT_4 ((uint32_t)0x00000010)
  1823. #define GPIO_OTYPER_OT_5 ((uint32_t)0x00000020)
  1824. #define GPIO_OTYPER_OT_6 ((uint32_t)0x00000040)
  1825. #define GPIO_OTYPER_OT_7 ((uint32_t)0x00000080)
  1826. #define GPIO_OTYPER_OT_8 ((uint32_t)0x00000100)
  1827. #define GPIO_OTYPER_OT_9 ((uint32_t)0x00000200)
  1828. #define GPIO_OTYPER_OT_10 ((uint32_t)0x00000400)
  1829. #define GPIO_OTYPER_OT_11 ((uint32_t)0x00000800)
  1830. #define GPIO_OTYPER_OT_12 ((uint32_t)0x00001000)
  1831. #define GPIO_OTYPER_OT_13 ((uint32_t)0x00002000)
  1832. #define GPIO_OTYPER_OT_14 ((uint32_t)0x00004000)
  1833. #define GPIO_OTYPER_OT_15 ((uint32_t)0x00008000)
  1834. /****************** Bits definition for GPIO_OSPEEDR register ***************/
  1835. #define GPIO_OSPEEDER_OSPEEDR0 ((uint32_t)0x00000003)
  1836. #define GPIO_OSPEEDER_OSPEEDR0_0 ((uint32_t)0x00000001)
  1837. #define GPIO_OSPEEDER_OSPEEDR0_1 ((uint32_t)0x00000002)
  1838. #define GPIO_OSPEEDER_OSPEEDR1 ((uint32_t)0x0000000C)
  1839. #define GPIO_OSPEEDER_OSPEEDR1_0 ((uint32_t)0x00000004)
  1840. #define GPIO_OSPEEDER_OSPEEDR1_1 ((uint32_t)0x00000008)
  1841. #define GPIO_OSPEEDER_OSPEEDR2 ((uint32_t)0x00000030)
  1842. #define GPIO_OSPEEDER_OSPEEDR2_0 ((uint32_t)0x00000010)
  1843. #define GPIO_OSPEEDER_OSPEEDR2_1 ((uint32_t)0x00000020)
  1844. #define GPIO_OSPEEDER_OSPEEDR3 ((uint32_t)0x000000C0)
  1845. #define GPIO_OSPEEDER_OSPEEDR3_0 ((uint32_t)0x00000040)
  1846. #define GPIO_OSPEEDER_OSPEEDR3_1 ((uint32_t)0x00000080)
  1847. #define GPIO_OSPEEDER_OSPEEDR4 ((uint32_t)0x00000300)
  1848. #define GPIO_OSPEEDER_OSPEEDR4_0 ((uint32_t)0x00000100)
  1849. #define GPIO_OSPEEDER_OSPEEDR4_1 ((uint32_t)0x00000200)
  1850. #define GPIO_OSPEEDER_OSPEEDR5 ((uint32_t)0x00000C00)
  1851. #define GPIO_OSPEEDER_OSPEEDR5_0 ((uint32_t)0x00000400)
  1852. #define GPIO_OSPEEDER_OSPEEDR5_1 ((uint32_t)0x00000800)
  1853. #define GPIO_OSPEEDER_OSPEEDR6 ((uint32_t)0x00003000)
  1854. #define GPIO_OSPEEDER_OSPEEDR6_0 ((uint32_t)0x00001000)
  1855. #define GPIO_OSPEEDER_OSPEEDR6_1 ((uint32_t)0x00002000)
  1856. #define GPIO_OSPEEDER_OSPEEDR7 ((uint32_t)0x0000C000)
  1857. #define GPIO_OSPEEDER_OSPEEDR7_0 ((uint32_t)0x00004000)
  1858. #define GPIO_OSPEEDER_OSPEEDR7_1 ((uint32_t)0x00008000)
  1859. #define GPIO_OSPEEDER_OSPEEDR8 ((uint32_t)0x00030000)
  1860. #define GPIO_OSPEEDER_OSPEEDR8_0 ((uint32_t)0x00010000)
  1861. #define GPIO_OSPEEDER_OSPEEDR8_1 ((uint32_t)0x00020000)
  1862. #define GPIO_OSPEEDER_OSPEEDR9 ((uint32_t)0x000C0000)
  1863. #define GPIO_OSPEEDER_OSPEEDR9_0 ((uint32_t)0x00040000)
  1864. #define GPIO_OSPEEDER_OSPEEDR9_1 ((uint32_t)0x00080000)
  1865. #define GPIO_OSPEEDER_OSPEEDR10 ((uint32_t)0x00300000)
  1866. #define GPIO_OSPEEDER_OSPEEDR10_0 ((uint32_t)0x00100000)
  1867. #define GPIO_OSPEEDER_OSPEEDR10_1 ((uint32_t)0x00200000)
  1868. #define GPIO_OSPEEDER_OSPEEDR11 ((uint32_t)0x00C00000)
  1869. #define GPIO_OSPEEDER_OSPEEDR11_0 ((uint32_t)0x00400000)
  1870. #define GPIO_OSPEEDER_OSPEEDR11_1 ((uint32_t)0x00800000)
  1871. #define GPIO_OSPEEDER_OSPEEDR12 ((uint32_t)0x03000000)
  1872. #define GPIO_OSPEEDER_OSPEEDR12_0 ((uint32_t)0x01000000)
  1873. #define GPIO_OSPEEDER_OSPEEDR12_1 ((uint32_t)0x02000000)
  1874. #define GPIO_OSPEEDER_OSPEEDR13 ((uint32_t)0x0C000000)
  1875. #define GPIO_OSPEEDER_OSPEEDR13_0 ((uint32_t)0x04000000)
  1876. #define GPIO_OSPEEDER_OSPEEDR13_1 ((uint32_t)0x08000000)
  1877. #define GPIO_OSPEEDER_OSPEEDR14 ((uint32_t)0x30000000)
  1878. #define GPIO_OSPEEDER_OSPEEDR14_0 ((uint32_t)0x10000000)
  1879. #define GPIO_OSPEEDER_OSPEEDR14_1 ((uint32_t)0x20000000)
  1880. #define GPIO_OSPEEDER_OSPEEDR15 ((uint32_t)0xC0000000)
  1881. #define GPIO_OSPEEDER_OSPEEDR15_0 ((uint32_t)0x40000000)
  1882. #define GPIO_OSPEEDER_OSPEEDR15_1 ((uint32_t)0x80000000)
  1883. /****************** Bits definition for GPIO_PUPDR register *****************/
  1884. #define GPIO_PUPDR_PUPDR0 ((uint32_t)0x00000003)
  1885. #define GPIO_PUPDR_PUPDR0_0 ((uint32_t)0x00000001)
  1886. #define GPIO_PUPDR_PUPDR0_1 ((uint32_t)0x00000002)
  1887. #define GPIO_PUPDR_PUPDR1 ((uint32_t)0x0000000C)
  1888. #define GPIO_PUPDR_PUPDR1_0 ((uint32_t)0x00000004)
  1889. #define GPIO_PUPDR_PUPDR1_1 ((uint32_t)0x00000008)
  1890. #define GPIO_PUPDR_PUPDR2 ((uint32_t)0x00000030)
  1891. #define GPIO_PUPDR_PUPDR2_0 ((uint32_t)0x00000010)
  1892. #define GPIO_PUPDR_PUPDR2_1 ((uint32_t)0x00000020)
  1893. #define GPIO_PUPDR_PUPDR3 ((uint32_t)0x000000C0)
  1894. #define GPIO_PUPDR_PUPDR3_0 ((uint32_t)0x00000040)
  1895. #define GPIO_PUPDR_PUPDR3_1 ((uint32_t)0x00000080)
  1896. #define GPIO_PUPDR_PUPDR4 ((uint32_t)0x00000300)
  1897. #define GPIO_PUPDR_PUPDR4_0 ((uint32_t)0x00000100)
  1898. #define GPIO_PUPDR_PUPDR4_1 ((uint32_t)0x00000200)
  1899. #define GPIO_PUPDR_PUPDR5 ((uint32_t)0x00000C00)
  1900. #define GPIO_PUPDR_PUPDR5_0 ((uint32_t)0x00000400)
  1901. #define GPIO_PUPDR_PUPDR5_1 ((uint32_t)0x00000800)
  1902. #define GPIO_PUPDR_PUPDR6 ((uint32_t)0x00003000)
  1903. #define GPIO_PUPDR_PUPDR6_0 ((uint32_t)0x00001000)
  1904. #define GPIO_PUPDR_PUPDR6_1 ((uint32_t)0x00002000)
  1905. #define GPIO_PUPDR_PUPDR7 ((uint32_t)0x0000C000)
  1906. #define GPIO_PUPDR_PUPDR7_0 ((uint32_t)0x00004000)
  1907. #define GPIO_PUPDR_PUPDR7_1 ((uint32_t)0x00008000)
  1908. #define GPIO_PUPDR_PUPDR8 ((uint32_t)0x00030000)
  1909. #define GPIO_PUPDR_PUPDR8_0 ((uint32_t)0x00010000)
  1910. #define GPIO_PUPDR_PUPDR8_1 ((uint32_t)0x00020000)
  1911. #define GPIO_PUPDR_PUPDR9 ((uint32_t)0x000C0000)
  1912. #define GPIO_PUPDR_PUPDR9_0 ((uint32_t)0x00040000)
  1913. #define GPIO_PUPDR_PUPDR9_1 ((uint32_t)0x00080000)
  1914. #define GPIO_PUPDR_PUPDR10 ((uint32_t)0x00300000)
  1915. #define GPIO_PUPDR_PUPDR10_0 ((uint32_t)0x00100000)
  1916. #define GPIO_PUPDR_PUPDR10_1 ((uint32_t)0x00200000)
  1917. #define GPIO_PUPDR_PUPDR11 ((uint32_t)0x00C00000)
  1918. #define GPIO_PUPDR_PUPDR11_0 ((uint32_t)0x00400000)
  1919. #define GPIO_PUPDR_PUPDR11_1 ((uint32_t)0x00800000)
  1920. #define GPIO_PUPDR_PUPDR12 ((uint32_t)0x03000000)
  1921. #define GPIO_PUPDR_PUPDR12_0 ((uint32_t)0x01000000)
  1922. #define GPIO_PUPDR_PUPDR12_1 ((uint32_t)0x02000000)
  1923. #define GPIO_PUPDR_PUPDR13 ((uint32_t)0x0C000000)
  1924. #define GPIO_PUPDR_PUPDR13_0 ((uint32_t)0x04000000)
  1925. #define GPIO_PUPDR_PUPDR13_1 ((uint32_t)0x08000000)
  1926. #define GPIO_PUPDR_PUPDR14 ((uint32_t)0x30000000)
  1927. #define GPIO_PUPDR_PUPDR14_0 ((uint32_t)0x10000000)
  1928. #define GPIO_PUPDR_PUPDR14_1 ((uint32_t)0x20000000)
  1929. #define GPIO_PUPDR_PUPDR15 ((uint32_t)0xC0000000)
  1930. #define GPIO_PUPDR_PUPDR15_0 ((uint32_t)0x40000000)
  1931. #define GPIO_PUPDR_PUPDR15_1 ((uint32_t)0x80000000)
  1932. /****************** Bits definition for GPIO_IDR register *******************/
  1933. #define GPIO_IDR_IDR_0 ((uint32_t)0x00000001)
  1934. #define GPIO_IDR_IDR_1 ((uint32_t)0x00000002)
  1935. #define GPIO_IDR_IDR_2 ((uint32_t)0x00000004)
  1936. #define GPIO_IDR_IDR_3 ((uint32_t)0x00000008)
  1937. #define GPIO_IDR_IDR_4 ((uint32_t)0x00000010)
  1938. #define GPIO_IDR_IDR_5 ((uint32_t)0x00000020)
  1939. #define GPIO_IDR_IDR_6 ((uint32_t)0x00000040)
  1940. #define GPIO_IDR_IDR_7 ((uint32_t)0x00000080)
  1941. #define GPIO_IDR_IDR_8 ((uint32_t)0x00000100)
  1942. #define GPIO_IDR_IDR_9 ((uint32_t)0x00000200)
  1943. #define GPIO_IDR_IDR_10 ((uint32_t)0x00000400)
  1944. #define GPIO_IDR_IDR_11 ((uint32_t)0x00000800)
  1945. #define GPIO_IDR_IDR_12 ((uint32_t)0x00001000)
  1946. #define GPIO_IDR_IDR_13 ((uint32_t)0x00002000)
  1947. #define GPIO_IDR_IDR_14 ((uint32_t)0x00004000)
  1948. #define GPIO_IDR_IDR_15 ((uint32_t)0x00008000)
  1949. /****************** Bits definition for GPIO_ODR register *******************/
  1950. #define GPIO_ODR_ODR_0 ((uint32_t)0x00000001)
  1951. #define GPIO_ODR_ODR_1 ((uint32_t)0x00000002)
  1952. #define GPIO_ODR_ODR_2 ((uint32_t)0x00000004)
  1953. #define GPIO_ODR_ODR_3 ((uint32_t)0x00000008)
  1954. #define GPIO_ODR_ODR_4 ((uint32_t)0x00000010)
  1955. #define GPIO_ODR_ODR_5 ((uint32_t)0x00000020)
  1956. #define GPIO_ODR_ODR_6 ((uint32_t)0x00000040)
  1957. #define GPIO_ODR_ODR_7 ((uint32_t)0x00000080)
  1958. #define GPIO_ODR_ODR_8 ((uint32_t)0x00000100)
  1959. #define GPIO_ODR_ODR_9 ((uint32_t)0x00000200)
  1960. #define GPIO_ODR_ODR_10 ((uint32_t)0x00000400)
  1961. #define GPIO_ODR_ODR_11 ((uint32_t)0x00000800)
  1962. #define GPIO_ODR_ODR_12 ((uint32_t)0x00001000)
  1963. #define GPIO_ODR_ODR_13 ((uint32_t)0x00002000)
  1964. #define GPIO_ODR_ODR_14 ((uint32_t)0x00004000)
  1965. #define GPIO_ODR_ODR_15 ((uint32_t)0x00008000)
  1966. /****************** Bits definition for GPIO_BSRR register ******************/
  1967. #define GPIO_BSRR_BS_0 ((uint32_t)0x00000001)
  1968. #define GPIO_BSRR_BS_1 ((uint32_t)0x00000002)
  1969. #define GPIO_BSRR_BS_2 ((uint32_t)0x00000004)
  1970. #define GPIO_BSRR_BS_3 ((uint32_t)0x00000008)
  1971. #define GPIO_BSRR_BS_4 ((uint32_t)0x00000010)
  1972. #define GPIO_BSRR_BS_5 ((uint32_t)0x00000020)
  1973. #define GPIO_BSRR_BS_6 ((uint32_t)0x00000040)
  1974. #define GPIO_BSRR_BS_7 ((uint32_t)0x00000080)
  1975. #define GPIO_BSRR_BS_8 ((uint32_t)0x00000100)
  1976. #define GPIO_BSRR_BS_9 ((uint32_t)0x00000200)
  1977. #define GPIO_BSRR_BS_10 ((uint32_t)0x00000400)
  1978. #define GPIO_BSRR_BS_11 ((uint32_t)0x00000800)
  1979. #define GPIO_BSRR_BS_12 ((uint32_t)0x00001000)
  1980. #define GPIO_BSRR_BS_13 ((uint32_t)0x00002000)
  1981. #define GPIO_BSRR_BS_14 ((uint32_t)0x00004000)
  1982. #define GPIO_BSRR_BS_15 ((uint32_t)0x00008000)
  1983. #define GPIO_BSRR_BR_0 ((uint32_t)0x00010000)
  1984. #define GPIO_BSRR_BR_1 ((uint32_t)0x00020000)
  1985. #define GPIO_BSRR_BR_2 ((uint32_t)0x00040000)
  1986. #define GPIO_BSRR_BR_3 ((uint32_t)0x00080000)
  1987. #define GPIO_BSRR_BR_4 ((uint32_t)0x00100000)
  1988. #define GPIO_BSRR_BR_5 ((uint32_t)0x00200000)
  1989. #define GPIO_BSRR_BR_6 ((uint32_t)0x00400000)
  1990. #define GPIO_BSRR_BR_7 ((uint32_t)0x00800000)
  1991. #define GPIO_BSRR_BR_8 ((uint32_t)0x01000000)
  1992. #define GPIO_BSRR_BR_9 ((uint32_t)0x02000000)
  1993. #define GPIO_BSRR_BR_10 ((uint32_t)0x04000000)
  1994. #define GPIO_BSRR_BR_11 ((uint32_t)0x08000000)
  1995. #define GPIO_BSRR_BR_12 ((uint32_t)0x10000000)
  1996. #define GPIO_BSRR_BR_13 ((uint32_t)0x20000000)
  1997. #define GPIO_BSRR_BR_14 ((uint32_t)0x40000000)
  1998. #define GPIO_BSRR_BR_15 ((uint32_t)0x80000000)
  1999. /****************** Bit definition for GPIO_LCKR register ********************/
  2000. #define GPIO_LCKR_LCK0 ((uint32_t)0x00000001)
  2001. #define GPIO_LCKR_LCK1 ((uint32_t)0x00000002)
  2002. #define GPIO_LCKR_LCK2 ((uint32_t)0x00000004)
  2003. #define GPIO_LCKR_LCK3 ((uint32_t)0x00000008)
  2004. #define GPIO_LCKR_LCK4 ((uint32_t)0x00000010)
  2005. #define GPIO_LCKR_LCK5 ((uint32_t)0x00000020)
  2006. #define GPIO_LCKR_LCK6 ((uint32_t)0x00000040)
  2007. #define GPIO_LCKR_LCK7 ((uint32_t)0x00000080)
  2008. #define GPIO_LCKR_LCK8 ((uint32_t)0x00000100)
  2009. #define GPIO_LCKR_LCK9 ((uint32_t)0x00000200)
  2010. #define GPIO_LCKR_LCK10 ((uint32_t)0x00000400)
  2011. #define GPIO_LCKR_LCK11 ((uint32_t)0x00000800)
  2012. #define GPIO_LCKR_LCK12 ((uint32_t)0x00001000)
  2013. #define GPIO_LCKR_LCK13 ((uint32_t)0x00002000)
  2014. #define GPIO_LCKR_LCK14 ((uint32_t)0x00004000)
  2015. #define GPIO_LCKR_LCK15 ((uint32_t)0x00008000)
  2016. #define GPIO_LCKR_LCKK ((uint32_t)0x00010000)
  2017. /****************** Bit definition for GPIO_AFRL register ********************/
  2018. #define GPIO_AFRL_AFRL0 ((uint32_t)0x0000000F)
  2019. #define GPIO_AFRL_AFRL1 ((uint32_t)0x000000F0)
  2020. #define GPIO_AFRL_AFRL2 ((uint32_t)0x00000F00)
  2021. #define GPIO_AFRL_AFRL3 ((uint32_t)0x0000F000)
  2022. #define GPIO_AFRL_AFRL4 ((uint32_t)0x000F0000)
  2023. #define GPIO_AFRL_AFRL5 ((uint32_t)0x00F00000)
  2024. #define GPIO_AFRL_AFRL6 ((uint32_t)0x0F000000)
  2025. #define GPIO_AFRL_AFRL7 ((uint32_t)0xF0000000)
  2026. /****************** Bit definition for GPIO_AFRH register ********************/
  2027. #define GPIO_AFRH_AFRH0 ((uint32_t)0x0000000F)
  2028. #define GPIO_AFRH_AFRH1 ((uint32_t)0x000000F0)
  2029. #define GPIO_AFRH_AFRH2 ((uint32_t)0x00000F00)
  2030. #define GPIO_AFRH_AFRH3 ((uint32_t)0x0000F000)
  2031. #define GPIO_AFRH_AFRH4 ((uint32_t)0x000F0000)
  2032. #define GPIO_AFRH_AFRH5 ((uint32_t)0x00F00000)
  2033. #define GPIO_AFRH_AFRH6 ((uint32_t)0x0F000000)
  2034. #define GPIO_AFRH_AFRH7 ((uint32_t)0xF0000000)
  2035. /****************** Bit definition for GPIO_BRR register *********************/
  2036. #define GPIO_BRR_BR_0 ((uint32_t)0x00000001)
  2037. #define GPIO_BRR_BR_1 ((uint32_t)0x00000002)
  2038. #define GPIO_BRR_BR_2 ((uint32_t)0x00000004)
  2039. #define GPIO_BRR_BR_3 ((uint32_t)0x00000008)
  2040. #define GPIO_BRR_BR_4 ((uint32_t)0x00000010)
  2041. #define GPIO_BRR_BR_5 ((uint32_t)0x00000020)
  2042. #define GPIO_BRR_BR_6 ((uint32_t)0x00000040)
  2043. #define GPIO_BRR_BR_7 ((uint32_t)0x00000080)
  2044. #define GPIO_BRR_BR_8 ((uint32_t)0x00000100)
  2045. #define GPIO_BRR_BR_9 ((uint32_t)0x00000200)
  2046. #define GPIO_BRR_BR_10 ((uint32_t)0x00000400)
  2047. #define GPIO_BRR_BR_11 ((uint32_t)0x00000800)
  2048. #define GPIO_BRR_BR_12 ((uint32_t)0x00001000)
  2049. #define GPIO_BRR_BR_13 ((uint32_t)0x00002000)
  2050. #define GPIO_BRR_BR_14 ((uint32_t)0x00004000)
  2051. #define GPIO_BRR_BR_15 ((uint32_t)0x00008000)
  2052. /******************************************************************************/
  2053. /* */
  2054. /* Inter-integrated Circuit Interface (I2C) */
  2055. /* */
  2056. /******************************************************************************/
  2057. /******************* Bit definition for I2C_CR1 register ********************/
  2058. #define I2C_CR1_PE ((uint32_t)0x00000001) /*!< Peripheral Enable */
  2059. #define I2C_CR1_SMBUS ((uint32_t)0x00000002) /*!< SMBus Mode */
  2060. #define I2C_CR1_SMBTYPE ((uint32_t)0x00000008) /*!< SMBus Type */
  2061. #define I2C_CR1_ENARP ((uint32_t)0x00000010) /*!< ARP Enable */
  2062. #define I2C_CR1_ENPEC ((uint32_t)0x00000020) /*!< PEC Enable */
  2063. #define I2C_CR1_ENGC ((uint32_t)0x00000040) /*!< General Call Enable */
  2064. #define I2C_CR1_NOSTRETCH ((uint32_t)0x00000080) /*!< Clock Stretching Disable (Slave mode) */
  2065. #define I2C_CR1_START ((uint32_t)0x00000100) /*!< Start Generation */
  2066. #define I2C_CR1_STOP ((uint32_t)0x00000200) /*!< Stop Generation */
  2067. #define I2C_CR1_ACK ((uint32_t)0x00000400) /*!< Acknowledge Enable */
  2068. #define I2C_CR1_POS ((uint32_t)0x00000800) /*!< Acknowledge/PEC Position (for data reception) */
  2069. #define I2C_CR1_PEC ((uint32_t)0x00001000) /*!< Packet Error Checking */
  2070. #define I2C_CR1_ALERT ((uint32_t)0x00002000) /*!< SMBus Alert */
  2071. #define I2C_CR1_SWRST ((uint32_t)0x00008000) /*!< Software Reset */
  2072. /******************* Bit definition for I2C_CR2 register ********************/
  2073. #define I2C_CR2_FREQ ((uint32_t)0x0000003F) /*!< FREQ[5:0] bits (Peripheral Clock Frequency) */
  2074. #define I2C_CR2_FREQ_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  2075. #define I2C_CR2_FREQ_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  2076. #define I2C_CR2_FREQ_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  2077. #define I2C_CR2_FREQ_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  2078. #define I2C_CR2_FREQ_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  2079. #define I2C_CR2_FREQ_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  2080. #define I2C_CR2_ITERREN ((uint32_t)0x00000100) /*!< Error Interrupt Enable */
  2081. #define I2C_CR2_ITEVTEN ((uint32_t)0x00000200) /*!< Event Interrupt Enable */
  2082. #define I2C_CR2_ITBUFEN ((uint32_t)0x00000400) /*!< Buffer Interrupt Enable */
  2083. #define I2C_CR2_DMAEN ((uint32_t)0x00000800) /*!< DMA Requests Enable */
  2084. #define I2C_CR2_LAST ((uint32_t)0x00001000) /*!< DMA Last Transfer */
  2085. /******************* Bit definition for I2C_OAR1 register *******************/
  2086. #define I2C_OAR1_ADD1_7 ((uint32_t)0x000000FE) /*!< Interface Address */
  2087. #define I2C_OAR1_ADD8_9 ((uint32_t)0x00000300) /*!< Interface Address */
  2088. #define I2C_OAR1_ADD0 ((uint32_t)0x00000001) /*!< Bit 0 */
  2089. #define I2C_OAR1_ADD1 ((uint32_t)0x00000002) /*!< Bit 1 */
  2090. #define I2C_OAR1_ADD2 ((uint32_t)0x00000004) /*!< Bit 2 */
  2091. #define I2C_OAR1_ADD3 ((uint32_t)0x00000008) /*!< Bit 3 */
  2092. #define I2C_OAR1_ADD4 ((uint32_t)0x00000010) /*!< Bit 4 */
  2093. #define I2C_OAR1_ADD5 ((uint32_t)0x00000020) /*!< Bit 5 */
  2094. #define I2C_OAR1_ADD6 ((uint32_t)0x00000040) /*!< Bit 6 */
  2095. #define I2C_OAR1_ADD7 ((uint32_t)0x00000080) /*!< Bit 7 */
  2096. #define I2C_OAR1_ADD8 ((uint32_t)0x00000100) /*!< Bit 8 */
  2097. #define I2C_OAR1_ADD9 ((uint32_t)0x00000200) /*!< Bit 9 */
  2098. #define I2C_OAR1_ADDMODE ((uint32_t)0x00008000) /*!< Addressing Mode (Slave mode) */
  2099. /******************* Bit definition for I2C_OAR2 register *******************/
  2100. #define I2C_OAR2_ENDUAL ((uint32_t)0x00000001) /*!< Dual addressing mode enable */
  2101. #define I2C_OAR2_ADD2 ((uint32_t)0x000000FE) /*!< Interface address */
  2102. /******************** Bit definition for I2C_DR register ********************/
  2103. #define I2C_DR_DR ((uint32_t)0x000000FF) /*!< 8-bit Data Register */
  2104. /******************* Bit definition for I2C_SR1 register ********************/
  2105. #define I2C_SR1_SB ((uint32_t)0x00000001) /*!< Start Bit (Master mode) */
  2106. #define I2C_SR1_ADDR ((uint32_t)0x00000002) /*!< Address sent (master mode)/matched (slave mode) */
  2107. #define I2C_SR1_BTF ((uint32_t)0x00000004) /*!< Byte Transfer Finished */
  2108. #define I2C_SR1_ADD10 ((uint32_t)0x00000008) /*!< 10-bit header sent (Master mode) */
  2109. #define I2C_SR1_STOPF ((uint32_t)0x00000010) /*!< Stop detection (Slave mode) */
  2110. #define I2C_SR1_RXNE ((uint32_t)0x00000040) /*!< Data Register not Empty (receivers) */
  2111. #define I2C_SR1_TXE ((uint32_t)0x00000080) /*!< Data Register Empty (transmitters) */
  2112. #define I2C_SR1_BERR ((uint32_t)0x00000100) /*!< Bus Error */
  2113. #define I2C_SR1_ARLO ((uint32_t)0x00000200) /*!< Arbitration Lost (master mode) */
  2114. #define I2C_SR1_AF ((uint32_t)0x00000400) /*!< Acknowledge Failure */
  2115. #define I2C_SR1_OVR ((uint32_t)0x00000800) /*!< Overrun/Underrun */
  2116. #define I2C_SR1_PECERR ((uint32_t)0x00001000) /*!< PEC Error in reception */
  2117. #define I2C_SR1_TIMEOUT ((uint32_t)0x00004000) /*!< Timeout or Tlow Error */
  2118. #define I2C_SR1_SMBALERT ((uint32_t)0x00008000) /*!< SMBus Alert */
  2119. /******************* Bit definition for I2C_SR2 register ********************/
  2120. #define I2C_SR2_MSL ((uint32_t)0x00000001) /*!< Master/Slave */
  2121. #define I2C_SR2_BUSY ((uint32_t)0x00000002) /*!< Bus Busy */
  2122. #define I2C_SR2_TRA ((uint32_t)0x00000004) /*!< Transmitter/Receiver */
  2123. #define I2C_SR2_GENCALL ((uint32_t)0x00000010) /*!< General Call Address (Slave mode) */
  2124. #define I2C_SR2_SMBDEFAULT ((uint32_t)0x00000020) /*!< SMBus Device Default Address (Slave mode) */
  2125. #define I2C_SR2_SMBHOST ((uint32_t)0x00000040) /*!< SMBus Host Header (Slave mode) */
  2126. #define I2C_SR2_DUALF ((uint32_t)0x00000080) /*!< Dual Flag (Slave mode) */
  2127. #define I2C_SR2_PEC ((uint32_t)0x0000FF00) /*!< Packet Error Checking Register */
  2128. /******************* Bit definition for I2C_CCR register ********************/
  2129. #define I2C_CCR_CCR ((uint32_t)0x00000FFF) /*!< Clock Control Register in Fast/Standard mode (Master mode) */
  2130. #define I2C_CCR_DUTY ((uint32_t)0x00004000) /*!< Fast Mode Duty Cycle */
  2131. #define I2C_CCR_FS ((uint32_t)0x00008000) /*!< I2C Master Mode Selection */
  2132. /****************** Bit definition for I2C_TRISE register *******************/
  2133. #define I2C_TRISE_TRISE ((uint32_t)0x0000003F) /*!< Maximum Rise Time in Fast/Standard mode (Master mode) */
  2134. /******************************************************************************/
  2135. /* */
  2136. /* Independent WATCHDOG (IWDG) */
  2137. /* */
  2138. /******************************************************************************/
  2139. /******************* Bit definition for IWDG_KR register ********************/
  2140. #define IWDG_KR_KEY ((uint32_t)0x0000FFFF) /*!< Key value (write only, read 0000h) */
  2141. /******************* Bit definition for IWDG_PR register ********************/
  2142. #define IWDG_PR_PR ((uint32_t)0x00000007) /*!< PR[2:0] (Prescaler divider) */
  2143. #define IWDG_PR_PR_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  2144. #define IWDG_PR_PR_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  2145. #define IWDG_PR_PR_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  2146. /******************* Bit definition for IWDG_RLR register *******************/
  2147. #define IWDG_RLR_RL ((uint32_t)0x00000FFF) /*!< Watchdog counter reload value */
  2148. /******************* Bit definition for IWDG_SR register ********************/
  2149. #define IWDG_SR_PVU ((uint32_t)0x00000001) /*!< Watchdog prescaler value update */
  2150. #define IWDG_SR_RVU ((uint32_t)0x00000002) /*!< Watchdog counter reload value update */
  2151. /******************************************************************************/
  2152. /* */
  2153. /* LCD Controller (LCD) */
  2154. /* */
  2155. /******************************************************************************/
  2156. /******************* Bit definition for LCD_CR register *********************/
  2157. #define LCD_CR_LCDEN ((uint32_t)0x00000001) /*!< LCD Enable Bit */
  2158. #define LCD_CR_VSEL ((uint32_t)0x00000002) /*!< Voltage source selector Bit */
  2159. #define LCD_CR_DUTY ((uint32_t)0x0000001C) /*!< DUTY[2:0] bits (Duty selector) */
  2160. #define LCD_CR_DUTY_0 ((uint32_t)0x00000004) /*!< Duty selector Bit 0 */
  2161. #define LCD_CR_DUTY_1 ((uint32_t)0x00000008) /*!< Duty selector Bit 1 */
  2162. #define LCD_CR_DUTY_2 ((uint32_t)0x00000010) /*!< Duty selector Bit 2 */
  2163. #define LCD_CR_BIAS ((uint32_t)0x00000060) /*!< BIAS[1:0] bits (Bias selector) */
  2164. #define LCD_CR_BIAS_0 ((uint32_t)0x00000020) /*!< Bias selector Bit 0 */
  2165. #define LCD_CR_BIAS_1 ((uint32_t)0x00000040) /*!< Bias selector Bit 1 */
  2166. #define LCD_CR_MUX_SEG ((uint32_t)0x00000080) /*!< Mux Segment Enable Bit */
  2167. /******************* Bit definition for LCD_FCR register ********************/
  2168. #define LCD_FCR_HD ((uint32_t)0x00000001) /*!< High Drive Enable Bit */
  2169. #define LCD_FCR_SOFIE ((uint32_t)0x00000002) /*!< Start of Frame Interrupt Enable Bit */
  2170. #define LCD_FCR_UDDIE ((uint32_t)0x00000008) /*!< Update Display Done Interrupt Enable Bit */
  2171. #define LCD_FCR_PON ((uint32_t)0x00000070) /*!< PON[2:0] bits (Puls ON Duration) */
  2172. #define LCD_FCR_PON_0 ((uint32_t)0x00000010) /*!< Bit 0 */
  2173. #define LCD_FCR_PON_1 ((uint32_t)0x00000020) /*!< Bit 1 */
  2174. #define LCD_FCR_PON_2 ((uint32_t)0x00000040) /*!< Bit 2 */
  2175. #define LCD_FCR_DEAD ((uint32_t)0x00000380) /*!< DEAD[2:0] bits (DEAD Time) */
  2176. #define LCD_FCR_DEAD_0 ((uint32_t)0x00000080) /*!< Bit 0 */
  2177. #define LCD_FCR_DEAD_1 ((uint32_t)0x00000100) /*!< Bit 1 */
  2178. #define LCD_FCR_DEAD_2 ((uint32_t)0x00000200) /*!< Bit 2 */
  2179. #define LCD_FCR_CC ((uint32_t)0x00001C00) /*!< CC[2:0] bits (Contrast Control) */
  2180. #define LCD_FCR_CC_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  2181. #define LCD_FCR_CC_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  2182. #define LCD_FCR_CC_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  2183. #define LCD_FCR_BLINKF ((uint32_t)0x0000E000) /*!< BLINKF[2:0] bits (Blink Frequency) */
  2184. #define LCD_FCR_BLINKF_0 ((uint32_t)0x00002000) /*!< Bit 0 */
  2185. #define LCD_FCR_BLINKF_1 ((uint32_t)0x00004000) /*!< Bit 1 */
  2186. #define LCD_FCR_BLINKF_2 ((uint32_t)0x00008000) /*!< Bit 2 */
  2187. #define LCD_FCR_BLINK ((uint32_t)0x00030000) /*!< BLINK[1:0] bits (Blink Enable) */
  2188. #define LCD_FCR_BLINK_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  2189. #define LCD_FCR_BLINK_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  2190. #define LCD_FCR_DIV ((uint32_t)0x003C0000) /*!< DIV[3:0] bits (Divider) */
  2191. #define LCD_FCR_PS ((uint32_t)0x03C00000) /*!< PS[3:0] bits (Prescaler) */
  2192. /******************* Bit definition for LCD_SR register *********************/
  2193. #define LCD_SR_ENS ((uint32_t)0x00000001) /*!< LCD Enabled Bit */
  2194. #define LCD_SR_SOF ((uint32_t)0x00000002) /*!< Start Of Frame Flag Bit */
  2195. #define LCD_SR_UDR ((uint32_t)0x00000004) /*!< Update Display Request Bit */
  2196. #define LCD_SR_UDD ((uint32_t)0x00000008) /*!< Update Display Done Flag Bit */
  2197. #define LCD_SR_RDY ((uint32_t)0x00000010) /*!< Ready Flag Bit */
  2198. #define LCD_SR_FCRSR ((uint32_t)0x00000020) /*!< LCD FCR Register Synchronization Flag Bit */
  2199. /******************* Bit definition for LCD_CLR register ********************/
  2200. #define LCD_CLR_SOFC ((uint32_t)0x00000002) /*!< Start Of Frame Flag Clear Bit */
  2201. #define LCD_CLR_UDDC ((uint32_t)0x00000008) /*!< Update Display Done Flag Clear Bit */
  2202. /******************* Bit definition for LCD_RAM register ********************/
  2203. #define LCD_RAM_SEGMENT_DATA ((uint32_t)0xFFFFFFFF) /*!< Segment Data Bits */
  2204. /******************************************************************************/
  2205. /* */
  2206. /* Power Control (PWR) */
  2207. /* */
  2208. /******************************************************************************/
  2209. /******************** Bit definition for PWR_CR register ********************/
  2210. #define PWR_CR_LPSDSR ((uint32_t)0x00000001) /*!< Low-power deepsleep/sleep/low power run */
  2211. #define PWR_CR_PDDS ((uint32_t)0x00000002) /*!< Power Down Deepsleep */
  2212. #define PWR_CR_CWUF ((uint32_t)0x00000004) /*!< Clear Wakeup Flag */
  2213. #define PWR_CR_CSBF ((uint32_t)0x00000008) /*!< Clear Standby Flag */
  2214. #define PWR_CR_PVDE ((uint32_t)0x00000010) /*!< Power Voltage Detector Enable */
  2215. #define PWR_CR_PLS ((uint32_t)0x000000E0) /*!< PLS[2:0] bits (PVD Level Selection) */
  2216. #define PWR_CR_PLS_0 ((uint32_t)0x00000020) /*!< Bit 0 */
  2217. #define PWR_CR_PLS_1 ((uint32_t)0x00000040) /*!< Bit 1 */
  2218. #define PWR_CR_PLS_2 ((uint32_t)0x00000080) /*!< Bit 2 */
  2219. /*!< PVD level configuration */
  2220. #define PWR_CR_PLS_LEV0 ((uint32_t)0x00000000) /*!< PVD level 0 */
  2221. #define PWR_CR_PLS_LEV1 ((uint32_t)0x00000020) /*!< PVD level 1 */
  2222. #define PWR_CR_PLS_LEV2 ((uint32_t)0x00000040) /*!< PVD level 2 */
  2223. #define PWR_CR_PLS_LEV3 ((uint32_t)0x00000060) /*!< PVD level 3 */
  2224. #define PWR_CR_PLS_LEV4 ((uint32_t)0x00000080) /*!< PVD level 4 */
  2225. #define PWR_CR_PLS_LEV5 ((uint32_t)0x000000A0) /*!< PVD level 5 */
  2226. #define PWR_CR_PLS_LEV6 ((uint32_t)0x000000C0) /*!< PVD level 6 */
  2227. #define PWR_CR_PLS_LEV7 ((uint32_t)0x000000E0) /*!< PVD level 7 */
  2228. #define PWR_CR_DBP ((uint32_t)0x00000100) /*!< Disable Backup Domain write protection */
  2229. #define PWR_CR_ULP ((uint32_t)0x00000200) /*!< Ultra Low Power mode */
  2230. #define PWR_CR_FWU ((uint32_t)0x00000400) /*!< Fast wakeup */
  2231. #define PWR_CR_VOS ((uint32_t)0x00001800) /*!< VOS[1:0] bits (Voltage scaling range selection) */
  2232. #define PWR_CR_VOS_0 ((uint32_t)0x00000800) /*!< Bit 0 */
  2233. #define PWR_CR_VOS_1 ((uint32_t)0x00001000) /*!< Bit 1 */
  2234. #define PWR_CR_LPRUN ((uint32_t)0x00004000) /*!< Low power run mode */
  2235. /******************* Bit definition for PWR_CSR register ********************/
  2236. #define PWR_CSR_WUF ((uint32_t)0x00000001) /*!< Wakeup Flag */
  2237. #define PWR_CSR_SBF ((uint32_t)0x00000002) /*!< Standby Flag */
  2238. #define PWR_CSR_PVDO ((uint32_t)0x00000004) /*!< PVD Output */
  2239. #define PWR_CSR_VREFINTRDYF ((uint32_t)0x00000008) /*!< Internal voltage reference (VREFINT) ready flag */
  2240. #define PWR_CSR_VOSF ((uint32_t)0x00000010) /*!< Voltage Scaling select flag */
  2241. #define PWR_CSR_REGLPF ((uint32_t)0x00000020) /*!< Regulator LP flag */
  2242. #define PWR_CSR_EWUP1 ((uint32_t)0x00000100) /*!< Enable WKUP pin 1 */
  2243. #define PWR_CSR_EWUP2 ((uint32_t)0x00000200) /*!< Enable WKUP pin 2 */
  2244. #define PWR_CSR_EWUP3 ((uint32_t)0x00000400) /*!< Enable WKUP pin 3 */
  2245. /******************************************************************************/
  2246. /* */
  2247. /* Reset and Clock Control (RCC) */
  2248. /* */
  2249. /******************************************************************************/
  2250. /******************** Bit definition for RCC_CR register ********************/
  2251. #define RCC_CR_HSION ((uint32_t)0x00000001) /*!< Internal High Speed clock enable */
  2252. #define RCC_CR_HSIRDY ((uint32_t)0x00000002) /*!< Internal High Speed clock ready flag */
  2253. #define RCC_CR_MSION ((uint32_t)0x00000100) /*!< Internal Multi Speed clock enable */
  2254. #define RCC_CR_MSIRDY ((uint32_t)0x00000200) /*!< Internal Multi Speed clock ready flag */
  2255. #define RCC_CR_HSEON ((uint32_t)0x00010000) /*!< External High Speed clock enable */
  2256. #define RCC_CR_HSERDY ((uint32_t)0x00020000) /*!< External High Speed clock ready flag */
  2257. #define RCC_CR_HSEBYP ((uint32_t)0x00040000) /*!< External High Speed clock Bypass */
  2258. #define RCC_CR_PLLON ((uint32_t)0x01000000) /*!< PLL enable */
  2259. #define RCC_CR_PLLRDY ((uint32_t)0x02000000) /*!< PLL clock ready flag */
  2260. #define RCC_CR_CSSON ((uint32_t)0x10000000) /*!< Clock Security System enable */
  2261. #define RCC_CR_RTCPRE ((uint32_t)0x60000000) /*!< RTC/LCD Prescaler */
  2262. #define RCC_CR_RTCPRE_0 ((uint32_t)0x20000000) /*!< Bit0 */
  2263. #define RCC_CR_RTCPRE_1 ((uint32_t)0x40000000) /*!< Bit1 */
  2264. /******************** Bit definition for RCC_ICSCR register *****************/
  2265. #define RCC_ICSCR_HSICAL ((uint32_t)0x000000FF) /*!< Internal High Speed clock Calibration */
  2266. #define RCC_ICSCR_HSITRIM ((uint32_t)0x00001F00) /*!< Internal High Speed clock trimming */
  2267. #define RCC_ICSCR_MSIRANGE ((uint32_t)0x0000E000) /*!< Internal Multi Speed clock Range */
  2268. #define RCC_ICSCR_MSIRANGE_0 ((uint32_t)0x00000000) /*!< Internal Multi Speed clock Range 65.536 KHz */
  2269. #define RCC_ICSCR_MSIRANGE_1 ((uint32_t)0x00002000) /*!< Internal Multi Speed clock Range 131.072 KHz */
  2270. #define RCC_ICSCR_MSIRANGE_2 ((uint32_t)0x00004000) /*!< Internal Multi Speed clock Range 262.144 KHz */
  2271. #define RCC_ICSCR_MSIRANGE_3 ((uint32_t)0x00006000) /*!< Internal Multi Speed clock Range 524.288 KHz */
  2272. #define RCC_ICSCR_MSIRANGE_4 ((uint32_t)0x00008000) /*!< Internal Multi Speed clock Range 1.048 MHz */
  2273. #define RCC_ICSCR_MSIRANGE_5 ((uint32_t)0x0000A000) /*!< Internal Multi Speed clock Range 2.097 MHz */
  2274. #define RCC_ICSCR_MSIRANGE_6 ((uint32_t)0x0000C000) /*!< Internal Multi Speed clock Range 4.194 MHz */
  2275. #define RCC_ICSCR_MSICAL ((uint32_t)0x00FF0000) /*!< Internal Multi Speed clock Calibration */
  2276. #define RCC_ICSCR_MSITRIM ((uint32_t)0xFF000000) /*!< Internal Multi Speed clock trimming */
  2277. /******************** Bit definition for RCC_CFGR register ******************/
  2278. #define RCC_CFGR_SW ((uint32_t)0x00000003) /*!< SW[1:0] bits (System clock Switch) */
  2279. #define RCC_CFGR_SW_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  2280. #define RCC_CFGR_SW_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  2281. /*!< SW configuration */
  2282. #define RCC_CFGR_SW_MSI ((uint32_t)0x00000000) /*!< MSI selected as system clock */
  2283. #define RCC_CFGR_SW_HSI ((uint32_t)0x00000001) /*!< HSI selected as system clock */
  2284. #define RCC_CFGR_SW_HSE ((uint32_t)0x00000002) /*!< HSE selected as system clock */
  2285. #define RCC_CFGR_SW_PLL ((uint32_t)0x00000003) /*!< PLL selected as system clock */
  2286. #define RCC_CFGR_SWS ((uint32_t)0x0000000C) /*!< SWS[1:0] bits (System Clock Switch Status) */
  2287. #define RCC_CFGR_SWS_0 ((uint32_t)0x00000004) /*!< Bit 0 */
  2288. #define RCC_CFGR_SWS_1 ((uint32_t)0x00000008) /*!< Bit 1 */
  2289. /*!< SWS configuration */
  2290. #define RCC_CFGR_SWS_MSI ((uint32_t)0x00000000) /*!< MSI oscillator used as system clock */
  2291. #define RCC_CFGR_SWS_HSI ((uint32_t)0x00000004) /*!< HSI oscillator used as system clock */
  2292. #define RCC_CFGR_SWS_HSE ((uint32_t)0x00000008) /*!< HSE oscillator used as system clock */
  2293. #define RCC_CFGR_SWS_PLL ((uint32_t)0x0000000C) /*!< PLL used as system clock */
  2294. #define RCC_CFGR_HPRE ((uint32_t)0x000000F0) /*!< HPRE[3:0] bits (AHB prescaler) */
  2295. #define RCC_CFGR_HPRE_0 ((uint32_t)0x00000010) /*!< Bit 0 */
  2296. #define RCC_CFGR_HPRE_1 ((uint32_t)0x00000020) /*!< Bit 1 */
  2297. #define RCC_CFGR_HPRE_2 ((uint32_t)0x00000040) /*!< Bit 2 */
  2298. #define RCC_CFGR_HPRE_3 ((uint32_t)0x00000080) /*!< Bit 3 */
  2299. /*!< HPRE configuration */
  2300. #define RCC_CFGR_HPRE_DIV1 ((uint32_t)0x00000000) /*!< SYSCLK not divided */
  2301. #define RCC_CFGR_HPRE_DIV2 ((uint32_t)0x00000080) /*!< SYSCLK divided by 2 */
  2302. #define RCC_CFGR_HPRE_DIV4 ((uint32_t)0x00000090) /*!< SYSCLK divided by 4 */
  2303. #define RCC_CFGR_HPRE_DIV8 ((uint32_t)0x000000A0) /*!< SYSCLK divided by 8 */
  2304. #define RCC_CFGR_HPRE_DIV16 ((uint32_t)0x000000B0) /*!< SYSCLK divided by 16 */
  2305. #define RCC_CFGR_HPRE_DIV64 ((uint32_t)0x000000C0) /*!< SYSCLK divided by 64 */
  2306. #define RCC_CFGR_HPRE_DIV128 ((uint32_t)0x000000D0) /*!< SYSCLK divided by 128 */
  2307. #define RCC_CFGR_HPRE_DIV256 ((uint32_t)0x000000E0) /*!< SYSCLK divided by 256 */
  2308. #define RCC_CFGR_HPRE_DIV512 ((uint32_t)0x000000F0) /*!< SYSCLK divided by 512 */
  2309. #define RCC_CFGR_PPRE1 ((uint32_t)0x00000700) /*!< PRE1[2:0] bits (APB1 prescaler) */
  2310. #define RCC_CFGR_PPRE1_0 ((uint32_t)0x00000100) /*!< Bit 0 */
  2311. #define RCC_CFGR_PPRE1_1 ((uint32_t)0x00000200) /*!< Bit 1 */
  2312. #define RCC_CFGR_PPRE1_2 ((uint32_t)0x00000400) /*!< Bit 2 */
  2313. /*!< PPRE1 configuration */
  2314. #define RCC_CFGR_PPRE1_DIV1 ((uint32_t)0x00000000) /*!< HCLK not divided */
  2315. #define RCC_CFGR_PPRE1_DIV2 ((uint32_t)0x00000400) /*!< HCLK divided by 2 */
  2316. #define RCC_CFGR_PPRE1_DIV4 ((uint32_t)0x00000500) /*!< HCLK divided by 4 */
  2317. #define RCC_CFGR_PPRE1_DIV8 ((uint32_t)0x00000600) /*!< HCLK divided by 8 */
  2318. #define RCC_CFGR_PPRE1_DIV16 ((uint32_t)0x00000700) /*!< HCLK divided by 16 */
  2319. #define RCC_CFGR_PPRE2 ((uint32_t)0x00003800) /*!< PRE2[2:0] bits (APB2 prescaler) */
  2320. #define RCC_CFGR_PPRE2_0 ((uint32_t)0x00000800) /*!< Bit 0 */
  2321. #define RCC_CFGR_PPRE2_1 ((uint32_t)0x00001000) /*!< Bit 1 */
  2322. #define RCC_CFGR_PPRE2_2 ((uint32_t)0x00002000) /*!< Bit 2 */
  2323. /*!< PPRE2 configuration */
  2324. #define RCC_CFGR_PPRE2_DIV1 ((uint32_t)0x00000000) /*!< HCLK not divided */
  2325. #define RCC_CFGR_PPRE2_DIV2 ((uint32_t)0x00002000) /*!< HCLK divided by 2 */
  2326. #define RCC_CFGR_PPRE2_DIV4 ((uint32_t)0x00002800) /*!< HCLK divided by 4 */
  2327. #define RCC_CFGR_PPRE2_DIV8 ((uint32_t)0x00003000) /*!< HCLK divided by 8 */
  2328. #define RCC_CFGR_PPRE2_DIV16 ((uint32_t)0x00003800) /*!< HCLK divided by 16 */
  2329. /*!< PLL entry clock source*/
  2330. #define RCC_CFGR_PLLSRC ((uint32_t)0x00010000) /*!< PLL entry clock source */
  2331. #define RCC_CFGR_PLLSRC_HSI ((uint32_t)0x00000000) /*!< HSI as PLL entry clock source */
  2332. #define RCC_CFGR_PLLSRC_HSE ((uint32_t)0x00010000) /*!< HSE as PLL entry clock source */
  2333. /*!< PLLMUL configuration */
  2334. #define RCC_CFGR_PLLMUL ((uint32_t)0x003C0000) /*!< PLLMUL[3:0] bits (PLL multiplication factor) */
  2335. #define RCC_CFGR_PLLMUL_0 ((uint32_t)0x00040000) /*!< Bit 0 */
  2336. #define RCC_CFGR_PLLMUL_1 ((uint32_t)0x00080000) /*!< Bit 1 */
  2337. #define RCC_CFGR_PLLMUL_2 ((uint32_t)0x00100000) /*!< Bit 2 */
  2338. #define RCC_CFGR_PLLMUL_3 ((uint32_t)0x00200000) /*!< Bit 3 */
  2339. /*!< PLLMUL configuration */
  2340. #define RCC_CFGR_PLLMUL3 ((uint32_t)0x00000000) /*!< PLL input clock * 3 */
  2341. #define RCC_CFGR_PLLMUL4 ((uint32_t)0x00040000) /*!< PLL input clock * 4 */
  2342. #define RCC_CFGR_PLLMUL6 ((uint32_t)0x00080000) /*!< PLL input clock * 6 */
  2343. #define RCC_CFGR_PLLMUL8 ((uint32_t)0x000C0000) /*!< PLL input clock * 8 */
  2344. #define RCC_CFGR_PLLMUL12 ((uint32_t)0x00100000) /*!< PLL input clock * 12 */
  2345. #define RCC_CFGR_PLLMUL16 ((uint32_t)0x00140000) /*!< PLL input clock * 16 */
  2346. #define RCC_CFGR_PLLMUL24 ((uint32_t)0x00180000) /*!< PLL input clock * 24 */
  2347. #define RCC_CFGR_PLLMUL32 ((uint32_t)0x001C0000) /*!< PLL input clock * 32 */
  2348. #define RCC_CFGR_PLLMUL48 ((uint32_t)0x00200000) /*!< PLL input clock * 48 */
  2349. /*!< PLLDIV configuration */
  2350. #define RCC_CFGR_PLLDIV ((uint32_t)0x00C00000) /*!< PLLDIV[1:0] bits (PLL Output Division) */
  2351. #define RCC_CFGR_PLLDIV_0 ((uint32_t)0x00400000) /*!< Bit0 */
  2352. #define RCC_CFGR_PLLDIV_1 ((uint32_t)0x00800000) /*!< Bit1 */
  2353. /*!< PLLDIV configuration */
  2354. #define RCC_CFGR_PLLDIV1 ((uint32_t)0x00000000) /*!< PLL clock output = CKVCO / 1 */
  2355. #define RCC_CFGR_PLLDIV2 ((uint32_t)0x00400000) /*!< PLL clock output = CKVCO / 2 */
  2356. #define RCC_CFGR_PLLDIV3 ((uint32_t)0x00800000) /*!< PLL clock output = CKVCO / 3 */
  2357. #define RCC_CFGR_PLLDIV4 ((uint32_t)0x00C00000) /*!< PLL clock output = CKVCO / 4 */
  2358. #define RCC_CFGR_MCOSEL ((uint32_t)0x07000000) /*!< MCO[2:0] bits (Microcontroller Clock Output) */
  2359. #define RCC_CFGR_MCOSEL_0 ((uint32_t)0x01000000) /*!< Bit 0 */
  2360. #define RCC_CFGR_MCOSEL_1 ((uint32_t)0x02000000) /*!< Bit 1 */
  2361. #define RCC_CFGR_MCOSEL_2 ((uint32_t)0x04000000) /*!< Bit 2 */
  2362. /*!< MCO configuration */
  2363. #define RCC_CFGR_MCO_NOCLOCK ((uint32_t)0x00000000) /*!< No clock */
  2364. #define RCC_CFGR_MCO_SYSCLK ((uint32_t)0x01000000) /*!< System clock selected */
  2365. #define RCC_CFGR_MCO_HSI ((uint32_t)0x02000000) /*!< Internal 16 MHz RC oscillator clock selected */
  2366. #define RCC_CFGR_MCO_MSI ((uint32_t)0x03000000) /*!< Internal Medium Speed RC oscillator clock selected */
  2367. #define RCC_CFGR_MCO_HSE ((uint32_t)0x04000000) /*!< External 1-25 MHz oscillator clock selected */
  2368. #define RCC_CFGR_MCO_PLL ((uint32_t)0x05000000) /*!< PLL clock divided */
  2369. #define RCC_CFGR_MCO_LSI ((uint32_t)0x06000000) /*!< LSI selected */
  2370. #define RCC_CFGR_MCO_LSE ((uint32_t)0x07000000) /*!< LSE selected */
  2371. #define RCC_CFGR_MCOPRE ((uint32_t)0x70000000) /*!< MCOPRE[2:0] bits (Microcontroller Clock Output Prescaler) */
  2372. #define RCC_CFGR_MCOPRE_0 ((uint32_t)0x10000000) /*!< Bit 0 */
  2373. #define RCC_CFGR_MCOPRE_1 ((uint32_t)0x20000000) /*!< Bit 1 */
  2374. #define RCC_CFGR_MCOPRE_2 ((uint32_t)0x40000000) /*!< Bit 2 */
  2375. /*!< MCO Prescaler configuration */
  2376. #define RCC_CFGR_MCO_DIV1 ((uint32_t)0x00000000) /*!< MCO Clock divided by 1 */
  2377. #define RCC_CFGR_MCO_DIV2 ((uint32_t)0x10000000) /*!< MCO Clock divided by 2 */
  2378. #define RCC_CFGR_MCO_DIV4 ((uint32_t)0x20000000) /*!< MCO Clock divided by 4 */
  2379. #define RCC_CFGR_MCO_DIV8 ((uint32_t)0x30000000) /*!< MCO Clock divided by 8 */
  2380. #define RCC_CFGR_MCO_DIV16 ((uint32_t)0x40000000) /*!< MCO Clock divided by 16 */
  2381. /*!<****************** Bit definition for RCC_CIR register ********************/
  2382. #define RCC_CIR_LSIRDYF ((uint32_t)0x00000001) /*!< LSI Ready Interrupt flag */
  2383. #define RCC_CIR_LSERDYF ((uint32_t)0x00000002) /*!< LSE Ready Interrupt flag */
  2384. #define RCC_CIR_HSIRDYF ((uint32_t)0x00000004) /*!< HSI Ready Interrupt flag */
  2385. #define RCC_CIR_HSERDYF ((uint32_t)0x00000008) /*!< HSE Ready Interrupt flag */
  2386. #define RCC_CIR_PLLRDYF ((uint32_t)0x00000010) /*!< PLL Ready Interrupt flag */
  2387. #define RCC_CIR_MSIRDYF ((uint32_t)0x00000020) /*!< MSI Ready Interrupt flag */
  2388. #define RCC_CIR_LSECSS ((uint32_t)0x00000040) /*!< LSE CSS Interrupt flag */
  2389. #define RCC_CIR_CSSF ((uint32_t)0x00000080) /*!< Clock Security System Interrupt flag */
  2390. #define RCC_CIR_LSIRDYIE ((uint32_t)0x00000100) /*!< LSI Ready Interrupt Enable */
  2391. #define RCC_CIR_LSERDYIE ((uint32_t)0x00000200) /*!< LSE Ready Interrupt Enable */
  2392. #define RCC_CIR_HSIRDYIE ((uint32_t)0x00000400) /*!< HSI Ready Interrupt Enable */
  2393. #define RCC_CIR_HSERDYIE ((uint32_t)0x00000800) /*!< HSE Ready Interrupt Enable */
  2394. #define RCC_CIR_PLLRDYIE ((uint32_t)0x00001000) /*!< PLL Ready Interrupt Enable */
  2395. #define RCC_CIR_MSIRDYIE ((uint32_t)0x00002000) /*!< MSI Ready Interrupt Enable */
  2396. #define RCC_CIR_LSECSSIE ((uint32_t)0x00004000) /*!< LSE CSS Interrupt Enable */
  2397. #define RCC_CIR_LSIRDYC ((uint32_t)0x00010000) /*!< LSI Ready Interrupt Clear */
  2398. #define RCC_CIR_LSERDYC ((uint32_t)0x00020000) /*!< LSE Ready Interrupt Clear */
  2399. #define RCC_CIR_HSIRDYC ((uint32_t)0x00040000) /*!< HSI Ready Interrupt Clear */
  2400. #define RCC_CIR_HSERDYC ((uint32_t)0x00080000) /*!< HSE Ready Interrupt Clear */
  2401. #define RCC_CIR_PLLRDYC ((uint32_t)0x00100000) /*!< PLL Ready Interrupt Clear */
  2402. #define RCC_CIR_MSIRDYC ((uint32_t)0x00200000) /*!< MSI Ready Interrupt Clear */
  2403. #define RCC_CIR_LSECSSC ((uint32_t)0x00400000) /*!< LSE CSS Interrupt Clear */
  2404. #define RCC_CIR_CSSC ((uint32_t)0x00800000) /*!< Clock Security System Interrupt Clear */
  2405. /***************** Bit definition for RCC_AHBRSTR register ******************/
  2406. #define RCC_AHBRSTR_GPIOARST ((uint32_t)0x00000001) /*!< GPIO port A reset */
  2407. #define RCC_AHBRSTR_GPIOBRST ((uint32_t)0x00000002) /*!< GPIO port B reset */
  2408. #define RCC_AHBRSTR_GPIOCRST ((uint32_t)0x00000004) /*!< GPIO port C reset */
  2409. #define RCC_AHBRSTR_GPIODRST ((uint32_t)0x00000008) /*!< GPIO port D reset */
  2410. #define RCC_AHBRSTR_GPIOERST ((uint32_t)0x00000010) /*!< GPIO port E reset */
  2411. #define RCC_AHBRSTR_GPIOHRST ((uint32_t)0x00000020) /*!< GPIO port H reset */
  2412. #define RCC_AHBRSTR_CRCRST ((uint32_t)0x00001000) /*!< CRC reset */
  2413. #define RCC_AHBRSTR_FLITFRST ((uint32_t)0x00008000) /*!< FLITF reset */
  2414. #define RCC_AHBRSTR_DMA1RST ((uint32_t)0x01000000) /*!< DMA1 reset */
  2415. #define RCC_AHBRSTR_DMA2RST ((uint32_t)0x02000000) /*!< DMA2 reset */
  2416. #define RCC_AHBRSTR_AESRST ((uint32_t)0x08000000) /*!< AES reset */
  2417. /***************** Bit definition for RCC_APB2RSTR register *****************/
  2418. #define RCC_APB2RSTR_SYSCFGRST ((uint32_t)0x00000001) /*!< System Configuration SYSCFG reset */
  2419. #define RCC_APB2RSTR_TIM9RST ((uint32_t)0x00000004) /*!< TIM9 reset */
  2420. #define RCC_APB2RSTR_TIM10RST ((uint32_t)0x00000008) /*!< TIM10 reset */
  2421. #define RCC_APB2RSTR_TIM11RST ((uint32_t)0x00000010) /*!< TIM11 reset */
  2422. #define RCC_APB2RSTR_ADC1RST ((uint32_t)0x00000200) /*!< ADC1 reset */
  2423. #define RCC_APB2RSTR_SPI1RST ((uint32_t)0x00001000) /*!< SPI1 reset */
  2424. #define RCC_APB2RSTR_USART1RST ((uint32_t)0x00004000) /*!< USART1 reset */
  2425. /***************** Bit definition for RCC_APB1RSTR register *****************/
  2426. #define RCC_APB1RSTR_TIM2RST ((uint32_t)0x00000001) /*!< Timer 2 reset */
  2427. #define RCC_APB1RSTR_TIM3RST ((uint32_t)0x00000002) /*!< Timer 3 reset */
  2428. #define RCC_APB1RSTR_TIM4RST ((uint32_t)0x00000004) /*!< Timer 4 reset */
  2429. #define RCC_APB1RSTR_TIM5RST ((uint32_t)0x00000008) /*!< Timer 5 reset */
  2430. #define RCC_APB1RSTR_TIM6RST ((uint32_t)0x00000010) /*!< Timer 6 reset */
  2431. #define RCC_APB1RSTR_TIM7RST ((uint32_t)0x00000020) /*!< Timer 7 reset */
  2432. #define RCC_APB1RSTR_LCDRST ((uint32_t)0x00000200) /*!< LCD reset */
  2433. #define RCC_APB1RSTR_WWDGRST ((uint32_t)0x00000800) /*!< Window Watchdog reset */
  2434. #define RCC_APB1RSTR_SPI2RST ((uint32_t)0x00004000) /*!< SPI 2 reset */
  2435. #define RCC_APB1RSTR_SPI3RST ((uint32_t)0x00008000) /*!< SPI 3 reset */
  2436. #define RCC_APB1RSTR_USART2RST ((uint32_t)0x00020000) /*!< USART 2 reset */
  2437. #define RCC_APB1RSTR_USART3RST ((uint32_t)0x00040000) /*!< USART 3 reset */
  2438. #define RCC_APB1RSTR_I2C1RST ((uint32_t)0x00200000) /*!< I2C 1 reset */
  2439. #define RCC_APB1RSTR_I2C2RST ((uint32_t)0x00400000) /*!< I2C 2 reset */
  2440. #define RCC_APB1RSTR_USBRST ((uint32_t)0x00800000) /*!< USB reset */
  2441. #define RCC_APB1RSTR_PWRRST ((uint32_t)0x10000000) /*!< Power interface reset */
  2442. #define RCC_APB1RSTR_DACRST ((uint32_t)0x20000000) /*!< DAC interface reset */
  2443. #define RCC_APB1RSTR_COMPRST ((uint32_t)0x80000000) /*!< Comparator interface reset */
  2444. /****************** Bit definition for RCC_AHBENR register ******************/
  2445. #define RCC_AHBENR_GPIOAEN ((uint32_t)0x00000001) /*!< GPIO port A clock enable */
  2446. #define RCC_AHBENR_GPIOBEN ((uint32_t)0x00000002) /*!< GPIO port B clock enable */
  2447. #define RCC_AHBENR_GPIOCEN ((uint32_t)0x00000004) /*!< GPIO port C clock enable */
  2448. #define RCC_AHBENR_GPIODEN ((uint32_t)0x00000008) /*!< GPIO port D clock enable */
  2449. #define RCC_AHBENR_GPIOEEN ((uint32_t)0x00000010) /*!< GPIO port E clock enable */
  2450. #define RCC_AHBENR_GPIOHEN ((uint32_t)0x00000020) /*!< GPIO port H clock enable */
  2451. #define RCC_AHBENR_CRCEN ((uint32_t)0x00001000) /*!< CRC clock enable */
  2452. #define RCC_AHBENR_FLITFEN ((uint32_t)0x00008000) /*!< FLITF clock enable (has effect only when
  2453. the Flash memory is in power down mode) */
  2454. #define RCC_AHBENR_DMA1EN ((uint32_t)0x01000000) /*!< DMA1 clock enable */
  2455. #define RCC_AHBENR_DMA2EN ((uint32_t)0x02000000) /*!< DMA2 clock enable */
  2456. #define RCC_AHBENR_AESEN ((uint32_t)0x08000000) /*!< AES clock enable */
  2457. /****************** Bit definition for RCC_APB2ENR register *****************/
  2458. #define RCC_APB2ENR_SYSCFGEN ((uint32_t)0x00000001) /*!< System Configuration SYSCFG clock enable */
  2459. #define RCC_APB2ENR_TIM9EN ((uint32_t)0x00000004) /*!< TIM9 interface clock enable */
  2460. #define RCC_APB2ENR_TIM10EN ((uint32_t)0x00000008) /*!< TIM10 interface clock enable */
  2461. #define RCC_APB2ENR_TIM11EN ((uint32_t)0x00000010) /*!< TIM11 Timer clock enable */
  2462. #define RCC_APB2ENR_ADC1EN ((uint32_t)0x00000200) /*!< ADC1 clock enable */
  2463. #define RCC_APB2ENR_SPI1EN ((uint32_t)0x00001000) /*!< SPI1 clock enable */
  2464. #define RCC_APB2ENR_USART1EN ((uint32_t)0x00004000) /*!< USART1 clock enable */
  2465. /***************** Bit definition for RCC_APB1ENR register ******************/
  2466. #define RCC_APB1ENR_TIM2EN ((uint32_t)0x00000001) /*!< Timer 2 clock enabled*/
  2467. #define RCC_APB1ENR_TIM3EN ((uint32_t)0x00000002) /*!< Timer 3 clock enable */
  2468. #define RCC_APB1ENR_TIM4EN ((uint32_t)0x00000004) /*!< Timer 4 clock enable */
  2469. #define RCC_APB1ENR_TIM5EN ((uint32_t)0x00000008) /*!< Timer 5 clock enable */
  2470. #define RCC_APB1ENR_TIM6EN ((uint32_t)0x00000010) /*!< Timer 6 clock enable */
  2471. #define RCC_APB1ENR_TIM7EN ((uint32_t)0x00000020) /*!< Timer 7 clock enable */
  2472. #define RCC_APB1ENR_LCDEN ((uint32_t)0x00000200) /*!< LCD clock enable */
  2473. #define RCC_APB1ENR_WWDGEN ((uint32_t)0x00000800) /*!< Window Watchdog clock enable */
  2474. #define RCC_APB1ENR_SPI2EN ((uint32_t)0x00004000) /*!< SPI 2 clock enable */
  2475. #define RCC_APB1ENR_SPI3EN ((uint32_t)0x00008000) /*!< SPI 3 clock enable */
  2476. #define RCC_APB1ENR_USART2EN ((uint32_t)0x00020000) /*!< USART 2 clock enable */
  2477. #define RCC_APB1ENR_USART3EN ((uint32_t)0x00040000) /*!< USART 3 clock enable */
  2478. #define RCC_APB1ENR_I2C1EN ((uint32_t)0x00200000) /*!< I2C 1 clock enable */
  2479. #define RCC_APB1ENR_I2C2EN ((uint32_t)0x00400000) /*!< I2C 2 clock enable */
  2480. #define RCC_APB1ENR_USBEN ((uint32_t)0x00800000) /*!< USB clock enable */
  2481. #define RCC_APB1ENR_PWREN ((uint32_t)0x10000000) /*!< Power interface clock enable */
  2482. #define RCC_APB1ENR_DACEN ((uint32_t)0x20000000) /*!< DAC interface clock enable */
  2483. #define RCC_APB1ENR_COMPEN ((uint32_t)0x80000000) /*!< Comparator interface clock enable */
  2484. /****************** Bit definition for RCC_AHBLPENR register ****************/
  2485. #define RCC_AHBLPENR_GPIOALPEN ((uint32_t)0x00000001) /*!< GPIO port A clock enabled in sleep mode */
  2486. #define RCC_AHBLPENR_GPIOBLPEN ((uint32_t)0x00000002) /*!< GPIO port B clock enabled in sleep mode */
  2487. #define RCC_AHBLPENR_GPIOCLPEN ((uint32_t)0x00000004) /*!< GPIO port C clock enabled in sleep mode */
  2488. #define RCC_AHBLPENR_GPIODLPEN ((uint32_t)0x00000008) /*!< GPIO port D clock enabled in sleep mode */
  2489. #define RCC_AHBLPENR_GPIOELPEN ((uint32_t)0x00000010) /*!< GPIO port E clock enabled in sleep mode */
  2490. #define RCC_AHBLPENR_GPIOHLPEN ((uint32_t)0x00000020) /*!< GPIO port H clock enabled in sleep mode */
  2491. #define RCC_AHBLPENR_CRCLPEN ((uint32_t)0x00001000) /*!< CRC clock enabled in sleep mode */
  2492. #define RCC_AHBLPENR_FLITFLPEN ((uint32_t)0x00008000) /*!< Flash Interface clock enabled in sleep mode
  2493. (has effect only when the Flash memory is
  2494. in power down mode) */
  2495. #define RCC_AHBLPENR_SRAMLPEN ((uint32_t)0x00010000) /*!< SRAM clock enabled in sleep mode */
  2496. #define RCC_AHBLPENR_DMA1LPEN ((uint32_t)0x01000000) /*!< DMA1 clock enabled in sleep mode */
  2497. #define RCC_AHBLPENR_DMA2LPEN ((uint32_t)0x02000000) /*!< DMA2 clock enabled in sleep mode */
  2498. #define RCC_AHBLPENR_AESLPEN ((uint32_t)0x08000000) /*!< AES clock enabled in sleep mode */
  2499. /****************** Bit definition for RCC_APB2LPENR register ***************/
  2500. #define RCC_APB2LPENR_SYSCFGLPEN ((uint32_t)0x00000001) /*!< System Configuration SYSCFG clock enabled in sleep mode */
  2501. #define RCC_APB2LPENR_TIM9LPEN ((uint32_t)0x00000004) /*!< TIM9 interface clock enabled in sleep mode */
  2502. #define RCC_APB2LPENR_TIM10LPEN ((uint32_t)0x00000008) /*!< TIM10 interface clock enabled in sleep mode */
  2503. #define RCC_APB2LPENR_TIM11LPEN ((uint32_t)0x00000010) /*!< TIM11 Timer clock enabled in sleep mode */
  2504. #define RCC_APB2LPENR_ADC1LPEN ((uint32_t)0x00000200) /*!< ADC1 clock enabled in sleep mode */
  2505. #define RCC_APB2LPENR_SPI1LPEN ((uint32_t)0x00001000) /*!< SPI1 clock enabled in sleep mode */
  2506. #define RCC_APB2LPENR_USART1LPEN ((uint32_t)0x00004000) /*!< USART1 clock enabled in sleep mode */
  2507. /***************** Bit definition for RCC_APB1LPENR register ****************/
  2508. #define RCC_APB1LPENR_TIM2LPEN ((uint32_t)0x00000001) /*!< Timer 2 clock enabled in sleep mode */
  2509. #define RCC_APB1LPENR_TIM3LPEN ((uint32_t)0x00000002) /*!< Timer 3 clock enabled in sleep mode */
  2510. #define RCC_APB1LPENR_TIM4LPEN ((uint32_t)0x00000004) /*!< Timer 4 clock enabled in sleep mode */
  2511. #define RCC_APB1LPENR_TIM5LPEN ((uint32_t)0x00000008) /*!< Timer 5 clock enabled in sleep mode */
  2512. #define RCC_APB1LPENR_TIM6LPEN ((uint32_t)0x00000010) /*!< Timer 6 clock enabled in sleep mode */
  2513. #define RCC_APB1LPENR_TIM7LPEN ((uint32_t)0x00000020) /*!< Timer 7 clock enabled in sleep mode */
  2514. #define RCC_APB1LPENR_LCDLPEN ((uint32_t)0x00000200) /*!< LCD clock enabled in sleep mode */
  2515. #define RCC_APB1LPENR_WWDGLPEN ((uint32_t)0x00000800) /*!< Window Watchdog clock enabled in sleep mode */
  2516. #define RCC_APB1LPENR_SPI2LPEN ((uint32_t)0x00004000) /*!< SPI 2 clock enabled in sleep mode */
  2517. #define RCC_APB1LPENR_SPI3LPEN ((uint32_t)0x00008000) /*!< SPI 3 clock enabled in sleep mode */
  2518. #define RCC_APB1LPENR_USART2LPEN ((uint32_t)0x00020000) /*!< USART 2 clock enabled in sleep mode */
  2519. #define RCC_APB1LPENR_USART3LPEN ((uint32_t)0x00040000) /*!< USART 3 clock enabled in sleep mode */
  2520. #define RCC_APB1LPENR_I2C1LPEN ((uint32_t)0x00200000) /*!< I2C 1 clock enabled in sleep mode */
  2521. #define RCC_APB1LPENR_I2C2LPEN ((uint32_t)0x00400000) /*!< I2C 2 clock enabled in sleep mode */
  2522. #define RCC_APB1LPENR_USBLPEN ((uint32_t)0x00800000) /*!< USB clock enabled in sleep mode */
  2523. #define RCC_APB1LPENR_PWRLPEN ((uint32_t)0x10000000) /*!< Power interface clock enabled in sleep mode */
  2524. #define RCC_APB1LPENR_DACLPEN ((uint32_t)0x20000000) /*!< DAC interface clock enabled in sleep mode */
  2525. #define RCC_APB1LPENR_COMPLPEN ((uint32_t)0x80000000) /*!< Comparator interface clock enabled in sleep mode*/
  2526. /******************* Bit definition for RCC_CSR register ********************/
  2527. #define RCC_CSR_LSION ((uint32_t)0x00000001) /*!< Internal Low Speed oscillator enable */
  2528. #define RCC_CSR_LSIRDY ((uint32_t)0x00000002) /*!< Internal Low Speed oscillator Ready */
  2529. #define RCC_CSR_LSEON ((uint32_t)0x00000100) /*!< External Low Speed oscillator enable */
  2530. #define RCC_CSR_LSERDY ((uint32_t)0x00000200) /*!< External Low Speed oscillator Ready */
  2531. #define RCC_CSR_LSEBYP ((uint32_t)0x00000400) /*!< External Low Speed oscillator Bypass */
  2532. #define RCC_CSR_LSECSSON ((uint32_t)0x00000800) /*!< External Low Speed oscillator CSS Enable */
  2533. #define RCC_CSR_LSECSSD ((uint32_t)0x00001000) /*!< External Low Speed oscillator CSS Detected */
  2534. #define RCC_CSR_RTCSEL ((uint32_t)0x00030000) /*!< RTCSEL[1:0] bits (RTC clock source selection) */
  2535. #define RCC_CSR_RTCSEL_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  2536. #define RCC_CSR_RTCSEL_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  2537. /*!< RTC congiguration */
  2538. #define RCC_CSR_RTCSEL_NOCLOCK ((uint32_t)0x00000000) /*!< No clock */
  2539. #define RCC_CSR_RTCSEL_LSE ((uint32_t)0x00010000) /*!< LSE oscillator clock used as RTC clock */
  2540. #define RCC_CSR_RTCSEL_LSI ((uint32_t)0x00020000) /*!< LSI oscillator clock used as RTC clock */
  2541. #define RCC_CSR_RTCSEL_HSE ((uint32_t)0x00030000) /*!< HSE oscillator clock divided by 2, 4, 8 or 16 by RTCPRE used as RTC clock */
  2542. #define RCC_CSR_RTCEN ((uint32_t)0x00400000) /*!< RTC clock enable */
  2543. #define RCC_CSR_RTCRST ((uint32_t)0x00800000) /*!< RTC reset */
  2544. #define RCC_CSR_RMVF ((uint32_t)0x01000000) /*!< Remove reset flag */
  2545. #define RCC_CSR_OBLRSTF ((uint32_t)0x02000000) /*!< Option Bytes Loader reset flag */
  2546. #define RCC_CSR_PINRSTF ((uint32_t)0x04000000) /*!< PIN reset flag */
  2547. #define RCC_CSR_PORRSTF ((uint32_t)0x08000000) /*!< POR/PDR reset flag */
  2548. #define RCC_CSR_SFTRSTF ((uint32_t)0x10000000) /*!< Software Reset flag */
  2549. #define RCC_CSR_IWDGRSTF ((uint32_t)0x20000000) /*!< Independent Watchdog reset flag */
  2550. #define RCC_CSR_WWDGRSTF ((uint32_t)0x40000000) /*!< Window watchdog reset flag */
  2551. #define RCC_CSR_LPWRRSTF ((uint32_t)0x80000000) /*!< Low-Power reset flag */
  2552. /******************************************************************************/
  2553. /* */
  2554. /* Real-Time Clock (RTC) */
  2555. /* */
  2556. /******************************************************************************/
  2557. /******************** Bits definition for RTC_TR register *******************/
  2558. #define RTC_TR_PM ((uint32_t)0x00400000)
  2559. #define RTC_TR_HT ((uint32_t)0x00300000)
  2560. #define RTC_TR_HT_0 ((uint32_t)0x00100000)
  2561. #define RTC_TR_HT_1 ((uint32_t)0x00200000)
  2562. #define RTC_TR_HU ((uint32_t)0x000F0000)
  2563. #define RTC_TR_HU_0 ((uint32_t)0x00010000)
  2564. #define RTC_TR_HU_1 ((uint32_t)0x00020000)
  2565. #define RTC_TR_HU_2 ((uint32_t)0x00040000)
  2566. #define RTC_TR_HU_3 ((uint32_t)0x00080000)
  2567. #define RTC_TR_MNT ((uint32_t)0x00007000)
  2568. #define RTC_TR_MNT_0 ((uint32_t)0x00001000)
  2569. #define RTC_TR_MNT_1 ((uint32_t)0x00002000)
  2570. #define RTC_TR_MNT_2 ((uint32_t)0x00004000)
  2571. #define RTC_TR_MNU ((uint32_t)0x00000F00)
  2572. #define RTC_TR_MNU_0 ((uint32_t)0x00000100)
  2573. #define RTC_TR_MNU_1 ((uint32_t)0x00000200)
  2574. #define RTC_TR_MNU_2 ((uint32_t)0x00000400)
  2575. #define RTC_TR_MNU_3 ((uint32_t)0x00000800)
  2576. #define RTC_TR_ST ((uint32_t)0x00000070)
  2577. #define RTC_TR_ST_0 ((uint32_t)0x00000010)
  2578. #define RTC_TR_ST_1 ((uint32_t)0x00000020)
  2579. #define RTC_TR_ST_2 ((uint32_t)0x00000040)
  2580. #define RTC_TR_SU ((uint32_t)0x0000000F)
  2581. #define RTC_TR_SU_0 ((uint32_t)0x00000001)
  2582. #define RTC_TR_SU_1 ((uint32_t)0x00000002)
  2583. #define RTC_TR_SU_2 ((uint32_t)0x00000004)
  2584. #define RTC_TR_SU_3 ((uint32_t)0x00000008)
  2585. /******************** Bits definition for RTC_DR register *******************/
  2586. #define RTC_DR_YT ((uint32_t)0x00F00000)
  2587. #define RTC_DR_YT_0 ((uint32_t)0x00100000)
  2588. #define RTC_DR_YT_1 ((uint32_t)0x00200000)
  2589. #define RTC_DR_YT_2 ((uint32_t)0x00400000)
  2590. #define RTC_DR_YT_3 ((uint32_t)0x00800000)
  2591. #define RTC_DR_YU ((uint32_t)0x000F0000)
  2592. #define RTC_DR_YU_0 ((uint32_t)0x00010000)
  2593. #define RTC_DR_YU_1 ((uint32_t)0x00020000)
  2594. #define RTC_DR_YU_2 ((uint32_t)0x00040000)
  2595. #define RTC_DR_YU_3 ((uint32_t)0x00080000)
  2596. #define RTC_DR_WDU ((uint32_t)0x0000E000)
  2597. #define RTC_DR_WDU_0 ((uint32_t)0x00002000)
  2598. #define RTC_DR_WDU_1 ((uint32_t)0x00004000)
  2599. #define RTC_DR_WDU_2 ((uint32_t)0x00008000)
  2600. #define RTC_DR_MT ((uint32_t)0x00001000)
  2601. #define RTC_DR_MU ((uint32_t)0x00000F00)
  2602. #define RTC_DR_MU_0 ((uint32_t)0x00000100)
  2603. #define RTC_DR_MU_1 ((uint32_t)0x00000200)
  2604. #define RTC_DR_MU_2 ((uint32_t)0x00000400)
  2605. #define RTC_DR_MU_3 ((uint32_t)0x00000800)
  2606. #define RTC_DR_DT ((uint32_t)0x00000030)
  2607. #define RTC_DR_DT_0 ((uint32_t)0x00000010)
  2608. #define RTC_DR_DT_1 ((uint32_t)0x00000020)
  2609. #define RTC_DR_DU ((uint32_t)0x0000000F)
  2610. #define RTC_DR_DU_0 ((uint32_t)0x00000001)
  2611. #define RTC_DR_DU_1 ((uint32_t)0x00000002)
  2612. #define RTC_DR_DU_2 ((uint32_t)0x00000004)
  2613. #define RTC_DR_DU_3 ((uint32_t)0x00000008)
  2614. /******************** Bits definition for RTC_CR register *******************/
  2615. #define RTC_CR_COE ((uint32_t)0x00800000)
  2616. #define RTC_CR_OSEL ((uint32_t)0x00600000)
  2617. #define RTC_CR_OSEL_0 ((uint32_t)0x00200000)
  2618. #define RTC_CR_OSEL_1 ((uint32_t)0x00400000)
  2619. #define RTC_CR_POL ((uint32_t)0x00100000)
  2620. #define RTC_CR_COSEL ((uint32_t)0x00080000)
  2621. #define RTC_CR_BCK ((uint32_t)0x00040000)
  2622. #define RTC_CR_SUB1H ((uint32_t)0x00020000)
  2623. #define RTC_CR_ADD1H ((uint32_t)0x00010000)
  2624. #define RTC_CR_TSIE ((uint32_t)0x00008000)
  2625. #define RTC_CR_WUTIE ((uint32_t)0x00004000)
  2626. #define RTC_CR_ALRBIE ((uint32_t)0x00002000)
  2627. #define RTC_CR_ALRAIE ((uint32_t)0x00001000)
  2628. #define RTC_CR_TSE ((uint32_t)0x00000800)
  2629. #define RTC_CR_WUTE ((uint32_t)0x00000400)
  2630. #define RTC_CR_ALRBE ((uint32_t)0x00000200)
  2631. #define RTC_CR_ALRAE ((uint32_t)0x00000100)
  2632. #define RTC_CR_DCE ((uint32_t)0x00000080)
  2633. #define RTC_CR_FMT ((uint32_t)0x00000040)
  2634. #define RTC_CR_BYPSHAD ((uint32_t)0x00000020)
  2635. #define RTC_CR_REFCKON ((uint32_t)0x00000010)
  2636. #define RTC_CR_TSEDGE ((uint32_t)0x00000008)
  2637. #define RTC_CR_WUCKSEL ((uint32_t)0x00000007)
  2638. #define RTC_CR_WUCKSEL_0 ((uint32_t)0x00000001)
  2639. #define RTC_CR_WUCKSEL_1 ((uint32_t)0x00000002)
  2640. #define RTC_CR_WUCKSEL_2 ((uint32_t)0x00000004)
  2641. /******************** Bits definition for RTC_ISR register ******************/
  2642. #define RTC_ISR_RECALPF ((uint32_t)0x00010000)
  2643. #define RTC_ISR_TAMP3F ((uint32_t)0x00008000)
  2644. #define RTC_ISR_TAMP2F ((uint32_t)0x00004000)
  2645. #define RTC_ISR_TAMP1F ((uint32_t)0x00002000)
  2646. #define RTC_ISR_TSOVF ((uint32_t)0x00001000)
  2647. #define RTC_ISR_TSF ((uint32_t)0x00000800)
  2648. #define RTC_ISR_WUTF ((uint32_t)0x00000400)
  2649. #define RTC_ISR_ALRBF ((uint32_t)0x00000200)
  2650. #define RTC_ISR_ALRAF ((uint32_t)0x00000100)
  2651. #define RTC_ISR_INIT ((uint32_t)0x00000080)
  2652. #define RTC_ISR_INITF ((uint32_t)0x00000040)
  2653. #define RTC_ISR_RSF ((uint32_t)0x00000020)
  2654. #define RTC_ISR_INITS ((uint32_t)0x00000010)
  2655. #define RTC_ISR_SHPF ((uint32_t)0x00000008)
  2656. #define RTC_ISR_WUTWF ((uint32_t)0x00000004)
  2657. #define RTC_ISR_ALRBWF ((uint32_t)0x00000002)
  2658. #define RTC_ISR_ALRAWF ((uint32_t)0x00000001)
  2659. /******************** Bits definition for RTC_PRER register *****************/
  2660. #define RTC_PRER_PREDIV_A ((uint32_t)0x007F0000)
  2661. #define RTC_PRER_PREDIV_S ((uint32_t)0x00007FFF)
  2662. /******************** Bits definition for RTC_WUTR register *****************/
  2663. #define RTC_WUTR_WUT ((uint32_t)0x0000FFFF)
  2664. /******************** Bits definition for RTC_CALIBR register ***************/
  2665. #define RTC_CALIBR_DCS ((uint32_t)0x00000080)
  2666. #define RTC_CALIBR_DC ((uint32_t)0x0000001F)
  2667. /******************** Bits definition for RTC_ALRMAR register ***************/
  2668. #define RTC_ALRMAR_MSK4 ((uint32_t)0x80000000)
  2669. #define RTC_ALRMAR_WDSEL ((uint32_t)0x40000000)
  2670. #define RTC_ALRMAR_DT ((uint32_t)0x30000000)
  2671. #define RTC_ALRMAR_DT_0 ((uint32_t)0x10000000)
  2672. #define RTC_ALRMAR_DT_1 ((uint32_t)0x20000000)
  2673. #define RTC_ALRMAR_DU ((uint32_t)0x0F000000)
  2674. #define RTC_ALRMAR_DU_0 ((uint32_t)0x01000000)
  2675. #define RTC_ALRMAR_DU_1 ((uint32_t)0x02000000)
  2676. #define RTC_ALRMAR_DU_2 ((uint32_t)0x04000000)
  2677. #define RTC_ALRMAR_DU_3 ((uint32_t)0x08000000)
  2678. #define RTC_ALRMAR_MSK3 ((uint32_t)0x00800000)
  2679. #define RTC_ALRMAR_PM ((uint32_t)0x00400000)
  2680. #define RTC_ALRMAR_HT ((uint32_t)0x00300000)
  2681. #define RTC_ALRMAR_HT_0 ((uint32_t)0x00100000)
  2682. #define RTC_ALRMAR_HT_1 ((uint32_t)0x00200000)
  2683. #define RTC_ALRMAR_HU ((uint32_t)0x000F0000)
  2684. #define RTC_ALRMAR_HU_0 ((uint32_t)0x00010000)
  2685. #define RTC_ALRMAR_HU_1 ((uint32_t)0x00020000)
  2686. #define RTC_ALRMAR_HU_2 ((uint32_t)0x00040000)
  2687. #define RTC_ALRMAR_HU_3 ((uint32_t)0x00080000)
  2688. #define RTC_ALRMAR_MSK2 ((uint32_t)0x00008000)
  2689. #define RTC_ALRMAR_MNT ((uint32_t)0x00007000)
  2690. #define RTC_ALRMAR_MNT_0 ((uint32_t)0x00001000)
  2691. #define RTC_ALRMAR_MNT_1 ((uint32_t)0x00002000)
  2692. #define RTC_ALRMAR_MNT_2 ((uint32_t)0x00004000)
  2693. #define RTC_ALRMAR_MNU ((uint32_t)0x00000F00)
  2694. #define RTC_ALRMAR_MNU_0 ((uint32_t)0x00000100)
  2695. #define RTC_ALRMAR_MNU_1 ((uint32_t)0x00000200)
  2696. #define RTC_ALRMAR_MNU_2 ((uint32_t)0x00000400)
  2697. #define RTC_ALRMAR_MNU_3 ((uint32_t)0x00000800)
  2698. #define RTC_ALRMAR_MSK1 ((uint32_t)0x00000080)
  2699. #define RTC_ALRMAR_ST ((uint32_t)0x00000070)
  2700. #define RTC_ALRMAR_ST_0 ((uint32_t)0x00000010)
  2701. #define RTC_ALRMAR_ST_1 ((uint32_t)0x00000020)
  2702. #define RTC_ALRMAR_ST_2 ((uint32_t)0x00000040)
  2703. #define RTC_ALRMAR_SU ((uint32_t)0x0000000F)
  2704. #define RTC_ALRMAR_SU_0 ((uint32_t)0x00000001)
  2705. #define RTC_ALRMAR_SU_1 ((uint32_t)0x00000002)
  2706. #define RTC_ALRMAR_SU_2 ((uint32_t)0x00000004)
  2707. #define RTC_ALRMAR_SU_3 ((uint32_t)0x00000008)
  2708. /******************** Bits definition for RTC_ALRMBR register ***************/
  2709. #define RTC_ALRMBR_MSK4 ((uint32_t)0x80000000)
  2710. #define RTC_ALRMBR_WDSEL ((uint32_t)0x40000000)
  2711. #define RTC_ALRMBR_DT ((uint32_t)0x30000000)
  2712. #define RTC_ALRMBR_DT_0 ((uint32_t)0x10000000)
  2713. #define RTC_ALRMBR_DT_1 ((uint32_t)0x20000000)
  2714. #define RTC_ALRMBR_DU ((uint32_t)0x0F000000)
  2715. #define RTC_ALRMBR_DU_0 ((uint32_t)0x01000000)
  2716. #define RTC_ALRMBR_DU_1 ((uint32_t)0x02000000)
  2717. #define RTC_ALRMBR_DU_2 ((uint32_t)0x04000000)
  2718. #define RTC_ALRMBR_DU_3 ((uint32_t)0x08000000)
  2719. #define RTC_ALRMBR_MSK3 ((uint32_t)0x00800000)
  2720. #define RTC_ALRMBR_PM ((uint32_t)0x00400000)
  2721. #define RTC_ALRMBR_HT ((uint32_t)0x00300000)
  2722. #define RTC_ALRMBR_HT_0 ((uint32_t)0x00100000)
  2723. #define RTC_ALRMBR_HT_1 ((uint32_t)0x00200000)
  2724. #define RTC_ALRMBR_HU ((uint32_t)0x000F0000)
  2725. #define RTC_ALRMBR_HU_0 ((uint32_t)0x00010000)
  2726. #define RTC_ALRMBR_HU_1 ((uint32_t)0x00020000)
  2727. #define RTC_ALRMBR_HU_2 ((uint32_t)0x00040000)
  2728. #define RTC_ALRMBR_HU_3 ((uint32_t)0x00080000)
  2729. #define RTC_ALRMBR_MSK2 ((uint32_t)0x00008000)
  2730. #define RTC_ALRMBR_MNT ((uint32_t)0x00007000)
  2731. #define RTC_ALRMBR_MNT_0 ((uint32_t)0x00001000)
  2732. #define RTC_ALRMBR_MNT_1 ((uint32_t)0x00002000)
  2733. #define RTC_ALRMBR_MNT_2 ((uint32_t)0x00004000)
  2734. #define RTC_ALRMBR_MNU ((uint32_t)0x00000F00)
  2735. #define RTC_ALRMBR_MNU_0 ((uint32_t)0x00000100)
  2736. #define RTC_ALRMBR_MNU_1 ((uint32_t)0x00000200)
  2737. #define RTC_ALRMBR_MNU_2 ((uint32_t)0x00000400)
  2738. #define RTC_ALRMBR_MNU_3 ((uint32_t)0x00000800)
  2739. #define RTC_ALRMBR_MSK1 ((uint32_t)0x00000080)
  2740. #define RTC_ALRMBR_ST ((uint32_t)0x00000070)
  2741. #define RTC_ALRMBR_ST_0 ((uint32_t)0x00000010)
  2742. #define RTC_ALRMBR_ST_1 ((uint32_t)0x00000020)
  2743. #define RTC_ALRMBR_ST_2 ((uint32_t)0x00000040)
  2744. #define RTC_ALRMBR_SU ((uint32_t)0x0000000F)
  2745. #define RTC_ALRMBR_SU_0 ((uint32_t)0x00000001)
  2746. #define RTC_ALRMBR_SU_1 ((uint32_t)0x00000002)
  2747. #define RTC_ALRMBR_SU_2 ((uint32_t)0x00000004)
  2748. #define RTC_ALRMBR_SU_3 ((uint32_t)0x00000008)
  2749. /******************** Bits definition for RTC_WPR register ******************/
  2750. #define RTC_WPR_KEY ((uint32_t)0x000000FF)
  2751. /******************** Bits definition for RTC_SSR register ******************/
  2752. #define RTC_SSR_SS ((uint32_t)0x0000FFFF)
  2753. /******************** Bits definition for RTC_SHIFTR register ***************/
  2754. #define RTC_SHIFTR_SUBFS ((uint32_t)0x00007FFF)
  2755. #define RTC_SHIFTR_ADD1S ((uint32_t)0x80000000)
  2756. /******************** Bits definition for RTC_TSTR register *****************/
  2757. #define RTC_TSTR_PM ((uint32_t)0x00400000)
  2758. #define RTC_TSTR_HT ((uint32_t)0x00300000)
  2759. #define RTC_TSTR_HT_0 ((uint32_t)0x00100000)
  2760. #define RTC_TSTR_HT_1 ((uint32_t)0x00200000)
  2761. #define RTC_TSTR_HU ((uint32_t)0x000F0000)
  2762. #define RTC_TSTR_HU_0 ((uint32_t)0x00010000)
  2763. #define RTC_TSTR_HU_1 ((uint32_t)0x00020000)
  2764. #define RTC_TSTR_HU_2 ((uint32_t)0x00040000)
  2765. #define RTC_TSTR_HU_3 ((uint32_t)0x00080000)
  2766. #define RTC_TSTR_MNT ((uint32_t)0x00007000)
  2767. #define RTC_TSTR_MNT_0 ((uint32_t)0x00001000)
  2768. #define RTC_TSTR_MNT_1 ((uint32_t)0x00002000)
  2769. #define RTC_TSTR_MNT_2 ((uint32_t)0x00004000)
  2770. #define RTC_TSTR_MNU ((uint32_t)0x00000F00)
  2771. #define RTC_TSTR_MNU_0 ((uint32_t)0x00000100)
  2772. #define RTC_TSTR_MNU_1 ((uint32_t)0x00000200)
  2773. #define RTC_TSTR_MNU_2 ((uint32_t)0x00000400)
  2774. #define RTC_TSTR_MNU_3 ((uint32_t)0x00000800)
  2775. #define RTC_TSTR_ST ((uint32_t)0x00000070)
  2776. #define RTC_TSTR_ST_0 ((uint32_t)0x00000010)
  2777. #define RTC_TSTR_ST_1 ((uint32_t)0x00000020)
  2778. #define RTC_TSTR_ST_2 ((uint32_t)0x00000040)
  2779. #define RTC_TSTR_SU ((uint32_t)0x0000000F)
  2780. #define RTC_TSTR_SU_0 ((uint32_t)0x00000001)
  2781. #define RTC_TSTR_SU_1 ((uint32_t)0x00000002)
  2782. #define RTC_TSTR_SU_2 ((uint32_t)0x00000004)
  2783. #define RTC_TSTR_SU_3 ((uint32_t)0x00000008)
  2784. /******************** Bits definition for RTC_TSDR register *****************/
  2785. #define RTC_TSDR_WDU ((uint32_t)0x0000E000)
  2786. #define RTC_TSDR_WDU_0 ((uint32_t)0x00002000)
  2787. #define RTC_TSDR_WDU_1 ((uint32_t)0x00004000)
  2788. #define RTC_TSDR_WDU_2 ((uint32_t)0x00008000)
  2789. #define RTC_TSDR_MT ((uint32_t)0x00001000)
  2790. #define RTC_TSDR_MU ((uint32_t)0x00000F00)
  2791. #define RTC_TSDR_MU_0 ((uint32_t)0x00000100)
  2792. #define RTC_TSDR_MU_1 ((uint32_t)0x00000200)
  2793. #define RTC_TSDR_MU_2 ((uint32_t)0x00000400)
  2794. #define RTC_TSDR_MU_3 ((uint32_t)0x00000800)
  2795. #define RTC_TSDR_DT ((uint32_t)0x00000030)
  2796. #define RTC_TSDR_DT_0 ((uint32_t)0x00000010)
  2797. #define RTC_TSDR_DT_1 ((uint32_t)0x00000020)
  2798. #define RTC_TSDR_DU ((uint32_t)0x0000000F)
  2799. #define RTC_TSDR_DU_0 ((uint32_t)0x00000001)
  2800. #define RTC_TSDR_DU_1 ((uint32_t)0x00000002)
  2801. #define RTC_TSDR_DU_2 ((uint32_t)0x00000004)
  2802. #define RTC_TSDR_DU_3 ((uint32_t)0x00000008)
  2803. /******************** Bits definition for RTC_TSSSR register ****************/
  2804. #define RTC_TSSSR_SS ((uint32_t)0x0000FFFF)
  2805. /******************** Bits definition for RTC_CAL register *****************/
  2806. #define RTC_CALR_CALP ((uint32_t)0x00008000)
  2807. #define RTC_CALR_CALW8 ((uint32_t)0x00004000)
  2808. #define RTC_CALR_CALW16 ((uint32_t)0x00002000)
  2809. #define RTC_CALR_CALM ((uint32_t)0x000001FF)
  2810. #define RTC_CALR_CALM_0 ((uint32_t)0x00000001)
  2811. #define RTC_CALR_CALM_1 ((uint32_t)0x00000002)
  2812. #define RTC_CALR_CALM_2 ((uint32_t)0x00000004)
  2813. #define RTC_CALR_CALM_3 ((uint32_t)0x00000008)
  2814. #define RTC_CALR_CALM_4 ((uint32_t)0x00000010)
  2815. #define RTC_CALR_CALM_5 ((uint32_t)0x00000020)
  2816. #define RTC_CALR_CALM_6 ((uint32_t)0x00000040)
  2817. #define RTC_CALR_CALM_7 ((uint32_t)0x00000080)
  2818. #define RTC_CALR_CALM_8 ((uint32_t)0x00000100)
  2819. /******************** Bits definition for RTC_TAFCR register ****************/
  2820. #define RTC_TAFCR_ALARMOUTTYPE ((uint32_t)0x00040000)
  2821. #define RTC_TAFCR_TAMPPUDIS ((uint32_t)0x00008000)
  2822. #define RTC_TAFCR_TAMPPRCH ((uint32_t)0x00006000)
  2823. #define RTC_TAFCR_TAMPPRCH_0 ((uint32_t)0x00002000)
  2824. #define RTC_TAFCR_TAMPPRCH_1 ((uint32_t)0x00004000)
  2825. #define RTC_TAFCR_TAMPFLT ((uint32_t)0x00001800)
  2826. #define RTC_TAFCR_TAMPFLT_0 ((uint32_t)0x00000800)
  2827. #define RTC_TAFCR_TAMPFLT_1 ((uint32_t)0x00001000)
  2828. #define RTC_TAFCR_TAMPFREQ ((uint32_t)0x00000700)
  2829. #define RTC_TAFCR_TAMPFREQ_0 ((uint32_t)0x00000100)
  2830. #define RTC_TAFCR_TAMPFREQ_1 ((uint32_t)0x00000200)
  2831. #define RTC_TAFCR_TAMPFREQ_2 ((uint32_t)0x00000400)
  2832. #define RTC_TAFCR_TAMPTS ((uint32_t)0x00000080)
  2833. #define RTC_TAFCR_TAMP3TRG ((uint32_t)0x00000040)
  2834. #define RTC_TAFCR_TAMP3E ((uint32_t)0x00000020)
  2835. #define RTC_TAFCR_TAMP2TRG ((uint32_t)0x00000010)
  2836. #define RTC_TAFCR_TAMP2E ((uint32_t)0x00000008)
  2837. #define RTC_TAFCR_TAMPIE ((uint32_t)0x00000004)
  2838. #define RTC_TAFCR_TAMP1TRG ((uint32_t)0x00000002)
  2839. #define RTC_TAFCR_TAMP1E ((uint32_t)0x00000001)
  2840. /******************** Bits definition for RTC_ALRMASSR register *************/
  2841. #define RTC_ALRMASSR_MASKSS ((uint32_t)0x0F000000)
  2842. #define RTC_ALRMASSR_MASKSS_0 ((uint32_t)0x01000000)
  2843. #define RTC_ALRMASSR_MASKSS_1 ((uint32_t)0x02000000)
  2844. #define RTC_ALRMASSR_MASKSS_2 ((uint32_t)0x04000000)
  2845. #define RTC_ALRMASSR_MASKSS_3 ((uint32_t)0x08000000)
  2846. #define RTC_ALRMASSR_SS ((uint32_t)0x00007FFF)
  2847. /******************** Bits definition for RTC_ALRMBSSR register *************/
  2848. #define RTC_ALRMBSSR_MASKSS ((uint32_t)0x0F000000)
  2849. #define RTC_ALRMBSSR_MASKSS_0 ((uint32_t)0x01000000)
  2850. #define RTC_ALRMBSSR_MASKSS_1 ((uint32_t)0x02000000)
  2851. #define RTC_ALRMBSSR_MASKSS_2 ((uint32_t)0x04000000)
  2852. #define RTC_ALRMBSSR_MASKSS_3 ((uint32_t)0x08000000)
  2853. #define RTC_ALRMBSSR_SS ((uint32_t)0x00007FFF)
  2854. /******************** Bits definition for RTC_BKP0R register ****************/
  2855. #define RTC_BKP0R ((uint32_t)0xFFFFFFFF)
  2856. /******************** Bits definition for RTC_BKP1R register ****************/
  2857. #define RTC_BKP1R ((uint32_t)0xFFFFFFFF)
  2858. /******************** Bits definition for RTC_BKP2R register ****************/
  2859. #define RTC_BKP2R ((uint32_t)0xFFFFFFFF)
  2860. /******************** Bits definition for RTC_BKP3R register ****************/
  2861. #define RTC_BKP3R ((uint32_t)0xFFFFFFFF)
  2862. /******************** Bits definition for RTC_BKP4R register ****************/
  2863. #define RTC_BKP4R ((uint32_t)0xFFFFFFFF)
  2864. /******************** Bits definition for RTC_BKP5R register ****************/
  2865. #define RTC_BKP5R ((uint32_t)0xFFFFFFFF)
  2866. /******************** Bits definition for RTC_BKP6R register ****************/
  2867. #define RTC_BKP6R ((uint32_t)0xFFFFFFFF)
  2868. /******************** Bits definition for RTC_BKP7R register ****************/
  2869. #define RTC_BKP7R ((uint32_t)0xFFFFFFFF)
  2870. /******************** Bits definition for RTC_BKP8R register ****************/
  2871. #define RTC_BKP8R ((uint32_t)0xFFFFFFFF)
  2872. /******************** Bits definition for RTC_BKP9R register ****************/
  2873. #define RTC_BKP9R ((uint32_t)0xFFFFFFFF)
  2874. /******************** Bits definition for RTC_BKP10R register ***************/
  2875. #define RTC_BKP10R ((uint32_t)0xFFFFFFFF)
  2876. /******************** Bits definition for RTC_BKP11R register ***************/
  2877. #define RTC_BKP11R ((uint32_t)0xFFFFFFFF)
  2878. /******************** Bits definition for RTC_BKP12R register ***************/
  2879. #define RTC_BKP12R ((uint32_t)0xFFFFFFFF)
  2880. /******************** Bits definition for RTC_BKP13R register ***************/
  2881. #define RTC_BKP13R ((uint32_t)0xFFFFFFFF)
  2882. /******************** Bits definition for RTC_BKP14R register ***************/
  2883. #define RTC_BKP14R ((uint32_t)0xFFFFFFFF)
  2884. /******************** Bits definition for RTC_BKP15R register ***************/
  2885. #define RTC_BKP15R ((uint32_t)0xFFFFFFFF)
  2886. /******************** Bits definition for RTC_BKP16R register ***************/
  2887. #define RTC_BKP16R ((uint32_t)0xFFFFFFFF)
  2888. /******************** Bits definition for RTC_BKP17R register ***************/
  2889. #define RTC_BKP17R ((uint32_t)0xFFFFFFFF)
  2890. /******************** Bits definition for RTC_BKP18R register ***************/
  2891. #define RTC_BKP18R ((uint32_t)0xFFFFFFFF)
  2892. /******************** Bits definition for RTC_BKP19R register ***************/
  2893. #define RTC_BKP19R ((uint32_t)0xFFFFFFFF)
  2894. /******************** Bits definition for RTC_BKP20R register ***************/
  2895. #define RTC_BKP20R ((uint32_t)0xFFFFFFFF)
  2896. /******************** Bits definition for RTC_BKP21R register ***************/
  2897. #define RTC_BKP21R ((uint32_t)0xFFFFFFFF)
  2898. /******************** Bits definition for RTC_BKP22R register ***************/
  2899. #define RTC_BKP22R ((uint32_t)0xFFFFFFFF)
  2900. /******************** Bits definition for RTC_BKP23R register ***************/
  2901. #define RTC_BKP23R ((uint32_t)0xFFFFFFFF)
  2902. /******************** Bits definition for RTC_BKP24R register ***************/
  2903. #define RTC_BKP24R ((uint32_t)0xFFFFFFFF)
  2904. /******************** Bits definition for RTC_BKP25R register ***************/
  2905. #define RTC_BKP25R ((uint32_t)0xFFFFFFFF)
  2906. /******************** Bits definition for RTC_BKP26R register ***************/
  2907. #define RTC_BKP26R ((uint32_t)0xFFFFFFFF)
  2908. /******************** Bits definition for RTC_BKP27R register ***************/
  2909. #define RTC_BKP27R ((uint32_t)0xFFFFFFFF)
  2910. /******************** Bits definition for RTC_BKP28R register ***************/
  2911. #define RTC_BKP28R ((uint32_t)0xFFFFFFFF)
  2912. /******************** Bits definition for RTC_BKP29R register ***************/
  2913. #define RTC_BKP29R ((uint32_t)0xFFFFFFFF)
  2914. /******************** Bits definition for RTC_BKP30R register ***************/
  2915. #define RTC_BKP30R ((uint32_t)0xFFFFFFFF)
  2916. /******************** Bits definition for RTC_BKP31R register ***************/
  2917. #define RTC_BKP31R ((uint32_t)0xFFFFFFFF)
  2918. /******************** Number of backup registers ******************************/
  2919. #define RTC_BKP_NUMBER 32
  2920. /******************************************************************************/
  2921. /* */
  2922. /* Serial Peripheral Interface (SPI) */
  2923. /* */
  2924. /******************************************************************************/
  2925. /******************* Bit definition for SPI_CR1 register ********************/
  2926. #define SPI_CR1_CPHA ((uint32_t)0x00000001) /*!< Clock Phase */
  2927. #define SPI_CR1_CPOL ((uint32_t)0x00000002) /*!< Clock Polarity */
  2928. #define SPI_CR1_MSTR ((uint32_t)0x00000004) /*!< Master Selection */
  2929. #define SPI_CR1_BR ((uint32_t)0x00000038) /*!< BR[2:0] bits (Baud Rate Control) */
  2930. #define SPI_CR1_BR_0 ((uint32_t)0x00000008) /*!< Bit 0 */
  2931. #define SPI_CR1_BR_1 ((uint32_t)0x00000010) /*!< Bit 1 */
  2932. #define SPI_CR1_BR_2 ((uint32_t)0x00000020) /*!< Bit 2 */
  2933. #define SPI_CR1_SPE ((uint32_t)0x00000040) /*!< SPI Enable */
  2934. #define SPI_CR1_LSBFIRST ((uint32_t)0x00000080) /*!< Frame Format */
  2935. #define SPI_CR1_SSI ((uint32_t)0x00000100) /*!< Internal slave select */
  2936. #define SPI_CR1_SSM ((uint32_t)0x00000200) /*!< Software slave management */
  2937. #define SPI_CR1_RXONLY ((uint32_t)0x00000400) /*!< Receive only */
  2938. #define SPI_CR1_DFF ((uint32_t)0x00000800) /*!< Data Frame Format */
  2939. #define SPI_CR1_CRCNEXT ((uint32_t)0x00001000) /*!< Transmit CRC next */
  2940. #define SPI_CR1_CRCEN ((uint32_t)0x00002000) /*!< Hardware CRC calculation enable */
  2941. #define SPI_CR1_BIDIOE ((uint32_t)0x00004000) /*!< Output enable in bidirectional mode */
  2942. #define SPI_CR1_BIDIMODE ((uint32_t)0x00008000) /*!< Bidirectional data mode enable */
  2943. /******************* Bit definition for SPI_CR2 register ********************/
  2944. #define SPI_CR2_RXDMAEN ((uint32_t)0x00000001) /*!< Rx Buffer DMA Enable */
  2945. #define SPI_CR2_TXDMAEN ((uint32_t)0x00000002) /*!< Tx Buffer DMA Enable */
  2946. #define SPI_CR2_SSOE ((uint32_t)0x00000004) /*!< SS Output Enable */
  2947. #define SPI_CR2_FRF ((uint32_t)0x00000010) /*!< Frame format */
  2948. #define SPI_CR2_ERRIE ((uint32_t)0x00000020) /*!< Error Interrupt Enable */
  2949. #define SPI_CR2_RXNEIE ((uint32_t)0x00000040) /*!< RX buffer Not Empty Interrupt Enable */
  2950. #define SPI_CR2_TXEIE ((uint32_t)0x00000080) /*!< Tx buffer Empty Interrupt Enable */
  2951. /******************** Bit definition for SPI_SR register ********************/
  2952. #define SPI_SR_RXNE ((uint32_t)0x00000001) /*!< Receive buffer Not Empty */
  2953. #define SPI_SR_TXE ((uint32_t)0x00000002) /*!< Transmit buffer Empty */
  2954. #define SPI_SR_CHSIDE ((uint32_t)0x00000004) /*!< Channel side */
  2955. #define SPI_SR_UDR ((uint32_t)0x00000008) /*!< Underrun flag */
  2956. #define SPI_SR_CRCERR ((uint32_t)0x00000010) /*!< CRC Error flag */
  2957. #define SPI_SR_MODF ((uint32_t)0x00000020) /*!< Mode fault */
  2958. #define SPI_SR_OVR ((uint32_t)0x00000040) /*!< Overrun flag */
  2959. #define SPI_SR_BSY ((uint32_t)0x00000080) /*!< Busy flag */
  2960. #define SPI_SR_FRE ((uint32_t)0x00000100) /*!<Frame format error flag */
  2961. /******************** Bit definition for SPI_DR register ********************/
  2962. #define SPI_DR_DR ((uint32_t)0x0000FFFF) /*!< Data Register */
  2963. /******************* Bit definition for SPI_CRCPR register ******************/
  2964. #define SPI_CRCPR_CRCPOLY ((uint32_t)0x0000FFFF) /*!< CRC polynomial register */
  2965. /****************** Bit definition for SPI_RXCRCR register ******************/
  2966. #define SPI_RXCRCR_RXCRC ((uint32_t)0x0000FFFF) /*!< Rx CRC Register */
  2967. /****************** Bit definition for SPI_TXCRCR register ******************/
  2968. #define SPI_TXCRCR_TXCRC ((uint32_t)0x0000FFFF) /*!< Tx CRC Register */
  2969. /****************** Bit definition for SPI_I2SCFGR register *****************/
  2970. #define SPI_I2SCFGR_CHLEN ((uint32_t)0x00000001) /*!<Channel length (number of bits per audio channel) */
  2971. #define SPI_I2SCFGR_DATLEN ((uint32_t)0x00000006) /*!<DATLEN[1:0] bits (Data length to be transferred) */
  2972. #define SPI_I2SCFGR_DATLEN_0 ((uint32_t)0x00000002) /*!<Bit 0 */
  2973. #define SPI_I2SCFGR_DATLEN_1 ((uint32_t)0x00000004) /*!<Bit 1 */
  2974. #define SPI_I2SCFGR_CKPOL ((uint32_t)0x00000008) /*!<steady state clock polarity */
  2975. #define SPI_I2SCFGR_I2SSTD ((uint32_t)0x00000030) /*!<I2SSTD[1:0] bits (I2S standard selection) */
  2976. #define SPI_I2SCFGR_I2SSTD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  2977. #define SPI_I2SCFGR_I2SSTD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  2978. #define SPI_I2SCFGR_PCMSYNC ((uint32_t)0x00000080) /*!<PCM frame synchronization */
  2979. #define SPI_I2SCFGR_I2SCFG ((uint32_t)0x00000300) /*!<I2SCFG[1:0] bits (I2S configuration mode) */
  2980. #define SPI_I2SCFGR_I2SCFG_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  2981. #define SPI_I2SCFGR_I2SCFG_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  2982. #define SPI_I2SCFGR_I2SE ((uint32_t)0x00000400) /*!<I2S Enable */
  2983. #define SPI_I2SCFGR_I2SMOD ((uint32_t)0x00000800) /*!<I2S mode selection */
  2984. /****************** Bit definition for SPI_I2SPR register *******************/
  2985. #define SPI_I2SPR_I2SDIV ((uint32_t)0x000000FF) /*!<I2S Linear prescaler */
  2986. #define SPI_I2SPR_ODD ((uint32_t)0x00000100) /*!<Odd factor for the prescaler */
  2987. #define SPI_I2SPR_MCKOE ((uint32_t)0x00000200) /*!<Master Clock Output Enable */
  2988. /******************************************************************************/
  2989. /* */
  2990. /* System Configuration (SYSCFG) */
  2991. /* */
  2992. /******************************************************************************/
  2993. /***************** Bit definition for SYSCFG_MEMRMP register ****************/
  2994. #define SYSCFG_MEMRMP_MEM_MODE ((uint32_t)0x00000003) /*!< SYSCFG_Memory Remap Config */
  2995. #define SYSCFG_MEMRMP_MEM_MODE_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  2996. #define SYSCFG_MEMRMP_MEM_MODE_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  2997. #define SYSCFG_MEMRMP_BOOT_MODE ((uint32_t)0x00000300) /*!< Boot mode Config */
  2998. #define SYSCFG_MEMRMP_BOOT_MODE_0 ((uint32_t)0x00000100) /*!< Bit 0 */
  2999. #define SYSCFG_MEMRMP_BOOT_MODE_1 ((uint32_t)0x00000200) /*!< Bit 1 */
  3000. /***************** Bit definition for SYSCFG_PMC register *******************/
  3001. #define SYSCFG_PMC_USB_PU ((uint32_t)0x00000001) /*!< SYSCFG PMC */
  3002. /***************** Bit definition for SYSCFG_EXTICR1 register ***************/
  3003. #define SYSCFG_EXTICR1_EXTI0 ((uint32_t)0x0000000F) /*!< EXTI 0 configuration */
  3004. #define SYSCFG_EXTICR1_EXTI1 ((uint32_t)0x000000F0) /*!< EXTI 1 configuration */
  3005. #define SYSCFG_EXTICR1_EXTI2 ((uint32_t)0x00000F00) /*!< EXTI 2 configuration */
  3006. #define SYSCFG_EXTICR1_EXTI3 ((uint32_t)0x0000F000) /*!< EXTI 3 configuration */
  3007. /**
  3008. * @brief EXTI0 configuration
  3009. */
  3010. #define SYSCFG_EXTICR1_EXTI0_PA ((uint32_t)0x00000000) /*!< PA[0] pin */
  3011. #define SYSCFG_EXTICR1_EXTI0_PB ((uint32_t)0x00000001) /*!< PB[0] pin */
  3012. #define SYSCFG_EXTICR1_EXTI0_PC ((uint32_t)0x00000002) /*!< PC[0] pin */
  3013. #define SYSCFG_EXTICR1_EXTI0_PD ((uint32_t)0x00000003) /*!< PD[0] pin */
  3014. #define SYSCFG_EXTICR1_EXTI0_PE ((uint32_t)0x00000004) /*!< PE[0] pin */
  3015. #define SYSCFG_EXTICR1_EXTI0_PH ((uint32_t)0x00000005) /*!< PH[0] pin */
  3016. #define SYSCFG_EXTICR1_EXTI0_PF ((uint32_t)0x00000006) /*!< PF[0] pin */
  3017. #define SYSCFG_EXTICR1_EXTI0_PG ((uint32_t)0x00000007) /*!< PG[0] pin */
  3018. /**
  3019. * @brief EXTI1 configuration
  3020. */
  3021. #define SYSCFG_EXTICR1_EXTI1_PA ((uint32_t)0x00000000) /*!< PA[1] pin */
  3022. #define SYSCFG_EXTICR1_EXTI1_PB ((uint32_t)0x00000010) /*!< PB[1] pin */
  3023. #define SYSCFG_EXTICR1_EXTI1_PC ((uint32_t)0x00000020) /*!< PC[1] pin */
  3024. #define SYSCFG_EXTICR1_EXTI1_PD ((uint32_t)0x00000030) /*!< PD[1] pin */
  3025. #define SYSCFG_EXTICR1_EXTI1_PE ((uint32_t)0x00000040) /*!< PE[1] pin */
  3026. #define SYSCFG_EXTICR1_EXTI1_PH ((uint32_t)0x00000050) /*!< PH[1] pin */
  3027. #define SYSCFG_EXTICR1_EXTI1_PF ((uint32_t)0x00000060) /*!< PF[1] pin */
  3028. #define SYSCFG_EXTICR1_EXTI1_PG ((uint32_t)0x00000070) /*!< PG[1] pin */
  3029. /**
  3030. * @brief EXTI2 configuration
  3031. */
  3032. #define SYSCFG_EXTICR1_EXTI2_PA ((uint32_t)0x00000000) /*!< PA[2] pin */
  3033. #define SYSCFG_EXTICR1_EXTI2_PB ((uint32_t)0x00000100) /*!< PB[2] pin */
  3034. #define SYSCFG_EXTICR1_EXTI2_PC ((uint32_t)0x00000200) /*!< PC[2] pin */
  3035. #define SYSCFG_EXTICR1_EXTI2_PD ((uint32_t)0x00000300) /*!< PD[2] pin */
  3036. #define SYSCFG_EXTICR1_EXTI2_PE ((uint32_t)0x00000400) /*!< PE[2] pin */
  3037. #define SYSCFG_EXTICR1_EXTI2_PH ((uint32_t)0x00000500) /*!< PH[2] pin */
  3038. #define SYSCFG_EXTICR1_EXTI2_PF ((uint32_t)0x00000600) /*!< PF[2] pin */
  3039. #define SYSCFG_EXTICR1_EXTI2_PG ((uint32_t)0x00000700) /*!< PG[2] pin */
  3040. /**
  3041. * @brief EXTI3 configuration
  3042. */
  3043. #define SYSCFG_EXTICR1_EXTI3_PA ((uint32_t)0x00000000) /*!< PA[3] pin */
  3044. #define SYSCFG_EXTICR1_EXTI3_PB ((uint32_t)0x00001000) /*!< PB[3] pin */
  3045. #define SYSCFG_EXTICR1_EXTI3_PC ((uint32_t)0x00002000) /*!< PC[3] pin */
  3046. #define SYSCFG_EXTICR1_EXTI3_PD ((uint32_t)0x00003000) /*!< PD[3] pin */
  3047. #define SYSCFG_EXTICR1_EXTI3_PE ((uint32_t)0x00004000) /*!< PE[3] pin */
  3048. #define SYSCFG_EXTICR1_EXTI3_PF ((uint32_t)0x00003000) /*!< PF[3] pin */
  3049. #define SYSCFG_EXTICR1_EXTI3_PG ((uint32_t)0x00004000) /*!< PG[3] pin */
  3050. /***************** Bit definition for SYSCFG_EXTICR2 register *****************/
  3051. #define SYSCFG_EXTICR2_EXTI4 ((uint32_t)0x0000000F) /*!< EXTI 4 configuration */
  3052. #define SYSCFG_EXTICR2_EXTI5 ((uint32_t)0x000000F0) /*!< EXTI 5 configuration */
  3053. #define SYSCFG_EXTICR2_EXTI6 ((uint32_t)0x00000F00) /*!< EXTI 6 configuration */
  3054. #define SYSCFG_EXTICR2_EXTI7 ((uint32_t)0x0000F000) /*!< EXTI 7 configuration */
  3055. /**
  3056. * @brief EXTI4 configuration
  3057. */
  3058. #define SYSCFG_EXTICR2_EXTI4_PA ((uint32_t)0x00000000) /*!< PA[4] pin */
  3059. #define SYSCFG_EXTICR2_EXTI4_PB ((uint32_t)0x00000001) /*!< PB[4] pin */
  3060. #define SYSCFG_EXTICR2_EXTI4_PC ((uint32_t)0x00000002) /*!< PC[4] pin */
  3061. #define SYSCFG_EXTICR2_EXTI4_PD ((uint32_t)0x00000003) /*!< PD[4] pin */
  3062. #define SYSCFG_EXTICR2_EXTI4_PE ((uint32_t)0x00000004) /*!< PE[4] pin */
  3063. #define SYSCFG_EXTICR2_EXTI4_PF ((uint32_t)0x00000006) /*!< PF[4] pin */
  3064. #define SYSCFG_EXTICR2_EXTI4_PG ((uint32_t)0x00000007) /*!< PG[4] pin */
  3065. /**
  3066. * @brief EXTI5 configuration
  3067. */
  3068. #define SYSCFG_EXTICR2_EXTI5_PA ((uint32_t)0x00000000) /*!< PA[5] pin */
  3069. #define SYSCFG_EXTICR2_EXTI5_PB ((uint32_t)0x00000010) /*!< PB[5] pin */
  3070. #define SYSCFG_EXTICR2_EXTI5_PC ((uint32_t)0x00000020) /*!< PC[5] pin */
  3071. #define SYSCFG_EXTICR2_EXTI5_PD ((uint32_t)0x00000030) /*!< PD[5] pin */
  3072. #define SYSCFG_EXTICR2_EXTI5_PE ((uint32_t)0x00000040) /*!< PE[5] pin */
  3073. #define SYSCFG_EXTICR2_EXTI5_PF ((uint32_t)0x00000060) /*!< PF[5] pin */
  3074. #define SYSCFG_EXTICR2_EXTI5_PG ((uint32_t)0x00000070) /*!< PG[5] pin */
  3075. /**
  3076. * @brief EXTI6 configuration
  3077. */
  3078. #define SYSCFG_EXTICR2_EXTI6_PA ((uint32_t)0x00000000) /*!< PA[6] pin */
  3079. #define SYSCFG_EXTICR2_EXTI6_PB ((uint32_t)0x00000100) /*!< PB[6] pin */
  3080. #define SYSCFG_EXTICR2_EXTI6_PC ((uint32_t)0x00000200) /*!< PC[6] pin */
  3081. #define SYSCFG_EXTICR2_EXTI6_PD ((uint32_t)0x00000300) /*!< PD[6] pin */
  3082. #define SYSCFG_EXTICR2_EXTI6_PE ((uint32_t)0x00000400) /*!< PE[6] pin */
  3083. #define SYSCFG_EXTICR2_EXTI6_PF ((uint32_t)0x00000600) /*!< PF[6] pin */
  3084. #define SYSCFG_EXTICR2_EXTI6_PG ((uint32_t)0x00000700) /*!< PG[6] pin */
  3085. /**
  3086. * @brief EXTI7 configuration
  3087. */
  3088. #define SYSCFG_EXTICR2_EXTI7_PA ((uint32_t)0x00000000) /*!< PA[7] pin */
  3089. #define SYSCFG_EXTICR2_EXTI7_PB ((uint32_t)0x00001000) /*!< PB[7] pin */
  3090. #define SYSCFG_EXTICR2_EXTI7_PC ((uint32_t)0x00002000) /*!< PC[7] pin */
  3091. #define SYSCFG_EXTICR2_EXTI7_PD ((uint32_t)0x00003000) /*!< PD[7] pin */
  3092. #define SYSCFG_EXTICR2_EXTI7_PE ((uint32_t)0x00004000) /*!< PE[7] pin */
  3093. #define SYSCFG_EXTICR2_EXTI7_PF ((uint32_t)0x00006000) /*!< PF[7] pin */
  3094. #define SYSCFG_EXTICR2_EXTI7_PG ((uint32_t)0x00007000) /*!< PG[7] pin */
  3095. /***************** Bit definition for SYSCFG_EXTICR3 register *****************/
  3096. #define SYSCFG_EXTICR3_EXTI8 ((uint32_t)0x0000000F) /*!< EXTI 8 configuration */
  3097. #define SYSCFG_EXTICR3_EXTI9 ((uint32_t)0x000000F0) /*!< EXTI 9 configuration */
  3098. #define SYSCFG_EXTICR3_EXTI10 ((uint32_t)0x00000F00) /*!< EXTI 10 configuration */
  3099. #define SYSCFG_EXTICR3_EXTI11 ((uint32_t)0x0000F000) /*!< EXTI 11 configuration */
  3100. /**
  3101. * @brief EXTI8 configuration
  3102. */
  3103. #define SYSCFG_EXTICR3_EXTI8_PA ((uint32_t)0x00000000) /*!< PA[8] pin */
  3104. #define SYSCFG_EXTICR3_EXTI8_PB ((uint32_t)0x00000001) /*!< PB[8] pin */
  3105. #define SYSCFG_EXTICR3_EXTI8_PC ((uint32_t)0x00000002) /*!< PC[8] pin */
  3106. #define SYSCFG_EXTICR3_EXTI8_PD ((uint32_t)0x00000003) /*!< PD[8] pin */
  3107. #define SYSCFG_EXTICR3_EXTI8_PE ((uint32_t)0x00000004) /*!< PE[8] pin */
  3108. #define SYSCFG_EXTICR3_EXTI8_PF ((uint32_t)0x00000006) /*!< PF[8] pin */
  3109. #define SYSCFG_EXTICR3_EXTI8_PG ((uint32_t)0x00000007) /*!< PG[8] pin */
  3110. /**
  3111. * @brief EXTI9 configuration
  3112. */
  3113. #define SYSCFG_EXTICR3_EXTI9_PA ((uint32_t)0x00000000) /*!< PA[9] pin */
  3114. #define SYSCFG_EXTICR3_EXTI9_PB ((uint32_t)0x00000010) /*!< PB[9] pin */
  3115. #define SYSCFG_EXTICR3_EXTI9_PC ((uint32_t)0x00000020) /*!< PC[9] pin */
  3116. #define SYSCFG_EXTICR3_EXTI9_PD ((uint32_t)0x00000030) /*!< PD[9] pin */
  3117. #define SYSCFG_EXTICR3_EXTI9_PE ((uint32_t)0x00000040) /*!< PE[9] pin */
  3118. #define SYSCFG_EXTICR3_EXTI9_PF ((uint32_t)0x00000060) /*!< PF[9] pin */
  3119. #define SYSCFG_EXTICR3_EXTI9_PG ((uint32_t)0x00000070) /*!< PG[9] pin */
  3120. /**
  3121. * @brief EXTI10 configuration
  3122. */
  3123. #define SYSCFG_EXTICR3_EXTI10_PA ((uint32_t)0x00000000) /*!< PA[10] pin */
  3124. #define SYSCFG_EXTICR3_EXTI10_PB ((uint32_t)0x00000100) /*!< PB[10] pin */
  3125. #define SYSCFG_EXTICR3_EXTI10_PC ((uint32_t)0x00000200) /*!< PC[10] pin */
  3126. #define SYSCFG_EXTICR3_EXTI10_PD ((uint32_t)0x00000300) /*!< PD[10] pin */
  3127. #define SYSCFG_EXTICR3_EXTI10_PE ((uint32_t)0x00000400) /*!< PE[10] pin */
  3128. #define SYSCFG_EXTICR3_EXTI10_PF ((uint32_t)0x00000600) /*!< PF[10] pin */
  3129. #define SYSCFG_EXTICR3_EXTI10_PG ((uint32_t)0x00000700) /*!< PG[10] pin */
  3130. /**
  3131. * @brief EXTI11 configuration
  3132. */
  3133. #define SYSCFG_EXTICR3_EXTI11_PA ((uint32_t)0x00000000) /*!< PA[11] pin */
  3134. #define SYSCFG_EXTICR3_EXTI11_PB ((uint32_t)0x00001000) /*!< PB[11] pin */
  3135. #define SYSCFG_EXTICR3_EXTI11_PC ((uint32_t)0x00002000) /*!< PC[11] pin */
  3136. #define SYSCFG_EXTICR3_EXTI11_PD ((uint32_t)0x00003000) /*!< PD[11] pin */
  3137. #define SYSCFG_EXTICR3_EXTI11_PE ((uint32_t)0x00004000) /*!< PE[11] pin */
  3138. #define SYSCFG_EXTICR3_EXTI11_PF ((uint32_t)0x00006000) /*!< PF[11] pin */
  3139. #define SYSCFG_EXTICR3_EXTI11_PG ((uint32_t)0x00007000) /*!< PG[11] pin */
  3140. /***************** Bit definition for SYSCFG_EXTICR4 register *****************/
  3141. #define SYSCFG_EXTICR4_EXTI12 ((uint32_t)0x0000000F) /*!< EXTI 12 configuration */
  3142. #define SYSCFG_EXTICR4_EXTI13 ((uint32_t)0x000000F0) /*!< EXTI 13 configuration */
  3143. #define SYSCFG_EXTICR4_EXTI14 ((uint32_t)0x00000F00) /*!< EXTI 14 configuration */
  3144. #define SYSCFG_EXTICR4_EXTI15 ((uint32_t)0x0000F000) /*!< EXTI 15 configuration */
  3145. /**
  3146. * @brief EXTI12 configuration
  3147. */
  3148. #define SYSCFG_EXTICR4_EXTI12_PA ((uint32_t)0x00000000) /*!< PA[12] pin */
  3149. #define SYSCFG_EXTICR4_EXTI12_PB ((uint32_t)0x00000001) /*!< PB[12] pin */
  3150. #define SYSCFG_EXTICR4_EXTI12_PC ((uint32_t)0x00000002) /*!< PC[12] pin */
  3151. #define SYSCFG_EXTICR4_EXTI12_PD ((uint32_t)0x00000003) /*!< PD[12] pin */
  3152. #define SYSCFG_EXTICR4_EXTI12_PE ((uint32_t)0x00000004) /*!< PE[12] pin */
  3153. #define SYSCFG_EXTICR4_EXTI12_PF ((uint32_t)0x00000006) /*!< PF[12] pin */
  3154. #define SYSCFG_EXTICR4_EXTI12_PG ((uint32_t)0x00000007) /*!< PG[12] pin */
  3155. /**
  3156. * @brief EXTI13 configuration
  3157. */
  3158. #define SYSCFG_EXTICR4_EXTI13_PA ((uint32_t)0x00000000) /*!< PA[13] pin */
  3159. #define SYSCFG_EXTICR4_EXTI13_PB ((uint32_t)0x00000010) /*!< PB[13] pin */
  3160. #define SYSCFG_EXTICR4_EXTI13_PC ((uint32_t)0x00000020) /*!< PC[13] pin */
  3161. #define SYSCFG_EXTICR4_EXTI13_PD ((uint32_t)0x00000030) /*!< PD[13] pin */
  3162. #define SYSCFG_EXTICR4_EXTI13_PE ((uint32_t)0x00000040) /*!< PE[13] pin */
  3163. #define SYSCFG_EXTICR4_EXTI13_PF ((uint32_t)0x00000060) /*!< PF[13] pin */
  3164. #define SYSCFG_EXTICR4_EXTI13_PG ((uint32_t)0x00000070) /*!< PG[13] pin */
  3165. /**
  3166. * @brief EXTI14 configuration
  3167. */
  3168. #define SYSCFG_EXTICR4_EXTI14_PA ((uint32_t)0x00000000) /*!< PA[14] pin */
  3169. #define SYSCFG_EXTICR4_EXTI14_PB ((uint32_t)0x00000100) /*!< PB[14] pin */
  3170. #define SYSCFG_EXTICR4_EXTI14_PC ((uint32_t)0x00000200) /*!< PC[14] pin */
  3171. #define SYSCFG_EXTICR4_EXTI14_PD ((uint32_t)0x00000300) /*!< PD[14] pin */
  3172. #define SYSCFG_EXTICR4_EXTI14_PE ((uint32_t)0x00000400) /*!< PE[14] pin */
  3173. #define SYSCFG_EXTICR4_EXTI14_PF ((uint32_t)0x00000600) /*!< PF[14] pin */
  3174. #define SYSCFG_EXTICR4_EXTI14_PG ((uint32_t)0x00000700) /*!< PG[14] pin */
  3175. /**
  3176. * @brief EXTI15 configuration
  3177. */
  3178. #define SYSCFG_EXTICR4_EXTI15_PA ((uint32_t)0x00000000) /*!< PA[15] pin */
  3179. #define SYSCFG_EXTICR4_EXTI15_PB ((uint32_t)0x00001000) /*!< PB[15] pin */
  3180. #define SYSCFG_EXTICR4_EXTI15_PC ((uint32_t)0x00002000) /*!< PC[15] pin */
  3181. #define SYSCFG_EXTICR4_EXTI15_PD ((uint32_t)0x00003000) /*!< PD[15] pin */
  3182. #define SYSCFG_EXTICR4_EXTI15_PE ((uint32_t)0x00004000) /*!< PE[15] pin */
  3183. #define SYSCFG_EXTICR4_EXTI15_PF ((uint32_t)0x00006000) /*!< PF[15] pin */
  3184. #define SYSCFG_EXTICR4_EXTI15_PG ((uint32_t)0x00007000) /*!< PG[15] pin */
  3185. /******************************************************************************/
  3186. /* */
  3187. /* Routing Interface (RI) */
  3188. /* */
  3189. /******************************************************************************/
  3190. /******************** Bit definition for RI_ICR register ********************/
  3191. #define RI_ICR_IC1OS ((uint32_t)0x0000000F) /*!< IC1OS[3:0] bits (Input Capture 1 select bits) */
  3192. #define RI_ICR_IC1OS_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3193. #define RI_ICR_IC1OS_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3194. #define RI_ICR_IC1OS_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3195. #define RI_ICR_IC1OS_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3196. #define RI_ICR_IC2OS ((uint32_t)0x000000F0) /*!< IC2OS[3:0] bits (Input Capture 2 select bits) */
  3197. #define RI_ICR_IC2OS_0 ((uint32_t)0x00000010) /*!< Bit 0 */
  3198. #define RI_ICR_IC2OS_1 ((uint32_t)0x00000020) /*!< Bit 1 */
  3199. #define RI_ICR_IC2OS_2 ((uint32_t)0x00000040) /*!< Bit 2 */
  3200. #define RI_ICR_IC2OS_3 ((uint32_t)0x00000080) /*!< Bit 3 */
  3201. #define RI_ICR_IC3OS ((uint32_t)0x00000F00) /*!< IC3OS[3:0] bits (Input Capture 3 select bits) */
  3202. #define RI_ICR_IC3OS_0 ((uint32_t)0x00000100) /*!< Bit 0 */
  3203. #define RI_ICR_IC3OS_1 ((uint32_t)0x00000200) /*!< Bit 1 */
  3204. #define RI_ICR_IC3OS_2 ((uint32_t)0x00000400) /*!< Bit 2 */
  3205. #define RI_ICR_IC3OS_3 ((uint32_t)0x00000800) /*!< Bit 3 */
  3206. #define RI_ICR_IC4OS ((uint32_t)0x0000F000) /*!< IC4OS[3:0] bits (Input Capture 4 select bits) */
  3207. #define RI_ICR_IC4OS_0 ((uint32_t)0x00001000) /*!< Bit 0 */
  3208. #define RI_ICR_IC4OS_1 ((uint32_t)0x00002000) /*!< Bit 1 */
  3209. #define RI_ICR_IC4OS_2 ((uint32_t)0x00004000) /*!< Bit 2 */
  3210. #define RI_ICR_IC4OS_3 ((uint32_t)0x00008000) /*!< Bit 3 */
  3211. #define RI_ICR_TIM ((uint32_t)0x00030000) /*!< TIM[3:0] bits (Timers select bits) */
  3212. #define RI_ICR_TIM_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  3213. #define RI_ICR_TIM_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  3214. #define RI_ICR_IC1 ((uint32_t)0x00040000) /*!< Input capture 1 */
  3215. #define RI_ICR_IC2 ((uint32_t)0x00080000) /*!< Input capture 2 */
  3216. #define RI_ICR_IC3 ((uint32_t)0x00100000) /*!< Input capture 3 */
  3217. #define RI_ICR_IC4 ((uint32_t)0x00200000) /*!< Input capture 4 */
  3218. /******************** Bit definition for RI_ASCR1 register ********************/
  3219. #define RI_ASCR1_CH ((uint32_t)0x7BFDFFFF) /*!< AS_CH[25:18] & AS_CH[15:0] bits ( Analog switches selection bits) */
  3220. #define RI_ASCR1_CH_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3221. #define RI_ASCR1_CH_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3222. #define RI_ASCR1_CH_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3223. #define RI_ASCR1_CH_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3224. #define RI_ASCR1_CH_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3225. #define RI_ASCR1_CH_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3226. #define RI_ASCR1_CH_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3227. #define RI_ASCR1_CH_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3228. #define RI_ASCR1_CH_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3229. #define RI_ASCR1_CH_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3230. #define RI_ASCR1_CH_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3231. #define RI_ASCR1_CH_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3232. #define RI_ASCR1_CH_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3233. #define RI_ASCR1_CH_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3234. #define RI_ASCR1_CH_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3235. #define RI_ASCR1_CH_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3236. #define RI_ASCR1_CH_31 ((uint32_t)0x00010000) /*!< Bit 16 */
  3237. #define RI_ASCR1_CH_18 ((uint32_t)0x00040000) /*!< Bit 18 */
  3238. #define RI_ASCR1_CH_19 ((uint32_t)0x00080000) /*!< Bit 19 */
  3239. #define RI_ASCR1_CH_20 ((uint32_t)0x00100000) /*!< Bit 20 */
  3240. #define RI_ASCR1_CH_21 ((uint32_t)0x00200000) /*!< Bit 21 */
  3241. #define RI_ASCR1_CH_22 ((uint32_t)0x00400000) /*!< Bit 22 */
  3242. #define RI_ASCR1_CH_23 ((uint32_t)0x00800000) /*!< Bit 23 */
  3243. #define RI_ASCR1_CH_24 ((uint32_t)0x01000000) /*!< Bit 24 */
  3244. #define RI_ASCR1_CH_25 ((uint32_t)0x02000000) /*!< Bit 25 */
  3245. #define RI_ASCR1_VCOMP ((uint32_t)0x04000000) /*!< ADC analog switch selection for internal node to COMP1 */
  3246. #define RI_ASCR1_CH_27 ((uint32_t)0x00400000) /*!< Bit 27 */
  3247. #define RI_ASCR1_CH_28 ((uint32_t)0x00800000) /*!< Bit 28 */
  3248. #define RI_ASCR1_CH_29 ((uint32_t)0x01000000) /*!< Bit 29 */
  3249. #define RI_ASCR1_CH_30 ((uint32_t)0x02000000) /*!< Bit 30 */
  3250. #define RI_ASCR1_SCM ((uint32_t)0x80000000) /*!< I/O Switch control mode */
  3251. /******************** Bit definition for RI_ASCR2 register ********************/
  3252. #define RI_ASCR2_GR10_1 ((uint32_t)0x00000001) /*!< GR10-1 selection bit */
  3253. #define RI_ASCR2_GR10_2 ((uint32_t)0x00000002) /*!< GR10-2 selection bit */
  3254. #define RI_ASCR2_GR10_3 ((uint32_t)0x00000004) /*!< GR10-3 selection bit */
  3255. #define RI_ASCR2_GR10_4 ((uint32_t)0x00000008) /*!< GR10-4 selection bit */
  3256. #define RI_ASCR2_GR6_1 ((uint32_t)0x00000010) /*!< GR6-1 selection bit */
  3257. #define RI_ASCR2_GR6_2 ((uint32_t)0x00000020) /*!< GR6-2 selection bit */
  3258. #define RI_ASCR2_GR5_1 ((uint32_t)0x00000040) /*!< GR5-1 selection bit */
  3259. #define RI_ASCR2_GR5_2 ((uint32_t)0x00000080) /*!< GR5-2 selection bit */
  3260. #define RI_ASCR2_GR5_3 ((uint32_t)0x00000100) /*!< GR5-3 selection bit */
  3261. #define RI_ASCR2_GR4_1 ((uint32_t)0x00000200) /*!< GR4-1 selection bit */
  3262. #define RI_ASCR2_GR4_2 ((uint32_t)0x00000400) /*!< GR4-2 selection bit */
  3263. #define RI_ASCR2_GR4_3 ((uint32_t)0x00000800) /*!< GR4-3 selection bit */
  3264. #define RI_ASCR2_GR4_4 ((uint32_t)0x00008000) /*!< GR4-4 selection bit */
  3265. #define RI_ASCR2_CH0b ((uint32_t)0x00010000) /*!< CH0b selection bit */
  3266. #define RI_ASCR2_GR6_3 ((uint32_t)0x08000000) /*!< GR6-3 selection bit */
  3267. #define RI_ASCR2_GR6_4 ((uint32_t)0x10000000) /*!< GR6-4 selection bit */
  3268. /******************** Bit definition for RI_HYSCR1 register ********************/
  3269. #define RI_HYSCR1_PA ((uint32_t)0x0000FFFF) /*!< PA[15:0] Port A Hysteresis selection */
  3270. #define RI_HYSCR1_PA_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3271. #define RI_HYSCR1_PA_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3272. #define RI_HYSCR1_PA_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3273. #define RI_HYSCR1_PA_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3274. #define RI_HYSCR1_PA_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3275. #define RI_HYSCR1_PA_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3276. #define RI_HYSCR1_PA_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3277. #define RI_HYSCR1_PA_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3278. #define RI_HYSCR1_PA_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3279. #define RI_HYSCR1_PA_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3280. #define RI_HYSCR1_PA_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3281. #define RI_HYSCR1_PA_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3282. #define RI_HYSCR1_PA_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3283. #define RI_HYSCR1_PA_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3284. #define RI_HYSCR1_PA_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3285. #define RI_HYSCR1_PA_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3286. #define RI_HYSCR1_PB ((uint32_t)0xFFFF0000) /*!< PB[15:0] Port B Hysteresis selection */
  3287. #define RI_HYSCR1_PB_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  3288. #define RI_HYSCR1_PB_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  3289. #define RI_HYSCR1_PB_2 ((uint32_t)0x00040000) /*!< Bit 2 */
  3290. #define RI_HYSCR1_PB_3 ((uint32_t)0x00080000) /*!< Bit 3 */
  3291. #define RI_HYSCR1_PB_4 ((uint32_t)0x00100000) /*!< Bit 4 */
  3292. #define RI_HYSCR1_PB_5 ((uint32_t)0x00200000) /*!< Bit 5 */
  3293. #define RI_HYSCR1_PB_6 ((uint32_t)0x00400000) /*!< Bit 6 */
  3294. #define RI_HYSCR1_PB_7 ((uint32_t)0x00800000) /*!< Bit 7 */
  3295. #define RI_HYSCR1_PB_8 ((uint32_t)0x01000000) /*!< Bit 8 */
  3296. #define RI_HYSCR1_PB_9 ((uint32_t)0x02000000) /*!< Bit 9 */
  3297. #define RI_HYSCR1_PB_10 ((uint32_t)0x04000000) /*!< Bit 10 */
  3298. #define RI_HYSCR1_PB_11 ((uint32_t)0x08000000) /*!< Bit 11 */
  3299. #define RI_HYSCR1_PB_12 ((uint32_t)0x10000000) /*!< Bit 12 */
  3300. #define RI_HYSCR1_PB_13 ((uint32_t)0x20000000) /*!< Bit 13 */
  3301. #define RI_HYSCR1_PB_14 ((uint32_t)0x40000000) /*!< Bit 14 */
  3302. #define RI_HYSCR1_PB_15 ((uint32_t)0x80000000) /*!< Bit 15 */
  3303. /******************** Bit definition for RI_HYSCR2 register ********************/
  3304. #define RI_HYSCR2_PC ((uint32_t)0x0000FFFF) /*!< PC[15:0] Port C Hysteresis selection */
  3305. #define RI_HYSCR2_PC_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3306. #define RI_HYSCR2_PC_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3307. #define RI_HYSCR2_PC_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3308. #define RI_HYSCR2_PC_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3309. #define RI_HYSCR2_PC_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3310. #define RI_HYSCR2_PC_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3311. #define RI_HYSCR2_PC_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3312. #define RI_HYSCR2_PC_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3313. #define RI_HYSCR2_PC_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3314. #define RI_HYSCR2_PC_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3315. #define RI_HYSCR2_PC_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3316. #define RI_HYSCR2_PC_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3317. #define RI_HYSCR2_PC_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3318. #define RI_HYSCR2_PC_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3319. #define RI_HYSCR2_PC_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3320. #define RI_HYSCR2_PC_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3321. #define RI_HYSCR2_PD ((uint32_t)0xFFFF0000) /*!< PD[15:0] Port D Hysteresis selection */
  3322. #define RI_HYSCR2_PD_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  3323. #define RI_HYSCR2_PD_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  3324. #define RI_HYSCR2_PD_2 ((uint32_t)0x00040000) /*!< Bit 2 */
  3325. #define RI_HYSCR2_PD_3 ((uint32_t)0x00080000) /*!< Bit 3 */
  3326. #define RI_HYSCR2_PD_4 ((uint32_t)0x00100000) /*!< Bit 4 */
  3327. #define RI_HYSCR2_PD_5 ((uint32_t)0x00200000) /*!< Bit 5 */
  3328. #define RI_HYSCR2_PD_6 ((uint32_t)0x00400000) /*!< Bit 6 */
  3329. #define RI_HYSCR2_PD_7 ((uint32_t)0x00800000) /*!< Bit 7 */
  3330. #define RI_HYSCR2_PD_8 ((uint32_t)0x01000000) /*!< Bit 8 */
  3331. #define RI_HYSCR2_PD_9 ((uint32_t)0x02000000) /*!< Bit 9 */
  3332. #define RI_HYSCR2_PD_10 ((uint32_t)0x04000000) /*!< Bit 10 */
  3333. #define RI_HYSCR2_PD_11 ((uint32_t)0x08000000) /*!< Bit 11 */
  3334. #define RI_HYSCR2_PD_12 ((uint32_t)0x10000000) /*!< Bit 12 */
  3335. #define RI_HYSCR2_PD_13 ((uint32_t)0x20000000) /*!< Bit 13 */
  3336. #define RI_HYSCR2_PD_14 ((uint32_t)0x40000000) /*!< Bit 14 */
  3337. #define RI_HYSCR2_PD_15 ((uint32_t)0x80000000) /*!< Bit 15 */
  3338. /******************** Bit definition for RI_HYSCR3 register ********************/
  3339. #define RI_HYSCR3_PE ((uint32_t)0x0000FFFF) /*!< PE[15:0] Port E Hysteresis selection */
  3340. #define RI_HYSCR3_PE_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3341. #define RI_HYSCR3_PE_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3342. #define RI_HYSCR3_PE_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3343. #define RI_HYSCR3_PE_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3344. #define RI_HYSCR3_PE_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3345. #define RI_HYSCR3_PE_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3346. #define RI_HYSCR3_PE_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3347. #define RI_HYSCR3_PE_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3348. #define RI_HYSCR3_PE_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3349. #define RI_HYSCR3_PE_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3350. #define RI_HYSCR3_PE_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3351. #define RI_HYSCR3_PE_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3352. #define RI_HYSCR3_PE_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3353. #define RI_HYSCR3_PE_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3354. #define RI_HYSCR3_PE_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3355. #define RI_HYSCR3_PE_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3356. /******************** Bit definition for RI_ASMR1 register ********************/
  3357. #define RI_ASMR1_PA ((uint32_t)0x0000FFFF) /*!< PA[15:0] Port A selection*/
  3358. #define RI_ASMR1_PA_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3359. #define RI_ASMR1_PA_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3360. #define RI_ASMR1_PA_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3361. #define RI_ASMR1_PA_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3362. #define RI_ASMR1_PA_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3363. #define RI_ASMR1_PA_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3364. #define RI_ASMR1_PA_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3365. #define RI_ASMR1_PA_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3366. #define RI_ASMR1_PA_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3367. #define RI_ASMR1_PA_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3368. #define RI_ASMR1_PA_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3369. #define RI_ASMR1_PA_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3370. #define RI_ASMR1_PA_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3371. #define RI_ASMR1_PA_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3372. #define RI_ASMR1_PA_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3373. #define RI_ASMR1_PA_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3374. /******************** Bit definition for RI_CMR1 register ********************/
  3375. #define RI_CMR1_PA ((uint32_t)0x0000FFFF) /*!< PA[15:0] Port A selection*/
  3376. #define RI_CMR1_PA_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3377. #define RI_CMR1_PA_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3378. #define RI_CMR1_PA_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3379. #define RI_CMR1_PA_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3380. #define RI_CMR1_PA_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3381. #define RI_CMR1_PA_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3382. #define RI_CMR1_PA_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3383. #define RI_CMR1_PA_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3384. #define RI_CMR1_PA_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3385. #define RI_CMR1_PA_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3386. #define RI_CMR1_PA_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3387. #define RI_CMR1_PA_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3388. #define RI_CMR1_PA_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3389. #define RI_CMR1_PA_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3390. #define RI_CMR1_PA_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3391. #define RI_CMR1_PA_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3392. /******************** Bit definition for RI_CICR1 register ********************/
  3393. #define RI_CICR1_PA ((uint32_t)0x0000FFFF) /*!< PA[15:0] Port A selection*/
  3394. #define RI_CICR1_PA_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3395. #define RI_CICR1_PA_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3396. #define RI_CICR1_PA_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3397. #define RI_CICR1_PA_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3398. #define RI_CICR1_PA_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3399. #define RI_CICR1_PA_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3400. #define RI_CICR1_PA_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3401. #define RI_CICR1_PA_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3402. #define RI_CICR1_PA_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3403. #define RI_CICR1_PA_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3404. #define RI_CICR1_PA_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3405. #define RI_CICR1_PA_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3406. #define RI_CICR1_PA_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3407. #define RI_CICR1_PA_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3408. #define RI_CICR1_PA_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3409. #define RI_CICR1_PA_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3410. /******************** Bit definition for RI_ASMR2 register ********************/
  3411. #define RI_ASMR2_PB ((uint32_t)0x0000FFFF) /*!< PB[15:0] Port B selection */
  3412. #define RI_ASMR2_PB_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3413. #define RI_ASMR2_PB_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3414. #define RI_ASMR2_PB_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3415. #define RI_ASMR2_PB_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3416. #define RI_ASMR2_PB_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3417. #define RI_ASMR2_PB_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3418. #define RI_ASMR2_PB_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3419. #define RI_ASMR2_PB_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3420. #define RI_ASMR2_PB_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3421. #define RI_ASMR2_PB_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3422. #define RI_ASMR2_PB_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3423. #define RI_ASMR2_PB_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3424. #define RI_ASMR2_PB_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3425. #define RI_ASMR2_PB_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3426. #define RI_ASMR2_PB_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3427. #define RI_ASMR2_PB_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3428. /******************** Bit definition for RI_CMR2 register ********************/
  3429. #define RI_CMR2_PB ((uint32_t)0x0000FFFF) /*!< PB[15:0] Port B selection */
  3430. #define RI_CMR2_PB_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3431. #define RI_CMR2_PB_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3432. #define RI_CMR2_PB_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3433. #define RI_CMR2_PB_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3434. #define RI_CMR2_PB_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3435. #define RI_CMR2_PB_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3436. #define RI_CMR2_PB_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3437. #define RI_CMR2_PB_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3438. #define RI_CMR2_PB_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3439. #define RI_CMR2_PB_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3440. #define RI_CMR2_PB_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3441. #define RI_CMR2_PB_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3442. #define RI_CMR2_PB_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3443. #define RI_CMR2_PB_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3444. #define RI_CMR2_PB_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3445. #define RI_CMR2_PB_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3446. /******************** Bit definition for RI_CICR2 register ********************/
  3447. #define RI_CICR2_PB ((uint32_t)0x0000FFFF) /*!< PB[15:0] Port B selection */
  3448. #define RI_CICR2_PB_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3449. #define RI_CICR2_PB_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3450. #define RI_CICR2_PB_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3451. #define RI_CICR2_PB_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3452. #define RI_CICR2_PB_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3453. #define RI_CICR2_PB_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3454. #define RI_CICR2_PB_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3455. #define RI_CICR2_PB_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3456. #define RI_CICR2_PB_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3457. #define RI_CICR2_PB_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3458. #define RI_CICR2_PB_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3459. #define RI_CICR2_PB_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3460. #define RI_CICR2_PB_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3461. #define RI_CICR2_PB_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3462. #define RI_CICR2_PB_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3463. #define RI_CICR2_PB_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3464. /******************** Bit definition for RI_ASMR3 register ********************/
  3465. #define RI_ASMR3_PC ((uint32_t)0x0000FFFF) /*!< PC[15:0] Port C selection */
  3466. #define RI_ASMR3_PC_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3467. #define RI_ASMR3_PC_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3468. #define RI_ASMR3_PC_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3469. #define RI_ASMR3_PC_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3470. #define RI_ASMR3_PC_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3471. #define RI_ASMR3_PC_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3472. #define RI_ASMR3_PC_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3473. #define RI_ASMR3_PC_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3474. #define RI_ASMR3_PC_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3475. #define RI_ASMR3_PC_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3476. #define RI_ASMR3_PC_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3477. #define RI_ASMR3_PC_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3478. #define RI_ASMR3_PC_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3479. #define RI_ASMR3_PC_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3480. #define RI_ASMR3_PC_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3481. #define RI_ASMR3_PC_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3482. /******************** Bit definition for RI_CMR3 register ********************/
  3483. #define RI_CMR3_PC ((uint32_t)0x0000FFFF) /*!< PC[15:0] Port C selection */
  3484. #define RI_CMR3_PC_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3485. #define RI_CMR3_PC_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3486. #define RI_CMR3_PC_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3487. #define RI_CMR3_PC_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3488. #define RI_CMR3_PC_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3489. #define RI_CMR3_PC_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3490. #define RI_CMR3_PC_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3491. #define RI_CMR3_PC_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3492. #define RI_CMR3_PC_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3493. #define RI_CMR3_PC_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3494. #define RI_CMR3_PC_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3495. #define RI_CMR3_PC_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3496. #define RI_CMR3_PC_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3497. #define RI_CMR3_PC_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3498. #define RI_CMR3_PC_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3499. #define RI_CMR3_PC_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3500. /******************** Bit definition for RI_CICR3 register ********************/
  3501. #define RI_CICR3_PC ((uint32_t)0x0000FFFF) /*!< PC[15:0] Port C selection */
  3502. #define RI_CICR3_PC_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3503. #define RI_CICR3_PC_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3504. #define RI_CICR3_PC_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3505. #define RI_CICR3_PC_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3506. #define RI_CICR3_PC_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3507. #define RI_CICR3_PC_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3508. #define RI_CICR3_PC_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3509. #define RI_CICR3_PC_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3510. #define RI_CICR3_PC_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3511. #define RI_CICR3_PC_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3512. #define RI_CICR3_PC_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3513. #define RI_CICR3_PC_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3514. #define RI_CICR3_PC_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3515. #define RI_CICR3_PC_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3516. #define RI_CICR3_PC_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3517. #define RI_CICR3_PC_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3518. /******************************************************************************/
  3519. /* */
  3520. /* Timers (TIM) */
  3521. /* */
  3522. /******************************************************************************/
  3523. /******************* Bit definition for TIM_CR1 register ********************/
  3524. #define TIM_CR1_CEN ((uint32_t)0x00000001) /*!<Counter enable */
  3525. #define TIM_CR1_UDIS ((uint32_t)0x00000002) /*!<Update disable */
  3526. #define TIM_CR1_URS ((uint32_t)0x00000004) /*!<Update request source */
  3527. #define TIM_CR1_OPM ((uint32_t)0x00000008) /*!<One pulse mode */
  3528. #define TIM_CR1_DIR ((uint32_t)0x00000010) /*!<Direction */
  3529. #define TIM_CR1_CMS ((uint32_t)0x00000060) /*!<CMS[1:0] bits (Center-aligned mode selection) */
  3530. #define TIM_CR1_CMS_0 ((uint32_t)0x00000020) /*!<Bit 0 */
  3531. #define TIM_CR1_CMS_1 ((uint32_t)0x00000040) /*!<Bit 1 */
  3532. #define TIM_CR1_ARPE ((uint32_t)0x00000080) /*!<Auto-reload preload enable */
  3533. #define TIM_CR1_CKD ((uint32_t)0x00000300) /*!<CKD[1:0] bits (clock division) */
  3534. #define TIM_CR1_CKD_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3535. #define TIM_CR1_CKD_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3536. /******************* Bit definition for TIM_CR2 register ********************/
  3537. #define TIM_CR2_CCDS ((uint32_t)0x00000008) /*!<Capture/Compare DMA Selection */
  3538. #define TIM_CR2_MMS ((uint32_t)0x00000070) /*!<MMS[2:0] bits (Master Mode Selection) */
  3539. #define TIM_CR2_MMS_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3540. #define TIM_CR2_MMS_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3541. #define TIM_CR2_MMS_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3542. #define TIM_CR2_TI1S ((uint32_t)0x00000080) /*!<TI1 Selection */
  3543. /******************* Bit definition for TIM_SMCR register *******************/
  3544. #define TIM_SMCR_SMS ((uint32_t)0x00000007) /*!<SMS[2:0] bits (Slave mode selection) */
  3545. #define TIM_SMCR_SMS_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3546. #define TIM_SMCR_SMS_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3547. #define TIM_SMCR_SMS_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3548. #define TIM_SMCR_OCCS ((uint32_t)0x00000008) /*!< OCREF clear selection */
  3549. #define TIM_SMCR_TS ((uint32_t)0x00000070) /*!<TS[2:0] bits (Trigger selection) */
  3550. #define TIM_SMCR_TS_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3551. #define TIM_SMCR_TS_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3552. #define TIM_SMCR_TS_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3553. #define TIM_SMCR_MSM ((uint32_t)0x00000080) /*!<Master/slave mode */
  3554. #define TIM_SMCR_ETF ((uint32_t)0x00000F00) /*!<ETF[3:0] bits (External trigger filter) */
  3555. #define TIM_SMCR_ETF_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3556. #define TIM_SMCR_ETF_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3557. #define TIM_SMCR_ETF_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3558. #define TIM_SMCR_ETF_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3559. #define TIM_SMCR_ETPS ((uint32_t)0x00003000) /*!<ETPS[1:0] bits (External trigger prescaler) */
  3560. #define TIM_SMCR_ETPS_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  3561. #define TIM_SMCR_ETPS_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  3562. #define TIM_SMCR_ECE ((uint32_t)0x00004000) /*!<External clock enable */
  3563. #define TIM_SMCR_ETP ((uint32_t)0x00008000) /*!<External trigger polarity */
  3564. /******************* Bit definition for TIM_DIER register *******************/
  3565. #define TIM_DIER_UIE ((uint32_t)0x00000001) /*!<Update interrupt enable */
  3566. #define TIM_DIER_CC1IE ((uint32_t)0x00000002) /*!<Capture/Compare 1 interrupt enable */
  3567. #define TIM_DIER_CC2IE ((uint32_t)0x00000004) /*!<Capture/Compare 2 interrupt enable */
  3568. #define TIM_DIER_CC3IE ((uint32_t)0x00000008) /*!<Capture/Compare 3 interrupt enable */
  3569. #define TIM_DIER_CC4IE ((uint32_t)0x00000010) /*!<Capture/Compare 4 interrupt enable */
  3570. #define TIM_DIER_TIE ((uint32_t)0x00000040) /*!<Trigger interrupt enable */
  3571. #define TIM_DIER_UDE ((uint32_t)0x00000100) /*!<Update DMA request enable */
  3572. #define TIM_DIER_CC1DE ((uint32_t)0x00000200) /*!<Capture/Compare 1 DMA request enable */
  3573. #define TIM_DIER_CC2DE ((uint32_t)0x00000400) /*!<Capture/Compare 2 DMA request enable */
  3574. #define TIM_DIER_CC3DE ((uint32_t)0x00000800) /*!<Capture/Compare 3 DMA request enable */
  3575. #define TIM_DIER_CC4DE ((uint32_t)0x00001000) /*!<Capture/Compare 4 DMA request enable */
  3576. #define TIM_DIER_COMDE ((uint16_t)0x2000) /*!<COM DMA request enable */
  3577. #define TIM_DIER_TDE ((uint32_t)0x00004000) /*!<Trigger DMA request enable */
  3578. /******************** Bit definition for TIM_SR register ********************/
  3579. #define TIM_SR_UIF ((uint32_t)0x00000001) /*!<Update interrupt Flag */
  3580. #define TIM_SR_CC1IF ((uint32_t)0x00000002) /*!<Capture/Compare 1 interrupt Flag */
  3581. #define TIM_SR_CC2IF ((uint32_t)0x00000004) /*!<Capture/Compare 2 interrupt Flag */
  3582. #define TIM_SR_CC3IF ((uint32_t)0x00000008) /*!<Capture/Compare 3 interrupt Flag */
  3583. #define TIM_SR_CC4IF ((uint32_t)0x00000010) /*!<Capture/Compare 4 interrupt Flag */
  3584. #define TIM_SR_TIF ((uint32_t)0x00000040) /*!<Trigger interrupt Flag */
  3585. #define TIM_SR_CC1OF ((uint32_t)0x00000200) /*!<Capture/Compare 1 Overcapture Flag */
  3586. #define TIM_SR_CC2OF ((uint32_t)0x00000400) /*!<Capture/Compare 2 Overcapture Flag */
  3587. #define TIM_SR_CC3OF ((uint32_t)0x00000800) /*!<Capture/Compare 3 Overcapture Flag */
  3588. #define TIM_SR_CC4OF ((uint32_t)0x00001000) /*!<Capture/Compare 4 Overcapture Flag */
  3589. /******************* Bit definition for TIM_EGR register ********************/
  3590. #define TIM_EGR_UG ((uint32_t)0x00000001) /*!<Update Generation */
  3591. #define TIM_EGR_CC1G ((uint32_t)0x00000002) /*!<Capture/Compare 1 Generation */
  3592. #define TIM_EGR_CC2G ((uint32_t)0x00000004) /*!<Capture/Compare 2 Generation */
  3593. #define TIM_EGR_CC3G ((uint32_t)0x00000008) /*!<Capture/Compare 3 Generation */
  3594. #define TIM_EGR_CC4G ((uint32_t)0x00000010) /*!<Capture/Compare 4 Generation */
  3595. #define TIM_EGR_TG ((uint32_t)0x00000040) /*!<Trigger Generation */
  3596. /****************** Bit definition for TIM_CCMR1 register *******************/
  3597. #define TIM_CCMR1_CC1S ((uint32_t)0x00000003) /*!<CC1S[1:0] bits (Capture/Compare 1 Selection) */
  3598. #define TIM_CCMR1_CC1S_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3599. #define TIM_CCMR1_CC1S_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3600. #define TIM_CCMR1_OC1FE ((uint32_t)0x00000004) /*!<Output Compare 1 Fast enable */
  3601. #define TIM_CCMR1_OC1PE ((uint32_t)0x00000008) /*!<Output Compare 1 Preload enable */
  3602. #define TIM_CCMR1_OC1M ((uint32_t)0x00000070) /*!<OC1M[2:0] bits (Output Compare 1 Mode) */
  3603. #define TIM_CCMR1_OC1M_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3604. #define TIM_CCMR1_OC1M_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3605. #define TIM_CCMR1_OC1M_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3606. #define TIM_CCMR1_OC1CE ((uint32_t)0x00000080) /*!<Output Compare 1Clear Enable */
  3607. #define TIM_CCMR1_CC2S ((uint32_t)0x00000300) /*!<CC2S[1:0] bits (Capture/Compare 2 Selection) */
  3608. #define TIM_CCMR1_CC2S_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3609. #define TIM_CCMR1_CC2S_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3610. #define TIM_CCMR1_OC2FE ((uint32_t)0x00000400) /*!<Output Compare 2 Fast enable */
  3611. #define TIM_CCMR1_OC2PE ((uint32_t)0x00000800) /*!<Output Compare 2 Preload enable */
  3612. #define TIM_CCMR1_OC2M ((uint32_t)0x00007000) /*!<OC2M[2:0] bits (Output Compare 2 Mode) */
  3613. #define TIM_CCMR1_OC2M_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  3614. #define TIM_CCMR1_OC2M_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  3615. #define TIM_CCMR1_OC2M_2 ((uint32_t)0x00004000) /*!<Bit 2 */
  3616. #define TIM_CCMR1_OC2CE ((uint32_t)0x00008000) /*!<Output Compare 2 Clear Enable */
  3617. /*----------------------------------------------------------------------------*/
  3618. #define TIM_CCMR1_IC1PSC ((uint32_t)0x0000000C) /*!<IC1PSC[1:0] bits (Input Capture 1 Prescaler) */
  3619. #define TIM_CCMR1_IC1PSC_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  3620. #define TIM_CCMR1_IC1PSC_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  3621. #define TIM_CCMR1_IC1F ((uint32_t)0x000000F0) /*!<IC1F[3:0] bits (Input Capture 1 Filter) */
  3622. #define TIM_CCMR1_IC1F_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3623. #define TIM_CCMR1_IC1F_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3624. #define TIM_CCMR1_IC1F_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3625. #define TIM_CCMR1_IC1F_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  3626. #define TIM_CCMR1_IC2PSC ((uint32_t)0x00000C00) /*!<IC2PSC[1:0] bits (Input Capture 2 Prescaler) */
  3627. #define TIM_CCMR1_IC2PSC_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  3628. #define TIM_CCMR1_IC2PSC_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  3629. #define TIM_CCMR1_IC2F ((uint32_t)0x0000F000) /*!<IC2F[3:0] bits (Input Capture 2 Filter) */
  3630. #define TIM_CCMR1_IC2F_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  3631. #define TIM_CCMR1_IC2F_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  3632. #define TIM_CCMR1_IC2F_2 ((uint32_t)0x00004000) /*!<Bit 2 */
  3633. #define TIM_CCMR1_IC2F_3 ((uint32_t)0x00008000) /*!<Bit 3 */
  3634. /****************** Bit definition for TIM_CCMR2 register *******************/
  3635. #define TIM_CCMR2_CC3S ((uint32_t)0x00000003) /*!<CC3S[1:0] bits (Capture/Compare 3 Selection) */
  3636. #define TIM_CCMR2_CC3S_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3637. #define TIM_CCMR2_CC3S_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3638. #define TIM_CCMR2_OC3FE ((uint32_t)0x00000004) /*!<Output Compare 3 Fast enable */
  3639. #define TIM_CCMR2_OC3PE ((uint32_t)0x00000008) /*!<Output Compare 3 Preload enable */
  3640. #define TIM_CCMR2_OC3M ((uint32_t)0x00000070) /*!<OC3M[2:0] bits (Output Compare 3 Mode) */
  3641. #define TIM_CCMR2_OC3M_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3642. #define TIM_CCMR2_OC3M_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3643. #define TIM_CCMR2_OC3M_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3644. #define TIM_CCMR2_OC3CE ((uint32_t)0x00000080) /*!<Output Compare 3 Clear Enable */
  3645. #define TIM_CCMR2_CC4S ((uint32_t)0x00000300) /*!<CC4S[1:0] bits (Capture/Compare 4 Selection) */
  3646. #define TIM_CCMR2_CC4S_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3647. #define TIM_CCMR2_CC4S_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3648. #define TIM_CCMR2_OC4FE ((uint32_t)0x00000400) /*!<Output Compare 4 Fast enable */
  3649. #define TIM_CCMR2_OC4PE ((uint32_t)0x00000800) /*!<Output Compare 4 Preload enable */
  3650. #define TIM_CCMR2_OC4M ((uint32_t)0x00007000) /*!<OC4M[2:0] bits (Output Compare 4 Mode) */
  3651. #define TIM_CCMR2_OC4M_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  3652. #define TIM_CCMR2_OC4M_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  3653. #define TIM_CCMR2_OC4M_2 ((uint32_t)0x00004000) /*!<Bit 2 */
  3654. #define TIM_CCMR2_OC4CE ((uint32_t)0x00008000) /*!<Output Compare 4 Clear Enable */
  3655. /*----------------------------------------------------------------------------*/
  3656. #define TIM_CCMR2_IC3PSC ((uint32_t)0x0000000C) /*!<IC3PSC[1:0] bits (Input Capture 3 Prescaler) */
  3657. #define TIM_CCMR2_IC3PSC_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  3658. #define TIM_CCMR2_IC3PSC_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  3659. #define TIM_CCMR2_IC3F ((uint32_t)0x000000F0) /*!<IC3F[3:0] bits (Input Capture 3 Filter) */
  3660. #define TIM_CCMR2_IC3F_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3661. #define TIM_CCMR2_IC3F_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3662. #define TIM_CCMR2_IC3F_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3663. #define TIM_CCMR2_IC3F_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  3664. #define TIM_CCMR2_IC4PSC ((uint32_t)0x00000C00) /*!<IC4PSC[1:0] bits (Input Capture 4 Prescaler) */
  3665. #define TIM_CCMR2_IC4PSC_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  3666. #define TIM_CCMR2_IC4PSC_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  3667. #define TIM_CCMR2_IC4F ((uint32_t)0x0000F000) /*!<IC4F[3:0] bits (Input Capture 4 Filter) */
  3668. #define TIM_CCMR2_IC4F_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  3669. #define TIM_CCMR2_IC4F_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  3670. #define TIM_CCMR2_IC4F_2 ((uint32_t)0x00004000) /*!<Bit 2 */
  3671. #define TIM_CCMR2_IC4F_3 ((uint32_t)0x00008000) /*!<Bit 3 */
  3672. /******************* Bit definition for TIM_CCER register *******************/
  3673. #define TIM_CCER_CC1E ((uint32_t)0x00000001) /*!<Capture/Compare 1 output enable */
  3674. #define TIM_CCER_CC1P ((uint32_t)0x00000002) /*!<Capture/Compare 1 output Polarity */
  3675. #define TIM_CCER_CC1NP ((uint32_t)0x00000008) /*!<Capture/Compare 1 Complementary output Polarity */
  3676. #define TIM_CCER_CC2E ((uint32_t)0x00000010) /*!<Capture/Compare 2 output enable */
  3677. #define TIM_CCER_CC2P ((uint32_t)0x00000020) /*!<Capture/Compare 2 output Polarity */
  3678. #define TIM_CCER_CC2NP ((uint32_t)0x00000080) /*!<Capture/Compare 2 Complementary output Polarity */
  3679. #define TIM_CCER_CC3E ((uint32_t)0x00000100) /*!<Capture/Compare 3 output enable */
  3680. #define TIM_CCER_CC3P ((uint32_t)0x00000200) /*!<Capture/Compare 3 output Polarity */
  3681. #define TIM_CCER_CC3NP ((uint32_t)0x00000800) /*!<Capture/Compare 3 Complementary output Polarity */
  3682. #define TIM_CCER_CC4E ((uint32_t)0x00001000) /*!<Capture/Compare 4 output enable */
  3683. #define TIM_CCER_CC4P ((uint32_t)0x00002000) /*!<Capture/Compare 4 output Polarity */
  3684. #define TIM_CCER_CC4NP ((uint32_t)0x00008000) /*!<Capture/Compare 4 Complementary output Polarity */
  3685. /******************* Bit definition for TIM_CNT register ********************/
  3686. #define TIM_CNT_CNT ((uint32_t)0x0000FFFF) /*!<Counter Value */
  3687. /******************* Bit definition for TIM_PSC register ********************/
  3688. #define TIM_PSC_PSC ((uint32_t)0x0000FFFF) /*!<Prescaler Value */
  3689. /******************* Bit definition for TIM_ARR register ********************/
  3690. #define TIM_ARR_ARR ((uint32_t)0x0000FFFF) /*!<actual auto-reload Value */
  3691. /******************* Bit definition for TIM_CCR1 register *******************/
  3692. #define TIM_CCR1_CCR1 ((uint32_t)0x0000FFFF) /*!<Capture/Compare 1 Value */
  3693. /******************* Bit definition for TIM_CCR2 register *******************/
  3694. #define TIM_CCR2_CCR2 ((uint32_t)0x0000FFFF) /*!<Capture/Compare 2 Value */
  3695. /******************* Bit definition for TIM_CCR3 register *******************/
  3696. #define TIM_CCR3_CCR3 ((uint32_t)0x0000FFFF) /*!<Capture/Compare 3 Value */
  3697. /******************* Bit definition for TIM_CCR4 register *******************/
  3698. #define TIM_CCR4_CCR4 ((uint32_t)0x0000FFFF) /*!<Capture/Compare 4 Value */
  3699. /******************* Bit definition for TIM_DCR register ********************/
  3700. #define TIM_DCR_DBA ((uint32_t)0x0000001F) /*!<DBA[4:0] bits (DMA Base Address) */
  3701. #define TIM_DCR_DBA_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3702. #define TIM_DCR_DBA_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3703. #define TIM_DCR_DBA_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3704. #define TIM_DCR_DBA_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3705. #define TIM_DCR_DBA_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  3706. #define TIM_DCR_DBL ((uint32_t)0x00001F00) /*!<DBL[4:0] bits (DMA Burst Length) */
  3707. #define TIM_DCR_DBL_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3708. #define TIM_DCR_DBL_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3709. #define TIM_DCR_DBL_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3710. #define TIM_DCR_DBL_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3711. #define TIM_DCR_DBL_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  3712. /******************* Bit definition for TIM_DMAR register *******************/
  3713. #define TIM_DMAR_DMAB ((uint32_t)0x0000FFFF) /*!<DMA register for burst accesses */
  3714. /******************* Bit definition for TIM_OR register *********************/
  3715. #define TIM_OR_TI1RMP ((uint32_t)0x00000003) /*!<TI1_RMP[1:0] bits (TIM Input 1 remap) */
  3716. #define TIM_OR_TI1RMP_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3717. #define TIM_OR_TI1RMP_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3718. #define TIM_OR_ETR_RMP ((uint32_t)0x00000004) /*!<ETR_RMP bit (TIM10/11 ETR remap)*/
  3719. #define TIM_OR_TI1_RMP_RI ((uint32_t)0x00000008) /*!<TI1_RMP_RI bit (TIM10/11 Input 1 remap for Routing interface) */
  3720. /*----------------------------------------------------------------------------*/
  3721. #define TIM9_OR_ITR1_RMP ((uint32_t)0x00000004) /*!<ITR1_RMP bit (TIM9 Internal trigger 1 remap) */
  3722. /*----------------------------------------------------------------------------*/
  3723. #define TIM2_OR_ITR1_RMP ((uint32_t)0x00000001) /*!<ITR1_RMP bit (TIM2 Internal trigger 1 remap) */
  3724. /*----------------------------------------------------------------------------*/
  3725. #define TIM3_OR_ITR2_RMP ((uint32_t)0x00000001) /*!<ITR2_RMP bit (TIM3 Internal trigger 2 remap) */
  3726. /*----------------------------------------------------------------------------*/
  3727. /******************************************************************************/
  3728. /* */
  3729. /* Universal Synchronous Asynchronous Receiver Transmitter (USART) */
  3730. /* */
  3731. /******************************************************************************/
  3732. /******************* Bit definition for USART_SR register *******************/
  3733. #define USART_SR_PE ((uint32_t)0x00000001) /*!< Parity Error */
  3734. #define USART_SR_FE ((uint32_t)0x00000002) /*!< Framing Error */
  3735. #define USART_SR_NE ((uint32_t)0x00000004) /*!< Noise Error Flag */
  3736. #define USART_SR_ORE ((uint32_t)0x00000008) /*!< OverRun Error */
  3737. #define USART_SR_IDLE ((uint32_t)0x00000010) /*!< IDLE line detected */
  3738. #define USART_SR_RXNE ((uint32_t)0x00000020) /*!< Read Data Register Not Empty */
  3739. #define USART_SR_TC ((uint32_t)0x00000040) /*!< Transmission Complete */
  3740. #define USART_SR_TXE ((uint32_t)0x00000080) /*!< Transmit Data Register Empty */
  3741. #define USART_SR_LBD ((uint32_t)0x00000100) /*!< LIN Break Detection Flag */
  3742. #define USART_SR_CTS ((uint32_t)0x00000200) /*!< CTS Flag */
  3743. /******************* Bit definition for USART_DR register *******************/
  3744. #define USART_DR_DR ((uint32_t)0x000001FF) /*!< Data value */
  3745. /****************** Bit definition for USART_BRR register *******************/
  3746. #define USART_BRR_DIV_FRACTION ((uint32_t)0x0000000F) /*!< Fraction of USARTDIV */
  3747. #define USART_BRR_DIV_MANTISSA ((uint32_t)0x0000FFF0) /*!< Mantissa of USARTDIV */
  3748. /****************** Bit definition for USART_CR1 register *******************/
  3749. #define USART_CR1_SBK ((uint32_t)0x00000001) /*!< Send Break */
  3750. #define USART_CR1_RWU ((uint32_t)0x00000002) /*!< Receiver wakeup */
  3751. #define USART_CR1_RE ((uint32_t)0x00000004) /*!< Receiver Enable */
  3752. #define USART_CR1_TE ((uint32_t)0x00000008) /*!< Transmitter Enable */
  3753. #define USART_CR1_IDLEIE ((uint32_t)0x00000010) /*!< IDLE Interrupt Enable */
  3754. #define USART_CR1_RXNEIE ((uint32_t)0x00000020) /*!< RXNE Interrupt Enable */
  3755. #define USART_CR1_TCIE ((uint32_t)0x00000040) /*!< Transmission Complete Interrupt Enable */
  3756. #define USART_CR1_TXEIE ((uint32_t)0x00000080) /*!< PE Interrupt Enable */
  3757. #define USART_CR1_PEIE ((uint32_t)0x00000100) /*!< PE Interrupt Enable */
  3758. #define USART_CR1_PS ((uint32_t)0x00000200) /*!< Parity Selection */
  3759. #define USART_CR1_PCE ((uint32_t)0x00000400) /*!< Parity Control Enable */
  3760. #define USART_CR1_WAKE ((uint32_t)0x00000800) /*!< Wakeup method */
  3761. #define USART_CR1_M ((uint32_t)0x00001000) /*!< Word length */
  3762. #define USART_CR1_UE ((uint32_t)0x00002000) /*!< USART Enable */
  3763. #define USART_CR1_OVER8 ((uint32_t)0x00008000) /*!< Oversampling by 8-bit mode */
  3764. /****************** Bit definition for USART_CR2 register *******************/
  3765. #define USART_CR2_ADD ((uint32_t)0x0000000F) /*!< Address of the USART node */
  3766. #define USART_CR2_LBDL ((uint32_t)0x00000020) /*!< LIN Break Detection Length */
  3767. #define USART_CR2_LBDIE ((uint32_t)0x00000040) /*!< LIN Break Detection Interrupt Enable */
  3768. #define USART_CR2_LBCL ((uint32_t)0x00000100) /*!< Last Bit Clock pulse */
  3769. #define USART_CR2_CPHA ((uint32_t)0x00000200) /*!< Clock Phase */
  3770. #define USART_CR2_CPOL ((uint32_t)0x00000400) /*!< Clock Polarity */
  3771. #define USART_CR2_CLKEN ((uint32_t)0x00000800) /*!< Clock Enable */
  3772. #define USART_CR2_STOP ((uint32_t)0x00003000) /*!< STOP[1:0] bits (STOP bits) */
  3773. #define USART_CR2_STOP_0 ((uint32_t)0x00001000) /*!< Bit 0 */
  3774. #define USART_CR2_STOP_1 ((uint32_t)0x00002000) /*!< Bit 1 */
  3775. #define USART_CR2_LINEN ((uint32_t)0x00004000) /*!< LIN mode enable */
  3776. /****************** Bit definition for USART_CR3 register *******************/
  3777. #define USART_CR3_EIE ((uint32_t)0x00000001) /*!< Error Interrupt Enable */
  3778. #define USART_CR3_IREN ((uint32_t)0x00000002) /*!< IrDA mode Enable */
  3779. #define USART_CR3_IRLP ((uint32_t)0x00000004) /*!< IrDA Low-Power */
  3780. #define USART_CR3_HDSEL ((uint32_t)0x00000008) /*!< Half-Duplex Selection */
  3781. #define USART_CR3_NACK ((uint32_t)0x00000010) /*!< Smartcard NACK enable */
  3782. #define USART_CR3_SCEN ((uint32_t)0x00000020) /*!< Smartcard mode enable */
  3783. #define USART_CR3_DMAR ((uint32_t)0x00000040) /*!< DMA Enable Receiver */
  3784. #define USART_CR3_DMAT ((uint32_t)0x00000080) /*!< DMA Enable Transmitter */
  3785. #define USART_CR3_RTSE ((uint32_t)0x00000100) /*!< RTS Enable */
  3786. #define USART_CR3_CTSE ((uint32_t)0x00000200) /*!< CTS Enable */
  3787. #define USART_CR3_CTSIE ((uint32_t)0x00000400) /*!< CTS Interrupt Enable */
  3788. #define USART_CR3_ONEBIT ((uint32_t)0x00000800) /*!< One sample bit method enable */
  3789. /****************** Bit definition for USART_GTPR register ******************/
  3790. #define USART_GTPR_PSC ((uint32_t)0x000000FF) /*!< PSC[7:0] bits (Prescaler value) */
  3791. #define USART_GTPR_PSC_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3792. #define USART_GTPR_PSC_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3793. #define USART_GTPR_PSC_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3794. #define USART_GTPR_PSC_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3795. #define USART_GTPR_PSC_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3796. #define USART_GTPR_PSC_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3797. #define USART_GTPR_PSC_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3798. #define USART_GTPR_PSC_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3799. #define USART_GTPR_GT ((uint32_t)0x0000FF00) /*!< Guard time value */
  3800. /******************************************************************************/
  3801. /* */
  3802. /* Universal Serial Bus (USB) */
  3803. /* */
  3804. /******************************************************************************/
  3805. /*!<Endpoint-specific registers */
  3806. #define USB_EP0R USB_BASE /*!< endpoint 0 register address */
  3807. #define USB_EP1R (USB_BASE + 0x00000004) /*!< endpoint 1 register address */
  3808. #define USB_EP2R (USB_BASE + 0x00000008) /*!< endpoint 2 register address */
  3809. #define USB_EP3R (USB_BASE + 0x0000000C) /*!< endpoint 3 register address */
  3810. #define USB_EP4R (USB_BASE + 0x00000010) /*!< endpoint 4 register address */
  3811. #define USB_EP5R (USB_BASE + 0x00000014) /*!< endpoint 5 register address */
  3812. #define USB_EP6R (USB_BASE + 0x00000018) /*!< endpoint 6 register address */
  3813. #define USB_EP7R (USB_BASE + 0x0000001C) /*!< endpoint 7 register address */
  3814. /* bit positions */
  3815. #define USB_EP_CTR_RX ((uint32_t)0x00008000) /*!< EndPoint Correct TRansfer RX */
  3816. #define USB_EP_DTOG_RX ((uint32_t)0x00004000) /*!< EndPoint Data TOGGLE RX */
  3817. #define USB_EPRX_STAT ((uint32_t)0x00003000) /*!< EndPoint RX STATus bit field */
  3818. #define USB_EP_SETUP ((uint32_t)0x00000800) /*!< EndPoint SETUP */
  3819. #define USB_EP_T_FIELD ((uint32_t)0x00000600) /*!< EndPoint TYPE */
  3820. #define USB_EP_KIND ((uint32_t)0x00000100) /*!< EndPoint KIND */
  3821. #define USB_EP_CTR_TX ((uint32_t)0x00000080) /*!< EndPoint Correct TRansfer TX */
  3822. #define USB_EP_DTOG_TX ((uint32_t)0x00000040) /*!< EndPoint Data TOGGLE TX */
  3823. #define USB_EPTX_STAT ((uint32_t)0x00000030) /*!< EndPoint TX STATus bit field */
  3824. #define USB_EPADDR_FIELD ((uint32_t)0x0000000F) /*!< EndPoint ADDRess FIELD */
  3825. /* EndPoint REGister MASK (no toggle fields) */
  3826. #define USB_EPREG_MASK (USB_EP_CTR_RX|USB_EP_SETUP|USB_EP_T_FIELD|USB_EP_KIND|USB_EP_CTR_TX|USB_EPADDR_FIELD)
  3827. /*!< EP_TYPE[1:0] EndPoint TYPE */
  3828. #define USB_EP_TYPE_MASK ((uint32_t)0x00000600) /*!< EndPoint TYPE Mask */
  3829. #define USB_EP_BULK ((uint32_t)0x00000000) /*!< EndPoint BULK */
  3830. #define USB_EP_CONTROL ((uint32_t)0x00000200) /*!< EndPoint CONTROL */
  3831. #define USB_EP_ISOCHRONOUS ((uint32_t)0x00000400) /*!< EndPoint ISOCHRONOUS */
  3832. #define USB_EP_INTERRUPT ((uint32_t)0x00000600) /*!< EndPoint INTERRUPT */
  3833. #define USB_EP_T_MASK (~USB_EP_T_FIELD & USB_EPREG_MASK)
  3834. #define USB_EPKIND_MASK (~USB_EP_KIND & USB_EPREG_MASK) /*!< EP_KIND EndPoint KIND */
  3835. /*!< STAT_TX[1:0] STATus for TX transfer */
  3836. #define USB_EP_TX_DIS ((uint32_t)0x00000000) /*!< EndPoint TX DISabled */
  3837. #define USB_EP_TX_STALL ((uint32_t)0x00000010) /*!< EndPoint TX STALLed */
  3838. #define USB_EP_TX_NAK ((uint32_t)0x00000020) /*!< EndPoint TX NAKed */
  3839. #define USB_EP_TX_VALID ((uint32_t)0x00000030) /*!< EndPoint TX VALID */
  3840. #define USB_EPTX_DTOG1 ((uint32_t)0x00000010) /*!< EndPoint TX Data TOGgle bit1 */
  3841. #define USB_EPTX_DTOG2 ((uint32_t)0x00000020) /*!< EndPoint TX Data TOGgle bit2 */
  3842. #define USB_EPTX_DTOGMASK (USB_EPTX_STAT|USB_EPREG_MASK)
  3843. /*!< STAT_RX[1:0] STATus for RX transfer */
  3844. #define USB_EP_RX_DIS ((uint32_t)0x00000000) /*!< EndPoint RX DISabled */
  3845. #define USB_EP_RX_STALL ((uint32_t)0x00001000) /*!< EndPoint RX STALLed */
  3846. #define USB_EP_RX_NAK ((uint32_t)0x00002000) /*!< EndPoint RX NAKed */
  3847. #define USB_EP_RX_VALID ((uint32_t)0x00003000) /*!< EndPoint RX VALID */
  3848. #define USB_EPRX_DTOG1 ((uint32_t)0x00001000) /*!< EndPoint RX Data TOGgle bit1 */
  3849. #define USB_EPRX_DTOG2 ((uint32_t)0x00002000) /*!< EndPoint RX Data TOGgle bit1 */
  3850. #define USB_EPRX_DTOGMASK (USB_EPRX_STAT|USB_EPREG_MASK)
  3851. /******************* Bit definition for USB_EP0R register *******************/
  3852. #define USB_EP0R_EA ((uint32_t)0x0000000F) /*!<Endpoint Address */
  3853. #define USB_EP0R_STAT_TX ((uint32_t)0x00000030) /*!<STAT_TX[1:0] bits (Status bits, for transmission transfers) */
  3854. #define USB_EP0R_STAT_TX_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3855. #define USB_EP0R_STAT_TX_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3856. #define USB_EP0R_DTOG_TX ((uint32_t)0x00000040) /*!<Data Toggle, for transmission transfers */
  3857. #define USB_EP0R_CTR_TX ((uint32_t)0x00000080) /*!<Correct Transfer for transmission */
  3858. #define USB_EP0R_EP_KIND ((uint32_t)0x00000100) /*!<Endpoint Kind */
  3859. #define USB_EP0R_EP_TYPE ((uint32_t)0x00000600) /*!<EP_TYPE[1:0] bits (Endpoint type) */
  3860. #define USB_EP0R_EP_TYPE_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  3861. #define USB_EP0R_EP_TYPE_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  3862. #define USB_EP0R_SETUP ((uint32_t)0x00000800) /*!<Setup transaction completed */
  3863. #define USB_EP0R_STAT_RX ((uint32_t)0x00003000) /*!<STAT_RX[1:0] bits (Status bits, for reception transfers) */
  3864. #define USB_EP0R_STAT_RX_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  3865. #define USB_EP0R_STAT_RX_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  3866. #define USB_EP0R_DTOG_RX ((uint32_t)0x00004000) /*!<Data Toggle, for reception transfers */
  3867. #define USB_EP0R_CTR_RX ((uint32_t)0x00008000) /*!<Correct Transfer for reception */
  3868. /******************* Bit definition for USB_EP1R register *******************/
  3869. #define USB_EP1R_EA ((uint32_t)0x0000000F) /*!<Endpoint Address */
  3870. #define USB_EP1R_STAT_TX ((uint32_t)0x00000030) /*!<STAT_TX[1:0] bits (Status bits, for transmission transfers) */
  3871. #define USB_EP1R_STAT_TX_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3872. #define USB_EP1R_STAT_TX_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3873. #define USB_EP1R_DTOG_TX ((uint32_t)0x00000040) /*!<Data Toggle, for transmission transfers */
  3874. #define USB_EP1R_CTR_TX ((uint32_t)0x00000080) /*!<Correct Transfer for transmission */
  3875. #define USB_EP1R_EP_KIND ((uint32_t)0x00000100) /*!<Endpoint Kind */
  3876. #define USB_EP1R_EP_TYPE ((uint32_t)0x00000600) /*!<EP_TYPE[1:0] bits (Endpoint type) */
  3877. #define USB_EP1R_EP_TYPE_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  3878. #define USB_EP1R_EP_TYPE_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  3879. #define USB_EP1R_SETUP ((uint32_t)0x00000800) /*!<Setup transaction completed */
  3880. #define USB_EP1R_STAT_RX ((uint32_t)0x00003000) /*!<STAT_RX[1:0] bits (Status bits, for reception transfers) */
  3881. #define USB_EP1R_STAT_RX_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  3882. #define USB_EP1R_STAT_RX_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  3883. #define USB_EP1R_DTOG_RX ((uint32_t)0x00004000) /*!<Data Toggle, for reception transfers */
  3884. #define USB_EP1R_CTR_RX ((uint32_t)0x00008000) /*!<Correct Transfer for reception */
  3885. /******************* Bit definition for USB_EP2R register *******************/
  3886. #define USB_EP2R_EA ((uint32_t)0x0000000F) /*!<Endpoint Address */
  3887. #define USB_EP2R_STAT_TX ((uint32_t)0x00000030) /*!<STAT_TX[1:0] bits (Status bits, for transmission transfers) */
  3888. #define USB_EP2R_STAT_TX_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3889. #define USB_EP2R_STAT_TX_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3890. #define USB_EP2R_DTOG_TX ((uint32_t)0x00000040) /*!<Data Toggle, for transmission transfers */
  3891. #define USB_EP2R_CTR_TX ((uint32_t)0x00000080) /*!<Correct Transfer for transmission */
  3892. #define USB_EP2R_EP_KIND ((uint32_t)0x00000100) /*!<Endpoint Kind */
  3893. #define USB_EP2R_EP_TYPE ((uint32_t)0x00000600) /*!<EP_TYPE[1:0] bits (Endpoint type) */
  3894. #define USB_EP2R_EP_TYPE_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  3895. #define USB_EP2R_EP_TYPE_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  3896. #define USB_EP2R_SETUP ((uint32_t)0x00000800) /*!<Setup transaction completed */
  3897. #define USB_EP2R_STAT_RX ((uint32_t)0x00003000) /*!<STAT_RX[1:0] bits (Status bits, for reception transfers) */
  3898. #define USB_EP2R_STAT_RX_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  3899. #define USB_EP2R_STAT_RX_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  3900. #define USB_EP2R_DTOG_RX ((uint32_t)0x00004000) /*!<Data Toggle, for reception transfers */
  3901. #define USB_EP2R_CTR_RX ((uint32_t)0x00008000) /*!<Correct Transfer for reception */
  3902. /******************* Bit definition for USB_EP3R register *******************/
  3903. #define USB_EP3R_EA ((uint32_t)0x0000000F) /*!<Endpoint Address */
  3904. #define USB_EP3R_STAT_TX ((uint32_t)0x00000030) /*!<STAT_TX[1:0] bits (Status bits, for transmission transfers) */
  3905. #define USB_EP3R_STAT_TX_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3906. #define USB_EP3R_STAT_TX_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3907. #define USB_EP3R_DTOG_TX ((uint32_t)0x00000040) /*!<Data Toggle, for transmission transfers */
  3908. #define USB_EP3R_CTR_TX ((uint32_t)0x00000080) /*!<Correct Transfer for transmission */
  3909. #define USB_EP3R_EP_KIND ((uint32_t)0x00000100) /*!<Endpoint Kind */
  3910. #define USB_EP3R_EP_TYPE ((uint32_t)0x00000600) /*!<EP_TYPE[1:0] bits (Endpoint type) */
  3911. #define USB_EP3R_EP_TYPE_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  3912. #define USB_EP3R_EP_TYPE_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  3913. #define USB_EP3R_SETUP ((uint32_t)0x00000800) /*!<Setup transaction completed */
  3914. #define USB_EP3R_STAT_RX ((uint32_t)0x00003000) /*!<STAT_RX[1:0] bits (Status bits, for reception transfers) */
  3915. #define USB_EP3R_STAT_RX_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  3916. #define USB_EP3R_STAT_RX_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  3917. #define USB_EP3R_DTOG_RX ((uint32_t)0x00004000) /*!<Data Toggle, for reception transfers */
  3918. #define USB_EP3R_CTR_RX ((uint32_t)0x00008000) /*!<Correct Transfer for reception */
  3919. /******************* Bit definition for USB_EP4R register *******************/
  3920. #define USB_EP4R_EA ((uint32_t)0x0000000F) /*!<Endpoint Address */
  3921. #define USB_EP4R_STAT_TX ((uint32_t)0x00000030) /*!<STAT_TX[1:0] bits (Status bits, for transmission transfers) */
  3922. #define USB_EP4R_STAT_TX_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3923. #define USB_EP4R_STAT_TX_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3924. #define USB_EP4R_DTOG_TX ((uint32_t)0x00000040) /*!<Data Toggle, for transmission transfers */
  3925. #define USB_EP4R_CTR_TX ((uint32_t)0x00000080) /*!<Correct Transfer for transmission */
  3926. #define USB_EP4R_EP_KIND ((uint32_t)0x00000100) /*!<Endpoint Kind */
  3927. #define USB_EP4R_EP_TYPE ((uint32_t)0x00000600) /*!<EP_TYPE[1:0] bits (Endpoint type) */
  3928. #define USB_EP4R_EP_TYPE_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  3929. #define USB_EP4R_EP_TYPE_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  3930. #define USB_EP4R_SETUP ((uint32_t)0x00000800) /*!<Setup transaction completed */
  3931. #define USB_EP4R_STAT_RX ((uint32_t)0x00003000) /*!<STAT_RX[1:0] bits (Status bits, for reception transfers) */
  3932. #define USB_EP4R_STAT_RX_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  3933. #define USB_EP4R_STAT_RX_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  3934. #define USB_EP4R_DTOG_RX ((uint32_t)0x00004000) /*!<Data Toggle, for reception transfers */
  3935. #define USB_EP4R_CTR_RX ((uint32_t)0x00008000) /*!<Correct Transfer for reception */
  3936. /******************* Bit definition for USB_EP5R register *******************/
  3937. #define USB_EP5R_EA ((uint32_t)0x0000000F) /*!<Endpoint Address */
  3938. #define USB_EP5R_STAT_TX ((uint32_t)0x00000030) /*!<STAT_TX[1:0] bits (Status bits, for transmission transfers) */
  3939. #define USB_EP5R_STAT_TX_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3940. #define USB_EP5R_STAT_TX_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3941. #define USB_EP5R_DTOG_TX ((uint32_t)0x00000040) /*!<Data Toggle, for transmission transfers */
  3942. #define USB_EP5R_CTR_TX ((uint32_t)0x00000080) /*!<Correct Transfer for transmission */
  3943. #define USB_EP5R_EP_KIND ((uint32_t)0x00000100) /*!<Endpoint Kind */
  3944. #define USB_EP5R_EP_TYPE ((uint32_t)0x00000600) /*!<EP_TYPE[1:0] bits (Endpoint type) */
  3945. #define USB_EP5R_EP_TYPE_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  3946. #define USB_EP5R_EP_TYPE_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  3947. #define USB_EP5R_SETUP ((uint32_t)0x00000800) /*!<Setup transaction completed */
  3948. #define USB_EP5R_STAT_RX ((uint32_t)0x00003000) /*!<STAT_RX[1:0] bits (Status bits, for reception transfers) */
  3949. #define USB_EP5R_STAT_RX_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  3950. #define USB_EP5R_STAT_RX_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  3951. #define USB_EP5R_DTOG_RX ((uint32_t)0x00004000) /*!<Data Toggle, for reception transfers */
  3952. #define USB_EP5R_CTR_RX ((uint32_t)0x00008000) /*!<Correct Transfer for reception */
  3953. /******************* Bit definition for USB_EP6R register *******************/
  3954. #define USB_EP6R_EA ((uint32_t)0x0000000F) /*!<Endpoint Address */
  3955. #define USB_EP6R_STAT_TX ((uint32_t)0x00000030) /*!<STAT_TX[1:0] bits (Status bits, for transmission transfers) */
  3956. #define USB_EP6R_STAT_TX_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3957. #define USB_EP6R_STAT_TX_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3958. #define USB_EP6R_DTOG_TX ((uint32_t)0x00000040) /*!<Data Toggle, for transmission transfers */
  3959. #define USB_EP6R_CTR_TX ((uint32_t)0x00000080) /*!<Correct Transfer for transmission */
  3960. #define USB_EP6R_EP_KIND ((uint32_t)0x00000100) /*!<Endpoint Kind */
  3961. #define USB_EP6R_EP_TYPE ((uint32_t)0x00000600) /*!<EP_TYPE[1:0] bits (Endpoint type) */
  3962. #define USB_EP6R_EP_TYPE_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  3963. #define USB_EP6R_EP_TYPE_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  3964. #define USB_EP6R_SETUP ((uint32_t)0x00000800) /*!<Setup transaction completed */
  3965. #define USB_EP6R_STAT_RX ((uint32_t)0x00003000) /*!<STAT_RX[1:0] bits (Status bits, for reception transfers) */
  3966. #define USB_EP6R_STAT_RX_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  3967. #define USB_EP6R_STAT_RX_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  3968. #define USB_EP6R_DTOG_RX ((uint32_t)0x00004000) /*!<Data Toggle, for reception transfers */
  3969. #define USB_EP6R_CTR_RX ((uint32_t)0x00008000) /*!<Correct Transfer for reception */
  3970. /******************* Bit definition for USB_EP7R register *******************/
  3971. #define USB_EP7R_EA ((uint32_t)0x0000000F) /*!<Endpoint Address */
  3972. #define USB_EP7R_STAT_TX ((uint32_t)0x00000030) /*!<STAT_TX[1:0] bits (Status bits, for transmission transfers) */
  3973. #define USB_EP7R_STAT_TX_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3974. #define USB_EP7R_STAT_TX_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3975. #define USB_EP7R_DTOG_TX ((uint32_t)0x00000040) /*!<Data Toggle, for transmission transfers */
  3976. #define USB_EP7R_CTR_TX ((uint32_t)0x00000080) /*!<Correct Transfer for transmission */
  3977. #define USB_EP7R_EP_KIND ((uint32_t)0x00000100) /*!<Endpoint Kind */
  3978. #define USB_EP7R_EP_TYPE ((uint32_t)0x00000600) /*!<EP_TYPE[1:0] bits (Endpoint type) */
  3979. #define USB_EP7R_EP_TYPE_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  3980. #define USB_EP7R_EP_TYPE_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  3981. #define USB_EP7R_SETUP ((uint32_t)0x00000800) /*!<Setup transaction completed */
  3982. #define USB_EP7R_STAT_RX ((uint32_t)0x00003000) /*!<STAT_RX[1:0] bits (Status bits, for reception transfers) */
  3983. #define USB_EP7R_STAT_RX_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  3984. #define USB_EP7R_STAT_RX_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  3985. #define USB_EP7R_DTOG_RX ((uint32_t)0x00004000) /*!<Data Toggle, for reception transfers */
  3986. #define USB_EP7R_CTR_RX ((uint32_t)0x00008000) /*!<Correct Transfer for reception */
  3987. /*!<Common registers */
  3988. #define USB_CNTR (USB_BASE + 0x00000040) /*!< Control register */
  3989. #define USB_ISTR (USB_BASE + 0x00000044) /*!< Interrupt status register */
  3990. #define USB_FNR (USB_BASE + 0x00000048) /*!< Frame number register */
  3991. #define USB_DADDR (USB_BASE + 0x0000004C) /*!< Device address register */
  3992. #define USB_BTABLE (USB_BASE + 0x00000050) /*!< Buffer Table address register */
  3993. /******************* Bit definition for USB_CNTR register *******************/
  3994. #define USB_CNTR_FRES ((uint32_t)0x00000001) /*!<Force USB Reset */
  3995. #define USB_CNTR_PDWN ((uint32_t)0x00000002) /*!<Power down */
  3996. #define USB_CNTR_LP_MODE ((uint32_t)0x00000004) /*!<Low-power mode */
  3997. #define USB_CNTR_FSUSP ((uint32_t)0x00000008) /*!<Force suspend */
  3998. #define USB_CNTR_RESUME ((uint32_t)0x00000010) /*!<Resume request */
  3999. #define USB_CNTR_ESOFM ((uint32_t)0x00000100) /*!<Expected Start Of Frame Interrupt Mask */
  4000. #define USB_CNTR_SOFM ((uint32_t)0x00000200) /*!<Start Of Frame Interrupt Mask */
  4001. #define USB_CNTR_RESETM ((uint32_t)0x00000400) /*!<RESET Interrupt Mask */
  4002. #define USB_CNTR_SUSPM ((uint32_t)0x00000800) /*!<Suspend mode Interrupt Mask */
  4003. #define USB_CNTR_WKUPM ((uint32_t)0x00001000) /*!<Wakeup Interrupt Mask */
  4004. #define USB_CNTR_ERRM ((uint32_t)0x00002000) /*!<Error Interrupt Mask */
  4005. #define USB_CNTR_PMAOVRM ((uint32_t)0x00004000) /*!<Packet Memory Area Over / Underrun Interrupt Mask */
  4006. #define USB_CNTR_CTRM ((uint32_t)0x00008000) /*!<Correct Transfer Interrupt Mask */
  4007. /******************* Bit definition for USB_ISTR register *******************/
  4008. #define USB_ISTR_EP_ID ((uint32_t)0x0000000F) /*!<Endpoint Identifier */
  4009. #define USB_ISTR_DIR ((uint32_t)0x00000010) /*!<Direction of transaction */
  4010. #define USB_ISTR_ESOF ((uint32_t)0x00000100) /*!<Expected Start Of Frame */
  4011. #define USB_ISTR_SOF ((uint32_t)0x00000200) /*!<Start Of Frame */
  4012. #define USB_ISTR_RESET ((uint32_t)0x00000400) /*!<USB RESET request */
  4013. #define USB_ISTR_SUSP ((uint32_t)0x00000800) /*!<Suspend mode request */
  4014. #define USB_ISTR_WKUP ((uint32_t)0x00001000) /*!<Wake up */
  4015. #define USB_ISTR_ERR ((uint32_t)0x00002000) /*!<Error */
  4016. #define USB_ISTR_PMAOVRM ((uint32_t)0x00004000) /*!<Packet Memory Area Over / Underrun */
  4017. #define USB_ISTR_CTR ((uint32_t)0x00008000) /*!<Correct Transfer */
  4018. #define USB_CLR_CTR (~USB_ISTR_CTR) /*!< clear Correct TRansfer bit */
  4019. #define USB_CLR_PMAOVRM (~USB_ISTR_PMAOVR) /*!< clear DMA OVeR/underrun bit*/
  4020. #define USB_CLR_ERR (~USB_ISTR_ERR) /*!< clear ERRor bit */
  4021. #define USB_CLR_WKUP (~USB_ISTR_WKUP) /*!< clear WaKe UP bit */
  4022. #define USB_CLR_SUSP (~USB_ISTR_SUSP) /*!< clear SUSPend bit */
  4023. #define USB_CLR_RESET (~USB_ISTR_RESET) /*!< clear RESET bit */
  4024. #define USB_CLR_SOF (~USB_ISTR_SOF) /*!< clear Start Of Frame bit */
  4025. #define USB_CLR_ESOF (~USB_ISTR_ESOF) /*!< clear Expected Start Of Frame bit */
  4026. /******************* Bit definition for USB_FNR register ********************/
  4027. #define USB_FNR_FN ((uint32_t)0x000007FF) /*!<Frame Number */
  4028. #define USB_FNR_LSOF ((uint32_t)0x00001800) /*!<Lost SOF */
  4029. #define USB_FNR_LCK ((uint32_t)0x00002000) /*!<Locked */
  4030. #define USB_FNR_RXDM ((uint32_t)0x00004000) /*!<Receive Data - Line Status */
  4031. #define USB_FNR_RXDP ((uint32_t)0x00008000) /*!<Receive Data + Line Status */
  4032. /****************** Bit definition for USB_DADDR register *******************/
  4033. #define USB_DADDR_ADD ((uint32_t)0x0000007F) /*!<ADD[6:0] bits (Device Address) */
  4034. #define USB_DADDR_ADD0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4035. #define USB_DADDR_ADD1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4036. #define USB_DADDR_ADD2 ((uint32_t)0x00000004) /*!<Bit 2 */
  4037. #define USB_DADDR_ADD3 ((uint32_t)0x00000008) /*!<Bit 3 */
  4038. #define USB_DADDR_ADD4 ((uint32_t)0x00000010) /*!<Bit 4 */
  4039. #define USB_DADDR_ADD5 ((uint32_t)0x00000020) /*!<Bit 5 */
  4040. #define USB_DADDR_ADD6 ((uint32_t)0x00000040) /*!<Bit 6 */
  4041. #define USB_DADDR_EF ((uint32_t)0x00000080) /*!<Enable Function */
  4042. /****************** Bit definition for USB_BTABLE register ******************/
  4043. #define USB_BTABLE_BTABLE ((uint32_t)0x0000FFF8) /*!<Buffer Table */
  4044. /*!< Buffer descriptor table */
  4045. /***************** Bit definition for USB_ADDR0_TX register *****************/
  4046. #define USB_ADDR0_TX_ADDR0_TX ((uint32_t)0x0000FFFE) /*!< Transmission Buffer Address 0 */
  4047. /***************** Bit definition for USB_ADDR1_TX register *****************/
  4048. #define USB_ADDR1_TX_ADDR1_TX ((uint32_t)0x0000FFFE) /*!< Transmission Buffer Address 1 */
  4049. /***************** Bit definition for USB_ADDR2_TX register *****************/
  4050. #define USB_ADDR2_TX_ADDR2_TX ((uint32_t)0x0000FFFE) /*!< Transmission Buffer Address 2 */
  4051. /***************** Bit definition for USB_ADDR3_TX register *****************/
  4052. #define USB_ADDR3_TX_ADDR3_TX ((uint32_t)0x0000FFFE) /*!< Transmission Buffer Address 3 */
  4053. /***************** Bit definition for USB_ADDR4_TX register *****************/
  4054. #define USB_ADDR4_TX_ADDR4_TX ((uint32_t)0x0000FFFE) /*!< Transmission Buffer Address 4 */
  4055. /***************** Bit definition for USB_ADDR5_TX register *****************/
  4056. #define USB_ADDR5_TX_ADDR5_TX ((uint32_t)0x0000FFFE) /*!< Transmission Buffer Address 5 */
  4057. /***************** Bit definition for USB_ADDR6_TX register *****************/
  4058. #define USB_ADDR6_TX_ADDR6_TX ((uint32_t)0x0000FFFE) /*!< Transmission Buffer Address 6 */
  4059. /***************** Bit definition for USB_ADDR7_TX register *****************/
  4060. #define USB_ADDR7_TX_ADDR7_TX ((uint32_t)0x0000FFFE) /*!< Transmission Buffer Address 7 */
  4061. /*----------------------------------------------------------------------------*/
  4062. /***************** Bit definition for USB_COUNT0_TX register ****************/
  4063. #define USB_COUNT0_TX_COUNT0_TX ((uint32_t)0x000003FF) /*!< Transmission Byte Count 0 */
  4064. /***************** Bit definition for USB_COUNT1_TX register ****************/
  4065. #define USB_COUNT1_TX_COUNT1_TX ((uint32_t)0x000003FF) /*!< Transmission Byte Count 1 */
  4066. /***************** Bit definition for USB_COUNT2_TX register ****************/
  4067. #define USB_COUNT2_TX_COUNT2_TX ((uint32_t)0x000003FF) /*!< Transmission Byte Count 2 */
  4068. /***************** Bit definition for USB_COUNT3_TX register ****************/
  4069. #define USB_COUNT3_TX_COUNT3_TX ((uint32_t)0x000003FF) /*!< Transmission Byte Count 3 */
  4070. /***************** Bit definition for USB_COUNT4_TX register ****************/
  4071. #define USB_COUNT4_TX_COUNT4_TX ((uint32_t)0x000003FF) /*!< Transmission Byte Count 4 */
  4072. /***************** Bit definition for USB_COUNT5_TX register ****************/
  4073. #define USB_COUNT5_TX_COUNT5_TX ((uint32_t)0x000003FF) /*!< Transmission Byte Count 5 */
  4074. /***************** Bit definition for USB_COUNT6_TX register ****************/
  4075. #define USB_COUNT6_TX_COUNT6_TX ((uint32_t)0x000003FF) /*!< Transmission Byte Count 6 */
  4076. /***************** Bit definition for USB_COUNT7_TX register ****************/
  4077. #define USB_COUNT7_TX_COUNT7_TX ((uint32_t)0x000003FF) /*!< Transmission Byte Count 7 */
  4078. /*----------------------------------------------------------------------------*/
  4079. /**************** Bit definition for USB_COUNT0_TX_0 register ***************/
  4080. #define USB_COUNT0_TX_0_COUNT0_TX_0 ((uint32_t)0x000003FF) /*!< Transmission Byte Count 0 (low) */
  4081. /**************** Bit definition for USB_COUNT0_TX_1 register ***************/
  4082. #define USB_COUNT0_TX_1_COUNT0_TX_1 ((uint32_t)0x03FF0000) /*!< Transmission Byte Count 0 (high) */
  4083. /**************** Bit definition for USB_COUNT1_TX_0 register ***************/
  4084. #define USB_COUNT1_TX_0_COUNT1_TX_0 ((uint32_t)0x000003FF) /*!< Transmission Byte Count 1 (low) */
  4085. /**************** Bit definition for USB_COUNT1_TX_1 register ***************/
  4086. #define USB_COUNT1_TX_1_COUNT1_TX_1 ((uint32_t)0x03FF0000) /*!< Transmission Byte Count 1 (high) */
  4087. /**************** Bit definition for USB_COUNT2_TX_0 register ***************/
  4088. #define USB_COUNT2_TX_0_COUNT2_TX_0 ((uint32_t)0x000003FF) /*!< Transmission Byte Count 2 (low) */
  4089. /**************** Bit definition for USB_COUNT2_TX_1 register ***************/
  4090. #define USB_COUNT2_TX_1_COUNT2_TX_1 ((uint32_t)0x03FF0000) /*!< Transmission Byte Count 2 (high) */
  4091. /**************** Bit definition for USB_COUNT3_TX_0 register ***************/
  4092. #define USB_COUNT3_TX_0_COUNT3_TX_0 ((uint32_t)0x0000000003FF) /*!< Transmission Byte Count 3 (low) */
  4093. /**************** Bit definition for USB_COUNT3_TX_1 register ***************/
  4094. #define USB_COUNT3_TX_1_COUNT3_TX_1 ((uint32_t)0x000003FF0000) /*!< Transmission Byte Count 3 (high) */
  4095. /**************** Bit definition for USB_COUNT4_TX_0 register ***************/
  4096. #define USB_COUNT4_TX_0_COUNT4_TX_0 ((uint32_t)0x000003FF) /*!< Transmission Byte Count 4 (low) */
  4097. /**************** Bit definition for USB_COUNT4_TX_1 register ***************/
  4098. #define USB_COUNT4_TX_1_COUNT4_TX_1 ((uint32_t)0x03FF0000) /*!< Transmission Byte Count 4 (high) */
  4099. /**************** Bit definition for USB_COUNT5_TX_0 register ***************/
  4100. #define USB_COUNT5_TX_0_COUNT5_TX_0 ((uint32_t)0x000003FF) /*!< Transmission Byte Count 5 (low) */
  4101. /**************** Bit definition for USB_COUNT5_TX_1 register ***************/
  4102. #define USB_COUNT5_TX_1_COUNT5_TX_1 ((uint32_t)0x03FF0000) /*!< Transmission Byte Count 5 (high) */
  4103. /**************** Bit definition for USB_COUNT6_TX_0 register ***************/
  4104. #define USB_COUNT6_TX_0_COUNT6_TX_0 ((uint32_t)0x000003FF) /*!< Transmission Byte Count 6 (low) */
  4105. /**************** Bit definition for USB_COUNT6_TX_1 register ***************/
  4106. #define USB_COUNT6_TX_1_COUNT6_TX_1 ((uint32_t)0x03FF0000) /*!< Transmission Byte Count 6 (high) */
  4107. /**************** Bit definition for USB_COUNT7_TX_0 register ***************/
  4108. #define USB_COUNT7_TX_0_COUNT7_TX_0 ((uint32_t)0x000003FF) /*!< Transmission Byte Count 7 (low) */
  4109. /**************** Bit definition for USB_COUNT7_TX_1 register ***************/
  4110. #define USB_COUNT7_TX_1_COUNT7_TX_1 ((uint32_t)0x03FF0000) /*!< Transmission Byte Count 7 (high) */
  4111. /*----------------------------------------------------------------------------*/
  4112. /***************** Bit definition for USB_ADDR0_RX register *****************/
  4113. #define USB_ADDR0_RX_ADDR0_RX ((uint32_t)0x0000FFFE) /*!< Reception Buffer Address 0 */
  4114. /***************** Bit definition for USB_ADDR1_RX register *****************/
  4115. #define USB_ADDR1_RX_ADDR1_RX ((uint32_t)0x0000FFFE) /*!< Reception Buffer Address 1 */
  4116. /***************** Bit definition for USB_ADDR2_RX register *****************/
  4117. #define USB_ADDR2_RX_ADDR2_RX ((uint32_t)0x0000FFFE) /*!< Reception Buffer Address 2 */
  4118. /***************** Bit definition for USB_ADDR3_RX register *****************/
  4119. #define USB_ADDR3_RX_ADDR3_RX ((uint32_t)0x0000FFFE) /*!< Reception Buffer Address 3 */
  4120. /***************** Bit definition for USB_ADDR4_RX register *****************/
  4121. #define USB_ADDR4_RX_ADDR4_RX ((uint32_t)0x0000FFFE) /*!< Reception Buffer Address 4 */
  4122. /***************** Bit definition for USB_ADDR5_RX register *****************/
  4123. #define USB_ADDR5_RX_ADDR5_RX ((uint32_t)0x0000FFFE) /*!< Reception Buffer Address 5 */
  4124. /***************** Bit definition for USB_ADDR6_RX register *****************/
  4125. #define USB_ADDR6_RX_ADDR6_RX ((uint32_t)0x0000FFFE) /*!< Reception Buffer Address 6 */
  4126. /***************** Bit definition for USB_ADDR7_RX register *****************/
  4127. #define USB_ADDR7_RX_ADDR7_RX ((uint32_t)0x0000FFFE) /*!< Reception Buffer Address 7 */
  4128. /*----------------------------------------------------------------------------*/
  4129. /***************** Bit definition for USB_COUNT0_RX register ****************/
  4130. #define USB_COUNT0_RX_COUNT0_RX ((uint32_t)0x000003FF) /*!< Reception Byte Count */
  4131. #define USB_COUNT0_RX_NUM_BLOCK ((uint32_t)0x00007C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
  4132. #define USB_COUNT0_RX_NUM_BLOCK_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4133. #define USB_COUNT0_RX_NUM_BLOCK_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4134. #define USB_COUNT0_RX_NUM_BLOCK_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4135. #define USB_COUNT0_RX_NUM_BLOCK_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4136. #define USB_COUNT0_RX_NUM_BLOCK_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4137. #define USB_COUNT0_RX_BLSIZE ((uint32_t)0x00008000) /*!< BLock SIZE */
  4138. /***************** Bit definition for USB_COUNT1_RX register ****************/
  4139. #define USB_COUNT1_RX_COUNT1_RX ((uint32_t)0x000003FF) /*!< Reception Byte Count */
  4140. #define USB_COUNT1_RX_NUM_BLOCK ((uint32_t)0x00007C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
  4141. #define USB_COUNT1_RX_NUM_BLOCK_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4142. #define USB_COUNT1_RX_NUM_BLOCK_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4143. #define USB_COUNT1_RX_NUM_BLOCK_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4144. #define USB_COUNT1_RX_NUM_BLOCK_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4145. #define USB_COUNT1_RX_NUM_BLOCK_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4146. #define USB_COUNT1_RX_BLSIZE ((uint32_t)0x00008000) /*!< BLock SIZE */
  4147. /***************** Bit definition for USB_COUNT2_RX register ****************/
  4148. #define USB_COUNT2_RX_COUNT2_RX ((uint32_t)0x000003FF) /*!< Reception Byte Count */
  4149. #define USB_COUNT2_RX_NUM_BLOCK ((uint32_t)0x00007C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
  4150. #define USB_COUNT2_RX_NUM_BLOCK_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4151. #define USB_COUNT2_RX_NUM_BLOCK_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4152. #define USB_COUNT2_RX_NUM_BLOCK_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4153. #define USB_COUNT2_RX_NUM_BLOCK_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4154. #define USB_COUNT2_RX_NUM_BLOCK_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4155. #define USB_COUNT2_RX_BLSIZE ((uint32_t)0x00008000) /*!< BLock SIZE */
  4156. /***************** Bit definition for USB_COUNT3_RX register ****************/
  4157. #define USB_COUNT3_RX_COUNT3_RX ((uint32_t)0x000003FF) /*!< Reception Byte Count */
  4158. #define USB_COUNT3_RX_NUM_BLOCK ((uint32_t)0x00007C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
  4159. #define USB_COUNT3_RX_NUM_BLOCK_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4160. #define USB_COUNT3_RX_NUM_BLOCK_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4161. #define USB_COUNT3_RX_NUM_BLOCK_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4162. #define USB_COUNT3_RX_NUM_BLOCK_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4163. #define USB_COUNT3_RX_NUM_BLOCK_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4164. #define USB_COUNT3_RX_BLSIZE ((uint32_t)0x00008000) /*!< BLock SIZE */
  4165. /***************** Bit definition for USB_COUNT4_RX register ****************/
  4166. #define USB_COUNT4_RX_COUNT4_RX ((uint32_t)0x000003FF) /*!< Reception Byte Count */
  4167. #define USB_COUNT4_RX_NUM_BLOCK ((uint32_t)0x00007C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
  4168. #define USB_COUNT4_RX_NUM_BLOCK_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4169. #define USB_COUNT4_RX_NUM_BLOCK_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4170. #define USB_COUNT4_RX_NUM_BLOCK_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4171. #define USB_COUNT4_RX_NUM_BLOCK_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4172. #define USB_COUNT4_RX_NUM_BLOCK_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4173. #define USB_COUNT4_RX_BLSIZE ((uint32_t)0x00008000) /*!< BLock SIZE */
  4174. /***************** Bit definition for USB_COUNT5_RX register ****************/
  4175. #define USB_COUNT5_RX_COUNT5_RX ((uint32_t)0x000003FF) /*!< Reception Byte Count */
  4176. #define USB_COUNT5_RX_NUM_BLOCK ((uint32_t)0x00007C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
  4177. #define USB_COUNT5_RX_NUM_BLOCK_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4178. #define USB_COUNT5_RX_NUM_BLOCK_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4179. #define USB_COUNT5_RX_NUM_BLOCK_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4180. #define USB_COUNT5_RX_NUM_BLOCK_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4181. #define USB_COUNT5_RX_NUM_BLOCK_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4182. #define USB_COUNT5_RX_BLSIZE ((uint32_t)0x00008000) /*!< BLock SIZE */
  4183. /***************** Bit definition for USB_COUNT6_RX register ****************/
  4184. #define USB_COUNT6_RX_COUNT6_RX ((uint32_t)0x000003FF) /*!< Reception Byte Count */
  4185. #define USB_COUNT6_RX_NUM_BLOCK ((uint32_t)0x00007C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
  4186. #define USB_COUNT6_RX_NUM_BLOCK_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4187. #define USB_COUNT6_RX_NUM_BLOCK_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4188. #define USB_COUNT6_RX_NUM_BLOCK_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4189. #define USB_COUNT6_RX_NUM_BLOCK_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4190. #define USB_COUNT6_RX_NUM_BLOCK_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4191. #define USB_COUNT6_RX_BLSIZE ((uint32_t)0x00008000) /*!< BLock SIZE */
  4192. /***************** Bit definition for USB_COUNT7_RX register ****************/
  4193. #define USB_COUNT7_RX_COUNT7_RX ((uint32_t)0x000003FF) /*!< Reception Byte Count */
  4194. #define USB_COUNT7_RX_NUM_BLOCK ((uint32_t)0x00007C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
  4195. #define USB_COUNT7_RX_NUM_BLOCK_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4196. #define USB_COUNT7_RX_NUM_BLOCK_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4197. #define USB_COUNT7_RX_NUM_BLOCK_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4198. #define USB_COUNT7_RX_NUM_BLOCK_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4199. #define USB_COUNT7_RX_NUM_BLOCK_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4200. #define USB_COUNT7_RX_BLSIZE ((uint32_t)0x00008000) /*!< BLock SIZE */
  4201. /*----------------------------------------------------------------------------*/
  4202. /**************** Bit definition for USB_COUNT0_RX_0 register ***************/
  4203. #define USB_COUNT0_RX_0_COUNT0_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
  4204. #define USB_COUNT0_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
  4205. #define USB_COUNT0_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4206. #define USB_COUNT0_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4207. #define USB_COUNT0_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4208. #define USB_COUNT0_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4209. #define USB_COUNT0_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4210. #define USB_COUNT0_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
  4211. /**************** Bit definition for USB_COUNT0_RX_1 register ***************/
  4212. #define USB_COUNT0_RX_1_COUNT0_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
  4213. #define USB_COUNT0_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
  4214. #define USB_COUNT0_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 1 */
  4215. #define USB_COUNT0_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
  4216. #define USB_COUNT0_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
  4217. #define USB_COUNT0_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
  4218. #define USB_COUNT0_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
  4219. #define USB_COUNT0_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
  4220. /**************** Bit definition for USB_COUNT1_RX_0 register ***************/
  4221. #define USB_COUNT1_RX_0_COUNT1_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
  4222. #define USB_COUNT1_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
  4223. #define USB_COUNT1_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4224. #define USB_COUNT1_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4225. #define USB_COUNT1_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4226. #define USB_COUNT1_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4227. #define USB_COUNT1_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4228. #define USB_COUNT1_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
  4229. /**************** Bit definition for USB_COUNT1_RX_1 register ***************/
  4230. #define USB_COUNT1_RX_1_COUNT1_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
  4231. #define USB_COUNT1_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
  4232. #define USB_COUNT1_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 0 */
  4233. #define USB_COUNT1_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
  4234. #define USB_COUNT1_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
  4235. #define USB_COUNT1_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
  4236. #define USB_COUNT1_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
  4237. #define USB_COUNT1_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
  4238. /**************** Bit definition for USB_COUNT2_RX_0 register ***************/
  4239. #define USB_COUNT2_RX_0_COUNT2_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
  4240. #define USB_COUNT2_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
  4241. #define USB_COUNT2_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4242. #define USB_COUNT2_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4243. #define USB_COUNT2_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4244. #define USB_COUNT2_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4245. #define USB_COUNT2_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4246. #define USB_COUNT2_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
  4247. /**************** Bit definition for USB_COUNT2_RX_1 register ***************/
  4248. #define USB_COUNT2_RX_1_COUNT2_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
  4249. #define USB_COUNT2_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
  4250. #define USB_COUNT2_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 0 */
  4251. #define USB_COUNT2_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
  4252. #define USB_COUNT2_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
  4253. #define USB_COUNT2_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
  4254. #define USB_COUNT2_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
  4255. #define USB_COUNT2_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
  4256. /**************** Bit definition for USB_COUNT3_RX_0 register ***************/
  4257. #define USB_COUNT3_RX_0_COUNT3_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
  4258. #define USB_COUNT3_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
  4259. #define USB_COUNT3_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4260. #define USB_COUNT3_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4261. #define USB_COUNT3_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4262. #define USB_COUNT3_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4263. #define USB_COUNT3_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4264. #define USB_COUNT3_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
  4265. /**************** Bit definition for USB_COUNT3_RX_1 register ***************/
  4266. #define USB_COUNT3_RX_1_COUNT3_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
  4267. #define USB_COUNT3_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
  4268. #define USB_COUNT3_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 0 */
  4269. #define USB_COUNT3_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
  4270. #define USB_COUNT3_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
  4271. #define USB_COUNT3_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
  4272. #define USB_COUNT3_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
  4273. #define USB_COUNT3_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
  4274. /**************** Bit definition for USB_COUNT4_RX_0 register ***************/
  4275. #define USB_COUNT4_RX_0_COUNT4_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
  4276. #define USB_COUNT4_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
  4277. #define USB_COUNT4_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4278. #define USB_COUNT4_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4279. #define USB_COUNT4_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4280. #define USB_COUNT4_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4281. #define USB_COUNT4_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4282. #define USB_COUNT4_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
  4283. /**************** Bit definition for USB_COUNT4_RX_1 register ***************/
  4284. #define USB_COUNT4_RX_1_COUNT4_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
  4285. #define USB_COUNT4_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
  4286. #define USB_COUNT4_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 0 */
  4287. #define USB_COUNT4_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
  4288. #define USB_COUNT4_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
  4289. #define USB_COUNT4_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
  4290. #define USB_COUNT4_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
  4291. #define USB_COUNT4_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
  4292. /**************** Bit definition for USB_COUNT5_RX_0 register ***************/
  4293. #define USB_COUNT5_RX_0_COUNT5_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
  4294. #define USB_COUNT5_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
  4295. #define USB_COUNT5_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4296. #define USB_COUNT5_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4297. #define USB_COUNT5_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4298. #define USB_COUNT5_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4299. #define USB_COUNT5_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4300. #define USB_COUNT5_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
  4301. /**************** Bit definition for USB_COUNT5_RX_1 register ***************/
  4302. #define USB_COUNT5_RX_1_COUNT5_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
  4303. #define USB_COUNT5_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
  4304. #define USB_COUNT5_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 0 */
  4305. #define USB_COUNT5_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
  4306. #define USB_COUNT5_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
  4307. #define USB_COUNT5_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
  4308. #define USB_COUNT5_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
  4309. #define USB_COUNT5_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
  4310. /*************** Bit definition for USB_COUNT6_RX_0 register ***************/
  4311. #define USB_COUNT6_RX_0_COUNT6_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
  4312. #define USB_COUNT6_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
  4313. #define USB_COUNT6_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4314. #define USB_COUNT6_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4315. #define USB_COUNT6_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4316. #define USB_COUNT6_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4317. #define USB_COUNT6_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4318. #define USB_COUNT6_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
  4319. /**************** Bit definition for USB_COUNT6_RX_1 register ***************/
  4320. #define USB_COUNT6_RX_1_COUNT6_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
  4321. #define USB_COUNT6_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
  4322. #define USB_COUNT6_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 0 */
  4323. #define USB_COUNT6_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
  4324. #define USB_COUNT6_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
  4325. #define USB_COUNT6_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
  4326. #define USB_COUNT6_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
  4327. #define USB_COUNT6_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
  4328. /*************** Bit definition for USB_COUNT7_RX_0 register ****************/
  4329. #define USB_COUNT7_RX_0_COUNT7_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
  4330. #define USB_COUNT7_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
  4331. #define USB_COUNT7_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4332. #define USB_COUNT7_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4333. #define USB_COUNT7_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4334. #define USB_COUNT7_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4335. #define USB_COUNT7_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4336. #define USB_COUNT7_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
  4337. /*************** Bit definition for USB_COUNT7_RX_1 register ****************/
  4338. #define USB_COUNT7_RX_1_COUNT7_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
  4339. #define USB_COUNT7_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
  4340. #define USB_COUNT7_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 0 */
  4341. #define USB_COUNT7_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
  4342. #define USB_COUNT7_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
  4343. #define USB_COUNT7_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
  4344. #define USB_COUNT7_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
  4345. #define USB_COUNT7_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
  4346. /******************************************************************************/
  4347. /* */
  4348. /* Window WATCHDOG (WWDG) */
  4349. /* */
  4350. /******************************************************************************/
  4351. /******************* Bit definition for WWDG_CR register ********************/
  4352. #define WWDG_CR_T ((uint32_t)0x0000007F) /*!< T[6:0] bits (7-Bit counter (MSB to LSB)) */
  4353. #define WWDG_CR_T0 ((uint32_t)0x00000001) /*!< Bit 0 */
  4354. #define WWDG_CR_T1 ((uint32_t)0x00000002) /*!< Bit 1 */
  4355. #define WWDG_CR_T2 ((uint32_t)0x00000004) /*!< Bit 2 */
  4356. #define WWDG_CR_T3 ((uint32_t)0x00000008) /*!< Bit 3 */
  4357. #define WWDG_CR_T4 ((uint32_t)0x00000010) /*!< Bit 4 */
  4358. #define WWDG_CR_T5 ((uint32_t)0x00000020) /*!< Bit 5 */
  4359. #define WWDG_CR_T6 ((uint32_t)0x00000040) /*!< Bit 6 */
  4360. #define WWDG_CR_WDGA ((uint32_t)0x00000080) /*!< Activation bit */
  4361. /******************* Bit definition for WWDG_CFR register *******************/
  4362. #define WWDG_CFR_W ((uint32_t)0x0000007F) /*!< W[6:0] bits (7-bit window value) */
  4363. #define WWDG_CFR_W0 ((uint32_t)0x00000001) /*!< Bit 0 */
  4364. #define WWDG_CFR_W1 ((uint32_t)0x00000002) /*!< Bit 1 */
  4365. #define WWDG_CFR_W2 ((uint32_t)0x00000004) /*!< Bit 2 */
  4366. #define WWDG_CFR_W3 ((uint32_t)0x00000008) /*!< Bit 3 */
  4367. #define WWDG_CFR_W4 ((uint32_t)0x00000010) /*!< Bit 4 */
  4368. #define WWDG_CFR_W5 ((uint32_t)0x00000020) /*!< Bit 5 */
  4369. #define WWDG_CFR_W6 ((uint32_t)0x00000040) /*!< Bit 6 */
  4370. #define WWDG_CFR_WDGTB ((uint32_t)0x00000180) /*!< WDGTB[1:0] bits (Timer Base) */
  4371. #define WWDG_CFR_WDGTB0 ((uint32_t)0x00000080) /*!< Bit 0 */
  4372. #define WWDG_CFR_WDGTB1 ((uint32_t)0x00000100) /*!< Bit 1 */
  4373. #define WWDG_CFR_EWI ((uint32_t)0x00000200) /*!< Early Wakeup Interrupt */
  4374. /******************* Bit definition for WWDG_SR register ********************/
  4375. #define WWDG_SR_EWIF ((uint32_t)0x00000001) /*!< Early Wakeup Interrupt Flag */
  4376. /******************************************************************************/
  4377. /* */
  4378. /* SystemTick (SysTick) */
  4379. /* */
  4380. /******************************************************************************/
  4381. /***************** Bit definition for SysTick_CTRL register *****************/
  4382. #define SysTick_CTRL_ENABLE ((uint32_t)0x00000001) /*!< Counter enable */
  4383. #define SysTick_CTRL_TICKINT ((uint32_t)0x00000002) /*!< Counting down to 0 pends the SysTick handler */
  4384. #define SysTick_CTRL_CLKSOURCE ((uint32_t)0x00000004) /*!< Clock source */
  4385. #define SysTick_CTRL_COUNTFLAG ((uint32_t)0x00010000) /*!< Count Flag */
  4386. /***************** Bit definition for SysTick_LOAD register *****************/
  4387. #define SysTick_LOAD_RELOAD ((uint32_t)0x00FFFFFF) /*!< Value to load into the SysTick Current Value Register when the counter reaches 0 */
  4388. /***************** Bit definition for SysTick_VAL register ******************/
  4389. #define SysTick_VAL_CURRENT ((uint32_t)0x00FFFFFF) /*!< Current value at the time the register is accessed */
  4390. /***************** Bit definition for SysTick_CALIB register ****************/
  4391. #define SysTick_CALIB_TENMS ((uint32_t)0x00FFFFFF) /*!< Reload value to use for 10ms timing */
  4392. #define SysTick_CALIB_SKEW ((uint32_t)0x40000000) /*!< Calibration value is not exactly 10 ms */
  4393. #define SysTick_CALIB_NOREF ((uint32_t)0x80000000) /*!< The reference clock is not provided */
  4394. /******************************************************************************/
  4395. /* */
  4396. /* Nested Vectored Interrupt Controller (NVIC) */
  4397. /* */
  4398. /******************************************************************************/
  4399. /****************** Bit definition for NVIC_ISER register *******************/
  4400. #define NVIC_ISER_SETENA ((uint32_t)0xFFFFFFFF) /*!< Interrupt set enable bits */
  4401. #define NVIC_ISER_SETENA_0 ((uint32_t)0x00000001) /*!< bit 0 */
  4402. #define NVIC_ISER_SETENA_1 ((uint32_t)0x00000002) /*!< bit 1 */
  4403. #define NVIC_ISER_SETENA_2 ((uint32_t)0x00000004) /*!< bit 2 */
  4404. #define NVIC_ISER_SETENA_3 ((uint32_t)0x00000008) /*!< bit 3 */
  4405. #define NVIC_ISER_SETENA_4 ((uint32_t)0x00000010) /*!< bit 4 */
  4406. #define NVIC_ISER_SETENA_5 ((uint32_t)0x00000020) /*!< bit 5 */
  4407. #define NVIC_ISER_SETENA_6 ((uint32_t)0x00000040) /*!< bit 6 */
  4408. #define NVIC_ISER_SETENA_7 ((uint32_t)0x00000080) /*!< bit 7 */
  4409. #define NVIC_ISER_SETENA_8 ((uint32_t)0x00000100) /*!< bit 8 */
  4410. #define NVIC_ISER_SETENA_9 ((uint32_t)0x00000200) /*!< bit 9 */
  4411. #define NVIC_ISER_SETENA_10 ((uint32_t)0x00000400) /*!< bit 10 */
  4412. #define NVIC_ISER_SETENA_11 ((uint32_t)0x00000800) /*!< bit 11 */
  4413. #define NVIC_ISER_SETENA_12 ((uint32_t)0x00001000) /*!< bit 12 */
  4414. #define NVIC_ISER_SETENA_13 ((uint32_t)0x00002000) /*!< bit 13 */
  4415. #define NVIC_ISER_SETENA_14 ((uint32_t)0x00004000) /*!< bit 14 */
  4416. #define NVIC_ISER_SETENA_15 ((uint32_t)0x00008000) /*!< bit 15 */
  4417. #define NVIC_ISER_SETENA_16 ((uint32_t)0x00010000) /*!< bit 16 */
  4418. #define NVIC_ISER_SETENA_17 ((uint32_t)0x00020000) /*!< bit 17 */
  4419. #define NVIC_ISER_SETENA_18 ((uint32_t)0x00040000) /*!< bit 18 */
  4420. #define NVIC_ISER_SETENA_19 ((uint32_t)0x00080000) /*!< bit 19 */
  4421. #define NVIC_ISER_SETENA_20 ((uint32_t)0x00100000) /*!< bit 20 */
  4422. #define NVIC_ISER_SETENA_21 ((uint32_t)0x00200000) /*!< bit 21 */
  4423. #define NVIC_ISER_SETENA_22 ((uint32_t)0x00400000) /*!< bit 22 */
  4424. #define NVIC_ISER_SETENA_23 ((uint32_t)0x00800000) /*!< bit 23 */
  4425. #define NVIC_ISER_SETENA_24 ((uint32_t)0x01000000) /*!< bit 24 */
  4426. #define NVIC_ISER_SETENA_25 ((uint32_t)0x02000000) /*!< bit 25 */
  4427. #define NVIC_ISER_SETENA_26 ((uint32_t)0x04000000) /*!< bit 26 */
  4428. #define NVIC_ISER_SETENA_27 ((uint32_t)0x08000000) /*!< bit 27 */
  4429. #define NVIC_ISER_SETENA_28 ((uint32_t)0x10000000) /*!< bit 28 */
  4430. #define NVIC_ISER_SETENA_29 ((uint32_t)0x20000000) /*!< bit 29 */
  4431. #define NVIC_ISER_SETENA_30 ((uint32_t)0x40000000) /*!< bit 30 */
  4432. #define NVIC_ISER_SETENA_31 ((uint32_t)0x80000000) /*!< bit 31 */
  4433. /****************** Bit definition for NVIC_ICER register *******************/
  4434. #define NVIC_ICER_CLRENA ((uint32_t)0xFFFFFFFF) /*!< Interrupt clear-enable bits */
  4435. #define NVIC_ICER_CLRENA_0 ((uint32_t)0x00000001) /*!< bit 0 */
  4436. #define NVIC_ICER_CLRENA_1 ((uint32_t)0x00000002) /*!< bit 1 */
  4437. #define NVIC_ICER_CLRENA_2 ((uint32_t)0x00000004) /*!< bit 2 */
  4438. #define NVIC_ICER_CLRENA_3 ((uint32_t)0x00000008) /*!< bit 3 */
  4439. #define NVIC_ICER_CLRENA_4 ((uint32_t)0x00000010) /*!< bit 4 */
  4440. #define NVIC_ICER_CLRENA_5 ((uint32_t)0x00000020) /*!< bit 5 */
  4441. #define NVIC_ICER_CLRENA_6 ((uint32_t)0x00000040) /*!< bit 6 */
  4442. #define NVIC_ICER_CLRENA_7 ((uint32_t)0x00000080) /*!< bit 7 */
  4443. #define NVIC_ICER_CLRENA_8 ((uint32_t)0x00000100) /*!< bit 8 */
  4444. #define NVIC_ICER_CLRENA_9 ((uint32_t)0x00000200) /*!< bit 9 */
  4445. #define NVIC_ICER_CLRENA_10 ((uint32_t)0x00000400) /*!< bit 10 */
  4446. #define NVIC_ICER_CLRENA_11 ((uint32_t)0x00000800) /*!< bit 11 */
  4447. #define NVIC_ICER_CLRENA_12 ((uint32_t)0x00001000) /*!< bit 12 */
  4448. #define NVIC_ICER_CLRENA_13 ((uint32_t)0x00002000) /*!< bit 13 */
  4449. #define NVIC_ICER_CLRENA_14 ((uint32_t)0x00004000) /*!< bit 14 */
  4450. #define NVIC_ICER_CLRENA_15 ((uint32_t)0x00008000) /*!< bit 15 */
  4451. #define NVIC_ICER_CLRENA_16 ((uint32_t)0x00010000) /*!< bit 16 */
  4452. #define NVIC_ICER_CLRENA_17 ((uint32_t)0x00020000) /*!< bit 17 */
  4453. #define NVIC_ICER_CLRENA_18 ((uint32_t)0x00040000) /*!< bit 18 */
  4454. #define NVIC_ICER_CLRENA_19 ((uint32_t)0x00080000) /*!< bit 19 */
  4455. #define NVIC_ICER_CLRENA_20 ((uint32_t)0x00100000) /*!< bit 20 */
  4456. #define NVIC_ICER_CLRENA_21 ((uint32_t)0x00200000) /*!< bit 21 */
  4457. #define NVIC_ICER_CLRENA_22 ((uint32_t)0x00400000) /*!< bit 22 */
  4458. #define NVIC_ICER_CLRENA_23 ((uint32_t)0x00800000) /*!< bit 23 */
  4459. #define NVIC_ICER_CLRENA_24 ((uint32_t)0x01000000) /*!< bit 24 */
  4460. #define NVIC_ICER_CLRENA_25 ((uint32_t)0x02000000) /*!< bit 25 */
  4461. #define NVIC_ICER_CLRENA_26 ((uint32_t)0x04000000) /*!< bit 26 */
  4462. #define NVIC_ICER_CLRENA_27 ((uint32_t)0x08000000) /*!< bit 27 */
  4463. #define NVIC_ICER_CLRENA_28 ((uint32_t)0x10000000) /*!< bit 28 */
  4464. #define NVIC_ICER_CLRENA_29 ((uint32_t)0x20000000) /*!< bit 29 */
  4465. #define NVIC_ICER_CLRENA_30 ((uint32_t)0x40000000) /*!< bit 30 */
  4466. #define NVIC_ICER_CLRENA_31 ((uint32_t)0x80000000) /*!< bit 31 */
  4467. /****************** Bit definition for NVIC_ISPR register *******************/
  4468. #define NVIC_ISPR_SETPEND ((uint32_t)0xFFFFFFFF) /*!< Interrupt set-pending bits */
  4469. #define NVIC_ISPR_SETPEND_0 ((uint32_t)0x00000001) /*!< bit 0 */
  4470. #define NVIC_ISPR_SETPEND_1 ((uint32_t)0x00000002) /*!< bit 1 */
  4471. #define NVIC_ISPR_SETPEND_2 ((uint32_t)0x00000004) /*!< bit 2 */
  4472. #define NVIC_ISPR_SETPEND_3 ((uint32_t)0x00000008) /*!< bit 3 */
  4473. #define NVIC_ISPR_SETPEND_4 ((uint32_t)0x00000010) /*!< bit 4 */
  4474. #define NVIC_ISPR_SETPEND_5 ((uint32_t)0x00000020) /*!< bit 5 */
  4475. #define NVIC_ISPR_SETPEND_6 ((uint32_t)0x00000040) /*!< bit 6 */
  4476. #define NVIC_ISPR_SETPEND_7 ((uint32_t)0x00000080) /*!< bit 7 */
  4477. #define NVIC_ISPR_SETPEND_8 ((uint32_t)0x00000100) /*!< bit 8 */
  4478. #define NVIC_ISPR_SETPEND_9 ((uint32_t)0x00000200) /*!< bit 9 */
  4479. #define NVIC_ISPR_SETPEND_10 ((uint32_t)0x00000400) /*!< bit 10 */
  4480. #define NVIC_ISPR_SETPEND_11 ((uint32_t)0x00000800) /*!< bit 11 */
  4481. #define NVIC_ISPR_SETPEND_12 ((uint32_t)0x00001000) /*!< bit 12 */
  4482. #define NVIC_ISPR_SETPEND_13 ((uint32_t)0x00002000) /*!< bit 13 */
  4483. #define NVIC_ISPR_SETPEND_14 ((uint32_t)0x00004000) /*!< bit 14 */
  4484. #define NVIC_ISPR_SETPEND_15 ((uint32_t)0x00008000) /*!< bit 15 */
  4485. #define NVIC_ISPR_SETPEND_16 ((uint32_t)0x00010000) /*!< bit 16 */
  4486. #define NVIC_ISPR_SETPEND_17 ((uint32_t)0x00020000) /*!< bit 17 */
  4487. #define NVIC_ISPR_SETPEND_18 ((uint32_t)0x00040000) /*!< bit 18 */
  4488. #define NVIC_ISPR_SETPEND_19 ((uint32_t)0x00080000) /*!< bit 19 */
  4489. #define NVIC_ISPR_SETPEND_20 ((uint32_t)0x00100000) /*!< bit 20 */
  4490. #define NVIC_ISPR_SETPEND_21 ((uint32_t)0x00200000) /*!< bit 21 */
  4491. #define NVIC_ISPR_SETPEND_22 ((uint32_t)0x00400000) /*!< bit 22 */
  4492. #define NVIC_ISPR_SETPEND_23 ((uint32_t)0x00800000) /*!< bit 23 */
  4493. #define NVIC_ISPR_SETPEND_24 ((uint32_t)0x01000000) /*!< bit 24 */
  4494. #define NVIC_ISPR_SETPEND_25 ((uint32_t)0x02000000) /*!< bit 25 */
  4495. #define NVIC_ISPR_SETPEND_26 ((uint32_t)0x04000000) /*!< bit 26 */
  4496. #define NVIC_ISPR_SETPEND_27 ((uint32_t)0x08000000) /*!< bit 27 */
  4497. #define NVIC_ISPR_SETPEND_28 ((uint32_t)0x10000000) /*!< bit 28 */
  4498. #define NVIC_ISPR_SETPEND_29 ((uint32_t)0x20000000) /*!< bit 29 */
  4499. #define NVIC_ISPR_SETPEND_30 ((uint32_t)0x40000000) /*!< bit 30 */
  4500. #define NVIC_ISPR_SETPEND_31 ((uint32_t)0x80000000) /*!< bit 31 */
  4501. /****************** Bit definition for NVIC_ICPR register *******************/
  4502. #define NVIC_ICPR_CLRPEND ((uint32_t)0xFFFFFFFF) /*!< Interrupt clear-pending bits */
  4503. #define NVIC_ICPR_CLRPEND_0 ((uint32_t)0x00000001) /*!< bit 0 */
  4504. #define NVIC_ICPR_CLRPEND_1 ((uint32_t)0x00000002) /*!< bit 1 */
  4505. #define NVIC_ICPR_CLRPEND_2 ((uint32_t)0x00000004) /*!< bit 2 */
  4506. #define NVIC_ICPR_CLRPEND_3 ((uint32_t)0x00000008) /*!< bit 3 */
  4507. #define NVIC_ICPR_CLRPEND_4 ((uint32_t)0x00000010) /*!< bit 4 */
  4508. #define NVIC_ICPR_CLRPEND_5 ((uint32_t)0x00000020) /*!< bit 5 */
  4509. #define NVIC_ICPR_CLRPEND_6 ((uint32_t)0x00000040) /*!< bit 6 */
  4510. #define NVIC_ICPR_CLRPEND_7 ((uint32_t)0x00000080) /*!< bit 7 */
  4511. #define NVIC_ICPR_CLRPEND_8 ((uint32_t)0x00000100) /*!< bit 8 */
  4512. #define NVIC_ICPR_CLRPEND_9 ((uint32_t)0x00000200) /*!< bit 9 */
  4513. #define NVIC_ICPR_CLRPEND_10 ((uint32_t)0x00000400) /*!< bit 10 */
  4514. #define NVIC_ICPR_CLRPEND_11 ((uint32_t)0x00000800) /*!< bit 11 */
  4515. #define NVIC_ICPR_CLRPEND_12 ((uint32_t)0x00001000) /*!< bit 12 */
  4516. #define NVIC_ICPR_CLRPEND_13 ((uint32_t)0x00002000) /*!< bit 13 */
  4517. #define NVIC_ICPR_CLRPEND_14 ((uint32_t)0x00004000) /*!< bit 14 */
  4518. #define NVIC_ICPR_CLRPEND_15 ((uint32_t)0x00008000) /*!< bit 15 */
  4519. #define NVIC_ICPR_CLRPEND_16 ((uint32_t)0x00010000) /*!< bit 16 */
  4520. #define NVIC_ICPR_CLRPEND_17 ((uint32_t)0x00020000) /*!< bit 17 */
  4521. #define NVIC_ICPR_CLRPEND_18 ((uint32_t)0x00040000) /*!< bit 18 */
  4522. #define NVIC_ICPR_CLRPEND_19 ((uint32_t)0x00080000) /*!< bit 19 */
  4523. #define NVIC_ICPR_CLRPEND_20 ((uint32_t)0x00100000) /*!< bit 20 */
  4524. #define NVIC_ICPR_CLRPEND_21 ((uint32_t)0x00200000) /*!< bit 21 */
  4525. #define NVIC_ICPR_CLRPEND_22 ((uint32_t)0x00400000) /*!< bit 22 */
  4526. #define NVIC_ICPR_CLRPEND_23 ((uint32_t)0x00800000) /*!< bit 23 */
  4527. #define NVIC_ICPR_CLRPEND_24 ((uint32_t)0x01000000) /*!< bit 24 */
  4528. #define NVIC_ICPR_CLRPEND_25 ((uint32_t)0x02000000) /*!< bit 25 */
  4529. #define NVIC_ICPR_CLRPEND_26 ((uint32_t)0x04000000) /*!< bit 26 */
  4530. #define NVIC_ICPR_CLRPEND_27 ((uint32_t)0x08000000) /*!< bit 27 */
  4531. #define NVIC_ICPR_CLRPEND_28 ((uint32_t)0x10000000) /*!< bit 28 */
  4532. #define NVIC_ICPR_CLRPEND_29 ((uint32_t)0x20000000) /*!< bit 29 */
  4533. #define NVIC_ICPR_CLRPEND_30 ((uint32_t)0x40000000) /*!< bit 30 */
  4534. #define NVIC_ICPR_CLRPEND_31 ((uint32_t)0x80000000) /*!< bit 31 */
  4535. /****************** Bit definition for NVIC_IABR register *******************/
  4536. #define NVIC_IABR_ACTIVE ((uint32_t)0xFFFFFFFF) /*!< Interrupt active flags */
  4537. #define NVIC_IABR_ACTIVE_0 ((uint32_t)0x00000001) /*!< bit 0 */
  4538. #define NVIC_IABR_ACTIVE_1 ((uint32_t)0x00000002) /*!< bit 1 */
  4539. #define NVIC_IABR_ACTIVE_2 ((uint32_t)0x00000004) /*!< bit 2 */
  4540. #define NVIC_IABR_ACTIVE_3 ((uint32_t)0x00000008) /*!< bit 3 */
  4541. #define NVIC_IABR_ACTIVE_4 ((uint32_t)0x00000010) /*!< bit 4 */
  4542. #define NVIC_IABR_ACTIVE_5 ((uint32_t)0x00000020) /*!< bit 5 */
  4543. #define NVIC_IABR_ACTIVE_6 ((uint32_t)0x00000040) /*!< bit 6 */
  4544. #define NVIC_IABR_ACTIVE_7 ((uint32_t)0x00000080) /*!< bit 7 */
  4545. #define NVIC_IABR_ACTIVE_8 ((uint32_t)0x00000100) /*!< bit 8 */
  4546. #define NVIC_IABR_ACTIVE_9 ((uint32_t)0x00000200) /*!< bit 9 */
  4547. #define NVIC_IABR_ACTIVE_10 ((uint32_t)0x00000400) /*!< bit 10 */
  4548. #define NVIC_IABR_ACTIVE_11 ((uint32_t)0x00000800) /*!< bit 11 */
  4549. #define NVIC_IABR_ACTIVE_12 ((uint32_t)0x00001000) /*!< bit 12 */
  4550. #define NVIC_IABR_ACTIVE_13 ((uint32_t)0x00002000) /*!< bit 13 */
  4551. #define NVIC_IABR_ACTIVE_14 ((uint32_t)0x00004000) /*!< bit 14 */
  4552. #define NVIC_IABR_ACTIVE_15 ((uint32_t)0x00008000) /*!< bit 15 */
  4553. #define NVIC_IABR_ACTIVE_16 ((uint32_t)0x00010000) /*!< bit 16 */
  4554. #define NVIC_IABR_ACTIVE_17 ((uint32_t)0x00020000) /*!< bit 17 */
  4555. #define NVIC_IABR_ACTIVE_18 ((uint32_t)0x00040000) /*!< bit 18 */
  4556. #define NVIC_IABR_ACTIVE_19 ((uint32_t)0x00080000) /*!< bit 19 */
  4557. #define NVIC_IABR_ACTIVE_20 ((uint32_t)0x00100000) /*!< bit 20 */
  4558. #define NVIC_IABR_ACTIVE_21 ((uint32_t)0x00200000) /*!< bit 21 */
  4559. #define NVIC_IABR_ACTIVE_22 ((uint32_t)0x00400000) /*!< bit 22 */
  4560. #define NVIC_IABR_ACTIVE_23 ((uint32_t)0x00800000) /*!< bit 23 */
  4561. #define NVIC_IABR_ACTIVE_24 ((uint32_t)0x01000000) /*!< bit 24 */
  4562. #define NVIC_IABR_ACTIVE_25 ((uint32_t)0x02000000) /*!< bit 25 */
  4563. #define NVIC_IABR_ACTIVE_26 ((uint32_t)0x04000000) /*!< bit 26 */
  4564. #define NVIC_IABR_ACTIVE_27 ((uint32_t)0x08000000) /*!< bit 27 */
  4565. #define NVIC_IABR_ACTIVE_28 ((uint32_t)0x10000000) /*!< bit 28 */
  4566. #define NVIC_IABR_ACTIVE_29 ((uint32_t)0x20000000) /*!< bit 29 */
  4567. #define NVIC_IABR_ACTIVE_30 ((uint32_t)0x40000000) /*!< bit 30 */
  4568. #define NVIC_IABR_ACTIVE_31 ((uint32_t)0x80000000) /*!< bit 31 */
  4569. /****************** Bit definition for NVIC_PRI0 register *******************/
  4570. #define NVIC_IPR0_PRI_0 ((uint32_t)0x000000FF) /*!< Priority of interrupt 0 */
  4571. #define NVIC_IPR0_PRI_1 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 1 */
  4572. #define NVIC_IPR0_PRI_2 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 2 */
  4573. #define NVIC_IPR0_PRI_3 ((uint32_t)0xFF000000) /*!< Priority of interrupt 3 */
  4574. /****************** Bit definition for NVIC_PRI1 register *******************/
  4575. #define NVIC_IPR1_PRI_4 ((uint32_t)0x000000FF) /*!< Priority of interrupt 4 */
  4576. #define NVIC_IPR1_PRI_5 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 5 */
  4577. #define NVIC_IPR1_PRI_6 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 6 */
  4578. #define NVIC_IPR1_PRI_7 ((uint32_t)0xFF000000) /*!< Priority of interrupt 7 */
  4579. /****************** Bit definition for NVIC_PRI2 register *******************/
  4580. #define NVIC_IPR2_PRI_8 ((uint32_t)0x000000FF) /*!< Priority of interrupt 8 */
  4581. #define NVIC_IPR2_PRI_9 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 9 */
  4582. #define NVIC_IPR2_PRI_10 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 10 */
  4583. #define NVIC_IPR2_PRI_11 ((uint32_t)0xFF000000) /*!< Priority of interrupt 11 */
  4584. /****************** Bit definition for NVIC_PRI3 register *******************/
  4585. #define NVIC_IPR3_PRI_12 ((uint32_t)0x000000FF) /*!< Priority of interrupt 12 */
  4586. #define NVIC_IPR3_PRI_13 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 13 */
  4587. #define NVIC_IPR3_PRI_14 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 14 */
  4588. #define NVIC_IPR3_PRI_15 ((uint32_t)0xFF000000) /*!< Priority of interrupt 15 */
  4589. /****************** Bit definition for NVIC_PRI4 register *******************/
  4590. #define NVIC_IPR4_PRI_16 ((uint32_t)0x000000FF) /*!< Priority of interrupt 16 */
  4591. #define NVIC_IPR4_PRI_17 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 17 */
  4592. #define NVIC_IPR4_PRI_18 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 18 */
  4593. #define NVIC_IPR4_PRI_19 ((uint32_t)0xFF000000) /*!< Priority of interrupt 19 */
  4594. /****************** Bit definition for NVIC_PRI5 register *******************/
  4595. #define NVIC_IPR5_PRI_20 ((uint32_t)0x000000FF) /*!< Priority of interrupt 20 */
  4596. #define NVIC_IPR5_PRI_21 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 21 */
  4597. #define NVIC_IPR5_PRI_22 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 22 */
  4598. #define NVIC_IPR5_PRI_23 ((uint32_t)0xFF000000) /*!< Priority of interrupt 23 */
  4599. /****************** Bit definition for NVIC_PRI6 register *******************/
  4600. #define NVIC_IPR6_PRI_24 ((uint32_t)0x000000FF) /*!< Priority of interrupt 24 */
  4601. #define NVIC_IPR6_PRI_25 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 25 */
  4602. #define NVIC_IPR6_PRI_26 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 26 */
  4603. #define NVIC_IPR6_PRI_27 ((uint32_t)0xFF000000) /*!< Priority of interrupt 27 */
  4604. /****************** Bit definition for NVIC_PRI7 register *******************/
  4605. #define NVIC_IPR7_PRI_28 ((uint32_t)0x000000FF) /*!< Priority of interrupt 28 */
  4606. #define NVIC_IPR7_PRI_29 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 29 */
  4607. #define NVIC_IPR7_PRI_30 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 30 */
  4608. #define NVIC_IPR7_PRI_31 ((uint32_t)0xFF000000) /*!< Priority of interrupt 31 */
  4609. /****************** Bit definition for SCB_CPUID register *******************/
  4610. #define SCB_CPUID_REVISION ((uint32_t)0x0000000F) /*!< Implementation defined revision number */
  4611. #define SCB_CPUID_PARTNO ((uint32_t)0x0000FFF0) /*!< Number of processor within family */
  4612. #define SCB_CPUID_Constant ((uint32_t)0x000F0000) /*!< Reads as 0x0F */
  4613. #define SCB_CPUID_VARIANT ((uint32_t)0x00F00000) /*!< Implementation defined variant number */
  4614. #define SCB_CPUID_IMPLEMENTER ((uint32_t)0xFF000000) /*!< Implementer code. ARM is 0x41 */
  4615. /******************* Bit definition for SCB_ICSR register *******************/
  4616. #define SCB_ICSR_VECTACTIVE ((uint32_t)0x000001FF) /*!< Active ISR number field */
  4617. #define SCB_ICSR_RETTOBASE ((uint32_t)0x00000800) /*!< All active exceptions minus the IPSR_current_exception yields the empty set */
  4618. #define SCB_ICSR_VECTPENDING ((uint32_t)0x003FF000) /*!< Pending ISR number field */
  4619. #define SCB_ICSR_ISRPENDING ((uint32_t)0x00400000) /*!< Interrupt pending flag */
  4620. #define SCB_ICSR_ISRPREEMPT ((uint32_t)0x00800000) /*!< It indicates that a pending interrupt becomes active in the next running cycle */
  4621. #define SCB_ICSR_PENDSTCLR ((uint32_t)0x02000000) /*!< Clear pending SysTick bit */
  4622. #define SCB_ICSR_PENDSTSET ((uint32_t)0x04000000) /*!< Set pending SysTick bit */
  4623. #define SCB_ICSR_PENDSVCLR ((uint32_t)0x08000000) /*!< Clear pending pendSV bit */
  4624. #define SCB_ICSR_PENDSVSET ((uint32_t)0x10000000) /*!< Set pending pendSV bit */
  4625. #define SCB_ICSR_NMIPENDSET ((uint32_t)0x80000000) /*!< Set pending NMI bit */
  4626. /******************* Bit definition for SCB_VTOR register *******************/
  4627. #define SCB_VTOR_TBLOFF ((uint32_t)0x1FFFFF80) /*!< Vector table base offset field */
  4628. #define SCB_VTOR_TBLBASE ((uint32_t)0x20000000) /*!< Table base in code(0) or RAM(1) */
  4629. /*!<***************** Bit definition for SCB_AIRCR register *******************/
  4630. #define SCB_AIRCR_VECTRESET ((uint32_t)0x00000001) /*!< System Reset bit */
  4631. #define SCB_AIRCR_VECTCLRACTIVE ((uint32_t)0x00000002) /*!< Clear active vector bit */
  4632. #define SCB_AIRCR_SYSRESETREQ ((uint32_t)0x00000004) /*!< Requests chip control logic to generate a reset */
  4633. #define SCB_AIRCR_PRIGROUP ((uint32_t)0x00000700) /*!< PRIGROUP[2:0] bits (Priority group) */
  4634. #define SCB_AIRCR_PRIGROUP_0 ((uint32_t)0x00000100) /*!< Bit 0 */
  4635. #define SCB_AIRCR_PRIGROUP_1 ((uint32_t)0x00000200) /*!< Bit 1 */
  4636. #define SCB_AIRCR_PRIGROUP_2 ((uint32_t)0x00000400) /*!< Bit 2 */
  4637. /* prority group configuration */
  4638. #define SCB_AIRCR_PRIGROUP0 ((uint32_t)0x00000000) /*!< Priority group=0 (7 bits of pre-emption priority, 1 bit of subpriority) */
  4639. #define SCB_AIRCR_PRIGROUP1 ((uint32_t)0x00000100) /*!< Priority group=1 (6 bits of pre-emption priority, 2 bits of subpriority) */
  4640. #define SCB_AIRCR_PRIGROUP2 ((uint32_t)0x00000200) /*!< Priority group=2 (5 bits of pre-emption priority, 3 bits of subpriority) */
  4641. #define SCB_AIRCR_PRIGROUP3 ((uint32_t)0x00000300) /*!< Priority group=3 (4 bits of pre-emption priority, 4 bits of subpriority) */
  4642. #define SCB_AIRCR_PRIGROUP4 ((uint32_t)0x00000400) /*!< Priority group=4 (3 bits of pre-emption priority, 5 bits of subpriority) */
  4643. #define SCB_AIRCR_PRIGROUP5 ((uint32_t)0x00000500) /*!< Priority group=5 (2 bits of pre-emption priority, 6 bits of subpriority) */
  4644. #define SCB_AIRCR_PRIGROUP6 ((uint32_t)0x00000600) /*!< Priority group=6 (1 bit of pre-emption priority, 7 bits of subpriority) */
  4645. #define SCB_AIRCR_PRIGROUP7 ((uint32_t)0x00000700) /*!< Priority group=7 (no pre-emption priority, 8 bits of subpriority) */
  4646. #define SCB_AIRCR_ENDIANESS ((uint32_t)0x00008000) /*!< Data endianness bit */
  4647. #define SCB_AIRCR_VECTKEY ((uint32_t)0xFFFF0000) /*!< Register key (VECTKEY) - Reads as 0xFA05 (VECTKEYSTAT) */
  4648. /******************* Bit definition for SCB_SCR register ********************/
  4649. #define SCB_SCR_SLEEPONEXIT ((uint32_t)0x00000002) /*!< Sleep on exit bit */
  4650. #define SCB_SCR_SLEEPDEEP ((uint32_t)0x00000004) /*!< Sleep deep bit */
  4651. #define SCB_SCR_SEVONPEND ((uint32_t)0x00000010) /*!< Wake up from WFE */
  4652. /******************** Bit definition for SCB_CCR register *******************/
  4653. #define SCB_CCR_NONBASETHRDENA ((uint32_t)0x00000001) /*!< Thread mode can be entered from any level in Handler mode by controlled return value */
  4654. #define SCB_CCR_USERSETMPEND ((uint32_t)0x00000002) /*!< Enables user code to write the Software Trigger Interrupt register to trigger (pend) a Main exception */
  4655. #define SCB_CCR_UNALIGN_TRP ((uint32_t)0x00000008) /*!< Trap for unaligned access */
  4656. #define SCB_CCR_DIV_0_TRP ((uint32_t)0x00000010) /*!< Trap on Divide by 0 */
  4657. #define SCB_CCR_BFHFNMIGN ((uint32_t)0x00000100) /*!< Handlers running at priority -1 and -2 */
  4658. #define SCB_CCR_STKALIGN ((uint32_t)0x00000200) /*!< On exception entry, the SP used prior to the exception is adjusted to be 8-byte aligned */
  4659. /******************* Bit definition for SCB_SHPR register ********************/
  4660. #define SCB_SHPR_PRI_N ((uint32_t)0x000000FF) /*!< Priority of system handler 4,8, and 12. Mem Manage, reserved and Debug Monitor */
  4661. #define SCB_SHPR_PRI_N1 ((uint32_t)0x0000FF00) /*!< Priority of system handler 5,9, and 13. Bus Fault, reserved and reserved */
  4662. #define SCB_SHPR_PRI_N2 ((uint32_t)0x00FF0000) /*!< Priority of system handler 6,10, and 14. Usage Fault, reserved and PendSV */
  4663. #define SCB_SHPR_PRI_N3 ((uint32_t)0xFF000000) /*!< Priority of system handler 7,11, and 15. Reserved, SVCall and SysTick */
  4664. /****************** Bit definition for SCB_SHCSR register *******************/
  4665. #define SCB_SHCSR_MEMFAULTACT ((uint32_t)0x00000001) /*!< MemManage is active */
  4666. #define SCB_SHCSR_BUSFAULTACT ((uint32_t)0x00000002) /*!< BusFault is active */
  4667. #define SCB_SHCSR_USGFAULTACT ((uint32_t)0x00000008) /*!< UsageFault is active */
  4668. #define SCB_SHCSR_SVCALLACT ((uint32_t)0x00000080) /*!< SVCall is active */
  4669. #define SCB_SHCSR_MONITORACT ((uint32_t)0x00000100) /*!< Monitor is active */
  4670. #define SCB_SHCSR_PENDSVACT ((uint32_t)0x00000400) /*!< PendSV is active */
  4671. #define SCB_SHCSR_SYSTICKACT ((uint32_t)0x00000800) /*!< SysTick is active */
  4672. #define SCB_SHCSR_USGFAULTPENDED ((uint32_t)0x00001000) /*!< Usage Fault is pended */
  4673. #define SCB_SHCSR_MEMFAULTPENDED ((uint32_t)0x00002000) /*!< MemManage is pended */
  4674. #define SCB_SHCSR_BUSFAULTPENDED ((uint32_t)0x00004000) /*!< Bus Fault is pended */
  4675. #define SCB_SHCSR_SVCALLPENDED ((uint32_t)0x00008000) /*!< SVCall is pended */
  4676. #define SCB_SHCSR_MEMFAULTENA ((uint32_t)0x00010000) /*!< MemManage enable */
  4677. #define SCB_SHCSR_BUSFAULTENA ((uint32_t)0x00020000) /*!< Bus Fault enable */
  4678. #define SCB_SHCSR_USGFAULTENA ((uint32_t)0x00040000) /*!< UsageFault enable */
  4679. /******************* Bit definition for SCB_CFSR register *******************/
  4680. /*!< MFSR */
  4681. #define SCB_CFSR_IACCVIOL ((uint32_t)0x00000001) /*!< Instruction access violation */
  4682. #define SCB_CFSR_DACCVIOL ((uint32_t)0x00000002) /*!< Data access violation */
  4683. #define SCB_CFSR_MUNSTKERR ((uint32_t)0x00000008) /*!< Unstacking error */
  4684. #define SCB_CFSR_MSTKERR ((uint32_t)0x00000010) /*!< Stacking error */
  4685. #define SCB_CFSR_MMARVALID ((uint32_t)0x00000080) /*!< Memory Manage Address Register address valid flag */
  4686. /*!< BFSR */
  4687. #define SCB_CFSR_IBUSERR ((uint32_t)0x00000100) /*!< Instruction bus error flag */
  4688. #define SCB_CFSR_PRECISERR ((uint32_t)0x00000200) /*!< Precise data bus error */
  4689. #define SCB_CFSR_IMPRECISERR ((uint32_t)0x00000400) /*!< Imprecise data bus error */
  4690. #define SCB_CFSR_UNSTKERR ((uint32_t)0x00000800) /*!< Unstacking error */
  4691. #define SCB_CFSR_STKERR ((uint32_t)0x00001000) /*!< Stacking error */
  4692. #define SCB_CFSR_BFARVALID ((uint32_t)0x00008000) /*!< Bus Fault Address Register address valid flag */
  4693. /*!< UFSR */
  4694. #define SCB_CFSR_UNDEFINSTR ((uint32_t)0x00010000) /*!< The processor attempt to excecute an undefined instruction */
  4695. #define SCB_CFSR_INVSTATE ((uint32_t)0x00020000) /*!< Invalid combination of EPSR and instruction */
  4696. #define SCB_CFSR_INVPC ((uint32_t)0x00040000) /*!< Attempt to load EXC_RETURN into pc illegally */
  4697. #define SCB_CFSR_NOCP ((uint32_t)0x00080000) /*!< Attempt to use a coprocessor instruction */
  4698. #define SCB_CFSR_UNALIGNED ((uint32_t)0x01000000) /*!< Fault occurs when there is an attempt to make an unaligned memory access */
  4699. #define SCB_CFSR_DIVBYZERO ((uint32_t)0x02000000) /*!< Fault occurs when SDIV or DIV instruction is used with a divisor of 0 */
  4700. /******************* Bit definition for SCB_HFSR register *******************/
  4701. #define SCB_HFSR_VECTTBL ((uint32_t)0x00000002) /*!< Fault occures because of vector table read on exception processing */
  4702. #define SCB_HFSR_FORCED ((uint32_t)0x40000000) /*!< Hard Fault activated when a configurable Fault was received and cannot activate */
  4703. #define SCB_HFSR_DEBUGEVT ((uint32_t)0x80000000) /*!< Fault related to debug */
  4704. /******************* Bit definition for SCB_DFSR register *******************/
  4705. #define SCB_DFSR_HALTED ((uint32_t)0x00000001) /*!< Halt request flag */
  4706. #define SCB_DFSR_BKPT ((uint32_t)0x00000002) /*!< BKPT flag */
  4707. #define SCB_DFSR_DWTTRAP ((uint32_t)0x00000004) /*!< Data Watchpoint and Trace (DWT) flag */
  4708. #define SCB_DFSR_VCATCH ((uint32_t)0x00000008) /*!< Vector catch flag */
  4709. #define SCB_DFSR_EXTERNAL ((uint32_t)0x00000010) /*!< External debug request flag */
  4710. /******************* Bit definition for SCB_MMFAR register ******************/
  4711. #define SCB_MMFAR_ADDRESS ((uint32_t)0xFFFFFFFF) /*!< Mem Manage fault address field */
  4712. /******************* Bit definition for SCB_BFAR register *******************/
  4713. #define SCB_BFAR_ADDRESS ((uint32_t)0xFFFFFFFF) /*!< Bus fault address field */
  4714. /******************* Bit definition for SCB_afsr register *******************/
  4715. #define SCB_AFSR_IMPDEF ((uint32_t)0xFFFFFFFF) /*!< Implementation defined */
  4716. /**
  4717. * @}
  4718. */
  4719. /**
  4720. * @}
  4721. */
  4722. /** @addtogroup Exported_macro
  4723. * @{
  4724. */
  4725. /****************************** ADC Instances *********************************/
  4726. #define IS_ADC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == ADC1)
  4727. /******************************** COMP Instances ******************************/
  4728. #define IS_COMP_ALL_INSTANCE(INSTANCE) (((INSTANCE) == COMP1) || \
  4729. ((INSTANCE) == COMP2))
  4730. /****************************** CRC Instances *********************************/
  4731. #define IS_CRC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CRC)
  4732. /****************************** DAC Instances *********************************/
  4733. #define IS_DAC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == DAC)
  4734. /****************************** DMA Instances *********************************/
  4735. #define IS_DMA_ALL_INSTANCE(INSTANCE) (((INSTANCE) == DMA1_Channel1) || \
  4736. ((INSTANCE) == DMA1_Channel2) || \
  4737. ((INSTANCE) == DMA1_Channel3) || \
  4738. ((INSTANCE) == DMA1_Channel4) || \
  4739. ((INSTANCE) == DMA1_Channel5) || \
  4740. ((INSTANCE) == DMA1_Channel6) || \
  4741. ((INSTANCE) == DMA1_Channel7) || \
  4742. ((INSTANCE) == DMA2_Channel1) || \
  4743. ((INSTANCE) == DMA2_Channel2) || \
  4744. ((INSTANCE) == DMA2_Channel3) || \
  4745. ((INSTANCE) == DMA2_Channel4) || \
  4746. ((INSTANCE) == DMA2_Channel5))
  4747. /******************************* GPIO Instances *******************************/
  4748. #define IS_GPIO_ALL_INSTANCE(INSTANCE) (((INSTANCE) == GPIOA) || \
  4749. ((INSTANCE) == GPIOB) || \
  4750. ((INSTANCE) == GPIOC) || \
  4751. ((INSTANCE) == GPIOD) || \
  4752. ((INSTANCE) == GPIOE) || \
  4753. ((INSTANCE) == GPIOH))
  4754. /**************************** GPIO Lock Instances *****************************/
  4755. /* On L1, all GPIO Bank support the Lock mechanism */
  4756. #define IS_GPIO_LOCK_INSTANCE(INSTANCE) IS_GPIO_ALL_INSTANCE(INSTANCE)
  4757. /******************************** I2C Instances *******************************/
  4758. #define IS_I2C_ALL_INSTANCE(INSTANCE) (((INSTANCE) == I2C1) || \
  4759. ((INSTANCE) == I2C2))
  4760. #define IS_I2S_ALL_INSTANCE(INSTANCE) (((INSTANCE) == SPI1) || \
  4761. ((INSTANCE) == SPI2) || \
  4762. ((INSTANCE) == SPI3))
  4763. /****************************** IWDG Instances ********************************/
  4764. #define IS_IWDG_ALL_INSTANCE(INSTANCE) ((INSTANCE) == IWDG)
  4765. /****************************** OPAMP Instances *******************************/
  4766. #define IS_OPAMP_ALL_INSTANCE(INSTANCE) (((INSTANCE) == OPAMP1) || \
  4767. ((INSTANCE) == OPAMP2))
  4768. /****************************** RTC Instances *********************************/
  4769. #define IS_RTC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == RTC)
  4770. /******************************** SPI Instances *******************************/
  4771. #define IS_SPI_ALL_INSTANCE(INSTANCE) (((INSTANCE) == SPI1) || \
  4772. ((INSTANCE) == SPI2) || \
  4773. ((INSTANCE) == SPI3))
  4774. /****************************** TIM Instances *********************************/
  4775. #define IS_TIM_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4776. ((INSTANCE) == TIM3) || \
  4777. ((INSTANCE) == TIM4) || \
  4778. ((INSTANCE) == TIM5) || \
  4779. ((INSTANCE) == TIM6) || \
  4780. ((INSTANCE) == TIM7) || \
  4781. ((INSTANCE) == TIM9) || \
  4782. ((INSTANCE) == TIM10) || \
  4783. ((INSTANCE) == TIM11))
  4784. #define IS_TIM_CC1_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4785. ((INSTANCE) == TIM3) || \
  4786. ((INSTANCE) == TIM4) || \
  4787. ((INSTANCE) == TIM5) || \
  4788. ((INSTANCE) == TIM9) || \
  4789. ((INSTANCE) == TIM10) || \
  4790. ((INSTANCE) == TIM11))
  4791. #define IS_TIM_CC2_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4792. ((INSTANCE) == TIM3) || \
  4793. ((INSTANCE) == TIM4) || \
  4794. ((INSTANCE) == TIM5) || \
  4795. ((INSTANCE) == TIM9))
  4796. #define IS_TIM_CC3_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4797. ((INSTANCE) == TIM3) || \
  4798. ((INSTANCE) == TIM4) || \
  4799. ((INSTANCE) == TIM5))
  4800. #define IS_TIM_CC4_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4801. ((INSTANCE) == TIM3) || \
  4802. ((INSTANCE) == TIM4) || \
  4803. ((INSTANCE) == TIM5))
  4804. #define IS_TIM_CLOCKSOURCE_ETRMODE1_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4805. ((INSTANCE) == TIM3) || \
  4806. ((INSTANCE) == TIM4) || \
  4807. ((INSTANCE) == TIM5) || \
  4808. ((INSTANCE) == TIM9))
  4809. #define IS_TIM_CLOCKSOURCE_ETRMODE2_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4810. ((INSTANCE) == TIM3) || \
  4811. ((INSTANCE) == TIM4) || \
  4812. ((INSTANCE) == TIM5) || \
  4813. ((INSTANCE) == TIM9) || \
  4814. ((INSTANCE) == TIM10) || \
  4815. ((INSTANCE) == TIM11))
  4816. #define IS_TIM_CLOCKSOURCE_TIX_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4817. ((INSTANCE) == TIM3) || \
  4818. ((INSTANCE) == TIM4) || \
  4819. ((INSTANCE) == TIM5) || \
  4820. ((INSTANCE) == TIM9))
  4821. #define IS_TIM_CLOCKSOURCE_ITRX_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4822. ((INSTANCE) == TIM3) || \
  4823. ((INSTANCE) == TIM4) || \
  4824. ((INSTANCE) == TIM5) || \
  4825. ((INSTANCE) == TIM9))
  4826. #define IS_TIM_OCXREF_CLEAR_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4827. ((INSTANCE) == TIM3) || \
  4828. ((INSTANCE) == TIM4))
  4829. #define IS_TIM_XOR_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4830. ((INSTANCE) == TIM3) || \
  4831. ((INSTANCE) == TIM4) || \
  4832. ((INSTANCE) == TIM5))
  4833. #define IS_TIM_MASTER_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4834. ((INSTANCE) == TIM3) || \
  4835. ((INSTANCE) == TIM4) || \
  4836. ((INSTANCE) == TIM5) || \
  4837. ((INSTANCE) == TIM6) || \
  4838. ((INSTANCE) == TIM7) || \
  4839. ((INSTANCE) == TIM9))
  4840. #define IS_TIM_SLAVE_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4841. ((INSTANCE) == TIM3) || \
  4842. ((INSTANCE) == TIM4) || \
  4843. ((INSTANCE) == TIM5) || \
  4844. ((INSTANCE) == TIM9))
  4845. #define IS_TIM_32B_COUNTER_INSTANCE(INSTANCE) ((INSTANCE) == TIM5)
  4846. #define IS_TIM_DMABURST_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4847. ((INSTANCE) == TIM3) || \
  4848. ((INSTANCE) == TIM4) || \
  4849. ((INSTANCE) == TIM5))
  4850. #define IS_TIM_CCX_INSTANCE(INSTANCE, CHANNEL) \
  4851. ((((INSTANCE) == TIM2) && \
  4852. (((CHANNEL) == TIM_CHANNEL_1) || \
  4853. ((CHANNEL) == TIM_CHANNEL_2) || \
  4854. ((CHANNEL) == TIM_CHANNEL_3) || \
  4855. ((CHANNEL) == TIM_CHANNEL_4))) \
  4856. || \
  4857. (((INSTANCE) == TIM3) && \
  4858. (((CHANNEL) == TIM_CHANNEL_1) || \
  4859. ((CHANNEL) == TIM_CHANNEL_2) || \
  4860. ((CHANNEL) == TIM_CHANNEL_3) || \
  4861. ((CHANNEL) == TIM_CHANNEL_4))) \
  4862. || \
  4863. (((INSTANCE) == TIM4) && \
  4864. (((CHANNEL) == TIM_CHANNEL_1) || \
  4865. ((CHANNEL) == TIM_CHANNEL_2) || \
  4866. ((CHANNEL) == TIM_CHANNEL_3) || \
  4867. ((CHANNEL) == TIM_CHANNEL_4))) \
  4868. || \
  4869. (((INSTANCE) == TIM5) && \
  4870. (((CHANNEL) == TIM_CHANNEL_1) || \
  4871. ((CHANNEL) == TIM_CHANNEL_2) || \
  4872. ((CHANNEL) == TIM_CHANNEL_3) || \
  4873. ((CHANNEL) == TIM_CHANNEL_4))) \
  4874. || \
  4875. (((INSTANCE) == TIM9) && \
  4876. (((CHANNEL) == TIM_CHANNEL_1) || \
  4877. ((CHANNEL) == TIM_CHANNEL_2))) \
  4878. || \
  4879. (((INSTANCE) == TIM10) && \
  4880. (((CHANNEL) == TIM_CHANNEL_1))) \
  4881. || \
  4882. (((INSTANCE) == TIM11) && \
  4883. (((CHANNEL) == TIM_CHANNEL_1))))
  4884. #define IS_TIM_CLOCK_DIVISION_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4885. ((INSTANCE) == TIM3) || \
  4886. ((INSTANCE) == TIM4) || \
  4887. ((INSTANCE) == TIM5) || \
  4888. ((INSTANCE) == TIM9) || \
  4889. ((INSTANCE) == TIM10) || \
  4890. ((INSTANCE) == TIM11))
  4891. #define IS_TIM_DMA_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4892. ((INSTANCE) == TIM3) || \
  4893. ((INSTANCE) == TIM4) || \
  4894. ((INSTANCE) == TIM5) || \
  4895. ((INSTANCE) == TIM6) || \
  4896. ((INSTANCE) == TIM7))
  4897. #define IS_TIM_DMA_CC_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4898. ((INSTANCE) == TIM3) || \
  4899. ((INSTANCE) == TIM4) || \
  4900. ((INSTANCE) == TIM5))
  4901. #define IS_TIM_COUNTER_MODE_SELECT_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4902. ((INSTANCE) == TIM3) || \
  4903. ((INSTANCE) == TIM4) || \
  4904. ((INSTANCE) == TIM5) || \
  4905. ((INSTANCE) == TIM9))
  4906. #define IS_TIM_ENCODER_INTERFACE_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4907. ((INSTANCE) == TIM3) || \
  4908. ((INSTANCE) == TIM4) || \
  4909. ((INSTANCE) == TIM5) || \
  4910. ((INSTANCE) == TIM9))
  4911. #define IS_TIM_REMAP_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4912. ((INSTANCE) == TIM3) || \
  4913. ((INSTANCE) == TIM9) || \
  4914. ((INSTANCE) == TIM10) || \
  4915. ((INSTANCE) == TIM11))
  4916. /******************** USART Instances : Synchronous mode **********************/
  4917. #define IS_USART_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  4918. ((INSTANCE) == USART2) || \
  4919. ((INSTANCE) == USART3))
  4920. /******************** UART Instances : Asynchronous mode **********************/
  4921. #define IS_UART_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  4922. ((INSTANCE) == USART2) || \
  4923. ((INSTANCE) == USART3))
  4924. /******************** UART Instances : Half-Duplex mode **********************/
  4925. #define IS_UART_HALFDUPLEX_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  4926. ((INSTANCE) == USART2) || \
  4927. ((INSTANCE) == USART3))
  4928. /******************** UART Instances : LIN mode **********************/
  4929. #define IS_UART_LIN_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  4930. ((INSTANCE) == USART2) || \
  4931. ((INSTANCE) == USART3))
  4932. /****************** UART Instances : Hardware Flow control ********************/
  4933. #define IS_UART_HWFLOW_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  4934. ((INSTANCE) == USART2) || \
  4935. ((INSTANCE) == USART3))
  4936. /********************* UART Instances : Smard card mode ***********************/
  4937. #define IS_SMARTCARD_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  4938. ((INSTANCE) == USART2) || \
  4939. ((INSTANCE) == USART3))
  4940. /*********************** UART Instances : IRDA mode ***************************/
  4941. #define IS_IRDA_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  4942. ((INSTANCE) == USART2) || \
  4943. ((INSTANCE) == USART3))
  4944. /***************** UART Instances : Multi-Processor mode **********************/
  4945. #define IS_UART_MULTIPROCESSOR_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  4946. ((INSTANCE) == USART2) || \
  4947. ((INSTANCE) == USART3))
  4948. /****************************** WWDG Instances ********************************/
  4949. #define IS_WWDG_ALL_INSTANCE(INSTANCE) ((INSTANCE) == WWDG)
  4950. /****************************** LCD Instances ********************************/
  4951. #define IS_LCD_ALL_INSTANCE(INSTANCE) ((INSTANCE) == LCD)
  4952. /****************************** USB Instances ********************************/
  4953. #define IS_USB_ALL_INSTANCE(INSTANCE) ((INSTANCE) == USB)
  4954. /**
  4955. * @}
  4956. */
  4957. /******************************************************************************/
  4958. /* For a painless codes migration between the STM32L1xx device product */
  4959. /* lines, the aliases defined below are put in place to overcome the */
  4960. /* differences in the interrupt handlers and IRQn definitions. */
  4961. /* No need to update developed interrupt code when moving across */
  4962. /* product lines within the same STM32L1 Family */
  4963. /******************************************************************************/
  4964. /* Aliases for __IRQn */
  4965. /* Aliases for __IRQHandler */
  4966. /**
  4967. * @}
  4968. */
  4969. /**
  4970. * @}
  4971. */
  4972. #ifdef __cplusplus
  4973. }
  4974. #endif /* __cplusplus */
  4975. #endif /* __STM32L162xC_H */
  4976. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/