stm32f072xb.h 451 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992
  1. /**
  2. ******************************************************************************
  3. * @file stm32f072xb.h
  4. * @author MCD Application Team
  5. * @version V2.2.3
  6. * @date 29-January-2016
  7. * @brief CMSIS Cortex-M0 Device Peripheral Access Layer Header File.
  8. * This file contains all the peripheral register's definitions, bits
  9. * definitions and memory mapping for STM32F0xx 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) 2016 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 stm32f072xb
  49. * @{
  50. */
  51. #ifndef __STM32F072xB_H
  52. #define __STM32F072xB_H
  53. #ifdef __cplusplus
  54. extern "C" {
  55. #endif /* __cplusplus */
  56. /** @addtogroup Configuration_section_for_CMSIS
  57. * @{
  58. */
  59. /**
  60. * @brief Configuration of the Cortex-M0 Processor and Core Peripherals
  61. */
  62. #define __CM0_REV 0 /*!< Core Revision r0p0 */
  63. #define __MPU_PRESENT 0 /*!< STM32F0xx do not provide MPU */
  64. #define __NVIC_PRIO_BITS 2 /*!< STM32F0xx uses 2 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 STM32F0xx 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-M0 Processor Exceptions Numbers **************************************************************/
  80. NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */
  81. HardFault_IRQn = -13, /*!< 3 Cortex-M0 Hard Fault Interrupt */
  82. SVC_IRQn = -5, /*!< 11 Cortex-M0 SV Call Interrupt */
  83. PendSV_IRQn = -2, /*!< 14 Cortex-M0 Pend SV Interrupt */
  84. SysTick_IRQn = -1, /*!< 15 Cortex-M0 System Tick Interrupt */
  85. /****** STM32F0 specific Interrupt Numbers ******************************************************************/
  86. WWDG_IRQn = 0, /*!< Window WatchDog Interrupt */
  87. PVD_VDDIO2_IRQn = 1, /*!< PVD & VDDIO2 Interrupt through EXTI Lines 16 and 31 */
  88. RTC_IRQn = 2, /*!< RTC Interrupt through EXTI Lines 17, 19 and 20 */
  89. FLASH_IRQn = 3, /*!< FLASH global Interrupt */
  90. RCC_CRS_IRQn = 4, /*!< RCC & CRS global Interrupt */
  91. EXTI0_1_IRQn = 5, /*!< EXTI Line 0 and 1 Interrupt */
  92. EXTI2_3_IRQn = 6, /*!< EXTI Line 2 and 3 Interrupt */
  93. EXTI4_15_IRQn = 7, /*!< EXTI Line 4 to 15 Interrupt */
  94. TSC_IRQn = 8, /*!< Touch Sensing Controller Interrupts */
  95. DMA1_Channel1_IRQn = 9, /*!< DMA1 Channel 1 Interrupt */
  96. DMA1_Channel2_3_IRQn = 10, /*!< DMA1 Channel 2 and Channel 3 Interrupt */
  97. DMA1_Channel4_5_6_7_IRQn = 11, /*!< DMA1 Channel 4 to Channel 7 Interrupt */
  98. ADC1_COMP_IRQn = 12, /*!< ADC1 and COMP interrupts (ADC interrupt combined with EXTI Lines 21 and 22 */
  99. TIM1_BRK_UP_TRG_COM_IRQn = 13, /*!< TIM1 Break, Update, Trigger and Commutation Interrupt */
  100. TIM1_CC_IRQn = 14, /*!< TIM1 Capture Compare Interrupt */
  101. TIM2_IRQn = 15, /*!< TIM2 global Interrupt */
  102. TIM3_IRQn = 16, /*!< TIM3 global Interrupt */
  103. TIM6_DAC_IRQn = 17, /*!< TIM6 global and DAC channel underrun error Interrupt */
  104. TIM7_IRQn = 18, /*!< TIM7 global Interrupt */
  105. TIM14_IRQn = 19, /*!< TIM14 global Interrupt */
  106. TIM15_IRQn = 20, /*!< TIM15 global Interrupt */
  107. TIM16_IRQn = 21, /*!< TIM16 global Interrupt */
  108. TIM17_IRQn = 22, /*!< TIM17 global Interrupt */
  109. I2C1_IRQn = 23, /*!< I2C1 Event Interrupt & EXTI Line23 Interrupt (I2C1 wakeup) */
  110. I2C2_IRQn = 24, /*!< I2C2 Event Interrupt */
  111. SPI1_IRQn = 25, /*!< SPI1 global Interrupt */
  112. SPI2_IRQn = 26, /*!< SPI2 global Interrupt */
  113. USART1_IRQn = 27, /*!< USART1 global Interrupt & EXTI Line25 Interrupt (USART1 wakeup) */
  114. USART2_IRQn = 28, /*!< USART2 global Interrupt & EXTI Line26 Interrupt (USART2 wakeup) */
  115. USART3_4_IRQn = 29, /*!< USART3 and USART4 global Interrupt */
  116. CEC_CAN_IRQn = 30, /*!< CEC and CAN global Interrupts & EXTI Line27 Interrupt */
  117. USB_IRQn = 31 /*!< USB global Interrupt & EXTI Line18 Interrupt */
  118. } IRQn_Type;
  119. /**
  120. * @}
  121. */
  122. #include "core_cm0.h" /* Cortex-M0 processor and core peripherals */
  123. #include "system_stm32f0xx.h" /* STM32F0xx System Header */
  124. #include <stdint.h>
  125. /** @addtogroup Peripheral_registers_structures
  126. * @{
  127. */
  128. /**
  129. * @brief Analog to Digital Converter
  130. */
  131. typedef struct
  132. {
  133. __IO uint32_t ISR; /*!< ADC interrupt and status register, Address offset: 0x00 */
  134. __IO uint32_t IER; /*!< ADC interrupt enable register, Address offset: 0x04 */
  135. __IO uint32_t CR; /*!< ADC control register, Address offset: 0x08 */
  136. __IO uint32_t CFGR1; /*!< ADC configuration register 1, Address offset: 0x0C */
  137. __IO uint32_t CFGR2; /*!< ADC configuration register 2, Address offset: 0x10 */
  138. __IO uint32_t SMPR; /*!< ADC sampling time register, Address offset: 0x14 */
  139. uint32_t RESERVED1; /*!< Reserved, 0x18 */
  140. uint32_t RESERVED2; /*!< Reserved, 0x1C */
  141. __IO uint32_t TR; /*!< ADC analog watchdog 1 threshold register, Address offset: 0x20 */
  142. uint32_t RESERVED3; /*!< Reserved, 0x24 */
  143. __IO uint32_t CHSELR; /*!< ADC group regular sequencer register, Address offset: 0x28 */
  144. uint32_t RESERVED4[5]; /*!< Reserved, 0x2C */
  145. __IO uint32_t DR; /*!< ADC group regular data register, Address offset: 0x40 */
  146. } ADC_TypeDef;
  147. typedef struct
  148. {
  149. __IO uint32_t CCR; /*!< ADC common configuration register, Address offset: ADC1 base address + 0x308 */
  150. } ADC_Common_TypeDef;
  151. /**
  152. * @brief Controller Area Network TxMailBox
  153. */
  154. typedef struct
  155. {
  156. __IO uint32_t TIR; /*!< CAN TX mailbox identifier register */
  157. __IO uint32_t TDTR; /*!< CAN mailbox data length control and time stamp register */
  158. __IO uint32_t TDLR; /*!< CAN mailbox data low register */
  159. __IO uint32_t TDHR; /*!< CAN mailbox data high register */
  160. }CAN_TxMailBox_TypeDef;
  161. /**
  162. * @brief Controller Area Network FIFOMailBox
  163. */
  164. typedef struct
  165. {
  166. __IO uint32_t RIR; /*!< CAN receive FIFO mailbox identifier register */
  167. __IO uint32_t RDTR; /*!< CAN receive FIFO mailbox data length control and time stamp register */
  168. __IO uint32_t RDLR; /*!< CAN receive FIFO mailbox data low register */
  169. __IO uint32_t RDHR; /*!< CAN receive FIFO mailbox data high register */
  170. }CAN_FIFOMailBox_TypeDef;
  171. /**
  172. * @brief Controller Area Network FilterRegister
  173. */
  174. typedef struct
  175. {
  176. __IO uint32_t FR1; /*!< CAN Filter bank register 1 */
  177. __IO uint32_t FR2; /*!< CAN Filter bank register 1 */
  178. }CAN_FilterRegister_TypeDef;
  179. /**
  180. * @brief Controller Area Network
  181. */
  182. typedef struct
  183. {
  184. __IO uint32_t MCR; /*!< CAN master control register, Address offset: 0x00 */
  185. __IO uint32_t MSR; /*!< CAN master status register, Address offset: 0x04 */
  186. __IO uint32_t TSR; /*!< CAN transmit status register, Address offset: 0x08 */
  187. __IO uint32_t RF0R; /*!< CAN receive FIFO 0 register, Address offset: 0x0C */
  188. __IO uint32_t RF1R; /*!< CAN receive FIFO 1 register, Address offset: 0x10 */
  189. __IO uint32_t IER; /*!< CAN interrupt enable register, Address offset: 0x14 */
  190. __IO uint32_t ESR; /*!< CAN error status register, Address offset: 0x18 */
  191. __IO uint32_t BTR; /*!< CAN bit timing register, Address offset: 0x1C */
  192. uint32_t RESERVED0[88]; /*!< Reserved, 0x020 - 0x17F */
  193. CAN_TxMailBox_TypeDef sTxMailBox[3]; /*!< CAN Tx MailBox, Address offset: 0x180 - 0x1AC */
  194. CAN_FIFOMailBox_TypeDef sFIFOMailBox[2]; /*!< CAN FIFO MailBox, Address offset: 0x1B0 - 0x1CC */
  195. uint32_t RESERVED1[12]; /*!< Reserved, 0x1D0 - 0x1FF */
  196. __IO uint32_t FMR; /*!< CAN filter master register, Address offset: 0x200 */
  197. __IO uint32_t FM1R; /*!< CAN filter mode register, Address offset: 0x204 */
  198. uint32_t RESERVED2; /*!< Reserved, 0x208 */
  199. __IO uint32_t FS1R; /*!< CAN filter scale register, Address offset: 0x20C */
  200. uint32_t RESERVED3; /*!< Reserved, 0x210 */
  201. __IO uint32_t FFA1R; /*!< CAN filter FIFO assignment register, Address offset: 0x214 */
  202. uint32_t RESERVED4; /*!< Reserved, 0x218 */
  203. __IO uint32_t FA1R; /*!< CAN filter activation register, Address offset: 0x21C */
  204. uint32_t RESERVED5[8]; /*!< Reserved, 0x220-0x23F */
  205. CAN_FilterRegister_TypeDef sFilterRegister[28]; /*!< CAN Filter Register, Address offset: 0x240-0x31C */
  206. }CAN_TypeDef;
  207. /**
  208. * @brief HDMI-CEC
  209. */
  210. typedef struct
  211. {
  212. __IO uint32_t CR; /*!< CEC control register, Address offset:0x00 */
  213. __IO uint32_t CFGR; /*!< CEC configuration register, Address offset:0x04 */
  214. __IO uint32_t TXDR; /*!< CEC Tx data register , Address offset:0x08 */
  215. __IO uint32_t RXDR; /*!< CEC Rx Data Register, Address offset:0x0C */
  216. __IO uint32_t ISR; /*!< CEC Interrupt and Status Register, Address offset:0x10 */
  217. __IO uint32_t IER; /*!< CEC interrupt enable register, Address offset:0x14 */
  218. }CEC_TypeDef;
  219. /**
  220. * @brief Comparator
  221. */
  222. typedef struct
  223. {
  224. __IO uint16_t CSR; /*!< COMP control and status register, Address offset: 0x00 */
  225. } COMP_TypeDef;
  226. typedef struct
  227. {
  228. __IO uint32_t CSR; /*!< COMP control and status register, used for bits common to several COMP instances, Address offset: 0x00 */
  229. } COMP_Common_TypeDef;
  230. /* Legacy defines */
  231. typedef struct
  232. {
  233. __IO uint32_t CSR; /*!< Kept for legacy purpose. Use structure 'COMP_Common_TypeDef'. */
  234. }COMP1_2_TypeDef;
  235. /**
  236. * @brief CRC calculation unit
  237. */
  238. typedef struct
  239. {
  240. __IO uint32_t DR; /*!< CRC Data register, Address offset: 0x00 */
  241. __IO uint8_t IDR; /*!< CRC Independent data register, Address offset: 0x04 */
  242. uint8_t RESERVED0; /*!< Reserved, 0x05 */
  243. uint16_t RESERVED1; /*!< Reserved, 0x06 */
  244. __IO uint32_t CR; /*!< CRC Control register, Address offset: 0x08 */
  245. uint32_t RESERVED2; /*!< Reserved, 0x0C */
  246. __IO uint32_t INIT; /*!< Initial CRC value register, Address offset: 0x10 */
  247. __IO uint32_t POL; /*!< CRC polynomial register, Address offset: 0x14 */
  248. } CRC_TypeDef;
  249. /**
  250. * @brief Clock Recovery System
  251. */
  252. typedef struct
  253. {
  254. __IO uint32_t CR; /*!< CRS ccontrol register, Address offset: 0x00 */
  255. __IO uint32_t CFGR; /*!< CRS configuration register, Address offset: 0x04 */
  256. __IO uint32_t ISR; /*!< CRS interrupt and status register, Address offset: 0x08 */
  257. __IO uint32_t ICR; /*!< CRS interrupt flag clear register, Address offset: 0x0C */
  258. }CRS_TypeDef;
  259. /**
  260. * @brief Digital to Analog Converter
  261. */
  262. typedef struct
  263. {
  264. __IO uint32_t CR; /*!< DAC control register, Address offset: 0x00 */
  265. __IO uint32_t SWTRIGR; /*!< DAC software trigger register, Address offset: 0x04 */
  266. __IO uint32_t DHR12R1; /*!< DAC channel1 12-bit right-aligned data holding register, Address offset: 0x08 */
  267. __IO uint32_t DHR12L1; /*!< DAC channel1 12-bit left aligned data holding register, Address offset: 0x0C */
  268. __IO uint32_t DHR8R1; /*!< DAC channel1 8-bit right aligned data holding register, Address offset: 0x10 */
  269. __IO uint32_t DHR12R2; /*!< DAC channel2 12-bit right aligned data holding register, Address offset: 0x14 */
  270. __IO uint32_t DHR12L2; /*!< DAC channel2 12-bit left aligned data holding register, Address offset: 0x18 */
  271. __IO uint32_t DHR8R2; /*!< DAC channel2 8-bit right-aligned data holding register, Address offset: 0x1C */
  272. __IO uint32_t DHR12RD; /*!< Dual DAC 12-bit right-aligned data holding register, Address offset: 0x20 */
  273. __IO uint32_t DHR12LD; /*!< DUAL DAC 12-bit left aligned data holding register, Address offset: 0x24 */
  274. __IO uint32_t DHR8RD; /*!< DUAL DAC 8-bit right aligned data holding register, Address offset: 0x28 */
  275. __IO uint32_t DOR1; /*!< DAC channel1 data output register, Address offset: 0x2C */
  276. __IO uint32_t DOR2; /*!< DAC channel2 data output register, Address offset: 0x30 */
  277. __IO uint32_t SR; /*!< DAC status register, Address offset: 0x34 */
  278. } DAC_TypeDef;
  279. /**
  280. * @brief Debug MCU
  281. */
  282. typedef struct
  283. {
  284. __IO uint32_t IDCODE; /*!< MCU device ID code, Address offset: 0x00 */
  285. __IO uint32_t CR; /*!< Debug MCU configuration register, Address offset: 0x04 */
  286. __IO uint32_t APB1FZ; /*!< Debug MCU APB1 freeze register, Address offset: 0x08 */
  287. __IO uint32_t APB2FZ; /*!< Debug MCU APB2 freeze register, Address offset: 0x0C */
  288. }DBGMCU_TypeDef;
  289. /**
  290. * @brief DMA Controller
  291. */
  292. typedef struct
  293. {
  294. __IO uint32_t CCR; /*!< DMA channel x configuration register */
  295. __IO uint32_t CNDTR; /*!< DMA channel x number of data register */
  296. __IO uint32_t CPAR; /*!< DMA channel x peripheral address register */
  297. __IO uint32_t CMAR; /*!< DMA channel x memory address register */
  298. } DMA_Channel_TypeDef;
  299. typedef struct
  300. {
  301. __IO uint32_t ISR; /*!< DMA interrupt status register, Address offset: 0x00 */
  302. __IO uint32_t IFCR; /*!< DMA interrupt flag clear register, Address offset: 0x04 */
  303. } DMA_TypeDef;
  304. /**
  305. * @brief External Interrupt/Event Controller
  306. */
  307. typedef struct
  308. {
  309. __IO uint32_t IMR; /*!<EXTI Interrupt mask register, Address offset: 0x00 */
  310. __IO uint32_t EMR; /*!<EXTI Event mask register, Address offset: 0x04 */
  311. __IO uint32_t RTSR; /*!<EXTI Rising trigger selection register , Address offset: 0x08 */
  312. __IO uint32_t FTSR; /*!<EXTI Falling trigger selection register, Address offset: 0x0C */
  313. __IO uint32_t SWIER; /*!<EXTI Software interrupt event register, Address offset: 0x10 */
  314. __IO uint32_t PR; /*!<EXTI Pending register, Address offset: 0x14 */
  315. } EXTI_TypeDef;
  316. /**
  317. * @brief FLASH Registers
  318. */
  319. typedef struct
  320. {
  321. __IO uint32_t ACR; /*!<FLASH access control register, Address offset: 0x00 */
  322. __IO uint32_t KEYR; /*!<FLASH key register, Address offset: 0x04 */
  323. __IO uint32_t OPTKEYR; /*!<FLASH OPT key register, Address offset: 0x08 */
  324. __IO uint32_t SR; /*!<FLASH status register, Address offset: 0x0C */
  325. __IO uint32_t CR; /*!<FLASH control register, Address offset: 0x10 */
  326. __IO uint32_t AR; /*!<FLASH address register, Address offset: 0x14 */
  327. __IO uint32_t RESERVED; /*!< Reserved, 0x18 */
  328. __IO uint32_t OBR; /*!<FLASH option bytes register, Address offset: 0x1C */
  329. __IO uint32_t WRPR; /*!<FLASH option bytes register, Address offset: 0x20 */
  330. } FLASH_TypeDef;
  331. /**
  332. * @brief Option Bytes Registers
  333. */
  334. typedef struct
  335. {
  336. __IO uint16_t RDP; /*!< FLASH option byte Read protection, Address offset: 0x00 */
  337. __IO uint16_t USER; /*!< FLASH option byte user options, Address offset: 0x02 */
  338. __IO uint16_t DATA0; /*!< User data byte 0 (stored in FLASH_OBR[23:16]), Address offset: 0x04 */
  339. __IO uint16_t DATA1; /*!< User data byte 1 (stored in FLASH_OBR[31:24]), Address offset: 0x06 */
  340. __IO uint16_t WRP0; /*!< FLASH option byte write protection 0, Address offset: 0x08 */
  341. __IO uint16_t WRP1; /*!< FLASH option byte write protection 1, Address offset: 0x0A */
  342. __IO uint16_t WRP2; /*!< FLASH option byte write protection 2, Address offset: 0x0C */
  343. __IO uint16_t WRP3; /*!< FLASH option byte write protection 3, Address offset: 0x0E */
  344. } OB_TypeDef;
  345. /**
  346. * @brief General Purpose I/O
  347. */
  348. typedef struct
  349. {
  350. __IO uint32_t MODER; /*!< GPIO port mode register, Address offset: 0x00 */
  351. __IO uint32_t OTYPER; /*!< GPIO port output type register, Address offset: 0x04 */
  352. __IO uint32_t OSPEEDR; /*!< GPIO port output speed register, Address offset: 0x08 */
  353. __IO uint32_t PUPDR; /*!< GPIO port pull-up/pull-down register, Address offset: 0x0C */
  354. __IO uint32_t IDR; /*!< GPIO port input data register, Address offset: 0x10 */
  355. __IO uint32_t ODR; /*!< GPIO port output data register, Address offset: 0x14 */
  356. __IO uint32_t BSRR; /*!< GPIO port bit set/reset register, Address offset: 0x1A */
  357. __IO uint32_t LCKR; /*!< GPIO port configuration lock register, Address offset: 0x1C */
  358. __IO uint32_t AFR[2]; /*!< GPIO alternate function low register, Address offset: 0x20-0x24 */
  359. __IO uint32_t BRR; /*!< GPIO bit reset register, Address offset: 0x28 */
  360. } GPIO_TypeDef;
  361. /**
  362. * @brief SysTem Configuration
  363. */
  364. typedef struct
  365. {
  366. __IO uint32_t CFGR1; /*!< SYSCFG configuration register 1, Address offset: 0x00 */
  367. uint32_t RESERVED; /*!< Reserved, 0x04 */
  368. __IO uint32_t EXTICR[4]; /*!< SYSCFG external interrupt configuration register, Address offset: 0x14-0x08 */
  369. __IO uint32_t CFGR2; /*!< SYSCFG configuration register 2, Address offset: 0x18 */
  370. } SYSCFG_TypeDef;
  371. /**
  372. * @brief Inter-integrated Circuit Interface
  373. */
  374. typedef struct
  375. {
  376. __IO uint32_t CR1; /*!< I2C Control register 1, Address offset: 0x00 */
  377. __IO uint32_t CR2; /*!< I2C Control register 2, Address offset: 0x04 */
  378. __IO uint32_t OAR1; /*!< I2C Own address 1 register, Address offset: 0x08 */
  379. __IO uint32_t OAR2; /*!< I2C Own address 2 register, Address offset: 0x0C */
  380. __IO uint32_t TIMINGR; /*!< I2C Timing register, Address offset: 0x10 */
  381. __IO uint32_t TIMEOUTR; /*!< I2C Timeout register, Address offset: 0x14 */
  382. __IO uint32_t ISR; /*!< I2C Interrupt and status register, Address offset: 0x18 */
  383. __IO uint32_t ICR; /*!< I2C Interrupt clear register, Address offset: 0x1C */
  384. __IO uint32_t PECR; /*!< I2C PEC register, Address offset: 0x20 */
  385. __IO uint32_t RXDR; /*!< I2C Receive data register, Address offset: 0x24 */
  386. __IO uint32_t TXDR; /*!< I2C Transmit data register, Address offset: 0x28 */
  387. } I2C_TypeDef;
  388. /**
  389. * @brief Independent WATCHDOG
  390. */
  391. typedef struct
  392. {
  393. __IO uint32_t KR; /*!< IWDG Key register, Address offset: 0x00 */
  394. __IO uint32_t PR; /*!< IWDG Prescaler register, Address offset: 0x04 */
  395. __IO uint32_t RLR; /*!< IWDG Reload register, Address offset: 0x08 */
  396. __IO uint32_t SR; /*!< IWDG Status register, Address offset: 0x0C */
  397. __IO uint32_t WINR; /*!< IWDG Window register, Address offset: 0x10 */
  398. } IWDG_TypeDef;
  399. /**
  400. * @brief Power Control
  401. */
  402. typedef struct
  403. {
  404. __IO uint32_t CR; /*!< PWR power control register, Address offset: 0x00 */
  405. __IO uint32_t CSR; /*!< PWR power control/status register, Address offset: 0x04 */
  406. } PWR_TypeDef;
  407. /**
  408. * @brief Reset and Clock Control
  409. */
  410. typedef struct
  411. {
  412. __IO uint32_t CR; /*!< RCC clock control register, Address offset: 0x00 */
  413. __IO uint32_t CFGR; /*!< RCC clock configuration register, Address offset: 0x04 */
  414. __IO uint32_t CIR; /*!< RCC clock interrupt register, Address offset: 0x08 */
  415. __IO uint32_t APB2RSTR; /*!< RCC APB2 peripheral reset register, Address offset: 0x0C */
  416. __IO uint32_t APB1RSTR; /*!< RCC APB1 peripheral reset register, Address offset: 0x10 */
  417. __IO uint32_t AHBENR; /*!< RCC AHB peripheral clock register, Address offset: 0x14 */
  418. __IO uint32_t APB2ENR; /*!< RCC APB2 peripheral clock enable register, Address offset: 0x18 */
  419. __IO uint32_t APB1ENR; /*!< RCC APB1 peripheral clock enable register, Address offset: 0x1C */
  420. __IO uint32_t BDCR; /*!< RCC Backup domain control register, Address offset: 0x20 */
  421. __IO uint32_t CSR; /*!< RCC clock control & status register, Address offset: 0x24 */
  422. __IO uint32_t AHBRSTR; /*!< RCC AHB peripheral reset register, Address offset: 0x28 */
  423. __IO uint32_t CFGR2; /*!< RCC clock configuration register 2, Address offset: 0x2C */
  424. __IO uint32_t CFGR3; /*!< RCC clock configuration register 3, Address offset: 0x30 */
  425. __IO uint32_t CR2; /*!< RCC clock control register 2, Address offset: 0x34 */
  426. } RCC_TypeDef;
  427. /**
  428. * @brief Real-Time Clock
  429. */
  430. typedef struct
  431. {
  432. __IO uint32_t TR; /*!< RTC time register, Address offset: 0x00 */
  433. __IO uint32_t DR; /*!< RTC date register, Address offset: 0x04 */
  434. __IO uint32_t CR; /*!< RTC control register, Address offset: 0x08 */
  435. __IO uint32_t ISR; /*!< RTC initialization and status register, Address offset: 0x0C */
  436. __IO uint32_t PRER; /*!< RTC prescaler register, Address offset: 0x10 */
  437. __IO uint32_t WUTR; /*!< RTC wakeup timer register, Address offset: 0x14 */
  438. uint32_t RESERVED1; /*!< Reserved, Address offset: 0x18 */
  439. __IO uint32_t ALRMAR; /*!< RTC alarm A register, Address offset: 0x1C */
  440. uint32_t RESERVED2; /*!< Reserved, Address offset: 0x20 */
  441. __IO uint32_t WPR; /*!< RTC write protection register, Address offset: 0x24 */
  442. __IO uint32_t SSR; /*!< RTC sub second register, Address offset: 0x28 */
  443. __IO uint32_t SHIFTR; /*!< RTC shift control register, Address offset: 0x2C */
  444. __IO uint32_t TSTR; /*!< RTC time stamp time register, Address offset: 0x30 */
  445. __IO uint32_t TSDR; /*!< RTC time stamp date register, Address offset: 0x34 */
  446. __IO uint32_t TSSSR; /*!< RTC time-stamp sub second register, Address offset: 0x38 */
  447. __IO uint32_t CALR; /*!< RTC calibration register, Address offset: 0x3C */
  448. __IO uint32_t TAFCR; /*!< RTC tamper and alternate function configuration register, Address offset: 0x40 */
  449. __IO uint32_t ALRMASSR; /*!< RTC alarm A sub second register, Address offset: 0x44 */
  450. uint32_t RESERVED3; /*!< Reserved, Address offset: 0x48 */
  451. uint32_t RESERVED4; /*!< Reserved, Address offset: 0x4C */
  452. __IO uint32_t BKP0R; /*!< RTC backup register 0, Address offset: 0x50 */
  453. __IO uint32_t BKP1R; /*!< RTC backup register 1, Address offset: 0x54 */
  454. __IO uint32_t BKP2R; /*!< RTC backup register 2, Address offset: 0x58 */
  455. __IO uint32_t BKP3R; /*!< RTC backup register 3, Address offset: 0x5C */
  456. __IO uint32_t BKP4R; /*!< RTC backup register 4, Address offset: 0x60 */
  457. } RTC_TypeDef;
  458. /**
  459. * @brief Serial Peripheral Interface
  460. */
  461. typedef struct
  462. {
  463. __IO uint32_t CR1; /*!< SPI Control register 1 (not used in I2S mode), Address offset: 0x00 */
  464. __IO uint32_t CR2; /*!< SPI Control register 2, Address offset: 0x04 */
  465. __IO uint32_t SR; /*!< SPI Status register, Address offset: 0x08 */
  466. __IO uint32_t DR; /*!< SPI data register, Address offset: 0x0C */
  467. __IO uint32_t CRCPR; /*!< SPI CRC polynomial register (not used in I2S mode), Address offset: 0x10 */
  468. __IO uint32_t RXCRCR; /*!< SPI Rx CRC register (not used in I2S mode), Address offset: 0x14 */
  469. __IO uint32_t TXCRCR; /*!< SPI Tx CRC register (not used in I2S mode), Address offset: 0x18 */
  470. __IO uint32_t I2SCFGR; /*!< SPI_I2S configuration register, Address offset: 0x1C */
  471. __IO uint32_t I2SPR; /*!< SPI_I2S prescaler register, Address offset: 0x20 */
  472. } SPI_TypeDef;
  473. /**
  474. * @brief TIM
  475. */
  476. typedef struct
  477. {
  478. __IO uint32_t CR1; /*!< TIM control register 1, Address offset: 0x00 */
  479. __IO uint32_t CR2; /*!< TIM control register 2, Address offset: 0x04 */
  480. __IO uint32_t SMCR; /*!< TIM slave Mode Control register, Address offset: 0x08 */
  481. __IO uint32_t DIER; /*!< TIM DMA/interrupt enable register, Address offset: 0x0C */
  482. __IO uint32_t SR; /*!< TIM status register, Address offset: 0x10 */
  483. __IO uint32_t EGR; /*!< TIM event generation register, Address offset: 0x14 */
  484. __IO uint32_t CCMR1; /*!< TIM capture/compare mode register 1, Address offset: 0x18 */
  485. __IO uint32_t CCMR2; /*!< TIM capture/compare mode register 2, Address offset: 0x1C */
  486. __IO uint32_t CCER; /*!< TIM capture/compare enable register, Address offset: 0x20 */
  487. __IO uint32_t CNT; /*!< TIM counter register, Address offset: 0x24 */
  488. __IO uint32_t PSC; /*!< TIM prescaler register, Address offset: 0x28 */
  489. __IO uint32_t ARR; /*!< TIM auto-reload register, Address offset: 0x2C */
  490. __IO uint32_t RCR; /*!< TIM repetition counter register, Address offset: 0x30 */
  491. __IO uint32_t CCR1; /*!< TIM capture/compare register 1, Address offset: 0x34 */
  492. __IO uint32_t CCR2; /*!< TIM capture/compare register 2, Address offset: 0x38 */
  493. __IO uint32_t CCR3; /*!< TIM capture/compare register 3, Address offset: 0x3C */
  494. __IO uint32_t CCR4; /*!< TIM capture/compare register 4, Address offset: 0x40 */
  495. __IO uint32_t BDTR; /*!< TIM break and dead-time register, Address offset: 0x44 */
  496. __IO uint32_t DCR; /*!< TIM DMA control register, Address offset: 0x48 */
  497. __IO uint32_t DMAR; /*!< TIM DMA address for full transfer register, Address offset: 0x4C */
  498. __IO uint32_t OR; /*!< TIM option register, Address offset: 0x50 */
  499. } TIM_TypeDef;
  500. /**
  501. * @brief Touch Sensing Controller (TSC)
  502. */
  503. typedef struct
  504. {
  505. __IO uint32_t CR; /*!< TSC control register, Address offset: 0x00 */
  506. __IO uint32_t IER; /*!< TSC interrupt enable register, Address offset: 0x04 */
  507. __IO uint32_t ICR; /*!< TSC interrupt clear register, Address offset: 0x08 */
  508. __IO uint32_t ISR; /*!< TSC interrupt status register, Address offset: 0x0C */
  509. __IO uint32_t IOHCR; /*!< TSC I/O hysteresis control register, Address offset: 0x10 */
  510. uint32_t RESERVED1; /*!< Reserved, Address offset: 0x14 */
  511. __IO uint32_t IOASCR; /*!< TSC I/O analog switch control register, Address offset: 0x18 */
  512. uint32_t RESERVED2; /*!< Reserved, Address offset: 0x1C */
  513. __IO uint32_t IOSCR; /*!< TSC I/O sampling control register, Address offset: 0x20 */
  514. uint32_t RESERVED3; /*!< Reserved, Address offset: 0x24 */
  515. __IO uint32_t IOCCR; /*!< TSC I/O channel control register, Address offset: 0x28 */
  516. uint32_t RESERVED4; /*!< Reserved, Address offset: 0x2C */
  517. __IO uint32_t IOGCSR; /*!< TSC I/O group control status register, Address offset: 0x30 */
  518. __IO uint32_t IOGXCR[8]; /*!< TSC I/O group x counter register, Address offset: 0x34-50 */
  519. }TSC_TypeDef;
  520. /**
  521. * @brief Universal Synchronous Asynchronous Receiver Transmitter
  522. */
  523. typedef struct
  524. {
  525. __IO uint32_t CR1; /*!< USART Control register 1, Address offset: 0x00 */
  526. __IO uint32_t CR2; /*!< USART Control register 2, Address offset: 0x04 */
  527. __IO uint32_t CR3; /*!< USART Control register 3, Address offset: 0x08 */
  528. __IO uint32_t BRR; /*!< USART Baud rate register, Address offset: 0x0C */
  529. __IO uint32_t GTPR; /*!< USART Guard time and prescaler register, Address offset: 0x10 */
  530. __IO uint32_t RTOR; /*!< USART Receiver Time Out register, Address offset: 0x14 */
  531. __IO uint32_t RQR; /*!< USART Request register, Address offset: 0x18 */
  532. __IO uint32_t ISR; /*!< USART Interrupt and status register, Address offset: 0x1C */
  533. __IO uint32_t ICR; /*!< USART Interrupt flag Clear register, Address offset: 0x20 */
  534. __IO uint16_t RDR; /*!< USART Receive Data register, Address offset: 0x24 */
  535. uint16_t RESERVED1; /*!< Reserved, 0x26 */
  536. __IO uint16_t TDR; /*!< USART Transmit Data register, Address offset: 0x28 */
  537. uint16_t RESERVED2; /*!< Reserved, 0x2A */
  538. } USART_TypeDef;
  539. /**
  540. * @brief Universal Serial Bus Full Speed Device
  541. */
  542. typedef struct
  543. {
  544. __IO uint16_t EP0R; /*!< USB Endpoint 0 register, Address offset: 0x00 */
  545. __IO uint16_t RESERVED0; /*!< Reserved */
  546. __IO uint16_t EP1R; /*!< USB Endpoint 1 register, Address offset: 0x04 */
  547. __IO uint16_t RESERVED1; /*!< Reserved */
  548. __IO uint16_t EP2R; /*!< USB Endpoint 2 register, Address offset: 0x08 */
  549. __IO uint16_t RESERVED2; /*!< Reserved */
  550. __IO uint16_t EP3R; /*!< USB Endpoint 3 register, Address offset: 0x0C */
  551. __IO uint16_t RESERVED3; /*!< Reserved */
  552. __IO uint16_t EP4R; /*!< USB Endpoint 4 register, Address offset: 0x10 */
  553. __IO uint16_t RESERVED4; /*!< Reserved */
  554. __IO uint16_t EP5R; /*!< USB Endpoint 5 register, Address offset: 0x14 */
  555. __IO uint16_t RESERVED5; /*!< Reserved */
  556. __IO uint16_t EP6R; /*!< USB Endpoint 6 register, Address offset: 0x18 */
  557. __IO uint16_t RESERVED6; /*!< Reserved */
  558. __IO uint16_t EP7R; /*!< USB Endpoint 7 register, Address offset: 0x1C */
  559. __IO uint16_t RESERVED7[17]; /*!< Reserved */
  560. __IO uint16_t CNTR; /*!< Control register, Address offset: 0x40 */
  561. __IO uint16_t RESERVED8; /*!< Reserved */
  562. __IO uint16_t ISTR; /*!< Interrupt status register, Address offset: 0x44 */
  563. __IO uint16_t RESERVED9; /*!< Reserved */
  564. __IO uint16_t FNR; /*!< Frame number register, Address offset: 0x48 */
  565. __IO uint16_t RESERVEDA; /*!< Reserved */
  566. __IO uint16_t DADDR; /*!< Device address register, Address offset: 0x4C */
  567. __IO uint16_t RESERVEDB; /*!< Reserved */
  568. __IO uint16_t BTABLE; /*!< Buffer Table address register, Address offset: 0x50 */
  569. __IO uint16_t RESERVEDC; /*!< Reserved */
  570. __IO uint16_t LPMCSR; /*!< LPM Control and Status register, Address offset: 0x54 */
  571. __IO uint16_t RESERVEDD; /*!< Reserved */
  572. __IO uint16_t BCDR; /*!< Battery Charging detector register, Address offset: 0x58 */
  573. __IO uint16_t RESERVEDE; /*!< Reserved */
  574. } USB_TypeDef;
  575. /**
  576. * @brief Window WATCHDOG
  577. */
  578. typedef struct
  579. {
  580. __IO uint32_t CR; /*!< WWDG Control register, Address offset: 0x00 */
  581. __IO uint32_t CFR; /*!< WWDG Configuration register, Address offset: 0x04 */
  582. __IO uint32_t SR; /*!< WWDG Status register, Address offset: 0x08 */
  583. } WWDG_TypeDef;
  584. /**
  585. * @}
  586. */
  587. /** @addtogroup Peripheral_memory_map
  588. * @{
  589. */
  590. #define FLASH_BASE ((uint32_t)0x08000000U) /*!< FLASH base address in the alias region */
  591. #define FLASH_BANK1_END ((uint32_t)0x0801FFFFU) /*!< FLASH END address of bank1 */
  592. #define SRAM_BASE ((uint32_t)0x20000000U) /*!< SRAM base address in the alias region */
  593. #define PERIPH_BASE ((uint32_t)0x40000000U) /*!< Peripheral base address in the alias region */
  594. /*!< Peripheral memory map */
  595. #define APBPERIPH_BASE PERIPH_BASE
  596. #define AHBPERIPH_BASE (PERIPH_BASE + 0x00020000)
  597. #define AHB2PERIPH_BASE (PERIPH_BASE + 0x08000000)
  598. /*!< APB peripherals */
  599. #define TIM2_BASE (APBPERIPH_BASE + 0x00000000)
  600. #define TIM3_BASE (APBPERIPH_BASE + 0x00000400)
  601. #define TIM6_BASE (APBPERIPH_BASE + 0x00001000)
  602. #define TIM7_BASE (APBPERIPH_BASE + 0x00001400)
  603. #define TIM14_BASE (APBPERIPH_BASE + 0x00002000)
  604. #define RTC_BASE (APBPERIPH_BASE + 0x00002800)
  605. #define WWDG_BASE (APBPERIPH_BASE + 0x00002C00)
  606. #define IWDG_BASE (APBPERIPH_BASE + 0x00003000)
  607. #define SPI2_BASE (APBPERIPH_BASE + 0x00003800)
  608. #define USART2_BASE (APBPERIPH_BASE + 0x00004400)
  609. #define USART3_BASE (APBPERIPH_BASE + 0x00004800)
  610. #define USART4_BASE (APBPERIPH_BASE + 0x00004C00)
  611. #define I2C1_BASE (APBPERIPH_BASE + 0x00005400)
  612. #define I2C2_BASE (APBPERIPH_BASE + 0x00005800)
  613. #define USB_BASE (APBPERIPH_BASE + 0x00005C00) /*!< USB_IP Peripheral Registers base address */
  614. #define USB_PMAADDR (APBPERIPH_BASE + 0x00006000) /*!< USB_IP Packet Memory Area base address */
  615. #define CAN_BASE (APBPERIPH_BASE + 0x00006400)
  616. #define CRS_BASE (APBPERIPH_BASE + 0x00006C00)
  617. #define PWR_BASE (APBPERIPH_BASE + 0x00007000)
  618. #define DAC_BASE (APBPERIPH_BASE + 0x00007400)
  619. #define CEC_BASE (APBPERIPH_BASE + 0x00007800)
  620. #define SYSCFG_BASE (APBPERIPH_BASE + 0x00010000)
  621. #define COMP_BASE (APBPERIPH_BASE + 0x0001001C)
  622. #define EXTI_BASE (APBPERIPH_BASE + 0x00010400)
  623. #define ADC1_BASE (APBPERIPH_BASE + 0x00012400)
  624. #define ADC_BASE (APBPERIPH_BASE + 0x00012708)
  625. #define TIM1_BASE (APBPERIPH_BASE + 0x00012C00)
  626. #define SPI1_BASE (APBPERIPH_BASE + 0x00013000)
  627. #define USART1_BASE (APBPERIPH_BASE + 0x00013800)
  628. #define TIM15_BASE (APBPERIPH_BASE + 0x00014000)
  629. #define TIM16_BASE (APBPERIPH_BASE + 0x00014400)
  630. #define TIM17_BASE (APBPERIPH_BASE + 0x00014800)
  631. #define DBGMCU_BASE (APBPERIPH_BASE + 0x00015800)
  632. /*!< AHB peripherals */
  633. #define DMA1_BASE (AHBPERIPH_BASE + 0x00000000)
  634. #define DMA1_Channel1_BASE (DMA1_BASE + 0x00000008)
  635. #define DMA1_Channel2_BASE (DMA1_BASE + 0x0000001C)
  636. #define DMA1_Channel3_BASE (DMA1_BASE + 0x00000030)
  637. #define DMA1_Channel4_BASE (DMA1_BASE + 0x00000044)
  638. #define DMA1_Channel5_BASE (DMA1_BASE + 0x00000058)
  639. #define DMA1_Channel6_BASE (DMA1_BASE + 0x0000006C)
  640. #define DMA1_Channel7_BASE (DMA1_BASE + 0x00000080)
  641. #define RCC_BASE (AHBPERIPH_BASE + 0x00001000)
  642. #define FLASH_R_BASE (AHBPERIPH_BASE + 0x00002000) /*!< FLASH registers base address */
  643. #define OB_BASE ((uint32_t)0x1FFFF800U) /*!< FLASH Option Bytes base address */
  644. #define FLASHSIZE_BASE ((uint32_t)0x1FFFF7CCU) /*!< FLASH Size register base address */
  645. #define UID_BASE ((uint32_t)0x1FFFF7ACU) /*!< Unique device ID register base address */
  646. #define CRC_BASE (AHBPERIPH_BASE + 0x00003000)
  647. #define TSC_BASE (AHBPERIPH_BASE + 0x00004000)
  648. /*!< AHB2 peripherals */
  649. #define GPIOA_BASE (AHB2PERIPH_BASE + 0x00000000)
  650. #define GPIOB_BASE (AHB2PERIPH_BASE + 0x00000400)
  651. #define GPIOC_BASE (AHB2PERIPH_BASE + 0x00000800)
  652. #define GPIOD_BASE (AHB2PERIPH_BASE + 0x00000C00)
  653. #define GPIOE_BASE (AHB2PERIPH_BASE + 0x00001000)
  654. #define GPIOF_BASE (AHB2PERIPH_BASE + 0x00001400)
  655. /**
  656. * @}
  657. */
  658. /** @addtogroup Peripheral_declaration
  659. * @{
  660. */
  661. #define TIM2 ((TIM_TypeDef *) TIM2_BASE)
  662. #define TIM3 ((TIM_TypeDef *) TIM3_BASE)
  663. #define TIM6 ((TIM_TypeDef *) TIM6_BASE)
  664. #define TIM7 ((TIM_TypeDef *) TIM7_BASE)
  665. #define TIM14 ((TIM_TypeDef *) TIM14_BASE)
  666. #define RTC ((RTC_TypeDef *) RTC_BASE)
  667. #define WWDG ((WWDG_TypeDef *) WWDG_BASE)
  668. #define IWDG ((IWDG_TypeDef *) IWDG_BASE)
  669. #define USART2 ((USART_TypeDef *) USART2_BASE)
  670. #define USART3 ((USART_TypeDef *) USART3_BASE)
  671. #define USART4 ((USART_TypeDef *) USART4_BASE)
  672. #define I2C1 ((I2C_TypeDef *) I2C1_BASE)
  673. #define I2C2 ((I2C_TypeDef *) I2C2_BASE)
  674. #define CAN ((CAN_TypeDef *) CAN_BASE)
  675. #define CRS ((CRS_TypeDef *) CRS_BASE)
  676. #define PWR ((PWR_TypeDef *) PWR_BASE)
  677. #define DAC1 ((DAC_TypeDef *) DAC_BASE)
  678. #define DAC ((DAC_TypeDef *) DAC_BASE) /* Kept for legacy purpose */
  679. #define CEC ((CEC_TypeDef *) CEC_BASE)
  680. #define SYSCFG ((SYSCFG_TypeDef *) SYSCFG_BASE)
  681. #define COMP1 ((COMP_TypeDef *) COMP_BASE)
  682. #define COMP2 ((COMP_TypeDef *) (COMP_BASE + 0x00000002))
  683. #define COMP12_COMMON ((COMP_Common_TypeDef *) COMP_BASE)
  684. #define COMP ((COMP1_2_TypeDef *) COMP_BASE) /* Kept for legacy purpose */
  685. #define EXTI ((EXTI_TypeDef *) EXTI_BASE)
  686. #define ADC1 ((ADC_TypeDef *) ADC1_BASE)
  687. #define ADC1_COMMON ((ADC_Common_TypeDef *) ADC_BASE)
  688. #define ADC ((ADC_Common_TypeDef *) ADC_BASE) /* Kept for legacy purpose */
  689. #define TIM1 ((TIM_TypeDef *) TIM1_BASE)
  690. #define SPI1 ((SPI_TypeDef *) SPI1_BASE)
  691. #define SPI2 ((SPI_TypeDef *) SPI2_BASE)
  692. #define USART1 ((USART_TypeDef *) USART1_BASE)
  693. #define TIM15 ((TIM_TypeDef *) TIM15_BASE)
  694. #define TIM16 ((TIM_TypeDef *) TIM16_BASE)
  695. #define TIM17 ((TIM_TypeDef *) TIM17_BASE)
  696. #define DBGMCU ((DBGMCU_TypeDef *) DBGMCU_BASE)
  697. #define DMA1 ((DMA_TypeDef *) DMA1_BASE)
  698. #define DMA1_Channel1 ((DMA_Channel_TypeDef *) DMA1_Channel1_BASE)
  699. #define DMA1_Channel2 ((DMA_Channel_TypeDef *) DMA1_Channel2_BASE)
  700. #define DMA1_Channel3 ((DMA_Channel_TypeDef *) DMA1_Channel3_BASE)
  701. #define DMA1_Channel4 ((DMA_Channel_TypeDef *) DMA1_Channel4_BASE)
  702. #define DMA1_Channel5 ((DMA_Channel_TypeDef *) DMA1_Channel5_BASE)
  703. #define DMA1_Channel6 ((DMA_Channel_TypeDef *) DMA1_Channel6_BASE)
  704. #define DMA1_Channel7 ((DMA_Channel_TypeDef *) DMA1_Channel7_BASE)
  705. #define FLASH ((FLASH_TypeDef *) FLASH_R_BASE)
  706. #define OB ((OB_TypeDef *) OB_BASE)
  707. #define RCC ((RCC_TypeDef *) RCC_BASE)
  708. #define CRC ((CRC_TypeDef *) CRC_BASE)
  709. #define TSC ((TSC_TypeDef *) TSC_BASE)
  710. #define GPIOA ((GPIO_TypeDef *) GPIOA_BASE)
  711. #define GPIOB ((GPIO_TypeDef *) GPIOB_BASE)
  712. #define GPIOC ((GPIO_TypeDef *) GPIOC_BASE)
  713. #define GPIOD ((GPIO_TypeDef *) GPIOD_BASE)
  714. #define GPIOE ((GPIO_TypeDef *) GPIOE_BASE)
  715. #define GPIOF ((GPIO_TypeDef *) GPIOF_BASE)
  716. #define USB ((USB_TypeDef *) USB_BASE)
  717. /**
  718. * @}
  719. */
  720. /** @addtogroup Exported_constants
  721. * @{
  722. */
  723. /** @addtogroup Peripheral_Registers_Bits_Definition
  724. * @{
  725. */
  726. /******************************************************************************/
  727. /* Peripheral Registers Bits Definition */
  728. /******************************************************************************/
  729. /******************************************************************************/
  730. /* */
  731. /* Analog to Digital Converter (ADC) */
  732. /* */
  733. /******************************************************************************/
  734. /*
  735. * @brief Specific device feature definitions (not present on all devices in the STM32F0 family)
  736. */
  737. #define ADC_CHANNEL_VBAT_SUPPORT /*!< ADC feature available only on specific devices: ADC internal channel Vbat */
  738. /******************** Bits definition for ADC_ISR register ******************/
  739. #define ADC_ISR_ADRDY ((uint32_t)0x00000001U) /*!< ADC ready flag */
  740. #define ADC_ISR_EOSMP ((uint32_t)0x00000002U) /*!< ADC group regular end of sampling flag */
  741. #define ADC_ISR_EOC ((uint32_t)0x00000004U) /*!< ADC group regular end of unitary conversion flag */
  742. #define ADC_ISR_EOS ((uint32_t)0x00000008U) /*!< ADC group regular end of sequence conversions flag */
  743. #define ADC_ISR_OVR ((uint32_t)0x00000010U) /*!< ADC group regular overrun flag */
  744. #define ADC_ISR_AWD1 ((uint32_t)0x00000080U) /*!< ADC analog watchdog 1 flag */
  745. /* Legacy defines */
  746. #define ADC_ISR_AWD (ADC_ISR_AWD1)
  747. #define ADC_ISR_EOSEQ (ADC_ISR_EOS)
  748. /******************** Bits definition for ADC_IER register ******************/
  749. #define ADC_IER_ADRDYIE ((uint32_t)0x00000001U) /*!< ADC ready interrupt */
  750. #define ADC_IER_EOSMPIE ((uint32_t)0x00000002U) /*!< ADC group regular end of sampling interrupt */
  751. #define ADC_IER_EOCIE ((uint32_t)0x00000004U) /*!< ADC group regular end of unitary conversion interrupt */
  752. #define ADC_IER_EOSIE ((uint32_t)0x00000008U) /*!< ADC group regular end of sequence conversions interrupt */
  753. #define ADC_IER_OVRIE ((uint32_t)0x00000010U) /*!< ADC group regular overrun interrupt */
  754. #define ADC_IER_AWD1IE ((uint32_t)0x00000080U) /*!< ADC analog watchdog 1 interrupt */
  755. /* Legacy defines */
  756. #define ADC_IER_AWDIE (ADC_IER_AWD1IE)
  757. #define ADC_IER_EOSEQIE (ADC_IER_EOSIE)
  758. /******************** Bits definition for ADC_CR register *******************/
  759. #define ADC_CR_ADEN ((uint32_t)0x00000001U) /*!< ADC enable */
  760. #define ADC_CR_ADDIS ((uint32_t)0x00000002U) /*!< ADC disable */
  761. #define ADC_CR_ADSTART ((uint32_t)0x00000004U) /*!< ADC group regular conversion start */
  762. #define ADC_CR_ADSTP ((uint32_t)0x00000010U) /*!< ADC group regular conversion stop */
  763. #define ADC_CR_ADCAL ((uint32_t)0x80000000U) /*!< ADC calibration */
  764. /******************* Bits definition for ADC_CFGR1 register *****************/
  765. #define ADC_CFGR1_DMAEN ((uint32_t)0x00000001U) /*!< ADC DMA transfer enable */
  766. #define ADC_CFGR1_DMACFG ((uint32_t)0x00000002U) /*!< ADC DMA transfer configuration */
  767. #define ADC_CFGR1_SCANDIR ((uint32_t)0x00000004U) /*!< ADC group regular sequencer scan direction */
  768. #define ADC_CFGR1_RES ((uint32_t)0x00000018U) /*!< ADC data resolution */
  769. #define ADC_CFGR1_RES_0 ((uint32_t)0x00000008U) /*!< bit 0 */
  770. #define ADC_CFGR1_RES_1 ((uint32_t)0x00000010U) /*!< bit 1 */
  771. #define ADC_CFGR1_ALIGN ((uint32_t)0x00000020U) /*!< ADC data alignement */
  772. #define ADC_CFGR1_EXTSEL ((uint32_t)0x000001C0U) /*!< ADC group regular external trigger source */
  773. #define ADC_CFGR1_EXTSEL_0 ((uint32_t)0x00000040U) /*!< bit 0 */
  774. #define ADC_CFGR1_EXTSEL_1 ((uint32_t)0x00000080U) /*!< bit 1 */
  775. #define ADC_CFGR1_EXTSEL_2 ((uint32_t)0x00000100U) /*!< bit 2 */
  776. #define ADC_CFGR1_EXTEN ((uint32_t)0x00000C00U) /*!< ADC group regular external trigger polarity */
  777. #define ADC_CFGR1_EXTEN_0 ((uint32_t)0x00000400U) /*!< bit 0 */
  778. #define ADC_CFGR1_EXTEN_1 ((uint32_t)0x00000800U) /*!< bit 1 */
  779. #define ADC_CFGR1_OVRMOD ((uint32_t)0x00001000U) /*!< ADC group regular overrun configuration */
  780. #define ADC_CFGR1_CONT ((uint32_t)0x00002000U) /*!< ADC group regular continuous conversion mode */
  781. #define ADC_CFGR1_WAIT ((uint32_t)0x00004000U) /*!< ADC low power auto wait */
  782. #define ADC_CFGR1_AUTOFF ((uint32_t)0x00008000U) /*!< ADC low power auto power off */
  783. #define ADC_CFGR1_DISCEN ((uint32_t)0x00010000U) /*!< ADC group regular sequencer discontinuous mode */
  784. #define ADC_CFGR1_AWD1SGL ((uint32_t)0x00400000U) /*!< ADC analog watchdog 1 monitoring a single channel or all channels */
  785. #define ADC_CFGR1_AWD1EN ((uint32_t)0x00800000U) /*!< ADC analog watchdog 1 enable on scope ADC group regular */
  786. #define ADC_CFGR1_AWD1CH ((uint32_t)0x7C000000U) /*!< ADC analog watchdog 1 monitored channel selection */
  787. #define ADC_CFGR1_AWD1CH_0 ((uint32_t)0x04000000U) /*!< bit 0 */
  788. #define ADC_CFGR1_AWD1CH_1 ((uint32_t)0x08000000U) /*!< bit 1 */
  789. #define ADC_CFGR1_AWD1CH_2 ((uint32_t)0x10000000U) /*!< bit 2 */
  790. #define ADC_CFGR1_AWD1CH_3 ((uint32_t)0x20000000U) /*!< bit 3 */
  791. #define ADC_CFGR1_AWD1CH_4 ((uint32_t)0x40000000U) /*!< bit 4 */
  792. /* Legacy defines */
  793. #define ADC_CFGR1_AUTDLY (ADC_CFGR1_WAIT)
  794. #define ADC_CFGR1_AWDSGL (ADC_CFGR1_AWD1SGL)
  795. #define ADC_CFGR1_AWDEN (ADC_CFGR1_AWD1EN)
  796. #define ADC_CFGR1_AWDCH (ADC_CFGR1_AWD1CH)
  797. #define ADC_CFGR1_AWDCH_0 (ADC_CFGR1_AWD1CH_0)
  798. #define ADC_CFGR1_AWDCH_1 (ADC_CFGR1_AWD1CH_1)
  799. #define ADC_CFGR1_AWDCH_2 (ADC_CFGR1_AWD1CH_2)
  800. #define ADC_CFGR1_AWDCH_3 (ADC_CFGR1_AWD1CH_3)
  801. #define ADC_CFGR1_AWDCH_4 (ADC_CFGR1_AWD1CH_4)
  802. /******************* Bits definition for ADC_CFGR2 register *****************/
  803. #define ADC_CFGR2_CKMODE ((uint32_t)0xC0000000U) /*!< ADC clock source and prescaler (prescaler only for clock source synchronous) */
  804. #define ADC_CFGR2_CKMODE_1 ((uint32_t)0x80000000U) /*!< bit 1 */
  805. #define ADC_CFGR2_CKMODE_0 ((uint32_t)0x40000000U) /*!< bit 0 */
  806. /* Legacy defines */
  807. #define ADC_CFGR2_JITOFFDIV4 (ADC_CFGR2_CKMODE_1) /*!< ADC clocked by PCLK div4 */
  808. #define ADC_CFGR2_JITOFFDIV2 (ADC_CFGR2_CKMODE_0) /*!< ADC clocked by PCLK div2 */
  809. /****************** Bit definition for ADC_SMPR register ********************/
  810. #define ADC_SMPR_SMP ((uint32_t)0x00000007U) /*!< ADC group of channels sampling time 2 */
  811. #define ADC_SMPR_SMP_0 ((uint32_t)0x00000001U) /*!< bit 0 */
  812. #define ADC_SMPR_SMP_1 ((uint32_t)0x00000002U) /*!< bit 1 */
  813. #define ADC_SMPR_SMP_2 ((uint32_t)0x00000004U) /*!< bit 2 */
  814. /* Legacy defines */
  815. #define ADC_SMPR1_SMPR (ADC_SMPR_SMP) /*!< SMP[2:0] bits (Sampling time selection) */
  816. #define ADC_SMPR1_SMPR_0 (ADC_SMPR_SMP_0) /*!< bit 0 */
  817. #define ADC_SMPR1_SMPR_1 (ADC_SMPR_SMP_1) /*!< bit 1 */
  818. #define ADC_SMPR1_SMPR_2 (ADC_SMPR_SMP_2) /*!< bit 2 */
  819. /******************* Bit definition for ADC_TR register ********************/
  820. #define ADC_TR1_LT1 ((uint32_t)0x00000FFFU) /*!< ADC analog watchdog 1 threshold low */
  821. #define ADC_TR1_LT1_0 ((uint32_t)0x00000001U) /*!< bit 0 */
  822. #define ADC_TR1_LT1_1 ((uint32_t)0x00000002U) /*!< bit 1 */
  823. #define ADC_TR1_LT1_2 ((uint32_t)0x00000004U) /*!< bit 2 */
  824. #define ADC_TR1_LT1_3 ((uint32_t)0x00000008U) /*!< bit 3 */
  825. #define ADC_TR1_LT1_4 ((uint32_t)0x00000010U) /*!< bit 4 */
  826. #define ADC_TR1_LT1_5 ((uint32_t)0x00000020U) /*!< bit 5 */
  827. #define ADC_TR1_LT1_6 ((uint32_t)0x00000040U) /*!< bit 6 */
  828. #define ADC_TR1_LT1_7 ((uint32_t)0x00000080U) /*!< bit 7 */
  829. #define ADC_TR1_LT1_8 ((uint32_t)0x00000100U) /*!< bit 8 */
  830. #define ADC_TR1_LT1_9 ((uint32_t)0x00000200U) /*!< bit 9 */
  831. #define ADC_TR1_LT1_10 ((uint32_t)0x00000400U) /*!< bit 10 */
  832. #define ADC_TR1_LT1_11 ((uint32_t)0x00000800U) /*!< bit 11 */
  833. #define ADC_TR1_HT1 ((uint32_t)0x0FFF0000U) /*!< ADC Analog watchdog 1 threshold high */
  834. #define ADC_TR1_HT1_0 ((uint32_t)0x00010000U) /*!< bit 0 */
  835. #define ADC_TR1_HT1_1 ((uint32_t)0x00020000U) /*!< bit 1 */
  836. #define ADC_TR1_HT1_2 ((uint32_t)0x00040000U) /*!< bit 2 */
  837. #define ADC_TR1_HT1_3 ((uint32_t)0x00080000U) /*!< bit 3 */
  838. #define ADC_TR1_HT1_4 ((uint32_t)0x00100000U) /*!< bit 4 */
  839. #define ADC_TR1_HT1_5 ((uint32_t)0x00200000U) /*!< bit 5 */
  840. #define ADC_TR1_HT1_6 ((uint32_t)0x00400000U) /*!< bit 6 */
  841. #define ADC_TR1_HT1_7 ((uint32_t)0x00800000U) /*!< bit 7 */
  842. #define ADC_TR1_HT1_8 ((uint32_t)0x01000000U) /*!< bit 8 */
  843. #define ADC_TR1_HT1_9 ((uint32_t)0x02000000U) /*!< bit 9 */
  844. #define ADC_TR1_HT1_10 ((uint32_t)0x04000000U) /*!< bit 10 */
  845. #define ADC_TR1_HT1_11 ((uint32_t)0x08000000U) /*!< bit 11 */
  846. /* Legacy defines */
  847. #define ADC_TR_HT (ADC_TR1_HT1)
  848. #define ADC_TR_LT (ADC_TR1_LT1)
  849. #define ADC_HTR_HT (ADC_TR1_HT1)
  850. #define ADC_LTR_LT (ADC_TR1_LT1)
  851. /****************** Bit definition for ADC_CHSELR register ******************/
  852. #define ADC_CHSELR_CHSEL ((uint32_t)0x0007FFFFU) /*!< ADC group regular sequencer channels, available when ADC_CFGR1_CHSELRMOD is reset */
  853. #define ADC_CHSELR_CHSEL18 ((uint32_t)0x00040000U) /*!< ADC group regular sequencer channel 18, available when ADC_CFGR1_CHSELRMOD is reset */
  854. #define ADC_CHSELR_CHSEL17 ((uint32_t)0x00020000U) /*!< ADC group regular sequencer channel 17, available when ADC_CFGR1_CHSELRMOD is reset */
  855. #define ADC_CHSELR_CHSEL16 ((uint32_t)0x00010000U) /*!< ADC group regular sequencer channel 16, available when ADC_CFGR1_CHSELRMOD is reset */
  856. #define ADC_CHSELR_CHSEL15 ((uint32_t)0x00008000U) /*!< ADC group regular sequencer channel 15, available when ADC_CFGR1_CHSELRMOD is reset */
  857. #define ADC_CHSELR_CHSEL14 ((uint32_t)0x00004000U) /*!< ADC group regular sequencer channel 14, available when ADC_CFGR1_CHSELRMOD is reset */
  858. #define ADC_CHSELR_CHSEL13 ((uint32_t)0x00002000U) /*!< ADC group regular sequencer channel 13, available when ADC_CFGR1_CHSELRMOD is reset */
  859. #define ADC_CHSELR_CHSEL12 ((uint32_t)0x00001000U) /*!< ADC group regular sequencer channel 12, available when ADC_CFGR1_CHSELRMOD is reset */
  860. #define ADC_CHSELR_CHSEL11 ((uint32_t)0x00000800U) /*!< ADC group regular sequencer channel 11, available when ADC_CFGR1_CHSELRMOD is reset */
  861. #define ADC_CHSELR_CHSEL10 ((uint32_t)0x00000400U) /*!< ADC group regular sequencer channel 10, available when ADC_CFGR1_CHSELRMOD is reset */
  862. #define ADC_CHSELR_CHSEL9 ((uint32_t)0x00000200U) /*!< ADC group regular sequencer channel 9, available when ADC_CFGR1_CHSELRMOD is reset */
  863. #define ADC_CHSELR_CHSEL8 ((uint32_t)0x00000100U) /*!< ADC group regular sequencer channel 8, available when ADC_CFGR1_CHSELRMOD is reset */
  864. #define ADC_CHSELR_CHSEL7 ((uint32_t)0x00000080U) /*!< ADC group regular sequencer channel 7, available when ADC_CFGR1_CHSELRMOD is reset */
  865. #define ADC_CHSELR_CHSEL6 ((uint32_t)0x00000040U) /*!< ADC group regular sequencer channel 6, available when ADC_CFGR1_CHSELRMOD is reset */
  866. #define ADC_CHSELR_CHSEL5 ((uint32_t)0x00000020U) /*!< ADC group regular sequencer channel 5, available when ADC_CFGR1_CHSELRMOD is reset */
  867. #define ADC_CHSELR_CHSEL4 ((uint32_t)0x00000010U) /*!< ADC group regular sequencer channel 4, available when ADC_CFGR1_CHSELRMOD is reset */
  868. #define ADC_CHSELR_CHSEL3 ((uint32_t)0x00000008U) /*!< ADC group regular sequencer channel 3, available when ADC_CFGR1_CHSELRMOD is reset */
  869. #define ADC_CHSELR_CHSEL2 ((uint32_t)0x00000004U) /*!< ADC group regular sequencer channel 2, available when ADC_CFGR1_CHSELRMOD is reset */
  870. #define ADC_CHSELR_CHSEL1 ((uint32_t)0x00000002U) /*!< ADC group regular sequencer channel 1, available when ADC_CFGR1_CHSELRMOD is reset */
  871. #define ADC_CHSELR_CHSEL0 ((uint32_t)0x00000001U) /*!< ADC group regular sequencer channel 0, available when ADC_CFGR1_CHSELRMOD is reset */
  872. /******************** Bit definition for ADC_DR register ********************/
  873. #define ADC_DR_DATA ((uint32_t)0x0000FFFFU) /*!< ADC group regular conversion data */
  874. #define ADC_DR_DATA_0 ((uint32_t)0x00000001U) /*!< bit 0 */
  875. #define ADC_DR_DATA_1 ((uint32_t)0x00000002U) /*!< bit 1 */
  876. #define ADC_DR_DATA_2 ((uint32_t)0x00000004U) /*!< bit 2 */
  877. #define ADC_DR_DATA_3 ((uint32_t)0x00000008U) /*!< bit 3 */
  878. #define ADC_DR_DATA_4 ((uint32_t)0x00000010U) /*!< bit 4 */
  879. #define ADC_DR_DATA_5 ((uint32_t)0x00000020U) /*!< bit 5 */
  880. #define ADC_DR_DATA_6 ((uint32_t)0x00000040U) /*!< bit 6 */
  881. #define ADC_DR_DATA_7 ((uint32_t)0x00000080U) /*!< bit 7 */
  882. #define ADC_DR_DATA_8 ((uint32_t)0x00000100U) /*!< bit 8 */
  883. #define ADC_DR_DATA_9 ((uint32_t)0x00000200U) /*!< bit 9 */
  884. #define ADC_DR_DATA_10 ((uint32_t)0x00000400U) /*!< bit 10 */
  885. #define ADC_DR_DATA_11 ((uint32_t)0x00000800U) /*!< bit 11 */
  886. #define ADC_DR_DATA_12 ((uint32_t)0x00001000U) /*!< bit 12 */
  887. #define ADC_DR_DATA_13 ((uint32_t)0x00002000U) /*!< bit 13 */
  888. #define ADC_DR_DATA_14 ((uint32_t)0x00004000U) /*!< bit 14 */
  889. #define ADC_DR_DATA_15 ((uint32_t)0x00008000U) /*!< bit 15 */
  890. /************************* ADC Common registers *****************************/
  891. /******************* Bit definition for ADC_CCR register ********************/
  892. #define ADC_CCR_VREFEN ((uint32_t)0x00400000U) /*!< ADC internal path to VrefInt enable */
  893. #define ADC_CCR_TSEN ((uint32_t)0x00800000U) /*!< ADC internal path to temperature sensor enable */
  894. #define ADC_CCR_VBATEN ((uint32_t)0x01000000U) /*!< ADC internal path to battery voltage enable */
  895. /******************************************************************************/
  896. /* */
  897. /* Controller Area Network (CAN ) */
  898. /* */
  899. /******************************************************************************/
  900. /*!<CAN control and status registers */
  901. /******************* Bit definition for CAN_MCR register ********************/
  902. #define CAN_MCR_INRQ ((uint32_t)0x00000001U) /*!<Initialization Request */
  903. #define CAN_MCR_SLEEP ((uint32_t)0x00000002U) /*!<Sleep Mode Request */
  904. #define CAN_MCR_TXFP ((uint32_t)0x00000004U) /*!<Transmit FIFO Priority */
  905. #define CAN_MCR_RFLM ((uint32_t)0x00000008U) /*!<Receive FIFO Locked Mode */
  906. #define CAN_MCR_NART ((uint32_t)0x00000010U) /*!<No Automatic Retransmission */
  907. #define CAN_MCR_AWUM ((uint32_t)0x00000020U) /*!<Automatic Wakeup Mode */
  908. #define CAN_MCR_ABOM ((uint32_t)0x00000040U) /*!<Automatic Bus-Off Management */
  909. #define CAN_MCR_TTCM ((uint32_t)0x00000080U) /*!<Time Triggered Communication Mode */
  910. #define CAN_MCR_RESET ((uint32_t)0x00008000U) /*!<bxCAN software master reset */
  911. /******************* Bit definition for CAN_MSR register ********************/
  912. #define CAN_MSR_INAK ((uint32_t)0x00000001U) /*!<Initialization Acknowledge */
  913. #define CAN_MSR_SLAK ((uint32_t)0x00000002U) /*!<Sleep Acknowledge */
  914. #define CAN_MSR_ERRI ((uint32_t)0x00000004U) /*!<Error Interrupt */
  915. #define CAN_MSR_WKUI ((uint32_t)0x00000008U) /*!<Wakeup Interrupt */
  916. #define CAN_MSR_SLAKI ((uint32_t)0x00000010U) /*!<Sleep Acknowledge Interrupt */
  917. #define CAN_MSR_TXM ((uint32_t)0x00000100U) /*!<Transmit Mode */
  918. #define CAN_MSR_RXM ((uint32_t)0x00000200U) /*!<Receive Mode */
  919. #define CAN_MSR_SAMP ((uint32_t)0x00000400U) /*!<Last Sample Point */
  920. #define CAN_MSR_RX ((uint32_t)0x00000800U) /*!<CAN Rx Signal */
  921. /******************* Bit definition for CAN_TSR register ********************/
  922. #define CAN_TSR_RQCP0 ((uint32_t)0x00000001U) /*!<Request Completed Mailbox0 */
  923. #define CAN_TSR_TXOK0 ((uint32_t)0x00000002U) /*!<Transmission OK of Mailbox0 */
  924. #define CAN_TSR_ALST0 ((uint32_t)0x00000004U) /*!<Arbitration Lost for Mailbox0 */
  925. #define CAN_TSR_TERR0 ((uint32_t)0x00000008U) /*!<Transmission Error of Mailbox0 */
  926. #define CAN_TSR_ABRQ0 ((uint32_t)0x00000080U) /*!<Abort Request for Mailbox0 */
  927. #define CAN_TSR_RQCP1 ((uint32_t)0x00000100U) /*!<Request Completed Mailbox1 */
  928. #define CAN_TSR_TXOK1 ((uint32_t)0x00000200U) /*!<Transmission OK of Mailbox1 */
  929. #define CAN_TSR_ALST1 ((uint32_t)0x00000400U) /*!<Arbitration Lost for Mailbox1 */
  930. #define CAN_TSR_TERR1 ((uint32_t)0x00000800U) /*!<Transmission Error of Mailbox1 */
  931. #define CAN_TSR_ABRQ1 ((uint32_t)0x00008000U) /*!<Abort Request for Mailbox 1 */
  932. #define CAN_TSR_RQCP2 ((uint32_t)0x00010000U) /*!<Request Completed Mailbox2 */
  933. #define CAN_TSR_TXOK2 ((uint32_t)0x00020000U) /*!<Transmission OK of Mailbox 2 */
  934. #define CAN_TSR_ALST2 ((uint32_t)0x00040000U) /*!<Arbitration Lost for mailbox 2 */
  935. #define CAN_TSR_TERR2 ((uint32_t)0x00080000U) /*!<Transmission Error of Mailbox 2 */
  936. #define CAN_TSR_ABRQ2 ((uint32_t)0x00800000U) /*!<Abort Request for Mailbox 2 */
  937. #define CAN_TSR_CODE ((uint32_t)0x03000000U) /*!<Mailbox Code */
  938. #define CAN_TSR_TME ((uint32_t)0x1C000000U) /*!<TME[2:0] bits */
  939. #define CAN_TSR_TME0 ((uint32_t)0x04000000U) /*!<Transmit Mailbox 0 Empty */
  940. #define CAN_TSR_TME1 ((uint32_t)0x08000000U) /*!<Transmit Mailbox 1 Empty */
  941. #define CAN_TSR_TME2 ((uint32_t)0x10000000U) /*!<Transmit Mailbox 2 Empty */
  942. #define CAN_TSR_LOW ((uint32_t)0xE0000000U) /*!<LOW[2:0] bits */
  943. #define CAN_TSR_LOW0 ((uint32_t)0x20000000U) /*!<Lowest Priority Flag for Mailbox 0 */
  944. #define CAN_TSR_LOW1 ((uint32_t)0x40000000U) /*!<Lowest Priority Flag for Mailbox 1 */
  945. #define CAN_TSR_LOW2 ((uint32_t)0x80000000U) /*!<Lowest Priority Flag for Mailbox 2 */
  946. /******************* Bit definition for CAN_RF0R register *******************/
  947. #define CAN_RF0R_FMP0 ((uint32_t)0x00000003U) /*!<FIFO 0 Message Pending */
  948. #define CAN_RF0R_FULL0 ((uint32_t)0x00000008U) /*!<FIFO 0 Full */
  949. #define CAN_RF0R_FOVR0 ((uint32_t)0x00000010U) /*!<FIFO 0 Overrun */
  950. #define CAN_RF0R_RFOM0 ((uint32_t)0x00000020U) /*!<Release FIFO 0 Output Mailbox */
  951. /******************* Bit definition for CAN_RF1R register *******************/
  952. #define CAN_RF1R_FMP1 ((uint32_t)0x00000003U) /*!<FIFO 1 Message Pending */
  953. #define CAN_RF1R_FULL1 ((uint32_t)0x00000008U) /*!<FIFO 1 Full */
  954. #define CAN_RF1R_FOVR1 ((uint32_t)0x00000010U) /*!<FIFO 1 Overrun */
  955. #define CAN_RF1R_RFOM1 ((uint32_t)0x00000020U) /*!<Release FIFO 1 Output Mailbox */
  956. /******************** Bit definition for CAN_IER register *******************/
  957. #define CAN_IER_TMEIE ((uint32_t)0x00000001U) /*!<Transmit Mailbox Empty Interrupt Enable */
  958. #define CAN_IER_FMPIE0 ((uint32_t)0x00000002U) /*!<FIFO Message Pending Interrupt Enable */
  959. #define CAN_IER_FFIE0 ((uint32_t)0x00000004U) /*!<FIFO Full Interrupt Enable */
  960. #define CAN_IER_FOVIE0 ((uint32_t)0x00000008U) /*!<FIFO Overrun Interrupt Enable */
  961. #define CAN_IER_FMPIE1 ((uint32_t)0x00000010U) /*!<FIFO Message Pending Interrupt Enable */
  962. #define CAN_IER_FFIE1 ((uint32_t)0x00000020U) /*!<FIFO Full Interrupt Enable */
  963. #define CAN_IER_FOVIE1 ((uint32_t)0x00000040U) /*!<FIFO Overrun Interrupt Enable */
  964. #define CAN_IER_EWGIE ((uint32_t)0x00000100U) /*!<Error Warning Interrupt Enable */
  965. #define CAN_IER_EPVIE ((uint32_t)0x00000200U) /*!<Error Passive Interrupt Enable */
  966. #define CAN_IER_BOFIE ((uint32_t)0x00000400U) /*!<Bus-Off Interrupt Enable */
  967. #define CAN_IER_LECIE ((uint32_t)0x00000800U) /*!<Last Error Code Interrupt Enable */
  968. #define CAN_IER_ERRIE ((uint32_t)0x00008000U) /*!<Error Interrupt Enable */
  969. #define CAN_IER_WKUIE ((uint32_t)0x00010000U) /*!<Wakeup Interrupt Enable */
  970. #define CAN_IER_SLKIE ((uint32_t)0x00020000U) /*!<Sleep Interrupt Enable */
  971. /******************** Bit definition for CAN_ESR register *******************/
  972. #define CAN_ESR_EWGF ((uint32_t)0x00000001U) /*!<Error Warning Flag */
  973. #define CAN_ESR_EPVF ((uint32_t)0x00000002U) /*!<Error Passive Flag */
  974. #define CAN_ESR_BOFF ((uint32_t)0x00000004U) /*!<Bus-Off Flag */
  975. #define CAN_ESR_LEC ((uint32_t)0x00000070U) /*!<LEC[2:0] bits (Last Error Code) */
  976. #define CAN_ESR_LEC_0 ((uint32_t)0x00000010U) /*!<Bit 0 */
  977. #define CAN_ESR_LEC_1 ((uint32_t)0x00000020U) /*!<Bit 1 */
  978. #define CAN_ESR_LEC_2 ((uint32_t)0x00000040U) /*!<Bit 2 */
  979. #define CAN_ESR_TEC ((uint32_t)0x00FF0000U) /*!<Least significant byte of the 9-bit Transmit Error Counter */
  980. #define CAN_ESR_REC ((uint32_t)0xFF000000U) /*!<Receive Error Counter */
  981. /******************* Bit definition for CAN_BTR register ********************/
  982. #define CAN_BTR_BRP ((uint32_t)0x000003FFU) /*!<Baud Rate Prescaler */
  983. #define CAN_BTR_TS1 ((uint32_t)0x000F0000U) /*!<Time Segment 1 */
  984. #define CAN_BTR_TS1_0 ((uint32_t)0x00010000U) /*!<Time Segment 1 (Bit 0) */
  985. #define CAN_BTR_TS1_1 ((uint32_t)0x00020000U) /*!<Time Segment 1 (Bit 1) */
  986. #define CAN_BTR_TS1_2 ((uint32_t)0x00040000U) /*!<Time Segment 1 (Bit 2) */
  987. #define CAN_BTR_TS1_3 ((uint32_t)0x00080000U) /*!<Time Segment 1 (Bit 3) */
  988. #define CAN_BTR_TS2 ((uint32_t)0x00700000U) /*!<Time Segment 2 */
  989. #define CAN_BTR_TS2_0 ((uint32_t)0x00100000U) /*!<Time Segment 2 (Bit 0) */
  990. #define CAN_BTR_TS2_1 ((uint32_t)0x00200000U) /*!<Time Segment 2 (Bit 1) */
  991. #define CAN_BTR_TS2_2 ((uint32_t)0x00400000U) /*!<Time Segment 2 (Bit 2) */
  992. #define CAN_BTR_SJW ((uint32_t)0x03000000U) /*!<Resynchronization Jump Width */
  993. #define CAN_BTR_SJW_0 ((uint32_t)0x01000000U) /*!<Resynchronization Jump Width (Bit 0) */
  994. #define CAN_BTR_SJW_1 ((uint32_t)0x02000000U) /*!<Resynchronization Jump Width (Bit 1) */
  995. #define CAN_BTR_LBKM ((uint32_t)0x40000000U) /*!<Loop Back Mode (Debug) */
  996. #define CAN_BTR_SILM ((uint32_t)0x80000000U) /*!<Silent Mode */
  997. /*!<Mailbox registers */
  998. /****************** Bit definition for CAN_TI0R register ********************/
  999. #define CAN_TI0R_TXRQ ((uint32_t)0x00000001U) /*!<Transmit Mailbox Request */
  1000. #define CAN_TI0R_RTR ((uint32_t)0x00000002U) /*!<Remote Transmission Request */
  1001. #define CAN_TI0R_IDE ((uint32_t)0x00000004U) /*!<Identifier Extension */
  1002. #define CAN_TI0R_EXID ((uint32_t)0x001FFFF8U) /*!<Extended Identifier */
  1003. #define CAN_TI0R_STID ((uint32_t)0xFFE00000U) /*!<Standard Identifier or Extended Identifier */
  1004. /****************** Bit definition for CAN_TDT0R register *******************/
  1005. #define CAN_TDT0R_DLC ((uint32_t)0x0000000FU) /*!<Data Length Code */
  1006. #define CAN_TDT0R_TGT ((uint32_t)0x00000100U) /*!<Transmit Global Time */
  1007. #define CAN_TDT0R_TIME ((uint32_t)0xFFFF0000U) /*!<Message Time Stamp */
  1008. /****************** Bit definition for CAN_TDL0R register *******************/
  1009. #define CAN_TDL0R_DATA0 ((uint32_t)0x000000FFU) /*!<Data byte 0 */
  1010. #define CAN_TDL0R_DATA1 ((uint32_t)0x0000FF00U) /*!<Data byte 1 */
  1011. #define CAN_TDL0R_DATA2 ((uint32_t)0x00FF0000U) /*!<Data byte 2 */
  1012. #define CAN_TDL0R_DATA3 ((uint32_t)0xFF000000U) /*!<Data byte 3 */
  1013. /****************** Bit definition for CAN_TDH0R register *******************/
  1014. #define CAN_TDH0R_DATA4 ((uint32_t)0x000000FFU) /*!<Data byte 4 */
  1015. #define CAN_TDH0R_DATA5 ((uint32_t)0x0000FF00U) /*!<Data byte 5 */
  1016. #define CAN_TDH0R_DATA6 ((uint32_t)0x00FF0000U) /*!<Data byte 6 */
  1017. #define CAN_TDH0R_DATA7 ((uint32_t)0xFF000000U) /*!<Data byte 7 */
  1018. /******************* Bit definition for CAN_TI1R register *******************/
  1019. #define CAN_TI1R_TXRQ ((uint32_t)0x00000001U) /*!<Transmit Mailbox Request */
  1020. #define CAN_TI1R_RTR ((uint32_t)0x00000002U) /*!<Remote Transmission Request */
  1021. #define CAN_TI1R_IDE ((uint32_t)0x00000004U) /*!<Identifier Extension */
  1022. #define CAN_TI1R_EXID ((uint32_t)0x001FFFF8U) /*!<Extended Identifier */
  1023. #define CAN_TI1R_STID ((uint32_t)0xFFE00000U) /*!<Standard Identifier or Extended Identifier */
  1024. /******************* Bit definition for CAN_TDT1R register ******************/
  1025. #define CAN_TDT1R_DLC ((uint32_t)0x0000000FU) /*!<Data Length Code */
  1026. #define CAN_TDT1R_TGT ((uint32_t)0x00000100U) /*!<Transmit Global Time */
  1027. #define CAN_TDT1R_TIME ((uint32_t)0xFFFF0000U) /*!<Message Time Stamp */
  1028. /******************* Bit definition for CAN_TDL1R register ******************/
  1029. #define CAN_TDL1R_DATA0 ((uint32_t)0x000000FFU) /*!<Data byte 0 */
  1030. #define CAN_TDL1R_DATA1 ((uint32_t)0x0000FF00U) /*!<Data byte 1 */
  1031. #define CAN_TDL1R_DATA2 ((uint32_t)0x00FF0000U) /*!<Data byte 2 */
  1032. #define CAN_TDL1R_DATA3 ((uint32_t)0xFF000000U) /*!<Data byte 3 */
  1033. /******************* Bit definition for CAN_TDH1R register ******************/
  1034. #define CAN_TDH1R_DATA4 ((uint32_t)0x000000FFU) /*!<Data byte 4 */
  1035. #define CAN_TDH1R_DATA5 ((uint32_t)0x0000FF00U) /*!<Data byte 5 */
  1036. #define CAN_TDH1R_DATA6 ((uint32_t)0x00FF0000U) /*!<Data byte 6 */
  1037. #define CAN_TDH1R_DATA7 ((uint32_t)0xFF000000U) /*!<Data byte 7 */
  1038. /******************* Bit definition for CAN_TI2R register *******************/
  1039. #define CAN_TI2R_TXRQ ((uint32_t)0x00000001U) /*!<Transmit Mailbox Request */
  1040. #define CAN_TI2R_RTR ((uint32_t)0x00000002U) /*!<Remote Transmission Request */
  1041. #define CAN_TI2R_IDE ((uint32_t)0x00000004U) /*!<Identifier Extension */
  1042. #define CAN_TI2R_EXID ((uint32_t)0x001FFFF8U) /*!<Extended identifier */
  1043. #define CAN_TI2R_STID ((uint32_t)0xFFE00000U) /*!<Standard Identifier or Extended Identifier */
  1044. /******************* Bit definition for CAN_TDT2R register ******************/
  1045. #define CAN_TDT2R_DLC ((uint32_t)0x0000000FU) /*!<Data Length Code */
  1046. #define CAN_TDT2R_TGT ((uint32_t)0x00000100U) /*!<Transmit Global Time */
  1047. #define CAN_TDT2R_TIME ((uint32_t)0xFFFF0000U) /*!<Message Time Stamp */
  1048. /******************* Bit definition for CAN_TDL2R register ******************/
  1049. #define CAN_TDL2R_DATA0 ((uint32_t)0x000000FFU) /*!<Data byte 0 */
  1050. #define CAN_TDL2R_DATA1 ((uint32_t)0x0000FF00U) /*!<Data byte 1 */
  1051. #define CAN_TDL2R_DATA2 ((uint32_t)0x00FF0000U) /*!<Data byte 2 */
  1052. #define CAN_TDL2R_DATA3 ((uint32_t)0xFF000000U) /*!<Data byte 3 */
  1053. /******************* Bit definition for CAN_TDH2R register ******************/
  1054. #define CAN_TDH2R_DATA4 ((uint32_t)0x000000FFU) /*!<Data byte 4 */
  1055. #define CAN_TDH2R_DATA5 ((uint32_t)0x0000FF00U) /*!<Data byte 5 */
  1056. #define CAN_TDH2R_DATA6 ((uint32_t)0x00FF0000U) /*!<Data byte 6 */
  1057. #define CAN_TDH2R_DATA7 ((uint32_t)0xFF000000U) /*!<Data byte 7 */
  1058. /******************* Bit definition for CAN_RI0R register *******************/
  1059. #define CAN_RI0R_RTR ((uint32_t)0x00000002U) /*!<Remote Transmission Request */
  1060. #define CAN_RI0R_IDE ((uint32_t)0x00000004U) /*!<Identifier Extension */
  1061. #define CAN_RI0R_EXID ((uint32_t)0x001FFFF8U) /*!<Extended Identifier */
  1062. #define CAN_RI0R_STID ((uint32_t)0xFFE00000U) /*!<Standard Identifier or Extended Identifier */
  1063. /******************* Bit definition for CAN_RDT0R register ******************/
  1064. #define CAN_RDT0R_DLC ((uint32_t)0x0000000FU) /*!<Data Length Code */
  1065. #define CAN_RDT0R_FMI ((uint32_t)0x0000FF00U) /*!<Filter Match Index */
  1066. #define CAN_RDT0R_TIME ((uint32_t)0xFFFF0000U) /*!<Message Time Stamp */
  1067. /******************* Bit definition for CAN_RDL0R register ******************/
  1068. #define CAN_RDL0R_DATA0 ((uint32_t)0x000000FFU) /*!<Data byte 0 */
  1069. #define CAN_RDL0R_DATA1 ((uint32_t)0x0000FF00U) /*!<Data byte 1 */
  1070. #define CAN_RDL0R_DATA2 ((uint32_t)0x00FF0000U) /*!<Data byte 2 */
  1071. #define CAN_RDL0R_DATA3 ((uint32_t)0xFF000000U) /*!<Data byte 3 */
  1072. /******************* Bit definition for CAN_RDH0R register ******************/
  1073. #define CAN_RDH0R_DATA4 ((uint32_t)0x000000FFU) /*!<Data byte 4 */
  1074. #define CAN_RDH0R_DATA5 ((uint32_t)0x0000FF00U) /*!<Data byte 5 */
  1075. #define CAN_RDH0R_DATA6 ((uint32_t)0x00FF0000U) /*!<Data byte 6 */
  1076. #define CAN_RDH0R_DATA7 ((uint32_t)0xFF000000U) /*!<Data byte 7 */
  1077. /******************* Bit definition for CAN_RI1R register *******************/
  1078. #define CAN_RI1R_RTR ((uint32_t)0x00000002U) /*!<Remote Transmission Request */
  1079. #define CAN_RI1R_IDE ((uint32_t)0x00000004U) /*!<Identifier Extension */
  1080. #define CAN_RI1R_EXID ((uint32_t)0x001FFFF8U) /*!<Extended identifier */
  1081. #define CAN_RI1R_STID ((uint32_t)0xFFE00000U) /*!<Standard Identifier or Extended Identifier */
  1082. /******************* Bit definition for CAN_RDT1R register ******************/
  1083. #define CAN_RDT1R_DLC ((uint32_t)0x0000000FU) /*!<Data Length Code */
  1084. #define CAN_RDT1R_FMI ((uint32_t)0x0000FF00U) /*!<Filter Match Index */
  1085. #define CAN_RDT1R_TIME ((uint32_t)0xFFFF0000U) /*!<Message Time Stamp */
  1086. /******************* Bit definition for CAN_RDL1R register ******************/
  1087. #define CAN_RDL1R_DATA0 ((uint32_t)0x000000FFU) /*!<Data byte 0 */
  1088. #define CAN_RDL1R_DATA1 ((uint32_t)0x0000FF00U) /*!<Data byte 1 */
  1089. #define CAN_RDL1R_DATA2 ((uint32_t)0x00FF0000U) /*!<Data byte 2 */
  1090. #define CAN_RDL1R_DATA3 ((uint32_t)0xFF000000U) /*!<Data byte 3 */
  1091. /******************* Bit definition for CAN_RDH1R register ******************/
  1092. #define CAN_RDH1R_DATA4 ((uint32_t)0x000000FFU) /*!<Data byte 4 */
  1093. #define CAN_RDH1R_DATA5 ((uint32_t)0x0000FF00U) /*!<Data byte 5 */
  1094. #define CAN_RDH1R_DATA6 ((uint32_t)0x00FF0000U) /*!<Data byte 6 */
  1095. #define CAN_RDH1R_DATA7 ((uint32_t)0xFF000000U) /*!<Data byte 7 */
  1096. /*!<CAN filter registers */
  1097. /******************* Bit definition for CAN_FMR register ********************/
  1098. #define CAN_FMR_FINIT ((uint32_t)0x00000001U) /*!<Filter Init Mode */
  1099. #define CAN_FMR_CAN2SB ((uint32_t)0x00003F00U) /*!<CAN2 start bank */
  1100. /******************* Bit definition for CAN_FM1R register *******************/
  1101. #define CAN_FM1R_FBM ((uint32_t)0x0FFFFFFFU) /*!<Filter Mode */
  1102. #define CAN_FM1R_FBM0 ((uint32_t)0x00000001U) /*!<Filter Init Mode bit 0 */
  1103. #define CAN_FM1R_FBM1 ((uint32_t)0x00000002U) /*!<Filter Init Mode bit 1 */
  1104. #define CAN_FM1R_FBM2 ((uint32_t)0x00000004U) /*!<Filter Init Mode bit 2 */
  1105. #define CAN_FM1R_FBM3 ((uint32_t)0x00000008U) /*!<Filter Init Mode bit 3 */
  1106. #define CAN_FM1R_FBM4 ((uint32_t)0x00000010U) /*!<Filter Init Mode bit 4 */
  1107. #define CAN_FM1R_FBM5 ((uint32_t)0x00000020U) /*!<Filter Init Mode bit 5 */
  1108. #define CAN_FM1R_FBM6 ((uint32_t)0x00000040U) /*!<Filter Init Mode bit 6 */
  1109. #define CAN_FM1R_FBM7 ((uint32_t)0x00000080U) /*!<Filter Init Mode bit 7 */
  1110. #define CAN_FM1R_FBM8 ((uint32_t)0x00000100U) /*!<Filter Init Mode bit 8 */
  1111. #define CAN_FM1R_FBM9 ((uint32_t)0x00000200U) /*!<Filter Init Mode bit 9 */
  1112. #define CAN_FM1R_FBM10 ((uint32_t)0x00000400U) /*!<Filter Init Mode bit 10 */
  1113. #define CAN_FM1R_FBM11 ((uint32_t)0x00000800U) /*!<Filter Init Mode bit 11 */
  1114. #define CAN_FM1R_FBM12 ((uint32_t)0x00001000U) /*!<Filter Init Mode bit 12 */
  1115. #define CAN_FM1R_FBM13 ((uint32_t)0x00002000U) /*!<Filter Init Mode bit 13 */
  1116. #define CAN_FM1R_FBM14 ((uint32_t)0x00004000U) /*!<Filter Init Mode bit 14 */
  1117. #define CAN_FM1R_FBM15 ((uint32_t)0x00008000U) /*!<Filter Init Mode bit 15 */
  1118. #define CAN_FM1R_FBM16 ((uint32_t)0x00010000U) /*!<Filter Init Mode bit 16 */
  1119. #define CAN_FM1R_FBM17 ((uint32_t)0x00020000U) /*!<Filter Init Mode bit 17 */
  1120. #define CAN_FM1R_FBM18 ((uint32_t)0x00040000U) /*!<Filter Init Mode bit 18 */
  1121. #define CAN_FM1R_FBM19 ((uint32_t)0x00080000U) /*!<Filter Init Mode bit 19 */
  1122. #define CAN_FM1R_FBM20 ((uint32_t)0x00100000U) /*!<Filter Init Mode bit 20 */
  1123. #define CAN_FM1R_FBM21 ((uint32_t)0x00200000U) /*!<Filter Init Mode bit 21 */
  1124. #define CAN_FM1R_FBM22 ((uint32_t)0x00400000U) /*!<Filter Init Mode bit 22 */
  1125. #define CAN_FM1R_FBM23 ((uint32_t)0x00800000U) /*!<Filter Init Mode bit 23 */
  1126. #define CAN_FM1R_FBM24 ((uint32_t)0x01000000U) /*!<Filter Init Mode bit 24 */
  1127. #define CAN_FM1R_FBM25 ((uint32_t)0x02000000U) /*!<Filter Init Mode bit 25 */
  1128. #define CAN_FM1R_FBM26 ((uint32_t)0x04000000U) /*!<Filter Init Mode bit 26 */
  1129. #define CAN_FM1R_FBM27 ((uint32_t)0x08000000U) /*!<Filter Init Mode bit 27 */
  1130. /******************* Bit definition for CAN_FS1R register *******************/
  1131. #define CAN_FS1R_FSC ((uint32_t)0x0FFFFFFFU) /*!<Filter Scale Configuration */
  1132. #define CAN_FS1R_FSC0 ((uint32_t)0x00000001U) /*!<Filter Scale Configuration bit 0 */
  1133. #define CAN_FS1R_FSC1 ((uint32_t)0x00000002U) /*!<Filter Scale Configuration bit 1 */
  1134. #define CAN_FS1R_FSC2 ((uint32_t)0x00000004U) /*!<Filter Scale Configuration bit 2 */
  1135. #define CAN_FS1R_FSC3 ((uint32_t)0x00000008U) /*!<Filter Scale Configuration bit 3 */
  1136. #define CAN_FS1R_FSC4 ((uint32_t)0x00000010U) /*!<Filter Scale Configuration bit 4 */
  1137. #define CAN_FS1R_FSC5 ((uint32_t)0x00000020U) /*!<Filter Scale Configuration bit 5 */
  1138. #define CAN_FS1R_FSC6 ((uint32_t)0x00000040U) /*!<Filter Scale Configuration bit 6 */
  1139. #define CAN_FS1R_FSC7 ((uint32_t)0x00000080U) /*!<Filter Scale Configuration bit 7 */
  1140. #define CAN_FS1R_FSC8 ((uint32_t)0x00000100U) /*!<Filter Scale Configuration bit 8 */
  1141. #define CAN_FS1R_FSC9 ((uint32_t)0x00000200U) /*!<Filter Scale Configuration bit 9 */
  1142. #define CAN_FS1R_FSC10 ((uint32_t)0x00000400U) /*!<Filter Scale Configuration bit 10 */
  1143. #define CAN_FS1R_FSC11 ((uint32_t)0x00000800U) /*!<Filter Scale Configuration bit 11 */
  1144. #define CAN_FS1R_FSC12 ((uint32_t)0x00001000U) /*!<Filter Scale Configuration bit 12 */
  1145. #define CAN_FS1R_FSC13 ((uint32_t)0x00002000U) /*!<Filter Scale Configuration bit 13 */
  1146. #define CAN_FS1R_FSC14 ((uint32_t)0x00004000U) /*!<Filter Scale Configuration bit 14 */
  1147. #define CAN_FS1R_FSC15 ((uint32_t)0x00008000U) /*!<Filter Scale Configuration bit 15 */
  1148. #define CAN_FS1R_FSC16 ((uint32_t)0x00010000U) /*!<Filter Scale Configuration bit 16 */
  1149. #define CAN_FS1R_FSC17 ((uint32_t)0x00020000U) /*!<Filter Scale Configuration bit 17 */
  1150. #define CAN_FS1R_FSC18 ((uint32_t)0x00040000U) /*!<Filter Scale Configuration bit 18 */
  1151. #define CAN_FS1R_FSC19 ((uint32_t)0x00080000U) /*!<Filter Scale Configuration bit 19 */
  1152. #define CAN_FS1R_FSC20 ((uint32_t)0x00100000U) /*!<Filter Scale Configuration bit 20 */
  1153. #define CAN_FS1R_FSC21 ((uint32_t)0x00200000U) /*!<Filter Scale Configuration bit 21 */
  1154. #define CAN_FS1R_FSC22 ((uint32_t)0x00400000U) /*!<Filter Scale Configuration bit 22 */
  1155. #define CAN_FS1R_FSC23 ((uint32_t)0x00800000U) /*!<Filter Scale Configuration bit 23 */
  1156. #define CAN_FS1R_FSC24 ((uint32_t)0x01000000U) /*!<Filter Scale Configuration bit 24 */
  1157. #define CAN_FS1R_FSC25 ((uint32_t)0x02000000U) /*!<Filter Scale Configuration bit 25 */
  1158. #define CAN_FS1R_FSC26 ((uint32_t)0x04000000U) /*!<Filter Scale Configuration bit 26 */
  1159. #define CAN_FS1R_FSC27 ((uint32_t)0x08000000U) /*!<Filter Scale Configuration bit 27 */
  1160. /****************** Bit definition for CAN_FFA1R register *******************/
  1161. #define CAN_FFA1R_FFA ((uint32_t)0x0FFFFFFFU) /*!<Filter FIFO Assignment */
  1162. #define CAN_FFA1R_FFA0 ((uint32_t)0x00000001U) /*!<Filter FIFO Assignment bit 0 */
  1163. #define CAN_FFA1R_FFA1 ((uint32_t)0x00000002U) /*!<Filter FIFO Assignment bit 1 */
  1164. #define CAN_FFA1R_FFA2 ((uint32_t)0x00000004U) /*!<Filter FIFO Assignment bit 2 */
  1165. #define CAN_FFA1R_FFA3 ((uint32_t)0x00000008U) /*!<Filter FIFO Assignment bit 3 */
  1166. #define CAN_FFA1R_FFA4 ((uint32_t)0x00000010U) /*!<Filter FIFO Assignment bit 4 */
  1167. #define CAN_FFA1R_FFA5 ((uint32_t)0x00000020U) /*!<Filter FIFO Assignment bit 5 */
  1168. #define CAN_FFA1R_FFA6 ((uint32_t)0x00000040U) /*!<Filter FIFO Assignment bit 6 */
  1169. #define CAN_FFA1R_FFA7 ((uint32_t)0x00000080U) /*!<Filter FIFO Assignment bit 7 */
  1170. #define CAN_FFA1R_FFA8 ((uint32_t)0x00000100U) /*!<Filter FIFO Assignment bit 8 */
  1171. #define CAN_FFA1R_FFA9 ((uint32_t)0x00000200U) /*!<Filter FIFO Assignment bit 9 */
  1172. #define CAN_FFA1R_FFA10 ((uint32_t)0x00000400U) /*!<Filter FIFO Assignment bit 10 */
  1173. #define CAN_FFA1R_FFA11 ((uint32_t)0x00000800U) /*!<Filter FIFO Assignment bit 11 */
  1174. #define CAN_FFA1R_FFA12 ((uint32_t)0x00001000U) /*!<Filter FIFO Assignment bit 12 */
  1175. #define CAN_FFA1R_FFA13 ((uint32_t)0x00002000U) /*!<Filter FIFO Assignment bit 13 */
  1176. #define CAN_FFA1R_FFA14 ((uint32_t)0x00004000U) /*!<Filter FIFO Assignment bit 14 */
  1177. #define CAN_FFA1R_FFA15 ((uint32_t)0x00008000U) /*!<Filter FIFO Assignment bit 15 */
  1178. #define CAN_FFA1R_FFA16 ((uint32_t)0x00010000U) /*!<Filter FIFO Assignment bit 16 */
  1179. #define CAN_FFA1R_FFA17 ((uint32_t)0x00020000U) /*!<Filter FIFO Assignment bit 17 */
  1180. #define CAN_FFA1R_FFA18 ((uint32_t)0x00040000U) /*!<Filter FIFO Assignment bit 18 */
  1181. #define CAN_FFA1R_FFA19 ((uint32_t)0x00080000U) /*!<Filter FIFO Assignment bit 19 */
  1182. #define CAN_FFA1R_FFA20 ((uint32_t)0x00100000U) /*!<Filter FIFO Assignment bit 20 */
  1183. #define CAN_FFA1R_FFA21 ((uint32_t)0x00200000U) /*!<Filter FIFO Assignment bit 21 */
  1184. #define CAN_FFA1R_FFA22 ((uint32_t)0x00400000U) /*!<Filter FIFO Assignment bit 22 */
  1185. #define CAN_FFA1R_FFA23 ((uint32_t)0x00800000U) /*!<Filter FIFO Assignment bit 23 */
  1186. #define CAN_FFA1R_FFA24 ((uint32_t)0x01000000U) /*!<Filter FIFO Assignment bit 24 */
  1187. #define CAN_FFA1R_FFA25 ((uint32_t)0x02000000U) /*!<Filter FIFO Assignment bit 25 */
  1188. #define CAN_FFA1R_FFA26 ((uint32_t)0x04000000U) /*!<Filter FIFO Assignment bit 26 */
  1189. #define CAN_FFA1R_FFA27 ((uint32_t)0x08000000U) /*!<Filter FIFO Assignment bit 27 */
  1190. /******************* Bit definition for CAN_FA1R register *******************/
  1191. #define CAN_FA1R_FACT ((uint32_t)0x0FFFFFFFU) /*!<Filter Active */
  1192. #define CAN_FA1R_FACT0 ((uint32_t)0x00000001U) /*!<Filter Active bit 0 */
  1193. #define CAN_FA1R_FACT1 ((uint32_t)0x00000002U) /*!<Filter Active bit 1 */
  1194. #define CAN_FA1R_FACT2 ((uint32_t)0x00000004U) /*!<Filter Active bit 2 */
  1195. #define CAN_FA1R_FACT3 ((uint32_t)0x00000008U) /*!<Filter Active bit 3 */
  1196. #define CAN_FA1R_FACT4 ((uint32_t)0x00000010U) /*!<Filter Active bit 4 */
  1197. #define CAN_FA1R_FACT5 ((uint32_t)0x00000020U) /*!<Filter Active bit 5 */
  1198. #define CAN_FA1R_FACT6 ((uint32_t)0x00000040U) /*!<Filter Active bit 6 */
  1199. #define CAN_FA1R_FACT7 ((uint32_t)0x00000080U) /*!<Filter Active bit 7 */
  1200. #define CAN_FA1R_FACT8 ((uint32_t)0x00000100U) /*!<Filter Active bit 8 */
  1201. #define CAN_FA1R_FACT9 ((uint32_t)0x00000200U) /*!<Filter Active bit 9 */
  1202. #define CAN_FA1R_FACT10 ((uint32_t)0x00000400U) /*!<Filter Active bit 10 */
  1203. #define CAN_FA1R_FACT11 ((uint32_t)0x00000800U) /*!<Filter Active bit 11 */
  1204. #define CAN_FA1R_FACT12 ((uint32_t)0x00001000U) /*!<Filter Active bit 12 */
  1205. #define CAN_FA1R_FACT13 ((uint32_t)0x00002000U) /*!<Filter Active bit 13 */
  1206. #define CAN_FA1R_FACT14 ((uint32_t)0x00004000U) /*!<Filter Active bit 14 */
  1207. #define CAN_FA1R_FACT15 ((uint32_t)0x00008000U) /*!<Filter Active bit 15 */
  1208. #define CAN_FA1R_FACT16 ((uint32_t)0x00010000U) /*!<Filter Active bit 16 */
  1209. #define CAN_FA1R_FACT17 ((uint32_t)0x00020000U) /*!<Filter Active bit 17 */
  1210. #define CAN_FA1R_FACT18 ((uint32_t)0x00040000U) /*!<Filter Active bit 18 */
  1211. #define CAN_FA1R_FACT19 ((uint32_t)0x00080000U) /*!<Filter Active bit 19 */
  1212. #define CAN_FA1R_FACT20 ((uint32_t)0x00100000U) /*!<Filter Active bit 20 */
  1213. #define CAN_FA1R_FACT21 ((uint32_t)0x00200000U) /*!<Filter Active bit 21 */
  1214. #define CAN_FA1R_FACT22 ((uint32_t)0x00400000U) /*!<Filter Active bit 22 */
  1215. #define CAN_FA1R_FACT23 ((uint32_t)0x00800000U) /*!<Filter Active bit 23 */
  1216. #define CAN_FA1R_FACT24 ((uint32_t)0x01000000U) /*!<Filter Active bit 24 */
  1217. #define CAN_FA1R_FACT25 ((uint32_t)0x02000000U) /*!<Filter Active bit 25 */
  1218. #define CAN_FA1R_FACT26 ((uint32_t)0x04000000U) /*!<Filter Active bit 26 */
  1219. #define CAN_FA1R_FACT27 ((uint32_t)0x08000000U) /*!<Filter Active bit 27 */
  1220. /******************* Bit definition for CAN_F0R1 register *******************/
  1221. #define CAN_F0R1_FB0 ((uint32_t)0x00000001U) /*!<Filter bit 0 */
  1222. #define CAN_F0R1_FB1 ((uint32_t)0x00000002U) /*!<Filter bit 1 */
  1223. #define CAN_F0R1_FB2 ((uint32_t)0x00000004U) /*!<Filter bit 2 */
  1224. #define CAN_F0R1_FB3 ((uint32_t)0x00000008U) /*!<Filter bit 3 */
  1225. #define CAN_F0R1_FB4 ((uint32_t)0x00000010U) /*!<Filter bit 4 */
  1226. #define CAN_F0R1_FB5 ((uint32_t)0x00000020U) /*!<Filter bit 5 */
  1227. #define CAN_F0R1_FB6 ((uint32_t)0x00000040U) /*!<Filter bit 6 */
  1228. #define CAN_F0R1_FB7 ((uint32_t)0x00000080U) /*!<Filter bit 7 */
  1229. #define CAN_F0R1_FB8 ((uint32_t)0x00000100U) /*!<Filter bit 8 */
  1230. #define CAN_F0R1_FB9 ((uint32_t)0x00000200U) /*!<Filter bit 9 */
  1231. #define CAN_F0R1_FB10 ((uint32_t)0x00000400U) /*!<Filter bit 10 */
  1232. #define CAN_F0R1_FB11 ((uint32_t)0x00000800U) /*!<Filter bit 11 */
  1233. #define CAN_F0R1_FB12 ((uint32_t)0x00001000U) /*!<Filter bit 12 */
  1234. #define CAN_F0R1_FB13 ((uint32_t)0x00002000U) /*!<Filter bit 13 */
  1235. #define CAN_F0R1_FB14 ((uint32_t)0x00004000U) /*!<Filter bit 14 */
  1236. #define CAN_F0R1_FB15 ((uint32_t)0x00008000U) /*!<Filter bit 15 */
  1237. #define CAN_F0R1_FB16 ((uint32_t)0x00010000U) /*!<Filter bit 16 */
  1238. #define CAN_F0R1_FB17 ((uint32_t)0x00020000U) /*!<Filter bit 17 */
  1239. #define CAN_F0R1_FB18 ((uint32_t)0x00040000U) /*!<Filter bit 18 */
  1240. #define CAN_F0R1_FB19 ((uint32_t)0x00080000U) /*!<Filter bit 19 */
  1241. #define CAN_F0R1_FB20 ((uint32_t)0x00100000U) /*!<Filter bit 20 */
  1242. #define CAN_F0R1_FB21 ((uint32_t)0x00200000U) /*!<Filter bit 21 */
  1243. #define CAN_F0R1_FB22 ((uint32_t)0x00400000U) /*!<Filter bit 22 */
  1244. #define CAN_F0R1_FB23 ((uint32_t)0x00800000U) /*!<Filter bit 23 */
  1245. #define CAN_F0R1_FB24 ((uint32_t)0x01000000U) /*!<Filter bit 24 */
  1246. #define CAN_F0R1_FB25 ((uint32_t)0x02000000U) /*!<Filter bit 25 */
  1247. #define CAN_F0R1_FB26 ((uint32_t)0x04000000U) /*!<Filter bit 26 */
  1248. #define CAN_F0R1_FB27 ((uint32_t)0x08000000U) /*!<Filter bit 27 */
  1249. #define CAN_F0R1_FB28 ((uint32_t)0x10000000U) /*!<Filter bit 28 */
  1250. #define CAN_F0R1_FB29 ((uint32_t)0x20000000U) /*!<Filter bit 29 */
  1251. #define CAN_F0R1_FB30 ((uint32_t)0x40000000U) /*!<Filter bit 30 */
  1252. #define CAN_F0R1_FB31 ((uint32_t)0x80000000U) /*!<Filter bit 31 */
  1253. /******************* Bit definition for CAN_F1R1 register *******************/
  1254. #define CAN_F1R1_FB0 ((uint32_t)0x00000001U) /*!<Filter bit 0 */
  1255. #define CAN_F1R1_FB1 ((uint32_t)0x00000002U) /*!<Filter bit 1 */
  1256. #define CAN_F1R1_FB2 ((uint32_t)0x00000004U) /*!<Filter bit 2 */
  1257. #define CAN_F1R1_FB3 ((uint32_t)0x00000008U) /*!<Filter bit 3 */
  1258. #define CAN_F1R1_FB4 ((uint32_t)0x00000010U) /*!<Filter bit 4 */
  1259. #define CAN_F1R1_FB5 ((uint32_t)0x00000020U) /*!<Filter bit 5 */
  1260. #define CAN_F1R1_FB6 ((uint32_t)0x00000040U) /*!<Filter bit 6 */
  1261. #define CAN_F1R1_FB7 ((uint32_t)0x00000080U) /*!<Filter bit 7 */
  1262. #define CAN_F1R1_FB8 ((uint32_t)0x00000100U) /*!<Filter bit 8 */
  1263. #define CAN_F1R1_FB9 ((uint32_t)0x00000200U) /*!<Filter bit 9 */
  1264. #define CAN_F1R1_FB10 ((uint32_t)0x00000400U) /*!<Filter bit 10 */
  1265. #define CAN_F1R1_FB11 ((uint32_t)0x00000800U) /*!<Filter bit 11 */
  1266. #define CAN_F1R1_FB12 ((uint32_t)0x00001000U) /*!<Filter bit 12 */
  1267. #define CAN_F1R1_FB13 ((uint32_t)0x00002000U) /*!<Filter bit 13 */
  1268. #define CAN_F1R1_FB14 ((uint32_t)0x00004000U) /*!<Filter bit 14 */
  1269. #define CAN_F1R1_FB15 ((uint32_t)0x00008000U) /*!<Filter bit 15 */
  1270. #define CAN_F1R1_FB16 ((uint32_t)0x00010000U) /*!<Filter bit 16 */
  1271. #define CAN_F1R1_FB17 ((uint32_t)0x00020000U) /*!<Filter bit 17 */
  1272. #define CAN_F1R1_FB18 ((uint32_t)0x00040000U) /*!<Filter bit 18 */
  1273. #define CAN_F1R1_FB19 ((uint32_t)0x00080000U) /*!<Filter bit 19 */
  1274. #define CAN_F1R1_FB20 ((uint32_t)0x00100000U) /*!<Filter bit 20 */
  1275. #define CAN_F1R1_FB21 ((uint32_t)0x00200000U) /*!<Filter bit 21 */
  1276. #define CAN_F1R1_FB22 ((uint32_t)0x00400000U) /*!<Filter bit 22 */
  1277. #define CAN_F1R1_FB23 ((uint32_t)0x00800000U) /*!<Filter bit 23 */
  1278. #define CAN_F1R1_FB24 ((uint32_t)0x01000000U) /*!<Filter bit 24 */
  1279. #define CAN_F1R1_FB25 ((uint32_t)0x02000000U) /*!<Filter bit 25 */
  1280. #define CAN_F1R1_FB26 ((uint32_t)0x04000000U) /*!<Filter bit 26 */
  1281. #define CAN_F1R1_FB27 ((uint32_t)0x08000000U) /*!<Filter bit 27 */
  1282. #define CAN_F1R1_FB28 ((uint32_t)0x10000000U) /*!<Filter bit 28 */
  1283. #define CAN_F1R1_FB29 ((uint32_t)0x20000000U) /*!<Filter bit 29 */
  1284. #define CAN_F1R1_FB30 ((uint32_t)0x40000000U) /*!<Filter bit 30 */
  1285. #define CAN_F1R1_FB31 ((uint32_t)0x80000000U) /*!<Filter bit 31 */
  1286. /******************* Bit definition for CAN_F2R1 register *******************/
  1287. #define CAN_F2R1_FB0 ((uint32_t)0x00000001U) /*!<Filter bit 0 */
  1288. #define CAN_F2R1_FB1 ((uint32_t)0x00000002U) /*!<Filter bit 1 */
  1289. #define CAN_F2R1_FB2 ((uint32_t)0x00000004U) /*!<Filter bit 2 */
  1290. #define CAN_F2R1_FB3 ((uint32_t)0x00000008U) /*!<Filter bit 3 */
  1291. #define CAN_F2R1_FB4 ((uint32_t)0x00000010U) /*!<Filter bit 4 */
  1292. #define CAN_F2R1_FB5 ((uint32_t)0x00000020U) /*!<Filter bit 5 */
  1293. #define CAN_F2R1_FB6 ((uint32_t)0x00000040U) /*!<Filter bit 6 */
  1294. #define CAN_F2R1_FB7 ((uint32_t)0x00000080U) /*!<Filter bit 7 */
  1295. #define CAN_F2R1_FB8 ((uint32_t)0x00000100U) /*!<Filter bit 8 */
  1296. #define CAN_F2R1_FB9 ((uint32_t)0x00000200U) /*!<Filter bit 9 */
  1297. #define CAN_F2R1_FB10 ((uint32_t)0x00000400U) /*!<Filter bit 10 */
  1298. #define CAN_F2R1_FB11 ((uint32_t)0x00000800U) /*!<Filter bit 11 */
  1299. #define CAN_F2R1_FB12 ((uint32_t)0x00001000U) /*!<Filter bit 12 */
  1300. #define CAN_F2R1_FB13 ((uint32_t)0x00002000U) /*!<Filter bit 13 */
  1301. #define CAN_F2R1_FB14 ((uint32_t)0x00004000U) /*!<Filter bit 14 */
  1302. #define CAN_F2R1_FB15 ((uint32_t)0x00008000U) /*!<Filter bit 15 */
  1303. #define CAN_F2R1_FB16 ((uint32_t)0x00010000U) /*!<Filter bit 16 */
  1304. #define CAN_F2R1_FB17 ((uint32_t)0x00020000U) /*!<Filter bit 17 */
  1305. #define CAN_F2R1_FB18 ((uint32_t)0x00040000U) /*!<Filter bit 18 */
  1306. #define CAN_F2R1_FB19 ((uint32_t)0x00080000U) /*!<Filter bit 19 */
  1307. #define CAN_F2R1_FB20 ((uint32_t)0x00100000U) /*!<Filter bit 20 */
  1308. #define CAN_F2R1_FB21 ((uint32_t)0x00200000U) /*!<Filter bit 21 */
  1309. #define CAN_F2R1_FB22 ((uint32_t)0x00400000U) /*!<Filter bit 22 */
  1310. #define CAN_F2R1_FB23 ((uint32_t)0x00800000U) /*!<Filter bit 23 */
  1311. #define CAN_F2R1_FB24 ((uint32_t)0x01000000U) /*!<Filter bit 24 */
  1312. #define CAN_F2R1_FB25 ((uint32_t)0x02000000U) /*!<Filter bit 25 */
  1313. #define CAN_F2R1_FB26 ((uint32_t)0x04000000U) /*!<Filter bit 26 */
  1314. #define CAN_F2R1_FB27 ((uint32_t)0x08000000U) /*!<Filter bit 27 */
  1315. #define CAN_F2R1_FB28 ((uint32_t)0x10000000U) /*!<Filter bit 28 */
  1316. #define CAN_F2R1_FB29 ((uint32_t)0x20000000U) /*!<Filter bit 29 */
  1317. #define CAN_F2R1_FB30 ((uint32_t)0x40000000U) /*!<Filter bit 30 */
  1318. #define CAN_F2R1_FB31 ((uint32_t)0x80000000U) /*!<Filter bit 31 */
  1319. /******************* Bit definition for CAN_F3R1 register *******************/
  1320. #define CAN_F3R1_FB0 ((uint32_t)0x00000001U) /*!<Filter bit 0 */
  1321. #define CAN_F3R1_FB1 ((uint32_t)0x00000002U) /*!<Filter bit 1 */
  1322. #define CAN_F3R1_FB2 ((uint32_t)0x00000004U) /*!<Filter bit 2 */
  1323. #define CAN_F3R1_FB3 ((uint32_t)0x00000008U) /*!<Filter bit 3 */
  1324. #define CAN_F3R1_FB4 ((uint32_t)0x00000010U) /*!<Filter bit 4 */
  1325. #define CAN_F3R1_FB5 ((uint32_t)0x00000020U) /*!<Filter bit 5 */
  1326. #define CAN_F3R1_FB6 ((uint32_t)0x00000040U) /*!<Filter bit 6 */
  1327. #define CAN_F3R1_FB7 ((uint32_t)0x00000080U) /*!<Filter bit 7 */
  1328. #define CAN_F3R1_FB8 ((uint32_t)0x00000100U) /*!<Filter bit 8 */
  1329. #define CAN_F3R1_FB9 ((uint32_t)0x00000200U) /*!<Filter bit 9 */
  1330. #define CAN_F3R1_FB10 ((uint32_t)0x00000400U) /*!<Filter bit 10 */
  1331. #define CAN_F3R1_FB11 ((uint32_t)0x00000800U) /*!<Filter bit 11 */
  1332. #define CAN_F3R1_FB12 ((uint32_t)0x00001000U) /*!<Filter bit 12 */
  1333. #define CAN_F3R1_FB13 ((uint32_t)0x00002000U) /*!<Filter bit 13 */
  1334. #define CAN_F3R1_FB14 ((uint32_t)0x00004000U) /*!<Filter bit 14 */
  1335. #define CAN_F3R1_FB15 ((uint32_t)0x00008000U) /*!<Filter bit 15 */
  1336. #define CAN_F3R1_FB16 ((uint32_t)0x00010000U) /*!<Filter bit 16 */
  1337. #define CAN_F3R1_FB17 ((uint32_t)0x00020000U) /*!<Filter bit 17 */
  1338. #define CAN_F3R1_FB18 ((uint32_t)0x00040000U) /*!<Filter bit 18 */
  1339. #define CAN_F3R1_FB19 ((uint32_t)0x00080000U) /*!<Filter bit 19 */
  1340. #define CAN_F3R1_FB20 ((uint32_t)0x00100000U) /*!<Filter bit 20 */
  1341. #define CAN_F3R1_FB21 ((uint32_t)0x00200000U) /*!<Filter bit 21 */
  1342. #define CAN_F3R1_FB22 ((uint32_t)0x00400000U) /*!<Filter bit 22 */
  1343. #define CAN_F3R1_FB23 ((uint32_t)0x00800000U) /*!<Filter bit 23 */
  1344. #define CAN_F3R1_FB24 ((uint32_t)0x01000000U) /*!<Filter bit 24 */
  1345. #define CAN_F3R1_FB25 ((uint32_t)0x02000000U) /*!<Filter bit 25 */
  1346. #define CAN_F3R1_FB26 ((uint32_t)0x04000000U) /*!<Filter bit 26 */
  1347. #define CAN_F3R1_FB27 ((uint32_t)0x08000000U) /*!<Filter bit 27 */
  1348. #define CAN_F3R1_FB28 ((uint32_t)0x10000000U) /*!<Filter bit 28 */
  1349. #define CAN_F3R1_FB29 ((uint32_t)0x20000000U) /*!<Filter bit 29 */
  1350. #define CAN_F3R1_FB30 ((uint32_t)0x40000000U) /*!<Filter bit 30 */
  1351. #define CAN_F3R1_FB31 ((uint32_t)0x80000000U) /*!<Filter bit 31 */
  1352. /******************* Bit definition for CAN_F4R1 register *******************/
  1353. #define CAN_F4R1_FB0 ((uint32_t)0x00000001U) /*!<Filter bit 0 */
  1354. #define CAN_F4R1_FB1 ((uint32_t)0x00000002U) /*!<Filter bit 1 */
  1355. #define CAN_F4R1_FB2 ((uint32_t)0x00000004U) /*!<Filter bit 2 */
  1356. #define CAN_F4R1_FB3 ((uint32_t)0x00000008U) /*!<Filter bit 3 */
  1357. #define CAN_F4R1_FB4 ((uint32_t)0x00000010U) /*!<Filter bit 4 */
  1358. #define CAN_F4R1_FB5 ((uint32_t)0x00000020U) /*!<Filter bit 5 */
  1359. #define CAN_F4R1_FB6 ((uint32_t)0x00000040U) /*!<Filter bit 6 */
  1360. #define CAN_F4R1_FB7 ((uint32_t)0x00000080U) /*!<Filter bit 7 */
  1361. #define CAN_F4R1_FB8 ((uint32_t)0x00000100U) /*!<Filter bit 8 */
  1362. #define CAN_F4R1_FB9 ((uint32_t)0x00000200U) /*!<Filter bit 9 */
  1363. #define CAN_F4R1_FB10 ((uint32_t)0x00000400U) /*!<Filter bit 10 */
  1364. #define CAN_F4R1_FB11 ((uint32_t)0x00000800U) /*!<Filter bit 11 */
  1365. #define CAN_F4R1_FB12 ((uint32_t)0x00001000U) /*!<Filter bit 12 */
  1366. #define CAN_F4R1_FB13 ((uint32_t)0x00002000U) /*!<Filter bit 13 */
  1367. #define CAN_F4R1_FB14 ((uint32_t)0x00004000U) /*!<Filter bit 14 */
  1368. #define CAN_F4R1_FB15 ((uint32_t)0x00008000U) /*!<Filter bit 15 */
  1369. #define CAN_F4R1_FB16 ((uint32_t)0x00010000U) /*!<Filter bit 16 */
  1370. #define CAN_F4R1_FB17 ((uint32_t)0x00020000U) /*!<Filter bit 17 */
  1371. #define CAN_F4R1_FB18 ((uint32_t)0x00040000U) /*!<Filter bit 18 */
  1372. #define CAN_F4R1_FB19 ((uint32_t)0x00080000U) /*!<Filter bit 19 */
  1373. #define CAN_F4R1_FB20 ((uint32_t)0x00100000U) /*!<Filter bit 20 */
  1374. #define CAN_F4R1_FB21 ((uint32_t)0x00200000U) /*!<Filter bit 21 */
  1375. #define CAN_F4R1_FB22 ((uint32_t)0x00400000U) /*!<Filter bit 22 */
  1376. #define CAN_F4R1_FB23 ((uint32_t)0x00800000U) /*!<Filter bit 23 */
  1377. #define CAN_F4R1_FB24 ((uint32_t)0x01000000U) /*!<Filter bit 24 */
  1378. #define CAN_F4R1_FB25 ((uint32_t)0x02000000U) /*!<Filter bit 25 */
  1379. #define CAN_F4R1_FB26 ((uint32_t)0x04000000U) /*!<Filter bit 26 */
  1380. #define CAN_F4R1_FB27 ((uint32_t)0x08000000U) /*!<Filter bit 27 */
  1381. #define CAN_F4R1_FB28 ((uint32_t)0x10000000U) /*!<Filter bit 28 */
  1382. #define CAN_F4R1_FB29 ((uint32_t)0x20000000U) /*!<Filter bit 29 */
  1383. #define CAN_F4R1_FB30 ((uint32_t)0x40000000U) /*!<Filter bit 30 */
  1384. #define CAN_F4R1_FB31 ((uint32_t)0x80000000U) /*!<Filter bit 31 */
  1385. /******************* Bit definition for CAN_F5R1 register *******************/
  1386. #define CAN_F5R1_FB0 ((uint32_t)0x00000001U) /*!<Filter bit 0 */
  1387. #define CAN_F5R1_FB1 ((uint32_t)0x00000002U) /*!<Filter bit 1 */
  1388. #define CAN_F5R1_FB2 ((uint32_t)0x00000004U) /*!<Filter bit 2 */
  1389. #define CAN_F5R1_FB3 ((uint32_t)0x00000008U) /*!<Filter bit 3 */
  1390. #define CAN_F5R1_FB4 ((uint32_t)0x00000010U) /*!<Filter bit 4 */
  1391. #define CAN_F5R1_FB5 ((uint32_t)0x00000020U) /*!<Filter bit 5 */
  1392. #define CAN_F5R1_FB6 ((uint32_t)0x00000040U) /*!<Filter bit 6 */
  1393. #define CAN_F5R1_FB7 ((uint32_t)0x00000080U) /*!<Filter bit 7 */
  1394. #define CAN_F5R1_FB8 ((uint32_t)0x00000100U) /*!<Filter bit 8 */
  1395. #define CAN_F5R1_FB9 ((uint32_t)0x00000200U) /*!<Filter bit 9 */
  1396. #define CAN_F5R1_FB10 ((uint32_t)0x00000400U) /*!<Filter bit 10 */
  1397. #define CAN_F5R1_FB11 ((uint32_t)0x00000800U) /*!<Filter bit 11 */
  1398. #define CAN_F5R1_FB12 ((uint32_t)0x00001000U) /*!<Filter bit 12 */
  1399. #define CAN_F5R1_FB13 ((uint32_t)0x00002000U) /*!<Filter bit 13 */
  1400. #define CAN_F5R1_FB14 ((uint32_t)0x00004000U) /*!<Filter bit 14 */
  1401. #define CAN_F5R1_FB15 ((uint32_t)0x00008000U) /*!<Filter bit 15 */
  1402. #define CAN_F5R1_FB16 ((uint32_t)0x00010000U) /*!<Filter bit 16 */
  1403. #define CAN_F5R1_FB17 ((uint32_t)0x00020000U) /*!<Filter bit 17 */
  1404. #define CAN_F5R1_FB18 ((uint32_t)0x00040000U) /*!<Filter bit 18 */
  1405. #define CAN_F5R1_FB19 ((uint32_t)0x00080000U) /*!<Filter bit 19 */
  1406. #define CAN_F5R1_FB20 ((uint32_t)0x00100000U) /*!<Filter bit 20 */
  1407. #define CAN_F5R1_FB21 ((uint32_t)0x00200000U) /*!<Filter bit 21 */
  1408. #define CAN_F5R1_FB22 ((uint32_t)0x00400000U) /*!<Filter bit 22 */
  1409. #define CAN_F5R1_FB23 ((uint32_t)0x00800000U) /*!<Filter bit 23 */
  1410. #define CAN_F5R1_FB24 ((uint32_t)0x01000000U) /*!<Filter bit 24 */
  1411. #define CAN_F5R1_FB25 ((uint32_t)0x02000000U) /*!<Filter bit 25 */
  1412. #define CAN_F5R1_FB26 ((uint32_t)0x04000000U) /*!<Filter bit 26 */
  1413. #define CAN_F5R1_FB27 ((uint32_t)0x08000000U) /*!<Filter bit 27 */
  1414. #define CAN_F5R1_FB28 ((uint32_t)0x10000000U) /*!<Filter bit 28 */
  1415. #define CAN_F5R1_FB29 ((uint32_t)0x20000000U) /*!<Filter bit 29 */
  1416. #define CAN_F5R1_FB30 ((uint32_t)0x40000000U) /*!<Filter bit 30 */
  1417. #define CAN_F5R1_FB31 ((uint32_t)0x80000000U) /*!<Filter bit 31 */
  1418. /******************* Bit definition for CAN_F6R1 register *******************/
  1419. #define CAN_F6R1_FB0 ((uint32_t)0x00000001U) /*!<Filter bit 0 */
  1420. #define CAN_F6R1_FB1 ((uint32_t)0x00000002U) /*!<Filter bit 1 */
  1421. #define CAN_F6R1_FB2 ((uint32_t)0x00000004U) /*!<Filter bit 2 */
  1422. #define CAN_F6R1_FB3 ((uint32_t)0x00000008U) /*!<Filter bit 3 */
  1423. #define CAN_F6R1_FB4 ((uint32_t)0x00000010U) /*!<Filter bit 4 */
  1424. #define CAN_F6R1_FB5 ((uint32_t)0x00000020U) /*!<Filter bit 5 */
  1425. #define CAN_F6R1_FB6 ((uint32_t)0x00000040U) /*!<Filter bit 6 */
  1426. #define CAN_F6R1_FB7 ((uint32_t)0x00000080U) /*!<Filter bit 7 */
  1427. #define CAN_F6R1_FB8 ((uint32_t)0x00000100U) /*!<Filter bit 8 */
  1428. #define CAN_F6R1_FB9 ((uint32_t)0x00000200U) /*!<Filter bit 9 */
  1429. #define CAN_F6R1_FB10 ((uint32_t)0x00000400U) /*!<Filter bit 10 */
  1430. #define CAN_F6R1_FB11 ((uint32_t)0x00000800U) /*!<Filter bit 11 */
  1431. #define CAN_F6R1_FB12 ((uint32_t)0x00001000U) /*!<Filter bit 12 */
  1432. #define CAN_F6R1_FB13 ((uint32_t)0x00002000U) /*!<Filter bit 13 */
  1433. #define CAN_F6R1_FB14 ((uint32_t)0x00004000U) /*!<Filter bit 14 */
  1434. #define CAN_F6R1_FB15 ((uint32_t)0x00008000U) /*!<Filter bit 15 */
  1435. #define CAN_F6R1_FB16 ((uint32_t)0x00010000U) /*!<Filter bit 16 */
  1436. #define CAN_F6R1_FB17 ((uint32_t)0x00020000U) /*!<Filter bit 17 */
  1437. #define CAN_F6R1_FB18 ((uint32_t)0x00040000U) /*!<Filter bit 18 */
  1438. #define CAN_F6R1_FB19 ((uint32_t)0x00080000U) /*!<Filter bit 19 */
  1439. #define CAN_F6R1_FB20 ((uint32_t)0x00100000U) /*!<Filter bit 20 */
  1440. #define CAN_F6R1_FB21 ((uint32_t)0x00200000U) /*!<Filter bit 21 */
  1441. #define CAN_F6R1_FB22 ((uint32_t)0x00400000U) /*!<Filter bit 22 */
  1442. #define CAN_F6R1_FB23 ((uint32_t)0x00800000U) /*!<Filter bit 23 */
  1443. #define CAN_F6R1_FB24 ((uint32_t)0x01000000U) /*!<Filter bit 24 */
  1444. #define CAN_F6R1_FB25 ((uint32_t)0x02000000U) /*!<Filter bit 25 */
  1445. #define CAN_F6R1_FB26 ((uint32_t)0x04000000U) /*!<Filter bit 26 */
  1446. #define CAN_F6R1_FB27 ((uint32_t)0x08000000U) /*!<Filter bit 27 */
  1447. #define CAN_F6R1_FB28 ((uint32_t)0x10000000U) /*!<Filter bit 28 */
  1448. #define CAN_F6R1_FB29 ((uint32_t)0x20000000U) /*!<Filter bit 29 */
  1449. #define CAN_F6R1_FB30 ((uint32_t)0x40000000U) /*!<Filter bit 30 */
  1450. #define CAN_F6R1_FB31 ((uint32_t)0x80000000U) /*!<Filter bit 31 */
  1451. /******************* Bit definition for CAN_F7R1 register *******************/
  1452. #define CAN_F7R1_FB0 ((uint32_t)0x00000001U) /*!<Filter bit 0 */
  1453. #define CAN_F7R1_FB1 ((uint32_t)0x00000002U) /*!<Filter bit 1 */
  1454. #define CAN_F7R1_FB2 ((uint32_t)0x00000004U) /*!<Filter bit 2 */
  1455. #define CAN_F7R1_FB3 ((uint32_t)0x00000008U) /*!<Filter bit 3 */
  1456. #define CAN_F7R1_FB4 ((uint32_t)0x00000010U) /*!<Filter bit 4 */
  1457. #define CAN_F7R1_FB5 ((uint32_t)0x00000020U) /*!<Filter bit 5 */
  1458. #define CAN_F7R1_FB6 ((uint32_t)0x00000040U) /*!<Filter bit 6 */
  1459. #define CAN_F7R1_FB7 ((uint32_t)0x00000080U) /*!<Filter bit 7 */
  1460. #define CAN_F7R1_FB8 ((uint32_t)0x00000100U) /*!<Filter bit 8 */
  1461. #define CAN_F7R1_FB9 ((uint32_t)0x00000200U) /*!<Filter bit 9 */
  1462. #define CAN_F7R1_FB10 ((uint32_t)0x00000400U) /*!<Filter bit 10 */
  1463. #define CAN_F7R1_FB11 ((uint32_t)0x00000800U) /*!<Filter bit 11 */
  1464. #define CAN_F7R1_FB12 ((uint32_t)0x00001000U) /*!<Filter bit 12 */
  1465. #define CAN_F7R1_FB13 ((uint32_t)0x00002000U) /*!<Filter bit 13 */
  1466. #define CAN_F7R1_FB14 ((uint32_t)0x00004000U) /*!<Filter bit 14 */
  1467. #define CAN_F7R1_FB15 ((uint32_t)0x00008000U) /*!<Filter bit 15 */
  1468. #define CAN_F7R1_FB16 ((uint32_t)0x00010000U) /*!<Filter bit 16 */
  1469. #define CAN_F7R1_FB17 ((uint32_t)0x00020000U) /*!<Filter bit 17 */
  1470. #define CAN_F7R1_FB18 ((uint32_t)0x00040000U) /*!<Filter bit 18 */
  1471. #define CAN_F7R1_FB19 ((uint32_t)0x00080000U) /*!<Filter bit 19 */
  1472. #define CAN_F7R1_FB20 ((uint32_t)0x00100000U) /*!<Filter bit 20 */
  1473. #define CAN_F7R1_FB21 ((uint32_t)0x00200000U) /*!<Filter bit 21 */
  1474. #define CAN_F7R1_FB22 ((uint32_t)0x00400000U) /*!<Filter bit 22 */
  1475. #define CAN_F7R1_FB23 ((uint32_t)0x00800000U) /*!<Filter bit 23 */
  1476. #define CAN_F7R1_FB24 ((uint32_t)0x01000000U) /*!<Filter bit 24 */
  1477. #define CAN_F7R1_FB25 ((uint32_t)0x02000000U) /*!<Filter bit 25 */
  1478. #define CAN_F7R1_FB26 ((uint32_t)0x04000000U) /*!<Filter bit 26 */
  1479. #define CAN_F7R1_FB27 ((uint32_t)0x08000000U) /*!<Filter bit 27 */
  1480. #define CAN_F7R1_FB28 ((uint32_t)0x10000000U) /*!<Filter bit 28 */
  1481. #define CAN_F7R1_FB29 ((uint32_t)0x20000000U) /*!<Filter bit 29 */
  1482. #define CAN_F7R1_FB30 ((uint32_t)0x40000000U) /*!<Filter bit 30 */
  1483. #define CAN_F7R1_FB31 ((uint32_t)0x80000000U) /*!<Filter bit 31 */
  1484. /******************* Bit definition for CAN_F8R1 register *******************/
  1485. #define CAN_F8R1_FB0 ((uint32_t)0x00000001U) /*!<Filter bit 0 */
  1486. #define CAN_F8R1_FB1 ((uint32_t)0x00000002U) /*!<Filter bit 1 */
  1487. #define CAN_F8R1_FB2 ((uint32_t)0x00000004U) /*!<Filter bit 2 */
  1488. #define CAN_F8R1_FB3 ((uint32_t)0x00000008U) /*!<Filter bit 3 */
  1489. #define CAN_F8R1_FB4 ((uint32_t)0x00000010U) /*!<Filter bit 4 */
  1490. #define CAN_F8R1_FB5 ((uint32_t)0x00000020U) /*!<Filter bit 5 */
  1491. #define CAN_F8R1_FB6 ((uint32_t)0x00000040U) /*!<Filter bit 6 */
  1492. #define CAN_F8R1_FB7 ((uint32_t)0x00000080U) /*!<Filter bit 7 */
  1493. #define CAN_F8R1_FB8 ((uint32_t)0x00000100U) /*!<Filter bit 8 */
  1494. #define CAN_F8R1_FB9 ((uint32_t)0x00000200U) /*!<Filter bit 9 */
  1495. #define CAN_F8R1_FB10 ((uint32_t)0x00000400U) /*!<Filter bit 10 */
  1496. #define CAN_F8R1_FB11 ((uint32_t)0x00000800U) /*!<Filter bit 11 */
  1497. #define CAN_F8R1_FB12 ((uint32_t)0x00001000U) /*!<Filter bit 12 */
  1498. #define CAN_F8R1_FB13 ((uint32_t)0x00002000U) /*!<Filter bit 13 */
  1499. #define CAN_F8R1_FB14 ((uint32_t)0x00004000U) /*!<Filter bit 14 */
  1500. #define CAN_F8R1_FB15 ((uint32_t)0x00008000U) /*!<Filter bit 15 */
  1501. #define CAN_F8R1_FB16 ((uint32_t)0x00010000U) /*!<Filter bit 16 */
  1502. #define CAN_F8R1_FB17 ((uint32_t)0x00020000U) /*!<Filter bit 17 */
  1503. #define CAN_F8R1_FB18 ((uint32_t)0x00040000U) /*!<Filter bit 18 */
  1504. #define CAN_F8R1_FB19 ((uint32_t)0x00080000U) /*!<Filter bit 19 */
  1505. #define CAN_F8R1_FB20 ((uint32_t)0x00100000U) /*!<Filter bit 20 */
  1506. #define CAN_F8R1_FB21 ((uint32_t)0x00200000U) /*!<Filter bit 21 */
  1507. #define CAN_F8R1_FB22 ((uint32_t)0x00400000U) /*!<Filter bit 22 */
  1508. #define CAN_F8R1_FB23 ((uint32_t)0x00800000U) /*!<Filter bit 23 */
  1509. #define CAN_F8R1_FB24 ((uint32_t)0x01000000U) /*!<Filter bit 24 */
  1510. #define CAN_F8R1_FB25 ((uint32_t)0x02000000U) /*!<Filter bit 25 */
  1511. #define CAN_F8R1_FB26 ((uint32_t)0x04000000U) /*!<Filter bit 26 */
  1512. #define CAN_F8R1_FB27 ((uint32_t)0x08000000U) /*!<Filter bit 27 */
  1513. #define CAN_F8R1_FB28 ((uint32_t)0x10000000U) /*!<Filter bit 28 */
  1514. #define CAN_F8R1_FB29 ((uint32_t)0x20000000U) /*!<Filter bit 29 */
  1515. #define CAN_F8R1_FB30 ((uint32_t)0x40000000U) /*!<Filter bit 30 */
  1516. #define CAN_F8R1_FB31 ((uint32_t)0x80000000U) /*!<Filter bit 31 */
  1517. /******************* Bit definition for CAN_F9R1 register *******************/
  1518. #define CAN_F9R1_FB0 ((uint32_t)0x00000001U) /*!<Filter bit 0 */
  1519. #define CAN_F9R1_FB1 ((uint32_t)0x00000002U) /*!<Filter bit 1 */
  1520. #define CAN_F9R1_FB2 ((uint32_t)0x00000004U) /*!<Filter bit 2 */
  1521. #define CAN_F9R1_FB3 ((uint32_t)0x00000008U) /*!<Filter bit 3 */
  1522. #define CAN_F9R1_FB4 ((uint32_t)0x00000010U) /*!<Filter bit 4 */
  1523. #define CAN_F9R1_FB5 ((uint32_t)0x00000020U) /*!<Filter bit 5 */
  1524. #define CAN_F9R1_FB6 ((uint32_t)0x00000040U) /*!<Filter bit 6 */
  1525. #define CAN_F9R1_FB7 ((uint32_t)0x00000080U) /*!<Filter bit 7 */
  1526. #define CAN_F9R1_FB8 ((uint32_t)0x00000100U) /*!<Filter bit 8 */
  1527. #define CAN_F9R1_FB9 ((uint32_t)0x00000200U) /*!<Filter bit 9 */
  1528. #define CAN_F9R1_FB10 ((uint32_t)0x00000400U) /*!<Filter bit 10 */
  1529. #define CAN_F9R1_FB11 ((uint32_t)0x00000800U) /*!<Filter bit 11 */
  1530. #define CAN_F9R1_FB12 ((uint32_t)0x00001000U) /*!<Filter bit 12 */
  1531. #define CAN_F9R1_FB13 ((uint32_t)0x00002000U) /*!<Filter bit 13 */
  1532. #define CAN_F9R1_FB14 ((uint32_t)0x00004000U) /*!<Filter bit 14 */
  1533. #define CAN_F9R1_FB15 ((uint32_t)0x00008000U) /*!<Filter bit 15 */
  1534. #define CAN_F9R1_FB16 ((uint32_t)0x00010000U) /*!<Filter bit 16 */
  1535. #define CAN_F9R1_FB17 ((uint32_t)0x00020000U) /*!<Filter bit 17 */
  1536. #define CAN_F9R1_FB18 ((uint32_t)0x00040000U) /*!<Filter bit 18 */
  1537. #define CAN_F9R1_FB19 ((uint32_t)0x00080000U) /*!<Filter bit 19 */
  1538. #define CAN_F9R1_FB20 ((uint32_t)0x00100000U) /*!<Filter bit 20 */
  1539. #define CAN_F9R1_FB21 ((uint32_t)0x00200000U) /*!<Filter bit 21 */
  1540. #define CAN_F9R1_FB22 ((uint32_t)0x00400000U) /*!<Filter bit 22 */
  1541. #define CAN_F9R1_FB23 ((uint32_t)0x00800000U) /*!<Filter bit 23 */
  1542. #define CAN_F9R1_FB24 ((uint32_t)0x01000000U) /*!<Filter bit 24 */
  1543. #define CAN_F9R1_FB25 ((uint32_t)0x02000000U) /*!<Filter bit 25 */
  1544. #define CAN_F9R1_FB26 ((uint32_t)0x04000000U) /*!<Filter bit 26 */
  1545. #define CAN_F9R1_FB27 ((uint32_t)0x08000000U) /*!<Filter bit 27 */
  1546. #define CAN_F9R1_FB28 ((uint32_t)0x10000000U) /*!<Filter bit 28 */
  1547. #define CAN_F9R1_FB29 ((uint32_t)0x20000000U) /*!<Filter bit 29 */
  1548. #define CAN_F9R1_FB30 ((uint32_t)0x40000000U) /*!<Filter bit 30 */
  1549. #define CAN_F9R1_FB31 ((uint32_t)0x80000000U) /*!<Filter bit 31 */
  1550. /******************* Bit definition for CAN_F10R1 register ******************/
  1551. #define CAN_F10R1_FB0 ((uint32_t)0x00000001U) /*!<Filter bit 0 */
  1552. #define CAN_F10R1_FB1 ((uint32_t)0x00000002U) /*!<Filter bit 1 */
  1553. #define CAN_F10R1_FB2 ((uint32_t)0x00000004U) /*!<Filter bit 2 */
  1554. #define CAN_F10R1_FB3 ((uint32_t)0x00000008U) /*!<Filter bit 3 */
  1555. #define CAN_F10R1_FB4 ((uint32_t)0x00000010U) /*!<Filter bit 4 */
  1556. #define CAN_F10R1_FB5 ((uint32_t)0x00000020U) /*!<Filter bit 5 */
  1557. #define CAN_F10R1_FB6 ((uint32_t)0x00000040U) /*!<Filter bit 6 */
  1558. #define CAN_F10R1_FB7 ((uint32_t)0x00000080U) /*!<Filter bit 7 */
  1559. #define CAN_F10R1_FB8 ((uint32_t)0x00000100U) /*!<Filter bit 8 */
  1560. #define CAN_F10R1_FB9 ((uint32_t)0x00000200U) /*!<Filter bit 9 */
  1561. #define CAN_F10R1_FB10 ((uint32_t)0x00000400U) /*!<Filter bit 10 */
  1562. #define CAN_F10R1_FB11 ((uint32_t)0x00000800U) /*!<Filter bit 11 */
  1563. #define CAN_F10R1_FB12 ((uint32_t)0x00001000U) /*!<Filter bit 12 */
  1564. #define CAN_F10R1_FB13 ((uint32_t)0x00002000U) /*!<Filter bit 13 */
  1565. #define CAN_F10R1_FB14 ((uint32_t)0x00004000U) /*!<Filter bit 14 */
  1566. #define CAN_F10R1_FB15 ((uint32_t)0x00008000U) /*!<Filter bit 15 */
  1567. #define CAN_F10R1_FB16 ((uint32_t)0x00010000U) /*!<Filter bit 16 */
  1568. #define CAN_F10R1_FB17 ((uint32_t)0x00020000U) /*!<Filter bit 17 */
  1569. #define CAN_F10R1_FB18 ((uint32_t)0x00040000U) /*!<Filter bit 18 */
  1570. #define CAN_F10R1_FB19 ((uint32_t)0x00080000U) /*!<Filter bit 19 */
  1571. #define CAN_F10R1_FB20 ((uint32_t)0x00100000U) /*!<Filter bit 20 */
  1572. #define CAN_F10R1_FB21 ((uint32_t)0x00200000U) /*!<Filter bit 21 */
  1573. #define CAN_F10R1_FB22 ((uint32_t)0x00400000U) /*!<Filter bit 22 */
  1574. #define CAN_F10R1_FB23 ((uint32_t)0x00800000U) /*!<Filter bit 23 */
  1575. #define CAN_F10R1_FB24 ((uint32_t)0x01000000U) /*!<Filter bit 24 */
  1576. #define CAN_F10R1_FB25 ((uint32_t)0x02000000U) /*!<Filter bit 25 */
  1577. #define CAN_F10R1_FB26 ((uint32_t)0x04000000U) /*!<Filter bit 26 */
  1578. #define CAN_F10R1_FB27 ((uint32_t)0x08000000U) /*!<Filter bit 27 */
  1579. #define CAN_F10R1_FB28 ((uint32_t)0x10000000U) /*!<Filter bit 28 */
  1580. #define CAN_F10R1_FB29 ((uint32_t)0x20000000U) /*!<Filter bit 29 */
  1581. #define CAN_F10R1_FB30 ((uint32_t)0x40000000U) /*!<Filter bit 30 */
  1582. #define CAN_F10R1_FB31 ((uint32_t)0x80000000U) /*!<Filter bit 31 */
  1583. /******************* Bit definition for CAN_F11R1 register ******************/
  1584. #define CAN_F11R1_FB0 ((uint32_t)0x00000001U) /*!<Filter bit 0 */
  1585. #define CAN_F11R1_FB1 ((uint32_t)0x00000002U) /*!<Filter bit 1 */
  1586. #define CAN_F11R1_FB2 ((uint32_t)0x00000004U) /*!<Filter bit 2 */
  1587. #define CAN_F11R1_FB3 ((uint32_t)0x00000008U) /*!<Filter bit 3 */
  1588. #define CAN_F11R1_FB4 ((uint32_t)0x00000010U) /*!<Filter bit 4 */
  1589. #define CAN_F11R1_FB5 ((uint32_t)0x00000020U) /*!<Filter bit 5 */
  1590. #define CAN_F11R1_FB6 ((uint32_t)0x00000040U) /*!<Filter bit 6 */
  1591. #define CAN_F11R1_FB7 ((uint32_t)0x00000080U) /*!<Filter bit 7 */
  1592. #define CAN_F11R1_FB8 ((uint32_t)0x00000100U) /*!<Filter bit 8 */
  1593. #define CAN_F11R1_FB9 ((uint32_t)0x00000200U) /*!<Filter bit 9 */
  1594. #define CAN_F11R1_FB10 ((uint32_t)0x00000400U) /*!<Filter bit 10 */
  1595. #define CAN_F11R1_FB11 ((uint32_t)0x00000800U) /*!<Filter bit 11 */
  1596. #define CAN_F11R1_FB12 ((uint32_t)0x00001000U) /*!<Filter bit 12 */
  1597. #define CAN_F11R1_FB13 ((uint32_t)0x00002000U) /*!<Filter bit 13 */
  1598. #define CAN_F11R1_FB14 ((uint32_t)0x00004000U) /*!<Filter bit 14 */
  1599. #define CAN_F11R1_FB15 ((uint32_t)0x00008000U) /*!<Filter bit 15 */
  1600. #define CAN_F11R1_FB16 ((uint32_t)0x00010000U) /*!<Filter bit 16 */
  1601. #define CAN_F11R1_FB17 ((uint32_t)0x00020000U) /*!<Filter bit 17 */
  1602. #define CAN_F11R1_FB18 ((uint32_t)0x00040000U) /*!<Filter bit 18 */
  1603. #define CAN_F11R1_FB19 ((uint32_t)0x00080000U) /*!<Filter bit 19 */
  1604. #define CAN_F11R1_FB20 ((uint32_t)0x00100000U) /*!<Filter bit 20 */
  1605. #define CAN_F11R1_FB21 ((uint32_t)0x00200000U) /*!<Filter bit 21 */
  1606. #define CAN_F11R1_FB22 ((uint32_t)0x00400000U) /*!<Filter bit 22 */
  1607. #define CAN_F11R1_FB23 ((uint32_t)0x00800000U) /*!<Filter bit 23 */
  1608. #define CAN_F11R1_FB24 ((uint32_t)0x01000000U) /*!<Filter bit 24 */
  1609. #define CAN_F11R1_FB25 ((uint32_t)0x02000000U) /*!<Filter bit 25 */
  1610. #define CAN_F11R1_FB26 ((uint32_t)0x04000000U) /*!<Filter bit 26 */
  1611. #define CAN_F11R1_FB27 ((uint32_t)0x08000000U) /*!<Filter bit 27 */
  1612. #define CAN_F11R1_FB28 ((uint32_t)0x10000000U) /*!<Filter bit 28 */
  1613. #define CAN_F11R1_FB29 ((uint32_t)0x20000000U) /*!<Filter bit 29 */
  1614. #define CAN_F11R1_FB30 ((uint32_t)0x40000000U) /*!<Filter bit 30 */
  1615. #define CAN_F11R1_FB31 ((uint32_t)0x80000000U) /*!<Filter bit 31 */
  1616. /******************* Bit definition for CAN_F12R1 register ******************/
  1617. #define CAN_F12R1_FB0 ((uint32_t)0x00000001U) /*!<Filter bit 0 */
  1618. #define CAN_F12R1_FB1 ((uint32_t)0x00000002U) /*!<Filter bit 1 */
  1619. #define CAN_F12R1_FB2 ((uint32_t)0x00000004U) /*!<Filter bit 2 */
  1620. #define CAN_F12R1_FB3 ((uint32_t)0x00000008U) /*!<Filter bit 3 */
  1621. #define CAN_F12R1_FB4 ((uint32_t)0x00000010U) /*!<Filter bit 4 */
  1622. #define CAN_F12R1_FB5 ((uint32_t)0x00000020U) /*!<Filter bit 5 */
  1623. #define CAN_F12R1_FB6 ((uint32_t)0x00000040U) /*!<Filter bit 6 */
  1624. #define CAN_F12R1_FB7 ((uint32_t)0x00000080U) /*!<Filter bit 7 */
  1625. #define CAN_F12R1_FB8 ((uint32_t)0x00000100U) /*!<Filter bit 8 */
  1626. #define CAN_F12R1_FB9 ((uint32_t)0x00000200U) /*!<Filter bit 9 */
  1627. #define CAN_F12R1_FB10 ((uint32_t)0x00000400U) /*!<Filter bit 10 */
  1628. #define CAN_F12R1_FB11 ((uint32_t)0x00000800U) /*!<Filter bit 11 */
  1629. #define CAN_F12R1_FB12 ((uint32_t)0x00001000U) /*!<Filter bit 12 */
  1630. #define CAN_F12R1_FB13 ((uint32_t)0x00002000U) /*!<Filter bit 13 */
  1631. #define CAN_F12R1_FB14 ((uint32_t)0x00004000U) /*!<Filter bit 14 */
  1632. #define CAN_F12R1_FB15 ((uint32_t)0x00008000U) /*!<Filter bit 15 */
  1633. #define CAN_F12R1_FB16 ((uint32_t)0x00010000U) /*!<Filter bit 16 */
  1634. #define CAN_F12R1_FB17 ((uint32_t)0x00020000U) /*!<Filter bit 17 */
  1635. #define CAN_F12R1_FB18 ((uint32_t)0x00040000U) /*!<Filter bit 18 */
  1636. #define CAN_F12R1_FB19 ((uint32_t)0x00080000U) /*!<Filter bit 19 */
  1637. #define CAN_F12R1_FB20 ((uint32_t)0x00100000U) /*!<Filter bit 20 */
  1638. #define CAN_F12R1_FB21 ((uint32_t)0x00200000U) /*!<Filter bit 21 */
  1639. #define CAN_F12R1_FB22 ((uint32_t)0x00400000U) /*!<Filter bit 22 */
  1640. #define CAN_F12R1_FB23 ((uint32_t)0x00800000U) /*!<Filter bit 23 */
  1641. #define CAN_F12R1_FB24 ((uint32_t)0x01000000U) /*!<Filter bit 24 */
  1642. #define CAN_F12R1_FB25 ((uint32_t)0x02000000U) /*!<Filter bit 25 */
  1643. #define CAN_F12R1_FB26 ((uint32_t)0x04000000U) /*!<Filter bit 26 */
  1644. #define CAN_F12R1_FB27 ((uint32_t)0x08000000U) /*!<Filter bit 27 */
  1645. #define CAN_F12R1_FB28 ((uint32_t)0x10000000U) /*!<Filter bit 28 */
  1646. #define CAN_F12R1_FB29 ((uint32_t)0x20000000U) /*!<Filter bit 29 */
  1647. #define CAN_F12R1_FB30 ((uint32_t)0x40000000U) /*!<Filter bit 30 */
  1648. #define CAN_F12R1_FB31 ((uint32_t)0x80000000U) /*!<Filter bit 31 */
  1649. /******************* Bit definition for CAN_F13R1 register ******************/
  1650. #define CAN_F13R1_FB0 ((uint32_t)0x00000001U) /*!<Filter bit 0 */
  1651. #define CAN_F13R1_FB1 ((uint32_t)0x00000002U) /*!<Filter bit 1 */
  1652. #define CAN_F13R1_FB2 ((uint32_t)0x00000004U) /*!<Filter bit 2 */
  1653. #define CAN_F13R1_FB3 ((uint32_t)0x00000008U) /*!<Filter bit 3 */
  1654. #define CAN_F13R1_FB4 ((uint32_t)0x00000010U) /*!<Filter bit 4 */
  1655. #define CAN_F13R1_FB5 ((uint32_t)0x00000020U) /*!<Filter bit 5 */
  1656. #define CAN_F13R1_FB6 ((uint32_t)0x00000040U) /*!<Filter bit 6 */
  1657. #define CAN_F13R1_FB7 ((uint32_t)0x00000080U) /*!<Filter bit 7 */
  1658. #define CAN_F13R1_FB8 ((uint32_t)0x00000100U) /*!<Filter bit 8 */
  1659. #define CAN_F13R1_FB9 ((uint32_t)0x00000200U) /*!<Filter bit 9 */
  1660. #define CAN_F13R1_FB10 ((uint32_t)0x00000400U) /*!<Filter bit 10 */
  1661. #define CAN_F13R1_FB11 ((uint32_t)0x00000800U) /*!<Filter bit 11 */
  1662. #define CAN_F13R1_FB12 ((uint32_t)0x00001000U) /*!<Filter bit 12 */
  1663. #define CAN_F13R1_FB13 ((uint32_t)0x00002000U) /*!<Filter bit 13 */
  1664. #define CAN_F13R1_FB14 ((uint32_t)0x00004000U) /*!<Filter bit 14 */
  1665. #define CAN_F13R1_FB15 ((uint32_t)0x00008000U) /*!<Filter bit 15 */
  1666. #define CAN_F13R1_FB16 ((uint32_t)0x00010000U) /*!<Filter bit 16 */
  1667. #define CAN_F13R1_FB17 ((uint32_t)0x00020000U) /*!<Filter bit 17 */
  1668. #define CAN_F13R1_FB18 ((uint32_t)0x00040000U) /*!<Filter bit 18 */
  1669. #define CAN_F13R1_FB19 ((uint32_t)0x00080000U) /*!<Filter bit 19 */
  1670. #define CAN_F13R1_FB20 ((uint32_t)0x00100000U) /*!<Filter bit 20 */
  1671. #define CAN_F13R1_FB21 ((uint32_t)0x00200000U) /*!<Filter bit 21 */
  1672. #define CAN_F13R1_FB22 ((uint32_t)0x00400000U) /*!<Filter bit 22 */
  1673. #define CAN_F13R1_FB23 ((uint32_t)0x00800000U) /*!<Filter bit 23 */
  1674. #define CAN_F13R1_FB24 ((uint32_t)0x01000000U) /*!<Filter bit 24 */
  1675. #define CAN_F13R1_FB25 ((uint32_t)0x02000000U) /*!<Filter bit 25 */
  1676. #define CAN_F13R1_FB26 ((uint32_t)0x04000000U) /*!<Filter bit 26 */
  1677. #define CAN_F13R1_FB27 ((uint32_t)0x08000000U) /*!<Filter bit 27 */
  1678. #define CAN_F13R1_FB28 ((uint32_t)0x10000000U) /*!<Filter bit 28 */
  1679. #define CAN_F13R1_FB29 ((uint32_t)0x20000000U) /*!<Filter bit 29 */
  1680. #define CAN_F13R1_FB30 ((uint32_t)0x40000000U) /*!<Filter bit 30 */
  1681. #define CAN_F13R1_FB31 ((uint32_t)0x80000000U) /*!<Filter bit 31 */
  1682. /******************* Bit definition for CAN_F0R2 register *******************/
  1683. #define CAN_F0R2_FB0 ((uint32_t)0x00000001U) /*!<Filter bit 0 */
  1684. #define CAN_F0R2_FB1 ((uint32_t)0x00000002U) /*!<Filter bit 1 */
  1685. #define CAN_F0R2_FB2 ((uint32_t)0x00000004U) /*!<Filter bit 2 */
  1686. #define CAN_F0R2_FB3 ((uint32_t)0x00000008U) /*!<Filter bit 3 */
  1687. #define CAN_F0R2_FB4 ((uint32_t)0x00000010U) /*!<Filter bit 4 */
  1688. #define CAN_F0R2_FB5 ((uint32_t)0x00000020U) /*!<Filter bit 5 */
  1689. #define CAN_F0R2_FB6 ((uint32_t)0x00000040U) /*!<Filter bit 6 */
  1690. #define CAN_F0R2_FB7 ((uint32_t)0x00000080U) /*!<Filter bit 7 */
  1691. #define CAN_F0R2_FB8 ((uint32_t)0x00000100U) /*!<Filter bit 8 */
  1692. #define CAN_F0R2_FB9 ((uint32_t)0x00000200U) /*!<Filter bit 9 */
  1693. #define CAN_F0R2_FB10 ((uint32_t)0x00000400U) /*!<Filter bit 10 */
  1694. #define CAN_F0R2_FB11 ((uint32_t)0x00000800U) /*!<Filter bit 11 */
  1695. #define CAN_F0R2_FB12 ((uint32_t)0x00001000U) /*!<Filter bit 12 */
  1696. #define CAN_F0R2_FB13 ((uint32_t)0x00002000U) /*!<Filter bit 13 */
  1697. #define CAN_F0R2_FB14 ((uint32_t)0x00004000U) /*!<Filter bit 14 */
  1698. #define CAN_F0R2_FB15 ((uint32_t)0x00008000U) /*!<Filter bit 15 */
  1699. #define CAN_F0R2_FB16 ((uint32_t)0x00010000U) /*!<Filter bit 16 */
  1700. #define CAN_F0R2_FB17 ((uint32_t)0x00020000U) /*!<Filter bit 17 */
  1701. #define CAN_F0R2_FB18 ((uint32_t)0x00040000U) /*!<Filter bit 18 */
  1702. #define CAN_F0R2_FB19 ((uint32_t)0x00080000U) /*!<Filter bit 19 */
  1703. #define CAN_F0R2_FB20 ((uint32_t)0x00100000U) /*!<Filter bit 20 */
  1704. #define CAN_F0R2_FB21 ((uint32_t)0x00200000U) /*!<Filter bit 21 */
  1705. #define CAN_F0R2_FB22 ((uint32_t)0x00400000U) /*!<Filter bit 22 */
  1706. #define CAN_F0R2_FB23 ((uint32_t)0x00800000U) /*!<Filter bit 23 */
  1707. #define CAN_F0R2_FB24 ((uint32_t)0x01000000U) /*!<Filter bit 24 */
  1708. #define CAN_F0R2_FB25 ((uint32_t)0x02000000U) /*!<Filter bit 25 */
  1709. #define CAN_F0R2_FB26 ((uint32_t)0x04000000U) /*!<Filter bit 26 */
  1710. #define CAN_F0R2_FB27 ((uint32_t)0x08000000U) /*!<Filter bit 27 */
  1711. #define CAN_F0R2_FB28 ((uint32_t)0x10000000U) /*!<Filter bit 28 */
  1712. #define CAN_F0R2_FB29 ((uint32_t)0x20000000U) /*!<Filter bit 29 */
  1713. #define CAN_F0R2_FB30 ((uint32_t)0x40000000U) /*!<Filter bit 30 */
  1714. #define CAN_F0R2_FB31 ((uint32_t)0x80000000U) /*!<Filter bit 31 */
  1715. /******************* Bit definition for CAN_F1R2 register *******************/
  1716. #define CAN_F1R2_FB0 ((uint32_t)0x00000001U) /*!<Filter bit 0 */
  1717. #define CAN_F1R2_FB1 ((uint32_t)0x00000002U) /*!<Filter bit 1 */
  1718. #define CAN_F1R2_FB2 ((uint32_t)0x00000004U) /*!<Filter bit 2 */
  1719. #define CAN_F1R2_FB3 ((uint32_t)0x00000008U) /*!<Filter bit 3 */
  1720. #define CAN_F1R2_FB4 ((uint32_t)0x00000010U) /*!<Filter bit 4 */
  1721. #define CAN_F1R2_FB5 ((uint32_t)0x00000020U) /*!<Filter bit 5 */
  1722. #define CAN_F1R2_FB6 ((uint32_t)0x00000040U) /*!<Filter bit 6 */
  1723. #define CAN_F1R2_FB7 ((uint32_t)0x00000080U) /*!<Filter bit 7 */
  1724. #define CAN_F1R2_FB8 ((uint32_t)0x00000100U) /*!<Filter bit 8 */
  1725. #define CAN_F1R2_FB9 ((uint32_t)0x00000200U) /*!<Filter bit 9 */
  1726. #define CAN_F1R2_FB10 ((uint32_t)0x00000400U) /*!<Filter bit 10 */
  1727. #define CAN_F1R2_FB11 ((uint32_t)0x00000800U) /*!<Filter bit 11 */
  1728. #define CAN_F1R2_FB12 ((uint32_t)0x00001000U) /*!<Filter bit 12 */
  1729. #define CAN_F1R2_FB13 ((uint32_t)0x00002000U) /*!<Filter bit 13 */
  1730. #define CAN_F1R2_FB14 ((uint32_t)0x00004000U) /*!<Filter bit 14 */
  1731. #define CAN_F1R2_FB15 ((uint32_t)0x00008000U) /*!<Filter bit 15 */
  1732. #define CAN_F1R2_FB16 ((uint32_t)0x00010000U) /*!<Filter bit 16 */
  1733. #define CAN_F1R2_FB17 ((uint32_t)0x00020000U) /*!<Filter bit 17 */
  1734. #define CAN_F1R2_FB18 ((uint32_t)0x00040000U) /*!<Filter bit 18 */
  1735. #define CAN_F1R2_FB19 ((uint32_t)0x00080000U) /*!<Filter bit 19 */
  1736. #define CAN_F1R2_FB20 ((uint32_t)0x00100000U) /*!<Filter bit 20 */
  1737. #define CAN_F1R2_FB21 ((uint32_t)0x00200000U) /*!<Filter bit 21 */
  1738. #define CAN_F1R2_FB22 ((uint32_t)0x00400000U) /*!<Filter bit 22 */
  1739. #define CAN_F1R2_FB23 ((uint32_t)0x00800000U) /*!<Filter bit 23 */
  1740. #define CAN_F1R2_FB24 ((uint32_t)0x01000000U) /*!<Filter bit 24 */
  1741. #define CAN_F1R2_FB25 ((uint32_t)0x02000000U) /*!<Filter bit 25 */
  1742. #define CAN_F1R2_FB26 ((uint32_t)0x04000000U) /*!<Filter bit 26 */
  1743. #define CAN_F1R2_FB27 ((uint32_t)0x08000000U) /*!<Filter bit 27 */
  1744. #define CAN_F1R2_FB28 ((uint32_t)0x10000000U) /*!<Filter bit 28 */
  1745. #define CAN_F1R2_FB29 ((uint32_t)0x20000000U) /*!<Filter bit 29 */
  1746. #define CAN_F1R2_FB30 ((uint32_t)0x40000000U) /*!<Filter bit 30 */
  1747. #define CAN_F1R2_FB31 ((uint32_t)0x80000000U) /*!<Filter bit 31 */
  1748. /******************* Bit definition for CAN_F2R2 register *******************/
  1749. #define CAN_F2R2_FB0 ((uint32_t)0x00000001U) /*!<Filter bit 0 */
  1750. #define CAN_F2R2_FB1 ((uint32_t)0x00000002U) /*!<Filter bit 1 */
  1751. #define CAN_F2R2_FB2 ((uint32_t)0x00000004U) /*!<Filter bit 2 */
  1752. #define CAN_F2R2_FB3 ((uint32_t)0x00000008U) /*!<Filter bit 3 */
  1753. #define CAN_F2R2_FB4 ((uint32_t)0x00000010U) /*!<Filter bit 4 */
  1754. #define CAN_F2R2_FB5 ((uint32_t)0x00000020U) /*!<Filter bit 5 */
  1755. #define CAN_F2R2_FB6 ((uint32_t)0x00000040U) /*!<Filter bit 6 */
  1756. #define CAN_F2R2_FB7 ((uint32_t)0x00000080U) /*!<Filter bit 7 */
  1757. #define CAN_F2R2_FB8 ((uint32_t)0x00000100U) /*!<Filter bit 8 */
  1758. #define CAN_F2R2_FB9 ((uint32_t)0x00000200U) /*!<Filter bit 9 */
  1759. #define CAN_F2R2_FB10 ((uint32_t)0x00000400U) /*!<Filter bit 10 */
  1760. #define CAN_F2R2_FB11 ((uint32_t)0x00000800U) /*!<Filter bit 11 */
  1761. #define CAN_F2R2_FB12 ((uint32_t)0x00001000U) /*!<Filter bit 12 */
  1762. #define CAN_F2R2_FB13 ((uint32_t)0x00002000U) /*!<Filter bit 13 */
  1763. #define CAN_F2R2_FB14 ((uint32_t)0x00004000U) /*!<Filter bit 14 */
  1764. #define CAN_F2R2_FB15 ((uint32_t)0x00008000U) /*!<Filter bit 15 */
  1765. #define CAN_F2R2_FB16 ((uint32_t)0x00010000U) /*!<Filter bit 16 */
  1766. #define CAN_F2R2_FB17 ((uint32_t)0x00020000U) /*!<Filter bit 17 */
  1767. #define CAN_F2R2_FB18 ((uint32_t)0x00040000U) /*!<Filter bit 18 */
  1768. #define CAN_F2R2_FB19 ((uint32_t)0x00080000U) /*!<Filter bit 19 */
  1769. #define CAN_F2R2_FB20 ((uint32_t)0x00100000U) /*!<Filter bit 20 */
  1770. #define CAN_F2R2_FB21 ((uint32_t)0x00200000U) /*!<Filter bit 21 */
  1771. #define CAN_F2R2_FB22 ((uint32_t)0x00400000U) /*!<Filter bit 22 */
  1772. #define CAN_F2R2_FB23 ((uint32_t)0x00800000U) /*!<Filter bit 23 */
  1773. #define CAN_F2R2_FB24 ((uint32_t)0x01000000U) /*!<Filter bit 24 */
  1774. #define CAN_F2R2_FB25 ((uint32_t)0x02000000U) /*!<Filter bit 25 */
  1775. #define CAN_F2R2_FB26 ((uint32_t)0x04000000U) /*!<Filter bit 26 */
  1776. #define CAN_F2R2_FB27 ((uint32_t)0x08000000U) /*!<Filter bit 27 */
  1777. #define CAN_F2R2_FB28 ((uint32_t)0x10000000U) /*!<Filter bit 28 */
  1778. #define CAN_F2R2_FB29 ((uint32_t)0x20000000U) /*!<Filter bit 29 */
  1779. #define CAN_F2R2_FB30 ((uint32_t)0x40000000U) /*!<Filter bit 30 */
  1780. #define CAN_F2R2_FB31 ((uint32_t)0x80000000U) /*!<Filter bit 31 */
  1781. /******************* Bit definition for CAN_F3R2 register *******************/
  1782. #define CAN_F3R2_FB0 ((uint32_t)0x00000001U) /*!<Filter bit 0 */
  1783. #define CAN_F3R2_FB1 ((uint32_t)0x00000002U) /*!<Filter bit 1 */
  1784. #define CAN_F3R2_FB2 ((uint32_t)0x00000004U) /*!<Filter bit 2 */
  1785. #define CAN_F3R2_FB3 ((uint32_t)0x00000008U) /*!<Filter bit 3 */
  1786. #define CAN_F3R2_FB4 ((uint32_t)0x00000010U) /*!<Filter bit 4 */
  1787. #define CAN_F3R2_FB5 ((uint32_t)0x00000020U) /*!<Filter bit 5 */
  1788. #define CAN_F3R2_FB6 ((uint32_t)0x00000040U) /*!<Filter bit 6 */
  1789. #define CAN_F3R2_FB7 ((uint32_t)0x00000080U) /*!<Filter bit 7 */
  1790. #define CAN_F3R2_FB8 ((uint32_t)0x00000100U) /*!<Filter bit 8 */
  1791. #define CAN_F3R2_FB9 ((uint32_t)0x00000200U) /*!<Filter bit 9 */
  1792. #define CAN_F3R2_FB10 ((uint32_t)0x00000400U) /*!<Filter bit 10 */
  1793. #define CAN_F3R2_FB11 ((uint32_t)0x00000800U) /*!<Filter bit 11 */
  1794. #define CAN_F3R2_FB12 ((uint32_t)0x00001000U) /*!<Filter bit 12 */
  1795. #define CAN_F3R2_FB13 ((uint32_t)0x00002000U) /*!<Filter bit 13 */
  1796. #define CAN_F3R2_FB14 ((uint32_t)0x00004000U) /*!<Filter bit 14 */
  1797. #define CAN_F3R2_FB15 ((uint32_t)0x00008000U) /*!<Filter bit 15 */
  1798. #define CAN_F3R2_FB16 ((uint32_t)0x00010000U) /*!<Filter bit 16 */
  1799. #define CAN_F3R2_FB17 ((uint32_t)0x00020000U) /*!<Filter bit 17 */
  1800. #define CAN_F3R2_FB18 ((uint32_t)0x00040000U) /*!<Filter bit 18 */
  1801. #define CAN_F3R2_FB19 ((uint32_t)0x00080000U) /*!<Filter bit 19 */
  1802. #define CAN_F3R2_FB20 ((uint32_t)0x00100000U) /*!<Filter bit 20 */
  1803. #define CAN_F3R2_FB21 ((uint32_t)0x00200000U) /*!<Filter bit 21 */
  1804. #define CAN_F3R2_FB22 ((uint32_t)0x00400000U) /*!<Filter bit 22 */
  1805. #define CAN_F3R2_FB23 ((uint32_t)0x00800000U) /*!<Filter bit 23 */
  1806. #define CAN_F3R2_FB24 ((uint32_t)0x01000000U) /*!<Filter bit 24 */
  1807. #define CAN_F3R2_FB25 ((uint32_t)0x02000000U) /*!<Filter bit 25 */
  1808. #define CAN_F3R2_FB26 ((uint32_t)0x04000000U) /*!<Filter bit 26 */
  1809. #define CAN_F3R2_FB27 ((uint32_t)0x08000000U) /*!<Filter bit 27 */
  1810. #define CAN_F3R2_FB28 ((uint32_t)0x10000000U) /*!<Filter bit 28 */
  1811. #define CAN_F3R2_FB29 ((uint32_t)0x20000000U) /*!<Filter bit 29 */
  1812. #define CAN_F3R2_FB30 ((uint32_t)0x40000000U) /*!<Filter bit 30 */
  1813. #define CAN_F3R2_FB31 ((uint32_t)0x80000000U) /*!<Filter bit 31 */
  1814. /******************* Bit definition for CAN_F4R2 register *******************/
  1815. #define CAN_F4R2_FB0 ((uint32_t)0x00000001U) /*!<Filter bit 0 */
  1816. #define CAN_F4R2_FB1 ((uint32_t)0x00000002U) /*!<Filter bit 1 */
  1817. #define CAN_F4R2_FB2 ((uint32_t)0x00000004U) /*!<Filter bit 2 */
  1818. #define CAN_F4R2_FB3 ((uint32_t)0x00000008U) /*!<Filter bit 3 */
  1819. #define CAN_F4R2_FB4 ((uint32_t)0x00000010U) /*!<Filter bit 4 */
  1820. #define CAN_F4R2_FB5 ((uint32_t)0x00000020U) /*!<Filter bit 5 */
  1821. #define CAN_F4R2_FB6 ((uint32_t)0x00000040U) /*!<Filter bit 6 */
  1822. #define CAN_F4R2_FB7 ((uint32_t)0x00000080U) /*!<Filter bit 7 */
  1823. #define CAN_F4R2_FB8 ((uint32_t)0x00000100U) /*!<Filter bit 8 */
  1824. #define CAN_F4R2_FB9 ((uint32_t)0x00000200U) /*!<Filter bit 9 */
  1825. #define CAN_F4R2_FB10 ((uint32_t)0x00000400U) /*!<Filter bit 10 */
  1826. #define CAN_F4R2_FB11 ((uint32_t)0x00000800U) /*!<Filter bit 11 */
  1827. #define CAN_F4R2_FB12 ((uint32_t)0x00001000U) /*!<Filter bit 12 */
  1828. #define CAN_F4R2_FB13 ((uint32_t)0x00002000U) /*!<Filter bit 13 */
  1829. #define CAN_F4R2_FB14 ((uint32_t)0x00004000U) /*!<Filter bit 14 */
  1830. #define CAN_F4R2_FB15 ((uint32_t)0x00008000U) /*!<Filter bit 15 */
  1831. #define CAN_F4R2_FB16 ((uint32_t)0x00010000U) /*!<Filter bit 16 */
  1832. #define CAN_F4R2_FB17 ((uint32_t)0x00020000U) /*!<Filter bit 17 */
  1833. #define CAN_F4R2_FB18 ((uint32_t)0x00040000U) /*!<Filter bit 18 */
  1834. #define CAN_F4R2_FB19 ((uint32_t)0x00080000U) /*!<Filter bit 19 */
  1835. #define CAN_F4R2_FB20 ((uint32_t)0x00100000U) /*!<Filter bit 20 */
  1836. #define CAN_F4R2_FB21 ((uint32_t)0x00200000U) /*!<Filter bit 21 */
  1837. #define CAN_F4R2_FB22 ((uint32_t)0x00400000U) /*!<Filter bit 22 */
  1838. #define CAN_F4R2_FB23 ((uint32_t)0x00800000U) /*!<Filter bit 23 */
  1839. #define CAN_F4R2_FB24 ((uint32_t)0x01000000U) /*!<Filter bit 24 */
  1840. #define CAN_F4R2_FB25 ((uint32_t)0x02000000U) /*!<Filter bit 25 */
  1841. #define CAN_F4R2_FB26 ((uint32_t)0x04000000U) /*!<Filter bit 26 */
  1842. #define CAN_F4R2_FB27 ((uint32_t)0x08000000U) /*!<Filter bit 27 */
  1843. #define CAN_F4R2_FB28 ((uint32_t)0x10000000U) /*!<Filter bit 28 */
  1844. #define CAN_F4R2_FB29 ((uint32_t)0x20000000U) /*!<Filter bit 29 */
  1845. #define CAN_F4R2_FB30 ((uint32_t)0x40000000U) /*!<Filter bit 30 */
  1846. #define CAN_F4R2_FB31 ((uint32_t)0x80000000U) /*!<Filter bit 31 */
  1847. /******************* Bit definition for CAN_F5R2 register *******************/
  1848. #define CAN_F5R2_FB0 ((uint32_t)0x00000001U) /*!<Filter bit 0 */
  1849. #define CAN_F5R2_FB1 ((uint32_t)0x00000002U) /*!<Filter bit 1 */
  1850. #define CAN_F5R2_FB2 ((uint32_t)0x00000004U) /*!<Filter bit 2 */
  1851. #define CAN_F5R2_FB3 ((uint32_t)0x00000008U) /*!<Filter bit 3 */
  1852. #define CAN_F5R2_FB4 ((uint32_t)0x00000010U) /*!<Filter bit 4 */
  1853. #define CAN_F5R2_FB5 ((uint32_t)0x00000020U) /*!<Filter bit 5 */
  1854. #define CAN_F5R2_FB6 ((uint32_t)0x00000040U) /*!<Filter bit 6 */
  1855. #define CAN_F5R2_FB7 ((uint32_t)0x00000080U) /*!<Filter bit 7 */
  1856. #define CAN_F5R2_FB8 ((uint32_t)0x00000100U) /*!<Filter bit 8 */
  1857. #define CAN_F5R2_FB9 ((uint32_t)0x00000200U) /*!<Filter bit 9 */
  1858. #define CAN_F5R2_FB10 ((uint32_t)0x00000400U) /*!<Filter bit 10 */
  1859. #define CAN_F5R2_FB11 ((uint32_t)0x00000800U) /*!<Filter bit 11 */
  1860. #define CAN_F5R2_FB12 ((uint32_t)0x00001000U) /*!<Filter bit 12 */
  1861. #define CAN_F5R2_FB13 ((uint32_t)0x00002000U) /*!<Filter bit 13 */
  1862. #define CAN_F5R2_FB14 ((uint32_t)0x00004000U) /*!<Filter bit 14 */
  1863. #define CAN_F5R2_FB15 ((uint32_t)0x00008000U) /*!<Filter bit 15 */
  1864. #define CAN_F5R2_FB16 ((uint32_t)0x00010000U) /*!<Filter bit 16 */
  1865. #define CAN_F5R2_FB17 ((uint32_t)0x00020000U) /*!<Filter bit 17 */
  1866. #define CAN_F5R2_FB18 ((uint32_t)0x00040000U) /*!<Filter bit 18 */
  1867. #define CAN_F5R2_FB19 ((uint32_t)0x00080000U) /*!<Filter bit 19 */
  1868. #define CAN_F5R2_FB20 ((uint32_t)0x00100000U) /*!<Filter bit 20 */
  1869. #define CAN_F5R2_FB21 ((uint32_t)0x00200000U) /*!<Filter bit 21 */
  1870. #define CAN_F5R2_FB22 ((uint32_t)0x00400000U) /*!<Filter bit 22 */
  1871. #define CAN_F5R2_FB23 ((uint32_t)0x00800000U) /*!<Filter bit 23 */
  1872. #define CAN_F5R2_FB24 ((uint32_t)0x01000000U) /*!<Filter bit 24 */
  1873. #define CAN_F5R2_FB25 ((uint32_t)0x02000000U) /*!<Filter bit 25 */
  1874. #define CAN_F5R2_FB26 ((uint32_t)0x04000000U) /*!<Filter bit 26 */
  1875. #define CAN_F5R2_FB27 ((uint32_t)0x08000000U) /*!<Filter bit 27 */
  1876. #define CAN_F5R2_FB28 ((uint32_t)0x10000000U) /*!<Filter bit 28 */
  1877. #define CAN_F5R2_FB29 ((uint32_t)0x20000000U) /*!<Filter bit 29 */
  1878. #define CAN_F5R2_FB30 ((uint32_t)0x40000000U) /*!<Filter bit 30 */
  1879. #define CAN_F5R2_FB31 ((uint32_t)0x80000000U) /*!<Filter bit 31 */
  1880. /******************* Bit definition for CAN_F6R2 register *******************/
  1881. #define CAN_F6R2_FB0 ((uint32_t)0x00000001U) /*!<Filter bit 0 */
  1882. #define CAN_F6R2_FB1 ((uint32_t)0x00000002U) /*!<Filter bit 1 */
  1883. #define CAN_F6R2_FB2 ((uint32_t)0x00000004U) /*!<Filter bit 2 */
  1884. #define CAN_F6R2_FB3 ((uint32_t)0x00000008U) /*!<Filter bit 3 */
  1885. #define CAN_F6R2_FB4 ((uint32_t)0x00000010U) /*!<Filter bit 4 */
  1886. #define CAN_F6R2_FB5 ((uint32_t)0x00000020U) /*!<Filter bit 5 */
  1887. #define CAN_F6R2_FB6 ((uint32_t)0x00000040U) /*!<Filter bit 6 */
  1888. #define CAN_F6R2_FB7 ((uint32_t)0x00000080U) /*!<Filter bit 7 */
  1889. #define CAN_F6R2_FB8 ((uint32_t)0x00000100U) /*!<Filter bit 8 */
  1890. #define CAN_F6R2_FB9 ((uint32_t)0x00000200U) /*!<Filter bit 9 */
  1891. #define CAN_F6R2_FB10 ((uint32_t)0x00000400U) /*!<Filter bit 10 */
  1892. #define CAN_F6R2_FB11 ((uint32_t)0x00000800U) /*!<Filter bit 11 */
  1893. #define CAN_F6R2_FB12 ((uint32_t)0x00001000U) /*!<Filter bit 12 */
  1894. #define CAN_F6R2_FB13 ((uint32_t)0x00002000U) /*!<Filter bit 13 */
  1895. #define CAN_F6R2_FB14 ((uint32_t)0x00004000U) /*!<Filter bit 14 */
  1896. #define CAN_F6R2_FB15 ((uint32_t)0x00008000U) /*!<Filter bit 15 */
  1897. #define CAN_F6R2_FB16 ((uint32_t)0x00010000U) /*!<Filter bit 16 */
  1898. #define CAN_F6R2_FB17 ((uint32_t)0x00020000U) /*!<Filter bit 17 */
  1899. #define CAN_F6R2_FB18 ((uint32_t)0x00040000U) /*!<Filter bit 18 */
  1900. #define CAN_F6R2_FB19 ((uint32_t)0x00080000U) /*!<Filter bit 19 */
  1901. #define CAN_F6R2_FB20 ((uint32_t)0x00100000U) /*!<Filter bit 20 */
  1902. #define CAN_F6R2_FB21 ((uint32_t)0x00200000U) /*!<Filter bit 21 */
  1903. #define CAN_F6R2_FB22 ((uint32_t)0x00400000U) /*!<Filter bit 22 */
  1904. #define CAN_F6R2_FB23 ((uint32_t)0x00800000U) /*!<Filter bit 23 */
  1905. #define CAN_F6R2_FB24 ((uint32_t)0x01000000U) /*!<Filter bit 24 */
  1906. #define CAN_F6R2_FB25 ((uint32_t)0x02000000U) /*!<Filter bit 25 */
  1907. #define CAN_F6R2_FB26 ((uint32_t)0x04000000U) /*!<Filter bit 26 */
  1908. #define CAN_F6R2_FB27 ((uint32_t)0x08000000U) /*!<Filter bit 27 */
  1909. #define CAN_F6R2_FB28 ((uint32_t)0x10000000U) /*!<Filter bit 28 */
  1910. #define CAN_F6R2_FB29 ((uint32_t)0x20000000U) /*!<Filter bit 29 */
  1911. #define CAN_F6R2_FB30 ((uint32_t)0x40000000U) /*!<Filter bit 30 */
  1912. #define CAN_F6R2_FB31 ((uint32_t)0x80000000U) /*!<Filter bit 31 */
  1913. /******************* Bit definition for CAN_F7R2 register *******************/
  1914. #define CAN_F7R2_FB0 ((uint32_t)0x00000001U) /*!<Filter bit 0 */
  1915. #define CAN_F7R2_FB1 ((uint32_t)0x00000002U) /*!<Filter bit 1 */
  1916. #define CAN_F7R2_FB2 ((uint32_t)0x00000004U) /*!<Filter bit 2 */
  1917. #define CAN_F7R2_FB3 ((uint32_t)0x00000008U) /*!<Filter bit 3 */
  1918. #define CAN_F7R2_FB4 ((uint32_t)0x00000010U) /*!<Filter bit 4 */
  1919. #define CAN_F7R2_FB5 ((uint32_t)0x00000020U) /*!<Filter bit 5 */
  1920. #define CAN_F7R2_FB6 ((uint32_t)0x00000040U) /*!<Filter bit 6 */
  1921. #define CAN_F7R2_FB7 ((uint32_t)0x00000080U) /*!<Filter bit 7 */
  1922. #define CAN_F7R2_FB8 ((uint32_t)0x00000100U) /*!<Filter bit 8 */
  1923. #define CAN_F7R2_FB9 ((uint32_t)0x00000200U) /*!<Filter bit 9 */
  1924. #define CAN_F7R2_FB10 ((uint32_t)0x00000400U) /*!<Filter bit 10 */
  1925. #define CAN_F7R2_FB11 ((uint32_t)0x00000800U) /*!<Filter bit 11 */
  1926. #define CAN_F7R2_FB12 ((uint32_t)0x00001000U) /*!<Filter bit 12 */
  1927. #define CAN_F7R2_FB13 ((uint32_t)0x00002000U) /*!<Filter bit 13 */
  1928. #define CAN_F7R2_FB14 ((uint32_t)0x00004000U) /*!<Filter bit 14 */
  1929. #define CAN_F7R2_FB15 ((uint32_t)0x00008000U) /*!<Filter bit 15 */
  1930. #define CAN_F7R2_FB16 ((uint32_t)0x00010000U) /*!<Filter bit 16 */
  1931. #define CAN_F7R2_FB17 ((uint32_t)0x00020000U) /*!<Filter bit 17 */
  1932. #define CAN_F7R2_FB18 ((uint32_t)0x00040000U) /*!<Filter bit 18 */
  1933. #define CAN_F7R2_FB19 ((uint32_t)0x00080000U) /*!<Filter bit 19 */
  1934. #define CAN_F7R2_FB20 ((uint32_t)0x00100000U) /*!<Filter bit 20 */
  1935. #define CAN_F7R2_FB21 ((uint32_t)0x00200000U) /*!<Filter bit 21 */
  1936. #define CAN_F7R2_FB22 ((uint32_t)0x00400000U) /*!<Filter bit 22 */
  1937. #define CAN_F7R2_FB23 ((uint32_t)0x00800000U) /*!<Filter bit 23 */
  1938. #define CAN_F7R2_FB24 ((uint32_t)0x01000000U) /*!<Filter bit 24 */
  1939. #define CAN_F7R2_FB25 ((uint32_t)0x02000000U) /*!<Filter bit 25 */
  1940. #define CAN_F7R2_FB26 ((uint32_t)0x04000000U) /*!<Filter bit 26 */
  1941. #define CAN_F7R2_FB27 ((uint32_t)0x08000000U) /*!<Filter bit 27 */
  1942. #define CAN_F7R2_FB28 ((uint32_t)0x10000000U) /*!<Filter bit 28 */
  1943. #define CAN_F7R2_FB29 ((uint32_t)0x20000000U) /*!<Filter bit 29 */
  1944. #define CAN_F7R2_FB30 ((uint32_t)0x40000000U) /*!<Filter bit 30 */
  1945. #define CAN_F7R2_FB31 ((uint32_t)0x80000000U) /*!<Filter bit 31 */
  1946. /******************* Bit definition for CAN_F8R2 register *******************/
  1947. #define CAN_F8R2_FB0 ((uint32_t)0x00000001U) /*!<Filter bit 0 */
  1948. #define CAN_F8R2_FB1 ((uint32_t)0x00000002U) /*!<Filter bit 1 */
  1949. #define CAN_F8R2_FB2 ((uint32_t)0x00000004U) /*!<Filter bit 2 */
  1950. #define CAN_F8R2_FB3 ((uint32_t)0x00000008U) /*!<Filter bit 3 */
  1951. #define CAN_F8R2_FB4 ((uint32_t)0x00000010U) /*!<Filter bit 4 */
  1952. #define CAN_F8R2_FB5 ((uint32_t)0x00000020U) /*!<Filter bit 5 */
  1953. #define CAN_F8R2_FB6 ((uint32_t)0x00000040U) /*!<Filter bit 6 */
  1954. #define CAN_F8R2_FB7 ((uint32_t)0x00000080U) /*!<Filter bit 7 */
  1955. #define CAN_F8R2_FB8 ((uint32_t)0x00000100U) /*!<Filter bit 8 */
  1956. #define CAN_F8R2_FB9 ((uint32_t)0x00000200U) /*!<Filter bit 9 */
  1957. #define CAN_F8R2_FB10 ((uint32_t)0x00000400U) /*!<Filter bit 10 */
  1958. #define CAN_F8R2_FB11 ((uint32_t)0x00000800U) /*!<Filter bit 11 */
  1959. #define CAN_F8R2_FB12 ((uint32_t)0x00001000U) /*!<Filter bit 12 */
  1960. #define CAN_F8R2_FB13 ((uint32_t)0x00002000U) /*!<Filter bit 13 */
  1961. #define CAN_F8R2_FB14 ((uint32_t)0x00004000U) /*!<Filter bit 14 */
  1962. #define CAN_F8R2_FB15 ((uint32_t)0x00008000U) /*!<Filter bit 15 */
  1963. #define CAN_F8R2_FB16 ((uint32_t)0x00010000U) /*!<Filter bit 16 */
  1964. #define CAN_F8R2_FB17 ((uint32_t)0x00020000U) /*!<Filter bit 17 */
  1965. #define CAN_F8R2_FB18 ((uint32_t)0x00040000U) /*!<Filter bit 18 */
  1966. #define CAN_F8R2_FB19 ((uint32_t)0x00080000U) /*!<Filter bit 19 */
  1967. #define CAN_F8R2_FB20 ((uint32_t)0x00100000U) /*!<Filter bit 20 */
  1968. #define CAN_F8R2_FB21 ((uint32_t)0x00200000U) /*!<Filter bit 21 */
  1969. #define CAN_F8R2_FB22 ((uint32_t)0x00400000U) /*!<Filter bit 22 */
  1970. #define CAN_F8R2_FB23 ((uint32_t)0x00800000U) /*!<Filter bit 23 */
  1971. #define CAN_F8R2_FB24 ((uint32_t)0x01000000U) /*!<Filter bit 24 */
  1972. #define CAN_F8R2_FB25 ((uint32_t)0x02000000U) /*!<Filter bit 25 */
  1973. #define CAN_F8R2_FB26 ((uint32_t)0x04000000U) /*!<Filter bit 26 */
  1974. #define CAN_F8R2_FB27 ((uint32_t)0x08000000U) /*!<Filter bit 27 */
  1975. #define CAN_F8R2_FB28 ((uint32_t)0x10000000U) /*!<Filter bit 28 */
  1976. #define CAN_F8R2_FB29 ((uint32_t)0x20000000U) /*!<Filter bit 29 */
  1977. #define CAN_F8R2_FB30 ((uint32_t)0x40000000U) /*!<Filter bit 30 */
  1978. #define CAN_F8R2_FB31 ((uint32_t)0x80000000U) /*!<Filter bit 31 */
  1979. /******************* Bit definition for CAN_F9R2 register *******************/
  1980. #define CAN_F9R2_FB0 ((uint32_t)0x00000001U) /*!<Filter bit 0 */
  1981. #define CAN_F9R2_FB1 ((uint32_t)0x00000002U) /*!<Filter bit 1 */
  1982. #define CAN_F9R2_FB2 ((uint32_t)0x00000004U) /*!<Filter bit 2 */
  1983. #define CAN_F9R2_FB3 ((uint32_t)0x00000008U) /*!<Filter bit 3 */
  1984. #define CAN_F9R2_FB4 ((uint32_t)0x00000010U) /*!<Filter bit 4 */
  1985. #define CAN_F9R2_FB5 ((uint32_t)0x00000020U) /*!<Filter bit 5 */
  1986. #define CAN_F9R2_FB6 ((uint32_t)0x00000040U) /*!<Filter bit 6 */
  1987. #define CAN_F9R2_FB7 ((uint32_t)0x00000080U) /*!<Filter bit 7 */
  1988. #define CAN_F9R2_FB8 ((uint32_t)0x00000100U) /*!<Filter bit 8 */
  1989. #define CAN_F9R2_FB9 ((uint32_t)0x00000200U) /*!<Filter bit 9 */
  1990. #define CAN_F9R2_FB10 ((uint32_t)0x00000400U) /*!<Filter bit 10 */
  1991. #define CAN_F9R2_FB11 ((uint32_t)0x00000800U) /*!<Filter bit 11 */
  1992. #define CAN_F9R2_FB12 ((uint32_t)0x00001000U) /*!<Filter bit 12 */
  1993. #define CAN_F9R2_FB13 ((uint32_t)0x00002000U) /*!<Filter bit 13 */
  1994. #define CAN_F9R2_FB14 ((uint32_t)0x00004000U) /*!<Filter bit 14 */
  1995. #define CAN_F9R2_FB15 ((uint32_t)0x00008000U) /*!<Filter bit 15 */
  1996. #define CAN_F9R2_FB16 ((uint32_t)0x00010000U) /*!<Filter bit 16 */
  1997. #define CAN_F9R2_FB17 ((uint32_t)0x00020000U) /*!<Filter bit 17 */
  1998. #define CAN_F9R2_FB18 ((uint32_t)0x00040000U) /*!<Filter bit 18 */
  1999. #define CAN_F9R2_FB19 ((uint32_t)0x00080000U) /*!<Filter bit 19 */
  2000. #define CAN_F9R2_FB20 ((uint32_t)0x00100000U) /*!<Filter bit 20 */
  2001. #define CAN_F9R2_FB21 ((uint32_t)0x00200000U) /*!<Filter bit 21 */
  2002. #define CAN_F9R2_FB22 ((uint32_t)0x00400000U) /*!<Filter bit 22 */
  2003. #define CAN_F9R2_FB23 ((uint32_t)0x00800000U) /*!<Filter bit 23 */
  2004. #define CAN_F9R2_FB24 ((uint32_t)0x01000000U) /*!<Filter bit 24 */
  2005. #define CAN_F9R2_FB25 ((uint32_t)0x02000000U) /*!<Filter bit 25 */
  2006. #define CAN_F9R2_FB26 ((uint32_t)0x04000000U) /*!<Filter bit 26 */
  2007. #define CAN_F9R2_FB27 ((uint32_t)0x08000000U) /*!<Filter bit 27 */
  2008. #define CAN_F9R2_FB28 ((uint32_t)0x10000000U) /*!<Filter bit 28 */
  2009. #define CAN_F9R2_FB29 ((uint32_t)0x20000000U) /*!<Filter bit 29 */
  2010. #define CAN_F9R2_FB30 ((uint32_t)0x40000000U) /*!<Filter bit 30 */
  2011. #define CAN_F9R2_FB31 ((uint32_t)0x80000000U) /*!<Filter bit 31 */
  2012. /******************* Bit definition for CAN_F10R2 register ******************/
  2013. #define CAN_F10R2_FB0 ((uint32_t)0x00000001U) /*!<Filter bit 0 */
  2014. #define CAN_F10R2_FB1 ((uint32_t)0x00000002U) /*!<Filter bit 1 */
  2015. #define CAN_F10R2_FB2 ((uint32_t)0x00000004U) /*!<Filter bit 2 */
  2016. #define CAN_F10R2_FB3 ((uint32_t)0x00000008U) /*!<Filter bit 3 */
  2017. #define CAN_F10R2_FB4 ((uint32_t)0x00000010U) /*!<Filter bit 4 */
  2018. #define CAN_F10R2_FB5 ((uint32_t)0x00000020U) /*!<Filter bit 5 */
  2019. #define CAN_F10R2_FB6 ((uint32_t)0x00000040U) /*!<Filter bit 6 */
  2020. #define CAN_F10R2_FB7 ((uint32_t)0x00000080U) /*!<Filter bit 7 */
  2021. #define CAN_F10R2_FB8 ((uint32_t)0x00000100U) /*!<Filter bit 8 */
  2022. #define CAN_F10R2_FB9 ((uint32_t)0x00000200U) /*!<Filter bit 9 */
  2023. #define CAN_F10R2_FB10 ((uint32_t)0x00000400U) /*!<Filter bit 10 */
  2024. #define CAN_F10R2_FB11 ((uint32_t)0x00000800U) /*!<Filter bit 11 */
  2025. #define CAN_F10R2_FB12 ((uint32_t)0x00001000U) /*!<Filter bit 12 */
  2026. #define CAN_F10R2_FB13 ((uint32_t)0x00002000U) /*!<Filter bit 13 */
  2027. #define CAN_F10R2_FB14 ((uint32_t)0x00004000U) /*!<Filter bit 14 */
  2028. #define CAN_F10R2_FB15 ((uint32_t)0x00008000U) /*!<Filter bit 15 */
  2029. #define CAN_F10R2_FB16 ((uint32_t)0x00010000U) /*!<Filter bit 16 */
  2030. #define CAN_F10R2_FB17 ((uint32_t)0x00020000U) /*!<Filter bit 17 */
  2031. #define CAN_F10R2_FB18 ((uint32_t)0x00040000U) /*!<Filter bit 18 */
  2032. #define CAN_F10R2_FB19 ((uint32_t)0x00080000U) /*!<Filter bit 19 */
  2033. #define CAN_F10R2_FB20 ((uint32_t)0x00100000U) /*!<Filter bit 20 */
  2034. #define CAN_F10R2_FB21 ((uint32_t)0x00200000U) /*!<Filter bit 21 */
  2035. #define CAN_F10R2_FB22 ((uint32_t)0x00400000U) /*!<Filter bit 22 */
  2036. #define CAN_F10R2_FB23 ((uint32_t)0x00800000U) /*!<Filter bit 23 */
  2037. #define CAN_F10R2_FB24 ((uint32_t)0x01000000U) /*!<Filter bit 24 */
  2038. #define CAN_F10R2_FB25 ((uint32_t)0x02000000U) /*!<Filter bit 25 */
  2039. #define CAN_F10R2_FB26 ((uint32_t)0x04000000U) /*!<Filter bit 26 */
  2040. #define CAN_F10R2_FB27 ((uint32_t)0x08000000U) /*!<Filter bit 27 */
  2041. #define CAN_F10R2_FB28 ((uint32_t)0x10000000U) /*!<Filter bit 28 */
  2042. #define CAN_F10R2_FB29 ((uint32_t)0x20000000U) /*!<Filter bit 29 */
  2043. #define CAN_F10R2_FB30 ((uint32_t)0x40000000U) /*!<Filter bit 30 */
  2044. #define CAN_F10R2_FB31 ((uint32_t)0x80000000U) /*!<Filter bit 31 */
  2045. /******************* Bit definition for CAN_F11R2 register ******************/
  2046. #define CAN_F11R2_FB0 ((uint32_t)0x00000001U) /*!<Filter bit 0 */
  2047. #define CAN_F11R2_FB1 ((uint32_t)0x00000002U) /*!<Filter bit 1 */
  2048. #define CAN_F11R2_FB2 ((uint32_t)0x00000004U) /*!<Filter bit 2 */
  2049. #define CAN_F11R2_FB3 ((uint32_t)0x00000008U) /*!<Filter bit 3 */
  2050. #define CAN_F11R2_FB4 ((uint32_t)0x00000010U) /*!<Filter bit 4 */
  2051. #define CAN_F11R2_FB5 ((uint32_t)0x00000020U) /*!<Filter bit 5 */
  2052. #define CAN_F11R2_FB6 ((uint32_t)0x00000040U) /*!<Filter bit 6 */
  2053. #define CAN_F11R2_FB7 ((uint32_t)0x00000080U) /*!<Filter bit 7 */
  2054. #define CAN_F11R2_FB8 ((uint32_t)0x00000100U) /*!<Filter bit 8 */
  2055. #define CAN_F11R2_FB9 ((uint32_t)0x00000200U) /*!<Filter bit 9 */
  2056. #define CAN_F11R2_FB10 ((uint32_t)0x00000400U) /*!<Filter bit 10 */
  2057. #define CAN_F11R2_FB11 ((uint32_t)0x00000800U) /*!<Filter bit 11 */
  2058. #define CAN_F11R2_FB12 ((uint32_t)0x00001000U) /*!<Filter bit 12 */
  2059. #define CAN_F11R2_FB13 ((uint32_t)0x00002000U) /*!<Filter bit 13 */
  2060. #define CAN_F11R2_FB14 ((uint32_t)0x00004000U) /*!<Filter bit 14 */
  2061. #define CAN_F11R2_FB15 ((uint32_t)0x00008000U) /*!<Filter bit 15 */
  2062. #define CAN_F11R2_FB16 ((uint32_t)0x00010000U) /*!<Filter bit 16 */
  2063. #define CAN_F11R2_FB17 ((uint32_t)0x00020000U) /*!<Filter bit 17 */
  2064. #define CAN_F11R2_FB18 ((uint32_t)0x00040000U) /*!<Filter bit 18 */
  2065. #define CAN_F11R2_FB19 ((uint32_t)0x00080000U) /*!<Filter bit 19 */
  2066. #define CAN_F11R2_FB20 ((uint32_t)0x00100000U) /*!<Filter bit 20 */
  2067. #define CAN_F11R2_FB21 ((uint32_t)0x00200000U) /*!<Filter bit 21 */
  2068. #define CAN_F11R2_FB22 ((uint32_t)0x00400000U) /*!<Filter bit 22 */
  2069. #define CAN_F11R2_FB23 ((uint32_t)0x00800000U) /*!<Filter bit 23 */
  2070. #define CAN_F11R2_FB24 ((uint32_t)0x01000000U) /*!<Filter bit 24 */
  2071. #define CAN_F11R2_FB25 ((uint32_t)0x02000000U) /*!<Filter bit 25 */
  2072. #define CAN_F11R2_FB26 ((uint32_t)0x04000000U) /*!<Filter bit 26 */
  2073. #define CAN_F11R2_FB27 ((uint32_t)0x08000000U) /*!<Filter bit 27 */
  2074. #define CAN_F11R2_FB28 ((uint32_t)0x10000000U) /*!<Filter bit 28 */
  2075. #define CAN_F11R2_FB29 ((uint32_t)0x20000000U) /*!<Filter bit 29 */
  2076. #define CAN_F11R2_FB30 ((uint32_t)0x40000000U) /*!<Filter bit 30 */
  2077. #define CAN_F11R2_FB31 ((uint32_t)0x80000000U) /*!<Filter bit 31 */
  2078. /******************* Bit definition for CAN_F12R2 register ******************/
  2079. #define CAN_F12R2_FB0 ((uint32_t)0x00000001U) /*!<Filter bit 0 */
  2080. #define CAN_F12R2_FB1 ((uint32_t)0x00000002U) /*!<Filter bit 1 */
  2081. #define CAN_F12R2_FB2 ((uint32_t)0x00000004U) /*!<Filter bit 2 */
  2082. #define CAN_F12R2_FB3 ((uint32_t)0x00000008U) /*!<Filter bit 3 */
  2083. #define CAN_F12R2_FB4 ((uint32_t)0x00000010U) /*!<Filter bit 4 */
  2084. #define CAN_F12R2_FB5 ((uint32_t)0x00000020U) /*!<Filter bit 5 */
  2085. #define CAN_F12R2_FB6 ((uint32_t)0x00000040U) /*!<Filter bit 6 */
  2086. #define CAN_F12R2_FB7 ((uint32_t)0x00000080U) /*!<Filter bit 7 */
  2087. #define CAN_F12R2_FB8 ((uint32_t)0x00000100U) /*!<Filter bit 8 */
  2088. #define CAN_F12R2_FB9 ((uint32_t)0x00000200U) /*!<Filter bit 9 */
  2089. #define CAN_F12R2_FB10 ((uint32_t)0x00000400U) /*!<Filter bit 10 */
  2090. #define CAN_F12R2_FB11 ((uint32_t)0x00000800U) /*!<Filter bit 11 */
  2091. #define CAN_F12R2_FB12 ((uint32_t)0x00001000U) /*!<Filter bit 12 */
  2092. #define CAN_F12R2_FB13 ((uint32_t)0x00002000U) /*!<Filter bit 13 */
  2093. #define CAN_F12R2_FB14 ((uint32_t)0x00004000U) /*!<Filter bit 14 */
  2094. #define CAN_F12R2_FB15 ((uint32_t)0x00008000U) /*!<Filter bit 15 */
  2095. #define CAN_F12R2_FB16 ((uint32_t)0x00010000U) /*!<Filter bit 16 */
  2096. #define CAN_F12R2_FB17 ((uint32_t)0x00020000U) /*!<Filter bit 17 */
  2097. #define CAN_F12R2_FB18 ((uint32_t)0x00040000U) /*!<Filter bit 18 */
  2098. #define CAN_F12R2_FB19 ((uint32_t)0x00080000U) /*!<Filter bit 19 */
  2099. #define CAN_F12R2_FB20 ((uint32_t)0x00100000U) /*!<Filter bit 20 */
  2100. #define CAN_F12R2_FB21 ((uint32_t)0x00200000U) /*!<Filter bit 21 */
  2101. #define CAN_F12R2_FB22 ((uint32_t)0x00400000U) /*!<Filter bit 22 */
  2102. #define CAN_F12R2_FB23 ((uint32_t)0x00800000U) /*!<Filter bit 23 */
  2103. #define CAN_F12R2_FB24 ((uint32_t)0x01000000U) /*!<Filter bit 24 */
  2104. #define CAN_F12R2_FB25 ((uint32_t)0x02000000U) /*!<Filter bit 25 */
  2105. #define CAN_F12R2_FB26 ((uint32_t)0x04000000U) /*!<Filter bit 26 */
  2106. #define CAN_F12R2_FB27 ((uint32_t)0x08000000U) /*!<Filter bit 27 */
  2107. #define CAN_F12R2_FB28 ((uint32_t)0x10000000U) /*!<Filter bit 28 */
  2108. #define CAN_F12R2_FB29 ((uint32_t)0x20000000U) /*!<Filter bit 29 */
  2109. #define CAN_F12R2_FB30 ((uint32_t)0x40000000U) /*!<Filter bit 30 */
  2110. #define CAN_F12R2_FB31 ((uint32_t)0x80000000U) /*!<Filter bit 31 */
  2111. /******************* Bit definition for CAN_F13R2 register ******************/
  2112. #define CAN_F13R2_FB0 ((uint32_t)0x00000001U) /*!<Filter bit 0 */
  2113. #define CAN_F13R2_FB1 ((uint32_t)0x00000002U) /*!<Filter bit 1 */
  2114. #define CAN_F13R2_FB2 ((uint32_t)0x00000004U) /*!<Filter bit 2 */
  2115. #define CAN_F13R2_FB3 ((uint32_t)0x00000008U) /*!<Filter bit 3 */
  2116. #define CAN_F13R2_FB4 ((uint32_t)0x00000010U) /*!<Filter bit 4 */
  2117. #define CAN_F13R2_FB5 ((uint32_t)0x00000020U) /*!<Filter bit 5 */
  2118. #define CAN_F13R2_FB6 ((uint32_t)0x00000040U) /*!<Filter bit 6 */
  2119. #define CAN_F13R2_FB7 ((uint32_t)0x00000080U) /*!<Filter bit 7 */
  2120. #define CAN_F13R2_FB8 ((uint32_t)0x00000100U) /*!<Filter bit 8 */
  2121. #define CAN_F13R2_FB9 ((uint32_t)0x00000200U) /*!<Filter bit 9 */
  2122. #define CAN_F13R2_FB10 ((uint32_t)0x00000400U) /*!<Filter bit 10 */
  2123. #define CAN_F13R2_FB11 ((uint32_t)0x00000800U) /*!<Filter bit 11 */
  2124. #define CAN_F13R2_FB12 ((uint32_t)0x00001000U) /*!<Filter bit 12 */
  2125. #define CAN_F13R2_FB13 ((uint32_t)0x00002000U) /*!<Filter bit 13 */
  2126. #define CAN_F13R2_FB14 ((uint32_t)0x00004000U) /*!<Filter bit 14 */
  2127. #define CAN_F13R2_FB15 ((uint32_t)0x00008000U) /*!<Filter bit 15 */
  2128. #define CAN_F13R2_FB16 ((uint32_t)0x00010000U) /*!<Filter bit 16 */
  2129. #define CAN_F13R2_FB17 ((uint32_t)0x00020000U) /*!<Filter bit 17 */
  2130. #define CAN_F13R2_FB18 ((uint32_t)0x00040000U) /*!<Filter bit 18 */
  2131. #define CAN_F13R2_FB19 ((uint32_t)0x00080000U) /*!<Filter bit 19 */
  2132. #define CAN_F13R2_FB20 ((uint32_t)0x00100000U) /*!<Filter bit 20 */
  2133. #define CAN_F13R2_FB21 ((uint32_t)0x00200000U) /*!<Filter bit 21 */
  2134. #define CAN_F13R2_FB22 ((uint32_t)0x00400000U) /*!<Filter bit 22 */
  2135. #define CAN_F13R2_FB23 ((uint32_t)0x00800000U) /*!<Filter bit 23 */
  2136. #define CAN_F13R2_FB24 ((uint32_t)0x01000000U) /*!<Filter bit 24 */
  2137. #define CAN_F13R2_FB25 ((uint32_t)0x02000000U) /*!<Filter bit 25 */
  2138. #define CAN_F13R2_FB26 ((uint32_t)0x04000000U) /*!<Filter bit 26 */
  2139. #define CAN_F13R2_FB27 ((uint32_t)0x08000000U) /*!<Filter bit 27 */
  2140. #define CAN_F13R2_FB28 ((uint32_t)0x10000000U) /*!<Filter bit 28 */
  2141. #define CAN_F13R2_FB29 ((uint32_t)0x20000000U) /*!<Filter bit 29 */
  2142. #define CAN_F13R2_FB30 ((uint32_t)0x40000000U) /*!<Filter bit 30 */
  2143. #define CAN_F13R2_FB31 ((uint32_t)0x80000000U) /*!<Filter bit 31 */
  2144. /******************************************************************************/
  2145. /* */
  2146. /* HDMI-CEC (CEC) */
  2147. /* */
  2148. /******************************************************************************/
  2149. /******************* Bit definition for CEC_CR register *********************/
  2150. #define CEC_CR_CECEN ((uint32_t)0x00000001U) /*!< CEC Enable */
  2151. #define CEC_CR_TXSOM ((uint32_t)0x00000002U) /*!< CEC Tx Start Of Message */
  2152. #define CEC_CR_TXEOM ((uint32_t)0x00000004U) /*!< CEC Tx End Of Message */
  2153. /******************* Bit definition for CEC_CFGR register *******************/
  2154. #define CEC_CFGR_SFT ((uint32_t)0x00000007U) /*!< CEC Signal Free Time */
  2155. #define CEC_CFGR_RXTOL ((uint32_t)0x00000008U) /*!< CEC Tolerance */
  2156. #define CEC_CFGR_BRESTP ((uint32_t)0x00000010U) /*!< CEC Rx Stop */
  2157. #define CEC_CFGR_BREGEN ((uint32_t)0x00000020U) /*!< CEC Bit Rising Error generation */
  2158. #define CEC_CFGR_LBPEGEN ((uint32_t)0x00000040U) /*!< CEC Long Bit Period Error gener. */
  2159. #define CEC_CFGR_BRDNOGEN ((uint32_t)0x00000080U) /*!< CEC Broadcast No Error generation */
  2160. #define CEC_CFGR_SFTOPT ((uint32_t)0x00000100U) /*!< CEC Signal Free Time optional */
  2161. #define CEC_CFGR_OAR ((uint32_t)0x7FFF0000U) /*!< CEC Own Address */
  2162. #define CEC_CFGR_LSTN ((uint32_t)0x80000000U) /*!< CEC Listen mode */
  2163. /******************* Bit definition for CEC_TXDR register *******************/
  2164. #define CEC_TXDR_TXD ((uint32_t)0x000000FFU) /*!< CEC Tx Data */
  2165. /******************* Bit definition for CEC_RXDR register *******************/
  2166. #define CEC_TXDR_RXD ((uint32_t)0x000000FFU) /*!< CEC Rx Data */
  2167. /******************* Bit definition for CEC_ISR register ********************/
  2168. #define CEC_ISR_RXBR ((uint32_t)0x00000001U) /*!< CEC Rx-Byte Received */
  2169. #define CEC_ISR_RXEND ((uint32_t)0x00000002U) /*!< CEC End Of Reception */
  2170. #define CEC_ISR_RXOVR ((uint32_t)0x00000004U) /*!< CEC Rx-Overrun */
  2171. #define CEC_ISR_BRE ((uint32_t)0x00000008U) /*!< CEC Rx Bit Rising Error */
  2172. #define CEC_ISR_SBPE ((uint32_t)0x00000010U) /*!< CEC Rx Short Bit period Error */
  2173. #define CEC_ISR_LBPE ((uint32_t)0x00000020U) /*!< CEC Rx Long Bit period Error */
  2174. #define CEC_ISR_RXACKE ((uint32_t)0x00000040U) /*!< CEC Rx Missing Acknowledge */
  2175. #define CEC_ISR_ARBLST ((uint32_t)0x00000080U) /*!< CEC Arbitration Lost */
  2176. #define CEC_ISR_TXBR ((uint32_t)0x00000100U) /*!< CEC Tx Byte Request */
  2177. #define CEC_ISR_TXEND ((uint32_t)0x00000200U) /*!< CEC End of Transmission */
  2178. #define CEC_ISR_TXUDR ((uint32_t)0x00000400U) /*!< CEC Tx-Buffer Underrun */
  2179. #define CEC_ISR_TXERR ((uint32_t)0x00000800U) /*!< CEC Tx-Error */
  2180. #define CEC_ISR_TXACKE ((uint32_t)0x00001000U) /*!< CEC Tx Missing Acknowledge */
  2181. /******************* Bit definition for CEC_IER register ********************/
  2182. #define CEC_IER_RXBRIE ((uint32_t)0x00000001U) /*!< CEC Rx-Byte Received IT Enable */
  2183. #define CEC_IER_RXENDIE ((uint32_t)0x00000002U) /*!< CEC End Of Reception IT Enable */
  2184. #define CEC_IER_RXOVRIE ((uint32_t)0x00000004U) /*!< CEC Rx-Overrun IT Enable */
  2185. #define CEC_IER_BREIE ((uint32_t)0x00000008U) /*!< CEC Rx Bit Rising Error IT Enable */
  2186. #define CEC_IER_SBPEIE ((uint32_t)0x00000010U) /*!< CEC Rx Short Bit period Error IT Enable*/
  2187. #define CEC_IER_LBPEIE ((uint32_t)0x00000020U) /*!< CEC Rx Long Bit period Error IT Enable */
  2188. #define CEC_IER_RXACKEIE ((uint32_t)0x00000040U) /*!< CEC Rx Missing Acknowledge IT Enable */
  2189. #define CEC_IER_ARBLSTIE ((uint32_t)0x00000080U) /*!< CEC Arbitration Lost IT Enable */
  2190. #define CEC_IER_TXBRIE ((uint32_t)0x00000100U) /*!< CEC Tx Byte Request IT Enable */
  2191. #define CEC_IER_TXENDIE ((uint32_t)0x00000200U) /*!< CEC End of Transmission IT Enable */
  2192. #define CEC_IER_TXUDRIE ((uint32_t)0x00000400U) /*!< CEC Tx-Buffer Underrun IT Enable */
  2193. #define CEC_IER_TXERRIE ((uint32_t)0x00000800U) /*!< CEC Tx-Error IT Enable */
  2194. #define CEC_IER_TXACKEIE ((uint32_t)0x00001000U) /*!< CEC Tx Missing Acknowledge IT Enable */
  2195. /******************************************************************************/
  2196. /* */
  2197. /* Analog Comparators (COMP) */
  2198. /* */
  2199. /******************************************************************************/
  2200. /*********************** Bit definition for COMP_CSR register ***************/
  2201. /* COMP1 bits definition */
  2202. #define COMP_CSR_COMP1EN ((uint32_t)0x00000001U) /*!< COMP1 enable */
  2203. #define COMP_CSR_COMP1SW1 ((uint32_t)0x00000002U) /*!< COMP1 SW1 switch control */
  2204. #define COMP_CSR_COMP1MODE ((uint32_t)0x0000000CU) /*!< COMP1 power mode */
  2205. #define COMP_CSR_COMP1MODE_0 ((uint32_t)0x00000004U) /*!< COMP1 power mode bit 0 */
  2206. #define COMP_CSR_COMP1MODE_1 ((uint32_t)0x00000008U) /*!< COMP1 power mode bit 1 */
  2207. #define COMP_CSR_COMP1INSEL ((uint32_t)0x00000070U) /*!< COMP1 inverting input select */
  2208. #define COMP_CSR_COMP1INSEL_0 ((uint32_t)0x00000010U) /*!< COMP1 inverting input select bit 0 */
  2209. #define COMP_CSR_COMP1INSEL_1 ((uint32_t)0x00000020U) /*!< COMP1 inverting input select bit 1 */
  2210. #define COMP_CSR_COMP1INSEL_2 ((uint32_t)0x00000040U) /*!< COMP1 inverting input select bit 2 */
  2211. #define COMP_CSR_COMP1OUTSEL ((uint32_t)0x00000700U) /*!< COMP1 output select */
  2212. #define COMP_CSR_COMP1OUTSEL_0 ((uint32_t)0x00000100U) /*!< COMP1 output select bit 0 */
  2213. #define COMP_CSR_COMP1OUTSEL_1 ((uint32_t)0x00000200U) /*!< COMP1 output select bit 1 */
  2214. #define COMP_CSR_COMP1OUTSEL_2 ((uint32_t)0x00000400U) /*!< COMP1 output select bit 2 */
  2215. #define COMP_CSR_COMP1POL ((uint32_t)0x00000800U) /*!< COMP1 output polarity */
  2216. #define COMP_CSR_COMP1HYST ((uint32_t)0x00003000U) /*!< COMP1 hysteresis */
  2217. #define COMP_CSR_COMP1HYST_0 ((uint32_t)0x00001000U) /*!< COMP1 hysteresis bit 0 */
  2218. #define COMP_CSR_COMP1HYST_1 ((uint32_t)0x00002000U) /*!< COMP1 hysteresis bit 1 */
  2219. #define COMP_CSR_COMP1OUT ((uint32_t)0x00004000U) /*!< COMP1 output level */
  2220. #define COMP_CSR_COMP1LOCK ((uint32_t)0x00008000U) /*!< COMP1 lock */
  2221. /* COMP2 bits definition */
  2222. #define COMP_CSR_COMP2EN ((uint32_t)0x00010000U) /*!< COMP2 enable */
  2223. #define COMP_CSR_COMP2MODE ((uint32_t)0x000C0000U) /*!< COMP2 power mode */
  2224. #define COMP_CSR_COMP2MODE_0 ((uint32_t)0x00040000U) /*!< COMP2 power mode bit 0 */
  2225. #define COMP_CSR_COMP2MODE_1 ((uint32_t)0x00080000U) /*!< COMP2 power mode bit 1 */
  2226. #define COMP_CSR_COMP2INSEL ((uint32_t)0x00700000U) /*!< COMP2 inverting input select */
  2227. #define COMP_CSR_COMP2INSEL_0 ((uint32_t)0x00100000U) /*!< COMP2 inverting input select bit 0 */
  2228. #define COMP_CSR_COMP2INSEL_1 ((uint32_t)0x00200000U) /*!< COMP2 inverting input select bit 1 */
  2229. #define COMP_CSR_COMP2INSEL_2 ((uint32_t)0x00400000U) /*!< COMP2 inverting input select bit 2 */
  2230. #define COMP_CSR_WNDWEN ((uint32_t)0x00800000U) /*!< COMPx window mode. Bit intended to be used with COMP common instance (COMP_Common_TypeDef) */
  2231. #define COMP_CSR_COMP2OUTSEL ((uint32_t)0x07000000U) /*!< COMP2 output select */
  2232. #define COMP_CSR_COMP2OUTSEL_0 ((uint32_t)0x01000000U) /*!< COMP2 output select bit 0 */
  2233. #define COMP_CSR_COMP2OUTSEL_1 ((uint32_t)0x02000000U) /*!< COMP2 output select bit 1 */
  2234. #define COMP_CSR_COMP2OUTSEL_2 ((uint32_t)0x04000000U) /*!< COMP2 output select bit 2 */
  2235. #define COMP_CSR_COMP2POL ((uint32_t)0x08000000U) /*!< COMP2 output polarity */
  2236. #define COMP_CSR_COMP2HYST ((uint32_t)0x30000000U) /*!< COMP2 hysteresis */
  2237. #define COMP_CSR_COMP2HYST_0 ((uint32_t)0x10000000U) /*!< COMP2 hysteresis bit 0 */
  2238. #define COMP_CSR_COMP2HYST_1 ((uint32_t)0x20000000U) /*!< COMP2 hysteresis bit 1 */
  2239. #define COMP_CSR_COMP2OUT ((uint32_t)0x40000000U) /*!< COMP2 output level */
  2240. #define COMP_CSR_COMP2LOCK ((uint32_t)0x80000000U) /*!< COMP2 lock */
  2241. /* COMPx bits definition */
  2242. #define COMP_CSR_COMPxEN ((uint32_t)0x00000001U) /*!< COMPx enable */
  2243. #define COMP_CSR_COMPxMODE ((uint32_t)0x0000000CU) /*!< COMPx power mode */
  2244. #define COMP_CSR_COMPxMODE_0 ((uint32_t)0x00000004U) /*!< COMPx power mode bit 0 */
  2245. #define COMP_CSR_COMPxMODE_1 ((uint32_t)0x00000008U) /*!< COMPx power mode bit 1 */
  2246. #define COMP_CSR_COMPxINSEL ((uint32_t)0x00000070U) /*!< COMPx inverting input select */
  2247. #define COMP_CSR_COMPxINSEL_0 ((uint32_t)0x00000010U) /*!< COMPx inverting input select bit 0 */
  2248. #define COMP_CSR_COMPxINSEL_1 ((uint32_t)0x00000020U) /*!< COMPx inverting input select bit 1 */
  2249. #define COMP_CSR_COMPxINSEL_2 ((uint32_t)0x00000040U) /*!< COMPx inverting input select bit 2 */
  2250. #define COMP_CSR_COMPxOUTSEL ((uint32_t)0x00000700U) /*!< COMPx output select */
  2251. #define COMP_CSR_COMPxOUTSEL_0 ((uint32_t)0x00000100U) /*!< COMPx output select bit 0 */
  2252. #define COMP_CSR_COMPxOUTSEL_1 ((uint32_t)0x00000200U) /*!< COMPx output select bit 1 */
  2253. #define COMP_CSR_COMPxOUTSEL_2 ((uint32_t)0x00000400U) /*!< COMPx output select bit 2 */
  2254. #define COMP_CSR_COMPxPOL ((uint32_t)0x00000800U) /*!< COMPx output polarity */
  2255. #define COMP_CSR_COMPxHYST ((uint32_t)0x00003000U) /*!< COMPx hysteresis */
  2256. #define COMP_CSR_COMPxHYST_0 ((uint32_t)0x00001000U) /*!< COMPx hysteresis bit 0 */
  2257. #define COMP_CSR_COMPxHYST_1 ((uint32_t)0x00002000U) /*!< COMPx hysteresis bit 1 */
  2258. #define COMP_CSR_COMPxOUT ((uint32_t)0x00004000U) /*!< COMPx output level */
  2259. #define COMP_CSR_COMPxLOCK ((uint32_t)0x00008000U) /*!< COMPx lock */
  2260. /******************************************************************************/
  2261. /* */
  2262. /* CRC calculation unit (CRC) */
  2263. /* */
  2264. /******************************************************************************/
  2265. /******************* Bit definition for CRC_DR register *********************/
  2266. #define CRC_DR_DR ((uint32_t)0xFFFFFFFFU) /*!< Data register bits */
  2267. /******************* Bit definition for CRC_IDR register ********************/
  2268. #define CRC_IDR_IDR ((uint8_t)0xFFU) /*!< General-purpose 8-bit data register bits */
  2269. /******************** Bit definition for CRC_CR register ********************/
  2270. #define CRC_CR_RESET ((uint32_t)0x00000001U) /*!< RESET the CRC computation unit bit */
  2271. #define CRC_CR_POLYSIZE ((uint32_t)0x00000018U) /*!< Polynomial size bits */
  2272. #define CRC_CR_POLYSIZE_0 ((uint32_t)0x00000008U) /*!< Polynomial size bit 0 */
  2273. #define CRC_CR_POLYSIZE_1 ((uint32_t)0x00000010U) /*!< Polynomial size bit 1 */
  2274. #define CRC_CR_REV_IN ((uint32_t)0x00000060U) /*!< REV_IN Reverse Input Data bits */
  2275. #define CRC_CR_REV_IN_0 ((uint32_t)0x00000020U) /*!< REV_IN Bit 0 */
  2276. #define CRC_CR_REV_IN_1 ((uint32_t)0x00000040U) /*!< REV_IN Bit 1 */
  2277. #define CRC_CR_REV_OUT ((uint32_t)0x00000080U) /*!< REV_OUT Reverse Output Data bits */
  2278. /******************* Bit definition for CRC_INIT register *******************/
  2279. #define CRC_INIT_INIT ((uint32_t)0xFFFFFFFFU) /*!< Initial CRC value bits */
  2280. /******************* Bit definition for CRC_POL register ********************/
  2281. #define CRC_POL_POL ((uint32_t)0xFFFFFFFFU) /*!< Coefficients of the polynomial */
  2282. /******************************************************************************/
  2283. /* */
  2284. /* CRS Clock Recovery System */
  2285. /******************************************************************************/
  2286. /******************* Bit definition for CRS_CR register *********************/
  2287. #define CRS_CR_SYNCOKIE ((uint32_t)0x00000001U) /* SYNC event OK interrupt enable */
  2288. #define CRS_CR_SYNCWARNIE ((uint32_t)0x00000002U) /* SYNC warning interrupt enable */
  2289. #define CRS_CR_ERRIE ((uint32_t)0x00000004U) /* SYNC error interrupt enable */
  2290. #define CRS_CR_ESYNCIE ((uint32_t)0x00000008U) /* Expected SYNC(ESYNCF) interrupt Enable*/
  2291. #define CRS_CR_CEN ((uint32_t)0x00000020U) /* Frequency error counter enable */
  2292. #define CRS_CR_AUTOTRIMEN ((uint32_t)0x00000040U) /* Automatic trimming enable */
  2293. #define CRS_CR_SWSYNC ((uint32_t)0x00000080U) /* A Software SYNC event is generated */
  2294. #define CRS_CR_TRIM ((uint32_t)0x00003F00U) /* HSI48 oscillator smooth trimming */
  2295. /******************* Bit definition for CRS_CFGR register *********************/
  2296. #define CRS_CFGR_RELOAD ((uint32_t)0x0000FFFFU) /* Counter reload value */
  2297. #define CRS_CFGR_FELIM ((uint32_t)0x00FF0000U) /* Frequency error limit */
  2298. #define CRS_CFGR_SYNCDIV ((uint32_t)0x07000000U) /* SYNC divider */
  2299. #define CRS_CFGR_SYNCDIV_0 ((uint32_t)0x01000000U) /* Bit 0 */
  2300. #define CRS_CFGR_SYNCDIV_1 ((uint32_t)0x02000000U) /* Bit 1 */
  2301. #define CRS_CFGR_SYNCDIV_2 ((uint32_t)0x04000000U) /* Bit 2 */
  2302. #define CRS_CFGR_SYNCSRC ((uint32_t)0x30000000U) /* SYNC signal source selection */
  2303. #define CRS_CFGR_SYNCSRC_0 ((uint32_t)0x10000000U) /* Bit 0 */
  2304. #define CRS_CFGR_SYNCSRC_1 ((uint32_t)0x20000000U) /* Bit 1 */
  2305. #define CRS_CFGR_SYNCPOL ((uint32_t)0x80000000U) /* SYNC polarity selection */
  2306. /******************* Bit definition for CRS_ISR register *********************/
  2307. #define CRS_ISR_SYNCOKF ((uint32_t)0x00000001U) /* SYNC event OK flag */
  2308. #define CRS_ISR_SYNCWARNF ((uint32_t)0x00000002U) /* SYNC warning */
  2309. #define CRS_ISR_ERRF ((uint32_t)0x00000004U) /* SYNC error flag */
  2310. #define CRS_ISR_ESYNCF ((uint32_t)0x00000008U) /* Expected SYNC flag */
  2311. #define CRS_ISR_SYNCERR ((uint32_t)0x00000100U) /* SYNC error */
  2312. #define CRS_ISR_SYNCMISS ((uint32_t)0x00000200U) /* SYNC missed */
  2313. #define CRS_ISR_TRIMOVF ((uint32_t)0x00000400U) /* Trimming overflow or underflow */
  2314. #define CRS_ISR_FEDIR ((uint32_t)0x00008000U) /* Frequency error direction */
  2315. #define CRS_ISR_FECAP ((uint32_t)0xFFFF0000U) /* Frequency error capture */
  2316. /******************* Bit definition for CRS_ICR register *********************/
  2317. #define CRS_ICR_SYNCOKC ((uint32_t)0x00000001U) /* SYNC event OK clear flag */
  2318. #define CRS_ICR_SYNCWARNC ((uint32_t)0x00000002U) /* SYNC warning clear flag */
  2319. #define CRS_ICR_ERRC ((uint32_t)0x00000004U) /* Error clear flag */
  2320. #define CRS_ICR_ESYNCC ((uint32_t)0x00000008U) /* Expected SYNC clear flag */
  2321. /******************************************************************************/
  2322. /* */
  2323. /* Digital to Analog Converter (DAC) */
  2324. /* */
  2325. /******************************************************************************/
  2326. /*
  2327. * @brief Specific device feature definitions (not present on all devices in the STM32F0 family)
  2328. */
  2329. #define DAC_CHANNEL2_SUPPORT /*!< DAC feature available only on specific devices: availability of DAC channel 2 */
  2330. /******************** Bit definition for DAC_CR register ********************/
  2331. #define DAC_CR_EN1 ((uint32_t)0x00000001U) /*!< DAC channel1 enable */
  2332. #define DAC_CR_BOFF1 ((uint32_t)0x00000002U) /*!< DAC channel1 output buffer disable */
  2333. #define DAC_CR_TEN1 ((uint32_t)0x00000004U) /*!< DAC channel1 Trigger enable */
  2334. #define DAC_CR_TSEL1 ((uint32_t)0x00000038U) /*!< TSEL1[2:0] (DAC channel1 Trigger selection) */
  2335. #define DAC_CR_TSEL1_0 ((uint32_t)0x00000008U) /*!< Bit 0 */
  2336. #define DAC_CR_TSEL1_1 ((uint32_t)0x00000010U) /*!< Bit 1 */
  2337. #define DAC_CR_TSEL1_2 ((uint32_t)0x00000020U) /*!< Bit 2 */
  2338. #define DAC_CR_WAVE1 ((uint32_t)0x000000C0U) /*!< WAVE1[1:0] (DAC channel1 noise/triangle wave generation enable) */
  2339. #define DAC_CR_WAVE1_0 ((uint32_t)0x00000040U) /*!< Bit 0 */
  2340. #define DAC_CR_WAVE1_1 ((uint32_t)0x00000080U) /*!< Bit 1 */
  2341. #define DAC_CR_MAMP1 ((uint32_t)0x00000F00U) /*!< MAMP1[3:0] (DAC channel1 Mask/Amplitude selector) */
  2342. #define DAC_CR_MAMP1_0 ((uint32_t)0x00000100U) /*!< Bit 0 */
  2343. #define DAC_CR_MAMP1_1 ((uint32_t)0x00000200U) /*!< Bit 1 */
  2344. #define DAC_CR_MAMP1_2 ((uint32_t)0x00000400U) /*!< Bit 2 */
  2345. #define DAC_CR_MAMP1_3 ((uint32_t)0x00000800U) /*!< Bit 3 */
  2346. #define DAC_CR_DMAEN1 ((uint32_t)0x00001000U) /*!< DAC channel1 DMA enable */
  2347. #define DAC_CR_DMAUDRIE1 ((uint32_t)0x00002000U) /*!< DAC channel1 DMA Underrun Interrupt enable */
  2348. #define DAC_CR_EN2 ((uint32_t)0x00010000U) /*!< DAC channel2 enable */
  2349. #define DAC_CR_BOFF2 ((uint32_t)0x00020000U) /*!< DAC channel2 output buffer disable */
  2350. #define DAC_CR_TEN2 ((uint32_t)0x00040000U) /*!< DAC channel2 Trigger enable */
  2351. #define DAC_CR_TSEL2 ((uint32_t)0x00380000U) /*!< TSEL2[2:0] (DAC channel2 Trigger selection) */
  2352. #define DAC_CR_TSEL2_0 ((uint32_t)0x00080000U) /*!< Bit 0 */
  2353. #define DAC_CR_TSEL2_1 ((uint32_t)0x00100000U) /*!< Bit 1 */
  2354. #define DAC_CR_TSEL2_2 ((uint32_t)0x00200000U) /*!< Bit 2 */
  2355. #define DAC_CR_WAVE2 ((uint32_t)0x00C00000U) /*!< WAVE2[1:0] (DAC channel2 noise/triangle wave generation enable) */
  2356. #define DAC_CR_WAVE2_0 ((uint32_t)0x00400000U) /*!< Bit 0 */
  2357. #define DAC_CR_WAVE2_1 ((uint32_t)0x00800000U) /*!< Bit 1 */
  2358. #define DAC_CR_MAMP2 ((uint32_t)0x0F000000U) /*!< MAMP2[3:0] (DAC channel2 Mask/Amplitude selector) */
  2359. #define DAC_CR_MAMP2_0 ((uint32_t)0x01000000U) /*!< Bit 0 */
  2360. #define DAC_CR_MAMP2_1 ((uint32_t)0x02000000U) /*!< Bit 1 */
  2361. #define DAC_CR_MAMP2_2 ((uint32_t)0x04000000U) /*!< Bit 2 */
  2362. #define DAC_CR_MAMP2_3 ((uint32_t)0x08000000U) /*!< Bit 3 */
  2363. #define DAC_CR_DMAEN2 ((uint32_t)0x10000000U) /*!< DAC channel2 DMA enabled */
  2364. #define DAC_CR_DMAUDRIE2 ((uint32_t)0x20000000U) /*!< DAC channel2 DMA Underrun Interrupt enable */
  2365. /***************** Bit definition for DAC_SWTRIGR register ******************/
  2366. #define DAC_SWTRIGR_SWTRIG1 ((uint32_t)0x00000001U) /*!< DAC channel1 software trigger */
  2367. #define DAC_SWTRIGR_SWTRIG2 ((uint32_t)0x00000002U) /*!< DAC channel2 software trigger */
  2368. /***************** Bit definition for DAC_DHR12R1 register ******************/
  2369. #define DAC_DHR12R1_DACC1DHR ((uint32_t)0x00000FFFU) /*!< DAC channel1 12-bit Right aligned data */
  2370. /***************** Bit definition for DAC_DHR12L1 register ******************/
  2371. #define DAC_DHR12L1_DACC1DHR ((uint32_t)0x0000FFF0U) /*!< DAC channel1 12-bit Left aligned data */
  2372. /****************** Bit definition for DAC_DHR8R1 register ******************/
  2373. #define DAC_DHR8R1_DACC1DHR ((uint32_t)0x000000FFU) /*!< DAC channel1 8-bit Right aligned data */
  2374. /***************** Bit definition for DAC_DHR12R2 register ******************/
  2375. #define DAC_DHR12R2_DACC2DHR ((uint32_t)0x00000FFFU) /*!< DAC channel2 12-bit Right aligned data */
  2376. /***************** Bit definition for DAC_DHR12L2 register ******************/
  2377. #define DAC_DHR12L2_DACC2DHR ((uint32_t)0x0000FFF0U) /*!< DAC channel2 12-bit Left aligned data */
  2378. /****************** Bit definition for DAC_DHR8R2 register ******************/
  2379. #define DAC_DHR8R2_DACC2DHR ((uint32_t)0x000000FFU) /*!< DAC channel2 8-bit Right aligned data */
  2380. /***************** Bit definition for DAC_DHR12RD register ******************/
  2381. #define DAC_DHR12RD_DACC1DHR ((uint32_t)0x00000FFFU) /*!< DAC channel1 12-bit Right aligned data */
  2382. #define DAC_DHR12RD_DACC2DHR ((uint32_t)0x0FFF0000U) /*!< DAC channel2 12-bit Right aligned data */
  2383. /***************** Bit definition for DAC_DHR12LD register ******************/
  2384. #define DAC_DHR12LD_DACC1DHR ((uint32_t)0x0000FFF0U) /*!< DAC channel1 12-bit Left aligned data */
  2385. #define DAC_DHR12LD_DACC2DHR ((uint32_t)0xFFF00000U) /*!< DAC channel2 12-bit Left aligned data */
  2386. /****************** Bit definition for DAC_DHR8RD register ******************/
  2387. #define DAC_DHR8RD_DACC1DHR ((uint32_t)0x000000FFU) /*!< DAC channel1 8-bit Right aligned data */
  2388. #define DAC_DHR8RD_DACC2DHR ((uint32_t)0x0000FF00U) /*!< DAC channel2 8-bit Right aligned data */
  2389. /******************* Bit definition for DAC_DOR1 register *******************/
  2390. #define DAC_DOR1_DACC1DOR ((uint32_t)0x00000FFFU) /*!< DAC channel1 data output */
  2391. /******************* Bit definition for DAC_DOR2 register *******************/
  2392. #define DAC_DOR2_DACC2DOR ((uint32_t)0x00000FFFU) /*!< DAC channel2 data output */
  2393. /******************** Bit definition for DAC_SR register ********************/
  2394. #define DAC_SR_DMAUDR1 ((uint32_t)0x00002000U) /*!< DAC channel1 DMA underrun flag */
  2395. #define DAC_SR_DMAUDR2 ((uint32_t)0x20000000U) /*!< DAC channel2 DMA underrun flag */
  2396. /******************************************************************************/
  2397. /* */
  2398. /* Debug MCU (DBGMCU) */
  2399. /* */
  2400. /******************************************************************************/
  2401. /**************** Bit definition for DBGMCU_IDCODE register *****************/
  2402. #define DBGMCU_IDCODE_DEV_ID ((uint32_t)0x00000FFFU) /*!< Device Identifier */
  2403. #define DBGMCU_IDCODE_REV_ID ((uint32_t)0xFFFF0000U) /*!< REV_ID[15:0] bits (Revision Identifier) */
  2404. #define DBGMCU_IDCODE_REV_ID_0 ((uint32_t)0x00010000U) /*!< Bit 0 */
  2405. #define DBGMCU_IDCODE_REV_ID_1 ((uint32_t)0x00020000U) /*!< Bit 1 */
  2406. #define DBGMCU_IDCODE_REV_ID_2 ((uint32_t)0x00040000U) /*!< Bit 2 */
  2407. #define DBGMCU_IDCODE_REV_ID_3 ((uint32_t)0x00080000U) /*!< Bit 3 */
  2408. #define DBGMCU_IDCODE_REV_ID_4 ((uint32_t)0x00100000U) /*!< Bit 4 */
  2409. #define DBGMCU_IDCODE_REV_ID_5 ((uint32_t)0x00200000U) /*!< Bit 5 */
  2410. #define DBGMCU_IDCODE_REV_ID_6 ((uint32_t)0x00400000U) /*!< Bit 6 */
  2411. #define DBGMCU_IDCODE_REV_ID_7 ((uint32_t)0x00800000U) /*!< Bit 7 */
  2412. #define DBGMCU_IDCODE_REV_ID_8 ((uint32_t)0x01000000U) /*!< Bit 8 */
  2413. #define DBGMCU_IDCODE_REV_ID_9 ((uint32_t)0x02000000U) /*!< Bit 9 */
  2414. #define DBGMCU_IDCODE_REV_ID_10 ((uint32_t)0x04000000U) /*!< Bit 10 */
  2415. #define DBGMCU_IDCODE_REV_ID_11 ((uint32_t)0x08000000U) /*!< Bit 11 */
  2416. #define DBGMCU_IDCODE_REV_ID_12 ((uint32_t)0x10000000U) /*!< Bit 12 */
  2417. #define DBGMCU_IDCODE_REV_ID_13 ((uint32_t)0x20000000U) /*!< Bit 13 */
  2418. #define DBGMCU_IDCODE_REV_ID_14 ((uint32_t)0x40000000U) /*!< Bit 14 */
  2419. #define DBGMCU_IDCODE_REV_ID_15 ((uint32_t)0x80000000U) /*!< Bit 15 */
  2420. /****************** Bit definition for DBGMCU_CR register *******************/
  2421. #define DBGMCU_CR_DBG_STOP ((uint32_t)0x00000002U) /*!< Debug Stop Mode */
  2422. #define DBGMCU_CR_DBG_STANDBY ((uint32_t)0x00000004U) /*!< Debug Standby mode */
  2423. /****************** Bit definition for DBGMCU_APB1_FZ register **************/
  2424. #define DBGMCU_APB1_FZ_DBG_TIM2_STOP ((uint32_t)0x00000001U) /*!< TIM2 counter stopped when core is halted */
  2425. #define DBGMCU_APB1_FZ_DBG_TIM3_STOP ((uint32_t)0x00000002U) /*!< TIM3 counter stopped when core is halted */
  2426. #define DBGMCU_APB1_FZ_DBG_TIM6_STOP ((uint32_t)0x00000010U) /*!< TIM6 counter stopped when core is halted */
  2427. #define DBGMCU_APB1_FZ_DBG_TIM7_STOP ((uint32_t)0x00000020U) /*!< TIM7 counter stopped when core is halted */
  2428. #define DBGMCU_APB1_FZ_DBG_TIM14_STOP ((uint32_t)0x00000100U) /*!< TIM14 counter stopped when core is halted */
  2429. #define DBGMCU_APB1_FZ_DBG_RTC_STOP ((uint32_t)0x00000400U) /*!< RTC Calendar frozen when core is halted */
  2430. #define DBGMCU_APB1_FZ_DBG_WWDG_STOP ((uint32_t)0x00000800U) /*!< Debug Window Watchdog stopped when Core is halted */
  2431. #define DBGMCU_APB1_FZ_DBG_IWDG_STOP ((uint32_t)0x00001000U) /*!< Debug Independent Watchdog stopped when Core is halted */
  2432. #define DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT ((uint32_t)0x00200000U) /*!< I2C1 SMBUS timeout mode stopped when Core is halted */
  2433. #define DBGMCU_APB1_FZ_DBG_CAN_STOP ((uint32_t)0x02000000U) /*!< CAN debug stopped when Core is halted */
  2434. /****************** Bit definition for DBGMCU_APB2_FZ register **************/
  2435. #define DBGMCU_APB2_FZ_DBG_TIM1_STOP ((uint32_t)0x00000800U) /*!< TIM1 counter stopped when core is halted */
  2436. #define DBGMCU_APB2_FZ_DBG_TIM15_STOP ((uint32_t)0x00010000U) /*!< TIM15 counter stopped when core is halted */
  2437. #define DBGMCU_APB2_FZ_DBG_TIM16_STOP ((uint32_t)0x00020000U) /*!< TIM16 counter stopped when core is halted */
  2438. #define DBGMCU_APB2_FZ_DBG_TIM17_STOP ((uint32_t)0x00040000U) /*!< TIM17 counter stopped when core is halted */
  2439. /******************************************************************************/
  2440. /* */
  2441. /* DMA Controller (DMA) */
  2442. /* */
  2443. /******************************************************************************/
  2444. /******************* Bit definition for DMA_ISR register ********************/
  2445. #define DMA_ISR_GIF1 ((uint32_t)0x00000001U) /*!< Channel 1 Global interrupt flag */
  2446. #define DMA_ISR_TCIF1 ((uint32_t)0x00000002U) /*!< Channel 1 Transfer Complete flag */
  2447. #define DMA_ISR_HTIF1 ((uint32_t)0x00000004U) /*!< Channel 1 Half Transfer flag */
  2448. #define DMA_ISR_TEIF1 ((uint32_t)0x00000008U) /*!< Channel 1 Transfer Error flag */
  2449. #define DMA_ISR_GIF2 ((uint32_t)0x00000010U) /*!< Channel 2 Global interrupt flag */
  2450. #define DMA_ISR_TCIF2 ((uint32_t)0x00000020U) /*!< Channel 2 Transfer Complete flag */
  2451. #define DMA_ISR_HTIF2 ((uint32_t)0x00000040U) /*!< Channel 2 Half Transfer flag */
  2452. #define DMA_ISR_TEIF2 ((uint32_t)0x00000080U) /*!< Channel 2 Transfer Error flag */
  2453. #define DMA_ISR_GIF3 ((uint32_t)0x00000100U) /*!< Channel 3 Global interrupt flag */
  2454. #define DMA_ISR_TCIF3 ((uint32_t)0x00000200U) /*!< Channel 3 Transfer Complete flag */
  2455. #define DMA_ISR_HTIF3 ((uint32_t)0x00000400U) /*!< Channel 3 Half Transfer flag */
  2456. #define DMA_ISR_TEIF3 ((uint32_t)0x00000800U) /*!< Channel 3 Transfer Error flag */
  2457. #define DMA_ISR_GIF4 ((uint32_t)0x00001000U) /*!< Channel 4 Global interrupt flag */
  2458. #define DMA_ISR_TCIF4 ((uint32_t)0x00002000U) /*!< Channel 4 Transfer Complete flag */
  2459. #define DMA_ISR_HTIF4 ((uint32_t)0x00004000U) /*!< Channel 4 Half Transfer flag */
  2460. #define DMA_ISR_TEIF4 ((uint32_t)0x00008000U) /*!< Channel 4 Transfer Error flag */
  2461. #define DMA_ISR_GIF5 ((uint32_t)0x00010000U) /*!< Channel 5 Global interrupt flag */
  2462. #define DMA_ISR_TCIF5 ((uint32_t)0x00020000U) /*!< Channel 5 Transfer Complete flag */
  2463. #define DMA_ISR_HTIF5 ((uint32_t)0x00040000U) /*!< Channel 5 Half Transfer flag */
  2464. #define DMA_ISR_TEIF5 ((uint32_t)0x00080000U) /*!< Channel 5 Transfer Error flag */
  2465. #define DMA_ISR_GIF6 ((uint32_t)0x00100000U) /*!< Channel 6 Global interrupt flag */
  2466. #define DMA_ISR_TCIF6 ((uint32_t)0x00200000U) /*!< Channel 6 Transfer Complete flag */
  2467. #define DMA_ISR_HTIF6 ((uint32_t)0x00400000U) /*!< Channel 6 Half Transfer flag */
  2468. #define DMA_ISR_TEIF6 ((uint32_t)0x00800000U) /*!< Channel 6 Transfer Error flag */
  2469. #define DMA_ISR_GIF7 ((uint32_t)0x01000000U) /*!< Channel 7 Global interrupt flag */
  2470. #define DMA_ISR_TCIF7 ((uint32_t)0x02000000U) /*!< Channel 7 Transfer Complete flag */
  2471. #define DMA_ISR_HTIF7 ((uint32_t)0x04000000U) /*!< Channel 7 Half Transfer flag */
  2472. #define DMA_ISR_TEIF7 ((uint32_t)0x08000000U) /*!< Channel 7 Transfer Error flag */
  2473. /******************* Bit definition for DMA_IFCR register *******************/
  2474. #define DMA_IFCR_CGIF1 ((uint32_t)0x00000001U) /*!< Channel 1 Global interrupt clear */
  2475. #define DMA_IFCR_CTCIF1 ((uint32_t)0x00000002U) /*!< Channel 1 Transfer Complete clear */
  2476. #define DMA_IFCR_CHTIF1 ((uint32_t)0x00000004U) /*!< Channel 1 Half Transfer clear */
  2477. #define DMA_IFCR_CTEIF1 ((uint32_t)0x00000008U) /*!< Channel 1 Transfer Error clear */
  2478. #define DMA_IFCR_CGIF2 ((uint32_t)0x00000010U) /*!< Channel 2 Global interrupt clear */
  2479. #define DMA_IFCR_CTCIF2 ((uint32_t)0x00000020U) /*!< Channel 2 Transfer Complete clear */
  2480. #define DMA_IFCR_CHTIF2 ((uint32_t)0x00000040U) /*!< Channel 2 Half Transfer clear */
  2481. #define DMA_IFCR_CTEIF2 ((uint32_t)0x00000080U) /*!< Channel 2 Transfer Error clear */
  2482. #define DMA_IFCR_CGIF3 ((uint32_t)0x00000100U) /*!< Channel 3 Global interrupt clear */
  2483. #define DMA_IFCR_CTCIF3 ((uint32_t)0x00000200U) /*!< Channel 3 Transfer Complete clear */
  2484. #define DMA_IFCR_CHTIF3 ((uint32_t)0x00000400U) /*!< Channel 3 Half Transfer clear */
  2485. #define DMA_IFCR_CTEIF3 ((uint32_t)0x00000800U) /*!< Channel 3 Transfer Error clear */
  2486. #define DMA_IFCR_CGIF4 ((uint32_t)0x00001000U) /*!< Channel 4 Global interrupt clear */
  2487. #define DMA_IFCR_CTCIF4 ((uint32_t)0x00002000U) /*!< Channel 4 Transfer Complete clear */
  2488. #define DMA_IFCR_CHTIF4 ((uint32_t)0x00004000U) /*!< Channel 4 Half Transfer clear */
  2489. #define DMA_IFCR_CTEIF4 ((uint32_t)0x00008000U) /*!< Channel 4 Transfer Error clear */
  2490. #define DMA_IFCR_CGIF5 ((uint32_t)0x00010000U) /*!< Channel 5 Global interrupt clear */
  2491. #define DMA_IFCR_CTCIF5 ((uint32_t)0x00020000U) /*!< Channel 5 Transfer Complete clear */
  2492. #define DMA_IFCR_CHTIF5 ((uint32_t)0x00040000U) /*!< Channel 5 Half Transfer clear */
  2493. #define DMA_IFCR_CTEIF5 ((uint32_t)0x00080000U) /*!< Channel 5 Transfer Error clear */
  2494. #define DMA_IFCR_CGIF6 ((uint32_t)0x00100000U) /*!< Channel 6 Global interrupt clear */
  2495. #define DMA_IFCR_CTCIF6 ((uint32_t)0x00200000U) /*!< Channel 6 Transfer Complete clear */
  2496. #define DMA_IFCR_CHTIF6 ((uint32_t)0x00400000U) /*!< Channel 6 Half Transfer clear */
  2497. #define DMA_IFCR_CTEIF6 ((uint32_t)0x00800000U) /*!< Channel 6 Transfer Error clear */
  2498. #define DMA_IFCR_CGIF7 ((uint32_t)0x01000000U) /*!< Channel 7 Global interrupt clear */
  2499. #define DMA_IFCR_CTCIF7 ((uint32_t)0x02000000U) /*!< Channel 7 Transfer Complete clear */
  2500. #define DMA_IFCR_CHTIF7 ((uint32_t)0x04000000U) /*!< Channel 7 Half Transfer clear */
  2501. #define DMA_IFCR_CTEIF7 ((uint32_t)0x08000000U) /*!< Channel 7 Transfer Error clear */
  2502. /******************* Bit definition for DMA_CCR register ********************/
  2503. #define DMA_CCR_EN ((uint32_t)0x00000001U) /*!< Channel enable */
  2504. #define DMA_CCR_TCIE ((uint32_t)0x00000002U) /*!< Transfer complete interrupt enable */
  2505. #define DMA_CCR_HTIE ((uint32_t)0x00000004U) /*!< Half Transfer interrupt enable */
  2506. #define DMA_CCR_TEIE ((uint32_t)0x00000008U) /*!< Transfer error interrupt enable */
  2507. #define DMA_CCR_DIR ((uint32_t)0x00000010U) /*!< Data transfer direction */
  2508. #define DMA_CCR_CIRC ((uint32_t)0x00000020U) /*!< Circular mode */
  2509. #define DMA_CCR_PINC ((uint32_t)0x00000040U) /*!< Peripheral increment mode */
  2510. #define DMA_CCR_MINC ((uint32_t)0x00000080U) /*!< Memory increment mode */
  2511. #define DMA_CCR_PSIZE ((uint32_t)0x00000300U) /*!< PSIZE[1:0] bits (Peripheral size) */
  2512. #define DMA_CCR_PSIZE_0 ((uint32_t)0x00000100U) /*!< Bit 0 */
  2513. #define DMA_CCR_PSIZE_1 ((uint32_t)0x00000200U) /*!< Bit 1 */
  2514. #define DMA_CCR_MSIZE ((uint32_t)0x00000C00U) /*!< MSIZE[1:0] bits (Memory size) */
  2515. #define DMA_CCR_MSIZE_0 ((uint32_t)0x00000400U) /*!< Bit 0 */
  2516. #define DMA_CCR_MSIZE_1 ((uint32_t)0x00000800U) /*!< Bit 1 */
  2517. #define DMA_CCR_PL ((uint32_t)0x00003000U) /*!< PL[1:0] bits(Channel Priority level)*/
  2518. #define DMA_CCR_PL_0 ((uint32_t)0x00001000U) /*!< Bit 0 */
  2519. #define DMA_CCR_PL_1 ((uint32_t)0x00002000U) /*!< Bit 1 */
  2520. #define DMA_CCR_MEM2MEM ((uint32_t)0x00004000U) /*!< Memory to memory mode */
  2521. /****************** Bit definition for DMA_CNDTR register *******************/
  2522. #define DMA_CNDTR_NDT ((uint32_t)0x0000FFFFU) /*!< Number of data to Transfer */
  2523. /****************** Bit definition for DMA_CPAR register ********************/
  2524. #define DMA_CPAR_PA ((uint32_t)0xFFFFFFFFU) /*!< Peripheral Address */
  2525. /****************** Bit definition for DMA_CMAR register ********************/
  2526. #define DMA_CMAR_MA ((uint32_t)0xFFFFFFFFU) /*!< Memory Address */
  2527. /******************************************************************************/
  2528. /* */
  2529. /* External Interrupt/Event Controller (EXTI) */
  2530. /* */
  2531. /******************************************************************************/
  2532. /******************* Bit definition for EXTI_IMR register *******************/
  2533. #define EXTI_IMR_MR0 ((uint32_t)0x00000001U) /*!< Interrupt Mask on line 0 */
  2534. #define EXTI_IMR_MR1 ((uint32_t)0x00000002U) /*!< Interrupt Mask on line 1 */
  2535. #define EXTI_IMR_MR2 ((uint32_t)0x00000004U) /*!< Interrupt Mask on line 2 */
  2536. #define EXTI_IMR_MR3 ((uint32_t)0x00000008U) /*!< Interrupt Mask on line 3 */
  2537. #define EXTI_IMR_MR4 ((uint32_t)0x00000010U) /*!< Interrupt Mask on line 4 */
  2538. #define EXTI_IMR_MR5 ((uint32_t)0x00000020U) /*!< Interrupt Mask on line 5 */
  2539. #define EXTI_IMR_MR6 ((uint32_t)0x00000040U) /*!< Interrupt Mask on line 6 */
  2540. #define EXTI_IMR_MR7 ((uint32_t)0x00000080U) /*!< Interrupt Mask on line 7 */
  2541. #define EXTI_IMR_MR8 ((uint32_t)0x00000100U) /*!< Interrupt Mask on line 8 */
  2542. #define EXTI_IMR_MR9 ((uint32_t)0x00000200U) /*!< Interrupt Mask on line 9 */
  2543. #define EXTI_IMR_MR10 ((uint32_t)0x00000400U) /*!< Interrupt Mask on line 10 */
  2544. #define EXTI_IMR_MR11 ((uint32_t)0x00000800U) /*!< Interrupt Mask on line 11 */
  2545. #define EXTI_IMR_MR12 ((uint32_t)0x00001000U) /*!< Interrupt Mask on line 12 */
  2546. #define EXTI_IMR_MR13 ((uint32_t)0x00002000U) /*!< Interrupt Mask on line 13 */
  2547. #define EXTI_IMR_MR14 ((uint32_t)0x00004000U) /*!< Interrupt Mask on line 14 */
  2548. #define EXTI_IMR_MR15 ((uint32_t)0x00008000U) /*!< Interrupt Mask on line 15 */
  2549. #define EXTI_IMR_MR16 ((uint32_t)0x00010000U) /*!< Interrupt Mask on line 16 */
  2550. #define EXTI_IMR_MR17 ((uint32_t)0x00020000U) /*!< Interrupt Mask on line 17 */
  2551. #define EXTI_IMR_MR18 ((uint32_t)0x00040000U) /*!< Interrupt Mask on line 18 */
  2552. #define EXTI_IMR_MR19 ((uint32_t)0x00080000U) /*!< Interrupt Mask on line 19 */
  2553. #define EXTI_IMR_MR20 ((uint32_t)0x00100000U) /*!< Interrupt Mask on line 20 */
  2554. #define EXTI_IMR_MR21 ((uint32_t)0x00200000U) /*!< Interrupt Mask on line 21 */
  2555. #define EXTI_IMR_MR22 ((uint32_t)0x00400000U) /*!< Interrupt Mask on line 22 */
  2556. #define EXTI_IMR_MR23 ((uint32_t)0x00800000U) /*!< Interrupt Mask on line 23 */
  2557. #define EXTI_IMR_MR25 ((uint32_t)0x02000000U) /*!< Interrupt Mask on line 25 */
  2558. #define EXTI_IMR_MR26 ((uint32_t)0x04000000U) /*!< Interrupt Mask on line 26 */
  2559. #define EXTI_IMR_MR27 ((uint32_t)0x08000000U) /*!< Interrupt Mask on line 27 */
  2560. #define EXTI_IMR_MR31 ((uint32_t)0x80000000U) /*!< Interrupt Mask on line 31 */
  2561. /* References Defines */
  2562. #define EXTI_IMR_IM0 EXTI_IMR_MR0
  2563. #define EXTI_IMR_IM1 EXTI_IMR_MR1
  2564. #define EXTI_IMR_IM2 EXTI_IMR_MR2
  2565. #define EXTI_IMR_IM3 EXTI_IMR_MR3
  2566. #define EXTI_IMR_IM4 EXTI_IMR_MR4
  2567. #define EXTI_IMR_IM5 EXTI_IMR_MR5
  2568. #define EXTI_IMR_IM6 EXTI_IMR_MR6
  2569. #define EXTI_IMR_IM7 EXTI_IMR_MR7
  2570. #define EXTI_IMR_IM8 EXTI_IMR_MR8
  2571. #define EXTI_IMR_IM9 EXTI_IMR_MR9
  2572. #define EXTI_IMR_IM10 EXTI_IMR_MR10
  2573. #define EXTI_IMR_IM11 EXTI_IMR_MR11
  2574. #define EXTI_IMR_IM12 EXTI_IMR_MR12
  2575. #define EXTI_IMR_IM13 EXTI_IMR_MR13
  2576. #define EXTI_IMR_IM14 EXTI_IMR_MR14
  2577. #define EXTI_IMR_IM15 EXTI_IMR_MR15
  2578. #define EXTI_IMR_IM16 EXTI_IMR_MR16
  2579. #define EXTI_IMR_IM17 EXTI_IMR_MR17
  2580. #define EXTI_IMR_IM18 EXTI_IMR_MR18
  2581. #define EXTI_IMR_IM19 EXTI_IMR_MR19
  2582. #define EXTI_IMR_IM20 EXTI_IMR_MR20
  2583. #define EXTI_IMR_IM21 EXTI_IMR_MR21
  2584. #define EXTI_IMR_IM22 EXTI_IMR_MR22
  2585. #define EXTI_IMR_IM23 EXTI_IMR_MR23
  2586. #define EXTI_IMR_IM25 EXTI_IMR_MR25
  2587. #define EXTI_IMR_IM26 EXTI_IMR_MR26
  2588. #define EXTI_IMR_IM27 EXTI_IMR_MR27
  2589. #define EXTI_IMR_IM31 EXTI_IMR_MR31
  2590. /****************** Bit definition for EXTI_EMR register ********************/
  2591. #define EXTI_EMR_MR0 ((uint32_t)0x00000001U) /*!< Event Mask on line 0 */
  2592. #define EXTI_EMR_MR1 ((uint32_t)0x00000002U) /*!< Event Mask on line 1 */
  2593. #define EXTI_EMR_MR2 ((uint32_t)0x00000004U) /*!< Event Mask on line 2 */
  2594. #define EXTI_EMR_MR3 ((uint32_t)0x00000008U) /*!< Event Mask on line 3 */
  2595. #define EXTI_EMR_MR4 ((uint32_t)0x00000010U) /*!< Event Mask on line 4 */
  2596. #define EXTI_EMR_MR5 ((uint32_t)0x00000020U) /*!< Event Mask on line 5 */
  2597. #define EXTI_EMR_MR6 ((uint32_t)0x00000040U) /*!< Event Mask on line 6 */
  2598. #define EXTI_EMR_MR7 ((uint32_t)0x00000080U) /*!< Event Mask on line 7 */
  2599. #define EXTI_EMR_MR8 ((uint32_t)0x00000100U) /*!< Event Mask on line 8 */
  2600. #define EXTI_EMR_MR9 ((uint32_t)0x00000200U) /*!< Event Mask on line 9 */
  2601. #define EXTI_EMR_MR10 ((uint32_t)0x00000400U) /*!< Event Mask on line 10 */
  2602. #define EXTI_EMR_MR11 ((uint32_t)0x00000800U) /*!< Event Mask on line 11 */
  2603. #define EXTI_EMR_MR12 ((uint32_t)0x00001000U) /*!< Event Mask on line 12 */
  2604. #define EXTI_EMR_MR13 ((uint32_t)0x00002000U) /*!< Event Mask on line 13 */
  2605. #define EXTI_EMR_MR14 ((uint32_t)0x00004000U) /*!< Event Mask on line 14 */
  2606. #define EXTI_EMR_MR15 ((uint32_t)0x00008000U) /*!< Event Mask on line 15 */
  2607. #define EXTI_EMR_MR16 ((uint32_t)0x00010000U) /*!< Event Mask on line 16 */
  2608. #define EXTI_EMR_MR17 ((uint32_t)0x00020000U) /*!< Event Mask on line 17 */
  2609. #define EXTI_EMR_MR18 ((uint32_t)0x00040000U) /*!< Event Mask on line 18 */
  2610. #define EXTI_EMR_MR19 ((uint32_t)0x00080000U) /*!< Event Mask on line 19 */
  2611. #define EXTI_EMR_MR20 ((uint32_t)0x00100000U) /*!< Event Mask on line 20 */
  2612. #define EXTI_EMR_MR21 ((uint32_t)0x00200000U) /*!< Event Mask on line 21 */
  2613. #define EXTI_EMR_MR22 ((uint32_t)0x00400000U) /*!< Event Mask on line 22 */
  2614. #define EXTI_EMR_MR23 ((uint32_t)0x00800000U) /*!< Event Mask on line 23 */
  2615. #define EXTI_EMR_MR25 ((uint32_t)0x02000000U) /*!< Event Mask on line 25 */
  2616. #define EXTI_EMR_MR26 ((uint32_t)0x04000000U) /*!< Event Mask on line 26 */
  2617. #define EXTI_EMR_MR27 ((uint32_t)0x08000000U) /*!< Event Mask on line 27 */
  2618. #define EXTI_EMR_MR31 ((uint32_t)0x80000000U) /*!< Event Mask on line 31 */
  2619. /* References Defines */
  2620. #define EXTI_EMR_EM0 EXTI_EMR_MR0
  2621. #define EXTI_EMR_EM1 EXTI_EMR_MR1
  2622. #define EXTI_EMR_EM2 EXTI_EMR_MR2
  2623. #define EXTI_EMR_EM3 EXTI_EMR_MR3
  2624. #define EXTI_EMR_EM4 EXTI_EMR_MR4
  2625. #define EXTI_EMR_EM5 EXTI_EMR_MR5
  2626. #define EXTI_EMR_EM6 EXTI_EMR_MR6
  2627. #define EXTI_EMR_EM7 EXTI_EMR_MR7
  2628. #define EXTI_EMR_EM8 EXTI_EMR_MR8
  2629. #define EXTI_EMR_EM9 EXTI_EMR_MR9
  2630. #define EXTI_EMR_EM10 EXTI_EMR_MR10
  2631. #define EXTI_EMR_EM11 EXTI_EMR_MR11
  2632. #define EXTI_EMR_EM12 EXTI_EMR_MR12
  2633. #define EXTI_EMR_EM13 EXTI_EMR_MR13
  2634. #define EXTI_EMR_EM14 EXTI_EMR_MR14
  2635. #define EXTI_EMR_EM15 EXTI_EMR_MR15
  2636. #define EXTI_EMR_EM16 EXTI_EMR_MR16
  2637. #define EXTI_EMR_EM17 EXTI_EMR_MR17
  2638. #define EXTI_EMR_EM18 EXTI_EMR_MR18
  2639. #define EXTI_EMR_EM19 EXTI_EMR_MR19
  2640. #define EXTI_EMR_EM20 EXTI_EMR_MR0
  2641. #define EXTI_EMR_EM21 EXTI_EMR_MR21
  2642. #define EXTI_EMR_EM22 EXTI_EMR_MR22
  2643. #define EXTI_EMR_EM23 EXTI_EMR_MR23
  2644. #define EXTI_EMR_EM25 EXTI_EMR_MR25
  2645. #define EXTI_EMR_EM26 EXTI_EMR_MR26
  2646. #define EXTI_EMR_EM27 EXTI_EMR_MR27
  2647. #define EXTI_EMR_EM31 EXTI_EMR_MR31
  2648. /******************* Bit definition for EXTI_RTSR register ******************/
  2649. #define EXTI_RTSR_TR0 ((uint32_t)0x00000001U) /*!< Rising trigger event configuration bit of line 0 */
  2650. #define EXTI_RTSR_TR1 ((uint32_t)0x00000002U) /*!< Rising trigger event configuration bit of line 1 */
  2651. #define EXTI_RTSR_TR2 ((uint32_t)0x00000004U) /*!< Rising trigger event configuration bit of line 2 */
  2652. #define EXTI_RTSR_TR3 ((uint32_t)0x00000008U) /*!< Rising trigger event configuration bit of line 3 */
  2653. #define EXTI_RTSR_TR4 ((uint32_t)0x00000010U) /*!< Rising trigger event configuration bit of line 4 */
  2654. #define EXTI_RTSR_TR5 ((uint32_t)0x00000020U) /*!< Rising trigger event configuration bit of line 5 */
  2655. #define EXTI_RTSR_TR6 ((uint32_t)0x00000040U) /*!< Rising trigger event configuration bit of line 6 */
  2656. #define EXTI_RTSR_TR7 ((uint32_t)0x00000080U) /*!< Rising trigger event configuration bit of line 7 */
  2657. #define EXTI_RTSR_TR8 ((uint32_t)0x00000100U) /*!< Rising trigger event configuration bit of line 8 */
  2658. #define EXTI_RTSR_TR9 ((uint32_t)0x00000200U) /*!< Rising trigger event configuration bit of line 9 */
  2659. #define EXTI_RTSR_TR10 ((uint32_t)0x00000400U) /*!< Rising trigger event configuration bit of line 10 */
  2660. #define EXTI_RTSR_TR11 ((uint32_t)0x00000800U) /*!< Rising trigger event configuration bit of line 11 */
  2661. #define EXTI_RTSR_TR12 ((uint32_t)0x00001000U) /*!< Rising trigger event configuration bit of line 12 */
  2662. #define EXTI_RTSR_TR13 ((uint32_t)0x00002000U) /*!< Rising trigger event configuration bit of line 13 */
  2663. #define EXTI_RTSR_TR14 ((uint32_t)0x00004000U) /*!< Rising trigger event configuration bit of line 14 */
  2664. #define EXTI_RTSR_TR15 ((uint32_t)0x00008000U) /*!< Rising trigger event configuration bit of line 15 */
  2665. #define EXTI_RTSR_TR16 ((uint32_t)0x00010000U) /*!< Rising trigger event configuration bit of line 16 */
  2666. #define EXTI_RTSR_TR17 ((uint32_t)0x00020000U) /*!< Rising trigger event configuration bit of line 17 */
  2667. #define EXTI_RTSR_TR19 ((uint32_t)0x00080000U) /*!< Rising trigger event configuration bit of line 19 */
  2668. #define EXTI_RTSR_TR20 ((uint32_t)0x00100000U) /*!< Rising trigger event configuration bit of line 20 */
  2669. #define EXTI_RTSR_TR21 ((uint32_t)0x00200000U) /*!< Rising trigger event configuration bit of line 21 */
  2670. #define EXTI_RTSR_TR22 ((uint32_t)0x00400000U) /*!< Rising trigger event configuration bit of line 22 */
  2671. /* References Defines */
  2672. #define EXTI_RTSR_RT0 EXTI_RTSR_TR0
  2673. #define EXTI_RTSR_RT1 EXTI_RTSR_TR1
  2674. #define EXTI_RTSR_RT2 EXTI_RTSR_TR2
  2675. #define EXTI_RTSR_RT3 EXTI_RTSR_TR3
  2676. #define EXTI_RTSR_RT4 EXTI_RTSR_TR4
  2677. #define EXTI_RTSR_RT5 EXTI_RTSR_TR5
  2678. #define EXTI_RTSR_RT6 EXTI_RTSR_TR6
  2679. #define EXTI_RTSR_RT7 EXTI_RTSR_TR7
  2680. #define EXTI_RTSR_RT8 EXTI_RTSR_TR8
  2681. #define EXTI_RTSR_RT9 EXTI_RTSR_TR9
  2682. #define EXTI_RTSR_RT10 EXTI_RTSR_TR10
  2683. #define EXTI_RTSR_RT11 EXTI_RTSR_TR11
  2684. #define EXTI_RTSR_RT12 EXTI_RTSR_TR12
  2685. #define EXTI_RTSR_RT13 EXTI_RTSR_TR13
  2686. #define EXTI_RTSR_RT14 EXTI_RTSR_TR14
  2687. #define EXTI_RTSR_RT15 EXTI_RTSR_TR15
  2688. #define EXTI_RTSR_RT16 EXTI_RTSR_TR16
  2689. #define EXTI_RTSR_RT17 EXTI_RTSR_TR17
  2690. #define EXTI_RTSR_RT19 EXTI_RTSR_TR19
  2691. #define EXTI_RTSR_RT20 EXTI_RTSR_TR20
  2692. #define EXTI_RTSR_RT21 EXTI_RTSR_TR21
  2693. #define EXTI_RTSR_RT22 EXTI_RTSR_TR22
  2694. /******************* Bit definition for EXTI_FTSR register *******************/
  2695. #define EXTI_FTSR_TR0 ((uint32_t)0x00000001U) /*!< Falling trigger event configuration bit of line 0 */
  2696. #define EXTI_FTSR_TR1 ((uint32_t)0x00000002U) /*!< Falling trigger event configuration bit of line 1 */
  2697. #define EXTI_FTSR_TR2 ((uint32_t)0x00000004U) /*!< Falling trigger event configuration bit of line 2 */
  2698. #define EXTI_FTSR_TR3 ((uint32_t)0x00000008U) /*!< Falling trigger event configuration bit of line 3 */
  2699. #define EXTI_FTSR_TR4 ((uint32_t)0x00000010U) /*!< Falling trigger event configuration bit of line 4 */
  2700. #define EXTI_FTSR_TR5 ((uint32_t)0x00000020U) /*!< Falling trigger event configuration bit of line 5 */
  2701. #define EXTI_FTSR_TR6 ((uint32_t)0x00000040U) /*!< Falling trigger event configuration bit of line 6 */
  2702. #define EXTI_FTSR_TR7 ((uint32_t)0x00000080U) /*!< Falling trigger event configuration bit of line 7 */
  2703. #define EXTI_FTSR_TR8 ((uint32_t)0x00000100U) /*!< Falling trigger event configuration bit of line 8 */
  2704. #define EXTI_FTSR_TR9 ((uint32_t)0x00000200U) /*!< Falling trigger event configuration bit of line 9 */
  2705. #define EXTI_FTSR_TR10 ((uint32_t)0x00000400U) /*!< Falling trigger event configuration bit of line 10 */
  2706. #define EXTI_FTSR_TR11 ((uint32_t)0x00000800U) /*!< Falling trigger event configuration bit of line 11 */
  2707. #define EXTI_FTSR_TR12 ((uint32_t)0x00001000U) /*!< Falling trigger event configuration bit of line 12 */
  2708. #define EXTI_FTSR_TR13 ((uint32_t)0x00002000U) /*!< Falling trigger event configuration bit of line 13 */
  2709. #define EXTI_FTSR_TR14 ((uint32_t)0x00004000U) /*!< Falling trigger event configuration bit of line 14 */
  2710. #define EXTI_FTSR_TR15 ((uint32_t)0x00008000U) /*!< Falling trigger event configuration bit of line 15 */
  2711. #define EXTI_FTSR_TR16 ((uint32_t)0x00010000U) /*!< Falling trigger event configuration bit of line 16 */
  2712. #define EXTI_FTSR_TR17 ((uint32_t)0x00020000U) /*!< Falling trigger event configuration bit of line 17 */
  2713. #define EXTI_FTSR_TR19 ((uint32_t)0x00080000U) /*!< Falling trigger event configuration bit of line 19 */
  2714. #define EXTI_FTSR_TR20 ((uint32_t)0x00100000U) /*!< Falling trigger event configuration bit of line 20 */
  2715. #define EXTI_FTSR_TR21 ((uint32_t)0x00200000U) /*!< Falling trigger event configuration bit of line 21 */
  2716. #define EXTI_FTSR_TR22 ((uint32_t)0x00400000U) /*!< Falling trigger event configuration bit of line 22 */
  2717. /* References Defines */
  2718. #define EXTI_FTSR_FT0 EXTI_FTSR_TR0
  2719. #define EXTI_FTSR_FT1 EXTI_FTSR_TR1
  2720. #define EXTI_FTSR_FT2 EXTI_FTSR_TR2
  2721. #define EXTI_FTSR_FT3 EXTI_FTSR_TR3
  2722. #define EXTI_FTSR_FT4 EXTI_FTSR_TR4
  2723. #define EXTI_FTSR_FT5 EXTI_FTSR_TR5
  2724. #define EXTI_FTSR_FT6 EXTI_FTSR_TR6
  2725. #define EXTI_FTSR_FT7 EXTI_FTSR_TR7
  2726. #define EXTI_FTSR_FT8 EXTI_FTSR_TR8
  2727. #define EXTI_FTSR_FT9 EXTI_FTSR_TR9
  2728. #define EXTI_FTSR_FT10 EXTI_FTSR_TR10
  2729. #define EXTI_FTSR_FT11 EXTI_FTSR_TR11
  2730. #define EXTI_FTSR_FT12 EXTI_FTSR_TR12
  2731. #define EXTI_FTSR_FT13 EXTI_FTSR_TR13
  2732. #define EXTI_FTSR_FT14 EXTI_FTSR_TR14
  2733. #define EXTI_FTSR_FT15 EXTI_FTSR_TR15
  2734. #define EXTI_FTSR_FT16 EXTI_FTSR_TR16
  2735. #define EXTI_FTSR_FT17 EXTI_FTSR_TR17
  2736. #define EXTI_FTSR_FT19 EXTI_FTSR_TR19
  2737. #define EXTI_FTSR_FT20 EXTI_FTSR_TR20
  2738. #define EXTI_FTSR_FT21 EXTI_FTSR_TR21
  2739. #define EXTI_FTSR_FT22 EXTI_FTSR_TR22
  2740. /******************* Bit definition for EXTI_SWIER register *******************/
  2741. #define EXTI_SWIER_SWIER0 ((uint32_t)0x00000001U) /*!< Software Interrupt on line 0 */
  2742. #define EXTI_SWIER_SWIER1 ((uint32_t)0x00000002U) /*!< Software Interrupt on line 1 */
  2743. #define EXTI_SWIER_SWIER2 ((uint32_t)0x00000004U) /*!< Software Interrupt on line 2 */
  2744. #define EXTI_SWIER_SWIER3 ((uint32_t)0x00000008U) /*!< Software Interrupt on line 3 */
  2745. #define EXTI_SWIER_SWIER4 ((uint32_t)0x00000010U) /*!< Software Interrupt on line 4 */
  2746. #define EXTI_SWIER_SWIER5 ((uint32_t)0x00000020U) /*!< Software Interrupt on line 5 */
  2747. #define EXTI_SWIER_SWIER6 ((uint32_t)0x00000040U) /*!< Software Interrupt on line 6 */
  2748. #define EXTI_SWIER_SWIER7 ((uint32_t)0x00000080U) /*!< Software Interrupt on line 7 */
  2749. #define EXTI_SWIER_SWIER8 ((uint32_t)0x00000100U) /*!< Software Interrupt on line 8 */
  2750. #define EXTI_SWIER_SWIER9 ((uint32_t)0x00000200U) /*!< Software Interrupt on line 9 */
  2751. #define EXTI_SWIER_SWIER10 ((uint32_t)0x00000400U) /*!< Software Interrupt on line 10 */
  2752. #define EXTI_SWIER_SWIER11 ((uint32_t)0x00000800U) /*!< Software Interrupt on line 11 */
  2753. #define EXTI_SWIER_SWIER12 ((uint32_t)0x00001000U) /*!< Software Interrupt on line 12 */
  2754. #define EXTI_SWIER_SWIER13 ((uint32_t)0x00002000U) /*!< Software Interrupt on line 13 */
  2755. #define EXTI_SWIER_SWIER14 ((uint32_t)0x00004000U) /*!< Software Interrupt on line 14 */
  2756. #define EXTI_SWIER_SWIER15 ((uint32_t)0x00008000U) /*!< Software Interrupt on line 15 */
  2757. #define EXTI_SWIER_SWIER16 ((uint32_t)0x00010000U) /*!< Software Interrupt on line 16 */
  2758. #define EXTI_SWIER_SWIER17 ((uint32_t)0x00020000U) /*!< Software Interrupt on line 17 */
  2759. #define EXTI_SWIER_SWIER19 ((uint32_t)0x00080000U) /*!< Software Interrupt on line 19 */
  2760. #define EXTI_SWIER_SWIER20 ((uint32_t)0x00100000U) /*!< Software Interrupt on line 20 */
  2761. #define EXTI_SWIER_SWIER21 ((uint32_t)0x00200000U) /*!< Software Interrupt on line 21 */
  2762. #define EXTI_SWIER_SWIER22 ((uint32_t)0x00400000U) /*!< Software Interrupt on line 22 */
  2763. /* References Defines */
  2764. #define EXTI_SWIER_SWI0 EXTI_SWIER_SWIER0
  2765. #define EXTI_SWIER_SWI1 EXTI_SWIER_SWIER1
  2766. #define EXTI_SWIER_SWI2 EXTI_SWIER_SWIER2
  2767. #define EXTI_SWIER_SWI3 EXTI_SWIER_SWIER3
  2768. #define EXTI_SWIER_SWI4 EXTI_SWIER_SWIER4
  2769. #define EXTI_SWIER_SWI5 EXTI_SWIER_SWIER5
  2770. #define EXTI_SWIER_SWI6 EXTI_SWIER_SWIER6
  2771. #define EXTI_SWIER_SWI7 EXTI_SWIER_SWIER7
  2772. #define EXTI_SWIER_SWI8 EXTI_SWIER_SWIER8
  2773. #define EXTI_SWIER_SWI9 EXTI_SWIER_SWIER9
  2774. #define EXTI_SWIER_SWI10 EXTI_SWIER_SWIER10
  2775. #define EXTI_SWIER_SWI11 EXTI_SWIER_SWIER11
  2776. #define EXTI_SWIER_SWI12 EXTI_SWIER_SWIER12
  2777. #define EXTI_SWIER_SWI13 EXTI_SWIER_SWIER13
  2778. #define EXTI_SWIER_SWI14 EXTI_SWIER_SWIER14
  2779. #define EXTI_SWIER_SWI15 EXTI_SWIER_SWIER15
  2780. #define EXTI_SWIER_SWI16 EXTI_SWIER_SWIER16
  2781. #define EXTI_SWIER_SWI17 EXTI_SWIER_SWIER17
  2782. #define EXTI_SWIER_SWI19 EXTI_SWIER_SWIER19
  2783. #define EXTI_SWIER_SWI20 EXTI_SWIER_SWIER20
  2784. #define EXTI_SWIER_SWI21 EXTI_SWIER_SWIER21
  2785. #define EXTI_SWIER_SWI22 EXTI_SWIER_SWIER22
  2786. /****************** Bit definition for EXTI_PR register *********************/
  2787. #define EXTI_PR_PR0 ((uint32_t)0x00000001U) /*!< Pending bit 0 */
  2788. #define EXTI_PR_PR1 ((uint32_t)0x00000002U) /*!< Pending bit 1 */
  2789. #define EXTI_PR_PR2 ((uint32_t)0x00000004U) /*!< Pending bit 2 */
  2790. #define EXTI_PR_PR3 ((uint32_t)0x00000008U) /*!< Pending bit 3 */
  2791. #define EXTI_PR_PR4 ((uint32_t)0x00000010U) /*!< Pending bit 4 */
  2792. #define EXTI_PR_PR5 ((uint32_t)0x00000020U) /*!< Pending bit 5 */
  2793. #define EXTI_PR_PR6 ((uint32_t)0x00000040U) /*!< Pending bit 6 */
  2794. #define EXTI_PR_PR7 ((uint32_t)0x00000080U) /*!< Pending bit 7 */
  2795. #define EXTI_PR_PR8 ((uint32_t)0x00000100U) /*!< Pending bit 8 */
  2796. #define EXTI_PR_PR9 ((uint32_t)0x00000200U) /*!< Pending bit 9 */
  2797. #define EXTI_PR_PR10 ((uint32_t)0x00000400U) /*!< Pending bit 10 */
  2798. #define EXTI_PR_PR11 ((uint32_t)0x00000800U) /*!< Pending bit 11 */
  2799. #define EXTI_PR_PR12 ((uint32_t)0x00001000U) /*!< Pending bit 12 */
  2800. #define EXTI_PR_PR13 ((uint32_t)0x00002000U) /*!< Pending bit 13 */
  2801. #define EXTI_PR_PR14 ((uint32_t)0x00004000U) /*!< Pending bit 14 */
  2802. #define EXTI_PR_PR15 ((uint32_t)0x00008000U) /*!< Pending bit 15 */
  2803. #define EXTI_PR_PR16 ((uint32_t)0x00010000U) /*!< Pending bit 16 */
  2804. #define EXTI_PR_PR17 ((uint32_t)0x00020000U) /*!< Pending bit 17 */
  2805. #define EXTI_PR_PR19 ((uint32_t)0x00080000U) /*!< Pending bit 19 */
  2806. #define EXTI_PR_PR20 ((uint32_t)0x00100000U) /*!< Pending bit 20 */
  2807. #define EXTI_PR_PR21 ((uint32_t)0x00200000U) /*!< Pending bit 21 */
  2808. #define EXTI_PR_PR22 ((uint32_t)0x00400000U) /*!< Pending bit 22 */
  2809. /* References Defines */
  2810. #define EXTI_PR_PIF0 EXTI_PR_PR0
  2811. #define EXTI_PR_PIF1 EXTI_PR_PR1
  2812. #define EXTI_PR_PIF2 EXTI_PR_PR2
  2813. #define EXTI_PR_PIF3 EXTI_PR_PR3
  2814. #define EXTI_PR_PIF4 EXTI_PR_PR4
  2815. #define EXTI_PR_PIF5 EXTI_PR_PR5
  2816. #define EXTI_PR_PIF6 EXTI_PR_PR6
  2817. #define EXTI_PR_PIF7 EXTI_PR_PR7
  2818. #define EXTI_PR_PIF8 EXTI_PR_PR8
  2819. #define EXTI_PR_PIF9 EXTI_PR_PR9
  2820. #define EXTI_PR_PIF10 EXTI_PR_PR10
  2821. #define EXTI_PR_PIF11 EXTI_PR_PR11
  2822. #define EXTI_PR_PIF12 EXTI_PR_PR12
  2823. #define EXTI_PR_PIF13 EXTI_PR_PR13
  2824. #define EXTI_PR_PIF14 EXTI_PR_PR14
  2825. #define EXTI_PR_PIF15 EXTI_PR_PR15
  2826. #define EXTI_PR_PIF16 EXTI_PR_PR16
  2827. #define EXTI_PR_PIF17 EXTI_PR_PR17
  2828. #define EXTI_PR_PIF19 EXTI_PR_PR19
  2829. #define EXTI_PR_PIF20 EXTI_PR_PR20
  2830. #define EXTI_PR_PIF21 EXTI_PR_PR21
  2831. #define EXTI_PR_PIF22 EXTI_PR_PR22
  2832. /******************************************************************************/
  2833. /* */
  2834. /* FLASH and Option Bytes Registers */
  2835. /* */
  2836. /******************************************************************************/
  2837. /******************* Bit definition for FLASH_ACR register ******************/
  2838. #define FLASH_ACR_LATENCY ((uint32_t)0x00000001U) /*!< LATENCY bit (Latency) */
  2839. #define FLASH_ACR_PRFTBE ((uint32_t)0x00000010U) /*!< Prefetch Buffer Enable */
  2840. #define FLASH_ACR_PRFTBS ((uint32_t)0x00000020U) /*!< Prefetch Buffer Status */
  2841. /****************** Bit definition for FLASH_KEYR register ******************/
  2842. #define FLASH_KEYR_FKEYR ((uint32_t)0xFFFFFFFFU) /*!< FPEC Key */
  2843. /***************** Bit definition for FLASH_OPTKEYR register ****************/
  2844. #define FLASH_OPTKEYR_OPTKEYR ((uint32_t)0xFFFFFFFFU) /*!< Option Byte Key */
  2845. /****************** FLASH Keys **********************************************/
  2846. #define FLASH_KEY1 ((uint32_t)0x45670123U) /*!< Flash program erase key1 */
  2847. #define FLASH_KEY2 ((uint32_t)0xCDEF89ABU) /*!< Flash program erase key2: used with FLASH_PEKEY1
  2848. to unlock the write access to the FPEC. */
  2849. #define FLASH_OPTKEY1 ((uint32_t)0x45670123U) /*!< Flash option key1 */
  2850. #define FLASH_OPTKEY2 ((uint32_t)0xCDEF89ABU) /*!< Flash option key2: used with FLASH_OPTKEY1 to
  2851. unlock the write access to the option byte block */
  2852. /****************** Bit definition for FLASH_SR register *******************/
  2853. #define FLASH_SR_BSY ((uint32_t)0x00000001U) /*!< Busy */
  2854. #define FLASH_SR_PGERR ((uint32_t)0x00000004U) /*!< Programming Error */
  2855. #define FLASH_SR_WRPRTERR ((uint32_t)0x00000010U) /*!< Write Protection Error */
  2856. #define FLASH_SR_EOP ((uint32_t)0x00000020U) /*!< End of operation */
  2857. #define FLASH_SR_WRPERR FLASH_SR_WRPRTERR /*!< Legacy of Write Protection Error */
  2858. /******************* Bit definition for FLASH_CR register *******************/
  2859. #define FLASH_CR_PG ((uint32_t)0x00000001U) /*!< Programming */
  2860. #define FLASH_CR_PER ((uint32_t)0x00000002U) /*!< Page Erase */
  2861. #define FLASH_CR_MER ((uint32_t)0x00000004U) /*!< Mass Erase */
  2862. #define FLASH_CR_OPTPG ((uint32_t)0x00000010U) /*!< Option Byte Programming */
  2863. #define FLASH_CR_OPTER ((uint32_t)0x00000020U) /*!< Option Byte Erase */
  2864. #define FLASH_CR_STRT ((uint32_t)0x00000040U) /*!< Start */
  2865. #define FLASH_CR_LOCK ((uint32_t)0x00000080U) /*!< Lock */
  2866. #define FLASH_CR_OPTWRE ((uint32_t)0x00000200U) /*!< Option Bytes Write Enable */
  2867. #define FLASH_CR_ERRIE ((uint32_t)0x00000400U) /*!< Error Interrupt Enable */
  2868. #define FLASH_CR_EOPIE ((uint32_t)0x00001000U) /*!< End of operation interrupt enable */
  2869. #define FLASH_CR_OBL_LAUNCH ((uint32_t)0x00002000U) /*!< Option Bytes Loader Launch */
  2870. /******************* Bit definition for FLASH_AR register *******************/
  2871. #define FLASH_AR_FAR ((uint32_t)0xFFFFFFFFU) /*!< Flash Address */
  2872. /****************** Bit definition for FLASH_OBR register *******************/
  2873. #define FLASH_OBR_OPTERR ((uint32_t)0x00000001U) /*!< Option Byte Error */
  2874. #define FLASH_OBR_RDPRT1 ((uint32_t)0x00000002U) /*!< Read protection Level 1 */
  2875. #define FLASH_OBR_RDPRT2 ((uint32_t)0x00000004U) /*!< Read protection Level 2 */
  2876. #define FLASH_OBR_USER ((uint32_t)0x00007700U) /*!< User Option Bytes */
  2877. #define FLASH_OBR_IWDG_SW ((uint32_t)0x00000100U) /*!< IWDG SW */
  2878. #define FLASH_OBR_nRST_STOP ((uint32_t)0x00000200U) /*!< nRST_STOP */
  2879. #define FLASH_OBR_nRST_STDBY ((uint32_t)0x00000400U) /*!< nRST_STDBY */
  2880. #define FLASH_OBR_nBOOT1 ((uint32_t)0x00001000U) /*!< nBOOT1 */
  2881. #define FLASH_OBR_VDDA_MONITOR ((uint32_t)0x00002000U) /*!< VDDA power supply supervisor */
  2882. #define FLASH_OBR_RAM_PARITY_CHECK ((uint32_t)0x00004000U) /*!< RAM parity check */
  2883. #define FLASH_OBR_DATA0 ((uint32_t)0x00FF0000U) /*!< Data0 */
  2884. #define FLASH_OBR_DATA1 ((uint32_t)0xFF000000U) /*!< Data1 */
  2885. /* Old BOOT1 bit definition, maintained for legacy purpose */
  2886. #define FLASH_OBR_BOOT1 FLASH_OBR_nBOOT1
  2887. /* Old OBR_VDDA bit definition, maintained for legacy purpose */
  2888. #define FLASH_OBR_VDDA_ANALOG FLASH_OBR_VDDA_MONITOR
  2889. /****************** Bit definition for FLASH_WRPR register ******************/
  2890. #define FLASH_WRPR_WRP ((uint32_t)0x0000FFFFU) /*!< Write Protect */
  2891. /*----------------------------------------------------------------------------*/
  2892. /****************** Bit definition for OB_RDP register **********************/
  2893. #define OB_RDP_RDP ((uint32_t)0x000000FFU) /*!< Read protection option byte */
  2894. #define OB_RDP_nRDP ((uint32_t)0x0000FF00U) /*!< Read protection complemented option byte */
  2895. /****************** Bit definition for OB_USER register *********************/
  2896. #define OB_USER_USER ((uint32_t)0x00FF0000U) /*!< User option byte */
  2897. #define OB_USER_nUSER ((uint32_t)0xFF000000U) /*!< User complemented option byte */
  2898. /****************** Bit definition for OB_WRP0 register *********************/
  2899. #define OB_WRP0_WRP0 ((uint32_t)0x000000FFU) /*!< Flash memory write protection option bytes */
  2900. #define OB_WRP0_nWRP0 ((uint32_t)0x0000FF00U) /*!< Flash memory write protection complemented option bytes */
  2901. /****************** Bit definition for OB_WRP1 register *********************/
  2902. #define OB_WRP1_WRP1 ((uint32_t)0x00FF0000U) /*!< Flash memory write protection option bytes */
  2903. #define OB_WRP1_nWRP1 ((uint32_t)0xFF000000U) /*!< Flash memory write protection complemented option bytes */
  2904. /****************** Bit definition for OB_WRP2 register *********************/
  2905. #define OB_WRP2_WRP2 ((uint32_t)0x000000FFU) /*!< Flash memory write protection option bytes */
  2906. #define OB_WRP2_nWRP2 ((uint32_t)0x0000FF00U) /*!< Flash memory write protection complemented option bytes */
  2907. /****************** Bit definition for OB_WRP3 register *********************/
  2908. #define OB_WRP3_WRP3 ((uint32_t)0x00FF0000U) /*!< Flash memory write protection option bytes */
  2909. #define OB_WRP3_nWRP3 ((uint32_t)0xFF000000U) /*!< Flash memory write protection complemented option bytes */
  2910. /******************************************************************************/
  2911. /* */
  2912. /* General Purpose IOs (GPIO) */
  2913. /* */
  2914. /******************************************************************************/
  2915. /******************* Bit definition for GPIO_MODER register *****************/
  2916. #define GPIO_MODER_MODER0 ((uint32_t)0x00000003U)
  2917. #define GPIO_MODER_MODER0_0 ((uint32_t)0x00000001U)
  2918. #define GPIO_MODER_MODER0_1 ((uint32_t)0x00000002U)
  2919. #define GPIO_MODER_MODER1 ((uint32_t)0x0000000CU)
  2920. #define GPIO_MODER_MODER1_0 ((uint32_t)0x00000004U)
  2921. #define GPIO_MODER_MODER1_1 ((uint32_t)0x00000008U)
  2922. #define GPIO_MODER_MODER2 ((uint32_t)0x00000030U)
  2923. #define GPIO_MODER_MODER2_0 ((uint32_t)0x00000010U)
  2924. #define GPIO_MODER_MODER2_1 ((uint32_t)0x00000020U)
  2925. #define GPIO_MODER_MODER3 ((uint32_t)0x000000C0U)
  2926. #define GPIO_MODER_MODER3_0 ((uint32_t)0x00000040U)
  2927. #define GPIO_MODER_MODER3_1 ((uint32_t)0x00000080U)
  2928. #define GPIO_MODER_MODER4 ((uint32_t)0x00000300U)
  2929. #define GPIO_MODER_MODER4_0 ((uint32_t)0x00000100U)
  2930. #define GPIO_MODER_MODER4_1 ((uint32_t)0x00000200U)
  2931. #define GPIO_MODER_MODER5 ((uint32_t)0x00000C00U)
  2932. #define GPIO_MODER_MODER5_0 ((uint32_t)0x00000400U)
  2933. #define GPIO_MODER_MODER5_1 ((uint32_t)0x00000800U)
  2934. #define GPIO_MODER_MODER6 ((uint32_t)0x00003000U)
  2935. #define GPIO_MODER_MODER6_0 ((uint32_t)0x00001000U)
  2936. #define GPIO_MODER_MODER6_1 ((uint32_t)0x00002000U)
  2937. #define GPIO_MODER_MODER7 ((uint32_t)0x0000C000U)
  2938. #define GPIO_MODER_MODER7_0 ((uint32_t)0x00004000U)
  2939. #define GPIO_MODER_MODER7_1 ((uint32_t)0x00008000U)
  2940. #define GPIO_MODER_MODER8 ((uint32_t)0x00030000U)
  2941. #define GPIO_MODER_MODER8_0 ((uint32_t)0x00010000U)
  2942. #define GPIO_MODER_MODER8_1 ((uint32_t)0x00020000U)
  2943. #define GPIO_MODER_MODER9 ((uint32_t)0x000C0000U)
  2944. #define GPIO_MODER_MODER9_0 ((uint32_t)0x00040000U)
  2945. #define GPIO_MODER_MODER9_1 ((uint32_t)0x00080000U)
  2946. #define GPIO_MODER_MODER10 ((uint32_t)0x00300000U)
  2947. #define GPIO_MODER_MODER10_0 ((uint32_t)0x00100000U)
  2948. #define GPIO_MODER_MODER10_1 ((uint32_t)0x00200000U)
  2949. #define GPIO_MODER_MODER11 ((uint32_t)0x00C00000U)
  2950. #define GPIO_MODER_MODER11_0 ((uint32_t)0x00400000U)
  2951. #define GPIO_MODER_MODER11_1 ((uint32_t)0x00800000U)
  2952. #define GPIO_MODER_MODER12 ((uint32_t)0x03000000U)
  2953. #define GPIO_MODER_MODER12_0 ((uint32_t)0x01000000U)
  2954. #define GPIO_MODER_MODER12_1 ((uint32_t)0x02000000U)
  2955. #define GPIO_MODER_MODER13 ((uint32_t)0x0C000000U)
  2956. #define GPIO_MODER_MODER13_0 ((uint32_t)0x04000000U)
  2957. #define GPIO_MODER_MODER13_1 ((uint32_t)0x08000000U)
  2958. #define GPIO_MODER_MODER14 ((uint32_t)0x30000000U)
  2959. #define GPIO_MODER_MODER14_0 ((uint32_t)0x10000000U)
  2960. #define GPIO_MODER_MODER14_1 ((uint32_t)0x20000000U)
  2961. #define GPIO_MODER_MODER15 ((uint32_t)0xC0000000U)
  2962. #define GPIO_MODER_MODER15_0 ((uint32_t)0x40000000U)
  2963. #define GPIO_MODER_MODER15_1 ((uint32_t)0x80000000U)
  2964. /****************** Bit definition for GPIO_OTYPER register *****************/
  2965. #define GPIO_OTYPER_OT_0 ((uint32_t)0x00000001U)
  2966. #define GPIO_OTYPER_OT_1 ((uint32_t)0x00000002U)
  2967. #define GPIO_OTYPER_OT_2 ((uint32_t)0x00000004U)
  2968. #define GPIO_OTYPER_OT_3 ((uint32_t)0x00000008U)
  2969. #define GPIO_OTYPER_OT_4 ((uint32_t)0x00000010U)
  2970. #define GPIO_OTYPER_OT_5 ((uint32_t)0x00000020U)
  2971. #define GPIO_OTYPER_OT_6 ((uint32_t)0x00000040U)
  2972. #define GPIO_OTYPER_OT_7 ((uint32_t)0x00000080U)
  2973. #define GPIO_OTYPER_OT_8 ((uint32_t)0x00000100U)
  2974. #define GPIO_OTYPER_OT_9 ((uint32_t)0x00000200U)
  2975. #define GPIO_OTYPER_OT_10 ((uint32_t)0x00000400U)
  2976. #define GPIO_OTYPER_OT_11 ((uint32_t)0x00000800U)
  2977. #define GPIO_OTYPER_OT_12 ((uint32_t)0x00001000U)
  2978. #define GPIO_OTYPER_OT_13 ((uint32_t)0x00002000U)
  2979. #define GPIO_OTYPER_OT_14 ((uint32_t)0x00004000U)
  2980. #define GPIO_OTYPER_OT_15 ((uint32_t)0x00008000U)
  2981. /**************** Bit definition for GPIO_OSPEEDR register ******************/
  2982. #define GPIO_OSPEEDR_OSPEEDR0 ((uint32_t)0x00000003U)
  2983. #define GPIO_OSPEEDR_OSPEEDR0_0 ((uint32_t)0x00000001U)
  2984. #define GPIO_OSPEEDR_OSPEEDR0_1 ((uint32_t)0x00000002U)
  2985. #define GPIO_OSPEEDR_OSPEEDR1 ((uint32_t)0x0000000CU)
  2986. #define GPIO_OSPEEDR_OSPEEDR1_0 ((uint32_t)0x00000004U)
  2987. #define GPIO_OSPEEDR_OSPEEDR1_1 ((uint32_t)0x00000008U)
  2988. #define GPIO_OSPEEDR_OSPEEDR2 ((uint32_t)0x00000030U)
  2989. #define GPIO_OSPEEDR_OSPEEDR2_0 ((uint32_t)0x00000010U)
  2990. #define GPIO_OSPEEDR_OSPEEDR2_1 ((uint32_t)0x00000020U)
  2991. #define GPIO_OSPEEDR_OSPEEDR3 ((uint32_t)0x000000C0U)
  2992. #define GPIO_OSPEEDR_OSPEEDR3_0 ((uint32_t)0x00000040U)
  2993. #define GPIO_OSPEEDR_OSPEEDR3_1 ((uint32_t)0x00000080U)
  2994. #define GPIO_OSPEEDR_OSPEEDR4 ((uint32_t)0x00000300U)
  2995. #define GPIO_OSPEEDR_OSPEEDR4_0 ((uint32_t)0x00000100U)
  2996. #define GPIO_OSPEEDR_OSPEEDR4_1 ((uint32_t)0x00000200U)
  2997. #define GPIO_OSPEEDR_OSPEEDR5 ((uint32_t)0x00000C00U)
  2998. #define GPIO_OSPEEDR_OSPEEDR5_0 ((uint32_t)0x00000400U)
  2999. #define GPIO_OSPEEDR_OSPEEDR5_1 ((uint32_t)0x00000800U)
  3000. #define GPIO_OSPEEDR_OSPEEDR6 ((uint32_t)0x00003000U)
  3001. #define GPIO_OSPEEDR_OSPEEDR6_0 ((uint32_t)0x00001000U)
  3002. #define GPIO_OSPEEDR_OSPEEDR6_1 ((uint32_t)0x00002000U)
  3003. #define GPIO_OSPEEDR_OSPEEDR7 ((uint32_t)0x0000C000U)
  3004. #define GPIO_OSPEEDR_OSPEEDR7_0 ((uint32_t)0x00004000U)
  3005. #define GPIO_OSPEEDR_OSPEEDR7_1 ((uint32_t)0x00008000U)
  3006. #define GPIO_OSPEEDR_OSPEEDR8 ((uint32_t)0x00030000U)
  3007. #define GPIO_OSPEEDR_OSPEEDR8_0 ((uint32_t)0x00010000U)
  3008. #define GPIO_OSPEEDR_OSPEEDR8_1 ((uint32_t)0x00020000U)
  3009. #define GPIO_OSPEEDR_OSPEEDR9 ((uint32_t)0x000C0000U)
  3010. #define GPIO_OSPEEDR_OSPEEDR9_0 ((uint32_t)0x00040000U)
  3011. #define GPIO_OSPEEDR_OSPEEDR9_1 ((uint32_t)0x00080000U)
  3012. #define GPIO_OSPEEDR_OSPEEDR10 ((uint32_t)0x00300000U)
  3013. #define GPIO_OSPEEDR_OSPEEDR10_0 ((uint32_t)0x00100000U)
  3014. #define GPIO_OSPEEDR_OSPEEDR10_1 ((uint32_t)0x00200000U)
  3015. #define GPIO_OSPEEDR_OSPEEDR11 ((uint32_t)0x00C00000U)
  3016. #define GPIO_OSPEEDR_OSPEEDR11_0 ((uint32_t)0x00400000U)
  3017. #define GPIO_OSPEEDR_OSPEEDR11_1 ((uint32_t)0x00800000U)
  3018. #define GPIO_OSPEEDR_OSPEEDR12 ((uint32_t)0x03000000U)
  3019. #define GPIO_OSPEEDR_OSPEEDR12_0 ((uint32_t)0x01000000U)
  3020. #define GPIO_OSPEEDR_OSPEEDR12_1 ((uint32_t)0x02000000U)
  3021. #define GPIO_OSPEEDR_OSPEEDR13 ((uint32_t)0x0C000000U)
  3022. #define GPIO_OSPEEDR_OSPEEDR13_0 ((uint32_t)0x04000000U)
  3023. #define GPIO_OSPEEDR_OSPEEDR13_1 ((uint32_t)0x08000000U)
  3024. #define GPIO_OSPEEDR_OSPEEDR14 ((uint32_t)0x30000000U)
  3025. #define GPIO_OSPEEDR_OSPEEDR14_0 ((uint32_t)0x10000000U)
  3026. #define GPIO_OSPEEDR_OSPEEDR14_1 ((uint32_t)0x20000000U)
  3027. #define GPIO_OSPEEDR_OSPEEDR15 ((uint32_t)0xC0000000U)
  3028. #define GPIO_OSPEEDR_OSPEEDR15_0 ((uint32_t)0x40000000U)
  3029. #define GPIO_OSPEEDR_OSPEEDR15_1 ((uint32_t)0x80000000U)
  3030. /* Old Bit definition for GPIO_OSPEEDR register maintained for legacy purpose */
  3031. #define GPIO_OSPEEDER_OSPEEDR0 GPIO_OSPEEDR_OSPEEDR0
  3032. #define GPIO_OSPEEDER_OSPEEDR0_0 GPIO_OSPEEDR_OSPEEDR0_0
  3033. #define GPIO_OSPEEDER_OSPEEDR0_1 GPIO_OSPEEDR_OSPEEDR0_1
  3034. #define GPIO_OSPEEDER_OSPEEDR1 GPIO_OSPEEDR_OSPEEDR1
  3035. #define GPIO_OSPEEDER_OSPEEDR1_0 GPIO_OSPEEDR_OSPEEDR1_0
  3036. #define GPIO_OSPEEDER_OSPEEDR1_1 GPIO_OSPEEDR_OSPEEDR1_1
  3037. #define GPIO_OSPEEDER_OSPEEDR2 GPIO_OSPEEDR_OSPEEDR2
  3038. #define GPIO_OSPEEDER_OSPEEDR2_0 GPIO_OSPEEDR_OSPEEDR2_0
  3039. #define GPIO_OSPEEDER_OSPEEDR2_1 GPIO_OSPEEDR_OSPEEDR2_1
  3040. #define GPIO_OSPEEDER_OSPEEDR3 GPIO_OSPEEDR_OSPEEDR3
  3041. #define GPIO_OSPEEDER_OSPEEDR3_0 GPIO_OSPEEDR_OSPEEDR3_0
  3042. #define GPIO_OSPEEDER_OSPEEDR3_1 GPIO_OSPEEDR_OSPEEDR3_1
  3043. #define GPIO_OSPEEDER_OSPEEDR4 GPIO_OSPEEDR_OSPEEDR4
  3044. #define GPIO_OSPEEDER_OSPEEDR4_0 GPIO_OSPEEDR_OSPEEDR4_0
  3045. #define GPIO_OSPEEDER_OSPEEDR4_1 GPIO_OSPEEDR_OSPEEDR4_1
  3046. #define GPIO_OSPEEDER_OSPEEDR5 GPIO_OSPEEDR_OSPEEDR5
  3047. #define GPIO_OSPEEDER_OSPEEDR5_0 GPIO_OSPEEDR_OSPEEDR5_0
  3048. #define GPIO_OSPEEDER_OSPEEDR5_1 GPIO_OSPEEDR_OSPEEDR5_1
  3049. #define GPIO_OSPEEDER_OSPEEDR6 GPIO_OSPEEDR_OSPEEDR6
  3050. #define GPIO_OSPEEDER_OSPEEDR6_0 GPIO_OSPEEDR_OSPEEDR6_0
  3051. #define GPIO_OSPEEDER_OSPEEDR6_1 GPIO_OSPEEDR_OSPEEDR6_1
  3052. #define GPIO_OSPEEDER_OSPEEDR7 GPIO_OSPEEDR_OSPEEDR7
  3053. #define GPIO_OSPEEDER_OSPEEDR7_0 GPIO_OSPEEDR_OSPEEDR7_0
  3054. #define GPIO_OSPEEDER_OSPEEDR7_1 GPIO_OSPEEDR_OSPEEDR7_1
  3055. #define GPIO_OSPEEDER_OSPEEDR8 GPIO_OSPEEDR_OSPEEDR8
  3056. #define GPIO_OSPEEDER_OSPEEDR8_0 GPIO_OSPEEDR_OSPEEDR8_0
  3057. #define GPIO_OSPEEDER_OSPEEDR8_1 GPIO_OSPEEDR_OSPEEDR8_1
  3058. #define GPIO_OSPEEDER_OSPEEDR9 GPIO_OSPEEDR_OSPEEDR9
  3059. #define GPIO_OSPEEDER_OSPEEDR9_0 GPIO_OSPEEDR_OSPEEDR9_0
  3060. #define GPIO_OSPEEDER_OSPEEDR9_1 GPIO_OSPEEDR_OSPEEDR9_1
  3061. #define GPIO_OSPEEDER_OSPEEDR10 GPIO_OSPEEDR_OSPEEDR10
  3062. #define GPIO_OSPEEDER_OSPEEDR10_0 GPIO_OSPEEDR_OSPEEDR10_0
  3063. #define GPIO_OSPEEDER_OSPEEDR10_1 GPIO_OSPEEDR_OSPEEDR10_1
  3064. #define GPIO_OSPEEDER_OSPEEDR11 GPIO_OSPEEDR_OSPEEDR11
  3065. #define GPIO_OSPEEDER_OSPEEDR11_0 GPIO_OSPEEDR_OSPEEDR11_0
  3066. #define GPIO_OSPEEDER_OSPEEDR11_1 GPIO_OSPEEDR_OSPEEDR11_1
  3067. #define GPIO_OSPEEDER_OSPEEDR12 GPIO_OSPEEDR_OSPEEDR12
  3068. #define GPIO_OSPEEDER_OSPEEDR12_0 GPIO_OSPEEDR_OSPEEDR12_0
  3069. #define GPIO_OSPEEDER_OSPEEDR12_1 GPIO_OSPEEDR_OSPEEDR12_1
  3070. #define GPIO_OSPEEDER_OSPEEDR13 GPIO_OSPEEDR_OSPEEDR13
  3071. #define GPIO_OSPEEDER_OSPEEDR13_0 GPIO_OSPEEDR_OSPEEDR13_0
  3072. #define GPIO_OSPEEDER_OSPEEDR13_1 GPIO_OSPEEDR_OSPEEDR13_1
  3073. #define GPIO_OSPEEDER_OSPEEDR14 GPIO_OSPEEDR_OSPEEDR14
  3074. #define GPIO_OSPEEDER_OSPEEDR14_0 GPIO_OSPEEDR_OSPEEDR14_0
  3075. #define GPIO_OSPEEDER_OSPEEDR14_1 GPIO_OSPEEDR_OSPEEDR14_1
  3076. #define GPIO_OSPEEDER_OSPEEDR15 GPIO_OSPEEDR_OSPEEDR15
  3077. #define GPIO_OSPEEDER_OSPEEDR15_0 GPIO_OSPEEDR_OSPEEDR15_0
  3078. #define GPIO_OSPEEDER_OSPEEDR15_1 GPIO_OSPEEDR_OSPEEDR15_1
  3079. /******************* Bit definition for GPIO_PUPDR register ******************/
  3080. #define GPIO_PUPDR_PUPDR0 ((uint32_t)0x00000003U)
  3081. #define GPIO_PUPDR_PUPDR0_0 ((uint32_t)0x00000001U)
  3082. #define GPIO_PUPDR_PUPDR0_1 ((uint32_t)0x00000002U)
  3083. #define GPIO_PUPDR_PUPDR1 ((uint32_t)0x0000000CU)
  3084. #define GPIO_PUPDR_PUPDR1_0 ((uint32_t)0x00000004U)
  3085. #define GPIO_PUPDR_PUPDR1_1 ((uint32_t)0x00000008U)
  3086. #define GPIO_PUPDR_PUPDR2 ((uint32_t)0x00000030U)
  3087. #define GPIO_PUPDR_PUPDR2_0 ((uint32_t)0x00000010U)
  3088. #define GPIO_PUPDR_PUPDR2_1 ((uint32_t)0x00000020U)
  3089. #define GPIO_PUPDR_PUPDR3 ((uint32_t)0x000000C0U)
  3090. #define GPIO_PUPDR_PUPDR3_0 ((uint32_t)0x00000040U)
  3091. #define GPIO_PUPDR_PUPDR3_1 ((uint32_t)0x00000080U)
  3092. #define GPIO_PUPDR_PUPDR4 ((uint32_t)0x00000300U)
  3093. #define GPIO_PUPDR_PUPDR4_0 ((uint32_t)0x00000100U)
  3094. #define GPIO_PUPDR_PUPDR4_1 ((uint32_t)0x00000200U)
  3095. #define GPIO_PUPDR_PUPDR5 ((uint32_t)0x00000C00U)
  3096. #define GPIO_PUPDR_PUPDR5_0 ((uint32_t)0x00000400U)
  3097. #define GPIO_PUPDR_PUPDR5_1 ((uint32_t)0x00000800U)
  3098. #define GPIO_PUPDR_PUPDR6 ((uint32_t)0x00003000U)
  3099. #define GPIO_PUPDR_PUPDR6_0 ((uint32_t)0x00001000U)
  3100. #define GPIO_PUPDR_PUPDR6_1 ((uint32_t)0x00002000U)
  3101. #define GPIO_PUPDR_PUPDR7 ((uint32_t)0x0000C000U)
  3102. #define GPIO_PUPDR_PUPDR7_0 ((uint32_t)0x00004000U)
  3103. #define GPIO_PUPDR_PUPDR7_1 ((uint32_t)0x00008000U)
  3104. #define GPIO_PUPDR_PUPDR8 ((uint32_t)0x00030000U)
  3105. #define GPIO_PUPDR_PUPDR8_0 ((uint32_t)0x00010000U)
  3106. #define GPIO_PUPDR_PUPDR8_1 ((uint32_t)0x00020000U)
  3107. #define GPIO_PUPDR_PUPDR9 ((uint32_t)0x000C0000U)
  3108. #define GPIO_PUPDR_PUPDR9_0 ((uint32_t)0x00040000U)
  3109. #define GPIO_PUPDR_PUPDR9_1 ((uint32_t)0x00080000U)
  3110. #define GPIO_PUPDR_PUPDR10 ((uint32_t)0x00300000U)
  3111. #define GPIO_PUPDR_PUPDR10_0 ((uint32_t)0x00100000U)
  3112. #define GPIO_PUPDR_PUPDR10_1 ((uint32_t)0x00200000U)
  3113. #define GPIO_PUPDR_PUPDR11 ((uint32_t)0x00C00000U)
  3114. #define GPIO_PUPDR_PUPDR11_0 ((uint32_t)0x00400000U)
  3115. #define GPIO_PUPDR_PUPDR11_1 ((uint32_t)0x00800000U)
  3116. #define GPIO_PUPDR_PUPDR12 ((uint32_t)0x03000000U)
  3117. #define GPIO_PUPDR_PUPDR12_0 ((uint32_t)0x01000000U)
  3118. #define GPIO_PUPDR_PUPDR12_1 ((uint32_t)0x02000000U)
  3119. #define GPIO_PUPDR_PUPDR13 ((uint32_t)0x0C000000U)
  3120. #define GPIO_PUPDR_PUPDR13_0 ((uint32_t)0x04000000U)
  3121. #define GPIO_PUPDR_PUPDR13_1 ((uint32_t)0x08000000U)
  3122. #define GPIO_PUPDR_PUPDR14 ((uint32_t)0x30000000U)
  3123. #define GPIO_PUPDR_PUPDR14_0 ((uint32_t)0x10000000U)
  3124. #define GPIO_PUPDR_PUPDR14_1 ((uint32_t)0x20000000U)
  3125. #define GPIO_PUPDR_PUPDR15 ((uint32_t)0xC0000000U)
  3126. #define GPIO_PUPDR_PUPDR15_0 ((uint32_t)0x40000000U)
  3127. #define GPIO_PUPDR_PUPDR15_1 ((uint32_t)0x80000000U)
  3128. /******************* Bit definition for GPIO_IDR register *******************/
  3129. #define GPIO_IDR_0 ((uint32_t)0x00000001U)
  3130. #define GPIO_IDR_1 ((uint32_t)0x00000002U)
  3131. #define GPIO_IDR_2 ((uint32_t)0x00000004U)
  3132. #define GPIO_IDR_3 ((uint32_t)0x00000008U)
  3133. #define GPIO_IDR_4 ((uint32_t)0x00000010U)
  3134. #define GPIO_IDR_5 ((uint32_t)0x00000020U)
  3135. #define GPIO_IDR_6 ((uint32_t)0x00000040U)
  3136. #define GPIO_IDR_7 ((uint32_t)0x00000080U)
  3137. #define GPIO_IDR_8 ((uint32_t)0x00000100U)
  3138. #define GPIO_IDR_9 ((uint32_t)0x00000200U)
  3139. #define GPIO_IDR_10 ((uint32_t)0x00000400U)
  3140. #define GPIO_IDR_11 ((uint32_t)0x00000800U)
  3141. #define GPIO_IDR_12 ((uint32_t)0x00001000U)
  3142. #define GPIO_IDR_13 ((uint32_t)0x00002000U)
  3143. #define GPIO_IDR_14 ((uint32_t)0x00004000U)
  3144. #define GPIO_IDR_15 ((uint32_t)0x00008000U)
  3145. /****************** Bit definition for GPIO_ODR register ********************/
  3146. #define GPIO_ODR_0 ((uint32_t)0x00000001U)
  3147. #define GPIO_ODR_1 ((uint32_t)0x00000002U)
  3148. #define GPIO_ODR_2 ((uint32_t)0x00000004U)
  3149. #define GPIO_ODR_3 ((uint32_t)0x00000008U)
  3150. #define GPIO_ODR_4 ((uint32_t)0x00000010U)
  3151. #define GPIO_ODR_5 ((uint32_t)0x00000020U)
  3152. #define GPIO_ODR_6 ((uint32_t)0x00000040U)
  3153. #define GPIO_ODR_7 ((uint32_t)0x00000080U)
  3154. #define GPIO_ODR_8 ((uint32_t)0x00000100U)
  3155. #define GPIO_ODR_9 ((uint32_t)0x00000200U)
  3156. #define GPIO_ODR_10 ((uint32_t)0x00000400U)
  3157. #define GPIO_ODR_11 ((uint32_t)0x00000800U)
  3158. #define GPIO_ODR_12 ((uint32_t)0x00001000U)
  3159. #define GPIO_ODR_13 ((uint32_t)0x00002000U)
  3160. #define GPIO_ODR_14 ((uint32_t)0x00004000U)
  3161. #define GPIO_ODR_15 ((uint32_t)0x00008000U)
  3162. /****************** Bit definition for GPIO_BSRR register ********************/
  3163. #define GPIO_BSRR_BS_0 ((uint32_t)0x00000001U)
  3164. #define GPIO_BSRR_BS_1 ((uint32_t)0x00000002U)
  3165. #define GPIO_BSRR_BS_2 ((uint32_t)0x00000004U)
  3166. #define GPIO_BSRR_BS_3 ((uint32_t)0x00000008U)
  3167. #define GPIO_BSRR_BS_4 ((uint32_t)0x00000010U)
  3168. #define GPIO_BSRR_BS_5 ((uint32_t)0x00000020U)
  3169. #define GPIO_BSRR_BS_6 ((uint32_t)0x00000040U)
  3170. #define GPIO_BSRR_BS_7 ((uint32_t)0x00000080U)
  3171. #define GPIO_BSRR_BS_8 ((uint32_t)0x00000100U)
  3172. #define GPIO_BSRR_BS_9 ((uint32_t)0x00000200U)
  3173. #define GPIO_BSRR_BS_10 ((uint32_t)0x00000400U)
  3174. #define GPIO_BSRR_BS_11 ((uint32_t)0x00000800U)
  3175. #define GPIO_BSRR_BS_12 ((uint32_t)0x00001000U)
  3176. #define GPIO_BSRR_BS_13 ((uint32_t)0x00002000U)
  3177. #define GPIO_BSRR_BS_14 ((uint32_t)0x00004000U)
  3178. #define GPIO_BSRR_BS_15 ((uint32_t)0x00008000U)
  3179. #define GPIO_BSRR_BR_0 ((uint32_t)0x00010000U)
  3180. #define GPIO_BSRR_BR_1 ((uint32_t)0x00020000U)
  3181. #define GPIO_BSRR_BR_2 ((uint32_t)0x00040000U)
  3182. #define GPIO_BSRR_BR_3 ((uint32_t)0x00080000U)
  3183. #define GPIO_BSRR_BR_4 ((uint32_t)0x00100000U)
  3184. #define GPIO_BSRR_BR_5 ((uint32_t)0x00200000U)
  3185. #define GPIO_BSRR_BR_6 ((uint32_t)0x00400000U)
  3186. #define GPIO_BSRR_BR_7 ((uint32_t)0x00800000U)
  3187. #define GPIO_BSRR_BR_8 ((uint32_t)0x01000000U)
  3188. #define GPIO_BSRR_BR_9 ((uint32_t)0x02000000U)
  3189. #define GPIO_BSRR_BR_10 ((uint32_t)0x04000000U)
  3190. #define GPIO_BSRR_BR_11 ((uint32_t)0x08000000U)
  3191. #define GPIO_BSRR_BR_12 ((uint32_t)0x10000000U)
  3192. #define GPIO_BSRR_BR_13 ((uint32_t)0x20000000U)
  3193. #define GPIO_BSRR_BR_14 ((uint32_t)0x40000000U)
  3194. #define GPIO_BSRR_BR_15 ((uint32_t)0x80000000U)
  3195. /****************** Bit definition for GPIO_LCKR register ********************/
  3196. #define GPIO_LCKR_LCK0 ((uint32_t)0x00000001U)
  3197. #define GPIO_LCKR_LCK1 ((uint32_t)0x00000002U)
  3198. #define GPIO_LCKR_LCK2 ((uint32_t)0x00000004U)
  3199. #define GPIO_LCKR_LCK3 ((uint32_t)0x00000008U)
  3200. #define GPIO_LCKR_LCK4 ((uint32_t)0x00000010U)
  3201. #define GPIO_LCKR_LCK5 ((uint32_t)0x00000020U)
  3202. #define GPIO_LCKR_LCK6 ((uint32_t)0x00000040U)
  3203. #define GPIO_LCKR_LCK7 ((uint32_t)0x00000080U)
  3204. #define GPIO_LCKR_LCK8 ((uint32_t)0x00000100U)
  3205. #define GPIO_LCKR_LCK9 ((uint32_t)0x00000200U)
  3206. #define GPIO_LCKR_LCK10 ((uint32_t)0x00000400U)
  3207. #define GPIO_LCKR_LCK11 ((uint32_t)0x00000800U)
  3208. #define GPIO_LCKR_LCK12 ((uint32_t)0x00001000U)
  3209. #define GPIO_LCKR_LCK13 ((uint32_t)0x00002000U)
  3210. #define GPIO_LCKR_LCK14 ((uint32_t)0x00004000U)
  3211. #define GPIO_LCKR_LCK15 ((uint32_t)0x00008000U)
  3212. #define GPIO_LCKR_LCKK ((uint32_t)0x00010000U)
  3213. /****************** Bit definition for GPIO_AFRL register ********************/
  3214. #define GPIO_AFRL_AFRL0 ((uint32_t)0x0000000FU)
  3215. #define GPIO_AFRL_AFRL1 ((uint32_t)0x000000F0U)
  3216. #define GPIO_AFRL_AFRL2 ((uint32_t)0x00000F00U)
  3217. #define GPIO_AFRL_AFRL3 ((uint32_t)0x0000F000U)
  3218. #define GPIO_AFRL_AFRL4 ((uint32_t)0x000F0000U)
  3219. #define GPIO_AFRL_AFRL5 ((uint32_t)0x00F00000U)
  3220. #define GPIO_AFRL_AFRL6 ((uint32_t)0x0F000000U)
  3221. #define GPIO_AFRL_AFRL7 ((uint32_t)0xF0000000U)
  3222. /****************** Bit definition for GPIO_AFRH register ********************/
  3223. #define GPIO_AFRH_AFRH0 ((uint32_t)0x0000000FU)
  3224. #define GPIO_AFRH_AFRH1 ((uint32_t)0x000000F0U)
  3225. #define GPIO_AFRH_AFRH2 ((uint32_t)0x00000F00U)
  3226. #define GPIO_AFRH_AFRH3 ((uint32_t)0x0000F000U)
  3227. #define GPIO_AFRH_AFRH4 ((uint32_t)0x000F0000U)
  3228. #define GPIO_AFRH_AFRH5 ((uint32_t)0x00F00000U)
  3229. #define GPIO_AFRH_AFRH6 ((uint32_t)0x0F000000U)
  3230. #define GPIO_AFRH_AFRH7 ((uint32_t)0xF0000000U)
  3231. /****************** Bit definition for GPIO_BRR register *********************/
  3232. #define GPIO_BRR_BR_0 ((uint32_t)0x00000001U)
  3233. #define GPIO_BRR_BR_1 ((uint32_t)0x00000002U)
  3234. #define GPIO_BRR_BR_2 ((uint32_t)0x00000004U)
  3235. #define GPIO_BRR_BR_3 ((uint32_t)0x00000008U)
  3236. #define GPIO_BRR_BR_4 ((uint32_t)0x00000010U)
  3237. #define GPIO_BRR_BR_5 ((uint32_t)0x00000020U)
  3238. #define GPIO_BRR_BR_6 ((uint32_t)0x00000040U)
  3239. #define GPIO_BRR_BR_7 ((uint32_t)0x00000080U)
  3240. #define GPIO_BRR_BR_8 ((uint32_t)0x00000100U)
  3241. #define GPIO_BRR_BR_9 ((uint32_t)0x00000200U)
  3242. #define GPIO_BRR_BR_10 ((uint32_t)0x00000400U)
  3243. #define GPIO_BRR_BR_11 ((uint32_t)0x00000800U)
  3244. #define GPIO_BRR_BR_12 ((uint32_t)0x00001000U)
  3245. #define GPIO_BRR_BR_13 ((uint32_t)0x00002000U)
  3246. #define GPIO_BRR_BR_14 ((uint32_t)0x00004000U)
  3247. #define GPIO_BRR_BR_15 ((uint32_t)0x00008000U)
  3248. /******************************************************************************/
  3249. /* */
  3250. /* Inter-integrated Circuit Interface (I2C) */
  3251. /* */
  3252. /******************************************************************************/
  3253. /******************* Bit definition for I2C_CR1 register *******************/
  3254. #define I2C_CR1_PE ((uint32_t)0x00000001U) /*!< Peripheral enable */
  3255. #define I2C_CR1_TXIE ((uint32_t)0x00000002U) /*!< TX interrupt enable */
  3256. #define I2C_CR1_RXIE ((uint32_t)0x00000004U) /*!< RX interrupt enable */
  3257. #define I2C_CR1_ADDRIE ((uint32_t)0x00000008U) /*!< Address match interrupt enable */
  3258. #define I2C_CR1_NACKIE ((uint32_t)0x00000010U) /*!< NACK received interrupt enable */
  3259. #define I2C_CR1_STOPIE ((uint32_t)0x00000020U) /*!< STOP detection interrupt enable */
  3260. #define I2C_CR1_TCIE ((uint32_t)0x00000040U) /*!< Transfer complete interrupt enable */
  3261. #define I2C_CR1_ERRIE ((uint32_t)0x00000080U) /*!< Errors interrupt enable */
  3262. #define I2C_CR1_DNF ((uint32_t)0x00000F00U) /*!< Digital noise filter */
  3263. #define I2C_CR1_ANFOFF ((uint32_t)0x00001000U) /*!< Analog noise filter OFF */
  3264. #define I2C_CR1_SWRST ((uint32_t)0x00002000U) /*!< Software reset */
  3265. #define I2C_CR1_TXDMAEN ((uint32_t)0x00004000U) /*!< DMA transmission requests enable */
  3266. #define I2C_CR1_RXDMAEN ((uint32_t)0x00008000U) /*!< DMA reception requests enable */
  3267. #define I2C_CR1_SBC ((uint32_t)0x00010000U) /*!< Slave byte control */
  3268. #define I2C_CR1_NOSTRETCH ((uint32_t)0x00020000U) /*!< Clock stretching disable */
  3269. #define I2C_CR1_WUPEN ((uint32_t)0x00040000U) /*!< Wakeup from STOP enable */
  3270. #define I2C_CR1_GCEN ((uint32_t)0x00080000U) /*!< General call enable */
  3271. #define I2C_CR1_SMBHEN ((uint32_t)0x00100000U) /*!< SMBus host address enable */
  3272. #define I2C_CR1_SMBDEN ((uint32_t)0x00200000U) /*!< SMBus device default address enable */
  3273. #define I2C_CR1_ALERTEN ((uint32_t)0x00400000U) /*!< SMBus alert enable */
  3274. #define I2C_CR1_PECEN ((uint32_t)0x00800000U) /*!< PEC enable */
  3275. /****************** Bit definition for I2C_CR2 register ********************/
  3276. #define I2C_CR2_SADD ((uint32_t)0x000003FFU) /*!< Slave address (master mode) */
  3277. #define I2C_CR2_RD_WRN ((uint32_t)0x00000400U) /*!< Transfer direction (master mode) */
  3278. #define I2C_CR2_ADD10 ((uint32_t)0x00000800U) /*!< 10-bit addressing mode (master mode) */
  3279. #define I2C_CR2_HEAD10R ((uint32_t)0x00001000U) /*!< 10-bit address header only read direction (master mode) */
  3280. #define I2C_CR2_START ((uint32_t)0x00002000U) /*!< START generation */
  3281. #define I2C_CR2_STOP ((uint32_t)0x00004000U) /*!< STOP generation (master mode) */
  3282. #define I2C_CR2_NACK ((uint32_t)0x00008000U) /*!< NACK generation (slave mode) */
  3283. #define I2C_CR2_NBYTES ((uint32_t)0x00FF0000U) /*!< Number of bytes */
  3284. #define I2C_CR2_RELOAD ((uint32_t)0x01000000U) /*!< NBYTES reload mode */
  3285. #define I2C_CR2_AUTOEND ((uint32_t)0x02000000U) /*!< Automatic end mode (master mode) */
  3286. #define I2C_CR2_PECBYTE ((uint32_t)0x04000000U) /*!< Packet error checking byte */
  3287. /******************* Bit definition for I2C_OAR1 register ******************/
  3288. #define I2C_OAR1_OA1 ((uint32_t)0x000003FFU) /*!< Interface own address 1 */
  3289. #define I2C_OAR1_OA1MODE ((uint32_t)0x00000400U) /*!< Own address 1 10-bit mode */
  3290. #define I2C_OAR1_OA1EN ((uint32_t)0x00008000U) /*!< Own address 1 enable */
  3291. /******************* Bit definition for I2C_OAR2 register ******************/
  3292. #define I2C_OAR2_OA2 ((uint32_t)0x000000FEU) /*!< Interface own address 2 */
  3293. #define I2C_OAR2_OA2MSK ((uint32_t)0x00000700U) /*!< Own address 2 masks */
  3294. #define I2C_OAR2_OA2NOMASK ((uint32_t)0x00000000U) /*!< No mask */
  3295. #define I2C_OAR2_OA2MASK01 ((uint32_t)0x00000100U) /*!< OA2[1] is masked, Only OA2[7:2] are compared */
  3296. #define I2C_OAR2_OA2MASK02 ((uint32_t)0x00000200U) /*!< OA2[2:1] is masked, Only OA2[7:3] are compared */
  3297. #define I2C_OAR2_OA2MASK03 ((uint32_t)0x00000300U) /*!< OA2[3:1] is masked, Only OA2[7:4] are compared */
  3298. #define I2C_OAR2_OA2MASK04 ((uint32_t)0x00000400U) /*!< OA2[4:1] is masked, Only OA2[7:5] are compared */
  3299. #define I2C_OAR2_OA2MASK05 ((uint32_t)0x00000500U) /*!< OA2[5:1] is masked, Only OA2[7:6] are compared */
  3300. #define I2C_OAR2_OA2MASK06 ((uint32_t)0x00000600U) /*!< OA2[6:1] is masked, Only OA2[7] are compared */
  3301. #define I2C_OAR2_OA2MASK07 ((uint32_t)0x00000700U) /*!< OA2[7:1] is masked, No comparison is done */
  3302. #define I2C_OAR2_OA2EN ((uint32_t)0x00008000U) /*!< Own address 2 enable */
  3303. /******************* Bit definition for I2C_TIMINGR register ****************/
  3304. #define I2C_TIMINGR_SCLL ((uint32_t)0x000000FFU) /*!< SCL low period (master mode) */
  3305. #define I2C_TIMINGR_SCLH ((uint32_t)0x0000FF00U) /*!< SCL high period (master mode) */
  3306. #define I2C_TIMINGR_SDADEL ((uint32_t)0x000F0000U) /*!< Data hold time */
  3307. #define I2C_TIMINGR_SCLDEL ((uint32_t)0x00F00000U) /*!< Data setup time */
  3308. #define I2C_TIMINGR_PRESC ((uint32_t)0xF0000000U) /*!< Timings prescaler */
  3309. /******************* Bit definition for I2C_TIMEOUTR register ****************/
  3310. #define I2C_TIMEOUTR_TIMEOUTA ((uint32_t)0x00000FFFU) /*!< Bus timeout A */
  3311. #define I2C_TIMEOUTR_TIDLE ((uint32_t)0x00001000U) /*!< Idle clock timeout detection */
  3312. #define I2C_TIMEOUTR_TIMOUTEN ((uint32_t)0x00008000U) /*!< Clock timeout enable */
  3313. #define I2C_TIMEOUTR_TIMEOUTB ((uint32_t)0x0FFF0000U) /*!< Bus timeout B*/
  3314. #define I2C_TIMEOUTR_TEXTEN ((uint32_t)0x80000000U) /*!< Extended clock timeout enable */
  3315. /****************** Bit definition for I2C_ISR register ********************/
  3316. #define I2C_ISR_TXE ((uint32_t)0x00000001U) /*!< Transmit data register empty */
  3317. #define I2C_ISR_TXIS ((uint32_t)0x00000002U) /*!< Transmit interrupt status */
  3318. #define I2C_ISR_RXNE ((uint32_t)0x00000004U) /*!< Receive data register not empty */
  3319. #define I2C_ISR_ADDR ((uint32_t)0x00000008U) /*!< Address matched (slave mode)*/
  3320. #define I2C_ISR_NACKF ((uint32_t)0x00000010U) /*!< NACK received flag */
  3321. #define I2C_ISR_STOPF ((uint32_t)0x00000020U) /*!< STOP detection flag */
  3322. #define I2C_ISR_TC ((uint32_t)0x00000040U) /*!< Transfer complete (master mode) */
  3323. #define I2C_ISR_TCR ((uint32_t)0x00000080U) /*!< Transfer complete reload */
  3324. #define I2C_ISR_BERR ((uint32_t)0x00000100U) /*!< Bus error */
  3325. #define I2C_ISR_ARLO ((uint32_t)0x00000200U) /*!< Arbitration lost */
  3326. #define I2C_ISR_OVR ((uint32_t)0x00000400U) /*!< Overrun/Underrun */
  3327. #define I2C_ISR_PECERR ((uint32_t)0x00000800U) /*!< PEC error in reception */
  3328. #define I2C_ISR_TIMEOUT ((uint32_t)0x00001000U) /*!< Timeout or Tlow detection flag */
  3329. #define I2C_ISR_ALERT ((uint32_t)0x00002000U) /*!< SMBus alert */
  3330. #define I2C_ISR_BUSY ((uint32_t)0x00008000U) /*!< Bus busy */
  3331. #define I2C_ISR_DIR ((uint32_t)0x00010000U) /*!< Transfer direction (slave mode) */
  3332. #define I2C_ISR_ADDCODE ((uint32_t)0x00FE0000U) /*!< Address match code (slave mode) */
  3333. /****************** Bit definition for I2C_ICR register ********************/
  3334. #define I2C_ICR_ADDRCF ((uint32_t)0x00000008U) /*!< Address matched clear flag */
  3335. #define I2C_ICR_NACKCF ((uint32_t)0x00000010U) /*!< NACK clear flag */
  3336. #define I2C_ICR_STOPCF ((uint32_t)0x00000020U) /*!< STOP detection clear flag */
  3337. #define I2C_ICR_BERRCF ((uint32_t)0x00000100U) /*!< Bus error clear flag */
  3338. #define I2C_ICR_ARLOCF ((uint32_t)0x00000200U) /*!< Arbitration lost clear flag */
  3339. #define I2C_ICR_OVRCF ((uint32_t)0x00000400U) /*!< Overrun/Underrun clear flag */
  3340. #define I2C_ICR_PECCF ((uint32_t)0x00000800U) /*!< PAC error clear flag */
  3341. #define I2C_ICR_TIMOUTCF ((uint32_t)0x00001000U) /*!< Timeout clear flag */
  3342. #define I2C_ICR_ALERTCF ((uint32_t)0x00002000U) /*!< Alert clear flag */
  3343. /****************** Bit definition for I2C_PECR register *******************/
  3344. #define I2C_PECR_PEC ((uint32_t)0x000000FFU) /*!< PEC register */
  3345. /****************** Bit definition for I2C_RXDR register *********************/
  3346. #define I2C_RXDR_RXDATA ((uint32_t)0x000000FFU) /*!< 8-bit receive data */
  3347. /****************** Bit definition for I2C_TXDR register *******************/
  3348. #define I2C_TXDR_TXDATA ((uint32_t)0x000000FFU) /*!< 8-bit transmit data */
  3349. /*****************************************************************************/
  3350. /* */
  3351. /* Independent WATCHDOG (IWDG) */
  3352. /* */
  3353. /*****************************************************************************/
  3354. /******************* Bit definition for IWDG_KR register *******************/
  3355. #define IWDG_KR_KEY ((uint32_t)0xFFFF) /*!< Key value (write only, read 0000h) */
  3356. /******************* Bit definition for IWDG_PR register *******************/
  3357. #define IWDG_PR_PR ((uint32_t)0x07) /*!< PR[2:0] (Prescaler divider) */
  3358. #define IWDG_PR_PR_0 ((uint32_t)0x01) /*!< Bit 0 */
  3359. #define IWDG_PR_PR_1 ((uint32_t)0x02) /*!< Bit 1 */
  3360. #define IWDG_PR_PR_2 ((uint32_t)0x04) /*!< Bit 2 */
  3361. /******************* Bit definition for IWDG_RLR register ******************/
  3362. #define IWDG_RLR_RL ((uint32_t)0x0FFF) /*!< Watchdog counter reload value */
  3363. /******************* Bit definition for IWDG_SR register *******************/
  3364. #define IWDG_SR_PVU ((uint32_t)0x01) /*!< Watchdog prescaler value update */
  3365. #define IWDG_SR_RVU ((uint32_t)0x02) /*!< Watchdog counter reload value update */
  3366. #define IWDG_SR_WVU ((uint32_t)0x04) /*!< Watchdog counter window value update */
  3367. /******************* Bit definition for IWDG_KR register *******************/
  3368. #define IWDG_WINR_WIN ((uint32_t)0x0FFF) /*!< Watchdog counter window value */
  3369. /*****************************************************************************/
  3370. /* */
  3371. /* Power Control (PWR) */
  3372. /* */
  3373. /*****************************************************************************/
  3374. #define PWR_PVD_SUPPORT /*!< PWR feature available only on specific devices: Power Voltage Detection feature */
  3375. /******************** Bit definition for PWR_CR register *******************/
  3376. #define PWR_CR_LPDS ((uint32_t)0x00000001U) /*!< Low-power Deepsleep */
  3377. #define PWR_CR_PDDS ((uint32_t)0x00000002U) /*!< Power Down Deepsleep */
  3378. #define PWR_CR_CWUF ((uint32_t)0x00000004U) /*!< Clear Wakeup Flag */
  3379. #define PWR_CR_CSBF ((uint32_t)0x00000008U) /*!< Clear Standby Flag */
  3380. #define PWR_CR_PVDE ((uint32_t)0x00000010U) /*!< Power Voltage Detector Enable */
  3381. #define PWR_CR_PLS ((uint32_t)0x000000E0U) /*!< PLS[2:0] bits (PVD Level Selection) */
  3382. #define PWR_CR_PLS_0 ((uint32_t)0x00000020U) /*!< Bit 0 */
  3383. #define PWR_CR_PLS_1 ((uint32_t)0x00000040U) /*!< Bit 1 */
  3384. #define PWR_CR_PLS_2 ((uint32_t)0x00000080U) /*!< Bit 2 */
  3385. /*!< PVD level configuration */
  3386. #define PWR_CR_PLS_LEV0 ((uint32_t)0x00000000U) /*!< PVD level 0 */
  3387. #define PWR_CR_PLS_LEV1 ((uint32_t)0x00000020U) /*!< PVD level 1 */
  3388. #define PWR_CR_PLS_LEV2 ((uint32_t)0x00000040U) /*!< PVD level 2 */
  3389. #define PWR_CR_PLS_LEV3 ((uint32_t)0x00000060U) /*!< PVD level 3 */
  3390. #define PWR_CR_PLS_LEV4 ((uint32_t)0x00000080U) /*!< PVD level 4 */
  3391. #define PWR_CR_PLS_LEV5 ((uint32_t)0x000000A0U) /*!< PVD level 5 */
  3392. #define PWR_CR_PLS_LEV6 ((uint32_t)0x000000C0U) /*!< PVD level 6 */
  3393. #define PWR_CR_PLS_LEV7 ((uint32_t)0x000000E0U) /*!< PVD level 7 */
  3394. #define PWR_CR_DBP ((uint32_t)0x00000100U) /*!< Disable Backup Domain write protection */
  3395. /******************* Bit definition for PWR_CSR register *******************/
  3396. #define PWR_CSR_WUF ((uint32_t)0x00000001U) /*!< Wakeup Flag */
  3397. #define PWR_CSR_SBF ((uint32_t)0x00000002U) /*!< Standby Flag */
  3398. #define PWR_CSR_PVDO ((uint32_t)0x00000004U) /*!< PVD Output */
  3399. #define PWR_CSR_VREFINTRDYF ((uint32_t)0x00000008U) /*!< Internal voltage reference (VREFINT) ready flag */
  3400. #define PWR_CSR_EWUP1 ((uint32_t)0x00000100U) /*!< Enable WKUP pin 1 */
  3401. #define PWR_CSR_EWUP2 ((uint32_t)0x00000200U) /*!< Enable WKUP pin 2 */
  3402. #define PWR_CSR_EWUP3 ((uint32_t)0x00000400U) /*!< Enable WKUP pin 3 */
  3403. #define PWR_CSR_EWUP4 ((uint32_t)0x00000800U) /*!< Enable WKUP pin 4 */
  3404. #define PWR_CSR_EWUP5 ((uint32_t)0x00001000U) /*!< Enable WKUP pin 5 */
  3405. #define PWR_CSR_EWUP6 ((uint32_t)0x00002000U) /*!< Enable WKUP pin 6 */
  3406. #define PWR_CSR_EWUP7 ((uint32_t)0x00004000U) /*!< Enable WKUP pin 7 */
  3407. #define PWR_CSR_EWUP8 ((uint32_t)0x00008000U) /*!< Enable WKUP pin 8 */
  3408. /*****************************************************************************/
  3409. /* */
  3410. /* Reset and Clock Control */
  3411. /* */
  3412. /*****************************************************************************/
  3413. /*
  3414. * @brief Specific device feature definitions (not present on all devices in the STM32F0 family)
  3415. */
  3416. #define RCC_HSI48_SUPPORT /*!< HSI48 feature support */
  3417. #define RCC_PLLSRC_PREDIV1_SUPPORT /*!< PREDIV support used as PLL source input */
  3418. /******************** Bit definition for RCC_CR register *******************/
  3419. #define RCC_CR_HSION ((uint32_t)0x00000001U) /*!< Internal High Speed clock enable */
  3420. #define RCC_CR_HSIRDY ((uint32_t)0x00000002U) /*!< Internal High Speed clock ready flag */
  3421. #define RCC_CR_HSITRIM ((uint32_t)0x000000F8U) /*!< Internal High Speed clock trimming */
  3422. #define RCC_CR_HSITRIM_0 ((uint32_t)0x00000008U) /*!<Bit 0 */
  3423. #define RCC_CR_HSITRIM_1 ((uint32_t)0x00000010U) /*!<Bit 1 */
  3424. #define RCC_CR_HSITRIM_2 ((uint32_t)0x00000020U) /*!<Bit 2 */
  3425. #define RCC_CR_HSITRIM_3 ((uint32_t)0x00000040U) /*!<Bit 3 */
  3426. #define RCC_CR_HSITRIM_4 ((uint32_t)0x00000080U) /*!<Bit 4 */
  3427. #define RCC_CR_HSICAL ((uint32_t)0x0000FF00U) /*!< Internal High Speed clock Calibration */
  3428. #define RCC_CR_HSICAL_0 ((uint32_t)0x00000100U) /*!<Bit 0 */
  3429. #define RCC_CR_HSICAL_1 ((uint32_t)0x00000200U) /*!<Bit 1 */
  3430. #define RCC_CR_HSICAL_2 ((uint32_t)0x00000400U) /*!<Bit 2 */
  3431. #define RCC_CR_HSICAL_3 ((uint32_t)0x00000800U) /*!<Bit 3 */
  3432. #define RCC_CR_HSICAL_4 ((uint32_t)0x00001000U) /*!<Bit 4 */
  3433. #define RCC_CR_HSICAL_5 ((uint32_t)0x00002000U) /*!<Bit 5 */
  3434. #define RCC_CR_HSICAL_6 ((uint32_t)0x00004000U) /*!<Bit 6 */
  3435. #define RCC_CR_HSICAL_7 ((uint32_t)0x00008000U) /*!<Bit 7 */
  3436. #define RCC_CR_HSEON ((uint32_t)0x00010000U) /*!< External High Speed clock enable */
  3437. #define RCC_CR_HSERDY ((uint32_t)0x00020000U) /*!< External High Speed clock ready flag */
  3438. #define RCC_CR_HSEBYP ((uint32_t)0x00040000U) /*!< External High Speed clock Bypass */
  3439. #define RCC_CR_CSSON ((uint32_t)0x00080000U) /*!< Clock Security System enable */
  3440. #define RCC_CR_PLLON ((uint32_t)0x01000000U) /*!< PLL enable */
  3441. #define RCC_CR_PLLRDY ((uint32_t)0x02000000U) /*!< PLL clock ready flag */
  3442. /******************** Bit definition for RCC_CFGR register *****************/
  3443. /*!< SW configuration */
  3444. #define RCC_CFGR_SW ((uint32_t)0x00000003U) /*!< SW[1:0] bits (System clock Switch) */
  3445. #define RCC_CFGR_SW_0 ((uint32_t)0x00000001U) /*!< Bit 0 */
  3446. #define RCC_CFGR_SW_1 ((uint32_t)0x00000002U) /*!< Bit 1 */
  3447. #define RCC_CFGR_SW_HSI ((uint32_t)0x00000000U) /*!< HSI selected as system clock */
  3448. #define RCC_CFGR_SW_HSE ((uint32_t)0x00000001U) /*!< HSE selected as system clock */
  3449. #define RCC_CFGR_SW_PLL ((uint32_t)0x00000002U) /*!< PLL selected as system clock */
  3450. #define RCC_CFGR_SW_HSI48 ((uint32_t)0x00000003U) /*!< HSI48 selected as system clock */
  3451. /*!< SWS configuration */
  3452. #define RCC_CFGR_SWS ((uint32_t)0x0000000CU) /*!< SWS[1:0] bits (System Clock Switch Status) */
  3453. #define RCC_CFGR_SWS_0 ((uint32_t)0x00000004U) /*!< Bit 0 */
  3454. #define RCC_CFGR_SWS_1 ((uint32_t)0x00000008U) /*!< Bit 1 */
  3455. #define RCC_CFGR_SWS_HSI ((uint32_t)0x00000000U) /*!< HSI oscillator used as system clock */
  3456. #define RCC_CFGR_SWS_HSE ((uint32_t)0x00000004U) /*!< HSE oscillator used as system clock */
  3457. #define RCC_CFGR_SWS_PLL ((uint32_t)0x00000008U) /*!< PLL used as system clock */
  3458. #define RCC_CFGR_SWS_HSI48 ((uint32_t)0x0000000CU) /*!< HSI48 oscillator used as system clock */
  3459. /*!< HPRE configuration */
  3460. #define RCC_CFGR_HPRE ((uint32_t)0x000000F0U) /*!< HPRE[3:0] bits (AHB prescaler) */
  3461. #define RCC_CFGR_HPRE_0 ((uint32_t)0x00000010U) /*!< Bit 0 */
  3462. #define RCC_CFGR_HPRE_1 ((uint32_t)0x00000020U) /*!< Bit 1 */
  3463. #define RCC_CFGR_HPRE_2 ((uint32_t)0x00000040U) /*!< Bit 2 */
  3464. #define RCC_CFGR_HPRE_3 ((uint32_t)0x00000080U) /*!< Bit 3 */
  3465. #define RCC_CFGR_HPRE_DIV1 ((uint32_t)0x00000000U) /*!< SYSCLK not divided */
  3466. #define RCC_CFGR_HPRE_DIV2 ((uint32_t)0x00000080U) /*!< SYSCLK divided by 2 */
  3467. #define RCC_CFGR_HPRE_DIV4 ((uint32_t)0x00000090U) /*!< SYSCLK divided by 4 */
  3468. #define RCC_CFGR_HPRE_DIV8 ((uint32_t)0x000000A0U) /*!< SYSCLK divided by 8 */
  3469. #define RCC_CFGR_HPRE_DIV16 ((uint32_t)0x000000B0U) /*!< SYSCLK divided by 16 */
  3470. #define RCC_CFGR_HPRE_DIV64 ((uint32_t)0x000000C0U) /*!< SYSCLK divided by 64 */
  3471. #define RCC_CFGR_HPRE_DIV128 ((uint32_t)0x000000D0U) /*!< SYSCLK divided by 128 */
  3472. #define RCC_CFGR_HPRE_DIV256 ((uint32_t)0x000000E0U) /*!< SYSCLK divided by 256 */
  3473. #define RCC_CFGR_HPRE_DIV512 ((uint32_t)0x000000F0U) /*!< SYSCLK divided by 512 */
  3474. /*!< PPRE configuration */
  3475. #define RCC_CFGR_PPRE ((uint32_t)0x00000700U) /*!< PRE[2:0] bits (APB prescaler) */
  3476. #define RCC_CFGR_PPRE_0 ((uint32_t)0x00000100U) /*!< Bit 0 */
  3477. #define RCC_CFGR_PPRE_1 ((uint32_t)0x00000200U) /*!< Bit 1 */
  3478. #define RCC_CFGR_PPRE_2 ((uint32_t)0x00000400U) /*!< Bit 2 */
  3479. #define RCC_CFGR_PPRE_DIV1 ((uint32_t)0x00000000U) /*!< HCLK not divided */
  3480. #define RCC_CFGR_PPRE_DIV2 ((uint32_t)0x00000400U) /*!< HCLK divided by 2 */
  3481. #define RCC_CFGR_PPRE_DIV4 ((uint32_t)0x00000500U) /*!< HCLK divided by 4 */
  3482. #define RCC_CFGR_PPRE_DIV8 ((uint32_t)0x00000600U) /*!< HCLK divided by 8 */
  3483. #define RCC_CFGR_PPRE_DIV16 ((uint32_t)0x00000700U) /*!< HCLK divided by 16 */
  3484. /*!< ADCPPRE configuration */
  3485. #define RCC_CFGR_ADCPRE ((uint32_t)0x00004000U) /*!< ADCPRE bit (ADC prescaler) */
  3486. #define RCC_CFGR_ADCPRE_DIV2 ((uint32_t)0x00000000U) /*!< PCLK divided by 2 */
  3487. #define RCC_CFGR_ADCPRE_DIV4 ((uint32_t)0x00004000U) /*!< PCLK divided by 4 */
  3488. #define RCC_CFGR_PLLSRC ((uint32_t)0x00018000U) /*!< PLL entry clock source */
  3489. #define RCC_CFGR_PLLSRC_HSI_DIV2 ((uint32_t)0x00000000U) /*!< HSI clock divided by 2 selected as PLL entry clock source */
  3490. #define RCC_CFGR_PLLSRC_HSI_PREDIV ((uint32_t)0x00008000U) /*!< HSI/PREDIV clock selected as PLL entry clock source */
  3491. #define RCC_CFGR_PLLSRC_HSE_PREDIV ((uint32_t)0x00010000U) /*!< HSE/PREDIV clock selected as PLL entry clock source */
  3492. #define RCC_CFGR_PLLSRC_HSI48_PREDIV ((uint32_t)0x00018000U) /*!< HSI48/PREDIV clock selected as PLL entry clock source */
  3493. #define RCC_CFGR_PLLXTPRE ((uint32_t)0x00020000U) /*!< HSE divider for PLL entry */
  3494. #define RCC_CFGR_PLLXTPRE_HSE_PREDIV_DIV1 ((uint32_t)0x00000000U) /*!< HSE/PREDIV clock not divided for PLL entry */
  3495. #define RCC_CFGR_PLLXTPRE_HSE_PREDIV_DIV2 ((uint32_t)0x00020000U) /*!< HSE/PREDIV clock divided by 2 for PLL entry */
  3496. /*!< PLLMUL configuration */
  3497. #define RCC_CFGR_PLLMUL ((uint32_t)0x003C0000U) /*!< PLLMUL[3:0] bits (PLL multiplication factor) */
  3498. #define RCC_CFGR_PLLMUL_0 ((uint32_t)0x00040000U) /*!< Bit 0 */
  3499. #define RCC_CFGR_PLLMUL_1 ((uint32_t)0x00080000U) /*!< Bit 1 */
  3500. #define RCC_CFGR_PLLMUL_2 ((uint32_t)0x00100000U) /*!< Bit 2 */
  3501. #define RCC_CFGR_PLLMUL_3 ((uint32_t)0x00200000U) /*!< Bit 3 */
  3502. #define RCC_CFGR_PLLMUL2 ((uint32_t)0x00000000U) /*!< PLL input clock*2 */
  3503. #define RCC_CFGR_PLLMUL3 ((uint32_t)0x00040000U) /*!< PLL input clock*3 */
  3504. #define RCC_CFGR_PLLMUL4 ((uint32_t)0x00080000U) /*!< PLL input clock*4 */
  3505. #define RCC_CFGR_PLLMUL5 ((uint32_t)0x000C0000U) /*!< PLL input clock*5 */
  3506. #define RCC_CFGR_PLLMUL6 ((uint32_t)0x00100000U) /*!< PLL input clock*6 */
  3507. #define RCC_CFGR_PLLMUL7 ((uint32_t)0x00140000U) /*!< PLL input clock*7 */
  3508. #define RCC_CFGR_PLLMUL8 ((uint32_t)0x00180000U) /*!< PLL input clock*8 */
  3509. #define RCC_CFGR_PLLMUL9 ((uint32_t)0x001C0000U) /*!< PLL input clock*9 */
  3510. #define RCC_CFGR_PLLMUL10 ((uint32_t)0x00200000U) /*!< PLL input clock10 */
  3511. #define RCC_CFGR_PLLMUL11 ((uint32_t)0x00240000U) /*!< PLL input clock*11 */
  3512. #define RCC_CFGR_PLLMUL12 ((uint32_t)0x00280000U) /*!< PLL input clock*12 */
  3513. #define RCC_CFGR_PLLMUL13 ((uint32_t)0x002C0000U) /*!< PLL input clock*13 */
  3514. #define RCC_CFGR_PLLMUL14 ((uint32_t)0x00300000U) /*!< PLL input clock*14 */
  3515. #define RCC_CFGR_PLLMUL15 ((uint32_t)0x00340000U) /*!< PLL input clock*15 */
  3516. #define RCC_CFGR_PLLMUL16 ((uint32_t)0x00380000U) /*!< PLL input clock*16 */
  3517. /*!< USB configuration */
  3518. #define RCC_CFGR_USBPRE ((uint32_t)0x00400000U) /*!< USB prescaler */
  3519. /*!< MCO configuration */
  3520. #define RCC_CFGR_MCO ((uint32_t)0x0F000000U) /*!< MCO[3:0] bits (Microcontroller Clock Output) */
  3521. #define RCC_CFGR_MCO_0 ((uint32_t)0x01000000U) /*!< Bit 0 */
  3522. #define RCC_CFGR_MCO_1 ((uint32_t)0x02000000U) /*!< Bit 1 */
  3523. #define RCC_CFGR_MCO_2 ((uint32_t)0x04000000U) /*!< Bit 2 */
  3524. #define RCC_CFGR_MCO_3 ((uint32_t)0x08000000U) /*!< Bit 3 */
  3525. #define RCC_CFGR_MCO_NOCLOCK ((uint32_t)0x00000000U) /*!< No clock */
  3526. #define RCC_CFGR_MCO_HSI14 ((uint32_t)0x01000000U) /*!< HSI14 clock selected as MCO source */
  3527. #define RCC_CFGR_MCO_LSI ((uint32_t)0x02000000U) /*!< LSI clock selected as MCO source */
  3528. #define RCC_CFGR_MCO_LSE ((uint32_t)0x03000000U) /*!< LSE clock selected as MCO source */
  3529. #define RCC_CFGR_MCO_SYSCLK ((uint32_t)0x04000000U) /*!< System clock selected as MCO source */
  3530. #define RCC_CFGR_MCO_HSI ((uint32_t)0x05000000U) /*!< HSI clock selected as MCO source */
  3531. #define RCC_CFGR_MCO_HSE ((uint32_t)0x06000000U) /*!< HSE clock selected as MCO source */
  3532. #define RCC_CFGR_MCO_PLL ((uint32_t)0x07000000U) /*!< PLL clock divided by 2 selected as MCO source */
  3533. #define RCC_CFGR_MCO_HSI48 ((uint32_t)0x08000000U) /*!< HSI48 clock selected as MCO source */
  3534. #define RCC_CFGR_MCOPRE ((uint32_t)0x70000000U) /*!< MCO prescaler */
  3535. #define RCC_CFGR_MCOPRE_DIV1 ((uint32_t)0x00000000U) /*!< MCO is divided by 1 */
  3536. #define RCC_CFGR_MCOPRE_DIV2 ((uint32_t)0x10000000U) /*!< MCO is divided by 2 */
  3537. #define RCC_CFGR_MCOPRE_DIV4 ((uint32_t)0x20000000U) /*!< MCO is divided by 4 */
  3538. #define RCC_CFGR_MCOPRE_DIV8 ((uint32_t)0x30000000U) /*!< MCO is divided by 8 */
  3539. #define RCC_CFGR_MCOPRE_DIV16 ((uint32_t)0x40000000U) /*!< MCO is divided by 16 */
  3540. #define RCC_CFGR_MCOPRE_DIV32 ((uint32_t)0x50000000U) /*!< MCO is divided by 32 */
  3541. #define RCC_CFGR_MCOPRE_DIV64 ((uint32_t)0x60000000U) /*!< MCO is divided by 64 */
  3542. #define RCC_CFGR_MCOPRE_DIV128 ((uint32_t)0x70000000U) /*!< MCO is divided by 128 */
  3543. #define RCC_CFGR_PLLNODIV ((uint32_t)0x80000000U) /*!< PLL is not divided to MCO */
  3544. /* Reference defines */
  3545. #define RCC_CFGR_MCOSEL RCC_CFGR_MCO
  3546. #define RCC_CFGR_MCOSEL_0 RCC_CFGR_MCO_0
  3547. #define RCC_CFGR_MCOSEL_1 RCC_CFGR_MCO_1
  3548. #define RCC_CFGR_MCOSEL_2 RCC_CFGR_MCO_2
  3549. #define RCC_CFGR_MCOSEL_3 RCC_CFGR_MCO_3
  3550. #define RCC_CFGR_MCOSEL_NOCLOCK RCC_CFGR_MCO_NOCLOCK
  3551. #define RCC_CFGR_MCOSEL_HSI14 RCC_CFGR_MCO_HSI14
  3552. #define RCC_CFGR_MCOSEL_LSI RCC_CFGR_MCO_LSI
  3553. #define RCC_CFGR_MCOSEL_LSE RCC_CFGR_MCO_LSE
  3554. #define RCC_CFGR_MCOSEL_SYSCLK RCC_CFGR_MCO_SYSCLK
  3555. #define RCC_CFGR_MCOSEL_HSI RCC_CFGR_MCO_HSI
  3556. #define RCC_CFGR_MCOSEL_HSE RCC_CFGR_MCO_HSE
  3557. #define RCC_CFGR_MCOSEL_PLL_DIV2 RCC_CFGR_MCO_PLL
  3558. #define RCC_CFGR_MCOSEL_HSI48 RCC_CFGR_MCO_HSI48
  3559. /*!<****************** Bit definition for RCC_CIR register *****************/
  3560. #define RCC_CIR_LSIRDYF ((uint32_t)0x00000001U) /*!< LSI Ready Interrupt flag */
  3561. #define RCC_CIR_LSERDYF ((uint32_t)0x00000002U) /*!< LSE Ready Interrupt flag */
  3562. #define RCC_CIR_HSIRDYF ((uint32_t)0x00000004U) /*!< HSI Ready Interrupt flag */
  3563. #define RCC_CIR_HSERDYF ((uint32_t)0x00000008U) /*!< HSE Ready Interrupt flag */
  3564. #define RCC_CIR_PLLRDYF ((uint32_t)0x00000010U) /*!< PLL Ready Interrupt flag */
  3565. #define RCC_CIR_HSI14RDYF ((uint32_t)0x00000020U) /*!< HSI14 Ready Interrupt flag */
  3566. #define RCC_CIR_HSI48RDYF ((uint32_t)0x00000040U) /*!< HSI48 Ready Interrupt flag */
  3567. #define RCC_CIR_CSSF ((uint32_t)0x00000080U) /*!< Clock Security System Interrupt flag */
  3568. #define RCC_CIR_LSIRDYIE ((uint32_t)0x00000100U) /*!< LSI Ready Interrupt Enable */
  3569. #define RCC_CIR_LSERDYIE ((uint32_t)0x00000200U) /*!< LSE Ready Interrupt Enable */
  3570. #define RCC_CIR_HSIRDYIE ((uint32_t)0x00000400U) /*!< HSI Ready Interrupt Enable */
  3571. #define RCC_CIR_HSERDYIE ((uint32_t)0x00000800U) /*!< HSE Ready Interrupt Enable */
  3572. #define RCC_CIR_PLLRDYIE ((uint32_t)0x00001000U) /*!< PLL Ready Interrupt Enable */
  3573. #define RCC_CIR_HSI14RDYIE ((uint32_t)0x00002000U) /*!< HSI14 Ready Interrupt Enable */
  3574. #define RCC_CIR_HSI48RDYIE ((uint32_t)0x00004000U) /*!< HSI48 Ready Interrupt Enable */
  3575. #define RCC_CIR_LSIRDYC ((uint32_t)0x00010000U) /*!< LSI Ready Interrupt Clear */
  3576. #define RCC_CIR_LSERDYC ((uint32_t)0x00020000U) /*!< LSE Ready Interrupt Clear */
  3577. #define RCC_CIR_HSIRDYC ((uint32_t)0x00040000U) /*!< HSI Ready Interrupt Clear */
  3578. #define RCC_CIR_HSERDYC ((uint32_t)0x00080000U) /*!< HSE Ready Interrupt Clear */
  3579. #define RCC_CIR_PLLRDYC ((uint32_t)0x00100000U) /*!< PLL Ready Interrupt Clear */
  3580. #define RCC_CIR_HSI14RDYC ((uint32_t)0x00200000U) /*!< HSI14 Ready Interrupt Clear */
  3581. #define RCC_CIR_HSI48RDYC ((uint32_t)0x00400000U) /*!< HSI48 Ready Interrupt Clear */
  3582. #define RCC_CIR_CSSC ((uint32_t)0x00800000U) /*!< Clock Security System Interrupt Clear */
  3583. /***************** Bit definition for RCC_APB2RSTR register ****************/
  3584. #define RCC_APB2RSTR_SYSCFGRST ((uint32_t)0x00000001U) /*!< SYSCFG clock reset */
  3585. #define RCC_APB2RSTR_ADCRST ((uint32_t)0x00000200U) /*!< ADC clock reset */
  3586. #define RCC_APB2RSTR_TIM1RST ((uint32_t)0x00000800U) /*!< TIM1 clock reset */
  3587. #define RCC_APB2RSTR_SPI1RST ((uint32_t)0x00001000U) /*!< SPI1 clock reset */
  3588. #define RCC_APB2RSTR_USART1RST ((uint32_t)0x00004000U) /*!< USART1 clock reset */
  3589. #define RCC_APB2RSTR_TIM15RST ((uint32_t)0x00010000U) /*!< TIM15 clock reset */
  3590. #define RCC_APB2RSTR_TIM16RST ((uint32_t)0x00020000U) /*!< TIM16 clock reset */
  3591. #define RCC_APB2RSTR_TIM17RST ((uint32_t)0x00040000U) /*!< TIM17 clock reset */
  3592. #define RCC_APB2RSTR_DBGMCURST ((uint32_t)0x00400000U) /*!< DBGMCU clock reset */
  3593. /*!< Old ADC1 clock reset bit definition maintained for legacy purpose */
  3594. #define RCC_APB2RSTR_ADC1RST RCC_APB2RSTR_ADCRST
  3595. /***************** Bit definition for RCC_APB1RSTR register ****************/
  3596. #define RCC_APB1RSTR_TIM2RST ((uint32_t)0x00000001U) /*!< Timer 2 clock reset */
  3597. #define RCC_APB1RSTR_TIM3RST ((uint32_t)0x00000002U) /*!< Timer 3 clock reset */
  3598. #define RCC_APB1RSTR_TIM6RST ((uint32_t)0x00000010U) /*!< Timer 6 clock reset */
  3599. #define RCC_APB1RSTR_TIM7RST ((uint32_t)0x00000020U) /*!< Timer 7 clock reset */
  3600. #define RCC_APB1RSTR_TIM14RST ((uint32_t)0x00000100U) /*!< Timer 14 clock reset */
  3601. #define RCC_APB1RSTR_WWDGRST ((uint32_t)0x00000800U) /*!< Window Watchdog clock reset */
  3602. #define RCC_APB1RSTR_SPI2RST ((uint32_t)0x00004000U) /*!< SPI2 clock reset */
  3603. #define RCC_APB1RSTR_USART2RST ((uint32_t)0x00020000U) /*!< USART 2 clock reset */
  3604. #define RCC_APB1RSTR_USART3RST ((uint32_t)0x00040000U) /*!< USART 3 clock reset */
  3605. #define RCC_APB1RSTR_USART4RST ((uint32_t)0x00080000U) /*!< USART 4 clock reset */
  3606. #define RCC_APB1RSTR_I2C1RST ((uint32_t)0x00200000U) /*!< I2C 1 clock reset */
  3607. #define RCC_APB1RSTR_I2C2RST ((uint32_t)0x00400000U) /*!< I2C 2 clock reset */
  3608. #define RCC_APB1RSTR_USBRST ((uint32_t)0x00800000U) /*!< USB clock reset */
  3609. #define RCC_APB1RSTR_CANRST ((uint32_t)0x02000000U) /*!< CAN clock reset */
  3610. #define RCC_APB1RSTR_CRSRST ((uint32_t)0x08000000U) /*!< CRS clock reset */
  3611. #define RCC_APB1RSTR_PWRRST ((uint32_t)0x10000000U) /*!< PWR clock reset */
  3612. #define RCC_APB1RSTR_DACRST ((uint32_t)0x20000000U) /*!< DAC clock reset */
  3613. #define RCC_APB1RSTR_CECRST ((uint32_t)0x40000000U) /*!< CEC clock reset */
  3614. /****************** Bit definition for RCC_AHBENR register *****************/
  3615. #define RCC_AHBENR_DMAEN ((uint32_t)0x00000001U) /*!< DMA1 clock enable */
  3616. #define RCC_AHBENR_SRAMEN ((uint32_t)0x00000004U) /*!< SRAM interface clock enable */
  3617. #define RCC_AHBENR_FLITFEN ((uint32_t)0x00000010U) /*!< FLITF clock enable */
  3618. #define RCC_AHBENR_CRCEN ((uint32_t)0x00000040U) /*!< CRC clock enable */
  3619. #define RCC_AHBENR_GPIOAEN ((uint32_t)0x00020000U) /*!< GPIOA clock enable */
  3620. #define RCC_AHBENR_GPIOBEN ((uint32_t)0x00040000U) /*!< GPIOB clock enable */
  3621. #define RCC_AHBENR_GPIOCEN ((uint32_t)0x00080000U) /*!< GPIOC clock enable */
  3622. #define RCC_AHBENR_GPIODEN ((uint32_t)0x00100000U) /*!< GPIOD clock enable */
  3623. #define RCC_AHBENR_GPIOEEN ((uint32_t)0x00200000U) /*!< GPIOE clock enable */
  3624. #define RCC_AHBENR_GPIOFEN ((uint32_t)0x00400000U) /*!< GPIOF clock enable */
  3625. #define RCC_AHBENR_TSCEN ((uint32_t)0x01000000U) /*!< TS controller clock enable */
  3626. /* Old Bit definition maintained for legacy purpose */
  3627. #define RCC_AHBENR_DMA1EN RCC_AHBENR_DMAEN /*!< DMA1 clock enable */
  3628. #define RCC_AHBENR_TSEN RCC_AHBENR_TSCEN /*!< TS clock enable */
  3629. /***************** Bit definition for RCC_APB2ENR register *****************/
  3630. #define RCC_APB2ENR_SYSCFGCOMPEN ((uint32_t)0x00000001U) /*!< SYSCFG and comparator clock enable */
  3631. #define RCC_APB2ENR_ADCEN ((uint32_t)0x00000200U) /*!< ADC1 clock enable */
  3632. #define RCC_APB2ENR_TIM1EN ((uint32_t)0x00000800U) /*!< TIM1 clock enable */
  3633. #define RCC_APB2ENR_SPI1EN ((uint32_t)0x00001000U) /*!< SPI1 clock enable */
  3634. #define RCC_APB2ENR_USART1EN ((uint32_t)0x00004000U) /*!< USART1 clock enable */
  3635. #define RCC_APB2ENR_TIM15EN ((uint32_t)0x00010000U) /*!< TIM15 clock enable */
  3636. #define RCC_APB2ENR_TIM16EN ((uint32_t)0x00020000U) /*!< TIM16 clock enable */
  3637. #define RCC_APB2ENR_TIM17EN ((uint32_t)0x00040000U) /*!< TIM17 clock enable */
  3638. #define RCC_APB2ENR_DBGMCUEN ((uint32_t)0x00400000U) /*!< DBGMCU clock enable */
  3639. /* Old Bit definition maintained for legacy purpose */
  3640. #define RCC_APB2ENR_SYSCFGEN RCC_APB2ENR_SYSCFGCOMPEN /*!< SYSCFG clock enable */
  3641. #define RCC_APB2ENR_ADC1EN RCC_APB2ENR_ADCEN /*!< ADC1 clock enable */
  3642. /***************** Bit definition for RCC_APB1ENR register *****************/
  3643. #define RCC_APB1ENR_TIM2EN ((uint32_t)0x00000001U) /*!< Timer 2 clock enable */
  3644. #define RCC_APB1ENR_TIM3EN ((uint32_t)0x00000002U) /*!< Timer 3 clock enable */
  3645. #define RCC_APB1ENR_TIM6EN ((uint32_t)0x00000010U) /*!< Timer 6 clock enable */
  3646. #define RCC_APB1ENR_TIM7EN ((uint32_t)0x00000020U) /*!< Timer 7 clock enable */
  3647. #define RCC_APB1ENR_TIM14EN ((uint32_t)0x00000100U) /*!< Timer 14 clock enable */
  3648. #define RCC_APB1ENR_WWDGEN ((uint32_t)0x00000800U) /*!< Window Watchdog clock enable */
  3649. #define RCC_APB1ENR_SPI2EN ((uint32_t)0x00004000U) /*!< SPI2 clock enable */
  3650. #define RCC_APB1ENR_USART2EN ((uint32_t)0x00020000U) /*!< USART2 clock enable */
  3651. #define RCC_APB1ENR_USART3EN ((uint32_t)0x00040000U) /*!< USART3 clock enable */
  3652. #define RCC_APB1ENR_USART4EN ((uint32_t)0x00080000U) /*!< USART4 clock enable */
  3653. #define RCC_APB1ENR_I2C1EN ((uint32_t)0x00200000U) /*!< I2C1 clock enable */
  3654. #define RCC_APB1ENR_I2C2EN ((uint32_t)0x00400000U) /*!< I2C2 clock enable */
  3655. #define RCC_APB1ENR_USBEN ((uint32_t)0x00800000U) /*!< USB clock enable */
  3656. #define RCC_APB1ENR_CANEN ((uint32_t)0x02000000U) /*!< CAN clock enable */
  3657. #define RCC_APB1ENR_CRSEN ((uint32_t)0x08000000U) /*!< CRS clock enable */
  3658. #define RCC_APB1ENR_PWREN ((uint32_t)0x10000000U) /*!< PWR clock enable */
  3659. #define RCC_APB1ENR_DACEN ((uint32_t)0x20000000U) /*!< DAC clock enable */
  3660. #define RCC_APB1ENR_CECEN ((uint32_t)0x40000000U) /*!< CEC clock enable */
  3661. /******************* Bit definition for RCC_BDCR register ******************/
  3662. #define RCC_BDCR_LSEON ((uint32_t)0x00000001U) /*!< External Low Speed oscillator enable */
  3663. #define RCC_BDCR_LSERDY ((uint32_t)0x00000002U) /*!< External Low Speed oscillator Ready */
  3664. #define RCC_BDCR_LSEBYP ((uint32_t)0x00000004U) /*!< External Low Speed oscillator Bypass */
  3665. #define RCC_BDCR_LSEDRV ((uint32_t)0x00000018U) /*!< LSEDRV[1:0] bits (LSE Osc. drive capability) */
  3666. #define RCC_BDCR_LSEDRV_0 ((uint32_t)0x00000008U) /*!< Bit 0 */
  3667. #define RCC_BDCR_LSEDRV_1 ((uint32_t)0x00000010U) /*!< Bit 1 */
  3668. #define RCC_BDCR_RTCSEL ((uint32_t)0x00000300U) /*!< RTCSEL[1:0] bits (RTC clock source selection) */
  3669. #define RCC_BDCR_RTCSEL_0 ((uint32_t)0x00000100U) /*!< Bit 0 */
  3670. #define RCC_BDCR_RTCSEL_1 ((uint32_t)0x00000200U) /*!< Bit 1 */
  3671. /*!< RTC configuration */
  3672. #define RCC_BDCR_RTCSEL_NOCLOCK ((uint32_t)0x00000000U) /*!< No clock */
  3673. #define RCC_BDCR_RTCSEL_LSE ((uint32_t)0x00000100U) /*!< LSE oscillator clock used as RTC clock */
  3674. #define RCC_BDCR_RTCSEL_LSI ((uint32_t)0x00000200U) /*!< LSI oscillator clock used as RTC clock */
  3675. #define RCC_BDCR_RTCSEL_HSE ((uint32_t)0x00000300U) /*!< HSE oscillator clock divided by 128 used as RTC clock */
  3676. #define RCC_BDCR_RTCEN ((uint32_t)0x00008000U) /*!< RTC clock enable */
  3677. #define RCC_BDCR_BDRST ((uint32_t)0x00010000U) /*!< Backup domain software reset */
  3678. /******************* Bit definition for RCC_CSR register *******************/
  3679. #define RCC_CSR_LSION ((uint32_t)0x00000001U) /*!< Internal Low Speed oscillator enable */
  3680. #define RCC_CSR_LSIRDY ((uint32_t)0x00000002U) /*!< Internal Low Speed oscillator Ready */
  3681. #define RCC_CSR_V18PWRRSTF ((uint32_t)0x00800000U) /*!< V1.8 power domain reset flag */
  3682. #define RCC_CSR_RMVF ((uint32_t)0x01000000U) /*!< Remove reset flag */
  3683. #define RCC_CSR_OBLRSTF ((uint32_t)0x02000000U) /*!< OBL reset flag */
  3684. #define RCC_CSR_PINRSTF ((uint32_t)0x04000000U) /*!< PIN reset flag */
  3685. #define RCC_CSR_PORRSTF ((uint32_t)0x08000000U) /*!< POR/PDR reset flag */
  3686. #define RCC_CSR_SFTRSTF ((uint32_t)0x10000000U) /*!< Software Reset flag */
  3687. #define RCC_CSR_IWDGRSTF ((uint32_t)0x20000000U) /*!< Independent Watchdog reset flag */
  3688. #define RCC_CSR_WWDGRSTF ((uint32_t)0x40000000U) /*!< Window watchdog reset flag */
  3689. #define RCC_CSR_LPWRRSTF ((uint32_t)0x80000000U) /*!< Low-Power reset flag */
  3690. /* Old Bit definition maintained for legacy purpose */
  3691. #define RCC_CSR_OBL RCC_CSR_OBLRSTF /*!< OBL reset flag */
  3692. /******************* Bit definition for RCC_AHBRSTR register ***************/
  3693. #define RCC_AHBRSTR_GPIOARST ((uint32_t)0x00020000U) /*!< GPIOA clock reset */
  3694. #define RCC_AHBRSTR_GPIOBRST ((uint32_t)0x00040000U) /*!< GPIOB clock reset */
  3695. #define RCC_AHBRSTR_GPIOCRST ((uint32_t)0x00080000U) /*!< GPIOC clock reset */
  3696. #define RCC_AHBRSTR_GPIODRST ((uint32_t)0x00100000U) /*!< GPIOD clock reset */
  3697. #define RCC_AHBRSTR_GPIOERST ((uint32_t)0x00200000U) /*!< GPIOE clock reset */
  3698. #define RCC_AHBRSTR_GPIOFRST ((uint32_t)0x00400000U) /*!< GPIOF clock reset */
  3699. #define RCC_AHBRSTR_TSCRST ((uint32_t)0x01000000U) /*!< TS clock reset */
  3700. /* Old Bit definition maintained for legacy purpose */
  3701. #define RCC_AHBRSTR_TSRST RCC_AHBRSTR_TSCRST /*!< TS clock reset */
  3702. /******************* Bit definition for RCC_CFGR2 register *****************/
  3703. /*!< PREDIV configuration */
  3704. #define RCC_CFGR2_PREDIV ((uint32_t)0x0000000FU) /*!< PREDIV[3:0] bits */
  3705. #define RCC_CFGR2_PREDIV_0 ((uint32_t)0x00000001U) /*!< Bit 0 */
  3706. #define RCC_CFGR2_PREDIV_1 ((uint32_t)0x00000002U) /*!< Bit 1 */
  3707. #define RCC_CFGR2_PREDIV_2 ((uint32_t)0x00000004U) /*!< Bit 2 */
  3708. #define RCC_CFGR2_PREDIV_3 ((uint32_t)0x00000008U) /*!< Bit 3 */
  3709. #define RCC_CFGR2_PREDIV_DIV1 ((uint32_t)0x00000000U) /*!< PREDIV input clock not divided */
  3710. #define RCC_CFGR2_PREDIV_DIV2 ((uint32_t)0x00000001U) /*!< PREDIV input clock divided by 2 */
  3711. #define RCC_CFGR2_PREDIV_DIV3 ((uint32_t)0x00000002U) /*!< PREDIV input clock divided by 3 */
  3712. #define RCC_CFGR2_PREDIV_DIV4 ((uint32_t)0x00000003U) /*!< PREDIV input clock divided by 4 */
  3713. #define RCC_CFGR2_PREDIV_DIV5 ((uint32_t)0x00000004U) /*!< PREDIV input clock divided by 5 */
  3714. #define RCC_CFGR2_PREDIV_DIV6 ((uint32_t)0x00000005U) /*!< PREDIV input clock divided by 6 */
  3715. #define RCC_CFGR2_PREDIV_DIV7 ((uint32_t)0x00000006U) /*!< PREDIV input clock divided by 7 */
  3716. #define RCC_CFGR2_PREDIV_DIV8 ((uint32_t)0x00000007U) /*!< PREDIV input clock divided by 8 */
  3717. #define RCC_CFGR2_PREDIV_DIV9 ((uint32_t)0x00000008U) /*!< PREDIV input clock divided by 9 */
  3718. #define RCC_CFGR2_PREDIV_DIV10 ((uint32_t)0x00000009U) /*!< PREDIV input clock divided by 10 */
  3719. #define RCC_CFGR2_PREDIV_DIV11 ((uint32_t)0x0000000AU) /*!< PREDIV input clock divided by 11 */
  3720. #define RCC_CFGR2_PREDIV_DIV12 ((uint32_t)0x0000000BU) /*!< PREDIV input clock divided by 12 */
  3721. #define RCC_CFGR2_PREDIV_DIV13 ((uint32_t)0x0000000CU) /*!< PREDIV input clock divided by 13 */
  3722. #define RCC_CFGR2_PREDIV_DIV14 ((uint32_t)0x0000000DU) /*!< PREDIV input clock divided by 14 */
  3723. #define RCC_CFGR2_PREDIV_DIV15 ((uint32_t)0x0000000EU) /*!< PREDIV input clock divided by 15 */
  3724. #define RCC_CFGR2_PREDIV_DIV16 ((uint32_t)0x0000000FU) /*!< PREDIV input clock divided by 16 */
  3725. /******************* Bit definition for RCC_CFGR3 register *****************/
  3726. /*!< USART1 Clock source selection */
  3727. #define RCC_CFGR3_USART1SW ((uint32_t)0x00000003U) /*!< USART1SW[1:0] bits */
  3728. #define RCC_CFGR3_USART1SW_0 ((uint32_t)0x00000001U) /*!< Bit 0 */
  3729. #define RCC_CFGR3_USART1SW_1 ((uint32_t)0x00000002U) /*!< Bit 1 */
  3730. #define RCC_CFGR3_USART1SW_PCLK ((uint32_t)0x00000000U) /*!< PCLK clock used as USART1 clock source */
  3731. #define RCC_CFGR3_USART1SW_SYSCLK ((uint32_t)0x00000001U) /*!< System clock selected as USART1 clock source */
  3732. #define RCC_CFGR3_USART1SW_LSE ((uint32_t)0x00000002U) /*!< LSE oscillator clock used as USART1 clock source */
  3733. #define RCC_CFGR3_USART1SW_HSI ((uint32_t)0x00000003U) /*!< HSI oscillator clock used as USART1 clock source */
  3734. /*!< I2C1 Clock source selection */
  3735. #define RCC_CFGR3_I2C1SW ((uint32_t)0x00000010U) /*!< I2C1SW bits */
  3736. #define RCC_CFGR3_I2C1SW_HSI ((uint32_t)0x00000000U) /*!< HSI oscillator clock used as I2C1 clock source */
  3737. #define RCC_CFGR3_I2C1SW_SYSCLK ((uint32_t)0x00000010U) /*!< System clock selected as I2C1 clock source */
  3738. /*!< CEC Clock source selection */
  3739. #define RCC_CFGR3_CECSW ((uint32_t)0x00000040U) /*!< CECSW bits */
  3740. #define RCC_CFGR3_CECSW_HSI_DIV244 ((uint32_t)0x00000000U) /*!< HSI clock divided by 244 selected as HDMI CEC entry clock source */
  3741. #define RCC_CFGR3_CECSW_LSE ((uint32_t)0x00000040U) /*!< LSE clock selected as HDMI CEC entry clock source */
  3742. /*!< USB Clock source selection */
  3743. #define RCC_CFGR3_USBSW ((uint32_t)0x00000080U) /*!< USBSW bits */
  3744. #define RCC_CFGR3_USBSW_HSI48 ((uint32_t)0x00000000U) /*!< HSI48 oscillator clock used as USB clock source */
  3745. #define RCC_CFGR3_USBSW_PLLCLK ((uint32_t)0x00000080U) /*!< PLLCLK selected as USB clock source */
  3746. /*!< USART2 Clock source selection */
  3747. #define RCC_CFGR3_USART2SW ((uint32_t)0x00030000U) /*!< USART2SW[1:0] bits */
  3748. #define RCC_CFGR3_USART2SW_0 ((uint32_t)0x00010000U) /*!< Bit 0 */
  3749. #define RCC_CFGR3_USART2SW_1 ((uint32_t)0x00020000U) /*!< Bit 1 */
  3750. #define RCC_CFGR3_USART2SW_PCLK ((uint32_t)0x00000000U) /*!< PCLK clock used as USART2 clock source */
  3751. #define RCC_CFGR3_USART2SW_SYSCLK ((uint32_t)0x00010000U) /*!< System clock selected as USART2 clock source */
  3752. #define RCC_CFGR3_USART2SW_LSE ((uint32_t)0x00020000U) /*!< LSE oscillator clock used as USART2 clock source */
  3753. #define RCC_CFGR3_USART2SW_HSI ((uint32_t)0x00030000U) /*!< HSI oscillator clock used as USART2 clock source */
  3754. /******************* Bit definition for RCC_CR2 register *******************/
  3755. #define RCC_CR2_HSI14ON ((uint32_t)0x00000001U) /*!< Internal High Speed 14MHz clock enable */
  3756. #define RCC_CR2_HSI14RDY ((uint32_t)0x00000002U) /*!< Internal High Speed 14MHz clock ready flag */
  3757. #define RCC_CR2_HSI14DIS ((uint32_t)0x00000004U) /*!< Internal High Speed 14MHz clock disable */
  3758. #define RCC_CR2_HSI14TRIM ((uint32_t)0x000000F8U) /*!< Internal High Speed 14MHz clock trimming */
  3759. #define RCC_CR2_HSI14CAL ((uint32_t)0x0000FF00U) /*!< Internal High Speed 14MHz clock Calibration */
  3760. #define RCC_CR2_HSI48ON ((uint32_t)0x00010000U) /*!< Internal High Speed 48MHz clock enable */
  3761. #define RCC_CR2_HSI48RDY ((uint32_t)0x00020000U) /*!< Internal High Speed 48MHz clock ready flag */
  3762. #define RCC_CR2_HSI48CAL ((uint32_t)0xFF000000U) /*!< Internal High Speed 48MHz clock Calibration */
  3763. /*****************************************************************************/
  3764. /* */
  3765. /* Real-Time Clock (RTC) */
  3766. /* */
  3767. /*****************************************************************************/
  3768. /*
  3769. * @brief Specific device feature definitions (not present on all devices in the STM32F0 family)
  3770. */
  3771. #define RTC_TAMPER1_SUPPORT /*!< TAMPER 1 feature support */
  3772. #define RTC_TAMPER3_SUPPORT /*!< TAMPER 3 feature support */
  3773. #define RTC_BACKUP_SUPPORT /*!< BACKUP register feature support */
  3774. #define RTC_WAKEUP_SUPPORT /*!< WAKEUP feature support */
  3775. /******************** Bits definition for RTC_TR register ******************/
  3776. #define RTC_TR_PM ((uint32_t)0x00400000U)
  3777. #define RTC_TR_HT ((uint32_t)0x00300000U)
  3778. #define RTC_TR_HT_0 ((uint32_t)0x00100000U)
  3779. #define RTC_TR_HT_1 ((uint32_t)0x00200000U)
  3780. #define RTC_TR_HU ((uint32_t)0x000F0000U)
  3781. #define RTC_TR_HU_0 ((uint32_t)0x00010000U)
  3782. #define RTC_TR_HU_1 ((uint32_t)0x00020000U)
  3783. #define RTC_TR_HU_2 ((uint32_t)0x00040000U)
  3784. #define RTC_TR_HU_3 ((uint32_t)0x00080000U)
  3785. #define RTC_TR_MNT ((uint32_t)0x00007000U)
  3786. #define RTC_TR_MNT_0 ((uint32_t)0x00001000U)
  3787. #define RTC_TR_MNT_1 ((uint32_t)0x00002000U)
  3788. #define RTC_TR_MNT_2 ((uint32_t)0x00004000U)
  3789. #define RTC_TR_MNU ((uint32_t)0x00000F00U)
  3790. #define RTC_TR_MNU_0 ((uint32_t)0x00000100U)
  3791. #define RTC_TR_MNU_1 ((uint32_t)0x00000200U)
  3792. #define RTC_TR_MNU_2 ((uint32_t)0x00000400U)
  3793. #define RTC_TR_MNU_3 ((uint32_t)0x00000800U)
  3794. #define RTC_TR_ST ((uint32_t)0x00000070U)
  3795. #define RTC_TR_ST_0 ((uint32_t)0x00000010U)
  3796. #define RTC_TR_ST_1 ((uint32_t)0x00000020U)
  3797. #define RTC_TR_ST_2 ((uint32_t)0x00000040U)
  3798. #define RTC_TR_SU ((uint32_t)0x0000000FU)
  3799. #define RTC_TR_SU_0 ((uint32_t)0x00000001U)
  3800. #define RTC_TR_SU_1 ((uint32_t)0x00000002U)
  3801. #define RTC_TR_SU_2 ((uint32_t)0x00000004U)
  3802. #define RTC_TR_SU_3 ((uint32_t)0x00000008U)
  3803. /******************** Bits definition for RTC_DR register ******************/
  3804. #define RTC_DR_YT ((uint32_t)0x00F00000U)
  3805. #define RTC_DR_YT_0 ((uint32_t)0x00100000U)
  3806. #define RTC_DR_YT_1 ((uint32_t)0x00200000U)
  3807. #define RTC_DR_YT_2 ((uint32_t)0x00400000U)
  3808. #define RTC_DR_YT_3 ((uint32_t)0x00800000U)
  3809. #define RTC_DR_YU ((uint32_t)0x000F0000U)
  3810. #define RTC_DR_YU_0 ((uint32_t)0x00010000U)
  3811. #define RTC_DR_YU_1 ((uint32_t)0x00020000U)
  3812. #define RTC_DR_YU_2 ((uint32_t)0x00040000U)
  3813. #define RTC_DR_YU_3 ((uint32_t)0x00080000U)
  3814. #define RTC_DR_WDU ((uint32_t)0x0000E000U)
  3815. #define RTC_DR_WDU_0 ((uint32_t)0x00002000U)
  3816. #define RTC_DR_WDU_1 ((uint32_t)0x00004000U)
  3817. #define RTC_DR_WDU_2 ((uint32_t)0x00008000U)
  3818. #define RTC_DR_MT ((uint32_t)0x00001000U)
  3819. #define RTC_DR_MU ((uint32_t)0x00000F00U)
  3820. #define RTC_DR_MU_0 ((uint32_t)0x00000100U)
  3821. #define RTC_DR_MU_1 ((uint32_t)0x00000200U)
  3822. #define RTC_DR_MU_2 ((uint32_t)0x00000400U)
  3823. #define RTC_DR_MU_3 ((uint32_t)0x00000800U)
  3824. #define RTC_DR_DT ((uint32_t)0x00000030U)
  3825. #define RTC_DR_DT_0 ((uint32_t)0x00000010U)
  3826. #define RTC_DR_DT_1 ((uint32_t)0x00000020U)
  3827. #define RTC_DR_DU ((uint32_t)0x0000000FU)
  3828. #define RTC_DR_DU_0 ((uint32_t)0x00000001U)
  3829. #define RTC_DR_DU_1 ((uint32_t)0x00000002U)
  3830. #define RTC_DR_DU_2 ((uint32_t)0x00000004U)
  3831. #define RTC_DR_DU_3 ((uint32_t)0x00000008U)
  3832. /******************** Bits definition for RTC_CR register ******************/
  3833. #define RTC_CR_COE ((uint32_t)0x00800000U)
  3834. #define RTC_CR_OSEL ((uint32_t)0x00600000U)
  3835. #define RTC_CR_OSEL_0 ((uint32_t)0x00200000U)
  3836. #define RTC_CR_OSEL_1 ((uint32_t)0x00400000U)
  3837. #define RTC_CR_POL ((uint32_t)0x00100000U)
  3838. #define RTC_CR_COSEL ((uint32_t)0x00080000U)
  3839. #define RTC_CR_BCK ((uint32_t)0x00040000U)
  3840. #define RTC_CR_SUB1H ((uint32_t)0x00020000U)
  3841. #define RTC_CR_ADD1H ((uint32_t)0x00010000U)
  3842. #define RTC_CR_TSIE ((uint32_t)0x00008000U)
  3843. #define RTC_CR_WUTIE ((uint32_t)0x00004000U)
  3844. #define RTC_CR_ALRAIE ((uint32_t)0x00001000U)
  3845. #define RTC_CR_TSE ((uint32_t)0x00000800U)
  3846. #define RTC_CR_WUTE ((uint32_t)0x00000400U)
  3847. #define RTC_CR_ALRAE ((uint32_t)0x00000100U)
  3848. #define RTC_CR_FMT ((uint32_t)0x00000040U)
  3849. #define RTC_CR_BYPSHAD ((uint32_t)0x00000020U)
  3850. #define RTC_CR_REFCKON ((uint32_t)0x00000010U)
  3851. #define RTC_CR_TSEDGE ((uint32_t)0x00000008U)
  3852. #define RTC_CR_WUCKSEL ((uint32_t)0x00000007U)
  3853. #define RTC_CR_WUCKSEL_0 ((uint32_t)0x00000001U)
  3854. #define RTC_CR_WUCKSEL_1 ((uint32_t)0x00000002U)
  3855. #define RTC_CR_WUCKSEL_2 ((uint32_t)0x00000004U)
  3856. /******************** Bits definition for RTC_ISR register *****************/
  3857. #define RTC_ISR_RECALPF ((uint32_t)0x00010000U)
  3858. #define RTC_ISR_TAMP3F ((uint32_t)0x00008000U)
  3859. #define RTC_ISR_TAMP2F ((uint32_t)0x00004000U)
  3860. #define RTC_ISR_TAMP1F ((uint32_t)0x00002000U)
  3861. #define RTC_ISR_TSOVF ((uint32_t)0x00001000U)
  3862. #define RTC_ISR_TSF ((uint32_t)0x00000800U)
  3863. #define RTC_ISR_WUTF ((uint32_t)0x00000400U)
  3864. #define RTC_ISR_ALRAF ((uint32_t)0x00000100U)
  3865. #define RTC_ISR_INIT ((uint32_t)0x00000080U)
  3866. #define RTC_ISR_INITF ((uint32_t)0x00000040U)
  3867. #define RTC_ISR_RSF ((uint32_t)0x00000020U)
  3868. #define RTC_ISR_INITS ((uint32_t)0x00000010U)
  3869. #define RTC_ISR_SHPF ((uint32_t)0x00000008U)
  3870. #define RTC_ISR_WUTWF ((uint32_t)0x00000004U)
  3871. #define RTC_ISR_ALRAWF ((uint32_t)0x00000001U)
  3872. /******************** Bits definition for RTC_PRER register ****************/
  3873. #define RTC_PRER_PREDIV_A ((uint32_t)0x007F0000U)
  3874. #define RTC_PRER_PREDIV_S ((uint32_t)0x00007FFFU)
  3875. /******************** Bits definition for RTC_WUTR register ****************/
  3876. #define RTC_WUTR_WUT ((uint32_t)0x0000FFFFU)
  3877. /******************** Bits definition for RTC_ALRMAR register **************/
  3878. #define RTC_ALRMAR_MSK4 ((uint32_t)0x80000000U)
  3879. #define RTC_ALRMAR_WDSEL ((uint32_t)0x40000000U)
  3880. #define RTC_ALRMAR_DT ((uint32_t)0x30000000U)
  3881. #define RTC_ALRMAR_DT_0 ((uint32_t)0x10000000U)
  3882. #define RTC_ALRMAR_DT_1 ((uint32_t)0x20000000U)
  3883. #define RTC_ALRMAR_DU ((uint32_t)0x0F000000U)
  3884. #define RTC_ALRMAR_DU_0 ((uint32_t)0x01000000U)
  3885. #define RTC_ALRMAR_DU_1 ((uint32_t)0x02000000U)
  3886. #define RTC_ALRMAR_DU_2 ((uint32_t)0x04000000U)
  3887. #define RTC_ALRMAR_DU_3 ((uint32_t)0x08000000U)
  3888. #define RTC_ALRMAR_MSK3 ((uint32_t)0x00800000U)
  3889. #define RTC_ALRMAR_PM ((uint32_t)0x00400000U)
  3890. #define RTC_ALRMAR_HT ((uint32_t)0x00300000U)
  3891. #define RTC_ALRMAR_HT_0 ((uint32_t)0x00100000U)
  3892. #define RTC_ALRMAR_HT_1 ((uint32_t)0x00200000U)
  3893. #define RTC_ALRMAR_HU ((uint32_t)0x000F0000U)
  3894. #define RTC_ALRMAR_HU_0 ((uint32_t)0x00010000U)
  3895. #define RTC_ALRMAR_HU_1 ((uint32_t)0x00020000U)
  3896. #define RTC_ALRMAR_HU_2 ((uint32_t)0x00040000U)
  3897. #define RTC_ALRMAR_HU_3 ((uint32_t)0x00080000U)
  3898. #define RTC_ALRMAR_MSK2 ((uint32_t)0x00008000U)
  3899. #define RTC_ALRMAR_MNT ((uint32_t)0x00007000U)
  3900. #define RTC_ALRMAR_MNT_0 ((uint32_t)0x00001000U)
  3901. #define RTC_ALRMAR_MNT_1 ((uint32_t)0x00002000U)
  3902. #define RTC_ALRMAR_MNT_2 ((uint32_t)0x00004000U)
  3903. #define RTC_ALRMAR_MNU ((uint32_t)0x00000F00U)
  3904. #define RTC_ALRMAR_MNU_0 ((uint32_t)0x00000100U)
  3905. #define RTC_ALRMAR_MNU_1 ((uint32_t)0x00000200U)
  3906. #define RTC_ALRMAR_MNU_2 ((uint32_t)0x00000400U)
  3907. #define RTC_ALRMAR_MNU_3 ((uint32_t)0x00000800U)
  3908. #define RTC_ALRMAR_MSK1 ((uint32_t)0x00000080U)
  3909. #define RTC_ALRMAR_ST ((uint32_t)0x00000070U)
  3910. #define RTC_ALRMAR_ST_0 ((uint32_t)0x00000010U)
  3911. #define RTC_ALRMAR_ST_1 ((uint32_t)0x00000020U)
  3912. #define RTC_ALRMAR_ST_2 ((uint32_t)0x00000040U)
  3913. #define RTC_ALRMAR_SU ((uint32_t)0x0000000FU)
  3914. #define RTC_ALRMAR_SU_0 ((uint32_t)0x00000001U)
  3915. #define RTC_ALRMAR_SU_1 ((uint32_t)0x00000002U)
  3916. #define RTC_ALRMAR_SU_2 ((uint32_t)0x00000004U)
  3917. #define RTC_ALRMAR_SU_3 ((uint32_t)0x00000008U)
  3918. /******************** Bits definition for RTC_WPR register *****************/
  3919. #define RTC_WPR_KEY ((uint32_t)0x000000FFU)
  3920. /******************** Bits definition for RTC_SSR register *****************/
  3921. #define RTC_SSR_SS ((uint32_t)0x0000FFFFU)
  3922. /******************** Bits definition for RTC_SHIFTR register **************/
  3923. #define RTC_SHIFTR_SUBFS ((uint32_t)0x00007FFFU)
  3924. #define RTC_SHIFTR_ADD1S ((uint32_t)0x80000000U)
  3925. /******************** Bits definition for RTC_TSTR register ****************/
  3926. #define RTC_TSTR_PM ((uint32_t)0x00400000U)
  3927. #define RTC_TSTR_HT ((uint32_t)0x00300000U)
  3928. #define RTC_TSTR_HT_0 ((uint32_t)0x00100000U)
  3929. #define RTC_TSTR_HT_1 ((uint32_t)0x00200000U)
  3930. #define RTC_TSTR_HU ((uint32_t)0x000F0000U)
  3931. #define RTC_TSTR_HU_0 ((uint32_t)0x00010000U)
  3932. #define RTC_TSTR_HU_1 ((uint32_t)0x00020000U)
  3933. #define RTC_TSTR_HU_2 ((uint32_t)0x00040000U)
  3934. #define RTC_TSTR_HU_3 ((uint32_t)0x00080000U)
  3935. #define RTC_TSTR_MNT ((uint32_t)0x00007000U)
  3936. #define RTC_TSTR_MNT_0 ((uint32_t)0x00001000U)
  3937. #define RTC_TSTR_MNT_1 ((uint32_t)0x00002000U)
  3938. #define RTC_TSTR_MNT_2 ((uint32_t)0x00004000U)
  3939. #define RTC_TSTR_MNU ((uint32_t)0x00000F00U)
  3940. #define RTC_TSTR_MNU_0 ((uint32_t)0x00000100U)
  3941. #define RTC_TSTR_MNU_1 ((uint32_t)0x00000200U)
  3942. #define RTC_TSTR_MNU_2 ((uint32_t)0x00000400U)
  3943. #define RTC_TSTR_MNU_3 ((uint32_t)0x00000800U)
  3944. #define RTC_TSTR_ST ((uint32_t)0x00000070U)
  3945. #define RTC_TSTR_ST_0 ((uint32_t)0x00000010U)
  3946. #define RTC_TSTR_ST_1 ((uint32_t)0x00000020U)
  3947. #define RTC_TSTR_ST_2 ((uint32_t)0x00000040U)
  3948. #define RTC_TSTR_SU ((uint32_t)0x0000000FU)
  3949. #define RTC_TSTR_SU_0 ((uint32_t)0x00000001U)
  3950. #define RTC_TSTR_SU_1 ((uint32_t)0x00000002U)
  3951. #define RTC_TSTR_SU_2 ((uint32_t)0x00000004U)
  3952. #define RTC_TSTR_SU_3 ((uint32_t)0x00000008U)
  3953. /******************** Bits definition for RTC_TSDR register ****************/
  3954. #define RTC_TSDR_WDU ((uint32_t)0x0000E000U)
  3955. #define RTC_TSDR_WDU_0 ((uint32_t)0x00002000U)
  3956. #define RTC_TSDR_WDU_1 ((uint32_t)0x00004000U)
  3957. #define RTC_TSDR_WDU_2 ((uint32_t)0x00008000U)
  3958. #define RTC_TSDR_MT ((uint32_t)0x00001000U)
  3959. #define RTC_TSDR_MU ((uint32_t)0x00000F00U)
  3960. #define RTC_TSDR_MU_0 ((uint32_t)0x00000100U)
  3961. #define RTC_TSDR_MU_1 ((uint32_t)0x00000200U)
  3962. #define RTC_TSDR_MU_2 ((uint32_t)0x00000400U)
  3963. #define RTC_TSDR_MU_3 ((uint32_t)0x00000800U)
  3964. #define RTC_TSDR_DT ((uint32_t)0x00000030U)
  3965. #define RTC_TSDR_DT_0 ((uint32_t)0x00000010U)
  3966. #define RTC_TSDR_DT_1 ((uint32_t)0x00000020U)
  3967. #define RTC_TSDR_DU ((uint32_t)0x0000000FU)
  3968. #define RTC_TSDR_DU_0 ((uint32_t)0x00000001U)
  3969. #define RTC_TSDR_DU_1 ((uint32_t)0x00000002U)
  3970. #define RTC_TSDR_DU_2 ((uint32_t)0x00000004U)
  3971. #define RTC_TSDR_DU_3 ((uint32_t)0x00000008U)
  3972. /******************** Bits definition for RTC_TSSSR register ***************/
  3973. #define RTC_TSSSR_SS ((uint32_t)0x0000FFFFU)
  3974. /******************** Bits definition for RTC_CALR register ****************/
  3975. #define RTC_CALR_CALP ((uint32_t)0x00008000U)
  3976. #define RTC_CALR_CALW8 ((uint32_t)0x00004000U)
  3977. #define RTC_CALR_CALW16 ((uint32_t)0x00002000U)
  3978. #define RTC_CALR_CALM ((uint32_t)0x000001FFU)
  3979. #define RTC_CALR_CALM_0 ((uint32_t)0x00000001U)
  3980. #define RTC_CALR_CALM_1 ((uint32_t)0x00000002U)
  3981. #define RTC_CALR_CALM_2 ((uint32_t)0x00000004U)
  3982. #define RTC_CALR_CALM_3 ((uint32_t)0x00000008U)
  3983. #define RTC_CALR_CALM_4 ((uint32_t)0x00000010U)
  3984. #define RTC_CALR_CALM_5 ((uint32_t)0x00000020U)
  3985. #define RTC_CALR_CALM_6 ((uint32_t)0x00000040U)
  3986. #define RTC_CALR_CALM_7 ((uint32_t)0x00000080U)
  3987. #define RTC_CALR_CALM_8 ((uint32_t)0x00000100U)
  3988. /******************** Bits definition for RTC_TAFCR register ***************/
  3989. #define RTC_TAFCR_PC15MODE ((uint32_t)0x00800000U)
  3990. #define RTC_TAFCR_PC15VALUE ((uint32_t)0x00400000U)
  3991. #define RTC_TAFCR_PC14MODE ((uint32_t)0x00200000U)
  3992. #define RTC_TAFCR_PC14VALUE ((uint32_t)0x00100000U)
  3993. #define RTC_TAFCR_PC13MODE ((uint32_t)0x00080000U)
  3994. #define RTC_TAFCR_PC13VALUE ((uint32_t)0x00040000U)
  3995. #define RTC_TAFCR_TAMPPUDIS ((uint32_t)0x00008000U)
  3996. #define RTC_TAFCR_TAMPPRCH ((uint32_t)0x00006000U)
  3997. #define RTC_TAFCR_TAMPPRCH_0 ((uint32_t)0x00002000U)
  3998. #define RTC_TAFCR_TAMPPRCH_1 ((uint32_t)0x00004000U)
  3999. #define RTC_TAFCR_TAMPFLT ((uint32_t)0x00001800U)
  4000. #define RTC_TAFCR_TAMPFLT_0 ((uint32_t)0x00000800U)
  4001. #define RTC_TAFCR_TAMPFLT_1 ((uint32_t)0x00001000U)
  4002. #define RTC_TAFCR_TAMPFREQ ((uint32_t)0x00000700U)
  4003. #define RTC_TAFCR_TAMPFREQ_0 ((uint32_t)0x00000100U)
  4004. #define RTC_TAFCR_TAMPFREQ_1 ((uint32_t)0x00000200U)
  4005. #define RTC_TAFCR_TAMPFREQ_2 ((uint32_t)0x00000400U)
  4006. #define RTC_TAFCR_TAMPTS ((uint32_t)0x00000080U)
  4007. #define RTC_TAFCR_TAMP3TRG ((uint32_t)0x00000040U)
  4008. #define RTC_TAFCR_TAMP3E ((uint32_t)0x00000020U)
  4009. #define RTC_TAFCR_TAMP2TRG ((uint32_t)0x00000010U)
  4010. #define RTC_TAFCR_TAMP2E ((uint32_t)0x00000008U)
  4011. #define RTC_TAFCR_TAMPIE ((uint32_t)0x00000004U)
  4012. #define RTC_TAFCR_TAMP1TRG ((uint32_t)0x00000002U)
  4013. #define RTC_TAFCR_TAMP1E ((uint32_t)0x00000001U)
  4014. /* Reference defines */
  4015. #define RTC_TAFCR_ALARMOUTTYPE RTC_TAFCR_PC13VALUE
  4016. /******************** Bits definition for RTC_ALRMASSR register ************/
  4017. #define RTC_ALRMASSR_MASKSS ((uint32_t)0x0F000000U)
  4018. #define RTC_ALRMASSR_MASKSS_0 ((uint32_t)0x01000000U)
  4019. #define RTC_ALRMASSR_MASKSS_1 ((uint32_t)0x02000000U)
  4020. #define RTC_ALRMASSR_MASKSS_2 ((uint32_t)0x04000000U)
  4021. #define RTC_ALRMASSR_MASKSS_3 ((uint32_t)0x08000000U)
  4022. #define RTC_ALRMASSR_SS ((uint32_t)0x00007FFFU)
  4023. /******************** Bits definition for RTC_BKP0R register ***************/
  4024. #define RTC_BKP0R ((uint32_t)0xFFFFFFFFU)
  4025. /******************** Bits definition for RTC_BKP1R register ***************/
  4026. #define RTC_BKP1R ((uint32_t)0xFFFFFFFFU)
  4027. /******************** Bits definition for RTC_BKP2R register ***************/
  4028. #define RTC_BKP2R ((uint32_t)0xFFFFFFFFU)
  4029. /******************** Bits definition for RTC_BKP3R register ***************/
  4030. #define RTC_BKP3R ((uint32_t)0xFFFFFFFFU)
  4031. /******************** Bits definition for RTC_BKP4R register ***************/
  4032. #define RTC_BKP4R ((uint32_t)0xFFFFFFFFU)
  4033. /******************** Number of backup registers ******************************/
  4034. #define RTC_BKP_NUMBER ((uint32_t)0x00000005U)
  4035. /*****************************************************************************/
  4036. /* */
  4037. /* Serial Peripheral Interface (SPI) */
  4038. /* */
  4039. /*****************************************************************************/
  4040. /******************* Bit definition for SPI_CR1 register *******************/
  4041. #define SPI_CR1_CPHA ((uint32_t)0x00000001U) /*!< Clock Phase */
  4042. #define SPI_CR1_CPOL ((uint32_t)0x00000002U) /*!< Clock Polarity */
  4043. #define SPI_CR1_MSTR ((uint32_t)0x00000004U) /*!< Master Selection */
  4044. #define SPI_CR1_BR ((uint32_t)0x00000038U) /*!< BR[2:0] bits (Baud Rate Control) */
  4045. #define SPI_CR1_BR_0 ((uint32_t)0x00000008U) /*!< Bit 0 */
  4046. #define SPI_CR1_BR_1 ((uint32_t)0x00000010U) /*!< Bit 1 */
  4047. #define SPI_CR1_BR_2 ((uint32_t)0x00000020U) /*!< Bit 2 */
  4048. #define SPI_CR1_SPE ((uint32_t)0x00000040U) /*!< SPI Enable */
  4049. #define SPI_CR1_LSBFIRST ((uint32_t)0x00000080U) /*!< Frame Format */
  4050. #define SPI_CR1_SSI ((uint32_t)0x00000100U) /*!< Internal slave select */
  4051. #define SPI_CR1_SSM ((uint32_t)0x00000200U) /*!< Software slave management */
  4052. #define SPI_CR1_RXONLY ((uint32_t)0x00000400U) /*!< Receive only */
  4053. #define SPI_CR1_CRCL ((uint32_t)0x00000800U) /*!< CRC Length */
  4054. #define SPI_CR1_CRCNEXT ((uint32_t)0x00001000U) /*!< Transmit CRC next */
  4055. #define SPI_CR1_CRCEN ((uint32_t)0x00002000U) /*!< Hardware CRC calculation enable */
  4056. #define SPI_CR1_BIDIOE ((uint32_t)0x00004000U) /*!< Output enable in bidirectional mode */
  4057. #define SPI_CR1_BIDIMODE ((uint32_t)0x00008000U) /*!< Bidirectional data mode enable */
  4058. /******************* Bit definition for SPI_CR2 register *******************/
  4059. #define SPI_CR2_RXDMAEN ((uint32_t)0x00000001U) /*!< Rx Buffer DMA Enable */
  4060. #define SPI_CR2_TXDMAEN ((uint32_t)0x00000002U) /*!< Tx Buffer DMA Enable */
  4061. #define SPI_CR2_SSOE ((uint32_t)0x00000004U) /*!< SS Output Enable */
  4062. #define SPI_CR2_NSSP ((uint32_t)0x00000008U) /*!< NSS pulse management Enable */
  4063. #define SPI_CR2_FRF ((uint32_t)0x00000010U) /*!< Frame Format Enable */
  4064. #define SPI_CR2_ERRIE ((uint32_t)0x00000020U) /*!< Error Interrupt Enable */
  4065. #define SPI_CR2_RXNEIE ((uint32_t)0x00000040U) /*!< RX buffer Not Empty Interrupt Enable */
  4066. #define SPI_CR2_TXEIE ((uint32_t)0x00000080U) /*!< Tx buffer Empty Interrupt Enable */
  4067. #define SPI_CR2_DS ((uint32_t)0x00000F00U) /*!< DS[3:0] Data Size */
  4068. #define SPI_CR2_DS_0 ((uint32_t)0x00000100U) /*!< Bit 0 */
  4069. #define SPI_CR2_DS_1 ((uint32_t)0x00000200U) /*!< Bit 1 */
  4070. #define SPI_CR2_DS_2 ((uint32_t)0x00000400U) /*!< Bit 2 */
  4071. #define SPI_CR2_DS_3 ((uint32_t)0x00000800U) /*!< Bit 3 */
  4072. #define SPI_CR2_FRXTH ((uint32_t)0x00001000U) /*!< FIFO reception Threshold */
  4073. #define SPI_CR2_LDMARX ((uint32_t)0x00002000U) /*!< Last DMA transfer for reception */
  4074. #define SPI_CR2_LDMATX ((uint32_t)0x00004000U) /*!< Last DMA transfer for transmission */
  4075. /******************** Bit definition for SPI_SR register *******************/
  4076. #define SPI_SR_RXNE ((uint32_t)0x00000001U) /*!< Receive buffer Not Empty */
  4077. #define SPI_SR_TXE ((uint32_t)0x00000002U) /*!< Transmit buffer Empty */
  4078. #define SPI_SR_CHSIDE ((uint32_t)0x00000004U) /*!< Channel side */
  4079. #define SPI_SR_UDR ((uint32_t)0x00000008U) /*!< Underrun flag */
  4080. #define SPI_SR_CRCERR ((uint32_t)0x00000010U) /*!< CRC Error flag */
  4081. #define SPI_SR_MODF ((uint32_t)0x00000020U) /*!< Mode fault */
  4082. #define SPI_SR_OVR ((uint32_t)0x00000040U) /*!< Overrun flag */
  4083. #define SPI_SR_BSY ((uint32_t)0x00000080U) /*!< Busy flag */
  4084. #define SPI_SR_FRE ((uint32_t)0x00000100U) /*!< TI frame format error */
  4085. #define SPI_SR_FRLVL ((uint32_t)0x00000600U) /*!< FIFO Reception Level */
  4086. #define SPI_SR_FRLVL_0 ((uint32_t)0x00000200U) /*!< Bit 0 */
  4087. #define SPI_SR_FRLVL_1 ((uint32_t)0x00000400U) /*!< Bit 1 */
  4088. #define SPI_SR_FTLVL ((uint32_t)0x00001800U) /*!< FIFO Transmission Level */
  4089. #define SPI_SR_FTLVL_0 ((uint32_t)0x00000800U) /*!< Bit 0 */
  4090. #define SPI_SR_FTLVL_1 ((uint32_t)0x00001000U) /*!< Bit 1 */
  4091. /******************** Bit definition for SPI_DR register *******************/
  4092. #define SPI_DR_DR ((uint32_t)0xFFFFFFFFU) /*!< Data Register */
  4093. /******************* Bit definition for SPI_CRCPR register *****************/
  4094. #define SPI_CRCPR_CRCPOLY ((uint32_t)0xFFFFFFFFU) /*!< CRC polynomial register */
  4095. /****************** Bit definition for SPI_RXCRCR register *****************/
  4096. #define SPI_RXCRCR_RXCRC ((uint32_t)0xFFFFFFFFU) /*!< Rx CRC Register */
  4097. /****************** Bit definition for SPI_TXCRCR register *****************/
  4098. #define SPI_TXCRCR_TXCRC ((uint32_t)0xFFFFFFFFU) /*!< Tx CRC Register */
  4099. /****************** Bit definition for SPI_I2SCFGR register ****************/
  4100. #define SPI_I2SCFGR_CHLEN ((uint32_t)0x00000001U) /*!<Channel length (number of bits per audio channel) */
  4101. #define SPI_I2SCFGR_DATLEN ((uint32_t)0x00000006U) /*!<DATLEN[1:0] bits (Data length to be transferred) */
  4102. #define SPI_I2SCFGR_DATLEN_0 ((uint32_t)0x00000002U) /*!<Bit 0 */
  4103. #define SPI_I2SCFGR_DATLEN_1 ((uint32_t)0x00000004U) /*!<Bit 1 */
  4104. #define SPI_I2SCFGR_CKPOL ((uint32_t)0x00000008U) /*!<steady state clock polarity */
  4105. #define SPI_I2SCFGR_I2SSTD ((uint32_t)0x00000030U) /*!<I2SSTD[1:0] bits (I2S standard selection) */
  4106. #define SPI_I2SCFGR_I2SSTD_0 ((uint32_t)0x00000010U) /*!<Bit 0 */
  4107. #define SPI_I2SCFGR_I2SSTD_1 ((uint32_t)0x00000020U) /*!<Bit 1 */
  4108. #define SPI_I2SCFGR_PCMSYNC ((uint32_t)0x00000080U) /*!<PCM frame synchronization */
  4109. #define SPI_I2SCFGR_I2SCFG ((uint32_t)0x00000300U) /*!<I2SCFG[1:0] bits (I2S configuration mode) */
  4110. #define SPI_I2SCFGR_I2SCFG_0 ((uint32_t)0x00000100U) /*!<Bit 0 */
  4111. #define SPI_I2SCFGR_I2SCFG_1 ((uint32_t)0x00000200U) /*!<Bit 1 */
  4112. #define SPI_I2SCFGR_I2SE ((uint32_t)0x00000400U) /*!<I2S Enable */
  4113. #define SPI_I2SCFGR_I2SMOD ((uint32_t)0x00000800U) /*!<I2S mode selection */
  4114. /****************** Bit definition for SPI_I2SPR register ******************/
  4115. #define SPI_I2SPR_I2SDIV ((uint32_t)0x000000FFU) /*!<I2S Linear prescaler */
  4116. #define SPI_I2SPR_ODD ((uint32_t)0x00000100U) /*!<Odd factor for the prescaler */
  4117. #define SPI_I2SPR_MCKOE ((uint32_t)0x00000200U) /*!<Master Clock Output Enable */
  4118. /*****************************************************************************/
  4119. /* */
  4120. /* System Configuration (SYSCFG) */
  4121. /* */
  4122. /*****************************************************************************/
  4123. /***************** Bit definition for SYSCFG_CFGR1 register ****************/
  4124. #define SYSCFG_CFGR1_MEM_MODE ((uint32_t)0x00000003U) /*!< SYSCFG_Memory Remap Config */
  4125. #define SYSCFG_CFGR1_MEM_MODE_0 ((uint32_t)0x00000001U) /*!< SYSCFG_Memory Remap Config Bit 0 */
  4126. #define SYSCFG_CFGR1_MEM_MODE_1 ((uint32_t)0x00000002U) /*!< SYSCFG_Memory Remap Config Bit 1 */
  4127. #define SYSCFG_CFGR1_DMA_RMP ((uint32_t)0x7F007F00U) /*!< DMA remap mask */
  4128. #define SYSCFG_CFGR1_ADC_DMA_RMP ((uint32_t)0x00000100U) /*!< ADC DMA remap */
  4129. #define SYSCFG_CFGR1_USART1TX_DMA_RMP ((uint32_t)0x00000200U) /*!< USART1 TX DMA remap */
  4130. #define SYSCFG_CFGR1_USART1RX_DMA_RMP ((uint32_t)0x00000400U) /*!< USART1 RX DMA remap */
  4131. #define SYSCFG_CFGR1_TIM16_DMA_RMP ((uint32_t)0x00000800U) /*!< Timer 16 DMA remap */
  4132. #define SYSCFG_CFGR1_TIM17_DMA_RMP ((uint32_t)0x00001000U) /*!< Timer 17 DMA remap */
  4133. #define SYSCFG_CFGR1_TIM16_DMA_RMP2 ((uint32_t)0x00002000U) /*!< Timer 16 DMA remap 2 */
  4134. #define SYSCFG_CFGR1_TIM17_DMA_RMP2 ((uint32_t)0x00004000U) /*!< Timer 17 DMA remap 2 */
  4135. #define SYSCFG_CFGR1_SPI2_DMA_RMP ((uint32_t)0x01000000U) /*!< SPI2 DMA remap */
  4136. #define SYSCFG_CFGR1_USART2_DMA_RMP ((uint32_t)0x02000000U) /*!< USART2 DMA remap */
  4137. #define SYSCFG_CFGR1_USART3_DMA_RMP ((uint32_t)0x04000000U) /*!< USART3 DMA remap */
  4138. #define SYSCFG_CFGR1_I2C1_DMA_RMP ((uint32_t)0x08000000U) /*!< I2C1 DMA remap */
  4139. #define SYSCFG_CFGR1_TIM1_DMA_RMP ((uint32_t)0x10000000U) /*!< TIM1 DMA remap */
  4140. #define SYSCFG_CFGR1_TIM2_DMA_RMP ((uint32_t)0x20000000U) /*!< TIM2 DMA remap */
  4141. #define SYSCFG_CFGR1_TIM3_DMA_RMP ((uint32_t)0x40000000U) /*!< TIM3 DMA remap */
  4142. #define SYSCFG_CFGR1_I2C_FMP_PB6 ((uint32_t)0x00010000U) /*!< I2C PB6 Fast mode plus */
  4143. #define SYSCFG_CFGR1_I2C_FMP_PB7 ((uint32_t)0x00020000U) /*!< I2C PB7 Fast mode plus */
  4144. #define SYSCFG_CFGR1_I2C_FMP_PB8 ((uint32_t)0x00040000U) /*!< I2C PB8 Fast mode plus */
  4145. #define SYSCFG_CFGR1_I2C_FMP_PB9 ((uint32_t)0x00080000U) /*!< I2C PB9 Fast mode plus */
  4146. #define SYSCFG_CFGR1_I2C_FMP_I2C1 ((uint32_t)0x00100000U) /*!< Enable Fast Mode Plus on PB10, PB11, PF6 and PF7 */
  4147. #define SYSCFG_CFGR1_I2C_FMP_I2C2 ((uint32_t)0x00200000U) /*!< Enable I2C2 Fast mode plus */
  4148. /***************** Bit definition for SYSCFG_EXTICR1 register **************/
  4149. #define SYSCFG_EXTICR1_EXTI0 ((uint32_t)0x0000000FU) /*!< EXTI 0 configuration */
  4150. #define SYSCFG_EXTICR1_EXTI1 ((uint32_t)0x000000F0U) /*!< EXTI 1 configuration */
  4151. #define SYSCFG_EXTICR1_EXTI2 ((uint32_t)0x00000F00U) /*!< EXTI 2 configuration */
  4152. #define SYSCFG_EXTICR1_EXTI3 ((uint32_t)0x0000F000U) /*!< EXTI 3 configuration */
  4153. /**
  4154. * @brief EXTI0 configuration
  4155. */
  4156. #define SYSCFG_EXTICR1_EXTI0_PA ((uint32_t)0x00000000U) /*!< PA[0] pin */
  4157. #define SYSCFG_EXTICR1_EXTI0_PB ((uint32_t)0x00000001U) /*!< PB[0] pin */
  4158. #define SYSCFG_EXTICR1_EXTI0_PC ((uint32_t)0x00000002U) /*!< PC[0] pin */
  4159. #define SYSCFG_EXTICR1_EXTI0_PD ((uint32_t)0x00000003U) /*!< PD[0] pin */
  4160. #define SYSCFG_EXTICR1_EXTI0_PE ((uint32_t)0x00000004U) /*!< PE[0] pin */
  4161. #define SYSCFG_EXTICR1_EXTI0_PF ((uint32_t)0x00000005U) /*!< PF[0] pin */
  4162. /**
  4163. * @brief EXTI1 configuration
  4164. */
  4165. #define SYSCFG_EXTICR1_EXTI1_PA ((uint32_t)0x00000000U) /*!< PA[1] pin */
  4166. #define SYSCFG_EXTICR1_EXTI1_PB ((uint32_t)0x00000010U) /*!< PB[1] pin */
  4167. #define SYSCFG_EXTICR1_EXTI1_PC ((uint32_t)0x00000020U) /*!< PC[1] pin */
  4168. #define SYSCFG_EXTICR1_EXTI1_PD ((uint32_t)0x00000030U) /*!< PD[1] pin */
  4169. #define SYSCFG_EXTICR1_EXTI1_PE ((uint32_t)0x00000040U) /*!< PE[1] pin */
  4170. #define SYSCFG_EXTICR1_EXTI1_PF ((uint32_t)0x00000050U) /*!< PF[1] pin */
  4171. /**
  4172. * @brief EXTI2 configuration
  4173. */
  4174. #define SYSCFG_EXTICR1_EXTI2_PA ((uint32_t)0x00000000U) /*!< PA[2] pin */
  4175. #define SYSCFG_EXTICR1_EXTI2_PB ((uint32_t)0x00000100U) /*!< PB[2] pin */
  4176. #define SYSCFG_EXTICR1_EXTI2_PC ((uint32_t)0x00000200U) /*!< PC[2] pin */
  4177. #define SYSCFG_EXTICR1_EXTI2_PD ((uint32_t)0x00000300U) /*!< PD[2] pin */
  4178. #define SYSCFG_EXTICR1_EXTI2_PE ((uint32_t)0x00000400U) /*!< PE[2] pin */
  4179. #define SYSCFG_EXTICR1_EXTI2_PF ((uint32_t)0x00000500U) /*!< PF[2] pin */
  4180. /**
  4181. * @brief EXTI3 configuration
  4182. */
  4183. #define SYSCFG_EXTICR1_EXTI3_PA ((uint32_t)0x00000000U) /*!< PA[3] pin */
  4184. #define SYSCFG_EXTICR1_EXTI3_PB ((uint32_t)0x00001000U) /*!< PB[3] pin */
  4185. #define SYSCFG_EXTICR1_EXTI3_PC ((uint32_t)0x00002000U) /*!< PC[3] pin */
  4186. #define SYSCFG_EXTICR1_EXTI3_PD ((uint32_t)0x00003000U) /*!< PD[3] pin */
  4187. #define SYSCFG_EXTICR1_EXTI3_PE ((uint32_t)0x00004000U) /*!< PE[3] pin */
  4188. #define SYSCFG_EXTICR1_EXTI3_PF ((uint32_t)0x00005000U) /*!< PF[3] pin */
  4189. /***************** Bit definition for SYSCFG_EXTICR2 register **************/
  4190. #define SYSCFG_EXTICR2_EXTI4 ((uint32_t)0x0000000FU) /*!< EXTI 4 configuration */
  4191. #define SYSCFG_EXTICR2_EXTI5 ((uint32_t)0x000000F0U) /*!< EXTI 5 configuration */
  4192. #define SYSCFG_EXTICR2_EXTI6 ((uint32_t)0x00000F00U) /*!< EXTI 6 configuration */
  4193. #define SYSCFG_EXTICR2_EXTI7 ((uint32_t)0x0000F000U) /*!< EXTI 7 configuration */
  4194. /**
  4195. * @brief EXTI4 configuration
  4196. */
  4197. #define SYSCFG_EXTICR2_EXTI4_PA ((uint32_t)0x00000000U) /*!< PA[4] pin */
  4198. #define SYSCFG_EXTICR2_EXTI4_PB ((uint32_t)0x00000001U) /*!< PB[4] pin */
  4199. #define SYSCFG_EXTICR2_EXTI4_PC ((uint32_t)0x00000002U) /*!< PC[4] pin */
  4200. #define SYSCFG_EXTICR2_EXTI4_PD ((uint32_t)0x00000003U) /*!< PD[4] pin */
  4201. #define SYSCFG_EXTICR2_EXTI4_PE ((uint32_t)0x00000004U) /*!< PE[4] pin */
  4202. #define SYSCFG_EXTICR2_EXTI4_PF ((uint32_t)0x00000005U) /*!< PF[4] pin */
  4203. /**
  4204. * @brief EXTI5 configuration
  4205. */
  4206. #define SYSCFG_EXTICR2_EXTI5_PA ((uint32_t)0x00000000U) /*!< PA[5] pin */
  4207. #define SYSCFG_EXTICR2_EXTI5_PB ((uint32_t)0x00000010U) /*!< PB[5] pin */
  4208. #define SYSCFG_EXTICR2_EXTI5_PC ((uint32_t)0x00000020U) /*!< PC[5] pin */
  4209. #define SYSCFG_EXTICR2_EXTI5_PD ((uint32_t)0x00000030U) /*!< PD[5] pin */
  4210. #define SYSCFG_EXTICR2_EXTI5_PE ((uint32_t)0x00000040U) /*!< PE[5] pin */
  4211. #define SYSCFG_EXTICR2_EXTI5_PF ((uint32_t)0x00000050U) /*!< PF[5] pin */
  4212. /**
  4213. * @brief EXTI6 configuration
  4214. */
  4215. #define SYSCFG_EXTICR2_EXTI6_PA ((uint32_t)0x00000000U) /*!< PA[6] pin */
  4216. #define SYSCFG_EXTICR2_EXTI6_PB ((uint32_t)0x00000100U) /*!< PB[6] pin */
  4217. #define SYSCFG_EXTICR2_EXTI6_PC ((uint32_t)0x00000200U) /*!< PC[6] pin */
  4218. #define SYSCFG_EXTICR2_EXTI6_PD ((uint32_t)0x00000300U) /*!< PD[6] pin */
  4219. #define SYSCFG_EXTICR2_EXTI6_PE ((uint32_t)0x00000400U) /*!< PE[6] pin */
  4220. #define SYSCFG_EXTICR2_EXTI6_PF ((uint32_t)0x00000500U) /*!< PF[6] pin */
  4221. /**
  4222. * @brief EXTI7 configuration
  4223. */
  4224. #define SYSCFG_EXTICR2_EXTI7_PA ((uint32_t)0x00000000U) /*!< PA[7] pin */
  4225. #define SYSCFG_EXTICR2_EXTI7_PB ((uint32_t)0x00001000U) /*!< PB[7] pin */
  4226. #define SYSCFG_EXTICR2_EXTI7_PC ((uint32_t)0x00002000U) /*!< PC[7] pin */
  4227. #define SYSCFG_EXTICR2_EXTI7_PD ((uint32_t)0x00003000U) /*!< PD[7] pin */
  4228. #define SYSCFG_EXTICR2_EXTI7_PE ((uint32_t)0x00004000U) /*!< PE[7] pin */
  4229. #define SYSCFG_EXTICR2_EXTI7_PF ((uint32_t)0x00005000U) /*!< PF[7] pin */
  4230. /***************** Bit definition for SYSCFG_EXTICR3 register **************/
  4231. #define SYSCFG_EXTICR3_EXTI8 ((uint32_t)0x0000000FU) /*!< EXTI 8 configuration */
  4232. #define SYSCFG_EXTICR3_EXTI9 ((uint32_t)0x000000F0U) /*!< EXTI 9 configuration */
  4233. #define SYSCFG_EXTICR3_EXTI10 ((uint32_t)0x00000F00U) /*!< EXTI 10 configuration */
  4234. #define SYSCFG_EXTICR3_EXTI11 ((uint32_t)0x0000F000U) /*!< EXTI 11 configuration */
  4235. /**
  4236. * @brief EXTI8 configuration
  4237. */
  4238. #define SYSCFG_EXTICR3_EXTI8_PA ((uint32_t)0x00000000U) /*!< PA[8] pin */
  4239. #define SYSCFG_EXTICR3_EXTI8_PB ((uint32_t)0x00000001U) /*!< PB[8] pin */
  4240. #define SYSCFG_EXTICR3_EXTI8_PC ((uint32_t)0x00000002U) /*!< PC[8] pin */
  4241. #define SYSCFG_EXTICR3_EXTI8_PD ((uint32_t)0x00000003U) /*!< PD[8] pin */
  4242. #define SYSCFG_EXTICR3_EXTI8_PE ((uint32_t)0x00000004U) /*!< PE[8] pin */
  4243. /**
  4244. * @brief EXTI9 configuration
  4245. */
  4246. #define SYSCFG_EXTICR3_EXTI9_PA ((uint32_t)0x00000000U) /*!< PA[9] pin */
  4247. #define SYSCFG_EXTICR3_EXTI9_PB ((uint32_t)0x00000010U) /*!< PB[9] pin */
  4248. #define SYSCFG_EXTICR3_EXTI9_PC ((uint32_t)0x00000020U) /*!< PC[9] pin */
  4249. #define SYSCFG_EXTICR3_EXTI9_PD ((uint32_t)0x00000030U) /*!< PD[9] pin */
  4250. #define SYSCFG_EXTICR3_EXTI9_PE ((uint32_t)0x00000040U) /*!< PE[9] pin */
  4251. #define SYSCFG_EXTICR3_EXTI9_PF ((uint32_t)0x00000050U) /*!< PF[9] pin */
  4252. /**
  4253. * @brief EXTI10 configuration
  4254. */
  4255. #define SYSCFG_EXTICR3_EXTI10_PA ((uint32_t)0x00000000U) /*!< PA[10] pin */
  4256. #define SYSCFG_EXTICR3_EXTI10_PB ((uint32_t)0x00000100U) /*!< PB[10] pin */
  4257. #define SYSCFG_EXTICR3_EXTI10_PC ((uint32_t)0x00000200U) /*!< PC[10] pin */
  4258. #define SYSCFG_EXTICR3_EXTI10_PD ((uint32_t)0x00000300U) /*!< PD[10] pin */
  4259. #define SYSCFG_EXTICR3_EXTI10_PE ((uint32_t)0x00000400U) /*!< PE[10] pin */
  4260. #define SYSCFG_EXTICR3_EXTI10_PF ((uint32_t)0x00000500U) /*!< PF[10] pin */
  4261. /**
  4262. * @brief EXTI11 configuration
  4263. */
  4264. #define SYSCFG_EXTICR3_EXTI11_PA ((uint32_t)0x00000000U) /*!< PA[11] pin */
  4265. #define SYSCFG_EXTICR3_EXTI11_PB ((uint32_t)0x00001000U) /*!< PB[11] pin */
  4266. #define SYSCFG_EXTICR3_EXTI11_PC ((uint32_t)0x00002000U) /*!< PC[11] pin */
  4267. #define SYSCFG_EXTICR3_EXTI11_PD ((uint32_t)0x00003000U) /*!< PD[11] pin */
  4268. #define SYSCFG_EXTICR3_EXTI11_PE ((uint32_t)0x00004000U) /*!< PE[11] pin */
  4269. /***************** Bit definition for SYSCFG_EXTICR4 register **************/
  4270. #define SYSCFG_EXTICR4_EXTI12 ((uint32_t)0x0000000FU) /*!< EXTI 12 configuration */
  4271. #define SYSCFG_EXTICR4_EXTI13 ((uint32_t)0x000000F0U) /*!< EXTI 13 configuration */
  4272. #define SYSCFG_EXTICR4_EXTI14 ((uint32_t)0x00000F00U) /*!< EXTI 14 configuration */
  4273. #define SYSCFG_EXTICR4_EXTI15 ((uint32_t)0x0000F000U) /*!< EXTI 15 configuration */
  4274. /**
  4275. * @brief EXTI12 configuration
  4276. */
  4277. #define SYSCFG_EXTICR4_EXTI12_PA ((uint32_t)0x00000000U) /*!< PA[12] pin */
  4278. #define SYSCFG_EXTICR4_EXTI12_PB ((uint32_t)0x00000001U) /*!< PB[12] pin */
  4279. #define SYSCFG_EXTICR4_EXTI12_PC ((uint32_t)0x00000002U) /*!< PC[12] pin */
  4280. #define SYSCFG_EXTICR4_EXTI12_PD ((uint32_t)0x00000003U) /*!< PD[12] pin */
  4281. #define SYSCFG_EXTICR4_EXTI12_PE ((uint32_t)0x00000004U) /*!< PE[12] pin */
  4282. /**
  4283. * @brief EXTI13 configuration
  4284. */
  4285. #define SYSCFG_EXTICR4_EXTI13_PA ((uint32_t)0x00000000U) /*!< PA[13] pin */
  4286. #define SYSCFG_EXTICR4_EXTI13_PB ((uint32_t)0x00000010U) /*!< PB[13] pin */
  4287. #define SYSCFG_EXTICR4_EXTI13_PC ((uint32_t)0x00000020U) /*!< PC[13] pin */
  4288. #define SYSCFG_EXTICR4_EXTI13_PD ((uint32_t)0x00000030U) /*!< PD[13] pin */
  4289. #define SYSCFG_EXTICR4_EXTI13_PE ((uint32_t)0x00000040U) /*!< PE[13] pin */
  4290. /**
  4291. * @brief EXTI14 configuration
  4292. */
  4293. #define SYSCFG_EXTICR4_EXTI14_PA ((uint32_t)0x00000000U) /*!< PA[14] pin */
  4294. #define SYSCFG_EXTICR4_EXTI14_PB ((uint32_t)0x00000100U) /*!< PB[14] pin */
  4295. #define SYSCFG_EXTICR4_EXTI14_PC ((uint32_t)0x00000200U) /*!< PC[14] pin */
  4296. #define SYSCFG_EXTICR4_EXTI14_PD ((uint32_t)0x00000300U) /*!< PD[14] pin */
  4297. #define SYSCFG_EXTICR4_EXTI14_PE ((uint32_t)0x00000400U) /*!< PE[14] pin */
  4298. /**
  4299. * @brief EXTI15 configuration
  4300. */
  4301. #define SYSCFG_EXTICR4_EXTI15_PA ((uint32_t)0x00000000U) /*!< PA[15] pin */
  4302. #define SYSCFG_EXTICR4_EXTI15_PB ((uint32_t)0x00001000U) /*!< PB[15] pin */
  4303. #define SYSCFG_EXTICR4_EXTI15_PC ((uint32_t)0x00002000U) /*!< PC[15] pin */
  4304. #define SYSCFG_EXTICR4_EXTI15_PD ((uint32_t)0x00003000U) /*!< PD[15] pin */
  4305. #define SYSCFG_EXTICR4_EXTI15_PE ((uint32_t)0x00004000U) /*!< PE[15] pin */
  4306. /***************** Bit definition for SYSCFG_CFGR2 register ****************/
  4307. #define SYSCFG_CFGR2_LOCKUP_LOCK ((uint32_t)0x00000001U) /*!< Enables and locks the LOCKUP (Hardfault) output of CortexM0 with Break Input of TIMER1 */
  4308. #define SYSCFG_CFGR2_SRAM_PARITY_LOCK ((uint32_t)0x00000002U) /*!< Enables and locks the SRAM_PARITY error signal with Break Input of TIMER1 */
  4309. #define SYSCFG_CFGR2_PVD_LOCK ((uint32_t)0x00000004U) /*!< Enables and locks the PVD connection with Timer1 Break Input and also the PVD_EN and PVDSEL[2:0] bits of the Power Control Interface */
  4310. #define SYSCFG_CFGR2_SRAM_PEF ((uint32_t)0x00000100U) /*!< SRAM Parity error flag */
  4311. #define SYSCFG_CFGR2_SRAM_PE SYSCFG_CFGR2_SRAM_PEF /*!< SRAM Parity error flag (define maintained for legacy purpose) */
  4312. /*****************************************************************************/
  4313. /* */
  4314. /* Timers (TIM) */
  4315. /* */
  4316. /*****************************************************************************/
  4317. /******************* Bit definition for TIM_CR1 register *******************/
  4318. #define TIM_CR1_CEN ((uint32_t)0x00000001U) /*!<Counter enable */
  4319. #define TIM_CR1_UDIS ((uint32_t)0x00000002U) /*!<Update disable */
  4320. #define TIM_CR1_URS ((uint32_t)0x00000004U) /*!<Update request source */
  4321. #define TIM_CR1_OPM ((uint32_t)0x00000008U) /*!<One pulse mode */
  4322. #define TIM_CR1_DIR ((uint32_t)0x00000010U) /*!<Direction */
  4323. #define TIM_CR1_CMS ((uint32_t)0x00000060U) /*!<CMS[1:0] bits (Center-aligned mode selection) */
  4324. #define TIM_CR1_CMS_0 ((uint32_t)0x00000020U) /*!<Bit 0 */
  4325. #define TIM_CR1_CMS_1 ((uint32_t)0x00000040U) /*!<Bit 1 */
  4326. #define TIM_CR1_ARPE ((uint32_t)0x00000080U) /*!<Auto-reload preload enable */
  4327. #define TIM_CR1_CKD ((uint32_t)0x00000300U) /*!<CKD[1:0] bits (clock division) */
  4328. #define TIM_CR1_CKD_0 ((uint32_t)0x00000100U) /*!<Bit 0 */
  4329. #define TIM_CR1_CKD_1 ((uint32_t)0x00000200U) /*!<Bit 1 */
  4330. /******************* Bit definition for TIM_CR2 register *******************/
  4331. #define TIM_CR2_CCPC ((uint32_t)0x00000001U) /*!<Capture/Compare Preloaded Control */
  4332. #define TIM_CR2_CCUS ((uint32_t)0x00000004U) /*!<Capture/Compare Control Update Selection */
  4333. #define TIM_CR2_CCDS ((uint32_t)0x00000008U) /*!<Capture/Compare DMA Selection */
  4334. #define TIM_CR2_MMS ((uint32_t)0x00000070U) /*!<MMS[2:0] bits (Master Mode Selection) */
  4335. #define TIM_CR2_MMS_0 ((uint32_t)0x00000010U) /*!<Bit 0 */
  4336. #define TIM_CR2_MMS_1 ((uint32_t)0x00000020U) /*!<Bit 1 */
  4337. #define TIM_CR2_MMS_2 ((uint32_t)0x00000040U) /*!<Bit 2 */
  4338. #define TIM_CR2_TI1S ((uint32_t)0x00000080U) /*!<TI1 Selection */
  4339. #define TIM_CR2_OIS1 ((uint32_t)0x00000100U) /*!<Output Idle state 1 (OC1 output) */
  4340. #define TIM_CR2_OIS1N ((uint32_t)0x00000200U) /*!<Output Idle state 1 (OC1N output) */
  4341. #define TIM_CR2_OIS2 ((uint32_t)0x00000400U) /*!<Output Idle state 2 (OC2 output) */
  4342. #define TIM_CR2_OIS2N ((uint32_t)0x00000800U) /*!<Output Idle state 2 (OC2N output) */
  4343. #define TIM_CR2_OIS3 ((uint32_t)0x00001000U) /*!<Output Idle state 3 (OC3 output) */
  4344. #define TIM_CR2_OIS3N ((uint32_t)0x00002000U) /*!<Output Idle state 3 (OC3N output) */
  4345. #define TIM_CR2_OIS4 ((uint32_t)0x00004000U) /*!<Output Idle state 4 (OC4 output) */
  4346. /******************* Bit definition for TIM_SMCR register ******************/
  4347. #define TIM_SMCR_SMS ((uint32_t)0x00000007U) /*!<SMS[2:0] bits (Slave mode selection) */
  4348. #define TIM_SMCR_SMS_0 ((uint32_t)0x00000001U) /*!<Bit 0 */
  4349. #define TIM_SMCR_SMS_1 ((uint32_t)0x00000002U) /*!<Bit 1 */
  4350. #define TIM_SMCR_SMS_2 ((uint32_t)0x00000004U) /*!<Bit 2 */
  4351. #define TIM_SMCR_OCCS ((uint32_t)0x00000008U) /*!< OCREF clear selection */
  4352. #define TIM_SMCR_TS ((uint32_t)0x00000070U) /*!<TS[2:0] bits (Trigger selection) */
  4353. #define TIM_SMCR_TS_0 ((uint32_t)0x00000010U) /*!<Bit 0 */
  4354. #define TIM_SMCR_TS_1 ((uint32_t)0x00000020U) /*!<Bit 1 */
  4355. #define TIM_SMCR_TS_2 ((uint32_t)0x00000040U) /*!<Bit 2 */
  4356. #define TIM_SMCR_MSM ((uint32_t)0x00000080U) /*!<Master/slave mode */
  4357. #define TIM_SMCR_ETF ((uint32_t)0x00000F00U) /*!<ETF[3:0] bits (External trigger filter) */
  4358. #define TIM_SMCR_ETF_0 ((uint32_t)0x00000100U) /*!<Bit 0 */
  4359. #define TIM_SMCR_ETF_1 ((uint32_t)0x00000200U) /*!<Bit 1 */
  4360. #define TIM_SMCR_ETF_2 ((uint32_t)0x00000400U) /*!<Bit 2 */
  4361. #define TIM_SMCR_ETF_3 ((uint32_t)0x00000800U) /*!<Bit 3 */
  4362. #define TIM_SMCR_ETPS ((uint32_t)0x00003000U) /*!<ETPS[1:0] bits (External trigger prescaler) */
  4363. #define TIM_SMCR_ETPS_0 ((uint32_t)0x00001000U) /*!<Bit 0 */
  4364. #define TIM_SMCR_ETPS_1 ((uint32_t)0x00002000U) /*!<Bit 1 */
  4365. #define TIM_SMCR_ECE ((uint32_t)0x00004000U) /*!<External clock enable */
  4366. #define TIM_SMCR_ETP ((uint32_t)0x00008000U) /*!<External trigger polarity */
  4367. /******************* Bit definition for TIM_DIER register ******************/
  4368. #define TIM_DIER_UIE ((uint32_t)0x00000001U) /*!<Update interrupt enable */
  4369. #define TIM_DIER_CC1IE ((uint32_t)0x00000002U) /*!<Capture/Compare 1 interrupt enable */
  4370. #define TIM_DIER_CC2IE ((uint32_t)0x00000004U) /*!<Capture/Compare 2 interrupt enable */
  4371. #define TIM_DIER_CC3IE ((uint32_t)0x00000008U) /*!<Capture/Compare 3 interrupt enable */
  4372. #define TIM_DIER_CC4IE ((uint32_t)0x00000010U) /*!<Capture/Compare 4 interrupt enable */
  4373. #define TIM_DIER_COMIE ((uint32_t)0x00000020U) /*!<COM interrupt enable */
  4374. #define TIM_DIER_TIE ((uint32_t)0x00000040U) /*!<Trigger interrupt enable */
  4375. #define TIM_DIER_BIE ((uint32_t)0x00000080U) /*!<Break interrupt enable */
  4376. #define TIM_DIER_UDE ((uint32_t)0x00000100U) /*!<Update DMA request enable */
  4377. #define TIM_DIER_CC1DE ((uint32_t)0x00000200U) /*!<Capture/Compare 1 DMA request enable */
  4378. #define TIM_DIER_CC2DE ((uint32_t)0x00000400U) /*!<Capture/Compare 2 DMA request enable */
  4379. #define TIM_DIER_CC3DE ((uint32_t)0x00000800U) /*!<Capture/Compare 3 DMA request enable */
  4380. #define TIM_DIER_CC4DE ((uint32_t)0x00001000U) /*!<Capture/Compare 4 DMA request enable */
  4381. #define TIM_DIER_COMDE ((uint32_t)0x00002000U) /*!<COM DMA request enable */
  4382. #define TIM_DIER_TDE ((uint32_t)0x00004000U) /*!<Trigger DMA request enable */
  4383. /******************** Bit definition for TIM_SR register *******************/
  4384. #define TIM_SR_UIF ((uint32_t)0x00000001U) /*!<Update interrupt Flag */
  4385. #define TIM_SR_CC1IF ((uint32_t)0x00000002U) /*!<Capture/Compare 1 interrupt Flag */
  4386. #define TIM_SR_CC2IF ((uint32_t)0x00000004U) /*!<Capture/Compare 2 interrupt Flag */
  4387. #define TIM_SR_CC3IF ((uint32_t)0x00000008U) /*!<Capture/Compare 3 interrupt Flag */
  4388. #define TIM_SR_CC4IF ((uint32_t)0x00000010U) /*!<Capture/Compare 4 interrupt Flag */
  4389. #define TIM_SR_COMIF ((uint32_t)0x00000020U) /*!<COM interrupt Flag */
  4390. #define TIM_SR_TIF ((uint32_t)0x00000040U) /*!<Trigger interrupt Flag */
  4391. #define TIM_SR_BIF ((uint32_t)0x00000080U) /*!<Break interrupt Flag */
  4392. #define TIM_SR_CC1OF ((uint32_t)0x00000200U) /*!<Capture/Compare 1 Overcapture Flag */
  4393. #define TIM_SR_CC2OF ((uint32_t)0x00000400U) /*!<Capture/Compare 2 Overcapture Flag */
  4394. #define TIM_SR_CC3OF ((uint32_t)0x00000800U) /*!<Capture/Compare 3 Overcapture Flag */
  4395. #define TIM_SR_CC4OF ((uint32_t)0x00001000U) /*!<Capture/Compare 4 Overcapture Flag */
  4396. /******************* Bit definition for TIM_EGR register *******************/
  4397. #define TIM_EGR_UG ((uint32_t)0x00000001U) /*!<Update Generation */
  4398. #define TIM_EGR_CC1G ((uint32_t)0x00000002U) /*!<Capture/Compare 1 Generation */
  4399. #define TIM_EGR_CC2G ((uint32_t)0x00000004U) /*!<Capture/Compare 2 Generation */
  4400. #define TIM_EGR_CC3G ((uint32_t)0x00000008U) /*!<Capture/Compare 3 Generation */
  4401. #define TIM_EGR_CC4G ((uint32_t)0x00000010U) /*!<Capture/Compare 4 Generation */
  4402. #define TIM_EGR_COMG ((uint32_t)0x00000020U) /*!<Capture/Compare Control Update Generation */
  4403. #define TIM_EGR_TG ((uint32_t)0x00000040U) /*!<Trigger Generation */
  4404. #define TIM_EGR_BG ((uint32_t)0x00000080U) /*!<Break Generation */
  4405. /****************** Bit definition for TIM_CCMR1 register ******************/
  4406. #define TIM_CCMR1_CC1S ((uint32_t)0x00000003U) /*!<CC1S[1:0] bits (Capture/Compare 1 Selection) */
  4407. #define TIM_CCMR1_CC1S_0 ((uint32_t)0x00000001U) /*!<Bit 0 */
  4408. #define TIM_CCMR1_CC1S_1 ((uint32_t)0x00000002U) /*!<Bit 1 */
  4409. #define TIM_CCMR1_OC1FE ((uint32_t)0x00000004U) /*!<Output Compare 1 Fast enable */
  4410. #define TIM_CCMR1_OC1PE ((uint32_t)0x00000008U) /*!<Output Compare 1 Preload enable */
  4411. #define TIM_CCMR1_OC1M ((uint32_t)0x00000070U) /*!<OC1M[2:0] bits (Output Compare 1 Mode) */
  4412. #define TIM_CCMR1_OC1M_0 ((uint32_t)0x00000010U) /*!<Bit 0 */
  4413. #define TIM_CCMR1_OC1M_1 ((uint32_t)0x00000020U) /*!<Bit 1 */
  4414. #define TIM_CCMR1_OC1M_2 ((uint32_t)0x00000040U) /*!<Bit 2 */
  4415. #define TIM_CCMR1_OC1CE ((uint32_t)0x00000080U) /*!<Output Compare 1Clear Enable */
  4416. #define TIM_CCMR1_CC2S ((uint32_t)0x00000300U) /*!<CC2S[1:0] bits (Capture/Compare 2 Selection) */
  4417. #define TIM_CCMR1_CC2S_0 ((uint32_t)0x00000100U) /*!<Bit 0 */
  4418. #define TIM_CCMR1_CC2S_1 ((uint32_t)0x00000200U) /*!<Bit 1 */
  4419. #define TIM_CCMR1_OC2FE ((uint32_t)0x00000400U) /*!<Output Compare 2 Fast enable */
  4420. #define TIM_CCMR1_OC2PE ((uint32_t)0x00000800U) /*!<Output Compare 2 Preload enable */
  4421. #define TIM_CCMR1_OC2M ((uint32_t)0x00007000U) /*!<OC2M[2:0] bits (Output Compare 2 Mode) */
  4422. #define TIM_CCMR1_OC2M_0 ((uint32_t)0x00001000U) /*!<Bit 0 */
  4423. #define TIM_CCMR1_OC2M_1 ((uint32_t)0x00002000U) /*!<Bit 1 */
  4424. #define TIM_CCMR1_OC2M_2 ((uint32_t)0x00004000U) /*!<Bit 2 */
  4425. #define TIM_CCMR1_OC2CE ((uint32_t)0x00008000U) /*!<Output Compare 2 Clear Enable */
  4426. /*---------------------------------------------------------------------------*/
  4427. #define TIM_CCMR1_IC1PSC ((uint32_t)0x0000000CU) /*!<IC1PSC[1:0] bits (Input Capture 1 Prescaler) */
  4428. #define TIM_CCMR1_IC1PSC_0 ((uint32_t)0x00000004U) /*!<Bit 0 */
  4429. #define TIM_CCMR1_IC1PSC_1 ((uint32_t)0x00000008U) /*!<Bit 1 */
  4430. #define TIM_CCMR1_IC1F ((uint32_t)0x000000F0U) /*!<IC1F[3:0] bits (Input Capture 1 Filter) */
  4431. #define TIM_CCMR1_IC1F_0 ((uint32_t)0x00000010U) /*!<Bit 0 */
  4432. #define TIM_CCMR1_IC1F_1 ((uint32_t)0x00000020U) /*!<Bit 1 */
  4433. #define TIM_CCMR1_IC1F_2 ((uint32_t)0x00000040U) /*!<Bit 2 */
  4434. #define TIM_CCMR1_IC1F_3 ((uint32_t)0x00000080U) /*!<Bit 3 */
  4435. #define TIM_CCMR1_IC2PSC ((uint32_t)0x00000C00U) /*!<IC2PSC[1:0] bits (Input Capture 2 Prescaler) */
  4436. #define TIM_CCMR1_IC2PSC_0 ((uint32_t)0x00000400U) /*!<Bit 0 */
  4437. #define TIM_CCMR1_IC2PSC_1 ((uint32_t)0x00000800U) /*!<Bit 1 */
  4438. #define TIM_CCMR1_IC2F ((uint32_t)0x0000F000U) /*!<IC2F[3:0] bits (Input Capture 2 Filter) */
  4439. #define TIM_CCMR1_IC2F_0 ((uint32_t)0x00001000U) /*!<Bit 0 */
  4440. #define TIM_CCMR1_IC2F_1 ((uint32_t)0x00002000U) /*!<Bit 1 */
  4441. #define TIM_CCMR1_IC2F_2 ((uint32_t)0x00004000U) /*!<Bit 2 */
  4442. #define TIM_CCMR1_IC2F_3 ((uint32_t)0x00008000U) /*!<Bit 3 */
  4443. /****************** Bit definition for TIM_CCMR2 register ******************/
  4444. #define TIM_CCMR2_CC3S ((uint32_t)0x00000003U) /*!<CC3S[1:0] bits (Capture/Compare 3 Selection) */
  4445. #define TIM_CCMR2_CC3S_0 ((uint32_t)0x00000001U) /*!<Bit 0 */
  4446. #define TIM_CCMR2_CC3S_1 ((uint32_t)0x00000002U) /*!<Bit 1 */
  4447. #define TIM_CCMR2_OC3FE ((uint32_t)0x00000004U) /*!<Output Compare 3 Fast enable */
  4448. #define TIM_CCMR2_OC3PE ((uint32_t)0x00000008U) /*!<Output Compare 3 Preload enable */
  4449. #define TIM_CCMR2_OC3M ((uint32_t)0x00000070U) /*!<OC3M[2:0] bits (Output Compare 3 Mode) */
  4450. #define TIM_CCMR2_OC3M_0 ((uint32_t)0x00000010U) /*!<Bit 0 */
  4451. #define TIM_CCMR2_OC3M_1 ((uint32_t)0x00000020U) /*!<Bit 1 */
  4452. #define TIM_CCMR2_OC3M_2 ((uint32_t)0x00000040U) /*!<Bit 2 */
  4453. #define TIM_CCMR2_OC3CE ((uint32_t)0x00000080U) /*!<Output Compare 3 Clear Enable */
  4454. #define TIM_CCMR2_CC4S ((uint32_t)0x00000300U) /*!<CC4S[1:0] bits (Capture/Compare 4 Selection) */
  4455. #define TIM_CCMR2_CC4S_0 ((uint32_t)0x00000100U) /*!<Bit 0 */
  4456. #define TIM_CCMR2_CC4S_1 ((uint32_t)0x00000200U) /*!<Bit 1 */
  4457. #define TIM_CCMR2_OC4FE ((uint32_t)0x00000400U) /*!<Output Compare 4 Fast enable */
  4458. #define TIM_CCMR2_OC4PE ((uint32_t)0x00000800U) /*!<Output Compare 4 Preload enable */
  4459. #define TIM_CCMR2_OC4M ((uint32_t)0x00007000U) /*!<OC4M[2:0] bits (Output Compare 4 Mode) */
  4460. #define TIM_CCMR2_OC4M_0 ((uint32_t)0x00001000U) /*!<Bit 0 */
  4461. #define TIM_CCMR2_OC4M_1 ((uint32_t)0x00002000U) /*!<Bit 1 */
  4462. #define TIM_CCMR2_OC4M_2 ((uint32_t)0x00004000U) /*!<Bit 2 */
  4463. #define TIM_CCMR2_OC4CE ((uint32_t)0x00008000U) /*!<Output Compare 4 Clear Enable */
  4464. /*---------------------------------------------------------------------------*/
  4465. #define TIM_CCMR2_IC3PSC ((uint32_t)0x0000000CU) /*!<IC3PSC[1:0] bits (Input Capture 3 Prescaler) */
  4466. #define TIM_CCMR2_IC3PSC_0 ((uint32_t)0x00000004U) /*!<Bit 0 */
  4467. #define TIM_CCMR2_IC3PSC_1 ((uint32_t)0x00000008U) /*!<Bit 1 */
  4468. #define TIM_CCMR2_IC3F ((uint32_t)0x000000F0U) /*!<IC3F[3:0] bits (Input Capture 3 Filter) */
  4469. #define TIM_CCMR2_IC3F_0 ((uint32_t)0x00000010U) /*!<Bit 0 */
  4470. #define TIM_CCMR2_IC3F_1 ((uint32_t)0x00000020U) /*!<Bit 1 */
  4471. #define TIM_CCMR2_IC3F_2 ((uint32_t)0x00000040U) /*!<Bit 2 */
  4472. #define TIM_CCMR2_IC3F_3 ((uint32_t)0x00000080U) /*!<Bit 3 */
  4473. #define TIM_CCMR2_IC4PSC ((uint32_t)0x00000C00U) /*!<IC4PSC[1:0] bits (Input Capture 4 Prescaler) */
  4474. #define TIM_CCMR2_IC4PSC_0 ((uint32_t)0x00000400U) /*!<Bit 0 */
  4475. #define TIM_CCMR2_IC4PSC_1 ((uint32_t)0x00000800U) /*!<Bit 1 */
  4476. #define TIM_CCMR2_IC4F ((uint32_t)0x0000F000U) /*!<IC4F[3:0] bits (Input Capture 4 Filter) */
  4477. #define TIM_CCMR2_IC4F_0 ((uint32_t)0x00001000U) /*!<Bit 0 */
  4478. #define TIM_CCMR2_IC4F_1 ((uint32_t)0x00002000U) /*!<Bit 1 */
  4479. #define TIM_CCMR2_IC4F_2 ((uint32_t)0x00004000U) /*!<Bit 2 */
  4480. #define TIM_CCMR2_IC4F_3 ((uint32_t)0x00008000U) /*!<Bit 3 */
  4481. /******************* Bit definition for TIM_CCER register ******************/
  4482. #define TIM_CCER_CC1E ((uint32_t)0x00000001U) /*!<Capture/Compare 1 output enable */
  4483. #define TIM_CCER_CC1P ((uint32_t)0x00000002U) /*!<Capture/Compare 1 output Polarity */
  4484. #define TIM_CCER_CC1NE ((uint32_t)0x00000004U) /*!<Capture/Compare 1 Complementary output enable */
  4485. #define TIM_CCER_CC1NP ((uint32_t)0x00000008U) /*!<Capture/Compare 1 Complementary output Polarity */
  4486. #define TIM_CCER_CC2E ((uint32_t)0x00000010U) /*!<Capture/Compare 2 output enable */
  4487. #define TIM_CCER_CC2P ((uint32_t)0x00000020U) /*!<Capture/Compare 2 output Polarity */
  4488. #define TIM_CCER_CC2NE ((uint32_t)0x00000040U) /*!<Capture/Compare 2 Complementary output enable */
  4489. #define TIM_CCER_CC2NP ((uint32_t)0x00000080U) /*!<Capture/Compare 2 Complementary output Polarity */
  4490. #define TIM_CCER_CC3E ((uint32_t)0x00000100U) /*!<Capture/Compare 3 output enable */
  4491. #define TIM_CCER_CC3P ((uint32_t)0x00000200U) /*!<Capture/Compare 3 output Polarity */
  4492. #define TIM_CCER_CC3NE ((uint32_t)0x00000400U) /*!<Capture/Compare 3 Complementary output enable */
  4493. #define TIM_CCER_CC3NP ((uint32_t)0x00000800U) /*!<Capture/Compare 3 Complementary output Polarity */
  4494. #define TIM_CCER_CC4E ((uint32_t)0x00001000U) /*!<Capture/Compare 4 output enable */
  4495. #define TIM_CCER_CC4P ((uint32_t)0x00002000U) /*!<Capture/Compare 4 output Polarity */
  4496. #define TIM_CCER_CC4NP ((uint32_t)0x00008000U) /*!<Capture/Compare 4 Complementary output Polarity */
  4497. /******************* Bit definition for TIM_CNT register *******************/
  4498. #define TIM_CNT_CNT ((uint32_t)0xFFFFFFFFU) /*!<Counter Value */
  4499. /******************* Bit definition for TIM_PSC register *******************/
  4500. #define TIM_PSC_PSC ((uint32_t)0x0000FFFFU) /*!<Prescaler Value */
  4501. /******************* Bit definition for TIM_ARR register *******************/
  4502. #define TIM_ARR_ARR ((uint32_t)0xFFFFFFFFU) /*!<actual auto-reload Value */
  4503. /******************* Bit definition for TIM_RCR register *******************/
  4504. #define TIM_RCR_REP ((uint32_t)0x000000FFU) /*!<Repetition Counter Value */
  4505. /******************* Bit definition for TIM_CCR1 register ******************/
  4506. #define TIM_CCR1_CCR1 ((uint32_t)0x0000FFFFU) /*!<Capture/Compare 1 Value */
  4507. /******************* Bit definition for TIM_CCR2 register ******************/
  4508. #define TIM_CCR2_CCR2 ((uint32_t)0x0000FFFFU) /*!<Capture/Compare 2 Value */
  4509. /******************* Bit definition for TIM_CCR3 register ******************/
  4510. #define TIM_CCR3_CCR3 ((uint32_t)0x0000FFFFU) /*!<Capture/Compare 3 Value */
  4511. /******************* Bit definition for TIM_CCR4 register ******************/
  4512. #define TIM_CCR4_CCR4 ((uint32_t)0x0000FFFFU) /*!<Capture/Compare 4 Value */
  4513. /******************* Bit definition for TIM_BDTR register ******************/
  4514. #define TIM_BDTR_DTG ((uint32_t)0x000000FFU) /*!<DTG[0:7] bits (Dead-Time Generator set-up) */
  4515. #define TIM_BDTR_DTG_0 ((uint32_t)0x00000001U) /*!<Bit 0 */
  4516. #define TIM_BDTR_DTG_1 ((uint32_t)0x00000002U) /*!<Bit 1 */
  4517. #define TIM_BDTR_DTG_2 ((uint32_t)0x00000004U) /*!<Bit 2 */
  4518. #define TIM_BDTR_DTG_3 ((uint32_t)0x00000008U) /*!<Bit 3 */
  4519. #define TIM_BDTR_DTG_4 ((uint32_t)0x00000010U) /*!<Bit 4 */
  4520. #define TIM_BDTR_DTG_5 ((uint32_t)0x00000020U) /*!<Bit 5 */
  4521. #define TIM_BDTR_DTG_6 ((uint32_t)0x00000040U) /*!<Bit 6 */
  4522. #define TIM_BDTR_DTG_7 ((uint32_t)0x00000080U) /*!<Bit 7 */
  4523. #define TIM_BDTR_LOCK ((uint32_t)0x00000300U) /*!<LOCK[1:0] bits (Lock Configuration) */
  4524. #define TIM_BDTR_LOCK_0 ((uint32_t)0x00000100U) /*!<Bit 0 */
  4525. #define TIM_BDTR_LOCK_1 ((uint32_t)0x00000200U) /*!<Bit 1 */
  4526. #define TIM_BDTR_OSSI ((uint32_t)0x00000400U) /*!<Off-State Selection for Idle mode */
  4527. #define TIM_BDTR_OSSR ((uint32_t)0x00000800U) /*!<Off-State Selection for Run mode */
  4528. #define TIM_BDTR_BKE ((uint32_t)0x00001000U) /*!<Break enable */
  4529. #define TIM_BDTR_BKP ((uint32_t)0x00002000U) /*!<Break Polarity */
  4530. #define TIM_BDTR_AOE ((uint32_t)0x00004000U) /*!<Automatic Output enable */
  4531. #define TIM_BDTR_MOE ((uint32_t)0x00008000U) /*!<Main Output enable */
  4532. /******************* Bit definition for TIM_DCR register *******************/
  4533. #define TIM_DCR_DBA ((uint32_t)0x0000001FU) /*!<DBA[4:0] bits (DMA Base Address) */
  4534. #define TIM_DCR_DBA_0 ((uint32_t)0x00000001U) /*!<Bit 0 */
  4535. #define TIM_DCR_DBA_1 ((uint32_t)0x00000002U) /*!<Bit 1 */
  4536. #define TIM_DCR_DBA_2 ((uint32_t)0x00000004U) /*!<Bit 2 */
  4537. #define TIM_DCR_DBA_3 ((uint32_t)0x00000008U) /*!<Bit 3 */
  4538. #define TIM_DCR_DBA_4 ((uint32_t)0x00000010U) /*!<Bit 4 */
  4539. #define TIM_DCR_DBL ((uint32_t)0x00001F00U) /*!<DBL[4:0] bits (DMA Burst Length) */
  4540. #define TIM_DCR_DBL_0 ((uint32_t)0x00000100U) /*!<Bit 0 */
  4541. #define TIM_DCR_DBL_1 ((uint32_t)0x00000200U) /*!<Bit 1 */
  4542. #define TIM_DCR_DBL_2 ((uint32_t)0x00000400U) /*!<Bit 2 */
  4543. #define TIM_DCR_DBL_3 ((uint32_t)0x00000800U) /*!<Bit 3 */
  4544. #define TIM_DCR_DBL_4 ((uint32_t)0x00001000U) /*!<Bit 4 */
  4545. /******************* Bit definition for TIM_DMAR register ******************/
  4546. #define TIM_DMAR_DMAB ((uint32_t)0x0000FFFFU) /*!<DMA register for burst accesses */
  4547. /******************* Bit definition for TIM14_OR register ********************/
  4548. #define TIM14_OR_TI1_RMP ((uint32_t)0x00000003U) /*!<TI1_RMP[1:0] bits (TIM14 Input 4 remap) */
  4549. #define TIM14_OR_TI1_RMP_0 ((uint32_t)0x00000001U) /*!<Bit 0 */
  4550. #define TIM14_OR_TI1_RMP_1 ((uint32_t)0x00000002U) /*!<Bit 1 */
  4551. /******************************************************************************/
  4552. /* */
  4553. /* Touch Sensing Controller (TSC) */
  4554. /* */
  4555. /******************************************************************************/
  4556. /******************* Bit definition for TSC_CR register *********************/
  4557. #define TSC_CR_TSCE ((uint32_t)0x00000001U) /*!<Touch sensing controller enable */
  4558. #define TSC_CR_START ((uint32_t)0x00000002U) /*!<Start acquisition */
  4559. #define TSC_CR_AM ((uint32_t)0x00000004U) /*!<Acquisition mode */
  4560. #define TSC_CR_SYNCPOL ((uint32_t)0x00000008U) /*!<Synchronization pin polarity */
  4561. #define TSC_CR_IODEF ((uint32_t)0x00000010U) /*!<IO default mode */
  4562. #define TSC_CR_MCV ((uint32_t)0x000000E0U) /*!<MCV[2:0] bits (Max Count Value) */
  4563. #define TSC_CR_MCV_0 ((uint32_t)0x00000020U) /*!<Bit 0 */
  4564. #define TSC_CR_MCV_1 ((uint32_t)0x00000040U) /*!<Bit 1 */
  4565. #define TSC_CR_MCV_2 ((uint32_t)0x00000080U) /*!<Bit 2 */
  4566. #define TSC_CR_PGPSC ((uint32_t)0x00007000U) /*!<PGPSC[2:0] bits (Pulse Generator Prescaler) */
  4567. #define TSC_CR_PGPSC_0 ((uint32_t)0x00001000U) /*!<Bit 0 */
  4568. #define TSC_CR_PGPSC_1 ((uint32_t)0x00002000U) /*!<Bit 1 */
  4569. #define TSC_CR_PGPSC_2 ((uint32_t)0x00004000U) /*!<Bit 2 */
  4570. #define TSC_CR_SSPSC ((uint32_t)0x00008000U) /*!<Spread Spectrum Prescaler */
  4571. #define TSC_CR_SSE ((uint32_t)0x00010000U) /*!<Spread Spectrum Enable */
  4572. #define TSC_CR_SSD ((uint32_t)0x00FE0000U) /*!<SSD[6:0] bits (Spread Spectrum Deviation) */
  4573. #define TSC_CR_SSD_0 ((uint32_t)0x00020000U) /*!<Bit 0 */
  4574. #define TSC_CR_SSD_1 ((uint32_t)0x00040000U) /*!<Bit 1 */
  4575. #define TSC_CR_SSD_2 ((uint32_t)0x00080000U) /*!<Bit 2 */
  4576. #define TSC_CR_SSD_3 ((uint32_t)0x00100000U) /*!<Bit 3 */
  4577. #define TSC_CR_SSD_4 ((uint32_t)0x00200000U) /*!<Bit 4 */
  4578. #define TSC_CR_SSD_5 ((uint32_t)0x00400000U) /*!<Bit 5 */
  4579. #define TSC_CR_SSD_6 ((uint32_t)0x00800000U) /*!<Bit 6 */
  4580. #define TSC_CR_CTPL ((uint32_t)0x0F000000U) /*!<CTPL[3:0] bits (Charge Transfer pulse low) */
  4581. #define TSC_CR_CTPL_0 ((uint32_t)0x01000000U) /*!<Bit 0 */
  4582. #define TSC_CR_CTPL_1 ((uint32_t)0x02000000U) /*!<Bit 1 */
  4583. #define TSC_CR_CTPL_2 ((uint32_t)0x04000000U) /*!<Bit 2 */
  4584. #define TSC_CR_CTPL_3 ((uint32_t)0x08000000U) /*!<Bit 3 */
  4585. #define TSC_CR_CTPH ((uint32_t)0xF0000000U) /*!<CTPH[3:0] bits (Charge Transfer pulse high) */
  4586. #define TSC_CR_CTPH_0 ((uint32_t)0x10000000U) /*!<Bit 0 */
  4587. #define TSC_CR_CTPH_1 ((uint32_t)0x20000000U) /*!<Bit 1 */
  4588. #define TSC_CR_CTPH_2 ((uint32_t)0x40000000U) /*!<Bit 2 */
  4589. #define TSC_CR_CTPH_3 ((uint32_t)0x80000000U) /*!<Bit 3 */
  4590. /******************* Bit definition for TSC_IER register ********************/
  4591. #define TSC_IER_EOAIE ((uint32_t)0x00000001U) /*!<End of acquisition interrupt enable */
  4592. #define TSC_IER_MCEIE ((uint32_t)0x00000002U) /*!<Max count error interrupt enable */
  4593. /******************* Bit definition for TSC_ICR register ********************/
  4594. #define TSC_ICR_EOAIC ((uint32_t)0x00000001U) /*!<End of acquisition interrupt clear */
  4595. #define TSC_ICR_MCEIC ((uint32_t)0x00000002U) /*!<Max count error interrupt clear */
  4596. /******************* Bit definition for TSC_ISR register ********************/
  4597. #define TSC_ISR_EOAF ((uint32_t)0x00000001U) /*!<End of acquisition flag */
  4598. #define TSC_ISR_MCEF ((uint32_t)0x00000002U) /*!<Max count error flag */
  4599. /******************* Bit definition for TSC_IOHCR register ******************/
  4600. #define TSC_IOHCR_G1_IO1 ((uint32_t)0x00000001U) /*!<GROUP1_IO1 schmitt trigger hysteresis mode */
  4601. #define TSC_IOHCR_G1_IO2 ((uint32_t)0x00000002U) /*!<GROUP1_IO2 schmitt trigger hysteresis mode */
  4602. #define TSC_IOHCR_G1_IO3 ((uint32_t)0x00000004U) /*!<GROUP1_IO3 schmitt trigger hysteresis mode */
  4603. #define TSC_IOHCR_G1_IO4 ((uint32_t)0x00000008U) /*!<GROUP1_IO4 schmitt trigger hysteresis mode */
  4604. #define TSC_IOHCR_G2_IO1 ((uint32_t)0x00000010U) /*!<GROUP2_IO1 schmitt trigger hysteresis mode */
  4605. #define TSC_IOHCR_G2_IO2 ((uint32_t)0x00000020U) /*!<GROUP2_IO2 schmitt trigger hysteresis mode */
  4606. #define TSC_IOHCR_G2_IO3 ((uint32_t)0x00000040U) /*!<GROUP2_IO3 schmitt trigger hysteresis mode */
  4607. #define TSC_IOHCR_G2_IO4 ((uint32_t)0x00000080U) /*!<GROUP2_IO4 schmitt trigger hysteresis mode */
  4608. #define TSC_IOHCR_G3_IO1 ((uint32_t)0x00000100U) /*!<GROUP3_IO1 schmitt trigger hysteresis mode */
  4609. #define TSC_IOHCR_G3_IO2 ((uint32_t)0x00000200U) /*!<GROUP3_IO2 schmitt trigger hysteresis mode */
  4610. #define TSC_IOHCR_G3_IO3 ((uint32_t)0x00000400U) /*!<GROUP3_IO3 schmitt trigger hysteresis mode */
  4611. #define TSC_IOHCR_G3_IO4 ((uint32_t)0x00000800U) /*!<GROUP3_IO4 schmitt trigger hysteresis mode */
  4612. #define TSC_IOHCR_G4_IO1 ((uint32_t)0x00001000U) /*!<GROUP4_IO1 schmitt trigger hysteresis mode */
  4613. #define TSC_IOHCR_G4_IO2 ((uint32_t)0x00002000U) /*!<GROUP4_IO2 schmitt trigger hysteresis mode */
  4614. #define TSC_IOHCR_G4_IO3 ((uint32_t)0x00004000U) /*!<GROUP4_IO3 schmitt trigger hysteresis mode */
  4615. #define TSC_IOHCR_G4_IO4 ((uint32_t)0x00008000U) /*!<GROUP4_IO4 schmitt trigger hysteresis mode */
  4616. #define TSC_IOHCR_G5_IO1 ((uint32_t)0x00010000U) /*!<GROUP5_IO1 schmitt trigger hysteresis mode */
  4617. #define TSC_IOHCR_G5_IO2 ((uint32_t)0x00020000U) /*!<GROUP5_IO2 schmitt trigger hysteresis mode */
  4618. #define TSC_IOHCR_G5_IO3 ((uint32_t)0x00040000U) /*!<GROUP5_IO3 schmitt trigger hysteresis mode */
  4619. #define TSC_IOHCR_G5_IO4 ((uint32_t)0x00080000U) /*!<GROUP5_IO4 schmitt trigger hysteresis mode */
  4620. #define TSC_IOHCR_G6_IO1 ((uint32_t)0x00100000U) /*!<GROUP6_IO1 schmitt trigger hysteresis mode */
  4621. #define TSC_IOHCR_G6_IO2 ((uint32_t)0x00200000U) /*!<GROUP6_IO2 schmitt trigger hysteresis mode */
  4622. #define TSC_IOHCR_G6_IO3 ((uint32_t)0x00400000U) /*!<GROUP6_IO3 schmitt trigger hysteresis mode */
  4623. #define TSC_IOHCR_G6_IO4 ((uint32_t)0x00800000U) /*!<GROUP6_IO4 schmitt trigger hysteresis mode */
  4624. #define TSC_IOHCR_G7_IO1 ((uint32_t)0x01000000U) /*!<GROUP7_IO1 schmitt trigger hysteresis mode */
  4625. #define TSC_IOHCR_G7_IO2 ((uint32_t)0x02000000U) /*!<GROUP7_IO2 schmitt trigger hysteresis mode */
  4626. #define TSC_IOHCR_G7_IO3 ((uint32_t)0x04000000U) /*!<GROUP7_IO3 schmitt trigger hysteresis mode */
  4627. #define TSC_IOHCR_G7_IO4 ((uint32_t)0x08000000U) /*!<GROUP7_IO4 schmitt trigger hysteresis mode */
  4628. #define TSC_IOHCR_G8_IO1 ((uint32_t)0x10000000U) /*!<GROUP8_IO1 schmitt trigger hysteresis mode */
  4629. #define TSC_IOHCR_G8_IO2 ((uint32_t)0x20000000U) /*!<GROUP8_IO2 schmitt trigger hysteresis mode */
  4630. #define TSC_IOHCR_G8_IO3 ((uint32_t)0x40000000U) /*!<GROUP8_IO3 schmitt trigger hysteresis mode */
  4631. #define TSC_IOHCR_G8_IO4 ((uint32_t)0x80000000U) /*!<GROUP8_IO4 schmitt trigger hysteresis mode */
  4632. /******************* Bit definition for TSC_IOASCR register *****************/
  4633. #define TSC_IOASCR_G1_IO1 ((uint32_t)0x00000001U) /*!<GROUP1_IO1 analog switch enable */
  4634. #define TSC_IOASCR_G1_IO2 ((uint32_t)0x00000002U) /*!<GROUP1_IO2 analog switch enable */
  4635. #define TSC_IOASCR_G1_IO3 ((uint32_t)0x00000004U) /*!<GROUP1_IO3 analog switch enable */
  4636. #define TSC_IOASCR_G1_IO4 ((uint32_t)0x00000008U) /*!<GROUP1_IO4 analog switch enable */
  4637. #define TSC_IOASCR_G2_IO1 ((uint32_t)0x00000010U) /*!<GROUP2_IO1 analog switch enable */
  4638. #define TSC_IOASCR_G2_IO2 ((uint32_t)0x00000020U) /*!<GROUP2_IO2 analog switch enable */
  4639. #define TSC_IOASCR_G2_IO3 ((uint32_t)0x00000040U) /*!<GROUP2_IO3 analog switch enable */
  4640. #define TSC_IOASCR_G2_IO4 ((uint32_t)0x00000080U) /*!<GROUP2_IO4 analog switch enable */
  4641. #define TSC_IOASCR_G3_IO1 ((uint32_t)0x00000100U) /*!<GROUP3_IO1 analog switch enable */
  4642. #define TSC_IOASCR_G3_IO2 ((uint32_t)0x00000200U) /*!<GROUP3_IO2 analog switch enable */
  4643. #define TSC_IOASCR_G3_IO3 ((uint32_t)0x00000400U) /*!<GROUP3_IO3 analog switch enable */
  4644. #define TSC_IOASCR_G3_IO4 ((uint32_t)0x00000800U) /*!<GROUP3_IO4 analog switch enable */
  4645. #define TSC_IOASCR_G4_IO1 ((uint32_t)0x00001000U) /*!<GROUP4_IO1 analog switch enable */
  4646. #define TSC_IOASCR_G4_IO2 ((uint32_t)0x00002000U) /*!<GROUP4_IO2 analog switch enable */
  4647. #define TSC_IOASCR_G4_IO3 ((uint32_t)0x00004000U) /*!<GROUP4_IO3 analog switch enable */
  4648. #define TSC_IOASCR_G4_IO4 ((uint32_t)0x00008000U) /*!<GROUP4_IO4 analog switch enable */
  4649. #define TSC_IOASCR_G5_IO1 ((uint32_t)0x00010000U) /*!<GROUP5_IO1 analog switch enable */
  4650. #define TSC_IOASCR_G5_IO2 ((uint32_t)0x00020000U) /*!<GROUP5_IO2 analog switch enable */
  4651. #define TSC_IOASCR_G5_IO3 ((uint32_t)0x00040000U) /*!<GROUP5_IO3 analog switch enable */
  4652. #define TSC_IOASCR_G5_IO4 ((uint32_t)0x00080000U) /*!<GROUP5_IO4 analog switch enable */
  4653. #define TSC_IOASCR_G6_IO1 ((uint32_t)0x00100000U) /*!<GROUP6_IO1 analog switch enable */
  4654. #define TSC_IOASCR_G6_IO2 ((uint32_t)0x00200000U) /*!<GROUP6_IO2 analog switch enable */
  4655. #define TSC_IOASCR_G6_IO3 ((uint32_t)0x00400000U) /*!<GROUP6_IO3 analog switch enable */
  4656. #define TSC_IOASCR_G6_IO4 ((uint32_t)0x00800000U) /*!<GROUP6_IO4 analog switch enable */
  4657. #define TSC_IOASCR_G7_IO1 ((uint32_t)0x01000000U) /*!<GROUP7_IO1 analog switch enable */
  4658. #define TSC_IOASCR_G7_IO2 ((uint32_t)0x02000000U) /*!<GROUP7_IO2 analog switch enable */
  4659. #define TSC_IOASCR_G7_IO3 ((uint32_t)0x04000000U) /*!<GROUP7_IO3 analog switch enable */
  4660. #define TSC_IOASCR_G7_IO4 ((uint32_t)0x08000000U) /*!<GROUP7_IO4 analog switch enable */
  4661. #define TSC_IOASCR_G8_IO1 ((uint32_t)0x10000000U) /*!<GROUP8_IO1 analog switch enable */
  4662. #define TSC_IOASCR_G8_IO2 ((uint32_t)0x20000000U) /*!<GROUP8_IO2 analog switch enable */
  4663. #define TSC_IOASCR_G8_IO3 ((uint32_t)0x40000000U) /*!<GROUP8_IO3 analog switch enable */
  4664. #define TSC_IOASCR_G8_IO4 ((uint32_t)0x80000000U) /*!<GROUP8_IO4 analog switch enable */
  4665. /******************* Bit definition for TSC_IOSCR register ******************/
  4666. #define TSC_IOSCR_G1_IO1 ((uint32_t)0x00000001U) /*!<GROUP1_IO1 sampling mode */
  4667. #define TSC_IOSCR_G1_IO2 ((uint32_t)0x00000002U) /*!<GROUP1_IO2 sampling mode */
  4668. #define TSC_IOSCR_G1_IO3 ((uint32_t)0x00000004U) /*!<GROUP1_IO3 sampling mode */
  4669. #define TSC_IOSCR_G1_IO4 ((uint32_t)0x00000008U) /*!<GROUP1_IO4 sampling mode */
  4670. #define TSC_IOSCR_G2_IO1 ((uint32_t)0x00000010U) /*!<GROUP2_IO1 sampling mode */
  4671. #define TSC_IOSCR_G2_IO2 ((uint32_t)0x00000020U) /*!<GROUP2_IO2 sampling mode */
  4672. #define TSC_IOSCR_G2_IO3 ((uint32_t)0x00000040U) /*!<GROUP2_IO3 sampling mode */
  4673. #define TSC_IOSCR_G2_IO4 ((uint32_t)0x00000080U) /*!<GROUP2_IO4 sampling mode */
  4674. #define TSC_IOSCR_G3_IO1 ((uint32_t)0x00000100U) /*!<GROUP3_IO1 sampling mode */
  4675. #define TSC_IOSCR_G3_IO2 ((uint32_t)0x00000200U) /*!<GROUP3_IO2 sampling mode */
  4676. #define TSC_IOSCR_G3_IO3 ((uint32_t)0x00000400U) /*!<GROUP3_IO3 sampling mode */
  4677. #define TSC_IOSCR_G3_IO4 ((uint32_t)0x00000800U) /*!<GROUP3_IO4 sampling mode */
  4678. #define TSC_IOSCR_G4_IO1 ((uint32_t)0x00001000U) /*!<GROUP4_IO1 sampling mode */
  4679. #define TSC_IOSCR_G4_IO2 ((uint32_t)0x00002000U) /*!<GROUP4_IO2 sampling mode */
  4680. #define TSC_IOSCR_G4_IO3 ((uint32_t)0x00004000U) /*!<GROUP4_IO3 sampling mode */
  4681. #define TSC_IOSCR_G4_IO4 ((uint32_t)0x00008000U) /*!<GROUP4_IO4 sampling mode */
  4682. #define TSC_IOSCR_G5_IO1 ((uint32_t)0x00010000U) /*!<GROUP5_IO1 sampling mode */
  4683. #define TSC_IOSCR_G5_IO2 ((uint32_t)0x00020000U) /*!<GROUP5_IO2 sampling mode */
  4684. #define TSC_IOSCR_G5_IO3 ((uint32_t)0x00040000U) /*!<GROUP5_IO3 sampling mode */
  4685. #define TSC_IOSCR_G5_IO4 ((uint32_t)0x00080000U) /*!<GROUP5_IO4 sampling mode */
  4686. #define TSC_IOSCR_G6_IO1 ((uint32_t)0x00100000U) /*!<GROUP6_IO1 sampling mode */
  4687. #define TSC_IOSCR_G6_IO2 ((uint32_t)0x00200000U) /*!<GROUP6_IO2 sampling mode */
  4688. #define TSC_IOSCR_G6_IO3 ((uint32_t)0x00400000U) /*!<GROUP6_IO3 sampling mode */
  4689. #define TSC_IOSCR_G6_IO4 ((uint32_t)0x00800000U) /*!<GROUP6_IO4 sampling mode */
  4690. #define TSC_IOSCR_G7_IO1 ((uint32_t)0x01000000U) /*!<GROUP7_IO1 sampling mode */
  4691. #define TSC_IOSCR_G7_IO2 ((uint32_t)0x02000000U) /*!<GROUP7_IO2 sampling mode */
  4692. #define TSC_IOSCR_G7_IO3 ((uint32_t)0x04000000U) /*!<GROUP7_IO3 sampling mode */
  4693. #define TSC_IOSCR_G7_IO4 ((uint32_t)0x08000000U) /*!<GROUP7_IO4 sampling mode */
  4694. #define TSC_IOSCR_G8_IO1 ((uint32_t)0x10000000U) /*!<GROUP8_IO1 sampling mode */
  4695. #define TSC_IOSCR_G8_IO2 ((uint32_t)0x20000000U) /*!<GROUP8_IO2 sampling mode */
  4696. #define TSC_IOSCR_G8_IO3 ((uint32_t)0x40000000U) /*!<GROUP8_IO3 sampling mode */
  4697. #define TSC_IOSCR_G8_IO4 ((uint32_t)0x80000000U) /*!<GROUP8_IO4 sampling mode */
  4698. /******************* Bit definition for TSC_IOCCR register ******************/
  4699. #define TSC_IOCCR_G1_IO1 ((uint32_t)0x00000001U) /*!<GROUP1_IO1 channel mode */
  4700. #define TSC_IOCCR_G1_IO2 ((uint32_t)0x00000002U) /*!<GROUP1_IO2 channel mode */
  4701. #define TSC_IOCCR_G1_IO3 ((uint32_t)0x00000004U) /*!<GROUP1_IO3 channel mode */
  4702. #define TSC_IOCCR_G1_IO4 ((uint32_t)0x00000008U) /*!<GROUP1_IO4 channel mode */
  4703. #define TSC_IOCCR_G2_IO1 ((uint32_t)0x00000010U) /*!<GROUP2_IO1 channel mode */
  4704. #define TSC_IOCCR_G2_IO2 ((uint32_t)0x00000020U) /*!<GROUP2_IO2 channel mode */
  4705. #define TSC_IOCCR_G2_IO3 ((uint32_t)0x00000040U) /*!<GROUP2_IO3 channel mode */
  4706. #define TSC_IOCCR_G2_IO4 ((uint32_t)0x00000080U) /*!<GROUP2_IO4 channel mode */
  4707. #define TSC_IOCCR_G3_IO1 ((uint32_t)0x00000100U) /*!<GROUP3_IO1 channel mode */
  4708. #define TSC_IOCCR_G3_IO2 ((uint32_t)0x00000200U) /*!<GROUP3_IO2 channel mode */
  4709. #define TSC_IOCCR_G3_IO3 ((uint32_t)0x00000400U) /*!<GROUP3_IO3 channel mode */
  4710. #define TSC_IOCCR_G3_IO4 ((uint32_t)0x00000800U) /*!<GROUP3_IO4 channel mode */
  4711. #define TSC_IOCCR_G4_IO1 ((uint32_t)0x00001000U) /*!<GROUP4_IO1 channel mode */
  4712. #define TSC_IOCCR_G4_IO2 ((uint32_t)0x00002000U) /*!<GROUP4_IO2 channel mode */
  4713. #define TSC_IOCCR_G4_IO3 ((uint32_t)0x00004000U) /*!<GROUP4_IO3 channel mode */
  4714. #define TSC_IOCCR_G4_IO4 ((uint32_t)0x00008000U) /*!<GROUP4_IO4 channel mode */
  4715. #define TSC_IOCCR_G5_IO1 ((uint32_t)0x00010000U) /*!<GROUP5_IO1 channel mode */
  4716. #define TSC_IOCCR_G5_IO2 ((uint32_t)0x00020000U) /*!<GROUP5_IO2 channel mode */
  4717. #define TSC_IOCCR_G5_IO3 ((uint32_t)0x00040000U) /*!<GROUP5_IO3 channel mode */
  4718. #define TSC_IOCCR_G5_IO4 ((uint32_t)0x00080000U) /*!<GROUP5_IO4 channel mode */
  4719. #define TSC_IOCCR_G6_IO1 ((uint32_t)0x00100000U) /*!<GROUP6_IO1 channel mode */
  4720. #define TSC_IOCCR_G6_IO2 ((uint32_t)0x00200000U) /*!<GROUP6_IO2 channel mode */
  4721. #define TSC_IOCCR_G6_IO3 ((uint32_t)0x00400000U) /*!<GROUP6_IO3 channel mode */
  4722. #define TSC_IOCCR_G6_IO4 ((uint32_t)0x00800000U) /*!<GROUP6_IO4 channel mode */
  4723. #define TSC_IOCCR_G7_IO1 ((uint32_t)0x01000000U) /*!<GROUP7_IO1 channel mode */
  4724. #define TSC_IOCCR_G7_IO2 ((uint32_t)0x02000000U) /*!<GROUP7_IO2 channel mode */
  4725. #define TSC_IOCCR_G7_IO3 ((uint32_t)0x04000000U) /*!<GROUP7_IO3 channel mode */
  4726. #define TSC_IOCCR_G7_IO4 ((uint32_t)0x08000000U) /*!<GROUP7_IO4 channel mode */
  4727. #define TSC_IOCCR_G8_IO1 ((uint32_t)0x10000000U) /*!<GROUP8_IO1 channel mode */
  4728. #define TSC_IOCCR_G8_IO2 ((uint32_t)0x20000000U) /*!<GROUP8_IO2 channel mode */
  4729. #define TSC_IOCCR_G8_IO3 ((uint32_t)0x40000000U) /*!<GROUP8_IO3 channel mode */
  4730. #define TSC_IOCCR_G8_IO4 ((uint32_t)0x80000000U) /*!<GROUP8_IO4 channel mode */
  4731. /******************* Bit definition for TSC_IOGCSR register *****************/
  4732. #define TSC_IOGCSR_G1E ((uint32_t)0x00000001U) /*!<Analog IO GROUP1 enable */
  4733. #define TSC_IOGCSR_G2E ((uint32_t)0x00000002U) /*!<Analog IO GROUP2 enable */
  4734. #define TSC_IOGCSR_G3E ((uint32_t)0x00000004U) /*!<Analog IO GROUP3 enable */
  4735. #define TSC_IOGCSR_G4E ((uint32_t)0x00000008U) /*!<Analog IO GROUP4 enable */
  4736. #define TSC_IOGCSR_G5E ((uint32_t)0x00000010U) /*!<Analog IO GROUP5 enable */
  4737. #define TSC_IOGCSR_G6E ((uint32_t)0x00000020U) /*!<Analog IO GROUP6 enable */
  4738. #define TSC_IOGCSR_G7E ((uint32_t)0x00000040U) /*!<Analog IO GROUP7 enable */
  4739. #define TSC_IOGCSR_G8E ((uint32_t)0x00000080U) /*!<Analog IO GROUP8 enable */
  4740. #define TSC_IOGCSR_G1S ((uint32_t)0x00010000U) /*!<Analog IO GROUP1 status */
  4741. #define TSC_IOGCSR_G2S ((uint32_t)0x00020000U) /*!<Analog IO GROUP2 status */
  4742. #define TSC_IOGCSR_G3S ((uint32_t)0x00040000U) /*!<Analog IO GROUP3 status */
  4743. #define TSC_IOGCSR_G4S ((uint32_t)0x00080000U) /*!<Analog IO GROUP4 status */
  4744. #define TSC_IOGCSR_G5S ((uint32_t)0x00100000U) /*!<Analog IO GROUP5 status */
  4745. #define TSC_IOGCSR_G6S ((uint32_t)0x00200000U) /*!<Analog IO GROUP6 status */
  4746. #define TSC_IOGCSR_G7S ((uint32_t)0x00400000U) /*!<Analog IO GROUP7 status */
  4747. #define TSC_IOGCSR_G8S ((uint32_t)0x00800000U) /*!<Analog IO GROUP8 status */
  4748. /******************* Bit definition for TSC_IOGXCR register *****************/
  4749. #define TSC_IOGXCR_CNT ((uint32_t)0x00003FFFU) /*!<CNT[13:0] bits (Counter value) */
  4750. /******************************************************************************/
  4751. /* */
  4752. /* Universal Synchronous Asynchronous Receiver Transmitter (USART) */
  4753. /* */
  4754. /******************************************************************************/
  4755. /****************** Bit definition for USART_CR1 register *******************/
  4756. #define USART_CR1_UE ((uint32_t)0x00000001U) /*!< USART Enable */
  4757. #define USART_CR1_UESM ((uint32_t)0x00000002U) /*!< USART Enable in STOP Mode */
  4758. #define USART_CR1_RE ((uint32_t)0x00000004U) /*!< Receiver Enable */
  4759. #define USART_CR1_TE ((uint32_t)0x00000008U) /*!< Transmitter Enable */
  4760. #define USART_CR1_IDLEIE ((uint32_t)0x00000010U) /*!< IDLE Interrupt Enable */
  4761. #define USART_CR1_RXNEIE ((uint32_t)0x00000020U) /*!< RXNE Interrupt Enable */
  4762. #define USART_CR1_TCIE ((uint32_t)0x00000040U) /*!< Transmission Complete Interrupt Enable */
  4763. #define USART_CR1_TXEIE ((uint32_t)0x00000080U) /*!< TXE Interrupt Enable */
  4764. #define USART_CR1_PEIE ((uint32_t)0x00000100U) /*!< PE Interrupt Enable */
  4765. #define USART_CR1_PS ((uint32_t)0x00000200U) /*!< Parity Selection */
  4766. #define USART_CR1_PCE ((uint32_t)0x00000400U) /*!< Parity Control Enable */
  4767. #define USART_CR1_WAKE ((uint32_t)0x00000800U) /*!< Receiver Wakeup method */
  4768. #define USART_CR1_M0 ((uint32_t)0x00001000U) /*!< Word length bit 0 */
  4769. #define USART_CR1_MME ((uint32_t)0x00002000U) /*!< Mute Mode Enable */
  4770. #define USART_CR1_CMIE ((uint32_t)0x00004000U) /*!< Character match interrupt enable */
  4771. #define USART_CR1_OVER8 ((uint32_t)0x00008000U) /*!< Oversampling by 8-bit or 16-bit mode */
  4772. #define USART_CR1_DEDT ((uint32_t)0x001F0000U) /*!< DEDT[4:0] bits (Driver Enable Deassertion Time) */
  4773. #define USART_CR1_DEDT_0 ((uint32_t)0x00010000U) /*!< Bit 0 */
  4774. #define USART_CR1_DEDT_1 ((uint32_t)0x00020000U) /*!< Bit 1 */
  4775. #define USART_CR1_DEDT_2 ((uint32_t)0x00040000U) /*!< Bit 2 */
  4776. #define USART_CR1_DEDT_3 ((uint32_t)0x00080000U) /*!< Bit 3 */
  4777. #define USART_CR1_DEDT_4 ((uint32_t)0x00100000U) /*!< Bit 4 */
  4778. #define USART_CR1_DEAT ((uint32_t)0x03E00000U) /*!< DEAT[4:0] bits (Driver Enable Assertion Time) */
  4779. #define USART_CR1_DEAT_0 ((uint32_t)0x00200000U) /*!< Bit 0 */
  4780. #define USART_CR1_DEAT_1 ((uint32_t)0x00400000U) /*!< Bit 1 */
  4781. #define USART_CR1_DEAT_2 ((uint32_t)0x00800000U) /*!< Bit 2 */
  4782. #define USART_CR1_DEAT_3 ((uint32_t)0x01000000U) /*!< Bit 3 */
  4783. #define USART_CR1_DEAT_4 ((uint32_t)0x02000000U) /*!< Bit 4 */
  4784. #define USART_CR1_RTOIE ((uint32_t)0x04000000U) /*!< Receive Time Out interrupt enable */
  4785. #define USART_CR1_EOBIE ((uint32_t)0x08000000U) /*!< End of Block interrupt enable */
  4786. #define USART_CR1_M1 ((uint32_t)0x10000000U) /*!< Word length bit 1 */
  4787. #define USART_CR1_M ((uint32_t)0x10001000U) /*!< [M1:M0] Word length */
  4788. /****************** Bit definition for USART_CR2 register *******************/
  4789. #define USART_CR2_ADDM7 ((uint32_t)0x00000010U) /*!< 7-bit or 4-bit Address Detection */
  4790. #define USART_CR2_LBDL ((uint32_t)0x00000020U) /*!< LIN Break Detection Length */
  4791. #define USART_CR2_LBDIE ((uint32_t)0x00000040U) /*!< LIN Break Detection Interrupt Enable */
  4792. #define USART_CR2_LBCL ((uint32_t)0x00000100U) /*!< Last Bit Clock pulse */
  4793. #define USART_CR2_CPHA ((uint32_t)0x00000200U) /*!< Clock Phase */
  4794. #define USART_CR2_CPOL ((uint32_t)0x00000400U) /*!< Clock Polarity */
  4795. #define USART_CR2_CLKEN ((uint32_t)0x00000800U) /*!< Clock Enable */
  4796. #define USART_CR2_STOP ((uint32_t)0x00003000U) /*!< STOP[1:0] bits (STOP bits) */
  4797. #define USART_CR2_STOP_0 ((uint32_t)0x00001000U) /*!< Bit 0 */
  4798. #define USART_CR2_STOP_1 ((uint32_t)0x00002000U) /*!< Bit 1 */
  4799. #define USART_CR2_LINEN ((uint32_t)0x00004000U) /*!< LIN mode enable */
  4800. #define USART_CR2_SWAP ((uint32_t)0x00008000U) /*!< SWAP TX/RX pins */
  4801. #define USART_CR2_RXINV ((uint32_t)0x00010000U) /*!< RX pin active level inversion */
  4802. #define USART_CR2_TXINV ((uint32_t)0x00020000U) /*!< TX pin active level inversion */
  4803. #define USART_CR2_DATAINV ((uint32_t)0x00040000U) /*!< Binary data inversion */
  4804. #define USART_CR2_MSBFIRST ((uint32_t)0x00080000U) /*!< Most Significant Bit First */
  4805. #define USART_CR2_ABREN ((uint32_t)0x00100000U) /*!< Auto Baud-Rate Enable*/
  4806. #define USART_CR2_ABRMODE ((uint32_t)0x00600000U) /*!< ABRMOD[1:0] bits (Auto Baud-Rate Mode) */
  4807. #define USART_CR2_ABRMODE_0 ((uint32_t)0x00200000U) /*!< Bit 0 */
  4808. #define USART_CR2_ABRMODE_1 ((uint32_t)0x00400000U) /*!< Bit 1 */
  4809. #define USART_CR2_RTOEN ((uint32_t)0x00800000U) /*!< Receiver Time-Out enable */
  4810. #define USART_CR2_ADD ((uint32_t)0xFF000000U) /*!< Address of the USART node */
  4811. /****************** Bit definition for USART_CR3 register *******************/
  4812. #define USART_CR3_EIE ((uint32_t)0x00000001U) /*!< Error Interrupt Enable */
  4813. #define USART_CR3_IREN ((uint32_t)0x00000002U) /*!< IrDA mode Enable */
  4814. #define USART_CR3_IRLP ((uint32_t)0x00000004U) /*!< IrDA Low-Power */
  4815. #define USART_CR3_HDSEL ((uint32_t)0x00000008U) /*!< Half-Duplex Selection */
  4816. #define USART_CR3_NACK ((uint32_t)0x00000010U) /*!< SmartCard NACK enable */
  4817. #define USART_CR3_SCEN ((uint32_t)0x00000020U) /*!< SmartCard mode enable */
  4818. #define USART_CR3_DMAR ((uint32_t)0x00000040U) /*!< DMA Enable Receiver */
  4819. #define USART_CR3_DMAT ((uint32_t)0x00000080U) /*!< DMA Enable Transmitter */
  4820. #define USART_CR3_RTSE ((uint32_t)0x00000100U) /*!< RTS Enable */
  4821. #define USART_CR3_CTSE ((uint32_t)0x00000200U) /*!< CTS Enable */
  4822. #define USART_CR3_CTSIE ((uint32_t)0x00000400U) /*!< CTS Interrupt Enable */
  4823. #define USART_CR3_ONEBIT ((uint32_t)0x00000800U) /*!< One sample bit method enable */
  4824. #define USART_CR3_OVRDIS ((uint32_t)0x00001000U) /*!< Overrun Disable */
  4825. #define USART_CR3_DDRE ((uint32_t)0x00002000U) /*!< DMA Disable on Reception Error */
  4826. #define USART_CR3_DEM ((uint32_t)0x00004000U) /*!< Driver Enable Mode */
  4827. #define USART_CR3_DEP ((uint32_t)0x00008000U) /*!< Driver Enable Polarity Selection */
  4828. #define USART_CR3_SCARCNT ((uint32_t)0x000E0000U) /*!< SCARCNT[2:0] bits (SmartCard Auto-Retry Count) */
  4829. #define USART_CR3_SCARCNT_0 ((uint32_t)0x00020000U) /*!< Bit 0 */
  4830. #define USART_CR3_SCARCNT_1 ((uint32_t)0x00040000U) /*!< Bit 1 */
  4831. #define USART_CR3_SCARCNT_2 ((uint32_t)0x00080000U) /*!< Bit 2 */
  4832. #define USART_CR3_WUS ((uint32_t)0x00300000U) /*!< WUS[1:0] bits (Wake UP Interrupt Flag Selection) */
  4833. #define USART_CR3_WUS_0 ((uint32_t)0x00100000U) /*!< Bit 0 */
  4834. #define USART_CR3_WUS_1 ((uint32_t)0x00200000U) /*!< Bit 1 */
  4835. #define USART_CR3_WUFIE ((uint32_t)0x00400000U) /*!< Wake Up Interrupt Enable */
  4836. /****************** Bit definition for USART_BRR register *******************/
  4837. #define USART_BRR_DIV_FRACTION ((uint32_t)0x0000000FU) /*!< Fraction of USARTDIV */
  4838. #define USART_BRR_DIV_MANTISSA ((uint32_t)0x0000FFF0U) /*!< Mantissa of USARTDIV */
  4839. /****************** Bit definition for USART_GTPR register ******************/
  4840. #define USART_GTPR_PSC ((uint32_t)0x000000FFU) /*!< PSC[7:0] bits (Prescaler value) */
  4841. #define USART_GTPR_GT ((uint32_t)0x0000FF00U) /*!< GT[7:0] bits (Guard time value) */
  4842. /******************* Bit definition for USART_RTOR register *****************/
  4843. #define USART_RTOR_RTO ((uint32_t)0x00FFFFFFU) /*!< Receiver Time Out Value */
  4844. #define USART_RTOR_BLEN ((uint32_t)0xFF000000U) /*!< Block Length */
  4845. /******************* Bit definition for USART_RQR register ******************/
  4846. #define USART_RQR_ABRRQ ((uint32_t)0x00000001U) /*!< Auto-Baud Rate Request */
  4847. #define USART_RQR_SBKRQ ((uint32_t)0x00000002U) /*!< Send Break Request */
  4848. #define USART_RQR_MMRQ ((uint32_t)0x00000004U) /*!< Mute Mode Request */
  4849. #define USART_RQR_RXFRQ ((uint32_t)0x00000008U) /*!< Receive Data flush Request */
  4850. #define USART_RQR_TXFRQ ((uint32_t)0x00000010U) /*!< Transmit data flush Request */
  4851. /******************* Bit definition for USART_ISR register ******************/
  4852. #define USART_ISR_PE ((uint32_t)0x00000001U) /*!< Parity Error */
  4853. #define USART_ISR_FE ((uint32_t)0x00000002U) /*!< Framing Error */
  4854. #define USART_ISR_NE ((uint32_t)0x00000004U) /*!< Noise detected Flag */
  4855. #define USART_ISR_ORE ((uint32_t)0x00000008U) /*!< OverRun Error */
  4856. #define USART_ISR_IDLE ((uint32_t)0x00000010U) /*!< IDLE line detected */
  4857. #define USART_ISR_RXNE ((uint32_t)0x00000020U) /*!< Read Data Register Not Empty */
  4858. #define USART_ISR_TC ((uint32_t)0x00000040U) /*!< Transmission Complete */
  4859. #define USART_ISR_TXE ((uint32_t)0x00000080U) /*!< Transmit Data Register Empty */
  4860. #define USART_ISR_LBDF ((uint32_t)0x00000100U) /*!< LIN Break Detection Flag */
  4861. #define USART_ISR_CTSIF ((uint32_t)0x00000200U) /*!< CTS interrupt flag */
  4862. #define USART_ISR_CTS ((uint32_t)0x00000400U) /*!< CTS flag */
  4863. #define USART_ISR_RTOF ((uint32_t)0x00000800U) /*!< Receiver Time Out */
  4864. #define USART_ISR_EOBF ((uint32_t)0x00001000U) /*!< End Of Block Flag */
  4865. #define USART_ISR_ABRE ((uint32_t)0x00004000U) /*!< Auto-Baud Rate Error */
  4866. #define USART_ISR_ABRF ((uint32_t)0x00008000U) /*!< Auto-Baud Rate Flag */
  4867. #define USART_ISR_BUSY ((uint32_t)0x00010000U) /*!< Busy Flag */
  4868. #define USART_ISR_CMF ((uint32_t)0x00020000U) /*!< Character Match Flag */
  4869. #define USART_ISR_SBKF ((uint32_t)0x00040000U) /*!< Send Break Flag */
  4870. #define USART_ISR_RWU ((uint32_t)0x00080000U) /*!< Receive Wake Up from mute mode Flag */
  4871. #define USART_ISR_WUF ((uint32_t)0x00100000U) /*!< Wake Up from stop mode Flag */
  4872. #define USART_ISR_TEACK ((uint32_t)0x00200000U) /*!< Transmit Enable Acknowledge Flag */
  4873. #define USART_ISR_REACK ((uint32_t)0x00400000U) /*!< Receive Enable Acknowledge Flag */
  4874. /******************* Bit definition for USART_ICR register ******************/
  4875. #define USART_ICR_PECF ((uint32_t)0x00000001U) /*!< Parity Error Clear Flag */
  4876. #define USART_ICR_FECF ((uint32_t)0x00000002U) /*!< Framing Error Clear Flag */
  4877. #define USART_ICR_NCF ((uint32_t)0x00000004U) /*!< Noise detected Clear Flag */
  4878. #define USART_ICR_ORECF ((uint32_t)0x00000008U) /*!< OverRun Error Clear Flag */
  4879. #define USART_ICR_IDLECF ((uint32_t)0x00000010U) /*!< IDLE line detected Clear Flag */
  4880. #define USART_ICR_TCCF ((uint32_t)0x00000040U) /*!< Transmission Complete Clear Flag */
  4881. #define USART_ICR_LBDCF ((uint32_t)0x00000100U) /*!< LIN Break Detection Clear Flag */
  4882. #define USART_ICR_CTSCF ((uint32_t)0x00000200U) /*!< CTS Interrupt Clear Flag */
  4883. #define USART_ICR_RTOCF ((uint32_t)0x00000800U) /*!< Receiver Time Out Clear Flag */
  4884. #define USART_ICR_EOBCF ((uint32_t)0x00001000U) /*!< End Of Block Clear Flag */
  4885. #define USART_ICR_CMCF ((uint32_t)0x00020000U) /*!< Character Match Clear Flag */
  4886. #define USART_ICR_WUCF ((uint32_t)0x00100000U) /*!< Wake Up from stop mode Clear Flag */
  4887. /******************* Bit definition for USART_RDR register ******************/
  4888. #define USART_RDR_RDR ((uint16_t)0x01FFU) /*!< RDR[8:0] bits (Receive Data value) */
  4889. /******************* Bit definition for USART_TDR register ******************/
  4890. #define USART_TDR_TDR ((uint16_t)0x01FFU) /*!< TDR[8:0] bits (Transmit Data value) */
  4891. /******************************************************************************/
  4892. /* */
  4893. /* USB Device General registers */
  4894. /* */
  4895. /******************************************************************************/
  4896. #define USB_CNTR (USB_BASE + 0x40) /*!< Control register */
  4897. #define USB_ISTR (USB_BASE + 0x44) /*!< Interrupt status register */
  4898. #define USB_FNR (USB_BASE + 0x48) /*!< Frame number register */
  4899. #define USB_DADDR (USB_BASE + 0x4C) /*!< Device address register */
  4900. #define USB_BTABLE (USB_BASE + 0x50) /*!< Buffer Table address register */
  4901. #define USB_LPMCSR (USB_BASE + 0x54) /*!< LPM Control and Status register */
  4902. #define USB_BCDR (USB_BASE + 0x58) /*!< Battery Charging detector register*/
  4903. /**************************** ISTR interrupt events *************************/
  4904. #define USB_ISTR_CTR ((uint16_t)0x8000U) /*!< Correct TRansfer (clear-only bit) */
  4905. #define USB_ISTR_PMAOVR ((uint16_t)0x4000U) /*!< DMA OVeR/underrun (clear-only bit) */
  4906. #define USB_ISTR_ERR ((uint16_t)0x2000U) /*!< ERRor (clear-only bit) */
  4907. #define USB_ISTR_WKUP ((uint16_t)0x1000U) /*!< WaKe UP (clear-only bit) */
  4908. #define USB_ISTR_SUSP ((uint16_t)0x0800U) /*!< SUSPend (clear-only bit) */
  4909. #define USB_ISTR_RESET ((uint16_t)0x0400U) /*!< RESET (clear-only bit) */
  4910. #define USB_ISTR_SOF ((uint16_t)0x0200U) /*!< Start Of Frame (clear-only bit) */
  4911. #define USB_ISTR_ESOF ((uint16_t)0x0100U) /*!< Expected Start Of Frame (clear-only bit) */
  4912. #define USB_ISTR_L1REQ ((uint16_t)0x0080U) /*!< LPM L1 state request */
  4913. #define USB_ISTR_DIR ((uint16_t)0x0010U) /*!< DIRection of transaction (read-only bit) */
  4914. #define USB_ISTR_EP_ID ((uint16_t)0x000FU) /*!< EndPoint IDentifier (read-only bit) */
  4915. #define USB_CLR_CTR (~USB_ISTR_CTR) /*!< clear Correct TRansfer bit */
  4916. #define USB_CLR_PMAOVR (~USB_ISTR_PMAOVR) /*!< clear DMA OVeR/underrun bit*/
  4917. #define USB_CLR_ERR (~USB_ISTR_ERR) /*!< clear ERRor bit */
  4918. #define USB_CLR_WKUP (~USB_ISTR_WKUP) /*!< clear WaKe UP bit */
  4919. #define USB_CLR_SUSP (~USB_ISTR_SUSP) /*!< clear SUSPend bit */
  4920. #define USB_CLR_RESET (~USB_ISTR_RESET) /*!< clear RESET bit */
  4921. #define USB_CLR_SOF (~USB_ISTR_SOF) /*!< clear Start Of Frame bit */
  4922. #define USB_CLR_ESOF (~USB_ISTR_ESOF) /*!< clear Expected Start Of Frame bit */
  4923. #define USB_CLR_L1REQ (~USB_ISTR_L1REQ) /*!< clear LPM L1 bit */
  4924. /************************* CNTR control register bits definitions ***********/
  4925. #define USB_CNTR_CTRM ((uint16_t)0x8000U) /*!< Correct TRansfer Mask */
  4926. #define USB_CNTR_PMAOVRM ((uint16_t)0x4000U) /*!< DMA OVeR/underrun Mask */
  4927. #define USB_CNTR_ERRM ((uint16_t)0x2000U) /*!< ERRor Mask */
  4928. #define USB_CNTR_WKUPM ((uint16_t)0x1000U) /*!< WaKe UP Mask */
  4929. #define USB_CNTR_SUSPM ((uint16_t)0x0800U) /*!< SUSPend Mask */
  4930. #define USB_CNTR_RESETM ((uint16_t)0x0400U) /*!< RESET Mask */
  4931. #define USB_CNTR_SOFM ((uint16_t)0x0200U) /*!< Start Of Frame Mask */
  4932. #define USB_CNTR_ESOFM ((uint16_t)0x0100U) /*!< Expected Start Of Frame Mask */
  4933. #define USB_CNTR_L1REQM ((uint16_t)0x0080U) /*!< LPM L1 state request interrupt mask */
  4934. #define USB_CNTR_L1RESUME ((uint16_t)0x0020U) /*!< LPM L1 Resume request */
  4935. #define USB_CNTR_RESUME ((uint16_t)0x0010U) /*!< RESUME request */
  4936. #define USB_CNTR_FSUSP ((uint16_t)0x0008U) /*!< Force SUSPend */
  4937. #define USB_CNTR_LPMODE ((uint16_t)0x0004U) /*!< Low-power MODE */
  4938. #define USB_CNTR_PDWN ((uint16_t)0x0002U) /*!< Power DoWN */
  4939. #define USB_CNTR_FRES ((uint16_t)0x0001U) /*!< Force USB RESet */
  4940. /************************* BCDR control register bits definitions ***********/
  4941. #define USB_BCDR_DPPU ((uint16_t)0x8000U) /*!< DP Pull-up Enable */
  4942. #define USB_BCDR_PS2DET ((uint16_t)0x0080U) /*!< PS2 port or proprietary charger detected */
  4943. #define USB_BCDR_SDET ((uint16_t)0x0040U) /*!< Secondary detection (SD) status */
  4944. #define USB_BCDR_PDET ((uint16_t)0x0020U) /*!< Primary detection (PD) status */
  4945. #define USB_BCDR_DCDET ((uint16_t)0x0010U) /*!< Data contact detection (DCD) status */
  4946. #define USB_BCDR_SDEN ((uint16_t)0x0008U) /*!< Secondary detection (SD) mode enable */
  4947. #define USB_BCDR_PDEN ((uint16_t)0x0004U) /*!< Primary detection (PD) mode enable */
  4948. #define USB_BCDR_DCDEN ((uint16_t)0x0002U) /*!< Data contact detection (DCD) mode enable */
  4949. #define USB_BCDR_BCDEN ((uint16_t)0x0001U) /*!< Battery charging detector (BCD) enable */
  4950. /*************************** LPM register bits definitions ******************/
  4951. #define USB_LPMCSR_BESL ((uint16_t)0x00F0U) /*!< BESL value received with last ACKed LPM Token */
  4952. #define USB_LPMCSR_REMWAKE ((uint16_t)0x0008U) /*!< bRemoteWake value received with last ACKed LPM Token */
  4953. #define USB_LPMCSR_LPMACK ((uint16_t)0x0002U) /*!< LPM Token acknowledge enable*/
  4954. #define USB_LPMCSR_LMPEN ((uint16_t)0x0001U) /*!< LPM support enable */
  4955. /******************** FNR Frame Number Register bit definitions ************/
  4956. #define USB_FNR_RXDP ((uint16_t)0x8000U) /*!< status of D+ data line */
  4957. #define USB_FNR_RXDM ((uint16_t)0x4000U) /*!< status of D- data line */
  4958. #define USB_FNR_LCK ((uint16_t)0x2000U) /*!< LoCKed */
  4959. #define USB_FNR_LSOF ((uint16_t)0x1800U) /*!< Lost SOF */
  4960. #define USB_FNR_FN ((uint16_t)0x07FFU) /*!< Frame Number */
  4961. /******************** DADDR Device ADDRess bit definitions ****************/
  4962. #define USB_DADDR_EF ((uint8_t)0x80U) /*!< USB device address Enable Function */
  4963. #define USB_DADDR_ADD ((uint8_t)0x7FU) /*!< USB device address */
  4964. /****************************** Endpoint register *************************/
  4965. #define USB_EP0R USB_BASE /*!< endpoint 0 register address */
  4966. #define USB_EP1R (USB_BASE + 0x04) /*!< endpoint 1 register address */
  4967. #define USB_EP2R (USB_BASE + 0x08) /*!< endpoint 2 register address */
  4968. #define USB_EP3R (USB_BASE + 0x0C) /*!< endpoint 3 register address */
  4969. #define USB_EP4R (USB_BASE + 0x10) /*!< endpoint 4 register address */
  4970. #define USB_EP5R (USB_BASE + 0x14) /*!< endpoint 5 register address */
  4971. #define USB_EP6R (USB_BASE + 0x18) /*!< endpoint 6 register address */
  4972. #define USB_EP7R (USB_BASE + 0x1C) /*!< endpoint 7 register address */
  4973. /* bit positions */
  4974. #define USB_EP_CTR_RX ((uint16_t)0x8000U) /*!< EndPoint Correct TRansfer RX */
  4975. #define USB_EP_DTOG_RX ((uint16_t)0x4000U) /*!< EndPoint Data TOGGLE RX */
  4976. #define USB_EPRX_STAT ((uint16_t)0x3000U) /*!< EndPoint RX STATus bit field */
  4977. #define USB_EP_SETUP ((uint16_t)0x0800U) /*!< EndPoint SETUP */
  4978. #define USB_EP_T_FIELD ((uint16_t)0x0600U) /*!< EndPoint TYPE */
  4979. #define USB_EP_KIND ((uint16_t)0x0100U) /*!< EndPoint KIND */
  4980. #define USB_EP_CTR_TX ((uint16_t)0x0080U) /*!< EndPoint Correct TRansfer TX */
  4981. #define USB_EP_DTOG_TX ((uint16_t)0x0040U) /*!< EndPoint Data TOGGLE TX */
  4982. #define USB_EPTX_STAT ((uint16_t)0x0030U) /*!< EndPoint TX STATus bit field */
  4983. #define USB_EPADDR_FIELD ((uint16_t)0x000FU) /*!< EndPoint ADDRess FIELD */
  4984. /* EndPoint REGister MASK (no toggle fields) */
  4985. #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)
  4986. /*!< EP_TYPE[1:0] EndPoint TYPE */
  4987. #define USB_EP_TYPE_MASK ((uint16_t)0x0600U) /*!< EndPoint TYPE Mask */
  4988. #define USB_EP_BULK ((uint16_t)0x0000U) /*!< EndPoint BULK */
  4989. #define USB_EP_CONTROL ((uint16_t)0x0200U) /*!< EndPoint CONTROL */
  4990. #define USB_EP_ISOCHRONOUS ((uint16_t)0x0400U) /*!< EndPoint ISOCHRONOUS */
  4991. #define USB_EP_INTERRUPT ((uint16_t)0x0600U) /*!< EndPoint INTERRUPT */
  4992. #define USB_EP_T_MASK (~USB_EP_T_FIELD & USB_EPREG_MASK)
  4993. #define USB_EPKIND_MASK (~USB_EP_KIND & USB_EPREG_MASK) /*!< EP_KIND EndPoint KIND */
  4994. /*!< STAT_TX[1:0] STATus for TX transfer */
  4995. #define USB_EP_TX_DIS ((uint16_t)0x0000U) /*!< EndPoint TX DISabled */
  4996. #define USB_EP_TX_STALL ((uint16_t)0x0010U) /*!< EndPoint TX STALLed */
  4997. #define USB_EP_TX_NAK ((uint16_t)0x0020U) /*!< EndPoint TX NAKed */
  4998. #define USB_EP_TX_VALID ((uint16_t)0x0030U) /*!< EndPoint TX VALID */
  4999. #define USB_EPTX_DTOG1 ((uint16_t)0x0010U) /*!< EndPoint TX Data TOGgle bit1 */
  5000. #define USB_EPTX_DTOG2 ((uint16_t)0x0020U) /*!< EndPoint TX Data TOGgle bit2 */
  5001. #define USB_EPTX_DTOGMASK (USB_EPTX_STAT|USB_EPREG_MASK)
  5002. /*!< STAT_RX[1:0] STATus for RX transfer */
  5003. #define USB_EP_RX_DIS ((uint16_t)0x0000U) /*!< EndPoint RX DISabled */
  5004. #define USB_EP_RX_STALL ((uint16_t)0x1000U) /*!< EndPoint RX STALLed */
  5005. #define USB_EP_RX_NAK ((uint16_t)0x2000U) /*!< EndPoint RX NAKed */
  5006. #define USB_EP_RX_VALID ((uint16_t)0x3000U) /*!< EndPoint RX VALID */
  5007. #define USB_EPRX_DTOG1 ((uint16_t)0x1000U) /*!< EndPoint RX Data TOGgle bit1 */
  5008. #define USB_EPRX_DTOG2 ((uint16_t)0x2000U) /*!< EndPoint RX Data TOGgle bit1 */
  5009. #define USB_EPRX_DTOGMASK (USB_EPRX_STAT|USB_EPREG_MASK)
  5010. /******************************************************************************/
  5011. /* */
  5012. /* Window WATCHDOG (WWDG) */
  5013. /* */
  5014. /******************************************************************************/
  5015. /******************* Bit definition for WWDG_CR register ********************/
  5016. #define WWDG_CR_T ((uint32_t)0x0000007FU) /*!< T[6:0] bits (7-Bit counter (MSB to LSB)) */
  5017. #define WWDG_CR_T_0 ((uint32_t)0x00000001U) /*!< Bit 0 */
  5018. #define WWDG_CR_T_1 ((uint32_t)0x00000002U) /*!< Bit 1 */
  5019. #define WWDG_CR_T_2 ((uint32_t)0x00000004U) /*!< Bit 2 */
  5020. #define WWDG_CR_T_3 ((uint32_t)0x00000008U) /*!< Bit 3 */
  5021. #define WWDG_CR_T_4 ((uint32_t)0x00000010U) /*!< Bit 4 */
  5022. #define WWDG_CR_T_5 ((uint32_t)0x00000020U) /*!< Bit 5 */
  5023. #define WWDG_CR_T_6 ((uint32_t)0x00000040U) /*!< Bit 6 */
  5024. /* Legacy defines */
  5025. #define WWDG_CR_T0 WWDG_CR_T_0
  5026. #define WWDG_CR_T1 WWDG_CR_T_1
  5027. #define WWDG_CR_T2 WWDG_CR_T_2
  5028. #define WWDG_CR_T3 WWDG_CR_T_3
  5029. #define WWDG_CR_T4 WWDG_CR_T_4
  5030. #define WWDG_CR_T5 WWDG_CR_T_5
  5031. #define WWDG_CR_T6 WWDG_CR_T_6
  5032. #define WWDG_CR_WDGA ((uint32_t)0x00000080U) /*!< Activation bit */
  5033. /******************* Bit definition for WWDG_CFR register *******************/
  5034. #define WWDG_CFR_W ((uint32_t)0x0000007FU) /*!< W[6:0] bits (7-bit window value) */
  5035. #define WWDG_CFR_W_0 ((uint32_t)0x00000001U) /*!< Bit 0 */
  5036. #define WWDG_CFR_W_1 ((uint32_t)0x00000002U) /*!< Bit 1 */
  5037. #define WWDG_CFR_W_2 ((uint32_t)0x00000004U) /*!< Bit 2 */
  5038. #define WWDG_CFR_W_3 ((uint32_t)0x00000008U) /*!< Bit 3 */
  5039. #define WWDG_CFR_W_4 ((uint32_t)0x00000010U) /*!< Bit 4 */
  5040. #define WWDG_CFR_W_5 ((uint32_t)0x00000020U) /*!< Bit 5 */
  5041. #define WWDG_CFR_W_6 ((uint32_t)0x00000040U) /*!< Bit 6 */
  5042. /* Legacy defines */
  5043. #define WWDG_CFR_W0 WWDG_CFR_W_0
  5044. #define WWDG_CFR_W1 WWDG_CFR_W_1
  5045. #define WWDG_CFR_W2 WWDG_CFR_W_2
  5046. #define WWDG_CFR_W3 WWDG_CFR_W_3
  5047. #define WWDG_CFR_W4 WWDG_CFR_W_4
  5048. #define WWDG_CFR_W5 WWDG_CFR_W_5
  5049. #define WWDG_CFR_W6 WWDG_CFR_W_6
  5050. #define WWDG_CFR_WDGTB ((uint32_t)0x00000180U) /*!< WDGTB[1:0] bits (Timer Base) */
  5051. #define WWDG_CFR_WDGTB_0 ((uint32_t)0x00000080U) /*!< Bit 0 */
  5052. #define WWDG_CFR_WDGTB_1 ((uint32_t)0x00000100U) /*!< Bit 1 */
  5053. /* Legacy defines */
  5054. #define WWDG_CFR_WDGTB0 WWDG_CFR_WDGTB_0
  5055. #define WWDG_CFR_WDGTB1 WWDG_CFR_WDGTB_1
  5056. #define WWDG_CFR_EWI ((uint32_t)0x00000200U) /*!< Early Wakeup Interrupt */
  5057. /******************* Bit definition for WWDG_SR register ********************/
  5058. #define WWDG_SR_EWIF ((uint32_t)0x00000001U) /*!< Early Wakeup Interrupt Flag */
  5059. /**
  5060. * @}
  5061. */
  5062. /**
  5063. * @}
  5064. */
  5065. /** @addtogroup Exported_macro
  5066. * @{
  5067. */
  5068. /****************************** ADC Instances *********************************/
  5069. #define IS_ADC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == ADC1)
  5070. #define IS_ADC_COMMON_INSTANCE(INSTANCE) ((INSTANCE) == ADC)
  5071. /******************************* CAN Instances ********************************/
  5072. #define IS_CAN_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CAN)
  5073. /****************************** COMP Instances *********************************/
  5074. #define IS_COMP_ALL_INSTANCE(INSTANCE) (((INSTANCE) == COMP1) || \
  5075. ((INSTANCE) == COMP2))
  5076. #define IS_COMP_COMMON_INSTANCE(INSTANCE) ((INSTANCE) == COMP12_COMMON)
  5077. #define IS_COMP_DAC1SWITCH_INSTANCE(INSTANCE) ((INSTANCE) == COMP1)
  5078. #define IS_COMP_WINDOWMODE_INSTANCE(INSTANCE) ((INSTANCE) == COMP2)
  5079. /****************************** CEC Instances *********************************/
  5080. #define IS_CEC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CEC)
  5081. /****************************** CRC Instances *********************************/
  5082. #define IS_CRC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CRC)
  5083. /******************************* DAC Instances ********************************/
  5084. #define IS_DAC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == DAC1)
  5085. /******************************* DMA Instances ********************************/
  5086. #define IS_DMA_ALL_INSTANCE(INSTANCE) (((INSTANCE) == DMA1_Channel1) || \
  5087. ((INSTANCE) == DMA1_Channel2) || \
  5088. ((INSTANCE) == DMA1_Channel3) || \
  5089. ((INSTANCE) == DMA1_Channel4) || \
  5090. ((INSTANCE) == DMA1_Channel5) || \
  5091. ((INSTANCE) == DMA1_Channel6) || \
  5092. ((INSTANCE) == DMA1_Channel7))
  5093. /****************************** GPIO Instances ********************************/
  5094. #define IS_GPIO_ALL_INSTANCE(INSTANCE) (((INSTANCE) == GPIOA) || \
  5095. ((INSTANCE) == GPIOB) || \
  5096. ((INSTANCE) == GPIOC) || \
  5097. ((INSTANCE) == GPIOD) || \
  5098. ((INSTANCE) == GPIOE) || \
  5099. ((INSTANCE) == GPIOF))
  5100. /**************************** GPIO Alternate Function Instances ***************/
  5101. #define IS_GPIO_AF_INSTANCE(INSTANCE) (((INSTANCE) == GPIOA) || \
  5102. ((INSTANCE) == GPIOB) || \
  5103. ((INSTANCE) == GPIOC) || \
  5104. ((INSTANCE) == GPIOD) || \
  5105. ((INSTANCE) == GPIOE))
  5106. /****************************** GPIO Lock Instances ***************************/
  5107. #define IS_GPIO_LOCK_INSTANCE(INSTANCE) (((INSTANCE) == GPIOA) || \
  5108. ((INSTANCE) == GPIOB))
  5109. /****************************** I2C Instances *********************************/
  5110. #define IS_I2C_ALL_INSTANCE(INSTANCE) (((INSTANCE) == I2C1) || \
  5111. ((INSTANCE) == I2C2))
  5112. /****************************** I2S Instances *********************************/
  5113. #define IS_I2S_ALL_INSTANCE(INSTANCE) (((INSTANCE) == SPI1) || \
  5114. ((INSTANCE) == SPI2))
  5115. /****************************** IWDG Instances ********************************/
  5116. #define IS_IWDG_ALL_INSTANCE(INSTANCE) ((INSTANCE) == IWDG)
  5117. /****************************** RTC Instances *********************************/
  5118. #define IS_RTC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == RTC)
  5119. /****************************** SMBUS Instances *********************************/
  5120. #define IS_SMBUS_ALL_INSTANCE(INSTANCE) ((INSTANCE) == I2C1)
  5121. /****************************** SPI Instances *********************************/
  5122. #define IS_SPI_ALL_INSTANCE(INSTANCE) (((INSTANCE) == SPI1) || \
  5123. ((INSTANCE) == SPI2))
  5124. /****************************** TIM Instances *********************************/
  5125. #define IS_TIM_INSTANCE(INSTANCE)\
  5126. (((INSTANCE) == TIM1) || \
  5127. ((INSTANCE) == TIM2) || \
  5128. ((INSTANCE) == TIM3) || \
  5129. ((INSTANCE) == TIM6) || \
  5130. ((INSTANCE) == TIM7) || \
  5131. ((INSTANCE) == TIM14) || \
  5132. ((INSTANCE) == TIM15) || \
  5133. ((INSTANCE) == TIM16) || \
  5134. ((INSTANCE) == TIM17))
  5135. #define IS_TIM_CC1_INSTANCE(INSTANCE)\
  5136. (((INSTANCE) == TIM1) || \
  5137. ((INSTANCE) == TIM2) || \
  5138. ((INSTANCE) == TIM3) || \
  5139. ((INSTANCE) == TIM14) || \
  5140. ((INSTANCE) == TIM15) || \
  5141. ((INSTANCE) == TIM16) || \
  5142. ((INSTANCE) == TIM17))
  5143. #define IS_TIM_CC2_INSTANCE(INSTANCE)\
  5144. (((INSTANCE) == TIM1) || \
  5145. ((INSTANCE) == TIM2) || \
  5146. ((INSTANCE) == TIM3) || \
  5147. ((INSTANCE) == TIM15))
  5148. #define IS_TIM_CC3_INSTANCE(INSTANCE)\
  5149. (((INSTANCE) == TIM1) || \
  5150. ((INSTANCE) == TIM2) || \
  5151. ((INSTANCE) == TIM3))
  5152. #define IS_TIM_CC4_INSTANCE(INSTANCE)\
  5153. (((INSTANCE) == TIM1) || \
  5154. ((INSTANCE) == TIM2) || \
  5155. ((INSTANCE) == TIM3))
  5156. #define IS_TIM_CLOCKSOURCE_ETRMODE1_INSTANCE(INSTANCE)\
  5157. (((INSTANCE) == TIM1) || \
  5158. ((INSTANCE) == TIM2) || \
  5159. ((INSTANCE) == TIM3))
  5160. #define IS_TIM_CLOCKSOURCE_ETRMODE2_INSTANCE(INSTANCE)\
  5161. (((INSTANCE) == TIM1) || \
  5162. ((INSTANCE) == TIM2) || \
  5163. ((INSTANCE) == TIM3))
  5164. #define IS_TIM_CLOCKSOURCE_TIX_INSTANCE(INSTANCE)\
  5165. (((INSTANCE) == TIM1) || \
  5166. ((INSTANCE) == TIM2) || \
  5167. ((INSTANCE) == TIM3) || \
  5168. ((INSTANCE) == TIM15))
  5169. #define IS_TIM_CLOCKSOURCE_ITRX_INSTANCE(INSTANCE)\
  5170. (((INSTANCE) == TIM1) || \
  5171. ((INSTANCE) == TIM2) || \
  5172. ((INSTANCE) == TIM3) || \
  5173. ((INSTANCE) == TIM15))
  5174. #define IS_TIM_OCXREF_CLEAR_INSTANCE(INSTANCE)\
  5175. (((INSTANCE) == TIM1) || \
  5176. ((INSTANCE) == TIM2) || \
  5177. ((INSTANCE) == TIM3))
  5178. #define IS_TIM_ENCODER_INTERFACE_INSTANCE(INSTANCE)\
  5179. (((INSTANCE) == TIM1) || \
  5180. ((INSTANCE) == TIM2) || \
  5181. ((INSTANCE) == TIM3))
  5182. #define IS_TIM_HALL_INTERFACE_INSTANCE(INSTANCE)\
  5183. (((INSTANCE) == TIM1))
  5184. #define IS_TIM_XOR_INSTANCE(INSTANCE)\
  5185. (((INSTANCE) == TIM1) || \
  5186. ((INSTANCE) == TIM2) || \
  5187. ((INSTANCE) == TIM3))
  5188. #define IS_TIM_MASTER_INSTANCE(INSTANCE)\
  5189. (((INSTANCE) == TIM1) || \
  5190. ((INSTANCE) == TIM2) || \
  5191. ((INSTANCE) == TIM3) || \
  5192. ((INSTANCE) == TIM6) || \
  5193. ((INSTANCE) == TIM7) || \
  5194. ((INSTANCE) == TIM15))
  5195. #define IS_TIM_SLAVE_INSTANCE(INSTANCE)\
  5196. (((INSTANCE) == TIM1) || \
  5197. ((INSTANCE) == TIM2) || \
  5198. ((INSTANCE) == TIM3) || \
  5199. ((INSTANCE) == TIM15))
  5200. #define IS_TIM_32B_COUNTER_INSTANCE(INSTANCE)\
  5201. ((INSTANCE) == TIM2)
  5202. #define IS_TIM_DMABURST_INSTANCE(INSTANCE)\
  5203. (((INSTANCE) == TIM1) || \
  5204. ((INSTANCE) == TIM2) || \
  5205. ((INSTANCE) == TIM3) || \
  5206. ((INSTANCE) == TIM15) || \
  5207. ((INSTANCE) == TIM16) || \
  5208. ((INSTANCE) == TIM17))
  5209. #define IS_TIM_BREAK_INSTANCE(INSTANCE)\
  5210. (((INSTANCE) == TIM1) || \
  5211. ((INSTANCE) == TIM15) || \
  5212. ((INSTANCE) == TIM16) || \
  5213. ((INSTANCE) == TIM17))
  5214. #define IS_TIM_CCX_INSTANCE(INSTANCE, CHANNEL) \
  5215. ((((INSTANCE) == TIM1) && \
  5216. (((CHANNEL) == TIM_CHANNEL_1) || \
  5217. ((CHANNEL) == TIM_CHANNEL_2) || \
  5218. ((CHANNEL) == TIM_CHANNEL_3) || \
  5219. ((CHANNEL) == TIM_CHANNEL_4))) \
  5220. || \
  5221. (((INSTANCE) == TIM2) && \
  5222. (((CHANNEL) == TIM_CHANNEL_1) || \
  5223. ((CHANNEL) == TIM_CHANNEL_2) || \
  5224. ((CHANNEL) == TIM_CHANNEL_3) || \
  5225. ((CHANNEL) == TIM_CHANNEL_4))) \
  5226. || \
  5227. (((INSTANCE) == TIM3) && \
  5228. (((CHANNEL) == TIM_CHANNEL_1) || \
  5229. ((CHANNEL) == TIM_CHANNEL_2) || \
  5230. ((CHANNEL) == TIM_CHANNEL_3) || \
  5231. ((CHANNEL) == TIM_CHANNEL_4))) \
  5232. || \
  5233. (((INSTANCE) == TIM14) && \
  5234. (((CHANNEL) == TIM_CHANNEL_1))) \
  5235. || \
  5236. (((INSTANCE) == TIM15) && \
  5237. (((CHANNEL) == TIM_CHANNEL_1) || \
  5238. ((CHANNEL) == TIM_CHANNEL_2))) \
  5239. || \
  5240. (((INSTANCE) == TIM16) && \
  5241. (((CHANNEL) == TIM_CHANNEL_1))) \
  5242. || \
  5243. (((INSTANCE) == TIM17) && \
  5244. (((CHANNEL) == TIM_CHANNEL_1))))
  5245. #define IS_TIM_CCXN_INSTANCE(INSTANCE, CHANNEL) \
  5246. ((((INSTANCE) == TIM1) && \
  5247. (((CHANNEL) == TIM_CHANNEL_1) || \
  5248. ((CHANNEL) == TIM_CHANNEL_2) || \
  5249. ((CHANNEL) == TIM_CHANNEL_3))) \
  5250. || \
  5251. (((INSTANCE) == TIM15) && \
  5252. ((CHANNEL) == TIM_CHANNEL_1)) \
  5253. || \
  5254. (((INSTANCE) == TIM16) && \
  5255. ((CHANNEL) == TIM_CHANNEL_1)) \
  5256. || \
  5257. (((INSTANCE) == TIM17) && \
  5258. ((CHANNEL) == TIM_CHANNEL_1)))
  5259. #define IS_TIM_COUNTER_MODE_SELECT_INSTANCE(INSTANCE)\
  5260. (((INSTANCE) == TIM1) || \
  5261. ((INSTANCE) == TIM2) || \
  5262. ((INSTANCE) == TIM3))
  5263. #define IS_TIM_REPETITION_COUNTER_INSTANCE(INSTANCE)\
  5264. (((INSTANCE) == TIM1) || \
  5265. ((INSTANCE) == TIM15) || \
  5266. ((INSTANCE) == TIM16) || \
  5267. ((INSTANCE) == TIM17))
  5268. #define IS_TIM_CLOCK_DIVISION_INSTANCE(INSTANCE)\
  5269. (((INSTANCE) == TIM1) || \
  5270. ((INSTANCE) == TIM2) || \
  5271. ((INSTANCE) == TIM3) || \
  5272. ((INSTANCE) == TIM14) || \
  5273. ((INSTANCE) == TIM15) || \
  5274. ((INSTANCE) == TIM16) || \
  5275. ((INSTANCE) == TIM17))
  5276. #define IS_TIM_DMA_INSTANCE(INSTANCE)\
  5277. (((INSTANCE) == TIM1) || \
  5278. ((INSTANCE) == TIM2) || \
  5279. ((INSTANCE) == TIM3) || \
  5280. ((INSTANCE) == TIM6) || \
  5281. ((INSTANCE) == TIM7) || \
  5282. ((INSTANCE) == TIM15) || \
  5283. ((INSTANCE) == TIM16) || \
  5284. ((INSTANCE) == TIM17))
  5285. #define IS_TIM_DMA_CC_INSTANCE(INSTANCE)\
  5286. (((INSTANCE) == TIM1) || \
  5287. ((INSTANCE) == TIM2) || \
  5288. ((INSTANCE) == TIM3) || \
  5289. ((INSTANCE) == TIM15) || \
  5290. ((INSTANCE) == TIM16) || \
  5291. ((INSTANCE) == TIM17))
  5292. #define IS_TIM_COMMUTATION_EVENT_INSTANCE(INSTANCE)\
  5293. (((INSTANCE) == TIM1) || \
  5294. ((INSTANCE) == TIM15) || \
  5295. ((INSTANCE) == TIM16) || \
  5296. ((INSTANCE) == TIM17))
  5297. #define IS_TIM_REMAP_INSTANCE(INSTANCE)\
  5298. ((INSTANCE) == TIM14)
  5299. /****************************** TSC Instances *********************************/
  5300. #define IS_TSC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == TSC)
  5301. /*********************** UART Instances : IRDA mode ***************************/
  5302. #define IS_IRDA_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  5303. ((INSTANCE) == USART2))
  5304. /********************* UART Instances : Smard card mode ***********************/
  5305. #define IS_SMARTCARD_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  5306. ((INSTANCE) == USART2))
  5307. /******************** USART Instances : Synchronous mode **********************/
  5308. #define IS_USART_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  5309. ((INSTANCE) == USART2) || \
  5310. ((INSTANCE) == USART3) || \
  5311. ((INSTANCE) == USART4))
  5312. /******************** USART Instances : auto Baud rate detection **************/
  5313. #define IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  5314. ((INSTANCE) == USART2))
  5315. /******************** UART Instances : Asynchronous mode **********************/
  5316. #define IS_UART_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  5317. ((INSTANCE) == USART2) || \
  5318. ((INSTANCE) == USART3) || \
  5319. ((INSTANCE) == USART4))
  5320. /******************** UART Instances : Half-Duplex mode **********************/
  5321. #define IS_UART_HALFDUPLEX_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  5322. ((INSTANCE) == USART2) || \
  5323. ((INSTANCE) == USART3) || \
  5324. ((INSTANCE) == USART4))
  5325. /****************** UART Instances : Hardware Flow control ********************/
  5326. #define IS_UART_HWFLOW_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  5327. ((INSTANCE) == USART2) || \
  5328. ((INSTANCE) == USART3) || \
  5329. ((INSTANCE) == USART4))
  5330. /****************** UART Instances : LIN mode ********************/
  5331. #define IS_UART_LIN_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  5332. ((INSTANCE) == USART2))
  5333. /****************** UART Instances : wakeup from stop mode ********************/
  5334. #define IS_UART_WAKEUP_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  5335. ((INSTANCE) == USART2))
  5336. /****************** UART Instances : Driver enable detection ********************/
  5337. #define IS_UART_DRIVER_ENABLE_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  5338. ((INSTANCE) == USART2) || \
  5339. ((INSTANCE) == USART3) || \
  5340. ((INSTANCE) == USART4))
  5341. /****************************** USB Instances ********************************/
  5342. #define IS_USB_ALL_INSTANCE(INSTANCE) ((INSTANCE) == USB)
  5343. /****************************** WWDG Instances ********************************/
  5344. #define IS_WWDG_ALL_INSTANCE(INSTANCE) ((INSTANCE) == WWDG)
  5345. /**
  5346. * @}
  5347. */
  5348. /******************************************************************************/
  5349. /* For a painless codes migration between the STM32F0xx device product */
  5350. /* lines, the aliases defined below are put in place to overcome the */
  5351. /* differences in the interrupt handlers and IRQn definitions. */
  5352. /* No need to update developed interrupt code when moving across */
  5353. /* product lines within the same STM32F0 Family */
  5354. /******************************************************************************/
  5355. /* Aliases for __IRQn */
  5356. #define ADC1_IRQn ADC1_COMP_IRQn
  5357. #define DMA1_Ch1_IRQn DMA1_Channel1_IRQn
  5358. #define DMA1_Ch2_3_DMA2_Ch1_2_IRQn DMA1_Channel2_3_IRQn
  5359. #define DMA1_Ch4_7_DMA2_Ch3_5_IRQn DMA1_Channel4_5_6_7_IRQn
  5360. #define DMA1_Channel4_5_IRQn DMA1_Channel4_5_6_7_IRQn
  5361. #define PVD_IRQn PVD_VDDIO2_IRQn
  5362. #define VDDIO2_IRQn PVD_VDDIO2_IRQn
  5363. #define RCC_IRQn RCC_CRS_IRQn
  5364. #define TIM6_IRQn TIM6_DAC_IRQn
  5365. #define USART3_6_IRQn USART3_4_IRQn
  5366. #define USART3_8_IRQn USART3_4_IRQn
  5367. /* Aliases for __IRQHandler */
  5368. #define ADC1_IRQHandler ADC1_COMP_IRQHandler
  5369. #define DMA1_Ch1_IRQHandler DMA1_Channel1_IRQHandler
  5370. #define DMA1_Ch2_3_DMA2_Ch1_2_IRQHandler DMA1_Channel2_3_IRQHandler
  5371. #define DMA1_Ch4_7_DMA2_Ch3_5_IRQHandler DMA1_Channel4_5_6_7_IRQHandler
  5372. #define DMA1_Channel4_5_IRQHandler DMA1_Channel4_5_6_7_IRQHandler
  5373. #define PVD_IRQHandler PVD_VDDIO2_IRQHandler
  5374. #define VDDIO2_IRQHandler PVD_VDDIO2_IRQHandler
  5375. #define RCC_IRQHandler RCC_CRS_IRQHandler
  5376. #define TIM6_IRQHandler TIM6_DAC_IRQHandler
  5377. #define USART3_6_IRQHandler USART3_4_IRQHandler
  5378. #define USART3_8_IRQHandler USART3_4_IRQHandler
  5379. #ifdef __cplusplus
  5380. }
  5381. #endif /* __cplusplus */
  5382. #endif /* __STM32F072xB_H */
  5383. /**
  5384. * @}
  5385. */
  5386. /**
  5387. * @}
  5388. */
  5389. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/