stm32l152xd.h 460 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355
  1. /**
  2. ******************************************************************************
  3. * @file stm32l152xd.h
  4. * @author MCD Application Team
  5. * @version V2.0.0
  6. * @date 5-September-2014
  7. * @brief CMSIS Cortex-M3 Device Peripheral Access Layer Header File.
  8. * This file contains all the peripheral register's definitions, bits
  9. * definitions and memory mapping for STM32L1xx devices.
  10. *
  11. * This file contains:
  12. * - Data structures and the address mapping for all peripherals
  13. * - Peripheral's registers declarations and bits definition
  14. * - Macros to access peripheral’s registers hardware
  15. *
  16. ******************************************************************************
  17. * @attention
  18. *
  19. * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
  20. *
  21. * Redistribution and use in source and binary forms, with or without modification,
  22. * are permitted provided that the following conditions are met:
  23. * 1. Redistributions of source code must retain the above copyright notice,
  24. * this list of conditions and the following disclaimer.
  25. * 2. Redistributions in binary form must reproduce the above copyright notice,
  26. * this list of conditions and the following disclaimer in the documentation
  27. * and/or other materials provided with the distribution.
  28. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  29. * may be used to endorse or promote products derived from this software
  30. * without specific prior written permission.
  31. *
  32. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  33. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  34. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  35. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  36. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  37. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  38. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  39. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  40. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  41. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  42. *
  43. ******************************************************************************
  44. */
  45. /** @addtogroup CMSIS
  46. * @{
  47. */
  48. /** @addtogroup stm32l152xd
  49. * @{
  50. */
  51. #ifndef __STM32L152xD_H
  52. #define __STM32L152xD_H
  53. #ifdef __cplusplus
  54. extern "C" {
  55. #endif
  56. /** @addtogroup Configuration_section_for_CMSIS
  57. * @{
  58. */
  59. /**
  60. * @brief Configuration of the Cortex-M3 Processor and Core Peripherals
  61. */
  62. #define __CM3_REV 0x200 /*!< Cortex-M3 Revision r2p0 */
  63. #define __MPU_PRESENT 1 /*!< STM32L1xx provides MPU */
  64. #define __NVIC_PRIO_BITS 4 /*!< STM32L1xx uses 4 Bits for the Priority Levels */
  65. #define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
  66. /**
  67. * @}
  68. */
  69. /** @addtogroup Peripheral_interrupt_number_definition
  70. * @{
  71. */
  72. /**
  73. * @brief STM32L1xx Interrupt Number Definition, according to the selected device
  74. * in @ref Library_configuration_section
  75. */
  76. /*!< Interrupt Number Definition */
  77. typedef enum
  78. {
  79. /****** Cortex-M3 Processor Exceptions Numbers ******************************************************/
  80. NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */
  81. MemoryManagement_IRQn = -12, /*!< 4 Cortex-M3 Memory Management Interrupt */
  82. BusFault_IRQn = -11, /*!< 5 Cortex-M3 Bus Fault Interrupt */
  83. UsageFault_IRQn = -10, /*!< 6 Cortex-M3 Usage Fault Interrupt */
  84. SVC_IRQn = -5, /*!< 11 Cortex-M3 SV Call Interrupt */
  85. DebugMonitor_IRQn = -4, /*!< 12 Cortex-M3 Debug Monitor Interrupt */
  86. PendSV_IRQn = -2, /*!< 14 Cortex-M3 Pend SV Interrupt */
  87. SysTick_IRQn = -1, /*!< 15 Cortex-M3 System Tick Interrupt */
  88. /****** STM32L specific Interrupt Numbers ***********************************************************/
  89. WWDG_IRQn = 0, /*!< Window WatchDog Interrupt */
  90. PVD_IRQn = 1, /*!< PVD through EXTI Line detection Interrupt */
  91. TAMPER_STAMP_IRQn = 2, /*!< Tamper and TimeStamp interrupts through the EXTI line */
  92. RTC_WKUP_IRQn = 3, /*!< RTC Wakeup Timer through EXTI Line Interrupt */
  93. FLASH_IRQn = 4, /*!< FLASH global Interrupt */
  94. RCC_IRQn = 5, /*!< RCC global Interrupt */
  95. EXTI0_IRQn = 6, /*!< EXTI Line0 Interrupt */
  96. EXTI1_IRQn = 7, /*!< EXTI Line1 Interrupt */
  97. EXTI2_IRQn = 8, /*!< EXTI Line2 Interrupt */
  98. EXTI3_IRQn = 9, /*!< EXTI Line3 Interrupt */
  99. EXTI4_IRQn = 10, /*!< EXTI Line4 Interrupt */
  100. DMA1_Channel1_IRQn = 11, /*!< DMA1 Channel 1 global Interrupt */
  101. DMA1_Channel2_IRQn = 12, /*!< DMA1 Channel 2 global Interrupt */
  102. DMA1_Channel3_IRQn = 13, /*!< DMA1 Channel 3 global Interrupt */
  103. DMA1_Channel4_IRQn = 14, /*!< DMA1 Channel 4 global Interrupt */
  104. DMA1_Channel5_IRQn = 15, /*!< DMA1 Channel 5 global Interrupt */
  105. DMA1_Channel6_IRQn = 16, /*!< DMA1 Channel 6 global Interrupt */
  106. DMA1_Channel7_IRQn = 17, /*!< DMA1 Channel 7 global Interrupt */
  107. ADC1_IRQn = 18, /*!< ADC1 global Interrupt */
  108. USB_HP_IRQn = 19, /*!< USB High Priority Interrupt */
  109. USB_LP_IRQn = 20, /*!< USB Low Priority Interrupt */
  110. DAC_IRQn = 21, /*!< DAC Interrupt */
  111. COMP_IRQn = 22, /*!< Comparator through EXTI Line Interrupt */
  112. EXTI9_5_IRQn = 23, /*!< External Line[9:5] Interrupts */
  113. LCD_IRQn = 24, /*!< LCD Interrupt */
  114. TIM9_IRQn = 25, /*!< TIM9 global Interrupt */
  115. TIM10_IRQn = 26, /*!< TIM10 global Interrupt */
  116. TIM11_IRQn = 27, /*!< TIM11 global Interrupt */
  117. TIM2_IRQn = 28, /*!< TIM2 global Interrupt */
  118. TIM3_IRQn = 29, /*!< TIM3 global Interrupt */
  119. TIM4_IRQn = 30, /*!< TIM4 global Interrupt */
  120. I2C1_EV_IRQn = 31, /*!< I2C1 Event Interrupt */
  121. I2C1_ER_IRQn = 32, /*!< I2C1 Error Interrupt */
  122. I2C2_EV_IRQn = 33, /*!< I2C2 Event Interrupt */
  123. I2C2_ER_IRQn = 34, /*!< I2C2 Error Interrupt */
  124. SPI1_IRQn = 35, /*!< SPI1 global Interrupt */
  125. SPI2_IRQn = 36, /*!< SPI2 global Interrupt */
  126. USART1_IRQn = 37, /*!< USART1 global Interrupt */
  127. USART2_IRQn = 38, /*!< USART2 global Interrupt */
  128. USART3_IRQn = 39, /*!< USART3 global Interrupt */
  129. EXTI15_10_IRQn = 40, /*!< External Line[15:10] Interrupts */
  130. RTC_Alarm_IRQn = 41, /*!< RTC Alarm through EXTI Line Interrupt */
  131. USB_FS_WKUP_IRQn = 42, /*!< USB FS WakeUp from suspend through EXTI Line Interrupt */
  132. TIM6_IRQn = 43, /*!< TIM6 global Interrupt */
  133. TIM7_IRQn = 44, /*!< TIM7 global Interrupt */
  134. SDIO_IRQn = 45, /*!< SDIO global Interrupt */
  135. TIM5_IRQn = 46, /*!< TIM5 global Interrupt */
  136. SPI3_IRQn = 47, /*!< SPI3 global Interrupt */
  137. UART4_IRQn = 48, /*!< UART4 global Interrupt */
  138. UART5_IRQn = 49, /*!< UART5 global Interrupt */
  139. DMA2_Channel1_IRQn = 50, /*!< DMA2 Channel 1 global Interrupt */
  140. DMA2_Channel2_IRQn = 51, /*!< DMA2 Channel 2 global Interrupt */
  141. DMA2_Channel3_IRQn = 52, /*!< DMA2 Channel 3 global Interrupt */
  142. DMA2_Channel4_IRQn = 53, /*!< DMA2 Channel 4 global Interrupt */
  143. DMA2_Channel5_IRQn = 54, /*!< DMA2 Channel 5 global Interrupt */
  144. COMP_ACQ_IRQn = 56 /*!< Comparator Channel Acquisition global Interrupt */
  145. } IRQn_Type;
  146. /**
  147. * @}
  148. */
  149. #include "core_cm3.h"
  150. #include "system_stm32l1xx.h"
  151. #include <stdint.h>
  152. /** @addtogroup Peripheral_registers_structures
  153. * @{
  154. */
  155. /**
  156. * @brief Analog to Digital Converter
  157. */
  158. typedef struct
  159. {
  160. __IO uint32_t SR; /*!< ADC status register, Address offset: 0x00 */
  161. __IO uint32_t CR1; /*!< ADC control register 1, Address offset: 0x04 */
  162. __IO uint32_t CR2; /*!< ADC control register 2, Address offset: 0x08 */
  163. __IO uint32_t SMPR1; /*!< ADC sample time register 1, Address offset: 0x0C */
  164. __IO uint32_t SMPR2; /*!< ADC sample time register 2, Address offset: 0x10 */
  165. __IO uint32_t SMPR3; /*!< ADC sample time register 3, Address offset: 0x14 */
  166. __IO uint32_t JOFR1; /*!< ADC injected channel data offset register 1, Address offset: 0x18 */
  167. __IO uint32_t JOFR2; /*!< ADC injected channel data offset register 2, Address offset: 0x1C */
  168. __IO uint32_t JOFR3; /*!< ADC injected channel data offset register 3, Address offset: 0x20 */
  169. __IO uint32_t JOFR4; /*!< ADC injected channel data offset register 4, Address offset: 0x24 */
  170. __IO uint32_t HTR; /*!< ADC watchdog higher threshold register, Address offset: 0x28 */
  171. __IO uint32_t LTR; /*!< ADC watchdog lower threshold register, Address offset: 0x2C */
  172. __IO uint32_t SQR1; /*!< ADC regular sequence register 1, Address offset: 0x30 */
  173. __IO uint32_t SQR2; /*!< ADC regular sequence register 2, Address offset: 0x34 */
  174. __IO uint32_t SQR3; /*!< ADC regular sequence register 3, Address offset: 0x38 */
  175. __IO uint32_t SQR4; /*!< ADC regular sequence register 4, Address offset: 0x3C */
  176. __IO uint32_t SQR5; /*!< ADC regular sequence register 5, Address offset: 0x40 */
  177. __IO uint32_t JSQR; /*!< ADC injected sequence register, Address offset: 0x44 */
  178. __IO uint32_t JDR1; /*!< ADC injected data register 1, Address offset: 0x48 */
  179. __IO uint32_t JDR2; /*!< ADC injected data register 2, Address offset: 0x4C */
  180. __IO uint32_t JDR3; /*!< ADC injected data register 3, Address offset: 0x50 */
  181. __IO uint32_t JDR4; /*!< ADC injected data register 4, Address offset: 0x54 */
  182. __IO uint32_t DR; /*!< ADC regular data register, Address offset: 0x58 */
  183. __IO uint32_t SMPR0; /*!< ADC sample time register 0, Address offset: 0x5C */
  184. } ADC_TypeDef;
  185. typedef struct
  186. {
  187. __IO uint32_t CSR; /*!< ADC common status register, Address offset: ADC1 base address + 0x300 */
  188. __IO uint32_t CCR; /*!< ADC common control register, Address offset: ADC1 base address + 0x304 */
  189. } ADC_Common_TypeDef;
  190. /**
  191. * @brief Comparator
  192. */
  193. typedef struct
  194. {
  195. __IO uint32_t CSR; /*!< COMP comparator control and status register, Address offset: 0x00 */
  196. } COMP_TypeDef;
  197. /**
  198. * @brief CRC calculation unit
  199. */
  200. typedef struct
  201. {
  202. __IO uint32_t DR; /*!< CRC Data register, Address offset: 0x00 */
  203. __IO uint32_t IDR; /*!< CRC Independent data register, Address offset: 0x04 */
  204. __IO uint32_t CR; /*!< CRC Control register, Address offset: 0x08 */
  205. } CRC_TypeDef;
  206. /**
  207. * @brief Digital to Analog Converter
  208. */
  209. typedef struct
  210. {
  211. __IO uint32_t CR; /*!< DAC control register, Address offset: 0x00 */
  212. __IO uint32_t SWTRIGR; /*!< DAC software trigger register, Address offset: 0x04 */
  213. __IO uint32_t DHR12R1; /*!< DAC channel1 12-bit right-aligned data holding register, Address offset: 0x08 */
  214. __IO uint32_t DHR12L1; /*!< DAC channel1 12-bit left aligned data holding register, Address offset: 0x0C */
  215. __IO uint32_t DHR8R1; /*!< DAC channel1 8-bit right aligned data holding register, Address offset: 0x10 */
  216. __IO uint32_t DHR12R2; /*!< DAC channel2 12-bit right aligned data holding register, Address offset: 0x14 */
  217. __IO uint32_t DHR12L2; /*!< DAC channel2 12-bit left aligned data holding register, Address offset: 0x18 */
  218. __IO uint32_t DHR8R2; /*!< DAC channel2 8-bit right-aligned data holding register, Address offset: 0x1C */
  219. __IO uint32_t DHR12RD; /*!< Dual DAC 12-bit right-aligned data holding register, Address offset: 0x20 */
  220. __IO uint32_t DHR12LD; /*!< DUAL DAC 12-bit left aligned data holding register, Address offset: 0x24 */
  221. __IO uint32_t DHR8RD; /*!< DUAL DAC 8-bit right aligned data holding register, Address offset: 0x28 */
  222. __IO uint32_t DOR1; /*!< DAC channel1 data output register, Address offset: 0x2C */
  223. __IO uint32_t DOR2; /*!< DAC channel2 data output register, Address offset: 0x30 */
  224. __IO uint32_t SR; /*!< DAC status register, Address offset: 0x34 */
  225. } DAC_TypeDef;
  226. /**
  227. * @brief Debug MCU
  228. */
  229. typedef struct
  230. {
  231. __IO uint32_t IDCODE; /*!< MCU device ID code, Address offset: 0x00 */
  232. __IO uint32_t CR; /*!< Debug MCU configuration register, Address offset: 0x04 */
  233. __IO uint32_t APB1FZ; /*!< Debug MCU APB1 freeze register, Address offset: 0x08 */
  234. __IO uint32_t APB2FZ; /*!< Debug MCU APB2 freeze register, Address offset: 0x0C */
  235. }DBGMCU_TypeDef;
  236. /**
  237. * @brief DMA Controller
  238. */
  239. typedef struct
  240. {
  241. __IO uint32_t CCR; /*!< DMA channel x configuration register */
  242. __IO uint32_t CNDTR; /*!< DMA channel x number of data register */
  243. __IO uint32_t CPAR; /*!< DMA channel x peripheral address register */
  244. __IO uint32_t CMAR; /*!< DMA channel x memory address register */
  245. } DMA_Channel_TypeDef;
  246. typedef struct
  247. {
  248. __IO uint32_t ISR; /*!< DMA interrupt status register, Address offset: 0x00 */
  249. __IO uint32_t IFCR; /*!< DMA interrupt flag clear register, Address offset: 0x04 */
  250. } DMA_TypeDef;
  251. /**
  252. * @brief External Interrupt/Event Controller
  253. */
  254. typedef struct
  255. {
  256. __IO uint32_t IMR; /*!<EXTI Interrupt mask register, Address offset: 0x00 */
  257. __IO uint32_t EMR; /*!<EXTI Event mask register, Address offset: 0x04 */
  258. __IO uint32_t RTSR; /*!<EXTI Rising trigger selection register , Address offset: 0x08 */
  259. __IO uint32_t FTSR; /*!<EXTI Falling trigger selection register, Address offset: 0x0C */
  260. __IO uint32_t SWIER; /*!<EXTI Software interrupt event register, Address offset: 0x10 */
  261. __IO uint32_t PR; /*!<EXTI Pending register, Address offset: 0x14 */
  262. } EXTI_TypeDef;
  263. /**
  264. * @brief FLASH Registers
  265. */
  266. typedef struct
  267. {
  268. __IO uint32_t ACR; /*!< Access control register, Address offset: 0x00 */
  269. __IO uint32_t PECR; /*!< Program/erase control register, Address offset: 0x04 */
  270. __IO uint32_t PDKEYR; /*!< Power down key register, Address offset: 0x08 */
  271. __IO uint32_t PEKEYR; /*!< Program/erase key register, Address offset: 0x0c */
  272. __IO uint32_t PRGKEYR; /*!< Program memory key register, Address offset: 0x10 */
  273. __IO uint32_t OPTKEYR; /*!< Option byte key register, Address offset: 0x14 */
  274. __IO uint32_t SR; /*!< Status register, Address offset: 0x18 */
  275. __IO uint32_t OBR; /*!< Option byte register, Address offset: 0x1c */
  276. __IO uint32_t WRPR1; /*!< Write protection register 1, Address offset: 0x20 */
  277. uint32_t RESERVED[23]; /*!< Reserved, Address offset: 0x24 */
  278. __IO uint32_t WRPR2; /*!< Write protection register 2, Address offset: 0x80 */
  279. __IO uint32_t WRPR3; /*!< Write protection register 3, Address offset: 0x84 */
  280. } FLASH_TypeDef;
  281. /**
  282. * @brief Option Bytes Registers
  283. */
  284. typedef struct
  285. {
  286. __IO uint32_t RDP; /*!< Read protection register, Address offset: 0x00 */
  287. __IO uint32_t USER; /*!< user register, Address offset: 0x04 */
  288. __IO uint32_t WRP01; /*!< write protection register 0 1, Address offset: 0x08 */
  289. __IO uint32_t WRP23; /*!< write protection register 2 3, Address offset: 0x0C */
  290. __IO uint32_t WRP45; /*!< write protection register 4 5, Address offset: 0x10 */
  291. __IO uint32_t WRP67; /*!< write protection register 6 7, Address offset: 0x14 */
  292. __IO uint32_t WRP89; /*!< write protection register 8 9, Address offset: 0x18 */
  293. __IO uint32_t WRP1011; /*!< write protection register 10 11, Address offset: 0x1C */
  294. } OB_TypeDef;
  295. /**
  296. * @brief Operational Amplifier (OPAMP)
  297. */
  298. typedef struct
  299. {
  300. __IO uint32_t CSR; /*!< OPAMP control/status register, Address offset: 0x00 */
  301. __IO uint32_t OTR; /*!< OPAMP offset trimming register for normal mode, Address offset: 0x04 */
  302. __IO uint32_t LPOTR; /*!< OPAMP offset trimming register for low power mode, Address offset: 0x08 */
  303. } OPAMP_TypeDef;
  304. /**
  305. * @brief Flexible Static Memory Controller
  306. */
  307. typedef struct
  308. {
  309. __IO uint32_t BTCR[8]; /*!< NOR/PSRAM chip-select control register(BCR) and chip-select timing register(BTR), Address offset: 0x00-1C */
  310. } FSMC_Bank1_TypeDef;
  311. /**
  312. * @brief Flexible Static Memory Controller Bank1E
  313. */
  314. typedef struct
  315. {
  316. __IO uint32_t BWTR[7]; /*!< NOR/PSRAM write timing registers, Address offset: 0x104-0x11C */
  317. } FSMC_Bank1E_TypeDef;
  318. /**
  319. * @brief General Purpose IO
  320. */
  321. typedef struct
  322. {
  323. __IO uint32_t MODER; /*!< GPIO port mode register, Address offset: 0x00 */
  324. __IO uint32_t OTYPER; /*!< GPIO port output type register, Address offset: 0x04 */
  325. __IO uint32_t OSPEEDR; /*!< GPIO port output speed register, Address offset: 0x08 */
  326. __IO uint32_t PUPDR; /*!< GPIO port pull-up/pull-down register, Address offset: 0x0C */
  327. __IO uint32_t IDR; /*!< GPIO port input data register, Address offset: 0x10 */
  328. __IO uint32_t ODR; /*!< GPIO port output data register, Address offset: 0x14 */
  329. __IO uint32_t BSRR; /*!< GPIO port bit set/reset registerBSRR, Address offset: 0x18 */
  330. __IO uint32_t LCKR; /*!< GPIO port configuration lock register, Address offset: 0x1C */
  331. __IO uint32_t AFR[2]; /*!< GPIO alternate function register, Address offset: 0x20-0x24 */
  332. __IO uint32_t BRR; /*!< GPIO bit reset register, Address offset: 0x28 */
  333. } GPIO_TypeDef;
  334. /**
  335. * @brief SysTem Configuration
  336. */
  337. typedef struct
  338. {
  339. __IO uint32_t MEMRMP; /*!< SYSCFG memory remap register, Address offset: 0x00 */
  340. __IO uint32_t PMC; /*!< SYSCFG peripheral mode configuration register, Address offset: 0x04 */
  341. __IO uint32_t EXTICR[4]; /*!< SYSCFG external interrupt configuration registers, Address offset: 0x08-0x14 */
  342. } SYSCFG_TypeDef;
  343. /**
  344. * @brief Inter-integrated Circuit Interface
  345. */
  346. typedef struct
  347. {
  348. __IO uint32_t CR1; /*!< I2C Control register 1, Address offset: 0x00 */
  349. __IO uint32_t CR2; /*!< I2C Control register 2, Address offset: 0x04 */
  350. __IO uint32_t OAR1; /*!< I2C Own address register 1, Address offset: 0x08 */
  351. __IO uint32_t OAR2; /*!< I2C Own address register 2, Address offset: 0x0C */
  352. __IO uint32_t DR; /*!< I2C Data register, Address offset: 0x10 */
  353. __IO uint32_t SR1; /*!< I2C Status register 1, Address offset: 0x14 */
  354. __IO uint32_t SR2; /*!< I2C Status register 2, Address offset: 0x18 */
  355. __IO uint32_t CCR; /*!< I2C Clock control register, Address offset: 0x1C */
  356. __IO uint32_t TRISE; /*!< I2C TRISE register, Address offset: 0x20 */
  357. } I2C_TypeDef;
  358. /**
  359. * @brief Independent WATCHDOG
  360. */
  361. typedef struct
  362. {
  363. __IO uint32_t KR; /*!< Key register, Address offset: 0x00 */
  364. __IO uint32_t PR; /*!< Prescaler register, Address offset: 0x04 */
  365. __IO uint32_t RLR; /*!< Reload register, Address offset: 0x08 */
  366. __IO uint32_t SR; /*!< Status register, Address offset: 0x0C */
  367. } IWDG_TypeDef;
  368. /**
  369. * @brief LCD
  370. */
  371. typedef struct
  372. {
  373. __IO uint32_t CR; /*!< LCD control register, Address offset: 0x00 */
  374. __IO uint32_t FCR; /*!< LCD frame control register, Address offset: 0x04 */
  375. __IO uint32_t SR; /*!< LCD status register, Address offset: 0x08 */
  376. __IO uint32_t CLR; /*!< LCD clear register, Address offset: 0x0C */
  377. uint32_t RESERVED; /*!< Reserved, Address offset: 0x10 */
  378. __IO uint32_t RAM[16]; /*!< LCD display memory, Address offset: 0x14-0x50 */
  379. } LCD_TypeDef;
  380. /**
  381. * @brief Power Control
  382. */
  383. typedef struct
  384. {
  385. __IO uint32_t CR; /*!< PWR power control register, Address offset: 0x00 */
  386. __IO uint32_t CSR; /*!< PWR power control/status register, Address offset: 0x04 */
  387. } PWR_TypeDef;
  388. /**
  389. * @brief Reset and Clock Control
  390. */
  391. typedef struct
  392. {
  393. __IO uint32_t CR; /*!< RCC clock control register, Address offset: 0x00 */
  394. __IO uint32_t ICSCR; /*!< RCC Internal clock sources calibration register, Address offset: 0x04 */
  395. __IO uint32_t CFGR; /*!< RCC Clock configuration register, Address offset: 0x08 */
  396. __IO uint32_t CIR; /*!< RCC Clock interrupt register, Address offset: 0x0C */
  397. __IO uint32_t AHBRSTR; /*!< RCC AHB peripheral reset register, Address offset: 0x10 */
  398. __IO uint32_t APB2RSTR; /*!< RCC APB2 peripheral reset register, Address offset: 0x14 */
  399. __IO uint32_t APB1RSTR; /*!< RCC APB1 peripheral reset register, Address offset: 0x18 */
  400. __IO uint32_t AHBENR; /*!< RCC AHB peripheral clock enable register, Address offset: 0x1C */
  401. __IO uint32_t APB2ENR; /*!< RCC APB2 peripheral clock enable register, Address offset: 0x20 */
  402. __IO uint32_t APB1ENR; /*!< RCC APB1 peripheral clock enable register, Address offset: 0x24 */
  403. __IO uint32_t AHBLPENR; /*!< RCC AHB peripheral clock enable in low power mode register, Address offset: 0x28 */
  404. __IO uint32_t APB2LPENR; /*!< RCC APB2 peripheral clock enable in low power mode register, Address offset: 0x2C */
  405. __IO uint32_t APB1LPENR; /*!< RCC APB1 peripheral clock enable in low power mode register, Address offset: 0x30 */
  406. __IO uint32_t CSR; /*!< RCC Control/status register, Address offset: 0x34 */
  407. } RCC_TypeDef;
  408. /**
  409. * @brief Routing Interface
  410. */
  411. typedef struct
  412. {
  413. __IO uint32_t ICR; /*!< RI input capture register, Address offset: 0x00 */
  414. __IO uint32_t ASCR1; /*!< RI analog switches control register, Address offset: 0x04 */
  415. __IO uint32_t ASCR2; /*!< RI analog switch control register 2, Address offset: 0x08 */
  416. __IO uint32_t HYSCR1; /*!< RI hysteresis control register, Address offset: 0x0C */
  417. __IO uint32_t HYSCR2; /*!< RI Hysteresis control register, Address offset: 0x10 */
  418. __IO uint32_t HYSCR3; /*!< RI Hysteresis control register, Address offset: 0x14 */
  419. __IO uint32_t HYSCR4; /*!< RI Hysteresis control register, Address offset: 0x18 */
  420. __IO uint32_t ASMR1; /*!< RI Analog switch mode register 1, Address offset: 0x1C */
  421. __IO uint32_t CMR1; /*!< RI Channel mask register 1, Address offset: 0x20 */
  422. __IO uint32_t CICR1; /*!< RI Channel Iden for capture register 1, Address offset: 0x24 */
  423. __IO uint32_t ASMR2; /*!< RI Analog switch mode register 2, Address offset: 0x28 */
  424. __IO uint32_t CMR2; /*!< RI Channel mask register 2, Address offset: 0x2C */
  425. __IO uint32_t CICR2; /*!< RI Channel Iden for capture register 2, Address offset: 0x30 */
  426. __IO uint32_t ASMR3; /*!< RI Analog switch mode register 3, Address offset: 0x34 */
  427. __IO uint32_t CMR3; /*!< RI Channel mask register 3, Address offset: 0x38 */
  428. __IO uint32_t CICR3; /*!< RI Channel Iden for capture register 3, Address offset: 0x3C */
  429. __IO uint32_t ASMR4; /*!< RI Analog switch mode register 4, Address offset: 0x40 */
  430. __IO uint32_t CMR4; /*!< RI Channel mask register 4, Address offset: 0x44 */
  431. __IO uint32_t CICR4; /*!< RI Channel Iden for capture register 4, Address offset: 0x48 */
  432. __IO uint32_t ASMR5; /*!< RI Analog switch mode register 5, Address offset: 0x4C */
  433. __IO uint32_t CMR5; /*!< RI Channel mask register 5, Address offset: 0x50 */
  434. __IO uint32_t CICR5; /*!< RI Channel Iden for capture register 5, Address offset: 0x54 */
  435. } RI_TypeDef;
  436. /**
  437. * @brief Real-Time Clock
  438. */
  439. typedef struct
  440. {
  441. __IO uint32_t TR; /*!< RTC time register, Address offset: 0x00 */
  442. __IO uint32_t DR; /*!< RTC date register, Address offset: 0x04 */
  443. __IO uint32_t CR; /*!< RTC control register, Address offset: 0x08 */
  444. __IO uint32_t ISR; /*!< RTC initialization and status register, Address offset: 0x0C */
  445. __IO uint32_t PRER; /*!< RTC prescaler register, Address offset: 0x10 */
  446. __IO uint32_t WUTR; /*!< RTC wakeup timer register, Address offset: 0x14 */
  447. __IO uint32_t CALIBR; /*!< RTC calibration register, Address offset: 0x18 */
  448. __IO uint32_t ALRMAR; /*!< RTC alarm A register, Address offset: 0x1C */
  449. __IO uint32_t ALRMBR; /*!< RTC alarm B register, Address offset: 0x20 */
  450. __IO uint32_t WPR; /*!< RTC write protection register, Address offset: 0x24 */
  451. __IO uint32_t SSR; /*!< RTC sub second register, Address offset: 0x28 */
  452. __IO uint32_t SHIFTR; /*!< RTC shift control register, Address offset: 0x2C */
  453. __IO uint32_t TSTR; /*!< RTC time stamp time register, Address offset: 0x30 */
  454. __IO uint32_t TSDR; /*!< RTC time stamp date register, Address offset: 0x34 */
  455. __IO uint32_t TSSSR; /*!< RTC time-stamp sub second register, Address offset: 0x38 */
  456. __IO uint32_t CALR; /*!< RRTC calibration register, Address offset: 0x3C */
  457. __IO uint32_t TAFCR; /*!< RTC tamper and alternate function configuration register, Address offset: 0x40 */
  458. __IO uint32_t ALRMASSR; /*!< RTC alarm A sub second register, Address offset: 0x44 */
  459. __IO uint32_t ALRMBSSR; /*!< RTC alarm B sub second register, Address offset: 0x48 */
  460. uint32_t RESERVED7; /*!< Reserved, 0x4C */
  461. __IO uint32_t BKP0R; /*!< RTC backup register 0, Address offset: 0x50 */
  462. __IO uint32_t BKP1R; /*!< RTC backup register 1, Address offset: 0x54 */
  463. __IO uint32_t BKP2R; /*!< RTC backup register 2, Address offset: 0x58 */
  464. __IO uint32_t BKP3R; /*!< RTC backup register 3, Address offset: 0x5C */
  465. __IO uint32_t BKP4R; /*!< RTC backup register 4, Address offset: 0x60 */
  466. __IO uint32_t BKP5R; /*!< RTC backup register 5, Address offset: 0x64 */
  467. __IO uint32_t BKP6R; /*!< RTC backup register 6, Address offset: 0x68 */
  468. __IO uint32_t BKP7R; /*!< RTC backup register 7, Address offset: 0x6C */
  469. __IO uint32_t BKP8R; /*!< RTC backup register 8, Address offset: 0x70 */
  470. __IO uint32_t BKP9R; /*!< RTC backup register 9, Address offset: 0x74 */
  471. __IO uint32_t BKP10R; /*!< RTC backup register 10, Address offset: 0x78 */
  472. __IO uint32_t BKP11R; /*!< RTC backup register 11, Address offset: 0x7C */
  473. __IO uint32_t BKP12R; /*!< RTC backup register 12, Address offset: 0x80 */
  474. __IO uint32_t BKP13R; /*!< RTC backup register 13, Address offset: 0x84 */
  475. __IO uint32_t BKP14R; /*!< RTC backup register 14, Address offset: 0x88 */
  476. __IO uint32_t BKP15R; /*!< RTC backup register 15, Address offset: 0x8C */
  477. __IO uint32_t BKP16R; /*!< RTC backup register 16, Address offset: 0x90 */
  478. __IO uint32_t BKP17R; /*!< RTC backup register 17, Address offset: 0x94 */
  479. __IO uint32_t BKP18R; /*!< RTC backup register 18, Address offset: 0x98 */
  480. __IO uint32_t BKP19R; /*!< RTC backup register 19, Address offset: 0x9C */
  481. __IO uint32_t BKP20R; /*!< RTC backup register 20, Address offset: 0xA0 */
  482. __IO uint32_t BKP21R; /*!< RTC backup register 21, Address offset: 0xA4 */
  483. __IO uint32_t BKP22R; /*!< RTC backup register 22, Address offset: 0xA8 */
  484. __IO uint32_t BKP23R; /*!< RTC backup register 23, Address offset: 0xAC */
  485. __IO uint32_t BKP24R; /*!< RTC backup register 24, Address offset: 0xB0 */
  486. __IO uint32_t BKP25R; /*!< RTC backup register 25, Address offset: 0xB4 */
  487. __IO uint32_t BKP26R; /*!< RTC backup register 26, Address offset: 0xB8 */
  488. __IO uint32_t BKP27R; /*!< RTC backup register 27, Address offset: 0xBC */
  489. __IO uint32_t BKP28R; /*!< RTC backup register 28, Address offset: 0xC0 */
  490. __IO uint32_t BKP29R; /*!< RTC backup register 29, Address offset: 0xC4 */
  491. __IO uint32_t BKP30R; /*!< RTC backup register 30, Address offset: 0xC8 */
  492. __IO uint32_t BKP31R; /*!< RTC backup register 31, Address offset: 0xCC */
  493. } RTC_TypeDef;
  494. /**
  495. * @brief SD host Interface
  496. */
  497. typedef struct
  498. {
  499. __IO uint32_t POWER; /*!< SDIO power control register, Address offset: 0x00 */
  500. __IO uint32_t CLKCR; /*!< SDI clock control register, Address offset: 0x04 */
  501. __IO uint32_t ARG; /*!< SDIO argument register, Address offset: 0x08 */
  502. __IO uint32_t CMD; /*!< SDIO command register, Address offset: 0x0C */
  503. __IO const uint32_t RESPCMD; /*!< SDIO command response register, Address offset: 0x10 */
  504. __IO const uint32_t RESP1; /*!< SDIO response 1 register, Address offset: 0x14 */
  505. __IO const uint32_t RESP2; /*!< SDIO response 2 register, Address offset: 0x18 */
  506. __IO const uint32_t RESP3; /*!< SDIO response 3 register, Address offset: 0x1C */
  507. __IO const uint32_t RESP4; /*!< SDIO response 4 register, Address offset: 0x20 */
  508. __IO uint32_t DTIMER; /*!< SDIO data timer register, Address offset: 0x24 */
  509. __IO uint32_t DLEN; /*!< SDIO data length register, Address offset: 0x28 */
  510. __IO uint32_t DCTRL; /*!< SDIO data control register, Address offset: 0x2C */
  511. __IO const uint32_t DCOUNT; /*!< SDIO data counter register, Address offset: 0x30 */
  512. __IO const uint32_t STA; /*!< SDIO status register, Address offset: 0x34 */
  513. __IO uint32_t ICR; /*!< SDIO interrupt clear register, Address offset: 0x38 */
  514. __IO uint32_t MASK; /*!< SDIO mask register, Address offset: 0x3C */
  515. uint32_t RESERVED0[2]; /*!< Reserved, 0x40-0x44 */
  516. __IO const uint32_t FIFOCNT; /*!< SDIO FIFO counter register, Address offset: 0x48 */
  517. uint32_t RESERVED1[13]; /*!< Reserved, 0x4C-0x7C */
  518. __IO uint32_t FIFO; /*!< SDIO data FIFO register, Address offset: 0x80 */
  519. } SDIO_TypeDef;
  520. /**
  521. * @brief Serial Peripheral Interface
  522. */
  523. typedef struct
  524. {
  525. __IO uint32_t CR1; /*!< SPI Control register 1 (not used in I2S mode), Address offset: 0x00 */
  526. __IO uint32_t CR2; /*!< SPI Control register 2, Address offset: 0x04 */
  527. __IO uint32_t SR; /*!< SPI Status register, Address offset: 0x08 */
  528. __IO uint32_t DR; /*!< SPI data register, Address offset: 0x0C */
  529. __IO uint32_t CRCPR; /*!< SPI CRC polynomial register (not used in I2S mode), Address offset: 0x10 */
  530. __IO uint32_t RXCRCR; /*!< SPI Rx CRC register (not used in I2S mode), Address offset: 0x14 */
  531. __IO uint32_t TXCRCR; /*!< SPI Tx CRC register (not used in I2S mode), Address offset: 0x18 */
  532. __IO uint32_t I2SCFGR; /*!< SPI_I2S configuration register, Address offset: 0x1C */
  533. __IO uint32_t I2SPR; /*!< SPI_I2S prescaler register, Address offset: 0x20 */
  534. } SPI_TypeDef;
  535. /**
  536. * @brief TIM
  537. */
  538. typedef struct
  539. {
  540. __IO uint32_t CR1; /*!< TIM control register 1, Address offset: 0x00 */
  541. __IO uint32_t CR2; /*!< TIM control register 2, Address offset: 0x04 */
  542. __IO uint32_t SMCR; /*!< TIM slave Mode Control register, Address offset: 0x08 */
  543. __IO uint32_t DIER; /*!< TIM DMA/interrupt enable register, Address offset: 0x0C */
  544. __IO uint32_t SR; /*!< TIM status register, Address offset: 0x10 */
  545. __IO uint32_t EGR; /*!< TIM event generation register, Address offset: 0x14 */
  546. __IO uint32_t CCMR1; /*!< TIM capture/compare mode register 1, Address offset: 0x18 */
  547. __IO uint32_t CCMR2; /*!< TIM capture/compare mode register 2, Address offset: 0x1C */
  548. __IO uint32_t CCER; /*!< TIM capture/compare enable register, Address offset: 0x20 */
  549. __IO uint32_t CNT; /*!< TIM counter register, Address offset: 0x24 */
  550. __IO uint32_t PSC; /*!< TIM prescaler register, Address offset: 0x28 */
  551. __IO uint32_t ARR; /*!< TIM auto-reload register, Address offset: 0x2C */
  552. uint32_t RESERVED12; /*!< Reserved, 0x30 */
  553. __IO uint32_t CCR1; /*!< TIM capture/compare register 1, Address offset: 0x34 */
  554. __IO uint32_t CCR2; /*!< TIM capture/compare register 2, Address offset: 0x38 */
  555. __IO uint32_t CCR3; /*!< TIM capture/compare register 3, Address offset: 0x3C */
  556. __IO uint32_t CCR4; /*!< TIM capture/compare register 4, Address offset: 0x40 */
  557. uint32_t RESERVED17; /*!< Reserved, 0x44 */
  558. __IO uint32_t DCR; /*!< TIM DMA control register, Address offset: 0x48 */
  559. __IO uint32_t DMAR; /*!< TIM DMA address for full transfer, Address offset: 0x4C */
  560. __IO uint32_t OR; /*!< TIM option register, Address offset: 0x50 */
  561. } TIM_TypeDef;
  562. /**
  563. * @brief Universal Synchronous Asynchronous Receiver Transmitter
  564. */
  565. typedef struct
  566. {
  567. __IO uint32_t SR; /*!< USART Status register, Address offset: 0x00 */
  568. __IO uint32_t DR; /*!< USART Data register, Address offset: 0x04 */
  569. __IO uint32_t BRR; /*!< USART Baud rate register, Address offset: 0x08 */
  570. __IO uint32_t CR1; /*!< USART Control register 1, Address offset: 0x0C */
  571. __IO uint32_t CR2; /*!< USART Control register 2, Address offset: 0x10 */
  572. __IO uint32_t CR3; /*!< USART Control register 3, Address offset: 0x14 */
  573. __IO uint32_t GTPR; /*!< USART Guard time and prescaler register, Address offset: 0x18 */
  574. } USART_TypeDef;
  575. /**
  576. * @brief Universal Serial Bus Full Speed Device
  577. */
  578. typedef struct
  579. {
  580. __IO uint16_t EP0R; /*!< USB Endpoint 0 register, Address offset: 0x00 */
  581. __IO uint16_t RESERVED0; /*!< Reserved */
  582. __IO uint16_t EP1R; /*!< USB Endpoint 1 register, Address offset: 0x04 */
  583. __IO uint16_t RESERVED1; /*!< Reserved */
  584. __IO uint16_t EP2R; /*!< USB Endpoint 2 register, Address offset: 0x08 */
  585. __IO uint16_t RESERVED2; /*!< Reserved */
  586. __IO uint16_t EP3R; /*!< USB Endpoint 3 register, Address offset: 0x0C */
  587. __IO uint16_t RESERVED3; /*!< Reserved */
  588. __IO uint16_t EP4R; /*!< USB Endpoint 4 register, Address offset: 0x10 */
  589. __IO uint16_t RESERVED4; /*!< Reserved */
  590. __IO uint16_t EP5R; /*!< USB Endpoint 5 register, Address offset: 0x14 */
  591. __IO uint16_t RESERVED5; /*!< Reserved */
  592. __IO uint16_t EP6R; /*!< USB Endpoint 6 register, Address offset: 0x18 */
  593. __IO uint16_t RESERVED6; /*!< Reserved */
  594. __IO uint16_t EP7R; /*!< USB Endpoint 7 register, Address offset: 0x1C */
  595. __IO uint16_t RESERVED7[17]; /*!< Reserved */
  596. __IO uint16_t CNTR; /*!< Control register, Address offset: 0x40 */
  597. __IO uint16_t RESERVED8; /*!< Reserved */
  598. __IO uint16_t ISTR; /*!< Interrupt status register, Address offset: 0x44 */
  599. __IO uint16_t RESERVED9; /*!< Reserved */
  600. __IO uint16_t FNR; /*!< Frame number register, Address offset: 0x48 */
  601. __IO uint16_t RESERVEDA; /*!< Reserved */
  602. __IO uint16_t DADDR; /*!< Device address register, Address offset: 0x4C */
  603. __IO uint16_t RESERVEDB; /*!< Reserved */
  604. __IO uint16_t BTABLE; /*!< Buffer Table address register, Address offset: 0x50 */
  605. __IO uint16_t RESERVEDC; /*!< Reserved */
  606. } USB_TypeDef;
  607. /**
  608. * @brief Window WATCHDOG
  609. */
  610. typedef struct
  611. {
  612. __IO uint32_t CR; /*!< WWDG Control register, Address offset: 0x00 */
  613. __IO uint32_t CFR; /*!< WWDG Configuration register, Address offset: 0x04 */
  614. __IO uint32_t SR; /*!< WWDG Status register, Address offset: 0x08 */
  615. } WWDG_TypeDef;
  616. /**
  617. * @brief Universal Serial Bus Full Speed Device
  618. */
  619. /**
  620. * @}
  621. */
  622. /** @addtogroup Peripheral_memory_map
  623. * @{
  624. */
  625. #define FLASH_BASE ((uint32_t)0x08000000) /*!< FLASH base address in the alias region */
  626. #define FLASH_EEPROM_BASE ((uint32_t)(FLASH_BASE + 0x80000)) /*!< FLASH EEPROM base address in the alias region */
  627. #define SRAM_BASE ((uint32_t)0x20000000) /*!< SRAM base address in the alias region */
  628. #define PERIPH_BASE ((uint32_t)0x40000000) /*!< Peripheral base address in the alias region */
  629. #define FSMC_R_BASE ((uint32_t)0xA0000000) /*!< FSMC registers base address */
  630. #define SRAM_BB_BASE ((uint32_t)0x22000000) /*!< SRAM base address in the bit-band region */
  631. #define PERIPH_BB_BASE ((uint32_t)0x42000000) /*!< Peripheral base address in the bit-band region */
  632. #define FLASH_BANK2_BASE ((uint32_t)0x08030000) /*!< FLASH BANK2 base address in the alias region */
  633. #define FLASH_BANK1_END ((uint32_t)0x0802FFFF) /*!< Program end FLASH BANK1 address */
  634. #define FLASH_BANK2_END ((uint32_t)0x0805FFFF) /*!< Program end FLASH BANK2 address */
  635. #define FLASH_EEPROM_END ((uint32_t)0x08082FFF) /*!< FLASH EEPROM end address (12KB) */
  636. /*!< Peripheral memory map */
  637. #define APB1PERIPH_BASE PERIPH_BASE
  638. #define APB2PERIPH_BASE (PERIPH_BASE + 0x00010000)
  639. #define AHBPERIPH_BASE (PERIPH_BASE + 0x00020000)
  640. /*!< APB1 peripherals */
  641. #define TIM2_BASE (APB1PERIPH_BASE + 0x00000000)
  642. #define TIM3_BASE (APB1PERIPH_BASE + 0x00000400)
  643. #define TIM4_BASE (APB1PERIPH_BASE + 0x00000800)
  644. #define TIM5_BASE (APB1PERIPH_BASE + 0x00000C00)
  645. #define TIM6_BASE (APB1PERIPH_BASE + 0x00001000)
  646. #define TIM7_BASE (APB1PERIPH_BASE + 0x00001400)
  647. #define LCD_BASE (APB1PERIPH_BASE + 0x00002400)
  648. #define RTC_BASE (APB1PERIPH_BASE + 0x00002800)
  649. #define WWDG_BASE (APB1PERIPH_BASE + 0x00002C00)
  650. #define IWDG_BASE (APB1PERIPH_BASE + 0x00003000)
  651. #define SPI2_BASE (APB1PERIPH_BASE + 0x00003800)
  652. #define SPI3_BASE (APB1PERIPH_BASE + 0x00003C00)
  653. #define USART2_BASE (APB1PERIPH_BASE + 0x00004400)
  654. #define USART3_BASE (APB1PERIPH_BASE + 0x00004800)
  655. #define UART4_BASE (APB1PERIPH_BASE + 0x00004C00)
  656. #define UART5_BASE (APB1PERIPH_BASE + 0x00005000)
  657. #define I2C1_BASE (APB1PERIPH_BASE + 0x00005400)
  658. #define I2C2_BASE (APB1PERIPH_BASE + 0x00005800)
  659. /* USB device FS */
  660. #define USB_BASE (APB1PERIPH_BASE + 0x00005C00) /*!< USB_IP Peripheral Registers base address */
  661. #define USB_PMAADDR (APB1PERIPH_BASE + 0x00006000) /*!< USB_IP Packet Memory Area base address */
  662. /* USB device FS SRAM */
  663. #define PWR_BASE (APB1PERIPH_BASE + 0x00007000)
  664. #define DAC_BASE (APB1PERIPH_BASE + 0x00007400)
  665. #define COMP_BASE (APB1PERIPH_BASE + 0x00007C00)
  666. #define RI_BASE (APB1PERIPH_BASE + 0x00007C04)
  667. #define OPAMP_BASE (APB1PERIPH_BASE + 0x00007C5C)
  668. /*!< APB2 peripherals */
  669. #define SYSCFG_BASE (APB2PERIPH_BASE + 0x00000000)
  670. #define EXTI_BASE (APB2PERIPH_BASE + 0x00000400)
  671. #define TIM9_BASE (APB2PERIPH_BASE + 0x00000800)
  672. #define TIM10_BASE (APB2PERIPH_BASE + 0x00000C00)
  673. #define TIM11_BASE (APB2PERIPH_BASE + 0x00001000)
  674. #define ADC1_BASE (APB2PERIPH_BASE + 0x00002400)
  675. #define ADC_BASE (APB2PERIPH_BASE + 0x00002700)
  676. #define SDIO_BASE (APB2PERIPH_BASE + 0x00002C00)
  677. #define SPI1_BASE (APB2PERIPH_BASE + 0x00003000)
  678. #define USART1_BASE (APB2PERIPH_BASE + 0x00003800)
  679. /*!< AHB peripherals */
  680. #define GPIOA_BASE (AHBPERIPH_BASE + 0x00000000)
  681. #define GPIOB_BASE (AHBPERIPH_BASE + 0x00000400)
  682. #define GPIOC_BASE (AHBPERIPH_BASE + 0x00000800)
  683. #define GPIOD_BASE (AHBPERIPH_BASE + 0x00000C00)
  684. #define GPIOE_BASE (AHBPERIPH_BASE + 0x00001000)
  685. #define GPIOH_BASE (AHBPERIPH_BASE + 0x00001400)
  686. #define GPIOF_BASE (AHBPERIPH_BASE + 0x00001800)
  687. #define GPIOG_BASE (AHBPERIPH_BASE + 0x00001C00)
  688. #define CRC_BASE (AHBPERIPH_BASE + 0x00003000)
  689. #define RCC_BASE (AHBPERIPH_BASE + 0x00003800)
  690. #define FLASH_R_BASE (AHBPERIPH_BASE + 0x00003C00) /*!< FLASH registers base address */
  691. #define OB_BASE ((uint32_t)0x1FF80000) /*!< FLASH Option Bytes base address */
  692. #define DMA1_BASE (AHBPERIPH_BASE + 0x00006000)
  693. #define DMA1_Channel1_BASE (DMA1_BASE + 0x00000008)
  694. #define DMA1_Channel2_BASE (DMA1_BASE + 0x0000001C)
  695. #define DMA1_Channel3_BASE (DMA1_BASE + 0x00000030)
  696. #define DMA1_Channel4_BASE (DMA1_BASE + 0x00000044)
  697. #define DMA1_Channel5_BASE (DMA1_BASE + 0x00000058)
  698. #define DMA1_Channel6_BASE (DMA1_BASE + 0x0000006C)
  699. #define DMA1_Channel7_BASE (DMA1_BASE + 0x00000080)
  700. #define DMA2_BASE (AHBPERIPH_BASE + 0x00006400)
  701. #define DMA2_Channel1_BASE (DMA2_BASE + 0x00000008)
  702. #define DMA2_Channel2_BASE (DMA2_BASE + 0x0000001C)
  703. #define DMA2_Channel3_BASE (DMA2_BASE + 0x00000030)
  704. #define DMA2_Channel4_BASE (DMA2_BASE + 0x00000044)
  705. #define DMA2_Channel5_BASE (DMA2_BASE + 0x00000058)
  706. #define FSMC_Bank1_R_BASE (FSMC_R_BASE + 0x00000000) /*!< FSMC Bank1 registers base address */
  707. #define FSMC_Bank1E_R_BASE (FSMC_R_BASE + 0x00000104) /*!< FSMC Bank1E registers base address */
  708. #define DBGMCU_BASE ((uint32_t)0xE0042000) /*!< Debug MCU registers base address */
  709. /**
  710. * @}
  711. */
  712. /** @addtogroup Peripheral_declaration
  713. * @{
  714. */
  715. #define TIM2 ((TIM_TypeDef *) TIM2_BASE)
  716. #define TIM3 ((TIM_TypeDef *) TIM3_BASE)
  717. #define TIM4 ((TIM_TypeDef *) TIM4_BASE)
  718. #define TIM5 ((TIM_TypeDef *) TIM5_BASE)
  719. #define TIM6 ((TIM_TypeDef *) TIM6_BASE)
  720. #define TIM7 ((TIM_TypeDef *) TIM7_BASE)
  721. #define LCD ((LCD_TypeDef *) LCD_BASE)
  722. #define RTC ((RTC_TypeDef *) RTC_BASE)
  723. #define WWDG ((WWDG_TypeDef *) WWDG_BASE)
  724. #define IWDG ((IWDG_TypeDef *) IWDG_BASE)
  725. #define SPI2 ((SPI_TypeDef *) SPI2_BASE)
  726. #define SPI3 ((SPI_TypeDef *) SPI3_BASE)
  727. #define USART2 ((USART_TypeDef *) USART2_BASE)
  728. #define USART3 ((USART_TypeDef *) USART3_BASE)
  729. #define UART4 ((USART_TypeDef *) UART4_BASE)
  730. #define UART5 ((USART_TypeDef *) UART5_BASE)
  731. #define I2C1 ((I2C_TypeDef *) I2C1_BASE)
  732. #define I2C2 ((I2C_TypeDef *) I2C2_BASE)
  733. /* USB device FS */
  734. #define USB ((USB_TypeDef *) USB_BASE)
  735. /* USB device FS SRAM */
  736. #define PWR ((PWR_TypeDef *) PWR_BASE)
  737. #define DAC ((DAC_TypeDef *) DAC_BASE)
  738. #define COMP ((COMP_TypeDef *) COMP_BASE)
  739. #define COMP1 ((COMP_TypeDef *) COMP_BASE)
  740. #define COMP2 ((COMP_TypeDef *) (COMP_BASE + 0x00000001))
  741. #define RI ((RI_TypeDef *) RI_BASE)
  742. #define OPAMP ((OPAMP_TypeDef *) OPAMP_BASE)
  743. #define OPAMP1 ((OPAMP_TypeDef *) OPAMP_BASE)
  744. #define OPAMP2 ((OPAMP_TypeDef *) (OPAMP_BASE + 0x00000001))
  745. #define OPAMP3 ((OPAMP_TypeDef *) (OPAMP_BASE + 0x00000002))
  746. #define SYSCFG ((SYSCFG_TypeDef *) SYSCFG_BASE)
  747. #define EXTI ((EXTI_TypeDef *) EXTI_BASE)
  748. #define TIM9 ((TIM_TypeDef *) TIM9_BASE)
  749. #define TIM10 ((TIM_TypeDef *) TIM10_BASE)
  750. #define TIM11 ((TIM_TypeDef *) TIM11_BASE)
  751. #define ADC1 ((ADC_TypeDef *) ADC1_BASE)
  752. #define ADC ((ADC_Common_TypeDef *) ADC_BASE)
  753. #define SDIO ((SDIO_TypeDef *) SDIO_BASE)
  754. #define SPI1 ((SPI_TypeDef *) SPI1_BASE)
  755. #define USART1 ((USART_TypeDef *) USART1_BASE)
  756. #define GPIOA ((GPIO_TypeDef *) GPIOA_BASE)
  757. #define GPIOB ((GPIO_TypeDef *) GPIOB_BASE)
  758. #define GPIOC ((GPIO_TypeDef *) GPIOC_BASE)
  759. #define GPIOD ((GPIO_TypeDef *) GPIOD_BASE)
  760. #define GPIOE ((GPIO_TypeDef *) GPIOE_BASE)
  761. #define GPIOH ((GPIO_TypeDef *) GPIOH_BASE)
  762. #define GPIOF ((GPIO_TypeDef *) GPIOF_BASE)
  763. #define GPIOG ((GPIO_TypeDef *) GPIOG_BASE)
  764. #define CRC ((CRC_TypeDef *) CRC_BASE)
  765. #define RCC ((RCC_TypeDef *) RCC_BASE)
  766. #define FLASH ((FLASH_TypeDef *) FLASH_R_BASE)
  767. #define OB ((OB_TypeDef *) OB_BASE)
  768. #define DMA1 ((DMA_TypeDef *) DMA1_BASE)
  769. #define DMA1_Channel1 ((DMA_Channel_TypeDef *) DMA1_Channel1_BASE)
  770. #define DMA1_Channel2 ((DMA_Channel_TypeDef *) DMA1_Channel2_BASE)
  771. #define DMA1_Channel3 ((DMA_Channel_TypeDef *) DMA1_Channel3_BASE)
  772. #define DMA1_Channel4 ((DMA_Channel_TypeDef *) DMA1_Channel4_BASE)
  773. #define DMA1_Channel5 ((DMA_Channel_TypeDef *) DMA1_Channel5_BASE)
  774. #define DMA1_Channel6 ((DMA_Channel_TypeDef *) DMA1_Channel6_BASE)
  775. #define DMA1_Channel7 ((DMA_Channel_TypeDef *) DMA1_Channel7_BASE)
  776. #define DMA2 ((DMA_TypeDef *) DMA2_BASE)
  777. #define DMA2_Channel1 ((DMA_Channel_TypeDef *) DMA2_Channel1_BASE)
  778. #define DMA2_Channel2 ((DMA_Channel_TypeDef *) DMA2_Channel2_BASE)
  779. #define DMA2_Channel3 ((DMA_Channel_TypeDef *) DMA2_Channel3_BASE)
  780. #define DMA2_Channel4 ((DMA_Channel_TypeDef *) DMA2_Channel4_BASE)
  781. #define DMA2_Channel5 ((DMA_Channel_TypeDef *) DMA2_Channel5_BASE)
  782. #define FSMC_Bank1 ((FSMC_Bank1_TypeDef *) FSMC_Bank1_R_BASE)
  783. #define FSMC_Bank1E ((FSMC_Bank1E_TypeDef *) FSMC_Bank1E_R_BASE)
  784. #define DBGMCU ((DBGMCU_TypeDef *) DBGMCU_BASE)
  785. /**
  786. * @}
  787. */
  788. /** @addtogroup Exported_constants
  789. * @{
  790. */
  791. /** @addtogroup Peripheral_Registers_Bits_Definition
  792. * @{
  793. */
  794. /******************************************************************************/
  795. /* Peripheral Registers Bits Definition */
  796. /******************************************************************************/
  797. /******************************************************************************/
  798. /* */
  799. /* Analog to Digital Converter (ADC) */
  800. /* */
  801. /******************************************************************************/
  802. /******************** Bit definition for ADC_SR register ********************/
  803. #define ADC_SR_AWD ((uint32_t)0x00000001) /*!< Analog watchdog flag */
  804. #define ADC_SR_EOC ((uint32_t)0x00000002) /*!< End of conversion */
  805. #define ADC_SR_JEOC ((uint32_t)0x00000004) /*!< Injected channel end of conversion */
  806. #define ADC_SR_JSTRT ((uint32_t)0x00000008) /*!< Injected channel Start flag */
  807. #define ADC_SR_STRT ((uint32_t)0x00000010) /*!< Regular channel Start flag */
  808. #define ADC_SR_OVR ((uint32_t)0x00000020) /*!< Overrun flag */
  809. #define ADC_SR_ADONS ((uint32_t)0x00000040) /*!< ADC ON status */
  810. #define ADC_SR_RCNR ((uint32_t)0x00000100) /*!< Regular channel not ready flag */
  811. #define ADC_SR_JCNR ((uint32_t)0x00000200) /*!< Injected channel not ready flag */
  812. /******************* Bit definition for ADC_CR1 register ********************/
  813. #define ADC_CR1_AWDCH ((uint32_t)0x0000001F) /*!< AWDCH[4:0] bits (Analog watchdog channel select bits) */
  814. #define ADC_CR1_AWDCH_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  815. #define ADC_CR1_AWDCH_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  816. #define ADC_CR1_AWDCH_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  817. #define ADC_CR1_AWDCH_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  818. #define ADC_CR1_AWDCH_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  819. #define ADC_CR1_EOCIE ((uint32_t)0x00000020) /*!< Interrupt enable for EOC */
  820. #define ADC_CR1_AWDIE ((uint32_t)0x00000040) /*!< Analog Watchdog interrupt enable */
  821. #define ADC_CR1_JEOCIE ((uint32_t)0x00000080) /*!< Interrupt enable for injected channels */
  822. #define ADC_CR1_SCAN ((uint32_t)0x00000100) /*!< Scan mode */
  823. #define ADC_CR1_AWDSGL ((uint32_t)0x00000200) /*!< Enable the watchdog on a single channel in scan mode */
  824. #define ADC_CR1_JAUTO ((uint32_t)0x00000400) /*!< Automatic injected group conversion */
  825. #define ADC_CR1_DISCEN ((uint32_t)0x00000800) /*!< Discontinuous mode on regular channels */
  826. #define ADC_CR1_JDISCEN ((uint32_t)0x00001000) /*!< Discontinuous mode on injected channels */
  827. #define ADC_CR1_DISCNUM ((uint32_t)0x0000E000) /*!< DISCNUM[2:0] bits (Discontinuous mode channel count) */
  828. #define ADC_CR1_DISCNUM_0 ((uint32_t)0x00002000) /*!< Bit 0 */
  829. #define ADC_CR1_DISCNUM_1 ((uint32_t)0x00004000) /*!< Bit 1 */
  830. #define ADC_CR1_DISCNUM_2 ((uint32_t)0x00008000) /*!< Bit 2 */
  831. #define ADC_CR1_PDD ((uint32_t)0x00010000) /*!< Power Down during Delay phase */
  832. #define ADC_CR1_PDI ((uint32_t)0x00020000) /*!< Power Down during Idle phase */
  833. #define ADC_CR1_JAWDEN ((uint32_t)0x00400000) /*!< Analog watchdog enable on injected channels */
  834. #define ADC_CR1_AWDEN ((uint32_t)0x00800000) /*!< Analog watchdog enable on regular channels */
  835. #define ADC_CR1_RES ((uint32_t)0x03000000) /*!< RES[1:0] bits (Resolution) */
  836. #define ADC_CR1_RES_0 ((uint32_t)0x01000000) /*!< Bit 0 */
  837. #define ADC_CR1_RES_1 ((uint32_t)0x02000000) /*!< Bit 1 */
  838. #define ADC_CR1_OVRIE ((uint32_t)0x04000000) /*!< Overrun interrupt enable */
  839. /******************* Bit definition for ADC_CR2 register ********************/
  840. #define ADC_CR2_ADON ((uint32_t)0x00000001) /*!< A/D Converter ON / OFF */
  841. #define ADC_CR2_CONT ((uint32_t)0x00000002) /*!< Continuous Conversion */
  842. #define ADC_CR2_CFG ((uint32_t)0x00000004) /*!< ADC Configuration */
  843. #define ADC_CR2_DELS ((uint32_t)0x00000070) /*!< DELS[2:0] bits (Delay selection) */
  844. #define ADC_CR2_DELS_0 ((uint32_t)0x00000010) /*!< Bit 0 */
  845. #define ADC_CR2_DELS_1 ((uint32_t)0x00000020) /*!< Bit 1 */
  846. #define ADC_CR2_DELS_2 ((uint32_t)0x00000040) /*!< Bit 2 */
  847. #define ADC_CR2_DMA ((uint32_t)0x00000100) /*!< Direct Memory access mode */
  848. #define ADC_CR2_DDS ((uint32_t)0x00000200) /*!< DMA disable selection (Single ADC) */
  849. #define ADC_CR2_EOCS ((uint32_t)0x00000400) /*!< End of conversion selection */
  850. #define ADC_CR2_ALIGN ((uint32_t)0x00000800) /*!< Data Alignment */
  851. #define ADC_CR2_JEXTSEL ((uint32_t)0x000F0000) /*!< JEXTSEL[3:0] bits (External event select for injected group) */
  852. #define ADC_CR2_JEXTSEL_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  853. #define ADC_CR2_JEXTSEL_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  854. #define ADC_CR2_JEXTSEL_2 ((uint32_t)0x00040000) /*!< Bit 2 */
  855. #define ADC_CR2_JEXTSEL_3 ((uint32_t)0x00080000) /*!< Bit 3 */
  856. #define ADC_CR2_JEXTEN ((uint32_t)0x00300000) /*!< JEXTEN[1:0] bits (External Trigger Conversion mode for injected channels) */
  857. #define ADC_CR2_JEXTEN_0 ((uint32_t)0x00100000) /*!< Bit 0 */
  858. #define ADC_CR2_JEXTEN_1 ((uint32_t)0x00200000) /*!< Bit 1 */
  859. #define ADC_CR2_JSWSTART ((uint32_t)0x00400000) /*!< Start Conversion of injected channels */
  860. #define ADC_CR2_EXTSEL ((uint32_t)0x0F000000) /*!< EXTSEL[3:0] bits (External Event Select for regular group) */
  861. #define ADC_CR2_EXTSEL_0 ((uint32_t)0x01000000) /*!< Bit 0 */
  862. #define ADC_CR2_EXTSEL_1 ((uint32_t)0x02000000) /*!< Bit 1 */
  863. #define ADC_CR2_EXTSEL_2 ((uint32_t)0x04000000) /*!< Bit 2 */
  864. #define ADC_CR2_EXTSEL_3 ((uint32_t)0x08000000) /*!< Bit 3 */
  865. #define ADC_CR2_EXTEN ((uint32_t)0x30000000) /*!< EXTEN[1:0] bits (External Trigger Conversion mode for regular channels) */
  866. #define ADC_CR2_EXTEN_0 ((uint32_t)0x10000000) /*!< Bit 0 */
  867. #define ADC_CR2_EXTEN_1 ((uint32_t)0x20000000) /*!< Bit 1 */
  868. #define ADC_CR2_SWSTART ((uint32_t)0x40000000) /*!< Start Conversion of regular channels */
  869. /****************** Bit definition for ADC_SMPR1 register *******************/
  870. #define ADC_SMPR1_SMP20 ((uint32_t)0x00000007) /*!< SMP20[2:0] bits (Channel 20 Sample time selection) */
  871. #define ADC_SMPR1_SMP20_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  872. #define ADC_SMPR1_SMP20_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  873. #define ADC_SMPR1_SMP20_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  874. #define ADC_SMPR1_SMP21 ((uint32_t)0x00000038) /*!< SMP21[2:0] bits (Channel 21 Sample time selection) */
  875. #define ADC_SMPR1_SMP21_0 ((uint32_t)0x00000008) /*!< Bit 0 */
  876. #define ADC_SMPR1_SMP21_1 ((uint32_t)0x00000010) /*!< Bit 1 */
  877. #define ADC_SMPR1_SMP21_2 ((uint32_t)0x00000020) /*!< Bit 2 */
  878. #define ADC_SMPR1_SMP22 ((uint32_t)0x000001C0) /*!< SMP22[2:0] bits (Channel 22 Sample time selection) */
  879. #define ADC_SMPR1_SMP22_0 ((uint32_t)0x00000040) /*!< Bit 0 */
  880. #define ADC_SMPR1_SMP22_1 ((uint32_t)0x00000080) /*!< Bit 1 */
  881. #define ADC_SMPR1_SMP22_2 ((uint32_t)0x00000100) /*!< Bit 2 */
  882. #define ADC_SMPR1_SMP23 ((uint32_t)0x00000E00) /*!< SMP23[2:0] bits (Channel 23 Sample time selection) */
  883. #define ADC_SMPR1_SMP23_0 ((uint32_t)0x00000200) /*!< Bit 0 */
  884. #define ADC_SMPR1_SMP23_1 ((uint32_t)0x00000400) /*!< Bit 1 */
  885. #define ADC_SMPR1_SMP23_2 ((uint32_t)0x00000800) /*!< Bit 2 */
  886. #define ADC_SMPR1_SMP24 ((uint32_t)0x00007000) /*!< SMP24[2:0] bits (Channel 24 Sample time selection) */
  887. #define ADC_SMPR1_SMP24_0 ((uint32_t)0x00001000) /*!< Bit 0 */
  888. #define ADC_SMPR1_SMP24_1 ((uint32_t)0x00002000) /*!< Bit 1 */
  889. #define ADC_SMPR1_SMP24_2 ((uint32_t)0x00004000) /*!< Bit 2 */
  890. #define ADC_SMPR1_SMP25 ((uint32_t)0x00038000) /*!< SMP25[2:0] bits (Channel 25 Sample time selection) */
  891. #define ADC_SMPR1_SMP25_0 ((uint32_t)0x00008000) /*!< Bit 0 */
  892. #define ADC_SMPR1_SMP25_1 ((uint32_t)0x00010000) /*!< Bit 1 */
  893. #define ADC_SMPR1_SMP25_2 ((uint32_t)0x00020000) /*!< Bit 2 */
  894. #define ADC_SMPR1_SMP26 ((uint32_t)0x001C0000) /*!< SMP26[2:0] bits (Channel 26 Sample time selection) */
  895. #define ADC_SMPR1_SMP26_0 ((uint32_t)0x00040000) /*!< Bit 0 */
  896. #define ADC_SMPR1_SMP26_1 ((uint32_t)0x00080000) /*!< Bit 1 */
  897. #define ADC_SMPR1_SMP26_2 ((uint32_t)0x00100000) /*!< Bit 2 */
  898. #define ADC_SMPR1_SMP27 ((uint32_t)0x00E00000) /*!< SMP27[2:0] bits (Channel 27 Sample time selection) */
  899. #define ADC_SMPR1_SMP27_0 ((uint32_t)0x00200000) /*!< Bit 0 */
  900. #define ADC_SMPR1_SMP27_1 ((uint32_t)0x00400000) /*!< Bit 1 */
  901. #define ADC_SMPR1_SMP27_2 ((uint32_t)0x00800000) /*!< Bit 2 */
  902. #define ADC_SMPR1_SMP28 ((uint32_t)0x07000000) /*!< SMP28[2:0] bits (Channel 28 Sample time selection) */
  903. #define ADC_SMPR1_SMP28_0 ((uint32_t)0x01000000) /*!< Bit 0 */
  904. #define ADC_SMPR1_SMP28_1 ((uint32_t)0x02000000) /*!< Bit 1 */
  905. #define ADC_SMPR1_SMP28_2 ((uint32_t)0x04000000) /*!< Bit 2 */
  906. #define ADC_SMPR1_SMP29 ((uint32_t)0x38000000) /*!< SMP29[2:0] bits (Channel 29 Sample time selection) */
  907. #define ADC_SMPR1_SMP29_0 ((uint32_t)0x08000000) /*!< Bit 0 */
  908. #define ADC_SMPR1_SMP29_1 ((uint32_t)0x10000000) /*!< Bit 1 */
  909. #define ADC_SMPR1_SMP29_2 ((uint32_t)0x20000000) /*!< Bit 2 */
  910. /****************** Bit definition for ADC_SMPR2 register *******************/
  911. #define ADC_SMPR2_SMP10 ((uint32_t)0x00000007) /*!< SMP10[2:0] bits (Channel 10 Sample time selection) */
  912. #define ADC_SMPR2_SMP10_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  913. #define ADC_SMPR2_SMP10_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  914. #define ADC_SMPR2_SMP10_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  915. #define ADC_SMPR2_SMP11 ((uint32_t)0x00000038) /*!< SMP11[2:0] bits (Channel 11 Sample time selection) */
  916. #define ADC_SMPR2_SMP11_0 ((uint32_t)0x00000008) /*!< Bit 0 */
  917. #define ADC_SMPR2_SMP11_1 ((uint32_t)0x00000010) /*!< Bit 1 */
  918. #define ADC_SMPR2_SMP11_2 ((uint32_t)0x00000020) /*!< Bit 2 */
  919. #define ADC_SMPR2_SMP12 ((uint32_t)0x000001C0) /*!< SMP12[2:0] bits (Channel 12 Sample time selection) */
  920. #define ADC_SMPR2_SMP12_0 ((uint32_t)0x00000040) /*!< Bit 0 */
  921. #define ADC_SMPR2_SMP12_1 ((uint32_t)0x00000080) /*!< Bit 1 */
  922. #define ADC_SMPR2_SMP12_2 ((uint32_t)0x00000100) /*!< Bit 2 */
  923. #define ADC_SMPR2_SMP13 ((uint32_t)0x00000E00) /*!< SMP13[2:0] bits (Channel 13 Sample time selection) */
  924. #define ADC_SMPR2_SMP13_0 ((uint32_t)0x00000200) /*!< Bit 0 */
  925. #define ADC_SMPR2_SMP13_1 ((uint32_t)0x00000400) /*!< Bit 1 */
  926. #define ADC_SMPR2_SMP13_2 ((uint32_t)0x00000800) /*!< Bit 2 */
  927. #define ADC_SMPR2_SMP14 ((uint32_t)0x00007000) /*!< SMP14[2:0] bits (Channel 14 Sample time selection) */
  928. #define ADC_SMPR2_SMP14_0 ((uint32_t)0x00001000) /*!< Bit 0 */
  929. #define ADC_SMPR2_SMP14_1 ((uint32_t)0x00002000) /*!< Bit 1 */
  930. #define ADC_SMPR2_SMP14_2 ((uint32_t)0x00004000) /*!< Bit 2 */
  931. #define ADC_SMPR2_SMP15 ((uint32_t)0x00038000) /*!< SMP15[2:0] bits (Channel 5 Sample time selection) */
  932. #define ADC_SMPR2_SMP15_0 ((uint32_t)0x00008000) /*!< Bit 0 */
  933. #define ADC_SMPR2_SMP15_1 ((uint32_t)0x00010000) /*!< Bit 1 */
  934. #define ADC_SMPR2_SMP15_2 ((uint32_t)0x00020000) /*!< Bit 2 */
  935. #define ADC_SMPR2_SMP16 ((uint32_t)0x001C0000) /*!< SMP16[2:0] bits (Channel 16 Sample time selection) */
  936. #define ADC_SMPR2_SMP16_0 ((uint32_t)0x00040000) /*!< Bit 0 */
  937. #define ADC_SMPR2_SMP16_1 ((uint32_t)0x00080000) /*!< Bit 1 */
  938. #define ADC_SMPR2_SMP16_2 ((uint32_t)0x00100000) /*!< Bit 2 */
  939. #define ADC_SMPR2_SMP17 ((uint32_t)0x00E00000) /*!< SMP17[2:0] bits (Channel 17 Sample time selection) */
  940. #define ADC_SMPR2_SMP17_0 ((uint32_t)0x00200000) /*!< Bit 0 */
  941. #define ADC_SMPR2_SMP17_1 ((uint32_t)0x00400000) /*!< Bit 1 */
  942. #define ADC_SMPR2_SMP17_2 ((uint32_t)0x00800000) /*!< Bit 2 */
  943. #define ADC_SMPR2_SMP18 ((uint32_t)0x07000000) /*!< SMP18[2:0] bits (Channel 18 Sample time selection) */
  944. #define ADC_SMPR2_SMP18_0 ((uint32_t)0x01000000) /*!< Bit 0 */
  945. #define ADC_SMPR2_SMP18_1 ((uint32_t)0x02000000) /*!< Bit 1 */
  946. #define ADC_SMPR2_SMP18_2 ((uint32_t)0x04000000) /*!< Bit 2 */
  947. #define ADC_SMPR2_SMP19 ((uint32_t)0x38000000) /*!< SMP19[2:0] bits (Channel 19 Sample time selection) */
  948. #define ADC_SMPR2_SMP19_0 ((uint32_t)0x08000000) /*!< Bit 0 */
  949. #define ADC_SMPR2_SMP19_1 ((uint32_t)0x10000000) /*!< Bit 1 */
  950. #define ADC_SMPR2_SMP19_2 ((uint32_t)0x20000000) /*!< Bit 2 */
  951. /****************** Bit definition for ADC_SMPR3 register *******************/
  952. #define ADC_SMPR3_SMP0 ((uint32_t)0x00000007) /*!< SMP0[2:0] bits (Channel 0 Sample time selection) */
  953. #define ADC_SMPR3_SMP0_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  954. #define ADC_SMPR3_SMP0_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  955. #define ADC_SMPR3_SMP0_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  956. #define ADC_SMPR3_SMP1 ((uint32_t)0x00000038) /*!< SMP1[2:0] bits (Channel 1 Sample time selection) */
  957. #define ADC_SMPR3_SMP1_0 ((uint32_t)0x00000008) /*!< Bit 0 */
  958. #define ADC_SMPR3_SMP1_1 ((uint32_t)0x00000010) /*!< Bit 1 */
  959. #define ADC_SMPR3_SMP1_2 ((uint32_t)0x00000020) /*!< Bit 2 */
  960. #define ADC_SMPR3_SMP2 ((uint32_t)0x000001C0) /*!< SMP2[2:0] bits (Channel 2 Sample time selection) */
  961. #define ADC_SMPR3_SMP2_0 ((uint32_t)0x00000040) /*!< Bit 0 */
  962. #define ADC_SMPR3_SMP2_1 ((uint32_t)0x00000080) /*!< Bit 1 */
  963. #define ADC_SMPR3_SMP2_2 ((uint32_t)0x00000100) /*!< Bit 2 */
  964. #define ADC_SMPR3_SMP3 ((uint32_t)0x00000E00) /*!< SMP3[2:0] bits (Channel 3 Sample time selection) */
  965. #define ADC_SMPR3_SMP3_0 ((uint32_t)0x00000200) /*!< Bit 0 */
  966. #define ADC_SMPR3_SMP3_1 ((uint32_t)0x00000400) /*!< Bit 1 */
  967. #define ADC_SMPR3_SMP3_2 ((uint32_t)0x00000800) /*!< Bit 2 */
  968. #define ADC_SMPR3_SMP4 ((uint32_t)0x00007000) /*!< SMP4[2:0] bits (Channel 4 Sample time selection) */
  969. #define ADC_SMPR3_SMP4_0 ((uint32_t)0x00001000) /*!< Bit 0 */
  970. #define ADC_SMPR3_SMP4_1 ((uint32_t)0x00002000) /*!< Bit 1 */
  971. #define ADC_SMPR3_SMP4_2 ((uint32_t)0x00004000) /*!< Bit 2 */
  972. #define ADC_SMPR3_SMP5 ((uint32_t)0x00038000) /*!< SMP5[2:0] bits (Channel 5 Sample time selection) */
  973. #define ADC_SMPR3_SMP5_0 ((uint32_t)0x00008000) /*!< Bit 0 */
  974. #define ADC_SMPR3_SMP5_1 ((uint32_t)0x00010000) /*!< Bit 1 */
  975. #define ADC_SMPR3_SMP5_2 ((uint32_t)0x00020000) /*!< Bit 2 */
  976. #define ADC_SMPR3_SMP6 ((uint32_t)0x001C0000) /*!< SMP6[2:0] bits (Channel 6 Sample time selection) */
  977. #define ADC_SMPR3_SMP6_0 ((uint32_t)0x00040000) /*!< Bit 0 */
  978. #define ADC_SMPR3_SMP6_1 ((uint32_t)0x00080000) /*!< Bit 1 */
  979. #define ADC_SMPR3_SMP6_2 ((uint32_t)0x00100000) /*!< Bit 2 */
  980. #define ADC_SMPR3_SMP7 ((uint32_t)0x00E00000) /*!< SMP7[2:0] bits (Channel 7 Sample time selection) */
  981. #define ADC_SMPR3_SMP7_0 ((uint32_t)0x00200000) /*!< Bit 0 */
  982. #define ADC_SMPR3_SMP7_1 ((uint32_t)0x00400000) /*!< Bit 1 */
  983. #define ADC_SMPR3_SMP7_2 ((uint32_t)0x00800000) /*!< Bit 2 */
  984. #define ADC_SMPR3_SMP8 ((uint32_t)0x07000000) /*!< SMP8[2:0] bits (Channel 8 Sample time selection) */
  985. #define ADC_SMPR3_SMP8_0 ((uint32_t)0x01000000) /*!< Bit 0 */
  986. #define ADC_SMPR3_SMP8_1 ((uint32_t)0x02000000) /*!< Bit 1 */
  987. #define ADC_SMPR3_SMP8_2 ((uint32_t)0x04000000) /*!< Bit 2 */
  988. #define ADC_SMPR3_SMP9 ((uint32_t)0x38000000) /*!< SMP9[2:0] bits (Channel 9 Sample time selection) */
  989. #define ADC_SMPR3_SMP9_0 ((uint32_t)0x08000000) /*!< Bit 0 */
  990. #define ADC_SMPR3_SMP9_1 ((uint32_t)0x10000000) /*!< Bit 1 */
  991. #define ADC_SMPR3_SMP9_2 ((uint32_t)0x20000000) /*!< Bit 2 */
  992. /****************** Bit definition for ADC_JOFR1 register *******************/
  993. #define ADC_JOFR1_JOFFSET1 ((uint32_t)0x00000FFF) /*!< Data offset for injected channel 1 */
  994. /****************** Bit definition for ADC_JOFR2 register *******************/
  995. #define ADC_JOFR2_JOFFSET2 ((uint32_t)0x00000FFF) /*!< Data offset for injected channel 2 */
  996. /****************** Bit definition for ADC_JOFR3 register *******************/
  997. #define ADC_JOFR3_JOFFSET3 ((uint32_t)0x00000FFF) /*!< Data offset for injected channel 3 */
  998. /****************** Bit definition for ADC_JOFR4 register *******************/
  999. #define ADC_JOFR4_JOFFSET4 ((uint32_t)0x00000FFF) /*!< Data offset for injected channel 4 */
  1000. /******************* Bit definition for ADC_HTR register ********************/
  1001. #define ADC_HTR_HT ((uint32_t)0x00000FFF) /*!< Analog watchdog high threshold */
  1002. /******************* Bit definition for ADC_LTR register ********************/
  1003. #define ADC_LTR_LT ((uint32_t)0x00000FFF) /*!< Analog watchdog low threshold */
  1004. /******************* Bit definition for ADC_SQR1 register *******************/
  1005. #define ADC_SQR1_L ((uint32_t)0x01F00000) /*!< L[4:0] bits (Regular channel sequence length) */
  1006. #define ADC_SQR1_L_0 ((uint32_t)0x00100000) /*!< Bit 0 */
  1007. #define ADC_SQR1_L_1 ((uint32_t)0x00200000) /*!< Bit 1 */
  1008. #define ADC_SQR1_L_2 ((uint32_t)0x00400000) /*!< Bit 2 */
  1009. #define ADC_SQR1_L_3 ((uint32_t)0x00800000) /*!< Bit 3 */
  1010. #define ADC_SQR1_L_4 ((uint32_t)0x01000000) /*!< Bit 4 */
  1011. #define ADC_SQR1_SQ28 ((uint32_t)0x000F8000) /*!< SQ28[4:0] bits (25th conversion in regular sequence) */
  1012. #define ADC_SQR1_SQ28_0 ((uint32_t)0x00008000) /*!< Bit 0 */
  1013. #define ADC_SQR1_SQ28_1 ((uint32_t)0x00010000) /*!< Bit 1 */
  1014. #define ADC_SQR1_SQ28_2 ((uint32_t)0x00020000) /*!< Bit 2 */
  1015. #define ADC_SQR1_SQ28_3 ((uint32_t)0x00040000) /*!< Bit 3 */
  1016. #define ADC_SQR1_SQ28_4 ((uint32_t)0x00080000) /*!< Bit 4 */
  1017. #define ADC_SQR1_SQ27 ((uint32_t)0x00007C00) /*!< SQ27[4:0] bits (27th conversion in regular sequence) */
  1018. #define ADC_SQR1_SQ27_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  1019. #define ADC_SQR1_SQ27_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  1020. #define ADC_SQR1_SQ27_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  1021. #define ADC_SQR1_SQ27_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  1022. #define ADC_SQR1_SQ27_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  1023. #define ADC_SQR1_SQ26 ((uint32_t)0x000003E0) /*!< SQ26[4:0] bits (26th conversion in regular sequence) */
  1024. #define ADC_SQR1_SQ26_0 ((uint32_t)0x00000020) /*!< Bit 0 */
  1025. #define ADC_SQR1_SQ26_1 ((uint32_t)0x00000040) /*!< Bit 1 */
  1026. #define ADC_SQR1_SQ26_2 ((uint32_t)0x00000080) /*!< Bit 2 */
  1027. #define ADC_SQR1_SQ26_3 ((uint32_t)0x00000100) /*!< Bit 3 */
  1028. #define ADC_SQR1_SQ26_4 ((uint32_t)0x00000200) /*!< Bit 4 */
  1029. #define ADC_SQR1_SQ25 ((uint32_t)0x0000001F) /*!< SQ25[4:0] bits (25th conversion in regular sequence) */
  1030. #define ADC_SQR1_SQ25_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  1031. #define ADC_SQR1_SQ25_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  1032. #define ADC_SQR1_SQ25_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  1033. #define ADC_SQR1_SQ25_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  1034. #define ADC_SQR1_SQ25_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  1035. /******************* Bit definition for ADC_SQR2 register *******************/
  1036. #define ADC_SQR2_SQ19 ((uint32_t)0x0000001F) /*!< SQ19[4:0] bits (19th conversion in regular sequence) */
  1037. #define ADC_SQR2_SQ19_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  1038. #define ADC_SQR2_SQ19_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  1039. #define ADC_SQR2_SQ19_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  1040. #define ADC_SQR2_SQ19_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  1041. #define ADC_SQR2_SQ19_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  1042. #define ADC_SQR2_SQ20 ((uint32_t)0x000003E0) /*!< SQ20[4:0] bits (20th conversion in regular sequence) */
  1043. #define ADC_SQR2_SQ20_0 ((uint32_t)0x00000020) /*!< Bit 0 */
  1044. #define ADC_SQR2_SQ20_1 ((uint32_t)0x00000040) /*!< Bit 1 */
  1045. #define ADC_SQR2_SQ20_2 ((uint32_t)0x00000080) /*!< Bit 2 */
  1046. #define ADC_SQR2_SQ20_3 ((uint32_t)0x00000100) /*!< Bit 3 */
  1047. #define ADC_SQR2_SQ20_4 ((uint32_t)0x00000200) /*!< Bit 4 */
  1048. #define ADC_SQR2_SQ21 ((uint32_t)0x00007C00) /*!< SQ21[4:0] bits (21th conversion in regular sequence) */
  1049. #define ADC_SQR2_SQ21_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  1050. #define ADC_SQR2_SQ21_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  1051. #define ADC_SQR2_SQ21_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  1052. #define ADC_SQR2_SQ21_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  1053. #define ADC_SQR2_SQ21_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  1054. #define ADC_SQR2_SQ22 ((uint32_t)0x000F8000) /*!< SQ22[4:0] bits (22th conversion in regular sequence) */
  1055. #define ADC_SQR2_SQ22_0 ((uint32_t)0x00008000) /*!< Bit 0 */
  1056. #define ADC_SQR2_SQ22_1 ((uint32_t)0x00010000) /*!< Bit 1 */
  1057. #define ADC_SQR2_SQ22_2 ((uint32_t)0x00020000) /*!< Bit 2 */
  1058. #define ADC_SQR2_SQ22_3 ((uint32_t)0x00040000) /*!< Bit 3 */
  1059. #define ADC_SQR2_SQ22_4 ((uint32_t)0x00080000) /*!< Bit 4 */
  1060. #define ADC_SQR2_SQ23 ((uint32_t)0x01F00000) /*!< SQ23[4:0] bits (23th conversion in regular sequence) */
  1061. #define ADC_SQR2_SQ23_0 ((uint32_t)0x00100000) /*!< Bit 0 */
  1062. #define ADC_SQR2_SQ23_1 ((uint32_t)0x00200000) /*!< Bit 1 */
  1063. #define ADC_SQR2_SQ23_2 ((uint32_t)0x00400000) /*!< Bit 2 */
  1064. #define ADC_SQR2_SQ23_3 ((uint32_t)0x00800000) /*!< Bit 3 */
  1065. #define ADC_SQR2_SQ23_4 ((uint32_t)0x01000000) /*!< Bit 4 */
  1066. #define ADC_SQR2_SQ24 ((uint32_t)0x3E000000) /*!< SQ24[4:0] bits (24th conversion in regular sequence) */
  1067. #define ADC_SQR2_SQ24_0 ((uint32_t)0x02000000) /*!< Bit 0 */
  1068. #define ADC_SQR2_SQ24_1 ((uint32_t)0x04000000) /*!< Bit 1 */
  1069. #define ADC_SQR2_SQ24_2 ((uint32_t)0x08000000) /*!< Bit 2 */
  1070. #define ADC_SQR2_SQ24_3 ((uint32_t)0x10000000) /*!< Bit 3 */
  1071. #define ADC_SQR2_SQ24_4 ((uint32_t)0x20000000) /*!< Bit 4 */
  1072. /******************* Bit definition for ADC_SQR3 register *******************/
  1073. #define ADC_SQR3_SQ13 ((uint32_t)0x0000001F) /*!< SQ13[4:0] bits (13th conversion in regular sequence) */
  1074. #define ADC_SQR3_SQ13_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  1075. #define ADC_SQR3_SQ13_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  1076. #define ADC_SQR3_SQ13_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  1077. #define ADC_SQR3_SQ13_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  1078. #define ADC_SQR3_SQ13_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  1079. #define ADC_SQR3_SQ14 ((uint32_t)0x000003E0) /*!< SQ14[4:0] bits (14th conversion in regular sequence) */
  1080. #define ADC_SQR3_SQ14_0 ((uint32_t)0x00000020) /*!< Bit 0 */
  1081. #define ADC_SQR3_SQ14_1 ((uint32_t)0x00000040) /*!< Bit 1 */
  1082. #define ADC_SQR3_SQ14_2 ((uint32_t)0x00000080) /*!< Bit 2 */
  1083. #define ADC_SQR3_SQ14_3 ((uint32_t)0x00000100) /*!< Bit 3 */
  1084. #define ADC_SQR3_SQ14_4 ((uint32_t)0x00000200) /*!< Bit 4 */
  1085. #define ADC_SQR3_SQ15 ((uint32_t)0x00007C00) /*!< SQ15[4:0] bits (15th conversion in regular sequence) */
  1086. #define ADC_SQR3_SQ15_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  1087. #define ADC_SQR3_SQ15_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  1088. #define ADC_SQR3_SQ15_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  1089. #define ADC_SQR3_SQ15_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  1090. #define ADC_SQR3_SQ15_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  1091. #define ADC_SQR3_SQ16 ((uint32_t)0x000F8000) /*!< SQ16[4:0] bits (16th conversion in regular sequence) */
  1092. #define ADC_SQR3_SQ16_0 ((uint32_t)0x00008000) /*!< Bit 0 */
  1093. #define ADC_SQR3_SQ16_1 ((uint32_t)0x00010000) /*!< Bit 1 */
  1094. #define ADC_SQR3_SQ16_2 ((uint32_t)0x00020000) /*!< Bit 2 */
  1095. #define ADC_SQR3_SQ16_3 ((uint32_t)0x00040000) /*!< Bit 3 */
  1096. #define ADC_SQR3_SQ16_4 ((uint32_t)0x00080000) /*!< Bit 4 */
  1097. #define ADC_SQR3_SQ17 ((uint32_t)0x01F00000) /*!< SQ17[4:0] bits (17th conversion in regular sequence) */
  1098. #define ADC_SQR3_SQ17_0 ((uint32_t)0x00100000) /*!< Bit 0 */
  1099. #define ADC_SQR3_SQ17_1 ((uint32_t)0x00200000) /*!< Bit 1 */
  1100. #define ADC_SQR3_SQ17_2 ((uint32_t)0x00400000) /*!< Bit 2 */
  1101. #define ADC_SQR3_SQ17_3 ((uint32_t)0x00800000) /*!< Bit 3 */
  1102. #define ADC_SQR3_SQ17_4 ((uint32_t)0x01000000) /*!< Bit 4 */
  1103. #define ADC_SQR3_SQ18 ((uint32_t)0x3E000000) /*!< SQ18[4:0] bits (18th conversion in regular sequence) */
  1104. #define ADC_SQR3_SQ18_0 ((uint32_t)0x02000000) /*!< Bit 0 */
  1105. #define ADC_SQR3_SQ18_1 ((uint32_t)0x04000000) /*!< Bit 1 */
  1106. #define ADC_SQR3_SQ18_2 ((uint32_t)0x08000000) /*!< Bit 2 */
  1107. #define ADC_SQR3_SQ18_3 ((uint32_t)0x10000000) /*!< Bit 3 */
  1108. #define ADC_SQR3_SQ18_4 ((uint32_t)0x20000000) /*!< Bit 4 */
  1109. /******************* Bit definition for ADC_SQR4 register *******************/
  1110. #define ADC_SQR4_SQ7 ((uint32_t)0x0000001F) /*!< SQ7[4:0] bits (7th conversion in regular sequence) */
  1111. #define ADC_SQR4_SQ7_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  1112. #define ADC_SQR4_SQ7_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  1113. #define ADC_SQR4_SQ7_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  1114. #define ADC_SQR4_SQ7_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  1115. #define ADC_SQR4_SQ7_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  1116. #define ADC_SQR4_SQ8 ((uint32_t)0x000003E0) /*!< SQ8[4:0] bits (8th conversion in regular sequence) */
  1117. #define ADC_SQR4_SQ8_0 ((uint32_t)0x00000020) /*!< Bit 0 */
  1118. #define ADC_SQR4_SQ8_1 ((uint32_t)0x00000040) /*!< Bit 1 */
  1119. #define ADC_SQR4_SQ8_2 ((uint32_t)0x00000080) /*!< Bit 2 */
  1120. #define ADC_SQR4_SQ8_3 ((uint32_t)0x00000100) /*!< Bit 3 */
  1121. #define ADC_SQR4_SQ8_4 ((uint32_t)0x00000200) /*!< Bit 4 */
  1122. #define ADC_SQR4_SQ9 ((uint32_t)0x00007C00) /*!< SQ9[4:0] bits (9th conversion in regular sequence) */
  1123. #define ADC_SQR4_SQ9_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  1124. #define ADC_SQR4_SQ9_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  1125. #define ADC_SQR4_SQ9_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  1126. #define ADC_SQR4_SQ9_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  1127. #define ADC_SQR4_SQ9_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  1128. #define ADC_SQR4_SQ10 ((uint32_t)0x000F8000) /*!< SQ10[4:0] bits (10th conversion in regular sequence) */
  1129. #define ADC_SQR4_SQ10_0 ((uint32_t)0x00008000) /*!< Bit 0 */
  1130. #define ADC_SQR4_SQ10_1 ((uint32_t)0x00010000) /*!< Bit 1 */
  1131. #define ADC_SQR4_SQ10_2 ((uint32_t)0x00020000) /*!< Bit 2 */
  1132. #define ADC_SQR4_SQ10_3 ((uint32_t)0x00040000) /*!< Bit 3 */
  1133. #define ADC_SQR4_SQ10_4 ((uint32_t)0x00080000) /*!< Bit 4 */
  1134. #define ADC_SQR4_SQ11 ((uint32_t)0x01F00000) /*!< SQ11[4:0] bits (11th conversion in regular sequence) */
  1135. #define ADC_SQR4_SQ11_0 ((uint32_t)0x00100000) /*!< Bit 0 */
  1136. #define ADC_SQR4_SQ11_1 ((uint32_t)0x00200000) /*!< Bit 1 */
  1137. #define ADC_SQR4_SQ11_2 ((uint32_t)0x00400000) /*!< Bit 2 */
  1138. #define ADC_SQR4_SQ11_3 ((uint32_t)0x00800000) /*!< Bit 3 */
  1139. #define ADC_SQR4_SQ11_4 ((uint32_t)0x01000000) /*!< Bit 4 */
  1140. #define ADC_SQR4_SQ12 ((uint32_t)0x3E000000) /*!< SQ12[4:0] bits (12th conversion in regular sequence) */
  1141. #define ADC_SQR4_SQ12_0 ((uint32_t)0x02000000) /*!< Bit 0 */
  1142. #define ADC_SQR4_SQ12_1 ((uint32_t)0x04000000) /*!< Bit 1 */
  1143. #define ADC_SQR4_SQ12_2 ((uint32_t)0x08000000) /*!< Bit 2 */
  1144. #define ADC_SQR4_SQ12_3 ((uint32_t)0x10000000) /*!< Bit 3 */
  1145. #define ADC_SQR4_SQ12_4 ((uint32_t)0x20000000) /*!< Bit 4 */
  1146. /******************* Bit definition for ADC_SQR5 register *******************/
  1147. #define ADC_SQR5_SQ1 ((uint32_t)0x0000001F) /*!< SQ1[4:0] bits (1st conversion in regular sequence) */
  1148. #define ADC_SQR5_SQ1_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  1149. #define ADC_SQR5_SQ1_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  1150. #define ADC_SQR5_SQ1_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  1151. #define ADC_SQR5_SQ1_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  1152. #define ADC_SQR5_SQ1_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  1153. #define ADC_SQR5_SQ2 ((uint32_t)0x000003E0) /*!< SQ2[4:0] bits (2nd conversion in regular sequence) */
  1154. #define ADC_SQR5_SQ2_0 ((uint32_t)0x00000020) /*!< Bit 0 */
  1155. #define ADC_SQR5_SQ2_1 ((uint32_t)0x00000040) /*!< Bit 1 */
  1156. #define ADC_SQR5_SQ2_2 ((uint32_t)0x00000080) /*!< Bit 2 */
  1157. #define ADC_SQR5_SQ2_3 ((uint32_t)0x00000100) /*!< Bit 3 */
  1158. #define ADC_SQR5_SQ2_4 ((uint32_t)0x00000200) /*!< Bit 4 */
  1159. #define ADC_SQR5_SQ3 ((uint32_t)0x00007C00) /*!< SQ3[4:0] bits (3rd conversion in regular sequence) */
  1160. #define ADC_SQR5_SQ3_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  1161. #define ADC_SQR5_SQ3_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  1162. #define ADC_SQR5_SQ3_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  1163. #define ADC_SQR5_SQ3_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  1164. #define ADC_SQR5_SQ3_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  1165. #define ADC_SQR5_SQ4 ((uint32_t)0x000F8000) /*!< SQ4[4:0] bits (4th conversion in regular sequence) */
  1166. #define ADC_SQR5_SQ4_0 ((uint32_t)0x00008000) /*!< Bit 0 */
  1167. #define ADC_SQR5_SQ4_1 ((uint32_t)0x00010000) /*!< Bit 1 */
  1168. #define ADC_SQR5_SQ4_2 ((uint32_t)0x00020000) /*!< Bit 2 */
  1169. #define ADC_SQR5_SQ4_3 ((uint32_t)0x00040000) /*!< Bit 3 */
  1170. #define ADC_SQR5_SQ4_4 ((uint32_t)0x00080000) /*!< Bit 4 */
  1171. #define ADC_SQR5_SQ5 ((uint32_t)0x01F00000) /*!< SQ5[4:0] bits (5th conversion in regular sequence) */
  1172. #define ADC_SQR5_SQ5_0 ((uint32_t)0x00100000) /*!< Bit 0 */
  1173. #define ADC_SQR5_SQ5_1 ((uint32_t)0x00200000) /*!< Bit 1 */
  1174. #define ADC_SQR5_SQ5_2 ((uint32_t)0x00400000) /*!< Bit 2 */
  1175. #define ADC_SQR5_SQ5_3 ((uint32_t)0x00800000) /*!< Bit 3 */
  1176. #define ADC_SQR5_SQ5_4 ((uint32_t)0x01000000) /*!< Bit 4 */
  1177. #define ADC_SQR5_SQ6 ((uint32_t)0x3E000000) /*!< SQ6[4:0] bits (6th conversion in regular sequence) */
  1178. #define ADC_SQR5_SQ6_0 ((uint32_t)0x02000000) /*!< Bit 0 */
  1179. #define ADC_SQR5_SQ6_1 ((uint32_t)0x04000000) /*!< Bit 1 */
  1180. #define ADC_SQR5_SQ6_2 ((uint32_t)0x08000000) /*!< Bit 2 */
  1181. #define ADC_SQR5_SQ6_3 ((uint32_t)0x10000000) /*!< Bit 3 */
  1182. #define ADC_SQR5_SQ6_4 ((uint32_t)0x20000000) /*!< Bit 4 */
  1183. /******************* Bit definition for ADC_JSQR register *******************/
  1184. #define ADC_JSQR_JSQ1 ((uint32_t)0x0000001F) /*!< JSQ1[4:0] bits (1st conversion in injected sequence) */
  1185. #define ADC_JSQR_JSQ1_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  1186. #define ADC_JSQR_JSQ1_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  1187. #define ADC_JSQR_JSQ1_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  1188. #define ADC_JSQR_JSQ1_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  1189. #define ADC_JSQR_JSQ1_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  1190. #define ADC_JSQR_JSQ2 ((uint32_t)0x000003E0) /*!< JSQ2[4:0] bits (2nd conversion in injected sequence) */
  1191. #define ADC_JSQR_JSQ2_0 ((uint32_t)0x00000020) /*!< Bit 0 */
  1192. #define ADC_JSQR_JSQ2_1 ((uint32_t)0x00000040) /*!< Bit 1 */
  1193. #define ADC_JSQR_JSQ2_2 ((uint32_t)0x00000080) /*!< Bit 2 */
  1194. #define ADC_JSQR_JSQ2_3 ((uint32_t)0x00000100) /*!< Bit 3 */
  1195. #define ADC_JSQR_JSQ2_4 ((uint32_t)0x00000200) /*!< Bit 4 */
  1196. #define ADC_JSQR_JSQ3 ((uint32_t)0x00007C00) /*!< JSQ3[4:0] bits (3rd conversion in injected sequence) */
  1197. #define ADC_JSQR_JSQ3_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  1198. #define ADC_JSQR_JSQ3_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  1199. #define ADC_JSQR_JSQ3_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  1200. #define ADC_JSQR_JSQ3_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  1201. #define ADC_JSQR_JSQ3_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  1202. #define ADC_JSQR_JSQ4 ((uint32_t)0x000F8000) /*!< JSQ4[4:0] bits (4th conversion in injected sequence) */
  1203. #define ADC_JSQR_JSQ4_0 ((uint32_t)0x00008000) /*!< Bit 0 */
  1204. #define ADC_JSQR_JSQ4_1 ((uint32_t)0x00010000) /*!< Bit 1 */
  1205. #define ADC_JSQR_JSQ4_2 ((uint32_t)0x00020000) /*!< Bit 2 */
  1206. #define ADC_JSQR_JSQ4_3 ((uint32_t)0x00040000) /*!< Bit 3 */
  1207. #define ADC_JSQR_JSQ4_4 ((uint32_t)0x00080000) /*!< Bit 4 */
  1208. #define ADC_JSQR_JL ((uint32_t)0x00300000) /*!< JL[1:0] bits (Injected Sequence length) */
  1209. #define ADC_JSQR_JL_0 ((uint32_t)0x00100000) /*!< Bit 0 */
  1210. #define ADC_JSQR_JL_1 ((uint32_t)0x00200000) /*!< Bit 1 */
  1211. /******************* Bit definition for ADC_JDR1 register *******************/
  1212. #define ADC_JDR1_JDATA ((uint32_t)0x0000FFFF) /*!< Injected data */
  1213. /******************* Bit definition for ADC_JDR2 register *******************/
  1214. #define ADC_JDR2_JDATA ((uint32_t)0x0000FFFF) /*!< Injected data */
  1215. /******************* Bit definition for ADC_JDR3 register *******************/
  1216. #define ADC_JDR3_JDATA ((uint32_t)0x0000FFFF) /*!< Injected data */
  1217. /******************* Bit definition for ADC_JDR4 register *******************/
  1218. #define ADC_JDR4_JDATA ((uint32_t)0x0000FFFF) /*!< Injected data */
  1219. /******************** Bit definition for ADC_DR register ********************/
  1220. #define ADC_DR_DATA ((uint32_t)0x0000FFFF) /*!< Regular data */
  1221. /****************** Bit definition for ADC_SMPR0 register *******************/
  1222. #define ADC_SMPR0_SMP30 ((uint32_t)0x00000007) /*!< SMP30[2:0] bits (Channel 30 Sample time selection) */
  1223. #define ADC_SMPR0_SMP30_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  1224. #define ADC_SMPR0_SMP30_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  1225. #define ADC_SMPR0_SMP30_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  1226. #define ADC_SMPR0_SMP31 ((uint32_t)0x00000038) /*!< SMP31[2:0] bits (Channel 31 Sample time selection) */
  1227. #define ADC_SMPR0_SMP31_0 ((uint32_t)0x00000008) /*!< Bit 0 */
  1228. #define ADC_SMPR0_SMP31_1 ((uint32_t)0x00000010) /*!< Bit 1 */
  1229. #define ADC_SMPR0_SMP31_2 ((uint32_t)0x00000020) /*!< Bit 2 */
  1230. /******************* Bit definition for ADC_CSR register ********************/
  1231. #define ADC_CSR_AWD1 ((uint32_t)0x00000001) /*!< ADC1 Analog watchdog flag */
  1232. #define ADC_CSR_EOC1 ((uint32_t)0x00000002) /*!< ADC1 End of conversion */
  1233. #define ADC_CSR_JEOC1 ((uint32_t)0x00000004) /*!< ADC1 Injected channel end of conversion */
  1234. #define ADC_CSR_JSTRT1 ((uint32_t)0x00000008) /*!< ADC1 Injected channel Start flag */
  1235. #define ADC_CSR_STRT1 ((uint32_t)0x00000010) /*!< ADC1 Regular channel Start flag */
  1236. #define ADC_CSR_OVR1 ((uint32_t)0x00000020) /*!< ADC1 overrun flag */
  1237. #define ADC_CSR_ADONS1 ((uint32_t)0x00000040) /*!< ADON status of ADC1 */
  1238. /******************* Bit definition for ADC_CCR register ********************/
  1239. #define ADC_CCR_ADCPRE ((uint32_t)0x00030000) /*!< ADC prescaler*/
  1240. #define ADC_CCR_ADCPRE_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  1241. #define ADC_CCR_ADCPRE_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  1242. #define ADC_CCR_TSVREFE ((uint32_t)0x00800000) /*!< Temperature Sensor and VREFINT Enable */
  1243. /******************************************************************************/
  1244. /* */
  1245. /* Analog Comparators (COMP) */
  1246. /* */
  1247. /******************************************************************************/
  1248. /****************** Bit definition for COMP_CSR register ********************/
  1249. #define COMP_CSR_10KPU ((uint32_t)0x00000001) /*!< 10K pull-up resistor */
  1250. #define COMP_CSR_400KPU ((uint32_t)0x00000002) /*!< 400K pull-up resistor */
  1251. #define COMP_CSR_10KPD ((uint32_t)0x00000004) /*!< 10K pull-down resistor */
  1252. #define COMP_CSR_400KPD ((uint32_t)0x00000008) /*!< 400K pull-down resistor */
  1253. #define COMP_CSR_CMP1EN ((uint32_t)0x00000010) /*!< Comparator 1 enable */
  1254. #define COMP_CSR_SW1 ((uint32_t)0x00000020) /*!< SW1 analog switch enable */
  1255. #define COMP_CSR_CMP1OUT ((uint32_t)0x00000080) /*!< Comparator 1 output */
  1256. #define COMP_CSR_SPEED ((uint32_t)0x00001000) /*!< Comparator 2 speed */
  1257. #define COMP_CSR_CMP2OUT ((uint32_t)0x00002000) /*!< Comparator 2 ouput */
  1258. #define COMP_CSR_VREFOUTEN ((uint32_t)0x00010000) /*!< Comparator Vref Enable */
  1259. #define COMP_CSR_WNDWE ((uint32_t)0x00020000) /*!< Window mode enable */
  1260. #define COMP_CSR_INSEL ((uint32_t)0x001C0000) /*!< INSEL[2:0] Inversion input Selection */
  1261. #define COMP_CSR_INSEL_0 ((uint32_t)0x00040000) /*!< Bit 0 */
  1262. #define COMP_CSR_INSEL_1 ((uint32_t)0x00080000) /*!< Bit 1 */
  1263. #define COMP_CSR_INSEL_2 ((uint32_t)0x00100000) /*!< Bit 2 */
  1264. #define COMP_CSR_OUTSEL ((uint32_t)0x00E00000) /*!< OUTSEL[2:0] comparator 2 output redirection */
  1265. #define COMP_CSR_OUTSEL_0 ((uint32_t)0x00200000) /*!< Bit 0 */
  1266. #define COMP_CSR_OUTSEL_1 ((uint32_t)0x00400000) /*!< Bit 1 */
  1267. #define COMP_CSR_OUTSEL_2 ((uint32_t)0x00800000) /*!< Bit 2 */
  1268. #define COMP_CSR_FCH3 ((uint32_t)0x04000000) /*!< Bit 26 */
  1269. #define COMP_CSR_FCH8 ((uint32_t)0x08000000) /*!< Bit 27 */
  1270. #define COMP_CSR_RCH13 ((uint32_t)0x10000000) /*!< Bit 28 */
  1271. #define COMP_CSR_CAIE ((uint32_t)0x20000000) /*!< Bit 29 */
  1272. #define COMP_CSR_CAIF ((uint32_t)0x40000000) /*!< Bit 30 */
  1273. #define COMP_CSR_TSUSP ((uint32_t)0x80000000) /*!< Bit 31 */
  1274. /******************************************************************************/
  1275. /* */
  1276. /* Operational Amplifier (OPAMP) */
  1277. /* */
  1278. /******************************************************************************/
  1279. /******************* Bit definition for OPAMP_CSR register ******************/
  1280. #define OPAMP_CSR_OPA1PD ((uint32_t)0x00000001) /*!< OPAMP1 disable */
  1281. #define OPAMP_CSR_S3SEL1 ((uint32_t)0x00000002) /*!< Switch 3 for OPAMP1 Enable */
  1282. #define OPAMP_CSR_S4SEL1 ((uint32_t)0x00000004) /*!< Switch 4 for OPAMP1 Enable */
  1283. #define OPAMP_CSR_S5SEL1 ((uint32_t)0x00000008) /*!< Switch 5 for OPAMP1 Enable */
  1284. #define OPAMP_CSR_S6SEL1 ((uint32_t)0x00000010) /*!< Switch 6 for OPAMP1 Enable */
  1285. #define OPAMP_CSR_OPA1CAL_L ((uint32_t)0x00000020) /*!< OPAMP1 Offset calibration for P differential pair */
  1286. #define OPAMP_CSR_OPA1CAL_H ((uint32_t)0x00000040) /*!< OPAMP1 Offset calibration for N differential pair */
  1287. #define OPAMP_CSR_OPA1LPM ((uint32_t)0x00000080) /*!< OPAMP1 Low power enable */
  1288. #define OPAMP_CSR_OPA2PD ((uint32_t)0x00000100) /*!< OPAMP2 disable */
  1289. #define OPAMP_CSR_S3SEL2 ((uint32_t)0x00000200) /*!< Switch 3 for OPAMP2 Enable */
  1290. #define OPAMP_CSR_S4SEL2 ((uint32_t)0x00000400) /*!< Switch 4 for OPAMP2 Enable */
  1291. #define OPAMP_CSR_S5SEL2 ((uint32_t)0x00000800) /*!< Switch 5 for OPAMP2 Enable */
  1292. #define OPAMP_CSR_S6SEL2 ((uint32_t)0x00001000) /*!< Switch 6 for OPAMP2 Enable */
  1293. #define OPAMP_CSR_OPA2CAL_L ((uint32_t)0x00002000) /*!< OPAMP2 Offset calibration for P differential pair */
  1294. #define OPAMP_CSR_OPA2CAL_H ((uint32_t)0x00004000) /*!< OPAMP2 Offset calibration for N differential pair */
  1295. #define OPAMP_CSR_OPA2LPM ((uint32_t)0x00008000) /*!< OPAMP2 Low power enable */
  1296. #define OPAMP_CSR_OPA3PD ((uint32_t)0x00010000) /*!< OPAMP3 disable */
  1297. #define OPAMP_CSR_S3SEL3 ((uint32_t)0x00020000) /*!< Switch 3 for OPAMP3 Enable */
  1298. #define OPAMP_CSR_S4SEL3 ((uint32_t)0x00040000) /*!< Switch 4 for OPAMP3 Enable */
  1299. #define OPAMP_CSR_S5SEL3 ((uint32_t)0x00080000) /*!< Switch 5 for OPAMP3 Enable */
  1300. #define OPAMP_CSR_S6SEL3 ((uint32_t)0x00100000) /*!< Switch 6 for OPAMP3 Enable */
  1301. #define OPAMP_CSR_OPA3CAL_L ((uint32_t)0x00200000) /*!< OPAMP3 Offset calibration for P differential pair */
  1302. #define OPAMP_CSR_OPA3CAL_H ((uint32_t)0x00400000) /*!< OPAMP3 Offset calibration for N differential pair */
  1303. #define OPAMP_CSR_OPA3LPM ((uint32_t)0x00800000) /*!< OPAMP3 Low power enable */
  1304. #define OPAMP_CSR_ANAWSEL1 ((uint32_t)0x01000000) /*!< Switch ANA Enable for OPAMP1 */
  1305. #define OPAMP_CSR_ANAWSEL2 ((uint32_t)0x02000000) /*!< Switch ANA Enable for OPAMP2 */
  1306. #define OPAMP_CSR_ANAWSEL3 ((uint32_t)0x04000000) /*!< Switch ANA Enable for OPAMP3 */
  1307. #define OPAMP_CSR_S7SEL2 ((uint32_t)0x08000000) /*!< Switch 7 for OPAMP2 Enable */
  1308. #define OPAMP_CSR_AOP_RANGE ((uint32_t)0x10000000) /*!< Power range selection */
  1309. #define OPAMP_CSR_OPA1CALOUT ((uint32_t)0x20000000) /*!< OPAMP1 calibration output */
  1310. #define OPAMP_CSR_OPA2CALOUT ((uint32_t)0x40000000) /*!< OPAMP2 calibration output */
  1311. #define OPAMP_CSR_OPA3CALOUT ((uint32_t)0x80000000) /*!< OPAMP3 calibration output */
  1312. /******************* Bit definition for OPAMP_OTR register ******************/
  1313. #define OPAMP_OTR_AO1_OPT_OFFSET_TRIM_LOW ((uint32_t)0x0000001F) /*!< Offset trim for transistors differential pair PMOS of OPAMP1 */
  1314. #define OPAMP_OTR_AO1_OPT_OFFSET_TRIM_HIGH ((uint32_t)0x000003E0) /*!< Offset trim for transistors differential pair NMOS of OPAMP1 */
  1315. #define OPAMP_OTR_AO2_OPT_OFFSET_TRIM_LOW ((uint32_t)0x00007C00) /*!< Offset trim for transistors differential pair PMOS of OPAMP2 */
  1316. #define OPAMP_OTR_AO2_OPT_OFFSET_TRIM_HIGH ((uint32_t)0x000F8000) /*!< Offset trim for transistors differential pair NMOS of OPAMP2 */
  1317. #define OPAMP_OTR_AO3_OPT_OFFSET_TRIM_LOW ((uint32_t)0x01F00000) /*!< Offset trim for transistors differential pair PMOS of OPAMP3 */
  1318. #define OPAMP_OTR_AO3_OPT_OFFSET_TRIM_HIGH ((uint32_t)0x3E000000) /*!< Offset trim for transistors differential pair NMOS of OPAMP3 */
  1319. #define OPAMP_OTR_OT_USER ((uint32_t)0x80000000) /*!< Switch to OPAMP offset user trimmed values */
  1320. /******************* Bit definition for OPAMP_LPOTR register ****************/
  1321. #define OPAMP_OTR_AO1_OPT_OFFSET_TRIM_LP_LOW ((uint32_t)0x0000001F) /*!< Offset trim for transistors differential pair PMOS of OPAMP1 */
  1322. #define OPAMP_OTR_AO1_OPT_OFFSET_TRIM_LP_HIGH ((uint32_t)0x000003E0) /*!< Offset trim for transistors differential pair NMOS of OPAMP1 */
  1323. #define OPAMP_OTR_AO2_OPT_OFFSET_TRIM_LP_LOW ((uint32_t)0x00007C00) /*!< Offset trim for transistors differential pair PMOS of OPAMP2 */
  1324. #define OPAMP_OTR_AO2_OPT_OFFSET_TRIM_LP_HIGH ((uint32_t)0x000F8000) /*!< Offset trim for transistors differential pair NMOS of OPAMP2 */
  1325. #define OPAMP_OTR_AO3_OPT_OFFSET_TRIM_LP_LOW ((uint32_t)0x01F00000) /*!< Offset trim for transistors differential pair PMOS of OPAMP3 */
  1326. #define OPAMP_OTR_AO3_OPT_OFFSET_TRIM_LP_HIGH ((uint32_t)0x3E000000) /*!< Offset trim for transistors differential pair NMOS of OPAMP3 */
  1327. /******************************************************************************/
  1328. /* */
  1329. /* CRC calculation unit (CRC) */
  1330. /* */
  1331. /******************************************************************************/
  1332. /******************* Bit definition for CRC_DR register *********************/
  1333. #define CRC_DR_DR ((uint32_t)0xFFFFFFFF) /*!< Data register bits */
  1334. /******************* Bit definition for CRC_IDR register ********************/
  1335. #define CRC_IDR_IDR ((uint32_t)0x000000FF) /*!< General-purpose 8-bit data register bits */
  1336. /******************** Bit definition for CRC_CR register ********************/
  1337. #define CRC_CR_RESET ((uint32_t)0x00000001) /*!< RESET bit */
  1338. /******************************************************************************/
  1339. /* */
  1340. /* Digital to Analog Converter (DAC) */
  1341. /* */
  1342. /******************************************************************************/
  1343. /******************** Bit definition for DAC_CR register ********************/
  1344. #define DAC_CR_EN1 ((uint32_t)0x00000001) /*!<DAC channel1 enable */
  1345. #define DAC_CR_BOFF1 ((uint32_t)0x00000002) /*!<DAC channel1 output buffer disable */
  1346. #define DAC_CR_TEN1 ((uint32_t)0x00000004) /*!<DAC channel1 Trigger enable */
  1347. #define DAC_CR_TSEL1 ((uint32_t)0x00000038) /*!<TSEL1[2:0] (DAC channel1 Trigger selection) */
  1348. #define DAC_CR_TSEL1_0 ((uint32_t)0x00000008) /*!<Bit 0 */
  1349. #define DAC_CR_TSEL1_1 ((uint32_t)0x00000010) /*!<Bit 1 */
  1350. #define DAC_CR_TSEL1_2 ((uint32_t)0x00000020) /*!<Bit 2 */
  1351. #define DAC_CR_WAVE1 ((uint32_t)0x000000C0) /*!<WAVE1[1:0] (DAC channel1 noise/triangle wave generation enable) */
  1352. #define DAC_CR_WAVE1_0 ((uint32_t)0x00000040) /*!<Bit 0 */
  1353. #define DAC_CR_WAVE1_1 ((uint32_t)0x00000080) /*!<Bit 1 */
  1354. #define DAC_CR_MAMP1 ((uint32_t)0x00000F00) /*!<MAMP1[3:0] (DAC channel1 Mask/Amplitude selector) */
  1355. #define DAC_CR_MAMP1_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  1356. #define DAC_CR_MAMP1_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  1357. #define DAC_CR_MAMP1_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  1358. #define DAC_CR_MAMP1_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  1359. #define DAC_CR_DMAEN1 ((uint32_t)0x00001000) /*!<DAC channel1 DMA enable */
  1360. #define DAC_CR_DMAUDRIE1 ((uint32_t)0x00002000) /*!<DAC channel1 DMA Interrupt enable */
  1361. #define DAC_CR_EN2 ((uint32_t)0x00010000) /*!<DAC channel2 enable */
  1362. #define DAC_CR_BOFF2 ((uint32_t)0x00020000) /*!<DAC channel2 output buffer disable */
  1363. #define DAC_CR_TEN2 ((uint32_t)0x00040000) /*!<DAC channel2 Trigger enable */
  1364. #define DAC_CR_TSEL2 ((uint32_t)0x00380000) /*!<TSEL2[2:0] (DAC channel2 Trigger selection) */
  1365. #define DAC_CR_TSEL2_0 ((uint32_t)0x00080000) /*!<Bit 0 */
  1366. #define DAC_CR_TSEL2_1 ((uint32_t)0x00100000) /*!<Bit 1 */
  1367. #define DAC_CR_TSEL2_2 ((uint32_t)0x00200000) /*!<Bit 2 */
  1368. #define DAC_CR_WAVE2 ((uint32_t)0x00C00000) /*!<WAVE2[1:0] (DAC channel2 noise/triangle wave generation enable) */
  1369. #define DAC_CR_WAVE2_0 ((uint32_t)0x00400000) /*!<Bit 0 */
  1370. #define DAC_CR_WAVE2_1 ((uint32_t)0x00800000) /*!<Bit 1 */
  1371. #define DAC_CR_MAMP2 ((uint32_t)0x0F000000) /*!<MAMP2[3:0] (DAC channel2 Mask/Amplitude selector) */
  1372. #define DAC_CR_MAMP2_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  1373. #define DAC_CR_MAMP2_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  1374. #define DAC_CR_MAMP2_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  1375. #define DAC_CR_MAMP2_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  1376. #define DAC_CR_DMAEN2 ((uint32_t)0x10000000) /*!<DAC channel2 DMA enabled */
  1377. #define DAC_CR_DMAUDRIE2 ((uint32_t)0x20000000) /*!<DAC channel2 DMA underrun interrupt enable */
  1378. /***************** Bit definition for DAC_SWTRIGR register ******************/
  1379. #define DAC_SWTRIGR_SWTRIG1 ((uint32_t)0x00000001) /*!<DAC channel1 software trigger */
  1380. #define DAC_SWTRIGR_SWTRIG2 ((uint32_t)0x00000002) /*!<DAC channel2 software trigger */
  1381. /***************** Bit definition for DAC_DHR12R1 register ******************/
  1382. #define DAC_DHR12R1_DACC1DHR ((uint32_t)0x00000FFF) /*!<DAC channel1 12-bit Right aligned data */
  1383. /***************** Bit definition for DAC_DHR12L1 register ******************/
  1384. #define DAC_DHR12L1_DACC1DHR ((uint32_t)0x0000FFF0) /*!<DAC channel1 12-bit Left aligned data */
  1385. /****************** Bit definition for DAC_DHR8R1 register ******************/
  1386. #define DAC_DHR8R1_DACC1DHR ((uint32_t)0x000000FF) /*!<DAC channel1 8-bit Right aligned data */
  1387. /***************** Bit definition for DAC_DHR12R2 register ******************/
  1388. #define DAC_DHR12R2_DACC2DHR ((uint32_t)0x00000FFF) /*!<DAC channel2 12-bit Right aligned data */
  1389. /***************** Bit definition for DAC_DHR12L2 register ******************/
  1390. #define DAC_DHR12L2_DACC2DHR ((uint32_t)0x0000FFF0) /*!<DAC channel2 12-bit Left aligned data */
  1391. /****************** Bit definition for DAC_DHR8R2 register ******************/
  1392. #define DAC_DHR8R2_DACC2DHR ((uint32_t)0x000000FF) /*!<DAC channel2 8-bit Right aligned data */
  1393. /***************** Bit definition for DAC_DHR12RD register ******************/
  1394. #define DAC_DHR12RD_DACC1DHR ((uint32_t)0x00000FFF) /*!<DAC channel1 12-bit Right aligned data */
  1395. #define DAC_DHR12RD_DACC2DHR ((uint32_t)0x0FFF0000) /*!<DAC channel2 12-bit Right aligned data */
  1396. /***************** Bit definition for DAC_DHR12LD register ******************/
  1397. #define DAC_DHR12LD_DACC1DHR ((uint32_t)0x0000FFF0) /*!<DAC channel1 12-bit Left aligned data */
  1398. #define DAC_DHR12LD_DACC2DHR ((uint32_t)0xFFF00000) /*!<DAC channel2 12-bit Left aligned data */
  1399. /****************** Bit definition for DAC_DHR8RD register ******************/
  1400. #define DAC_DHR8RD_DACC1DHR ((uint32_t)0x000000FF) /*!<DAC channel1 8-bit Right aligned data */
  1401. #define DAC_DHR8RD_DACC2DHR ((uint32_t)0x0000FF00) /*!<DAC channel2 8-bit Right aligned data */
  1402. /******************* Bit definition for DAC_DOR1 register *******************/
  1403. #define DAC_DOR1_DACC1DOR ((uint32_t)0x00000FFF) /*!<DAC channel1 data output */
  1404. /******************* Bit definition for DAC_DOR2 register *******************/
  1405. #define DAC_DOR2_DACC2DOR ((uint_t)0x00000FFF) /*!<DAC channel2 data output */
  1406. /******************** Bit definition for DAC_SR register ********************/
  1407. #define DAC_SR_DMAUDR1 ((uint32_t)0x00002000) /*!<DAC channel1 DMA underrun flag */
  1408. #define DAC_SR_DMAUDR2 ((uint32_t)0x20000000) /*!<DAC channel2 DMA underrun flag */
  1409. /******************************************************************************/
  1410. /* */
  1411. /* Debug MCU (DBGMCU) */
  1412. /* */
  1413. /******************************************************************************/
  1414. /**************** Bit definition for DBGMCU_IDCODE register *****************/
  1415. #define DBGMCU_IDCODE_DEV_ID ((uint32_t)0x00000FFF) /*!< Device Identifier */
  1416. #define DBGMCU_IDCODE_REV_ID ((uint32_t)0xFFFF0000) /*!< REV_ID[15:0] bits (Revision Identifier) */
  1417. #define DBGMCU_IDCODE_REV_ID_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  1418. #define DBGMCU_IDCODE_REV_ID_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  1419. #define DBGMCU_IDCODE_REV_ID_2 ((uint32_t)0x00040000) /*!< Bit 2 */
  1420. #define DBGMCU_IDCODE_REV_ID_3 ((uint32_t)0x00080000) /*!< Bit 3 */
  1421. #define DBGMCU_IDCODE_REV_ID_4 ((uint32_t)0x00100000) /*!< Bit 4 */
  1422. #define DBGMCU_IDCODE_REV_ID_5 ((uint32_t)0x00200000) /*!< Bit 5 */
  1423. #define DBGMCU_IDCODE_REV_ID_6 ((uint32_t)0x00400000) /*!< Bit 6 */
  1424. #define DBGMCU_IDCODE_REV_ID_7 ((uint32_t)0x00800000) /*!< Bit 7 */
  1425. #define DBGMCU_IDCODE_REV_ID_8 ((uint32_t)0x01000000) /*!< Bit 8 */
  1426. #define DBGMCU_IDCODE_REV_ID_9 ((uint32_t)0x02000000) /*!< Bit 9 */
  1427. #define DBGMCU_IDCODE_REV_ID_10 ((uint32_t)0x04000000) /*!< Bit 10 */
  1428. #define DBGMCU_IDCODE_REV_ID_11 ((uint32_t)0x08000000) /*!< Bit 11 */
  1429. #define DBGMCU_IDCODE_REV_ID_12 ((uint32_t)0x10000000) /*!< Bit 12 */
  1430. #define DBGMCU_IDCODE_REV_ID_13 ((uint32_t)0x20000000) /*!< Bit 13 */
  1431. #define DBGMCU_IDCODE_REV_ID_14 ((uint32_t)0x40000000) /*!< Bit 14 */
  1432. #define DBGMCU_IDCODE_REV_ID_15 ((uint32_t)0x80000000) /*!< Bit 15 */
  1433. /****************** Bit definition for DBGMCU_CR register *******************/
  1434. #define DBGMCU_CR_DBG_SLEEP ((uint32_t)0x00000001) /*!< Debug Sleep Mode */
  1435. #define DBGMCU_CR_DBG_STOP ((uint32_t)0x00000002) /*!< Debug Stop Mode */
  1436. #define DBGMCU_CR_DBG_STANDBY ((uint32_t)0x00000004) /*!< Debug Standby mode */
  1437. #define DBGMCU_CR_TRACE_IOEN ((uint32_t)0x00000020) /*!< Trace Pin Assignment Control */
  1438. #define DBGMCU_CR_TRACE_MODE ((uint32_t)0x000000C0) /*!< TRACE_MODE[1:0] bits (Trace Pin Assignment Control) */
  1439. #define DBGMCU_CR_TRACE_MODE_0 ((uint32_t)0x00000040) /*!< Bit 0 */
  1440. #define DBGMCU_CR_TRACE_MODE_1 ((uint32_t)0x00000080) /*!< Bit 1 */
  1441. /****************** Bit definition for DBGMCU_APB1_FZ register **************/
  1442. #define DBGMCU_APB1_FZ_DBG_TIM2_STOP ((uint32_t)0x00000001) /*!< TIM2 counter stopped when core is halted */
  1443. #define DBGMCU_APB1_FZ_DBG_TIM3_STOP ((uint32_t)0x00000002) /*!< TIM3 counter stopped when core is halted */
  1444. #define DBGMCU_APB1_FZ_DBG_TIM4_STOP ((uint32_t)0x00000004) /*!< TIM4 counter stopped when core is halted */
  1445. #define DBGMCU_APB1_FZ_DBG_TIM5_STOP ((uint32_t)0x00000008) /*!< TIM5 counter stopped when core is halted */
  1446. #define DBGMCU_APB1_FZ_DBG_TIM6_STOP ((uint32_t)0x00000010) /*!< TIM6 counter stopped when core is halted */
  1447. #define DBGMCU_APB1_FZ_DBG_TIM7_STOP ((uint32_t)0x00000020) /*!< TIM7 counter stopped when core is halted */
  1448. #define DBGMCU_APB1_FZ_DBG_RTC_STOP ((uint32_t)0x00000400) /*!< RTC Counter stopped when Core is halted */
  1449. #define DBGMCU_APB1_FZ_DBG_WWDG_STOP ((uint32_t)0x00000800) /*!< Debug Window Watchdog stopped when Core is halted */
  1450. #define DBGMCU_APB1_FZ_DBG_IWDG_STOP ((uint32_t)0x00001000) /*!< Debug Independent Watchdog stopped when Core is halted */
  1451. #define DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT ((uint32_t)0x00200000) /*!< SMBUS timeout mode stopped when Core is halted */
  1452. #define DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT ((uint32_t)0x00400000) /*!< SMBUS timeout mode stopped when Core is halted */
  1453. /****************** Bit definition for DBGMCU_APB2_FZ register **************/
  1454. #define DBGMCU_APB2_FZ_DBG_TIM9_STOP ((uint32_t)0x00000004) /*!< TIM9 counter stopped when core is halted */
  1455. #define DBGMCU_APB2_FZ_DBG_TIM10_STOP ((uint32_t)0x00000008) /*!< TIM10 counter stopped when core is halted */
  1456. #define DBGMCU_APB2_FZ_DBG_TIM11_STOP ((uint32_t)0x00000010) /*!< TIM11 counter stopped when core is halted */
  1457. /******************************************************************************/
  1458. /* */
  1459. /* DMA Controller (DMA) */
  1460. /* */
  1461. /******************************************************************************/
  1462. /******************* Bit definition for DMA_ISR register ********************/
  1463. #define DMA_ISR_GIF1 ((uint32_t)0x00000001) /*!< Channel 1 Global interrupt flag */
  1464. #define DMA_ISR_TCIF1 ((uint32_t)0x00000002) /*!< Channel 1 Transfer Complete flag */
  1465. #define DMA_ISR_HTIF1 ((uint32_t)0x00000004) /*!< Channel 1 Half Transfer flag */
  1466. #define DMA_ISR_TEIF1 ((uint32_t)0x00000008) /*!< Channel 1 Transfer Error flag */
  1467. #define DMA_ISR_GIF2 ((uint32_t)0x00000010) /*!< Channel 2 Global interrupt flag */
  1468. #define DMA_ISR_TCIF2 ((uint32_t)0x00000020) /*!< Channel 2 Transfer Complete flag */
  1469. #define DMA_ISR_HTIF2 ((uint32_t)0x00000040) /*!< Channel 2 Half Transfer flag */
  1470. #define DMA_ISR_TEIF2 ((uint32_t)0x00000080) /*!< Channel 2 Transfer Error flag */
  1471. #define DMA_ISR_GIF3 ((uint32_t)0x00000100) /*!< Channel 3 Global interrupt flag */
  1472. #define DMA_ISR_TCIF3 ((uint32_t)0x00000200) /*!< Channel 3 Transfer Complete flag */
  1473. #define DMA_ISR_HTIF3 ((uint32_t)0x00000400) /*!< Channel 3 Half Transfer flag */
  1474. #define DMA_ISR_TEIF3 ((uint32_t)0x00000800) /*!< Channel 3 Transfer Error flag */
  1475. #define DMA_ISR_GIF4 ((uint32_t)0x00001000) /*!< Channel 4 Global interrupt flag */
  1476. #define DMA_ISR_TCIF4 ((uint32_t)0x00002000) /*!< Channel 4 Transfer Complete flag */
  1477. #define DMA_ISR_HTIF4 ((uint32_t)0x00004000) /*!< Channel 4 Half Transfer flag */
  1478. #define DMA_ISR_TEIF4 ((uint32_t)0x00008000) /*!< Channel 4 Transfer Error flag */
  1479. #define DMA_ISR_GIF5 ((uint32_t)0x00010000) /*!< Channel 5 Global interrupt flag */
  1480. #define DMA_ISR_TCIF5 ((uint32_t)0x00020000) /*!< Channel 5 Transfer Complete flag */
  1481. #define DMA_ISR_HTIF5 ((uint32_t)0x00040000) /*!< Channel 5 Half Transfer flag */
  1482. #define DMA_ISR_TEIF5 ((uint32_t)0x00080000) /*!< Channel 5 Transfer Error flag */
  1483. #define DMA_ISR_GIF6 ((uint32_t)0x00100000) /*!< Channel 6 Global interrupt flag */
  1484. #define DMA_ISR_TCIF6 ((uint32_t)0x00200000) /*!< Channel 6 Transfer Complete flag */
  1485. #define DMA_ISR_HTIF6 ((uint32_t)0x00400000) /*!< Channel 6 Half Transfer flag */
  1486. #define DMA_ISR_TEIF6 ((uint32_t)0x00800000) /*!< Channel 6 Transfer Error flag */
  1487. #define DMA_ISR_GIF7 ((uint32_t)0x01000000) /*!< Channel 7 Global interrupt flag */
  1488. #define DMA_ISR_TCIF7 ((uint32_t)0x02000000) /*!< Channel 7 Transfer Complete flag */
  1489. #define DMA_ISR_HTIF7 ((uint32_t)0x04000000) /*!< Channel 7 Half Transfer flag */
  1490. #define DMA_ISR_TEIF7 ((uint32_t)0x08000000) /*!< Channel 7 Transfer Error flag */
  1491. /******************* Bit definition for DMA_IFCR register *******************/
  1492. #define DMA_IFCR_CGIF1 ((uint32_t)0x00000001) /*!< Channel 1 Global interrupt clear */
  1493. #define DMA_IFCR_CTCIF1 ((uint32_t)0x00000002) /*!< Channel 1 Transfer Complete clear */
  1494. #define DMA_IFCR_CHTIF1 ((uint32_t)0x00000004) /*!< Channel 1 Half Transfer clear */
  1495. #define DMA_IFCR_CTEIF1 ((uint32_t)0x00000008) /*!< Channel 1 Transfer Error clear */
  1496. #define DMA_IFCR_CGIF2 ((uint32_t)0x00000010) /*!< Channel 2 Global interrupt clear */
  1497. #define DMA_IFCR_CTCIF2 ((uint32_t)0x00000020) /*!< Channel 2 Transfer Complete clear */
  1498. #define DMA_IFCR_CHTIF2 ((uint32_t)0x00000040) /*!< Channel 2 Half Transfer clear */
  1499. #define DMA_IFCR_CTEIF2 ((uint32_t)0x00000080) /*!< Channel 2 Transfer Error clear */
  1500. #define DMA_IFCR_CGIF3 ((uint32_t)0x00000100) /*!< Channel 3 Global interrupt clear */
  1501. #define DMA_IFCR_CTCIF3 ((uint32_t)0x00000200) /*!< Channel 3 Transfer Complete clear */
  1502. #define DMA_IFCR_CHTIF3 ((uint32_t)0x00000400) /*!< Channel 3 Half Transfer clear */
  1503. #define DMA_IFCR_CTEIF3 ((uint32_t)0x00000800) /*!< Channel 3 Transfer Error clear */
  1504. #define DMA_IFCR_CGIF4 ((uint32_t)0x00001000) /*!< Channel 4 Global interrupt clear */
  1505. #define DMA_IFCR_CTCIF4 ((uint32_t)0x00002000) /*!< Channel 4 Transfer Complete clear */
  1506. #define DMA_IFCR_CHTIF4 ((uint32_t)0x00004000) /*!< Channel 4 Half Transfer clear */
  1507. #define DMA_IFCR_CTEIF4 ((uint32_t)0x00008000) /*!< Channel 4 Transfer Error clear */
  1508. #define DMA_IFCR_CGIF5 ((uint32_t)0x00010000) /*!< Channel 5 Global interrupt clear */
  1509. #define DMA_IFCR_CTCIF5 ((uint32_t)0x00020000) /*!< Channel 5 Transfer Complete clear */
  1510. #define DMA_IFCR_CHTIF5 ((uint32_t)0x00040000) /*!< Channel 5 Half Transfer clear */
  1511. #define DMA_IFCR_CTEIF5 ((uint32_t)0x00080000) /*!< Channel 5 Transfer Error clear */
  1512. #define DMA_IFCR_CGIF6 ((uint32_t)0x00100000) /*!< Channel 6 Global interrupt clear */
  1513. #define DMA_IFCR_CTCIF6 ((uint32_t)0x00200000) /*!< Channel 6 Transfer Complete clear */
  1514. #define DMA_IFCR_CHTIF6 ((uint32_t)0x00400000) /*!< Channel 6 Half Transfer clear */
  1515. #define DMA_IFCR_CTEIF6 ((uint32_t)0x00800000) /*!< Channel 6 Transfer Error clear */
  1516. #define DMA_IFCR_CGIF7 ((uint32_t)0x01000000) /*!< Channel 7 Global interrupt clear */
  1517. #define DMA_IFCR_CTCIF7 ((uint32_t)0x02000000) /*!< Channel 7 Transfer Complete clear */
  1518. #define DMA_IFCR_CHTIF7 ((uint32_t)0x04000000) /*!< Channel 7 Half Transfer clear */
  1519. #define DMA_IFCR_CTEIF7 ((uint32_t)0x08000000) /*!< Channel 7 Transfer Error clear */
  1520. /******************* Bit definition for DMA_CCR register *******************/
  1521. #define DMA_CCR_EN ((uint32_t)0x00000001) /*!< Channel enable*/
  1522. #define DMA_CCR_TCIE ((uint32_t)0x00000002) /*!< Transfer complete interrupt enable */
  1523. #define DMA_CCR_HTIE ((uint32_t)0x00000004) /*!< Half Transfer interrupt enable */
  1524. #define DMA_CCR_TEIE ((uint32_t)0x00000008) /*!< Transfer error interrupt enable */
  1525. #define DMA_CCR_DIR ((uint32_t)0x00000010) /*!< Data transfer direction */
  1526. #define DMA_CCR_CIRC ((uint32_t)0x00000020) /*!< Circular mode */
  1527. #define DMA_CCR_PINC ((uint32_t)0x00000040) /*!< Peripheral increment mode */
  1528. #define DMA_CCR_MINC ((uint32_t)0x00000080) /*!< Memory increment mode */
  1529. #define DMA_CCR_PSIZE ((uint32_t)0x00000300) /*!< PSIZE[1:0] bits (Peripheral size) */
  1530. #define DMA_CCR_PSIZE_0 ((uint32_t)0x00000100) /*!< Bit 0 */
  1531. #define DMA_CCR_PSIZE_1 ((uint32_t)0x00000200) /*!< Bit 1 */
  1532. #define DMA_CCR_MSIZE ((uint32_t)0x00000C00) /*!< MSIZE[1:0] bits (Memory size) */
  1533. #define DMA_CCR_MSIZE_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  1534. #define DMA_CCR_MSIZE_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  1535. #define DMA_CCR_PL ((uint32_t)0x00003000) /*!< PL[1:0] bits(Channel Priority level) */
  1536. #define DMA_CCR_PL_0 ((uint32_t)0x00001000) /*!< Bit 0 */
  1537. #define DMA_CCR_PL_1 ((uint32_t)0x00002000) /*!< Bit 1 */
  1538. #define DMA_CCR_MEM2MEM ((uint32_t)0x00004000) /*!< Memory to memory mode */
  1539. /****************** Bit definition for DMA_CNDTR1 register ******************/
  1540. #define DMA_CNDTR1_NDT ((uint32_t)0x0000FFFF) /*!< Number of data to Transfer */
  1541. /****************** Bit definition for DMA_CNDTR2 register ******************/
  1542. #define DMA_CNDTR2_NDT ((uint32_t)0x0000FFFF) /*!< Number of data to Transfer */
  1543. /****************** Bit definition for DMA_CNDTR3 register ******************/
  1544. #define DMA_CNDTR3_NDT ((uint32_t)0x0000FFFF) /*!< Number of data to Transfer */
  1545. /****************** Bit definition for DMA_CNDTR4 register ******************/
  1546. #define DMA_CNDTR4_NDT ((uint32_t)0x0000FFFF) /*!< Number of data to Transfer */
  1547. /****************** Bit definition for DMA_CNDTR5 register ******************/
  1548. #define DMA_CNDTR5_NDT ((uint32_t)0x0000FFFF) /*!< Number of data to Transfer */
  1549. /****************** Bit definition for DMA_CNDTR6 register ******************/
  1550. #define DMA_CNDTR6_NDT ((uint32_t)0x0000FFFF) /*!< Number of data to Transfer */
  1551. /****************** Bit definition for DMA_CNDTR7 register ******************/
  1552. #define DMA_CNDTR7_NDT ((uint32_t)0x0000FFFF) /*!< Number of data to Transfer */
  1553. /****************** Bit definition for DMA_CPAR1 register *******************/
  1554. #define DMA_CPAR1_PA ((uint32_t)0xFFFFFFFF) /*!< Peripheral Address */
  1555. /****************** Bit definition for DMA_CPAR2 register *******************/
  1556. #define DMA_CPAR2_PA ((uint32_t)0xFFFFFFFF) /*!< Peripheral Address */
  1557. /****************** Bit definition for DMA_CPAR3 register *******************/
  1558. #define DMA_CPAR3_PA ((uint32_t)0xFFFFFFFF) /*!< Peripheral Address */
  1559. /****************** Bit definition for DMA_CPAR4 register *******************/
  1560. #define DMA_CPAR4_PA ((uint32_t)0xFFFFFFFF) /*!< Peripheral Address */
  1561. /****************** Bit definition for DMA_CPAR5 register *******************/
  1562. #define DMA_CPAR5_PA ((uint32_t)0xFFFFFFFF) /*!< Peripheral Address */
  1563. /****************** Bit definition for DMA_CPAR6 register *******************/
  1564. #define DMA_CPAR6_PA ((uint32_t)0xFFFFFFFF) /*!< Peripheral Address */
  1565. /****************** Bit definition for DMA_CPAR7 register *******************/
  1566. #define DMA_CPAR7_PA ((uint32_t)0xFFFFFFFF) /*!< Peripheral Address */
  1567. /****************** Bit definition for DMA_CMAR1 register *******************/
  1568. #define DMA_CMAR1_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  1569. /****************** Bit definition for DMA_CMAR2 register *******************/
  1570. #define DMA_CMAR2_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  1571. /****************** Bit definition for DMA_CMAR3 register *******************/
  1572. #define DMA_CMAR3_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  1573. /****************** Bit definition for DMA_CMAR4 register *******************/
  1574. #define DMA_CMAR4_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  1575. /****************** Bit definition for DMA_CMAR5 register *******************/
  1576. #define DMA_CMAR5_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  1577. /****************** Bit definition for DMA_CMAR6 register *******************/
  1578. #define DMA_CMAR6_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  1579. /****************** Bit definition for DMA_CMAR7 register *******************/
  1580. #define DMA_CMAR7_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  1581. /******************************************************************************/
  1582. /* */
  1583. /* External Interrupt/Event Controller (EXTI) */
  1584. /* */
  1585. /******************************************************************************/
  1586. /******************* Bit definition for EXTI_IMR register *******************/
  1587. #define EXTI_IMR_MR0 ((uint32_t)0x00000001) /*!< Interrupt Mask on line 0 */
  1588. #define EXTI_IMR_MR1 ((uint32_t)0x00000002) /*!< Interrupt Mask on line 1 */
  1589. #define EXTI_IMR_MR2 ((uint32_t)0x00000004) /*!< Interrupt Mask on line 2 */
  1590. #define EXTI_IMR_MR3 ((uint32_t)0x00000008) /*!< Interrupt Mask on line 3 */
  1591. #define EXTI_IMR_MR4 ((uint32_t)0x00000010) /*!< Interrupt Mask on line 4 */
  1592. #define EXTI_IMR_MR5 ((uint32_t)0x00000020) /*!< Interrupt Mask on line 5 */
  1593. #define EXTI_IMR_MR6 ((uint32_t)0x00000040) /*!< Interrupt Mask on line 6 */
  1594. #define EXTI_IMR_MR7 ((uint32_t)0x00000080) /*!< Interrupt Mask on line 7 */
  1595. #define EXTI_IMR_MR8 ((uint32_t)0x00000100) /*!< Interrupt Mask on line 8 */
  1596. #define EXTI_IMR_MR9 ((uint32_t)0x00000200) /*!< Interrupt Mask on line 9 */
  1597. #define EXTI_IMR_MR10 ((uint32_t)0x00000400) /*!< Interrupt Mask on line 10 */
  1598. #define EXTI_IMR_MR11 ((uint32_t)0x00000800) /*!< Interrupt Mask on line 11 */
  1599. #define EXTI_IMR_MR12 ((uint32_t)0x00001000) /*!< Interrupt Mask on line 12 */
  1600. #define EXTI_IMR_MR13 ((uint32_t)0x00002000) /*!< Interrupt Mask on line 13 */
  1601. #define EXTI_IMR_MR14 ((uint32_t)0x00004000) /*!< Interrupt Mask on line 14 */
  1602. #define EXTI_IMR_MR15 ((uint32_t)0x00008000) /*!< Interrupt Mask on line 15 */
  1603. #define EXTI_IMR_MR16 ((uint32_t)0x00010000) /*!< Interrupt Mask on line 16 */
  1604. #define EXTI_IMR_MR17 ((uint32_t)0x00020000) /*!< Interrupt Mask on line 17 */
  1605. #define EXTI_IMR_MR18 ((uint32_t)0x00040000) /*!< Interrupt Mask on line 18 */
  1606. #define EXTI_IMR_MR19 ((uint32_t)0x00080000) /*!< Interrupt Mask on line 19 */
  1607. #define EXTI_IMR_MR20 ((uint32_t)0x00100000) /*!< Interrupt Mask on line 20 */
  1608. #define EXTI_IMR_MR21 ((uint32_t)0x00200000) /*!< Interrupt Mask on line 21 */
  1609. #define EXTI_IMR_MR22 ((uint32_t)0x00400000) /*!< Interrupt Mask on line 22 */
  1610. #define EXTI_IMR_MR23 ((uint32_t)0x00800000) /*!< Interrupt Mask on line 23 */
  1611. /******************* Bit definition for EXTI_EMR register *******************/
  1612. #define EXTI_EMR_MR0 ((uint32_t)0x00000001) /*!< Event Mask on line 0 */
  1613. #define EXTI_EMR_MR1 ((uint32_t)0x00000002) /*!< Event Mask on line 1 */
  1614. #define EXTI_EMR_MR2 ((uint32_t)0x00000004) /*!< Event Mask on line 2 */
  1615. #define EXTI_EMR_MR3 ((uint32_t)0x00000008) /*!< Event Mask on line 3 */
  1616. #define EXTI_EMR_MR4 ((uint32_t)0x00000010) /*!< Event Mask on line 4 */
  1617. #define EXTI_EMR_MR5 ((uint32_t)0x00000020) /*!< Event Mask on line 5 */
  1618. #define EXTI_EMR_MR6 ((uint32_t)0x00000040) /*!< Event Mask on line 6 */
  1619. #define EXTI_EMR_MR7 ((uint32_t)0x00000080) /*!< Event Mask on line 7 */
  1620. #define EXTI_EMR_MR8 ((uint32_t)0x00000100) /*!< Event Mask on line 8 */
  1621. #define EXTI_EMR_MR9 ((uint32_t)0x00000200) /*!< Event Mask on line 9 */
  1622. #define EXTI_EMR_MR10 ((uint32_t)0x00000400) /*!< Event Mask on line 10 */
  1623. #define EXTI_EMR_MR11 ((uint32_t)0x00000800) /*!< Event Mask on line 11 */
  1624. #define EXTI_EMR_MR12 ((uint32_t)0x00001000) /*!< Event Mask on line 12 */
  1625. #define EXTI_EMR_MR13 ((uint32_t)0x00002000) /*!< Event Mask on line 13 */
  1626. #define EXTI_EMR_MR14 ((uint32_t)0x00004000) /*!< Event Mask on line 14 */
  1627. #define EXTI_EMR_MR15 ((uint32_t)0x00008000) /*!< Event Mask on line 15 */
  1628. #define EXTI_EMR_MR16 ((uint32_t)0x00010000) /*!< Event Mask on line 16 */
  1629. #define EXTI_EMR_MR17 ((uint32_t)0x00020000) /*!< Event Mask on line 17 */
  1630. #define EXTI_EMR_MR18 ((uint32_t)0x00040000) /*!< Event Mask on line 18 */
  1631. #define EXTI_EMR_MR19 ((uint32_t)0x00080000) /*!< Event Mask on line 19 */
  1632. #define EXTI_EMR_MR20 ((uint32_t)0x00100000) /*!< Event Mask on line 20 */
  1633. #define EXTI_EMR_MR21 ((uint32_t)0x00200000) /*!< Event Mask on line 21 */
  1634. #define EXTI_EMR_MR22 ((uint32_t)0x00400000) /*!< Event Mask on line 22 */
  1635. #define EXTI_EMR_MR23 ((uint32_t)0x00800000) /*!< Event Mask on line 23 */
  1636. /****************** Bit definition for EXTI_RTSR register *******************/
  1637. #define EXTI_RTSR_TR0 ((uint32_t)0x00000001) /*!< Rising trigger event configuration bit of line 0 */
  1638. #define EXTI_RTSR_TR1 ((uint32_t)0x00000002) /*!< Rising trigger event configuration bit of line 1 */
  1639. #define EXTI_RTSR_TR2 ((uint32_t)0x00000004) /*!< Rising trigger event configuration bit of line 2 */
  1640. #define EXTI_RTSR_TR3 ((uint32_t)0x00000008) /*!< Rising trigger event configuration bit of line 3 */
  1641. #define EXTI_RTSR_TR4 ((uint32_t)0x00000010) /*!< Rising trigger event configuration bit of line 4 */
  1642. #define EXTI_RTSR_TR5 ((uint32_t)0x00000020) /*!< Rising trigger event configuration bit of line 5 */
  1643. #define EXTI_RTSR_TR6 ((uint32_t)0x00000040) /*!< Rising trigger event configuration bit of line 6 */
  1644. #define EXTI_RTSR_TR7 ((uint32_t)0x00000080) /*!< Rising trigger event configuration bit of line 7 */
  1645. #define EXTI_RTSR_TR8 ((uint32_t)0x00000100) /*!< Rising trigger event configuration bit of line 8 */
  1646. #define EXTI_RTSR_TR9 ((uint32_t)0x00000200) /*!< Rising trigger event configuration bit of line 9 */
  1647. #define EXTI_RTSR_TR10 ((uint32_t)0x00000400) /*!< Rising trigger event configuration bit of line 10 */
  1648. #define EXTI_RTSR_TR11 ((uint32_t)0x00000800) /*!< Rising trigger event configuration bit of line 11 */
  1649. #define EXTI_RTSR_TR12 ((uint32_t)0x00001000) /*!< Rising trigger event configuration bit of line 12 */
  1650. #define EXTI_RTSR_TR13 ((uint32_t)0x00002000) /*!< Rising trigger event configuration bit of line 13 */
  1651. #define EXTI_RTSR_TR14 ((uint32_t)0x00004000) /*!< Rising trigger event configuration bit of line 14 */
  1652. #define EXTI_RTSR_TR15 ((uint32_t)0x00008000) /*!< Rising trigger event configuration bit of line 15 */
  1653. #define EXTI_RTSR_TR16 ((uint32_t)0x00010000) /*!< Rising trigger event configuration bit of line 16 */
  1654. #define EXTI_RTSR_TR17 ((uint32_t)0x00020000) /*!< Rising trigger event configuration bit of line 17 */
  1655. #define EXTI_RTSR_TR18 ((uint32_t)0x00040000) /*!< Rising trigger event configuration bit of line 18 */
  1656. #define EXTI_RTSR_TR19 ((uint32_t)0x00080000) /*!< Rising trigger event configuration bit of line 19 */
  1657. #define EXTI_RTSR_TR20 ((uint32_t)0x00100000) /*!< Rising trigger event configuration bit of line 20 */
  1658. #define EXTI_RTSR_TR21 ((uint32_t)0x00200000) /*!< Rising trigger event configuration bit of line 21 */
  1659. #define EXTI_RTSR_TR22 ((uint32_t)0x00400000) /*!< Rising trigger event configuration bit of line 22 */
  1660. #define EXTI_RTSR_TR23 ((uint32_t)0x00800000) /*!< Rising trigger event configuration bit of line 23 */
  1661. /****************** Bit definition for EXTI_FTSR register *******************/
  1662. #define EXTI_FTSR_TR0 ((uint32_t)0x00000001) /*!< Falling trigger event configuration bit of line 0 */
  1663. #define EXTI_FTSR_TR1 ((uint32_t)0x00000002) /*!< Falling trigger event configuration bit of line 1 */
  1664. #define EXTI_FTSR_TR2 ((uint32_t)0x00000004) /*!< Falling trigger event configuration bit of line 2 */
  1665. #define EXTI_FTSR_TR3 ((uint32_t)0x00000008) /*!< Falling trigger event configuration bit of line 3 */
  1666. #define EXTI_FTSR_TR4 ((uint32_t)0x00000010) /*!< Falling trigger event configuration bit of line 4 */
  1667. #define EXTI_FTSR_TR5 ((uint32_t)0x00000020) /*!< Falling trigger event configuration bit of line 5 */
  1668. #define EXTI_FTSR_TR6 ((uint32_t)0x00000040) /*!< Falling trigger event configuration bit of line 6 */
  1669. #define EXTI_FTSR_TR7 ((uint32_t)0x00000080) /*!< Falling trigger event configuration bit of line 7 */
  1670. #define EXTI_FTSR_TR8 ((uint32_t)0x00000100) /*!< Falling trigger event configuration bit of line 8 */
  1671. #define EXTI_FTSR_TR9 ((uint32_t)0x00000200) /*!< Falling trigger event configuration bit of line 9 */
  1672. #define EXTI_FTSR_TR10 ((uint32_t)0x00000400) /*!< Falling trigger event configuration bit of line 10 */
  1673. #define EXTI_FTSR_TR11 ((uint32_t)0x00000800) /*!< Falling trigger event configuration bit of line 11 */
  1674. #define EXTI_FTSR_TR12 ((uint32_t)0x00001000) /*!< Falling trigger event configuration bit of line 12 */
  1675. #define EXTI_FTSR_TR13 ((uint32_t)0x00002000) /*!< Falling trigger event configuration bit of line 13 */
  1676. #define EXTI_FTSR_TR14 ((uint32_t)0x00004000) /*!< Falling trigger event configuration bit of line 14 */
  1677. #define EXTI_FTSR_TR15 ((uint32_t)0x00008000) /*!< Falling trigger event configuration bit of line 15 */
  1678. #define EXTI_FTSR_TR16 ((uint32_t)0x00010000) /*!< Falling trigger event configuration bit of line 16 */
  1679. #define EXTI_FTSR_TR17 ((uint32_t)0x00020000) /*!< Falling trigger event configuration bit of line 17 */
  1680. #define EXTI_FTSR_TR18 ((uint32_t)0x00040000) /*!< Falling trigger event configuration bit of line 18 */
  1681. #define EXTI_FTSR_TR19 ((uint32_t)0x00080000) /*!< Falling trigger event configuration bit of line 19 */
  1682. #define EXTI_FTSR_TR20 ((uint32_t)0x00100000) /*!< Falling trigger event configuration bit of line 20 */
  1683. #define EXTI_FTSR_TR21 ((uint32_t)0x00200000) /*!< Falling trigger event configuration bit of line 21 */
  1684. #define EXTI_FTSR_TR22 ((uint32_t)0x00400000) /*!< Falling trigger event configuration bit of line 22 */
  1685. #define EXTI_FTSR_TR23 ((uint32_t)0x00800000) /*!< Falling trigger event configuration bit of line 23 */
  1686. /****************** Bit definition for EXTI_SWIER register ******************/
  1687. #define EXTI_SWIER_SWIER0 ((uint32_t)0x00000001) /*!< Software Interrupt on line 0 */
  1688. #define EXTI_SWIER_SWIER1 ((uint32_t)0x00000002) /*!< Software Interrupt on line 1 */
  1689. #define EXTI_SWIER_SWIER2 ((uint32_t)0x00000004) /*!< Software Interrupt on line 2 */
  1690. #define EXTI_SWIER_SWIER3 ((uint32_t)0x00000008) /*!< Software Interrupt on line 3 */
  1691. #define EXTI_SWIER_SWIER4 ((uint32_t)0x00000010) /*!< Software Interrupt on line 4 */
  1692. #define EXTI_SWIER_SWIER5 ((uint32_t)0x00000020) /*!< Software Interrupt on line 5 */
  1693. #define EXTI_SWIER_SWIER6 ((uint32_t)0x00000040) /*!< Software Interrupt on line 6 */
  1694. #define EXTI_SWIER_SWIER7 ((uint32_t)0x00000080) /*!< Software Interrupt on line 7 */
  1695. #define EXTI_SWIER_SWIER8 ((uint32_t)0x00000100) /*!< Software Interrupt on line 8 */
  1696. #define EXTI_SWIER_SWIER9 ((uint32_t)0x00000200) /*!< Software Interrupt on line 9 */
  1697. #define EXTI_SWIER_SWIER10 ((uint32_t)0x00000400) /*!< Software Interrupt on line 10 */
  1698. #define EXTI_SWIER_SWIER11 ((uint32_t)0x00000800) /*!< Software Interrupt on line 11 */
  1699. #define EXTI_SWIER_SWIER12 ((uint32_t)0x00001000) /*!< Software Interrupt on line 12 */
  1700. #define EXTI_SWIER_SWIER13 ((uint32_t)0x00002000) /*!< Software Interrupt on line 13 */
  1701. #define EXTI_SWIER_SWIER14 ((uint32_t)0x00004000) /*!< Software Interrupt on line 14 */
  1702. #define EXTI_SWIER_SWIER15 ((uint32_t)0x00008000) /*!< Software Interrupt on line 15 */
  1703. #define EXTI_SWIER_SWIER16 ((uint32_t)0x00010000) /*!< Software Interrupt on line 16 */
  1704. #define EXTI_SWIER_SWIER17 ((uint32_t)0x00020000) /*!< Software Interrupt on line 17 */
  1705. #define EXTI_SWIER_SWIER18 ((uint32_t)0x00040000) /*!< Software Interrupt on line 18 */
  1706. #define EXTI_SWIER_SWIER19 ((uint32_t)0x00080000) /*!< Software Interrupt on line 19 */
  1707. #define EXTI_SWIER_SWIER20 ((uint32_t)0x00100000) /*!< Software Interrupt on line 20 */
  1708. #define EXTI_SWIER_SWIER21 ((uint32_t)0x00200000) /*!< Software Interrupt on line 21 */
  1709. #define EXTI_SWIER_SWIER22 ((uint32_t)0x00400000) /*!< Software Interrupt on line 22 */
  1710. #define EXTI_SWIER_SWIER23 ((uint32_t)0x00800000) /*!< Software Interrupt on line 23 */
  1711. /******************* Bit definition for EXTI_PR register ********************/
  1712. #define EXTI_PR_PR0 ((uint32_t)0x00000001) /*!< Pending bit 0 */
  1713. #define EXTI_PR_PR1 ((uint32_t)0x00000002) /*!< Pending bit 1 */
  1714. #define EXTI_PR_PR2 ((uint32_t)0x00000004) /*!< Pending bit 2 */
  1715. #define EXTI_PR_PR3 ((uint32_t)0x00000008) /*!< Pending bit 3 */
  1716. #define EXTI_PR_PR4 ((uint32_t)0x00000010) /*!< Pending bit 4 */
  1717. #define EXTI_PR_PR5 ((uint32_t)0x00000020) /*!< Pending bit 5 */
  1718. #define EXTI_PR_PR6 ((uint32_t)0x00000040) /*!< Pending bit 6 */
  1719. #define EXTI_PR_PR7 ((uint32_t)0x00000080) /*!< Pending bit 7 */
  1720. #define EXTI_PR_PR8 ((uint32_t)0x00000100) /*!< Pending bit 8 */
  1721. #define EXTI_PR_PR9 ((uint32_t)0x00000200) /*!< Pending bit 9 */
  1722. #define EXTI_PR_PR10 ((uint32_t)0x00000400) /*!< Pending bit 10 */
  1723. #define EXTI_PR_PR11 ((uint32_t)0x00000800) /*!< Pending bit 11 */
  1724. #define EXTI_PR_PR12 ((uint32_t)0x00001000) /*!< Pending bit 12 */
  1725. #define EXTI_PR_PR13 ((uint32_t)0x00002000) /*!< Pending bit 13 */
  1726. #define EXTI_PR_PR14 ((uint32_t)0x00004000) /*!< Pending bit 14 */
  1727. #define EXTI_PR_PR15 ((uint32_t)0x00008000) /*!< Pending bit 15 */
  1728. #define EXTI_PR_PR16 ((uint32_t)0x00010000) /*!< Pending bit 16 */
  1729. #define EXTI_PR_PR17 ((uint32_t)0x00020000) /*!< Pending bit 17 */
  1730. #define EXTI_PR_PR18 ((uint32_t)0x00040000) /*!< Pending bit 18 */
  1731. #define EXTI_PR_PR19 ((uint32_t)0x00080000) /*!< Pending bit 19 */
  1732. #define EXTI_PR_PR20 ((uint32_t)0x00100000) /*!< Pending bit 20 */
  1733. #define EXTI_PR_PR21 ((uint32_t)0x00200000) /*!< Pending bit 21 */
  1734. #define EXTI_PR_PR22 ((uint32_t)0x00400000) /*!< Pending bit 22 */
  1735. #define EXTI_PR_PR23 ((uint32_t)0x00800000) /*!< Pending bit 23 */
  1736. /******************************************************************************/
  1737. /* */
  1738. /* FLASH, DATA EEPROM and Option Bytes Registers */
  1739. /* (FLASH, DATA_EEPROM, OB) */
  1740. /* */
  1741. /******************************************************************************/
  1742. /******************* Bit definition for FLASH_ACR register ******************/
  1743. #define FLASH_ACR_LATENCY ((uint32_t)0x00000001) /*!< Latency */
  1744. #define FLASH_ACR_PRFTEN ((uint32_t)0x00000002) /*!< Prefetch Buffer Enable */
  1745. #define FLASH_ACR_ACC64 ((uint32_t)0x00000004) /*!< Access 64 bits */
  1746. #define FLASH_ACR_SLEEP_PD ((uint32_t)0x00000008) /*!< Flash mode during sleep mode */
  1747. #define FLASH_ACR_RUN_PD ((uint32_t)0x00000010) /*!< Flash mode during RUN mode */
  1748. /******************* Bit definition for FLASH_PECR register ******************/
  1749. #define FLASH_PECR_PELOCK ((uint32_t)0x00000001) /*!< FLASH_PECR and Flash data Lock */
  1750. #define FLASH_PECR_PRGLOCK ((uint32_t)0x00000002) /*!< Program matrix Lock */
  1751. #define FLASH_PECR_OPTLOCK ((uint32_t)0x00000004) /*!< Option byte matrix Lock */
  1752. #define FLASH_PECR_PROG ((uint32_t)0x00000008) /*!< Program matrix selection */
  1753. #define FLASH_PECR_DATA ((uint32_t)0x00000010) /*!< Data matrix selection */
  1754. #define FLASH_PECR_FTDW ((uint32_t)0x00000100) /*!< Fixed Time Data write for Word/Half Word/Byte programming */
  1755. #define FLASH_PECR_ERASE ((uint32_t)0x00000200) /*!< Page erasing mode */
  1756. #define FLASH_PECR_FPRG ((uint32_t)0x00000400) /*!< Fast Page/Half Page programming mode */
  1757. #define FLASH_PECR_PARALLBANK ((uint32_t)0x00008000) /*!< Parallel Bank mode */
  1758. #define FLASH_PECR_EOPIE ((uint32_t)0x00010000) /*!< End of programming interrupt */
  1759. #define FLASH_PECR_ERRIE ((uint32_t)0x00020000) /*!< Error interrupt */
  1760. #define FLASH_PECR_OBL_LAUNCH ((uint32_t)0x00040000) /*!< Launch the option byte loading */
  1761. /****************** Bit definition for FLASH_PDKEYR register ******************/
  1762. #define FLASH_PDKEYR_PDKEYR ((uint32_t)0xFFFFFFFF) /*!< FLASH_PEC and data matrix Key */
  1763. /****************** Bit definition for FLASH_PEKEYR register ******************/
  1764. #define FLASH_PEKEYR_PEKEYR ((uint32_t)0xFFFFFFFF) /*!< FLASH_PEC and data matrix Key */
  1765. /****************** Bit definition for FLASH_PRGKEYR register ******************/
  1766. #define FLASH_PRGKEYR_PRGKEYR ((uint32_t)0xFFFFFFFF) /*!< Program matrix Key */
  1767. /****************** Bit definition for FLASH_OPTKEYR register ******************/
  1768. #define FLASH_OPTKEYR_OPTKEYR ((uint32_t)0xFFFFFFFF) /*!< Option bytes matrix Key */
  1769. /****************** Bit definition for FLASH_SR register *******************/
  1770. #define FLASH_SR_BSY ((uint32_t)0x00000001) /*!< Busy */
  1771. #define FLASH_SR_EOP ((uint32_t)0x00000002) /*!< End Of Programming*/
  1772. #define FLASH_SR_ENDHV ((uint32_t)0x00000004) /*!< End of high voltage */
  1773. #define FLASH_SR_READY ((uint32_t)0x00000008) /*!< Flash ready after low power mode */
  1774. #define FLASH_SR_WRPERR ((uint32_t)0x00000100) /*!< Write protected error */
  1775. #define FLASH_SR_PGAERR ((uint32_t)0x00000200) /*!< Programming Alignment Error */
  1776. #define FLASH_SR_SIZERR ((uint32_t)0x00000400) /*!< Size error */
  1777. #define FLASH_SR_OPTVERR ((uint32_t)0x00000800) /*!< Option validity error */
  1778. #define FLASH_SR_OPTVERRUSR ((uint32_t)0x00001000) /*!< Option User validity error */
  1779. /****************** Bit definition for FLASH_OBR register *******************/
  1780. #define FLASH_OBR_RDPRT ((uint32_t)0x000000FF) /*!< Read Protection */
  1781. #define FLASH_OBR_BOR_LEV ((uint32_t)0x000F0000) /*!< BOR_LEV[3:0] Brown Out Reset Threshold Level*/
  1782. #define FLASH_OBR_USER ((uint32_t)0x00F00000) /*!< User Option Bytes */
  1783. #define FLASH_OBR_IWDG_SW ((uint32_t)0x00100000) /*!< IWDG_SW */
  1784. #define FLASH_OBR_nRST_STOP ((uint32_t)0x00200000) /*!< nRST_STOP */
  1785. #define FLASH_OBR_nRST_STDBY ((uint32_t)0x00400000) /*!< nRST_STDBY */
  1786. #define FLASH_OBR_nRST_BFB2 ((uint32_t)0x00800000) /*!< BFB2 */
  1787. /****************** Bit definition for FLASH_WRPR register ******************/
  1788. #define FLASH_WRPR1_WRP ((uint32_t)0xFFFFFFFF) /*!< Write Protect */
  1789. #define FLASH_WRPR2_WRP ((uint32_t)0xFFFFFFFF) /*!< Write Protect */
  1790. #define FLASH_WRPR3_WRP ((uint32_t)0xFFFFFFFF) /*!< Write Protect */
  1791. /******************************************************************************/
  1792. /* */
  1793. /* Flexible Static Memory Controller */
  1794. /* */
  1795. /******************************************************************************/
  1796. /****************** Bit definition for FSMC_BCRx register (x=1..4) *******************/
  1797. #define FSMC_BCRx_MBKEN ((uint32_t)0x00000001) /*!< Memory bank enable bit */
  1798. #define FSMC_BCRx_MUXEN ((uint32_t)0x00000002) /*!< Address/data multiplexing enable bit */
  1799. #define FSMC_BCRx_MTYP ((uint32_t)0x0000000C) /*!< MTYP[1:0] bits (Memory type) */
  1800. #define FSMC_BCRx_MTYP_0 ((uint32_t)0x00000004) /*!< Bit 0 */
  1801. #define FSMC_BCRx_MTYP_1 ((uint32_t)0x00000008) /*!< Bit 1 */
  1802. #define FSMC_BCRx_MWID ((uint32_t)0x00000030) /*!< MWID[1:0] bits (Memory data bus width) */
  1803. #define FSMC_BCRx_MWID_0 ((uint32_t)0x00000010) /*!< Bit 0 */
  1804. #define FSMC_BCRx_MWID_1 ((uint32_t)0x00000020) /*!< Bit 1 */
  1805. #define FSMC_BCRx_FACCEN ((uint32_t)0x00000040) /*!< Flash access enable */
  1806. #define FSMC_BCRx_BURSTEN ((uint32_t)0x00000100) /*!< Burst enable bit */
  1807. #define FSMC_BCRx_WAITPOL ((uint32_t)0x00000200) /*!< Wait signal polarity bit */
  1808. #define FSMC_BCRx_WRAPMOD ((uint32_t)0x00000400) /*!< Wrapped burst mode support */
  1809. #define FSMC_BCRx_WAITCFG ((uint32_t)0x00000800) /*!< Wait timing configuration */
  1810. #define FSMC_BCRx_WREN ((uint32_t)0x00001000) /*!< Write enable bit */
  1811. #define FSMC_BCRx_WAITEN ((uint32_t)0x00002000) /*!< Wait enable bit */
  1812. #define FSMC_BCRx_EXTMOD ((uint32_t)0x00004000) /*!< Extended mode enable */
  1813. #define FSMC_BCRx_ASYNCWAIT ((uint32_t)0x00008000) /*!< Asynchronous wait */
  1814. #define FSMC_BCRx_CBURSTRW ((uint32_t)0x00080000) /*!< Write burst enable */
  1815. /****************** Bit definition for FSMC_BTRx register (x=1..4) ******************/
  1816. #define FSMC_BTRx_ADDSET ((uint32_t)0x0000000F) /*!< ADDSET[3:0] bits (Address setup phase duration) */
  1817. #define FSMC_BTRx_ADDSET_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  1818. #define FSMC_BTRx_ADDSET_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  1819. #define FSMC_BTRx_ADDSET_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  1820. #define FSMC_BTRx_ADDSET_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  1821. #define FSMC_BTRx_ADDHLD ((uint32_t)0x000000F0) /*!< ADDHLD[3:0] bits (Address-hold phase duration) */
  1822. #define FSMC_BTRx_ADDHLD_0 ((uint32_t)0x00000010) /*!< Bit 0 */
  1823. #define FSMC_BTRx_ADDHLD_1 ((uint32_t)0x00000020) /*!< Bit 1 */
  1824. #define FSMC_BTRx_ADDHLD_2 ((uint32_t)0x00000040) /*!< Bit 2 */
  1825. #define FSMC_BTRx_ADDHLD_3 ((uint32_t)0x00000080) /*!< Bit 3 */
  1826. #define FSMC_BTRx_DATAST ((uint32_t)0x0000FF00) /*!< DATAST [7:0] bits (Data-phase duration) */
  1827. #define FSMC_BTRx_DATAST_0 ((uint32_t)0x00000100) /*!< Bit 0 */
  1828. #define FSMC_BTRx_DATAST_1 ((uint32_t)0x00000200) /*!< Bit 1 */
  1829. #define FSMC_BTRx_DATAST_2 ((uint32_t)0x00000400) /*!< Bit 2 */
  1830. #define FSMC_BTRx_DATAST_3 ((uint32_t)0x00000800) /*!< Bit 3 */
  1831. #define FSMC_BTRx_DATAST_4 ((uint32_t)0x00001000) /*!< Bit 4 */
  1832. #define FSMC_BTRx_DATAST_5 ((uint32_t)0x00002000) /*!< Bit 5 */
  1833. #define FSMC_BTRx_DATAST_6 ((uint32_t)0x00004000) /*!< Bit 6 */
  1834. #define FSMC_BTRx_DATAST_7 ((uint32_t)0x00008000) /*!< Bit 7 */
  1835. #define FSMC_BTRx_BUSTURN ((uint32_t)0x000F0000) /*!< BUSTURN[3:0] bits (Bus turnaround phase duration) */
  1836. #define FSMC_BTRx_BUSTURN_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  1837. #define FSMC_BTRx_BUSTURN_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  1838. #define FSMC_BTRx_BUSTURN_2 ((uint32_t)0x00040000) /*!< Bit 2 */
  1839. #define FSMC_BTRx_BUSTURN_3 ((uint32_t)0x00080000) /*!< Bit 3 */
  1840. #define FSMC_BTRx_CLKDIV ((uint32_t)0x00F00000) /*!< CLKDIV[3:0] bits (Clock divide ratio) */
  1841. #define FSMC_BTRx_CLKDIV_0 ((uint32_t)0x00100000) /*!< Bit 0 */
  1842. #define FSMC_BTRx_CLKDIV_1 ((uint32_t)0x00200000) /*!< Bit 1 */
  1843. #define FSMC_BTRx_CLKDIV_2 ((uint32_t)0x00400000) /*!< Bit 2 */
  1844. #define FSMC_BTRx_CLKDIV_3 ((uint32_t)0x00800000) /*!< Bit 3 */
  1845. #define FSMC_BTRx_DATLAT ((uint32_t)0x0F000000) /*!< DATLA[3:0] bits (Data latency) */
  1846. #define FSMC_BTRx_DATLAT_0 ((uint32_t)0x01000000) /*!< Bit 0 */
  1847. #define FSMC_BTRx_DATLAT_1 ((uint32_t)0x02000000) /*!< Bit 1 */
  1848. #define FSMC_BTRx_DATLAT_2 ((uint32_t)0x04000000) /*!< Bit 2 */
  1849. #define FSMC_BTRx_DATLAT_3 ((uint32_t)0x08000000) /*!< Bit 3 */
  1850. #define FSMC_BTRx_ACCMOD ((uint32_t)0x30000000) /*!< ACCMOD[1:0] bits (Access mode) */
  1851. #define FSMC_BTRx_ACCMOD_0 ((uint32_t)0x10000000) /*!< Bit 0 */
  1852. #define FSMC_BTRx_ACCMOD_1 ((uint32_t)0x20000000) /*!< Bit 1 */
  1853. /****************** Bit definition for FSMC_BWTRx register (x=1..4) ******************/
  1854. #define FSMC_BWTRx_ADDSET ((uint32_t)0x0000000F) /*!< ADDSET[3:0] bits (Address setup phase duration) */
  1855. #define FSMC_BWTRx_ADDSET_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  1856. #define FSMC_BWTRx_ADDSET_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  1857. #define FSMC_BWTRx_ADDSET_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  1858. #define FSMC_BWTRx_ADDSET_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  1859. #define FSMC_BWTRx_ADDHLD ((uint32_t)0x000000F0) /*!< ADDHLD[3:0] bits (Address-hold phase duration) */
  1860. #define FSMC_BWTRx_ADDHLD_0 ((uint32_t)0x00000010) /*!< Bit 0 */
  1861. #define FSMC_BWTRx_ADDHLD_1 ((uint32_t)0x00000020) /*!< Bit 1 */
  1862. #define FSMC_BWTRx_ADDHLD_2 ((uint32_t)0x00000040) /*!< Bit 2 */
  1863. #define FSMC_BWTRx_ADDHLD_3 ((uint32_t)0x00000080) /*!< Bit 3 */
  1864. #define FSMC_BWTRx_DATAST ((uint32_t)0x0000FF00) /*!< DATAST [7:0] bits (Data-phase duration) */
  1865. #define FSMC_BWTRx_DATAST_0 ((uint32_t)0x00000100) /*!< Bit 0 */
  1866. #define FSMC_BWTRx_DATAST_1 ((uint32_t)0x00000200) /*!< Bit 1 */
  1867. #define FSMC_BWTRx_DATAST_2 ((uint32_t)0x00000400) /*!< Bit 2 */
  1868. #define FSMC_BWTRx_DATAST_3 ((uint32_t)0x00000800) /*!< Bit 3 */
  1869. #define FSMC_BWTRx_DATAST_4 ((uint32_t)0x00001000) /*!< Bit 4 */
  1870. #define FSMC_BWTRx_DATAST_5 ((uint32_t)0x00002000) /*!< Bit 5 */
  1871. #define FSMC_BWTRx_DATAST_6 ((uint32_t)0x00004000) /*!< Bit 6 */
  1872. #define FSMC_BWTRx_DATAST_7 ((uint32_t)0x00008000) /*!< Bit 7 */
  1873. #define FSMC_BWTRx_BUSTURN ((uint32_t)0x000F0000) /*!< BUSTURN[3:0] bits (Bus turnaround phase duration) */
  1874. #define FSMC_BWTRx_BUSTURN_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  1875. #define FSMC_BWTRx_BUSTURN_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  1876. #define FSMC_BWTRx_BUSTURN_2 ((uint32_t)0x00040000) /*!< Bit 2 */
  1877. #define FSMC_BWTRx_BUSTURN_3 ((uint32_t)0x00080000) /*!< Bit 3 */
  1878. #define FSMC_BWTRx_ACCMOD ((uint32_t)0x30000000) /*!< ACCMOD[1:0] bits (Access mode) */
  1879. #define FSMC_BWTRx_ACCMOD_0 ((uint32_t)0x10000000) /*!< Bit 0 */
  1880. #define FSMC_BWTRx_ACCMOD_1 ((uint32_t)0x20000000) /*!< Bit 1 */
  1881. /******************************************************************************/
  1882. /* */
  1883. /* General Purpose I/O */
  1884. /* */
  1885. /******************************************************************************/
  1886. /****************** Bits definition for GPIO_MODER register *****************/
  1887. #define GPIO_MODER_MODER0 ((uint32_t)0x00000003)
  1888. #define GPIO_MODER_MODER0_0 ((uint32_t)0x00000001)
  1889. #define GPIO_MODER_MODER0_1 ((uint32_t)0x00000002)
  1890. #define GPIO_MODER_MODER1 ((uint32_t)0x0000000C)
  1891. #define GPIO_MODER_MODER1_0 ((uint32_t)0x00000004)
  1892. #define GPIO_MODER_MODER1_1 ((uint32_t)0x00000008)
  1893. #define GPIO_MODER_MODER2 ((uint32_t)0x00000030)
  1894. #define GPIO_MODER_MODER2_0 ((uint32_t)0x00000010)
  1895. #define GPIO_MODER_MODER2_1 ((uint32_t)0x00000020)
  1896. #define GPIO_MODER_MODER3 ((uint32_t)0x000000C0)
  1897. #define GPIO_MODER_MODER3_0 ((uint32_t)0x00000040)
  1898. #define GPIO_MODER_MODER3_1 ((uint32_t)0x00000080)
  1899. #define GPIO_MODER_MODER4 ((uint32_t)0x00000300)
  1900. #define GPIO_MODER_MODER4_0 ((uint32_t)0x00000100)
  1901. #define GPIO_MODER_MODER4_1 ((uint32_t)0x00000200)
  1902. #define GPIO_MODER_MODER5 ((uint32_t)0x00000C00)
  1903. #define GPIO_MODER_MODER5_0 ((uint32_t)0x00000400)
  1904. #define GPIO_MODER_MODER5_1 ((uint32_t)0x00000800)
  1905. #define GPIO_MODER_MODER6 ((uint32_t)0x00003000)
  1906. #define GPIO_MODER_MODER6_0 ((uint32_t)0x00001000)
  1907. #define GPIO_MODER_MODER6_1 ((uint32_t)0x00002000)
  1908. #define GPIO_MODER_MODER7 ((uint32_t)0x0000C000)
  1909. #define GPIO_MODER_MODER7_0 ((uint32_t)0x00004000)
  1910. #define GPIO_MODER_MODER7_1 ((uint32_t)0x00008000)
  1911. #define GPIO_MODER_MODER8 ((uint32_t)0x00030000)
  1912. #define GPIO_MODER_MODER8_0 ((uint32_t)0x00010000)
  1913. #define GPIO_MODER_MODER8_1 ((uint32_t)0x00020000)
  1914. #define GPIO_MODER_MODER9 ((uint32_t)0x000C0000)
  1915. #define GPIO_MODER_MODER9_0 ((uint32_t)0x00040000)
  1916. #define GPIO_MODER_MODER9_1 ((uint32_t)0x00080000)
  1917. #define GPIO_MODER_MODER10 ((uint32_t)0x00300000)
  1918. #define GPIO_MODER_MODER10_0 ((uint32_t)0x00100000)
  1919. #define GPIO_MODER_MODER10_1 ((uint32_t)0x00200000)
  1920. #define GPIO_MODER_MODER11 ((uint32_t)0x00C00000)
  1921. #define GPIO_MODER_MODER11_0 ((uint32_t)0x00400000)
  1922. #define GPIO_MODER_MODER11_1 ((uint32_t)0x00800000)
  1923. #define GPIO_MODER_MODER12 ((uint32_t)0x03000000)
  1924. #define GPIO_MODER_MODER12_0 ((uint32_t)0x01000000)
  1925. #define GPIO_MODER_MODER12_1 ((uint32_t)0x02000000)
  1926. #define GPIO_MODER_MODER13 ((uint32_t)0x0C000000)
  1927. #define GPIO_MODER_MODER13_0 ((uint32_t)0x04000000)
  1928. #define GPIO_MODER_MODER13_1 ((uint32_t)0x08000000)
  1929. #define GPIO_MODER_MODER14 ((uint32_t)0x30000000)
  1930. #define GPIO_MODER_MODER14_0 ((uint32_t)0x10000000)
  1931. #define GPIO_MODER_MODER14_1 ((uint32_t)0x20000000)
  1932. #define GPIO_MODER_MODER15 ((uint32_t)0xC0000000)
  1933. #define GPIO_MODER_MODER15_0 ((uint32_t)0x40000000)
  1934. #define GPIO_MODER_MODER15_1 ((uint32_t)0x80000000)
  1935. /****************** Bits definition for GPIO_OTYPER register ****************/
  1936. #define GPIO_OTYPER_OT_0 ((uint32_t)0x00000001)
  1937. #define GPIO_OTYPER_OT_1 ((uint32_t)0x00000002)
  1938. #define GPIO_OTYPER_OT_2 ((uint32_t)0x00000004)
  1939. #define GPIO_OTYPER_OT_3 ((uint32_t)0x00000008)
  1940. #define GPIO_OTYPER_OT_4 ((uint32_t)0x00000010)
  1941. #define GPIO_OTYPER_OT_5 ((uint32_t)0x00000020)
  1942. #define GPIO_OTYPER_OT_6 ((uint32_t)0x00000040)
  1943. #define GPIO_OTYPER_OT_7 ((uint32_t)0x00000080)
  1944. #define GPIO_OTYPER_OT_8 ((uint32_t)0x00000100)
  1945. #define GPIO_OTYPER_OT_9 ((uint32_t)0x00000200)
  1946. #define GPIO_OTYPER_OT_10 ((uint32_t)0x00000400)
  1947. #define GPIO_OTYPER_OT_11 ((uint32_t)0x00000800)
  1948. #define GPIO_OTYPER_OT_12 ((uint32_t)0x00001000)
  1949. #define GPIO_OTYPER_OT_13 ((uint32_t)0x00002000)
  1950. #define GPIO_OTYPER_OT_14 ((uint32_t)0x00004000)
  1951. #define GPIO_OTYPER_OT_15 ((uint32_t)0x00008000)
  1952. /****************** Bits definition for GPIO_OSPEEDR register ***************/
  1953. #define GPIO_OSPEEDER_OSPEEDR0 ((uint32_t)0x00000003)
  1954. #define GPIO_OSPEEDER_OSPEEDR0_0 ((uint32_t)0x00000001)
  1955. #define GPIO_OSPEEDER_OSPEEDR0_1 ((uint32_t)0x00000002)
  1956. #define GPIO_OSPEEDER_OSPEEDR1 ((uint32_t)0x0000000C)
  1957. #define GPIO_OSPEEDER_OSPEEDR1_0 ((uint32_t)0x00000004)
  1958. #define GPIO_OSPEEDER_OSPEEDR1_1 ((uint32_t)0x00000008)
  1959. #define GPIO_OSPEEDER_OSPEEDR2 ((uint32_t)0x00000030)
  1960. #define GPIO_OSPEEDER_OSPEEDR2_0 ((uint32_t)0x00000010)
  1961. #define GPIO_OSPEEDER_OSPEEDR2_1 ((uint32_t)0x00000020)
  1962. #define GPIO_OSPEEDER_OSPEEDR3 ((uint32_t)0x000000C0)
  1963. #define GPIO_OSPEEDER_OSPEEDR3_0 ((uint32_t)0x00000040)
  1964. #define GPIO_OSPEEDER_OSPEEDR3_1 ((uint32_t)0x00000080)
  1965. #define GPIO_OSPEEDER_OSPEEDR4 ((uint32_t)0x00000300)
  1966. #define GPIO_OSPEEDER_OSPEEDR4_0 ((uint32_t)0x00000100)
  1967. #define GPIO_OSPEEDER_OSPEEDR4_1 ((uint32_t)0x00000200)
  1968. #define GPIO_OSPEEDER_OSPEEDR5 ((uint32_t)0x00000C00)
  1969. #define GPIO_OSPEEDER_OSPEEDR5_0 ((uint32_t)0x00000400)
  1970. #define GPIO_OSPEEDER_OSPEEDR5_1 ((uint32_t)0x00000800)
  1971. #define GPIO_OSPEEDER_OSPEEDR6 ((uint32_t)0x00003000)
  1972. #define GPIO_OSPEEDER_OSPEEDR6_0 ((uint32_t)0x00001000)
  1973. #define GPIO_OSPEEDER_OSPEEDR6_1 ((uint32_t)0x00002000)
  1974. #define GPIO_OSPEEDER_OSPEEDR7 ((uint32_t)0x0000C000)
  1975. #define GPIO_OSPEEDER_OSPEEDR7_0 ((uint32_t)0x00004000)
  1976. #define GPIO_OSPEEDER_OSPEEDR7_1 ((uint32_t)0x00008000)
  1977. #define GPIO_OSPEEDER_OSPEEDR8 ((uint32_t)0x00030000)
  1978. #define GPIO_OSPEEDER_OSPEEDR8_0 ((uint32_t)0x00010000)
  1979. #define GPIO_OSPEEDER_OSPEEDR8_1 ((uint32_t)0x00020000)
  1980. #define GPIO_OSPEEDER_OSPEEDR9 ((uint32_t)0x000C0000)
  1981. #define GPIO_OSPEEDER_OSPEEDR9_0 ((uint32_t)0x00040000)
  1982. #define GPIO_OSPEEDER_OSPEEDR9_1 ((uint32_t)0x00080000)
  1983. #define GPIO_OSPEEDER_OSPEEDR10 ((uint32_t)0x00300000)
  1984. #define GPIO_OSPEEDER_OSPEEDR10_0 ((uint32_t)0x00100000)
  1985. #define GPIO_OSPEEDER_OSPEEDR10_1 ((uint32_t)0x00200000)
  1986. #define GPIO_OSPEEDER_OSPEEDR11 ((uint32_t)0x00C00000)
  1987. #define GPIO_OSPEEDER_OSPEEDR11_0 ((uint32_t)0x00400000)
  1988. #define GPIO_OSPEEDER_OSPEEDR11_1 ((uint32_t)0x00800000)
  1989. #define GPIO_OSPEEDER_OSPEEDR12 ((uint32_t)0x03000000)
  1990. #define GPIO_OSPEEDER_OSPEEDR12_0 ((uint32_t)0x01000000)
  1991. #define GPIO_OSPEEDER_OSPEEDR12_1 ((uint32_t)0x02000000)
  1992. #define GPIO_OSPEEDER_OSPEEDR13 ((uint32_t)0x0C000000)
  1993. #define GPIO_OSPEEDER_OSPEEDR13_0 ((uint32_t)0x04000000)
  1994. #define GPIO_OSPEEDER_OSPEEDR13_1 ((uint32_t)0x08000000)
  1995. #define GPIO_OSPEEDER_OSPEEDR14 ((uint32_t)0x30000000)
  1996. #define GPIO_OSPEEDER_OSPEEDR14_0 ((uint32_t)0x10000000)
  1997. #define GPIO_OSPEEDER_OSPEEDR14_1 ((uint32_t)0x20000000)
  1998. #define GPIO_OSPEEDER_OSPEEDR15 ((uint32_t)0xC0000000)
  1999. #define GPIO_OSPEEDER_OSPEEDR15_0 ((uint32_t)0x40000000)
  2000. #define GPIO_OSPEEDER_OSPEEDR15_1 ((uint32_t)0x80000000)
  2001. /****************** Bits definition for GPIO_PUPDR register *****************/
  2002. #define GPIO_PUPDR_PUPDR0 ((uint32_t)0x00000003)
  2003. #define GPIO_PUPDR_PUPDR0_0 ((uint32_t)0x00000001)
  2004. #define GPIO_PUPDR_PUPDR0_1 ((uint32_t)0x00000002)
  2005. #define GPIO_PUPDR_PUPDR1 ((uint32_t)0x0000000C)
  2006. #define GPIO_PUPDR_PUPDR1_0 ((uint32_t)0x00000004)
  2007. #define GPIO_PUPDR_PUPDR1_1 ((uint32_t)0x00000008)
  2008. #define GPIO_PUPDR_PUPDR2 ((uint32_t)0x00000030)
  2009. #define GPIO_PUPDR_PUPDR2_0 ((uint32_t)0x00000010)
  2010. #define GPIO_PUPDR_PUPDR2_1 ((uint32_t)0x00000020)
  2011. #define GPIO_PUPDR_PUPDR3 ((uint32_t)0x000000C0)
  2012. #define GPIO_PUPDR_PUPDR3_0 ((uint32_t)0x00000040)
  2013. #define GPIO_PUPDR_PUPDR3_1 ((uint32_t)0x00000080)
  2014. #define GPIO_PUPDR_PUPDR4 ((uint32_t)0x00000300)
  2015. #define GPIO_PUPDR_PUPDR4_0 ((uint32_t)0x00000100)
  2016. #define GPIO_PUPDR_PUPDR4_1 ((uint32_t)0x00000200)
  2017. #define GPIO_PUPDR_PUPDR5 ((uint32_t)0x00000C00)
  2018. #define GPIO_PUPDR_PUPDR5_0 ((uint32_t)0x00000400)
  2019. #define GPIO_PUPDR_PUPDR5_1 ((uint32_t)0x00000800)
  2020. #define GPIO_PUPDR_PUPDR6 ((uint32_t)0x00003000)
  2021. #define GPIO_PUPDR_PUPDR6_0 ((uint32_t)0x00001000)
  2022. #define GPIO_PUPDR_PUPDR6_1 ((uint32_t)0x00002000)
  2023. #define GPIO_PUPDR_PUPDR7 ((uint32_t)0x0000C000)
  2024. #define GPIO_PUPDR_PUPDR7_0 ((uint32_t)0x00004000)
  2025. #define GPIO_PUPDR_PUPDR7_1 ((uint32_t)0x00008000)
  2026. #define GPIO_PUPDR_PUPDR8 ((uint32_t)0x00030000)
  2027. #define GPIO_PUPDR_PUPDR8_0 ((uint32_t)0x00010000)
  2028. #define GPIO_PUPDR_PUPDR8_1 ((uint32_t)0x00020000)
  2029. #define GPIO_PUPDR_PUPDR9 ((uint32_t)0x000C0000)
  2030. #define GPIO_PUPDR_PUPDR9_0 ((uint32_t)0x00040000)
  2031. #define GPIO_PUPDR_PUPDR9_1 ((uint32_t)0x00080000)
  2032. #define GPIO_PUPDR_PUPDR10 ((uint32_t)0x00300000)
  2033. #define GPIO_PUPDR_PUPDR10_0 ((uint32_t)0x00100000)
  2034. #define GPIO_PUPDR_PUPDR10_1 ((uint32_t)0x00200000)
  2035. #define GPIO_PUPDR_PUPDR11 ((uint32_t)0x00C00000)
  2036. #define GPIO_PUPDR_PUPDR11_0 ((uint32_t)0x00400000)
  2037. #define GPIO_PUPDR_PUPDR11_1 ((uint32_t)0x00800000)
  2038. #define GPIO_PUPDR_PUPDR12 ((uint32_t)0x03000000)
  2039. #define GPIO_PUPDR_PUPDR12_0 ((uint32_t)0x01000000)
  2040. #define GPIO_PUPDR_PUPDR12_1 ((uint32_t)0x02000000)
  2041. #define GPIO_PUPDR_PUPDR13 ((uint32_t)0x0C000000)
  2042. #define GPIO_PUPDR_PUPDR13_0 ((uint32_t)0x04000000)
  2043. #define GPIO_PUPDR_PUPDR13_1 ((uint32_t)0x08000000)
  2044. #define GPIO_PUPDR_PUPDR14 ((uint32_t)0x30000000)
  2045. #define GPIO_PUPDR_PUPDR14_0 ((uint32_t)0x10000000)
  2046. #define GPIO_PUPDR_PUPDR14_1 ((uint32_t)0x20000000)
  2047. #define GPIO_PUPDR_PUPDR15 ((uint32_t)0xC0000000)
  2048. #define GPIO_PUPDR_PUPDR15_0 ((uint32_t)0x40000000)
  2049. #define GPIO_PUPDR_PUPDR15_1 ((uint32_t)0x80000000)
  2050. /****************** Bits definition for GPIO_IDR register *******************/
  2051. #define GPIO_IDR_IDR_0 ((uint32_t)0x00000001)
  2052. #define GPIO_IDR_IDR_1 ((uint32_t)0x00000002)
  2053. #define GPIO_IDR_IDR_2 ((uint32_t)0x00000004)
  2054. #define GPIO_IDR_IDR_3 ((uint32_t)0x00000008)
  2055. #define GPIO_IDR_IDR_4 ((uint32_t)0x00000010)
  2056. #define GPIO_IDR_IDR_5 ((uint32_t)0x00000020)
  2057. #define GPIO_IDR_IDR_6 ((uint32_t)0x00000040)
  2058. #define GPIO_IDR_IDR_7 ((uint32_t)0x00000080)
  2059. #define GPIO_IDR_IDR_8 ((uint32_t)0x00000100)
  2060. #define GPIO_IDR_IDR_9 ((uint32_t)0x00000200)
  2061. #define GPIO_IDR_IDR_10 ((uint32_t)0x00000400)
  2062. #define GPIO_IDR_IDR_11 ((uint32_t)0x00000800)
  2063. #define GPIO_IDR_IDR_12 ((uint32_t)0x00001000)
  2064. #define GPIO_IDR_IDR_13 ((uint32_t)0x00002000)
  2065. #define GPIO_IDR_IDR_14 ((uint32_t)0x00004000)
  2066. #define GPIO_IDR_IDR_15 ((uint32_t)0x00008000)
  2067. /****************** Bits definition for GPIO_ODR register *******************/
  2068. #define GPIO_ODR_ODR_0 ((uint32_t)0x00000001)
  2069. #define GPIO_ODR_ODR_1 ((uint32_t)0x00000002)
  2070. #define GPIO_ODR_ODR_2 ((uint32_t)0x00000004)
  2071. #define GPIO_ODR_ODR_3 ((uint32_t)0x00000008)
  2072. #define GPIO_ODR_ODR_4 ((uint32_t)0x00000010)
  2073. #define GPIO_ODR_ODR_5 ((uint32_t)0x00000020)
  2074. #define GPIO_ODR_ODR_6 ((uint32_t)0x00000040)
  2075. #define GPIO_ODR_ODR_7 ((uint32_t)0x00000080)
  2076. #define GPIO_ODR_ODR_8 ((uint32_t)0x00000100)
  2077. #define GPIO_ODR_ODR_9 ((uint32_t)0x00000200)
  2078. #define GPIO_ODR_ODR_10 ((uint32_t)0x00000400)
  2079. #define GPIO_ODR_ODR_11 ((uint32_t)0x00000800)
  2080. #define GPIO_ODR_ODR_12 ((uint32_t)0x00001000)
  2081. #define GPIO_ODR_ODR_13 ((uint32_t)0x00002000)
  2082. #define GPIO_ODR_ODR_14 ((uint32_t)0x00004000)
  2083. #define GPIO_ODR_ODR_15 ((uint32_t)0x00008000)
  2084. /****************** Bits definition for GPIO_BSRR register ******************/
  2085. #define GPIO_BSRR_BS_0 ((uint32_t)0x00000001)
  2086. #define GPIO_BSRR_BS_1 ((uint32_t)0x00000002)
  2087. #define GPIO_BSRR_BS_2 ((uint32_t)0x00000004)
  2088. #define GPIO_BSRR_BS_3 ((uint32_t)0x00000008)
  2089. #define GPIO_BSRR_BS_4 ((uint32_t)0x00000010)
  2090. #define GPIO_BSRR_BS_5 ((uint32_t)0x00000020)
  2091. #define GPIO_BSRR_BS_6 ((uint32_t)0x00000040)
  2092. #define GPIO_BSRR_BS_7 ((uint32_t)0x00000080)
  2093. #define GPIO_BSRR_BS_8 ((uint32_t)0x00000100)
  2094. #define GPIO_BSRR_BS_9 ((uint32_t)0x00000200)
  2095. #define GPIO_BSRR_BS_10 ((uint32_t)0x00000400)
  2096. #define GPIO_BSRR_BS_11 ((uint32_t)0x00000800)
  2097. #define GPIO_BSRR_BS_12 ((uint32_t)0x00001000)
  2098. #define GPIO_BSRR_BS_13 ((uint32_t)0x00002000)
  2099. #define GPIO_BSRR_BS_14 ((uint32_t)0x00004000)
  2100. #define GPIO_BSRR_BS_15 ((uint32_t)0x00008000)
  2101. #define GPIO_BSRR_BR_0 ((uint32_t)0x00010000)
  2102. #define GPIO_BSRR_BR_1 ((uint32_t)0x00020000)
  2103. #define GPIO_BSRR_BR_2 ((uint32_t)0x00040000)
  2104. #define GPIO_BSRR_BR_3 ((uint32_t)0x00080000)
  2105. #define GPIO_BSRR_BR_4 ((uint32_t)0x00100000)
  2106. #define GPIO_BSRR_BR_5 ((uint32_t)0x00200000)
  2107. #define GPIO_BSRR_BR_6 ((uint32_t)0x00400000)
  2108. #define GPIO_BSRR_BR_7 ((uint32_t)0x00800000)
  2109. #define GPIO_BSRR_BR_8 ((uint32_t)0x01000000)
  2110. #define GPIO_BSRR_BR_9 ((uint32_t)0x02000000)
  2111. #define GPIO_BSRR_BR_10 ((uint32_t)0x04000000)
  2112. #define GPIO_BSRR_BR_11 ((uint32_t)0x08000000)
  2113. #define GPIO_BSRR_BR_12 ((uint32_t)0x10000000)
  2114. #define GPIO_BSRR_BR_13 ((uint32_t)0x20000000)
  2115. #define GPIO_BSRR_BR_14 ((uint32_t)0x40000000)
  2116. #define GPIO_BSRR_BR_15 ((uint32_t)0x80000000)
  2117. /****************** Bit definition for GPIO_LCKR register ********************/
  2118. #define GPIO_LCKR_LCK0 ((uint32_t)0x00000001)
  2119. #define GPIO_LCKR_LCK1 ((uint32_t)0x00000002)
  2120. #define GPIO_LCKR_LCK2 ((uint32_t)0x00000004)
  2121. #define GPIO_LCKR_LCK3 ((uint32_t)0x00000008)
  2122. #define GPIO_LCKR_LCK4 ((uint32_t)0x00000010)
  2123. #define GPIO_LCKR_LCK5 ((uint32_t)0x00000020)
  2124. #define GPIO_LCKR_LCK6 ((uint32_t)0x00000040)
  2125. #define GPIO_LCKR_LCK7 ((uint32_t)0x00000080)
  2126. #define GPIO_LCKR_LCK8 ((uint32_t)0x00000100)
  2127. #define GPIO_LCKR_LCK9 ((uint32_t)0x00000200)
  2128. #define GPIO_LCKR_LCK10 ((uint32_t)0x00000400)
  2129. #define GPIO_LCKR_LCK11 ((uint32_t)0x00000800)
  2130. #define GPIO_LCKR_LCK12 ((uint32_t)0x00001000)
  2131. #define GPIO_LCKR_LCK13 ((uint32_t)0x00002000)
  2132. #define GPIO_LCKR_LCK14 ((uint32_t)0x00004000)
  2133. #define GPIO_LCKR_LCK15 ((uint32_t)0x00008000)
  2134. #define GPIO_LCKR_LCKK ((uint32_t)0x00010000)
  2135. /****************** Bit definition for GPIO_AFRL register ********************/
  2136. #define GPIO_AFRL_AFRL0 ((uint32_t)0x0000000F)
  2137. #define GPIO_AFRL_AFRL1 ((uint32_t)0x000000F0)
  2138. #define GPIO_AFRL_AFRL2 ((uint32_t)0x00000F00)
  2139. #define GPIO_AFRL_AFRL3 ((uint32_t)0x0000F000)
  2140. #define GPIO_AFRL_AFRL4 ((uint32_t)0x000F0000)
  2141. #define GPIO_AFRL_AFRL5 ((uint32_t)0x00F00000)
  2142. #define GPIO_AFRL_AFRL6 ((uint32_t)0x0F000000)
  2143. #define GPIO_AFRL_AFRL7 ((uint32_t)0xF0000000)
  2144. /****************** Bit definition for GPIO_AFRH register ********************/
  2145. #define GPIO_AFRH_AFRH0 ((uint32_t)0x0000000F)
  2146. #define GPIO_AFRH_AFRH1 ((uint32_t)0x000000F0)
  2147. #define GPIO_AFRH_AFRH2 ((uint32_t)0x00000F00)
  2148. #define GPIO_AFRH_AFRH3 ((uint32_t)0x0000F000)
  2149. #define GPIO_AFRH_AFRH4 ((uint32_t)0x000F0000)
  2150. #define GPIO_AFRH_AFRH5 ((uint32_t)0x00F00000)
  2151. #define GPIO_AFRH_AFRH6 ((uint32_t)0x0F000000)
  2152. #define GPIO_AFRH_AFRH7 ((uint32_t)0xF0000000)
  2153. /****************** Bit definition for GPIO_BRR register *********************/
  2154. #define GPIO_BRR_BR_0 ((uint32_t)0x00000001)
  2155. #define GPIO_BRR_BR_1 ((uint32_t)0x00000002)
  2156. #define GPIO_BRR_BR_2 ((uint32_t)0x00000004)
  2157. #define GPIO_BRR_BR_3 ((uint32_t)0x00000008)
  2158. #define GPIO_BRR_BR_4 ((uint32_t)0x00000010)
  2159. #define GPIO_BRR_BR_5 ((uint32_t)0x00000020)
  2160. #define GPIO_BRR_BR_6 ((uint32_t)0x00000040)
  2161. #define GPIO_BRR_BR_7 ((uint32_t)0x00000080)
  2162. #define GPIO_BRR_BR_8 ((uint32_t)0x00000100)
  2163. #define GPIO_BRR_BR_9 ((uint32_t)0x00000200)
  2164. #define GPIO_BRR_BR_10 ((uint32_t)0x00000400)
  2165. #define GPIO_BRR_BR_11 ((uint32_t)0x00000800)
  2166. #define GPIO_BRR_BR_12 ((uint32_t)0x00001000)
  2167. #define GPIO_BRR_BR_13 ((uint32_t)0x00002000)
  2168. #define GPIO_BRR_BR_14 ((uint32_t)0x00004000)
  2169. #define GPIO_BRR_BR_15 ((uint32_t)0x00008000)
  2170. /******************************************************************************/
  2171. /* */
  2172. /* Inter-integrated Circuit Interface (I2C) */
  2173. /* */
  2174. /******************************************************************************/
  2175. /******************* Bit definition for I2C_CR1 register ********************/
  2176. #define I2C_CR1_PE ((uint32_t)0x00000001) /*!< Peripheral Enable */
  2177. #define I2C_CR1_SMBUS ((uint32_t)0x00000002) /*!< SMBus Mode */
  2178. #define I2C_CR1_SMBTYPE ((uint32_t)0x00000008) /*!< SMBus Type */
  2179. #define I2C_CR1_ENARP ((uint32_t)0x00000010) /*!< ARP Enable */
  2180. #define I2C_CR1_ENPEC ((uint32_t)0x00000020) /*!< PEC Enable */
  2181. #define I2C_CR1_ENGC ((uint32_t)0x00000040) /*!< General Call Enable */
  2182. #define I2C_CR1_NOSTRETCH ((uint32_t)0x00000080) /*!< Clock Stretching Disable (Slave mode) */
  2183. #define I2C_CR1_START ((uint32_t)0x00000100) /*!< Start Generation */
  2184. #define I2C_CR1_STOP ((uint32_t)0x00000200) /*!< Stop Generation */
  2185. #define I2C_CR1_ACK ((uint32_t)0x00000400) /*!< Acknowledge Enable */
  2186. #define I2C_CR1_POS ((uint32_t)0x00000800) /*!< Acknowledge/PEC Position (for data reception) */
  2187. #define I2C_CR1_PEC ((uint32_t)0x00001000) /*!< Packet Error Checking */
  2188. #define I2C_CR1_ALERT ((uint32_t)0x00002000) /*!< SMBus Alert */
  2189. #define I2C_CR1_SWRST ((uint32_t)0x00008000) /*!< Software Reset */
  2190. /******************* Bit definition for I2C_CR2 register ********************/
  2191. #define I2C_CR2_FREQ ((uint32_t)0x0000003F) /*!< FREQ[5:0] bits (Peripheral Clock Frequency) */
  2192. #define I2C_CR2_FREQ_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  2193. #define I2C_CR2_FREQ_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  2194. #define I2C_CR2_FREQ_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  2195. #define I2C_CR2_FREQ_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  2196. #define I2C_CR2_FREQ_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  2197. #define I2C_CR2_FREQ_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  2198. #define I2C_CR2_ITERREN ((uint32_t)0x00000100) /*!< Error Interrupt Enable */
  2199. #define I2C_CR2_ITEVTEN ((uint32_t)0x00000200) /*!< Event Interrupt Enable */
  2200. #define I2C_CR2_ITBUFEN ((uint32_t)0x00000400) /*!< Buffer Interrupt Enable */
  2201. #define I2C_CR2_DMAEN ((uint32_t)0x00000800) /*!< DMA Requests Enable */
  2202. #define I2C_CR2_LAST ((uint32_t)0x00001000) /*!< DMA Last Transfer */
  2203. /******************* Bit definition for I2C_OAR1 register *******************/
  2204. #define I2C_OAR1_ADD1_7 ((uint32_t)0x000000FE) /*!< Interface Address */
  2205. #define I2C_OAR1_ADD8_9 ((uint32_t)0x00000300) /*!< Interface Address */
  2206. #define I2C_OAR1_ADD0 ((uint32_t)0x00000001) /*!< Bit 0 */
  2207. #define I2C_OAR1_ADD1 ((uint32_t)0x00000002) /*!< Bit 1 */
  2208. #define I2C_OAR1_ADD2 ((uint32_t)0x00000004) /*!< Bit 2 */
  2209. #define I2C_OAR1_ADD3 ((uint32_t)0x00000008) /*!< Bit 3 */
  2210. #define I2C_OAR1_ADD4 ((uint32_t)0x00000010) /*!< Bit 4 */
  2211. #define I2C_OAR1_ADD5 ((uint32_t)0x00000020) /*!< Bit 5 */
  2212. #define I2C_OAR1_ADD6 ((uint32_t)0x00000040) /*!< Bit 6 */
  2213. #define I2C_OAR1_ADD7 ((uint32_t)0x00000080) /*!< Bit 7 */
  2214. #define I2C_OAR1_ADD8 ((uint32_t)0x00000100) /*!< Bit 8 */
  2215. #define I2C_OAR1_ADD9 ((uint32_t)0x00000200) /*!< Bit 9 */
  2216. #define I2C_OAR1_ADDMODE ((uint32_t)0x00008000) /*!< Addressing Mode (Slave mode) */
  2217. /******************* Bit definition for I2C_OAR2 register *******************/
  2218. #define I2C_OAR2_ENDUAL ((uint32_t)0x00000001) /*!< Dual addressing mode enable */
  2219. #define I2C_OAR2_ADD2 ((uint32_t)0x000000FE) /*!< Interface address */
  2220. /******************** Bit definition for I2C_DR register ********************/
  2221. #define I2C_DR_DR ((uint32_t)0x000000FF) /*!< 8-bit Data Register */
  2222. /******************* Bit definition for I2C_SR1 register ********************/
  2223. #define I2C_SR1_SB ((uint32_t)0x00000001) /*!< Start Bit (Master mode) */
  2224. #define I2C_SR1_ADDR ((uint32_t)0x00000002) /*!< Address sent (master mode)/matched (slave mode) */
  2225. #define I2C_SR1_BTF ((uint32_t)0x00000004) /*!< Byte Transfer Finished */
  2226. #define I2C_SR1_ADD10 ((uint32_t)0x00000008) /*!< 10-bit header sent (Master mode) */
  2227. #define I2C_SR1_STOPF ((uint32_t)0x00000010) /*!< Stop detection (Slave mode) */
  2228. #define I2C_SR1_RXNE ((uint32_t)0x00000040) /*!< Data Register not Empty (receivers) */
  2229. #define I2C_SR1_TXE ((uint32_t)0x00000080) /*!< Data Register Empty (transmitters) */
  2230. #define I2C_SR1_BERR ((uint32_t)0x00000100) /*!< Bus Error */
  2231. #define I2C_SR1_ARLO ((uint32_t)0x00000200) /*!< Arbitration Lost (master mode) */
  2232. #define I2C_SR1_AF ((uint32_t)0x00000400) /*!< Acknowledge Failure */
  2233. #define I2C_SR1_OVR ((uint32_t)0x00000800) /*!< Overrun/Underrun */
  2234. #define I2C_SR1_PECERR ((uint32_t)0x00001000) /*!< PEC Error in reception */
  2235. #define I2C_SR1_TIMEOUT ((uint32_t)0x00004000) /*!< Timeout or Tlow Error */
  2236. #define I2C_SR1_SMBALERT ((uint32_t)0x00008000) /*!< SMBus Alert */
  2237. /******************* Bit definition for I2C_SR2 register ********************/
  2238. #define I2C_SR2_MSL ((uint32_t)0x00000001) /*!< Master/Slave */
  2239. #define I2C_SR2_BUSY ((uint32_t)0x00000002) /*!< Bus Busy */
  2240. #define I2C_SR2_TRA ((uint32_t)0x00000004) /*!< Transmitter/Receiver */
  2241. #define I2C_SR2_GENCALL ((uint32_t)0x00000010) /*!< General Call Address (Slave mode) */
  2242. #define I2C_SR2_SMBDEFAULT ((uint32_t)0x00000020) /*!< SMBus Device Default Address (Slave mode) */
  2243. #define I2C_SR2_SMBHOST ((uint32_t)0x00000040) /*!< SMBus Host Header (Slave mode) */
  2244. #define I2C_SR2_DUALF ((uint32_t)0x00000080) /*!< Dual Flag (Slave mode) */
  2245. #define I2C_SR2_PEC ((uint32_t)0x0000FF00) /*!< Packet Error Checking Register */
  2246. /******************* Bit definition for I2C_CCR register ********************/
  2247. #define I2C_CCR_CCR ((uint32_t)0x00000FFF) /*!< Clock Control Register in Fast/Standard mode (Master mode) */
  2248. #define I2C_CCR_DUTY ((uint32_t)0x00004000) /*!< Fast Mode Duty Cycle */
  2249. #define I2C_CCR_FS ((uint32_t)0x00008000) /*!< I2C Master Mode Selection */
  2250. /****************** Bit definition for I2C_TRISE register *******************/
  2251. #define I2C_TRISE_TRISE ((uint32_t)0x0000003F) /*!< Maximum Rise Time in Fast/Standard mode (Master mode) */
  2252. /******************************************************************************/
  2253. /* */
  2254. /* Independent WATCHDOG (IWDG) */
  2255. /* */
  2256. /******************************************************************************/
  2257. /******************* Bit definition for IWDG_KR register ********************/
  2258. #define IWDG_KR_KEY ((uint32_t)0x0000FFFF) /*!< Key value (write only, read 0000h) */
  2259. /******************* Bit definition for IWDG_PR register ********************/
  2260. #define IWDG_PR_PR ((uint32_t)0x00000007) /*!< PR[2:0] (Prescaler divider) */
  2261. #define IWDG_PR_PR_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  2262. #define IWDG_PR_PR_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  2263. #define IWDG_PR_PR_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  2264. /******************* Bit definition for IWDG_RLR register *******************/
  2265. #define IWDG_RLR_RL ((uint32_t)0x00000FFF) /*!< Watchdog counter reload value */
  2266. /******************* Bit definition for IWDG_SR register ********************/
  2267. #define IWDG_SR_PVU ((uint32_t)0x00000001) /*!< Watchdog prescaler value update */
  2268. #define IWDG_SR_RVU ((uint32_t)0x00000002) /*!< Watchdog counter reload value update */
  2269. /******************************************************************************/
  2270. /* */
  2271. /* LCD Controller (LCD) */
  2272. /* */
  2273. /******************************************************************************/
  2274. /******************* Bit definition for LCD_CR register *********************/
  2275. #define LCD_CR_LCDEN ((uint32_t)0x00000001) /*!< LCD Enable Bit */
  2276. #define LCD_CR_VSEL ((uint32_t)0x00000002) /*!< Voltage source selector Bit */
  2277. #define LCD_CR_DUTY ((uint32_t)0x0000001C) /*!< DUTY[2:0] bits (Duty selector) */
  2278. #define LCD_CR_DUTY_0 ((uint32_t)0x00000004) /*!< Duty selector Bit 0 */
  2279. #define LCD_CR_DUTY_1 ((uint32_t)0x00000008) /*!< Duty selector Bit 1 */
  2280. #define LCD_CR_DUTY_2 ((uint32_t)0x00000010) /*!< Duty selector Bit 2 */
  2281. #define LCD_CR_BIAS ((uint32_t)0x00000060) /*!< BIAS[1:0] bits (Bias selector) */
  2282. #define LCD_CR_BIAS_0 ((uint32_t)0x00000020) /*!< Bias selector Bit 0 */
  2283. #define LCD_CR_BIAS_1 ((uint32_t)0x00000040) /*!< Bias selector Bit 1 */
  2284. #define LCD_CR_MUX_SEG ((uint32_t)0x00000080) /*!< Mux Segment Enable Bit */
  2285. /******************* Bit definition for LCD_FCR register ********************/
  2286. #define LCD_FCR_HD ((uint32_t)0x00000001) /*!< High Drive Enable Bit */
  2287. #define LCD_FCR_SOFIE ((uint32_t)0x00000002) /*!< Start of Frame Interrupt Enable Bit */
  2288. #define LCD_FCR_UDDIE ((uint32_t)0x00000008) /*!< Update Display Done Interrupt Enable Bit */
  2289. #define LCD_FCR_PON ((uint32_t)0x00000070) /*!< PON[2:0] bits (Puls ON Duration) */
  2290. #define LCD_FCR_PON_0 ((uint32_t)0x00000010) /*!< Bit 0 */
  2291. #define LCD_FCR_PON_1 ((uint32_t)0x00000020) /*!< Bit 1 */
  2292. #define LCD_FCR_PON_2 ((uint32_t)0x00000040) /*!< Bit 2 */
  2293. #define LCD_FCR_DEAD ((uint32_t)0x00000380) /*!< DEAD[2:0] bits (DEAD Time) */
  2294. #define LCD_FCR_DEAD_0 ((uint32_t)0x00000080) /*!< Bit 0 */
  2295. #define LCD_FCR_DEAD_1 ((uint32_t)0x00000100) /*!< Bit 1 */
  2296. #define LCD_FCR_DEAD_2 ((uint32_t)0x00000200) /*!< Bit 2 */
  2297. #define LCD_FCR_CC ((uint32_t)0x00001C00) /*!< CC[2:0] bits (Contrast Control) */
  2298. #define LCD_FCR_CC_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  2299. #define LCD_FCR_CC_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  2300. #define LCD_FCR_CC_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  2301. #define LCD_FCR_BLINKF ((uint32_t)0x0000E000) /*!< BLINKF[2:0] bits (Blink Frequency) */
  2302. #define LCD_FCR_BLINKF_0 ((uint32_t)0x00002000) /*!< Bit 0 */
  2303. #define LCD_FCR_BLINKF_1 ((uint32_t)0x00004000) /*!< Bit 1 */
  2304. #define LCD_FCR_BLINKF_2 ((uint32_t)0x00008000) /*!< Bit 2 */
  2305. #define LCD_FCR_BLINK ((uint32_t)0x00030000) /*!< BLINK[1:0] bits (Blink Enable) */
  2306. #define LCD_FCR_BLINK_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  2307. #define LCD_FCR_BLINK_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  2308. #define LCD_FCR_DIV ((uint32_t)0x003C0000) /*!< DIV[3:0] bits (Divider) */
  2309. #define LCD_FCR_PS ((uint32_t)0x03C00000) /*!< PS[3:0] bits (Prescaler) */
  2310. /******************* Bit definition for LCD_SR register *********************/
  2311. #define LCD_SR_ENS ((uint32_t)0x00000001) /*!< LCD Enabled Bit */
  2312. #define LCD_SR_SOF ((uint32_t)0x00000002) /*!< Start Of Frame Flag Bit */
  2313. #define LCD_SR_UDR ((uint32_t)0x00000004) /*!< Update Display Request Bit */
  2314. #define LCD_SR_UDD ((uint32_t)0x00000008) /*!< Update Display Done Flag Bit */
  2315. #define LCD_SR_RDY ((uint32_t)0x00000010) /*!< Ready Flag Bit */
  2316. #define LCD_SR_FCRSR ((uint32_t)0x00000020) /*!< LCD FCR Register Synchronization Flag Bit */
  2317. /******************* Bit definition for LCD_CLR register ********************/
  2318. #define LCD_CLR_SOFC ((uint32_t)0x00000002) /*!< Start Of Frame Flag Clear Bit */
  2319. #define LCD_CLR_UDDC ((uint32_t)0x00000008) /*!< Update Display Done Flag Clear Bit */
  2320. /******************* Bit definition for LCD_RAM register ********************/
  2321. #define LCD_RAM_SEGMENT_DATA ((uint32_t)0xFFFFFFFF) /*!< Segment Data Bits */
  2322. /******************************************************************************/
  2323. /* */
  2324. /* Power Control (PWR) */
  2325. /* */
  2326. /******************************************************************************/
  2327. /******************** Bit definition for PWR_CR register ********************/
  2328. #define PWR_CR_LPSDSR ((uint32_t)0x00000001) /*!< Low-power deepsleep/sleep/low power run */
  2329. #define PWR_CR_PDDS ((uint32_t)0x00000002) /*!< Power Down Deepsleep */
  2330. #define PWR_CR_CWUF ((uint32_t)0x00000004) /*!< Clear Wakeup Flag */
  2331. #define PWR_CR_CSBF ((uint32_t)0x00000008) /*!< Clear Standby Flag */
  2332. #define PWR_CR_PVDE ((uint32_t)0x00000010) /*!< Power Voltage Detector Enable */
  2333. #define PWR_CR_PLS ((uint32_t)0x000000E0) /*!< PLS[2:0] bits (PVD Level Selection) */
  2334. #define PWR_CR_PLS_0 ((uint32_t)0x00000020) /*!< Bit 0 */
  2335. #define PWR_CR_PLS_1 ((uint32_t)0x00000040) /*!< Bit 1 */
  2336. #define PWR_CR_PLS_2 ((uint32_t)0x00000080) /*!< Bit 2 */
  2337. /*!< PVD level configuration */
  2338. #define PWR_CR_PLS_LEV0 ((uint32_t)0x00000000) /*!< PVD level 0 */
  2339. #define PWR_CR_PLS_LEV1 ((uint32_t)0x00000020) /*!< PVD level 1 */
  2340. #define PWR_CR_PLS_LEV2 ((uint32_t)0x00000040) /*!< PVD level 2 */
  2341. #define PWR_CR_PLS_LEV3 ((uint32_t)0x00000060) /*!< PVD level 3 */
  2342. #define PWR_CR_PLS_LEV4 ((uint32_t)0x00000080) /*!< PVD level 4 */
  2343. #define PWR_CR_PLS_LEV5 ((uint32_t)0x000000A0) /*!< PVD level 5 */
  2344. #define PWR_CR_PLS_LEV6 ((uint32_t)0x000000C0) /*!< PVD level 6 */
  2345. #define PWR_CR_PLS_LEV7 ((uint32_t)0x000000E0) /*!< PVD level 7 */
  2346. #define PWR_CR_DBP ((uint32_t)0x00000100) /*!< Disable Backup Domain write protection */
  2347. #define PWR_CR_ULP ((uint32_t)0x00000200) /*!< Ultra Low Power mode */
  2348. #define PWR_CR_FWU ((uint32_t)0x00000400) /*!< Fast wakeup */
  2349. #define PWR_CR_VOS ((uint32_t)0x00001800) /*!< VOS[1:0] bits (Voltage scaling range selection) */
  2350. #define PWR_CR_VOS_0 ((uint32_t)0x00000800) /*!< Bit 0 */
  2351. #define PWR_CR_VOS_1 ((uint32_t)0x00001000) /*!< Bit 1 */
  2352. #define PWR_CR_LPRUN ((uint32_t)0x00004000) /*!< Low power run mode */
  2353. /******************* Bit definition for PWR_CSR register ********************/
  2354. #define PWR_CSR_WUF ((uint32_t)0x00000001) /*!< Wakeup Flag */
  2355. #define PWR_CSR_SBF ((uint32_t)0x00000002) /*!< Standby Flag */
  2356. #define PWR_CSR_PVDO ((uint32_t)0x00000004) /*!< PVD Output */
  2357. #define PWR_CSR_VREFINTRDYF ((uint32_t)0x00000008) /*!< Internal voltage reference (VREFINT) ready flag */
  2358. #define PWR_CSR_VOSF ((uint32_t)0x00000010) /*!< Voltage Scaling select flag */
  2359. #define PWR_CSR_REGLPF ((uint32_t)0x00000020) /*!< Regulator LP flag */
  2360. #define PWR_CSR_EWUP1 ((uint32_t)0x00000100) /*!< Enable WKUP pin 1 */
  2361. #define PWR_CSR_EWUP2 ((uint32_t)0x00000200) /*!< Enable WKUP pin 2 */
  2362. #define PWR_CSR_EWUP3 ((uint32_t)0x00000400) /*!< Enable WKUP pin 3 */
  2363. /******************************************************************************/
  2364. /* */
  2365. /* Reset and Clock Control (RCC) */
  2366. /* */
  2367. /******************************************************************************/
  2368. /******************** Bit definition for RCC_CR register ********************/
  2369. #define RCC_CR_HSION ((uint32_t)0x00000001) /*!< Internal High Speed clock enable */
  2370. #define RCC_CR_HSIRDY ((uint32_t)0x00000002) /*!< Internal High Speed clock ready flag */
  2371. #define RCC_CR_MSION ((uint32_t)0x00000100) /*!< Internal Multi Speed clock enable */
  2372. #define RCC_CR_MSIRDY ((uint32_t)0x00000200) /*!< Internal Multi Speed clock ready flag */
  2373. #define RCC_CR_HSEON ((uint32_t)0x00010000) /*!< External High Speed clock enable */
  2374. #define RCC_CR_HSERDY ((uint32_t)0x00020000) /*!< External High Speed clock ready flag */
  2375. #define RCC_CR_HSEBYP ((uint32_t)0x00040000) /*!< External High Speed clock Bypass */
  2376. #define RCC_CR_PLLON ((uint32_t)0x01000000) /*!< PLL enable */
  2377. #define RCC_CR_PLLRDY ((uint32_t)0x02000000) /*!< PLL clock ready flag */
  2378. #define RCC_CR_CSSON ((uint32_t)0x10000000) /*!< Clock Security System enable */
  2379. #define RCC_CR_RTCPRE ((uint32_t)0x60000000) /*!< RTC/LCD Prescaler */
  2380. #define RCC_CR_RTCPRE_0 ((uint32_t)0x20000000) /*!< Bit0 */
  2381. #define RCC_CR_RTCPRE_1 ((uint32_t)0x40000000) /*!< Bit1 */
  2382. /******************** Bit definition for RCC_ICSCR register *****************/
  2383. #define RCC_ICSCR_HSICAL ((uint32_t)0x000000FF) /*!< Internal High Speed clock Calibration */
  2384. #define RCC_ICSCR_HSITRIM ((uint32_t)0x00001F00) /*!< Internal High Speed clock trimming */
  2385. #define RCC_ICSCR_MSIRANGE ((uint32_t)0x0000E000) /*!< Internal Multi Speed clock Range */
  2386. #define RCC_ICSCR_MSIRANGE_0 ((uint32_t)0x00000000) /*!< Internal Multi Speed clock Range 65.536 KHz */
  2387. #define RCC_ICSCR_MSIRANGE_1 ((uint32_t)0x00002000) /*!< Internal Multi Speed clock Range 131.072 KHz */
  2388. #define RCC_ICSCR_MSIRANGE_2 ((uint32_t)0x00004000) /*!< Internal Multi Speed clock Range 262.144 KHz */
  2389. #define RCC_ICSCR_MSIRANGE_3 ((uint32_t)0x00006000) /*!< Internal Multi Speed clock Range 524.288 KHz */
  2390. #define RCC_ICSCR_MSIRANGE_4 ((uint32_t)0x00008000) /*!< Internal Multi Speed clock Range 1.048 MHz */
  2391. #define RCC_ICSCR_MSIRANGE_5 ((uint32_t)0x0000A000) /*!< Internal Multi Speed clock Range 2.097 MHz */
  2392. #define RCC_ICSCR_MSIRANGE_6 ((uint32_t)0x0000C000) /*!< Internal Multi Speed clock Range 4.194 MHz */
  2393. #define RCC_ICSCR_MSICAL ((uint32_t)0x00FF0000) /*!< Internal Multi Speed clock Calibration */
  2394. #define RCC_ICSCR_MSITRIM ((uint32_t)0xFF000000) /*!< Internal Multi Speed clock trimming */
  2395. /******************** Bit definition for RCC_CFGR register ******************/
  2396. #define RCC_CFGR_SW ((uint32_t)0x00000003) /*!< SW[1:0] bits (System clock Switch) */
  2397. #define RCC_CFGR_SW_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  2398. #define RCC_CFGR_SW_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  2399. /*!< SW configuration */
  2400. #define RCC_CFGR_SW_MSI ((uint32_t)0x00000000) /*!< MSI selected as system clock */
  2401. #define RCC_CFGR_SW_HSI ((uint32_t)0x00000001) /*!< HSI selected as system clock */
  2402. #define RCC_CFGR_SW_HSE ((uint32_t)0x00000002) /*!< HSE selected as system clock */
  2403. #define RCC_CFGR_SW_PLL ((uint32_t)0x00000003) /*!< PLL selected as system clock */
  2404. #define RCC_CFGR_SWS ((uint32_t)0x0000000C) /*!< SWS[1:0] bits (System Clock Switch Status) */
  2405. #define RCC_CFGR_SWS_0 ((uint32_t)0x00000004) /*!< Bit 0 */
  2406. #define RCC_CFGR_SWS_1 ((uint32_t)0x00000008) /*!< Bit 1 */
  2407. /*!< SWS configuration */
  2408. #define RCC_CFGR_SWS_MSI ((uint32_t)0x00000000) /*!< MSI oscillator used as system clock */
  2409. #define RCC_CFGR_SWS_HSI ((uint32_t)0x00000004) /*!< HSI oscillator used as system clock */
  2410. #define RCC_CFGR_SWS_HSE ((uint32_t)0x00000008) /*!< HSE oscillator used as system clock */
  2411. #define RCC_CFGR_SWS_PLL ((uint32_t)0x0000000C) /*!< PLL used as system clock */
  2412. #define RCC_CFGR_HPRE ((uint32_t)0x000000F0) /*!< HPRE[3:0] bits (AHB prescaler) */
  2413. #define RCC_CFGR_HPRE_0 ((uint32_t)0x00000010) /*!< Bit 0 */
  2414. #define RCC_CFGR_HPRE_1 ((uint32_t)0x00000020) /*!< Bit 1 */
  2415. #define RCC_CFGR_HPRE_2 ((uint32_t)0x00000040) /*!< Bit 2 */
  2416. #define RCC_CFGR_HPRE_3 ((uint32_t)0x00000080) /*!< Bit 3 */
  2417. /*!< HPRE configuration */
  2418. #define RCC_CFGR_HPRE_DIV1 ((uint32_t)0x00000000) /*!< SYSCLK not divided */
  2419. #define RCC_CFGR_HPRE_DIV2 ((uint32_t)0x00000080) /*!< SYSCLK divided by 2 */
  2420. #define RCC_CFGR_HPRE_DIV4 ((uint32_t)0x00000090) /*!< SYSCLK divided by 4 */
  2421. #define RCC_CFGR_HPRE_DIV8 ((uint32_t)0x000000A0) /*!< SYSCLK divided by 8 */
  2422. #define RCC_CFGR_HPRE_DIV16 ((uint32_t)0x000000B0) /*!< SYSCLK divided by 16 */
  2423. #define RCC_CFGR_HPRE_DIV64 ((uint32_t)0x000000C0) /*!< SYSCLK divided by 64 */
  2424. #define RCC_CFGR_HPRE_DIV128 ((uint32_t)0x000000D0) /*!< SYSCLK divided by 128 */
  2425. #define RCC_CFGR_HPRE_DIV256 ((uint32_t)0x000000E0) /*!< SYSCLK divided by 256 */
  2426. #define RCC_CFGR_HPRE_DIV512 ((uint32_t)0x000000F0) /*!< SYSCLK divided by 512 */
  2427. #define RCC_CFGR_PPRE1 ((uint32_t)0x00000700) /*!< PRE1[2:0] bits (APB1 prescaler) */
  2428. #define RCC_CFGR_PPRE1_0 ((uint32_t)0x00000100) /*!< Bit 0 */
  2429. #define RCC_CFGR_PPRE1_1 ((uint32_t)0x00000200) /*!< Bit 1 */
  2430. #define RCC_CFGR_PPRE1_2 ((uint32_t)0x00000400) /*!< Bit 2 */
  2431. /*!< PPRE1 configuration */
  2432. #define RCC_CFGR_PPRE1_DIV1 ((uint32_t)0x00000000) /*!< HCLK not divided */
  2433. #define RCC_CFGR_PPRE1_DIV2 ((uint32_t)0x00000400) /*!< HCLK divided by 2 */
  2434. #define RCC_CFGR_PPRE1_DIV4 ((uint32_t)0x00000500) /*!< HCLK divided by 4 */
  2435. #define RCC_CFGR_PPRE1_DIV8 ((uint32_t)0x00000600) /*!< HCLK divided by 8 */
  2436. #define RCC_CFGR_PPRE1_DIV16 ((uint32_t)0x00000700) /*!< HCLK divided by 16 */
  2437. #define RCC_CFGR_PPRE2 ((uint32_t)0x00003800) /*!< PRE2[2:0] bits (APB2 prescaler) */
  2438. #define RCC_CFGR_PPRE2_0 ((uint32_t)0x00000800) /*!< Bit 0 */
  2439. #define RCC_CFGR_PPRE2_1 ((uint32_t)0x00001000) /*!< Bit 1 */
  2440. #define RCC_CFGR_PPRE2_2 ((uint32_t)0x00002000) /*!< Bit 2 */
  2441. /*!< PPRE2 configuration */
  2442. #define RCC_CFGR_PPRE2_DIV1 ((uint32_t)0x00000000) /*!< HCLK not divided */
  2443. #define RCC_CFGR_PPRE2_DIV2 ((uint32_t)0x00002000) /*!< HCLK divided by 2 */
  2444. #define RCC_CFGR_PPRE2_DIV4 ((uint32_t)0x00002800) /*!< HCLK divided by 4 */
  2445. #define RCC_CFGR_PPRE2_DIV8 ((uint32_t)0x00003000) /*!< HCLK divided by 8 */
  2446. #define RCC_CFGR_PPRE2_DIV16 ((uint32_t)0x00003800) /*!< HCLK divided by 16 */
  2447. /*!< PLL entry clock source*/
  2448. #define RCC_CFGR_PLLSRC ((uint32_t)0x00010000) /*!< PLL entry clock source */
  2449. #define RCC_CFGR_PLLSRC_HSI ((uint32_t)0x00000000) /*!< HSI as PLL entry clock source */
  2450. #define RCC_CFGR_PLLSRC_HSE ((uint32_t)0x00010000) /*!< HSE as PLL entry clock source */
  2451. /*!< PLLMUL configuration */
  2452. #define RCC_CFGR_PLLMUL ((uint32_t)0x003C0000) /*!< PLLMUL[3:0] bits (PLL multiplication factor) */
  2453. #define RCC_CFGR_PLLMUL_0 ((uint32_t)0x00040000) /*!< Bit 0 */
  2454. #define RCC_CFGR_PLLMUL_1 ((uint32_t)0x00080000) /*!< Bit 1 */
  2455. #define RCC_CFGR_PLLMUL_2 ((uint32_t)0x00100000) /*!< Bit 2 */
  2456. #define RCC_CFGR_PLLMUL_3 ((uint32_t)0x00200000) /*!< Bit 3 */
  2457. /*!< PLLMUL configuration */
  2458. #define RCC_CFGR_PLLMUL3 ((uint32_t)0x00000000) /*!< PLL input clock * 3 */
  2459. #define RCC_CFGR_PLLMUL4 ((uint32_t)0x00040000) /*!< PLL input clock * 4 */
  2460. #define RCC_CFGR_PLLMUL6 ((uint32_t)0x00080000) /*!< PLL input clock * 6 */
  2461. #define RCC_CFGR_PLLMUL8 ((uint32_t)0x000C0000) /*!< PLL input clock * 8 */
  2462. #define RCC_CFGR_PLLMUL12 ((uint32_t)0x00100000) /*!< PLL input clock * 12 */
  2463. #define RCC_CFGR_PLLMUL16 ((uint32_t)0x00140000) /*!< PLL input clock * 16 */
  2464. #define RCC_CFGR_PLLMUL24 ((uint32_t)0x00180000) /*!< PLL input clock * 24 */
  2465. #define RCC_CFGR_PLLMUL32 ((uint32_t)0x001C0000) /*!< PLL input clock * 32 */
  2466. #define RCC_CFGR_PLLMUL48 ((uint32_t)0x00200000) /*!< PLL input clock * 48 */
  2467. /*!< PLLDIV configuration */
  2468. #define RCC_CFGR_PLLDIV ((uint32_t)0x00C00000) /*!< PLLDIV[1:0] bits (PLL Output Division) */
  2469. #define RCC_CFGR_PLLDIV_0 ((uint32_t)0x00400000) /*!< Bit0 */
  2470. #define RCC_CFGR_PLLDIV_1 ((uint32_t)0x00800000) /*!< Bit1 */
  2471. /*!< PLLDIV configuration */
  2472. #define RCC_CFGR_PLLDIV1 ((uint32_t)0x00000000) /*!< PLL clock output = CKVCO / 1 */
  2473. #define RCC_CFGR_PLLDIV2 ((uint32_t)0x00400000) /*!< PLL clock output = CKVCO / 2 */
  2474. #define RCC_CFGR_PLLDIV3 ((uint32_t)0x00800000) /*!< PLL clock output = CKVCO / 3 */
  2475. #define RCC_CFGR_PLLDIV4 ((uint32_t)0x00C00000) /*!< PLL clock output = CKVCO / 4 */
  2476. #define RCC_CFGR_MCOSEL ((uint32_t)0x07000000) /*!< MCO[2:0] bits (Microcontroller Clock Output) */
  2477. #define RCC_CFGR_MCOSEL_0 ((uint32_t)0x01000000) /*!< Bit 0 */
  2478. #define RCC_CFGR_MCOSEL_1 ((uint32_t)0x02000000) /*!< Bit 1 */
  2479. #define RCC_CFGR_MCOSEL_2 ((uint32_t)0x04000000) /*!< Bit 2 */
  2480. /*!< MCO configuration */
  2481. #define RCC_CFGR_MCO_NOCLOCK ((uint32_t)0x00000000) /*!< No clock */
  2482. #define RCC_CFGR_MCO_SYSCLK ((uint32_t)0x01000000) /*!< System clock selected */
  2483. #define RCC_CFGR_MCO_HSI ((uint32_t)0x02000000) /*!< Internal 16 MHz RC oscillator clock selected */
  2484. #define RCC_CFGR_MCO_MSI ((uint32_t)0x03000000) /*!< Internal Medium Speed RC oscillator clock selected */
  2485. #define RCC_CFGR_MCO_HSE ((uint32_t)0x04000000) /*!< External 1-25 MHz oscillator clock selected */
  2486. #define RCC_CFGR_MCO_PLL ((uint32_t)0x05000000) /*!< PLL clock divided */
  2487. #define RCC_CFGR_MCO_LSI ((uint32_t)0x06000000) /*!< LSI selected */
  2488. #define RCC_CFGR_MCO_LSE ((uint32_t)0x07000000) /*!< LSE selected */
  2489. #define RCC_CFGR_MCOPRE ((uint32_t)0x70000000) /*!< MCOPRE[2:0] bits (Microcontroller Clock Output Prescaler) */
  2490. #define RCC_CFGR_MCOPRE_0 ((uint32_t)0x10000000) /*!< Bit 0 */
  2491. #define RCC_CFGR_MCOPRE_1 ((uint32_t)0x20000000) /*!< Bit 1 */
  2492. #define RCC_CFGR_MCOPRE_2 ((uint32_t)0x40000000) /*!< Bit 2 */
  2493. /*!< MCO Prescaler configuration */
  2494. #define RCC_CFGR_MCO_DIV1 ((uint32_t)0x00000000) /*!< MCO Clock divided by 1 */
  2495. #define RCC_CFGR_MCO_DIV2 ((uint32_t)0x10000000) /*!< MCO Clock divided by 2 */
  2496. #define RCC_CFGR_MCO_DIV4 ((uint32_t)0x20000000) /*!< MCO Clock divided by 4 */
  2497. #define RCC_CFGR_MCO_DIV8 ((uint32_t)0x30000000) /*!< MCO Clock divided by 8 */
  2498. #define RCC_CFGR_MCO_DIV16 ((uint32_t)0x40000000) /*!< MCO Clock divided by 16 */
  2499. /*!<****************** Bit definition for RCC_CIR register ********************/
  2500. #define RCC_CIR_LSIRDYF ((uint32_t)0x00000001) /*!< LSI Ready Interrupt flag */
  2501. #define RCC_CIR_LSERDYF ((uint32_t)0x00000002) /*!< LSE Ready Interrupt flag */
  2502. #define RCC_CIR_HSIRDYF ((uint32_t)0x00000004) /*!< HSI Ready Interrupt flag */
  2503. #define RCC_CIR_HSERDYF ((uint32_t)0x00000008) /*!< HSE Ready Interrupt flag */
  2504. #define RCC_CIR_PLLRDYF ((uint32_t)0x00000010) /*!< PLL Ready Interrupt flag */
  2505. #define RCC_CIR_MSIRDYF ((uint32_t)0x00000020) /*!< MSI Ready Interrupt flag */
  2506. #define RCC_CIR_LSECSS ((uint32_t)0x00000040) /*!< LSE CSS Interrupt flag */
  2507. #define RCC_CIR_CSSF ((uint32_t)0x00000080) /*!< Clock Security System Interrupt flag */
  2508. #define RCC_CIR_LSIRDYIE ((uint32_t)0x00000100) /*!< LSI Ready Interrupt Enable */
  2509. #define RCC_CIR_LSERDYIE ((uint32_t)0x00000200) /*!< LSE Ready Interrupt Enable */
  2510. #define RCC_CIR_HSIRDYIE ((uint32_t)0x00000400) /*!< HSI Ready Interrupt Enable */
  2511. #define RCC_CIR_HSERDYIE ((uint32_t)0x00000800) /*!< HSE Ready Interrupt Enable */
  2512. #define RCC_CIR_PLLRDYIE ((uint32_t)0x00001000) /*!< PLL Ready Interrupt Enable */
  2513. #define RCC_CIR_MSIRDYIE ((uint32_t)0x00002000) /*!< MSI Ready Interrupt Enable */
  2514. #define RCC_CIR_LSECSSIE ((uint32_t)0x00004000) /*!< LSE CSS Interrupt Enable */
  2515. #define RCC_CIR_LSIRDYC ((uint32_t)0x00010000) /*!< LSI Ready Interrupt Clear */
  2516. #define RCC_CIR_LSERDYC ((uint32_t)0x00020000) /*!< LSE Ready Interrupt Clear */
  2517. #define RCC_CIR_HSIRDYC ((uint32_t)0x00040000) /*!< HSI Ready Interrupt Clear */
  2518. #define RCC_CIR_HSERDYC ((uint32_t)0x00080000) /*!< HSE Ready Interrupt Clear */
  2519. #define RCC_CIR_PLLRDYC ((uint32_t)0x00100000) /*!< PLL Ready Interrupt Clear */
  2520. #define RCC_CIR_MSIRDYC ((uint32_t)0x00200000) /*!< MSI Ready Interrupt Clear */
  2521. #define RCC_CIR_LSECSSC ((uint32_t)0x00400000) /*!< LSE CSS Interrupt Clear */
  2522. #define RCC_CIR_CSSC ((uint32_t)0x00800000) /*!< Clock Security System Interrupt Clear */
  2523. /***************** Bit definition for RCC_AHBRSTR register ******************/
  2524. #define RCC_AHBRSTR_GPIOARST ((uint32_t)0x00000001) /*!< GPIO port A reset */
  2525. #define RCC_AHBRSTR_GPIOBRST ((uint32_t)0x00000002) /*!< GPIO port B reset */
  2526. #define RCC_AHBRSTR_GPIOCRST ((uint32_t)0x00000004) /*!< GPIO port C reset */
  2527. #define RCC_AHBRSTR_GPIODRST ((uint32_t)0x00000008) /*!< GPIO port D reset */
  2528. #define RCC_AHBRSTR_GPIOERST ((uint32_t)0x00000010) /*!< GPIO port E reset */
  2529. #define RCC_AHBRSTR_GPIOHRST ((uint32_t)0x00000020) /*!< GPIO port H reset */
  2530. #define RCC_AHBRSTR_GPIOFRST ((uint32_t)0x00000040) /*!< GPIO port F reset */
  2531. #define RCC_AHBRSTR_GPIOGRST ((uint32_t)0x00000080) /*!< GPIO port G reset */
  2532. #define RCC_AHBRSTR_CRCRST ((uint32_t)0x00001000) /*!< CRC reset */
  2533. #define RCC_AHBRSTR_FLITFRST ((uint32_t)0x00008000) /*!< FLITF reset */
  2534. #define RCC_AHBRSTR_DMA1RST ((uint32_t)0x01000000) /*!< DMA1 reset */
  2535. #define RCC_AHBRSTR_DMA2RST ((uint32_t)0x02000000) /*!< DMA2 reset */
  2536. #define RCC_AHBRSTR_FSMCRST ((uint32_t)0x40000000) /*!< FSMC reset */
  2537. /***************** Bit definition for RCC_APB2RSTR register *****************/
  2538. #define RCC_APB2RSTR_SYSCFGRST ((uint32_t)0x00000001) /*!< System Configuration SYSCFG reset */
  2539. #define RCC_APB2RSTR_TIM9RST ((uint32_t)0x00000004) /*!< TIM9 reset */
  2540. #define RCC_APB2RSTR_TIM10RST ((uint32_t)0x00000008) /*!< TIM10 reset */
  2541. #define RCC_APB2RSTR_TIM11RST ((uint32_t)0x00000010) /*!< TIM11 reset */
  2542. #define RCC_APB2RSTR_ADC1RST ((uint32_t)0x00000200) /*!< ADC1 reset */
  2543. #define RCC_APB2RSTR_SDIORST ((uint32_t)0x00000800) /*!< SDIO reset */
  2544. #define RCC_APB2RSTR_SPI1RST ((uint32_t)0x00001000) /*!< SPI1 reset */
  2545. #define RCC_APB2RSTR_USART1RST ((uint32_t)0x00004000) /*!< USART1 reset */
  2546. /***************** Bit definition for RCC_APB1RSTR register *****************/
  2547. #define RCC_APB1RSTR_TIM2RST ((uint32_t)0x00000001) /*!< Timer 2 reset */
  2548. #define RCC_APB1RSTR_TIM3RST ((uint32_t)0x00000002) /*!< Timer 3 reset */
  2549. #define RCC_APB1RSTR_TIM4RST ((uint32_t)0x00000004) /*!< Timer 4 reset */
  2550. #define RCC_APB1RSTR_TIM5RST ((uint32_t)0x00000008) /*!< Timer 5 reset */
  2551. #define RCC_APB1RSTR_TIM6RST ((uint32_t)0x00000010) /*!< Timer 6 reset */
  2552. #define RCC_APB1RSTR_TIM7RST ((uint32_t)0x00000020) /*!< Timer 7 reset */
  2553. #define RCC_APB1RSTR_LCDRST ((uint32_t)0x00000200) /*!< LCD reset */
  2554. #define RCC_APB1RSTR_WWDGRST ((uint32_t)0x00000800) /*!< Window Watchdog reset */
  2555. #define RCC_APB1RSTR_SPI2RST ((uint32_t)0x00004000) /*!< SPI 2 reset */
  2556. #define RCC_APB1RSTR_SPI3RST ((uint32_t)0x00008000) /*!< SPI 3 reset */
  2557. #define RCC_APB1RSTR_USART2RST ((uint32_t)0x00020000) /*!< USART 2 reset */
  2558. #define RCC_APB1RSTR_USART3RST ((uint32_t)0x00040000) /*!< USART 3 reset */
  2559. #define RCC_APB1RSTR_UART4RST ((uint32_t)0x00080000) /*!< UART 4 reset */
  2560. #define RCC_APB1RSTR_UART5RST ((uint32_t)0x00100000) /*!< UART 5 reset */
  2561. #define RCC_APB1RSTR_I2C1RST ((uint32_t)0x00200000) /*!< I2C 1 reset */
  2562. #define RCC_APB1RSTR_I2C2RST ((uint32_t)0x00400000) /*!< I2C 2 reset */
  2563. #define RCC_APB1RSTR_USBRST ((uint32_t)0x00800000) /*!< USB reset */
  2564. #define RCC_APB1RSTR_PWRRST ((uint32_t)0x10000000) /*!< Power interface reset */
  2565. #define RCC_APB1RSTR_DACRST ((uint32_t)0x20000000) /*!< DAC interface reset */
  2566. #define RCC_APB1RSTR_COMPRST ((uint32_t)0x80000000) /*!< Comparator interface reset */
  2567. /****************** Bit definition for RCC_AHBENR register ******************/
  2568. #define RCC_AHBENR_GPIOAEN ((uint32_t)0x00000001) /*!< GPIO port A clock enable */
  2569. #define RCC_AHBENR_GPIOBEN ((uint32_t)0x00000002) /*!< GPIO port B clock enable */
  2570. #define RCC_AHBENR_GPIOCEN ((uint32_t)0x00000004) /*!< GPIO port C clock enable */
  2571. #define RCC_AHBENR_GPIODEN ((uint32_t)0x00000008) /*!< GPIO port D clock enable */
  2572. #define RCC_AHBENR_GPIOEEN ((uint32_t)0x00000010) /*!< GPIO port E clock enable */
  2573. #define RCC_AHBENR_GPIOHEN ((uint32_t)0x00000020) /*!< GPIO port H clock enable */
  2574. #define RCC_AHBENR_GPIOFEN ((uint32_t)0x00000040) /*!< GPIO port F clock enable */
  2575. #define RCC_AHBENR_GPIOGEN ((uint32_t)0x00000080) /*!< GPIO port G clock enable */
  2576. #define RCC_AHBENR_CRCEN ((uint32_t)0x00001000) /*!< CRC clock enable */
  2577. #define RCC_AHBENR_FLITFEN ((uint32_t)0x00008000) /*!< FLITF clock enable (has effect only when
  2578. the Flash memory is in power down mode) */
  2579. #define RCC_AHBENR_DMA1EN ((uint32_t)0x01000000) /*!< DMA1 clock enable */
  2580. #define RCC_AHBENR_DMA2EN ((uint32_t)0x02000000) /*!< DMA2 clock enable */
  2581. #define RCC_AHBENR_FSMCEN ((uint32_t)0x40000000) /*!< FSMC clock enable */
  2582. /****************** Bit definition for RCC_APB2ENR register *****************/
  2583. #define RCC_APB2ENR_SYSCFGEN ((uint32_t)0x00000001) /*!< System Configuration SYSCFG clock enable */
  2584. #define RCC_APB2ENR_TIM9EN ((uint32_t)0x00000004) /*!< TIM9 interface clock enable */
  2585. #define RCC_APB2ENR_TIM10EN ((uint32_t)0x00000008) /*!< TIM10 interface clock enable */
  2586. #define RCC_APB2ENR_TIM11EN ((uint32_t)0x00000010) /*!< TIM11 Timer clock enable */
  2587. #define RCC_APB2ENR_ADC1EN ((uint32_t)0x00000200) /*!< ADC1 clock enable */
  2588. #define RCC_APB2ENR_SDIOEN ((uint32_t)0x00000800) /*!< SDIO clock enable */
  2589. #define RCC_APB2ENR_SPI1EN ((uint32_t)0x00001000) /*!< SPI1 clock enable */
  2590. #define RCC_APB2ENR_USART1EN ((uint32_t)0x00004000) /*!< USART1 clock enable */
  2591. /***************** Bit definition for RCC_APB1ENR register ******************/
  2592. #define RCC_APB1ENR_TIM2EN ((uint32_t)0x00000001) /*!< Timer 2 clock enabled*/
  2593. #define RCC_APB1ENR_TIM3EN ((uint32_t)0x00000002) /*!< Timer 3 clock enable */
  2594. #define RCC_APB1ENR_TIM4EN ((uint32_t)0x00000004) /*!< Timer 4 clock enable */
  2595. #define RCC_APB1ENR_TIM5EN ((uint32_t)0x00000008) /*!< Timer 5 clock enable */
  2596. #define RCC_APB1ENR_TIM6EN ((uint32_t)0x00000010) /*!< Timer 6 clock enable */
  2597. #define RCC_APB1ENR_TIM7EN ((uint32_t)0x00000020) /*!< Timer 7 clock enable */
  2598. #define RCC_APB1ENR_LCDEN ((uint32_t)0x00000200) /*!< LCD clock enable */
  2599. #define RCC_APB1ENR_WWDGEN ((uint32_t)0x00000800) /*!< Window Watchdog clock enable */
  2600. #define RCC_APB1ENR_SPI2EN ((uint32_t)0x00004000) /*!< SPI 2 clock enable */
  2601. #define RCC_APB1ENR_SPI3EN ((uint32_t)0x00008000) /*!< SPI 3 clock enable */
  2602. #define RCC_APB1ENR_USART2EN ((uint32_t)0x00020000) /*!< USART 2 clock enable */
  2603. #define RCC_APB1ENR_USART3EN ((uint32_t)0x00040000) /*!< USART 3 clock enable */
  2604. #define RCC_APB1ENR_UART4EN ((uint32_t)0x00080000) /*!< UART 4 clock enable */
  2605. #define RCC_APB1ENR_UART5EN ((uint32_t)0x00100000) /*!< UART 5 clock enable */
  2606. #define RCC_APB1ENR_I2C1EN ((uint32_t)0x00200000) /*!< I2C 1 clock enable */
  2607. #define RCC_APB1ENR_I2C2EN ((uint32_t)0x00400000) /*!< I2C 2 clock enable */
  2608. #define RCC_APB1ENR_USBEN ((uint32_t)0x00800000) /*!< USB clock enable */
  2609. #define RCC_APB1ENR_PWREN ((uint32_t)0x10000000) /*!< Power interface clock enable */
  2610. #define RCC_APB1ENR_DACEN ((uint32_t)0x20000000) /*!< DAC interface clock enable */
  2611. #define RCC_APB1ENR_COMPEN ((uint32_t)0x80000000) /*!< Comparator interface clock enable */
  2612. /****************** Bit definition for RCC_AHBLPENR register ****************/
  2613. #define RCC_AHBLPENR_GPIOALPEN ((uint32_t)0x00000001) /*!< GPIO port A clock enabled in sleep mode */
  2614. #define RCC_AHBLPENR_GPIOBLPEN ((uint32_t)0x00000002) /*!< GPIO port B clock enabled in sleep mode */
  2615. #define RCC_AHBLPENR_GPIOCLPEN ((uint32_t)0x00000004) /*!< GPIO port C clock enabled in sleep mode */
  2616. #define RCC_AHBLPENR_GPIODLPEN ((uint32_t)0x00000008) /*!< GPIO port D clock enabled in sleep mode */
  2617. #define RCC_AHBLPENR_GPIOELPEN ((uint32_t)0x00000010) /*!< GPIO port E clock enabled in sleep mode */
  2618. #define RCC_AHBLPENR_GPIOHLPEN ((uint32_t)0x00000020) /*!< GPIO port H clock enabled in sleep mode */
  2619. #define RCC_AHBLPENR_GPIOFLPEN ((uint32_t)0x00000040) /*!< GPIO port F clock enabled in sleep mode */
  2620. #define RCC_AHBLPENR_GPIOGLPEN ((uint32_t)0x00000080) /*!< GPIO port G clock enabled in sleep mode */
  2621. #define RCC_AHBLPENR_CRCLPEN ((uint32_t)0x00001000) /*!< CRC clock enabled in sleep mode */
  2622. #define RCC_AHBLPENR_FLITFLPEN ((uint32_t)0x00008000) /*!< Flash Interface clock enabled in sleep mode
  2623. (has effect only when the Flash memory is
  2624. in power down mode) */
  2625. #define RCC_AHBLPENR_SRAMLPEN ((uint32_t)0x00010000) /*!< SRAM clock enabled in sleep mode */
  2626. #define RCC_AHBLPENR_DMA1LPEN ((uint32_t)0x01000000) /*!< DMA1 clock enabled in sleep mode */
  2627. #define RCC_AHBLPENR_DMA2LPEN ((uint32_t)0x02000000) /*!< DMA2 clock enabled in sleep mode */
  2628. #define RCC_AHBLPENR_FSMCLPEN ((uint32_t)0x40000000) /*!< FSMC clock enabled in sleep mode */
  2629. /****************** Bit definition for RCC_APB2LPENR register ***************/
  2630. #define RCC_APB2LPENR_SYSCFGLPEN ((uint32_t)0x00000001) /*!< System Configuration SYSCFG clock enabled in sleep mode */
  2631. #define RCC_APB2LPENR_TIM9LPEN ((uint32_t)0x00000004) /*!< TIM9 interface clock enabled in sleep mode */
  2632. #define RCC_APB2LPENR_TIM10LPEN ((uint32_t)0x00000008) /*!< TIM10 interface clock enabled in sleep mode */
  2633. #define RCC_APB2LPENR_TIM11LPEN ((uint32_t)0x00000010) /*!< TIM11 Timer clock enabled in sleep mode */
  2634. #define RCC_APB2LPENR_ADC1LPEN ((uint32_t)0x00000200) /*!< ADC1 clock enabled in sleep mode */
  2635. #define RCC_APB2LPENR_SDIOLPEN ((uint32_t)0x00000800) /*!< SDIO clock enabled in sleep mode */
  2636. #define RCC_APB2LPENR_SPI1LPEN ((uint32_t)0x00001000) /*!< SPI1 clock enabled in sleep mode */
  2637. #define RCC_APB2LPENR_USART1LPEN ((uint32_t)0x00004000) /*!< USART1 clock enabled in sleep mode */
  2638. /***************** Bit definition for RCC_APB1LPENR register ****************/
  2639. #define RCC_APB1LPENR_TIM2LPEN ((uint32_t)0x00000001) /*!< Timer 2 clock enabled in sleep mode */
  2640. #define RCC_APB1LPENR_TIM3LPEN ((uint32_t)0x00000002) /*!< Timer 3 clock enabled in sleep mode */
  2641. #define RCC_APB1LPENR_TIM4LPEN ((uint32_t)0x00000004) /*!< Timer 4 clock enabled in sleep mode */
  2642. #define RCC_APB1LPENR_TIM5LPEN ((uint32_t)0x00000008) /*!< Timer 5 clock enabled in sleep mode */
  2643. #define RCC_APB1LPENR_TIM6LPEN ((uint32_t)0x00000010) /*!< Timer 6 clock enabled in sleep mode */
  2644. #define RCC_APB1LPENR_TIM7LPEN ((uint32_t)0x00000020) /*!< Timer 7 clock enabled in sleep mode */
  2645. #define RCC_APB1LPENR_LCDLPEN ((uint32_t)0x00000200) /*!< LCD clock enabled in sleep mode */
  2646. #define RCC_APB1LPENR_WWDGLPEN ((uint32_t)0x00000800) /*!< Window Watchdog clock enabled in sleep mode */
  2647. #define RCC_APB1LPENR_SPI2LPEN ((uint32_t)0x00004000) /*!< SPI 2 clock enabled in sleep mode */
  2648. #define RCC_APB1LPENR_SPI3LPEN ((uint32_t)0x00008000) /*!< SPI 3 clock enabled in sleep mode */
  2649. #define RCC_APB1LPENR_USART2LPEN ((uint32_t)0x00020000) /*!< USART 2 clock enabled in sleep mode */
  2650. #define RCC_APB1LPENR_USART3LPEN ((uint32_t)0x00040000) /*!< USART 3 clock enabled in sleep mode */
  2651. #define RCC_APB1LPENR_UART4LPEN ((uint32_t)0x00080000) /*!< UART 4 clock enabled in sleep mode */
  2652. #define RCC_APB1LPENR_UART5LPEN ((uint32_t)0x00100000) /*!< UART 5 clock enabled in sleep mode */
  2653. #define RCC_APB1LPENR_I2C1LPEN ((uint32_t)0x00200000) /*!< I2C 1 clock enabled in sleep mode */
  2654. #define RCC_APB1LPENR_I2C2LPEN ((uint32_t)0x00400000) /*!< I2C 2 clock enabled in sleep mode */
  2655. #define RCC_APB1LPENR_USBLPEN ((uint32_t)0x00800000) /*!< USB clock enabled in sleep mode */
  2656. #define RCC_APB1LPENR_PWRLPEN ((uint32_t)0x10000000) /*!< Power interface clock enabled in sleep mode */
  2657. #define RCC_APB1LPENR_DACLPEN ((uint32_t)0x20000000) /*!< DAC interface clock enabled in sleep mode */
  2658. #define RCC_APB1LPENR_COMPLPEN ((uint32_t)0x80000000) /*!< Comparator interface clock enabled in sleep mode*/
  2659. /******************* Bit definition for RCC_CSR register ********************/
  2660. #define RCC_CSR_LSION ((uint32_t)0x00000001) /*!< Internal Low Speed oscillator enable */
  2661. #define RCC_CSR_LSIRDY ((uint32_t)0x00000002) /*!< Internal Low Speed oscillator Ready */
  2662. #define RCC_CSR_LSEON ((uint32_t)0x00000100) /*!< External Low Speed oscillator enable */
  2663. #define RCC_CSR_LSERDY ((uint32_t)0x00000200) /*!< External Low Speed oscillator Ready */
  2664. #define RCC_CSR_LSEBYP ((uint32_t)0x00000400) /*!< External Low Speed oscillator Bypass */
  2665. #define RCC_CSR_LSECSSON ((uint32_t)0x00000800) /*!< External Low Speed oscillator CSS Enable */
  2666. #define RCC_CSR_LSECSSD ((uint32_t)0x00001000) /*!< External Low Speed oscillator CSS Detected */
  2667. #define RCC_CSR_RTCSEL ((uint32_t)0x00030000) /*!< RTCSEL[1:0] bits (RTC clock source selection) */
  2668. #define RCC_CSR_RTCSEL_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  2669. #define RCC_CSR_RTCSEL_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  2670. /*!< RTC congiguration */
  2671. #define RCC_CSR_RTCSEL_NOCLOCK ((uint32_t)0x00000000) /*!< No clock */
  2672. #define RCC_CSR_RTCSEL_LSE ((uint32_t)0x00010000) /*!< LSE oscillator clock used as RTC clock */
  2673. #define RCC_CSR_RTCSEL_LSI ((uint32_t)0x00020000) /*!< LSI oscillator clock used as RTC clock */
  2674. #define RCC_CSR_RTCSEL_HSE ((uint32_t)0x00030000) /*!< HSE oscillator clock divided by 2, 4, 8 or 16 by RTCPRE used as RTC clock */
  2675. #define RCC_CSR_RTCEN ((uint32_t)0x00400000) /*!< RTC clock enable */
  2676. #define RCC_CSR_RTCRST ((uint32_t)0x00800000) /*!< RTC reset */
  2677. #define RCC_CSR_RMVF ((uint32_t)0x01000000) /*!< Remove reset flag */
  2678. #define RCC_CSR_OBLRSTF ((uint32_t)0x02000000) /*!< Option Bytes Loader reset flag */
  2679. #define RCC_CSR_PINRSTF ((uint32_t)0x04000000) /*!< PIN reset flag */
  2680. #define RCC_CSR_PORRSTF ((uint32_t)0x08000000) /*!< POR/PDR reset flag */
  2681. #define RCC_CSR_SFTRSTF ((uint32_t)0x10000000) /*!< Software Reset flag */
  2682. #define RCC_CSR_IWDGRSTF ((uint32_t)0x20000000) /*!< Independent Watchdog reset flag */
  2683. #define RCC_CSR_WWDGRSTF ((uint32_t)0x40000000) /*!< Window watchdog reset flag */
  2684. #define RCC_CSR_LPWRRSTF ((uint32_t)0x80000000) /*!< Low-Power reset flag */
  2685. /******************************************************************************/
  2686. /* */
  2687. /* Real-Time Clock (RTC) */
  2688. /* */
  2689. /******************************************************************************/
  2690. /******************** Bits definition for RTC_TR register *******************/
  2691. #define RTC_TR_PM ((uint32_t)0x00400000)
  2692. #define RTC_TR_HT ((uint32_t)0x00300000)
  2693. #define RTC_TR_HT_0 ((uint32_t)0x00100000)
  2694. #define RTC_TR_HT_1 ((uint32_t)0x00200000)
  2695. #define RTC_TR_HU ((uint32_t)0x000F0000)
  2696. #define RTC_TR_HU_0 ((uint32_t)0x00010000)
  2697. #define RTC_TR_HU_1 ((uint32_t)0x00020000)
  2698. #define RTC_TR_HU_2 ((uint32_t)0x00040000)
  2699. #define RTC_TR_HU_3 ((uint32_t)0x00080000)
  2700. #define RTC_TR_MNT ((uint32_t)0x00007000)
  2701. #define RTC_TR_MNT_0 ((uint32_t)0x00001000)
  2702. #define RTC_TR_MNT_1 ((uint32_t)0x00002000)
  2703. #define RTC_TR_MNT_2 ((uint32_t)0x00004000)
  2704. #define RTC_TR_MNU ((uint32_t)0x00000F00)
  2705. #define RTC_TR_MNU_0 ((uint32_t)0x00000100)
  2706. #define RTC_TR_MNU_1 ((uint32_t)0x00000200)
  2707. #define RTC_TR_MNU_2 ((uint32_t)0x00000400)
  2708. #define RTC_TR_MNU_3 ((uint32_t)0x00000800)
  2709. #define RTC_TR_ST ((uint32_t)0x00000070)
  2710. #define RTC_TR_ST_0 ((uint32_t)0x00000010)
  2711. #define RTC_TR_ST_1 ((uint32_t)0x00000020)
  2712. #define RTC_TR_ST_2 ((uint32_t)0x00000040)
  2713. #define RTC_TR_SU ((uint32_t)0x0000000F)
  2714. #define RTC_TR_SU_0 ((uint32_t)0x00000001)
  2715. #define RTC_TR_SU_1 ((uint32_t)0x00000002)
  2716. #define RTC_TR_SU_2 ((uint32_t)0x00000004)
  2717. #define RTC_TR_SU_3 ((uint32_t)0x00000008)
  2718. /******************** Bits definition for RTC_DR register *******************/
  2719. #define RTC_DR_YT ((uint32_t)0x00F00000)
  2720. #define RTC_DR_YT_0 ((uint32_t)0x00100000)
  2721. #define RTC_DR_YT_1 ((uint32_t)0x00200000)
  2722. #define RTC_DR_YT_2 ((uint32_t)0x00400000)
  2723. #define RTC_DR_YT_3 ((uint32_t)0x00800000)
  2724. #define RTC_DR_YU ((uint32_t)0x000F0000)
  2725. #define RTC_DR_YU_0 ((uint32_t)0x00010000)
  2726. #define RTC_DR_YU_1 ((uint32_t)0x00020000)
  2727. #define RTC_DR_YU_2 ((uint32_t)0x00040000)
  2728. #define RTC_DR_YU_3 ((uint32_t)0x00080000)
  2729. #define RTC_DR_WDU ((uint32_t)0x0000E000)
  2730. #define RTC_DR_WDU_0 ((uint32_t)0x00002000)
  2731. #define RTC_DR_WDU_1 ((uint32_t)0x00004000)
  2732. #define RTC_DR_WDU_2 ((uint32_t)0x00008000)
  2733. #define RTC_DR_MT ((uint32_t)0x00001000)
  2734. #define RTC_DR_MU ((uint32_t)0x00000F00)
  2735. #define RTC_DR_MU_0 ((uint32_t)0x00000100)
  2736. #define RTC_DR_MU_1 ((uint32_t)0x00000200)
  2737. #define RTC_DR_MU_2 ((uint32_t)0x00000400)
  2738. #define RTC_DR_MU_3 ((uint32_t)0x00000800)
  2739. #define RTC_DR_DT ((uint32_t)0x00000030)
  2740. #define RTC_DR_DT_0 ((uint32_t)0x00000010)
  2741. #define RTC_DR_DT_1 ((uint32_t)0x00000020)
  2742. #define RTC_DR_DU ((uint32_t)0x0000000F)
  2743. #define RTC_DR_DU_0 ((uint32_t)0x00000001)
  2744. #define RTC_DR_DU_1 ((uint32_t)0x00000002)
  2745. #define RTC_DR_DU_2 ((uint32_t)0x00000004)
  2746. #define RTC_DR_DU_3 ((uint32_t)0x00000008)
  2747. /******************** Bits definition for RTC_CR register *******************/
  2748. #define RTC_CR_COE ((uint32_t)0x00800000)
  2749. #define RTC_CR_OSEL ((uint32_t)0x00600000)
  2750. #define RTC_CR_OSEL_0 ((uint32_t)0x00200000)
  2751. #define RTC_CR_OSEL_1 ((uint32_t)0x00400000)
  2752. #define RTC_CR_POL ((uint32_t)0x00100000)
  2753. #define RTC_CR_COSEL ((uint32_t)0x00080000)
  2754. #define RTC_CR_BCK ((uint32_t)0x00040000)
  2755. #define RTC_CR_SUB1H ((uint32_t)0x00020000)
  2756. #define RTC_CR_ADD1H ((uint32_t)0x00010000)
  2757. #define RTC_CR_TSIE ((uint32_t)0x00008000)
  2758. #define RTC_CR_WUTIE ((uint32_t)0x00004000)
  2759. #define RTC_CR_ALRBIE ((uint32_t)0x00002000)
  2760. #define RTC_CR_ALRAIE ((uint32_t)0x00001000)
  2761. #define RTC_CR_TSE ((uint32_t)0x00000800)
  2762. #define RTC_CR_WUTE ((uint32_t)0x00000400)
  2763. #define RTC_CR_ALRBE ((uint32_t)0x00000200)
  2764. #define RTC_CR_ALRAE ((uint32_t)0x00000100)
  2765. #define RTC_CR_DCE ((uint32_t)0x00000080)
  2766. #define RTC_CR_FMT ((uint32_t)0x00000040)
  2767. #define RTC_CR_BYPSHAD ((uint32_t)0x00000020)
  2768. #define RTC_CR_REFCKON ((uint32_t)0x00000010)
  2769. #define RTC_CR_TSEDGE ((uint32_t)0x00000008)
  2770. #define RTC_CR_WUCKSEL ((uint32_t)0x00000007)
  2771. #define RTC_CR_WUCKSEL_0 ((uint32_t)0x00000001)
  2772. #define RTC_CR_WUCKSEL_1 ((uint32_t)0x00000002)
  2773. #define RTC_CR_WUCKSEL_2 ((uint32_t)0x00000004)
  2774. /******************** Bits definition for RTC_ISR register ******************/
  2775. #define RTC_ISR_RECALPF ((uint32_t)0x00010000)
  2776. #define RTC_ISR_TAMP3F ((uint32_t)0x00008000)
  2777. #define RTC_ISR_TAMP2F ((uint32_t)0x00004000)
  2778. #define RTC_ISR_TAMP1F ((uint32_t)0x00002000)
  2779. #define RTC_ISR_TSOVF ((uint32_t)0x00001000)
  2780. #define RTC_ISR_TSF ((uint32_t)0x00000800)
  2781. #define RTC_ISR_WUTF ((uint32_t)0x00000400)
  2782. #define RTC_ISR_ALRBF ((uint32_t)0x00000200)
  2783. #define RTC_ISR_ALRAF ((uint32_t)0x00000100)
  2784. #define RTC_ISR_INIT ((uint32_t)0x00000080)
  2785. #define RTC_ISR_INITF ((uint32_t)0x00000040)
  2786. #define RTC_ISR_RSF ((uint32_t)0x00000020)
  2787. #define RTC_ISR_INITS ((uint32_t)0x00000010)
  2788. #define RTC_ISR_SHPF ((uint32_t)0x00000008)
  2789. #define RTC_ISR_WUTWF ((uint32_t)0x00000004)
  2790. #define RTC_ISR_ALRBWF ((uint32_t)0x00000002)
  2791. #define RTC_ISR_ALRAWF ((uint32_t)0x00000001)
  2792. /******************** Bits definition for RTC_PRER register *****************/
  2793. #define RTC_PRER_PREDIV_A ((uint32_t)0x007F0000)
  2794. #define RTC_PRER_PREDIV_S ((uint32_t)0x00007FFF)
  2795. /******************** Bits definition for RTC_WUTR register *****************/
  2796. #define RTC_WUTR_WUT ((uint32_t)0x0000FFFF)
  2797. /******************** Bits definition for RTC_CALIBR register ***************/
  2798. #define RTC_CALIBR_DCS ((uint32_t)0x00000080)
  2799. #define RTC_CALIBR_DC ((uint32_t)0x0000001F)
  2800. /******************** Bits definition for RTC_ALRMAR register ***************/
  2801. #define RTC_ALRMAR_MSK4 ((uint32_t)0x80000000)
  2802. #define RTC_ALRMAR_WDSEL ((uint32_t)0x40000000)
  2803. #define RTC_ALRMAR_DT ((uint32_t)0x30000000)
  2804. #define RTC_ALRMAR_DT_0 ((uint32_t)0x10000000)
  2805. #define RTC_ALRMAR_DT_1 ((uint32_t)0x20000000)
  2806. #define RTC_ALRMAR_DU ((uint32_t)0x0F000000)
  2807. #define RTC_ALRMAR_DU_0 ((uint32_t)0x01000000)
  2808. #define RTC_ALRMAR_DU_1 ((uint32_t)0x02000000)
  2809. #define RTC_ALRMAR_DU_2 ((uint32_t)0x04000000)
  2810. #define RTC_ALRMAR_DU_3 ((uint32_t)0x08000000)
  2811. #define RTC_ALRMAR_MSK3 ((uint32_t)0x00800000)
  2812. #define RTC_ALRMAR_PM ((uint32_t)0x00400000)
  2813. #define RTC_ALRMAR_HT ((uint32_t)0x00300000)
  2814. #define RTC_ALRMAR_HT_0 ((uint32_t)0x00100000)
  2815. #define RTC_ALRMAR_HT_1 ((uint32_t)0x00200000)
  2816. #define RTC_ALRMAR_HU ((uint32_t)0x000F0000)
  2817. #define RTC_ALRMAR_HU_0 ((uint32_t)0x00010000)
  2818. #define RTC_ALRMAR_HU_1 ((uint32_t)0x00020000)
  2819. #define RTC_ALRMAR_HU_2 ((uint32_t)0x00040000)
  2820. #define RTC_ALRMAR_HU_3 ((uint32_t)0x00080000)
  2821. #define RTC_ALRMAR_MSK2 ((uint32_t)0x00008000)
  2822. #define RTC_ALRMAR_MNT ((uint32_t)0x00007000)
  2823. #define RTC_ALRMAR_MNT_0 ((uint32_t)0x00001000)
  2824. #define RTC_ALRMAR_MNT_1 ((uint32_t)0x00002000)
  2825. #define RTC_ALRMAR_MNT_2 ((uint32_t)0x00004000)
  2826. #define RTC_ALRMAR_MNU ((uint32_t)0x00000F00)
  2827. #define RTC_ALRMAR_MNU_0 ((uint32_t)0x00000100)
  2828. #define RTC_ALRMAR_MNU_1 ((uint32_t)0x00000200)
  2829. #define RTC_ALRMAR_MNU_2 ((uint32_t)0x00000400)
  2830. #define RTC_ALRMAR_MNU_3 ((uint32_t)0x00000800)
  2831. #define RTC_ALRMAR_MSK1 ((uint32_t)0x00000080)
  2832. #define RTC_ALRMAR_ST ((uint32_t)0x00000070)
  2833. #define RTC_ALRMAR_ST_0 ((uint32_t)0x00000010)
  2834. #define RTC_ALRMAR_ST_1 ((uint32_t)0x00000020)
  2835. #define RTC_ALRMAR_ST_2 ((uint32_t)0x00000040)
  2836. #define RTC_ALRMAR_SU ((uint32_t)0x0000000F)
  2837. #define RTC_ALRMAR_SU_0 ((uint32_t)0x00000001)
  2838. #define RTC_ALRMAR_SU_1 ((uint32_t)0x00000002)
  2839. #define RTC_ALRMAR_SU_2 ((uint32_t)0x00000004)
  2840. #define RTC_ALRMAR_SU_3 ((uint32_t)0x00000008)
  2841. /******************** Bits definition for RTC_ALRMBR register ***************/
  2842. #define RTC_ALRMBR_MSK4 ((uint32_t)0x80000000)
  2843. #define RTC_ALRMBR_WDSEL ((uint32_t)0x40000000)
  2844. #define RTC_ALRMBR_DT ((uint32_t)0x30000000)
  2845. #define RTC_ALRMBR_DT_0 ((uint32_t)0x10000000)
  2846. #define RTC_ALRMBR_DT_1 ((uint32_t)0x20000000)
  2847. #define RTC_ALRMBR_DU ((uint32_t)0x0F000000)
  2848. #define RTC_ALRMBR_DU_0 ((uint32_t)0x01000000)
  2849. #define RTC_ALRMBR_DU_1 ((uint32_t)0x02000000)
  2850. #define RTC_ALRMBR_DU_2 ((uint32_t)0x04000000)
  2851. #define RTC_ALRMBR_DU_3 ((uint32_t)0x08000000)
  2852. #define RTC_ALRMBR_MSK3 ((uint32_t)0x00800000)
  2853. #define RTC_ALRMBR_PM ((uint32_t)0x00400000)
  2854. #define RTC_ALRMBR_HT ((uint32_t)0x00300000)
  2855. #define RTC_ALRMBR_HT_0 ((uint32_t)0x00100000)
  2856. #define RTC_ALRMBR_HT_1 ((uint32_t)0x00200000)
  2857. #define RTC_ALRMBR_HU ((uint32_t)0x000F0000)
  2858. #define RTC_ALRMBR_HU_0 ((uint32_t)0x00010000)
  2859. #define RTC_ALRMBR_HU_1 ((uint32_t)0x00020000)
  2860. #define RTC_ALRMBR_HU_2 ((uint32_t)0x00040000)
  2861. #define RTC_ALRMBR_HU_3 ((uint32_t)0x00080000)
  2862. #define RTC_ALRMBR_MSK2 ((uint32_t)0x00008000)
  2863. #define RTC_ALRMBR_MNT ((uint32_t)0x00007000)
  2864. #define RTC_ALRMBR_MNT_0 ((uint32_t)0x00001000)
  2865. #define RTC_ALRMBR_MNT_1 ((uint32_t)0x00002000)
  2866. #define RTC_ALRMBR_MNT_2 ((uint32_t)0x00004000)
  2867. #define RTC_ALRMBR_MNU ((uint32_t)0x00000F00)
  2868. #define RTC_ALRMBR_MNU_0 ((uint32_t)0x00000100)
  2869. #define RTC_ALRMBR_MNU_1 ((uint32_t)0x00000200)
  2870. #define RTC_ALRMBR_MNU_2 ((uint32_t)0x00000400)
  2871. #define RTC_ALRMBR_MNU_3 ((uint32_t)0x00000800)
  2872. #define RTC_ALRMBR_MSK1 ((uint32_t)0x00000080)
  2873. #define RTC_ALRMBR_ST ((uint32_t)0x00000070)
  2874. #define RTC_ALRMBR_ST_0 ((uint32_t)0x00000010)
  2875. #define RTC_ALRMBR_ST_1 ((uint32_t)0x00000020)
  2876. #define RTC_ALRMBR_ST_2 ((uint32_t)0x00000040)
  2877. #define RTC_ALRMBR_SU ((uint32_t)0x0000000F)
  2878. #define RTC_ALRMBR_SU_0 ((uint32_t)0x00000001)
  2879. #define RTC_ALRMBR_SU_1 ((uint32_t)0x00000002)
  2880. #define RTC_ALRMBR_SU_2 ((uint32_t)0x00000004)
  2881. #define RTC_ALRMBR_SU_3 ((uint32_t)0x00000008)
  2882. /******************** Bits definition for RTC_WPR register ******************/
  2883. #define RTC_WPR_KEY ((uint32_t)0x000000FF)
  2884. /******************** Bits definition for RTC_SSR register ******************/
  2885. #define RTC_SSR_SS ((uint32_t)0x0000FFFF)
  2886. /******************** Bits definition for RTC_SHIFTR register ***************/
  2887. #define RTC_SHIFTR_SUBFS ((uint32_t)0x00007FFF)
  2888. #define RTC_SHIFTR_ADD1S ((uint32_t)0x80000000)
  2889. /******************** Bits definition for RTC_TSTR register *****************/
  2890. #define RTC_TSTR_PM ((uint32_t)0x00400000)
  2891. #define RTC_TSTR_HT ((uint32_t)0x00300000)
  2892. #define RTC_TSTR_HT_0 ((uint32_t)0x00100000)
  2893. #define RTC_TSTR_HT_1 ((uint32_t)0x00200000)
  2894. #define RTC_TSTR_HU ((uint32_t)0x000F0000)
  2895. #define RTC_TSTR_HU_0 ((uint32_t)0x00010000)
  2896. #define RTC_TSTR_HU_1 ((uint32_t)0x00020000)
  2897. #define RTC_TSTR_HU_2 ((uint32_t)0x00040000)
  2898. #define RTC_TSTR_HU_3 ((uint32_t)0x00080000)
  2899. #define RTC_TSTR_MNT ((uint32_t)0x00007000)
  2900. #define RTC_TSTR_MNT_0 ((uint32_t)0x00001000)
  2901. #define RTC_TSTR_MNT_1 ((uint32_t)0x00002000)
  2902. #define RTC_TSTR_MNT_2 ((uint32_t)0x00004000)
  2903. #define RTC_TSTR_MNU ((uint32_t)0x00000F00)
  2904. #define RTC_TSTR_MNU_0 ((uint32_t)0x00000100)
  2905. #define RTC_TSTR_MNU_1 ((uint32_t)0x00000200)
  2906. #define RTC_TSTR_MNU_2 ((uint32_t)0x00000400)
  2907. #define RTC_TSTR_MNU_3 ((uint32_t)0x00000800)
  2908. #define RTC_TSTR_ST ((uint32_t)0x00000070)
  2909. #define RTC_TSTR_ST_0 ((uint32_t)0x00000010)
  2910. #define RTC_TSTR_ST_1 ((uint32_t)0x00000020)
  2911. #define RTC_TSTR_ST_2 ((uint32_t)0x00000040)
  2912. #define RTC_TSTR_SU ((uint32_t)0x0000000F)
  2913. #define RTC_TSTR_SU_0 ((uint32_t)0x00000001)
  2914. #define RTC_TSTR_SU_1 ((uint32_t)0x00000002)
  2915. #define RTC_TSTR_SU_2 ((uint32_t)0x00000004)
  2916. #define RTC_TSTR_SU_3 ((uint32_t)0x00000008)
  2917. /******************** Bits definition for RTC_TSDR register *****************/
  2918. #define RTC_TSDR_WDU ((uint32_t)0x0000E000)
  2919. #define RTC_TSDR_WDU_0 ((uint32_t)0x00002000)
  2920. #define RTC_TSDR_WDU_1 ((uint32_t)0x00004000)
  2921. #define RTC_TSDR_WDU_2 ((uint32_t)0x00008000)
  2922. #define RTC_TSDR_MT ((uint32_t)0x00001000)
  2923. #define RTC_TSDR_MU ((uint32_t)0x00000F00)
  2924. #define RTC_TSDR_MU_0 ((uint32_t)0x00000100)
  2925. #define RTC_TSDR_MU_1 ((uint32_t)0x00000200)
  2926. #define RTC_TSDR_MU_2 ((uint32_t)0x00000400)
  2927. #define RTC_TSDR_MU_3 ((uint32_t)0x00000800)
  2928. #define RTC_TSDR_DT ((uint32_t)0x00000030)
  2929. #define RTC_TSDR_DT_0 ((uint32_t)0x00000010)
  2930. #define RTC_TSDR_DT_1 ((uint32_t)0x00000020)
  2931. #define RTC_TSDR_DU ((uint32_t)0x0000000F)
  2932. #define RTC_TSDR_DU_0 ((uint32_t)0x00000001)
  2933. #define RTC_TSDR_DU_1 ((uint32_t)0x00000002)
  2934. #define RTC_TSDR_DU_2 ((uint32_t)0x00000004)
  2935. #define RTC_TSDR_DU_3 ((uint32_t)0x00000008)
  2936. /******************** Bits definition for RTC_TSSSR register ****************/
  2937. #define RTC_TSSSR_SS ((uint32_t)0x0000FFFF)
  2938. /******************** Bits definition for RTC_CAL register *****************/
  2939. #define RTC_CALR_CALP ((uint32_t)0x00008000)
  2940. #define RTC_CALR_CALW8 ((uint32_t)0x00004000)
  2941. #define RTC_CALR_CALW16 ((uint32_t)0x00002000)
  2942. #define RTC_CALR_CALM ((uint32_t)0x000001FF)
  2943. #define RTC_CALR_CALM_0 ((uint32_t)0x00000001)
  2944. #define RTC_CALR_CALM_1 ((uint32_t)0x00000002)
  2945. #define RTC_CALR_CALM_2 ((uint32_t)0x00000004)
  2946. #define RTC_CALR_CALM_3 ((uint32_t)0x00000008)
  2947. #define RTC_CALR_CALM_4 ((uint32_t)0x00000010)
  2948. #define RTC_CALR_CALM_5 ((uint32_t)0x00000020)
  2949. #define RTC_CALR_CALM_6 ((uint32_t)0x00000040)
  2950. #define RTC_CALR_CALM_7 ((uint32_t)0x00000080)
  2951. #define RTC_CALR_CALM_8 ((uint32_t)0x00000100)
  2952. /******************** Bits definition for RTC_TAFCR register ****************/
  2953. #define RTC_TAFCR_ALARMOUTTYPE ((uint32_t)0x00040000)
  2954. #define RTC_TAFCR_TAMPPUDIS ((uint32_t)0x00008000)
  2955. #define RTC_TAFCR_TAMPPRCH ((uint32_t)0x00006000)
  2956. #define RTC_TAFCR_TAMPPRCH_0 ((uint32_t)0x00002000)
  2957. #define RTC_TAFCR_TAMPPRCH_1 ((uint32_t)0x00004000)
  2958. #define RTC_TAFCR_TAMPFLT ((uint32_t)0x00001800)
  2959. #define RTC_TAFCR_TAMPFLT_0 ((uint32_t)0x00000800)
  2960. #define RTC_TAFCR_TAMPFLT_1 ((uint32_t)0x00001000)
  2961. #define RTC_TAFCR_TAMPFREQ ((uint32_t)0x00000700)
  2962. #define RTC_TAFCR_TAMPFREQ_0 ((uint32_t)0x00000100)
  2963. #define RTC_TAFCR_TAMPFREQ_1 ((uint32_t)0x00000200)
  2964. #define RTC_TAFCR_TAMPFREQ_2 ((uint32_t)0x00000400)
  2965. #define RTC_TAFCR_TAMPTS ((uint32_t)0x00000080)
  2966. #define RTC_TAFCR_TAMP3TRG ((uint32_t)0x00000040)
  2967. #define RTC_TAFCR_TAMP3E ((uint32_t)0x00000020)
  2968. #define RTC_TAFCR_TAMP2TRG ((uint32_t)0x00000010)
  2969. #define RTC_TAFCR_TAMP2E ((uint32_t)0x00000008)
  2970. #define RTC_TAFCR_TAMPIE ((uint32_t)0x00000004)
  2971. #define RTC_TAFCR_TAMP1TRG ((uint32_t)0x00000002)
  2972. #define RTC_TAFCR_TAMP1E ((uint32_t)0x00000001)
  2973. /******************** Bits definition for RTC_ALRMASSR register *************/
  2974. #define RTC_ALRMASSR_MASKSS ((uint32_t)0x0F000000)
  2975. #define RTC_ALRMASSR_MASKSS_0 ((uint32_t)0x01000000)
  2976. #define RTC_ALRMASSR_MASKSS_1 ((uint32_t)0x02000000)
  2977. #define RTC_ALRMASSR_MASKSS_2 ((uint32_t)0x04000000)
  2978. #define RTC_ALRMASSR_MASKSS_3 ((uint32_t)0x08000000)
  2979. #define RTC_ALRMASSR_SS ((uint32_t)0x00007FFF)
  2980. /******************** Bits definition for RTC_ALRMBSSR register *************/
  2981. #define RTC_ALRMBSSR_MASKSS ((uint32_t)0x0F000000)
  2982. #define RTC_ALRMBSSR_MASKSS_0 ((uint32_t)0x01000000)
  2983. #define RTC_ALRMBSSR_MASKSS_1 ((uint32_t)0x02000000)
  2984. #define RTC_ALRMBSSR_MASKSS_2 ((uint32_t)0x04000000)
  2985. #define RTC_ALRMBSSR_MASKSS_3 ((uint32_t)0x08000000)
  2986. #define RTC_ALRMBSSR_SS ((uint32_t)0x00007FFF)
  2987. /******************** Bits definition for RTC_BKP0R register ****************/
  2988. #define RTC_BKP0R ((uint32_t)0xFFFFFFFF)
  2989. /******************** Bits definition for RTC_BKP1R register ****************/
  2990. #define RTC_BKP1R ((uint32_t)0xFFFFFFFF)
  2991. /******************** Bits definition for RTC_BKP2R register ****************/
  2992. #define RTC_BKP2R ((uint32_t)0xFFFFFFFF)
  2993. /******************** Bits definition for RTC_BKP3R register ****************/
  2994. #define RTC_BKP3R ((uint32_t)0xFFFFFFFF)
  2995. /******************** Bits definition for RTC_BKP4R register ****************/
  2996. #define RTC_BKP4R ((uint32_t)0xFFFFFFFF)
  2997. /******************** Bits definition for RTC_BKP5R register ****************/
  2998. #define RTC_BKP5R ((uint32_t)0xFFFFFFFF)
  2999. /******************** Bits definition for RTC_BKP6R register ****************/
  3000. #define RTC_BKP6R ((uint32_t)0xFFFFFFFF)
  3001. /******************** Bits definition for RTC_BKP7R register ****************/
  3002. #define RTC_BKP7R ((uint32_t)0xFFFFFFFF)
  3003. /******************** Bits definition for RTC_BKP8R register ****************/
  3004. #define RTC_BKP8R ((uint32_t)0xFFFFFFFF)
  3005. /******************** Bits definition for RTC_BKP9R register ****************/
  3006. #define RTC_BKP9R ((uint32_t)0xFFFFFFFF)
  3007. /******************** Bits definition for RTC_BKP10R register ***************/
  3008. #define RTC_BKP10R ((uint32_t)0xFFFFFFFF)
  3009. /******************** Bits definition for RTC_BKP11R register ***************/
  3010. #define RTC_BKP11R ((uint32_t)0xFFFFFFFF)
  3011. /******************** Bits definition for RTC_BKP12R register ***************/
  3012. #define RTC_BKP12R ((uint32_t)0xFFFFFFFF)
  3013. /******************** Bits definition for RTC_BKP13R register ***************/
  3014. #define RTC_BKP13R ((uint32_t)0xFFFFFFFF)
  3015. /******************** Bits definition for RTC_BKP14R register ***************/
  3016. #define RTC_BKP14R ((uint32_t)0xFFFFFFFF)
  3017. /******************** Bits definition for RTC_BKP15R register ***************/
  3018. #define RTC_BKP15R ((uint32_t)0xFFFFFFFF)
  3019. /******************** Bits definition for RTC_BKP16R register ***************/
  3020. #define RTC_BKP16R ((uint32_t)0xFFFFFFFF)
  3021. /******************** Bits definition for RTC_BKP17R register ***************/
  3022. #define RTC_BKP17R ((uint32_t)0xFFFFFFFF)
  3023. /******************** Bits definition for RTC_BKP18R register ***************/
  3024. #define RTC_BKP18R ((uint32_t)0xFFFFFFFF)
  3025. /******************** Bits definition for RTC_BKP19R register ***************/
  3026. #define RTC_BKP19R ((uint32_t)0xFFFFFFFF)
  3027. /******************** Bits definition for RTC_BKP20R register ***************/
  3028. #define RTC_BKP20R ((uint32_t)0xFFFFFFFF)
  3029. /******************** Bits definition for RTC_BKP21R register ***************/
  3030. #define RTC_BKP21R ((uint32_t)0xFFFFFFFF)
  3031. /******************** Bits definition for RTC_BKP22R register ***************/
  3032. #define RTC_BKP22R ((uint32_t)0xFFFFFFFF)
  3033. /******************** Bits definition for RTC_BKP23R register ***************/
  3034. #define RTC_BKP23R ((uint32_t)0xFFFFFFFF)
  3035. /******************** Bits definition for RTC_BKP24R register ***************/
  3036. #define RTC_BKP24R ((uint32_t)0xFFFFFFFF)
  3037. /******************** Bits definition for RTC_BKP25R register ***************/
  3038. #define RTC_BKP25R ((uint32_t)0xFFFFFFFF)
  3039. /******************** Bits definition for RTC_BKP26R register ***************/
  3040. #define RTC_BKP26R ((uint32_t)0xFFFFFFFF)
  3041. /******************** Bits definition for RTC_BKP27R register ***************/
  3042. #define RTC_BKP27R ((uint32_t)0xFFFFFFFF)
  3043. /******************** Bits definition for RTC_BKP28R register ***************/
  3044. #define RTC_BKP28R ((uint32_t)0xFFFFFFFF)
  3045. /******************** Bits definition for RTC_BKP29R register ***************/
  3046. #define RTC_BKP29R ((uint32_t)0xFFFFFFFF)
  3047. /******************** Bits definition for RTC_BKP30R register ***************/
  3048. #define RTC_BKP30R ((uint32_t)0xFFFFFFFF)
  3049. /******************** Bits definition for RTC_BKP31R register ***************/
  3050. #define RTC_BKP31R ((uint32_t)0xFFFFFFFF)
  3051. /******************** Number of backup registers ******************************/
  3052. #define RTC_BKP_NUMBER 32
  3053. /******************************************************************************/
  3054. /* */
  3055. /* SD host Interface */
  3056. /* */
  3057. /******************************************************************************/
  3058. /****************** Bit definition for SDIO_POWER register ******************/
  3059. #define SDIO_POWER_PWRCTRL ((uint32_t)0x00000003) /*!< PWRCTRL[1:0] bits (Power supply control bits) */
  3060. #define SDIO_POWER_PWRCTRL_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3061. #define SDIO_POWER_PWRCTRL_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3062. /****************** Bit definition for SDIO_CLKCR register ******************/
  3063. #define SDIO_CLKCR_CLKDIV ((uint32_t)0x000000FF) /*!< Clock divide factor */
  3064. #define SDIO_CLKCR_CLKEN ((uint32_t)0x00000100) /*!< Clock enable bit */
  3065. #define SDIO_CLKCR_PWRSAV ((uint32_t)0x00000200) /*!< Power saving configuration bit */
  3066. #define SDIO_CLKCR_BYPASS ((uint32_t)0x00000400) /*!< Clock divider bypass enable bit */
  3067. #define SDIO_CLKCR_WIDBUS ((uint32_t)0x00001800) /*!< WIDBUS[1:0] bits (Wide bus mode enable bit) */
  3068. #define SDIO_CLKCR_WIDBUS_0 ((uint32_t)0x00000800) /*!< Bit 0 */
  3069. #define SDIO_CLKCR_WIDBUS_1 ((uint32_t)0x00001000) /*!< Bit 1 */
  3070. #define SDIO_CLKCR_NEGEDGE ((uint32_t)0x00002000) /*!< SDIO_CK dephasing selection bit */
  3071. #define SDIO_CLKCR_HWFC_EN ((uint32_t)0x00004000) /*!< HW Flow Control enable */
  3072. /******************* Bit definition for SDIO_ARG register *******************/
  3073. #define SDIO_ARG_CMDARG ((uint32_t)0xFFFFFFFF) /*!< Command argument */
  3074. /******************* Bit definition for SDIO_CMD register *******************/
  3075. #define SDIO_CMD_CMDINDEX ((uint32_t)0x0000003F) /*!< Command Index */
  3076. #define SDIO_CMD_WAITRESP ((uint32_t)0x000000C0) /*!< WAITRESP[1:0] bits (Wait for response bits) */
  3077. #define SDIO_CMD_WAITRESP_0 ((uint32_t)0x00000040) /*!< Bit 0 */
  3078. #define SDIO_CMD_WAITRESP_1 ((uint32_t)0x00000080) /*!< Bit 1 */
  3079. #define SDIO_CMD_WAITINT ((uint32_t)0x00000100) /*!< CPSM Waits for Interrupt Request */
  3080. #define SDIO_CMD_WAITPEND ((uint32_t)0x00000200) /*!< CPSM Waits for ends of data transfer (CmdPend internal signal) */
  3081. #define SDIO_CMD_CPSMEN ((uint32_t)0x00000400) /*!< Command path state machine (CPSM) Enable bit */
  3082. #define SDIO_CMD_SDIOSUSPEND ((uint32_t)0x00000800) /*!< SD I/O suspend command */
  3083. #define SDIO_CMD_ENCMDCOMPL ((uint32_t)0x00001000) /*!< Enable CMD completion */
  3084. #define SDIO_CMD_NIEN ((uint32_t)0x00002000) /*!< Not Interrupt Enable */
  3085. #define SDIO_CMD_CEATACMD ((uint32_t)0x00004000) /*!< CE-ATA command */
  3086. /***************** Bit definition for SDIO_RESPCMD register *****************/
  3087. #define SDIO_RESPCMD_RESPCMD ((uint32_t)0x0000003F) /*!< Response command index */
  3088. /****************** Bit definition for SDIO_RESP0 register ******************/
  3089. #define SDIO_RESP0_CARDSTATUS0 ((uint32_t)0xFFFFFFFF) /*!< Card Status */
  3090. /****************** Bit definition for SDIO_RESP1 register ******************/
  3091. #define SDIO_RESP1_CARDSTATUS1 ((uint32_t)0xFFFFFFFF) /*!< Card Status */
  3092. /****************** Bit definition for SDIO_RESP2 register ******************/
  3093. #define SDIO_RESP2_CARDSTATUS2 ((uint32_t)0xFFFFFFFF) /*!< Card Status */
  3094. /****************** Bit definition for SDIO_RESP3 register ******************/
  3095. #define SDIO_RESP3_CARDSTATUS3 ((uint32_t)0xFFFFFFFF) /*!< Card Status */
  3096. /****************** Bit definition for SDIO_RESP4 register ******************/
  3097. #define SDIO_RESP4_CARDSTATUS4 ((uint32_t)0xFFFFFFFF) /*!< Card Status */
  3098. /****************** Bit definition for SDIO_DTIMER register *****************/
  3099. #define SDIO_DTIMER_DATATIME ((uint32_t)0xFFFFFFFF) /*!< Data timeout period. */
  3100. /****************** Bit definition for SDIO_DLEN register *******************/
  3101. #define SDIO_DLEN_DATALENGTH ((uint32_t)0x01FFFFFF) /*!< Data length value */
  3102. /****************** Bit definition for SDIO_DCTRL register ******************/
  3103. #define SDIO_DCTRL_DTEN ((uint32_t)0x00000001) /*!< Data transfer enabled bit */
  3104. #define SDIO_DCTRL_DTDIR ((uint32_t)0x00000002) /*!< Data transfer direction selection */
  3105. #define SDIO_DCTRL_DTMODE ((uint32_t)0x00000004) /*!< Data transfer mode selection */
  3106. #define SDIO_DCTRL_DMAEN ((uint32_t)0x00000008) /*!< DMA enabled bit */
  3107. #define SDIO_DCTRL_DBLOCKSIZE ((uint32_t)0x000000F0) /*!< DBLOCKSIZE[3:0] bits (Data block size) */
  3108. #define SDIO_DCTRL_DBLOCKSIZE_0 ((uint32_t)0x00000010) /*!< Bit 0 */
  3109. #define SDIO_DCTRL_DBLOCKSIZE_1 ((uint32_t)0x00000020) /*!< Bit 1 */
  3110. #define SDIO_DCTRL_DBLOCKSIZE_2 ((uint32_t)0x00000040) /*!< Bit 2 */
  3111. #define SDIO_DCTRL_DBLOCKSIZE_3 ((uint32_t)0x00000080) /*!< Bit 3 */
  3112. #define SDIO_DCTRL_RWSTART ((uint32_t)0x00000100) /*!< Read wait start */
  3113. #define SDIO_DCTRL_RWSTOP ((uint32_t)0x00000200) /*!< Read wait stop */
  3114. #define SDIO_DCTRL_RWMOD ((uint32_t)0x00000400) /*!< Read wait mode */
  3115. #define SDIO_DCTRL_SDIOEN ((uint32_t)0x00000800) /*!< SD I/O enable functions */
  3116. /****************** Bit definition for SDIO_DCOUNT register *****************/
  3117. #define SDIO_DCOUNT_DATACOUNT ((uint32_t)0x01FFFFFF) /*!< Data count value */
  3118. /****************** Bit definition for SDIO_STA register ********************/
  3119. #define SDIO_STA_CCRCFAIL ((uint32_t)0x00000001) /*!< Command response received (CRC check failed) */
  3120. #define SDIO_STA_DCRCFAIL ((uint32_t)0x00000002) /*!< Data block sent/received (CRC check failed) */
  3121. #define SDIO_STA_CTIMEOUT ((uint32_t)0x00000004) /*!< Command response timeout */
  3122. #define SDIO_STA_DTIMEOUT ((uint32_t)0x00000008) /*!< Data timeout */
  3123. #define SDIO_STA_TXUNDERR ((uint32_t)0x00000010) /*!< Transmit FIFO underrun error */
  3124. #define SDIO_STA_RXOVERR ((uint32_t)0x00000020) /*!< Received FIFO overrun error */
  3125. #define SDIO_STA_CMDREND ((uint32_t)0x00000040) /*!< Command response received (CRC check passed) */
  3126. #define SDIO_STA_CMDSENT ((uint32_t)0x00000080) /*!< Command sent (no response required) */
  3127. #define SDIO_STA_DATAEND ((uint32_t)0x00000100) /*!< Data end (data counter, SDIDCOUNT, is zero) */
  3128. #define SDIO_STA_STBITERR ((uint32_t)0x00000200) /*!< Start bit not detected on all data signals in wide bus mode */
  3129. #define SDIO_STA_DBCKEND ((uint32_t)0x00000400) /*!< Data block sent/received (CRC check passed) */
  3130. #define SDIO_STA_CMDACT ((uint32_t)0x00000800) /*!< Command transfer in progress */
  3131. #define SDIO_STA_TXACT ((uint32_t)0x00001000) /*!< Data transmit in progress */
  3132. #define SDIO_STA_RXACT ((uint32_t)0x00002000) /*!< Data receive in progress */
  3133. #define SDIO_STA_TXFIFOHE ((uint32_t)0x00004000) /*!< Transmit FIFO Half Empty: at least 8 words can be written into the FIFO */
  3134. #define SDIO_STA_RXFIFOHF ((uint32_t)0x00008000) /*!< Receive FIFO Half Full: there are at least 8 words in the FIFO */
  3135. #define SDIO_STA_TXFIFOF ((uint32_t)0x00010000) /*!< Transmit FIFO full */
  3136. #define SDIO_STA_RXFIFOF ((uint32_t)0x00020000) /*!< Receive FIFO full */
  3137. #define SDIO_STA_TXFIFOE ((uint32_t)0x00040000) /*!< Transmit FIFO empty */
  3138. #define SDIO_STA_RXFIFOE ((uint32_t)0x00080000) /*!< Receive FIFO empty */
  3139. #define SDIO_STA_TXDAVL ((uint32_t)0x00100000) /*!< Data available in transmit FIFO */
  3140. #define SDIO_STA_RXDAVL ((uint32_t)0x00200000) /*!< Data available in receive FIFO */
  3141. #define SDIO_STA_SDIOIT ((uint32_t)0x00400000) /*!< SDIO interrupt received */
  3142. #define SDIO_STA_CEATAEND ((uint32_t)0x00800000) /*!< CE-ATA command completion signal received for CMD61 */
  3143. /******************* Bit definition for SDIO_ICR register *******************/
  3144. #define SDIO_ICR_CCRCFAILC ((uint32_t)0x00000001) /*!< CCRCFAIL flag clear bit */
  3145. #define SDIO_ICR_DCRCFAILC ((uint32_t)0x00000002) /*!< DCRCFAIL flag clear bit */
  3146. #define SDIO_ICR_CTIMEOUTC ((uint32_t)0x00000004) /*!< CTIMEOUT flag clear bit */
  3147. #define SDIO_ICR_DTIMEOUTC ((uint32_t)0x00000008) /*!< DTIMEOUT flag clear bit */
  3148. #define SDIO_ICR_TXUNDERRC ((uint32_t)0x00000010) /*!< TXUNDERR flag clear bit */
  3149. #define SDIO_ICR_RXOVERRC ((uint32_t)0x00000020) /*!< RXOVERR flag clear bit */
  3150. #define SDIO_ICR_CMDRENDC ((uint32_t)0x00000040) /*!< CMDREND flag clear bit */
  3151. #define SDIO_ICR_CMDSENTC ((uint32_t)0x00000080) /*!< CMDSENT flag clear bit */
  3152. #define SDIO_ICR_DATAENDC ((uint32_t)0x00000100) /*!< DATAEND flag clear bit */
  3153. #define SDIO_ICR_STBITERRC ((uint32_t)0x00000200) /*!< STBITERR flag clear bit */
  3154. #define SDIO_ICR_DBCKENDC ((uint32_t)0x00000400) /*!< DBCKEND flag clear bit */
  3155. #define SDIO_ICR_SDIOITC ((uint32_t)0x00400000) /*!< SDIOIT flag clear bit */
  3156. #define SDIO_ICR_CEATAENDC ((uint32_t)0x00800000) /*!< CEATAEND flag clear bit */
  3157. /****************** Bit definition for SDIO_MASK register *******************/
  3158. #define SDIO_MASK_CCRCFAILIE ((uint32_t)0x00000001) /*!< Command CRC Fail Interrupt Enable */
  3159. #define SDIO_MASK_DCRCFAILIE ((uint32_t)0x00000002) /*!< Data CRC Fail Interrupt Enable */
  3160. #define SDIO_MASK_CTIMEOUTIE ((uint32_t)0x00000004) /*!< Command TimeOut Interrupt Enable */
  3161. #define SDIO_MASK_DTIMEOUTIE ((uint32_t)0x00000008) /*!< Data TimeOut Interrupt Enable */
  3162. #define SDIO_MASK_TXUNDERRIE ((uint32_t)0x00000010) /*!< Tx FIFO UnderRun Error Interrupt Enable */
  3163. #define SDIO_MASK_RXOVERRIE ((uint32_t)0x00000020) /*!< Rx FIFO OverRun Error Interrupt Enable */
  3164. #define SDIO_MASK_CMDRENDIE ((uint32_t)0x00000040) /*!< Command Response Received Interrupt Enable */
  3165. #define SDIO_MASK_CMDSENTIE ((uint32_t)0x00000080) /*!< Command Sent Interrupt Enable */
  3166. #define SDIO_MASK_DATAENDIE ((uint32_t)0x00000100) /*!< Data End Interrupt Enable */
  3167. #define SDIO_MASK_STBITERRIE ((uint32_t)0x00000200) /*!< Start Bit Error Interrupt Enable */
  3168. #define SDIO_MASK_DBCKENDIE ((uint32_t)0x00000400) /*!< Data Block End Interrupt Enable */
  3169. #define SDIO_MASK_CMDACTIE ((uint32_t)0x00000800) /*!< Command Acting Interrupt Enable */
  3170. #define SDIO_MASK_TXACTIE ((uint32_t)0x00001000) /*!< Data Transmit Acting Interrupt Enable */
  3171. #define SDIO_MASK_RXACTIE ((uint32_t)0x00002000) /*!< Data receive acting interrupt enabled */
  3172. #define SDIO_MASK_TXFIFOHEIE ((uint32_t)0x00004000) /*!< Tx FIFO Half Empty interrupt Enable */
  3173. #define SDIO_MASK_RXFIFOHFIE ((uint32_t)0x00008000) /*!< Rx FIFO Half Full interrupt Enable */
  3174. #define SDIO_MASK_TXFIFOFIE ((uint32_t)0x00010000) /*!< Tx FIFO Full interrupt Enable */
  3175. #define SDIO_MASK_RXFIFOFIE ((uint32_t)0x00020000) /*!< Rx FIFO Full interrupt Enable */
  3176. #define SDIO_MASK_TXFIFOEIE ((uint32_t)0x00040000) /*!< Tx FIFO Empty interrupt Enable */
  3177. #define SDIO_MASK_RXFIFOEIE ((uint32_t)0x00080000) /*!< Rx FIFO Empty interrupt Enable */
  3178. #define SDIO_MASK_TXDAVLIE ((uint32_t)0x00100000) /*!< Data available in Tx FIFO interrupt Enable */
  3179. #define SDIO_MASK_RXDAVLIE ((uint32_t)0x00200000) /*!< Data available in Rx FIFO interrupt Enable */
  3180. #define SDIO_MASK_SDIOITIE ((uint32_t)0x00400000) /*!< SDIO Mode Interrupt Received interrupt Enable */
  3181. #define SDIO_MASK_CEATAENDIE ((uint32_t)0x00800000) /*!< CE-ATA command completion signal received Interrupt Enable */
  3182. /***************** Bit definition for SDIO_FIFOCNT register *****************/
  3183. #define SDIO_FIFOCNT_FIFOCOUNT ((uint32_t)0x00FFFFFF) /*!< Remaining number of words to be written to or read from the FIFO */
  3184. /****************** Bit definition for SDIO_FIFO register *******************/
  3185. #define SDIO_FIFO_FIFODATA ((uint32_t)0xFFFFFFFF) /*!< Receive and transmit FIFO data */
  3186. /******************************************************************************/
  3187. /* */
  3188. /* Serial Peripheral Interface (SPI) */
  3189. /* */
  3190. /******************************************************************************/
  3191. /******************* Bit definition for SPI_CR1 register ********************/
  3192. #define SPI_CR1_CPHA ((uint32_t)0x00000001) /*!< Clock Phase */
  3193. #define SPI_CR1_CPOL ((uint32_t)0x00000002) /*!< Clock Polarity */
  3194. #define SPI_CR1_MSTR ((uint32_t)0x00000004) /*!< Master Selection */
  3195. #define SPI_CR1_BR ((uint32_t)0x00000038) /*!< BR[2:0] bits (Baud Rate Control) */
  3196. #define SPI_CR1_BR_0 ((uint32_t)0x00000008) /*!< Bit 0 */
  3197. #define SPI_CR1_BR_1 ((uint32_t)0x00000010) /*!< Bit 1 */
  3198. #define SPI_CR1_BR_2 ((uint32_t)0x00000020) /*!< Bit 2 */
  3199. #define SPI_CR1_SPE ((uint32_t)0x00000040) /*!< SPI Enable */
  3200. #define SPI_CR1_LSBFIRST ((uint32_t)0x00000080) /*!< Frame Format */
  3201. #define SPI_CR1_SSI ((uint32_t)0x00000100) /*!< Internal slave select */
  3202. #define SPI_CR1_SSM ((uint32_t)0x00000200) /*!< Software slave management */
  3203. #define SPI_CR1_RXONLY ((uint32_t)0x00000400) /*!< Receive only */
  3204. #define SPI_CR1_DFF ((uint32_t)0x00000800) /*!< Data Frame Format */
  3205. #define SPI_CR1_CRCNEXT ((uint32_t)0x00001000) /*!< Transmit CRC next */
  3206. #define SPI_CR1_CRCEN ((uint32_t)0x00002000) /*!< Hardware CRC calculation enable */
  3207. #define SPI_CR1_BIDIOE ((uint32_t)0x00004000) /*!< Output enable in bidirectional mode */
  3208. #define SPI_CR1_BIDIMODE ((uint32_t)0x00008000) /*!< Bidirectional data mode enable */
  3209. /******************* Bit definition for SPI_CR2 register ********************/
  3210. #define SPI_CR2_RXDMAEN ((uint32_t)0x00000001) /*!< Rx Buffer DMA Enable */
  3211. #define SPI_CR2_TXDMAEN ((uint32_t)0x00000002) /*!< Tx Buffer DMA Enable */
  3212. #define SPI_CR2_SSOE ((uint32_t)0x00000004) /*!< SS Output Enable */
  3213. #define SPI_CR2_FRF ((uint32_t)0x00000010) /*!< Frame format */
  3214. #define SPI_CR2_ERRIE ((uint32_t)0x00000020) /*!< Error Interrupt Enable */
  3215. #define SPI_CR2_RXNEIE ((uint32_t)0x00000040) /*!< RX buffer Not Empty Interrupt Enable */
  3216. #define SPI_CR2_TXEIE ((uint32_t)0x00000080) /*!< Tx buffer Empty Interrupt Enable */
  3217. /******************** Bit definition for SPI_SR register ********************/
  3218. #define SPI_SR_RXNE ((uint32_t)0x00000001) /*!< Receive buffer Not Empty */
  3219. #define SPI_SR_TXE ((uint32_t)0x00000002) /*!< Transmit buffer Empty */
  3220. #define SPI_SR_CHSIDE ((uint32_t)0x00000004) /*!< Channel side */
  3221. #define SPI_SR_UDR ((uint32_t)0x00000008) /*!< Underrun flag */
  3222. #define SPI_SR_CRCERR ((uint32_t)0x00000010) /*!< CRC Error flag */
  3223. #define SPI_SR_MODF ((uint32_t)0x00000020) /*!< Mode fault */
  3224. #define SPI_SR_OVR ((uint32_t)0x00000040) /*!< Overrun flag */
  3225. #define SPI_SR_BSY ((uint32_t)0x00000080) /*!< Busy flag */
  3226. #define SPI_SR_FRE ((uint32_t)0x00000100) /*!<Frame format error flag */
  3227. /******************** Bit definition for SPI_DR register ********************/
  3228. #define SPI_DR_DR ((uint32_t)0x0000FFFF) /*!< Data Register */
  3229. /******************* Bit definition for SPI_CRCPR register ******************/
  3230. #define SPI_CRCPR_CRCPOLY ((uint32_t)0x0000FFFF) /*!< CRC polynomial register */
  3231. /****************** Bit definition for SPI_RXCRCR register ******************/
  3232. #define SPI_RXCRCR_RXCRC ((uint32_t)0x0000FFFF) /*!< Rx CRC Register */
  3233. /****************** Bit definition for SPI_TXCRCR register ******************/
  3234. #define SPI_TXCRCR_TXCRC ((uint32_t)0x0000FFFF) /*!< Tx CRC Register */
  3235. /****************** Bit definition for SPI_I2SCFGR register *****************/
  3236. #define SPI_I2SCFGR_CHLEN ((uint32_t)0x00000001) /*!<Channel length (number of bits per audio channel) */
  3237. #define SPI_I2SCFGR_DATLEN ((uint32_t)0x00000006) /*!<DATLEN[1:0] bits (Data length to be transferred) */
  3238. #define SPI_I2SCFGR_DATLEN_0 ((uint32_t)0x00000002) /*!<Bit 0 */
  3239. #define SPI_I2SCFGR_DATLEN_1 ((uint32_t)0x00000004) /*!<Bit 1 */
  3240. #define SPI_I2SCFGR_CKPOL ((uint32_t)0x00000008) /*!<steady state clock polarity */
  3241. #define SPI_I2SCFGR_I2SSTD ((uint32_t)0x00000030) /*!<I2SSTD[1:0] bits (I2S standard selection) */
  3242. #define SPI_I2SCFGR_I2SSTD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3243. #define SPI_I2SCFGR_I2SSTD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3244. #define SPI_I2SCFGR_PCMSYNC ((uint32_t)0x00000080) /*!<PCM frame synchronization */
  3245. #define SPI_I2SCFGR_I2SCFG ((uint32_t)0x00000300) /*!<I2SCFG[1:0] bits (I2S configuration mode) */
  3246. #define SPI_I2SCFGR_I2SCFG_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3247. #define SPI_I2SCFGR_I2SCFG_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3248. #define SPI_I2SCFGR_I2SE ((uint32_t)0x00000400) /*!<I2S Enable */
  3249. #define SPI_I2SCFGR_I2SMOD ((uint32_t)0x00000800) /*!<I2S mode selection */
  3250. /****************** Bit definition for SPI_I2SPR register *******************/
  3251. #define SPI_I2SPR_I2SDIV ((uint32_t)0x000000FF) /*!<I2S Linear prescaler */
  3252. #define SPI_I2SPR_ODD ((uint32_t)0x00000100) /*!<Odd factor for the prescaler */
  3253. #define SPI_I2SPR_MCKOE ((uint32_t)0x00000200) /*!<Master Clock Output Enable */
  3254. /******************************************************************************/
  3255. /* */
  3256. /* System Configuration (SYSCFG) */
  3257. /* */
  3258. /******************************************************************************/
  3259. /***************** Bit definition for SYSCFG_MEMRMP register ****************/
  3260. #define SYSCFG_MEMRMP_MEM_MODE ((uint32_t)0x00000003) /*!< SYSCFG_Memory Remap Config */
  3261. #define SYSCFG_MEMRMP_MEM_MODE_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3262. #define SYSCFG_MEMRMP_MEM_MODE_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3263. #define SYSCFG_MEMRMP_BOOT_MODE ((uint32_t)0x00000300) /*!< Boot mode Config */
  3264. #define SYSCFG_MEMRMP_BOOT_MODE_0 ((uint32_t)0x00000100) /*!< Bit 0 */
  3265. #define SYSCFG_MEMRMP_BOOT_MODE_1 ((uint32_t)0x00000200) /*!< Bit 1 */
  3266. /***************** Bit definition for SYSCFG_PMC register *******************/
  3267. #define SYSCFG_PMC_USB_PU ((uint32_t)0x00000001) /*!< SYSCFG PMC */
  3268. /***************** Bit definition for SYSCFG_EXTICR1 register ***************/
  3269. #define SYSCFG_EXTICR1_EXTI0 ((uint32_t)0x0000000F) /*!< EXTI 0 configuration */
  3270. #define SYSCFG_EXTICR1_EXTI1 ((uint32_t)0x000000F0) /*!< EXTI 1 configuration */
  3271. #define SYSCFG_EXTICR1_EXTI2 ((uint32_t)0x00000F00) /*!< EXTI 2 configuration */
  3272. #define SYSCFG_EXTICR1_EXTI3 ((uint32_t)0x0000F000) /*!< EXTI 3 configuration */
  3273. /**
  3274. * @brief EXTI0 configuration
  3275. */
  3276. #define SYSCFG_EXTICR1_EXTI0_PA ((uint32_t)0x00000000) /*!< PA[0] pin */
  3277. #define SYSCFG_EXTICR1_EXTI0_PB ((uint32_t)0x00000001) /*!< PB[0] pin */
  3278. #define SYSCFG_EXTICR1_EXTI0_PC ((uint32_t)0x00000002) /*!< PC[0] pin */
  3279. #define SYSCFG_EXTICR1_EXTI0_PD ((uint32_t)0x00000003) /*!< PD[0] pin */
  3280. #define SYSCFG_EXTICR1_EXTI0_PE ((uint32_t)0x00000004) /*!< PE[0] pin */
  3281. #define SYSCFG_EXTICR1_EXTI0_PH ((uint32_t)0x00000005) /*!< PH[0] pin */
  3282. #define SYSCFG_EXTICR1_EXTI0_PF ((uint32_t)0x00000006) /*!< PF[0] pin */
  3283. #define SYSCFG_EXTICR1_EXTI0_PG ((uint32_t)0x00000007) /*!< PG[0] pin */
  3284. /**
  3285. * @brief EXTI1 configuration
  3286. */
  3287. #define SYSCFG_EXTICR1_EXTI1_PA ((uint32_t)0x00000000) /*!< PA[1] pin */
  3288. #define SYSCFG_EXTICR1_EXTI1_PB ((uint32_t)0x00000010) /*!< PB[1] pin */
  3289. #define SYSCFG_EXTICR1_EXTI1_PC ((uint32_t)0x00000020) /*!< PC[1] pin */
  3290. #define SYSCFG_EXTICR1_EXTI1_PD ((uint32_t)0x00000030) /*!< PD[1] pin */
  3291. #define SYSCFG_EXTICR1_EXTI1_PE ((uint32_t)0x00000040) /*!< PE[1] pin */
  3292. #define SYSCFG_EXTICR1_EXTI1_PH ((uint32_t)0x00000050) /*!< PH[1] pin */
  3293. #define SYSCFG_EXTICR1_EXTI1_PF ((uint32_t)0x00000060) /*!< PF[1] pin */
  3294. #define SYSCFG_EXTICR1_EXTI1_PG ((uint32_t)0x00000070) /*!< PG[1] pin */
  3295. /**
  3296. * @brief EXTI2 configuration
  3297. */
  3298. #define SYSCFG_EXTICR1_EXTI2_PA ((uint32_t)0x00000000) /*!< PA[2] pin */
  3299. #define SYSCFG_EXTICR1_EXTI2_PB ((uint32_t)0x00000100) /*!< PB[2] pin */
  3300. #define SYSCFG_EXTICR1_EXTI2_PC ((uint32_t)0x00000200) /*!< PC[2] pin */
  3301. #define SYSCFG_EXTICR1_EXTI2_PD ((uint32_t)0x00000300) /*!< PD[2] pin */
  3302. #define SYSCFG_EXTICR1_EXTI2_PE ((uint32_t)0x00000400) /*!< PE[2] pin */
  3303. #define SYSCFG_EXTICR1_EXTI2_PH ((uint32_t)0x00000500) /*!< PH[2] pin */
  3304. #define SYSCFG_EXTICR1_EXTI2_PF ((uint32_t)0x00000600) /*!< PF[2] pin */
  3305. #define SYSCFG_EXTICR1_EXTI2_PG ((uint32_t)0x00000700) /*!< PG[2] pin */
  3306. /**
  3307. * @brief EXTI3 configuration
  3308. */
  3309. #define SYSCFG_EXTICR1_EXTI3_PA ((uint32_t)0x00000000) /*!< PA[3] pin */
  3310. #define SYSCFG_EXTICR1_EXTI3_PB ((uint32_t)0x00001000) /*!< PB[3] pin */
  3311. #define SYSCFG_EXTICR1_EXTI3_PC ((uint32_t)0x00002000) /*!< PC[3] pin */
  3312. #define SYSCFG_EXTICR1_EXTI3_PD ((uint32_t)0x00003000) /*!< PD[3] pin */
  3313. #define SYSCFG_EXTICR1_EXTI3_PE ((uint32_t)0x00004000) /*!< PE[3] pin */
  3314. #define SYSCFG_EXTICR1_EXTI3_PF ((uint32_t)0x00003000) /*!< PF[3] pin */
  3315. #define SYSCFG_EXTICR1_EXTI3_PG ((uint32_t)0x00004000) /*!< PG[3] pin */
  3316. /***************** Bit definition for SYSCFG_EXTICR2 register *****************/
  3317. #define SYSCFG_EXTICR2_EXTI4 ((uint32_t)0x0000000F) /*!< EXTI 4 configuration */
  3318. #define SYSCFG_EXTICR2_EXTI5 ((uint32_t)0x000000F0) /*!< EXTI 5 configuration */
  3319. #define SYSCFG_EXTICR2_EXTI6 ((uint32_t)0x00000F00) /*!< EXTI 6 configuration */
  3320. #define SYSCFG_EXTICR2_EXTI7 ((uint32_t)0x0000F000) /*!< EXTI 7 configuration */
  3321. /**
  3322. * @brief EXTI4 configuration
  3323. */
  3324. #define SYSCFG_EXTICR2_EXTI4_PA ((uint32_t)0x00000000) /*!< PA[4] pin */
  3325. #define SYSCFG_EXTICR2_EXTI4_PB ((uint32_t)0x00000001) /*!< PB[4] pin */
  3326. #define SYSCFG_EXTICR2_EXTI4_PC ((uint32_t)0x00000002) /*!< PC[4] pin */
  3327. #define SYSCFG_EXTICR2_EXTI4_PD ((uint32_t)0x00000003) /*!< PD[4] pin */
  3328. #define SYSCFG_EXTICR2_EXTI4_PE ((uint32_t)0x00000004) /*!< PE[4] pin */
  3329. #define SYSCFG_EXTICR2_EXTI4_PF ((uint32_t)0x00000006) /*!< PF[4] pin */
  3330. #define SYSCFG_EXTICR2_EXTI4_PG ((uint32_t)0x00000007) /*!< PG[4] pin */
  3331. /**
  3332. * @brief EXTI5 configuration
  3333. */
  3334. #define SYSCFG_EXTICR2_EXTI5_PA ((uint32_t)0x00000000) /*!< PA[5] pin */
  3335. #define SYSCFG_EXTICR2_EXTI5_PB ((uint32_t)0x00000010) /*!< PB[5] pin */
  3336. #define SYSCFG_EXTICR2_EXTI5_PC ((uint32_t)0x00000020) /*!< PC[5] pin */
  3337. #define SYSCFG_EXTICR2_EXTI5_PD ((uint32_t)0x00000030) /*!< PD[5] pin */
  3338. #define SYSCFG_EXTICR2_EXTI5_PE ((uint32_t)0x00000040) /*!< PE[5] pin */
  3339. #define SYSCFG_EXTICR2_EXTI5_PF ((uint32_t)0x00000060) /*!< PF[5] pin */
  3340. #define SYSCFG_EXTICR2_EXTI5_PG ((uint32_t)0x00000070) /*!< PG[5] pin */
  3341. /**
  3342. * @brief EXTI6 configuration
  3343. */
  3344. #define SYSCFG_EXTICR2_EXTI6_PA ((uint32_t)0x00000000) /*!< PA[6] pin */
  3345. #define SYSCFG_EXTICR2_EXTI6_PB ((uint32_t)0x00000100) /*!< PB[6] pin */
  3346. #define SYSCFG_EXTICR2_EXTI6_PC ((uint32_t)0x00000200) /*!< PC[6] pin */
  3347. #define SYSCFG_EXTICR2_EXTI6_PD ((uint32_t)0x00000300) /*!< PD[6] pin */
  3348. #define SYSCFG_EXTICR2_EXTI6_PE ((uint32_t)0x00000400) /*!< PE[6] pin */
  3349. #define SYSCFG_EXTICR2_EXTI6_PF ((uint32_t)0x00000600) /*!< PF[6] pin */
  3350. #define SYSCFG_EXTICR2_EXTI6_PG ((uint32_t)0x00000700) /*!< PG[6] pin */
  3351. /**
  3352. * @brief EXTI7 configuration
  3353. */
  3354. #define SYSCFG_EXTICR2_EXTI7_PA ((uint32_t)0x00000000) /*!< PA[7] pin */
  3355. #define SYSCFG_EXTICR2_EXTI7_PB ((uint32_t)0x00001000) /*!< PB[7] pin */
  3356. #define SYSCFG_EXTICR2_EXTI7_PC ((uint32_t)0x00002000) /*!< PC[7] pin */
  3357. #define SYSCFG_EXTICR2_EXTI7_PD ((uint32_t)0x00003000) /*!< PD[7] pin */
  3358. #define SYSCFG_EXTICR2_EXTI7_PE ((uint32_t)0x00004000) /*!< PE[7] pin */
  3359. #define SYSCFG_EXTICR2_EXTI7_PF ((uint32_t)0x00006000) /*!< PF[7] pin */
  3360. #define SYSCFG_EXTICR2_EXTI7_PG ((uint32_t)0x00007000) /*!< PG[7] pin */
  3361. /***************** Bit definition for SYSCFG_EXTICR3 register *****************/
  3362. #define SYSCFG_EXTICR3_EXTI8 ((uint32_t)0x0000000F) /*!< EXTI 8 configuration */
  3363. #define SYSCFG_EXTICR3_EXTI9 ((uint32_t)0x000000F0) /*!< EXTI 9 configuration */
  3364. #define SYSCFG_EXTICR3_EXTI10 ((uint32_t)0x00000F00) /*!< EXTI 10 configuration */
  3365. #define SYSCFG_EXTICR3_EXTI11 ((uint32_t)0x0000F000) /*!< EXTI 11 configuration */
  3366. /**
  3367. * @brief EXTI8 configuration
  3368. */
  3369. #define SYSCFG_EXTICR3_EXTI8_PA ((uint32_t)0x00000000) /*!< PA[8] pin */
  3370. #define SYSCFG_EXTICR3_EXTI8_PB ((uint32_t)0x00000001) /*!< PB[8] pin */
  3371. #define SYSCFG_EXTICR3_EXTI8_PC ((uint32_t)0x00000002) /*!< PC[8] pin */
  3372. #define SYSCFG_EXTICR3_EXTI8_PD ((uint32_t)0x00000003) /*!< PD[8] pin */
  3373. #define SYSCFG_EXTICR3_EXTI8_PE ((uint32_t)0x00000004) /*!< PE[8] pin */
  3374. #define SYSCFG_EXTICR3_EXTI8_PF ((uint32_t)0x00000006) /*!< PF[8] pin */
  3375. #define SYSCFG_EXTICR3_EXTI8_PG ((uint32_t)0x00000007) /*!< PG[8] pin */
  3376. /**
  3377. * @brief EXTI9 configuration
  3378. */
  3379. #define SYSCFG_EXTICR3_EXTI9_PA ((uint32_t)0x00000000) /*!< PA[9] pin */
  3380. #define SYSCFG_EXTICR3_EXTI9_PB ((uint32_t)0x00000010) /*!< PB[9] pin */
  3381. #define SYSCFG_EXTICR3_EXTI9_PC ((uint32_t)0x00000020) /*!< PC[9] pin */
  3382. #define SYSCFG_EXTICR3_EXTI9_PD ((uint32_t)0x00000030) /*!< PD[9] pin */
  3383. #define SYSCFG_EXTICR3_EXTI9_PE ((uint32_t)0x00000040) /*!< PE[9] pin */
  3384. #define SYSCFG_EXTICR3_EXTI9_PF ((uint32_t)0x00000060) /*!< PF[9] pin */
  3385. #define SYSCFG_EXTICR3_EXTI9_PG ((uint32_t)0x00000070) /*!< PG[9] pin */
  3386. /**
  3387. * @brief EXTI10 configuration
  3388. */
  3389. #define SYSCFG_EXTICR3_EXTI10_PA ((uint32_t)0x00000000) /*!< PA[10] pin */
  3390. #define SYSCFG_EXTICR3_EXTI10_PB ((uint32_t)0x00000100) /*!< PB[10] pin */
  3391. #define SYSCFG_EXTICR3_EXTI10_PC ((uint32_t)0x00000200) /*!< PC[10] pin */
  3392. #define SYSCFG_EXTICR3_EXTI10_PD ((uint32_t)0x00000300) /*!< PD[10] pin */
  3393. #define SYSCFG_EXTICR3_EXTI10_PE ((uint32_t)0x00000400) /*!< PE[10] pin */
  3394. #define SYSCFG_EXTICR3_EXTI10_PF ((uint32_t)0x00000600) /*!< PF[10] pin */
  3395. #define SYSCFG_EXTICR3_EXTI10_PG ((uint32_t)0x00000700) /*!< PG[10] pin */
  3396. /**
  3397. * @brief EXTI11 configuration
  3398. */
  3399. #define SYSCFG_EXTICR3_EXTI11_PA ((uint32_t)0x00000000) /*!< PA[11] pin */
  3400. #define SYSCFG_EXTICR3_EXTI11_PB ((uint32_t)0x00001000) /*!< PB[11] pin */
  3401. #define SYSCFG_EXTICR3_EXTI11_PC ((uint32_t)0x00002000) /*!< PC[11] pin */
  3402. #define SYSCFG_EXTICR3_EXTI11_PD ((uint32_t)0x00003000) /*!< PD[11] pin */
  3403. #define SYSCFG_EXTICR3_EXTI11_PE ((uint32_t)0x00004000) /*!< PE[11] pin */
  3404. #define SYSCFG_EXTICR3_EXTI11_PF ((uint32_t)0x00006000) /*!< PF[11] pin */
  3405. #define SYSCFG_EXTICR3_EXTI11_PG ((uint32_t)0x00007000) /*!< PG[11] pin */
  3406. /***************** Bit definition for SYSCFG_EXTICR4 register *****************/
  3407. #define SYSCFG_EXTICR4_EXTI12 ((uint32_t)0x0000000F) /*!< EXTI 12 configuration */
  3408. #define SYSCFG_EXTICR4_EXTI13 ((uint32_t)0x000000F0) /*!< EXTI 13 configuration */
  3409. #define SYSCFG_EXTICR4_EXTI14 ((uint32_t)0x00000F00) /*!< EXTI 14 configuration */
  3410. #define SYSCFG_EXTICR4_EXTI15 ((uint32_t)0x0000F000) /*!< EXTI 15 configuration */
  3411. /**
  3412. * @brief EXTI12 configuration
  3413. */
  3414. #define SYSCFG_EXTICR4_EXTI12_PA ((uint32_t)0x00000000) /*!< PA[12] pin */
  3415. #define SYSCFG_EXTICR4_EXTI12_PB ((uint32_t)0x00000001) /*!< PB[12] pin */
  3416. #define SYSCFG_EXTICR4_EXTI12_PC ((uint32_t)0x00000002) /*!< PC[12] pin */
  3417. #define SYSCFG_EXTICR4_EXTI12_PD ((uint32_t)0x00000003) /*!< PD[12] pin */
  3418. #define SYSCFG_EXTICR4_EXTI12_PE ((uint32_t)0x00000004) /*!< PE[12] pin */
  3419. #define SYSCFG_EXTICR4_EXTI12_PF ((uint32_t)0x00000006) /*!< PF[12] pin */
  3420. #define SYSCFG_EXTICR4_EXTI12_PG ((uint32_t)0x00000007) /*!< PG[12] pin */
  3421. /**
  3422. * @brief EXTI13 configuration
  3423. */
  3424. #define SYSCFG_EXTICR4_EXTI13_PA ((uint32_t)0x00000000) /*!< PA[13] pin */
  3425. #define SYSCFG_EXTICR4_EXTI13_PB ((uint32_t)0x00000010) /*!< PB[13] pin */
  3426. #define SYSCFG_EXTICR4_EXTI13_PC ((uint32_t)0x00000020) /*!< PC[13] pin */
  3427. #define SYSCFG_EXTICR4_EXTI13_PD ((uint32_t)0x00000030) /*!< PD[13] pin */
  3428. #define SYSCFG_EXTICR4_EXTI13_PE ((uint32_t)0x00000040) /*!< PE[13] pin */
  3429. #define SYSCFG_EXTICR4_EXTI13_PF ((uint32_t)0x00000060) /*!< PF[13] pin */
  3430. #define SYSCFG_EXTICR4_EXTI13_PG ((uint32_t)0x00000070) /*!< PG[13] pin */
  3431. /**
  3432. * @brief EXTI14 configuration
  3433. */
  3434. #define SYSCFG_EXTICR4_EXTI14_PA ((uint32_t)0x00000000) /*!< PA[14] pin */
  3435. #define SYSCFG_EXTICR4_EXTI14_PB ((uint32_t)0x00000100) /*!< PB[14] pin */
  3436. #define SYSCFG_EXTICR4_EXTI14_PC ((uint32_t)0x00000200) /*!< PC[14] pin */
  3437. #define SYSCFG_EXTICR4_EXTI14_PD ((uint32_t)0x00000300) /*!< PD[14] pin */
  3438. #define SYSCFG_EXTICR4_EXTI14_PE ((uint32_t)0x00000400) /*!< PE[14] pin */
  3439. #define SYSCFG_EXTICR4_EXTI14_PF ((uint32_t)0x00000600) /*!< PF[14] pin */
  3440. #define SYSCFG_EXTICR4_EXTI14_PG ((uint32_t)0x00000700) /*!< PG[14] pin */
  3441. /**
  3442. * @brief EXTI15 configuration
  3443. */
  3444. #define SYSCFG_EXTICR4_EXTI15_PA ((uint32_t)0x00000000) /*!< PA[15] pin */
  3445. #define SYSCFG_EXTICR4_EXTI15_PB ((uint32_t)0x00001000) /*!< PB[15] pin */
  3446. #define SYSCFG_EXTICR4_EXTI15_PC ((uint32_t)0x00002000) /*!< PC[15] pin */
  3447. #define SYSCFG_EXTICR4_EXTI15_PD ((uint32_t)0x00003000) /*!< PD[15] pin */
  3448. #define SYSCFG_EXTICR4_EXTI15_PE ((uint32_t)0x00004000) /*!< PE[15] pin */
  3449. #define SYSCFG_EXTICR4_EXTI15_PF ((uint32_t)0x00006000) /*!< PF[15] pin */
  3450. #define SYSCFG_EXTICR4_EXTI15_PG ((uint32_t)0x00007000) /*!< PG[15] pin */
  3451. /******************************************************************************/
  3452. /* */
  3453. /* Routing Interface (RI) */
  3454. /* */
  3455. /******************************************************************************/
  3456. /******************** Bit definition for RI_ICR register ********************/
  3457. #define RI_ICR_IC1OS ((uint32_t)0x0000000F) /*!< IC1OS[3:0] bits (Input Capture 1 select bits) */
  3458. #define RI_ICR_IC1OS_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3459. #define RI_ICR_IC1OS_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3460. #define RI_ICR_IC1OS_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3461. #define RI_ICR_IC1OS_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3462. #define RI_ICR_IC2OS ((uint32_t)0x000000F0) /*!< IC2OS[3:0] bits (Input Capture 2 select bits) */
  3463. #define RI_ICR_IC2OS_0 ((uint32_t)0x00000010) /*!< Bit 0 */
  3464. #define RI_ICR_IC2OS_1 ((uint32_t)0x00000020) /*!< Bit 1 */
  3465. #define RI_ICR_IC2OS_2 ((uint32_t)0x00000040) /*!< Bit 2 */
  3466. #define RI_ICR_IC2OS_3 ((uint32_t)0x00000080) /*!< Bit 3 */
  3467. #define RI_ICR_IC3OS ((uint32_t)0x00000F00) /*!< IC3OS[3:0] bits (Input Capture 3 select bits) */
  3468. #define RI_ICR_IC3OS_0 ((uint32_t)0x00000100) /*!< Bit 0 */
  3469. #define RI_ICR_IC3OS_1 ((uint32_t)0x00000200) /*!< Bit 1 */
  3470. #define RI_ICR_IC3OS_2 ((uint32_t)0x00000400) /*!< Bit 2 */
  3471. #define RI_ICR_IC3OS_3 ((uint32_t)0x00000800) /*!< Bit 3 */
  3472. #define RI_ICR_IC4OS ((uint32_t)0x0000F000) /*!< IC4OS[3:0] bits (Input Capture 4 select bits) */
  3473. #define RI_ICR_IC4OS_0 ((uint32_t)0x00001000) /*!< Bit 0 */
  3474. #define RI_ICR_IC4OS_1 ((uint32_t)0x00002000) /*!< Bit 1 */
  3475. #define RI_ICR_IC4OS_2 ((uint32_t)0x00004000) /*!< Bit 2 */
  3476. #define RI_ICR_IC4OS_3 ((uint32_t)0x00008000) /*!< Bit 3 */
  3477. #define RI_ICR_TIM ((uint32_t)0x00030000) /*!< TIM[3:0] bits (Timers select bits) */
  3478. #define RI_ICR_TIM_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  3479. #define RI_ICR_TIM_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  3480. #define RI_ICR_IC1 ((uint32_t)0x00040000) /*!< Input capture 1 */
  3481. #define RI_ICR_IC2 ((uint32_t)0x00080000) /*!< Input capture 2 */
  3482. #define RI_ICR_IC3 ((uint32_t)0x00100000) /*!< Input capture 3 */
  3483. #define RI_ICR_IC4 ((uint32_t)0x00200000) /*!< Input capture 4 */
  3484. /******************** Bit definition for RI_ASCR1 register ********************/
  3485. #define RI_ASCR1_CH ((uint32_t)0x7BFDFFFF) /*!< AS_CH[25:18] & AS_CH[15:0] bits ( Analog switches selection bits) */
  3486. #define RI_ASCR1_CH_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3487. #define RI_ASCR1_CH_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3488. #define RI_ASCR1_CH_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3489. #define RI_ASCR1_CH_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3490. #define RI_ASCR1_CH_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3491. #define RI_ASCR1_CH_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3492. #define RI_ASCR1_CH_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3493. #define RI_ASCR1_CH_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3494. #define RI_ASCR1_CH_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3495. #define RI_ASCR1_CH_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3496. #define RI_ASCR1_CH_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3497. #define RI_ASCR1_CH_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3498. #define RI_ASCR1_CH_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3499. #define RI_ASCR1_CH_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3500. #define RI_ASCR1_CH_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3501. #define RI_ASCR1_CH_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3502. #define RI_ASCR1_CH_31 ((uint32_t)0x00010000) /*!< Bit 16 */
  3503. #define RI_ASCR1_CH_18 ((uint32_t)0x00040000) /*!< Bit 18 */
  3504. #define RI_ASCR1_CH_19 ((uint32_t)0x00080000) /*!< Bit 19 */
  3505. #define RI_ASCR1_CH_20 ((uint32_t)0x00100000) /*!< Bit 20 */
  3506. #define RI_ASCR1_CH_21 ((uint32_t)0x00200000) /*!< Bit 21 */
  3507. #define RI_ASCR1_CH_22 ((uint32_t)0x00400000) /*!< Bit 22 */
  3508. #define RI_ASCR1_CH_23 ((uint32_t)0x00800000) /*!< Bit 23 */
  3509. #define RI_ASCR1_CH_24 ((uint32_t)0x01000000) /*!< Bit 24 */
  3510. #define RI_ASCR1_CH_25 ((uint32_t)0x02000000) /*!< Bit 25 */
  3511. #define RI_ASCR1_VCOMP ((uint32_t)0x04000000) /*!< ADC analog switch selection for internal node to COMP1 */
  3512. #define RI_ASCR1_CH_27 ((uint32_t)0x00400000) /*!< Bit 27 */
  3513. #define RI_ASCR1_CH_28 ((uint32_t)0x00800000) /*!< Bit 28 */
  3514. #define RI_ASCR1_CH_29 ((uint32_t)0x01000000) /*!< Bit 29 */
  3515. #define RI_ASCR1_CH_30 ((uint32_t)0x02000000) /*!< Bit 30 */
  3516. #define RI_ASCR1_SCM ((uint32_t)0x80000000) /*!< I/O Switch control mode */
  3517. /******************** Bit definition for RI_ASCR2 register ********************/
  3518. #define RI_ASCR2_GR10_1 ((uint32_t)0x00000001) /*!< GR10-1 selection bit */
  3519. #define RI_ASCR2_GR10_2 ((uint32_t)0x00000002) /*!< GR10-2 selection bit */
  3520. #define RI_ASCR2_GR10_3 ((uint32_t)0x00000004) /*!< GR10-3 selection bit */
  3521. #define RI_ASCR2_GR10_4 ((uint32_t)0x00000008) /*!< GR10-4 selection bit */
  3522. #define RI_ASCR2_GR6_1 ((uint32_t)0x00000010) /*!< GR6-1 selection bit */
  3523. #define RI_ASCR2_GR6_2 ((uint32_t)0x00000020) /*!< GR6-2 selection bit */
  3524. #define RI_ASCR2_GR5_1 ((uint32_t)0x00000040) /*!< GR5-1 selection bit */
  3525. #define RI_ASCR2_GR5_2 ((uint32_t)0x00000080) /*!< GR5-2 selection bit */
  3526. #define RI_ASCR2_GR5_3 ((uint32_t)0x00000100) /*!< GR5-3 selection bit */
  3527. #define RI_ASCR2_GR4_1 ((uint32_t)0x00000200) /*!< GR4-1 selection bit */
  3528. #define RI_ASCR2_GR4_2 ((uint32_t)0x00000400) /*!< GR4-2 selection bit */
  3529. #define RI_ASCR2_GR4_3 ((uint32_t)0x00000800) /*!< GR4-3 selection bit */
  3530. #define RI_ASCR2_GR4_4 ((uint32_t)0x00008000) /*!< GR4-4 selection bit */
  3531. #define RI_ASCR2_CH0b ((uint32_t)0x00010000) /*!< CH0b selection bit */
  3532. #define RI_ASCR2_CH1b ((uint32_t)0x00020000) /*!< CH1b selection bit */
  3533. #define RI_ASCR2_CH2b ((uint32_t)0x00040000) /*!< CH2b selection bit */
  3534. #define RI_ASCR2_CH3b ((uint32_t)0x00080000) /*!< CH3b selection bit */
  3535. #define RI_ASCR2_CH6b ((uint32_t)0x00100000) /*!< CH6b selection bit */
  3536. #define RI_ASCR2_CH7b ((uint32_t)0x00200000) /*!< CH7b selection bit */
  3537. #define RI_ASCR2_CH8b ((uint32_t)0x00400000) /*!< CH8b selection bit */
  3538. #define RI_ASCR2_CH9b ((uint32_t)0x00800000) /*!< CH9b selection bit */
  3539. #define RI_ASCR2_CH10b ((uint32_t)0x01000000) /*!< CH10b selection bit */
  3540. #define RI_ASCR2_CH11b ((uint32_t)0x02000000) /*!< CH11b selection bit */
  3541. #define RI_ASCR2_CH12b ((uint32_t)0x04000000) /*!< CH12b selection bit */
  3542. #define RI_ASCR2_GR6_3 ((uint32_t)0x08000000) /*!< GR6-3 selection bit */
  3543. #define RI_ASCR2_GR6_4 ((uint32_t)0x10000000) /*!< GR6-4 selection bit */
  3544. /******************** Bit definition for RI_HYSCR1 register ********************/
  3545. #define RI_HYSCR1_PA ((uint32_t)0x0000FFFF) /*!< PA[15:0] Port A Hysteresis selection */
  3546. #define RI_HYSCR1_PA_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3547. #define RI_HYSCR1_PA_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3548. #define RI_HYSCR1_PA_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3549. #define RI_HYSCR1_PA_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3550. #define RI_HYSCR1_PA_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3551. #define RI_HYSCR1_PA_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3552. #define RI_HYSCR1_PA_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3553. #define RI_HYSCR1_PA_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3554. #define RI_HYSCR1_PA_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3555. #define RI_HYSCR1_PA_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3556. #define RI_HYSCR1_PA_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3557. #define RI_HYSCR1_PA_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3558. #define RI_HYSCR1_PA_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3559. #define RI_HYSCR1_PA_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3560. #define RI_HYSCR1_PA_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3561. #define RI_HYSCR1_PA_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3562. #define RI_HYSCR1_PB ((uint32_t)0xFFFF0000) /*!< PB[15:0] Port B Hysteresis selection */
  3563. #define RI_HYSCR1_PB_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  3564. #define RI_HYSCR1_PB_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  3565. #define RI_HYSCR1_PB_2 ((uint32_t)0x00040000) /*!< Bit 2 */
  3566. #define RI_HYSCR1_PB_3 ((uint32_t)0x00080000) /*!< Bit 3 */
  3567. #define RI_HYSCR1_PB_4 ((uint32_t)0x00100000) /*!< Bit 4 */
  3568. #define RI_HYSCR1_PB_5 ((uint32_t)0x00200000) /*!< Bit 5 */
  3569. #define RI_HYSCR1_PB_6 ((uint32_t)0x00400000) /*!< Bit 6 */
  3570. #define RI_HYSCR1_PB_7 ((uint32_t)0x00800000) /*!< Bit 7 */
  3571. #define RI_HYSCR1_PB_8 ((uint32_t)0x01000000) /*!< Bit 8 */
  3572. #define RI_HYSCR1_PB_9 ((uint32_t)0x02000000) /*!< Bit 9 */
  3573. #define RI_HYSCR1_PB_10 ((uint32_t)0x04000000) /*!< Bit 10 */
  3574. #define RI_HYSCR1_PB_11 ((uint32_t)0x08000000) /*!< Bit 11 */
  3575. #define RI_HYSCR1_PB_12 ((uint32_t)0x10000000) /*!< Bit 12 */
  3576. #define RI_HYSCR1_PB_13 ((uint32_t)0x20000000) /*!< Bit 13 */
  3577. #define RI_HYSCR1_PB_14 ((uint32_t)0x40000000) /*!< Bit 14 */
  3578. #define RI_HYSCR1_PB_15 ((uint32_t)0x80000000) /*!< Bit 15 */
  3579. /******************** Bit definition for RI_HYSCR2 register ********************/
  3580. #define RI_HYSCR2_PC ((uint32_t)0x0000FFFF) /*!< PC[15:0] Port C Hysteresis selection */
  3581. #define RI_HYSCR2_PC_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3582. #define RI_HYSCR2_PC_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3583. #define RI_HYSCR2_PC_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3584. #define RI_HYSCR2_PC_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3585. #define RI_HYSCR2_PC_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3586. #define RI_HYSCR2_PC_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3587. #define RI_HYSCR2_PC_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3588. #define RI_HYSCR2_PC_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3589. #define RI_HYSCR2_PC_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3590. #define RI_HYSCR2_PC_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3591. #define RI_HYSCR2_PC_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3592. #define RI_HYSCR2_PC_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3593. #define RI_HYSCR2_PC_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3594. #define RI_HYSCR2_PC_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3595. #define RI_HYSCR2_PC_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3596. #define RI_HYSCR2_PC_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3597. #define RI_HYSCR2_PD ((uint32_t)0xFFFF0000) /*!< PD[15:0] Port D Hysteresis selection */
  3598. #define RI_HYSCR2_PD_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  3599. #define RI_HYSCR2_PD_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  3600. #define RI_HYSCR2_PD_2 ((uint32_t)0x00040000) /*!< Bit 2 */
  3601. #define RI_HYSCR2_PD_3 ((uint32_t)0x00080000) /*!< Bit 3 */
  3602. #define RI_HYSCR2_PD_4 ((uint32_t)0x00100000) /*!< Bit 4 */
  3603. #define RI_HYSCR2_PD_5 ((uint32_t)0x00200000) /*!< Bit 5 */
  3604. #define RI_HYSCR2_PD_6 ((uint32_t)0x00400000) /*!< Bit 6 */
  3605. #define RI_HYSCR2_PD_7 ((uint32_t)0x00800000) /*!< Bit 7 */
  3606. #define RI_HYSCR2_PD_8 ((uint32_t)0x01000000) /*!< Bit 8 */
  3607. #define RI_HYSCR2_PD_9 ((uint32_t)0x02000000) /*!< Bit 9 */
  3608. #define RI_HYSCR2_PD_10 ((uint32_t)0x04000000) /*!< Bit 10 */
  3609. #define RI_HYSCR2_PD_11 ((uint32_t)0x08000000) /*!< Bit 11 */
  3610. #define RI_HYSCR2_PD_12 ((uint32_t)0x10000000) /*!< Bit 12 */
  3611. #define RI_HYSCR2_PD_13 ((uint32_t)0x20000000) /*!< Bit 13 */
  3612. #define RI_HYSCR2_PD_14 ((uint32_t)0x40000000) /*!< Bit 14 */
  3613. #define RI_HYSCR2_PD_15 ((uint32_t)0x80000000) /*!< Bit 15 */
  3614. /******************** Bit definition for RI_HYSCR3 register ********************/
  3615. #define RI_HYSCR3_PE ((uint32_t)0x0000FFFF) /*!< PE[15:0] Port E Hysteresis selection */
  3616. #define RI_HYSCR3_PE_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3617. #define RI_HYSCR3_PE_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3618. #define RI_HYSCR3_PE_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3619. #define RI_HYSCR3_PE_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3620. #define RI_HYSCR3_PE_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3621. #define RI_HYSCR3_PE_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3622. #define RI_HYSCR3_PE_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3623. #define RI_HYSCR3_PE_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3624. #define RI_HYSCR3_PE_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3625. #define RI_HYSCR3_PE_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3626. #define RI_HYSCR3_PE_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3627. #define RI_HYSCR3_PE_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3628. #define RI_HYSCR3_PE_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3629. #define RI_HYSCR3_PE_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3630. #define RI_HYSCR3_PE_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3631. #define RI_HYSCR3_PE_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3632. #define RI_HYSCR3_PF ((uint32_t)0xFFFF0000) /*!< PF[15:0] Port F Hysteresis selection */
  3633. #define RI_HYSCR3_PF_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  3634. #define RI_HYSCR3_PF_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  3635. #define RI_HYSCR3_PF_2 ((uint32_t)0x00040000) /*!< Bit 2 */
  3636. #define RI_HYSCR3_PF_3 ((uint32_t)0x00080000) /*!< Bit 3 */
  3637. #define RI_HYSCR3_PF_4 ((uint32_t)0x00100000) /*!< Bit 4 */
  3638. #define RI_HYSCR3_PF_5 ((uint32_t)0x00200000) /*!< Bit 5 */
  3639. #define RI_HYSCR3_PF_6 ((uint32_t)0x00400000) /*!< Bit 6 */
  3640. #define RI_HYSCR3_PF_7 ((uint32_t)0x00800000) /*!< Bit 7 */
  3641. #define RI_HYSCR3_PF_8 ((uint32_t)0x01000000) /*!< Bit 8 */
  3642. #define RI_HYSCR3_PF_9 ((uint32_t)0x02000000) /*!< Bit 9 */
  3643. #define RI_HYSCR3_PF_10 ((uint32_t)0x04000000) /*!< Bit 10 */
  3644. #define RI_HYSCR3_PF_11 ((uint32_t)0x08000000) /*!< Bit 11 */
  3645. #define RI_HYSCR3_PF_12 ((uint32_t)0x10000000) /*!< Bit 12 */
  3646. #define RI_HYSCR3_PF_13 ((uint32_t)0x20000000) /*!< Bit 13 */
  3647. #define RI_HYSCR3_PF_14 ((uint32_t)0x40000000) /*!< Bit 14 */
  3648. #define RI_HYSCR3_PF_15 ((uint32_t)0x80000000) /*!< Bit 15 */
  3649. /******************** Bit definition for RI_HYSCR4 register ********************/
  3650. #define RI_HYSCR4_PG ((uint32_t)0x0000FFFF) /*!< PG[15:0] Port G Hysteresis selection */
  3651. #define RI_HYSCR4_PG_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3652. #define RI_HYSCR4_PG_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3653. #define RI_HYSCR4_PG_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3654. #define RI_HYSCR4_PG_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3655. #define RI_HYSCR4_PG_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3656. #define RI_HYSCR4_PG_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3657. #define RI_HYSCR4_PG_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3658. #define RI_HYSCR4_PG_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3659. #define RI_HYSCR4_PG_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3660. #define RI_HYSCR4_PG_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3661. #define RI_HYSCR4_PG_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3662. #define RI_HYSCR4_PG_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3663. #define RI_HYSCR4_PG_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3664. #define RI_HYSCR4_PG_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3665. #define RI_HYSCR4_PG_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3666. #define RI_HYSCR4_PG_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3667. /******************** Bit definition for RI_ASMR1 register ********************/
  3668. #define RI_ASMR1_PA ((uint32_t)0x0000FFFF) /*!< PA[15:0] Port A selection*/
  3669. #define RI_ASMR1_PA_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3670. #define RI_ASMR1_PA_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3671. #define RI_ASMR1_PA_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3672. #define RI_ASMR1_PA_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3673. #define RI_ASMR1_PA_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3674. #define RI_ASMR1_PA_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3675. #define RI_ASMR1_PA_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3676. #define RI_ASMR1_PA_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3677. #define RI_ASMR1_PA_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3678. #define RI_ASMR1_PA_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3679. #define RI_ASMR1_PA_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3680. #define RI_ASMR1_PA_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3681. #define RI_ASMR1_PA_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3682. #define RI_ASMR1_PA_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3683. #define RI_ASMR1_PA_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3684. #define RI_ASMR1_PA_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3685. /******************** Bit definition for RI_CMR1 register ********************/
  3686. #define RI_CMR1_PA ((uint32_t)0x0000FFFF) /*!< PA[15:0] Port A selection*/
  3687. #define RI_CMR1_PA_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3688. #define RI_CMR1_PA_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3689. #define RI_CMR1_PA_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3690. #define RI_CMR1_PA_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3691. #define RI_CMR1_PA_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3692. #define RI_CMR1_PA_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3693. #define RI_CMR1_PA_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3694. #define RI_CMR1_PA_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3695. #define RI_CMR1_PA_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3696. #define RI_CMR1_PA_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3697. #define RI_CMR1_PA_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3698. #define RI_CMR1_PA_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3699. #define RI_CMR1_PA_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3700. #define RI_CMR1_PA_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3701. #define RI_CMR1_PA_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3702. #define RI_CMR1_PA_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3703. /******************** Bit definition for RI_CICR1 register ********************/
  3704. #define RI_CICR1_PA ((uint32_t)0x0000FFFF) /*!< PA[15:0] Port A selection*/
  3705. #define RI_CICR1_PA_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3706. #define RI_CICR1_PA_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3707. #define RI_CICR1_PA_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3708. #define RI_CICR1_PA_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3709. #define RI_CICR1_PA_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3710. #define RI_CICR1_PA_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3711. #define RI_CICR1_PA_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3712. #define RI_CICR1_PA_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3713. #define RI_CICR1_PA_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3714. #define RI_CICR1_PA_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3715. #define RI_CICR1_PA_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3716. #define RI_CICR1_PA_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3717. #define RI_CICR1_PA_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3718. #define RI_CICR1_PA_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3719. #define RI_CICR1_PA_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3720. #define RI_CICR1_PA_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3721. /******************** Bit definition for RI_ASMR2 register ********************/
  3722. #define RI_ASMR2_PB ((uint32_t)0x0000FFFF) /*!< PB[15:0] Port B selection */
  3723. #define RI_ASMR2_PB_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3724. #define RI_ASMR2_PB_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3725. #define RI_ASMR2_PB_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3726. #define RI_ASMR2_PB_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3727. #define RI_ASMR2_PB_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3728. #define RI_ASMR2_PB_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3729. #define RI_ASMR2_PB_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3730. #define RI_ASMR2_PB_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3731. #define RI_ASMR2_PB_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3732. #define RI_ASMR2_PB_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3733. #define RI_ASMR2_PB_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3734. #define RI_ASMR2_PB_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3735. #define RI_ASMR2_PB_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3736. #define RI_ASMR2_PB_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3737. #define RI_ASMR2_PB_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3738. #define RI_ASMR2_PB_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3739. /******************** Bit definition for RI_CMR2 register ********************/
  3740. #define RI_CMR2_PB ((uint32_t)0x0000FFFF) /*!< PB[15:0] Port B selection */
  3741. #define RI_CMR2_PB_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3742. #define RI_CMR2_PB_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3743. #define RI_CMR2_PB_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3744. #define RI_CMR2_PB_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3745. #define RI_CMR2_PB_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3746. #define RI_CMR2_PB_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3747. #define RI_CMR2_PB_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3748. #define RI_CMR2_PB_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3749. #define RI_CMR2_PB_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3750. #define RI_CMR2_PB_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3751. #define RI_CMR2_PB_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3752. #define RI_CMR2_PB_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3753. #define RI_CMR2_PB_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3754. #define RI_CMR2_PB_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3755. #define RI_CMR2_PB_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3756. #define RI_CMR2_PB_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3757. /******************** Bit definition for RI_CICR2 register ********************/
  3758. #define RI_CICR2_PB ((uint32_t)0x0000FFFF) /*!< PB[15:0] Port B selection */
  3759. #define RI_CICR2_PB_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3760. #define RI_CICR2_PB_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3761. #define RI_CICR2_PB_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3762. #define RI_CICR2_PB_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3763. #define RI_CICR2_PB_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3764. #define RI_CICR2_PB_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3765. #define RI_CICR2_PB_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3766. #define RI_CICR2_PB_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3767. #define RI_CICR2_PB_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3768. #define RI_CICR2_PB_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3769. #define RI_CICR2_PB_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3770. #define RI_CICR2_PB_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3771. #define RI_CICR2_PB_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3772. #define RI_CICR2_PB_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3773. #define RI_CICR2_PB_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3774. #define RI_CICR2_PB_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3775. /******************** Bit definition for RI_ASMR3 register ********************/
  3776. #define RI_ASMR3_PC ((uint32_t)0x0000FFFF) /*!< PC[15:0] Port C selection */
  3777. #define RI_ASMR3_PC_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3778. #define RI_ASMR3_PC_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3779. #define RI_ASMR3_PC_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3780. #define RI_ASMR3_PC_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3781. #define RI_ASMR3_PC_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3782. #define RI_ASMR3_PC_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3783. #define RI_ASMR3_PC_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3784. #define RI_ASMR3_PC_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3785. #define RI_ASMR3_PC_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3786. #define RI_ASMR3_PC_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3787. #define RI_ASMR3_PC_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3788. #define RI_ASMR3_PC_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3789. #define RI_ASMR3_PC_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3790. #define RI_ASMR3_PC_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3791. #define RI_ASMR3_PC_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3792. #define RI_ASMR3_PC_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3793. /******************** Bit definition for RI_CMR3 register ********************/
  3794. #define RI_CMR3_PC ((uint32_t)0x0000FFFF) /*!< PC[15:0] Port C selection */
  3795. #define RI_CMR3_PC_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3796. #define RI_CMR3_PC_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3797. #define RI_CMR3_PC_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3798. #define RI_CMR3_PC_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3799. #define RI_CMR3_PC_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3800. #define RI_CMR3_PC_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3801. #define RI_CMR3_PC_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3802. #define RI_CMR3_PC_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3803. #define RI_CMR3_PC_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3804. #define RI_CMR3_PC_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3805. #define RI_CMR3_PC_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3806. #define RI_CMR3_PC_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3807. #define RI_CMR3_PC_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3808. #define RI_CMR3_PC_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3809. #define RI_CMR3_PC_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3810. #define RI_CMR3_PC_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3811. /******************** Bit definition for RI_CICR3 register ********************/
  3812. #define RI_CICR3_PC ((uint32_t)0x0000FFFF) /*!< PC[15:0] Port C selection */
  3813. #define RI_CICR3_PC_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3814. #define RI_CICR3_PC_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3815. #define RI_CICR3_PC_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3816. #define RI_CICR3_PC_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3817. #define RI_CICR3_PC_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3818. #define RI_CICR3_PC_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3819. #define RI_CICR3_PC_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3820. #define RI_CICR3_PC_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3821. #define RI_CICR3_PC_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3822. #define RI_CICR3_PC_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3823. #define RI_CICR3_PC_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3824. #define RI_CICR3_PC_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3825. #define RI_CICR3_PC_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3826. #define RI_CICR3_PC_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3827. #define RI_CICR3_PC_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3828. #define RI_CICR3_PC_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3829. /******************** Bit definition for RI_ASMR4 register ********************/
  3830. #define RI_ASMR4_PF ((uint32_t)0x0000FFFF) /*!< PF[15:0] Port F selection */
  3831. #define RI_ASMR4_PF_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3832. #define RI_ASMR4_PF_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3833. #define RI_ASMR4_PF_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3834. #define RI_ASMR4_PF_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3835. #define RI_ASMR4_PF_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3836. #define RI_ASMR4_PF_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3837. #define RI_ASMR4_PF_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3838. #define RI_ASMR4_PF_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3839. #define RI_ASMR4_PF_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3840. #define RI_ASMR4_PF_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3841. #define RI_ASMR4_PF_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3842. #define RI_ASMR4_PF_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3843. #define RI_ASMR4_PF_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3844. #define RI_ASMR4_PF_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3845. #define RI_ASMR4_PF_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3846. #define RI_ASMR4_PF_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3847. /******************** Bit definition for RI_CMR4 register ********************/
  3848. #define RI_CMR4_PF ((uint32_t)0x0000FFFF) /*!< PF[15:0] Port F selection */
  3849. #define RI_CMR4_PF_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3850. #define RI_CMR4_PF_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3851. #define RI_CMR4_PF_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3852. #define RI_CMR4_PF_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3853. #define RI_CMR4_PF_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3854. #define RI_CMR4_PF_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3855. #define RI_CMR4_PF_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3856. #define RI_CMR4_PF_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3857. #define RI_CMR4_PF_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3858. #define RI_CMR4_PF_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3859. #define RI_CMR4_PF_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3860. #define RI_CMR4_PF_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3861. #define RI_CMR4_PF_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3862. #define RI_CMR4_PF_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3863. #define RI_CMR4_PF_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3864. #define RI_CMR4_PF_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3865. /******************** Bit definition for RI_CICR4 register ********************/
  3866. #define RI_CICR4_PF ((uint32_t)0x0000FFFF) /*!< PF[15:0] Port F selection */
  3867. #define RI_CICR4_PF_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3868. #define RI_CICR4_PF_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3869. #define RI_CICR4_PF_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3870. #define RI_CICR4_PF_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3871. #define RI_CICR4_PF_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3872. #define RI_CICR4_PF_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3873. #define RI_CICR4_PF_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3874. #define RI_CICR4_PF_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3875. #define RI_CICR4_PF_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3876. #define RI_CICR4_PF_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3877. #define RI_CICR4_PF_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3878. #define RI_CICR4_PF_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3879. #define RI_CICR4_PF_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3880. #define RI_CICR4_PF_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3881. #define RI_CICR4_PF_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3882. #define RI_CICR4_PF_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3883. /******************** Bit definition for RI_ASMR5 register ********************/
  3884. #define RI_ASMR5_PG ((uint32_t)0x0000FFFF) /*!< PG[15:0] Port G selection */
  3885. #define RI_ASMR5_PG_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3886. #define RI_ASMR5_PG_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3887. #define RI_ASMR5_PG_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3888. #define RI_ASMR5_PG_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3889. #define RI_ASMR5_PG_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3890. #define RI_ASMR5_PG_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3891. #define RI_ASMR5_PG_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3892. #define RI_ASMR5_PG_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3893. #define RI_ASMR5_PG_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3894. #define RI_ASMR5_PG_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3895. #define RI_ASMR5_PG_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3896. #define RI_ASMR5_PG_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3897. #define RI_ASMR5_PG_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3898. #define RI_ASMR5_PG_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3899. #define RI_ASMR5_PG_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3900. #define RI_ASMR5_PG_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3901. /******************** Bit definition for RI_CMR5 register ********************/
  3902. #define RI_CMR5_PG ((uint32_t)0x0000FFFF) /*!< PG[15:0] Port G selection */
  3903. #define RI_CMR5_PG_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3904. #define RI_CMR5_PG_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3905. #define RI_CMR5_PG_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3906. #define RI_CMR5_PG_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3907. #define RI_CMR5_PG_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3908. #define RI_CMR5_PG_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3909. #define RI_CMR5_PG_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3910. #define RI_CMR5_PG_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3911. #define RI_CMR5_PG_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3912. #define RI_CMR5_PG_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3913. #define RI_CMR5_PG_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3914. #define RI_CMR5_PG_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3915. #define RI_CMR5_PG_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3916. #define RI_CMR5_PG_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3917. #define RI_CMR5_PG_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3918. #define RI_CMR5_PG_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3919. /******************** Bit definition for RI_CICR5 register ********************/
  3920. #define RI_CICR5_PG ((uint32_t)0x0000FFFF) /*!< PG[15:0] Port G selection */
  3921. #define RI_CICR5_PG_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  3922. #define RI_CICR5_PG_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  3923. #define RI_CICR5_PG_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  3924. #define RI_CICR5_PG_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  3925. #define RI_CICR5_PG_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  3926. #define RI_CICR5_PG_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  3927. #define RI_CICR5_PG_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  3928. #define RI_CICR5_PG_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  3929. #define RI_CICR5_PG_8 ((uint32_t)0x00000100) /*!< Bit 8 */
  3930. #define RI_CICR5_PG_9 ((uint32_t)0x00000200) /*!< Bit 9 */
  3931. #define RI_CICR5_PG_10 ((uint32_t)0x00000400) /*!< Bit 10 */
  3932. #define RI_CICR5_PG_11 ((uint32_t)0x00000800) /*!< Bit 11 */
  3933. #define RI_CICR5_PG_12 ((uint32_t)0x00001000) /*!< Bit 12 */
  3934. #define RI_CICR5_PG_13 ((uint32_t)0x00002000) /*!< Bit 13 */
  3935. #define RI_CICR5_PG_14 ((uint32_t)0x00004000) /*!< Bit 14 */
  3936. #define RI_CICR5_PG_15 ((uint32_t)0x00008000) /*!< Bit 15 */
  3937. /******************************************************************************/
  3938. /* */
  3939. /* Timers (TIM) */
  3940. /* */
  3941. /******************************************************************************/
  3942. /******************* Bit definition for TIM_CR1 register ********************/
  3943. #define TIM_CR1_CEN ((uint32_t)0x00000001) /*!<Counter enable */
  3944. #define TIM_CR1_UDIS ((uint32_t)0x00000002) /*!<Update disable */
  3945. #define TIM_CR1_URS ((uint32_t)0x00000004) /*!<Update request source */
  3946. #define TIM_CR1_OPM ((uint32_t)0x00000008) /*!<One pulse mode */
  3947. #define TIM_CR1_DIR ((uint32_t)0x00000010) /*!<Direction */
  3948. #define TIM_CR1_CMS ((uint32_t)0x00000060) /*!<CMS[1:0] bits (Center-aligned mode selection) */
  3949. #define TIM_CR1_CMS_0 ((uint32_t)0x00000020) /*!<Bit 0 */
  3950. #define TIM_CR1_CMS_1 ((uint32_t)0x00000040) /*!<Bit 1 */
  3951. #define TIM_CR1_ARPE ((uint32_t)0x00000080) /*!<Auto-reload preload enable */
  3952. #define TIM_CR1_CKD ((uint32_t)0x00000300) /*!<CKD[1:0] bits (clock division) */
  3953. #define TIM_CR1_CKD_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3954. #define TIM_CR1_CKD_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3955. /******************* Bit definition for TIM_CR2 register ********************/
  3956. #define TIM_CR2_CCDS ((uint32_t)0x00000008) /*!<Capture/Compare DMA Selection */
  3957. #define TIM_CR2_MMS ((uint32_t)0x00000070) /*!<MMS[2:0] bits (Master Mode Selection) */
  3958. #define TIM_CR2_MMS_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3959. #define TIM_CR2_MMS_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3960. #define TIM_CR2_MMS_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3961. #define TIM_CR2_TI1S ((uint32_t)0x00000080) /*!<TI1 Selection */
  3962. /******************* Bit definition for TIM_SMCR register *******************/
  3963. #define TIM_SMCR_SMS ((uint32_t)0x00000007) /*!<SMS[2:0] bits (Slave mode selection) */
  3964. #define TIM_SMCR_SMS_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3965. #define TIM_SMCR_SMS_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3966. #define TIM_SMCR_SMS_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3967. #define TIM_SMCR_OCCS ((uint32_t)0x00000008) /*!< OCREF clear selection */
  3968. #define TIM_SMCR_TS ((uint32_t)0x00000070) /*!<TS[2:0] bits (Trigger selection) */
  3969. #define TIM_SMCR_TS_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3970. #define TIM_SMCR_TS_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3971. #define TIM_SMCR_TS_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3972. #define TIM_SMCR_MSM ((uint32_t)0x00000080) /*!<Master/slave mode */
  3973. #define TIM_SMCR_ETF ((uint32_t)0x00000F00) /*!<ETF[3:0] bits (External trigger filter) */
  3974. #define TIM_SMCR_ETF_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3975. #define TIM_SMCR_ETF_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3976. #define TIM_SMCR_ETF_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3977. #define TIM_SMCR_ETF_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3978. #define TIM_SMCR_ETPS ((uint32_t)0x00003000) /*!<ETPS[1:0] bits (External trigger prescaler) */
  3979. #define TIM_SMCR_ETPS_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  3980. #define TIM_SMCR_ETPS_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  3981. #define TIM_SMCR_ECE ((uint32_t)0x00004000) /*!<External clock enable */
  3982. #define TIM_SMCR_ETP ((uint32_t)0x00008000) /*!<External trigger polarity */
  3983. /******************* Bit definition for TIM_DIER register *******************/
  3984. #define TIM_DIER_UIE ((uint32_t)0x00000001) /*!<Update interrupt enable */
  3985. #define TIM_DIER_CC1IE ((uint32_t)0x00000002) /*!<Capture/Compare 1 interrupt enable */
  3986. #define TIM_DIER_CC2IE ((uint32_t)0x00000004) /*!<Capture/Compare 2 interrupt enable */
  3987. #define TIM_DIER_CC3IE ((uint32_t)0x00000008) /*!<Capture/Compare 3 interrupt enable */
  3988. #define TIM_DIER_CC4IE ((uint32_t)0x00000010) /*!<Capture/Compare 4 interrupt enable */
  3989. #define TIM_DIER_TIE ((uint32_t)0x00000040) /*!<Trigger interrupt enable */
  3990. #define TIM_DIER_UDE ((uint32_t)0x00000100) /*!<Update DMA request enable */
  3991. #define TIM_DIER_CC1DE ((uint32_t)0x00000200) /*!<Capture/Compare 1 DMA request enable */
  3992. #define TIM_DIER_CC2DE ((uint32_t)0x00000400) /*!<Capture/Compare 2 DMA request enable */
  3993. #define TIM_DIER_CC3DE ((uint32_t)0x00000800) /*!<Capture/Compare 3 DMA request enable */
  3994. #define TIM_DIER_CC4DE ((uint32_t)0x00001000) /*!<Capture/Compare 4 DMA request enable */
  3995. #define TIM_DIER_COMDE ((uint16_t)0x2000) /*!<COM DMA request enable */
  3996. #define TIM_DIER_TDE ((uint32_t)0x00004000) /*!<Trigger DMA request enable */
  3997. /******************** Bit definition for TIM_SR register ********************/
  3998. #define TIM_SR_UIF ((uint32_t)0x00000001) /*!<Update interrupt Flag */
  3999. #define TIM_SR_CC1IF ((uint32_t)0x00000002) /*!<Capture/Compare 1 interrupt Flag */
  4000. #define TIM_SR_CC2IF ((uint32_t)0x00000004) /*!<Capture/Compare 2 interrupt Flag */
  4001. #define TIM_SR_CC3IF ((uint32_t)0x00000008) /*!<Capture/Compare 3 interrupt Flag */
  4002. #define TIM_SR_CC4IF ((uint32_t)0x00000010) /*!<Capture/Compare 4 interrupt Flag */
  4003. #define TIM_SR_TIF ((uint32_t)0x00000040) /*!<Trigger interrupt Flag */
  4004. #define TIM_SR_CC1OF ((uint32_t)0x00000200) /*!<Capture/Compare 1 Overcapture Flag */
  4005. #define TIM_SR_CC2OF ((uint32_t)0x00000400) /*!<Capture/Compare 2 Overcapture Flag */
  4006. #define TIM_SR_CC3OF ((uint32_t)0x00000800) /*!<Capture/Compare 3 Overcapture Flag */
  4007. #define TIM_SR_CC4OF ((uint32_t)0x00001000) /*!<Capture/Compare 4 Overcapture Flag */
  4008. /******************* Bit definition for TIM_EGR register ********************/
  4009. #define TIM_EGR_UG ((uint32_t)0x00000001) /*!<Update Generation */
  4010. #define TIM_EGR_CC1G ((uint32_t)0x00000002) /*!<Capture/Compare 1 Generation */
  4011. #define TIM_EGR_CC2G ((uint32_t)0x00000004) /*!<Capture/Compare 2 Generation */
  4012. #define TIM_EGR_CC3G ((uint32_t)0x00000008) /*!<Capture/Compare 3 Generation */
  4013. #define TIM_EGR_CC4G ((uint32_t)0x00000010) /*!<Capture/Compare 4 Generation */
  4014. #define TIM_EGR_TG ((uint32_t)0x00000040) /*!<Trigger Generation */
  4015. /****************** Bit definition for TIM_CCMR1 register *******************/
  4016. #define TIM_CCMR1_CC1S ((uint32_t)0x00000003) /*!<CC1S[1:0] bits (Capture/Compare 1 Selection) */
  4017. #define TIM_CCMR1_CC1S_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4018. #define TIM_CCMR1_CC1S_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4019. #define TIM_CCMR1_OC1FE ((uint32_t)0x00000004) /*!<Output Compare 1 Fast enable */
  4020. #define TIM_CCMR1_OC1PE ((uint32_t)0x00000008) /*!<Output Compare 1 Preload enable */
  4021. #define TIM_CCMR1_OC1M ((uint32_t)0x00000070) /*!<OC1M[2:0] bits (Output Compare 1 Mode) */
  4022. #define TIM_CCMR1_OC1M_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4023. #define TIM_CCMR1_OC1M_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4024. #define TIM_CCMR1_OC1M_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  4025. #define TIM_CCMR1_OC1CE ((uint32_t)0x00000080) /*!<Output Compare 1Clear Enable */
  4026. #define TIM_CCMR1_CC2S ((uint32_t)0x00000300) /*!<CC2S[1:0] bits (Capture/Compare 2 Selection) */
  4027. #define TIM_CCMR1_CC2S_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  4028. #define TIM_CCMR1_CC2S_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  4029. #define TIM_CCMR1_OC2FE ((uint32_t)0x00000400) /*!<Output Compare 2 Fast enable */
  4030. #define TIM_CCMR1_OC2PE ((uint32_t)0x00000800) /*!<Output Compare 2 Preload enable */
  4031. #define TIM_CCMR1_OC2M ((uint32_t)0x00007000) /*!<OC2M[2:0] bits (Output Compare 2 Mode) */
  4032. #define TIM_CCMR1_OC2M_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  4033. #define TIM_CCMR1_OC2M_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  4034. #define TIM_CCMR1_OC2M_2 ((uint32_t)0x00004000) /*!<Bit 2 */
  4035. #define TIM_CCMR1_OC2CE ((uint32_t)0x00008000) /*!<Output Compare 2 Clear Enable */
  4036. /*----------------------------------------------------------------------------*/
  4037. #define TIM_CCMR1_IC1PSC ((uint32_t)0x0000000C) /*!<IC1PSC[1:0] bits (Input Capture 1 Prescaler) */
  4038. #define TIM_CCMR1_IC1PSC_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  4039. #define TIM_CCMR1_IC1PSC_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  4040. #define TIM_CCMR1_IC1F ((uint32_t)0x000000F0) /*!<IC1F[3:0] bits (Input Capture 1 Filter) */
  4041. #define TIM_CCMR1_IC1F_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4042. #define TIM_CCMR1_IC1F_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4043. #define TIM_CCMR1_IC1F_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  4044. #define TIM_CCMR1_IC1F_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  4045. #define TIM_CCMR1_IC2PSC ((uint32_t)0x00000C00) /*!<IC2PSC[1:0] bits (Input Capture 2 Prescaler) */
  4046. #define TIM_CCMR1_IC2PSC_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  4047. #define TIM_CCMR1_IC2PSC_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  4048. #define TIM_CCMR1_IC2F ((uint32_t)0x0000F000) /*!<IC2F[3:0] bits (Input Capture 2 Filter) */
  4049. #define TIM_CCMR1_IC2F_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  4050. #define TIM_CCMR1_IC2F_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  4051. #define TIM_CCMR1_IC2F_2 ((uint32_t)0x00004000) /*!<Bit 2 */
  4052. #define TIM_CCMR1_IC2F_3 ((uint32_t)0x00008000) /*!<Bit 3 */
  4053. /****************** Bit definition for TIM_CCMR2 register *******************/
  4054. #define TIM_CCMR2_CC3S ((uint32_t)0x00000003) /*!<CC3S[1:0] bits (Capture/Compare 3 Selection) */
  4055. #define TIM_CCMR2_CC3S_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4056. #define TIM_CCMR2_CC3S_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4057. #define TIM_CCMR2_OC3FE ((uint32_t)0x00000004) /*!<Output Compare 3 Fast enable */
  4058. #define TIM_CCMR2_OC3PE ((uint32_t)0x00000008) /*!<Output Compare 3 Preload enable */
  4059. #define TIM_CCMR2_OC3M ((uint32_t)0x00000070) /*!<OC3M[2:0] bits (Output Compare 3 Mode) */
  4060. #define TIM_CCMR2_OC3M_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4061. #define TIM_CCMR2_OC3M_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4062. #define TIM_CCMR2_OC3M_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  4063. #define TIM_CCMR2_OC3CE ((uint32_t)0x00000080) /*!<Output Compare 3 Clear Enable */
  4064. #define TIM_CCMR2_CC4S ((uint32_t)0x00000300) /*!<CC4S[1:0] bits (Capture/Compare 4 Selection) */
  4065. #define TIM_CCMR2_CC4S_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  4066. #define TIM_CCMR2_CC4S_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  4067. #define TIM_CCMR2_OC4FE ((uint32_t)0x00000400) /*!<Output Compare 4 Fast enable */
  4068. #define TIM_CCMR2_OC4PE ((uint32_t)0x00000800) /*!<Output Compare 4 Preload enable */
  4069. #define TIM_CCMR2_OC4M ((uint32_t)0x00007000) /*!<OC4M[2:0] bits (Output Compare 4 Mode) */
  4070. #define TIM_CCMR2_OC4M_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  4071. #define TIM_CCMR2_OC4M_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  4072. #define TIM_CCMR2_OC4M_2 ((uint32_t)0x00004000) /*!<Bit 2 */
  4073. #define TIM_CCMR2_OC4CE ((uint32_t)0x00008000) /*!<Output Compare 4 Clear Enable */
  4074. /*----------------------------------------------------------------------------*/
  4075. #define TIM_CCMR2_IC3PSC ((uint32_t)0x0000000C) /*!<IC3PSC[1:0] bits (Input Capture 3 Prescaler) */
  4076. #define TIM_CCMR2_IC3PSC_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  4077. #define TIM_CCMR2_IC3PSC_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  4078. #define TIM_CCMR2_IC3F ((uint32_t)0x000000F0) /*!<IC3F[3:0] bits (Input Capture 3 Filter) */
  4079. #define TIM_CCMR2_IC3F_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4080. #define TIM_CCMR2_IC3F_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4081. #define TIM_CCMR2_IC3F_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  4082. #define TIM_CCMR2_IC3F_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  4083. #define TIM_CCMR2_IC4PSC ((uint32_t)0x00000C00) /*!<IC4PSC[1:0] bits (Input Capture 4 Prescaler) */
  4084. #define TIM_CCMR2_IC4PSC_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  4085. #define TIM_CCMR2_IC4PSC_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  4086. #define TIM_CCMR2_IC4F ((uint32_t)0x0000F000) /*!<IC4F[3:0] bits (Input Capture 4 Filter) */
  4087. #define TIM_CCMR2_IC4F_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  4088. #define TIM_CCMR2_IC4F_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  4089. #define TIM_CCMR2_IC4F_2 ((uint32_t)0x00004000) /*!<Bit 2 */
  4090. #define TIM_CCMR2_IC4F_3 ((uint32_t)0x00008000) /*!<Bit 3 */
  4091. /******************* Bit definition for TIM_CCER register *******************/
  4092. #define TIM_CCER_CC1E ((uint32_t)0x00000001) /*!<Capture/Compare 1 output enable */
  4093. #define TIM_CCER_CC1P ((uint32_t)0x00000002) /*!<Capture/Compare 1 output Polarity */
  4094. #define TIM_CCER_CC1NP ((uint32_t)0x00000008) /*!<Capture/Compare 1 Complementary output Polarity */
  4095. #define TIM_CCER_CC2E ((uint32_t)0x00000010) /*!<Capture/Compare 2 output enable */
  4096. #define TIM_CCER_CC2P ((uint32_t)0x00000020) /*!<Capture/Compare 2 output Polarity */
  4097. #define TIM_CCER_CC2NP ((uint32_t)0x00000080) /*!<Capture/Compare 2 Complementary output Polarity */
  4098. #define TIM_CCER_CC3E ((uint32_t)0x00000100) /*!<Capture/Compare 3 output enable */
  4099. #define TIM_CCER_CC3P ((uint32_t)0x00000200) /*!<Capture/Compare 3 output Polarity */
  4100. #define TIM_CCER_CC3NP ((uint32_t)0x00000800) /*!<Capture/Compare 3 Complementary output Polarity */
  4101. #define TIM_CCER_CC4E ((uint32_t)0x00001000) /*!<Capture/Compare 4 output enable */
  4102. #define TIM_CCER_CC4P ((uint32_t)0x00002000) /*!<Capture/Compare 4 output Polarity */
  4103. #define TIM_CCER_CC4NP ((uint32_t)0x00008000) /*!<Capture/Compare 4 Complementary output Polarity */
  4104. /******************* Bit definition for TIM_CNT register ********************/
  4105. #define TIM_CNT_CNT ((uint32_t)0x0000FFFF) /*!<Counter Value */
  4106. /******************* Bit definition for TIM_PSC register ********************/
  4107. #define TIM_PSC_PSC ((uint32_t)0x0000FFFF) /*!<Prescaler Value */
  4108. /******************* Bit definition for TIM_ARR register ********************/
  4109. #define TIM_ARR_ARR ((uint32_t)0x0000FFFF) /*!<actual auto-reload Value */
  4110. /******************* Bit definition for TIM_CCR1 register *******************/
  4111. #define TIM_CCR1_CCR1 ((uint32_t)0x0000FFFF) /*!<Capture/Compare 1 Value */
  4112. /******************* Bit definition for TIM_CCR2 register *******************/
  4113. #define TIM_CCR2_CCR2 ((uint32_t)0x0000FFFF) /*!<Capture/Compare 2 Value */
  4114. /******************* Bit definition for TIM_CCR3 register *******************/
  4115. #define TIM_CCR3_CCR3 ((uint32_t)0x0000FFFF) /*!<Capture/Compare 3 Value */
  4116. /******************* Bit definition for TIM_CCR4 register *******************/
  4117. #define TIM_CCR4_CCR4 ((uint32_t)0x0000FFFF) /*!<Capture/Compare 4 Value */
  4118. /******************* Bit definition for TIM_DCR register ********************/
  4119. #define TIM_DCR_DBA ((uint32_t)0x0000001F) /*!<DBA[4:0] bits (DMA Base Address) */
  4120. #define TIM_DCR_DBA_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4121. #define TIM_DCR_DBA_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4122. #define TIM_DCR_DBA_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  4123. #define TIM_DCR_DBA_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  4124. #define TIM_DCR_DBA_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  4125. #define TIM_DCR_DBL ((uint32_t)0x00001F00) /*!<DBL[4:0] bits (DMA Burst Length) */
  4126. #define TIM_DCR_DBL_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  4127. #define TIM_DCR_DBL_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  4128. #define TIM_DCR_DBL_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  4129. #define TIM_DCR_DBL_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  4130. #define TIM_DCR_DBL_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  4131. /******************* Bit definition for TIM_DMAR register *******************/
  4132. #define TIM_DMAR_DMAB ((uint32_t)0x0000FFFF) /*!<DMA register for burst accesses */
  4133. /******************* Bit definition for TIM_OR register *********************/
  4134. #define TIM_OR_TI1RMP ((uint32_t)0x00000003) /*!<TI1_RMP[1:0] bits (TIM Input 1 remap) */
  4135. #define TIM_OR_TI1RMP_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4136. #define TIM_OR_TI1RMP_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4137. #define TIM_OR_ETR_RMP ((uint32_t)0x00000004) /*!<ETR_RMP bit (TIM10/11 ETR remap)*/
  4138. #define TIM_OR_TI1_RMP_RI ((uint32_t)0x00000008) /*!<TI1_RMP_RI bit (TIM10/11 Input 1 remap for Routing interface) */
  4139. /*----------------------------------------------------------------------------*/
  4140. #define TIM9_OR_ITR1_RMP ((uint32_t)0x00000004) /*!<ITR1_RMP bit (TIM9 Internal trigger 1 remap) */
  4141. /*----------------------------------------------------------------------------*/
  4142. #define TIM2_OR_ITR1_RMP ((uint32_t)0x00000001) /*!<ITR1_RMP bit (TIM2 Internal trigger 1 remap) */
  4143. /*----------------------------------------------------------------------------*/
  4144. #define TIM3_OR_ITR2_RMP ((uint32_t)0x00000001) /*!<ITR2_RMP bit (TIM3 Internal trigger 2 remap) */
  4145. /*----------------------------------------------------------------------------*/
  4146. /******************************************************************************/
  4147. /* */
  4148. /* Universal Synchronous Asynchronous Receiver Transmitter (USART) */
  4149. /* */
  4150. /******************************************************************************/
  4151. /******************* Bit definition for USART_SR register *******************/
  4152. #define USART_SR_PE ((uint32_t)0x00000001) /*!< Parity Error */
  4153. #define USART_SR_FE ((uint32_t)0x00000002) /*!< Framing Error */
  4154. #define USART_SR_NE ((uint32_t)0x00000004) /*!< Noise Error Flag */
  4155. #define USART_SR_ORE ((uint32_t)0x00000008) /*!< OverRun Error */
  4156. #define USART_SR_IDLE ((uint32_t)0x00000010) /*!< IDLE line detected */
  4157. #define USART_SR_RXNE ((uint32_t)0x00000020) /*!< Read Data Register Not Empty */
  4158. #define USART_SR_TC ((uint32_t)0x00000040) /*!< Transmission Complete */
  4159. #define USART_SR_TXE ((uint32_t)0x00000080) /*!< Transmit Data Register Empty */
  4160. #define USART_SR_LBD ((uint32_t)0x00000100) /*!< LIN Break Detection Flag */
  4161. #define USART_SR_CTS ((uint32_t)0x00000200) /*!< CTS Flag */
  4162. /******************* Bit definition for USART_DR register *******************/
  4163. #define USART_DR_DR ((uint32_t)0x000001FF) /*!< Data value */
  4164. /****************** Bit definition for USART_BRR register *******************/
  4165. #define USART_BRR_DIV_FRACTION ((uint32_t)0x0000000F) /*!< Fraction of USARTDIV */
  4166. #define USART_BRR_DIV_MANTISSA ((uint32_t)0x0000FFF0) /*!< Mantissa of USARTDIV */
  4167. /****************** Bit definition for USART_CR1 register *******************/
  4168. #define USART_CR1_SBK ((uint32_t)0x00000001) /*!< Send Break */
  4169. #define USART_CR1_RWU ((uint32_t)0x00000002) /*!< Receiver wakeup */
  4170. #define USART_CR1_RE ((uint32_t)0x00000004) /*!< Receiver Enable */
  4171. #define USART_CR1_TE ((uint32_t)0x00000008) /*!< Transmitter Enable */
  4172. #define USART_CR1_IDLEIE ((uint32_t)0x00000010) /*!< IDLE Interrupt Enable */
  4173. #define USART_CR1_RXNEIE ((uint32_t)0x00000020) /*!< RXNE Interrupt Enable */
  4174. #define USART_CR1_TCIE ((uint32_t)0x00000040) /*!< Transmission Complete Interrupt Enable */
  4175. #define USART_CR1_TXEIE ((uint32_t)0x00000080) /*!< PE Interrupt Enable */
  4176. #define USART_CR1_PEIE ((uint32_t)0x00000100) /*!< PE Interrupt Enable */
  4177. #define USART_CR1_PS ((uint32_t)0x00000200) /*!< Parity Selection */
  4178. #define USART_CR1_PCE ((uint32_t)0x00000400) /*!< Parity Control Enable */
  4179. #define USART_CR1_WAKE ((uint32_t)0x00000800) /*!< Wakeup method */
  4180. #define USART_CR1_M ((uint32_t)0x00001000) /*!< Word length */
  4181. #define USART_CR1_UE ((uint32_t)0x00002000) /*!< USART Enable */
  4182. #define USART_CR1_OVER8 ((uint32_t)0x00008000) /*!< Oversampling by 8-bit mode */
  4183. /****************** Bit definition for USART_CR2 register *******************/
  4184. #define USART_CR2_ADD ((uint32_t)0x0000000F) /*!< Address of the USART node */
  4185. #define USART_CR2_LBDL ((uint32_t)0x00000020) /*!< LIN Break Detection Length */
  4186. #define USART_CR2_LBDIE ((uint32_t)0x00000040) /*!< LIN Break Detection Interrupt Enable */
  4187. #define USART_CR2_LBCL ((uint32_t)0x00000100) /*!< Last Bit Clock pulse */
  4188. #define USART_CR2_CPHA ((uint32_t)0x00000200) /*!< Clock Phase */
  4189. #define USART_CR2_CPOL ((uint32_t)0x00000400) /*!< Clock Polarity */
  4190. #define USART_CR2_CLKEN ((uint32_t)0x00000800) /*!< Clock Enable */
  4191. #define USART_CR2_STOP ((uint32_t)0x00003000) /*!< STOP[1:0] bits (STOP bits) */
  4192. #define USART_CR2_STOP_0 ((uint32_t)0x00001000) /*!< Bit 0 */
  4193. #define USART_CR2_STOP_1 ((uint32_t)0x00002000) /*!< Bit 1 */
  4194. #define USART_CR2_LINEN ((uint32_t)0x00004000) /*!< LIN mode enable */
  4195. /****************** Bit definition for USART_CR3 register *******************/
  4196. #define USART_CR3_EIE ((uint32_t)0x00000001) /*!< Error Interrupt Enable */
  4197. #define USART_CR3_IREN ((uint32_t)0x00000002) /*!< IrDA mode Enable */
  4198. #define USART_CR3_IRLP ((uint32_t)0x00000004) /*!< IrDA Low-Power */
  4199. #define USART_CR3_HDSEL ((uint32_t)0x00000008) /*!< Half-Duplex Selection */
  4200. #define USART_CR3_NACK ((uint32_t)0x00000010) /*!< Smartcard NACK enable */
  4201. #define USART_CR3_SCEN ((uint32_t)0x00000020) /*!< Smartcard mode enable */
  4202. #define USART_CR3_DMAR ((uint32_t)0x00000040) /*!< DMA Enable Receiver */
  4203. #define USART_CR3_DMAT ((uint32_t)0x00000080) /*!< DMA Enable Transmitter */
  4204. #define USART_CR3_RTSE ((uint32_t)0x00000100) /*!< RTS Enable */
  4205. #define USART_CR3_CTSE ((uint32_t)0x00000200) /*!< CTS Enable */
  4206. #define USART_CR3_CTSIE ((uint32_t)0x00000400) /*!< CTS Interrupt Enable */
  4207. #define USART_CR3_ONEBIT ((uint32_t)0x00000800) /*!< One sample bit method enable */
  4208. /****************** Bit definition for USART_GTPR register ******************/
  4209. #define USART_GTPR_PSC ((uint32_t)0x000000FF) /*!< PSC[7:0] bits (Prescaler value) */
  4210. #define USART_GTPR_PSC_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  4211. #define USART_GTPR_PSC_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  4212. #define USART_GTPR_PSC_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  4213. #define USART_GTPR_PSC_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  4214. #define USART_GTPR_PSC_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  4215. #define USART_GTPR_PSC_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  4216. #define USART_GTPR_PSC_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  4217. #define USART_GTPR_PSC_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  4218. #define USART_GTPR_GT ((uint32_t)0x0000FF00) /*!< Guard time value */
  4219. /******************************************************************************/
  4220. /* */
  4221. /* Universal Serial Bus (USB) */
  4222. /* */
  4223. /******************************************************************************/
  4224. /*!<Endpoint-specific registers */
  4225. #define USB_EP0R USB_BASE /*!< endpoint 0 register address */
  4226. #define USB_EP1R (USB_BASE + 0x00000004) /*!< endpoint 1 register address */
  4227. #define USB_EP2R (USB_BASE + 0x00000008) /*!< endpoint 2 register address */
  4228. #define USB_EP3R (USB_BASE + 0x0000000C) /*!< endpoint 3 register address */
  4229. #define USB_EP4R (USB_BASE + 0x00000010) /*!< endpoint 4 register address */
  4230. #define USB_EP5R (USB_BASE + 0x00000014) /*!< endpoint 5 register address */
  4231. #define USB_EP6R (USB_BASE + 0x00000018) /*!< endpoint 6 register address */
  4232. #define USB_EP7R (USB_BASE + 0x0000001C) /*!< endpoint 7 register address */
  4233. /* bit positions */
  4234. #define USB_EP_CTR_RX ((uint32_t)0x00008000) /*!< EndPoint Correct TRansfer RX */
  4235. #define USB_EP_DTOG_RX ((uint32_t)0x00004000) /*!< EndPoint Data TOGGLE RX */
  4236. #define USB_EPRX_STAT ((uint32_t)0x00003000) /*!< EndPoint RX STATus bit field */
  4237. #define USB_EP_SETUP ((uint32_t)0x00000800) /*!< EndPoint SETUP */
  4238. #define USB_EP_T_FIELD ((uint32_t)0x00000600) /*!< EndPoint TYPE */
  4239. #define USB_EP_KIND ((uint32_t)0x00000100) /*!< EndPoint KIND */
  4240. #define USB_EP_CTR_TX ((uint32_t)0x00000080) /*!< EndPoint Correct TRansfer TX */
  4241. #define USB_EP_DTOG_TX ((uint32_t)0x00000040) /*!< EndPoint Data TOGGLE TX */
  4242. #define USB_EPTX_STAT ((uint32_t)0x00000030) /*!< EndPoint TX STATus bit field */
  4243. #define USB_EPADDR_FIELD ((uint32_t)0x0000000F) /*!< EndPoint ADDRess FIELD */
  4244. /* EndPoint REGister MASK (no toggle fields) */
  4245. #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)
  4246. /*!< EP_TYPE[1:0] EndPoint TYPE */
  4247. #define USB_EP_TYPE_MASK ((uint32_t)0x00000600) /*!< EndPoint TYPE Mask */
  4248. #define USB_EP_BULK ((uint32_t)0x00000000) /*!< EndPoint BULK */
  4249. #define USB_EP_CONTROL ((uint32_t)0x00000200) /*!< EndPoint CONTROL */
  4250. #define USB_EP_ISOCHRONOUS ((uint32_t)0x00000400) /*!< EndPoint ISOCHRONOUS */
  4251. #define USB_EP_INTERRUPT ((uint32_t)0x00000600) /*!< EndPoint INTERRUPT */
  4252. #define USB_EP_T_MASK (~USB_EP_T_FIELD & USB_EPREG_MASK)
  4253. #define USB_EPKIND_MASK (~USB_EP_KIND & USB_EPREG_MASK) /*!< EP_KIND EndPoint KIND */
  4254. /*!< STAT_TX[1:0] STATus for TX transfer */
  4255. #define USB_EP_TX_DIS ((uint32_t)0x00000000) /*!< EndPoint TX DISabled */
  4256. #define USB_EP_TX_STALL ((uint32_t)0x00000010) /*!< EndPoint TX STALLed */
  4257. #define USB_EP_TX_NAK ((uint32_t)0x00000020) /*!< EndPoint TX NAKed */
  4258. #define USB_EP_TX_VALID ((uint32_t)0x00000030) /*!< EndPoint TX VALID */
  4259. #define USB_EPTX_DTOG1 ((uint32_t)0x00000010) /*!< EndPoint TX Data TOGgle bit1 */
  4260. #define USB_EPTX_DTOG2 ((uint32_t)0x00000020) /*!< EndPoint TX Data TOGgle bit2 */
  4261. #define USB_EPTX_DTOGMASK (USB_EPTX_STAT|USB_EPREG_MASK)
  4262. /*!< STAT_RX[1:0] STATus for RX transfer */
  4263. #define USB_EP_RX_DIS ((uint32_t)0x00000000) /*!< EndPoint RX DISabled */
  4264. #define USB_EP_RX_STALL ((uint32_t)0x00001000) /*!< EndPoint RX STALLed */
  4265. #define USB_EP_RX_NAK ((uint32_t)0x00002000) /*!< EndPoint RX NAKed */
  4266. #define USB_EP_RX_VALID ((uint32_t)0x00003000) /*!< EndPoint RX VALID */
  4267. #define USB_EPRX_DTOG1 ((uint32_t)0x00001000) /*!< EndPoint RX Data TOGgle bit1 */
  4268. #define USB_EPRX_DTOG2 ((uint32_t)0x00002000) /*!< EndPoint RX Data TOGgle bit1 */
  4269. #define USB_EPRX_DTOGMASK (USB_EPRX_STAT|USB_EPREG_MASK)
  4270. /******************* Bit definition for USB_EP0R register *******************/
  4271. #define USB_EP0R_EA ((uint32_t)0x0000000F) /*!<Endpoint Address */
  4272. #define USB_EP0R_STAT_TX ((uint32_t)0x00000030) /*!<STAT_TX[1:0] bits (Status bits, for transmission transfers) */
  4273. #define USB_EP0R_STAT_TX_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4274. #define USB_EP0R_STAT_TX_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4275. #define USB_EP0R_DTOG_TX ((uint32_t)0x00000040) /*!<Data Toggle, for transmission transfers */
  4276. #define USB_EP0R_CTR_TX ((uint32_t)0x00000080) /*!<Correct Transfer for transmission */
  4277. #define USB_EP0R_EP_KIND ((uint32_t)0x00000100) /*!<Endpoint Kind */
  4278. #define USB_EP0R_EP_TYPE ((uint32_t)0x00000600) /*!<EP_TYPE[1:0] bits (Endpoint type) */
  4279. #define USB_EP0R_EP_TYPE_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  4280. #define USB_EP0R_EP_TYPE_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  4281. #define USB_EP0R_SETUP ((uint32_t)0x00000800) /*!<Setup transaction completed */
  4282. #define USB_EP0R_STAT_RX ((uint32_t)0x00003000) /*!<STAT_RX[1:0] bits (Status bits, for reception transfers) */
  4283. #define USB_EP0R_STAT_RX_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  4284. #define USB_EP0R_STAT_RX_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  4285. #define USB_EP0R_DTOG_RX ((uint32_t)0x00004000) /*!<Data Toggle, for reception transfers */
  4286. #define USB_EP0R_CTR_RX ((uint32_t)0x00008000) /*!<Correct Transfer for reception */
  4287. /******************* Bit definition for USB_EP1R register *******************/
  4288. #define USB_EP1R_EA ((uint32_t)0x0000000F) /*!<Endpoint Address */
  4289. #define USB_EP1R_STAT_TX ((uint32_t)0x00000030) /*!<STAT_TX[1:0] bits (Status bits, for transmission transfers) */
  4290. #define USB_EP1R_STAT_TX_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4291. #define USB_EP1R_STAT_TX_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4292. #define USB_EP1R_DTOG_TX ((uint32_t)0x00000040) /*!<Data Toggle, for transmission transfers */
  4293. #define USB_EP1R_CTR_TX ((uint32_t)0x00000080) /*!<Correct Transfer for transmission */
  4294. #define USB_EP1R_EP_KIND ((uint32_t)0x00000100) /*!<Endpoint Kind */
  4295. #define USB_EP1R_EP_TYPE ((uint32_t)0x00000600) /*!<EP_TYPE[1:0] bits (Endpoint type) */
  4296. #define USB_EP1R_EP_TYPE_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  4297. #define USB_EP1R_EP_TYPE_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  4298. #define USB_EP1R_SETUP ((uint32_t)0x00000800) /*!<Setup transaction completed */
  4299. #define USB_EP1R_STAT_RX ((uint32_t)0x00003000) /*!<STAT_RX[1:0] bits (Status bits, for reception transfers) */
  4300. #define USB_EP1R_STAT_RX_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  4301. #define USB_EP1R_STAT_RX_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  4302. #define USB_EP1R_DTOG_RX ((uint32_t)0x00004000) /*!<Data Toggle, for reception transfers */
  4303. #define USB_EP1R_CTR_RX ((uint32_t)0x00008000) /*!<Correct Transfer for reception */
  4304. /******************* Bit definition for USB_EP2R register *******************/
  4305. #define USB_EP2R_EA ((uint32_t)0x0000000F) /*!<Endpoint Address */
  4306. #define USB_EP2R_STAT_TX ((uint32_t)0x00000030) /*!<STAT_TX[1:0] bits (Status bits, for transmission transfers) */
  4307. #define USB_EP2R_STAT_TX_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4308. #define USB_EP2R_STAT_TX_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4309. #define USB_EP2R_DTOG_TX ((uint32_t)0x00000040) /*!<Data Toggle, for transmission transfers */
  4310. #define USB_EP2R_CTR_TX ((uint32_t)0x00000080) /*!<Correct Transfer for transmission */
  4311. #define USB_EP2R_EP_KIND ((uint32_t)0x00000100) /*!<Endpoint Kind */
  4312. #define USB_EP2R_EP_TYPE ((uint32_t)0x00000600) /*!<EP_TYPE[1:0] bits (Endpoint type) */
  4313. #define USB_EP2R_EP_TYPE_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  4314. #define USB_EP2R_EP_TYPE_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  4315. #define USB_EP2R_SETUP ((uint32_t)0x00000800) /*!<Setup transaction completed */
  4316. #define USB_EP2R_STAT_RX ((uint32_t)0x00003000) /*!<STAT_RX[1:0] bits (Status bits, for reception transfers) */
  4317. #define USB_EP2R_STAT_RX_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  4318. #define USB_EP2R_STAT_RX_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  4319. #define USB_EP2R_DTOG_RX ((uint32_t)0x00004000) /*!<Data Toggle, for reception transfers */
  4320. #define USB_EP2R_CTR_RX ((uint32_t)0x00008000) /*!<Correct Transfer for reception */
  4321. /******************* Bit definition for USB_EP3R register *******************/
  4322. #define USB_EP3R_EA ((uint32_t)0x0000000F) /*!<Endpoint Address */
  4323. #define USB_EP3R_STAT_TX ((uint32_t)0x00000030) /*!<STAT_TX[1:0] bits (Status bits, for transmission transfers) */
  4324. #define USB_EP3R_STAT_TX_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4325. #define USB_EP3R_STAT_TX_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4326. #define USB_EP3R_DTOG_TX ((uint32_t)0x00000040) /*!<Data Toggle, for transmission transfers */
  4327. #define USB_EP3R_CTR_TX ((uint32_t)0x00000080) /*!<Correct Transfer for transmission */
  4328. #define USB_EP3R_EP_KIND ((uint32_t)0x00000100) /*!<Endpoint Kind */
  4329. #define USB_EP3R_EP_TYPE ((uint32_t)0x00000600) /*!<EP_TYPE[1:0] bits (Endpoint type) */
  4330. #define USB_EP3R_EP_TYPE_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  4331. #define USB_EP3R_EP_TYPE_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  4332. #define USB_EP3R_SETUP ((uint32_t)0x00000800) /*!<Setup transaction completed */
  4333. #define USB_EP3R_STAT_RX ((uint32_t)0x00003000) /*!<STAT_RX[1:0] bits (Status bits, for reception transfers) */
  4334. #define USB_EP3R_STAT_RX_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  4335. #define USB_EP3R_STAT_RX_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  4336. #define USB_EP3R_DTOG_RX ((uint32_t)0x00004000) /*!<Data Toggle, for reception transfers */
  4337. #define USB_EP3R_CTR_RX ((uint32_t)0x00008000) /*!<Correct Transfer for reception */
  4338. /******************* Bit definition for USB_EP4R register *******************/
  4339. #define USB_EP4R_EA ((uint32_t)0x0000000F) /*!<Endpoint Address */
  4340. #define USB_EP4R_STAT_TX ((uint32_t)0x00000030) /*!<STAT_TX[1:0] bits (Status bits, for transmission transfers) */
  4341. #define USB_EP4R_STAT_TX_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4342. #define USB_EP4R_STAT_TX_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4343. #define USB_EP4R_DTOG_TX ((uint32_t)0x00000040) /*!<Data Toggle, for transmission transfers */
  4344. #define USB_EP4R_CTR_TX ((uint32_t)0x00000080) /*!<Correct Transfer for transmission */
  4345. #define USB_EP4R_EP_KIND ((uint32_t)0x00000100) /*!<Endpoint Kind */
  4346. #define USB_EP4R_EP_TYPE ((uint32_t)0x00000600) /*!<EP_TYPE[1:0] bits (Endpoint type) */
  4347. #define USB_EP4R_EP_TYPE_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  4348. #define USB_EP4R_EP_TYPE_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  4349. #define USB_EP4R_SETUP ((uint32_t)0x00000800) /*!<Setup transaction completed */
  4350. #define USB_EP4R_STAT_RX ((uint32_t)0x00003000) /*!<STAT_RX[1:0] bits (Status bits, for reception transfers) */
  4351. #define USB_EP4R_STAT_RX_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  4352. #define USB_EP4R_STAT_RX_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  4353. #define USB_EP4R_DTOG_RX ((uint32_t)0x00004000) /*!<Data Toggle, for reception transfers */
  4354. #define USB_EP4R_CTR_RX ((uint32_t)0x00008000) /*!<Correct Transfer for reception */
  4355. /******************* Bit definition for USB_EP5R register *******************/
  4356. #define USB_EP5R_EA ((uint32_t)0x0000000F) /*!<Endpoint Address */
  4357. #define USB_EP5R_STAT_TX ((uint32_t)0x00000030) /*!<STAT_TX[1:0] bits (Status bits, for transmission transfers) */
  4358. #define USB_EP5R_STAT_TX_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4359. #define USB_EP5R_STAT_TX_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4360. #define USB_EP5R_DTOG_TX ((uint32_t)0x00000040) /*!<Data Toggle, for transmission transfers */
  4361. #define USB_EP5R_CTR_TX ((uint32_t)0x00000080) /*!<Correct Transfer for transmission */
  4362. #define USB_EP5R_EP_KIND ((uint32_t)0x00000100) /*!<Endpoint Kind */
  4363. #define USB_EP5R_EP_TYPE ((uint32_t)0x00000600) /*!<EP_TYPE[1:0] bits (Endpoint type) */
  4364. #define USB_EP5R_EP_TYPE_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  4365. #define USB_EP5R_EP_TYPE_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  4366. #define USB_EP5R_SETUP ((uint32_t)0x00000800) /*!<Setup transaction completed */
  4367. #define USB_EP5R_STAT_RX ((uint32_t)0x00003000) /*!<STAT_RX[1:0] bits (Status bits, for reception transfers) */
  4368. #define USB_EP5R_STAT_RX_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  4369. #define USB_EP5R_STAT_RX_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  4370. #define USB_EP5R_DTOG_RX ((uint32_t)0x00004000) /*!<Data Toggle, for reception transfers */
  4371. #define USB_EP5R_CTR_RX ((uint32_t)0x00008000) /*!<Correct Transfer for reception */
  4372. /******************* Bit definition for USB_EP6R register *******************/
  4373. #define USB_EP6R_EA ((uint32_t)0x0000000F) /*!<Endpoint Address */
  4374. #define USB_EP6R_STAT_TX ((uint32_t)0x00000030) /*!<STAT_TX[1:0] bits (Status bits, for transmission transfers) */
  4375. #define USB_EP6R_STAT_TX_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4376. #define USB_EP6R_STAT_TX_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4377. #define USB_EP6R_DTOG_TX ((uint32_t)0x00000040) /*!<Data Toggle, for transmission transfers */
  4378. #define USB_EP6R_CTR_TX ((uint32_t)0x00000080) /*!<Correct Transfer for transmission */
  4379. #define USB_EP6R_EP_KIND ((uint32_t)0x00000100) /*!<Endpoint Kind */
  4380. #define USB_EP6R_EP_TYPE ((uint32_t)0x00000600) /*!<EP_TYPE[1:0] bits (Endpoint type) */
  4381. #define USB_EP6R_EP_TYPE_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  4382. #define USB_EP6R_EP_TYPE_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  4383. #define USB_EP6R_SETUP ((uint32_t)0x00000800) /*!<Setup transaction completed */
  4384. #define USB_EP6R_STAT_RX ((uint32_t)0x00003000) /*!<STAT_RX[1:0] bits (Status bits, for reception transfers) */
  4385. #define USB_EP6R_STAT_RX_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  4386. #define USB_EP6R_STAT_RX_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  4387. #define USB_EP6R_DTOG_RX ((uint32_t)0x00004000) /*!<Data Toggle, for reception transfers */
  4388. #define USB_EP6R_CTR_RX ((uint32_t)0x00008000) /*!<Correct Transfer for reception */
  4389. /******************* Bit definition for USB_EP7R register *******************/
  4390. #define USB_EP7R_EA ((uint32_t)0x0000000F) /*!<Endpoint Address */
  4391. #define USB_EP7R_STAT_TX ((uint32_t)0x00000030) /*!<STAT_TX[1:0] bits (Status bits, for transmission transfers) */
  4392. #define USB_EP7R_STAT_TX_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4393. #define USB_EP7R_STAT_TX_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4394. #define USB_EP7R_DTOG_TX ((uint32_t)0x00000040) /*!<Data Toggle, for transmission transfers */
  4395. #define USB_EP7R_CTR_TX ((uint32_t)0x00000080) /*!<Correct Transfer for transmission */
  4396. #define USB_EP7R_EP_KIND ((uint32_t)0x00000100) /*!<Endpoint Kind */
  4397. #define USB_EP7R_EP_TYPE ((uint32_t)0x00000600) /*!<EP_TYPE[1:0] bits (Endpoint type) */
  4398. #define USB_EP7R_EP_TYPE_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  4399. #define USB_EP7R_EP_TYPE_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  4400. #define USB_EP7R_SETUP ((uint32_t)0x00000800) /*!<Setup transaction completed */
  4401. #define USB_EP7R_STAT_RX ((uint32_t)0x00003000) /*!<STAT_RX[1:0] bits (Status bits, for reception transfers) */
  4402. #define USB_EP7R_STAT_RX_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  4403. #define USB_EP7R_STAT_RX_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  4404. #define USB_EP7R_DTOG_RX ((uint32_t)0x00004000) /*!<Data Toggle, for reception transfers */
  4405. #define USB_EP7R_CTR_RX ((uint32_t)0x00008000) /*!<Correct Transfer for reception */
  4406. /*!<Common registers */
  4407. #define USB_CNTR (USB_BASE + 0x00000040) /*!< Control register */
  4408. #define USB_ISTR (USB_BASE + 0x00000044) /*!< Interrupt status register */
  4409. #define USB_FNR (USB_BASE + 0x00000048) /*!< Frame number register */
  4410. #define USB_DADDR (USB_BASE + 0x0000004C) /*!< Device address register */
  4411. #define USB_BTABLE (USB_BASE + 0x00000050) /*!< Buffer Table address register */
  4412. /******************* Bit definition for USB_CNTR register *******************/
  4413. #define USB_CNTR_FRES ((uint32_t)0x00000001) /*!<Force USB Reset */
  4414. #define USB_CNTR_PDWN ((uint32_t)0x00000002) /*!<Power down */
  4415. #define USB_CNTR_LP_MODE ((uint32_t)0x00000004) /*!<Low-power mode */
  4416. #define USB_CNTR_FSUSP ((uint32_t)0x00000008) /*!<Force suspend */
  4417. #define USB_CNTR_RESUME ((uint32_t)0x00000010) /*!<Resume request */
  4418. #define USB_CNTR_ESOFM ((uint32_t)0x00000100) /*!<Expected Start Of Frame Interrupt Mask */
  4419. #define USB_CNTR_SOFM ((uint32_t)0x00000200) /*!<Start Of Frame Interrupt Mask */
  4420. #define USB_CNTR_RESETM ((uint32_t)0x00000400) /*!<RESET Interrupt Mask */
  4421. #define USB_CNTR_SUSPM ((uint32_t)0x00000800) /*!<Suspend mode Interrupt Mask */
  4422. #define USB_CNTR_WKUPM ((uint32_t)0x00001000) /*!<Wakeup Interrupt Mask */
  4423. #define USB_CNTR_ERRM ((uint32_t)0x00002000) /*!<Error Interrupt Mask */
  4424. #define USB_CNTR_PMAOVRM ((uint32_t)0x00004000) /*!<Packet Memory Area Over / Underrun Interrupt Mask */
  4425. #define USB_CNTR_CTRM ((uint32_t)0x00008000) /*!<Correct Transfer Interrupt Mask */
  4426. /******************* Bit definition for USB_ISTR register *******************/
  4427. #define USB_ISTR_EP_ID ((uint32_t)0x0000000F) /*!<Endpoint Identifier */
  4428. #define USB_ISTR_DIR ((uint32_t)0x00000010) /*!<Direction of transaction */
  4429. #define USB_ISTR_ESOF ((uint32_t)0x00000100) /*!<Expected Start Of Frame */
  4430. #define USB_ISTR_SOF ((uint32_t)0x00000200) /*!<Start Of Frame */
  4431. #define USB_ISTR_RESET ((uint32_t)0x00000400) /*!<USB RESET request */
  4432. #define USB_ISTR_SUSP ((uint32_t)0x00000800) /*!<Suspend mode request */
  4433. #define USB_ISTR_WKUP ((uint32_t)0x00001000) /*!<Wake up */
  4434. #define USB_ISTR_ERR ((uint32_t)0x00002000) /*!<Error */
  4435. #define USB_ISTR_PMAOVRM ((uint32_t)0x00004000) /*!<Packet Memory Area Over / Underrun */
  4436. #define USB_ISTR_CTR ((uint32_t)0x00008000) /*!<Correct Transfer */
  4437. #define USB_CLR_CTR (~USB_ISTR_CTR) /*!< clear Correct TRansfer bit */
  4438. #define USB_CLR_PMAOVRM (~USB_ISTR_PMAOVR) /*!< clear DMA OVeR/underrun bit*/
  4439. #define USB_CLR_ERR (~USB_ISTR_ERR) /*!< clear ERRor bit */
  4440. #define USB_CLR_WKUP (~USB_ISTR_WKUP) /*!< clear WaKe UP bit */
  4441. #define USB_CLR_SUSP (~USB_ISTR_SUSP) /*!< clear SUSPend bit */
  4442. #define USB_CLR_RESET (~USB_ISTR_RESET) /*!< clear RESET bit */
  4443. #define USB_CLR_SOF (~USB_ISTR_SOF) /*!< clear Start Of Frame bit */
  4444. #define USB_CLR_ESOF (~USB_ISTR_ESOF) /*!< clear Expected Start Of Frame bit */
  4445. /******************* Bit definition for USB_FNR register ********************/
  4446. #define USB_FNR_FN ((uint32_t)0x000007FF) /*!<Frame Number */
  4447. #define USB_FNR_LSOF ((uint32_t)0x00001800) /*!<Lost SOF */
  4448. #define USB_FNR_LCK ((uint32_t)0x00002000) /*!<Locked */
  4449. #define USB_FNR_RXDM ((uint32_t)0x00004000) /*!<Receive Data - Line Status */
  4450. #define USB_FNR_RXDP ((uint32_t)0x00008000) /*!<Receive Data + Line Status */
  4451. /****************** Bit definition for USB_DADDR register *******************/
  4452. #define USB_DADDR_ADD ((uint32_t)0x0000007F) /*!<ADD[6:0] bits (Device Address) */
  4453. #define USB_DADDR_ADD0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4454. #define USB_DADDR_ADD1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4455. #define USB_DADDR_ADD2 ((uint32_t)0x00000004) /*!<Bit 2 */
  4456. #define USB_DADDR_ADD3 ((uint32_t)0x00000008) /*!<Bit 3 */
  4457. #define USB_DADDR_ADD4 ((uint32_t)0x00000010) /*!<Bit 4 */
  4458. #define USB_DADDR_ADD5 ((uint32_t)0x00000020) /*!<Bit 5 */
  4459. #define USB_DADDR_ADD6 ((uint32_t)0x00000040) /*!<Bit 6 */
  4460. #define USB_DADDR_EF ((uint32_t)0x00000080) /*!<Enable Function */
  4461. /****************** Bit definition for USB_BTABLE register ******************/
  4462. #define USB_BTABLE_BTABLE ((uint32_t)0x0000FFF8) /*!<Buffer Table */
  4463. /*!< Buffer descriptor table */
  4464. /***************** Bit definition for USB_ADDR0_TX register *****************/
  4465. #define USB_ADDR0_TX_ADDR0_TX ((uint32_t)0x0000FFFE) /*!< Transmission Buffer Address 0 */
  4466. /***************** Bit definition for USB_ADDR1_TX register *****************/
  4467. #define USB_ADDR1_TX_ADDR1_TX ((uint32_t)0x0000FFFE) /*!< Transmission Buffer Address 1 */
  4468. /***************** Bit definition for USB_ADDR2_TX register *****************/
  4469. #define USB_ADDR2_TX_ADDR2_TX ((uint32_t)0x0000FFFE) /*!< Transmission Buffer Address 2 */
  4470. /***************** Bit definition for USB_ADDR3_TX register *****************/
  4471. #define USB_ADDR3_TX_ADDR3_TX ((uint32_t)0x0000FFFE) /*!< Transmission Buffer Address 3 */
  4472. /***************** Bit definition for USB_ADDR4_TX register *****************/
  4473. #define USB_ADDR4_TX_ADDR4_TX ((uint32_t)0x0000FFFE) /*!< Transmission Buffer Address 4 */
  4474. /***************** Bit definition for USB_ADDR5_TX register *****************/
  4475. #define USB_ADDR5_TX_ADDR5_TX ((uint32_t)0x0000FFFE) /*!< Transmission Buffer Address 5 */
  4476. /***************** Bit definition for USB_ADDR6_TX register *****************/
  4477. #define USB_ADDR6_TX_ADDR6_TX ((uint32_t)0x0000FFFE) /*!< Transmission Buffer Address 6 */
  4478. /***************** Bit definition for USB_ADDR7_TX register *****************/
  4479. #define USB_ADDR7_TX_ADDR7_TX ((uint32_t)0x0000FFFE) /*!< Transmission Buffer Address 7 */
  4480. /*----------------------------------------------------------------------------*/
  4481. /***************** Bit definition for USB_COUNT0_TX register ****************/
  4482. #define USB_COUNT0_TX_COUNT0_TX ((uint32_t)0x000003FF) /*!< Transmission Byte Count 0 */
  4483. /***************** Bit definition for USB_COUNT1_TX register ****************/
  4484. #define USB_COUNT1_TX_COUNT1_TX ((uint32_t)0x000003FF) /*!< Transmission Byte Count 1 */
  4485. /***************** Bit definition for USB_COUNT2_TX register ****************/
  4486. #define USB_COUNT2_TX_COUNT2_TX ((uint32_t)0x000003FF) /*!< Transmission Byte Count 2 */
  4487. /***************** Bit definition for USB_COUNT3_TX register ****************/
  4488. #define USB_COUNT3_TX_COUNT3_TX ((uint32_t)0x000003FF) /*!< Transmission Byte Count 3 */
  4489. /***************** Bit definition for USB_COUNT4_TX register ****************/
  4490. #define USB_COUNT4_TX_COUNT4_TX ((uint32_t)0x000003FF) /*!< Transmission Byte Count 4 */
  4491. /***************** Bit definition for USB_COUNT5_TX register ****************/
  4492. #define USB_COUNT5_TX_COUNT5_TX ((uint32_t)0x000003FF) /*!< Transmission Byte Count 5 */
  4493. /***************** Bit definition for USB_COUNT6_TX register ****************/
  4494. #define USB_COUNT6_TX_COUNT6_TX ((uint32_t)0x000003FF) /*!< Transmission Byte Count 6 */
  4495. /***************** Bit definition for USB_COUNT7_TX register ****************/
  4496. #define USB_COUNT7_TX_COUNT7_TX ((uint32_t)0x000003FF) /*!< Transmission Byte Count 7 */
  4497. /*----------------------------------------------------------------------------*/
  4498. /**************** Bit definition for USB_COUNT0_TX_0 register ***************/
  4499. #define USB_COUNT0_TX_0_COUNT0_TX_0 ((uint32_t)0x000003FF) /*!< Transmission Byte Count 0 (low) */
  4500. /**************** Bit definition for USB_COUNT0_TX_1 register ***************/
  4501. #define USB_COUNT0_TX_1_COUNT0_TX_1 ((uint32_t)0x03FF0000) /*!< Transmission Byte Count 0 (high) */
  4502. /**************** Bit definition for USB_COUNT1_TX_0 register ***************/
  4503. #define USB_COUNT1_TX_0_COUNT1_TX_0 ((uint32_t)0x000003FF) /*!< Transmission Byte Count 1 (low) */
  4504. /**************** Bit definition for USB_COUNT1_TX_1 register ***************/
  4505. #define USB_COUNT1_TX_1_COUNT1_TX_1 ((uint32_t)0x03FF0000) /*!< Transmission Byte Count 1 (high) */
  4506. /**************** Bit definition for USB_COUNT2_TX_0 register ***************/
  4507. #define USB_COUNT2_TX_0_COUNT2_TX_0 ((uint32_t)0x000003FF) /*!< Transmission Byte Count 2 (low) */
  4508. /**************** Bit definition for USB_COUNT2_TX_1 register ***************/
  4509. #define USB_COUNT2_TX_1_COUNT2_TX_1 ((uint32_t)0x03FF0000) /*!< Transmission Byte Count 2 (high) */
  4510. /**************** Bit definition for USB_COUNT3_TX_0 register ***************/
  4511. #define USB_COUNT3_TX_0_COUNT3_TX_0 ((uint32_t)0x0000000003FF) /*!< Transmission Byte Count 3 (low) */
  4512. /**************** Bit definition for USB_COUNT3_TX_1 register ***************/
  4513. #define USB_COUNT3_TX_1_COUNT3_TX_1 ((uint32_t)0x000003FF0000) /*!< Transmission Byte Count 3 (high) */
  4514. /**************** Bit definition for USB_COUNT4_TX_0 register ***************/
  4515. #define USB_COUNT4_TX_0_COUNT4_TX_0 ((uint32_t)0x000003FF) /*!< Transmission Byte Count 4 (low) */
  4516. /**************** Bit definition for USB_COUNT4_TX_1 register ***************/
  4517. #define USB_COUNT4_TX_1_COUNT4_TX_1 ((uint32_t)0x03FF0000) /*!< Transmission Byte Count 4 (high) */
  4518. /**************** Bit definition for USB_COUNT5_TX_0 register ***************/
  4519. #define USB_COUNT5_TX_0_COUNT5_TX_0 ((uint32_t)0x000003FF) /*!< Transmission Byte Count 5 (low) */
  4520. /**************** Bit definition for USB_COUNT5_TX_1 register ***************/
  4521. #define USB_COUNT5_TX_1_COUNT5_TX_1 ((uint32_t)0x03FF0000) /*!< Transmission Byte Count 5 (high) */
  4522. /**************** Bit definition for USB_COUNT6_TX_0 register ***************/
  4523. #define USB_COUNT6_TX_0_COUNT6_TX_0 ((uint32_t)0x000003FF) /*!< Transmission Byte Count 6 (low) */
  4524. /**************** Bit definition for USB_COUNT6_TX_1 register ***************/
  4525. #define USB_COUNT6_TX_1_COUNT6_TX_1 ((uint32_t)0x03FF0000) /*!< Transmission Byte Count 6 (high) */
  4526. /**************** Bit definition for USB_COUNT7_TX_0 register ***************/
  4527. #define USB_COUNT7_TX_0_COUNT7_TX_0 ((uint32_t)0x000003FF) /*!< Transmission Byte Count 7 (low) */
  4528. /**************** Bit definition for USB_COUNT7_TX_1 register ***************/
  4529. #define USB_COUNT7_TX_1_COUNT7_TX_1 ((uint32_t)0x03FF0000) /*!< Transmission Byte Count 7 (high) */
  4530. /*----------------------------------------------------------------------------*/
  4531. /***************** Bit definition for USB_ADDR0_RX register *****************/
  4532. #define USB_ADDR0_RX_ADDR0_RX ((uint32_t)0x0000FFFE) /*!< Reception Buffer Address 0 */
  4533. /***************** Bit definition for USB_ADDR1_RX register *****************/
  4534. #define USB_ADDR1_RX_ADDR1_RX ((uint32_t)0x0000FFFE) /*!< Reception Buffer Address 1 */
  4535. /***************** Bit definition for USB_ADDR2_RX register *****************/
  4536. #define USB_ADDR2_RX_ADDR2_RX ((uint32_t)0x0000FFFE) /*!< Reception Buffer Address 2 */
  4537. /***************** Bit definition for USB_ADDR3_RX register *****************/
  4538. #define USB_ADDR3_RX_ADDR3_RX ((uint32_t)0x0000FFFE) /*!< Reception Buffer Address 3 */
  4539. /***************** Bit definition for USB_ADDR4_RX register *****************/
  4540. #define USB_ADDR4_RX_ADDR4_RX ((uint32_t)0x0000FFFE) /*!< Reception Buffer Address 4 */
  4541. /***************** Bit definition for USB_ADDR5_RX register *****************/
  4542. #define USB_ADDR5_RX_ADDR5_RX ((uint32_t)0x0000FFFE) /*!< Reception Buffer Address 5 */
  4543. /***************** Bit definition for USB_ADDR6_RX register *****************/
  4544. #define USB_ADDR6_RX_ADDR6_RX ((uint32_t)0x0000FFFE) /*!< Reception Buffer Address 6 */
  4545. /***************** Bit definition for USB_ADDR7_RX register *****************/
  4546. #define USB_ADDR7_RX_ADDR7_RX ((uint32_t)0x0000FFFE) /*!< Reception Buffer Address 7 */
  4547. /*----------------------------------------------------------------------------*/
  4548. /***************** Bit definition for USB_COUNT0_RX register ****************/
  4549. #define USB_COUNT0_RX_COUNT0_RX ((uint32_t)0x000003FF) /*!< Reception Byte Count */
  4550. #define USB_COUNT0_RX_NUM_BLOCK ((uint32_t)0x00007C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
  4551. #define USB_COUNT0_RX_NUM_BLOCK_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4552. #define USB_COUNT0_RX_NUM_BLOCK_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4553. #define USB_COUNT0_RX_NUM_BLOCK_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4554. #define USB_COUNT0_RX_NUM_BLOCK_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4555. #define USB_COUNT0_RX_NUM_BLOCK_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4556. #define USB_COUNT0_RX_BLSIZE ((uint32_t)0x00008000) /*!< BLock SIZE */
  4557. /***************** Bit definition for USB_COUNT1_RX register ****************/
  4558. #define USB_COUNT1_RX_COUNT1_RX ((uint32_t)0x000003FF) /*!< Reception Byte Count */
  4559. #define USB_COUNT1_RX_NUM_BLOCK ((uint32_t)0x00007C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
  4560. #define USB_COUNT1_RX_NUM_BLOCK_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4561. #define USB_COUNT1_RX_NUM_BLOCK_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4562. #define USB_COUNT1_RX_NUM_BLOCK_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4563. #define USB_COUNT1_RX_NUM_BLOCK_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4564. #define USB_COUNT1_RX_NUM_BLOCK_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4565. #define USB_COUNT1_RX_BLSIZE ((uint32_t)0x00008000) /*!< BLock SIZE */
  4566. /***************** Bit definition for USB_COUNT2_RX register ****************/
  4567. #define USB_COUNT2_RX_COUNT2_RX ((uint32_t)0x000003FF) /*!< Reception Byte Count */
  4568. #define USB_COUNT2_RX_NUM_BLOCK ((uint32_t)0x00007C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
  4569. #define USB_COUNT2_RX_NUM_BLOCK_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4570. #define USB_COUNT2_RX_NUM_BLOCK_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4571. #define USB_COUNT2_RX_NUM_BLOCK_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4572. #define USB_COUNT2_RX_NUM_BLOCK_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4573. #define USB_COUNT2_RX_NUM_BLOCK_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4574. #define USB_COUNT2_RX_BLSIZE ((uint32_t)0x00008000) /*!< BLock SIZE */
  4575. /***************** Bit definition for USB_COUNT3_RX register ****************/
  4576. #define USB_COUNT3_RX_COUNT3_RX ((uint32_t)0x000003FF) /*!< Reception Byte Count */
  4577. #define USB_COUNT3_RX_NUM_BLOCK ((uint32_t)0x00007C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
  4578. #define USB_COUNT3_RX_NUM_BLOCK_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4579. #define USB_COUNT3_RX_NUM_BLOCK_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4580. #define USB_COUNT3_RX_NUM_BLOCK_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4581. #define USB_COUNT3_RX_NUM_BLOCK_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4582. #define USB_COUNT3_RX_NUM_BLOCK_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4583. #define USB_COUNT3_RX_BLSIZE ((uint32_t)0x00008000) /*!< BLock SIZE */
  4584. /***************** Bit definition for USB_COUNT4_RX register ****************/
  4585. #define USB_COUNT4_RX_COUNT4_RX ((uint32_t)0x000003FF) /*!< Reception Byte Count */
  4586. #define USB_COUNT4_RX_NUM_BLOCK ((uint32_t)0x00007C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
  4587. #define USB_COUNT4_RX_NUM_BLOCK_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4588. #define USB_COUNT4_RX_NUM_BLOCK_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4589. #define USB_COUNT4_RX_NUM_BLOCK_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4590. #define USB_COUNT4_RX_NUM_BLOCK_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4591. #define USB_COUNT4_RX_NUM_BLOCK_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4592. #define USB_COUNT4_RX_BLSIZE ((uint32_t)0x00008000) /*!< BLock SIZE */
  4593. /***************** Bit definition for USB_COUNT5_RX register ****************/
  4594. #define USB_COUNT5_RX_COUNT5_RX ((uint32_t)0x000003FF) /*!< Reception Byte Count */
  4595. #define USB_COUNT5_RX_NUM_BLOCK ((uint32_t)0x00007C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
  4596. #define USB_COUNT5_RX_NUM_BLOCK_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4597. #define USB_COUNT5_RX_NUM_BLOCK_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4598. #define USB_COUNT5_RX_NUM_BLOCK_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4599. #define USB_COUNT5_RX_NUM_BLOCK_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4600. #define USB_COUNT5_RX_NUM_BLOCK_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4601. #define USB_COUNT5_RX_BLSIZE ((uint32_t)0x00008000) /*!< BLock SIZE */
  4602. /***************** Bit definition for USB_COUNT6_RX register ****************/
  4603. #define USB_COUNT6_RX_COUNT6_RX ((uint32_t)0x000003FF) /*!< Reception Byte Count */
  4604. #define USB_COUNT6_RX_NUM_BLOCK ((uint32_t)0x00007C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
  4605. #define USB_COUNT6_RX_NUM_BLOCK_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4606. #define USB_COUNT6_RX_NUM_BLOCK_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4607. #define USB_COUNT6_RX_NUM_BLOCK_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4608. #define USB_COUNT6_RX_NUM_BLOCK_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4609. #define USB_COUNT6_RX_NUM_BLOCK_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4610. #define USB_COUNT6_RX_BLSIZE ((uint32_t)0x00008000) /*!< BLock SIZE */
  4611. /***************** Bit definition for USB_COUNT7_RX register ****************/
  4612. #define USB_COUNT7_RX_COUNT7_RX ((uint32_t)0x000003FF) /*!< Reception Byte Count */
  4613. #define USB_COUNT7_RX_NUM_BLOCK ((uint32_t)0x00007C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
  4614. #define USB_COUNT7_RX_NUM_BLOCK_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4615. #define USB_COUNT7_RX_NUM_BLOCK_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4616. #define USB_COUNT7_RX_NUM_BLOCK_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4617. #define USB_COUNT7_RX_NUM_BLOCK_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4618. #define USB_COUNT7_RX_NUM_BLOCK_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4619. #define USB_COUNT7_RX_BLSIZE ((uint32_t)0x00008000) /*!< BLock SIZE */
  4620. /*----------------------------------------------------------------------------*/
  4621. /**************** Bit definition for USB_COUNT0_RX_0 register ***************/
  4622. #define USB_COUNT0_RX_0_COUNT0_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
  4623. #define USB_COUNT0_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
  4624. #define USB_COUNT0_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4625. #define USB_COUNT0_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4626. #define USB_COUNT0_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4627. #define USB_COUNT0_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4628. #define USB_COUNT0_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4629. #define USB_COUNT0_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
  4630. /**************** Bit definition for USB_COUNT0_RX_1 register ***************/
  4631. #define USB_COUNT0_RX_1_COUNT0_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
  4632. #define USB_COUNT0_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
  4633. #define USB_COUNT0_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 1 */
  4634. #define USB_COUNT0_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
  4635. #define USB_COUNT0_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
  4636. #define USB_COUNT0_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
  4637. #define USB_COUNT0_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
  4638. #define USB_COUNT0_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
  4639. /**************** Bit definition for USB_COUNT1_RX_0 register ***************/
  4640. #define USB_COUNT1_RX_0_COUNT1_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
  4641. #define USB_COUNT1_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
  4642. #define USB_COUNT1_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4643. #define USB_COUNT1_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4644. #define USB_COUNT1_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4645. #define USB_COUNT1_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4646. #define USB_COUNT1_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4647. #define USB_COUNT1_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
  4648. /**************** Bit definition for USB_COUNT1_RX_1 register ***************/
  4649. #define USB_COUNT1_RX_1_COUNT1_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
  4650. #define USB_COUNT1_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
  4651. #define USB_COUNT1_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 0 */
  4652. #define USB_COUNT1_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
  4653. #define USB_COUNT1_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
  4654. #define USB_COUNT1_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
  4655. #define USB_COUNT1_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
  4656. #define USB_COUNT1_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
  4657. /**************** Bit definition for USB_COUNT2_RX_0 register ***************/
  4658. #define USB_COUNT2_RX_0_COUNT2_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
  4659. #define USB_COUNT2_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
  4660. #define USB_COUNT2_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4661. #define USB_COUNT2_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4662. #define USB_COUNT2_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4663. #define USB_COUNT2_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4664. #define USB_COUNT2_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4665. #define USB_COUNT2_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
  4666. /**************** Bit definition for USB_COUNT2_RX_1 register ***************/
  4667. #define USB_COUNT2_RX_1_COUNT2_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
  4668. #define USB_COUNT2_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
  4669. #define USB_COUNT2_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 0 */
  4670. #define USB_COUNT2_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
  4671. #define USB_COUNT2_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
  4672. #define USB_COUNT2_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
  4673. #define USB_COUNT2_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
  4674. #define USB_COUNT2_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
  4675. /**************** Bit definition for USB_COUNT3_RX_0 register ***************/
  4676. #define USB_COUNT3_RX_0_COUNT3_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
  4677. #define USB_COUNT3_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
  4678. #define USB_COUNT3_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4679. #define USB_COUNT3_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4680. #define USB_COUNT3_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4681. #define USB_COUNT3_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4682. #define USB_COUNT3_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4683. #define USB_COUNT3_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
  4684. /**************** Bit definition for USB_COUNT3_RX_1 register ***************/
  4685. #define USB_COUNT3_RX_1_COUNT3_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
  4686. #define USB_COUNT3_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
  4687. #define USB_COUNT3_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 0 */
  4688. #define USB_COUNT3_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
  4689. #define USB_COUNT3_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
  4690. #define USB_COUNT3_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
  4691. #define USB_COUNT3_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
  4692. #define USB_COUNT3_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
  4693. /**************** Bit definition for USB_COUNT4_RX_0 register ***************/
  4694. #define USB_COUNT4_RX_0_COUNT4_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
  4695. #define USB_COUNT4_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
  4696. #define USB_COUNT4_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4697. #define USB_COUNT4_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4698. #define USB_COUNT4_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4699. #define USB_COUNT4_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4700. #define USB_COUNT4_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4701. #define USB_COUNT4_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
  4702. /**************** Bit definition for USB_COUNT4_RX_1 register ***************/
  4703. #define USB_COUNT4_RX_1_COUNT4_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
  4704. #define USB_COUNT4_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
  4705. #define USB_COUNT4_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 0 */
  4706. #define USB_COUNT4_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
  4707. #define USB_COUNT4_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
  4708. #define USB_COUNT4_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
  4709. #define USB_COUNT4_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
  4710. #define USB_COUNT4_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
  4711. /**************** Bit definition for USB_COUNT5_RX_0 register ***************/
  4712. #define USB_COUNT5_RX_0_COUNT5_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
  4713. #define USB_COUNT5_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
  4714. #define USB_COUNT5_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4715. #define USB_COUNT5_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4716. #define USB_COUNT5_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4717. #define USB_COUNT5_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4718. #define USB_COUNT5_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4719. #define USB_COUNT5_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
  4720. /**************** Bit definition for USB_COUNT5_RX_1 register ***************/
  4721. #define USB_COUNT5_RX_1_COUNT5_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
  4722. #define USB_COUNT5_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
  4723. #define USB_COUNT5_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 0 */
  4724. #define USB_COUNT5_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
  4725. #define USB_COUNT5_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
  4726. #define USB_COUNT5_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
  4727. #define USB_COUNT5_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
  4728. #define USB_COUNT5_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
  4729. /*************** Bit definition for USB_COUNT6_RX_0 register ***************/
  4730. #define USB_COUNT6_RX_0_COUNT6_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
  4731. #define USB_COUNT6_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
  4732. #define USB_COUNT6_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4733. #define USB_COUNT6_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4734. #define USB_COUNT6_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4735. #define USB_COUNT6_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4736. #define USB_COUNT6_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4737. #define USB_COUNT6_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
  4738. /**************** Bit definition for USB_COUNT6_RX_1 register ***************/
  4739. #define USB_COUNT6_RX_1_COUNT6_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
  4740. #define USB_COUNT6_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
  4741. #define USB_COUNT6_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 0 */
  4742. #define USB_COUNT6_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
  4743. #define USB_COUNT6_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
  4744. #define USB_COUNT6_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
  4745. #define USB_COUNT6_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
  4746. #define USB_COUNT6_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
  4747. /*************** Bit definition for USB_COUNT7_RX_0 register ****************/
  4748. #define USB_COUNT7_RX_0_COUNT7_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
  4749. #define USB_COUNT7_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
  4750. #define USB_COUNT7_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4751. #define USB_COUNT7_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4752. #define USB_COUNT7_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4753. #define USB_COUNT7_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
  4754. #define USB_COUNT7_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
  4755. #define USB_COUNT7_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
  4756. /*************** Bit definition for USB_COUNT7_RX_1 register ****************/
  4757. #define USB_COUNT7_RX_1_COUNT7_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
  4758. #define USB_COUNT7_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
  4759. #define USB_COUNT7_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 0 */
  4760. #define USB_COUNT7_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
  4761. #define USB_COUNT7_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
  4762. #define USB_COUNT7_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
  4763. #define USB_COUNT7_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
  4764. #define USB_COUNT7_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
  4765. /******************************************************************************/
  4766. /* */
  4767. /* Window WATCHDOG (WWDG) */
  4768. /* */
  4769. /******************************************************************************/
  4770. /******************* Bit definition for WWDG_CR register ********************/
  4771. #define WWDG_CR_T ((uint32_t)0x0000007F) /*!< T[6:0] bits (7-Bit counter (MSB to LSB)) */
  4772. #define WWDG_CR_T0 ((uint32_t)0x00000001) /*!< Bit 0 */
  4773. #define WWDG_CR_T1 ((uint32_t)0x00000002) /*!< Bit 1 */
  4774. #define WWDG_CR_T2 ((uint32_t)0x00000004) /*!< Bit 2 */
  4775. #define WWDG_CR_T3 ((uint32_t)0x00000008) /*!< Bit 3 */
  4776. #define WWDG_CR_T4 ((uint32_t)0x00000010) /*!< Bit 4 */
  4777. #define WWDG_CR_T5 ((uint32_t)0x00000020) /*!< Bit 5 */
  4778. #define WWDG_CR_T6 ((uint32_t)0x00000040) /*!< Bit 6 */
  4779. #define WWDG_CR_WDGA ((uint32_t)0x00000080) /*!< Activation bit */
  4780. /******************* Bit definition for WWDG_CFR register *******************/
  4781. #define WWDG_CFR_W ((uint32_t)0x0000007F) /*!< W[6:0] bits (7-bit window value) */
  4782. #define WWDG_CFR_W0 ((uint32_t)0x00000001) /*!< Bit 0 */
  4783. #define WWDG_CFR_W1 ((uint32_t)0x00000002) /*!< Bit 1 */
  4784. #define WWDG_CFR_W2 ((uint32_t)0x00000004) /*!< Bit 2 */
  4785. #define WWDG_CFR_W3 ((uint32_t)0x00000008) /*!< Bit 3 */
  4786. #define WWDG_CFR_W4 ((uint32_t)0x00000010) /*!< Bit 4 */
  4787. #define WWDG_CFR_W5 ((uint32_t)0x00000020) /*!< Bit 5 */
  4788. #define WWDG_CFR_W6 ((uint32_t)0x00000040) /*!< Bit 6 */
  4789. #define WWDG_CFR_WDGTB ((uint32_t)0x00000180) /*!< WDGTB[1:0] bits (Timer Base) */
  4790. #define WWDG_CFR_WDGTB0 ((uint32_t)0x00000080) /*!< Bit 0 */
  4791. #define WWDG_CFR_WDGTB1 ((uint32_t)0x00000100) /*!< Bit 1 */
  4792. #define WWDG_CFR_EWI ((uint32_t)0x00000200) /*!< Early Wakeup Interrupt */
  4793. /******************* Bit definition for WWDG_SR register ********************/
  4794. #define WWDG_SR_EWIF ((uint32_t)0x00000001) /*!< Early Wakeup Interrupt Flag */
  4795. /******************************************************************************/
  4796. /* */
  4797. /* SystemTick (SysTick) */
  4798. /* */
  4799. /******************************************************************************/
  4800. /***************** Bit definition for SysTick_CTRL register *****************/
  4801. #define SysTick_CTRL_ENABLE ((uint32_t)0x00000001) /*!< Counter enable */
  4802. #define SysTick_CTRL_TICKINT ((uint32_t)0x00000002) /*!< Counting down to 0 pends the SysTick handler */
  4803. #define SysTick_CTRL_CLKSOURCE ((uint32_t)0x00000004) /*!< Clock source */
  4804. #define SysTick_CTRL_COUNTFLAG ((uint32_t)0x00010000) /*!< Count Flag */
  4805. /***************** Bit definition for SysTick_LOAD register *****************/
  4806. #define SysTick_LOAD_RELOAD ((uint32_t)0x00FFFFFF) /*!< Value to load into the SysTick Current Value Register when the counter reaches 0 */
  4807. /***************** Bit definition for SysTick_VAL register ******************/
  4808. #define SysTick_VAL_CURRENT ((uint32_t)0x00FFFFFF) /*!< Current value at the time the register is accessed */
  4809. /***************** Bit definition for SysTick_CALIB register ****************/
  4810. #define SysTick_CALIB_TENMS ((uint32_t)0x00FFFFFF) /*!< Reload value to use for 10ms timing */
  4811. #define SysTick_CALIB_SKEW ((uint32_t)0x40000000) /*!< Calibration value is not exactly 10 ms */
  4812. #define SysTick_CALIB_NOREF ((uint32_t)0x80000000) /*!< The reference clock is not provided */
  4813. /******************************************************************************/
  4814. /* */
  4815. /* Nested Vectored Interrupt Controller (NVIC) */
  4816. /* */
  4817. /******************************************************************************/
  4818. /****************** Bit definition for NVIC_ISER register *******************/
  4819. #define NVIC_ISER_SETENA ((uint32_t)0xFFFFFFFF) /*!< Interrupt set enable bits */
  4820. #define NVIC_ISER_SETENA_0 ((uint32_t)0x00000001) /*!< bit 0 */
  4821. #define NVIC_ISER_SETENA_1 ((uint32_t)0x00000002) /*!< bit 1 */
  4822. #define NVIC_ISER_SETENA_2 ((uint32_t)0x00000004) /*!< bit 2 */
  4823. #define NVIC_ISER_SETENA_3 ((uint32_t)0x00000008) /*!< bit 3 */
  4824. #define NVIC_ISER_SETENA_4 ((uint32_t)0x00000010) /*!< bit 4 */
  4825. #define NVIC_ISER_SETENA_5 ((uint32_t)0x00000020) /*!< bit 5 */
  4826. #define NVIC_ISER_SETENA_6 ((uint32_t)0x00000040) /*!< bit 6 */
  4827. #define NVIC_ISER_SETENA_7 ((uint32_t)0x00000080) /*!< bit 7 */
  4828. #define NVIC_ISER_SETENA_8 ((uint32_t)0x00000100) /*!< bit 8 */
  4829. #define NVIC_ISER_SETENA_9 ((uint32_t)0x00000200) /*!< bit 9 */
  4830. #define NVIC_ISER_SETENA_10 ((uint32_t)0x00000400) /*!< bit 10 */
  4831. #define NVIC_ISER_SETENA_11 ((uint32_t)0x00000800) /*!< bit 11 */
  4832. #define NVIC_ISER_SETENA_12 ((uint32_t)0x00001000) /*!< bit 12 */
  4833. #define NVIC_ISER_SETENA_13 ((uint32_t)0x00002000) /*!< bit 13 */
  4834. #define NVIC_ISER_SETENA_14 ((uint32_t)0x00004000) /*!< bit 14 */
  4835. #define NVIC_ISER_SETENA_15 ((uint32_t)0x00008000) /*!< bit 15 */
  4836. #define NVIC_ISER_SETENA_16 ((uint32_t)0x00010000) /*!< bit 16 */
  4837. #define NVIC_ISER_SETENA_17 ((uint32_t)0x00020000) /*!< bit 17 */
  4838. #define NVIC_ISER_SETENA_18 ((uint32_t)0x00040000) /*!< bit 18 */
  4839. #define NVIC_ISER_SETENA_19 ((uint32_t)0x00080000) /*!< bit 19 */
  4840. #define NVIC_ISER_SETENA_20 ((uint32_t)0x00100000) /*!< bit 20 */
  4841. #define NVIC_ISER_SETENA_21 ((uint32_t)0x00200000) /*!< bit 21 */
  4842. #define NVIC_ISER_SETENA_22 ((uint32_t)0x00400000) /*!< bit 22 */
  4843. #define NVIC_ISER_SETENA_23 ((uint32_t)0x00800000) /*!< bit 23 */
  4844. #define NVIC_ISER_SETENA_24 ((uint32_t)0x01000000) /*!< bit 24 */
  4845. #define NVIC_ISER_SETENA_25 ((uint32_t)0x02000000) /*!< bit 25 */
  4846. #define NVIC_ISER_SETENA_26 ((uint32_t)0x04000000) /*!< bit 26 */
  4847. #define NVIC_ISER_SETENA_27 ((uint32_t)0x08000000) /*!< bit 27 */
  4848. #define NVIC_ISER_SETENA_28 ((uint32_t)0x10000000) /*!< bit 28 */
  4849. #define NVIC_ISER_SETENA_29 ((uint32_t)0x20000000) /*!< bit 29 */
  4850. #define NVIC_ISER_SETENA_30 ((uint32_t)0x40000000) /*!< bit 30 */
  4851. #define NVIC_ISER_SETENA_31 ((uint32_t)0x80000000) /*!< bit 31 */
  4852. /****************** Bit definition for NVIC_ICER register *******************/
  4853. #define NVIC_ICER_CLRENA ((uint32_t)0xFFFFFFFF) /*!< Interrupt clear-enable bits */
  4854. #define NVIC_ICER_CLRENA_0 ((uint32_t)0x00000001) /*!< bit 0 */
  4855. #define NVIC_ICER_CLRENA_1 ((uint32_t)0x00000002) /*!< bit 1 */
  4856. #define NVIC_ICER_CLRENA_2 ((uint32_t)0x00000004) /*!< bit 2 */
  4857. #define NVIC_ICER_CLRENA_3 ((uint32_t)0x00000008) /*!< bit 3 */
  4858. #define NVIC_ICER_CLRENA_4 ((uint32_t)0x00000010) /*!< bit 4 */
  4859. #define NVIC_ICER_CLRENA_5 ((uint32_t)0x00000020) /*!< bit 5 */
  4860. #define NVIC_ICER_CLRENA_6 ((uint32_t)0x00000040) /*!< bit 6 */
  4861. #define NVIC_ICER_CLRENA_7 ((uint32_t)0x00000080) /*!< bit 7 */
  4862. #define NVIC_ICER_CLRENA_8 ((uint32_t)0x00000100) /*!< bit 8 */
  4863. #define NVIC_ICER_CLRENA_9 ((uint32_t)0x00000200) /*!< bit 9 */
  4864. #define NVIC_ICER_CLRENA_10 ((uint32_t)0x00000400) /*!< bit 10 */
  4865. #define NVIC_ICER_CLRENA_11 ((uint32_t)0x00000800) /*!< bit 11 */
  4866. #define NVIC_ICER_CLRENA_12 ((uint32_t)0x00001000) /*!< bit 12 */
  4867. #define NVIC_ICER_CLRENA_13 ((uint32_t)0x00002000) /*!< bit 13 */
  4868. #define NVIC_ICER_CLRENA_14 ((uint32_t)0x00004000) /*!< bit 14 */
  4869. #define NVIC_ICER_CLRENA_15 ((uint32_t)0x00008000) /*!< bit 15 */
  4870. #define NVIC_ICER_CLRENA_16 ((uint32_t)0x00010000) /*!< bit 16 */
  4871. #define NVIC_ICER_CLRENA_17 ((uint32_t)0x00020000) /*!< bit 17 */
  4872. #define NVIC_ICER_CLRENA_18 ((uint32_t)0x00040000) /*!< bit 18 */
  4873. #define NVIC_ICER_CLRENA_19 ((uint32_t)0x00080000) /*!< bit 19 */
  4874. #define NVIC_ICER_CLRENA_20 ((uint32_t)0x00100000) /*!< bit 20 */
  4875. #define NVIC_ICER_CLRENA_21 ((uint32_t)0x00200000) /*!< bit 21 */
  4876. #define NVIC_ICER_CLRENA_22 ((uint32_t)0x00400000) /*!< bit 22 */
  4877. #define NVIC_ICER_CLRENA_23 ((uint32_t)0x00800000) /*!< bit 23 */
  4878. #define NVIC_ICER_CLRENA_24 ((uint32_t)0x01000000) /*!< bit 24 */
  4879. #define NVIC_ICER_CLRENA_25 ((uint32_t)0x02000000) /*!< bit 25 */
  4880. #define NVIC_ICER_CLRENA_26 ((uint32_t)0x04000000) /*!< bit 26 */
  4881. #define NVIC_ICER_CLRENA_27 ((uint32_t)0x08000000) /*!< bit 27 */
  4882. #define NVIC_ICER_CLRENA_28 ((uint32_t)0x10000000) /*!< bit 28 */
  4883. #define NVIC_ICER_CLRENA_29 ((uint32_t)0x20000000) /*!< bit 29 */
  4884. #define NVIC_ICER_CLRENA_30 ((uint32_t)0x40000000) /*!< bit 30 */
  4885. #define NVIC_ICER_CLRENA_31 ((uint32_t)0x80000000) /*!< bit 31 */
  4886. /****************** Bit definition for NVIC_ISPR register *******************/
  4887. #define NVIC_ISPR_SETPEND ((uint32_t)0xFFFFFFFF) /*!< Interrupt set-pending bits */
  4888. #define NVIC_ISPR_SETPEND_0 ((uint32_t)0x00000001) /*!< bit 0 */
  4889. #define NVIC_ISPR_SETPEND_1 ((uint32_t)0x00000002) /*!< bit 1 */
  4890. #define NVIC_ISPR_SETPEND_2 ((uint32_t)0x00000004) /*!< bit 2 */
  4891. #define NVIC_ISPR_SETPEND_3 ((uint32_t)0x00000008) /*!< bit 3 */
  4892. #define NVIC_ISPR_SETPEND_4 ((uint32_t)0x00000010) /*!< bit 4 */
  4893. #define NVIC_ISPR_SETPEND_5 ((uint32_t)0x00000020) /*!< bit 5 */
  4894. #define NVIC_ISPR_SETPEND_6 ((uint32_t)0x00000040) /*!< bit 6 */
  4895. #define NVIC_ISPR_SETPEND_7 ((uint32_t)0x00000080) /*!< bit 7 */
  4896. #define NVIC_ISPR_SETPEND_8 ((uint32_t)0x00000100) /*!< bit 8 */
  4897. #define NVIC_ISPR_SETPEND_9 ((uint32_t)0x00000200) /*!< bit 9 */
  4898. #define NVIC_ISPR_SETPEND_10 ((uint32_t)0x00000400) /*!< bit 10 */
  4899. #define NVIC_ISPR_SETPEND_11 ((uint32_t)0x00000800) /*!< bit 11 */
  4900. #define NVIC_ISPR_SETPEND_12 ((uint32_t)0x00001000) /*!< bit 12 */
  4901. #define NVIC_ISPR_SETPEND_13 ((uint32_t)0x00002000) /*!< bit 13 */
  4902. #define NVIC_ISPR_SETPEND_14 ((uint32_t)0x00004000) /*!< bit 14 */
  4903. #define NVIC_ISPR_SETPEND_15 ((uint32_t)0x00008000) /*!< bit 15 */
  4904. #define NVIC_ISPR_SETPEND_16 ((uint32_t)0x00010000) /*!< bit 16 */
  4905. #define NVIC_ISPR_SETPEND_17 ((uint32_t)0x00020000) /*!< bit 17 */
  4906. #define NVIC_ISPR_SETPEND_18 ((uint32_t)0x00040000) /*!< bit 18 */
  4907. #define NVIC_ISPR_SETPEND_19 ((uint32_t)0x00080000) /*!< bit 19 */
  4908. #define NVIC_ISPR_SETPEND_20 ((uint32_t)0x00100000) /*!< bit 20 */
  4909. #define NVIC_ISPR_SETPEND_21 ((uint32_t)0x00200000) /*!< bit 21 */
  4910. #define NVIC_ISPR_SETPEND_22 ((uint32_t)0x00400000) /*!< bit 22 */
  4911. #define NVIC_ISPR_SETPEND_23 ((uint32_t)0x00800000) /*!< bit 23 */
  4912. #define NVIC_ISPR_SETPEND_24 ((uint32_t)0x01000000) /*!< bit 24 */
  4913. #define NVIC_ISPR_SETPEND_25 ((uint32_t)0x02000000) /*!< bit 25 */
  4914. #define NVIC_ISPR_SETPEND_26 ((uint32_t)0x04000000) /*!< bit 26 */
  4915. #define NVIC_ISPR_SETPEND_27 ((uint32_t)0x08000000) /*!< bit 27 */
  4916. #define NVIC_ISPR_SETPEND_28 ((uint32_t)0x10000000) /*!< bit 28 */
  4917. #define NVIC_ISPR_SETPEND_29 ((uint32_t)0x20000000) /*!< bit 29 */
  4918. #define NVIC_ISPR_SETPEND_30 ((uint32_t)0x40000000) /*!< bit 30 */
  4919. #define NVIC_ISPR_SETPEND_31 ((uint32_t)0x80000000) /*!< bit 31 */
  4920. /****************** Bit definition for NVIC_ICPR register *******************/
  4921. #define NVIC_ICPR_CLRPEND ((uint32_t)0xFFFFFFFF) /*!< Interrupt clear-pending bits */
  4922. #define NVIC_ICPR_CLRPEND_0 ((uint32_t)0x00000001) /*!< bit 0 */
  4923. #define NVIC_ICPR_CLRPEND_1 ((uint32_t)0x00000002) /*!< bit 1 */
  4924. #define NVIC_ICPR_CLRPEND_2 ((uint32_t)0x00000004) /*!< bit 2 */
  4925. #define NVIC_ICPR_CLRPEND_3 ((uint32_t)0x00000008) /*!< bit 3 */
  4926. #define NVIC_ICPR_CLRPEND_4 ((uint32_t)0x00000010) /*!< bit 4 */
  4927. #define NVIC_ICPR_CLRPEND_5 ((uint32_t)0x00000020) /*!< bit 5 */
  4928. #define NVIC_ICPR_CLRPEND_6 ((uint32_t)0x00000040) /*!< bit 6 */
  4929. #define NVIC_ICPR_CLRPEND_7 ((uint32_t)0x00000080) /*!< bit 7 */
  4930. #define NVIC_ICPR_CLRPEND_8 ((uint32_t)0x00000100) /*!< bit 8 */
  4931. #define NVIC_ICPR_CLRPEND_9 ((uint32_t)0x00000200) /*!< bit 9 */
  4932. #define NVIC_ICPR_CLRPEND_10 ((uint32_t)0x00000400) /*!< bit 10 */
  4933. #define NVIC_ICPR_CLRPEND_11 ((uint32_t)0x00000800) /*!< bit 11 */
  4934. #define NVIC_ICPR_CLRPEND_12 ((uint32_t)0x00001000) /*!< bit 12 */
  4935. #define NVIC_ICPR_CLRPEND_13 ((uint32_t)0x00002000) /*!< bit 13 */
  4936. #define NVIC_ICPR_CLRPEND_14 ((uint32_t)0x00004000) /*!< bit 14 */
  4937. #define NVIC_ICPR_CLRPEND_15 ((uint32_t)0x00008000) /*!< bit 15 */
  4938. #define NVIC_ICPR_CLRPEND_16 ((uint32_t)0x00010000) /*!< bit 16 */
  4939. #define NVIC_ICPR_CLRPEND_17 ((uint32_t)0x00020000) /*!< bit 17 */
  4940. #define NVIC_ICPR_CLRPEND_18 ((uint32_t)0x00040000) /*!< bit 18 */
  4941. #define NVIC_ICPR_CLRPEND_19 ((uint32_t)0x00080000) /*!< bit 19 */
  4942. #define NVIC_ICPR_CLRPEND_20 ((uint32_t)0x00100000) /*!< bit 20 */
  4943. #define NVIC_ICPR_CLRPEND_21 ((uint32_t)0x00200000) /*!< bit 21 */
  4944. #define NVIC_ICPR_CLRPEND_22 ((uint32_t)0x00400000) /*!< bit 22 */
  4945. #define NVIC_ICPR_CLRPEND_23 ((uint32_t)0x00800000) /*!< bit 23 */
  4946. #define NVIC_ICPR_CLRPEND_24 ((uint32_t)0x01000000) /*!< bit 24 */
  4947. #define NVIC_ICPR_CLRPEND_25 ((uint32_t)0x02000000) /*!< bit 25 */
  4948. #define NVIC_ICPR_CLRPEND_26 ((uint32_t)0x04000000) /*!< bit 26 */
  4949. #define NVIC_ICPR_CLRPEND_27 ((uint32_t)0x08000000) /*!< bit 27 */
  4950. #define NVIC_ICPR_CLRPEND_28 ((uint32_t)0x10000000) /*!< bit 28 */
  4951. #define NVIC_ICPR_CLRPEND_29 ((uint32_t)0x20000000) /*!< bit 29 */
  4952. #define NVIC_ICPR_CLRPEND_30 ((uint32_t)0x40000000) /*!< bit 30 */
  4953. #define NVIC_ICPR_CLRPEND_31 ((uint32_t)0x80000000) /*!< bit 31 */
  4954. /****************** Bit definition for NVIC_IABR register *******************/
  4955. #define NVIC_IABR_ACTIVE ((uint32_t)0xFFFFFFFF) /*!< Interrupt active flags */
  4956. #define NVIC_IABR_ACTIVE_0 ((uint32_t)0x00000001) /*!< bit 0 */
  4957. #define NVIC_IABR_ACTIVE_1 ((uint32_t)0x00000002) /*!< bit 1 */
  4958. #define NVIC_IABR_ACTIVE_2 ((uint32_t)0x00000004) /*!< bit 2 */
  4959. #define NVIC_IABR_ACTIVE_3 ((uint32_t)0x00000008) /*!< bit 3 */
  4960. #define NVIC_IABR_ACTIVE_4 ((uint32_t)0x00000010) /*!< bit 4 */
  4961. #define NVIC_IABR_ACTIVE_5 ((uint32_t)0x00000020) /*!< bit 5 */
  4962. #define NVIC_IABR_ACTIVE_6 ((uint32_t)0x00000040) /*!< bit 6 */
  4963. #define NVIC_IABR_ACTIVE_7 ((uint32_t)0x00000080) /*!< bit 7 */
  4964. #define NVIC_IABR_ACTIVE_8 ((uint32_t)0x00000100) /*!< bit 8 */
  4965. #define NVIC_IABR_ACTIVE_9 ((uint32_t)0x00000200) /*!< bit 9 */
  4966. #define NVIC_IABR_ACTIVE_10 ((uint32_t)0x00000400) /*!< bit 10 */
  4967. #define NVIC_IABR_ACTIVE_11 ((uint32_t)0x00000800) /*!< bit 11 */
  4968. #define NVIC_IABR_ACTIVE_12 ((uint32_t)0x00001000) /*!< bit 12 */
  4969. #define NVIC_IABR_ACTIVE_13 ((uint32_t)0x00002000) /*!< bit 13 */
  4970. #define NVIC_IABR_ACTIVE_14 ((uint32_t)0x00004000) /*!< bit 14 */
  4971. #define NVIC_IABR_ACTIVE_15 ((uint32_t)0x00008000) /*!< bit 15 */
  4972. #define NVIC_IABR_ACTIVE_16 ((uint32_t)0x00010000) /*!< bit 16 */
  4973. #define NVIC_IABR_ACTIVE_17 ((uint32_t)0x00020000) /*!< bit 17 */
  4974. #define NVIC_IABR_ACTIVE_18 ((uint32_t)0x00040000) /*!< bit 18 */
  4975. #define NVIC_IABR_ACTIVE_19 ((uint32_t)0x00080000) /*!< bit 19 */
  4976. #define NVIC_IABR_ACTIVE_20 ((uint32_t)0x00100000) /*!< bit 20 */
  4977. #define NVIC_IABR_ACTIVE_21 ((uint32_t)0x00200000) /*!< bit 21 */
  4978. #define NVIC_IABR_ACTIVE_22 ((uint32_t)0x00400000) /*!< bit 22 */
  4979. #define NVIC_IABR_ACTIVE_23 ((uint32_t)0x00800000) /*!< bit 23 */
  4980. #define NVIC_IABR_ACTIVE_24 ((uint32_t)0x01000000) /*!< bit 24 */
  4981. #define NVIC_IABR_ACTIVE_25 ((uint32_t)0x02000000) /*!< bit 25 */
  4982. #define NVIC_IABR_ACTIVE_26 ((uint32_t)0x04000000) /*!< bit 26 */
  4983. #define NVIC_IABR_ACTIVE_27 ((uint32_t)0x08000000) /*!< bit 27 */
  4984. #define NVIC_IABR_ACTIVE_28 ((uint32_t)0x10000000) /*!< bit 28 */
  4985. #define NVIC_IABR_ACTIVE_29 ((uint32_t)0x20000000) /*!< bit 29 */
  4986. #define NVIC_IABR_ACTIVE_30 ((uint32_t)0x40000000) /*!< bit 30 */
  4987. #define NVIC_IABR_ACTIVE_31 ((uint32_t)0x80000000) /*!< bit 31 */
  4988. /****************** Bit definition for NVIC_PRI0 register *******************/
  4989. #define NVIC_IPR0_PRI_0 ((uint32_t)0x000000FF) /*!< Priority of interrupt 0 */
  4990. #define NVIC_IPR0_PRI_1 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 1 */
  4991. #define NVIC_IPR0_PRI_2 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 2 */
  4992. #define NVIC_IPR0_PRI_3 ((uint32_t)0xFF000000) /*!< Priority of interrupt 3 */
  4993. /****************** Bit definition for NVIC_PRI1 register *******************/
  4994. #define NVIC_IPR1_PRI_4 ((uint32_t)0x000000FF) /*!< Priority of interrupt 4 */
  4995. #define NVIC_IPR1_PRI_5 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 5 */
  4996. #define NVIC_IPR1_PRI_6 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 6 */
  4997. #define NVIC_IPR1_PRI_7 ((uint32_t)0xFF000000) /*!< Priority of interrupt 7 */
  4998. /****************** Bit definition for NVIC_PRI2 register *******************/
  4999. #define NVIC_IPR2_PRI_8 ((uint32_t)0x000000FF) /*!< Priority of interrupt 8 */
  5000. #define NVIC_IPR2_PRI_9 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 9 */
  5001. #define NVIC_IPR2_PRI_10 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 10 */
  5002. #define NVIC_IPR2_PRI_11 ((uint32_t)0xFF000000) /*!< Priority of interrupt 11 */
  5003. /****************** Bit definition for NVIC_PRI3 register *******************/
  5004. #define NVIC_IPR3_PRI_12 ((uint32_t)0x000000FF) /*!< Priority of interrupt 12 */
  5005. #define NVIC_IPR3_PRI_13 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 13 */
  5006. #define NVIC_IPR3_PRI_14 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 14 */
  5007. #define NVIC_IPR3_PRI_15 ((uint32_t)0xFF000000) /*!< Priority of interrupt 15 */
  5008. /****************** Bit definition for NVIC_PRI4 register *******************/
  5009. #define NVIC_IPR4_PRI_16 ((uint32_t)0x000000FF) /*!< Priority of interrupt 16 */
  5010. #define NVIC_IPR4_PRI_17 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 17 */
  5011. #define NVIC_IPR4_PRI_18 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 18 */
  5012. #define NVIC_IPR4_PRI_19 ((uint32_t)0xFF000000) /*!< Priority of interrupt 19 */
  5013. /****************** Bit definition for NVIC_PRI5 register *******************/
  5014. #define NVIC_IPR5_PRI_20 ((uint32_t)0x000000FF) /*!< Priority of interrupt 20 */
  5015. #define NVIC_IPR5_PRI_21 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 21 */
  5016. #define NVIC_IPR5_PRI_22 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 22 */
  5017. #define NVIC_IPR5_PRI_23 ((uint32_t)0xFF000000) /*!< Priority of interrupt 23 */
  5018. /****************** Bit definition for NVIC_PRI6 register *******************/
  5019. #define NVIC_IPR6_PRI_24 ((uint32_t)0x000000FF) /*!< Priority of interrupt 24 */
  5020. #define NVIC_IPR6_PRI_25 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 25 */
  5021. #define NVIC_IPR6_PRI_26 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 26 */
  5022. #define NVIC_IPR6_PRI_27 ((uint32_t)0xFF000000) /*!< Priority of interrupt 27 */
  5023. /****************** Bit definition for NVIC_PRI7 register *******************/
  5024. #define NVIC_IPR7_PRI_28 ((uint32_t)0x000000FF) /*!< Priority of interrupt 28 */
  5025. #define NVIC_IPR7_PRI_29 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 29 */
  5026. #define NVIC_IPR7_PRI_30 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 30 */
  5027. #define NVIC_IPR7_PRI_31 ((uint32_t)0xFF000000) /*!< Priority of interrupt 31 */
  5028. /****************** Bit definition for SCB_CPUID register *******************/
  5029. #define SCB_CPUID_REVISION ((uint32_t)0x0000000F) /*!< Implementation defined revision number */
  5030. #define SCB_CPUID_PARTNO ((uint32_t)0x0000FFF0) /*!< Number of processor within family */
  5031. #define SCB_CPUID_Constant ((uint32_t)0x000F0000) /*!< Reads as 0x0F */
  5032. #define SCB_CPUID_VARIANT ((uint32_t)0x00F00000) /*!< Implementation defined variant number */
  5033. #define SCB_CPUID_IMPLEMENTER ((uint32_t)0xFF000000) /*!< Implementer code. ARM is 0x41 */
  5034. /******************* Bit definition for SCB_ICSR register *******************/
  5035. #define SCB_ICSR_VECTACTIVE ((uint32_t)0x000001FF) /*!< Active ISR number field */
  5036. #define SCB_ICSR_RETTOBASE ((uint32_t)0x00000800) /*!< All active exceptions minus the IPSR_current_exception yields the empty set */
  5037. #define SCB_ICSR_VECTPENDING ((uint32_t)0x003FF000) /*!< Pending ISR number field */
  5038. #define SCB_ICSR_ISRPENDING ((uint32_t)0x00400000) /*!< Interrupt pending flag */
  5039. #define SCB_ICSR_ISRPREEMPT ((uint32_t)0x00800000) /*!< It indicates that a pending interrupt becomes active in the next running cycle */
  5040. #define SCB_ICSR_PENDSTCLR ((uint32_t)0x02000000) /*!< Clear pending SysTick bit */
  5041. #define SCB_ICSR_PENDSTSET ((uint32_t)0x04000000) /*!< Set pending SysTick bit */
  5042. #define SCB_ICSR_PENDSVCLR ((uint32_t)0x08000000) /*!< Clear pending pendSV bit */
  5043. #define SCB_ICSR_PENDSVSET ((uint32_t)0x10000000) /*!< Set pending pendSV bit */
  5044. #define SCB_ICSR_NMIPENDSET ((uint32_t)0x80000000) /*!< Set pending NMI bit */
  5045. /******************* Bit definition for SCB_VTOR register *******************/
  5046. #define SCB_VTOR_TBLOFF ((uint32_t)0x1FFFFF80) /*!< Vector table base offset field */
  5047. #define SCB_VTOR_TBLBASE ((uint32_t)0x20000000) /*!< Table base in code(0) or RAM(1) */
  5048. /*!<***************** Bit definition for SCB_AIRCR register *******************/
  5049. #define SCB_AIRCR_VECTRESET ((uint32_t)0x00000001) /*!< System Reset bit */
  5050. #define SCB_AIRCR_VECTCLRACTIVE ((uint32_t)0x00000002) /*!< Clear active vector bit */
  5051. #define SCB_AIRCR_SYSRESETREQ ((uint32_t)0x00000004) /*!< Requests chip control logic to generate a reset */
  5052. #define SCB_AIRCR_PRIGROUP ((uint32_t)0x00000700) /*!< PRIGROUP[2:0] bits (Priority group) */
  5053. #define SCB_AIRCR_PRIGROUP_0 ((uint32_t)0x00000100) /*!< Bit 0 */
  5054. #define SCB_AIRCR_PRIGROUP_1 ((uint32_t)0x00000200) /*!< Bit 1 */
  5055. #define SCB_AIRCR_PRIGROUP_2 ((uint32_t)0x00000400) /*!< Bit 2 */
  5056. /* prority group configuration */
  5057. #define SCB_AIRCR_PRIGROUP0 ((uint32_t)0x00000000) /*!< Priority group=0 (7 bits of pre-emption priority, 1 bit of subpriority) */
  5058. #define SCB_AIRCR_PRIGROUP1 ((uint32_t)0x00000100) /*!< Priority group=1 (6 bits of pre-emption priority, 2 bits of subpriority) */
  5059. #define SCB_AIRCR_PRIGROUP2 ((uint32_t)0x00000200) /*!< Priority group=2 (5 bits of pre-emption priority, 3 bits of subpriority) */
  5060. #define SCB_AIRCR_PRIGROUP3 ((uint32_t)0x00000300) /*!< Priority group=3 (4 bits of pre-emption priority, 4 bits of subpriority) */
  5061. #define SCB_AIRCR_PRIGROUP4 ((uint32_t)0x00000400) /*!< Priority group=4 (3 bits of pre-emption priority, 5 bits of subpriority) */
  5062. #define SCB_AIRCR_PRIGROUP5 ((uint32_t)0x00000500) /*!< Priority group=5 (2 bits of pre-emption priority, 6 bits of subpriority) */
  5063. #define SCB_AIRCR_PRIGROUP6 ((uint32_t)0x00000600) /*!< Priority group=6 (1 bit of pre-emption priority, 7 bits of subpriority) */
  5064. #define SCB_AIRCR_PRIGROUP7 ((uint32_t)0x00000700) /*!< Priority group=7 (no pre-emption priority, 8 bits of subpriority) */
  5065. #define SCB_AIRCR_ENDIANESS ((uint32_t)0x00008000) /*!< Data endianness bit */
  5066. #define SCB_AIRCR_VECTKEY ((uint32_t)0xFFFF0000) /*!< Register key (VECTKEY) - Reads as 0xFA05 (VECTKEYSTAT) */
  5067. /******************* Bit definition for SCB_SCR register ********************/
  5068. #define SCB_SCR_SLEEPONEXIT ((uint32_t)0x00000002) /*!< Sleep on exit bit */
  5069. #define SCB_SCR_SLEEPDEEP ((uint32_t)0x00000004) /*!< Sleep deep bit */
  5070. #define SCB_SCR_SEVONPEND ((uint32_t)0x00000010) /*!< Wake up from WFE */
  5071. /******************** Bit definition for SCB_CCR register *******************/
  5072. #define SCB_CCR_NONBASETHRDENA ((uint32_t)0x00000001) /*!< Thread mode can be entered from any level in Handler mode by controlled return value */
  5073. #define SCB_CCR_USERSETMPEND ((uint32_t)0x00000002) /*!< Enables user code to write the Software Trigger Interrupt register to trigger (pend) a Main exception */
  5074. #define SCB_CCR_UNALIGN_TRP ((uint32_t)0x00000008) /*!< Trap for unaligned access */
  5075. #define SCB_CCR_DIV_0_TRP ((uint32_t)0x00000010) /*!< Trap on Divide by 0 */
  5076. #define SCB_CCR_BFHFNMIGN ((uint32_t)0x00000100) /*!< Handlers running at priority -1 and -2 */
  5077. #define SCB_CCR_STKALIGN ((uint32_t)0x00000200) /*!< On exception entry, the SP used prior to the exception is adjusted to be 8-byte aligned */
  5078. /******************* Bit definition for SCB_SHPR register ********************/
  5079. #define SCB_SHPR_PRI_N ((uint32_t)0x000000FF) /*!< Priority of system handler 4,8, and 12. Mem Manage, reserved and Debug Monitor */
  5080. #define SCB_SHPR_PRI_N1 ((uint32_t)0x0000FF00) /*!< Priority of system handler 5,9, and 13. Bus Fault, reserved and reserved */
  5081. #define SCB_SHPR_PRI_N2 ((uint32_t)0x00FF0000) /*!< Priority of system handler 6,10, and 14. Usage Fault, reserved and PendSV */
  5082. #define SCB_SHPR_PRI_N3 ((uint32_t)0xFF000000) /*!< Priority of system handler 7,11, and 15. Reserved, SVCall and SysTick */
  5083. /****************** Bit definition for SCB_SHCSR register *******************/
  5084. #define SCB_SHCSR_MEMFAULTACT ((uint32_t)0x00000001) /*!< MemManage is active */
  5085. #define SCB_SHCSR_BUSFAULTACT ((uint32_t)0x00000002) /*!< BusFault is active */
  5086. #define SCB_SHCSR_USGFAULTACT ((uint32_t)0x00000008) /*!< UsageFault is active */
  5087. #define SCB_SHCSR_SVCALLACT ((uint32_t)0x00000080) /*!< SVCall is active */
  5088. #define SCB_SHCSR_MONITORACT ((uint32_t)0x00000100) /*!< Monitor is active */
  5089. #define SCB_SHCSR_PENDSVACT ((uint32_t)0x00000400) /*!< PendSV is active */
  5090. #define SCB_SHCSR_SYSTICKACT ((uint32_t)0x00000800) /*!< SysTick is active */
  5091. #define SCB_SHCSR_USGFAULTPENDED ((uint32_t)0x00001000) /*!< Usage Fault is pended */
  5092. #define SCB_SHCSR_MEMFAULTPENDED ((uint32_t)0x00002000) /*!< MemManage is pended */
  5093. #define SCB_SHCSR_BUSFAULTPENDED ((uint32_t)0x00004000) /*!< Bus Fault is pended */
  5094. #define SCB_SHCSR_SVCALLPENDED ((uint32_t)0x00008000) /*!< SVCall is pended */
  5095. #define SCB_SHCSR_MEMFAULTENA ((uint32_t)0x00010000) /*!< MemManage enable */
  5096. #define SCB_SHCSR_BUSFAULTENA ((uint32_t)0x00020000) /*!< Bus Fault enable */
  5097. #define SCB_SHCSR_USGFAULTENA ((uint32_t)0x00040000) /*!< UsageFault enable */
  5098. /******************* Bit definition for SCB_CFSR register *******************/
  5099. /*!< MFSR */
  5100. #define SCB_CFSR_IACCVIOL ((uint32_t)0x00000001) /*!< Instruction access violation */
  5101. #define SCB_CFSR_DACCVIOL ((uint32_t)0x00000002) /*!< Data access violation */
  5102. #define SCB_CFSR_MUNSTKERR ((uint32_t)0x00000008) /*!< Unstacking error */
  5103. #define SCB_CFSR_MSTKERR ((uint32_t)0x00000010) /*!< Stacking error */
  5104. #define SCB_CFSR_MMARVALID ((uint32_t)0x00000080) /*!< Memory Manage Address Register address valid flag */
  5105. /*!< BFSR */
  5106. #define SCB_CFSR_IBUSERR ((uint32_t)0x00000100) /*!< Instruction bus error flag */
  5107. #define SCB_CFSR_PRECISERR ((uint32_t)0x00000200) /*!< Precise data bus error */
  5108. #define SCB_CFSR_IMPRECISERR ((uint32_t)0x00000400) /*!< Imprecise data bus error */
  5109. #define SCB_CFSR_UNSTKERR ((uint32_t)0x00000800) /*!< Unstacking error */
  5110. #define SCB_CFSR_STKERR ((uint32_t)0x00001000) /*!< Stacking error */
  5111. #define SCB_CFSR_BFARVALID ((uint32_t)0x00008000) /*!< Bus Fault Address Register address valid flag */
  5112. /*!< UFSR */
  5113. #define SCB_CFSR_UNDEFINSTR ((uint32_t)0x00010000) /*!< The processor attempt to excecute an undefined instruction */
  5114. #define SCB_CFSR_INVSTATE ((uint32_t)0x00020000) /*!< Invalid combination of EPSR and instruction */
  5115. #define SCB_CFSR_INVPC ((uint32_t)0x00040000) /*!< Attempt to load EXC_RETURN into pc illegally */
  5116. #define SCB_CFSR_NOCP ((uint32_t)0x00080000) /*!< Attempt to use a coprocessor instruction */
  5117. #define SCB_CFSR_UNALIGNED ((uint32_t)0x01000000) /*!< Fault occurs when there is an attempt to make an unaligned memory access */
  5118. #define SCB_CFSR_DIVBYZERO ((uint32_t)0x02000000) /*!< Fault occurs when SDIV or DIV instruction is used with a divisor of 0 */
  5119. /******************* Bit definition for SCB_HFSR register *******************/
  5120. #define SCB_HFSR_VECTTBL ((uint32_t)0x00000002) /*!< Fault occures because of vector table read on exception processing */
  5121. #define SCB_HFSR_FORCED ((uint32_t)0x40000000) /*!< Hard Fault activated when a configurable Fault was received and cannot activate */
  5122. #define SCB_HFSR_DEBUGEVT ((uint32_t)0x80000000) /*!< Fault related to debug */
  5123. /******************* Bit definition for SCB_DFSR register *******************/
  5124. #define SCB_DFSR_HALTED ((uint32_t)0x00000001) /*!< Halt request flag */
  5125. #define SCB_DFSR_BKPT ((uint32_t)0x00000002) /*!< BKPT flag */
  5126. #define SCB_DFSR_DWTTRAP ((uint32_t)0x00000004) /*!< Data Watchpoint and Trace (DWT) flag */
  5127. #define SCB_DFSR_VCATCH ((uint32_t)0x00000008) /*!< Vector catch flag */
  5128. #define SCB_DFSR_EXTERNAL ((uint32_t)0x00000010) /*!< External debug request flag */
  5129. /******************* Bit definition for SCB_MMFAR register ******************/
  5130. #define SCB_MMFAR_ADDRESS ((uint32_t)0xFFFFFFFF) /*!< Mem Manage fault address field */
  5131. /******************* Bit definition for SCB_BFAR register *******************/
  5132. #define SCB_BFAR_ADDRESS ((uint32_t)0xFFFFFFFF) /*!< Bus fault address field */
  5133. /******************* Bit definition for SCB_afsr register *******************/
  5134. #define SCB_AFSR_IMPDEF ((uint32_t)0xFFFFFFFF) /*!< Implementation defined */
  5135. /**
  5136. * @}
  5137. */
  5138. /**
  5139. * @}
  5140. */
  5141. /** @addtogroup Exported_macro
  5142. * @{
  5143. */
  5144. /****************************** ADC Instances *********************************/
  5145. #define IS_ADC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == ADC1)
  5146. /******************************** COMP Instances ******************************/
  5147. #define IS_COMP_ALL_INSTANCE(INSTANCE) (((INSTANCE) == COMP1) || \
  5148. ((INSTANCE) == COMP2))
  5149. /****************************** CRC Instances *********************************/
  5150. #define IS_CRC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CRC)
  5151. /****************************** DAC Instances *********************************/
  5152. #define IS_DAC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == DAC)
  5153. /****************************** DMA Instances *********************************/
  5154. #define IS_DMA_ALL_INSTANCE(INSTANCE) (((INSTANCE) == DMA1_Channel1) || \
  5155. ((INSTANCE) == DMA1_Channel2) || \
  5156. ((INSTANCE) == DMA1_Channel3) || \
  5157. ((INSTANCE) == DMA1_Channel4) || \
  5158. ((INSTANCE) == DMA1_Channel5) || \
  5159. ((INSTANCE) == DMA1_Channel6) || \
  5160. ((INSTANCE) == DMA1_Channel7) || \
  5161. ((INSTANCE) == DMA2_Channel1) || \
  5162. ((INSTANCE) == DMA2_Channel2) || \
  5163. ((INSTANCE) == DMA2_Channel3) || \
  5164. ((INSTANCE) == DMA2_Channel4) || \
  5165. ((INSTANCE) == DMA2_Channel5))
  5166. /******************************* GPIO Instances *******************************/
  5167. #define IS_GPIO_ALL_INSTANCE(INSTANCE) (((INSTANCE) == GPIOA) || \
  5168. ((INSTANCE) == GPIOB) || \
  5169. ((INSTANCE) == GPIOC) || \
  5170. ((INSTANCE) == GPIOD) || \
  5171. ((INSTANCE) == GPIOE) || \
  5172. ((INSTANCE) == GPIOF) || \
  5173. ((INSTANCE) == GPIOG) || \
  5174. ((INSTANCE) == GPIOH))
  5175. /**************************** GPIO Lock Instances *****************************/
  5176. /* On L1, all GPIO Bank support the Lock mechanism */
  5177. #define IS_GPIO_LOCK_INSTANCE(INSTANCE) IS_GPIO_ALL_INSTANCE(INSTANCE)
  5178. /******************************** I2C Instances *******************************/
  5179. #define IS_I2C_ALL_INSTANCE(INSTANCE) (((INSTANCE) == I2C1) || \
  5180. ((INSTANCE) == I2C2))
  5181. #define IS_I2S_ALL_INSTANCE(INSTANCE) (((INSTANCE) == SPI1) || \
  5182. ((INSTANCE) == SPI2) || \
  5183. ((INSTANCE) == SPI3))
  5184. /****************************** IWDG Instances ********************************/
  5185. #define IS_IWDG_ALL_INSTANCE(INSTANCE) ((INSTANCE) == IWDG)
  5186. /****************************** OPAMP Instances *******************************/
  5187. #define IS_OPAMP_ALL_INSTANCE(INSTANCE) (((INSTANCE) == OPAMP1) || \
  5188. ((INSTANCE) == OPAMP2) || \
  5189. ((INSTANCE) == OPAMP3))
  5190. /****************************** RTC Instances *********************************/
  5191. #define IS_RTC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == RTC)
  5192. /****************************** SDIO Instances *********************************/
  5193. #define IS_SDIO_ALL_INSTANCE(INSTANCE) ((INSTANCE) == SDIO)
  5194. /******************************** SPI Instances *******************************/
  5195. #define IS_SPI_ALL_INSTANCE(INSTANCE) (((INSTANCE) == SPI1) || \
  5196. ((INSTANCE) == SPI2) || \
  5197. ((INSTANCE) == SPI3))
  5198. /****************************** TIM Instances *********************************/
  5199. #define IS_TIM_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  5200. ((INSTANCE) == TIM3) || \
  5201. ((INSTANCE) == TIM4) || \
  5202. ((INSTANCE) == TIM5) || \
  5203. ((INSTANCE) == TIM6) || \
  5204. ((INSTANCE) == TIM7) || \
  5205. ((INSTANCE) == TIM9) || \
  5206. ((INSTANCE) == TIM10) || \
  5207. ((INSTANCE) == TIM11))
  5208. #define IS_TIM_CC1_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  5209. ((INSTANCE) == TIM3) || \
  5210. ((INSTANCE) == TIM4) || \
  5211. ((INSTANCE) == TIM5) || \
  5212. ((INSTANCE) == TIM9) || \
  5213. ((INSTANCE) == TIM10) || \
  5214. ((INSTANCE) == TIM11))
  5215. #define IS_TIM_CC2_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  5216. ((INSTANCE) == TIM3) || \
  5217. ((INSTANCE) == TIM4) || \
  5218. ((INSTANCE) == TIM5) || \
  5219. ((INSTANCE) == TIM9))
  5220. #define IS_TIM_CC3_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  5221. ((INSTANCE) == TIM3) || \
  5222. ((INSTANCE) == TIM4) || \
  5223. ((INSTANCE) == TIM5))
  5224. #define IS_TIM_CC4_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  5225. ((INSTANCE) == TIM3) || \
  5226. ((INSTANCE) == TIM4) || \
  5227. ((INSTANCE) == TIM5))
  5228. #define IS_TIM_CLOCKSOURCE_ETRMODE1_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  5229. ((INSTANCE) == TIM3) || \
  5230. ((INSTANCE) == TIM4) || \
  5231. ((INSTANCE) == TIM5) || \
  5232. ((INSTANCE) == TIM9))
  5233. #define IS_TIM_CLOCKSOURCE_ETRMODE2_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  5234. ((INSTANCE) == TIM3) || \
  5235. ((INSTANCE) == TIM4) || \
  5236. ((INSTANCE) == TIM5) || \
  5237. ((INSTANCE) == TIM9) || \
  5238. ((INSTANCE) == TIM10) || \
  5239. ((INSTANCE) == TIM11))
  5240. #define IS_TIM_CLOCKSOURCE_TIX_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  5241. ((INSTANCE) == TIM3) || \
  5242. ((INSTANCE) == TIM4) || \
  5243. ((INSTANCE) == TIM5) || \
  5244. ((INSTANCE) == TIM9))
  5245. #define IS_TIM_CLOCKSOURCE_ITRX_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  5246. ((INSTANCE) == TIM3) || \
  5247. ((INSTANCE) == TIM4) || \
  5248. ((INSTANCE) == TIM5) || \
  5249. ((INSTANCE) == TIM9))
  5250. #define IS_TIM_OCXREF_CLEAR_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  5251. ((INSTANCE) == TIM3) || \
  5252. ((INSTANCE) == TIM4))
  5253. #define IS_TIM_XOR_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  5254. ((INSTANCE) == TIM3) || \
  5255. ((INSTANCE) == TIM4) || \
  5256. ((INSTANCE) == TIM5))
  5257. #define IS_TIM_MASTER_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  5258. ((INSTANCE) == TIM3) || \
  5259. ((INSTANCE) == TIM4) || \
  5260. ((INSTANCE) == TIM5) || \
  5261. ((INSTANCE) == TIM6) || \
  5262. ((INSTANCE) == TIM7) || \
  5263. ((INSTANCE) == TIM9))
  5264. #define IS_TIM_SLAVE_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  5265. ((INSTANCE) == TIM3) || \
  5266. ((INSTANCE) == TIM4) || \
  5267. ((INSTANCE) == TIM5) || \
  5268. ((INSTANCE) == TIM9))
  5269. #define IS_TIM_32B_COUNTER_INSTANCE(INSTANCE) ((INSTANCE) == TIM5)
  5270. #define IS_TIM_DMABURST_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  5271. ((INSTANCE) == TIM3) || \
  5272. ((INSTANCE) == TIM4) || \
  5273. ((INSTANCE) == TIM5))
  5274. #define IS_TIM_CCX_INSTANCE(INSTANCE, CHANNEL) \
  5275. ((((INSTANCE) == TIM2) && \
  5276. (((CHANNEL) == TIM_CHANNEL_1) || \
  5277. ((CHANNEL) == TIM_CHANNEL_2) || \
  5278. ((CHANNEL) == TIM_CHANNEL_3) || \
  5279. ((CHANNEL) == TIM_CHANNEL_4))) \
  5280. || \
  5281. (((INSTANCE) == TIM3) && \
  5282. (((CHANNEL) == TIM_CHANNEL_1) || \
  5283. ((CHANNEL) == TIM_CHANNEL_2) || \
  5284. ((CHANNEL) == TIM_CHANNEL_3) || \
  5285. ((CHANNEL) == TIM_CHANNEL_4))) \
  5286. || \
  5287. (((INSTANCE) == TIM4) && \
  5288. (((CHANNEL) == TIM_CHANNEL_1) || \
  5289. ((CHANNEL) == TIM_CHANNEL_2) || \
  5290. ((CHANNEL) == TIM_CHANNEL_3) || \
  5291. ((CHANNEL) == TIM_CHANNEL_4))) \
  5292. || \
  5293. (((INSTANCE) == TIM5) && \
  5294. (((CHANNEL) == TIM_CHANNEL_1) || \
  5295. ((CHANNEL) == TIM_CHANNEL_2) || \
  5296. ((CHANNEL) == TIM_CHANNEL_3) || \
  5297. ((CHANNEL) == TIM_CHANNEL_4))) \
  5298. || \
  5299. (((INSTANCE) == TIM9) && \
  5300. (((CHANNEL) == TIM_CHANNEL_1) || \
  5301. ((CHANNEL) == TIM_CHANNEL_2))) \
  5302. || \
  5303. (((INSTANCE) == TIM10) && \
  5304. (((CHANNEL) == TIM_CHANNEL_1))) \
  5305. || \
  5306. (((INSTANCE) == TIM11) && \
  5307. (((CHANNEL) == TIM_CHANNEL_1))))
  5308. #define IS_TIM_CLOCK_DIVISION_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  5309. ((INSTANCE) == TIM3) || \
  5310. ((INSTANCE) == TIM4) || \
  5311. ((INSTANCE) == TIM5) || \
  5312. ((INSTANCE) == TIM9) || \
  5313. ((INSTANCE) == TIM10) || \
  5314. ((INSTANCE) == TIM11))
  5315. #define IS_TIM_DMA_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  5316. ((INSTANCE) == TIM3) || \
  5317. ((INSTANCE) == TIM4) || \
  5318. ((INSTANCE) == TIM5) || \
  5319. ((INSTANCE) == TIM6) || \
  5320. ((INSTANCE) == TIM7))
  5321. #define IS_TIM_DMA_CC_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  5322. ((INSTANCE) == TIM3) || \
  5323. ((INSTANCE) == TIM4) || \
  5324. ((INSTANCE) == TIM5))
  5325. #define IS_TIM_COUNTER_MODE_SELECT_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  5326. ((INSTANCE) == TIM3) || \
  5327. ((INSTANCE) == TIM4) || \
  5328. ((INSTANCE) == TIM5) || \
  5329. ((INSTANCE) == TIM9))
  5330. #define IS_TIM_ENCODER_INTERFACE_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  5331. ((INSTANCE) == TIM3) || \
  5332. ((INSTANCE) == TIM4) || \
  5333. ((INSTANCE) == TIM5) || \
  5334. ((INSTANCE) == TIM9))
  5335. #define IS_TIM_REMAP_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  5336. ((INSTANCE) == TIM3) || \
  5337. ((INSTANCE) == TIM9) || \
  5338. ((INSTANCE) == TIM10) || \
  5339. ((INSTANCE) == TIM11))
  5340. /******************** USART Instances : Synchronous mode **********************/
  5341. #define IS_USART_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  5342. ((INSTANCE) == USART2) || \
  5343. ((INSTANCE) == USART3))
  5344. /******************** UART Instances : Asynchronous mode **********************/
  5345. #define IS_UART_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  5346. ((INSTANCE) == USART2) || \
  5347. ((INSTANCE) == USART3) || \
  5348. ((INSTANCE) == UART4) || \
  5349. ((INSTANCE) == UART5))
  5350. /******************** UART Instances : Half-Duplex mode **********************/
  5351. #define IS_UART_HALFDUPLEX_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  5352. ((INSTANCE) == USART2) || \
  5353. ((INSTANCE) == USART3) || \
  5354. ((INSTANCE) == UART4) || \
  5355. ((INSTANCE) == UART5))
  5356. /******************** UART Instances : LIN mode **********************/
  5357. #define IS_UART_LIN_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  5358. ((INSTANCE) == USART2) || \
  5359. ((INSTANCE) == USART3) || \
  5360. ((INSTANCE) == UART4) || \
  5361. ((INSTANCE) == UART5))
  5362. /****************** UART Instances : Hardware Flow control ********************/
  5363. #define IS_UART_HWFLOW_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  5364. ((INSTANCE) == USART2) || \
  5365. ((INSTANCE) == USART3))
  5366. /********************* UART Instances : Smard card mode ***********************/
  5367. #define IS_SMARTCARD_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  5368. ((INSTANCE) == USART2) || \
  5369. ((INSTANCE) == USART3))
  5370. /*********************** UART Instances : IRDA mode ***************************/
  5371. #define IS_IRDA_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  5372. ((INSTANCE) == USART2) || \
  5373. ((INSTANCE) == USART3) || \
  5374. ((INSTANCE) == UART4) || \
  5375. ((INSTANCE) == UART5))
  5376. /***************** UART Instances : Multi-Processor mode **********************/
  5377. #define IS_UART_MULTIPROCESSOR_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  5378. ((INSTANCE) == USART2) || \
  5379. ((INSTANCE) == USART3) || \
  5380. ((INSTANCE) == UART4) || \
  5381. ((INSTANCE) == UART5))
  5382. /****************************** WWDG Instances ********************************/
  5383. #define IS_WWDG_ALL_INSTANCE(INSTANCE) ((INSTANCE) == WWDG)
  5384. /****************************** LCD Instances ********************************/
  5385. #define IS_LCD_ALL_INSTANCE(INSTANCE) ((INSTANCE) == LCD)
  5386. /****************************** USB Instances ********************************/
  5387. #define IS_USB_ALL_INSTANCE(INSTANCE) ((INSTANCE) == USB)
  5388. /**
  5389. * @}
  5390. */
  5391. /******************************************************************************/
  5392. /* For a painless codes migration between the STM32L1xx device product */
  5393. /* lines, the aliases defined below are put in place to overcome the */
  5394. /* differences in the interrupt handlers and IRQn definitions. */
  5395. /* No need to update developed interrupt code when moving across */
  5396. /* product lines within the same STM32L1 Family */
  5397. /******************************************************************************/
  5398. /* Aliases for __IRQn */
  5399. /* Aliases for __IRQHandler */
  5400. /**
  5401. * @}
  5402. */
  5403. /**
  5404. * @}
  5405. */
  5406. #ifdef __cplusplus
  5407. }
  5408. #endif /* __cplusplus */
  5409. #endif /* __STM32L152xD_H */
  5410. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/