stm32l100xba.h 378 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286
  1. /**
  2. ******************************************************************************
  3. * @file stm32l100xba.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 stm32l100xba
  49. * @{
  50. */
  51. #ifndef __STM32L100xBA_H
  52. #define __STM32L100xBA_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. } IRQn_Type;
  135. /**
  136. * @}
  137. */
  138. #include "core_cm3.h"
  139. #include "system_stm32l1xx.h"
  140. #include <stdint.h>
  141. /** @addtogroup Peripheral_registers_structures
  142. * @{
  143. */
  144. /**
  145. * @brief Analog to Digital Converter
  146. */
  147. typedef struct
  148. {
  149. __IO uint32_t SR; /*!< ADC status register, Address offset: 0x00 */
  150. __IO uint32_t CR1; /*!< ADC control register 1, Address offset: 0x04 */
  151. __IO uint32_t CR2; /*!< ADC control register 2, Address offset: 0x08 */
  152. __IO uint32_t SMPR1; /*!< ADC sample time register 1, Address offset: 0x0C */
  153. __IO uint32_t SMPR2; /*!< ADC sample time register 2, Address offset: 0x10 */
  154. __IO uint32_t SMPR3; /*!< ADC sample time register 3, Address offset: 0x14 */
  155. __IO uint32_t JOFR1; /*!< ADC injected channel data offset register 1, Address offset: 0x18 */
  156. __IO uint32_t JOFR2; /*!< ADC injected channel data offset register 2, Address offset: 0x1C */
  157. __IO uint32_t JOFR3; /*!< ADC injected channel data offset register 3, Address offset: 0x20 */
  158. __IO uint32_t JOFR4; /*!< ADC injected channel data offset register 4, Address offset: 0x24 */
  159. __IO uint32_t HTR; /*!< ADC watchdog higher threshold register, Address offset: 0x28 */
  160. __IO uint32_t LTR; /*!< ADC watchdog lower threshold register, Address offset: 0x2C */
  161. __IO uint32_t SQR1; /*!< ADC regular sequence register 1, Address offset: 0x30 */
  162. __IO uint32_t SQR2; /*!< ADC regular sequence register 2, Address offset: 0x34 */
  163. __IO uint32_t SQR3; /*!< ADC regular sequence register 3, Address offset: 0x38 */
  164. __IO uint32_t SQR4; /*!< ADC regular sequence register 4, Address offset: 0x3C */
  165. __IO uint32_t SQR5; /*!< ADC regular sequence register 5, Address offset: 0x40 */
  166. __IO uint32_t JSQR; /*!< ADC injected sequence register, Address offset: 0x44 */
  167. __IO uint32_t JDR1; /*!< ADC injected data register 1, Address offset: 0x48 */
  168. __IO uint32_t JDR2; /*!< ADC injected data register 2, Address offset: 0x4C */
  169. __IO uint32_t JDR3; /*!< ADC injected data register 3, Address offset: 0x50 */
  170. __IO uint32_t JDR4; /*!< ADC injected data register 4, Address offset: 0x54 */
  171. __IO uint32_t DR; /*!< ADC regular data register, Address offset: 0x58 */
  172. uint32_t RESERVED; /*!< Reserved, Address offset: 0x5C */
  173. } ADC_TypeDef;
  174. typedef struct
  175. {
  176. __IO uint32_t CSR; /*!< ADC common status register, Address offset: ADC1 base address + 0x300 */
  177. __IO uint32_t CCR; /*!< ADC common control register, Address offset: ADC1 base address + 0x304 */
  178. } ADC_Common_TypeDef;
  179. /**
  180. * @brief Comparator
  181. */
  182. typedef struct
  183. {
  184. __IO uint32_t CSR; /*!< COMP comparator control and status register, Address offset: 0x00 */
  185. } COMP_TypeDef;
  186. /**
  187. * @brief CRC calculation unit
  188. */
  189. typedef struct
  190. {
  191. __IO uint32_t DR; /*!< CRC Data register, Address offset: 0x00 */
  192. __IO uint32_t IDR; /*!< CRC Independent data register, Address offset: 0x04 */
  193. __IO uint32_t CR; /*!< CRC Control register, Address offset: 0x08 */
  194. } CRC_TypeDef;
  195. /**
  196. * @brief Digital to Analog Converter
  197. */
  198. typedef struct
  199. {
  200. __IO uint32_t CR; /*!< DAC control register, Address offset: 0x00 */
  201. __IO uint32_t SWTRIGR; /*!< DAC software trigger register, Address offset: 0x04 */
  202. __IO uint32_t DHR12R1; /*!< DAC channel1 12-bit right-aligned data holding register, Address offset: 0x08 */
  203. __IO uint32_t DHR12L1; /*!< DAC channel1 12-bit left aligned data holding register, Address offset: 0x0C */
  204. __IO uint32_t DHR8R1; /*!< DAC channel1 8-bit right aligned data holding register, Address offset: 0x10 */
  205. __IO uint32_t DHR12R2; /*!< DAC channel2 12-bit right aligned data holding register, Address offset: 0x14 */
  206. __IO uint32_t DHR12L2; /*!< DAC channel2 12-bit left aligned data holding register, Address offset: 0x18 */
  207. __IO uint32_t DHR8R2; /*!< DAC channel2 8-bit right-aligned data holding register, Address offset: 0x1C */
  208. __IO uint32_t DHR12RD; /*!< Dual DAC 12-bit right-aligned data holding register, Address offset: 0x20 */
  209. __IO uint32_t DHR12LD; /*!< DUAL DAC 12-bit left aligned data holding register, Address offset: 0x24 */
  210. __IO uint32_t DHR8RD; /*!< DUAL DAC 8-bit right aligned data holding register, Address offset: 0x28 */
  211. __IO uint32_t DOR1; /*!< DAC channel1 data output register, Address offset: 0x2C */
  212. __IO uint32_t DOR2; /*!< DAC channel2 data output register, Address offset: 0x30 */
  213. __IO uint32_t SR; /*!< DAC status register, Address offset: 0x34 */
  214. } DAC_TypeDef;
  215. /**
  216. * @brief Debug MCU
  217. */
  218. typedef struct
  219. {
  220. __IO uint32_t IDCODE; /*!< MCU device ID code, Address offset: 0x00 */
  221. __IO uint32_t CR; /*!< Debug MCU configuration register, Address offset: 0x04 */
  222. __IO uint32_t APB1FZ; /*!< Debug MCU APB1 freeze register, Address offset: 0x08 */
  223. __IO uint32_t APB2FZ; /*!< Debug MCU APB2 freeze register, Address offset: 0x0C */
  224. }DBGMCU_TypeDef;
  225. /**
  226. * @brief DMA Controller
  227. */
  228. typedef struct
  229. {
  230. __IO uint32_t CCR; /*!< DMA channel x configuration register */
  231. __IO uint32_t CNDTR; /*!< DMA channel x number of data register */
  232. __IO uint32_t CPAR; /*!< DMA channel x peripheral address register */
  233. __IO uint32_t CMAR; /*!< DMA channel x memory address register */
  234. } DMA_Channel_TypeDef;
  235. typedef struct
  236. {
  237. __IO uint32_t ISR; /*!< DMA interrupt status register, Address offset: 0x00 */
  238. __IO uint32_t IFCR; /*!< DMA interrupt flag clear register, Address offset: 0x04 */
  239. } DMA_TypeDef;
  240. /**
  241. * @brief External Interrupt/Event Controller
  242. */
  243. typedef struct
  244. {
  245. __IO uint32_t IMR; /*!<EXTI Interrupt mask register, Address offset: 0x00 */
  246. __IO uint32_t EMR; /*!<EXTI Event mask register, Address offset: 0x04 */
  247. __IO uint32_t RTSR; /*!<EXTI Rising trigger selection register , Address offset: 0x08 */
  248. __IO uint32_t FTSR; /*!<EXTI Falling trigger selection register, Address offset: 0x0C */
  249. __IO uint32_t SWIER; /*!<EXTI Software interrupt event register, Address offset: 0x10 */
  250. __IO uint32_t PR; /*!<EXTI Pending register, Address offset: 0x14 */
  251. } EXTI_TypeDef;
  252. /**
  253. * @brief FLASH Registers
  254. */
  255. typedef struct
  256. {
  257. __IO uint32_t ACR; /*!< Access control register, Address offset: 0x00 */
  258. __IO uint32_t PECR; /*!< Program/erase control register, Address offset: 0x04 */
  259. __IO uint32_t PDKEYR; /*!< Power down key register, Address offset: 0x08 */
  260. __IO uint32_t PEKEYR; /*!< Program/erase key register, Address offset: 0x0c */
  261. __IO uint32_t PRGKEYR; /*!< Program memory key register, Address offset: 0x10 */
  262. __IO uint32_t OPTKEYR; /*!< Option byte key register, Address offset: 0x14 */
  263. __IO uint32_t SR; /*!< Status register, Address offset: 0x18 */
  264. __IO uint32_t OBR; /*!< Option byte register, Address offset: 0x1c */
  265. __IO uint32_t WRPR1; /*!< Write protection register 1, Address offset: 0x20 */
  266. } FLASH_TypeDef;
  267. /**
  268. * @brief Option Bytes Registers
  269. */
  270. typedef struct
  271. {
  272. __IO uint32_t RDP; /*!< Read protection register, Address offset: 0x00 */
  273. __IO uint32_t USER; /*!< user register, Address offset: 0x04 */
  274. __IO uint32_t WRP01; /*!< write protection register 0 1, Address offset: 0x08 */
  275. __IO uint32_t WRP23; /*!< write protection register 2 3, Address offset: 0x0C */
  276. } OB_TypeDef;
  277. /**
  278. * @brief General Purpose IO
  279. */
  280. typedef struct
  281. {
  282. __IO uint32_t MODER; /*!< GPIO port mode register, Address offset: 0x00 */
  283. __IO uint32_t OTYPER; /*!< GPIO port output type register, Address offset: 0x04 */
  284. __IO uint32_t OSPEEDR; /*!< GPIO port output speed register, Address offset: 0x08 */
  285. __IO uint32_t PUPDR; /*!< GPIO port pull-up/pull-down register, Address offset: 0x0C */
  286. __IO uint32_t IDR; /*!< GPIO port input data register, Address offset: 0x10 */
  287. __IO uint32_t ODR; /*!< GPIO port output data register, Address offset: 0x14 */
  288. __IO uint32_t BSRR; /*!< GPIO port bit set/reset registerBSRR, Address offset: 0x18 */
  289. __IO uint32_t LCKR; /*!< GPIO port configuration lock register, Address offset: 0x1C */
  290. __IO uint32_t AFR[2]; /*!< GPIO alternate function register, Address offset: 0x20-0x24 */
  291. } GPIO_TypeDef;
  292. /**
  293. * @brief SysTem Configuration
  294. */
  295. typedef struct
  296. {
  297. __IO uint32_t MEMRMP; /*!< SYSCFG memory remap register, Address offset: 0x00 */
  298. __IO uint32_t PMC; /*!< SYSCFG peripheral mode configuration register, Address offset: 0x04 */
  299. __IO uint32_t EXTICR[4]; /*!< SYSCFG external interrupt configuration registers, Address offset: 0x08-0x14 */
  300. } SYSCFG_TypeDef;
  301. /**
  302. * @brief Inter-integrated Circuit Interface
  303. */
  304. typedef struct
  305. {
  306. __IO uint32_t CR1; /*!< I2C Control register 1, Address offset: 0x00 */
  307. __IO uint32_t CR2; /*!< I2C Control register 2, Address offset: 0x04 */
  308. __IO uint32_t OAR1; /*!< I2C Own address register 1, Address offset: 0x08 */
  309. __IO uint32_t OAR2; /*!< I2C Own address register 2, Address offset: 0x0C */
  310. __IO uint32_t DR; /*!< I2C Data register, Address offset: 0x10 */
  311. __IO uint32_t SR1; /*!< I2C Status register 1, Address offset: 0x14 */
  312. __IO uint32_t SR2; /*!< I2C Status register 2, Address offset: 0x18 */
  313. __IO uint32_t CCR; /*!< I2C Clock control register, Address offset: 0x1C */
  314. __IO uint32_t TRISE; /*!< I2C TRISE register, Address offset: 0x20 */
  315. } I2C_TypeDef;
  316. /**
  317. * @brief Independent WATCHDOG
  318. */
  319. typedef struct
  320. {
  321. __IO uint32_t KR; /*!< Key register, Address offset: 0x00 */
  322. __IO uint32_t PR; /*!< Prescaler register, Address offset: 0x04 */
  323. __IO uint32_t RLR; /*!< Reload register, Address offset: 0x08 */
  324. __IO uint32_t SR; /*!< Status register, Address offset: 0x0C */
  325. } IWDG_TypeDef;
  326. /**
  327. * @brief LCD
  328. */
  329. typedef struct
  330. {
  331. __IO uint32_t CR; /*!< LCD control register, Address offset: 0x00 */
  332. __IO uint32_t FCR; /*!< LCD frame control register, Address offset: 0x04 */
  333. __IO uint32_t SR; /*!< LCD status register, Address offset: 0x08 */
  334. __IO uint32_t CLR; /*!< LCD clear register, Address offset: 0x0C */
  335. uint32_t RESERVED; /*!< Reserved, Address offset: 0x10 */
  336. __IO uint32_t RAM[16]; /*!< LCD display memory, Address offset: 0x14-0x50 */
  337. } LCD_TypeDef;
  338. /**
  339. * @brief Power Control
  340. */
  341. typedef struct
  342. {
  343. __IO uint32_t CR; /*!< PWR power control register, Address offset: 0x00 */
  344. __IO uint32_t CSR; /*!< PWR power control/status register, Address offset: 0x04 */
  345. } PWR_TypeDef;
  346. /**
  347. * @brief Reset and Clock Control
  348. */
  349. typedef struct
  350. {
  351. __IO uint32_t CR; /*!< RCC clock control register, Address offset: 0x00 */
  352. __IO uint32_t ICSCR; /*!< RCC Internal clock sources calibration register, Address offset: 0x04 */
  353. __IO uint32_t CFGR; /*!< RCC Clock configuration register, Address offset: 0x08 */
  354. __IO uint32_t CIR; /*!< RCC Clock interrupt register, Address offset: 0x0C */
  355. __IO uint32_t AHBRSTR; /*!< RCC AHB peripheral reset register, Address offset: 0x10 */
  356. __IO uint32_t APB2RSTR; /*!< RCC APB2 peripheral reset register, Address offset: 0x14 */
  357. __IO uint32_t APB1RSTR; /*!< RCC APB1 peripheral reset register, Address offset: 0x18 */
  358. __IO uint32_t AHBENR; /*!< RCC AHB peripheral clock enable register, Address offset: 0x1C */
  359. __IO uint32_t APB2ENR; /*!< RCC APB2 peripheral clock enable register, Address offset: 0x20 */
  360. __IO uint32_t APB1ENR; /*!< RCC APB1 peripheral clock enable register, Address offset: 0x24 */
  361. __IO uint32_t AHBLPENR; /*!< RCC AHB peripheral clock enable in low power mode register, Address offset: 0x28 */
  362. __IO uint32_t APB2LPENR; /*!< RCC APB2 peripheral clock enable in low power mode register, Address offset: 0x2C */
  363. __IO uint32_t APB1LPENR; /*!< RCC APB1 peripheral clock enable in low power mode register, Address offset: 0x30 */
  364. __IO uint32_t CSR; /*!< RCC Control/status register, Address offset: 0x34 */
  365. } RCC_TypeDef;
  366. /**
  367. * @brief Routing Interface
  368. */
  369. typedef struct
  370. {
  371. __IO uint32_t ICR; /*!< RI input capture register, Address offset: 0x00 */
  372. __IO uint32_t ASCR1; /*!< RI analog switches control register, Address offset: 0x04 */
  373. __IO uint32_t ASCR2; /*!< RI analog switch control register 2, Address offset: 0x08 */
  374. __IO uint32_t HYSCR1; /*!< RI hysteresis control register, Address offset: 0x0C */
  375. __IO uint32_t HYSCR2; /*!< RI Hysteresis control register, Address offset: 0x10 */
  376. } RI_TypeDef;
  377. /**
  378. * @brief Real-Time Clock
  379. */
  380. typedef struct
  381. {
  382. __IO uint32_t TR; /*!< RTC time register, Address offset: 0x00 */
  383. __IO uint32_t DR; /*!< RTC date register, Address offset: 0x04 */
  384. __IO uint32_t CR; /*!< RTC control register, Address offset: 0x08 */
  385. __IO uint32_t ISR; /*!< RTC initialization and status register, Address offset: 0x0C */
  386. __IO uint32_t PRER; /*!< RTC prescaler register, Address offset: 0x10 */
  387. __IO uint32_t WUTR; /*!< RTC wakeup timer register, Address offset: 0x14 */
  388. __IO uint32_t CALIBR; /*!< RTC calibration register, Address offset: 0x18 */
  389. __IO uint32_t ALRMAR; /*!< RTC alarm A register, Address offset: 0x1C */
  390. __IO uint32_t ALRMBR; /*!< RTC alarm B register, Address offset: 0x20 */
  391. __IO uint32_t WPR; /*!< RTC write protection register, Address offset: 0x24 */
  392. __IO uint32_t SSR; /*!< RTC sub second register, Address offset: 0x28 */
  393. __IO uint32_t SHIFTR; /*!< RTC shift control register, Address offset: 0x2C */
  394. __IO uint32_t TSTR; /*!< RTC time stamp time register, Address offset: 0x30 */
  395. __IO uint32_t TSDR; /*!< RTC time stamp date register, Address offset: 0x34 */
  396. __IO uint32_t TSSSR; /*!< RTC time-stamp sub second register, Address offset: 0x38 */
  397. __IO uint32_t CALR; /*!< RRTC calibration register, Address offset: 0x3C */
  398. __IO uint32_t TAFCR; /*!< RTC tamper and alternate function configuration register, Address offset: 0x40 */
  399. __IO uint32_t ALRMASSR; /*!< RTC alarm A sub second register, Address offset: 0x44 */
  400. __IO uint32_t ALRMBSSR; /*!< RTC alarm B sub second register, Address offset: 0x48 */
  401. uint32_t RESERVED7; /*!< Reserved, 0x4C */
  402. __IO uint32_t BKP0R; /*!< RTC backup register 0, Address offset: 0x50 */
  403. __IO uint32_t BKP1R; /*!< RTC backup register 1, Address offset: 0x54 */
  404. __IO uint32_t BKP2R; /*!< RTC backup register 2, Address offset: 0x58 */
  405. __IO uint32_t BKP3R; /*!< RTC backup register 3, Address offset: 0x5C */
  406. __IO uint32_t BKP4R; /*!< RTC backup register 4, Address offset: 0x60 */
  407. } RTC_TypeDef;
  408. /**
  409. * @brief Serial Peripheral Interface
  410. */
  411. typedef struct
  412. {
  413. __IO uint32_t CR1; /*!< SPI Control register 1 Address offset: 0x00 */
  414. __IO uint32_t CR2; /*!< SPI Control register 2, Address offset: 0x04 */
  415. __IO uint32_t SR; /*!< SPI Status register, Address offset: 0x08 */
  416. __IO uint32_t DR; /*!< SPI data register, Address offset: 0x0C */
  417. __IO uint32_t CRCPR; /*!< SPI CRC polynomial register Address offset: 0x10 */
  418. __IO uint32_t RXCRCR; /*!< SPI Rx CRC register Address offset: 0x14 */
  419. __IO uint32_t TXCRCR; /*!< SPI Tx CRC register Address offset: 0x18 */
  420. } SPI_TypeDef;
  421. /**
  422. * @brief TIM
  423. */
  424. typedef struct
  425. {
  426. __IO uint32_t CR1; /*!< TIM control register 1, Address offset: 0x00 */
  427. __IO uint32_t CR2; /*!< TIM control register 2, Address offset: 0x04 */
  428. __IO uint32_t SMCR; /*!< TIM slave Mode Control register, Address offset: 0x08 */
  429. __IO uint32_t DIER; /*!< TIM DMA/interrupt enable register, Address offset: 0x0C */
  430. __IO uint32_t SR; /*!< TIM status register, Address offset: 0x10 */
  431. __IO uint32_t EGR; /*!< TIM event generation register, Address offset: 0x14 */
  432. __IO uint32_t CCMR1; /*!< TIM capture/compare mode register 1, Address offset: 0x18 */
  433. __IO uint32_t CCMR2; /*!< TIM capture/compare mode register 2, Address offset: 0x1C */
  434. __IO uint32_t CCER; /*!< TIM capture/compare enable register, Address offset: 0x20 */
  435. __IO uint32_t CNT; /*!< TIM counter register, Address offset: 0x24 */
  436. __IO uint32_t PSC; /*!< TIM prescaler register, Address offset: 0x28 */
  437. __IO uint32_t ARR; /*!< TIM auto-reload register, Address offset: 0x2C */
  438. uint32_t RESERVED12; /*!< Reserved, 0x30 */
  439. __IO uint32_t CCR1; /*!< TIM capture/compare register 1, Address offset: 0x34 */
  440. __IO uint32_t CCR2; /*!< TIM capture/compare register 2, Address offset: 0x38 */
  441. __IO uint32_t CCR3; /*!< TIM capture/compare register 3, Address offset: 0x3C */
  442. __IO uint32_t CCR4; /*!< TIM capture/compare register 4, Address offset: 0x40 */
  443. uint32_t RESERVED17; /*!< Reserved, 0x44 */
  444. __IO uint32_t DCR; /*!< TIM DMA control register, Address offset: 0x48 */
  445. __IO uint32_t DMAR; /*!< TIM DMA address for full transfer, Address offset: 0x4C */
  446. __IO uint32_t OR; /*!< TIM option register, Address offset: 0x50 */
  447. } TIM_TypeDef;
  448. /**
  449. * @brief Universal Synchronous Asynchronous Receiver Transmitter
  450. */
  451. typedef struct
  452. {
  453. __IO uint32_t SR; /*!< USART Status register, Address offset: 0x00 */
  454. __IO uint32_t DR; /*!< USART Data register, Address offset: 0x04 */
  455. __IO uint32_t BRR; /*!< USART Baud rate register, Address offset: 0x08 */
  456. __IO uint32_t CR1; /*!< USART Control register 1, Address offset: 0x0C */
  457. __IO uint32_t CR2; /*!< USART Control register 2, Address offset: 0x10 */
  458. __IO uint32_t CR3; /*!< USART Control register 3, Address offset: 0x14 */
  459. __IO uint32_t GTPR; /*!< USART Guard time and prescaler register, Address offset: 0x18 */
  460. } USART_TypeDef;
  461. /**
  462. * @brief Universal Serial Bus Full Speed Device
  463. */
  464. typedef struct
  465. {
  466. __IO uint16_t EP0R; /*!< USB Endpoint 0 register, Address offset: 0x00 */
  467. __IO uint16_t RESERVED0; /*!< Reserved */
  468. __IO uint16_t EP1R; /*!< USB Endpoint 1 register, Address offset: 0x04 */
  469. __IO uint16_t RESERVED1; /*!< Reserved */
  470. __IO uint16_t EP2R; /*!< USB Endpoint 2 register, Address offset: 0x08 */
  471. __IO uint16_t RESERVED2; /*!< Reserved */
  472. __IO uint16_t EP3R; /*!< USB Endpoint 3 register, Address offset: 0x0C */
  473. __IO uint16_t RESERVED3; /*!< Reserved */
  474. __IO uint16_t EP4R; /*!< USB Endpoint 4 register, Address offset: 0x10 */
  475. __IO uint16_t RESERVED4; /*!< Reserved */
  476. __IO uint16_t EP5R; /*!< USB Endpoint 5 register, Address offset: 0x14 */
  477. __IO uint16_t RESERVED5; /*!< Reserved */
  478. __IO uint16_t EP6R; /*!< USB Endpoint 6 register, Address offset: 0x18 */
  479. __IO uint16_t RESERVED6; /*!< Reserved */
  480. __IO uint16_t EP7R; /*!< USB Endpoint 7 register, Address offset: 0x1C */
  481. __IO uint16_t RESERVED7[17]; /*!< Reserved */
  482. __IO uint16_t CNTR; /*!< Control register, Address offset: 0x40 */
  483. __IO uint16_t RESERVED8; /*!< Reserved */
  484. __IO uint16_t ISTR; /*!< Interrupt status register, Address offset: 0x44 */
  485. __IO uint16_t RESERVED9; /*!< Reserved */
  486. __IO uint16_t FNR; /*!< Frame number register, Address offset: 0x48 */
  487. __IO uint16_t RESERVEDA; /*!< Reserved */
  488. __IO uint16_t DADDR; /*!< Device address register, Address offset: 0x4C */
  489. __IO uint16_t RESERVEDB; /*!< Reserved */
  490. __IO uint16_t BTABLE; /*!< Buffer Table address register, Address offset: 0x50 */
  491. __IO uint16_t RESERVEDC; /*!< Reserved */
  492. } USB_TypeDef;
  493. /**
  494. * @brief Window WATCHDOG
  495. */
  496. typedef struct
  497. {
  498. __IO uint32_t CR; /*!< WWDG Control register, Address offset: 0x00 */
  499. __IO uint32_t CFR; /*!< WWDG Configuration register, Address offset: 0x04 */
  500. __IO uint32_t SR; /*!< WWDG Status register, Address offset: 0x08 */
  501. } WWDG_TypeDef;
  502. /**
  503. * @brief Universal Serial Bus Full Speed Device
  504. */
  505. /**
  506. * @}
  507. */
  508. /** @addtogroup Peripheral_memory_map
  509. * @{
  510. */
  511. #define FLASH_BASE ((uint32_t)0x08000000) /*!< FLASH base address in the alias region */
  512. #define FLASH_EEPROM_BASE ((uint32_t)(FLASH_BASE + 0x80000)) /*!< FLASH EEPROM base address in the alias region */
  513. #define SRAM_BASE ((uint32_t)0x20000000) /*!< SRAM base address in the alias region */
  514. #define PERIPH_BASE ((uint32_t)0x40000000) /*!< Peripheral base address in the alias region */
  515. #define SRAM_BB_BASE ((uint32_t)0x22000000) /*!< SRAM base address in the bit-band region */
  516. #define PERIPH_BB_BASE ((uint32_t)0x42000000) /*!< Peripheral base address in the bit-band region */
  517. #define FLASH_END ((uint32_t)0x0801FFFF) /*!< Program end FLASH address for Cat1 & Cat2 */
  518. #define FLASH_EEPROM_END ((uint32_t)0x080807FF) /*!< FLASH EEPROM end address (2KB) */
  519. /*!< Peripheral memory map */
  520. #define APB1PERIPH_BASE PERIPH_BASE
  521. #define APB2PERIPH_BASE (PERIPH_BASE + 0x00010000)
  522. #define AHBPERIPH_BASE (PERIPH_BASE + 0x00020000)
  523. /*!< APB1 peripherals */
  524. #define TIM2_BASE (APB1PERIPH_BASE + 0x00000000)
  525. #define TIM3_BASE (APB1PERIPH_BASE + 0x00000400)
  526. #define TIM4_BASE (APB1PERIPH_BASE + 0x00000800)
  527. #define TIM6_BASE (APB1PERIPH_BASE + 0x00001000)
  528. #define TIM7_BASE (APB1PERIPH_BASE + 0x00001400)
  529. #define LCD_BASE (APB1PERIPH_BASE + 0x00002400)
  530. #define RTC_BASE (APB1PERIPH_BASE + 0x00002800)
  531. #define WWDG_BASE (APB1PERIPH_BASE + 0x00002C00)
  532. #define IWDG_BASE (APB1PERIPH_BASE + 0x00003000)
  533. #define SPI2_BASE (APB1PERIPH_BASE + 0x00003800)
  534. #define USART2_BASE (APB1PERIPH_BASE + 0x00004400)
  535. #define USART3_BASE (APB1PERIPH_BASE + 0x00004800)
  536. #define I2C1_BASE (APB1PERIPH_BASE + 0x00005400)
  537. #define I2C2_BASE (APB1PERIPH_BASE + 0x00005800)
  538. /* USB device FS */
  539. #define USB_BASE (APB1PERIPH_BASE + 0x00005C00) /*!< USB_IP Peripheral Registers base address */
  540. #define USB_PMAADDR (APB1PERIPH_BASE + 0x00006000) /*!< USB_IP Packet Memory Area base address */
  541. /* USB device FS SRAM */
  542. #define PWR_BASE (APB1PERIPH_BASE + 0x00007000)
  543. #define DAC_BASE (APB1PERIPH_BASE + 0x00007400)
  544. #define COMP_BASE (APB1PERIPH_BASE + 0x00007C00)
  545. #define RI_BASE (APB1PERIPH_BASE + 0x00007C04)
  546. /*!< APB2 peripherals */
  547. #define SYSCFG_BASE (APB2PERIPH_BASE + 0x00000000)
  548. #define EXTI_BASE (APB2PERIPH_BASE + 0x00000400)
  549. #define TIM9_BASE (APB2PERIPH_BASE + 0x00000800)
  550. #define TIM10_BASE (APB2PERIPH_BASE + 0x00000C00)
  551. #define TIM11_BASE (APB2PERIPH_BASE + 0x00001000)
  552. #define ADC1_BASE (APB2PERIPH_BASE + 0x00002400)
  553. #define ADC_BASE (APB2PERIPH_BASE + 0x00002700)
  554. #define SPI1_BASE (APB2PERIPH_BASE + 0x00003000)
  555. #define USART1_BASE (APB2PERIPH_BASE + 0x00003800)
  556. /*!< AHB peripherals */
  557. #define GPIOA_BASE (AHBPERIPH_BASE + 0x00000000)
  558. #define GPIOB_BASE (AHBPERIPH_BASE + 0x00000400)
  559. #define GPIOC_BASE (AHBPERIPH_BASE + 0x00000800)
  560. #define GPIOD_BASE (AHBPERIPH_BASE + 0x00000C00)
  561. #define GPIOH_BASE (AHBPERIPH_BASE + 0x00001400)
  562. #define CRC_BASE (AHBPERIPH_BASE + 0x00003000)
  563. #define RCC_BASE (AHBPERIPH_BASE + 0x00003800)
  564. #define FLASH_R_BASE (AHBPERIPH_BASE + 0x00003C00) /*!< FLASH registers base address */
  565. #define OB_BASE ((uint32_t)0x1FF80000) /*!< FLASH Option Bytes base address */
  566. #define DMA1_BASE (AHBPERIPH_BASE + 0x00006000)
  567. #define DMA1_Channel1_BASE (DMA1_BASE + 0x00000008)
  568. #define DMA1_Channel2_BASE (DMA1_BASE + 0x0000001C)
  569. #define DMA1_Channel3_BASE (DMA1_BASE + 0x00000030)
  570. #define DMA1_Channel4_BASE (DMA1_BASE + 0x00000044)
  571. #define DMA1_Channel5_BASE (DMA1_BASE + 0x00000058)
  572. #define DMA1_Channel6_BASE (DMA1_BASE + 0x0000006C)
  573. #define DMA1_Channel7_BASE (DMA1_BASE + 0x00000080)
  574. #define DBGMCU_BASE ((uint32_t)0xE0042000) /*!< Debug MCU registers base address */
  575. /**
  576. * @}
  577. */
  578. /** @addtogroup Peripheral_declaration
  579. * @{
  580. */
  581. #define TIM2 ((TIM_TypeDef *) TIM2_BASE)
  582. #define TIM3 ((TIM_TypeDef *) TIM3_BASE)
  583. #define TIM4 ((TIM_TypeDef *) TIM4_BASE)
  584. #define TIM6 ((TIM_TypeDef *) TIM6_BASE)
  585. #define TIM7 ((TIM_TypeDef *) TIM7_BASE)
  586. #define LCD ((LCD_TypeDef *) LCD_BASE)
  587. #define RTC ((RTC_TypeDef *) RTC_BASE)
  588. #define WWDG ((WWDG_TypeDef *) WWDG_BASE)
  589. #define IWDG ((IWDG_TypeDef *) IWDG_BASE)
  590. #define SPI2 ((SPI_TypeDef *) SPI2_BASE)
  591. #define USART2 ((USART_TypeDef *) USART2_BASE)
  592. #define USART3 ((USART_TypeDef *) USART3_BASE)
  593. #define I2C1 ((I2C_TypeDef *) I2C1_BASE)
  594. #define I2C2 ((I2C_TypeDef *) I2C2_BASE)
  595. /* USB device FS */
  596. #define USB ((USB_TypeDef *) USB_BASE)
  597. /* USB device FS SRAM */
  598. #define PWR ((PWR_TypeDef *) PWR_BASE)
  599. #define DAC ((DAC_TypeDef *) DAC_BASE)
  600. #define COMP ((COMP_TypeDef *) COMP_BASE)
  601. #define COMP1 ((COMP_TypeDef *) COMP_BASE)
  602. #define COMP2 ((COMP_TypeDef *) (COMP_BASE + 0x00000001))
  603. #define RI ((RI_TypeDef *) RI_BASE)
  604. #define SYSCFG ((SYSCFG_TypeDef *) SYSCFG_BASE)
  605. #define EXTI ((EXTI_TypeDef *) EXTI_BASE)
  606. #define TIM9 ((TIM_TypeDef *) TIM9_BASE)
  607. #define TIM10 ((TIM_TypeDef *) TIM10_BASE)
  608. #define TIM11 ((TIM_TypeDef *) TIM11_BASE)
  609. #define ADC1 ((ADC_TypeDef *) ADC1_BASE)
  610. #define ADC ((ADC_Common_TypeDef *) ADC_BASE)
  611. #define SPI1 ((SPI_TypeDef *) SPI1_BASE)
  612. #define USART1 ((USART_TypeDef *) USART1_BASE)
  613. #define GPIOA ((GPIO_TypeDef *) GPIOA_BASE)
  614. #define GPIOB ((GPIO_TypeDef *) GPIOB_BASE)
  615. #define GPIOC ((GPIO_TypeDef *) GPIOC_BASE)
  616. #define GPIOD ((GPIO_TypeDef *) GPIOD_BASE)
  617. #define GPIOH ((GPIO_TypeDef *) GPIOH_BASE)
  618. #define CRC ((CRC_TypeDef *) CRC_BASE)
  619. #define RCC ((RCC_TypeDef *) RCC_BASE)
  620. #define FLASH ((FLASH_TypeDef *) FLASH_R_BASE)
  621. #define OB ((OB_TypeDef *) OB_BASE)
  622. #define DMA1 ((DMA_TypeDef *) DMA1_BASE)
  623. #define DMA1_Channel1 ((DMA_Channel_TypeDef *) DMA1_Channel1_BASE)
  624. #define DMA1_Channel2 ((DMA_Channel_TypeDef *) DMA1_Channel2_BASE)
  625. #define DMA1_Channel3 ((DMA_Channel_TypeDef *) DMA1_Channel3_BASE)
  626. #define DMA1_Channel4 ((DMA_Channel_TypeDef *) DMA1_Channel4_BASE)
  627. #define DMA1_Channel5 ((DMA_Channel_TypeDef *) DMA1_Channel5_BASE)
  628. #define DMA1_Channel6 ((DMA_Channel_TypeDef *) DMA1_Channel6_BASE)
  629. #define DMA1_Channel7 ((DMA_Channel_TypeDef *) DMA1_Channel7_BASE)
  630. #define DBGMCU ((DBGMCU_TypeDef *) DBGMCU_BASE)
  631. /**
  632. * @}
  633. */
  634. /** @addtogroup Exported_constants
  635. * @{
  636. */
  637. /** @addtogroup Peripheral_Registers_Bits_Definition
  638. * @{
  639. */
  640. /******************************************************************************/
  641. /* Peripheral Registers Bits Definition */
  642. /******************************************************************************/
  643. /******************************************************************************/
  644. /* */
  645. /* Analog to Digital Converter (ADC) */
  646. /* */
  647. /******************************************************************************/
  648. /******************** Bit definition for ADC_SR register ********************/
  649. #define ADC_SR_AWD ((uint32_t)0x00000001) /*!< Analog watchdog flag */
  650. #define ADC_SR_EOC ((uint32_t)0x00000002) /*!< End of conversion */
  651. #define ADC_SR_JEOC ((uint32_t)0x00000004) /*!< Injected channel end of conversion */
  652. #define ADC_SR_JSTRT ((uint32_t)0x00000008) /*!< Injected channel Start flag */
  653. #define ADC_SR_STRT ((uint32_t)0x00000010) /*!< Regular channel Start flag */
  654. #define ADC_SR_OVR ((uint32_t)0x00000020) /*!< Overrun flag */
  655. #define ADC_SR_ADONS ((uint32_t)0x00000040) /*!< ADC ON status */
  656. #define ADC_SR_RCNR ((uint32_t)0x00000100) /*!< Regular channel not ready flag */
  657. #define ADC_SR_JCNR ((uint32_t)0x00000200) /*!< Injected channel not ready flag */
  658. /******************* Bit definition for ADC_CR1 register ********************/
  659. #define ADC_CR1_AWDCH ((uint32_t)0x0000001F) /*!< AWDCH[4:0] bits (Analog watchdog channel select bits) */
  660. #define ADC_CR1_AWDCH_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  661. #define ADC_CR1_AWDCH_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  662. #define ADC_CR1_AWDCH_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  663. #define ADC_CR1_AWDCH_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  664. #define ADC_CR1_AWDCH_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  665. #define ADC_CR1_EOCIE ((uint32_t)0x00000020) /*!< Interrupt enable for EOC */
  666. #define ADC_CR1_AWDIE ((uint32_t)0x00000040) /*!< Analog Watchdog interrupt enable */
  667. #define ADC_CR1_JEOCIE ((uint32_t)0x00000080) /*!< Interrupt enable for injected channels */
  668. #define ADC_CR1_SCAN ((uint32_t)0x00000100) /*!< Scan mode */
  669. #define ADC_CR1_AWDSGL ((uint32_t)0x00000200) /*!< Enable the watchdog on a single channel in scan mode */
  670. #define ADC_CR1_JAUTO ((uint32_t)0x00000400) /*!< Automatic injected group conversion */
  671. #define ADC_CR1_DISCEN ((uint32_t)0x00000800) /*!< Discontinuous mode on regular channels */
  672. #define ADC_CR1_JDISCEN ((uint32_t)0x00001000) /*!< Discontinuous mode on injected channels */
  673. #define ADC_CR1_DISCNUM ((uint32_t)0x0000E000) /*!< DISCNUM[2:0] bits (Discontinuous mode channel count) */
  674. #define ADC_CR1_DISCNUM_0 ((uint32_t)0x00002000) /*!< Bit 0 */
  675. #define ADC_CR1_DISCNUM_1 ((uint32_t)0x00004000) /*!< Bit 1 */
  676. #define ADC_CR1_DISCNUM_2 ((uint32_t)0x00008000) /*!< Bit 2 */
  677. #define ADC_CR1_PDD ((uint32_t)0x00010000) /*!< Power Down during Delay phase */
  678. #define ADC_CR1_PDI ((uint32_t)0x00020000) /*!< Power Down during Idle phase */
  679. #define ADC_CR1_JAWDEN ((uint32_t)0x00400000) /*!< Analog watchdog enable on injected channels */
  680. #define ADC_CR1_AWDEN ((uint32_t)0x00800000) /*!< Analog watchdog enable on regular channels */
  681. #define ADC_CR1_RES ((uint32_t)0x03000000) /*!< RES[1:0] bits (Resolution) */
  682. #define ADC_CR1_RES_0 ((uint32_t)0x01000000) /*!< Bit 0 */
  683. #define ADC_CR1_RES_1 ((uint32_t)0x02000000) /*!< Bit 1 */
  684. #define ADC_CR1_OVRIE ((uint32_t)0x04000000) /*!< Overrun interrupt enable */
  685. /******************* Bit definition for ADC_CR2 register ********************/
  686. #define ADC_CR2_ADON ((uint32_t)0x00000001) /*!< A/D Converter ON / OFF */
  687. #define ADC_CR2_CONT ((uint32_t)0x00000002) /*!< Continuous Conversion */
  688. #define ADC_CR2_DELS ((uint32_t)0x00000070) /*!< DELS[2:0] bits (Delay selection) */
  689. #define ADC_CR2_DELS_0 ((uint32_t)0x00000010) /*!< Bit 0 */
  690. #define ADC_CR2_DELS_1 ((uint32_t)0x00000020) /*!< Bit 1 */
  691. #define ADC_CR2_DELS_2 ((uint32_t)0x00000040) /*!< Bit 2 */
  692. #define ADC_CR2_DMA ((uint32_t)0x00000100) /*!< Direct Memory access mode */
  693. #define ADC_CR2_DDS ((uint32_t)0x00000200) /*!< DMA disable selection (Single ADC) */
  694. #define ADC_CR2_EOCS ((uint32_t)0x00000400) /*!< End of conversion selection */
  695. #define ADC_CR2_ALIGN ((uint32_t)0x00000800) /*!< Data Alignment */
  696. #define ADC_CR2_JEXTSEL ((uint32_t)0x000F0000) /*!< JEXTSEL[3:0] bits (External event select for injected group) */
  697. #define ADC_CR2_JEXTSEL_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  698. #define ADC_CR2_JEXTSEL_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  699. #define ADC_CR2_JEXTSEL_2 ((uint32_t)0x00040000) /*!< Bit 2 */
  700. #define ADC_CR2_JEXTSEL_3 ((uint32_t)0x00080000) /*!< Bit 3 */
  701. #define ADC_CR2_JEXTEN ((uint32_t)0x00300000) /*!< JEXTEN[1:0] bits (External Trigger Conversion mode for injected channels) */
  702. #define ADC_CR2_JEXTEN_0 ((uint32_t)0x00100000) /*!< Bit 0 */
  703. #define ADC_CR2_JEXTEN_1 ((uint32_t)0x00200000) /*!< Bit 1 */
  704. #define ADC_CR2_JSWSTART ((uint32_t)0x00400000) /*!< Start Conversion of injected channels */
  705. #define ADC_CR2_EXTSEL ((uint32_t)0x0F000000) /*!< EXTSEL[3:0] bits (External Event Select for regular group) */
  706. #define ADC_CR2_EXTSEL_0 ((uint32_t)0x01000000) /*!< Bit 0 */
  707. #define ADC_CR2_EXTSEL_1 ((uint32_t)0x02000000) /*!< Bit 1 */
  708. #define ADC_CR2_EXTSEL_2 ((uint32_t)0x04000000) /*!< Bit 2 */
  709. #define ADC_CR2_EXTSEL_3 ((uint32_t)0x08000000) /*!< Bit 3 */
  710. #define ADC_CR2_EXTEN ((uint32_t)0x30000000) /*!< EXTEN[1:0] bits (External Trigger Conversion mode for regular channels) */
  711. #define ADC_CR2_EXTEN_0 ((uint32_t)0x10000000) /*!< Bit 0 */
  712. #define ADC_CR2_EXTEN_1 ((uint32_t)0x20000000) /*!< Bit 1 */
  713. #define ADC_CR2_SWSTART ((uint32_t)0x40000000) /*!< Start Conversion of regular channels */
  714. /****************** Bit definition for ADC_SMPR1 register *******************/
  715. #define ADC_SMPR1_SMP20 ((uint32_t)0x00000007) /*!< SMP20[2:0] bits (Channel 20 Sample time selection) */
  716. #define ADC_SMPR1_SMP20_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  717. #define ADC_SMPR1_SMP20_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  718. #define ADC_SMPR1_SMP20_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  719. #define ADC_SMPR1_SMP21 ((uint32_t)0x00000038) /*!< SMP21[2:0] bits (Channel 21 Sample time selection) */
  720. #define ADC_SMPR1_SMP21_0 ((uint32_t)0x00000008) /*!< Bit 0 */
  721. #define ADC_SMPR1_SMP21_1 ((uint32_t)0x00000010) /*!< Bit 1 */
  722. #define ADC_SMPR1_SMP21_2 ((uint32_t)0x00000020) /*!< Bit 2 */
  723. #define ADC_SMPR1_SMP22 ((uint32_t)0x000001C0) /*!< SMP22[2:0] bits (Channel 22 Sample time selection) */
  724. #define ADC_SMPR1_SMP22_0 ((uint32_t)0x00000040) /*!< Bit 0 */
  725. #define ADC_SMPR1_SMP22_1 ((uint32_t)0x00000080) /*!< Bit 1 */
  726. #define ADC_SMPR1_SMP22_2 ((uint32_t)0x00000100) /*!< Bit 2 */
  727. #define ADC_SMPR1_SMP23 ((uint32_t)0x00000E00) /*!< SMP23[2:0] bits (Channel 23 Sample time selection) */
  728. #define ADC_SMPR1_SMP23_0 ((uint32_t)0x00000200) /*!< Bit 0 */
  729. #define ADC_SMPR1_SMP23_1 ((uint32_t)0x00000400) /*!< Bit 1 */
  730. #define ADC_SMPR1_SMP23_2 ((uint32_t)0x00000800) /*!< Bit 2 */
  731. #define ADC_SMPR1_SMP24 ((uint32_t)0x00007000) /*!< SMP24[2:0] bits (Channel 24 Sample time selection) */
  732. #define ADC_SMPR1_SMP24_0 ((uint32_t)0x00001000) /*!< Bit 0 */
  733. #define ADC_SMPR1_SMP24_1 ((uint32_t)0x00002000) /*!< Bit 1 */
  734. #define ADC_SMPR1_SMP24_2 ((uint32_t)0x00004000) /*!< Bit 2 */
  735. #define ADC_SMPR1_SMP25 ((uint32_t)0x00038000) /*!< SMP25[2:0] bits (Channel 25 Sample time selection) */
  736. #define ADC_SMPR1_SMP25_0 ((uint32_t)0x00008000) /*!< Bit 0 */
  737. #define ADC_SMPR1_SMP25_1 ((uint32_t)0x00010000) /*!< Bit 1 */
  738. #define ADC_SMPR1_SMP25_2 ((uint32_t)0x00020000) /*!< Bit 2 */
  739. #define ADC_SMPR1_SMP26 ((uint32_t)0x001C0000) /*!< SMP26[2:0] bits (Channel 26 Sample time selection) */
  740. #define ADC_SMPR1_SMP26_0 ((uint32_t)0x00040000) /*!< Bit 0 */
  741. #define ADC_SMPR1_SMP26_1 ((uint32_t)0x00080000) /*!< Bit 1 */
  742. #define ADC_SMPR1_SMP26_2 ((uint32_t)0x00100000) /*!< Bit 2 */
  743. #define ADC_SMPR1_SMP27 ((uint32_t)0x00E00000) /*!< SMP27[2:0] bits (Channel 27 Sample time selection) */
  744. #define ADC_SMPR1_SMP27_0 ((uint32_t)0x00200000) /*!< Bit 0 */
  745. #define ADC_SMPR1_SMP27_1 ((uint32_t)0x00400000) /*!< Bit 1 */
  746. #define ADC_SMPR1_SMP27_2 ((uint32_t)0x00800000) /*!< Bit 2 */
  747. #define ADC_SMPR1_SMP28 ((uint32_t)0x07000000) /*!< SMP28[2:0] bits (Channel 28 Sample time selection) */
  748. #define ADC_SMPR1_SMP28_0 ((uint32_t)0x01000000) /*!< Bit 0 */
  749. #define ADC_SMPR1_SMP28_1 ((uint32_t)0x02000000) /*!< Bit 1 */
  750. #define ADC_SMPR1_SMP28_2 ((uint32_t)0x04000000) /*!< Bit 2 */
  751. #define ADC_SMPR1_SMP29 ((uint32_t)0x38000000) /*!< SMP29[2:0] bits (Channel 29 Sample time selection) */
  752. #define ADC_SMPR1_SMP29_0 ((uint32_t)0x08000000) /*!< Bit 0 */
  753. #define ADC_SMPR1_SMP29_1 ((uint32_t)0x10000000) /*!< Bit 1 */
  754. #define ADC_SMPR1_SMP29_2 ((uint32_t)0x20000000) /*!< Bit 2 */
  755. /****************** Bit definition for ADC_SMPR2 register *******************/
  756. #define ADC_SMPR2_SMP10 ((uint32_t)0x00000007) /*!< SMP10[2:0] bits (Channel 10 Sample time selection) */
  757. #define ADC_SMPR2_SMP10_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  758. #define ADC_SMPR2_SMP10_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  759. #define ADC_SMPR2_SMP10_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  760. #define ADC_SMPR2_SMP11 ((uint32_t)0x00000038) /*!< SMP11[2:0] bits (Channel 11 Sample time selection) */
  761. #define ADC_SMPR2_SMP11_0 ((uint32_t)0x00000008) /*!< Bit 0 */
  762. #define ADC_SMPR2_SMP11_1 ((uint32_t)0x00000010) /*!< Bit 1 */
  763. #define ADC_SMPR2_SMP11_2 ((uint32_t)0x00000020) /*!< Bit 2 */
  764. #define ADC_SMPR2_SMP12 ((uint32_t)0x000001C0) /*!< SMP12[2:0] bits (Channel 12 Sample time selection) */
  765. #define ADC_SMPR2_SMP12_0 ((uint32_t)0x00000040) /*!< Bit 0 */
  766. #define ADC_SMPR2_SMP12_1 ((uint32_t)0x00000080) /*!< Bit 1 */
  767. #define ADC_SMPR2_SMP12_2 ((uint32_t)0x00000100) /*!< Bit 2 */
  768. #define ADC_SMPR2_SMP13 ((uint32_t)0x00000E00) /*!< SMP13[2:0] bits (Channel 13 Sample time selection) */
  769. #define ADC_SMPR2_SMP13_0 ((uint32_t)0x00000200) /*!< Bit 0 */
  770. #define ADC_SMPR2_SMP13_1 ((uint32_t)0x00000400) /*!< Bit 1 */
  771. #define ADC_SMPR2_SMP13_2 ((uint32_t)0x00000800) /*!< Bit 2 */
  772. #define ADC_SMPR2_SMP14 ((uint32_t)0x00007000) /*!< SMP14[2:0] bits (Channel 14 Sample time selection) */
  773. #define ADC_SMPR2_SMP14_0 ((uint32_t)0x00001000) /*!< Bit 0 */
  774. #define ADC_SMPR2_SMP14_1 ((uint32_t)0x00002000) /*!< Bit 1 */
  775. #define ADC_SMPR2_SMP14_2 ((uint32_t)0x00004000) /*!< Bit 2 */
  776. #define ADC_SMPR2_SMP15 ((uint32_t)0x00038000) /*!< SMP15[2:0] bits (Channel 5 Sample time selection) */
  777. #define ADC_SMPR2_SMP15_0 ((uint32_t)0x00008000) /*!< Bit 0 */
  778. #define ADC_SMPR2_SMP15_1 ((uint32_t)0x00010000) /*!< Bit 1 */
  779. #define ADC_SMPR2_SMP15_2 ((uint32_t)0x00020000) /*!< Bit 2 */
  780. #define ADC_SMPR2_SMP16 ((uint32_t)0x001C0000) /*!< SMP16[2:0] bits (Channel 16 Sample time selection) */
  781. #define ADC_SMPR2_SMP16_0 ((uint32_t)0x00040000) /*!< Bit 0 */
  782. #define ADC_SMPR2_SMP16_1 ((uint32_t)0x00080000) /*!< Bit 1 */
  783. #define ADC_SMPR2_SMP16_2 ((uint32_t)0x00100000) /*!< Bit 2 */
  784. #define ADC_SMPR2_SMP17 ((uint32_t)0x00E00000) /*!< SMP17[2:0] bits (Channel 17 Sample time selection) */
  785. #define ADC_SMPR2_SMP17_0 ((uint32_t)0x00200000) /*!< Bit 0 */
  786. #define ADC_SMPR2_SMP17_1 ((uint32_t)0x00400000) /*!< Bit 1 */
  787. #define ADC_SMPR2_SMP17_2 ((uint32_t)0x00800000) /*!< Bit 2 */
  788. #define ADC_SMPR2_SMP18 ((uint32_t)0x07000000) /*!< SMP18[2:0] bits (Channel 18 Sample time selection) */
  789. #define ADC_SMPR2_SMP18_0 ((uint32_t)0x01000000) /*!< Bit 0 */
  790. #define ADC_SMPR2_SMP18_1 ((uint32_t)0x02000000) /*!< Bit 1 */
  791. #define ADC_SMPR2_SMP18_2 ((uint32_t)0x04000000) /*!< Bit 2 */
  792. #define ADC_SMPR2_SMP19 ((uint32_t)0x38000000) /*!< SMP19[2:0] bits (Channel 19 Sample time selection) */
  793. #define ADC_SMPR2_SMP19_0 ((uint32_t)0x08000000) /*!< Bit 0 */
  794. #define ADC_SMPR2_SMP19_1 ((uint32_t)0x10000000) /*!< Bit 1 */
  795. #define ADC_SMPR2_SMP19_2 ((uint32_t)0x20000000) /*!< Bit 2 */
  796. /****************** Bit definition for ADC_SMPR3 register *******************/
  797. #define ADC_SMPR3_SMP0 ((uint32_t)0x00000007) /*!< SMP0[2:0] bits (Channel 0 Sample time selection) */
  798. #define ADC_SMPR3_SMP0_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  799. #define ADC_SMPR3_SMP0_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  800. #define ADC_SMPR3_SMP0_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  801. #define ADC_SMPR3_SMP1 ((uint32_t)0x00000038) /*!< SMP1[2:0] bits (Channel 1 Sample time selection) */
  802. #define ADC_SMPR3_SMP1_0 ((uint32_t)0x00000008) /*!< Bit 0 */
  803. #define ADC_SMPR3_SMP1_1 ((uint32_t)0x00000010) /*!< Bit 1 */
  804. #define ADC_SMPR3_SMP1_2 ((uint32_t)0x00000020) /*!< Bit 2 */
  805. #define ADC_SMPR3_SMP2 ((uint32_t)0x000001C0) /*!< SMP2[2:0] bits (Channel 2 Sample time selection) */
  806. #define ADC_SMPR3_SMP2_0 ((uint32_t)0x00000040) /*!< Bit 0 */
  807. #define ADC_SMPR3_SMP2_1 ((uint32_t)0x00000080) /*!< Bit 1 */
  808. #define ADC_SMPR3_SMP2_2 ((uint32_t)0x00000100) /*!< Bit 2 */
  809. #define ADC_SMPR3_SMP3 ((uint32_t)0x00000E00) /*!< SMP3[2:0] bits (Channel 3 Sample time selection) */
  810. #define ADC_SMPR3_SMP3_0 ((uint32_t)0x00000200) /*!< Bit 0 */
  811. #define ADC_SMPR3_SMP3_1 ((uint32_t)0x00000400) /*!< Bit 1 */
  812. #define ADC_SMPR3_SMP3_2 ((uint32_t)0x00000800) /*!< Bit 2 */
  813. #define ADC_SMPR3_SMP4 ((uint32_t)0x00007000) /*!< SMP4[2:0] bits (Channel 4 Sample time selection) */
  814. #define ADC_SMPR3_SMP4_0 ((uint32_t)0x00001000) /*!< Bit 0 */
  815. #define ADC_SMPR3_SMP4_1 ((uint32_t)0x00002000) /*!< Bit 1 */
  816. #define ADC_SMPR3_SMP4_2 ((uint32_t)0x00004000) /*!< Bit 2 */
  817. #define ADC_SMPR3_SMP5 ((uint32_t)0x00038000) /*!< SMP5[2:0] bits (Channel 5 Sample time selection) */
  818. #define ADC_SMPR3_SMP5_0 ((uint32_t)0x00008000) /*!< Bit 0 */
  819. #define ADC_SMPR3_SMP5_1 ((uint32_t)0x00010000) /*!< Bit 1 */
  820. #define ADC_SMPR3_SMP5_2 ((uint32_t)0x00020000) /*!< Bit 2 */
  821. #define ADC_SMPR3_SMP6 ((uint32_t)0x001C0000) /*!< SMP6[2:0] bits (Channel 6 Sample time selection) */
  822. #define ADC_SMPR3_SMP6_0 ((uint32_t)0x00040000) /*!< Bit 0 */
  823. #define ADC_SMPR3_SMP6_1 ((uint32_t)0x00080000) /*!< Bit 1 */
  824. #define ADC_SMPR3_SMP6_2 ((uint32_t)0x00100000) /*!< Bit 2 */
  825. #define ADC_SMPR3_SMP7 ((uint32_t)0x00E00000) /*!< SMP7[2:0] bits (Channel 7 Sample time selection) */
  826. #define ADC_SMPR3_SMP7_0 ((uint32_t)0x00200000) /*!< Bit 0 */
  827. #define ADC_SMPR3_SMP7_1 ((uint32_t)0x00400000) /*!< Bit 1 */
  828. #define ADC_SMPR3_SMP7_2 ((uint32_t)0x00800000) /*!< Bit 2 */
  829. #define ADC_SMPR3_SMP8 ((uint32_t)0x07000000) /*!< SMP8[2:0] bits (Channel 8 Sample time selection) */
  830. #define ADC_SMPR3_SMP8_0 ((uint32_t)0x01000000) /*!< Bit 0 */
  831. #define ADC_SMPR3_SMP8_1 ((uint32_t)0x02000000) /*!< Bit 1 */
  832. #define ADC_SMPR3_SMP8_2 ((uint32_t)0x04000000) /*!< Bit 2 */
  833. #define ADC_SMPR3_SMP9 ((uint32_t)0x38000000) /*!< SMP9[2:0] bits (Channel 9 Sample time selection) */
  834. #define ADC_SMPR3_SMP9_0 ((uint32_t)0x08000000) /*!< Bit 0 */
  835. #define ADC_SMPR3_SMP9_1 ((uint32_t)0x10000000) /*!< Bit 1 */
  836. #define ADC_SMPR3_SMP9_2 ((uint32_t)0x20000000) /*!< Bit 2 */
  837. /****************** Bit definition for ADC_JOFR1 register *******************/
  838. #define ADC_JOFR1_JOFFSET1 ((uint32_t)0x00000FFF) /*!< Data offset for injected channel 1 */
  839. /****************** Bit definition for ADC_JOFR2 register *******************/
  840. #define ADC_JOFR2_JOFFSET2 ((uint32_t)0x00000FFF) /*!< Data offset for injected channel 2 */
  841. /****************** Bit definition for ADC_JOFR3 register *******************/
  842. #define ADC_JOFR3_JOFFSET3 ((uint32_t)0x00000FFF) /*!< Data offset for injected channel 3 */
  843. /****************** Bit definition for ADC_JOFR4 register *******************/
  844. #define ADC_JOFR4_JOFFSET4 ((uint32_t)0x00000FFF) /*!< Data offset for injected channel 4 */
  845. /******************* Bit definition for ADC_HTR register ********************/
  846. #define ADC_HTR_HT ((uint32_t)0x00000FFF) /*!< Analog watchdog high threshold */
  847. /******************* Bit definition for ADC_LTR register ********************/
  848. #define ADC_LTR_LT ((uint32_t)0x00000FFF) /*!< Analog watchdog low threshold */
  849. /******************* Bit definition for ADC_SQR1 register *******************/
  850. #define ADC_SQR1_L ((uint32_t)0x01F00000) /*!< L[4:0] bits (Regular channel sequence length) */
  851. #define ADC_SQR1_L_0 ((uint32_t)0x00100000) /*!< Bit 0 */
  852. #define ADC_SQR1_L_1 ((uint32_t)0x00200000) /*!< Bit 1 */
  853. #define ADC_SQR1_L_2 ((uint32_t)0x00400000) /*!< Bit 2 */
  854. #define ADC_SQR1_L_3 ((uint32_t)0x00800000) /*!< Bit 3 */
  855. #define ADC_SQR1_L_4 ((uint32_t)0x01000000) /*!< Bit 4 */
  856. #define ADC_SQR1_SQ27 ((uint32_t)0x00007C00) /*!< SQ27[4:0] bits (27th conversion in regular sequence) */
  857. #define ADC_SQR1_SQ27_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  858. #define ADC_SQR1_SQ27_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  859. #define ADC_SQR1_SQ27_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  860. #define ADC_SQR1_SQ27_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  861. #define ADC_SQR1_SQ27_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  862. #define ADC_SQR1_SQ26 ((uint32_t)0x000003E0) /*!< SQ26[4:0] bits (26th conversion in regular sequence) */
  863. #define ADC_SQR1_SQ26_0 ((uint32_t)0x00000020) /*!< Bit 0 */
  864. #define ADC_SQR1_SQ26_1 ((uint32_t)0x00000040) /*!< Bit 1 */
  865. #define ADC_SQR1_SQ26_2 ((uint32_t)0x00000080) /*!< Bit 2 */
  866. #define ADC_SQR1_SQ26_3 ((uint32_t)0x00000100) /*!< Bit 3 */
  867. #define ADC_SQR1_SQ26_4 ((uint32_t)0x00000200) /*!< Bit 4 */
  868. #define ADC_SQR1_SQ25 ((uint32_t)0x0000001F) /*!< SQ25[4:0] bits (25th conversion in regular sequence) */
  869. #define ADC_SQR1_SQ25_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  870. #define ADC_SQR1_SQ25_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  871. #define ADC_SQR1_SQ25_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  872. #define ADC_SQR1_SQ25_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  873. #define ADC_SQR1_SQ25_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  874. /******************* Bit definition for ADC_SQR2 register *******************/
  875. #define ADC_SQR2_SQ19 ((uint32_t)0x0000001F) /*!< SQ19[4:0] bits (19th conversion in regular sequence) */
  876. #define ADC_SQR2_SQ19_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  877. #define ADC_SQR2_SQ19_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  878. #define ADC_SQR2_SQ19_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  879. #define ADC_SQR2_SQ19_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  880. #define ADC_SQR2_SQ19_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  881. #define ADC_SQR2_SQ20 ((uint32_t)0x000003E0) /*!< SQ20[4:0] bits (20th conversion in regular sequence) */
  882. #define ADC_SQR2_SQ20_0 ((uint32_t)0x00000020) /*!< Bit 0 */
  883. #define ADC_SQR2_SQ20_1 ((uint32_t)0x00000040) /*!< Bit 1 */
  884. #define ADC_SQR2_SQ20_2 ((uint32_t)0x00000080) /*!< Bit 2 */
  885. #define ADC_SQR2_SQ20_3 ((uint32_t)0x00000100) /*!< Bit 3 */
  886. #define ADC_SQR2_SQ20_4 ((uint32_t)0x00000200) /*!< Bit 4 */
  887. #define ADC_SQR2_SQ21 ((uint32_t)0x00007C00) /*!< SQ21[4:0] bits (21th conversion in regular sequence) */
  888. #define ADC_SQR2_SQ21_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  889. #define ADC_SQR2_SQ21_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  890. #define ADC_SQR2_SQ21_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  891. #define ADC_SQR2_SQ21_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  892. #define ADC_SQR2_SQ21_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  893. #define ADC_SQR2_SQ22 ((uint32_t)0x000F8000) /*!< SQ22[4:0] bits (22th conversion in regular sequence) */
  894. #define ADC_SQR2_SQ22_0 ((uint32_t)0x00008000) /*!< Bit 0 */
  895. #define ADC_SQR2_SQ22_1 ((uint32_t)0x00010000) /*!< Bit 1 */
  896. #define ADC_SQR2_SQ22_2 ((uint32_t)0x00020000) /*!< Bit 2 */
  897. #define ADC_SQR2_SQ22_3 ((uint32_t)0x00040000) /*!< Bit 3 */
  898. #define ADC_SQR2_SQ22_4 ((uint32_t)0x00080000) /*!< Bit 4 */
  899. #define ADC_SQR2_SQ23 ((uint32_t)0x01F00000) /*!< SQ23[4:0] bits (23th conversion in regular sequence) */
  900. #define ADC_SQR2_SQ23_0 ((uint32_t)0x00100000) /*!< Bit 0 */
  901. #define ADC_SQR2_SQ23_1 ((uint32_t)0x00200000) /*!< Bit 1 */
  902. #define ADC_SQR2_SQ23_2 ((uint32_t)0x00400000) /*!< Bit 2 */
  903. #define ADC_SQR2_SQ23_3 ((uint32_t)0x00800000) /*!< Bit 3 */
  904. #define ADC_SQR2_SQ23_4 ((uint32_t)0x01000000) /*!< Bit 4 */
  905. #define ADC_SQR2_SQ24 ((uint32_t)0x3E000000) /*!< SQ24[4:0] bits (24th conversion in regular sequence) */
  906. #define ADC_SQR2_SQ24_0 ((uint32_t)0x02000000) /*!< Bit 0 */
  907. #define ADC_SQR2_SQ24_1 ((uint32_t)0x04000000) /*!< Bit 1 */
  908. #define ADC_SQR2_SQ24_2 ((uint32_t)0x08000000) /*!< Bit 2 */
  909. #define ADC_SQR2_SQ24_3 ((uint32_t)0x10000000) /*!< Bit 3 */
  910. #define ADC_SQR2_SQ24_4 ((uint32_t)0x20000000) /*!< Bit 4 */
  911. /******************* Bit definition for ADC_SQR3 register *******************/
  912. #define ADC_SQR3_SQ13 ((uint32_t)0x0000001F) /*!< SQ13[4:0] bits (13th conversion in regular sequence) */
  913. #define ADC_SQR3_SQ13_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  914. #define ADC_SQR3_SQ13_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  915. #define ADC_SQR3_SQ13_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  916. #define ADC_SQR3_SQ13_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  917. #define ADC_SQR3_SQ13_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  918. #define ADC_SQR3_SQ14 ((uint32_t)0x000003E0) /*!< SQ14[4:0] bits (14th conversion in regular sequence) */
  919. #define ADC_SQR3_SQ14_0 ((uint32_t)0x00000020) /*!< Bit 0 */
  920. #define ADC_SQR3_SQ14_1 ((uint32_t)0x00000040) /*!< Bit 1 */
  921. #define ADC_SQR3_SQ14_2 ((uint32_t)0x00000080) /*!< Bit 2 */
  922. #define ADC_SQR3_SQ14_3 ((uint32_t)0x00000100) /*!< Bit 3 */
  923. #define ADC_SQR3_SQ14_4 ((uint32_t)0x00000200) /*!< Bit 4 */
  924. #define ADC_SQR3_SQ15 ((uint32_t)0x00007C00) /*!< SQ15[4:0] bits (15th conversion in regular sequence) */
  925. #define ADC_SQR3_SQ15_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  926. #define ADC_SQR3_SQ15_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  927. #define ADC_SQR3_SQ15_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  928. #define ADC_SQR3_SQ15_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  929. #define ADC_SQR3_SQ15_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  930. #define ADC_SQR3_SQ16 ((uint32_t)0x000F8000) /*!< SQ16[4:0] bits (16th conversion in regular sequence) */
  931. #define ADC_SQR3_SQ16_0 ((uint32_t)0x00008000) /*!< Bit 0 */
  932. #define ADC_SQR3_SQ16_1 ((uint32_t)0x00010000) /*!< Bit 1 */
  933. #define ADC_SQR3_SQ16_2 ((uint32_t)0x00020000) /*!< Bit 2 */
  934. #define ADC_SQR3_SQ16_3 ((uint32_t)0x00040000) /*!< Bit 3 */
  935. #define ADC_SQR3_SQ16_4 ((uint32_t)0x00080000) /*!< Bit 4 */
  936. #define ADC_SQR3_SQ17 ((uint32_t)0x01F00000) /*!< SQ17[4:0] bits (17th conversion in regular sequence) */
  937. #define ADC_SQR3_SQ17_0 ((uint32_t)0x00100000) /*!< Bit 0 */
  938. #define ADC_SQR3_SQ17_1 ((uint32_t)0x00200000) /*!< Bit 1 */
  939. #define ADC_SQR3_SQ17_2 ((uint32_t)0x00400000) /*!< Bit 2 */
  940. #define ADC_SQR3_SQ17_3 ((uint32_t)0x00800000) /*!< Bit 3 */
  941. #define ADC_SQR3_SQ17_4 ((uint32_t)0x01000000) /*!< Bit 4 */
  942. #define ADC_SQR3_SQ18 ((uint32_t)0x3E000000) /*!< SQ18[4:0] bits (18th conversion in regular sequence) */
  943. #define ADC_SQR3_SQ18_0 ((uint32_t)0x02000000) /*!< Bit 0 */
  944. #define ADC_SQR3_SQ18_1 ((uint32_t)0x04000000) /*!< Bit 1 */
  945. #define ADC_SQR3_SQ18_2 ((uint32_t)0x08000000) /*!< Bit 2 */
  946. #define ADC_SQR3_SQ18_3 ((uint32_t)0x10000000) /*!< Bit 3 */
  947. #define ADC_SQR3_SQ18_4 ((uint32_t)0x20000000) /*!< Bit 4 */
  948. /******************* Bit definition for ADC_SQR4 register *******************/
  949. #define ADC_SQR4_SQ7 ((uint32_t)0x0000001F) /*!< SQ7[4:0] bits (7th conversion in regular sequence) */
  950. #define ADC_SQR4_SQ7_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  951. #define ADC_SQR4_SQ7_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  952. #define ADC_SQR4_SQ7_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  953. #define ADC_SQR4_SQ7_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  954. #define ADC_SQR4_SQ7_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  955. #define ADC_SQR4_SQ8 ((uint32_t)0x000003E0) /*!< SQ8[4:0] bits (8th conversion in regular sequence) */
  956. #define ADC_SQR4_SQ8_0 ((uint32_t)0x00000020) /*!< Bit 0 */
  957. #define ADC_SQR4_SQ8_1 ((uint32_t)0x00000040) /*!< Bit 1 */
  958. #define ADC_SQR4_SQ8_2 ((uint32_t)0x00000080) /*!< Bit 2 */
  959. #define ADC_SQR4_SQ8_3 ((uint32_t)0x00000100) /*!< Bit 3 */
  960. #define ADC_SQR4_SQ8_4 ((uint32_t)0x00000200) /*!< Bit 4 */
  961. #define ADC_SQR4_SQ9 ((uint32_t)0x00007C00) /*!< SQ9[4:0] bits (9th conversion in regular sequence) */
  962. #define ADC_SQR4_SQ9_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  963. #define ADC_SQR4_SQ9_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  964. #define ADC_SQR4_SQ9_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  965. #define ADC_SQR4_SQ9_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  966. #define ADC_SQR4_SQ9_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  967. #define ADC_SQR4_SQ10 ((uint32_t)0x000F8000) /*!< SQ10[4:0] bits (10th conversion in regular sequence) */
  968. #define ADC_SQR4_SQ10_0 ((uint32_t)0x00008000) /*!< Bit 0 */
  969. #define ADC_SQR4_SQ10_1 ((uint32_t)0x00010000) /*!< Bit 1 */
  970. #define ADC_SQR4_SQ10_2 ((uint32_t)0x00020000) /*!< Bit 2 */
  971. #define ADC_SQR4_SQ10_3 ((uint32_t)0x00040000) /*!< Bit 3 */
  972. #define ADC_SQR4_SQ10_4 ((uint32_t)0x00080000) /*!< Bit 4 */
  973. #define ADC_SQR4_SQ11 ((uint32_t)0x01F00000) /*!< SQ11[4:0] bits (11th conversion in regular sequence) */
  974. #define ADC_SQR4_SQ11_0 ((uint32_t)0x00100000) /*!< Bit 0 */
  975. #define ADC_SQR4_SQ11_1 ((uint32_t)0x00200000) /*!< Bit 1 */
  976. #define ADC_SQR4_SQ11_2 ((uint32_t)0x00400000) /*!< Bit 2 */
  977. #define ADC_SQR4_SQ11_3 ((uint32_t)0x00800000) /*!< Bit 3 */
  978. #define ADC_SQR4_SQ11_4 ((uint32_t)0x01000000) /*!< Bit 4 */
  979. #define ADC_SQR4_SQ12 ((uint32_t)0x3E000000) /*!< SQ12[4:0] bits (12th conversion in regular sequence) */
  980. #define ADC_SQR4_SQ12_0 ((uint32_t)0x02000000) /*!< Bit 0 */
  981. #define ADC_SQR4_SQ12_1 ((uint32_t)0x04000000) /*!< Bit 1 */
  982. #define ADC_SQR4_SQ12_2 ((uint32_t)0x08000000) /*!< Bit 2 */
  983. #define ADC_SQR4_SQ12_3 ((uint32_t)0x10000000) /*!< Bit 3 */
  984. #define ADC_SQR4_SQ12_4 ((uint32_t)0x20000000) /*!< Bit 4 */
  985. /******************* Bit definition for ADC_SQR5 register *******************/
  986. #define ADC_SQR5_SQ1 ((uint32_t)0x0000001F) /*!< SQ1[4:0] bits (1st conversion in regular sequence) */
  987. #define ADC_SQR5_SQ1_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  988. #define ADC_SQR5_SQ1_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  989. #define ADC_SQR5_SQ1_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  990. #define ADC_SQR5_SQ1_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  991. #define ADC_SQR5_SQ1_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  992. #define ADC_SQR5_SQ2 ((uint32_t)0x000003E0) /*!< SQ2[4:0] bits (2nd conversion in regular sequence) */
  993. #define ADC_SQR5_SQ2_0 ((uint32_t)0x00000020) /*!< Bit 0 */
  994. #define ADC_SQR5_SQ2_1 ((uint32_t)0x00000040) /*!< Bit 1 */
  995. #define ADC_SQR5_SQ2_2 ((uint32_t)0x00000080) /*!< Bit 2 */
  996. #define ADC_SQR5_SQ2_3 ((uint32_t)0x00000100) /*!< Bit 3 */
  997. #define ADC_SQR5_SQ2_4 ((uint32_t)0x00000200) /*!< Bit 4 */
  998. #define ADC_SQR5_SQ3 ((uint32_t)0x00007C00) /*!< SQ3[4:0] bits (3rd conversion in regular sequence) */
  999. #define ADC_SQR5_SQ3_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  1000. #define ADC_SQR5_SQ3_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  1001. #define ADC_SQR5_SQ3_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  1002. #define ADC_SQR5_SQ3_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  1003. #define ADC_SQR5_SQ3_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  1004. #define ADC_SQR5_SQ4 ((uint32_t)0x000F8000) /*!< SQ4[4:0] bits (4th conversion in regular sequence) */
  1005. #define ADC_SQR5_SQ4_0 ((uint32_t)0x00008000) /*!< Bit 0 */
  1006. #define ADC_SQR5_SQ4_1 ((uint32_t)0x00010000) /*!< Bit 1 */
  1007. #define ADC_SQR5_SQ4_2 ((uint32_t)0x00020000) /*!< Bit 2 */
  1008. #define ADC_SQR5_SQ4_3 ((uint32_t)0x00040000) /*!< Bit 3 */
  1009. #define ADC_SQR5_SQ4_4 ((uint32_t)0x00080000) /*!< Bit 4 */
  1010. #define ADC_SQR5_SQ5 ((uint32_t)0x01F00000) /*!< SQ5[4:0] bits (5th conversion in regular sequence) */
  1011. #define ADC_SQR5_SQ5_0 ((uint32_t)0x00100000) /*!< Bit 0 */
  1012. #define ADC_SQR5_SQ5_1 ((uint32_t)0x00200000) /*!< Bit 1 */
  1013. #define ADC_SQR5_SQ5_2 ((uint32_t)0x00400000) /*!< Bit 2 */
  1014. #define ADC_SQR5_SQ5_3 ((uint32_t)0x00800000) /*!< Bit 3 */
  1015. #define ADC_SQR5_SQ5_4 ((uint32_t)0x01000000) /*!< Bit 4 */
  1016. #define ADC_SQR5_SQ6 ((uint32_t)0x3E000000) /*!< SQ6[4:0] bits (6th conversion in regular sequence) */
  1017. #define ADC_SQR5_SQ6_0 ((uint32_t)0x02000000) /*!< Bit 0 */
  1018. #define ADC_SQR5_SQ6_1 ((uint32_t)0x04000000) /*!< Bit 1 */
  1019. #define ADC_SQR5_SQ6_2 ((uint32_t)0x08000000) /*!< Bit 2 */
  1020. #define ADC_SQR5_SQ6_3 ((uint32_t)0x10000000) /*!< Bit 3 */
  1021. #define ADC_SQR5_SQ6_4 ((uint32_t)0x20000000) /*!< Bit 4 */
  1022. /******************* Bit definition for ADC_JSQR register *******************/
  1023. #define ADC_JSQR_JSQ1 ((uint32_t)0x0000001F) /*!< JSQ1[4:0] bits (1st conversion in injected sequence) */
  1024. #define ADC_JSQR_JSQ1_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  1025. #define ADC_JSQR_JSQ1_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  1026. #define ADC_JSQR_JSQ1_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  1027. #define ADC_JSQR_JSQ1_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  1028. #define ADC_JSQR_JSQ1_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  1029. #define ADC_JSQR_JSQ2 ((uint32_t)0x000003E0) /*!< JSQ2[4:0] bits (2nd conversion in injected sequence) */
  1030. #define ADC_JSQR_JSQ2_0 ((uint32_t)0x00000020) /*!< Bit 0 */
  1031. #define ADC_JSQR_JSQ2_1 ((uint32_t)0x00000040) /*!< Bit 1 */
  1032. #define ADC_JSQR_JSQ2_2 ((uint32_t)0x00000080) /*!< Bit 2 */
  1033. #define ADC_JSQR_JSQ2_3 ((uint32_t)0x00000100) /*!< Bit 3 */
  1034. #define ADC_JSQR_JSQ2_4 ((uint32_t)0x00000200) /*!< Bit 4 */
  1035. #define ADC_JSQR_JSQ3 ((uint32_t)0x00007C00) /*!< JSQ3[4:0] bits (3rd conversion in injected sequence) */
  1036. #define ADC_JSQR_JSQ3_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  1037. #define ADC_JSQR_JSQ3_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  1038. #define ADC_JSQR_JSQ3_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  1039. #define ADC_JSQR_JSQ3_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  1040. #define ADC_JSQR_JSQ3_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  1041. #define ADC_JSQR_JSQ4 ((uint32_t)0x000F8000) /*!< JSQ4[4:0] bits (4th conversion in injected sequence) */
  1042. #define ADC_JSQR_JSQ4_0 ((uint32_t)0x00008000) /*!< Bit 0 */
  1043. #define ADC_JSQR_JSQ4_1 ((uint32_t)0x00010000) /*!< Bit 1 */
  1044. #define ADC_JSQR_JSQ4_2 ((uint32_t)0x00020000) /*!< Bit 2 */
  1045. #define ADC_JSQR_JSQ4_3 ((uint32_t)0x00040000) /*!< Bit 3 */
  1046. #define ADC_JSQR_JSQ4_4 ((uint32_t)0x00080000) /*!< Bit 4 */
  1047. #define ADC_JSQR_JL ((uint32_t)0x00300000) /*!< JL[1:0] bits (Injected Sequence length) */
  1048. #define ADC_JSQR_JL_0 ((uint32_t)0x00100000) /*!< Bit 0 */
  1049. #define ADC_JSQR_JL_1 ((uint32_t)0x00200000) /*!< Bit 1 */
  1050. /******************* Bit definition for ADC_JDR1 register *******************/
  1051. #define ADC_JDR1_JDATA ((uint32_t)0x0000FFFF) /*!< Injected data */
  1052. /******************* Bit definition for ADC_JDR2 register *******************/
  1053. #define ADC_JDR2_JDATA ((uint32_t)0x0000FFFF) /*!< Injected data */
  1054. /******************* Bit definition for ADC_JDR3 register *******************/
  1055. #define ADC_JDR3_JDATA ((uint32_t)0x0000FFFF) /*!< Injected data */
  1056. /******************* Bit definition for ADC_JDR4 register *******************/
  1057. #define ADC_JDR4_JDATA ((uint32_t)0x0000FFFF) /*!< Injected data */
  1058. /******************** Bit definition for ADC_DR register ********************/
  1059. #define ADC_DR_DATA ((uint32_t)0x0000FFFF) /*!< Regular data */
  1060. /******************* Bit definition for ADC_CSR register ********************/
  1061. #define ADC_CSR_AWD1 ((uint32_t)0x00000001) /*!< ADC1 Analog watchdog flag */
  1062. #define ADC_CSR_EOC1 ((uint32_t)0x00000002) /*!< ADC1 End of conversion */
  1063. #define ADC_CSR_JEOC1 ((uint32_t)0x00000004) /*!< ADC1 Injected channel end of conversion */
  1064. #define ADC_CSR_JSTRT1 ((uint32_t)0x00000008) /*!< ADC1 Injected channel Start flag */
  1065. #define ADC_CSR_STRT1 ((uint32_t)0x00000010) /*!< ADC1 Regular channel Start flag */
  1066. #define ADC_CSR_OVR1 ((uint32_t)0x00000020) /*!< ADC1 overrun flag */
  1067. #define ADC_CSR_ADONS1 ((uint32_t)0x00000040) /*!< ADON status of ADC1 */
  1068. /******************* Bit definition for ADC_CCR register ********************/
  1069. #define ADC_CCR_ADCPRE ((uint32_t)0x00030000) /*!< ADC prescaler*/
  1070. #define ADC_CCR_ADCPRE_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  1071. #define ADC_CCR_ADCPRE_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  1072. #define ADC_CCR_TSVREFE ((uint32_t)0x00800000) /*!< Temperature Sensor and VREFINT Enable */
  1073. /******************************************************************************/
  1074. /* */
  1075. /* Analog Comparators (COMP) */
  1076. /* */
  1077. /******************************************************************************/
  1078. /****************** Bit definition for COMP_CSR register ********************/
  1079. #define COMP_CSR_10KPU ((uint32_t)0x00000001) /*!< 10K pull-up resistor */
  1080. #define COMP_CSR_400KPU ((uint32_t)0x00000002) /*!< 400K pull-up resistor */
  1081. #define COMP_CSR_10KPD ((uint32_t)0x00000004) /*!< 10K pull-down resistor */
  1082. #define COMP_CSR_400KPD ((uint32_t)0x00000008) /*!< 400K pull-down resistor */
  1083. #define COMP_CSR_CMP1EN ((uint32_t)0x00000010) /*!< Comparator 1 enable */
  1084. #define COMP_CSR_CMP1OUT ((uint32_t)0x00000080) /*!< Comparator 1 output */
  1085. #define COMP_CSR_SPEED ((uint32_t)0x00001000) /*!< Comparator 2 speed */
  1086. #define COMP_CSR_CMP2OUT ((uint32_t)0x00002000) /*!< Comparator 2 ouput */
  1087. #define COMP_CSR_VREFOUTEN ((uint32_t)0x00010000) /*!< Comparator Vref Enable */
  1088. #define COMP_CSR_WNDWE ((uint32_t)0x00020000) /*!< Window mode enable */
  1089. #define COMP_CSR_INSEL ((uint32_t)0x001C0000) /*!< INSEL[2:0] Inversion input Selection */
  1090. #define COMP_CSR_INSEL_0 ((uint32_t)0x00040000) /*!< Bit 0 */
  1091. #define COMP_CSR_INSEL_1 ((uint32_t)0x00080000) /*!< Bit 1 */
  1092. #define COMP_CSR_INSEL_2 ((uint32_t)0x00100000) /*!< Bit 2 */
  1093. #define COMP_CSR_OUTSEL ((uint32_t)0x00E00000) /*!< OUTSEL[2:0] comparator 2 output redirection */
  1094. #define COMP_CSR_OUTSEL_0 ((uint32_t)0x00200000) /*!< Bit 0 */
  1095. #define COMP_CSR_OUTSEL_1 ((uint32_t)0x00400000) /*!< Bit 1 */
  1096. #define COMP_CSR_OUTSEL_2 ((uint32_t)0x00800000) /*!< Bit 2 */
  1097. /******************************************************************************/
  1098. /* */
  1099. /* CRC calculation unit (CRC) */
  1100. /* */
  1101. /******************************************************************************/
  1102. /******************* Bit definition for CRC_DR register *********************/
  1103. #define CRC_DR_DR ((uint32_t)0xFFFFFFFF) /*!< Data register bits */
  1104. /******************* Bit definition for CRC_IDR register ********************/
  1105. #define CRC_IDR_IDR ((uint32_t)0x000000FF) /*!< General-purpose 8-bit data register bits */
  1106. /******************** Bit definition for CRC_CR register ********************/
  1107. #define CRC_CR_RESET ((uint32_t)0x00000001) /*!< RESET bit */
  1108. /******************************************************************************/
  1109. /* */
  1110. /* Digital to Analog Converter (DAC) */
  1111. /* */
  1112. /******************************************************************************/
  1113. /******************** Bit definition for DAC_CR register ********************/
  1114. #define DAC_CR_EN1 ((uint32_t)0x00000001) /*!<DAC channel1 enable */
  1115. #define DAC_CR_BOFF1 ((uint32_t)0x00000002) /*!<DAC channel1 output buffer disable */
  1116. #define DAC_CR_TEN1 ((uint32_t)0x00000004) /*!<DAC channel1 Trigger enable */
  1117. #define DAC_CR_TSEL1 ((uint32_t)0x00000038) /*!<TSEL1[2:0] (DAC channel1 Trigger selection) */
  1118. #define DAC_CR_TSEL1_0 ((uint32_t)0x00000008) /*!<Bit 0 */
  1119. #define DAC_CR_TSEL1_1 ((uint32_t)0x00000010) /*!<Bit 1 */
  1120. #define DAC_CR_TSEL1_2 ((uint32_t)0x00000020) /*!<Bit 2 */
  1121. #define DAC_CR_WAVE1 ((uint32_t)0x000000C0) /*!<WAVE1[1:0] (DAC channel1 noise/triangle wave generation enable) */
  1122. #define DAC_CR_WAVE1_0 ((uint32_t)0x00000040) /*!<Bit 0 */
  1123. #define DAC_CR_WAVE1_1 ((uint32_t)0x00000080) /*!<Bit 1 */
  1124. #define DAC_CR_MAMP1 ((uint32_t)0x00000F00) /*!<MAMP1[3:0] (DAC channel1 Mask/Amplitude selector) */
  1125. #define DAC_CR_MAMP1_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  1126. #define DAC_CR_MAMP1_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  1127. #define DAC_CR_MAMP1_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  1128. #define DAC_CR_MAMP1_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  1129. #define DAC_CR_DMAEN1 ((uint32_t)0x00001000) /*!<DAC channel1 DMA enable */
  1130. #define DAC_CR_DMAUDRIE1 ((uint32_t)0x00002000) /*!<DAC channel1 DMA Interrupt enable */
  1131. #define DAC_CR_EN2 ((uint32_t)0x00010000) /*!<DAC channel2 enable */
  1132. #define DAC_CR_BOFF2 ((uint32_t)0x00020000) /*!<DAC channel2 output buffer disable */
  1133. #define DAC_CR_TEN2 ((uint32_t)0x00040000) /*!<DAC channel2 Trigger enable */
  1134. #define DAC_CR_TSEL2 ((uint32_t)0x00380000) /*!<TSEL2[2:0] (DAC channel2 Trigger selection) */
  1135. #define DAC_CR_TSEL2_0 ((uint32_t)0x00080000) /*!<Bit 0 */
  1136. #define DAC_CR_TSEL2_1 ((uint32_t)0x00100000) /*!<Bit 1 */
  1137. #define DAC_CR_TSEL2_2 ((uint32_t)0x00200000) /*!<Bit 2 */
  1138. #define DAC_CR_WAVE2 ((uint32_t)0x00C00000) /*!<WAVE2[1:0] (DAC channel2 noise/triangle wave generation enable) */
  1139. #define DAC_CR_WAVE2_0 ((uint32_t)0x00400000) /*!<Bit 0 */
  1140. #define DAC_CR_WAVE2_1 ((uint32_t)0x00800000) /*!<Bit 1 */
  1141. #define DAC_CR_MAMP2 ((uint32_t)0x0F000000) /*!<MAMP2[3:0] (DAC channel2 Mask/Amplitude selector) */
  1142. #define DAC_CR_MAMP2_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  1143. #define DAC_CR_MAMP2_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  1144. #define DAC_CR_MAMP2_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  1145. #define DAC_CR_MAMP2_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  1146. #define DAC_CR_DMAEN2 ((uint32_t)0x10000000) /*!<DAC channel2 DMA enabled */
  1147. #define DAC_CR_DMAUDRIE2 ((uint32_t)0x20000000) /*!<DAC channel2 DMA underrun interrupt enable */
  1148. /***************** Bit definition for DAC_SWTRIGR register ******************/
  1149. #define DAC_SWTRIGR_SWTRIG1 ((uint32_t)0x00000001) /*!<DAC channel1 software trigger */
  1150. #define DAC_SWTRIGR_SWTRIG2 ((uint32_t)0x00000002) /*!<DAC channel2 software trigger */
  1151. /***************** Bit definition for DAC_DHR12R1 register ******************/
  1152. #define DAC_DHR12R1_DACC1DHR ((uint32_t)0x00000FFF) /*!<DAC channel1 12-bit Right aligned data */
  1153. /***************** Bit definition for DAC_DHR12L1 register ******************/
  1154. #define DAC_DHR12L1_DACC1DHR ((uint32_t)0x0000FFF0) /*!<DAC channel1 12-bit Left aligned data */
  1155. /****************** Bit definition for DAC_DHR8R1 register ******************/
  1156. #define DAC_DHR8R1_DACC1DHR ((uint32_t)0x000000FF) /*!<DAC channel1 8-bit Right aligned data */
  1157. /***************** Bit definition for DAC_DHR12R2 register ******************/
  1158. #define DAC_DHR12R2_DACC2DHR ((uint32_t)0x00000FFF) /*!<DAC channel2 12-bit Right aligned data */
  1159. /***************** Bit definition for DAC_DHR12L2 register ******************/
  1160. #define DAC_DHR12L2_DACC2DHR ((uint32_t)0x0000FFF0) /*!<DAC channel2 12-bit Left aligned data */
  1161. /****************** Bit definition for DAC_DHR8R2 register ******************/
  1162. #define DAC_DHR8R2_DACC2DHR ((uint32_t)0x000000FF) /*!<DAC channel2 8-bit Right aligned data */
  1163. /***************** Bit definition for DAC_DHR12RD register ******************/
  1164. #define DAC_DHR12RD_DACC1DHR ((uint32_t)0x00000FFF) /*!<DAC channel1 12-bit Right aligned data */
  1165. #define DAC_DHR12RD_DACC2DHR ((uint32_t)0x0FFF0000) /*!<DAC channel2 12-bit Right aligned data */
  1166. /***************** Bit definition for DAC_DHR12LD register ******************/
  1167. #define DAC_DHR12LD_DACC1DHR ((uint32_t)0x0000FFF0) /*!<DAC channel1 12-bit Left aligned data */
  1168. #define DAC_DHR12LD_DACC2DHR ((uint32_t)0xFFF00000) /*!<DAC channel2 12-bit Left aligned data */
  1169. /****************** Bit definition for DAC_DHR8RD register ******************/
  1170. #define DAC_DHR8RD_DACC1DHR ((uint32_t)0x000000FF) /*!<DAC channel1 8-bit Right aligned data */
  1171. #define DAC_DHR8RD_DACC2DHR ((uint32_t)0x0000FF00) /*!<DAC channel2 8-bit Right aligned data */
  1172. /******************* Bit definition for DAC_DOR1 register *******************/
  1173. #define DAC_DOR1_DACC1DOR ((uint32_t)0x00000FFF) /*!<DAC channel1 data output */
  1174. /******************* Bit definition for DAC_DOR2 register *******************/
  1175. #define DAC_DOR2_DACC2DOR ((uint_t)0x00000FFF) /*!<DAC channel2 data output */
  1176. /******************** Bit definition for DAC_SR register ********************/
  1177. #define DAC_SR_DMAUDR1 ((uint32_t)0x00002000) /*!<DAC channel1 DMA underrun flag */
  1178. #define DAC_SR_DMAUDR2 ((uint32_t)0x20000000) /*!<DAC channel2 DMA underrun flag */
  1179. /******************************************************************************/
  1180. /* */
  1181. /* Debug MCU (DBGMCU) */
  1182. /* */
  1183. /******************************************************************************/
  1184. /**************** Bit definition for DBGMCU_IDCODE register *****************/
  1185. #define DBGMCU_IDCODE_DEV_ID ((uint32_t)0x00000FFF) /*!< Device Identifier */
  1186. #define DBGMCU_IDCODE_REV_ID ((uint32_t)0xFFFF0000) /*!< REV_ID[15:0] bits (Revision Identifier) */
  1187. #define DBGMCU_IDCODE_REV_ID_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  1188. #define DBGMCU_IDCODE_REV_ID_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  1189. #define DBGMCU_IDCODE_REV_ID_2 ((uint32_t)0x00040000) /*!< Bit 2 */
  1190. #define DBGMCU_IDCODE_REV_ID_3 ((uint32_t)0x00080000) /*!< Bit 3 */
  1191. #define DBGMCU_IDCODE_REV_ID_4 ((uint32_t)0x00100000) /*!< Bit 4 */
  1192. #define DBGMCU_IDCODE_REV_ID_5 ((uint32_t)0x00200000) /*!< Bit 5 */
  1193. #define DBGMCU_IDCODE_REV_ID_6 ((uint32_t)0x00400000) /*!< Bit 6 */
  1194. #define DBGMCU_IDCODE_REV_ID_7 ((uint32_t)0x00800000) /*!< Bit 7 */
  1195. #define DBGMCU_IDCODE_REV_ID_8 ((uint32_t)0x01000000) /*!< Bit 8 */
  1196. #define DBGMCU_IDCODE_REV_ID_9 ((uint32_t)0x02000000) /*!< Bit 9 */
  1197. #define DBGMCU_IDCODE_REV_ID_10 ((uint32_t)0x04000000) /*!< Bit 10 */
  1198. #define DBGMCU_IDCODE_REV_ID_11 ((uint32_t)0x08000000) /*!< Bit 11 */
  1199. #define DBGMCU_IDCODE_REV_ID_12 ((uint32_t)0x10000000) /*!< Bit 12 */
  1200. #define DBGMCU_IDCODE_REV_ID_13 ((uint32_t)0x20000000) /*!< Bit 13 */
  1201. #define DBGMCU_IDCODE_REV_ID_14 ((uint32_t)0x40000000) /*!< Bit 14 */
  1202. #define DBGMCU_IDCODE_REV_ID_15 ((uint32_t)0x80000000) /*!< Bit 15 */
  1203. /****************** Bit definition for DBGMCU_CR register *******************/
  1204. #define DBGMCU_CR_DBG_SLEEP ((uint32_t)0x00000001) /*!< Debug Sleep Mode */
  1205. #define DBGMCU_CR_DBG_STOP ((uint32_t)0x00000002) /*!< Debug Stop Mode */
  1206. #define DBGMCU_CR_DBG_STANDBY ((uint32_t)0x00000004) /*!< Debug Standby mode */
  1207. #define DBGMCU_CR_TRACE_IOEN ((uint32_t)0x00000020) /*!< Trace Pin Assignment Control */
  1208. #define DBGMCU_CR_TRACE_MODE ((uint32_t)0x000000C0) /*!< TRACE_MODE[1:0] bits (Trace Pin Assignment Control) */
  1209. #define DBGMCU_CR_TRACE_MODE_0 ((uint32_t)0x00000040) /*!< Bit 0 */
  1210. #define DBGMCU_CR_TRACE_MODE_1 ((uint32_t)0x00000080) /*!< Bit 1 */
  1211. /****************** Bit definition for DBGMCU_APB1_FZ register **************/
  1212. #define DBGMCU_APB1_FZ_DBG_TIM2_STOP ((uint32_t)0x00000001) /*!< TIM2 counter stopped when core is halted */
  1213. #define DBGMCU_APB1_FZ_DBG_TIM3_STOP ((uint32_t)0x00000002) /*!< TIM3 counter stopped when core is halted */
  1214. #define DBGMCU_APB1_FZ_DBG_TIM4_STOP ((uint32_t)0x00000004) /*!< TIM4 counter stopped when core is halted */
  1215. #define DBGMCU_APB1_FZ_DBG_TIM6_STOP ((uint32_t)0x00000010) /*!< TIM6 counter stopped when core is halted */
  1216. #define DBGMCU_APB1_FZ_DBG_TIM7_STOP ((uint32_t)0x00000020) /*!< TIM7 counter stopped when core is halted */
  1217. #define DBGMCU_APB1_FZ_DBG_RTC_STOP ((uint32_t)0x00000400) /*!< RTC Counter stopped when Core is halted */
  1218. #define DBGMCU_APB1_FZ_DBG_WWDG_STOP ((uint32_t)0x00000800) /*!< Debug Window Watchdog stopped when Core is halted */
  1219. #define DBGMCU_APB1_FZ_DBG_IWDG_STOP ((uint32_t)0x00001000) /*!< Debug Independent Watchdog stopped when Core is halted */
  1220. #define DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT ((uint32_t)0x00200000) /*!< SMBUS timeout mode stopped when Core is halted */
  1221. #define DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT ((uint32_t)0x00400000) /*!< SMBUS timeout mode stopped when Core is halted */
  1222. /****************** Bit definition for DBGMCU_APB2_FZ register **************/
  1223. #define DBGMCU_APB2_FZ_DBG_TIM9_STOP ((uint32_t)0x00000004) /*!< TIM9 counter stopped when core is halted */
  1224. #define DBGMCU_APB2_FZ_DBG_TIM10_STOP ((uint32_t)0x00000008) /*!< TIM10 counter stopped when core is halted */
  1225. #define DBGMCU_APB2_FZ_DBG_TIM11_STOP ((uint32_t)0x00000010) /*!< TIM11 counter stopped when core is halted */
  1226. /******************************************************************************/
  1227. /* */
  1228. /* DMA Controller (DMA) */
  1229. /* */
  1230. /******************************************************************************/
  1231. /******************* Bit definition for DMA_ISR register ********************/
  1232. #define DMA_ISR_GIF1 ((uint32_t)0x00000001) /*!< Channel 1 Global interrupt flag */
  1233. #define DMA_ISR_TCIF1 ((uint32_t)0x00000002) /*!< Channel 1 Transfer Complete flag */
  1234. #define DMA_ISR_HTIF1 ((uint32_t)0x00000004) /*!< Channel 1 Half Transfer flag */
  1235. #define DMA_ISR_TEIF1 ((uint32_t)0x00000008) /*!< Channel 1 Transfer Error flag */
  1236. #define DMA_ISR_GIF2 ((uint32_t)0x00000010) /*!< Channel 2 Global interrupt flag */
  1237. #define DMA_ISR_TCIF2 ((uint32_t)0x00000020) /*!< Channel 2 Transfer Complete flag */
  1238. #define DMA_ISR_HTIF2 ((uint32_t)0x00000040) /*!< Channel 2 Half Transfer flag */
  1239. #define DMA_ISR_TEIF2 ((uint32_t)0x00000080) /*!< Channel 2 Transfer Error flag */
  1240. #define DMA_ISR_GIF3 ((uint32_t)0x00000100) /*!< Channel 3 Global interrupt flag */
  1241. #define DMA_ISR_TCIF3 ((uint32_t)0x00000200) /*!< Channel 3 Transfer Complete flag */
  1242. #define DMA_ISR_HTIF3 ((uint32_t)0x00000400) /*!< Channel 3 Half Transfer flag */
  1243. #define DMA_ISR_TEIF3 ((uint32_t)0x00000800) /*!< Channel 3 Transfer Error flag */
  1244. #define DMA_ISR_GIF4 ((uint32_t)0x00001000) /*!< Channel 4 Global interrupt flag */
  1245. #define DMA_ISR_TCIF4 ((uint32_t)0x00002000) /*!< Channel 4 Transfer Complete flag */
  1246. #define DMA_ISR_HTIF4 ((uint32_t)0x00004000) /*!< Channel 4 Half Transfer flag */
  1247. #define DMA_ISR_TEIF4 ((uint32_t)0x00008000) /*!< Channel 4 Transfer Error flag */
  1248. #define DMA_ISR_GIF5 ((uint32_t)0x00010000) /*!< Channel 5 Global interrupt flag */
  1249. #define DMA_ISR_TCIF5 ((uint32_t)0x00020000) /*!< Channel 5 Transfer Complete flag */
  1250. #define DMA_ISR_HTIF5 ((uint32_t)0x00040000) /*!< Channel 5 Half Transfer flag */
  1251. #define DMA_ISR_TEIF5 ((uint32_t)0x00080000) /*!< Channel 5 Transfer Error flag */
  1252. #define DMA_ISR_GIF6 ((uint32_t)0x00100000) /*!< Channel 6 Global interrupt flag */
  1253. #define DMA_ISR_TCIF6 ((uint32_t)0x00200000) /*!< Channel 6 Transfer Complete flag */
  1254. #define DMA_ISR_HTIF6 ((uint32_t)0x00400000) /*!< Channel 6 Half Transfer flag */
  1255. #define DMA_ISR_TEIF6 ((uint32_t)0x00800000) /*!< Channel 6 Transfer Error flag */
  1256. #define DMA_ISR_GIF7 ((uint32_t)0x01000000) /*!< Channel 7 Global interrupt flag */
  1257. #define DMA_ISR_TCIF7 ((uint32_t)0x02000000) /*!< Channel 7 Transfer Complete flag */
  1258. #define DMA_ISR_HTIF7 ((uint32_t)0x04000000) /*!< Channel 7 Half Transfer flag */
  1259. #define DMA_ISR_TEIF7 ((uint32_t)0x08000000) /*!< Channel 7 Transfer Error flag */
  1260. /******************* Bit definition for DMA_IFCR register *******************/
  1261. #define DMA_IFCR_CGIF1 ((uint32_t)0x00000001) /*!< Channel 1 Global interrupt clear */
  1262. #define DMA_IFCR_CTCIF1 ((uint32_t)0x00000002) /*!< Channel 1 Transfer Complete clear */
  1263. #define DMA_IFCR_CHTIF1 ((uint32_t)0x00000004) /*!< Channel 1 Half Transfer clear */
  1264. #define DMA_IFCR_CTEIF1 ((uint32_t)0x00000008) /*!< Channel 1 Transfer Error clear */
  1265. #define DMA_IFCR_CGIF2 ((uint32_t)0x00000010) /*!< Channel 2 Global interrupt clear */
  1266. #define DMA_IFCR_CTCIF2 ((uint32_t)0x00000020) /*!< Channel 2 Transfer Complete clear */
  1267. #define DMA_IFCR_CHTIF2 ((uint32_t)0x00000040) /*!< Channel 2 Half Transfer clear */
  1268. #define DMA_IFCR_CTEIF2 ((uint32_t)0x00000080) /*!< Channel 2 Transfer Error clear */
  1269. #define DMA_IFCR_CGIF3 ((uint32_t)0x00000100) /*!< Channel 3 Global interrupt clear */
  1270. #define DMA_IFCR_CTCIF3 ((uint32_t)0x00000200) /*!< Channel 3 Transfer Complete clear */
  1271. #define DMA_IFCR_CHTIF3 ((uint32_t)0x00000400) /*!< Channel 3 Half Transfer clear */
  1272. #define DMA_IFCR_CTEIF3 ((uint32_t)0x00000800) /*!< Channel 3 Transfer Error clear */
  1273. #define DMA_IFCR_CGIF4 ((uint32_t)0x00001000) /*!< Channel 4 Global interrupt clear */
  1274. #define DMA_IFCR_CTCIF4 ((uint32_t)0x00002000) /*!< Channel 4 Transfer Complete clear */
  1275. #define DMA_IFCR_CHTIF4 ((uint32_t)0x00004000) /*!< Channel 4 Half Transfer clear */
  1276. #define DMA_IFCR_CTEIF4 ((uint32_t)0x00008000) /*!< Channel 4 Transfer Error clear */
  1277. #define DMA_IFCR_CGIF5 ((uint32_t)0x00010000) /*!< Channel 5 Global interrupt clear */
  1278. #define DMA_IFCR_CTCIF5 ((uint32_t)0x00020000) /*!< Channel 5 Transfer Complete clear */
  1279. #define DMA_IFCR_CHTIF5 ((uint32_t)0x00040000) /*!< Channel 5 Half Transfer clear */
  1280. #define DMA_IFCR_CTEIF5 ((uint32_t)0x00080000) /*!< Channel 5 Transfer Error clear */
  1281. #define DMA_IFCR_CGIF6 ((uint32_t)0x00100000) /*!< Channel 6 Global interrupt clear */
  1282. #define DMA_IFCR_CTCIF6 ((uint32_t)0x00200000) /*!< Channel 6 Transfer Complete clear */
  1283. #define DMA_IFCR_CHTIF6 ((uint32_t)0x00400000) /*!< Channel 6 Half Transfer clear */
  1284. #define DMA_IFCR_CTEIF6 ((uint32_t)0x00800000) /*!< Channel 6 Transfer Error clear */
  1285. #define DMA_IFCR_CGIF7 ((uint32_t)0x01000000) /*!< Channel 7 Global interrupt clear */
  1286. #define DMA_IFCR_CTCIF7 ((uint32_t)0x02000000) /*!< Channel 7 Transfer Complete clear */
  1287. #define DMA_IFCR_CHTIF7 ((uint32_t)0x04000000) /*!< Channel 7 Half Transfer clear */
  1288. #define DMA_IFCR_CTEIF7 ((uint32_t)0x08000000) /*!< Channel 7 Transfer Error clear */
  1289. /******************* Bit definition for DMA_CCR register *******************/
  1290. #define DMA_CCR_EN ((uint32_t)0x00000001) /*!< Channel enable*/
  1291. #define DMA_CCR_TCIE ((uint32_t)0x00000002) /*!< Transfer complete interrupt enable */
  1292. #define DMA_CCR_HTIE ((uint32_t)0x00000004) /*!< Half Transfer interrupt enable */
  1293. #define DMA_CCR_TEIE ((uint32_t)0x00000008) /*!< Transfer error interrupt enable */
  1294. #define DMA_CCR_DIR ((uint32_t)0x00000010) /*!< Data transfer direction */
  1295. #define DMA_CCR_CIRC ((uint32_t)0x00000020) /*!< Circular mode */
  1296. #define DMA_CCR_PINC ((uint32_t)0x00000040) /*!< Peripheral increment mode */
  1297. #define DMA_CCR_MINC ((uint32_t)0x00000080) /*!< Memory increment mode */
  1298. #define DMA_CCR_PSIZE ((uint32_t)0x00000300) /*!< PSIZE[1:0] bits (Peripheral size) */
  1299. #define DMA_CCR_PSIZE_0 ((uint32_t)0x00000100) /*!< Bit 0 */
  1300. #define DMA_CCR_PSIZE_1 ((uint32_t)0x00000200) /*!< Bit 1 */
  1301. #define DMA_CCR_MSIZE ((uint32_t)0x00000C00) /*!< MSIZE[1:0] bits (Memory size) */
  1302. #define DMA_CCR_MSIZE_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  1303. #define DMA_CCR_MSIZE_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  1304. #define DMA_CCR_PL ((uint32_t)0x00003000) /*!< PL[1:0] bits(Channel Priority level) */
  1305. #define DMA_CCR_PL_0 ((uint32_t)0x00001000) /*!< Bit 0 */
  1306. #define DMA_CCR_PL_1 ((uint32_t)0x00002000) /*!< Bit 1 */
  1307. #define DMA_CCR_MEM2MEM ((uint32_t)0x00004000) /*!< Memory to memory mode */
  1308. /****************** Bit definition for DMA_CNDTR1 register ******************/
  1309. #define DMA_CNDTR1_NDT ((uint32_t)0x0000FFFF) /*!< Number of data to Transfer */
  1310. /****************** Bit definition for DMA_CNDTR2 register ******************/
  1311. #define DMA_CNDTR2_NDT ((uint32_t)0x0000FFFF) /*!< Number of data to Transfer */
  1312. /****************** Bit definition for DMA_CNDTR3 register ******************/
  1313. #define DMA_CNDTR3_NDT ((uint32_t)0x0000FFFF) /*!< Number of data to Transfer */
  1314. /****************** Bit definition for DMA_CNDTR4 register ******************/
  1315. #define DMA_CNDTR4_NDT ((uint32_t)0x0000FFFF) /*!< Number of data to Transfer */
  1316. /****************** Bit definition for DMA_CNDTR5 register ******************/
  1317. #define DMA_CNDTR5_NDT ((uint32_t)0x0000FFFF) /*!< Number of data to Transfer */
  1318. /****************** Bit definition for DMA_CNDTR6 register ******************/
  1319. #define DMA_CNDTR6_NDT ((uint32_t)0x0000FFFF) /*!< Number of data to Transfer */
  1320. /****************** Bit definition for DMA_CNDTR7 register ******************/
  1321. #define DMA_CNDTR7_NDT ((uint32_t)0x0000FFFF) /*!< Number of data to Transfer */
  1322. /****************** Bit definition for DMA_CPAR1 register *******************/
  1323. #define DMA_CPAR1_PA ((uint32_t)0xFFFFFFFF) /*!< Peripheral Address */
  1324. /****************** Bit definition for DMA_CPAR2 register *******************/
  1325. #define DMA_CPAR2_PA ((uint32_t)0xFFFFFFFF) /*!< Peripheral Address */
  1326. /****************** Bit definition for DMA_CPAR3 register *******************/
  1327. #define DMA_CPAR3_PA ((uint32_t)0xFFFFFFFF) /*!< Peripheral Address */
  1328. /****************** Bit definition for DMA_CPAR4 register *******************/
  1329. #define DMA_CPAR4_PA ((uint32_t)0xFFFFFFFF) /*!< Peripheral Address */
  1330. /****************** Bit definition for DMA_CPAR5 register *******************/
  1331. #define DMA_CPAR5_PA ((uint32_t)0xFFFFFFFF) /*!< Peripheral Address */
  1332. /****************** Bit definition for DMA_CPAR6 register *******************/
  1333. #define DMA_CPAR6_PA ((uint32_t)0xFFFFFFFF) /*!< Peripheral Address */
  1334. /****************** Bit definition for DMA_CPAR7 register *******************/
  1335. #define DMA_CPAR7_PA ((uint32_t)0xFFFFFFFF) /*!< Peripheral Address */
  1336. /****************** Bit definition for DMA_CMAR1 register *******************/
  1337. #define DMA_CMAR1_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  1338. /****************** Bit definition for DMA_CMAR2 register *******************/
  1339. #define DMA_CMAR2_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  1340. /****************** Bit definition for DMA_CMAR3 register *******************/
  1341. #define DMA_CMAR3_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  1342. /****************** Bit definition for DMA_CMAR4 register *******************/
  1343. #define DMA_CMAR4_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  1344. /****************** Bit definition for DMA_CMAR5 register *******************/
  1345. #define DMA_CMAR5_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  1346. /****************** Bit definition for DMA_CMAR6 register *******************/
  1347. #define DMA_CMAR6_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  1348. /****************** Bit definition for DMA_CMAR7 register *******************/
  1349. #define DMA_CMAR7_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  1350. /******************************************************************************/
  1351. /* */
  1352. /* External Interrupt/Event Controller (EXTI) */
  1353. /* */
  1354. /******************************************************************************/
  1355. /******************* Bit definition for EXTI_IMR register *******************/
  1356. #define EXTI_IMR_MR0 ((uint32_t)0x00000001) /*!< Interrupt Mask on line 0 */
  1357. #define EXTI_IMR_MR1 ((uint32_t)0x00000002) /*!< Interrupt Mask on line 1 */
  1358. #define EXTI_IMR_MR2 ((uint32_t)0x00000004) /*!< Interrupt Mask on line 2 */
  1359. #define EXTI_IMR_MR3 ((uint32_t)0x00000008) /*!< Interrupt Mask on line 3 */
  1360. #define EXTI_IMR_MR4 ((uint32_t)0x00000010) /*!< Interrupt Mask on line 4 */
  1361. #define EXTI_IMR_MR5 ((uint32_t)0x00000020) /*!< Interrupt Mask on line 5 */
  1362. #define EXTI_IMR_MR6 ((uint32_t)0x00000040) /*!< Interrupt Mask on line 6 */
  1363. #define EXTI_IMR_MR7 ((uint32_t)0x00000080) /*!< Interrupt Mask on line 7 */
  1364. #define EXTI_IMR_MR8 ((uint32_t)0x00000100) /*!< Interrupt Mask on line 8 */
  1365. #define EXTI_IMR_MR9 ((uint32_t)0x00000200) /*!< Interrupt Mask on line 9 */
  1366. #define EXTI_IMR_MR10 ((uint32_t)0x00000400) /*!< Interrupt Mask on line 10 */
  1367. #define EXTI_IMR_MR11 ((uint32_t)0x00000800) /*!< Interrupt Mask on line 11 */
  1368. #define EXTI_IMR_MR12 ((uint32_t)0x00001000) /*!< Interrupt Mask on line 12 */
  1369. #define EXTI_IMR_MR13 ((uint32_t)0x00002000) /*!< Interrupt Mask on line 13 */
  1370. #define EXTI_IMR_MR14 ((uint32_t)0x00004000) /*!< Interrupt Mask on line 14 */
  1371. #define EXTI_IMR_MR15 ((uint32_t)0x00008000) /*!< Interrupt Mask on line 15 */
  1372. #define EXTI_IMR_MR16 ((uint32_t)0x00010000) /*!< Interrupt Mask on line 16 */
  1373. #define EXTI_IMR_MR17 ((uint32_t)0x00020000) /*!< Interrupt Mask on line 17 */
  1374. #define EXTI_IMR_MR18 ((uint32_t)0x00040000) /*!< Interrupt Mask on line 18 */
  1375. #define EXTI_IMR_MR19 ((uint32_t)0x00080000) /*!< Interrupt Mask on line 19 */
  1376. #define EXTI_IMR_MR20 ((uint32_t)0x00100000) /*!< Interrupt Mask on line 20 */
  1377. #define EXTI_IMR_MR21 ((uint32_t)0x00200000) /*!< Interrupt Mask on line 21 */
  1378. #define EXTI_IMR_MR22 ((uint32_t)0x00400000) /*!< Interrupt Mask on line 22 */
  1379. #define EXTI_IMR_MR23 ((uint32_t)0x00800000) /*!< Interrupt Mask on line 23 */
  1380. /******************* Bit definition for EXTI_EMR register *******************/
  1381. #define EXTI_EMR_MR0 ((uint32_t)0x00000001) /*!< Event Mask on line 0 */
  1382. #define EXTI_EMR_MR1 ((uint32_t)0x00000002) /*!< Event Mask on line 1 */
  1383. #define EXTI_EMR_MR2 ((uint32_t)0x00000004) /*!< Event Mask on line 2 */
  1384. #define EXTI_EMR_MR3 ((uint32_t)0x00000008) /*!< Event Mask on line 3 */
  1385. #define EXTI_EMR_MR4 ((uint32_t)0x00000010) /*!< Event Mask on line 4 */
  1386. #define EXTI_EMR_MR5 ((uint32_t)0x00000020) /*!< Event Mask on line 5 */
  1387. #define EXTI_EMR_MR6 ((uint32_t)0x00000040) /*!< Event Mask on line 6 */
  1388. #define EXTI_EMR_MR7 ((uint32_t)0x00000080) /*!< Event Mask on line 7 */
  1389. #define EXTI_EMR_MR8 ((uint32_t)0x00000100) /*!< Event Mask on line 8 */
  1390. #define EXTI_EMR_MR9 ((uint32_t)0x00000200) /*!< Event Mask on line 9 */
  1391. #define EXTI_EMR_MR10 ((uint32_t)0x00000400) /*!< Event Mask on line 10 */
  1392. #define EXTI_EMR_MR11 ((uint32_t)0x00000800) /*!< Event Mask on line 11 */
  1393. #define EXTI_EMR_MR12 ((uint32_t)0x00001000) /*!< Event Mask on line 12 */
  1394. #define EXTI_EMR_MR13 ((uint32_t)0x00002000) /*!< Event Mask on line 13 */
  1395. #define EXTI_EMR_MR14 ((uint32_t)0x00004000) /*!< Event Mask on line 14 */
  1396. #define EXTI_EMR_MR15 ((uint32_t)0x00008000) /*!< Event Mask on line 15 */
  1397. #define EXTI_EMR_MR16 ((uint32_t)0x00010000) /*!< Event Mask on line 16 */
  1398. #define EXTI_EMR_MR17 ((uint32_t)0x00020000) /*!< Event Mask on line 17 */
  1399. #define EXTI_EMR_MR18 ((uint32_t)0x00040000) /*!< Event Mask on line 18 */
  1400. #define EXTI_EMR_MR19 ((uint32_t)0x00080000) /*!< Event Mask on line 19 */
  1401. #define EXTI_EMR_MR20 ((uint32_t)0x00100000) /*!< Event Mask on line 20 */
  1402. #define EXTI_EMR_MR21 ((uint32_t)0x00200000) /*!< Event Mask on line 21 */
  1403. #define EXTI_EMR_MR22 ((uint32_t)0x00400000) /*!< Event Mask on line 22 */
  1404. #define EXTI_EMR_MR23 ((uint32_t)0x00800000) /*!< Event Mask on line 23 */
  1405. /****************** Bit definition for EXTI_RTSR register *******************/
  1406. #define EXTI_RTSR_TR0 ((uint32_t)0x00000001) /*!< Rising trigger event configuration bit of line 0 */
  1407. #define EXTI_RTSR_TR1 ((uint32_t)0x00000002) /*!< Rising trigger event configuration bit of line 1 */
  1408. #define EXTI_RTSR_TR2 ((uint32_t)0x00000004) /*!< Rising trigger event configuration bit of line 2 */
  1409. #define EXTI_RTSR_TR3 ((uint32_t)0x00000008) /*!< Rising trigger event configuration bit of line 3 */
  1410. #define EXTI_RTSR_TR4 ((uint32_t)0x00000010) /*!< Rising trigger event configuration bit of line 4 */
  1411. #define EXTI_RTSR_TR5 ((uint32_t)0x00000020) /*!< Rising trigger event configuration bit of line 5 */
  1412. #define EXTI_RTSR_TR6 ((uint32_t)0x00000040) /*!< Rising trigger event configuration bit of line 6 */
  1413. #define EXTI_RTSR_TR7 ((uint32_t)0x00000080) /*!< Rising trigger event configuration bit of line 7 */
  1414. #define EXTI_RTSR_TR8 ((uint32_t)0x00000100) /*!< Rising trigger event configuration bit of line 8 */
  1415. #define EXTI_RTSR_TR9 ((uint32_t)0x00000200) /*!< Rising trigger event configuration bit of line 9 */
  1416. #define EXTI_RTSR_TR10 ((uint32_t)0x00000400) /*!< Rising trigger event configuration bit of line 10 */
  1417. #define EXTI_RTSR_TR11 ((uint32_t)0x00000800) /*!< Rising trigger event configuration bit of line 11 */
  1418. #define EXTI_RTSR_TR12 ((uint32_t)0x00001000) /*!< Rising trigger event configuration bit of line 12 */
  1419. #define EXTI_RTSR_TR13 ((uint32_t)0x00002000) /*!< Rising trigger event configuration bit of line 13 */
  1420. #define EXTI_RTSR_TR14 ((uint32_t)0x00004000) /*!< Rising trigger event configuration bit of line 14 */
  1421. #define EXTI_RTSR_TR15 ((uint32_t)0x00008000) /*!< Rising trigger event configuration bit of line 15 */
  1422. #define EXTI_RTSR_TR16 ((uint32_t)0x00010000) /*!< Rising trigger event configuration bit of line 16 */
  1423. #define EXTI_RTSR_TR17 ((uint32_t)0x00020000) /*!< Rising trigger event configuration bit of line 17 */
  1424. #define EXTI_RTSR_TR18 ((uint32_t)0x00040000) /*!< Rising trigger event configuration bit of line 18 */
  1425. #define EXTI_RTSR_TR19 ((uint32_t)0x00080000) /*!< Rising trigger event configuration bit of line 19 */
  1426. #define EXTI_RTSR_TR20 ((uint32_t)0x00100000) /*!< Rising trigger event configuration bit of line 20 */
  1427. #define EXTI_RTSR_TR21 ((uint32_t)0x00200000) /*!< Rising trigger event configuration bit of line 21 */
  1428. #define EXTI_RTSR_TR22 ((uint32_t)0x00400000) /*!< Rising trigger event configuration bit of line 22 */
  1429. #define EXTI_RTSR_TR23 ((uint32_t)0x00800000) /*!< Rising trigger event configuration bit of line 23 */
  1430. /****************** Bit definition for EXTI_FTSR register *******************/
  1431. #define EXTI_FTSR_TR0 ((uint32_t)0x00000001) /*!< Falling trigger event configuration bit of line 0 */
  1432. #define EXTI_FTSR_TR1 ((uint32_t)0x00000002) /*!< Falling trigger event configuration bit of line 1 */
  1433. #define EXTI_FTSR_TR2 ((uint32_t)0x00000004) /*!< Falling trigger event configuration bit of line 2 */
  1434. #define EXTI_FTSR_TR3 ((uint32_t)0x00000008) /*!< Falling trigger event configuration bit of line 3 */
  1435. #define EXTI_FTSR_TR4 ((uint32_t)0x00000010) /*!< Falling trigger event configuration bit of line 4 */
  1436. #define EXTI_FTSR_TR5 ((uint32_t)0x00000020) /*!< Falling trigger event configuration bit of line 5 */
  1437. #define EXTI_FTSR_TR6 ((uint32_t)0x00000040) /*!< Falling trigger event configuration bit of line 6 */
  1438. #define EXTI_FTSR_TR7 ((uint32_t)0x00000080) /*!< Falling trigger event configuration bit of line 7 */
  1439. #define EXTI_FTSR_TR8 ((uint32_t)0x00000100) /*!< Falling trigger event configuration bit of line 8 */
  1440. #define EXTI_FTSR_TR9 ((uint32_t)0x00000200) /*!< Falling trigger event configuration bit of line 9 */
  1441. #define EXTI_FTSR_TR10 ((uint32_t)0x00000400) /*!< Falling trigger event configuration bit of line 10 */
  1442. #define EXTI_FTSR_TR11 ((uint32_t)0x00000800) /*!< Falling trigger event configuration bit of line 11 */
  1443. #define EXTI_FTSR_TR12 ((uint32_t)0x00001000) /*!< Falling trigger event configuration bit of line 12 */
  1444. #define EXTI_FTSR_TR13 ((uint32_t)0x00002000) /*!< Falling trigger event configuration bit of line 13 */
  1445. #define EXTI_FTSR_TR14 ((uint32_t)0x00004000) /*!< Falling trigger event configuration bit of line 14 */
  1446. #define EXTI_FTSR_TR15 ((uint32_t)0x00008000) /*!< Falling trigger event configuration bit of line 15 */
  1447. #define EXTI_FTSR_TR16 ((uint32_t)0x00010000) /*!< Falling trigger event configuration bit of line 16 */
  1448. #define EXTI_FTSR_TR17 ((uint32_t)0x00020000) /*!< Falling trigger event configuration bit of line 17 */
  1449. #define EXTI_FTSR_TR18 ((uint32_t)0x00040000) /*!< Falling trigger event configuration bit of line 18 */
  1450. #define EXTI_FTSR_TR19 ((uint32_t)0x00080000) /*!< Falling trigger event configuration bit of line 19 */
  1451. #define EXTI_FTSR_TR20 ((uint32_t)0x00100000) /*!< Falling trigger event configuration bit of line 20 */
  1452. #define EXTI_FTSR_TR21 ((uint32_t)0x00200000) /*!< Falling trigger event configuration bit of line 21 */
  1453. #define EXTI_FTSR_TR22 ((uint32_t)0x00400000) /*!< Falling trigger event configuration bit of line 22 */
  1454. #define EXTI_FTSR_TR23 ((uint32_t)0x00800000) /*!< Falling trigger event configuration bit of line 23 */
  1455. /****************** Bit definition for EXTI_SWIER register ******************/
  1456. #define EXTI_SWIER_SWIER0 ((uint32_t)0x00000001) /*!< Software Interrupt on line 0 */
  1457. #define EXTI_SWIER_SWIER1 ((uint32_t)0x00000002) /*!< Software Interrupt on line 1 */
  1458. #define EXTI_SWIER_SWIER2 ((uint32_t)0x00000004) /*!< Software Interrupt on line 2 */
  1459. #define EXTI_SWIER_SWIER3 ((uint32_t)0x00000008) /*!< Software Interrupt on line 3 */
  1460. #define EXTI_SWIER_SWIER4 ((uint32_t)0x00000010) /*!< Software Interrupt on line 4 */
  1461. #define EXTI_SWIER_SWIER5 ((uint32_t)0x00000020) /*!< Software Interrupt on line 5 */
  1462. #define EXTI_SWIER_SWIER6 ((uint32_t)0x00000040) /*!< Software Interrupt on line 6 */
  1463. #define EXTI_SWIER_SWIER7 ((uint32_t)0x00000080) /*!< Software Interrupt on line 7 */
  1464. #define EXTI_SWIER_SWIER8 ((uint32_t)0x00000100) /*!< Software Interrupt on line 8 */
  1465. #define EXTI_SWIER_SWIER9 ((uint32_t)0x00000200) /*!< Software Interrupt on line 9 */
  1466. #define EXTI_SWIER_SWIER10 ((uint32_t)0x00000400) /*!< Software Interrupt on line 10 */
  1467. #define EXTI_SWIER_SWIER11 ((uint32_t)0x00000800) /*!< Software Interrupt on line 11 */
  1468. #define EXTI_SWIER_SWIER12 ((uint32_t)0x00001000) /*!< Software Interrupt on line 12 */
  1469. #define EXTI_SWIER_SWIER13 ((uint32_t)0x00002000) /*!< Software Interrupt on line 13 */
  1470. #define EXTI_SWIER_SWIER14 ((uint32_t)0x00004000) /*!< Software Interrupt on line 14 */
  1471. #define EXTI_SWIER_SWIER15 ((uint32_t)0x00008000) /*!< Software Interrupt on line 15 */
  1472. #define EXTI_SWIER_SWIER16 ((uint32_t)0x00010000) /*!< Software Interrupt on line 16 */
  1473. #define EXTI_SWIER_SWIER17 ((uint32_t)0x00020000) /*!< Software Interrupt on line 17 */
  1474. #define EXTI_SWIER_SWIER18 ((uint32_t)0x00040000) /*!< Software Interrupt on line 18 */
  1475. #define EXTI_SWIER_SWIER19 ((uint32_t)0x00080000) /*!< Software Interrupt on line 19 */
  1476. #define EXTI_SWIER_SWIER20 ((uint32_t)0x00100000) /*!< Software Interrupt on line 20 */
  1477. #define EXTI_SWIER_SWIER21 ((uint32_t)0x00200000) /*!< Software Interrupt on line 21 */
  1478. #define EXTI_SWIER_SWIER22 ((uint32_t)0x00400000) /*!< Software Interrupt on line 22 */
  1479. #define EXTI_SWIER_SWIER23 ((uint32_t)0x00800000) /*!< Software Interrupt on line 23 */
  1480. /******************* Bit definition for EXTI_PR register ********************/
  1481. #define EXTI_PR_PR0 ((uint32_t)0x00000001) /*!< Pending bit 0 */
  1482. #define EXTI_PR_PR1 ((uint32_t)0x00000002) /*!< Pending bit 1 */
  1483. #define EXTI_PR_PR2 ((uint32_t)0x00000004) /*!< Pending bit 2 */
  1484. #define EXTI_PR_PR3 ((uint32_t)0x00000008) /*!< Pending bit 3 */
  1485. #define EXTI_PR_PR4 ((uint32_t)0x00000010) /*!< Pending bit 4 */
  1486. #define EXTI_PR_PR5 ((uint32_t)0x00000020) /*!< Pending bit 5 */
  1487. #define EXTI_PR_PR6 ((uint32_t)0x00000040) /*!< Pending bit 6 */
  1488. #define EXTI_PR_PR7 ((uint32_t)0x00000080) /*!< Pending bit 7 */
  1489. #define EXTI_PR_PR8 ((uint32_t)0x00000100) /*!< Pending bit 8 */
  1490. #define EXTI_PR_PR9 ((uint32_t)0x00000200) /*!< Pending bit 9 */
  1491. #define EXTI_PR_PR10 ((uint32_t)0x00000400) /*!< Pending bit 10 */
  1492. #define EXTI_PR_PR11 ((uint32_t)0x00000800) /*!< Pending bit 11 */
  1493. #define EXTI_PR_PR12 ((uint32_t)0x00001000) /*!< Pending bit 12 */
  1494. #define EXTI_PR_PR13 ((uint32_t)0x00002000) /*!< Pending bit 13 */
  1495. #define EXTI_PR_PR14 ((uint32_t)0x00004000) /*!< Pending bit 14 */
  1496. #define EXTI_PR_PR15 ((uint32_t)0x00008000) /*!< Pending bit 15 */
  1497. #define EXTI_PR_PR16 ((uint32_t)0x00010000) /*!< Pending bit 16 */
  1498. #define EXTI_PR_PR17 ((uint32_t)0x00020000) /*!< Pending bit 17 */
  1499. #define EXTI_PR_PR18 ((uint32_t)0x00040000) /*!< Pending bit 18 */
  1500. #define EXTI_PR_PR19 ((uint32_t)0x00080000) /*!< Pending bit 19 */
  1501. #define EXTI_PR_PR20 ((uint32_t)0x00100000) /*!< Pending bit 20 */
  1502. #define EXTI_PR_PR21 ((uint32_t)0x00200000) /*!< Pending bit 21 */
  1503. #define EXTI_PR_PR22 ((uint32_t)0x00400000) /*!< Pending bit 22 */
  1504. #define EXTI_PR_PR23 ((uint32_t)0x00800000) /*!< Pending bit 23 */
  1505. /******************************************************************************/
  1506. /* */
  1507. /* FLASH, DATA EEPROM and Option Bytes Registers */
  1508. /* (FLASH, DATA_EEPROM, OB) */
  1509. /* */
  1510. /******************************************************************************/
  1511. /******************* Bit definition for FLASH_ACR register ******************/
  1512. #define FLASH_ACR_LATENCY ((uint32_t)0x00000001) /*!< Latency */
  1513. #define FLASH_ACR_PRFTEN ((uint32_t)0x00000002) /*!< Prefetch Buffer Enable */
  1514. #define FLASH_ACR_ACC64 ((uint32_t)0x00000004) /*!< Access 64 bits */
  1515. #define FLASH_ACR_SLEEP_PD ((uint32_t)0x00000008) /*!< Flash mode during sleep mode */
  1516. #define FLASH_ACR_RUN_PD ((uint32_t)0x00000010) /*!< Flash mode during RUN mode */
  1517. /******************* Bit definition for FLASH_PECR register ******************/
  1518. #define FLASH_PECR_PELOCK ((uint32_t)0x00000001) /*!< FLASH_PECR and Flash data Lock */
  1519. #define FLASH_PECR_PRGLOCK ((uint32_t)0x00000002) /*!< Program matrix Lock */
  1520. #define FLASH_PECR_OPTLOCK ((uint32_t)0x00000004) /*!< Option byte matrix Lock */
  1521. #define FLASH_PECR_PROG ((uint32_t)0x00000008) /*!< Program matrix selection */
  1522. #define FLASH_PECR_DATA ((uint32_t)0x00000010) /*!< Data matrix selection */
  1523. #define FLASH_PECR_FTDW ((uint32_t)0x00000100) /*!< Fixed Time Data write for Word/Half Word/Byte programming */
  1524. #define FLASH_PECR_ERASE ((uint32_t)0x00000200) /*!< Page erasing mode */
  1525. #define FLASH_PECR_FPRG ((uint32_t)0x00000400) /*!< Fast Page/Half Page programming mode */
  1526. #define FLASH_PECR_EOPIE ((uint32_t)0x00010000) /*!< End of programming interrupt */
  1527. #define FLASH_PECR_ERRIE ((uint32_t)0x00020000) /*!< Error interrupt */
  1528. #define FLASH_PECR_OBL_LAUNCH ((uint32_t)0x00040000) /*!< Launch the option byte loading */
  1529. /****************** Bit definition for FLASH_PDKEYR register ******************/
  1530. #define FLASH_PDKEYR_PDKEYR ((uint32_t)0xFFFFFFFF) /*!< FLASH_PEC and data matrix Key */
  1531. /****************** Bit definition for FLASH_PEKEYR register ******************/
  1532. #define FLASH_PEKEYR_PEKEYR ((uint32_t)0xFFFFFFFF) /*!< FLASH_PEC and data matrix Key */
  1533. /****************** Bit definition for FLASH_PRGKEYR register ******************/
  1534. #define FLASH_PRGKEYR_PRGKEYR ((uint32_t)0xFFFFFFFF) /*!< Program matrix Key */
  1535. /****************** Bit definition for FLASH_OPTKEYR register ******************/
  1536. #define FLASH_OPTKEYR_OPTKEYR ((uint32_t)0xFFFFFFFF) /*!< Option bytes matrix Key */
  1537. /****************** Bit definition for FLASH_SR register *******************/
  1538. #define FLASH_SR_BSY ((uint32_t)0x00000001) /*!< Busy */
  1539. #define FLASH_SR_EOP ((uint32_t)0x00000002) /*!< End Of Programming*/
  1540. #define FLASH_SR_ENDHV ((uint32_t)0x00000004) /*!< End of high voltage */
  1541. #define FLASH_SR_READY ((uint32_t)0x00000008) /*!< Flash ready after low power mode */
  1542. #define FLASH_SR_WRPERR ((uint32_t)0x00000100) /*!< Write protected error */
  1543. #define FLASH_SR_PGAERR ((uint32_t)0x00000200) /*!< Programming Alignment Error */
  1544. #define FLASH_SR_SIZERR ((uint32_t)0x00000400) /*!< Size error */
  1545. #define FLASH_SR_OPTVERR ((uint32_t)0x00000800) /*!< Option validity error */
  1546. #define FLASH_SR_RDERR ((uint32_t)0x00002000) /*!< Read protected error */
  1547. /****************** Bit definition for FLASH_OBR register *******************/
  1548. #define FLASH_OBR_RDPRT ((uint32_t)0x000000FF) /*!< Read Protection */
  1549. #define FLASH_OBR_BOR_LEV ((uint32_t)0x000F0000) /*!< BOR_LEV[3:0] Brown Out Reset Threshold Level*/
  1550. #define FLASH_OBR_USER ((uint32_t)0x00700000) /*!< User Option Bytes */
  1551. #define FLASH_OBR_IWDG_SW ((uint32_t)0x00100000) /*!< IWDG_SW */
  1552. #define FLASH_OBR_nRST_STOP ((uint32_t)0x00200000) /*!< nRST_STOP */
  1553. #define FLASH_OBR_nRST_STDBY ((uint32_t)0x00400000) /*!< nRST_STDBY */
  1554. /****************** Bit definition for FLASH_WRPR register ******************/
  1555. #define FLASH_WRPR1_WRP ((uint32_t)0xFFFFFFFF) /*!< Write Protect */
  1556. /******************************************************************************/
  1557. /* */
  1558. /* General Purpose I/O */
  1559. /* */
  1560. /******************************************************************************/
  1561. /****************** Bits definition for GPIO_MODER register *****************/
  1562. #define GPIO_MODER_MODER0 ((uint32_t)0x00000003)
  1563. #define GPIO_MODER_MODER0_0 ((uint32_t)0x00000001)
  1564. #define GPIO_MODER_MODER0_1 ((uint32_t)0x00000002)
  1565. #define GPIO_MODER_MODER1 ((uint32_t)0x0000000C)
  1566. #define GPIO_MODER_MODER1_0 ((uint32_t)0x00000004)
  1567. #define GPIO_MODER_MODER1_1 ((uint32_t)0x00000008)
  1568. #define GPIO_MODER_MODER2 ((uint32_t)0x00000030)
  1569. #define GPIO_MODER_MODER2_0 ((uint32_t)0x00000010)
  1570. #define GPIO_MODER_MODER2_1 ((uint32_t)0x00000020)
  1571. #define GPIO_MODER_MODER3 ((uint32_t)0x000000C0)
  1572. #define GPIO_MODER_MODER3_0 ((uint32_t)0x00000040)
  1573. #define GPIO_MODER_MODER3_1 ((uint32_t)0x00000080)
  1574. #define GPIO_MODER_MODER4 ((uint32_t)0x00000300)
  1575. #define GPIO_MODER_MODER4_0 ((uint32_t)0x00000100)
  1576. #define GPIO_MODER_MODER4_1 ((uint32_t)0x00000200)
  1577. #define GPIO_MODER_MODER5 ((uint32_t)0x00000C00)
  1578. #define GPIO_MODER_MODER5_0 ((uint32_t)0x00000400)
  1579. #define GPIO_MODER_MODER5_1 ((uint32_t)0x00000800)
  1580. #define GPIO_MODER_MODER6 ((uint32_t)0x00003000)
  1581. #define GPIO_MODER_MODER6_0 ((uint32_t)0x00001000)
  1582. #define GPIO_MODER_MODER6_1 ((uint32_t)0x00002000)
  1583. #define GPIO_MODER_MODER7 ((uint32_t)0x0000C000)
  1584. #define GPIO_MODER_MODER7_0 ((uint32_t)0x00004000)
  1585. #define GPIO_MODER_MODER7_1 ((uint32_t)0x00008000)
  1586. #define GPIO_MODER_MODER8 ((uint32_t)0x00030000)
  1587. #define GPIO_MODER_MODER8_0 ((uint32_t)0x00010000)
  1588. #define GPIO_MODER_MODER8_1 ((uint32_t)0x00020000)
  1589. #define GPIO_MODER_MODER9 ((uint32_t)0x000C0000)
  1590. #define GPIO_MODER_MODER9_0 ((uint32_t)0x00040000)
  1591. #define GPIO_MODER_MODER9_1 ((uint32_t)0x00080000)
  1592. #define GPIO_MODER_MODER10 ((uint32_t)0x00300000)
  1593. #define GPIO_MODER_MODER10_0 ((uint32_t)0x00100000)
  1594. #define GPIO_MODER_MODER10_1 ((uint32_t)0x00200000)
  1595. #define GPIO_MODER_MODER11 ((uint32_t)0x00C00000)
  1596. #define GPIO_MODER_MODER11_0 ((uint32_t)0x00400000)
  1597. #define GPIO_MODER_MODER11_1 ((uint32_t)0x00800000)
  1598. #define GPIO_MODER_MODER12 ((uint32_t)0x03000000)
  1599. #define GPIO_MODER_MODER12_0 ((uint32_t)0x01000000)
  1600. #define GPIO_MODER_MODER12_1 ((uint32_t)0x02000000)
  1601. #define GPIO_MODER_MODER13 ((uint32_t)0x0C000000)
  1602. #define GPIO_MODER_MODER13_0 ((uint32_t)0x04000000)
  1603. #define GPIO_MODER_MODER13_1 ((uint32_t)0x08000000)
  1604. #define GPIO_MODER_MODER14 ((uint32_t)0x30000000)
  1605. #define GPIO_MODER_MODER14_0 ((uint32_t)0x10000000)
  1606. #define GPIO_MODER_MODER14_1 ((uint32_t)0x20000000)
  1607. #define GPIO_MODER_MODER15 ((uint32_t)0xC0000000)
  1608. #define GPIO_MODER_MODER15_0 ((uint32_t)0x40000000)
  1609. #define GPIO_MODER_MODER15_1 ((uint32_t)0x80000000)
  1610. /****************** Bits definition for GPIO_OTYPER register ****************/
  1611. #define GPIO_OTYPER_OT_0 ((uint32_t)0x00000001)
  1612. #define GPIO_OTYPER_OT_1 ((uint32_t)0x00000002)
  1613. #define GPIO_OTYPER_OT_2 ((uint32_t)0x00000004)
  1614. #define GPIO_OTYPER_OT_3 ((uint32_t)0x00000008)
  1615. #define GPIO_OTYPER_OT_4 ((uint32_t)0x00000010)
  1616. #define GPIO_OTYPER_OT_5 ((uint32_t)0x00000020)
  1617. #define GPIO_OTYPER_OT_6 ((uint32_t)0x00000040)
  1618. #define GPIO_OTYPER_OT_7 ((uint32_t)0x00000080)
  1619. #define GPIO_OTYPER_OT_8 ((uint32_t)0x00000100)
  1620. #define GPIO_OTYPER_OT_9 ((uint32_t)0x00000200)
  1621. #define GPIO_OTYPER_OT_10 ((uint32_t)0x00000400)
  1622. #define GPIO_OTYPER_OT_11 ((uint32_t)0x00000800)
  1623. #define GPIO_OTYPER_OT_12 ((uint32_t)0x00001000)
  1624. #define GPIO_OTYPER_OT_13 ((uint32_t)0x00002000)
  1625. #define GPIO_OTYPER_OT_14 ((uint32_t)0x00004000)
  1626. #define GPIO_OTYPER_OT_15 ((uint32_t)0x00008000)
  1627. /****************** Bits definition for GPIO_OSPEEDR register ***************/
  1628. #define GPIO_OSPEEDER_OSPEEDR0 ((uint32_t)0x00000003)
  1629. #define GPIO_OSPEEDER_OSPEEDR0_0 ((uint32_t)0x00000001)
  1630. #define GPIO_OSPEEDER_OSPEEDR0_1 ((uint32_t)0x00000002)
  1631. #define GPIO_OSPEEDER_OSPEEDR1 ((uint32_t)0x0000000C)
  1632. #define GPIO_OSPEEDER_OSPEEDR1_0 ((uint32_t)0x00000004)
  1633. #define GPIO_OSPEEDER_OSPEEDR1_1 ((uint32_t)0x00000008)
  1634. #define GPIO_OSPEEDER_OSPEEDR2 ((uint32_t)0x00000030)
  1635. #define GPIO_OSPEEDER_OSPEEDR2_0 ((uint32_t)0x00000010)
  1636. #define GPIO_OSPEEDER_OSPEEDR2_1 ((uint32_t)0x00000020)
  1637. #define GPIO_OSPEEDER_OSPEEDR3 ((uint32_t)0x000000C0)
  1638. #define GPIO_OSPEEDER_OSPEEDR3_0 ((uint32_t)0x00000040)
  1639. #define GPIO_OSPEEDER_OSPEEDR3_1 ((uint32_t)0x00000080)
  1640. #define GPIO_OSPEEDER_OSPEEDR4 ((uint32_t)0x00000300)
  1641. #define GPIO_OSPEEDER_OSPEEDR4_0 ((uint32_t)0x00000100)
  1642. #define GPIO_OSPEEDER_OSPEEDR4_1 ((uint32_t)0x00000200)
  1643. #define GPIO_OSPEEDER_OSPEEDR5 ((uint32_t)0x00000C00)
  1644. #define GPIO_OSPEEDER_OSPEEDR5_0 ((uint32_t)0x00000400)
  1645. #define GPIO_OSPEEDER_OSPEEDR5_1 ((uint32_t)0x00000800)
  1646. #define GPIO_OSPEEDER_OSPEEDR6 ((uint32_t)0x00003000)
  1647. #define GPIO_OSPEEDER_OSPEEDR6_0 ((uint32_t)0x00001000)
  1648. #define GPIO_OSPEEDER_OSPEEDR6_1 ((uint32_t)0x00002000)
  1649. #define GPIO_OSPEEDER_OSPEEDR7 ((uint32_t)0x0000C000)
  1650. #define GPIO_OSPEEDER_OSPEEDR7_0 ((uint32_t)0x00004000)
  1651. #define GPIO_OSPEEDER_OSPEEDR7_1 ((uint32_t)0x00008000)
  1652. #define GPIO_OSPEEDER_OSPEEDR8 ((uint32_t)0x00030000)
  1653. #define GPIO_OSPEEDER_OSPEEDR8_0 ((uint32_t)0x00010000)
  1654. #define GPIO_OSPEEDER_OSPEEDR8_1 ((uint32_t)0x00020000)
  1655. #define GPIO_OSPEEDER_OSPEEDR9 ((uint32_t)0x000C0000)
  1656. #define GPIO_OSPEEDER_OSPEEDR9_0 ((uint32_t)0x00040000)
  1657. #define GPIO_OSPEEDER_OSPEEDR9_1 ((uint32_t)0x00080000)
  1658. #define GPIO_OSPEEDER_OSPEEDR10 ((uint32_t)0x00300000)
  1659. #define GPIO_OSPEEDER_OSPEEDR10_0 ((uint32_t)0x00100000)
  1660. #define GPIO_OSPEEDER_OSPEEDR10_1 ((uint32_t)0x00200000)
  1661. #define GPIO_OSPEEDER_OSPEEDR11 ((uint32_t)0x00C00000)
  1662. #define GPIO_OSPEEDER_OSPEEDR11_0 ((uint32_t)0x00400000)
  1663. #define GPIO_OSPEEDER_OSPEEDR11_1 ((uint32_t)0x00800000)
  1664. #define GPIO_OSPEEDER_OSPEEDR12 ((uint32_t)0x03000000)
  1665. #define GPIO_OSPEEDER_OSPEEDR12_0 ((uint32_t)0x01000000)
  1666. #define GPIO_OSPEEDER_OSPEEDR12_1 ((uint32_t)0x02000000)
  1667. #define GPIO_OSPEEDER_OSPEEDR13 ((uint32_t)0x0C000000)
  1668. #define GPIO_OSPEEDER_OSPEEDR13_0 ((uint32_t)0x04000000)
  1669. #define GPIO_OSPEEDER_OSPEEDR13_1 ((uint32_t)0x08000000)
  1670. #define GPIO_OSPEEDER_OSPEEDR14 ((uint32_t)0x30000000)
  1671. #define GPIO_OSPEEDER_OSPEEDR14_0 ((uint32_t)0x10000000)
  1672. #define GPIO_OSPEEDER_OSPEEDR14_1 ((uint32_t)0x20000000)
  1673. #define GPIO_OSPEEDER_OSPEEDR15 ((uint32_t)0xC0000000)
  1674. #define GPIO_OSPEEDER_OSPEEDR15_0 ((uint32_t)0x40000000)
  1675. #define GPIO_OSPEEDER_OSPEEDR15_1 ((uint32_t)0x80000000)
  1676. /****************** Bits definition for GPIO_PUPDR register *****************/
  1677. #define GPIO_PUPDR_PUPDR0 ((uint32_t)0x00000003)
  1678. #define GPIO_PUPDR_PUPDR0_0 ((uint32_t)0x00000001)
  1679. #define GPIO_PUPDR_PUPDR0_1 ((uint32_t)0x00000002)
  1680. #define GPIO_PUPDR_PUPDR1 ((uint32_t)0x0000000C)
  1681. #define GPIO_PUPDR_PUPDR1_0 ((uint32_t)0x00000004)
  1682. #define GPIO_PUPDR_PUPDR1_1 ((uint32_t)0x00000008)
  1683. #define GPIO_PUPDR_PUPDR2 ((uint32_t)0x00000030)
  1684. #define GPIO_PUPDR_PUPDR2_0 ((uint32_t)0x00000010)
  1685. #define GPIO_PUPDR_PUPDR2_1 ((uint32_t)0x00000020)
  1686. #define GPIO_PUPDR_PUPDR3 ((uint32_t)0x000000C0)
  1687. #define GPIO_PUPDR_PUPDR3_0 ((uint32_t)0x00000040)
  1688. #define GPIO_PUPDR_PUPDR3_1 ((uint32_t)0x00000080)
  1689. #define GPIO_PUPDR_PUPDR4 ((uint32_t)0x00000300)
  1690. #define GPIO_PUPDR_PUPDR4_0 ((uint32_t)0x00000100)
  1691. #define GPIO_PUPDR_PUPDR4_1 ((uint32_t)0x00000200)
  1692. #define GPIO_PUPDR_PUPDR5 ((uint32_t)0x00000C00)
  1693. #define GPIO_PUPDR_PUPDR5_0 ((uint32_t)0x00000400)
  1694. #define GPIO_PUPDR_PUPDR5_1 ((uint32_t)0x00000800)
  1695. #define GPIO_PUPDR_PUPDR6 ((uint32_t)0x00003000)
  1696. #define GPIO_PUPDR_PUPDR6_0 ((uint32_t)0x00001000)
  1697. #define GPIO_PUPDR_PUPDR6_1 ((uint32_t)0x00002000)
  1698. #define GPIO_PUPDR_PUPDR7 ((uint32_t)0x0000C000)
  1699. #define GPIO_PUPDR_PUPDR7_0 ((uint32_t)0x00004000)
  1700. #define GPIO_PUPDR_PUPDR7_1 ((uint32_t)0x00008000)
  1701. #define GPIO_PUPDR_PUPDR8 ((uint32_t)0x00030000)
  1702. #define GPIO_PUPDR_PUPDR8_0 ((uint32_t)0x00010000)
  1703. #define GPIO_PUPDR_PUPDR8_1 ((uint32_t)0x00020000)
  1704. #define GPIO_PUPDR_PUPDR9 ((uint32_t)0x000C0000)
  1705. #define GPIO_PUPDR_PUPDR9_0 ((uint32_t)0x00040000)
  1706. #define GPIO_PUPDR_PUPDR9_1 ((uint32_t)0x00080000)
  1707. #define GPIO_PUPDR_PUPDR10 ((uint32_t)0x00300000)
  1708. #define GPIO_PUPDR_PUPDR10_0 ((uint32_t)0x00100000)
  1709. #define GPIO_PUPDR_PUPDR10_1 ((uint32_t)0x00200000)
  1710. #define GPIO_PUPDR_PUPDR11 ((uint32_t)0x00C00000)
  1711. #define GPIO_PUPDR_PUPDR11_0 ((uint32_t)0x00400000)
  1712. #define GPIO_PUPDR_PUPDR11_1 ((uint32_t)0x00800000)
  1713. #define GPIO_PUPDR_PUPDR12 ((uint32_t)0x03000000)
  1714. #define GPIO_PUPDR_PUPDR12_0 ((uint32_t)0x01000000)
  1715. #define GPIO_PUPDR_PUPDR12_1 ((uint32_t)0x02000000)
  1716. #define GPIO_PUPDR_PUPDR13 ((uint32_t)0x0C000000)
  1717. #define GPIO_PUPDR_PUPDR13_0 ((uint32_t)0x04000000)
  1718. #define GPIO_PUPDR_PUPDR13_1 ((uint32_t)0x08000000)
  1719. #define GPIO_PUPDR_PUPDR14 ((uint32_t)0x30000000)
  1720. #define GPIO_PUPDR_PUPDR14_0 ((uint32_t)0x10000000)
  1721. #define GPIO_PUPDR_PUPDR14_1 ((uint32_t)0x20000000)
  1722. #define GPIO_PUPDR_PUPDR15 ((uint32_t)0xC0000000)
  1723. #define GPIO_PUPDR_PUPDR15_0 ((uint32_t)0x40000000)
  1724. #define GPIO_PUPDR_PUPDR15_1 ((uint32_t)0x80000000)
  1725. /****************** Bits definition for GPIO_IDR register *******************/
  1726. #define GPIO_IDR_IDR_0 ((uint32_t)0x00000001)
  1727. #define GPIO_IDR_IDR_1 ((uint32_t)0x00000002)
  1728. #define GPIO_IDR_IDR_2 ((uint32_t)0x00000004)
  1729. #define GPIO_IDR_IDR_3 ((uint32_t)0x00000008)
  1730. #define GPIO_IDR_IDR_4 ((uint32_t)0x00000010)
  1731. #define GPIO_IDR_IDR_5 ((uint32_t)0x00000020)
  1732. #define GPIO_IDR_IDR_6 ((uint32_t)0x00000040)
  1733. #define GPIO_IDR_IDR_7 ((uint32_t)0x00000080)
  1734. #define GPIO_IDR_IDR_8 ((uint32_t)0x00000100)
  1735. #define GPIO_IDR_IDR_9 ((uint32_t)0x00000200)
  1736. #define GPIO_IDR_IDR_10 ((uint32_t)0x00000400)
  1737. #define GPIO_IDR_IDR_11 ((uint32_t)0x00000800)
  1738. #define GPIO_IDR_IDR_12 ((uint32_t)0x00001000)
  1739. #define GPIO_IDR_IDR_13 ((uint32_t)0x00002000)
  1740. #define GPIO_IDR_IDR_14 ((uint32_t)0x00004000)
  1741. #define GPIO_IDR_IDR_15 ((uint32_t)0x00008000)
  1742. /****************** Bits definition for GPIO_ODR register *******************/
  1743. #define GPIO_ODR_ODR_0 ((uint32_t)0x00000001)
  1744. #define GPIO_ODR_ODR_1 ((uint32_t)0x00000002)
  1745. #define GPIO_ODR_ODR_2 ((uint32_t)0x00000004)
  1746. #define GPIO_ODR_ODR_3 ((uint32_t)0x00000008)
  1747. #define GPIO_ODR_ODR_4 ((uint32_t)0x00000010)
  1748. #define GPIO_ODR_ODR_5 ((uint32_t)0x00000020)
  1749. #define GPIO_ODR_ODR_6 ((uint32_t)0x00000040)
  1750. #define GPIO_ODR_ODR_7 ((uint32_t)0x00000080)
  1751. #define GPIO_ODR_ODR_8 ((uint32_t)0x00000100)
  1752. #define GPIO_ODR_ODR_9 ((uint32_t)0x00000200)
  1753. #define GPIO_ODR_ODR_10 ((uint32_t)0x00000400)
  1754. #define GPIO_ODR_ODR_11 ((uint32_t)0x00000800)
  1755. #define GPIO_ODR_ODR_12 ((uint32_t)0x00001000)
  1756. #define GPIO_ODR_ODR_13 ((uint32_t)0x00002000)
  1757. #define GPIO_ODR_ODR_14 ((uint32_t)0x00004000)
  1758. #define GPIO_ODR_ODR_15 ((uint32_t)0x00008000)
  1759. /****************** Bits definition for GPIO_BSRR register ******************/
  1760. #define GPIO_BSRR_BS_0 ((uint32_t)0x00000001)
  1761. #define GPIO_BSRR_BS_1 ((uint32_t)0x00000002)
  1762. #define GPIO_BSRR_BS_2 ((uint32_t)0x00000004)
  1763. #define GPIO_BSRR_BS_3 ((uint32_t)0x00000008)
  1764. #define GPIO_BSRR_BS_4 ((uint32_t)0x00000010)
  1765. #define GPIO_BSRR_BS_5 ((uint32_t)0x00000020)
  1766. #define GPIO_BSRR_BS_6 ((uint32_t)0x00000040)
  1767. #define GPIO_BSRR_BS_7 ((uint32_t)0x00000080)
  1768. #define GPIO_BSRR_BS_8 ((uint32_t)0x00000100)
  1769. #define GPIO_BSRR_BS_9 ((uint32_t)0x00000200)
  1770. #define GPIO_BSRR_BS_10 ((uint32_t)0x00000400)
  1771. #define GPIO_BSRR_BS_11 ((uint32_t)0x00000800)
  1772. #define GPIO_BSRR_BS_12 ((uint32_t)0x00001000)
  1773. #define GPIO_BSRR_BS_13 ((uint32_t)0x00002000)
  1774. #define GPIO_BSRR_BS_14 ((uint32_t)0x00004000)
  1775. #define GPIO_BSRR_BS_15 ((uint32_t)0x00008000)
  1776. #define GPIO_BSRR_BR_0 ((uint32_t)0x00010000)
  1777. #define GPIO_BSRR_BR_1 ((uint32_t)0x00020000)
  1778. #define GPIO_BSRR_BR_2 ((uint32_t)0x00040000)
  1779. #define GPIO_BSRR_BR_3 ((uint32_t)0x00080000)
  1780. #define GPIO_BSRR_BR_4 ((uint32_t)0x00100000)
  1781. #define GPIO_BSRR_BR_5 ((uint32_t)0x00200000)
  1782. #define GPIO_BSRR_BR_6 ((uint32_t)0x00400000)
  1783. #define GPIO_BSRR_BR_7 ((uint32_t)0x00800000)
  1784. #define GPIO_BSRR_BR_8 ((uint32_t)0x01000000)
  1785. #define GPIO_BSRR_BR_9 ((uint32_t)0x02000000)
  1786. #define GPIO_BSRR_BR_10 ((uint32_t)0x04000000)
  1787. #define GPIO_BSRR_BR_11 ((uint32_t)0x08000000)
  1788. #define GPIO_BSRR_BR_12 ((uint32_t)0x10000000)
  1789. #define GPIO_BSRR_BR_13 ((uint32_t)0x20000000)
  1790. #define GPIO_BSRR_BR_14 ((uint32_t)0x40000000)
  1791. #define GPIO_BSRR_BR_15 ((uint32_t)0x80000000)
  1792. /****************** Bit definition for GPIO_LCKR register ********************/
  1793. #define GPIO_LCKR_LCK0 ((uint32_t)0x00000001)
  1794. #define GPIO_LCKR_LCK1 ((uint32_t)0x00000002)
  1795. #define GPIO_LCKR_LCK2 ((uint32_t)0x00000004)
  1796. #define GPIO_LCKR_LCK3 ((uint32_t)0x00000008)
  1797. #define GPIO_LCKR_LCK4 ((uint32_t)0x00000010)
  1798. #define GPIO_LCKR_LCK5 ((uint32_t)0x00000020)
  1799. #define GPIO_LCKR_LCK6 ((uint32_t)0x00000040)
  1800. #define GPIO_LCKR_LCK7 ((uint32_t)0x00000080)
  1801. #define GPIO_LCKR_LCK8 ((uint32_t)0x00000100)
  1802. #define GPIO_LCKR_LCK9 ((uint32_t)0x00000200)
  1803. #define GPIO_LCKR_LCK10 ((uint32_t)0x00000400)
  1804. #define GPIO_LCKR_LCK11 ((uint32_t)0x00000800)
  1805. #define GPIO_LCKR_LCK12 ((uint32_t)0x00001000)
  1806. #define GPIO_LCKR_LCK13 ((uint32_t)0x00002000)
  1807. #define GPIO_LCKR_LCK14 ((uint32_t)0x00004000)
  1808. #define GPIO_LCKR_LCK15 ((uint32_t)0x00008000)
  1809. #define GPIO_LCKR_LCKK ((uint32_t)0x00010000)
  1810. /****************** Bit definition for GPIO_AFRL register ********************/
  1811. #define GPIO_AFRL_AFRL0 ((uint32_t)0x0000000F)
  1812. #define GPIO_AFRL_AFRL1 ((uint32_t)0x000000F0)
  1813. #define GPIO_AFRL_AFRL2 ((uint32_t)0x00000F00)
  1814. #define GPIO_AFRL_AFRL3 ((uint32_t)0x0000F000)
  1815. #define GPIO_AFRL_AFRL4 ((uint32_t)0x000F0000)
  1816. #define GPIO_AFRL_AFRL5 ((uint32_t)0x00F00000)
  1817. #define GPIO_AFRL_AFRL6 ((uint32_t)0x0F000000)
  1818. #define GPIO_AFRL_AFRL7 ((uint32_t)0xF0000000)
  1819. /****************** Bit definition for GPIO_AFRH register ********************/
  1820. #define GPIO_AFRH_AFRH0 ((uint32_t)0x0000000F)
  1821. #define GPIO_AFRH_AFRH1 ((uint32_t)0x000000F0)
  1822. #define GPIO_AFRH_AFRH2 ((uint32_t)0x00000F00)
  1823. #define GPIO_AFRH_AFRH3 ((uint32_t)0x0000F000)
  1824. #define GPIO_AFRH_AFRH4 ((uint32_t)0x000F0000)
  1825. #define GPIO_AFRH_AFRH5 ((uint32_t)0x00F00000)
  1826. #define GPIO_AFRH_AFRH6 ((uint32_t)0x0F000000)
  1827. #define GPIO_AFRH_AFRH7 ((uint32_t)0xF0000000)
  1828. /****************** Bit definition for GPIO_BRR register *********************/
  1829. #define GPIO_BRR_BR_0 ((uint32_t)0x00000001)
  1830. #define GPIO_BRR_BR_1 ((uint32_t)0x00000002)
  1831. #define GPIO_BRR_BR_2 ((uint32_t)0x00000004)
  1832. #define GPIO_BRR_BR_3 ((uint32_t)0x00000008)
  1833. #define GPIO_BRR_BR_4 ((uint32_t)0x00000010)
  1834. #define GPIO_BRR_BR_5 ((uint32_t)0x00000020)
  1835. #define GPIO_BRR_BR_6 ((uint32_t)0x00000040)
  1836. #define GPIO_BRR_BR_7 ((uint32_t)0x00000080)
  1837. #define GPIO_BRR_BR_8 ((uint32_t)0x00000100)
  1838. #define GPIO_BRR_BR_9 ((uint32_t)0x00000200)
  1839. #define GPIO_BRR_BR_10 ((uint32_t)0x00000400)
  1840. #define GPIO_BRR_BR_11 ((uint32_t)0x00000800)
  1841. #define GPIO_BRR_BR_12 ((uint32_t)0x00001000)
  1842. #define GPIO_BRR_BR_13 ((uint32_t)0x00002000)
  1843. #define GPIO_BRR_BR_14 ((uint32_t)0x00004000)
  1844. #define GPIO_BRR_BR_15 ((uint32_t)0x00008000)
  1845. /******************************************************************************/
  1846. /* */
  1847. /* Inter-integrated Circuit Interface (I2C) */
  1848. /* */
  1849. /******************************************************************************/
  1850. /******************* Bit definition for I2C_CR1 register ********************/
  1851. #define I2C_CR1_PE ((uint32_t)0x00000001) /*!< Peripheral Enable */
  1852. #define I2C_CR1_SMBUS ((uint32_t)0x00000002) /*!< SMBus Mode */
  1853. #define I2C_CR1_SMBTYPE ((uint32_t)0x00000008) /*!< SMBus Type */
  1854. #define I2C_CR1_ENARP ((uint32_t)0x00000010) /*!< ARP Enable */
  1855. #define I2C_CR1_ENPEC ((uint32_t)0x00000020) /*!< PEC Enable */
  1856. #define I2C_CR1_ENGC ((uint32_t)0x00000040) /*!< General Call Enable */
  1857. #define I2C_CR1_NOSTRETCH ((uint32_t)0x00000080) /*!< Clock Stretching Disable (Slave mode) */
  1858. #define I2C_CR1_START ((uint32_t)0x00000100) /*!< Start Generation */
  1859. #define I2C_CR1_STOP ((uint32_t)0x00000200) /*!< Stop Generation */
  1860. #define I2C_CR1_ACK ((uint32_t)0x00000400) /*!< Acknowledge Enable */
  1861. #define I2C_CR1_POS ((uint32_t)0x00000800) /*!< Acknowledge/PEC Position (for data reception) */
  1862. #define I2C_CR1_PEC ((uint32_t)0x00001000) /*!< Packet Error Checking */
  1863. #define I2C_CR1_ALERT ((uint32_t)0x00002000) /*!< SMBus Alert */
  1864. #define I2C_CR1_SWRST ((uint32_t)0x00008000) /*!< Software Reset */
  1865. /******************* Bit definition for I2C_CR2 register ********************/
  1866. #define I2C_CR2_FREQ ((uint32_t)0x0000003F) /*!< FREQ[5:0] bits (Peripheral Clock Frequency) */
  1867. #define I2C_CR2_FREQ_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  1868. #define I2C_CR2_FREQ_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  1869. #define I2C_CR2_FREQ_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  1870. #define I2C_CR2_FREQ_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  1871. #define I2C_CR2_FREQ_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  1872. #define I2C_CR2_FREQ_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  1873. #define I2C_CR2_ITERREN ((uint32_t)0x00000100) /*!< Error Interrupt Enable */
  1874. #define I2C_CR2_ITEVTEN ((uint32_t)0x00000200) /*!< Event Interrupt Enable */
  1875. #define I2C_CR2_ITBUFEN ((uint32_t)0x00000400) /*!< Buffer Interrupt Enable */
  1876. #define I2C_CR2_DMAEN ((uint32_t)0x00000800) /*!< DMA Requests Enable */
  1877. #define I2C_CR2_LAST ((uint32_t)0x00001000) /*!< DMA Last Transfer */
  1878. /******************* Bit definition for I2C_OAR1 register *******************/
  1879. #define I2C_OAR1_ADD1_7 ((uint32_t)0x000000FE) /*!< Interface Address */
  1880. #define I2C_OAR1_ADD8_9 ((uint32_t)0x00000300) /*!< Interface Address */
  1881. #define I2C_OAR1_ADD0 ((uint32_t)0x00000001) /*!< Bit 0 */
  1882. #define I2C_OAR1_ADD1 ((uint32_t)0x00000002) /*!< Bit 1 */
  1883. #define I2C_OAR1_ADD2 ((uint32_t)0x00000004) /*!< Bit 2 */
  1884. #define I2C_OAR1_ADD3 ((uint32_t)0x00000008) /*!< Bit 3 */
  1885. #define I2C_OAR1_ADD4 ((uint32_t)0x00000010) /*!< Bit 4 */
  1886. #define I2C_OAR1_ADD5 ((uint32_t)0x00000020) /*!< Bit 5 */
  1887. #define I2C_OAR1_ADD6 ((uint32_t)0x00000040) /*!< Bit 6 */
  1888. #define I2C_OAR1_ADD7 ((uint32_t)0x00000080) /*!< Bit 7 */
  1889. #define I2C_OAR1_ADD8 ((uint32_t)0x00000100) /*!< Bit 8 */
  1890. #define I2C_OAR1_ADD9 ((uint32_t)0x00000200) /*!< Bit 9 */
  1891. #define I2C_OAR1_ADDMODE ((uint32_t)0x00008000) /*!< Addressing Mode (Slave mode) */
  1892. /******************* Bit definition for I2C_OAR2 register *******************/
  1893. #define I2C_OAR2_ENDUAL ((uint32_t)0x00000001) /*!< Dual addressing mode enable */
  1894. #define I2C_OAR2_ADD2 ((uint32_t)0x000000FE) /*!< Interface address */
  1895. /******************** Bit definition for I2C_DR register ********************/
  1896. #define I2C_DR_DR ((uint32_t)0x000000FF) /*!< 8-bit Data Register */
  1897. /******************* Bit definition for I2C_SR1 register ********************/
  1898. #define I2C_SR1_SB ((uint32_t)0x00000001) /*!< Start Bit (Master mode) */
  1899. #define I2C_SR1_ADDR ((uint32_t)0x00000002) /*!< Address sent (master mode)/matched (slave mode) */
  1900. #define I2C_SR1_BTF ((uint32_t)0x00000004) /*!< Byte Transfer Finished */
  1901. #define I2C_SR1_ADD10 ((uint32_t)0x00000008) /*!< 10-bit header sent (Master mode) */
  1902. #define I2C_SR1_STOPF ((uint32_t)0x00000010) /*!< Stop detection (Slave mode) */
  1903. #define I2C_SR1_RXNE ((uint32_t)0x00000040) /*!< Data Register not Empty (receivers) */
  1904. #define I2C_SR1_TXE ((uint32_t)0x00000080) /*!< Data Register Empty (transmitters) */
  1905. #define I2C_SR1_BERR ((uint32_t)0x00000100) /*!< Bus Error */
  1906. #define I2C_SR1_ARLO ((uint32_t)0x00000200) /*!< Arbitration Lost (master mode) */
  1907. #define I2C_SR1_AF ((uint32_t)0x00000400) /*!< Acknowledge Failure */
  1908. #define I2C_SR1_OVR ((uint32_t)0x00000800) /*!< Overrun/Underrun */
  1909. #define I2C_SR1_PECERR ((uint32_t)0x00001000) /*!< PEC Error in reception */
  1910. #define I2C_SR1_TIMEOUT ((uint32_t)0x00004000) /*!< Timeout or Tlow Error */
  1911. #define I2C_SR1_SMBALERT ((uint32_t)0x00008000) /*!< SMBus Alert */
  1912. /******************* Bit definition for I2C_SR2 register ********************/
  1913. #define I2C_SR2_MSL ((uint32_t)0x00000001) /*!< Master/Slave */
  1914. #define I2C_SR2_BUSY ((uint32_t)0x00000002) /*!< Bus Busy */
  1915. #define I2C_SR2_TRA ((uint32_t)0x00000004) /*!< Transmitter/Receiver */
  1916. #define I2C_SR2_GENCALL ((uint32_t)0x00000010) /*!< General Call Address (Slave mode) */
  1917. #define I2C_SR2_SMBDEFAULT ((uint32_t)0x00000020) /*!< SMBus Device Default Address (Slave mode) */
  1918. #define I2C_SR2_SMBHOST ((uint32_t)0x00000040) /*!< SMBus Host Header (Slave mode) */
  1919. #define I2C_SR2_DUALF ((uint32_t)0x00000080) /*!< Dual Flag (Slave mode) */
  1920. #define I2C_SR2_PEC ((uint32_t)0x0000FF00) /*!< Packet Error Checking Register */
  1921. /******************* Bit definition for I2C_CCR register ********************/
  1922. #define I2C_CCR_CCR ((uint32_t)0x00000FFF) /*!< Clock Control Register in Fast/Standard mode (Master mode) */
  1923. #define I2C_CCR_DUTY ((uint32_t)0x00004000) /*!< Fast Mode Duty Cycle */
  1924. #define I2C_CCR_FS ((uint32_t)0x00008000) /*!< I2C Master Mode Selection */
  1925. /****************** Bit definition for I2C_TRISE register *******************/
  1926. #define I2C_TRISE_TRISE ((uint32_t)0x0000003F) /*!< Maximum Rise Time in Fast/Standard mode (Master mode) */
  1927. /******************************************************************************/
  1928. /* */
  1929. /* Independent WATCHDOG (IWDG) */
  1930. /* */
  1931. /******************************************************************************/
  1932. /******************* Bit definition for IWDG_KR register ********************/
  1933. #define IWDG_KR_KEY ((uint32_t)0x0000FFFF) /*!< Key value (write only, read 0000h) */
  1934. /******************* Bit definition for IWDG_PR register ********************/
  1935. #define IWDG_PR_PR ((uint32_t)0x00000007) /*!< PR[2:0] (Prescaler divider) */
  1936. #define IWDG_PR_PR_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  1937. #define IWDG_PR_PR_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  1938. #define IWDG_PR_PR_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  1939. /******************* Bit definition for IWDG_RLR register *******************/
  1940. #define IWDG_RLR_RL ((uint32_t)0x00000FFF) /*!< Watchdog counter reload value */
  1941. /******************* Bit definition for IWDG_SR register ********************/
  1942. #define IWDG_SR_PVU ((uint32_t)0x00000001) /*!< Watchdog prescaler value update */
  1943. #define IWDG_SR_RVU ((uint32_t)0x00000002) /*!< Watchdog counter reload value update */
  1944. /******************************************************************************/
  1945. /* */
  1946. /* LCD Controller (LCD) */
  1947. /* */
  1948. /******************************************************************************/
  1949. /******************* Bit definition for LCD_CR register *********************/
  1950. #define LCD_CR_LCDEN ((uint32_t)0x00000001) /*!< LCD Enable Bit */
  1951. #define LCD_CR_VSEL ((uint32_t)0x00000002) /*!< Voltage source selector Bit */
  1952. #define LCD_CR_DUTY ((uint32_t)0x0000001C) /*!< DUTY[2:0] bits (Duty selector) */
  1953. #define LCD_CR_DUTY_0 ((uint32_t)0x00000004) /*!< Duty selector Bit 0 */
  1954. #define LCD_CR_DUTY_1 ((uint32_t)0x00000008) /*!< Duty selector Bit 1 */
  1955. #define LCD_CR_DUTY_2 ((uint32_t)0x00000010) /*!< Duty selector Bit 2 */
  1956. #define LCD_CR_BIAS ((uint32_t)0x00000060) /*!< BIAS[1:0] bits (Bias selector) */
  1957. #define LCD_CR_BIAS_0 ((uint32_t)0x00000020) /*!< Bias selector Bit 0 */
  1958. #define LCD_CR_BIAS_1 ((uint32_t)0x00000040) /*!< Bias selector Bit 1 */
  1959. #define LCD_CR_MUX_SEG ((uint32_t)0x00000080) /*!< Mux Segment Enable Bit */
  1960. /******************* Bit definition for LCD_FCR register ********************/
  1961. #define LCD_FCR_HD ((uint32_t)0x00000001) /*!< High Drive Enable Bit */
  1962. #define LCD_FCR_SOFIE ((uint32_t)0x00000002) /*!< Start of Frame Interrupt Enable Bit */
  1963. #define LCD_FCR_UDDIE ((uint32_t)0x00000008) /*!< Update Display Done Interrupt Enable Bit */
  1964. #define LCD_FCR_PON ((uint32_t)0x00000070) /*!< PON[2:0] bits (Puls ON Duration) */
  1965. #define LCD_FCR_PON_0 ((uint32_t)0x00000010) /*!< Bit 0 */
  1966. #define LCD_FCR_PON_1 ((uint32_t)0x00000020) /*!< Bit 1 */
  1967. #define LCD_FCR_PON_2 ((uint32_t)0x00000040) /*!< Bit 2 */
  1968. #define LCD_FCR_DEAD ((uint32_t)0x00000380) /*!< DEAD[2:0] bits (DEAD Time) */
  1969. #define LCD_FCR_DEAD_0 ((uint32_t)0x00000080) /*!< Bit 0 */
  1970. #define LCD_FCR_DEAD_1 ((uint32_t)0x00000100) /*!< Bit 1 */
  1971. #define LCD_FCR_DEAD_2 ((uint32_t)0x00000200) /*!< Bit 2 */
  1972. #define LCD_FCR_CC ((uint32_t)0x00001C00) /*!< CC[2:0] bits (Contrast Control) */
  1973. #define LCD_FCR_CC_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  1974. #define LCD_FCR_CC_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  1975. #define LCD_FCR_CC_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  1976. #define LCD_FCR_BLINKF ((uint32_t)0x0000E000) /*!< BLINKF[2:0] bits (Blink Frequency) */
  1977. #define LCD_FCR_BLINKF_0 ((uint32_t)0x00002000) /*!< Bit 0 */
  1978. #define LCD_FCR_BLINKF_1 ((uint32_t)0x00004000) /*!< Bit 1 */
  1979. #define LCD_FCR_BLINKF_2 ((uint32_t)0x00008000) /*!< Bit 2 */
  1980. #define LCD_FCR_BLINK ((uint32_t)0x00030000) /*!< BLINK[1:0] bits (Blink Enable) */
  1981. #define LCD_FCR_BLINK_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  1982. #define LCD_FCR_BLINK_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  1983. #define LCD_FCR_DIV ((uint32_t)0x003C0000) /*!< DIV[3:0] bits (Divider) */
  1984. #define LCD_FCR_PS ((uint32_t)0x03C00000) /*!< PS[3:0] bits (Prescaler) */
  1985. /******************* Bit definition for LCD_SR register *********************/
  1986. #define LCD_SR_ENS ((uint32_t)0x00000001) /*!< LCD Enabled Bit */
  1987. #define LCD_SR_SOF ((uint32_t)0x00000002) /*!< Start Of Frame Flag Bit */
  1988. #define LCD_SR_UDR ((uint32_t)0x00000004) /*!< Update Display Request Bit */
  1989. #define LCD_SR_UDD ((uint32_t)0x00000008) /*!< Update Display Done Flag Bit */
  1990. #define LCD_SR_RDY ((uint32_t)0x00000010) /*!< Ready Flag Bit */
  1991. #define LCD_SR_FCRSR ((uint32_t)0x00000020) /*!< LCD FCR Register Synchronization Flag Bit */
  1992. /******************* Bit definition for LCD_CLR register ********************/
  1993. #define LCD_CLR_SOFC ((uint32_t)0x00000002) /*!< Start Of Frame Flag Clear Bit */
  1994. #define LCD_CLR_UDDC ((uint32_t)0x00000008) /*!< Update Display Done Flag Clear Bit */
  1995. /******************* Bit definition for LCD_RAM register ********************/
  1996. #define LCD_RAM_SEGMENT_DATA ((uint32_t)0xFFFFFFFF) /*!< Segment Data Bits */
  1997. /******************************************************************************/
  1998. /* */
  1999. /* Power Control (PWR) */
  2000. /* */
  2001. /******************************************************************************/
  2002. /******************** Bit definition for PWR_CR register ********************/
  2003. #define PWR_CR_LPSDSR ((uint32_t)0x00000001) /*!< Low-power deepsleep/sleep/low power run */
  2004. #define PWR_CR_PDDS ((uint32_t)0x00000002) /*!< Power Down Deepsleep */
  2005. #define PWR_CR_CWUF ((uint32_t)0x00000004) /*!< Clear Wakeup Flag */
  2006. #define PWR_CR_CSBF ((uint32_t)0x00000008) /*!< Clear Standby Flag */
  2007. #define PWR_CR_PVDE ((uint32_t)0x00000010) /*!< Power Voltage Detector Enable */
  2008. #define PWR_CR_PLS ((uint32_t)0x000000E0) /*!< PLS[2:0] bits (PVD Level Selection) */
  2009. #define PWR_CR_PLS_0 ((uint32_t)0x00000020) /*!< Bit 0 */
  2010. #define PWR_CR_PLS_1 ((uint32_t)0x00000040) /*!< Bit 1 */
  2011. #define PWR_CR_PLS_2 ((uint32_t)0x00000080) /*!< Bit 2 */
  2012. /*!< PVD level configuration */
  2013. #define PWR_CR_PLS_LEV0 ((uint32_t)0x00000000) /*!< PVD level 0 */
  2014. #define PWR_CR_PLS_LEV1 ((uint32_t)0x00000020) /*!< PVD level 1 */
  2015. #define PWR_CR_PLS_LEV2 ((uint32_t)0x00000040) /*!< PVD level 2 */
  2016. #define PWR_CR_PLS_LEV3 ((uint32_t)0x00000060) /*!< PVD level 3 */
  2017. #define PWR_CR_PLS_LEV4 ((uint32_t)0x00000080) /*!< PVD level 4 */
  2018. #define PWR_CR_PLS_LEV5 ((uint32_t)0x000000A0) /*!< PVD level 5 */
  2019. #define PWR_CR_PLS_LEV6 ((uint32_t)0x000000C0) /*!< PVD level 6 */
  2020. #define PWR_CR_PLS_LEV7 ((uint32_t)0x000000E0) /*!< PVD level 7 */
  2021. #define PWR_CR_DBP ((uint32_t)0x00000100) /*!< Disable Backup Domain write protection */
  2022. #define PWR_CR_ULP ((uint32_t)0x00000200) /*!< Ultra Low Power mode */
  2023. #define PWR_CR_FWU ((uint32_t)0x00000400) /*!< Fast wakeup */
  2024. #define PWR_CR_VOS ((uint32_t)0x00001800) /*!< VOS[1:0] bits (Voltage scaling range selection) */
  2025. #define PWR_CR_VOS_0 ((uint32_t)0x00000800) /*!< Bit 0 */
  2026. #define PWR_CR_VOS_1 ((uint32_t)0x00001000) /*!< Bit 1 */
  2027. #define PWR_CR_LPRUN ((uint32_t)0x00004000) /*!< Low power run mode */
  2028. /******************* Bit definition for PWR_CSR register ********************/
  2029. #define PWR_CSR_WUF ((uint32_t)0x00000001) /*!< Wakeup Flag */
  2030. #define PWR_CSR_SBF ((uint32_t)0x00000002) /*!< Standby Flag */
  2031. #define PWR_CSR_PVDO ((uint32_t)0x00000004) /*!< PVD Output */
  2032. #define PWR_CSR_VREFINTRDYF ((uint32_t)0x00000008) /*!< Internal voltage reference (VREFINT) ready flag */
  2033. #define PWR_CSR_VOSF ((uint32_t)0x00000010) /*!< Voltage Scaling select flag */
  2034. #define PWR_CSR_REGLPF ((uint32_t)0x00000020) /*!< Regulator LP flag */
  2035. #define PWR_CSR_EWUP1 ((uint32_t)0x00000100) /*!< Enable WKUP pin 1 */
  2036. #define PWR_CSR_EWUP2 ((uint32_t)0x00000200) /*!< Enable WKUP pin 2 */
  2037. #define PWR_CSR_EWUP3 ((uint32_t)0x00000400) /*!< Enable WKUP pin 3 */
  2038. /******************************************************************************/
  2039. /* */
  2040. /* Reset and Clock Control (RCC) */
  2041. /* */
  2042. /******************************************************************************/
  2043. /******************** Bit definition for RCC_CR register ********************/
  2044. #define RCC_CR_HSION ((uint32_t)0x00000001) /*!< Internal High Speed clock enable */
  2045. #define RCC_CR_HSIRDY ((uint32_t)0x00000002) /*!< Internal High Speed clock ready flag */
  2046. #define RCC_CR_MSION ((uint32_t)0x00000100) /*!< Internal Multi Speed clock enable */
  2047. #define RCC_CR_MSIRDY ((uint32_t)0x00000200) /*!< Internal Multi Speed clock ready flag */
  2048. #define RCC_CR_HSEON ((uint32_t)0x00010000) /*!< External High Speed clock enable */
  2049. #define RCC_CR_HSERDY ((uint32_t)0x00020000) /*!< External High Speed clock ready flag */
  2050. #define RCC_CR_HSEBYP ((uint32_t)0x00040000) /*!< External High Speed clock Bypass */
  2051. #define RCC_CR_PLLON ((uint32_t)0x01000000) /*!< PLL enable */
  2052. #define RCC_CR_PLLRDY ((uint32_t)0x02000000) /*!< PLL clock ready flag */
  2053. #define RCC_CR_CSSON ((uint32_t)0x10000000) /*!< Clock Security System enable */
  2054. #define RCC_CR_RTCPRE ((uint32_t)0x60000000) /*!< RTC/LCD Prescaler */
  2055. #define RCC_CR_RTCPRE_0 ((uint32_t)0x20000000) /*!< Bit0 */
  2056. #define RCC_CR_RTCPRE_1 ((uint32_t)0x40000000) /*!< Bit1 */
  2057. /******************** Bit definition for RCC_ICSCR register *****************/
  2058. #define RCC_ICSCR_HSICAL ((uint32_t)0x000000FF) /*!< Internal High Speed clock Calibration */
  2059. #define RCC_ICSCR_HSITRIM ((uint32_t)0x00001F00) /*!< Internal High Speed clock trimming */
  2060. #define RCC_ICSCR_MSIRANGE ((uint32_t)0x0000E000) /*!< Internal Multi Speed clock Range */
  2061. #define RCC_ICSCR_MSIRANGE_0 ((uint32_t)0x00000000) /*!< Internal Multi Speed clock Range 65.536 KHz */
  2062. #define RCC_ICSCR_MSIRANGE_1 ((uint32_t)0x00002000) /*!< Internal Multi Speed clock Range 131.072 KHz */
  2063. #define RCC_ICSCR_MSIRANGE_2 ((uint32_t)0x00004000) /*!< Internal Multi Speed clock Range 262.144 KHz */
  2064. #define RCC_ICSCR_MSIRANGE_3 ((uint32_t)0x00006000) /*!< Internal Multi Speed clock Range 524.288 KHz */
  2065. #define RCC_ICSCR_MSIRANGE_4 ((uint32_t)0x00008000) /*!< Internal Multi Speed clock Range 1.048 MHz */
  2066. #define RCC_ICSCR_MSIRANGE_5 ((uint32_t)0x0000A000) /*!< Internal Multi Speed clock Range 2.097 MHz */
  2067. #define RCC_ICSCR_MSIRANGE_6 ((uint32_t)0x0000C000) /*!< Internal Multi Speed clock Range 4.194 MHz */
  2068. #define RCC_ICSCR_MSICAL ((uint32_t)0x00FF0000) /*!< Internal Multi Speed clock Calibration */
  2069. #define RCC_ICSCR_MSITRIM ((uint32_t)0xFF000000) /*!< Internal Multi Speed clock trimming */
  2070. /******************** Bit definition for RCC_CFGR register ******************/
  2071. #define RCC_CFGR_SW ((uint32_t)0x00000003) /*!< SW[1:0] bits (System clock Switch) */
  2072. #define RCC_CFGR_SW_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  2073. #define RCC_CFGR_SW_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  2074. /*!< SW configuration */
  2075. #define RCC_CFGR_SW_MSI ((uint32_t)0x00000000) /*!< MSI selected as system clock */
  2076. #define RCC_CFGR_SW_HSI ((uint32_t)0x00000001) /*!< HSI selected as system clock */
  2077. #define RCC_CFGR_SW_HSE ((uint32_t)0x00000002) /*!< HSE selected as system clock */
  2078. #define RCC_CFGR_SW_PLL ((uint32_t)0x00000003) /*!< PLL selected as system clock */
  2079. #define RCC_CFGR_SWS ((uint32_t)0x0000000C) /*!< SWS[1:0] bits (System Clock Switch Status) */
  2080. #define RCC_CFGR_SWS_0 ((uint32_t)0x00000004) /*!< Bit 0 */
  2081. #define RCC_CFGR_SWS_1 ((uint32_t)0x00000008) /*!< Bit 1 */
  2082. /*!< SWS configuration */
  2083. #define RCC_CFGR_SWS_MSI ((uint32_t)0x00000000) /*!< MSI oscillator used as system clock */
  2084. #define RCC_CFGR_SWS_HSI ((uint32_t)0x00000004) /*!< HSI oscillator used as system clock */
  2085. #define RCC_CFGR_SWS_HSE ((uint32_t)0x00000008) /*!< HSE oscillator used as system clock */
  2086. #define RCC_CFGR_SWS_PLL ((uint32_t)0x0000000C) /*!< PLL used as system clock */
  2087. #define RCC_CFGR_HPRE ((uint32_t)0x000000F0) /*!< HPRE[3:0] bits (AHB prescaler) */
  2088. #define RCC_CFGR_HPRE_0 ((uint32_t)0x00000010) /*!< Bit 0 */
  2089. #define RCC_CFGR_HPRE_1 ((uint32_t)0x00000020) /*!< Bit 1 */
  2090. #define RCC_CFGR_HPRE_2 ((uint32_t)0x00000040) /*!< Bit 2 */
  2091. #define RCC_CFGR_HPRE_3 ((uint32_t)0x00000080) /*!< Bit 3 */
  2092. /*!< HPRE configuration */
  2093. #define RCC_CFGR_HPRE_DIV1 ((uint32_t)0x00000000) /*!< SYSCLK not divided */
  2094. #define RCC_CFGR_HPRE_DIV2 ((uint32_t)0x00000080) /*!< SYSCLK divided by 2 */
  2095. #define RCC_CFGR_HPRE_DIV4 ((uint32_t)0x00000090) /*!< SYSCLK divided by 4 */
  2096. #define RCC_CFGR_HPRE_DIV8 ((uint32_t)0x000000A0) /*!< SYSCLK divided by 8 */
  2097. #define RCC_CFGR_HPRE_DIV16 ((uint32_t)0x000000B0) /*!< SYSCLK divided by 16 */
  2098. #define RCC_CFGR_HPRE_DIV64 ((uint32_t)0x000000C0) /*!< SYSCLK divided by 64 */
  2099. #define RCC_CFGR_HPRE_DIV128 ((uint32_t)0x000000D0) /*!< SYSCLK divided by 128 */
  2100. #define RCC_CFGR_HPRE_DIV256 ((uint32_t)0x000000E0) /*!< SYSCLK divided by 256 */
  2101. #define RCC_CFGR_HPRE_DIV512 ((uint32_t)0x000000F0) /*!< SYSCLK divided by 512 */
  2102. #define RCC_CFGR_PPRE1 ((uint32_t)0x00000700) /*!< PRE1[2:0] bits (APB1 prescaler) */
  2103. #define RCC_CFGR_PPRE1_0 ((uint32_t)0x00000100) /*!< Bit 0 */
  2104. #define RCC_CFGR_PPRE1_1 ((uint32_t)0x00000200) /*!< Bit 1 */
  2105. #define RCC_CFGR_PPRE1_2 ((uint32_t)0x00000400) /*!< Bit 2 */
  2106. /*!< PPRE1 configuration */
  2107. #define RCC_CFGR_PPRE1_DIV1 ((uint32_t)0x00000000) /*!< HCLK not divided */
  2108. #define RCC_CFGR_PPRE1_DIV2 ((uint32_t)0x00000400) /*!< HCLK divided by 2 */
  2109. #define RCC_CFGR_PPRE1_DIV4 ((uint32_t)0x00000500) /*!< HCLK divided by 4 */
  2110. #define RCC_CFGR_PPRE1_DIV8 ((uint32_t)0x00000600) /*!< HCLK divided by 8 */
  2111. #define RCC_CFGR_PPRE1_DIV16 ((uint32_t)0x00000700) /*!< HCLK divided by 16 */
  2112. #define RCC_CFGR_PPRE2 ((uint32_t)0x00003800) /*!< PRE2[2:0] bits (APB2 prescaler) */
  2113. #define RCC_CFGR_PPRE2_0 ((uint32_t)0x00000800) /*!< Bit 0 */
  2114. #define RCC_CFGR_PPRE2_1 ((uint32_t)0x00001000) /*!< Bit 1 */
  2115. #define RCC_CFGR_PPRE2_2 ((uint32_t)0x00002000) /*!< Bit 2 */
  2116. /*!< PPRE2 configuration */
  2117. #define RCC_CFGR_PPRE2_DIV1 ((uint32_t)0x00000000) /*!< HCLK not divided */
  2118. #define RCC_CFGR_PPRE2_DIV2 ((uint32_t)0x00002000) /*!< HCLK divided by 2 */
  2119. #define RCC_CFGR_PPRE2_DIV4 ((uint32_t)0x00002800) /*!< HCLK divided by 4 */
  2120. #define RCC_CFGR_PPRE2_DIV8 ((uint32_t)0x00003000) /*!< HCLK divided by 8 */
  2121. #define RCC_CFGR_PPRE2_DIV16 ((uint32_t)0x00003800) /*!< HCLK divided by 16 */
  2122. /*!< PLL entry clock source*/
  2123. #define RCC_CFGR_PLLSRC ((uint32_t)0x00010000) /*!< PLL entry clock source */
  2124. #define RCC_CFGR_PLLSRC_HSI ((uint32_t)0x00000000) /*!< HSI as PLL entry clock source */
  2125. #define RCC_CFGR_PLLSRC_HSE ((uint32_t)0x00010000) /*!< HSE as PLL entry clock source */
  2126. /*!< PLLMUL configuration */
  2127. #define RCC_CFGR_PLLMUL ((uint32_t)0x003C0000) /*!< PLLMUL[3:0] bits (PLL multiplication factor) */
  2128. #define RCC_CFGR_PLLMUL_0 ((uint32_t)0x00040000) /*!< Bit 0 */
  2129. #define RCC_CFGR_PLLMUL_1 ((uint32_t)0x00080000) /*!< Bit 1 */
  2130. #define RCC_CFGR_PLLMUL_2 ((uint32_t)0x00100000) /*!< Bit 2 */
  2131. #define RCC_CFGR_PLLMUL_3 ((uint32_t)0x00200000) /*!< Bit 3 */
  2132. /*!< PLLMUL configuration */
  2133. #define RCC_CFGR_PLLMUL3 ((uint32_t)0x00000000) /*!< PLL input clock * 3 */
  2134. #define RCC_CFGR_PLLMUL4 ((uint32_t)0x00040000) /*!< PLL input clock * 4 */
  2135. #define RCC_CFGR_PLLMUL6 ((uint32_t)0x00080000) /*!< PLL input clock * 6 */
  2136. #define RCC_CFGR_PLLMUL8 ((uint32_t)0x000C0000) /*!< PLL input clock * 8 */
  2137. #define RCC_CFGR_PLLMUL12 ((uint32_t)0x00100000) /*!< PLL input clock * 12 */
  2138. #define RCC_CFGR_PLLMUL16 ((uint32_t)0x00140000) /*!< PLL input clock * 16 */
  2139. #define RCC_CFGR_PLLMUL24 ((uint32_t)0x00180000) /*!< PLL input clock * 24 */
  2140. #define RCC_CFGR_PLLMUL32 ((uint32_t)0x001C0000) /*!< PLL input clock * 32 */
  2141. #define RCC_CFGR_PLLMUL48 ((uint32_t)0x00200000) /*!< PLL input clock * 48 */
  2142. /*!< PLLDIV configuration */
  2143. #define RCC_CFGR_PLLDIV ((uint32_t)0x00C00000) /*!< PLLDIV[1:0] bits (PLL Output Division) */
  2144. #define RCC_CFGR_PLLDIV_0 ((uint32_t)0x00400000) /*!< Bit0 */
  2145. #define RCC_CFGR_PLLDIV_1 ((uint32_t)0x00800000) /*!< Bit1 */
  2146. /*!< PLLDIV configuration */
  2147. #define RCC_CFGR_PLLDIV1 ((uint32_t)0x00000000) /*!< PLL clock output = CKVCO / 1 */
  2148. #define RCC_CFGR_PLLDIV2 ((uint32_t)0x00400000) /*!< PLL clock output = CKVCO / 2 */
  2149. #define RCC_CFGR_PLLDIV3 ((uint32_t)0x00800000) /*!< PLL clock output = CKVCO / 3 */
  2150. #define RCC_CFGR_PLLDIV4 ((uint32_t)0x00C00000) /*!< PLL clock output = CKVCO / 4 */
  2151. #define RCC_CFGR_MCOSEL ((uint32_t)0x07000000) /*!< MCO[2:0] bits (Microcontroller Clock Output) */
  2152. #define RCC_CFGR_MCOSEL_0 ((uint32_t)0x01000000) /*!< Bit 0 */
  2153. #define RCC_CFGR_MCOSEL_1 ((uint32_t)0x02000000) /*!< Bit 1 */
  2154. #define RCC_CFGR_MCOSEL_2 ((uint32_t)0x04000000) /*!< Bit 2 */
  2155. /*!< MCO configuration */
  2156. #define RCC_CFGR_MCO_NOCLOCK ((uint32_t)0x00000000) /*!< No clock */
  2157. #define RCC_CFGR_MCO_SYSCLK ((uint32_t)0x01000000) /*!< System clock selected */
  2158. #define RCC_CFGR_MCO_HSI ((uint32_t)0x02000000) /*!< Internal 16 MHz RC oscillator clock selected */
  2159. #define RCC_CFGR_MCO_MSI ((uint32_t)0x03000000) /*!< Internal Medium Speed RC oscillator clock selected */
  2160. #define RCC_CFGR_MCO_HSE ((uint32_t)0x04000000) /*!< External 1-25 MHz oscillator clock selected */
  2161. #define RCC_CFGR_MCO_PLL ((uint32_t)0x05000000) /*!< PLL clock divided */
  2162. #define RCC_CFGR_MCO_LSI ((uint32_t)0x06000000) /*!< LSI selected */
  2163. #define RCC_CFGR_MCO_LSE ((uint32_t)0x07000000) /*!< LSE selected */
  2164. #define RCC_CFGR_MCOPRE ((uint32_t)0x70000000) /*!< MCOPRE[2:0] bits (Microcontroller Clock Output Prescaler) */
  2165. #define RCC_CFGR_MCOPRE_0 ((uint32_t)0x10000000) /*!< Bit 0 */
  2166. #define RCC_CFGR_MCOPRE_1 ((uint32_t)0x20000000) /*!< Bit 1 */
  2167. #define RCC_CFGR_MCOPRE_2 ((uint32_t)0x40000000) /*!< Bit 2 */
  2168. /*!< MCO Prescaler configuration */
  2169. #define RCC_CFGR_MCO_DIV1 ((uint32_t)0x00000000) /*!< MCO Clock divided by 1 */
  2170. #define RCC_CFGR_MCO_DIV2 ((uint32_t)0x10000000) /*!< MCO Clock divided by 2 */
  2171. #define RCC_CFGR_MCO_DIV4 ((uint32_t)0x20000000) /*!< MCO Clock divided by 4 */
  2172. #define RCC_CFGR_MCO_DIV8 ((uint32_t)0x30000000) /*!< MCO Clock divided by 8 */
  2173. #define RCC_CFGR_MCO_DIV16 ((uint32_t)0x40000000) /*!< MCO Clock divided by 16 */
  2174. /*!<****************** Bit definition for RCC_CIR register ********************/
  2175. #define RCC_CIR_LSIRDYF ((uint32_t)0x00000001) /*!< LSI Ready Interrupt flag */
  2176. #define RCC_CIR_LSERDYF ((uint32_t)0x00000002) /*!< LSE Ready Interrupt flag */
  2177. #define RCC_CIR_HSIRDYF ((uint32_t)0x00000004) /*!< HSI Ready Interrupt flag */
  2178. #define RCC_CIR_HSERDYF ((uint32_t)0x00000008) /*!< HSE Ready Interrupt flag */
  2179. #define RCC_CIR_PLLRDYF ((uint32_t)0x00000010) /*!< PLL Ready Interrupt flag */
  2180. #define RCC_CIR_MSIRDYF ((uint32_t)0x00000020) /*!< MSI Ready Interrupt flag */
  2181. #define RCC_CIR_LSECSS ((uint32_t)0x00000040) /*!< LSE CSS Interrupt flag */
  2182. #define RCC_CIR_CSSF ((uint32_t)0x00000080) /*!< Clock Security System Interrupt flag */
  2183. #define RCC_CIR_LSIRDYIE ((uint32_t)0x00000100) /*!< LSI Ready Interrupt Enable */
  2184. #define RCC_CIR_LSERDYIE ((uint32_t)0x00000200) /*!< LSE Ready Interrupt Enable */
  2185. #define RCC_CIR_HSIRDYIE ((uint32_t)0x00000400) /*!< HSI Ready Interrupt Enable */
  2186. #define RCC_CIR_HSERDYIE ((uint32_t)0x00000800) /*!< HSE Ready Interrupt Enable */
  2187. #define RCC_CIR_PLLRDYIE ((uint32_t)0x00001000) /*!< PLL Ready Interrupt Enable */
  2188. #define RCC_CIR_MSIRDYIE ((uint32_t)0x00002000) /*!< MSI Ready Interrupt Enable */
  2189. #define RCC_CIR_LSECSSIE ((uint32_t)0x00004000) /*!< LSE CSS Interrupt Enable */
  2190. #define RCC_CIR_LSIRDYC ((uint32_t)0x00010000) /*!< LSI Ready Interrupt Clear */
  2191. #define RCC_CIR_LSERDYC ((uint32_t)0x00020000) /*!< LSE Ready Interrupt Clear */
  2192. #define RCC_CIR_HSIRDYC ((uint32_t)0x00040000) /*!< HSI Ready Interrupt Clear */
  2193. #define RCC_CIR_HSERDYC ((uint32_t)0x00080000) /*!< HSE Ready Interrupt Clear */
  2194. #define RCC_CIR_PLLRDYC ((uint32_t)0x00100000) /*!< PLL Ready Interrupt Clear */
  2195. #define RCC_CIR_MSIRDYC ((uint32_t)0x00200000) /*!< MSI Ready Interrupt Clear */
  2196. #define RCC_CIR_LSECSSC ((uint32_t)0x00400000) /*!< LSE CSS Interrupt Clear */
  2197. #define RCC_CIR_CSSC ((uint32_t)0x00800000) /*!< Clock Security System Interrupt Clear */
  2198. /***************** Bit definition for RCC_AHBRSTR register ******************/
  2199. #define RCC_AHBRSTR_GPIOARST ((uint32_t)0x00000001) /*!< GPIO port A reset */
  2200. #define RCC_AHBRSTR_GPIOBRST ((uint32_t)0x00000002) /*!< GPIO port B reset */
  2201. #define RCC_AHBRSTR_GPIOCRST ((uint32_t)0x00000004) /*!< GPIO port C reset */
  2202. #define RCC_AHBRSTR_GPIODRST ((uint32_t)0x00000008) /*!< GPIO port D reset */
  2203. #define RCC_AHBRSTR_GPIOHRST ((uint32_t)0x00000020) /*!< GPIO port H reset */
  2204. #define RCC_AHBRSTR_CRCRST ((uint32_t)0x00001000) /*!< CRC reset */
  2205. #define RCC_AHBRSTR_FLITFRST ((uint32_t)0x00008000) /*!< FLITF reset */
  2206. #define RCC_AHBRSTR_DMA1RST ((uint32_t)0x01000000) /*!< DMA1 reset */
  2207. /***************** Bit definition for RCC_APB2RSTR register *****************/
  2208. #define RCC_APB2RSTR_SYSCFGRST ((uint32_t)0x00000001) /*!< System Configuration SYSCFG reset */
  2209. #define RCC_APB2RSTR_TIM9RST ((uint32_t)0x00000004) /*!< TIM9 reset */
  2210. #define RCC_APB2RSTR_TIM10RST ((uint32_t)0x00000008) /*!< TIM10 reset */
  2211. #define RCC_APB2RSTR_TIM11RST ((uint32_t)0x00000010) /*!< TIM11 reset */
  2212. #define RCC_APB2RSTR_ADC1RST ((uint32_t)0x00000200) /*!< ADC1 reset */
  2213. #define RCC_APB2RSTR_SPI1RST ((uint32_t)0x00001000) /*!< SPI1 reset */
  2214. #define RCC_APB2RSTR_USART1RST ((uint32_t)0x00004000) /*!< USART1 reset */
  2215. /***************** Bit definition for RCC_APB1RSTR register *****************/
  2216. #define RCC_APB1RSTR_TIM2RST ((uint32_t)0x00000001) /*!< Timer 2 reset */
  2217. #define RCC_APB1RSTR_TIM3RST ((uint32_t)0x00000002) /*!< Timer 3 reset */
  2218. #define RCC_APB1RSTR_TIM4RST ((uint32_t)0x00000004) /*!< Timer 4 reset */
  2219. #define RCC_APB1RSTR_TIM6RST ((uint32_t)0x00000010) /*!< Timer 6 reset */
  2220. #define RCC_APB1RSTR_TIM7RST ((uint32_t)0x00000020) /*!< Timer 7 reset */
  2221. #define RCC_APB1RSTR_LCDRST ((uint32_t)0x00000200) /*!< LCD reset */
  2222. #define RCC_APB1RSTR_WWDGRST ((uint32_t)0x00000800) /*!< Window Watchdog reset */
  2223. #define RCC_APB1RSTR_SPI2RST ((uint32_t)0x00004000) /*!< SPI 2 reset */
  2224. #define RCC_APB1RSTR_USART2RST ((uint32_t)0x00020000) /*!< USART 2 reset */
  2225. #define RCC_APB1RSTR_USART3RST ((uint32_t)0x00040000) /*!< USART 3 reset */
  2226. #define RCC_APB1RSTR_I2C1RST ((uint32_t)0x00200000) /*!< I2C 1 reset */
  2227. #define RCC_APB1RSTR_I2C2RST ((uint32_t)0x00400000) /*!< I2C 2 reset */
  2228. #define RCC_APB1RSTR_USBRST ((uint32_t)0x00800000) /*!< USB reset */
  2229. #define RCC_APB1RSTR_PWRRST ((uint32_t)0x10000000) /*!< Power interface reset */
  2230. #define RCC_APB1RSTR_DACRST ((uint32_t)0x20000000) /*!< DAC interface reset */
  2231. #define RCC_APB1RSTR_COMPRST ((uint32_t)0x80000000) /*!< Comparator interface reset */
  2232. /****************** Bit definition for RCC_AHBENR register ******************/
  2233. #define RCC_AHBENR_GPIOAEN ((uint32_t)0x00000001) /*!< GPIO port A clock enable */
  2234. #define RCC_AHBENR_GPIOBEN ((uint32_t)0x00000002) /*!< GPIO port B clock enable */
  2235. #define RCC_AHBENR_GPIOCEN ((uint32_t)0x00000004) /*!< GPIO port C clock enable */
  2236. #define RCC_AHBENR_GPIODEN ((uint32_t)0x00000008) /*!< GPIO port D clock enable */
  2237. #define RCC_AHBENR_GPIOHEN ((uint32_t)0x00000020) /*!< GPIO port H clock enable */
  2238. #define RCC_AHBENR_CRCEN ((uint32_t)0x00001000) /*!< CRC clock enable */
  2239. #define RCC_AHBENR_FLITFEN ((uint32_t)0x00008000) /*!< FLITF clock enable (has effect only when
  2240. the Flash memory is in power down mode) */
  2241. #define RCC_AHBENR_DMA1EN ((uint32_t)0x01000000) /*!< DMA1 clock enable */
  2242. /****************** Bit definition for RCC_APB2ENR register *****************/
  2243. #define RCC_APB2ENR_SYSCFGEN ((uint32_t)0x00000001) /*!< System Configuration SYSCFG clock enable */
  2244. #define RCC_APB2ENR_TIM9EN ((uint32_t)0x00000004) /*!< TIM9 interface clock enable */
  2245. #define RCC_APB2ENR_TIM10EN ((uint32_t)0x00000008) /*!< TIM10 interface clock enable */
  2246. #define RCC_APB2ENR_TIM11EN ((uint32_t)0x00000010) /*!< TIM11 Timer clock enable */
  2247. #define RCC_APB2ENR_ADC1EN ((uint32_t)0x00000200) /*!< ADC1 clock enable */
  2248. #define RCC_APB2ENR_SPI1EN ((uint32_t)0x00001000) /*!< SPI1 clock enable */
  2249. #define RCC_APB2ENR_USART1EN ((uint32_t)0x00004000) /*!< USART1 clock enable */
  2250. /***************** Bit definition for RCC_APB1ENR register ******************/
  2251. #define RCC_APB1ENR_TIM2EN ((uint32_t)0x00000001) /*!< Timer 2 clock enabled*/
  2252. #define RCC_APB1ENR_TIM3EN ((uint32_t)0x00000002) /*!< Timer 3 clock enable */
  2253. #define RCC_APB1ENR_TIM4EN ((uint32_t)0x00000004) /*!< Timer 4 clock enable */
  2254. #define RCC_APB1ENR_TIM6EN ((uint32_t)0x00000010) /*!< Timer 6 clock enable */
  2255. #define RCC_APB1ENR_TIM7EN ((uint32_t)0x00000020) /*!< Timer 7 clock enable */
  2256. #define RCC_APB1ENR_LCDEN ((uint32_t)0x00000200) /*!< LCD clock enable */
  2257. #define RCC_APB1ENR_WWDGEN ((uint32_t)0x00000800) /*!< Window Watchdog clock enable */
  2258. #define RCC_APB1ENR_SPI2EN ((uint32_t)0x00004000) /*!< SPI 2 clock enable */
  2259. #define RCC_APB1ENR_USART2EN ((uint32_t)0x00020000) /*!< USART 2 clock enable */
  2260. #define RCC_APB1ENR_USART3EN ((uint32_t)0x00040000) /*!< USART 3 clock enable */
  2261. #define RCC_APB1ENR_I2C1EN ((uint32_t)0x00200000) /*!< I2C 1 clock enable */
  2262. #define RCC_APB1ENR_I2C2EN ((uint32_t)0x00400000) /*!< I2C 2 clock enable */
  2263. #define RCC_APB1ENR_USBEN ((uint32_t)0x00800000) /*!< USB clock enable */
  2264. #define RCC_APB1ENR_PWREN ((uint32_t)0x10000000) /*!< Power interface clock enable */
  2265. #define RCC_APB1ENR_DACEN ((uint32_t)0x20000000) /*!< DAC interface clock enable */
  2266. #define RCC_APB1ENR_COMPEN ((uint32_t)0x80000000) /*!< Comparator interface clock enable */
  2267. /****************** Bit definition for RCC_AHBLPENR register ****************/
  2268. #define RCC_AHBLPENR_GPIOALPEN ((uint32_t)0x00000001) /*!< GPIO port A clock enabled in sleep mode */
  2269. #define RCC_AHBLPENR_GPIOBLPEN ((uint32_t)0x00000002) /*!< GPIO port B clock enabled in sleep mode */
  2270. #define RCC_AHBLPENR_GPIOCLPEN ((uint32_t)0x00000004) /*!< GPIO port C clock enabled in sleep mode */
  2271. #define RCC_AHBLPENR_GPIODLPEN ((uint32_t)0x00000008) /*!< GPIO port D clock enabled in sleep mode */
  2272. #define RCC_AHBLPENR_GPIOHLPEN ((uint32_t)0x00000020) /*!< GPIO port H clock enabled in sleep mode */
  2273. #define RCC_AHBLPENR_CRCLPEN ((uint32_t)0x00001000) /*!< CRC clock enabled in sleep mode */
  2274. #define RCC_AHBLPENR_FLITFLPEN ((uint32_t)0x00008000) /*!< Flash Interface clock enabled in sleep mode
  2275. (has effect only when the Flash memory is
  2276. in power down mode) */
  2277. #define RCC_AHBLPENR_SRAMLPEN ((uint32_t)0x00010000) /*!< SRAM clock enabled in sleep mode */
  2278. #define RCC_AHBLPENR_DMA1LPEN ((uint32_t)0x01000000) /*!< DMA1 clock enabled in sleep mode */
  2279. /****************** Bit definition for RCC_APB2LPENR register ***************/
  2280. #define RCC_APB2LPENR_SYSCFGLPEN ((uint32_t)0x00000001) /*!< System Configuration SYSCFG clock enabled in sleep mode */
  2281. #define RCC_APB2LPENR_TIM9LPEN ((uint32_t)0x00000004) /*!< TIM9 interface clock enabled in sleep mode */
  2282. #define RCC_APB2LPENR_TIM10LPEN ((uint32_t)0x00000008) /*!< TIM10 interface clock enabled in sleep mode */
  2283. #define RCC_APB2LPENR_TIM11LPEN ((uint32_t)0x00000010) /*!< TIM11 Timer clock enabled in sleep mode */
  2284. #define RCC_APB2LPENR_ADC1LPEN ((uint32_t)0x00000200) /*!< ADC1 clock enabled in sleep mode */
  2285. #define RCC_APB2LPENR_SPI1LPEN ((uint32_t)0x00001000) /*!< SPI1 clock enabled in sleep mode */
  2286. #define RCC_APB2LPENR_USART1LPEN ((uint32_t)0x00004000) /*!< USART1 clock enabled in sleep mode */
  2287. /***************** Bit definition for RCC_APB1LPENR register ****************/
  2288. #define RCC_APB1LPENR_TIM2LPEN ((uint32_t)0x00000001) /*!< Timer 2 clock enabled in sleep mode */
  2289. #define RCC_APB1LPENR_TIM3LPEN ((uint32_t)0x00000002) /*!< Timer 3 clock enabled in sleep mode */
  2290. #define RCC_APB1LPENR_TIM4LPEN ((uint32_t)0x00000004) /*!< Timer 4 clock enabled in sleep mode */
  2291. #define RCC_APB1LPENR_TIM6LPEN ((uint32_t)0x00000010) /*!< Timer 6 clock enabled in sleep mode */
  2292. #define RCC_APB1LPENR_TIM7LPEN ((uint32_t)0x00000020) /*!< Timer 7 clock enabled in sleep mode */
  2293. #define RCC_APB1LPENR_LCDLPEN ((uint32_t)0x00000200) /*!< LCD clock enabled in sleep mode */
  2294. #define RCC_APB1LPENR_WWDGLPEN ((uint32_t)0x00000800) /*!< Window Watchdog clock enabled in sleep mode */
  2295. #define RCC_APB1LPENR_SPI2LPEN ((uint32_t)0x00004000) /*!< SPI 2 clock enabled in sleep mode */
  2296. #define RCC_APB1LPENR_USART2LPEN ((uint32_t)0x00020000) /*!< USART 2 clock enabled in sleep mode */
  2297. #define RCC_APB1LPENR_USART3LPEN ((uint32_t)0x00040000) /*!< USART 3 clock enabled in sleep mode */
  2298. #define RCC_APB1LPENR_I2C1LPEN ((uint32_t)0x00200000) /*!< I2C 1 clock enabled in sleep mode */
  2299. #define RCC_APB1LPENR_I2C2LPEN ((uint32_t)0x00400000) /*!< I2C 2 clock enabled in sleep mode */
  2300. #define RCC_APB1LPENR_USBLPEN ((uint32_t)0x00800000) /*!< USB clock enabled in sleep mode */
  2301. #define RCC_APB1LPENR_PWRLPEN ((uint32_t)0x10000000) /*!< Power interface clock enabled in sleep mode */
  2302. #define RCC_APB1LPENR_DACLPEN ((uint32_t)0x20000000) /*!< DAC interface clock enabled in sleep mode */
  2303. #define RCC_APB1LPENR_COMPLPEN ((uint32_t)0x80000000) /*!< Comparator interface clock enabled in sleep mode*/
  2304. /******************* Bit definition for RCC_CSR register ********************/
  2305. #define RCC_CSR_LSION ((uint32_t)0x00000001) /*!< Internal Low Speed oscillator enable */
  2306. #define RCC_CSR_LSIRDY ((uint32_t)0x00000002) /*!< Internal Low Speed oscillator Ready */
  2307. #define RCC_CSR_LSEON ((uint32_t)0x00000100) /*!< External Low Speed oscillator enable */
  2308. #define RCC_CSR_LSERDY ((uint32_t)0x00000200) /*!< External Low Speed oscillator Ready */
  2309. #define RCC_CSR_LSEBYP ((uint32_t)0x00000400) /*!< External Low Speed oscillator Bypass */
  2310. #define RCC_CSR_LSECSSON ((uint32_t)0x00000800) /*!< External Low Speed oscillator CSS Enable */
  2311. #define RCC_CSR_LSECSSD ((uint32_t)0x00001000) /*!< External Low Speed oscillator CSS Detected */
  2312. #define RCC_CSR_RTCSEL ((uint32_t)0x00030000) /*!< RTCSEL[1:0] bits (RTC clock source selection) */
  2313. #define RCC_CSR_RTCSEL_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  2314. #define RCC_CSR_RTCSEL_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  2315. /*!< RTC congiguration */
  2316. #define RCC_CSR_RTCSEL_NOCLOCK ((uint32_t)0x00000000) /*!< No clock */
  2317. #define RCC_CSR_RTCSEL_LSE ((uint32_t)0x00010000) /*!< LSE oscillator clock used as RTC clock */
  2318. #define RCC_CSR_RTCSEL_LSI ((uint32_t)0x00020000) /*!< LSI oscillator clock used as RTC clock */
  2319. #define RCC_CSR_RTCSEL_HSE ((uint32_t)0x00030000) /*!< HSE oscillator clock divided by 2, 4, 8 or 16 by RTCPRE used as RTC clock */
  2320. #define RCC_CSR_RTCEN ((uint32_t)0x00400000) /*!< RTC clock enable */
  2321. #define RCC_CSR_RTCRST ((uint32_t)0x00800000) /*!< RTC reset */
  2322. #define RCC_CSR_RMVF ((uint32_t)0x01000000) /*!< Remove reset flag */
  2323. #define RCC_CSR_OBLRSTF ((uint32_t)0x02000000) /*!< Option Bytes Loader reset flag */
  2324. #define RCC_CSR_PINRSTF ((uint32_t)0x04000000) /*!< PIN reset flag */
  2325. #define RCC_CSR_PORRSTF ((uint32_t)0x08000000) /*!< POR/PDR reset flag */
  2326. #define RCC_CSR_SFTRSTF ((uint32_t)0x10000000) /*!< Software Reset flag */
  2327. #define RCC_CSR_IWDGRSTF ((uint32_t)0x20000000) /*!< Independent Watchdog reset flag */
  2328. #define RCC_CSR_WWDGRSTF ((uint32_t)0x40000000) /*!< Window watchdog reset flag */
  2329. #define RCC_CSR_LPWRRSTF ((uint32_t)0x80000000) /*!< Low-Power reset flag */
  2330. /******************************************************************************/
  2331. /* */
  2332. /* Real-Time Clock (RTC) */
  2333. /* */
  2334. /******************************************************************************/
  2335. /******************** Bits definition for RTC_TR register *******************/
  2336. #define RTC_TR_PM ((uint32_t)0x00400000)
  2337. #define RTC_TR_HT ((uint32_t)0x00300000)
  2338. #define RTC_TR_HT_0 ((uint32_t)0x00100000)
  2339. #define RTC_TR_HT_1 ((uint32_t)0x00200000)
  2340. #define RTC_TR_HU ((uint32_t)0x000F0000)
  2341. #define RTC_TR_HU_0 ((uint32_t)0x00010000)
  2342. #define RTC_TR_HU_1 ((uint32_t)0x00020000)
  2343. #define RTC_TR_HU_2 ((uint32_t)0x00040000)
  2344. #define RTC_TR_HU_3 ((uint32_t)0x00080000)
  2345. #define RTC_TR_MNT ((uint32_t)0x00007000)
  2346. #define RTC_TR_MNT_0 ((uint32_t)0x00001000)
  2347. #define RTC_TR_MNT_1 ((uint32_t)0x00002000)
  2348. #define RTC_TR_MNT_2 ((uint32_t)0x00004000)
  2349. #define RTC_TR_MNU ((uint32_t)0x00000F00)
  2350. #define RTC_TR_MNU_0 ((uint32_t)0x00000100)
  2351. #define RTC_TR_MNU_1 ((uint32_t)0x00000200)
  2352. #define RTC_TR_MNU_2 ((uint32_t)0x00000400)
  2353. #define RTC_TR_MNU_3 ((uint32_t)0x00000800)
  2354. #define RTC_TR_ST ((uint32_t)0x00000070)
  2355. #define RTC_TR_ST_0 ((uint32_t)0x00000010)
  2356. #define RTC_TR_ST_1 ((uint32_t)0x00000020)
  2357. #define RTC_TR_ST_2 ((uint32_t)0x00000040)
  2358. #define RTC_TR_SU ((uint32_t)0x0000000F)
  2359. #define RTC_TR_SU_0 ((uint32_t)0x00000001)
  2360. #define RTC_TR_SU_1 ((uint32_t)0x00000002)
  2361. #define RTC_TR_SU_2 ((uint32_t)0x00000004)
  2362. #define RTC_TR_SU_3 ((uint32_t)0x00000008)
  2363. /******************** Bits definition for RTC_DR register *******************/
  2364. #define RTC_DR_YT ((uint32_t)0x00F00000)
  2365. #define RTC_DR_YT_0 ((uint32_t)0x00100000)
  2366. #define RTC_DR_YT_1 ((uint32_t)0x00200000)
  2367. #define RTC_DR_YT_2 ((uint32_t)0x00400000)
  2368. #define RTC_DR_YT_3 ((uint32_t)0x00800000)
  2369. #define RTC_DR_YU ((uint32_t)0x000F0000)
  2370. #define RTC_DR_YU_0 ((uint32_t)0x00010000)
  2371. #define RTC_DR_YU_1 ((uint32_t)0x00020000)
  2372. #define RTC_DR_YU_2 ((uint32_t)0x00040000)
  2373. #define RTC_DR_YU_3 ((uint32_t)0x00080000)
  2374. #define RTC_DR_WDU ((uint32_t)0x0000E000)
  2375. #define RTC_DR_WDU_0 ((uint32_t)0x00002000)
  2376. #define RTC_DR_WDU_1 ((uint32_t)0x00004000)
  2377. #define RTC_DR_WDU_2 ((uint32_t)0x00008000)
  2378. #define RTC_DR_MT ((uint32_t)0x00001000)
  2379. #define RTC_DR_MU ((uint32_t)0x00000F00)
  2380. #define RTC_DR_MU_0 ((uint32_t)0x00000100)
  2381. #define RTC_DR_MU_1 ((uint32_t)0x00000200)
  2382. #define RTC_DR_MU_2 ((uint32_t)0x00000400)
  2383. #define RTC_DR_MU_3 ((uint32_t)0x00000800)
  2384. #define RTC_DR_DT ((uint32_t)0x00000030)
  2385. #define RTC_DR_DT_0 ((uint32_t)0x00000010)
  2386. #define RTC_DR_DT_1 ((uint32_t)0x00000020)
  2387. #define RTC_DR_DU ((uint32_t)0x0000000F)
  2388. #define RTC_DR_DU_0 ((uint32_t)0x00000001)
  2389. #define RTC_DR_DU_1 ((uint32_t)0x00000002)
  2390. #define RTC_DR_DU_2 ((uint32_t)0x00000004)
  2391. #define RTC_DR_DU_3 ((uint32_t)0x00000008)
  2392. /******************** Bits definition for RTC_CR register *******************/
  2393. #define RTC_CR_COE ((uint32_t)0x00800000)
  2394. #define RTC_CR_OSEL ((uint32_t)0x00600000)
  2395. #define RTC_CR_OSEL_0 ((uint32_t)0x00200000)
  2396. #define RTC_CR_OSEL_1 ((uint32_t)0x00400000)
  2397. #define RTC_CR_POL ((uint32_t)0x00100000)
  2398. #define RTC_CR_COSEL ((uint32_t)0x00080000)
  2399. #define RTC_CR_BCK ((uint32_t)0x00040000)
  2400. #define RTC_CR_SUB1H ((uint32_t)0x00020000)
  2401. #define RTC_CR_ADD1H ((uint32_t)0x00010000)
  2402. #define RTC_CR_TSIE ((uint32_t)0x00008000)
  2403. #define RTC_CR_WUTIE ((uint32_t)0x00004000)
  2404. #define RTC_CR_ALRBIE ((uint32_t)0x00002000)
  2405. #define RTC_CR_ALRAIE ((uint32_t)0x00001000)
  2406. #define RTC_CR_TSE ((uint32_t)0x00000800)
  2407. #define RTC_CR_WUTE ((uint32_t)0x00000400)
  2408. #define RTC_CR_ALRBE ((uint32_t)0x00000200)
  2409. #define RTC_CR_ALRAE ((uint32_t)0x00000100)
  2410. #define RTC_CR_DCE ((uint32_t)0x00000080)
  2411. #define RTC_CR_FMT ((uint32_t)0x00000040)
  2412. #define RTC_CR_BYPSHAD ((uint32_t)0x00000020)
  2413. #define RTC_CR_REFCKON ((uint32_t)0x00000010)
  2414. #define RTC_CR_TSEDGE ((uint32_t)0x00000008)
  2415. #define RTC_CR_WUCKSEL ((uint32_t)0x00000007)
  2416. #define RTC_CR_WUCKSEL_0 ((uint32_t)0x00000001)
  2417. #define RTC_CR_WUCKSEL_1 ((uint32_t)0x00000002)
  2418. #define RTC_CR_WUCKSEL_2 ((uint32_t)0x00000004)
  2419. /******************** Bits definition for RTC_ISR register ******************/
  2420. #define RTC_ISR_RECALPF ((uint32_t)0x00010000)
  2421. #define RTC_ISR_TAMP3F ((uint32_t)0x00008000)
  2422. #define RTC_ISR_TAMP2F ((uint32_t)0x00004000)
  2423. #define RTC_ISR_TAMP1F ((uint32_t)0x00002000)
  2424. #define RTC_ISR_TSOVF ((uint32_t)0x00001000)
  2425. #define RTC_ISR_TSF ((uint32_t)0x00000800)
  2426. #define RTC_ISR_WUTF ((uint32_t)0x00000400)
  2427. #define RTC_ISR_ALRBF ((uint32_t)0x00000200)
  2428. #define RTC_ISR_ALRAF ((uint32_t)0x00000100)
  2429. #define RTC_ISR_INIT ((uint32_t)0x00000080)
  2430. #define RTC_ISR_INITF ((uint32_t)0x00000040)
  2431. #define RTC_ISR_RSF ((uint32_t)0x00000020)
  2432. #define RTC_ISR_INITS ((uint32_t)0x00000010)
  2433. #define RTC_ISR_SHPF ((uint32_t)0x00000008)
  2434. #define RTC_ISR_WUTWF ((uint32_t)0x00000004)
  2435. #define RTC_ISR_ALRBWF ((uint32_t)0x00000002)
  2436. #define RTC_ISR_ALRAWF ((uint32_t)0x00000001)
  2437. /******************** Bits definition for RTC_PRER register *****************/
  2438. #define RTC_PRER_PREDIV_A ((uint32_t)0x007F0000)
  2439. #define RTC_PRER_PREDIV_S ((uint32_t)0x00007FFF)
  2440. /******************** Bits definition for RTC_WUTR register *****************/
  2441. #define RTC_WUTR_WUT ((uint32_t)0x0000FFFF)
  2442. /******************** Bits definition for RTC_CALIBR register ***************/
  2443. #define RTC_CALIBR_DCS ((uint32_t)0x00000080)
  2444. #define RTC_CALIBR_DC ((uint32_t)0x0000001F)
  2445. /******************** Bits definition for RTC_ALRMAR register ***************/
  2446. #define RTC_ALRMAR_MSK4 ((uint32_t)0x80000000)
  2447. #define RTC_ALRMAR_WDSEL ((uint32_t)0x40000000)
  2448. #define RTC_ALRMAR_DT ((uint32_t)0x30000000)
  2449. #define RTC_ALRMAR_DT_0 ((uint32_t)0x10000000)
  2450. #define RTC_ALRMAR_DT_1 ((uint32_t)0x20000000)
  2451. #define RTC_ALRMAR_DU ((uint32_t)0x0F000000)
  2452. #define RTC_ALRMAR_DU_0 ((uint32_t)0x01000000)
  2453. #define RTC_ALRMAR_DU_1 ((uint32_t)0x02000000)
  2454. #define RTC_ALRMAR_DU_2 ((uint32_t)0x04000000)
  2455. #define RTC_ALRMAR_DU_3 ((uint32_t)0x08000000)
  2456. #define RTC_ALRMAR_MSK3 ((uint32_t)0x00800000)
  2457. #define RTC_ALRMAR_PM ((uint32_t)0x00400000)
  2458. #define RTC_ALRMAR_HT ((uint32_t)0x00300000)
  2459. #define RTC_ALRMAR_HT_0 ((uint32_t)0x00100000)
  2460. #define RTC_ALRMAR_HT_1 ((uint32_t)0x00200000)
  2461. #define RTC_ALRMAR_HU ((uint32_t)0x000F0000)
  2462. #define RTC_ALRMAR_HU_0 ((uint32_t)0x00010000)
  2463. #define RTC_ALRMAR_HU_1 ((uint32_t)0x00020000)
  2464. #define RTC_ALRMAR_HU_2 ((uint32_t)0x00040000)
  2465. #define RTC_ALRMAR_HU_3 ((uint32_t)0x00080000)
  2466. #define RTC_ALRMAR_MSK2 ((uint32_t)0x00008000)
  2467. #define RTC_ALRMAR_MNT ((uint32_t)0x00007000)
  2468. #define RTC_ALRMAR_MNT_0 ((uint32_t)0x00001000)
  2469. #define RTC_ALRMAR_MNT_1 ((uint32_t)0x00002000)
  2470. #define RTC_ALRMAR_MNT_2 ((uint32_t)0x00004000)
  2471. #define RTC_ALRMAR_MNU ((uint32_t)0x00000F00)
  2472. #define RTC_ALRMAR_MNU_0 ((uint32_t)0x00000100)
  2473. #define RTC_ALRMAR_MNU_1 ((uint32_t)0x00000200)
  2474. #define RTC_ALRMAR_MNU_2 ((uint32_t)0x00000400)
  2475. #define RTC_ALRMAR_MNU_3 ((uint32_t)0x00000800)
  2476. #define RTC_ALRMAR_MSK1 ((uint32_t)0x00000080)
  2477. #define RTC_ALRMAR_ST ((uint32_t)0x00000070)
  2478. #define RTC_ALRMAR_ST_0 ((uint32_t)0x00000010)
  2479. #define RTC_ALRMAR_ST_1 ((uint32_t)0x00000020)
  2480. #define RTC_ALRMAR_ST_2 ((uint32_t)0x00000040)
  2481. #define RTC_ALRMAR_SU ((uint32_t)0x0000000F)
  2482. #define RTC_ALRMAR_SU_0 ((uint32_t)0x00000001)
  2483. #define RTC_ALRMAR_SU_1 ((uint32_t)0x00000002)
  2484. #define RTC_ALRMAR_SU_2 ((uint32_t)0x00000004)
  2485. #define RTC_ALRMAR_SU_3 ((uint32_t)0x00000008)
  2486. /******************** Bits definition for RTC_ALRMBR register ***************/
  2487. #define RTC_ALRMBR_MSK4 ((uint32_t)0x80000000)
  2488. #define RTC_ALRMBR_WDSEL ((uint32_t)0x40000000)
  2489. #define RTC_ALRMBR_DT ((uint32_t)0x30000000)
  2490. #define RTC_ALRMBR_DT_0 ((uint32_t)0x10000000)
  2491. #define RTC_ALRMBR_DT_1 ((uint32_t)0x20000000)
  2492. #define RTC_ALRMBR_DU ((uint32_t)0x0F000000)
  2493. #define RTC_ALRMBR_DU_0 ((uint32_t)0x01000000)
  2494. #define RTC_ALRMBR_DU_1 ((uint32_t)0x02000000)
  2495. #define RTC_ALRMBR_DU_2 ((uint32_t)0x04000000)
  2496. #define RTC_ALRMBR_DU_3 ((uint32_t)0x08000000)
  2497. #define RTC_ALRMBR_MSK3 ((uint32_t)0x00800000)
  2498. #define RTC_ALRMBR_PM ((uint32_t)0x00400000)
  2499. #define RTC_ALRMBR_HT ((uint32_t)0x00300000)
  2500. #define RTC_ALRMBR_HT_0 ((uint32_t)0x00100000)
  2501. #define RTC_ALRMBR_HT_1 ((uint32_t)0x00200000)
  2502. #define RTC_ALRMBR_HU ((uint32_t)0x000F0000)
  2503. #define RTC_ALRMBR_HU_0 ((uint32_t)0x00010000)
  2504. #define RTC_ALRMBR_HU_1 ((uint32_t)0x00020000)
  2505. #define RTC_ALRMBR_HU_2 ((uint32_t)0x00040000)
  2506. #define RTC_ALRMBR_HU_3 ((uint32_t)0x00080000)
  2507. #define RTC_ALRMBR_MSK2 ((uint32_t)0x00008000)
  2508. #define RTC_ALRMBR_MNT ((uint32_t)0x00007000)
  2509. #define RTC_ALRMBR_MNT_0 ((uint32_t)0x00001000)
  2510. #define RTC_ALRMBR_MNT_1 ((uint32_t)0x00002000)
  2511. #define RTC_ALRMBR_MNT_2 ((uint32_t)0x00004000)
  2512. #define RTC_ALRMBR_MNU ((uint32_t)0x00000F00)
  2513. #define RTC_ALRMBR_MNU_0 ((uint32_t)0x00000100)
  2514. #define RTC_ALRMBR_MNU_1 ((uint32_t)0x00000200)
  2515. #define RTC_ALRMBR_MNU_2 ((uint32_t)0x00000400)
  2516. #define RTC_ALRMBR_MNU_3 ((uint32_t)0x00000800)
  2517. #define RTC_ALRMBR_MSK1 ((uint32_t)0x00000080)
  2518. #define RTC_ALRMBR_ST ((uint32_t)0x00000070)
  2519. #define RTC_ALRMBR_ST_0 ((uint32_t)0x00000010)
  2520. #define RTC_ALRMBR_ST_1 ((uint32_t)0x00000020)
  2521. #define RTC_ALRMBR_ST_2 ((uint32_t)0x00000040)
  2522. #define RTC_ALRMBR_SU ((uint32_t)0x0000000F)
  2523. #define RTC_ALRMBR_SU_0 ((uint32_t)0x00000001)
  2524. #define RTC_ALRMBR_SU_1 ((uint32_t)0x00000002)
  2525. #define RTC_ALRMBR_SU_2 ((uint32_t)0x00000004)
  2526. #define RTC_ALRMBR_SU_3 ((uint32_t)0x00000008)
  2527. /******************** Bits definition for RTC_WPR register ******************/
  2528. #define RTC_WPR_KEY ((uint32_t)0x000000FF)
  2529. /******************** Bits definition for RTC_SSR register ******************/
  2530. #define RTC_SSR_SS ((uint32_t)0x0000FFFF)
  2531. /******************** Bits definition for RTC_SHIFTR register ***************/
  2532. #define RTC_SHIFTR_SUBFS ((uint32_t)0x00007FFF)
  2533. #define RTC_SHIFTR_ADD1S ((uint32_t)0x80000000)
  2534. /******************** Bits definition for RTC_TSTR register *****************/
  2535. #define RTC_TSTR_PM ((uint32_t)0x00400000)
  2536. #define RTC_TSTR_HT ((uint32_t)0x00300000)
  2537. #define RTC_TSTR_HT_0 ((uint32_t)0x00100000)
  2538. #define RTC_TSTR_HT_1 ((uint32_t)0x00200000)
  2539. #define RTC_TSTR_HU ((uint32_t)0x000F0000)
  2540. #define RTC_TSTR_HU_0 ((uint32_t)0x00010000)
  2541. #define RTC_TSTR_HU_1 ((uint32_t)0x00020000)
  2542. #define RTC_TSTR_HU_2 ((uint32_t)0x00040000)
  2543. #define RTC_TSTR_HU_3 ((uint32_t)0x00080000)
  2544. #define RTC_TSTR_MNT ((uint32_t)0x00007000)
  2545. #define RTC_TSTR_MNT_0 ((uint32_t)0x00001000)
  2546. #define RTC_TSTR_MNT_1 ((uint32_t)0x00002000)
  2547. #define RTC_TSTR_MNT_2 ((uint32_t)0x00004000)
  2548. #define RTC_TSTR_MNU ((uint32_t)0x00000F00)
  2549. #define RTC_TSTR_MNU_0 ((uint32_t)0x00000100)
  2550. #define RTC_TSTR_MNU_1 ((uint32_t)0x00000200)
  2551. #define RTC_TSTR_MNU_2 ((uint32_t)0x00000400)
  2552. #define RTC_TSTR_MNU_3 ((uint32_t)0x00000800)
  2553. #define RTC_TSTR_ST ((uint32_t)0x00000070)
  2554. #define RTC_TSTR_ST_0 ((uint32_t)0x00000010)
  2555. #define RTC_TSTR_ST_1 ((uint32_t)0x00000020)
  2556. #define RTC_TSTR_ST_2 ((uint32_t)0x00000040)
  2557. #define RTC_TSTR_SU ((uint32_t)0x0000000F)
  2558. #define RTC_TSTR_SU_0 ((uint32_t)0x00000001)
  2559. #define RTC_TSTR_SU_1 ((uint32_t)0x00000002)
  2560. #define RTC_TSTR_SU_2 ((uint32_t)0x00000004)
  2561. #define RTC_TSTR_SU_3 ((uint32_t)0x00000008)
  2562. /******************** Bits definition for RTC_TSDR register *****************/
  2563. #define RTC_TSDR_WDU ((uint32_t)0x0000E000)
  2564. #define RTC_TSDR_WDU_0 ((uint32_t)0x00002000)
  2565. #define RTC_TSDR_WDU_1 ((uint32_t)0x00004000)
  2566. #define RTC_TSDR_WDU_2 ((uint32_t)0x00008000)
  2567. #define RTC_TSDR_MT ((uint32_t)0x00001000)
  2568. #define RTC_TSDR_MU ((uint32_t)0x00000F00)
  2569. #define RTC_TSDR_MU_0 ((uint32_t)0x00000100)
  2570. #define RTC_TSDR_MU_1 ((uint32_t)0x00000200)
  2571. #define RTC_TSDR_MU_2 ((uint32_t)0x00000400)
  2572. #define RTC_TSDR_MU_3 ((uint32_t)0x00000800)
  2573. #define RTC_TSDR_DT ((uint32_t)0x00000030)
  2574. #define RTC_TSDR_DT_0 ((uint32_t)0x00000010)
  2575. #define RTC_TSDR_DT_1 ((uint32_t)0x00000020)
  2576. #define RTC_TSDR_DU ((uint32_t)0x0000000F)
  2577. #define RTC_TSDR_DU_0 ((uint32_t)0x00000001)
  2578. #define RTC_TSDR_DU_1 ((uint32_t)0x00000002)
  2579. #define RTC_TSDR_DU_2 ((uint32_t)0x00000004)
  2580. #define RTC_TSDR_DU_3 ((uint32_t)0x00000008)
  2581. /******************** Bits definition for RTC_TSSSR register ****************/
  2582. #define RTC_TSSSR_SS ((uint32_t)0x0000FFFF)
  2583. /******************** Bits definition for RTC_CAL register *****************/
  2584. #define RTC_CALR_CALP ((uint32_t)0x00008000)
  2585. #define RTC_CALR_CALW8 ((uint32_t)0x00004000)
  2586. #define RTC_CALR_CALW16 ((uint32_t)0x00002000)
  2587. #define RTC_CALR_CALM ((uint32_t)0x000001FF)
  2588. #define RTC_CALR_CALM_0 ((uint32_t)0x00000001)
  2589. #define RTC_CALR_CALM_1 ((uint32_t)0x00000002)
  2590. #define RTC_CALR_CALM_2 ((uint32_t)0x00000004)
  2591. #define RTC_CALR_CALM_3 ((uint32_t)0x00000008)
  2592. #define RTC_CALR_CALM_4 ((uint32_t)0x00000010)
  2593. #define RTC_CALR_CALM_5 ((uint32_t)0x00000020)
  2594. #define RTC_CALR_CALM_6 ((uint32_t)0x00000040)
  2595. #define RTC_CALR_CALM_7 ((uint32_t)0x00000080)
  2596. #define RTC_CALR_CALM_8 ((uint32_t)0x00000100)
  2597. /******************** Bits definition for RTC_TAFCR register ****************/
  2598. #define RTC_TAFCR_ALARMOUTTYPE ((uint32_t)0x00040000)
  2599. #define RTC_TAFCR_TAMPPUDIS ((uint32_t)0x00008000)
  2600. #define RTC_TAFCR_TAMPPRCH ((uint32_t)0x00006000)
  2601. #define RTC_TAFCR_TAMPPRCH_0 ((uint32_t)0x00002000)
  2602. #define RTC_TAFCR_TAMPPRCH_1 ((uint32_t)0x00004000)
  2603. #define RTC_TAFCR_TAMPFLT ((uint32_t)0x00001800)
  2604. #define RTC_TAFCR_TAMPFLT_0 ((uint32_t)0x00000800)
  2605. #define RTC_TAFCR_TAMPFLT_1 ((uint32_t)0x00001000)
  2606. #define RTC_TAFCR_TAMPFREQ ((uint32_t)0x00000700)
  2607. #define RTC_TAFCR_TAMPFREQ_0 ((uint32_t)0x00000100)
  2608. #define RTC_TAFCR_TAMPFREQ_1 ((uint32_t)0x00000200)
  2609. #define RTC_TAFCR_TAMPFREQ_2 ((uint32_t)0x00000400)
  2610. #define RTC_TAFCR_TAMPTS ((uint32_t)0x00000080)
  2611. #define RTC_TAFCR_TAMP3TRG ((uint32_t)0x00000040)
  2612. #define RTC_TAFCR_TAMP3E ((uint32_t)0x00000020)
  2613. #define RTC_TAFCR_TAMP2TRG ((uint32_t)0x00000010)
  2614. #define RTC_TAFCR_TAMP2E ((uint32_t)0x00000008)
  2615. #define RTC_TAFCR_TAMPIE ((uint32_t)0x00000004)
  2616. #define RTC_TAFCR_TAMP1TRG ((uint32_t)0x00000002)
  2617. #define RTC_TAFCR_TAMP1E ((uint32_t)0x00000001)
  2618. /******************** Bits definition for RTC_ALRMASSR register *************/
  2619. #define RTC_ALRMASSR_MASKSS ((uint32_t)0x0F000000)
  2620. #define RTC_ALRMASSR_MASKSS_0 ((uint32_t)0x01000000)
  2621. #define RTC_ALRMASSR_MASKSS_1 ((uint32_t)0x02000000)
  2622. #define RTC_ALRMASSR_MASKSS_2 ((uint32_t)0x04000000)
  2623. #define RTC_ALRMASSR_MASKSS_3 ((uint32_t)0x08000000)
  2624. #define RTC_ALRMASSR_SS ((uint32_t)0x00007FFF)
  2625. /******************** Bits definition for RTC_ALRMBSSR register *************/
  2626. #define RTC_ALRMBSSR_MASKSS ((uint32_t)0x0F000000)
  2627. #define RTC_ALRMBSSR_MASKSS_0 ((uint32_t)0x01000000)
  2628. #define RTC_ALRMBSSR_MASKSS_1 ((uint32_t)0x02000000)
  2629. #define RTC_ALRMBSSR_MASKSS_2 ((uint32_t)0x04000000)
  2630. #define RTC_ALRMBSSR_MASKSS_3 ((uint32_t)0x08000000)
  2631. #define RTC_ALRMBSSR_SS ((uint32_t)0x00007FFF)
  2632. /******************** Bits definition for RTC_BKP0R register ****************/
  2633. #define RTC_BKP0R ((uint32_t)0xFFFFFFFF)
  2634. /******************** Bits definition for RTC_BKP1R register ****************/
  2635. #define RTC_BKP1R ((uint32_t)0xFFFFFFFF)
  2636. /******************** Bits definition for RTC_BKP2R register ****************/
  2637. #define RTC_BKP2R ((uint32_t)0xFFFFFFFF)
  2638. /******************** Bits definition for RTC_BKP3R register ****************/
  2639. #define RTC_BKP3R ((uint32_t)0xFFFFFFFF)
  2640. /******************** Bits definition for RTC_BKP4R register ****************/
  2641. #define RTC_BKP4R ((uint32_t)0xFFFFFFFF)
  2642. /******************** Number of backup registers ******************************/
  2643. #define RTC_BKP_NUMBER 5
  2644. /******************************************************************************/
  2645. /* */
  2646. /* Serial Peripheral Interface (SPI) */
  2647. /* */
  2648. /******************************************************************************/
  2649. /******************* Bit definition for SPI_CR1 register ********************/
  2650. #define SPI_CR1_CPHA ((uint32_t)0x00000001) /*!< Clock Phase */
  2651. #define SPI_CR1_CPOL ((uint32_t)0x00000002) /*!< Clock Polarity */
  2652. #define SPI_CR1_MSTR ((uint32_t)0x00000004) /*!< Master Selection */
  2653. #define SPI_CR1_BR ((uint32_t)0x00000038) /*!< BR[2:0] bits (Baud Rate Control) */
  2654. #define SPI_CR1_BR_0 ((uint32_t)0x00000008) /*!< Bit 0 */
  2655. #define SPI_CR1_BR_1 ((uint32_t)0x00000010) /*!< Bit 1 */
  2656. #define SPI_CR1_BR_2 ((uint32_t)0x00000020) /*!< Bit 2 */
  2657. #define SPI_CR1_SPE ((uint32_t)0x00000040) /*!< SPI Enable */
  2658. #define SPI_CR1_LSBFIRST ((uint32_t)0x00000080) /*!< Frame Format */
  2659. #define SPI_CR1_SSI ((uint32_t)0x00000100) /*!< Internal slave select */
  2660. #define SPI_CR1_SSM ((uint32_t)0x00000200) /*!< Software slave management */
  2661. #define SPI_CR1_RXONLY ((uint32_t)0x00000400) /*!< Receive only */
  2662. #define SPI_CR1_DFF ((uint32_t)0x00000800) /*!< Data Frame Format */
  2663. #define SPI_CR1_CRCNEXT ((uint32_t)0x00001000) /*!< Transmit CRC next */
  2664. #define SPI_CR1_CRCEN ((uint32_t)0x00002000) /*!< Hardware CRC calculation enable */
  2665. #define SPI_CR1_BIDIOE ((uint32_t)0x00004000) /*!< Output enable in bidirectional mode */
  2666. #define SPI_CR1_BIDIMODE ((uint32_t)0x00008000) /*!< Bidirectional data mode enable */
  2667. /******************* Bit definition for SPI_CR2 register ********************/
  2668. #define SPI_CR2_RXDMAEN ((uint32_t)0x00000001) /*!< Rx Buffer DMA Enable */
  2669. #define SPI_CR2_TXDMAEN ((uint32_t)0x00000002) /*!< Tx Buffer DMA Enable */
  2670. #define SPI_CR2_SSOE ((uint32_t)0x00000004) /*!< SS Output Enable */
  2671. #define SPI_CR2_ERRIE ((uint32_t)0x00000020) /*!< Error Interrupt Enable */
  2672. #define SPI_CR2_RXNEIE ((uint32_t)0x00000040) /*!< RX buffer Not Empty Interrupt Enable */
  2673. #define SPI_CR2_TXEIE ((uint32_t)0x00000080) /*!< Tx buffer Empty Interrupt Enable */
  2674. /******************** Bit definition for SPI_SR register ********************/
  2675. #define SPI_SR_RXNE ((uint32_t)0x00000001) /*!< Receive buffer Not Empty */
  2676. #define SPI_SR_TXE ((uint32_t)0x00000002) /*!< Transmit buffer Empty */
  2677. #define SPI_SR_CHSIDE ((uint32_t)0x00000004) /*!< Channel side */
  2678. #define SPI_SR_UDR ((uint32_t)0x00000008) /*!< Underrun flag */
  2679. #define SPI_SR_CRCERR ((uint32_t)0x00000010) /*!< CRC Error flag */
  2680. #define SPI_SR_MODF ((uint32_t)0x00000020) /*!< Mode fault */
  2681. #define SPI_SR_OVR ((uint32_t)0x00000040) /*!< Overrun flag */
  2682. #define SPI_SR_BSY ((uint32_t)0x00000080) /*!< Busy flag */
  2683. #define SPI_SR_FRE ((uint32_t)0x00000100) /*!<Frame format error flag */
  2684. /******************** Bit definition for SPI_DR register ********************/
  2685. #define SPI_DR_DR ((uint32_t)0x0000FFFF) /*!< Data Register */
  2686. /******************* Bit definition for SPI_CRCPR register ******************/
  2687. #define SPI_CRCPR_CRCPOLY ((uint32_t)0x0000FFFF) /*!< CRC polynomial register */
  2688. /****************** Bit definition for SPI_RXCRCR register ******************/
  2689. #define SPI_RXCRCR_RXCRC ((uint32_t)0x0000FFFF) /*!< Rx CRC Register */
  2690. /****************** Bit definition for SPI_TXCRCR register ******************/
  2691. #define SPI_TXCRCR_TXCRC ((uint32_t)0x0000FFFF) /*!< Tx CRC Register */
  2692. /******************************************************************************/
  2693. /* */
  2694. /* System Configuration (SYSCFG) */
  2695. /* */
  2696. /******************************************************************************/
  2697. /***************** Bit definition for SYSCFG_MEMRMP register ****************/
  2698. #define SYSCFG_MEMRMP_MEM_MODE ((uint32_t)0x00000003) /*!< SYSCFG_Memory Remap Config */
  2699. #define SYSCFG_MEMRMP_MEM_MODE_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  2700. #define SYSCFG_MEMRMP_MEM_MODE_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  2701. #define SYSCFG_MEMRMP_BOOT_MODE ((uint32_t)0x00000300) /*!< Boot mode Config */
  2702. #define SYSCFG_MEMRMP_BOOT_MODE_0 ((uint32_t)0x00000100) /*!< Bit 0 */
  2703. #define SYSCFG_MEMRMP_BOOT_MODE_1 ((uint32_t)0x00000200) /*!< Bit 1 */
  2704. /***************** Bit definition for SYSCFG_PMC register *******************/
  2705. #define SYSCFG_PMC_USB_PU ((uint32_t)0x00000001) /*!< SYSCFG PMC */
  2706. /***************** Bit definition for SYSCFG_EXTICR1 register ***************/
  2707. #define SYSCFG_EXTICR1_EXTI0 ((uint32_t)0x0000000F) /*!< EXTI 0 configuration */
  2708. #define SYSCFG_EXTICR1_EXTI1 ((uint32_t)0x000000F0) /*!< EXTI 1 configuration */
  2709. #define SYSCFG_EXTICR1_EXTI2 ((uint32_t)0x00000F00) /*!< EXTI 2 configuration */
  2710. #define SYSCFG_EXTICR1_EXTI3 ((uint32_t)0x0000F000) /*!< EXTI 3 configuration */
  2711. /**
  2712. * @brief EXTI0 configuration
  2713. */
  2714. #define SYSCFG_EXTICR1_EXTI0_PA ((uint32_t)0x00000000) /*!< PA[0] pin */
  2715. #define SYSCFG_EXTICR1_EXTI0_PB ((uint32_t)0x00000001) /*!< PB[0] pin */
  2716. #define SYSCFG_EXTICR1_EXTI0_PC ((uint32_t)0x00000002) /*!< PC[0] pin */
  2717. #define SYSCFG_EXTICR1_EXTI0_PD ((uint32_t)0x00000003) /*!< PD[0] pin */
  2718. #define SYSCFG_EXTICR1_EXTI0_PE ((uint32_t)0x00000004) /*!< PE[0] pin */
  2719. #define SYSCFG_EXTICR1_EXTI0_PH ((uint32_t)0x00000005) /*!< PH[0] pin */
  2720. #define SYSCFG_EXTICR1_EXTI0_PF ((uint32_t)0x00000006) /*!< PF[0] pin */
  2721. #define SYSCFG_EXTICR1_EXTI0_PG ((uint32_t)0x00000007) /*!< PG[0] pin */
  2722. /**
  2723. * @brief EXTI1 configuration
  2724. */
  2725. #define SYSCFG_EXTICR1_EXTI1_PA ((uint32_t)0x00000000) /*!< PA[1] pin */
  2726. #define SYSCFG_EXTICR1_EXTI1_PB ((uint32_t)0x00000010) /*!< PB[1] pin */
  2727. #define SYSCFG_EXTICR1_EXTI1_PC ((uint32_t)0x00000020) /*!< PC[1] pin */
  2728. #define SYSCFG_EXTICR1_EXTI1_PD ((uint32_t)0x00000030) /*!< PD[1] pin */
  2729. #define SYSCFG_EXTICR1_EXTI1_PE ((uint32_t)0x00000040) /*!< PE[1] pin */
  2730. #define SYSCFG_EXTICR1_EXTI1_PH ((uint32_t)0x00000050) /*!< PH[1] pin */
  2731. #define SYSCFG_EXTICR1_EXTI1_PF ((uint32_t)0x00000060) /*!< PF[1] pin */
  2732. #define SYSCFG_EXTICR1_EXTI1_PG ((uint32_t)0x00000070) /*!< PG[1] pin */
  2733. /**
  2734. * @brief EXTI2 configuration
  2735. */
  2736. #define SYSCFG_EXTICR1_EXTI2_PA ((uint32_t)0x00000000) /*!< PA[2] pin */
  2737. #define SYSCFG_EXTICR1_EXTI2_PB ((uint32_t)0x00000100) /*!< PB[2] pin */
  2738. #define SYSCFG_EXTICR1_EXTI2_PC ((uint32_t)0x00000200) /*!< PC[2] pin */
  2739. #define SYSCFG_EXTICR1_EXTI2_PD ((uint32_t)0x00000300) /*!< PD[2] pin */
  2740. #define SYSCFG_EXTICR1_EXTI2_PE ((uint32_t)0x00000400) /*!< PE[2] pin */
  2741. #define SYSCFG_EXTICR1_EXTI2_PH ((uint32_t)0x00000500) /*!< PH[2] pin */
  2742. #define SYSCFG_EXTICR1_EXTI2_PF ((uint32_t)0x00000600) /*!< PF[2] pin */
  2743. #define SYSCFG_EXTICR1_EXTI2_PG ((uint32_t)0x00000700) /*!< PG[2] pin */
  2744. /**
  2745. * @brief EXTI3 configuration
  2746. */
  2747. #define SYSCFG_EXTICR1_EXTI3_PA ((uint32_t)0x00000000) /*!< PA[3] pin */
  2748. #define SYSCFG_EXTICR1_EXTI3_PB ((uint32_t)0x00001000) /*!< PB[3] pin */
  2749. #define SYSCFG_EXTICR1_EXTI3_PC ((uint32_t)0x00002000) /*!< PC[3] pin */
  2750. #define SYSCFG_EXTICR1_EXTI3_PD ((uint32_t)0x00003000) /*!< PD[3] pin */
  2751. #define SYSCFG_EXTICR1_EXTI3_PE ((uint32_t)0x00004000) /*!< PE[3] pin */
  2752. #define SYSCFG_EXTICR1_EXTI3_PF ((uint32_t)0x00003000) /*!< PF[3] pin */
  2753. #define SYSCFG_EXTICR1_EXTI3_PG ((uint32_t)0x00004000) /*!< PG[3] pin */
  2754. /***************** Bit definition for SYSCFG_EXTICR2 register *****************/
  2755. #define SYSCFG_EXTICR2_EXTI4 ((uint32_t)0x0000000F) /*!< EXTI 4 configuration */
  2756. #define SYSCFG_EXTICR2_EXTI5 ((uint32_t)0x000000F0) /*!< EXTI 5 configuration */
  2757. #define SYSCFG_EXTICR2_EXTI6 ((uint32_t)0x00000F00) /*!< EXTI 6 configuration */
  2758. #define SYSCFG_EXTICR2_EXTI7 ((uint32_t)0x0000F000) /*!< EXTI 7 configuration */
  2759. /**
  2760. * @brief EXTI4 configuration
  2761. */
  2762. #define SYSCFG_EXTICR2_EXTI4_PA ((uint32_t)0x00000000) /*!< PA[4] pin */
  2763. #define SYSCFG_EXTICR2_EXTI4_PB ((uint32_t)0x00000001) /*!< PB[4] pin */
  2764. #define SYSCFG_EXTICR2_EXTI4_PC ((uint32_t)0x00000002) /*!< PC[4] pin */
  2765. #define SYSCFG_EXTICR2_EXTI4_PD ((uint32_t)0x00000003) /*!< PD[4] pin */
  2766. #define SYSCFG_EXTICR2_EXTI4_PE ((uint32_t)0x00000004) /*!< PE[4] pin */
  2767. #define SYSCFG_EXTICR2_EXTI4_PF ((uint32_t)0x00000006) /*!< PF[4] pin */
  2768. #define SYSCFG_EXTICR2_EXTI4_PG ((uint32_t)0x00000007) /*!< PG[4] pin */
  2769. /**
  2770. * @brief EXTI5 configuration
  2771. */
  2772. #define SYSCFG_EXTICR2_EXTI5_PA ((uint32_t)0x00000000) /*!< PA[5] pin */
  2773. #define SYSCFG_EXTICR2_EXTI5_PB ((uint32_t)0x00000010) /*!< PB[5] pin */
  2774. #define SYSCFG_EXTICR2_EXTI5_PC ((uint32_t)0x00000020) /*!< PC[5] pin */
  2775. #define SYSCFG_EXTICR2_EXTI5_PD ((uint32_t)0x00000030) /*!< PD[5] pin */
  2776. #define SYSCFG_EXTICR2_EXTI5_PE ((uint32_t)0x00000040) /*!< PE[5] pin */
  2777. #define SYSCFG_EXTICR2_EXTI5_PF ((uint32_t)0x00000060) /*!< PF[5] pin */
  2778. #define SYSCFG_EXTICR2_EXTI5_PG ((uint32_t)0x00000070) /*!< PG[5] pin */
  2779. /**
  2780. * @brief EXTI6 configuration
  2781. */
  2782. #define SYSCFG_EXTICR2_EXTI6_PA ((uint32_t)0x00000000) /*!< PA[6] pin */
  2783. #define SYSCFG_EXTICR2_EXTI6_PB ((uint32_t)0x00000100) /*!< PB[6] pin */
  2784. #define SYSCFG_EXTICR2_EXTI6_PC ((uint32_t)0x00000200) /*!< PC[6] pin */
  2785. #define SYSCFG_EXTICR2_EXTI6_PD ((uint32_t)0x00000300) /*!< PD[6] pin */
  2786. #define SYSCFG_EXTICR2_EXTI6_PE ((uint32_t)0x00000400) /*!< PE[6] pin */
  2787. #define SYSCFG_EXTICR2_EXTI6_PF ((uint32_t)0x00000600) /*!< PF[6] pin */
  2788. #define SYSCFG_EXTICR2_EXTI6_PG ((uint32_t)0x00000700) /*!< PG[6] pin */
  2789. /**
  2790. * @brief EXTI7 configuration
  2791. */
  2792. #define SYSCFG_EXTICR2_EXTI7_PA ((uint32_t)0x00000000) /*!< PA[7] pin */
  2793. #define SYSCFG_EXTICR2_EXTI7_PB ((uint32_t)0x00001000) /*!< PB[7] pin */
  2794. #define SYSCFG_EXTICR2_EXTI7_PC ((uint32_t)0x00002000) /*!< PC[7] pin */
  2795. #define SYSCFG_EXTICR2_EXTI7_PD ((uint32_t)0x00003000) /*!< PD[7] pin */
  2796. #define SYSCFG_EXTICR2_EXTI7_PE ((uint32_t)0x00004000) /*!< PE[7] pin */
  2797. #define SYSCFG_EXTICR2_EXTI7_PF ((uint32_t)0x00006000) /*!< PF[7] pin */
  2798. #define SYSCFG_EXTICR2_EXTI7_PG ((uint32_t)0x00007000) /*!< PG[7] pin */
  2799. /***************** Bit definition for SYSCFG_EXTICR3 register *****************/
  2800. #define SYSCFG_EXTICR3_EXTI8 ((uint32_t)0x0000000F) /*!< EXTI 8 configuration */
  2801. #define SYSCFG_EXTICR3_EXTI9 ((uint32_t)0x000000F0) /*!< EXTI 9 configuration */
  2802. #define SYSCFG_EXTICR3_EXTI10 ((uint32_t)0x00000F00) /*!< EXTI 10 configuration */
  2803. #define SYSCFG_EXTICR3_EXTI11 ((uint32_t)0x0000F000) /*!< EXTI 11 configuration */
  2804. /**
  2805. * @brief EXTI8 configuration
  2806. */
  2807. #define SYSCFG_EXTICR3_EXTI8_PA ((uint32_t)0x00000000) /*!< PA[8] pin */
  2808. #define SYSCFG_EXTICR3_EXTI8_PB ((uint32_t)0x00000001) /*!< PB[8] pin */
  2809. #define SYSCFG_EXTICR3_EXTI8_PC ((uint32_t)0x00000002) /*!< PC[8] pin */
  2810. #define SYSCFG_EXTICR3_EXTI8_PD ((uint32_t)0x00000003) /*!< PD[8] pin */
  2811. #define SYSCFG_EXTICR3_EXTI8_PE ((uint32_t)0x00000004) /*!< PE[8] pin */
  2812. #define SYSCFG_EXTICR3_EXTI8_PF ((uint32_t)0x00000006) /*!< PF[8] pin */
  2813. #define SYSCFG_EXTICR3_EXTI8_PG ((uint32_t)0x00000007) /*!< PG[8] pin */
  2814. /**
  2815. * @brief EXTI9 configuration
  2816. */
  2817. #define SYSCFG_EXTICR3_EXTI9_PA ((uint32_t)0x00000000) /*!< PA[9] pin */
  2818. #define SYSCFG_EXTICR3_EXTI9_PB ((uint32_t)0x00000010) /*!< PB[9] pin */
  2819. #define SYSCFG_EXTICR3_EXTI9_PC ((uint32_t)0x00000020) /*!< PC[9] pin */
  2820. #define SYSCFG_EXTICR3_EXTI9_PD ((uint32_t)0x00000030) /*!< PD[9] pin */
  2821. #define SYSCFG_EXTICR3_EXTI9_PE ((uint32_t)0x00000040) /*!< PE[9] pin */
  2822. #define SYSCFG_EXTICR3_EXTI9_PF ((uint32_t)0x00000060) /*!< PF[9] pin */
  2823. #define SYSCFG_EXTICR3_EXTI9_PG ((uint32_t)0x00000070) /*!< PG[9] pin */
  2824. /**
  2825. * @brief EXTI10 configuration
  2826. */
  2827. #define SYSCFG_EXTICR3_EXTI10_PA ((uint32_t)0x00000000) /*!< PA[10] pin */
  2828. #define SYSCFG_EXTICR3_EXTI10_PB ((uint32_t)0x00000100) /*!< PB[10] pin */
  2829. #define SYSCFG_EXTICR3_EXTI10_PC ((uint32_t)0x00000200) /*!< PC[10] pin */
  2830. #define SYSCFG_EXTICR3_EXTI10_PD ((uint32_t)0x00000300) /*!< PD[10] pin */
  2831. #define SYSCFG_EXTICR3_EXTI10_PE ((uint32_t)0x00000400) /*!< PE[10] pin */
  2832. #define SYSCFG_EXTICR3_EXTI10_PF ((uint32_t)0x00000600) /*!< PF[10] pin */
  2833. #define SYSCFG_EXTICR3_EXTI10_PG ((uint32_t)0x00000700) /*!< PG[10] pin */
  2834. /**
  2835. * @brief EXTI11 configuration
  2836. */
  2837. #define SYSCFG_EXTICR3_EXTI11_PA ((uint32_t)0x00000000) /*!< PA[11] pin */
  2838. #define SYSCFG_EXTICR3_EXTI11_PB ((uint32_t)0x00001000) /*!< PB[11] pin */
  2839. #define SYSCFG_EXTICR3_EXTI11_PC ((uint32_t)0x00002000) /*!< PC[11] pin */
  2840. #define SYSCFG_EXTICR3_EXTI11_PD ((uint32_t)0x00003000) /*!< PD[11] pin */
  2841. #define SYSCFG_EXTICR3_EXTI11_PE ((uint32_t)0x00004000) /*!< PE[11] pin */
  2842. #define SYSCFG_EXTICR3_EXTI11_PF ((uint32_t)0x00006000) /*!< PF[11] pin */
  2843. #define SYSCFG_EXTICR3_EXTI11_PG ((uint32_t)0x00007000) /*!< PG[11] pin */
  2844. /***************** Bit definition for SYSCFG_EXTICR4 register *****************/
  2845. #define SYSCFG_EXTICR4_EXTI12 ((uint32_t)0x0000000F) /*!< EXTI 12 configuration */
  2846. #define SYSCFG_EXTICR4_EXTI13 ((uint32_t)0x000000F0) /*!< EXTI 13 configuration */
  2847. #define SYSCFG_EXTICR4_EXTI14 ((uint32_t)0x00000F00) /*!< EXTI 14 configuration */
  2848. #define SYSCFG_EXTICR4_EXTI15 ((uint32_t)0x0000F000) /*!< EXTI 15 configuration */
  2849. /**
  2850. * @brief EXTI12 configuration
  2851. */
  2852. #define SYSCFG_EXTICR4_EXTI12_PA ((uint32_t)0x00000000) /*!< PA[12] pin */
  2853. #define SYSCFG_EXTICR4_EXTI12_PB ((uint32_t)0x00000001) /*!< PB[12] pin */
  2854. #define SYSCFG_EXTICR4_EXTI12_PC ((uint32_t)0x00000002) /*!< PC[12] pin */
  2855. #define SYSCFG_EXTICR4_EXTI12_PD ((uint32_t)0x00000003) /*!< PD[12] pin */
  2856. #define SYSCFG_EXTICR4_EXTI12_PE ((uint32_t)0x00000004) /*!< PE[12] pin */
  2857. #define SYSCFG_EXTICR4_EXTI12_PF ((uint32_t)0x00000006) /*!< PF[12] pin */
  2858. #define SYSCFG_EXTICR4_EXTI12_PG ((uint32_t)0x00000007) /*!< PG[12] pin */
  2859. /**
  2860. * @brief EXTI13 configuration
  2861. */
  2862. #define SYSCFG_EXTICR4_EXTI13_PA ((uint32_t)0x00000000) /*!< PA[13] pin */
  2863. #define SYSCFG_EXTICR4_EXTI13_PB ((uint32_t)0x00000010) /*!< PB[13] pin */
  2864. #define SYSCFG_EXTICR4_EXTI13_PC ((uint32_t)0x00000020) /*!< PC[13] pin */
  2865. #define SYSCFG_EXTICR4_EXTI13_PD ((uint32_t)0x00000030) /*!< PD[13] pin */
  2866. #define SYSCFG_EXTICR4_EXTI13_PE ((uint32_t)0x00000040) /*!< PE[13] pin */
  2867. #define SYSCFG_EXTICR4_EXTI13_PF ((uint32_t)0x00000060) /*!< PF[13] pin */
  2868. #define SYSCFG_EXTICR4_EXTI13_PG ((uint32_t)0x00000070) /*!< PG[13] pin */
  2869. /**
  2870. * @brief EXTI14 configuration
  2871. */
  2872. #define SYSCFG_EXTICR4_EXTI14_PA ((uint32_t)0x00000000) /*!< PA[14] pin */
  2873. #define SYSCFG_EXTICR4_EXTI14_PB ((uint32_t)0x00000100) /*!< PB[14] pin */
  2874. #define SYSCFG_EXTICR4_EXTI14_PC ((uint32_t)0x00000200) /*!< PC[14] pin */
  2875. #define SYSCFG_EXTICR4_EXTI14_PD ((uint32_t)0x00000300) /*!< PD[14] pin */
  2876. #define SYSCFG_EXTICR4_EXTI14_PE ((uint32_t)0x00000400) /*!< PE[14] pin */
  2877. #define SYSCFG_EXTICR4_EXTI14_PF ((uint32_t)0x00000600) /*!< PF[14] pin */
  2878. #define SYSCFG_EXTICR4_EXTI14_PG ((uint32_t)0x00000700) /*!< PG[14] pin */
  2879. /**
  2880. * @brief EXTI15 configuration
  2881. */
  2882. #define SYSCFG_EXTICR4_EXTI15_PA ((uint32_t)0x00000000) /*!< PA[15] pin */
  2883. #define SYSCFG_EXTICR4_EXTI15_PB ((uint32_t)0x00001000) /*!< PB[15] pin */
  2884. #define SYSCFG_EXTICR4_EXTI15_PC ((uint32_t)0x00002000) /*!< PC[15] pin */
  2885. #define SYSCFG_EXTICR4_EXTI15_PD ((uint32_t)0x00003000) /*!< PD[15] pin */
  2886. #define SYSCFG_EXTICR4_EXTI15_PE ((uint32_t)0x00004000) /*!< PE[15] pin */
  2887. #define SYSCFG_EXTICR4_EXTI15_PF ((uint32_t)0x00006000) /*!< PF[15] pin */
  2888. #define SYSCFG_EXTICR4_EXTI15_PG ((uint32_t)0x00007000) /*!< PG[15] pin */
  2889. /******************************************************************************/
  2890. /* */
  2891. /* Routing Interface (RI) */
  2892. /* */
  2893. /******************************************************************************/
  2894. /******************** Bit definition for RI_ICR register ********************/
  2895. #define RI_ICR_IC1OS ((uint32_t)0x0000000F) /*!< IC1OS[3:0] bits (Input Capture 1 select bits) */
  2896. #define RI_ICR_IC1OS_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  2897. #define RI_ICR_IC1OS_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  2898. #define RI_ICR_IC1OS_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  2899. #define RI_ICR_IC1OS_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  2900. #define RI_ICR_IC2OS ((uint32_t)0x000000F0) /*!< IC2OS[3:0] bits (Input Capture 2 select bits) */
  2901. #define RI_ICR_IC2OS_0 ((uint32_t)0x00000010) /*!< Bit 0 */
  2902. #define RI_ICR_IC2OS_1 ((uint32_t)0x00000020) /*!< Bit 1 */
  2903. #define RI_ICR_IC2OS_2 ((uint32_t)0x00000040) /*!< Bit 2 */
  2904. #define RI_ICR_IC2OS_3 ((uint32_t)0x00000080) /*!< Bit 3 */
  2905. #define RI_ICR_IC3OS ((uint32_t)0x00000F00) /*!< IC3OS[3:0] bits (Input Capture 3 select bits) */
  2906. #define RI_ICR_IC3OS_0 ((uint32_t)0x00000100) /*!< Bit 0 */
  2907. #define RI_ICR_IC3OS_1 ((uint32_t)0x00000200) /*!< Bit 1 */
  2908. #define RI_ICR_IC3OS_2 ((uint32_t)0x00000400) /*!< Bit 2 */
  2909. #define RI_ICR_IC3OS_3 ((uint32_t)0x00000800) /*!< Bit 3 */
  2910. #define RI_ICR_IC4OS ((uint32_t)0x0000F000) /*!< IC4OS[3:0] bits (Input Capture 4 select bits) */
  2911. #define RI_ICR_IC4OS_0 ((uint32_t)0x00001000) /*!< Bit 0 */
  2912. #define RI_ICR_IC4OS_1 ((uint32_t)0x00002000) /*!< Bit 1 */
  2913. #define RI_ICR_IC4OS_2 ((uint32_t)0x00004000) /*!< Bit 2 */
  2914. #define RI_ICR_IC4OS_3 ((uint32_t)0x00008000) /*!< Bit 3 */
  2915. #define RI_ICR_TIM ((uint32_t)0x00030000) /*!< TIM[3:0] bits (Timers select bits) */
  2916. #define RI_ICR_TIM_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  2917. #define RI_ICR_TIM_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  2918. #define RI_ICR_IC1 ((uint32_t)0x00040000) /*!< Input capture 1 */
  2919. #define RI_ICR_IC2 ((uint32_t)0x00080000) /*!< Input capture 2 */
  2920. #define RI_ICR_IC3 ((uint32_t)0x00100000) /*!< Input capture 3 */
  2921. #define RI_ICR_IC4 ((uint32_t)0x00200000) /*!< Input capture 4 */
  2922. /******************** Bit definition for RI_ASCR1 register ********************/
  2923. #define RI_ASCR1_CH ((uint32_t)0x03FCFFFF) /*!< AS_CH[25:18] & AS_CH[15:0] bits ( Analog switches selection bits) */
  2924. #define RI_ASCR1_CH_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  2925. #define RI_ASCR1_CH_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  2926. #define RI_ASCR1_CH_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  2927. #define RI_ASCR1_CH_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  2928. #define RI_ASCR1_CH_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  2929. #define RI_ASCR1_CH_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  2930. #define RI_ASCR1_CH_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  2931. #define RI_ASCR1_CH_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  2932. #define RI_ASCR1_CH_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  2933. #define RI_ASCR1_CH_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  2934. #define RI_ASCR1_CH_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  2935. #define RI_ASCR1_CH_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  2936. #define RI_ASCR1_CH_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  2937. #define RI_ASCR1_CH_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  2938. #define RI_ASCR1_CH_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  2939. #define RI_ASCR1_CH_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  2940. #define RI_ASCR1_CH_18 ((uint32_t)0x00040000) /*!< Bit 18 */
  2941. #define RI_ASCR1_CH_19 ((uint32_t)0x00080000) /*!< Bit 19 */
  2942. #define RI_ASCR1_CH_20 ((uint32_t)0x00100000) /*!< Bit 20 */
  2943. #define RI_ASCR1_CH_21 ((uint32_t)0x00200000) /*!< Bit 21 */
  2944. #define RI_ASCR1_CH_22 ((uint32_t)0x00400000) /*!< Bit 22 */
  2945. #define RI_ASCR1_CH_23 ((uint32_t)0x00800000) /*!< Bit 23 */
  2946. #define RI_ASCR1_CH_24 ((uint32_t)0x01000000) /*!< Bit 24 */
  2947. #define RI_ASCR1_CH_25 ((uint32_t)0x02000000) /*!< Bit 25 */
  2948. #define RI_ASCR1_VCOMP ((uint32_t)0x04000000) /*!< ADC analog switch selection for internal node to COMP1 */
  2949. #define RI_ASCR1_SCM ((uint32_t)0x80000000) /*!< I/O Switch control mode */
  2950. /******************** Bit definition for RI_ASCR2 register ********************/
  2951. #define RI_ASCR2_GR10_1 ((uint32_t)0x00000001) /*!< GR10-1 selection bit */
  2952. #define RI_ASCR2_GR10_2 ((uint32_t)0x00000002) /*!< GR10-2 selection bit */
  2953. #define RI_ASCR2_GR10_3 ((uint32_t)0x00000004) /*!< GR10-3 selection bit */
  2954. #define RI_ASCR2_GR10_4 ((uint32_t)0x00000008) /*!< GR10-4 selection bit */
  2955. #define RI_ASCR2_GR6_1 ((uint32_t)0x00000010) /*!< GR6-1 selection bit */
  2956. #define RI_ASCR2_GR6_2 ((uint32_t)0x00000020) /*!< GR6-2 selection bit */
  2957. #define RI_ASCR2_GR5_1 ((uint32_t)0x00000040) /*!< GR5-1 selection bit */
  2958. #define RI_ASCR2_GR5_2 ((uint32_t)0x00000080) /*!< GR5-2 selection bit */
  2959. #define RI_ASCR2_GR5_3 ((uint32_t)0x00000100) /*!< GR5-3 selection bit */
  2960. #define RI_ASCR2_GR4_1 ((uint32_t)0x00000200) /*!< GR4-1 selection bit */
  2961. #define RI_ASCR2_GR4_2 ((uint32_t)0x00000400) /*!< GR4-2 selection bit */
  2962. #define RI_ASCR2_GR4_3 ((uint32_t)0x00000800) /*!< GR4-3 selection bit */
  2963. #define RI_ASCR2_GR4_4 ((uint32_t)0x00008000) /*!< GR4-4 selection bit */
  2964. /******************** Bit definition for RI_HYSCR1 register ********************/
  2965. #define RI_HYSCR1_PA ((uint32_t)0x0000FFFF) /*!< PA[15:0] Port A Hysteresis selection */
  2966. #define RI_HYSCR1_PA_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  2967. #define RI_HYSCR1_PA_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  2968. #define RI_HYSCR1_PA_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  2969. #define RI_HYSCR1_PA_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  2970. #define RI_HYSCR1_PA_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  2971. #define RI_HYSCR1_PA_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  2972. #define RI_HYSCR1_PA_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  2973. #define RI_HYSCR1_PA_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  2974. #define RI_HYSCR1_PA_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  2975. #define RI_HYSCR1_PA_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  2976. #define RI_HYSCR1_PA_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  2977. #define RI_HYSCR1_PA_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  2978. #define RI_HYSCR1_PA_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  2979. #define RI_HYSCR1_PA_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  2980. #define RI_HYSCR1_PA_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  2981. #define RI_HYSCR1_PA_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  2982. #define RI_HYSCR1_PB ((uint32_t)0xFFFF0000) /*!< PB[15:0] Port B Hysteresis selection */
  2983. #define RI_HYSCR1_PB_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  2984. #define RI_HYSCR1_PB_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  2985. #define RI_HYSCR1_PB_2 ((uint32_t)0x00040000) /*!< Bit 2 */
  2986. #define RI_HYSCR1_PB_3 ((uint32_t)0x00080000) /*!< Bit 3 */
  2987. #define RI_HYSCR1_PB_4 ((uint32_t)0x00100000) /*!< Bit 4 */
  2988. #define RI_HYSCR1_PB_5 ((uint32_t)0x00200000) /*!< Bit 5 */
  2989. #define RI_HYSCR1_PB_6 ((uint32_t)0x00400000) /*!< Bit 6 */
  2990. #define RI_HYSCR1_PB_7 ((uint32_t)0x00800000) /*!< Bit 7 */
  2991. #define RI_HYSCR1_PB_8 ((uint32_t)0x01000000) /*!< Bit 8 */
  2992. #define RI_HYSCR1_PB_9 ((uint32_t)0x02000000) /*!< Bit 9 */
  2993. #define RI_HYSCR1_PB_10 ((uint32_t)0x04000000) /*!< Bit 10 */
  2994. #define RI_HYSCR1_PB_11 ((uint32_t)0x08000000) /*!< Bit 11 */
  2995. #define RI_HYSCR1_PB_12 ((uint32_t)0x10000000) /*!< Bit 12 */
  2996. #define RI_HYSCR1_PB_13 ((uint32_t)0x20000000) /*!< Bit 13 */
  2997. #define RI_HYSCR1_PB_14 ((uint32_t)0x40000000) /*!< Bit 14 */
  2998. #define RI_HYSCR1_PB_15 ((uint32_t)0x80000000) /*!< Bit 15 */
  2999. /******************** Bit definition for RI_HYSCR2 register ********************/
  3000. #define RI_HYSCR2_PC ((uint32_t)0x0000FFFF) /*!< PC[15:0] Port C Hysteresis selection */
  3001. #define RI_HYSCR2_PC_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3002. #define RI_HYSCR2_PC_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3003. #define RI_HYSCR2_PC_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3004. #define RI_HYSCR2_PC_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3005. #define RI_HYSCR2_PC_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3006. #define RI_HYSCR2_PC_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3007. #define RI_HYSCR2_PC_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3008. #define RI_HYSCR2_PC_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3009. #define RI_HYSCR2_PC_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3010. #define RI_HYSCR2_PC_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3011. #define RI_HYSCR2_PC_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3012. #define RI_HYSCR2_PC_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3013. #define RI_HYSCR2_PC_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3014. #define RI_HYSCR2_PC_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3015. #define RI_HYSCR2_PC_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3016. #define RI_HYSCR2_PC_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3017. #define RI_HYSCR2_PD ((uint32_t)0xFFFF0000) /*!< PD[15:0] Port D Hysteresis selection */
  3018. #define RI_HYSCR2_PD_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  3019. #define RI_HYSCR2_PD_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  3020. #define RI_HYSCR2_PD_2 ((uint32_t)0x00040000) /*!< Bit 2 */
  3021. #define RI_HYSCR2_PD_3 ((uint32_t)0x00080000) /*!< Bit 3 */
  3022. #define RI_HYSCR2_PD_4 ((uint32_t)0x00100000) /*!< Bit 4 */
  3023. #define RI_HYSCR2_PD_5 ((uint32_t)0x00200000) /*!< Bit 5 */
  3024. #define RI_HYSCR2_PD_6 ((uint32_t)0x00400000) /*!< Bit 6 */
  3025. #define RI_HYSCR2_PD_7 ((uint32_t)0x00800000) /*!< Bit 7 */
  3026. #define RI_HYSCR2_PD_8 ((uint32_t)0x01000000) /*!< Bit 8 */
  3027. #define RI_HYSCR2_PD_9 ((uint32_t)0x02000000) /*!< Bit 9 */
  3028. #define RI_HYSCR2_PD_10 ((uint32_t)0x04000000) /*!< Bit 10 */
  3029. #define RI_HYSCR2_PD_11 ((uint32_t)0x08000000) /*!< Bit 11 */
  3030. #define RI_HYSCR2_PD_12 ((uint32_t)0x10000000) /*!< Bit 12 */
  3031. #define RI_HYSCR2_PD_13 ((uint32_t)0x20000000) /*!< Bit 13 */
  3032. #define RI_HYSCR2_PD_14 ((uint32_t)0x40000000) /*!< Bit 14 */
  3033. #define RI_HYSCR2_PD_15 ((uint32_t)0x80000000) /*!< Bit 15 */
  3034. /******************************************************************************/
  3035. /* */
  3036. /* Timers (TIM) */
  3037. /* */
  3038. /******************************************************************************/
  3039. /******************* Bit definition for TIM_CR1 register ********************/
  3040. #define TIM_CR1_CEN ((uint32_t)0x00000001) /*!<Counter enable */
  3041. #define TIM_CR1_UDIS ((uint32_t)0x00000002) /*!<Update disable */
  3042. #define TIM_CR1_URS ((uint32_t)0x00000004) /*!<Update request source */
  3043. #define TIM_CR1_OPM ((uint32_t)0x00000008) /*!<One pulse mode */
  3044. #define TIM_CR1_DIR ((uint32_t)0x00000010) /*!<Direction */
  3045. #define TIM_CR1_CMS ((uint32_t)0x00000060) /*!<CMS[1:0] bits (Center-aligned mode selection) */
  3046. #define TIM_CR1_CMS_0 ((uint32_t)0x00000020) /*!<Bit 0 */
  3047. #define TIM_CR1_CMS_1 ((uint32_t)0x00000040) /*!<Bit 1 */
  3048. #define TIM_CR1_ARPE ((uint32_t)0x00000080) /*!<Auto-reload preload enable */
  3049. #define TIM_CR1_CKD ((uint32_t)0x00000300) /*!<CKD[1:0] bits (clock division) */
  3050. #define TIM_CR1_CKD_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3051. #define TIM_CR1_CKD_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3052. /******************* Bit definition for TIM_CR2 register ********************/
  3053. #define TIM_CR2_CCDS ((uint32_t)0x00000008) /*!<Capture/Compare DMA Selection */
  3054. #define TIM_CR2_MMS ((uint32_t)0x00000070) /*!<MMS[2:0] bits (Master Mode Selection) */
  3055. #define TIM_CR2_MMS_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3056. #define TIM_CR2_MMS_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3057. #define TIM_CR2_MMS_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3058. #define TIM_CR2_TI1S ((uint32_t)0x00000080) /*!<TI1 Selection */
  3059. /******************* Bit definition for TIM_SMCR register *******************/
  3060. #define TIM_SMCR_SMS ((uint32_t)0x00000007) /*!<SMS[2:0] bits (Slave mode selection) */
  3061. #define TIM_SMCR_SMS_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3062. #define TIM_SMCR_SMS_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3063. #define TIM_SMCR_SMS_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3064. #define TIM_SMCR_OCCS ((uint32_t)0x00000008) /*!< OCREF clear selection */
  3065. #define TIM_SMCR_TS ((uint32_t)0x00000070) /*!<TS[2:0] bits (Trigger selection) */
  3066. #define TIM_SMCR_TS_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3067. #define TIM_SMCR_TS_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3068. #define TIM_SMCR_TS_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3069. #define TIM_SMCR_MSM ((uint32_t)0x00000080) /*!<Master/slave mode */
  3070. #define TIM_SMCR_ETF ((uint32_t)0x00000F00) /*!<ETF[3:0] bits (External trigger filter) */
  3071. #define TIM_SMCR_ETF_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3072. #define TIM_SMCR_ETF_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3073. #define TIM_SMCR_ETF_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3074. #define TIM_SMCR_ETF_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3075. #define TIM_SMCR_ETPS ((uint32_t)0x00003000) /*!<ETPS[1:0] bits (External trigger prescaler) */
  3076. #define TIM_SMCR_ETPS_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  3077. #define TIM_SMCR_ETPS_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  3078. #define TIM_SMCR_ECE ((uint32_t)0x00004000) /*!<External clock enable */
  3079. #define TIM_SMCR_ETP ((uint32_t)0x00008000) /*!<External trigger polarity */
  3080. /******************* Bit definition for TIM_DIER register *******************/
  3081. #define TIM_DIER_UIE ((uint32_t)0x00000001) /*!<Update interrupt enable */
  3082. #define TIM_DIER_CC1IE ((uint32_t)0x00000002) /*!<Capture/Compare 1 interrupt enable */
  3083. #define TIM_DIER_CC2IE ((uint32_t)0x00000004) /*!<Capture/Compare 2 interrupt enable */
  3084. #define TIM_DIER_CC3IE ((uint32_t)0x00000008) /*!<Capture/Compare 3 interrupt enable */
  3085. #define TIM_DIER_CC4IE ((uint32_t)0x00000010) /*!<Capture/Compare 4 interrupt enable */
  3086. #define TIM_DIER_TIE ((uint32_t)0x00000040) /*!<Trigger interrupt enable */
  3087. #define TIM_DIER_UDE ((uint32_t)0x00000100) /*!<Update DMA request enable */
  3088. #define TIM_DIER_CC1DE ((uint32_t)0x00000200) /*!<Capture/Compare 1 DMA request enable */
  3089. #define TIM_DIER_CC2DE ((uint32_t)0x00000400) /*!<Capture/Compare 2 DMA request enable */
  3090. #define TIM_DIER_CC3DE ((uint32_t)0x00000800) /*!<Capture/Compare 3 DMA request enable */
  3091. #define TIM_DIER_CC4DE ((uint32_t)0x00001000) /*!<Capture/Compare 4 DMA request enable */
  3092. #define TIM_DIER_COMDE ((uint16_t)0x2000) /*!<COM DMA request enable */
  3093. #define TIM_DIER_TDE ((uint32_t)0x00004000) /*!<Trigger DMA request enable */
  3094. /******************** Bit definition for TIM_SR register ********************/
  3095. #define TIM_SR_UIF ((uint32_t)0x00000001) /*!<Update interrupt Flag */
  3096. #define TIM_SR_CC1IF ((uint32_t)0x00000002) /*!<Capture/Compare 1 interrupt Flag */
  3097. #define TIM_SR_CC2IF ((uint32_t)0x00000004) /*!<Capture/Compare 2 interrupt Flag */
  3098. #define TIM_SR_CC3IF ((uint32_t)0x00000008) /*!<Capture/Compare 3 interrupt Flag */
  3099. #define TIM_SR_CC4IF ((uint32_t)0x00000010) /*!<Capture/Compare 4 interrupt Flag */
  3100. #define TIM_SR_TIF ((uint32_t)0x00000040) /*!<Trigger interrupt Flag */
  3101. #define TIM_SR_CC1OF ((uint32_t)0x00000200) /*!<Capture/Compare 1 Overcapture Flag */
  3102. #define TIM_SR_CC2OF ((uint32_t)0x00000400) /*!<Capture/Compare 2 Overcapture Flag */
  3103. #define TIM_SR_CC3OF ((uint32_t)0x00000800) /*!<Capture/Compare 3 Overcapture Flag */
  3104. #define TIM_SR_CC4OF ((uint32_t)0x00001000) /*!<Capture/Compare 4 Overcapture Flag */
  3105. /******************* Bit definition for TIM_EGR register ********************/
  3106. #define TIM_EGR_UG ((uint32_t)0x00000001) /*!<Update Generation */
  3107. #define TIM_EGR_CC1G ((uint32_t)0x00000002) /*!<Capture/Compare 1 Generation */
  3108. #define TIM_EGR_CC2G ((uint32_t)0x00000004) /*!<Capture/Compare 2 Generation */
  3109. #define TIM_EGR_CC3G ((uint32_t)0x00000008) /*!<Capture/Compare 3 Generation */
  3110. #define TIM_EGR_CC4G ((uint32_t)0x00000010) /*!<Capture/Compare 4 Generation */
  3111. #define TIM_EGR_TG ((uint32_t)0x00000040) /*!<Trigger Generation */
  3112. /****************** Bit definition for TIM_CCMR1 register *******************/
  3113. #define TIM_CCMR1_CC1S ((uint32_t)0x00000003) /*!<CC1S[1:0] bits (Capture/Compare 1 Selection) */
  3114. #define TIM_CCMR1_CC1S_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3115. #define TIM_CCMR1_CC1S_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3116. #define TIM_CCMR1_OC1FE ((uint32_t)0x00000004) /*!<Output Compare 1 Fast enable */
  3117. #define TIM_CCMR1_OC1PE ((uint32_t)0x00000008) /*!<Output Compare 1 Preload enable */
  3118. #define TIM_CCMR1_OC1M ((uint32_t)0x00000070) /*!<OC1M[2:0] bits (Output Compare 1 Mode) */
  3119. #define TIM_CCMR1_OC1M_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3120. #define TIM_CCMR1_OC1M_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3121. #define TIM_CCMR1_OC1M_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3122. #define TIM_CCMR1_OC1CE ((uint32_t)0x00000080) /*!<Output Compare 1Clear Enable */
  3123. #define TIM_CCMR1_CC2S ((uint32_t)0x00000300) /*!<CC2S[1:0] bits (Capture/Compare 2 Selection) */
  3124. #define TIM_CCMR1_CC2S_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3125. #define TIM_CCMR1_CC2S_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3126. #define TIM_CCMR1_OC2FE ((uint32_t)0x00000400) /*!<Output Compare 2 Fast enable */
  3127. #define TIM_CCMR1_OC2PE ((uint32_t)0x00000800) /*!<Output Compare 2 Preload enable */
  3128. #define TIM_CCMR1_OC2M ((uint32_t)0x00007000) /*!<OC2M[2:0] bits (Output Compare 2 Mode) */
  3129. #define TIM_CCMR1_OC2M_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  3130. #define TIM_CCMR1_OC2M_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  3131. #define TIM_CCMR1_OC2M_2 ((uint32_t)0x00004000) /*!<Bit 2 */
  3132. #define TIM_CCMR1_OC2CE ((uint32_t)0x00008000) /*!<Output Compare 2 Clear Enable */
  3133. /*----------------------------------------------------------------------------*/
  3134. #define TIM_CCMR1_IC1PSC ((uint32_t)0x0000000C) /*!<IC1PSC[1:0] bits (Input Capture 1 Prescaler) */
  3135. #define TIM_CCMR1_IC1PSC_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  3136. #define TIM_CCMR1_IC1PSC_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  3137. #define TIM_CCMR1_IC1F ((uint32_t)0x000000F0) /*!<IC1F[3:0] bits (Input Capture 1 Filter) */
  3138. #define TIM_CCMR1_IC1F_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3139. #define TIM_CCMR1_IC1F_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3140. #define TIM_CCMR1_IC1F_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3141. #define TIM_CCMR1_IC1F_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  3142. #define TIM_CCMR1_IC2PSC ((uint32_t)0x00000C00) /*!<IC2PSC[1:0] bits (Input Capture 2 Prescaler) */
  3143. #define TIM_CCMR1_IC2PSC_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  3144. #define TIM_CCMR1_IC2PSC_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  3145. #define TIM_CCMR1_IC2F ((uint32_t)0x0000F000) /*!<IC2F[3:0] bits (Input Capture 2 Filter) */
  3146. #define TIM_CCMR1_IC2F_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  3147. #define TIM_CCMR1_IC2F_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  3148. #define TIM_CCMR1_IC2F_2 ((uint32_t)0x00004000) /*!<Bit 2 */
  3149. #define TIM_CCMR1_IC2F_3 ((uint32_t)0x00008000) /*!<Bit 3 */
  3150. /****************** Bit definition for TIM_CCMR2 register *******************/
  3151. #define TIM_CCMR2_CC3S ((uint32_t)0x00000003) /*!<CC3S[1:0] bits (Capture/Compare 3 Selection) */
  3152. #define TIM_CCMR2_CC3S_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3153. #define TIM_CCMR2_CC3S_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3154. #define TIM_CCMR2_OC3FE ((uint32_t)0x00000004) /*!<Output Compare 3 Fast enable */
  3155. #define TIM_CCMR2_OC3PE ((uint32_t)0x00000008) /*!<Output Compare 3 Preload enable */
  3156. #define TIM_CCMR2_OC3M ((uint32_t)0x00000070) /*!<OC3M[2:0] bits (Output Compare 3 Mode) */
  3157. #define TIM_CCMR2_OC3M_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3158. #define TIM_CCMR2_OC3M_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3159. #define TIM_CCMR2_OC3M_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3160. #define TIM_CCMR2_OC3CE ((uint32_t)0x00000080) /*!<Output Compare 3 Clear Enable */
  3161. #define TIM_CCMR2_CC4S ((uint32_t)0x00000300) /*!<CC4S[1:0] bits (Capture/Compare 4 Selection) */
  3162. #define TIM_CCMR2_CC4S_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3163. #define TIM_CCMR2_CC4S_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3164. #define TIM_CCMR2_OC4FE ((uint32_t)0x00000400) /*!<Output Compare 4 Fast enable */
  3165. #define TIM_CCMR2_OC4PE ((uint32_t)0x00000800) /*!<Output Compare 4 Preload enable */
  3166. #define TIM_CCMR2_OC4M ((uint32_t)0x00007000) /*!<OC4M[2:0] bits (Output Compare 4 Mode) */
  3167. #define TIM_CCMR2_OC4M_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  3168. #define TIM_CCMR2_OC4M_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  3169. #define TIM_CCMR2_OC4M_2 ((uint32_t)0x00004000) /*!<Bit 2 */
  3170. #define TIM_CCMR2_OC4CE ((uint32_t)0x00008000) /*!<Output Compare 4 Clear Enable */
  3171. /*----------------------------------------------------------------------------*/
  3172. #define TIM_CCMR2_IC3PSC ((uint32_t)0x0000000C) /*!<IC3PSC[1:0] bits (Input Capture 3 Prescaler) */
  3173. #define TIM_CCMR2_IC3PSC_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  3174. #define TIM_CCMR2_IC3PSC_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  3175. #define TIM_CCMR2_IC3F ((uint32_t)0x000000F0) /*!<IC3F[3:0] bits (Input Capture 3 Filter) */
  3176. #define TIM_CCMR2_IC3F_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3177. #define TIM_CCMR2_IC3F_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3178. #define TIM_CCMR2_IC3F_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3179. #define TIM_CCMR2_IC3F_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  3180. #define TIM_CCMR2_IC4PSC ((uint32_t)0x00000C00) /*!<IC4PSC[1:0] bits (Input Capture 4 Prescaler) */
  3181. #define TIM_CCMR2_IC4PSC_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  3182. #define TIM_CCMR2_IC4PSC_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  3183. #define TIM_CCMR2_IC4F ((uint32_t)0x0000F000) /*!<IC4F[3:0] bits (Input Capture 4 Filter) */
  3184. #define TIM_CCMR2_IC4F_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  3185. #define TIM_CCMR2_IC4F_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  3186. #define TIM_CCMR2_IC4F_2 ((uint32_t)0x00004000) /*!<Bit 2 */
  3187. #define TIM_CCMR2_IC4F_3 ((uint32_t)0x00008000) /*!<Bit 3 */
  3188. /******************* Bit definition for TIM_CCER register *******************/
  3189. #define TIM_CCER_CC1E ((uint32_t)0x00000001) /*!<Capture/Compare 1 output enable */
  3190. #define TIM_CCER_CC1P ((uint32_t)0x00000002) /*!<Capture/Compare 1 output Polarity */
  3191. #define TIM_CCER_CC1NP ((uint32_t)0x00000008) /*!<Capture/Compare 1 Complementary output Polarity */
  3192. #define TIM_CCER_CC2E ((uint32_t)0x00000010) /*!<Capture/Compare 2 output enable */
  3193. #define TIM_CCER_CC2P ((uint32_t)0x00000020) /*!<Capture/Compare 2 output Polarity */
  3194. #define TIM_CCER_CC2NP ((uint32_t)0x00000080) /*!<Capture/Compare 2 Complementary output Polarity */
  3195. #define TIM_CCER_CC3E ((uint32_t)0x00000100) /*!<Capture/Compare 3 output enable */
  3196. #define TIM_CCER_CC3P ((uint32_t)0x00000200) /*!<Capture/Compare 3 output Polarity */
  3197. #define TIM_CCER_CC3NP ((uint32_t)0x00000800) /*!<Capture/Compare 3 Complementary output Polarity */
  3198. #define TIM_CCER_CC4E ((uint32_t)0x00001000) /*!<Capture/Compare 4 output enable */
  3199. #define TIM_CCER_CC4P ((uint32_t)0x00002000) /*!<Capture/Compare 4 output Polarity */
  3200. #define TIM_CCER_CC4NP ((uint32_t)0x00008000) /*!<Capture/Compare 4 Complementary output Polarity */
  3201. /******************* Bit definition for TIM_CNT register ********************/
  3202. #define TIM_CNT_CNT ((uint32_t)0x0000FFFF) /*!<Counter Value */
  3203. /******************* Bit definition for TIM_PSC register ********************/
  3204. #define TIM_PSC_PSC ((uint32_t)0x0000FFFF) /*!<Prescaler Value */
  3205. /******************* Bit definition for TIM_ARR register ********************/
  3206. #define TIM_ARR_ARR ((uint32_t)0x0000FFFF) /*!<actual auto-reload Value */
  3207. /******************* Bit definition for TIM_CCR1 register *******************/
  3208. #define TIM_CCR1_CCR1 ((uint32_t)0x0000FFFF) /*!<Capture/Compare 1 Value */
  3209. /******************* Bit definition for TIM_CCR2 register *******************/
  3210. #define TIM_CCR2_CCR2 ((uint32_t)0x0000FFFF) /*!<Capture/Compare 2 Value */
  3211. /******************* Bit definition for TIM_CCR3 register *******************/
  3212. #define TIM_CCR3_CCR3 ((uint32_t)0x0000FFFF) /*!<Capture/Compare 3 Value */
  3213. /******************* Bit definition for TIM_CCR4 register *******************/
  3214. #define TIM_CCR4_CCR4 ((uint32_t)0x0000FFFF) /*!<Capture/Compare 4 Value */
  3215. /******************* Bit definition for TIM_DCR register ********************/
  3216. #define TIM_DCR_DBA ((uint32_t)0x0000001F) /*!<DBA[4:0] bits (DMA Base Address) */
  3217. #define TIM_DCR_DBA_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3218. #define TIM_DCR_DBA_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3219. #define TIM_DCR_DBA_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3220. #define TIM_DCR_DBA_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3221. #define TIM_DCR_DBA_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  3222. #define TIM_DCR_DBL ((uint32_t)0x00001F00) /*!<DBL[4:0] bits (DMA Burst Length) */
  3223. #define TIM_DCR_DBL_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3224. #define TIM_DCR_DBL_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3225. #define TIM_DCR_DBL_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3226. #define TIM_DCR_DBL_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3227. #define TIM_DCR_DBL_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  3228. /******************* Bit definition for TIM_DMAR register *******************/
  3229. #define TIM_DMAR_DMAB ((uint32_t)0x0000FFFF) /*!<DMA register for burst accesses */
  3230. /******************* Bit definition for TIM_OR register *********************/
  3231. #define TIM_OR_TI1RMP ((uint32_t)0x00000003) /*!<TI1_RMP[1:0] bits (TIM Input 1 remap) */
  3232. #define TIM_OR_TI1RMP_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3233. #define TIM_OR_TI1RMP_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3234. #define TIM_OR_ETR_RMP ((uint32_t)0x00000004) /*!<ETR_RMP bit (TIM10/11 ETR remap)*/
  3235. #define TIM_OR_TI1_RMP_RI ((uint32_t)0x00000008) /*!<TI1_RMP_RI bit (TIM10/11 Input 1 remap for Routing interface) */
  3236. /*----------------------------------------------------------------------------*/
  3237. #define TIM9_OR_ITR1_RMP ((uint32_t)0x00000004) /*!<ITR1_RMP bit (TIM9 Internal trigger 1 remap) */
  3238. /*----------------------------------------------------------------------------*/
  3239. #define TIM2_OR_ITR1_RMP ((uint32_t)0x00000001) /*!<ITR1_RMP bit (TIM2 Internal trigger 1 remap) */
  3240. /*----------------------------------------------------------------------------*/
  3241. #define TIM3_OR_ITR2_RMP ((uint32_t)0x00000001) /*!<ITR2_RMP bit (TIM3 Internal trigger 2 remap) */
  3242. /*----------------------------------------------------------------------------*/
  3243. /******************************************************************************/
  3244. /* */
  3245. /* Universal Synchronous Asynchronous Receiver Transmitter (USART) */
  3246. /* */
  3247. /******************************************************************************/
  3248. /******************* Bit definition for USART_SR register *******************/
  3249. #define USART_SR_PE ((uint32_t)0x00000001) /*!< Parity Error */
  3250. #define USART_SR_FE ((uint32_t)0x00000002) /*!< Framing Error */
  3251. #define USART_SR_NE ((uint32_t)0x00000004) /*!< Noise Error Flag */
  3252. #define USART_SR_ORE ((uint32_t)0x00000008) /*!< OverRun Error */
  3253. #define USART_SR_IDLE ((uint32_t)0x00000010) /*!< IDLE line detected */
  3254. #define USART_SR_RXNE ((uint32_t)0x00000020) /*!< Read Data Register Not Empty */
  3255. #define USART_SR_TC ((uint32_t)0x00000040) /*!< Transmission Complete */
  3256. #define USART_SR_TXE ((uint32_t)0x00000080) /*!< Transmit Data Register Empty */
  3257. #define USART_SR_LBD ((uint32_t)0x00000100) /*!< LIN Break Detection Flag */
  3258. #define USART_SR_CTS ((uint32_t)0x00000200) /*!< CTS Flag */
  3259. /******************* Bit definition for USART_DR register *******************/
  3260. #define USART_DR_DR ((uint32_t)0x000001FF) /*!< Data value */
  3261. /****************** Bit definition for USART_BRR register *******************/
  3262. #define USART_BRR_DIV_FRACTION ((uint32_t)0x0000000F) /*!< Fraction of USARTDIV */
  3263. #define USART_BRR_DIV_MANTISSA ((uint32_t)0x0000FFF0) /*!< Mantissa of USARTDIV */
  3264. /****************** Bit definition for USART_CR1 register *******************/
  3265. #define USART_CR1_SBK ((uint32_t)0x00000001) /*!< Send Break */
  3266. #define USART_CR1_RWU ((uint32_t)0x00000002) /*!< Receiver wakeup */
  3267. #define USART_CR1_RE ((uint32_t)0x00000004) /*!< Receiver Enable */
  3268. #define USART_CR1_TE ((uint32_t)0x00000008) /*!< Transmitter Enable */
  3269. #define USART_CR1_IDLEIE ((uint32_t)0x00000010) /*!< IDLE Interrupt Enable */
  3270. #define USART_CR1_RXNEIE ((uint32_t)0x00000020) /*!< RXNE Interrupt Enable */
  3271. #define USART_CR1_TCIE ((uint32_t)0x00000040) /*!< Transmission Complete Interrupt Enable */
  3272. #define USART_CR1_TXEIE ((uint32_t)0x00000080) /*!< PE Interrupt Enable */
  3273. #define USART_CR1_PEIE ((uint32_t)0x00000100) /*!< PE Interrupt Enable */
  3274. #define USART_CR1_PS ((uint32_t)0x00000200) /*!< Parity Selection */
  3275. #define USART_CR1_PCE ((uint32_t)0x00000400) /*!< Parity Control Enable */
  3276. #define USART_CR1_WAKE ((uint32_t)0x00000800) /*!< Wakeup method */
  3277. #define USART_CR1_M ((uint32_t)0x00001000) /*!< Word length */
  3278. #define USART_CR1_UE ((uint32_t)0x00002000) /*!< USART Enable */
  3279. #define USART_CR1_OVER8 ((uint32_t)0x00008000) /*!< Oversampling by 8-bit mode */
  3280. /****************** Bit definition for USART_CR2 register *******************/
  3281. #define USART_CR2_ADD ((uint32_t)0x0000000F) /*!< Address of the USART node */
  3282. #define USART_CR2_LBDL ((uint32_t)0x00000020) /*!< LIN Break Detection Length */
  3283. #define USART_CR2_LBDIE ((uint32_t)0x00000040) /*!< LIN Break Detection Interrupt Enable */
  3284. #define USART_CR2_LBCL ((uint32_t)0x00000100) /*!< Last Bit Clock pulse */
  3285. #define USART_CR2_CPHA ((uint32_t)0x00000200) /*!< Clock Phase */
  3286. #define USART_CR2_CPOL ((uint32_t)0x00000400) /*!< Clock Polarity */
  3287. #define USART_CR2_CLKEN ((uint32_t)0x00000800) /*!< Clock Enable */
  3288. #define USART_CR2_STOP ((uint32_t)0x00003000) /*!< STOP[1:0] bits (STOP bits) */
  3289. #define USART_CR2_STOP_0 ((uint32_t)0x00001000) /*!< Bit 0 */
  3290. #define USART_CR2_STOP_1 ((uint32_t)0x00002000) /*!< Bit 1 */
  3291. #define USART_CR2_LINEN ((uint32_t)0x00004000) /*!< LIN mode enable */
  3292. /****************** Bit definition for USART_CR3 register *******************/
  3293. #define USART_CR3_EIE ((uint32_t)0x00000001) /*!< Error Interrupt Enable */
  3294. #define USART_CR3_IREN ((uint32_t)0x00000002) /*!< IrDA mode Enable */
  3295. #define USART_CR3_IRLP ((uint32_t)0x00000004) /*!< IrDA Low-Power */
  3296. #define USART_CR3_HDSEL ((uint32_t)0x00000008) /*!< Half-Duplex Selection */
  3297. #define USART_CR3_NACK ((uint32_t)0x00000010) /*!< Smartcard NACK enable */
  3298. #define USART_CR3_SCEN ((uint32_t)0x00000020) /*!< Smartcard mode enable */
  3299. #define USART_CR3_DMAR ((uint32_t)0x00000040) /*!< DMA Enable Receiver */
  3300. #define USART_CR3_DMAT ((uint32_t)0x00000080) /*!< DMA Enable Transmitter */
  3301. #define USART_CR3_RTSE ((uint32_t)0x00000100) /*!< RTS Enable */
  3302. #define USART_CR3_CTSE ((uint32_t)0x00000200) /*!< CTS Enable */
  3303. #define USART_CR3_CTSIE ((uint32_t)0x00000400) /*!< CTS Interrupt Enable */
  3304. #define USART_CR3_ONEBIT ((uint32_t)0x00000800) /*!< One sample bit method enable */
  3305. /****************** Bit definition for USART_GTPR register ******************/
  3306. #define USART_GTPR_PSC ((uint32_t)0x000000FF) /*!< PSC[7:0] bits (Prescaler value) */
  3307. #define USART_GTPR_PSC_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3308. #define USART_GTPR_PSC_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3309. #define USART_GTPR_PSC_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3310. #define USART_GTPR_PSC_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3311. #define USART_GTPR_PSC_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3312. #define USART_GTPR_PSC_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3313. #define USART_GTPR_PSC_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3314. #define USART_GTPR_PSC_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3315. #define USART_GTPR_GT ((uint32_t)0x0000FF00) /*!< Guard time value */
  3316. /******************************************************************************/
  3317. /* */
  3318. /* Universal Serial Bus (USB) */
  3319. /* */
  3320. /******************************************************************************/
  3321. /*!<Endpoint-specific registers */
  3322. #define USB_EP0R USB_BASE /*!< endpoint 0 register address */
  3323. #define USB_EP1R (USB_BASE + 0x00000004) /*!< endpoint 1 register address */
  3324. #define USB_EP2R (USB_BASE + 0x00000008) /*!< endpoint 2 register address */
  3325. #define USB_EP3R (USB_BASE + 0x0000000C) /*!< endpoint 3 register address */
  3326. #define USB_EP4R (USB_BASE + 0x00000010) /*!< endpoint 4 register address */
  3327. #define USB_EP5R (USB_BASE + 0x00000014) /*!< endpoint 5 register address */
  3328. #define USB_EP6R (USB_BASE + 0x00000018) /*!< endpoint 6 register address */
  3329. #define USB_EP7R (USB_BASE + 0x0000001C) /*!< endpoint 7 register address */
  3330. /* bit positions */
  3331. #define USB_EP_CTR_RX ((uint32_t)0x00008000) /*!< EndPoint Correct TRansfer RX */
  3332. #define USB_EP_DTOG_RX ((uint32_t)0x00004000) /*!< EndPoint Data TOGGLE RX */
  3333. #define USB_EPRX_STAT ((uint32_t)0x00003000) /*!< EndPoint RX STATus bit field */
  3334. #define USB_EP_SETUP ((uint32_t)0x00000800) /*!< EndPoint SETUP */
  3335. #define USB_EP_T_FIELD ((uint32_t)0x00000600) /*!< EndPoint TYPE */
  3336. #define USB_EP_KIND ((uint32_t)0x00000100) /*!< EndPoint KIND */
  3337. #define USB_EP_CTR_TX ((uint32_t)0x00000080) /*!< EndPoint Correct TRansfer TX */
  3338. #define USB_EP_DTOG_TX ((uint32_t)0x00000040) /*!< EndPoint Data TOGGLE TX */
  3339. #define USB_EPTX_STAT ((uint32_t)0x00000030) /*!< EndPoint TX STATus bit field */
  3340. #define USB_EPADDR_FIELD ((uint32_t)0x0000000F) /*!< EndPoint ADDRess FIELD */
  3341. /* EndPoint REGister MASK (no toggle fields) */
  3342. #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)
  3343. /*!< EP_TYPE[1:0] EndPoint TYPE */
  3344. #define USB_EP_TYPE_MASK ((uint32_t)0x00000600) /*!< EndPoint TYPE Mask */
  3345. #define USB_EP_BULK ((uint32_t)0x00000000) /*!< EndPoint BULK */
  3346. #define USB_EP_CONTROL ((uint32_t)0x00000200) /*!< EndPoint CONTROL */
  3347. #define USB_EP_ISOCHRONOUS ((uint32_t)0x00000400) /*!< EndPoint ISOCHRONOUS */
  3348. #define USB_EP_INTERRUPT ((uint32_t)0x00000600) /*!< EndPoint INTERRUPT */
  3349. #define USB_EP_T_MASK (~USB_EP_T_FIELD & USB_EPREG_MASK)
  3350. #define USB_EPKIND_MASK (~USB_EP_KIND & USB_EPREG_MASK) /*!< EP_KIND EndPoint KIND */
  3351. /*!< STAT_TX[1:0] STATus for TX transfer */
  3352. #define USB_EP_TX_DIS ((uint32_t)0x00000000) /*!< EndPoint TX DISabled */
  3353. #define USB_EP_TX_STALL ((uint32_t)0x00000010) /*!< EndPoint TX STALLed */
  3354. #define USB_EP_TX_NAK ((uint32_t)0x00000020) /*!< EndPoint TX NAKed */
  3355. #define USB_EP_TX_VALID ((uint32_t)0x00000030) /*!< EndPoint TX VALID */
  3356. #define USB_EPTX_DTOG1 ((uint32_t)0x00000010) /*!< EndPoint TX Data TOGgle bit1 */
  3357. #define USB_EPTX_DTOG2 ((uint32_t)0x00000020) /*!< EndPoint TX Data TOGgle bit2 */
  3358. #define USB_EPTX_DTOGMASK (USB_EPTX_STAT|USB_EPREG_MASK)
  3359. /*!< STAT_RX[1:0] STATus for RX transfer */
  3360. #define USB_EP_RX_DIS ((uint32_t)0x00000000) /*!< EndPoint RX DISabled */
  3361. #define USB_EP_RX_STALL ((uint32_t)0x00001000) /*!< EndPoint RX STALLed */
  3362. #define USB_EP_RX_NAK ((uint32_t)0x00002000) /*!< EndPoint RX NAKed */
  3363. #define USB_EP_RX_VALID ((uint32_t)0x00003000) /*!< EndPoint RX VALID */
  3364. #define USB_EPRX_DTOG1 ((uint32_t)0x00001000) /*!< EndPoint RX Data TOGgle bit1 */
  3365. #define USB_EPRX_DTOG2 ((uint32_t)0x00002000) /*!< EndPoint RX Data TOGgle bit1 */
  3366. #define USB_EPRX_DTOGMASK (USB_EPRX_STAT|USB_EPREG_MASK)
  3367. /******************* Bit definition for USB_EP0R register *******************/
  3368. #define USB_EP0R_EA ((uint32_t)0x0000000F) /*!<Endpoint Address */
  3369. #define USB_EP0R_STAT_TX ((uint32_t)0x00000030) /*!<STAT_TX[1:0] bits (Status bits, for transmission transfers) */
  3370. #define USB_EP0R_STAT_TX_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3371. #define USB_EP0R_STAT_TX_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3372. #define USB_EP0R_DTOG_TX ((uint32_t)0x00000040) /*!<Data Toggle, for transmission transfers */
  3373. #define USB_EP0R_CTR_TX ((uint32_t)0x00000080) /*!<Correct Transfer for transmission */
  3374. #define USB_EP0R_EP_KIND ((uint32_t)0x00000100) /*!<Endpoint Kind */
  3375. #define USB_EP0R_EP_TYPE ((uint32_t)0x00000600) /*!<EP_TYPE[1:0] bits (Endpoint type) */
  3376. #define USB_EP0R_EP_TYPE_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  3377. #define USB_EP0R_EP_TYPE_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  3378. #define USB_EP0R_SETUP ((uint32_t)0x00000800) /*!<Setup transaction completed */
  3379. #define USB_EP0R_STAT_RX ((uint32_t)0x00003000) /*!<STAT_RX[1:0] bits (Status bits, for reception transfers) */
  3380. #define USB_EP0R_STAT_RX_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  3381. #define USB_EP0R_STAT_RX_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  3382. #define USB_EP0R_DTOG_RX ((uint32_t)0x00004000) /*!<Data Toggle, for reception transfers */
  3383. #define USB_EP0R_CTR_RX ((uint32_t)0x00008000) /*!<Correct Transfer for reception */
  3384. /******************* Bit definition for USB_EP1R register *******************/
  3385. #define USB_EP1R_EA ((uint32_t)0x0000000F) /*!<Endpoint Address */
  3386. #define USB_EP1R_STAT_TX ((uint32_t)0x00000030) /*!<STAT_TX[1:0] bits (Status bits, for transmission transfers) */
  3387. #define USB_EP1R_STAT_TX_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3388. #define USB_EP1R_STAT_TX_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3389. #define USB_EP1R_DTOG_TX ((uint32_t)0x00000040) /*!<Data Toggle, for transmission transfers */
  3390. #define USB_EP1R_CTR_TX ((uint32_t)0x00000080) /*!<Correct Transfer for transmission */
  3391. #define USB_EP1R_EP_KIND ((uint32_t)0x00000100) /*!<Endpoint Kind */
  3392. #define USB_EP1R_EP_TYPE ((uint32_t)0x00000600) /*!<EP_TYPE[1:0] bits (Endpoint type) */
  3393. #define USB_EP1R_EP_TYPE_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  3394. #define USB_EP1R_EP_TYPE_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  3395. #define USB_EP1R_SETUP ((uint32_t)0x00000800) /*!<Setup transaction completed */
  3396. #define USB_EP1R_STAT_RX ((uint32_t)0x00003000) /*!<STAT_RX[1:0] bits (Status bits, for reception transfers) */
  3397. #define USB_EP1R_STAT_RX_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  3398. #define USB_EP1R_STAT_RX_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  3399. #define USB_EP1R_DTOG_RX ((uint32_t)0x00004000) /*!<Data Toggle, for reception transfers */
  3400. #define USB_EP1R_CTR_RX ((uint32_t)0x00008000) /*!<Correct Transfer for reception */
  3401. /******************* Bit definition for USB_EP2R register *******************/
  3402. #define USB_EP2R_EA ((uint32_t)0x0000000F) /*!<Endpoint Address */
  3403. #define USB_EP2R_STAT_TX ((uint32_t)0x00000030) /*!<STAT_TX[1:0] bits (Status bits, for transmission transfers) */
  3404. #define USB_EP2R_STAT_TX_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3405. #define USB_EP2R_STAT_TX_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3406. #define USB_EP2R_DTOG_TX ((uint32_t)0x00000040) /*!<Data Toggle, for transmission transfers */
  3407. #define USB_EP2R_CTR_TX ((uint32_t)0x00000080) /*!<Correct Transfer for transmission */
  3408. #define USB_EP2R_EP_KIND ((uint32_t)0x00000100) /*!<Endpoint Kind */
  3409. #define USB_EP2R_EP_TYPE ((uint32_t)0x00000600) /*!<EP_TYPE[1:0] bits (Endpoint type) */
  3410. #define USB_EP2R_EP_TYPE_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  3411. #define USB_EP2R_EP_TYPE_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  3412. #define USB_EP2R_SETUP ((uint32_t)0x00000800) /*!<Setup transaction completed */
  3413. #define USB_EP2R_STAT_RX ((uint32_t)0x00003000) /*!<STAT_RX[1:0] bits (Status bits, for reception transfers) */
  3414. #define USB_EP2R_STAT_RX_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  3415. #define USB_EP2R_STAT_RX_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  3416. #define USB_EP2R_DTOG_RX ((uint32_t)0x00004000) /*!<Data Toggle, for reception transfers */
  3417. #define USB_EP2R_CTR_RX ((uint32_t)0x00008000) /*!<Correct Transfer for reception */
  3418. /******************* Bit definition for USB_EP3R register *******************/
  3419. #define USB_EP3R_EA ((uint32_t)0x0000000F) /*!<Endpoint Address */
  3420. #define USB_EP3R_STAT_TX ((uint32_t)0x00000030) /*!<STAT_TX[1:0] bits (Status bits, for transmission transfers) */
  3421. #define USB_EP3R_STAT_TX_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3422. #define USB_EP3R_STAT_TX_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3423. #define USB_EP3R_DTOG_TX ((uint32_t)0x00000040) /*!<Data Toggle, for transmission transfers */
  3424. #define USB_EP3R_CTR_TX ((uint32_t)0x00000080) /*!<Correct Transfer for transmission */
  3425. #define USB_EP3R_EP_KIND ((uint32_t)0x00000100) /*!<Endpoint Kind */
  3426. #define USB_EP3R_EP_TYPE ((uint32_t)0x00000600) /*!<EP_TYPE[1:0] bits (Endpoint type) */
  3427. #define USB_EP3R_EP_TYPE_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  3428. #define USB_EP3R_EP_TYPE_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  3429. #define USB_EP3R_SETUP ((uint32_t)0x00000800) /*!<Setup transaction completed */
  3430. #define USB_EP3R_STAT_RX ((uint32_t)0x00003000) /*!<STAT_RX[1:0] bits (Status bits, for reception transfers) */
  3431. #define USB_EP3R_STAT_RX_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  3432. #define USB_EP3R_STAT_RX_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  3433. #define USB_EP3R_DTOG_RX ((uint32_t)0x00004000) /*!<Data Toggle, for reception transfers */
  3434. #define USB_EP3R_CTR_RX ((uint32_t)0x00008000) /*!<Correct Transfer for reception */
  3435. /******************* Bit definition for USB_EP4R register *******************/
  3436. #define USB_EP4R_EA ((uint32_t)0x0000000F) /*!<Endpoint Address */
  3437. #define USB_EP4R_STAT_TX ((uint32_t)0x00000030) /*!<STAT_TX[1:0] bits (Status bits, for transmission transfers) */
  3438. #define USB_EP4R_STAT_TX_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3439. #define USB_EP4R_STAT_TX_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3440. #define USB_EP4R_DTOG_TX ((uint32_t)0x00000040) /*!<Data Toggle, for transmission transfers */
  3441. #define USB_EP4R_CTR_TX ((uint32_t)0x00000080) /*!<Correct Transfer for transmission */
  3442. #define USB_EP4R_EP_KIND ((uint32_t)0x00000100) /*!<Endpoint Kind */
  3443. #define USB_EP4R_EP_TYPE ((uint32_t)0x00000600) /*!<EP_TYPE[1:0] bits (Endpoint type) */
  3444. #define USB_EP4R_EP_TYPE_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  3445. #define USB_EP4R_EP_TYPE_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  3446. #define USB_EP4R_SETUP ((uint32_t)0x00000800) /*!<Setup transaction completed */
  3447. #define USB_EP4R_STAT_RX ((uint32_t)0x00003000) /*!<STAT_RX[1:0] bits (Status bits, for reception transfers) */
  3448. #define USB_EP4R_STAT_RX_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  3449. #define USB_EP4R_STAT_RX_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  3450. #define USB_EP4R_DTOG_RX ((uint32_t)0x00004000) /*!<Data Toggle, for reception transfers */
  3451. #define USB_EP4R_CTR_RX ((uint32_t)0x00008000) /*!<Correct Transfer for reception */
  3452. /******************* Bit definition for USB_EP5R register *******************/
  3453. #define USB_EP5R_EA ((uint32_t)0x0000000F) /*!<Endpoint Address */
  3454. #define USB_EP5R_STAT_TX ((uint32_t)0x00000030) /*!<STAT_TX[1:0] bits (Status bits, for transmission transfers) */
  3455. #define USB_EP5R_STAT_TX_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3456. #define USB_EP5R_STAT_TX_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3457. #define USB_EP5R_DTOG_TX ((uint32_t)0x00000040) /*!<Data Toggle, for transmission transfers */
  3458. #define USB_EP5R_CTR_TX ((uint32_t)0x00000080) /*!<Correct Transfer for transmission */
  3459. #define USB_EP5R_EP_KIND ((uint32_t)0x00000100) /*!<Endpoint Kind */
  3460. #define USB_EP5R_EP_TYPE ((uint32_t)0x00000600) /*!<EP_TYPE[1:0] bits (Endpoint type) */
  3461. #define USB_EP5R_EP_TYPE_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  3462. #define USB_EP5R_EP_TYPE_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  3463. #define USB_EP5R_SETUP ((uint32_t)0x00000800) /*!<Setup transaction completed */
  3464. #define USB_EP5R_STAT_RX ((uint32_t)0x00003000) /*!<STAT_RX[1:0] bits (Status bits, for reception transfers) */
  3465. #define USB_EP5R_STAT_RX_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  3466. #define USB_EP5R_STAT_RX_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  3467. #define USB_EP5R_DTOG_RX ((uint32_t)0x00004000) /*!<Data Toggle, for reception transfers */
  3468. #define USB_EP5R_CTR_RX ((uint32_t)0x00008000) /*!<Correct Transfer for reception */
  3469. /******************* Bit definition for USB_EP6R register *******************/
  3470. #define USB_EP6R_EA ((uint32_t)0x0000000F) /*!<Endpoint Address */
  3471. #define USB_EP6R_STAT_TX ((uint32_t)0x00000030) /*!<STAT_TX[1:0] bits (Status bits, for transmission transfers) */
  3472. #define USB_EP6R_STAT_TX_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3473. #define USB_EP6R_STAT_TX_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3474. #define USB_EP6R_DTOG_TX ((uint32_t)0x00000040) /*!<Data Toggle, for transmission transfers */
  3475. #define USB_EP6R_CTR_TX ((uint32_t)0x00000080) /*!<Correct Transfer for transmission */
  3476. #define USB_EP6R_EP_KIND ((uint32_t)0x00000100) /*!<Endpoint Kind */
  3477. #define USB_EP6R_EP_TYPE ((uint32_t)0x00000600) /*!<EP_TYPE[1:0] bits (Endpoint type) */
  3478. #define USB_EP6R_EP_TYPE_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  3479. #define USB_EP6R_EP_TYPE_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  3480. #define USB_EP6R_SETUP ((uint32_t)0x00000800) /*!<Setup transaction completed */
  3481. #define USB_EP6R_STAT_RX ((uint32_t)0x00003000) /*!<STAT_RX[1:0] bits (Status bits, for reception transfers) */
  3482. #define USB_EP6R_STAT_RX_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  3483. #define USB_EP6R_STAT_RX_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  3484. #define USB_EP6R_DTOG_RX ((uint32_t)0x00004000) /*!<Data Toggle, for reception transfers */
  3485. #define USB_EP6R_CTR_RX ((uint32_t)0x00008000) /*!<Correct Transfer for reception */
  3486. /******************* Bit definition for USB_EP7R register *******************/
  3487. #define USB_EP7R_EA ((uint32_t)0x0000000F) /*!<Endpoint Address */
  3488. #define USB_EP7R_STAT_TX ((uint32_t)0x00000030) /*!<STAT_TX[1:0] bits (Status bits, for transmission transfers) */
  3489. #define USB_EP7R_STAT_TX_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3490. #define USB_EP7R_STAT_TX_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3491. #define USB_EP7R_DTOG_TX ((uint32_t)0x00000040) /*!<Data Toggle, for transmission transfers */
  3492. #define USB_EP7R_CTR_TX ((uint32_t)0x00000080) /*!<Correct Transfer for transmission */
  3493. #define USB_EP7R_EP_KIND ((uint32_t)0x00000100) /*!<Endpoint Kind */
  3494. #define USB_EP7R_EP_TYPE ((uint32_t)0x00000600) /*!<EP_TYPE[1:0] bits (Endpoint type) */
  3495. #define USB_EP7R_EP_TYPE_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  3496. #define USB_EP7R_EP_TYPE_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  3497. #define USB_EP7R_SETUP ((uint32_t)0x00000800) /*!<Setup transaction completed */
  3498. #define USB_EP7R_STAT_RX ((uint32_t)0x00003000) /*!<STAT_RX[1:0] bits (Status bits, for reception transfers) */
  3499. #define USB_EP7R_STAT_RX_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  3500. #define USB_EP7R_STAT_RX_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  3501. #define USB_EP7R_DTOG_RX ((uint32_t)0x00004000) /*!<Data Toggle, for reception transfers */
  3502. #define USB_EP7R_CTR_RX ((uint32_t)0x00008000) /*!<Correct Transfer for reception */
  3503. /*!<Common registers */
  3504. #define USB_CNTR (USB_BASE + 0x00000040) /*!< Control register */
  3505. #define USB_ISTR (USB_BASE + 0x00000044) /*!< Interrupt status register */
  3506. #define USB_FNR (USB_BASE + 0x00000048) /*!< Frame number register */
  3507. #define USB_DADDR (USB_BASE + 0x0000004C) /*!< Device address register */
  3508. #define USB_BTABLE (USB_BASE + 0x00000050) /*!< Buffer Table address register */
  3509. /******************* Bit definition for USB_CNTR register *******************/
  3510. #define USB_CNTR_FRES ((uint32_t)0x00000001) /*!<Force USB Reset */
  3511. #define USB_CNTR_PDWN ((uint32_t)0x00000002) /*!<Power down */
  3512. #define USB_CNTR_LP_MODE ((uint32_t)0x00000004) /*!<Low-power mode */
  3513. #define USB_CNTR_FSUSP ((uint32_t)0x00000008) /*!<Force suspend */
  3514. #define USB_CNTR_RESUME ((uint32_t)0x00000010) /*!<Resume request */
  3515. #define USB_CNTR_ESOFM ((uint32_t)0x00000100) /*!<Expected Start Of Frame Interrupt Mask */
  3516. #define USB_CNTR_SOFM ((uint32_t)0x00000200) /*!<Start Of Frame Interrupt Mask */
  3517. #define USB_CNTR_RESETM ((uint32_t)0x00000400) /*!<RESET Interrupt Mask */
  3518. #define USB_CNTR_SUSPM ((uint32_t)0x00000800) /*!<Suspend mode Interrupt Mask */
  3519. #define USB_CNTR_WKUPM ((uint32_t)0x00001000) /*!<Wakeup Interrupt Mask */
  3520. #define USB_CNTR_ERRM ((uint32_t)0x00002000) /*!<Error Interrupt Mask */
  3521. #define USB_CNTR_PMAOVRM ((uint32_t)0x00004000) /*!<Packet Memory Area Over / Underrun Interrupt Mask */
  3522. #define USB_CNTR_CTRM ((uint32_t)0x00008000) /*!<Correct Transfer Interrupt Mask */
  3523. /******************* Bit definition for USB_ISTR register *******************/
  3524. #define USB_ISTR_EP_ID ((uint32_t)0x0000000F) /*!<Endpoint Identifier */
  3525. #define USB_ISTR_DIR ((uint32_t)0x00000010) /*!<Direction of transaction */
  3526. #define USB_ISTR_ESOF ((uint32_t)0x00000100) /*!<Expected Start Of Frame */
  3527. #define USB_ISTR_SOF ((uint32_t)0x00000200) /*!<Start Of Frame */
  3528. #define USB_ISTR_RESET ((uint32_t)0x00000400) /*!<USB RESET request */
  3529. #define USB_ISTR_SUSP ((uint32_t)0x00000800) /*!<Suspend mode request */
  3530. #define USB_ISTR_WKUP ((uint32_t)0x00001000) /*!<Wake up */
  3531. #define USB_ISTR_ERR ((uint32_t)0x00002000) /*!<Error */
  3532. #define USB_ISTR_PMAOVRM ((uint32_t)0x00004000) /*!<Packet Memory Area Over / Underrun */
  3533. #define USB_ISTR_CTR ((uint32_t)0x00008000) /*!<Correct Transfer */
  3534. #define USB_CLR_CTR (~USB_ISTR_CTR) /*!< clear Correct TRansfer bit */
  3535. #define USB_CLR_PMAOVRM (~USB_ISTR_PMAOVR) /*!< clear DMA OVeR/underrun bit*/
  3536. #define USB_CLR_ERR (~USB_ISTR_ERR) /*!< clear ERRor bit */
  3537. #define USB_CLR_WKUP (~USB_ISTR_WKUP) /*!< clear WaKe UP bit */
  3538. #define USB_CLR_SUSP (~USB_ISTR_SUSP) /*!< clear SUSPend bit */
  3539. #define USB_CLR_RESET (~USB_ISTR_RESET) /*!< clear RESET bit */
  3540. #define USB_CLR_SOF (~USB_ISTR_SOF) /*!< clear Start Of Frame bit */
  3541. #define USB_CLR_ESOF (~USB_ISTR_ESOF) /*!< clear Expected Start Of Frame bit */
  3542. /******************* Bit definition for USB_FNR register ********************/
  3543. #define USB_FNR_FN ((uint32_t)0x000007FF) /*!<Frame Number */
  3544. #define USB_FNR_LSOF ((uint32_t)0x00001800) /*!<Lost SOF */
  3545. #define USB_FNR_LCK ((uint32_t)0x00002000) /*!<Locked */
  3546. #define USB_FNR_RXDM ((uint32_t)0x00004000) /*!<Receive Data - Line Status */
  3547. #define USB_FNR_RXDP ((uint32_t)0x00008000) /*!<Receive Data + Line Status */
  3548. /****************** Bit definition for USB_DADDR register *******************/
  3549. #define USB_DADDR_ADD ((uint32_t)0x0000007F) /*!<ADD[6:0] bits (Device Address) */
  3550. #define USB_DADDR_ADD0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3551. #define USB_DADDR_ADD1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3552. #define USB_DADDR_ADD2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3553. #define USB_DADDR_ADD3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3554. #define USB_DADDR_ADD4 ((uint32_t)0x00000010) /*!<Bit 4 */
  3555. #define USB_DADDR_ADD5 ((uint32_t)0x00000020) /*!<Bit 5 */
  3556. #define USB_DADDR_ADD6 ((uint32_t)0x00000040) /*!<Bit 6 */
  3557. #define USB_DADDR_EF ((uint32_t)0x00000080) /*!<Enable Function */
  3558. /****************** Bit definition for USB_BTABLE register ******************/
  3559. #define USB_BTABLE_BTABLE ((uint32_t)0x0000FFF8) /*!<Buffer Table */
  3560. /*!< Buffer descriptor table */
  3561. /***************** Bit definition for USB_ADDR0_TX register *****************/
  3562. #define USB_ADDR0_TX_ADDR0_TX ((uint32_t)0x0000FFFE) /*!< Transmission Buffer Address 0 */
  3563. /***************** Bit definition for USB_ADDR1_TX register *****************/
  3564. #define USB_ADDR1_TX_ADDR1_TX ((uint32_t)0x0000FFFE) /*!< Transmission Buffer Address 1 */
  3565. /***************** Bit definition for USB_ADDR2_TX register *****************/
  3566. #define USB_ADDR2_TX_ADDR2_TX ((uint32_t)0x0000FFFE) /*!< Transmission Buffer Address 2 */
  3567. /***************** Bit definition for USB_ADDR3_TX register *****************/
  3568. #define USB_ADDR3_TX_ADDR3_TX ((uint32_t)0x0000FFFE) /*!< Transmission Buffer Address 3 */
  3569. /***************** Bit definition for USB_ADDR4_TX register *****************/
  3570. #define USB_ADDR4_TX_ADDR4_TX ((uint32_t)0x0000FFFE) /*!< Transmission Buffer Address 4 */
  3571. /***************** Bit definition for USB_ADDR5_TX register *****************/
  3572. #define USB_ADDR5_TX_ADDR5_TX ((uint32_t)0x0000FFFE) /*!< Transmission Buffer Address 5 */
  3573. /***************** Bit definition for USB_ADDR6_TX register *****************/
  3574. #define USB_ADDR6_TX_ADDR6_TX ((uint32_t)0x0000FFFE) /*!< Transmission Buffer Address 6 */
  3575. /***************** Bit definition for USB_ADDR7_TX register *****************/
  3576. #define USB_ADDR7_TX_ADDR7_TX ((uint32_t)0x0000FFFE) /*!< Transmission Buffer Address 7 */
  3577. /*----------------------------------------------------------------------------*/
  3578. /***************** Bit definition for USB_COUNT0_TX register ****************/
  3579. #define USB_COUNT0_TX_COUNT0_TX ((uint32_t)0x000003FF) /*!< Transmission Byte Count 0 */
  3580. /***************** Bit definition for USB_COUNT1_TX register ****************/
  3581. #define USB_COUNT1_TX_COUNT1_TX ((uint32_t)0x000003FF) /*!< Transmission Byte Count 1 */
  3582. /***************** Bit definition for USB_COUNT2_TX register ****************/
  3583. #define USB_COUNT2_TX_COUNT2_TX ((uint32_t)0x000003FF) /*!< Transmission Byte Count 2 */
  3584. /***************** Bit definition for USB_COUNT3_TX register ****************/
  3585. #define USB_COUNT3_TX_COUNT3_TX ((uint32_t)0x000003FF) /*!< Transmission Byte Count 3 */
  3586. /***************** Bit definition for USB_COUNT4_TX register ****************/
  3587. #define USB_COUNT4_TX_COUNT4_TX ((uint32_t)0x000003FF) /*!< Transmission Byte Count 4 */
  3588. /***************** Bit definition for USB_COUNT5_TX register ****************/
  3589. #define USB_COUNT5_TX_COUNT5_TX ((uint32_t)0x000003FF) /*!< Transmission Byte Count 5 */
  3590. /***************** Bit definition for USB_COUNT6_TX register ****************/
  3591. #define USB_COUNT6_TX_COUNT6_TX ((uint32_t)0x000003FF) /*!< Transmission Byte Count 6 */
  3592. /***************** Bit definition for USB_COUNT7_TX register ****************/
  3593. #define USB_COUNT7_TX_COUNT7_TX ((uint32_t)0x000003FF) /*!< Transmission Byte Count 7 */
  3594. /*----------------------------------------------------------------------------*/
  3595. /**************** Bit definition for USB_COUNT0_TX_0 register ***************/
  3596. #define USB_COUNT0_TX_0_COUNT0_TX_0 ((uint32_t)0x000003FF) /*!< Transmission Byte Count 0 (low) */
  3597. /**************** Bit definition for USB_COUNT0_TX_1 register ***************/
  3598. #define USB_COUNT0_TX_1_COUNT0_TX_1 ((uint32_t)0x03FF0000) /*!< Transmission Byte Count 0 (high) */
  3599. /**************** Bit definition for USB_COUNT1_TX_0 register ***************/
  3600. #define USB_COUNT1_TX_0_COUNT1_TX_0 ((uint32_t)0x000003FF) /*!< Transmission Byte Count 1 (low) */
  3601. /**************** Bit definition for USB_COUNT1_TX_1 register ***************/
  3602. #define USB_COUNT1_TX_1_COUNT1_TX_1 ((uint32_t)0x03FF0000) /*!< Transmission Byte Count 1 (high) */
  3603. /**************** Bit definition for USB_COUNT2_TX_0 register ***************/
  3604. #define USB_COUNT2_TX_0_COUNT2_TX_0 ((uint32_t)0x000003FF) /*!< Transmission Byte Count 2 (low) */
  3605. /**************** Bit definition for USB_COUNT2_TX_1 register ***************/
  3606. #define USB_COUNT2_TX_1_COUNT2_TX_1 ((uint32_t)0x03FF0000) /*!< Transmission Byte Count 2 (high) */
  3607. /**************** Bit definition for USB_COUNT3_TX_0 register ***************/
  3608. #define USB_COUNT3_TX_0_COUNT3_TX_0 ((uint32_t)0x0000000003FF) /*!< Transmission Byte Count 3 (low) */
  3609. /**************** Bit definition for USB_COUNT3_TX_1 register ***************/
  3610. #define USB_COUNT3_TX_1_COUNT3_TX_1 ((uint32_t)0x000003FF0000) /*!< Transmission Byte Count 3 (high) */
  3611. /**************** Bit definition for USB_COUNT4_TX_0 register ***************/
  3612. #define USB_COUNT4_TX_0_COUNT4_TX_0 ((uint32_t)0x000003FF) /*!< Transmission Byte Count 4 (low) */
  3613. /**************** Bit definition for USB_COUNT4_TX_1 register ***************/
  3614. #define USB_COUNT4_TX_1_COUNT4_TX_1 ((uint32_t)0x03FF0000) /*!< Transmission Byte Count 4 (high) */
  3615. /**************** Bit definition for USB_COUNT5_TX_0 register ***************/
  3616. #define USB_COUNT5_TX_0_COUNT5_TX_0 ((uint32_t)0x000003FF) /*!< Transmission Byte Count 5 (low) */
  3617. /**************** Bit definition for USB_COUNT5_TX_1 register ***************/
  3618. #define USB_COUNT5_TX_1_COUNT5_TX_1 ((uint32_t)0x03FF0000) /*!< Transmission Byte Count 5 (high) */
  3619. /**************** Bit definition for USB_COUNT6_TX_0 register ***************/
  3620. #define USB_COUNT6_TX_0_COUNT6_TX_0 ((uint32_t)0x000003FF) /*!< Transmission Byte Count 6 (low) */
  3621. /**************** Bit definition for USB_COUNT6_TX_1 register ***************/
  3622. #define USB_COUNT6_TX_1_COUNT6_TX_1 ((uint32_t)0x03FF0000) /*!< Transmission Byte Count 6 (high) */
  3623. /**************** Bit definition for USB_COUNT7_TX_0 register ***************/
  3624. #define USB_COUNT7_TX_0_COUNT7_TX_0 ((uint32_t)0x000003FF) /*!< Transmission Byte Count 7 (low) */
  3625. /**************** Bit definition for USB_COUNT7_TX_1 register ***************/
  3626. #define USB_COUNT7_TX_1_COUNT7_TX_1 ((uint32_t)0x03FF0000) /*!< Transmission Byte Count 7 (high) */
  3627. /*----------------------------------------------------------------------------*/
  3628. /***************** Bit definition for USB_ADDR0_RX register *****************/
  3629. #define USB_ADDR0_RX_ADDR0_RX ((uint32_t)0x0000FFFE) /*!< Reception Buffer Address 0 */
  3630. /***************** Bit definition for USB_ADDR1_RX register *****************/
  3631. #define USB_ADDR1_RX_ADDR1_RX ((uint32_t)0x0000FFFE) /*!< Reception Buffer Address 1 */
  3632. /***************** Bit definition for USB_ADDR2_RX register *****************/
  3633. #define USB_ADDR2_RX_ADDR2_RX ((uint32_t)0x0000FFFE) /*!< Reception Buffer Address 2 */
  3634. /***************** Bit definition for USB_ADDR3_RX register *****************/
  3635. #define USB_ADDR3_RX_ADDR3_RX ((uint32_t)0x0000FFFE) /*!< Reception Buffer Address 3 */
  3636. /***************** Bit definition for USB_ADDR4_RX register *****************/
  3637. #define USB_ADDR4_RX_ADDR4_RX ((uint32_t)0x0000FFFE) /*!< Reception Buffer Address 4 */
  3638. /***************** Bit definition for USB_ADDR5_RX register *****************/
  3639. #define USB_ADDR5_RX_ADDR5_RX ((uint32_t)0x0000FFFE) /*!< Reception Buffer Address 5 */
  3640. /***************** Bit definition for USB_ADDR6_RX register *****************/
  3641. #define USB_ADDR6_RX_ADDR6_RX ((uint32_t)0x0000FFFE) /*!< Reception Buffer Address 6 */
  3642. /***************** Bit definition for USB_ADDR7_RX register *****************/
  3643. #define USB_ADDR7_RX_ADDR7_RX ((uint32_t)0x0000FFFE) /*!< Reception Buffer Address 7 */
  3644. /*----------------------------------------------------------------------------*/
  3645. /***************** Bit definition for USB_COUNT0_RX register ****************/
  3646. #define USB_COUNT0_RX_COUNT0_RX ((uint32_t)0x000003FF) /*!< Reception Byte Count */
  3647. #define USB_COUNT0_RX_NUM_BLOCK ((uint32_t)0x00007C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
  3648. #define USB_COUNT0_RX_NUM_BLOCK_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  3649. #define USB_COUNT0_RX_NUM_BLOCK_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  3650. #define USB_COUNT0_RX_NUM_BLOCK_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  3651. #define USB_COUNT0_RX_NUM_BLOCK_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  3652. #define USB_COUNT0_RX_NUM_BLOCK_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  3653. #define USB_COUNT0_RX_BLSIZE ((uint32_t)0x00008000) /*!< BLock SIZE */
  3654. /***************** Bit definition for USB_COUNT1_RX register ****************/
  3655. #define USB_COUNT1_RX_COUNT1_RX ((uint32_t)0x000003FF) /*!< Reception Byte Count */
  3656. #define USB_COUNT1_RX_NUM_BLOCK ((uint32_t)0x00007C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
  3657. #define USB_COUNT1_RX_NUM_BLOCK_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  3658. #define USB_COUNT1_RX_NUM_BLOCK_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  3659. #define USB_COUNT1_RX_NUM_BLOCK_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  3660. #define USB_COUNT1_RX_NUM_BLOCK_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  3661. #define USB_COUNT1_RX_NUM_BLOCK_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  3662. #define USB_COUNT1_RX_BLSIZE ((uint32_t)0x00008000) /*!< BLock SIZE */
  3663. /***************** Bit definition for USB_COUNT2_RX register ****************/
  3664. #define USB_COUNT2_RX_COUNT2_RX ((uint32_t)0x000003FF) /*!< Reception Byte Count */
  3665. #define USB_COUNT2_RX_NUM_BLOCK ((uint32_t)0x00007C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
  3666. #define USB_COUNT2_RX_NUM_BLOCK_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  3667. #define USB_COUNT2_RX_NUM_BLOCK_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  3668. #define USB_COUNT2_RX_NUM_BLOCK_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  3669. #define USB_COUNT2_RX_NUM_BLOCK_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  3670. #define USB_COUNT2_RX_NUM_BLOCK_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  3671. #define USB_COUNT2_RX_BLSIZE ((uint32_t)0x00008000) /*!< BLock SIZE */
  3672. /***************** Bit definition for USB_COUNT3_RX register ****************/
  3673. #define USB_COUNT3_RX_COUNT3_RX ((uint32_t)0x000003FF) /*!< Reception Byte Count */
  3674. #define USB_COUNT3_RX_NUM_BLOCK ((uint32_t)0x00007C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
  3675. #define USB_COUNT3_RX_NUM_BLOCK_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  3676. #define USB_COUNT3_RX_NUM_BLOCK_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  3677. #define USB_COUNT3_RX_NUM_BLOCK_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  3678. #define USB_COUNT3_RX_NUM_BLOCK_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  3679. #define USB_COUNT3_RX_NUM_BLOCK_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  3680. #define USB_COUNT3_RX_BLSIZE ((uint32_t)0x00008000) /*!< BLock SIZE */
  3681. /***************** Bit definition for USB_COUNT4_RX register ****************/
  3682. #define USB_COUNT4_RX_COUNT4_RX ((uint32_t)0x000003FF) /*!< Reception Byte Count */
  3683. #define USB_COUNT4_RX_NUM_BLOCK ((uint32_t)0x00007C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
  3684. #define USB_COUNT4_RX_NUM_BLOCK_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  3685. #define USB_COUNT4_RX_NUM_BLOCK_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  3686. #define USB_COUNT4_RX_NUM_BLOCK_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  3687. #define USB_COUNT4_RX_NUM_BLOCK_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  3688. #define USB_COUNT4_RX_NUM_BLOCK_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  3689. #define USB_COUNT4_RX_BLSIZE ((uint32_t)0x00008000) /*!< BLock SIZE */
  3690. /***************** Bit definition for USB_COUNT5_RX register ****************/
  3691. #define USB_COUNT5_RX_COUNT5_RX ((uint32_t)0x000003FF) /*!< Reception Byte Count */
  3692. #define USB_COUNT5_RX_NUM_BLOCK ((uint32_t)0x00007C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
  3693. #define USB_COUNT5_RX_NUM_BLOCK_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  3694. #define USB_COUNT5_RX_NUM_BLOCK_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  3695. #define USB_COUNT5_RX_NUM_BLOCK_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  3696. #define USB_COUNT5_RX_NUM_BLOCK_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  3697. #define USB_COUNT5_RX_NUM_BLOCK_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  3698. #define USB_COUNT5_RX_BLSIZE ((uint32_t)0x00008000) /*!< BLock SIZE */
  3699. /***************** Bit definition for USB_COUNT6_RX register ****************/
  3700. #define USB_COUNT6_RX_COUNT6_RX ((uint32_t)0x000003FF) /*!< Reception Byte Count */
  3701. #define USB_COUNT6_RX_NUM_BLOCK ((uint32_t)0x00007C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
  3702. #define USB_COUNT6_RX_NUM_BLOCK_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  3703. #define USB_COUNT6_RX_NUM_BLOCK_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  3704. #define USB_COUNT6_RX_NUM_BLOCK_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  3705. #define USB_COUNT6_RX_NUM_BLOCK_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  3706. #define USB_COUNT6_RX_NUM_BLOCK_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  3707. #define USB_COUNT6_RX_BLSIZE ((uint32_t)0x00008000) /*!< BLock SIZE */
  3708. /***************** Bit definition for USB_COUNT7_RX register ****************/
  3709. #define USB_COUNT7_RX_COUNT7_RX ((uint32_t)0x000003FF) /*!< Reception Byte Count */
  3710. #define USB_COUNT7_RX_NUM_BLOCK ((uint32_t)0x00007C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
  3711. #define USB_COUNT7_RX_NUM_BLOCK_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  3712. #define USB_COUNT7_RX_NUM_BLOCK_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  3713. #define USB_COUNT7_RX_NUM_BLOCK_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  3714. #define USB_COUNT7_RX_NUM_BLOCK_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  3715. #define USB_COUNT7_RX_NUM_BLOCK_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  3716. #define USB_COUNT7_RX_BLSIZE ((uint32_t)0x00008000) /*!< BLock SIZE */
  3717. /*----------------------------------------------------------------------------*/
  3718. /**************** Bit definition for USB_COUNT0_RX_0 register ***************/
  3719. #define USB_COUNT0_RX_0_COUNT0_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
  3720. #define USB_COUNT0_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
  3721. #define USB_COUNT0_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  3722. #define USB_COUNT0_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  3723. #define USB_COUNT0_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  3724. #define USB_COUNT0_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  3725. #define USB_COUNT0_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  3726. #define USB_COUNT0_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
  3727. /**************** Bit definition for USB_COUNT0_RX_1 register ***************/
  3728. #define USB_COUNT0_RX_1_COUNT0_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
  3729. #define USB_COUNT0_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
  3730. #define USB_COUNT0_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 1 */
  3731. #define USB_COUNT0_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
  3732. #define USB_COUNT0_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
  3733. #define USB_COUNT0_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
  3734. #define USB_COUNT0_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
  3735. #define USB_COUNT0_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
  3736. /**************** Bit definition for USB_COUNT1_RX_0 register ***************/
  3737. #define USB_COUNT1_RX_0_COUNT1_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
  3738. #define USB_COUNT1_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
  3739. #define USB_COUNT1_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  3740. #define USB_COUNT1_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  3741. #define USB_COUNT1_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  3742. #define USB_COUNT1_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  3743. #define USB_COUNT1_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  3744. #define USB_COUNT1_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
  3745. /**************** Bit definition for USB_COUNT1_RX_1 register ***************/
  3746. #define USB_COUNT1_RX_1_COUNT1_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
  3747. #define USB_COUNT1_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
  3748. #define USB_COUNT1_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 0 */
  3749. #define USB_COUNT1_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
  3750. #define USB_COUNT1_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
  3751. #define USB_COUNT1_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
  3752. #define USB_COUNT1_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
  3753. #define USB_COUNT1_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
  3754. /**************** Bit definition for USB_COUNT2_RX_0 register ***************/
  3755. #define USB_COUNT2_RX_0_COUNT2_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
  3756. #define USB_COUNT2_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
  3757. #define USB_COUNT2_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  3758. #define USB_COUNT2_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  3759. #define USB_COUNT2_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  3760. #define USB_COUNT2_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  3761. #define USB_COUNT2_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  3762. #define USB_COUNT2_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
  3763. /**************** Bit definition for USB_COUNT2_RX_1 register ***************/
  3764. #define USB_COUNT2_RX_1_COUNT2_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
  3765. #define USB_COUNT2_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
  3766. #define USB_COUNT2_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 0 */
  3767. #define USB_COUNT2_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
  3768. #define USB_COUNT2_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
  3769. #define USB_COUNT2_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
  3770. #define USB_COUNT2_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
  3771. #define USB_COUNT2_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
  3772. /**************** Bit definition for USB_COUNT3_RX_0 register ***************/
  3773. #define USB_COUNT3_RX_0_COUNT3_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
  3774. #define USB_COUNT3_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
  3775. #define USB_COUNT3_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  3776. #define USB_COUNT3_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  3777. #define USB_COUNT3_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  3778. #define USB_COUNT3_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  3779. #define USB_COUNT3_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  3780. #define USB_COUNT3_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
  3781. /**************** Bit definition for USB_COUNT3_RX_1 register ***************/
  3782. #define USB_COUNT3_RX_1_COUNT3_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
  3783. #define USB_COUNT3_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
  3784. #define USB_COUNT3_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 0 */
  3785. #define USB_COUNT3_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
  3786. #define USB_COUNT3_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
  3787. #define USB_COUNT3_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
  3788. #define USB_COUNT3_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
  3789. #define USB_COUNT3_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
  3790. /**************** Bit definition for USB_COUNT4_RX_0 register ***************/
  3791. #define USB_COUNT4_RX_0_COUNT4_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
  3792. #define USB_COUNT4_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
  3793. #define USB_COUNT4_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  3794. #define USB_COUNT4_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  3795. #define USB_COUNT4_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  3796. #define USB_COUNT4_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  3797. #define USB_COUNT4_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  3798. #define USB_COUNT4_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
  3799. /**************** Bit definition for USB_COUNT4_RX_1 register ***************/
  3800. #define USB_COUNT4_RX_1_COUNT4_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
  3801. #define USB_COUNT4_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
  3802. #define USB_COUNT4_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 0 */
  3803. #define USB_COUNT4_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
  3804. #define USB_COUNT4_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
  3805. #define USB_COUNT4_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
  3806. #define USB_COUNT4_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
  3807. #define USB_COUNT4_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
  3808. /**************** Bit definition for USB_COUNT5_RX_0 register ***************/
  3809. #define USB_COUNT5_RX_0_COUNT5_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
  3810. #define USB_COUNT5_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
  3811. #define USB_COUNT5_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  3812. #define USB_COUNT5_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  3813. #define USB_COUNT5_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  3814. #define USB_COUNT5_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  3815. #define USB_COUNT5_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  3816. #define USB_COUNT5_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
  3817. /**************** Bit definition for USB_COUNT5_RX_1 register ***************/
  3818. #define USB_COUNT5_RX_1_COUNT5_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
  3819. #define USB_COUNT5_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
  3820. #define USB_COUNT5_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 0 */
  3821. #define USB_COUNT5_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
  3822. #define USB_COUNT5_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
  3823. #define USB_COUNT5_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
  3824. #define USB_COUNT5_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
  3825. #define USB_COUNT5_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
  3826. /*************** Bit definition for USB_COUNT6_RX_0 register ***************/
  3827. #define USB_COUNT6_RX_0_COUNT6_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
  3828. #define USB_COUNT6_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
  3829. #define USB_COUNT6_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  3830. #define USB_COUNT6_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  3831. #define USB_COUNT6_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  3832. #define USB_COUNT6_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  3833. #define USB_COUNT6_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  3834. #define USB_COUNT6_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
  3835. /**************** Bit definition for USB_COUNT6_RX_1 register ***************/
  3836. #define USB_COUNT6_RX_1_COUNT6_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
  3837. #define USB_COUNT6_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
  3838. #define USB_COUNT6_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 0 */
  3839. #define USB_COUNT6_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
  3840. #define USB_COUNT6_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
  3841. #define USB_COUNT6_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
  3842. #define USB_COUNT6_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
  3843. #define USB_COUNT6_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
  3844. /*************** Bit definition for USB_COUNT7_RX_0 register ****************/
  3845. #define USB_COUNT7_RX_0_COUNT7_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
  3846. #define USB_COUNT7_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
  3847. #define USB_COUNT7_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  3848. #define USB_COUNT7_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  3849. #define USB_COUNT7_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  3850. #define USB_COUNT7_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  3851. #define USB_COUNT7_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  3852. #define USB_COUNT7_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
  3853. /*************** Bit definition for USB_COUNT7_RX_1 register ****************/
  3854. #define USB_COUNT7_RX_1_COUNT7_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
  3855. #define USB_COUNT7_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
  3856. #define USB_COUNT7_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 0 */
  3857. #define USB_COUNT7_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
  3858. #define USB_COUNT7_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
  3859. #define USB_COUNT7_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
  3860. #define USB_COUNT7_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
  3861. #define USB_COUNT7_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
  3862. /******************************************************************************/
  3863. /* */
  3864. /* Window WATCHDOG (WWDG) */
  3865. /* */
  3866. /******************************************************************************/
  3867. /******************* Bit definition for WWDG_CR register ********************/
  3868. #define WWDG_CR_T ((uint32_t)0x0000007F) /*!< T[6:0] bits (7-Bit counter (MSB to LSB)) */
  3869. #define WWDG_CR_T0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3870. #define WWDG_CR_T1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3871. #define WWDG_CR_T2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3872. #define WWDG_CR_T3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3873. #define WWDG_CR_T4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3874. #define WWDG_CR_T5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3875. #define WWDG_CR_T6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3876. #define WWDG_CR_WDGA ((uint32_t)0x00000080) /*!< Activation bit */
  3877. /******************* Bit definition for WWDG_CFR register *******************/
  3878. #define WWDG_CFR_W ((uint32_t)0x0000007F) /*!< W[6:0] bits (7-bit window value) */
  3879. #define WWDG_CFR_W0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3880. #define WWDG_CFR_W1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3881. #define WWDG_CFR_W2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3882. #define WWDG_CFR_W3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3883. #define WWDG_CFR_W4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3884. #define WWDG_CFR_W5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3885. #define WWDG_CFR_W6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3886. #define WWDG_CFR_WDGTB ((uint32_t)0x00000180) /*!< WDGTB[1:0] bits (Timer Base) */
  3887. #define WWDG_CFR_WDGTB0 ((uint32_t)0x00000080) /*!< Bit 0 */
  3888. #define WWDG_CFR_WDGTB1 ((uint32_t)0x00000100) /*!< Bit 1 */
  3889. #define WWDG_CFR_EWI ((uint32_t)0x00000200) /*!< Early Wakeup Interrupt */
  3890. /******************* Bit definition for WWDG_SR register ********************/
  3891. #define WWDG_SR_EWIF ((uint32_t)0x00000001) /*!< Early Wakeup Interrupt Flag */
  3892. /******************************************************************************/
  3893. /* */
  3894. /* SystemTick (SysTick) */
  3895. /* */
  3896. /******************************************************************************/
  3897. /***************** Bit definition for SysTick_CTRL register *****************/
  3898. #define SysTick_CTRL_ENABLE ((uint32_t)0x00000001) /*!< Counter enable */
  3899. #define SysTick_CTRL_TICKINT ((uint32_t)0x00000002) /*!< Counting down to 0 pends the SysTick handler */
  3900. #define SysTick_CTRL_CLKSOURCE ((uint32_t)0x00000004) /*!< Clock source */
  3901. #define SysTick_CTRL_COUNTFLAG ((uint32_t)0x00010000) /*!< Count Flag */
  3902. /***************** Bit definition for SysTick_LOAD register *****************/
  3903. #define SysTick_LOAD_RELOAD ((uint32_t)0x00FFFFFF) /*!< Value to load into the SysTick Current Value Register when the counter reaches 0 */
  3904. /***************** Bit definition for SysTick_VAL register ******************/
  3905. #define SysTick_VAL_CURRENT ((uint32_t)0x00FFFFFF) /*!< Current value at the time the register is accessed */
  3906. /***************** Bit definition for SysTick_CALIB register ****************/
  3907. #define SysTick_CALIB_TENMS ((uint32_t)0x00FFFFFF) /*!< Reload value to use for 10ms timing */
  3908. #define SysTick_CALIB_SKEW ((uint32_t)0x40000000) /*!< Calibration value is not exactly 10 ms */
  3909. #define SysTick_CALIB_NOREF ((uint32_t)0x80000000) /*!< The reference clock is not provided */
  3910. /******************************************************************************/
  3911. /* */
  3912. /* Nested Vectored Interrupt Controller (NVIC) */
  3913. /* */
  3914. /******************************************************************************/
  3915. /****************** Bit definition for NVIC_ISER register *******************/
  3916. #define NVIC_ISER_SETENA ((uint32_t)0xFFFFFFFF) /*!< Interrupt set enable bits */
  3917. #define NVIC_ISER_SETENA_0 ((uint32_t)0x00000001) /*!< bit 0 */
  3918. #define NVIC_ISER_SETENA_1 ((uint32_t)0x00000002) /*!< bit 1 */
  3919. #define NVIC_ISER_SETENA_2 ((uint32_t)0x00000004) /*!< bit 2 */
  3920. #define NVIC_ISER_SETENA_3 ((uint32_t)0x00000008) /*!< bit 3 */
  3921. #define NVIC_ISER_SETENA_4 ((uint32_t)0x00000010) /*!< bit 4 */
  3922. #define NVIC_ISER_SETENA_5 ((uint32_t)0x00000020) /*!< bit 5 */
  3923. #define NVIC_ISER_SETENA_6 ((uint32_t)0x00000040) /*!< bit 6 */
  3924. #define NVIC_ISER_SETENA_7 ((uint32_t)0x00000080) /*!< bit 7 */
  3925. #define NVIC_ISER_SETENA_8 ((uint32_t)0x00000100) /*!< bit 8 */
  3926. #define NVIC_ISER_SETENA_9 ((uint32_t)0x00000200) /*!< bit 9 */
  3927. #define NVIC_ISER_SETENA_10 ((uint32_t)0x00000400) /*!< bit 10 */
  3928. #define NVIC_ISER_SETENA_11 ((uint32_t)0x00000800) /*!< bit 11 */
  3929. #define NVIC_ISER_SETENA_12 ((uint32_t)0x00001000) /*!< bit 12 */
  3930. #define NVIC_ISER_SETENA_13 ((uint32_t)0x00002000) /*!< bit 13 */
  3931. #define NVIC_ISER_SETENA_14 ((uint32_t)0x00004000) /*!< bit 14 */
  3932. #define NVIC_ISER_SETENA_15 ((uint32_t)0x00008000) /*!< bit 15 */
  3933. #define NVIC_ISER_SETENA_16 ((uint32_t)0x00010000) /*!< bit 16 */
  3934. #define NVIC_ISER_SETENA_17 ((uint32_t)0x00020000) /*!< bit 17 */
  3935. #define NVIC_ISER_SETENA_18 ((uint32_t)0x00040000) /*!< bit 18 */
  3936. #define NVIC_ISER_SETENA_19 ((uint32_t)0x00080000) /*!< bit 19 */
  3937. #define NVIC_ISER_SETENA_20 ((uint32_t)0x00100000) /*!< bit 20 */
  3938. #define NVIC_ISER_SETENA_21 ((uint32_t)0x00200000) /*!< bit 21 */
  3939. #define NVIC_ISER_SETENA_22 ((uint32_t)0x00400000) /*!< bit 22 */
  3940. #define NVIC_ISER_SETENA_23 ((uint32_t)0x00800000) /*!< bit 23 */
  3941. #define NVIC_ISER_SETENA_24 ((uint32_t)0x01000000) /*!< bit 24 */
  3942. #define NVIC_ISER_SETENA_25 ((uint32_t)0x02000000) /*!< bit 25 */
  3943. #define NVIC_ISER_SETENA_26 ((uint32_t)0x04000000) /*!< bit 26 */
  3944. #define NVIC_ISER_SETENA_27 ((uint32_t)0x08000000) /*!< bit 27 */
  3945. #define NVIC_ISER_SETENA_28 ((uint32_t)0x10000000) /*!< bit 28 */
  3946. #define NVIC_ISER_SETENA_29 ((uint32_t)0x20000000) /*!< bit 29 */
  3947. #define NVIC_ISER_SETENA_30 ((uint32_t)0x40000000) /*!< bit 30 */
  3948. #define NVIC_ISER_SETENA_31 ((uint32_t)0x80000000) /*!< bit 31 */
  3949. /****************** Bit definition for NVIC_ICER register *******************/
  3950. #define NVIC_ICER_CLRENA ((uint32_t)0xFFFFFFFF) /*!< Interrupt clear-enable bits */
  3951. #define NVIC_ICER_CLRENA_0 ((uint32_t)0x00000001) /*!< bit 0 */
  3952. #define NVIC_ICER_CLRENA_1 ((uint32_t)0x00000002) /*!< bit 1 */
  3953. #define NVIC_ICER_CLRENA_2 ((uint32_t)0x00000004) /*!< bit 2 */
  3954. #define NVIC_ICER_CLRENA_3 ((uint32_t)0x00000008) /*!< bit 3 */
  3955. #define NVIC_ICER_CLRENA_4 ((uint32_t)0x00000010) /*!< bit 4 */
  3956. #define NVIC_ICER_CLRENA_5 ((uint32_t)0x00000020) /*!< bit 5 */
  3957. #define NVIC_ICER_CLRENA_6 ((uint32_t)0x00000040) /*!< bit 6 */
  3958. #define NVIC_ICER_CLRENA_7 ((uint32_t)0x00000080) /*!< bit 7 */
  3959. #define NVIC_ICER_CLRENA_8 ((uint32_t)0x00000100) /*!< bit 8 */
  3960. #define NVIC_ICER_CLRENA_9 ((uint32_t)0x00000200) /*!< bit 9 */
  3961. #define NVIC_ICER_CLRENA_10 ((uint32_t)0x00000400) /*!< bit 10 */
  3962. #define NVIC_ICER_CLRENA_11 ((uint32_t)0x00000800) /*!< bit 11 */
  3963. #define NVIC_ICER_CLRENA_12 ((uint32_t)0x00001000) /*!< bit 12 */
  3964. #define NVIC_ICER_CLRENA_13 ((uint32_t)0x00002000) /*!< bit 13 */
  3965. #define NVIC_ICER_CLRENA_14 ((uint32_t)0x00004000) /*!< bit 14 */
  3966. #define NVIC_ICER_CLRENA_15 ((uint32_t)0x00008000) /*!< bit 15 */
  3967. #define NVIC_ICER_CLRENA_16 ((uint32_t)0x00010000) /*!< bit 16 */
  3968. #define NVIC_ICER_CLRENA_17 ((uint32_t)0x00020000) /*!< bit 17 */
  3969. #define NVIC_ICER_CLRENA_18 ((uint32_t)0x00040000) /*!< bit 18 */
  3970. #define NVIC_ICER_CLRENA_19 ((uint32_t)0x00080000) /*!< bit 19 */
  3971. #define NVIC_ICER_CLRENA_20 ((uint32_t)0x00100000) /*!< bit 20 */
  3972. #define NVIC_ICER_CLRENA_21 ((uint32_t)0x00200000) /*!< bit 21 */
  3973. #define NVIC_ICER_CLRENA_22 ((uint32_t)0x00400000) /*!< bit 22 */
  3974. #define NVIC_ICER_CLRENA_23 ((uint32_t)0x00800000) /*!< bit 23 */
  3975. #define NVIC_ICER_CLRENA_24 ((uint32_t)0x01000000) /*!< bit 24 */
  3976. #define NVIC_ICER_CLRENA_25 ((uint32_t)0x02000000) /*!< bit 25 */
  3977. #define NVIC_ICER_CLRENA_26 ((uint32_t)0x04000000) /*!< bit 26 */
  3978. #define NVIC_ICER_CLRENA_27 ((uint32_t)0x08000000) /*!< bit 27 */
  3979. #define NVIC_ICER_CLRENA_28 ((uint32_t)0x10000000) /*!< bit 28 */
  3980. #define NVIC_ICER_CLRENA_29 ((uint32_t)0x20000000) /*!< bit 29 */
  3981. #define NVIC_ICER_CLRENA_30 ((uint32_t)0x40000000) /*!< bit 30 */
  3982. #define NVIC_ICER_CLRENA_31 ((uint32_t)0x80000000) /*!< bit 31 */
  3983. /****************** Bit definition for NVIC_ISPR register *******************/
  3984. #define NVIC_ISPR_SETPEND ((uint32_t)0xFFFFFFFF) /*!< Interrupt set-pending bits */
  3985. #define NVIC_ISPR_SETPEND_0 ((uint32_t)0x00000001) /*!< bit 0 */
  3986. #define NVIC_ISPR_SETPEND_1 ((uint32_t)0x00000002) /*!< bit 1 */
  3987. #define NVIC_ISPR_SETPEND_2 ((uint32_t)0x00000004) /*!< bit 2 */
  3988. #define NVIC_ISPR_SETPEND_3 ((uint32_t)0x00000008) /*!< bit 3 */
  3989. #define NVIC_ISPR_SETPEND_4 ((uint32_t)0x00000010) /*!< bit 4 */
  3990. #define NVIC_ISPR_SETPEND_5 ((uint32_t)0x00000020) /*!< bit 5 */
  3991. #define NVIC_ISPR_SETPEND_6 ((uint32_t)0x00000040) /*!< bit 6 */
  3992. #define NVIC_ISPR_SETPEND_7 ((uint32_t)0x00000080) /*!< bit 7 */
  3993. #define NVIC_ISPR_SETPEND_8 ((uint32_t)0x00000100) /*!< bit 8 */
  3994. #define NVIC_ISPR_SETPEND_9 ((uint32_t)0x00000200) /*!< bit 9 */
  3995. #define NVIC_ISPR_SETPEND_10 ((uint32_t)0x00000400) /*!< bit 10 */
  3996. #define NVIC_ISPR_SETPEND_11 ((uint32_t)0x00000800) /*!< bit 11 */
  3997. #define NVIC_ISPR_SETPEND_12 ((uint32_t)0x00001000) /*!< bit 12 */
  3998. #define NVIC_ISPR_SETPEND_13 ((uint32_t)0x00002000) /*!< bit 13 */
  3999. #define NVIC_ISPR_SETPEND_14 ((uint32_t)0x00004000) /*!< bit 14 */
  4000. #define NVIC_ISPR_SETPEND_15 ((uint32_t)0x00008000) /*!< bit 15 */
  4001. #define NVIC_ISPR_SETPEND_16 ((uint32_t)0x00010000) /*!< bit 16 */
  4002. #define NVIC_ISPR_SETPEND_17 ((uint32_t)0x00020000) /*!< bit 17 */
  4003. #define NVIC_ISPR_SETPEND_18 ((uint32_t)0x00040000) /*!< bit 18 */
  4004. #define NVIC_ISPR_SETPEND_19 ((uint32_t)0x00080000) /*!< bit 19 */
  4005. #define NVIC_ISPR_SETPEND_20 ((uint32_t)0x00100000) /*!< bit 20 */
  4006. #define NVIC_ISPR_SETPEND_21 ((uint32_t)0x00200000) /*!< bit 21 */
  4007. #define NVIC_ISPR_SETPEND_22 ((uint32_t)0x00400000) /*!< bit 22 */
  4008. #define NVIC_ISPR_SETPEND_23 ((uint32_t)0x00800000) /*!< bit 23 */
  4009. #define NVIC_ISPR_SETPEND_24 ((uint32_t)0x01000000) /*!< bit 24 */
  4010. #define NVIC_ISPR_SETPEND_25 ((uint32_t)0x02000000) /*!< bit 25 */
  4011. #define NVIC_ISPR_SETPEND_26 ((uint32_t)0x04000000) /*!< bit 26 */
  4012. #define NVIC_ISPR_SETPEND_27 ((uint32_t)0x08000000) /*!< bit 27 */
  4013. #define NVIC_ISPR_SETPEND_28 ((uint32_t)0x10000000) /*!< bit 28 */
  4014. #define NVIC_ISPR_SETPEND_29 ((uint32_t)0x20000000) /*!< bit 29 */
  4015. #define NVIC_ISPR_SETPEND_30 ((uint32_t)0x40000000) /*!< bit 30 */
  4016. #define NVIC_ISPR_SETPEND_31 ((uint32_t)0x80000000) /*!< bit 31 */
  4017. /****************** Bit definition for NVIC_ICPR register *******************/
  4018. #define NVIC_ICPR_CLRPEND ((uint32_t)0xFFFFFFFF) /*!< Interrupt clear-pending bits */
  4019. #define NVIC_ICPR_CLRPEND_0 ((uint32_t)0x00000001) /*!< bit 0 */
  4020. #define NVIC_ICPR_CLRPEND_1 ((uint32_t)0x00000002) /*!< bit 1 */
  4021. #define NVIC_ICPR_CLRPEND_2 ((uint32_t)0x00000004) /*!< bit 2 */
  4022. #define NVIC_ICPR_CLRPEND_3 ((uint32_t)0x00000008) /*!< bit 3 */
  4023. #define NVIC_ICPR_CLRPEND_4 ((uint32_t)0x00000010) /*!< bit 4 */
  4024. #define NVIC_ICPR_CLRPEND_5 ((uint32_t)0x00000020) /*!< bit 5 */
  4025. #define NVIC_ICPR_CLRPEND_6 ((uint32_t)0x00000040) /*!< bit 6 */
  4026. #define NVIC_ICPR_CLRPEND_7 ((uint32_t)0x00000080) /*!< bit 7 */
  4027. #define NVIC_ICPR_CLRPEND_8 ((uint32_t)0x00000100) /*!< bit 8 */
  4028. #define NVIC_ICPR_CLRPEND_9 ((uint32_t)0x00000200) /*!< bit 9 */
  4029. #define NVIC_ICPR_CLRPEND_10 ((uint32_t)0x00000400) /*!< bit 10 */
  4030. #define NVIC_ICPR_CLRPEND_11 ((uint32_t)0x00000800) /*!< bit 11 */
  4031. #define NVIC_ICPR_CLRPEND_12 ((uint32_t)0x00001000) /*!< bit 12 */
  4032. #define NVIC_ICPR_CLRPEND_13 ((uint32_t)0x00002000) /*!< bit 13 */
  4033. #define NVIC_ICPR_CLRPEND_14 ((uint32_t)0x00004000) /*!< bit 14 */
  4034. #define NVIC_ICPR_CLRPEND_15 ((uint32_t)0x00008000) /*!< bit 15 */
  4035. #define NVIC_ICPR_CLRPEND_16 ((uint32_t)0x00010000) /*!< bit 16 */
  4036. #define NVIC_ICPR_CLRPEND_17 ((uint32_t)0x00020000) /*!< bit 17 */
  4037. #define NVIC_ICPR_CLRPEND_18 ((uint32_t)0x00040000) /*!< bit 18 */
  4038. #define NVIC_ICPR_CLRPEND_19 ((uint32_t)0x00080000) /*!< bit 19 */
  4039. #define NVIC_ICPR_CLRPEND_20 ((uint32_t)0x00100000) /*!< bit 20 */
  4040. #define NVIC_ICPR_CLRPEND_21 ((uint32_t)0x00200000) /*!< bit 21 */
  4041. #define NVIC_ICPR_CLRPEND_22 ((uint32_t)0x00400000) /*!< bit 22 */
  4042. #define NVIC_ICPR_CLRPEND_23 ((uint32_t)0x00800000) /*!< bit 23 */
  4043. #define NVIC_ICPR_CLRPEND_24 ((uint32_t)0x01000000) /*!< bit 24 */
  4044. #define NVIC_ICPR_CLRPEND_25 ((uint32_t)0x02000000) /*!< bit 25 */
  4045. #define NVIC_ICPR_CLRPEND_26 ((uint32_t)0x04000000) /*!< bit 26 */
  4046. #define NVIC_ICPR_CLRPEND_27 ((uint32_t)0x08000000) /*!< bit 27 */
  4047. #define NVIC_ICPR_CLRPEND_28 ((uint32_t)0x10000000) /*!< bit 28 */
  4048. #define NVIC_ICPR_CLRPEND_29 ((uint32_t)0x20000000) /*!< bit 29 */
  4049. #define NVIC_ICPR_CLRPEND_30 ((uint32_t)0x40000000) /*!< bit 30 */
  4050. #define NVIC_ICPR_CLRPEND_31 ((uint32_t)0x80000000) /*!< bit 31 */
  4051. /****************** Bit definition for NVIC_IABR register *******************/
  4052. #define NVIC_IABR_ACTIVE ((uint32_t)0xFFFFFFFF) /*!< Interrupt active flags */
  4053. #define NVIC_IABR_ACTIVE_0 ((uint32_t)0x00000001) /*!< bit 0 */
  4054. #define NVIC_IABR_ACTIVE_1 ((uint32_t)0x00000002) /*!< bit 1 */
  4055. #define NVIC_IABR_ACTIVE_2 ((uint32_t)0x00000004) /*!< bit 2 */
  4056. #define NVIC_IABR_ACTIVE_3 ((uint32_t)0x00000008) /*!< bit 3 */
  4057. #define NVIC_IABR_ACTIVE_4 ((uint32_t)0x00000010) /*!< bit 4 */
  4058. #define NVIC_IABR_ACTIVE_5 ((uint32_t)0x00000020) /*!< bit 5 */
  4059. #define NVIC_IABR_ACTIVE_6 ((uint32_t)0x00000040) /*!< bit 6 */
  4060. #define NVIC_IABR_ACTIVE_7 ((uint32_t)0x00000080) /*!< bit 7 */
  4061. #define NVIC_IABR_ACTIVE_8 ((uint32_t)0x00000100) /*!< bit 8 */
  4062. #define NVIC_IABR_ACTIVE_9 ((uint32_t)0x00000200) /*!< bit 9 */
  4063. #define NVIC_IABR_ACTIVE_10 ((uint32_t)0x00000400) /*!< bit 10 */
  4064. #define NVIC_IABR_ACTIVE_11 ((uint32_t)0x00000800) /*!< bit 11 */
  4065. #define NVIC_IABR_ACTIVE_12 ((uint32_t)0x00001000) /*!< bit 12 */
  4066. #define NVIC_IABR_ACTIVE_13 ((uint32_t)0x00002000) /*!< bit 13 */
  4067. #define NVIC_IABR_ACTIVE_14 ((uint32_t)0x00004000) /*!< bit 14 */
  4068. #define NVIC_IABR_ACTIVE_15 ((uint32_t)0x00008000) /*!< bit 15 */
  4069. #define NVIC_IABR_ACTIVE_16 ((uint32_t)0x00010000) /*!< bit 16 */
  4070. #define NVIC_IABR_ACTIVE_17 ((uint32_t)0x00020000) /*!< bit 17 */
  4071. #define NVIC_IABR_ACTIVE_18 ((uint32_t)0x00040000) /*!< bit 18 */
  4072. #define NVIC_IABR_ACTIVE_19 ((uint32_t)0x00080000) /*!< bit 19 */
  4073. #define NVIC_IABR_ACTIVE_20 ((uint32_t)0x00100000) /*!< bit 20 */
  4074. #define NVIC_IABR_ACTIVE_21 ((uint32_t)0x00200000) /*!< bit 21 */
  4075. #define NVIC_IABR_ACTIVE_22 ((uint32_t)0x00400000) /*!< bit 22 */
  4076. #define NVIC_IABR_ACTIVE_23 ((uint32_t)0x00800000) /*!< bit 23 */
  4077. #define NVIC_IABR_ACTIVE_24 ((uint32_t)0x01000000) /*!< bit 24 */
  4078. #define NVIC_IABR_ACTIVE_25 ((uint32_t)0x02000000) /*!< bit 25 */
  4079. #define NVIC_IABR_ACTIVE_26 ((uint32_t)0x04000000) /*!< bit 26 */
  4080. #define NVIC_IABR_ACTIVE_27 ((uint32_t)0x08000000) /*!< bit 27 */
  4081. #define NVIC_IABR_ACTIVE_28 ((uint32_t)0x10000000) /*!< bit 28 */
  4082. #define NVIC_IABR_ACTIVE_29 ((uint32_t)0x20000000) /*!< bit 29 */
  4083. #define NVIC_IABR_ACTIVE_30 ((uint32_t)0x40000000) /*!< bit 30 */
  4084. #define NVIC_IABR_ACTIVE_31 ((uint32_t)0x80000000) /*!< bit 31 */
  4085. /****************** Bit definition for NVIC_PRI0 register *******************/
  4086. #define NVIC_IPR0_PRI_0 ((uint32_t)0x000000FF) /*!< Priority of interrupt 0 */
  4087. #define NVIC_IPR0_PRI_1 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 1 */
  4088. #define NVIC_IPR0_PRI_2 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 2 */
  4089. #define NVIC_IPR0_PRI_3 ((uint32_t)0xFF000000) /*!< Priority of interrupt 3 */
  4090. /****************** Bit definition for NVIC_PRI1 register *******************/
  4091. #define NVIC_IPR1_PRI_4 ((uint32_t)0x000000FF) /*!< Priority of interrupt 4 */
  4092. #define NVIC_IPR1_PRI_5 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 5 */
  4093. #define NVIC_IPR1_PRI_6 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 6 */
  4094. #define NVIC_IPR1_PRI_7 ((uint32_t)0xFF000000) /*!< Priority of interrupt 7 */
  4095. /****************** Bit definition for NVIC_PRI2 register *******************/
  4096. #define NVIC_IPR2_PRI_8 ((uint32_t)0x000000FF) /*!< Priority of interrupt 8 */
  4097. #define NVIC_IPR2_PRI_9 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 9 */
  4098. #define NVIC_IPR2_PRI_10 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 10 */
  4099. #define NVIC_IPR2_PRI_11 ((uint32_t)0xFF000000) /*!< Priority of interrupt 11 */
  4100. /****************** Bit definition for NVIC_PRI3 register *******************/
  4101. #define NVIC_IPR3_PRI_12 ((uint32_t)0x000000FF) /*!< Priority of interrupt 12 */
  4102. #define NVIC_IPR3_PRI_13 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 13 */
  4103. #define NVIC_IPR3_PRI_14 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 14 */
  4104. #define NVIC_IPR3_PRI_15 ((uint32_t)0xFF000000) /*!< Priority of interrupt 15 */
  4105. /****************** Bit definition for NVIC_PRI4 register *******************/
  4106. #define NVIC_IPR4_PRI_16 ((uint32_t)0x000000FF) /*!< Priority of interrupt 16 */
  4107. #define NVIC_IPR4_PRI_17 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 17 */
  4108. #define NVIC_IPR4_PRI_18 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 18 */
  4109. #define NVIC_IPR4_PRI_19 ((uint32_t)0xFF000000) /*!< Priority of interrupt 19 */
  4110. /****************** Bit definition for NVIC_PRI5 register *******************/
  4111. #define NVIC_IPR5_PRI_20 ((uint32_t)0x000000FF) /*!< Priority of interrupt 20 */
  4112. #define NVIC_IPR5_PRI_21 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 21 */
  4113. #define NVIC_IPR5_PRI_22 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 22 */
  4114. #define NVIC_IPR5_PRI_23 ((uint32_t)0xFF000000) /*!< Priority of interrupt 23 */
  4115. /****************** Bit definition for NVIC_PRI6 register *******************/
  4116. #define NVIC_IPR6_PRI_24 ((uint32_t)0x000000FF) /*!< Priority of interrupt 24 */
  4117. #define NVIC_IPR6_PRI_25 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 25 */
  4118. #define NVIC_IPR6_PRI_26 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 26 */
  4119. #define NVIC_IPR6_PRI_27 ((uint32_t)0xFF000000) /*!< Priority of interrupt 27 */
  4120. /****************** Bit definition for NVIC_PRI7 register *******************/
  4121. #define NVIC_IPR7_PRI_28 ((uint32_t)0x000000FF) /*!< Priority of interrupt 28 */
  4122. #define NVIC_IPR7_PRI_29 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 29 */
  4123. #define NVIC_IPR7_PRI_30 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 30 */
  4124. #define NVIC_IPR7_PRI_31 ((uint32_t)0xFF000000) /*!< Priority of interrupt 31 */
  4125. /****************** Bit definition for SCB_CPUID register *******************/
  4126. #define SCB_CPUID_REVISION ((uint32_t)0x0000000F) /*!< Implementation defined revision number */
  4127. #define SCB_CPUID_PARTNO ((uint32_t)0x0000FFF0) /*!< Number of processor within family */
  4128. #define SCB_CPUID_Constant ((uint32_t)0x000F0000) /*!< Reads as 0x0F */
  4129. #define SCB_CPUID_VARIANT ((uint32_t)0x00F00000) /*!< Implementation defined variant number */
  4130. #define SCB_CPUID_IMPLEMENTER ((uint32_t)0xFF000000) /*!< Implementer code. ARM is 0x41 */
  4131. /******************* Bit definition for SCB_ICSR register *******************/
  4132. #define SCB_ICSR_VECTACTIVE ((uint32_t)0x000001FF) /*!< Active ISR number field */
  4133. #define SCB_ICSR_RETTOBASE ((uint32_t)0x00000800) /*!< All active exceptions minus the IPSR_current_exception yields the empty set */
  4134. #define SCB_ICSR_VECTPENDING ((uint32_t)0x003FF000) /*!< Pending ISR number field */
  4135. #define SCB_ICSR_ISRPENDING ((uint32_t)0x00400000) /*!< Interrupt pending flag */
  4136. #define SCB_ICSR_ISRPREEMPT ((uint32_t)0x00800000) /*!< It indicates that a pending interrupt becomes active in the next running cycle */
  4137. #define SCB_ICSR_PENDSTCLR ((uint32_t)0x02000000) /*!< Clear pending SysTick bit */
  4138. #define SCB_ICSR_PENDSTSET ((uint32_t)0x04000000) /*!< Set pending SysTick bit */
  4139. #define SCB_ICSR_PENDSVCLR ((uint32_t)0x08000000) /*!< Clear pending pendSV bit */
  4140. #define SCB_ICSR_PENDSVSET ((uint32_t)0x10000000) /*!< Set pending pendSV bit */
  4141. #define SCB_ICSR_NMIPENDSET ((uint32_t)0x80000000) /*!< Set pending NMI bit */
  4142. /******************* Bit definition for SCB_VTOR register *******************/
  4143. #define SCB_VTOR_TBLOFF ((uint32_t)0x1FFFFF80) /*!< Vector table base offset field */
  4144. #define SCB_VTOR_TBLBASE ((uint32_t)0x20000000) /*!< Table base in code(0) or RAM(1) */
  4145. /*!<***************** Bit definition for SCB_AIRCR register *******************/
  4146. #define SCB_AIRCR_VECTRESET ((uint32_t)0x00000001) /*!< System Reset bit */
  4147. #define SCB_AIRCR_VECTCLRACTIVE ((uint32_t)0x00000002) /*!< Clear active vector bit */
  4148. #define SCB_AIRCR_SYSRESETREQ ((uint32_t)0x00000004) /*!< Requests chip control logic to generate a reset */
  4149. #define SCB_AIRCR_PRIGROUP ((uint32_t)0x00000700) /*!< PRIGROUP[2:0] bits (Priority group) */
  4150. #define SCB_AIRCR_PRIGROUP_0 ((uint32_t)0x00000100) /*!< Bit 0 */
  4151. #define SCB_AIRCR_PRIGROUP_1 ((uint32_t)0x00000200) /*!< Bit 1 */
  4152. #define SCB_AIRCR_PRIGROUP_2 ((uint32_t)0x00000400) /*!< Bit 2 */
  4153. /* prority group configuration */
  4154. #define SCB_AIRCR_PRIGROUP0 ((uint32_t)0x00000000) /*!< Priority group=0 (7 bits of pre-emption priority, 1 bit of subpriority) */
  4155. #define SCB_AIRCR_PRIGROUP1 ((uint32_t)0x00000100) /*!< Priority group=1 (6 bits of pre-emption priority, 2 bits of subpriority) */
  4156. #define SCB_AIRCR_PRIGROUP2 ((uint32_t)0x00000200) /*!< Priority group=2 (5 bits of pre-emption priority, 3 bits of subpriority) */
  4157. #define SCB_AIRCR_PRIGROUP3 ((uint32_t)0x00000300) /*!< Priority group=3 (4 bits of pre-emption priority, 4 bits of subpriority) */
  4158. #define SCB_AIRCR_PRIGROUP4 ((uint32_t)0x00000400) /*!< Priority group=4 (3 bits of pre-emption priority, 5 bits of subpriority) */
  4159. #define SCB_AIRCR_PRIGROUP5 ((uint32_t)0x00000500) /*!< Priority group=5 (2 bits of pre-emption priority, 6 bits of subpriority) */
  4160. #define SCB_AIRCR_PRIGROUP6 ((uint32_t)0x00000600) /*!< Priority group=6 (1 bit of pre-emption priority, 7 bits of subpriority) */
  4161. #define SCB_AIRCR_PRIGROUP7 ((uint32_t)0x00000700) /*!< Priority group=7 (no pre-emption priority, 8 bits of subpriority) */
  4162. #define SCB_AIRCR_ENDIANESS ((uint32_t)0x00008000) /*!< Data endianness bit */
  4163. #define SCB_AIRCR_VECTKEY ((uint32_t)0xFFFF0000) /*!< Register key (VECTKEY) - Reads as 0xFA05 (VECTKEYSTAT) */
  4164. /******************* Bit definition for SCB_SCR register ********************/
  4165. #define SCB_SCR_SLEEPONEXIT ((uint32_t)0x00000002) /*!< Sleep on exit bit */
  4166. #define SCB_SCR_SLEEPDEEP ((uint32_t)0x00000004) /*!< Sleep deep bit */
  4167. #define SCB_SCR_SEVONPEND ((uint32_t)0x00000010) /*!< Wake up from WFE */
  4168. /******************** Bit definition for SCB_CCR register *******************/
  4169. #define SCB_CCR_NONBASETHRDENA ((uint32_t)0x00000001) /*!< Thread mode can be entered from any level in Handler mode by controlled return value */
  4170. #define SCB_CCR_USERSETMPEND ((uint32_t)0x00000002) /*!< Enables user code to write the Software Trigger Interrupt register to trigger (pend) a Main exception */
  4171. #define SCB_CCR_UNALIGN_TRP ((uint32_t)0x00000008) /*!< Trap for unaligned access */
  4172. #define SCB_CCR_DIV_0_TRP ((uint32_t)0x00000010) /*!< Trap on Divide by 0 */
  4173. #define SCB_CCR_BFHFNMIGN ((uint32_t)0x00000100) /*!< Handlers running at priority -1 and -2 */
  4174. #define SCB_CCR_STKALIGN ((uint32_t)0x00000200) /*!< On exception entry, the SP used prior to the exception is adjusted to be 8-byte aligned */
  4175. /******************* Bit definition for SCB_SHPR register ********************/
  4176. #define SCB_SHPR_PRI_N ((uint32_t)0x000000FF) /*!< Priority of system handler 4,8, and 12. Mem Manage, reserved and Debug Monitor */
  4177. #define SCB_SHPR_PRI_N1 ((uint32_t)0x0000FF00) /*!< Priority of system handler 5,9, and 13. Bus Fault, reserved and reserved */
  4178. #define SCB_SHPR_PRI_N2 ((uint32_t)0x00FF0000) /*!< Priority of system handler 6,10, and 14. Usage Fault, reserved and PendSV */
  4179. #define SCB_SHPR_PRI_N3 ((uint32_t)0xFF000000) /*!< Priority of system handler 7,11, and 15. Reserved, SVCall and SysTick */
  4180. /****************** Bit definition for SCB_SHCSR register *******************/
  4181. #define SCB_SHCSR_MEMFAULTACT ((uint32_t)0x00000001) /*!< MemManage is active */
  4182. #define SCB_SHCSR_BUSFAULTACT ((uint32_t)0x00000002) /*!< BusFault is active */
  4183. #define SCB_SHCSR_USGFAULTACT ((uint32_t)0x00000008) /*!< UsageFault is active */
  4184. #define SCB_SHCSR_SVCALLACT ((uint32_t)0x00000080) /*!< SVCall is active */
  4185. #define SCB_SHCSR_MONITORACT ((uint32_t)0x00000100) /*!< Monitor is active */
  4186. #define SCB_SHCSR_PENDSVACT ((uint32_t)0x00000400) /*!< PendSV is active */
  4187. #define SCB_SHCSR_SYSTICKACT ((uint32_t)0x00000800) /*!< SysTick is active */
  4188. #define SCB_SHCSR_USGFAULTPENDED ((uint32_t)0x00001000) /*!< Usage Fault is pended */
  4189. #define SCB_SHCSR_MEMFAULTPENDED ((uint32_t)0x00002000) /*!< MemManage is pended */
  4190. #define SCB_SHCSR_BUSFAULTPENDED ((uint32_t)0x00004000) /*!< Bus Fault is pended */
  4191. #define SCB_SHCSR_SVCALLPENDED ((uint32_t)0x00008000) /*!< SVCall is pended */
  4192. #define SCB_SHCSR_MEMFAULTENA ((uint32_t)0x00010000) /*!< MemManage enable */
  4193. #define SCB_SHCSR_BUSFAULTENA ((uint32_t)0x00020000) /*!< Bus Fault enable */
  4194. #define SCB_SHCSR_USGFAULTENA ((uint32_t)0x00040000) /*!< UsageFault enable */
  4195. /******************* Bit definition for SCB_CFSR register *******************/
  4196. /*!< MFSR */
  4197. #define SCB_CFSR_IACCVIOL ((uint32_t)0x00000001) /*!< Instruction access violation */
  4198. #define SCB_CFSR_DACCVIOL ((uint32_t)0x00000002) /*!< Data access violation */
  4199. #define SCB_CFSR_MUNSTKERR ((uint32_t)0x00000008) /*!< Unstacking error */
  4200. #define SCB_CFSR_MSTKERR ((uint32_t)0x00000010) /*!< Stacking error */
  4201. #define SCB_CFSR_MMARVALID ((uint32_t)0x00000080) /*!< Memory Manage Address Register address valid flag */
  4202. /*!< BFSR */
  4203. #define SCB_CFSR_IBUSERR ((uint32_t)0x00000100) /*!< Instruction bus error flag */
  4204. #define SCB_CFSR_PRECISERR ((uint32_t)0x00000200) /*!< Precise data bus error */
  4205. #define SCB_CFSR_IMPRECISERR ((uint32_t)0x00000400) /*!< Imprecise data bus error */
  4206. #define SCB_CFSR_UNSTKERR ((uint32_t)0x00000800) /*!< Unstacking error */
  4207. #define SCB_CFSR_STKERR ((uint32_t)0x00001000) /*!< Stacking error */
  4208. #define SCB_CFSR_BFARVALID ((uint32_t)0x00008000) /*!< Bus Fault Address Register address valid flag */
  4209. /*!< UFSR */
  4210. #define SCB_CFSR_UNDEFINSTR ((uint32_t)0x00010000) /*!< The processor attempt to excecute an undefined instruction */
  4211. #define SCB_CFSR_INVSTATE ((uint32_t)0x00020000) /*!< Invalid combination of EPSR and instruction */
  4212. #define SCB_CFSR_INVPC ((uint32_t)0x00040000) /*!< Attempt to load EXC_RETURN into pc illegally */
  4213. #define SCB_CFSR_NOCP ((uint32_t)0x00080000) /*!< Attempt to use a coprocessor instruction */
  4214. #define SCB_CFSR_UNALIGNED ((uint32_t)0x01000000) /*!< Fault occurs when there is an attempt to make an unaligned memory access */
  4215. #define SCB_CFSR_DIVBYZERO ((uint32_t)0x02000000) /*!< Fault occurs when SDIV or DIV instruction is used with a divisor of 0 */
  4216. /******************* Bit definition for SCB_HFSR register *******************/
  4217. #define SCB_HFSR_VECTTBL ((uint32_t)0x00000002) /*!< Fault occures because of vector table read on exception processing */
  4218. #define SCB_HFSR_FORCED ((uint32_t)0x40000000) /*!< Hard Fault activated when a configurable Fault was received and cannot activate */
  4219. #define SCB_HFSR_DEBUGEVT ((uint32_t)0x80000000) /*!< Fault related to debug */
  4220. /******************* Bit definition for SCB_DFSR register *******************/
  4221. #define SCB_DFSR_HALTED ((uint32_t)0x00000001) /*!< Halt request flag */
  4222. #define SCB_DFSR_BKPT ((uint32_t)0x00000002) /*!< BKPT flag */
  4223. #define SCB_DFSR_DWTTRAP ((uint32_t)0x00000004) /*!< Data Watchpoint and Trace (DWT) flag */
  4224. #define SCB_DFSR_VCATCH ((uint32_t)0x00000008) /*!< Vector catch flag */
  4225. #define SCB_DFSR_EXTERNAL ((uint32_t)0x00000010) /*!< External debug request flag */
  4226. /******************* Bit definition for SCB_MMFAR register ******************/
  4227. #define SCB_MMFAR_ADDRESS ((uint32_t)0xFFFFFFFF) /*!< Mem Manage fault address field */
  4228. /******************* Bit definition for SCB_BFAR register *******************/
  4229. #define SCB_BFAR_ADDRESS ((uint32_t)0xFFFFFFFF) /*!< Bus fault address field */
  4230. /******************* Bit definition for SCB_afsr register *******************/
  4231. #define SCB_AFSR_IMPDEF ((uint32_t)0xFFFFFFFF) /*!< Implementation defined */
  4232. /**
  4233. * @}
  4234. */
  4235. /**
  4236. * @}
  4237. */
  4238. /** @addtogroup Exported_macro
  4239. * @{
  4240. */
  4241. /****************************** ADC Instances *********************************/
  4242. #define IS_ADC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == ADC1)
  4243. /******************************** COMP Instances ******************************/
  4244. #define IS_COMP_ALL_INSTANCE(INSTANCE) (((INSTANCE) == COMP1) || \
  4245. ((INSTANCE) == COMP2))
  4246. /****************************** CRC Instances *********************************/
  4247. #define IS_CRC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CRC)
  4248. /****************************** DAC Instances *********************************/
  4249. #define IS_DAC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == DAC)
  4250. /****************************** DMA Instances *********************************/
  4251. #define IS_DMA_ALL_INSTANCE(INSTANCE) (((INSTANCE) == DMA1_Channel1) || \
  4252. ((INSTANCE) == DMA1_Channel2) || \
  4253. ((INSTANCE) == DMA1_Channel3) || \
  4254. ((INSTANCE) == DMA1_Channel4) || \
  4255. ((INSTANCE) == DMA1_Channel5) || \
  4256. ((INSTANCE) == DMA1_Channel6) || \
  4257. ((INSTANCE) == DMA1_Channel7))
  4258. /******************************* GPIO Instances *******************************/
  4259. #define IS_GPIO_ALL_INSTANCE(INSTANCE) (((INSTANCE) == GPIOA) || \
  4260. ((INSTANCE) == GPIOB) || \
  4261. ((INSTANCE) == GPIOC) || \
  4262. ((INSTANCE) == GPIOD) || \
  4263. ((INSTANCE) == GPIOH))
  4264. /**************************** GPIO Lock Instances *****************************/
  4265. /* On L1, all GPIO Bank support the Lock mechanism */
  4266. #define IS_GPIO_LOCK_INSTANCE(INSTANCE) IS_GPIO_ALL_INSTANCE(INSTANCE)
  4267. /******************************** I2C Instances *******************************/
  4268. #define IS_I2C_ALL_INSTANCE(INSTANCE) (((INSTANCE) == I2C1) || \
  4269. ((INSTANCE) == I2C2))
  4270. /****************************** IWDG Instances ********************************/
  4271. #define IS_IWDG_ALL_INSTANCE(INSTANCE) ((INSTANCE) == IWDG)
  4272. /****************************** RTC Instances *********************************/
  4273. #define IS_RTC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == RTC)
  4274. /******************************** SPI Instances *******************************/
  4275. #define IS_SPI_ALL_INSTANCE(INSTANCE) (((INSTANCE) == SPI1) || \
  4276. ((INSTANCE) == SPI2))
  4277. /****************************** TIM Instances *********************************/
  4278. #define IS_TIM_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4279. ((INSTANCE) == TIM3) || \
  4280. ((INSTANCE) == TIM4) || \
  4281. ((INSTANCE) == TIM6) || \
  4282. ((INSTANCE) == TIM7) || \
  4283. ((INSTANCE) == TIM9) || \
  4284. ((INSTANCE) == TIM10) || \
  4285. ((INSTANCE) == TIM11))
  4286. #define IS_TIM_CC1_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4287. ((INSTANCE) == TIM3) || \
  4288. ((INSTANCE) == TIM4) || \
  4289. ((INSTANCE) == TIM9) || \
  4290. ((INSTANCE) == TIM10) || \
  4291. ((INSTANCE) == TIM11))
  4292. #define IS_TIM_CC2_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4293. ((INSTANCE) == TIM3) || \
  4294. ((INSTANCE) == TIM4) || \
  4295. ((INSTANCE) == TIM9))
  4296. #define IS_TIM_CC3_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4297. ((INSTANCE) == TIM3) || \
  4298. ((INSTANCE) == TIM4))
  4299. #define IS_TIM_CC4_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4300. ((INSTANCE) == TIM3) || \
  4301. ((INSTANCE) == TIM4))
  4302. #define IS_TIM_CLOCKSOURCE_ETRMODE1_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4303. ((INSTANCE) == TIM3) || \
  4304. ((INSTANCE) == TIM4) || \
  4305. ((INSTANCE) == TIM9))
  4306. #define IS_TIM_CLOCKSOURCE_ETRMODE2_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4307. ((INSTANCE) == TIM3) || \
  4308. ((INSTANCE) == TIM4) || \
  4309. ((INSTANCE) == TIM9) || \
  4310. ((INSTANCE) == TIM10) || \
  4311. ((INSTANCE) == TIM11))
  4312. #define IS_TIM_CLOCKSOURCE_TIX_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4313. ((INSTANCE) == TIM3) || \
  4314. ((INSTANCE) == TIM4) || \
  4315. ((INSTANCE) == TIM9))
  4316. #define IS_TIM_CLOCKSOURCE_ITRX_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4317. ((INSTANCE) == TIM3) || \
  4318. ((INSTANCE) == TIM4) || \
  4319. ((INSTANCE) == TIM9))
  4320. #define IS_TIM_OCXREF_CLEAR_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4321. ((INSTANCE) == TIM3) || \
  4322. ((INSTANCE) == TIM4))
  4323. #define IS_TIM_XOR_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4324. ((INSTANCE) == TIM3) || \
  4325. ((INSTANCE) == TIM4))
  4326. #define IS_TIM_MASTER_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4327. ((INSTANCE) == TIM3) || \
  4328. ((INSTANCE) == TIM4) || \
  4329. ((INSTANCE) == TIM6) || \
  4330. ((INSTANCE) == TIM7) || \
  4331. ((INSTANCE) == TIM9))
  4332. #define IS_TIM_SLAVE_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4333. ((INSTANCE) == TIM3) || \
  4334. ((INSTANCE) == TIM4) || \
  4335. ((INSTANCE) == TIM9))
  4336. #define IS_TIM_DMABURST_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4337. ((INSTANCE) == TIM3) || \
  4338. ((INSTANCE) == TIM4))
  4339. #define IS_TIM_CCX_INSTANCE(INSTANCE, CHANNEL) \
  4340. ((((INSTANCE) == TIM2) && \
  4341. (((CHANNEL) == TIM_CHANNEL_1) || \
  4342. ((CHANNEL) == TIM_CHANNEL_2) || \
  4343. ((CHANNEL) == TIM_CHANNEL_3) || \
  4344. ((CHANNEL) == TIM_CHANNEL_4))) \
  4345. || \
  4346. (((INSTANCE) == TIM3) && \
  4347. (((CHANNEL) == TIM_CHANNEL_1) || \
  4348. ((CHANNEL) == TIM_CHANNEL_2) || \
  4349. ((CHANNEL) == TIM_CHANNEL_3) || \
  4350. ((CHANNEL) == TIM_CHANNEL_4))) \
  4351. || \
  4352. (((INSTANCE) == TIM4) && \
  4353. (((CHANNEL) == TIM_CHANNEL_1) || \
  4354. ((CHANNEL) == TIM_CHANNEL_2) || \
  4355. ((CHANNEL) == TIM_CHANNEL_3) || \
  4356. ((CHANNEL) == TIM_CHANNEL_4))) \
  4357. || \
  4358. (((INSTANCE) == TIM9) && \
  4359. (((CHANNEL) == TIM_CHANNEL_1) || \
  4360. ((CHANNEL) == TIM_CHANNEL_2))) \
  4361. || \
  4362. (((INSTANCE) == TIM10) && \
  4363. (((CHANNEL) == TIM_CHANNEL_1))) \
  4364. || \
  4365. (((INSTANCE) == TIM11) && \
  4366. (((CHANNEL) == TIM_CHANNEL_1))))
  4367. #define IS_TIM_CLOCK_DIVISION_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4368. ((INSTANCE) == TIM3) || \
  4369. ((INSTANCE) == TIM4) || \
  4370. ((INSTANCE) == TIM9) || \
  4371. ((INSTANCE) == TIM10) || \
  4372. ((INSTANCE) == TIM11))
  4373. #define IS_TIM_DMA_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4374. ((INSTANCE) == TIM3) || \
  4375. ((INSTANCE) == TIM4) || \
  4376. ((INSTANCE) == TIM6) || \
  4377. ((INSTANCE) == TIM7))
  4378. #define IS_TIM_DMA_CC_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4379. ((INSTANCE) == TIM3) || \
  4380. ((INSTANCE) == TIM4))
  4381. #define IS_TIM_COUNTER_MODE_SELECT_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4382. ((INSTANCE) == TIM3) || \
  4383. ((INSTANCE) == TIM4))
  4384. #define IS_TIM_ENCODER_INTERFACE_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  4385. ((INSTANCE) == TIM3) || \
  4386. ((INSTANCE) == TIM4))
  4387. #define IS_TIM_REMAP_INSTANCE(INSTANCE) (((INSTANCE) == TIM9) || \
  4388. ((INSTANCE) == TIM10) || \
  4389. ((INSTANCE) == TIM11))
  4390. /******************** USART Instances : Synchronous mode **********************/
  4391. #define IS_USART_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  4392. ((INSTANCE) == USART2) || \
  4393. ((INSTANCE) == USART3))
  4394. /******************** UART Instances : Asynchronous mode **********************/
  4395. #define IS_UART_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  4396. ((INSTANCE) == USART2) || \
  4397. ((INSTANCE) == USART3))
  4398. /******************** UART Instances : Half-Duplex mode **********************/
  4399. #define IS_UART_HALFDUPLEX_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  4400. ((INSTANCE) == USART2) || \
  4401. ((INSTANCE) == USART3))
  4402. /******************** UART Instances : LIN mode **********************/
  4403. #define IS_UART_LIN_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  4404. ((INSTANCE) == USART2) || \
  4405. ((INSTANCE) == USART3))
  4406. /****************** UART Instances : Hardware Flow control ********************/
  4407. #define IS_UART_HWFLOW_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  4408. ((INSTANCE) == USART2) || \
  4409. ((INSTANCE) == USART3))
  4410. /********************* UART Instances : Smard card mode ***********************/
  4411. #define IS_SMARTCARD_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  4412. ((INSTANCE) == USART2) || \
  4413. ((INSTANCE) == USART3))
  4414. /*********************** UART Instances : IRDA mode ***************************/
  4415. #define IS_IRDA_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  4416. ((INSTANCE) == USART2) || \
  4417. ((INSTANCE) == USART3))
  4418. /***************** UART Instances : Multi-Processor mode **********************/
  4419. #define IS_UART_MULTIPROCESSOR_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  4420. ((INSTANCE) == USART2) || \
  4421. ((INSTANCE) == USART3))
  4422. /****************************** WWDG Instances ********************************/
  4423. #define IS_WWDG_ALL_INSTANCE(INSTANCE) ((INSTANCE) == WWDG)
  4424. /****************************** LCD Instances ********************************/
  4425. #define IS_LCD_ALL_INSTANCE(INSTANCE) ((INSTANCE) == LCD)
  4426. /****************************** USB Instances ********************************/
  4427. #define IS_USB_ALL_INSTANCE(INSTANCE) ((INSTANCE) == USB)
  4428. /**
  4429. * @}
  4430. */
  4431. /******************************************************************************/
  4432. /* For a painless codes migration between the STM32L1xx device product */
  4433. /* lines, the aliases defined below are put in place to overcome the */
  4434. /* differences in the interrupt handlers and IRQn definitions. */
  4435. /* No need to update developed interrupt code when moving across */
  4436. /* product lines within the same STM32L1 Family */
  4437. /******************************************************************************/
  4438. /* Aliases for __IRQn */
  4439. /* Aliases for __IRQHandler */
  4440. /**
  4441. * @}
  4442. */
  4443. /**
  4444. * @}
  4445. */
  4446. #ifdef __cplusplus
  4447. }
  4448. #endif /* __cplusplus */
  4449. #endif /* __STM32L100xBA_H */
  4450. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/