stm32f746xx.h 714 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445
  1. /**
  2. ******************************************************************************
  3. * @file stm32f746xx.h
  4. * @author MCD Application Team
  5. * @version V1.0.1
  6. * @date 25-June-2015
  7. * @brief CMSIS STM32F746xx Device Peripheral Access Layer Header File.
  8. *
  9. * This file contains:
  10. * - Data structures and the address mapping for all peripherals
  11. * - Peripheral's registers declarations and bits definition
  12. * - Macros to access peripheral’s registers hardware
  13. *
  14. ******************************************************************************
  15. * @attention
  16. *
  17. * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
  18. *
  19. * Redistribution and use in source and binary forms, with or without modification,
  20. * are permitted provided that the following conditions are met:
  21. * 1. Redistributions of source code must retain the above copyright notice,
  22. * this list of conditions and the following disclaimer.
  23. * 2. Redistributions in binary form must reproduce the above copyright notice,
  24. * this list of conditions and the following disclaimer in the documentation
  25. * and/or other materials provided with the distribution.
  26. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  27. * may be used to endorse or promote products derived from this software
  28. * without specific prior written permission.
  29. *
  30. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  31. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  32. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  33. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  34. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  35. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  36. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  37. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  38. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  39. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  40. *
  41. ******************************************************************************
  42. */
  43. /** @addtogroup CMSIS_Device
  44. * @{
  45. */
  46. /** @addtogroup stm32f746xx
  47. * @{
  48. */
  49. #ifndef __STM32F746xx_H
  50. #define __STM32F746xx_H
  51. #ifdef __cplusplus
  52. extern "C" {
  53. #endif /* __cplusplus */
  54. /** @addtogroup Configuration_section_for_CMSIS
  55. * @{
  56. */
  57. /**
  58. * @brief STM32F7xx Interrupt Number Definition, according to the selected device
  59. * in @ref Library_configuration_section
  60. */
  61. typedef enum IRQn
  62. {
  63. /****** Cortex-M7 Processor Exceptions Numbers ****************************************************************/
  64. NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */
  65. MemoryManagement_IRQn = -12, /*!< 4 Cortex-M7 Memory Management Interrupt */
  66. BusFault_IRQn = -11, /*!< 5 Cortex-M7 Bus Fault Interrupt */
  67. UsageFault_IRQn = -10, /*!< 6 Cortex-M7 Usage Fault Interrupt */
  68. SVCall_IRQn = -5, /*!< 11 Cortex-M7 SV Call Interrupt */
  69. DebugMonitor_IRQn = -4, /*!< 12 Cortex-M7 Debug Monitor Interrupt */
  70. PendSV_IRQn = -2, /*!< 14 Cortex-M7 Pend SV Interrupt */
  71. SysTick_IRQn = -1, /*!< 15 Cortex-M7 System Tick Interrupt */
  72. /****** STM32 specific Interrupt Numbers **********************************************************************/
  73. WWDG_IRQn = 0, /*!< Window WatchDog Interrupt */
  74. PVD_IRQn = 1, /*!< PVD through EXTI Line detection Interrupt */
  75. TAMP_STAMP_IRQn = 2, /*!< Tamper and TimeStamp interrupts through the EXTI line */
  76. RTC_WKUP_IRQn = 3, /*!< RTC Wakeup interrupt through the EXTI line */
  77. FLASH_IRQn = 4, /*!< FLASH global Interrupt */
  78. RCC_IRQn = 5, /*!< RCC global Interrupt */
  79. EXTI0_IRQn = 6, /*!< EXTI Line0 Interrupt */
  80. EXTI1_IRQn = 7, /*!< EXTI Line1 Interrupt */
  81. EXTI2_IRQn = 8, /*!< EXTI Line2 Interrupt */
  82. EXTI3_IRQn = 9, /*!< EXTI Line3 Interrupt */
  83. EXTI4_IRQn = 10, /*!< EXTI Line4 Interrupt */
  84. DMA1_Stream0_IRQn = 11, /*!< DMA1 Stream 0 global Interrupt */
  85. DMA1_Stream1_IRQn = 12, /*!< DMA1 Stream 1 global Interrupt */
  86. DMA1_Stream2_IRQn = 13, /*!< DMA1 Stream 2 global Interrupt */
  87. DMA1_Stream3_IRQn = 14, /*!< DMA1 Stream 3 global Interrupt */
  88. DMA1_Stream4_IRQn = 15, /*!< DMA1 Stream 4 global Interrupt */
  89. DMA1_Stream5_IRQn = 16, /*!< DMA1 Stream 5 global Interrupt */
  90. DMA1_Stream6_IRQn = 17, /*!< DMA1 Stream 6 global Interrupt */
  91. ADC_IRQn = 18, /*!< ADC1, ADC2 and ADC3 global Interrupts */
  92. CAN1_TX_IRQn = 19, /*!< CAN1 TX Interrupt */
  93. CAN1_RX0_IRQn = 20, /*!< CAN1 RX0 Interrupt */
  94. CAN1_RX1_IRQn = 21, /*!< CAN1 RX1 Interrupt */
  95. CAN1_SCE_IRQn = 22, /*!< CAN1 SCE Interrupt */
  96. EXTI9_5_IRQn = 23, /*!< External Line[9:5] Interrupts */
  97. TIM1_BRK_TIM9_IRQn = 24, /*!< TIM1 Break interrupt and TIM9 global interrupt */
  98. TIM1_UP_TIM10_IRQn = 25, /*!< TIM1 Update Interrupt and TIM10 global interrupt */
  99. TIM1_TRG_COM_TIM11_IRQn = 26, /*!< TIM1 Trigger and Commutation Interrupt and TIM11 global interrupt */
  100. TIM1_CC_IRQn = 27, /*!< TIM1 Capture Compare Interrupt */
  101. TIM2_IRQn = 28, /*!< TIM2 global Interrupt */
  102. TIM3_IRQn = 29, /*!< TIM3 global Interrupt */
  103. TIM4_IRQn = 30, /*!< TIM4 global Interrupt */
  104. I2C1_EV_IRQn = 31, /*!< I2C1 Event Interrupt */
  105. I2C1_ER_IRQn = 32, /*!< I2C1 Error Interrupt */
  106. I2C2_EV_IRQn = 33, /*!< I2C2 Event Interrupt */
  107. I2C2_ER_IRQn = 34, /*!< I2C2 Error Interrupt */
  108. SPI1_IRQn = 35, /*!< SPI1 global Interrupt */
  109. SPI2_IRQn = 36, /*!< SPI2 global Interrupt */
  110. USART1_IRQn = 37, /*!< USART1 global Interrupt */
  111. USART2_IRQn = 38, /*!< USART2 global Interrupt */
  112. USART3_IRQn = 39, /*!< USART3 global Interrupt */
  113. EXTI15_10_IRQn = 40, /*!< External Line[15:10] Interrupts */
  114. RTC_Alarm_IRQn = 41, /*!< RTC Alarm (A and B) through EXTI Line Interrupt */
  115. OTG_FS_WKUP_IRQn = 42, /*!< USB OTG FS Wakeup through EXTI line interrupt */
  116. TIM8_BRK_TIM12_IRQn = 43, /*!< TIM8 Break Interrupt and TIM12 global interrupt */
  117. TIM8_UP_TIM13_IRQn = 44, /*!< TIM8 Update Interrupt and TIM13 global interrupt */
  118. TIM8_TRG_COM_TIM14_IRQn = 45, /*!< TIM8 Trigger and Commutation Interrupt and TIM14 global interrupt */
  119. TIM8_CC_IRQn = 46, /*!< TIM8 Capture Compare Interrupt */
  120. DMA1_Stream7_IRQn = 47, /*!< DMA1 Stream7 Interrupt */
  121. FMC_IRQn = 48, /*!< FMC global Interrupt */
  122. SDMMC1_IRQn = 49, /*!< SDMMC1 global Interrupt */
  123. TIM5_IRQn = 50, /*!< TIM5 global Interrupt */
  124. SPI3_IRQn = 51, /*!< SPI3 global Interrupt */
  125. UART4_IRQn = 52, /*!< UART4 global Interrupt */
  126. UART5_IRQn = 53, /*!< UART5 global Interrupt */
  127. TIM6_DAC_IRQn = 54, /*!< TIM6 global and DAC1&2 underrun error interrupts */
  128. TIM7_IRQn = 55, /*!< TIM7 global interrupt */
  129. DMA2_Stream0_IRQn = 56, /*!< DMA2 Stream 0 global Interrupt */
  130. DMA2_Stream1_IRQn = 57, /*!< DMA2 Stream 1 global Interrupt */
  131. DMA2_Stream2_IRQn = 58, /*!< DMA2 Stream 2 global Interrupt */
  132. DMA2_Stream3_IRQn = 59, /*!< DMA2 Stream 3 global Interrupt */
  133. DMA2_Stream4_IRQn = 60, /*!< DMA2 Stream 4 global Interrupt */
  134. ETH_IRQn = 61, /*!< Ethernet global Interrupt */
  135. ETH_WKUP_IRQn = 62, /*!< Ethernet Wakeup through EXTI line Interrupt */
  136. CAN2_TX_IRQn = 63, /*!< CAN2 TX Interrupt */
  137. CAN2_RX0_IRQn = 64, /*!< CAN2 RX0 Interrupt */
  138. CAN2_RX1_IRQn = 65, /*!< CAN2 RX1 Interrupt */
  139. CAN2_SCE_IRQn = 66, /*!< CAN2 SCE Interrupt */
  140. OTG_FS_IRQn = 67, /*!< USB OTG FS global Interrupt */
  141. DMA2_Stream5_IRQn = 68, /*!< DMA2 Stream 5 global interrupt */
  142. DMA2_Stream6_IRQn = 69, /*!< DMA2 Stream 6 global interrupt */
  143. DMA2_Stream7_IRQn = 70, /*!< DMA2 Stream 7 global interrupt */
  144. USART6_IRQn = 71, /*!< USART6 global interrupt */
  145. I2C3_EV_IRQn = 72, /*!< I2C3 event interrupt */
  146. I2C3_ER_IRQn = 73, /*!< I2C3 error interrupt */
  147. OTG_HS_EP1_OUT_IRQn = 74, /*!< USB OTG HS End Point 1 Out global interrupt */
  148. OTG_HS_EP1_IN_IRQn = 75, /*!< USB OTG HS End Point 1 In global interrupt */
  149. OTG_HS_WKUP_IRQn = 76, /*!< USB OTG HS Wakeup through EXTI interrupt */
  150. OTG_HS_IRQn = 77, /*!< USB OTG HS global interrupt */
  151. DCMI_IRQn = 78, /*!< DCMI global interrupt */
  152. RNG_IRQn = 80, /*!< RNG global interrupt */
  153. FPU_IRQn = 81, /*!< FPU global interrupt */
  154. UART7_IRQn = 82, /*!< UART7 global interrupt */
  155. UART8_IRQn = 83, /*!< UART8 global interrupt */
  156. SPI4_IRQn = 84, /*!< SPI4 global Interrupt */
  157. SPI5_IRQn = 85, /*!< SPI5 global Interrupt */
  158. SPI6_IRQn = 86, /*!< SPI6 global Interrupt */
  159. SAI1_IRQn = 87, /*!< SAI1 global Interrupt */
  160. LTDC_IRQn = 88, /*!< LTDC global Interrupt */
  161. LTDC_ER_IRQn = 89, /*!< LTDC Error global Interrupt */
  162. DMA2D_IRQn = 90, /*!< DMA2D global Interrupt */
  163. SAI2_IRQn = 91, /*!< SAI2 global Interrupt */
  164. QUADSPI_IRQn = 92, /*!< Quad SPI global interrupt */
  165. LPTIM1_IRQn = 93, /*!< LP TIM1 interrupt */
  166. CEC_IRQn = 94, /*!< HDMI-CEC global Interrupt */
  167. I2C4_EV_IRQn = 95, /*!< I2C4 Event Interrupt */
  168. I2C4_ER_IRQn = 96, /*!< I2C4 Error Interrupt */
  169. SPDIF_RX_IRQn = 97 /*!< SPDIF-RX global Interrupt */
  170. } IRQn_Type;
  171. /**
  172. * @}
  173. */
  174. /**
  175. * @brief Configuration of the Cortex-M7 Processor and Core Peripherals
  176. */
  177. #define __CM7_REV 0x0000 /*!< Cortex-M7 revision r0p1 */
  178. #define __MPU_PRESENT 1 /*!< CM7 provides an MPU */
  179. #define __NVIC_PRIO_BITS 4 /*!< CM7 uses 4 Bits for the Priority Levels */
  180. #define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
  181. #define __FPU_PRESENT 1 /*!< FPU present */
  182. #define __ICACHE_PRESENT 1 /*!< CM7 instruction cache present */
  183. #define __DCACHE_PRESENT 1 /*!< CM7 data cache present */
  184. #include "core_cm7.h" /*!< Cortex-M7 processor and core peripherals */
  185. #include "system_stm32f7xx.h"
  186. #include <stdint.h>
  187. /** @addtogroup Peripheral_registers_structures
  188. * @{
  189. */
  190. /**
  191. * @brief Analog to Digital Converter
  192. */
  193. typedef struct
  194. {
  195. __IO uint32_t SR; /*!< ADC status register, Address offset: 0x00 */
  196. __IO uint32_t CR1; /*!< ADC control register 1, Address offset: 0x04 */
  197. __IO uint32_t CR2; /*!< ADC control register 2, Address offset: 0x08 */
  198. __IO uint32_t SMPR1; /*!< ADC sample time register 1, Address offset: 0x0C */
  199. __IO uint32_t SMPR2; /*!< ADC sample time register 2, Address offset: 0x10 */
  200. __IO uint32_t JOFR1; /*!< ADC injected channel data offset register 1, Address offset: 0x14 */
  201. __IO uint32_t JOFR2; /*!< ADC injected channel data offset register 2, Address offset: 0x18 */
  202. __IO uint32_t JOFR3; /*!< ADC injected channel data offset register 3, Address offset: 0x1C */
  203. __IO uint32_t JOFR4; /*!< ADC injected channel data offset register 4, Address offset: 0x20 */
  204. __IO uint32_t HTR; /*!< ADC watchdog higher threshold register, Address offset: 0x24 */
  205. __IO uint32_t LTR; /*!< ADC watchdog lower threshold register, Address offset: 0x28 */
  206. __IO uint32_t SQR1; /*!< ADC regular sequence register 1, Address offset: 0x2C */
  207. __IO uint32_t SQR2; /*!< ADC regular sequence register 2, Address offset: 0x30 */
  208. __IO uint32_t SQR3; /*!< ADC regular sequence register 3, Address offset: 0x34 */
  209. __IO uint32_t JSQR; /*!< ADC injected sequence register, Address offset: 0x38*/
  210. __IO uint32_t JDR1; /*!< ADC injected data register 1, Address offset: 0x3C */
  211. __IO uint32_t JDR2; /*!< ADC injected data register 2, Address offset: 0x40 */
  212. __IO uint32_t JDR3; /*!< ADC injected data register 3, Address offset: 0x44 */
  213. __IO uint32_t JDR4; /*!< ADC injected data register 4, Address offset: 0x48 */
  214. __IO uint32_t DR; /*!< ADC regular data register, Address offset: 0x4C */
  215. } ADC_TypeDef;
  216. typedef struct
  217. {
  218. __IO uint32_t CSR; /*!< ADC Common status register, Address offset: ADC1 base address + 0x300 */
  219. __IO uint32_t CCR; /*!< ADC common control register, Address offset: ADC1 base address + 0x304 */
  220. __IO uint32_t CDR; /*!< ADC common regular data register for dual
  221. AND triple modes, Address offset: ADC1 base address + 0x308 */
  222. } ADC_Common_TypeDef;
  223. /**
  224. * @brief Controller Area Network TxMailBox
  225. */
  226. typedef struct
  227. {
  228. __IO uint32_t TIR; /*!< CAN TX mailbox identifier register */
  229. __IO uint32_t TDTR; /*!< CAN mailbox data length control and time stamp register */
  230. __IO uint32_t TDLR; /*!< CAN mailbox data low register */
  231. __IO uint32_t TDHR; /*!< CAN mailbox data high register */
  232. } CAN_TxMailBox_TypeDef;
  233. /**
  234. * @brief Controller Area Network FIFOMailBox
  235. */
  236. typedef struct
  237. {
  238. __IO uint32_t RIR; /*!< CAN receive FIFO mailbox identifier register */
  239. __IO uint32_t RDTR; /*!< CAN receive FIFO mailbox data length control and time stamp register */
  240. __IO uint32_t RDLR; /*!< CAN receive FIFO mailbox data low register */
  241. __IO uint32_t RDHR; /*!< CAN receive FIFO mailbox data high register */
  242. } CAN_FIFOMailBox_TypeDef;
  243. /**
  244. * @brief Controller Area Network FilterRegister
  245. */
  246. typedef struct
  247. {
  248. __IO uint32_t FR1; /*!< CAN Filter bank register 1 */
  249. __IO uint32_t FR2; /*!< CAN Filter bank register 1 */
  250. } CAN_FilterRegister_TypeDef;
  251. /**
  252. * @brief Controller Area Network
  253. */
  254. typedef struct
  255. {
  256. __IO uint32_t MCR; /*!< CAN master control register, Address offset: 0x00 */
  257. __IO uint32_t MSR; /*!< CAN master status register, Address offset: 0x04 */
  258. __IO uint32_t TSR; /*!< CAN transmit status register, Address offset: 0x08 */
  259. __IO uint32_t RF0R; /*!< CAN receive FIFO 0 register, Address offset: 0x0C */
  260. __IO uint32_t RF1R; /*!< CAN receive FIFO 1 register, Address offset: 0x10 */
  261. __IO uint32_t IER; /*!< CAN interrupt enable register, Address offset: 0x14 */
  262. __IO uint32_t ESR; /*!< CAN error status register, Address offset: 0x18 */
  263. __IO uint32_t BTR; /*!< CAN bit timing register, Address offset: 0x1C */
  264. uint32_t RESERVED0[88]; /*!< Reserved, 0x020 - 0x17F */
  265. CAN_TxMailBox_TypeDef sTxMailBox[3]; /*!< CAN Tx MailBox, Address offset: 0x180 - 0x1AC */
  266. CAN_FIFOMailBox_TypeDef sFIFOMailBox[2]; /*!< CAN FIFO MailBox, Address offset: 0x1B0 - 0x1CC */
  267. uint32_t RESERVED1[12]; /*!< Reserved, 0x1D0 - 0x1FF */
  268. __IO uint32_t FMR; /*!< CAN filter master register, Address offset: 0x200 */
  269. __IO uint32_t FM1R; /*!< CAN filter mode register, Address offset: 0x204 */
  270. uint32_t RESERVED2; /*!< Reserved, 0x208 */
  271. __IO uint32_t FS1R; /*!< CAN filter scale register, Address offset: 0x20C */
  272. uint32_t RESERVED3; /*!< Reserved, 0x210 */
  273. __IO uint32_t FFA1R; /*!< CAN filter FIFO assignment register, Address offset: 0x214 */
  274. uint32_t RESERVED4; /*!< Reserved, 0x218 */
  275. __IO uint32_t FA1R; /*!< CAN filter activation register, Address offset: 0x21C */
  276. uint32_t RESERVED5[8]; /*!< Reserved, 0x220-0x23F */
  277. CAN_FilterRegister_TypeDef sFilterRegister[28]; /*!< CAN Filter Register, Address offset: 0x240-0x31C */
  278. } CAN_TypeDef;
  279. /**
  280. * @brief HDMI-CEC
  281. */
  282. typedef struct
  283. {
  284. __IO uint32_t CR; /*!< CEC control register, Address offset:0x00 */
  285. __IO uint32_t CFGR; /*!< CEC configuration register, Address offset:0x04 */
  286. __IO uint32_t TXDR; /*!< CEC Tx data register , Address offset:0x08 */
  287. __IO uint32_t RXDR; /*!< CEC Rx Data Register, Address offset:0x0C */
  288. __IO uint32_t ISR; /*!< CEC Interrupt and Status Register, Address offset:0x10 */
  289. __IO uint32_t IER; /*!< CEC interrupt enable register, Address offset:0x14 */
  290. }CEC_TypeDef;
  291. /**
  292. * @brief CRC calculation unit
  293. */
  294. typedef struct
  295. {
  296. __IO uint32_t DR; /*!< CRC Data register, Address offset: 0x00 */
  297. __IO uint8_t IDR; /*!< CRC Independent data register, Address offset: 0x04 */
  298. uint8_t RESERVED0; /*!< Reserved, 0x05 */
  299. uint16_t RESERVED1; /*!< Reserved, 0x06 */
  300. __IO uint32_t CR; /*!< CRC Control register, Address offset: 0x08 */
  301. uint32_t RESERVED2; /*!< Reserved, 0x0C */
  302. __IO uint32_t INIT; /*!< Initial CRC value register, Address offset: 0x10 */
  303. __IO uint32_t POL; /*!< CRC polynomial register, Address offset: 0x14 */
  304. } CRC_TypeDef;
  305. /**
  306. * @brief Digital to Analog Converter
  307. */
  308. typedef struct
  309. {
  310. __IO uint32_t CR; /*!< DAC control register, Address offset: 0x00 */
  311. __IO uint32_t SWTRIGR; /*!< DAC software trigger register, Address offset: 0x04 */
  312. __IO uint32_t DHR12R1; /*!< DAC channel1 12-bit right-aligned data holding register, Address offset: 0x08 */
  313. __IO uint32_t DHR12L1; /*!< DAC channel1 12-bit left aligned data holding register, Address offset: 0x0C */
  314. __IO uint32_t DHR8R1; /*!< DAC channel1 8-bit right aligned data holding register, Address offset: 0x10 */
  315. __IO uint32_t DHR12R2; /*!< DAC channel2 12-bit right aligned data holding register, Address offset: 0x14 */
  316. __IO uint32_t DHR12L2; /*!< DAC channel2 12-bit left aligned data holding register, Address offset: 0x18 */
  317. __IO uint32_t DHR8R2; /*!< DAC channel2 8-bit right-aligned data holding register, Address offset: 0x1C */
  318. __IO uint32_t DHR12RD; /*!< Dual DAC 12-bit right-aligned data holding register, Address offset: 0x20 */
  319. __IO uint32_t DHR12LD; /*!< DUAL DAC 12-bit left aligned data holding register, Address offset: 0x24 */
  320. __IO uint32_t DHR8RD; /*!< DUAL DAC 8-bit right aligned data holding register, Address offset: 0x28 */
  321. __IO uint32_t DOR1; /*!< DAC channel1 data output register, Address offset: 0x2C */
  322. __IO uint32_t DOR2; /*!< DAC channel2 data output register, Address offset: 0x30 */
  323. __IO uint32_t SR; /*!< DAC status register, Address offset: 0x34 */
  324. } DAC_TypeDef;
  325. /**
  326. * @brief Debug MCU
  327. */
  328. typedef struct
  329. {
  330. __IO uint32_t IDCODE; /*!< MCU device ID code, Address offset: 0x00 */
  331. __IO uint32_t CR; /*!< Debug MCU configuration register, Address offset: 0x04 */
  332. __IO uint32_t APB1FZ; /*!< Debug MCU APB1 freeze register, Address offset: 0x08 */
  333. __IO uint32_t APB2FZ; /*!< Debug MCU APB2 freeze register, Address offset: 0x0C */
  334. }DBGMCU_TypeDef;
  335. /**
  336. * @brief DCMI
  337. */
  338. typedef struct
  339. {
  340. __IO uint32_t CR; /*!< DCMI control register 1, Address offset: 0x00 */
  341. __IO uint32_t SR; /*!< DCMI status register, Address offset: 0x04 */
  342. __IO uint32_t RISR; /*!< DCMI raw interrupt status register, Address offset: 0x08 */
  343. __IO uint32_t IER; /*!< DCMI interrupt enable register, Address offset: 0x0C */
  344. __IO uint32_t MISR; /*!< DCMI masked interrupt status register, Address offset: 0x10 */
  345. __IO uint32_t ICR; /*!< DCMI interrupt clear register, Address offset: 0x14 */
  346. __IO uint32_t ESCR; /*!< DCMI embedded synchronization code register, Address offset: 0x18 */
  347. __IO uint32_t ESUR; /*!< DCMI embedded synchronization unmask register, Address offset: 0x1C */
  348. __IO uint32_t CWSTRTR; /*!< DCMI crop window start, Address offset: 0x20 */
  349. __IO uint32_t CWSIZER; /*!< DCMI crop window size, Address offset: 0x24 */
  350. __IO uint32_t DR; /*!< DCMI data register, Address offset: 0x28 */
  351. } DCMI_TypeDef;
  352. /**
  353. * @brief DMA Controller
  354. */
  355. typedef struct
  356. {
  357. __IO uint32_t CR; /*!< DMA stream x configuration register */
  358. __IO uint32_t NDTR; /*!< DMA stream x number of data register */
  359. __IO uint32_t PAR; /*!< DMA stream x peripheral address register */
  360. __IO uint32_t M0AR; /*!< DMA stream x memory 0 address register */
  361. __IO uint32_t M1AR; /*!< DMA stream x memory 1 address register */
  362. __IO uint32_t FCR; /*!< DMA stream x FIFO control register */
  363. } DMA_Stream_TypeDef;
  364. typedef struct
  365. {
  366. __IO uint32_t LISR; /*!< DMA low interrupt status register, Address offset: 0x00 */
  367. __IO uint32_t HISR; /*!< DMA high interrupt status register, Address offset: 0x04 */
  368. __IO uint32_t LIFCR; /*!< DMA low interrupt flag clear register, Address offset: 0x08 */
  369. __IO uint32_t HIFCR; /*!< DMA high interrupt flag clear register, Address offset: 0x0C */
  370. } DMA_TypeDef;
  371. /**
  372. * @brief DMA2D Controller
  373. */
  374. typedef struct
  375. {
  376. __IO uint32_t CR; /*!< DMA2D Control Register, Address offset: 0x00 */
  377. __IO uint32_t ISR; /*!< DMA2D Interrupt Status Register, Address offset: 0x04 */
  378. __IO uint32_t IFCR; /*!< DMA2D Interrupt Flag Clear Register, Address offset: 0x08 */
  379. __IO uint32_t FGMAR; /*!< DMA2D Foreground Memory Address Register, Address offset: 0x0C */
  380. __IO uint32_t FGOR; /*!< DMA2D Foreground Offset Register, Address offset: 0x10 */
  381. __IO uint32_t BGMAR; /*!< DMA2D Background Memory Address Register, Address offset: 0x14 */
  382. __IO uint32_t BGOR; /*!< DMA2D Background Offset Register, Address offset: 0x18 */
  383. __IO uint32_t FGPFCCR; /*!< DMA2D Foreground PFC Control Register, Address offset: 0x1C */
  384. __IO uint32_t FGCOLR; /*!< DMA2D Foreground Color Register, Address offset: 0x20 */
  385. __IO uint32_t BGPFCCR; /*!< DMA2D Background PFC Control Register, Address offset: 0x24 */
  386. __IO uint32_t BGCOLR; /*!< DMA2D Background Color Register, Address offset: 0x28 */
  387. __IO uint32_t FGCMAR; /*!< DMA2D Foreground CLUT Memory Address Register, Address offset: 0x2C */
  388. __IO uint32_t BGCMAR; /*!< DMA2D Background CLUT Memory Address Register, Address offset: 0x30 */
  389. __IO uint32_t OPFCCR; /*!< DMA2D Output PFC Control Register, Address offset: 0x34 */
  390. __IO uint32_t OCOLR; /*!< DMA2D Output Color Register, Address offset: 0x38 */
  391. __IO uint32_t OMAR; /*!< DMA2D Output Memory Address Register, Address offset: 0x3C */
  392. __IO uint32_t OOR; /*!< DMA2D Output Offset Register, Address offset: 0x40 */
  393. __IO uint32_t NLR; /*!< DMA2D Number of Line Register, Address offset: 0x44 */
  394. __IO uint32_t LWR; /*!< DMA2D Line Watermark Register, Address offset: 0x48 */
  395. __IO uint32_t AMTCR; /*!< DMA2D AHB Master Timer Configuration Register, Address offset: 0x4C */
  396. uint32_t RESERVED[236]; /*!< Reserved, 0x50-0x3FF */
  397. __IO uint32_t FGCLUT[256]; /*!< DMA2D Foreground CLUT, Address offset:400-7FF */
  398. __IO uint32_t BGCLUT[256]; /*!< DMA2D Background CLUT, Address offset:800-BFF */
  399. } DMA2D_TypeDef;
  400. /**
  401. * @brief Ethernet MAC
  402. */
  403. typedef struct
  404. {
  405. __IO uint32_t MACCR;
  406. __IO uint32_t MACFFR;
  407. __IO uint32_t MACHTHR;
  408. __IO uint32_t MACHTLR;
  409. __IO uint32_t MACMIIAR;
  410. __IO uint32_t MACMIIDR;
  411. __IO uint32_t MACFCR;
  412. __IO uint32_t MACVLANTR; /* 8 */
  413. uint32_t RESERVED0[2];
  414. __IO uint32_t MACRWUFFR; /* 11 */
  415. __IO uint32_t MACPMTCSR;
  416. uint32_t RESERVED1[2];
  417. __IO uint32_t MACSR; /* 15 */
  418. __IO uint32_t MACIMR;
  419. __IO uint32_t MACA0HR;
  420. __IO uint32_t MACA0LR;
  421. __IO uint32_t MACA1HR;
  422. __IO uint32_t MACA1LR;
  423. __IO uint32_t MACA2HR;
  424. __IO uint32_t MACA2LR;
  425. __IO uint32_t MACA3HR;
  426. __IO uint32_t MACA3LR; /* 24 */
  427. uint32_t RESERVED2[40];
  428. __IO uint32_t MMCCR; /* 65 */
  429. __IO uint32_t MMCRIR;
  430. __IO uint32_t MMCTIR;
  431. __IO uint32_t MMCRIMR;
  432. __IO uint32_t MMCTIMR; /* 69 */
  433. uint32_t RESERVED3[14];
  434. __IO uint32_t MMCTGFSCCR; /* 84 */
  435. __IO uint32_t MMCTGFMSCCR;
  436. uint32_t RESERVED4[5];
  437. __IO uint32_t MMCTGFCR;
  438. uint32_t RESERVED5[10];
  439. __IO uint32_t MMCRFCECR;
  440. __IO uint32_t MMCRFAECR;
  441. uint32_t RESERVED6[10];
  442. __IO uint32_t MMCRGUFCR;
  443. uint32_t RESERVED7[334];
  444. __IO uint32_t PTPTSCR;
  445. __IO uint32_t PTPSSIR;
  446. __IO uint32_t PTPTSHR;
  447. __IO uint32_t PTPTSLR;
  448. __IO uint32_t PTPTSHUR;
  449. __IO uint32_t PTPTSLUR;
  450. __IO uint32_t PTPTSAR;
  451. __IO uint32_t PTPTTHR;
  452. __IO uint32_t PTPTTLR;
  453. __IO uint32_t RESERVED8;
  454. __IO uint32_t PTPTSSR;
  455. uint32_t RESERVED9[565];
  456. __IO uint32_t DMABMR;
  457. __IO uint32_t DMATPDR;
  458. __IO uint32_t DMARPDR;
  459. __IO uint32_t DMARDLAR;
  460. __IO uint32_t DMATDLAR;
  461. __IO uint32_t DMASR;
  462. __IO uint32_t DMAOMR;
  463. __IO uint32_t DMAIER;
  464. __IO uint32_t DMAMFBOCR;
  465. __IO uint32_t DMARSWTR;
  466. uint32_t RESERVED10[8];
  467. __IO uint32_t DMACHTDR;
  468. __IO uint32_t DMACHRDR;
  469. __IO uint32_t DMACHTBAR;
  470. __IO uint32_t DMACHRBAR;
  471. } ETH_TypeDef;
  472. /**
  473. * @brief External Interrupt/Event Controller
  474. */
  475. typedef struct
  476. {
  477. __IO uint32_t IMR; /*!< EXTI Interrupt mask register, Address offset: 0x00 */
  478. __IO uint32_t EMR; /*!< EXTI Event mask register, Address offset: 0x04 */
  479. __IO uint32_t RTSR; /*!< EXTI Rising trigger selection register, Address offset: 0x08 */
  480. __IO uint32_t FTSR; /*!< EXTI Falling trigger selection register, Address offset: 0x0C */
  481. __IO uint32_t SWIER; /*!< EXTI Software interrupt event register, Address offset: 0x10 */
  482. __IO uint32_t PR; /*!< EXTI Pending register, Address offset: 0x14 */
  483. } EXTI_TypeDef;
  484. /**
  485. * @brief FLASH Registers
  486. */
  487. typedef struct
  488. {
  489. __IO uint32_t ACR; /*!< FLASH access control register, Address offset: 0x00 */
  490. __IO uint32_t KEYR; /*!< FLASH key register, Address offset: 0x04 */
  491. __IO uint32_t OPTKEYR; /*!< FLASH option key register, Address offset: 0x08 */
  492. __IO uint32_t SR; /*!< FLASH status register, Address offset: 0x0C */
  493. __IO uint32_t CR; /*!< FLASH control register, Address offset: 0x10 */
  494. __IO uint32_t OPTCR; /*!< FLASH option control register , Address offset: 0x14 */
  495. __IO uint32_t OPTCR1; /*!< FLASH option control register 1 , Address offset: 0x18 */
  496. } FLASH_TypeDef;
  497. /**
  498. * @brief Flexible Memory Controller
  499. */
  500. typedef struct
  501. {
  502. __IO uint32_t BTCR[8]; /*!< NOR/PSRAM chip-select control register(BCR) and chip-select timing register(BTR), Address offset: 0x00-1C */
  503. } FMC_Bank1_TypeDef;
  504. /**
  505. * @brief Flexible Memory Controller Bank1E
  506. */
  507. typedef struct
  508. {
  509. __IO uint32_t BWTR[7]; /*!< NOR/PSRAM write timing registers, Address offset: 0x104-0x11C */
  510. } FMC_Bank1E_TypeDef;
  511. /**
  512. * @brief Flexible Memory Controller Bank3
  513. */
  514. typedef struct
  515. {
  516. __IO uint32_t PCR; /*!< NAND Flash control register, Address offset: 0x80 */
  517. __IO uint32_t SR; /*!< NAND Flash FIFO status and interrupt register, Address offset: 0x84 */
  518. __IO uint32_t PMEM; /*!< NAND Flash Common memory space timing register, Address offset: 0x88 */
  519. __IO uint32_t PATT; /*!< NAND Flash Attribute memory space timing register, Address offset: 0x8C */
  520. uint32_t RESERVED0; /*!< Reserved, 0x90 */
  521. __IO uint32_t ECCR; /*!< NAND Flash ECC result registers, Address offset: 0x94 */
  522. } FMC_Bank3_TypeDef;
  523. /**
  524. * @brief Flexible Memory Controller Bank5_6
  525. */
  526. typedef struct
  527. {
  528. __IO uint32_t SDCR[2]; /*!< SDRAM Control registers , Address offset: 0x140-0x144 */
  529. __IO uint32_t SDTR[2]; /*!< SDRAM Timing registers , Address offset: 0x148-0x14C */
  530. __IO uint32_t SDCMR; /*!< SDRAM Command Mode register, Address offset: 0x150 */
  531. __IO uint32_t SDRTR; /*!< SDRAM Refresh Timer register, Address offset: 0x154 */
  532. __IO uint32_t SDSR; /*!< SDRAM Status register, Address offset: 0x158 */
  533. } FMC_Bank5_6_TypeDef;
  534. /**
  535. * @brief General Purpose I/O
  536. */
  537. typedef struct
  538. {
  539. __IO uint32_t MODER; /*!< GPIO port mode register, Address offset: 0x00 */
  540. __IO uint32_t OTYPER; /*!< GPIO port output type register, Address offset: 0x04 */
  541. __IO uint32_t OSPEEDR; /*!< GPIO port output speed register, Address offset: 0x08 */
  542. __IO uint32_t PUPDR; /*!< GPIO port pull-up/pull-down register, Address offset: 0x0C */
  543. __IO uint32_t IDR; /*!< GPIO port input data register, Address offset: 0x10 */
  544. __IO uint32_t ODR; /*!< GPIO port output data register, Address offset: 0x14 */
  545. __IO uint32_t BSRR; /*!< GPIO port bit set/reset register, Address offset: 0x18 */
  546. __IO uint32_t LCKR; /*!< GPIO port configuration lock register, Address offset: 0x1C */
  547. __IO uint32_t AFR[2]; /*!< GPIO alternate function registers, Address offset: 0x20-0x24 */
  548. } GPIO_TypeDef;
  549. /**
  550. * @brief System configuration controller
  551. */
  552. typedef struct
  553. {
  554. __IO uint32_t MEMRMP; /*!< SYSCFG memory remap register, Address offset: 0x00 */
  555. __IO uint32_t PMC; /*!< SYSCFG peripheral mode configuration register, Address offset: 0x04 */
  556. __IO uint32_t EXTICR[4]; /*!< SYSCFG external interrupt configuration registers, Address offset: 0x08-0x14 */
  557. uint32_t RESERVED[2]; /*!< Reserved, 0x18-0x1C */
  558. __IO uint32_t CMPCR; /*!< SYSCFG Compensation cell control register, Address offset: 0x20 */
  559. } SYSCFG_TypeDef;
  560. /**
  561. * @brief Inter-integrated Circuit Interface
  562. */
  563. typedef struct
  564. {
  565. __IO uint32_t CR1; /*!< I2C Control register 1, Address offset: 0x00 */
  566. __IO uint32_t CR2; /*!< I2C Control register 2, Address offset: 0x04 */
  567. __IO uint32_t OAR1; /*!< I2C Own address 1 register, Address offset: 0x08 */
  568. __IO uint32_t OAR2; /*!< I2C Own address 2 register, Address offset: 0x0C */
  569. __IO uint32_t TIMINGR; /*!< I2C Timing register, Address offset: 0x10 */
  570. __IO uint32_t TIMEOUTR; /*!< I2C Timeout register, Address offset: 0x14 */
  571. __IO uint32_t ISR; /*!< I2C Interrupt and status register, Address offset: 0x18 */
  572. __IO uint32_t ICR; /*!< I2C Interrupt clear register, Address offset: 0x1C */
  573. __IO uint32_t PECR; /*!< I2C PEC register, Address offset: 0x20 */
  574. __IO uint32_t RXDR; /*!< I2C Receive data register, Address offset: 0x24 */
  575. __IO uint32_t TXDR; /*!< I2C Transmit data register, Address offset: 0x28 */
  576. } I2C_TypeDef;
  577. /**
  578. * @brief Independent WATCHDOG
  579. */
  580. typedef struct
  581. {
  582. __IO uint32_t KR; /*!< IWDG Key register, Address offset: 0x00 */
  583. __IO uint32_t PR; /*!< IWDG Prescaler register, Address offset: 0x04 */
  584. __IO uint32_t RLR; /*!< IWDG Reload register, Address offset: 0x08 */
  585. __IO uint32_t SR; /*!< IWDG Status register, Address offset: 0x0C */
  586. __IO uint32_t WINR; /*!< IWDG Window register, Address offset: 0x10 */
  587. } IWDG_TypeDef;
  588. /**
  589. * @brief LCD-TFT Display Controller
  590. */
  591. typedef struct
  592. {
  593. uint32_t RESERVED0[2]; /*!< Reserved, 0x00-0x04 */
  594. __IO uint32_t SSCR; /*!< LTDC Synchronization Size Configuration Register, Address offset: 0x08 */
  595. __IO uint32_t BPCR; /*!< LTDC Back Porch Configuration Register, Address offset: 0x0C */
  596. __IO uint32_t AWCR; /*!< LTDC Active Width Configuration Register, Address offset: 0x10 */
  597. __IO uint32_t TWCR; /*!< LTDC Total Width Configuration Register, Address offset: 0x14 */
  598. __IO uint32_t GCR; /*!< LTDC Global Control Register, Address offset: 0x18 */
  599. uint32_t RESERVED1[2]; /*!< Reserved, 0x1C-0x20 */
  600. __IO uint32_t SRCR; /*!< LTDC Shadow Reload Configuration Register, Address offset: 0x24 */
  601. uint32_t RESERVED2[1]; /*!< Reserved, 0x28 */
  602. __IO uint32_t BCCR; /*!< LTDC Background Color Configuration Register, Address offset: 0x2C */
  603. uint32_t RESERVED3[1]; /*!< Reserved, 0x30 */
  604. __IO uint32_t IER; /*!< LTDC Interrupt Enable Register, Address offset: 0x34 */
  605. __IO uint32_t ISR; /*!< LTDC Interrupt Status Register, Address offset: 0x38 */
  606. __IO uint32_t ICR; /*!< LTDC Interrupt Clear Register, Address offset: 0x3C */
  607. __IO uint32_t LIPCR; /*!< LTDC Line Interrupt Position Configuration Register, Address offset: 0x40 */
  608. __IO uint32_t CPSR; /*!< LTDC Current Position Status Register, Address offset: 0x44 */
  609. __IO uint32_t CDSR; /*!< LTDC Current Display Status Register, Address offset: 0x48 */
  610. } LTDC_TypeDef;
  611. /**
  612. * @brief LCD-TFT Display layer x Controller
  613. */
  614. typedef struct
  615. {
  616. __IO uint32_t CR; /*!< LTDC Layerx Control Register Address offset: 0x84 */
  617. __IO uint32_t WHPCR; /*!< LTDC Layerx Window Horizontal Position Configuration Register Address offset: 0x88 */
  618. __IO uint32_t WVPCR; /*!< LTDC Layerx Window Vertical Position Configuration Register Address offset: 0x8C */
  619. __IO uint32_t CKCR; /*!< LTDC Layerx Color Keying Configuration Register Address offset: 0x90 */
  620. __IO uint32_t PFCR; /*!< LTDC Layerx Pixel Format Configuration Register Address offset: 0x94 */
  621. __IO uint32_t CACR; /*!< LTDC Layerx Constant Alpha Configuration Register Address offset: 0x98 */
  622. __IO uint32_t DCCR; /*!< LTDC Layerx Default Color Configuration Register Address offset: 0x9C */
  623. __IO uint32_t BFCR; /*!< LTDC Layerx Blending Factors Configuration Register Address offset: 0xA0 */
  624. uint32_t RESERVED0[2]; /*!< Reserved */
  625. __IO uint32_t CFBAR; /*!< LTDC Layerx Color Frame Buffer Address Register Address offset: 0xAC */
  626. __IO uint32_t CFBLR; /*!< LTDC Layerx Color Frame Buffer Length Register Address offset: 0xB0 */
  627. __IO uint32_t CFBLNR; /*!< LTDC Layerx ColorFrame Buffer Line Number Register Address offset: 0xB4 */
  628. uint32_t RESERVED1[3]; /*!< Reserved */
  629. __IO uint32_t CLUTWR; /*!< LTDC Layerx CLUT Write Register Address offset: 0x144 */
  630. } LTDC_Layer_TypeDef;
  631. /**
  632. * @brief Power Control
  633. */
  634. typedef struct
  635. {
  636. __IO uint32_t CR1; /*!< PWR power control register 1, Address offset: 0x00 */
  637. __IO uint32_t CSR1; /*!< PWR power control/status register 2, Address offset: 0x04 */
  638. __IO uint32_t CR2; /*!< PWR power control register 2, Address offset: 0x08 */
  639. __IO uint32_t CSR2; /*!< PWR power control/status register 2, Address offset: 0x0C */
  640. } PWR_TypeDef;
  641. /**
  642. * @brief Reset and Clock Control
  643. */
  644. typedef struct
  645. {
  646. __IO uint32_t CR; /*!< RCC clock control register, Address offset: 0x00 */
  647. __IO uint32_t PLLCFGR; /*!< RCC PLL configuration register, Address offset: 0x04 */
  648. __IO uint32_t CFGR; /*!< RCC clock configuration register, Address offset: 0x08 */
  649. __IO uint32_t CIR; /*!< RCC clock interrupt register, Address offset: 0x0C */
  650. __IO uint32_t AHB1RSTR; /*!< RCC AHB1 peripheral reset register, Address offset: 0x10 */
  651. __IO uint32_t AHB2RSTR; /*!< RCC AHB2 peripheral reset register, Address offset: 0x14 */
  652. __IO uint32_t AHB3RSTR; /*!< RCC AHB3 peripheral reset register, Address offset: 0x18 */
  653. uint32_t RESERVED0; /*!< Reserved, 0x1C */
  654. __IO uint32_t APB1RSTR; /*!< RCC APB1 peripheral reset register, Address offset: 0x20 */
  655. __IO uint32_t APB2RSTR; /*!< RCC APB2 peripheral reset register, Address offset: 0x24 */
  656. uint32_t RESERVED1[2]; /*!< Reserved, 0x28-0x2C */
  657. __IO uint32_t AHB1ENR; /*!< RCC AHB1 peripheral clock register, Address offset: 0x30 */
  658. __IO uint32_t AHB2ENR; /*!< RCC AHB2 peripheral clock register, Address offset: 0x34 */
  659. __IO uint32_t AHB3ENR; /*!< RCC AHB3 peripheral clock register, Address offset: 0x38 */
  660. uint32_t RESERVED2; /*!< Reserved, 0x3C */
  661. __IO uint32_t APB1ENR; /*!< RCC APB1 peripheral clock enable register, Address offset: 0x40 */
  662. __IO uint32_t APB2ENR; /*!< RCC APB2 peripheral clock enable register, Address offset: 0x44 */
  663. uint32_t RESERVED3[2]; /*!< Reserved, 0x48-0x4C */
  664. __IO uint32_t AHB1LPENR; /*!< RCC AHB1 peripheral clock enable in low power mode register, Address offset: 0x50 */
  665. __IO uint32_t AHB2LPENR; /*!< RCC AHB2 peripheral clock enable in low power mode register, Address offset: 0x54 */
  666. __IO uint32_t AHB3LPENR; /*!< RCC AHB3 peripheral clock enable in low power mode register, Address offset: 0x58 */
  667. uint32_t RESERVED4; /*!< Reserved, 0x5C */
  668. __IO uint32_t APB1LPENR; /*!< RCC APB1 peripheral clock enable in low power mode register, Address offset: 0x60 */
  669. __IO uint32_t APB2LPENR; /*!< RCC APB2 peripheral clock enable in low power mode register, Address offset: 0x64 */
  670. uint32_t RESERVED5[2]; /*!< Reserved, 0x68-0x6C */
  671. __IO uint32_t BDCR; /*!< RCC Backup domain control register, Address offset: 0x70 */
  672. __IO uint32_t CSR; /*!< RCC clock control & status register, Address offset: 0x74 */
  673. uint32_t RESERVED6[2]; /*!< Reserved, 0x78-0x7C */
  674. __IO uint32_t SSCGR; /*!< RCC spread spectrum clock generation register, Address offset: 0x80 */
  675. __IO uint32_t PLLI2SCFGR; /*!< RCC PLLI2S configuration register, Address offset: 0x84 */
  676. __IO uint32_t PLLSAICFGR; /*!< RCC PLLSAI configuration register, Address offset: 0x88 */
  677. __IO uint32_t DCKCFGR1; /*!< RCC Dedicated Clocks configuration register1, Address offset: 0x8C */
  678. __IO uint32_t DCKCFGR2; /*!< RCC Dedicated Clocks configuration register 2, Address offset: 0x90 */
  679. } RCC_TypeDef;
  680. /**
  681. * @brief Real-Time Clock
  682. */
  683. typedef struct
  684. {
  685. __IO uint32_t TR; /*!< RTC time register, Address offset: 0x00 */
  686. __IO uint32_t DR; /*!< RTC date register, Address offset: 0x04 */
  687. __IO uint32_t CR; /*!< RTC control register, Address offset: 0x08 */
  688. __IO uint32_t ISR; /*!< RTC initialization and status register, Address offset: 0x0C */
  689. __IO uint32_t PRER; /*!< RTC prescaler register, Address offset: 0x10 */
  690. __IO uint32_t WUTR; /*!< RTC wakeup timer register, Address offset: 0x14 */
  691. uint32_t reserved; /*!< Reserved */
  692. __IO uint32_t ALRMAR; /*!< RTC alarm A register, Address offset: 0x1C */
  693. __IO uint32_t ALRMBR; /*!< RTC alarm B register, Address offset: 0x20 */
  694. __IO uint32_t WPR; /*!< RTC write protection register, Address offset: 0x24 */
  695. __IO uint32_t SSR; /*!< RTC sub second register, Address offset: 0x28 */
  696. __IO uint32_t SHIFTR; /*!< RTC shift control register, Address offset: 0x2C */
  697. __IO uint32_t TSTR; /*!< RTC time stamp time register, Address offset: 0x30 */
  698. __IO uint32_t TSDR; /*!< RTC time stamp date register, Address offset: 0x34 */
  699. __IO uint32_t TSSSR; /*!< RTC time-stamp sub second register, Address offset: 0x38 */
  700. __IO uint32_t CALR; /*!< RTC calibration register, Address offset: 0x3C */
  701. __IO uint32_t TAMPCR; /*!< RTC tamper configuration register, Address offset: 0x40 */
  702. __IO uint32_t ALRMASSR; /*!< RTC alarm A sub second register, Address offset: 0x44 */
  703. __IO uint32_t ALRMBSSR; /*!< RTC alarm B sub second register, Address offset: 0x48 */
  704. __IO uint32_t OR; /*!< RTC option register, Address offset: 0x4C */
  705. __IO uint32_t BKP0R; /*!< RTC backup register 0, Address offset: 0x50 */
  706. __IO uint32_t BKP1R; /*!< RTC backup register 1, Address offset: 0x54 */
  707. __IO uint32_t BKP2R; /*!< RTC backup register 2, Address offset: 0x58 */
  708. __IO uint32_t BKP3R; /*!< RTC backup register 3, Address offset: 0x5C */
  709. __IO uint32_t BKP4R; /*!< RTC backup register 4, Address offset: 0x60 */
  710. __IO uint32_t BKP5R; /*!< RTC backup register 5, Address offset: 0x64 */
  711. __IO uint32_t BKP6R; /*!< RTC backup register 6, Address offset: 0x68 */
  712. __IO uint32_t BKP7R; /*!< RTC backup register 7, Address offset: 0x6C */
  713. __IO uint32_t BKP8R; /*!< RTC backup register 8, Address offset: 0x70 */
  714. __IO uint32_t BKP9R; /*!< RTC backup register 9, Address offset: 0x74 */
  715. __IO uint32_t BKP10R; /*!< RTC backup register 10, Address offset: 0x78 */
  716. __IO uint32_t BKP11R; /*!< RTC backup register 11, Address offset: 0x7C */
  717. __IO uint32_t BKP12R; /*!< RTC backup register 12, Address offset: 0x80 */
  718. __IO uint32_t BKP13R; /*!< RTC backup register 13, Address offset: 0x84 */
  719. __IO uint32_t BKP14R; /*!< RTC backup register 14, Address offset: 0x88 */
  720. __IO uint32_t BKP15R; /*!< RTC backup register 15, Address offset: 0x8C */
  721. __IO uint32_t BKP16R; /*!< RTC backup register 16, Address offset: 0x90 */
  722. __IO uint32_t BKP17R; /*!< RTC backup register 17, Address offset: 0x94 */
  723. __IO uint32_t BKP18R; /*!< RTC backup register 18, Address offset: 0x98 */
  724. __IO uint32_t BKP19R; /*!< RTC backup register 19, Address offset: 0x9C */
  725. __IO uint32_t BKP20R; /*!< RTC backup register 20, Address offset: 0xA0 */
  726. __IO uint32_t BKP21R; /*!< RTC backup register 21, Address offset: 0xA4 */
  727. __IO uint32_t BKP22R; /*!< RTC backup register 22, Address offset: 0xA8 */
  728. __IO uint32_t BKP23R; /*!< RTC backup register 23, Address offset: 0xAC */
  729. __IO uint32_t BKP24R; /*!< RTC backup register 24, Address offset: 0xB0 */
  730. __IO uint32_t BKP25R; /*!< RTC backup register 25, Address offset: 0xB4 */
  731. __IO uint32_t BKP26R; /*!< RTC backup register 26, Address offset: 0xB8 */
  732. __IO uint32_t BKP27R; /*!< RTC backup register 27, Address offset: 0xBC */
  733. __IO uint32_t BKP28R; /*!< RTC backup register 28, Address offset: 0xC0 */
  734. __IO uint32_t BKP29R; /*!< RTC backup register 29, Address offset: 0xC4 */
  735. __IO uint32_t BKP30R; /*!< RTC backup register 30, Address offset: 0xC8 */
  736. __IO uint32_t BKP31R; /*!< RTC backup register 31, Address offset: 0xCC */
  737. } RTC_TypeDef;
  738. /**
  739. * @brief Serial Audio Interface
  740. */
  741. typedef struct
  742. {
  743. __IO uint32_t GCR; /*!< SAI global configuration register, Address offset: 0x00 */
  744. } SAI_TypeDef;
  745. typedef struct
  746. {
  747. __IO uint32_t CR1; /*!< SAI block x configuration register 1, Address offset: 0x04 */
  748. __IO uint32_t CR2; /*!< SAI block x configuration register 2, Address offset: 0x08 */
  749. __IO uint32_t FRCR; /*!< SAI block x frame configuration register, Address offset: 0x0C */
  750. __IO uint32_t SLOTR; /*!< SAI block x slot register, Address offset: 0x10 */
  751. __IO uint32_t IMR; /*!< SAI block x interrupt mask register, Address offset: 0x14 */
  752. __IO uint32_t SR; /*!< SAI block x status register, Address offset: 0x18 */
  753. __IO uint32_t CLRFR; /*!< SAI block x clear flag register, Address offset: 0x1C */
  754. __IO uint32_t DR; /*!< SAI block x data register, Address offset: 0x20 */
  755. } SAI_Block_TypeDef;
  756. /**
  757. * @brief SPDIF-RX Interface
  758. */
  759. typedef struct
  760. {
  761. __IO uint32_t CR; /*!< Control register, Address offset: 0x00 */
  762. __IO uint32_t IMR; /*!< Interrupt mask register, Address offset: 0x04 */
  763. __IO uint32_t SR; /*!< Status register, Address offset: 0x08 */
  764. __IO uint32_t IFCR; /*!< Interrupt Flag Clear register, Address offset: 0x0C */
  765. __IO uint32_t DR; /*!< Data input register, Address offset: 0x10 */
  766. __IO uint32_t CSR; /*!< Channel Status register, Address offset: 0x14 */
  767. __IO uint32_t DIR; /*!< Debug Information register, Address offset: 0x18 */
  768. } SPDIFRX_TypeDef;
  769. /**
  770. * @brief SD host Interface
  771. */
  772. typedef struct
  773. {
  774. __IO uint32_t POWER; /*!< SDMMC power control register, Address offset: 0x00 */
  775. __IO uint32_t CLKCR; /*!< SDMMClock control register, Address offset: 0x04 */
  776. __IO uint32_t ARG; /*!< SDMMC argument register, Address offset: 0x08 */
  777. __IO uint32_t CMD; /*!< SDMMC command register, Address offset: 0x0C */
  778. __I uint32_t RESPCMD; /*!< SDMMC command response register, Address offset: 0x10 */
  779. __I uint32_t RESP1; /*!< SDMMC response 1 register, Address offset: 0x14 */
  780. __I uint32_t RESP2; /*!< SDMMC response 2 register, Address offset: 0x18 */
  781. __I uint32_t RESP3; /*!< SDMMC response 3 register, Address offset: 0x1C */
  782. __I uint32_t RESP4; /*!< SDMMC response 4 register, Address offset: 0x20 */
  783. __IO uint32_t DTIMER; /*!< SDMMC data timer register, Address offset: 0x24 */
  784. __IO uint32_t DLEN; /*!< SDMMC data length register, Address offset: 0x28 */
  785. __IO uint32_t DCTRL; /*!< SDMMC data control register, Address offset: 0x2C */
  786. __I uint32_t DCOUNT; /*!< SDMMC data counter register, Address offset: 0x30 */
  787. __I uint32_t STA; /*!< SDMMC status register, Address offset: 0x34 */
  788. __IO uint32_t ICR; /*!< SDMMC interrupt clear register, Address offset: 0x38 */
  789. __IO uint32_t MASK; /*!< SDMMC mask register, Address offset: 0x3C */
  790. uint32_t RESERVED0[2]; /*!< Reserved, 0x40-0x44 */
  791. __I uint32_t FIFOCNT; /*!< SDMMC FIFO counter register, Address offset: 0x48 */
  792. uint32_t RESERVED1[13]; /*!< Reserved, 0x4C-0x7C */
  793. __IO uint32_t FIFO; /*!< SDMMC data FIFO register, Address offset: 0x80 */
  794. } SDMMC_TypeDef;
  795. /**
  796. * @brief Serial Peripheral Interface
  797. */
  798. typedef struct
  799. {
  800. __IO uint32_t CR1; /*!< SPI control register 1 (not used in I2S mode), Address offset: 0x00 */
  801. __IO uint32_t CR2; /*!< SPI control register 2, Address offset: 0x04 */
  802. __IO uint32_t SR; /*!< SPI status register, Address offset: 0x08 */
  803. __IO uint32_t DR; /*!< SPI data register, Address offset: 0x0C */
  804. __IO uint32_t CRCPR; /*!< SPI CRC polynomial register (not used in I2S mode), Address offset: 0x10 */
  805. __IO uint32_t RXCRCR; /*!< SPI RX CRC register (not used in I2S mode), Address offset: 0x14 */
  806. __IO uint32_t TXCRCR; /*!< SPI TX CRC register (not used in I2S mode), Address offset: 0x18 */
  807. __IO uint32_t I2SCFGR; /*!< SPI_I2S configuration register, Address offset: 0x1C */
  808. __IO uint32_t I2SPR; /*!< SPI_I2S prescaler register, Address offset: 0x20 */
  809. } SPI_TypeDef;
  810. /**
  811. * @brief QUAD Serial Peripheral Interface
  812. */
  813. typedef struct
  814. {
  815. __IO uint32_t CR; /*!< QUADSPI Control register, Address offset: 0x00 */
  816. __IO uint32_t DCR; /*!< QUADSPI Device Configuration register, Address offset: 0x04 */
  817. __IO uint32_t SR; /*!< QUADSPI Status register, Address offset: 0x08 */
  818. __IO uint32_t FCR; /*!< QUADSPI Flag Clear register, Address offset: 0x0C */
  819. __IO uint32_t DLR; /*!< QUADSPI Data Length register, Address offset: 0x10 */
  820. __IO uint32_t CCR; /*!< QUADSPI Communication Configuration register, Address offset: 0x14 */
  821. __IO uint32_t AR; /*!< QUADSPI Address register, Address offset: 0x18 */
  822. __IO uint32_t ABR; /*!< QUADSPI Alternate Bytes register, Address offset: 0x1C */
  823. __IO uint32_t DR; /*!< QUADSPI Data register, Address offset: 0x20 */
  824. __IO uint32_t PSMKR; /*!< QUADSPI Polling Status Mask register, Address offset: 0x24 */
  825. __IO uint32_t PSMAR; /*!< QUADSPI Polling Status Match register, Address offset: 0x28 */
  826. __IO uint32_t PIR; /*!< QUADSPI Polling Interval register, Address offset: 0x2C */
  827. __IO uint32_t LPTR; /*!< QUADSPI Low Power Timeout register, Address offset: 0x30 */
  828. } QUADSPI_TypeDef;
  829. /**
  830. * @brief TIM
  831. */
  832. typedef struct
  833. {
  834. __IO uint32_t CR1; /*!< TIM control register 1, Address offset: 0x00 */
  835. __IO uint32_t CR2; /*!< TIM control register 2, Address offset: 0x04 */
  836. __IO uint32_t SMCR; /*!< TIM slave mode control register, Address offset: 0x08 */
  837. __IO uint32_t DIER; /*!< TIM DMA/interrupt enable register, Address offset: 0x0C */
  838. __IO uint32_t SR; /*!< TIM status register, Address offset: 0x10 */
  839. __IO uint32_t EGR; /*!< TIM event generation register, Address offset: 0x14 */
  840. __IO uint32_t CCMR1; /*!< TIM capture/compare mode register 1, Address offset: 0x18 */
  841. __IO uint32_t CCMR2; /*!< TIM capture/compare mode register 2, Address offset: 0x1C */
  842. __IO uint32_t CCER; /*!< TIM capture/compare enable register, Address offset: 0x20 */
  843. __IO uint32_t CNT; /*!< TIM counter register, Address offset: 0x24 */
  844. __IO uint32_t PSC; /*!< TIM prescaler, Address offset: 0x28 */
  845. __IO uint32_t ARR; /*!< TIM auto-reload register, Address offset: 0x2C */
  846. __IO uint32_t RCR; /*!< TIM repetition counter register, Address offset: 0x30 */
  847. __IO uint32_t CCR1; /*!< TIM capture/compare register 1, Address offset: 0x34 */
  848. __IO uint32_t CCR2; /*!< TIM capture/compare register 2, Address offset: 0x38 */
  849. __IO uint32_t CCR3; /*!< TIM capture/compare register 3, Address offset: 0x3C */
  850. __IO uint32_t CCR4; /*!< TIM capture/compare register 4, Address offset: 0x40 */
  851. __IO uint32_t BDTR; /*!< TIM break and dead-time register, Address offset: 0x44 */
  852. __IO uint32_t DCR; /*!< TIM DMA control register, Address offset: 0x48 */
  853. __IO uint32_t DMAR; /*!< TIM DMA address for full transfer, Address offset: 0x4C */
  854. __IO uint32_t OR; /*!< TIM option register, Address offset: 0x50 */
  855. __IO uint32_t CCMR3; /*!< TIM capture/compare mode register 3, Address offset: 0x54 */
  856. __IO uint32_t CCR5; /*!< TIM capture/compare mode register5, Address offset: 0x58 */
  857. __IO uint32_t CCR6; /*!< TIM capture/compare mode register6, Address offset: 0x5C */
  858. } TIM_TypeDef;
  859. /**
  860. * @brief LPTIMIMER
  861. */
  862. typedef struct
  863. {
  864. __IO uint32_t ISR; /*!< LPTIM Interrupt and Status register, Address offset: 0x00 */
  865. __IO uint32_t ICR; /*!< LPTIM Interrupt Clear register, Address offset: 0x04 */
  866. __IO uint32_t IER; /*!< LPTIM Interrupt Enable register, Address offset: 0x08 */
  867. __IO uint32_t CFGR; /*!< LPTIM Configuration register, Address offset: 0x0C */
  868. __IO uint32_t CR; /*!< LPTIM Control register, Address offset: 0x10 */
  869. __IO uint32_t CMP; /*!< LPTIM Compare register, Address offset: 0x14 */
  870. __IO uint32_t ARR; /*!< LPTIM Autoreload register, Address offset: 0x18 */
  871. __IO uint32_t CNT; /*!< LPTIM Counter register, Address offset: 0x1C */
  872. __IO uint32_t OR; /*!< LPTIM Option register, Address offset: 0x20 */
  873. } LPTIM_TypeDef;
  874. /**
  875. * @brief Universal Synchronous Asynchronous Receiver Transmitter
  876. */
  877. typedef struct
  878. {
  879. __IO uint32_t CR1; /*!< USART Control register 1, Address offset: 0x00 */
  880. __IO uint32_t CR2; /*!< USART Control register 2, Address offset: 0x04 */
  881. __IO uint32_t CR3; /*!< USART Control register 3, Address offset: 0x08 */
  882. __IO uint32_t BRR; /*!< USART Baud rate register, Address offset: 0x0C */
  883. __IO uint32_t GTPR; /*!< USART Guard time and prescaler register, Address offset: 0x10 */
  884. __IO uint32_t RTOR; /*!< USART Receiver Time Out register, Address offset: 0x14 */
  885. __IO uint32_t RQR; /*!< USART Request register, Address offset: 0x18 */
  886. __IO uint32_t ISR; /*!< USART Interrupt and status register, Address offset: 0x1C */
  887. __IO uint32_t ICR; /*!< USART Interrupt flag Clear register, Address offset: 0x20 */
  888. __IO uint32_t RDR; /*!< USART Receive Data register, Address offset: 0x24 */
  889. __IO uint32_t TDR; /*!< USART Transmit Data register, Address offset: 0x28 */
  890. } USART_TypeDef;
  891. /**
  892. * @brief Window WATCHDOG
  893. */
  894. typedef struct
  895. {
  896. __IO uint32_t CR; /*!< WWDG Control register, Address offset: 0x00 */
  897. __IO uint32_t CFR; /*!< WWDG Configuration register, Address offset: 0x04 */
  898. __IO uint32_t SR; /*!< WWDG Status register, Address offset: 0x08 */
  899. } WWDG_TypeDef;
  900. /**
  901. * @brief RNG
  902. */
  903. typedef struct
  904. {
  905. __IO uint32_t CR; /*!< RNG control register, Address offset: 0x00 */
  906. __IO uint32_t SR; /*!< RNG status register, Address offset: 0x04 */
  907. __IO uint32_t DR; /*!< RNG data register, Address offset: 0x08 */
  908. } RNG_TypeDef;
  909. /**
  910. * @}
  911. */
  912. /**
  913. * @brief USB_OTG_Core_Registers
  914. */
  915. typedef struct
  916. {
  917. __IO uint32_t GOTGCTL; /*!< USB_OTG Control and Status Register 000h */
  918. __IO uint32_t GOTGINT; /*!< USB_OTG Interrupt Register 004h */
  919. __IO uint32_t GAHBCFG; /*!< Core AHB Configuration Register 008h */
  920. __IO uint32_t GUSBCFG; /*!< Core USB Configuration Register 00Ch */
  921. __IO uint32_t GRSTCTL; /*!< Core Reset Register 010h */
  922. __IO uint32_t GINTSTS; /*!< Core Interrupt Register 014h */
  923. __IO uint32_t GINTMSK; /*!< Core Interrupt Mask Register 018h */
  924. __IO uint32_t GRXSTSR; /*!< Receive Sts Q Read Register 01Ch */
  925. __IO uint32_t GRXSTSP; /*!< Receive Sts Q Read & POP Register 020h */
  926. __IO uint32_t GRXFSIZ; /*!< Receive FIFO Size Register 024h */
  927. __IO uint32_t DIEPTXF0_HNPTXFSIZ; /*!< EP0 / Non Periodic Tx FIFO Size Register 028h */
  928. __IO uint32_t HNPTXSTS; /*!< Non Periodic Tx FIFO/Queue Sts reg 02Ch */
  929. uint32_t Reserved30[2]; /*!< Reserved 030h */
  930. __IO uint32_t GCCFG; /*!< General Purpose IO Register 038h */
  931. __IO uint32_t CID; /*!< User ID Register 03Ch */
  932. uint32_t Reserved5[3]; /*!< Reserved 040h-048h */
  933. __IO uint32_t GHWCFG3; /*!< User HW config3 04Ch */
  934. uint32_t Reserved6; /*!< Reserved 050h */
  935. __IO uint32_t GLPMCFG; /*!< LPM Register 054h */
  936. __IO uint32_t GPWRDN; /*!< Power Down Register 058h */
  937. __IO uint32_t GDFIFOCFG; /*!< DFIFO Software Config Register 05Ch */
  938. __IO uint32_t GADPCTL; /*!< ADP Timer, Control and Status Register 60Ch */
  939. uint32_t Reserved43[39]; /*!< Reserved 058h-0FFh */
  940. __IO uint32_t HPTXFSIZ; /*!< Host Periodic Tx FIFO Size Reg 100h */
  941. __IO uint32_t DIEPTXF[0x0F]; /*!< dev Periodic Transmit FIFO */
  942. } USB_OTG_GlobalTypeDef;
  943. /**
  944. * @brief USB_OTG_device_Registers
  945. */
  946. typedef struct
  947. {
  948. __IO uint32_t DCFG; /*!< dev Configuration Register 800h */
  949. __IO uint32_t DCTL; /*!< dev Control Register 804h */
  950. __IO uint32_t DSTS; /*!< dev Status Register (RO) 808h */
  951. uint32_t Reserved0C; /*!< Reserved 80Ch */
  952. __IO uint32_t DIEPMSK; /*!< dev IN Endpoint Mask 810h */
  953. __IO uint32_t DOEPMSK; /*!< dev OUT Endpoint Mask 814h */
  954. __IO uint32_t DAINT; /*!< dev All Endpoints Itr Reg 818h */
  955. __IO uint32_t DAINTMSK; /*!< dev All Endpoints Itr Mask 81Ch */
  956. uint32_t Reserved20; /*!< Reserved 820h */
  957. uint32_t Reserved9; /*!< Reserved 824h */
  958. __IO uint32_t DVBUSDIS; /*!< dev VBUS discharge Register 828h */
  959. __IO uint32_t DVBUSPULSE; /*!< dev VBUS Pulse Register 82Ch */
  960. __IO uint32_t DTHRCTL; /*!< dev threshold 830h */
  961. __IO uint32_t DIEPEMPMSK; /*!< dev empty msk 834h */
  962. __IO uint32_t DEACHINT; /*!< dedicated EP interrupt 838h */
  963. __IO uint32_t DEACHMSK; /*!< dedicated EP msk 83Ch */
  964. uint32_t Reserved40; /*!< dedicated EP mask 840h */
  965. __IO uint32_t DINEP1MSK; /*!< dedicated EP mask 844h */
  966. uint32_t Reserved44[15]; /*!< Reserved 844-87Ch */
  967. __IO uint32_t DOUTEP1MSK; /*!< dedicated EP msk 884h */
  968. } USB_OTG_DeviceTypeDef;
  969. /**
  970. * @brief USB_OTG_IN_Endpoint-Specific_Register
  971. */
  972. typedef struct
  973. {
  974. __IO uint32_t DIEPCTL; /*!< dev IN Endpoint Control Reg 900h + (ep_num * 20h) + 00h */
  975. uint32_t Reserved04; /*!< Reserved 900h + (ep_num * 20h) + 04h */
  976. __IO uint32_t DIEPINT; /*!< dev IN Endpoint Itr Reg 900h + (ep_num * 20h) + 08h */
  977. uint32_t Reserved0C; /*!< Reserved 900h + (ep_num * 20h) + 0Ch */
  978. __IO uint32_t DIEPTSIZ; /*!< IN Endpoint Txfer Size 900h + (ep_num * 20h) + 10h */
  979. __IO uint32_t DIEPDMA; /*!< IN Endpoint DMA Address Reg 900h + (ep_num * 20h) + 14h */
  980. __IO uint32_t DTXFSTS; /*!< IN Endpoint Tx FIFO Status Reg 900h + (ep_num * 20h) + 18h */
  981. uint32_t Reserved18; /*!< Reserved 900h+(ep_num*20h)+1Ch-900h+ (ep_num * 20h) + 1Ch */
  982. } USB_OTG_INEndpointTypeDef;
  983. /**
  984. * @brief USB_OTG_OUT_Endpoint-Specific_Registers
  985. */
  986. typedef struct
  987. {
  988. __IO uint32_t DOEPCTL; /*!< dev OUT Endpoint Control Reg B00h + (ep_num * 20h) + 00h */
  989. uint32_t Reserved04; /*!< Reserved B00h + (ep_num * 20h) + 04h */
  990. __IO uint32_t DOEPINT; /*!< dev OUT Endpoint Itr Reg B00h + (ep_num * 20h) + 08h */
  991. uint32_t Reserved0C; /*!< Reserved B00h + (ep_num * 20h) + 0Ch */
  992. __IO uint32_t DOEPTSIZ; /*!< dev OUT Endpoint Txfer Size B00h + (ep_num * 20h) + 10h */
  993. __IO uint32_t DOEPDMA; /*!< dev OUT Endpoint DMA Address B00h + (ep_num * 20h) + 14h */
  994. uint32_t Reserved18[2]; /*!< Reserved B00h + (ep_num * 20h) + 18h - B00h + (ep_num * 20h) + 1Ch */
  995. } USB_OTG_OUTEndpointTypeDef;
  996. /**
  997. * @brief USB_OTG_Host_Mode_Register_Structures
  998. */
  999. typedef struct
  1000. {
  1001. __IO uint32_t HCFG; /*!< Host Configuration Register 400h */
  1002. __IO uint32_t HFIR; /*!< Host Frame Interval Register 404h */
  1003. __IO uint32_t HFNUM; /*!< Host Frame Nbr/Frame Remaining 408h */
  1004. uint32_t Reserved40C; /*!< Reserved 40Ch */
  1005. __IO uint32_t HPTXSTS; /*!< Host Periodic Tx FIFO/ Queue Status 410h */
  1006. __IO uint32_t HAINT; /*!< Host All Channels Interrupt Register 414h */
  1007. __IO uint32_t HAINTMSK; /*!< Host All Channels Interrupt Mask 418h */
  1008. } USB_OTG_HostTypeDef;
  1009. /**
  1010. * @brief USB_OTG_Host_Channel_Specific_Registers
  1011. */
  1012. typedef struct
  1013. {
  1014. __IO uint32_t HCCHAR; /*!< Host Channel Characteristics Register 500h */
  1015. __IO uint32_t HCSPLT; /*!< Host Channel Split Control Register 504h */
  1016. __IO uint32_t HCINT; /*!< Host Channel Interrupt Register 508h */
  1017. __IO uint32_t HCINTMSK; /*!< Host Channel Interrupt Mask Register 50Ch */
  1018. __IO uint32_t HCTSIZ; /*!< Host Channel Transfer Size Register 510h */
  1019. __IO uint32_t HCDMA; /*!< Host Channel DMA Address Register 514h */
  1020. uint32_t Reserved[2]; /*!< Reserved */
  1021. } USB_OTG_HostChannelTypeDef;
  1022. /**
  1023. * @}
  1024. */
  1025. /** @addtogroup Peripheral_memory_map
  1026. * @{
  1027. */
  1028. #define RAMITCM_BASE ((uint32_t)0x00000000) /*!< Base address of :16KB RAM reserved for CPU execution/instruction accessible over ITCM */
  1029. #define FLASHITCM_BASE ((uint32_t)0x00200000) /*!< Base address of :(up to 1 MB) embedded FLASH memory accessible over ITCM */
  1030. #define FLASHAXI_BASE ((uint32_t)0x08000000) /*!< Base address of : (up to 1 MB) embedded FLASH memory accessible over AXI */
  1031. #define RAMDTCM_BASE ((uint32_t)0x20000000) /*!< Base address of : 64KB system data RAM accessible over DTCM */
  1032. #define SRAM1_BASE ((uint32_t)0x20010000) /*!< Base address of : 240KB RAM1 accessible over AXI/AHB */
  1033. #define SRAM2_BASE ((uint32_t)0x2004C000) /*!< Base address of : 16KB RAM2 accessible over AXI/AHB */
  1034. #define PERIPH_BASE ((uint32_t)0x40000000) /*!< Base address of : AHB/ABP Peripherals */
  1035. #define BKPSRAM_BASE ((uint32_t)0x40024000) /*!< Base address of : Backup SRAM(4 KB) */
  1036. #define QSPI_BASE ((uint32_t)0x90000000) /*!< Base address of : QSPI memories accessible over AXI */
  1037. #define FMC_R_BASE ((uint32_t)0xA0000000) /*!< Base address of : FMC Control registers */
  1038. #define QSPI_R_BASE ((uint32_t)0xA0001000) /*!< Base address of : QSPI Control registers */
  1039. #define FLASH_END ((uint32_t)0x080FFFFF) /*!< FLASH end address */
  1040. /* Legacy define */
  1041. #define FLASH_BASE FLASHAXI_BASE
  1042. /*!< Peripheral memory map */
  1043. #define APB1PERIPH_BASE PERIPH_BASE
  1044. #define APB2PERIPH_BASE (PERIPH_BASE + 0x00010000)
  1045. #define AHB1PERIPH_BASE (PERIPH_BASE + 0x00020000)
  1046. #define AHB2PERIPH_BASE (PERIPH_BASE + 0x10000000)
  1047. /*!< APB1 peripherals */
  1048. #define TIM2_BASE (APB1PERIPH_BASE + 0x0000)
  1049. #define TIM3_BASE (APB1PERIPH_BASE + 0x0400)
  1050. #define TIM4_BASE (APB1PERIPH_BASE + 0x0800)
  1051. #define TIM5_BASE (APB1PERIPH_BASE + 0x0C00)
  1052. #define TIM6_BASE (APB1PERIPH_BASE + 0x1000)
  1053. #define TIM7_BASE (APB1PERIPH_BASE + 0x1400)
  1054. #define TIM12_BASE (APB1PERIPH_BASE + 0x1800)
  1055. #define TIM13_BASE (APB1PERIPH_BASE + 0x1C00)
  1056. #define TIM14_BASE (APB1PERIPH_BASE + 0x2000)
  1057. #define LPTIM1_BASE (APB1PERIPH_BASE + 0x2400)
  1058. #define RTC_BASE (APB1PERIPH_BASE + 0x2800)
  1059. #define WWDG_BASE (APB1PERIPH_BASE + 0x2C00)
  1060. #define IWDG_BASE (APB1PERIPH_BASE + 0x3000)
  1061. #define SPI2_BASE (APB1PERIPH_BASE + 0x3800)
  1062. #define SPI3_BASE (APB1PERIPH_BASE + 0x3C00)
  1063. #define SPDIFRX_BASE (APB1PERIPH_BASE + 0x4000)
  1064. #define USART2_BASE (APB1PERIPH_BASE + 0x4400)
  1065. #define USART3_BASE (APB1PERIPH_BASE + 0x4800)
  1066. #define UART4_BASE (APB1PERIPH_BASE + 0x4C00)
  1067. #define UART5_BASE (APB1PERIPH_BASE + 0x5000)
  1068. #define I2C1_BASE (APB1PERIPH_BASE + 0x5400)
  1069. #define I2C2_BASE (APB1PERIPH_BASE + 0x5800)
  1070. #define I2C3_BASE (APB1PERIPH_BASE + 0x5C00)
  1071. #define I2C4_BASE (APB1PERIPH_BASE + 0x6000)
  1072. #define CAN1_BASE (APB1PERIPH_BASE + 0x6400)
  1073. #define CAN2_BASE (APB1PERIPH_BASE + 0x6800)
  1074. #define CEC_BASE (APB1PERIPH_BASE + 0x6C00)
  1075. #define PWR_BASE (APB1PERIPH_BASE + 0x7000)
  1076. #define DAC_BASE (APB1PERIPH_BASE + 0x7400)
  1077. #define UART7_BASE (APB1PERIPH_BASE + 0x7800)
  1078. #define UART8_BASE (APB1PERIPH_BASE + 0x7C00)
  1079. /*!< APB2 peripherals */
  1080. #define TIM1_BASE (APB2PERIPH_BASE + 0x0000)
  1081. #define TIM8_BASE (APB2PERIPH_BASE + 0x0400)
  1082. #define USART1_BASE (APB2PERIPH_BASE + 0x1000)
  1083. #define USART6_BASE (APB2PERIPH_BASE + 0x1400)
  1084. #define ADC1_BASE (APB2PERIPH_BASE + 0x2000)
  1085. #define ADC2_BASE (APB2PERIPH_BASE + 0x2100)
  1086. #define ADC3_BASE (APB2PERIPH_BASE + 0x2200)
  1087. #define ADC_BASE (APB2PERIPH_BASE + 0x2300)
  1088. #define SDMMC1_BASE (APB2PERIPH_BASE + 0x2C00)
  1089. #define SPI1_BASE (APB2PERIPH_BASE + 0x3000)
  1090. #define SPI4_BASE (APB2PERIPH_BASE + 0x3400)
  1091. #define SYSCFG_BASE (APB2PERIPH_BASE + 0x3800)
  1092. #define EXTI_BASE (APB2PERIPH_BASE + 0x3C00)
  1093. #define TIM9_BASE (APB2PERIPH_BASE + 0x4000)
  1094. #define TIM10_BASE (APB2PERIPH_BASE + 0x4400)
  1095. #define TIM11_BASE (APB2PERIPH_BASE + 0x4800)
  1096. #define SPI5_BASE (APB2PERIPH_BASE + 0x5000)
  1097. #define SPI6_BASE (APB2PERIPH_BASE + 0x5400)
  1098. #define SAI1_BASE (APB2PERIPH_BASE + 0x5800)
  1099. #define SAI2_BASE (APB2PERIPH_BASE + 0x5C00)
  1100. #define SAI1_Block_A_BASE (SAI1_BASE + 0x004)
  1101. #define SAI1_Block_B_BASE (SAI1_BASE + 0x024)
  1102. #define SAI2_Block_A_BASE (SAI2_BASE + 0x004)
  1103. #define SAI2_Block_B_BASE (SAI2_BASE + 0x024)
  1104. #define LTDC_BASE (APB2PERIPH_BASE + 0x6800)
  1105. #define LTDC_Layer1_BASE (LTDC_BASE + 0x84)
  1106. #define LTDC_Layer2_BASE (LTDC_BASE + 0x104)
  1107. /*!< AHB1 peripherals */
  1108. #define GPIOA_BASE (AHB1PERIPH_BASE + 0x0000)
  1109. #define GPIOB_BASE (AHB1PERIPH_BASE + 0x0400)
  1110. #define GPIOC_BASE (AHB1PERIPH_BASE + 0x0800)
  1111. #define GPIOD_BASE (AHB1PERIPH_BASE + 0x0C00)
  1112. #define GPIOE_BASE (AHB1PERIPH_BASE + 0x1000)
  1113. #define GPIOF_BASE (AHB1PERIPH_BASE + 0x1400)
  1114. #define GPIOG_BASE (AHB1PERIPH_BASE + 0x1800)
  1115. #define GPIOH_BASE (AHB1PERIPH_BASE + 0x1C00)
  1116. #define GPIOI_BASE (AHB1PERIPH_BASE + 0x2000)
  1117. #define GPIOJ_BASE (AHB1PERIPH_BASE + 0x2400)
  1118. #define GPIOK_BASE (AHB1PERIPH_BASE + 0x2800)
  1119. #define CRC_BASE (AHB1PERIPH_BASE + 0x3000)
  1120. #define RCC_BASE (AHB1PERIPH_BASE + 0x3800)
  1121. #define FLASH_R_BASE (AHB1PERIPH_BASE + 0x3C00)
  1122. #define DMA1_BASE (AHB1PERIPH_BASE + 0x6000)
  1123. #define DMA1_Stream0_BASE (DMA1_BASE + 0x010)
  1124. #define DMA1_Stream1_BASE (DMA1_BASE + 0x028)
  1125. #define DMA1_Stream2_BASE (DMA1_BASE + 0x040)
  1126. #define DMA1_Stream3_BASE (DMA1_BASE + 0x058)
  1127. #define DMA1_Stream4_BASE (DMA1_BASE + 0x070)
  1128. #define DMA1_Stream5_BASE (DMA1_BASE + 0x088)
  1129. #define DMA1_Stream6_BASE (DMA1_BASE + 0x0A0)
  1130. #define DMA1_Stream7_BASE (DMA1_BASE + 0x0B8)
  1131. #define DMA2_BASE (AHB1PERIPH_BASE + 0x6400)
  1132. #define DMA2_Stream0_BASE (DMA2_BASE + 0x010)
  1133. #define DMA2_Stream1_BASE (DMA2_BASE + 0x028)
  1134. #define DMA2_Stream2_BASE (DMA2_BASE + 0x040)
  1135. #define DMA2_Stream3_BASE (DMA2_BASE + 0x058)
  1136. #define DMA2_Stream4_BASE (DMA2_BASE + 0x070)
  1137. #define DMA2_Stream5_BASE (DMA2_BASE + 0x088)
  1138. #define DMA2_Stream6_BASE (DMA2_BASE + 0x0A0)
  1139. #define DMA2_Stream7_BASE (DMA2_BASE + 0x0B8)
  1140. #define ETH_BASE (AHB1PERIPH_BASE + 0x8000)
  1141. #define ETH_MAC_BASE (ETH_BASE)
  1142. #define ETH_MMC_BASE (ETH_BASE + 0x0100)
  1143. #define ETH_PTP_BASE (ETH_BASE + 0x0700)
  1144. #define ETH_DMA_BASE (ETH_BASE + 0x1000)
  1145. #define DMA2D_BASE (AHB1PERIPH_BASE + 0xB000)
  1146. /*!< AHB2 peripherals */
  1147. #define DCMI_BASE (AHB2PERIPH_BASE + 0x50000)
  1148. #define RNG_BASE (AHB2PERIPH_BASE + 0x60800)
  1149. /*!< FMC Bankx registers base address */
  1150. #define FMC_Bank1_R_BASE (FMC_R_BASE + 0x0000)
  1151. #define FMC_Bank1E_R_BASE (FMC_R_BASE + 0x0104)
  1152. #define FMC_Bank3_R_BASE (FMC_R_BASE + 0x0080)
  1153. #define FMC_Bank5_6_R_BASE (FMC_R_BASE + 0x0140)
  1154. /* Debug MCU registers base address */
  1155. #define DBGMCU_BASE ((uint32_t )0xE0042000)
  1156. /*!< USB registers base address */
  1157. #define USB_OTG_HS_PERIPH_BASE ((uint32_t )0x40040000)
  1158. #define USB_OTG_FS_PERIPH_BASE ((uint32_t )0x50000000)
  1159. #define USB_OTG_GLOBAL_BASE ((uint32_t )0x000)
  1160. #define USB_OTG_DEVICE_BASE ((uint32_t )0x800)
  1161. #define USB_OTG_IN_ENDPOINT_BASE ((uint32_t )0x900)
  1162. #define USB_OTG_OUT_ENDPOINT_BASE ((uint32_t )0xB00)
  1163. #define USB_OTG_EP_REG_SIZE ((uint32_t )0x20)
  1164. #define USB_OTG_HOST_BASE ((uint32_t )0x400)
  1165. #define USB_OTG_HOST_PORT_BASE ((uint32_t )0x440)
  1166. #define USB_OTG_HOST_CHANNEL_BASE ((uint32_t )0x500)
  1167. #define USB_OTG_HOST_CHANNEL_SIZE ((uint32_t )0x20)
  1168. #define USB_OTG_PCGCCTL_BASE ((uint32_t )0xE00)
  1169. #define USB_OTG_FIFO_BASE ((uint32_t )0x1000)
  1170. #define USB_OTG_FIFO_SIZE ((uint32_t )0x1000)
  1171. /**
  1172. * @}
  1173. */
  1174. /** @addtogroup Peripheral_declaration
  1175. * @{
  1176. */
  1177. #define TIM2 ((TIM_TypeDef *) TIM2_BASE)
  1178. #define TIM3 ((TIM_TypeDef *) TIM3_BASE)
  1179. #define TIM4 ((TIM_TypeDef *) TIM4_BASE)
  1180. #define TIM5 ((TIM_TypeDef *) TIM5_BASE)
  1181. #define TIM6 ((TIM_TypeDef *) TIM6_BASE)
  1182. #define TIM7 ((TIM_TypeDef *) TIM7_BASE)
  1183. #define TIM12 ((TIM_TypeDef *) TIM12_BASE)
  1184. #define TIM13 ((TIM_TypeDef *) TIM13_BASE)
  1185. #define TIM14 ((TIM_TypeDef *) TIM14_BASE)
  1186. #define LPTIM1 ((LPTIM_TypeDef *) LPTIM1_BASE)
  1187. #define RTC ((RTC_TypeDef *) RTC_BASE)
  1188. #define WWDG ((WWDG_TypeDef *) WWDG_BASE)
  1189. #define IWDG ((IWDG_TypeDef *) IWDG_BASE)
  1190. #define SPI2 ((SPI_TypeDef *) SPI2_BASE)
  1191. #define SPI3 ((SPI_TypeDef *) SPI3_BASE)
  1192. #define SPDIFRX ((SPDIFRX_TypeDef *) SPDIFRX_BASE)
  1193. #define USART2 ((USART_TypeDef *) USART2_BASE)
  1194. #define USART3 ((USART_TypeDef *) USART3_BASE)
  1195. #define UART4 ((USART_TypeDef *) UART4_BASE)
  1196. #define UART5 ((USART_TypeDef *) UART5_BASE)
  1197. #define I2C1 ((I2C_TypeDef *) I2C1_BASE)
  1198. #define I2C2 ((I2C_TypeDef *) I2C2_BASE)
  1199. #define I2C3 ((I2C_TypeDef *) I2C3_BASE)
  1200. #define I2C4 ((I2C_TypeDef *) I2C4_BASE)
  1201. #define CAN1 ((CAN_TypeDef *) CAN1_BASE)
  1202. #define CAN2 ((CAN_TypeDef *) CAN2_BASE)
  1203. #define CEC ((CEC_TypeDef *) CEC_BASE)
  1204. #define PWR ((PWR_TypeDef *) PWR_BASE)
  1205. #define DAC ((DAC_TypeDef *) DAC_BASE)
  1206. #define UART7 ((USART_TypeDef *) UART7_BASE)
  1207. #define UART8 ((USART_TypeDef *) UART8_BASE)
  1208. #define TIM1 ((TIM_TypeDef *) TIM1_BASE)
  1209. #define TIM8 ((TIM_TypeDef *) TIM8_BASE)
  1210. #define USART1 ((USART_TypeDef *) USART1_BASE)
  1211. #define USART6 ((USART_TypeDef *) USART6_BASE)
  1212. #define ADC ((ADC_Common_TypeDef *) ADC_BASE)
  1213. #define ADC1 ((ADC_TypeDef *) ADC1_BASE)
  1214. #define ADC2 ((ADC_TypeDef *) ADC2_BASE)
  1215. #define ADC3 ((ADC_TypeDef *) ADC3_BASE)
  1216. #define SDMMC1 ((SDMMC_TypeDef *) SDMMC1_BASE)
  1217. #define SPI1 ((SPI_TypeDef *) SPI1_BASE)
  1218. #define SPI4 ((SPI_TypeDef *) SPI4_BASE)
  1219. #define SYSCFG ((SYSCFG_TypeDef *) SYSCFG_BASE)
  1220. #define EXTI ((EXTI_TypeDef *) EXTI_BASE)
  1221. #define TIM9 ((TIM_TypeDef *) TIM9_BASE)
  1222. #define TIM10 ((TIM_TypeDef *) TIM10_BASE)
  1223. #define TIM11 ((TIM_TypeDef *) TIM11_BASE)
  1224. #define SPI5 ((SPI_TypeDef *) SPI5_BASE)
  1225. #define SPI6 ((SPI_TypeDef *) SPI6_BASE)
  1226. #define SAI1 ((SAI_TypeDef *) SAI1_BASE)
  1227. #define SAI2 ((SAI_TypeDef *) SAI2_BASE)
  1228. #define SAI1_Block_A ((SAI_Block_TypeDef *)SAI1_Block_A_BASE)
  1229. #define SAI1_Block_B ((SAI_Block_TypeDef *)SAI1_Block_B_BASE)
  1230. #define SAI2_Block_A ((SAI_Block_TypeDef *)SAI2_Block_A_BASE)
  1231. #define SAI2_Block_B ((SAI_Block_TypeDef *)SAI2_Block_B_BASE)
  1232. #define LTDC ((LTDC_TypeDef *)LTDC_BASE)
  1233. #define LTDC_Layer1 ((LTDC_Layer_TypeDef *)LTDC_Layer1_BASE)
  1234. #define LTDC_Layer2 ((LTDC_Layer_TypeDef *)LTDC_Layer2_BASE)
  1235. #define GPIOA ((GPIO_TypeDef *) GPIOA_BASE)
  1236. #define GPIOB ((GPIO_TypeDef *) GPIOB_BASE)
  1237. #define GPIOC ((GPIO_TypeDef *) GPIOC_BASE)
  1238. #define GPIOD ((GPIO_TypeDef *) GPIOD_BASE)
  1239. #define GPIOE ((GPIO_TypeDef *) GPIOE_BASE)
  1240. #define GPIOF ((GPIO_TypeDef *) GPIOF_BASE)
  1241. #define GPIOG ((GPIO_TypeDef *) GPIOG_BASE)
  1242. #define GPIOH ((GPIO_TypeDef *) GPIOH_BASE)
  1243. #define GPIOI ((GPIO_TypeDef *) GPIOI_BASE)
  1244. #define GPIOJ ((GPIO_TypeDef *) GPIOJ_BASE)
  1245. #define GPIOK ((GPIO_TypeDef *) GPIOK_BASE)
  1246. #define CRC ((CRC_TypeDef *) CRC_BASE)
  1247. #define RCC ((RCC_TypeDef *) RCC_BASE)
  1248. #define FLASH ((FLASH_TypeDef *) FLASH_R_BASE)
  1249. #define DMA1 ((DMA_TypeDef *) DMA1_BASE)
  1250. #define DMA1_Stream0 ((DMA_Stream_TypeDef *) DMA1_Stream0_BASE)
  1251. #define DMA1_Stream1 ((DMA_Stream_TypeDef *) DMA1_Stream1_BASE)
  1252. #define DMA1_Stream2 ((DMA_Stream_TypeDef *) DMA1_Stream2_BASE)
  1253. #define DMA1_Stream3 ((DMA_Stream_TypeDef *) DMA1_Stream3_BASE)
  1254. #define DMA1_Stream4 ((DMA_Stream_TypeDef *) DMA1_Stream4_BASE)
  1255. #define DMA1_Stream5 ((DMA_Stream_TypeDef *) DMA1_Stream5_BASE)
  1256. #define DMA1_Stream6 ((DMA_Stream_TypeDef *) DMA1_Stream6_BASE)
  1257. #define DMA1_Stream7 ((DMA_Stream_TypeDef *) DMA1_Stream7_BASE)
  1258. #define DMA2 ((DMA_TypeDef *) DMA2_BASE)
  1259. #define DMA2_Stream0 ((DMA_Stream_TypeDef *) DMA2_Stream0_BASE)
  1260. #define DMA2_Stream1 ((DMA_Stream_TypeDef *) DMA2_Stream1_BASE)
  1261. #define DMA2_Stream2 ((DMA_Stream_TypeDef *) DMA2_Stream2_BASE)
  1262. #define DMA2_Stream3 ((DMA_Stream_TypeDef *) DMA2_Stream3_BASE)
  1263. #define DMA2_Stream4 ((DMA_Stream_TypeDef *) DMA2_Stream4_BASE)
  1264. #define DMA2_Stream5 ((DMA_Stream_TypeDef *) DMA2_Stream5_BASE)
  1265. #define DMA2_Stream6 ((DMA_Stream_TypeDef *) DMA2_Stream6_BASE)
  1266. #define DMA2_Stream7 ((DMA_Stream_TypeDef *) DMA2_Stream7_BASE)
  1267. #define ETH ((ETH_TypeDef *) ETH_BASE)
  1268. #define DMA2D ((DMA2D_TypeDef *)DMA2D_BASE)
  1269. #define DCMI ((DCMI_TypeDef *) DCMI_BASE)
  1270. #define RNG ((RNG_TypeDef *) RNG_BASE)
  1271. #define FMC_Bank1 ((FMC_Bank1_TypeDef *) FMC_Bank1_R_BASE)
  1272. #define FMC_Bank1E ((FMC_Bank1E_TypeDef *) FMC_Bank1E_R_BASE)
  1273. #define FMC_Bank3 ((FMC_Bank3_TypeDef *) FMC_Bank3_R_BASE)
  1274. #define FMC_Bank5_6 ((FMC_Bank5_6_TypeDef *) FMC_Bank5_6_R_BASE)
  1275. #define QUADSPI ((QUADSPI_TypeDef *) QSPI_R_BASE)
  1276. #define DBGMCU ((DBGMCU_TypeDef *) DBGMCU_BASE)
  1277. #define USB_OTG_FS ((USB_OTG_GlobalTypeDef *) USB_OTG_FS_PERIPH_BASE)
  1278. #define USB_OTG_HS ((USB_OTG_GlobalTypeDef *) USB_OTG_HS_PERIPH_BASE)
  1279. /**
  1280. * @}
  1281. */
  1282. /** @addtogroup Exported_constants
  1283. * @{
  1284. */
  1285. /** @addtogroup Peripheral_Registers_Bits_Definition
  1286. * @{
  1287. */
  1288. /******************************************************************************/
  1289. /* Peripheral Registers_Bits_Definition */
  1290. /******************************************************************************/
  1291. /******************************************************************************/
  1292. /* */
  1293. /* Analog to Digital Converter */
  1294. /* */
  1295. /******************************************************************************/
  1296. /******************** Bit definition for ADC_SR register ********************/
  1297. #define ADC_SR_AWD ((uint32_t)0x00000001) /*!<Analog watchdog flag */
  1298. #define ADC_SR_EOC ((uint32_t)0x00000002) /*!<End of conversion */
  1299. #define ADC_SR_JEOC ((uint32_t)0x00000004) /*!<Injected channel end of conversion */
  1300. #define ADC_SR_JSTRT ((uint32_t)0x00000008) /*!<Injected channel Start flag */
  1301. #define ADC_SR_STRT ((uint32_t)0x00000010) /*!<Regular channel Start flag */
  1302. #define ADC_SR_OVR ((uint32_t)0x00000020) /*!<Overrun flag */
  1303. /******************* Bit definition for ADC_CR1 register ********************/
  1304. #define ADC_CR1_AWDCH ((uint32_t)0x0000001F) /*!<AWDCH[4:0] bits (Analog watchdog channel select bits) */
  1305. #define ADC_CR1_AWDCH_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1306. #define ADC_CR1_AWDCH_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1307. #define ADC_CR1_AWDCH_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1308. #define ADC_CR1_AWDCH_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  1309. #define ADC_CR1_AWDCH_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  1310. #define ADC_CR1_EOCIE ((uint32_t)0x00000020) /*!<Interrupt enable for EOC */
  1311. #define ADC_CR1_AWDIE ((uint32_t)0x00000040) /*!<AAnalog Watchdog interrupt enable */
  1312. #define ADC_CR1_JEOCIE ((uint32_t)0x00000080) /*!<Interrupt enable for injected channels */
  1313. #define ADC_CR1_SCAN ((uint32_t)0x00000100) /*!<Scan mode */
  1314. #define ADC_CR1_AWDSGL ((uint32_t)0x00000200) /*!<Enable the watchdog on a single channel in scan mode */
  1315. #define ADC_CR1_JAUTO ((uint32_t)0x00000400) /*!<Automatic injected group conversion */
  1316. #define ADC_CR1_DISCEN ((uint32_t)0x00000800) /*!<Discontinuous mode on regular channels */
  1317. #define ADC_CR1_JDISCEN ((uint32_t)0x00001000) /*!<Discontinuous mode on injected channels */
  1318. #define ADC_CR1_DISCNUM ((uint32_t)0x0000E000) /*!<DISCNUM[2:0] bits (Discontinuous mode channel count) */
  1319. #define ADC_CR1_DISCNUM_0 ((uint32_t)0x00002000) /*!<Bit 0 */
  1320. #define ADC_CR1_DISCNUM_1 ((uint32_t)0x00004000) /*!<Bit 1 */
  1321. #define ADC_CR1_DISCNUM_2 ((uint32_t)0x00008000) /*!<Bit 2 */
  1322. #define ADC_CR1_JAWDEN ((uint32_t)0x00400000) /*!<Analog watchdog enable on injected channels */
  1323. #define ADC_CR1_AWDEN ((uint32_t)0x00800000) /*!<Analog watchdog enable on regular channels */
  1324. #define ADC_CR1_RES ((uint32_t)0x03000000) /*!<RES[2:0] bits (Resolution) */
  1325. #define ADC_CR1_RES_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  1326. #define ADC_CR1_RES_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  1327. #define ADC_CR1_OVRIE ((uint32_t)0x04000000) /*!<overrun interrupt enable */
  1328. /******************* Bit definition for ADC_CR2 register ********************/
  1329. #define ADC_CR2_ADON ((uint32_t)0x00000001) /*!<A/D Converter ON / OFF */
  1330. #define ADC_CR2_CONT ((uint32_t)0x00000002) /*!<Continuous Conversion */
  1331. #define ADC_CR2_DMA ((uint32_t)0x00000100) /*!<Direct Memory access mode */
  1332. #define ADC_CR2_DDS ((uint32_t)0x00000200) /*!<DMA disable selection (Single ADC) */
  1333. #define ADC_CR2_EOCS ((uint32_t)0x00000400) /*!<End of conversion selection */
  1334. #define ADC_CR2_ALIGN ((uint32_t)0x00000800) /*!<Data Alignment */
  1335. #define ADC_CR2_JEXTSEL ((uint32_t)0x000F0000) /*!<JEXTSEL[3:0] bits (External event select for injected group) */
  1336. #define ADC_CR2_JEXTSEL_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  1337. #define ADC_CR2_JEXTSEL_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  1338. #define ADC_CR2_JEXTSEL_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  1339. #define ADC_CR2_JEXTSEL_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  1340. #define ADC_CR2_JEXTEN ((uint32_t)0x00300000) /*!<JEXTEN[1:0] bits (External Trigger Conversion mode for injected channelsp) */
  1341. #define ADC_CR2_JEXTEN_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  1342. #define ADC_CR2_JEXTEN_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  1343. #define ADC_CR2_JSWSTART ((uint32_t)0x00400000) /*!<Start Conversion of injected channels */
  1344. #define ADC_CR2_EXTSEL ((uint32_t)0x0F000000) /*!<EXTSEL[3:0] bits (External Event Select for regular group) */
  1345. #define ADC_CR2_EXTSEL_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  1346. #define ADC_CR2_EXTSEL_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  1347. #define ADC_CR2_EXTSEL_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  1348. #define ADC_CR2_EXTSEL_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  1349. #define ADC_CR2_EXTEN ((uint32_t)0x30000000) /*!<EXTEN[1:0] bits (External Trigger Conversion mode for regular channelsp) */
  1350. #define ADC_CR2_EXTEN_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  1351. #define ADC_CR2_EXTEN_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  1352. #define ADC_CR2_SWSTART ((uint32_t)0x40000000) /*!<Start Conversion of regular channels */
  1353. /****************** Bit definition for ADC_SMPR1 register *******************/
  1354. #define ADC_SMPR1_SMP10 ((uint32_t)0x00000007) /*!<SMP10[2:0] bits (Channel 10 Sample time selection) */
  1355. #define ADC_SMPR1_SMP10_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1356. #define ADC_SMPR1_SMP10_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1357. #define ADC_SMPR1_SMP10_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1358. #define ADC_SMPR1_SMP11 ((uint32_t)0x00000038) /*!<SMP11[2:0] bits (Channel 11 Sample time selection) */
  1359. #define ADC_SMPR1_SMP11_0 ((uint32_t)0x00000008) /*!<Bit 0 */
  1360. #define ADC_SMPR1_SMP11_1 ((uint32_t)0x00000010) /*!<Bit 1 */
  1361. #define ADC_SMPR1_SMP11_2 ((uint32_t)0x00000020) /*!<Bit 2 */
  1362. #define ADC_SMPR1_SMP12 ((uint32_t)0x000001C0) /*!<SMP12[2:0] bits (Channel 12 Sample time selection) */
  1363. #define ADC_SMPR1_SMP12_0 ((uint32_t)0x00000040) /*!<Bit 0 */
  1364. #define ADC_SMPR1_SMP12_1 ((uint32_t)0x00000080) /*!<Bit 1 */
  1365. #define ADC_SMPR1_SMP12_2 ((uint32_t)0x00000100) /*!<Bit 2 */
  1366. #define ADC_SMPR1_SMP13 ((uint32_t)0x00000E00) /*!<SMP13[2:0] bits (Channel 13 Sample time selection) */
  1367. #define ADC_SMPR1_SMP13_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  1368. #define ADC_SMPR1_SMP13_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  1369. #define ADC_SMPR1_SMP13_2 ((uint32_t)0x00000800) /*!<Bit 2 */
  1370. #define ADC_SMPR1_SMP14 ((uint32_t)0x00007000) /*!<SMP14[2:0] bits (Channel 14 Sample time selection) */
  1371. #define ADC_SMPR1_SMP14_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  1372. #define ADC_SMPR1_SMP14_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  1373. #define ADC_SMPR1_SMP14_2 ((uint32_t)0x00004000) /*!<Bit 2 */
  1374. #define ADC_SMPR1_SMP15 ((uint32_t)0x00038000) /*!<SMP15[2:0] bits (Channel 15 Sample time selection) */
  1375. #define ADC_SMPR1_SMP15_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  1376. #define ADC_SMPR1_SMP15_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  1377. #define ADC_SMPR1_SMP15_2 ((uint32_t)0x00020000) /*!<Bit 2 */
  1378. #define ADC_SMPR1_SMP16 ((uint32_t)0x001C0000) /*!<SMP16[2:0] bits (Channel 16 Sample time selection) */
  1379. #define ADC_SMPR1_SMP16_0 ((uint32_t)0x00040000) /*!<Bit 0 */
  1380. #define ADC_SMPR1_SMP16_1 ((uint32_t)0x00080000) /*!<Bit 1 */
  1381. #define ADC_SMPR1_SMP16_2 ((uint32_t)0x00100000) /*!<Bit 2 */
  1382. #define ADC_SMPR1_SMP17 ((uint32_t)0x00E00000) /*!<SMP17[2:0] bits (Channel 17 Sample time selection) */
  1383. #define ADC_SMPR1_SMP17_0 ((uint32_t)0x00200000) /*!<Bit 0 */
  1384. #define ADC_SMPR1_SMP17_1 ((uint32_t)0x00400000) /*!<Bit 1 */
  1385. #define ADC_SMPR1_SMP17_2 ((uint32_t)0x00800000) /*!<Bit 2 */
  1386. #define ADC_SMPR1_SMP18 ((uint32_t)0x07000000) /*!<SMP18[2:0] bits (Channel 18 Sample time selection) */
  1387. #define ADC_SMPR1_SMP18_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  1388. #define ADC_SMPR1_SMP18_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  1389. #define ADC_SMPR1_SMP18_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  1390. /****************** Bit definition for ADC_SMPR2 register *******************/
  1391. #define ADC_SMPR2_SMP0 ((uint32_t)0x00000007) /*!<SMP0[2:0] bits (Channel 0 Sample time selection) */
  1392. #define ADC_SMPR2_SMP0_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1393. #define ADC_SMPR2_SMP0_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1394. #define ADC_SMPR2_SMP0_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1395. #define ADC_SMPR2_SMP1 ((uint32_t)0x00000038) /*!<SMP1[2:0] bits (Channel 1 Sample time selection) */
  1396. #define ADC_SMPR2_SMP1_0 ((uint32_t)0x00000008) /*!<Bit 0 */
  1397. #define ADC_SMPR2_SMP1_1 ((uint32_t)0x00000010) /*!<Bit 1 */
  1398. #define ADC_SMPR2_SMP1_2 ((uint32_t)0x00000020) /*!<Bit 2 */
  1399. #define ADC_SMPR2_SMP2 ((uint32_t)0x000001C0) /*!<SMP2[2:0] bits (Channel 2 Sample time selection) */
  1400. #define ADC_SMPR2_SMP2_0 ((uint32_t)0x00000040) /*!<Bit 0 */
  1401. #define ADC_SMPR2_SMP2_1 ((uint32_t)0x00000080) /*!<Bit 1 */
  1402. #define ADC_SMPR2_SMP2_2 ((uint32_t)0x00000100) /*!<Bit 2 */
  1403. #define ADC_SMPR2_SMP3 ((uint32_t)0x00000E00) /*!<SMP3[2:0] bits (Channel 3 Sample time selection) */
  1404. #define ADC_SMPR2_SMP3_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  1405. #define ADC_SMPR2_SMP3_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  1406. #define ADC_SMPR2_SMP3_2 ((uint32_t)0x00000800) /*!<Bit 2 */
  1407. #define ADC_SMPR2_SMP4 ((uint32_t)0x00007000) /*!<SMP4[2:0] bits (Channel 4 Sample time selection) */
  1408. #define ADC_SMPR2_SMP4_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  1409. #define ADC_SMPR2_SMP4_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  1410. #define ADC_SMPR2_SMP4_2 ((uint32_t)0x00004000) /*!<Bit 2 */
  1411. #define ADC_SMPR2_SMP5 ((uint32_t)0x00038000) /*!<SMP5[2:0] bits (Channel 5 Sample time selection) */
  1412. #define ADC_SMPR2_SMP5_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  1413. #define ADC_SMPR2_SMP5_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  1414. #define ADC_SMPR2_SMP5_2 ((uint32_t)0x00020000) /*!<Bit 2 */
  1415. #define ADC_SMPR2_SMP6 ((uint32_t)0x001C0000) /*!<SMP6[2:0] bits (Channel 6 Sample time selection) */
  1416. #define ADC_SMPR2_SMP6_0 ((uint32_t)0x00040000) /*!<Bit 0 */
  1417. #define ADC_SMPR2_SMP6_1 ((uint32_t)0x00080000) /*!<Bit 1 */
  1418. #define ADC_SMPR2_SMP6_2 ((uint32_t)0x00100000) /*!<Bit 2 */
  1419. #define ADC_SMPR2_SMP7 ((uint32_t)0x00E00000) /*!<SMP7[2:0] bits (Channel 7 Sample time selection) */
  1420. #define ADC_SMPR2_SMP7_0 ((uint32_t)0x00200000) /*!<Bit 0 */
  1421. #define ADC_SMPR2_SMP7_1 ((uint32_t)0x00400000) /*!<Bit 1 */
  1422. #define ADC_SMPR2_SMP7_2 ((uint32_t)0x00800000) /*!<Bit 2 */
  1423. #define ADC_SMPR2_SMP8 ((uint32_t)0x07000000) /*!<SMP8[2:0] bits (Channel 8 Sample time selection) */
  1424. #define ADC_SMPR2_SMP8_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  1425. #define ADC_SMPR2_SMP8_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  1426. #define ADC_SMPR2_SMP8_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  1427. #define ADC_SMPR2_SMP9 ((uint32_t)0x38000000) /*!<SMP9[2:0] bits (Channel 9 Sample time selection) */
  1428. #define ADC_SMPR2_SMP9_0 ((uint32_t)0x08000000) /*!<Bit 0 */
  1429. #define ADC_SMPR2_SMP9_1 ((uint32_t)0x10000000) /*!<Bit 1 */
  1430. #define ADC_SMPR2_SMP9_2 ((uint32_t)0x20000000) /*!<Bit 2 */
  1431. /****************** Bit definition for ADC_JOFR1 register *******************/
  1432. #define ADC_JOFR1_JOFFSET1 ((uint32_t)0x0FFF) /*!<Data offset for injected channel 1 */
  1433. /****************** Bit definition for ADC_JOFR2 register *******************/
  1434. #define ADC_JOFR2_JOFFSET2 ((uint32_t)0x0FFF) /*!<Data offset for injected channel 2 */
  1435. /****************** Bit definition for ADC_JOFR3 register *******************/
  1436. #define ADC_JOFR3_JOFFSET3 ((uint32_t)0x0FFF) /*!<Data offset for injected channel 3 */
  1437. /****************** Bit definition for ADC_JOFR4 register *******************/
  1438. #define ADC_JOFR4_JOFFSET4 ((uint32_t)0x0FFF) /*!<Data offset for injected channel 4 */
  1439. /******************* Bit definition for ADC_HTR register ********************/
  1440. #define ADC_HTR_HT ((uint32_t)0x0FFF) /*!<Analog watchdog high threshold */
  1441. /******************* Bit definition for ADC_LTR register ********************/
  1442. #define ADC_LTR_LT ((uint32_t)0x0FFF) /*!<Analog watchdog low threshold */
  1443. /******************* Bit definition for ADC_SQR1 register *******************/
  1444. #define ADC_SQR1_SQ13 ((uint32_t)0x0000001F) /*!<SQ13[4:0] bits (13th conversion in regular sequence) */
  1445. #define ADC_SQR1_SQ13_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1446. #define ADC_SQR1_SQ13_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1447. #define ADC_SQR1_SQ13_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1448. #define ADC_SQR1_SQ13_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  1449. #define ADC_SQR1_SQ13_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  1450. #define ADC_SQR1_SQ14 ((uint32_t)0x000003E0) /*!<SQ14[4:0] bits (14th conversion in regular sequence) */
  1451. #define ADC_SQR1_SQ14_0 ((uint32_t)0x00000020) /*!<Bit 0 */
  1452. #define ADC_SQR1_SQ14_1 ((uint32_t)0x00000040) /*!<Bit 1 */
  1453. #define ADC_SQR1_SQ14_2 ((uint32_t)0x00000080) /*!<Bit 2 */
  1454. #define ADC_SQR1_SQ14_3 ((uint32_t)0x00000100) /*!<Bit 3 */
  1455. #define ADC_SQR1_SQ14_4 ((uint32_t)0x00000200) /*!<Bit 4 */
  1456. #define ADC_SQR1_SQ15 ((uint32_t)0x00007C00) /*!<SQ15[4:0] bits (15th conversion in regular sequence) */
  1457. #define ADC_SQR1_SQ15_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  1458. #define ADC_SQR1_SQ15_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  1459. #define ADC_SQR1_SQ15_2 ((uint32_t)0x00001000) /*!<Bit 2 */
  1460. #define ADC_SQR1_SQ15_3 ((uint32_t)0x00002000) /*!<Bit 3 */
  1461. #define ADC_SQR1_SQ15_4 ((uint32_t)0x00004000) /*!<Bit 4 */
  1462. #define ADC_SQR1_SQ16 ((uint32_t)0x000F8000) /*!<SQ16[4:0] bits (16th conversion in regular sequence) */
  1463. #define ADC_SQR1_SQ16_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  1464. #define ADC_SQR1_SQ16_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  1465. #define ADC_SQR1_SQ16_2 ((uint32_t)0x00020000) /*!<Bit 2 */
  1466. #define ADC_SQR1_SQ16_3 ((uint32_t)0x00040000) /*!<Bit 3 */
  1467. #define ADC_SQR1_SQ16_4 ((uint32_t)0x00080000) /*!<Bit 4 */
  1468. #define ADC_SQR1_L ((uint32_t)0x00F00000) /*!<L[3:0] bits (Regular channel sequence length) */
  1469. #define ADC_SQR1_L_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  1470. #define ADC_SQR1_L_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  1471. #define ADC_SQR1_L_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  1472. #define ADC_SQR1_L_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  1473. /******************* Bit definition for ADC_SQR2 register *******************/
  1474. #define ADC_SQR2_SQ7 ((uint32_t)0x0000001F) /*!<SQ7[4:0] bits (7th conversion in regular sequence) */
  1475. #define ADC_SQR2_SQ7_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1476. #define ADC_SQR2_SQ7_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1477. #define ADC_SQR2_SQ7_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1478. #define ADC_SQR2_SQ7_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  1479. #define ADC_SQR2_SQ7_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  1480. #define ADC_SQR2_SQ8 ((uint32_t)0x000003E0) /*!<SQ8[4:0] bits (8th conversion in regular sequence) */
  1481. #define ADC_SQR2_SQ8_0 ((uint32_t)0x00000020) /*!<Bit 0 */
  1482. #define ADC_SQR2_SQ8_1 ((uint32_t)0x00000040) /*!<Bit 1 */
  1483. #define ADC_SQR2_SQ8_2 ((uint32_t)0x00000080) /*!<Bit 2 */
  1484. #define ADC_SQR2_SQ8_3 ((uint32_t)0x00000100) /*!<Bit 3 */
  1485. #define ADC_SQR2_SQ8_4 ((uint32_t)0x00000200) /*!<Bit 4 */
  1486. #define ADC_SQR2_SQ9 ((uint32_t)0x00007C00) /*!<SQ9[4:0] bits (9th conversion in regular sequence) */
  1487. #define ADC_SQR2_SQ9_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  1488. #define ADC_SQR2_SQ9_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  1489. #define ADC_SQR2_SQ9_2 ((uint32_t)0x00001000) /*!<Bit 2 */
  1490. #define ADC_SQR2_SQ9_3 ((uint32_t)0x00002000) /*!<Bit 3 */
  1491. #define ADC_SQR2_SQ9_4 ((uint32_t)0x00004000) /*!<Bit 4 */
  1492. #define ADC_SQR2_SQ10 ((uint32_t)0x000F8000) /*!<SQ10[4:0] bits (10th conversion in regular sequence) */
  1493. #define ADC_SQR2_SQ10_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  1494. #define ADC_SQR2_SQ10_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  1495. #define ADC_SQR2_SQ10_2 ((uint32_t)0x00020000) /*!<Bit 2 */
  1496. #define ADC_SQR2_SQ10_3 ((uint32_t)0x00040000) /*!<Bit 3 */
  1497. #define ADC_SQR2_SQ10_4 ((uint32_t)0x00080000) /*!<Bit 4 */
  1498. #define ADC_SQR2_SQ11 ((uint32_t)0x01F00000) /*!<SQ11[4:0] bits (11th conversion in regular sequence) */
  1499. #define ADC_SQR2_SQ11_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  1500. #define ADC_SQR2_SQ11_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  1501. #define ADC_SQR2_SQ11_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  1502. #define ADC_SQR2_SQ11_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  1503. #define ADC_SQR2_SQ11_4 ((uint32_t)0x01000000) /*!<Bit 4 */
  1504. #define ADC_SQR2_SQ12 ((uint32_t)0x3E000000) /*!<SQ12[4:0] bits (12th conversion in regular sequence) */
  1505. #define ADC_SQR2_SQ12_0 ((uint32_t)0x02000000) /*!<Bit 0 */
  1506. #define ADC_SQR2_SQ12_1 ((uint32_t)0x04000000) /*!<Bit 1 */
  1507. #define ADC_SQR2_SQ12_2 ((uint32_t)0x08000000) /*!<Bit 2 */
  1508. #define ADC_SQR2_SQ12_3 ((uint32_t)0x10000000) /*!<Bit 3 */
  1509. #define ADC_SQR2_SQ12_4 ((uint32_t)0x20000000) /*!<Bit 4 */
  1510. /******************* Bit definition for ADC_SQR3 register *******************/
  1511. #define ADC_SQR3_SQ1 ((uint32_t)0x0000001F) /*!<SQ1[4:0] bits (1st conversion in regular sequence) */
  1512. #define ADC_SQR3_SQ1_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1513. #define ADC_SQR3_SQ1_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1514. #define ADC_SQR3_SQ1_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1515. #define ADC_SQR3_SQ1_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  1516. #define ADC_SQR3_SQ1_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  1517. #define ADC_SQR3_SQ2 ((uint32_t)0x000003E0) /*!<SQ2[4:0] bits (2nd conversion in regular sequence) */
  1518. #define ADC_SQR3_SQ2_0 ((uint32_t)0x00000020) /*!<Bit 0 */
  1519. #define ADC_SQR3_SQ2_1 ((uint32_t)0x00000040) /*!<Bit 1 */
  1520. #define ADC_SQR3_SQ2_2 ((uint32_t)0x00000080) /*!<Bit 2 */
  1521. #define ADC_SQR3_SQ2_3 ((uint32_t)0x00000100) /*!<Bit 3 */
  1522. #define ADC_SQR3_SQ2_4 ((uint32_t)0x00000200) /*!<Bit 4 */
  1523. #define ADC_SQR3_SQ3 ((uint32_t)0x00007C00) /*!<SQ3[4:0] bits (3rd conversion in regular sequence) */
  1524. #define ADC_SQR3_SQ3_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  1525. #define ADC_SQR3_SQ3_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  1526. #define ADC_SQR3_SQ3_2 ((uint32_t)0x00001000) /*!<Bit 2 */
  1527. #define ADC_SQR3_SQ3_3 ((uint32_t)0x00002000) /*!<Bit 3 */
  1528. #define ADC_SQR3_SQ3_4 ((uint32_t)0x00004000) /*!<Bit 4 */
  1529. #define ADC_SQR3_SQ4 ((uint32_t)0x000F8000) /*!<SQ4[4:0] bits (4th conversion in regular sequence) */
  1530. #define ADC_SQR3_SQ4_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  1531. #define ADC_SQR3_SQ4_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  1532. #define ADC_SQR3_SQ4_2 ((uint32_t)0x00020000) /*!<Bit 2 */
  1533. #define ADC_SQR3_SQ4_3 ((uint32_t)0x00040000) /*!<Bit 3 */
  1534. #define ADC_SQR3_SQ4_4 ((uint32_t)0x00080000) /*!<Bit 4 */
  1535. #define ADC_SQR3_SQ5 ((uint32_t)0x01F00000) /*!<SQ5[4:0] bits (5th conversion in regular sequence) */
  1536. #define ADC_SQR3_SQ5_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  1537. #define ADC_SQR3_SQ5_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  1538. #define ADC_SQR3_SQ5_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  1539. #define ADC_SQR3_SQ5_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  1540. #define ADC_SQR3_SQ5_4 ((uint32_t)0x01000000) /*!<Bit 4 */
  1541. #define ADC_SQR3_SQ6 ((uint32_t)0x3E000000) /*!<SQ6[4:0] bits (6th conversion in regular sequence) */
  1542. #define ADC_SQR3_SQ6_0 ((uint32_t)0x02000000) /*!<Bit 0 */
  1543. #define ADC_SQR3_SQ6_1 ((uint32_t)0x04000000) /*!<Bit 1 */
  1544. #define ADC_SQR3_SQ6_2 ((uint32_t)0x08000000) /*!<Bit 2 */
  1545. #define ADC_SQR3_SQ6_3 ((uint32_t)0x10000000) /*!<Bit 3 */
  1546. #define ADC_SQR3_SQ6_4 ((uint32_t)0x20000000) /*!<Bit 4 */
  1547. /******************* Bit definition for ADC_JSQR register *******************/
  1548. #define ADC_JSQR_JSQ1 ((uint32_t)0x0000001F) /*!<JSQ1[4:0] bits (1st conversion in injected sequence) */
  1549. #define ADC_JSQR_JSQ1_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1550. #define ADC_JSQR_JSQ1_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1551. #define ADC_JSQR_JSQ1_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1552. #define ADC_JSQR_JSQ1_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  1553. #define ADC_JSQR_JSQ1_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  1554. #define ADC_JSQR_JSQ2 ((uint32_t)0x000003E0) /*!<JSQ2[4:0] bits (2nd conversion in injected sequence) */
  1555. #define ADC_JSQR_JSQ2_0 ((uint32_t)0x00000020) /*!<Bit 0 */
  1556. #define ADC_JSQR_JSQ2_1 ((uint32_t)0x00000040) /*!<Bit 1 */
  1557. #define ADC_JSQR_JSQ2_2 ((uint32_t)0x00000080) /*!<Bit 2 */
  1558. #define ADC_JSQR_JSQ2_3 ((uint32_t)0x00000100) /*!<Bit 3 */
  1559. #define ADC_JSQR_JSQ2_4 ((uint32_t)0x00000200) /*!<Bit 4 */
  1560. #define ADC_JSQR_JSQ3 ((uint32_t)0x00007C00) /*!<JSQ3[4:0] bits (3rd conversion in injected sequence) */
  1561. #define ADC_JSQR_JSQ3_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  1562. #define ADC_JSQR_JSQ3_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  1563. #define ADC_JSQR_JSQ3_2 ((uint32_t)0x00001000) /*!<Bit 2 */
  1564. #define ADC_JSQR_JSQ3_3 ((uint32_t)0x00002000) /*!<Bit 3 */
  1565. #define ADC_JSQR_JSQ3_4 ((uint32_t)0x00004000) /*!<Bit 4 */
  1566. #define ADC_JSQR_JSQ4 ((uint32_t)0x000F8000) /*!<JSQ4[4:0] bits (4th conversion in injected sequence) */
  1567. #define ADC_JSQR_JSQ4_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  1568. #define ADC_JSQR_JSQ4_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  1569. #define ADC_JSQR_JSQ4_2 ((uint32_t)0x00020000) /*!<Bit 2 */
  1570. #define ADC_JSQR_JSQ4_3 ((uint32_t)0x00040000) /*!<Bit 3 */
  1571. #define ADC_JSQR_JSQ4_4 ((uint32_t)0x00080000) /*!<Bit 4 */
  1572. #define ADC_JSQR_JL ((uint32_t)0x00300000) /*!<JL[1:0] bits (Injected Sequence length) */
  1573. #define ADC_JSQR_JL_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  1574. #define ADC_JSQR_JL_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  1575. /******************* Bit definition for ADC_JDR1 register *******************/
  1576. #define ADC_JDR1_JDATA ((uint16_t)0xFFFF) /*!<Injected data */
  1577. /******************* Bit definition for ADC_JDR2 register *******************/
  1578. #define ADC_JDR2_JDATA ((uint16_t)0xFFFF) /*!<Injected data */
  1579. /******************* Bit definition for ADC_JDR3 register *******************/
  1580. #define ADC_JDR3_JDATA ((uint16_t)0xFFFF) /*!<Injected data */
  1581. /******************* Bit definition for ADC_JDR4 register *******************/
  1582. #define ADC_JDR4_JDATA ((uint16_t)0xFFFF) /*!<Injected data */
  1583. /******************** Bit definition for ADC_DR register ********************/
  1584. #define ADC_DR_DATA ((uint32_t)0x0000FFFF) /*!<Regular data */
  1585. #define ADC_DR_ADC2DATA ((uint32_t)0xFFFF0000) /*!<ADC2 data */
  1586. /******************* Bit definition for ADC_CSR register ********************/
  1587. #define ADC_CSR_AWD1 ((uint32_t)0x00000001) /*!<ADC1 Analog watchdog flag */
  1588. #define ADC_CSR_EOC1 ((uint32_t)0x00000002) /*!<ADC1 End of conversion */
  1589. #define ADC_CSR_JEOC1 ((uint32_t)0x00000004) /*!<ADC1 Injected channel end of conversion */
  1590. #define ADC_CSR_JSTRT1 ((uint32_t)0x00000008) /*!<ADC1 Injected channel Start flag */
  1591. #define ADC_CSR_STRT1 ((uint32_t)0x00000010) /*!<ADC1 Regular channel Start flag */
  1592. #define ADC_CSR_DOVR1 ((uint32_t)0x00000020) /*!<ADC1 DMA overrun flag */
  1593. #define ADC_CSR_AWD2 ((uint32_t)0x00000100) /*!<ADC2 Analog watchdog flag */
  1594. #define ADC_CSR_EOC2 ((uint32_t)0x00000200) /*!<ADC2 End of conversion */
  1595. #define ADC_CSR_JEOC2 ((uint32_t)0x00000400) /*!<ADC2 Injected channel end of conversion */
  1596. #define ADC_CSR_JSTRT2 ((uint32_t)0x00000800) /*!<ADC2 Injected channel Start flag */
  1597. #define ADC_CSR_STRT2 ((uint32_t)0x00001000) /*!<ADC2 Regular channel Start flag */
  1598. #define ADC_CSR_DOVR2 ((uint32_t)0x00002000) /*!<ADC2 DMA overrun flag */
  1599. #define ADC_CSR_AWD3 ((uint32_t)0x00010000) /*!<ADC3 Analog watchdog flag */
  1600. #define ADC_CSR_EOC3 ((uint32_t)0x00020000) /*!<ADC3 End of conversion */
  1601. #define ADC_CSR_JEOC3 ((uint32_t)0x00040000) /*!<ADC3 Injected channel end of conversion */
  1602. #define ADC_CSR_JSTRT3 ((uint32_t)0x00080000) /*!<ADC3 Injected channel Start flag */
  1603. #define ADC_CSR_STRT3 ((uint32_t)0x00100000) /*!<ADC3 Regular channel Start flag */
  1604. #define ADC_CSR_DOVR3 ((uint32_t)0x00200000) /*!<ADC3 DMA overrun flag */
  1605. /******************* Bit definition for ADC_CCR register ********************/
  1606. #define ADC_CCR_MULTI ((uint32_t)0x0000001F) /*!<MULTI[4:0] bits (Multi-ADC mode selection) */
  1607. #define ADC_CCR_MULTI_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1608. #define ADC_CCR_MULTI_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1609. #define ADC_CCR_MULTI_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1610. #define ADC_CCR_MULTI_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  1611. #define ADC_CCR_MULTI_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  1612. #define ADC_CCR_DELAY ((uint32_t)0x00000F00) /*!<DELAY[3:0] bits (Delay between 2 sampling phases) */
  1613. #define ADC_CCR_DELAY_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  1614. #define ADC_CCR_DELAY_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  1615. #define ADC_CCR_DELAY_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  1616. #define ADC_CCR_DELAY_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  1617. #define ADC_CCR_DDS ((uint32_t)0x00002000) /*!<DMA disable selection (Multi-ADC mode) */
  1618. #define ADC_CCR_DMA ((uint32_t)0x0000C000) /*!<DMA[1:0] bits (Direct Memory Access mode for multimode) */
  1619. #define ADC_CCR_DMA_0 ((uint32_t)0x00004000) /*!<Bit 0 */
  1620. #define ADC_CCR_DMA_1 ((uint32_t)0x00008000) /*!<Bit 1 */
  1621. #define ADC_CCR_ADCPRE ((uint32_t)0x00030000) /*!<ADCPRE[1:0] bits (ADC prescaler) */
  1622. #define ADC_CCR_ADCPRE_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  1623. #define ADC_CCR_ADCPRE_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  1624. #define ADC_CCR_VBATE ((uint32_t)0x00400000) /*!<VBAT Enable */
  1625. #define ADC_CCR_TSVREFE ((uint32_t)0x00800000) /*!<Temperature Sensor and VREFINT Enable */
  1626. /******************* Bit definition for ADC_CDR register ********************/
  1627. #define ADC_CDR_DATA1 ((uint32_t)0x0000FFFF) /*!<1st data of a pair of regular conversions */
  1628. #define ADC_CDR_DATA2 ((uint32_t)0xFFFF0000) /*!<2nd data of a pair of regular conversions */
  1629. /******************************************************************************/
  1630. /* */
  1631. /* Controller Area Network */
  1632. /* */
  1633. /******************************************************************************/
  1634. /*!<CAN control and status registers */
  1635. /******************* Bit definition for CAN_MCR register ********************/
  1636. #define CAN_MCR_INRQ ((uint32_t)0x00000001) /*!<Initialization Request */
  1637. #define CAN_MCR_SLEEP ((uint32_t)0x00000002) /*!<Sleep Mode Request */
  1638. #define CAN_MCR_TXFP ((uint32_t)0x00000004) /*!<Transmit FIFO Priority */
  1639. #define CAN_MCR_RFLM ((uint32_t)0x00000008) /*!<Receive FIFO Locked Mode */
  1640. #define CAN_MCR_NART ((uint32_t)0x00000010) /*!<No Automatic Retransmission */
  1641. #define CAN_MCR_AWUM ((uint32_t)0x00000020) /*!<Automatic Wakeup Mode */
  1642. #define CAN_MCR_ABOM ((uint32_t)0x00000040) /*!<Automatic Bus-Off Management */
  1643. #define CAN_MCR_TTCM ((uint32_t)0x00000080) /*!<Time Triggered Communication Mode */
  1644. #define CAN_MCR_RESET ((uint32_t)0x00008000) /*!<bxCAN software master reset */
  1645. /******************* Bit definition for CAN_MSR register ********************/
  1646. #define CAN_MSR_INAK ((uint32_t)0x00000001) /*!<Initialization Acknowledge */
  1647. #define CAN_MSR_SLAK ((uint32_t)0x00000002) /*!<Sleep Acknowledge */
  1648. #define CAN_MSR_ERRI ((uint32_t)0x00000004) /*!<Error Interrupt */
  1649. #define CAN_MSR_WKUI ((uint32_t)0x00000008) /*!<Wakeup Interrupt */
  1650. #define CAN_MSR_SLAKI ((uint32_t)0x00000010) /*!<Sleep Acknowledge Interrupt */
  1651. #define CAN_MSR_TXM ((uint32_t)0x00000100) /*!<Transmit Mode */
  1652. #define CAN_MSR_RXM ((uint32_t)0x00000200) /*!<Receive Mode */
  1653. #define CAN_MSR_SAMP ((uint32_t)0x00000400) /*!<Last Sample Point */
  1654. #define CAN_MSR_RX ((uint32_t)0x00000800) /*!<CAN Rx Signal */
  1655. /******************* Bit definition for CAN_TSR register ********************/
  1656. #define CAN_TSR_RQCP0 ((uint32_t)0x00000001) /*!<Request Completed Mailbox0 */
  1657. #define CAN_TSR_TXOK0 ((uint32_t)0x00000002) /*!<Transmission OK of Mailbox0 */
  1658. #define CAN_TSR_ALST0 ((uint32_t)0x00000004) /*!<Arbitration Lost for Mailbox0 */
  1659. #define CAN_TSR_TERR0 ((uint32_t)0x00000008) /*!<Transmission Error of Mailbox0 */
  1660. #define CAN_TSR_ABRQ0 ((uint32_t)0x00000080) /*!<Abort Request for Mailbox0 */
  1661. #define CAN_TSR_RQCP1 ((uint32_t)0x00000100) /*!<Request Completed Mailbox1 */
  1662. #define CAN_TSR_TXOK1 ((uint32_t)0x00000200) /*!<Transmission OK of Mailbox1 */
  1663. #define CAN_TSR_ALST1 ((uint32_t)0x00000400) /*!<Arbitration Lost for Mailbox1 */
  1664. #define CAN_TSR_TERR1 ((uint32_t)0x00000800) /*!<Transmission Error of Mailbox1 */
  1665. #define CAN_TSR_ABRQ1 ((uint32_t)0x00008000) /*!<Abort Request for Mailbox 1 */
  1666. #define CAN_TSR_RQCP2 ((uint32_t)0x00010000) /*!<Request Completed Mailbox2 */
  1667. #define CAN_TSR_TXOK2 ((uint32_t)0x00020000) /*!<Transmission OK of Mailbox 2 */
  1668. #define CAN_TSR_ALST2 ((uint32_t)0x00040000) /*!<Arbitration Lost for mailbox 2 */
  1669. #define CAN_TSR_TERR2 ((uint32_t)0x00080000) /*!<Transmission Error of Mailbox 2 */
  1670. #define CAN_TSR_ABRQ2 ((uint32_t)0x00800000) /*!<Abort Request for Mailbox 2 */
  1671. #define CAN_TSR_CODE ((uint32_t)0x03000000) /*!<Mailbox Code */
  1672. #define CAN_TSR_TME ((uint32_t)0x1C000000) /*!<TME[2:0] bits */
  1673. #define CAN_TSR_TME0 ((uint32_t)0x04000000) /*!<Transmit Mailbox 0 Empty */
  1674. #define CAN_TSR_TME1 ((uint32_t)0x08000000) /*!<Transmit Mailbox 1 Empty */
  1675. #define CAN_TSR_TME2 ((uint32_t)0x10000000) /*!<Transmit Mailbox 2 Empty */
  1676. #define CAN_TSR_LOW ((uint32_t)0xE0000000) /*!<LOW[2:0] bits */
  1677. #define CAN_TSR_LOW0 ((uint32_t)0x20000000) /*!<Lowest Priority Flag for Mailbox 0 */
  1678. #define CAN_TSR_LOW1 ((uint32_t)0x40000000) /*!<Lowest Priority Flag for Mailbox 1 */
  1679. #define CAN_TSR_LOW2 ((uint32_t)0x80000000) /*!<Lowest Priority Flag for Mailbox 2 */
  1680. /******************* Bit definition for CAN_RF0R register *******************/
  1681. #define CAN_RF0R_FMP0 ((uint32_t)0x00000003) /*!<FIFO 0 Message Pending */
  1682. #define CAN_RF0R_FULL0 ((uint32_t)0x00000008) /*!<FIFO 0 Full */
  1683. #define CAN_RF0R_FOVR0 ((uint32_t)0x00000010) /*!<FIFO 0 Overrun */
  1684. #define CAN_RF0R_RFOM0 ((uint32_t)0x00000020) /*!<Release FIFO 0 Output Mailbox */
  1685. /******************* Bit definition for CAN_RF1R register *******************/
  1686. #define CAN_RF1R_FMP1 ((uint32_t)0x00000003) /*!<FIFO 1 Message Pending */
  1687. #define CAN_RF1R_FULL1 ((uint32_t)0x00000008) /*!<FIFO 1 Full */
  1688. #define CAN_RF1R_FOVR1 ((uint32_t)0x00000010) /*!<FIFO 1 Overrun */
  1689. #define CAN_RF1R_RFOM1 ((uint32_t)0x00000020) /*!<Release FIFO 1 Output Mailbox */
  1690. /******************** Bit definition for CAN_IER register *******************/
  1691. #define CAN_IER_TMEIE ((uint32_t)0x00000001) /*!<Transmit Mailbox Empty Interrupt Enable */
  1692. #define CAN_IER_FMPIE0 ((uint32_t)0x00000002) /*!<FIFO Message Pending Interrupt Enable */
  1693. #define CAN_IER_FFIE0 ((uint32_t)0x00000004) /*!<FIFO Full Interrupt Enable */
  1694. #define CAN_IER_FOVIE0 ((uint32_t)0x00000008) /*!<FIFO Overrun Interrupt Enable */
  1695. #define CAN_IER_FMPIE1 ((uint32_t)0x00000010) /*!<FIFO Message Pending Interrupt Enable */
  1696. #define CAN_IER_FFIE1 ((uint32_t)0x00000020) /*!<FIFO Full Interrupt Enable */
  1697. #define CAN_IER_FOVIE1 ((uint32_t)0x00000040) /*!<FIFO Overrun Interrupt Enable */
  1698. #define CAN_IER_EWGIE ((uint32_t)0x00000100) /*!<Error Warning Interrupt Enable */
  1699. #define CAN_IER_EPVIE ((uint32_t)0x00000200) /*!<Error Passive Interrupt Enable */
  1700. #define CAN_IER_BOFIE ((uint32_t)0x00000400) /*!<Bus-Off Interrupt Enable */
  1701. #define CAN_IER_LECIE ((uint32_t)0x00000800) /*!<Last Error Code Interrupt Enable */
  1702. #define CAN_IER_ERRIE ((uint32_t)0x00008000) /*!<Error Interrupt Enable */
  1703. #define CAN_IER_WKUIE ((uint32_t)0x00010000) /*!<Wakeup Interrupt Enable */
  1704. #define CAN_IER_SLKIE ((uint32_t)0x00020000) /*!<Sleep Interrupt Enable */
  1705. /******************** Bit definition for CAN_ESR register *******************/
  1706. #define CAN_ESR_EWGF ((uint32_t)0x00000001) /*!<Error Warning Flag */
  1707. #define CAN_ESR_EPVF ((uint32_t)0x00000002) /*!<Error Passive Flag */
  1708. #define CAN_ESR_BOFF ((uint32_t)0x00000004) /*!<Bus-Off Flag */
  1709. #define CAN_ESR_LEC ((uint32_t)0x00000070) /*!<LEC[2:0] bits (Last Error Code) */
  1710. #define CAN_ESR_LEC_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  1711. #define CAN_ESR_LEC_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  1712. #define CAN_ESR_LEC_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  1713. #define CAN_ESR_TEC ((uint32_t)0x00FF0000) /*!<Least significant byte of the 9-bit Transmit Error Counter */
  1714. #define CAN_ESR_REC ((uint32_t)0xFF000000) /*!<Receive Error Counter */
  1715. /******************* Bit definition for CAN_BTR register ********************/
  1716. #define CAN_BTR_BRP ((uint32_t)0x000003FF) /*!<Baud Rate Prescaler */
  1717. #define CAN_BTR_TS1 ((uint32_t)0x000F0000) /*!<Time Segment 1 */
  1718. #define CAN_BTR_TS1_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  1719. #define CAN_BTR_TS1_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  1720. #define CAN_BTR_TS1_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  1721. #define CAN_BTR_TS1_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  1722. #define CAN_BTR_TS2 ((uint32_t)0x00700000) /*!<Time Segment 2 */
  1723. #define CAN_BTR_TS2_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  1724. #define CAN_BTR_TS2_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  1725. #define CAN_BTR_TS2_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  1726. #define CAN_BTR_SJW ((uint32_t)0x03000000) /*!<Resynchronization Jump Width */
  1727. #define CAN_BTR_SJW_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  1728. #define CAN_BTR_SJW_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  1729. #define CAN_BTR_LBKM ((uint32_t)0x40000000) /*!<Loop Back Mode (Debug) */
  1730. #define CAN_BTR_SILM ((uint32_t)0x80000000) /*!<Silent Mode */
  1731. /*!<Mailbox registers */
  1732. /****************** Bit definition for CAN_TI0R register ********************/
  1733. #define CAN_TI0R_TXRQ ((uint32_t)0x00000001) /*!<Transmit Mailbox Request */
  1734. #define CAN_TI0R_RTR ((uint32_t)0x00000002) /*!<Remote Transmission Request */
  1735. #define CAN_TI0R_IDE ((uint32_t)0x00000004) /*!<Identifier Extension */
  1736. #define CAN_TI0R_EXID ((uint32_t)0x001FFFF8) /*!<Extended Identifier */
  1737. #define CAN_TI0R_STID ((uint32_t)0xFFE00000) /*!<Standard Identifier or Extended Identifier */
  1738. /****************** Bit definition for CAN_TDT0R register *******************/
  1739. #define CAN_TDT0R_DLC ((uint32_t)0x0000000F) /*!<Data Length Code */
  1740. #define CAN_TDT0R_TGT ((uint32_t)0x00000100) /*!<Transmit Global Time */
  1741. #define CAN_TDT0R_TIME ((uint32_t)0xFFFF0000) /*!<Message Time Stamp */
  1742. /****************** Bit definition for CAN_TDL0R register *******************/
  1743. #define CAN_TDL0R_DATA0 ((uint32_t)0x000000FF) /*!<Data byte 0 */
  1744. #define CAN_TDL0R_DATA1 ((uint32_t)0x0000FF00) /*!<Data byte 1 */
  1745. #define CAN_TDL0R_DATA2 ((uint32_t)0x00FF0000) /*!<Data byte 2 */
  1746. #define CAN_TDL0R_DATA3 ((uint32_t)0xFF000000) /*!<Data byte 3 */
  1747. /****************** Bit definition for CAN_TDH0R register *******************/
  1748. #define CAN_TDH0R_DATA4 ((uint32_t)0x000000FF) /*!<Data byte 4 */
  1749. #define CAN_TDH0R_DATA5 ((uint32_t)0x0000FF00) /*!<Data byte 5 */
  1750. #define CAN_TDH0R_DATA6 ((uint32_t)0x00FF0000) /*!<Data byte 6 */
  1751. #define CAN_TDH0R_DATA7 ((uint32_t)0xFF000000) /*!<Data byte 7 */
  1752. /******************* Bit definition for CAN_TI1R register *******************/
  1753. #define CAN_TI1R_TXRQ ((uint32_t)0x00000001) /*!<Transmit Mailbox Request */
  1754. #define CAN_TI1R_RTR ((uint32_t)0x00000002) /*!<Remote Transmission Request */
  1755. #define CAN_TI1R_IDE ((uint32_t)0x00000004) /*!<Identifier Extension */
  1756. #define CAN_TI1R_EXID ((uint32_t)0x001FFFF8) /*!<Extended Identifier */
  1757. #define CAN_TI1R_STID ((uint32_t)0xFFE00000) /*!<Standard Identifier or Extended Identifier */
  1758. /******************* Bit definition for CAN_TDT1R register ******************/
  1759. #define CAN_TDT1R_DLC ((uint32_t)0x0000000F) /*!<Data Length Code */
  1760. #define CAN_TDT1R_TGT ((uint32_t)0x00000100) /*!<Transmit Global Time */
  1761. #define CAN_TDT1R_TIME ((uint32_t)0xFFFF0000) /*!<Message Time Stamp */
  1762. /******************* Bit definition for CAN_TDL1R register ******************/
  1763. #define CAN_TDL1R_DATA0 ((uint32_t)0x000000FF) /*!<Data byte 0 */
  1764. #define CAN_TDL1R_DATA1 ((uint32_t)0x0000FF00) /*!<Data byte 1 */
  1765. #define CAN_TDL1R_DATA2 ((uint32_t)0x00FF0000) /*!<Data byte 2 */
  1766. #define CAN_TDL1R_DATA3 ((uint32_t)0xFF000000) /*!<Data byte 3 */
  1767. /******************* Bit definition for CAN_TDH1R register ******************/
  1768. #define CAN_TDH1R_DATA4 ((uint32_t)0x000000FF) /*!<Data byte 4 */
  1769. #define CAN_TDH1R_DATA5 ((uint32_t)0x0000FF00) /*!<Data byte 5 */
  1770. #define CAN_TDH1R_DATA6 ((uint32_t)0x00FF0000) /*!<Data byte 6 */
  1771. #define CAN_TDH1R_DATA7 ((uint32_t)0xFF000000) /*!<Data byte 7 */
  1772. /******************* Bit definition for CAN_TI2R register *******************/
  1773. #define CAN_TI2R_TXRQ ((uint32_t)0x00000001) /*!<Transmit Mailbox Request */
  1774. #define CAN_TI2R_RTR ((uint32_t)0x00000002) /*!<Remote Transmission Request */
  1775. #define CAN_TI2R_IDE ((uint32_t)0x00000004) /*!<Identifier Extension */
  1776. #define CAN_TI2R_EXID ((uint32_t)0x001FFFF8) /*!<Extended identifier */
  1777. #define CAN_TI2R_STID ((uint32_t)0xFFE00000) /*!<Standard Identifier or Extended Identifier */
  1778. /******************* Bit definition for CAN_TDT2R register ******************/
  1779. #define CAN_TDT2R_DLC ((uint32_t)0x0000000F) /*!<Data Length Code */
  1780. #define CAN_TDT2R_TGT ((uint32_t)0x00000100) /*!<Transmit Global Time */
  1781. #define CAN_TDT2R_TIME ((uint32_t)0xFFFF0000) /*!<Message Time Stamp */
  1782. /******************* Bit definition for CAN_TDL2R register ******************/
  1783. #define CAN_TDL2R_DATA0 ((uint32_t)0x000000FF) /*!<Data byte 0 */
  1784. #define CAN_TDL2R_DATA1 ((uint32_t)0x0000FF00) /*!<Data byte 1 */
  1785. #define CAN_TDL2R_DATA2 ((uint32_t)0x00FF0000) /*!<Data byte 2 */
  1786. #define CAN_TDL2R_DATA3 ((uint32_t)0xFF000000) /*!<Data byte 3 */
  1787. /******************* Bit definition for CAN_TDH2R register ******************/
  1788. #define CAN_TDH2R_DATA4 ((uint32_t)0x000000FF) /*!<Data byte 4 */
  1789. #define CAN_TDH2R_DATA5 ((uint32_t)0x0000FF00) /*!<Data byte 5 */
  1790. #define CAN_TDH2R_DATA6 ((uint32_t)0x00FF0000) /*!<Data byte 6 */
  1791. #define CAN_TDH2R_DATA7 ((uint32_t)0xFF000000) /*!<Data byte 7 */
  1792. /******************* Bit definition for CAN_RI0R register *******************/
  1793. #define CAN_RI0R_RTR ((uint32_t)0x00000002) /*!<Remote Transmission Request */
  1794. #define CAN_RI0R_IDE ((uint32_t)0x00000004) /*!<Identifier Extension */
  1795. #define CAN_RI0R_EXID ((uint32_t)0x001FFFF8) /*!<Extended Identifier */
  1796. #define CAN_RI0R_STID ((uint32_t)0xFFE00000) /*!<Standard Identifier or Extended Identifier */
  1797. /******************* Bit definition for CAN_RDT0R register ******************/
  1798. #define CAN_RDT0R_DLC ((uint32_t)0x0000000F) /*!<Data Length Code */
  1799. #define CAN_RDT0R_FMI ((uint32_t)0x0000FF00) /*!<Filter Match Index */
  1800. #define CAN_RDT0R_TIME ((uint32_t)0xFFFF0000) /*!<Message Time Stamp */
  1801. /******************* Bit definition for CAN_RDL0R register ******************/
  1802. #define CAN_RDL0R_DATA0 ((uint32_t)0x000000FF) /*!<Data byte 0 */
  1803. #define CAN_RDL0R_DATA1 ((uint32_t)0x0000FF00) /*!<Data byte 1 */
  1804. #define CAN_RDL0R_DATA2 ((uint32_t)0x00FF0000) /*!<Data byte 2 */
  1805. #define CAN_RDL0R_DATA3 ((uint32_t)0xFF000000) /*!<Data byte 3 */
  1806. /******************* Bit definition for CAN_RDH0R register ******************/
  1807. #define CAN_RDH0R_DATA4 ((uint32_t)0x000000FF) /*!<Data byte 4 */
  1808. #define CAN_RDH0R_DATA5 ((uint32_t)0x0000FF00) /*!<Data byte 5 */
  1809. #define CAN_RDH0R_DATA6 ((uint32_t)0x00FF0000) /*!<Data byte 6 */
  1810. #define CAN_RDH0R_DATA7 ((uint32_t)0xFF000000) /*!<Data byte 7 */
  1811. /******************* Bit definition for CAN_RI1R register *******************/
  1812. #define CAN_RI1R_RTR ((uint32_t)0x00000002) /*!<Remote Transmission Request */
  1813. #define CAN_RI1R_IDE ((uint32_t)0x00000004) /*!<Identifier Extension */
  1814. #define CAN_RI1R_EXID ((uint32_t)0x001FFFF8) /*!<Extended identifier */
  1815. #define CAN_RI1R_STID ((uint32_t)0xFFE00000) /*!<Standard Identifier or Extended Identifier */
  1816. /******************* Bit definition for CAN_RDT1R register ******************/
  1817. #define CAN_RDT1R_DLC ((uint32_t)0x0000000F) /*!<Data Length Code */
  1818. #define CAN_RDT1R_FMI ((uint32_t)0x0000FF00) /*!<Filter Match Index */
  1819. #define CAN_RDT1R_TIME ((uint32_t)0xFFFF0000) /*!<Message Time Stamp */
  1820. /******************* Bit definition for CAN_RDL1R register ******************/
  1821. #define CAN_RDL1R_DATA0 ((uint32_t)0x000000FF) /*!<Data byte 0 */
  1822. #define CAN_RDL1R_DATA1 ((uint32_t)0x0000FF00) /*!<Data byte 1 */
  1823. #define CAN_RDL1R_DATA2 ((uint32_t)0x00FF0000) /*!<Data byte 2 */
  1824. #define CAN_RDL1R_DATA3 ((uint32_t)0xFF000000) /*!<Data byte 3 */
  1825. /******************* Bit definition for CAN_RDH1R register ******************/
  1826. #define CAN_RDH1R_DATA4 ((uint32_t)0x000000FF) /*!<Data byte 4 */
  1827. #define CAN_RDH1R_DATA5 ((uint32_t)0x0000FF00) /*!<Data byte 5 */
  1828. #define CAN_RDH1R_DATA6 ((uint32_t)0x00FF0000) /*!<Data byte 6 */
  1829. #define CAN_RDH1R_DATA7 ((uint32_t)0xFF000000) /*!<Data byte 7 */
  1830. /*!<CAN filter registers */
  1831. /******************* Bit definition for CAN_FMR register ********************/
  1832. #define CAN_FMR_FINIT ((uint8_t)0x01) /*!<Filter Init Mode */
  1833. #define CAN_FMR_CAN2SB ((uint32_t)0x00003F00) /*!<CAN2 start bank */
  1834. /******************* Bit definition for CAN_FM1R register *******************/
  1835. #define CAN_FM1R_FBM ((uint32_t)0x3FFF) /*!<Filter Mode */
  1836. #define CAN_FM1R_FBM0 ((uint32_t)0x0001) /*!<Filter Init Mode bit 0 */
  1837. #define CAN_FM1R_FBM1 ((uint32_t)0x0002) /*!<Filter Init Mode bit 1 */
  1838. #define CAN_FM1R_FBM2 ((uint32_t)0x0004) /*!<Filter Init Mode bit 2 */
  1839. #define CAN_FM1R_FBM3 ((uint32_t)0x0008) /*!<Filter Init Mode bit 3 */
  1840. #define CAN_FM1R_FBM4 ((uint32_t)0x0010) /*!<Filter Init Mode bit 4 */
  1841. #define CAN_FM1R_FBM5 ((uint32_t)0x0020) /*!<Filter Init Mode bit 5 */
  1842. #define CAN_FM1R_FBM6 ((uint32_t)0x0040) /*!<Filter Init Mode bit 6 */
  1843. #define CAN_FM1R_FBM7 ((uint32_t)0x0080) /*!<Filter Init Mode bit 7 */
  1844. #define CAN_FM1R_FBM8 ((uint32_t)0x0100) /*!<Filter Init Mode bit 8 */
  1845. #define CAN_FM1R_FBM9 ((uint32_t)0x0200) /*!<Filter Init Mode bit 9 */
  1846. #define CAN_FM1R_FBM10 ((uint32_t)0x0400) /*!<Filter Init Mode bit 10 */
  1847. #define CAN_FM1R_FBM11 ((uint32_t)0x0800) /*!<Filter Init Mode bit 11 */
  1848. #define CAN_FM1R_FBM12 ((uint32_t)0x1000) /*!<Filter Init Mode bit 12 */
  1849. #define CAN_FM1R_FBM13 ((uint32_t)0x2000) /*!<Filter Init Mode bit 13 */
  1850. /******************* Bit definition for CAN_FS1R register *******************/
  1851. #define CAN_FS1R_FSC ((uint32_t)0x00003FFF) /*!<Filter Scale Configuration */
  1852. #define CAN_FS1R_FSC0 ((uint32_t)0x00000001) /*!<Filter Scale Configuration bit 0 */
  1853. #define CAN_FS1R_FSC1 ((uint32_t)0x00000002) /*!<Filter Scale Configuration bit 1 */
  1854. #define CAN_FS1R_FSC2 ((uint32_t)0x00000004) /*!<Filter Scale Configuration bit 2 */
  1855. #define CAN_FS1R_FSC3 ((uint32_t)0x00000008) /*!<Filter Scale Configuration bit 3 */
  1856. #define CAN_FS1R_FSC4 ((uint32_t)0x00000010) /*!<Filter Scale Configuration bit 4 */
  1857. #define CAN_FS1R_FSC5 ((uint32_t)0x00000020) /*!<Filter Scale Configuration bit 5 */
  1858. #define CAN_FS1R_FSC6 ((uint32_t)0x00000040) /*!<Filter Scale Configuration bit 6 */
  1859. #define CAN_FS1R_FSC7 ((uint32_t)0x00000080) /*!<Filter Scale Configuration bit 7 */
  1860. #define CAN_FS1R_FSC8 ((uint32_t)0x00000100) /*!<Filter Scale Configuration bit 8 */
  1861. #define CAN_FS1R_FSC9 ((uint32_t)0x00000200) /*!<Filter Scale Configuration bit 9 */
  1862. #define CAN_FS1R_FSC10 ((uint32_t)0x00000400) /*!<Filter Scale Configuration bit 10 */
  1863. #define CAN_FS1R_FSC11 ((uint32_t)0x00000800) /*!<Filter Scale Configuration bit 11 */
  1864. #define CAN_FS1R_FSC12 ((uint32_t)0x00001000) /*!<Filter Scale Configuration bit 12 */
  1865. #define CAN_FS1R_FSC13 ((uint32_t)0x00002000) /*!<Filter Scale Configuration bit 13 */
  1866. /****************** Bit definition for CAN_FFA1R register *******************/
  1867. #define CAN_FFA1R_FFA ((uint32_t)0x00003FFF) /*!<Filter FIFO Assignment */
  1868. #define CAN_FFA1R_FFA0 ((uint32_t)0x00000001) /*!<Filter FIFO Assignment for Filter 0 */
  1869. #define CAN_FFA1R_FFA1 ((uint32_t)0x00000002) /*!<Filter FIFO Assignment for Filter 1 */
  1870. #define CAN_FFA1R_FFA2 ((uint32_t)0x00000004) /*!<Filter FIFO Assignment for Filter 2 */
  1871. #define CAN_FFA1R_FFA3 ((uint32_t)0x00000008) /*!<Filter FIFO Assignment for Filter 3 */
  1872. #define CAN_FFA1R_FFA4 ((uint32_t)0x00000010) /*!<Filter FIFO Assignment for Filter 4 */
  1873. #define CAN_FFA1R_FFA5 ((uint32_t)0x00000020) /*!<Filter FIFO Assignment for Filter 5 */
  1874. #define CAN_FFA1R_FFA6 ((uint32_t)0x00000040) /*!<Filter FIFO Assignment for Filter 6 */
  1875. #define CAN_FFA1R_FFA7 ((uint32_t)0x00000080) /*!<Filter FIFO Assignment for Filter 7 */
  1876. #define CAN_FFA1R_FFA8 ((uint32_t)0x00000100) /*!<Filter FIFO Assignment for Filter 8 */
  1877. #define CAN_FFA1R_FFA9 ((uint32_t)0x00000200) /*!<Filter FIFO Assignment for Filter 9 */
  1878. #define CAN_FFA1R_FFA10 ((uint32_t)0x00000400) /*!<Filter FIFO Assignment for Filter 10 */
  1879. #define CAN_FFA1R_FFA11 ((uint32_t)0x00000800) /*!<Filter FIFO Assignment for Filter 11 */
  1880. #define CAN_FFA1R_FFA12 ((uint32_t)0x00001000) /*!<Filter FIFO Assignment for Filter 12 */
  1881. #define CAN_FFA1R_FFA13 ((uint32_t)0x00002000) /*!<Filter FIFO Assignment for Filter 13 */
  1882. /******************* Bit definition for CAN_FA1R register *******************/
  1883. #define CAN_FA1R_FACT ((uint32_t)0x00003FFF) /*!<Filter Active */
  1884. #define CAN_FA1R_FACT0 ((uint32_t)0x00000001) /*!<Filter 0 Active */
  1885. #define CAN_FA1R_FACT1 ((uint32_t)0x00000002) /*!<Filter 1 Active */
  1886. #define CAN_FA1R_FACT2 ((uint32_t)0x00000004) /*!<Filter 2 Active */
  1887. #define CAN_FA1R_FACT3 ((uint32_t)0x00000008) /*!<Filter 3 Active */
  1888. #define CAN_FA1R_FACT4 ((uint32_t)0x00000010) /*!<Filter 4 Active */
  1889. #define CAN_FA1R_FACT5 ((uint32_t)0x00000020) /*!<Filter 5 Active */
  1890. #define CAN_FA1R_FACT6 ((uint32_t)0x00000040) /*!<Filter 6 Active */
  1891. #define CAN_FA1R_FACT7 ((uint32_t)0x00000080) /*!<Filter 7 Active */
  1892. #define CAN_FA1R_FACT8 ((uint32_t)0x00000100) /*!<Filter 8 Active */
  1893. #define CAN_FA1R_FACT9 ((uint32_t)0x00000200) /*!<Filter 9 Active */
  1894. #define CAN_FA1R_FACT10 ((uint32_t)0x00000400) /*!<Filter 10 Active */
  1895. #define CAN_FA1R_FACT11 ((uint32_t)0x00000800) /*!<Filter 11 Active */
  1896. #define CAN_FA1R_FACT12 ((uint32_t)0x00001000) /*!<Filter 12 Active */
  1897. #define CAN_FA1R_FACT13 ((uint32_t)0x00002000) /*!<Filter 13 Active */
  1898. /******************* Bit definition for CAN_F0R1 register *******************/
  1899. #define CAN_F0R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  1900. #define CAN_F0R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  1901. #define CAN_F0R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  1902. #define CAN_F0R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  1903. #define CAN_F0R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  1904. #define CAN_F0R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  1905. #define CAN_F0R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  1906. #define CAN_F0R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  1907. #define CAN_F0R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  1908. #define CAN_F0R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  1909. #define CAN_F0R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  1910. #define CAN_F0R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  1911. #define CAN_F0R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  1912. #define CAN_F0R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  1913. #define CAN_F0R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  1914. #define CAN_F0R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  1915. #define CAN_F0R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  1916. #define CAN_F0R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  1917. #define CAN_F0R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  1918. #define CAN_F0R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  1919. #define CAN_F0R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  1920. #define CAN_F0R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  1921. #define CAN_F0R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  1922. #define CAN_F0R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  1923. #define CAN_F0R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  1924. #define CAN_F0R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  1925. #define CAN_F0R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  1926. #define CAN_F0R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  1927. #define CAN_F0R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  1928. #define CAN_F0R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  1929. #define CAN_F0R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  1930. #define CAN_F0R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  1931. /******************* Bit definition for CAN_F1R1 register *******************/
  1932. #define CAN_F1R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  1933. #define CAN_F1R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  1934. #define CAN_F1R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  1935. #define CAN_F1R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  1936. #define CAN_F1R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  1937. #define CAN_F1R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  1938. #define CAN_F1R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  1939. #define CAN_F1R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  1940. #define CAN_F1R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  1941. #define CAN_F1R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  1942. #define CAN_F1R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  1943. #define CAN_F1R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  1944. #define CAN_F1R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  1945. #define CAN_F1R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  1946. #define CAN_F1R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  1947. #define CAN_F1R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  1948. #define CAN_F1R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  1949. #define CAN_F1R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  1950. #define CAN_F1R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  1951. #define CAN_F1R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  1952. #define CAN_F1R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  1953. #define CAN_F1R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  1954. #define CAN_F1R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  1955. #define CAN_F1R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  1956. #define CAN_F1R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  1957. #define CAN_F1R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  1958. #define CAN_F1R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  1959. #define CAN_F1R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  1960. #define CAN_F1R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  1961. #define CAN_F1R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  1962. #define CAN_F1R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  1963. #define CAN_F1R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  1964. /******************* Bit definition for CAN_F2R1 register *******************/
  1965. #define CAN_F2R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  1966. #define CAN_F2R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  1967. #define CAN_F2R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  1968. #define CAN_F2R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  1969. #define CAN_F2R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  1970. #define CAN_F2R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  1971. #define CAN_F2R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  1972. #define CAN_F2R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  1973. #define CAN_F2R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  1974. #define CAN_F2R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  1975. #define CAN_F2R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  1976. #define CAN_F2R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  1977. #define CAN_F2R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  1978. #define CAN_F2R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  1979. #define CAN_F2R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  1980. #define CAN_F2R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  1981. #define CAN_F2R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  1982. #define CAN_F2R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  1983. #define CAN_F2R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  1984. #define CAN_F2R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  1985. #define CAN_F2R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  1986. #define CAN_F2R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  1987. #define CAN_F2R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  1988. #define CAN_F2R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  1989. #define CAN_F2R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  1990. #define CAN_F2R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  1991. #define CAN_F2R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  1992. #define CAN_F2R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  1993. #define CAN_F2R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  1994. #define CAN_F2R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  1995. #define CAN_F2R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  1996. #define CAN_F2R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  1997. /******************* Bit definition for CAN_F3R1 register *******************/
  1998. #define CAN_F3R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  1999. #define CAN_F3R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2000. #define CAN_F3R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2001. #define CAN_F3R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2002. #define CAN_F3R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2003. #define CAN_F3R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2004. #define CAN_F3R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2005. #define CAN_F3R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2006. #define CAN_F3R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2007. #define CAN_F3R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2008. #define CAN_F3R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2009. #define CAN_F3R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2010. #define CAN_F3R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2011. #define CAN_F3R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2012. #define CAN_F3R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2013. #define CAN_F3R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2014. #define CAN_F3R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2015. #define CAN_F3R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2016. #define CAN_F3R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2017. #define CAN_F3R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2018. #define CAN_F3R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2019. #define CAN_F3R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2020. #define CAN_F3R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2021. #define CAN_F3R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2022. #define CAN_F3R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2023. #define CAN_F3R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2024. #define CAN_F3R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2025. #define CAN_F3R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2026. #define CAN_F3R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2027. #define CAN_F3R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2028. #define CAN_F3R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2029. #define CAN_F3R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2030. /******************* Bit definition for CAN_F4R1 register *******************/
  2031. #define CAN_F4R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2032. #define CAN_F4R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2033. #define CAN_F4R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2034. #define CAN_F4R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2035. #define CAN_F4R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2036. #define CAN_F4R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2037. #define CAN_F4R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2038. #define CAN_F4R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2039. #define CAN_F4R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2040. #define CAN_F4R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2041. #define CAN_F4R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2042. #define CAN_F4R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2043. #define CAN_F4R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2044. #define CAN_F4R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2045. #define CAN_F4R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2046. #define CAN_F4R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2047. #define CAN_F4R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2048. #define CAN_F4R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2049. #define CAN_F4R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2050. #define CAN_F4R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2051. #define CAN_F4R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2052. #define CAN_F4R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2053. #define CAN_F4R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2054. #define CAN_F4R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2055. #define CAN_F4R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2056. #define CAN_F4R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2057. #define CAN_F4R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2058. #define CAN_F4R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2059. #define CAN_F4R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2060. #define CAN_F4R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2061. #define CAN_F4R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2062. #define CAN_F4R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2063. /******************* Bit definition for CAN_F5R1 register *******************/
  2064. #define CAN_F5R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2065. #define CAN_F5R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2066. #define CAN_F5R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2067. #define CAN_F5R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2068. #define CAN_F5R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2069. #define CAN_F5R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2070. #define CAN_F5R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2071. #define CAN_F5R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2072. #define CAN_F5R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2073. #define CAN_F5R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2074. #define CAN_F5R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2075. #define CAN_F5R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2076. #define CAN_F5R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2077. #define CAN_F5R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2078. #define CAN_F5R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2079. #define CAN_F5R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2080. #define CAN_F5R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2081. #define CAN_F5R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2082. #define CAN_F5R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2083. #define CAN_F5R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2084. #define CAN_F5R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2085. #define CAN_F5R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2086. #define CAN_F5R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2087. #define CAN_F5R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2088. #define CAN_F5R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2089. #define CAN_F5R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2090. #define CAN_F5R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2091. #define CAN_F5R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2092. #define CAN_F5R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2093. #define CAN_F5R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2094. #define CAN_F5R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2095. #define CAN_F5R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2096. /******************* Bit definition for CAN_F6R1 register *******************/
  2097. #define CAN_F6R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2098. #define CAN_F6R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2099. #define CAN_F6R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2100. #define CAN_F6R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2101. #define CAN_F6R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2102. #define CAN_F6R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2103. #define CAN_F6R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2104. #define CAN_F6R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2105. #define CAN_F6R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2106. #define CAN_F6R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2107. #define CAN_F6R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2108. #define CAN_F6R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2109. #define CAN_F6R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2110. #define CAN_F6R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2111. #define CAN_F6R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2112. #define CAN_F6R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2113. #define CAN_F6R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2114. #define CAN_F6R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2115. #define CAN_F6R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2116. #define CAN_F6R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2117. #define CAN_F6R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2118. #define CAN_F6R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2119. #define CAN_F6R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2120. #define CAN_F6R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2121. #define CAN_F6R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2122. #define CAN_F6R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2123. #define CAN_F6R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2124. #define CAN_F6R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2125. #define CAN_F6R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2126. #define CAN_F6R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2127. #define CAN_F6R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2128. #define CAN_F6R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2129. /******************* Bit definition for CAN_F7R1 register *******************/
  2130. #define CAN_F7R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2131. #define CAN_F7R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2132. #define CAN_F7R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2133. #define CAN_F7R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2134. #define CAN_F7R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2135. #define CAN_F7R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2136. #define CAN_F7R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2137. #define CAN_F7R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2138. #define CAN_F7R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2139. #define CAN_F7R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2140. #define CAN_F7R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2141. #define CAN_F7R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2142. #define CAN_F7R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2143. #define CAN_F7R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2144. #define CAN_F7R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2145. #define CAN_F7R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2146. #define CAN_F7R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2147. #define CAN_F7R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2148. #define CAN_F7R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2149. #define CAN_F7R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2150. #define CAN_F7R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2151. #define CAN_F7R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2152. #define CAN_F7R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2153. #define CAN_F7R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2154. #define CAN_F7R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2155. #define CAN_F7R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2156. #define CAN_F7R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2157. #define CAN_F7R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2158. #define CAN_F7R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2159. #define CAN_F7R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2160. #define CAN_F7R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2161. #define CAN_F7R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2162. /******************* Bit definition for CAN_F8R1 register *******************/
  2163. #define CAN_F8R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2164. #define CAN_F8R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2165. #define CAN_F8R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2166. #define CAN_F8R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2167. #define CAN_F8R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2168. #define CAN_F8R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2169. #define CAN_F8R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2170. #define CAN_F8R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2171. #define CAN_F8R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2172. #define CAN_F8R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2173. #define CAN_F8R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2174. #define CAN_F8R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2175. #define CAN_F8R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2176. #define CAN_F8R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2177. #define CAN_F8R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2178. #define CAN_F8R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2179. #define CAN_F8R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2180. #define CAN_F8R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2181. #define CAN_F8R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2182. #define CAN_F8R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2183. #define CAN_F8R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2184. #define CAN_F8R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2185. #define CAN_F8R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2186. #define CAN_F8R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2187. #define CAN_F8R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2188. #define CAN_F8R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2189. #define CAN_F8R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2190. #define CAN_F8R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2191. #define CAN_F8R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2192. #define CAN_F8R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2193. #define CAN_F8R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2194. #define CAN_F8R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2195. /******************* Bit definition for CAN_F9R1 register *******************/
  2196. #define CAN_F9R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2197. #define CAN_F9R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2198. #define CAN_F9R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2199. #define CAN_F9R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2200. #define CAN_F9R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2201. #define CAN_F9R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2202. #define CAN_F9R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2203. #define CAN_F9R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2204. #define CAN_F9R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2205. #define CAN_F9R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2206. #define CAN_F9R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2207. #define CAN_F9R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2208. #define CAN_F9R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2209. #define CAN_F9R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2210. #define CAN_F9R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2211. #define CAN_F9R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2212. #define CAN_F9R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2213. #define CAN_F9R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2214. #define CAN_F9R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2215. #define CAN_F9R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2216. #define CAN_F9R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2217. #define CAN_F9R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2218. #define CAN_F9R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2219. #define CAN_F9R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2220. #define CAN_F9R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2221. #define CAN_F9R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2222. #define CAN_F9R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2223. #define CAN_F9R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2224. #define CAN_F9R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2225. #define CAN_F9R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2226. #define CAN_F9R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2227. #define CAN_F9R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2228. /******************* Bit definition for CAN_F10R1 register ******************/
  2229. #define CAN_F10R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2230. #define CAN_F10R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2231. #define CAN_F10R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2232. #define CAN_F10R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2233. #define CAN_F10R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2234. #define CAN_F10R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2235. #define CAN_F10R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2236. #define CAN_F10R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2237. #define CAN_F10R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2238. #define CAN_F10R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2239. #define CAN_F10R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2240. #define CAN_F10R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2241. #define CAN_F10R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2242. #define CAN_F10R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2243. #define CAN_F10R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2244. #define CAN_F10R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2245. #define CAN_F10R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2246. #define CAN_F10R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2247. #define CAN_F10R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2248. #define CAN_F10R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2249. #define CAN_F10R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2250. #define CAN_F10R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2251. #define CAN_F10R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2252. #define CAN_F10R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2253. #define CAN_F10R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2254. #define CAN_F10R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2255. #define CAN_F10R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2256. #define CAN_F10R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2257. #define CAN_F10R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2258. #define CAN_F10R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2259. #define CAN_F10R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2260. #define CAN_F10R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2261. /******************* Bit definition for CAN_F11R1 register ******************/
  2262. #define CAN_F11R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2263. #define CAN_F11R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2264. #define CAN_F11R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2265. #define CAN_F11R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2266. #define CAN_F11R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2267. #define CAN_F11R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2268. #define CAN_F11R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2269. #define CAN_F11R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2270. #define CAN_F11R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2271. #define CAN_F11R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2272. #define CAN_F11R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2273. #define CAN_F11R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2274. #define CAN_F11R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2275. #define CAN_F11R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2276. #define CAN_F11R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2277. #define CAN_F11R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2278. #define CAN_F11R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2279. #define CAN_F11R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2280. #define CAN_F11R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2281. #define CAN_F11R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2282. #define CAN_F11R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2283. #define CAN_F11R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2284. #define CAN_F11R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2285. #define CAN_F11R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2286. #define CAN_F11R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2287. #define CAN_F11R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2288. #define CAN_F11R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2289. #define CAN_F11R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2290. #define CAN_F11R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2291. #define CAN_F11R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2292. #define CAN_F11R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2293. #define CAN_F11R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2294. /******************* Bit definition for CAN_F12R1 register ******************/
  2295. #define CAN_F12R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2296. #define CAN_F12R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2297. #define CAN_F12R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2298. #define CAN_F12R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2299. #define CAN_F12R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2300. #define CAN_F12R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2301. #define CAN_F12R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2302. #define CAN_F12R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2303. #define CAN_F12R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2304. #define CAN_F12R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2305. #define CAN_F12R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2306. #define CAN_F12R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2307. #define CAN_F12R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2308. #define CAN_F12R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2309. #define CAN_F12R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2310. #define CAN_F12R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2311. #define CAN_F12R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2312. #define CAN_F12R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2313. #define CAN_F12R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2314. #define CAN_F12R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2315. #define CAN_F12R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2316. #define CAN_F12R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2317. #define CAN_F12R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2318. #define CAN_F12R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2319. #define CAN_F12R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2320. #define CAN_F12R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2321. #define CAN_F12R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2322. #define CAN_F12R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2323. #define CAN_F12R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2324. #define CAN_F12R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2325. #define CAN_F12R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2326. #define CAN_F12R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2327. /******************* Bit definition for CAN_F13R1 register ******************/
  2328. #define CAN_F13R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2329. #define CAN_F13R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2330. #define CAN_F13R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2331. #define CAN_F13R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2332. #define CAN_F13R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2333. #define CAN_F13R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2334. #define CAN_F13R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2335. #define CAN_F13R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2336. #define CAN_F13R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2337. #define CAN_F13R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2338. #define CAN_F13R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2339. #define CAN_F13R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2340. #define CAN_F13R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2341. #define CAN_F13R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2342. #define CAN_F13R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2343. #define CAN_F13R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2344. #define CAN_F13R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2345. #define CAN_F13R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2346. #define CAN_F13R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2347. #define CAN_F13R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2348. #define CAN_F13R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2349. #define CAN_F13R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2350. #define CAN_F13R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2351. #define CAN_F13R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2352. #define CAN_F13R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2353. #define CAN_F13R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2354. #define CAN_F13R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2355. #define CAN_F13R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2356. #define CAN_F13R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2357. #define CAN_F13R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2358. #define CAN_F13R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2359. #define CAN_F13R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2360. /******************* Bit definition for CAN_F0R2 register *******************/
  2361. #define CAN_F0R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2362. #define CAN_F0R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2363. #define CAN_F0R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2364. #define CAN_F0R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2365. #define CAN_F0R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2366. #define CAN_F0R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2367. #define CAN_F0R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2368. #define CAN_F0R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2369. #define CAN_F0R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2370. #define CAN_F0R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2371. #define CAN_F0R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2372. #define CAN_F0R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2373. #define CAN_F0R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2374. #define CAN_F0R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2375. #define CAN_F0R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2376. #define CAN_F0R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2377. #define CAN_F0R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2378. #define CAN_F0R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2379. #define CAN_F0R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2380. #define CAN_F0R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2381. #define CAN_F0R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2382. #define CAN_F0R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2383. #define CAN_F0R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2384. #define CAN_F0R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2385. #define CAN_F0R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2386. #define CAN_F0R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2387. #define CAN_F0R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2388. #define CAN_F0R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2389. #define CAN_F0R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2390. #define CAN_F0R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2391. #define CAN_F0R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2392. #define CAN_F0R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2393. /******************* Bit definition for CAN_F1R2 register *******************/
  2394. #define CAN_F1R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2395. #define CAN_F1R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2396. #define CAN_F1R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2397. #define CAN_F1R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2398. #define CAN_F1R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2399. #define CAN_F1R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2400. #define CAN_F1R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2401. #define CAN_F1R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2402. #define CAN_F1R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2403. #define CAN_F1R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2404. #define CAN_F1R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2405. #define CAN_F1R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2406. #define CAN_F1R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2407. #define CAN_F1R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2408. #define CAN_F1R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2409. #define CAN_F1R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2410. #define CAN_F1R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2411. #define CAN_F1R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2412. #define CAN_F1R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2413. #define CAN_F1R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2414. #define CAN_F1R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2415. #define CAN_F1R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2416. #define CAN_F1R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2417. #define CAN_F1R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2418. #define CAN_F1R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2419. #define CAN_F1R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2420. #define CAN_F1R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2421. #define CAN_F1R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2422. #define CAN_F1R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2423. #define CAN_F1R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2424. #define CAN_F1R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2425. #define CAN_F1R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2426. /******************* Bit definition for CAN_F2R2 register *******************/
  2427. #define CAN_F2R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2428. #define CAN_F2R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2429. #define CAN_F2R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2430. #define CAN_F2R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2431. #define CAN_F2R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2432. #define CAN_F2R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2433. #define CAN_F2R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2434. #define CAN_F2R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2435. #define CAN_F2R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2436. #define CAN_F2R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2437. #define CAN_F2R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2438. #define CAN_F2R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2439. #define CAN_F2R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2440. #define CAN_F2R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2441. #define CAN_F2R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2442. #define CAN_F2R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2443. #define CAN_F2R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2444. #define CAN_F2R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2445. #define CAN_F2R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2446. #define CAN_F2R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2447. #define CAN_F2R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2448. #define CAN_F2R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2449. #define CAN_F2R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2450. #define CAN_F2R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2451. #define CAN_F2R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2452. #define CAN_F2R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2453. #define CAN_F2R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2454. #define CAN_F2R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2455. #define CAN_F2R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2456. #define CAN_F2R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2457. #define CAN_F2R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2458. #define CAN_F2R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2459. /******************* Bit definition for CAN_F3R2 register *******************/
  2460. #define CAN_F3R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2461. #define CAN_F3R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2462. #define CAN_F3R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2463. #define CAN_F3R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2464. #define CAN_F3R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2465. #define CAN_F3R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2466. #define CAN_F3R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2467. #define CAN_F3R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2468. #define CAN_F3R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2469. #define CAN_F3R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2470. #define CAN_F3R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2471. #define CAN_F3R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2472. #define CAN_F3R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2473. #define CAN_F3R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2474. #define CAN_F3R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2475. #define CAN_F3R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2476. #define CAN_F3R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2477. #define CAN_F3R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2478. #define CAN_F3R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2479. #define CAN_F3R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2480. #define CAN_F3R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2481. #define CAN_F3R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2482. #define CAN_F3R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2483. #define CAN_F3R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2484. #define CAN_F3R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2485. #define CAN_F3R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2486. #define CAN_F3R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2487. #define CAN_F3R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2488. #define CAN_F3R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2489. #define CAN_F3R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2490. #define CAN_F3R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2491. #define CAN_F3R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2492. /******************* Bit definition for CAN_F4R2 register *******************/
  2493. #define CAN_F4R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2494. #define CAN_F4R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2495. #define CAN_F4R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2496. #define CAN_F4R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2497. #define CAN_F4R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2498. #define CAN_F4R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2499. #define CAN_F4R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2500. #define CAN_F4R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2501. #define CAN_F4R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2502. #define CAN_F4R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2503. #define CAN_F4R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2504. #define CAN_F4R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2505. #define CAN_F4R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2506. #define CAN_F4R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2507. #define CAN_F4R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2508. #define CAN_F4R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2509. #define CAN_F4R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2510. #define CAN_F4R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2511. #define CAN_F4R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2512. #define CAN_F4R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2513. #define CAN_F4R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2514. #define CAN_F4R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2515. #define CAN_F4R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2516. #define CAN_F4R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2517. #define CAN_F4R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2518. #define CAN_F4R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2519. #define CAN_F4R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2520. #define CAN_F4R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2521. #define CAN_F4R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2522. #define CAN_F4R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2523. #define CAN_F4R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2524. #define CAN_F4R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2525. /******************* Bit definition for CAN_F5R2 register *******************/
  2526. #define CAN_F5R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2527. #define CAN_F5R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2528. #define CAN_F5R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2529. #define CAN_F5R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2530. #define CAN_F5R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2531. #define CAN_F5R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2532. #define CAN_F5R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2533. #define CAN_F5R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2534. #define CAN_F5R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2535. #define CAN_F5R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2536. #define CAN_F5R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2537. #define CAN_F5R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2538. #define CAN_F5R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2539. #define CAN_F5R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2540. #define CAN_F5R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2541. #define CAN_F5R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2542. #define CAN_F5R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2543. #define CAN_F5R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2544. #define CAN_F5R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2545. #define CAN_F5R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2546. #define CAN_F5R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2547. #define CAN_F5R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2548. #define CAN_F5R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2549. #define CAN_F5R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2550. #define CAN_F5R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2551. #define CAN_F5R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2552. #define CAN_F5R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2553. #define CAN_F5R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2554. #define CAN_F5R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2555. #define CAN_F5R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2556. #define CAN_F5R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2557. #define CAN_F5R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2558. /******************* Bit definition for CAN_F6R2 register *******************/
  2559. #define CAN_F6R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2560. #define CAN_F6R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2561. #define CAN_F6R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2562. #define CAN_F6R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2563. #define CAN_F6R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2564. #define CAN_F6R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2565. #define CAN_F6R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2566. #define CAN_F6R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2567. #define CAN_F6R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2568. #define CAN_F6R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2569. #define CAN_F6R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2570. #define CAN_F6R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2571. #define CAN_F6R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2572. #define CAN_F6R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2573. #define CAN_F6R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2574. #define CAN_F6R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2575. #define CAN_F6R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2576. #define CAN_F6R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2577. #define CAN_F6R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2578. #define CAN_F6R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2579. #define CAN_F6R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2580. #define CAN_F6R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2581. #define CAN_F6R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2582. #define CAN_F6R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2583. #define CAN_F6R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2584. #define CAN_F6R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2585. #define CAN_F6R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2586. #define CAN_F6R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2587. #define CAN_F6R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2588. #define CAN_F6R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2589. #define CAN_F6R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2590. #define CAN_F6R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2591. /******************* Bit definition for CAN_F7R2 register *******************/
  2592. #define CAN_F7R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2593. #define CAN_F7R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2594. #define CAN_F7R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2595. #define CAN_F7R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2596. #define CAN_F7R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2597. #define CAN_F7R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2598. #define CAN_F7R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2599. #define CAN_F7R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2600. #define CAN_F7R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2601. #define CAN_F7R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2602. #define CAN_F7R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2603. #define CAN_F7R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2604. #define CAN_F7R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2605. #define CAN_F7R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2606. #define CAN_F7R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2607. #define CAN_F7R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2608. #define CAN_F7R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2609. #define CAN_F7R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2610. #define CAN_F7R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2611. #define CAN_F7R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2612. #define CAN_F7R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2613. #define CAN_F7R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2614. #define CAN_F7R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2615. #define CAN_F7R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2616. #define CAN_F7R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2617. #define CAN_F7R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2618. #define CAN_F7R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2619. #define CAN_F7R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2620. #define CAN_F7R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2621. #define CAN_F7R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2622. #define CAN_F7R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2623. #define CAN_F7R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2624. /******************* Bit definition for CAN_F8R2 register *******************/
  2625. #define CAN_F8R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2626. #define CAN_F8R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2627. #define CAN_F8R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2628. #define CAN_F8R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2629. #define CAN_F8R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2630. #define CAN_F8R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2631. #define CAN_F8R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2632. #define CAN_F8R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2633. #define CAN_F8R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2634. #define CAN_F8R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2635. #define CAN_F8R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2636. #define CAN_F8R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2637. #define CAN_F8R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2638. #define CAN_F8R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2639. #define CAN_F8R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2640. #define CAN_F8R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2641. #define CAN_F8R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2642. #define CAN_F8R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2643. #define CAN_F8R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2644. #define CAN_F8R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2645. #define CAN_F8R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2646. #define CAN_F8R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2647. #define CAN_F8R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2648. #define CAN_F8R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2649. #define CAN_F8R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2650. #define CAN_F8R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2651. #define CAN_F8R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2652. #define CAN_F8R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2653. #define CAN_F8R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2654. #define CAN_F8R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2655. #define CAN_F8R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2656. #define CAN_F8R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2657. /******************* Bit definition for CAN_F9R2 register *******************/
  2658. #define CAN_F9R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2659. #define CAN_F9R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2660. #define CAN_F9R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2661. #define CAN_F9R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2662. #define CAN_F9R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2663. #define CAN_F9R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2664. #define CAN_F9R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2665. #define CAN_F9R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2666. #define CAN_F9R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2667. #define CAN_F9R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2668. #define CAN_F9R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2669. #define CAN_F9R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2670. #define CAN_F9R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2671. #define CAN_F9R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2672. #define CAN_F9R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2673. #define CAN_F9R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2674. #define CAN_F9R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2675. #define CAN_F9R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2676. #define CAN_F9R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2677. #define CAN_F9R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2678. #define CAN_F9R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2679. #define CAN_F9R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2680. #define CAN_F9R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2681. #define CAN_F9R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2682. #define CAN_F9R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2683. #define CAN_F9R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2684. #define CAN_F9R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2685. #define CAN_F9R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2686. #define CAN_F9R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2687. #define CAN_F9R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2688. #define CAN_F9R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2689. #define CAN_F9R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2690. /******************* Bit definition for CAN_F10R2 register ******************/
  2691. #define CAN_F10R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2692. #define CAN_F10R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2693. #define CAN_F10R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2694. #define CAN_F10R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2695. #define CAN_F10R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2696. #define CAN_F10R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2697. #define CAN_F10R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2698. #define CAN_F10R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2699. #define CAN_F10R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2700. #define CAN_F10R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2701. #define CAN_F10R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2702. #define CAN_F10R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2703. #define CAN_F10R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2704. #define CAN_F10R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2705. #define CAN_F10R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2706. #define CAN_F10R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2707. #define CAN_F10R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2708. #define CAN_F10R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2709. #define CAN_F10R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2710. #define CAN_F10R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2711. #define CAN_F10R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2712. #define CAN_F10R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2713. #define CAN_F10R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2714. #define CAN_F10R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2715. #define CAN_F10R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2716. #define CAN_F10R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2717. #define CAN_F10R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2718. #define CAN_F10R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2719. #define CAN_F10R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2720. #define CAN_F10R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2721. #define CAN_F10R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2722. #define CAN_F10R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2723. /******************* Bit definition for CAN_F11R2 register ******************/
  2724. #define CAN_F11R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2725. #define CAN_F11R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2726. #define CAN_F11R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2727. #define CAN_F11R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2728. #define CAN_F11R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2729. #define CAN_F11R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2730. #define CAN_F11R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2731. #define CAN_F11R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2732. #define CAN_F11R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2733. #define CAN_F11R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2734. #define CAN_F11R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2735. #define CAN_F11R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2736. #define CAN_F11R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2737. #define CAN_F11R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2738. #define CAN_F11R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2739. #define CAN_F11R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2740. #define CAN_F11R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2741. #define CAN_F11R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2742. #define CAN_F11R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2743. #define CAN_F11R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2744. #define CAN_F11R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2745. #define CAN_F11R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2746. #define CAN_F11R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2747. #define CAN_F11R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2748. #define CAN_F11R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2749. #define CAN_F11R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2750. #define CAN_F11R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2751. #define CAN_F11R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2752. #define CAN_F11R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2753. #define CAN_F11R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2754. #define CAN_F11R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2755. #define CAN_F11R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2756. /******************* Bit definition for CAN_F12R2 register ******************/
  2757. #define CAN_F12R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2758. #define CAN_F12R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2759. #define CAN_F12R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2760. #define CAN_F12R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2761. #define CAN_F12R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2762. #define CAN_F12R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2763. #define CAN_F12R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2764. #define CAN_F12R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2765. #define CAN_F12R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2766. #define CAN_F12R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2767. #define CAN_F12R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2768. #define CAN_F12R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2769. #define CAN_F12R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2770. #define CAN_F12R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2771. #define CAN_F12R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2772. #define CAN_F12R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2773. #define CAN_F12R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2774. #define CAN_F12R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2775. #define CAN_F12R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2776. #define CAN_F12R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2777. #define CAN_F12R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2778. #define CAN_F12R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2779. #define CAN_F12R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2780. #define CAN_F12R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2781. #define CAN_F12R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2782. #define CAN_F12R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2783. #define CAN_F12R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2784. #define CAN_F12R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2785. #define CAN_F12R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2786. #define CAN_F12R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2787. #define CAN_F12R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2788. #define CAN_F12R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2789. /******************* Bit definition for CAN_F13R2 register ******************/
  2790. #define CAN_F13R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2791. #define CAN_F13R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2792. #define CAN_F13R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2793. #define CAN_F13R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2794. #define CAN_F13R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2795. #define CAN_F13R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2796. #define CAN_F13R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2797. #define CAN_F13R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2798. #define CAN_F13R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2799. #define CAN_F13R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2800. #define CAN_F13R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2801. #define CAN_F13R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2802. #define CAN_F13R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2803. #define CAN_F13R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2804. #define CAN_F13R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2805. #define CAN_F13R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2806. #define CAN_F13R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2807. #define CAN_F13R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2808. #define CAN_F13R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2809. #define CAN_F13R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2810. #define CAN_F13R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2811. #define CAN_F13R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2812. #define CAN_F13R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2813. #define CAN_F13R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2814. #define CAN_F13R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2815. #define CAN_F13R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2816. #define CAN_F13R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2817. #define CAN_F13R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2818. #define CAN_F13R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2819. #define CAN_F13R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2820. #define CAN_F13R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2821. #define CAN_F13R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2822. /******************************************************************************/
  2823. /* */
  2824. /* HDMI-CEC (CEC) */
  2825. /* */
  2826. /******************************************************************************/
  2827. /******************* Bit definition for CEC_CR register *********************/
  2828. #define CEC_CR_CECEN ((uint32_t)0x00000001) /*!< CEC Enable */
  2829. #define CEC_CR_TXSOM ((uint32_t)0x00000002) /*!< CEC Tx Start Of Message */
  2830. #define CEC_CR_TXEOM ((uint32_t)0x00000004) /*!< CEC Tx End Of Message */
  2831. /******************* Bit definition for CEC_CFGR register *******************/
  2832. #define CEC_CFGR_SFT ((uint32_t)0x00000007) /*!< CEC Signal Free Time */
  2833. #define CEC_CFGR_RXTOL ((uint32_t)0x00000008) /*!< CEC Tolerance */
  2834. #define CEC_CFGR_BRESTP ((uint32_t)0x00000010) /*!< CEC Rx Stop */
  2835. #define CEC_CFGR_BREGEN ((uint32_t)0x00000020) /*!< CEC Bit Rising Error generation */
  2836. #define CEC_CFGR_LBPEGEN ((uint32_t)0x00000040) /*!< CEC Long Period Error generation */
  2837. #define CEC_CFGR_BRDNOGEN ((uint32_t)0x00000080) /*!< CEC Broadcast no Error generation */
  2838. #define CEC_CFGR_SFTOPT ((uint32_t)0x00000100) /*!< CEC Signal Free Time optional */
  2839. #define CEC_CFGR_OAR ((uint32_t)0x7FFF0000) /*!< CEC Own Address */
  2840. #define CEC_CFGR_LSTN ((uint32_t)0x80000000) /*!< CEC Listen mode */
  2841. /******************* Bit definition for CEC_TXDR register *******************/
  2842. #define CEC_TXDR_TXD ((uint32_t)0x000000FF) /*!< CEC Tx Data */
  2843. /******************* Bit definition for CEC_RXDR register *******************/
  2844. #define CEC_TXDR_RXD ((uint32_t)0x000000FF) /*!< CEC Rx Data */
  2845. /******************* Bit definition for CEC_ISR register ********************/
  2846. #define CEC_ISR_RXBR ((uint32_t)0x00000001) /*!< CEC Rx-Byte Received */
  2847. #define CEC_ISR_RXEND ((uint32_t)0x00000002) /*!< CEC End Of Reception */
  2848. #define CEC_ISR_RXOVR ((uint32_t)0x00000004) /*!< CEC Rx-Overrun */
  2849. #define CEC_ISR_BRE ((uint32_t)0x00000008) /*!< CEC Rx Bit Rising Error */
  2850. #define CEC_ISR_SBPE ((uint32_t)0x00000010) /*!< CEC Rx Short Bit period Error */
  2851. #define CEC_ISR_LBPE ((uint32_t)0x00000020) /*!< CEC Rx Long Bit period Error */
  2852. #define CEC_ISR_RXACKE ((uint32_t)0x00000040) /*!< CEC Rx Missing Acknowledge */
  2853. #define CEC_ISR_ARBLST ((uint32_t)0x00000080) /*!< CEC Arbitration Lost */
  2854. #define CEC_ISR_TXBR ((uint32_t)0x00000100) /*!< CEC Tx Byte Request */
  2855. #define CEC_ISR_TXEND ((uint32_t)0x00000200) /*!< CEC End of Transmission */
  2856. #define CEC_ISR_TXUDR ((uint32_t)0x00000400) /*!< CEC Tx-Buffer Underrun */
  2857. #define CEC_ISR_TXERR ((uint32_t)0x00000800) /*!< CEC Tx-Error */
  2858. #define CEC_ISR_TXACKE ((uint32_t)0x00001000) /*!< CEC Tx Missing Acknowledge */
  2859. /******************* Bit definition for CEC_IER register ********************/
  2860. #define CEC_IER_RXBRIE ((uint32_t)0x00000001) /*!< CEC Rx-Byte Received IT Enable */
  2861. #define CEC_IER_RXENDIE ((uint32_t)0x00000002) /*!< CEC End Of Reception IT Enable */
  2862. #define CEC_IER_RXOVRIE ((uint32_t)0x00000004) /*!< CEC Rx-Overrun IT Enable */
  2863. #define CEC_IER_BREIE ((uint32_t)0x00000008) /*!< CEC Rx Bit Rising Error IT Enable */
  2864. #define CEC_IER_SBPEIE ((uint32_t)0x00000010) /*!< CEC Rx Short Bit period Error IT Enable*/
  2865. #define CEC_IER_LBPEIE ((uint32_t)0x00000020) /*!< CEC Rx Long Bit period Error IT Enable */
  2866. #define CEC_IER_RXACKEIE ((uint32_t)0x00000040) /*!< CEC Rx Missing Acknowledge IT Enable */
  2867. #define CEC_IER_ARBLSTIE ((uint32_t)0x00000080) /*!< CEC Arbitration Lost IT Enable */
  2868. #define CEC_IER_TXBRIE ((uint32_t)0x00000100) /*!< CEC Tx Byte Request IT Enable */
  2869. #define CEC_IER_TXENDIE ((uint32_t)0x00000200) /*!< CEC End of Transmission IT Enable */
  2870. #define CEC_IER_TXUDRIE ((uint32_t)0x00000400) /*!< CEC Tx-Buffer Underrun IT Enable */
  2871. #define CEC_IER_TXERRIE ((uint32_t)0x00000800) /*!< CEC Tx-Error IT Enable */
  2872. #define CEC_IER_TXACKEIE ((uint32_t)0x00001000) /*!< CEC Tx Missing Acknowledge IT Enable */
  2873. /******************************************************************************/
  2874. /* */
  2875. /* CRC calculation unit */
  2876. /* */
  2877. /******************************************************************************/
  2878. /******************* Bit definition for CRC_DR register *********************/
  2879. #define CRC_DR_DR ((uint32_t)0xFFFFFFFF) /*!< Data register bits */
  2880. /******************* Bit definition for CRC_IDR register ********************/
  2881. #define CRC_IDR_IDR ((uint32_t)0x000000FF) /*!< General-purpose 8-bit data register bits */
  2882. /******************** Bit definition for CRC_CR register ********************/
  2883. #define CRC_CR_RESET ((uint32_t)0x00000001) /*!< RESET the CRC computation unit bit */
  2884. #define CRC_CR_POLYSIZE ((uint32_t)0x00000018) /*!< Polynomial size bits */
  2885. #define CRC_CR_POLYSIZE_0 ((uint32_t)0x00000008) /*!< Polynomial size bit 0 */
  2886. #define CRC_CR_POLYSIZE_1 ((uint32_t)0x00000010) /*!< Polynomial size bit 1 */
  2887. #define CRC_CR_REV_IN ((uint32_t)0x00000060) /*!< REV_IN Reverse Input Data bits */
  2888. #define CRC_CR_REV_IN_0 ((uint32_t)0x00000020) /*!< Bit 0 */
  2889. #define CRC_CR_REV_IN_1 ((uint32_t)0x00000040) /*!< Bit 1 */
  2890. #define CRC_CR_REV_OUT ((uint32_t)0x00000080) /*!< REV_OUT Reverse Output Data bits */
  2891. /******************* Bit definition for CRC_INIT register *******************/
  2892. #define CRC_INIT_INIT ((uint32_t)0xFFFFFFFF) /*!< Initial CRC value bits */
  2893. /******************* Bit definition for CRC_POL register ********************/
  2894. #define CRC_POL_POL ((uint32_t)0xFFFFFFFF) /*!< Coefficients of the polynomial */
  2895. /******************************************************************************/
  2896. /* */
  2897. /* Digital to Analog Converter */
  2898. /* */
  2899. /******************************************************************************/
  2900. /******************** Bit definition for DAC_CR register ********************/
  2901. #define DAC_CR_EN1 ((uint32_t)0x00000001) /*!<DAC channel1 enable */
  2902. #define DAC_CR_BOFF1 ((uint32_t)0x00000002) /*!<DAC channel1 output buffer disable */
  2903. #define DAC_CR_TEN1 ((uint32_t)0x00000004) /*!<DAC channel1 Trigger enable */
  2904. #define DAC_CR_TSEL1 ((uint32_t)0x00000038) /*!<TSEL1[2:0] (DAC channel1 Trigger selection) */
  2905. #define DAC_CR_TSEL1_0 ((uint32_t)0x00000008) /*!<Bit 0 */
  2906. #define DAC_CR_TSEL1_1 ((uint32_t)0x00000010) /*!<Bit 1 */
  2907. #define DAC_CR_TSEL1_2 ((uint32_t)0x00000020) /*!<Bit 2 */
  2908. #define DAC_CR_WAVE1 ((uint32_t)0x000000C0) /*!<WAVE1[1:0] (DAC channel1 noise/triangle wave generation enable) */
  2909. #define DAC_CR_WAVE1_0 ((uint32_t)0x00000040) /*!<Bit 0 */
  2910. #define DAC_CR_WAVE1_1 ((uint32_t)0x00000080) /*!<Bit 1 */
  2911. #define DAC_CR_MAMP1 ((uint32_t)0x00000F00) /*!<MAMP1[3:0] (DAC channel1 Mask/Amplitude selector) */
  2912. #define DAC_CR_MAMP1_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  2913. #define DAC_CR_MAMP1_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  2914. #define DAC_CR_MAMP1_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  2915. #define DAC_CR_MAMP1_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  2916. #define DAC_CR_DMAEN1 ((uint32_t)0x00001000) /*!<DAC channel1 DMA enable */
  2917. #define DAC_CR_EN2 ((uint32_t)0x00010000) /*!<DAC channel2 enable */
  2918. #define DAC_CR_BOFF2 ((uint32_t)0x00020000) /*!<DAC channel2 output buffer disable */
  2919. #define DAC_CR_TEN2 ((uint32_t)0x00040000) /*!<DAC channel2 Trigger enable */
  2920. #define DAC_CR_TSEL2 ((uint32_t)0x00380000) /*!<TSEL2[2:0] (DAC channel2 Trigger selection) */
  2921. #define DAC_CR_TSEL2_0 ((uint32_t)0x00080000) /*!<Bit 0 */
  2922. #define DAC_CR_TSEL2_1 ((uint32_t)0x00100000) /*!<Bit 1 */
  2923. #define DAC_CR_TSEL2_2 ((uint32_t)0x00200000) /*!<Bit 2 */
  2924. #define DAC_CR_WAVE2 ((uint32_t)0x00C00000) /*!<WAVE2[1:0] (DAC channel2 noise/triangle wave generation enable) */
  2925. #define DAC_CR_WAVE2_0 ((uint32_t)0x00400000) /*!<Bit 0 */
  2926. #define DAC_CR_WAVE2_1 ((uint32_t)0x00800000) /*!<Bit 1 */
  2927. #define DAC_CR_MAMP2 ((uint32_t)0x0F000000) /*!<MAMP2[3:0] (DAC channel2 Mask/Amplitude selector) */
  2928. #define DAC_CR_MAMP2_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  2929. #define DAC_CR_MAMP2_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  2930. #define DAC_CR_MAMP2_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  2931. #define DAC_CR_MAMP2_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  2932. #define DAC_CR_DMAEN2 ((uint32_t)0x10000000) /*!<DAC channel2 DMA enabled */
  2933. /***************** Bit definition for DAC_SWTRIGR register ******************/
  2934. #define DAC_SWTRIGR_SWTRIG1 ((uint32_t)0x01) /*!<DAC channel1 software trigger */
  2935. #define DAC_SWTRIGR_SWTRIG2 ((uint32_t)0x02) /*!<DAC channel2 software trigger */
  2936. /***************** Bit definition for DAC_DHR12R1 register ******************/
  2937. #define DAC_DHR12R1_DACC1DHR ((uint32_t)0x0FFF) /*!<DAC channel1 12-bit Right aligned data */
  2938. /***************** Bit definition for DAC_DHR12L1 register ******************/
  2939. #define DAC_DHR12L1_DACC1DHR ((uint32_t)0xFFF0) /*!<DAC channel1 12-bit Left aligned data */
  2940. /****************** Bit definition for DAC_DHR8R1 register ******************/
  2941. #define DAC_DHR8R1_DACC1DHR ((uint32_t)0xFF) /*!<DAC channel1 8-bit Right aligned data */
  2942. /***************** Bit definition for DAC_DHR12R2 register ******************/
  2943. #define DAC_DHR12R2_DACC2DHR ((uint32_t)0x0FFF) /*!<DAC channel2 12-bit Right aligned data */
  2944. /***************** Bit definition for DAC_DHR12L2 register ******************/
  2945. #define DAC_DHR12L2_DACC2DHR ((uint32_t)0xFFF0) /*!<DAC channel2 12-bit Left aligned data */
  2946. /****************** Bit definition for DAC_DHR8R2 register ******************/
  2947. #define DAC_DHR8R2_DACC2DHR ((uint32_t)0xFF) /*!<DAC channel2 8-bit Right aligned data */
  2948. /***************** Bit definition for DAC_DHR12RD register ******************/
  2949. #define DAC_DHR12RD_DACC1DHR ((uint32_t)0x00000FFF) /*!<DAC channel1 12-bit Right aligned data */
  2950. #define DAC_DHR12RD_DACC2DHR ((uint32_t)0x0FFF0000) /*!<DAC channel2 12-bit Right aligned data */
  2951. /***************** Bit definition for DAC_DHR12LD register ******************/
  2952. #define DAC_DHR12LD_DACC1DHR ((uint32_t)0x0000FFF0) /*!<DAC channel1 12-bit Left aligned data */
  2953. #define DAC_DHR12LD_DACC2DHR ((uint32_t)0xFFF00000) /*!<DAC channel2 12-bit Left aligned data */
  2954. /****************** Bit definition for DAC_DHR8RD register ******************/
  2955. #define DAC_DHR8RD_DACC1DHR ((uint32_t)0x00FF) /*!<DAC channel1 8-bit Right aligned data */
  2956. #define DAC_DHR8RD_DACC2DHR ((uint32_t)0xFF00) /*!<DAC channel2 8-bit Right aligned data */
  2957. /******************* Bit definition for DAC_DOR1 register *******************/
  2958. #define DAC_DOR1_DACC1DOR ((uint32_t)0x0FFF) /*!<DAC channel1 data output */
  2959. /******************* Bit definition for DAC_DOR2 register *******************/
  2960. #define DAC_DOR2_DACC2DOR ((uint32_t)0x0FFF) /*!<DAC channel2 data output */
  2961. /******************** Bit definition for DAC_SR register ********************/
  2962. #define DAC_SR_DMAUDR1 ((uint32_t)0x00002000) /*!<DAC channel1 DMA underrun flag */
  2963. #define DAC_SR_DMAUDR2 ((uint32_t)0x20000000) /*!<DAC channel2 DMA underrun flag */
  2964. /******************************************************************************/
  2965. /* */
  2966. /* Debug MCU */
  2967. /* */
  2968. /******************************************************************************/
  2969. /******************************************************************************/
  2970. /* */
  2971. /* DCMI */
  2972. /* */
  2973. /******************************************************************************/
  2974. /******************** Bits definition for DCMI_CR register ******************/
  2975. #define DCMI_CR_CAPTURE ((uint32_t)0x00000001)
  2976. #define DCMI_CR_CM ((uint32_t)0x00000002)
  2977. #define DCMI_CR_CROP ((uint32_t)0x00000004)
  2978. #define DCMI_CR_JPEG ((uint32_t)0x00000008)
  2979. #define DCMI_CR_ESS ((uint32_t)0x00000010)
  2980. #define DCMI_CR_PCKPOL ((uint32_t)0x00000020)
  2981. #define DCMI_CR_HSPOL ((uint32_t)0x00000040)
  2982. #define DCMI_CR_VSPOL ((uint32_t)0x00000080)
  2983. #define DCMI_CR_FCRC_0 ((uint32_t)0x00000100)
  2984. #define DCMI_CR_FCRC_1 ((uint32_t)0x00000200)
  2985. #define DCMI_CR_EDM_0 ((uint32_t)0x00000400)
  2986. #define DCMI_CR_EDM_1 ((uint32_t)0x00000800)
  2987. #define DCMI_CR_CRE ((uint32_t)0x00001000)
  2988. #define DCMI_CR_ENABLE ((uint32_t)0x00004000)
  2989. #define DCMI_CR_BSM ((uint32_t)0x00030000)
  2990. #define DCMI_CR_BSM_0 ((uint32_t)0x00010000)
  2991. #define DCMI_CR_BSM_1 ((uint32_t)0x00020000)
  2992. #define DCMI_CR_OEBS ((uint32_t)0x00040000)
  2993. #define DCMI_CR_LSM ((uint32_t)0x00080000)
  2994. #define DCMI_CR_OELS ((uint32_t)0x00100000)
  2995. /******************** Bits definition for DCMI_SR register ******************/
  2996. #define DCMI_SR_HSYNC ((uint32_t)0x00000001)
  2997. #define DCMI_SR_VSYNC ((uint32_t)0x00000002)
  2998. #define DCMI_SR_FNE ((uint32_t)0x00000004)
  2999. /******************** Bits definition for DCMI_RISR register ****************/
  3000. #define DCMI_RISR_FRAME_RIS ((uint32_t)0x00000001)
  3001. #define DCMI_RISR_OVF_RIS ((uint32_t)0x00000002)
  3002. #define DCMI_RISR_ERR_RIS ((uint32_t)0x00000004)
  3003. #define DCMI_RISR_VSYNC_RIS ((uint32_t)0x00000008)
  3004. #define DCMI_RISR_LINE_RIS ((uint32_t)0x00000010)
  3005. /******************** Bits definition for DCMI_IER register *****************/
  3006. #define DCMI_IER_FRAME_IE ((uint32_t)0x00000001)
  3007. #define DCMI_IER_OVF_IE ((uint32_t)0x00000002)
  3008. #define DCMI_IER_ERR_IE ((uint32_t)0x00000004)
  3009. #define DCMI_IER_VSYNC_IE ((uint32_t)0x00000008)
  3010. #define DCMI_IER_LINE_IE ((uint32_t)0x00000010)
  3011. /******************** Bits definition for DCMI_MISR register ****************/
  3012. #define DCMI_MISR_FRAME_MIS ((uint32_t)0x00000001)
  3013. #define DCMI_MISR_OVF_MIS ((uint32_t)0x00000002)
  3014. #define DCMI_MISR_ERR_MIS ((uint32_t)0x00000004)
  3015. #define DCMI_MISR_VSYNC_MIS ((uint32_t)0x00000008)
  3016. #define DCMI_MISR_LINE_MIS ((uint32_t)0x00000010)
  3017. /******************** Bits definition for DCMI_ICR register *****************/
  3018. #define DCMI_ICR_FRAME_ISC ((uint32_t)0x00000001)
  3019. #define DCMI_ICR_OVF_ISC ((uint32_t)0x00000002)
  3020. #define DCMI_ICR_ERR_ISC ((uint32_t)0x00000004)
  3021. #define DCMI_ICR_VSYNC_ISC ((uint32_t)0x00000008)
  3022. #define DCMI_ICR_LINE_ISC ((uint32_t)0x00000010)
  3023. /******************************************************************************/
  3024. /* */
  3025. /* DMA Controller */
  3026. /* */
  3027. /******************************************************************************/
  3028. /******************** Bits definition for DMA_SxCR register *****************/
  3029. #define DMA_SxCR_CHSEL ((uint32_t)0x0E000000)
  3030. #define DMA_SxCR_CHSEL_0 ((uint32_t)0x02000000)
  3031. #define DMA_SxCR_CHSEL_1 ((uint32_t)0x04000000)
  3032. #define DMA_SxCR_CHSEL_2 ((uint32_t)0x08000000)
  3033. #define DMA_SxCR_MBURST ((uint32_t)0x01800000)
  3034. #define DMA_SxCR_MBURST_0 ((uint32_t)0x00800000)
  3035. #define DMA_SxCR_MBURST_1 ((uint32_t)0x01000000)
  3036. #define DMA_SxCR_PBURST ((uint32_t)0x00600000)
  3037. #define DMA_SxCR_PBURST_0 ((uint32_t)0x00200000)
  3038. #define DMA_SxCR_PBURST_1 ((uint32_t)0x00400000)
  3039. #define DMA_SxCR_ACK ((uint32_t)0x00100000)
  3040. #define DMA_SxCR_CT ((uint32_t)0x00080000)
  3041. #define DMA_SxCR_DBM ((uint32_t)0x00040000)
  3042. #define DMA_SxCR_PL ((uint32_t)0x00030000)
  3043. #define DMA_SxCR_PL_0 ((uint32_t)0x00010000)
  3044. #define DMA_SxCR_PL_1 ((uint32_t)0x00020000)
  3045. #define DMA_SxCR_PINCOS ((uint32_t)0x00008000)
  3046. #define DMA_SxCR_MSIZE ((uint32_t)0x00006000)
  3047. #define DMA_SxCR_MSIZE_0 ((uint32_t)0x00002000)
  3048. #define DMA_SxCR_MSIZE_1 ((uint32_t)0x00004000)
  3049. #define DMA_SxCR_PSIZE ((uint32_t)0x00001800)
  3050. #define DMA_SxCR_PSIZE_0 ((uint32_t)0x00000800)
  3051. #define DMA_SxCR_PSIZE_1 ((uint32_t)0x00001000)
  3052. #define DMA_SxCR_MINC ((uint32_t)0x00000400)
  3053. #define DMA_SxCR_PINC ((uint32_t)0x00000200)
  3054. #define DMA_SxCR_CIRC ((uint32_t)0x00000100)
  3055. #define DMA_SxCR_DIR ((uint32_t)0x000000C0)
  3056. #define DMA_SxCR_DIR_0 ((uint32_t)0x00000040)
  3057. #define DMA_SxCR_DIR_1 ((uint32_t)0x00000080)
  3058. #define DMA_SxCR_PFCTRL ((uint32_t)0x00000020)
  3059. #define DMA_SxCR_TCIE ((uint32_t)0x00000010)
  3060. #define DMA_SxCR_HTIE ((uint32_t)0x00000008)
  3061. #define DMA_SxCR_TEIE ((uint32_t)0x00000004)
  3062. #define DMA_SxCR_DMEIE ((uint32_t)0x00000002)
  3063. #define DMA_SxCR_EN ((uint32_t)0x00000001)
  3064. /******************** Bits definition for DMA_SxCNDTR register **************/
  3065. #define DMA_SxNDT ((uint32_t)0x0000FFFF)
  3066. #define DMA_SxNDT_0 ((uint32_t)0x00000001)
  3067. #define DMA_SxNDT_1 ((uint32_t)0x00000002)
  3068. #define DMA_SxNDT_2 ((uint32_t)0x00000004)
  3069. #define DMA_SxNDT_3 ((uint32_t)0x00000008)
  3070. #define DMA_SxNDT_4 ((uint32_t)0x00000010)
  3071. #define DMA_SxNDT_5 ((uint32_t)0x00000020)
  3072. #define DMA_SxNDT_6 ((uint32_t)0x00000040)
  3073. #define DMA_SxNDT_7 ((uint32_t)0x00000080)
  3074. #define DMA_SxNDT_8 ((uint32_t)0x00000100)
  3075. #define DMA_SxNDT_9 ((uint32_t)0x00000200)
  3076. #define DMA_SxNDT_10 ((uint32_t)0x00000400)
  3077. #define DMA_SxNDT_11 ((uint32_t)0x00000800)
  3078. #define DMA_SxNDT_12 ((uint32_t)0x00001000)
  3079. #define DMA_SxNDT_13 ((uint32_t)0x00002000)
  3080. #define DMA_SxNDT_14 ((uint32_t)0x00004000)
  3081. #define DMA_SxNDT_15 ((uint32_t)0x00008000)
  3082. /******************** Bits definition for DMA_SxFCR register ****************/
  3083. #define DMA_SxFCR_FEIE ((uint32_t)0x00000080)
  3084. #define DMA_SxFCR_FS ((uint32_t)0x00000038)
  3085. #define DMA_SxFCR_FS_0 ((uint32_t)0x00000008)
  3086. #define DMA_SxFCR_FS_1 ((uint32_t)0x00000010)
  3087. #define DMA_SxFCR_FS_2 ((uint32_t)0x00000020)
  3088. #define DMA_SxFCR_DMDIS ((uint32_t)0x00000004)
  3089. #define DMA_SxFCR_FTH ((uint32_t)0x00000003)
  3090. #define DMA_SxFCR_FTH_0 ((uint32_t)0x00000001)
  3091. #define DMA_SxFCR_FTH_1 ((uint32_t)0x00000002)
  3092. /******************** Bits definition for DMA_LISR register *****************/
  3093. #define DMA_LISR_TCIF3 ((uint32_t)0x08000000)
  3094. #define DMA_LISR_HTIF3 ((uint32_t)0x04000000)
  3095. #define DMA_LISR_TEIF3 ((uint32_t)0x02000000)
  3096. #define DMA_LISR_DMEIF3 ((uint32_t)0x01000000)
  3097. #define DMA_LISR_FEIF3 ((uint32_t)0x00400000)
  3098. #define DMA_LISR_TCIF2 ((uint32_t)0x00200000)
  3099. #define DMA_LISR_HTIF2 ((uint32_t)0x00100000)
  3100. #define DMA_LISR_TEIF2 ((uint32_t)0x00080000)
  3101. #define DMA_LISR_DMEIF2 ((uint32_t)0x00040000)
  3102. #define DMA_LISR_FEIF2 ((uint32_t)0x00010000)
  3103. #define DMA_LISR_TCIF1 ((uint32_t)0x00000800)
  3104. #define DMA_LISR_HTIF1 ((uint32_t)0x00000400)
  3105. #define DMA_LISR_TEIF1 ((uint32_t)0x00000200)
  3106. #define DMA_LISR_DMEIF1 ((uint32_t)0x00000100)
  3107. #define DMA_LISR_FEIF1 ((uint32_t)0x00000040)
  3108. #define DMA_LISR_TCIF0 ((uint32_t)0x00000020)
  3109. #define DMA_LISR_HTIF0 ((uint32_t)0x00000010)
  3110. #define DMA_LISR_TEIF0 ((uint32_t)0x00000008)
  3111. #define DMA_LISR_DMEIF0 ((uint32_t)0x00000004)
  3112. #define DMA_LISR_FEIF0 ((uint32_t)0x00000001)
  3113. /******************** Bits definition for DMA_HISR register *****************/
  3114. #define DMA_HISR_TCIF7 ((uint32_t)0x08000000)
  3115. #define DMA_HISR_HTIF7 ((uint32_t)0x04000000)
  3116. #define DMA_HISR_TEIF7 ((uint32_t)0x02000000)
  3117. #define DMA_HISR_DMEIF7 ((uint32_t)0x01000000)
  3118. #define DMA_HISR_FEIF7 ((uint32_t)0x00400000)
  3119. #define DMA_HISR_TCIF6 ((uint32_t)0x00200000)
  3120. #define DMA_HISR_HTIF6 ((uint32_t)0x00100000)
  3121. #define DMA_HISR_TEIF6 ((uint32_t)0x00080000)
  3122. #define DMA_HISR_DMEIF6 ((uint32_t)0x00040000)
  3123. #define DMA_HISR_FEIF6 ((uint32_t)0x00010000)
  3124. #define DMA_HISR_TCIF5 ((uint32_t)0x00000800)
  3125. #define DMA_HISR_HTIF5 ((uint32_t)0x00000400)
  3126. #define DMA_HISR_TEIF5 ((uint32_t)0x00000200)
  3127. #define DMA_HISR_DMEIF5 ((uint32_t)0x00000100)
  3128. #define DMA_HISR_FEIF5 ((uint32_t)0x00000040)
  3129. #define DMA_HISR_TCIF4 ((uint32_t)0x00000020)
  3130. #define DMA_HISR_HTIF4 ((uint32_t)0x00000010)
  3131. #define DMA_HISR_TEIF4 ((uint32_t)0x00000008)
  3132. #define DMA_HISR_DMEIF4 ((uint32_t)0x00000004)
  3133. #define DMA_HISR_FEIF4 ((uint32_t)0x00000001)
  3134. /******************** Bits definition for DMA_LIFCR register ****************/
  3135. #define DMA_LIFCR_CTCIF3 ((uint32_t)0x08000000)
  3136. #define DMA_LIFCR_CHTIF3 ((uint32_t)0x04000000)
  3137. #define DMA_LIFCR_CTEIF3 ((uint32_t)0x02000000)
  3138. #define DMA_LIFCR_CDMEIF3 ((uint32_t)0x01000000)
  3139. #define DMA_LIFCR_CFEIF3 ((uint32_t)0x00400000)
  3140. #define DMA_LIFCR_CTCIF2 ((uint32_t)0x00200000)
  3141. #define DMA_LIFCR_CHTIF2 ((uint32_t)0x00100000)
  3142. #define DMA_LIFCR_CTEIF2 ((uint32_t)0x00080000)
  3143. #define DMA_LIFCR_CDMEIF2 ((uint32_t)0x00040000)
  3144. #define DMA_LIFCR_CFEIF2 ((uint32_t)0x00010000)
  3145. #define DMA_LIFCR_CTCIF1 ((uint32_t)0x00000800)
  3146. #define DMA_LIFCR_CHTIF1 ((uint32_t)0x00000400)
  3147. #define DMA_LIFCR_CTEIF1 ((uint32_t)0x00000200)
  3148. #define DMA_LIFCR_CDMEIF1 ((uint32_t)0x00000100)
  3149. #define DMA_LIFCR_CFEIF1 ((uint32_t)0x00000040)
  3150. #define DMA_LIFCR_CTCIF0 ((uint32_t)0x00000020)
  3151. #define DMA_LIFCR_CHTIF0 ((uint32_t)0x00000010)
  3152. #define DMA_LIFCR_CTEIF0 ((uint32_t)0x00000008)
  3153. #define DMA_LIFCR_CDMEIF0 ((uint32_t)0x00000004)
  3154. #define DMA_LIFCR_CFEIF0 ((uint32_t)0x00000001)
  3155. /******************** Bits definition for DMA_HIFCR register ****************/
  3156. #define DMA_HIFCR_CTCIF7 ((uint32_t)0x08000000)
  3157. #define DMA_HIFCR_CHTIF7 ((uint32_t)0x04000000)
  3158. #define DMA_HIFCR_CTEIF7 ((uint32_t)0x02000000)
  3159. #define DMA_HIFCR_CDMEIF7 ((uint32_t)0x01000000)
  3160. #define DMA_HIFCR_CFEIF7 ((uint32_t)0x00400000)
  3161. #define DMA_HIFCR_CTCIF6 ((uint32_t)0x00200000)
  3162. #define DMA_HIFCR_CHTIF6 ((uint32_t)0x00100000)
  3163. #define DMA_HIFCR_CTEIF6 ((uint32_t)0x00080000)
  3164. #define DMA_HIFCR_CDMEIF6 ((uint32_t)0x00040000)
  3165. #define DMA_HIFCR_CFEIF6 ((uint32_t)0x00010000)
  3166. #define DMA_HIFCR_CTCIF5 ((uint32_t)0x00000800)
  3167. #define DMA_HIFCR_CHTIF5 ((uint32_t)0x00000400)
  3168. #define DMA_HIFCR_CTEIF5 ((uint32_t)0x00000200)
  3169. #define DMA_HIFCR_CDMEIF5 ((uint32_t)0x00000100)
  3170. #define DMA_HIFCR_CFEIF5 ((uint32_t)0x00000040)
  3171. #define DMA_HIFCR_CTCIF4 ((uint32_t)0x00000020)
  3172. #define DMA_HIFCR_CHTIF4 ((uint32_t)0x00000010)
  3173. #define DMA_HIFCR_CTEIF4 ((uint32_t)0x00000008)
  3174. #define DMA_HIFCR_CDMEIF4 ((uint32_t)0x00000004)
  3175. #define DMA_HIFCR_CFEIF4 ((uint32_t)0x00000001)
  3176. /******************************************************************************/
  3177. /* */
  3178. /* AHB Master DMA2D Controller (DMA2D) */
  3179. /* */
  3180. /******************************************************************************/
  3181. /******************** Bit definition for DMA2D_CR register ******************/
  3182. #define DMA2D_CR_START ((uint32_t)0x00000001) /*!< Start transfer */
  3183. #define DMA2D_CR_SUSP ((uint32_t)0x00000002) /*!< Suspend transfer */
  3184. #define DMA2D_CR_ABORT ((uint32_t)0x00000004) /*!< Abort transfer */
  3185. #define DMA2D_CR_TEIE ((uint32_t)0x00000100) /*!< Transfer Error Interrupt Enable */
  3186. #define DMA2D_CR_TCIE ((uint32_t)0x00000200) /*!< Transfer Complete Interrupt Enable */
  3187. #define DMA2D_CR_TWIE ((uint32_t)0x00000400) /*!< Transfer Watermark Interrupt Enable */
  3188. #define DMA2D_CR_CAEIE ((uint32_t)0x00000800) /*!< CLUT Access Error Interrupt Enable */
  3189. #define DMA2D_CR_CTCIE ((uint32_t)0x00001000) /*!< CLUT Transfer Complete Interrupt Enable */
  3190. #define DMA2D_CR_CEIE ((uint32_t)0x00002000) /*!< Configuration Error Interrupt Enable */
  3191. #define DMA2D_CR_MODE ((uint32_t)0x00030000) /*!< DMA2D Mode */
  3192. /******************** Bit definition for DMA2D_ISR register *****************/
  3193. #define DMA2D_ISR_TEIF ((uint32_t)0x00000001) /*!< Transfer Error Interrupt Flag */
  3194. #define DMA2D_ISR_TCIF ((uint32_t)0x00000002) /*!< Transfer Complete Interrupt Flag */
  3195. #define DMA2D_ISR_TWIF ((uint32_t)0x00000004) /*!< Transfer Watermark Interrupt Flag */
  3196. #define DMA2D_ISR_CAEIF ((uint32_t)0x00000008) /*!< CLUT Access Error Interrupt Flag */
  3197. #define DMA2D_ISR_CTCIF ((uint32_t)0x00000010) /*!< CLUT Transfer Complete Interrupt Flag */
  3198. #define DMA2D_ISR_CEIF ((uint32_t)0x00000020) /*!< Configuration Error Interrupt Flag */
  3199. /******************** Bit definition for DMA2D_IFSR register ****************/
  3200. #define DMA2D_IFSR_CTEIF ((uint32_t)0x00000001) /*!< Clears Transfer Error Interrupt Flag */
  3201. #define DMA2D_IFSR_CTCIF ((uint32_t)0x00000002) /*!< Clears Transfer Complete Interrupt Flag */
  3202. #define DMA2D_IFSR_CTWIF ((uint32_t)0x00000004) /*!< Clears Transfer Watermark Interrupt Flag */
  3203. #define DMA2D_IFSR_CCAEIF ((uint32_t)0x00000008) /*!< Clears CLUT Access Error Interrupt Flag */
  3204. #define DMA2D_IFSR_CCTCIF ((uint32_t)0x00000010) /*!< Clears CLUT Transfer Complete Interrupt Flag */
  3205. #define DMA2D_IFSR_CCEIF ((uint32_t)0x00000020) /*!< Clears Configuration Error Interrupt Flag */
  3206. /******************** Bit definition for DMA2D_FGMAR register ***************/
  3207. #define DMA2D_FGMAR_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  3208. /******************** Bit definition for DMA2D_FGOR register ****************/
  3209. #define DMA2D_FGOR_LO ((uint32_t)0x00003FFF) /*!< Line Offset */
  3210. /******************** Bit definition for DMA2D_BGMAR register ***************/
  3211. #define DMA2D_BGMAR_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  3212. /******************** Bit definition for DMA2D_BGOR register ****************/
  3213. #define DMA2D_BGOR_LO ((uint32_t)0x00003FFF) /*!< Line Offset */
  3214. /******************** Bit definition for DMA2D_FGPFCCR register *************/
  3215. #define DMA2D_FGPFCCR_CM ((uint32_t)0x0000000F) /*!< Color mode */
  3216. #define DMA2D_FGPFCCR_CCM ((uint32_t)0x00000010) /*!< CLUT Color mode */
  3217. #define DMA2D_FGPFCCR_START ((uint32_t)0x00000020) /*!< Start */
  3218. #define DMA2D_FGPFCCR_CS ((uint32_t)0x0000FF00) /*!< CLUT size */
  3219. #define DMA2D_FGPFCCR_AM ((uint32_t)0x00030000) /*!< Alpha mode */
  3220. #define DMA2D_FGPFCCR_ALPHA ((uint32_t)0xFF000000) /*!< Alpha value */
  3221. /******************** Bit definition for DMA2D_FGCOLR register **************/
  3222. #define DMA2D_FGCOLR_BLUE ((uint32_t)0x000000FF) /*!< Blue Value */
  3223. #define DMA2D_FGCOLR_GREEN ((uint32_t)0x0000FF00) /*!< Green Value */
  3224. #define DMA2D_FGCOLR_RED ((uint32_t)0x00FF0000) /*!< Red Value */
  3225. /******************** Bit definition for DMA2D_BGPFCCR register *************/
  3226. #define DMA2D_BGPFCCR_CM ((uint32_t)0x0000000F) /*!< Color mode */
  3227. #define DMA2D_BGPFCCR_CCM ((uint32_t)0x00000010) /*!< CLUT Color mode */
  3228. #define DMA2D_BGPFCCR_START ((uint32_t)0x00000020) /*!< Start */
  3229. #define DMA2D_BGPFCCR_CS ((uint32_t)0x0000FF00) /*!< CLUT size */
  3230. #define DMA2D_BGPFCCR_AM ((uint32_t)0x00030000) /*!< Alpha Mode */
  3231. #define DMA2D_BGPFCCR_ALPHA ((uint32_t)0xFF000000) /*!< Alpha value */
  3232. /******************** Bit definition for DMA2D_BGCOLR register **************/
  3233. #define DMA2D_BGCOLR_BLUE ((uint32_t)0x000000FF) /*!< Blue Value */
  3234. #define DMA2D_BGCOLR_GREEN ((uint32_t)0x0000FF00) /*!< Green Value */
  3235. #define DMA2D_BGCOLR_RED ((uint32_t)0x00FF0000) /*!< Red Value */
  3236. /******************** Bit definition for DMA2D_FGCMAR register **************/
  3237. #define DMA2D_FGCMAR_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  3238. /******************** Bit definition for DMA2D_BGCMAR register **************/
  3239. #define DMA2D_BGCMAR_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  3240. /******************** Bit definition for DMA2D_OPFCCR register **************/
  3241. #define DMA2D_OPFCCR_CM ((uint32_t)0x00000007) /*!< Color mode */
  3242. /******************** Bit definition for DMA2D_OCOLR register ***************/
  3243. /*!<Mode_ARGB8888/RGB888 */
  3244. #define DMA2D_OCOLR_BLUE_1 ((uint32_t)0x000000FF) /*!< BLUE Value */
  3245. #define DMA2D_OCOLR_GREEN_1 ((uint32_t)0x0000FF00) /*!< GREEN Value */
  3246. #define DMA2D_OCOLR_RED_1 ((uint32_t)0x00FF0000) /*!< Red Value */
  3247. #define DMA2D_OCOLR_ALPHA_1 ((uint32_t)0xFF000000) /*!< Alpha Channel Value */
  3248. /*!<Mode_RGB565 */
  3249. #define DMA2D_OCOLR_BLUE_2 ((uint32_t)0x0000001F) /*!< BLUE Value */
  3250. #define DMA2D_OCOLR_GREEN_2 ((uint32_t)0x000007E0) /*!< GREEN Value */
  3251. #define DMA2D_OCOLR_RED_2 ((uint32_t)0x0000F800) /*!< Red Value */
  3252. /*!<Mode_ARGB1555 */
  3253. #define DMA2D_OCOLR_BLUE_3 ((uint32_t)0x0000001F) /*!< BLUE Value */
  3254. #define DMA2D_OCOLR_GREEN_3 ((uint32_t)0x000003E0) /*!< GREEN Value */
  3255. #define DMA2D_OCOLR_RED_3 ((uint32_t)0x00007C00) /*!< Red Value */
  3256. #define DMA2D_OCOLR_ALPHA_3 ((uint32_t)0x00008000) /*!< Alpha Channel Value */
  3257. /*!<Mode_ARGB4444 */
  3258. #define DMA2D_OCOLR_BLUE_4 ((uint32_t)0x0000000F) /*!< BLUE Value */
  3259. #define DMA2D_OCOLR_GREEN_4 ((uint32_t)0x000000F0) /*!< GREEN Value */
  3260. #define DMA2D_OCOLR_RED_4 ((uint32_t)0x00000F00) /*!< Red Value */
  3261. #define DMA2D_OCOLR_ALPHA_4 ((uint32_t)0x0000F000) /*!< Alpha Channel Value */
  3262. /******************** Bit definition for DMA2D_OMAR register ****************/
  3263. #define DMA2D_OMAR_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  3264. /******************** Bit definition for DMA2D_OOR register *****************/
  3265. #define DMA2D_OOR_LO ((uint32_t)0x00003FFF) /*!< Line Offset */
  3266. /******************** Bit definition for DMA2D_NLR register *****************/
  3267. #define DMA2D_NLR_NL ((uint32_t)0x0000FFFF) /*!< Number of Lines */
  3268. #define DMA2D_NLR_PL ((uint32_t)0x3FFF0000) /*!< Pixel per Lines */
  3269. /******************** Bit definition for DMA2D_LWR register *****************/
  3270. #define DMA2D_LWR_LW ((uint32_t)0x0000FFFF) /*!< Line Watermark */
  3271. /******************** Bit definition for DMA2D_AMTCR register ***************/
  3272. #define DMA2D_AMTCR_EN ((uint32_t)0x00000001) /*!< Enable */
  3273. #define DMA2D_AMTCR_DT ((uint32_t)0x0000FF00) /*!< Dead Time */
  3274. /******************** Bit definition for DMA2D_FGCLUT register **************/
  3275. /******************** Bit definition for DMA2D_BGCLUT register **************/
  3276. /******************************************************************************/
  3277. /* */
  3278. /* External Interrupt/Event Controller */
  3279. /* */
  3280. /******************************************************************************/
  3281. /******************* Bit definition for EXTI_IMR register *******************/
  3282. #define EXTI_IMR_MR0 ((uint32_t)0x00000001) /*!< Interrupt Mask on line 0 */
  3283. #define EXTI_IMR_MR1 ((uint32_t)0x00000002) /*!< Interrupt Mask on line 1 */
  3284. #define EXTI_IMR_MR2 ((uint32_t)0x00000004) /*!< Interrupt Mask on line 2 */
  3285. #define EXTI_IMR_MR3 ((uint32_t)0x00000008) /*!< Interrupt Mask on line 3 */
  3286. #define EXTI_IMR_MR4 ((uint32_t)0x00000010) /*!< Interrupt Mask on line 4 */
  3287. #define EXTI_IMR_MR5 ((uint32_t)0x00000020) /*!< Interrupt Mask on line 5 */
  3288. #define EXTI_IMR_MR6 ((uint32_t)0x00000040) /*!< Interrupt Mask on line 6 */
  3289. #define EXTI_IMR_MR7 ((uint32_t)0x00000080) /*!< Interrupt Mask on line 7 */
  3290. #define EXTI_IMR_MR8 ((uint32_t)0x00000100) /*!< Interrupt Mask on line 8 */
  3291. #define EXTI_IMR_MR9 ((uint32_t)0x00000200) /*!< Interrupt Mask on line 9 */
  3292. #define EXTI_IMR_MR10 ((uint32_t)0x00000400) /*!< Interrupt Mask on line 10 */
  3293. #define EXTI_IMR_MR11 ((uint32_t)0x00000800) /*!< Interrupt Mask on line 11 */
  3294. #define EXTI_IMR_MR12 ((uint32_t)0x00001000) /*!< Interrupt Mask on line 12 */
  3295. #define EXTI_IMR_MR13 ((uint32_t)0x00002000) /*!< Interrupt Mask on line 13 */
  3296. #define EXTI_IMR_MR14 ((uint32_t)0x00004000) /*!< Interrupt Mask on line 14 */
  3297. #define EXTI_IMR_MR15 ((uint32_t)0x00008000) /*!< Interrupt Mask on line 15 */
  3298. #define EXTI_IMR_MR16 ((uint32_t)0x00010000) /*!< Interrupt Mask on line 16 */
  3299. #define EXTI_IMR_MR17 ((uint32_t)0x00020000) /*!< Interrupt Mask on line 17 */
  3300. #define EXTI_IMR_MR18 ((uint32_t)0x00040000) /*!< Interrupt Mask on line 18 */
  3301. #define EXTI_IMR_MR19 ((uint32_t)0x00080000) /*!< Interrupt Mask on line 19 */
  3302. #define EXTI_IMR_MR20 ((uint32_t)0x00100000) /*!< Interrupt Mask on line 20 */
  3303. #define EXTI_IMR_MR21 ((uint32_t)0x00200000) /*!< Interrupt Mask on line 21 */
  3304. #define EXTI_IMR_MR22 ((uint32_t)0x00400000) /*!< Interrupt Mask on line 22 */
  3305. #define EXTI_IMR_MR23 ((uint32_t)0x00800000) /*!< Interrupt Mask on line 23 */
  3306. /******************* Bit definition for EXTI_EMR register *******************/
  3307. #define EXTI_EMR_MR0 ((uint32_t)0x00000001) /*!< Event Mask on line 0 */
  3308. #define EXTI_EMR_MR1 ((uint32_t)0x00000002) /*!< Event Mask on line 1 */
  3309. #define EXTI_EMR_MR2 ((uint32_t)0x00000004) /*!< Event Mask on line 2 */
  3310. #define EXTI_EMR_MR3 ((uint32_t)0x00000008) /*!< Event Mask on line 3 */
  3311. #define EXTI_EMR_MR4 ((uint32_t)0x00000010) /*!< Event Mask on line 4 */
  3312. #define EXTI_EMR_MR5 ((uint32_t)0x00000020) /*!< Event Mask on line 5 */
  3313. #define EXTI_EMR_MR6 ((uint32_t)0x00000040) /*!< Event Mask on line 6 */
  3314. #define EXTI_EMR_MR7 ((uint32_t)0x00000080) /*!< Event Mask on line 7 */
  3315. #define EXTI_EMR_MR8 ((uint32_t)0x00000100) /*!< Event Mask on line 8 */
  3316. #define EXTI_EMR_MR9 ((uint32_t)0x00000200) /*!< Event Mask on line 9 */
  3317. #define EXTI_EMR_MR10 ((uint32_t)0x00000400) /*!< Event Mask on line 10 */
  3318. #define EXTI_EMR_MR11 ((uint32_t)0x00000800) /*!< Event Mask on line 11 */
  3319. #define EXTI_EMR_MR12 ((uint32_t)0x00001000) /*!< Event Mask on line 12 */
  3320. #define EXTI_EMR_MR13 ((uint32_t)0x00002000) /*!< Event Mask on line 13 */
  3321. #define EXTI_EMR_MR14 ((uint32_t)0x00004000) /*!< Event Mask on line 14 */
  3322. #define EXTI_EMR_MR15 ((uint32_t)0x00008000) /*!< Event Mask on line 15 */
  3323. #define EXTI_EMR_MR16 ((uint32_t)0x00010000) /*!< Event Mask on line 16 */
  3324. #define EXTI_EMR_MR17 ((uint32_t)0x00020000) /*!< Event Mask on line 17 */
  3325. #define EXTI_EMR_MR18 ((uint32_t)0x00040000) /*!< Event Mask on line 18 */
  3326. #define EXTI_EMR_MR19 ((uint32_t)0x00080000) /*!< Event Mask on line 19 */
  3327. #define EXTI_EMR_MR20 ((uint32_t)0x00100000) /*!< Event Mask on line 20 */
  3328. #define EXTI_EMR_MR21 ((uint32_t)0x00200000) /*!< Event Mask on line 21 */
  3329. #define EXTI_EMR_MR22 ((uint32_t)0x00400000) /*!< Event Mask on line 22 */
  3330. #define EXTI_EMR_MR23 ((uint32_t)0x00800000) /*!< Event Mask on line 23 */
  3331. /****************** Bit definition for EXTI_RTSR register *******************/
  3332. #define EXTI_RTSR_TR0 ((uint32_t)0x00000001) /*!< Rising trigger event configuration bit of line 0 */
  3333. #define EXTI_RTSR_TR1 ((uint32_t)0x00000002) /*!< Rising trigger event configuration bit of line 1 */
  3334. #define EXTI_RTSR_TR2 ((uint32_t)0x00000004) /*!< Rising trigger event configuration bit of line 2 */
  3335. #define EXTI_RTSR_TR3 ((uint32_t)0x00000008) /*!< Rising trigger event configuration bit of line 3 */
  3336. #define EXTI_RTSR_TR4 ((uint32_t)0x00000010) /*!< Rising trigger event configuration bit of line 4 */
  3337. #define EXTI_RTSR_TR5 ((uint32_t)0x00000020) /*!< Rising trigger event configuration bit of line 5 */
  3338. #define EXTI_RTSR_TR6 ((uint32_t)0x00000040) /*!< Rising trigger event configuration bit of line 6 */
  3339. #define EXTI_RTSR_TR7 ((uint32_t)0x00000080) /*!< Rising trigger event configuration bit of line 7 */
  3340. #define EXTI_RTSR_TR8 ((uint32_t)0x00000100) /*!< Rising trigger event configuration bit of line 8 */
  3341. #define EXTI_RTSR_TR9 ((uint32_t)0x00000200) /*!< Rising trigger event configuration bit of line 9 */
  3342. #define EXTI_RTSR_TR10 ((uint32_t)0x00000400) /*!< Rising trigger event configuration bit of line 10 */
  3343. #define EXTI_RTSR_TR11 ((uint32_t)0x00000800) /*!< Rising trigger event configuration bit of line 11 */
  3344. #define EXTI_RTSR_TR12 ((uint32_t)0x00001000) /*!< Rising trigger event configuration bit of line 12 */
  3345. #define EXTI_RTSR_TR13 ((uint32_t)0x00002000) /*!< Rising trigger event configuration bit of line 13 */
  3346. #define EXTI_RTSR_TR14 ((uint32_t)0x00004000) /*!< Rising trigger event configuration bit of line 14 */
  3347. #define EXTI_RTSR_TR15 ((uint32_t)0x00008000) /*!< Rising trigger event configuration bit of line 15 */
  3348. #define EXTI_RTSR_TR16 ((uint32_t)0x00010000) /*!< Rising trigger event configuration bit of line 16 */
  3349. #define EXTI_RTSR_TR17 ((uint32_t)0x00020000) /*!< Rising trigger event configuration bit of line 17 */
  3350. #define EXTI_RTSR_TR18 ((uint32_t)0x00040000) /*!< Rising trigger event configuration bit of line 18 */
  3351. #define EXTI_RTSR_TR19 ((uint32_t)0x00080000) /*!< Rising trigger event configuration bit of line 19 */
  3352. #define EXTI_RTSR_TR20 ((uint32_t)0x00100000) /*!< Rising trigger event configuration bit of line 20 */
  3353. #define EXTI_RTSR_TR21 ((uint32_t)0x00200000) /*!< Rising trigger event configuration bit of line 21 */
  3354. #define EXTI_RTSR_TR22 ((uint32_t)0x00400000) /*!< Rising trigger event configuration bit of line 22 */
  3355. #define EXTI_RTSR_TR23 ((uint32_t)0x00800000) /*!< Rising trigger event configuration bit of line 23 */
  3356. /****************** Bit definition for EXTI_FTSR register *******************/
  3357. #define EXTI_FTSR_TR0 ((uint32_t)0x00000001) /*!< Falling trigger event configuration bit of line 0 */
  3358. #define EXTI_FTSR_TR1 ((uint32_t)0x00000002) /*!< Falling trigger event configuration bit of line 1 */
  3359. #define EXTI_FTSR_TR2 ((uint32_t)0x00000004) /*!< Falling trigger event configuration bit of line 2 */
  3360. #define EXTI_FTSR_TR3 ((uint32_t)0x00000008) /*!< Falling trigger event configuration bit of line 3 */
  3361. #define EXTI_FTSR_TR4 ((uint32_t)0x00000010) /*!< Falling trigger event configuration bit of line 4 */
  3362. #define EXTI_FTSR_TR5 ((uint32_t)0x00000020) /*!< Falling trigger event configuration bit of line 5 */
  3363. #define EXTI_FTSR_TR6 ((uint32_t)0x00000040) /*!< Falling trigger event configuration bit of line 6 */
  3364. #define EXTI_FTSR_TR7 ((uint32_t)0x00000080) /*!< Falling trigger event configuration bit of line 7 */
  3365. #define EXTI_FTSR_TR8 ((uint32_t)0x00000100) /*!< Falling trigger event configuration bit of line 8 */
  3366. #define EXTI_FTSR_TR9 ((uint32_t)0x00000200) /*!< Falling trigger event configuration bit of line 9 */
  3367. #define EXTI_FTSR_TR10 ((uint32_t)0x00000400) /*!< Falling trigger event configuration bit of line 10 */
  3368. #define EXTI_FTSR_TR11 ((uint32_t)0x00000800) /*!< Falling trigger event configuration bit of line 11 */
  3369. #define EXTI_FTSR_TR12 ((uint32_t)0x00001000) /*!< Falling trigger event configuration bit of line 12 */
  3370. #define EXTI_FTSR_TR13 ((uint32_t)0x00002000) /*!< Falling trigger event configuration bit of line 13 */
  3371. #define EXTI_FTSR_TR14 ((uint32_t)0x00004000) /*!< Falling trigger event configuration bit of line 14 */
  3372. #define EXTI_FTSR_TR15 ((uint32_t)0x00008000) /*!< Falling trigger event configuration bit of line 15 */
  3373. #define EXTI_FTSR_TR16 ((uint32_t)0x00010000) /*!< Falling trigger event configuration bit of line 16 */
  3374. #define EXTI_FTSR_TR17 ((uint32_t)0x00020000) /*!< Falling trigger event configuration bit of line 17 */
  3375. #define EXTI_FTSR_TR18 ((uint32_t)0x00040000) /*!< Falling trigger event configuration bit of line 18 */
  3376. #define EXTI_FTSR_TR19 ((uint32_t)0x00080000) /*!< Falling trigger event configuration bit of line 19 */
  3377. #define EXTI_FTSR_TR20 ((uint32_t)0x00100000) /*!< Falling trigger event configuration bit of line 20 */
  3378. #define EXTI_FTSR_TR21 ((uint32_t)0x00200000) /*!< Falling trigger event configuration bit of line 21 */
  3379. #define EXTI_FTSR_TR22 ((uint32_t)0x00400000) /*!< Falling trigger event configuration bit of line 22 */
  3380. #define EXTI_FTSR_TR23 ((uint32_t)0x00800000) /*!< Falling trigger event configuration bit of line 23 */
  3381. /****************** Bit definition for EXTI_SWIER register ******************/
  3382. #define EXTI_SWIER_SWIER0 ((uint32_t)0x00000001) /*!< Software Interrupt on line 0 */
  3383. #define EXTI_SWIER_SWIER1 ((uint32_t)0x00000002) /*!< Software Interrupt on line 1 */
  3384. #define EXTI_SWIER_SWIER2 ((uint32_t)0x00000004) /*!< Software Interrupt on line 2 */
  3385. #define EXTI_SWIER_SWIER3 ((uint32_t)0x00000008) /*!< Software Interrupt on line 3 */
  3386. #define EXTI_SWIER_SWIER4 ((uint32_t)0x00000010) /*!< Software Interrupt on line 4 */
  3387. #define EXTI_SWIER_SWIER5 ((uint32_t)0x00000020) /*!< Software Interrupt on line 5 */
  3388. #define EXTI_SWIER_SWIER6 ((uint32_t)0x00000040) /*!< Software Interrupt on line 6 */
  3389. #define EXTI_SWIER_SWIER7 ((uint32_t)0x00000080) /*!< Software Interrupt on line 7 */
  3390. #define EXTI_SWIER_SWIER8 ((uint32_t)0x00000100) /*!< Software Interrupt on line 8 */
  3391. #define EXTI_SWIER_SWIER9 ((uint32_t)0x00000200) /*!< Software Interrupt on line 9 */
  3392. #define EXTI_SWIER_SWIER10 ((uint32_t)0x00000400) /*!< Software Interrupt on line 10 */
  3393. #define EXTI_SWIER_SWIER11 ((uint32_t)0x00000800) /*!< Software Interrupt on line 11 */
  3394. #define EXTI_SWIER_SWIER12 ((uint32_t)0x00001000) /*!< Software Interrupt on line 12 */
  3395. #define EXTI_SWIER_SWIER13 ((uint32_t)0x00002000) /*!< Software Interrupt on line 13 */
  3396. #define EXTI_SWIER_SWIER14 ((uint32_t)0x00004000) /*!< Software Interrupt on line 14 */
  3397. #define EXTI_SWIER_SWIER15 ((uint32_t)0x00008000) /*!< Software Interrupt on line 15 */
  3398. #define EXTI_SWIER_SWIER16 ((uint32_t)0x00010000) /*!< Software Interrupt on line 16 */
  3399. #define EXTI_SWIER_SWIER17 ((uint32_t)0x00020000) /*!< Software Interrupt on line 17 */
  3400. #define EXTI_SWIER_SWIER18 ((uint32_t)0x00040000) /*!< Software Interrupt on line 18 */
  3401. #define EXTI_SWIER_SWIER19 ((uint32_t)0x00080000) /*!< Software Interrupt on line 19 */
  3402. #define EXTI_SWIER_SWIER20 ((uint32_t)0x00100000) /*!< Software Interrupt on line 20 */
  3403. #define EXTI_SWIER_SWIER21 ((uint32_t)0x00200000) /*!< Software Interrupt on line 21 */
  3404. #define EXTI_SWIER_SWIER22 ((uint32_t)0x00400000) /*!< Software Interrupt on line 22 */
  3405. #define EXTI_SWIER_SWIER23 ((uint32_t)0x00800000) /*!< Software Interrupt on line 23 */
  3406. /******************* Bit definition for EXTI_PR register ********************/
  3407. #define EXTI_PR_PR0 ((uint32_t)0x00000001) /*!< Pending bit for line 0 */
  3408. #define EXTI_PR_PR1 ((uint32_t)0x00000002) /*!< Pending bit for line 1 */
  3409. #define EXTI_PR_PR2 ((uint32_t)0x00000004) /*!< Pending bit for line 2 */
  3410. #define EXTI_PR_PR3 ((uint32_t)0x00000008) /*!< Pending bit for line 3 */
  3411. #define EXTI_PR_PR4 ((uint32_t)0x00000010) /*!< Pending bit for line 4 */
  3412. #define EXTI_PR_PR5 ((uint32_t)0x00000020) /*!< Pending bit for line 5 */
  3413. #define EXTI_PR_PR6 ((uint32_t)0x00000040) /*!< Pending bit for line 6 */
  3414. #define EXTI_PR_PR7 ((uint32_t)0x00000080) /*!< Pending bit for line 7 */
  3415. #define EXTI_PR_PR8 ((uint32_t)0x00000100) /*!< Pending bit for line 8 */
  3416. #define EXTI_PR_PR9 ((uint32_t)0x00000200) /*!< Pending bit for line 9 */
  3417. #define EXTI_PR_PR10 ((uint32_t)0x00000400) /*!< Pending bit for line 10 */
  3418. #define EXTI_PR_PR11 ((uint32_t)0x00000800) /*!< Pending bit for line 11 */
  3419. #define EXTI_PR_PR12 ((uint32_t)0x00001000) /*!< Pending bit for line 12 */
  3420. #define EXTI_PR_PR13 ((uint32_t)0x00002000) /*!< Pending bit for line 13 */
  3421. #define EXTI_PR_PR14 ((uint32_t)0x00004000) /*!< Pending bit for line 14 */
  3422. #define EXTI_PR_PR15 ((uint32_t)0x00008000) /*!< Pending bit for line 15 */
  3423. #define EXTI_PR_PR16 ((uint32_t)0x00010000) /*!< Pending bit for line 16 */
  3424. #define EXTI_PR_PR17 ((uint32_t)0x00020000) /*!< Pending bit for line 17 */
  3425. #define EXTI_PR_PR18 ((uint32_t)0x00040000) /*!< Pending bit for line 18 */
  3426. #define EXTI_PR_PR19 ((uint32_t)0x00080000) /*!< Pending bit for line 19 */
  3427. #define EXTI_PR_PR20 ((uint32_t)0x00100000) /*!< Pending bit for line 20 */
  3428. #define EXTI_PR_PR21 ((uint32_t)0x00200000) /*!< Pending bit for line 21 */
  3429. #define EXTI_PR_PR22 ((uint32_t)0x00400000) /*!< Pending bit for line 22 */
  3430. #define EXTI_PR_PR23 ((uint32_t)0x00800000) /*!< Pending bit for line 23 */
  3431. /******************************************************************************/
  3432. /* */
  3433. /* FLASH */
  3434. /* */
  3435. /******************************************************************************/
  3436. /******************* Bits definition for FLASH_ACR register *****************/
  3437. #define FLASH_ACR_LATENCY ((uint32_t)0x0000000F)
  3438. #define FLASH_ACR_LATENCY_0WS ((uint32_t)0x00000000)
  3439. #define FLASH_ACR_LATENCY_1WS ((uint32_t)0x00000001)
  3440. #define FLASH_ACR_LATENCY_2WS ((uint32_t)0x00000002)
  3441. #define FLASH_ACR_LATENCY_3WS ((uint32_t)0x00000003)
  3442. #define FLASH_ACR_LATENCY_4WS ((uint32_t)0x00000004)
  3443. #define FLASH_ACR_LATENCY_5WS ((uint32_t)0x00000005)
  3444. #define FLASH_ACR_LATENCY_6WS ((uint32_t)0x00000006)
  3445. #define FLASH_ACR_LATENCY_7WS ((uint32_t)0x00000007)
  3446. #define FLASH_ACR_LATENCY_8WS ((uint32_t)0x00000008)
  3447. #define FLASH_ACR_LATENCY_9WS ((uint32_t)0x00000009)
  3448. #define FLASH_ACR_LATENCY_10WS ((uint32_t)0x0000000A)
  3449. #define FLASH_ACR_LATENCY_11WS ((uint32_t)0x0000000B)
  3450. #define FLASH_ACR_LATENCY_12WS ((uint32_t)0x0000000C)
  3451. #define FLASH_ACR_LATENCY_13WS ((uint32_t)0x0000000D)
  3452. #define FLASH_ACR_LATENCY_14WS ((uint32_t)0x0000000E)
  3453. #define FLASH_ACR_LATENCY_15WS ((uint32_t)0x0000000F)
  3454. #define FLASH_ACR_PRFTEN ((uint32_t)0x00000100)
  3455. #define FLASH_ACR_ARTEN ((uint32_t)0x00000200)
  3456. #define FLASH_ACR_ARTRST ((uint32_t)0x00000800)
  3457. /******************* Bits definition for FLASH_SR register ******************/
  3458. #define FLASH_SR_EOP ((uint32_t)0x00000001)
  3459. #define FLASH_SR_OPERR ((uint32_t)0x00000002)
  3460. #define FLASH_SR_WRPERR ((uint32_t)0x00000010)
  3461. #define FLASH_SR_PGAERR ((uint32_t)0x00000020)
  3462. #define FLASH_SR_PGPERR ((uint32_t)0x00000040)
  3463. #define FLASH_SR_ERSERR ((uint32_t)0x00000080)
  3464. #define FLASH_SR_BSY ((uint32_t)0x00010000)
  3465. /******************* Bits definition for FLASH_CR register ******************/
  3466. #define FLASH_CR_PG ((uint32_t)0x00000001)
  3467. #define FLASH_CR_SER ((uint32_t)0x00000002)
  3468. #define FLASH_CR_MER ((uint32_t)0x00000004)
  3469. #define FLASH_CR_SNB ((uint32_t)0x00000078)
  3470. #define FLASH_CR_SNB_0 ((uint32_t)0x00000008)
  3471. #define FLASH_CR_SNB_1 ((uint32_t)0x00000010)
  3472. #define FLASH_CR_SNB_2 ((uint32_t)0x00000020)
  3473. #define FLASH_CR_SNB_3 ((uint32_t)0x00000040)
  3474. #define FLASH_CR_PSIZE ((uint32_t)0x00000300)
  3475. #define FLASH_CR_PSIZE_0 ((uint32_t)0x00000100)
  3476. #define FLASH_CR_PSIZE_1 ((uint32_t)0x00000200)
  3477. #define FLASH_CR_STRT ((uint32_t)0x00010000)
  3478. #define FLASH_CR_EOPIE ((uint32_t)0x01000000)
  3479. #define FLASH_CR_ERRIE ((uint32_t)0x02000000)
  3480. #define FLASH_CR_LOCK ((uint32_t)0x80000000)
  3481. /******************* Bits definition for FLASH_OPTCR register ***************/
  3482. #define FLASH_OPTCR_OPTLOCK ((uint32_t)0x00000001)
  3483. #define FLASH_OPTCR_OPTSTRT ((uint32_t)0x00000002)
  3484. #define FLASH_OPTCR_BOR_LEV ((uint32_t)0x0000000C)
  3485. #define FLASH_OPTCR_BOR_LEV_0 ((uint32_t)0x00000004)
  3486. #define FLASH_OPTCR_BOR_LEV_1 ((uint32_t)0x00000008)
  3487. #define FLASH_OPTCR_WWDG_SW ((uint32_t)0x00000010)
  3488. #define FLASH_OPTCR_IWDG_SW ((uint32_t)0x00000020)
  3489. #define FLASH_OPTCR_nRST_STOP ((uint32_t)0x00000040)
  3490. #define FLASH_OPTCR_nRST_STDBY ((uint32_t)0x00000080)
  3491. #define FLASH_OPTCR_RDP ((uint32_t)0x0000FF00)
  3492. #define FLASH_OPTCR_RDP_0 ((uint32_t)0x00000100)
  3493. #define FLASH_OPTCR_RDP_1 ((uint32_t)0x00000200)
  3494. #define FLASH_OPTCR_RDP_2 ((uint32_t)0x00000400)
  3495. #define FLASH_OPTCR_RDP_3 ((uint32_t)0x00000800)
  3496. #define FLASH_OPTCR_RDP_4 ((uint32_t)0x00001000)
  3497. #define FLASH_OPTCR_RDP_5 ((uint32_t)0x00002000)
  3498. #define FLASH_OPTCR_RDP_6 ((uint32_t)0x00004000)
  3499. #define FLASH_OPTCR_RDP_7 ((uint32_t)0x00008000)
  3500. #define FLASH_OPTCR_nWRP ((uint32_t)0x00FF0000)
  3501. #define FLASH_OPTCR_nWRP_0 ((uint32_t)0x00010000)
  3502. #define FLASH_OPTCR_nWRP_1 ((uint32_t)0x00020000)
  3503. #define FLASH_OPTCR_nWRP_2 ((uint32_t)0x00040000)
  3504. #define FLASH_OPTCR_nWRP_3 ((uint32_t)0x00080000)
  3505. #define FLASH_OPTCR_nWRP_4 ((uint32_t)0x00100000)
  3506. #define FLASH_OPTCR_nWRP_5 ((uint32_t)0x00200000)
  3507. #define FLASH_OPTCR_nWRP_6 ((uint32_t)0x00400000)
  3508. #define FLASH_OPTCR_nWRP_7 ((uint32_t)0x00800000)
  3509. #define FLASH_OPTCR_IWDG_STDBY ((uint32_t)0x40000000)
  3510. #define FLASH_OPTCR_IWDG_STOP ((uint32_t)0x80000000)
  3511. /******************* Bits definition for FLASH_OPTCR1 register ***************/
  3512. #define FLASH_OPTCR1_BOOT_ADD0 ((uint32_t)0x0000FFFF)
  3513. #define FLASH_OPTCR1_BOOT_ADD1 ((uint32_t)0xFFFF0000)
  3514. /******************************************************************************/
  3515. /* */
  3516. /* Flexible Memory Controller */
  3517. /* */
  3518. /******************************************************************************/
  3519. /****************** Bit definition for FMC_BCR1 register *******************/
  3520. #define FMC_BCR1_MBKEN ((uint32_t)0x00000001) /*!<Memory bank enable bit */
  3521. #define FMC_BCR1_MUXEN ((uint32_t)0x00000002) /*!<Address/data multiplexing enable bit */
  3522. #define FMC_BCR1_MTYP ((uint32_t)0x0000000C) /*!<MTYP[1:0] bits (Memory type) */
  3523. #define FMC_BCR1_MTYP_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  3524. #define FMC_BCR1_MTYP_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  3525. #define FMC_BCR1_MWID ((uint32_t)0x00000030) /*!<MWID[1:0] bits (Memory data bus width) */
  3526. #define FMC_BCR1_MWID_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3527. #define FMC_BCR1_MWID_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3528. #define FMC_BCR1_FACCEN ((uint32_t)0x00000040) /*!<Flash access enable */
  3529. #define FMC_BCR1_BURSTEN ((uint32_t)0x00000100) /*!<Burst enable bit */
  3530. #define FMC_BCR1_WAITPOL ((uint32_t)0x00000200) /*!<Wait signal polarity bit */
  3531. #define FMC_BCR1_WRAPMOD ((uint32_t)0x00000400) /*!<Wrapped burst mode support */
  3532. #define FMC_BCR1_WAITCFG ((uint32_t)0x00000800) /*!<Wait timing configuration */
  3533. #define FMC_BCR1_WREN ((uint32_t)0x00001000) /*!<Write enable bit */
  3534. #define FMC_BCR1_WAITEN ((uint32_t)0x00002000) /*!<Wait enable bit */
  3535. #define FMC_BCR1_EXTMOD ((uint32_t)0x00004000) /*!<Extended mode enable */
  3536. #define FMC_BCR1_ASYNCWAIT ((uint32_t)0x00008000) /*!<Asynchronous wait */
  3537. #define FMC_BCR1_CPSIZE ((uint32_t)0x00070000) /*!<CRAM page size */
  3538. #define FMC_BCR1_CPSIZE_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3539. #define FMC_BCR1_CPSIZE_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3540. #define FMC_BCR1_CPSIZE_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3541. #define FMC_BCR1_CBURSTRW ((uint32_t)0x00080000) /*!<Write burst enable */
  3542. #define FMC_BCR1_CCLKEN ((uint32_t)0x00100000) /*!<Continous clock enable */
  3543. #define FMC_BCR1_WFDIS ((uint32_t)0x00200000) /*!<Write FIFO Disable */
  3544. /****************** Bit definition for FMC_BCR2 register *******************/
  3545. #define FMC_BCR2_MBKEN ((uint32_t)0x00000001) /*!<Memory bank enable bit */
  3546. #define FMC_BCR2_MUXEN ((uint32_t)0x00000002) /*!<Address/data multiplexing enable bit */
  3547. #define FMC_BCR2_MTYP ((uint32_t)0x0000000C) /*!<MTYP[1:0] bits (Memory type) */
  3548. #define FMC_BCR2_MTYP_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  3549. #define FMC_BCR2_MTYP_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  3550. #define FMC_BCR2_MWID ((uint32_t)0x00000030) /*!<MWID[1:0] bits (Memory data bus width) */
  3551. #define FMC_BCR2_MWID_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3552. #define FMC_BCR2_MWID_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3553. #define FMC_BCR2_FACCEN ((uint32_t)0x00000040) /*!<Flash access enable */
  3554. #define FMC_BCR2_BURSTEN ((uint32_t)0x00000100) /*!<Burst enable bit */
  3555. #define FMC_BCR2_WAITPOL ((uint32_t)0x00000200) /*!<Wait signal polarity bit */
  3556. #define FMC_BCR2_WRAPMOD ((uint32_t)0x00000400) /*!<Wrapped burst mode support */
  3557. #define FMC_BCR2_WAITCFG ((uint32_t)0x00000800) /*!<Wait timing configuration */
  3558. #define FMC_BCR2_WREN ((uint32_t)0x00001000) /*!<Write enable bit */
  3559. #define FMC_BCR2_WAITEN ((uint32_t)0x00002000) /*!<Wait enable bit */
  3560. #define FMC_BCR2_EXTMOD ((uint32_t)0x00004000) /*!<Extended mode enable */
  3561. #define FMC_BCR2_ASYNCWAIT ((uint32_t)0x00008000) /*!<Asynchronous wait */
  3562. #define FMC_BCR2_CPSIZE ((uint32_t)0x00070000) /*!<CRAM page size */
  3563. #define FMC_BCR2_CPSIZE_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3564. #define FMC_BCR2_CPSIZE_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3565. #define FMC_BCR2_CPSIZE_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3566. #define FMC_BCR2_CBURSTRW ((uint32_t)0x00080000) /*!<Write burst enable */
  3567. /****************** Bit definition for FMC_BCR3 register *******************/
  3568. #define FMC_BCR3_MBKEN ((uint32_t)0x00000001) /*!<Memory bank enable bit */
  3569. #define FMC_BCR3_MUXEN ((uint32_t)0x00000002) /*!<Address/data multiplexing enable bit */
  3570. #define FMC_BCR3_MTYP ((uint32_t)0x0000000C) /*!<MTYP[1:0] bits (Memory type) */
  3571. #define FMC_BCR3_MTYP_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  3572. #define FMC_BCR3_MTYP_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  3573. #define FMC_BCR3_MWID ((uint32_t)0x00000030) /*!<MWID[1:0] bits (Memory data bus width) */
  3574. #define FMC_BCR3_MWID_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3575. #define FMC_BCR3_MWID_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3576. #define FMC_BCR3_FACCEN ((uint32_t)0x00000040) /*!<Flash access enable */
  3577. #define FMC_BCR3_BURSTEN ((uint32_t)0x00000100) /*!<Burst enable bit */
  3578. #define FMC_BCR3_WAITPOL ((uint32_t)0x00000200) /*!<Wait signal polarity bit */
  3579. #define FMC_BCR3_WRAPMOD ((uint32_t)0x00000400) /*!<Wrapped burst mode support */
  3580. #define FMC_BCR3_WAITCFG ((uint32_t)0x00000800) /*!<Wait timing configuration */
  3581. #define FMC_BCR3_WREN ((uint32_t)0x00001000) /*!<Write enable bit */
  3582. #define FMC_BCR3_WAITEN ((uint32_t)0x00002000) /*!<Wait enable bit */
  3583. #define FMC_BCR3_EXTMOD ((uint32_t)0x00004000) /*!<Extended mode enable */
  3584. #define FMC_BCR3_ASYNCWAIT ((uint32_t)0x00008000) /*!<Asynchronous wait */
  3585. #define FMC_BCR3_CPSIZE ((uint32_t)0x00070000) /*!<CRAM page size */
  3586. #define FMC_BCR3_CPSIZE_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3587. #define FMC_BCR3_CPSIZE_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3588. #define FMC_BCR3_CPSIZE_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3589. #define FMC_BCR3_CBURSTRW ((uint32_t)0x00080000) /*!<Write burst enable */
  3590. /****************** Bit definition for FMC_BCR4 register *******************/
  3591. #define FMC_BCR4_MBKEN ((uint32_t)0x00000001) /*!<Memory bank enable bit */
  3592. #define FMC_BCR4_MUXEN ((uint32_t)0x00000002) /*!<Address/data multiplexing enable bit */
  3593. #define FMC_BCR4_MTYP ((uint32_t)0x0000000C) /*!<MTYP[1:0] bits (Memory type) */
  3594. #define FMC_BCR4_MTYP_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  3595. #define FMC_BCR4_MTYP_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  3596. #define FMC_BCR4_MWID ((uint32_t)0x00000030) /*!<MWID[1:0] bits (Memory data bus width) */
  3597. #define FMC_BCR4_MWID_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3598. #define FMC_BCR4_MWID_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3599. #define FMC_BCR4_FACCEN ((uint32_t)0x00000040) /*!<Flash access enable */
  3600. #define FMC_BCR4_BURSTEN ((uint32_t)0x00000100) /*!<Burst enable bit */
  3601. #define FMC_BCR4_WAITPOL ((uint32_t)0x00000200) /*!<Wait signal polarity bit */
  3602. #define FMC_BCR4_WRAPMOD ((uint32_t)0x00000400) /*!<Wrapped burst mode support */
  3603. #define FMC_BCR4_WAITCFG ((uint32_t)0x00000800) /*!<Wait timing configuration */
  3604. #define FMC_BCR4_WREN ((uint32_t)0x00001000) /*!<Write enable bit */
  3605. #define FMC_BCR4_WAITEN ((uint32_t)0x00002000) /*!<Wait enable bit */
  3606. #define FMC_BCR4_EXTMOD ((uint32_t)0x00004000) /*!<Extended mode enable */
  3607. #define FMC_BCR4_ASYNCWAIT ((uint32_t)0x00008000) /*!<Asynchronous wait */
  3608. #define FMC_BCR4_CPSIZE ((uint32_t)0x00070000) /*!<CRAM page size */
  3609. #define FMC_BCR4_CPSIZE_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3610. #define FMC_BCR4_CPSIZE_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3611. #define FMC_BCR4_CPSIZE_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3612. #define FMC_BCR4_CBURSTRW ((uint32_t)0x00080000) /*!<Write burst enable */
  3613. /****************** Bit definition for FMC_BTR1 register ******************/
  3614. #define FMC_BTR1_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  3615. #define FMC_BTR1_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3616. #define FMC_BTR1_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3617. #define FMC_BTR1_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3618. #define FMC_BTR1_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3619. #define FMC_BTR1_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  3620. #define FMC_BTR1_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3621. #define FMC_BTR1_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3622. #define FMC_BTR1_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3623. #define FMC_BTR1_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  3624. #define FMC_BTR1_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  3625. #define FMC_BTR1_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3626. #define FMC_BTR1_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3627. #define FMC_BTR1_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3628. #define FMC_BTR1_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3629. #define FMC_BTR1_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  3630. #define FMC_BTR1_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  3631. #define FMC_BTR1_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  3632. #define FMC_BTR1_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  3633. #define FMC_BTR1_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround phase duration) */
  3634. #define FMC_BTR1_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3635. #define FMC_BTR1_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3636. #define FMC_BTR1_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3637. #define FMC_BTR1_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  3638. #define FMC_BTR1_CLKDIV ((uint32_t)0x00F00000) /*!<CLKDIV[3:0] bits (Clock divide ratio) */
  3639. #define FMC_BTR1_CLKDIV_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  3640. #define FMC_BTR1_CLKDIV_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  3641. #define FMC_BTR1_CLKDIV_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  3642. #define FMC_BTR1_CLKDIV_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  3643. #define FMC_BTR1_DATLAT ((uint32_t)0x0F000000) /*!<DATLA[3:0] bits (Data latency) */
  3644. #define FMC_BTR1_DATLAT_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  3645. #define FMC_BTR1_DATLAT_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  3646. #define FMC_BTR1_DATLAT_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  3647. #define FMC_BTR1_DATLAT_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  3648. #define FMC_BTR1_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  3649. #define FMC_BTR1_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  3650. #define FMC_BTR1_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  3651. /****************** Bit definition for FMC_BTR2 register *******************/
  3652. #define FMC_BTR2_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  3653. #define FMC_BTR2_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3654. #define FMC_BTR2_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3655. #define FMC_BTR2_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3656. #define FMC_BTR2_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3657. #define FMC_BTR2_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  3658. #define FMC_BTR2_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3659. #define FMC_BTR2_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3660. #define FMC_BTR2_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3661. #define FMC_BTR2_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  3662. #define FMC_BTR2_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  3663. #define FMC_BTR2_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3664. #define FMC_BTR2_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3665. #define FMC_BTR2_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3666. #define FMC_BTR2_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3667. #define FMC_BTR2_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  3668. #define FMC_BTR2_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  3669. #define FMC_BTR2_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  3670. #define FMC_BTR2_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  3671. #define FMC_BTR2_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround phase duration) */
  3672. #define FMC_BTR2_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3673. #define FMC_BTR2_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3674. #define FMC_BTR2_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3675. #define FMC_BTR2_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  3676. #define FMC_BTR2_CLKDIV ((uint32_t)0x00F00000) /*!<CLKDIV[3:0] bits (Clock divide ratio) */
  3677. #define FMC_BTR2_CLKDIV_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  3678. #define FMC_BTR2_CLKDIV_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  3679. #define FMC_BTR2_CLKDIV_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  3680. #define FMC_BTR2_CLKDIV_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  3681. #define FMC_BTR2_DATLAT ((uint32_t)0x0F000000) /*!<DATLA[3:0] bits (Data latency) */
  3682. #define FMC_BTR2_DATLAT_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  3683. #define FMC_BTR2_DATLAT_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  3684. #define FMC_BTR2_DATLAT_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  3685. #define FMC_BTR2_DATLAT_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  3686. #define FMC_BTR2_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  3687. #define FMC_BTR2_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  3688. #define FMC_BTR2_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  3689. /******************* Bit definition for FMC_BTR3 register *******************/
  3690. #define FMC_BTR3_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  3691. #define FMC_BTR3_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3692. #define FMC_BTR3_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3693. #define FMC_BTR3_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3694. #define FMC_BTR3_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3695. #define FMC_BTR3_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  3696. #define FMC_BTR3_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3697. #define FMC_BTR3_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3698. #define FMC_BTR3_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3699. #define FMC_BTR3_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  3700. #define FMC_BTR3_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  3701. #define FMC_BTR3_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3702. #define FMC_BTR3_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3703. #define FMC_BTR3_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3704. #define FMC_BTR3_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3705. #define FMC_BTR3_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  3706. #define FMC_BTR3_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  3707. #define FMC_BTR3_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  3708. #define FMC_BTR3_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  3709. #define FMC_BTR3_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround phase duration) */
  3710. #define FMC_BTR3_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3711. #define FMC_BTR3_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3712. #define FMC_BTR3_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3713. #define FMC_BTR3_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  3714. #define FMC_BTR3_CLKDIV ((uint32_t)0x00F00000) /*!<CLKDIV[3:0] bits (Clock divide ratio) */
  3715. #define FMC_BTR3_CLKDIV_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  3716. #define FMC_BTR3_CLKDIV_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  3717. #define FMC_BTR3_CLKDIV_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  3718. #define FMC_BTR3_CLKDIV_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  3719. #define FMC_BTR3_DATLAT ((uint32_t)0x0F000000) /*!<DATLA[3:0] bits (Data latency) */
  3720. #define FMC_BTR3_DATLAT_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  3721. #define FMC_BTR3_DATLAT_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  3722. #define FMC_BTR3_DATLAT_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  3723. #define FMC_BTR3_DATLAT_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  3724. #define FMC_BTR3_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  3725. #define FMC_BTR3_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  3726. #define FMC_BTR3_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  3727. /****************** Bit definition for FMC_BTR4 register *******************/
  3728. #define FMC_BTR4_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  3729. #define FMC_BTR4_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3730. #define FMC_BTR4_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3731. #define FMC_BTR4_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3732. #define FMC_BTR4_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3733. #define FMC_BTR4_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  3734. #define FMC_BTR4_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3735. #define FMC_BTR4_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3736. #define FMC_BTR4_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3737. #define FMC_BTR4_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  3738. #define FMC_BTR4_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  3739. #define FMC_BTR4_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3740. #define FMC_BTR4_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3741. #define FMC_BTR4_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3742. #define FMC_BTR4_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3743. #define FMC_BTR4_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  3744. #define FMC_BTR4_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  3745. #define FMC_BTR4_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  3746. #define FMC_BTR4_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  3747. #define FMC_BTR4_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround phase duration) */
  3748. #define FMC_BTR4_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3749. #define FMC_BTR4_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3750. #define FMC_BTR4_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3751. #define FMC_BTR4_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  3752. #define FMC_BTR4_CLKDIV ((uint32_t)0x00F00000) /*!<CLKDIV[3:0] bits (Clock divide ratio) */
  3753. #define FMC_BTR4_CLKDIV_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  3754. #define FMC_BTR4_CLKDIV_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  3755. #define FMC_BTR4_CLKDIV_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  3756. #define FMC_BTR4_CLKDIV_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  3757. #define FMC_BTR4_DATLAT ((uint32_t)0x0F000000) /*!<DATLA[3:0] bits (Data latency) */
  3758. #define FMC_BTR4_DATLAT_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  3759. #define FMC_BTR4_DATLAT_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  3760. #define FMC_BTR4_DATLAT_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  3761. #define FMC_BTR4_DATLAT_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  3762. #define FMC_BTR4_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  3763. #define FMC_BTR4_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  3764. #define FMC_BTR4_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  3765. /****************** Bit definition for FMC_BWTR1 register ******************/
  3766. #define FMC_BWTR1_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  3767. #define FMC_BWTR1_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3768. #define FMC_BWTR1_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3769. #define FMC_BWTR1_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3770. #define FMC_BWTR1_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3771. #define FMC_BWTR1_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  3772. #define FMC_BWTR1_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3773. #define FMC_BWTR1_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3774. #define FMC_BWTR1_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3775. #define FMC_BWTR1_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  3776. #define FMC_BWTR1_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  3777. #define FMC_BWTR1_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3778. #define FMC_BWTR1_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3779. #define FMC_BWTR1_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3780. #define FMC_BWTR1_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3781. #define FMC_BWTR1_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  3782. #define FMC_BWTR1_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  3783. #define FMC_BWTR1_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  3784. #define FMC_BWTR1_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  3785. #define FMC_BWTR1_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround phase duration) */
  3786. #define FMC_BWTR1_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3787. #define FMC_BWTR1_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3788. #define FMC_BWTR1_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3789. #define FMC_BWTR1_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  3790. #define FMC_BWTR1_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  3791. #define FMC_BWTR1_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  3792. #define FMC_BWTR1_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  3793. /****************** Bit definition for FMC_BWTR2 register ******************/
  3794. #define FMC_BWTR2_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  3795. #define FMC_BWTR2_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3796. #define FMC_BWTR2_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3797. #define FMC_BWTR2_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3798. #define FMC_BWTR2_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3799. #define FMC_BWTR2_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  3800. #define FMC_BWTR2_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3801. #define FMC_BWTR2_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3802. #define FMC_BWTR2_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3803. #define FMC_BWTR2_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  3804. #define FMC_BWTR2_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  3805. #define FMC_BWTR2_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3806. #define FMC_BWTR2_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3807. #define FMC_BWTR2_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3808. #define FMC_BWTR2_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3809. #define FMC_BWTR2_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  3810. #define FMC_BWTR2_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  3811. #define FMC_BWTR2_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  3812. #define FMC_BWTR2_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  3813. #define FMC_BWTR2_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround phase duration) */
  3814. #define FMC_BWTR2_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3815. #define FMC_BWTR2_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3816. #define FMC_BWTR2_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3817. #define FMC_BWTR2_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  3818. #define FMC_BWTR2_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  3819. #define FMC_BWTR2_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  3820. #define FMC_BWTR2_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  3821. /****************** Bit definition for FMC_BWTR3 register ******************/
  3822. #define FMC_BWTR3_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  3823. #define FMC_BWTR3_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3824. #define FMC_BWTR3_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3825. #define FMC_BWTR3_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3826. #define FMC_BWTR3_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3827. #define FMC_BWTR3_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  3828. #define FMC_BWTR3_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3829. #define FMC_BWTR3_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3830. #define FMC_BWTR3_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3831. #define FMC_BWTR3_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  3832. #define FMC_BWTR3_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  3833. #define FMC_BWTR3_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3834. #define FMC_BWTR3_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3835. #define FMC_BWTR3_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3836. #define FMC_BWTR3_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3837. #define FMC_BWTR3_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  3838. #define FMC_BWTR3_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  3839. #define FMC_BWTR3_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  3840. #define FMC_BWTR3_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  3841. #define FMC_BWTR3_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround phase duration) */
  3842. #define FMC_BWTR3_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3843. #define FMC_BWTR3_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3844. #define FMC_BWTR3_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3845. #define FMC_BWTR3_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  3846. #define FMC_BWTR3_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  3847. #define FMC_BWTR3_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  3848. #define FMC_BWTR3_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  3849. /****************** Bit definition for FMC_BWTR4 register ******************/
  3850. #define FMC_BWTR4_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  3851. #define FMC_BWTR4_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3852. #define FMC_BWTR4_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3853. #define FMC_BWTR4_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3854. #define FMC_BWTR4_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3855. #define FMC_BWTR4_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  3856. #define FMC_BWTR4_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3857. #define FMC_BWTR4_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3858. #define FMC_BWTR4_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3859. #define FMC_BWTR4_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  3860. #define FMC_BWTR4_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  3861. #define FMC_BWTR4_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3862. #define FMC_BWTR4_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3863. #define FMC_BWTR4_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3864. #define FMC_BWTR4_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3865. #define FMC_BWTR4_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  3866. #define FMC_BWTR4_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  3867. #define FMC_BWTR4_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  3868. #define FMC_BWTR4_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  3869. #define FMC_BWTR4_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround phase duration) */
  3870. #define FMC_BWTR4_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3871. #define FMC_BWTR4_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3872. #define FMC_BWTR4_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3873. #define FMC_BWTR4_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  3874. #define FMC_BWTR4_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  3875. #define FMC_BWTR4_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  3876. #define FMC_BWTR4_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  3877. /****************** Bit definition for FMC_PCR register *******************/
  3878. #define FMC_PCR_PWAITEN ((uint32_t)0x00000002) /*!<Wait feature enable bit */
  3879. #define FMC_PCR_PBKEN ((uint32_t)0x00000004) /*!<PC Card/NAND Flash memory bank enable bit */
  3880. #define FMC_PCR_PTYP ((uint32_t)0x00000008) /*!<Memory type */
  3881. #define FMC_PCR_PWID ((uint32_t)0x00000030) /*!<PWID[1:0] bits (NAND Flash databus width) */
  3882. #define FMC_PCR_PWID_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3883. #define FMC_PCR_PWID_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3884. #define FMC_PCR_ECCEN ((uint32_t)0x00000040) /*!<ECC computation logic enable bit */
  3885. #define FMC_PCR_TCLR ((uint32_t)0x00001E00) /*!<TCLR[3:0] bits (CLE to RE delay) */
  3886. #define FMC_PCR_TCLR_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  3887. #define FMC_PCR_TCLR_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  3888. #define FMC_PCR_TCLR_2 ((uint32_t)0x00000800) /*!<Bit 2 */
  3889. #define FMC_PCR_TCLR_3 ((uint32_t)0x00001000) /*!<Bit 3 */
  3890. #define FMC_PCR_TAR ((uint32_t)0x0001E000) /*!<TAR[3:0] bits (ALE to RE delay) */
  3891. #define FMC_PCR_TAR_0 ((uint32_t)0x00002000) /*!<Bit 0 */
  3892. #define FMC_PCR_TAR_1 ((uint32_t)0x00004000) /*!<Bit 1 */
  3893. #define FMC_PCR_TAR_2 ((uint32_t)0x00008000) /*!<Bit 2 */
  3894. #define FMC_PCR_TAR_3 ((uint32_t)0x00010000) /*!<Bit 3 */
  3895. #define FMC_PCR_ECCPS ((uint32_t)0x000E0000) /*!<ECCPS[2:0] bits (ECC page size) */
  3896. #define FMC_PCR_ECCPS_0 ((uint32_t)0x00020000) /*!<Bit 0 */
  3897. #define FMC_PCR_ECCPS_1 ((uint32_t)0x00040000) /*!<Bit 1 */
  3898. #define FMC_PCR_ECCPS_2 ((uint32_t)0x00080000) /*!<Bit 2 */
  3899. /******************* Bit definition for FMC_SR register *******************/
  3900. #define FMC_SR_IRS ((uint32_t)0x01) /*!<Interrupt Rising Edge status */
  3901. #define FMC_SR_ILS ((uint32_t)0x02) /*!<Interrupt Level status */
  3902. #define FMC_SR_IFS ((uint32_t)0x04) /*!<Interrupt Falling Edge status */
  3903. #define FMC_SR_IREN ((uint32_t)0x08) /*!<Interrupt Rising Edge detection Enable bit */
  3904. #define FMC_SR_ILEN ((uint32_t)0x10) /*!<Interrupt Level detection Enable bit */
  3905. #define FMC_SR_IFEN ((uint32_t)0x20) /*!<Interrupt Falling Edge detection Enable bit */
  3906. #define FMC_SR_FEMPT ((uint32_t)0x40) /*!<FIFO empty */
  3907. /****************** Bit definition for FMC_PMEM register ******************/
  3908. #define FMC_PMEM_MEMSET3 ((uint32_t)0x000000FF) /*!<MEMSET3[7:0] bits (Common memory 3 setup time) */
  3909. #define FMC_PMEM_MEMSET3_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3910. #define FMC_PMEM_MEMSET3_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3911. #define FMC_PMEM_MEMSET3_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3912. #define FMC_PMEM_MEMSET3_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3913. #define FMC_PMEM_MEMSET3_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  3914. #define FMC_PMEM_MEMSET3_5 ((uint32_t)0x00000020) /*!<Bit 5 */
  3915. #define FMC_PMEM_MEMSET3_6 ((uint32_t)0x00000040) /*!<Bit 6 */
  3916. #define FMC_PMEM_MEMSET3_7 ((uint32_t)0x00000080) /*!<Bit 7 */
  3917. #define FMC_PMEM_MEMWAIT3 ((uint32_t)0x0000FF00) /*!<MEMWAIT3[7:0] bits (Common memory 3 wait time) */
  3918. #define FMC_PMEM_MEMWAIT3_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3919. #define FMC_PMEM_MEMWAIT3_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3920. #define FMC_PMEM_MEMWAIT3_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3921. #define FMC_PMEM_MEMWAIT3_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3922. #define FMC_PMEM_MEMWAIT3_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  3923. #define FMC_PMEM_MEMWAIT3_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  3924. #define FMC_PMEM_MEMWAIT3_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  3925. #define FMC_PMEM_MEMWAIT3_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  3926. #define FMC_PMEM_MEMHOLD3 ((uint32_t)0x00FF0000) /*!<MEMHOLD3[7:0] bits (Common memory 3 hold time) */
  3927. #define FMC_PMEM_MEMHOLD3_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3928. #define FMC_PMEM_MEMHOLD3_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3929. #define FMC_PMEM_MEMHOLD3_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3930. #define FMC_PMEM_MEMHOLD3_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  3931. #define FMC_PMEM_MEMHOLD3_4 ((uint32_t)0x00100000) /*!<Bit 4 */
  3932. #define FMC_PMEM_MEMHOLD3_5 ((uint32_t)0x00200000) /*!<Bit 5 */
  3933. #define FMC_PMEM_MEMHOLD3_6 ((uint32_t)0x00400000) /*!<Bit 6 */
  3934. #define FMC_PMEM_MEMHOLD3_7 ((uint32_t)0x00800000) /*!<Bit 7 */
  3935. #define FMC_PMEM_MEMHIZ3 ((uint32_t)0xFF000000) /*!<MEMHIZ3[7:0] bits (Common memory 3 databus HiZ time) */
  3936. #define FMC_PMEM_MEMHIZ3_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  3937. #define FMC_PMEM_MEMHIZ3_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  3938. #define FMC_PMEM_MEMHIZ3_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  3939. #define FMC_PMEM_MEMHIZ3_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  3940. #define FMC_PMEM_MEMHIZ3_4 ((uint32_t)0x10000000) /*!<Bit 4 */
  3941. #define FMC_PMEM_MEMHIZ3_5 ((uint32_t)0x20000000) /*!<Bit 5 */
  3942. #define FMC_PMEM_MEMHIZ3_6 ((uint32_t)0x40000000) /*!<Bit 6 */
  3943. #define FMC_PMEM_MEMHIZ3_7 ((uint32_t)0x80000000) /*!<Bit 7 */
  3944. /****************** Bit definition for FMC_PATT register ******************/
  3945. #define FMC_PATT_ATTSET3 ((uint32_t)0x000000FF) /*!<ATTSET3[7:0] bits (Attribute memory 3 setup time) */
  3946. #define FMC_PATT_ATTSET3_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3947. #define FMC_PATT_ATTSET3_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3948. #define FMC_PATT_ATTSET3_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3949. #define FMC_PATT_ATTSET3_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3950. #define FMC_PATT_ATTSET3_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  3951. #define FMC_PATT_ATTSET3_5 ((uint32_t)0x00000020) /*!<Bit 5 */
  3952. #define FMC_PATT_ATTSET3_6 ((uint32_t)0x00000040) /*!<Bit 6 */
  3953. #define FMC_PATT_ATTSET3_7 ((uint32_t)0x00000080) /*!<Bit 7 */
  3954. #define FMC_PATT_ATTWAIT3 ((uint32_t)0x0000FF00) /*!<ATTWAIT3[7:0] bits (Attribute memory 3 wait time) */
  3955. #define FMC_PATT_ATTWAIT3_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3956. #define FMC_PATT_ATTWAIT3_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3957. #define FMC_PATT_ATTWAIT3_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3958. #define FMC_PATT_ATTWAIT3_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3959. #define FMC_PATT_ATTWAIT3_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  3960. #define FMC_PATT_ATTWAIT3_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  3961. #define FMC_PATT_ATTWAIT3_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  3962. #define FMC_PATT_ATTWAIT3_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  3963. #define FMC_PATT_ATTHOLD3 ((uint32_t)0x00FF0000) /*!<ATTHOLD3[7:0] bits (Attribute memory 3 hold time) */
  3964. #define FMC_PATT_ATTHOLD3_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3965. #define FMC_PATT_ATTHOLD3_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3966. #define FMC_PATT_ATTHOLD3_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3967. #define FMC_PATT_ATTHOLD3_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  3968. #define FMC_PATT_ATTHOLD3_4 ((uint32_t)0x00100000) /*!<Bit 4 */
  3969. #define FMC_PATT_ATTHOLD3_5 ((uint32_t)0x00200000) /*!<Bit 5 */
  3970. #define FMC_PATT_ATTHOLD3_6 ((uint32_t)0x00400000) /*!<Bit 6 */
  3971. #define FMC_PATT_ATTHOLD3_7 ((uint32_t)0x00800000) /*!<Bit 7 */
  3972. #define FMC_PATT_ATTHIZ3 ((uint32_t)0xFF000000) /*!<ATTHIZ3[7:0] bits (Attribute memory 3 databus HiZ time) */
  3973. #define FMC_PATT_ATTHIZ3_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  3974. #define FMC_PATT_ATTHIZ3_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  3975. #define FMC_PATT_ATTHIZ3_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  3976. #define FMC_PATT_ATTHIZ3_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  3977. #define FMC_PATT_ATTHIZ3_4 ((uint32_t)0x10000000) /*!<Bit 4 */
  3978. #define FMC_PATT_ATTHIZ3_5 ((uint32_t)0x20000000) /*!<Bit 5 */
  3979. #define FMC_PATT_ATTHIZ3_6 ((uint32_t)0x40000000) /*!<Bit 6 */
  3980. #define FMC_PATT_ATTHIZ3_7 ((uint32_t)0x80000000) /*!<Bit 7 */
  3981. /****************** Bit definition for FMC_ECCR register ******************/
  3982. #define FMC_ECCR_ECC3 ((uint32_t)0xFFFFFFFF) /*!<ECC result */
  3983. /****************** Bit definition for FMC_SDCR1 register ******************/
  3984. #define FMC_SDCR1_NC ((uint32_t)0x00000003) /*!<NC[1:0] bits (Number of column bits) */
  3985. #define FMC_SDCR1_NC_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3986. #define FMC_SDCR1_NC_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3987. #define FMC_SDCR1_NR ((uint32_t)0x0000000C) /*!<NR[1:0] bits (Number of row bits) */
  3988. #define FMC_SDCR1_NR_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  3989. #define FMC_SDCR1_NR_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  3990. #define FMC_SDCR1_MWID ((uint32_t)0x00000030) /*!<NR[1:0] bits (Number of row bits) */
  3991. #define FMC_SDCR1_MWID_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3992. #define FMC_SDCR1_MWID_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3993. #define FMC_SDCR1_NB ((uint32_t)0x00000040) /*!<Number of internal bank */
  3994. #define FMC_SDCR1_CAS ((uint32_t)0x00000180) /*!<CAS[1:0] bits (CAS latency) */
  3995. #define FMC_SDCR1_CAS_0 ((uint32_t)0x00000080) /*!<Bit 0 */
  3996. #define FMC_SDCR1_CAS_1 ((uint32_t)0x00000100) /*!<Bit 1 */
  3997. #define FMC_SDCR1_WP ((uint32_t)0x00000200) /*!<Write protection */
  3998. #define FMC_SDCR1_SDCLK ((uint32_t)0x00000C00) /*!<SDRAM clock configuration */
  3999. #define FMC_SDCR1_SDCLK_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  4000. #define FMC_SDCR1_SDCLK_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  4001. #define FMC_SDCR1_RBURST ((uint32_t)0x00001000) /*!<Read burst */
  4002. #define FMC_SDCR1_RPIPE ((uint32_t)0x00006000) /*!<Write protection */
  4003. #define FMC_SDCR1_RPIPE_0 ((uint32_t)0x00002000) /*!<Bit 0 */
  4004. #define FMC_SDCR1_RPIPE_1 ((uint32_t)0x00004000) /*!<Bit 1 */
  4005. /****************** Bit definition for FMC_SDCR2 register ******************/
  4006. #define FMC_SDCR2_NC ((uint32_t)0x00000003) /*!<NC[1:0] bits (Number of column bits) */
  4007. #define FMC_SDCR2_NC_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4008. #define FMC_SDCR2_NC_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4009. #define FMC_SDCR2_NR ((uint32_t)0x0000000C) /*!<NR[1:0] bits (Number of row bits) */
  4010. #define FMC_SDCR2_NR_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  4011. #define FMC_SDCR2_NR_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  4012. #define FMC_SDCR2_MWID ((uint32_t)0x00000030) /*!<NR[1:0] bits (Number of row bits) */
  4013. #define FMC_SDCR2_MWID_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4014. #define FMC_SDCR2_MWID_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4015. #define FMC_SDCR2_NB ((uint32_t)0x00000040) /*!<Number of internal bank */
  4016. #define FMC_SDCR2_CAS ((uint32_t)0x00000180) /*!<CAS[1:0] bits (CAS latency) */
  4017. #define FMC_SDCR2_CAS_0 ((uint32_t)0x00000080) /*!<Bit 0 */
  4018. #define FMC_SDCR2_CAS_1 ((uint32_t)0x00000100) /*!<Bit 1 */
  4019. #define FMC_SDCR2_WP ((uint32_t)0x00000200) /*!<Write protection */
  4020. #define FMC_SDCR2_SDCLK ((uint32_t)0x00000C00) /*!<SDCLK[1:0] (SDRAM clock configuration) */
  4021. #define FMC_SDCR2_SDCLK_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  4022. #define FMC_SDCR2_SDCLK_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  4023. #define FMC_SDCR2_RBURST ((uint32_t)0x00001000) /*!<Read burst */
  4024. #define FMC_SDCR2_RPIPE ((uint32_t)0x00006000) /*!<RPIPE[1:0](Read pipe) */
  4025. #define FMC_SDCR2_RPIPE_0 ((uint32_t)0x00002000) /*!<Bit 0 */
  4026. #define FMC_SDCR2_RPIPE_1 ((uint32_t)0x00004000) /*!<Bit 1 */
  4027. /****************** Bit definition for FMC_SDTR1 register ******************/
  4028. #define FMC_SDTR1_TMRD ((uint32_t)0x0000000F) /*!<TMRD[3:0] bits (Load mode register to active) */
  4029. #define FMC_SDTR1_TMRD_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4030. #define FMC_SDTR1_TMRD_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4031. #define FMC_SDTR1_TMRD_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  4032. #define FMC_SDTR1_TMRD_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  4033. #define FMC_SDTR1_TXSR ((uint32_t)0x000000F0) /*!<TXSR[3:0] bits (Exit self refresh) */
  4034. #define FMC_SDTR1_TXSR_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4035. #define FMC_SDTR1_TXSR_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4036. #define FMC_SDTR1_TXSR_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  4037. #define FMC_SDTR1_TXSR_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  4038. #define FMC_SDTR1_TRAS ((uint32_t)0x00000F00) /*!<TRAS[3:0] bits (Self refresh time) */
  4039. #define FMC_SDTR1_TRAS_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  4040. #define FMC_SDTR1_TRAS_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  4041. #define FMC_SDTR1_TRAS_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  4042. #define FMC_SDTR1_TRAS_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  4043. #define FMC_SDTR1_TRC ((uint32_t)0x0000F000) /*!<TRC[2:0] bits (Row cycle delay) */
  4044. #define FMC_SDTR1_TRC_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  4045. #define FMC_SDTR1_TRC_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  4046. #define FMC_SDTR1_TRC_2 ((uint32_t)0x00004000) /*!<Bit 2 */
  4047. #define FMC_SDTR1_TWR ((uint32_t)0x000F0000) /*!<TRC[2:0] bits (Write recovery delay) */
  4048. #define FMC_SDTR1_TWR_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  4049. #define FMC_SDTR1_TWR_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  4050. #define FMC_SDTR1_TWR_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  4051. #define FMC_SDTR1_TRP ((uint32_t)0x00F00000) /*!<TRP[2:0] bits (Row precharge delay) */
  4052. #define FMC_SDTR1_TRP_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  4053. #define FMC_SDTR1_TRP_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  4054. #define FMC_SDTR1_TRP_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  4055. #define FMC_SDTR1_TRCD ((uint32_t)0x0F000000) /*!<TRP[2:0] bits (Row to column delay) */
  4056. #define FMC_SDTR1_TRCD_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  4057. #define FMC_SDTR1_TRCD_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  4058. #define FMC_SDTR1_TRCD_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  4059. /****************** Bit definition for FMC_SDTR2 register ******************/
  4060. #define FMC_SDTR2_TMRD ((uint32_t)0x0000000F) /*!<TMRD[3:0] bits (Load mode register to active) */
  4061. #define FMC_SDTR2_TMRD_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4062. #define FMC_SDTR2_TMRD_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4063. #define FMC_SDTR2_TMRD_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  4064. #define FMC_SDTR2_TMRD_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  4065. #define FMC_SDTR2_TXSR ((uint32_t)0x000000F0) /*!<TXSR[3:0] bits (Exit self refresh) */
  4066. #define FMC_SDTR2_TXSR_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4067. #define FMC_SDTR2_TXSR_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4068. #define FMC_SDTR2_TXSR_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  4069. #define FMC_SDTR2_TXSR_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  4070. #define FMC_SDTR2_TRAS ((uint32_t)0x00000F00) /*!<TRAS[3:0] bits (Self refresh time) */
  4071. #define FMC_SDTR2_TRAS_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  4072. #define FMC_SDTR2_TRAS_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  4073. #define FMC_SDTR2_TRAS_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  4074. #define FMC_SDTR2_TRAS_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  4075. #define FMC_SDTR2_TRC ((uint32_t)0x0000F000) /*!<TRC[2:0] bits (Row cycle delay) */
  4076. #define FMC_SDTR2_TRC_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  4077. #define FMC_SDTR2_TRC_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  4078. #define FMC_SDTR2_TRC_2 ((uint32_t)0x00004000) /*!<Bit 2 */
  4079. #define FMC_SDTR2_TWR ((uint32_t)0x000F0000) /*!<TRC[2:0] bits (Write recovery delay) */
  4080. #define FMC_SDTR2_TWR_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  4081. #define FMC_SDTR2_TWR_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  4082. #define FMC_SDTR2_TWR_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  4083. #define FMC_SDTR2_TRP ((uint32_t)0x00F00000) /*!<TRP[2:0] bits (Row precharge delay) */
  4084. #define FMC_SDTR2_TRP_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  4085. #define FMC_SDTR2_TRP_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  4086. #define FMC_SDTR2_TRP_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  4087. #define FMC_SDTR2_TRCD ((uint32_t)0x0F000000) /*!<TRP[2:0] bits (Row to column delay) */
  4088. #define FMC_SDTR2_TRCD_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  4089. #define FMC_SDTR2_TRCD_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  4090. #define FMC_SDTR2_TRCD_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  4091. /****************** Bit definition for FMC_SDCMR register ******************/
  4092. #define FMC_SDCMR_MODE ((uint32_t)0x00000007) /*!<MODE[2:0] bits (Command mode) */
  4093. #define FMC_SDCMR_MODE_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4094. #define FMC_SDCMR_MODE_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4095. #define FMC_SDCMR_MODE_2 ((uint32_t)0x00000003) /*!<Bit 2 */
  4096. #define FMC_SDCMR_CTB2 ((uint32_t)0x00000008) /*!<Command target 2 */
  4097. #define FMC_SDCMR_CTB1 ((uint32_t)0x00000010) /*!<Command target 1 */
  4098. #define FMC_SDCMR_NRFS ((uint32_t)0x000001E0) /*!<NRFS[3:0] bits (Number of auto-refresh) */
  4099. #define FMC_SDCMR_NRFS_0 ((uint32_t)0x00000020) /*!<Bit 0 */
  4100. #define FMC_SDCMR_NRFS_1 ((uint32_t)0x00000040) /*!<Bit 1 */
  4101. #define FMC_SDCMR_NRFS_2 ((uint32_t)0x00000080) /*!<Bit 2 */
  4102. #define FMC_SDCMR_NRFS_3 ((uint32_t)0x00000100) /*!<Bit 3 */
  4103. #define FMC_SDCMR_MRD ((uint32_t)0x003FFE00) /*!<MRD[12:0] bits (Mode register definition) */
  4104. /****************** Bit definition for FMC_SDRTR register ******************/
  4105. #define FMC_SDRTR_CRE ((uint32_t)0x00000001) /*!<Clear refresh error flag */
  4106. #define FMC_SDRTR_COUNT ((uint32_t)0x00003FFE) /*!<COUNT[12:0] bits (Refresh timer count) */
  4107. #define FMC_SDRTR_REIE ((uint32_t)0x00004000) /*!<RES interupt enable */
  4108. /****************** Bit definition for FMC_SDSR register ******************/
  4109. #define FMC_SDSR_RE ((uint32_t)0x00000001) /*!<Refresh error flag */
  4110. #define FMC_SDSR_MODES1 ((uint32_t)0x00000006) /*!<MODES1[1:0]bits (Status mode for bank 1) */
  4111. #define FMC_SDSR_MODES1_0 ((uint32_t)0x00000002) /*!<Bit 0 */
  4112. #define FMC_SDSR_MODES1_1 ((uint32_t)0x00000004) /*!<Bit 1 */
  4113. #define FMC_SDSR_MODES2 ((uint32_t)0x00000018) /*!<MODES2[1:0]bits (Status mode for bank 2) */
  4114. #define FMC_SDSR_MODES2_0 ((uint32_t)0x00000008) /*!<Bit 0 */
  4115. #define FMC_SDSR_MODES2_1 ((uint32_t)0x00000010) /*!<Bit 1 */
  4116. #define FMC_SDSR_BUSY ((uint32_t)0x00000020) /*!<Busy status */
  4117. /******************************************************************************/
  4118. /* */
  4119. /* General Purpose I/O */
  4120. /* */
  4121. /******************************************************************************/
  4122. /****************** Bits definition for GPIO_MODER register *****************/
  4123. #define GPIO_MODER_MODER0 ((uint32_t)0x00000003)
  4124. #define GPIO_MODER_MODER0_0 ((uint32_t)0x00000001)
  4125. #define GPIO_MODER_MODER0_1 ((uint32_t)0x00000002)
  4126. #define GPIO_MODER_MODER1 ((uint32_t)0x0000000C)
  4127. #define GPIO_MODER_MODER1_0 ((uint32_t)0x00000004)
  4128. #define GPIO_MODER_MODER1_1 ((uint32_t)0x00000008)
  4129. #define GPIO_MODER_MODER2 ((uint32_t)0x00000030)
  4130. #define GPIO_MODER_MODER2_0 ((uint32_t)0x00000010)
  4131. #define GPIO_MODER_MODER2_1 ((uint32_t)0x00000020)
  4132. #define GPIO_MODER_MODER3 ((uint32_t)0x000000C0)
  4133. #define GPIO_MODER_MODER3_0 ((uint32_t)0x00000040)
  4134. #define GPIO_MODER_MODER3_1 ((uint32_t)0x00000080)
  4135. #define GPIO_MODER_MODER4 ((uint32_t)0x00000300)
  4136. #define GPIO_MODER_MODER4_0 ((uint32_t)0x00000100)
  4137. #define GPIO_MODER_MODER4_1 ((uint32_t)0x00000200)
  4138. #define GPIO_MODER_MODER5 ((uint32_t)0x00000C00)
  4139. #define GPIO_MODER_MODER5_0 ((uint32_t)0x00000400)
  4140. #define GPIO_MODER_MODER5_1 ((uint32_t)0x00000800)
  4141. #define GPIO_MODER_MODER6 ((uint32_t)0x00003000)
  4142. #define GPIO_MODER_MODER6_0 ((uint32_t)0x00001000)
  4143. #define GPIO_MODER_MODER6_1 ((uint32_t)0x00002000)
  4144. #define GPIO_MODER_MODER7 ((uint32_t)0x0000C000)
  4145. #define GPIO_MODER_MODER7_0 ((uint32_t)0x00004000)
  4146. #define GPIO_MODER_MODER7_1 ((uint32_t)0x00008000)
  4147. #define GPIO_MODER_MODER8 ((uint32_t)0x00030000)
  4148. #define GPIO_MODER_MODER8_0 ((uint32_t)0x00010000)
  4149. #define GPIO_MODER_MODER8_1 ((uint32_t)0x00020000)
  4150. #define GPIO_MODER_MODER9 ((uint32_t)0x000C0000)
  4151. #define GPIO_MODER_MODER9_0 ((uint32_t)0x00040000)
  4152. #define GPIO_MODER_MODER9_1 ((uint32_t)0x00080000)
  4153. #define GPIO_MODER_MODER10 ((uint32_t)0x00300000)
  4154. #define GPIO_MODER_MODER10_0 ((uint32_t)0x00100000)
  4155. #define GPIO_MODER_MODER10_1 ((uint32_t)0x00200000)
  4156. #define GPIO_MODER_MODER11 ((uint32_t)0x00C00000)
  4157. #define GPIO_MODER_MODER11_0 ((uint32_t)0x00400000)
  4158. #define GPIO_MODER_MODER11_1 ((uint32_t)0x00800000)
  4159. #define GPIO_MODER_MODER12 ((uint32_t)0x03000000)
  4160. #define GPIO_MODER_MODER12_0 ((uint32_t)0x01000000)
  4161. #define GPIO_MODER_MODER12_1 ((uint32_t)0x02000000)
  4162. #define GPIO_MODER_MODER13 ((uint32_t)0x0C000000)
  4163. #define GPIO_MODER_MODER13_0 ((uint32_t)0x04000000)
  4164. #define GPIO_MODER_MODER13_1 ((uint32_t)0x08000000)
  4165. #define GPIO_MODER_MODER14 ((uint32_t)0x30000000)
  4166. #define GPIO_MODER_MODER14_0 ((uint32_t)0x10000000)
  4167. #define GPIO_MODER_MODER14_1 ((uint32_t)0x20000000)
  4168. #define GPIO_MODER_MODER15 ((uint32_t)0xC0000000)
  4169. #define GPIO_MODER_MODER15_0 ((uint32_t)0x40000000)
  4170. #define GPIO_MODER_MODER15_1 ((uint32_t)0x80000000)
  4171. /****************** Bits definition for GPIO_OTYPER register ****************/
  4172. #define GPIO_OTYPER_OT_0 ((uint32_t)0x00000001)
  4173. #define GPIO_OTYPER_OT_1 ((uint32_t)0x00000002)
  4174. #define GPIO_OTYPER_OT_2 ((uint32_t)0x00000004)
  4175. #define GPIO_OTYPER_OT_3 ((uint32_t)0x00000008)
  4176. #define GPIO_OTYPER_OT_4 ((uint32_t)0x00000010)
  4177. #define GPIO_OTYPER_OT_5 ((uint32_t)0x00000020)
  4178. #define GPIO_OTYPER_OT_6 ((uint32_t)0x00000040)
  4179. #define GPIO_OTYPER_OT_7 ((uint32_t)0x00000080)
  4180. #define GPIO_OTYPER_OT_8 ((uint32_t)0x00000100)
  4181. #define GPIO_OTYPER_OT_9 ((uint32_t)0x00000200)
  4182. #define GPIO_OTYPER_OT_10 ((uint32_t)0x00000400)
  4183. #define GPIO_OTYPER_OT_11 ((uint32_t)0x00000800)
  4184. #define GPIO_OTYPER_OT_12 ((uint32_t)0x00001000)
  4185. #define GPIO_OTYPER_OT_13 ((uint32_t)0x00002000)
  4186. #define GPIO_OTYPER_OT_14 ((uint32_t)0x00004000)
  4187. #define GPIO_OTYPER_OT_15 ((uint32_t)0x00008000)
  4188. /****************** Bits definition for GPIO_OSPEEDR register ***************/
  4189. #define GPIO_OSPEEDER_OSPEEDR0 ((uint32_t)0x00000003)
  4190. #define GPIO_OSPEEDER_OSPEEDR0_0 ((uint32_t)0x00000001)
  4191. #define GPIO_OSPEEDER_OSPEEDR0_1 ((uint32_t)0x00000002)
  4192. #define GPIO_OSPEEDER_OSPEEDR1 ((uint32_t)0x0000000C)
  4193. #define GPIO_OSPEEDER_OSPEEDR1_0 ((uint32_t)0x00000004)
  4194. #define GPIO_OSPEEDER_OSPEEDR1_1 ((uint32_t)0x00000008)
  4195. #define GPIO_OSPEEDER_OSPEEDR2 ((uint32_t)0x00000030)
  4196. #define GPIO_OSPEEDER_OSPEEDR2_0 ((uint32_t)0x00000010)
  4197. #define GPIO_OSPEEDER_OSPEEDR2_1 ((uint32_t)0x00000020)
  4198. #define GPIO_OSPEEDER_OSPEEDR3 ((uint32_t)0x000000C0)
  4199. #define GPIO_OSPEEDER_OSPEEDR3_0 ((uint32_t)0x00000040)
  4200. #define GPIO_OSPEEDER_OSPEEDR3_1 ((uint32_t)0x00000080)
  4201. #define GPIO_OSPEEDER_OSPEEDR4 ((uint32_t)0x00000300)
  4202. #define GPIO_OSPEEDER_OSPEEDR4_0 ((uint32_t)0x00000100)
  4203. #define GPIO_OSPEEDER_OSPEEDR4_1 ((uint32_t)0x00000200)
  4204. #define GPIO_OSPEEDER_OSPEEDR5 ((uint32_t)0x00000C00)
  4205. #define GPIO_OSPEEDER_OSPEEDR5_0 ((uint32_t)0x00000400)
  4206. #define GPIO_OSPEEDER_OSPEEDR5_1 ((uint32_t)0x00000800)
  4207. #define GPIO_OSPEEDER_OSPEEDR6 ((uint32_t)0x00003000)
  4208. #define GPIO_OSPEEDER_OSPEEDR6_0 ((uint32_t)0x00001000)
  4209. #define GPIO_OSPEEDER_OSPEEDR6_1 ((uint32_t)0x00002000)
  4210. #define GPIO_OSPEEDER_OSPEEDR7 ((uint32_t)0x0000C000)
  4211. #define GPIO_OSPEEDER_OSPEEDR7_0 ((uint32_t)0x00004000)
  4212. #define GPIO_OSPEEDER_OSPEEDR7_1 ((uint32_t)0x00008000)
  4213. #define GPIO_OSPEEDER_OSPEEDR8 ((uint32_t)0x00030000)
  4214. #define GPIO_OSPEEDER_OSPEEDR8_0 ((uint32_t)0x00010000)
  4215. #define GPIO_OSPEEDER_OSPEEDR8_1 ((uint32_t)0x00020000)
  4216. #define GPIO_OSPEEDER_OSPEEDR9 ((uint32_t)0x000C0000)
  4217. #define GPIO_OSPEEDER_OSPEEDR9_0 ((uint32_t)0x00040000)
  4218. #define GPIO_OSPEEDER_OSPEEDR9_1 ((uint32_t)0x00080000)
  4219. #define GPIO_OSPEEDER_OSPEEDR10 ((uint32_t)0x00300000)
  4220. #define GPIO_OSPEEDER_OSPEEDR10_0 ((uint32_t)0x00100000)
  4221. #define GPIO_OSPEEDER_OSPEEDR10_1 ((uint32_t)0x00200000)
  4222. #define GPIO_OSPEEDER_OSPEEDR11 ((uint32_t)0x00C00000)
  4223. #define GPIO_OSPEEDER_OSPEEDR11_0 ((uint32_t)0x00400000)
  4224. #define GPIO_OSPEEDER_OSPEEDR11_1 ((uint32_t)0x00800000)
  4225. #define GPIO_OSPEEDER_OSPEEDR12 ((uint32_t)0x03000000)
  4226. #define GPIO_OSPEEDER_OSPEEDR12_0 ((uint32_t)0x01000000)
  4227. #define GPIO_OSPEEDER_OSPEEDR12_1 ((uint32_t)0x02000000)
  4228. #define GPIO_OSPEEDER_OSPEEDR13 ((uint32_t)0x0C000000)
  4229. #define GPIO_OSPEEDER_OSPEEDR13_0 ((uint32_t)0x04000000)
  4230. #define GPIO_OSPEEDER_OSPEEDR13_1 ((uint32_t)0x08000000)
  4231. #define GPIO_OSPEEDER_OSPEEDR14 ((uint32_t)0x30000000)
  4232. #define GPIO_OSPEEDER_OSPEEDR14_0 ((uint32_t)0x10000000)
  4233. #define GPIO_OSPEEDER_OSPEEDR14_1 ((uint32_t)0x20000000)
  4234. #define GPIO_OSPEEDER_OSPEEDR15 ((uint32_t)0xC0000000)
  4235. #define GPIO_OSPEEDER_OSPEEDR15_0 ((uint32_t)0x40000000)
  4236. #define GPIO_OSPEEDER_OSPEEDR15_1 ((uint32_t)0x80000000)
  4237. /****************** Bits definition for GPIO_PUPDR register *****************/
  4238. #define GPIO_PUPDR_PUPDR0 ((uint32_t)0x00000003)
  4239. #define GPIO_PUPDR_PUPDR0_0 ((uint32_t)0x00000001)
  4240. #define GPIO_PUPDR_PUPDR0_1 ((uint32_t)0x00000002)
  4241. #define GPIO_PUPDR_PUPDR1 ((uint32_t)0x0000000C)
  4242. #define GPIO_PUPDR_PUPDR1_0 ((uint32_t)0x00000004)
  4243. #define GPIO_PUPDR_PUPDR1_1 ((uint32_t)0x00000008)
  4244. #define GPIO_PUPDR_PUPDR2 ((uint32_t)0x00000030)
  4245. #define GPIO_PUPDR_PUPDR2_0 ((uint32_t)0x00000010)
  4246. #define GPIO_PUPDR_PUPDR2_1 ((uint32_t)0x00000020)
  4247. #define GPIO_PUPDR_PUPDR3 ((uint32_t)0x000000C0)
  4248. #define GPIO_PUPDR_PUPDR3_0 ((uint32_t)0x00000040)
  4249. #define GPIO_PUPDR_PUPDR3_1 ((uint32_t)0x00000080)
  4250. #define GPIO_PUPDR_PUPDR4 ((uint32_t)0x00000300)
  4251. #define GPIO_PUPDR_PUPDR4_0 ((uint32_t)0x00000100)
  4252. #define GPIO_PUPDR_PUPDR4_1 ((uint32_t)0x00000200)
  4253. #define GPIO_PUPDR_PUPDR5 ((uint32_t)0x00000C00)
  4254. #define GPIO_PUPDR_PUPDR5_0 ((uint32_t)0x00000400)
  4255. #define GPIO_PUPDR_PUPDR5_1 ((uint32_t)0x00000800)
  4256. #define GPIO_PUPDR_PUPDR6 ((uint32_t)0x00003000)
  4257. #define GPIO_PUPDR_PUPDR6_0 ((uint32_t)0x00001000)
  4258. #define GPIO_PUPDR_PUPDR6_1 ((uint32_t)0x00002000)
  4259. #define GPIO_PUPDR_PUPDR7 ((uint32_t)0x0000C000)
  4260. #define GPIO_PUPDR_PUPDR7_0 ((uint32_t)0x00004000)
  4261. #define GPIO_PUPDR_PUPDR7_1 ((uint32_t)0x00008000)
  4262. #define GPIO_PUPDR_PUPDR8 ((uint32_t)0x00030000)
  4263. #define GPIO_PUPDR_PUPDR8_0 ((uint32_t)0x00010000)
  4264. #define GPIO_PUPDR_PUPDR8_1 ((uint32_t)0x00020000)
  4265. #define GPIO_PUPDR_PUPDR9 ((uint32_t)0x000C0000)
  4266. #define GPIO_PUPDR_PUPDR9_0 ((uint32_t)0x00040000)
  4267. #define GPIO_PUPDR_PUPDR9_1 ((uint32_t)0x00080000)
  4268. #define GPIO_PUPDR_PUPDR10 ((uint32_t)0x00300000)
  4269. #define GPIO_PUPDR_PUPDR10_0 ((uint32_t)0x00100000)
  4270. #define GPIO_PUPDR_PUPDR10_1 ((uint32_t)0x00200000)
  4271. #define GPIO_PUPDR_PUPDR11 ((uint32_t)0x00C00000)
  4272. #define GPIO_PUPDR_PUPDR11_0 ((uint32_t)0x00400000)
  4273. #define GPIO_PUPDR_PUPDR11_1 ((uint32_t)0x00800000)
  4274. #define GPIO_PUPDR_PUPDR12 ((uint32_t)0x03000000)
  4275. #define GPIO_PUPDR_PUPDR12_0 ((uint32_t)0x01000000)
  4276. #define GPIO_PUPDR_PUPDR12_1 ((uint32_t)0x02000000)
  4277. #define GPIO_PUPDR_PUPDR13 ((uint32_t)0x0C000000)
  4278. #define GPIO_PUPDR_PUPDR13_0 ((uint32_t)0x04000000)
  4279. #define GPIO_PUPDR_PUPDR13_1 ((uint32_t)0x08000000)
  4280. #define GPIO_PUPDR_PUPDR14 ((uint32_t)0x30000000)
  4281. #define GPIO_PUPDR_PUPDR14_0 ((uint32_t)0x10000000)
  4282. #define GPIO_PUPDR_PUPDR14_1 ((uint32_t)0x20000000)
  4283. #define GPIO_PUPDR_PUPDR15 ((uint32_t)0xC0000000)
  4284. #define GPIO_PUPDR_PUPDR15_0 ((uint32_t)0x40000000)
  4285. #define GPIO_PUPDR_PUPDR15_1 ((uint32_t)0x80000000)
  4286. /****************** Bits definition for GPIO_IDR register *******************/
  4287. #define GPIO_IDR_IDR_0 ((uint32_t)0x00000001)
  4288. #define GPIO_IDR_IDR_1 ((uint32_t)0x00000002)
  4289. #define GPIO_IDR_IDR_2 ((uint32_t)0x00000004)
  4290. #define GPIO_IDR_IDR_3 ((uint32_t)0x00000008)
  4291. #define GPIO_IDR_IDR_4 ((uint32_t)0x00000010)
  4292. #define GPIO_IDR_IDR_5 ((uint32_t)0x00000020)
  4293. #define GPIO_IDR_IDR_6 ((uint32_t)0x00000040)
  4294. #define GPIO_IDR_IDR_7 ((uint32_t)0x00000080)
  4295. #define GPIO_IDR_IDR_8 ((uint32_t)0x00000100)
  4296. #define GPIO_IDR_IDR_9 ((uint32_t)0x00000200)
  4297. #define GPIO_IDR_IDR_10 ((uint32_t)0x00000400)
  4298. #define GPIO_IDR_IDR_11 ((uint32_t)0x00000800)
  4299. #define GPIO_IDR_IDR_12 ((uint32_t)0x00001000)
  4300. #define GPIO_IDR_IDR_13 ((uint32_t)0x00002000)
  4301. #define GPIO_IDR_IDR_14 ((uint32_t)0x00004000)
  4302. #define GPIO_IDR_IDR_15 ((uint32_t)0x00008000)
  4303. /****************** Bits definition for GPIO_ODR register *******************/
  4304. #define GPIO_ODR_ODR_0 ((uint32_t)0x00000001)
  4305. #define GPIO_ODR_ODR_1 ((uint32_t)0x00000002)
  4306. #define GPIO_ODR_ODR_2 ((uint32_t)0x00000004)
  4307. #define GPIO_ODR_ODR_3 ((uint32_t)0x00000008)
  4308. #define GPIO_ODR_ODR_4 ((uint32_t)0x00000010)
  4309. #define GPIO_ODR_ODR_5 ((uint32_t)0x00000020)
  4310. #define GPIO_ODR_ODR_6 ((uint32_t)0x00000040)
  4311. #define GPIO_ODR_ODR_7 ((uint32_t)0x00000080)
  4312. #define GPIO_ODR_ODR_8 ((uint32_t)0x00000100)
  4313. #define GPIO_ODR_ODR_9 ((uint32_t)0x00000200)
  4314. #define GPIO_ODR_ODR_10 ((uint32_t)0x00000400)
  4315. #define GPIO_ODR_ODR_11 ((uint32_t)0x00000800)
  4316. #define GPIO_ODR_ODR_12 ((uint32_t)0x00001000)
  4317. #define GPIO_ODR_ODR_13 ((uint32_t)0x00002000)
  4318. #define GPIO_ODR_ODR_14 ((uint32_t)0x00004000)
  4319. #define GPIO_ODR_ODR_15 ((uint32_t)0x00008000)
  4320. /****************** Bits definition for GPIO_BSRR register ******************/
  4321. #define GPIO_BSRR_BS_0 ((uint32_t)0x00000001)
  4322. #define GPIO_BSRR_BS_1 ((uint32_t)0x00000002)
  4323. #define GPIO_BSRR_BS_2 ((uint32_t)0x00000004)
  4324. #define GPIO_BSRR_BS_3 ((uint32_t)0x00000008)
  4325. #define GPIO_BSRR_BS_4 ((uint32_t)0x00000010)
  4326. #define GPIO_BSRR_BS_5 ((uint32_t)0x00000020)
  4327. #define GPIO_BSRR_BS_6 ((uint32_t)0x00000040)
  4328. #define GPIO_BSRR_BS_7 ((uint32_t)0x00000080)
  4329. #define GPIO_BSRR_BS_8 ((uint32_t)0x00000100)
  4330. #define GPIO_BSRR_BS_9 ((uint32_t)0x00000200)
  4331. #define GPIO_BSRR_BS_10 ((uint32_t)0x00000400)
  4332. #define GPIO_BSRR_BS_11 ((uint32_t)0x00000800)
  4333. #define GPIO_BSRR_BS_12 ((uint32_t)0x00001000)
  4334. #define GPIO_BSRR_BS_13 ((uint32_t)0x00002000)
  4335. #define GPIO_BSRR_BS_14 ((uint32_t)0x00004000)
  4336. #define GPIO_BSRR_BS_15 ((uint32_t)0x00008000)
  4337. #define GPIO_BSRR_BR_0 ((uint32_t)0x00010000)
  4338. #define GPIO_BSRR_BR_1 ((uint32_t)0x00020000)
  4339. #define GPIO_BSRR_BR_2 ((uint32_t)0x00040000)
  4340. #define GPIO_BSRR_BR_3 ((uint32_t)0x00080000)
  4341. #define GPIO_BSRR_BR_4 ((uint32_t)0x00100000)
  4342. #define GPIO_BSRR_BR_5 ((uint32_t)0x00200000)
  4343. #define GPIO_BSRR_BR_6 ((uint32_t)0x00400000)
  4344. #define GPIO_BSRR_BR_7 ((uint32_t)0x00800000)
  4345. #define GPIO_BSRR_BR_8 ((uint32_t)0x01000000)
  4346. #define GPIO_BSRR_BR_9 ((uint32_t)0x02000000)
  4347. #define GPIO_BSRR_BR_10 ((uint32_t)0x04000000)
  4348. #define GPIO_BSRR_BR_11 ((uint32_t)0x08000000)
  4349. #define GPIO_BSRR_BR_12 ((uint32_t)0x10000000)
  4350. #define GPIO_BSRR_BR_13 ((uint32_t)0x20000000)
  4351. #define GPIO_BSRR_BR_14 ((uint32_t)0x40000000)
  4352. #define GPIO_BSRR_BR_15 ((uint32_t)0x80000000)
  4353. /****************** Bit definition for GPIO_LCKR register *********************/
  4354. #define GPIO_LCKR_LCK0 ((uint32_t)0x00000001)
  4355. #define GPIO_LCKR_LCK1 ((uint32_t)0x00000002)
  4356. #define GPIO_LCKR_LCK2 ((uint32_t)0x00000004)
  4357. #define GPIO_LCKR_LCK3 ((uint32_t)0x00000008)
  4358. #define GPIO_LCKR_LCK4 ((uint32_t)0x00000010)
  4359. #define GPIO_LCKR_LCK5 ((uint32_t)0x00000020)
  4360. #define GPIO_LCKR_LCK6 ((uint32_t)0x00000040)
  4361. #define GPIO_LCKR_LCK7 ((uint32_t)0x00000080)
  4362. #define GPIO_LCKR_LCK8 ((uint32_t)0x00000100)
  4363. #define GPIO_LCKR_LCK9 ((uint32_t)0x00000200)
  4364. #define GPIO_LCKR_LCK10 ((uint32_t)0x00000400)
  4365. #define GPIO_LCKR_LCK11 ((uint32_t)0x00000800)
  4366. #define GPIO_LCKR_LCK12 ((uint32_t)0x00001000)
  4367. #define GPIO_LCKR_LCK13 ((uint32_t)0x00002000)
  4368. #define GPIO_LCKR_LCK14 ((uint32_t)0x00004000)
  4369. #define GPIO_LCKR_LCK15 ((uint32_t)0x00008000)
  4370. #define GPIO_LCKR_LCKK ((uint32_t)0x00010000)
  4371. /******************************************************************************/
  4372. /* */
  4373. /* Inter-integrated Circuit Interface (I2C) */
  4374. /* */
  4375. /******************************************************************************/
  4376. /******************* Bit definition for I2C_CR1 register *******************/
  4377. #define I2C_CR1_PE ((uint32_t)0x00000001) /*!< Peripheral enable */
  4378. #define I2C_CR1_TXIE ((uint32_t)0x00000002) /*!< TX interrupt enable */
  4379. #define I2C_CR1_RXIE ((uint32_t)0x00000004) /*!< RX interrupt enable */
  4380. #define I2C_CR1_ADDRIE ((uint32_t)0x00000008) /*!< Address match interrupt enable */
  4381. #define I2C_CR1_NACKIE ((uint32_t)0x00000010) /*!< NACK received interrupt enable */
  4382. #define I2C_CR1_STOPIE ((uint32_t)0x00000020) /*!< STOP detection interrupt enable */
  4383. #define I2C_CR1_TCIE ((uint32_t)0x00000040) /*!< Transfer complete interrupt enable */
  4384. #define I2C_CR1_ERRIE ((uint32_t)0x00000080) /*!< Errors interrupt enable */
  4385. #define I2C_CR1_DFN ((uint32_t)0x00000F00) /*!< Digital noise filter */
  4386. #define I2C_CR1_ANFOFF ((uint32_t)0x00001000) /*!< Analog noise filter OFF */
  4387. #define I2C_CR1_SWRST ((uint32_t)0x00002000) /*!< Software reset */
  4388. #define I2C_CR1_TXDMAEN ((uint32_t)0x00004000) /*!< DMA transmission requests enable */
  4389. #define I2C_CR1_RXDMAEN ((uint32_t)0x00008000) /*!< DMA reception requests enable */
  4390. #define I2C_CR1_SBC ((uint32_t)0x00010000) /*!< Slave byte control */
  4391. #define I2C_CR1_NOSTRETCH ((uint32_t)0x00020000) /*!< Clock stretching disable */
  4392. #define I2C_CR1_WUPEN ((uint32_t)0x00040000) /*!< Wakeup from STOP enable */
  4393. #define I2C_CR1_GCEN ((uint32_t)0x00080000) /*!< General call enable */
  4394. #define I2C_CR1_SMBHEN ((uint32_t)0x00100000) /*!< SMBus host address enable */
  4395. #define I2C_CR1_SMBDEN ((uint32_t)0x00200000) /*!< SMBus device default address enable */
  4396. #define I2C_CR1_ALERTEN ((uint32_t)0x00400000) /*!< SMBus alert enable */
  4397. #define I2C_CR1_PECEN ((uint32_t)0x00800000) /*!< PEC enable */
  4398. /****************** Bit definition for I2C_CR2 register ********************/
  4399. #define I2C_CR2_SADD ((uint32_t)0x000003FF) /*!< Slave address (master mode) */
  4400. #define I2C_CR2_RD_WRN ((uint32_t)0x00000400) /*!< Transfer direction (master mode) */
  4401. #define I2C_CR2_ADD10 ((uint32_t)0x00000800) /*!< 10-bit addressing mode (master mode) */
  4402. #define I2C_CR2_HEAD10R ((uint32_t)0x00001000) /*!< 10-bit address header only read direction (master mode) */
  4403. #define I2C_CR2_START ((uint32_t)0x00002000) /*!< START generation */
  4404. #define I2C_CR2_STOP ((uint32_t)0x00004000) /*!< STOP generation (master mode) */
  4405. #define I2C_CR2_NACK ((uint32_t)0x00008000) /*!< NACK generation (slave mode) */
  4406. #define I2C_CR2_NBYTES ((uint32_t)0x00FF0000) /*!< Number of bytes */
  4407. #define I2C_CR2_RELOAD ((uint32_t)0x01000000) /*!< NBYTES reload mode */
  4408. #define I2C_CR2_AUTOEND ((uint32_t)0x02000000) /*!< Automatic end mode (master mode) */
  4409. #define I2C_CR2_PECBYTE ((uint32_t)0x04000000) /*!< Packet error checking byte */
  4410. /******************* Bit definition for I2C_OAR1 register ******************/
  4411. #define I2C_OAR1_OA1 ((uint32_t)0x000003FF) /*!< Interface own address 1 */
  4412. #define I2C_OAR1_OA1MODE ((uint32_t)0x00000400) /*!< Own address 1 10-bit mode */
  4413. #define I2C_OAR1_OA1EN ((uint32_t)0x00008000) /*!< Own address 1 enable */
  4414. /******************* Bit definition for I2C_OAR2 register ******************/
  4415. #define I2C_OAR2_OA2 ((uint32_t)0x000000FE) /*!< Interface own address 2 */
  4416. #define I2C_OAR2_OA2MSK ((uint32_t)0x00000700) /*!< Own address 2 masks */
  4417. #define I2C_OAR2_OA2NOMASK ((uint32_t)0x00000000) /*!< No mask */
  4418. #define I2C_OAR2_OA2MASK01 ((uint32_t)0x00000100) /*!< OA2[1] is masked, Only OA2[7:2] are compared */
  4419. #define I2C_OAR2_OA2MASK02 ((uint32_t)0x00000200) /*!< OA2[2:1] is masked, Only OA2[7:3] are compared */
  4420. #define I2C_OAR2_OA2MASK03 ((uint32_t)0x00000300) /*!< OA2[3:1] is masked, Only OA2[7:4] are compared */
  4421. #define I2C_OAR2_OA2MASK04 ((uint32_t)0x00000400) /*!< OA2[4:1] is masked, Only OA2[7:5] are compared */
  4422. #define I2C_OAR2_OA2MASK05 ((uint32_t)0x00000500) /*!< OA2[5:1] is masked, Only OA2[7:6] are compared */
  4423. #define I2C_OAR2_OA2MASK06 ((uint32_t)0x00000600) /*!< OA2[6:1] is masked, Only OA2[7] are compared */
  4424. #define I2C_OAR2_OA2MASK07 ((uint32_t)0x00000700) /*!< OA2[7:1] is masked, No comparison is done */
  4425. #define I2C_OAR2_OA2EN ((uint32_t)0x00008000) /*!< Own address 2 enable */
  4426. /******************* Bit definition for I2C_TIMINGR register *******************/
  4427. #define I2C_TIMINGR_SCLL ((uint32_t)0x000000FF) /*!< SCL low period (master mode) */
  4428. #define I2C_TIMINGR_SCLH ((uint32_t)0x0000FF00) /*!< SCL high period (master mode) */
  4429. #define I2C_TIMINGR_SDADEL ((uint32_t)0x000F0000) /*!< Data hold time */
  4430. #define I2C_TIMINGR_SCLDEL ((uint32_t)0x00F00000) /*!< Data setup time */
  4431. #define I2C_TIMINGR_PRESC ((uint32_t)0xF0000000) /*!< Timings prescaler */
  4432. /******************* Bit definition for I2C_TIMEOUTR register *******************/
  4433. #define I2C_TIMEOUTR_TIMEOUTA ((uint32_t)0x00000FFF) /*!< Bus timeout A */
  4434. #define I2C_TIMEOUTR_TIDLE ((uint32_t)0x00001000) /*!< Idle clock timeout detection */
  4435. #define I2C_TIMEOUTR_TIMOUTEN ((uint32_t)0x00008000) /*!< Clock timeout enable */
  4436. #define I2C_TIMEOUTR_TIMEOUTB ((uint32_t)0x0FFF0000) /*!< Bus timeout B */
  4437. #define I2C_TIMEOUTR_TEXTEN ((uint32_t)0x80000000) /*!< Extended clock timeout enable */
  4438. /****************** Bit definition for I2C_ISR register *********************/
  4439. #define I2C_ISR_TXE ((uint32_t)0x00000001) /*!< Transmit data register empty */
  4440. #define I2C_ISR_TXIS ((uint32_t)0x00000002) /*!< Transmit interrupt status */
  4441. #define I2C_ISR_RXNE ((uint32_t)0x00000004) /*!< Receive data register not empty */
  4442. #define I2C_ISR_ADDR ((uint32_t)0x00000008) /*!< Address matched (slave mode) */
  4443. #define I2C_ISR_NACKF ((uint32_t)0x00000010) /*!< NACK received flag */
  4444. #define I2C_ISR_STOPF ((uint32_t)0x00000020) /*!< STOP detection flag */
  4445. #define I2C_ISR_TC ((uint32_t)0x00000040) /*!< Transfer complete (master mode) */
  4446. #define I2C_ISR_TCR ((uint32_t)0x00000080) /*!< Transfer complete reload */
  4447. #define I2C_ISR_BERR ((uint32_t)0x00000100) /*!< Bus error */
  4448. #define I2C_ISR_ARLO ((uint32_t)0x00000200) /*!< Arbitration lost */
  4449. #define I2C_ISR_OVR ((uint32_t)0x00000400) /*!< Overrun/Underrun */
  4450. #define I2C_ISR_PECERR ((uint32_t)0x00000800) /*!< PEC error in reception */
  4451. #define I2C_ISR_TIMEOUT ((uint32_t)0x00001000) /*!< Timeout or Tlow detection flag */
  4452. #define I2C_ISR_ALERT ((uint32_t)0x00002000) /*!< SMBus alert */
  4453. #define I2C_ISR_BUSY ((uint32_t)0x00008000) /*!< Bus busy */
  4454. #define I2C_ISR_DIR ((uint32_t)0x00010000) /*!< Transfer direction (slave mode) */
  4455. #define I2C_ISR_ADDCODE ((uint32_t)0x00FE0000) /*!< Address match code (slave mode) */
  4456. /****************** Bit definition for I2C_ICR register *********************/
  4457. #define I2C_ICR_ADDRCF ((uint32_t)0x00000008) /*!< Address matched clear flag */
  4458. #define I2C_ICR_NACKCF ((uint32_t)0x00000010) /*!< NACK clear flag */
  4459. #define I2C_ICR_STOPCF ((uint32_t)0x00000020) /*!< STOP detection clear flag */
  4460. #define I2C_ICR_BERRCF ((uint32_t)0x00000100) /*!< Bus error clear flag */
  4461. #define I2C_ICR_ARLOCF ((uint32_t)0x00000200) /*!< Arbitration lost clear flag */
  4462. #define I2C_ICR_OVRCF ((uint32_t)0x00000400) /*!< Overrun/Underrun clear flag */
  4463. #define I2C_ICR_PECCF ((uint32_t)0x00000800) /*!< PAC error clear flag */
  4464. #define I2C_ICR_TIMOUTCF ((uint32_t)0x00001000) /*!< Timeout clear flag */
  4465. #define I2C_ICR_ALERTCF ((uint32_t)0x00002000) /*!< Alert clear flag */
  4466. /****************** Bit definition for I2C_PECR register *********************/
  4467. #define I2C_PECR_PEC ((uint32_t)0x000000FF) /*!< PEC register */
  4468. /****************** Bit definition for I2C_RXDR register *********************/
  4469. #define I2C_RXDR_RXDATA ((uint32_t)0x000000FF) /*!< 8-bit receive data */
  4470. /****************** Bit definition for I2C_TXDR register *********************/
  4471. #define I2C_TXDR_TXDATA ((uint32_t)0x000000FF) /*!< 8-bit transmit data */
  4472. /******************************************************************************/
  4473. /* */
  4474. /* Independent WATCHDOG */
  4475. /* */
  4476. /******************************************************************************/
  4477. /******************* Bit definition for IWDG_KR register ********************/
  4478. #define IWDG_KR_KEY ((uint32_t)0xFFFF) /*!<Key value (write only, read 0000h) */
  4479. /******************* Bit definition for IWDG_PR register ********************/
  4480. #define IWDG_PR_PR ((uint32_t)0x07) /*!<PR[2:0] (Prescaler divider) */
  4481. #define IWDG_PR_PR_0 ((uint32_t)0x01) /*!<Bit 0 */
  4482. #define IWDG_PR_PR_1 ((uint32_t)0x02) /*!<Bit 1 */
  4483. #define IWDG_PR_PR_2 ((uint32_t)0x04) /*!<Bit 2 */
  4484. /******************* Bit definition for IWDG_RLR register *******************/
  4485. #define IWDG_RLR_RL ((uint32_t)0x0FFF) /*!<Watchdog counter reload value */
  4486. /******************* Bit definition for IWDG_SR register ********************/
  4487. #define IWDG_SR_PVU ((uint32_t)0x01) /*!< Watchdog prescaler value update */
  4488. #define IWDG_SR_RVU ((uint32_t)0x02) /*!< Watchdog counter reload value update */
  4489. #define IWDG_SR_WVU ((uint32_t)0x04) /*!< Watchdog counter window value update */
  4490. /******************* Bit definition for IWDG_KR register ********************/
  4491. #define IWDG_WINR_WIN ((uint32_t)0x0FFF) /*!< Watchdog counter window value */
  4492. /******************************************************************************/
  4493. /* */
  4494. /* LCD-TFT Display Controller (LTDC) */
  4495. /* */
  4496. /******************************************************************************/
  4497. /******************** Bit definition for LTDC_SSCR register *****************/
  4498. #define LTDC_SSCR_VSH ((uint32_t)0x000007FF) /*!< Vertical Synchronization Height */
  4499. #define LTDC_SSCR_HSW ((uint32_t)0x0FFF0000) /*!< Horizontal Synchronization Width */
  4500. /******************** Bit definition for LTDC_BPCR register *****************/
  4501. #define LTDC_BPCR_AVBP ((uint32_t)0x000007FF) /*!< Accumulated Vertical Back Porch */
  4502. #define LTDC_BPCR_AHBP ((uint32_t)0x0FFF0000) /*!< Accumulated Horizontal Back Porch */
  4503. /******************** Bit definition for LTDC_AWCR register *****************/
  4504. #define LTDC_AWCR_AAH ((uint32_t)0x000007FF) /*!< Accumulated Active heigh */
  4505. #define LTDC_AWCR_AAW ((uint32_t)0x0FFF0000) /*!< Accumulated Active Width */
  4506. /******************** Bit definition for LTDC_TWCR register *****************/
  4507. #define LTDC_TWCR_TOTALH ((uint32_t)0x000007FF) /*!< Total Heigh */
  4508. #define LTDC_TWCR_TOTALW ((uint32_t)0x0FFF0000) /*!< Total Width */
  4509. /******************** Bit definition for LTDC_GCR register ******************/
  4510. #define LTDC_GCR_LTDCEN ((uint32_t)0x00000001) /*!< LCD-TFT controller enable bit */
  4511. #define LTDC_GCR_DBW ((uint32_t)0x00000070) /*!< Dither Blue Width */
  4512. #define LTDC_GCR_DGW ((uint32_t)0x00000700) /*!< Dither Green Width */
  4513. #define LTDC_GCR_DRW ((uint32_t)0x00007000) /*!< Dither Red Width */
  4514. #define LTDC_GCR_DTEN ((uint32_t)0x00010000) /*!< Dither Enable */
  4515. #define LTDC_GCR_PCPOL ((uint32_t)0x10000000) /*!< Pixel Clock Polarity */
  4516. #define LTDC_GCR_DEPOL ((uint32_t)0x20000000) /*!< Data Enable Polarity */
  4517. #define LTDC_GCR_VSPOL ((uint32_t)0x40000000) /*!< Vertical Synchronization Polarity */
  4518. #define LTDC_GCR_HSPOL ((uint32_t)0x80000000) /*!< Horizontal Synchronization Polarity */
  4519. /******************** Bit definition for LTDC_SRCR register *****************/
  4520. #define LTDC_SRCR_IMR ((uint32_t)0x00000001) /*!< Immediate Reload */
  4521. #define LTDC_SRCR_VBR ((uint32_t)0x00000002) /*!< Vertical Blanking Reload */
  4522. /******************** Bit definition for LTDC_BCCR register *****************/
  4523. #define LTDC_BCCR_BCBLUE ((uint32_t)0x000000FF) /*!< Background Blue value */
  4524. #define LTDC_BCCR_BCGREEN ((uint32_t)0x0000FF00) /*!< Background Green value */
  4525. #define LTDC_BCCR_BCRED ((uint32_t)0x00FF0000) /*!< Background Red value */
  4526. /******************** Bit definition for LTDC_IER register ******************/
  4527. #define LTDC_IER_LIE ((uint32_t)0x00000001) /*!< Line Interrupt Enable */
  4528. #define LTDC_IER_FUIE ((uint32_t)0x00000002) /*!< FIFO Underrun Interrupt Enable */
  4529. #define LTDC_IER_TERRIE ((uint32_t)0x00000004) /*!< Transfer Error Interrupt Enable */
  4530. #define LTDC_IER_RRIE ((uint32_t)0x00000008) /*!< Register Reload interrupt enable */
  4531. /******************** Bit definition for LTDC_ISR register ******************/
  4532. #define LTDC_ISR_LIF ((uint32_t)0x00000001) /*!< Line Interrupt Flag */
  4533. #define LTDC_ISR_FUIF ((uint32_t)0x00000002) /*!< FIFO Underrun Interrupt Flag */
  4534. #define LTDC_ISR_TERRIF ((uint32_t)0x00000004) /*!< Transfer Error Interrupt Flag */
  4535. #define LTDC_ISR_RRIF ((uint32_t)0x00000008) /*!< Register Reload interrupt Flag */
  4536. /******************** Bit definition for LTDC_ICR register ******************/
  4537. #define LTDC_ICR_CLIF ((uint32_t)0x00000001) /*!< Clears the Line Interrupt Flag */
  4538. #define LTDC_ICR_CFUIF ((uint32_t)0x00000002) /*!< Clears the FIFO Underrun Interrupt Flag */
  4539. #define LTDC_ICR_CTERRIF ((uint32_t)0x00000004) /*!< Clears the Transfer Error Interrupt Flag */
  4540. #define LTDC_ICR_CRRIF ((uint32_t)0x00000008) /*!< Clears Register Reload interrupt Flag */
  4541. /******************** Bit definition for LTDC_LIPCR register ****************/
  4542. #define LTDC_LIPCR_LIPOS ((uint32_t)0x000007FF) /*!< Line Interrupt Position */
  4543. /******************** Bit definition for LTDC_CPSR register *****************/
  4544. #define LTDC_CPSR_CYPOS ((uint32_t)0x0000FFFF) /*!< Current Y Position */
  4545. #define LTDC_CPSR_CXPOS ((uint32_t)0xFFFF0000) /*!< Current X Position */
  4546. /******************** Bit definition for LTDC_CDSR register *****************/
  4547. #define LTDC_CDSR_VDES ((uint32_t)0x00000001) /*!< Vertical Data Enable Status */
  4548. #define LTDC_CDSR_HDES ((uint32_t)0x00000002) /*!< Horizontal Data Enable Status */
  4549. #define LTDC_CDSR_VSYNCS ((uint32_t)0x00000004) /*!< Vertical Synchronization Status */
  4550. #define LTDC_CDSR_HSYNCS ((uint32_t)0x00000008) /*!< Horizontal Synchronization Status */
  4551. /******************** Bit definition for LTDC_LxCR register *****************/
  4552. #define LTDC_LxCR_LEN ((uint32_t)0x00000001) /*!< Layer Enable */
  4553. #define LTDC_LxCR_COLKEN ((uint32_t)0x00000002) /*!< Color Keying Enable */
  4554. #define LTDC_LxCR_CLUTEN ((uint32_t)0x00000010) /*!< Color Lockup Table Enable */
  4555. /******************** Bit definition for LTDC_LxWHPCR register **************/
  4556. #define LTDC_LxWHPCR_WHSTPOS ((uint32_t)0x00000FFF) /*!< Window Horizontal Start Position */
  4557. #define LTDC_LxWHPCR_WHSPPOS ((uint32_t)0xFFFF0000) /*!< Window Horizontal Stop Position */
  4558. /******************** Bit definition for LTDC_LxWVPCR register **************/
  4559. #define LTDC_LxWVPCR_WVSTPOS ((uint32_t)0x00000FFF) /*!< Window Vertical Start Position */
  4560. #define LTDC_LxWVPCR_WVSPPOS ((uint32_t)0xFFFF0000) /*!< Window Vertical Stop Position */
  4561. /******************** Bit definition for LTDC_LxCKCR register ***************/
  4562. #define LTDC_LxCKCR_CKBLUE ((uint32_t)0x000000FF) /*!< Color Key Blue value */
  4563. #define LTDC_LxCKCR_CKGREEN ((uint32_t)0x0000FF00) /*!< Color Key Green value */
  4564. #define LTDC_LxCKCR_CKRED ((uint32_t)0x00FF0000) /*!< Color Key Red value */
  4565. /******************** Bit definition for LTDC_LxPFCR register ***************/
  4566. #define LTDC_LxPFCR_PF ((uint32_t)0x00000007) /*!< Pixel Format */
  4567. /******************** Bit definition for LTDC_LxCACR register ***************/
  4568. #define LTDC_LxCACR_CONSTA ((uint32_t)0x000000FF) /*!< Constant Alpha */
  4569. /******************** Bit definition for LTDC_LxDCCR register ***************/
  4570. #define LTDC_LxDCCR_DCBLUE ((uint32_t)0x000000FF) /*!< Default Color Blue */
  4571. #define LTDC_LxDCCR_DCGREEN ((uint32_t)0x0000FF00) /*!< Default Color Green */
  4572. #define LTDC_LxDCCR_DCRED ((uint32_t)0x00FF0000) /*!< Default Color Red */
  4573. #define LTDC_LxDCCR_DCALPHA ((uint32_t)0xFF000000) /*!< Default Color Alpha */
  4574. /******************** Bit definition for LTDC_LxBFCR register ***************/
  4575. #define LTDC_LxBFCR_BF2 ((uint32_t)0x00000007) /*!< Blending Factor 2 */
  4576. #define LTDC_LxBFCR_BF1 ((uint32_t)0x00000700) /*!< Blending Factor 1 */
  4577. /******************** Bit definition for LTDC_LxCFBAR register **************/
  4578. #define LTDC_LxCFBAR_CFBADD ((uint32_t)0xFFFFFFFF) /*!< Color Frame Buffer Start Address */
  4579. /******************** Bit definition for LTDC_LxCFBLR register **************/
  4580. #define LTDC_LxCFBLR_CFBLL ((uint32_t)0x00001FFF) /*!< Color Frame Buffer Line Length */
  4581. #define LTDC_LxCFBLR_CFBP ((uint32_t)0x1FFF0000) /*!< Color Frame Buffer Pitch in bytes */
  4582. /******************** Bit definition for LTDC_LxCFBLNR register *************/
  4583. #define LTDC_LxCFBLNR_CFBLNBR ((uint32_t)0x000007FF) /*!< Frame Buffer Line Number */
  4584. /******************** Bit definition for LTDC_LxCLUTWR register *************/
  4585. #define LTDC_LxCLUTWR_BLUE ((uint32_t)0x000000FF) /*!< Blue value */
  4586. #define LTDC_LxCLUTWR_GREEN ((uint32_t)0x0000FF00) /*!< Green value */
  4587. #define LTDC_LxCLUTWR_RED ((uint32_t)0x00FF0000) /*!< Red value */
  4588. #define LTDC_LxCLUTWR_CLUTADD ((uint32_t)0xFF000000) /*!< CLUT address */
  4589. /******************************************************************************/
  4590. /* */
  4591. /* Power Control */
  4592. /* */
  4593. /******************************************************************************/
  4594. /******************** Bit definition for PWR_CR1 register ********************/
  4595. #define PWR_CR1_LPDS ((uint32_t)0x00000001) /*!< Low-Power Deepsleep */
  4596. #define PWR_CR1_PDDS ((uint32_t)0x00000002) /*!< Power Down Deepsleep */
  4597. #define PWR_CR1_CSBF ((uint32_t)0x00000008) /*!< Clear Standby Flag */
  4598. #define PWR_CR1_PVDE ((uint32_t)0x00000010) /*!< Power Voltage Detector Enable */
  4599. #define PWR_CR1_PLS ((uint32_t)0x000000E0) /*!< PLS[2:0] bits (PVD Level Selection) */
  4600. #define PWR_CR1_PLS_0 ((uint32_t)0x00000020) /*!< Bit 0 */
  4601. #define PWR_CR1_PLS_1 ((uint32_t)0x00000040) /*!< Bit 1 */
  4602. #define PWR_CR1_PLS_2 ((uint32_t)0x00000080) /*!< Bit 2 */
  4603. /*!< PVD level configuration */
  4604. #define PWR_CR1_PLS_LEV0 ((uint32_t)0x00000000) /*!< PVD level 0 */
  4605. #define PWR_CR1_PLS_LEV1 ((uint32_t)0x00000020) /*!< PVD level 1 */
  4606. #define PWR_CR1_PLS_LEV2 ((uint32_t)0x00000040) /*!< PVD level 2 */
  4607. #define PWR_CR1_PLS_LEV3 ((uint32_t)0x00000060) /*!< PVD level 3 */
  4608. #define PWR_CR1_PLS_LEV4 ((uint32_t)0x00000080) /*!< PVD level 4 */
  4609. #define PWR_CR1_PLS_LEV5 ((uint32_t)0x000000A0) /*!< PVD level 5 */
  4610. #define PWR_CR1_PLS_LEV6 ((uint32_t)0x000000C0) /*!< PVD level 6 */
  4611. #define PWR_CR1_PLS_LEV7 ((uint32_t)0x000000E0) /*!< PVD level 7 */
  4612. #define PWR_CR1_DBP ((uint32_t)0x00000100) /*!< Disable Backup Domain write protection */
  4613. #define PWR_CR1_FPDS ((uint32_t)0x00000200) /*!< Flash power down in Stop mode */
  4614. #define PWR_CR1_LPUDS ((uint32_t)0x00000400) /*!< Low-power regulator in deepsleep under-drive mode */
  4615. #define PWR_CR1_MRUDS ((uint32_t)0x00000800) /*!< Main regulator in deepsleep under-drive mode */
  4616. #define PWR_CR1_ADCDC1 ((uint32_t)0x00002000) /*!< Refer to AN4073 on how to use this bit */
  4617. #define PWR_CR1_VOS ((uint32_t)0x0000C000) /*!< VOS[1:0] bits (Regulator voltage scaling output selection) */
  4618. #define PWR_CR1_VOS_0 ((uint32_t)0x00004000) /*!< Bit 0 */
  4619. #define PWR_CR1_VOS_1 ((uint32_t)0x00008000) /*!< Bit 1 */
  4620. #define PWR_CR1_ODEN ((uint32_t)0x00010000) /*!< Over Drive enable */
  4621. #define PWR_CR1_ODSWEN ((uint32_t)0x00020000) /*!< Over Drive switch enabled */
  4622. #define PWR_CR1_UDEN ((uint32_t)0x000C0000) /*!< Under Drive enable in stop mode */
  4623. #define PWR_CR1_UDEN_0 ((uint32_t)0x00040000) /*!< Bit 0 */
  4624. #define PWR_CR1_UDEN_1 ((uint32_t)0x00080000) /*!< Bit 1 */
  4625. /******************* Bit definition for PWR_CSR1 register ********************/
  4626. #define PWR_CSR1_WUIF ((uint32_t)0x00000001) /*!< Wake up internal Flag */
  4627. #define PWR_CSR1_SBF ((uint32_t)0x00000002) /*!< Standby Flag */
  4628. #define PWR_CSR1_PVDO ((uint32_t)0x00000004) /*!< PVD Output */
  4629. #define PWR_CSR1_BRR ((uint32_t)0x00000008) /*!< Backup regulator ready */
  4630. #define PWR_CSR1_BRE ((uint32_t)0x00000200) /*!< Backup regulator enable */
  4631. #define PWR_CSR1_VOSRDY ((uint32_t)0x00004000) /*!< Regulator voltage scaling output selection ready */
  4632. #define PWR_CSR1_ODRDY ((uint32_t)0x00010000) /*!< Over Drive generator ready */
  4633. #define PWR_CSR1_ODSWRDY ((uint32_t)0x00020000) /*!< Over Drive Switch ready */
  4634. #define PWR_CSR1_UDSWRDY ((uint32_t)0x000C0000) /*!< Under Drive ready */
  4635. /******************** Bit definition for PWR_CR2 register ********************/
  4636. #define PWR_CR2_CWUPF1 ((uint32_t)0x00000001) /*!< Clear Wakeup Pin Flag for PA0 */
  4637. #define PWR_CR2_CWUPF2 ((uint32_t)0x00000002) /*!< Clear Wakeup Pin Flag for PA2 */
  4638. #define PWR_CR2_CWUPF3 ((uint32_t)0x00000004) /*!< Clear Wakeup Pin Flag for PC1 */
  4639. #define PWR_CR2_CWUPF4 ((uint32_t)0x00000008) /*!< Clear Wakeup Pin Flag for PC13 */
  4640. #define PWR_CR2_CWUPF5 ((uint32_t)0x00000010) /*!< Clear Wakeup Pin Flag for PI8 */
  4641. #define PWR_CR2_CWUPF6 ((uint32_t)0x00000020) /*!< Clear Wakeup Pin Flag for PI11 */
  4642. #define PWR_CR2_WUPP1 ((uint32_t)0x00000100) /*!< Wakeup Pin Polarity bit for PA0 */
  4643. #define PWR_CR2_WUPP2 ((uint32_t)0x00000200) /*!< Wakeup Pin Polarity bit for PA2 */
  4644. #define PWR_CR2_WUPP3 ((uint32_t)0x00000400) /*!< Wakeup Pin Polarity bit for PC1 */
  4645. #define PWR_CR2_WUPP4 ((uint32_t)0x00000800) /*!< Wakeup Pin Polarity bit for PC13 */
  4646. #define PWR_CR2_WUPP5 ((uint32_t)0x00001000) /*!< Wakeup Pin Polarity bit for PI8 */
  4647. #define PWR_CR2_WUPP6 ((uint32_t)0x00002000) /*!< Wakeup Pin Polarity bit for PI11 */
  4648. /******************* Bit definition for PWR_CSR2 register ********************/
  4649. #define PWR_CSR2_WUPF1 ((uint32_t)0x00000001) /*!< Wakeup Pin Flag for PA0 */
  4650. #define PWR_CSR2_WUPF2 ((uint32_t)0x00000002) /*!< Wakeup Pin Flag for PA2 */
  4651. #define PWR_CSR2_WUPF3 ((uint32_t)0x00000004) /*!< Wakeup Pin Flag for PC1 */
  4652. #define PWR_CSR2_WUPF4 ((uint32_t)0x00000008) /*!< Wakeup Pin Flag for PC13 */
  4653. #define PWR_CSR2_WUPF5 ((uint32_t)0x00000010) /*!< Wakeup Pin Flag for PI8 */
  4654. #define PWR_CSR2_WUPF6 ((uint32_t)0x00000020) /*!< Wakeup Pin Flag for PI11 */
  4655. #define PWR_CSR2_EWUP1 ((uint32_t)0x00000100) /*!< Enable Wakeup Pin PA0 */
  4656. #define PWR_CSR2_EWUP2 ((uint32_t)0x00000200) /*!< Enable Wakeup Pin PA2 */
  4657. #define PWR_CSR2_EWUP3 ((uint32_t)0x00000400) /*!< Enable Wakeup Pin PC1 */
  4658. #define PWR_CSR2_EWUP4 ((uint32_t)0x00000800) /*!< Enable Wakeup Pin PC13 */
  4659. #define PWR_CSR2_EWUP5 ((uint32_t)0x00001000) /*!< Enable Wakeup Pin PI8 */
  4660. #define PWR_CSR2_EWUP6 ((uint32_t)0x00002000) /*!< Enable Wakeup Pin PI11 */
  4661. /******************************************************************************/
  4662. /* */
  4663. /* QUADSPI */
  4664. /* */
  4665. /******************************************************************************/
  4666. /***************** Bit definition for QUADSPI_CR register *******************/
  4667. #define QUADSPI_CR_EN ((uint32_t)0x00000001) /*!< Enable */
  4668. #define QUADSPI_CR_ABORT ((uint32_t)0x00000002) /*!< Abort request */
  4669. #define QUADSPI_CR_DMAEN ((uint32_t)0x00000004) /*!< DMA Enable */
  4670. #define QUADSPI_CR_TCEN ((uint32_t)0x00000008) /*!< Timeout Counter Enable */
  4671. #define QUADSPI_CR_SSHIFT ((uint32_t)0x00000010) /*!< Sample Shift */
  4672. #define QUADSPI_CR_DFM ((uint32_t)0x00000040) /*!< Dual Flash Mode */
  4673. #define QUADSPI_CR_FSEL ((uint32_t)0x00000080) /*!< Flash Select */
  4674. #define QUADSPI_CR_FTHRES ((uint32_t)0x00000F00) /*!< FTHRES[3:0] FIFO Level */
  4675. #define QUADSPI_CR_FTHRES_0 ((uint32_t)0x00000100) /*!< Bit 0 */
  4676. #define QUADSPI_CR_FTHRES_1 ((uint32_t)0x00000200) /*!< Bit 1 */
  4677. #define QUADSPI_CR_FTHRES_2 ((uint32_t)0x00000400) /*!< Bit 2 */
  4678. #define QUADSPI_CR_FTHRES_3 ((uint32_t)0x00000800) /*!< Bit 3 */
  4679. #define QUADSPI_CR_TEIE ((uint32_t)0x00010000) /*!< Transfer Error Interrupt Enable */
  4680. #define QUADSPI_CR_TCIE ((uint32_t)0x00020000) /*!< Transfer Complete Interrupt Enable */
  4681. #define QUADSPI_CR_FTIE ((uint32_t)0x00040000) /*!< FIFO Threshold Interrupt Enable */
  4682. #define QUADSPI_CR_SMIE ((uint32_t)0x00080000) /*!< Status Match Interrupt Enable */
  4683. #define QUADSPI_CR_TOIE ((uint32_t)0x00100000) /*!< TimeOut Interrupt Enable */
  4684. #define QUADSPI_CR_APMS ((uint32_t)0x00400000) /*!< Bit 1 */
  4685. #define QUADSPI_CR_PMM ((uint32_t)0x00800000) /*!< Polling Match Mode */
  4686. #define QUADSPI_CR_PRESCALER ((uint32_t)0xFF000000) /*!< PRESCALER[7:0] Clock prescaler */
  4687. #define QUADSPI_CR_PRESCALER_0 ((uint32_t)0x01000000) /*!< Bit 0 */
  4688. #define QUADSPI_CR_PRESCALER_1 ((uint32_t)0x02000000) /*!< Bit 1 */
  4689. #define QUADSPI_CR_PRESCALER_2 ((uint32_t)0x04000000) /*!< Bit 2 */
  4690. #define QUADSPI_CR_PRESCALER_3 ((uint32_t)0x08000000) /*!< Bit 3 */
  4691. #define QUADSPI_CR_PRESCALER_4 ((uint32_t)0x10000000) /*!< Bit 4 */
  4692. #define QUADSPI_CR_PRESCALER_5 ((uint32_t)0x20000000) /*!< Bit 5 */
  4693. #define QUADSPI_CR_PRESCALER_6 ((uint32_t)0x40000000) /*!< Bit 6 */
  4694. #define QUADSPI_CR_PRESCALER_7 ((uint32_t)0x80000000) /*!< Bit 7 */
  4695. /***************** Bit definition for QUADSPI_DCR register ******************/
  4696. #define QUADSPI_DCR_CKMODE ((uint32_t)0x00000001) /*!< Mode 0 / Mode 3 */
  4697. #define QUADSPI_DCR_CSHT ((uint32_t)0x00000700) /*!< CSHT[2:0]: ChipSelect High Time */
  4698. #define QUADSPI_DCR_CSHT_0 ((uint32_t)0x00000100) /*!< Bit 0 */
  4699. #define QUADSPI_DCR_CSHT_1 ((uint32_t)0x00000200) /*!< Bit 1 */
  4700. #define QUADSPI_DCR_CSHT_2 ((uint32_t)0x00000400) /*!< Bit 2 */
  4701. #define QUADSPI_DCR_FSIZE ((uint32_t)0x001F0000) /*!< FSIZE[4:0]: Flash Size */
  4702. #define QUADSPI_DCR_FSIZE_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  4703. #define QUADSPI_DCR_FSIZE_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  4704. #define QUADSPI_DCR_FSIZE_2 ((uint32_t)0x00040000) /*!< Bit 2 */
  4705. #define QUADSPI_DCR_FSIZE_3 ((uint32_t)0x00080000) /*!< Bit 3 */
  4706. #define QUADSPI_DCR_FSIZE_4 ((uint32_t)0x00100000) /*!< Bit 4 */
  4707. /****************** Bit definition for QUADSPI_SR register *******************/
  4708. #define QUADSPI_SR_TEF ((uint32_t)0x00000001) /*!< Transfer Error Flag */
  4709. #define QUADSPI_SR_TCF ((uint32_t)0x00000002) /*!< Transfer Complete Flag */
  4710. #define QUADSPI_SR_FTF ((uint32_t)0x00000004) /*!< FIFO Threshlod Flag */
  4711. #define QUADSPI_SR_SMF ((uint32_t)0x00000008) /*!< Status Match Flag */
  4712. #define QUADSPI_SR_TOF ((uint32_t)0x00000010) /*!< Timeout Flag */
  4713. #define QUADSPI_SR_BUSY ((uint32_t)0x00000020) /*!< Busy */
  4714. #define QUADSPI_SR_FLEVEL ((uint32_t)0x00001F00) /*!< FIFO Threshlod Flag */
  4715. #define QUADSPI_SR_FLEVEL_0 ((uint32_t)0x00000100) /*!< Bit 0 */
  4716. #define QUADSPI_SR_FLEVEL_1 ((uint32_t)0x00000200) /*!< Bit 1 */
  4717. #define QUADSPI_SR_FLEVEL_2 ((uint32_t)0x00000400) /*!< Bit 2 */
  4718. #define QUADSPI_SR_FLEVEL_3 ((uint32_t)0x00000800) /*!< Bit 3 */
  4719. #define QUADSPI_SR_FLEVEL_4 ((uint32_t)0x00001000) /*!< Bit 4 */
  4720. /****************** Bit definition for QUADSPI_FCR register ******************/
  4721. #define QUADSPI_FCR_CTEF ((uint32_t)0x00000001) /*!< Clear Transfer Error Flag */
  4722. #define QUADSPI_FCR_CTCF ((uint32_t)0x00000002) /*!< Clear Transfer Complete Flag */
  4723. #define QUADSPI_FCR_CSMF ((uint32_t)0x00000008) /*!< Clear Status Match Flag */
  4724. #define QUADSPI_FCR_CTOF ((uint32_t)0x00000010) /*!< Clear Timeout Flag */
  4725. /****************** Bit definition for QUADSPI_DLR register ******************/
  4726. #define QUADSPI_DLR_DL ((uint32_t)0xFFFFFFFF) /*!< DL[31:0]: Data Length */
  4727. /****************** Bit definition for QUADSPI_CCR register ******************/
  4728. #define QUADSPI_CCR_INSTRUCTION ((uint32_t)0x000000FF) /*!< INSTRUCTION[7:0]: Instruction */
  4729. #define QUADSPI_CCR_INSTRUCTION_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  4730. #define QUADSPI_CCR_INSTRUCTION_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  4731. #define QUADSPI_CCR_INSTRUCTION_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  4732. #define QUADSPI_CCR_INSTRUCTION_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  4733. #define QUADSPI_CCR_INSTRUCTION_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  4734. #define QUADSPI_CCR_INSTRUCTION_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  4735. #define QUADSPI_CCR_INSTRUCTION_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  4736. #define QUADSPI_CCR_INSTRUCTION_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  4737. #define QUADSPI_CCR_IMODE ((uint32_t)0x00000300) /*!< IMODE[1:0]: Instruction Mode */
  4738. #define QUADSPI_CCR_IMODE_0 ((uint32_t)0x00000100) /*!< Bit 0 */
  4739. #define QUADSPI_CCR_IMODE_1 ((uint32_t)0x00000200) /*!< Bit 1 */
  4740. #define QUADSPI_CCR_ADMODE ((uint32_t)0x00000C00) /*!< ADMODE[1:0]: Address Mode */
  4741. #define QUADSPI_CCR_ADMODE_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4742. #define QUADSPI_CCR_ADMODE_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4743. #define QUADSPI_CCR_ADSIZE ((uint32_t)0x00003000) /*!< ADSIZE[1:0]: Address Size */
  4744. #define QUADSPI_CCR_ADSIZE_0 ((uint32_t)0x00001000) /*!< Bit 0 */
  4745. #define QUADSPI_CCR_ADSIZE_1 ((uint32_t)0x00002000) /*!< Bit 1 */
  4746. #define QUADSPI_CCR_ABMODE ((uint32_t)0x0000C000) /*!< ABMODE[1:0]: Alternate Bytes Mode */
  4747. #define QUADSPI_CCR_ABMODE_0 ((uint32_t)0x00004000) /*!< Bit 0 */
  4748. #define QUADSPI_CCR_ABMODE_1 ((uint32_t)0x00008000) /*!< Bit 1 */
  4749. #define QUADSPI_CCR_ABSIZE ((uint32_t)0x00030000) /*!< ABSIZE[1:0]: Instruction Mode */
  4750. #define QUADSPI_CCR_ABSIZE_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  4751. #define QUADSPI_CCR_ABSIZE_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  4752. #define QUADSPI_CCR_DCYC ((uint32_t)0x007C0000) /*!< DCYC[4:0]: Dummy Cycles */
  4753. #define QUADSPI_CCR_DCYC_0 ((uint32_t)0x00040000) /*!< Bit 0 */
  4754. #define QUADSPI_CCR_DCYC_1 ((uint32_t)0x00080000) /*!< Bit 1 */
  4755. #define QUADSPI_CCR_DCYC_2 ((uint32_t)0x00100000) /*!< Bit 2 */
  4756. #define QUADSPI_CCR_DCYC_3 ((uint32_t)0x00200000) /*!< Bit 3 */
  4757. #define QUADSPI_CCR_DCYC_4 ((uint32_t)0x00400000) /*!< Bit 4 */
  4758. #define QUADSPI_CCR_DMODE ((uint32_t)0x03000000) /*!< DMODE[1:0]: Data Mode */
  4759. #define QUADSPI_CCR_DMODE_0 ((uint32_t)0x01000000) /*!< Bit 0 */
  4760. #define QUADSPI_CCR_DMODE_1 ((uint32_t)0x02000000) /*!< Bit 1 */
  4761. #define QUADSPI_CCR_FMODE ((uint32_t)0x0C000000) /*!< FMODE[1:0]: Functional Mode */
  4762. #define QUADSPI_CCR_FMODE_0 ((uint32_t)0x04000000) /*!< Bit 0 */
  4763. #define QUADSPI_CCR_FMODE_1 ((uint32_t)0x08000000) /*!< Bit 1 */
  4764. #define QUADSPI_CCR_SIOO ((uint32_t)0x10000000) /*!< SIOO: Send Instruction Only Once Mode */
  4765. #define QUADSPI_CCR_DHHC ((uint32_t)0x40000000) /*!< DHHC: Delay Half Hclk Cycle */
  4766. #define QUADSPI_CCR_DDRM ((uint32_t)0x80000000) /*!< DDRM: Double Data Rate Mode */
  4767. /****************** Bit definition for QUADSPI_AR register *******************/
  4768. #define QUADSPI_AR_ADDRESS ((uint32_t)0xFFFFFFFF) /*!< ADDRESS[31:0]: Address */
  4769. /****************** Bit definition for QUADSPI_ABR register ******************/
  4770. #define QUADSPI_ABR_ALTERNATE ((uint32_t)0xFFFFFFFF) /*!< ALTERNATE[31:0]: Alternate Bytes */
  4771. /****************** Bit definition for QUADSPI_DR register *******************/
  4772. #define QUADSPI_DR_DATA ((uint32_t)0xFFFFFFFF) /*!< DATA[31:0]: Data */
  4773. /****************** Bit definition for QUADSPI_PSMKR register ****************/
  4774. #define QUADSPI_PSMKR_MASK ((uint32_t)0xFFFFFFFF) /*!< MASK[31:0]: Status Mask */
  4775. /****************** Bit definition for QUADSPI_PSMAR register ****************/
  4776. #define QUADSPI_PSMAR_MATCH ((uint32_t)0xFFFFFFFF) /*!< MATCH[31:0]: Status Match */
  4777. /****************** Bit definition for QUADSPI_PIR register *****************/
  4778. #define QUADSPI_PIR_INTERVAL ((uint32_t)0x0000FFFF) /*!< INTERVAL[15:0]: Polling Interval */
  4779. /****************** Bit definition for QUADSPI_LPTR register *****************/
  4780. #define QUADSPI_LPTR_TIMEOUT ((uint32_t)0x0000FFFF) /*!< TIMEOUT[15:0]: Timeout period */
  4781. /******************************************************************************/
  4782. /* */
  4783. /* Reset and Clock Control */
  4784. /* */
  4785. /******************************************************************************/
  4786. /******************** Bit definition for RCC_CR register ********************/
  4787. #define RCC_CR_HSION ((uint32_t)0x00000001)
  4788. #define RCC_CR_HSIRDY ((uint32_t)0x00000002)
  4789. #define RCC_CR_HSITRIM ((uint32_t)0x000000F8)
  4790. #define RCC_CR_HSITRIM_0 ((uint32_t)0x00000008) /*!<Bit 0 */
  4791. #define RCC_CR_HSITRIM_1 ((uint32_t)0x00000010) /*!<Bit 1 */
  4792. #define RCC_CR_HSITRIM_2 ((uint32_t)0x00000020) /*!<Bit 2 */
  4793. #define RCC_CR_HSITRIM_3 ((uint32_t)0x00000040) /*!<Bit 3 */
  4794. #define RCC_CR_HSITRIM_4 ((uint32_t)0x00000080) /*!<Bit 4 */
  4795. #define RCC_CR_HSICAL ((uint32_t)0x0000FF00)
  4796. #define RCC_CR_HSICAL_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  4797. #define RCC_CR_HSICAL_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  4798. #define RCC_CR_HSICAL_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  4799. #define RCC_CR_HSICAL_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  4800. #define RCC_CR_HSICAL_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  4801. #define RCC_CR_HSICAL_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  4802. #define RCC_CR_HSICAL_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  4803. #define RCC_CR_HSICAL_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  4804. #define RCC_CR_HSEON ((uint32_t)0x00010000)
  4805. #define RCC_CR_HSERDY ((uint32_t)0x00020000)
  4806. #define RCC_CR_HSEBYP ((uint32_t)0x00040000)
  4807. #define RCC_CR_CSSON ((uint32_t)0x00080000)
  4808. #define RCC_CR_PLLON ((uint32_t)0x01000000)
  4809. #define RCC_CR_PLLRDY ((uint32_t)0x02000000)
  4810. #define RCC_CR_PLLI2SON ((uint32_t)0x04000000)
  4811. #define RCC_CR_PLLI2SRDY ((uint32_t)0x08000000)
  4812. #define RCC_CR_PLLSAION ((uint32_t)0x10000000)
  4813. #define RCC_CR_PLLSAIRDY ((uint32_t)0x20000000)
  4814. /******************** Bit definition for RCC_PLLCFGR register ***************/
  4815. #define RCC_PLLCFGR_PLLM ((uint32_t)0x0000003F)
  4816. #define RCC_PLLCFGR_PLLM_0 ((uint32_t)0x00000001)
  4817. #define RCC_PLLCFGR_PLLM_1 ((uint32_t)0x00000002)
  4818. #define RCC_PLLCFGR_PLLM_2 ((uint32_t)0x00000004)
  4819. #define RCC_PLLCFGR_PLLM_3 ((uint32_t)0x00000008)
  4820. #define RCC_PLLCFGR_PLLM_4 ((uint32_t)0x00000010)
  4821. #define RCC_PLLCFGR_PLLM_5 ((uint32_t)0x00000020)
  4822. #define RCC_PLLCFGR_PLLN ((uint32_t)0x00007FC0)
  4823. #define RCC_PLLCFGR_PLLN_0 ((uint32_t)0x00000040)
  4824. #define RCC_PLLCFGR_PLLN_1 ((uint32_t)0x00000080)
  4825. #define RCC_PLLCFGR_PLLN_2 ((uint32_t)0x00000100)
  4826. #define RCC_PLLCFGR_PLLN_3 ((uint32_t)0x00000200)
  4827. #define RCC_PLLCFGR_PLLN_4 ((uint32_t)0x00000400)
  4828. #define RCC_PLLCFGR_PLLN_5 ((uint32_t)0x00000800)
  4829. #define RCC_PLLCFGR_PLLN_6 ((uint32_t)0x00001000)
  4830. #define RCC_PLLCFGR_PLLN_7 ((uint32_t)0x00002000)
  4831. #define RCC_PLLCFGR_PLLN_8 ((uint32_t)0x00004000)
  4832. #define RCC_PLLCFGR_PLLP ((uint32_t)0x00030000)
  4833. #define RCC_PLLCFGR_PLLP_0 ((uint32_t)0x00010000)
  4834. #define RCC_PLLCFGR_PLLP_1 ((uint32_t)0x00020000)
  4835. #define RCC_PLLCFGR_PLLSRC ((uint32_t)0x00400000)
  4836. #define RCC_PLLCFGR_PLLSRC_HSE ((uint32_t)0x00400000)
  4837. #define RCC_PLLCFGR_PLLSRC_HSI ((uint32_t)0x00000000)
  4838. #define RCC_PLLCFGR_PLLQ ((uint32_t)0x0F000000)
  4839. #define RCC_PLLCFGR_PLLQ_0 ((uint32_t)0x01000000)
  4840. #define RCC_PLLCFGR_PLLQ_1 ((uint32_t)0x02000000)
  4841. #define RCC_PLLCFGR_PLLQ_2 ((uint32_t)0x04000000)
  4842. #define RCC_PLLCFGR_PLLQ_3 ((uint32_t)0x08000000)
  4843. /******************** Bit definition for RCC_CFGR register ******************/
  4844. /*!< SW configuration */
  4845. #define RCC_CFGR_SW ((uint32_t)0x00000003) /*!< SW[1:0] bits (System clock Switch) */
  4846. #define RCC_CFGR_SW_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  4847. #define RCC_CFGR_SW_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  4848. #define RCC_CFGR_SW_HSI ((uint32_t)0x00000000) /*!< HSI selected as system clock */
  4849. #define RCC_CFGR_SW_HSE ((uint32_t)0x00000001) /*!< HSE selected as system clock */
  4850. #define RCC_CFGR_SW_PLL ((uint32_t)0x00000002) /*!< PLL selected as system clock */
  4851. /*!< SWS configuration */
  4852. #define RCC_CFGR_SWS ((uint32_t)0x0000000C) /*!< SWS[1:0] bits (System Clock Switch Status) */
  4853. #define RCC_CFGR_SWS_0 ((uint32_t)0x00000004) /*!< Bit 0 */
  4854. #define RCC_CFGR_SWS_1 ((uint32_t)0x00000008) /*!< Bit 1 */
  4855. #define RCC_CFGR_SWS_HSI ((uint32_t)0x00000000) /*!< HSI oscillator used as system clock */
  4856. #define RCC_CFGR_SWS_HSE ((uint32_t)0x00000004) /*!< HSE oscillator used as system clock */
  4857. #define RCC_CFGR_SWS_PLL ((uint32_t)0x00000008) /*!< PLL used as system clock */
  4858. /*!< HPRE configuration */
  4859. #define RCC_CFGR_HPRE ((uint32_t)0x000000F0) /*!< HPRE[3:0] bits (AHB prescaler) */
  4860. #define RCC_CFGR_HPRE_0 ((uint32_t)0x00000010) /*!< Bit 0 */
  4861. #define RCC_CFGR_HPRE_1 ((uint32_t)0x00000020) /*!< Bit 1 */
  4862. #define RCC_CFGR_HPRE_2 ((uint32_t)0x00000040) /*!< Bit 2 */
  4863. #define RCC_CFGR_HPRE_3 ((uint32_t)0x00000080) /*!< Bit 3 */
  4864. #define RCC_CFGR_HPRE_DIV1 ((uint32_t)0x00000000) /*!< SYSCLK not divided */
  4865. #define RCC_CFGR_HPRE_DIV2 ((uint32_t)0x00000080) /*!< SYSCLK divided by 2 */
  4866. #define RCC_CFGR_HPRE_DIV4 ((uint32_t)0x00000090) /*!< SYSCLK divided by 4 */
  4867. #define RCC_CFGR_HPRE_DIV8 ((uint32_t)0x000000A0) /*!< SYSCLK divided by 8 */
  4868. #define RCC_CFGR_HPRE_DIV16 ((uint32_t)0x000000B0) /*!< SYSCLK divided by 16 */
  4869. #define RCC_CFGR_HPRE_DIV64 ((uint32_t)0x000000C0) /*!< SYSCLK divided by 64 */
  4870. #define RCC_CFGR_HPRE_DIV128 ((uint32_t)0x000000D0) /*!< SYSCLK divided by 128 */
  4871. #define RCC_CFGR_HPRE_DIV256 ((uint32_t)0x000000E0) /*!< SYSCLK divided by 256 */
  4872. #define RCC_CFGR_HPRE_DIV512 ((uint32_t)0x000000F0) /*!< SYSCLK divided by 512 */
  4873. /*!< PPRE1 configuration */
  4874. #define RCC_CFGR_PPRE1 ((uint32_t)0x00001C00) /*!< PRE1[2:0] bits (APB1 prescaler) */
  4875. #define RCC_CFGR_PPRE1_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4876. #define RCC_CFGR_PPRE1_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4877. #define RCC_CFGR_PPRE1_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4878. #define RCC_CFGR_PPRE1_DIV1 ((uint32_t)0x00000000) /*!< HCLK not divided */
  4879. #define RCC_CFGR_PPRE1_DIV2 ((uint32_t)0x00001000) /*!< HCLK divided by 2 */
  4880. #define RCC_CFGR_PPRE1_DIV4 ((uint32_t)0x00001400) /*!< HCLK divided by 4 */
  4881. #define RCC_CFGR_PPRE1_DIV8 ((uint32_t)0x00001800) /*!< HCLK divided by 8 */
  4882. #define RCC_CFGR_PPRE1_DIV16 ((uint32_t)0x00001C00) /*!< HCLK divided by 16 */
  4883. /*!< PPRE2 configuration */
  4884. #define RCC_CFGR_PPRE2 ((uint32_t)0x0000E000) /*!< PRE2[2:0] bits (APB2 prescaler) */
  4885. #define RCC_CFGR_PPRE2_0 ((uint32_t)0x00002000) /*!< Bit 0 */
  4886. #define RCC_CFGR_PPRE2_1 ((uint32_t)0x00004000) /*!< Bit 1 */
  4887. #define RCC_CFGR_PPRE2_2 ((uint32_t)0x00008000) /*!< Bit 2 */
  4888. #define RCC_CFGR_PPRE2_DIV1 ((uint32_t)0x00000000) /*!< HCLK not divided */
  4889. #define RCC_CFGR_PPRE2_DIV2 ((uint32_t)0x00008000) /*!< HCLK divided by 2 */
  4890. #define RCC_CFGR_PPRE2_DIV4 ((uint32_t)0x0000A000) /*!< HCLK divided by 4 */
  4891. #define RCC_CFGR_PPRE2_DIV8 ((uint32_t)0x0000C000) /*!< HCLK divided by 8 */
  4892. #define RCC_CFGR_PPRE2_DIV16 ((uint32_t)0x0000E000) /*!< HCLK divided by 16 */
  4893. /*!< RTCPRE configuration */
  4894. #define RCC_CFGR_RTCPRE ((uint32_t)0x001F0000)
  4895. #define RCC_CFGR_RTCPRE_0 ((uint32_t)0x00010000)
  4896. #define RCC_CFGR_RTCPRE_1 ((uint32_t)0x00020000)
  4897. #define RCC_CFGR_RTCPRE_2 ((uint32_t)0x00040000)
  4898. #define RCC_CFGR_RTCPRE_3 ((uint32_t)0x00080000)
  4899. #define RCC_CFGR_RTCPRE_4 ((uint32_t)0x00100000)
  4900. /*!< MCO1 configuration */
  4901. #define RCC_CFGR_MCO1 ((uint32_t)0x00600000)
  4902. #define RCC_CFGR_MCO1_0 ((uint32_t)0x00200000)
  4903. #define RCC_CFGR_MCO1_1 ((uint32_t)0x00400000)
  4904. #define RCC_CFGR_I2SSRC ((uint32_t)0x00800000)
  4905. #define RCC_CFGR_MCO1PRE ((uint32_t)0x07000000)
  4906. #define RCC_CFGR_MCO1PRE_0 ((uint32_t)0x01000000)
  4907. #define RCC_CFGR_MCO1PRE_1 ((uint32_t)0x02000000)
  4908. #define RCC_CFGR_MCO1PRE_2 ((uint32_t)0x04000000)
  4909. #define RCC_CFGR_MCO2PRE ((uint32_t)0x38000000)
  4910. #define RCC_CFGR_MCO2PRE_0 ((uint32_t)0x08000000)
  4911. #define RCC_CFGR_MCO2PRE_1 ((uint32_t)0x10000000)
  4912. #define RCC_CFGR_MCO2PRE_2 ((uint32_t)0x20000000)
  4913. #define RCC_CFGR_MCO2 ((uint32_t)0xC0000000)
  4914. #define RCC_CFGR_MCO2_0 ((uint32_t)0x40000000)
  4915. #define RCC_CFGR_MCO2_1 ((uint32_t)0x80000000)
  4916. /******************** Bit definition for RCC_CIR register *******************/
  4917. #define RCC_CIR_LSIRDYF ((uint32_t)0x00000001)
  4918. #define RCC_CIR_LSERDYF ((uint32_t)0x00000002)
  4919. #define RCC_CIR_HSIRDYF ((uint32_t)0x00000004)
  4920. #define RCC_CIR_HSERDYF ((uint32_t)0x00000008)
  4921. #define RCC_CIR_PLLRDYF ((uint32_t)0x00000010)
  4922. #define RCC_CIR_PLLI2SRDYF ((uint32_t)0x00000020)
  4923. #define RCC_CIR_PLLSAIRDYF ((uint32_t)0x00000040)
  4924. #define RCC_CIR_CSSF ((uint32_t)0x00000080)
  4925. #define RCC_CIR_LSIRDYIE ((uint32_t)0x00000100)
  4926. #define RCC_CIR_LSERDYIE ((uint32_t)0x00000200)
  4927. #define RCC_CIR_HSIRDYIE ((uint32_t)0x00000400)
  4928. #define RCC_CIR_HSERDYIE ((uint32_t)0x00000800)
  4929. #define RCC_CIR_PLLRDYIE ((uint32_t)0x00001000)
  4930. #define RCC_CIR_PLLI2SRDYIE ((uint32_t)0x00002000)
  4931. #define RCC_CIR_PLLSAIRDYIE ((uint32_t)0x00004000)
  4932. #define RCC_CIR_LSIRDYC ((uint32_t)0x00010000)
  4933. #define RCC_CIR_LSERDYC ((uint32_t)0x00020000)
  4934. #define RCC_CIR_HSIRDYC ((uint32_t)0x00040000)
  4935. #define RCC_CIR_HSERDYC ((uint32_t)0x00080000)
  4936. #define RCC_CIR_PLLRDYC ((uint32_t)0x00100000)
  4937. #define RCC_CIR_PLLI2SRDYC ((uint32_t)0x00200000)
  4938. #define RCC_CIR_PLLSAIRDYC ((uint32_t)0x00400000)
  4939. #define RCC_CIR_CSSC ((uint32_t)0x00800000)
  4940. /******************** Bit definition for RCC_AHB1RSTR register **************/
  4941. #define RCC_AHB1RSTR_GPIOARST ((uint32_t)0x00000001)
  4942. #define RCC_AHB1RSTR_GPIOBRST ((uint32_t)0x00000002)
  4943. #define RCC_AHB1RSTR_GPIOCRST ((uint32_t)0x00000004)
  4944. #define RCC_AHB1RSTR_GPIODRST ((uint32_t)0x00000008)
  4945. #define RCC_AHB1RSTR_GPIOERST ((uint32_t)0x00000010)
  4946. #define RCC_AHB1RSTR_GPIOFRST ((uint32_t)0x00000020)
  4947. #define RCC_AHB1RSTR_GPIOGRST ((uint32_t)0x00000040)
  4948. #define RCC_AHB1RSTR_GPIOHRST ((uint32_t)0x00000080)
  4949. #define RCC_AHB1RSTR_GPIOIRST ((uint32_t)0x00000100)
  4950. #define RCC_AHB1RSTR_GPIOJRST ((uint32_t)0x00000200)
  4951. #define RCC_AHB1RSTR_GPIOKRST ((uint32_t)0x00000400)
  4952. #define RCC_AHB1RSTR_CRCRST ((uint32_t)0x00001000)
  4953. #define RCC_AHB1RSTR_DMA1RST ((uint32_t)0x00200000)
  4954. #define RCC_AHB1RSTR_DMA2RST ((uint32_t)0x00400000)
  4955. #define RCC_AHB1RSTR_DMA2DRST ((uint32_t)0x00800000)
  4956. #define RCC_AHB1RSTR_ETHMACRST ((uint32_t)0x02000000)
  4957. #define RCC_AHB1RSTR_OTGHRST ((uint32_t)0x20000000)
  4958. /******************** Bit definition for RCC_AHB2RSTR register **************/
  4959. #define RCC_AHB2RSTR_DCMIRST ((uint32_t)0x00000001)
  4960. #define RCC_AHB2RSTR_RNGRST ((uint32_t)0x00000040)
  4961. #define RCC_AHB2RSTR_OTGFSRST ((uint32_t)0x00000080)
  4962. /******************** Bit definition for RCC_AHB3RSTR register **************/
  4963. #define RCC_AHB3RSTR_FMCRST ((uint32_t)0x00000001)
  4964. #define RCC_AHB3RSTR_QSPIRST ((uint32_t)0x00000002)
  4965. /******************** Bit definition for RCC_APB1RSTR register **************/
  4966. #define RCC_APB1RSTR_TIM2RST ((uint32_t)0x00000001)
  4967. #define RCC_APB1RSTR_TIM3RST ((uint32_t)0x00000002)
  4968. #define RCC_APB1RSTR_TIM4RST ((uint32_t)0x00000004)
  4969. #define RCC_APB1RSTR_TIM5RST ((uint32_t)0x00000008)
  4970. #define RCC_APB1RSTR_TIM6RST ((uint32_t)0x00000010)
  4971. #define RCC_APB1RSTR_TIM7RST ((uint32_t)0x00000020)
  4972. #define RCC_APB1RSTR_TIM12RST ((uint32_t)0x00000040)
  4973. #define RCC_APB1RSTR_TIM13RST ((uint32_t)0x00000080)
  4974. #define RCC_APB1RSTR_TIM14RST ((uint32_t)0x00000100)
  4975. #define RCC_APB1RSTR_LPTIM1RST ((uint32_t)0x00000200)
  4976. #define RCC_APB1RSTR_WWDGRST ((uint32_t)0x00000800)
  4977. #define RCC_APB1RSTR_SPI2RST ((uint32_t)0x00004000)
  4978. #define RCC_APB1RSTR_SPI3RST ((uint32_t)0x00008000)
  4979. #define RCC_APB1RSTR_SPDIFRXRST ((uint32_t)0x00010000)
  4980. #define RCC_APB1RSTR_USART2RST ((uint32_t)0x00020000)
  4981. #define RCC_APB1RSTR_USART3RST ((uint32_t)0x00040000)
  4982. #define RCC_APB1RSTR_UART4RST ((uint32_t)0x00080000)
  4983. #define RCC_APB1RSTR_UART5RST ((uint32_t)0x00100000)
  4984. #define RCC_APB1RSTR_I2C1RST ((uint32_t)0x00200000)
  4985. #define RCC_APB1RSTR_I2C2RST ((uint32_t)0x00400000)
  4986. #define RCC_APB1RSTR_I2C3RST ((uint32_t)0x00800000)
  4987. #define RCC_APB1RSTR_I2C4RST ((uint32_t)0x01000000)
  4988. #define RCC_APB1RSTR_CAN1RST ((uint32_t)0x02000000)
  4989. #define RCC_APB1RSTR_CAN2RST ((uint32_t)0x04000000)
  4990. #define RCC_APB1RSTR_CECRST ((uint32_t)0x08000000)
  4991. #define RCC_APB1RSTR_PWRRST ((uint32_t)0x10000000)
  4992. #define RCC_APB1RSTR_DACRST ((uint32_t)0x20000000)
  4993. #define RCC_APB1RSTR_UART7RST ((uint32_t)0x40000000)
  4994. #define RCC_APB1RSTR_UART8RST ((uint32_t)0x80000000)
  4995. /******************** Bit definition for RCC_APB2RSTR register **************/
  4996. #define RCC_APB2RSTR_TIM1RST ((uint32_t)0x00000001)
  4997. #define RCC_APB2RSTR_TIM8RST ((uint32_t)0x00000002)
  4998. #define RCC_APB2RSTR_USART1RST ((uint32_t)0x00000010)
  4999. #define RCC_APB2RSTR_USART6RST ((uint32_t)0x00000020)
  5000. #define RCC_APB2RSTR_ADCRST ((uint32_t)0x00000100)
  5001. #define RCC_APB2RSTR_SDMMC1RST ((uint32_t)0x00000800)
  5002. #define RCC_APB2RSTR_SPI1RST ((uint32_t)0x00001000)
  5003. #define RCC_APB2RSTR_SPI4RST ((uint32_t)0x00002000)
  5004. #define RCC_APB2RSTR_SYSCFGRST ((uint32_t)0x00004000)
  5005. #define RCC_APB2RSTR_TIM9RST ((uint32_t)0x00010000)
  5006. #define RCC_APB2RSTR_TIM10RST ((uint32_t)0x00020000)
  5007. #define RCC_APB2RSTR_TIM11RST ((uint32_t)0x00040000)
  5008. #define RCC_APB2RSTR_SPI5RST ((uint32_t)0x00100000)
  5009. #define RCC_APB2RSTR_SPI6RST ((uint32_t)0x00200000)
  5010. #define RCC_APB2RSTR_SAI1RST ((uint32_t)0x00400000)
  5011. #define RCC_APB2RSTR_SAI2RST ((uint32_t)0x00800000)
  5012. #define RCC_APB2RSTR_LTDCRST ((uint32_t)0x04000000)
  5013. /******************** Bit definition for RCC_AHB1ENR register ***************/
  5014. #define RCC_AHB1ENR_GPIOAEN ((uint32_t)0x00000001)
  5015. #define RCC_AHB1ENR_GPIOBEN ((uint32_t)0x00000002)
  5016. #define RCC_AHB1ENR_GPIOCEN ((uint32_t)0x00000004)
  5017. #define RCC_AHB1ENR_GPIODEN ((uint32_t)0x00000008)
  5018. #define RCC_AHB1ENR_GPIOEEN ((uint32_t)0x00000010)
  5019. #define RCC_AHB1ENR_GPIOFEN ((uint32_t)0x00000020)
  5020. #define RCC_AHB1ENR_GPIOGEN ((uint32_t)0x00000040)
  5021. #define RCC_AHB1ENR_GPIOHEN ((uint32_t)0x00000080)
  5022. #define RCC_AHB1ENR_GPIOIEN ((uint32_t)0x00000100)
  5023. #define RCC_AHB1ENR_GPIOJEN ((uint32_t)0x00000200)
  5024. #define RCC_AHB1ENR_GPIOKEN ((uint32_t)0x00000400)
  5025. #define RCC_AHB1ENR_CRCEN ((uint32_t)0x00001000)
  5026. #define RCC_AHB1ENR_BKPSRAMEN ((uint32_t)0x00040000)
  5027. #define RCC_AHB1ENR_DTCMRAMEN ((uint32_t)0x00100000)
  5028. #define RCC_AHB1ENR_DMA1EN ((uint32_t)0x00200000)
  5029. #define RCC_AHB1ENR_DMA2EN ((uint32_t)0x00400000)
  5030. #define RCC_AHB1ENR_DMA2DEN ((uint32_t)0x00800000)
  5031. #define RCC_AHB1ENR_ETHMACEN ((uint32_t)0x02000000)
  5032. #define RCC_AHB1ENR_ETHMACTXEN ((uint32_t)0x04000000)
  5033. #define RCC_AHB1ENR_ETHMACRXEN ((uint32_t)0x08000000)
  5034. #define RCC_AHB1ENR_ETHMACPTPEN ((uint32_t)0x10000000)
  5035. #define RCC_AHB1ENR_OTGHSEN ((uint32_t)0x20000000)
  5036. #define RCC_AHB1ENR_OTGHSULPIEN ((uint32_t)0x40000000)
  5037. /******************** Bit definition for RCC_AHB2ENR register ***************/
  5038. #define RCC_AHB2ENR_DCMIEN ((uint32_t)0x00000001)
  5039. #define RCC_AHB2ENR_RNGEN ((uint32_t)0x00000040)
  5040. #define RCC_AHB2ENR_OTGFSEN ((uint32_t)0x00000080)
  5041. /******************** Bit definition for RCC_AHB3ENR register ***************/
  5042. #define RCC_AHB3ENR_FMCEN ((uint32_t)0x00000001)
  5043. #define RCC_AHB3ENR_QSPIEN ((uint32_t)0x00000002)
  5044. /******************** Bit definition for RCC_APB1ENR register ***************/
  5045. #define RCC_APB1ENR_TIM2EN ((uint32_t)0x00000001)
  5046. #define RCC_APB1ENR_TIM3EN ((uint32_t)0x00000002)
  5047. #define RCC_APB1ENR_TIM4EN ((uint32_t)0x00000004)
  5048. #define RCC_APB1ENR_TIM5EN ((uint32_t)0x00000008)
  5049. #define RCC_APB1ENR_TIM6EN ((uint32_t)0x00000010)
  5050. #define RCC_APB1ENR_TIM7EN ((uint32_t)0x00000020)
  5051. #define RCC_APB1ENR_TIM12EN ((uint32_t)0x00000040)
  5052. #define RCC_APB1ENR_TIM13EN ((uint32_t)0x00000080)
  5053. #define RCC_APB1ENR_TIM14EN ((uint32_t)0x00000100)
  5054. #define RCC_APB1ENR_LPTIM1EN ((uint32_t)0x00000200)
  5055. #define RCC_APB1ENR_WWDGEN ((uint32_t)0x00000800)
  5056. #define RCC_APB1ENR_SPI2EN ((uint32_t)0x00004000)
  5057. #define RCC_APB1ENR_SPI3EN ((uint32_t)0x00008000)
  5058. #define RCC_APB1ENR_SPDIFRXEN ((uint32_t)0x00010000)
  5059. #define RCC_APB1ENR_USART2EN ((uint32_t)0x00020000)
  5060. #define RCC_APB1ENR_USART3EN ((uint32_t)0x00040000)
  5061. #define RCC_APB1ENR_UART4EN ((uint32_t)0x00080000)
  5062. #define RCC_APB1ENR_UART5EN ((uint32_t)0x00100000)
  5063. #define RCC_APB1ENR_I2C1EN ((uint32_t)0x00200000)
  5064. #define RCC_APB1ENR_I2C2EN ((uint32_t)0x00400000)
  5065. #define RCC_APB1ENR_I2C3EN ((uint32_t)0x00800000)
  5066. #define RCC_APB1ENR_I2C4EN ((uint32_t)0x01000000)
  5067. #define RCC_APB1ENR_CAN1EN ((uint32_t)0x02000000)
  5068. #define RCC_APB1ENR_CAN2EN ((uint32_t)0x04000000)
  5069. #define RCC_APB1ENR_CECEN ((uint32_t)0x08000000)
  5070. #define RCC_APB1ENR_PWREN ((uint32_t)0x10000000)
  5071. #define RCC_APB1ENR_DACEN ((uint32_t)0x20000000)
  5072. #define RCC_APB1ENR_UART7EN ((uint32_t)0x40000000)
  5073. #define RCC_APB1ENR_UART8EN ((uint32_t)0x80000000)
  5074. /******************** Bit definition for RCC_APB2ENR register ***************/
  5075. #define RCC_APB2ENR_TIM1EN ((uint32_t)0x00000001)
  5076. #define RCC_APB2ENR_TIM8EN ((uint32_t)0x00000002)
  5077. #define RCC_APB2ENR_USART1EN ((uint32_t)0x00000010)
  5078. #define RCC_APB2ENR_USART6EN ((uint32_t)0x00000020)
  5079. #define RCC_APB2ENR_ADC1EN ((uint32_t)0x00000100)
  5080. #define RCC_APB2ENR_ADC2EN ((uint32_t)0x00000200)
  5081. #define RCC_APB2ENR_ADC3EN ((uint32_t)0x00000400)
  5082. #define RCC_APB2ENR_SDMMC1EN ((uint32_t)0x00000800)
  5083. #define RCC_APB2ENR_SPI1EN ((uint32_t)0x00001000)
  5084. #define RCC_APB2ENR_SPI4EN ((uint32_t)0x00002000)
  5085. #define RCC_APB2ENR_SYSCFGEN ((uint32_t)0x00004000)
  5086. #define RCC_APB2ENR_TIM9EN ((uint32_t)0x00010000)
  5087. #define RCC_APB2ENR_TIM10EN ((uint32_t)0x00020000)
  5088. #define RCC_APB2ENR_TIM11EN ((uint32_t)0x00040000)
  5089. #define RCC_APB2ENR_SPI5EN ((uint32_t)0x00100000)
  5090. #define RCC_APB2ENR_SPI6EN ((uint32_t)0x00200000)
  5091. #define RCC_APB2ENR_SAI1EN ((uint32_t)0x00400000)
  5092. #define RCC_APB2ENR_SAI2EN ((uint32_t)0x00800000)
  5093. #define RCC_APB2ENR_LTDCEN ((uint32_t)0x04000000)
  5094. /******************** Bit definition for RCC_AHB1LPENR register *************/
  5095. #define RCC_AHB1LPENR_GPIOALPEN ((uint32_t)0x00000001)
  5096. #define RCC_AHB1LPENR_GPIOBLPEN ((uint32_t)0x00000002)
  5097. #define RCC_AHB1LPENR_GPIOCLPEN ((uint32_t)0x00000004)
  5098. #define RCC_AHB1LPENR_GPIODLPEN ((uint32_t)0x00000008)
  5099. #define RCC_AHB1LPENR_GPIOELPEN ((uint32_t)0x00000010)
  5100. #define RCC_AHB1LPENR_GPIOFLPEN ((uint32_t)0x00000020)
  5101. #define RCC_AHB1LPENR_GPIOGLPEN ((uint32_t)0x00000040)
  5102. #define RCC_AHB1LPENR_GPIOHLPEN ((uint32_t)0x00000080)
  5103. #define RCC_AHB1LPENR_GPIOILPEN ((uint32_t)0x00000100)
  5104. #define RCC_AHB1LPENR_GPIOJLPEN ((uint32_t)0x00000200)
  5105. #define RCC_AHB1LPENR_GPIOKLPEN ((uint32_t)0x00000400)
  5106. #define RCC_AHB1LPENR_CRCLPEN ((uint32_t)0x00001000)
  5107. #define RCC_AHB1LPENR_AXILPEN ((uint32_t)0x00002000)
  5108. #define RCC_AHB1LPENR_FLITFLPEN ((uint32_t)0x00008000)
  5109. #define RCC_AHB1LPENR_SRAM1LPEN ((uint32_t)0x00010000)
  5110. #define RCC_AHB1LPENR_SRAM2LPEN ((uint32_t)0x00020000)
  5111. #define RCC_AHB1LPENR_BKPSRAMLPEN ((uint32_t)0x00040000)
  5112. #define RCC_AHB1LPENR_DTCMLPEN ((uint32_t)0x00100000)
  5113. #define RCC_AHB1LPENR_DMA1LPEN ((uint32_t)0x00200000)
  5114. #define RCC_AHB1LPENR_DMA2LPEN ((uint32_t)0x00400000)
  5115. #define RCC_AHB1LPENR_DMA2DLPEN ((uint32_t)0x00800000)
  5116. #define RCC_AHB1LPENR_ETHMACLPEN ((uint32_t)0x02000000)
  5117. #define RCC_AHB1LPENR_ETHMACTXLPEN ((uint32_t)0x04000000)
  5118. #define RCC_AHB1LPENR_ETHMACRXLPEN ((uint32_t)0x08000000)
  5119. #define RCC_AHB1LPENR_ETHMACPTPLPEN ((uint32_t)0x10000000)
  5120. #define RCC_AHB1LPENR_OTGHSLPEN ((uint32_t)0x20000000)
  5121. #define RCC_AHB1LPENR_OTGHSULPILPEN ((uint32_t)0x40000000)
  5122. /******************** Bit definition for RCC_AHB2LPENR register *************/
  5123. #define RCC_AHB2LPENR_DCMILPEN ((uint32_t)0x00000001)
  5124. #define RCC_AHB2LPENR_RNGLPEN ((uint32_t)0x00000040)
  5125. #define RCC_AHB2LPENR_OTGFSLPEN ((uint32_t)0x00000080)
  5126. /******************** Bit definition for RCC_AHB3LPENR register *************/
  5127. #define RCC_AHB3LPENR_FMCLPEN ((uint32_t)0x00000001)
  5128. #define RCC_AHB3LPENR_QSPILPEN ((uint32_t)0x00000002)
  5129. /******************** Bit definition for RCC_APB1LPENR register *************/
  5130. #define RCC_APB1LPENR_TIM2LPEN ((uint32_t)0x00000001)
  5131. #define RCC_APB1LPENR_TIM3LPEN ((uint32_t)0x00000002)
  5132. #define RCC_APB1LPENR_TIM4LPEN ((uint32_t)0x00000004)
  5133. #define RCC_APB1LPENR_TIM5LPEN ((uint32_t)0x00000008)
  5134. #define RCC_APB1LPENR_TIM6LPEN ((uint32_t)0x00000010)
  5135. #define RCC_APB1LPENR_TIM7LPEN ((uint32_t)0x00000020)
  5136. #define RCC_APB1LPENR_TIM12LPEN ((uint32_t)0x00000040)
  5137. #define RCC_APB1LPENR_TIM13LPEN ((uint32_t)0x00000080)
  5138. #define RCC_APB1LPENR_TIM14LPEN ((uint32_t)0x00000100)
  5139. #define RCC_APB1LPENR_LPTIM1LPEN ((uint32_t)0x00000200)
  5140. #define RCC_APB1LPENR_WWDGLPEN ((uint32_t)0x00000800)
  5141. #define RCC_APB1LPENR_SPI2LPEN ((uint32_t)0x00004000)
  5142. #define RCC_APB1LPENR_SPI3LPEN ((uint32_t)0x00008000)
  5143. #define RCC_APB1LPENR_SPDIFRXLPEN ((uint32_t)0x00010000)
  5144. #define RCC_APB1LPENR_USART2LPEN ((uint32_t)0x00020000)
  5145. #define RCC_APB1LPENR_USART3LPEN ((uint32_t)0x00040000)
  5146. #define RCC_APB1LPENR_UART4LPEN ((uint32_t)0x00080000)
  5147. #define RCC_APB1LPENR_UART5LPEN ((uint32_t)0x00100000)
  5148. #define RCC_APB1LPENR_I2C1LPEN ((uint32_t)0x00200000)
  5149. #define RCC_APB1LPENR_I2C2LPEN ((uint32_t)0x00400000)
  5150. #define RCC_APB1LPENR_I2C3LPEN ((uint32_t)0x00800000)
  5151. #define RCC_APB1LPENR_I2C4LPEN ((uint32_t)0x01000000)
  5152. #define RCC_APB1LPENR_CAN1LPEN ((uint32_t)0x02000000)
  5153. #define RCC_APB1LPENR_CAN2LPEN ((uint32_t)0x04000000)
  5154. #define RCC_APB1LPENR_CECLPEN ((uint32_t)0x08000000)
  5155. #define RCC_APB1LPENR_PWRLPEN ((uint32_t)0x10000000)
  5156. #define RCC_APB1LPENR_DACLPEN ((uint32_t)0x20000000)
  5157. #define RCC_APB1LPENR_UART7LPEN ((uint32_t)0x40000000)
  5158. #define RCC_APB1LPENR_UART8LPEN ((uint32_t)0x80000000)
  5159. /******************** Bit definition for RCC_APB2LPENR register *************/
  5160. #define RCC_APB2LPENR_TIM1LPEN ((uint32_t)0x00000001)
  5161. #define RCC_APB2LPENR_TIM8LPEN ((uint32_t)0x00000002)
  5162. #define RCC_APB2LPENR_USART1LPEN ((uint32_t)0x00000010)
  5163. #define RCC_APB2LPENR_USART6LPEN ((uint32_t)0x00000020)
  5164. #define RCC_APB2LPENR_ADC1LPEN ((uint32_t)0x00000100)
  5165. #define RCC_APB2LPENR_ADC2LPEN ((uint32_t)0x00000200)
  5166. #define RCC_APB2LPENR_ADC3LPEN ((uint32_t)0x00000400)
  5167. #define RCC_APB2LPENR_SDMMC1LPEN ((uint32_t)0x00000800)
  5168. #define RCC_APB2LPENR_SPI1LPEN ((uint32_t)0x00001000)
  5169. #define RCC_APB2LPENR_SPI4LPEN ((uint32_t)0x00002000)
  5170. #define RCC_APB2LPENR_SYSCFGLPEN ((uint32_t)0x00004000)
  5171. #define RCC_APB2LPENR_TIM9LPEN ((uint32_t)0x00010000)
  5172. #define RCC_APB2LPENR_TIM10LPEN ((uint32_t)0x00020000)
  5173. #define RCC_APB2LPENR_TIM11LPEN ((uint32_t)0x00040000)
  5174. #define RCC_APB2LPENR_SPI5LPEN ((uint32_t)0x00100000)
  5175. #define RCC_APB2LPENR_SPI6LPEN ((uint32_t)0x00200000)
  5176. #define RCC_APB2LPENR_SAI1LPEN ((uint32_t)0x00400000)
  5177. #define RCC_APB2LPENR_SAI2LPEN ((uint32_t)0x00800000)
  5178. #define RCC_APB2LPENR_LTDCLPEN ((uint32_t)0x04000000)
  5179. /******************** Bit definition for RCC_BDCR register ******************/
  5180. #define RCC_BDCR_LSEON ((uint32_t)0x00000001)
  5181. #define RCC_BDCR_LSERDY ((uint32_t)0x00000002)
  5182. #define RCC_BDCR_LSEBYP ((uint32_t)0x00000004)
  5183. #define RCC_BDCR_LSEDRV ((uint32_t)0x00000018)
  5184. #define RCC_BDCR_LSEDRV_0 ((uint32_t)0x00000008)
  5185. #define RCC_BDCR_LSEDRV_1 ((uint32_t)0x00000010)
  5186. #define RCC_BDCR_RTCSEL ((uint32_t)0x00000300)
  5187. #define RCC_BDCR_RTCSEL_0 ((uint32_t)0x00000100)
  5188. #define RCC_BDCR_RTCSEL_1 ((uint32_t)0x00000200)
  5189. #define RCC_BDCR_RTCEN ((uint32_t)0x00008000)
  5190. #define RCC_BDCR_BDRST ((uint32_t)0x00010000)
  5191. /******************** Bit definition for RCC_CSR register *******************/
  5192. #define RCC_CSR_LSION ((uint32_t)0x00000001)
  5193. #define RCC_CSR_LSIRDY ((uint32_t)0x00000002)
  5194. #define RCC_CSR_RMVF ((uint32_t)0x01000000)
  5195. #define RCC_CSR_BORRSTF ((uint32_t)0x02000000)
  5196. #define RCC_CSR_PINRSTF ((uint32_t)0x04000000)
  5197. #define RCC_CSR_PORRSTF ((uint32_t)0x08000000)
  5198. #define RCC_CSR_SFTRSTF ((uint32_t)0x10000000)
  5199. #define RCC_CSR_IWDGRSTF ((uint32_t)0x20000000)
  5200. #define RCC_CSR_WWDGRSTF ((uint32_t)0x40000000)
  5201. #define RCC_CSR_LPWRRSTF ((uint32_t)0x80000000)
  5202. /******************** Bit definition for RCC_SSCGR register *****************/
  5203. #define RCC_SSCGR_MODPER ((uint32_t)0x00001FFF)
  5204. #define RCC_SSCGR_INCSTEP ((uint32_t)0x0FFFE000)
  5205. #define RCC_SSCGR_SPREADSEL ((uint32_t)0x40000000)
  5206. #define RCC_SSCGR_SSCGEN ((uint32_t)0x80000000)
  5207. /******************** Bit definition for RCC_PLLI2SCFGR register ************/
  5208. #define RCC_PLLI2SCFGR_PLLI2SN ((uint32_t)0x00007FC0)
  5209. #define RCC_PLLI2SCFGR_PLLI2SN_0 ((uint32_t)0x00000040)
  5210. #define RCC_PLLI2SCFGR_PLLI2SN_1 ((uint32_t)0x00000080)
  5211. #define RCC_PLLI2SCFGR_PLLI2SN_2 ((uint32_t)0x00000100)
  5212. #define RCC_PLLI2SCFGR_PLLI2SN_3 ((uint32_t)0x00000200)
  5213. #define RCC_PLLI2SCFGR_PLLI2SN_4 ((uint32_t)0x00000400)
  5214. #define RCC_PLLI2SCFGR_PLLI2SN_5 ((uint32_t)0x00000800)
  5215. #define RCC_PLLI2SCFGR_PLLI2SN_6 ((uint32_t)0x00001000)
  5216. #define RCC_PLLI2SCFGR_PLLI2SN_7 ((uint32_t)0x00002000)
  5217. #define RCC_PLLI2SCFGR_PLLI2SN_8 ((uint32_t)0x00004000)
  5218. #define RCC_PLLI2SCFGR_PLLI2SP ((uint32_t)0x00030000)
  5219. #define RCC_PLLI2SCFGR_PLLI2SP_0 ((uint32_t)0x00010000)
  5220. #define RCC_PLLI2SCFGR_PLLI2SP_1 ((uint32_t)0x00020000)
  5221. #define RCC_PLLI2SCFGR_PLLI2SQ ((uint32_t)0x0F000000)
  5222. #define RCC_PLLI2SCFGR_PLLI2SQ_0 ((uint32_t)0x01000000)
  5223. #define RCC_PLLI2SCFGR_PLLI2SQ_1 ((uint32_t)0x02000000)
  5224. #define RCC_PLLI2SCFGR_PLLI2SQ_2 ((uint32_t)0x04000000)
  5225. #define RCC_PLLI2SCFGR_PLLI2SQ_3 ((uint32_t)0x08000000)
  5226. #define RCC_PLLI2SCFGR_PLLI2SR ((uint32_t)0x70000000)
  5227. #define RCC_PLLI2SCFGR_PLLI2SR_0 ((uint32_t)0x10000000)
  5228. #define RCC_PLLI2SCFGR_PLLI2SR_1 ((uint32_t)0x20000000)
  5229. #define RCC_PLLI2SCFGR_PLLI2SR_2 ((uint32_t)0x40000000)
  5230. /******************** Bit definition for RCC_PLLSAICFGR register ************/
  5231. #define RCC_PLLSAICFGR_PLLSAIN ((uint32_t)0x00007FC0)
  5232. #define RCC_PLLSAICFGR_PLLSAIN_0 ((uint32_t)0x00000040)
  5233. #define RCC_PLLSAICFGR_PLLSAIN_1 ((uint32_t)0x00000080)
  5234. #define RCC_PLLSAICFGR_PLLSAIN_2 ((uint32_t)0x00000100)
  5235. #define RCC_PLLSAICFGR_PLLSAIN_3 ((uint32_t)0x00000200)
  5236. #define RCC_PLLSAICFGR_PLLSAIN_4 ((uint32_t)0x00000400)
  5237. #define RCC_PLLSAICFGR_PLLSAIN_5 ((uint32_t)0x00000800)
  5238. #define RCC_PLLSAICFGR_PLLSAIN_6 ((uint32_t)0x00001000)
  5239. #define RCC_PLLSAICFGR_PLLSAIN_7 ((uint32_t)0x00002000)
  5240. #define RCC_PLLSAICFGR_PLLSAIN_8 ((uint32_t)0x00004000)
  5241. #define RCC_PLLSAICFGR_PLLSAIP ((uint32_t)0x00030000)
  5242. #define RCC_PLLSAICFGR_PLLSAIP_0 ((uint32_t)0x00010000)
  5243. #define RCC_PLLSAICFGR_PLLSAIP_1 ((uint32_t)0x00020000)
  5244. #define RCC_PLLSAICFGR_PLLSAIQ ((uint32_t)0x0F000000)
  5245. #define RCC_PLLSAICFGR_PLLSAIQ_0 ((uint32_t)0x01000000)
  5246. #define RCC_PLLSAICFGR_PLLSAIQ_1 ((uint32_t)0x02000000)
  5247. #define RCC_PLLSAICFGR_PLLSAIQ_2 ((uint32_t)0x04000000)
  5248. #define RCC_PLLSAICFGR_PLLSAIQ_3 ((uint32_t)0x08000000)
  5249. #define RCC_PLLSAICFGR_PLLSAIR ((uint32_t)0x70000000)
  5250. #define RCC_PLLSAICFGR_PLLSAIR_0 ((uint32_t)0x10000000)
  5251. #define RCC_PLLSAICFGR_PLLSAIR_1 ((uint32_t)0x20000000)
  5252. #define RCC_PLLSAICFGR_PLLSAIR_2 ((uint32_t)0x40000000)
  5253. /******************** Bit definition for RCC_DCKCFGR1 register ***************/
  5254. #define RCC_DCKCFGR1_PLLI2SDIVQ ((uint32_t)0x0000001F)
  5255. #define RCC_DCKCFGR1_PLLI2SDIVQ_0 ((uint32_t)0x00000001)
  5256. #define RCC_DCKCFGR1_PLLI2SDIVQ_1 ((uint32_t)0x00000002)
  5257. #define RCC_DCKCFGR1_PLLI2SDIVQ_2 ((uint32_t)0x00000004)
  5258. #define RCC_DCKCFGR1_PLLI2SDIVQ_3 ((uint32_t)0x00000008)
  5259. #define RCC_DCKCFGR1_PLLI2SDIVQ_4 ((uint32_t)0x00000010)
  5260. #define RCC_DCKCFGR1_PLLSAIDIVQ ((uint32_t)0x00001F00)
  5261. #define RCC_DCKCFGR1_PLLSAIDIVQ_0 ((uint32_t)0x00000100)
  5262. #define RCC_DCKCFGR1_PLLSAIDIVQ_1 ((uint32_t)0x00000200)
  5263. #define RCC_DCKCFGR1_PLLSAIDIVQ_2 ((uint32_t)0x00000400)
  5264. #define RCC_DCKCFGR1_PLLSAIDIVQ_3 ((uint32_t)0x00000800)
  5265. #define RCC_DCKCFGR1_PLLSAIDIVQ_4 ((uint32_t)0x00001000)
  5266. #define RCC_DCKCFGR1_PLLSAIDIVR ((uint32_t)0x00030000)
  5267. #define RCC_DCKCFGR1_PLLSAIDIVR_0 ((uint32_t)0x00010000)
  5268. #define RCC_DCKCFGR1_PLLSAIDIVR_1 ((uint32_t)0x00020000)
  5269. #define RCC_DCKCFGR1_SAI1SEL ((uint32_t)0x00300000)
  5270. #define RCC_DCKCFGR1_SAI1SEL_0 ((uint32_t)0x00100000)
  5271. #define RCC_DCKCFGR1_SAI1SEL_1 ((uint32_t)0x00200000)
  5272. #define RCC_DCKCFGR1_SAI2SEL ((uint32_t)0x00C00000)
  5273. #define RCC_DCKCFGR1_SAI2SEL_0 ((uint32_t)0x00400000)
  5274. #define RCC_DCKCFGR1_SAI2SEL_1 ((uint32_t)0x00800000)
  5275. #define RCC_DCKCFGR1_TIMPRE ((uint32_t)0x01000000)
  5276. /******************** Bit definition for RCC_DCKCFGR2 register ***************/
  5277. #define RCC_DCKCFGR2_USART1SEL ((uint32_t)0x00000003)
  5278. #define RCC_DCKCFGR2_USART1SEL_0 ((uint32_t)0x00000001)
  5279. #define RCC_DCKCFGR2_USART1SEL_1 ((uint32_t)0x00000002)
  5280. #define RCC_DCKCFGR2_USART2SEL ((uint32_t)0x0000000C)
  5281. #define RCC_DCKCFGR2_USART2SEL_0 ((uint32_t)0x00000004)
  5282. #define RCC_DCKCFGR2_USART2SEL_1 ((uint32_t)0x00000008)
  5283. #define RCC_DCKCFGR2_USART3SEL ((uint32_t)0x00000030)
  5284. #define RCC_DCKCFGR2_USART3SEL_0 ((uint32_t)0x00000010)
  5285. #define RCC_DCKCFGR2_USART3SEL_1 ((uint32_t)0x00000020)
  5286. #define RCC_DCKCFGR2_UART4SEL ((uint32_t)0x000000C0)
  5287. #define RCC_DCKCFGR2_UART4SEL_0 ((uint32_t)0x00000040)
  5288. #define RCC_DCKCFGR2_UART4SEL_1 ((uint32_t)0x00000080)
  5289. #define RCC_DCKCFGR2_UART5SEL ((uint32_t)0x00000300)
  5290. #define RCC_DCKCFGR2_UART5SEL_0 ((uint32_t)0x00000100)
  5291. #define RCC_DCKCFGR2_UART5SEL_1 ((uint32_t)0x00000200)
  5292. #define RCC_DCKCFGR2_USART6SEL ((uint32_t)0x00000C00)
  5293. #define RCC_DCKCFGR2_USART6SEL_0 ((uint32_t)0x00000400)
  5294. #define RCC_DCKCFGR2_USART6SEL_1 ((uint32_t)0x00000800)
  5295. #define RCC_DCKCFGR2_UART7SEL ((uint32_t)0x00003000)
  5296. #define RCC_DCKCFGR2_UART7SEL_0 ((uint32_t)0x00001000)
  5297. #define RCC_DCKCFGR2_UART7SEL_1 ((uint32_t)0x00002000)
  5298. #define RCC_DCKCFGR2_UART8SEL ((uint32_t)0x0000C000)
  5299. #define RCC_DCKCFGR2_UART8SEL_0 ((uint32_t)0x00004000)
  5300. #define RCC_DCKCFGR2_UART8SEL_1 ((uint32_t)0x00008000)
  5301. #define RCC_DCKCFGR2_I2C1SEL ((uint32_t)0x00030000)
  5302. #define RCC_DCKCFGR2_I2C1SEL_0 ((uint32_t)0x00010000)
  5303. #define RCC_DCKCFGR2_I2C1SEL_1 ((uint32_t)0x00020000)
  5304. #define RCC_DCKCFGR2_I2C2SEL ((uint32_t)0x000C0000)
  5305. #define RCC_DCKCFGR2_I2C2SEL_0 ((uint32_t)0x00040000)
  5306. #define RCC_DCKCFGR2_I2C2SEL_1 ((uint32_t)0x00080000)
  5307. #define RCC_DCKCFGR2_I2C3SEL ((uint32_t)0x00300000)
  5308. #define RCC_DCKCFGR2_I2C3SEL_0 ((uint32_t)0x00100000)
  5309. #define RCC_DCKCFGR2_I2C3SEL_1 ((uint32_t)0x00200000)
  5310. #define RCC_DCKCFGR2_I2C4SEL ((uint32_t)0x00C00000)
  5311. #define RCC_DCKCFGR2_I2C4SEL_0 ((uint32_t)0x00400000)
  5312. #define RCC_DCKCFGR2_I2C4SEL_1 ((uint32_t)0x00800000)
  5313. #define RCC_DCKCFGR2_LPTIM1SEL ((uint32_t)0x03000000)
  5314. #define RCC_DCKCFGR2_LPTIM1SEL_0 ((uint32_t)0x01000000)
  5315. #define RCC_DCKCFGR2_LPTIM1SEL_1 ((uint32_t)0x02000000)
  5316. #define RCC_DCKCFGR2_CECSEL ((uint32_t)0x04000000)
  5317. #define RCC_DCKCFGR2_CK48MSEL ((uint32_t)0x08000000)
  5318. #define RCC_DCKCFGR2_SDMMC1SEL ((uint32_t)0x10000000)
  5319. /******************************************************************************/
  5320. /* */
  5321. /* RNG */
  5322. /* */
  5323. /******************************************************************************/
  5324. /******************** Bits definition for RNG_CR register *******************/
  5325. #define RNG_CR_RNGEN ((uint32_t)0x00000004)
  5326. #define RNG_CR_IE ((uint32_t)0x00000008)
  5327. /******************** Bits definition for RNG_SR register *******************/
  5328. #define RNG_SR_DRDY ((uint32_t)0x00000001)
  5329. #define RNG_SR_CECS ((uint32_t)0x00000002)
  5330. #define RNG_SR_SECS ((uint32_t)0x00000004)
  5331. #define RNG_SR_CEIS ((uint32_t)0x00000020)
  5332. #define RNG_SR_SEIS ((uint32_t)0x00000040)
  5333. /******************************************************************************/
  5334. /* */
  5335. /* Real-Time Clock (RTC) */
  5336. /* */
  5337. /******************************************************************************/
  5338. /******************** Bits definition for RTC_TR register *******************/
  5339. #define RTC_TR_PM ((uint32_t)0x00400000)
  5340. #define RTC_TR_HT ((uint32_t)0x00300000)
  5341. #define RTC_TR_HT_0 ((uint32_t)0x00100000)
  5342. #define RTC_TR_HT_1 ((uint32_t)0x00200000)
  5343. #define RTC_TR_HU ((uint32_t)0x000F0000)
  5344. #define RTC_TR_HU_0 ((uint32_t)0x00010000)
  5345. #define RTC_TR_HU_1 ((uint32_t)0x00020000)
  5346. #define RTC_TR_HU_2 ((uint32_t)0x00040000)
  5347. #define RTC_TR_HU_3 ((uint32_t)0x00080000)
  5348. #define RTC_TR_MNT ((uint32_t)0x00007000)
  5349. #define RTC_TR_MNT_0 ((uint32_t)0x00001000)
  5350. #define RTC_TR_MNT_1 ((uint32_t)0x00002000)
  5351. #define RTC_TR_MNT_2 ((uint32_t)0x00004000)
  5352. #define RTC_TR_MNU ((uint32_t)0x00000F00)
  5353. #define RTC_TR_MNU_0 ((uint32_t)0x00000100)
  5354. #define RTC_TR_MNU_1 ((uint32_t)0x00000200)
  5355. #define RTC_TR_MNU_2 ((uint32_t)0x00000400)
  5356. #define RTC_TR_MNU_3 ((uint32_t)0x00000800)
  5357. #define RTC_TR_ST ((uint32_t)0x00000070)
  5358. #define RTC_TR_ST_0 ((uint32_t)0x00000010)
  5359. #define RTC_TR_ST_1 ((uint32_t)0x00000020)
  5360. #define RTC_TR_ST_2 ((uint32_t)0x00000040)
  5361. #define RTC_TR_SU ((uint32_t)0x0000000F)
  5362. #define RTC_TR_SU_0 ((uint32_t)0x00000001)
  5363. #define RTC_TR_SU_1 ((uint32_t)0x00000002)
  5364. #define RTC_TR_SU_2 ((uint32_t)0x00000004)
  5365. #define RTC_TR_SU_3 ((uint32_t)0x00000008)
  5366. /******************** Bits definition for RTC_DR register *******************/
  5367. #define RTC_DR_YT ((uint32_t)0x00F00000)
  5368. #define RTC_DR_YT_0 ((uint32_t)0x00100000)
  5369. #define RTC_DR_YT_1 ((uint32_t)0x00200000)
  5370. #define RTC_DR_YT_2 ((uint32_t)0x00400000)
  5371. #define RTC_DR_YT_3 ((uint32_t)0x00800000)
  5372. #define RTC_DR_YU ((uint32_t)0x000F0000)
  5373. #define RTC_DR_YU_0 ((uint32_t)0x00010000)
  5374. #define RTC_DR_YU_1 ((uint32_t)0x00020000)
  5375. #define RTC_DR_YU_2 ((uint32_t)0x00040000)
  5376. #define RTC_DR_YU_3 ((uint32_t)0x00080000)
  5377. #define RTC_DR_WDU ((uint32_t)0x0000E000)
  5378. #define RTC_DR_WDU_0 ((uint32_t)0x00002000)
  5379. #define RTC_DR_WDU_1 ((uint32_t)0x00004000)
  5380. #define RTC_DR_WDU_2 ((uint32_t)0x00008000)
  5381. #define RTC_DR_MT ((uint32_t)0x00001000)
  5382. #define RTC_DR_MU ((uint32_t)0x00000F00)
  5383. #define RTC_DR_MU_0 ((uint32_t)0x00000100)
  5384. #define RTC_DR_MU_1 ((uint32_t)0x00000200)
  5385. #define RTC_DR_MU_2 ((uint32_t)0x00000400)
  5386. #define RTC_DR_MU_3 ((uint32_t)0x00000800)
  5387. #define RTC_DR_DT ((uint32_t)0x00000030)
  5388. #define RTC_DR_DT_0 ((uint32_t)0x00000010)
  5389. #define RTC_DR_DT_1 ((uint32_t)0x00000020)
  5390. #define RTC_DR_DU ((uint32_t)0x0000000F)
  5391. #define RTC_DR_DU_0 ((uint32_t)0x00000001)
  5392. #define RTC_DR_DU_1 ((uint32_t)0x00000002)
  5393. #define RTC_DR_DU_2 ((uint32_t)0x00000004)
  5394. #define RTC_DR_DU_3 ((uint32_t)0x00000008)
  5395. /******************** Bits definition for RTC_CR register *******************/
  5396. #define RTC_CR_ITSE ((uint32_t)0x01000000)
  5397. #define RTC_CR_COE ((uint32_t)0x00800000)
  5398. #define RTC_CR_OSEL ((uint32_t)0x00600000)
  5399. #define RTC_CR_OSEL_0 ((uint32_t)0x00200000)
  5400. #define RTC_CR_OSEL_1 ((uint32_t)0x00400000)
  5401. #define RTC_CR_POL ((uint32_t)0x00100000)
  5402. #define RTC_CR_COSEL ((uint32_t)0x00080000)
  5403. #define RTC_CR_BCK ((uint32_t)0x00040000)
  5404. #define RTC_CR_SUB1H ((uint32_t)0x00020000)
  5405. #define RTC_CR_ADD1H ((uint32_t)0x00010000)
  5406. #define RTC_CR_TSIE ((uint32_t)0x00008000)
  5407. #define RTC_CR_WUTIE ((uint32_t)0x00004000)
  5408. #define RTC_CR_ALRBIE ((uint32_t)0x00002000)
  5409. #define RTC_CR_ALRAIE ((uint32_t)0x00001000)
  5410. #define RTC_CR_TSE ((uint32_t)0x00000800)
  5411. #define RTC_CR_WUTE ((uint32_t)0x00000400)
  5412. #define RTC_CR_ALRBE ((uint32_t)0x00000200)
  5413. #define RTC_CR_ALRAE ((uint32_t)0x00000100)
  5414. #define RTC_CR_FMT ((uint32_t)0x00000040)
  5415. #define RTC_CR_BYPSHAD ((uint32_t)0x00000020)
  5416. #define RTC_CR_REFCKON ((uint32_t)0x00000010)
  5417. #define RTC_CR_TSEDGE ((uint32_t)0x00000008)
  5418. #define RTC_CR_WUCKSEL ((uint32_t)0x00000007)
  5419. #define RTC_CR_WUCKSEL_0 ((uint32_t)0x00000001)
  5420. #define RTC_CR_WUCKSEL_1 ((uint32_t)0x00000002)
  5421. #define RTC_CR_WUCKSEL_2 ((uint32_t)0x00000004)
  5422. /******************** Bits definition for RTC_ISR register ******************/
  5423. #define RTC_ISR_ITSF ((uint32_t)0x00020000)
  5424. #define RTC_ISR_RECALPF ((uint32_t)0x00010000)
  5425. #define RTC_ISR_TAMP3F ((uint32_t)0x00008000)
  5426. #define RTC_ISR_TAMP2F ((uint32_t)0x00004000)
  5427. #define RTC_ISR_TAMP1F ((uint32_t)0x00002000)
  5428. #define RTC_ISR_TSOVF ((uint32_t)0x00001000)
  5429. #define RTC_ISR_TSF ((uint32_t)0x00000800)
  5430. #define RTC_ISR_WUTF ((uint32_t)0x00000400)
  5431. #define RTC_ISR_ALRBF ((uint32_t)0x00000200)
  5432. #define RTC_ISR_ALRAF ((uint32_t)0x00000100)
  5433. #define RTC_ISR_INIT ((uint32_t)0x00000080)
  5434. #define RTC_ISR_INITF ((uint32_t)0x00000040)
  5435. #define RTC_ISR_RSF ((uint32_t)0x00000020)
  5436. #define RTC_ISR_INITS ((uint32_t)0x00000010)
  5437. #define RTC_ISR_SHPF ((uint32_t)0x00000008)
  5438. #define RTC_ISR_WUTWF ((uint32_t)0x00000004)
  5439. #define RTC_ISR_ALRBWF ((uint32_t)0x00000002)
  5440. #define RTC_ISR_ALRAWF ((uint32_t)0x00000001)
  5441. /******************** Bits definition for RTC_PRER register *****************/
  5442. #define RTC_PRER_PREDIV_A ((uint32_t)0x007F0000)
  5443. #define RTC_PRER_PREDIV_S ((uint32_t)0x00007FFF)
  5444. /******************** Bits definition for RTC_WUTR register *****************/
  5445. #define RTC_WUTR_WUT ((uint32_t)0x0000FFFF)
  5446. /******************** Bits definition for RTC_ALRMAR register ***************/
  5447. #define RTC_ALRMAR_MSK4 ((uint32_t)0x80000000)
  5448. #define RTC_ALRMAR_WDSEL ((uint32_t)0x40000000)
  5449. #define RTC_ALRMAR_DT ((uint32_t)0x30000000)
  5450. #define RTC_ALRMAR_DT_0 ((uint32_t)0x10000000)
  5451. #define RTC_ALRMAR_DT_1 ((uint32_t)0x20000000)
  5452. #define RTC_ALRMAR_DU ((uint32_t)0x0F000000)
  5453. #define RTC_ALRMAR_DU_0 ((uint32_t)0x01000000)
  5454. #define RTC_ALRMAR_DU_1 ((uint32_t)0x02000000)
  5455. #define RTC_ALRMAR_DU_2 ((uint32_t)0x04000000)
  5456. #define RTC_ALRMAR_DU_3 ((uint32_t)0x08000000)
  5457. #define RTC_ALRMAR_MSK3 ((uint32_t)0x00800000)
  5458. #define RTC_ALRMAR_PM ((uint32_t)0x00400000)
  5459. #define RTC_ALRMAR_HT ((uint32_t)0x00300000)
  5460. #define RTC_ALRMAR_HT_0 ((uint32_t)0x00100000)
  5461. #define RTC_ALRMAR_HT_1 ((uint32_t)0x00200000)
  5462. #define RTC_ALRMAR_HU ((uint32_t)0x000F0000)
  5463. #define RTC_ALRMAR_HU_0 ((uint32_t)0x00010000)
  5464. #define RTC_ALRMAR_HU_1 ((uint32_t)0x00020000)
  5465. #define RTC_ALRMAR_HU_2 ((uint32_t)0x00040000)
  5466. #define RTC_ALRMAR_HU_3 ((uint32_t)0x00080000)
  5467. #define RTC_ALRMAR_MSK2 ((uint32_t)0x00008000)
  5468. #define RTC_ALRMAR_MNT ((uint32_t)0x00007000)
  5469. #define RTC_ALRMAR_MNT_0 ((uint32_t)0x00001000)
  5470. #define RTC_ALRMAR_MNT_1 ((uint32_t)0x00002000)
  5471. #define RTC_ALRMAR_MNT_2 ((uint32_t)0x00004000)
  5472. #define RTC_ALRMAR_MNU ((uint32_t)0x00000F00)
  5473. #define RTC_ALRMAR_MNU_0 ((uint32_t)0x00000100)
  5474. #define RTC_ALRMAR_MNU_1 ((uint32_t)0x00000200)
  5475. #define RTC_ALRMAR_MNU_2 ((uint32_t)0x00000400)
  5476. #define RTC_ALRMAR_MNU_3 ((uint32_t)0x00000800)
  5477. #define RTC_ALRMAR_MSK1 ((uint32_t)0x00000080)
  5478. #define RTC_ALRMAR_ST ((uint32_t)0x00000070)
  5479. #define RTC_ALRMAR_ST_0 ((uint32_t)0x00000010)
  5480. #define RTC_ALRMAR_ST_1 ((uint32_t)0x00000020)
  5481. #define RTC_ALRMAR_ST_2 ((uint32_t)0x00000040)
  5482. #define RTC_ALRMAR_SU ((uint32_t)0x0000000F)
  5483. #define RTC_ALRMAR_SU_0 ((uint32_t)0x00000001)
  5484. #define RTC_ALRMAR_SU_1 ((uint32_t)0x00000002)
  5485. #define RTC_ALRMAR_SU_2 ((uint32_t)0x00000004)
  5486. #define RTC_ALRMAR_SU_3 ((uint32_t)0x00000008)
  5487. /******************** Bits definition for RTC_ALRMBR register ***************/
  5488. #define RTC_ALRMBR_MSK4 ((uint32_t)0x80000000)
  5489. #define RTC_ALRMBR_WDSEL ((uint32_t)0x40000000)
  5490. #define RTC_ALRMBR_DT ((uint32_t)0x30000000)
  5491. #define RTC_ALRMBR_DT_0 ((uint32_t)0x10000000)
  5492. #define RTC_ALRMBR_DT_1 ((uint32_t)0x20000000)
  5493. #define RTC_ALRMBR_DU ((uint32_t)0x0F000000)
  5494. #define RTC_ALRMBR_DU_0 ((uint32_t)0x01000000)
  5495. #define RTC_ALRMBR_DU_1 ((uint32_t)0x02000000)
  5496. #define RTC_ALRMBR_DU_2 ((uint32_t)0x04000000)
  5497. #define RTC_ALRMBR_DU_3 ((uint32_t)0x08000000)
  5498. #define RTC_ALRMBR_MSK3 ((uint32_t)0x00800000)
  5499. #define RTC_ALRMBR_PM ((uint32_t)0x00400000)
  5500. #define RTC_ALRMBR_HT ((uint32_t)0x00300000)
  5501. #define RTC_ALRMBR_HT_0 ((uint32_t)0x00100000)
  5502. #define RTC_ALRMBR_HT_1 ((uint32_t)0x00200000)
  5503. #define RTC_ALRMBR_HU ((uint32_t)0x000F0000)
  5504. #define RTC_ALRMBR_HU_0 ((uint32_t)0x00010000)
  5505. #define RTC_ALRMBR_HU_1 ((uint32_t)0x00020000)
  5506. #define RTC_ALRMBR_HU_2 ((uint32_t)0x00040000)
  5507. #define RTC_ALRMBR_HU_3 ((uint32_t)0x00080000)
  5508. #define RTC_ALRMBR_MSK2 ((uint32_t)0x00008000)
  5509. #define RTC_ALRMBR_MNT ((uint32_t)0x00007000)
  5510. #define RTC_ALRMBR_MNT_0 ((uint32_t)0x00001000)
  5511. #define RTC_ALRMBR_MNT_1 ((uint32_t)0x00002000)
  5512. #define RTC_ALRMBR_MNT_2 ((uint32_t)0x00004000)
  5513. #define RTC_ALRMBR_MNU ((uint32_t)0x00000F00)
  5514. #define RTC_ALRMBR_MNU_0 ((uint32_t)0x00000100)
  5515. #define RTC_ALRMBR_MNU_1 ((uint32_t)0x00000200)
  5516. #define RTC_ALRMBR_MNU_2 ((uint32_t)0x00000400)
  5517. #define RTC_ALRMBR_MNU_3 ((uint32_t)0x00000800)
  5518. #define RTC_ALRMBR_MSK1 ((uint32_t)0x00000080)
  5519. #define RTC_ALRMBR_ST ((uint32_t)0x00000070)
  5520. #define RTC_ALRMBR_ST_0 ((uint32_t)0x00000010)
  5521. #define RTC_ALRMBR_ST_1 ((uint32_t)0x00000020)
  5522. #define RTC_ALRMBR_ST_2 ((uint32_t)0x00000040)
  5523. #define RTC_ALRMBR_SU ((uint32_t)0x0000000F)
  5524. #define RTC_ALRMBR_SU_0 ((uint32_t)0x00000001)
  5525. #define RTC_ALRMBR_SU_1 ((uint32_t)0x00000002)
  5526. #define RTC_ALRMBR_SU_2 ((uint32_t)0x00000004)
  5527. #define RTC_ALRMBR_SU_3 ((uint32_t)0x00000008)
  5528. /******************** Bits definition for RTC_WPR register ******************/
  5529. #define RTC_WPR_KEY ((uint32_t)0x000000FF)
  5530. /******************** Bits definition for RTC_SSR register ******************/
  5531. #define RTC_SSR_SS ((uint32_t)0x0000FFFF)
  5532. /******************** Bits definition for RTC_SHIFTR register ***************/
  5533. #define RTC_SHIFTR_SUBFS ((uint32_t)0x00007FFF)
  5534. #define RTC_SHIFTR_ADD1S ((uint32_t)0x80000000)
  5535. /******************** Bits definition for RTC_TSTR register *****************/
  5536. #define RTC_TSTR_PM ((uint32_t)0x00400000)
  5537. #define RTC_TSTR_HT ((uint32_t)0x00300000)
  5538. #define RTC_TSTR_HT_0 ((uint32_t)0x00100000)
  5539. #define RTC_TSTR_HT_1 ((uint32_t)0x00200000)
  5540. #define RTC_TSTR_HU ((uint32_t)0x000F0000)
  5541. #define RTC_TSTR_HU_0 ((uint32_t)0x00010000)
  5542. #define RTC_TSTR_HU_1 ((uint32_t)0x00020000)
  5543. #define RTC_TSTR_HU_2 ((uint32_t)0x00040000)
  5544. #define RTC_TSTR_HU_3 ((uint32_t)0x00080000)
  5545. #define RTC_TSTR_MNT ((uint32_t)0x00007000)
  5546. #define RTC_TSTR_MNT_0 ((uint32_t)0x00001000)
  5547. #define RTC_TSTR_MNT_1 ((uint32_t)0x00002000)
  5548. #define RTC_TSTR_MNT_2 ((uint32_t)0x00004000)
  5549. #define RTC_TSTR_MNU ((uint32_t)0x00000F00)
  5550. #define RTC_TSTR_MNU_0 ((uint32_t)0x00000100)
  5551. #define RTC_TSTR_MNU_1 ((uint32_t)0x00000200)
  5552. #define RTC_TSTR_MNU_2 ((uint32_t)0x00000400)
  5553. #define RTC_TSTR_MNU_3 ((uint32_t)0x00000800)
  5554. #define RTC_TSTR_ST ((uint32_t)0x00000070)
  5555. #define RTC_TSTR_ST_0 ((uint32_t)0x00000010)
  5556. #define RTC_TSTR_ST_1 ((uint32_t)0x00000020)
  5557. #define RTC_TSTR_ST_2 ((uint32_t)0x00000040)
  5558. #define RTC_TSTR_SU ((uint32_t)0x0000000F)
  5559. #define RTC_TSTR_SU_0 ((uint32_t)0x00000001)
  5560. #define RTC_TSTR_SU_1 ((uint32_t)0x00000002)
  5561. #define RTC_TSTR_SU_2 ((uint32_t)0x00000004)
  5562. #define RTC_TSTR_SU_3 ((uint32_t)0x00000008)
  5563. /******************** Bits definition for RTC_TSDR register *****************/
  5564. #define RTC_TSDR_WDU ((uint32_t)0x0000E000)
  5565. #define RTC_TSDR_WDU_0 ((uint32_t)0x00002000)
  5566. #define RTC_TSDR_WDU_1 ((uint32_t)0x00004000)
  5567. #define RTC_TSDR_WDU_2 ((uint32_t)0x00008000)
  5568. #define RTC_TSDR_MT ((uint32_t)0x00001000)
  5569. #define RTC_TSDR_MU ((uint32_t)0x00000F00)
  5570. #define RTC_TSDR_MU_0 ((uint32_t)0x00000100)
  5571. #define RTC_TSDR_MU_1 ((uint32_t)0x00000200)
  5572. #define RTC_TSDR_MU_2 ((uint32_t)0x00000400)
  5573. #define RTC_TSDR_MU_3 ((uint32_t)0x00000800)
  5574. #define RTC_TSDR_DT ((uint32_t)0x00000030)
  5575. #define RTC_TSDR_DT_0 ((uint32_t)0x00000010)
  5576. #define RTC_TSDR_DT_1 ((uint32_t)0x00000020)
  5577. #define RTC_TSDR_DU ((uint32_t)0x0000000F)
  5578. #define RTC_TSDR_DU_0 ((uint32_t)0x00000001)
  5579. #define RTC_TSDR_DU_1 ((uint32_t)0x00000002)
  5580. #define RTC_TSDR_DU_2 ((uint32_t)0x00000004)
  5581. #define RTC_TSDR_DU_3 ((uint32_t)0x00000008)
  5582. /******************** Bits definition for RTC_TSSSR register ****************/
  5583. #define RTC_TSSSR_SS ((uint32_t)0x0000FFFF)
  5584. /******************** Bits definition for RTC_CAL register *****************/
  5585. #define RTC_CALR_CALP ((uint32_t)0x00008000)
  5586. #define RTC_CALR_CALW8 ((uint32_t)0x00004000)
  5587. #define RTC_CALR_CALW16 ((uint32_t)0x00002000)
  5588. #define RTC_CALR_CALM ((uint32_t)0x000001FF)
  5589. #define RTC_CALR_CALM_0 ((uint32_t)0x00000001)
  5590. #define RTC_CALR_CALM_1 ((uint32_t)0x00000002)
  5591. #define RTC_CALR_CALM_2 ((uint32_t)0x00000004)
  5592. #define RTC_CALR_CALM_3 ((uint32_t)0x00000008)
  5593. #define RTC_CALR_CALM_4 ((uint32_t)0x00000010)
  5594. #define RTC_CALR_CALM_5 ((uint32_t)0x00000020)
  5595. #define RTC_CALR_CALM_6 ((uint32_t)0x00000040)
  5596. #define RTC_CALR_CALM_7 ((uint32_t)0x00000080)
  5597. #define RTC_CALR_CALM_8 ((uint32_t)0x00000100)
  5598. /******************** Bits definition for RTC_TAMPCR register ****************/
  5599. #define RTC_TAMPCR_TAMP3MF ((uint32_t)0x01000000)
  5600. #define RTC_TAMPCR_TAMP3NOERASE ((uint32_t)0x00800000)
  5601. #define RTC_TAMPCR_TAMP3IE ((uint32_t)0x00400000)
  5602. #define RTC_TAMPCR_TAMP2MF ((uint32_t)0x00200000)
  5603. #define RTC_TAMPCR_TAMP2NOERASE ((uint32_t)0x00100000)
  5604. #define RTC_TAMPCR_TAMP2IE ((uint32_t)0x00080000)
  5605. #define RTC_TAMPCR_TAMP1MF ((uint32_t)0x00040000)
  5606. #define RTC_TAMPCR_TAMP1NOERASE ((uint32_t)0x00020000)
  5607. #define RTC_TAMPCR_TAMP1IE ((uint32_t)0x00010000)
  5608. #define RTC_TAMPCR_TAMPPUDIS ((uint32_t)0x00008000)
  5609. #define RTC_TAMPCR_TAMPPRCH ((uint32_t)0x00006000)
  5610. #define RTC_TAMPCR_TAMPPRCH_0 ((uint32_t)0x00002000)
  5611. #define RTC_TAMPCR_TAMPPRCH_1 ((uint32_t)0x00004000)
  5612. #define RTC_TAMPCR_TAMPFLT ((uint32_t)0x00001800)
  5613. #define RTC_TAMPCR_TAMPFLT_0 ((uint32_t)0x00000800)
  5614. #define RTC_TAMPCR_TAMPFLT_1 ((uint32_t)0x00001000)
  5615. #define RTC_TAMPCR_TAMPFREQ ((uint32_t)0x00000700)
  5616. #define RTC_TAMPCR_TAMPFREQ_0 ((uint32_t)0x00000100)
  5617. #define RTC_TAMPCR_TAMPFREQ_1 ((uint32_t)0x00000200)
  5618. #define RTC_TAMPCR_TAMPFREQ_2 ((uint32_t)0x00000400)
  5619. #define RTC_TAMPCR_TAMPTS ((uint32_t)0x00000080)
  5620. #define RTC_TAMPCR_TAMP3_TRG ((uint32_t)0x00000040)
  5621. #define RTC_TAMPCR_TAMP3E ((uint32_t)0x00000020)
  5622. #define RTC_TAMPCR_TAMP2_TRG ((uint32_t)0x00000010)
  5623. #define RTC_TAMPCR_TAMP2E ((uint32_t)0x00000008)
  5624. #define RTC_TAMPCR_TAMPIE ((uint32_t)0x00000004)
  5625. #define RTC_TAMPCR_TAMP1_TRG ((uint32_t)0x00000002)
  5626. #define RTC_TAMPCR_TAMP1E ((uint32_t)0x00000001)
  5627. /******************** Bits definition for RTC_ALRMASSR register *************/
  5628. #define RTC_ALRMASSR_MASKSS ((uint32_t)0x0F000000)
  5629. #define RTC_ALRMASSR_MASKSS_0 ((uint32_t)0x01000000)
  5630. #define RTC_ALRMASSR_MASKSS_1 ((uint32_t)0x02000000)
  5631. #define RTC_ALRMASSR_MASKSS_2 ((uint32_t)0x04000000)
  5632. #define RTC_ALRMASSR_MASKSS_3 ((uint32_t)0x08000000)
  5633. #define RTC_ALRMASSR_SS ((uint32_t)0x00007FFF)
  5634. /******************** Bits definition for RTC_ALRMBSSR register *************/
  5635. #define RTC_ALRMBSSR_MASKSS ((uint32_t)0x0F000000)
  5636. #define RTC_ALRMBSSR_MASKSS_0 ((uint32_t)0x01000000)
  5637. #define RTC_ALRMBSSR_MASKSS_1 ((uint32_t)0x02000000)
  5638. #define RTC_ALRMBSSR_MASKSS_2 ((uint32_t)0x04000000)
  5639. #define RTC_ALRMBSSR_MASKSS_3 ((uint32_t)0x08000000)
  5640. #define RTC_ALRMBSSR_SS ((uint32_t)0x00007FFF)
  5641. /******************** Bits definition for RTC_OR register ****************/
  5642. #define RTC_OR_TSINSEL ((uint32_t)0x00000006)
  5643. #define RTC_OR_TSINSEL_0 ((uint32_t)0x00000002)
  5644. #define RTC_OR_TSINSEL_1 ((uint32_t)0x00000004)
  5645. #define RTC_OR_ALARMTYPE ((uint32_t)0x00000008)
  5646. /******************** Bits definition for RTC_BKP0R register ****************/
  5647. #define RTC_BKP0R ((uint32_t)0xFFFFFFFF)
  5648. /******************** Bits definition for RTC_BKP1R register ****************/
  5649. #define RTC_BKP1R ((uint32_t)0xFFFFFFFF)
  5650. /******************** Bits definition for RTC_BKP2R register ****************/
  5651. #define RTC_BKP2R ((uint32_t)0xFFFFFFFF)
  5652. /******************** Bits definition for RTC_BKP3R register ****************/
  5653. #define RTC_BKP3R ((uint32_t)0xFFFFFFFF)
  5654. /******************** Bits definition for RTC_BKP4R register ****************/
  5655. #define RTC_BKP4R ((uint32_t)0xFFFFFFFF)
  5656. /******************** Bits definition for RTC_BKP5R register ****************/
  5657. #define RTC_BKP5R ((uint32_t)0xFFFFFFFF)
  5658. /******************** Bits definition for RTC_BKP6R register ****************/
  5659. #define RTC_BKP6R ((uint32_t)0xFFFFFFFF)
  5660. /******************** Bits definition for RTC_BKP7R register ****************/
  5661. #define RTC_BKP7R ((uint32_t)0xFFFFFFFF)
  5662. /******************** Bits definition for RTC_BKP8R register ****************/
  5663. #define RTC_BKP8R ((uint32_t)0xFFFFFFFF)
  5664. /******************** Bits definition for RTC_BKP9R register ****************/
  5665. #define RTC_BKP9R ((uint32_t)0xFFFFFFFF)
  5666. /******************** Bits definition for RTC_BKP10R register ***************/
  5667. #define RTC_BKP10R ((uint32_t)0xFFFFFFFF)
  5668. /******************** Bits definition for RTC_BKP11R register ***************/
  5669. #define RTC_BKP11R ((uint32_t)0xFFFFFFFF)
  5670. /******************** Bits definition for RTC_BKP12R register ***************/
  5671. #define RTC_BKP12R ((uint32_t)0xFFFFFFFF)
  5672. /******************** Bits definition for RTC_BKP13R register ***************/
  5673. #define RTC_BKP13R ((uint32_t)0xFFFFFFFF)
  5674. /******************** Bits definition for RTC_BKP14R register ***************/
  5675. #define RTC_BKP14R ((uint32_t)0xFFFFFFFF)
  5676. /******************** Bits definition for RTC_BKP15R register ***************/
  5677. #define RTC_BKP15R ((uint32_t)0xFFFFFFFF)
  5678. /******************** Bits definition for RTC_BKP16R register ***************/
  5679. #define RTC_BKP16R ((uint32_t)0xFFFFFFFF)
  5680. /******************** Bits definition for RTC_BKP17R register ***************/
  5681. #define RTC_BKP17R ((uint32_t)0xFFFFFFFF)
  5682. /******************** Bits definition for RTC_BKP18R register ***************/
  5683. #define RTC_BKP18R ((uint32_t)0xFFFFFFFF)
  5684. /******************** Bits definition for RTC_BKP19R register ***************/
  5685. #define RTC_BKP19R ((uint32_t)0xFFFFFFFF)
  5686. /******************** Bits definition for RTC_BKP20R register ***************/
  5687. #define RTC_BKP20R ((uint32_t)0xFFFFFFFF)
  5688. /******************** Bits definition for RTC_BKP21R register ***************/
  5689. #define RTC_BKP21R ((uint32_t)0xFFFFFFFF)
  5690. /******************** Bits definition for RTC_BKP22R register ***************/
  5691. #define RTC_BKP22R ((uint32_t)0xFFFFFFFF)
  5692. /******************** Bits definition for RTC_BKP23R register ***************/
  5693. #define RTC_BKP23R ((uint32_t)0xFFFFFFFF)
  5694. /******************** Bits definition for RTC_BKP24R register ***************/
  5695. #define RTC_BKP24R ((uint32_t)0xFFFFFFFF)
  5696. /******************** Bits definition for RTC_BKP25R register ***************/
  5697. #define RTC_BKP25R ((uint32_t)0xFFFFFFFF)
  5698. /******************** Bits definition for RTC_BKP26R register ***************/
  5699. #define RTC_BKP26R ((uint32_t)0xFFFFFFFF)
  5700. /******************** Bits definition for RTC_BKP27R register ***************/
  5701. #define RTC_BKP27R ((uint32_t)0xFFFFFFFF)
  5702. /******************** Bits definition for RTC_BKP28R register ***************/
  5703. #define RTC_BKP28R ((uint32_t)0xFFFFFFFF)
  5704. /******************** Bits definition for RTC_BKP29R register ***************/
  5705. #define RTC_BKP29R ((uint32_t)0xFFFFFFFF)
  5706. /******************** Bits definition for RTC_BKP30R register ***************/
  5707. #define RTC_BKP30R ((uint32_t)0xFFFFFFFF)
  5708. /******************** Bits definition for RTC_BKP31R register ***************/
  5709. #define RTC_BKP31R ((uint32_t)0xFFFFFFFF)
  5710. /******************** Number of backup registers ******************************/
  5711. #define RTC_BKP_NUMBER ((uint32_t)0x00000020)
  5712. /******************************************************************************/
  5713. /* */
  5714. /* Serial Audio Interface */
  5715. /* */
  5716. /******************************************************************************/
  5717. /******************** Bit definition for SAI_GCR register *******************/
  5718. #define SAI_GCR_SYNCIN ((uint32_t)0x00000003) /*!<SYNCIN[1:0] bits (Synchronization Inputs) */
  5719. #define SAI_GCR_SYNCIN_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  5720. #define SAI_GCR_SYNCIN_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  5721. #define SAI_GCR_SYNCOUT ((uint32_t)0x00000030) /*!<SYNCOUT[1:0] bits (Synchronization Outputs) */
  5722. #define SAI_GCR_SYNCOUT_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  5723. #define SAI_GCR_SYNCOUT_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  5724. /******************* Bit definition for SAI_xCR1 register *******************/
  5725. #define SAI_xCR1_MODE ((uint32_t)0x00000003) /*!<MODE[1:0] bits (Audio Block Mode) */
  5726. #define SAI_xCR1_MODE_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  5727. #define SAI_xCR1_MODE_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  5728. #define SAI_xCR1_PRTCFG ((uint32_t)0x0000000C) /*!<PRTCFG[1:0] bits (Protocol Configuration) */
  5729. #define SAI_xCR1_PRTCFG_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  5730. #define SAI_xCR1_PRTCFG_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  5731. #define SAI_xCR1_DS ((uint32_t)0x000000E0) /*!<DS[1:0] bits (Data Size) */
  5732. #define SAI_xCR1_DS_0 ((uint32_t)0x00000020) /*!<Bit 0 */
  5733. #define SAI_xCR1_DS_1 ((uint32_t)0x00000040) /*!<Bit 1 */
  5734. #define SAI_xCR1_DS_2 ((uint32_t)0x00000080) /*!<Bit 2 */
  5735. #define SAI_xCR1_LSBFIRST ((uint32_t)0x00000100) /*!<LSB First Configuration */
  5736. #define SAI_xCR1_CKSTR ((uint32_t)0x00000200) /*!<ClocK STRobing edge */
  5737. #define SAI_xCR1_SYNCEN ((uint32_t)0x00000C00) /*!<SYNCEN[1:0](SYNChronization ENable) */
  5738. #define SAI_xCR1_SYNCEN_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  5739. #define SAI_xCR1_SYNCEN_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  5740. #define SAI_xCR1_MONO ((uint32_t)0x00001000) /*!<Mono mode */
  5741. #define SAI_xCR1_OUTDRIV ((uint32_t)0x00002000) /*!<Output Drive */
  5742. #define SAI_xCR1_SAIEN ((uint32_t)0x00010000) /*!<Audio Block enable */
  5743. #define SAI_xCR1_DMAEN ((uint32_t)0x00020000) /*!<DMA enable */
  5744. #define SAI_xCR1_NODIV ((uint32_t)0x00080000) /*!<No Divider Configuration */
  5745. #define SAI_xCR1_MCKDIV ((uint32_t)0x00F00000) /*!<MCKDIV[3:0] (Master ClocK Divider) */
  5746. #define SAI_xCR1_MCKDIV_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  5747. #define SAI_xCR1_MCKDIV_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  5748. #define SAI_xCR1_MCKDIV_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  5749. #define SAI_xCR1_MCKDIV_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  5750. /******************* Bit definition for SAI_xCR2 register *******************/
  5751. #define SAI_xCR2_FTH ((uint32_t)0x00000007) /*!<FTH[2:0](Fifo THreshold) */
  5752. #define SAI_xCR2_FTH_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  5753. #define SAI_xCR2_FTH_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  5754. #define SAI_xCR2_FTH_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  5755. #define SAI_xCR2_FFLUSH ((uint32_t)0x00000008) /*!<Fifo FLUSH */
  5756. #define SAI_xCR2_TRIS ((uint32_t)0x00000010) /*!<TRIState Management on data line */
  5757. #define SAI_xCR2_MUTE ((uint32_t)0x00000020) /*!<Mute mode */
  5758. #define SAI_xCR2_MUTEVAL ((uint32_t)0x00000040) /*!<Muate value */
  5759. #define SAI_xCR2_MUTECNT ((uint32_t)0x00001F80) /*!<MUTECNT[5:0] (MUTE counter) */
  5760. #define SAI_xCR2_MUTECNT_0 ((uint32_t)0x00000080) /*!<Bit 0 */
  5761. #define SAI_xCR2_MUTECNT_1 ((uint32_t)0x00000100) /*!<Bit 1 */
  5762. #define SAI_xCR2_MUTECNT_2 ((uint32_t)0x00000200) /*!<Bit 2 */
  5763. #define SAI_xCR2_MUTECNT_3 ((uint32_t)0x00000400) /*!<Bit 3 */
  5764. #define SAI_xCR2_MUTECNT_4 ((uint32_t)0x00000800) /*!<Bit 4 */
  5765. #define SAI_xCR2_MUTECNT_5 ((uint32_t)0x00001000) /*!<Bit 5 */
  5766. #define SAI_xCR2_CPL ((uint32_t)0x00080000) /*!< Complement Bit */
  5767. #define SAI_xCR2_COMP ((uint32_t)0x0000C000) /*!<COMP[1:0] (Companding mode) */
  5768. #define SAI_xCR2_COMP_0 ((uint32_t)0x00004000) /*!<Bit 0 */
  5769. #define SAI_xCR2_COMP_1 ((uint32_t)0x00008000) /*!<Bit 1 */
  5770. /****************** Bit definition for SAI_xFRCR register *******************/
  5771. #define SAI_xFRCR_FRL ((uint32_t)0x000000FF) /*!<FRL[1:0](Frame length) */
  5772. #define SAI_xFRCR_FRL_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  5773. #define SAI_xFRCR_FRL_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  5774. #define SAI_xFRCR_FRL_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  5775. #define SAI_xFRCR_FRL_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  5776. #define SAI_xFRCR_FRL_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  5777. #define SAI_xFRCR_FRL_5 ((uint32_t)0x00000020) /*!<Bit 5 */
  5778. #define SAI_xFRCR_FRL_6 ((uint32_t)0x00000040) /*!<Bit 6 */
  5779. #define SAI_xFRCR_FRL_7 ((uint32_t)0x00000080) /*!<Bit 7 */
  5780. #define SAI_xFRCR_FSALL ((uint32_t)0x00007F00) /*!<FRL[1:0] (Frame synchronization active level length) */
  5781. #define SAI_xFRCR_FSALL_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  5782. #define SAI_xFRCR_FSALL_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  5783. #define SAI_xFRCR_FSALL_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  5784. #define SAI_xFRCR_FSALL_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  5785. #define SAI_xFRCR_FSALL_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  5786. #define SAI_xFRCR_FSALL_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  5787. #define SAI_xFRCR_FSALL_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  5788. #define SAI_xFRCR_FSDEF ((uint32_t)0x00010000) /*!< Frame Synchronization Definition */
  5789. #define SAI_xFRCR_FSPO ((uint32_t)0x00020000) /*!<Frame Synchronization POLarity */
  5790. #define SAI_xFRCR_FSOFF ((uint32_t)0x00040000) /*!<Frame Synchronization OFFset */
  5791. /****************** Bit definition for SAI_xSLOTR register *******************/
  5792. #define SAI_xSLOTR_FBOFF ((uint32_t)0x0000001F) /*!<FRL[4:0](First Bit Offset) */
  5793. #define SAI_xSLOTR_FBOFF_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  5794. #define SAI_xSLOTR_FBOFF_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  5795. #define SAI_xSLOTR_FBOFF_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  5796. #define SAI_xSLOTR_FBOFF_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  5797. #define SAI_xSLOTR_FBOFF_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  5798. #define SAI_xSLOTR_SLOTSZ ((uint32_t)0x000000C0) /*!<SLOTSZ[1:0] (Slot size) */
  5799. #define SAI_xSLOTR_SLOTSZ_0 ((uint32_t)0x00000040) /*!<Bit 0 */
  5800. #define SAI_xSLOTR_SLOTSZ_1 ((uint32_t)0x00000080) /*!<Bit 1 */
  5801. #define SAI_xSLOTR_NBSLOT ((uint32_t)0x00000F00) /*!<NBSLOT[3:0] (Number of Slot in audio Frame) */
  5802. #define SAI_xSLOTR_NBSLOT_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  5803. #define SAI_xSLOTR_NBSLOT_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  5804. #define SAI_xSLOTR_NBSLOT_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  5805. #define SAI_xSLOTR_NBSLOT_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  5806. #define SAI_xSLOTR_SLOTEN ((uint32_t)0xFFFF0000) /*!<SLOTEN[15:0] (Slot Enable) */
  5807. /******************* Bit definition for SAI_xIMR register *******************/
  5808. #define SAI_xIMR_OVRUDRIE ((uint32_t)0x00000001) /*!<Overrun underrun interrupt enable */
  5809. #define SAI_xIMR_MUTEDETIE ((uint32_t)0x00000002) /*!<Mute detection interrupt enable */
  5810. #define SAI_xIMR_WCKCFGIE ((uint32_t)0x00000004) /*!<Wrong Clock Configuration interrupt enable */
  5811. #define SAI_xIMR_FREQIE ((uint32_t)0x00000008) /*!<FIFO request interrupt enable */
  5812. #define SAI_xIMR_CNRDYIE ((uint32_t)0x00000010) /*!<Codec not ready interrupt enable */
  5813. #define SAI_xIMR_AFSDETIE ((uint32_t)0x00000020) /*!<Anticipated frame synchronization detection interrupt enable */
  5814. #define SAI_xIMR_LFSDETIE ((uint32_t)0x00000040) /*!<Late frame synchronization detection interrupt enable */
  5815. /******************** Bit definition for SAI_xSR register *******************/
  5816. #define SAI_xSR_OVRUDR ((uint32_t)0x00000001) /*!<Overrun underrun */
  5817. #define SAI_xSR_MUTEDET ((uint32_t)0x00000002) /*!<Mute detection */
  5818. #define SAI_xSR_WCKCFG ((uint32_t)0x00000004) /*!<Wrong Clock Configuration */
  5819. #define SAI_xSR_FREQ ((uint32_t)0x00000008) /*!<FIFO request */
  5820. #define SAI_xSR_CNRDY ((uint32_t)0x00000010) /*!<Codec not ready */
  5821. #define SAI_xSR_AFSDET ((uint32_t)0x00000020) /*!<Anticipated frame synchronization detection */
  5822. #define SAI_xSR_LFSDET ((uint32_t)0x00000040) /*!<Late frame synchronization detection */
  5823. #define SAI_xSR_FLVL ((uint32_t)0x00070000) /*!<FLVL[2:0] (FIFO Level Threshold) */
  5824. #define SAI_xSR_FLVL_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  5825. #define SAI_xSR_FLVL_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  5826. #define SAI_xSR_FLVL_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  5827. /****************** Bit definition for SAI_xCLRFR register ******************/
  5828. #define SAI_xCLRFR_COVRUDR ((uint32_t)0x00000001) /*!<Clear Overrun underrun */
  5829. #define SAI_xCLRFR_CMUTEDET ((uint32_t)0x00000002) /*!<Clear Mute detection */
  5830. #define SAI_xCLRFR_CWCKCFG ((uint32_t)0x00000004) /*!<Clear Wrong Clock Configuration */
  5831. #define SAI_xCLRFR_CFREQ ((uint32_t)0x00000008) /*!<Clear FIFO request */
  5832. #define SAI_xCLRFR_CCNRDY ((uint32_t)0x00000010) /*!<Clear Codec not ready */
  5833. #define SAI_xCLRFR_CAFSDET ((uint32_t)0x00000020) /*!<Clear Anticipated frame synchronization detection */
  5834. #define SAI_xCLRFR_CLFSDET ((uint32_t)0x00000040) /*!<Clear Late frame synchronization detection */
  5835. /****************** Bit definition for SAI_xDR register *********************/
  5836. #define SAI_xDR_DATA ((uint32_t)0xFFFFFFFF)
  5837. /******************************************************************************/
  5838. /* */
  5839. /* SPDIF-RX Interface */
  5840. /* */
  5841. /******************************************************************************/
  5842. /******************** Bit definition for SPDIF_CR register *******************/
  5843. #define SPDIFRX_CR_SPDIFEN ((uint32_t)0x00000003) /*!<Peripheral Block Enable */
  5844. #define SPDIFRX_CR_RXDMAEN ((uint32_t)0x00000004) /*!<Receiver DMA Enable for data flow */
  5845. #define SPDIFRX_CR_RXSTEO ((uint32_t)0x00000008) /*!<Stereo Mode */
  5846. #define SPDIFRX_CR_DRFMT ((uint32_t)0x00000030) /*!<RX Data format */
  5847. #define SPDIFRX_CR_PMSK ((uint32_t)0x00000040) /*!<Mask Parity error bit */
  5848. #define SPDIFRX_CR_VMSK ((uint32_t)0x00000080) /*!<Mask of Validity bit */
  5849. #define SPDIFRX_CR_CUMSK ((uint32_t)0x00000100) /*!<Mask of channel status and user bits */
  5850. #define SPDIFRX_CR_PTMSK ((uint32_t)0x00000200) /*!<Mask of Preamble Type bits */
  5851. #define SPDIFRX_CR_CBDMAEN ((uint32_t)0x00000400) /*!<Control Buffer DMA ENable for control flow */
  5852. #define SPDIFRX_CR_CHSEL ((uint32_t)0x00000800) /*!<Channel Selection */
  5853. #define SPDIFRX_CR_NBTR ((uint32_t)0x00003000) /*!<Maximum allowed re-tries during synchronization phase */
  5854. #define SPDIFRX_CR_WFA ((uint32_t)0x00004000) /*!<Wait For Activity */
  5855. #define SPDIFRX_CR_INSEL ((uint32_t)0x00070000) /*!<SPDIF input selection */
  5856. /******************* Bit definition for SPDIFRX_IMR register *******************/
  5857. #define SPDIFRX_IMR_RXNEIE ((uint32_t)0x00000001) /*!<RXNE interrupt enable */
  5858. #define SPDIFRX_IMR_CSRNEIE ((uint32_t)0x00000002) /*!<Control Buffer Ready Interrupt Enable */
  5859. #define SPDIFRX_IMR_PERRIE ((uint32_t)0x00000004) /*!<Parity error interrupt enable */
  5860. #define SPDIFRX_IMR_OVRIE ((uint32_t)0x00000008) /*!<Overrun error Interrupt Enable */
  5861. #define SPDIFRX_IMR_SBLKIE ((uint32_t)0x00000010) /*!<Synchronization Block Detected Interrupt Enable */
  5862. #define SPDIFRX_IMR_SYNCDIE ((uint32_t)0x00000020) /*!<Synchronization Done */
  5863. #define SPDIFRX_IMR_IFEIE ((uint32_t)0x00000040) /*!<Serial Interface Error Interrupt Enable */
  5864. /******************* Bit definition for SPDIFRX_SR register *******************/
  5865. #define SPDIFRX_SR_RXNE ((uint32_t)0x00000001) /*!<Read data register not empty */
  5866. #define SPDIFRX_SR_CSRNE ((uint32_t)0x00000002) /*!<The Control Buffer register is not empty */
  5867. #define SPDIFRX_SR_PERR ((uint32_t)0x00000004) /*!<Parity error */
  5868. #define SPDIFRX_SR_OVR ((uint32_t)0x00000008) /*!<Overrun error */
  5869. #define SPDIFRX_SR_SBD ((uint32_t)0x00000010) /*!<Synchronization Block Detected */
  5870. #define SPDIFRX_SR_SYNCD ((uint32_t)0x00000020) /*!<Synchronization Done */
  5871. #define SPDIFRX_SR_FERR ((uint32_t)0x00000040) /*!<Framing error */
  5872. #define SPDIFRX_SR_SERR ((uint32_t)0x00000080) /*!<Synchronization error */
  5873. #define SPDIFRX_SR_TERR ((uint32_t)0x00000100) /*!<Time-out error */
  5874. #define SPDIFRX_SR_WIDTH5 ((uint32_t)0x7FFF0000) /*!<Duration of 5 symbols counted with spdif_clk */
  5875. /******************* Bit definition for SPDIFRX_IFCR register *******************/
  5876. #define SPDIFRX_IFCR_PERRCF ((uint32_t)0x00000004) /*!<Clears the Parity error flag */
  5877. #define SPDIFRX_IFCR_OVRCF ((uint32_t)0x00000008) /*!<Clears the Overrun error flag */
  5878. #define SPDIFRX_IFCR_SBDCF ((uint32_t)0x00000010) /*!<Clears the Synchronization Block Detected flag */
  5879. #define SPDIFRX_IFCR_SYNCDCF ((uint32_t)0x00000020) /*!<Clears the Synchronization Done flag */
  5880. /******************* Bit definition for SPDIFRX_DR register (DRFMT = 0b00 case) *******************/
  5881. #define SPDIFRX_DR0_DR ((uint32_t)0x00FFFFFF) /*!<Data value */
  5882. #define SPDIFRX_DR0_PE ((uint32_t)0x01000000) /*!<Parity Error bit */
  5883. #define SPDIFRX_DR0_V ((uint32_t)0x02000000) /*!<Validity bit */
  5884. #define SPDIFRX_DR0_U ((uint32_t)0x04000000) /*!<User bit */
  5885. #define SPDIFRX_DR0_C ((uint32_t)0x08000000) /*!<Channel Status bit */
  5886. #define SPDIFRX_DR0_PT ((uint32_t)0x30000000) /*!<Preamble Type */
  5887. /******************* Bit definition for SPDIFRX_DR register (DRFMT = 0b01 case) *******************/
  5888. #define SPDIFRX_DR1_DR ((uint32_t)0xFFFFFF00) /*!<Data value */
  5889. #define SPDIFRX_DR1_PT ((uint32_t)0x00000030) /*!<Preamble Type */
  5890. #define SPDIFRX_DR1_C ((uint32_t)0x00000008) /*!<Channel Status bit */
  5891. #define SPDIFRX_DR1_U ((uint32_t)0x00000004) /*!<User bit */
  5892. #define SPDIFRX_DR1_V ((uint32_t)0x00000002) /*!<Validity bit */
  5893. #define SPDIFRX_DR1_PE ((uint32_t)0x00000001) /*!<Parity Error bit */
  5894. /******************* Bit definition for SPDIFRX_DR register (DRFMT = 0b10 case) *******************/
  5895. #define SPDIFRX_DR1_DRNL1 ((uint32_t)0xFFFF0000) /*!<Data value Channel B */
  5896. #define SPDIFRX_DR1_DRNL2 ((uint32_t)0x0000FFFF) /*!<Data value Channel A */
  5897. /******************* Bit definition for SPDIFRX_CSR register *******************/
  5898. #define SPDIFRX_CSR_USR ((uint32_t)0x0000FFFF) /*!<User data information */
  5899. #define SPDIFRX_CSR_CS ((uint32_t)0x00FF0000) /*!<Channel A status information */
  5900. #define SPDIFRX_CSR_SOB ((uint32_t)0x01000000) /*!<Start Of Block */
  5901. /******************* Bit definition for SPDIFRX_DIR register *******************/
  5902. #define SPDIFRX_DIR_THI ((uint32_t)0x000013FF) /*!<Threshold LOW */
  5903. #define SPDIFRX_DIR_TLO ((uint32_t)0x1FFF0000) /*!<Threshold HIGH */
  5904. /******************************************************************************/
  5905. /* */
  5906. /* SD host Interface */
  5907. /* */
  5908. /******************************************************************************/
  5909. /****************** Bit definition for SDMMC_POWER register ******************/
  5910. #define SDMMC_POWER_PWRCTRL ((uint32_t)0x03) /*!<PWRCTRL[1:0] bits (Power supply control bits) */
  5911. #define SDMMC_POWER_PWRCTRL_0 ((uint32_t)0x01) /*!<Bit 0 */
  5912. #define SDMMC_POWER_PWRCTRL_1 ((uint32_t)0x02) /*!<Bit 1 */
  5913. /****************** Bit definition for SDMMC_CLKCR register ******************/
  5914. #define SDMMC_CLKCR_CLKDIV ((uint32_t)0x00FF) /*!<Clock divide factor */
  5915. #define SDMMC_CLKCR_CLKEN ((uint32_t)0x0100) /*!<Clock enable bit */
  5916. #define SDMMC_CLKCR_PWRSAV ((uint32_t)0x0200) /*!<Power saving configuration bit */
  5917. #define SDMMC_CLKCR_BYPASS ((uint32_t)0x0400) /*!<Clock divider bypass enable bit */
  5918. #define SDMMC_CLKCR_WIDBUS ((uint32_t)0x1800) /*!<WIDBUS[1:0] bits (Wide bus mode enable bit) */
  5919. #define SDMMC_CLKCR_WIDBUS_0 ((uint32_t)0x0800) /*!<Bit 0 */
  5920. #define SDMMC_CLKCR_WIDBUS_1 ((uint32_t)0x1000) /*!<Bit 1 */
  5921. #define SDMMC_CLKCR_NEGEDGE ((uint32_t)0x2000) /*!<SDMMC_CK dephasing selection bit */
  5922. #define SDMMC_CLKCR_HWFC_EN ((uint32_t)0x4000) /*!<HW Flow Control enable */
  5923. /******************* Bit definition for SDMMC_ARG register *******************/
  5924. #define SDMMC_ARG_CMDARG ((uint32_t)0xFFFFFFFF) /*!<Command argument */
  5925. /******************* Bit definition for SDMMC_CMD register *******************/
  5926. #define SDMMC_CMD_CMDINDEX ((uint32_t)0x003F) /*!<Command Index */
  5927. #define SDMMC_CMD_WAITRESP ((uint32_t)0x00C0) /*!<WAITRESP[1:0] bits (Wait for response bits) */
  5928. #define SDMMC_CMD_WAITRESP_0 ((uint32_t)0x0040) /*!< Bit 0 */
  5929. #define SDMMC_CMD_WAITRESP_1 ((uint32_t)0x0080) /*!< Bit 1 */
  5930. #define SDMMC_CMD_WAITINT ((uint32_t)0x0100) /*!<CPSM Waits for Interrupt Request */
  5931. #define SDMMC_CMD_WAITPEND ((uint32_t)0x0200) /*!<CPSM Waits for ends of data transfer (CmdPend internal signal) */
  5932. #define SDMMC_CMD_CPSMEN ((uint32_t)0x0400) /*!<Command path state machine (CPSM) Enable bit */
  5933. #define SDMMC_CMD_SDIOSUSPEND ((uint32_t)0x0800) /*!<SD I/O suspend command */
  5934. /***************** Bit definition for SDMMC_RESPCMD register *****************/
  5935. #define SDMMC_RESPCMD_RESPCMD ((uint32_t)0x3F) /*!<Response command index */
  5936. /****************** Bit definition for SDMMC_RESP0 register ******************/
  5937. #define SDMMC_RESP0_CARDSTATUS0 ((uint32_t)0xFFFFFFFF) /*!<Card Status */
  5938. /****************** Bit definition for SDMMC_RESP1 register ******************/
  5939. #define SDMMC_RESP1_CARDSTATUS1 ((uint32_t)0xFFFFFFFF) /*!<Card Status */
  5940. /****************** Bit definition for SDMMC_RESP2 register ******************/
  5941. #define SDMMC_RESP2_CARDSTATUS2 ((uint32_t)0xFFFFFFFF) /*!<Card Status */
  5942. /****************** Bit definition for SDMMC_RESP3 register ******************/
  5943. #define SDMMC_RESP3_CARDSTATUS3 ((uint32_t)0xFFFFFFFF) /*!<Card Status */
  5944. /****************** Bit definition for SDMMC_RESP4 register ******************/
  5945. #define SDMMC_RESP4_CARDSTATUS4 ((uint32_t)0xFFFFFFFF) /*!<Card Status */
  5946. /****************** Bit definition for SDMMC_DTIMER register *****************/
  5947. #define SDMMC_DTIMER_DATATIME ((uint32_t)0xFFFFFFFF) /*!<Data timeout period. */
  5948. /****************** Bit definition for SDMMC_DLEN register *******************/
  5949. #define SDMMC_DLEN_DATALENGTH ((uint32_t)0x01FFFFFF) /*!<Data length value */
  5950. /****************** Bit definition for SDMMC_DCTRL register ******************/
  5951. #define SDMMC_DCTRL_DTEN ((uint32_t)0x0001) /*!<Data transfer enabled bit */
  5952. #define SDMMC_DCTRL_DTDIR ((uint32_t)0x0002) /*!<Data transfer direction selection */
  5953. #define SDMMC_DCTRL_DTMODE ((uint32_t)0x0004) /*!<Data transfer mode selection */
  5954. #define SDMMC_DCTRL_DMAEN ((uint32_t)0x0008) /*!<DMA enabled bit */
  5955. #define SDMMC_DCTRL_DBLOCKSIZE ((uint32_t)0x00F0) /*!<DBLOCKSIZE[3:0] bits (Data block size) */
  5956. #define SDMMC_DCTRL_DBLOCKSIZE_0 ((uint32_t)0x0010) /*!<Bit 0 */
  5957. #define SDMMC_DCTRL_DBLOCKSIZE_1 ((uint32_t)0x0020) /*!<Bit 1 */
  5958. #define SDMMC_DCTRL_DBLOCKSIZE_2 ((uint32_t)0x0040) /*!<Bit 2 */
  5959. #define SDMMC_DCTRL_DBLOCKSIZE_3 ((uint32_t)0x0080) /*!<Bit 3 */
  5960. #define SDMMC_DCTRL_RWSTART ((uint32_t)0x0100) /*!<Read wait start */
  5961. #define SDMMC_DCTRL_RWSTOP ((uint32_t)0x0200) /*!<Read wait stop */
  5962. #define SDMMC_DCTRL_RWMOD ((uint32_t)0x0400) /*!<Read wait mode */
  5963. #define SDMMC_DCTRL_SDIOEN ((uint32_t)0x0800) /*!<SD I/O enable functions */
  5964. /****************** Bit definition for SDMMC_DCOUNT register *****************/
  5965. #define SDMMC_DCOUNT_DATACOUNT ((uint32_t)0x01FFFFFF) /*!<Data count value */
  5966. /****************** Bit definition for SDMMC_STA register ********************/
  5967. #define SDMMC_STA_CCRCFAIL ((uint32_t)0x00000001) /*!<Command response received (CRC check failed) */
  5968. #define SDMMC_STA_DCRCFAIL ((uint32_t)0x00000002) /*!<Data block sent/received (CRC check failed) */
  5969. #define SDMMC_STA_CTIMEOUT ((uint32_t)0x00000004) /*!<Command response timeout */
  5970. #define SDMMC_STA_DTIMEOUT ((uint32_t)0x00000008) /*!<Data timeout */
  5971. #define SDMMC_STA_TXUNDERR ((uint32_t)0x00000010) /*!<Transmit FIFO underrun error */
  5972. #define SDMMC_STA_RXOVERR ((uint32_t)0x00000020) /*!<Received FIFO overrun error */
  5973. #define SDMMC_STA_CMDREND ((uint32_t)0x00000040) /*!<Command response received (CRC check passed) */
  5974. #define SDMMC_STA_CMDSENT ((uint32_t)0x00000080) /*!<Command sent (no response required) */
  5975. #define SDMMC_STA_DATAEND ((uint32_t)0x00000100) /*!<Data end (data counter, SDIDCOUNT, is zero) */
  5976. #define SDMMC_STA_DBCKEND ((uint32_t)0x00000400) /*!<Data block sent/received (CRC check passed) */
  5977. #define SDMMC_STA_CMDACT ((uint32_t)0x00000800) /*!<Command transfer in progress */
  5978. #define SDMMC_STA_TXACT ((uint32_t)0x00001000) /*!<Data transmit in progress */
  5979. #define SDMMC_STA_RXACT ((uint32_t)0x00002000) /*!<Data receive in progress */
  5980. #define SDMMC_STA_TXFIFOHE ((uint32_t)0x00004000) /*!<Transmit FIFO Half Empty: at least 8 words can be written into the FIFO */
  5981. #define SDMMC_STA_RXFIFOHF ((uint32_t)0x00008000) /*!<Receive FIFO Half Full: there are at least 8 words in the FIFO */
  5982. #define SDMMC_STA_TXFIFOF ((uint32_t)0x00010000) /*!<Transmit FIFO full */
  5983. #define SDMMC_STA_RXFIFOF ((uint32_t)0x00020000) /*!<Receive FIFO full */
  5984. #define SDMMC_STA_TXFIFOE ((uint32_t)0x00040000) /*!<Transmit FIFO empty */
  5985. #define SDMMC_STA_RXFIFOE ((uint32_t)0x00080000) /*!<Receive FIFO empty */
  5986. #define SDMMC_STA_TXDAVL ((uint32_t)0x00100000) /*!<Data available in transmit FIFO */
  5987. #define SDMMC_STA_RXDAVL ((uint32_t)0x00200000) /*!<Data available in receive FIFO */
  5988. #define SDMMC_STA_SDIOIT ((uint32_t)0x00400000) /*!<SDMMC interrupt received */
  5989. /******************* Bit definition for SDMMC_ICR register *******************/
  5990. #define SDMMC_ICR_CCRCFAILC ((uint32_t)0x00000001) /*!<CCRCFAIL flag clear bit */
  5991. #define SDMMC_ICR_DCRCFAILC ((uint32_t)0x00000002) /*!<DCRCFAIL flag clear bit */
  5992. #define SDMMC_ICR_CTIMEOUTC ((uint32_t)0x00000004) /*!<CTIMEOUT flag clear bit */
  5993. #define SDMMC_ICR_DTIMEOUTC ((uint32_t)0x00000008) /*!<DTIMEOUT flag clear bit */
  5994. #define SDMMC_ICR_TXUNDERRC ((uint32_t)0x00000010) /*!<TXUNDERR flag clear bit */
  5995. #define SDMMC_ICR_RXOVERRC ((uint32_t)0x00000020) /*!<RXOVERR flag clear bit */
  5996. #define SDMMC_ICR_CMDRENDC ((uint32_t)0x00000040) /*!<CMDREND flag clear bit */
  5997. #define SDMMC_ICR_CMDSENTC ((uint32_t)0x00000080) /*!<CMDSENT flag clear bit */
  5998. #define SDMMC_ICR_DATAENDC ((uint32_t)0x00000100) /*!<DATAEND flag clear bit */
  5999. #define SDMMC_ICR_DBCKENDC ((uint32_t)0x00000400) /*!<DBCKEND flag clear bit */
  6000. #define SDMMC_ICR_SDIOITC ((uint32_t)0x00400000) /*!<SDMMCIT flag clear bit */
  6001. /****************** Bit definition for SDMMC_MASK register *******************/
  6002. #define SDMMC_MASK_CCRCFAILIE ((uint32_t)0x00000001) /*!<Command CRC Fail Interrupt Enable */
  6003. #define SDMMC_MASK_DCRCFAILIE ((uint32_t)0x00000002) /*!<Data CRC Fail Interrupt Enable */
  6004. #define SDMMC_MASK_CTIMEOUTIE ((uint32_t)0x00000004) /*!<Command TimeOut Interrupt Enable */
  6005. #define SDMMC_MASK_DTIMEOUTIE ((uint32_t)0x00000008) /*!<Data TimeOut Interrupt Enable */
  6006. #define SDMMC_MASK_TXUNDERRIE ((uint32_t)0x00000010) /*!<Tx FIFO UnderRun Error Interrupt Enable */
  6007. #define SDMMC_MASK_RXOVERRIE ((uint32_t)0x00000020) /*!<Rx FIFO OverRun Error Interrupt Enable */
  6008. #define SDMMC_MASK_CMDRENDIE ((uint32_t)0x00000040) /*!<Command Response Received Interrupt Enable */
  6009. #define SDMMC_MASK_CMDSENTIE ((uint32_t)0x00000080) /*!<Command Sent Interrupt Enable */
  6010. #define SDMMC_MASK_DATAENDIE ((uint32_t)0x00000100) /*!<Data End Interrupt Enable */
  6011. #define SDMMC_MASK_DBCKENDIE ((uint32_t)0x00000400) /*!<Data Block End Interrupt Enable */
  6012. #define SDMMC_MASK_CMDACTIE ((uint32_t)0x00000800) /*!<CCommand Acting Interrupt Enable */
  6013. #define SDMMC_MASK_TXACTIE ((uint32_t)0x00001000) /*!<Data Transmit Acting Interrupt Enable */
  6014. #define SDMMC_MASK_RXACTIE ((uint32_t)0x00002000) /*!<Data receive acting interrupt enabled */
  6015. #define SDMMC_MASK_TXFIFOHEIE ((uint32_t)0x00004000) /*!<Tx FIFO Half Empty interrupt Enable */
  6016. #define SDMMC_MASK_RXFIFOHFIE ((uint32_t)0x00008000) /*!<Rx FIFO Half Full interrupt Enable */
  6017. #define SDMMC_MASK_TXFIFOFIE ((uint32_t)0x00010000) /*!<Tx FIFO Full interrupt Enable */
  6018. #define SDMMC_MASK_RXFIFOFIE ((uint32_t)0x00020000) /*!<Rx FIFO Full interrupt Enable */
  6019. #define SDMMC_MASK_TXFIFOEIE ((uint32_t)0x00040000) /*!<Tx FIFO Empty interrupt Enable */
  6020. #define SDMMC_MASK_RXFIFOEIE ((uint32_t)0x00080000) /*!<Rx FIFO Empty interrupt Enable */
  6021. #define SDMMC_MASK_TXDAVLIE ((uint32_t)0x00100000) /*!<Data available in Tx FIFO interrupt Enable */
  6022. #define SDMMC_MASK_RXDAVLIE ((uint32_t)0x00200000) /*!<Data available in Rx FIFO interrupt Enable */
  6023. #define SDMMC_MASK_SDIOITIE ((uint32_t)0x00400000) /*!<SDMMC Mode Interrupt Received interrupt Enable */
  6024. /***************** Bit definition for SDMMC_FIFOCNT register *****************/
  6025. #define SDMMC_FIFOCNT_FIFOCOUNT ((uint32_t)0x00FFFFFF) /*!<Remaining number of words to be written to or read from the FIFO */
  6026. /****************** Bit definition for SDMMC_FIFO register *******************/
  6027. #define SDMMC_FIFO_FIFODATA ((uint32_t)0xFFFFFFFF) /*!<Receive and transmit FIFO data */
  6028. /******************************************************************************/
  6029. /* */
  6030. /* Serial Peripheral Interface (SPI) */
  6031. /* */
  6032. /******************************************************************************/
  6033. /******************* Bit definition for SPI_CR1 register ********************/
  6034. #define SPI_CR1_CPHA ((uint32_t)0x00000001) /*!< Clock Phase */
  6035. #define SPI_CR1_CPOL ((uint32_t)0x00000002) /*!< Clock Polarity */
  6036. #define SPI_CR1_MSTR ((uint32_t)0x00000004) /*!< Master Selection */
  6037. #define SPI_CR1_BR ((uint32_t)0x00000038) /*!< BR[2:0] bits (Baud Rate Control) */
  6038. #define SPI_CR1_BR_0 ((uint32_t)0x00000008) /*!< Bit 0 */
  6039. #define SPI_CR1_BR_1 ((uint32_t)0x00000010) /*!< Bit 1 */
  6040. #define SPI_CR1_BR_2 ((uint32_t)0x00000020) /*!< Bit 2 */
  6041. #define SPI_CR1_SPE ((uint32_t)0x00000040) /*!< SPI Enable */
  6042. #define SPI_CR1_LSBFIRST ((uint32_t)0x00000080) /*!< Frame Format */
  6043. #define SPI_CR1_SSI ((uint32_t)0x00000100) /*!< Internal slave select */
  6044. #define SPI_CR1_SSM ((uint32_t)0x00000200) /*!< Software slave management */
  6045. #define SPI_CR1_RXONLY ((uint32_t)0x00000400) /*!< Receive only */
  6046. #define SPI_CR1_CRCL ((uint32_t)0x00000800) /*!< CRC Length */
  6047. #define SPI_CR1_CRCNEXT ((uint32_t)0x00001000) /*!< Transmit CRC next */
  6048. #define SPI_CR1_CRCEN ((uint32_t)0x00002000) /*!< Hardware CRC calculation enable */
  6049. #define SPI_CR1_BIDIOE ((uint32_t)0x00004000) /*!< Output enable in bidirectional mode */
  6050. #define SPI_CR1_BIDIMODE ((uint32_t)0x00008000) /*!< Bidirectional data mode enable */
  6051. /******************* Bit definition for SPI_CR2 register ********************/
  6052. #define SPI_CR2_RXDMAEN ((uint32_t)0x00000001) /*!< Rx Buffer DMA Enable */
  6053. #define SPI_CR2_TXDMAEN ((uint32_t)0x00000002) /*!< Tx Buffer DMA Enable */
  6054. #define SPI_CR2_SSOE ((uint32_t)0x00000004) /*!< SS Output Enable */
  6055. #define SPI_CR2_NSSP ((uint32_t)0x00000008) /*!< NSS pulse management Enable */
  6056. #define SPI_CR2_FRF ((uint32_t)0x00000010) /*!< Frame Format Enable */
  6057. #define SPI_CR2_ERRIE ((uint32_t)0x00000020) /*!< Error Interrupt Enable */
  6058. #define SPI_CR2_RXNEIE ((uint32_t)0x00000040) /*!< RX buffer Not Empty Interrupt Enable */
  6059. #define SPI_CR2_TXEIE ((uint32_t)0x00000080) /*!< Tx buffer Empty Interrupt Enable */
  6060. #define SPI_CR2_DS ((uint32_t)0x00000F00) /*!< DS[3:0] Data Size */
  6061. #define SPI_CR2_DS_0 ((uint32_t)0x00000100) /*!< Bit 0 */
  6062. #define SPI_CR2_DS_1 ((uint32_t)0x00000200) /*!< Bit 1 */
  6063. #define SPI_CR2_DS_2 ((uint32_t)0x00000400) /*!< Bit 2 */
  6064. #define SPI_CR2_DS_3 ((uint32_t)0x00000800) /*!< Bit 3 */
  6065. #define SPI_CR2_FRXTH ((uint32_t)0x00001000) /*!< FIFO reception Threshold */
  6066. #define SPI_CR2_LDMARX ((uint32_t)0x00002000) /*!< Last DMA transfer for reception */
  6067. #define SPI_CR2_LDMATX ((uint32_t)0x00004000) /*!< Last DMA transfer for transmission */
  6068. /******************** Bit definition for SPI_SR register ********************/
  6069. #define SPI_SR_RXNE ((uint32_t)0x00000001) /*!< Receive buffer Not Empty */
  6070. #define SPI_SR_TXE ((uint32_t)0x00000002) /*!< Transmit buffer Empty */
  6071. #define SPI_SR_CHSIDE ((uint32_t)0x00000004) /*!< Channel side */
  6072. #define SPI_SR_UDR ((uint32_t)0x00000008) /*!< Underrun flag */
  6073. #define SPI_SR_CRCERR ((uint32_t)0x00000010) /*!< CRC Error flag */
  6074. #define SPI_SR_MODF ((uint32_t)0x00000020) /*!< Mode fault */
  6075. #define SPI_SR_OVR ((uint32_t)0x00000040) /*!< Overrun flag */
  6076. #define SPI_SR_BSY ((uint32_t)0x00000080) /*!< Busy flag */
  6077. #define SPI_SR_FRE ((uint32_t)0x00000100) /*!< TI frame format error */
  6078. #define SPI_SR_FRLVL ((uint32_t)0x00000600) /*!< FIFO Reception Level */
  6079. #define SPI_SR_FRLVL_0 ((uint32_t)0x00000200) /*!< Bit 0 */
  6080. #define SPI_SR_FRLVL_1 ((uint32_t)0x00000400) /*!< Bit 1 */
  6081. #define SPI_SR_FTLVL ((uint32_t)0x00001800) /*!< FIFO Transmission Level */
  6082. #define SPI_SR_FTLVL_0 ((uint32_t)0x00000800) /*!< Bit 0 */
  6083. #define SPI_SR_FTLVL_1 ((uint32_t)0x00001000) /*!< Bit 1 */
  6084. /******************** Bit definition for SPI_DR register ********************/
  6085. #define SPI_DR_DR ((uint32_t)0xFFFF) /*!< Data Register */
  6086. /******************* Bit definition for SPI_CRCPR register ******************/
  6087. #define SPI_CRCPR_CRCPOLY ((uint32_t)0xFFFF) /*!< CRC polynomial register */
  6088. /****************** Bit definition for SPI_RXCRCR register ******************/
  6089. #define SPI_RXCRCR_RXCRC ((uint32_t)0xFFFF) /*!< Rx CRC Register */
  6090. /****************** Bit definition for SPI_TXCRCR register ******************/
  6091. #define SPI_TXCRCR_TXCRC ((uint32_t)0xFFFF) /*!< Tx CRC Register */
  6092. /****************** Bit definition for SPI_I2SCFGR register *****************/
  6093. #define SPI_I2SCFGR_CHLEN ((uint32_t)0x00000001) /*!<Channel length (number of bits per audio channel) */
  6094. #define SPI_I2SCFGR_DATLEN ((uint32_t)0x00000006) /*!<DATLEN[1:0] bits (Data length to be transferred) */
  6095. #define SPI_I2SCFGR_DATLEN_0 ((uint32_t)0x00000002) /*!<Bit 0 */
  6096. #define SPI_I2SCFGR_DATLEN_1 ((uint32_t)0x00000004) /*!<Bit 1 */
  6097. #define SPI_I2SCFGR_CKPOL ((uint32_t)0x00000008) /*!<steady state clock polarity */
  6098. #define SPI_I2SCFGR_I2SSTD ((uint32_t)0x00000030) /*!<I2SSTD[1:0] bits (I2S standard selection) */
  6099. #define SPI_I2SCFGR_I2SSTD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  6100. #define SPI_I2SCFGR_I2SSTD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  6101. #define SPI_I2SCFGR_PCMSYNC ((uint32_t)0x00000080) /*!<PCM frame synchronization */
  6102. #define SPI_I2SCFGR_I2SCFG ((uint32_t)0x00000300) /*!<I2SCFG[1:0] bits (I2S configuration mode) */
  6103. #define SPI_I2SCFGR_I2SCFG_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  6104. #define SPI_I2SCFGR_I2SCFG_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  6105. #define SPI_I2SCFGR_I2SE ((uint32_t)0x00000400) /*!<I2S Enable */
  6106. #define SPI_I2SCFGR_I2SMOD ((uint32_t)0x00000800) /*!<I2S mode selection */
  6107. #define SPI_I2SCFGR_ASTRTEN ((uint32_t)0x00001000) /*!<Asynchronous start enable */
  6108. /****************** Bit definition for SPI_I2SPR register *******************/
  6109. #define SPI_I2SPR_I2SDIV ((uint32_t)0x00FF) /*!<I2S Linear prescaler */
  6110. #define SPI_I2SPR_ODD ((uint32_t)0x0100) /*!<Odd factor for the prescaler */
  6111. #define SPI_I2SPR_MCKOE ((uint32_t)0x0200) /*!<Master Clock Output Enable */
  6112. /******************************************************************************/
  6113. /* */
  6114. /* SYSCFG */
  6115. /* */
  6116. /******************************************************************************/
  6117. /****************** Bit definition for SYSCFG_MEMRMP register ***************/
  6118. #define SYSCFG_MEMRMP_MEM_BOOT ((uint32_t)0x00000001) /*!< Boot information after Reset */
  6119. #define SYSCFG_MEMRMP_SWP_FMC ((uint32_t)0x00000C00) /*!< FMC Memory Mapping swapping */
  6120. #define SYSCFG_MEMRMP_SWP_FMC_0 ((uint32_t)0x00000400)
  6121. #define SYSCFG_MEMRMP_SWP_FMC_1 ((uint32_t)0x00000800)
  6122. /****************** Bit definition for SYSCFG_PMC register ******************/
  6123. #define SYSCFG_PMC_ADCxDC2 ((uint32_t)0x00070000) /*!< Refer to AN4073 on how to use this bit */
  6124. #define SYSCFG_PMC_ADC1DC2 ((uint32_t)0x00010000) /*!< Refer to AN4073 on how to use this bit */
  6125. #define SYSCFG_PMC_ADC2DC2 ((uint32_t)0x00020000) /*!< Refer to AN4073 on how to use this bit */
  6126. #define SYSCFG_PMC_ADC3DC2 ((uint32_t)0x00040000) /*!< Refer to AN4073 on how to use this bit */
  6127. #define SYSCFG_PMC_MII_RMII_SEL ((uint32_t)0x00800000) /*!<Ethernet PHY interface selection */
  6128. /***************** Bit definition for SYSCFG_EXTICR1 register ***************/
  6129. #define SYSCFG_EXTICR1_EXTI0 ((uint32_t)0x000F) /*!<EXTI 0 configuration */
  6130. #define SYSCFG_EXTICR1_EXTI1 ((uint32_t)0x00F0) /*!<EXTI 1 configuration */
  6131. #define SYSCFG_EXTICR1_EXTI2 ((uint32_t)0x0F00) /*!<EXTI 2 configuration */
  6132. #define SYSCFG_EXTICR1_EXTI3 ((uint32_t)0xF000) /*!<EXTI 3 configuration */
  6133. /**
  6134. * @brief EXTI0 configuration
  6135. */
  6136. #define SYSCFG_EXTICR1_EXTI0_PA ((uint32_t)0x0000) /*!<PA[0] pin */
  6137. #define SYSCFG_EXTICR1_EXTI0_PB ((uint32_t)0x0001) /*!<PB[0] pin */
  6138. #define SYSCFG_EXTICR1_EXTI0_PC ((uint32_t)0x0002) /*!<PC[0] pin */
  6139. #define SYSCFG_EXTICR1_EXTI0_PD ((uint32_t)0x0003) /*!<PD[0] pin */
  6140. #define SYSCFG_EXTICR1_EXTI0_PE ((uint32_t)0x0004) /*!<PE[0] pin */
  6141. #define SYSCFG_EXTICR1_EXTI0_PF ((uint32_t)0x0005) /*!<PF[0] pin */
  6142. #define SYSCFG_EXTICR1_EXTI0_PG ((uint32_t)0x0006) /*!<PG[0] pin */
  6143. #define SYSCFG_EXTICR1_EXTI0_PH ((uint32_t)0x0007) /*!<PH[0] pin */
  6144. #define SYSCFG_EXTICR1_EXTI0_PI ((uint32_t)0x0008) /*!<PI[0] pin */
  6145. #define SYSCFG_EXTICR1_EXTI0_PJ ((uint32_t)0x0009) /*!<PJ[0] pin */
  6146. #define SYSCFG_EXTICR1_EXTI0_PK ((uint32_t)0x000A) /*!<PK[0] pin */
  6147. /**
  6148. * @brief EXTI1 configuration
  6149. */
  6150. #define SYSCFG_EXTICR1_EXTI1_PA ((uint32_t)0x0000) /*!<PA[1] pin */
  6151. #define SYSCFG_EXTICR1_EXTI1_PB ((uint32_t)0x0010) /*!<PB[1] pin */
  6152. #define SYSCFG_EXTICR1_EXTI1_PC ((uint32_t)0x0020) /*!<PC[1] pin */
  6153. #define SYSCFG_EXTICR1_EXTI1_PD ((uint32_t)0x0030) /*!<PD[1] pin */
  6154. #define SYSCFG_EXTICR1_EXTI1_PE ((uint32_t)0x0040) /*!<PE[1] pin */
  6155. #define SYSCFG_EXTICR1_EXTI1_PF ((uint32_t)0x0050) /*!<PF[1] pin */
  6156. #define SYSCFG_EXTICR1_EXTI1_PG ((uint32_t)0x0060) /*!<PG[1] pin */
  6157. #define SYSCFG_EXTICR1_EXTI1_PH ((uint32_t)0x0070) /*!<PH[1] pin */
  6158. #define SYSCFG_EXTICR1_EXTI1_PI ((uint32_t)0x0080) /*!<PI[1] pin */
  6159. #define SYSCFG_EXTICR1_EXTI1_PJ ((uint32_t)0x0090) /*!<PJ[1] pin */
  6160. #define SYSCFG_EXTICR1_EXTI1_PK ((uint32_t)0x00A0) /*!<PK[1] pin */
  6161. /**
  6162. * @brief EXTI2 configuration
  6163. */
  6164. #define SYSCFG_EXTICR1_EXTI2_PA ((uint32_t)0x0000) /*!<PA[2] pin */
  6165. #define SYSCFG_EXTICR1_EXTI2_PB ((uint32_t)0x0100) /*!<PB[2] pin */
  6166. #define SYSCFG_EXTICR1_EXTI2_PC ((uint32_t)0x0200) /*!<PC[2] pin */
  6167. #define SYSCFG_EXTICR1_EXTI2_PD ((uint32_t)0x0300) /*!<PD[2] pin */
  6168. #define SYSCFG_EXTICR1_EXTI2_PE ((uint32_t)0x0400) /*!<PE[2] pin */
  6169. #define SYSCFG_EXTICR1_EXTI2_PF ((uint32_t)0x0500) /*!<PF[2] pin */
  6170. #define SYSCFG_EXTICR1_EXTI2_PG ((uint32_t)0x0600) /*!<PG[2] pin */
  6171. #define SYSCFG_EXTICR1_EXTI2_PH ((uint32_t)0x0700) /*!<PH[2] pin */
  6172. #define SYSCFG_EXTICR1_EXTI2_PI ((uint32_t)0x0800) /*!<PI[2] pin */
  6173. #define SYSCFG_EXTICR1_EXTI2_PJ ((uint32_t)0x0900) /*!<PJ[2] pin */
  6174. #define SYSCFG_EXTICR1_EXTI2_PK ((uint32_t)0x0A00) /*!<PK[2] pin */
  6175. /**
  6176. * @brief EXTI3 configuration
  6177. */
  6178. #define SYSCFG_EXTICR1_EXTI3_PA ((uint32_t)0x0000) /*!<PA[3] pin */
  6179. #define SYSCFG_EXTICR1_EXTI3_PB ((uint32_t)0x1000) /*!<PB[3] pin */
  6180. #define SYSCFG_EXTICR1_EXTI3_PC ((uint32_t)0x2000) /*!<PC[3] pin */
  6181. #define SYSCFG_EXTICR1_EXTI3_PD ((uint32_t)0x3000) /*!<PD[3] pin */
  6182. #define SYSCFG_EXTICR1_EXTI3_PE ((uint32_t)0x4000) /*!<PE[3] pin */
  6183. #define SYSCFG_EXTICR1_EXTI3_PF ((uint32_t)0x5000) /*!<PF[3] pin */
  6184. #define SYSCFG_EXTICR1_EXTI3_PG ((uint32_t)0x6000) /*!<PG[3] pin */
  6185. #define SYSCFG_EXTICR1_EXTI3_PH ((uint32_t)0x7000) /*!<PH[3] pin */
  6186. #define SYSCFG_EXTICR1_EXTI3_PI ((uint32_t)0x8000) /*!<PI[3] pin */
  6187. #define SYSCFG_EXTICR1_EXTI3_PJ ((uint32_t)0x9000) /*!<PJ[3] pin */
  6188. #define SYSCFG_EXTICR1_EXTI3_PK ((uint32_t)0xA000) /*!<PK[3] pin */
  6189. /***************** Bit definition for SYSCFG_EXTICR2 register ***************/
  6190. #define SYSCFG_EXTICR2_EXTI4 ((uint32_t)0x000F) /*!<EXTI 4 configuration */
  6191. #define SYSCFG_EXTICR2_EXTI5 ((uint32_t)0x00F0) /*!<EXTI 5 configuration */
  6192. #define SYSCFG_EXTICR2_EXTI6 ((uint32_t)0x0F00) /*!<EXTI 6 configuration */
  6193. #define SYSCFG_EXTICR2_EXTI7 ((uint32_t)0xF000) /*!<EXTI 7 configuration */
  6194. /**
  6195. * @brief EXTI4 configuration
  6196. */
  6197. #define SYSCFG_EXTICR2_EXTI4_PA ((uint32_t)0x0000) /*!<PA[4] pin */
  6198. #define SYSCFG_EXTICR2_EXTI4_PB ((uint32_t)0x0001) /*!<PB[4] pin */
  6199. #define SYSCFG_EXTICR2_EXTI4_PC ((uint32_t)0x0002) /*!<PC[4] pin */
  6200. #define SYSCFG_EXTICR2_EXTI4_PD ((uint32_t)0x0003) /*!<PD[4] pin */
  6201. #define SYSCFG_EXTICR2_EXTI4_PE ((uint32_t)0x0004) /*!<PE[4] pin */
  6202. #define SYSCFG_EXTICR2_EXTI4_PF ((uint32_t)0x0005) /*!<PF[4] pin */
  6203. #define SYSCFG_EXTICR2_EXTI4_PG ((uint32_t)0x0006) /*!<PG[4] pin */
  6204. #define SYSCFG_EXTICR2_EXTI4_PH ((uint32_t)0x0007) /*!<PH[4] pin */
  6205. #define SYSCFG_EXTICR2_EXTI4_PI ((uint32_t)0x0008) /*!<PI[4] pin */
  6206. #define SYSCFG_EXTICR2_EXTI4_PJ ((uint32_t)0x0009) /*!<PJ[4] pin */
  6207. #define SYSCFG_EXTICR2_EXTI4_PK ((uint32_t)0x000A) /*!<PK[4] pin */
  6208. /**
  6209. * @brief EXTI5 configuration
  6210. */
  6211. #define SYSCFG_EXTICR2_EXTI5_PA ((uint32_t)0x0000) /*!<PA[5] pin */
  6212. #define SYSCFG_EXTICR2_EXTI5_PB ((uint32_t)0x0010) /*!<PB[5] pin */
  6213. #define SYSCFG_EXTICR2_EXTI5_PC ((uint32_t)0x0020) /*!<PC[5] pin */
  6214. #define SYSCFG_EXTICR2_EXTI5_PD ((uint32_t)0x0030) /*!<PD[5] pin */
  6215. #define SYSCFG_EXTICR2_EXTI5_PE ((uint32_t)0x0040) /*!<PE[5] pin */
  6216. #define SYSCFG_EXTICR2_EXTI5_PF ((uint32_t)0x0050) /*!<PF[5] pin */
  6217. #define SYSCFG_EXTICR2_EXTI5_PG ((uint32_t)0x0060) /*!<PG[5] pin */
  6218. #define SYSCFG_EXTICR2_EXTI5_PH ((uint32_t)0x0070) /*!<PH[5] pin */
  6219. #define SYSCFG_EXTICR2_EXTI5_PI ((uint32_t)0x0080) /*!<PI[5] pin */
  6220. #define SYSCFG_EXTICR2_EXTI5_PJ ((uint32_t)0x0090) /*!<PJ[5] pin */
  6221. #define SYSCFG_EXTICR2_EXTI5_PK ((uint32_t)0x00A0) /*!<PK[5] pin */
  6222. /**
  6223. * @brief EXTI6 configuration
  6224. */
  6225. #define SYSCFG_EXTICR2_EXTI6_PA ((uint32_t)0x0000) /*!<PA[6] pin */
  6226. #define SYSCFG_EXTICR2_EXTI6_PB ((uint32_t)0x0100) /*!<PB[6] pin */
  6227. #define SYSCFG_EXTICR2_EXTI6_PC ((uint32_t)0x0200) /*!<PC[6] pin */
  6228. #define SYSCFG_EXTICR2_EXTI6_PD ((uint32_t)0x0300) /*!<PD[6] pin */
  6229. #define SYSCFG_EXTICR2_EXTI6_PE ((uint32_t)0x0400) /*!<PE[6] pin */
  6230. #define SYSCFG_EXTICR2_EXTI6_PF ((uint32_t)0x0500) /*!<PF[6] pin */
  6231. #define SYSCFG_EXTICR2_EXTI6_PG ((uint32_t)0x0600) /*!<PG[6] pin */
  6232. #define SYSCFG_EXTICR2_EXTI6_PH ((uint32_t)0x0700) /*!<PH[6] pin */
  6233. #define SYSCFG_EXTICR2_EXTI6_PI ((uint32_t)0x0800) /*!<PI[6] pin */
  6234. #define SYSCFG_EXTICR2_EXTI6_PJ ((uint32_t)0x0900) /*!<PJ[6] pin */
  6235. #define SYSCFG_EXTICR2_EXTI6_PK ((uint32_t)0x0A00) /*!<PK[6] pin */
  6236. /**
  6237. * @brief EXTI7 configuration
  6238. */
  6239. #define SYSCFG_EXTICR2_EXTI7_PA ((uint32_t)0x0000) /*!<PA[7] pin */
  6240. #define SYSCFG_EXTICR2_EXTI7_PB ((uint32_t)0x1000) /*!<PB[7] pin */
  6241. #define SYSCFG_EXTICR2_EXTI7_PC ((uint32_t)0x2000) /*!<PC[7] pin */
  6242. #define SYSCFG_EXTICR2_EXTI7_PD ((uint32_t)0x3000) /*!<PD[7] pin */
  6243. #define SYSCFG_EXTICR2_EXTI7_PE ((uint32_t)0x4000) /*!<PE[7] pin */
  6244. #define SYSCFG_EXTICR2_EXTI7_PF ((uint32_t)0x5000) /*!<PF[7] pin */
  6245. #define SYSCFG_EXTICR2_EXTI7_PG ((uint32_t)0x6000) /*!<PG[7] pin */
  6246. #define SYSCFG_EXTICR2_EXTI7_PH ((uint32_t)0x7000) /*!<PH[7] pin */
  6247. #define SYSCFG_EXTICR2_EXTI7_PI ((uint32_t)0x8000) /*!<PI[7] pin */
  6248. #define SYSCFG_EXTICR2_EXTI7_PJ ((uint32_t)0x9000) /*!<PJ[7] pin */
  6249. #define SYSCFG_EXTICR2_EXTI7_PK ((uint32_t)0xA000) /*!<PK[7] pin */
  6250. /***************** Bit definition for SYSCFG_EXTICR3 register ***************/
  6251. #define SYSCFG_EXTICR3_EXTI8 ((uint32_t)0x000F) /*!<EXTI 8 configuration */
  6252. #define SYSCFG_EXTICR3_EXTI9 ((uint32_t)0x00F0) /*!<EXTI 9 configuration */
  6253. #define SYSCFG_EXTICR3_EXTI10 ((uint32_t)0x0F00) /*!<EXTI 10 configuration */
  6254. #define SYSCFG_EXTICR3_EXTI11 ((uint32_t)0xF000) /*!<EXTI 11 configuration */
  6255. /**
  6256. * @brief EXTI8 configuration
  6257. */
  6258. #define SYSCFG_EXTICR3_EXTI8_PA ((uint32_t)0x0000) /*!<PA[8] pin */
  6259. #define SYSCFG_EXTICR3_EXTI8_PB ((uint32_t)0x0001) /*!<PB[8] pin */
  6260. #define SYSCFG_EXTICR3_EXTI8_PC ((uint32_t)0x0002) /*!<PC[8] pin */
  6261. #define SYSCFG_EXTICR3_EXTI8_PD ((uint32_t)0x0003) /*!<PD[8] pin */
  6262. #define SYSCFG_EXTICR3_EXTI8_PE ((uint32_t)0x0004) /*!<PE[8] pin */
  6263. #define SYSCFG_EXTICR3_EXTI8_PF ((uint32_t)0x0005) /*!<PF[8] pin */
  6264. #define SYSCFG_EXTICR3_EXTI8_PG ((uint32_t)0x0006) /*!<PG[8] pin */
  6265. #define SYSCFG_EXTICR3_EXTI8_PH ((uint32_t)0x0007) /*!<PH[8] pin */
  6266. #define SYSCFG_EXTICR3_EXTI8_PI ((uint32_t)0x0008) /*!<PI[8] pin */
  6267. #define SYSCFG_EXTICR3_EXTI8_PJ ((uint32_t)0x0009) /*!<PJ[8] pin */
  6268. /**
  6269. * @brief EXTI9 configuration
  6270. */
  6271. #define SYSCFG_EXTICR3_EXTI9_PA ((uint32_t)0x0000) /*!<PA[9] pin */
  6272. #define SYSCFG_EXTICR3_EXTI9_PB ((uint32_t)0x0010) /*!<PB[9] pin */
  6273. #define SYSCFG_EXTICR3_EXTI9_PC ((uint32_t)0x0020) /*!<PC[9] pin */
  6274. #define SYSCFG_EXTICR3_EXTI9_PD ((uint32_t)0x0030) /*!<PD[9] pin */
  6275. #define SYSCFG_EXTICR3_EXTI9_PE ((uint32_t)0x0040) /*!<PE[9] pin */
  6276. #define SYSCFG_EXTICR3_EXTI9_PF ((uint32_t)0x0050) /*!<PF[9] pin */
  6277. #define SYSCFG_EXTICR3_EXTI9_PG ((uint32_t)0x0060) /*!<PG[9] pin */
  6278. #define SYSCFG_EXTICR3_EXTI9_PH ((uint32_t)0x0070) /*!<PH[9] pin */
  6279. #define SYSCFG_EXTICR3_EXTI9_PI ((uint32_t)0x0080) /*!<PI[9] pin */
  6280. #define SYSCFG_EXTICR3_EXTI9_PJ ((uint32_t)0x0090) /*!<PJ[9] pin */
  6281. /**
  6282. * @brief EXTI10 configuration
  6283. */
  6284. #define SYSCFG_EXTICR3_EXTI10_PA ((uint32_t)0x0000) /*!<PA[10] pin */
  6285. #define SYSCFG_EXTICR3_EXTI10_PB ((uint32_t)0x0100) /*!<PB[10] pin */
  6286. #define SYSCFG_EXTICR3_EXTI10_PC ((uint32_t)0x0200) /*!<PC[10] pin */
  6287. #define SYSCFG_EXTICR3_EXTI10_PD ((uint32_t)0x0300) /*!<PD[10] pin */
  6288. #define SYSCFG_EXTICR3_EXTI10_PE ((uint32_t)0x0400) /*!<PE[10] pin */
  6289. #define SYSCFG_EXTICR3_EXTI10_PF ((uint32_t)0x0500) /*!<PF[10] pin */
  6290. #define SYSCFG_EXTICR3_EXTI10_PG ((uint32_t)0x0600) /*!<PG[10] pin */
  6291. #define SYSCFG_EXTICR3_EXTI10_PH ((uint32_t)0x0700) /*!<PH[10] pin */
  6292. #define SYSCFG_EXTICR3_EXTI10_PI ((uint32_t)0x0800) /*!<PI[10] pin */
  6293. #define SYSCFG_EXTICR3_EXTI10_PJ ((uint32_t)0x0900) /*!<PJ[10] pin */
  6294. /**
  6295. * @brief EXTI11 configuration
  6296. */
  6297. #define SYSCFG_EXTICR3_EXTI11_PA ((uint32_t)0x0000) /*!<PA[11] pin */
  6298. #define SYSCFG_EXTICR3_EXTI11_PB ((uint32_t)0x1000) /*!<PB[11] pin */
  6299. #define SYSCFG_EXTICR3_EXTI11_PC ((uint32_t)0x2000) /*!<PC[11] pin */
  6300. #define SYSCFG_EXTICR3_EXTI11_PD ((uint32_t)0x3000) /*!<PD[11] pin */
  6301. #define SYSCFG_EXTICR3_EXTI11_PE ((uint32_t)0x4000) /*!<PE[11] pin */
  6302. #define SYSCFG_EXTICR3_EXTI11_PF ((uint32_t)0x5000) /*!<PF[11] pin */
  6303. #define SYSCFG_EXTICR3_EXTI11_PG ((uint32_t)0x6000) /*!<PG[11] pin */
  6304. #define SYSCFG_EXTICR3_EXTI11_PH ((uint32_t)0x7000) /*!<PH[11] pin */
  6305. #define SYSCFG_EXTICR3_EXTI11_PI ((uint32_t)0x8000) /*!<PI[11] pin */
  6306. #define SYSCFG_EXTICR3_EXTI11_PJ ((uint32_t)0x9000) /*!<PJ[11] pin */
  6307. /***************** Bit definition for SYSCFG_EXTICR4 register ***************/
  6308. #define SYSCFG_EXTICR4_EXTI12 ((uint32_t)0x000F) /*!<EXTI 12 configuration */
  6309. #define SYSCFG_EXTICR4_EXTI13 ((uint32_t)0x00F0) /*!<EXTI 13 configuration */
  6310. #define SYSCFG_EXTICR4_EXTI14 ((uint32_t)0x0F00) /*!<EXTI 14 configuration */
  6311. #define SYSCFG_EXTICR4_EXTI15 ((uint32_t)0xF000) /*!<EXTI 15 configuration */
  6312. /**
  6313. * @brief EXTI12 configuration
  6314. */
  6315. #define SYSCFG_EXTICR4_EXTI12_PA ((uint32_t)0x0000) /*!<PA[12] pin */
  6316. #define SYSCFG_EXTICR4_EXTI12_PB ((uint32_t)0x0001) /*!<PB[12] pin */
  6317. #define SYSCFG_EXTICR4_EXTI12_PC ((uint32_t)0x0002) /*!<PC[12] pin */
  6318. #define SYSCFG_EXTICR4_EXTI12_PD ((uint32_t)0x0003) /*!<PD[12] pin */
  6319. #define SYSCFG_EXTICR4_EXTI12_PE ((uint32_t)0x0004) /*!<PE[12] pin */
  6320. #define SYSCFG_EXTICR4_EXTI12_PF ((uint32_t)0x0005) /*!<PF[12] pin */
  6321. #define SYSCFG_EXTICR4_EXTI12_PG ((uint32_t)0x0006) /*!<PG[12] pin */
  6322. #define SYSCFG_EXTICR4_EXTI12_PH ((uint32_t)0x0007) /*!<PH[12] pin */
  6323. #define SYSCFG_EXTICR4_EXTI12_PI ((uint32_t)0x0008) /*!<PI[12] pin */
  6324. #define SYSCFG_EXTICR4_EXTI12_PJ ((uint32_t)0x0009) /*!<PJ[12] pin */
  6325. /**
  6326. * @brief EXTI13 configuration
  6327. */
  6328. #define SYSCFG_EXTICR4_EXTI13_PA ((uint32_t)0x0000) /*!<PA[13] pin */
  6329. #define SYSCFG_EXTICR4_EXTI13_PB ((uint32_t)0x0010) /*!<PB[13] pin */
  6330. #define SYSCFG_EXTICR4_EXTI13_PC ((uint32_t)0x0020) /*!<PC[13] pin */
  6331. #define SYSCFG_EXTICR4_EXTI13_PD ((uint32_t)0x0030) /*!<PD[13] pin */
  6332. #define SYSCFG_EXTICR4_EXTI13_PE ((uint32_t)0x0040) /*!<PE[13] pin */
  6333. #define SYSCFG_EXTICR4_EXTI13_PF ((uint32_t)0x0050) /*!<PF[13] pin */
  6334. #define SYSCFG_EXTICR4_EXTI13_PG ((uint32_t)0x0060) /*!<PG[13] pin */
  6335. #define SYSCFG_EXTICR4_EXTI13_PH ((uint32_t)0x0070) /*!<PH[13] pin */
  6336. #define SYSCFG_EXTICR4_EXTI13_PI ((uint32_t)0x0008) /*!<PI[13] pin */
  6337. #define SYSCFG_EXTICR4_EXTI13_PJ ((uint32_t)0x0009) /*!<PJ[13] pin */
  6338. /**
  6339. * @brief EXTI14 configuration
  6340. */
  6341. #define SYSCFG_EXTICR4_EXTI14_PA ((uint32_t)0x0000) /*!<PA[14] pin */
  6342. #define SYSCFG_EXTICR4_EXTI14_PB ((uint32_t)0x0100) /*!<PB[14] pin */
  6343. #define SYSCFG_EXTICR4_EXTI14_PC ((uint32_t)0x0200) /*!<PC[14] pin */
  6344. #define SYSCFG_EXTICR4_EXTI14_PD ((uint32_t)0x0300) /*!<PD[14] pin */
  6345. #define SYSCFG_EXTICR4_EXTI14_PE ((uint32_t)0x0400) /*!<PE[14] pin */
  6346. #define SYSCFG_EXTICR4_EXTI14_PF ((uint32_t)0x0500) /*!<PF[14] pin */
  6347. #define SYSCFG_EXTICR4_EXTI14_PG ((uint32_t)0x0600) /*!<PG[14] pin */
  6348. #define SYSCFG_EXTICR4_EXTI14_PH ((uint32_t)0x0700) /*!<PH[14] pin */
  6349. #define SYSCFG_EXTICR4_EXTI14_PI ((uint32_t)0x0800) /*!<PI[14] pin */
  6350. #define SYSCFG_EXTICR4_EXTI14_PJ ((uint32_t)0x0900) /*!<PJ[14] pin */
  6351. /**
  6352. * @brief EXTI15 configuration
  6353. */
  6354. #define SYSCFG_EXTICR4_EXTI15_PA ((uint32_t)0x0000) /*!<PA[15] pin */
  6355. #define SYSCFG_EXTICR4_EXTI15_PB ((uint32_t)0x1000) /*!<PB[15] pin */
  6356. #define SYSCFG_EXTICR4_EXTI15_PC ((uint32_t)0x2000) /*!<PC[15] pin */
  6357. #define SYSCFG_EXTICR4_EXTI15_PD ((uint32_t)0x3000) /*!<PD[15] pin */
  6358. #define SYSCFG_EXTICR4_EXTI15_PE ((uint32_t)0x4000) /*!<PE[15] pin */
  6359. #define SYSCFG_EXTICR4_EXTI15_PF ((uint32_t)0x5000) /*!<PF[15] pin */
  6360. #define SYSCFG_EXTICR4_EXTI15_PG ((uint32_t)0x6000) /*!<PG[15] pin */
  6361. #define SYSCFG_EXTICR4_EXTI15_PH ((uint32_t)0x7000) /*!<PH[15] pin */
  6362. #define SYSCFG_EXTICR4_EXTI15_PI ((uint32_t)0x8000) /*!<PI[15] pin */
  6363. #define SYSCFG_EXTICR4_EXTI15_PJ ((uint32_t)0x9000) /*!<PJ[15] pin */
  6364. /****************** Bit definition for SYSCFG_CMPCR register ****************/
  6365. #define SYSCFG_CMPCR_CMP_PD ((uint32_t)0x00000001) /*!<Compensation cell power-down */
  6366. #define SYSCFG_CMPCR_READY ((uint32_t)0x00000100) /*!<Compensation cell ready flag*/
  6367. /******************************************************************************/
  6368. /* */
  6369. /* TIM */
  6370. /* */
  6371. /******************************************************************************/
  6372. /******************* Bit definition for TIM_CR1 register ********************/
  6373. #define TIM_CR1_CEN ((uint32_t)0x0001) /*!<Counter enable */
  6374. #define TIM_CR1_UDIS ((uint32_t)0x0002) /*!<Update disable */
  6375. #define TIM_CR1_URS ((uint32_t)0x0004) /*!<Update request source */
  6376. #define TIM_CR1_OPM ((uint32_t)0x0008) /*!<One pulse mode */
  6377. #define TIM_CR1_DIR ((uint32_t)0x0010) /*!<Direction */
  6378. #define TIM_CR1_CMS ((uint32_t)0x0060) /*!<CMS[1:0] bits (Center-aligned mode selection) */
  6379. #define TIM_CR1_CMS_0 ((uint32_t)0x0020) /*!<Bit 0 */
  6380. #define TIM_CR1_CMS_1 ((uint32_t)0x0040) /*!<Bit 1 */
  6381. #define TIM_CR1_ARPE ((uint32_t)0x0080) /*!<Auto-reload preload enable */
  6382. #define TIM_CR1_CKD ((uint32_t)0x0300) /*!<CKD[1:0] bits (clock division) */
  6383. #define TIM_CR1_CKD_0 ((uint32_t)0x0100) /*!<Bit 0 */
  6384. #define TIM_CR1_CKD_1 ((uint32_t)0x0200) /*!<Bit 1 */
  6385. #define TIM_CR1_UIFREMAP ((uint32_t)0x0800) /*!<UIF status bit */
  6386. /******************* Bit definition for TIM_CR2 register ********************/
  6387. #define TIM_CR2_CCPC ((uint32_t)0x00000001) /*!<Capture/Compare Preloaded Control */
  6388. #define TIM_CR2_CCUS ((uint32_t)0x00000004) /*!<Capture/Compare Control Update Selection */
  6389. #define TIM_CR2_CCDS ((uint32_t)0x00000008) /*!<Capture/Compare DMA Selection */
  6390. #define TIM_CR2_OIS5 ((uint32_t)0x00010000) /*!<Output Idle state 4 (OC4 output) */
  6391. #define TIM_CR2_OIS6 ((uint32_t)0x00040000) /*!<Output Idle state 4 (OC4 output) */
  6392. #define TIM_CR2_MMS ((uint32_t)0x0070) /*!<MMS[2:0] bits (Master Mode Selection) */
  6393. #define TIM_CR2_MMS_0 ((uint32_t)0x0010) /*!<Bit 0 */
  6394. #define TIM_CR2_MMS_1 ((uint32_t)0x0020) /*!<Bit 1 */
  6395. #define TIM_CR2_MMS_2 ((uint32_t)0x0040) /*!<Bit 2 */
  6396. #define TIM_CR2_MMS2 ((uint32_t)0x00F00000) /*!<MMS[2:0] bits (Master Mode Selection) */
  6397. #define TIM_CR2_MMS2_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  6398. #define TIM_CR2_MMS2_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  6399. #define TIM_CR2_MMS2_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  6400. #define TIM_CR2_MMS2_3 ((uint32_t)0x00800000) /*!<Bit 2 */
  6401. #define TIM_CR2_TI1S ((uint32_t)0x0080) /*!<TI1 Selection */
  6402. #define TIM_CR2_OIS1 ((uint32_t)0x0100) /*!<Output Idle state 1 (OC1 output) */
  6403. #define TIM_CR2_OIS1N ((uint32_t)0x0200) /*!<Output Idle state 1 (OC1N output) */
  6404. #define TIM_CR2_OIS2 ((uint32_t)0x0400) /*!<Output Idle state 2 (OC2 output) */
  6405. #define TIM_CR2_OIS2N ((uint32_t)0x0800) /*!<Output Idle state 2 (OC2N output) */
  6406. #define TIM_CR2_OIS3 ((uint32_t)0x1000) /*!<Output Idle state 3 (OC3 output) */
  6407. #define TIM_CR2_OIS3N ((uint32_t)0x2000) /*!<Output Idle state 3 (OC3N output) */
  6408. #define TIM_CR2_OIS4 ((uint32_t)0x4000) /*!<Output Idle state 4 (OC4 output) */
  6409. /******************* Bit definition for TIM_SMCR register *******************/
  6410. #define TIM_SMCR_SMS ((uint32_t)0x00010007) /*!<SMS[2:0] bits (Slave mode selection) */
  6411. #define TIM_SMCR_SMS_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  6412. #define TIM_SMCR_SMS_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  6413. #define TIM_SMCR_SMS_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  6414. #define TIM_SMCR_SMS_3 ((uint32_t)0x00010000) /*!<Bit 3 */
  6415. #define TIM_SMCR_OCCS ((uint32_t)0x00000008) /*!< OCREF clear selection */
  6416. #define TIM_SMCR_TS ((uint32_t)0x0070) /*!<TS[2:0] bits (Trigger selection) */
  6417. #define TIM_SMCR_TS_0 ((uint32_t)0x0010) /*!<Bit 0 */
  6418. #define TIM_SMCR_TS_1 ((uint32_t)0x0020) /*!<Bit 1 */
  6419. #define TIM_SMCR_TS_2 ((uint32_t)0x0040) /*!<Bit 2 */
  6420. #define TIM_SMCR_MSM ((uint32_t)0x0080) /*!<Master/slave mode */
  6421. #define TIM_SMCR_ETF ((uint32_t)0x0F00) /*!<ETF[3:0] bits (External trigger filter) */
  6422. #define TIM_SMCR_ETF_0 ((uint32_t)0x0100) /*!<Bit 0 */
  6423. #define TIM_SMCR_ETF_1 ((uint32_t)0x0200) /*!<Bit 1 */
  6424. #define TIM_SMCR_ETF_2 ((uint32_t)0x0400) /*!<Bit 2 */
  6425. #define TIM_SMCR_ETF_3 ((uint32_t)0x0800) /*!<Bit 3 */
  6426. #define TIM_SMCR_ETPS ((uint32_t)0x3000) /*!<ETPS[1:0] bits (External trigger prescaler) */
  6427. #define TIM_SMCR_ETPS_0 ((uint32_t)0x1000) /*!<Bit 0 */
  6428. #define TIM_SMCR_ETPS_1 ((uint32_t)0x2000) /*!<Bit 1 */
  6429. #define TIM_SMCR_ECE ((uint32_t)0x4000) /*!<External clock enable */
  6430. #define TIM_SMCR_ETP ((uint32_t)0x8000) /*!<External trigger polarity */
  6431. /******************* Bit definition for TIM_DIER register *******************/
  6432. #define TIM_DIER_UIE ((uint32_t)0x0001) /*!<Update interrupt enable */
  6433. #define TIM_DIER_CC1IE ((uint32_t)0x0002) /*!<Capture/Compare 1 interrupt enable */
  6434. #define TIM_DIER_CC2IE ((uint32_t)0x0004) /*!<Capture/Compare 2 interrupt enable */
  6435. #define TIM_DIER_CC3IE ((uint32_t)0x0008) /*!<Capture/Compare 3 interrupt enable */
  6436. #define TIM_DIER_CC4IE ((uint32_t)0x0010) /*!<Capture/Compare 4 interrupt enable */
  6437. #define TIM_DIER_COMIE ((uint32_t)0x0020) /*!<COM interrupt enable */
  6438. #define TIM_DIER_TIE ((uint32_t)0x0040) /*!<Trigger interrupt enable */
  6439. #define TIM_DIER_BIE ((uint32_t)0x0080) /*!<Break interrupt enable */
  6440. #define TIM_DIER_UDE ((uint32_t)0x0100) /*!<Update DMA request enable */
  6441. #define TIM_DIER_CC1DE ((uint32_t)0x0200) /*!<Capture/Compare 1 DMA request enable */
  6442. #define TIM_DIER_CC2DE ((uint32_t)0x0400) /*!<Capture/Compare 2 DMA request enable */
  6443. #define TIM_DIER_CC3DE ((uint32_t)0x0800) /*!<Capture/Compare 3 DMA request enable */
  6444. #define TIM_DIER_CC4DE ((uint32_t)0x1000) /*!<Capture/Compare 4 DMA request enable */
  6445. #define TIM_DIER_COMDE ((uint32_t)0x2000) /*!<COM DMA request enable */
  6446. #define TIM_DIER_TDE ((uint32_t)0x4000) /*!<Trigger DMA request enable */
  6447. /******************** Bit definition for TIM_SR register ********************/
  6448. #define TIM_SR_UIF ((uint32_t)0x0001) /*!<Update interrupt Flag */
  6449. #define TIM_SR_CC1IF ((uint32_t)0x0002) /*!<Capture/Compare 1 interrupt Flag */
  6450. #define TIM_SR_CC2IF ((uint32_t)0x0004) /*!<Capture/Compare 2 interrupt Flag */
  6451. #define TIM_SR_CC3IF ((uint32_t)0x0008) /*!<Capture/Compare 3 interrupt Flag */
  6452. #define TIM_SR_CC4IF ((uint32_t)0x0010) /*!<Capture/Compare 4 interrupt Flag */
  6453. #define TIM_SR_COMIF ((uint32_t)0x0020) /*!<COM interrupt Flag */
  6454. #define TIM_SR_TIF ((uint32_t)0x0040) /*!<Trigger interrupt Flag */
  6455. #define TIM_SR_BIF ((uint32_t)0x0080) /*!<Break interrupt Flag */
  6456. #define TIM_SR_B2IF ((uint32_t)0x0100) /*!<Break2 interrupt Flag */
  6457. #define TIM_SR_CC1OF ((uint32_t)0x0200) /*!<Capture/Compare 1 Overcapture Flag */
  6458. #define TIM_SR_CC2OF ((uint32_t)0x0400) /*!<Capture/Compare 2 Overcapture Flag */
  6459. #define TIM_SR_CC3OF ((uint32_t)0x0800) /*!<Capture/Compare 3 Overcapture Flag */
  6460. #define TIM_SR_CC4OF ((uint32_t)0x1000) /*!<Capture/Compare 4 Overcapture Flag */
  6461. /******************* Bit definition for TIM_EGR register ********************/
  6462. #define TIM_EGR_UG ((uint32_t)0x00000001) /*!<Update Generation */
  6463. #define TIM_EGR_CC1G ((uint32_t)0x00000002) /*!<Capture/Compare 1 Generation */
  6464. #define TIM_EGR_CC2G ((uint32_t)0x00000004) /*!<Capture/Compare 2 Generation */
  6465. #define TIM_EGR_CC3G ((uint32_t)0x00000008) /*!<Capture/Compare 3 Generation */
  6466. #define TIM_EGR_CC4G ((uint32_t)0x00000010) /*!<Capture/Compare 4 Generation */
  6467. #define TIM_EGR_COMG ((uint32_t)0x00000020) /*!<Capture/Compare Control Update Generation */
  6468. #define TIM_EGR_TG ((uint32_t)0x00000040) /*!<Trigger Generation */
  6469. #define TIM_EGR_BG ((uint32_t)0x00000080) /*!<Break Generation */
  6470. #define TIM_EGR_B2G ((uint32_t)0x00000100) /*!<Break2 Generation */
  6471. /****************** Bit definition for TIM_CCMR1 register *******************/
  6472. #define TIM_CCMR1_CC1S ((uint32_t)0x00000003) /*!<CC1S[1:0] bits (Capture/Compare 1 Selection) */
  6473. #define TIM_CCMR1_CC1S_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  6474. #define TIM_CCMR1_CC1S_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  6475. #define TIM_CCMR1_OC1FE ((uint32_t)0x00000004) /*!<Output Compare 1 Fast enable */
  6476. #define TIM_CCMR1_OC1PE ((uint32_t)0x00000008) /*!<Output Compare 1 Preload enable */
  6477. #define TIM_CCMR1_OC1M ((uint32_t)0x00010070) /*!<OC1M[2:0] bits (Output Compare 1 Mode) */
  6478. #define TIM_CCMR1_OC1M_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  6479. #define TIM_CCMR1_OC1M_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  6480. #define TIM_CCMR1_OC1M_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  6481. #define TIM_CCMR1_OC1M_3 ((uint32_t)0x00010000) /*!<Bit 3 */
  6482. #define TIM_CCMR1_OC1CE ((uint32_t)0x00000080) /*!<Output Compare 1Clear Enable */
  6483. #define TIM_CCMR1_CC2S ((uint32_t)0x00000300) /*!<CC2S[1:0] bits (Capture/Compare 2 Selection) */
  6484. #define TIM_CCMR1_CC2S_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  6485. #define TIM_CCMR1_CC2S_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  6486. #define TIM_CCMR1_OC2FE ((uint32_t)0x00000400) /*!<Output Compare 2 Fast enable */
  6487. #define TIM_CCMR1_OC2PE ((uint32_t)0x00000800) /*!<Output Compare 2 Preload enable */
  6488. #define TIM_CCMR1_OC2M ((uint32_t)0x01007000) /*!<OC2M[2:0] bits (Output Compare 2 Mode) */
  6489. #define TIM_CCMR1_OC2M_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  6490. #define TIM_CCMR1_OC2M_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  6491. #define TIM_CCMR1_OC2M_2 ((uint32_t)0x00004000) /*!<Bit 2 */
  6492. #define TIM_CCMR1_OC2M_3 ((uint32_t)0x01000000) /*!<Bit 3 */
  6493. #define TIM_CCMR1_OC2CE ((uint32_t)0x00008000) /*!<Output Compare 2 Clear Enable */
  6494. /*----------------------------------------------------------------------------*/
  6495. #define TIM_CCMR1_IC1PSC ((uint32_t)0x000C) /*!<IC1PSC[1:0] bits (Input Capture 1 Prescaler) */
  6496. #define TIM_CCMR1_IC1PSC_0 ((uint32_t)0x0004) /*!<Bit 0 */
  6497. #define TIM_CCMR1_IC1PSC_1 ((uint32_t)0x0008) /*!<Bit 1 */
  6498. #define TIM_CCMR1_IC1F ((uint32_t)0x00F0) /*!<IC1F[3:0] bits (Input Capture 1 Filter) */
  6499. #define TIM_CCMR1_IC1F_0 ((uint32_t)0x0010) /*!<Bit 0 */
  6500. #define TIM_CCMR1_IC1F_1 ((uint32_t)0x0020) /*!<Bit 1 */
  6501. #define TIM_CCMR1_IC1F_2 ((uint32_t)0x0040) /*!<Bit 2 */
  6502. #define TIM_CCMR1_IC1F_3 ((uint32_t)0x0080) /*!<Bit 3 */
  6503. #define TIM_CCMR1_IC2PSC ((uint32_t)0x0C00) /*!<IC2PSC[1:0] bits (Input Capture 2 Prescaler) */
  6504. #define TIM_CCMR1_IC2PSC_0 ((uint32_t)0x0400) /*!<Bit 0 */
  6505. #define TIM_CCMR1_IC2PSC_1 ((uint32_t)0x0800) /*!<Bit 1 */
  6506. #define TIM_CCMR1_IC2F ((uint32_t)0xF000) /*!<IC2F[3:0] bits (Input Capture 2 Filter) */
  6507. #define TIM_CCMR1_IC2F_0 ((uint32_t)0x1000) /*!<Bit 0 */
  6508. #define TIM_CCMR1_IC2F_1 ((uint32_t)0x2000) /*!<Bit 1 */
  6509. #define TIM_CCMR1_IC2F_2 ((uint32_t)0x4000) /*!<Bit 2 */
  6510. #define TIM_CCMR1_IC2F_3 ((uint32_t)0x8000) /*!<Bit 3 */
  6511. /****************** Bit definition for TIM_CCMR2 register *******************/
  6512. #define TIM_CCMR2_CC3S ((uint32_t)0x00000003) /*!<CC3S[1:0] bits (Capture/Compare 3 Selection) */
  6513. #define TIM_CCMR2_CC3S_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  6514. #define TIM_CCMR2_CC3S_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  6515. #define TIM_CCMR2_OC3FE ((uint32_t)0x00000004) /*!<Output Compare 3 Fast enable */
  6516. #define TIM_CCMR2_OC3PE ((uint32_t)0x00000008) /*!<Output Compare 3 Preload enable */
  6517. #define TIM_CCMR2_OC3M ((uint32_t)0x00010070) /*!<OC3M[2:0] bits (Output Compare 3 Mode) */
  6518. #define TIM_CCMR2_OC3M_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  6519. #define TIM_CCMR2_OC3M_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  6520. #define TIM_CCMR2_OC3M_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  6521. #define TIM_CCMR2_OC3M_3 ((uint32_t)0x00010000) /*!<Bit 3 */
  6522. #define TIM_CCMR2_OC3CE ((uint32_t)0x00000080) /*!<Output Compare 3 Clear Enable */
  6523. #define TIM_CCMR2_CC4S ((uint32_t)0x00000300) /*!<CC4S[1:0] bits (Capture/Compare 4 Selection) */
  6524. #define TIM_CCMR2_CC4S_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  6525. #define TIM_CCMR2_CC4S_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  6526. #define TIM_CCMR2_OC4FE ((uint32_t)0x00000400) /*!<Output Compare 4 Fast enable */
  6527. #define TIM_CCMR2_OC4PE ((uint32_t)0x00000800) /*!<Output Compare 4 Preload enable */
  6528. #define TIM_CCMR2_OC4M ((uint32_t)0x01007000) /*!<OC4M[2:0] bits (Output Compare 4 Mode) */
  6529. #define TIM_CCMR2_OC4M_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  6530. #define TIM_CCMR2_OC4M_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  6531. #define TIM_CCMR2_OC4M_2 ((uint32_t)0x00004000) /*!<Bit 2 */
  6532. #define TIM_CCMR2_OC4M_3 ((uint32_t)0x01000000) /*!<Bit 3 */
  6533. #define TIM_CCMR2_OC4CE ((uint32_t)0x8000) /*!<Output Compare 4 Clear Enable */
  6534. /*----------------------------------------------------------------------------*/
  6535. #define TIM_CCMR2_IC3PSC ((uint32_t)0x000C) /*!<IC3PSC[1:0] bits (Input Capture 3 Prescaler) */
  6536. #define TIM_CCMR2_IC3PSC_0 ((uint32_t)0x0004) /*!<Bit 0 */
  6537. #define TIM_CCMR2_IC3PSC_1 ((uint32_t)0x0008) /*!<Bit 1 */
  6538. #define TIM_CCMR2_IC3F ((uint32_t)0x00F0) /*!<IC3F[3:0] bits (Input Capture 3 Filter) */
  6539. #define TIM_CCMR2_IC3F_0 ((uint32_t)0x0010) /*!<Bit 0 */
  6540. #define TIM_CCMR2_IC3F_1 ((uint32_t)0x0020) /*!<Bit 1 */
  6541. #define TIM_CCMR2_IC3F_2 ((uint32_t)0x0040) /*!<Bit 2 */
  6542. #define TIM_CCMR2_IC3F_3 ((uint32_t)0x0080) /*!<Bit 3 */
  6543. #define TIM_CCMR2_IC4PSC ((uint32_t)0x0C00) /*!<IC4PSC[1:0] bits (Input Capture 4 Prescaler) */
  6544. #define TIM_CCMR2_IC4PSC_0 ((uint32_t)0x0400) /*!<Bit 0 */
  6545. #define TIM_CCMR2_IC4PSC_1 ((uint32_t)0x0800) /*!<Bit 1 */
  6546. #define TIM_CCMR2_IC4F ((uint32_t)0xF000) /*!<IC4F[3:0] bits (Input Capture 4 Filter) */
  6547. #define TIM_CCMR2_IC4F_0 ((uint32_t)0x1000) /*!<Bit 0 */
  6548. #define TIM_CCMR2_IC4F_1 ((uint32_t)0x2000) /*!<Bit 1 */
  6549. #define TIM_CCMR2_IC4F_2 ((uint32_t)0x4000) /*!<Bit 2 */
  6550. #define TIM_CCMR2_IC4F_3 ((uint32_t)0x8000) /*!<Bit 3 */
  6551. /******************* Bit definition for TIM_CCER register *******************/
  6552. #define TIM_CCER_CC1E ((uint32_t)0x00000001) /*!<Capture/Compare 1 output enable */
  6553. #define TIM_CCER_CC1P ((uint32_t)0x00000002) /*!<Capture/Compare 1 output Polarity */
  6554. #define TIM_CCER_CC1NE ((uint32_t)0x00000004) /*!<Capture/Compare 1 Complementary output enable */
  6555. #define TIM_CCER_CC1NP ((uint32_t)0x00000008) /*!<Capture/Compare 1 Complementary output Polarity */
  6556. #define TIM_CCER_CC2E ((uint32_t)0x00000010) /*!<Capture/Compare 2 output enable */
  6557. #define TIM_CCER_CC2P ((uint32_t)0x00000020) /*!<Capture/Compare 2 output Polarity */
  6558. #define TIM_CCER_CC2NE ((uint32_t)0x00000040) /*!<Capture/Compare 2 Complementary output enable */
  6559. #define TIM_CCER_CC2NP ((uint32_t)0x00000080) /*!<Capture/Compare 2 Complementary output Polarity */
  6560. #define TIM_CCER_CC3E ((uint32_t)0x00000100) /*!<Capture/Compare 3 output enable */
  6561. #define TIM_CCER_CC3P ((uint32_t)0x00000200) /*!<Capture/Compare 3 output Polarity */
  6562. #define TIM_CCER_CC3NE ((uint32_t)0x00000400) /*!<Capture/Compare 3 Complementary output enable */
  6563. #define TIM_CCER_CC3NP ((uint32_t)0x00000800) /*!<Capture/Compare 3 Complementary output Polarity */
  6564. #define TIM_CCER_CC4E ((uint32_t)0x00001000) /*!<Capture/Compare 4 output enable */
  6565. #define TIM_CCER_CC4P ((uint32_t)0x00002000) /*!<Capture/Compare 4 output Polarity */
  6566. #define TIM_CCER_CC4NP ((uint32_t)0x00008000) /*!<Capture/Compare 4 Complementary output Polarity */
  6567. #define TIM_CCER_CC5E ((uint32_t)0x00010000) /*!<Capture/Compare 5 output enable */
  6568. #define TIM_CCER_CC5P ((uint32_t)0x00020000) /*!<Capture/Compare 5 output Polarity */
  6569. #define TIM_CCER_CC6E ((uint32_t)0x00100000) /*!<Capture/Compare 6 output enable */
  6570. #define TIM_CCER_CC6P ((uint32_t)0x00200000) /*!<Capture/Compare 6 output Polarity */
  6571. /******************* Bit definition for TIM_CNT register ********************/
  6572. #define TIM_CNT_CNT ((uint32_t)0xFFFF) /*!<Counter Value */
  6573. /******************* Bit definition for TIM_PSC register ********************/
  6574. #define TIM_PSC_PSC ((uint32_t)0xFFFF) /*!<Prescaler Value */
  6575. /******************* Bit definition for TIM_ARR register ********************/
  6576. #define TIM_ARR_ARR ((uint32_t)0xFFFF) /*!<actual auto-reload Value */
  6577. /******************* Bit definition for TIM_RCR register ********************/
  6578. #define TIM_RCR_REP ((uint8_t)0xFF) /*!<Repetition Counter Value */
  6579. /******************* Bit definition for TIM_CCR1 register *******************/
  6580. #define TIM_CCR1_CCR1 ((uint32_t)0xFFFF) /*!<Capture/Compare 1 Value */
  6581. /******************* Bit definition for TIM_CCR2 register *******************/
  6582. #define TIM_CCR2_CCR2 ((uint32_t)0xFFFF) /*!<Capture/Compare 2 Value */
  6583. /******************* Bit definition for TIM_CCR3 register *******************/
  6584. #define TIM_CCR3_CCR3 ((uint32_t)0xFFFF) /*!<Capture/Compare 3 Value */
  6585. /******************* Bit definition for TIM_CCR4 register *******************/
  6586. #define TIM_CCR4_CCR4 ((uint32_t)0xFFFF) /*!<Capture/Compare 4 Value */
  6587. /******************* Bit definition for TIM_BDTR register *******************/
  6588. #define TIM_BDTR_DTG ((uint32_t)0x000000FF) /*!<DTG[0:7] bits (Dead-Time Generator set-up) */
  6589. #define TIM_BDTR_DTG_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  6590. #define TIM_BDTR_DTG_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  6591. #define TIM_BDTR_DTG_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  6592. #define TIM_BDTR_DTG_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  6593. #define TIM_BDTR_DTG_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  6594. #define TIM_BDTR_DTG_5 ((uint32_t)0x00000020) /*!<Bit 5 */
  6595. #define TIM_BDTR_DTG_6 ((uint32_t)0x00000040) /*!<Bit 6 */
  6596. #define TIM_BDTR_DTG_7 ((uint32_t)0x00000080) /*!<Bit 7 */
  6597. #define TIM_BDTR_LOCK ((uint32_t)0x00000300) /*!<LOCK[1:0] bits (Lock Configuration) */
  6598. #define TIM_BDTR_LOCK_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  6599. #define TIM_BDTR_LOCK_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  6600. #define TIM_BDTR_OSSI ((uint32_t)0x00000400) /*!<Off-State Selection for Idle mode */
  6601. #define TIM_BDTR_OSSR ((uint32_t)0x00000800) /*!<Off-State Selection for Run mode */
  6602. #define TIM_BDTR_BKE ((uint32_t)0x00001000) /*!<Break enable */
  6603. #define TIM_BDTR_BKP ((uint32_t)0x00002000) /*!<Break Polarity */
  6604. #define TIM_BDTR_AOE ((uint32_t)0x00004000) /*!<Automatic Output enable */
  6605. #define TIM_BDTR_MOE ((uint32_t)0x00008000) /*!<Main Output enable */
  6606. #define TIM_BDTR_BKF ((uint32_t)0x000F0000) /*!<Break Filter for Break1 */
  6607. #define TIM_BDTR_BK2F ((uint32_t)0x00F00000) /*!<Break Filter for Break2 */
  6608. #define TIM_BDTR_BK2E ((uint32_t)0x01000000) /*!<Break enable for Break2 */
  6609. #define TIM_BDTR_BK2P ((uint32_t)0x02000000) /*!<Break Polarity for Break2 */
  6610. /******************* Bit definition for TIM_DCR register ********************/
  6611. #define TIM_DCR_DBA ((uint32_t)0x001F) /*!<DBA[4:0] bits (DMA Base Address) */
  6612. #define TIM_DCR_DBA_0 ((uint32_t)0x0001) /*!<Bit 0 */
  6613. #define TIM_DCR_DBA_1 ((uint32_t)0x0002) /*!<Bit 1 */
  6614. #define TIM_DCR_DBA_2 ((uint32_t)0x0004) /*!<Bit 2 */
  6615. #define TIM_DCR_DBA_3 ((uint32_t)0x0008) /*!<Bit 3 */
  6616. #define TIM_DCR_DBA_4 ((uint32_t)0x0010) /*!<Bit 4 */
  6617. #define TIM_DCR_DBL ((uint32_t)0x1F00) /*!<DBL[4:0] bits (DMA Burst Length) */
  6618. #define TIM_DCR_DBL_0 ((uint32_t)0x0100) /*!<Bit 0 */
  6619. #define TIM_DCR_DBL_1 ((uint32_t)0x0200) /*!<Bit 1 */
  6620. #define TIM_DCR_DBL_2 ((uint32_t)0x0400) /*!<Bit 2 */
  6621. #define TIM_DCR_DBL_3 ((uint32_t)0x0800) /*!<Bit 3 */
  6622. #define TIM_DCR_DBL_4 ((uint32_t)0x1000) /*!<Bit 4 */
  6623. /******************* Bit definition for TIM_DMAR register *******************/
  6624. #define TIM_DMAR_DMAB ((uint32_t)0xFFFF) /*!<DMA register for burst accesses */
  6625. /******************* Bit definition for TIM_OR register *********************/
  6626. #define TIM_OR_TI4_RMP ((uint32_t)0x00C0) /*!<TI4_RMP[1:0] bits (TIM5 Input 4 remap) */
  6627. #define TIM_OR_TI4_RMP_0 ((uint32_t)0x0040) /*!<Bit 0 */
  6628. #define TIM_OR_TI4_RMP_1 ((uint32_t)0x0080) /*!<Bit 1 */
  6629. #define TIM_OR_ITR1_RMP ((uint32_t)0x0C00) /*!<ITR1_RMP[1:0] bits (TIM2 Internal trigger 1 remap) */
  6630. #define TIM_OR_ITR1_RMP_0 ((uint32_t)0x0400) /*!<Bit 0 */
  6631. #define TIM_OR_ITR1_RMP_1 ((uint32_t)0x0800) /*!<Bit 1 */
  6632. /****************** Bit definition for TIM_CCMR3 register *******************/
  6633. #define TIM_CCMR3_OC5FE ((uint32_t)0x00000004) /*!<Output Compare 5 Fast enable */
  6634. #define TIM_CCMR3_OC5PE ((uint32_t)0x00000008) /*!<Output Compare 5 Preload enable */
  6635. #define TIM_CCMR3_OC5M ((uint32_t)0x00010070) /*!<OC5M[2:0] bits (Output Compare 5 Mode) */
  6636. #define TIM_CCMR3_OC5M_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  6637. #define TIM_CCMR3_OC5M_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  6638. #define TIM_CCMR3_OC5M_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  6639. #define TIM_CCMR3_OC5M_3 ((uint32_t)0x00010000) /*!<Bit 3 */
  6640. #define TIM_CCMR3_OC5CE ((uint32_t)0x00000080) /*!<Output Compare 5 Clear Enable */
  6641. #define TIM_CCMR3_OC6FE ((uint32_t)0x00000400) /*!<Output Compare 4 Fast enable */
  6642. #define TIM_CCMR3_OC6PE ((uint32_t)0x00000800) /*!<Output Compare 4 Preload enable */
  6643. #define TIM_CCMR3_OC6M ((uint32_t)0x01007000) /*!<OC4M[2:0] bits (Output Compare 4 Mode) */
  6644. #define TIM_CCMR3_OC6M_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  6645. #define TIM_CCMR3_OC6M_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  6646. #define TIM_CCMR3_OC6M_2 ((uint32_t)0x00004000) /*!<Bit 2 */
  6647. #define TIM_CCMR3_OC6M_3 ((uint32_t)0x01000000) /*!<Bit 3 */
  6648. #define TIM_CCMR3_OC6CE ((uint32_t)0x00008000) /*!<Output Compare 4 Clear Enable */
  6649. /******************* Bit definition for TIM_CCR5 register *******************/
  6650. #define TIM_CCR5_CCR5 ((uint32_t)0xFFFFFFFF) /*!<Capture/Compare 5 Value */
  6651. #define TIM_CCR5_GC5C1 ((uint32_t)0x20000000) /*!<Group Channel 5 and Channel 1 */
  6652. #define TIM_CCR5_GC5C2 ((uint32_t)0x40000000) /*!<Group Channel 5 and Channel 2 */
  6653. #define TIM_CCR5_GC5C3 ((uint32_t)0x80000000) /*!<Group Channel 5 and Channel 3 */
  6654. /******************* Bit definition for TIM_CCR6 register *******************/
  6655. #define TIM_CCR6_CCR6 ((uint16_t)0xFFFF) /*!<Capture/Compare 6 Value */
  6656. /******************************************************************************/
  6657. /* */
  6658. /* Low Power Timer (LPTIM) */
  6659. /* */
  6660. /******************************************************************************/
  6661. /****************** Bit definition for LPTIM_ISR register *******************/
  6662. #define LPTIM_ISR_CMPM ((uint32_t)0x00000001) /*!< Compare match */
  6663. #define LPTIM_ISR_ARRM ((uint32_t)0x00000002) /*!< Autoreload match */
  6664. #define LPTIM_ISR_EXTTRIG ((uint32_t)0x00000004) /*!< External trigger edge event */
  6665. #define LPTIM_ISR_CMPOK ((uint32_t)0x00000008) /*!< Compare register update OK */
  6666. #define LPTIM_ISR_ARROK ((uint32_t)0x00000010) /*!< Autoreload register update OK */
  6667. #define LPTIM_ISR_UP ((uint32_t)0x00000020) /*!< Counter direction change down to up */
  6668. #define LPTIM_ISR_DOWN ((uint32_t)0x00000040) /*!< Counter direction change up to down */
  6669. /****************** Bit definition for LPTIM_ICR register *******************/
  6670. #define LPTIM_ICR_CMPMCF ((uint32_t)0x00000001) /*!< Compare match Clear Flag */
  6671. #define LPTIM_ICR_ARRMCF ((uint32_t)0x00000002) /*!< Autoreload match Clear Flag */
  6672. #define LPTIM_ICR_EXTTRIGCF ((uint32_t)0x00000004) /*!< External trigger edge event Clear Flag */
  6673. #define LPTIM_ICR_CMPOKCF ((uint32_t)0x00000008) /*!< Compare register update OK Clear Flag */
  6674. #define LPTIM_ICR_ARROKCF ((uint32_t)0x00000010) /*!< Autoreload register update OK Clear Flag */
  6675. #define LPTIM_ICR_UPCF ((uint32_t)0x00000020) /*!< Counter direction change down to up Clear Flag */
  6676. #define LPTIM_ICR_DOWNCF ((uint32_t)0x00000040) /*!< Counter direction change up to down Clear Flag */
  6677. /****************** Bit definition for LPTIM_IER register ********************/
  6678. #define LPTIM_IER_CMPMIE ((uint32_t)0x00000001) /*!< Compare match Interrupt Enable */
  6679. #define LPTIM_IER_ARRMIE ((uint32_t)0x00000002) /*!< Autoreload match Interrupt Enable */
  6680. #define LPTIM_IER_EXTTRIGIE ((uint32_t)0x00000004) /*!< External trigger edge event Interrupt Enable */
  6681. #define LPTIM_IER_CMPOKIE ((uint32_t)0x00000008) /*!< Compare register update OK Interrupt Enable */
  6682. #define LPTIM_IER_ARROKIE ((uint32_t)0x00000010) /*!< Autoreload register update OK Interrupt Enable */
  6683. #define LPTIM_IER_UPIE ((uint32_t)0x00000020) /*!< Counter direction change down to up Interrupt Enable */
  6684. #define LPTIM_IER_DOWNIE ((uint32_t)0x00000040) /*!< Counter direction change up to down Interrupt Enable */
  6685. /****************** Bit definition for LPTIM_CFGR register *******************/
  6686. #define LPTIM_CFGR_CKSEL ((uint32_t)0x00000001) /*!< Clock selector */
  6687. #define LPTIM_CFGR_CKPOL ((uint32_t)0x00000006) /*!< CKPOL[1:0] bits (Clock polarity) */
  6688. #define LPTIM_CFGR_CKPOL_0 ((uint32_t)0x00000002) /*!< Bit 0 */
  6689. #define LPTIM_CFGR_CKPOL_1 ((uint32_t)0x00000004) /*!< Bit 1 */
  6690. #define LPTIM_CFGR_CKFLT ((uint32_t)0x00000018) /*!< CKFLT[1:0] bits (Configurable digital filter for external clock) */
  6691. #define LPTIM_CFGR_CKFLT_0 ((uint32_t)0x00000008) /*!< Bit 0 */
  6692. #define LPTIM_CFGR_CKFLT_1 ((uint32_t)0x00000010) /*!< Bit 1 */
  6693. #define LPTIM_CFGR_TRGFLT ((uint32_t)0x000000C0) /*!< TRGFLT[1:0] bits (Configurable digital filter for trigger) */
  6694. #define LPTIM_CFGR_TRGFLT_0 ((uint32_t)0x00000040) /*!< Bit 0 */
  6695. #define LPTIM_CFGR_TRGFLT_1 ((uint32_t)0x00000080) /*!< Bit 1 */
  6696. #define LPTIM_CFGR_PRESC ((uint32_t)0x00000E00) /*!< PRESC[2:0] bits (Clock prescaler) */
  6697. #define LPTIM_CFGR_PRESC_0 ((uint32_t)0x00000200) /*!< Bit 0 */
  6698. #define LPTIM_CFGR_PRESC_1 ((uint32_t)0x00000400) /*!< Bit 1 */
  6699. #define LPTIM_CFGR_PRESC_2 ((uint32_t)0x00000800) /*!< Bit 2 */
  6700. #define LPTIM_CFGR_TRIGSEL ((uint32_t)0x0000E000) /*!< TRIGSEL[2:0]] bits (Trigger selector) */
  6701. #define LPTIM_CFGR_TRIGSEL_0 ((uint32_t)0x00002000) /*!< Bit 0 */
  6702. #define LPTIM_CFGR_TRIGSEL_1 ((uint32_t)0x00004000) /*!< Bit 1 */
  6703. #define LPTIM_CFGR_TRIGSEL_2 ((uint32_t)0x00008000) /*!< Bit 2 */
  6704. #define LPTIM_CFGR_TRIGEN ((uint32_t)0x00060000) /*!< TRIGEN[1:0] bits (Trigger enable and polarity) */
  6705. #define LPTIM_CFGR_TRIGEN_0 ((uint32_t)0x00020000) /*!< Bit 0 */
  6706. #define LPTIM_CFGR_TRIGEN_1 ((uint32_t)0x00040000) /*!< Bit 1 */
  6707. #define LPTIM_CFGR_TIMOUT ((uint32_t)0x00080000) /*!< Timout enable */
  6708. #define LPTIM_CFGR_WAVE ((uint32_t)0x00100000) /*!< Waveform shape */
  6709. #define LPTIM_CFGR_WAVPOL ((uint32_t)0x00200000) /*!< Waveform shape polarity */
  6710. #define LPTIM_CFGR_PRELOAD ((uint32_t)0x00400000) /*!< Reg update mode */
  6711. #define LPTIM_CFGR_COUNTMODE ((uint32_t)0x00800000) /*!< Counter mode enable */
  6712. #define LPTIM_CFGR_ENC ((uint32_t)0x01000000) /*!< Encoder mode enable */
  6713. /****************** Bit definition for LPTIM_CR register ********************/
  6714. #define LPTIM_CR_ENABLE ((uint32_t)0x00000001) /*!< LPTIMer enable */
  6715. #define LPTIM_CR_SNGSTRT ((uint32_t)0x00080002) /*!< Timer start in single mode */
  6716. #define LPTIM_CR_CNTSTRT ((uint32_t)0x00000004) /*!< Timer start in continuous mode */
  6717. /****************** Bit definition for LPTIM_CMP register *******************/
  6718. #define LPTIM_CMP_CMP ((uint32_t)0x0000FFFF) /*!< Compare register */
  6719. /****************** Bit definition for LPTIM_ARR register *******************/
  6720. #define LPTIM_ARR_ARR ((uint32_t)0x0000FFFF) /*!< Auto reload register */
  6721. /****************** Bit definition for LPTIM_CNT register *******************/
  6722. #define LPTIM_CNT_CNT ((uint32_t)0x0000FFFF) /*!< Counter register */
  6723. /******************************************************************************/
  6724. /* */
  6725. /* Universal Synchronous Asynchronous Receiver Transmitter (USART) */
  6726. /* */
  6727. /******************************************************************************/
  6728. /****************** Bit definition for USART_CR1 register *******************/
  6729. #define USART_CR1_UE ((uint32_t)0x00000001) /*!< USART Enable */
  6730. #define USART_CR1_RE ((uint32_t)0x00000004) /*!< Receiver Enable */
  6731. #define USART_CR1_TE ((uint32_t)0x00000008) /*!< Transmitter Enable */
  6732. #define USART_CR1_IDLEIE ((uint32_t)0x00000010) /*!< IDLE Interrupt Enable */
  6733. #define USART_CR1_RXNEIE ((uint32_t)0x00000020) /*!< RXNE Interrupt Enable */
  6734. #define USART_CR1_TCIE ((uint32_t)0x00000040) /*!< Transmission Complete Interrupt Enable */
  6735. #define USART_CR1_TXEIE ((uint32_t)0x00000080) /*!< TXE Interrupt Enable */
  6736. #define USART_CR1_PEIE ((uint32_t)0x00000100) /*!< PE Interrupt Enable */
  6737. #define USART_CR1_PS ((uint32_t)0x00000200) /*!< Parity Selection */
  6738. #define USART_CR1_PCE ((uint32_t)0x00000400) /*!< Parity Control Enable */
  6739. #define USART_CR1_WAKE ((uint32_t)0x00000800) /*!< Receiver Wakeup method */
  6740. #define USART_CR1_M ((uint32_t)0x10001000) /*!< Word length */
  6741. #define USART_CR1_M_0 ((uint32_t)0x00001000) /*!< Word length - Bit 0 */
  6742. #define USART_CR1_MME ((uint32_t)0x00002000) /*!< Mute Mode Enable */
  6743. #define USART_CR1_CMIE ((uint32_t)0x00004000) /*!< Character match interrupt enable */
  6744. #define USART_CR1_OVER8 ((uint32_t)0x00008000) /*!< Oversampling by 8-bit or 16-bit mode */
  6745. #define USART_CR1_DEDT ((uint32_t)0x001F0000) /*!< DEDT[4:0] bits (Driver Enable Deassertion Time) */
  6746. #define USART_CR1_DEDT_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  6747. #define USART_CR1_DEDT_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  6748. #define USART_CR1_DEDT_2 ((uint32_t)0x00040000) /*!< Bit 2 */
  6749. #define USART_CR1_DEDT_3 ((uint32_t)0x00080000) /*!< Bit 3 */
  6750. #define USART_CR1_DEDT_4 ((uint32_t)0x00100000) /*!< Bit 4 */
  6751. #define USART_CR1_DEAT ((uint32_t)0x03E00000) /*!< DEAT[4:0] bits (Driver Enable Assertion Time) */
  6752. #define USART_CR1_DEAT_0 ((uint32_t)0x00200000) /*!< Bit 0 */
  6753. #define USART_CR1_DEAT_1 ((uint32_t)0x00400000) /*!< Bit 1 */
  6754. #define USART_CR1_DEAT_2 ((uint32_t)0x00800000) /*!< Bit 2 */
  6755. #define USART_CR1_DEAT_3 ((uint32_t)0x01000000) /*!< Bit 3 */
  6756. #define USART_CR1_DEAT_4 ((uint32_t)0x02000000) /*!< Bit 4 */
  6757. #define USART_CR1_RTOIE ((uint32_t)0x04000000) /*!< Receive Time Out interrupt enable */
  6758. #define USART_CR1_EOBIE ((uint32_t)0x08000000) /*!< End of Block interrupt enable */
  6759. #define USART_CR1_M_1 ((uint32_t)0x10000000) /*!< Word length - Bit 1 */
  6760. /****************** Bit definition for USART_CR2 register *******************/
  6761. #define USART_CR2_ADDM7 ((uint32_t)0x00000010) /*!< 7-bit or 4-bit Address Detection */
  6762. #define USART_CR2_LBDL ((uint32_t)0x00000020) /*!< LIN Break Detection Length */
  6763. #define USART_CR2_LBDIE ((uint32_t)0x00000040) /*!< LIN Break Detection Interrupt Enable */
  6764. #define USART_CR2_LBCL ((uint32_t)0x00000100) /*!< Last Bit Clock pulse */
  6765. #define USART_CR2_CPHA ((uint32_t)0x00000200) /*!< Clock Phase */
  6766. #define USART_CR2_CPOL ((uint32_t)0x00000400) /*!< Clock Polarity */
  6767. #define USART_CR2_CLKEN ((uint32_t)0x00000800) /*!< Clock Enable */
  6768. #define USART_CR2_STOP ((uint32_t)0x00003000) /*!< STOP[1:0] bits (STOP bits) */
  6769. #define USART_CR2_STOP_0 ((uint32_t)0x00001000) /*!< Bit 0 */
  6770. #define USART_CR2_STOP_1 ((uint32_t)0x00002000) /*!< Bit 1 */
  6771. #define USART_CR2_LINEN ((uint32_t)0x00004000) /*!< LIN mode enable */
  6772. #define USART_CR2_SWAP ((uint32_t)0x00008000) /*!< SWAP TX/RX pins */
  6773. #define USART_CR2_RXINV ((uint32_t)0x00010000) /*!< RX pin active level inversion */
  6774. #define USART_CR2_TXINV ((uint32_t)0x00020000) /*!< TX pin active level inversion */
  6775. #define USART_CR2_DATAINV ((uint32_t)0x00040000) /*!< Binary data inversion */
  6776. #define USART_CR2_MSBFIRST ((uint32_t)0x00080000) /*!< Most Significant Bit First */
  6777. #define USART_CR2_ABREN ((uint32_t)0x00100000) /*!< Auto Baud-Rate Enable */
  6778. #define USART_CR2_ABRMODE ((uint32_t)0x00600000) /*!< ABRMOD[1:0] bits (Auto Baud-Rate Mode) */
  6779. #define USART_CR2_ABRMODE_0 ((uint32_t)0x00200000) /*!< Bit 0 */
  6780. #define USART_CR2_ABRMODE_1 ((uint32_t)0x00400000) /*!< Bit 1 */
  6781. #define USART_CR2_RTOEN ((uint32_t)0x00800000) /*!< Receiver Time-Out enable */
  6782. #define USART_CR2_ADD ((uint32_t)0xFF000000) /*!< Address of the USART node */
  6783. /****************** Bit definition for USART_CR3 register *******************/
  6784. #define USART_CR3_EIE ((uint32_t)0x00000001) /*!< Error Interrupt Enable */
  6785. #define USART_CR3_IREN ((uint32_t)0x00000002) /*!< IrDA mode Enable */
  6786. #define USART_CR3_IRLP ((uint32_t)0x00000004) /*!< IrDA Low-Power */
  6787. #define USART_CR3_HDSEL ((uint32_t)0x00000008) /*!< Half-Duplex Selection */
  6788. #define USART_CR3_NACK ((uint32_t)0x00000010) /*!< SmartCard NACK enable */
  6789. #define USART_CR3_SCEN ((uint32_t)0x00000020) /*!< SmartCard mode enable */
  6790. #define USART_CR3_DMAR ((uint32_t)0x00000040) /*!< DMA Enable Receiver */
  6791. #define USART_CR3_DMAT ((uint32_t)0x00000080) /*!< DMA Enable Transmitter */
  6792. #define USART_CR3_RTSE ((uint32_t)0x00000100) /*!< RTS Enable */
  6793. #define USART_CR3_CTSE ((uint32_t)0x00000200) /*!< CTS Enable */
  6794. #define USART_CR3_CTSIE ((uint32_t)0x00000400) /*!< CTS Interrupt Enable */
  6795. #define USART_CR3_ONEBIT ((uint32_t)0x00000800) /*!< One sample bit method enable */
  6796. #define USART_CR3_OVRDIS ((uint32_t)0x00001000) /*!< Overrun Disable */
  6797. #define USART_CR3_DDRE ((uint32_t)0x00002000) /*!< DMA Disable on Reception Error */
  6798. #define USART_CR3_DEM ((uint32_t)0x00004000) /*!< Driver Enable Mode */
  6799. #define USART_CR3_DEP ((uint32_t)0x00008000) /*!< Driver Enable Polarity Selection */
  6800. #define USART_CR3_SCARCNT ((uint32_t)0x000E0000) /*!< SCARCNT[2:0] bits (SmartCard Auto-Retry Count) */
  6801. #define USART_CR3_SCARCNT_0 ((uint32_t)0x00020000) /*!< Bit 0 */
  6802. #define USART_CR3_SCARCNT_1 ((uint32_t)0x00040000) /*!< Bit 1 */
  6803. #define USART_CR3_SCARCNT_2 ((uint32_t)0x00080000) /*!< Bit 2 */
  6804. /****************** Bit definition for USART_BRR register *******************/
  6805. #define USART_BRR_DIV_FRACTION ((uint32_t)0x000F) /*!< Fraction of USARTDIV */
  6806. #define USART_BRR_DIV_MANTISSA ((uint32_t)0xFFF0) /*!< Mantissa of USARTDIV */
  6807. /****************** Bit definition for USART_GTPR register ******************/
  6808. #define USART_GTPR_PSC ((uint32_t)0x00FF) /*!< PSC[7:0] bits (Prescaler value) */
  6809. #define USART_GTPR_GT ((uint32_t)0xFF00) /*!< GT[7:0] bits (Guard time value) */
  6810. /******************* Bit definition for USART_RTOR register *****************/
  6811. #define USART_RTOR_RTO ((uint32_t)0x00FFFFFF) /*!< Receiver Time Out Value */
  6812. #define USART_RTOR_BLEN ((uint32_t)0xFF000000) /*!< Block Length */
  6813. /******************* Bit definition for USART_RQR register ******************/
  6814. #define USART_RQR_ABRRQ ((uint32_t)0x0001) /*!< Auto-Baud Rate Request */
  6815. #define USART_RQR_SBKRQ ((uint32_t)0x0002) /*!< Send Break Request */
  6816. #define USART_RQR_MMRQ ((uint32_t)0x0004) /*!< Mute Mode Request */
  6817. #define USART_RQR_RXFRQ ((uint32_t)0x0008) /*!< Receive Data flush Request */
  6818. #define USART_RQR_TXFRQ ((uint32_t)0x0010) /*!< Transmit data flush Request */
  6819. /******************* Bit definition for USART_ISR register ******************/
  6820. #define USART_ISR_PE ((uint32_t)0x00000001) /*!< Parity Error */
  6821. #define USART_ISR_FE ((uint32_t)0x00000002) /*!< Framing Error */
  6822. #define USART_ISR_NE ((uint32_t)0x00000004) /*!< Noise detected Flag */
  6823. #define USART_ISR_ORE ((uint32_t)0x00000008) /*!< OverRun Error */
  6824. #define USART_ISR_IDLE ((uint32_t)0x00000010) /*!< IDLE line detected */
  6825. #define USART_ISR_RXNE ((uint32_t)0x00000020) /*!< Read Data Register Not Empty */
  6826. #define USART_ISR_TC ((uint32_t)0x00000040) /*!< Transmission Complete */
  6827. #define USART_ISR_TXE ((uint32_t)0x00000080) /*!< Transmit Data Register Empty */
  6828. #define USART_ISR_LBD ((uint32_t)0x00000100) /*!< LIN Break Detection Flag */
  6829. #define USART_ISR_CTSIF ((uint32_t)0x00000200) /*!< CTS interrupt flag */
  6830. #define USART_ISR_CTS ((uint32_t)0x00000400) /*!< CTS flag */
  6831. #define USART_ISR_RTOF ((uint32_t)0x00000800) /*!< Receiver Time Out */
  6832. #define USART_ISR_EOBF ((uint32_t)0x00001000) /*!< End Of Block Flag */
  6833. #define USART_ISR_ABRE ((uint32_t)0x00004000) /*!< Auto-Baud Rate Error */
  6834. #define USART_ISR_ABRF ((uint32_t)0x00008000) /*!< Auto-Baud Rate Flag */
  6835. #define USART_ISR_BUSY ((uint32_t)0x00010000) /*!< Busy Flag */
  6836. #define USART_ISR_CMF ((uint32_t)0x00020000) /*!< Character Match Flag */
  6837. #define USART_ISR_SBKF ((uint32_t)0x00040000) /*!< Send Break Flag */
  6838. #define USART_ISR_RWU ((uint32_t)0x00080000) /*!< Receive Wake Up from mute mode Flag */
  6839. #define USART_ISR_WUF ((uint32_t)0x00100000) /*!< Wake Up from stop mode Flag */
  6840. #define USART_ISR_TEACK ((uint32_t)0x00200000) /*!< Transmit Enable Acknowledge Flag */
  6841. #define USART_ISR_REACK ((uint32_t)0x00400000) /*!< Receive Enable Acknowledge Flag */
  6842. /******************* Bit definition for USART_ICR register ******************/
  6843. #define USART_ICR_PECF ((uint32_t)0x00000001) /*!< Parity Error Clear Flag */
  6844. #define USART_ICR_FECF ((uint32_t)0x00000002) /*!< Framing Error Clear Flag */
  6845. #define USART_ICR_NCF ((uint32_t)0x00000004) /*!< Noise detected Clear Flag */
  6846. #define USART_ICR_ORECF ((uint32_t)0x00000008) /*!< OverRun Error Clear Flag */
  6847. #define USART_ICR_IDLECF ((uint32_t)0x00000010) /*!< IDLE line detected Clear Flag */
  6848. #define USART_ICR_TCCF ((uint32_t)0x00000040) /*!< Transmission Complete Clear Flag */
  6849. #define USART_ICR_LBDCF ((uint32_t)0x00000100) /*!< LIN Break Detection Clear Flag */
  6850. #define USART_ICR_CTSCF ((uint32_t)0x00000200) /*!< CTS Interrupt Clear Flag */
  6851. #define USART_ICR_RTOCF ((uint32_t)0x00000800) /*!< Receiver Time Out Clear Flag */
  6852. #define USART_ICR_EOBCF ((uint32_t)0x00001000) /*!< End Of Block Clear Flag */
  6853. #define USART_ICR_CMCF ((uint32_t)0x00020000) /*!< Character Match Clear Flag */
  6854. #define USART_ICR_WUCF ((uint32_t)0x00100000) /*!< Wake Up from stop mode Clear Flag */
  6855. /******************* Bit definition for USART_RDR register ******************/
  6856. #define USART_RDR_RDR ((uint32_t)0x01FF) /*!< RDR[8:0] bits (Receive Data value) */
  6857. /******************* Bit definition for USART_TDR register ******************/
  6858. #define USART_TDR_TDR ((uint32_t)0x01FF) /*!< TDR[8:0] bits (Transmit Data value) */
  6859. /******************************************************************************/
  6860. /* */
  6861. /* Window WATCHDOG */
  6862. /* */
  6863. /******************************************************************************/
  6864. /******************* Bit definition for WWDG_CR register ********************/
  6865. #define WWDG_CR_T ((uint32_t)0x7F) /*!<T[6:0] bits (7-Bit counter (MSB to LSB)) */
  6866. #define WWDG_CR_T0 ((uint32_t)0x01) /*!<Bit 0 */
  6867. #define WWDG_CR_T1 ((uint32_t)0x02) /*!<Bit 1 */
  6868. #define WWDG_CR_T2 ((uint32_t)0x04) /*!<Bit 2 */
  6869. #define WWDG_CR_T3 ((uint32_t)0x08) /*!<Bit 3 */
  6870. #define WWDG_CR_T4 ((uint32_t)0x10) /*!<Bit 4 */
  6871. #define WWDG_CR_T5 ((uint32_t)0x20) /*!<Bit 5 */
  6872. #define WWDG_CR_T6 ((uint32_t)0x40) /*!<Bit 6 */
  6873. #define WWDG_CR_WDGA ((uint32_t)0x80) /*!<Activation bit */
  6874. /******************* Bit definition for WWDG_CFR register *******************/
  6875. #define WWDG_CFR_W ((uint32_t)0x007F) /*!<W[6:0] bits (7-bit window value) */
  6876. #define WWDG_CFR_W0 ((uint32_t)0x0001) /*!<Bit 0 */
  6877. #define WWDG_CFR_W1 ((uint32_t)0x0002) /*!<Bit 1 */
  6878. #define WWDG_CFR_W2 ((uint32_t)0x0004) /*!<Bit 2 */
  6879. #define WWDG_CFR_W3 ((uint32_t)0x0008) /*!<Bit 3 */
  6880. #define WWDG_CFR_W4 ((uint32_t)0x0010) /*!<Bit 4 */
  6881. #define WWDG_CFR_W5 ((uint32_t)0x0020) /*!<Bit 5 */
  6882. #define WWDG_CFR_W6 ((uint32_t)0x0040) /*!<Bit 6 */
  6883. #define WWDG_CFR_WDGTB ((uint32_t)0x0180) /*!<WDGTB[1:0] bits (Timer Base) */
  6884. #define WWDG_CFR_WDGTB0 ((uint32_t)0x0080) /*!<Bit 0 */
  6885. #define WWDG_CFR_WDGTB1 ((uint32_t)0x0100) /*!<Bit 1 */
  6886. #define WWDG_CFR_EWI ((uint32_t)0x0200) /*!<Early Wakeup Interrupt */
  6887. /******************* Bit definition for WWDG_SR register ********************/
  6888. #define WWDG_SR_EWIF ((uint32_t)0x01) /*!<Early Wakeup Interrupt Flag */
  6889. /******************************************************************************/
  6890. /* */
  6891. /* DBG */
  6892. /* */
  6893. /******************************************************************************/
  6894. /******************** Bit definition for DBGMCU_IDCODE register *************/
  6895. #define DBGMCU_IDCODE_DEV_ID ((uint32_t)0x00000FFF)
  6896. #define DBGMCU_IDCODE_REV_ID ((uint32_t)0xFFFF0000)
  6897. /******************** Bit definition for DBGMCU_CR register *****************/
  6898. #define DBGMCU_CR_DBG_SLEEP ((uint32_t)0x00000001)
  6899. #define DBGMCU_CR_DBG_STOP ((uint32_t)0x00000002)
  6900. #define DBGMCU_CR_DBG_STANDBY ((uint32_t)0x00000004)
  6901. #define DBGMCU_CR_TRACE_IOEN ((uint32_t)0x00000020)
  6902. #define DBGMCU_CR_TRACE_MODE ((uint32_t)0x000000C0)
  6903. #define DBGMCU_CR_TRACE_MODE_0 ((uint32_t)0x00000040) /*!<Bit 0 */
  6904. #define DBGMCU_CR_TRACE_MODE_1 ((uint32_t)0x00000080) /*!<Bit 1 */
  6905. /******************** Bit definition for DBGMCU_APB1_FZ register ************/
  6906. #define DBGMCU_APB1_FZ_DBG_TIM2_STOP ((uint32_t)0x00000001)
  6907. #define DBGMCU_APB1_FZ_DBG_TIM3_STOP ((uint32_t)0x00000002)
  6908. #define DBGMCU_APB1_FZ_DBG_TIM4_STOP ((uint32_t)0x00000004)
  6909. #define DBGMCU_APB1_FZ_DBG_TIM5_STOP ((uint32_t)0x00000008)
  6910. #define DBGMCU_APB1_FZ_DBG_TIM6_STOP ((uint32_t)0x00000010)
  6911. #define DBGMCU_APB1_FZ_DBG_TIM7_STOP ((uint32_t)0x00000020)
  6912. #define DBGMCU_APB1_FZ_DBG_TIM12_STOP ((uint32_t)0x00000040)
  6913. #define DBGMCU_APB1_FZ_DBG_TIM13_STOP ((uint32_t)0x00000080)
  6914. #define DBGMCU_APB1_FZ_DBG_TIM14_STOP ((uint32_t)0x00000100)
  6915. #define DBGMCU_APB1_FZ_DBG_RTC_STOP ((uint32_t)0x00000400)
  6916. #define DBGMCU_APB1_FZ_DBG_WWDG_STOP ((uint32_t)0x00000800)
  6917. #define DBGMCU_APB1_FZ_DBG_IWDG_STOP ((uint32_t)0x00001000)
  6918. #define DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT ((uint32_t)0x00200000)
  6919. #define DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT ((uint32_t)0x00400000)
  6920. #define DBGMCU_APB1_FZ_DBG_I2C3_SMBUS_TIMEOUT ((uint32_t)0x00800000)
  6921. #define DBGMCU_APB1_FZ_DBG_CAN1_STOP ((uint32_t)0x02000000)
  6922. #define DBGMCU_APB1_FZ_DBG_CAN2_STOP ((uint32_t)0x04000000)
  6923. /******************** Bit definition for DBGMCU_APB2_FZ register ************/
  6924. #define DBGMCU_APB1_FZ_DBG_TIM1_STOP ((uint32_t)0x00000001)
  6925. #define DBGMCU_APB1_FZ_DBG_TIM8_STOP ((uint32_t)0x00000002)
  6926. #define DBGMCU_APB1_FZ_DBG_TIM9_STOP ((uint32_t)0x00010000)
  6927. #define DBGMCU_APB1_FZ_DBG_TIM10_STOP ((uint32_t)0x00020000)
  6928. #define DBGMCU_APB1_FZ_DBG_TIM11_STOP ((uint32_t)0x00040000)
  6929. /******************************************************************************/
  6930. /* */
  6931. /* Ethernet MAC Registers bits definitions */
  6932. /* */
  6933. /******************************************************************************/
  6934. /* Bit definition for Ethernet MAC Control Register register */
  6935. #define ETH_MACCR_WD ((uint32_t)0x00800000) /* Watchdog disable */
  6936. #define ETH_MACCR_JD ((uint32_t)0x00400000) /* Jabber disable */
  6937. #define ETH_MACCR_IFG ((uint32_t)0x000E0000) /* Inter-frame gap */
  6938. #define ETH_MACCR_IFG_96Bit ((uint32_t)0x00000000) /* Minimum IFG between frames during transmission is 96Bit */
  6939. #define ETH_MACCR_IFG_88Bit ((uint32_t)0x00020000) /* Minimum IFG between frames during transmission is 88Bit */
  6940. #define ETH_MACCR_IFG_80Bit ((uint32_t)0x00040000) /* Minimum IFG between frames during transmission is 80Bit */
  6941. #define ETH_MACCR_IFG_72Bit ((uint32_t)0x00060000) /* Minimum IFG between frames during transmission is 72Bit */
  6942. #define ETH_MACCR_IFG_64Bit ((uint32_t)0x00080000) /* Minimum IFG between frames during transmission is 64Bit */
  6943. #define ETH_MACCR_IFG_56Bit ((uint32_t)0x000A0000) /* Minimum IFG between frames during transmission is 56Bit */
  6944. #define ETH_MACCR_IFG_48Bit ((uint32_t)0x000C0000) /* Minimum IFG between frames during transmission is 48Bit */
  6945. #define ETH_MACCR_IFG_40Bit ((uint32_t)0x000E0000) /* Minimum IFG between frames during transmission is 40Bit */
  6946. #define ETH_MACCR_CSD ((uint32_t)0x00010000) /* Carrier sense disable (during transmission) */
  6947. #define ETH_MACCR_FES ((uint32_t)0x00004000) /* Fast ethernet speed */
  6948. #define ETH_MACCR_ROD ((uint32_t)0x00002000) /* Receive own disable */
  6949. #define ETH_MACCR_LM ((uint32_t)0x00001000) /* loopback mode */
  6950. #define ETH_MACCR_DM ((uint32_t)0x00000800) /* Duplex mode */
  6951. #define ETH_MACCR_IPCO ((uint32_t)0x00000400) /* IP Checksum offload */
  6952. #define ETH_MACCR_RD ((uint32_t)0x00000200) /* Retry disable */
  6953. #define ETH_MACCR_APCS ((uint32_t)0x00000080) /* Automatic Pad/CRC stripping */
  6954. #define ETH_MACCR_BL ((uint32_t)0x00000060) /* Back-off limit: random integer number (r) of slot time delays before rescheduling
  6955. a transmission attempt during retries after a collision: 0 =< r <2^k */
  6956. #define ETH_MACCR_BL_10 ((uint32_t)0x00000000) /* k = min (n, 10) */
  6957. #define ETH_MACCR_BL_8 ((uint32_t)0x00000020) /* k = min (n, 8) */
  6958. #define ETH_MACCR_BL_4 ((uint32_t)0x00000040) /* k = min (n, 4) */
  6959. #define ETH_MACCR_BL_1 ((uint32_t)0x00000060) /* k = min (n, 1) */
  6960. #define ETH_MACCR_DC ((uint32_t)0x00000010) /* Defferal check */
  6961. #define ETH_MACCR_TE ((uint32_t)0x00000008) /* Transmitter enable */
  6962. #define ETH_MACCR_RE ((uint32_t)0x00000004) /* Receiver enable */
  6963. /* Bit definition for Ethernet MAC Frame Filter Register */
  6964. #define ETH_MACFFR_RA ((uint32_t)0x80000000) /* Receive all */
  6965. #define ETH_MACFFR_HPF ((uint32_t)0x00000400) /* Hash or perfect filter */
  6966. #define ETH_MACFFR_SAF ((uint32_t)0x00000200) /* Source address filter enable */
  6967. #define ETH_MACFFR_SAIF ((uint32_t)0x00000100) /* SA inverse filtering */
  6968. #define ETH_MACFFR_PCF ((uint32_t)0x000000C0) /* Pass control frames: 3 cases */
  6969. #define ETH_MACFFR_PCF_BlockAll ((uint32_t)0x00000040) /* MAC filters all control frames from reaching the application */
  6970. #define ETH_MACFFR_PCF_ForwardAll ((uint32_t)0x00000080) /* MAC forwards all control frames to application even if they fail the Address Filter */
  6971. #define ETH_MACFFR_PCF_ForwardPassedAddrFilter ((uint32_t)0x000000C0) /* MAC forwards control frames that pass the Address Filter. */
  6972. #define ETH_MACFFR_BFD ((uint32_t)0x00000020) /* Broadcast frame disable */
  6973. #define ETH_MACFFR_PAM ((uint32_t)0x00000010) /* Pass all mutlicast */
  6974. #define ETH_MACFFR_DAIF ((uint32_t)0x00000008) /* DA Inverse filtering */
  6975. #define ETH_MACFFR_HM ((uint32_t)0x00000004) /* Hash multicast */
  6976. #define ETH_MACFFR_HU ((uint32_t)0x00000002) /* Hash unicast */
  6977. #define ETH_MACFFR_PM ((uint32_t)0x00000001) /* Promiscuous mode */
  6978. /* Bit definition for Ethernet MAC Hash Table High Register */
  6979. #define ETH_MACHTHR_HTH ((uint32_t)0xFFFFFFFF) /* Hash table high */
  6980. /* Bit definition for Ethernet MAC Hash Table Low Register */
  6981. #define ETH_MACHTLR_HTL ((uint32_t)0xFFFFFFFF) /* Hash table low */
  6982. /* Bit definition for Ethernet MAC MII Address Register */
  6983. #define ETH_MACMIIAR_PA ((uint32_t)0x0000F800) /* Physical layer address */
  6984. #define ETH_MACMIIAR_MR ((uint32_t)0x000007C0) /* MII register in the selected PHY */
  6985. #define ETH_MACMIIAR_CR ((uint32_t)0x0000001C) /* CR clock range: 6 cases */
  6986. #define ETH_MACMIIAR_CR_Div42 ((uint32_t)0x00000000) /* HCLK:60-100 MHz; MDC clock= HCLK/42 */
  6987. #define ETH_MACMIIAR_CR_Div62 ((uint32_t)0x00000004) /* HCLK:100-150 MHz; MDC clock= HCLK/62 */
  6988. #define ETH_MACMIIAR_CR_Div16 ((uint32_t)0x00000008) /* HCLK:20-35 MHz; MDC clock= HCLK/16 */
  6989. #define ETH_MACMIIAR_CR_Div26 ((uint32_t)0x0000000C) /* HCLK:35-60 MHz; MDC clock= HCLK/26 */
  6990. #define ETH_MACMIIAR_CR_Div102 ((uint32_t)0x00000010) /* HCLK:150-168 MHz; MDC clock= HCLK/102 */
  6991. #define ETH_MACMIIAR_MW ((uint32_t)0x00000002) /* MII write */
  6992. #define ETH_MACMIIAR_MB ((uint32_t)0x00000001) /* MII busy */
  6993. /* Bit definition for Ethernet MAC MII Data Register */
  6994. #define ETH_MACMIIDR_MD ((uint32_t)0x0000FFFF) /* MII data: read/write data from/to PHY */
  6995. /* Bit definition for Ethernet MAC Flow Control Register */
  6996. #define ETH_MACFCR_PT ((uint32_t)0xFFFF0000) /* Pause time */
  6997. #define ETH_MACFCR_ZQPD ((uint32_t)0x00000080) /* Zero-quanta pause disable */
  6998. #define ETH_MACFCR_PLT ((uint32_t)0x00000030) /* Pause low threshold: 4 cases */
  6999. #define ETH_MACFCR_PLT_Minus4 ((uint32_t)0x00000000) /* Pause time minus 4 slot times */
  7000. #define ETH_MACFCR_PLT_Minus28 ((uint32_t)0x00000010) /* Pause time minus 28 slot times */
  7001. #define ETH_MACFCR_PLT_Minus144 ((uint32_t)0x00000020) /* Pause time minus 144 slot times */
  7002. #define ETH_MACFCR_PLT_Minus256 ((uint32_t)0x00000030) /* Pause time minus 256 slot times */
  7003. #define ETH_MACFCR_UPFD ((uint32_t)0x00000008) /* Unicast pause frame detect */
  7004. #define ETH_MACFCR_RFCE ((uint32_t)0x00000004) /* Receive flow control enable */
  7005. #define ETH_MACFCR_TFCE ((uint32_t)0x00000002) /* Transmit flow control enable */
  7006. #define ETH_MACFCR_FCBBPA ((uint32_t)0x00000001) /* Flow control busy/backpressure activate */
  7007. /* Bit definition for Ethernet MAC VLAN Tag Register */
  7008. #define ETH_MACVLANTR_VLANTC ((uint32_t)0x00010000) /* 12-bit VLAN tag comparison */
  7009. #define ETH_MACVLANTR_VLANTI ((uint32_t)0x0000FFFF) /* VLAN tag identifier (for receive frames) */
  7010. /* Bit definition for Ethernet MAC Remote Wake-UpFrame Filter Register */
  7011. #define ETH_MACRWUFFR_D ((uint32_t)0xFFFFFFFF) /* Wake-up frame filter register data */
  7012. /* Eight sequential Writes to this address (offset 0x28) will write all Wake-UpFrame Filter Registers.
  7013. Eight sequential Reads from this address (offset 0x28) will read all Wake-UpFrame Filter Registers. */
  7014. /* Wake-UpFrame Filter Reg0 : Filter 0 Byte Mask
  7015. Wake-UpFrame Filter Reg1 : Filter 1 Byte Mask
  7016. Wake-UpFrame Filter Reg2 : Filter 2 Byte Mask
  7017. Wake-UpFrame Filter Reg3 : Filter 3 Byte Mask
  7018. Wake-UpFrame Filter Reg4 : RSVD - Filter3 Command - RSVD - Filter2 Command -
  7019. RSVD - Filter1 Command - RSVD - Filter0 Command
  7020. Wake-UpFrame Filter Re5 : Filter3 Offset - Filter2 Offset - Filter1 Offset - Filter0 Offset
  7021. Wake-UpFrame Filter Re6 : Filter1 CRC16 - Filter0 CRC16
  7022. Wake-UpFrame Filter Re7 : Filter3 CRC16 - Filter2 CRC16 */
  7023. /* Bit definition for Ethernet MAC PMT Control and Status Register */
  7024. #define ETH_MACPMTCSR_WFFRPR ((uint32_t)0x80000000) /* Wake-Up Frame Filter Register Pointer Reset */
  7025. #define ETH_MACPMTCSR_GU ((uint32_t)0x00000200) /* Global Unicast */
  7026. #define ETH_MACPMTCSR_WFR ((uint32_t)0x00000040) /* Wake-Up Frame Received */
  7027. #define ETH_MACPMTCSR_MPR ((uint32_t)0x00000020) /* Magic Packet Received */
  7028. #define ETH_MACPMTCSR_WFE ((uint32_t)0x00000004) /* Wake-Up Frame Enable */
  7029. #define ETH_MACPMTCSR_MPE ((uint32_t)0x00000002) /* Magic Packet Enable */
  7030. #define ETH_MACPMTCSR_PD ((uint32_t)0x00000001) /* Power Down */
  7031. /* Bit definition for Ethernet MAC Status Register */
  7032. #define ETH_MACSR_TSTS ((uint32_t)0x00000200) /* Time stamp trigger status */
  7033. #define ETH_MACSR_MMCTS ((uint32_t)0x00000040) /* MMC transmit status */
  7034. #define ETH_MACSR_MMMCRS ((uint32_t)0x00000020) /* MMC receive status */
  7035. #define ETH_MACSR_MMCS ((uint32_t)0x00000010) /* MMC status */
  7036. #define ETH_MACSR_PMTS ((uint32_t)0x00000008) /* PMT status */
  7037. /* Bit definition for Ethernet MAC Interrupt Mask Register */
  7038. #define ETH_MACIMR_TSTIM ((uint32_t)0x00000200) /* Time stamp trigger interrupt mask */
  7039. #define ETH_MACIMR_PMTIM ((uint32_t)0x00000008) /* PMT interrupt mask */
  7040. /* Bit definition for Ethernet MAC Address0 High Register */
  7041. #define ETH_MACA0HR_MACA0H ((uint32_t)0x0000FFFF) /* MAC address0 high */
  7042. /* Bit definition for Ethernet MAC Address0 Low Register */
  7043. #define ETH_MACA0LR_MACA0L ((uint32_t)0xFFFFFFFF) /* MAC address0 low */
  7044. /* Bit definition for Ethernet MAC Address1 High Register */
  7045. #define ETH_MACA1HR_AE ((uint32_t)0x80000000) /* Address enable */
  7046. #define ETH_MACA1HR_SA ((uint32_t)0x40000000) /* Source address */
  7047. #define ETH_MACA1HR_MBC ((uint32_t)0x3F000000) /* Mask byte control: bits to mask for comparison of the MAC Address bytes */
  7048. #define ETH_MACA1HR_MBC_HBits15_8 ((uint32_t)0x20000000) /* Mask MAC Address high reg bits [15:8] */
  7049. #define ETH_MACA1HR_MBC_HBits7_0 ((uint32_t)0x10000000) /* Mask MAC Address high reg bits [7:0] */
  7050. #define ETH_MACA1HR_MBC_LBits31_24 ((uint32_t)0x08000000) /* Mask MAC Address low reg bits [31:24] */
  7051. #define ETH_MACA1HR_MBC_LBits23_16 ((uint32_t)0x04000000) /* Mask MAC Address low reg bits [23:16] */
  7052. #define ETH_MACA1HR_MBC_LBits15_8 ((uint32_t)0x02000000) /* Mask MAC Address low reg bits [15:8] */
  7053. #define ETH_MACA1HR_MBC_LBits7_0 ((uint32_t)0x01000000) /* Mask MAC Address low reg bits [7:0] */
  7054. #define ETH_MACA1HR_MACA1H ((uint32_t)0x0000FFFF) /* MAC address1 high */
  7055. /* Bit definition for Ethernet MAC Address1 Low Register */
  7056. #define ETH_MACA1LR_MACA1L ((uint32_t)0xFFFFFFFF) /* MAC address1 low */
  7057. /* Bit definition for Ethernet MAC Address2 High Register */
  7058. #define ETH_MACA2HR_AE ((uint32_t)0x80000000) /* Address enable */
  7059. #define ETH_MACA2HR_SA ((uint32_t)0x40000000) /* Source address */
  7060. #define ETH_MACA2HR_MBC ((uint32_t)0x3F000000) /* Mask byte control */
  7061. #define ETH_MACA2HR_MBC_HBits15_8 ((uint32_t)0x20000000) /* Mask MAC Address high reg bits [15:8] */
  7062. #define ETH_MACA2HR_MBC_HBits7_0 ((uint32_t)0x10000000) /* Mask MAC Address high reg bits [7:0] */
  7063. #define ETH_MACA2HR_MBC_LBits31_24 ((uint32_t)0x08000000) /* Mask MAC Address low reg bits [31:24] */
  7064. #define ETH_MACA2HR_MBC_LBits23_16 ((uint32_t)0x04000000) /* Mask MAC Address low reg bits [23:16] */
  7065. #define ETH_MACA2HR_MBC_LBits15_8 ((uint32_t)0x02000000) /* Mask MAC Address low reg bits [15:8] */
  7066. #define ETH_MACA2HR_MBC_LBits7_0 ((uint32_t)0x01000000) /* Mask MAC Address low reg bits [70] */
  7067. #define ETH_MACA2HR_MACA2H ((uint32_t)0x0000FFFF) /* MAC address1 high */
  7068. /* Bit definition for Ethernet MAC Address2 Low Register */
  7069. #define ETH_MACA2LR_MACA2L ((uint32_t)0xFFFFFFFF) /* MAC address2 low */
  7070. /* Bit definition for Ethernet MAC Address3 High Register */
  7071. #define ETH_MACA3HR_AE ((uint32_t)0x80000000) /* Address enable */
  7072. #define ETH_MACA3HR_SA ((uint32_t)0x40000000) /* Source address */
  7073. #define ETH_MACA3HR_MBC ((uint32_t)0x3F000000) /* Mask byte control */
  7074. #define ETH_MACA3HR_MBC_HBits15_8 ((uint32_t)0x20000000) /* Mask MAC Address high reg bits [15:8] */
  7075. #define ETH_MACA3HR_MBC_HBits7_0 ((uint32_t)0x10000000) /* Mask MAC Address high reg bits [7:0] */
  7076. #define ETH_MACA3HR_MBC_LBits31_24 ((uint32_t)0x08000000) /* Mask MAC Address low reg bits [31:24] */
  7077. #define ETH_MACA3HR_MBC_LBits23_16 ((uint32_t)0x04000000) /* Mask MAC Address low reg bits [23:16] */
  7078. #define ETH_MACA3HR_MBC_LBits15_8 ((uint32_t)0x02000000) /* Mask MAC Address low reg bits [15:8] */
  7079. #define ETH_MACA3HR_MBC_LBits7_0 ((uint32_t)0x01000000) /* Mask MAC Address low reg bits [70] */
  7080. #define ETH_MACA3HR_MACA3H ((uint32_t)0x0000FFFF) /* MAC address3 high */
  7081. /* Bit definition for Ethernet MAC Address3 Low Register */
  7082. #define ETH_MACA3LR_MACA3L ((uint32_t)0xFFFFFFFF) /* MAC address3 low */
  7083. /******************************************************************************/
  7084. /* Ethernet MMC Registers bits definition */
  7085. /******************************************************************************/
  7086. /* Bit definition for Ethernet MMC Contol Register */
  7087. #define ETH_MMCCR_MCFHP ((uint32_t)0x00000020) /* MMC counter Full-Half preset */
  7088. #define ETH_MMCCR_MCP ((uint32_t)0x00000010) /* MMC counter preset */
  7089. #define ETH_MMCCR_MCF ((uint32_t)0x00000008) /* MMC Counter Freeze */
  7090. #define ETH_MMCCR_ROR ((uint32_t)0x00000004) /* Reset on Read */
  7091. #define ETH_MMCCR_CSR ((uint32_t)0x00000002) /* Counter Stop Rollover */
  7092. #define ETH_MMCCR_CR ((uint32_t)0x00000001) /* Counters Reset */
  7093. /* Bit definition for Ethernet MMC Receive Interrupt Register */
  7094. #define ETH_MMCRIR_RGUFS ((uint32_t)0x00020000) /* Set when Rx good unicast frames counter reaches half the maximum value */
  7095. #define ETH_MMCRIR_RFAES ((uint32_t)0x00000040) /* Set when Rx alignment error counter reaches half the maximum value */
  7096. #define ETH_MMCRIR_RFCES ((uint32_t)0x00000020) /* Set when Rx crc error counter reaches half the maximum value */
  7097. /* Bit definition for Ethernet MMC Transmit Interrupt Register */
  7098. #define ETH_MMCTIR_TGFS ((uint32_t)0x00200000) /* Set when Tx good frame count counter reaches half the maximum value */
  7099. #define ETH_MMCTIR_TGFMSCS ((uint32_t)0x00008000) /* Set when Tx good multi col counter reaches half the maximum value */
  7100. #define ETH_MMCTIR_TGFSCS ((uint32_t)0x00004000) /* Set when Tx good single col counter reaches half the maximum value */
  7101. /* Bit definition for Ethernet MMC Receive Interrupt Mask Register */
  7102. #define ETH_MMCRIMR_RGUFM ((uint32_t)0x00020000) /* Mask the interrupt when Rx good unicast frames counter reaches half the maximum value */
  7103. #define ETH_MMCRIMR_RFAEM ((uint32_t)0x00000040) /* Mask the interrupt when when Rx alignment error counter reaches half the maximum value */
  7104. #define ETH_MMCRIMR_RFCEM ((uint32_t)0x00000020) /* Mask the interrupt when Rx crc error counter reaches half the maximum value */
  7105. /* Bit definition for Ethernet MMC Transmit Interrupt Mask Register */
  7106. #define ETH_MMCTIMR_TGFM ((uint32_t)0x00200000) /* Mask the interrupt when Tx good frame count counter reaches half the maximum value */
  7107. #define ETH_MMCTIMR_TGFMSCM ((uint32_t)0x00008000) /* Mask the interrupt when Tx good multi col counter reaches half the maximum value */
  7108. #define ETH_MMCTIMR_TGFSCM ((uint32_t)0x00004000) /* Mask the interrupt when Tx good single col counter reaches half the maximum value */
  7109. /* Bit definition for Ethernet MMC Transmitted Good Frames after Single Collision Counter Register */
  7110. #define ETH_MMCTGFSCCR_TGFSCC ((uint32_t)0xFFFFFFFF) /* Number of successfully transmitted frames after a single collision in Half-duplex mode. */
  7111. /* Bit definition for Ethernet MMC Transmitted Good Frames after More than a Single Collision Counter Register */
  7112. #define ETH_MMCTGFMSCCR_TGFMSCC ((uint32_t)0xFFFFFFFF) /* Number of successfully transmitted frames after more than a single collision in Half-duplex mode. */
  7113. /* Bit definition for Ethernet MMC Transmitted Good Frames Counter Register */
  7114. #define ETH_MMCTGFCR_TGFC ((uint32_t)0xFFFFFFFF) /* Number of good frames transmitted. */
  7115. /* Bit definition for Ethernet MMC Received Frames with CRC Error Counter Register */
  7116. #define ETH_MMCRFCECR_RFCEC ((uint32_t)0xFFFFFFFF) /* Number of frames received with CRC error. */
  7117. /* Bit definition for Ethernet MMC Received Frames with Alignement Error Counter Register */
  7118. #define ETH_MMCRFAECR_RFAEC ((uint32_t)0xFFFFFFFF) /* Number of frames received with alignment (dribble) error */
  7119. /* Bit definition for Ethernet MMC Received Good Unicast Frames Counter Register */
  7120. #define ETH_MMCRGUFCR_RGUFC ((uint32_t)0xFFFFFFFF) /* Number of good unicast frames received. */
  7121. /******************************************************************************/
  7122. /* Ethernet PTP Registers bits definition */
  7123. /******************************************************************************/
  7124. /* Bit definition for Ethernet PTP Time Stamp Contol Register */
  7125. #define ETH_PTPTSCR_TSCNT ((uint32_t)0x00030000) /* Time stamp clock node type */
  7126. #define ETH_PTPTSSR_TSSMRME ((uint32_t)0x00008000) /* Time stamp snapshot for message relevant to master enable */
  7127. #define ETH_PTPTSSR_TSSEME ((uint32_t)0x00004000) /* Time stamp snapshot for event message enable */
  7128. #define ETH_PTPTSSR_TSSIPV4FE ((uint32_t)0x00002000) /* Time stamp snapshot for IPv4 frames enable */
  7129. #define ETH_PTPTSSR_TSSIPV6FE ((uint32_t)0x00001000) /* Time stamp snapshot for IPv6 frames enable */
  7130. #define ETH_PTPTSSR_TSSPTPOEFE ((uint32_t)0x00000800) /* Time stamp snapshot for PTP over ethernet frames enable */
  7131. #define ETH_PTPTSSR_TSPTPPSV2E ((uint32_t)0x00000400) /* Time stamp PTP packet snooping for version2 format enable */
  7132. #define ETH_PTPTSSR_TSSSR ((uint32_t)0x00000200) /* Time stamp Sub-seconds rollover */
  7133. #define ETH_PTPTSSR_TSSARFE ((uint32_t)0x00000100) /* Time stamp snapshot for all received frames enable */
  7134. #define ETH_PTPTSCR_TSARU ((uint32_t)0x00000020) /* Addend register update */
  7135. #define ETH_PTPTSCR_TSITE ((uint32_t)0x00000010) /* Time stamp interrupt trigger enable */
  7136. #define ETH_PTPTSCR_TSSTU ((uint32_t)0x00000008) /* Time stamp update */
  7137. #define ETH_PTPTSCR_TSSTI ((uint32_t)0x00000004) /* Time stamp initialize */
  7138. #define ETH_PTPTSCR_TSFCU ((uint32_t)0x00000002) /* Time stamp fine or coarse update */
  7139. #define ETH_PTPTSCR_TSE ((uint32_t)0x00000001) /* Time stamp enable */
  7140. /* Bit definition for Ethernet PTP Sub-Second Increment Register */
  7141. #define ETH_PTPSSIR_STSSI ((uint32_t)0x000000FF) /* System time Sub-second increment value */
  7142. /* Bit definition for Ethernet PTP Time Stamp High Register */
  7143. #define ETH_PTPTSHR_STS ((uint32_t)0xFFFFFFFF) /* System Time second */
  7144. /* Bit definition for Ethernet PTP Time Stamp Low Register */
  7145. #define ETH_PTPTSLR_STPNS ((uint32_t)0x80000000) /* System Time Positive or negative time */
  7146. #define ETH_PTPTSLR_STSS ((uint32_t)0x7FFFFFFF) /* System Time sub-seconds */
  7147. /* Bit definition for Ethernet PTP Time Stamp High Update Register */
  7148. #define ETH_PTPTSHUR_TSUS ((uint32_t)0xFFFFFFFF) /* Time stamp update seconds */
  7149. /* Bit definition for Ethernet PTP Time Stamp Low Update Register */
  7150. #define ETH_PTPTSLUR_TSUPNS ((uint32_t)0x80000000) /* Time stamp update Positive or negative time */
  7151. #define ETH_PTPTSLUR_TSUSS ((uint32_t)0x7FFFFFFF) /* Time stamp update sub-seconds */
  7152. /* Bit definition for Ethernet PTP Time Stamp Addend Register */
  7153. #define ETH_PTPTSAR_TSA ((uint32_t)0xFFFFFFFF) /* Time stamp addend */
  7154. /* Bit definition for Ethernet PTP Target Time High Register */
  7155. #define ETH_PTPTTHR_TTSH ((uint32_t)0xFFFFFFFF) /* Target time stamp high */
  7156. /* Bit definition for Ethernet PTP Target Time Low Register */
  7157. #define ETH_PTPTTLR_TTSL ((uint32_t)0xFFFFFFFF) /* Target time stamp low */
  7158. /* Bit definition for Ethernet PTP Time Stamp Status Register */
  7159. #define ETH_PTPTSSR_TSTTR ((uint32_t)0x00000020) /* Time stamp target time reached */
  7160. #define ETH_PTPTSSR_TSSO ((uint32_t)0x00000010) /* Time stamp seconds overflow */
  7161. /******************************************************************************/
  7162. /* Ethernet DMA Registers bits definition */
  7163. /******************************************************************************/
  7164. /* Bit definition for Ethernet DMA Bus Mode Register */
  7165. #define ETH_DMABMR_AAB ((uint32_t)0x02000000) /* Address-Aligned beats */
  7166. #define ETH_DMABMR_FPM ((uint32_t)0x01000000) /* 4xPBL mode */
  7167. #define ETH_DMABMR_USP ((uint32_t)0x00800000) /* Use separate PBL */
  7168. #define ETH_DMABMR_RDP ((uint32_t)0x007E0000) /* RxDMA PBL */
  7169. #define ETH_DMABMR_RDP_1Beat ((uint32_t)0x00020000) /* maximum number of beats to be transferred in one RxDMA transaction is 1 */
  7170. #define ETH_DMABMR_RDP_2Beat ((uint32_t)0x00040000) /* maximum number of beats to be transferred in one RxDMA transaction is 2 */
  7171. #define ETH_DMABMR_RDP_4Beat ((uint32_t)0x00080000) /* maximum number of beats to be transferred in one RxDMA transaction is 4 */
  7172. #define ETH_DMABMR_RDP_8Beat ((uint32_t)0x00100000) /* maximum number of beats to be transferred in one RxDMA transaction is 8 */
  7173. #define ETH_DMABMR_RDP_16Beat ((uint32_t)0x00200000) /* maximum number of beats to be transferred in one RxDMA transaction is 16 */
  7174. #define ETH_DMABMR_RDP_32Beat ((uint32_t)0x00400000) /* maximum number of beats to be transferred in one RxDMA transaction is 32 */
  7175. #define ETH_DMABMR_RDP_4xPBL_4Beat ((uint32_t)0x01020000) /* maximum number of beats to be transferred in one RxDMA transaction is 4 */
  7176. #define ETH_DMABMR_RDP_4xPBL_8Beat ((uint32_t)0x01040000) /* maximum number of beats to be transferred in one RxDMA transaction is 8 */
  7177. #define ETH_DMABMR_RDP_4xPBL_16Beat ((uint32_t)0x01080000) /* maximum number of beats to be transferred in one RxDMA transaction is 16 */
  7178. #define ETH_DMABMR_RDP_4xPBL_32Beat ((uint32_t)0x01100000) /* maximum number of beats to be transferred in one RxDMA transaction is 32 */
  7179. #define ETH_DMABMR_RDP_4xPBL_64Beat ((uint32_t)0x01200000) /* maximum number of beats to be transferred in one RxDMA transaction is 64 */
  7180. #define ETH_DMABMR_RDP_4xPBL_128Beat ((uint32_t)0x01400000) /* maximum number of beats to be transferred in one RxDMA transaction is 128 */
  7181. #define ETH_DMABMR_FB ((uint32_t)0x00010000) /* Fixed Burst */
  7182. #define ETH_DMABMR_RTPR ((uint32_t)0x0000C000) /* Rx Tx priority ratio */
  7183. #define ETH_DMABMR_RTPR_1_1 ((uint32_t)0x00000000) /* Rx Tx priority ratio */
  7184. #define ETH_DMABMR_RTPR_2_1 ((uint32_t)0x00004000) /* Rx Tx priority ratio */
  7185. #define ETH_DMABMR_RTPR_3_1 ((uint32_t)0x00008000) /* Rx Tx priority ratio */
  7186. #define ETH_DMABMR_RTPR_4_1 ((uint32_t)0x0000C000) /* Rx Tx priority ratio */
  7187. #define ETH_DMABMR_PBL ((uint32_t)0x00003F00) /* Programmable burst length */
  7188. #define ETH_DMABMR_PBL_1Beat ((uint32_t)0x00000100) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 1 */
  7189. #define ETH_DMABMR_PBL_2Beat ((uint32_t)0x00000200) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 2 */
  7190. #define ETH_DMABMR_PBL_4Beat ((uint32_t)0x00000400) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 4 */
  7191. #define ETH_DMABMR_PBL_8Beat ((uint32_t)0x00000800) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 8 */
  7192. #define ETH_DMABMR_PBL_16Beat ((uint32_t)0x00001000) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 16 */
  7193. #define ETH_DMABMR_PBL_32Beat ((uint32_t)0x00002000) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 32 */
  7194. #define ETH_DMABMR_PBL_4xPBL_4Beat ((uint32_t)0x01000100) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 4 */
  7195. #define ETH_DMABMR_PBL_4xPBL_8Beat ((uint32_t)0x01000200) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 8 */
  7196. #define ETH_DMABMR_PBL_4xPBL_16Beat ((uint32_t)0x01000400) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 16 */
  7197. #define ETH_DMABMR_PBL_4xPBL_32Beat ((uint32_t)0x01000800) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 32 */
  7198. #define ETH_DMABMR_PBL_4xPBL_64Beat ((uint32_t)0x01001000) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 64 */
  7199. #define ETH_DMABMR_PBL_4xPBL_128Beat ((uint32_t)0x01002000) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 128 */
  7200. #define ETH_DMABMR_EDE ((uint32_t)0x00000080) /* Enhanced Descriptor Enable */
  7201. #define ETH_DMABMR_DSL ((uint32_t)0x0000007C) /* Descriptor Skip Length */
  7202. #define ETH_DMABMR_DA ((uint32_t)0x00000002) /* DMA arbitration scheme */
  7203. #define ETH_DMABMR_SR ((uint32_t)0x00000001) /* Software reset */
  7204. /* Bit definition for Ethernet DMA Transmit Poll Demand Register */
  7205. #define ETH_DMATPDR_TPD ((uint32_t)0xFFFFFFFF) /* Transmit poll demand */
  7206. /* Bit definition for Ethernet DMA Receive Poll Demand Register */
  7207. #define ETH_DMARPDR_RPD ((uint32_t)0xFFFFFFFF) /* Receive poll demand */
  7208. /* Bit definition for Ethernet DMA Receive Descriptor List Address Register */
  7209. #define ETH_DMARDLAR_SRL ((uint32_t)0xFFFFFFFF) /* Start of receive list */
  7210. /* Bit definition for Ethernet DMA Transmit Descriptor List Address Register */
  7211. #define ETH_DMATDLAR_STL ((uint32_t)0xFFFFFFFF) /* Start of transmit list */
  7212. /* Bit definition for Ethernet DMA Status Register */
  7213. #define ETH_DMASR_TSTS ((uint32_t)0x20000000) /* Time-stamp trigger status */
  7214. #define ETH_DMASR_PMTS ((uint32_t)0x10000000) /* PMT status */
  7215. #define ETH_DMASR_MMCS ((uint32_t)0x08000000) /* MMC status */
  7216. #define ETH_DMASR_EBS ((uint32_t)0x03800000) /* Error bits status */
  7217. /* combination with EBS[2:0] for GetFlagStatus function */
  7218. #define ETH_DMASR_EBS_DescAccess ((uint32_t)0x02000000) /* Error bits 0-data buffer, 1-desc. access */
  7219. #define ETH_DMASR_EBS_ReadTransf ((uint32_t)0x01000000) /* Error bits 0-write trnsf, 1-read transfr */
  7220. #define ETH_DMASR_EBS_DataTransfTx ((uint32_t)0x00800000) /* Error bits 0-Rx DMA, 1-Tx DMA */
  7221. #define ETH_DMASR_TPS ((uint32_t)0x00700000) /* Transmit process state */
  7222. #define ETH_DMASR_TPS_Stopped ((uint32_t)0x00000000) /* Stopped - Reset or Stop Tx Command issued */
  7223. #define ETH_DMASR_TPS_Fetching ((uint32_t)0x00100000) /* Running - fetching the Tx descriptor */
  7224. #define ETH_DMASR_TPS_Waiting ((uint32_t)0x00200000) /* Running - waiting for status */
  7225. #define ETH_DMASR_TPS_Reading ((uint32_t)0x00300000) /* Running - reading the data from host memory */
  7226. #define ETH_DMASR_TPS_Suspended ((uint32_t)0x00600000) /* Suspended - Tx Descriptor unavailabe */
  7227. #define ETH_DMASR_TPS_Closing ((uint32_t)0x00700000) /* Running - closing Rx descriptor */
  7228. #define ETH_DMASR_RPS ((uint32_t)0x000E0000) /* Receive process state */
  7229. #define ETH_DMASR_RPS_Stopped ((uint32_t)0x00000000) /* Stopped - Reset or Stop Rx Command issued */
  7230. #define ETH_DMASR_RPS_Fetching ((uint32_t)0x00020000) /* Running - fetching the Rx descriptor */
  7231. #define ETH_DMASR_RPS_Waiting ((uint32_t)0x00060000) /* Running - waiting for packet */
  7232. #define ETH_DMASR_RPS_Suspended ((uint32_t)0x00080000) /* Suspended - Rx Descriptor unavailable */
  7233. #define ETH_DMASR_RPS_Closing ((uint32_t)0x000A0000) /* Running - closing descriptor */
  7234. #define ETH_DMASR_RPS_Queuing ((uint32_t)0x000E0000) /* Running - queuing the recieve frame into host memory */
  7235. #define ETH_DMASR_NIS ((uint32_t)0x00010000) /* Normal interrupt summary */
  7236. #define ETH_DMASR_AIS ((uint32_t)0x00008000) /* Abnormal interrupt summary */
  7237. #define ETH_DMASR_ERS ((uint32_t)0x00004000) /* Early receive status */
  7238. #define ETH_DMASR_FBES ((uint32_t)0x00002000) /* Fatal bus error status */
  7239. #define ETH_DMASR_ETS ((uint32_t)0x00000400) /* Early transmit status */
  7240. #define ETH_DMASR_RWTS ((uint32_t)0x00000200) /* Receive watchdog timeout status */
  7241. #define ETH_DMASR_RPSS ((uint32_t)0x00000100) /* Receive process stopped status */
  7242. #define ETH_DMASR_RBUS ((uint32_t)0x00000080) /* Receive buffer unavailable status */
  7243. #define ETH_DMASR_RS ((uint32_t)0x00000040) /* Receive status */
  7244. #define ETH_DMASR_TUS ((uint32_t)0x00000020) /* Transmit underflow status */
  7245. #define ETH_DMASR_ROS ((uint32_t)0x00000010) /* Receive overflow status */
  7246. #define ETH_DMASR_TJTS ((uint32_t)0x00000008) /* Transmit jabber timeout status */
  7247. #define ETH_DMASR_TBUS ((uint32_t)0x00000004) /* Transmit buffer unavailable status */
  7248. #define ETH_DMASR_TPSS ((uint32_t)0x00000002) /* Transmit process stopped status */
  7249. #define ETH_DMASR_TS ((uint32_t)0x00000001) /* Transmit status */
  7250. /* Bit definition for Ethernet DMA Operation Mode Register */
  7251. #define ETH_DMAOMR_DTCEFD ((uint32_t)0x04000000) /* Disable Dropping of TCP/IP checksum error frames */
  7252. #define ETH_DMAOMR_RSF ((uint32_t)0x02000000) /* Receive store and forward */
  7253. #define ETH_DMAOMR_DFRF ((uint32_t)0x01000000) /* Disable flushing of received frames */
  7254. #define ETH_DMAOMR_TSF ((uint32_t)0x00200000) /* Transmit store and forward */
  7255. #define ETH_DMAOMR_FTF ((uint32_t)0x00100000) /* Flush transmit FIFO */
  7256. #define ETH_DMAOMR_TTC ((uint32_t)0x0001C000) /* Transmit threshold control */
  7257. #define ETH_DMAOMR_TTC_64Bytes ((uint32_t)0x00000000) /* threshold level of the MTL Transmit FIFO is 64 Bytes */
  7258. #define ETH_DMAOMR_TTC_128Bytes ((uint32_t)0x00004000) /* threshold level of the MTL Transmit FIFO is 128 Bytes */
  7259. #define ETH_DMAOMR_TTC_192Bytes ((uint32_t)0x00008000) /* threshold level of the MTL Transmit FIFO is 192 Bytes */
  7260. #define ETH_DMAOMR_TTC_256Bytes ((uint32_t)0x0000C000) /* threshold level of the MTL Transmit FIFO is 256 Bytes */
  7261. #define ETH_DMAOMR_TTC_40Bytes ((uint32_t)0x00010000) /* threshold level of the MTL Transmit FIFO is 40 Bytes */
  7262. #define ETH_DMAOMR_TTC_32Bytes ((uint32_t)0x00014000) /* threshold level of the MTL Transmit FIFO is 32 Bytes */
  7263. #define ETH_DMAOMR_TTC_24Bytes ((uint32_t)0x00018000) /* threshold level of the MTL Transmit FIFO is 24 Bytes */
  7264. #define ETH_DMAOMR_TTC_16Bytes ((uint32_t)0x0001C000) /* threshold level of the MTL Transmit FIFO is 16 Bytes */
  7265. #define ETH_DMAOMR_ST ((uint32_t)0x00002000) /* Start/stop transmission command */
  7266. #define ETH_DMAOMR_FEF ((uint32_t)0x00000080) /* Forward error frames */
  7267. #define ETH_DMAOMR_FUGF ((uint32_t)0x00000040) /* Forward undersized good frames */
  7268. #define ETH_DMAOMR_RTC ((uint32_t)0x00000018) /* receive threshold control */
  7269. #define ETH_DMAOMR_RTC_64Bytes ((uint32_t)0x00000000) /* threshold level of the MTL Receive FIFO is 64 Bytes */
  7270. #define ETH_DMAOMR_RTC_32Bytes ((uint32_t)0x00000008) /* threshold level of the MTL Receive FIFO is 32 Bytes */
  7271. #define ETH_DMAOMR_RTC_96Bytes ((uint32_t)0x00000010) /* threshold level of the MTL Receive FIFO is 96 Bytes */
  7272. #define ETH_DMAOMR_RTC_128Bytes ((uint32_t)0x00000018) /* threshold level of the MTL Receive FIFO is 128 Bytes */
  7273. #define ETH_DMAOMR_OSF ((uint32_t)0x00000004) /* operate on second frame */
  7274. #define ETH_DMAOMR_SR ((uint32_t)0x00000002) /* Start/stop receive */
  7275. /* Bit definition for Ethernet DMA Interrupt Enable Register */
  7276. #define ETH_DMAIER_NISE ((uint32_t)0x00010000) /* Normal interrupt summary enable */
  7277. #define ETH_DMAIER_AISE ((uint32_t)0x00008000) /* Abnormal interrupt summary enable */
  7278. #define ETH_DMAIER_ERIE ((uint32_t)0x00004000) /* Early receive interrupt enable */
  7279. #define ETH_DMAIER_FBEIE ((uint32_t)0x00002000) /* Fatal bus error interrupt enable */
  7280. #define ETH_DMAIER_ETIE ((uint32_t)0x00000400) /* Early transmit interrupt enable */
  7281. #define ETH_DMAIER_RWTIE ((uint32_t)0x00000200) /* Receive watchdog timeout interrupt enable */
  7282. #define ETH_DMAIER_RPSIE ((uint32_t)0x00000100) /* Receive process stopped interrupt enable */
  7283. #define ETH_DMAIER_RBUIE ((uint32_t)0x00000080) /* Receive buffer unavailable interrupt enable */
  7284. #define ETH_DMAIER_RIE ((uint32_t)0x00000040) /* Receive interrupt enable */
  7285. #define ETH_DMAIER_TUIE ((uint32_t)0x00000020) /* Transmit Underflow interrupt enable */
  7286. #define ETH_DMAIER_ROIE ((uint32_t)0x00000010) /* Receive Overflow interrupt enable */
  7287. #define ETH_DMAIER_TJTIE ((uint32_t)0x00000008) /* Transmit jabber timeout interrupt enable */
  7288. #define ETH_DMAIER_TBUIE ((uint32_t)0x00000004) /* Transmit buffer unavailable interrupt enable */
  7289. #define ETH_DMAIER_TPSIE ((uint32_t)0x00000002) /* Transmit process stopped interrupt enable */
  7290. #define ETH_DMAIER_TIE ((uint32_t)0x00000001) /* Transmit interrupt enable */
  7291. /* Bit definition for Ethernet DMA Missed Frame and Buffer Overflow Counter Register */
  7292. #define ETH_DMAMFBOCR_OFOC ((uint32_t)0x10000000) /* Overflow bit for FIFO overflow counter */
  7293. #define ETH_DMAMFBOCR_MFA ((uint32_t)0x0FFE0000) /* Number of frames missed by the application */
  7294. #define ETH_DMAMFBOCR_OMFC ((uint32_t)0x00010000) /* Overflow bit for missed frame counter */
  7295. #define ETH_DMAMFBOCR_MFC ((uint32_t)0x0000FFFF) /* Number of frames missed by the controller */
  7296. /* Bit definition for Ethernet DMA Current Host Transmit Descriptor Register */
  7297. #define ETH_DMACHTDR_HTDAP ((uint32_t)0xFFFFFFFF) /* Host transmit descriptor address pointer */
  7298. /* Bit definition for Ethernet DMA Current Host Receive Descriptor Register */
  7299. #define ETH_DMACHRDR_HRDAP ((uint32_t)0xFFFFFFFF) /* Host receive descriptor address pointer */
  7300. /* Bit definition for Ethernet DMA Current Host Transmit Buffer Address Register */
  7301. #define ETH_DMACHTBAR_HTBAP ((uint32_t)0xFFFFFFFF) /* Host transmit buffer address pointer */
  7302. /* Bit definition for Ethernet DMA Current Host Receive Buffer Address Register */
  7303. #define ETH_DMACHRBAR_HRBAP ((uint32_t)0xFFFFFFFF) /* Host receive buffer address pointer */
  7304. /******************************************************************************/
  7305. /* */
  7306. /* USB_OTG */
  7307. /* */
  7308. /******************************************************************************/
  7309. /******************** Bit definition for USB_OTG_GOTGCTL register ********************/
  7310. #define USB_OTG_GOTGCTL_SRQSCS ((uint32_t)0x00000001) /*!< Session request success */
  7311. #define USB_OTG_GOTGCTL_SRQ ((uint32_t)0x00000002) /*!< Session request */
  7312. #define USB_OTG_GOTGCTL_VBVALOEN ((uint32_t)0x00000004) /*!< VBUS valid override enable */
  7313. #define USB_OTG_GOTGCTL_VBVALOVAL ((uint32_t)0x00000008) /*!< VBUS valid override value */
  7314. #define USB_OTG_GOTGCTL_AVALOEN ((uint32_t)0x00000010) /*!< A-peripheral session valid override enable */
  7315. #define USB_OTG_GOTGCTL_AVALOVAL ((uint32_t)0x00000020) /*!< A-peripheral session valid override value */
  7316. #define USB_OTG_GOTGCTL_BVALOEN ((uint32_t)0x00000040) /*!< B-peripheral session valid override enable */
  7317. #define USB_OTG_GOTGCTL_BVALOVAL ((uint32_t)0x00000080) /*!< B-peripheral session valid override value */
  7318. #define USB_OTG_GOTGCTL_HNGSCS ((uint32_t)0x00000100) /*!< Host set HNP enable */
  7319. #define USB_OTG_GOTGCTL_HNPRQ ((uint32_t)0x00000200) /*!< HNP request */
  7320. #define USB_OTG_GOTGCTL_HSHNPEN ((uint32_t)0x00000400) /*!< Host set HNP enable */
  7321. #define USB_OTG_GOTGCTL_DHNPEN ((uint32_t)0x00000800) /*!< Device HNP enabled */
  7322. #define USB_OTG_GOTGCTL_EHEN ((uint32_t)0x00001000) /*!< Embedded host enable */
  7323. #define USB_OTG_GOTGCTL_CIDSTS ((uint32_t)0x00010000) /*!< Connector ID status */
  7324. #define USB_OTG_GOTGCTL_DBCT ((uint32_t)0x00020000) /*!< Long/short debounce time */
  7325. #define USB_OTG_GOTGCTL_ASVLD ((uint32_t)0x00040000) /*!< A-session valid */
  7326. #define USB_OTG_GOTGCTL_BSESVLD ((uint32_t)0x00080000) /*!< B-session valid */
  7327. #define USB_OTG_GOTGCTL_OTGVER ((uint32_t)0x00100000) /*!< OTG version */
  7328. /******************** Bit definition for USB_OTG_HCFG register ********************/
  7329. #define USB_OTG_HCFG_FSLSPCS ((uint32_t)0x00000003) /*!< FS/LS PHY clock select */
  7330. #define USB_OTG_HCFG_FSLSPCS_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  7331. #define USB_OTG_HCFG_FSLSPCS_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  7332. #define USB_OTG_HCFG_FSLSS ((uint32_t)0x00000004) /*!< FS- and LS-only support */
  7333. /******************** Bit definition for USB_OTG_DCFG register ********************/
  7334. #define USB_OTG_DCFG_DSPD ((uint32_t)0x00000003) /*!< Device speed */
  7335. #define USB_OTG_DCFG_DSPD_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  7336. #define USB_OTG_DCFG_DSPD_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  7337. #define USB_OTG_DCFG_NZLSOHSK ((uint32_t)0x00000004) /*!< Nonzero-length status OUT handshake */
  7338. #define USB_OTG_DCFG_DAD ((uint32_t)0x000007F0) /*!< Device address */
  7339. #define USB_OTG_DCFG_DAD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  7340. #define USB_OTG_DCFG_DAD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  7341. #define USB_OTG_DCFG_DAD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  7342. #define USB_OTG_DCFG_DAD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  7343. #define USB_OTG_DCFG_DAD_4 ((uint32_t)0x00000100) /*!<Bit 4 */
  7344. #define USB_OTG_DCFG_DAD_5 ((uint32_t)0x00000200) /*!<Bit 5 */
  7345. #define USB_OTG_DCFG_DAD_6 ((uint32_t)0x00000400) /*!<Bit 6 */
  7346. #define USB_OTG_DCFG_PFIVL ((uint32_t)0x00001800) /*!< Periodic (micro)frame interval */
  7347. #define USB_OTG_DCFG_PFIVL_0 ((uint32_t)0x00000800) /*!<Bit 0 */
  7348. #define USB_OTG_DCFG_PFIVL_1 ((uint32_t)0x00001000) /*!<Bit 1 */
  7349. #define USB_OTG_DCFG_PERSCHIVL ((uint32_t)0x03000000) /*!< Periodic scheduling interval */
  7350. #define USB_OTG_DCFG_PERSCHIVL_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  7351. #define USB_OTG_DCFG_PERSCHIVL_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  7352. /******************** Bit definition for USB_OTG_PCGCR register ********************/
  7353. #define USB_OTG_PCGCR_STPPCLK ((uint32_t)0x00000001) /*!< Stop PHY clock */
  7354. #define USB_OTG_PCGCR_GATEHCLK ((uint32_t)0x00000002) /*!< Gate HCLK */
  7355. #define USB_OTG_PCGCR_PHYSUSP ((uint32_t)0x00000010) /*!< PHY suspended */
  7356. /******************** Bit definition for USB_OTG_GOTGINT register ********************/
  7357. #define USB_OTG_GOTGINT_SEDET ((uint32_t)0x00000004) /*!< Session end detected */
  7358. #define USB_OTG_GOTGINT_SRSSCHG ((uint32_t)0x00000100) /*!< Session request success status change */
  7359. #define USB_OTG_GOTGINT_HNSSCHG ((uint32_t)0x00000200) /*!< Host negotiation success status change */
  7360. #define USB_OTG_GOTGINT_HNGDET ((uint32_t)0x00020000) /*!< Host negotiation detected */
  7361. #define USB_OTG_GOTGINT_ADTOCHG ((uint32_t)0x00040000) /*!< A-device timeout change */
  7362. #define USB_OTG_GOTGINT_DBCDNE ((uint32_t)0x00080000) /*!< Debounce done */
  7363. #define USB_OTG_GOTGINT_IDCHNG ((uint32_t)0x00100000) /*!< Change in ID pin input value */
  7364. /******************** Bit definition for USB_OTG_DCTL register ********************/
  7365. #define USB_OTG_DCTL_RWUSIG ((uint32_t)0x00000001) /*!< Remote wakeup signaling */
  7366. #define USB_OTG_DCTL_SDIS ((uint32_t)0x00000002) /*!< Soft disconnect */
  7367. #define USB_OTG_DCTL_GINSTS ((uint32_t)0x00000004) /*!< Global IN NAK status */
  7368. #define USB_OTG_DCTL_GONSTS ((uint32_t)0x00000008) /*!< Global OUT NAK status */
  7369. #define USB_OTG_DCTL_TCTL ((uint32_t)0x00000070) /*!< Test control */
  7370. #define USB_OTG_DCTL_TCTL_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  7371. #define USB_OTG_DCTL_TCTL_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  7372. #define USB_OTG_DCTL_TCTL_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  7373. #define USB_OTG_DCTL_SGINAK ((uint32_t)0x00000080) /*!< Set global IN NAK */
  7374. #define USB_OTG_DCTL_CGINAK ((uint32_t)0x00000100) /*!< Clear global IN NAK */
  7375. #define USB_OTG_DCTL_SGONAK ((uint32_t)0x00000200) /*!< Set global OUT NAK */
  7376. #define USB_OTG_DCTL_CGONAK ((uint32_t)0x00000400) /*!< Clear global OUT NAK */
  7377. #define USB_OTG_DCTL_POPRGDNE ((uint32_t)0x00000800) /*!< Power-on programming done */
  7378. /******************** Bit definition for USB_OTG_HFIR register ********************/
  7379. #define USB_OTG_HFIR_FRIVL ((uint32_t)0x0000FFFF) /*!< Frame interval */
  7380. /******************** Bit definition for USB_OTG_HFNUM register ********************/
  7381. #define USB_OTG_HFNUM_FRNUM ((uint32_t)0x0000FFFF) /*!< Frame number */
  7382. #define USB_OTG_HFNUM_FTREM ((uint32_t)0xFFFF0000) /*!< Frame time remaining */
  7383. /******************** Bit definition for USB_OTG_DSTS register ********************/
  7384. #define USB_OTG_DSTS_SUSPSTS ((uint32_t)0x00000001) /*!< Suspend status */
  7385. #define USB_OTG_DSTS_ENUMSPD ((uint32_t)0x00000006) /*!< Enumerated speed */
  7386. #define USB_OTG_DSTS_ENUMSPD_0 ((uint32_t)0x00000002) /*!<Bit 0 */
  7387. #define USB_OTG_DSTS_ENUMSPD_1 ((uint32_t)0x00000004) /*!<Bit 1 */
  7388. #define USB_OTG_DSTS_EERR ((uint32_t)0x00000008) /*!< Erratic error */
  7389. #define USB_OTG_DSTS_FNSOF ((uint32_t)0x003FFF00) /*!< Frame number of the received SOF */
  7390. /******************** Bit definition for USB_OTG_GAHBCFG register ********************/
  7391. #define USB_OTG_GAHBCFG_GINT ((uint32_t)0x00000001) /*!< Global interrupt mask */
  7392. #define USB_OTG_GAHBCFG_HBSTLEN ((uint32_t)0x0000001E) /*!< Burst length/type */
  7393. #define USB_OTG_GAHBCFG_HBSTLEN_0 ((uint32_t)0x00000002) /*!<Bit 0 */
  7394. #define USB_OTG_GAHBCFG_HBSTLEN_1 ((uint32_t)0x00000004) /*!<Bit 1 */
  7395. #define USB_OTG_GAHBCFG_HBSTLEN_2 ((uint32_t)0x00000008) /*!<Bit 2 */
  7396. #define USB_OTG_GAHBCFG_HBSTLEN_3 ((uint32_t)0x00000010) /*!<Bit 3 */
  7397. #define USB_OTG_GAHBCFG_DMAEN ((uint32_t)0x00000020) /*!< DMA enable */
  7398. #define USB_OTG_GAHBCFG_TXFELVL ((uint32_t)0x00000080) /*!< TxFIFO empty level */
  7399. #define USB_OTG_GAHBCFG_PTXFELVL ((uint32_t)0x00000100) /*!< Periodic TxFIFO empty level */
  7400. /******************** Bit definition for USB_OTG_GUSBCFG register ********************/
  7401. #define USB_OTG_GUSBCFG_TOCAL ((uint32_t)0x00000007) /*!< FS timeout calibration */
  7402. #define USB_OTG_GUSBCFG_TOCAL_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  7403. #define USB_OTG_GUSBCFG_TOCAL_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  7404. #define USB_OTG_GUSBCFG_TOCAL_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  7405. #define USB_OTG_GUSBCFG_PHYSEL ((uint32_t)0x00000040) /*!< USB 2.0 high-speed ULPI PHY or USB 1.1 full-speed serial transceiver select */
  7406. #define USB_OTG_GUSBCFG_SRPCAP ((uint32_t)0x00000100) /*!< SRP-capable */
  7407. #define USB_OTG_GUSBCFG_HNPCAP ((uint32_t)0x00000200) /*!< HNP-capable */
  7408. #define USB_OTG_GUSBCFG_TRDT ((uint32_t)0x00003C00) /*!< USB turnaround time */
  7409. #define USB_OTG_GUSBCFG_TRDT_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  7410. #define USB_OTG_GUSBCFG_TRDT_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  7411. #define USB_OTG_GUSBCFG_TRDT_2 ((uint32_t)0x00001000) /*!<Bit 2 */
  7412. #define USB_OTG_GUSBCFG_TRDT_3 ((uint32_t)0x00002000) /*!<Bit 3 */
  7413. #define USB_OTG_GUSBCFG_PHYLPCS ((uint32_t)0x00008000) /*!< PHY Low-power clock select */
  7414. #define USB_OTG_GUSBCFG_ULPIFSLS ((uint32_t)0x00020000) /*!< ULPI FS/LS select */
  7415. #define USB_OTG_GUSBCFG_ULPIAR ((uint32_t)0x00040000) /*!< ULPI Auto-resume */
  7416. #define USB_OTG_GUSBCFG_ULPICSM ((uint32_t)0x00080000) /*!< ULPI Clock SuspendM */
  7417. #define USB_OTG_GUSBCFG_ULPIEVBUSD ((uint32_t)0x00100000) /*!< ULPI External VBUS Drive */
  7418. #define USB_OTG_GUSBCFG_ULPIEVBUSI ((uint32_t)0x00200000) /*!< ULPI external VBUS indicator */
  7419. #define USB_OTG_GUSBCFG_TSDPS ((uint32_t)0x00400000) /*!< TermSel DLine pulsing selection */
  7420. #define USB_OTG_GUSBCFG_PCCI ((uint32_t)0x00800000) /*!< Indicator complement */
  7421. #define USB_OTG_GUSBCFG_PTCI ((uint32_t)0x01000000) /*!< Indicator pass through */
  7422. #define USB_OTG_GUSBCFG_ULPIIPD ((uint32_t)0x02000000) /*!< ULPI interface protect disable */
  7423. #define USB_OTG_GUSBCFG_FHMOD ((uint32_t)0x20000000) /*!< Forced host mode */
  7424. #define USB_OTG_GUSBCFG_FDMOD ((uint32_t)0x40000000) /*!< Forced peripheral mode */
  7425. #define USB_OTG_GUSBCFG_CTXPKT ((uint32_t)0x80000000) /*!< Corrupt Tx packet */
  7426. /******************** Bit definition for USB_OTG_GRSTCTL register ********************/
  7427. #define USB_OTG_GRSTCTL_CSRST ((uint32_t)0x00000001) /*!< Core soft reset */
  7428. #define USB_OTG_GRSTCTL_HSRST ((uint32_t)0x00000002) /*!< HCLK soft reset */
  7429. #define USB_OTG_GRSTCTL_FCRST ((uint32_t)0x00000004) /*!< Host frame counter reset */
  7430. #define USB_OTG_GRSTCTL_RXFFLSH ((uint32_t)0x00000010) /*!< RxFIFO flush */
  7431. #define USB_OTG_GRSTCTL_TXFFLSH ((uint32_t)0x00000020) /*!< TxFIFO flush */
  7432. #define USB_OTG_GRSTCTL_TXFNUM ((uint32_t)0x000007C0) /*!< TxFIFO number */
  7433. #define USB_OTG_GRSTCTL_TXFNUM_0 ((uint32_t)0x00000040) /*!<Bit 0 */
  7434. #define USB_OTG_GRSTCTL_TXFNUM_1 ((uint32_t)0x00000080) /*!<Bit 1 */
  7435. #define USB_OTG_GRSTCTL_TXFNUM_2 ((uint32_t)0x00000100) /*!<Bit 2 */
  7436. #define USB_OTG_GRSTCTL_TXFNUM_3 ((uint32_t)0x00000200) /*!<Bit 3 */
  7437. #define USB_OTG_GRSTCTL_TXFNUM_4 ((uint32_t)0x00000400) /*!<Bit 4 */
  7438. #define USB_OTG_GRSTCTL_DMAREQ ((uint32_t)0x40000000) /*!< DMA request signal */
  7439. #define USB_OTG_GRSTCTL_AHBIDL ((uint32_t)0x80000000) /*!< AHB master idle */
  7440. /******************** Bit definition for USB_OTG_DIEPMSK register ********************/
  7441. #define USB_OTG_DIEPMSK_XFRCM ((uint32_t)0x00000001) /*!< Transfer completed interrupt mask */
  7442. #define USB_OTG_DIEPMSK_EPDM ((uint32_t)0x00000002) /*!< Endpoint disabled interrupt mask */
  7443. #define USB_OTG_DIEPMSK_TOM ((uint32_t)0x00000008) /*!< Timeout condition mask (nonisochronous endpoints) */
  7444. #define USB_OTG_DIEPMSK_ITTXFEMSK ((uint32_t)0x00000010) /*!< IN token received when TxFIFO empty mask */
  7445. #define USB_OTG_DIEPMSK_INEPNMM ((uint32_t)0x00000020) /*!< IN token received with EP mismatch mask */
  7446. #define USB_OTG_DIEPMSK_INEPNEM ((uint32_t)0x00000040) /*!< IN endpoint NAK effective mask */
  7447. #define USB_OTG_DIEPMSK_TXFURM ((uint32_t)0x00000100) /*!< FIFO underrun mask */
  7448. #define USB_OTG_DIEPMSK_BIM ((uint32_t)0x00000200) /*!< BNA interrupt mask */
  7449. /******************** Bit definition for USB_OTG_HPTXSTS register ********************/
  7450. #define USB_OTG_HPTXSTS_PTXFSAVL ((uint32_t)0x0000FFFF) /*!< Periodic transmit data FIFO space available */
  7451. #define USB_OTG_HPTXSTS_PTXQSAV ((uint32_t)0x00FF0000) /*!< Periodic transmit request queue space available */
  7452. #define USB_OTG_HPTXSTS_PTXQSAV_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  7453. #define USB_OTG_HPTXSTS_PTXQSAV_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  7454. #define USB_OTG_HPTXSTS_PTXQSAV_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  7455. #define USB_OTG_HPTXSTS_PTXQSAV_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  7456. #define USB_OTG_HPTXSTS_PTXQSAV_4 ((uint32_t)0x00100000) /*!<Bit 4 */
  7457. #define USB_OTG_HPTXSTS_PTXQSAV_5 ((uint32_t)0x00200000) /*!<Bit 5 */
  7458. #define USB_OTG_HPTXSTS_PTXQSAV_6 ((uint32_t)0x00400000) /*!<Bit 6 */
  7459. #define USB_OTG_HPTXSTS_PTXQSAV_7 ((uint32_t)0x00800000) /*!<Bit 7 */
  7460. #define USB_OTG_HPTXSTS_PTXQTOP ((uint32_t)0xFF000000) /*!< Top of the periodic transmit request queue */
  7461. #define USB_OTG_HPTXSTS_PTXQTOP_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  7462. #define USB_OTG_HPTXSTS_PTXQTOP_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  7463. #define USB_OTG_HPTXSTS_PTXQTOP_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  7464. #define USB_OTG_HPTXSTS_PTXQTOP_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  7465. #define USB_OTG_HPTXSTS_PTXQTOP_4 ((uint32_t)0x10000000) /*!<Bit 4 */
  7466. #define USB_OTG_HPTXSTS_PTXQTOP_5 ((uint32_t)0x20000000) /*!<Bit 5 */
  7467. #define USB_OTG_HPTXSTS_PTXQTOP_6 ((uint32_t)0x40000000) /*!<Bit 6 */
  7468. #define USB_OTG_HPTXSTS_PTXQTOP_7 ((uint32_t)0x80000000) /*!<Bit 7 */
  7469. /******************** Bit definition for USB_OTG_HAINT register ********************/
  7470. #define USB_OTG_HAINT_HAINT ((uint32_t)0x0000FFFF) /*!< Channel interrupts */
  7471. /******************** Bit definition for USB_OTG_DOEPMSK register ********************/
  7472. #define USB_OTG_DOEPMSK_XFRCM ((uint32_t)0x00000001) /*!< Transfer completed interrupt mask */
  7473. #define USB_OTG_DOEPMSK_EPDM ((uint32_t)0x00000002) /*!< Endpoint disabled interrupt mask */
  7474. #define USB_OTG_DOEPMSK_STUPM ((uint32_t)0x00000008) /*!< SETUP phase done mask */
  7475. #define USB_OTG_DOEPMSK_OTEPDM ((uint32_t)0x00000010) /*!< OUT token received when endpoint disabled mask */
  7476. #define USB_OTG_DOEPMSK_B2BSTUP ((uint32_t)0x00000040) /*!< Back-to-back SETUP packets received mask */
  7477. #define USB_OTG_DOEPMSK_OPEM ((uint32_t)0x00000100) /*!< OUT packet error mask */
  7478. #define USB_OTG_DOEPMSK_BOIM ((uint32_t)0x00000200) /*!< BNA interrupt mask */
  7479. /******************** Bit definition for USB_OTG_GINTSTS register ********************/
  7480. #define USB_OTG_GINTSTS_CMOD ((uint32_t)0x00000001) /*!< Current mode of operation */
  7481. #define USB_OTG_GINTSTS_MMIS ((uint32_t)0x00000002) /*!< Mode mismatch interrupt */
  7482. #define USB_OTG_GINTSTS_OTGINT ((uint32_t)0x00000004) /*!< OTG interrupt */
  7483. #define USB_OTG_GINTSTS_SOF ((uint32_t)0x00000008) /*!< Start of frame */
  7484. #define USB_OTG_GINTSTS_RXFLVL ((uint32_t)0x00000010) /*!< RxFIFO nonempty */
  7485. #define USB_OTG_GINTSTS_NPTXFE ((uint32_t)0x00000020) /*!< Nonperiodic TxFIFO empty */
  7486. #define USB_OTG_GINTSTS_GINAKEFF ((uint32_t)0x00000040) /*!< Global IN nonperiodic NAK effective */
  7487. #define USB_OTG_GINTSTS_BOUTNAKEFF ((uint32_t)0x00000080) /*!< Global OUT NAK effective */
  7488. #define USB_OTG_GINTSTS_ESUSP ((uint32_t)0x00000400) /*!< Early suspend */
  7489. #define USB_OTG_GINTSTS_USBSUSP ((uint32_t)0x00000800) /*!< USB suspend */
  7490. #define USB_OTG_GINTSTS_USBRST ((uint32_t)0x00001000) /*!< USB reset */
  7491. #define USB_OTG_GINTSTS_ENUMDNE ((uint32_t)0x00002000) /*!< Enumeration done */
  7492. #define USB_OTG_GINTSTS_ISOODRP ((uint32_t)0x00004000) /*!< Isochronous OUT packet dropped interrupt */
  7493. #define USB_OTG_GINTSTS_EOPF ((uint32_t)0x00008000) /*!< End of periodic frame interrupt */
  7494. #define USB_OTG_GINTSTS_IEPINT ((uint32_t)0x00040000) /*!< IN endpoint interrupt */
  7495. #define USB_OTG_GINTSTS_OEPINT ((uint32_t)0x00080000) /*!< OUT endpoint interrupt */
  7496. #define USB_OTG_GINTSTS_IISOIXFR ((uint32_t)0x00100000) /*!< Incomplete isochronous IN transfer */
  7497. #define USB_OTG_GINTSTS_PXFR_INCOMPISOOUT ((uint32_t)0x00200000) /*!< Incomplete periodic transfer */
  7498. #define USB_OTG_GINTSTS_DATAFSUSP ((uint32_t)0x00400000) /*!< Data fetch suspended */
  7499. #define USB_OTG_GINTSTS_RSTDET ((uint32_t)0x00800000) /*!< Reset detected interrupt */
  7500. #define USB_OTG_GINTSTS_HPRTINT ((uint32_t)0x01000000) /*!< Host port interrupt */
  7501. #define USB_OTG_GINTSTS_HCINT ((uint32_t)0x02000000) /*!< Host channels interrupt */
  7502. #define USB_OTG_GINTSTS_PTXFE ((uint32_t)0x04000000) /*!< Periodic TxFIFO empty */
  7503. #define USB_OTG_GINTSTS_LPMINT ((uint32_t)0x08000000) /*!< LPM interrupt */
  7504. #define USB_OTG_GINTSTS_CIDSCHG ((uint32_t)0x10000000) /*!< Connector ID status change */
  7505. #define USB_OTG_GINTSTS_DISCINT ((uint32_t)0x20000000) /*!< Disconnect detected interrupt */
  7506. #define USB_OTG_GINTSTS_SRQINT ((uint32_t)0x40000000) /*!< Session request/new session detected interrupt */
  7507. #define USB_OTG_GINTSTS_WKUINT ((uint32_t)0x80000000) /*!< Resume/remote wakeup detected interrupt */
  7508. /******************** Bit definition for USB_OTG_GINTMSK register ********************/
  7509. #define USB_OTG_GINTMSK_MMISM ((uint32_t)0x00000002) /*!< Mode mismatch interrupt mask */
  7510. #define USB_OTG_GINTMSK_OTGINT ((uint32_t)0x00000004) /*!< OTG interrupt mask */
  7511. #define USB_OTG_GINTMSK_SOFM ((uint32_t)0x00000008) /*!< Start of frame mask */
  7512. #define USB_OTG_GINTMSK_RXFLVLM ((uint32_t)0x00000010) /*!< Receive FIFO nonempty mask */
  7513. #define USB_OTG_GINTMSK_NPTXFEM ((uint32_t)0x00000020) /*!< Nonperiodic TxFIFO empty mask */
  7514. #define USB_OTG_GINTMSK_GINAKEFFM ((uint32_t)0x00000040) /*!< Global nonperiodic IN NAK effective mask */
  7515. #define USB_OTG_GINTMSK_GONAKEFFM ((uint32_t)0x00000080) /*!< Global OUT NAK effective mask */
  7516. #define USB_OTG_GINTMSK_ESUSPM ((uint32_t)0x00000400) /*!< Early suspend mask */
  7517. #define USB_OTG_GINTMSK_USBSUSPM ((uint32_t)0x00000800) /*!< USB suspend mask */
  7518. #define USB_OTG_GINTMSK_USBRST ((uint32_t)0x00001000) /*!< USB reset mask */
  7519. #define USB_OTG_GINTMSK_ENUMDNEM ((uint32_t)0x00002000) /*!< Enumeration done mask */
  7520. #define USB_OTG_GINTMSK_ISOODRPM ((uint32_t)0x00004000) /*!< Isochronous OUT packet dropped interrupt mask */
  7521. #define USB_OTG_GINTMSK_EOPFM ((uint32_t)0x00008000) /*!< End of periodic frame interrupt mask */
  7522. #define USB_OTG_GINTMSK_EPMISM ((uint32_t)0x00020000) /*!< Endpoint mismatch interrupt mask */
  7523. #define USB_OTG_GINTMSK_IEPINT ((uint32_t)0x00040000) /*!< IN endpoints interrupt mask */
  7524. #define USB_OTG_GINTMSK_OEPINT ((uint32_t)0x00080000) /*!< OUT endpoints interrupt mask */
  7525. #define USB_OTG_GINTMSK_IISOIXFRM ((uint32_t)0x00100000) /*!< Incomplete isochronous IN transfer mask */
  7526. #define USB_OTG_GINTMSK_PXFRM_IISOOXFRM ((uint32_t)0x00200000) /*!< Incomplete periodic transfer mask */
  7527. #define USB_OTG_GINTMSK_FSUSPM ((uint32_t)0x00400000) /*!< Data fetch suspended mask */
  7528. #define USB_OTG_GINTMSK_RSTDEM ((uint32_t)0x00800000) /*!< Reset detected interrupt mask */
  7529. #define USB_OTG_GINTMSK_PRTIM ((uint32_t)0x01000000) /*!< Host port interrupt mask */
  7530. #define USB_OTG_GINTMSK_HCIM ((uint32_t)0x02000000) /*!< Host channels interrupt mask */
  7531. #define USB_OTG_GINTMSK_PTXFEM ((uint32_t)0x04000000) /*!< Periodic TxFIFO empty mask */
  7532. #define USB_OTG_GINTMSK_LPMINTM ((uint32_t)0x08000000) /*!< LPM interrupt Mask */
  7533. #define USB_OTG_GINTMSK_CIDSCHGM ((uint32_t)0x10000000) /*!< Connector ID status change mask */
  7534. #define USB_OTG_GINTMSK_DISCINT ((uint32_t)0x20000000) /*!< Disconnect detected interrupt mask */
  7535. #define USB_OTG_GINTMSK_SRQIM ((uint32_t)0x40000000) /*!< Session request/new session detected interrupt mask */
  7536. #define USB_OTG_GINTMSK_WUIM ((uint32_t)0x80000000) /*!< Resume/remote wakeup detected interrupt mask */
  7537. /******************** Bit definition for USB_OTG_DAINT register ********************/
  7538. #define USB_OTG_DAINT_IEPINT ((uint32_t)0x0000FFFF) /*!< IN endpoint interrupt bits */
  7539. #define USB_OTG_DAINT_OEPINT ((uint32_t)0xFFFF0000) /*!< OUT endpoint interrupt bits */
  7540. /******************** Bit definition for USB_OTG_HAINTMSK register ********************/
  7541. #define USB_OTG_HAINTMSK_HAINTM ((uint32_t)0x0000FFFF) /*!< Channel interrupt mask */
  7542. /******************** Bit definition for USB_OTG_GRXSTSP register ********************/
  7543. #define USB_OTG_GRXSTSP_EPNUM ((uint32_t)0x0000000F) /*!< IN EP interrupt mask bits */
  7544. #define USB_OTG_GRXSTSP_BCNT ((uint32_t)0x00007FF0) /*!< OUT EP interrupt mask bits */
  7545. #define USB_OTG_GRXSTSP_DPID ((uint32_t)0x00018000) /*!< OUT EP interrupt mask bits */
  7546. #define USB_OTG_GRXSTSP_PKTSTS ((uint32_t)0x001E0000) /*!< OUT EP interrupt mask bits */
  7547. /******************** Bit definition for USB_OTG_DAINTMSK register ********************/
  7548. #define USB_OTG_DAINTMSK_IEPM ((uint32_t)0x0000FFFF) /*!< IN EP interrupt mask bits */
  7549. #define USB_OTG_DAINTMSK_OEPM ((uint32_t)0xFFFF0000) /*!< OUT EP interrupt mask bits */
  7550. /******************** Bit definition for OTG register ********************/
  7551. #define USB_OTG_CHNUM ((uint32_t)0x0000000F) /*!< Channel number */
  7552. #define USB_OTG_CHNUM_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  7553. #define USB_OTG_CHNUM_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  7554. #define USB_OTG_CHNUM_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  7555. #define USB_OTG_CHNUM_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  7556. #define USB_OTG_BCNT ((uint32_t)0x00007FF0) /*!< Byte count */
  7557. #define USB_OTG_DPID ((uint32_t)0x00018000) /*!< Data PID */
  7558. #define USB_OTG_DPID_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  7559. #define USB_OTG_DPID_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  7560. #define USB_OTG_PKTSTS ((uint32_t)0x001E0000) /*!< Packet status */
  7561. #define USB_OTG_PKTSTS_0 ((uint32_t)0x00020000) /*!<Bit 0 */
  7562. #define USB_OTG_PKTSTS_1 ((uint32_t)0x00040000) /*!<Bit 1 */
  7563. #define USB_OTG_PKTSTS_2 ((uint32_t)0x00080000) /*!<Bit 2 */
  7564. #define USB_OTG_PKTSTS_3 ((uint32_t)0x00100000) /*!<Bit 3 */
  7565. #define USB_OTG_EPNUM ((uint32_t)0x0000000F) /*!< Endpoint number */
  7566. #define USB_OTG_EPNUM_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  7567. #define USB_OTG_EPNUM_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  7568. #define USB_OTG_EPNUM_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  7569. #define USB_OTG_EPNUM_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  7570. #define USB_OTG_FRMNUM ((uint32_t)0x01E00000) /*!< Frame number */
  7571. #define USB_OTG_FRMNUM_0 ((uint32_t)0x00200000) /*!<Bit 0 */
  7572. #define USB_OTG_FRMNUM_1 ((uint32_t)0x00400000) /*!<Bit 1 */
  7573. #define USB_OTG_FRMNUM_2 ((uint32_t)0x00800000) /*!<Bit 2 */
  7574. #define USB_OTG_FRMNUM_3 ((uint32_t)0x01000000) /*!<Bit 3 */
  7575. /******************** Bit definition for OTG register ********************/
  7576. #define USB_OTG_CHNUM ((uint32_t)0x0000000F) /*!< Channel number */
  7577. #define USB_OTG_CHNUM_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  7578. #define USB_OTG_CHNUM_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  7579. #define USB_OTG_CHNUM_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  7580. #define USB_OTG_CHNUM_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  7581. #define USB_OTG_BCNT ((uint32_t)0x00007FF0) /*!< Byte count */
  7582. #define USB_OTG_DPID ((uint32_t)0x00018000) /*!< Data PID */
  7583. #define USB_OTG_DPID_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  7584. #define USB_OTG_DPID_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  7585. #define USB_OTG_PKTSTS ((uint32_t)0x001E0000) /*!< Packet status */
  7586. #define USB_OTG_PKTSTS_0 ((uint32_t)0x00020000) /*!<Bit 0 */
  7587. #define USB_OTG_PKTSTS_1 ((uint32_t)0x00040000) /*!<Bit 1 */
  7588. #define USB_OTG_PKTSTS_2 ((uint32_t)0x00080000) /*!<Bit 2 */
  7589. #define USB_OTG_PKTSTS_3 ((uint32_t)0x00100000) /*!<Bit 3 */
  7590. #define USB_OTG_EPNUM ((uint32_t)0x0000000F) /*!< Endpoint number */
  7591. #define USB_OTG_EPNUM_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  7592. #define USB_OTG_EPNUM_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  7593. #define USB_OTG_EPNUM_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  7594. #define USB_OTG_EPNUM_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  7595. #define USB_OTG_FRMNUM ((uint32_t)0x01E00000) /*!< Frame number */
  7596. #define USB_OTG_FRMNUM_0 ((uint32_t)0x00200000) /*!<Bit 0 */
  7597. #define USB_OTG_FRMNUM_1 ((uint32_t)0x00400000) /*!<Bit 1 */
  7598. #define USB_OTG_FRMNUM_2 ((uint32_t)0x00800000) /*!<Bit 2 */
  7599. #define USB_OTG_FRMNUM_3 ((uint32_t)0x01000000) /*!<Bit 3 */
  7600. /******************** Bit definition for USB_OTG_GRXFSIZ register ********************/
  7601. #define USB_OTG_GRXFSIZ_RXFD ((uint32_t)0x0000FFFF) /*!< RxFIFO depth */
  7602. /******************** Bit definition for USB_OTG_DVBUSDIS register ********************/
  7603. #define USB_OTG_DVBUSDIS_VBUSDT ((uint32_t)0x0000FFFF) /*!< Device VBUS discharge time */
  7604. /******************** Bit definition for OTG register ********************/
  7605. #define USB_OTG_NPTXFSA ((uint32_t)0x0000FFFF) /*!< Nonperiodic transmit RAM start address */
  7606. #define USB_OTG_NPTXFD ((uint32_t)0xFFFF0000) /*!< Nonperiodic TxFIFO depth */
  7607. #define USB_OTG_TX0FSA ((uint32_t)0x0000FFFF) /*!< Endpoint 0 transmit RAM start address */
  7608. #define USB_OTG_TX0FD ((uint32_t)0xFFFF0000) /*!< Endpoint 0 TxFIFO depth */
  7609. /******************** Bit definition for USB_OTG_DVBUSPULSE register ********************/
  7610. #define USB_OTG_DVBUSPULSE_DVBUSP ((uint32_t)0x00000FFF) /*!< Device VBUS pulsing time */
  7611. /******************** Bit definition for USB_OTG_GNPTXSTS register ********************/
  7612. #define USB_OTG_GNPTXSTS_NPTXFSAV ((uint32_t)0x0000FFFF) /*!< Nonperiodic TxFIFO space available */
  7613. #define USB_OTG_GNPTXSTS_NPTQXSAV ((uint32_t)0x00FF0000) /*!< Nonperiodic transmit request queue space available */
  7614. #define USB_OTG_GNPTXSTS_NPTQXSAV_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  7615. #define USB_OTG_GNPTXSTS_NPTQXSAV_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  7616. #define USB_OTG_GNPTXSTS_NPTQXSAV_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  7617. #define USB_OTG_GNPTXSTS_NPTQXSAV_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  7618. #define USB_OTG_GNPTXSTS_NPTQXSAV_4 ((uint32_t)0x00100000) /*!<Bit 4 */
  7619. #define USB_OTG_GNPTXSTS_NPTQXSAV_5 ((uint32_t)0x00200000) /*!<Bit 5 */
  7620. #define USB_OTG_GNPTXSTS_NPTQXSAV_6 ((uint32_t)0x00400000) /*!<Bit 6 */
  7621. #define USB_OTG_GNPTXSTS_NPTQXSAV_7 ((uint32_t)0x00800000) /*!<Bit 7 */
  7622. #define USB_OTG_GNPTXSTS_NPTXQTOP ((uint32_t)0x7F000000) /*!< Top of the nonperiodic transmit request queue */
  7623. #define USB_OTG_GNPTXSTS_NPTXQTOP_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  7624. #define USB_OTG_GNPTXSTS_NPTXQTOP_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  7625. #define USB_OTG_GNPTXSTS_NPTXQTOP_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  7626. #define USB_OTG_GNPTXSTS_NPTXQTOP_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  7627. #define USB_OTG_GNPTXSTS_NPTXQTOP_4 ((uint32_t)0x10000000) /*!<Bit 4 */
  7628. #define USB_OTG_GNPTXSTS_NPTXQTOP_5 ((uint32_t)0x20000000) /*!<Bit 5 */
  7629. #define USB_OTG_GNPTXSTS_NPTXQTOP_6 ((uint32_t)0x40000000) /*!<Bit 6 */
  7630. /******************** Bit definition for USB_OTG_DTHRCTL register ********************/
  7631. #define USB_OTG_DTHRCTL_NONISOTHREN ((uint32_t)0x00000001) /*!< Nonisochronous IN endpoints threshold enable */
  7632. #define USB_OTG_DTHRCTL_ISOTHREN ((uint32_t)0x00000002) /*!< ISO IN endpoint threshold enable */
  7633. #define USB_OTG_DTHRCTL_TXTHRLEN ((uint32_t)0x000007FC) /*!< Transmit threshold length */
  7634. #define USB_OTG_DTHRCTL_TXTHRLEN_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  7635. #define USB_OTG_DTHRCTL_TXTHRLEN_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  7636. #define USB_OTG_DTHRCTL_TXTHRLEN_2 ((uint32_t)0x00000010) /*!<Bit 2 */
  7637. #define USB_OTG_DTHRCTL_TXTHRLEN_3 ((uint32_t)0x00000020) /*!<Bit 3 */
  7638. #define USB_OTG_DTHRCTL_TXTHRLEN_4 ((uint32_t)0x00000040) /*!<Bit 4 */
  7639. #define USB_OTG_DTHRCTL_TXTHRLEN_5 ((uint32_t)0x00000080) /*!<Bit 5 */
  7640. #define USB_OTG_DTHRCTL_TXTHRLEN_6 ((uint32_t)0x00000100) /*!<Bit 6 */
  7641. #define USB_OTG_DTHRCTL_TXTHRLEN_7 ((uint32_t)0x00000200) /*!<Bit 7 */
  7642. #define USB_OTG_DTHRCTL_TXTHRLEN_8 ((uint32_t)0x00000400) /*!<Bit 8 */
  7643. #define USB_OTG_DTHRCTL_RXTHREN ((uint32_t)0x00010000) /*!< Receive threshold enable */
  7644. #define USB_OTG_DTHRCTL_RXTHRLEN ((uint32_t)0x03FE0000) /*!< Receive threshold length */
  7645. #define USB_OTG_DTHRCTL_RXTHRLEN_0 ((uint32_t)0x00020000) /*!<Bit 0 */
  7646. #define USB_OTG_DTHRCTL_RXTHRLEN_1 ((uint32_t)0x00040000) /*!<Bit 1 */
  7647. #define USB_OTG_DTHRCTL_RXTHRLEN_2 ((uint32_t)0x00080000) /*!<Bit 2 */
  7648. #define USB_OTG_DTHRCTL_RXTHRLEN_3 ((uint32_t)0x00100000) /*!<Bit 3 */
  7649. #define USB_OTG_DTHRCTL_RXTHRLEN_4 ((uint32_t)0x00200000) /*!<Bit 4 */
  7650. #define USB_OTG_DTHRCTL_RXTHRLEN_5 ((uint32_t)0x00400000) /*!<Bit 5 */
  7651. #define USB_OTG_DTHRCTL_RXTHRLEN_6 ((uint32_t)0x00800000) /*!<Bit 6 */
  7652. #define USB_OTG_DTHRCTL_RXTHRLEN_7 ((uint32_t)0x01000000) /*!<Bit 7 */
  7653. #define USB_OTG_DTHRCTL_RXTHRLEN_8 ((uint32_t)0x02000000) /*!<Bit 8 */
  7654. #define USB_OTG_DTHRCTL_ARPEN ((uint32_t)0x08000000) /*!< Arbiter parking enable */
  7655. /******************** Bit definition for USB_OTG_DIEPEMPMSK register ********************/
  7656. #define USB_OTG_DIEPEMPMSK_INEPTXFEM ((uint32_t)0x0000FFFF) /*!< IN EP Tx FIFO empty interrupt mask bits */
  7657. /******************** Bit definition for USB_OTG_DEACHINT register ********************/
  7658. #define USB_OTG_DEACHINT_IEP1INT ((uint32_t)0x00000002) /*!< IN endpoint 1interrupt bit */
  7659. #define USB_OTG_DEACHINT_OEP1INT ((uint32_t)0x00020000) /*!< OUT endpoint 1 interrupt bit */
  7660. /******************** Bit definition for USB_OTG_GCCFG register ********************/
  7661. #define USB_OTG_GCCFG_PWRDWN ((uint32_t)0x00010000) /*!< Power down */
  7662. #define USB_OTG_GCCFG_VBDEN ((uint32_t)0x00200000) /*!< USB VBUS Detection Enable */
  7663. /******************** Bit definition for USB_OTG_GPWRDN) register ********************/
  7664. #define USB_OTG_GPWRDN_ADPMEN ((uint32_t)0x00000001) /*!< ADP module enable */
  7665. #define USB_OTG_GPWRDN_ADPIF ((uint32_t)0x00800000) /*!< ADP Interrupt flag */
  7666. /******************** Bit definition for USB_OTG_DEACHINTMSK register ********************/
  7667. #define USB_OTG_DEACHINTMSK_IEP1INTM ((uint32_t)0x00000002) /*!< IN Endpoint 1 interrupt mask bit */
  7668. #define USB_OTG_DEACHINTMSK_OEP1INTM ((uint32_t)0x00020000) /*!< OUT Endpoint 1 interrupt mask bit */
  7669. /******************** Bit definition for USB_OTG_CID register ********************/
  7670. #define USB_OTG_CID_PRODUCT_ID ((uint32_t)0xFFFFFFFF) /*!< Product ID field */
  7671. /******************** Bit definition for USB_OTG_GLPMCFG register ********************/
  7672. #define USB_OTG_GLPMCFG_LPMEN ((uint32_t)0x00000001) /*!< LPM support enable */
  7673. #define USB_OTG_GLPMCFG_LPMACK ((uint32_t)0x00000002) /*!< LPM Token acknowledge enable */
  7674. #define USB_OTG_GLPMCFG_BESL ((uint32_t)0x0000003C) /*!< BESL value received with last ACKed LPM Token */
  7675. #define USB_OTG_GLPMCFG_REMWAKE ((uint32_t)0x00000040) /*!< bRemoteWake value received with last ACKed LPM Token */
  7676. #define USB_OTG_GLPMCFG_L1SSEN ((uint32_t)0x00000080) /*!< L1 shallow sleep enable */
  7677. #define USB_OTG_GLPMCFG_BESLTHRS ((uint32_t)0x00000F00) /*!< BESL threshold */
  7678. #define USB_OTG_GLPMCFG_L1DSEN ((uint32_t)0x00001000) /*!< L1 deep sleep enable */
  7679. #define USB_OTG_GLPMCFG_LPMRSP ((uint32_t)0x00006000) /*!< LPM response */
  7680. #define USB_OTG_GLPMCFG_SLPSTS ((uint32_t)0x00008000) /*!< Port sleep status */
  7681. #define USB_OTG_GLPMCFG_L1RSMOK ((uint32_t)0x00010000) /*!< Sleep State Resume OK */
  7682. #define USB_OTG_GLPMCFG_LPMCHIDX ((uint32_t)0x001E0000) /*!< LPM Channel Index */
  7683. #define USB_OTG_GLPMCFG_LPMRCNT ((uint32_t)0x00E00000) /*!< LPM retry count */
  7684. #define USB_OTG_GLPMCFG_SNDLPM ((uint32_t)0x01000000) /*!< Send LPM transaction */
  7685. #define USB_OTG_GLPMCFG_LPMRCNTSTS ((uint32_t)0x0E000000) /*!< LPM retry count status */
  7686. #define USB_OTG_GLPMCFG_ENBESL ((uint32_t)0x10000000) /*!< Enable best effort service latency */
  7687. /******************** Bit definition for USB_OTG_DIEPEACHMSK1 register ********************/
  7688. #define USB_OTG_DIEPEACHMSK1_XFRCM ((uint32_t)0x00000001) /*!< Transfer completed interrupt mask */
  7689. #define USB_OTG_DIEPEACHMSK1_EPDM ((uint32_t)0x00000002) /*!< Endpoint disabled interrupt mask */
  7690. #define USB_OTG_DIEPEACHMSK1_TOM ((uint32_t)0x00000008) /*!< Timeout condition mask (nonisochronous endpoints) */
  7691. #define USB_OTG_DIEPEACHMSK1_ITTXFEMSK ((uint32_t)0x00000010) /*!< IN token received when TxFIFO empty mask */
  7692. #define USB_OTG_DIEPEACHMSK1_INEPNMM ((uint32_t)0x00000020) /*!< IN token received with EP mismatch mask */
  7693. #define USB_OTG_DIEPEACHMSK1_INEPNEM ((uint32_t)0x00000040) /*!< IN endpoint NAK effective mask */
  7694. #define USB_OTG_DIEPEACHMSK1_TXFURM ((uint32_t)0x00000100) /*!< FIFO underrun mask */
  7695. #define USB_OTG_DIEPEACHMSK1_BIM ((uint32_t)0x00000200) /*!< BNA interrupt mask */
  7696. #define USB_OTG_DIEPEACHMSK1_NAKM ((uint32_t)0x00002000) /*!< NAK interrupt mask */
  7697. /******************** Bit definition for USB_OTG_HPRT register ********************/
  7698. #define USB_OTG_HPRT_PCSTS ((uint32_t)0x00000001) /*!< Port connect status */
  7699. #define USB_OTG_HPRT_PCDET ((uint32_t)0x00000002) /*!< Port connect detected */
  7700. #define USB_OTG_HPRT_PENA ((uint32_t)0x00000004) /*!< Port enable */
  7701. #define USB_OTG_HPRT_PENCHNG ((uint32_t)0x00000008) /*!< Port enable/disable change */
  7702. #define USB_OTG_HPRT_POCA ((uint32_t)0x00000010) /*!< Port overcurrent active */
  7703. #define USB_OTG_HPRT_POCCHNG ((uint32_t)0x00000020) /*!< Port overcurrent change */
  7704. #define USB_OTG_HPRT_PRES ((uint32_t)0x00000040) /*!< Port resume */
  7705. #define USB_OTG_HPRT_PSUSP ((uint32_t)0x00000080) /*!< Port suspend */
  7706. #define USB_OTG_HPRT_PRST ((uint32_t)0x00000100) /*!< Port reset */
  7707. #define USB_OTG_HPRT_PLSTS ((uint32_t)0x00000C00) /*!< Port line status */
  7708. #define USB_OTG_HPRT_PLSTS_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  7709. #define USB_OTG_HPRT_PLSTS_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  7710. #define USB_OTG_HPRT_PPWR ((uint32_t)0x00001000) /*!< Port power */
  7711. #define USB_OTG_HPRT_PTCTL ((uint32_t)0x0001E000) /*!< Port test control */
  7712. #define USB_OTG_HPRT_PTCTL_0 ((uint32_t)0x00002000) /*!<Bit 0 */
  7713. #define USB_OTG_HPRT_PTCTL_1 ((uint32_t)0x00004000) /*!<Bit 1 */
  7714. #define USB_OTG_HPRT_PTCTL_2 ((uint32_t)0x00008000) /*!<Bit 2 */
  7715. #define USB_OTG_HPRT_PTCTL_3 ((uint32_t)0x00010000) /*!<Bit 3 */
  7716. #define USB_OTG_HPRT_PSPD ((uint32_t)0x00060000) /*!< Port speed */
  7717. #define USB_OTG_HPRT_PSPD_0 ((uint32_t)0x00020000) /*!<Bit 0 */
  7718. #define USB_OTG_HPRT_PSPD_1 ((uint32_t)0x00040000) /*!<Bit 1 */
  7719. /******************** Bit definition for USB_OTG_DOEPEACHMSK1 register ********************/
  7720. #define USB_OTG_DOEPEACHMSK1_XFRCM ((uint32_t)0x00000001) /*!< Transfer completed interrupt mask */
  7721. #define USB_OTG_DOEPEACHMSK1_EPDM ((uint32_t)0x00000002) /*!< Endpoint disabled interrupt mask */
  7722. #define USB_OTG_DOEPEACHMSK1_TOM ((uint32_t)0x00000008) /*!< Timeout condition mask */
  7723. #define USB_OTG_DOEPEACHMSK1_ITTXFEMSK ((uint32_t)0x00000010) /*!< IN token received when TxFIFO empty mask */
  7724. #define USB_OTG_DOEPEACHMSK1_INEPNMM ((uint32_t)0x00000020) /*!< IN token received with EP mismatch mask */
  7725. #define USB_OTG_DOEPEACHMSK1_INEPNEM ((uint32_t)0x00000040) /*!< IN endpoint NAK effective mask */
  7726. #define USB_OTG_DOEPEACHMSK1_TXFURM ((uint32_t)0x00000100) /*!< OUT packet error mask */
  7727. #define USB_OTG_DOEPEACHMSK1_BIM ((uint32_t)0x00000200) /*!< BNA interrupt mask */
  7728. #define USB_OTG_DOEPEACHMSK1_BERRM ((uint32_t)0x00001000) /*!< Bubble error interrupt mask */
  7729. #define USB_OTG_DOEPEACHMSK1_NAKM ((uint32_t)0x00002000) /*!< NAK interrupt mask */
  7730. #define USB_OTG_DOEPEACHMSK1_NYETM ((uint32_t)0x00004000) /*!< NYET interrupt mask */
  7731. /******************** Bit definition for USB_OTG_HPTXFSIZ register ********************/
  7732. #define USB_OTG_HPTXFSIZ_PTXSA ((uint32_t)0x0000FFFF) /*!< Host periodic TxFIFO start address */
  7733. #define USB_OTG_HPTXFSIZ_PTXFD ((uint32_t)0xFFFF0000) /*!< Host periodic TxFIFO depth */
  7734. /******************** Bit definition for USB_OTG_DIEPCTL register ********************/
  7735. #define USB_OTG_DIEPCTL_MPSIZ ((uint32_t)0x000007FF) /*!< Maximum packet size */
  7736. #define USB_OTG_DIEPCTL_USBAEP ((uint32_t)0x00008000) /*!< USB active endpoint */
  7737. #define USB_OTG_DIEPCTL_EONUM_DPID ((uint32_t)0x00010000) /*!< Even/odd frame */
  7738. #define USB_OTG_DIEPCTL_NAKSTS ((uint32_t)0x00020000) /*!< NAK status */
  7739. #define USB_OTG_DIEPCTL_EPTYP ((uint32_t)0x000C0000) /*!< Endpoint type */
  7740. #define USB_OTG_DIEPCTL_EPTYP_0 ((uint32_t)0x00040000) /*!<Bit 0 */
  7741. #define USB_OTG_DIEPCTL_EPTYP_1 ((uint32_t)0x00080000) /*!<Bit 1 */
  7742. #define USB_OTG_DIEPCTL_STALL ((uint32_t)0x00200000) /*!< STALL handshake */
  7743. #define USB_OTG_DIEPCTL_TXFNUM ((uint32_t)0x03C00000) /*!< TxFIFO number */
  7744. #define USB_OTG_DIEPCTL_TXFNUM_0 ((uint32_t)0x00400000) /*!<Bit 0 */
  7745. #define USB_OTG_DIEPCTL_TXFNUM_1 ((uint32_t)0x00800000) /*!<Bit 1 */
  7746. #define USB_OTG_DIEPCTL_TXFNUM_2 ((uint32_t)0x01000000) /*!<Bit 2 */
  7747. #define USB_OTG_DIEPCTL_TXFNUM_3 ((uint32_t)0x02000000) /*!<Bit 3 */
  7748. #define USB_OTG_DIEPCTL_CNAK ((uint32_t)0x04000000) /*!< Clear NAK */
  7749. #define USB_OTG_DIEPCTL_SNAK ((uint32_t)0x08000000) /*!< Set NAK */
  7750. #define USB_OTG_DIEPCTL_SD0PID_SEVNFRM ((uint32_t)0x10000000) /*!< Set DATA0 PID */
  7751. #define USB_OTG_DIEPCTL_SODDFRM ((uint32_t)0x20000000) /*!< Set odd frame */
  7752. #define USB_OTG_DIEPCTL_EPDIS ((uint32_t)0x40000000) /*!< Endpoint disable */
  7753. #define USB_OTG_DIEPCTL_EPENA ((uint32_t)0x80000000) /*!< Endpoint enable */
  7754. /******************** Bit definition for USB_OTG_HCCHAR register ********************/
  7755. #define USB_OTG_HCCHAR_MPSIZ ((uint32_t)0x000007FF) /*!< Maximum packet size */
  7756. #define USB_OTG_HCCHAR_EPNUM ((uint32_t)0x00007800) /*!< Endpoint number */
  7757. #define USB_OTG_HCCHAR_EPNUM_0 ((uint32_t)0x00000800) /*!<Bit 0 */
  7758. #define USB_OTG_HCCHAR_EPNUM_1 ((uint32_t)0x00001000) /*!<Bit 1 */
  7759. #define USB_OTG_HCCHAR_EPNUM_2 ((uint32_t)0x00002000) /*!<Bit 2 */
  7760. #define USB_OTG_HCCHAR_EPNUM_3 ((uint32_t)0x00004000) /*!<Bit 3 */
  7761. #define USB_OTG_HCCHAR_EPDIR ((uint32_t)0x00008000) /*!< Endpoint direction */
  7762. #define USB_OTG_HCCHAR_LSDEV ((uint32_t)0x00020000) /*!< Low-speed device */
  7763. #define USB_OTG_HCCHAR_EPTYP ((uint32_t)0x000C0000) /*!< Endpoint type */
  7764. #define USB_OTG_HCCHAR_EPTYP_0 ((uint32_t)0x00040000) /*!<Bit 0 */
  7765. #define USB_OTG_HCCHAR_EPTYP_1 ((uint32_t)0x00080000) /*!<Bit 1 */
  7766. #define USB_OTG_HCCHAR_MC ((uint32_t)0x00300000) /*!< Multi Count (MC) / Error Count (EC) */
  7767. #define USB_OTG_HCCHAR_MC_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  7768. #define USB_OTG_HCCHAR_MC_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  7769. #define USB_OTG_HCCHAR_DAD ((uint32_t)0x1FC00000) /*!< Device address */
  7770. #define USB_OTG_HCCHAR_DAD_0 ((uint32_t)0x00400000) /*!<Bit 0 */
  7771. #define USB_OTG_HCCHAR_DAD_1 ((uint32_t)0x00800000) /*!<Bit 1 */
  7772. #define USB_OTG_HCCHAR_DAD_2 ((uint32_t)0x01000000) /*!<Bit 2 */
  7773. #define USB_OTG_HCCHAR_DAD_3 ((uint32_t)0x02000000) /*!<Bit 3 */
  7774. #define USB_OTG_HCCHAR_DAD_4 ((uint32_t)0x04000000) /*!<Bit 4 */
  7775. #define USB_OTG_HCCHAR_DAD_5 ((uint32_t)0x08000000) /*!<Bit 5 */
  7776. #define USB_OTG_HCCHAR_DAD_6 ((uint32_t)0x10000000) /*!<Bit 6 */
  7777. #define USB_OTG_HCCHAR_ODDFRM ((uint32_t)0x20000000) /*!< Odd frame */
  7778. #define USB_OTG_HCCHAR_CHDIS ((uint32_t)0x40000000) /*!< Channel disable */
  7779. #define USB_OTG_HCCHAR_CHENA ((uint32_t)0x80000000) /*!< Channel enable */
  7780. /******************** Bit definition for USB_OTG_HCSPLT register ********************/
  7781. #define USB_OTG_HCSPLT_PRTADDR ((uint32_t)0x0000007F) /*!< Port address */
  7782. #define USB_OTG_HCSPLT_PRTADDR_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  7783. #define USB_OTG_HCSPLT_PRTADDR_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  7784. #define USB_OTG_HCSPLT_PRTADDR_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  7785. #define USB_OTG_HCSPLT_PRTADDR_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  7786. #define USB_OTG_HCSPLT_PRTADDR_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  7787. #define USB_OTG_HCSPLT_PRTADDR_5 ((uint32_t)0x00000020) /*!<Bit 5 */
  7788. #define USB_OTG_HCSPLT_PRTADDR_6 ((uint32_t)0x00000040) /*!<Bit 6 */
  7789. #define USB_OTG_HCSPLT_HUBADDR ((uint32_t)0x00003F80) /*!< Hub address */
  7790. #define USB_OTG_HCSPLT_HUBADDR_0 ((uint32_t)0x00000080) /*!<Bit 0 */
  7791. #define USB_OTG_HCSPLT_HUBADDR_1 ((uint32_t)0x00000100) /*!<Bit 1 */
  7792. #define USB_OTG_HCSPLT_HUBADDR_2 ((uint32_t)0x00000200) /*!<Bit 2 */
  7793. #define USB_OTG_HCSPLT_HUBADDR_3 ((uint32_t)0x00000400) /*!<Bit 3 */
  7794. #define USB_OTG_HCSPLT_HUBADDR_4 ((uint32_t)0x00000800) /*!<Bit 4 */
  7795. #define USB_OTG_HCSPLT_HUBADDR_5 ((uint32_t)0x00001000) /*!<Bit 5 */
  7796. #define USB_OTG_HCSPLT_HUBADDR_6 ((uint32_t)0x00002000) /*!<Bit 6 */
  7797. #define USB_OTG_HCSPLT_XACTPOS ((uint32_t)0x0000C000) /*!< XACTPOS */
  7798. #define USB_OTG_HCSPLT_XACTPOS_0 ((uint32_t)0x00004000) /*!<Bit 0 */
  7799. #define USB_OTG_HCSPLT_XACTPOS_1 ((uint32_t)0x00008000) /*!<Bit 1 */
  7800. #define USB_OTG_HCSPLT_COMPLSPLT ((uint32_t)0x00010000) /*!< Do complete split */
  7801. #define USB_OTG_HCSPLT_SPLITEN ((uint32_t)0x80000000) /*!< Split enable */
  7802. /******************** Bit definition for USB_OTG_HCINT register ********************/
  7803. #define USB_OTG_HCINT_XFRC ((uint32_t)0x00000001) /*!< Transfer completed */
  7804. #define USB_OTG_HCINT_CHH ((uint32_t)0x00000002) /*!< Channel halted */
  7805. #define USB_OTG_HCINT_AHBERR ((uint32_t)0x00000004) /*!< AHB error */
  7806. #define USB_OTG_HCINT_STALL ((uint32_t)0x00000008) /*!< STALL response received interrupt */
  7807. #define USB_OTG_HCINT_NAK ((uint32_t)0x00000010) /*!< NAK response received interrupt */
  7808. #define USB_OTG_HCINT_ACK ((uint32_t)0x00000020) /*!< ACK response received/transmitted interrupt */
  7809. #define USB_OTG_HCINT_NYET ((uint32_t)0x00000040) /*!< Response received interrupt */
  7810. #define USB_OTG_HCINT_TXERR ((uint32_t)0x00000080) /*!< Transaction error */
  7811. #define USB_OTG_HCINT_BBERR ((uint32_t)0x00000100) /*!< Babble error */
  7812. #define USB_OTG_HCINT_FRMOR ((uint32_t)0x00000200) /*!< Frame overrun */
  7813. #define USB_OTG_HCINT_DTERR ((uint32_t)0x00000400) /*!< Data toggle error */
  7814. /******************** Bit definition for USB_OTG_DIEPINT register ********************/
  7815. #define USB_OTG_DIEPINT_XFRC ((uint32_t)0x00000001) /*!< Transfer completed interrupt */
  7816. #define USB_OTG_DIEPINT_EPDISD ((uint32_t)0x00000002) /*!< Endpoint disabled interrupt */
  7817. #define USB_OTG_DIEPINT_TOC ((uint32_t)0x00000008) /*!< Timeout condition */
  7818. #define USB_OTG_DIEPINT_ITTXFE ((uint32_t)0x00000010) /*!< IN token received when TxFIFO is empty */
  7819. #define USB_OTG_DIEPINT_INEPNE ((uint32_t)0x00000040) /*!< IN endpoint NAK effective */
  7820. #define USB_OTG_DIEPINT_TXFE ((uint32_t)0x00000080) /*!< Transmit FIFO empty */
  7821. #define USB_OTG_DIEPINT_TXFIFOUDRN ((uint32_t)0x00000100) /*!< Transmit Fifo Underrun */
  7822. #define USB_OTG_DIEPINT_BNA ((uint32_t)0x00000200) /*!< Buffer not available interrupt */
  7823. #define USB_OTG_DIEPINT_PKTDRPSTS ((uint32_t)0x00000800) /*!< Packet dropped status */
  7824. #define USB_OTG_DIEPINT_BERR ((uint32_t)0x00001000) /*!< Babble error interrupt */
  7825. #define USB_OTG_DIEPINT_NAK ((uint32_t)0x00002000) /*!< NAK interrupt */
  7826. /******************** Bit definition for USB_OTG_HCINTMSK register ********************/
  7827. #define USB_OTG_HCINTMSK_XFRCM ((uint32_t)0x00000001) /*!< Transfer completed mask */
  7828. #define USB_OTG_HCINTMSK_CHHM ((uint32_t)0x00000002) /*!< Channel halted mask */
  7829. #define USB_OTG_HCINTMSK_AHBERR ((uint32_t)0x00000004) /*!< AHB error */
  7830. #define USB_OTG_HCINTMSK_STALLM ((uint32_t)0x00000008) /*!< STALL response received interrupt mask */
  7831. #define USB_OTG_HCINTMSK_NAKM ((uint32_t)0x00000010) /*!< NAK response received interrupt mask */
  7832. #define USB_OTG_HCINTMSK_ACKM ((uint32_t)0x00000020) /*!< ACK response received/transmitted interrupt mask */
  7833. #define USB_OTG_HCINTMSK_NYET ((uint32_t)0x00000040) /*!< response received interrupt mask */
  7834. #define USB_OTG_HCINTMSK_TXERRM ((uint32_t)0x00000080) /*!< Transaction error mask */
  7835. #define USB_OTG_HCINTMSK_BBERRM ((uint32_t)0x00000100) /*!< Babble error mask */
  7836. #define USB_OTG_HCINTMSK_FRMORM ((uint32_t)0x00000200) /*!< Frame overrun mask */
  7837. #define USB_OTG_HCINTMSK_DTERRM ((uint32_t)0x00000400) /*!< Data toggle error mask */
  7838. /******************** Bit definition for USB_OTG_DIEPTSIZ register ********************/
  7839. #define USB_OTG_DIEPTSIZ_XFRSIZ ((uint32_t)0x0007FFFF) /*!< Transfer size */
  7840. #define USB_OTG_DIEPTSIZ_PKTCNT ((uint32_t)0x1FF80000) /*!< Packet count */
  7841. #define USB_OTG_DIEPTSIZ_MULCNT ((uint32_t)0x60000000) /*!< Packet count */
  7842. /******************** Bit definition for USB_OTG_HCTSIZ register ********************/
  7843. #define USB_OTG_HCTSIZ_XFRSIZ ((uint32_t)0x0007FFFF) /*!< Transfer size */
  7844. #define USB_OTG_HCTSIZ_PKTCNT ((uint32_t)0x1FF80000) /*!< Packet count */
  7845. #define USB_OTG_HCTSIZ_DOPING ((uint32_t)0x80000000) /*!< Do PING */
  7846. #define USB_OTG_HCTSIZ_DPID ((uint32_t)0x60000000) /*!< Data PID */
  7847. #define USB_OTG_HCTSIZ_DPID_0 ((uint32_t)0x20000000) /*!<Bit 0 */
  7848. #define USB_OTG_HCTSIZ_DPID_1 ((uint32_t)0x40000000) /*!<Bit 1 */
  7849. /******************** Bit definition for USB_OTG_DIEPDMA register ********************/
  7850. #define USB_OTG_DIEPDMA_DMAADDR ((uint32_t)0xFFFFFFFF) /*!< DMA address */
  7851. /******************** Bit definition for USB_OTG_HCDMA register ********************/
  7852. #define USB_OTG_HCDMA_DMAADDR ((uint32_t)0xFFFFFFFF) /*!< DMA address */
  7853. /******************** Bit definition for USB_OTG_DTXFSTS register ********************/
  7854. #define USB_OTG_DTXFSTS_INEPTFSAV ((uint32_t)0x0000FFFF) /*!< IN endpoint TxFIFO space available */
  7855. /******************** Bit definition for USB_OTG_DIEPTXF register ********************/
  7856. #define USB_OTG_DIEPTXF_INEPTXSA ((uint32_t)0x0000FFFF) /*!< IN endpoint FIFOx transmit RAM start address */
  7857. #define USB_OTG_DIEPTXF_INEPTXFD ((uint32_t)0xFFFF0000) /*!< IN endpoint TxFIFO depth */
  7858. /******************** Bit definition for USB_OTG_DOEPCTL register ********************/
  7859. #define USB_OTG_DOEPCTL_MPSIZ ((uint32_t)0x000007FF) /*!< Maximum packet size */ /*!<Bit 1 */
  7860. #define USB_OTG_DOEPCTL_USBAEP ((uint32_t)0x00008000) /*!< USB active endpoint */
  7861. #define USB_OTG_DOEPCTL_NAKSTS ((uint32_t)0x00020000) /*!< NAK status */
  7862. #define USB_OTG_DOEPCTL_SD0PID_SEVNFRM ((uint32_t)0x10000000) /*!< Set DATA0 PID */
  7863. #define USB_OTG_DOEPCTL_SODDFRM ((uint32_t)0x20000000) /*!< Set odd frame */
  7864. #define USB_OTG_DOEPCTL_EPTYP ((uint32_t)0x000C0000) /*!< Endpoint type */
  7865. #define USB_OTG_DOEPCTL_EPTYP_0 ((uint32_t)0x00040000) /*!<Bit 0 */
  7866. #define USB_OTG_DOEPCTL_EPTYP_1 ((uint32_t)0x00080000) /*!<Bit 1 */
  7867. #define USB_OTG_DOEPCTL_SNPM ((uint32_t)0x00100000) /*!< Snoop mode */
  7868. #define USB_OTG_DOEPCTL_STALL ((uint32_t)0x00200000) /*!< STALL handshake */
  7869. #define USB_OTG_DOEPCTL_CNAK ((uint32_t)0x04000000) /*!< Clear NAK */
  7870. #define USB_OTG_DOEPCTL_SNAK ((uint32_t)0x08000000) /*!< Set NAK */
  7871. #define USB_OTG_DOEPCTL_EPDIS ((uint32_t)0x40000000) /*!< Endpoint disable */
  7872. #define USB_OTG_DOEPCTL_EPENA ((uint32_t)0x80000000) /*!< Endpoint enable */
  7873. /******************** Bit definition for USB_OTG_DOEPINT register ********************/
  7874. #define USB_OTG_DOEPINT_XFRC ((uint32_t)0x00000001) /*!< Transfer completed interrupt */
  7875. #define USB_OTG_DOEPINT_EPDISD ((uint32_t)0x00000002) /*!< Endpoint disabled interrupt */
  7876. #define USB_OTG_DOEPINT_STUP ((uint32_t)0x00000008) /*!< SETUP phase done */
  7877. #define USB_OTG_DOEPINT_OTEPDIS ((uint32_t)0x00000010) /*!< OUT token received when endpoint disabled */
  7878. #define USB_OTG_DOEPINT_B2BSTUP ((uint32_t)0x00000040) /*!< Back-to-back SETUP packets received */
  7879. #define USB_OTG_DOEPINT_NYET ((uint32_t)0x00004000) /*!< NYET interrupt */
  7880. /******************** Bit definition for USB_OTG_DOEPTSIZ register ********************/
  7881. #define USB_OTG_DOEPTSIZ_XFRSIZ ((uint32_t)0x0007FFFF) /*!< Transfer size */
  7882. #define USB_OTG_DOEPTSIZ_PKTCNT ((uint32_t)0x1FF80000) /*!< Packet count */
  7883. #define USB_OTG_DOEPTSIZ_STUPCNT ((uint32_t)0x60000000) /*!< SETUP packet count */
  7884. #define USB_OTG_DOEPTSIZ_STUPCNT_0 ((uint32_t)0x20000000) /*!<Bit 0 */
  7885. #define USB_OTG_DOEPTSIZ_STUPCNT_1 ((uint32_t)0x40000000) /*!<Bit 1 */
  7886. /******************** Bit definition for PCGCCTL register ********************/
  7887. #define USB_OTG_PCGCCTL_STOPCLK ((uint32_t)0x00000001) /*!< SETUP packet count */
  7888. #define USB_OTG_PCGCCTL_GATECLK ((uint32_t)0x00000002) /*!<Bit 0 */
  7889. #define USB_OTG_PCGCCTL_PHYSUSP ((uint32_t)0x00000010) /*!<Bit 1 */
  7890. /**
  7891. * @}
  7892. */
  7893. /**
  7894. * @}
  7895. */
  7896. /** @addtogroup Exported_macros
  7897. * @{
  7898. */
  7899. /******************************* ADC Instances ********************************/
  7900. #define IS_ADC_ALL_INSTANCE(__INSTANCE__) (((__INSTANCE__) == ADC1) || \
  7901. ((__INSTANCE__) == ADC2) || \
  7902. ((__INSTANCE__) == ADC3))
  7903. /******************************* CAN Instances ********************************/
  7904. #define IS_CAN_ALL_INSTANCE(__INSTANCE__) (((__INSTANCE__) == CAN1) || \
  7905. ((__INSTANCE__) == CAN2))
  7906. /******************************* CRC Instances ********************************/
  7907. #define IS_CRC_ALL_INSTANCE(__INSTANCE__) ((__INSTANCE__) == CRC)
  7908. /******************************* DAC Instances ********************************/
  7909. #define IS_DAC_ALL_INSTANCE(__INSTANCE__) ((__INSTANCE__) == DAC)
  7910. /******************************* DCMI Instances *******************************/
  7911. #define IS_DCMI_ALL_INSTANCE(__INSTANCE__) ((__INSTANCE__) == DCMI)
  7912. /******************************* DMA2D Instances *******************************/
  7913. #define IS_DMA2D_ALL_INSTANCE(__INSTANCE__) ((__INSTANCE__) == DMA2D)
  7914. /******************************** DMA Instances *******************************/
  7915. #define IS_DMA_STREAM_ALL_INSTANCE(__INSTANCE__) (((__INSTANCE__) == DMA1_Stream0) || \
  7916. ((__INSTANCE__) == DMA1_Stream1) || \
  7917. ((__INSTANCE__) == DMA1_Stream2) || \
  7918. ((__INSTANCE__) == DMA1_Stream3) || \
  7919. ((__INSTANCE__) == DMA1_Stream4) || \
  7920. ((__INSTANCE__) == DMA1_Stream5) || \
  7921. ((__INSTANCE__) == DMA1_Stream6) || \
  7922. ((__INSTANCE__) == DMA1_Stream7) || \
  7923. ((__INSTANCE__) == DMA2_Stream0) || \
  7924. ((__INSTANCE__) == DMA2_Stream1) || \
  7925. ((__INSTANCE__) == DMA2_Stream2) || \
  7926. ((__INSTANCE__) == DMA2_Stream3) || \
  7927. ((__INSTANCE__) == DMA2_Stream4) || \
  7928. ((__INSTANCE__) == DMA2_Stream5) || \
  7929. ((__INSTANCE__) == DMA2_Stream6) || \
  7930. ((__INSTANCE__) == DMA2_Stream7))
  7931. /******************************* GPIO Instances *******************************/
  7932. #define IS_GPIO_ALL_INSTANCE(__INSTANCE__) (((__INSTANCE__) == GPIOA) || \
  7933. ((__INSTANCE__) == GPIOB) || \
  7934. ((__INSTANCE__) == GPIOC) || \
  7935. ((__INSTANCE__) == GPIOD) || \
  7936. ((__INSTANCE__) == GPIOE) || \
  7937. ((__INSTANCE__) == GPIOF) || \
  7938. ((__INSTANCE__) == GPIOG) || \
  7939. ((__INSTANCE__) == GPIOH) || \
  7940. ((__INSTANCE__) == GPIOI) || \
  7941. ((__INSTANCE__) == GPIOJ) || \
  7942. ((__INSTANCE__) == GPIOK))
  7943. #define IS_GPIO_AF_INSTANCE(__INSTANCE__) (((__INSTANCE__) == GPIOA) || \
  7944. ((__INSTANCE__) == GPIOB) || \
  7945. ((__INSTANCE__) == GPIOC) || \
  7946. ((__INSTANCE__) == GPIOD) || \
  7947. ((__INSTANCE__) == GPIOE) || \
  7948. ((__INSTANCE__) == GPIOF) || \
  7949. ((__INSTANCE__) == GPIOG) || \
  7950. ((__INSTANCE__) == GPIOH) || \
  7951. ((__INSTANCE__) == GPIOI) || \
  7952. ((__INSTANCE__) == GPIOJ) || \
  7953. ((__INSTANCE__) == GPIOK))
  7954. /****************************** CEC Instances *********************************/
  7955. #define IS_CEC_ALL_INSTANCE(__INSTANCE__) ((__INSTANCE__) == CEC)
  7956. /****************************** QSPI Instances *********************************/
  7957. #define IS_QSPI_ALL_INSTANCE(__INSTANCE__) ((__INSTANCE__) == QUADSPI)
  7958. /******************************** I2C Instances *******************************/
  7959. #define IS_I2C_ALL_INSTANCE(__INSTANCE__) (((__INSTANCE__) == I2C1) || \
  7960. ((__INSTANCE__) == I2C2) || \
  7961. ((__INSTANCE__) == I2C3) || \
  7962. ((__INSTANCE__) == I2C4))
  7963. /******************************** I2S Instances *******************************/
  7964. #define IS_I2S_ALL_INSTANCE(__INSTANCE__) (((__INSTANCE__) == SPI1) || \
  7965. ((__INSTANCE__) == SPI2) || \
  7966. ((__INSTANCE__) == SPI3))
  7967. /******************************* LPTIM Instances ********************************/
  7968. #define IS_LPTIM_INSTANCE(__INSTANCE__) ((__INSTANCE__) == LPTIM1)
  7969. /****************************** LTDC Instances ********************************/
  7970. #define IS_LTDC_ALL_INSTANCE(__INSTANCE__) ((__INSTANCE__) == LTDC)
  7971. /******************************* RNG Instances ********************************/
  7972. #define IS_RNG_ALL_INSTANCE(__INSTANCE__) ((__INSTANCE__) == RNG)
  7973. /****************************** RTC Instances *********************************/
  7974. #define IS_RTC_ALL_INSTANCE(__INSTANCE__) ((__INSTANCE__) == RTC)
  7975. /******************************* SAI Instances ********************************/
  7976. #define IS_SAI_BLOCK_PERIPH(__PERIPH__) (((__PERIPH__) == SAI1_Block_A) || \
  7977. ((__PERIPH__) == SAI1_Block_B) || \
  7978. ((__PERIPH__) == SAI2_Block_A) || \
  7979. ((__PERIPH__) == SAI2_Block_B))
  7980. /******************************** SDMMC Instances *******************************/
  7981. #define IS_SDMMC_ALL_INSTANCE(__INSTANCE__) ((__INSTANCE__) == SDMMC1)
  7982. /****************************** SPDIFRX Instances *********************************/
  7983. #define IS_SPDIFRX_ALL_INSTANCE(__INSTANCE__) ((__INSTANCE__) == SPDIFRX)
  7984. /******************************** SPI Instances *******************************/
  7985. #define IS_SPI_ALL_INSTANCE(__INSTANCE__) (((__INSTANCE__) == SPI1) || \
  7986. ((__INSTANCE__) == SPI2) || \
  7987. ((__INSTANCE__) == SPI3) || \
  7988. ((__INSTANCE__) == SPI4) || \
  7989. ((__INSTANCE__) == SPI5) || \
  7990. ((__INSTANCE__) == SPI6))
  7991. /****************** TIM Instances : All supported instances *******************/
  7992. #define IS_TIM_INSTANCE(__INSTANCE__) (((__INSTANCE__) == TIM1) || \
  7993. ((__INSTANCE__) == TIM2) || \
  7994. ((__INSTANCE__) == TIM3) || \
  7995. ((__INSTANCE__) == TIM4) || \
  7996. ((__INSTANCE__) == TIM5) || \
  7997. ((__INSTANCE__) == TIM6) || \
  7998. ((__INSTANCE__) == TIM7) || \
  7999. ((__INSTANCE__) == TIM8) || \
  8000. ((__INSTANCE__) == TIM9) || \
  8001. ((__INSTANCE__) == TIM10) || \
  8002. ((__INSTANCE__) == TIM11) || \
  8003. ((__INSTANCE__) == TIM12) || \
  8004. ((__INSTANCE__) == TIM13) || \
  8005. ((__INSTANCE__) == TIM14))
  8006. /************* TIM Instances : at least 1 capture/compare channel *************/
  8007. #define IS_TIM_CC1_INSTANCE(__INSTANCE__) (((__INSTANCE__) == TIM1) || \
  8008. ((__INSTANCE__) == TIM2) || \
  8009. ((__INSTANCE__) == TIM3) || \
  8010. ((__INSTANCE__) == TIM4) || \
  8011. ((__INSTANCE__) == TIM5) || \
  8012. ((__INSTANCE__) == TIM8) || \
  8013. ((__INSTANCE__) == TIM9) || \
  8014. ((__INSTANCE__) == TIM10) || \
  8015. ((__INSTANCE__) == TIM11) || \
  8016. ((__INSTANCE__) == TIM12) || \
  8017. ((__INSTANCE__) == TIM13) || \
  8018. ((__INSTANCE__) == TIM14))
  8019. /************ TIM Instances : at least 2 capture/compare channels *************/
  8020. #define IS_TIM_CC2_INSTANCE(__INSTANCE__) (((__INSTANCE__) == TIM1) || \
  8021. ((__INSTANCE__) == TIM2) || \
  8022. ((__INSTANCE__) == TIM3) || \
  8023. ((__INSTANCE__) == TIM4) || \
  8024. ((__INSTANCE__) == TIM5) || \
  8025. ((__INSTANCE__) == TIM8) || \
  8026. ((__INSTANCE__) == TIM9) || \
  8027. ((__INSTANCE__) == TIM12))
  8028. /************ TIM Instances : at least 3 capture/compare channels *************/
  8029. #define IS_TIM_CC3_INSTANCE(__INSTANCE__) (((__INSTANCE__) == TIM1) || \
  8030. ((__INSTANCE__) == TIM2) || \
  8031. ((__INSTANCE__) == TIM3) || \
  8032. ((__INSTANCE__) == TIM4) || \
  8033. ((__INSTANCE__) == TIM5) || \
  8034. ((__INSTANCE__) == TIM8))
  8035. /************ TIM Instances : at least 4 capture/compare channels *************/
  8036. #define IS_TIM_CC4_INSTANCE(__INSTANCE__) (((__INSTANCE__) == TIM1) || \
  8037. ((__INSTANCE__) == TIM2) || \
  8038. ((__INSTANCE__) == TIM3) || \
  8039. ((__INSTANCE__) == TIM4) || \
  8040. ((__INSTANCE__) == TIM5) || \
  8041. ((__INSTANCE__) == TIM8))
  8042. /****************** TIM Instances : supporting combined 3-phase PWM mode ******/
  8043. #define IS_TIM_COMBINED3PHASEPWM_INSTANCE(__INSTANCE__) \
  8044. (((__INSTANCE__) == TIM1) || \
  8045. ((__INSTANCE__) == TIM8))
  8046. /****************** TIM Instances : supporting OCxREF clear *******************/
  8047. #define IS_TIM_OCXREF_CLEAR_INSTANCE(__INSTANCE__)\
  8048. (((__INSTANCE__) == TIM1) || \
  8049. ((__INSTANCE__) == TIM2) || \
  8050. ((__INSTANCE__) == TIM3) || \
  8051. ((__INSTANCE__) == TIM4) || \
  8052. ((__INSTANCE__) == TIM8))
  8053. /****************** TIM Instances : supporting external clock mode 1 for TIX inputs*/
  8054. #define IS_TIM_CLOCKSOURCE_TIX_INSTANCE(__INSTANCE__)\
  8055. (((__INSTANCE__) == TIM1) || \
  8056. ((__INSTANCE__) == TIM2) || \
  8057. ((__INSTANCE__) == TIM3) || \
  8058. ((__INSTANCE__) == TIM4) || \
  8059. ((__INSTANCE__) == TIM5) || \
  8060. ((__INSTANCE__) == TIM8))
  8061. /****************** TIM Instances : supporting internal trigger inputs(ITRX) *******/
  8062. #define IS_TIM_CLOCKSOURCE_ITRX_INSTANCE(__INSTANCE__)\
  8063. (((__INSTANCE__) == TIM1) || \
  8064. ((__INSTANCE__) == TIM2) || \
  8065. ((__INSTANCE__) == TIM3) || \
  8066. ((__INSTANCE__) == TIM4) || \
  8067. ((__INSTANCE__) == TIM5) || \
  8068. ((__INSTANCE__) == TIM8))
  8069. /****************** TIM Instances : at least 5 capture/compare channels *******/
  8070. #define IS_TIM_CC5_INSTANCE(__INSTANCE__)\
  8071. (((__INSTANCE__) == TIM1) || \
  8072. ((__INSTANCE__) == TIM8) )
  8073. /****************** TIM Instances : at least 6 capture/compare channels *******/
  8074. #define IS_TIM_CC6_INSTANCE(__INSTANCE__)\
  8075. (((__INSTANCE__) == TIM1) || \
  8076. ((__INSTANCE__) == TIM8))
  8077. /******************** TIM Instances : Advanced-control timers *****************/
  8078. #define IS_TIM_ADVANCED_INSTANCE(__INSTANCE__) (((__INSTANCE__) == TIM1) || \
  8079. ((__INSTANCE__) == TIM8))
  8080. /****************** TIM Instances : supporting 2 break inputs *****************/
  8081. #define IS_TIM_BREAK_INSTANCE(__INSTANCE__)\
  8082. (((__INSTANCE__) == TIM1) || \
  8083. ((__INSTANCE__) == TIM8))
  8084. /******************* TIM Instances : Timer input XOR function *****************/
  8085. #define IS_TIM_XOR_INSTANCE(__INSTANCE__) (((__INSTANCE__) == TIM1) || \
  8086. ((__INSTANCE__) == TIM2) || \
  8087. ((__INSTANCE__) == TIM3) || \
  8088. ((__INSTANCE__) == TIM4) || \
  8089. ((__INSTANCE__) == TIM5) || \
  8090. ((__INSTANCE__) == TIM8))
  8091. /****************** TIM Instances : DMA requests generation (UDE) *************/
  8092. #define IS_TIM_DMA_INSTANCE(__INSTANCE__) (((__INSTANCE__) == TIM1) || \
  8093. ((__INSTANCE__) == TIM2) || \
  8094. ((__INSTANCE__) == TIM3) || \
  8095. ((__INSTANCE__) == TIM4) || \
  8096. ((__INSTANCE__) == TIM5) || \
  8097. ((__INSTANCE__) == TIM6) || \
  8098. ((__INSTANCE__) == TIM7) || \
  8099. ((__INSTANCE__) == TIM8))
  8100. /************ TIM Instances : DMA requests generation (CCxDE) *****************/
  8101. #define IS_TIM_DMA_CC_INSTANCE(__INSTANCE__) (((__INSTANCE__) == TIM1) || \
  8102. ((__INSTANCE__) == TIM2) || \
  8103. ((__INSTANCE__) == TIM3) || \
  8104. ((__INSTANCE__) == TIM4) || \
  8105. ((__INSTANCE__) == TIM5) || \
  8106. ((__INSTANCE__) == TIM8))
  8107. /************ TIM Instances : DMA requests generation (COMDE) *****************/
  8108. #define IS_TIM_CCDMA_INSTANCE(__INSTANCE__) (((__INSTANCE__) == TIM1) || \
  8109. ((__INSTANCE__) == TIM2) || \
  8110. ((__INSTANCE__) == TIM3) || \
  8111. ((__INSTANCE__) == TIM4) || \
  8112. ((__INSTANCE__) == TIM5) || \
  8113. ((__INSTANCE__) == TIM8))
  8114. /******************** TIM Instances : DMA burst feature ***********************/
  8115. #define IS_TIM_DMABURST_INSTANCE(__INSTANCE__) (((__INSTANCE__) == TIM1) || \
  8116. ((__INSTANCE__) == TIM2) || \
  8117. ((__INSTANCE__) == TIM3) || \
  8118. ((__INSTANCE__) == TIM4) || \
  8119. ((__INSTANCE__) == TIM5) || \
  8120. ((__INSTANCE__) == TIM8))
  8121. /****** TIM Instances : master mode available (TIMx_CR2.MMS available )********/
  8122. #define IS_TIM_MASTER_INSTANCE(__INSTANCE__) (((__INSTANCE__) == TIM1) || \
  8123. ((__INSTANCE__) == TIM2) || \
  8124. ((__INSTANCE__) == TIM3) || \
  8125. ((__INSTANCE__) == TIM4) || \
  8126. ((__INSTANCE__) == TIM5) || \
  8127. ((__INSTANCE__) == TIM6) || \
  8128. ((__INSTANCE__) == TIM7) || \
  8129. ((__INSTANCE__) == TIM8) || \
  8130. ((__INSTANCE__) == TIM13) || \
  8131. ((__INSTANCE__) == TIM14))
  8132. /*********** TIM Instances : Slave mode available (TIMx_SMCR available )*******/
  8133. #define IS_TIM_SLAVE_INSTANCE(__INSTANCE__) (((__INSTANCE__) == TIM1) || \
  8134. ((__INSTANCE__) == TIM2) || \
  8135. ((__INSTANCE__) == TIM3) || \
  8136. ((__INSTANCE__) == TIM4) || \
  8137. ((__INSTANCE__) == TIM5) || \
  8138. ((__INSTANCE__) == TIM8) || \
  8139. ((__INSTANCE__) == TIM9) || \
  8140. ((__INSTANCE__) == TIM12))
  8141. /********************** TIM Instances : 32 bit Counter ************************/
  8142. #define IS_TIM_32B_COUNTER_INSTANCE(__INSTANCE__)(((__INSTANCE__) == TIM2) || \
  8143. ((__INSTANCE__) == TIM5))
  8144. /***************** TIM Instances : external trigger input available ************/
  8145. #define IS_TIM_ETR_INSTANCE(__INSTANCE__) (((__INSTANCE__) == TIM1) || \
  8146. ((__INSTANCE__) == TIM2) || \
  8147. ((__INSTANCE__) == TIM3) || \
  8148. ((__INSTANCE__) == TIM4) || \
  8149. ((__INSTANCE__) == TIM5) || \
  8150. ((__INSTANCE__) == TIM8))
  8151. /****************** TIM Instances : remapping capability **********************/
  8152. #define IS_TIM_REMAP_INSTANCE(__INSTANCE__) (((__INSTANCE__) == TIM2) || \
  8153. ((__INSTANCE__) == TIM5) || \
  8154. ((__INSTANCE__) == TIM11))
  8155. /******************* TIM Instances : output(s) available **********************/
  8156. #define IS_TIM_CCX_INSTANCE(__INSTANCE__, __CHANNEL__) \
  8157. ((((__INSTANCE__) == TIM1) && \
  8158. (((__CHANNEL__) == TIM_CHANNEL_1) || \
  8159. ((__CHANNEL__) == TIM_CHANNEL_2) || \
  8160. ((__CHANNEL__) == TIM_CHANNEL_3) || \
  8161. ((__CHANNEL__) == TIM_CHANNEL_4))) \
  8162. || \
  8163. (((__INSTANCE__) == TIM2) && \
  8164. (((__CHANNEL__) == TIM_CHANNEL_1) || \
  8165. ((__CHANNEL__) == TIM_CHANNEL_2) || \
  8166. ((__CHANNEL__) == TIM_CHANNEL_3) || \
  8167. ((__CHANNEL__) == TIM_CHANNEL_4))) \
  8168. || \
  8169. (((__INSTANCE__) == TIM3) && \
  8170. (((__CHANNEL__) == TIM_CHANNEL_1) || \
  8171. ((__CHANNEL__) == TIM_CHANNEL_2) || \
  8172. ((__CHANNEL__) == TIM_CHANNEL_3) || \
  8173. ((__CHANNEL__) == TIM_CHANNEL_4))) \
  8174. || \
  8175. (((__INSTANCE__) == TIM4) && \
  8176. (((__CHANNEL__) == TIM_CHANNEL_1) || \
  8177. ((__CHANNEL__) == TIM_CHANNEL_2) || \
  8178. ((__CHANNEL__) == TIM_CHANNEL_3) || \
  8179. ((__CHANNEL__) == TIM_CHANNEL_4))) \
  8180. || \
  8181. (((__INSTANCE__) == TIM5) && \
  8182. (((__CHANNEL__) == TIM_CHANNEL_1) || \
  8183. ((__CHANNEL__) == TIM_CHANNEL_2) || \
  8184. ((__CHANNEL__) == TIM_CHANNEL_3) || \
  8185. ((__CHANNEL__) == TIM_CHANNEL_4))) \
  8186. || \
  8187. (((__INSTANCE__) == TIM8) && \
  8188. (((__CHANNEL__) == TIM_CHANNEL_1) || \
  8189. ((__CHANNEL__) == TIM_CHANNEL_2) || \
  8190. ((__CHANNEL__) == TIM_CHANNEL_3) || \
  8191. ((__CHANNEL__) == TIM_CHANNEL_4))) \
  8192. || \
  8193. (((__INSTANCE__) == TIM9) && \
  8194. (((__CHANNEL__) == TIM_CHANNEL_1) || \
  8195. ((__CHANNEL__) == TIM_CHANNEL_2))) \
  8196. || \
  8197. (((__INSTANCE__) == TIM10) && \
  8198. (((__CHANNEL__) == TIM_CHANNEL_1))) \
  8199. || \
  8200. (((__INSTANCE__) == TIM11) && \
  8201. (((__CHANNEL__) == TIM_CHANNEL_1))) \
  8202. || \
  8203. (((__INSTANCE__) == TIM12) && \
  8204. (((__CHANNEL__) == TIM_CHANNEL_1) || \
  8205. ((__CHANNEL__) == TIM_CHANNEL_2))) \
  8206. || \
  8207. (((__INSTANCE__) == TIM13) && \
  8208. (((__CHANNEL__) == TIM_CHANNEL_1))) \
  8209. || \
  8210. (((__INSTANCE__) == TIM14) && \
  8211. (((__CHANNEL__) == TIM_CHANNEL_1))))
  8212. /************ TIM Instances : complementary output(s) available ***************/
  8213. #define IS_TIM_CCXN_INSTANCE(__INSTANCE__, __CHANNEL__) \
  8214. ((((__INSTANCE__) == TIM1) && \
  8215. (((__CHANNEL__) == TIM_CHANNEL_1) || \
  8216. ((__CHANNEL__) == TIM_CHANNEL_2) || \
  8217. ((__CHANNEL__) == TIM_CHANNEL_3))) \
  8218. || \
  8219. (((__INSTANCE__) == TIM8) && \
  8220. (((__CHANNEL__) == TIM_CHANNEL_1) || \
  8221. ((__CHANNEL__) == TIM_CHANNEL_2) || \
  8222. ((__CHANNEL__) == TIM_CHANNEL_3))))
  8223. /****************** TIM Instances : supporting ADC triggering through TRGO2 ***/
  8224. #define IS_TIM_TRGO2_INSTANCE(__INSTANCE__)\
  8225. (((__INSTANCE__) == TIM1) || \
  8226. ((__INSTANCE__) == TIM8) )
  8227. /****************** TIM Instances : supporting synchronization ****************/
  8228. #define IS_TIM_SYNCHRO_INSTANCE(__INSTANCE__)\
  8229. (((__INSTANCE__) == TIM1) || \
  8230. ((__INSTANCE__) == TIM2) || \
  8231. ((__INSTANCE__) == TIM3) || \
  8232. ((__INSTANCE__) == TIM4) || \
  8233. ((__INSTANCE__) == TIM5) || \
  8234. ((__INSTANCE__) == TIM6) || \
  8235. ((__INSTANCE__) == TIM7) || \
  8236. ((__INSTANCE__) == TIM8))
  8237. /******************** USART Instances : Synchronous mode **********************/
  8238. #define IS_USART_INSTANCE(__INSTANCE__) (((__INSTANCE__) == USART1) || \
  8239. ((__INSTANCE__) == USART2) || \
  8240. ((__INSTANCE__) == USART3) || \
  8241. ((__INSTANCE__) == USART6))
  8242. /******************** UART Instances : Asynchronous mode **********************/
  8243. #define IS_UART_INSTANCE(__INSTANCE__) (((__INSTANCE__) == USART1) || \
  8244. ((__INSTANCE__) == USART2) || \
  8245. ((__INSTANCE__) == USART3) || \
  8246. ((__INSTANCE__) == UART4) || \
  8247. ((__INSTANCE__) == UART5) || \
  8248. ((__INSTANCE__) == USART6) || \
  8249. ((__INSTANCE__) == UART7) || \
  8250. ((__INSTANCE__) == UART8))
  8251. /****************** UART Instances : Hardware Flow control ********************/
  8252. #define IS_UART_HWFLOW_INSTANCE(__INSTANCE__) (((__INSTANCE__) == USART1) || \
  8253. ((__INSTANCE__) == USART2) || \
  8254. ((__INSTANCE__) == USART3) || \
  8255. ((__INSTANCE__) == UART4) || \
  8256. ((__INSTANCE__) == UART5) || \
  8257. ((__INSTANCE__) == USART6) || \
  8258. ((__INSTANCE__) == UART7) || \
  8259. ((__INSTANCE__) == UART8))
  8260. /********************* UART Instances : Smart card mode ***********************/
  8261. #define IS_SMARTCARD_INSTANCE(__INSTANCE__) (((__INSTANCE__) == USART1) || \
  8262. ((__INSTANCE__) == USART2) || \
  8263. ((__INSTANCE__) == USART3) || \
  8264. ((__INSTANCE__) == USART6))
  8265. /*********************** UART Instances : IRDA mode ***************************/
  8266. #define IS_IRDA_INSTANCE(__INSTANCE__) (((__INSTANCE__) == USART1) || \
  8267. ((__INSTANCE__) == USART2) || \
  8268. ((__INSTANCE__) == USART3) || \
  8269. ((__INSTANCE__) == UART4) || \
  8270. ((__INSTANCE__) == UART5) || \
  8271. ((__INSTANCE__) == USART6) || \
  8272. ((__INSTANCE__) == UART7) || \
  8273. ((__INSTANCE__) == UART8))
  8274. /****************************** IWDG Instances ********************************/
  8275. #define IS_IWDG_ALL_INSTANCE(__INSTANCE__) ((__INSTANCE__) == IWDG)
  8276. /****************************** WWDG Instances ********************************/
  8277. #define IS_WWDG_ALL_INSTANCE(__INSTANCE__) ((__INSTANCE__) == WWDG)
  8278. /******************************************************************************/
  8279. /* For a painless codes migration between the STM32F7xx device product */
  8280. /* lines, the aliases defined below are put in place to overcome the */
  8281. /* differences in the interrupt handlers and IRQn definitions. */
  8282. /* No need to update developed interrupt code when moving across */
  8283. /* product lines within the same STM32F7 Family */
  8284. /******************************************************************************/
  8285. /* Aliases for __IRQn */
  8286. #define HASH_RNG_IRQn RNG_IRQn
  8287. /* Aliases for __IRQHandler */
  8288. #define HASH_RNG_IRQHandler RNG_IRQHandler
  8289. /**
  8290. * @}
  8291. */
  8292. /**
  8293. * @}
  8294. */
  8295. /**
  8296. * @}
  8297. */
  8298. #ifdef __cplusplus
  8299. }
  8300. #endif /* __cplusplus */
  8301. #endif /* __STM32F746xx_H */
  8302. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/