stm32f437xx.h 665 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992
  1. /**
  2. ******************************************************************************
  3. * @file stm32f437xx.h
  4. * @author MCD Application Team
  5. * @version V2.4.2
  6. * @date 13-November-2015
  7. * @brief CMSIS STM32F437xx 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 stm32f437xx
  47. * @{
  48. */
  49. #ifndef __STM32F437xx_H
  50. #define __STM32F437xx_H
  51. #ifdef __cplusplus
  52. extern "C" {
  53. #endif /* __cplusplus */
  54. /** @addtogroup Configuration_section_for_CMSIS
  55. * @{
  56. */
  57. /**
  58. * @brief Configuration of the Cortex-M4 Processor and Core Peripherals
  59. */
  60. #define __CM4_REV 0x0001 /*!< Core revision r0p1 */
  61. #define __MPU_PRESENT 1 /*!< STM32F4XX provides an MPU */
  62. #define __NVIC_PRIO_BITS 4 /*!< STM32F4XX uses 4 Bits for the Priority Levels */
  63. #define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
  64. #define __FPU_PRESENT 1 /*!< FPU present */
  65. /**
  66. * @}
  67. */
  68. /** @addtogroup Peripheral_interrupt_number_definition
  69. * @{
  70. */
  71. /**
  72. * @brief STM32F4XX Interrupt Number Definition, according to the selected device
  73. * in @ref Library_configuration_section
  74. */
  75. typedef enum
  76. {
  77. /****** Cortex-M4 Processor Exceptions Numbers ****************************************************************/
  78. NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */
  79. MemoryManagement_IRQn = -12, /*!< 4 Cortex-M4 Memory Management Interrupt */
  80. BusFault_IRQn = -11, /*!< 5 Cortex-M4 Bus Fault Interrupt */
  81. UsageFault_IRQn = -10, /*!< 6 Cortex-M4 Usage Fault Interrupt */
  82. SVCall_IRQn = -5, /*!< 11 Cortex-M4 SV Call Interrupt */
  83. DebugMonitor_IRQn = -4, /*!< 12 Cortex-M4 Debug Monitor Interrupt */
  84. PendSV_IRQn = -2, /*!< 14 Cortex-M4 Pend SV Interrupt */
  85. SysTick_IRQn = -1, /*!< 15 Cortex-M4 System Tick Interrupt */
  86. /****** STM32 specific Interrupt Numbers **********************************************************************/
  87. WWDG_IRQn = 0, /*!< Window WatchDog Interrupt */
  88. PVD_IRQn = 1, /*!< PVD through EXTI Line detection Interrupt */
  89. TAMP_STAMP_IRQn = 2, /*!< Tamper and TimeStamp interrupts through the EXTI line */
  90. RTC_WKUP_IRQn = 3, /*!< RTC Wakeup interrupt through the EXTI line */
  91. FLASH_IRQn = 4, /*!< FLASH global Interrupt */
  92. RCC_IRQn = 5, /*!< RCC global Interrupt */
  93. EXTI0_IRQn = 6, /*!< EXTI Line0 Interrupt */
  94. EXTI1_IRQn = 7, /*!< EXTI Line1 Interrupt */
  95. EXTI2_IRQn = 8, /*!< EXTI Line2 Interrupt */
  96. EXTI3_IRQn = 9, /*!< EXTI Line3 Interrupt */
  97. EXTI4_IRQn = 10, /*!< EXTI Line4 Interrupt */
  98. DMA1_Stream0_IRQn = 11, /*!< DMA1 Stream 0 global Interrupt */
  99. DMA1_Stream1_IRQn = 12, /*!< DMA1 Stream 1 global Interrupt */
  100. DMA1_Stream2_IRQn = 13, /*!< DMA1 Stream 2 global Interrupt */
  101. DMA1_Stream3_IRQn = 14, /*!< DMA1 Stream 3 global Interrupt */
  102. DMA1_Stream4_IRQn = 15, /*!< DMA1 Stream 4 global Interrupt */
  103. DMA1_Stream5_IRQn = 16, /*!< DMA1 Stream 5 global Interrupt */
  104. DMA1_Stream6_IRQn = 17, /*!< DMA1 Stream 6 global Interrupt */
  105. ADC_IRQn = 18, /*!< ADC1, ADC2 and ADC3 global Interrupts */
  106. CAN1_TX_IRQn = 19, /*!< CAN1 TX Interrupt */
  107. CAN1_RX0_IRQn = 20, /*!< CAN1 RX0 Interrupt */
  108. CAN1_RX1_IRQn = 21, /*!< CAN1 RX1 Interrupt */
  109. CAN1_SCE_IRQn = 22, /*!< CAN1 SCE Interrupt */
  110. EXTI9_5_IRQn = 23, /*!< External Line[9:5] Interrupts */
  111. TIM1_BRK_TIM9_IRQn = 24, /*!< TIM1 Break interrupt and TIM9 global interrupt */
  112. TIM1_UP_TIM10_IRQn = 25, /*!< TIM1 Update Interrupt and TIM10 global interrupt */
  113. TIM1_TRG_COM_TIM11_IRQn = 26, /*!< TIM1 Trigger and Commutation Interrupt and TIM11 global interrupt */
  114. TIM1_CC_IRQn = 27, /*!< TIM1 Capture Compare Interrupt */
  115. TIM2_IRQn = 28, /*!< TIM2 global Interrupt */
  116. TIM3_IRQn = 29, /*!< TIM3 global Interrupt */
  117. TIM4_IRQn = 30, /*!< TIM4 global Interrupt */
  118. I2C1_EV_IRQn = 31, /*!< I2C1 Event Interrupt */
  119. I2C1_ER_IRQn = 32, /*!< I2C1 Error Interrupt */
  120. I2C2_EV_IRQn = 33, /*!< I2C2 Event Interrupt */
  121. I2C2_ER_IRQn = 34, /*!< I2C2 Error Interrupt */
  122. SPI1_IRQn = 35, /*!< SPI1 global Interrupt */
  123. SPI2_IRQn = 36, /*!< SPI2 global Interrupt */
  124. USART1_IRQn = 37, /*!< USART1 global Interrupt */
  125. USART2_IRQn = 38, /*!< USART2 global Interrupt */
  126. USART3_IRQn = 39, /*!< USART3 global Interrupt */
  127. EXTI15_10_IRQn = 40, /*!< External Line[15:10] Interrupts */
  128. RTC_Alarm_IRQn = 41, /*!< RTC Alarm (A and B) through EXTI Line Interrupt */
  129. OTG_FS_WKUP_IRQn = 42, /*!< USB OTG FS Wakeup through EXTI line interrupt */
  130. TIM8_BRK_TIM12_IRQn = 43, /*!< TIM8 Break Interrupt and TIM12 global interrupt */
  131. TIM8_UP_TIM13_IRQn = 44, /*!< TIM8 Update Interrupt and TIM13 global interrupt */
  132. TIM8_TRG_COM_TIM14_IRQn = 45, /*!< TIM8 Trigger and Commutation Interrupt and TIM14 global interrupt */
  133. TIM8_CC_IRQn = 46, /*!< TIM8 Capture Compare Interrupt */
  134. DMA1_Stream7_IRQn = 47, /*!< DMA1 Stream7 Interrupt */
  135. FMC_IRQn = 48, /*!< FMC global Interrupt */
  136. SDIO_IRQn = 49, /*!< SDIO global Interrupt */
  137. TIM5_IRQn = 50, /*!< TIM5 global Interrupt */
  138. SPI3_IRQn = 51, /*!< SPI3 global Interrupt */
  139. UART4_IRQn = 52, /*!< UART4 global Interrupt */
  140. UART5_IRQn = 53, /*!< UART5 global Interrupt */
  141. TIM6_DAC_IRQn = 54, /*!< TIM6 global and DAC1&2 underrun error interrupts */
  142. TIM7_IRQn = 55, /*!< TIM7 global interrupt */
  143. DMA2_Stream0_IRQn = 56, /*!< DMA2 Stream 0 global Interrupt */
  144. DMA2_Stream1_IRQn = 57, /*!< DMA2 Stream 1 global Interrupt */
  145. DMA2_Stream2_IRQn = 58, /*!< DMA2 Stream 2 global Interrupt */
  146. DMA2_Stream3_IRQn = 59, /*!< DMA2 Stream 3 global Interrupt */
  147. DMA2_Stream4_IRQn = 60, /*!< DMA2 Stream 4 global Interrupt */
  148. ETH_IRQn = 61, /*!< Ethernet global Interrupt */
  149. ETH_WKUP_IRQn = 62, /*!< Ethernet Wakeup through EXTI line Interrupt */
  150. CAN2_TX_IRQn = 63, /*!< CAN2 TX Interrupt */
  151. CAN2_RX0_IRQn = 64, /*!< CAN2 RX0 Interrupt */
  152. CAN2_RX1_IRQn = 65, /*!< CAN2 RX1 Interrupt */
  153. CAN2_SCE_IRQn = 66, /*!< CAN2 SCE Interrupt */
  154. OTG_FS_IRQn = 67, /*!< USB OTG FS global Interrupt */
  155. DMA2_Stream5_IRQn = 68, /*!< DMA2 Stream 5 global interrupt */
  156. DMA2_Stream6_IRQn = 69, /*!< DMA2 Stream 6 global interrupt */
  157. DMA2_Stream7_IRQn = 70, /*!< DMA2 Stream 7 global interrupt */
  158. USART6_IRQn = 71, /*!< USART6 global interrupt */
  159. I2C3_EV_IRQn = 72, /*!< I2C3 event interrupt */
  160. I2C3_ER_IRQn = 73, /*!< I2C3 error interrupt */
  161. OTG_HS_EP1_OUT_IRQn = 74, /*!< USB OTG HS End Point 1 Out global interrupt */
  162. OTG_HS_EP1_IN_IRQn = 75, /*!< USB OTG HS End Point 1 In global interrupt */
  163. OTG_HS_WKUP_IRQn = 76, /*!< USB OTG HS Wakeup through EXTI interrupt */
  164. OTG_HS_IRQn = 77, /*!< USB OTG HS global interrupt */
  165. DCMI_IRQn = 78, /*!< DCMI global interrupt */
  166. CRYP_IRQn = 79, /*!< CRYP crypto global interrupt */
  167. HASH_RNG_IRQn = 80, /*!< Hash and Rng global interrupt */
  168. FPU_IRQn = 81, /*!< FPU global interrupt */
  169. UART7_IRQn = 82, /*!< UART7 global interrupt */
  170. UART8_IRQn = 83, /*!< UART8 global interrupt */
  171. SPI4_IRQn = 84, /*!< SPI4 global Interrupt */
  172. SPI5_IRQn = 85, /*!< SPI5 global Interrupt */
  173. SPI6_IRQn = 86, /*!< SPI6 global Interrupt */
  174. SAI1_IRQn = 87, /*!< SAI1 global Interrupt */
  175. DMA2D_IRQn = 90 /*!< DMA2D global Interrupt */
  176. } IRQn_Type;
  177. /**
  178. * @}
  179. */
  180. #include "core_cm4.h" /* Cortex-M4 processor and core peripherals */
  181. #include "system_stm32f4xx.h"
  182. #include <stdint.h>
  183. /** @addtogroup Peripheral_registers_structures
  184. * @{
  185. */
  186. /**
  187. * @brief Analog to Digital Converter
  188. */
  189. typedef struct
  190. {
  191. __IO uint32_t SR; /*!< ADC status register, Address offset: 0x00 */
  192. __IO uint32_t CR1; /*!< ADC control register 1, Address offset: 0x04 */
  193. __IO uint32_t CR2; /*!< ADC control register 2, Address offset: 0x08 */
  194. __IO uint32_t SMPR1; /*!< ADC sample time register 1, Address offset: 0x0C */
  195. __IO uint32_t SMPR2; /*!< ADC sample time register 2, Address offset: 0x10 */
  196. __IO uint32_t JOFR1; /*!< ADC injected channel data offset register 1, Address offset: 0x14 */
  197. __IO uint32_t JOFR2; /*!< ADC injected channel data offset register 2, Address offset: 0x18 */
  198. __IO uint32_t JOFR3; /*!< ADC injected channel data offset register 3, Address offset: 0x1C */
  199. __IO uint32_t JOFR4; /*!< ADC injected channel data offset register 4, Address offset: 0x20 */
  200. __IO uint32_t HTR; /*!< ADC watchdog higher threshold register, Address offset: 0x24 */
  201. __IO uint32_t LTR; /*!< ADC watchdog lower threshold register, Address offset: 0x28 */
  202. __IO uint32_t SQR1; /*!< ADC regular sequence register 1, Address offset: 0x2C */
  203. __IO uint32_t SQR2; /*!< ADC regular sequence register 2, Address offset: 0x30 */
  204. __IO uint32_t SQR3; /*!< ADC regular sequence register 3, Address offset: 0x34 */
  205. __IO uint32_t JSQR; /*!< ADC injected sequence register, Address offset: 0x38*/
  206. __IO uint32_t JDR1; /*!< ADC injected data register 1, Address offset: 0x3C */
  207. __IO uint32_t JDR2; /*!< ADC injected data register 2, Address offset: 0x40 */
  208. __IO uint32_t JDR3; /*!< ADC injected data register 3, Address offset: 0x44 */
  209. __IO uint32_t JDR4; /*!< ADC injected data register 4, Address offset: 0x48 */
  210. __IO uint32_t DR; /*!< ADC regular data register, Address offset: 0x4C */
  211. } ADC_TypeDef;
  212. typedef struct
  213. {
  214. __IO uint32_t CSR; /*!< ADC Common status register, Address offset: ADC1 base address + 0x300 */
  215. __IO uint32_t CCR; /*!< ADC common control register, Address offset: ADC1 base address + 0x304 */
  216. __IO uint32_t CDR; /*!< ADC common regular data register for dual
  217. AND triple modes, Address offset: ADC1 base address + 0x308 */
  218. } ADC_Common_TypeDef;
  219. /**
  220. * @brief Controller Area Network TxMailBox
  221. */
  222. typedef struct
  223. {
  224. __IO uint32_t TIR; /*!< CAN TX mailbox identifier register */
  225. __IO uint32_t TDTR; /*!< CAN mailbox data length control and time stamp register */
  226. __IO uint32_t TDLR; /*!< CAN mailbox data low register */
  227. __IO uint32_t TDHR; /*!< CAN mailbox data high register */
  228. } CAN_TxMailBox_TypeDef;
  229. /**
  230. * @brief Controller Area Network FIFOMailBox
  231. */
  232. typedef struct
  233. {
  234. __IO uint32_t RIR; /*!< CAN receive FIFO mailbox identifier register */
  235. __IO uint32_t RDTR; /*!< CAN receive FIFO mailbox data length control and time stamp register */
  236. __IO uint32_t RDLR; /*!< CAN receive FIFO mailbox data low register */
  237. __IO uint32_t RDHR; /*!< CAN receive FIFO mailbox data high register */
  238. } CAN_FIFOMailBox_TypeDef;
  239. /**
  240. * @brief Controller Area Network FilterRegister
  241. */
  242. typedef struct
  243. {
  244. __IO uint32_t FR1; /*!< CAN Filter bank register 1 */
  245. __IO uint32_t FR2; /*!< CAN Filter bank register 1 */
  246. } CAN_FilterRegister_TypeDef;
  247. /**
  248. * @brief Controller Area Network
  249. */
  250. typedef struct
  251. {
  252. __IO uint32_t MCR; /*!< CAN master control register, Address offset: 0x00 */
  253. __IO uint32_t MSR; /*!< CAN master status register, Address offset: 0x04 */
  254. __IO uint32_t TSR; /*!< CAN transmit status register, Address offset: 0x08 */
  255. __IO uint32_t RF0R; /*!< CAN receive FIFO 0 register, Address offset: 0x0C */
  256. __IO uint32_t RF1R; /*!< CAN receive FIFO 1 register, Address offset: 0x10 */
  257. __IO uint32_t IER; /*!< CAN interrupt enable register, Address offset: 0x14 */
  258. __IO uint32_t ESR; /*!< CAN error status register, Address offset: 0x18 */
  259. __IO uint32_t BTR; /*!< CAN bit timing register, Address offset: 0x1C */
  260. uint32_t RESERVED0[88]; /*!< Reserved, 0x020 - 0x17F */
  261. CAN_TxMailBox_TypeDef sTxMailBox[3]; /*!< CAN Tx MailBox, Address offset: 0x180 - 0x1AC */
  262. CAN_FIFOMailBox_TypeDef sFIFOMailBox[2]; /*!< CAN FIFO MailBox, Address offset: 0x1B0 - 0x1CC */
  263. uint32_t RESERVED1[12]; /*!< Reserved, 0x1D0 - 0x1FF */
  264. __IO uint32_t FMR; /*!< CAN filter master register, Address offset: 0x200 */
  265. __IO uint32_t FM1R; /*!< CAN filter mode register, Address offset: 0x204 */
  266. uint32_t RESERVED2; /*!< Reserved, 0x208 */
  267. __IO uint32_t FS1R; /*!< CAN filter scale register, Address offset: 0x20C */
  268. uint32_t RESERVED3; /*!< Reserved, 0x210 */
  269. __IO uint32_t FFA1R; /*!< CAN filter FIFO assignment register, Address offset: 0x214 */
  270. uint32_t RESERVED4; /*!< Reserved, 0x218 */
  271. __IO uint32_t FA1R; /*!< CAN filter activation register, Address offset: 0x21C */
  272. uint32_t RESERVED5[8]; /*!< Reserved, 0x220-0x23F */
  273. CAN_FilterRegister_TypeDef sFilterRegister[28]; /*!< CAN Filter Register, Address offset: 0x240-0x31C */
  274. } CAN_TypeDef;
  275. /**
  276. * @brief CRC calculation unit
  277. */
  278. typedef struct
  279. {
  280. __IO uint32_t DR; /*!< CRC Data register, Address offset: 0x00 */
  281. __IO uint8_t IDR; /*!< CRC Independent data register, Address offset: 0x04 */
  282. uint8_t RESERVED0; /*!< Reserved, 0x05 */
  283. uint16_t RESERVED1; /*!< Reserved, 0x06 */
  284. __IO uint32_t CR; /*!< CRC Control register, Address offset: 0x08 */
  285. } CRC_TypeDef;
  286. /**
  287. * @brief Digital to Analog Converter
  288. */
  289. typedef struct
  290. {
  291. __IO uint32_t CR; /*!< DAC control register, Address offset: 0x00 */
  292. __IO uint32_t SWTRIGR; /*!< DAC software trigger register, Address offset: 0x04 */
  293. __IO uint32_t DHR12R1; /*!< DAC channel1 12-bit right-aligned data holding register, Address offset: 0x08 */
  294. __IO uint32_t DHR12L1; /*!< DAC channel1 12-bit left aligned data holding register, Address offset: 0x0C */
  295. __IO uint32_t DHR8R1; /*!< DAC channel1 8-bit right aligned data holding register, Address offset: 0x10 */
  296. __IO uint32_t DHR12R2; /*!< DAC channel2 12-bit right aligned data holding register, Address offset: 0x14 */
  297. __IO uint32_t DHR12L2; /*!< DAC channel2 12-bit left aligned data holding register, Address offset: 0x18 */
  298. __IO uint32_t DHR8R2; /*!< DAC channel2 8-bit right-aligned data holding register, Address offset: 0x1C */
  299. __IO uint32_t DHR12RD; /*!< Dual DAC 12-bit right-aligned data holding register, Address offset: 0x20 */
  300. __IO uint32_t DHR12LD; /*!< DUAL DAC 12-bit left aligned data holding register, Address offset: 0x24 */
  301. __IO uint32_t DHR8RD; /*!< DUAL DAC 8-bit right aligned data holding register, Address offset: 0x28 */
  302. __IO uint32_t DOR1; /*!< DAC channel1 data output register, Address offset: 0x2C */
  303. __IO uint32_t DOR2; /*!< DAC channel2 data output register, Address offset: 0x30 */
  304. __IO uint32_t SR; /*!< DAC status register, Address offset: 0x34 */
  305. } DAC_TypeDef;
  306. /**
  307. * @brief Debug MCU
  308. */
  309. typedef struct
  310. {
  311. __IO uint32_t IDCODE; /*!< MCU device ID code, Address offset: 0x00 */
  312. __IO uint32_t CR; /*!< Debug MCU configuration register, Address offset: 0x04 */
  313. __IO uint32_t APB1FZ; /*!< Debug MCU APB1 freeze register, Address offset: 0x08 */
  314. __IO uint32_t APB2FZ; /*!< Debug MCU APB2 freeze register, Address offset: 0x0C */
  315. }DBGMCU_TypeDef;
  316. /**
  317. * @brief DCMI
  318. */
  319. typedef struct
  320. {
  321. __IO uint32_t CR; /*!< DCMI control register 1, Address offset: 0x00 */
  322. __IO uint32_t SR; /*!< DCMI status register, Address offset: 0x04 */
  323. __IO uint32_t RISR; /*!< DCMI raw interrupt status register, Address offset: 0x08 */
  324. __IO uint32_t IER; /*!< DCMI interrupt enable register, Address offset: 0x0C */
  325. __IO uint32_t MISR; /*!< DCMI masked interrupt status register, Address offset: 0x10 */
  326. __IO uint32_t ICR; /*!< DCMI interrupt clear register, Address offset: 0x14 */
  327. __IO uint32_t ESCR; /*!< DCMI embedded synchronization code register, Address offset: 0x18 */
  328. __IO uint32_t ESUR; /*!< DCMI embedded synchronization unmask register, Address offset: 0x1C */
  329. __IO uint32_t CWSTRTR; /*!< DCMI crop window start, Address offset: 0x20 */
  330. __IO uint32_t CWSIZER; /*!< DCMI crop window size, Address offset: 0x24 */
  331. __IO uint32_t DR; /*!< DCMI data register, Address offset: 0x28 */
  332. } DCMI_TypeDef;
  333. /**
  334. * @brief DMA Controller
  335. */
  336. typedef struct
  337. {
  338. __IO uint32_t CR; /*!< DMA stream x configuration register */
  339. __IO uint32_t NDTR; /*!< DMA stream x number of data register */
  340. __IO uint32_t PAR; /*!< DMA stream x peripheral address register */
  341. __IO uint32_t M0AR; /*!< DMA stream x memory 0 address register */
  342. __IO uint32_t M1AR; /*!< DMA stream x memory 1 address register */
  343. __IO uint32_t FCR; /*!< DMA stream x FIFO control register */
  344. } DMA_Stream_TypeDef;
  345. typedef struct
  346. {
  347. __IO uint32_t LISR; /*!< DMA low interrupt status register, Address offset: 0x00 */
  348. __IO uint32_t HISR; /*!< DMA high interrupt status register, Address offset: 0x04 */
  349. __IO uint32_t LIFCR; /*!< DMA low interrupt flag clear register, Address offset: 0x08 */
  350. __IO uint32_t HIFCR; /*!< DMA high interrupt flag clear register, Address offset: 0x0C */
  351. } DMA_TypeDef;
  352. /**
  353. * @brief DMA2D Controller
  354. */
  355. typedef struct
  356. {
  357. __IO uint32_t CR; /*!< DMA2D Control Register, Address offset: 0x00 */
  358. __IO uint32_t ISR; /*!< DMA2D Interrupt Status Register, Address offset: 0x04 */
  359. __IO uint32_t IFCR; /*!< DMA2D Interrupt Flag Clear Register, Address offset: 0x08 */
  360. __IO uint32_t FGMAR; /*!< DMA2D Foreground Memory Address Register, Address offset: 0x0C */
  361. __IO uint32_t FGOR; /*!< DMA2D Foreground Offset Register, Address offset: 0x10 */
  362. __IO uint32_t BGMAR; /*!< DMA2D Background Memory Address Register, Address offset: 0x14 */
  363. __IO uint32_t BGOR; /*!< DMA2D Background Offset Register, Address offset: 0x18 */
  364. __IO uint32_t FGPFCCR; /*!< DMA2D Foreground PFC Control Register, Address offset: 0x1C */
  365. __IO uint32_t FGCOLR; /*!< DMA2D Foreground Color Register, Address offset: 0x20 */
  366. __IO uint32_t BGPFCCR; /*!< DMA2D Background PFC Control Register, Address offset: 0x24 */
  367. __IO uint32_t BGCOLR; /*!< DMA2D Background Color Register, Address offset: 0x28 */
  368. __IO uint32_t FGCMAR; /*!< DMA2D Foreground CLUT Memory Address Register, Address offset: 0x2C */
  369. __IO uint32_t BGCMAR; /*!< DMA2D Background CLUT Memory Address Register, Address offset: 0x30 */
  370. __IO uint32_t OPFCCR; /*!< DMA2D Output PFC Control Register, Address offset: 0x34 */
  371. __IO uint32_t OCOLR; /*!< DMA2D Output Color Register, Address offset: 0x38 */
  372. __IO uint32_t OMAR; /*!< DMA2D Output Memory Address Register, Address offset: 0x3C */
  373. __IO uint32_t OOR; /*!< DMA2D Output Offset Register, Address offset: 0x40 */
  374. __IO uint32_t NLR; /*!< DMA2D Number of Line Register, Address offset: 0x44 */
  375. __IO uint32_t LWR; /*!< DMA2D Line Watermark Register, Address offset: 0x48 */
  376. __IO uint32_t AMTCR; /*!< DMA2D AHB Master Timer Configuration Register, Address offset: 0x4C */
  377. uint32_t RESERVED[236]; /*!< Reserved, 0x50-0x3FF */
  378. __IO uint32_t FGCLUT[256]; /*!< DMA2D Foreground CLUT, Address offset:400-7FF */
  379. __IO uint32_t BGCLUT[256]; /*!< DMA2D Background CLUT, Address offset:800-BFF */
  380. } DMA2D_TypeDef;
  381. /**
  382. * @brief Ethernet MAC
  383. */
  384. typedef struct
  385. {
  386. __IO uint32_t MACCR;
  387. __IO uint32_t MACFFR;
  388. __IO uint32_t MACHTHR;
  389. __IO uint32_t MACHTLR;
  390. __IO uint32_t MACMIIAR;
  391. __IO uint32_t MACMIIDR;
  392. __IO uint32_t MACFCR;
  393. __IO uint32_t MACVLANTR; /* 8 */
  394. uint32_t RESERVED0[2];
  395. __IO uint32_t MACRWUFFR; /* 11 */
  396. __IO uint32_t MACPMTCSR;
  397. uint32_t RESERVED1[2];
  398. __IO uint32_t MACSR; /* 15 */
  399. __IO uint32_t MACIMR;
  400. __IO uint32_t MACA0HR;
  401. __IO uint32_t MACA0LR;
  402. __IO uint32_t MACA1HR;
  403. __IO uint32_t MACA1LR;
  404. __IO uint32_t MACA2HR;
  405. __IO uint32_t MACA2LR;
  406. __IO uint32_t MACA3HR;
  407. __IO uint32_t MACA3LR; /* 24 */
  408. uint32_t RESERVED2[40];
  409. __IO uint32_t MMCCR; /* 65 */
  410. __IO uint32_t MMCRIR;
  411. __IO uint32_t MMCTIR;
  412. __IO uint32_t MMCRIMR;
  413. __IO uint32_t MMCTIMR; /* 69 */
  414. uint32_t RESERVED3[14];
  415. __IO uint32_t MMCTGFSCCR; /* 84 */
  416. __IO uint32_t MMCTGFMSCCR;
  417. uint32_t RESERVED4[5];
  418. __IO uint32_t MMCTGFCR;
  419. uint32_t RESERVED5[10];
  420. __IO uint32_t MMCRFCECR;
  421. __IO uint32_t MMCRFAECR;
  422. uint32_t RESERVED6[10];
  423. __IO uint32_t MMCRGUFCR;
  424. uint32_t RESERVED7[334];
  425. __IO uint32_t PTPTSCR;
  426. __IO uint32_t PTPSSIR;
  427. __IO uint32_t PTPTSHR;
  428. __IO uint32_t PTPTSLR;
  429. __IO uint32_t PTPTSHUR;
  430. __IO uint32_t PTPTSLUR;
  431. __IO uint32_t PTPTSAR;
  432. __IO uint32_t PTPTTHR;
  433. __IO uint32_t PTPTTLR;
  434. __IO uint32_t RESERVED8;
  435. __IO uint32_t PTPTSSR;
  436. uint32_t RESERVED9[565];
  437. __IO uint32_t DMABMR;
  438. __IO uint32_t DMATPDR;
  439. __IO uint32_t DMARPDR;
  440. __IO uint32_t DMARDLAR;
  441. __IO uint32_t DMATDLAR;
  442. __IO uint32_t DMASR;
  443. __IO uint32_t DMAOMR;
  444. __IO uint32_t DMAIER;
  445. __IO uint32_t DMAMFBOCR;
  446. __IO uint32_t DMARSWTR;
  447. uint32_t RESERVED10[8];
  448. __IO uint32_t DMACHTDR;
  449. __IO uint32_t DMACHRDR;
  450. __IO uint32_t DMACHTBAR;
  451. __IO uint32_t DMACHRBAR;
  452. } ETH_TypeDef;
  453. /**
  454. * @brief External Interrupt/Event Controller
  455. */
  456. typedef struct
  457. {
  458. __IO uint32_t IMR; /*!< EXTI Interrupt mask register, Address offset: 0x00 */
  459. __IO uint32_t EMR; /*!< EXTI Event mask register, Address offset: 0x04 */
  460. __IO uint32_t RTSR; /*!< EXTI Rising trigger selection register, Address offset: 0x08 */
  461. __IO uint32_t FTSR; /*!< EXTI Falling trigger selection register, Address offset: 0x0C */
  462. __IO uint32_t SWIER; /*!< EXTI Software interrupt event register, Address offset: 0x10 */
  463. __IO uint32_t PR; /*!< EXTI Pending register, Address offset: 0x14 */
  464. } EXTI_TypeDef;
  465. /**
  466. * @brief FLASH Registers
  467. */
  468. typedef struct
  469. {
  470. __IO uint32_t ACR; /*!< FLASH access control register, Address offset: 0x00 */
  471. __IO uint32_t KEYR; /*!< FLASH key register, Address offset: 0x04 */
  472. __IO uint32_t OPTKEYR; /*!< FLASH option key register, Address offset: 0x08 */
  473. __IO uint32_t SR; /*!< FLASH status register, Address offset: 0x0C */
  474. __IO uint32_t CR; /*!< FLASH control register, Address offset: 0x10 */
  475. __IO uint32_t OPTCR; /*!< FLASH option control register , Address offset: 0x14 */
  476. __IO uint32_t OPTCR1; /*!< FLASH option control register 1, Address offset: 0x18 */
  477. } FLASH_TypeDef;
  478. /**
  479. * @brief Flexible Memory Controller
  480. */
  481. typedef struct
  482. {
  483. __IO uint32_t BTCR[8]; /*!< NOR/PSRAM chip-select control register(BCR) and chip-select timing register(BTR), Address offset: 0x00-1C */
  484. } FMC_Bank1_TypeDef;
  485. /**
  486. * @brief Flexible Memory Controller Bank1E
  487. */
  488. typedef struct
  489. {
  490. __IO uint32_t BWTR[7]; /*!< NOR/PSRAM write timing registers, Address offset: 0x104-0x11C */
  491. } FMC_Bank1E_TypeDef;
  492. /**
  493. * @brief Flexible Memory Controller Bank2
  494. */
  495. typedef struct
  496. {
  497. __IO uint32_t PCR2; /*!< NAND Flash control register 2, Address offset: 0x60 */
  498. __IO uint32_t SR2; /*!< NAND Flash FIFO status and interrupt register 2, Address offset: 0x64 */
  499. __IO uint32_t PMEM2; /*!< NAND Flash Common memory space timing register 2, Address offset: 0x68 */
  500. __IO uint32_t PATT2; /*!< NAND Flash Attribute memory space timing register 2, Address offset: 0x6C */
  501. uint32_t RESERVED0; /*!< Reserved, 0x70 */
  502. __IO uint32_t ECCR2; /*!< NAND Flash ECC result registers 2, Address offset: 0x74 */
  503. uint32_t RESERVED1; /*!< Reserved, 0x78 */
  504. uint32_t RESERVED2; /*!< Reserved, 0x7C */
  505. __IO uint32_t PCR3; /*!< NAND Flash control register 3, Address offset: 0x80 */
  506. __IO uint32_t SR3; /*!< NAND Flash FIFO status and interrupt register 3, Address offset: 0x84 */
  507. __IO uint32_t PMEM3; /*!< NAND Flash Common memory space timing register 3, Address offset: 0x88 */
  508. __IO uint32_t PATT3; /*!< NAND Flash Attribute memory space timing register 3, Address offset: 0x8C */
  509. uint32_t RESERVED3; /*!< Reserved, 0x90 */
  510. __IO uint32_t ECCR3; /*!< NAND Flash ECC result registers 3, Address offset: 0x94 */
  511. } FMC_Bank2_3_TypeDef;
  512. /**
  513. * @brief Flexible Memory Controller Bank4
  514. */
  515. typedef struct
  516. {
  517. __IO uint32_t PCR4; /*!< PC Card control register 4, Address offset: 0xA0 */
  518. __IO uint32_t SR4; /*!< PC Card FIFO status and interrupt register 4, Address offset: 0xA4 */
  519. __IO uint32_t PMEM4; /*!< PC Card Common memory space timing register 4, Address offset: 0xA8 */
  520. __IO uint32_t PATT4; /*!< PC Card Attribute memory space timing register 4, Address offset: 0xAC */
  521. __IO uint32_t PIO4; /*!< PC Card I/O space timing register 4, Address offset: 0xB0 */
  522. } FMC_Bank4_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 register 1, Address offset: 0x08 */
  568. __IO uint32_t OAR2; /*!< I2C Own address register 2, Address offset: 0x0C */
  569. __IO uint32_t DR; /*!< I2C Data register, Address offset: 0x10 */
  570. __IO uint32_t SR1; /*!< I2C Status register 1, Address offset: 0x14 */
  571. __IO uint32_t SR2; /*!< I2C Status register 2, Address offset: 0x18 */
  572. __IO uint32_t CCR; /*!< I2C Clock control register, Address offset: 0x1C */
  573. __IO uint32_t TRISE; /*!< I2C TRISE register, Address offset: 0x20 */
  574. __IO uint32_t FLTR; /*!< I2C FLTR register, Address offset: 0x24 */
  575. } I2C_TypeDef;
  576. /**
  577. * @brief Independent WATCHDOG
  578. */
  579. typedef struct
  580. {
  581. __IO uint32_t KR; /*!< IWDG Key register, Address offset: 0x00 */
  582. __IO uint32_t PR; /*!< IWDG Prescaler register, Address offset: 0x04 */
  583. __IO uint32_t RLR; /*!< IWDG Reload register, Address offset: 0x08 */
  584. __IO uint32_t SR; /*!< IWDG Status register, Address offset: 0x0C */
  585. } IWDG_TypeDef;
  586. /**
  587. * @brief Power Control
  588. */
  589. typedef struct
  590. {
  591. __IO uint32_t CR; /*!< PWR power control register, Address offset: 0x00 */
  592. __IO uint32_t CSR; /*!< PWR power control/status register, Address offset: 0x04 */
  593. } PWR_TypeDef;
  594. /**
  595. * @brief Reset and Clock Control
  596. */
  597. typedef struct
  598. {
  599. __IO uint32_t CR; /*!< RCC clock control register, Address offset: 0x00 */
  600. __IO uint32_t PLLCFGR; /*!< RCC PLL configuration register, Address offset: 0x04 */
  601. __IO uint32_t CFGR; /*!< RCC clock configuration register, Address offset: 0x08 */
  602. __IO uint32_t CIR; /*!< RCC clock interrupt register, Address offset: 0x0C */
  603. __IO uint32_t AHB1RSTR; /*!< RCC AHB1 peripheral reset register, Address offset: 0x10 */
  604. __IO uint32_t AHB2RSTR; /*!< RCC AHB2 peripheral reset register, Address offset: 0x14 */
  605. __IO uint32_t AHB3RSTR; /*!< RCC AHB3 peripheral reset register, Address offset: 0x18 */
  606. uint32_t RESERVED0; /*!< Reserved, 0x1C */
  607. __IO uint32_t APB1RSTR; /*!< RCC APB1 peripheral reset register, Address offset: 0x20 */
  608. __IO uint32_t APB2RSTR; /*!< RCC APB2 peripheral reset register, Address offset: 0x24 */
  609. uint32_t RESERVED1[2]; /*!< Reserved, 0x28-0x2C */
  610. __IO uint32_t AHB1ENR; /*!< RCC AHB1 peripheral clock register, Address offset: 0x30 */
  611. __IO uint32_t AHB2ENR; /*!< RCC AHB2 peripheral clock register, Address offset: 0x34 */
  612. __IO uint32_t AHB3ENR; /*!< RCC AHB3 peripheral clock register, Address offset: 0x38 */
  613. uint32_t RESERVED2; /*!< Reserved, 0x3C */
  614. __IO uint32_t APB1ENR; /*!< RCC APB1 peripheral clock enable register, Address offset: 0x40 */
  615. __IO uint32_t APB2ENR; /*!< RCC APB2 peripheral clock enable register, Address offset: 0x44 */
  616. uint32_t RESERVED3[2]; /*!< Reserved, 0x48-0x4C */
  617. __IO uint32_t AHB1LPENR; /*!< RCC AHB1 peripheral clock enable in low power mode register, Address offset: 0x50 */
  618. __IO uint32_t AHB2LPENR; /*!< RCC AHB2 peripheral clock enable in low power mode register, Address offset: 0x54 */
  619. __IO uint32_t AHB3LPENR; /*!< RCC AHB3 peripheral clock enable in low power mode register, Address offset: 0x58 */
  620. uint32_t RESERVED4; /*!< Reserved, 0x5C */
  621. __IO uint32_t APB1LPENR; /*!< RCC APB1 peripheral clock enable in low power mode register, Address offset: 0x60 */
  622. __IO uint32_t APB2LPENR; /*!< RCC APB2 peripheral clock enable in low power mode register, Address offset: 0x64 */
  623. uint32_t RESERVED5[2]; /*!< Reserved, 0x68-0x6C */
  624. __IO uint32_t BDCR; /*!< RCC Backup domain control register, Address offset: 0x70 */
  625. __IO uint32_t CSR; /*!< RCC clock control & status register, Address offset: 0x74 */
  626. uint32_t RESERVED6[2]; /*!< Reserved, 0x78-0x7C */
  627. __IO uint32_t SSCGR; /*!< RCC spread spectrum clock generation register, Address offset: 0x80 */
  628. __IO uint32_t PLLI2SCFGR; /*!< RCC PLLI2S configuration register, Address offset: 0x84 */
  629. __IO uint32_t PLLSAICFGR; /*!< RCC PLLSAI configuration register, Address offset: 0x88 */
  630. __IO uint32_t DCKCFGR; /*!< RCC Dedicated Clocks configuration register, Address offset: 0x8C */
  631. } RCC_TypeDef;
  632. /**
  633. * @brief Real-Time Clock
  634. */
  635. typedef struct
  636. {
  637. __IO uint32_t TR; /*!< RTC time register, Address offset: 0x00 */
  638. __IO uint32_t DR; /*!< RTC date register, Address offset: 0x04 */
  639. __IO uint32_t CR; /*!< RTC control register, Address offset: 0x08 */
  640. __IO uint32_t ISR; /*!< RTC initialization and status register, Address offset: 0x0C */
  641. __IO uint32_t PRER; /*!< RTC prescaler register, Address offset: 0x10 */
  642. __IO uint32_t WUTR; /*!< RTC wakeup timer register, Address offset: 0x14 */
  643. __IO uint32_t CALIBR; /*!< RTC calibration register, Address offset: 0x18 */
  644. __IO uint32_t ALRMAR; /*!< RTC alarm A register, Address offset: 0x1C */
  645. __IO uint32_t ALRMBR; /*!< RTC alarm B register, Address offset: 0x20 */
  646. __IO uint32_t WPR; /*!< RTC write protection register, Address offset: 0x24 */
  647. __IO uint32_t SSR; /*!< RTC sub second register, Address offset: 0x28 */
  648. __IO uint32_t SHIFTR; /*!< RTC shift control register, Address offset: 0x2C */
  649. __IO uint32_t TSTR; /*!< RTC time stamp time register, Address offset: 0x30 */
  650. __IO uint32_t TSDR; /*!< RTC time stamp date register, Address offset: 0x34 */
  651. __IO uint32_t TSSSR; /*!< RTC time-stamp sub second register, Address offset: 0x38 */
  652. __IO uint32_t CALR; /*!< RTC calibration register, Address offset: 0x3C */
  653. __IO uint32_t TAFCR; /*!< RTC tamper and alternate function configuration register, Address offset: 0x40 */
  654. __IO uint32_t ALRMASSR;/*!< RTC alarm A sub second register, Address offset: 0x44 */
  655. __IO uint32_t ALRMBSSR;/*!< RTC alarm B sub second register, Address offset: 0x48 */
  656. uint32_t RESERVED7; /*!< Reserved, 0x4C */
  657. __IO uint32_t BKP0R; /*!< RTC backup register 1, Address offset: 0x50 */
  658. __IO uint32_t BKP1R; /*!< RTC backup register 1, Address offset: 0x54 */
  659. __IO uint32_t BKP2R; /*!< RTC backup register 2, Address offset: 0x58 */
  660. __IO uint32_t BKP3R; /*!< RTC backup register 3, Address offset: 0x5C */
  661. __IO uint32_t BKP4R; /*!< RTC backup register 4, Address offset: 0x60 */
  662. __IO uint32_t BKP5R; /*!< RTC backup register 5, Address offset: 0x64 */
  663. __IO uint32_t BKP6R; /*!< RTC backup register 6, Address offset: 0x68 */
  664. __IO uint32_t BKP7R; /*!< RTC backup register 7, Address offset: 0x6C */
  665. __IO uint32_t BKP8R; /*!< RTC backup register 8, Address offset: 0x70 */
  666. __IO uint32_t BKP9R; /*!< RTC backup register 9, Address offset: 0x74 */
  667. __IO uint32_t BKP10R; /*!< RTC backup register 10, Address offset: 0x78 */
  668. __IO uint32_t BKP11R; /*!< RTC backup register 11, Address offset: 0x7C */
  669. __IO uint32_t BKP12R; /*!< RTC backup register 12, Address offset: 0x80 */
  670. __IO uint32_t BKP13R; /*!< RTC backup register 13, Address offset: 0x84 */
  671. __IO uint32_t BKP14R; /*!< RTC backup register 14, Address offset: 0x88 */
  672. __IO uint32_t BKP15R; /*!< RTC backup register 15, Address offset: 0x8C */
  673. __IO uint32_t BKP16R; /*!< RTC backup register 16, Address offset: 0x90 */
  674. __IO uint32_t BKP17R; /*!< RTC backup register 17, Address offset: 0x94 */
  675. __IO uint32_t BKP18R; /*!< RTC backup register 18, Address offset: 0x98 */
  676. __IO uint32_t BKP19R; /*!< RTC backup register 19, Address offset: 0x9C */
  677. } RTC_TypeDef;
  678. /**
  679. * @brief Serial Audio Interface
  680. */
  681. typedef struct
  682. {
  683. __IO uint32_t GCR; /*!< SAI global configuration register, Address offset: 0x00 */
  684. } SAI_TypeDef;
  685. typedef struct
  686. {
  687. __IO uint32_t CR1; /*!< SAI block x configuration register 1, Address offset: 0x04 */
  688. __IO uint32_t CR2; /*!< SAI block x configuration register 2, Address offset: 0x08 */
  689. __IO uint32_t FRCR; /*!< SAI block x frame configuration register, Address offset: 0x0C */
  690. __IO uint32_t SLOTR; /*!< SAI block x slot register, Address offset: 0x10 */
  691. __IO uint32_t IMR; /*!< SAI block x interrupt mask register, Address offset: 0x14 */
  692. __IO uint32_t SR; /*!< SAI block x status register, Address offset: 0x18 */
  693. __IO uint32_t CLRFR; /*!< SAI block x clear flag register, Address offset: 0x1C */
  694. __IO uint32_t DR; /*!< SAI block x data register, Address offset: 0x20 */
  695. } SAI_Block_TypeDef;
  696. /**
  697. * @brief SD host Interface
  698. */
  699. typedef struct
  700. {
  701. __IO uint32_t POWER; /*!< SDIO power control register, Address offset: 0x00 */
  702. __IO uint32_t CLKCR; /*!< SDI clock control register, Address offset: 0x04 */
  703. __IO uint32_t ARG; /*!< SDIO argument register, Address offset: 0x08 */
  704. __IO uint32_t CMD; /*!< SDIO command register, Address offset: 0x0C */
  705. __I uint32_t RESPCMD; /*!< SDIO command response register, Address offset: 0x10 */
  706. __I uint32_t RESP1; /*!< SDIO response 1 register, Address offset: 0x14 */
  707. __I uint32_t RESP2; /*!< SDIO response 2 register, Address offset: 0x18 */
  708. __I uint32_t RESP3; /*!< SDIO response 3 register, Address offset: 0x1C */
  709. __I uint32_t RESP4; /*!< SDIO response 4 register, Address offset: 0x20 */
  710. __IO uint32_t DTIMER; /*!< SDIO data timer register, Address offset: 0x24 */
  711. __IO uint32_t DLEN; /*!< SDIO data length register, Address offset: 0x28 */
  712. __IO uint32_t DCTRL; /*!< SDIO data control register, Address offset: 0x2C */
  713. __I uint32_t DCOUNT; /*!< SDIO data counter register, Address offset: 0x30 */
  714. __I uint32_t STA; /*!< SDIO status register, Address offset: 0x34 */
  715. __IO uint32_t ICR; /*!< SDIO interrupt clear register, Address offset: 0x38 */
  716. __IO uint32_t MASK; /*!< SDIO mask register, Address offset: 0x3C */
  717. uint32_t RESERVED0[2]; /*!< Reserved, 0x40-0x44 */
  718. __I uint32_t FIFOCNT; /*!< SDIO FIFO counter register, Address offset: 0x48 */
  719. uint32_t RESERVED1[13]; /*!< Reserved, 0x4C-0x7C */
  720. __IO uint32_t FIFO; /*!< SDIO data FIFO register, Address offset: 0x80 */
  721. } SDIO_TypeDef;
  722. /**
  723. * @brief Serial Peripheral Interface
  724. */
  725. typedef struct
  726. {
  727. __IO uint32_t CR1; /*!< SPI control register 1 (not used in I2S mode), Address offset: 0x00 */
  728. __IO uint32_t CR2; /*!< SPI control register 2, Address offset: 0x04 */
  729. __IO uint32_t SR; /*!< SPI status register, Address offset: 0x08 */
  730. __IO uint32_t DR; /*!< SPI data register, Address offset: 0x0C */
  731. __IO uint32_t CRCPR; /*!< SPI CRC polynomial register (not used in I2S mode), Address offset: 0x10 */
  732. __IO uint32_t RXCRCR; /*!< SPI RX CRC register (not used in I2S mode), Address offset: 0x14 */
  733. __IO uint32_t TXCRCR; /*!< SPI TX CRC register (not used in I2S mode), Address offset: 0x18 */
  734. __IO uint32_t I2SCFGR; /*!< SPI_I2S configuration register, Address offset: 0x1C */
  735. __IO uint32_t I2SPR; /*!< SPI_I2S prescaler register, Address offset: 0x20 */
  736. } SPI_TypeDef;
  737. /**
  738. * @brief TIM
  739. */
  740. typedef struct
  741. {
  742. __IO uint32_t CR1; /*!< TIM control register 1, Address offset: 0x00 */
  743. __IO uint32_t CR2; /*!< TIM control register 2, Address offset: 0x04 */
  744. __IO uint32_t SMCR; /*!< TIM slave mode control register, Address offset: 0x08 */
  745. __IO uint32_t DIER; /*!< TIM DMA/interrupt enable register, Address offset: 0x0C */
  746. __IO uint32_t SR; /*!< TIM status register, Address offset: 0x10 */
  747. __IO uint32_t EGR; /*!< TIM event generation register, Address offset: 0x14 */
  748. __IO uint32_t CCMR1; /*!< TIM capture/compare mode register 1, Address offset: 0x18 */
  749. __IO uint32_t CCMR2; /*!< TIM capture/compare mode register 2, Address offset: 0x1C */
  750. __IO uint32_t CCER; /*!< TIM capture/compare enable register, Address offset: 0x20 */
  751. __IO uint32_t CNT; /*!< TIM counter register, Address offset: 0x24 */
  752. __IO uint32_t PSC; /*!< TIM prescaler, Address offset: 0x28 */
  753. __IO uint32_t ARR; /*!< TIM auto-reload register, Address offset: 0x2C */
  754. __IO uint32_t RCR; /*!< TIM repetition counter register, Address offset: 0x30 */
  755. __IO uint32_t CCR1; /*!< TIM capture/compare register 1, Address offset: 0x34 */
  756. __IO uint32_t CCR2; /*!< TIM capture/compare register 2, Address offset: 0x38 */
  757. __IO uint32_t CCR3; /*!< TIM capture/compare register 3, Address offset: 0x3C */
  758. __IO uint32_t CCR4; /*!< TIM capture/compare register 4, Address offset: 0x40 */
  759. __IO uint32_t BDTR; /*!< TIM break and dead-time register, Address offset: 0x44 */
  760. __IO uint32_t DCR; /*!< TIM DMA control register, Address offset: 0x48 */
  761. __IO uint32_t DMAR; /*!< TIM DMA address for full transfer, Address offset: 0x4C */
  762. __IO uint32_t OR; /*!< TIM option register, Address offset: 0x50 */
  763. } TIM_TypeDef;
  764. /**
  765. * @brief Universal Synchronous Asynchronous Receiver Transmitter
  766. */
  767. typedef struct
  768. {
  769. __IO uint32_t SR; /*!< USART Status register, Address offset: 0x00 */
  770. __IO uint32_t DR; /*!< USART Data register, Address offset: 0x04 */
  771. __IO uint32_t BRR; /*!< USART Baud rate register, Address offset: 0x08 */
  772. __IO uint32_t CR1; /*!< USART Control register 1, Address offset: 0x0C */
  773. __IO uint32_t CR2; /*!< USART Control register 2, Address offset: 0x10 */
  774. __IO uint32_t CR3; /*!< USART Control register 3, Address offset: 0x14 */
  775. __IO uint32_t GTPR; /*!< USART Guard time and prescaler register, Address offset: 0x18 */
  776. } USART_TypeDef;
  777. /**
  778. * @brief Window WATCHDOG
  779. */
  780. typedef struct
  781. {
  782. __IO uint32_t CR; /*!< WWDG Control register, Address offset: 0x00 */
  783. __IO uint32_t CFR; /*!< WWDG Configuration register, Address offset: 0x04 */
  784. __IO uint32_t SR; /*!< WWDG Status register, Address offset: 0x08 */
  785. } WWDG_TypeDef;
  786. /**
  787. * @brief Crypto Processor
  788. */
  789. typedef struct
  790. {
  791. __IO uint32_t CR; /*!< CRYP control register, Address offset: 0x00 */
  792. __IO uint32_t SR; /*!< CRYP status register, Address offset: 0x04 */
  793. __IO uint32_t DR; /*!< CRYP data input register, Address offset: 0x08 */
  794. __IO uint32_t DOUT; /*!< CRYP data output register, Address offset: 0x0C */
  795. __IO uint32_t DMACR; /*!< CRYP DMA control register, Address offset: 0x10 */
  796. __IO uint32_t IMSCR; /*!< CRYP interrupt mask set/clear register, Address offset: 0x14 */
  797. __IO uint32_t RISR; /*!< CRYP raw interrupt status register, Address offset: 0x18 */
  798. __IO uint32_t MISR; /*!< CRYP masked interrupt status register, Address offset: 0x1C */
  799. __IO uint32_t K0LR; /*!< CRYP key left register 0, Address offset: 0x20 */
  800. __IO uint32_t K0RR; /*!< CRYP key right register 0, Address offset: 0x24 */
  801. __IO uint32_t K1LR; /*!< CRYP key left register 1, Address offset: 0x28 */
  802. __IO uint32_t K1RR; /*!< CRYP key right register 1, Address offset: 0x2C */
  803. __IO uint32_t K2LR; /*!< CRYP key left register 2, Address offset: 0x30 */
  804. __IO uint32_t K2RR; /*!< CRYP key right register 2, Address offset: 0x34 */
  805. __IO uint32_t K3LR; /*!< CRYP key left register 3, Address offset: 0x38 */
  806. __IO uint32_t K3RR; /*!< CRYP key right register 3, Address offset: 0x3C */
  807. __IO uint32_t IV0LR; /*!< CRYP initialization vector left-word register 0, Address offset: 0x40 */
  808. __IO uint32_t IV0RR; /*!< CRYP initialization vector right-word register 0, Address offset: 0x44 */
  809. __IO uint32_t IV1LR; /*!< CRYP initialization vector left-word register 1, Address offset: 0x48 */
  810. __IO uint32_t IV1RR; /*!< CRYP initialization vector right-word register 1, Address offset: 0x4C */
  811. __IO uint32_t CSGCMCCM0R; /*!< CRYP GCM/GMAC or CCM/CMAC context swap register 0, Address offset: 0x50 */
  812. __IO uint32_t CSGCMCCM1R; /*!< CRYP GCM/GMAC or CCM/CMAC context swap register 1, Address offset: 0x54 */
  813. __IO uint32_t CSGCMCCM2R; /*!< CRYP GCM/GMAC or CCM/CMAC context swap register 2, Address offset: 0x58 */
  814. __IO uint32_t CSGCMCCM3R; /*!< CRYP GCM/GMAC or CCM/CMAC context swap register 3, Address offset: 0x5C */
  815. __IO uint32_t CSGCMCCM4R; /*!< CRYP GCM/GMAC or CCM/CMAC context swap register 4, Address offset: 0x60 */
  816. __IO uint32_t CSGCMCCM5R; /*!< CRYP GCM/GMAC or CCM/CMAC context swap register 5, Address offset: 0x64 */
  817. __IO uint32_t CSGCMCCM6R; /*!< CRYP GCM/GMAC or CCM/CMAC context swap register 6, Address offset: 0x68 */
  818. __IO uint32_t CSGCMCCM7R; /*!< CRYP GCM/GMAC or CCM/CMAC context swap register 7, Address offset: 0x6C */
  819. __IO uint32_t CSGCM0R; /*!< CRYP GCM/GMAC context swap register 0, Address offset: 0x70 */
  820. __IO uint32_t CSGCM1R; /*!< CRYP GCM/GMAC context swap register 1, Address offset: 0x74 */
  821. __IO uint32_t CSGCM2R; /*!< CRYP GCM/GMAC context swap register 2, Address offset: 0x78 */
  822. __IO uint32_t CSGCM3R; /*!< CRYP GCM/GMAC context swap register 3, Address offset: 0x7C */
  823. __IO uint32_t CSGCM4R; /*!< CRYP GCM/GMAC context swap register 4, Address offset: 0x80 */
  824. __IO uint32_t CSGCM5R; /*!< CRYP GCM/GMAC context swap register 5, Address offset: 0x84 */
  825. __IO uint32_t CSGCM6R; /*!< CRYP GCM/GMAC context swap register 6, Address offset: 0x88 */
  826. __IO uint32_t CSGCM7R; /*!< CRYP GCM/GMAC context swap register 7, Address offset: 0x8C */
  827. } CRYP_TypeDef;
  828. /**
  829. * @brief HASH
  830. */
  831. typedef struct
  832. {
  833. __IO uint32_t CR; /*!< HASH control register, Address offset: 0x00 */
  834. __IO uint32_t DIN; /*!< HASH data input register, Address offset: 0x04 */
  835. __IO uint32_t STR; /*!< HASH start register, Address offset: 0x08 */
  836. __IO uint32_t HR[5]; /*!< HASH digest registers, Address offset: 0x0C-0x1C */
  837. __IO uint32_t IMR; /*!< HASH interrupt enable register, Address offset: 0x20 */
  838. __IO uint32_t SR; /*!< HASH status register, Address offset: 0x24 */
  839. uint32_t RESERVED[52]; /*!< Reserved, 0x28-0xF4 */
  840. __IO uint32_t CSR[54]; /*!< HASH context swap registers, Address offset: 0x0F8-0x1CC */
  841. } HASH_TypeDef;
  842. /**
  843. * @brief HASH_DIGEST
  844. */
  845. typedef struct
  846. {
  847. __IO uint32_t HR[8]; /*!< HASH digest registers, Address offset: 0x310-0x32C */
  848. } HASH_DIGEST_TypeDef;
  849. /**
  850. * @brief RNG
  851. */
  852. typedef struct
  853. {
  854. __IO uint32_t CR; /*!< RNG control register, Address offset: 0x00 */
  855. __IO uint32_t SR; /*!< RNG status register, Address offset: 0x04 */
  856. __IO uint32_t DR; /*!< RNG data register, Address offset: 0x08 */
  857. } RNG_TypeDef;
  858. /**
  859. * @brief __USB_OTG_Core_register
  860. */
  861. typedef struct
  862. {
  863. __IO uint32_t GOTGCTL; /*!< USB_OTG Control and Status Register 000h */
  864. __IO uint32_t GOTGINT; /*!< USB_OTG Interrupt Register 004h */
  865. __IO uint32_t GAHBCFG; /*!< Core AHB Configuration Register 008h */
  866. __IO uint32_t GUSBCFG; /*!< Core USB Configuration Register 00Ch */
  867. __IO uint32_t GRSTCTL; /*!< Core Reset Register 010h */
  868. __IO uint32_t GINTSTS; /*!< Core Interrupt Register 014h */
  869. __IO uint32_t GINTMSK; /*!< Core Interrupt Mask Register 018h */
  870. __IO uint32_t GRXSTSR; /*!< Receive Sts Q Read Register 01Ch */
  871. __IO uint32_t GRXSTSP; /*!< Receive Sts Q Read & POP Register 020h */
  872. __IO uint32_t GRXFSIZ; /* Receive FIFO Size Register 024h */
  873. __IO uint32_t DIEPTXF0_HNPTXFSIZ; /*!< EP0 / Non Periodic Tx FIFO Size Register 028h*/
  874. __IO uint32_t HNPTXSTS; /*!< Non Periodic Tx FIFO/Queue Sts reg 02Ch */
  875. uint32_t Reserved30[2]; /* Reserved 030h*/
  876. __IO uint32_t GCCFG; /* General Purpose IO Register 038h*/
  877. __IO uint32_t CID; /* User ID Register 03Ch*/
  878. uint32_t Reserved40[48]; /* Reserved 040h-0FFh*/
  879. __IO uint32_t HPTXFSIZ; /* Host Periodic Tx FIFO Size Reg 100h*/
  880. __IO uint32_t DIEPTXF[0x0F];/* dev Periodic Transmit FIFO */
  881. }
  882. USB_OTG_GlobalTypeDef;
  883. /**
  884. * @brief __device_Registers
  885. */
  886. typedef struct
  887. {
  888. __IO uint32_t DCFG; /* dev Configuration Register 800h*/
  889. __IO uint32_t DCTL; /* dev Control Register 804h*/
  890. __IO uint32_t DSTS; /* dev Status Register (RO) 808h*/
  891. uint32_t Reserved0C; /* Reserved 80Ch*/
  892. __IO uint32_t DIEPMSK; /* dev IN Endpoint Mask 810h*/
  893. __IO uint32_t DOEPMSK; /* dev OUT Endpoint Mask 814h*/
  894. __IO uint32_t DAINT; /* dev All Endpoints Itr Reg 818h*/
  895. __IO uint32_t DAINTMSK; /* dev All Endpoints Itr Mask 81Ch*/
  896. uint32_t Reserved20; /* Reserved 820h*/
  897. uint32_t Reserved9; /* Reserved 824h*/
  898. __IO uint32_t DVBUSDIS; /* dev VBUS discharge Register 828h*/
  899. __IO uint32_t DVBUSPULSE; /* dev VBUS Pulse Register 82Ch*/
  900. __IO uint32_t DTHRCTL; /* dev thr 830h*/
  901. __IO uint32_t DIEPEMPMSK; /* dev empty msk 834h*/
  902. __IO uint32_t DEACHINT; /* dedicated EP interrupt 838h*/
  903. __IO uint32_t DEACHMSK; /* dedicated EP msk 83Ch*/
  904. uint32_t Reserved40; /* dedicated EP mask 840h*/
  905. __IO uint32_t DINEP1MSK; /* dedicated EP mask 844h*/
  906. uint32_t Reserved44[15]; /* Reserved 844-87Ch*/
  907. __IO uint32_t DOUTEP1MSK; /* dedicated EP msk 884h*/
  908. }
  909. USB_OTG_DeviceTypeDef;
  910. /**
  911. * @brief __IN_Endpoint-Specific_Register
  912. */
  913. typedef struct
  914. {
  915. __IO uint32_t DIEPCTL; /* dev IN Endpoint Control Reg 900h + (ep_num * 20h) + 00h*/
  916. uint32_t Reserved04; /* Reserved 900h + (ep_num * 20h) + 04h*/
  917. __IO uint32_t DIEPINT; /* dev IN Endpoint Itr Reg 900h + (ep_num * 20h) + 08h*/
  918. uint32_t Reserved0C; /* Reserved 900h + (ep_num * 20h) + 0Ch*/
  919. __IO uint32_t DIEPTSIZ; /* IN Endpoint Txfer Size 900h + (ep_num * 20h) + 10h*/
  920. __IO uint32_t DIEPDMA; /* IN Endpoint DMA Address Reg 900h + (ep_num * 20h) + 14h*/
  921. __IO uint32_t DTXFSTS;/*IN Endpoint Tx FIFO Status Reg 900h + (ep_num * 20h) + 18h*/
  922. uint32_t Reserved18; /* Reserved 900h+(ep_num*20h)+1Ch-900h+ (ep_num * 20h) + 1Ch*/
  923. }
  924. USB_OTG_INEndpointTypeDef;
  925. /**
  926. * @brief __OUT_Endpoint-Specific_Registers
  927. */
  928. typedef struct
  929. {
  930. __IO uint32_t DOEPCTL; /* dev OUT Endpoint Control Reg B00h + (ep_num * 20h) + 00h*/
  931. uint32_t Reserved04; /* Reserved B00h + (ep_num * 20h) + 04h*/
  932. __IO uint32_t DOEPINT; /* dev OUT Endpoint Itr Reg B00h + (ep_num * 20h) + 08h*/
  933. uint32_t Reserved0C; /* Reserved B00h + (ep_num * 20h) + 0Ch*/
  934. __IO uint32_t DOEPTSIZ; /* dev OUT Endpoint Txfer Size B00h + (ep_num * 20h) + 10h*/
  935. __IO uint32_t DOEPDMA; /* dev OUT Endpoint DMA Address B00h + (ep_num * 20h) + 14h*/
  936. uint32_t Reserved18[2]; /* Reserved B00h + (ep_num * 20h) + 18h - B00h + (ep_num * 20h) + 1Ch*/
  937. }
  938. USB_OTG_OUTEndpointTypeDef;
  939. /**
  940. * @brief __Host_Mode_Register_Structures
  941. */
  942. typedef struct
  943. {
  944. __IO uint32_t HCFG; /* Host Configuration Register 400h*/
  945. __IO uint32_t HFIR; /* Host Frame Interval Register 404h*/
  946. __IO uint32_t HFNUM; /* Host Frame Nbr/Frame Remaining 408h*/
  947. uint32_t Reserved40C; /* Reserved 40Ch*/
  948. __IO uint32_t HPTXSTS; /* Host Periodic Tx FIFO/ Queue Status 410h*/
  949. __IO uint32_t HAINT; /* Host All Channels Interrupt Register 414h*/
  950. __IO uint32_t HAINTMSK; /* Host All Channels Interrupt Mask 418h*/
  951. }
  952. USB_OTG_HostTypeDef;
  953. /**
  954. * @brief __Host_Channel_Specific_Registers
  955. */
  956. typedef struct
  957. {
  958. __IO uint32_t HCCHAR;
  959. __IO uint32_t HCSPLT;
  960. __IO uint32_t HCINT;
  961. __IO uint32_t HCINTMSK;
  962. __IO uint32_t HCTSIZ;
  963. __IO uint32_t HCDMA;
  964. uint32_t Reserved[2];
  965. }
  966. USB_OTG_HostChannelTypeDef;
  967. /**
  968. * @}
  969. */
  970. /** @addtogroup Peripheral_memory_map
  971. * @{
  972. */
  973. #define FLASH_BASE ((uint32_t)0x08000000) /*!< FLASH(up to 2 MB) base address in the alias region */
  974. #define CCMDATARAM_BASE ((uint32_t)0x10000000) /*!< CCM(core coupled memory) data RAM(64 KB) base address in the alias region */
  975. #define SRAM1_BASE ((uint32_t)0x20000000) /*!< SRAM1(112 KB) base address in the alias region */
  976. #define SRAM2_BASE ((uint32_t)0x2001C000) /*!< SRAM2(16 KB) base address in the alias region */
  977. #define SRAM3_BASE ((uint32_t)0x20020000) /*!< SRAM3(64 KB) base address in the alias region */
  978. #define PERIPH_BASE ((uint32_t)0x40000000) /*!< Peripheral base address in the alias region */
  979. #define BKPSRAM_BASE ((uint32_t)0x40024000) /*!< Backup SRAM(4 KB) base address in the alias region */
  980. #define FMC_R_BASE ((uint32_t)0xA0000000) /*!< FMC registers base address */
  981. #define SRAM1_BB_BASE ((uint32_t)0x22000000) /*!< SRAM1(112 KB) base address in the bit-band region */
  982. #define SRAM2_BB_BASE ((uint32_t)0x22380000) /*!< SRAM2(16 KB) base address in the bit-band region */
  983. #define SRAM3_BB_BASE ((uint32_t)0x22400000) /*!< SRAM3(64 KB) base address in the bit-band region */
  984. #define PERIPH_BB_BASE ((uint32_t)0x42000000) /*!< Peripheral base address in the bit-band region */
  985. #define BKPSRAM_BB_BASE ((uint32_t)0x42480000) /*!< Backup SRAM(4 KB) base address in the bit-band region */
  986. #define FLASH_END ((uint32_t)0x081FFFFF) /*!< FLASH end address */
  987. #define CCMDATARAM_END ((uint32_t)0x1000FFFF) /*!< CCM data RAM end address */
  988. /* Legacy defines */
  989. #define SRAM_BASE SRAM1_BASE
  990. #define SRAM_BB_BASE SRAM1_BB_BASE
  991. /*!< Peripheral memory map */
  992. #define APB1PERIPH_BASE PERIPH_BASE
  993. #define APB2PERIPH_BASE (PERIPH_BASE + 0x00010000)
  994. #define AHB1PERIPH_BASE (PERIPH_BASE + 0x00020000)
  995. #define AHB2PERIPH_BASE (PERIPH_BASE + 0x10000000)
  996. /*!< APB1 peripherals */
  997. #define TIM2_BASE (APB1PERIPH_BASE + 0x0000)
  998. #define TIM3_BASE (APB1PERIPH_BASE + 0x0400)
  999. #define TIM4_BASE (APB1PERIPH_BASE + 0x0800)
  1000. #define TIM5_BASE (APB1PERIPH_BASE + 0x0C00)
  1001. #define TIM6_BASE (APB1PERIPH_BASE + 0x1000)
  1002. #define TIM7_BASE (APB1PERIPH_BASE + 0x1400)
  1003. #define TIM12_BASE (APB1PERIPH_BASE + 0x1800)
  1004. #define TIM13_BASE (APB1PERIPH_BASE + 0x1C00)
  1005. #define TIM14_BASE (APB1PERIPH_BASE + 0x2000)
  1006. #define RTC_BASE (APB1PERIPH_BASE + 0x2800)
  1007. #define WWDG_BASE (APB1PERIPH_BASE + 0x2C00)
  1008. #define IWDG_BASE (APB1PERIPH_BASE + 0x3000)
  1009. #define I2S2ext_BASE (APB1PERIPH_BASE + 0x3400)
  1010. #define SPI2_BASE (APB1PERIPH_BASE + 0x3800)
  1011. #define SPI3_BASE (APB1PERIPH_BASE + 0x3C00)
  1012. #define I2S3ext_BASE (APB1PERIPH_BASE + 0x4000)
  1013. #define USART2_BASE (APB1PERIPH_BASE + 0x4400)
  1014. #define USART3_BASE (APB1PERIPH_BASE + 0x4800)
  1015. #define UART4_BASE (APB1PERIPH_BASE + 0x4C00)
  1016. #define UART5_BASE (APB1PERIPH_BASE + 0x5000)
  1017. #define I2C1_BASE (APB1PERIPH_BASE + 0x5400)
  1018. #define I2C2_BASE (APB1PERIPH_BASE + 0x5800)
  1019. #define I2C3_BASE (APB1PERIPH_BASE + 0x5C00)
  1020. #define CAN1_BASE (APB1PERIPH_BASE + 0x6400)
  1021. #define CAN2_BASE (APB1PERIPH_BASE + 0x6800)
  1022. #define PWR_BASE (APB1PERIPH_BASE + 0x7000)
  1023. #define DAC_BASE (APB1PERIPH_BASE + 0x7400)
  1024. #define UART7_BASE (APB1PERIPH_BASE + 0x7800)
  1025. #define UART8_BASE (APB1PERIPH_BASE + 0x7C00)
  1026. /*!< APB2 peripherals */
  1027. #define TIM1_BASE (APB2PERIPH_BASE + 0x0000)
  1028. #define TIM8_BASE (APB2PERIPH_BASE + 0x0400)
  1029. #define USART1_BASE (APB2PERIPH_BASE + 0x1000)
  1030. #define USART6_BASE (APB2PERIPH_BASE + 0x1400)
  1031. #define ADC1_BASE (APB2PERIPH_BASE + 0x2000)
  1032. #define ADC2_BASE (APB2PERIPH_BASE + 0x2100)
  1033. #define ADC3_BASE (APB2PERIPH_BASE + 0x2200)
  1034. #define ADC_BASE (APB2PERIPH_BASE + 0x2300)
  1035. #define SDIO_BASE (APB2PERIPH_BASE + 0x2C00)
  1036. #define SPI1_BASE (APB2PERIPH_BASE + 0x3000)
  1037. #define SPI4_BASE (APB2PERIPH_BASE + 0x3400)
  1038. #define SYSCFG_BASE (APB2PERIPH_BASE + 0x3800)
  1039. #define EXTI_BASE (APB2PERIPH_BASE + 0x3C00)
  1040. #define TIM9_BASE (APB2PERIPH_BASE + 0x4000)
  1041. #define TIM10_BASE (APB2PERIPH_BASE + 0x4400)
  1042. #define TIM11_BASE (APB2PERIPH_BASE + 0x4800)
  1043. #define SPI5_BASE (APB2PERIPH_BASE + 0x5000)
  1044. #define SPI6_BASE (APB2PERIPH_BASE + 0x5400)
  1045. #define SAI1_BASE (APB2PERIPH_BASE + 0x5800)
  1046. #define SAI1_Block_A_BASE (SAI1_BASE + 0x004)
  1047. #define SAI1_Block_B_BASE (SAI1_BASE + 0x024)
  1048. /*!< AHB1 peripherals */
  1049. #define GPIOA_BASE (AHB1PERIPH_BASE + 0x0000)
  1050. #define GPIOB_BASE (AHB1PERIPH_BASE + 0x0400)
  1051. #define GPIOC_BASE (AHB1PERIPH_BASE + 0x0800)
  1052. #define GPIOD_BASE (AHB1PERIPH_BASE + 0x0C00)
  1053. #define GPIOE_BASE (AHB1PERIPH_BASE + 0x1000)
  1054. #define GPIOF_BASE (AHB1PERIPH_BASE + 0x1400)
  1055. #define GPIOG_BASE (AHB1PERIPH_BASE + 0x1800)
  1056. #define GPIOH_BASE (AHB1PERIPH_BASE + 0x1C00)
  1057. #define GPIOI_BASE (AHB1PERIPH_BASE + 0x2000)
  1058. #define GPIOJ_BASE (AHB1PERIPH_BASE + 0x2400)
  1059. #define GPIOK_BASE (AHB1PERIPH_BASE + 0x2800)
  1060. #define CRC_BASE (AHB1PERIPH_BASE + 0x3000)
  1061. #define RCC_BASE (AHB1PERIPH_BASE + 0x3800)
  1062. #define FLASH_R_BASE (AHB1PERIPH_BASE + 0x3C00)
  1063. #define DMA1_BASE (AHB1PERIPH_BASE + 0x6000)
  1064. #define DMA1_Stream0_BASE (DMA1_BASE + 0x010)
  1065. #define DMA1_Stream1_BASE (DMA1_BASE + 0x028)
  1066. #define DMA1_Stream2_BASE (DMA1_BASE + 0x040)
  1067. #define DMA1_Stream3_BASE (DMA1_BASE + 0x058)
  1068. #define DMA1_Stream4_BASE (DMA1_BASE + 0x070)
  1069. #define DMA1_Stream5_BASE (DMA1_BASE + 0x088)
  1070. #define DMA1_Stream6_BASE (DMA1_BASE + 0x0A0)
  1071. #define DMA1_Stream7_BASE (DMA1_BASE + 0x0B8)
  1072. #define DMA2_BASE (AHB1PERIPH_BASE + 0x6400)
  1073. #define DMA2_Stream0_BASE (DMA2_BASE + 0x010)
  1074. #define DMA2_Stream1_BASE (DMA2_BASE + 0x028)
  1075. #define DMA2_Stream2_BASE (DMA2_BASE + 0x040)
  1076. #define DMA2_Stream3_BASE (DMA2_BASE + 0x058)
  1077. #define DMA2_Stream4_BASE (DMA2_BASE + 0x070)
  1078. #define DMA2_Stream5_BASE (DMA2_BASE + 0x088)
  1079. #define DMA2_Stream6_BASE (DMA2_BASE + 0x0A0)
  1080. #define DMA2_Stream7_BASE (DMA2_BASE + 0x0B8)
  1081. #define ETH_BASE (AHB1PERIPH_BASE + 0x8000)
  1082. #define ETH_MAC_BASE (ETH_BASE)
  1083. #define ETH_MMC_BASE (ETH_BASE + 0x0100)
  1084. #define ETH_PTP_BASE (ETH_BASE + 0x0700)
  1085. #define ETH_DMA_BASE (ETH_BASE + 0x1000)
  1086. #define DMA2D_BASE (AHB1PERIPH_BASE + 0xB000)
  1087. /*!< AHB2 peripherals */
  1088. #define DCMI_BASE (AHB2PERIPH_BASE + 0x50000)
  1089. #define CRYP_BASE (AHB2PERIPH_BASE + 0x60000)
  1090. #define HASH_BASE (AHB2PERIPH_BASE + 0x60400)
  1091. #define HASH_DIGEST_BASE (AHB2PERIPH_BASE + 0x60710)
  1092. #define RNG_BASE (AHB2PERIPH_BASE + 0x60800)
  1093. /*!< FMC Bankx registers base address */
  1094. #define FMC_Bank1_R_BASE (FMC_R_BASE + 0x0000)
  1095. #define FMC_Bank1E_R_BASE (FMC_R_BASE + 0x0104)
  1096. #define FMC_Bank2_3_R_BASE (FMC_R_BASE + 0x0060)
  1097. #define FMC_Bank4_R_BASE (FMC_R_BASE + 0x00A0)
  1098. #define FMC_Bank5_6_R_BASE (FMC_R_BASE + 0x0140)
  1099. /* Debug MCU registers base address */
  1100. #define DBGMCU_BASE ((uint32_t )0xE0042000)
  1101. /*!< USB registers base address */
  1102. #define USB_OTG_HS_PERIPH_BASE ((uint32_t )0x40040000)
  1103. #define USB_OTG_FS_PERIPH_BASE ((uint32_t )0x50000000)
  1104. #define USB_OTG_GLOBAL_BASE ((uint32_t )0x000)
  1105. #define USB_OTG_DEVICE_BASE ((uint32_t )0x800)
  1106. #define USB_OTG_IN_ENDPOINT_BASE ((uint32_t )0x900)
  1107. #define USB_OTG_OUT_ENDPOINT_BASE ((uint32_t )0xB00)
  1108. #define USB_OTG_EP_REG_SIZE ((uint32_t )0x20)
  1109. #define USB_OTG_HOST_BASE ((uint32_t )0x400)
  1110. #define USB_OTG_HOST_PORT_BASE ((uint32_t )0x440)
  1111. #define USB_OTG_HOST_CHANNEL_BASE ((uint32_t )0x500)
  1112. #define USB_OTG_HOST_CHANNEL_SIZE ((uint32_t )0x20)
  1113. #define USB_OTG_PCGCCTL_BASE ((uint32_t )0xE00)
  1114. #define USB_OTG_FIFO_BASE ((uint32_t )0x1000)
  1115. #define USB_OTG_FIFO_SIZE ((uint32_t )0x1000)
  1116. /**
  1117. * @}
  1118. */
  1119. /** @addtogroup Peripheral_declaration
  1120. * @{
  1121. */
  1122. #define TIM2 ((TIM_TypeDef *) TIM2_BASE)
  1123. #define TIM3 ((TIM_TypeDef *) TIM3_BASE)
  1124. #define TIM4 ((TIM_TypeDef *) TIM4_BASE)
  1125. #define TIM5 ((TIM_TypeDef *) TIM5_BASE)
  1126. #define TIM6 ((TIM_TypeDef *) TIM6_BASE)
  1127. #define TIM7 ((TIM_TypeDef *) TIM7_BASE)
  1128. #define TIM12 ((TIM_TypeDef *) TIM12_BASE)
  1129. #define TIM13 ((TIM_TypeDef *) TIM13_BASE)
  1130. #define TIM14 ((TIM_TypeDef *) TIM14_BASE)
  1131. #define RTC ((RTC_TypeDef *) RTC_BASE)
  1132. #define WWDG ((WWDG_TypeDef *) WWDG_BASE)
  1133. #define IWDG ((IWDG_TypeDef *) IWDG_BASE)
  1134. #define I2S2ext ((SPI_TypeDef *) I2S2ext_BASE)
  1135. #define SPI2 ((SPI_TypeDef *) SPI2_BASE)
  1136. #define SPI3 ((SPI_TypeDef *) SPI3_BASE)
  1137. #define I2S3ext ((SPI_TypeDef *) I2S3ext_BASE)
  1138. #define USART2 ((USART_TypeDef *) USART2_BASE)
  1139. #define USART3 ((USART_TypeDef *) USART3_BASE)
  1140. #define UART4 ((USART_TypeDef *) UART4_BASE)
  1141. #define UART5 ((USART_TypeDef *) UART5_BASE)
  1142. #define I2C1 ((I2C_TypeDef *) I2C1_BASE)
  1143. #define I2C2 ((I2C_TypeDef *) I2C2_BASE)
  1144. #define I2C3 ((I2C_TypeDef *) I2C3_BASE)
  1145. #define CAN1 ((CAN_TypeDef *) CAN1_BASE)
  1146. #define CAN2 ((CAN_TypeDef *) CAN2_BASE)
  1147. #define PWR ((PWR_TypeDef *) PWR_BASE)
  1148. #define DAC ((DAC_TypeDef *) DAC_BASE)
  1149. #define UART7 ((USART_TypeDef *) UART7_BASE)
  1150. #define UART8 ((USART_TypeDef *) UART8_BASE)
  1151. #define TIM1 ((TIM_TypeDef *) TIM1_BASE)
  1152. #define TIM8 ((TIM_TypeDef *) TIM8_BASE)
  1153. #define USART1 ((USART_TypeDef *) USART1_BASE)
  1154. #define USART6 ((USART_TypeDef *) USART6_BASE)
  1155. #define ADC ((ADC_Common_TypeDef *) ADC_BASE)
  1156. #define ADC1 ((ADC_TypeDef *) ADC1_BASE)
  1157. #define ADC2 ((ADC_TypeDef *) ADC2_BASE)
  1158. #define ADC3 ((ADC_TypeDef *) ADC3_BASE)
  1159. #define SDIO ((SDIO_TypeDef *) SDIO_BASE)
  1160. #define SPI1 ((SPI_TypeDef *) SPI1_BASE)
  1161. #define SPI4 ((SPI_TypeDef *) SPI4_BASE)
  1162. #define SYSCFG ((SYSCFG_TypeDef *) SYSCFG_BASE)
  1163. #define EXTI ((EXTI_TypeDef *) EXTI_BASE)
  1164. #define TIM9 ((TIM_TypeDef *) TIM9_BASE)
  1165. #define TIM10 ((TIM_TypeDef *) TIM10_BASE)
  1166. #define TIM11 ((TIM_TypeDef *) TIM11_BASE)
  1167. #define SPI5 ((SPI_TypeDef *) SPI5_BASE)
  1168. #define SPI6 ((SPI_TypeDef *) SPI6_BASE)
  1169. #define SAI1 ((SAI_TypeDef *) SAI1_BASE)
  1170. #define SAI1_Block_A ((SAI_Block_TypeDef *)SAI1_Block_A_BASE)
  1171. #define SAI1_Block_B ((SAI_Block_TypeDef *)SAI1_Block_B_BASE)
  1172. #define GPIOA ((GPIO_TypeDef *) GPIOA_BASE)
  1173. #define GPIOB ((GPIO_TypeDef *) GPIOB_BASE)
  1174. #define GPIOC ((GPIO_TypeDef *) GPIOC_BASE)
  1175. #define GPIOD ((GPIO_TypeDef *) GPIOD_BASE)
  1176. #define GPIOE ((GPIO_TypeDef *) GPIOE_BASE)
  1177. #define GPIOF ((GPIO_TypeDef *) GPIOF_BASE)
  1178. #define GPIOG ((GPIO_TypeDef *) GPIOG_BASE)
  1179. #define GPIOH ((GPIO_TypeDef *) GPIOH_BASE)
  1180. #define GPIOI ((GPIO_TypeDef *) GPIOI_BASE)
  1181. #define GPIOJ ((GPIO_TypeDef *) GPIOJ_BASE)
  1182. #define GPIOK ((GPIO_TypeDef *) GPIOK_BASE)
  1183. #define CRC ((CRC_TypeDef *) CRC_BASE)
  1184. #define RCC ((RCC_TypeDef *) RCC_BASE)
  1185. #define FLASH ((FLASH_TypeDef *) FLASH_R_BASE)
  1186. #define DMA1 ((DMA_TypeDef *) DMA1_BASE)
  1187. #define DMA1_Stream0 ((DMA_Stream_TypeDef *) DMA1_Stream0_BASE)
  1188. #define DMA1_Stream1 ((DMA_Stream_TypeDef *) DMA1_Stream1_BASE)
  1189. #define DMA1_Stream2 ((DMA_Stream_TypeDef *) DMA1_Stream2_BASE)
  1190. #define DMA1_Stream3 ((DMA_Stream_TypeDef *) DMA1_Stream3_BASE)
  1191. #define DMA1_Stream4 ((DMA_Stream_TypeDef *) DMA1_Stream4_BASE)
  1192. #define DMA1_Stream5 ((DMA_Stream_TypeDef *) DMA1_Stream5_BASE)
  1193. #define DMA1_Stream6 ((DMA_Stream_TypeDef *) DMA1_Stream6_BASE)
  1194. #define DMA1_Stream7 ((DMA_Stream_TypeDef *) DMA1_Stream7_BASE)
  1195. #define DMA2 ((DMA_TypeDef *) DMA2_BASE)
  1196. #define DMA2_Stream0 ((DMA_Stream_TypeDef *) DMA2_Stream0_BASE)
  1197. #define DMA2_Stream1 ((DMA_Stream_TypeDef *) DMA2_Stream1_BASE)
  1198. #define DMA2_Stream2 ((DMA_Stream_TypeDef *) DMA2_Stream2_BASE)
  1199. #define DMA2_Stream3 ((DMA_Stream_TypeDef *) DMA2_Stream3_BASE)
  1200. #define DMA2_Stream4 ((DMA_Stream_TypeDef *) DMA2_Stream4_BASE)
  1201. #define DMA2_Stream5 ((DMA_Stream_TypeDef *) DMA2_Stream5_BASE)
  1202. #define DMA2_Stream6 ((DMA_Stream_TypeDef *) DMA2_Stream6_BASE)
  1203. #define DMA2_Stream7 ((DMA_Stream_TypeDef *) DMA2_Stream7_BASE)
  1204. #define ETH ((ETH_TypeDef *) ETH_BASE)
  1205. #define DMA2D ((DMA2D_TypeDef *)DMA2D_BASE)
  1206. #define DCMI ((DCMI_TypeDef *) DCMI_BASE)
  1207. #define CRYP ((CRYP_TypeDef *) CRYP_BASE)
  1208. #define HASH ((HASH_TypeDef *) HASH_BASE)
  1209. #define HASH_DIGEST ((HASH_DIGEST_TypeDef *) HASH_DIGEST_BASE)
  1210. #define RNG ((RNG_TypeDef *) RNG_BASE)
  1211. #define FMC_Bank1 ((FMC_Bank1_TypeDef *) FMC_Bank1_R_BASE)
  1212. #define FMC_Bank1E ((FMC_Bank1E_TypeDef *) FMC_Bank1E_R_BASE)
  1213. #define FMC_Bank2_3 ((FMC_Bank2_3_TypeDef *) FMC_Bank2_3_R_BASE)
  1214. #define FMC_Bank4 ((FMC_Bank4_TypeDef *) FMC_Bank4_R_BASE)
  1215. #define FMC_Bank5_6 ((FMC_Bank5_6_TypeDef *) FMC_Bank5_6_R_BASE)
  1216. #define DBGMCU ((DBGMCU_TypeDef *) DBGMCU_BASE)
  1217. #define USB_OTG_FS ((USB_OTG_GlobalTypeDef *) USB_OTG_FS_PERIPH_BASE)
  1218. #define USB_OTG_HS ((USB_OTG_GlobalTypeDef *) USB_OTG_HS_PERIPH_BASE)
  1219. /**
  1220. * @}
  1221. */
  1222. /** @addtogroup Exported_constants
  1223. * @{
  1224. */
  1225. /** @addtogroup Peripheral_Registers_Bits_Definition
  1226. * @{
  1227. */
  1228. /******************************************************************************/
  1229. /* Peripheral Registers_Bits_Definition */
  1230. /******************************************************************************/
  1231. /******************************************************************************/
  1232. /* */
  1233. /* Analog to Digital Converter */
  1234. /* */
  1235. /******************************************************************************/
  1236. /******************** Bit definition for ADC_SR register ********************/
  1237. #define ADC_SR_AWD ((uint32_t)0x00000001) /*!<Analog watchdog flag */
  1238. #define ADC_SR_EOC ((uint32_t)0x00000002) /*!<End of conversion */
  1239. #define ADC_SR_JEOC ((uint32_t)0x00000004) /*!<Injected channel end of conversion */
  1240. #define ADC_SR_JSTRT ((uint32_t)0x00000008) /*!<Injected channel Start flag */
  1241. #define ADC_SR_STRT ((uint32_t)0x00000010) /*!<Regular channel Start flag */
  1242. #define ADC_SR_OVR ((uint32_t)0x00000020) /*!<Overrun flag */
  1243. /******************* Bit definition for ADC_CR1 register ********************/
  1244. #define ADC_CR1_AWDCH ((uint32_t)0x0000001F) /*!<AWDCH[4:0] bits (Analog watchdog channel select bits) */
  1245. #define ADC_CR1_AWDCH_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1246. #define ADC_CR1_AWDCH_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1247. #define ADC_CR1_AWDCH_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1248. #define ADC_CR1_AWDCH_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  1249. #define ADC_CR1_AWDCH_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  1250. #define ADC_CR1_EOCIE ((uint32_t)0x00000020) /*!<Interrupt enable for EOC */
  1251. #define ADC_CR1_AWDIE ((uint32_t)0x00000040) /*!<AAnalog Watchdog interrupt enable */
  1252. #define ADC_CR1_JEOCIE ((uint32_t)0x00000080) /*!<Interrupt enable for injected channels */
  1253. #define ADC_CR1_SCAN ((uint32_t)0x00000100) /*!<Scan mode */
  1254. #define ADC_CR1_AWDSGL ((uint32_t)0x00000200) /*!<Enable the watchdog on a single channel in scan mode */
  1255. #define ADC_CR1_JAUTO ((uint32_t)0x00000400) /*!<Automatic injected group conversion */
  1256. #define ADC_CR1_DISCEN ((uint32_t)0x00000800) /*!<Discontinuous mode on regular channels */
  1257. #define ADC_CR1_JDISCEN ((uint32_t)0x00001000) /*!<Discontinuous mode on injected channels */
  1258. #define ADC_CR1_DISCNUM ((uint32_t)0x0000E000) /*!<DISCNUM[2:0] bits (Discontinuous mode channel count) */
  1259. #define ADC_CR1_DISCNUM_0 ((uint32_t)0x00002000) /*!<Bit 0 */
  1260. #define ADC_CR1_DISCNUM_1 ((uint32_t)0x00004000) /*!<Bit 1 */
  1261. #define ADC_CR1_DISCNUM_2 ((uint32_t)0x00008000) /*!<Bit 2 */
  1262. #define ADC_CR1_JAWDEN ((uint32_t)0x00400000) /*!<Analog watchdog enable on injected channels */
  1263. #define ADC_CR1_AWDEN ((uint32_t)0x00800000) /*!<Analog watchdog enable on regular channels */
  1264. #define ADC_CR1_RES ((uint32_t)0x03000000) /*!<RES[2:0] bits (Resolution) */
  1265. #define ADC_CR1_RES_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  1266. #define ADC_CR1_RES_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  1267. #define ADC_CR1_OVRIE ((uint32_t)0x04000000) /*!<overrun interrupt enable */
  1268. /******************* Bit definition for ADC_CR2 register ********************/
  1269. #define ADC_CR2_ADON ((uint32_t)0x00000001) /*!<A/D Converter ON / OFF */
  1270. #define ADC_CR2_CONT ((uint32_t)0x00000002) /*!<Continuous Conversion */
  1271. #define ADC_CR2_DMA ((uint32_t)0x00000100) /*!<Direct Memory access mode */
  1272. #define ADC_CR2_DDS ((uint32_t)0x00000200) /*!<DMA disable selection (Single ADC) */
  1273. #define ADC_CR2_EOCS ((uint32_t)0x00000400) /*!<End of conversion selection */
  1274. #define ADC_CR2_ALIGN ((uint32_t)0x00000800) /*!<Data Alignment */
  1275. #define ADC_CR2_JEXTSEL ((uint32_t)0x000F0000) /*!<JEXTSEL[3:0] bits (External event select for injected group) */
  1276. #define ADC_CR2_JEXTSEL_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  1277. #define ADC_CR2_JEXTSEL_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  1278. #define ADC_CR2_JEXTSEL_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  1279. #define ADC_CR2_JEXTSEL_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  1280. #define ADC_CR2_JEXTEN ((uint32_t)0x00300000) /*!<JEXTEN[1:0] bits (External Trigger Conversion mode for injected channelsp) */
  1281. #define ADC_CR2_JEXTEN_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  1282. #define ADC_CR2_JEXTEN_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  1283. #define ADC_CR2_JSWSTART ((uint32_t)0x00400000) /*!<Start Conversion of injected channels */
  1284. #define ADC_CR2_EXTSEL ((uint32_t)0x0F000000) /*!<EXTSEL[3:0] bits (External Event Select for regular group) */
  1285. #define ADC_CR2_EXTSEL_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  1286. #define ADC_CR2_EXTSEL_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  1287. #define ADC_CR2_EXTSEL_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  1288. #define ADC_CR2_EXTSEL_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  1289. #define ADC_CR2_EXTEN ((uint32_t)0x30000000) /*!<EXTEN[1:0] bits (External Trigger Conversion mode for regular channelsp) */
  1290. #define ADC_CR2_EXTEN_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  1291. #define ADC_CR2_EXTEN_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  1292. #define ADC_CR2_SWSTART ((uint32_t)0x40000000) /*!<Start Conversion of regular channels */
  1293. /****************** Bit definition for ADC_SMPR1 register *******************/
  1294. #define ADC_SMPR1_SMP10 ((uint32_t)0x00000007) /*!<SMP10[2:0] bits (Channel 10 Sample time selection) */
  1295. #define ADC_SMPR1_SMP10_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1296. #define ADC_SMPR1_SMP10_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1297. #define ADC_SMPR1_SMP10_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1298. #define ADC_SMPR1_SMP11 ((uint32_t)0x00000038) /*!<SMP11[2:0] bits (Channel 11 Sample time selection) */
  1299. #define ADC_SMPR1_SMP11_0 ((uint32_t)0x00000008) /*!<Bit 0 */
  1300. #define ADC_SMPR1_SMP11_1 ((uint32_t)0x00000010) /*!<Bit 1 */
  1301. #define ADC_SMPR1_SMP11_2 ((uint32_t)0x00000020) /*!<Bit 2 */
  1302. #define ADC_SMPR1_SMP12 ((uint32_t)0x000001C0) /*!<SMP12[2:0] bits (Channel 12 Sample time selection) */
  1303. #define ADC_SMPR1_SMP12_0 ((uint32_t)0x00000040) /*!<Bit 0 */
  1304. #define ADC_SMPR1_SMP12_1 ((uint32_t)0x00000080) /*!<Bit 1 */
  1305. #define ADC_SMPR1_SMP12_2 ((uint32_t)0x00000100) /*!<Bit 2 */
  1306. #define ADC_SMPR1_SMP13 ((uint32_t)0x00000E00) /*!<SMP13[2:0] bits (Channel 13 Sample time selection) */
  1307. #define ADC_SMPR1_SMP13_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  1308. #define ADC_SMPR1_SMP13_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  1309. #define ADC_SMPR1_SMP13_2 ((uint32_t)0x00000800) /*!<Bit 2 */
  1310. #define ADC_SMPR1_SMP14 ((uint32_t)0x00007000) /*!<SMP14[2:0] bits (Channel 14 Sample time selection) */
  1311. #define ADC_SMPR1_SMP14_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  1312. #define ADC_SMPR1_SMP14_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  1313. #define ADC_SMPR1_SMP14_2 ((uint32_t)0x00004000) /*!<Bit 2 */
  1314. #define ADC_SMPR1_SMP15 ((uint32_t)0x00038000) /*!<SMP15[2:0] bits (Channel 15 Sample time selection) */
  1315. #define ADC_SMPR1_SMP15_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  1316. #define ADC_SMPR1_SMP15_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  1317. #define ADC_SMPR1_SMP15_2 ((uint32_t)0x00020000) /*!<Bit 2 */
  1318. #define ADC_SMPR1_SMP16 ((uint32_t)0x001C0000) /*!<SMP16[2:0] bits (Channel 16 Sample time selection) */
  1319. #define ADC_SMPR1_SMP16_0 ((uint32_t)0x00040000) /*!<Bit 0 */
  1320. #define ADC_SMPR1_SMP16_1 ((uint32_t)0x00080000) /*!<Bit 1 */
  1321. #define ADC_SMPR1_SMP16_2 ((uint32_t)0x00100000) /*!<Bit 2 */
  1322. #define ADC_SMPR1_SMP17 ((uint32_t)0x00E00000) /*!<SMP17[2:0] bits (Channel 17 Sample time selection) */
  1323. #define ADC_SMPR1_SMP17_0 ((uint32_t)0x00200000) /*!<Bit 0 */
  1324. #define ADC_SMPR1_SMP17_1 ((uint32_t)0x00400000) /*!<Bit 1 */
  1325. #define ADC_SMPR1_SMP17_2 ((uint32_t)0x00800000) /*!<Bit 2 */
  1326. #define ADC_SMPR1_SMP18 ((uint32_t)0x07000000) /*!<SMP18[2:0] bits (Channel 18 Sample time selection) */
  1327. #define ADC_SMPR1_SMP18_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  1328. #define ADC_SMPR1_SMP18_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  1329. #define ADC_SMPR1_SMP18_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  1330. /****************** Bit definition for ADC_SMPR2 register *******************/
  1331. #define ADC_SMPR2_SMP0 ((uint32_t)0x00000007) /*!<SMP0[2:0] bits (Channel 0 Sample time selection) */
  1332. #define ADC_SMPR2_SMP0_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1333. #define ADC_SMPR2_SMP0_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1334. #define ADC_SMPR2_SMP0_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1335. #define ADC_SMPR2_SMP1 ((uint32_t)0x00000038) /*!<SMP1[2:0] bits (Channel 1 Sample time selection) */
  1336. #define ADC_SMPR2_SMP1_0 ((uint32_t)0x00000008) /*!<Bit 0 */
  1337. #define ADC_SMPR2_SMP1_1 ((uint32_t)0x00000010) /*!<Bit 1 */
  1338. #define ADC_SMPR2_SMP1_2 ((uint32_t)0x00000020) /*!<Bit 2 */
  1339. #define ADC_SMPR2_SMP2 ((uint32_t)0x000001C0) /*!<SMP2[2:0] bits (Channel 2 Sample time selection) */
  1340. #define ADC_SMPR2_SMP2_0 ((uint32_t)0x00000040) /*!<Bit 0 */
  1341. #define ADC_SMPR2_SMP2_1 ((uint32_t)0x00000080) /*!<Bit 1 */
  1342. #define ADC_SMPR2_SMP2_2 ((uint32_t)0x00000100) /*!<Bit 2 */
  1343. #define ADC_SMPR2_SMP3 ((uint32_t)0x00000E00) /*!<SMP3[2:0] bits (Channel 3 Sample time selection) */
  1344. #define ADC_SMPR2_SMP3_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  1345. #define ADC_SMPR2_SMP3_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  1346. #define ADC_SMPR2_SMP3_2 ((uint32_t)0x00000800) /*!<Bit 2 */
  1347. #define ADC_SMPR2_SMP4 ((uint32_t)0x00007000) /*!<SMP4[2:0] bits (Channel 4 Sample time selection) */
  1348. #define ADC_SMPR2_SMP4_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  1349. #define ADC_SMPR2_SMP4_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  1350. #define ADC_SMPR2_SMP4_2 ((uint32_t)0x00004000) /*!<Bit 2 */
  1351. #define ADC_SMPR2_SMP5 ((uint32_t)0x00038000) /*!<SMP5[2:0] bits (Channel 5 Sample time selection) */
  1352. #define ADC_SMPR2_SMP5_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  1353. #define ADC_SMPR2_SMP5_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  1354. #define ADC_SMPR2_SMP5_2 ((uint32_t)0x00020000) /*!<Bit 2 */
  1355. #define ADC_SMPR2_SMP6 ((uint32_t)0x001C0000) /*!<SMP6[2:0] bits (Channel 6 Sample time selection) */
  1356. #define ADC_SMPR2_SMP6_0 ((uint32_t)0x00040000) /*!<Bit 0 */
  1357. #define ADC_SMPR2_SMP6_1 ((uint32_t)0x00080000) /*!<Bit 1 */
  1358. #define ADC_SMPR2_SMP6_2 ((uint32_t)0x00100000) /*!<Bit 2 */
  1359. #define ADC_SMPR2_SMP7 ((uint32_t)0x00E00000) /*!<SMP7[2:0] bits (Channel 7 Sample time selection) */
  1360. #define ADC_SMPR2_SMP7_0 ((uint32_t)0x00200000) /*!<Bit 0 */
  1361. #define ADC_SMPR2_SMP7_1 ((uint32_t)0x00400000) /*!<Bit 1 */
  1362. #define ADC_SMPR2_SMP7_2 ((uint32_t)0x00800000) /*!<Bit 2 */
  1363. #define ADC_SMPR2_SMP8 ((uint32_t)0x07000000) /*!<SMP8[2:0] bits (Channel 8 Sample time selection) */
  1364. #define ADC_SMPR2_SMP8_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  1365. #define ADC_SMPR2_SMP8_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  1366. #define ADC_SMPR2_SMP8_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  1367. #define ADC_SMPR2_SMP9 ((uint32_t)0x38000000) /*!<SMP9[2:0] bits (Channel 9 Sample time selection) */
  1368. #define ADC_SMPR2_SMP9_0 ((uint32_t)0x08000000) /*!<Bit 0 */
  1369. #define ADC_SMPR2_SMP9_1 ((uint32_t)0x10000000) /*!<Bit 1 */
  1370. #define ADC_SMPR2_SMP9_2 ((uint32_t)0x20000000) /*!<Bit 2 */
  1371. /****************** Bit definition for ADC_JOFR1 register *******************/
  1372. #define ADC_JOFR1_JOFFSET1 ((uint32_t)0x0FFF) /*!<Data offset for injected channel 1 */
  1373. /****************** Bit definition for ADC_JOFR2 register *******************/
  1374. #define ADC_JOFR2_JOFFSET2 ((uint32_t)0x0FFF) /*!<Data offset for injected channel 2 */
  1375. /****************** Bit definition for ADC_JOFR3 register *******************/
  1376. #define ADC_JOFR3_JOFFSET3 ((uint32_t)0x0FFF) /*!<Data offset for injected channel 3 */
  1377. /****************** Bit definition for ADC_JOFR4 register *******************/
  1378. #define ADC_JOFR4_JOFFSET4 ((uint32_t)0x0FFF) /*!<Data offset for injected channel 4 */
  1379. /******************* Bit definition for ADC_HTR register ********************/
  1380. #define ADC_HTR_HT ((uint32_t)0x0FFF) /*!<Analog watchdog high threshold */
  1381. /******************* Bit definition for ADC_LTR register ********************/
  1382. #define ADC_LTR_LT ((uint32_t)0x0FFF) /*!<Analog watchdog low threshold */
  1383. /******************* Bit definition for ADC_SQR1 register *******************/
  1384. #define ADC_SQR1_SQ13 ((uint32_t)0x0000001F) /*!<SQ13[4:0] bits (13th conversion in regular sequence) */
  1385. #define ADC_SQR1_SQ13_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1386. #define ADC_SQR1_SQ13_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1387. #define ADC_SQR1_SQ13_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1388. #define ADC_SQR1_SQ13_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  1389. #define ADC_SQR1_SQ13_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  1390. #define ADC_SQR1_SQ14 ((uint32_t)0x000003E0) /*!<SQ14[4:0] bits (14th conversion in regular sequence) */
  1391. #define ADC_SQR1_SQ14_0 ((uint32_t)0x00000020) /*!<Bit 0 */
  1392. #define ADC_SQR1_SQ14_1 ((uint32_t)0x00000040) /*!<Bit 1 */
  1393. #define ADC_SQR1_SQ14_2 ((uint32_t)0x00000080) /*!<Bit 2 */
  1394. #define ADC_SQR1_SQ14_3 ((uint32_t)0x00000100) /*!<Bit 3 */
  1395. #define ADC_SQR1_SQ14_4 ((uint32_t)0x00000200) /*!<Bit 4 */
  1396. #define ADC_SQR1_SQ15 ((uint32_t)0x00007C00) /*!<SQ15[4:0] bits (15th conversion in regular sequence) */
  1397. #define ADC_SQR1_SQ15_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  1398. #define ADC_SQR1_SQ15_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  1399. #define ADC_SQR1_SQ15_2 ((uint32_t)0x00001000) /*!<Bit 2 */
  1400. #define ADC_SQR1_SQ15_3 ((uint32_t)0x00002000) /*!<Bit 3 */
  1401. #define ADC_SQR1_SQ15_4 ((uint32_t)0x00004000) /*!<Bit 4 */
  1402. #define ADC_SQR1_SQ16 ((uint32_t)0x000F8000) /*!<SQ16[4:0] bits (16th conversion in regular sequence) */
  1403. #define ADC_SQR1_SQ16_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  1404. #define ADC_SQR1_SQ16_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  1405. #define ADC_SQR1_SQ16_2 ((uint32_t)0x00020000) /*!<Bit 2 */
  1406. #define ADC_SQR1_SQ16_3 ((uint32_t)0x00040000) /*!<Bit 3 */
  1407. #define ADC_SQR1_SQ16_4 ((uint32_t)0x00080000) /*!<Bit 4 */
  1408. #define ADC_SQR1_L ((uint32_t)0x00F00000) /*!<L[3:0] bits (Regular channel sequence length) */
  1409. #define ADC_SQR1_L_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  1410. #define ADC_SQR1_L_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  1411. #define ADC_SQR1_L_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  1412. #define ADC_SQR1_L_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  1413. /******************* Bit definition for ADC_SQR2 register *******************/
  1414. #define ADC_SQR2_SQ7 ((uint32_t)0x0000001F) /*!<SQ7[4:0] bits (7th conversion in regular sequence) */
  1415. #define ADC_SQR2_SQ7_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1416. #define ADC_SQR2_SQ7_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1417. #define ADC_SQR2_SQ7_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1418. #define ADC_SQR2_SQ7_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  1419. #define ADC_SQR2_SQ7_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  1420. #define ADC_SQR2_SQ8 ((uint32_t)0x000003E0) /*!<SQ8[4:0] bits (8th conversion in regular sequence) */
  1421. #define ADC_SQR2_SQ8_0 ((uint32_t)0x00000020) /*!<Bit 0 */
  1422. #define ADC_SQR2_SQ8_1 ((uint32_t)0x00000040) /*!<Bit 1 */
  1423. #define ADC_SQR2_SQ8_2 ((uint32_t)0x00000080) /*!<Bit 2 */
  1424. #define ADC_SQR2_SQ8_3 ((uint32_t)0x00000100) /*!<Bit 3 */
  1425. #define ADC_SQR2_SQ8_4 ((uint32_t)0x00000200) /*!<Bit 4 */
  1426. #define ADC_SQR2_SQ9 ((uint32_t)0x00007C00) /*!<SQ9[4:0] bits (9th conversion in regular sequence) */
  1427. #define ADC_SQR2_SQ9_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  1428. #define ADC_SQR2_SQ9_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  1429. #define ADC_SQR2_SQ9_2 ((uint32_t)0x00001000) /*!<Bit 2 */
  1430. #define ADC_SQR2_SQ9_3 ((uint32_t)0x00002000) /*!<Bit 3 */
  1431. #define ADC_SQR2_SQ9_4 ((uint32_t)0x00004000) /*!<Bit 4 */
  1432. #define ADC_SQR2_SQ10 ((uint32_t)0x000F8000) /*!<SQ10[4:0] bits (10th conversion in regular sequence) */
  1433. #define ADC_SQR2_SQ10_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  1434. #define ADC_SQR2_SQ10_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  1435. #define ADC_SQR2_SQ10_2 ((uint32_t)0x00020000) /*!<Bit 2 */
  1436. #define ADC_SQR2_SQ10_3 ((uint32_t)0x00040000) /*!<Bit 3 */
  1437. #define ADC_SQR2_SQ10_4 ((uint32_t)0x00080000) /*!<Bit 4 */
  1438. #define ADC_SQR2_SQ11 ((uint32_t)0x01F00000) /*!<SQ11[4:0] bits (11th conversion in regular sequence) */
  1439. #define ADC_SQR2_SQ11_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  1440. #define ADC_SQR2_SQ11_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  1441. #define ADC_SQR2_SQ11_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  1442. #define ADC_SQR2_SQ11_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  1443. #define ADC_SQR2_SQ11_4 ((uint32_t)0x01000000) /*!<Bit 4 */
  1444. #define ADC_SQR2_SQ12 ((uint32_t)0x3E000000) /*!<SQ12[4:0] bits (12th conversion in regular sequence) */
  1445. #define ADC_SQR2_SQ12_0 ((uint32_t)0x02000000) /*!<Bit 0 */
  1446. #define ADC_SQR2_SQ12_1 ((uint32_t)0x04000000) /*!<Bit 1 */
  1447. #define ADC_SQR2_SQ12_2 ((uint32_t)0x08000000) /*!<Bit 2 */
  1448. #define ADC_SQR2_SQ12_3 ((uint32_t)0x10000000) /*!<Bit 3 */
  1449. #define ADC_SQR2_SQ12_4 ((uint32_t)0x20000000) /*!<Bit 4 */
  1450. /******************* Bit definition for ADC_SQR3 register *******************/
  1451. #define ADC_SQR3_SQ1 ((uint32_t)0x0000001F) /*!<SQ1[4:0] bits (1st conversion in regular sequence) */
  1452. #define ADC_SQR3_SQ1_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1453. #define ADC_SQR3_SQ1_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1454. #define ADC_SQR3_SQ1_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1455. #define ADC_SQR3_SQ1_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  1456. #define ADC_SQR3_SQ1_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  1457. #define ADC_SQR3_SQ2 ((uint32_t)0x000003E0) /*!<SQ2[4:0] bits (2nd conversion in regular sequence) */
  1458. #define ADC_SQR3_SQ2_0 ((uint32_t)0x00000020) /*!<Bit 0 */
  1459. #define ADC_SQR3_SQ2_1 ((uint32_t)0x00000040) /*!<Bit 1 */
  1460. #define ADC_SQR3_SQ2_2 ((uint32_t)0x00000080) /*!<Bit 2 */
  1461. #define ADC_SQR3_SQ2_3 ((uint32_t)0x00000100) /*!<Bit 3 */
  1462. #define ADC_SQR3_SQ2_4 ((uint32_t)0x00000200) /*!<Bit 4 */
  1463. #define ADC_SQR3_SQ3 ((uint32_t)0x00007C00) /*!<SQ3[4:0] bits (3rd conversion in regular sequence) */
  1464. #define ADC_SQR3_SQ3_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  1465. #define ADC_SQR3_SQ3_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  1466. #define ADC_SQR3_SQ3_2 ((uint32_t)0x00001000) /*!<Bit 2 */
  1467. #define ADC_SQR3_SQ3_3 ((uint32_t)0x00002000) /*!<Bit 3 */
  1468. #define ADC_SQR3_SQ3_4 ((uint32_t)0x00004000) /*!<Bit 4 */
  1469. #define ADC_SQR3_SQ4 ((uint32_t)0x000F8000) /*!<SQ4[4:0] bits (4th conversion in regular sequence) */
  1470. #define ADC_SQR3_SQ4_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  1471. #define ADC_SQR3_SQ4_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  1472. #define ADC_SQR3_SQ4_2 ((uint32_t)0x00020000) /*!<Bit 2 */
  1473. #define ADC_SQR3_SQ4_3 ((uint32_t)0x00040000) /*!<Bit 3 */
  1474. #define ADC_SQR3_SQ4_4 ((uint32_t)0x00080000) /*!<Bit 4 */
  1475. #define ADC_SQR3_SQ5 ((uint32_t)0x01F00000) /*!<SQ5[4:0] bits (5th conversion in regular sequence) */
  1476. #define ADC_SQR3_SQ5_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  1477. #define ADC_SQR3_SQ5_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  1478. #define ADC_SQR3_SQ5_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  1479. #define ADC_SQR3_SQ5_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  1480. #define ADC_SQR3_SQ5_4 ((uint32_t)0x01000000) /*!<Bit 4 */
  1481. #define ADC_SQR3_SQ6 ((uint32_t)0x3E000000) /*!<SQ6[4:0] bits (6th conversion in regular sequence) */
  1482. #define ADC_SQR3_SQ6_0 ((uint32_t)0x02000000) /*!<Bit 0 */
  1483. #define ADC_SQR3_SQ6_1 ((uint32_t)0x04000000) /*!<Bit 1 */
  1484. #define ADC_SQR3_SQ6_2 ((uint32_t)0x08000000) /*!<Bit 2 */
  1485. #define ADC_SQR3_SQ6_3 ((uint32_t)0x10000000) /*!<Bit 3 */
  1486. #define ADC_SQR3_SQ6_4 ((uint32_t)0x20000000) /*!<Bit 4 */
  1487. /******************* Bit definition for ADC_JSQR register *******************/
  1488. #define ADC_JSQR_JSQ1 ((uint32_t)0x0000001F) /*!<JSQ1[4:0] bits (1st conversion in injected sequence) */
  1489. #define ADC_JSQR_JSQ1_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1490. #define ADC_JSQR_JSQ1_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1491. #define ADC_JSQR_JSQ1_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1492. #define ADC_JSQR_JSQ1_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  1493. #define ADC_JSQR_JSQ1_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  1494. #define ADC_JSQR_JSQ2 ((uint32_t)0x000003E0) /*!<JSQ2[4:0] bits (2nd conversion in injected sequence) */
  1495. #define ADC_JSQR_JSQ2_0 ((uint32_t)0x00000020) /*!<Bit 0 */
  1496. #define ADC_JSQR_JSQ2_1 ((uint32_t)0x00000040) /*!<Bit 1 */
  1497. #define ADC_JSQR_JSQ2_2 ((uint32_t)0x00000080) /*!<Bit 2 */
  1498. #define ADC_JSQR_JSQ2_3 ((uint32_t)0x00000100) /*!<Bit 3 */
  1499. #define ADC_JSQR_JSQ2_4 ((uint32_t)0x00000200) /*!<Bit 4 */
  1500. #define ADC_JSQR_JSQ3 ((uint32_t)0x00007C00) /*!<JSQ3[4:0] bits (3rd conversion in injected sequence) */
  1501. #define ADC_JSQR_JSQ3_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  1502. #define ADC_JSQR_JSQ3_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  1503. #define ADC_JSQR_JSQ3_2 ((uint32_t)0x00001000) /*!<Bit 2 */
  1504. #define ADC_JSQR_JSQ3_3 ((uint32_t)0x00002000) /*!<Bit 3 */
  1505. #define ADC_JSQR_JSQ3_4 ((uint32_t)0x00004000) /*!<Bit 4 */
  1506. #define ADC_JSQR_JSQ4 ((uint32_t)0x000F8000) /*!<JSQ4[4:0] bits (4th conversion in injected sequence) */
  1507. #define ADC_JSQR_JSQ4_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  1508. #define ADC_JSQR_JSQ4_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  1509. #define ADC_JSQR_JSQ4_2 ((uint32_t)0x00020000) /*!<Bit 2 */
  1510. #define ADC_JSQR_JSQ4_3 ((uint32_t)0x00040000) /*!<Bit 3 */
  1511. #define ADC_JSQR_JSQ4_4 ((uint32_t)0x00080000) /*!<Bit 4 */
  1512. #define ADC_JSQR_JL ((uint32_t)0x00300000) /*!<JL[1:0] bits (Injected Sequence length) */
  1513. #define ADC_JSQR_JL_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  1514. #define ADC_JSQR_JL_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  1515. /******************* Bit definition for ADC_JDR1 register *******************/
  1516. #define ADC_JDR1_JDATA ((uint32_t)0xFFFF) /*!<Injected data */
  1517. /******************* Bit definition for ADC_JDR2 register *******************/
  1518. #define ADC_JDR2_JDATA ((uint32_t)0xFFFF) /*!<Injected data */
  1519. /******************* Bit definition for ADC_JDR3 register *******************/
  1520. #define ADC_JDR3_JDATA ((uint32_t)0xFFFF) /*!<Injected data */
  1521. /******************* Bit definition for ADC_JDR4 register *******************/
  1522. #define ADC_JDR4_JDATA ((uint32_t)0xFFFF) /*!<Injected data */
  1523. /******************** Bit definition for ADC_DR register ********************/
  1524. #define ADC_DR_DATA ((uint32_t)0x0000FFFF) /*!<Regular data */
  1525. #define ADC_DR_ADC2DATA ((uint32_t)0xFFFF0000) /*!<ADC2 data */
  1526. /******************* Bit definition for ADC_CSR register ********************/
  1527. #define ADC_CSR_AWD1 ((uint32_t)0x00000001) /*!<ADC1 Analog watchdog flag */
  1528. #define ADC_CSR_EOC1 ((uint32_t)0x00000002) /*!<ADC1 End of conversion */
  1529. #define ADC_CSR_JEOC1 ((uint32_t)0x00000004) /*!<ADC1 Injected channel end of conversion */
  1530. #define ADC_CSR_JSTRT1 ((uint32_t)0x00000008) /*!<ADC1 Injected channel Start flag */
  1531. #define ADC_CSR_STRT1 ((uint32_t)0x00000010) /*!<ADC1 Regular channel Start flag */
  1532. #define ADC_CSR_DOVR1 ((uint32_t)0x00000020) /*!<ADC1 DMA overrun flag */
  1533. #define ADC_CSR_AWD2 ((uint32_t)0x00000100) /*!<ADC2 Analog watchdog flag */
  1534. #define ADC_CSR_EOC2 ((uint32_t)0x00000200) /*!<ADC2 End of conversion */
  1535. #define ADC_CSR_JEOC2 ((uint32_t)0x00000400) /*!<ADC2 Injected channel end of conversion */
  1536. #define ADC_CSR_JSTRT2 ((uint32_t)0x00000800) /*!<ADC2 Injected channel Start flag */
  1537. #define ADC_CSR_STRT2 ((uint32_t)0x00001000) /*!<ADC2 Regular channel Start flag */
  1538. #define ADC_CSR_DOVR2 ((uint32_t)0x00002000) /*!<ADC2 DMA overrun flag */
  1539. #define ADC_CSR_AWD3 ((uint32_t)0x00010000) /*!<ADC3 Analog watchdog flag */
  1540. #define ADC_CSR_EOC3 ((uint32_t)0x00020000) /*!<ADC3 End of conversion */
  1541. #define ADC_CSR_JEOC3 ((uint32_t)0x00040000) /*!<ADC3 Injected channel end of conversion */
  1542. #define ADC_CSR_JSTRT3 ((uint32_t)0x00080000) /*!<ADC3 Injected channel Start flag */
  1543. #define ADC_CSR_STRT3 ((uint32_t)0x00100000) /*!<ADC3 Regular channel Start flag */
  1544. #define ADC_CSR_DOVR3 ((uint32_t)0x00200000) /*!<ADC3 DMA overrun flag */
  1545. /******************* Bit definition for ADC_CCR register ********************/
  1546. #define ADC_CCR_MULTI ((uint32_t)0x0000001F) /*!<MULTI[4:0] bits (Multi-ADC mode selection) */
  1547. #define ADC_CCR_MULTI_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1548. #define ADC_CCR_MULTI_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1549. #define ADC_CCR_MULTI_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1550. #define ADC_CCR_MULTI_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  1551. #define ADC_CCR_MULTI_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  1552. #define ADC_CCR_DELAY ((uint32_t)0x00000F00) /*!<DELAY[3:0] bits (Delay between 2 sampling phases) */
  1553. #define ADC_CCR_DELAY_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  1554. #define ADC_CCR_DELAY_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  1555. #define ADC_CCR_DELAY_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  1556. #define ADC_CCR_DELAY_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  1557. #define ADC_CCR_DDS ((uint32_t)0x00002000) /*!<DMA disable selection (Multi-ADC mode) */
  1558. #define ADC_CCR_DMA ((uint32_t)0x0000C000) /*!<DMA[1:0] bits (Direct Memory Access mode for multimode) */
  1559. #define ADC_CCR_DMA_0 ((uint32_t)0x00004000) /*!<Bit 0 */
  1560. #define ADC_CCR_DMA_1 ((uint32_t)0x00008000) /*!<Bit 1 */
  1561. #define ADC_CCR_ADCPRE ((uint32_t)0x00030000) /*!<ADCPRE[1:0] bits (ADC prescaler) */
  1562. #define ADC_CCR_ADCPRE_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  1563. #define ADC_CCR_ADCPRE_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  1564. #define ADC_CCR_VBATE ((uint32_t)0x00400000) /*!<VBAT Enable */
  1565. #define ADC_CCR_TSVREFE ((uint32_t)0x00800000) /*!<Temperature Sensor and VREFINT Enable */
  1566. /******************* Bit definition for ADC_CDR register ********************/
  1567. #define ADC_CDR_DATA1 ((uint32_t)0x0000FFFF) /*!<1st data of a pair of regular conversions */
  1568. #define ADC_CDR_DATA2 ((uint32_t)0xFFFF0000) /*!<2nd data of a pair of regular conversions */
  1569. /******************************************************************************/
  1570. /* */
  1571. /* Controller Area Network */
  1572. /* */
  1573. /******************************************************************************/
  1574. /*!<CAN control and status registers */
  1575. /******************* Bit definition for CAN_MCR register ********************/
  1576. #define CAN_MCR_INRQ ((uint32_t)0x00000001) /*!<Initialization Request */
  1577. #define CAN_MCR_SLEEP ((uint32_t)0x00000002) /*!<Sleep Mode Request */
  1578. #define CAN_MCR_TXFP ((uint32_t)0x00000004) /*!<Transmit FIFO Priority */
  1579. #define CAN_MCR_RFLM ((uint32_t)0x00000008) /*!<Receive FIFO Locked Mode */
  1580. #define CAN_MCR_NART ((uint32_t)0x00000010) /*!<No Automatic Retransmission */
  1581. #define CAN_MCR_AWUM ((uint32_t)0x00000020) /*!<Automatic Wakeup Mode */
  1582. #define CAN_MCR_ABOM ((uint32_t)0x00000040) /*!<Automatic Bus-Off Management */
  1583. #define CAN_MCR_TTCM ((uint32_t)0x00000080) /*!<Time Triggered Communication Mode */
  1584. #define CAN_MCR_RESET ((uint32_t)0x00008000) /*!<bxCAN software master reset */
  1585. #define CAN_MCR_DBF ((uint32_t)0x00010000) /*!<bxCAN Debug freeze */
  1586. /******************* Bit definition for CAN_MSR register ********************/
  1587. #define CAN_MSR_INAK ((uint32_t)0x0001) /*!<Initialization Acknowledge */
  1588. #define CAN_MSR_SLAK ((uint32_t)0x0002) /*!<Sleep Acknowledge */
  1589. #define CAN_MSR_ERRI ((uint32_t)0x0004) /*!<Error Interrupt */
  1590. #define CAN_MSR_WKUI ((uint32_t)0x0008) /*!<Wakeup Interrupt */
  1591. #define CAN_MSR_SLAKI ((uint32_t)0x0010) /*!<Sleep Acknowledge Interrupt */
  1592. #define CAN_MSR_TXM ((uint32_t)0x0100) /*!<Transmit Mode */
  1593. #define CAN_MSR_RXM ((uint32_t)0x0200) /*!<Receive Mode */
  1594. #define CAN_MSR_SAMP ((uint32_t)0x0400) /*!<Last Sample Point */
  1595. #define CAN_MSR_RX ((uint32_t)0x0800) /*!<CAN Rx Signal */
  1596. /******************* Bit definition for CAN_TSR register ********************/
  1597. #define CAN_TSR_RQCP0 ((uint32_t)0x00000001) /*!<Request Completed Mailbox0 */
  1598. #define CAN_TSR_TXOK0 ((uint32_t)0x00000002) /*!<Transmission OK of Mailbox0 */
  1599. #define CAN_TSR_ALST0 ((uint32_t)0x00000004) /*!<Arbitration Lost for Mailbox0 */
  1600. #define CAN_TSR_TERR0 ((uint32_t)0x00000008) /*!<Transmission Error of Mailbox0 */
  1601. #define CAN_TSR_ABRQ0 ((uint32_t)0x00000080) /*!<Abort Request for Mailbox0 */
  1602. #define CAN_TSR_RQCP1 ((uint32_t)0x00000100) /*!<Request Completed Mailbox1 */
  1603. #define CAN_TSR_TXOK1 ((uint32_t)0x00000200) /*!<Transmission OK of Mailbox1 */
  1604. #define CAN_TSR_ALST1 ((uint32_t)0x00000400) /*!<Arbitration Lost for Mailbox1 */
  1605. #define CAN_TSR_TERR1 ((uint32_t)0x00000800) /*!<Transmission Error of Mailbox1 */
  1606. #define CAN_TSR_ABRQ1 ((uint32_t)0x00008000) /*!<Abort Request for Mailbox 1 */
  1607. #define CAN_TSR_RQCP2 ((uint32_t)0x00010000) /*!<Request Completed Mailbox2 */
  1608. #define CAN_TSR_TXOK2 ((uint32_t)0x00020000) /*!<Transmission OK of Mailbox 2 */
  1609. #define CAN_TSR_ALST2 ((uint32_t)0x00040000) /*!<Arbitration Lost for mailbox 2 */
  1610. #define CAN_TSR_TERR2 ((uint32_t)0x00080000) /*!<Transmission Error of Mailbox 2 */
  1611. #define CAN_TSR_ABRQ2 ((uint32_t)0x00800000) /*!<Abort Request for Mailbox 2 */
  1612. #define CAN_TSR_CODE ((uint32_t)0x03000000) /*!<Mailbox Code */
  1613. #define CAN_TSR_TME ((uint32_t)0x1C000000) /*!<TME[2:0] bits */
  1614. #define CAN_TSR_TME0 ((uint32_t)0x04000000) /*!<Transmit Mailbox 0 Empty */
  1615. #define CAN_TSR_TME1 ((uint32_t)0x08000000) /*!<Transmit Mailbox 1 Empty */
  1616. #define CAN_TSR_TME2 ((uint32_t)0x10000000) /*!<Transmit Mailbox 2 Empty */
  1617. #define CAN_TSR_LOW ((uint32_t)0xE0000000) /*!<LOW[2:0] bits */
  1618. #define CAN_TSR_LOW0 ((uint32_t)0x20000000) /*!<Lowest Priority Flag for Mailbox 0 */
  1619. #define CAN_TSR_LOW1 ((uint32_t)0x40000000) /*!<Lowest Priority Flag for Mailbox 1 */
  1620. #define CAN_TSR_LOW2 ((uint32_t)0x80000000) /*!<Lowest Priority Flag for Mailbox 2 */
  1621. /******************* Bit definition for CAN_RF0R register *******************/
  1622. #define CAN_RF0R_FMP0 ((uint32_t)0x03) /*!<FIFO 0 Message Pending */
  1623. #define CAN_RF0R_FULL0 ((uint32_t)0x08) /*!<FIFO 0 Full */
  1624. #define CAN_RF0R_FOVR0 ((uint32_t)0x10) /*!<FIFO 0 Overrun */
  1625. #define CAN_RF0R_RFOM0 ((uint32_t)0x20) /*!<Release FIFO 0 Output Mailbox */
  1626. /******************* Bit definition for CAN_RF1R register *******************/
  1627. #define CAN_RF1R_FMP1 ((uint32_t)0x03) /*!<FIFO 1 Message Pending */
  1628. #define CAN_RF1R_FULL1 ((uint32_t)0x08) /*!<FIFO 1 Full */
  1629. #define CAN_RF1R_FOVR1 ((uint32_t)0x10) /*!<FIFO 1 Overrun */
  1630. #define CAN_RF1R_RFOM1 ((uint32_t)0x20) /*!<Release FIFO 1 Output Mailbox */
  1631. /******************** Bit definition for CAN_IER register *******************/
  1632. #define CAN_IER_TMEIE ((uint32_t)0x00000001) /*!<Transmit Mailbox Empty Interrupt Enable */
  1633. #define CAN_IER_FMPIE0 ((uint32_t)0x00000002) /*!<FIFO Message Pending Interrupt Enable */
  1634. #define CAN_IER_FFIE0 ((uint32_t)0x00000004) /*!<FIFO Full Interrupt Enable */
  1635. #define CAN_IER_FOVIE0 ((uint32_t)0x00000008) /*!<FIFO Overrun Interrupt Enable */
  1636. #define CAN_IER_FMPIE1 ((uint32_t)0x00000010) /*!<FIFO Message Pending Interrupt Enable */
  1637. #define CAN_IER_FFIE1 ((uint32_t)0x00000020) /*!<FIFO Full Interrupt Enable */
  1638. #define CAN_IER_FOVIE1 ((uint32_t)0x00000040) /*!<FIFO Overrun Interrupt Enable */
  1639. #define CAN_IER_EWGIE ((uint32_t)0x00000100) /*!<Error Warning Interrupt Enable */
  1640. #define CAN_IER_EPVIE ((uint32_t)0x00000200) /*!<Error Passive Interrupt Enable */
  1641. #define CAN_IER_BOFIE ((uint32_t)0x00000400) /*!<Bus-Off Interrupt Enable */
  1642. #define CAN_IER_LECIE ((uint32_t)0x00000800) /*!<Last Error Code Interrupt Enable */
  1643. #define CAN_IER_ERRIE ((uint32_t)0x00008000) /*!<Error Interrupt Enable */
  1644. #define CAN_IER_WKUIE ((uint32_t)0x00010000) /*!<Wakeup Interrupt Enable */
  1645. #define CAN_IER_SLKIE ((uint32_t)0x00020000) /*!<Sleep Interrupt Enable */
  1646. #define CAN_IER_EWGIE ((uint32_t)0x00000100) /*!<Error warning interrupt enable */
  1647. #define CAN_IER_EPVIE ((uint32_t)0x00000200) /*!<Error passive interrupt enable */
  1648. #define CAN_IER_BOFIE ((uint32_t)0x00000400) /*!<Bus-off interrupt enable */
  1649. #define CAN_IER_LECIE ((uint32_t)0x00000800) /*!<Last error code interrupt enable */
  1650. #define CAN_IER_ERRIE ((uint32_t)0x00008000) /*!<Error interrupt enable */
  1651. /******************** Bit definition for CAN_ESR register *******************/
  1652. #define CAN_ESR_EWGF ((uint32_t)0x00000001) /*!<Error Warning Flag */
  1653. #define CAN_ESR_EPVF ((uint32_t)0x00000002) /*!<Error Passive Flag */
  1654. #define CAN_ESR_BOFF ((uint32_t)0x00000004) /*!<Bus-Off Flag */
  1655. #define CAN_ESR_LEC ((uint32_t)0x00000070) /*!<LEC[2:0] bits (Last Error Code) */
  1656. #define CAN_ESR_LEC_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  1657. #define CAN_ESR_LEC_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  1658. #define CAN_ESR_LEC_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  1659. #define CAN_ESR_TEC ((uint32_t)0x00FF0000) /*!<Least significant byte of the 9-bit Transmit Error Counter */
  1660. #define CAN_ESR_REC ((uint32_t)0xFF000000) /*!<Receive Error Counter */
  1661. /******************* Bit definition for CAN_BTR register ********************/
  1662. #define CAN_BTR_BRP ((uint32_t)0x000003FF) /*!<Baud Rate Prescaler */
  1663. #define CAN_BTR_TS1 ((uint32_t)0x000F0000) /*!<Time Segment 1 */
  1664. #define CAN_BTR_TS1_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  1665. #define CAN_BTR_TS1_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  1666. #define CAN_BTR_TS1_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  1667. #define CAN_BTR_TS1_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  1668. #define CAN_BTR_TS2 ((uint32_t)0x00700000) /*!<Time Segment 2 */
  1669. #define CAN_BTR_TS2_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  1670. #define CAN_BTR_TS2_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  1671. #define CAN_BTR_TS2_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  1672. #define CAN_BTR_SJW ((uint32_t)0x03000000) /*!<Resynchronization Jump Width */
  1673. #define CAN_BTR_SJW_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  1674. #define CAN_BTR_SJW_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  1675. #define CAN_BTR_LBKM ((uint32_t)0x40000000) /*!<Loop Back Mode (Debug) */
  1676. #define CAN_BTR_SILM ((uint32_t)0x80000000) /*!<Silent Mode */
  1677. /*!<Mailbox registers */
  1678. /****************** Bit definition for CAN_TI0R register ********************/
  1679. #define CAN_TI0R_TXRQ ((uint32_t)0x00000001) /*!<Transmit Mailbox Request */
  1680. #define CAN_TI0R_RTR ((uint32_t)0x00000002) /*!<Remote Transmission Request */
  1681. #define CAN_TI0R_IDE ((uint32_t)0x00000004) /*!<Identifier Extension */
  1682. #define CAN_TI0R_EXID ((uint32_t)0x001FFFF8) /*!<Extended Identifier */
  1683. #define CAN_TI0R_STID ((uint32_t)0xFFE00000) /*!<Standard Identifier or Extended Identifier */
  1684. /****************** Bit definition for CAN_TDT0R register *******************/
  1685. #define CAN_TDT0R_DLC ((uint32_t)0x0000000F) /*!<Data Length Code */
  1686. #define CAN_TDT0R_TGT ((uint32_t)0x00000100) /*!<Transmit Global Time */
  1687. #define CAN_TDT0R_TIME ((uint32_t)0xFFFF0000) /*!<Message Time Stamp */
  1688. /****************** Bit definition for CAN_TDL0R register *******************/
  1689. #define CAN_TDL0R_DATA0 ((uint32_t)0x000000FF) /*!<Data byte 0 */
  1690. #define CAN_TDL0R_DATA1 ((uint32_t)0x0000FF00) /*!<Data byte 1 */
  1691. #define CAN_TDL0R_DATA2 ((uint32_t)0x00FF0000) /*!<Data byte 2 */
  1692. #define CAN_TDL0R_DATA3 ((uint32_t)0xFF000000) /*!<Data byte 3 */
  1693. /****************** Bit definition for CAN_TDH0R register *******************/
  1694. #define CAN_TDH0R_DATA4 ((uint32_t)0x000000FF) /*!<Data byte 4 */
  1695. #define CAN_TDH0R_DATA5 ((uint32_t)0x0000FF00) /*!<Data byte 5 */
  1696. #define CAN_TDH0R_DATA6 ((uint32_t)0x00FF0000) /*!<Data byte 6 */
  1697. #define CAN_TDH0R_DATA7 ((uint32_t)0xFF000000) /*!<Data byte 7 */
  1698. /******************* Bit definition for CAN_TI1R register *******************/
  1699. #define CAN_TI1R_TXRQ ((uint32_t)0x00000001) /*!<Transmit Mailbox Request */
  1700. #define CAN_TI1R_RTR ((uint32_t)0x00000002) /*!<Remote Transmission Request */
  1701. #define CAN_TI1R_IDE ((uint32_t)0x00000004) /*!<Identifier Extension */
  1702. #define CAN_TI1R_EXID ((uint32_t)0x001FFFF8) /*!<Extended Identifier */
  1703. #define CAN_TI1R_STID ((uint32_t)0xFFE00000) /*!<Standard Identifier or Extended Identifier */
  1704. /******************* Bit definition for CAN_TDT1R register ******************/
  1705. #define CAN_TDT1R_DLC ((uint32_t)0x0000000F) /*!<Data Length Code */
  1706. #define CAN_TDT1R_TGT ((uint32_t)0x00000100) /*!<Transmit Global Time */
  1707. #define CAN_TDT1R_TIME ((uint32_t)0xFFFF0000) /*!<Message Time Stamp */
  1708. /******************* Bit definition for CAN_TDL1R register ******************/
  1709. #define CAN_TDL1R_DATA0 ((uint32_t)0x000000FF) /*!<Data byte 0 */
  1710. #define CAN_TDL1R_DATA1 ((uint32_t)0x0000FF00) /*!<Data byte 1 */
  1711. #define CAN_TDL1R_DATA2 ((uint32_t)0x00FF0000) /*!<Data byte 2 */
  1712. #define CAN_TDL1R_DATA3 ((uint32_t)0xFF000000) /*!<Data byte 3 */
  1713. /******************* Bit definition for CAN_TDH1R register ******************/
  1714. #define CAN_TDH1R_DATA4 ((uint32_t)0x000000FF) /*!<Data byte 4 */
  1715. #define CAN_TDH1R_DATA5 ((uint32_t)0x0000FF00) /*!<Data byte 5 */
  1716. #define CAN_TDH1R_DATA6 ((uint32_t)0x00FF0000) /*!<Data byte 6 */
  1717. #define CAN_TDH1R_DATA7 ((uint32_t)0xFF000000) /*!<Data byte 7 */
  1718. /******************* Bit definition for CAN_TI2R register *******************/
  1719. #define CAN_TI2R_TXRQ ((uint32_t)0x00000001) /*!<Transmit Mailbox Request */
  1720. #define CAN_TI2R_RTR ((uint32_t)0x00000002) /*!<Remote Transmission Request */
  1721. #define CAN_TI2R_IDE ((uint32_t)0x00000004) /*!<Identifier Extension */
  1722. #define CAN_TI2R_EXID ((uint32_t)0x001FFFF8) /*!<Extended identifier */
  1723. #define CAN_TI2R_STID ((uint32_t)0xFFE00000) /*!<Standard Identifier or Extended Identifier */
  1724. /******************* Bit definition for CAN_TDT2R register ******************/
  1725. #define CAN_TDT2R_DLC ((uint32_t)0x0000000F) /*!<Data Length Code */
  1726. #define CAN_TDT2R_TGT ((uint32_t)0x00000100) /*!<Transmit Global Time */
  1727. #define CAN_TDT2R_TIME ((uint32_t)0xFFFF0000) /*!<Message Time Stamp */
  1728. /******************* Bit definition for CAN_TDL2R register ******************/
  1729. #define CAN_TDL2R_DATA0 ((uint32_t)0x000000FF) /*!<Data byte 0 */
  1730. #define CAN_TDL2R_DATA1 ((uint32_t)0x0000FF00) /*!<Data byte 1 */
  1731. #define CAN_TDL2R_DATA2 ((uint32_t)0x00FF0000) /*!<Data byte 2 */
  1732. #define CAN_TDL2R_DATA3 ((uint32_t)0xFF000000) /*!<Data byte 3 */
  1733. /******************* Bit definition for CAN_TDH2R register ******************/
  1734. #define CAN_TDH2R_DATA4 ((uint32_t)0x000000FF) /*!<Data byte 4 */
  1735. #define CAN_TDH2R_DATA5 ((uint32_t)0x0000FF00) /*!<Data byte 5 */
  1736. #define CAN_TDH2R_DATA6 ((uint32_t)0x00FF0000) /*!<Data byte 6 */
  1737. #define CAN_TDH2R_DATA7 ((uint32_t)0xFF000000) /*!<Data byte 7 */
  1738. /******************* Bit definition for CAN_RI0R register *******************/
  1739. #define CAN_RI0R_RTR ((uint32_t)0x00000002) /*!<Remote Transmission Request */
  1740. #define CAN_RI0R_IDE ((uint32_t)0x00000004) /*!<Identifier Extension */
  1741. #define CAN_RI0R_EXID ((uint32_t)0x001FFFF8) /*!<Extended Identifier */
  1742. #define CAN_RI0R_STID ((uint32_t)0xFFE00000) /*!<Standard Identifier or Extended Identifier */
  1743. /******************* Bit definition for CAN_RDT0R register ******************/
  1744. #define CAN_RDT0R_DLC ((uint32_t)0x0000000F) /*!<Data Length Code */
  1745. #define CAN_RDT0R_FMI ((uint32_t)0x0000FF00) /*!<Filter Match Index */
  1746. #define CAN_RDT0R_TIME ((uint32_t)0xFFFF0000) /*!<Message Time Stamp */
  1747. /******************* Bit definition for CAN_RDL0R register ******************/
  1748. #define CAN_RDL0R_DATA0 ((uint32_t)0x000000FF) /*!<Data byte 0 */
  1749. #define CAN_RDL0R_DATA1 ((uint32_t)0x0000FF00) /*!<Data byte 1 */
  1750. #define CAN_RDL0R_DATA2 ((uint32_t)0x00FF0000) /*!<Data byte 2 */
  1751. #define CAN_RDL0R_DATA3 ((uint32_t)0xFF000000) /*!<Data byte 3 */
  1752. /******************* Bit definition for CAN_RDH0R register ******************/
  1753. #define CAN_RDH0R_DATA4 ((uint32_t)0x000000FF) /*!<Data byte 4 */
  1754. #define CAN_RDH0R_DATA5 ((uint32_t)0x0000FF00) /*!<Data byte 5 */
  1755. #define CAN_RDH0R_DATA6 ((uint32_t)0x00FF0000) /*!<Data byte 6 */
  1756. #define CAN_RDH0R_DATA7 ((uint32_t)0xFF000000) /*!<Data byte 7 */
  1757. /******************* Bit definition for CAN_RI1R register *******************/
  1758. #define CAN_RI1R_RTR ((uint32_t)0x00000002) /*!<Remote Transmission Request */
  1759. #define CAN_RI1R_IDE ((uint32_t)0x00000004) /*!<Identifier Extension */
  1760. #define CAN_RI1R_EXID ((uint32_t)0x001FFFF8) /*!<Extended identifier */
  1761. #define CAN_RI1R_STID ((uint32_t)0xFFE00000) /*!<Standard Identifier or Extended Identifier */
  1762. /******************* Bit definition for CAN_RDT1R register ******************/
  1763. #define CAN_RDT1R_DLC ((uint32_t)0x0000000F) /*!<Data Length Code */
  1764. #define CAN_RDT1R_FMI ((uint32_t)0x0000FF00) /*!<Filter Match Index */
  1765. #define CAN_RDT1R_TIME ((uint32_t)0xFFFF0000) /*!<Message Time Stamp */
  1766. /******************* Bit definition for CAN_RDL1R register ******************/
  1767. #define CAN_RDL1R_DATA0 ((uint32_t)0x000000FF) /*!<Data byte 0 */
  1768. #define CAN_RDL1R_DATA1 ((uint32_t)0x0000FF00) /*!<Data byte 1 */
  1769. #define CAN_RDL1R_DATA2 ((uint32_t)0x00FF0000) /*!<Data byte 2 */
  1770. #define CAN_RDL1R_DATA3 ((uint32_t)0xFF000000) /*!<Data byte 3 */
  1771. /******************* Bit definition for CAN_RDH1R register ******************/
  1772. #define CAN_RDH1R_DATA4 ((uint32_t)0x000000FF) /*!<Data byte 4 */
  1773. #define CAN_RDH1R_DATA5 ((uint32_t)0x0000FF00) /*!<Data byte 5 */
  1774. #define CAN_RDH1R_DATA6 ((uint32_t)0x00FF0000) /*!<Data byte 6 */
  1775. #define CAN_RDH1R_DATA7 ((uint32_t)0xFF000000) /*!<Data byte 7 */
  1776. /*!<CAN filter registers */
  1777. /******************* Bit definition for CAN_FMR register ********************/
  1778. #define CAN_FMR_FINIT ((uint32_t)0x01) /*!<Filter Init Mode */
  1779. #define CAN_FMR_CAN2SB ((uint32_t)0x00003F00) /*!<CAN2 start bank */
  1780. /******************* Bit definition for CAN_FM1R register *******************/
  1781. #define CAN_FM1R_FBM ((uint32_t)0x0FFFFFFF) /*!<Filter Mode */
  1782. #define CAN_FM1R_FBM0 ((uint32_t)0x00000001) /*!<Filter Init Mode bit 0 */
  1783. #define CAN_FM1R_FBM1 ((uint32_t)0x00000002) /*!<Filter Init Mode bit 1 */
  1784. #define CAN_FM1R_FBM2 ((uint32_t)0x00000004) /*!<Filter Init Mode bit 2 */
  1785. #define CAN_FM1R_FBM3 ((uint32_t)0x00000008) /*!<Filter Init Mode bit 3 */
  1786. #define CAN_FM1R_FBM4 ((uint32_t)0x00000010) /*!<Filter Init Mode bit 4 */
  1787. #define CAN_FM1R_FBM5 ((uint32_t)0x00000020) /*!<Filter Init Mode bit 5 */
  1788. #define CAN_FM1R_FBM6 ((uint32_t)0x00000040) /*!<Filter Init Mode bit 6 */
  1789. #define CAN_FM1R_FBM7 ((uint32_t)0x00000080) /*!<Filter Init Mode bit 7 */
  1790. #define CAN_FM1R_FBM8 ((uint32_t)0x00000100) /*!<Filter Init Mode bit 8 */
  1791. #define CAN_FM1R_FBM9 ((uint32_t)0x00000200) /*!<Filter Init Mode bit 9 */
  1792. #define CAN_FM1R_FBM10 ((uint32_t)0x00000400) /*!<Filter Init Mode bit 10 */
  1793. #define CAN_FM1R_FBM11 ((uint32_t)0x00000800) /*!<Filter Init Mode bit 11 */
  1794. #define CAN_FM1R_FBM12 ((uint32_t)0x00001000) /*!<Filter Init Mode bit 12 */
  1795. #define CAN_FM1R_FBM13 ((uint32_t)0x00002000) /*!<Filter Init Mode bit 13 */
  1796. #define CAN_FM1R_FBM14 ((uint32_t)0x00004000) /*!<Filter Init Mode bit 14 */
  1797. #define CAN_FM1R_FBM15 ((uint32_t)0x00008000) /*!<Filter Init Mode bit 15 */
  1798. #define CAN_FM1R_FBM16 ((uint32_t)0x00010000) /*!<Filter Init Mode bit 16 */
  1799. #define CAN_FM1R_FBM17 ((uint32_t)0x00020000) /*!<Filter Init Mode bit 17 */
  1800. #define CAN_FM1R_FBM18 ((uint32_t)0x00040000) /*!<Filter Init Mode bit 18 */
  1801. #define CAN_FM1R_FBM19 ((uint32_t)0x00080000) /*!<Filter Init Mode bit 19 */
  1802. #define CAN_FM1R_FBM20 ((uint32_t)0x00100000) /*!<Filter Init Mode bit 20 */
  1803. #define CAN_FM1R_FBM21 ((uint32_t)0x00200000) /*!<Filter Init Mode bit 21 */
  1804. #define CAN_FM1R_FBM22 ((uint32_t)0x00400000) /*!<Filter Init Mode bit 22 */
  1805. #define CAN_FM1R_FBM23 ((uint32_t)0x00800000) /*!<Filter Init Mode bit 23 */
  1806. #define CAN_FM1R_FBM24 ((uint32_t)0x01000000) /*!<Filter Init Mode bit 24 */
  1807. #define CAN_FM1R_FBM25 ((uint32_t)0x02000000) /*!<Filter Init Mode bit 25 */
  1808. #define CAN_FM1R_FBM26 ((uint32_t)0x04000000) /*!<Filter Init Mode bit 26 */
  1809. #define CAN_FM1R_FBM27 ((uint32_t)0x08000000) /*!<Filter Init Mode bit 27 */
  1810. /******************* Bit definition for CAN_FS1R register *******************/
  1811. #define CAN_FS1R_FSC ((uint32_t)0x0FFFFFFF) /*!<Filter Scale Configuration */
  1812. #define CAN_FS1R_FSC0 ((uint32_t)0x00000001) /*!<Filter Scale Configuration bit 0 */
  1813. #define CAN_FS1R_FSC1 ((uint32_t)0x00000002) /*!<Filter Scale Configuration bit 1 */
  1814. #define CAN_FS1R_FSC2 ((uint32_t)0x00000004) /*!<Filter Scale Configuration bit 2 */
  1815. #define CAN_FS1R_FSC3 ((uint32_t)0x00000008) /*!<Filter Scale Configuration bit 3 */
  1816. #define CAN_FS1R_FSC4 ((uint32_t)0x00000010) /*!<Filter Scale Configuration bit 4 */
  1817. #define CAN_FS1R_FSC5 ((uint32_t)0x00000020) /*!<Filter Scale Configuration bit 5 */
  1818. #define CAN_FS1R_FSC6 ((uint32_t)0x00000040) /*!<Filter Scale Configuration bit 6 */
  1819. #define CAN_FS1R_FSC7 ((uint32_t)0x00000080) /*!<Filter Scale Configuration bit 7 */
  1820. #define CAN_FS1R_FSC8 ((uint32_t)0x00000100) /*!<Filter Scale Configuration bit 8 */
  1821. #define CAN_FS1R_FSC9 ((uint32_t)0x00000200) /*!<Filter Scale Configuration bit 9 */
  1822. #define CAN_FS1R_FSC10 ((uint32_t)0x00000400) /*!<Filter Scale Configuration bit 10 */
  1823. #define CAN_FS1R_FSC11 ((uint32_t)0x00000800) /*!<Filter Scale Configuration bit 11 */
  1824. #define CAN_FS1R_FSC12 ((uint32_t)0x00001000) /*!<Filter Scale Configuration bit 12 */
  1825. #define CAN_FS1R_FSC13 ((uint32_t)0x00002000) /*!<Filter Scale Configuration bit 13 */
  1826. #define CAN_FS1R_FSC14 ((uint32_t)0x00004000) /*!<Filter Scale Configuration bit 14 */
  1827. #define CAN_FS1R_FSC15 ((uint32_t)0x00008000) /*!<Filter Scale Configuration bit 15 */
  1828. #define CAN_FS1R_FSC16 ((uint32_t)0x00010000) /*!<Filter Scale Configuration bit 16 */
  1829. #define CAN_FS1R_FSC17 ((uint32_t)0x00020000) /*!<Filter Scale Configuration bit 17 */
  1830. #define CAN_FS1R_FSC18 ((uint32_t)0x00040000) /*!<Filter Scale Configuration bit 18 */
  1831. #define CAN_FS1R_FSC19 ((uint32_t)0x00080000) /*!<Filter Scale Configuration bit 19 */
  1832. #define CAN_FS1R_FSC20 ((uint32_t)0x00100000) /*!<Filter Scale Configuration bit 20 */
  1833. #define CAN_FS1R_FSC21 ((uint32_t)0x00200000) /*!<Filter Scale Configuration bit 21 */
  1834. #define CAN_FS1R_FSC22 ((uint32_t)0x00400000) /*!<Filter Scale Configuration bit 22 */
  1835. #define CAN_FS1R_FSC23 ((uint32_t)0x00800000) /*!<Filter Scale Configuration bit 23 */
  1836. #define CAN_FS1R_FSC24 ((uint32_t)0x01000000) /*!<Filter Scale Configuration bit 24 */
  1837. #define CAN_FS1R_FSC25 ((uint32_t)0x02000000) /*!<Filter Scale Configuration bit 25 */
  1838. #define CAN_FS1R_FSC26 ((uint32_t)0x04000000) /*!<Filter Scale Configuration bit 26 */
  1839. #define CAN_FS1R_FSC27 ((uint32_t)0x08000000) /*!<Filter Scale Configuration bit 27 */
  1840. /****************** Bit definition for CAN_FFA1R register *******************/
  1841. #define CAN_FFA1R_FFA ((uint32_t)0x0FFFFFFF) /*!<Filter FIFO Assignment */
  1842. #define CAN_FFA1R_FFA0 ((uint32_t)0x00000001) /*!<Filter FIFO Assignment bit 0 */
  1843. #define CAN_FFA1R_FFA1 ((uint32_t)0x00000002) /*!<Filter FIFO Assignment bit 1 */
  1844. #define CAN_FFA1R_FFA2 ((uint32_t)0x00000004) /*!<Filter FIFO Assignment bit 2 */
  1845. #define CAN_FFA1R_FFA3 ((uint32_t)0x00000008) /*!<Filter FIFO Assignment bit 3 */
  1846. #define CAN_FFA1R_FFA4 ((uint32_t)0x00000010) /*!<Filter FIFO Assignment bit 4 */
  1847. #define CAN_FFA1R_FFA5 ((uint32_t)0x00000020) /*!<Filter FIFO Assignment bit 5 */
  1848. #define CAN_FFA1R_FFA6 ((uint32_t)0x00000040) /*!<Filter FIFO Assignment bit 6 */
  1849. #define CAN_FFA1R_FFA7 ((uint32_t)0x00000080) /*!<Filter FIFO Assignment bit 7 */
  1850. #define CAN_FFA1R_FFA8 ((uint32_t)0x00000100) /*!<Filter FIFO Assignment bit 8 */
  1851. #define CAN_FFA1R_FFA9 ((uint32_t)0x00000200) /*!<Filter FIFO Assignment bit 9 */
  1852. #define CAN_FFA1R_FFA10 ((uint32_t)0x00000400) /*!<Filter FIFO Assignment bit 10 */
  1853. #define CAN_FFA1R_FFA11 ((uint32_t)0x00000800) /*!<Filter FIFO Assignment bit 11 */
  1854. #define CAN_FFA1R_FFA12 ((uint32_t)0x00001000) /*!<Filter FIFO Assignment bit 12 */
  1855. #define CAN_FFA1R_FFA13 ((uint32_t)0x00002000) /*!<Filter FIFO Assignment bit 13 */
  1856. #define CAN_FFA1R_FFA14 ((uint32_t)0x00004000) /*!<Filter FIFO Assignment bit 14 */
  1857. #define CAN_FFA1R_FFA15 ((uint32_t)0x00008000) /*!<Filter FIFO Assignment bit 15 */
  1858. #define CAN_FFA1R_FFA16 ((uint32_t)0x00010000) /*!<Filter FIFO Assignment bit 16 */
  1859. #define CAN_FFA1R_FFA17 ((uint32_t)0x00020000) /*!<Filter FIFO Assignment bit 17 */
  1860. #define CAN_FFA1R_FFA18 ((uint32_t)0x00040000) /*!<Filter FIFO Assignment bit 18 */
  1861. #define CAN_FFA1R_FFA19 ((uint32_t)0x00080000) /*!<Filter FIFO Assignment bit 19 */
  1862. #define CAN_FFA1R_FFA20 ((uint32_t)0x00100000) /*!<Filter FIFO Assignment bit 20 */
  1863. #define CAN_FFA1R_FFA21 ((uint32_t)0x00200000) /*!<Filter FIFO Assignment bit 21 */
  1864. #define CAN_FFA1R_FFA22 ((uint32_t)0x00400000) /*!<Filter FIFO Assignment bit 22 */
  1865. #define CAN_FFA1R_FFA23 ((uint32_t)0x00800000) /*!<Filter FIFO Assignment bit 23 */
  1866. #define CAN_FFA1R_FFA24 ((uint32_t)0x01000000) /*!<Filter FIFO Assignment bit 24 */
  1867. #define CAN_FFA1R_FFA25 ((uint32_t)0x02000000) /*!<Filter FIFO Assignment bit 25 */
  1868. #define CAN_FFA1R_FFA26 ((uint32_t)0x04000000) /*!<Filter FIFO Assignment bit 26 */
  1869. #define CAN_FFA1R_FFA27 ((uint32_t)0x08000000) /*!<Filter FIFO Assignment bit 27 */
  1870. /******************* Bit definition for CAN_FA1R register *******************/
  1871. #define CAN_FA1R_FACT ((uint32_t)0x0FFFFFFF) /*!<Filter Active */
  1872. #define CAN_FA1R_FACT0 ((uint32_t)0x00000001) /*!<Filter Active bit 0 */
  1873. #define CAN_FA1R_FACT1 ((uint32_t)0x00000002) /*!<Filter Active bit 1 */
  1874. #define CAN_FA1R_FACT2 ((uint32_t)0x00000004) /*!<Filter Active bit 2 */
  1875. #define CAN_FA1R_FACT3 ((uint32_t)0x00000008) /*!<Filter Active bit 3 */
  1876. #define CAN_FA1R_FACT4 ((uint32_t)0x00000010) /*!<Filter Active bit 4 */
  1877. #define CAN_FA1R_FACT5 ((uint32_t)0x00000020) /*!<Filter Active bit 5 */
  1878. #define CAN_FA1R_FACT6 ((uint32_t)0x00000040) /*!<Filter Active bit 6 */
  1879. #define CAN_FA1R_FACT7 ((uint32_t)0x00000080) /*!<Filter Active bit 7 */
  1880. #define CAN_FA1R_FACT8 ((uint32_t)0x00000100) /*!<Filter Active bit 8 */
  1881. #define CAN_FA1R_FACT9 ((uint32_t)0x00000200) /*!<Filter Active bit 9 */
  1882. #define CAN_FA1R_FACT10 ((uint32_t)0x00000400) /*!<Filter Active bit 10 */
  1883. #define CAN_FA1R_FACT11 ((uint32_t)0x00000800) /*!<Filter Active bit 11 */
  1884. #define CAN_FA1R_FACT12 ((uint32_t)0x00001000) /*!<Filter Active bit 12 */
  1885. #define CAN_FA1R_FACT13 ((uint32_t)0x00002000) /*!<Filter Active bit 13 */
  1886. #define CAN_FA1R_FACT14 ((uint32_t)0x00004000) /*!<Filter Active bit 14 */
  1887. #define CAN_FA1R_FACT15 ((uint32_t)0x00008000) /*!<Filter Active bit 15 */
  1888. #define CAN_FA1R_FACT16 ((uint32_t)0x00010000) /*!<Filter Active bit 16 */
  1889. #define CAN_FA1R_FACT17 ((uint32_t)0x00020000) /*!<Filter Active bit 17 */
  1890. #define CAN_FA1R_FACT18 ((uint32_t)0x00040000) /*!<Filter Active bit 18 */
  1891. #define CAN_FA1R_FACT19 ((uint32_t)0x00080000) /*!<Filter Active bit 19 */
  1892. #define CAN_FA1R_FACT20 ((uint32_t)0x00100000) /*!<Filter Active bit 20 */
  1893. #define CAN_FA1R_FACT21 ((uint32_t)0x00200000) /*!<Filter Active bit 21 */
  1894. #define CAN_FA1R_FACT22 ((uint32_t)0x00400000) /*!<Filter Active bit 22 */
  1895. #define CAN_FA1R_FACT23 ((uint32_t)0x00800000) /*!<Filter Active bit 23 */
  1896. #define CAN_FA1R_FACT24 ((uint32_t)0x01000000) /*!<Filter Active bit 24 */
  1897. #define CAN_FA1R_FACT25 ((uint32_t)0x02000000) /*!<Filter Active bit 25 */
  1898. #define CAN_FA1R_FACT26 ((uint32_t)0x04000000) /*!<Filter Active bit 26 */
  1899. #define CAN_FA1R_FACT27 ((uint32_t)0x08000000) /*!<Filter Active bit 27 */
  1900. /******************* Bit definition for CAN_F0R1 register *******************/
  1901. #define CAN_F0R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  1902. #define CAN_F0R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  1903. #define CAN_F0R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  1904. #define CAN_F0R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  1905. #define CAN_F0R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  1906. #define CAN_F0R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  1907. #define CAN_F0R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  1908. #define CAN_F0R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  1909. #define CAN_F0R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  1910. #define CAN_F0R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  1911. #define CAN_F0R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  1912. #define CAN_F0R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  1913. #define CAN_F0R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  1914. #define CAN_F0R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  1915. #define CAN_F0R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  1916. #define CAN_F0R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  1917. #define CAN_F0R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  1918. #define CAN_F0R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  1919. #define CAN_F0R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  1920. #define CAN_F0R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  1921. #define CAN_F0R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  1922. #define CAN_F0R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  1923. #define CAN_F0R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  1924. #define CAN_F0R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  1925. #define CAN_F0R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  1926. #define CAN_F0R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  1927. #define CAN_F0R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  1928. #define CAN_F0R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  1929. #define CAN_F0R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  1930. #define CAN_F0R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  1931. #define CAN_F0R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  1932. #define CAN_F0R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  1933. /******************* Bit definition for CAN_F1R1 register *******************/
  1934. #define CAN_F1R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  1935. #define CAN_F1R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  1936. #define CAN_F1R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  1937. #define CAN_F1R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  1938. #define CAN_F1R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  1939. #define CAN_F1R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  1940. #define CAN_F1R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  1941. #define CAN_F1R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  1942. #define CAN_F1R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  1943. #define CAN_F1R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  1944. #define CAN_F1R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  1945. #define CAN_F1R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  1946. #define CAN_F1R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  1947. #define CAN_F1R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  1948. #define CAN_F1R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  1949. #define CAN_F1R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  1950. #define CAN_F1R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  1951. #define CAN_F1R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  1952. #define CAN_F1R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  1953. #define CAN_F1R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  1954. #define CAN_F1R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  1955. #define CAN_F1R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  1956. #define CAN_F1R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  1957. #define CAN_F1R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  1958. #define CAN_F1R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  1959. #define CAN_F1R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  1960. #define CAN_F1R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  1961. #define CAN_F1R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  1962. #define CAN_F1R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  1963. #define CAN_F1R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  1964. #define CAN_F1R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  1965. #define CAN_F1R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  1966. /******************* Bit definition for CAN_F2R1 register *******************/
  1967. #define CAN_F2R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  1968. #define CAN_F2R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  1969. #define CAN_F2R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  1970. #define CAN_F2R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  1971. #define CAN_F2R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  1972. #define CAN_F2R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  1973. #define CAN_F2R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  1974. #define CAN_F2R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  1975. #define CAN_F2R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  1976. #define CAN_F2R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  1977. #define CAN_F2R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  1978. #define CAN_F2R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  1979. #define CAN_F2R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  1980. #define CAN_F2R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  1981. #define CAN_F2R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  1982. #define CAN_F2R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  1983. #define CAN_F2R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  1984. #define CAN_F2R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  1985. #define CAN_F2R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  1986. #define CAN_F2R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  1987. #define CAN_F2R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  1988. #define CAN_F2R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  1989. #define CAN_F2R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  1990. #define CAN_F2R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  1991. #define CAN_F2R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  1992. #define CAN_F2R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  1993. #define CAN_F2R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  1994. #define CAN_F2R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  1995. #define CAN_F2R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  1996. #define CAN_F2R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  1997. #define CAN_F2R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  1998. #define CAN_F2R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  1999. /******************* Bit definition for CAN_F3R1 register *******************/
  2000. #define CAN_F3R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2001. #define CAN_F3R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2002. #define CAN_F3R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2003. #define CAN_F3R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2004. #define CAN_F3R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2005. #define CAN_F3R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2006. #define CAN_F3R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2007. #define CAN_F3R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2008. #define CAN_F3R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2009. #define CAN_F3R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2010. #define CAN_F3R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2011. #define CAN_F3R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2012. #define CAN_F3R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2013. #define CAN_F3R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2014. #define CAN_F3R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2015. #define CAN_F3R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2016. #define CAN_F3R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2017. #define CAN_F3R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2018. #define CAN_F3R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2019. #define CAN_F3R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2020. #define CAN_F3R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2021. #define CAN_F3R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2022. #define CAN_F3R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2023. #define CAN_F3R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2024. #define CAN_F3R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2025. #define CAN_F3R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2026. #define CAN_F3R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2027. #define CAN_F3R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2028. #define CAN_F3R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2029. #define CAN_F3R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2030. #define CAN_F3R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2031. #define CAN_F3R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2032. /******************* Bit definition for CAN_F4R1 register *******************/
  2033. #define CAN_F4R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2034. #define CAN_F4R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2035. #define CAN_F4R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2036. #define CAN_F4R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2037. #define CAN_F4R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2038. #define CAN_F4R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2039. #define CAN_F4R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2040. #define CAN_F4R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2041. #define CAN_F4R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2042. #define CAN_F4R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2043. #define CAN_F4R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2044. #define CAN_F4R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2045. #define CAN_F4R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2046. #define CAN_F4R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2047. #define CAN_F4R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2048. #define CAN_F4R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2049. #define CAN_F4R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2050. #define CAN_F4R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2051. #define CAN_F4R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2052. #define CAN_F4R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2053. #define CAN_F4R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2054. #define CAN_F4R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2055. #define CAN_F4R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2056. #define CAN_F4R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2057. #define CAN_F4R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2058. #define CAN_F4R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2059. #define CAN_F4R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2060. #define CAN_F4R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2061. #define CAN_F4R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2062. #define CAN_F4R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2063. #define CAN_F4R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2064. #define CAN_F4R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2065. /******************* Bit definition for CAN_F5R1 register *******************/
  2066. #define CAN_F5R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2067. #define CAN_F5R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2068. #define CAN_F5R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2069. #define CAN_F5R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2070. #define CAN_F5R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2071. #define CAN_F5R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2072. #define CAN_F5R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2073. #define CAN_F5R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2074. #define CAN_F5R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2075. #define CAN_F5R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2076. #define CAN_F5R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2077. #define CAN_F5R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2078. #define CAN_F5R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2079. #define CAN_F5R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2080. #define CAN_F5R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2081. #define CAN_F5R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2082. #define CAN_F5R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2083. #define CAN_F5R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2084. #define CAN_F5R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2085. #define CAN_F5R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2086. #define CAN_F5R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2087. #define CAN_F5R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2088. #define CAN_F5R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2089. #define CAN_F5R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2090. #define CAN_F5R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2091. #define CAN_F5R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2092. #define CAN_F5R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2093. #define CAN_F5R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2094. #define CAN_F5R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2095. #define CAN_F5R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2096. #define CAN_F5R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2097. #define CAN_F5R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2098. /******************* Bit definition for CAN_F6R1 register *******************/
  2099. #define CAN_F6R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2100. #define CAN_F6R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2101. #define CAN_F6R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2102. #define CAN_F6R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2103. #define CAN_F6R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2104. #define CAN_F6R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2105. #define CAN_F6R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2106. #define CAN_F6R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2107. #define CAN_F6R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2108. #define CAN_F6R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2109. #define CAN_F6R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2110. #define CAN_F6R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2111. #define CAN_F6R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2112. #define CAN_F6R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2113. #define CAN_F6R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2114. #define CAN_F6R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2115. #define CAN_F6R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2116. #define CAN_F6R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2117. #define CAN_F6R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2118. #define CAN_F6R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2119. #define CAN_F6R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2120. #define CAN_F6R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2121. #define CAN_F6R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2122. #define CAN_F6R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2123. #define CAN_F6R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2124. #define CAN_F6R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2125. #define CAN_F6R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2126. #define CAN_F6R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2127. #define CAN_F6R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2128. #define CAN_F6R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2129. #define CAN_F6R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2130. #define CAN_F6R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2131. /******************* Bit definition for CAN_F7R1 register *******************/
  2132. #define CAN_F7R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2133. #define CAN_F7R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2134. #define CAN_F7R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2135. #define CAN_F7R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2136. #define CAN_F7R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2137. #define CAN_F7R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2138. #define CAN_F7R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2139. #define CAN_F7R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2140. #define CAN_F7R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2141. #define CAN_F7R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2142. #define CAN_F7R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2143. #define CAN_F7R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2144. #define CAN_F7R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2145. #define CAN_F7R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2146. #define CAN_F7R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2147. #define CAN_F7R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2148. #define CAN_F7R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2149. #define CAN_F7R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2150. #define CAN_F7R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2151. #define CAN_F7R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2152. #define CAN_F7R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2153. #define CAN_F7R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2154. #define CAN_F7R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2155. #define CAN_F7R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2156. #define CAN_F7R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2157. #define CAN_F7R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2158. #define CAN_F7R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2159. #define CAN_F7R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2160. #define CAN_F7R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2161. #define CAN_F7R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2162. #define CAN_F7R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2163. #define CAN_F7R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2164. /******************* Bit definition for CAN_F8R1 register *******************/
  2165. #define CAN_F8R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2166. #define CAN_F8R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2167. #define CAN_F8R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2168. #define CAN_F8R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2169. #define CAN_F8R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2170. #define CAN_F8R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2171. #define CAN_F8R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2172. #define CAN_F8R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2173. #define CAN_F8R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2174. #define CAN_F8R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2175. #define CAN_F8R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2176. #define CAN_F8R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2177. #define CAN_F8R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2178. #define CAN_F8R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2179. #define CAN_F8R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2180. #define CAN_F8R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2181. #define CAN_F8R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2182. #define CAN_F8R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2183. #define CAN_F8R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2184. #define CAN_F8R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2185. #define CAN_F8R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2186. #define CAN_F8R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2187. #define CAN_F8R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2188. #define CAN_F8R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2189. #define CAN_F8R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2190. #define CAN_F8R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2191. #define CAN_F8R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2192. #define CAN_F8R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2193. #define CAN_F8R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2194. #define CAN_F8R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2195. #define CAN_F8R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2196. #define CAN_F8R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2197. /******************* Bit definition for CAN_F9R1 register *******************/
  2198. #define CAN_F9R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2199. #define CAN_F9R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2200. #define CAN_F9R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2201. #define CAN_F9R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2202. #define CAN_F9R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2203. #define CAN_F9R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2204. #define CAN_F9R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2205. #define CAN_F9R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2206. #define CAN_F9R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2207. #define CAN_F9R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2208. #define CAN_F9R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2209. #define CAN_F9R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2210. #define CAN_F9R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2211. #define CAN_F9R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2212. #define CAN_F9R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2213. #define CAN_F9R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2214. #define CAN_F9R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2215. #define CAN_F9R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2216. #define CAN_F9R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2217. #define CAN_F9R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2218. #define CAN_F9R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2219. #define CAN_F9R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2220. #define CAN_F9R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2221. #define CAN_F9R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2222. #define CAN_F9R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2223. #define CAN_F9R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2224. #define CAN_F9R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2225. #define CAN_F9R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2226. #define CAN_F9R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2227. #define CAN_F9R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2228. #define CAN_F9R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2229. #define CAN_F9R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2230. /******************* Bit definition for CAN_F10R1 register ******************/
  2231. #define CAN_F10R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2232. #define CAN_F10R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2233. #define CAN_F10R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2234. #define CAN_F10R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2235. #define CAN_F10R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2236. #define CAN_F10R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2237. #define CAN_F10R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2238. #define CAN_F10R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2239. #define CAN_F10R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2240. #define CAN_F10R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2241. #define CAN_F10R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2242. #define CAN_F10R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2243. #define CAN_F10R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2244. #define CAN_F10R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2245. #define CAN_F10R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2246. #define CAN_F10R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2247. #define CAN_F10R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2248. #define CAN_F10R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2249. #define CAN_F10R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2250. #define CAN_F10R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2251. #define CAN_F10R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2252. #define CAN_F10R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2253. #define CAN_F10R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2254. #define CAN_F10R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2255. #define CAN_F10R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2256. #define CAN_F10R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2257. #define CAN_F10R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2258. #define CAN_F10R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2259. #define CAN_F10R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2260. #define CAN_F10R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2261. #define CAN_F10R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2262. #define CAN_F10R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2263. /******************* Bit definition for CAN_F11R1 register ******************/
  2264. #define CAN_F11R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2265. #define CAN_F11R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2266. #define CAN_F11R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2267. #define CAN_F11R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2268. #define CAN_F11R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2269. #define CAN_F11R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2270. #define CAN_F11R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2271. #define CAN_F11R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2272. #define CAN_F11R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2273. #define CAN_F11R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2274. #define CAN_F11R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2275. #define CAN_F11R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2276. #define CAN_F11R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2277. #define CAN_F11R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2278. #define CAN_F11R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2279. #define CAN_F11R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2280. #define CAN_F11R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2281. #define CAN_F11R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2282. #define CAN_F11R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2283. #define CAN_F11R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2284. #define CAN_F11R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2285. #define CAN_F11R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2286. #define CAN_F11R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2287. #define CAN_F11R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2288. #define CAN_F11R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2289. #define CAN_F11R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2290. #define CAN_F11R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2291. #define CAN_F11R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2292. #define CAN_F11R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2293. #define CAN_F11R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2294. #define CAN_F11R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2295. #define CAN_F11R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2296. /******************* Bit definition for CAN_F12R1 register ******************/
  2297. #define CAN_F12R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2298. #define CAN_F12R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2299. #define CAN_F12R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2300. #define CAN_F12R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2301. #define CAN_F12R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2302. #define CAN_F12R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2303. #define CAN_F12R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2304. #define CAN_F12R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2305. #define CAN_F12R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2306. #define CAN_F12R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2307. #define CAN_F12R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2308. #define CAN_F12R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2309. #define CAN_F12R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2310. #define CAN_F12R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2311. #define CAN_F12R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2312. #define CAN_F12R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2313. #define CAN_F12R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2314. #define CAN_F12R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2315. #define CAN_F12R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2316. #define CAN_F12R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2317. #define CAN_F12R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2318. #define CAN_F12R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2319. #define CAN_F12R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2320. #define CAN_F12R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2321. #define CAN_F12R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2322. #define CAN_F12R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2323. #define CAN_F12R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2324. #define CAN_F12R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2325. #define CAN_F12R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2326. #define CAN_F12R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2327. #define CAN_F12R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2328. #define CAN_F12R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2329. /******************* Bit definition for CAN_F13R1 register ******************/
  2330. #define CAN_F13R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2331. #define CAN_F13R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2332. #define CAN_F13R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2333. #define CAN_F13R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2334. #define CAN_F13R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2335. #define CAN_F13R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2336. #define CAN_F13R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2337. #define CAN_F13R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2338. #define CAN_F13R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2339. #define CAN_F13R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2340. #define CAN_F13R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2341. #define CAN_F13R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2342. #define CAN_F13R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2343. #define CAN_F13R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2344. #define CAN_F13R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2345. #define CAN_F13R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2346. #define CAN_F13R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2347. #define CAN_F13R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2348. #define CAN_F13R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2349. #define CAN_F13R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2350. #define CAN_F13R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2351. #define CAN_F13R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2352. #define CAN_F13R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2353. #define CAN_F13R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2354. #define CAN_F13R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2355. #define CAN_F13R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2356. #define CAN_F13R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2357. #define CAN_F13R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2358. #define CAN_F13R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2359. #define CAN_F13R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2360. #define CAN_F13R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2361. #define CAN_F13R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2362. /******************* Bit definition for CAN_F0R2 register *******************/
  2363. #define CAN_F0R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2364. #define CAN_F0R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2365. #define CAN_F0R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2366. #define CAN_F0R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2367. #define CAN_F0R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2368. #define CAN_F0R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2369. #define CAN_F0R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2370. #define CAN_F0R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2371. #define CAN_F0R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2372. #define CAN_F0R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2373. #define CAN_F0R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2374. #define CAN_F0R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2375. #define CAN_F0R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2376. #define CAN_F0R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2377. #define CAN_F0R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2378. #define CAN_F0R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2379. #define CAN_F0R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2380. #define CAN_F0R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2381. #define CAN_F0R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2382. #define CAN_F0R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2383. #define CAN_F0R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2384. #define CAN_F0R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2385. #define CAN_F0R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2386. #define CAN_F0R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2387. #define CAN_F0R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2388. #define CAN_F0R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2389. #define CAN_F0R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2390. #define CAN_F0R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2391. #define CAN_F0R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2392. #define CAN_F0R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2393. #define CAN_F0R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2394. #define CAN_F0R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2395. /******************* Bit definition for CAN_F1R2 register *******************/
  2396. #define CAN_F1R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2397. #define CAN_F1R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2398. #define CAN_F1R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2399. #define CAN_F1R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2400. #define CAN_F1R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2401. #define CAN_F1R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2402. #define CAN_F1R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2403. #define CAN_F1R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2404. #define CAN_F1R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2405. #define CAN_F1R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2406. #define CAN_F1R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2407. #define CAN_F1R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2408. #define CAN_F1R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2409. #define CAN_F1R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2410. #define CAN_F1R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2411. #define CAN_F1R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2412. #define CAN_F1R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2413. #define CAN_F1R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2414. #define CAN_F1R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2415. #define CAN_F1R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2416. #define CAN_F1R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2417. #define CAN_F1R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2418. #define CAN_F1R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2419. #define CAN_F1R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2420. #define CAN_F1R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2421. #define CAN_F1R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2422. #define CAN_F1R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2423. #define CAN_F1R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2424. #define CAN_F1R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2425. #define CAN_F1R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2426. #define CAN_F1R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2427. #define CAN_F1R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2428. /******************* Bit definition for CAN_F2R2 register *******************/
  2429. #define CAN_F2R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2430. #define CAN_F2R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2431. #define CAN_F2R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2432. #define CAN_F2R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2433. #define CAN_F2R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2434. #define CAN_F2R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2435. #define CAN_F2R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2436. #define CAN_F2R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2437. #define CAN_F2R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2438. #define CAN_F2R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2439. #define CAN_F2R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2440. #define CAN_F2R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2441. #define CAN_F2R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2442. #define CAN_F2R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2443. #define CAN_F2R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2444. #define CAN_F2R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2445. #define CAN_F2R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2446. #define CAN_F2R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2447. #define CAN_F2R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2448. #define CAN_F2R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2449. #define CAN_F2R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2450. #define CAN_F2R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2451. #define CAN_F2R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2452. #define CAN_F2R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2453. #define CAN_F2R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2454. #define CAN_F2R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2455. #define CAN_F2R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2456. #define CAN_F2R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2457. #define CAN_F2R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2458. #define CAN_F2R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2459. #define CAN_F2R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2460. #define CAN_F2R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2461. /******************* Bit definition for CAN_F3R2 register *******************/
  2462. #define CAN_F3R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2463. #define CAN_F3R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2464. #define CAN_F3R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2465. #define CAN_F3R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2466. #define CAN_F3R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2467. #define CAN_F3R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2468. #define CAN_F3R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2469. #define CAN_F3R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2470. #define CAN_F3R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2471. #define CAN_F3R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2472. #define CAN_F3R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2473. #define CAN_F3R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2474. #define CAN_F3R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2475. #define CAN_F3R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2476. #define CAN_F3R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2477. #define CAN_F3R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2478. #define CAN_F3R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2479. #define CAN_F3R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2480. #define CAN_F3R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2481. #define CAN_F3R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2482. #define CAN_F3R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2483. #define CAN_F3R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2484. #define CAN_F3R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2485. #define CAN_F3R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2486. #define CAN_F3R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2487. #define CAN_F3R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2488. #define CAN_F3R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2489. #define CAN_F3R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2490. #define CAN_F3R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2491. #define CAN_F3R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2492. #define CAN_F3R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2493. #define CAN_F3R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2494. /******************* Bit definition for CAN_F4R2 register *******************/
  2495. #define CAN_F4R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2496. #define CAN_F4R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2497. #define CAN_F4R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2498. #define CAN_F4R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2499. #define CAN_F4R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2500. #define CAN_F4R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2501. #define CAN_F4R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2502. #define CAN_F4R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2503. #define CAN_F4R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2504. #define CAN_F4R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2505. #define CAN_F4R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2506. #define CAN_F4R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2507. #define CAN_F4R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2508. #define CAN_F4R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2509. #define CAN_F4R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2510. #define CAN_F4R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2511. #define CAN_F4R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2512. #define CAN_F4R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2513. #define CAN_F4R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2514. #define CAN_F4R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2515. #define CAN_F4R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2516. #define CAN_F4R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2517. #define CAN_F4R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2518. #define CAN_F4R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2519. #define CAN_F4R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2520. #define CAN_F4R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2521. #define CAN_F4R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2522. #define CAN_F4R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2523. #define CAN_F4R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2524. #define CAN_F4R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2525. #define CAN_F4R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2526. #define CAN_F4R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2527. /******************* Bit definition for CAN_F5R2 register *******************/
  2528. #define CAN_F5R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2529. #define CAN_F5R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2530. #define CAN_F5R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2531. #define CAN_F5R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2532. #define CAN_F5R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2533. #define CAN_F5R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2534. #define CAN_F5R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2535. #define CAN_F5R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2536. #define CAN_F5R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2537. #define CAN_F5R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2538. #define CAN_F5R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2539. #define CAN_F5R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2540. #define CAN_F5R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2541. #define CAN_F5R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2542. #define CAN_F5R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2543. #define CAN_F5R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2544. #define CAN_F5R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2545. #define CAN_F5R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2546. #define CAN_F5R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2547. #define CAN_F5R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2548. #define CAN_F5R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2549. #define CAN_F5R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2550. #define CAN_F5R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2551. #define CAN_F5R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2552. #define CAN_F5R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2553. #define CAN_F5R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2554. #define CAN_F5R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2555. #define CAN_F5R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2556. #define CAN_F5R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2557. #define CAN_F5R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2558. #define CAN_F5R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2559. #define CAN_F5R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2560. /******************* Bit definition for CAN_F6R2 register *******************/
  2561. #define CAN_F6R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2562. #define CAN_F6R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2563. #define CAN_F6R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2564. #define CAN_F6R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2565. #define CAN_F6R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2566. #define CAN_F6R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2567. #define CAN_F6R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2568. #define CAN_F6R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2569. #define CAN_F6R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2570. #define CAN_F6R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2571. #define CAN_F6R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2572. #define CAN_F6R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2573. #define CAN_F6R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2574. #define CAN_F6R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2575. #define CAN_F6R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2576. #define CAN_F6R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2577. #define CAN_F6R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2578. #define CAN_F6R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2579. #define CAN_F6R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2580. #define CAN_F6R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2581. #define CAN_F6R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2582. #define CAN_F6R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2583. #define CAN_F6R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2584. #define CAN_F6R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2585. #define CAN_F6R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2586. #define CAN_F6R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2587. #define CAN_F6R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2588. #define CAN_F6R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2589. #define CAN_F6R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2590. #define CAN_F6R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2591. #define CAN_F6R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2592. #define CAN_F6R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2593. /******************* Bit definition for CAN_F7R2 register *******************/
  2594. #define CAN_F7R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2595. #define CAN_F7R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2596. #define CAN_F7R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2597. #define CAN_F7R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2598. #define CAN_F7R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2599. #define CAN_F7R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2600. #define CAN_F7R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2601. #define CAN_F7R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2602. #define CAN_F7R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2603. #define CAN_F7R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2604. #define CAN_F7R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2605. #define CAN_F7R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2606. #define CAN_F7R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2607. #define CAN_F7R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2608. #define CAN_F7R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2609. #define CAN_F7R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2610. #define CAN_F7R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2611. #define CAN_F7R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2612. #define CAN_F7R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2613. #define CAN_F7R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2614. #define CAN_F7R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2615. #define CAN_F7R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2616. #define CAN_F7R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2617. #define CAN_F7R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2618. #define CAN_F7R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2619. #define CAN_F7R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2620. #define CAN_F7R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2621. #define CAN_F7R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2622. #define CAN_F7R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2623. #define CAN_F7R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2624. #define CAN_F7R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2625. #define CAN_F7R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2626. /******************* Bit definition for CAN_F8R2 register *******************/
  2627. #define CAN_F8R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2628. #define CAN_F8R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2629. #define CAN_F8R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2630. #define CAN_F8R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2631. #define CAN_F8R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2632. #define CAN_F8R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2633. #define CAN_F8R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2634. #define CAN_F8R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2635. #define CAN_F8R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2636. #define CAN_F8R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2637. #define CAN_F8R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2638. #define CAN_F8R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2639. #define CAN_F8R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2640. #define CAN_F8R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2641. #define CAN_F8R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2642. #define CAN_F8R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2643. #define CAN_F8R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2644. #define CAN_F8R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2645. #define CAN_F8R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2646. #define CAN_F8R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2647. #define CAN_F8R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2648. #define CAN_F8R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2649. #define CAN_F8R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2650. #define CAN_F8R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2651. #define CAN_F8R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2652. #define CAN_F8R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2653. #define CAN_F8R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2654. #define CAN_F8R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2655. #define CAN_F8R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2656. #define CAN_F8R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2657. #define CAN_F8R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2658. #define CAN_F8R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2659. /******************* Bit definition for CAN_F9R2 register *******************/
  2660. #define CAN_F9R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2661. #define CAN_F9R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2662. #define CAN_F9R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2663. #define CAN_F9R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2664. #define CAN_F9R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2665. #define CAN_F9R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2666. #define CAN_F9R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2667. #define CAN_F9R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2668. #define CAN_F9R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2669. #define CAN_F9R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2670. #define CAN_F9R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2671. #define CAN_F9R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2672. #define CAN_F9R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2673. #define CAN_F9R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2674. #define CAN_F9R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2675. #define CAN_F9R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2676. #define CAN_F9R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2677. #define CAN_F9R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2678. #define CAN_F9R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2679. #define CAN_F9R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2680. #define CAN_F9R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2681. #define CAN_F9R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2682. #define CAN_F9R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2683. #define CAN_F9R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2684. #define CAN_F9R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2685. #define CAN_F9R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2686. #define CAN_F9R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2687. #define CAN_F9R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2688. #define CAN_F9R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2689. #define CAN_F9R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2690. #define CAN_F9R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2691. #define CAN_F9R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2692. /******************* Bit definition for CAN_F10R2 register ******************/
  2693. #define CAN_F10R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2694. #define CAN_F10R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2695. #define CAN_F10R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2696. #define CAN_F10R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2697. #define CAN_F10R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2698. #define CAN_F10R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2699. #define CAN_F10R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2700. #define CAN_F10R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2701. #define CAN_F10R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2702. #define CAN_F10R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2703. #define CAN_F10R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2704. #define CAN_F10R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2705. #define CAN_F10R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2706. #define CAN_F10R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2707. #define CAN_F10R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2708. #define CAN_F10R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2709. #define CAN_F10R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2710. #define CAN_F10R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2711. #define CAN_F10R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2712. #define CAN_F10R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2713. #define CAN_F10R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2714. #define CAN_F10R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2715. #define CAN_F10R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2716. #define CAN_F10R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2717. #define CAN_F10R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2718. #define CAN_F10R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2719. #define CAN_F10R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2720. #define CAN_F10R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2721. #define CAN_F10R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2722. #define CAN_F10R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2723. #define CAN_F10R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2724. #define CAN_F10R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2725. /******************* Bit definition for CAN_F11R2 register ******************/
  2726. #define CAN_F11R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2727. #define CAN_F11R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2728. #define CAN_F11R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2729. #define CAN_F11R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2730. #define CAN_F11R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2731. #define CAN_F11R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2732. #define CAN_F11R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2733. #define CAN_F11R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2734. #define CAN_F11R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2735. #define CAN_F11R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2736. #define CAN_F11R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2737. #define CAN_F11R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2738. #define CAN_F11R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2739. #define CAN_F11R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2740. #define CAN_F11R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2741. #define CAN_F11R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2742. #define CAN_F11R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2743. #define CAN_F11R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2744. #define CAN_F11R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2745. #define CAN_F11R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2746. #define CAN_F11R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2747. #define CAN_F11R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2748. #define CAN_F11R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2749. #define CAN_F11R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2750. #define CAN_F11R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2751. #define CAN_F11R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2752. #define CAN_F11R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2753. #define CAN_F11R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2754. #define CAN_F11R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2755. #define CAN_F11R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2756. #define CAN_F11R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2757. #define CAN_F11R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2758. /******************* Bit definition for CAN_F12R2 register ******************/
  2759. #define CAN_F12R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2760. #define CAN_F12R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2761. #define CAN_F12R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2762. #define CAN_F12R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2763. #define CAN_F12R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2764. #define CAN_F12R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2765. #define CAN_F12R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2766. #define CAN_F12R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2767. #define CAN_F12R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2768. #define CAN_F12R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2769. #define CAN_F12R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2770. #define CAN_F12R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2771. #define CAN_F12R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2772. #define CAN_F12R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2773. #define CAN_F12R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2774. #define CAN_F12R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2775. #define CAN_F12R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2776. #define CAN_F12R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2777. #define CAN_F12R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2778. #define CAN_F12R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2779. #define CAN_F12R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2780. #define CAN_F12R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2781. #define CAN_F12R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2782. #define CAN_F12R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2783. #define CAN_F12R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2784. #define CAN_F12R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2785. #define CAN_F12R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2786. #define CAN_F12R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2787. #define CAN_F12R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2788. #define CAN_F12R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2789. #define CAN_F12R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2790. #define CAN_F12R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2791. /******************* Bit definition for CAN_F13R2 register ******************/
  2792. #define CAN_F13R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2793. #define CAN_F13R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2794. #define CAN_F13R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2795. #define CAN_F13R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2796. #define CAN_F13R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2797. #define CAN_F13R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2798. #define CAN_F13R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2799. #define CAN_F13R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2800. #define CAN_F13R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2801. #define CAN_F13R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2802. #define CAN_F13R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2803. #define CAN_F13R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2804. #define CAN_F13R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2805. #define CAN_F13R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2806. #define CAN_F13R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2807. #define CAN_F13R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2808. #define CAN_F13R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2809. #define CAN_F13R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2810. #define CAN_F13R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2811. #define CAN_F13R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2812. #define CAN_F13R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2813. #define CAN_F13R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2814. #define CAN_F13R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2815. #define CAN_F13R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2816. #define CAN_F13R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2817. #define CAN_F13R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2818. #define CAN_F13R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2819. #define CAN_F13R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2820. #define CAN_F13R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2821. #define CAN_F13R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2822. #define CAN_F13R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2823. #define CAN_F13R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2824. /******************************************************************************/
  2825. /* */
  2826. /* CRC calculation unit */
  2827. /* */
  2828. /******************************************************************************/
  2829. /******************* Bit definition for CRC_DR register *********************/
  2830. #define CRC_DR_DR ((uint32_t)0xFFFFFFFF) /*!< Data register bits */
  2831. /******************* Bit definition for CRC_IDR register ********************/
  2832. #define CRC_IDR_IDR ((uint32_t)0xFF) /*!< General-purpose 8-bit data register bits */
  2833. /******************** Bit definition for CRC_CR register ********************/
  2834. #define CRC_CR_RESET ((uint32_t)0x01) /*!< RESET bit */
  2835. /******************************************************************************/
  2836. /* */
  2837. /* Crypto Processor */
  2838. /* */
  2839. /******************************************************************************/
  2840. /******************* Bits definition for CRYP_CR register ********************/
  2841. #define CRYP_CR_ALGODIR ((uint32_t)0x00000004)
  2842. #define CRYP_CR_ALGOMODE ((uint32_t)0x00080038)
  2843. #define CRYP_CR_ALGOMODE_0 ((uint32_t)0x00000008)
  2844. #define CRYP_CR_ALGOMODE_1 ((uint32_t)0x00000010)
  2845. #define CRYP_CR_ALGOMODE_2 ((uint32_t)0x00000020)
  2846. #define CRYP_CR_ALGOMODE_TDES_ECB ((uint32_t)0x00000000)
  2847. #define CRYP_CR_ALGOMODE_TDES_CBC ((uint32_t)0x00000008)
  2848. #define CRYP_CR_ALGOMODE_DES_ECB ((uint32_t)0x00000010)
  2849. #define CRYP_CR_ALGOMODE_DES_CBC ((uint32_t)0x00000018)
  2850. #define CRYP_CR_ALGOMODE_AES_ECB ((uint32_t)0x00000020)
  2851. #define CRYP_CR_ALGOMODE_AES_CBC ((uint32_t)0x00000028)
  2852. #define CRYP_CR_ALGOMODE_AES_CTR ((uint32_t)0x00000030)
  2853. #define CRYP_CR_ALGOMODE_AES_KEY ((uint32_t)0x00000038)
  2854. #define CRYP_CR_DATATYPE ((uint32_t)0x000000C0)
  2855. #define CRYP_CR_DATATYPE_0 ((uint32_t)0x00000040)
  2856. #define CRYP_CR_DATATYPE_1 ((uint32_t)0x00000080)
  2857. #define CRYP_CR_KEYSIZE ((uint32_t)0x00000300)
  2858. #define CRYP_CR_KEYSIZE_0 ((uint32_t)0x00000100)
  2859. #define CRYP_CR_KEYSIZE_1 ((uint32_t)0x00000200)
  2860. #define CRYP_CR_FFLUSH ((uint32_t)0x00004000)
  2861. #define CRYP_CR_CRYPEN ((uint32_t)0x00008000)
  2862. #define CRYP_CR_GCM_CCMPH ((uint32_t)0x00030000)
  2863. #define CRYP_CR_GCM_CCMPH_0 ((uint32_t)0x00010000)
  2864. #define CRYP_CR_GCM_CCMPH_1 ((uint32_t)0x00020000)
  2865. #define CRYP_CR_ALGOMODE_3 ((uint32_t)0x00080000)
  2866. /****************** Bits definition for CRYP_SR register *********************/
  2867. #define CRYP_SR_IFEM ((uint32_t)0x00000001)
  2868. #define CRYP_SR_IFNF ((uint32_t)0x00000002)
  2869. #define CRYP_SR_OFNE ((uint32_t)0x00000004)
  2870. #define CRYP_SR_OFFU ((uint32_t)0x00000008)
  2871. #define CRYP_SR_BUSY ((uint32_t)0x00000010)
  2872. /****************** Bits definition for CRYP_DMACR register ******************/
  2873. #define CRYP_DMACR_DIEN ((uint32_t)0x00000001)
  2874. #define CRYP_DMACR_DOEN ((uint32_t)0x00000002)
  2875. /***************** Bits definition for CRYP_IMSCR register ******************/
  2876. #define CRYP_IMSCR_INIM ((uint32_t)0x00000001)
  2877. #define CRYP_IMSCR_OUTIM ((uint32_t)0x00000002)
  2878. /****************** Bits definition for CRYP_RISR register *******************/
  2879. #define CRYP_RISR_OUTRIS ((uint32_t)0x00000001)
  2880. #define CRYP_RISR_INRIS ((uint32_t)0x00000002)
  2881. /****************** Bits definition for CRYP_MISR register *******************/
  2882. #define CRYP_MISR_INMIS ((uint32_t)0x00000001)
  2883. #define CRYP_MISR_OUTMIS ((uint32_t)0x00000002)
  2884. /******************************************************************************/
  2885. /* */
  2886. /* Digital to Analog Converter */
  2887. /* */
  2888. /******************************************************************************/
  2889. /******************** Bit definition for DAC_CR register ********************/
  2890. #define DAC_CR_EN1 ((uint32_t)0x00000001) /*!<DAC channel1 enable */
  2891. #define DAC_CR_BOFF1 ((uint32_t)0x00000002) /*!<DAC channel1 output buffer disable */
  2892. #define DAC_CR_TEN1 ((uint32_t)0x00000004) /*!<DAC channel1 Trigger enable */
  2893. #define DAC_CR_TSEL1 ((uint32_t)0x00000038) /*!<TSEL1[2:0] (DAC channel1 Trigger selection) */
  2894. #define DAC_CR_TSEL1_0 ((uint32_t)0x00000008) /*!<Bit 0 */
  2895. #define DAC_CR_TSEL1_1 ((uint32_t)0x00000010) /*!<Bit 1 */
  2896. #define DAC_CR_TSEL1_2 ((uint32_t)0x00000020) /*!<Bit 2 */
  2897. #define DAC_CR_WAVE1 ((uint32_t)0x000000C0) /*!<WAVE1[1:0] (DAC channel1 noise/triangle wave generation enable) */
  2898. #define DAC_CR_WAVE1_0 ((uint32_t)0x00000040) /*!<Bit 0 */
  2899. #define DAC_CR_WAVE1_1 ((uint32_t)0x00000080) /*!<Bit 1 */
  2900. #define DAC_CR_MAMP1 ((uint32_t)0x00000F00) /*!<MAMP1[3:0] (DAC channel1 Mask/Amplitude selector) */
  2901. #define DAC_CR_MAMP1_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  2902. #define DAC_CR_MAMP1_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  2903. #define DAC_CR_MAMP1_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  2904. #define DAC_CR_MAMP1_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  2905. #define DAC_CR_DMAEN1 ((uint32_t)0x00001000) /*!<DAC channel1 DMA enable */
  2906. #define DAC_CR_EN2 ((uint32_t)0x00010000) /*!<DAC channel2 enable */
  2907. #define DAC_CR_BOFF2 ((uint32_t)0x00020000) /*!<DAC channel2 output buffer disable */
  2908. #define DAC_CR_TEN2 ((uint32_t)0x00040000) /*!<DAC channel2 Trigger enable */
  2909. #define DAC_CR_TSEL2 ((uint32_t)0x00380000) /*!<TSEL2[2:0] (DAC channel2 Trigger selection) */
  2910. #define DAC_CR_TSEL2_0 ((uint32_t)0x00080000) /*!<Bit 0 */
  2911. #define DAC_CR_TSEL2_1 ((uint32_t)0x00100000) /*!<Bit 1 */
  2912. #define DAC_CR_TSEL2_2 ((uint32_t)0x00200000) /*!<Bit 2 */
  2913. #define DAC_CR_WAVE2 ((uint32_t)0x00C00000) /*!<WAVE2[1:0] (DAC channel2 noise/triangle wave generation enable) */
  2914. #define DAC_CR_WAVE2_0 ((uint32_t)0x00400000) /*!<Bit 0 */
  2915. #define DAC_CR_WAVE2_1 ((uint32_t)0x00800000) /*!<Bit 1 */
  2916. #define DAC_CR_MAMP2 ((uint32_t)0x0F000000) /*!<MAMP2[3:0] (DAC channel2 Mask/Amplitude selector) */
  2917. #define DAC_CR_MAMP2_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  2918. #define DAC_CR_MAMP2_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  2919. #define DAC_CR_MAMP2_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  2920. #define DAC_CR_MAMP2_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  2921. #define DAC_CR_DMAEN2 ((uint32_t)0x10000000) /*!<DAC channel2 DMA enabled */
  2922. /***************** Bit definition for DAC_SWTRIGR register ******************/
  2923. #define DAC_SWTRIGR_SWTRIG1 ((uint32_t)0x01) /*!<DAC channel1 software trigger */
  2924. #define DAC_SWTRIGR_SWTRIG2 ((uint32_t)0x02) /*!<DAC channel2 software trigger */
  2925. /***************** Bit definition for DAC_DHR12R1 register ******************/
  2926. #define DAC_DHR12R1_DACC1DHR ((uint32_t)0x0FFF) /*!<DAC channel1 12-bit Right aligned data */
  2927. /***************** Bit definition for DAC_DHR12L1 register ******************/
  2928. #define DAC_DHR12L1_DACC1DHR ((uint32_t)0xFFF0) /*!<DAC channel1 12-bit Left aligned data */
  2929. /****************** Bit definition for DAC_DHR8R1 register ******************/
  2930. #define DAC_DHR8R1_DACC1DHR ((uint32_t)0xFF) /*!<DAC channel1 8-bit Right aligned data */
  2931. /***************** Bit definition for DAC_DHR12R2 register ******************/
  2932. #define DAC_DHR12R2_DACC2DHR ((uint32_t)0x0FFF) /*!<DAC channel2 12-bit Right aligned data */
  2933. /***************** Bit definition for DAC_DHR12L2 register ******************/
  2934. #define DAC_DHR12L2_DACC2DHR ((uint32_t)0xFFF0) /*!<DAC channel2 12-bit Left aligned data */
  2935. /****************** Bit definition for DAC_DHR8R2 register ******************/
  2936. #define DAC_DHR8R2_DACC2DHR ((uint32_t)0xFF) /*!<DAC channel2 8-bit Right aligned data */
  2937. /***************** Bit definition for DAC_DHR12RD register ******************/
  2938. #define DAC_DHR12RD_DACC1DHR ((uint32_t)0x00000FFF) /*!<DAC channel1 12-bit Right aligned data */
  2939. #define DAC_DHR12RD_DACC2DHR ((uint32_t)0x0FFF0000) /*!<DAC channel2 12-bit Right aligned data */
  2940. /***************** Bit definition for DAC_DHR12LD register ******************/
  2941. #define DAC_DHR12LD_DACC1DHR ((uint32_t)0x0000FFF0) /*!<DAC channel1 12-bit Left aligned data */
  2942. #define DAC_DHR12LD_DACC2DHR ((uint32_t)0xFFF00000) /*!<DAC channel2 12-bit Left aligned data */
  2943. /****************** Bit definition for DAC_DHR8RD register ******************/
  2944. #define DAC_DHR8RD_DACC1DHR ((uint32_t)0x00FF) /*!<DAC channel1 8-bit Right aligned data */
  2945. #define DAC_DHR8RD_DACC2DHR ((uint32_t)0xFF00) /*!<DAC channel2 8-bit Right aligned data */
  2946. /******************* Bit definition for DAC_DOR1 register *******************/
  2947. #define DAC_DOR1_DACC1DOR ((uint32_t)0x0FFF) /*!<DAC channel1 data output */
  2948. /******************* Bit definition for DAC_DOR2 register *******************/
  2949. #define DAC_DOR2_DACC2DOR ((uint32_t)0x0FFF) /*!<DAC channel2 data output */
  2950. /******************** Bit definition for DAC_SR register ********************/
  2951. #define DAC_SR_DMAUDR1 ((uint32_t)0x00002000) /*!<DAC channel1 DMA underrun flag */
  2952. #define DAC_SR_DMAUDR2 ((uint32_t)0x20000000) /*!<DAC channel2 DMA underrun flag */
  2953. /******************************************************************************/
  2954. /* */
  2955. /* Debug MCU */
  2956. /* */
  2957. /******************************************************************************/
  2958. /******************************************************************************/
  2959. /* */
  2960. /* DCMI */
  2961. /* */
  2962. /******************************************************************************/
  2963. /******************** Bits definition for DCMI_CR register ******************/
  2964. #define DCMI_CR_CAPTURE ((uint32_t)0x00000001)
  2965. #define DCMI_CR_CM ((uint32_t)0x00000002)
  2966. #define DCMI_CR_CROP ((uint32_t)0x00000004)
  2967. #define DCMI_CR_JPEG ((uint32_t)0x00000008)
  2968. #define DCMI_CR_ESS ((uint32_t)0x00000010)
  2969. #define DCMI_CR_PCKPOL ((uint32_t)0x00000020)
  2970. #define DCMI_CR_HSPOL ((uint32_t)0x00000040)
  2971. #define DCMI_CR_VSPOL ((uint32_t)0x00000080)
  2972. #define DCMI_CR_FCRC_0 ((uint32_t)0x00000100)
  2973. #define DCMI_CR_FCRC_1 ((uint32_t)0x00000200)
  2974. #define DCMI_CR_EDM_0 ((uint32_t)0x00000400)
  2975. #define DCMI_CR_EDM_1 ((uint32_t)0x00000800)
  2976. #define DCMI_CR_CRE ((uint32_t)0x00001000)
  2977. #define DCMI_CR_ENABLE ((uint32_t)0x00004000)
  2978. /******************** Bits definition for DCMI_SR register ******************/
  2979. #define DCMI_SR_HSYNC ((uint32_t)0x00000001)
  2980. #define DCMI_SR_VSYNC ((uint32_t)0x00000002)
  2981. #define DCMI_SR_FNE ((uint32_t)0x00000004)
  2982. /******************** Bits definition for DCMI_RISR register ****************/
  2983. #define DCMI_RISR_FRAME_RIS ((uint32_t)0x00000001)
  2984. #define DCMI_RISR_OVF_RIS ((uint32_t)0x00000002)
  2985. #define DCMI_RISR_ERR_RIS ((uint32_t)0x00000004)
  2986. #define DCMI_RISR_VSYNC_RIS ((uint32_t)0x00000008)
  2987. #define DCMI_RISR_LINE_RIS ((uint32_t)0x00000010)
  2988. /******************** Bits definition for DCMI_IER register *****************/
  2989. #define DCMI_IER_FRAME_IE ((uint32_t)0x00000001)
  2990. #define DCMI_IER_OVF_IE ((uint32_t)0x00000002)
  2991. #define DCMI_IER_ERR_IE ((uint32_t)0x00000004)
  2992. #define DCMI_IER_VSYNC_IE ((uint32_t)0x00000008)
  2993. #define DCMI_IER_LINE_IE ((uint32_t)0x00000010)
  2994. /******************** Bits definition for DCMI_MISR register ****************/
  2995. #define DCMI_MISR_FRAME_MIS ((uint32_t)0x00000001)
  2996. #define DCMI_MISR_OVF_MIS ((uint32_t)0x00000002)
  2997. #define DCMI_MISR_ERR_MIS ((uint32_t)0x00000004)
  2998. #define DCMI_MISR_VSYNC_MIS ((uint32_t)0x00000008)
  2999. #define DCMI_MISR_LINE_MIS ((uint32_t)0x00000010)
  3000. /******************** Bits definition for DCMI_ICR register *****************/
  3001. #define DCMI_ICR_FRAME_ISC ((uint32_t)0x00000001)
  3002. #define DCMI_ICR_OVF_ISC ((uint32_t)0x00000002)
  3003. #define DCMI_ICR_ERR_ISC ((uint32_t)0x00000004)
  3004. #define DCMI_ICR_VSYNC_ISC ((uint32_t)0x00000008)
  3005. #define DCMI_ICR_LINE_ISC ((uint32_t)0x00000010)
  3006. /******************************************************************************/
  3007. /* */
  3008. /* DMA Controller */
  3009. /* */
  3010. /******************************************************************************/
  3011. /******************** Bits definition for DMA_SxCR register *****************/
  3012. #define DMA_SxCR_CHSEL ((uint32_t)0x0E000000)
  3013. #define DMA_SxCR_CHSEL_0 ((uint32_t)0x02000000)
  3014. #define DMA_SxCR_CHSEL_1 ((uint32_t)0x04000000)
  3015. #define DMA_SxCR_CHSEL_2 ((uint32_t)0x08000000)
  3016. #define DMA_SxCR_MBURST ((uint32_t)0x01800000)
  3017. #define DMA_SxCR_MBURST_0 ((uint32_t)0x00800000)
  3018. #define DMA_SxCR_MBURST_1 ((uint32_t)0x01000000)
  3019. #define DMA_SxCR_PBURST ((uint32_t)0x00600000)
  3020. #define DMA_SxCR_PBURST_0 ((uint32_t)0x00200000)
  3021. #define DMA_SxCR_PBURST_1 ((uint32_t)0x00400000)
  3022. #define DMA_SxCR_ACK ((uint32_t)0x00100000)
  3023. #define DMA_SxCR_CT ((uint32_t)0x00080000)
  3024. #define DMA_SxCR_DBM ((uint32_t)0x00040000)
  3025. #define DMA_SxCR_PL ((uint32_t)0x00030000)
  3026. #define DMA_SxCR_PL_0 ((uint32_t)0x00010000)
  3027. #define DMA_SxCR_PL_1 ((uint32_t)0x00020000)
  3028. #define DMA_SxCR_PINCOS ((uint32_t)0x00008000)
  3029. #define DMA_SxCR_MSIZE ((uint32_t)0x00006000)
  3030. #define DMA_SxCR_MSIZE_0 ((uint32_t)0x00002000)
  3031. #define DMA_SxCR_MSIZE_1 ((uint32_t)0x00004000)
  3032. #define DMA_SxCR_PSIZE ((uint32_t)0x00001800)
  3033. #define DMA_SxCR_PSIZE_0 ((uint32_t)0x00000800)
  3034. #define DMA_SxCR_PSIZE_1 ((uint32_t)0x00001000)
  3035. #define DMA_SxCR_MINC ((uint32_t)0x00000400)
  3036. #define DMA_SxCR_PINC ((uint32_t)0x00000200)
  3037. #define DMA_SxCR_CIRC ((uint32_t)0x00000100)
  3038. #define DMA_SxCR_DIR ((uint32_t)0x000000C0)
  3039. #define DMA_SxCR_DIR_0 ((uint32_t)0x00000040)
  3040. #define DMA_SxCR_DIR_1 ((uint32_t)0x00000080)
  3041. #define DMA_SxCR_PFCTRL ((uint32_t)0x00000020)
  3042. #define DMA_SxCR_TCIE ((uint32_t)0x00000010)
  3043. #define DMA_SxCR_HTIE ((uint32_t)0x00000008)
  3044. #define DMA_SxCR_TEIE ((uint32_t)0x00000004)
  3045. #define DMA_SxCR_DMEIE ((uint32_t)0x00000002)
  3046. #define DMA_SxCR_EN ((uint32_t)0x00000001)
  3047. /******************** Bits definition for DMA_SxCNDTR register **************/
  3048. #define DMA_SxNDT ((uint32_t)0x0000FFFF)
  3049. #define DMA_SxNDT_0 ((uint32_t)0x00000001)
  3050. #define DMA_SxNDT_1 ((uint32_t)0x00000002)
  3051. #define DMA_SxNDT_2 ((uint32_t)0x00000004)
  3052. #define DMA_SxNDT_3 ((uint32_t)0x00000008)
  3053. #define DMA_SxNDT_4 ((uint32_t)0x00000010)
  3054. #define DMA_SxNDT_5 ((uint32_t)0x00000020)
  3055. #define DMA_SxNDT_6 ((uint32_t)0x00000040)
  3056. #define DMA_SxNDT_7 ((uint32_t)0x00000080)
  3057. #define DMA_SxNDT_8 ((uint32_t)0x00000100)
  3058. #define DMA_SxNDT_9 ((uint32_t)0x00000200)
  3059. #define DMA_SxNDT_10 ((uint32_t)0x00000400)
  3060. #define DMA_SxNDT_11 ((uint32_t)0x00000800)
  3061. #define DMA_SxNDT_12 ((uint32_t)0x00001000)
  3062. #define DMA_SxNDT_13 ((uint32_t)0x00002000)
  3063. #define DMA_SxNDT_14 ((uint32_t)0x00004000)
  3064. #define DMA_SxNDT_15 ((uint32_t)0x00008000)
  3065. /******************** Bits definition for DMA_SxFCR register ****************/
  3066. #define DMA_SxFCR_FEIE ((uint32_t)0x00000080)
  3067. #define DMA_SxFCR_FS ((uint32_t)0x00000038)
  3068. #define DMA_SxFCR_FS_0 ((uint32_t)0x00000008)
  3069. #define DMA_SxFCR_FS_1 ((uint32_t)0x00000010)
  3070. #define DMA_SxFCR_FS_2 ((uint32_t)0x00000020)
  3071. #define DMA_SxFCR_DMDIS ((uint32_t)0x00000004)
  3072. #define DMA_SxFCR_FTH ((uint32_t)0x00000003)
  3073. #define DMA_SxFCR_FTH_0 ((uint32_t)0x00000001)
  3074. #define DMA_SxFCR_FTH_1 ((uint32_t)0x00000002)
  3075. /******************** Bits definition for DMA_LISR register *****************/
  3076. #define DMA_LISR_TCIF3 ((uint32_t)0x08000000)
  3077. #define DMA_LISR_HTIF3 ((uint32_t)0x04000000)
  3078. #define DMA_LISR_TEIF3 ((uint32_t)0x02000000)
  3079. #define DMA_LISR_DMEIF3 ((uint32_t)0x01000000)
  3080. #define DMA_LISR_FEIF3 ((uint32_t)0x00400000)
  3081. #define DMA_LISR_TCIF2 ((uint32_t)0x00200000)
  3082. #define DMA_LISR_HTIF2 ((uint32_t)0x00100000)
  3083. #define DMA_LISR_TEIF2 ((uint32_t)0x00080000)
  3084. #define DMA_LISR_DMEIF2 ((uint32_t)0x00040000)
  3085. #define DMA_LISR_FEIF2 ((uint32_t)0x00010000)
  3086. #define DMA_LISR_TCIF1 ((uint32_t)0x00000800)
  3087. #define DMA_LISR_HTIF1 ((uint32_t)0x00000400)
  3088. #define DMA_LISR_TEIF1 ((uint32_t)0x00000200)
  3089. #define DMA_LISR_DMEIF1 ((uint32_t)0x00000100)
  3090. #define DMA_LISR_FEIF1 ((uint32_t)0x00000040)
  3091. #define DMA_LISR_TCIF0 ((uint32_t)0x00000020)
  3092. #define DMA_LISR_HTIF0 ((uint32_t)0x00000010)
  3093. #define DMA_LISR_TEIF0 ((uint32_t)0x00000008)
  3094. #define DMA_LISR_DMEIF0 ((uint32_t)0x00000004)
  3095. #define DMA_LISR_FEIF0 ((uint32_t)0x00000001)
  3096. /******************** Bits definition for DMA_HISR register *****************/
  3097. #define DMA_HISR_TCIF7 ((uint32_t)0x08000000)
  3098. #define DMA_HISR_HTIF7 ((uint32_t)0x04000000)
  3099. #define DMA_HISR_TEIF7 ((uint32_t)0x02000000)
  3100. #define DMA_HISR_DMEIF7 ((uint32_t)0x01000000)
  3101. #define DMA_HISR_FEIF7 ((uint32_t)0x00400000)
  3102. #define DMA_HISR_TCIF6 ((uint32_t)0x00200000)
  3103. #define DMA_HISR_HTIF6 ((uint32_t)0x00100000)
  3104. #define DMA_HISR_TEIF6 ((uint32_t)0x00080000)
  3105. #define DMA_HISR_DMEIF6 ((uint32_t)0x00040000)
  3106. #define DMA_HISR_FEIF6 ((uint32_t)0x00010000)
  3107. #define DMA_HISR_TCIF5 ((uint32_t)0x00000800)
  3108. #define DMA_HISR_HTIF5 ((uint32_t)0x00000400)
  3109. #define DMA_HISR_TEIF5 ((uint32_t)0x00000200)
  3110. #define DMA_HISR_DMEIF5 ((uint32_t)0x00000100)
  3111. #define DMA_HISR_FEIF5 ((uint32_t)0x00000040)
  3112. #define DMA_HISR_TCIF4 ((uint32_t)0x00000020)
  3113. #define DMA_HISR_HTIF4 ((uint32_t)0x00000010)
  3114. #define DMA_HISR_TEIF4 ((uint32_t)0x00000008)
  3115. #define DMA_HISR_DMEIF4 ((uint32_t)0x00000004)
  3116. #define DMA_HISR_FEIF4 ((uint32_t)0x00000001)
  3117. /******************** Bits definition for DMA_LIFCR register ****************/
  3118. #define DMA_LIFCR_CTCIF3 ((uint32_t)0x08000000)
  3119. #define DMA_LIFCR_CHTIF3 ((uint32_t)0x04000000)
  3120. #define DMA_LIFCR_CTEIF3 ((uint32_t)0x02000000)
  3121. #define DMA_LIFCR_CDMEIF3 ((uint32_t)0x01000000)
  3122. #define DMA_LIFCR_CFEIF3 ((uint32_t)0x00400000)
  3123. #define DMA_LIFCR_CTCIF2 ((uint32_t)0x00200000)
  3124. #define DMA_LIFCR_CHTIF2 ((uint32_t)0x00100000)
  3125. #define DMA_LIFCR_CTEIF2 ((uint32_t)0x00080000)
  3126. #define DMA_LIFCR_CDMEIF2 ((uint32_t)0x00040000)
  3127. #define DMA_LIFCR_CFEIF2 ((uint32_t)0x00010000)
  3128. #define DMA_LIFCR_CTCIF1 ((uint32_t)0x00000800)
  3129. #define DMA_LIFCR_CHTIF1 ((uint32_t)0x00000400)
  3130. #define DMA_LIFCR_CTEIF1 ((uint32_t)0x00000200)
  3131. #define DMA_LIFCR_CDMEIF1 ((uint32_t)0x00000100)
  3132. #define DMA_LIFCR_CFEIF1 ((uint32_t)0x00000040)
  3133. #define DMA_LIFCR_CTCIF0 ((uint32_t)0x00000020)
  3134. #define DMA_LIFCR_CHTIF0 ((uint32_t)0x00000010)
  3135. #define DMA_LIFCR_CTEIF0 ((uint32_t)0x00000008)
  3136. #define DMA_LIFCR_CDMEIF0 ((uint32_t)0x00000004)
  3137. #define DMA_LIFCR_CFEIF0 ((uint32_t)0x00000001)
  3138. /******************** Bits definition for DMA_HIFCR register ****************/
  3139. #define DMA_HIFCR_CTCIF7 ((uint32_t)0x08000000)
  3140. #define DMA_HIFCR_CHTIF7 ((uint32_t)0x04000000)
  3141. #define DMA_HIFCR_CTEIF7 ((uint32_t)0x02000000)
  3142. #define DMA_HIFCR_CDMEIF7 ((uint32_t)0x01000000)
  3143. #define DMA_HIFCR_CFEIF7 ((uint32_t)0x00400000)
  3144. #define DMA_HIFCR_CTCIF6 ((uint32_t)0x00200000)
  3145. #define DMA_HIFCR_CHTIF6 ((uint32_t)0x00100000)
  3146. #define DMA_HIFCR_CTEIF6 ((uint32_t)0x00080000)
  3147. #define DMA_HIFCR_CDMEIF6 ((uint32_t)0x00040000)
  3148. #define DMA_HIFCR_CFEIF6 ((uint32_t)0x00010000)
  3149. #define DMA_HIFCR_CTCIF5 ((uint32_t)0x00000800)
  3150. #define DMA_HIFCR_CHTIF5 ((uint32_t)0x00000400)
  3151. #define DMA_HIFCR_CTEIF5 ((uint32_t)0x00000200)
  3152. #define DMA_HIFCR_CDMEIF5 ((uint32_t)0x00000100)
  3153. #define DMA_HIFCR_CFEIF5 ((uint32_t)0x00000040)
  3154. #define DMA_HIFCR_CTCIF4 ((uint32_t)0x00000020)
  3155. #define DMA_HIFCR_CHTIF4 ((uint32_t)0x00000010)
  3156. #define DMA_HIFCR_CTEIF4 ((uint32_t)0x00000008)
  3157. #define DMA_HIFCR_CDMEIF4 ((uint32_t)0x00000004)
  3158. #define DMA_HIFCR_CFEIF4 ((uint32_t)0x00000001)
  3159. /******************************************************************************/
  3160. /* */
  3161. /* AHB Master DMA2D Controller (DMA2D) */
  3162. /* */
  3163. /******************************************************************************/
  3164. /******************** Bit definition for DMA2D_CR register ******************/
  3165. #define DMA2D_CR_START ((uint32_t)0x00000001) /*!< Start transfer */
  3166. #define DMA2D_CR_SUSP ((uint32_t)0x00000002) /*!< Suspend transfer */
  3167. #define DMA2D_CR_ABORT ((uint32_t)0x00000004) /*!< Abort transfer */
  3168. #define DMA2D_CR_TEIE ((uint32_t)0x00000100) /*!< Transfer Error Interrupt Enable */
  3169. #define DMA2D_CR_TCIE ((uint32_t)0x00000200) /*!< Transfer Complete Interrupt Enable */
  3170. #define DMA2D_CR_TWIE ((uint32_t)0x00000400) /*!< Transfer Watermark Interrupt Enable */
  3171. #define DMA2D_CR_CAEIE ((uint32_t)0x00000800) /*!< CLUT Access Error Interrupt Enable */
  3172. #define DMA2D_CR_CTCIE ((uint32_t)0x00001000) /*!< CLUT Transfer Complete Interrupt Enable */
  3173. #define DMA2D_CR_CEIE ((uint32_t)0x00002000) /*!< Configuration Error Interrupt Enable */
  3174. #define DMA2D_CR_MODE ((uint32_t)0x00030000) /*!< DMA2D Mode */
  3175. /******************** Bit definition for DMA2D_ISR register *****************/
  3176. #define DMA2D_ISR_TEIF ((uint32_t)0x00000001) /*!< Transfer Error Interrupt Flag */
  3177. #define DMA2D_ISR_TCIF ((uint32_t)0x00000002) /*!< Transfer Complete Interrupt Flag */
  3178. #define DMA2D_ISR_TWIF ((uint32_t)0x00000004) /*!< Transfer Watermark Interrupt Flag */
  3179. #define DMA2D_ISR_CAEIF ((uint32_t)0x00000008) /*!< CLUT Access Error Interrupt Flag */
  3180. #define DMA2D_ISR_CTCIF ((uint32_t)0x00000010) /*!< CLUT Transfer Complete Interrupt Flag */
  3181. #define DMA2D_ISR_CEIF ((uint32_t)0x00000020) /*!< Configuration Error Interrupt Flag */
  3182. /******************** Bit definition for DMA2D_IFSR register ****************/
  3183. #define DMA2D_IFSR_CTEIF ((uint32_t)0x00000001) /*!< Clears Transfer Error Interrupt Flag */
  3184. #define DMA2D_IFSR_CTCIF ((uint32_t)0x00000002) /*!< Clears Transfer Complete Interrupt Flag */
  3185. #define DMA2D_IFSR_CTWIF ((uint32_t)0x00000004) /*!< Clears Transfer Watermark Interrupt Flag */
  3186. #define DMA2D_IFSR_CCAEIF ((uint32_t)0x00000008) /*!< Clears CLUT Access Error Interrupt Flag */
  3187. #define DMA2D_IFSR_CCTCIF ((uint32_t)0x00000010) /*!< Clears CLUT Transfer Complete Interrupt Flag */
  3188. #define DMA2D_IFSR_CCEIF ((uint32_t)0x00000020) /*!< Clears Configuration Error Interrupt Flag */
  3189. /******************** Bit definition for DMA2D_FGMAR register ***************/
  3190. #define DMA2D_FGMAR_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  3191. /******************** Bit definition for DMA2D_FGOR register ****************/
  3192. #define DMA2D_FGOR_LO ((uint32_t)0x00003FFF) /*!< Line Offset */
  3193. /******************** Bit definition for DMA2D_BGMAR register ***************/
  3194. #define DMA2D_BGMAR_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  3195. /******************** Bit definition for DMA2D_BGOR register ****************/
  3196. #define DMA2D_BGOR_LO ((uint32_t)0x00003FFF) /*!< Line Offset */
  3197. /******************** Bit definition for DMA2D_FGPFCCR register *************/
  3198. #define DMA2D_FGPFCCR_CM ((uint32_t)0x0000000F) /*!< Color mode */
  3199. #define DMA2D_FGPFCCR_CCM ((uint32_t)0x00000010) /*!< CLUT Color mode */
  3200. #define DMA2D_FGPFCCR_START ((uint32_t)0x00000020) /*!< Start */
  3201. #define DMA2D_FGPFCCR_CS ((uint32_t)0x0000FF00) /*!< CLUT size */
  3202. #define DMA2D_FGPFCCR_AM ((uint32_t)0x00030000) /*!< Alpha mode */
  3203. #define DMA2D_FGPFCCR_ALPHA ((uint32_t)0xFF000000) /*!< Alpha value */
  3204. /******************** Bit definition for DMA2D_FGCOLR register **************/
  3205. #define DMA2D_FGCOLR_BLUE ((uint32_t)0x000000FF) /*!< Blue Value */
  3206. #define DMA2D_FGCOLR_GREEN ((uint32_t)0x0000FF00) /*!< Green Value */
  3207. #define DMA2D_FGCOLR_RED ((uint32_t)0x00FF0000) /*!< Red Value */
  3208. /******************** Bit definition for DMA2D_BGPFCCR register *************/
  3209. #define DMA2D_BGPFCCR_CM ((uint32_t)0x0000000F) /*!< Color mode */
  3210. #define DMA2D_BGPFCCR_CCM ((uint32_t)0x00000010) /*!< CLUT Color mode */
  3211. #define DMA2D_BGPFCCR_START ((uint32_t)0x00000020) /*!< Start */
  3212. #define DMA2D_BGPFCCR_CS ((uint32_t)0x0000FF00) /*!< CLUT size */
  3213. #define DMA2D_BGPFCCR_AM ((uint32_t)0x00030000) /*!< Alpha Mode */
  3214. #define DMA2D_BGPFCCR_ALPHA ((uint32_t)0xFF000000) /*!< Alpha value */
  3215. /******************** Bit definition for DMA2D_BGCOLR register **************/
  3216. #define DMA2D_BGCOLR_BLUE ((uint32_t)0x000000FF) /*!< Blue Value */
  3217. #define DMA2D_BGCOLR_GREEN ((uint32_t)0x0000FF00) /*!< Green Value */
  3218. #define DMA2D_BGCOLR_RED ((uint32_t)0x00FF0000) /*!< Red Value */
  3219. /******************** Bit definition for DMA2D_FGCMAR register **************/
  3220. #define DMA2D_FGCMAR_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  3221. /******************** Bit definition for DMA2D_BGCMAR register **************/
  3222. #define DMA2D_BGCMAR_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  3223. /******************** Bit definition for DMA2D_OPFCCR register **************/
  3224. #define DMA2D_OPFCCR_CM ((uint32_t)0x00000007) /*!< Color mode */
  3225. /******************** Bit definition for DMA2D_OCOLR register ***************/
  3226. /*!<Mode_ARGB8888/RGB888 */
  3227. #define DMA2D_OCOLR_BLUE_1 ((uint32_t)0x000000FF) /*!< BLUE Value */
  3228. #define DMA2D_OCOLR_GREEN_1 ((uint32_t)0x0000FF00) /*!< GREEN Value */
  3229. #define DMA2D_OCOLR_RED_1 ((uint32_t)0x00FF0000) /*!< Red Value */
  3230. #define DMA2D_OCOLR_ALPHA_1 ((uint32_t)0xFF000000) /*!< Alpha Channel Value */
  3231. /*!<Mode_RGB565 */
  3232. #define DMA2D_OCOLR_BLUE_2 ((uint32_t)0x0000001F) /*!< BLUE Value */
  3233. #define DMA2D_OCOLR_GREEN_2 ((uint32_t)0x000007E0) /*!< GREEN Value */
  3234. #define DMA2D_OCOLR_RED_2 ((uint32_t)0x0000F800) /*!< Red Value */
  3235. /*!<Mode_ARGB1555 */
  3236. #define DMA2D_OCOLR_BLUE_3 ((uint32_t)0x0000001F) /*!< BLUE Value */
  3237. #define DMA2D_OCOLR_GREEN_3 ((uint32_t)0x000003E0) /*!< GREEN Value */
  3238. #define DMA2D_OCOLR_RED_3 ((uint32_t)0x00007C00) /*!< Red Value */
  3239. #define DMA2D_OCOLR_ALPHA_3 ((uint32_t)0x00008000) /*!< Alpha Channel Value */
  3240. /*!<Mode_ARGB4444 */
  3241. #define DMA2D_OCOLR_BLUE_4 ((uint32_t)0x0000000F) /*!< BLUE Value */
  3242. #define DMA2D_OCOLR_GREEN_4 ((uint32_t)0x000000F0) /*!< GREEN Value */
  3243. #define DMA2D_OCOLR_RED_4 ((uint32_t)0x00000F00) /*!< Red Value */
  3244. #define DMA2D_OCOLR_ALPHA_4 ((uint32_t)0x0000F000) /*!< Alpha Channel Value */
  3245. /******************** Bit definition for DMA2D_OMAR register ****************/
  3246. #define DMA2D_OMAR_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
  3247. /******************** Bit definition for DMA2D_OOR register *****************/
  3248. #define DMA2D_OOR_LO ((uint32_t)0x00003FFF) /*!< Line Offset */
  3249. /******************** Bit definition for DMA2D_NLR register *****************/
  3250. #define DMA2D_NLR_NL ((uint32_t)0x0000FFFF) /*!< Number of Lines */
  3251. #define DMA2D_NLR_PL ((uint32_t)0x3FFF0000) /*!< Pixel per Lines */
  3252. /******************** Bit definition for DMA2D_LWR register *****************/
  3253. #define DMA2D_LWR_LW ((uint32_t)0x0000FFFF) /*!< Line Watermark */
  3254. /******************** Bit definition for DMA2D_AMTCR register ***************/
  3255. #define DMA2D_AMTCR_EN ((uint32_t)0x00000001) /*!< Enable */
  3256. #define DMA2D_AMTCR_DT ((uint32_t)0x0000FF00) /*!< Dead Time */
  3257. /******************** Bit definition for DMA2D_FGCLUT register **************/
  3258. /******************** Bit definition for DMA2D_BGCLUT register **************/
  3259. /******************************************************************************/
  3260. /* */
  3261. /* External Interrupt/Event Controller */
  3262. /* */
  3263. /******************************************************************************/
  3264. /******************* Bit definition for EXTI_IMR register *******************/
  3265. #define EXTI_IMR_MR0 ((uint32_t)0x00000001) /*!< Interrupt Mask on line 0 */
  3266. #define EXTI_IMR_MR1 ((uint32_t)0x00000002) /*!< Interrupt Mask on line 1 */
  3267. #define EXTI_IMR_MR2 ((uint32_t)0x00000004) /*!< Interrupt Mask on line 2 */
  3268. #define EXTI_IMR_MR3 ((uint32_t)0x00000008) /*!< Interrupt Mask on line 3 */
  3269. #define EXTI_IMR_MR4 ((uint32_t)0x00000010) /*!< Interrupt Mask on line 4 */
  3270. #define EXTI_IMR_MR5 ((uint32_t)0x00000020) /*!< Interrupt Mask on line 5 */
  3271. #define EXTI_IMR_MR6 ((uint32_t)0x00000040) /*!< Interrupt Mask on line 6 */
  3272. #define EXTI_IMR_MR7 ((uint32_t)0x00000080) /*!< Interrupt Mask on line 7 */
  3273. #define EXTI_IMR_MR8 ((uint32_t)0x00000100) /*!< Interrupt Mask on line 8 */
  3274. #define EXTI_IMR_MR9 ((uint32_t)0x00000200) /*!< Interrupt Mask on line 9 */
  3275. #define EXTI_IMR_MR10 ((uint32_t)0x00000400) /*!< Interrupt Mask on line 10 */
  3276. #define EXTI_IMR_MR11 ((uint32_t)0x00000800) /*!< Interrupt Mask on line 11 */
  3277. #define EXTI_IMR_MR12 ((uint32_t)0x00001000) /*!< Interrupt Mask on line 12 */
  3278. #define EXTI_IMR_MR13 ((uint32_t)0x00002000) /*!< Interrupt Mask on line 13 */
  3279. #define EXTI_IMR_MR14 ((uint32_t)0x00004000) /*!< Interrupt Mask on line 14 */
  3280. #define EXTI_IMR_MR15 ((uint32_t)0x00008000) /*!< Interrupt Mask on line 15 */
  3281. #define EXTI_IMR_MR16 ((uint32_t)0x00010000) /*!< Interrupt Mask on line 16 */
  3282. #define EXTI_IMR_MR17 ((uint32_t)0x00020000) /*!< Interrupt Mask on line 17 */
  3283. #define EXTI_IMR_MR18 ((uint32_t)0x00040000) /*!< Interrupt Mask on line 18 */
  3284. #define EXTI_IMR_MR19 ((uint32_t)0x00080000) /*!< Interrupt Mask on line 19 */
  3285. #define EXTI_IMR_MR20 ((uint32_t)0x00100000) /*!< Interrupt Mask on line 20 */
  3286. #define EXTI_IMR_MR21 ((uint32_t)0x00200000) /*!< Interrupt Mask on line 21 */
  3287. #define EXTI_IMR_MR22 ((uint32_t)0x00400000) /*!< Interrupt Mask on line 22 */
  3288. /******************* Bit definition for EXTI_EMR register *******************/
  3289. #define EXTI_EMR_MR0 ((uint32_t)0x00000001) /*!< Event Mask on line 0 */
  3290. #define EXTI_EMR_MR1 ((uint32_t)0x00000002) /*!< Event Mask on line 1 */
  3291. #define EXTI_EMR_MR2 ((uint32_t)0x00000004) /*!< Event Mask on line 2 */
  3292. #define EXTI_EMR_MR3 ((uint32_t)0x00000008) /*!< Event Mask on line 3 */
  3293. #define EXTI_EMR_MR4 ((uint32_t)0x00000010) /*!< Event Mask on line 4 */
  3294. #define EXTI_EMR_MR5 ((uint32_t)0x00000020) /*!< Event Mask on line 5 */
  3295. #define EXTI_EMR_MR6 ((uint32_t)0x00000040) /*!< Event Mask on line 6 */
  3296. #define EXTI_EMR_MR7 ((uint32_t)0x00000080) /*!< Event Mask on line 7 */
  3297. #define EXTI_EMR_MR8 ((uint32_t)0x00000100) /*!< Event Mask on line 8 */
  3298. #define EXTI_EMR_MR9 ((uint32_t)0x00000200) /*!< Event Mask on line 9 */
  3299. #define EXTI_EMR_MR10 ((uint32_t)0x00000400) /*!< Event Mask on line 10 */
  3300. #define EXTI_EMR_MR11 ((uint32_t)0x00000800) /*!< Event Mask on line 11 */
  3301. #define EXTI_EMR_MR12 ((uint32_t)0x00001000) /*!< Event Mask on line 12 */
  3302. #define EXTI_EMR_MR13 ((uint32_t)0x00002000) /*!< Event Mask on line 13 */
  3303. #define EXTI_EMR_MR14 ((uint32_t)0x00004000) /*!< Event Mask on line 14 */
  3304. #define EXTI_EMR_MR15 ((uint32_t)0x00008000) /*!< Event Mask on line 15 */
  3305. #define EXTI_EMR_MR16 ((uint32_t)0x00010000) /*!< Event Mask on line 16 */
  3306. #define EXTI_EMR_MR17 ((uint32_t)0x00020000) /*!< Event Mask on line 17 */
  3307. #define EXTI_EMR_MR18 ((uint32_t)0x00040000) /*!< Event Mask on line 18 */
  3308. #define EXTI_EMR_MR19 ((uint32_t)0x00080000) /*!< Event Mask on line 19 */
  3309. #define EXTI_EMR_MR20 ((uint32_t)0x00100000) /*!< Event Mask on line 20 */
  3310. #define EXTI_EMR_MR21 ((uint32_t)0x00200000) /*!< Event Mask on line 21 */
  3311. #define EXTI_EMR_MR22 ((uint32_t)0x00400000) /*!< Event Mask on line 22 */
  3312. /****************** Bit definition for EXTI_RTSR register *******************/
  3313. #define EXTI_RTSR_TR0 ((uint32_t)0x00000001) /*!< Rising trigger event configuration bit of line 0 */
  3314. #define EXTI_RTSR_TR1 ((uint32_t)0x00000002) /*!< Rising trigger event configuration bit of line 1 */
  3315. #define EXTI_RTSR_TR2 ((uint32_t)0x00000004) /*!< Rising trigger event configuration bit of line 2 */
  3316. #define EXTI_RTSR_TR3 ((uint32_t)0x00000008) /*!< Rising trigger event configuration bit of line 3 */
  3317. #define EXTI_RTSR_TR4 ((uint32_t)0x00000010) /*!< Rising trigger event configuration bit of line 4 */
  3318. #define EXTI_RTSR_TR5 ((uint32_t)0x00000020) /*!< Rising trigger event configuration bit of line 5 */
  3319. #define EXTI_RTSR_TR6 ((uint32_t)0x00000040) /*!< Rising trigger event configuration bit of line 6 */
  3320. #define EXTI_RTSR_TR7 ((uint32_t)0x00000080) /*!< Rising trigger event configuration bit of line 7 */
  3321. #define EXTI_RTSR_TR8 ((uint32_t)0x00000100) /*!< Rising trigger event configuration bit of line 8 */
  3322. #define EXTI_RTSR_TR9 ((uint32_t)0x00000200) /*!< Rising trigger event configuration bit of line 9 */
  3323. #define EXTI_RTSR_TR10 ((uint32_t)0x00000400) /*!< Rising trigger event configuration bit of line 10 */
  3324. #define EXTI_RTSR_TR11 ((uint32_t)0x00000800) /*!< Rising trigger event configuration bit of line 11 */
  3325. #define EXTI_RTSR_TR12 ((uint32_t)0x00001000) /*!< Rising trigger event configuration bit of line 12 */
  3326. #define EXTI_RTSR_TR13 ((uint32_t)0x00002000) /*!< Rising trigger event configuration bit of line 13 */
  3327. #define EXTI_RTSR_TR14 ((uint32_t)0x00004000) /*!< Rising trigger event configuration bit of line 14 */
  3328. #define EXTI_RTSR_TR15 ((uint32_t)0x00008000) /*!< Rising trigger event configuration bit of line 15 */
  3329. #define EXTI_RTSR_TR16 ((uint32_t)0x00010000) /*!< Rising trigger event configuration bit of line 16 */
  3330. #define EXTI_RTSR_TR17 ((uint32_t)0x00020000) /*!< Rising trigger event configuration bit of line 17 */
  3331. #define EXTI_RTSR_TR18 ((uint32_t)0x00040000) /*!< Rising trigger event configuration bit of line 18 */
  3332. #define EXTI_RTSR_TR19 ((uint32_t)0x00080000) /*!< Rising trigger event configuration bit of line 19 */
  3333. #define EXTI_RTSR_TR20 ((uint32_t)0x00100000) /*!< Rising trigger event configuration bit of line 20 */
  3334. #define EXTI_RTSR_TR21 ((uint32_t)0x00200000) /*!< Rising trigger event configuration bit of line 21 */
  3335. #define EXTI_RTSR_TR22 ((uint32_t)0x00400000) /*!< Rising trigger event configuration bit of line 22 */
  3336. /****************** Bit definition for EXTI_FTSR register *******************/
  3337. #define EXTI_FTSR_TR0 ((uint32_t)0x00000001) /*!< Falling trigger event configuration bit of line 0 */
  3338. #define EXTI_FTSR_TR1 ((uint32_t)0x00000002) /*!< Falling trigger event configuration bit of line 1 */
  3339. #define EXTI_FTSR_TR2 ((uint32_t)0x00000004) /*!< Falling trigger event configuration bit of line 2 */
  3340. #define EXTI_FTSR_TR3 ((uint32_t)0x00000008) /*!< Falling trigger event configuration bit of line 3 */
  3341. #define EXTI_FTSR_TR4 ((uint32_t)0x00000010) /*!< Falling trigger event configuration bit of line 4 */
  3342. #define EXTI_FTSR_TR5 ((uint32_t)0x00000020) /*!< Falling trigger event configuration bit of line 5 */
  3343. #define EXTI_FTSR_TR6 ((uint32_t)0x00000040) /*!< Falling trigger event configuration bit of line 6 */
  3344. #define EXTI_FTSR_TR7 ((uint32_t)0x00000080) /*!< Falling trigger event configuration bit of line 7 */
  3345. #define EXTI_FTSR_TR8 ((uint32_t)0x00000100) /*!< Falling trigger event configuration bit of line 8 */
  3346. #define EXTI_FTSR_TR9 ((uint32_t)0x00000200) /*!< Falling trigger event configuration bit of line 9 */
  3347. #define EXTI_FTSR_TR10 ((uint32_t)0x00000400) /*!< Falling trigger event configuration bit of line 10 */
  3348. #define EXTI_FTSR_TR11 ((uint32_t)0x00000800) /*!< Falling trigger event configuration bit of line 11 */
  3349. #define EXTI_FTSR_TR12 ((uint32_t)0x00001000) /*!< Falling trigger event configuration bit of line 12 */
  3350. #define EXTI_FTSR_TR13 ((uint32_t)0x00002000) /*!< Falling trigger event configuration bit of line 13 */
  3351. #define EXTI_FTSR_TR14 ((uint32_t)0x00004000) /*!< Falling trigger event configuration bit of line 14 */
  3352. #define EXTI_FTSR_TR15 ((uint32_t)0x00008000) /*!< Falling trigger event configuration bit of line 15 */
  3353. #define EXTI_FTSR_TR16 ((uint32_t)0x00010000) /*!< Falling trigger event configuration bit of line 16 */
  3354. #define EXTI_FTSR_TR17 ((uint32_t)0x00020000) /*!< Falling trigger event configuration bit of line 17 */
  3355. #define EXTI_FTSR_TR18 ((uint32_t)0x00040000) /*!< Falling trigger event configuration bit of line 18 */
  3356. #define EXTI_FTSR_TR19 ((uint32_t)0x00080000) /*!< Falling trigger event configuration bit of line 19 */
  3357. #define EXTI_FTSR_TR20 ((uint32_t)0x00100000) /*!< Falling trigger event configuration bit of line 20 */
  3358. #define EXTI_FTSR_TR21 ((uint32_t)0x00200000) /*!< Falling trigger event configuration bit of line 21 */
  3359. #define EXTI_FTSR_TR22 ((uint32_t)0x00400000) /*!< Falling trigger event configuration bit of line 22 */
  3360. /****************** Bit definition for EXTI_SWIER register ******************/
  3361. #define EXTI_SWIER_SWIER0 ((uint32_t)0x00000001) /*!< Software Interrupt on line 0 */
  3362. #define EXTI_SWIER_SWIER1 ((uint32_t)0x00000002) /*!< Software Interrupt on line 1 */
  3363. #define EXTI_SWIER_SWIER2 ((uint32_t)0x00000004) /*!< Software Interrupt on line 2 */
  3364. #define EXTI_SWIER_SWIER3 ((uint32_t)0x00000008) /*!< Software Interrupt on line 3 */
  3365. #define EXTI_SWIER_SWIER4 ((uint32_t)0x00000010) /*!< Software Interrupt on line 4 */
  3366. #define EXTI_SWIER_SWIER5 ((uint32_t)0x00000020) /*!< Software Interrupt on line 5 */
  3367. #define EXTI_SWIER_SWIER6 ((uint32_t)0x00000040) /*!< Software Interrupt on line 6 */
  3368. #define EXTI_SWIER_SWIER7 ((uint32_t)0x00000080) /*!< Software Interrupt on line 7 */
  3369. #define EXTI_SWIER_SWIER8 ((uint32_t)0x00000100) /*!< Software Interrupt on line 8 */
  3370. #define EXTI_SWIER_SWIER9 ((uint32_t)0x00000200) /*!< Software Interrupt on line 9 */
  3371. #define EXTI_SWIER_SWIER10 ((uint32_t)0x00000400) /*!< Software Interrupt on line 10 */
  3372. #define EXTI_SWIER_SWIER11 ((uint32_t)0x00000800) /*!< Software Interrupt on line 11 */
  3373. #define EXTI_SWIER_SWIER12 ((uint32_t)0x00001000) /*!< Software Interrupt on line 12 */
  3374. #define EXTI_SWIER_SWIER13 ((uint32_t)0x00002000) /*!< Software Interrupt on line 13 */
  3375. #define EXTI_SWIER_SWIER14 ((uint32_t)0x00004000) /*!< Software Interrupt on line 14 */
  3376. #define EXTI_SWIER_SWIER15 ((uint32_t)0x00008000) /*!< Software Interrupt on line 15 */
  3377. #define EXTI_SWIER_SWIER16 ((uint32_t)0x00010000) /*!< Software Interrupt on line 16 */
  3378. #define EXTI_SWIER_SWIER17 ((uint32_t)0x00020000) /*!< Software Interrupt on line 17 */
  3379. #define EXTI_SWIER_SWIER18 ((uint32_t)0x00040000) /*!< Software Interrupt on line 18 */
  3380. #define EXTI_SWIER_SWIER19 ((uint32_t)0x00080000) /*!< Software Interrupt on line 19 */
  3381. #define EXTI_SWIER_SWIER20 ((uint32_t)0x00100000) /*!< Software Interrupt on line 20 */
  3382. #define EXTI_SWIER_SWIER21 ((uint32_t)0x00200000) /*!< Software Interrupt on line 21 */
  3383. #define EXTI_SWIER_SWIER22 ((uint32_t)0x00400000) /*!< Software Interrupt on line 22 */
  3384. /******************* Bit definition for EXTI_PR register ********************/
  3385. #define EXTI_PR_PR0 ((uint32_t)0x00000001) /*!< Pending bit for line 0 */
  3386. #define EXTI_PR_PR1 ((uint32_t)0x00000002) /*!< Pending bit for line 1 */
  3387. #define EXTI_PR_PR2 ((uint32_t)0x00000004) /*!< Pending bit for line 2 */
  3388. #define EXTI_PR_PR3 ((uint32_t)0x00000008) /*!< Pending bit for line 3 */
  3389. #define EXTI_PR_PR4 ((uint32_t)0x00000010) /*!< Pending bit for line 4 */
  3390. #define EXTI_PR_PR5 ((uint32_t)0x00000020) /*!< Pending bit for line 5 */
  3391. #define EXTI_PR_PR6 ((uint32_t)0x00000040) /*!< Pending bit for line 6 */
  3392. #define EXTI_PR_PR7 ((uint32_t)0x00000080) /*!< Pending bit for line 7 */
  3393. #define EXTI_PR_PR8 ((uint32_t)0x00000100) /*!< Pending bit for line 8 */
  3394. #define EXTI_PR_PR9 ((uint32_t)0x00000200) /*!< Pending bit for line 9 */
  3395. #define EXTI_PR_PR10 ((uint32_t)0x00000400) /*!< Pending bit for line 10 */
  3396. #define EXTI_PR_PR11 ((uint32_t)0x00000800) /*!< Pending bit for line 11 */
  3397. #define EXTI_PR_PR12 ((uint32_t)0x00001000) /*!< Pending bit for line 12 */
  3398. #define EXTI_PR_PR13 ((uint32_t)0x00002000) /*!< Pending bit for line 13 */
  3399. #define EXTI_PR_PR14 ((uint32_t)0x00004000) /*!< Pending bit for line 14 */
  3400. #define EXTI_PR_PR15 ((uint32_t)0x00008000) /*!< Pending bit for line 15 */
  3401. #define EXTI_PR_PR16 ((uint32_t)0x00010000) /*!< Pending bit for line 16 */
  3402. #define EXTI_PR_PR17 ((uint32_t)0x00020000) /*!< Pending bit for line 17 */
  3403. #define EXTI_PR_PR18 ((uint32_t)0x00040000) /*!< Pending bit for line 18 */
  3404. #define EXTI_PR_PR19 ((uint32_t)0x00080000) /*!< Pending bit for line 19 */
  3405. #define EXTI_PR_PR20 ((uint32_t)0x00100000) /*!< Pending bit for line 20 */
  3406. #define EXTI_PR_PR21 ((uint32_t)0x00200000) /*!< Pending bit for line 21 */
  3407. #define EXTI_PR_PR22 ((uint32_t)0x00400000) /*!< Pending bit for line 22 */
  3408. /******************************************************************************/
  3409. /* */
  3410. /* FLASH */
  3411. /* */
  3412. /******************************************************************************/
  3413. /******************* Bits definition for FLASH_ACR register *****************/
  3414. #define FLASH_ACR_LATENCY ((uint32_t)0x0000000F)
  3415. #define FLASH_ACR_LATENCY_0WS ((uint32_t)0x00000000)
  3416. #define FLASH_ACR_LATENCY_1WS ((uint32_t)0x00000001)
  3417. #define FLASH_ACR_LATENCY_2WS ((uint32_t)0x00000002)
  3418. #define FLASH_ACR_LATENCY_3WS ((uint32_t)0x00000003)
  3419. #define FLASH_ACR_LATENCY_4WS ((uint32_t)0x00000004)
  3420. #define FLASH_ACR_LATENCY_5WS ((uint32_t)0x00000005)
  3421. #define FLASH_ACR_LATENCY_6WS ((uint32_t)0x00000006)
  3422. #define FLASH_ACR_LATENCY_7WS ((uint32_t)0x00000007)
  3423. #define FLASH_ACR_LATENCY_8WS ((uint32_t)0x00000008)
  3424. #define FLASH_ACR_LATENCY_9WS ((uint32_t)0x00000009)
  3425. #define FLASH_ACR_LATENCY_10WS ((uint32_t)0x0000000A)
  3426. #define FLASH_ACR_LATENCY_11WS ((uint32_t)0x0000000B)
  3427. #define FLASH_ACR_LATENCY_12WS ((uint32_t)0x0000000C)
  3428. #define FLASH_ACR_LATENCY_13WS ((uint32_t)0x0000000D)
  3429. #define FLASH_ACR_LATENCY_14WS ((uint32_t)0x0000000E)
  3430. #define FLASH_ACR_LATENCY_15WS ((uint32_t)0x0000000F)
  3431. #define FLASH_ACR_PRFTEN ((uint32_t)0x00000100)
  3432. #define FLASH_ACR_ICEN ((uint32_t)0x00000200)
  3433. #define FLASH_ACR_DCEN ((uint32_t)0x00000400)
  3434. #define FLASH_ACR_ICRST ((uint32_t)0x00000800)
  3435. #define FLASH_ACR_DCRST ((uint32_t)0x00001000)
  3436. #define FLASH_ACR_BYTE0_ADDRESS ((uint32_t)0x40023C00)
  3437. #define FLASH_ACR_BYTE2_ADDRESS ((uint32_t)0x40023C03)
  3438. /******************* Bits definition for FLASH_SR register ******************/
  3439. #define FLASH_SR_EOP ((uint32_t)0x00000001)
  3440. #define FLASH_SR_SOP ((uint32_t)0x00000002)
  3441. #define FLASH_SR_WRPERR ((uint32_t)0x00000010)
  3442. #define FLASH_SR_PGAERR ((uint32_t)0x00000020)
  3443. #define FLASH_SR_PGPERR ((uint32_t)0x00000040)
  3444. #define FLASH_SR_PGSERR ((uint32_t)0x00000080)
  3445. #define FLASH_SR_BSY ((uint32_t)0x00010000)
  3446. /******************* Bits definition for FLASH_CR register ******************/
  3447. #define FLASH_CR_PG ((uint32_t)0x00000001)
  3448. #define FLASH_CR_SER ((uint32_t)0x00000002)
  3449. #define FLASH_CR_MER ((uint32_t)0x00000004)
  3450. #define FLASH_CR_MER1 FLASH_CR_MER
  3451. #define FLASH_CR_SNB ((uint32_t)0x000000F8)
  3452. #define FLASH_CR_SNB_0 ((uint32_t)0x00000008)
  3453. #define FLASH_CR_SNB_1 ((uint32_t)0x00000010)
  3454. #define FLASH_CR_SNB_2 ((uint32_t)0x00000020)
  3455. #define FLASH_CR_SNB_3 ((uint32_t)0x00000040)
  3456. #define FLASH_CR_SNB_4 ((uint32_t)0x00000080)
  3457. #define FLASH_CR_PSIZE ((uint32_t)0x00000300)
  3458. #define FLASH_CR_PSIZE_0 ((uint32_t)0x00000100)
  3459. #define FLASH_CR_PSIZE_1 ((uint32_t)0x00000200)
  3460. #define FLASH_CR_MER2 ((uint32_t)0x00008000)
  3461. #define FLASH_CR_STRT ((uint32_t)0x00010000)
  3462. #define FLASH_CR_EOPIE ((uint32_t)0x01000000)
  3463. #define FLASH_CR_LOCK ((uint32_t)0x80000000)
  3464. /******************* Bits definition for FLASH_OPTCR register ***************/
  3465. #define FLASH_OPTCR_OPTLOCK ((uint32_t)0x00000001)
  3466. #define FLASH_OPTCR_OPTSTRT ((uint32_t)0x00000002)
  3467. #define FLASH_OPTCR_BOR_LEV_0 ((uint32_t)0x00000004)
  3468. #define FLASH_OPTCR_BOR_LEV_1 ((uint32_t)0x00000008)
  3469. #define FLASH_OPTCR_BOR_LEV ((uint32_t)0x0000000C)
  3470. #define FLASH_OPTCR_BFB2 ((uint32_t)0x00000010)
  3471. #define FLASH_OPTCR_WDG_SW ((uint32_t)0x00000020)
  3472. #define FLASH_OPTCR_nRST_STOP ((uint32_t)0x00000040)
  3473. #define FLASH_OPTCR_nRST_STDBY ((uint32_t)0x00000080)
  3474. #define FLASH_OPTCR_RDP ((uint32_t)0x0000FF00)
  3475. #define FLASH_OPTCR_RDP_0 ((uint32_t)0x00000100)
  3476. #define FLASH_OPTCR_RDP_1 ((uint32_t)0x00000200)
  3477. #define FLASH_OPTCR_RDP_2 ((uint32_t)0x00000400)
  3478. #define FLASH_OPTCR_RDP_3 ((uint32_t)0x00000800)
  3479. #define FLASH_OPTCR_RDP_4 ((uint32_t)0x00001000)
  3480. #define FLASH_OPTCR_RDP_5 ((uint32_t)0x00002000)
  3481. #define FLASH_OPTCR_RDP_6 ((uint32_t)0x00004000)
  3482. #define FLASH_OPTCR_RDP_7 ((uint32_t)0x00008000)
  3483. #define FLASH_OPTCR_nWRP ((uint32_t)0x0FFF0000)
  3484. #define FLASH_OPTCR_nWRP_0 ((uint32_t)0x00010000)
  3485. #define FLASH_OPTCR_nWRP_1 ((uint32_t)0x00020000)
  3486. #define FLASH_OPTCR_nWRP_2 ((uint32_t)0x00040000)
  3487. #define FLASH_OPTCR_nWRP_3 ((uint32_t)0x00080000)
  3488. #define FLASH_OPTCR_nWRP_4 ((uint32_t)0x00100000)
  3489. #define FLASH_OPTCR_nWRP_5 ((uint32_t)0x00200000)
  3490. #define FLASH_OPTCR_nWRP_6 ((uint32_t)0x00400000)
  3491. #define FLASH_OPTCR_nWRP_7 ((uint32_t)0x00800000)
  3492. #define FLASH_OPTCR_nWRP_8 ((uint32_t)0x01000000)
  3493. #define FLASH_OPTCR_nWRP_9 ((uint32_t)0x02000000)
  3494. #define FLASH_OPTCR_nWRP_10 ((uint32_t)0x04000000)
  3495. #define FLASH_OPTCR_nWRP_11 ((uint32_t)0x08000000)
  3496. #define FLASH_OPTCR_DB1M ((uint32_t)0x40000000)
  3497. #define FLASH_OPTCR_SPRMOD ((uint32_t)0x80000000)
  3498. /****************** Bits definition for FLASH_OPTCR1 register ***************/
  3499. #define FLASH_OPTCR1_nWRP ((uint32_t)0x0FFF0000)
  3500. #define FLASH_OPTCR1_nWRP_0 ((uint32_t)0x00010000)
  3501. #define FLASH_OPTCR1_nWRP_1 ((uint32_t)0x00020000)
  3502. #define FLASH_OPTCR1_nWRP_2 ((uint32_t)0x00040000)
  3503. #define FLASH_OPTCR1_nWRP_3 ((uint32_t)0x00080000)
  3504. #define FLASH_OPTCR1_nWRP_4 ((uint32_t)0x00100000)
  3505. #define FLASH_OPTCR1_nWRP_5 ((uint32_t)0x00200000)
  3506. #define FLASH_OPTCR1_nWRP_6 ((uint32_t)0x00400000)
  3507. #define FLASH_OPTCR1_nWRP_7 ((uint32_t)0x00800000)
  3508. #define FLASH_OPTCR1_nWRP_8 ((uint32_t)0x01000000)
  3509. #define FLASH_OPTCR1_nWRP_9 ((uint32_t)0x02000000)
  3510. #define FLASH_OPTCR1_nWRP_10 ((uint32_t)0x04000000)
  3511. #define FLASH_OPTCR1_nWRP_11 ((uint32_t)0x08000000)
  3512. /******************************************************************************/
  3513. /* */
  3514. /* Flexible Memory Controller */
  3515. /* */
  3516. /******************************************************************************/
  3517. /****************** Bit definition for FMC_BCR1 register *******************/
  3518. #define FMC_BCR1_MBKEN ((uint32_t)0x00000001) /*!<Memory bank enable bit */
  3519. #define FMC_BCR1_MUXEN ((uint32_t)0x00000002) /*!<Address/data multiplexing enable bit */
  3520. #define FMC_BCR1_MTYP ((uint32_t)0x0000000C) /*!<MTYP[1:0] bits (Memory type) */
  3521. #define FMC_BCR1_MTYP_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  3522. #define FMC_BCR1_MTYP_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  3523. #define FMC_BCR1_MWID ((uint32_t)0x00000030) /*!<MWID[1:0] bits (Memory data bus width) */
  3524. #define FMC_BCR1_MWID_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3525. #define FMC_BCR1_MWID_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3526. #define FMC_BCR1_FACCEN ((uint32_t)0x00000040) /*!<Flash access enable */
  3527. #define FMC_BCR1_BURSTEN ((uint32_t)0x00000100) /*!<Burst enable bit */
  3528. #define FMC_BCR1_WAITPOL ((uint32_t)0x00000200) /*!<Wait signal polarity bit */
  3529. #define FMC_BCR1_WRAPMOD ((uint32_t)0x00000400) /*!<Wrapped burst mode support */
  3530. #define FMC_BCR1_WAITCFG ((uint32_t)0x00000800) /*!<Wait timing configuration */
  3531. #define FMC_BCR1_WREN ((uint32_t)0x00001000) /*!<Write enable bit */
  3532. #define FMC_BCR1_WAITEN ((uint32_t)0x00002000) /*!<Wait enable bit */
  3533. #define FMC_BCR1_EXTMOD ((uint32_t)0x00004000) /*!<Extended mode enable */
  3534. #define FMC_BCR1_ASYNCWAIT ((uint32_t)0x00008000) /*!<Asynchronous wait */
  3535. #define FMC_BCR1_CPSIZE ((uint32_t)0x00070000) /*!<CRAM page size */
  3536. #define FMC_BCR1_CPSIZE_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3537. #define FMC_BCR1_CPSIZE_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3538. #define FMC_BCR1_CPSIZE_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3539. #define FMC_BCR1_CBURSTRW ((uint32_t)0x00080000) /*!<Write burst enable */
  3540. #define FMC_BCR1_CCLKEN ((uint32_t)0x00100000) /*!<Continous clock enable */
  3541. /****************** Bit definition for FMC_BCR2 register *******************/
  3542. #define FMC_BCR2_MBKEN ((uint32_t)0x00000001) /*!<Memory bank enable bit */
  3543. #define FMC_BCR2_MUXEN ((uint32_t)0x00000002) /*!<Address/data multiplexing enable bit */
  3544. #define FMC_BCR2_MTYP ((uint32_t)0x0000000C) /*!<MTYP[1:0] bits (Memory type) */
  3545. #define FMC_BCR2_MTYP_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  3546. #define FMC_BCR2_MTYP_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  3547. #define FMC_BCR2_MWID ((uint32_t)0x00000030) /*!<MWID[1:0] bits (Memory data bus width) */
  3548. #define FMC_BCR2_MWID_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3549. #define FMC_BCR2_MWID_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3550. #define FMC_BCR2_FACCEN ((uint32_t)0x00000040) /*!<Flash access enable */
  3551. #define FMC_BCR2_BURSTEN ((uint32_t)0x00000100) /*!<Burst enable bit */
  3552. #define FMC_BCR2_WAITPOL ((uint32_t)0x00000200) /*!<Wait signal polarity bit */
  3553. #define FMC_BCR2_WRAPMOD ((uint32_t)0x00000400) /*!<Wrapped burst mode support */
  3554. #define FMC_BCR2_WAITCFG ((uint32_t)0x00000800) /*!<Wait timing configuration */
  3555. #define FMC_BCR2_WREN ((uint32_t)0x00001000) /*!<Write enable bit */
  3556. #define FMC_BCR2_WAITEN ((uint32_t)0x00002000) /*!<Wait enable bit */
  3557. #define FMC_BCR2_EXTMOD ((uint32_t)0x00004000) /*!<Extended mode enable */
  3558. #define FMC_BCR2_ASYNCWAIT ((uint32_t)0x00008000) /*!<Asynchronous wait */
  3559. #define FMC_BCR2_CPSIZE ((uint32_t)0x00070000) /*!<CRAM page size */
  3560. #define FMC_BCR2_CPSIZE_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3561. #define FMC_BCR2_CPSIZE_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3562. #define FMC_BCR2_CPSIZE_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3563. #define FMC_BCR2_CBURSTRW ((uint32_t)0x00080000) /*!<Write burst enable */
  3564. /****************** Bit definition for FMC_BCR3 register *******************/
  3565. #define FMC_BCR3_MBKEN ((uint32_t)0x00000001) /*!<Memory bank enable bit */
  3566. #define FMC_BCR3_MUXEN ((uint32_t)0x00000002) /*!<Address/data multiplexing enable bit */
  3567. #define FMC_BCR3_MTYP ((uint32_t)0x0000000C) /*!<MTYP[1:0] bits (Memory type) */
  3568. #define FMC_BCR3_MTYP_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  3569. #define FMC_BCR3_MTYP_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  3570. #define FMC_BCR3_MWID ((uint32_t)0x00000030) /*!<MWID[1:0] bits (Memory data bus width) */
  3571. #define FMC_BCR3_MWID_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3572. #define FMC_BCR3_MWID_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3573. #define FMC_BCR3_FACCEN ((uint32_t)0x00000040) /*!<Flash access enable */
  3574. #define FMC_BCR3_BURSTEN ((uint32_t)0x00000100) /*!<Burst enable bit */
  3575. #define FMC_BCR3_WAITPOL ((uint32_t)0x00000200) /*!<Wait signal polarity bit */
  3576. #define FMC_BCR3_WRAPMOD ((uint32_t)0x00000400) /*!<Wrapped burst mode support */
  3577. #define FMC_BCR3_WAITCFG ((uint32_t)0x00000800) /*!<Wait timing configuration */
  3578. #define FMC_BCR3_WREN ((uint32_t)0x00001000) /*!<Write enable bit */
  3579. #define FMC_BCR3_WAITEN ((uint32_t)0x00002000) /*!<Wait enable bit */
  3580. #define FMC_BCR3_EXTMOD ((uint32_t)0x00004000) /*!<Extended mode enable */
  3581. #define FMC_BCR3_ASYNCWAIT ((uint32_t)0x00008000) /*!<Asynchronous wait */
  3582. #define FMC_BCR3_CPSIZE ((uint32_t)0x00070000) /*!<CRAM page size */
  3583. #define FMC_BCR3_CPSIZE_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3584. #define FMC_BCR3_CPSIZE_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3585. #define FMC_BCR3_CPSIZE_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3586. #define FMC_BCR3_CBURSTRW ((uint32_t)0x00080000) /*!<Write burst enable */
  3587. /****************** Bit definition for FMC_BCR4 register *******************/
  3588. #define FMC_BCR4_MBKEN ((uint32_t)0x00000001) /*!<Memory bank enable bit */
  3589. #define FMC_BCR4_MUXEN ((uint32_t)0x00000002) /*!<Address/data multiplexing enable bit */
  3590. #define FMC_BCR4_MTYP ((uint32_t)0x0000000C) /*!<MTYP[1:0] bits (Memory type) */
  3591. #define FMC_BCR4_MTYP_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  3592. #define FMC_BCR4_MTYP_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  3593. #define FMC_BCR4_MWID ((uint32_t)0x00000030) /*!<MWID[1:0] bits (Memory data bus width) */
  3594. #define FMC_BCR4_MWID_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3595. #define FMC_BCR4_MWID_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3596. #define FMC_BCR4_FACCEN ((uint32_t)0x00000040) /*!<Flash access enable */
  3597. #define FMC_BCR4_BURSTEN ((uint32_t)0x00000100) /*!<Burst enable bit */
  3598. #define FMC_BCR4_WAITPOL ((uint32_t)0x00000200) /*!<Wait signal polarity bit */
  3599. #define FMC_BCR4_WRAPMOD ((uint32_t)0x00000400) /*!<Wrapped burst mode support */
  3600. #define FMC_BCR4_WAITCFG ((uint32_t)0x00000800) /*!<Wait timing configuration */
  3601. #define FMC_BCR4_WREN ((uint32_t)0x00001000) /*!<Write enable bit */
  3602. #define FMC_BCR4_WAITEN ((uint32_t)0x00002000) /*!<Wait enable bit */
  3603. #define FMC_BCR4_EXTMOD ((uint32_t)0x00004000) /*!<Extended mode enable */
  3604. #define FMC_BCR4_ASYNCWAIT ((uint32_t)0x00008000) /*!<Asynchronous wait */
  3605. #define FMC_BCR4_CPSIZE ((uint32_t)0x00070000) /*!<CRAM page size */
  3606. #define FMC_BCR4_CPSIZE_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3607. #define FMC_BCR4_CPSIZE_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3608. #define FMC_BCR4_CPSIZE_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3609. #define FMC_BCR4_CBURSTRW ((uint32_t)0x00080000) /*!<Write burst enable */
  3610. /****************** Bit definition for FMC_BTR1 register ******************/
  3611. #define FMC_BTR1_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  3612. #define FMC_BTR1_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3613. #define FMC_BTR1_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3614. #define FMC_BTR1_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3615. #define FMC_BTR1_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3616. #define FMC_BTR1_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  3617. #define FMC_BTR1_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3618. #define FMC_BTR1_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3619. #define FMC_BTR1_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3620. #define FMC_BTR1_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  3621. #define FMC_BTR1_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  3622. #define FMC_BTR1_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3623. #define FMC_BTR1_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3624. #define FMC_BTR1_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3625. #define FMC_BTR1_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3626. #define FMC_BTR1_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  3627. #define FMC_BTR1_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  3628. #define FMC_BTR1_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  3629. #define FMC_BTR1_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  3630. #define FMC_BTR1_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround phase duration) */
  3631. #define FMC_BTR1_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3632. #define FMC_BTR1_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3633. #define FMC_BTR1_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3634. #define FMC_BTR1_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  3635. #define FMC_BTR1_CLKDIV ((uint32_t)0x00F00000) /*!<CLKDIV[3:0] bits (Clock divide ratio) */
  3636. #define FMC_BTR1_CLKDIV_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  3637. #define FMC_BTR1_CLKDIV_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  3638. #define FMC_BTR1_CLKDIV_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  3639. #define FMC_BTR1_CLKDIV_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  3640. #define FMC_BTR1_DATLAT ((uint32_t)0x0F000000) /*!<DATLA[3:0] bits (Data latency) */
  3641. #define FMC_BTR1_DATLAT_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  3642. #define FMC_BTR1_DATLAT_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  3643. #define FMC_BTR1_DATLAT_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  3644. #define FMC_BTR1_DATLAT_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  3645. #define FMC_BTR1_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  3646. #define FMC_BTR1_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  3647. #define FMC_BTR1_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  3648. /****************** Bit definition for FMC_BTR2 register *******************/
  3649. #define FMC_BTR2_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  3650. #define FMC_BTR2_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3651. #define FMC_BTR2_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3652. #define FMC_BTR2_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3653. #define FMC_BTR2_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3654. #define FMC_BTR2_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  3655. #define FMC_BTR2_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3656. #define FMC_BTR2_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3657. #define FMC_BTR2_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3658. #define FMC_BTR2_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  3659. #define FMC_BTR2_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  3660. #define FMC_BTR2_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3661. #define FMC_BTR2_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3662. #define FMC_BTR2_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3663. #define FMC_BTR2_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3664. #define FMC_BTR2_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  3665. #define FMC_BTR2_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  3666. #define FMC_BTR2_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  3667. #define FMC_BTR2_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  3668. #define FMC_BTR2_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround phase duration) */
  3669. #define FMC_BTR2_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3670. #define FMC_BTR2_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3671. #define FMC_BTR2_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3672. #define FMC_BTR2_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  3673. #define FMC_BTR2_CLKDIV ((uint32_t)0x00F00000) /*!<CLKDIV[3:0] bits (Clock divide ratio) */
  3674. #define FMC_BTR2_CLKDIV_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  3675. #define FMC_BTR2_CLKDIV_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  3676. #define FMC_BTR2_CLKDIV_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  3677. #define FMC_BTR2_CLKDIV_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  3678. #define FMC_BTR2_DATLAT ((uint32_t)0x0F000000) /*!<DATLA[3:0] bits (Data latency) */
  3679. #define FMC_BTR2_DATLAT_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  3680. #define FMC_BTR2_DATLAT_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  3681. #define FMC_BTR2_DATLAT_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  3682. #define FMC_BTR2_DATLAT_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  3683. #define FMC_BTR2_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  3684. #define FMC_BTR2_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  3685. #define FMC_BTR2_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  3686. /******************* Bit definition for FMC_BTR3 register *******************/
  3687. #define FMC_BTR3_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  3688. #define FMC_BTR3_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3689. #define FMC_BTR3_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3690. #define FMC_BTR3_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3691. #define FMC_BTR3_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3692. #define FMC_BTR3_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  3693. #define FMC_BTR3_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3694. #define FMC_BTR3_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3695. #define FMC_BTR3_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3696. #define FMC_BTR3_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  3697. #define FMC_BTR3_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  3698. #define FMC_BTR3_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3699. #define FMC_BTR3_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3700. #define FMC_BTR3_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3701. #define FMC_BTR3_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3702. #define FMC_BTR3_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  3703. #define FMC_BTR3_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  3704. #define FMC_BTR3_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  3705. #define FMC_BTR3_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  3706. #define FMC_BTR3_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround phase duration) */
  3707. #define FMC_BTR3_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3708. #define FMC_BTR3_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3709. #define FMC_BTR3_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3710. #define FMC_BTR3_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  3711. #define FMC_BTR3_CLKDIV ((uint32_t)0x00F00000) /*!<CLKDIV[3:0] bits (Clock divide ratio) */
  3712. #define FMC_BTR3_CLKDIV_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  3713. #define FMC_BTR3_CLKDIV_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  3714. #define FMC_BTR3_CLKDIV_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  3715. #define FMC_BTR3_CLKDIV_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  3716. #define FMC_BTR3_DATLAT ((uint32_t)0x0F000000) /*!<DATLA[3:0] bits (Data latency) */
  3717. #define FMC_BTR3_DATLAT_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  3718. #define FMC_BTR3_DATLAT_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  3719. #define FMC_BTR3_DATLAT_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  3720. #define FMC_BTR3_DATLAT_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  3721. #define FMC_BTR3_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  3722. #define FMC_BTR3_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  3723. #define FMC_BTR3_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  3724. /****************** Bit definition for FMC_BTR4 register *******************/
  3725. #define FMC_BTR4_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  3726. #define FMC_BTR4_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3727. #define FMC_BTR4_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3728. #define FMC_BTR4_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3729. #define FMC_BTR4_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3730. #define FMC_BTR4_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  3731. #define FMC_BTR4_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3732. #define FMC_BTR4_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3733. #define FMC_BTR4_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3734. #define FMC_BTR4_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  3735. #define FMC_BTR4_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  3736. #define FMC_BTR4_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3737. #define FMC_BTR4_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3738. #define FMC_BTR4_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3739. #define FMC_BTR4_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3740. #define FMC_BTR4_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  3741. #define FMC_BTR4_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  3742. #define FMC_BTR4_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  3743. #define FMC_BTR4_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  3744. #define FMC_BTR4_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround phase duration) */
  3745. #define FMC_BTR4_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3746. #define FMC_BTR4_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3747. #define FMC_BTR4_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3748. #define FMC_BTR4_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  3749. #define FMC_BTR4_CLKDIV ((uint32_t)0x00F00000) /*!<CLKDIV[3:0] bits (Clock divide ratio) */
  3750. #define FMC_BTR4_CLKDIV_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  3751. #define FMC_BTR4_CLKDIV_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  3752. #define FMC_BTR4_CLKDIV_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  3753. #define FMC_BTR4_CLKDIV_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  3754. #define FMC_BTR4_DATLAT ((uint32_t)0x0F000000) /*!<DATLA[3:0] bits (Data latency) */
  3755. #define FMC_BTR4_DATLAT_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  3756. #define FMC_BTR4_DATLAT_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  3757. #define FMC_BTR4_DATLAT_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  3758. #define FMC_BTR4_DATLAT_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  3759. #define FMC_BTR4_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  3760. #define FMC_BTR4_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  3761. #define FMC_BTR4_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  3762. /****************** Bit definition for FMC_BWTR1 register ******************/
  3763. #define FMC_BWTR1_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  3764. #define FMC_BWTR1_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3765. #define FMC_BWTR1_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3766. #define FMC_BWTR1_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3767. #define FMC_BWTR1_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3768. #define FMC_BWTR1_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  3769. #define FMC_BWTR1_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3770. #define FMC_BWTR1_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3771. #define FMC_BWTR1_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3772. #define FMC_BWTR1_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  3773. #define FMC_BWTR1_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  3774. #define FMC_BWTR1_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3775. #define FMC_BWTR1_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3776. #define FMC_BWTR1_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3777. #define FMC_BWTR1_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3778. #define FMC_BWTR1_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  3779. #define FMC_BWTR1_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  3780. #define FMC_BWTR1_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  3781. #define FMC_BWTR1_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  3782. #define FMC_BWTR1_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround duration) */
  3783. #define FMC_BWTR1_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3784. #define FMC_BWTR1_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3785. #define FMC_BWTR1_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3786. #define FMC_BWTR1_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  3787. #define FMC_BWTR1_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  3788. #define FMC_BWTR1_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  3789. #define FMC_BWTR1_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  3790. /****************** Bit definition for FMC_BWTR2 register ******************/
  3791. #define FMC_BWTR2_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  3792. #define FMC_BWTR2_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3793. #define FMC_BWTR2_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3794. #define FMC_BWTR2_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3795. #define FMC_BWTR2_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3796. #define FMC_BWTR2_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  3797. #define FMC_BWTR2_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3798. #define FMC_BWTR2_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3799. #define FMC_BWTR2_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3800. #define FMC_BWTR2_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  3801. #define FMC_BWTR2_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  3802. #define FMC_BWTR2_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3803. #define FMC_BWTR2_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3804. #define FMC_BWTR2_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3805. #define FMC_BWTR2_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3806. #define FMC_BWTR2_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  3807. #define FMC_BWTR2_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  3808. #define FMC_BWTR2_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  3809. #define FMC_BWTR2_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  3810. #define FMC_BWTR2_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround duration) */
  3811. #define FMC_BWTR2_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3812. #define FMC_BWTR2_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3813. #define FMC_BWTR2_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3814. #define FMC_BWTR2_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  3815. #define FMC_BWTR2_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  3816. #define FMC_BWTR2_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  3817. #define FMC_BWTR2_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  3818. /****************** Bit definition for FMC_BWTR3 register ******************/
  3819. #define FMC_BWTR3_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  3820. #define FMC_BWTR3_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3821. #define FMC_BWTR3_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3822. #define FMC_BWTR3_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3823. #define FMC_BWTR3_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3824. #define FMC_BWTR3_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  3825. #define FMC_BWTR3_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3826. #define FMC_BWTR3_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3827. #define FMC_BWTR3_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3828. #define FMC_BWTR3_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  3829. #define FMC_BWTR3_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  3830. #define FMC_BWTR3_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3831. #define FMC_BWTR3_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3832. #define FMC_BWTR3_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3833. #define FMC_BWTR3_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3834. #define FMC_BWTR3_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  3835. #define FMC_BWTR3_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  3836. #define FMC_BWTR3_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  3837. #define FMC_BWTR3_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  3838. #define FMC_BWTR3_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround duration) */
  3839. #define FMC_BWTR3_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3840. #define FMC_BWTR3_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3841. #define FMC_BWTR3_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3842. #define FMC_BWTR3_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  3843. #define FMC_BWTR3_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  3844. #define FMC_BWTR3_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  3845. #define FMC_BWTR3_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  3846. /****************** Bit definition for FMC_BWTR4 register ******************/
  3847. #define FMC_BWTR4_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  3848. #define FMC_BWTR4_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3849. #define FMC_BWTR4_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3850. #define FMC_BWTR4_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3851. #define FMC_BWTR4_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3852. #define FMC_BWTR4_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  3853. #define FMC_BWTR4_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3854. #define FMC_BWTR4_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3855. #define FMC_BWTR4_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3856. #define FMC_BWTR4_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  3857. #define FMC_BWTR4_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  3858. #define FMC_BWTR4_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3859. #define FMC_BWTR4_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3860. #define FMC_BWTR4_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3861. #define FMC_BWTR4_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3862. #define FMC_BWTR4_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  3863. #define FMC_BWTR4_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  3864. #define FMC_BWTR4_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  3865. #define FMC_BWTR4_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  3866. #define FMC_BWTR4_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround duration) */
  3867. #define FMC_BWTR4_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3868. #define FMC_BWTR4_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3869. #define FMC_BWTR4_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3870. #define FMC_BWTR4_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  3871. #define FMC_BWTR4_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  3872. #define FMC_BWTR4_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  3873. #define FMC_BWTR4_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  3874. /****************** Bit definition for FMC_PCR2 register *******************/
  3875. #define FMC_PCR2_PWAITEN ((uint32_t)0x00000002) /*!<Wait feature enable bit */
  3876. #define FMC_PCR2_PBKEN ((uint32_t)0x00000004) /*!<PC Card/NAND Flash memory bank enable bit */
  3877. #define FMC_PCR2_PTYP ((uint32_t)0x00000008) /*!<Memory type */
  3878. #define FMC_PCR2_PWID ((uint32_t)0x00000030) /*!<PWID[1:0] bits (NAND Flash databus width) */
  3879. #define FMC_PCR2_PWID_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3880. #define FMC_PCR2_PWID_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3881. #define FMC_PCR2_ECCEN ((uint32_t)0x00000040) /*!<ECC computation logic enable bit */
  3882. #define FMC_PCR2_TCLR ((uint32_t)0x00001E00) /*!<TCLR[3:0] bits (CLE to RE delay) */
  3883. #define FMC_PCR2_TCLR_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  3884. #define FMC_PCR2_TCLR_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  3885. #define FMC_PCR2_TCLR_2 ((uint32_t)0x00000800) /*!<Bit 2 */
  3886. #define FMC_PCR2_TCLR_3 ((uint32_t)0x00001000) /*!<Bit 3 */
  3887. #define FMC_PCR2_TAR ((uint32_t)0x0001E000) /*!<TAR[3:0] bits (ALE to RE delay) */
  3888. #define FMC_PCR2_TAR_0 ((uint32_t)0x00002000) /*!<Bit 0 */
  3889. #define FMC_PCR2_TAR_1 ((uint32_t)0x00004000) /*!<Bit 1 */
  3890. #define FMC_PCR2_TAR_2 ((uint32_t)0x00008000) /*!<Bit 2 */
  3891. #define FMC_PCR2_TAR_3 ((uint32_t)0x00010000) /*!<Bit 3 */
  3892. #define FMC_PCR2_ECCPS ((uint32_t)0x000E0000) /*!<ECCPS[1:0] bits (ECC page size) */
  3893. #define FMC_PCR2_ECCPS_0 ((uint32_t)0x00020000) /*!<Bit 0 */
  3894. #define FMC_PCR2_ECCPS_1 ((uint32_t)0x00040000) /*!<Bit 1 */
  3895. #define FMC_PCR2_ECCPS_2 ((uint32_t)0x00080000) /*!<Bit 2 */
  3896. /****************** Bit definition for FMC_PCR3 register *******************/
  3897. #define FMC_PCR3_PWAITEN ((uint32_t)0x00000002) /*!<Wait feature enable bit */
  3898. #define FMC_PCR3_PBKEN ((uint32_t)0x00000004) /*!<PC Card/NAND Flash memory bank enable bit */
  3899. #define FMC_PCR3_PTYP ((uint32_t)0x00000008) /*!<Memory type */
  3900. #define FMC_PCR3_PWID ((uint32_t)0x00000030) /*!<PWID[1:0] bits (NAND Flash databus width) */
  3901. #define FMC_PCR3_PWID_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3902. #define FMC_PCR3_PWID_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3903. #define FMC_PCR3_ECCEN ((uint32_t)0x00000040) /*!<ECC computation logic enable bit */
  3904. #define FMC_PCR3_TCLR ((uint32_t)0x00001E00) /*!<TCLR[3:0] bits (CLE to RE delay) */
  3905. #define FMC_PCR3_TCLR_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  3906. #define FMC_PCR3_TCLR_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  3907. #define FMC_PCR3_TCLR_2 ((uint32_t)0x00000800) /*!<Bit 2 */
  3908. #define FMC_PCR3_TCLR_3 ((uint32_t)0x00001000) /*!<Bit 3 */
  3909. #define FMC_PCR3_TAR ((uint32_t)0x0001E000) /*!<TAR[3:0] bits (ALE to RE delay) */
  3910. #define FMC_PCR3_TAR_0 ((uint32_t)0x00002000) /*!<Bit 0 */
  3911. #define FMC_PCR3_TAR_1 ((uint32_t)0x00004000) /*!<Bit 1 */
  3912. #define FMC_PCR3_TAR_2 ((uint32_t)0x00008000) /*!<Bit 2 */
  3913. #define FMC_PCR3_TAR_3 ((uint32_t)0x00010000) /*!<Bit 3 */
  3914. #define FMC_PCR3_ECCPS ((uint32_t)0x000E0000) /*!<ECCPS[2:0] bits (ECC page size) */
  3915. #define FMC_PCR3_ECCPS_0 ((uint32_t)0x00020000) /*!<Bit 0 */
  3916. #define FMC_PCR3_ECCPS_1 ((uint32_t)0x00040000) /*!<Bit 1 */
  3917. #define FMC_PCR3_ECCPS_2 ((uint32_t)0x00080000) /*!<Bit 2 */
  3918. /****************** Bit definition for FMC_PCR4 register *******************/
  3919. #define FMC_PCR4_PWAITEN ((uint32_t)0x00000002) /*!<Wait feature enable bit */
  3920. #define FMC_PCR4_PBKEN ((uint32_t)0x00000004) /*!<PC Card/NAND Flash memory bank enable bit */
  3921. #define FMC_PCR4_PTYP ((uint32_t)0x00000008) /*!<Memory type */
  3922. #define FMC_PCR4_PWID ((uint32_t)0x00000030) /*!<PWID[1:0] bits (NAND Flash databus width) */
  3923. #define FMC_PCR4_PWID_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3924. #define FMC_PCR4_PWID_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3925. #define FMC_PCR4_ECCEN ((uint32_t)0x00000040) /*!<ECC computation logic enable bit */
  3926. #define FMC_PCR4_TCLR ((uint32_t)0x00001E00) /*!<TCLR[3:0] bits (CLE to RE delay) */
  3927. #define FMC_PCR4_TCLR_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  3928. #define FMC_PCR4_TCLR_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  3929. #define FMC_PCR4_TCLR_2 ((uint32_t)0x00000800) /*!<Bit 2 */
  3930. #define FMC_PCR4_TCLR_3 ((uint32_t)0x00001000) /*!<Bit 3 */
  3931. #define FMC_PCR4_TAR ((uint32_t)0x0001E000) /*!<TAR[3:0] bits (ALE to RE delay) */
  3932. #define FMC_PCR4_TAR_0 ((uint32_t)0x00002000) /*!<Bit 0 */
  3933. #define FMC_PCR4_TAR_1 ((uint32_t)0x00004000) /*!<Bit 1 */
  3934. #define FMC_PCR4_TAR_2 ((uint32_t)0x00008000) /*!<Bit 2 */
  3935. #define FMC_PCR4_TAR_3 ((uint32_t)0x00010000) /*!<Bit 3 */
  3936. #define FMC_PCR4_ECCPS ((uint32_t)0x000E0000) /*!<ECCPS[2:0] bits (ECC page size) */
  3937. #define FMC_PCR4_ECCPS_0 ((uint32_t)0x00020000) /*!<Bit 0 */
  3938. #define FMC_PCR4_ECCPS_1 ((uint32_t)0x00040000) /*!<Bit 1 */
  3939. #define FMC_PCR4_ECCPS_2 ((uint32_t)0x00080000) /*!<Bit 2 */
  3940. /******************* Bit definition for FMC_SR2 register *******************/
  3941. #define FMC_SR2_IRS ((uint32_t)0x01) /*!<Interrupt Rising Edge status */
  3942. #define FMC_SR2_ILS ((uint32_t)0x02) /*!<Interrupt Level status */
  3943. #define FMC_SR2_IFS ((uint32_t)0x04) /*!<Interrupt Falling Edge status */
  3944. #define FMC_SR2_IREN ((uint32_t)0x08) /*!<Interrupt Rising Edge detection Enable bit */
  3945. #define FMC_SR2_ILEN ((uint32_t)0x10) /*!<Interrupt Level detection Enable bit */
  3946. #define FMC_SR2_IFEN ((uint32_t)0x20) /*!<Interrupt Falling Edge detection Enable bit */
  3947. #define FMC_SR2_FEMPT ((uint32_t)0x40) /*!<FIFO empty */
  3948. /******************* Bit definition for FMC_SR3 register *******************/
  3949. #define FMC_SR3_IRS ((uint32_t)0x01) /*!<Interrupt Rising Edge status */
  3950. #define FMC_SR3_ILS ((uint32_t)0x02) /*!<Interrupt Level status */
  3951. #define FMC_SR3_IFS ((uint32_t)0x04) /*!<Interrupt Falling Edge status */
  3952. #define FMC_SR3_IREN ((uint32_t)0x08) /*!<Interrupt Rising Edge detection Enable bit */
  3953. #define FMC_SR3_ILEN ((uint32_t)0x10) /*!<Interrupt Level detection Enable bit */
  3954. #define FMC_SR3_IFEN ((uint32_t)0x20) /*!<Interrupt Falling Edge detection Enable bit */
  3955. #define FMC_SR3_FEMPT ((uint32_t)0x40) /*!<FIFO empty */
  3956. /******************* Bit definition for FMC_SR4 register *******************/
  3957. #define FMC_SR4_IRS ((uint32_t)0x01) /*!<Interrupt Rising Edge status */
  3958. #define FMC_SR4_ILS ((uint32_t)0x02) /*!<Interrupt Level status */
  3959. #define FMC_SR4_IFS ((uint32_t)0x04) /*!<Interrupt Falling Edge status */
  3960. #define FMC_SR4_IREN ((uint32_t)0x08) /*!<Interrupt Rising Edge detection Enable bit */
  3961. #define FMC_SR4_ILEN ((uint32_t)0x10) /*!<Interrupt Level detection Enable bit */
  3962. #define FMC_SR4_IFEN ((uint32_t)0x20) /*!<Interrupt Falling Edge detection Enable bit */
  3963. #define FMC_SR4_FEMPT ((uint32_t)0x40) /*!<FIFO empty */
  3964. /****************** Bit definition for FMC_PMEM2 register ******************/
  3965. #define FMC_PMEM2_MEMSET2 ((uint32_t)0x000000FF) /*!<MEMSET2[7:0] bits (Common memory 2 setup time) */
  3966. #define FMC_PMEM2_MEMSET2_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3967. #define FMC_PMEM2_MEMSET2_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3968. #define FMC_PMEM2_MEMSET2_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3969. #define FMC_PMEM2_MEMSET2_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3970. #define FMC_PMEM2_MEMSET2_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  3971. #define FMC_PMEM2_MEMSET2_5 ((uint32_t)0x00000020) /*!<Bit 5 */
  3972. #define FMC_PMEM2_MEMSET2_6 ((uint32_t)0x00000040) /*!<Bit 6 */
  3973. #define FMC_PMEM2_MEMSET2_7 ((uint32_t)0x00000080) /*!<Bit 7 */
  3974. #define FMC_PMEM2_MEMWAIT2 ((uint32_t)0x0000FF00) /*!<MEMWAIT2[7:0] bits (Common memory 2 wait time) */
  3975. #define FMC_PMEM2_MEMWAIT2_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3976. #define FMC_PMEM2_MEMWAIT2_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3977. #define FMC_PMEM2_MEMWAIT2_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3978. #define FMC_PMEM2_MEMWAIT2_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3979. #define FMC_PMEM2_MEMWAIT2_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  3980. #define FMC_PMEM2_MEMWAIT2_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  3981. #define FMC_PMEM2_MEMWAIT2_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  3982. #define FMC_PMEM2_MEMWAIT2_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  3983. #define FMC_PMEM2_MEMHOLD2 ((uint32_t)0x00FF0000) /*!<MEMHOLD2[7:0] bits (Common memory 2 hold time) */
  3984. #define FMC_PMEM2_MEMHOLD2_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3985. #define FMC_PMEM2_MEMHOLD2_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3986. #define FMC_PMEM2_MEMHOLD2_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3987. #define FMC_PMEM2_MEMHOLD2_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  3988. #define FMC_PMEM2_MEMHOLD2_4 ((uint32_t)0x00100000) /*!<Bit 4 */
  3989. #define FMC_PMEM2_MEMHOLD2_5 ((uint32_t)0x00200000) /*!<Bit 5 */
  3990. #define FMC_PMEM2_MEMHOLD2_6 ((uint32_t)0x00400000) /*!<Bit 6 */
  3991. #define FMC_PMEM2_MEMHOLD2_7 ((uint32_t)0x00800000) /*!<Bit 7 */
  3992. #define FMC_PMEM2_MEMHIZ2 ((uint32_t)0xFF000000) /*!<MEMHIZ2[7:0] bits (Common memory 2 databus HiZ time) */
  3993. #define FMC_PMEM2_MEMHIZ2_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  3994. #define FMC_PMEM2_MEMHIZ2_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  3995. #define FMC_PMEM2_MEMHIZ2_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  3996. #define FMC_PMEM2_MEMHIZ2_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  3997. #define FMC_PMEM2_MEMHIZ2_4 ((uint32_t)0x10000000) /*!<Bit 4 */
  3998. #define FMC_PMEM2_MEMHIZ2_5 ((uint32_t)0x20000000) /*!<Bit 5 */
  3999. #define FMC_PMEM2_MEMHIZ2_6 ((uint32_t)0x40000000) /*!<Bit 6 */
  4000. #define FMC_PMEM2_MEMHIZ2_7 ((uint32_t)0x80000000) /*!<Bit 7 */
  4001. /****************** Bit definition for FMC_PMEM3 register ******************/
  4002. #define FMC_PMEM3_MEMSET3 ((uint32_t)0x000000FF) /*!<MEMSET3[7:0] bits (Common memory 3 setup time) */
  4003. #define FMC_PMEM3_MEMSET3_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4004. #define FMC_PMEM3_MEMSET3_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4005. #define FMC_PMEM3_MEMSET3_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  4006. #define FMC_PMEM3_MEMSET3_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  4007. #define FMC_PMEM3_MEMSET3_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  4008. #define FMC_PMEM3_MEMSET3_5 ((uint32_t)0x00000020) /*!<Bit 5 */
  4009. #define FMC_PMEM3_MEMSET3_6 ((uint32_t)0x00000040) /*!<Bit 6 */
  4010. #define FMC_PMEM3_MEMSET3_7 ((uint32_t)0x00000080) /*!<Bit 7 */
  4011. #define FMC_PMEM3_MEMWAIT3 ((uint32_t)0x0000FF00) /*!<MEMWAIT3[7:0] bits (Common memory 3 wait time) */
  4012. #define FMC_PMEM3_MEMWAIT3_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  4013. #define FMC_PMEM3_MEMWAIT3_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  4014. #define FMC_PMEM3_MEMWAIT3_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  4015. #define FMC_PMEM3_MEMWAIT3_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  4016. #define FMC_PMEM3_MEMWAIT3_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  4017. #define FMC_PMEM3_MEMWAIT3_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  4018. #define FMC_PMEM3_MEMWAIT3_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  4019. #define FMC_PMEM3_MEMWAIT3_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  4020. #define FMC_PMEM3_MEMHOLD3 ((uint32_t)0x00FF0000) /*!<MEMHOLD3[7:0] bits (Common memory 3 hold time) */
  4021. #define FMC_PMEM3_MEMHOLD3_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  4022. #define FMC_PMEM3_MEMHOLD3_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  4023. #define FMC_PMEM3_MEMHOLD3_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  4024. #define FMC_PMEM3_MEMHOLD3_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  4025. #define FMC_PMEM3_MEMHOLD3_4 ((uint32_t)0x00100000) /*!<Bit 4 */
  4026. #define FMC_PMEM3_MEMHOLD3_5 ((uint32_t)0x00200000) /*!<Bit 5 */
  4027. #define FMC_PMEM3_MEMHOLD3_6 ((uint32_t)0x00400000) /*!<Bit 6 */
  4028. #define FMC_PMEM3_MEMHOLD3_7 ((uint32_t)0x00800000) /*!<Bit 7 */
  4029. #define FMC_PMEM3_MEMHIZ3 ((uint32_t)0xFF000000) /*!<MEMHIZ3[7:0] bits (Common memory 3 databus HiZ time) */
  4030. #define FMC_PMEM3_MEMHIZ3_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  4031. #define FMC_PMEM3_MEMHIZ3_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  4032. #define FMC_PMEM3_MEMHIZ3_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  4033. #define FMC_PMEM3_MEMHIZ3_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  4034. #define FMC_PMEM3_MEMHIZ3_4 ((uint32_t)0x10000000) /*!<Bit 4 */
  4035. #define FMC_PMEM3_MEMHIZ3_5 ((uint32_t)0x20000000) /*!<Bit 5 */
  4036. #define FMC_PMEM3_MEMHIZ3_6 ((uint32_t)0x40000000) /*!<Bit 6 */
  4037. #define FMC_PMEM3_MEMHIZ3_7 ((uint32_t)0x80000000) /*!<Bit 7 */
  4038. /****************** Bit definition for FMC_PMEM4 register ******************/
  4039. #define FMC_PMEM4_MEMSET4 ((uint32_t)0x000000FF) /*!<MEMSET4[7:0] bits (Common memory 4 setup time) */
  4040. #define FMC_PMEM4_MEMSET4_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4041. #define FMC_PMEM4_MEMSET4_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4042. #define FMC_PMEM4_MEMSET4_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  4043. #define FMC_PMEM4_MEMSET4_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  4044. #define FMC_PMEM4_MEMSET4_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  4045. #define FMC_PMEM4_MEMSET4_5 ((uint32_t)0x00000020) /*!<Bit 5 */
  4046. #define FMC_PMEM4_MEMSET4_6 ((uint32_t)0x00000040) /*!<Bit 6 */
  4047. #define FMC_PMEM4_MEMSET4_7 ((uint32_t)0x00000080) /*!<Bit 7 */
  4048. #define FMC_PMEM4_MEMWAIT4 ((uint32_t)0x0000FF00) /*!<MEMWAIT4[7:0] bits (Common memory 4 wait time) */
  4049. #define FMC_PMEM4_MEMWAIT4_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  4050. #define FMC_PMEM4_MEMWAIT4_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  4051. #define FMC_PMEM4_MEMWAIT4_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  4052. #define FMC_PMEM4_MEMWAIT4_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  4053. #define FMC_PMEM4_MEMWAIT4_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  4054. #define FMC_PMEM4_MEMWAIT4_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  4055. #define FMC_PMEM4_MEMWAIT4_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  4056. #define FMC_PMEM4_MEMWAIT4_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  4057. #define FMC_PMEM4_MEMHOLD4 ((uint32_t)0x00FF0000) /*!<MEMHOLD4[7:0] bits (Common memory 4 hold time) */
  4058. #define FMC_PMEM4_MEMHOLD4_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  4059. #define FMC_PMEM4_MEMHOLD4_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  4060. #define FMC_PMEM4_MEMHOLD4_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  4061. #define FMC_PMEM4_MEMHOLD4_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  4062. #define FMC_PMEM4_MEMHOLD4_4 ((uint32_t)0x00100000) /*!<Bit 4 */
  4063. #define FMC_PMEM4_MEMHOLD4_5 ((uint32_t)0x00200000) /*!<Bit 5 */
  4064. #define FMC_PMEM4_MEMHOLD4_6 ((uint32_t)0x00400000) /*!<Bit 6 */
  4065. #define FMC_PMEM4_MEMHOLD4_7 ((uint32_t)0x00800000) /*!<Bit 7 */
  4066. #define FMC_PMEM4_MEMHIZ4 ((uint32_t)0xFF000000) /*!<MEMHIZ4[7:0] bits (Common memory 4 databus HiZ time) */
  4067. #define FMC_PMEM4_MEMHIZ4_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  4068. #define FMC_PMEM4_MEMHIZ4_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  4069. #define FMC_PMEM4_MEMHIZ4_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  4070. #define FMC_PMEM4_MEMHIZ4_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  4071. #define FMC_PMEM4_MEMHIZ4_4 ((uint32_t)0x10000000) /*!<Bit 4 */
  4072. #define FMC_PMEM4_MEMHIZ4_5 ((uint32_t)0x20000000) /*!<Bit 5 */
  4073. #define FMC_PMEM4_MEMHIZ4_6 ((uint32_t)0x40000000) /*!<Bit 6 */
  4074. #define FMC_PMEM4_MEMHIZ4_7 ((uint32_t)0x80000000) /*!<Bit 7 */
  4075. /****************** Bit definition for FMC_PATT2 register ******************/
  4076. #define FMC_PATT2_ATTSET2 ((uint32_t)0x000000FF) /*!<ATTSET2[7:0] bits (Attribute memory 2 setup time) */
  4077. #define FMC_PATT2_ATTSET2_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4078. #define FMC_PATT2_ATTSET2_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4079. #define FMC_PATT2_ATTSET2_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  4080. #define FMC_PATT2_ATTSET2_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  4081. #define FMC_PATT2_ATTSET2_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  4082. #define FMC_PATT2_ATTSET2_5 ((uint32_t)0x00000020) /*!<Bit 5 */
  4083. #define FMC_PATT2_ATTSET2_6 ((uint32_t)0x00000040) /*!<Bit 6 */
  4084. #define FMC_PATT2_ATTSET2_7 ((uint32_t)0x00000080) /*!<Bit 7 */
  4085. #define FMC_PATT2_ATTWAIT2 ((uint32_t)0x0000FF00) /*!<ATTWAIT2[7:0] bits (Attribute memory 2 wait time) */
  4086. #define FMC_PATT2_ATTWAIT2_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  4087. #define FMC_PATT2_ATTWAIT2_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  4088. #define FMC_PATT2_ATTWAIT2_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  4089. #define FMC_PATT2_ATTWAIT2_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  4090. #define FMC_PATT2_ATTWAIT2_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  4091. #define FMC_PATT2_ATTWAIT2_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  4092. #define FMC_PATT2_ATTWAIT2_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  4093. #define FMC_PATT2_ATTWAIT2_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  4094. #define FMC_PATT2_ATTHOLD2 ((uint32_t)0x00FF0000) /*!<ATTHOLD2[7:0] bits (Attribute memory 2 hold time) */
  4095. #define FMC_PATT2_ATTHOLD2_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  4096. #define FMC_PATT2_ATTHOLD2_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  4097. #define FMC_PATT2_ATTHOLD2_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  4098. #define FMC_PATT2_ATTHOLD2_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  4099. #define FMC_PATT2_ATTHOLD2_4 ((uint32_t)0x00100000) /*!<Bit 4 */
  4100. #define FMC_PATT2_ATTHOLD2_5 ((uint32_t)0x00200000) /*!<Bit 5 */
  4101. #define FMC_PATT2_ATTHOLD2_6 ((uint32_t)0x00400000) /*!<Bit 6 */
  4102. #define FMC_PATT2_ATTHOLD2_7 ((uint32_t)0x00800000) /*!<Bit 7 */
  4103. #define FMC_PATT2_ATTHIZ2 ((uint32_t)0xFF000000) /*!<ATTHIZ2[7:0] bits (Attribute memory 2 databus HiZ time) */
  4104. #define FMC_PATT2_ATTHIZ2_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  4105. #define FMC_PATT2_ATTHIZ2_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  4106. #define FMC_PATT2_ATTHIZ2_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  4107. #define FMC_PATT2_ATTHIZ2_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  4108. #define FMC_PATT2_ATTHIZ2_4 ((uint32_t)0x10000000) /*!<Bit 4 */
  4109. #define FMC_PATT2_ATTHIZ2_5 ((uint32_t)0x20000000) /*!<Bit 5 */
  4110. #define FMC_PATT2_ATTHIZ2_6 ((uint32_t)0x40000000) /*!<Bit 6 */
  4111. #define FMC_PATT2_ATTHIZ2_7 ((uint32_t)0x80000000) /*!<Bit 7 */
  4112. /****************** Bit definition for FMC_PATT3 register ******************/
  4113. #define FMC_PATT3_ATTSET3 ((uint32_t)0x000000FF) /*!<ATTSET3[7:0] bits (Attribute memory 3 setup time) */
  4114. #define FMC_PATT3_ATTSET3_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4115. #define FMC_PATT3_ATTSET3_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4116. #define FMC_PATT3_ATTSET3_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  4117. #define FMC_PATT3_ATTSET3_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  4118. #define FMC_PATT3_ATTSET3_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  4119. #define FMC_PATT3_ATTSET3_5 ((uint32_t)0x00000020) /*!<Bit 5 */
  4120. #define FMC_PATT3_ATTSET3_6 ((uint32_t)0x00000040) /*!<Bit 6 */
  4121. #define FMC_PATT3_ATTSET3_7 ((uint32_t)0x00000080) /*!<Bit 7 */
  4122. #define FMC_PATT3_ATTWAIT3 ((uint32_t)0x0000FF00) /*!<ATTWAIT3[7:0] bits (Attribute memory 3 wait time) */
  4123. #define FMC_PATT3_ATTWAIT3_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  4124. #define FMC_PATT3_ATTWAIT3_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  4125. #define FMC_PATT3_ATTWAIT3_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  4126. #define FMC_PATT3_ATTWAIT3_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  4127. #define FMC_PATT3_ATTWAIT3_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  4128. #define FMC_PATT3_ATTWAIT3_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  4129. #define FMC_PATT3_ATTWAIT3_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  4130. #define FMC_PATT3_ATTWAIT3_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  4131. #define FMC_PATT3_ATTHOLD3 ((uint32_t)0x00FF0000) /*!<ATTHOLD3[7:0] bits (Attribute memory 3 hold time) */
  4132. #define FMC_PATT3_ATTHOLD3_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  4133. #define FMC_PATT3_ATTHOLD3_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  4134. #define FMC_PATT3_ATTHOLD3_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  4135. #define FMC_PATT3_ATTHOLD3_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  4136. #define FMC_PATT3_ATTHOLD3_4 ((uint32_t)0x00100000) /*!<Bit 4 */
  4137. #define FMC_PATT3_ATTHOLD3_5 ((uint32_t)0x00200000) /*!<Bit 5 */
  4138. #define FMC_PATT3_ATTHOLD3_6 ((uint32_t)0x00400000) /*!<Bit 6 */
  4139. #define FMC_PATT3_ATTHOLD3_7 ((uint32_t)0x00800000) /*!<Bit 7 */
  4140. #define FMC_PATT3_ATTHIZ3 ((uint32_t)0xFF000000) /*!<ATTHIZ3[7:0] bits (Attribute memory 3 databus HiZ time) */
  4141. #define FMC_PATT3_ATTHIZ3_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  4142. #define FMC_PATT3_ATTHIZ3_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  4143. #define FMC_PATT3_ATTHIZ3_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  4144. #define FMC_PATT3_ATTHIZ3_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  4145. #define FMC_PATT3_ATTHIZ3_4 ((uint32_t)0x10000000) /*!<Bit 4 */
  4146. #define FMC_PATT3_ATTHIZ3_5 ((uint32_t)0x20000000) /*!<Bit 5 */
  4147. #define FMC_PATT3_ATTHIZ3_6 ((uint32_t)0x40000000) /*!<Bit 6 */
  4148. #define FMC_PATT3_ATTHIZ3_7 ((uint32_t)0x80000000) /*!<Bit 7 */
  4149. /****************** Bit definition for FMC_PATT4 register ******************/
  4150. #define FMC_PATT4_ATTSET4 ((uint32_t)0x000000FF) /*!<ATTSET4[7:0] bits (Attribute memory 4 setup time) */
  4151. #define FMC_PATT4_ATTSET4_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4152. #define FMC_PATT4_ATTSET4_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4153. #define FMC_PATT4_ATTSET4_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  4154. #define FMC_PATT4_ATTSET4_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  4155. #define FMC_PATT4_ATTSET4_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  4156. #define FMC_PATT4_ATTSET4_5 ((uint32_t)0x00000020) /*!<Bit 5 */
  4157. #define FMC_PATT4_ATTSET4_6 ((uint32_t)0x00000040) /*!<Bit 6 */
  4158. #define FMC_PATT4_ATTSET4_7 ((uint32_t)0x00000080) /*!<Bit 7 */
  4159. #define FMC_PATT4_ATTWAIT4 ((uint32_t)0x0000FF00) /*!<ATTWAIT4[7:0] bits (Attribute memory 4 wait time) */
  4160. #define FMC_PATT4_ATTWAIT4_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  4161. #define FMC_PATT4_ATTWAIT4_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  4162. #define FMC_PATT4_ATTWAIT4_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  4163. #define FMC_PATT4_ATTWAIT4_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  4164. #define FMC_PATT4_ATTWAIT4_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  4165. #define FMC_PATT4_ATTWAIT4_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  4166. #define FMC_PATT4_ATTWAIT4_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  4167. #define FMC_PATT4_ATTWAIT4_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  4168. #define FMC_PATT4_ATTHOLD4 ((uint32_t)0x00FF0000) /*!<ATTHOLD4[7:0] bits (Attribute memory 4 hold time) */
  4169. #define FMC_PATT4_ATTHOLD4_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  4170. #define FMC_PATT4_ATTHOLD4_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  4171. #define FMC_PATT4_ATTHOLD4_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  4172. #define FMC_PATT4_ATTHOLD4_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  4173. #define FMC_PATT4_ATTHOLD4_4 ((uint32_t)0x00100000) /*!<Bit 4 */
  4174. #define FMC_PATT4_ATTHOLD4_5 ((uint32_t)0x00200000) /*!<Bit 5 */
  4175. #define FMC_PATT4_ATTHOLD4_6 ((uint32_t)0x00400000) /*!<Bit 6 */
  4176. #define FMC_PATT4_ATTHOLD4_7 ((uint32_t)0x00800000) /*!<Bit 7 */
  4177. #define FMC_PATT4_ATTHIZ4 ((uint32_t)0xFF000000) /*!<ATTHIZ4[7:0] bits (Attribute memory 4 databus HiZ time) */
  4178. #define FMC_PATT4_ATTHIZ4_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  4179. #define FMC_PATT4_ATTHIZ4_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  4180. #define FMC_PATT4_ATTHIZ4_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  4181. #define FMC_PATT4_ATTHIZ4_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  4182. #define FMC_PATT4_ATTHIZ4_4 ((uint32_t)0x10000000) /*!<Bit 4 */
  4183. #define FMC_PATT4_ATTHIZ4_5 ((uint32_t)0x20000000) /*!<Bit 5 */
  4184. #define FMC_PATT4_ATTHIZ4_6 ((uint32_t)0x40000000) /*!<Bit 6 */
  4185. #define FMC_PATT4_ATTHIZ4_7 ((uint32_t)0x80000000) /*!<Bit 7 */
  4186. /****************** Bit definition for FMC_PIO4 register *******************/
  4187. #define FMC_PIO4_IOSET4 ((uint32_t)0x000000FF) /*!<IOSET4[7:0] bits (I/O 4 setup time) */
  4188. #define FMC_PIO4_IOSET4_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4189. #define FMC_PIO4_IOSET4_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4190. #define FMC_PIO4_IOSET4_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  4191. #define FMC_PIO4_IOSET4_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  4192. #define FMC_PIO4_IOSET4_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  4193. #define FMC_PIO4_IOSET4_5 ((uint32_t)0x00000020) /*!<Bit 5 */
  4194. #define FMC_PIO4_IOSET4_6 ((uint32_t)0x00000040) /*!<Bit 6 */
  4195. #define FMC_PIO4_IOSET4_7 ((uint32_t)0x00000080) /*!<Bit 7 */
  4196. #define FMC_PIO4_IOWAIT4 ((uint32_t)0x0000FF00) /*!<IOWAIT4[7:0] bits (I/O 4 wait time) */
  4197. #define FMC_PIO4_IOWAIT4_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  4198. #define FMC_PIO4_IOWAIT4_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  4199. #define FMC_PIO4_IOWAIT4_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  4200. #define FMC_PIO4_IOWAIT4_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  4201. #define FMC_PIO4_IOWAIT4_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  4202. #define FMC_PIO4_IOWAIT4_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  4203. #define FMC_PIO4_IOWAIT4_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  4204. #define FMC_PIO4_IOWAIT4_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  4205. #define FMC_PIO4_IOHOLD4 ((uint32_t)0x00FF0000) /*!<IOHOLD4[7:0] bits (I/O 4 hold time) */
  4206. #define FMC_PIO4_IOHOLD4_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  4207. #define FMC_PIO4_IOHOLD4_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  4208. #define FMC_PIO4_IOHOLD4_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  4209. #define FMC_PIO4_IOHOLD4_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  4210. #define FMC_PIO4_IOHOLD4_4 ((uint32_t)0x00100000) /*!<Bit 4 */
  4211. #define FMC_PIO4_IOHOLD4_5 ((uint32_t)0x00200000) /*!<Bit 5 */
  4212. #define FMC_PIO4_IOHOLD4_6 ((uint32_t)0x00400000) /*!<Bit 6 */
  4213. #define FMC_PIO4_IOHOLD4_7 ((uint32_t)0x00800000) /*!<Bit 7 */
  4214. #define FMC_PIO4_IOHIZ4 ((uint32_t)0xFF000000) /*!<IOHIZ4[7:0] bits (I/O 4 databus HiZ time) */
  4215. #define FMC_PIO4_IOHIZ4_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  4216. #define FMC_PIO4_IOHIZ4_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  4217. #define FMC_PIO4_IOHIZ4_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  4218. #define FMC_PIO4_IOHIZ4_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  4219. #define FMC_PIO4_IOHIZ4_4 ((uint32_t)0x10000000) /*!<Bit 4 */
  4220. #define FMC_PIO4_IOHIZ4_5 ((uint32_t)0x20000000) /*!<Bit 5 */
  4221. #define FMC_PIO4_IOHIZ4_6 ((uint32_t)0x40000000) /*!<Bit 6 */
  4222. #define FMC_PIO4_IOHIZ4_7 ((uint32_t)0x80000000) /*!<Bit 7 */
  4223. /****************** Bit definition for FMC_ECCR2 register ******************/
  4224. #define FMC_ECCR2_ECC2 ((uint32_t)0xFFFFFFFF) /*!<ECC result */
  4225. /****************** Bit definition for FMC_ECCR3 register ******************/
  4226. #define FMC_ECCR3_ECC3 ((uint32_t)0xFFFFFFFF) /*!<ECC result */
  4227. /****************** Bit definition for FMC_SDCR1 register ******************/
  4228. #define FMC_SDCR1_NC ((uint32_t)0x00000003) /*!<NC[1:0] bits (Number of column bits) */
  4229. #define FMC_SDCR1_NC_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4230. #define FMC_SDCR1_NC_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4231. #define FMC_SDCR1_NR ((uint32_t)0x0000000C) /*!<NR[1:0] bits (Number of row bits) */
  4232. #define FMC_SDCR1_NR_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  4233. #define FMC_SDCR1_NR_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  4234. #define FMC_SDCR1_MWID ((uint32_t)0x00000030) /*!<NR[1:0] bits (Number of row bits) */
  4235. #define FMC_SDCR1_MWID_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4236. #define FMC_SDCR1_MWID_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4237. #define FMC_SDCR1_NB ((uint32_t)0x00000040) /*!<Number of internal bank */
  4238. #define FMC_SDCR1_CAS ((uint32_t)0x00000180) /*!<CAS[1:0] bits (CAS latency) */
  4239. #define FMC_SDCR1_CAS_0 ((uint32_t)0x00000080) /*!<Bit 0 */
  4240. #define FMC_SDCR1_CAS_1 ((uint32_t)0x00000100) /*!<Bit 1 */
  4241. #define FMC_SDCR1_WP ((uint32_t)0x00000200) /*!<Write protection */
  4242. #define FMC_SDCR1_SDCLK ((uint32_t)0x00000C00) /*!<SDRAM clock configuration */
  4243. #define FMC_SDCR1_SDCLK_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  4244. #define FMC_SDCR1_SDCLK_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  4245. #define FMC_SDCR1_RBURST ((uint32_t)0x00001000) /*!<Read burst */
  4246. #define FMC_SDCR1_RPIPE ((uint32_t)0x00006000) /*!<Write protection */
  4247. #define FMC_SDCR1_RPIPE_0 ((uint32_t)0x00002000) /*!<Bit 0 */
  4248. #define FMC_SDCR1_RPIPE_1 ((uint32_t)0x00004000) /*!<Bit 1 */
  4249. /****************** Bit definition for FMC_SDCR2 register ******************/
  4250. #define FMC_SDCR2_NC ((uint32_t)0x00000003) /*!<NC[1:0] bits (Number of column bits) */
  4251. #define FMC_SDCR2_NC_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4252. #define FMC_SDCR2_NC_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4253. #define FMC_SDCR2_NR ((uint32_t)0x0000000C) /*!<NR[1:0] bits (Number of row bits) */
  4254. #define FMC_SDCR2_NR_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  4255. #define FMC_SDCR2_NR_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  4256. #define FMC_SDCR2_MWID ((uint32_t)0x00000030) /*!<NR[1:0] bits (Number of row bits) */
  4257. #define FMC_SDCR2_MWID_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4258. #define FMC_SDCR2_MWID_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4259. #define FMC_SDCR2_NB ((uint32_t)0x00000040) /*!<Number of internal bank */
  4260. #define FMC_SDCR2_CAS ((uint32_t)0x00000180) /*!<CAS[1:0] bits (CAS latency) */
  4261. #define FMC_SDCR2_CAS_0 ((uint32_t)0x00000080) /*!<Bit 0 */
  4262. #define FMC_SDCR2_CAS_1 ((uint32_t)0x00000100) /*!<Bit 1 */
  4263. #define FMC_SDCR2_WP ((uint32_t)0x00000200) /*!<Write protection */
  4264. #define FMC_SDCR2_SDCLK ((uint32_t)0x00000C00) /*!<SDCLK[1:0] (SDRAM clock configuration) */
  4265. #define FMC_SDCR2_SDCLK_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  4266. #define FMC_SDCR2_SDCLK_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  4267. #define FMC_SDCR2_RBURST ((uint32_t)0x00001000) /*!<Read burst */
  4268. #define FMC_SDCR2_RPIPE ((uint32_t)0x00006000) /*!<RPIPE[1:0](Read pipe) */
  4269. #define FMC_SDCR2_RPIPE_0 ((uint32_t)0x00002000) /*!<Bit 0 */
  4270. #define FMC_SDCR2_RPIPE_1 ((uint32_t)0x00004000) /*!<Bit 1 */
  4271. /****************** Bit definition for FMC_SDTR1 register ******************/
  4272. #define FMC_SDTR1_TMRD ((uint32_t)0x0000000F) /*!<TMRD[3:0] bits (Load mode register to active) */
  4273. #define FMC_SDTR1_TMRD_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4274. #define FMC_SDTR1_TMRD_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4275. #define FMC_SDTR1_TMRD_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  4276. #define FMC_SDTR1_TMRD_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  4277. #define FMC_SDTR1_TXSR ((uint32_t)0x000000F0) /*!<TXSR[3:0] bits (Exit self refresh) */
  4278. #define FMC_SDTR1_TXSR_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4279. #define FMC_SDTR1_TXSR_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4280. #define FMC_SDTR1_TXSR_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  4281. #define FMC_SDTR1_TXSR_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  4282. #define FMC_SDTR1_TRAS ((uint32_t)0x00000F00) /*!<TRAS[3:0] bits (Self refresh time) */
  4283. #define FMC_SDTR1_TRAS_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  4284. #define FMC_SDTR1_TRAS_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  4285. #define FMC_SDTR1_TRAS_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  4286. #define FMC_SDTR1_TRAS_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  4287. #define FMC_SDTR1_TRC ((uint32_t)0x0000F000) /*!<TRC[2:0] bits (Row cycle delay) */
  4288. #define FMC_SDTR1_TRC_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  4289. #define FMC_SDTR1_TRC_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  4290. #define FMC_SDTR1_TRC_2 ((uint32_t)0x00004000) /*!<Bit 2 */
  4291. #define FMC_SDTR1_TWR ((uint32_t)0x000F0000) /*!<TRC[2:0] bits (Write recovery delay) */
  4292. #define FMC_SDTR1_TWR_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  4293. #define FMC_SDTR1_TWR_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  4294. #define FMC_SDTR1_TWR_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  4295. #define FMC_SDTR1_TRP ((uint32_t)0x00F00000) /*!<TRP[2:0] bits (Row precharge delay) */
  4296. #define FMC_SDTR1_TRP_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  4297. #define FMC_SDTR1_TRP_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  4298. #define FMC_SDTR1_TRP_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  4299. #define FMC_SDTR1_TRCD ((uint32_t)0x0F000000) /*!<TRP[2:0] bits (Row to column delay) */
  4300. #define FMC_SDTR1_TRCD_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  4301. #define FMC_SDTR1_TRCD_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  4302. #define FMC_SDTR1_TRCD_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  4303. /****************** Bit definition for FMC_SDTR2 register ******************/
  4304. #define FMC_SDTR2_TMRD ((uint32_t)0x0000000F) /*!<TMRD[3:0] bits (Load mode register to active) */
  4305. #define FMC_SDTR2_TMRD_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4306. #define FMC_SDTR2_TMRD_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4307. #define FMC_SDTR2_TMRD_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  4308. #define FMC_SDTR2_TMRD_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  4309. #define FMC_SDTR2_TXSR ((uint32_t)0x000000F0) /*!<TXSR[3:0] bits (Exit self refresh) */
  4310. #define FMC_SDTR2_TXSR_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  4311. #define FMC_SDTR2_TXSR_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  4312. #define FMC_SDTR2_TXSR_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  4313. #define FMC_SDTR2_TXSR_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  4314. #define FMC_SDTR2_TRAS ((uint32_t)0x00000F00) /*!<TRAS[3:0] bits (Self refresh time) */
  4315. #define FMC_SDTR2_TRAS_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  4316. #define FMC_SDTR2_TRAS_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  4317. #define FMC_SDTR2_TRAS_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  4318. #define FMC_SDTR2_TRAS_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  4319. #define FMC_SDTR2_TRC ((uint32_t)0x0000F000) /*!<TRC[2:0] bits (Row cycle delay) */
  4320. #define FMC_SDTR2_TRC_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  4321. #define FMC_SDTR2_TRC_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  4322. #define FMC_SDTR2_TRC_2 ((uint32_t)0x00004000) /*!<Bit 2 */
  4323. #define FMC_SDTR2_TWR ((uint32_t)0x000F0000) /*!<TRC[2:0] bits (Write recovery delay) */
  4324. #define FMC_SDTR2_TWR_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  4325. #define FMC_SDTR2_TWR_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  4326. #define FMC_SDTR2_TWR_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  4327. #define FMC_SDTR2_TRP ((uint32_t)0x00F00000) /*!<TRP[2:0] bits (Row precharge delay) */
  4328. #define FMC_SDTR2_TRP_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  4329. #define FMC_SDTR2_TRP_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  4330. #define FMC_SDTR2_TRP_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  4331. #define FMC_SDTR2_TRCD ((uint32_t)0x0F000000) /*!<TRP[2:0] bits (Row to column delay) */
  4332. #define FMC_SDTR2_TRCD_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  4333. #define FMC_SDTR2_TRCD_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  4334. #define FMC_SDTR2_TRCD_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  4335. /****************** Bit definition for FMC_SDCMR register ******************/
  4336. #define FMC_SDCMR_MODE ((uint32_t)0x00000007) /*!<MODE[2:0] bits (Command mode) */
  4337. #define FMC_SDCMR_MODE_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4338. #define FMC_SDCMR_MODE_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4339. #define FMC_SDCMR_MODE_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  4340. #define FMC_SDCMR_CTB2 ((uint32_t)0x00000008) /*!<Command target 2 */
  4341. #define FMC_SDCMR_CTB1 ((uint32_t)0x00000010) /*!<Command target 1 */
  4342. #define FMC_SDCMR_NRFS ((uint32_t)0x000001E0) /*!<NRFS[3:0] bits (Number of auto-refresh) */
  4343. #define FMC_SDCMR_NRFS_0 ((uint32_t)0x00000020) /*!<Bit 0 */
  4344. #define FMC_SDCMR_NRFS_1 ((uint32_t)0x00000040) /*!<Bit 1 */
  4345. #define FMC_SDCMR_NRFS_2 ((uint32_t)0x00000080) /*!<Bit 2 */
  4346. #define FMC_SDCMR_NRFS_3 ((uint32_t)0x00000100) /*!<Bit 3 */
  4347. #define FMC_SDCMR_MRD ((uint32_t)0x003FFE00) /*!<MRD[12:0] bits (Mode register definition) */
  4348. /****************** Bit definition for FMC_SDRTR register ******************/
  4349. #define FMC_SDRTR_CRE ((uint32_t)0x00000001) /*!<Clear refresh error flag */
  4350. #define FMC_SDRTR_COUNT ((uint32_t)0x00003FFE) /*!<COUNT[12:0] bits (Refresh timer count) */
  4351. #define FMC_SDRTR_REIE ((uint32_t)0x00004000) /*!<RES interupt enable */
  4352. /****************** Bit definition for FMC_SDSR register ******************/
  4353. #define FMC_SDSR_RE ((uint32_t)0x00000001) /*!<Refresh error flag */
  4354. #define FMC_SDSR_MODES1 ((uint32_t)0x00000006) /*!<MODES1[1:0]bits (Status mode for bank 1) */
  4355. #define FMC_SDSR_MODES1_0 ((uint32_t)0x00000002) /*!<Bit 0 */
  4356. #define FMC_SDSR_MODES1_1 ((uint32_t)0x00000004) /*!<Bit 1 */
  4357. #define FMC_SDSR_MODES2 ((uint32_t)0x00000018) /*!<MODES2[1:0]bits (Status mode for bank 2) */
  4358. #define FMC_SDSR_MODES2_0 ((uint32_t)0x00000008) /*!<Bit 0 */
  4359. #define FMC_SDSR_MODES2_1 ((uint32_t)0x00000010) /*!<Bit 1 */
  4360. #define FMC_SDSR_BUSY ((uint32_t)0x00000020) /*!<Busy status */
  4361. /******************************************************************************/
  4362. /* */
  4363. /* General Purpose I/O */
  4364. /* */
  4365. /******************************************************************************/
  4366. /****************** Bits definition for GPIO_MODER register *****************/
  4367. #define GPIO_MODER_MODER0 ((uint32_t)0x00000003)
  4368. #define GPIO_MODER_MODER0_0 ((uint32_t)0x00000001)
  4369. #define GPIO_MODER_MODER0_1 ((uint32_t)0x00000002)
  4370. #define GPIO_MODER_MODER1 ((uint32_t)0x0000000C)
  4371. #define GPIO_MODER_MODER1_0 ((uint32_t)0x00000004)
  4372. #define GPIO_MODER_MODER1_1 ((uint32_t)0x00000008)
  4373. #define GPIO_MODER_MODER2 ((uint32_t)0x00000030)
  4374. #define GPIO_MODER_MODER2_0 ((uint32_t)0x00000010)
  4375. #define GPIO_MODER_MODER2_1 ((uint32_t)0x00000020)
  4376. #define GPIO_MODER_MODER3 ((uint32_t)0x000000C0)
  4377. #define GPIO_MODER_MODER3_0 ((uint32_t)0x00000040)
  4378. #define GPIO_MODER_MODER3_1 ((uint32_t)0x00000080)
  4379. #define GPIO_MODER_MODER4 ((uint32_t)0x00000300)
  4380. #define GPIO_MODER_MODER4_0 ((uint32_t)0x00000100)
  4381. #define GPIO_MODER_MODER4_1 ((uint32_t)0x00000200)
  4382. #define GPIO_MODER_MODER5 ((uint32_t)0x00000C00)
  4383. #define GPIO_MODER_MODER5_0 ((uint32_t)0x00000400)
  4384. #define GPIO_MODER_MODER5_1 ((uint32_t)0x00000800)
  4385. #define GPIO_MODER_MODER6 ((uint32_t)0x00003000)
  4386. #define GPIO_MODER_MODER6_0 ((uint32_t)0x00001000)
  4387. #define GPIO_MODER_MODER6_1 ((uint32_t)0x00002000)
  4388. #define GPIO_MODER_MODER7 ((uint32_t)0x0000C000)
  4389. #define GPIO_MODER_MODER7_0 ((uint32_t)0x00004000)
  4390. #define GPIO_MODER_MODER7_1 ((uint32_t)0x00008000)
  4391. #define GPIO_MODER_MODER8 ((uint32_t)0x00030000)
  4392. #define GPIO_MODER_MODER8_0 ((uint32_t)0x00010000)
  4393. #define GPIO_MODER_MODER8_1 ((uint32_t)0x00020000)
  4394. #define GPIO_MODER_MODER9 ((uint32_t)0x000C0000)
  4395. #define GPIO_MODER_MODER9_0 ((uint32_t)0x00040000)
  4396. #define GPIO_MODER_MODER9_1 ((uint32_t)0x00080000)
  4397. #define GPIO_MODER_MODER10 ((uint32_t)0x00300000)
  4398. #define GPIO_MODER_MODER10_0 ((uint32_t)0x00100000)
  4399. #define GPIO_MODER_MODER10_1 ((uint32_t)0x00200000)
  4400. #define GPIO_MODER_MODER11 ((uint32_t)0x00C00000)
  4401. #define GPIO_MODER_MODER11_0 ((uint32_t)0x00400000)
  4402. #define GPIO_MODER_MODER11_1 ((uint32_t)0x00800000)
  4403. #define GPIO_MODER_MODER12 ((uint32_t)0x03000000)
  4404. #define GPIO_MODER_MODER12_0 ((uint32_t)0x01000000)
  4405. #define GPIO_MODER_MODER12_1 ((uint32_t)0x02000000)
  4406. #define GPIO_MODER_MODER13 ((uint32_t)0x0C000000)
  4407. #define GPIO_MODER_MODER13_0 ((uint32_t)0x04000000)
  4408. #define GPIO_MODER_MODER13_1 ((uint32_t)0x08000000)
  4409. #define GPIO_MODER_MODER14 ((uint32_t)0x30000000)
  4410. #define GPIO_MODER_MODER14_0 ((uint32_t)0x10000000)
  4411. #define GPIO_MODER_MODER14_1 ((uint32_t)0x20000000)
  4412. #define GPIO_MODER_MODER15 ((uint32_t)0xC0000000)
  4413. #define GPIO_MODER_MODER15_0 ((uint32_t)0x40000000)
  4414. #define GPIO_MODER_MODER15_1 ((uint32_t)0x80000000)
  4415. /****************** Bits definition for GPIO_OTYPER register ****************/
  4416. #define GPIO_OTYPER_OT_0 ((uint32_t)0x00000001)
  4417. #define GPIO_OTYPER_OT_1 ((uint32_t)0x00000002)
  4418. #define GPIO_OTYPER_OT_2 ((uint32_t)0x00000004)
  4419. #define GPIO_OTYPER_OT_3 ((uint32_t)0x00000008)
  4420. #define GPIO_OTYPER_OT_4 ((uint32_t)0x00000010)
  4421. #define GPIO_OTYPER_OT_5 ((uint32_t)0x00000020)
  4422. #define GPIO_OTYPER_OT_6 ((uint32_t)0x00000040)
  4423. #define GPIO_OTYPER_OT_7 ((uint32_t)0x00000080)
  4424. #define GPIO_OTYPER_OT_8 ((uint32_t)0x00000100)
  4425. #define GPIO_OTYPER_OT_9 ((uint32_t)0x00000200)
  4426. #define GPIO_OTYPER_OT_10 ((uint32_t)0x00000400)
  4427. #define GPIO_OTYPER_OT_11 ((uint32_t)0x00000800)
  4428. #define GPIO_OTYPER_OT_12 ((uint32_t)0x00001000)
  4429. #define GPIO_OTYPER_OT_13 ((uint32_t)0x00002000)
  4430. #define GPIO_OTYPER_OT_14 ((uint32_t)0x00004000)
  4431. #define GPIO_OTYPER_OT_15 ((uint32_t)0x00008000)
  4432. /****************** Bits definition for GPIO_OSPEEDR register ***************/
  4433. #define GPIO_OSPEEDER_OSPEEDR0 ((uint32_t)0x00000003)
  4434. #define GPIO_OSPEEDER_OSPEEDR0_0 ((uint32_t)0x00000001)
  4435. #define GPIO_OSPEEDER_OSPEEDR0_1 ((uint32_t)0x00000002)
  4436. #define GPIO_OSPEEDER_OSPEEDR1 ((uint32_t)0x0000000C)
  4437. #define GPIO_OSPEEDER_OSPEEDR1_0 ((uint32_t)0x00000004)
  4438. #define GPIO_OSPEEDER_OSPEEDR1_1 ((uint32_t)0x00000008)
  4439. #define GPIO_OSPEEDER_OSPEEDR2 ((uint32_t)0x00000030)
  4440. #define GPIO_OSPEEDER_OSPEEDR2_0 ((uint32_t)0x00000010)
  4441. #define GPIO_OSPEEDER_OSPEEDR2_1 ((uint32_t)0x00000020)
  4442. #define GPIO_OSPEEDER_OSPEEDR3 ((uint32_t)0x000000C0)
  4443. #define GPIO_OSPEEDER_OSPEEDR3_0 ((uint32_t)0x00000040)
  4444. #define GPIO_OSPEEDER_OSPEEDR3_1 ((uint32_t)0x00000080)
  4445. #define GPIO_OSPEEDER_OSPEEDR4 ((uint32_t)0x00000300)
  4446. #define GPIO_OSPEEDER_OSPEEDR4_0 ((uint32_t)0x00000100)
  4447. #define GPIO_OSPEEDER_OSPEEDR4_1 ((uint32_t)0x00000200)
  4448. #define GPIO_OSPEEDER_OSPEEDR5 ((uint32_t)0x00000C00)
  4449. #define GPIO_OSPEEDER_OSPEEDR5_0 ((uint32_t)0x00000400)
  4450. #define GPIO_OSPEEDER_OSPEEDR5_1 ((uint32_t)0x00000800)
  4451. #define GPIO_OSPEEDER_OSPEEDR6 ((uint32_t)0x00003000)
  4452. #define GPIO_OSPEEDER_OSPEEDR6_0 ((uint32_t)0x00001000)
  4453. #define GPIO_OSPEEDER_OSPEEDR6_1 ((uint32_t)0x00002000)
  4454. #define GPIO_OSPEEDER_OSPEEDR7 ((uint32_t)0x0000C000)
  4455. #define GPIO_OSPEEDER_OSPEEDR7_0 ((uint32_t)0x00004000)
  4456. #define GPIO_OSPEEDER_OSPEEDR7_1 ((uint32_t)0x00008000)
  4457. #define GPIO_OSPEEDER_OSPEEDR8 ((uint32_t)0x00030000)
  4458. #define GPIO_OSPEEDER_OSPEEDR8_0 ((uint32_t)0x00010000)
  4459. #define GPIO_OSPEEDER_OSPEEDR8_1 ((uint32_t)0x00020000)
  4460. #define GPIO_OSPEEDER_OSPEEDR9 ((uint32_t)0x000C0000)
  4461. #define GPIO_OSPEEDER_OSPEEDR9_0 ((uint32_t)0x00040000)
  4462. #define GPIO_OSPEEDER_OSPEEDR9_1 ((uint32_t)0x00080000)
  4463. #define GPIO_OSPEEDER_OSPEEDR10 ((uint32_t)0x00300000)
  4464. #define GPIO_OSPEEDER_OSPEEDR10_0 ((uint32_t)0x00100000)
  4465. #define GPIO_OSPEEDER_OSPEEDR10_1 ((uint32_t)0x00200000)
  4466. #define GPIO_OSPEEDER_OSPEEDR11 ((uint32_t)0x00C00000)
  4467. #define GPIO_OSPEEDER_OSPEEDR11_0 ((uint32_t)0x00400000)
  4468. #define GPIO_OSPEEDER_OSPEEDR11_1 ((uint32_t)0x00800000)
  4469. #define GPIO_OSPEEDER_OSPEEDR12 ((uint32_t)0x03000000)
  4470. #define GPIO_OSPEEDER_OSPEEDR12_0 ((uint32_t)0x01000000)
  4471. #define GPIO_OSPEEDER_OSPEEDR12_1 ((uint32_t)0x02000000)
  4472. #define GPIO_OSPEEDER_OSPEEDR13 ((uint32_t)0x0C000000)
  4473. #define GPIO_OSPEEDER_OSPEEDR13_0 ((uint32_t)0x04000000)
  4474. #define GPIO_OSPEEDER_OSPEEDR13_1 ((uint32_t)0x08000000)
  4475. #define GPIO_OSPEEDER_OSPEEDR14 ((uint32_t)0x30000000)
  4476. #define GPIO_OSPEEDER_OSPEEDR14_0 ((uint32_t)0x10000000)
  4477. #define GPIO_OSPEEDER_OSPEEDR14_1 ((uint32_t)0x20000000)
  4478. #define GPIO_OSPEEDER_OSPEEDR15 ((uint32_t)0xC0000000)
  4479. #define GPIO_OSPEEDER_OSPEEDR15_0 ((uint32_t)0x40000000)
  4480. #define GPIO_OSPEEDER_OSPEEDR15_1 ((uint32_t)0x80000000)
  4481. /****************** Bits definition for GPIO_PUPDR register *****************/
  4482. #define GPIO_PUPDR_PUPDR0 ((uint32_t)0x00000003)
  4483. #define GPIO_PUPDR_PUPDR0_0 ((uint32_t)0x00000001)
  4484. #define GPIO_PUPDR_PUPDR0_1 ((uint32_t)0x00000002)
  4485. #define GPIO_PUPDR_PUPDR1 ((uint32_t)0x0000000C)
  4486. #define GPIO_PUPDR_PUPDR1_0 ((uint32_t)0x00000004)
  4487. #define GPIO_PUPDR_PUPDR1_1 ((uint32_t)0x00000008)
  4488. #define GPIO_PUPDR_PUPDR2 ((uint32_t)0x00000030)
  4489. #define GPIO_PUPDR_PUPDR2_0 ((uint32_t)0x00000010)
  4490. #define GPIO_PUPDR_PUPDR2_1 ((uint32_t)0x00000020)
  4491. #define GPIO_PUPDR_PUPDR3 ((uint32_t)0x000000C0)
  4492. #define GPIO_PUPDR_PUPDR3_0 ((uint32_t)0x00000040)
  4493. #define GPIO_PUPDR_PUPDR3_1 ((uint32_t)0x00000080)
  4494. #define GPIO_PUPDR_PUPDR4 ((uint32_t)0x00000300)
  4495. #define GPIO_PUPDR_PUPDR4_0 ((uint32_t)0x00000100)
  4496. #define GPIO_PUPDR_PUPDR4_1 ((uint32_t)0x00000200)
  4497. #define GPIO_PUPDR_PUPDR5 ((uint32_t)0x00000C00)
  4498. #define GPIO_PUPDR_PUPDR5_0 ((uint32_t)0x00000400)
  4499. #define GPIO_PUPDR_PUPDR5_1 ((uint32_t)0x00000800)
  4500. #define GPIO_PUPDR_PUPDR6 ((uint32_t)0x00003000)
  4501. #define GPIO_PUPDR_PUPDR6_0 ((uint32_t)0x00001000)
  4502. #define GPIO_PUPDR_PUPDR6_1 ((uint32_t)0x00002000)
  4503. #define GPIO_PUPDR_PUPDR7 ((uint32_t)0x0000C000)
  4504. #define GPIO_PUPDR_PUPDR7_0 ((uint32_t)0x00004000)
  4505. #define GPIO_PUPDR_PUPDR7_1 ((uint32_t)0x00008000)
  4506. #define GPIO_PUPDR_PUPDR8 ((uint32_t)0x00030000)
  4507. #define GPIO_PUPDR_PUPDR8_0 ((uint32_t)0x00010000)
  4508. #define GPIO_PUPDR_PUPDR8_1 ((uint32_t)0x00020000)
  4509. #define GPIO_PUPDR_PUPDR9 ((uint32_t)0x000C0000)
  4510. #define GPIO_PUPDR_PUPDR9_0 ((uint32_t)0x00040000)
  4511. #define GPIO_PUPDR_PUPDR9_1 ((uint32_t)0x00080000)
  4512. #define GPIO_PUPDR_PUPDR10 ((uint32_t)0x00300000)
  4513. #define GPIO_PUPDR_PUPDR10_0 ((uint32_t)0x00100000)
  4514. #define GPIO_PUPDR_PUPDR10_1 ((uint32_t)0x00200000)
  4515. #define GPIO_PUPDR_PUPDR11 ((uint32_t)0x00C00000)
  4516. #define GPIO_PUPDR_PUPDR11_0 ((uint32_t)0x00400000)
  4517. #define GPIO_PUPDR_PUPDR11_1 ((uint32_t)0x00800000)
  4518. #define GPIO_PUPDR_PUPDR12 ((uint32_t)0x03000000)
  4519. #define GPIO_PUPDR_PUPDR12_0 ((uint32_t)0x01000000)
  4520. #define GPIO_PUPDR_PUPDR12_1 ((uint32_t)0x02000000)
  4521. #define GPIO_PUPDR_PUPDR13 ((uint32_t)0x0C000000)
  4522. #define GPIO_PUPDR_PUPDR13_0 ((uint32_t)0x04000000)
  4523. #define GPIO_PUPDR_PUPDR13_1 ((uint32_t)0x08000000)
  4524. #define GPIO_PUPDR_PUPDR14 ((uint32_t)0x30000000)
  4525. #define GPIO_PUPDR_PUPDR14_0 ((uint32_t)0x10000000)
  4526. #define GPIO_PUPDR_PUPDR14_1 ((uint32_t)0x20000000)
  4527. #define GPIO_PUPDR_PUPDR15 ((uint32_t)0xC0000000)
  4528. #define GPIO_PUPDR_PUPDR15_0 ((uint32_t)0x40000000)
  4529. #define GPIO_PUPDR_PUPDR15_1 ((uint32_t)0x80000000)
  4530. /****************** Bits definition for GPIO_IDR register *******************/
  4531. #define GPIO_IDR_IDR_0 ((uint32_t)0x00000001)
  4532. #define GPIO_IDR_IDR_1 ((uint32_t)0x00000002)
  4533. #define GPIO_IDR_IDR_2 ((uint32_t)0x00000004)
  4534. #define GPIO_IDR_IDR_3 ((uint32_t)0x00000008)
  4535. #define GPIO_IDR_IDR_4 ((uint32_t)0x00000010)
  4536. #define GPIO_IDR_IDR_5 ((uint32_t)0x00000020)
  4537. #define GPIO_IDR_IDR_6 ((uint32_t)0x00000040)
  4538. #define GPIO_IDR_IDR_7 ((uint32_t)0x00000080)
  4539. #define GPIO_IDR_IDR_8 ((uint32_t)0x00000100)
  4540. #define GPIO_IDR_IDR_9 ((uint32_t)0x00000200)
  4541. #define GPIO_IDR_IDR_10 ((uint32_t)0x00000400)
  4542. #define GPIO_IDR_IDR_11 ((uint32_t)0x00000800)
  4543. #define GPIO_IDR_IDR_12 ((uint32_t)0x00001000)
  4544. #define GPIO_IDR_IDR_13 ((uint32_t)0x00002000)
  4545. #define GPIO_IDR_IDR_14 ((uint32_t)0x00004000)
  4546. #define GPIO_IDR_IDR_15 ((uint32_t)0x00008000)
  4547. /* Old GPIO_IDR register bits definition, maintained for legacy purpose */
  4548. #define GPIO_OTYPER_IDR_0 GPIO_IDR_IDR_0
  4549. #define GPIO_OTYPER_IDR_1 GPIO_IDR_IDR_1
  4550. #define GPIO_OTYPER_IDR_2 GPIO_IDR_IDR_2
  4551. #define GPIO_OTYPER_IDR_3 GPIO_IDR_IDR_3
  4552. #define GPIO_OTYPER_IDR_4 GPIO_IDR_IDR_4
  4553. #define GPIO_OTYPER_IDR_5 GPIO_IDR_IDR_5
  4554. #define GPIO_OTYPER_IDR_6 GPIO_IDR_IDR_6
  4555. #define GPIO_OTYPER_IDR_7 GPIO_IDR_IDR_7
  4556. #define GPIO_OTYPER_IDR_8 GPIO_IDR_IDR_8
  4557. #define GPIO_OTYPER_IDR_9 GPIO_IDR_IDR_9
  4558. #define GPIO_OTYPER_IDR_10 GPIO_IDR_IDR_10
  4559. #define GPIO_OTYPER_IDR_11 GPIO_IDR_IDR_11
  4560. #define GPIO_OTYPER_IDR_12 GPIO_IDR_IDR_12
  4561. #define GPIO_OTYPER_IDR_13 GPIO_IDR_IDR_13
  4562. #define GPIO_OTYPER_IDR_14 GPIO_IDR_IDR_14
  4563. #define GPIO_OTYPER_IDR_15 GPIO_IDR_IDR_15
  4564. /****************** Bits definition for GPIO_ODR register *******************/
  4565. #define GPIO_ODR_ODR_0 ((uint32_t)0x00000001)
  4566. #define GPIO_ODR_ODR_1 ((uint32_t)0x00000002)
  4567. #define GPIO_ODR_ODR_2 ((uint32_t)0x00000004)
  4568. #define GPIO_ODR_ODR_3 ((uint32_t)0x00000008)
  4569. #define GPIO_ODR_ODR_4 ((uint32_t)0x00000010)
  4570. #define GPIO_ODR_ODR_5 ((uint32_t)0x00000020)
  4571. #define GPIO_ODR_ODR_6 ((uint32_t)0x00000040)
  4572. #define GPIO_ODR_ODR_7 ((uint32_t)0x00000080)
  4573. #define GPIO_ODR_ODR_8 ((uint32_t)0x00000100)
  4574. #define GPIO_ODR_ODR_9 ((uint32_t)0x00000200)
  4575. #define GPIO_ODR_ODR_10 ((uint32_t)0x00000400)
  4576. #define GPIO_ODR_ODR_11 ((uint32_t)0x00000800)
  4577. #define GPIO_ODR_ODR_12 ((uint32_t)0x00001000)
  4578. #define GPIO_ODR_ODR_13 ((uint32_t)0x00002000)
  4579. #define GPIO_ODR_ODR_14 ((uint32_t)0x00004000)
  4580. #define GPIO_ODR_ODR_15 ((uint32_t)0x00008000)
  4581. /* Old GPIO_ODR register bits definition, maintained for legacy purpose */
  4582. #define GPIO_OTYPER_ODR_0 GPIO_ODR_ODR_0
  4583. #define GPIO_OTYPER_ODR_1 GPIO_ODR_ODR_1
  4584. #define GPIO_OTYPER_ODR_2 GPIO_ODR_ODR_2
  4585. #define GPIO_OTYPER_ODR_3 GPIO_ODR_ODR_3
  4586. #define GPIO_OTYPER_ODR_4 GPIO_ODR_ODR_4
  4587. #define GPIO_OTYPER_ODR_5 GPIO_ODR_ODR_5
  4588. #define GPIO_OTYPER_ODR_6 GPIO_ODR_ODR_6
  4589. #define GPIO_OTYPER_ODR_7 GPIO_ODR_ODR_7
  4590. #define GPIO_OTYPER_ODR_8 GPIO_ODR_ODR_8
  4591. #define GPIO_OTYPER_ODR_9 GPIO_ODR_ODR_9
  4592. #define GPIO_OTYPER_ODR_10 GPIO_ODR_ODR_10
  4593. #define GPIO_OTYPER_ODR_11 GPIO_ODR_ODR_11
  4594. #define GPIO_OTYPER_ODR_12 GPIO_ODR_ODR_12
  4595. #define GPIO_OTYPER_ODR_13 GPIO_ODR_ODR_13
  4596. #define GPIO_OTYPER_ODR_14 GPIO_ODR_ODR_14
  4597. #define GPIO_OTYPER_ODR_15 GPIO_ODR_ODR_15
  4598. /****************** Bits definition for GPIO_BSRR register ******************/
  4599. #define GPIO_BSRR_BS_0 ((uint32_t)0x00000001)
  4600. #define GPIO_BSRR_BS_1 ((uint32_t)0x00000002)
  4601. #define GPIO_BSRR_BS_2 ((uint32_t)0x00000004)
  4602. #define GPIO_BSRR_BS_3 ((uint32_t)0x00000008)
  4603. #define GPIO_BSRR_BS_4 ((uint32_t)0x00000010)
  4604. #define GPIO_BSRR_BS_5 ((uint32_t)0x00000020)
  4605. #define GPIO_BSRR_BS_6 ((uint32_t)0x00000040)
  4606. #define GPIO_BSRR_BS_7 ((uint32_t)0x00000080)
  4607. #define GPIO_BSRR_BS_8 ((uint32_t)0x00000100)
  4608. #define GPIO_BSRR_BS_9 ((uint32_t)0x00000200)
  4609. #define GPIO_BSRR_BS_10 ((uint32_t)0x00000400)
  4610. #define GPIO_BSRR_BS_11 ((uint32_t)0x00000800)
  4611. #define GPIO_BSRR_BS_12 ((uint32_t)0x00001000)
  4612. #define GPIO_BSRR_BS_13 ((uint32_t)0x00002000)
  4613. #define GPIO_BSRR_BS_14 ((uint32_t)0x00004000)
  4614. #define GPIO_BSRR_BS_15 ((uint32_t)0x00008000)
  4615. #define GPIO_BSRR_BR_0 ((uint32_t)0x00010000)
  4616. #define GPIO_BSRR_BR_1 ((uint32_t)0x00020000)
  4617. #define GPIO_BSRR_BR_2 ((uint32_t)0x00040000)
  4618. #define GPIO_BSRR_BR_3 ((uint32_t)0x00080000)
  4619. #define GPIO_BSRR_BR_4 ((uint32_t)0x00100000)
  4620. #define GPIO_BSRR_BR_5 ((uint32_t)0x00200000)
  4621. #define GPIO_BSRR_BR_6 ((uint32_t)0x00400000)
  4622. #define GPIO_BSRR_BR_7 ((uint32_t)0x00800000)
  4623. #define GPIO_BSRR_BR_8 ((uint32_t)0x01000000)
  4624. #define GPIO_BSRR_BR_9 ((uint32_t)0x02000000)
  4625. #define GPIO_BSRR_BR_10 ((uint32_t)0x04000000)
  4626. #define GPIO_BSRR_BR_11 ((uint32_t)0x08000000)
  4627. #define GPIO_BSRR_BR_12 ((uint32_t)0x10000000)
  4628. #define GPIO_BSRR_BR_13 ((uint32_t)0x20000000)
  4629. #define GPIO_BSRR_BR_14 ((uint32_t)0x40000000)
  4630. #define GPIO_BSRR_BR_15 ((uint32_t)0x80000000)
  4631. /****************** Bit definition for GPIO_LCKR register *********************/
  4632. #define GPIO_LCKR_LCK0 ((uint32_t)0x00000001)
  4633. #define GPIO_LCKR_LCK1 ((uint32_t)0x00000002)
  4634. #define GPIO_LCKR_LCK2 ((uint32_t)0x00000004)
  4635. #define GPIO_LCKR_LCK3 ((uint32_t)0x00000008)
  4636. #define GPIO_LCKR_LCK4 ((uint32_t)0x00000010)
  4637. #define GPIO_LCKR_LCK5 ((uint32_t)0x00000020)
  4638. #define GPIO_LCKR_LCK6 ((uint32_t)0x00000040)
  4639. #define GPIO_LCKR_LCK7 ((uint32_t)0x00000080)
  4640. #define GPIO_LCKR_LCK8 ((uint32_t)0x00000100)
  4641. #define GPIO_LCKR_LCK9 ((uint32_t)0x00000200)
  4642. #define GPIO_LCKR_LCK10 ((uint32_t)0x00000400)
  4643. #define GPIO_LCKR_LCK11 ((uint32_t)0x00000800)
  4644. #define GPIO_LCKR_LCK12 ((uint32_t)0x00001000)
  4645. #define GPIO_LCKR_LCK13 ((uint32_t)0x00002000)
  4646. #define GPIO_LCKR_LCK14 ((uint32_t)0x00004000)
  4647. #define GPIO_LCKR_LCK15 ((uint32_t)0x00008000)
  4648. #define GPIO_LCKR_LCKK ((uint32_t)0x00010000)
  4649. /******************************************************************************/
  4650. /* */
  4651. /* HASH */
  4652. /* */
  4653. /******************************************************************************/
  4654. /****************** Bits definition for HASH_CR register ********************/
  4655. #define HASH_CR_INIT ((uint32_t)0x00000004)
  4656. #define HASH_CR_DMAE ((uint32_t)0x00000008)
  4657. #define HASH_CR_DATATYPE ((uint32_t)0x00000030)
  4658. #define HASH_CR_DATATYPE_0 ((uint32_t)0x00000010)
  4659. #define HASH_CR_DATATYPE_1 ((uint32_t)0x00000020)
  4660. #define HASH_CR_MODE ((uint32_t)0x00000040)
  4661. #define HASH_CR_ALGO ((uint32_t)0x00040080)
  4662. #define HASH_CR_ALGO_0 ((uint32_t)0x00000080)
  4663. #define HASH_CR_ALGO_1 ((uint32_t)0x00040000)
  4664. #define HASH_CR_NBW ((uint32_t)0x00000F00)
  4665. #define HASH_CR_NBW_0 ((uint32_t)0x00000100)
  4666. #define HASH_CR_NBW_1 ((uint32_t)0x00000200)
  4667. #define HASH_CR_NBW_2 ((uint32_t)0x00000400)
  4668. #define HASH_CR_NBW_3 ((uint32_t)0x00000800)
  4669. #define HASH_CR_DINNE ((uint32_t)0x00001000)
  4670. #define HASH_CR_MDMAT ((uint32_t)0x00002000)
  4671. #define HASH_CR_LKEY ((uint32_t)0x00010000)
  4672. /****************** Bits definition for HASH_STR register *******************/
  4673. #define HASH_STR_NBLW ((uint32_t)0x0000001F)
  4674. #define HASH_STR_NBLW_0 ((uint32_t)0x00000001)
  4675. #define HASH_STR_NBLW_1 ((uint32_t)0x00000002)
  4676. #define HASH_STR_NBLW_2 ((uint32_t)0x00000004)
  4677. #define HASH_STR_NBLW_3 ((uint32_t)0x00000008)
  4678. #define HASH_STR_NBLW_4 ((uint32_t)0x00000010)
  4679. #define HASH_STR_DCAL ((uint32_t)0x00000100)
  4680. /* Aliases for HASH_STR register */
  4681. #define HASH_STR_NBW HASH_STR_NBLW
  4682. #define HASH_STR_NBW_0 HASH_STR_NBLW_0
  4683. #define HASH_STR_NBW_1 HASH_STR_NBLW_1
  4684. #define HASH_STR_NBW_2 HASH_STR_NBLW_2
  4685. #define HASH_STR_NBW_3 HASH_STR_NBLW_3
  4686. #define HASH_STR_NBW_4 HASH_STR_NBLW_4
  4687. /****************** Bits definition for HASH_IMR register *******************/
  4688. #define HASH_IMR_DINIE ((uint32_t)0x00000001)
  4689. #define HASH_IMR_DCIE ((uint32_t)0x00000002)
  4690. /* Aliases for HASH_IMR register */
  4691. #define HASH_IMR_DINIM HASH_IMR_DINIE
  4692. #define HASH_IMR_DCIM HASH_IMR_DCIE
  4693. /****************** Bits definition for HASH_SR register ********************/
  4694. #define HASH_SR_DINIS ((uint32_t)0x00000001)
  4695. #define HASH_SR_DCIS ((uint32_t)0x00000002)
  4696. #define HASH_SR_DMAS ((uint32_t)0x00000004)
  4697. #define HASH_SR_BUSY ((uint32_t)0x00000008)
  4698. /******************************************************************************/
  4699. /* */
  4700. /* Inter-integrated Circuit Interface */
  4701. /* */
  4702. /******************************************************************************/
  4703. /******************* Bit definition for I2C_CR1 register ********************/
  4704. #define I2C_CR1_PE ((uint32_t)0x00000001) /*!<Peripheral Enable */
  4705. #define I2C_CR1_SMBUS ((uint32_t)0x00000002) /*!<SMBus Mode */
  4706. #define I2C_CR1_SMBTYPE ((uint32_t)0x00000008) /*!<SMBus Type */
  4707. #define I2C_CR1_ENARP ((uint32_t)0x00000010) /*!<ARP Enable */
  4708. #define I2C_CR1_ENPEC ((uint32_t)0x00000020) /*!<PEC Enable */
  4709. #define I2C_CR1_ENGC ((uint32_t)0x00000040) /*!<General Call Enable */
  4710. #define I2C_CR1_NOSTRETCH ((uint32_t)0x00000080) /*!<Clock Stretching Disable (Slave mode) */
  4711. #define I2C_CR1_START ((uint32_t)0x00000100) /*!<Start Generation */
  4712. #define I2C_CR1_STOP ((uint32_t)0x00000200) /*!<Stop Generation */
  4713. #define I2C_CR1_ACK ((uint32_t)0x00000400) /*!<Acknowledge Enable */
  4714. #define I2C_CR1_POS ((uint32_t)0x00000800) /*!<Acknowledge/PEC Position (for data reception) */
  4715. #define I2C_CR1_PEC ((uint32_t)0x00001000) /*!<Packet Error Checking */
  4716. #define I2C_CR1_ALERT ((uint32_t)0x00002000) /*!<SMBus Alert */
  4717. #define I2C_CR1_SWRST ((uint32_t)0x00008000) /*!<Software Reset */
  4718. /******************* Bit definition for I2C_CR2 register ********************/
  4719. #define I2C_CR2_FREQ ((uint32_t)0x0000003F) /*!<FREQ[5:0] bits (Peripheral Clock Frequency) */
  4720. #define I2C_CR2_FREQ_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4721. #define I2C_CR2_FREQ_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4722. #define I2C_CR2_FREQ_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  4723. #define I2C_CR2_FREQ_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  4724. #define I2C_CR2_FREQ_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  4725. #define I2C_CR2_FREQ_5 ((uint32_t)0x00000020) /*!<Bit 5 */
  4726. #define I2C_CR2_ITERREN ((uint32_t)0x00000100) /*!<Error Interrupt Enable */
  4727. #define I2C_CR2_ITEVTEN ((uint32_t)0x00000200) /*!<Event Interrupt Enable */
  4728. #define I2C_CR2_ITBUFEN ((uint32_t)0x00000400) /*!<Buffer Interrupt Enable */
  4729. #define I2C_CR2_DMAEN ((uint32_t)0x00000800) /*!<DMA Requests Enable */
  4730. #define I2C_CR2_LAST ((uint32_t)0x00001000) /*!<DMA Last Transfer */
  4731. /******************* Bit definition for I2C_OAR1 register *******************/
  4732. #define I2C_OAR1_ADD1_7 ((uint32_t)0x000000FE) /*!<Interface Address */
  4733. #define I2C_OAR1_ADD8_9 ((uint32_t)0x00000300) /*!<Interface Address */
  4734. #define I2C_OAR1_ADD0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4735. #define I2C_OAR1_ADD1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4736. #define I2C_OAR1_ADD2 ((uint32_t)0x00000004) /*!<Bit 2 */
  4737. #define I2C_OAR1_ADD3 ((uint32_t)0x00000008) /*!<Bit 3 */
  4738. #define I2C_OAR1_ADD4 ((uint32_t)0x00000010) /*!<Bit 4 */
  4739. #define I2C_OAR1_ADD5 ((uint32_t)0x00000020) /*!<Bit 5 */
  4740. #define I2C_OAR1_ADD6 ((uint32_t)0x00000040) /*!<Bit 6 */
  4741. #define I2C_OAR1_ADD7 ((uint32_t)0x00000080) /*!<Bit 7 */
  4742. #define I2C_OAR1_ADD8 ((uint32_t)0x00000100) /*!<Bit 8 */
  4743. #define I2C_OAR1_ADD9 ((uint32_t)0x00000200) /*!<Bit 9 */
  4744. #define I2C_OAR1_ADDMODE ((uint32_t)0x00008000) /*!<Addressing Mode (Slave mode) */
  4745. /******************* Bit definition for I2C_OAR2 register *******************/
  4746. #define I2C_OAR2_ENDUAL ((uint32_t)0x00000001) /*!<Dual addressing mode enable */
  4747. #define I2C_OAR2_ADD2 ((uint32_t)0x000000FE) /*!<Interface address */
  4748. /******************** Bit definition for I2C_DR register ********************/
  4749. #define I2C_DR_DR ((uint32_t)0x000000FF) /*!<8-bit Data Register */
  4750. /******************* Bit definition for I2C_SR1 register ********************/
  4751. #define I2C_SR1_SB ((uint32_t)0x00000001) /*!<Start Bit (Master mode) */
  4752. #define I2C_SR1_ADDR ((uint32_t)0x00000002) /*!<Address sent (master mode)/matched (slave mode) */
  4753. #define I2C_SR1_BTF ((uint32_t)0x00000004) /*!<Byte Transfer Finished */
  4754. #define I2C_SR1_ADD10 ((uint32_t)0x00000008) /*!<10-bit header sent (Master mode) */
  4755. #define I2C_SR1_STOPF ((uint32_t)0x00000010) /*!<Stop detection (Slave mode) */
  4756. #define I2C_SR1_RXNE ((uint32_t)0x00000040) /*!<Data Register not Empty (receivers) */
  4757. #define I2C_SR1_TXE ((uint32_t)0x00000080) /*!<Data Register Empty (transmitters) */
  4758. #define I2C_SR1_BERR ((uint32_t)0x00000100) /*!<Bus Error */
  4759. #define I2C_SR1_ARLO ((uint32_t)0x00000200) /*!<Arbitration Lost (master mode) */
  4760. #define I2C_SR1_AF ((uint32_t)0x00000400) /*!<Acknowledge Failure */
  4761. #define I2C_SR1_OVR ((uint32_t)0x00000800) /*!<Overrun/Underrun */
  4762. #define I2C_SR1_PECERR ((uint32_t)0x00001000) /*!<PEC Error in reception */
  4763. #define I2C_SR1_TIMEOUT ((uint32_t)0x00004000) /*!<Timeout or Tlow Error */
  4764. #define I2C_SR1_SMBALERT ((uint32_t)0x00008000) /*!<SMBus Alert */
  4765. /******************* Bit definition for I2C_SR2 register ********************/
  4766. #define I2C_SR2_MSL ((uint32_t)0x00000001) /*!<Master/Slave */
  4767. #define I2C_SR2_BUSY ((uint32_t)0x00000002) /*!<Bus Busy */
  4768. #define I2C_SR2_TRA ((uint32_t)0x00000004) /*!<Transmitter/Receiver */
  4769. #define I2C_SR2_GENCALL ((uint32_t)0x00000010) /*!<General Call Address (Slave mode) */
  4770. #define I2C_SR2_SMBDEFAULT ((uint32_t)0x00000020) /*!<SMBus Device Default Address (Slave mode) */
  4771. #define I2C_SR2_SMBHOST ((uint32_t)0x00000040) /*!<SMBus Host Header (Slave mode) */
  4772. #define I2C_SR2_DUALF ((uint32_t)0x00000080) /*!<Dual Flag (Slave mode) */
  4773. #define I2C_SR2_PEC ((uint32_t)0x0000FF00) /*!<Packet Error Checking Register */
  4774. /******************* Bit definition for I2C_CCR register ********************/
  4775. #define I2C_CCR_CCR ((uint32_t)0x00000FFF) /*!<Clock Control Register in Fast/Standard mode (Master mode) */
  4776. #define I2C_CCR_DUTY ((uint32_t)0x00004000) /*!<Fast Mode Duty Cycle */
  4777. #define I2C_CCR_FS ((uint32_t)0x00008000) /*!<I2C Master Mode Selection */
  4778. /****************** Bit definition for I2C_TRISE register *******************/
  4779. #define I2C_TRISE_TRISE ((uint32_t)0x0000003F) /*!<Maximum Rise Time in Fast/Standard mode (Master mode) */
  4780. /****************** Bit definition for I2C_FLTR register *******************/
  4781. #define I2C_FLTR_DNF ((uint32_t)0x0000000F) /*!<Digital Noise Filter */
  4782. #define I2C_FLTR_ANOFF ((uint32_t)0x00000010) /*!<Analog Noise Filter OFF */
  4783. /******************************************************************************/
  4784. /* */
  4785. /* Independent WATCHDOG */
  4786. /* */
  4787. /******************************************************************************/
  4788. /******************* Bit definition for IWDG_KR register ********************/
  4789. #define IWDG_KR_KEY ((uint32_t)0xFFFF) /*!<Key value (write only, read 0000h) */
  4790. /******************* Bit definition for IWDG_PR register ********************/
  4791. #define IWDG_PR_PR ((uint32_t)0x07) /*!<PR[2:0] (Prescaler divider) */
  4792. #define IWDG_PR_PR_0 ((uint32_t)0x01) /*!<Bit 0 */
  4793. #define IWDG_PR_PR_1 ((uint32_t)0x02) /*!<Bit 1 */
  4794. #define IWDG_PR_PR_2 ((uint32_t)0x04) /*!<Bit 2 */
  4795. /******************* Bit definition for IWDG_RLR register *******************/
  4796. #define IWDG_RLR_RL ((uint32_t)0x0FFF) /*!<Watchdog counter reload value */
  4797. /******************* Bit definition for IWDG_SR register ********************/
  4798. #define IWDG_SR_PVU ((uint32_t)0x01) /*!<Watchdog prescaler value update */
  4799. #define IWDG_SR_RVU ((uint32_t)0x02) /*!<Watchdog counter reload value update */
  4800. /******************************************************************************/
  4801. /* */
  4802. /* Power Control */
  4803. /* */
  4804. /******************************************************************************/
  4805. /******************** Bit definition for PWR_CR register ********************/
  4806. #define PWR_CR_LPDS ((uint32_t)0x00000001) /*!< Low-Power Deepsleep */
  4807. #define PWR_CR_PDDS ((uint32_t)0x00000002) /*!< Power Down Deepsleep */
  4808. #define PWR_CR_CWUF ((uint32_t)0x00000004) /*!< Clear Wakeup Flag */
  4809. #define PWR_CR_CSBF ((uint32_t)0x00000008) /*!< Clear Standby Flag */
  4810. #define PWR_CR_PVDE ((uint32_t)0x00000010) /*!< Power Voltage Detector Enable */
  4811. #define PWR_CR_PLS ((uint32_t)0x000000E0) /*!< PLS[2:0] bits (PVD Level Selection) */
  4812. #define PWR_CR_PLS_0 ((uint32_t)0x00000020) /*!< Bit 0 */
  4813. #define PWR_CR_PLS_1 ((uint32_t)0x00000040) /*!< Bit 1 */
  4814. #define PWR_CR_PLS_2 ((uint32_t)0x00000080) /*!< Bit 2 */
  4815. /*!< PVD level configuration */
  4816. #define PWR_CR_PLS_LEV0 ((uint32_t)0x00000000) /*!< PVD level 0 */
  4817. #define PWR_CR_PLS_LEV1 ((uint32_t)0x00000020) /*!< PVD level 1 */
  4818. #define PWR_CR_PLS_LEV2 ((uint32_t)0x00000040) /*!< PVD level 2 */
  4819. #define PWR_CR_PLS_LEV3 ((uint32_t)0x00000060) /*!< PVD level 3 */
  4820. #define PWR_CR_PLS_LEV4 ((uint32_t)0x00000080) /*!< PVD level 4 */
  4821. #define PWR_CR_PLS_LEV5 ((uint32_t)0x000000A0) /*!< PVD level 5 */
  4822. #define PWR_CR_PLS_LEV6 ((uint32_t)0x000000C0) /*!< PVD level 6 */
  4823. #define PWR_CR_PLS_LEV7 ((uint32_t)0x000000E0) /*!< PVD level 7 */
  4824. #define PWR_CR_DBP ((uint32_t)0x00000100) /*!< Disable Backup Domain write protection */
  4825. #define PWR_CR_FPDS ((uint32_t)0x00000200) /*!< Flash power down in Stop mode */
  4826. #define PWR_CR_LPLVDS ((uint32_t)0x00000400) /*!< Low-Power Regulator Low Voltage Scaling in Stop mode */
  4827. #define PWR_CR_MRLVDS ((uint32_t)0x00000800) /*!< Main regulator Low Voltage Scaling in Stop mode */
  4828. #define PWR_CR_ADCDC1 ((uint32_t)0x00002000) /*!< Refer to AN4073 on how to use this bit */
  4829. #define PWR_CR_VOS ((uint32_t)0x0000C000) /*!< VOS[1:0] bits (Regulator voltage scaling output selection) */
  4830. #define PWR_CR_VOS_0 ((uint32_t)0x00004000) /*!< Bit 0 */
  4831. #define PWR_CR_VOS_1 ((uint32_t)0x00008000) /*!< Bit 1 */
  4832. #define PWR_CR_ODEN ((uint32_t)0x00010000) /*!< Over Drive enable */
  4833. #define PWR_CR_ODSWEN ((uint32_t)0x00020000) /*!< Over Drive switch enabled */
  4834. #define PWR_CR_UDEN ((uint32_t)0x000C0000) /*!< Under Drive enable in stop mode */
  4835. #define PWR_CR_UDEN_0 ((uint32_t)0x00040000) /*!< Bit 0 */
  4836. #define PWR_CR_UDEN_1 ((uint32_t)0x00080000) /*!< Bit 1 */
  4837. /* Legacy define */
  4838. #define PWR_CR_PMODE PWR_CR_VOS
  4839. #define PWR_CR_LPUDS PWR_CR_LPLVDS /*!< Low-Power Regulator in deepsleep under-drive mode */
  4840. #define PWR_CR_MRUDS PWR_CR_MRLVDS /*!< Main regulator in deepsleep under-drive mode */
  4841. /******************* Bit definition for PWR_CSR register ********************/
  4842. #define PWR_CSR_WUF ((uint32_t)0x00000001) /*!< Wakeup Flag */
  4843. #define PWR_CSR_SBF ((uint32_t)0x00000002) /*!< Standby Flag */
  4844. #define PWR_CSR_PVDO ((uint32_t)0x00000004) /*!< PVD Output */
  4845. #define PWR_CSR_BRR ((uint32_t)0x00000008) /*!< Backup regulator ready */
  4846. #define PWR_CSR_EWUP ((uint32_t)0x00000100) /*!< Enable WKUP pin */
  4847. #define PWR_CSR_BRE ((uint32_t)0x00000200) /*!< Backup regulator enable */
  4848. #define PWR_CSR_VOSRDY ((uint32_t)0x00004000) /*!< Regulator voltage scaling output selection ready */
  4849. #define PWR_CSR_ODRDY ((uint32_t)0x00010000) /*!< Over Drive generator ready */
  4850. #define PWR_CSR_ODSWRDY ((uint32_t)0x00020000) /*!< Over Drive Switch ready */
  4851. #define PWR_CSR_UDSWRDY ((uint32_t)0x000C0000) /*!< Under Drive ready */
  4852. /* Legacy define */
  4853. #define PWR_CSR_REGRDY PWR_CSR_VOSRDY
  4854. /******************************************************************************/
  4855. /* */
  4856. /* Reset and Clock Control */
  4857. /* */
  4858. /******************************************************************************/
  4859. /******************** Bit definition for RCC_CR register ********************/
  4860. #define RCC_CR_HSION ((uint32_t)0x00000001)
  4861. #define RCC_CR_HSIRDY ((uint32_t)0x00000002)
  4862. #define RCC_CR_HSITRIM ((uint32_t)0x000000F8)
  4863. #define RCC_CR_HSITRIM_0 ((uint32_t)0x00000008)/*!<Bit 0 */
  4864. #define RCC_CR_HSITRIM_1 ((uint32_t)0x00000010)/*!<Bit 1 */
  4865. #define RCC_CR_HSITRIM_2 ((uint32_t)0x00000020)/*!<Bit 2 */
  4866. #define RCC_CR_HSITRIM_3 ((uint32_t)0x00000040)/*!<Bit 3 */
  4867. #define RCC_CR_HSITRIM_4 ((uint32_t)0x00000080)/*!<Bit 4 */
  4868. #define RCC_CR_HSICAL ((uint32_t)0x0000FF00)
  4869. #define RCC_CR_HSICAL_0 ((uint32_t)0x00000100)/*!<Bit 0 */
  4870. #define RCC_CR_HSICAL_1 ((uint32_t)0x00000200)/*!<Bit 1 */
  4871. #define RCC_CR_HSICAL_2 ((uint32_t)0x00000400)/*!<Bit 2 */
  4872. #define RCC_CR_HSICAL_3 ((uint32_t)0x00000800)/*!<Bit 3 */
  4873. #define RCC_CR_HSICAL_4 ((uint32_t)0x00001000)/*!<Bit 4 */
  4874. #define RCC_CR_HSICAL_5 ((uint32_t)0x00002000)/*!<Bit 5 */
  4875. #define RCC_CR_HSICAL_6 ((uint32_t)0x00004000)/*!<Bit 6 */
  4876. #define RCC_CR_HSICAL_7 ((uint32_t)0x00008000)/*!<Bit 7 */
  4877. #define RCC_CR_HSEON ((uint32_t)0x00010000)
  4878. #define RCC_CR_HSERDY ((uint32_t)0x00020000)
  4879. #define RCC_CR_HSEBYP ((uint32_t)0x00040000)
  4880. #define RCC_CR_CSSON ((uint32_t)0x00080000)
  4881. #define RCC_CR_PLLON ((uint32_t)0x01000000)
  4882. #define RCC_CR_PLLRDY ((uint32_t)0x02000000)
  4883. #define RCC_CR_PLLI2SON ((uint32_t)0x04000000)
  4884. #define RCC_CR_PLLI2SRDY ((uint32_t)0x08000000)
  4885. #define RCC_CR_PLLSAION ((uint32_t)0x10000000)
  4886. #define RCC_CR_PLLSAIRDY ((uint32_t)0x20000000)
  4887. /******************** Bit definition for RCC_PLLCFGR register ***************/
  4888. #define RCC_PLLCFGR_PLLM ((uint32_t)0x0000003F)
  4889. #define RCC_PLLCFGR_PLLM_0 ((uint32_t)0x00000001)
  4890. #define RCC_PLLCFGR_PLLM_1 ((uint32_t)0x00000002)
  4891. #define RCC_PLLCFGR_PLLM_2 ((uint32_t)0x00000004)
  4892. #define RCC_PLLCFGR_PLLM_3 ((uint32_t)0x00000008)
  4893. #define RCC_PLLCFGR_PLLM_4 ((uint32_t)0x00000010)
  4894. #define RCC_PLLCFGR_PLLM_5 ((uint32_t)0x00000020)
  4895. #define RCC_PLLCFGR_PLLN ((uint32_t)0x00007FC0)
  4896. #define RCC_PLLCFGR_PLLN_0 ((uint32_t)0x00000040)
  4897. #define RCC_PLLCFGR_PLLN_1 ((uint32_t)0x00000080)
  4898. #define RCC_PLLCFGR_PLLN_2 ((uint32_t)0x00000100)
  4899. #define RCC_PLLCFGR_PLLN_3 ((uint32_t)0x00000200)
  4900. #define RCC_PLLCFGR_PLLN_4 ((uint32_t)0x00000400)
  4901. #define RCC_PLLCFGR_PLLN_5 ((uint32_t)0x00000800)
  4902. #define RCC_PLLCFGR_PLLN_6 ((uint32_t)0x00001000)
  4903. #define RCC_PLLCFGR_PLLN_7 ((uint32_t)0x00002000)
  4904. #define RCC_PLLCFGR_PLLN_8 ((uint32_t)0x00004000)
  4905. #define RCC_PLLCFGR_PLLP ((uint32_t)0x00030000)
  4906. #define RCC_PLLCFGR_PLLP_0 ((uint32_t)0x00010000)
  4907. #define RCC_PLLCFGR_PLLP_1 ((uint32_t)0x00020000)
  4908. #define RCC_PLLCFGR_PLLSRC ((uint32_t)0x00400000)
  4909. #define RCC_PLLCFGR_PLLSRC_HSE ((uint32_t)0x00400000)
  4910. #define RCC_PLLCFGR_PLLSRC_HSI ((uint32_t)0x00000000)
  4911. #define RCC_PLLCFGR_PLLQ ((uint32_t)0x0F000000)
  4912. #define RCC_PLLCFGR_PLLQ_0 ((uint32_t)0x01000000)
  4913. #define RCC_PLLCFGR_PLLQ_1 ((uint32_t)0x02000000)
  4914. #define RCC_PLLCFGR_PLLQ_2 ((uint32_t)0x04000000)
  4915. #define RCC_PLLCFGR_PLLQ_3 ((uint32_t)0x08000000)
  4916. /******************** Bit definition for RCC_CFGR register ******************/
  4917. /*!< SW configuration */
  4918. #define RCC_CFGR_SW ((uint32_t)0x00000003) /*!< SW[1:0] bits (System clock Switch) */
  4919. #define RCC_CFGR_SW_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  4920. #define RCC_CFGR_SW_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  4921. #define RCC_CFGR_SW_HSI ((uint32_t)0x00000000) /*!< HSI selected as system clock */
  4922. #define RCC_CFGR_SW_HSE ((uint32_t)0x00000001) /*!< HSE selected as system clock */
  4923. #define RCC_CFGR_SW_PLL ((uint32_t)0x00000002) /*!< PLL selected as system clock */
  4924. /*!< SWS configuration */
  4925. #define RCC_CFGR_SWS ((uint32_t)0x0000000C) /*!< SWS[1:0] bits (System Clock Switch Status) */
  4926. #define RCC_CFGR_SWS_0 ((uint32_t)0x00000004) /*!< Bit 0 */
  4927. #define RCC_CFGR_SWS_1 ((uint32_t)0x00000008) /*!< Bit 1 */
  4928. #define RCC_CFGR_SWS_HSI ((uint32_t)0x00000000) /*!< HSI oscillator used as system clock */
  4929. #define RCC_CFGR_SWS_HSE ((uint32_t)0x00000004) /*!< HSE oscillator used as system clock */
  4930. #define RCC_CFGR_SWS_PLL ((uint32_t)0x00000008) /*!< PLL used as system clock */
  4931. /*!< HPRE configuration */
  4932. #define RCC_CFGR_HPRE ((uint32_t)0x000000F0) /*!< HPRE[3:0] bits (AHB prescaler) */
  4933. #define RCC_CFGR_HPRE_0 ((uint32_t)0x00000010) /*!< Bit 0 */
  4934. #define RCC_CFGR_HPRE_1 ((uint32_t)0x00000020) /*!< Bit 1 */
  4935. #define RCC_CFGR_HPRE_2 ((uint32_t)0x00000040) /*!< Bit 2 */
  4936. #define RCC_CFGR_HPRE_3 ((uint32_t)0x00000080) /*!< Bit 3 */
  4937. #define RCC_CFGR_HPRE_DIV1 ((uint32_t)0x00000000) /*!< SYSCLK not divided */
  4938. #define RCC_CFGR_HPRE_DIV2 ((uint32_t)0x00000080) /*!< SYSCLK divided by 2 */
  4939. #define RCC_CFGR_HPRE_DIV4 ((uint32_t)0x00000090) /*!< SYSCLK divided by 4 */
  4940. #define RCC_CFGR_HPRE_DIV8 ((uint32_t)0x000000A0) /*!< SYSCLK divided by 8 */
  4941. #define RCC_CFGR_HPRE_DIV16 ((uint32_t)0x000000B0) /*!< SYSCLK divided by 16 */
  4942. #define RCC_CFGR_HPRE_DIV64 ((uint32_t)0x000000C0) /*!< SYSCLK divided by 64 */
  4943. #define RCC_CFGR_HPRE_DIV128 ((uint32_t)0x000000D0) /*!< SYSCLK divided by 128 */
  4944. #define RCC_CFGR_HPRE_DIV256 ((uint32_t)0x000000E0) /*!< SYSCLK divided by 256 */
  4945. #define RCC_CFGR_HPRE_DIV512 ((uint32_t)0x000000F0) /*!< SYSCLK divided by 512 */
  4946. /*!< PPRE1 configuration */
  4947. #define RCC_CFGR_PPRE1 ((uint32_t)0x00001C00) /*!< PRE1[2:0] bits (APB1 prescaler) */
  4948. #define RCC_CFGR_PPRE1_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4949. #define RCC_CFGR_PPRE1_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4950. #define RCC_CFGR_PPRE1_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4951. #define RCC_CFGR_PPRE1_DIV1 ((uint32_t)0x00000000) /*!< HCLK not divided */
  4952. #define RCC_CFGR_PPRE1_DIV2 ((uint32_t)0x00001000) /*!< HCLK divided by 2 */
  4953. #define RCC_CFGR_PPRE1_DIV4 ((uint32_t)0x00001400) /*!< HCLK divided by 4 */
  4954. #define RCC_CFGR_PPRE1_DIV8 ((uint32_t)0x00001800) /*!< HCLK divided by 8 */
  4955. #define RCC_CFGR_PPRE1_DIV16 ((uint32_t)0x00001C00) /*!< HCLK divided by 16 */
  4956. /*!< PPRE2 configuration */
  4957. #define RCC_CFGR_PPRE2 ((uint32_t)0x0000E000) /*!< PRE2[2:0] bits (APB2 prescaler) */
  4958. #define RCC_CFGR_PPRE2_0 ((uint32_t)0x00002000) /*!< Bit 0 */
  4959. #define RCC_CFGR_PPRE2_1 ((uint32_t)0x00004000) /*!< Bit 1 */
  4960. #define RCC_CFGR_PPRE2_2 ((uint32_t)0x00008000) /*!< Bit 2 */
  4961. #define RCC_CFGR_PPRE2_DIV1 ((uint32_t)0x00000000) /*!< HCLK not divided */
  4962. #define RCC_CFGR_PPRE2_DIV2 ((uint32_t)0x00008000) /*!< HCLK divided by 2 */
  4963. #define RCC_CFGR_PPRE2_DIV4 ((uint32_t)0x0000A000) /*!< HCLK divided by 4 */
  4964. #define RCC_CFGR_PPRE2_DIV8 ((uint32_t)0x0000C000) /*!< HCLK divided by 8 */
  4965. #define RCC_CFGR_PPRE2_DIV16 ((uint32_t)0x0000E000) /*!< HCLK divided by 16 */
  4966. /*!< RTCPRE configuration */
  4967. #define RCC_CFGR_RTCPRE ((uint32_t)0x001F0000)
  4968. #define RCC_CFGR_RTCPRE_0 ((uint32_t)0x00010000)
  4969. #define RCC_CFGR_RTCPRE_1 ((uint32_t)0x00020000)
  4970. #define RCC_CFGR_RTCPRE_2 ((uint32_t)0x00040000)
  4971. #define RCC_CFGR_RTCPRE_3 ((uint32_t)0x00080000)
  4972. #define RCC_CFGR_RTCPRE_4 ((uint32_t)0x00100000)
  4973. /*!< MCO1 configuration */
  4974. #define RCC_CFGR_MCO1 ((uint32_t)0x00600000)
  4975. #define RCC_CFGR_MCO1_0 ((uint32_t)0x00200000)
  4976. #define RCC_CFGR_MCO1_1 ((uint32_t)0x00400000)
  4977. #define RCC_CFGR_I2SSRC ((uint32_t)0x00800000)
  4978. #define RCC_CFGR_MCO1PRE ((uint32_t)0x07000000)
  4979. #define RCC_CFGR_MCO1PRE_0 ((uint32_t)0x01000000)
  4980. #define RCC_CFGR_MCO1PRE_1 ((uint32_t)0x02000000)
  4981. #define RCC_CFGR_MCO1PRE_2 ((uint32_t)0x04000000)
  4982. #define RCC_CFGR_MCO2PRE ((uint32_t)0x38000000)
  4983. #define RCC_CFGR_MCO2PRE_0 ((uint32_t)0x08000000)
  4984. #define RCC_CFGR_MCO2PRE_1 ((uint32_t)0x10000000)
  4985. #define RCC_CFGR_MCO2PRE_2 ((uint32_t)0x20000000)
  4986. #define RCC_CFGR_MCO2 ((uint32_t)0xC0000000)
  4987. #define RCC_CFGR_MCO2_0 ((uint32_t)0x40000000)
  4988. #define RCC_CFGR_MCO2_1 ((uint32_t)0x80000000)
  4989. /******************** Bit definition for RCC_CIR register *******************/
  4990. #define RCC_CIR_LSIRDYF ((uint32_t)0x00000001)
  4991. #define RCC_CIR_LSERDYF ((uint32_t)0x00000002)
  4992. #define RCC_CIR_HSIRDYF ((uint32_t)0x00000004)
  4993. #define RCC_CIR_HSERDYF ((uint32_t)0x00000008)
  4994. #define RCC_CIR_PLLRDYF ((uint32_t)0x00000010)
  4995. #define RCC_CIR_PLLI2SRDYF ((uint32_t)0x00000020)
  4996. #define RCC_CIR_PLLSAIRDYF ((uint32_t)0x00000040)
  4997. #define RCC_CIR_CSSF ((uint32_t)0x00000080)
  4998. #define RCC_CIR_LSIRDYIE ((uint32_t)0x00000100)
  4999. #define RCC_CIR_LSERDYIE ((uint32_t)0x00000200)
  5000. #define RCC_CIR_HSIRDYIE ((uint32_t)0x00000400)
  5001. #define RCC_CIR_HSERDYIE ((uint32_t)0x00000800)
  5002. #define RCC_CIR_PLLRDYIE ((uint32_t)0x00001000)
  5003. #define RCC_CIR_PLLI2SRDYIE ((uint32_t)0x00002000)
  5004. #define RCC_CIR_PLLSAIRDYIE ((uint32_t)0x00004000)
  5005. #define RCC_CIR_LSIRDYC ((uint32_t)0x00010000)
  5006. #define RCC_CIR_LSERDYC ((uint32_t)0x00020000)
  5007. #define RCC_CIR_HSIRDYC ((uint32_t)0x00040000)
  5008. #define RCC_CIR_HSERDYC ((uint32_t)0x00080000)
  5009. #define RCC_CIR_PLLRDYC ((uint32_t)0x00100000)
  5010. #define RCC_CIR_PLLI2SRDYC ((uint32_t)0x00200000)
  5011. #define RCC_CIR_PLLSAIRDYC ((uint32_t)0x00400000)
  5012. #define RCC_CIR_CSSC ((uint32_t)0x00800000)
  5013. /******************** Bit definition for RCC_AHB1RSTR register **************/
  5014. #define RCC_AHB1RSTR_GPIOARST ((uint32_t)0x00000001)
  5015. #define RCC_AHB1RSTR_GPIOBRST ((uint32_t)0x00000002)
  5016. #define RCC_AHB1RSTR_GPIOCRST ((uint32_t)0x00000004)
  5017. #define RCC_AHB1RSTR_GPIODRST ((uint32_t)0x00000008)
  5018. #define RCC_AHB1RSTR_GPIOERST ((uint32_t)0x00000010)
  5019. #define RCC_AHB1RSTR_GPIOFRST ((uint32_t)0x00000020)
  5020. #define RCC_AHB1RSTR_GPIOGRST ((uint32_t)0x00000040)
  5021. #define RCC_AHB1RSTR_GPIOHRST ((uint32_t)0x00000080)
  5022. #define RCC_AHB1RSTR_GPIOIRST ((uint32_t)0x00000100)
  5023. #define RCC_AHB1RSTR_GPIOJRST ((uint32_t)0x00000200)
  5024. #define RCC_AHB1RSTR_GPIOKRST ((uint32_t)0x00000400)
  5025. #define RCC_AHB1RSTR_CRCRST ((uint32_t)0x00001000)
  5026. #define RCC_AHB1RSTR_DMA1RST ((uint32_t)0x00200000)
  5027. #define RCC_AHB1RSTR_DMA2RST ((uint32_t)0x00400000)
  5028. #define RCC_AHB1RSTR_DMA2DRST ((uint32_t)0x00800000)
  5029. #define RCC_AHB1RSTR_ETHMACRST ((uint32_t)0x02000000)
  5030. #define RCC_AHB1RSTR_OTGHRST ((uint32_t)0x20000000)
  5031. /******************** Bit definition for RCC_AHB2RSTR register **************/
  5032. #define RCC_AHB2RSTR_DCMIRST ((uint32_t)0x00000001)
  5033. #define RCC_AHB2RSTR_CRYPRST ((uint32_t)0x00000010)
  5034. #define RCC_AHB2RSTR_HASHRST ((uint32_t)0x00000020)
  5035. /* maintained for legacy purpose */
  5036. #define RCC_AHB2RSTR_HSAHRST RCC_AHB2RSTR_HASHRST
  5037. #define RCC_AHB2RSTR_RNGRST ((uint32_t)0x00000040)
  5038. #define RCC_AHB2RSTR_OTGFSRST ((uint32_t)0x00000080)
  5039. /******************** Bit definition for RCC_AHB3RSTR register **************/
  5040. #define RCC_AHB3RSTR_FMCRST ((uint32_t)0x00000001)
  5041. /******************** Bit definition for RCC_APB1RSTR register **************/
  5042. #define RCC_APB1RSTR_TIM2RST ((uint32_t)0x00000001)
  5043. #define RCC_APB1RSTR_TIM3RST ((uint32_t)0x00000002)
  5044. #define RCC_APB1RSTR_TIM4RST ((uint32_t)0x00000004)
  5045. #define RCC_APB1RSTR_TIM5RST ((uint32_t)0x00000008)
  5046. #define RCC_APB1RSTR_TIM6RST ((uint32_t)0x00000010)
  5047. #define RCC_APB1RSTR_TIM7RST ((uint32_t)0x00000020)
  5048. #define RCC_APB1RSTR_TIM12RST ((uint32_t)0x00000040)
  5049. #define RCC_APB1RSTR_TIM13RST ((uint32_t)0x00000080)
  5050. #define RCC_APB1RSTR_TIM14RST ((uint32_t)0x00000100)
  5051. #define RCC_APB1RSTR_WWDGRST ((uint32_t)0x00000800)
  5052. #define RCC_APB1RSTR_SPI2RST ((uint32_t)0x00004000)
  5053. #define RCC_APB1RSTR_SPI3RST ((uint32_t)0x00008000)
  5054. #define RCC_APB1RSTR_USART2RST ((uint32_t)0x00020000)
  5055. #define RCC_APB1RSTR_USART3RST ((uint32_t)0x00040000)
  5056. #define RCC_APB1RSTR_UART4RST ((uint32_t)0x00080000)
  5057. #define RCC_APB1RSTR_UART5RST ((uint32_t)0x00100000)
  5058. #define RCC_APB1RSTR_I2C1RST ((uint32_t)0x00200000)
  5059. #define RCC_APB1RSTR_I2C2RST ((uint32_t)0x00400000)
  5060. #define RCC_APB1RSTR_I2C3RST ((uint32_t)0x00800000)
  5061. #define RCC_APB1RSTR_CAN1RST ((uint32_t)0x02000000)
  5062. #define RCC_APB1RSTR_CAN2RST ((uint32_t)0x04000000)
  5063. #define RCC_APB1RSTR_PWRRST ((uint32_t)0x10000000)
  5064. #define RCC_APB1RSTR_DACRST ((uint32_t)0x20000000)
  5065. #define RCC_APB1RSTR_UART7RST ((uint32_t)0x40000000)
  5066. #define RCC_APB1RSTR_UART8RST ((uint32_t)0x80000000)
  5067. /******************** Bit definition for RCC_APB2RSTR register **************/
  5068. #define RCC_APB2RSTR_TIM1RST ((uint32_t)0x00000001)
  5069. #define RCC_APB2RSTR_TIM8RST ((uint32_t)0x00000002)
  5070. #define RCC_APB2RSTR_USART1RST ((uint32_t)0x00000010)
  5071. #define RCC_APB2RSTR_USART6RST ((uint32_t)0x00000020)
  5072. #define RCC_APB2RSTR_ADCRST ((uint32_t)0x00000100)
  5073. #define RCC_APB2RSTR_SDIORST ((uint32_t)0x00000800)
  5074. #define RCC_APB2RSTR_SPI1RST ((uint32_t)0x00001000)
  5075. #define RCC_APB2RSTR_SPI4RST ((uint32_t)0x00002000)
  5076. #define RCC_APB2RSTR_SYSCFGRST ((uint32_t)0x00004000)
  5077. #define RCC_APB2RSTR_TIM9RST ((uint32_t)0x00010000)
  5078. #define RCC_APB2RSTR_TIM10RST ((uint32_t)0x00020000)
  5079. #define RCC_APB2RSTR_TIM11RST ((uint32_t)0x00040000)
  5080. #define RCC_APB2RSTR_SPI5RST ((uint32_t)0x00100000)
  5081. #define RCC_APB2RSTR_SPI6RST ((uint32_t)0x00200000)
  5082. #define RCC_APB2RSTR_SAI1RST ((uint32_t)0x00400000)
  5083. /* Old SPI1RST bit definition, maintained for legacy purpose */
  5084. #define RCC_APB2RSTR_SPI1 RCC_APB2RSTR_SPI1RST
  5085. /******************** Bit definition for RCC_AHB1ENR register ***************/
  5086. #define RCC_AHB1ENR_GPIOAEN ((uint32_t)0x00000001)
  5087. #define RCC_AHB1ENR_GPIOBEN ((uint32_t)0x00000002)
  5088. #define RCC_AHB1ENR_GPIOCEN ((uint32_t)0x00000004)
  5089. #define RCC_AHB1ENR_GPIODEN ((uint32_t)0x00000008)
  5090. #define RCC_AHB1ENR_GPIOEEN ((uint32_t)0x00000010)
  5091. #define RCC_AHB1ENR_GPIOFEN ((uint32_t)0x00000020)
  5092. #define RCC_AHB1ENR_GPIOGEN ((uint32_t)0x00000040)
  5093. #define RCC_AHB1ENR_GPIOHEN ((uint32_t)0x00000080)
  5094. #define RCC_AHB1ENR_GPIOIEN ((uint32_t)0x00000100)
  5095. #define RCC_AHB1ENR_GPIOJEN ((uint32_t)0x00000200)
  5096. #define RCC_AHB1ENR_GPIOKEN ((uint32_t)0x00000400)
  5097. #define RCC_AHB1ENR_CRCEN ((uint32_t)0x00001000)
  5098. #define RCC_AHB1ENR_BKPSRAMEN ((uint32_t)0x00040000)
  5099. #define RCC_AHB1ENR_CCMDATARAMEN ((uint32_t)0x00100000)
  5100. #define RCC_AHB1ENR_DMA1EN ((uint32_t)0x00200000)
  5101. #define RCC_AHB1ENR_DMA2EN ((uint32_t)0x00400000)
  5102. #define RCC_AHB1ENR_DMA2DEN ((uint32_t)0x00800000)
  5103. #define RCC_AHB1ENR_ETHMACEN ((uint32_t)0x02000000)
  5104. #define RCC_AHB1ENR_ETHMACTXEN ((uint32_t)0x04000000)
  5105. #define RCC_AHB1ENR_ETHMACRXEN ((uint32_t)0x08000000)
  5106. #define RCC_AHB1ENR_ETHMACPTPEN ((uint32_t)0x10000000)
  5107. #define RCC_AHB1ENR_OTGHSEN ((uint32_t)0x20000000)
  5108. #define RCC_AHB1ENR_OTGHSULPIEN ((uint32_t)0x40000000)
  5109. /******************** Bit definition for RCC_AHB2ENR register ***************/
  5110. #define RCC_AHB2ENR_DCMIEN ((uint32_t)0x00000001)
  5111. #define RCC_AHB2ENR_CRYPEN ((uint32_t)0x00000010)
  5112. #define RCC_AHB2ENR_HASHEN ((uint32_t)0x00000020)
  5113. #define RCC_AHB2ENR_RNGEN ((uint32_t)0x00000040)
  5114. #define RCC_AHB2ENR_OTGFSEN ((uint32_t)0x00000080)
  5115. /******************** Bit definition for RCC_AHB3ENR register ***************/
  5116. #define RCC_AHB3ENR_FMCEN ((uint32_t)0x00000001)
  5117. /******************** Bit definition for RCC_APB1ENR register ***************/
  5118. #define RCC_APB1ENR_TIM2EN ((uint32_t)0x00000001)
  5119. #define RCC_APB1ENR_TIM3EN ((uint32_t)0x00000002)
  5120. #define RCC_APB1ENR_TIM4EN ((uint32_t)0x00000004)
  5121. #define RCC_APB1ENR_TIM5EN ((uint32_t)0x00000008)
  5122. #define RCC_APB1ENR_TIM6EN ((uint32_t)0x00000010)
  5123. #define RCC_APB1ENR_TIM7EN ((uint32_t)0x00000020)
  5124. #define RCC_APB1ENR_TIM12EN ((uint32_t)0x00000040)
  5125. #define RCC_APB1ENR_TIM13EN ((uint32_t)0x00000080)
  5126. #define RCC_APB1ENR_TIM14EN ((uint32_t)0x00000100)
  5127. #define RCC_APB1ENR_WWDGEN ((uint32_t)0x00000800)
  5128. #define RCC_APB1ENR_SPI2EN ((uint32_t)0x00004000)
  5129. #define RCC_APB1ENR_SPI3EN ((uint32_t)0x00008000)
  5130. #define RCC_APB1ENR_USART2EN ((uint32_t)0x00020000)
  5131. #define RCC_APB1ENR_USART3EN ((uint32_t)0x00040000)
  5132. #define RCC_APB1ENR_UART4EN ((uint32_t)0x00080000)
  5133. #define RCC_APB1ENR_UART5EN ((uint32_t)0x00100000)
  5134. #define RCC_APB1ENR_I2C1EN ((uint32_t)0x00200000)
  5135. #define RCC_APB1ENR_I2C2EN ((uint32_t)0x00400000)
  5136. #define RCC_APB1ENR_I2C3EN ((uint32_t)0x00800000)
  5137. #define RCC_APB1ENR_CAN1EN ((uint32_t)0x02000000)
  5138. #define RCC_APB1ENR_CAN2EN ((uint32_t)0x04000000)
  5139. #define RCC_APB1ENR_PWREN ((uint32_t)0x10000000)
  5140. #define RCC_APB1ENR_DACEN ((uint32_t)0x20000000)
  5141. #define RCC_APB1ENR_UART7EN ((uint32_t)0x40000000)
  5142. #define RCC_APB1ENR_UART8EN ((uint32_t)0x80000000)
  5143. /******************** Bit definition for RCC_APB2ENR register ***************/
  5144. #define RCC_APB2ENR_TIM1EN ((uint32_t)0x00000001)
  5145. #define RCC_APB2ENR_TIM8EN ((uint32_t)0x00000002)
  5146. #define RCC_APB2ENR_USART1EN ((uint32_t)0x00000010)
  5147. #define RCC_APB2ENR_USART6EN ((uint32_t)0x00000020)
  5148. #define RCC_APB2ENR_ADC1EN ((uint32_t)0x00000100)
  5149. #define RCC_APB2ENR_ADC2EN ((uint32_t)0x00000200)
  5150. #define RCC_APB2ENR_ADC3EN ((uint32_t)0x00000400)
  5151. #define RCC_APB2ENR_SDIOEN ((uint32_t)0x00000800)
  5152. #define RCC_APB2ENR_SPI1EN ((uint32_t)0x00001000)
  5153. #define RCC_APB2ENR_SPI4EN ((uint32_t)0x00002000)
  5154. #define RCC_APB2ENR_SYSCFGEN ((uint32_t)0x00004000)
  5155. #define RCC_APB2ENR_TIM9EN ((uint32_t)0x00010000)
  5156. #define RCC_APB2ENR_TIM10EN ((uint32_t)0x00020000)
  5157. #define RCC_APB2ENR_TIM11EN ((uint32_t)0x00040000)
  5158. #define RCC_APB2ENR_SPI5EN ((uint32_t)0x00100000)
  5159. #define RCC_APB2ENR_SPI6EN ((uint32_t)0x00200000)
  5160. #define RCC_APB2ENR_SAI1EN ((uint32_t)0x00400000)
  5161. /******************** Bit definition for RCC_AHB1LPENR register *************/
  5162. #define RCC_AHB1LPENR_GPIOALPEN ((uint32_t)0x00000001)
  5163. #define RCC_AHB1LPENR_GPIOBLPEN ((uint32_t)0x00000002)
  5164. #define RCC_AHB1LPENR_GPIOCLPEN ((uint32_t)0x00000004)
  5165. #define RCC_AHB1LPENR_GPIODLPEN ((uint32_t)0x00000008)
  5166. #define RCC_AHB1LPENR_GPIOELPEN ((uint32_t)0x00000010)
  5167. #define RCC_AHB1LPENR_GPIOFLPEN ((uint32_t)0x00000020)
  5168. #define RCC_AHB1LPENR_GPIOGLPEN ((uint32_t)0x00000040)
  5169. #define RCC_AHB1LPENR_GPIOHLPEN ((uint32_t)0x00000080)
  5170. #define RCC_AHB1LPENR_GPIOILPEN ((uint32_t)0x00000100)
  5171. #define RCC_AHB1LPENR_GPIOJLPEN ((uint32_t)0x00000200)
  5172. #define RCC_AHB1LPENR_GPIOKLPEN ((uint32_t)0x00000400)
  5173. #define RCC_AHB1LPENR_CRCLPEN ((uint32_t)0x00001000)
  5174. #define RCC_AHB1LPENR_FLITFLPEN ((uint32_t)0x00008000)
  5175. #define RCC_AHB1LPENR_SRAM1LPEN ((uint32_t)0x00010000)
  5176. #define RCC_AHB1LPENR_SRAM2LPEN ((uint32_t)0x00020000)
  5177. #define RCC_AHB1LPENR_BKPSRAMLPEN ((uint32_t)0x00040000)
  5178. #define RCC_AHB1LPENR_SRAM3LPEN ((uint32_t)0x00080000)
  5179. #define RCC_AHB1LPENR_DMA1LPEN ((uint32_t)0x00200000)
  5180. #define RCC_AHB1LPENR_DMA2LPEN ((uint32_t)0x00400000)
  5181. #define RCC_AHB1LPENR_DMA2DLPEN ((uint32_t)0x00800000)
  5182. #define RCC_AHB1LPENR_ETHMACLPEN ((uint32_t)0x02000000)
  5183. #define RCC_AHB1LPENR_ETHMACTXLPEN ((uint32_t)0x04000000)
  5184. #define RCC_AHB1LPENR_ETHMACRXLPEN ((uint32_t)0x08000000)
  5185. #define RCC_AHB1LPENR_ETHMACPTPLPEN ((uint32_t)0x10000000)
  5186. #define RCC_AHB1LPENR_OTGHSLPEN ((uint32_t)0x20000000)
  5187. #define RCC_AHB1LPENR_OTGHSULPILPEN ((uint32_t)0x40000000)
  5188. /******************** Bit definition for RCC_AHB2LPENR register *************/
  5189. #define RCC_AHB2LPENR_DCMILPEN ((uint32_t)0x00000001)
  5190. #define RCC_AHB2LPENR_CRYPLPEN ((uint32_t)0x00000010)
  5191. #define RCC_AHB2LPENR_HASHLPEN ((uint32_t)0x00000020)
  5192. #define RCC_AHB2LPENR_RNGLPEN ((uint32_t)0x00000040)
  5193. #define RCC_AHB2LPENR_OTGFSLPEN ((uint32_t)0x00000080)
  5194. /******************** Bit definition for RCC_AHB3LPENR register *************/
  5195. #define RCC_AHB3LPENR_FMCLPEN ((uint32_t)0x00000001)
  5196. /******************** Bit definition for RCC_APB1LPENR register *************/
  5197. #define RCC_APB1LPENR_TIM2LPEN ((uint32_t)0x00000001)
  5198. #define RCC_APB1LPENR_TIM3LPEN ((uint32_t)0x00000002)
  5199. #define RCC_APB1LPENR_TIM4LPEN ((uint32_t)0x00000004)
  5200. #define RCC_APB1LPENR_TIM5LPEN ((uint32_t)0x00000008)
  5201. #define RCC_APB1LPENR_TIM6LPEN ((uint32_t)0x00000010)
  5202. #define RCC_APB1LPENR_TIM7LPEN ((uint32_t)0x00000020)
  5203. #define RCC_APB1LPENR_TIM12LPEN ((uint32_t)0x00000040)
  5204. #define RCC_APB1LPENR_TIM13LPEN ((uint32_t)0x00000080)
  5205. #define RCC_APB1LPENR_TIM14LPEN ((uint32_t)0x00000100)
  5206. #define RCC_APB1LPENR_WWDGLPEN ((uint32_t)0x00000800)
  5207. #define RCC_APB1LPENR_SPI2LPEN ((uint32_t)0x00004000)
  5208. #define RCC_APB1LPENR_SPI3LPEN ((uint32_t)0x00008000)
  5209. #define RCC_APB1LPENR_USART2LPEN ((uint32_t)0x00020000)
  5210. #define RCC_APB1LPENR_USART3LPEN ((uint32_t)0x00040000)
  5211. #define RCC_APB1LPENR_UART4LPEN ((uint32_t)0x00080000)
  5212. #define RCC_APB1LPENR_UART5LPEN ((uint32_t)0x00100000)
  5213. #define RCC_APB1LPENR_I2C1LPEN ((uint32_t)0x00200000)
  5214. #define RCC_APB1LPENR_I2C2LPEN ((uint32_t)0x00400000)
  5215. #define RCC_APB1LPENR_I2C3LPEN ((uint32_t)0x00800000)
  5216. #define RCC_APB1LPENR_CAN1LPEN ((uint32_t)0x02000000)
  5217. #define RCC_APB1LPENR_CAN2LPEN ((uint32_t)0x04000000)
  5218. #define RCC_APB1LPENR_PWRLPEN ((uint32_t)0x10000000)
  5219. #define RCC_APB1LPENR_DACLPEN ((uint32_t)0x20000000)
  5220. #define RCC_APB1LPENR_UART7LPEN ((uint32_t)0x40000000)
  5221. #define RCC_APB1LPENR_UART8LPEN ((uint32_t)0x80000000)
  5222. /******************** Bit definition for RCC_APB2LPENR register *************/
  5223. #define RCC_APB2LPENR_TIM1LPEN ((uint32_t)0x00000001)
  5224. #define RCC_APB2LPENR_TIM8LPEN ((uint32_t)0x00000002)
  5225. #define RCC_APB2LPENR_USART1LPEN ((uint32_t)0x00000010)
  5226. #define RCC_APB2LPENR_USART6LPEN ((uint32_t)0x00000020)
  5227. #define RCC_APB2LPENR_ADC1LPEN ((uint32_t)0x00000100)
  5228. #define RCC_APB2LPENR_ADC2LPEN ((uint32_t)0x00000200)
  5229. #define RCC_APB2LPENR_ADC3LPEN ((uint32_t)0x00000400)
  5230. #define RCC_APB2LPENR_SDIOLPEN ((uint32_t)0x00000800)
  5231. #define RCC_APB2LPENR_SPI1LPEN ((uint32_t)0x00001000)
  5232. #define RCC_APB2LPENR_SPI4LPEN ((uint32_t)0x00002000)
  5233. #define RCC_APB2LPENR_SYSCFGLPEN ((uint32_t)0x00004000)
  5234. #define RCC_APB2LPENR_TIM9LPEN ((uint32_t)0x00010000)
  5235. #define RCC_APB2LPENR_TIM10LPEN ((uint32_t)0x00020000)
  5236. #define RCC_APB2LPENR_TIM11LPEN ((uint32_t)0x00040000)
  5237. #define RCC_APB2LPENR_SPI5LPEN ((uint32_t)0x00100000)
  5238. #define RCC_APB2LPENR_SPI6LPEN ((uint32_t)0x00200000)
  5239. #define RCC_APB2LPENR_SAI1LPEN ((uint32_t)0x00400000)
  5240. /******************** Bit definition for RCC_BDCR register ******************/
  5241. #define RCC_BDCR_LSEON ((uint32_t)0x00000001)
  5242. #define RCC_BDCR_LSERDY ((uint32_t)0x00000002)
  5243. #define RCC_BDCR_LSEBYP ((uint32_t)0x00000004)
  5244. #define RCC_BDCR_RTCSEL ((uint32_t)0x00000300)
  5245. #define RCC_BDCR_RTCSEL_0 ((uint32_t)0x00000100)
  5246. #define RCC_BDCR_RTCSEL_1 ((uint32_t)0x00000200)
  5247. #define RCC_BDCR_RTCEN ((uint32_t)0x00008000)
  5248. #define RCC_BDCR_BDRST ((uint32_t)0x00010000)
  5249. /******************** Bit definition for RCC_CSR register *******************/
  5250. #define RCC_CSR_LSION ((uint32_t)0x00000001)
  5251. #define RCC_CSR_LSIRDY ((uint32_t)0x00000002)
  5252. #define RCC_CSR_RMVF ((uint32_t)0x01000000)
  5253. #define RCC_CSR_BORRSTF ((uint32_t)0x02000000)
  5254. #define RCC_CSR_PADRSTF ((uint32_t)0x04000000)
  5255. #define RCC_CSR_PORRSTF ((uint32_t)0x08000000)
  5256. #define RCC_CSR_SFTRSTF ((uint32_t)0x10000000)
  5257. #define RCC_CSR_WDGRSTF ((uint32_t)0x20000000)
  5258. #define RCC_CSR_WWDGRSTF ((uint32_t)0x40000000)
  5259. #define RCC_CSR_LPWRRSTF ((uint32_t)0x80000000)
  5260. /******************** Bit definition for RCC_SSCGR register *****************/
  5261. #define RCC_SSCGR_MODPER ((uint32_t)0x00001FFF)
  5262. #define RCC_SSCGR_INCSTEP ((uint32_t)0x0FFFE000)
  5263. #define RCC_SSCGR_SPREADSEL ((uint32_t)0x40000000)
  5264. #define RCC_SSCGR_SSCGEN ((uint32_t)0x80000000)
  5265. /******************** Bit definition for RCC_PLLI2SCFGR register ************/
  5266. #define RCC_PLLI2SCFGR_PLLI2SN ((uint32_t)0x00007FC0)
  5267. #define RCC_PLLI2SCFGR_PLLI2SN_0 ((uint32_t)0x00000040)
  5268. #define RCC_PLLI2SCFGR_PLLI2SN_1 ((uint32_t)0x00000080)
  5269. #define RCC_PLLI2SCFGR_PLLI2SN_2 ((uint32_t)0x00000100)
  5270. #define RCC_PLLI2SCFGR_PLLI2SN_3 ((uint32_t)0x00000200)
  5271. #define RCC_PLLI2SCFGR_PLLI2SN_4 ((uint32_t)0x00000400)
  5272. #define RCC_PLLI2SCFGR_PLLI2SN_5 ((uint32_t)0x00000800)
  5273. #define RCC_PLLI2SCFGR_PLLI2SN_6 ((uint32_t)0x00001000)
  5274. #define RCC_PLLI2SCFGR_PLLI2SN_7 ((uint32_t)0x00002000)
  5275. #define RCC_PLLI2SCFGR_PLLI2SN_8 ((uint32_t)0x00004000)
  5276. #define RCC_PLLI2SCFGR_PLLI2SQ ((uint32_t)0x0F000000)
  5277. #define RCC_PLLI2SCFGR_PLLI2SQ_0 ((uint32_t)0x01000000)
  5278. #define RCC_PLLI2SCFGR_PLLI2SQ_1 ((uint32_t)0x02000000)
  5279. #define RCC_PLLI2SCFGR_PLLI2SQ_2 ((uint32_t)0x04000000)
  5280. #define RCC_PLLI2SCFGR_PLLI2SQ_3 ((uint32_t)0x08000000)
  5281. #define RCC_PLLI2SCFGR_PLLI2SR ((uint32_t)0x70000000)
  5282. #define RCC_PLLI2SCFGR_PLLI2SR_0 ((uint32_t)0x10000000)
  5283. #define RCC_PLLI2SCFGR_PLLI2SR_1 ((uint32_t)0x20000000)
  5284. #define RCC_PLLI2SCFGR_PLLI2SR_2 ((uint32_t)0x40000000)
  5285. /******************** Bit definition for RCC_PLLSAICFGR register ************/
  5286. #define RCC_PLLSAICFGR_PLLSAIN ((uint32_t)0x00007FC0)
  5287. #define RCC_PLLSAICFGR_PLLSAIN_0 ((uint32_t)0x00000040)
  5288. #define RCC_PLLSAICFGR_PLLSAIN_1 ((uint32_t)0x00000080)
  5289. #define RCC_PLLSAICFGR_PLLSAIN_2 ((uint32_t)0x00000100)
  5290. #define RCC_PLLSAICFGR_PLLSAIN_3 ((uint32_t)0x00000200)
  5291. #define RCC_PLLSAICFGR_PLLSAIN_4 ((uint32_t)0x00000400)
  5292. #define RCC_PLLSAICFGR_PLLSAIN_5 ((uint32_t)0x00000800)
  5293. #define RCC_PLLSAICFGR_PLLSAIN_6 ((uint32_t)0x00001000)
  5294. #define RCC_PLLSAICFGR_PLLSAIN_7 ((uint32_t)0x00002000)
  5295. #define RCC_PLLSAICFGR_PLLSAIN_8 ((uint32_t)0x00004000)
  5296. #define RCC_PLLSAICFGR_PLLSAIQ ((uint32_t)0x0F000000)
  5297. #define RCC_PLLSAICFGR_PLLSAIQ_0 ((uint32_t)0x01000000)
  5298. #define RCC_PLLSAICFGR_PLLSAIQ_1 ((uint32_t)0x02000000)
  5299. #define RCC_PLLSAICFGR_PLLSAIQ_2 ((uint32_t)0x04000000)
  5300. #define RCC_PLLSAICFGR_PLLSAIQ_3 ((uint32_t)0x08000000)
  5301. #define RCC_PLLSAICFGR_PLLSAIR ((uint32_t)0x70000000)
  5302. #define RCC_PLLSAICFGR_PLLSAIR_0 ((uint32_t)0x10000000)
  5303. #define RCC_PLLSAICFGR_PLLSAIR_1 ((uint32_t)0x20000000)
  5304. #define RCC_PLLSAICFGR_PLLSAIR_2 ((uint32_t)0x40000000)
  5305. /******************** Bit definition for RCC_DCKCFGR register ***************/
  5306. #define RCC_DCKCFGR_PLLI2SDIVQ ((uint32_t)0x0000001F)
  5307. #define RCC_DCKCFGR_PLLSAIDIVQ ((uint32_t)0x00001F00)
  5308. #define RCC_DCKCFGR_PLLSAIDIVR ((uint32_t)0x00030000)
  5309. #define RCC_DCKCFGR_SAI1ASRC ((uint32_t)0x00300000)
  5310. #define RCC_DCKCFGR_SAI1ASRC_0 ((uint32_t)0x00100000)
  5311. #define RCC_DCKCFGR_SAI1ASRC_1 ((uint32_t)0x00200000)
  5312. #define RCC_DCKCFGR_SAI1BSRC ((uint32_t)0x00C00000)
  5313. #define RCC_DCKCFGR_SAI1BSRC_0 ((uint32_t)0x00400000)
  5314. #define RCC_DCKCFGR_SAI1BSRC_1 ((uint32_t)0x00800000)
  5315. #define RCC_DCKCFGR_TIMPRE ((uint32_t)0x01000000)
  5316. /******************************************************************************/
  5317. /* */
  5318. /* RNG */
  5319. /* */
  5320. /******************************************************************************/
  5321. /******************** Bits definition for RNG_CR register *******************/
  5322. #define RNG_CR_RNGEN ((uint32_t)0x00000004)
  5323. #define RNG_CR_IE ((uint32_t)0x00000008)
  5324. /******************** Bits definition for RNG_SR register *******************/
  5325. #define RNG_SR_DRDY ((uint32_t)0x00000001)
  5326. #define RNG_SR_CECS ((uint32_t)0x00000002)
  5327. #define RNG_SR_SECS ((uint32_t)0x00000004)
  5328. #define RNG_SR_CEIS ((uint32_t)0x00000020)
  5329. #define RNG_SR_SEIS ((uint32_t)0x00000040)
  5330. /******************************************************************************/
  5331. /* */
  5332. /* Real-Time Clock (RTC) */
  5333. /* */
  5334. /******************************************************************************/
  5335. /******************** Bits definition for RTC_TR register *******************/
  5336. #define RTC_TR_PM ((uint32_t)0x00400000)
  5337. #define RTC_TR_HT ((uint32_t)0x00300000)
  5338. #define RTC_TR_HT_0 ((uint32_t)0x00100000)
  5339. #define RTC_TR_HT_1 ((uint32_t)0x00200000)
  5340. #define RTC_TR_HU ((uint32_t)0x000F0000)
  5341. #define RTC_TR_HU_0 ((uint32_t)0x00010000)
  5342. #define RTC_TR_HU_1 ((uint32_t)0x00020000)
  5343. #define RTC_TR_HU_2 ((uint32_t)0x00040000)
  5344. #define RTC_TR_HU_3 ((uint32_t)0x00080000)
  5345. #define RTC_TR_MNT ((uint32_t)0x00007000)
  5346. #define RTC_TR_MNT_0 ((uint32_t)0x00001000)
  5347. #define RTC_TR_MNT_1 ((uint32_t)0x00002000)
  5348. #define RTC_TR_MNT_2 ((uint32_t)0x00004000)
  5349. #define RTC_TR_MNU ((uint32_t)0x00000F00)
  5350. #define RTC_TR_MNU_0 ((uint32_t)0x00000100)
  5351. #define RTC_TR_MNU_1 ((uint32_t)0x00000200)
  5352. #define RTC_TR_MNU_2 ((uint32_t)0x00000400)
  5353. #define RTC_TR_MNU_3 ((uint32_t)0x00000800)
  5354. #define RTC_TR_ST ((uint32_t)0x00000070)
  5355. #define RTC_TR_ST_0 ((uint32_t)0x00000010)
  5356. #define RTC_TR_ST_1 ((uint32_t)0x00000020)
  5357. #define RTC_TR_ST_2 ((uint32_t)0x00000040)
  5358. #define RTC_TR_SU ((uint32_t)0x0000000F)
  5359. #define RTC_TR_SU_0 ((uint32_t)0x00000001)
  5360. #define RTC_TR_SU_1 ((uint32_t)0x00000002)
  5361. #define RTC_TR_SU_2 ((uint32_t)0x00000004)
  5362. #define RTC_TR_SU_3 ((uint32_t)0x00000008)
  5363. /******************** Bits definition for RTC_DR register *******************/
  5364. #define RTC_DR_YT ((uint32_t)0x00F00000)
  5365. #define RTC_DR_YT_0 ((uint32_t)0x00100000)
  5366. #define RTC_DR_YT_1 ((uint32_t)0x00200000)
  5367. #define RTC_DR_YT_2 ((uint32_t)0x00400000)
  5368. #define RTC_DR_YT_3 ((uint32_t)0x00800000)
  5369. #define RTC_DR_YU ((uint32_t)0x000F0000)
  5370. #define RTC_DR_YU_0 ((uint32_t)0x00010000)
  5371. #define RTC_DR_YU_1 ((uint32_t)0x00020000)
  5372. #define RTC_DR_YU_2 ((uint32_t)0x00040000)
  5373. #define RTC_DR_YU_3 ((uint32_t)0x00080000)
  5374. #define RTC_DR_WDU ((uint32_t)0x0000E000)
  5375. #define RTC_DR_WDU_0 ((uint32_t)0x00002000)
  5376. #define RTC_DR_WDU_1 ((uint32_t)0x00004000)
  5377. #define RTC_DR_WDU_2 ((uint32_t)0x00008000)
  5378. #define RTC_DR_MT ((uint32_t)0x00001000)
  5379. #define RTC_DR_MU ((uint32_t)0x00000F00)
  5380. #define RTC_DR_MU_0 ((uint32_t)0x00000100)
  5381. #define RTC_DR_MU_1 ((uint32_t)0x00000200)
  5382. #define RTC_DR_MU_2 ((uint32_t)0x00000400)
  5383. #define RTC_DR_MU_3 ((uint32_t)0x00000800)
  5384. #define RTC_DR_DT ((uint32_t)0x00000030)
  5385. #define RTC_DR_DT_0 ((uint32_t)0x00000010)
  5386. #define RTC_DR_DT_1 ((uint32_t)0x00000020)
  5387. #define RTC_DR_DU ((uint32_t)0x0000000F)
  5388. #define RTC_DR_DU_0 ((uint32_t)0x00000001)
  5389. #define RTC_DR_DU_1 ((uint32_t)0x00000002)
  5390. #define RTC_DR_DU_2 ((uint32_t)0x00000004)
  5391. #define RTC_DR_DU_3 ((uint32_t)0x00000008)
  5392. /******************** Bits definition for RTC_CR register *******************/
  5393. #define RTC_CR_COE ((uint32_t)0x00800000)
  5394. #define RTC_CR_OSEL ((uint32_t)0x00600000)
  5395. #define RTC_CR_OSEL_0 ((uint32_t)0x00200000)
  5396. #define RTC_CR_OSEL_1 ((uint32_t)0x00400000)
  5397. #define RTC_CR_POL ((uint32_t)0x00100000)
  5398. #define RTC_CR_COSEL ((uint32_t)0x00080000)
  5399. #define RTC_CR_BCK ((uint32_t)0x00040000)
  5400. #define RTC_CR_SUB1H ((uint32_t)0x00020000)
  5401. #define RTC_CR_ADD1H ((uint32_t)0x00010000)
  5402. #define RTC_CR_TSIE ((uint32_t)0x00008000)
  5403. #define RTC_CR_WUTIE ((uint32_t)0x00004000)
  5404. #define RTC_CR_ALRBIE ((uint32_t)0x00002000)
  5405. #define RTC_CR_ALRAIE ((uint32_t)0x00001000)
  5406. #define RTC_CR_TSE ((uint32_t)0x00000800)
  5407. #define RTC_CR_WUTE ((uint32_t)0x00000400)
  5408. #define RTC_CR_ALRBE ((uint32_t)0x00000200)
  5409. #define RTC_CR_ALRAE ((uint32_t)0x00000100)
  5410. #define RTC_CR_DCE ((uint32_t)0x00000080)
  5411. #define RTC_CR_FMT ((uint32_t)0x00000040)
  5412. #define RTC_CR_BYPSHAD ((uint32_t)0x00000020)
  5413. #define RTC_CR_REFCKON ((uint32_t)0x00000010)
  5414. #define RTC_CR_TSEDGE ((uint32_t)0x00000008)
  5415. #define RTC_CR_WUCKSEL ((uint32_t)0x00000007)
  5416. #define RTC_CR_WUCKSEL_0 ((uint32_t)0x00000001)
  5417. #define RTC_CR_WUCKSEL_1 ((uint32_t)0x00000002)
  5418. #define RTC_CR_WUCKSEL_2 ((uint32_t)0x00000004)
  5419. /******************** Bits definition for RTC_ISR register ******************/
  5420. #define RTC_ISR_RECALPF ((uint32_t)0x00010000)
  5421. #define RTC_ISR_TAMP1F ((uint32_t)0x00002000)
  5422. #define RTC_ISR_TAMP2F ((uint32_t)0x00004000)
  5423. #define RTC_ISR_TSOVF ((uint32_t)0x00001000)
  5424. #define RTC_ISR_TSF ((uint32_t)0x00000800)
  5425. #define RTC_ISR_WUTF ((uint32_t)0x00000400)
  5426. #define RTC_ISR_ALRBF ((uint32_t)0x00000200)
  5427. #define RTC_ISR_ALRAF ((uint32_t)0x00000100)
  5428. #define RTC_ISR_INIT ((uint32_t)0x00000080)
  5429. #define RTC_ISR_INITF ((uint32_t)0x00000040)
  5430. #define RTC_ISR_RSF ((uint32_t)0x00000020)
  5431. #define RTC_ISR_INITS ((uint32_t)0x00000010)
  5432. #define RTC_ISR_SHPF ((uint32_t)0x00000008)
  5433. #define RTC_ISR_WUTWF ((uint32_t)0x00000004)
  5434. #define RTC_ISR_ALRBWF ((uint32_t)0x00000002)
  5435. #define RTC_ISR_ALRAWF ((uint32_t)0x00000001)
  5436. /******************** Bits definition for RTC_PRER register *****************/
  5437. #define RTC_PRER_PREDIV_A ((uint32_t)0x007F0000)
  5438. #define RTC_PRER_PREDIV_S ((uint32_t)0x00007FFF)
  5439. /******************** Bits definition for RTC_WUTR register *****************/
  5440. #define RTC_WUTR_WUT ((uint32_t)0x0000FFFF)
  5441. /******************** Bits definition for RTC_CALIBR register ***************/
  5442. #define RTC_CALIBR_DCS ((uint32_t)0x00000080)
  5443. #define RTC_CALIBR_DC ((uint32_t)0x0000001F)
  5444. /******************** Bits definition for RTC_ALRMAR register ***************/
  5445. #define RTC_ALRMAR_MSK4 ((uint32_t)0x80000000)
  5446. #define RTC_ALRMAR_WDSEL ((uint32_t)0x40000000)
  5447. #define RTC_ALRMAR_DT ((uint32_t)0x30000000)
  5448. #define RTC_ALRMAR_DT_0 ((uint32_t)0x10000000)
  5449. #define RTC_ALRMAR_DT_1 ((uint32_t)0x20000000)
  5450. #define RTC_ALRMAR_DU ((uint32_t)0x0F000000)
  5451. #define RTC_ALRMAR_DU_0 ((uint32_t)0x01000000)
  5452. #define RTC_ALRMAR_DU_1 ((uint32_t)0x02000000)
  5453. #define RTC_ALRMAR_DU_2 ((uint32_t)0x04000000)
  5454. #define RTC_ALRMAR_DU_3 ((uint32_t)0x08000000)
  5455. #define RTC_ALRMAR_MSK3 ((uint32_t)0x00800000)
  5456. #define RTC_ALRMAR_PM ((uint32_t)0x00400000)
  5457. #define RTC_ALRMAR_HT ((uint32_t)0x00300000)
  5458. #define RTC_ALRMAR_HT_0 ((uint32_t)0x00100000)
  5459. #define RTC_ALRMAR_HT_1 ((uint32_t)0x00200000)
  5460. #define RTC_ALRMAR_HU ((uint32_t)0x000F0000)
  5461. #define RTC_ALRMAR_HU_0 ((uint32_t)0x00010000)
  5462. #define RTC_ALRMAR_HU_1 ((uint32_t)0x00020000)
  5463. #define RTC_ALRMAR_HU_2 ((uint32_t)0x00040000)
  5464. #define RTC_ALRMAR_HU_3 ((uint32_t)0x00080000)
  5465. #define RTC_ALRMAR_MSK2 ((uint32_t)0x00008000)
  5466. #define RTC_ALRMAR_MNT ((uint32_t)0x00007000)
  5467. #define RTC_ALRMAR_MNT_0 ((uint32_t)0x00001000)
  5468. #define RTC_ALRMAR_MNT_1 ((uint32_t)0x00002000)
  5469. #define RTC_ALRMAR_MNT_2 ((uint32_t)0x00004000)
  5470. #define RTC_ALRMAR_MNU ((uint32_t)0x00000F00)
  5471. #define RTC_ALRMAR_MNU_0 ((uint32_t)0x00000100)
  5472. #define RTC_ALRMAR_MNU_1 ((uint32_t)0x00000200)
  5473. #define RTC_ALRMAR_MNU_2 ((uint32_t)0x00000400)
  5474. #define RTC_ALRMAR_MNU_3 ((uint32_t)0x00000800)
  5475. #define RTC_ALRMAR_MSK1 ((uint32_t)0x00000080)
  5476. #define RTC_ALRMAR_ST ((uint32_t)0x00000070)
  5477. #define RTC_ALRMAR_ST_0 ((uint32_t)0x00000010)
  5478. #define RTC_ALRMAR_ST_1 ((uint32_t)0x00000020)
  5479. #define RTC_ALRMAR_ST_2 ((uint32_t)0x00000040)
  5480. #define RTC_ALRMAR_SU ((uint32_t)0x0000000F)
  5481. #define RTC_ALRMAR_SU_0 ((uint32_t)0x00000001)
  5482. #define RTC_ALRMAR_SU_1 ((uint32_t)0x00000002)
  5483. #define RTC_ALRMAR_SU_2 ((uint32_t)0x00000004)
  5484. #define RTC_ALRMAR_SU_3 ((uint32_t)0x00000008)
  5485. /******************** Bits definition for RTC_ALRMBR register ***************/
  5486. #define RTC_ALRMBR_MSK4 ((uint32_t)0x80000000)
  5487. #define RTC_ALRMBR_WDSEL ((uint32_t)0x40000000)
  5488. #define RTC_ALRMBR_DT ((uint32_t)0x30000000)
  5489. #define RTC_ALRMBR_DT_0 ((uint32_t)0x10000000)
  5490. #define RTC_ALRMBR_DT_1 ((uint32_t)0x20000000)
  5491. #define RTC_ALRMBR_DU ((uint32_t)0x0F000000)
  5492. #define RTC_ALRMBR_DU_0 ((uint32_t)0x01000000)
  5493. #define RTC_ALRMBR_DU_1 ((uint32_t)0x02000000)
  5494. #define RTC_ALRMBR_DU_2 ((uint32_t)0x04000000)
  5495. #define RTC_ALRMBR_DU_3 ((uint32_t)0x08000000)
  5496. #define RTC_ALRMBR_MSK3 ((uint32_t)0x00800000)
  5497. #define RTC_ALRMBR_PM ((uint32_t)0x00400000)
  5498. #define RTC_ALRMBR_HT ((uint32_t)0x00300000)
  5499. #define RTC_ALRMBR_HT_0 ((uint32_t)0x00100000)
  5500. #define RTC_ALRMBR_HT_1 ((uint32_t)0x00200000)
  5501. #define RTC_ALRMBR_HU ((uint32_t)0x000F0000)
  5502. #define RTC_ALRMBR_HU_0 ((uint32_t)0x00010000)
  5503. #define RTC_ALRMBR_HU_1 ((uint32_t)0x00020000)
  5504. #define RTC_ALRMBR_HU_2 ((uint32_t)0x00040000)
  5505. #define RTC_ALRMBR_HU_3 ((uint32_t)0x00080000)
  5506. #define RTC_ALRMBR_MSK2 ((uint32_t)0x00008000)
  5507. #define RTC_ALRMBR_MNT ((uint32_t)0x00007000)
  5508. #define RTC_ALRMBR_MNT_0 ((uint32_t)0x00001000)
  5509. #define RTC_ALRMBR_MNT_1 ((uint32_t)0x00002000)
  5510. #define RTC_ALRMBR_MNT_2 ((uint32_t)0x00004000)
  5511. #define RTC_ALRMBR_MNU ((uint32_t)0x00000F00)
  5512. #define RTC_ALRMBR_MNU_0 ((uint32_t)0x00000100)
  5513. #define RTC_ALRMBR_MNU_1 ((uint32_t)0x00000200)
  5514. #define RTC_ALRMBR_MNU_2 ((uint32_t)0x00000400)
  5515. #define RTC_ALRMBR_MNU_3 ((uint32_t)0x00000800)
  5516. #define RTC_ALRMBR_MSK1 ((uint32_t)0x00000080)
  5517. #define RTC_ALRMBR_ST ((uint32_t)0x00000070)
  5518. #define RTC_ALRMBR_ST_0 ((uint32_t)0x00000010)
  5519. #define RTC_ALRMBR_ST_1 ((uint32_t)0x00000020)
  5520. #define RTC_ALRMBR_ST_2 ((uint32_t)0x00000040)
  5521. #define RTC_ALRMBR_SU ((uint32_t)0x0000000F)
  5522. #define RTC_ALRMBR_SU_0 ((uint32_t)0x00000001)
  5523. #define RTC_ALRMBR_SU_1 ((uint32_t)0x00000002)
  5524. #define RTC_ALRMBR_SU_2 ((uint32_t)0x00000004)
  5525. #define RTC_ALRMBR_SU_3 ((uint32_t)0x00000008)
  5526. /******************** Bits definition for RTC_WPR register ******************/
  5527. #define RTC_WPR_KEY ((uint32_t)0x000000FF)
  5528. /******************** Bits definition for RTC_SSR register ******************/
  5529. #define RTC_SSR_SS ((uint32_t)0x0000FFFF)
  5530. /******************** Bits definition for RTC_SHIFTR register ***************/
  5531. #define RTC_SHIFTR_SUBFS ((uint32_t)0x00007FFF)
  5532. #define RTC_SHIFTR_ADD1S ((uint32_t)0x80000000)
  5533. /******************** Bits definition for RTC_TSTR register *****************/
  5534. #define RTC_TSTR_PM ((uint32_t)0x00400000)
  5535. #define RTC_TSTR_HT ((uint32_t)0x00300000)
  5536. #define RTC_TSTR_HT_0 ((uint32_t)0x00100000)
  5537. #define RTC_TSTR_HT_1 ((uint32_t)0x00200000)
  5538. #define RTC_TSTR_HU ((uint32_t)0x000F0000)
  5539. #define RTC_TSTR_HU_0 ((uint32_t)0x00010000)
  5540. #define RTC_TSTR_HU_1 ((uint32_t)0x00020000)
  5541. #define RTC_TSTR_HU_2 ((uint32_t)0x00040000)
  5542. #define RTC_TSTR_HU_3 ((uint32_t)0x00080000)
  5543. #define RTC_TSTR_MNT ((uint32_t)0x00007000)
  5544. #define RTC_TSTR_MNT_0 ((uint32_t)0x00001000)
  5545. #define RTC_TSTR_MNT_1 ((uint32_t)0x00002000)
  5546. #define RTC_TSTR_MNT_2 ((uint32_t)0x00004000)
  5547. #define RTC_TSTR_MNU ((uint32_t)0x00000F00)
  5548. #define RTC_TSTR_MNU_0 ((uint32_t)0x00000100)
  5549. #define RTC_TSTR_MNU_1 ((uint32_t)0x00000200)
  5550. #define RTC_TSTR_MNU_2 ((uint32_t)0x00000400)
  5551. #define RTC_TSTR_MNU_3 ((uint32_t)0x00000800)
  5552. #define RTC_TSTR_ST ((uint32_t)0x00000070)
  5553. #define RTC_TSTR_ST_0 ((uint32_t)0x00000010)
  5554. #define RTC_TSTR_ST_1 ((uint32_t)0x00000020)
  5555. #define RTC_TSTR_ST_2 ((uint32_t)0x00000040)
  5556. #define RTC_TSTR_SU ((uint32_t)0x0000000F)
  5557. #define RTC_TSTR_SU_0 ((uint32_t)0x00000001)
  5558. #define RTC_TSTR_SU_1 ((uint32_t)0x00000002)
  5559. #define RTC_TSTR_SU_2 ((uint32_t)0x00000004)
  5560. #define RTC_TSTR_SU_3 ((uint32_t)0x00000008)
  5561. /******************** Bits definition for RTC_TSDR register *****************/
  5562. #define RTC_TSDR_WDU ((uint32_t)0x0000E000)
  5563. #define RTC_TSDR_WDU_0 ((uint32_t)0x00002000)
  5564. #define RTC_TSDR_WDU_1 ((uint32_t)0x00004000)
  5565. #define RTC_TSDR_WDU_2 ((uint32_t)0x00008000)
  5566. #define RTC_TSDR_MT ((uint32_t)0x00001000)
  5567. #define RTC_TSDR_MU ((uint32_t)0x00000F00)
  5568. #define RTC_TSDR_MU_0 ((uint32_t)0x00000100)
  5569. #define RTC_TSDR_MU_1 ((uint32_t)0x00000200)
  5570. #define RTC_TSDR_MU_2 ((uint32_t)0x00000400)
  5571. #define RTC_TSDR_MU_3 ((uint32_t)0x00000800)
  5572. #define RTC_TSDR_DT ((uint32_t)0x00000030)
  5573. #define RTC_TSDR_DT_0 ((uint32_t)0x00000010)
  5574. #define RTC_TSDR_DT_1 ((uint32_t)0x00000020)
  5575. #define RTC_TSDR_DU ((uint32_t)0x0000000F)
  5576. #define RTC_TSDR_DU_0 ((uint32_t)0x00000001)
  5577. #define RTC_TSDR_DU_1 ((uint32_t)0x00000002)
  5578. #define RTC_TSDR_DU_2 ((uint32_t)0x00000004)
  5579. #define RTC_TSDR_DU_3 ((uint32_t)0x00000008)
  5580. /******************** Bits definition for RTC_TSSSR register ****************/
  5581. #define RTC_TSSSR_SS ((uint32_t)0x0000FFFF)
  5582. /******************** Bits definition for RTC_CAL register *****************/
  5583. #define RTC_CALR_CALP ((uint32_t)0x00008000)
  5584. #define RTC_CALR_CALW8 ((uint32_t)0x00004000)
  5585. #define RTC_CALR_CALW16 ((uint32_t)0x00002000)
  5586. #define RTC_CALR_CALM ((uint32_t)0x000001FF)
  5587. #define RTC_CALR_CALM_0 ((uint32_t)0x00000001)
  5588. #define RTC_CALR_CALM_1 ((uint32_t)0x00000002)
  5589. #define RTC_CALR_CALM_2 ((uint32_t)0x00000004)
  5590. #define RTC_CALR_CALM_3 ((uint32_t)0x00000008)
  5591. #define RTC_CALR_CALM_4 ((uint32_t)0x00000010)
  5592. #define RTC_CALR_CALM_5 ((uint32_t)0x00000020)
  5593. #define RTC_CALR_CALM_6 ((uint32_t)0x00000040)
  5594. #define RTC_CALR_CALM_7 ((uint32_t)0x00000080)
  5595. #define RTC_CALR_CALM_8 ((uint32_t)0x00000100)
  5596. /******************** Bits definition for RTC_TAFCR register ****************/
  5597. #define RTC_TAFCR_ALARMOUTTYPE ((uint32_t)0x00040000)
  5598. #define RTC_TAFCR_TSINSEL ((uint32_t)0x00020000)
  5599. #define RTC_TAFCR_TAMPINSEL ((uint32_t)0x00010000)
  5600. #define RTC_TAFCR_TAMPPUDIS ((uint32_t)0x00008000)
  5601. #define RTC_TAFCR_TAMPPRCH ((uint32_t)0x00006000)
  5602. #define RTC_TAFCR_TAMPPRCH_0 ((uint32_t)0x00002000)
  5603. #define RTC_TAFCR_TAMPPRCH_1 ((uint32_t)0x00004000)
  5604. #define RTC_TAFCR_TAMPFLT ((uint32_t)0x00001800)
  5605. #define RTC_TAFCR_TAMPFLT_0 ((uint32_t)0x00000800)
  5606. #define RTC_TAFCR_TAMPFLT_1 ((uint32_t)0x00001000)
  5607. #define RTC_TAFCR_TAMPFREQ ((uint32_t)0x00000700)
  5608. #define RTC_TAFCR_TAMPFREQ_0 ((uint32_t)0x00000100)
  5609. #define RTC_TAFCR_TAMPFREQ_1 ((uint32_t)0x00000200)
  5610. #define RTC_TAFCR_TAMPFREQ_2 ((uint32_t)0x00000400)
  5611. #define RTC_TAFCR_TAMPTS ((uint32_t)0x00000080)
  5612. #define RTC_TAFCR_TAMP2TRG ((uint32_t)0x00000010)
  5613. #define RTC_TAFCR_TAMP2E ((uint32_t)0x00000008)
  5614. #define RTC_TAFCR_TAMPIE ((uint32_t)0x00000004)
  5615. #define RTC_TAFCR_TAMP1TRG ((uint32_t)0x00000002)
  5616. #define RTC_TAFCR_TAMP1E ((uint32_t)0x00000001)
  5617. /******************** Bits definition for RTC_ALRMASSR register *************/
  5618. #define RTC_ALRMASSR_MASKSS ((uint32_t)0x0F000000)
  5619. #define RTC_ALRMASSR_MASKSS_0 ((uint32_t)0x01000000)
  5620. #define RTC_ALRMASSR_MASKSS_1 ((uint32_t)0x02000000)
  5621. #define RTC_ALRMASSR_MASKSS_2 ((uint32_t)0x04000000)
  5622. #define RTC_ALRMASSR_MASKSS_3 ((uint32_t)0x08000000)
  5623. #define RTC_ALRMASSR_SS ((uint32_t)0x00007FFF)
  5624. /******************** Bits definition for RTC_ALRMBSSR register *************/
  5625. #define RTC_ALRMBSSR_MASKSS ((uint32_t)0x0F000000)
  5626. #define RTC_ALRMBSSR_MASKSS_0 ((uint32_t)0x01000000)
  5627. #define RTC_ALRMBSSR_MASKSS_1 ((uint32_t)0x02000000)
  5628. #define RTC_ALRMBSSR_MASKSS_2 ((uint32_t)0x04000000)
  5629. #define RTC_ALRMBSSR_MASKSS_3 ((uint32_t)0x08000000)
  5630. #define RTC_ALRMBSSR_SS ((uint32_t)0x00007FFF)
  5631. /******************** Bits definition for RTC_BKP0R register ****************/
  5632. #define RTC_BKP0R ((uint32_t)0xFFFFFFFF)
  5633. /******************** Bits definition for RTC_BKP1R register ****************/
  5634. #define RTC_BKP1R ((uint32_t)0xFFFFFFFF)
  5635. /******************** Bits definition for RTC_BKP2R register ****************/
  5636. #define RTC_BKP2R ((uint32_t)0xFFFFFFFF)
  5637. /******************** Bits definition for RTC_BKP3R register ****************/
  5638. #define RTC_BKP3R ((uint32_t)0xFFFFFFFF)
  5639. /******************** Bits definition for RTC_BKP4R register ****************/
  5640. #define RTC_BKP4R ((uint32_t)0xFFFFFFFF)
  5641. /******************** Bits definition for RTC_BKP5R register ****************/
  5642. #define RTC_BKP5R ((uint32_t)0xFFFFFFFF)
  5643. /******************** Bits definition for RTC_BKP6R register ****************/
  5644. #define RTC_BKP6R ((uint32_t)0xFFFFFFFF)
  5645. /******************** Bits definition for RTC_BKP7R register ****************/
  5646. #define RTC_BKP7R ((uint32_t)0xFFFFFFFF)
  5647. /******************** Bits definition for RTC_BKP8R register ****************/
  5648. #define RTC_BKP8R ((uint32_t)0xFFFFFFFF)
  5649. /******************** Bits definition for RTC_BKP9R register ****************/
  5650. #define RTC_BKP9R ((uint32_t)0xFFFFFFFF)
  5651. /******************** Bits definition for RTC_BKP10R register ***************/
  5652. #define RTC_BKP10R ((uint32_t)0xFFFFFFFF)
  5653. /******************** Bits definition for RTC_BKP11R register ***************/
  5654. #define RTC_BKP11R ((uint32_t)0xFFFFFFFF)
  5655. /******************** Bits definition for RTC_BKP12R register ***************/
  5656. #define RTC_BKP12R ((uint32_t)0xFFFFFFFF)
  5657. /******************** Bits definition for RTC_BKP13R register ***************/
  5658. #define RTC_BKP13R ((uint32_t)0xFFFFFFFF)
  5659. /******************** Bits definition for RTC_BKP14R register ***************/
  5660. #define RTC_BKP14R ((uint32_t)0xFFFFFFFF)
  5661. /******************** Bits definition for RTC_BKP15R register ***************/
  5662. #define RTC_BKP15R ((uint32_t)0xFFFFFFFF)
  5663. /******************** Bits definition for RTC_BKP16R register ***************/
  5664. #define RTC_BKP16R ((uint32_t)0xFFFFFFFF)
  5665. /******************** Bits definition for RTC_BKP17R register ***************/
  5666. #define RTC_BKP17R ((uint32_t)0xFFFFFFFF)
  5667. /******************** Bits definition for RTC_BKP18R register ***************/
  5668. #define RTC_BKP18R ((uint32_t)0xFFFFFFFF)
  5669. /******************** Bits definition for RTC_BKP19R register ***************/
  5670. #define RTC_BKP19R ((uint32_t)0xFFFFFFFF)
  5671. /******************************************************************************/
  5672. /* */
  5673. /* Serial Audio Interface */
  5674. /* */
  5675. /******************************************************************************/
  5676. /******************** Bit definition for SAI_GCR register *******************/
  5677. #define SAI_GCR_SYNCIN ((uint32_t)0x00000003) /*!<SYNCIN[1:0] bits (Synchronization Inputs) */
  5678. #define SAI_GCR_SYNCIN_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  5679. #define SAI_GCR_SYNCIN_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  5680. #define SAI_GCR_SYNCOUT ((uint32_t)0x00000030) /*!<SYNCOUT[1:0] bits (Synchronization Outputs) */
  5681. #define SAI_GCR_SYNCOUT_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  5682. #define SAI_GCR_SYNCOUT_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  5683. /******************* Bit definition for SAI_xCR1 register *******************/
  5684. #define SAI_xCR1_MODE ((uint32_t)0x00000003) /*!<MODE[1:0] bits (Audio Block Mode) */
  5685. #define SAI_xCR1_MODE_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  5686. #define SAI_xCR1_MODE_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  5687. #define SAI_xCR1_PRTCFG ((uint32_t)0x0000000C) /*!<PRTCFG[1:0] bits (Protocol Configuration) */
  5688. #define SAI_xCR1_PRTCFG_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  5689. #define SAI_xCR1_PRTCFG_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  5690. #define SAI_xCR1_DS ((uint32_t)0x000000E0) /*!<DS[1:0] bits (Data Size) */
  5691. #define SAI_xCR1_DS_0 ((uint32_t)0x00000020) /*!<Bit 0 */
  5692. #define SAI_xCR1_DS_1 ((uint32_t)0x00000040) /*!<Bit 1 */
  5693. #define SAI_xCR1_DS_2 ((uint32_t)0x00000080) /*!<Bit 2 */
  5694. #define SAI_xCR1_LSBFIRST ((uint32_t)0x00000100) /*!<LSB First Configuration */
  5695. #define SAI_xCR1_CKSTR ((uint32_t)0x00000200) /*!<ClocK STRobing edge */
  5696. #define SAI_xCR1_SYNCEN ((uint32_t)0x00000C00) /*!<SYNCEN[1:0](SYNChronization ENable) */
  5697. #define SAI_xCR1_SYNCEN_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  5698. #define SAI_xCR1_SYNCEN_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  5699. #define SAI_xCR1_MONO ((uint32_t)0x00001000) /*!<Mono mode */
  5700. #define SAI_xCR1_OUTDRIV ((uint32_t)0x00002000) /*!<Output Drive */
  5701. #define SAI_xCR1_SAIEN ((uint32_t)0x00010000) /*!<Audio Block enable */
  5702. #define SAI_xCR1_DMAEN ((uint32_t)0x00020000) /*!<DMA enable */
  5703. #define SAI_xCR1_NODIV ((uint32_t)0x00080000) /*!<No Divider Configuration */
  5704. #define SAI_xCR1_MCKDIV ((uint32_t)0x00F00000) /*!<MCKDIV[3:0] (Master ClocK Divider) */
  5705. #define SAI_xCR1_MCKDIV_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  5706. #define SAI_xCR1_MCKDIV_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  5707. #define SAI_xCR1_MCKDIV_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  5708. #define SAI_xCR1_MCKDIV_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  5709. /******************* Bit definition for SAI_xCR2 register *******************/
  5710. #define SAI_xCR2_FTH ((uint32_t)0x00000007) /*!<FTH[2:0](Fifo THreshold) */
  5711. #define SAI_xCR2_FTH_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  5712. #define SAI_xCR2_FTH_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  5713. #define SAI_xCR2_FTH_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  5714. #define SAI_xCR2_FFLUSH ((uint32_t)0x00000008) /*!<Fifo FLUSH */
  5715. #define SAI_xCR2_TRIS ((uint32_t)0x00000010) /*!<TRIState Management on data line */
  5716. #define SAI_xCR2_MUTE ((uint32_t)0x00000020) /*!<Mute mode */
  5717. #define SAI_xCR2_MUTEVAL ((uint32_t)0x00000040) /*!<Muate value */
  5718. #define SAI_xCR2_MUTECNT ((uint32_t)0x00001F80) /*!<MUTECNT[5:0] (MUTE counter) */
  5719. #define SAI_xCR2_MUTECNT_0 ((uint32_t)0x00000080) /*!<Bit 0 */
  5720. #define SAI_xCR2_MUTECNT_1 ((uint32_t)0x00000100) /*!<Bit 1 */
  5721. #define SAI_xCR2_MUTECNT_2 ((uint32_t)0x00000200) /*!<Bit 2 */
  5722. #define SAI_xCR2_MUTECNT_3 ((uint32_t)0x00000400) /*!<Bit 3 */
  5723. #define SAI_xCR2_MUTECNT_4 ((uint32_t)0x00000800) /*!<Bit 4 */
  5724. #define SAI_xCR2_MUTECNT_5 ((uint32_t)0x00001000) /*!<Bit 5 */
  5725. #define SAI_xCR2_CPL ((uint32_t)0x00080000) /*!< Complement Bit */
  5726. #define SAI_xCR2_COMP ((uint32_t)0x0000C000) /*!<COMP[1:0] (Companding mode) */
  5727. #define SAI_xCR2_COMP_0 ((uint32_t)0x00004000) /*!<Bit 0 */
  5728. #define SAI_xCR2_COMP_1 ((uint32_t)0x00008000) /*!<Bit 1 */
  5729. /****************** Bit definition for SAI_xFRCR register *******************/
  5730. #define SAI_xFRCR_FRL ((uint32_t)0x000000FF) /*!<FRL[1:0](Frame length) */
  5731. #define SAI_xFRCR_FRL_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  5732. #define SAI_xFRCR_FRL_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  5733. #define SAI_xFRCR_FRL_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  5734. #define SAI_xFRCR_FRL_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  5735. #define SAI_xFRCR_FRL_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  5736. #define SAI_xFRCR_FRL_5 ((uint32_t)0x00000020) /*!<Bit 5 */
  5737. #define SAI_xFRCR_FRL_6 ((uint32_t)0x00000040) /*!<Bit 6 */
  5738. #define SAI_xFRCR_FRL_7 ((uint32_t)0x00000080) /*!<Bit 7 */
  5739. #define SAI_xFRCR_FSALL ((uint32_t)0x00007F00) /*!<FRL[1:0] (Frame synchronization active level length) */
  5740. #define SAI_xFRCR_FSALL_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  5741. #define SAI_xFRCR_FSALL_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  5742. #define SAI_xFRCR_FSALL_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  5743. #define SAI_xFRCR_FSALL_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  5744. #define SAI_xFRCR_FSALL_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  5745. #define SAI_xFRCR_FSALL_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  5746. #define SAI_xFRCR_FSALL_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  5747. #define SAI_xFRCR_FSDEF ((uint32_t)0x00010000) /*!< Frame Synchronization Definition */
  5748. #define SAI_xFRCR_FSPO ((uint32_t)0x00020000) /*!<Frame Synchronization POLarity */
  5749. #define SAI_xFRCR_FSOFF ((uint32_t)0x00040000) /*!<Frame Synchronization OFFset */
  5750. /****************** Bit definition for SAI_xSLOTR register *******************/
  5751. #define SAI_xSLOTR_FBOFF ((uint32_t)0x0000001F) /*!<FRL[4:0](First Bit Offset) */
  5752. #define SAI_xSLOTR_FBOFF_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  5753. #define SAI_xSLOTR_FBOFF_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  5754. #define SAI_xSLOTR_FBOFF_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  5755. #define SAI_xSLOTR_FBOFF_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  5756. #define SAI_xSLOTR_FBOFF_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  5757. #define SAI_xSLOTR_SLOTSZ ((uint32_t)0x000000C0) /*!<SLOTSZ[1:0] (Slot size) */
  5758. #define SAI_xSLOTR_SLOTSZ_0 ((uint32_t)0x00000040) /*!<Bit 0 */
  5759. #define SAI_xSLOTR_SLOTSZ_1 ((uint32_t)0x00000080) /*!<Bit 1 */
  5760. #define SAI_xSLOTR_NBSLOT ((uint32_t)0x00000F00) /*!<NBSLOT[3:0] (Number of Slot in audio Frame) */
  5761. #define SAI_xSLOTR_NBSLOT_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  5762. #define SAI_xSLOTR_NBSLOT_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  5763. #define SAI_xSLOTR_NBSLOT_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  5764. #define SAI_xSLOTR_NBSLOT_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  5765. #define SAI_xSLOTR_SLOTEN ((uint32_t)0xFFFF0000) /*!<SLOTEN[15:0] (Slot Enable) */
  5766. /******************* Bit definition for SAI_xIMR register *******************/
  5767. #define SAI_xIMR_OVRUDRIE ((uint32_t)0x00000001) /*!<Overrun underrun interrupt enable */
  5768. #define SAI_xIMR_MUTEDETIE ((uint32_t)0x00000002) /*!<Mute detection interrupt enable */
  5769. #define SAI_xIMR_WCKCFGIE ((uint32_t)0x00000004) /*!<Wrong Clock Configuration interrupt enable */
  5770. #define SAI_xIMR_FREQIE ((uint32_t)0x00000008) /*!<FIFO request interrupt enable */
  5771. #define SAI_xIMR_CNRDYIE ((uint32_t)0x00000010) /*!<Codec not ready interrupt enable */
  5772. #define SAI_xIMR_AFSDETIE ((uint32_t)0x00000020) /*!<Anticipated frame synchronization detection interrupt enable */
  5773. #define SAI_xIMR_LFSDETIE ((uint32_t)0x00000040) /*!<Late frame synchronization detection interrupt enable */
  5774. /******************** Bit definition for SAI_xSR register *******************/
  5775. #define SAI_xSR_OVRUDR ((uint32_t)0x00000001) /*!<Overrun underrun */
  5776. #define SAI_xSR_MUTEDET ((uint32_t)0x00000002) /*!<Mute detection */
  5777. #define SAI_xSR_WCKCFG ((uint32_t)0x00000004) /*!<Wrong Clock Configuration */
  5778. #define SAI_xSR_FREQ ((uint32_t)0x00000008) /*!<FIFO request */
  5779. #define SAI_xSR_CNRDY ((uint32_t)0x00000010) /*!<Codec not ready */
  5780. #define SAI_xSR_AFSDET ((uint32_t)0x00000020) /*!<Anticipated frame synchronization detection */
  5781. #define SAI_xSR_LFSDET ((uint32_t)0x00000040) /*!<Late frame synchronization detection */
  5782. #define SAI_xSR_FLVL ((uint32_t)0x00070000) /*!<FLVL[2:0] (FIFO Level Threshold) */
  5783. #define SAI_xSR_FLVL_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  5784. #define SAI_xSR_FLVL_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  5785. #define SAI_xSR_FLVL_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  5786. /****************** Bit definition for SAI_xCLRFR register ******************/
  5787. #define SAI_xCLRFR_COVRUDR ((uint32_t)0x00000001) /*!<Clear Overrun underrun */
  5788. #define SAI_xCLRFR_CMUTEDET ((uint32_t)0x00000002) /*!<Clear Mute detection */
  5789. #define SAI_xCLRFR_CWCKCFG ((uint32_t)0x00000004) /*!<Clear Wrong Clock Configuration */
  5790. #define SAI_xCLRFR_CFREQ ((uint32_t)0x00000008) /*!<Clear FIFO request */
  5791. #define SAI_xCLRFR_CCNRDY ((uint32_t)0x00000010) /*!<Clear Codec not ready */
  5792. #define SAI_xCLRFR_CAFSDET ((uint32_t)0x00000020) /*!<Clear Anticipated frame synchronization detection */
  5793. #define SAI_xCLRFR_CLFSDET ((uint32_t)0x00000040) /*!<Clear Late frame synchronization detection */
  5794. /****************** Bit definition for SAI_xDR register ******************/
  5795. #define SAI_xDR_DATA ((uint32_t)0xFFFFFFFF)
  5796. /******************************************************************************/
  5797. /* */
  5798. /* SD host Interface */
  5799. /* */
  5800. /******************************************************************************/
  5801. /****************** Bit definition for SDIO_POWER register ******************/
  5802. #define SDIO_POWER_PWRCTRL ((uint32_t)0x03) /*!<PWRCTRL[1:0] bits (Power supply control bits) */
  5803. #define SDIO_POWER_PWRCTRL_0 ((uint32_t)0x01) /*!<Bit 0 */
  5804. #define SDIO_POWER_PWRCTRL_1 ((uint32_t)0x02) /*!<Bit 1 */
  5805. /****************** Bit definition for SDIO_CLKCR register ******************/
  5806. #define SDIO_CLKCR_CLKDIV ((uint32_t)0x00FF) /*!<Clock divide factor */
  5807. #define SDIO_CLKCR_CLKEN ((uint32_t)0x0100) /*!<Clock enable bit */
  5808. #define SDIO_CLKCR_PWRSAV ((uint32_t)0x0200) /*!<Power saving configuration bit */
  5809. #define SDIO_CLKCR_BYPASS ((uint32_t)0x0400) /*!<Clock divider bypass enable bit */
  5810. #define SDIO_CLKCR_WIDBUS ((uint32_t)0x1800) /*!<WIDBUS[1:0] bits (Wide bus mode enable bit) */
  5811. #define SDIO_CLKCR_WIDBUS_0 ((uint32_t)0x0800) /*!<Bit 0 */
  5812. #define SDIO_CLKCR_WIDBUS_1 ((uint32_t)0x1000) /*!<Bit 1 */
  5813. #define SDIO_CLKCR_NEGEDGE ((uint32_t)0x2000) /*!<SDIO_CK dephasing selection bit */
  5814. #define SDIO_CLKCR_HWFC_EN ((uint32_t)0x4000) /*!<HW Flow Control enable */
  5815. /******************* Bit definition for SDIO_ARG register *******************/
  5816. #define SDIO_ARG_CMDARG ((uint32_t)0xFFFFFFFF) /*!<Command argument */
  5817. /******************* Bit definition for SDIO_CMD register *******************/
  5818. #define SDIO_CMD_CMDINDEX ((uint32_t)0x003F) /*!<Command Index */
  5819. #define SDIO_CMD_WAITRESP ((uint32_t)0x00C0) /*!<WAITRESP[1:0] bits (Wait for response bits) */
  5820. #define SDIO_CMD_WAITRESP_0 ((uint32_t)0x0040) /*!< Bit 0 */
  5821. #define SDIO_CMD_WAITRESP_1 ((uint32_t)0x0080) /*!< Bit 1 */
  5822. #define SDIO_CMD_WAITINT ((uint32_t)0x0100) /*!<CPSM Waits for Interrupt Request */
  5823. #define SDIO_CMD_WAITPEND ((uint32_t)0x0200) /*!<CPSM Waits for ends of data transfer (CmdPend internal signal) */
  5824. #define SDIO_CMD_CPSMEN ((uint32_t)0x0400) /*!<Command path state machine (CPSM) Enable bit */
  5825. #define SDIO_CMD_SDIOSUSPEND ((uint32_t)0x0800) /*!<SD I/O suspend command */
  5826. #define SDIO_CMD_ENCMDCOMPL ((uint32_t)0x1000) /*!<Enable CMD completion */
  5827. #define SDIO_CMD_NIEN ((uint32_t)0x2000) /*!<Not Interrupt Enable */
  5828. #define SDIO_CMD_CEATACMD ((uint32_t)0x4000) /*!<CE-ATA command */
  5829. /***************** Bit definition for SDIO_RESPCMD register *****************/
  5830. #define SDIO_RESPCMD_RESPCMD ((uint32_t)0x3F) /*!<Response command index */
  5831. /****************** Bit definition for SDIO_RESP0 register ******************/
  5832. #define SDIO_RESP0_CARDSTATUS0 ((uint32_t)0xFFFFFFFF) /*!<Card Status */
  5833. /****************** Bit definition for SDIO_RESP1 register ******************/
  5834. #define SDIO_RESP1_CARDSTATUS1 ((uint32_t)0xFFFFFFFF) /*!<Card Status */
  5835. /****************** Bit definition for SDIO_RESP2 register ******************/
  5836. #define SDIO_RESP2_CARDSTATUS2 ((uint32_t)0xFFFFFFFF) /*!<Card Status */
  5837. /****************** Bit definition for SDIO_RESP3 register ******************/
  5838. #define SDIO_RESP3_CARDSTATUS3 ((uint32_t)0xFFFFFFFF) /*!<Card Status */
  5839. /****************** Bit definition for SDIO_RESP4 register ******************/
  5840. #define SDIO_RESP4_CARDSTATUS4 ((uint32_t)0xFFFFFFFF) /*!<Card Status */
  5841. /****************** Bit definition for SDIO_DTIMER register *****************/
  5842. #define SDIO_DTIMER_DATATIME ((uint32_t)0xFFFFFFFF) /*!<Data timeout period. */
  5843. /****************** Bit definition for SDIO_DLEN register *******************/
  5844. #define SDIO_DLEN_DATALENGTH ((uint32_t)0x01FFFFFF) /*!<Data length value */
  5845. /****************** Bit definition for SDIO_DCTRL register ******************/
  5846. #define SDIO_DCTRL_DTEN ((uint32_t)0x0001) /*!<Data transfer enabled bit */
  5847. #define SDIO_DCTRL_DTDIR ((uint32_t)0x0002) /*!<Data transfer direction selection */
  5848. #define SDIO_DCTRL_DTMODE ((uint32_t)0x0004) /*!<Data transfer mode selection */
  5849. #define SDIO_DCTRL_DMAEN ((uint32_t)0x0008) /*!<DMA enabled bit */
  5850. #define SDIO_DCTRL_DBLOCKSIZE ((uint32_t)0x00F0) /*!<DBLOCKSIZE[3:0] bits (Data block size) */
  5851. #define SDIO_DCTRL_DBLOCKSIZE_0 ((uint32_t)0x0010) /*!<Bit 0 */
  5852. #define SDIO_DCTRL_DBLOCKSIZE_1 ((uint32_t)0x0020) /*!<Bit 1 */
  5853. #define SDIO_DCTRL_DBLOCKSIZE_2 ((uint32_t)0x0040) /*!<Bit 2 */
  5854. #define SDIO_DCTRL_DBLOCKSIZE_3 ((uint32_t)0x0080) /*!<Bit 3 */
  5855. #define SDIO_DCTRL_RWSTART ((uint32_t)0x0100) /*!<Read wait start */
  5856. #define SDIO_DCTRL_RWSTOP ((uint32_t)0x0200) /*!<Read wait stop */
  5857. #define SDIO_DCTRL_RWMOD ((uint32_t)0x0400) /*!<Read wait mode */
  5858. #define SDIO_DCTRL_SDIOEN ((uint32_t)0x0800) /*!<SD I/O enable functions */
  5859. /****************** Bit definition for SDIO_DCOUNT register *****************/
  5860. #define SDIO_DCOUNT_DATACOUNT ((uint32_t)0x01FFFFFF) /*!<Data count value */
  5861. /****************** Bit definition for SDIO_STA register ********************/
  5862. #define SDIO_STA_CCRCFAIL ((uint32_t)0x00000001) /*!<Command response received (CRC check failed) */
  5863. #define SDIO_STA_DCRCFAIL ((uint32_t)0x00000002) /*!<Data block sent/received (CRC check failed) */
  5864. #define SDIO_STA_CTIMEOUT ((uint32_t)0x00000004) /*!<Command response timeout */
  5865. #define SDIO_STA_DTIMEOUT ((uint32_t)0x00000008) /*!<Data timeout */
  5866. #define SDIO_STA_TXUNDERR ((uint32_t)0x00000010) /*!<Transmit FIFO underrun error */
  5867. #define SDIO_STA_RXOVERR ((uint32_t)0x00000020) /*!<Received FIFO overrun error */
  5868. #define SDIO_STA_CMDREND ((uint32_t)0x00000040) /*!<Command response received (CRC check passed) */
  5869. #define SDIO_STA_CMDSENT ((uint32_t)0x00000080) /*!<Command sent (no response required) */
  5870. #define SDIO_STA_DATAEND ((uint32_t)0x00000100) /*!<Data end (data counter, SDIDCOUNT, is zero) */
  5871. #define SDIO_STA_STBITERR ((uint32_t)0x00000200) /*!<Start bit not detected on all data signals in wide bus mode */
  5872. #define SDIO_STA_DBCKEND ((uint32_t)0x00000400) /*!<Data block sent/received (CRC check passed) */
  5873. #define SDIO_STA_CMDACT ((uint32_t)0x00000800) /*!<Command transfer in progress */
  5874. #define SDIO_STA_TXACT ((uint32_t)0x00001000) /*!<Data transmit in progress */
  5875. #define SDIO_STA_RXACT ((uint32_t)0x00002000) /*!<Data receive in progress */
  5876. #define SDIO_STA_TXFIFOHE ((uint32_t)0x00004000) /*!<Transmit FIFO Half Empty: at least 8 words can be written into the FIFO */
  5877. #define SDIO_STA_RXFIFOHF ((uint32_t)0x00008000) /*!<Receive FIFO Half Full: there are at least 8 words in the FIFO */
  5878. #define SDIO_STA_TXFIFOF ((uint32_t)0x00010000) /*!<Transmit FIFO full */
  5879. #define SDIO_STA_RXFIFOF ((uint32_t)0x00020000) /*!<Receive FIFO full */
  5880. #define SDIO_STA_TXFIFOE ((uint32_t)0x00040000) /*!<Transmit FIFO empty */
  5881. #define SDIO_STA_RXFIFOE ((uint32_t)0x00080000) /*!<Receive FIFO empty */
  5882. #define SDIO_STA_TXDAVL ((uint32_t)0x00100000) /*!<Data available in transmit FIFO */
  5883. #define SDIO_STA_RXDAVL ((uint32_t)0x00200000) /*!<Data available in receive FIFO */
  5884. #define SDIO_STA_SDIOIT ((uint32_t)0x00400000) /*!<SDIO interrupt received */
  5885. #define SDIO_STA_CEATAEND ((uint32_t)0x00800000) /*!<CE-ATA command completion signal received for CMD61 */
  5886. /******************* Bit definition for SDIO_ICR register *******************/
  5887. #define SDIO_ICR_CCRCFAILC ((uint32_t)0x00000001) /*!<CCRCFAIL flag clear bit */
  5888. #define SDIO_ICR_DCRCFAILC ((uint32_t)0x00000002) /*!<DCRCFAIL flag clear bit */
  5889. #define SDIO_ICR_CTIMEOUTC ((uint32_t)0x00000004) /*!<CTIMEOUT flag clear bit */
  5890. #define SDIO_ICR_DTIMEOUTC ((uint32_t)0x00000008) /*!<DTIMEOUT flag clear bit */
  5891. #define SDIO_ICR_TXUNDERRC ((uint32_t)0x00000010) /*!<TXUNDERR flag clear bit */
  5892. #define SDIO_ICR_RXOVERRC ((uint32_t)0x00000020) /*!<RXOVERR flag clear bit */
  5893. #define SDIO_ICR_CMDRENDC ((uint32_t)0x00000040) /*!<CMDREND flag clear bit */
  5894. #define SDIO_ICR_CMDSENTC ((uint32_t)0x00000080) /*!<CMDSENT flag clear bit */
  5895. #define SDIO_ICR_DATAENDC ((uint32_t)0x00000100) /*!<DATAEND flag clear bit */
  5896. #define SDIO_ICR_STBITERRC ((uint32_t)0x00000200) /*!<STBITERR flag clear bit */
  5897. #define SDIO_ICR_DBCKENDC ((uint32_t)0x00000400) /*!<DBCKEND flag clear bit */
  5898. #define SDIO_ICR_SDIOITC ((uint32_t)0x00400000) /*!<SDIOIT flag clear bit */
  5899. #define SDIO_ICR_CEATAENDC ((uint32_t)0x00800000) /*!<CEATAEND flag clear bit */
  5900. /****************** Bit definition for SDIO_MASK register *******************/
  5901. #define SDIO_MASK_CCRCFAILIE ((uint32_t)0x00000001) /*!<Command CRC Fail Interrupt Enable */
  5902. #define SDIO_MASK_DCRCFAILIE ((uint32_t)0x00000002) /*!<Data CRC Fail Interrupt Enable */
  5903. #define SDIO_MASK_CTIMEOUTIE ((uint32_t)0x00000004) /*!<Command TimeOut Interrupt Enable */
  5904. #define SDIO_MASK_DTIMEOUTIE ((uint32_t)0x00000008) /*!<Data TimeOut Interrupt Enable */
  5905. #define SDIO_MASK_TXUNDERRIE ((uint32_t)0x00000010) /*!<Tx FIFO UnderRun Error Interrupt Enable */
  5906. #define SDIO_MASK_RXOVERRIE ((uint32_t)0x00000020) /*!<Rx FIFO OverRun Error Interrupt Enable */
  5907. #define SDIO_MASK_CMDRENDIE ((uint32_t)0x00000040) /*!<Command Response Received Interrupt Enable */
  5908. #define SDIO_MASK_CMDSENTIE ((uint32_t)0x00000080) /*!<Command Sent Interrupt Enable */
  5909. #define SDIO_MASK_DATAENDIE ((uint32_t)0x00000100) /*!<Data End Interrupt Enable */
  5910. #define SDIO_MASK_STBITERRIE ((uint32_t)0x00000200) /*!<Start Bit Error Interrupt Enable */
  5911. #define SDIO_MASK_DBCKENDIE ((uint32_t)0x00000400) /*!<Data Block End Interrupt Enable */
  5912. #define SDIO_MASK_CMDACTIE ((uint32_t)0x00000800) /*!<CCommand Acting Interrupt Enable */
  5913. #define SDIO_MASK_TXACTIE ((uint32_t)0x00001000) /*!<Data Transmit Acting Interrupt Enable */
  5914. #define SDIO_MASK_RXACTIE ((uint32_t)0x00002000) /*!<Data receive acting interrupt enabled */
  5915. #define SDIO_MASK_TXFIFOHEIE ((uint32_t)0x00004000) /*!<Tx FIFO Half Empty interrupt Enable */
  5916. #define SDIO_MASK_RXFIFOHFIE ((uint32_t)0x00008000) /*!<Rx FIFO Half Full interrupt Enable */
  5917. #define SDIO_MASK_TXFIFOFIE ((uint32_t)0x00010000) /*!<Tx FIFO Full interrupt Enable */
  5918. #define SDIO_MASK_RXFIFOFIE ((uint32_t)0x00020000) /*!<Rx FIFO Full interrupt Enable */
  5919. #define SDIO_MASK_TXFIFOEIE ((uint32_t)0x00040000) /*!<Tx FIFO Empty interrupt Enable */
  5920. #define SDIO_MASK_RXFIFOEIE ((uint32_t)0x00080000) /*!<Rx FIFO Empty interrupt Enable */
  5921. #define SDIO_MASK_TXDAVLIE ((uint32_t)0x00100000) /*!<Data available in Tx FIFO interrupt Enable */
  5922. #define SDIO_MASK_RXDAVLIE ((uint32_t)0x00200000) /*!<Data available in Rx FIFO interrupt Enable */
  5923. #define SDIO_MASK_SDIOITIE ((uint32_t)0x00400000) /*!<SDIO Mode Interrupt Received interrupt Enable */
  5924. #define SDIO_MASK_CEATAENDIE ((uint32_t)0x00800000) /*!<CE-ATA command completion signal received Interrupt Enable */
  5925. /***************** Bit definition for SDIO_FIFOCNT register *****************/
  5926. #define SDIO_FIFOCNT_FIFOCOUNT ((uint32_t)0x00FFFFFF) /*!<Remaining number of words to be written to or read from the FIFO */
  5927. /****************** Bit definition for SDIO_FIFO register *******************/
  5928. #define SDIO_FIFO_FIFODATA ((uint32_t)0xFFFFFFFF) /*!<Receive and transmit FIFO data */
  5929. /******************************************************************************/
  5930. /* */
  5931. /* Serial Peripheral Interface */
  5932. /* */
  5933. /******************************************************************************/
  5934. /******************* Bit definition for SPI_CR1 register ********************/
  5935. #define SPI_CR1_CPHA ((uint32_t)0x00000001) /*!<Clock Phase */
  5936. #define SPI_CR1_CPOL ((uint32_t)0x00000002) /*!<Clock Polarity */
  5937. #define SPI_CR1_MSTR ((uint32_t)0x00000004) /*!<Master Selection */
  5938. #define SPI_CR1_BR ((uint32_t)0x00000038) /*!<BR[2:0] bits (Baud Rate Control) */
  5939. #define SPI_CR1_BR_0 ((uint32_t)0x00000008) /*!<Bit 0 */
  5940. #define SPI_CR1_BR_1 ((uint32_t)0x00000010) /*!<Bit 1 */
  5941. #define SPI_CR1_BR_2 ((uint32_t)0x00000020) /*!<Bit 2 */
  5942. #define SPI_CR1_SPE ((uint32_t)0x00000040) /*!<SPI Enable */
  5943. #define SPI_CR1_LSBFIRST ((uint32_t)0x00000080) /*!<Frame Format */
  5944. #define SPI_CR1_SSI ((uint32_t)0x00000100) /*!<Internal slave select */
  5945. #define SPI_CR1_SSM ((uint32_t)0x00000200) /*!<Software slave management */
  5946. #define SPI_CR1_RXONLY ((uint32_t)0x00000400) /*!<Receive only */
  5947. #define SPI_CR1_DFF ((uint32_t)0x00000800) /*!<Data Frame Format */
  5948. #define SPI_CR1_CRCNEXT ((uint32_t)0x00001000) /*!<Transmit CRC next */
  5949. #define SPI_CR1_CRCEN ((uint32_t)0x00002000) /*!<Hardware CRC calculation enable */
  5950. #define SPI_CR1_BIDIOE ((uint32_t)0x00004000) /*!<Output enable in bidirectional mode */
  5951. #define SPI_CR1_BIDIMODE ((uint32_t)0x00008000) /*!<Bidirectional data mode enable */
  5952. /******************* Bit definition for SPI_CR2 register ********************/
  5953. #define SPI_CR2_RXDMAEN ((uint32_t)0x00000001) /*!<Rx Buffer DMA Enable */
  5954. #define SPI_CR2_TXDMAEN ((uint32_t)0x00000002) /*!<Tx Buffer DMA Enable */
  5955. #define SPI_CR2_SSOE ((uint32_t)0x00000004) /*!<SS Output Enable */
  5956. #define SPI_CR2_FRF ((uint32_t)0x00000010) /*!<Frame Format */
  5957. #define SPI_CR2_ERRIE ((uint32_t)0x00000020) /*!<Error Interrupt Enable */
  5958. #define SPI_CR2_RXNEIE ((uint32_t)0x00000040) /*!<RX buffer Not Empty Interrupt Enable */
  5959. #define SPI_CR2_TXEIE ((uint32_t)0x00000080) /*!<Tx buffer Empty Interrupt Enable */
  5960. /******************** Bit definition for SPI_SR register ********************/
  5961. #define SPI_SR_RXNE ((uint32_t)0x00000001) /*!<Receive buffer Not Empty */
  5962. #define SPI_SR_TXE ((uint32_t)0x00000002) /*!<Transmit buffer Empty */
  5963. #define SPI_SR_CHSIDE ((uint32_t)0x00000004) /*!<Channel side */
  5964. #define SPI_SR_UDR ((uint32_t)0x00000008) /*!<Underrun flag */
  5965. #define SPI_SR_CRCERR ((uint32_t)0x00000010) /*!<CRC Error flag */
  5966. #define SPI_SR_MODF ((uint32_t)0x00000020) /*!<Mode fault */
  5967. #define SPI_SR_OVR ((uint32_t)0x00000040) /*!<Overrun flag */
  5968. #define SPI_SR_BSY ((uint32_t)0x00000080) /*!<Busy flag */
  5969. #define SPI_SR_FRE ((uint32_t)0x00000100) /*!<Frame format error flag */
  5970. /******************** Bit definition for SPI_DR register ********************/
  5971. #define SPI_DR_DR ((uint32_t)0x0000FFFF) /*!<Data Register */
  5972. /******************* Bit definition for SPI_CRCPR register ******************/
  5973. #define SPI_CRCPR_CRCPOLY ((uint32_t)0x0000FFFF) /*!<CRC polynomial register */
  5974. /****************** Bit definition for SPI_RXCRCR register ******************/
  5975. #define SPI_RXCRCR_RXCRC ((uint32_t)0x0000FFFF) /*!<Rx CRC Register */
  5976. /****************** Bit definition for SPI_TXCRCR register ******************/
  5977. #define SPI_TXCRCR_TXCRC ((uint32_t)0x0000FFFF) /*!<Tx CRC Register */
  5978. /****************** Bit definition for SPI_I2SCFGR register *****************/
  5979. #define SPI_I2SCFGR_CHLEN ((uint32_t)0x00000001) /*!<Channel length (number of bits per audio channel) */
  5980. #define SPI_I2SCFGR_DATLEN ((uint32_t)0x00000006) /*!<DATLEN[1:0] bits (Data length to be transferred) */
  5981. #define SPI_I2SCFGR_DATLEN_0 ((uint32_t)0x00000002) /*!<Bit 0 */
  5982. #define SPI_I2SCFGR_DATLEN_1 ((uint32_t)0x00000004) /*!<Bit 1 */
  5983. #define SPI_I2SCFGR_CKPOL ((uint32_t)0x00000008) /*!<steady state clock polarity */
  5984. #define SPI_I2SCFGR_I2SSTD ((uint32_t)0x00000030) /*!<I2SSTD[1:0] bits (I2S standard selection) */
  5985. #define SPI_I2SCFGR_I2SSTD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  5986. #define SPI_I2SCFGR_I2SSTD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  5987. #define SPI_I2SCFGR_PCMSYNC ((uint32_t)0x00000080) /*!<PCM frame synchronization */
  5988. #define SPI_I2SCFGR_I2SCFG ((uint32_t)0x00000300) /*!<I2SCFG[1:0] bits (I2S configuration mode) */
  5989. #define SPI_I2SCFGR_I2SCFG_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  5990. #define SPI_I2SCFGR_I2SCFG_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  5991. #define SPI_I2SCFGR_I2SE ((uint32_t)0x00000400) /*!<I2S Enable */
  5992. #define SPI_I2SCFGR_I2SMOD ((uint32_t)0x00000800) /*!<I2S mode selection */
  5993. /****************** Bit definition for SPI_I2SPR register *******************/
  5994. #define SPI_I2SPR_I2SDIV ((uint32_t)0x000000FF) /*!<I2S Linear prescaler */
  5995. #define SPI_I2SPR_ODD ((uint32_t)0x00000100) /*!<Odd factor for the prescaler */
  5996. #define SPI_I2SPR_MCKOE ((uint32_t)0x00000200) /*!<Master Clock Output Enable */
  5997. /******************************************************************************/
  5998. /* */
  5999. /* SYSCFG */
  6000. /* */
  6001. /******************************************************************************/
  6002. /****************** Bit definition for SYSCFG_MEMRMP register ***************/
  6003. #define SYSCFG_MEMRMP_MEM_MODE ((uint32_t)0x00000007) /*!< SYSCFG_Memory Remap Config */
  6004. #define SYSCFG_MEMRMP_MEM_MODE_0 ((uint32_t)0x00000001)
  6005. #define SYSCFG_MEMRMP_MEM_MODE_1 ((uint32_t)0x00000002)
  6006. #define SYSCFG_MEMRMP_MEM_MODE_2 ((uint32_t)0x00000004)
  6007. #define SYSCFG_MEMRMP_UFB_MODE ((uint32_t)0x00000100) /*!< User Flash Bank mode */
  6008. #define SYSCFG_SWP_FMC ((uint32_t)0x00000C00) /*!< FMC memory mapping swap */
  6009. /****************** Bit definition for SYSCFG_PMC register ******************/
  6010. #define SYSCFG_PMC_ADCxDC2 ((uint32_t)0x00070000) /*!< Refer to AN4073 on how to use this bit */
  6011. #define SYSCFG_PMC_ADC1DC2 ((uint32_t)0x00010000) /*!< Refer to AN4073 on how to use this bit */
  6012. #define SYSCFG_PMC_ADC2DC2 ((uint32_t)0x00020000) /*!< Refer to AN4073 on how to use this bit */
  6013. #define SYSCFG_PMC_ADC3DC2 ((uint32_t)0x00040000) /*!< Refer to AN4073 on how to use this bit */
  6014. #define SYSCFG_PMC_MII_RMII_SEL ((uint32_t)0x00800000) /*!<Ethernet PHY interface selection */
  6015. /* Old MII_RMII_SEL bit definition, maintained for legacy purpose */
  6016. #define SYSCFG_PMC_MII_RMII SYSCFG_PMC_MII_RMII_SEL
  6017. /***************** Bit definition for SYSCFG_EXTICR1 register ***************/
  6018. #define SYSCFG_EXTICR1_EXTI0 ((uint32_t)0x000F) /*!<EXTI 0 configuration */
  6019. #define SYSCFG_EXTICR1_EXTI1 ((uint32_t)0x00F0) /*!<EXTI 1 configuration */
  6020. #define SYSCFG_EXTICR1_EXTI2 ((uint32_t)0x0F00) /*!<EXTI 2 configuration */
  6021. #define SYSCFG_EXTICR1_EXTI3 ((uint32_t)0xF000) /*!<EXTI 3 configuration */
  6022. /**
  6023. * @brief EXTI0 configuration
  6024. */
  6025. #define SYSCFG_EXTICR1_EXTI0_PA ((uint32_t)0x0000) /*!<PA[0] pin */
  6026. #define SYSCFG_EXTICR1_EXTI0_PB ((uint32_t)0x0001) /*!<PB[0] pin */
  6027. #define SYSCFG_EXTICR1_EXTI0_PC ((uint32_t)0x0002) /*!<PC[0] pin */
  6028. #define SYSCFG_EXTICR1_EXTI0_PD ((uint32_t)0x0003) /*!<PD[0] pin */
  6029. #define SYSCFG_EXTICR1_EXTI0_PE ((uint32_t)0x0004) /*!<PE[0] pin */
  6030. #define SYSCFG_EXTICR1_EXTI0_PF ((uint32_t)0x0005) /*!<PF[0] pin */
  6031. #define SYSCFG_EXTICR1_EXTI0_PG ((uint32_t)0x0006) /*!<PG[0] pin */
  6032. #define SYSCFG_EXTICR1_EXTI0_PH ((uint32_t)0x0007) /*!<PH[0] pin */
  6033. #define SYSCFG_EXTICR1_EXTI0_PI ((uint32_t)0x0008) /*!<PI[0] pin */
  6034. #define SYSCFG_EXTICR1_EXTI0_PJ ((uint32_t)0x0009) /*!<PJ[0] pin */
  6035. #define SYSCFG_EXTICR1_EXTI0_PK ((uint32_t)0x000A) /*!<PK[0] pin */
  6036. /**
  6037. * @brief EXTI1 configuration
  6038. */
  6039. #define SYSCFG_EXTICR1_EXTI1_PA ((uint32_t)0x0000) /*!<PA[1] pin */
  6040. #define SYSCFG_EXTICR1_EXTI1_PB ((uint32_t)0x0010) /*!<PB[1] pin */
  6041. #define SYSCFG_EXTICR1_EXTI1_PC ((uint32_t)0x0020) /*!<PC[1] pin */
  6042. #define SYSCFG_EXTICR1_EXTI1_PD ((uint32_t)0x0030) /*!<PD[1] pin */
  6043. #define SYSCFG_EXTICR1_EXTI1_PE ((uint32_t)0x0040) /*!<PE[1] pin */
  6044. #define SYSCFG_EXTICR1_EXTI1_PF ((uint32_t)0x0050) /*!<PF[1] pin */
  6045. #define SYSCFG_EXTICR1_EXTI1_PG ((uint32_t)0x0060) /*!<PG[1] pin */
  6046. #define SYSCFG_EXTICR1_EXTI1_PH ((uint32_t)0x0070) /*!<PH[1] pin */
  6047. #define SYSCFG_EXTICR1_EXTI1_PI ((uint32_t)0x0080) /*!<PI[1] pin */
  6048. #define SYSCFG_EXTICR1_EXTI1_PJ ((uint32_t)0x0090) /*!<PJ[1] pin */
  6049. #define SYSCFG_EXTICR1_EXTI1_PK ((uint32_t)0x00A0) /*!<PK[1] pin */
  6050. /**
  6051. * @brief EXTI2 configuration
  6052. */
  6053. #define SYSCFG_EXTICR1_EXTI2_PA ((uint32_t)0x0000) /*!<PA[2] pin */
  6054. #define SYSCFG_EXTICR1_EXTI2_PB ((uint32_t)0x0100) /*!<PB[2] pin */
  6055. #define SYSCFG_EXTICR1_EXTI2_PC ((uint32_t)0x0200) /*!<PC[2] pin */
  6056. #define SYSCFG_EXTICR1_EXTI2_PD ((uint32_t)0x0300) /*!<PD[2] pin */
  6057. #define SYSCFG_EXTICR1_EXTI2_PE ((uint32_t)0x0400) /*!<PE[2] pin */
  6058. #define SYSCFG_EXTICR1_EXTI2_PF ((uint32_t)0x0500) /*!<PF[2] pin */
  6059. #define SYSCFG_EXTICR1_EXTI2_PG ((uint32_t)0x0600) /*!<PG[2] pin */
  6060. #define SYSCFG_EXTICR1_EXTI2_PH ((uint32_t)0x0700) /*!<PH[2] pin */
  6061. #define SYSCFG_EXTICR1_EXTI2_PI ((uint32_t)0x0800) /*!<PI[2] pin */
  6062. #define SYSCFG_EXTICR1_EXTI2_PJ ((uint32_t)0x0900) /*!<PJ[2] pin */
  6063. #define SYSCFG_EXTICR1_EXTI2_PK ((uint32_t)0x0A00) /*!<PK[2] pin */
  6064. /**
  6065. * @brief EXTI3 configuration
  6066. */
  6067. #define SYSCFG_EXTICR1_EXTI3_PA ((uint32_t)0x0000) /*!<PA[3] pin */
  6068. #define SYSCFG_EXTICR1_EXTI3_PB ((uint32_t)0x1000) /*!<PB[3] pin */
  6069. #define SYSCFG_EXTICR1_EXTI3_PC ((uint32_t)0x2000) /*!<PC[3] pin */
  6070. #define SYSCFG_EXTICR1_EXTI3_PD ((uint32_t)0x3000) /*!<PD[3] pin */
  6071. #define SYSCFG_EXTICR1_EXTI3_PE ((uint32_t)0x4000) /*!<PE[3] pin */
  6072. #define SYSCFG_EXTICR1_EXTI3_PF ((uint32_t)0x5000) /*!<PF[3] pin */
  6073. #define SYSCFG_EXTICR1_EXTI3_PG ((uint32_t)0x6000) /*!<PG[3] pin */
  6074. #define SYSCFG_EXTICR1_EXTI3_PH ((uint32_t)0x7000) /*!<PH[3] pin */
  6075. #define SYSCFG_EXTICR1_EXTI3_PI ((uint32_t)0x8000) /*!<PI[3] pin */
  6076. #define SYSCFG_EXTICR1_EXTI3_PJ ((uint32_t)0x9000) /*!<PJ[3] pin */
  6077. #define SYSCFG_EXTICR1_EXTI3_PK ((uint32_t)0xA000) /*!<PK[3] pin */
  6078. /***************** Bit definition for SYSCFG_EXTICR2 register ***************/
  6079. #define SYSCFG_EXTICR2_EXTI4 ((uint32_t)0x000F) /*!<EXTI 4 configuration */
  6080. #define SYSCFG_EXTICR2_EXTI5 ((uint32_t)0x00F0) /*!<EXTI 5 configuration */
  6081. #define SYSCFG_EXTICR2_EXTI6 ((uint32_t)0x0F00) /*!<EXTI 6 configuration */
  6082. #define SYSCFG_EXTICR2_EXTI7 ((uint32_t)0xF000) /*!<EXTI 7 configuration */
  6083. /**
  6084. * @brief EXTI4 configuration
  6085. */
  6086. #define SYSCFG_EXTICR2_EXTI4_PA ((uint32_t)0x0000) /*!<PA[4] pin */
  6087. #define SYSCFG_EXTICR2_EXTI4_PB ((uint32_t)0x0001) /*!<PB[4] pin */
  6088. #define SYSCFG_EXTICR2_EXTI4_PC ((uint32_t)0x0002) /*!<PC[4] pin */
  6089. #define SYSCFG_EXTICR2_EXTI4_PD ((uint32_t)0x0003) /*!<PD[4] pin */
  6090. #define SYSCFG_EXTICR2_EXTI4_PE ((uint32_t)0x0004) /*!<PE[4] pin */
  6091. #define SYSCFG_EXTICR2_EXTI4_PF ((uint32_t)0x0005) /*!<PF[4] pin */
  6092. #define SYSCFG_EXTICR2_EXTI4_PG ((uint32_t)0x0006) /*!<PG[4] pin */
  6093. #define SYSCFG_EXTICR2_EXTI4_PH ((uint32_t)0x0007) /*!<PH[4] pin */
  6094. #define SYSCFG_EXTICR2_EXTI4_PI ((uint32_t)0x0008) /*!<PI[4] pin */
  6095. #define SYSCFG_EXTICR2_EXTI4_PJ ((uint32_t)0x0009) /*!<PJ[4] pin */
  6096. #define SYSCFG_EXTICR2_EXTI4_PK ((uint32_t)0x000A) /*!<PK[4] pin */
  6097. /**
  6098. * @brief EXTI5 configuration
  6099. */
  6100. #define SYSCFG_EXTICR2_EXTI5_PA ((uint32_t)0x0000) /*!<PA[5] pin */
  6101. #define SYSCFG_EXTICR2_EXTI5_PB ((uint32_t)0x0010) /*!<PB[5] pin */
  6102. #define SYSCFG_EXTICR2_EXTI5_PC ((uint32_t)0x0020) /*!<PC[5] pin */
  6103. #define SYSCFG_EXTICR2_EXTI5_PD ((uint32_t)0x0030) /*!<PD[5] pin */
  6104. #define SYSCFG_EXTICR2_EXTI5_PE ((uint32_t)0x0040) /*!<PE[5] pin */
  6105. #define SYSCFG_EXTICR2_EXTI5_PF ((uint32_t)0x0050) /*!<PF[5] pin */
  6106. #define SYSCFG_EXTICR2_EXTI5_PG ((uint32_t)0x0060) /*!<PG[5] pin */
  6107. #define SYSCFG_EXTICR2_EXTI5_PH ((uint32_t)0x0070) /*!<PH[5] pin */
  6108. #define SYSCFG_EXTICR2_EXTI5_PI ((uint32_t)0x0080) /*!<PI[5] pin */
  6109. #define SYSCFG_EXTICR2_EXTI5_PJ ((uint32_t)0x0090) /*!<PJ[5] pin */
  6110. #define SYSCFG_EXTICR2_EXTI5_PK ((uint32_t)0x00A0) /*!<PK[5] pin */
  6111. /**
  6112. * @brief EXTI6 configuration
  6113. */
  6114. #define SYSCFG_EXTICR2_EXTI6_PA ((uint32_t)0x0000) /*!<PA[6] pin */
  6115. #define SYSCFG_EXTICR2_EXTI6_PB ((uint32_t)0x0100) /*!<PB[6] pin */
  6116. #define SYSCFG_EXTICR2_EXTI6_PC ((uint32_t)0x0200) /*!<PC[6] pin */
  6117. #define SYSCFG_EXTICR2_EXTI6_PD ((uint32_t)0x0300) /*!<PD[6] pin */
  6118. #define SYSCFG_EXTICR2_EXTI6_PE ((uint32_t)0x0400) /*!<PE[6] pin */
  6119. #define SYSCFG_EXTICR2_EXTI6_PF ((uint32_t)0x0500) /*!<PF[6] pin */
  6120. #define SYSCFG_EXTICR2_EXTI6_PG ((uint32_t)0x0600) /*!<PG[6] pin */
  6121. #define SYSCFG_EXTICR2_EXTI6_PH ((uint32_t)0x0700) /*!<PH[6] pin */
  6122. #define SYSCFG_EXTICR2_EXTI6_PI ((uint32_t)0x0800) /*!<PI[6] pin */
  6123. #define SYSCFG_EXTICR2_EXTI6_PJ ((uint32_t)0x0900) /*!<PJ[6] pin */
  6124. #define SYSCFG_EXTICR2_EXTI6_PK ((uint32_t)0x0A00) /*!<PK[6] pin */
  6125. /**
  6126. * @brief EXTI7 configuration
  6127. */
  6128. #define SYSCFG_EXTICR2_EXTI7_PA ((uint32_t)0x0000) /*!<PA[7] pin */
  6129. #define SYSCFG_EXTICR2_EXTI7_PB ((uint32_t)0x1000) /*!<PB[7] pin */
  6130. #define SYSCFG_EXTICR2_EXTI7_PC ((uint32_t)0x2000) /*!<PC[7] pin */
  6131. #define SYSCFG_EXTICR2_EXTI7_PD ((uint32_t)0x3000) /*!<PD[7] pin */
  6132. #define SYSCFG_EXTICR2_EXTI7_PE ((uint32_t)0x4000) /*!<PE[7] pin */
  6133. #define SYSCFG_EXTICR2_EXTI7_PF ((uint32_t)0x5000) /*!<PF[7] pin */
  6134. #define SYSCFG_EXTICR2_EXTI7_PG ((uint32_t)0x6000) /*!<PG[7] pin */
  6135. #define SYSCFG_EXTICR2_EXTI7_PH ((uint32_t)0x7000) /*!<PH[7] pin */
  6136. #define SYSCFG_EXTICR2_EXTI7_PI ((uint32_t)0x8000) /*!<PI[7] pin */
  6137. #define SYSCFG_EXTICR2_EXTI7_PJ ((uint32_t)0x9000) /*!<PJ[7] pin */
  6138. #define SYSCFG_EXTICR2_EXTI7_PK ((uint32_t)0xA000) /*!<PK[7] pin */
  6139. /***************** Bit definition for SYSCFG_EXTICR3 register ***************/
  6140. #define SYSCFG_EXTICR3_EXTI8 ((uint32_t)0x000F) /*!<EXTI 8 configuration */
  6141. #define SYSCFG_EXTICR3_EXTI9 ((uint32_t)0x00F0) /*!<EXTI 9 configuration */
  6142. #define SYSCFG_EXTICR3_EXTI10 ((uint32_t)0x0F00) /*!<EXTI 10 configuration */
  6143. #define SYSCFG_EXTICR3_EXTI11 ((uint32_t)0xF000) /*!<EXTI 11 configuration */
  6144. /**
  6145. * @brief EXTI8 configuration
  6146. */
  6147. #define SYSCFG_EXTICR3_EXTI8_PA ((uint32_t)0x0000) /*!<PA[8] pin */
  6148. #define SYSCFG_EXTICR3_EXTI8_PB ((uint32_t)0x0001) /*!<PB[8] pin */
  6149. #define SYSCFG_EXTICR3_EXTI8_PC ((uint32_t)0x0002) /*!<PC[8] pin */
  6150. #define SYSCFG_EXTICR3_EXTI8_PD ((uint32_t)0x0003) /*!<PD[8] pin */
  6151. #define SYSCFG_EXTICR3_EXTI8_PE ((uint32_t)0x0004) /*!<PE[8] pin */
  6152. #define SYSCFG_EXTICR3_EXTI8_PF ((uint32_t)0x0005) /*!<PF[8] pin */
  6153. #define SYSCFG_EXTICR3_EXTI8_PG ((uint32_t)0x0006) /*!<PG[8] pin */
  6154. #define SYSCFG_EXTICR3_EXTI8_PH ((uint32_t)0x0007) /*!<PH[8] pin */
  6155. #define SYSCFG_EXTICR3_EXTI8_PI ((uint32_t)0x0008) /*!<PI[8] pin */
  6156. #define SYSCFG_EXTICR3_EXTI8_PJ ((uint32_t)0x0009) /*!<PJ[8] pin */
  6157. /**
  6158. * @brief EXTI9 configuration
  6159. */
  6160. #define SYSCFG_EXTICR3_EXTI9_PA ((uint32_t)0x0000) /*!<PA[9] pin */
  6161. #define SYSCFG_EXTICR3_EXTI9_PB ((uint32_t)0x0010) /*!<PB[9] pin */
  6162. #define SYSCFG_EXTICR3_EXTI9_PC ((uint32_t)0x0020) /*!<PC[9] pin */
  6163. #define SYSCFG_EXTICR3_EXTI9_PD ((uint32_t)0x0030) /*!<PD[9] pin */
  6164. #define SYSCFG_EXTICR3_EXTI9_PE ((uint32_t)0x0040) /*!<PE[9] pin */
  6165. #define SYSCFG_EXTICR3_EXTI9_PF ((uint32_t)0x0050) /*!<PF[9] pin */
  6166. #define SYSCFG_EXTICR3_EXTI9_PG ((uint32_t)0x0060) /*!<PG[9] pin */
  6167. #define SYSCFG_EXTICR3_EXTI9_PH ((uint32_t)0x0070) /*!<PH[9] pin */
  6168. #define SYSCFG_EXTICR3_EXTI9_PI ((uint32_t)0x0080) /*!<PI[9] pin */
  6169. #define SYSCFG_EXTICR3_EXTI9_PJ ((uint32_t)0x0090) /*!<PJ[9] pin */
  6170. /**
  6171. * @brief EXTI10 configuration
  6172. */
  6173. #define SYSCFG_EXTICR3_EXTI10_PA ((uint32_t)0x0000) /*!<PA[10] pin */
  6174. #define SYSCFG_EXTICR3_EXTI10_PB ((uint32_t)0x0100) /*!<PB[10] pin */
  6175. #define SYSCFG_EXTICR3_EXTI10_PC ((uint32_t)0x0200) /*!<PC[10] pin */
  6176. #define SYSCFG_EXTICR3_EXTI10_PD ((uint32_t)0x0300) /*!<PD[10] pin */
  6177. #define SYSCFG_EXTICR3_EXTI10_PE ((uint32_t)0x0400) /*!<PE[10] pin */
  6178. #define SYSCFG_EXTICR3_EXTI10_PF ((uint32_t)0x0500) /*!<PF[10] pin */
  6179. #define SYSCFG_EXTICR3_EXTI10_PG ((uint32_t)0x0600) /*!<PG[10] pin */
  6180. #define SYSCFG_EXTICR3_EXTI10_PH ((uint32_t)0x0700) /*!<PH[10] pin */
  6181. #define SYSCFG_EXTICR3_EXTI10_PI ((uint32_t)0x0800) /*!<PI[10] pin */
  6182. #define SYSCFG_EXTICR3_EXTI10_PJ ((uint32_t)0x0900) /*!<PJ[10] pin */
  6183. /**
  6184. * @brief EXTI11 configuration
  6185. */
  6186. #define SYSCFG_EXTICR3_EXTI11_PA ((uint32_t)0x0000) /*!<PA[11] pin */
  6187. #define SYSCFG_EXTICR3_EXTI11_PB ((uint32_t)0x1000) /*!<PB[11] pin */
  6188. #define SYSCFG_EXTICR3_EXTI11_PC ((uint32_t)0x2000) /*!<PC[11] pin */
  6189. #define SYSCFG_EXTICR3_EXTI11_PD ((uint32_t)0x3000) /*!<PD[11] pin */
  6190. #define SYSCFG_EXTICR3_EXTI11_PE ((uint32_t)0x4000) /*!<PE[11] pin */
  6191. #define SYSCFG_EXTICR3_EXTI11_PF ((uint32_t)0x5000) /*!<PF[11] pin */
  6192. #define SYSCFG_EXTICR3_EXTI11_PG ((uint32_t)0x6000) /*!<PG[11] pin */
  6193. #define SYSCFG_EXTICR3_EXTI11_PH ((uint32_t)0x7000) /*!<PH[11] pin */
  6194. #define SYSCFG_EXTICR3_EXTI11_PI ((uint32_t)0x8000) /*!<PI[11] pin */
  6195. #define SYSCFG_EXTICR3_EXTI11_PJ ((uint32_t)0x9000) /*!<PJ[11] pin */
  6196. /***************** Bit definition for SYSCFG_EXTICR4 register ***************/
  6197. #define SYSCFG_EXTICR4_EXTI12 ((uint32_t)0x000F) /*!<EXTI 12 configuration */
  6198. #define SYSCFG_EXTICR4_EXTI13 ((uint32_t)0x00F0) /*!<EXTI 13 configuration */
  6199. #define SYSCFG_EXTICR4_EXTI14 ((uint32_t)0x0F00) /*!<EXTI 14 configuration */
  6200. #define SYSCFG_EXTICR4_EXTI15 ((uint32_t)0xF000) /*!<EXTI 15 configuration */
  6201. /**
  6202. * @brief EXTI12 configuration
  6203. */
  6204. #define SYSCFG_EXTICR4_EXTI12_PA ((uint32_t)0x0000) /*!<PA[12] pin */
  6205. #define SYSCFG_EXTICR4_EXTI12_PB ((uint32_t)0x0001) /*!<PB[12] pin */
  6206. #define SYSCFG_EXTICR4_EXTI12_PC ((uint32_t)0x0002) /*!<PC[12] pin */
  6207. #define SYSCFG_EXTICR4_EXTI12_PD ((uint32_t)0x0003) /*!<PD[12] pin */
  6208. #define SYSCFG_EXTICR4_EXTI12_PE ((uint32_t)0x0004) /*!<PE[12] pin */
  6209. #define SYSCFG_EXTICR4_EXTI12_PF ((uint32_t)0x0005) /*!<PF[12] pin */
  6210. #define SYSCFG_EXTICR4_EXTI12_PG ((uint32_t)0x0006) /*!<PG[12] pin */
  6211. #define SYSCFG_EXTICR4_EXTI12_PH ((uint32_t)0x0007) /*!<PH[12] pin */
  6212. #define SYSCFG_EXTICR4_EXTI12_PI ((uint32_t)0x0008) /*!<PI[12] pin */
  6213. #define SYSCFG_EXTICR4_EXTI12_PJ ((uint32_t)0x0009) /*!<PJ[12] pin */
  6214. /**
  6215. * @brief EXTI13 configuration
  6216. */
  6217. #define SYSCFG_EXTICR4_EXTI13_PA ((uint32_t)0x0000) /*!<PA[13] pin */
  6218. #define SYSCFG_EXTICR4_EXTI13_PB ((uint32_t)0x0010) /*!<PB[13] pin */
  6219. #define SYSCFG_EXTICR4_EXTI13_PC ((uint32_t)0x0020) /*!<PC[13] pin */
  6220. #define SYSCFG_EXTICR4_EXTI13_PD ((uint32_t)0x0030) /*!<PD[13] pin */
  6221. #define SYSCFG_EXTICR4_EXTI13_PE ((uint32_t)0x0040) /*!<PE[13] pin */
  6222. #define SYSCFG_EXTICR4_EXTI13_PF ((uint32_t)0x0050) /*!<PF[13] pin */
  6223. #define SYSCFG_EXTICR4_EXTI13_PG ((uint32_t)0x0060) /*!<PG[13] pin */
  6224. #define SYSCFG_EXTICR4_EXTI13_PH ((uint32_t)0x0070) /*!<PH[13] pin */
  6225. #define SYSCFG_EXTICR4_EXTI13_PI ((uint32_t)0x0008) /*!<PI[13] pin */
  6226. #define SYSCFG_EXTICR4_EXTI13_PJ ((uint32_t)0x0009) /*!<PJ[13] pin */
  6227. /**
  6228. * @brief EXTI14 configuration
  6229. */
  6230. #define SYSCFG_EXTICR4_EXTI14_PA ((uint32_t)0x0000) /*!<PA[14] pin */
  6231. #define SYSCFG_EXTICR4_EXTI14_PB ((uint32_t)0x0100) /*!<PB[14] pin */
  6232. #define SYSCFG_EXTICR4_EXTI14_PC ((uint32_t)0x0200) /*!<PC[14] pin */
  6233. #define SYSCFG_EXTICR4_EXTI14_PD ((uint32_t)0x0300) /*!<PD[14] pin */
  6234. #define SYSCFG_EXTICR4_EXTI14_PE ((uint32_t)0x0400) /*!<PE[14] pin */
  6235. #define SYSCFG_EXTICR4_EXTI14_PF ((uint32_t)0x0500) /*!<PF[14] pin */
  6236. #define SYSCFG_EXTICR4_EXTI14_PG ((uint32_t)0x0600) /*!<PG[14] pin */
  6237. #define SYSCFG_EXTICR4_EXTI14_PH ((uint32_t)0x0700) /*!<PH[14] pin */
  6238. #define SYSCFG_EXTICR4_EXTI14_PI ((uint32_t)0x0800) /*!<PI[14] pin */
  6239. #define SYSCFG_EXTICR4_EXTI14_PJ ((uint32_t)0x0900) /*!<PJ[14] pin */
  6240. /**
  6241. * @brief EXTI15 configuration
  6242. */
  6243. #define SYSCFG_EXTICR4_EXTI15_PA ((uint32_t)0x0000) /*!<PA[15] pin */
  6244. #define SYSCFG_EXTICR4_EXTI15_PB ((uint32_t)0x1000) /*!<PB[15] pin */
  6245. #define SYSCFG_EXTICR4_EXTI15_PC ((uint32_t)0x2000) /*!<PC[15] pin */
  6246. #define SYSCFG_EXTICR4_EXTI15_PD ((uint32_t)0x3000) /*!<PD[15] pin */
  6247. #define SYSCFG_EXTICR4_EXTI15_PE ((uint32_t)0x4000) /*!<PE[15] pin */
  6248. #define SYSCFG_EXTICR4_EXTI15_PF ((uint32_t)0x5000) /*!<PF[15] pin */
  6249. #define SYSCFG_EXTICR4_EXTI15_PG ((uint32_t)0x6000) /*!<PG[15] pin */
  6250. #define SYSCFG_EXTICR4_EXTI15_PH ((uint32_t)0x7000) /*!<PH[15] pin */
  6251. #define SYSCFG_EXTICR4_EXTI15_PI ((uint32_t)0x8000) /*!<PI[15] pin */
  6252. #define SYSCFG_EXTICR4_EXTI15_PJ ((uint32_t)0x9000) /*!<PJ[15] pin */
  6253. /****************** Bit definition for SYSCFG_CMPCR register ****************/
  6254. #define SYSCFG_CMPCR_CMP_PD ((uint32_t)0x00000001) /*!<Compensation cell ready flag */
  6255. #define SYSCFG_CMPCR_READY ((uint32_t)0x00000100) /*!<Compensation cell power-down */
  6256. /******************************************************************************/
  6257. /* */
  6258. /* TIM */
  6259. /* */
  6260. /******************************************************************************/
  6261. /******************* Bit definition for TIM_CR1 register ********************/
  6262. #define TIM_CR1_CEN ((uint32_t)0x0001) /*!<Counter enable */
  6263. #define TIM_CR1_UDIS ((uint32_t)0x0002) /*!<Update disable */
  6264. #define TIM_CR1_URS ((uint32_t)0x0004) /*!<Update request source */
  6265. #define TIM_CR1_OPM ((uint32_t)0x0008) /*!<One pulse mode */
  6266. #define TIM_CR1_DIR ((uint32_t)0x0010) /*!<Direction */
  6267. #define TIM_CR1_CMS ((uint32_t)0x0060) /*!<CMS[1:0] bits (Center-aligned mode selection) */
  6268. #define TIM_CR1_CMS_0 ((uint32_t)0x0020) /*!<Bit 0 */
  6269. #define TIM_CR1_CMS_1 ((uint32_t)0x0040) /*!<Bit 1 */
  6270. #define TIM_CR1_ARPE ((uint32_t)0x0080) /*!<Auto-reload preload enable */
  6271. #define TIM_CR1_CKD ((uint32_t)0x0300) /*!<CKD[1:0] bits (clock division) */
  6272. #define TIM_CR1_CKD_0 ((uint32_t)0x0100) /*!<Bit 0 */
  6273. #define TIM_CR1_CKD_1 ((uint32_t)0x0200) /*!<Bit 1 */
  6274. /******************* Bit definition for TIM_CR2 register ********************/
  6275. #define TIM_CR2_CCPC ((uint32_t)0x0001) /*!<Capture/Compare Preloaded Control */
  6276. #define TIM_CR2_CCUS ((uint32_t)0x0004) /*!<Capture/Compare Control Update Selection */
  6277. #define TIM_CR2_CCDS ((uint32_t)0x0008) /*!<Capture/Compare DMA Selection */
  6278. #define TIM_CR2_MMS ((uint32_t)0x0070) /*!<MMS[2:0] bits (Master Mode Selection) */
  6279. #define TIM_CR2_MMS_0 ((uint32_t)0x0010) /*!<Bit 0 */
  6280. #define TIM_CR2_MMS_1 ((uint32_t)0x0020) /*!<Bit 1 */
  6281. #define TIM_CR2_MMS_2 ((uint32_t)0x0040) /*!<Bit 2 */
  6282. #define TIM_CR2_TI1S ((uint32_t)0x0080) /*!<TI1 Selection */
  6283. #define TIM_CR2_OIS1 ((uint32_t)0x0100) /*!<Output Idle state 1 (OC1 output) */
  6284. #define TIM_CR2_OIS1N ((uint32_t)0x0200) /*!<Output Idle state 1 (OC1N output) */
  6285. #define TIM_CR2_OIS2 ((uint32_t)0x0400) /*!<Output Idle state 2 (OC2 output) */
  6286. #define TIM_CR2_OIS2N ((uint32_t)0x0800) /*!<Output Idle state 2 (OC2N output) */
  6287. #define TIM_CR2_OIS3 ((uint32_t)0x1000) /*!<Output Idle state 3 (OC3 output) */
  6288. #define TIM_CR2_OIS3N ((uint32_t)0x2000) /*!<Output Idle state 3 (OC3N output) */
  6289. #define TIM_CR2_OIS4 ((uint32_t)0x4000) /*!<Output Idle state 4 (OC4 output) */
  6290. /******************* Bit definition for TIM_SMCR register *******************/
  6291. #define TIM_SMCR_SMS ((uint32_t)0x0007) /*!<SMS[2:0] bits (Slave mode selection) */
  6292. #define TIM_SMCR_SMS_0 ((uint32_t)0x0001) /*!<Bit 0 */
  6293. #define TIM_SMCR_SMS_1 ((uint32_t)0x0002) /*!<Bit 1 */
  6294. #define TIM_SMCR_SMS_2 ((uint32_t)0x0004) /*!<Bit 2 */
  6295. #define TIM_SMCR_TS ((uint32_t)0x0070) /*!<TS[2:0] bits (Trigger selection) */
  6296. #define TIM_SMCR_TS_0 ((uint32_t)0x0010) /*!<Bit 0 */
  6297. #define TIM_SMCR_TS_1 ((uint32_t)0x0020) /*!<Bit 1 */
  6298. #define TIM_SMCR_TS_2 ((uint32_t)0x0040) /*!<Bit 2 */
  6299. #define TIM_SMCR_MSM ((uint32_t)0x0080) /*!<Master/slave mode */
  6300. #define TIM_SMCR_ETF ((uint32_t)0x0F00) /*!<ETF[3:0] bits (External trigger filter) */
  6301. #define TIM_SMCR_ETF_0 ((uint32_t)0x0100) /*!<Bit 0 */
  6302. #define TIM_SMCR_ETF_1 ((uint32_t)0x0200) /*!<Bit 1 */
  6303. #define TIM_SMCR_ETF_2 ((uint32_t)0x0400) /*!<Bit 2 */
  6304. #define TIM_SMCR_ETF_3 ((uint32_t)0x0800) /*!<Bit 3 */
  6305. #define TIM_SMCR_ETPS ((uint32_t)0x3000) /*!<ETPS[1:0] bits (External trigger prescaler) */
  6306. #define TIM_SMCR_ETPS_0 ((uint32_t)0x1000) /*!<Bit 0 */
  6307. #define TIM_SMCR_ETPS_1 ((uint32_t)0x2000) /*!<Bit 1 */
  6308. #define TIM_SMCR_ECE ((uint32_t)0x4000) /*!<External clock enable */
  6309. #define TIM_SMCR_ETP ((uint32_t)0x8000) /*!<External trigger polarity */
  6310. /******************* Bit definition for TIM_DIER register *******************/
  6311. #define TIM_DIER_UIE ((uint32_t)0x0001) /*!<Update interrupt enable */
  6312. #define TIM_DIER_CC1IE ((uint32_t)0x0002) /*!<Capture/Compare 1 interrupt enable */
  6313. #define TIM_DIER_CC2IE ((uint32_t)0x0004) /*!<Capture/Compare 2 interrupt enable */
  6314. #define TIM_DIER_CC3IE ((uint32_t)0x0008) /*!<Capture/Compare 3 interrupt enable */
  6315. #define TIM_DIER_CC4IE ((uint32_t)0x0010) /*!<Capture/Compare 4 interrupt enable */
  6316. #define TIM_DIER_COMIE ((uint32_t)0x0020) /*!<COM interrupt enable */
  6317. #define TIM_DIER_TIE ((uint32_t)0x0040) /*!<Trigger interrupt enable */
  6318. #define TIM_DIER_BIE ((uint32_t)0x0080) /*!<Break interrupt enable */
  6319. #define TIM_DIER_UDE ((uint32_t)0x0100) /*!<Update DMA request enable */
  6320. #define TIM_DIER_CC1DE ((uint32_t)0x0200) /*!<Capture/Compare 1 DMA request enable */
  6321. #define TIM_DIER_CC2DE ((uint32_t)0x0400) /*!<Capture/Compare 2 DMA request enable */
  6322. #define TIM_DIER_CC3DE ((uint32_t)0x0800) /*!<Capture/Compare 3 DMA request enable */
  6323. #define TIM_DIER_CC4DE ((uint32_t)0x1000) /*!<Capture/Compare 4 DMA request enable */
  6324. #define TIM_DIER_COMDE ((uint32_t)0x2000) /*!<COM DMA request enable */
  6325. #define TIM_DIER_TDE ((uint32_t)0x4000) /*!<Trigger DMA request enable */
  6326. /******************** Bit definition for TIM_SR register ********************/
  6327. #define TIM_SR_UIF ((uint32_t)0x0001) /*!<Update interrupt Flag */
  6328. #define TIM_SR_CC1IF ((uint32_t)0x0002) /*!<Capture/Compare 1 interrupt Flag */
  6329. #define TIM_SR_CC2IF ((uint32_t)0x0004) /*!<Capture/Compare 2 interrupt Flag */
  6330. #define TIM_SR_CC3IF ((uint32_t)0x0008) /*!<Capture/Compare 3 interrupt Flag */
  6331. #define TIM_SR_CC4IF ((uint32_t)0x0010) /*!<Capture/Compare 4 interrupt Flag */
  6332. #define TIM_SR_COMIF ((uint32_t)0x0020) /*!<COM interrupt Flag */
  6333. #define TIM_SR_TIF ((uint32_t)0x0040) /*!<Trigger interrupt Flag */
  6334. #define TIM_SR_BIF ((uint32_t)0x0080) /*!<Break interrupt Flag */
  6335. #define TIM_SR_CC1OF ((uint32_t)0x0200) /*!<Capture/Compare 1 Overcapture Flag */
  6336. #define TIM_SR_CC2OF ((uint32_t)0x0400) /*!<Capture/Compare 2 Overcapture Flag */
  6337. #define TIM_SR_CC3OF ((uint32_t)0x0800) /*!<Capture/Compare 3 Overcapture Flag */
  6338. #define TIM_SR_CC4OF ((uint32_t)0x1000) /*!<Capture/Compare 4 Overcapture Flag */
  6339. /******************* Bit definition for TIM_EGR register ********************/
  6340. #define TIM_EGR_UG ((uint32_t)0x01) /*!<Update Generation */
  6341. #define TIM_EGR_CC1G ((uint32_t)0x02) /*!<Capture/Compare 1 Generation */
  6342. #define TIM_EGR_CC2G ((uint32_t)0x04) /*!<Capture/Compare 2 Generation */
  6343. #define TIM_EGR_CC3G ((uint32_t)0x08) /*!<Capture/Compare 3 Generation */
  6344. #define TIM_EGR_CC4G ((uint32_t)0x10) /*!<Capture/Compare 4 Generation */
  6345. #define TIM_EGR_COMG ((uint32_t)0x20) /*!<Capture/Compare Control Update Generation */
  6346. #define TIM_EGR_TG ((uint32_t)0x40) /*!<Trigger Generation */
  6347. #define TIM_EGR_BG ((uint32_t)0x80) /*!<Break Generation */
  6348. /****************** Bit definition for TIM_CCMR1 register *******************/
  6349. #define TIM_CCMR1_CC1S ((uint32_t)0x0003) /*!<CC1S[1:0] bits (Capture/Compare 1 Selection) */
  6350. #define TIM_CCMR1_CC1S_0 ((uint32_t)0x0001) /*!<Bit 0 */
  6351. #define TIM_CCMR1_CC1S_1 ((uint32_t)0x0002) /*!<Bit 1 */
  6352. #define TIM_CCMR1_OC1FE ((uint32_t)0x0004) /*!<Output Compare 1 Fast enable */
  6353. #define TIM_CCMR1_OC1PE ((uint32_t)0x0008) /*!<Output Compare 1 Preload enable */
  6354. #define TIM_CCMR1_OC1M ((uint32_t)0x0070) /*!<OC1M[2:0] bits (Output Compare 1 Mode) */
  6355. #define TIM_CCMR1_OC1M_0 ((uint32_t)0x0010) /*!<Bit 0 */
  6356. #define TIM_CCMR1_OC1M_1 ((uint32_t)0x0020) /*!<Bit 1 */
  6357. #define TIM_CCMR1_OC1M_2 ((uint32_t)0x0040) /*!<Bit 2 */
  6358. #define TIM_CCMR1_OC1CE ((uint32_t)0x0080) /*!<Output Compare 1Clear Enable */
  6359. #define TIM_CCMR1_CC2S ((uint32_t)0x0300) /*!<CC2S[1:0] bits (Capture/Compare 2 Selection) */
  6360. #define TIM_CCMR1_CC2S_0 ((uint32_t)0x0100) /*!<Bit 0 */
  6361. #define TIM_CCMR1_CC2S_1 ((uint32_t)0x0200) /*!<Bit 1 */
  6362. #define TIM_CCMR1_OC2FE ((uint32_t)0x0400) /*!<Output Compare 2 Fast enable */
  6363. #define TIM_CCMR1_OC2PE ((uint32_t)0x0800) /*!<Output Compare 2 Preload enable */
  6364. #define TIM_CCMR1_OC2M ((uint32_t)0x7000) /*!<OC2M[2:0] bits (Output Compare 2 Mode) */
  6365. #define TIM_CCMR1_OC2M_0 ((uint32_t)0x1000) /*!<Bit 0 */
  6366. #define TIM_CCMR1_OC2M_1 ((uint32_t)0x2000) /*!<Bit 1 */
  6367. #define TIM_CCMR1_OC2M_2 ((uint32_t)0x4000) /*!<Bit 2 */
  6368. #define TIM_CCMR1_OC2CE ((uint32_t)0x8000) /*!<Output Compare 2 Clear Enable */
  6369. /*----------------------------------------------------------------------------*/
  6370. #define TIM_CCMR1_IC1PSC ((uint32_t)0x000C) /*!<IC1PSC[1:0] bits (Input Capture 1 Prescaler) */
  6371. #define TIM_CCMR1_IC1PSC_0 ((uint32_t)0x0004) /*!<Bit 0 */
  6372. #define TIM_CCMR1_IC1PSC_1 ((uint32_t)0x0008) /*!<Bit 1 */
  6373. #define TIM_CCMR1_IC1F ((uint32_t)0x00F0) /*!<IC1F[3:0] bits (Input Capture 1 Filter) */
  6374. #define TIM_CCMR1_IC1F_0 ((uint32_t)0x0010) /*!<Bit 0 */
  6375. #define TIM_CCMR1_IC1F_1 ((uint32_t)0x0020) /*!<Bit 1 */
  6376. #define TIM_CCMR1_IC1F_2 ((uint32_t)0x0040) /*!<Bit 2 */
  6377. #define TIM_CCMR1_IC1F_3 ((uint32_t)0x0080) /*!<Bit 3 */
  6378. #define TIM_CCMR1_IC2PSC ((uint32_t)0x0C00) /*!<IC2PSC[1:0] bits (Input Capture 2 Prescaler) */
  6379. #define TIM_CCMR1_IC2PSC_0 ((uint32_t)0x0400) /*!<Bit 0 */
  6380. #define TIM_CCMR1_IC2PSC_1 ((uint32_t)0x0800) /*!<Bit 1 */
  6381. #define TIM_CCMR1_IC2F ((uint32_t)0xF000) /*!<IC2F[3:0] bits (Input Capture 2 Filter) */
  6382. #define TIM_CCMR1_IC2F_0 ((uint32_t)0x1000) /*!<Bit 0 */
  6383. #define TIM_CCMR1_IC2F_1 ((uint32_t)0x2000) /*!<Bit 1 */
  6384. #define TIM_CCMR1_IC2F_2 ((uint32_t)0x4000) /*!<Bit 2 */
  6385. #define TIM_CCMR1_IC2F_3 ((uint32_t)0x8000) /*!<Bit 3 */
  6386. /****************** Bit definition for TIM_CCMR2 register *******************/
  6387. #define TIM_CCMR2_CC3S ((uint32_t)0x0003) /*!<CC3S[1:0] bits (Capture/Compare 3 Selection) */
  6388. #define TIM_CCMR2_CC3S_0 ((uint32_t)0x0001) /*!<Bit 0 */
  6389. #define TIM_CCMR2_CC3S_1 ((uint32_t)0x0002) /*!<Bit 1 */
  6390. #define TIM_CCMR2_OC3FE ((uint32_t)0x0004) /*!<Output Compare 3 Fast enable */
  6391. #define TIM_CCMR2_OC3PE ((uint32_t)0x0008) /*!<Output Compare 3 Preload enable */
  6392. #define TIM_CCMR2_OC3M ((uint32_t)0x0070) /*!<OC3M[2:0] bits (Output Compare 3 Mode) */
  6393. #define TIM_CCMR2_OC3M_0 ((uint32_t)0x0010) /*!<Bit 0 */
  6394. #define TIM_CCMR2_OC3M_1 ((uint32_t)0x0020) /*!<Bit 1 */
  6395. #define TIM_CCMR2_OC3M_2 ((uint32_t)0x0040) /*!<Bit 2 */
  6396. #define TIM_CCMR2_OC3CE ((uint32_t)0x0080) /*!<Output Compare 3 Clear Enable */
  6397. #define TIM_CCMR2_CC4S ((uint32_t)0x0300) /*!<CC4S[1:0] bits (Capture/Compare 4 Selection) */
  6398. #define TIM_CCMR2_CC4S_0 ((uint32_t)0x0100) /*!<Bit 0 */
  6399. #define TIM_CCMR2_CC4S_1 ((uint32_t)0x0200) /*!<Bit 1 */
  6400. #define TIM_CCMR2_OC4FE ((uint32_t)0x0400) /*!<Output Compare 4 Fast enable */
  6401. #define TIM_CCMR2_OC4PE ((uint32_t)0x0800) /*!<Output Compare 4 Preload enable */
  6402. #define TIM_CCMR2_OC4M ((uint32_t)0x7000) /*!<OC4M[2:0] bits (Output Compare 4 Mode) */
  6403. #define TIM_CCMR2_OC4M_0 ((uint32_t)0x1000) /*!<Bit 0 */
  6404. #define TIM_CCMR2_OC4M_1 ((uint32_t)0x2000) /*!<Bit 1 */
  6405. #define TIM_CCMR2_OC4M_2 ((uint32_t)0x4000) /*!<Bit 2 */
  6406. #define TIM_CCMR2_OC4CE ((uint32_t)0x8000) /*!<Output Compare 4 Clear Enable */
  6407. /*----------------------------------------------------------------------------*/
  6408. #define TIM_CCMR2_IC3PSC ((uint32_t)0x000C) /*!<IC3PSC[1:0] bits (Input Capture 3 Prescaler) */
  6409. #define TIM_CCMR2_IC3PSC_0 ((uint32_t)0x0004) /*!<Bit 0 */
  6410. #define TIM_CCMR2_IC3PSC_1 ((uint32_t)0x0008) /*!<Bit 1 */
  6411. #define TIM_CCMR2_IC3F ((uint32_t)0x00F0) /*!<IC3F[3:0] bits (Input Capture 3 Filter) */
  6412. #define TIM_CCMR2_IC3F_0 ((uint32_t)0x0010) /*!<Bit 0 */
  6413. #define TIM_CCMR2_IC3F_1 ((uint32_t)0x0020) /*!<Bit 1 */
  6414. #define TIM_CCMR2_IC3F_2 ((uint32_t)0x0040) /*!<Bit 2 */
  6415. #define TIM_CCMR2_IC3F_3 ((uint32_t)0x0080) /*!<Bit 3 */
  6416. #define TIM_CCMR2_IC4PSC ((uint32_t)0x0C00) /*!<IC4PSC[1:0] bits (Input Capture 4 Prescaler) */
  6417. #define TIM_CCMR2_IC4PSC_0 ((uint32_t)0x0400) /*!<Bit 0 */
  6418. #define TIM_CCMR2_IC4PSC_1 ((uint32_t)0x0800) /*!<Bit 1 */
  6419. #define TIM_CCMR2_IC4F ((uint32_t)0xF000) /*!<IC4F[3:0] bits (Input Capture 4 Filter) */
  6420. #define TIM_CCMR2_IC4F_0 ((uint32_t)0x1000) /*!<Bit 0 */
  6421. #define TIM_CCMR2_IC4F_1 ((uint32_t)0x2000) /*!<Bit 1 */
  6422. #define TIM_CCMR2_IC4F_2 ((uint32_t)0x4000) /*!<Bit 2 */
  6423. #define TIM_CCMR2_IC4F_3 ((uint32_t)0x8000) /*!<Bit 3 */
  6424. /******************* Bit definition for TIM_CCER register *******************/
  6425. #define TIM_CCER_CC1E ((uint32_t)0x0001) /*!<Capture/Compare 1 output enable */
  6426. #define TIM_CCER_CC1P ((uint32_t)0x0002) /*!<Capture/Compare 1 output Polarity */
  6427. #define TIM_CCER_CC1NE ((uint32_t)0x0004) /*!<Capture/Compare 1 Complementary output enable */
  6428. #define TIM_CCER_CC1NP ((uint32_t)0x0008) /*!<Capture/Compare 1 Complementary output Polarity */
  6429. #define TIM_CCER_CC2E ((uint32_t)0x0010) /*!<Capture/Compare 2 output enable */
  6430. #define TIM_CCER_CC2P ((uint32_t)0x0020) /*!<Capture/Compare 2 output Polarity */
  6431. #define TIM_CCER_CC2NE ((uint32_t)0x0040) /*!<Capture/Compare 2 Complementary output enable */
  6432. #define TIM_CCER_CC2NP ((uint32_t)0x0080) /*!<Capture/Compare 2 Complementary output Polarity */
  6433. #define TIM_CCER_CC3E ((uint32_t)0x0100) /*!<Capture/Compare 3 output enable */
  6434. #define TIM_CCER_CC3P ((uint32_t)0x0200) /*!<Capture/Compare 3 output Polarity */
  6435. #define TIM_CCER_CC3NE ((uint32_t)0x0400) /*!<Capture/Compare 3 Complementary output enable */
  6436. #define TIM_CCER_CC3NP ((uint32_t)0x0800) /*!<Capture/Compare 3 Complementary output Polarity */
  6437. #define TIM_CCER_CC4E ((uint32_t)0x1000) /*!<Capture/Compare 4 output enable */
  6438. #define TIM_CCER_CC4P ((uint32_t)0x2000) /*!<Capture/Compare 4 output Polarity */
  6439. #define TIM_CCER_CC4NP ((uint32_t)0x8000) /*!<Capture/Compare 4 Complementary output Polarity */
  6440. /******************* Bit definition for TIM_CNT register ********************/
  6441. #define TIM_CNT_CNT ((uint32_t)0xFFFF) /*!<Counter Value */
  6442. /******************* Bit definition for TIM_PSC register ********************/
  6443. #define TIM_PSC_PSC ((uint32_t)0xFFFF) /*!<Prescaler Value */
  6444. /******************* Bit definition for TIM_ARR register ********************/
  6445. #define TIM_ARR_ARR ((uint32_t)0xFFFF) /*!<actual auto-reload Value */
  6446. /******************* Bit definition for TIM_RCR register ********************/
  6447. #define TIM_RCR_REP ((uint32_t)0xFF) /*!<Repetition Counter Value */
  6448. /******************* Bit definition for TIM_CCR1 register *******************/
  6449. #define TIM_CCR1_CCR1 ((uint32_t)0xFFFF) /*!<Capture/Compare 1 Value */
  6450. /******************* Bit definition for TIM_CCR2 register *******************/
  6451. #define TIM_CCR2_CCR2 ((uint32_t)0xFFFF) /*!<Capture/Compare 2 Value */
  6452. /******************* Bit definition for TIM_CCR3 register *******************/
  6453. #define TIM_CCR3_CCR3 ((uint32_t)0xFFFF) /*!<Capture/Compare 3 Value */
  6454. /******************* Bit definition for TIM_CCR4 register *******************/
  6455. #define TIM_CCR4_CCR4 ((uint32_t)0xFFFF) /*!<Capture/Compare 4 Value */
  6456. /******************* Bit definition for TIM_BDTR register *******************/
  6457. #define TIM_BDTR_DTG ((uint32_t)0x00FF) /*!<DTG[0:7] bits (Dead-Time Generator set-up) */
  6458. #define TIM_BDTR_DTG_0 ((uint32_t)0x0001) /*!<Bit 0 */
  6459. #define TIM_BDTR_DTG_1 ((uint32_t)0x0002) /*!<Bit 1 */
  6460. #define TIM_BDTR_DTG_2 ((uint32_t)0x0004) /*!<Bit 2 */
  6461. #define TIM_BDTR_DTG_3 ((uint32_t)0x0008) /*!<Bit 3 */
  6462. #define TIM_BDTR_DTG_4 ((uint32_t)0x0010) /*!<Bit 4 */
  6463. #define TIM_BDTR_DTG_5 ((uint32_t)0x0020) /*!<Bit 5 */
  6464. #define TIM_BDTR_DTG_6 ((uint32_t)0x0040) /*!<Bit 6 */
  6465. #define TIM_BDTR_DTG_7 ((uint32_t)0x0080) /*!<Bit 7 */
  6466. #define TIM_BDTR_LOCK ((uint32_t)0x0300) /*!<LOCK[1:0] bits (Lock Configuration) */
  6467. #define TIM_BDTR_LOCK_0 ((uint32_t)0x0100) /*!<Bit 0 */
  6468. #define TIM_BDTR_LOCK_1 ((uint32_t)0x0200) /*!<Bit 1 */
  6469. #define TIM_BDTR_OSSI ((uint32_t)0x0400) /*!<Off-State Selection for Idle mode */
  6470. #define TIM_BDTR_OSSR ((uint32_t)0x0800) /*!<Off-State Selection for Run mode */
  6471. #define TIM_BDTR_BKE ((uint32_t)0x1000) /*!<Break enable */
  6472. #define TIM_BDTR_BKP ((uint32_t)0x2000) /*!<Break Polarity */
  6473. #define TIM_BDTR_AOE ((uint32_t)0x4000) /*!<Automatic Output enable */
  6474. #define TIM_BDTR_MOE ((uint32_t)0x8000) /*!<Main Output enable */
  6475. /******************* Bit definition for TIM_DCR register ********************/
  6476. #define TIM_DCR_DBA ((uint32_t)0x001F) /*!<DBA[4:0] bits (DMA Base Address) */
  6477. #define TIM_DCR_DBA_0 ((uint32_t)0x0001) /*!<Bit 0 */
  6478. #define TIM_DCR_DBA_1 ((uint32_t)0x0002) /*!<Bit 1 */
  6479. #define TIM_DCR_DBA_2 ((uint32_t)0x0004) /*!<Bit 2 */
  6480. #define TIM_DCR_DBA_3 ((uint32_t)0x0008) /*!<Bit 3 */
  6481. #define TIM_DCR_DBA_4 ((uint32_t)0x0010) /*!<Bit 4 */
  6482. #define TIM_DCR_DBL ((uint32_t)0x1F00) /*!<DBL[4:0] bits (DMA Burst Length) */
  6483. #define TIM_DCR_DBL_0 ((uint32_t)0x0100) /*!<Bit 0 */
  6484. #define TIM_DCR_DBL_1 ((uint32_t)0x0200) /*!<Bit 1 */
  6485. #define TIM_DCR_DBL_2 ((uint32_t)0x0400) /*!<Bit 2 */
  6486. #define TIM_DCR_DBL_3 ((uint32_t)0x0800) /*!<Bit 3 */
  6487. #define TIM_DCR_DBL_4 ((uint32_t)0x1000) /*!<Bit 4 */
  6488. /******************* Bit definition for TIM_DMAR register *******************/
  6489. #define TIM_DMAR_DMAB ((uint32_t)0xFFFF) /*!<DMA register for burst accesses */
  6490. /******************* Bit definition for TIM_OR register *********************/
  6491. #define TIM_OR_TI4_RMP ((uint32_t)0x00C0) /*!<TI4_RMP[1:0] bits (TIM5 Input 4 remap) */
  6492. #define TIM_OR_TI4_RMP_0 ((uint32_t)0x0040) /*!<Bit 0 */
  6493. #define TIM_OR_TI4_RMP_1 ((uint32_t)0x0080) /*!<Bit 1 */
  6494. #define TIM_OR_ITR1_RMP ((uint32_t)0x0C00) /*!<ITR1_RMP[1:0] bits (TIM2 Internal trigger 1 remap) */
  6495. #define TIM_OR_ITR1_RMP_0 ((uint32_t)0x0400) /*!<Bit 0 */
  6496. #define TIM_OR_ITR1_RMP_1 ((uint32_t)0x0800) /*!<Bit 1 */
  6497. /******************************************************************************/
  6498. /* */
  6499. /* Universal Synchronous Asynchronous Receiver Transmitter */
  6500. /* */
  6501. /******************************************************************************/
  6502. /******************* Bit definition for USART_SR register *******************/
  6503. #define USART_SR_PE ((uint32_t)0x0001) /*!<Parity Error */
  6504. #define USART_SR_FE ((uint32_t)0x0002) /*!<Framing Error */
  6505. #define USART_SR_NE ((uint32_t)0x0004) /*!<Noise Error Flag */
  6506. #define USART_SR_ORE ((uint32_t)0x0008) /*!<OverRun Error */
  6507. #define USART_SR_IDLE ((uint32_t)0x0010) /*!<IDLE line detected */
  6508. #define USART_SR_RXNE ((uint32_t)0x0020) /*!<Read Data Register Not Empty */
  6509. #define USART_SR_TC ((uint32_t)0x0040) /*!<Transmission Complete */
  6510. #define USART_SR_TXE ((uint32_t)0x0080) /*!<Transmit Data Register Empty */
  6511. #define USART_SR_LBD ((uint32_t)0x0100) /*!<LIN Break Detection Flag */
  6512. #define USART_SR_CTS ((uint32_t)0x0200) /*!<CTS Flag */
  6513. /******************* Bit definition for USART_DR register *******************/
  6514. #define USART_DR_DR ((uint32_t)0x01FF) /*!<Data value */
  6515. /****************** Bit definition for USART_BRR register *******************/
  6516. #define USART_BRR_DIV_Fraction ((uint32_t)0x000F) /*!<Fraction of USARTDIV */
  6517. #define USART_BRR_DIV_Mantissa ((uint32_t)0xFFF0) /*!<Mantissa of USARTDIV */
  6518. /****************** Bit definition for USART_CR1 register *******************/
  6519. #define USART_CR1_SBK ((uint32_t)0x0001) /*!<Send Break */
  6520. #define USART_CR1_RWU ((uint32_t)0x0002) /*!<Receiver wakeup */
  6521. #define USART_CR1_RE ((uint32_t)0x0004) /*!<Receiver Enable */
  6522. #define USART_CR1_TE ((uint32_t)0x0008) /*!<Transmitter Enable */
  6523. #define USART_CR1_IDLEIE ((uint32_t)0x0010) /*!<IDLE Interrupt Enable */
  6524. #define USART_CR1_RXNEIE ((uint32_t)0x0020) /*!<RXNE Interrupt Enable */
  6525. #define USART_CR1_TCIE ((uint32_t)0x0040) /*!<Transmission Complete Interrupt Enable */
  6526. #define USART_CR1_TXEIE ((uint32_t)0x0080) /*!<PE Interrupt Enable */
  6527. #define USART_CR1_PEIE ((uint32_t)0x0100) /*!<PE Interrupt Enable */
  6528. #define USART_CR1_PS ((uint32_t)0x0200) /*!<Parity Selection */
  6529. #define USART_CR1_PCE ((uint32_t)0x0400) /*!<Parity Control Enable */
  6530. #define USART_CR1_WAKE ((uint32_t)0x0800) /*!<Wakeup method */
  6531. #define USART_CR1_M ((uint32_t)0x1000) /*!<Word length */
  6532. #define USART_CR1_UE ((uint32_t)0x2000) /*!<USART Enable */
  6533. #define USART_CR1_OVER8 ((uint32_t)0x8000) /*!<USART Oversampling by 8 enable */
  6534. /****************** Bit definition for USART_CR2 register *******************/
  6535. #define USART_CR2_ADD ((uint32_t)0x000F) /*!<Address of the USART node */
  6536. #define USART_CR2_LBDL ((uint32_t)0x0020) /*!<LIN Break Detection Length */
  6537. #define USART_CR2_LBDIE ((uint32_t)0x0040) /*!<LIN Break Detection Interrupt Enable */
  6538. #define USART_CR2_LBCL ((uint32_t)0x0100) /*!<Last Bit Clock pulse */
  6539. #define USART_CR2_CPHA ((uint32_t)0x0200) /*!<Clock Phase */
  6540. #define USART_CR2_CPOL ((uint32_t)0x0400) /*!<Clock Polarity */
  6541. #define USART_CR2_CLKEN ((uint32_t)0x0800) /*!<Clock Enable */
  6542. #define USART_CR2_STOP ((uint32_t)0x3000) /*!<STOP[1:0] bits (STOP bits) */
  6543. #define USART_CR2_STOP_0 ((uint32_t)0x1000) /*!<Bit 0 */
  6544. #define USART_CR2_STOP_1 ((uint32_t)0x2000) /*!<Bit 1 */
  6545. #define USART_CR2_LINEN ((uint32_t)0x4000) /*!<LIN mode enable */
  6546. /****************** Bit definition for USART_CR3 register *******************/
  6547. #define USART_CR3_EIE ((uint32_t)0x0001) /*!<Error Interrupt Enable */
  6548. #define USART_CR3_IREN ((uint32_t)0x0002) /*!<IrDA mode Enable */
  6549. #define USART_CR3_IRLP ((uint32_t)0x0004) /*!<IrDA Low-Power */
  6550. #define USART_CR3_HDSEL ((uint32_t)0x0008) /*!<Half-Duplex Selection */
  6551. #define USART_CR3_NACK ((uint32_t)0x0010) /*!<Smartcard NACK enable */
  6552. #define USART_CR3_SCEN ((uint32_t)0x0020) /*!<Smartcard mode enable */
  6553. #define USART_CR3_DMAR ((uint32_t)0x0040) /*!<DMA Enable Receiver */
  6554. #define USART_CR3_DMAT ((uint32_t)0x0080) /*!<DMA Enable Transmitter */
  6555. #define USART_CR3_RTSE ((uint32_t)0x0100) /*!<RTS Enable */
  6556. #define USART_CR3_CTSE ((uint32_t)0x0200) /*!<CTS Enable */
  6557. #define USART_CR3_CTSIE ((uint32_t)0x0400) /*!<CTS Interrupt Enable */
  6558. #define USART_CR3_ONEBIT ((uint32_t)0x0800) /*!<USART One bit method enable */
  6559. /****************** Bit definition for USART_GTPR register ******************/
  6560. #define USART_GTPR_PSC ((uint32_t)0x00FF) /*!<PSC[7:0] bits (Prescaler value) */
  6561. #define USART_GTPR_PSC_0 ((uint32_t)0x0001) /*!<Bit 0 */
  6562. #define USART_GTPR_PSC_1 ((uint32_t)0x0002) /*!<Bit 1 */
  6563. #define USART_GTPR_PSC_2 ((uint32_t)0x0004) /*!<Bit 2 */
  6564. #define USART_GTPR_PSC_3 ((uint32_t)0x0008) /*!<Bit 3 */
  6565. #define USART_GTPR_PSC_4 ((uint32_t)0x0010) /*!<Bit 4 */
  6566. #define USART_GTPR_PSC_5 ((uint32_t)0x0020) /*!<Bit 5 */
  6567. #define USART_GTPR_PSC_6 ((uint32_t)0x0040) /*!<Bit 6 */
  6568. #define USART_GTPR_PSC_7 ((uint32_t)0x0080) /*!<Bit 7 */
  6569. #define USART_GTPR_GT ((uint32_t)0xFF00) /*!<Guard time value */
  6570. /******************************************************************************/
  6571. /* */
  6572. /* Window WATCHDOG */
  6573. /* */
  6574. /******************************************************************************/
  6575. /******************* Bit definition for WWDG_CR register ********************/
  6576. #define WWDG_CR_T ((uint32_t)0x7F) /*!<T[6:0] bits (7-Bit counter (MSB to LSB)) */
  6577. #define WWDG_CR_T0 ((uint32_t)0x01) /*!<Bit 0 */
  6578. #define WWDG_CR_T1 ((uint32_t)0x02) /*!<Bit 1 */
  6579. #define WWDG_CR_T2 ((uint32_t)0x04) /*!<Bit 2 */
  6580. #define WWDG_CR_T3 ((uint32_t)0x08) /*!<Bit 3 */
  6581. #define WWDG_CR_T4 ((uint32_t)0x10) /*!<Bit 4 */
  6582. #define WWDG_CR_T5 ((uint32_t)0x20) /*!<Bit 5 */
  6583. #define WWDG_CR_T6 ((uint32_t)0x40) /*!<Bit 6 */
  6584. #define WWDG_CR_WDGA ((uint32_t)0x80) /*!<Activation bit */
  6585. /******************* Bit definition for WWDG_CFR register *******************/
  6586. #define WWDG_CFR_W ((uint32_t)0x007F) /*!<W[6:0] bits (7-bit window value) */
  6587. #define WWDG_CFR_W0 ((uint32_t)0x0001) /*!<Bit 0 */
  6588. #define WWDG_CFR_W1 ((uint32_t)0x0002) /*!<Bit 1 */
  6589. #define WWDG_CFR_W2 ((uint32_t)0x0004) /*!<Bit 2 */
  6590. #define WWDG_CFR_W3 ((uint32_t)0x0008) /*!<Bit 3 */
  6591. #define WWDG_CFR_W4 ((uint32_t)0x0010) /*!<Bit 4 */
  6592. #define WWDG_CFR_W5 ((uint32_t)0x0020) /*!<Bit 5 */
  6593. #define WWDG_CFR_W6 ((uint32_t)0x0040) /*!<Bit 6 */
  6594. #define WWDG_CFR_WDGTB ((uint32_t)0x0180) /*!<WDGTB[1:0] bits (Timer Base) */
  6595. #define WWDG_CFR_WDGTB0 ((uint32_t)0x0080) /*!<Bit 0 */
  6596. #define WWDG_CFR_WDGTB1 ((uint32_t)0x0100) /*!<Bit 1 */
  6597. #define WWDG_CFR_EWI ((uint32_t)0x0200) /*!<Early Wakeup Interrupt */
  6598. /******************* Bit definition for WWDG_SR register ********************/
  6599. #define WWDG_SR_EWIF ((uint32_t)0x01) /*!<Early Wakeup Interrupt Flag */
  6600. /******************************************************************************/
  6601. /* */
  6602. /* DBG */
  6603. /* */
  6604. /******************************************************************************/
  6605. /******************** Bit definition for DBGMCU_IDCODE register *************/
  6606. #define DBGMCU_IDCODE_DEV_ID ((uint32_t)0x00000FFF)
  6607. #define DBGMCU_IDCODE_REV_ID ((uint32_t)0xFFFF0000)
  6608. /******************** Bit definition for DBGMCU_CR register *****************/
  6609. #define DBGMCU_CR_DBG_SLEEP ((uint32_t)0x00000001)
  6610. #define DBGMCU_CR_DBG_STOP ((uint32_t)0x00000002)
  6611. #define DBGMCU_CR_DBG_STANDBY ((uint32_t)0x00000004)
  6612. #define DBGMCU_CR_TRACE_IOEN ((uint32_t)0x00000020)
  6613. #define DBGMCU_CR_TRACE_MODE ((uint32_t)0x000000C0)
  6614. #define DBGMCU_CR_TRACE_MODE_0 ((uint32_t)0x00000040)/*!<Bit 0 */
  6615. #define DBGMCU_CR_TRACE_MODE_1 ((uint32_t)0x00000080)/*!<Bit 1 */
  6616. /******************** Bit definition for DBGMCU_APB1_FZ register ************/
  6617. #define DBGMCU_APB1_FZ_DBG_TIM2_STOP ((uint32_t)0x00000001)
  6618. #define DBGMCU_APB1_FZ_DBG_TIM3_STOP ((uint32_t)0x00000002)
  6619. #define DBGMCU_APB1_FZ_DBG_TIM4_STOP ((uint32_t)0x00000004)
  6620. #define DBGMCU_APB1_FZ_DBG_TIM5_STOP ((uint32_t)0x00000008)
  6621. #define DBGMCU_APB1_FZ_DBG_TIM6_STOP ((uint32_t)0x00000010)
  6622. #define DBGMCU_APB1_FZ_DBG_TIM7_STOP ((uint32_t)0x00000020)
  6623. #define DBGMCU_APB1_FZ_DBG_TIM12_STOP ((uint32_t)0x00000040)
  6624. #define DBGMCU_APB1_FZ_DBG_TIM13_STOP ((uint32_t)0x00000080)
  6625. #define DBGMCU_APB1_FZ_DBG_TIM14_STOP ((uint32_t)0x00000100)
  6626. #define DBGMCU_APB1_FZ_DBG_RTC_STOP ((uint32_t)0x00000400)
  6627. #define DBGMCU_APB1_FZ_DBG_WWDG_STOP ((uint32_t)0x00000800)
  6628. #define DBGMCU_APB1_FZ_DBG_IWDG_STOP ((uint32_t)0x00001000)
  6629. #define DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT ((uint32_t)0x00200000)
  6630. #define DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT ((uint32_t)0x00400000)
  6631. #define DBGMCU_APB1_FZ_DBG_I2C3_SMBUS_TIMEOUT ((uint32_t)0x00800000)
  6632. #define DBGMCU_APB1_FZ_DBG_CAN1_STOP ((uint32_t)0x02000000)
  6633. #define DBGMCU_APB1_FZ_DBG_CAN2_STOP ((uint32_t)0x04000000)
  6634. /* Old IWDGSTOP bit definition, maintained for legacy purpose */
  6635. #define DBGMCU_APB1_FZ_DBG_IWDEG_STOP DBGMCU_APB1_FZ_DBG_IWDG_STOP
  6636. /******************** Bit definition for DBGMCU_APB2_FZ register ************/
  6637. #define DBGMCU_APB2_FZ_DBG_TIM1_STOP ((uint32_t)0x00000001)
  6638. #define DBGMCU_APB2_FZ_DBG_TIM8_STOP ((uint32_t)0x00000002)
  6639. #define DBGMCU_APB2_FZ_DBG_TIM9_STOP ((uint32_t)0x00010000)
  6640. #define DBGMCU_APB2_FZ_DBG_TIM10_STOP ((uint32_t)0x00020000)
  6641. #define DBGMCU_APB2_FZ_DBG_TIM11_STOP ((uint32_t)0x00040000)
  6642. /******************************************************************************/
  6643. /* */
  6644. /* Ethernet MAC Registers bits definitions */
  6645. /* */
  6646. /******************************************************************************/
  6647. /* Bit definition for Ethernet MAC Control Register register */
  6648. #define ETH_MACCR_WD ((uint32_t)0x00800000) /* Watchdog disable */
  6649. #define ETH_MACCR_JD ((uint32_t)0x00400000) /* Jabber disable */
  6650. #define ETH_MACCR_IFG ((uint32_t)0x000E0000) /* Inter-frame gap */
  6651. #define ETH_MACCR_IFG_96Bit ((uint32_t)0x00000000) /* Minimum IFG between frames during transmission is 96Bit */
  6652. #define ETH_MACCR_IFG_88Bit ((uint32_t)0x00020000) /* Minimum IFG between frames during transmission is 88Bit */
  6653. #define ETH_MACCR_IFG_80Bit ((uint32_t)0x00040000) /* Minimum IFG between frames during transmission is 80Bit */
  6654. #define ETH_MACCR_IFG_72Bit ((uint32_t)0x00060000) /* Minimum IFG between frames during transmission is 72Bit */
  6655. #define ETH_MACCR_IFG_64Bit ((uint32_t)0x00080000) /* Minimum IFG between frames during transmission is 64Bit */
  6656. #define ETH_MACCR_IFG_56Bit ((uint32_t)0x000A0000) /* Minimum IFG between frames during transmission is 56Bit */
  6657. #define ETH_MACCR_IFG_48Bit ((uint32_t)0x000C0000) /* Minimum IFG between frames during transmission is 48Bit */
  6658. #define ETH_MACCR_IFG_40Bit ((uint32_t)0x000E0000) /* Minimum IFG between frames during transmission is 40Bit */
  6659. #define ETH_MACCR_CSD ((uint32_t)0x00010000) /* Carrier sense disable (during transmission) */
  6660. #define ETH_MACCR_FES ((uint32_t)0x00004000) /* Fast ethernet speed */
  6661. #define ETH_MACCR_ROD ((uint32_t)0x00002000) /* Receive own disable */
  6662. #define ETH_MACCR_LM ((uint32_t)0x00001000) /* loopback mode */
  6663. #define ETH_MACCR_DM ((uint32_t)0x00000800) /* Duplex mode */
  6664. #define ETH_MACCR_IPCO ((uint32_t)0x00000400) /* IP Checksum offload */
  6665. #define ETH_MACCR_RD ((uint32_t)0x00000200) /* Retry disable */
  6666. #define ETH_MACCR_APCS ((uint32_t)0x00000080) /* Automatic Pad/CRC stripping */
  6667. #define ETH_MACCR_BL ((uint32_t)0x00000060) /* Back-off limit: random integer number (r) of slot time delays before rescheduling
  6668. a transmission attempt during retries after a collision: 0 =< r <2^k */
  6669. #define ETH_MACCR_BL_10 ((uint32_t)0x00000000) /* k = min (n, 10) */
  6670. #define ETH_MACCR_BL_8 ((uint32_t)0x00000020) /* k = min (n, 8) */
  6671. #define ETH_MACCR_BL_4 ((uint32_t)0x00000040) /* k = min (n, 4) */
  6672. #define ETH_MACCR_BL_1 ((uint32_t)0x00000060) /* k = min (n, 1) */
  6673. #define ETH_MACCR_DC ((uint32_t)0x00000010) /* Defferal check */
  6674. #define ETH_MACCR_TE ((uint32_t)0x00000008) /* Transmitter enable */
  6675. #define ETH_MACCR_RE ((uint32_t)0x00000004) /* Receiver enable */
  6676. /* Bit definition for Ethernet MAC Frame Filter Register */
  6677. #define ETH_MACFFR_RA ((uint32_t)0x80000000) /* Receive all */
  6678. #define ETH_MACFFR_HPF ((uint32_t)0x00000400) /* Hash or perfect filter */
  6679. #define ETH_MACFFR_SAF ((uint32_t)0x00000200) /* Source address filter enable */
  6680. #define ETH_MACFFR_SAIF ((uint32_t)0x00000100) /* SA inverse filtering */
  6681. #define ETH_MACFFR_PCF ((uint32_t)0x000000C0) /* Pass control frames: 3 cases */
  6682. #define ETH_MACFFR_PCF_BlockAll ((uint32_t)0x00000040) /* MAC filters all control frames from reaching the application */
  6683. #define ETH_MACFFR_PCF_ForwardAll ((uint32_t)0x00000080) /* MAC forwards all control frames to application even if they fail the Address Filter */
  6684. #define ETH_MACFFR_PCF_ForwardPassedAddrFilter ((uint32_t)0x000000C0) /* MAC forwards control frames that pass the Address Filter. */
  6685. #define ETH_MACFFR_BFD ((uint32_t)0x00000020) /* Broadcast frame disable */
  6686. #define ETH_MACFFR_PAM ((uint32_t)0x00000010) /* Pass all mutlicast */
  6687. #define ETH_MACFFR_DAIF ((uint32_t)0x00000008) /* DA Inverse filtering */
  6688. #define ETH_MACFFR_HM ((uint32_t)0x00000004) /* Hash multicast */
  6689. #define ETH_MACFFR_HU ((uint32_t)0x00000002) /* Hash unicast */
  6690. #define ETH_MACFFR_PM ((uint32_t)0x00000001) /* Promiscuous mode */
  6691. /* Bit definition for Ethernet MAC Hash Table High Register */
  6692. #define ETH_MACHTHR_HTH ((uint32_t)0xFFFFFFFF) /* Hash table high */
  6693. /* Bit definition for Ethernet MAC Hash Table Low Register */
  6694. #define ETH_MACHTLR_HTL ((uint32_t)0xFFFFFFFF) /* Hash table low */
  6695. /* Bit definition for Ethernet MAC MII Address Register */
  6696. #define ETH_MACMIIAR_PA ((uint32_t)0x0000F800) /* Physical layer address */
  6697. #define ETH_MACMIIAR_MR ((uint32_t)0x000007C0) /* MII register in the selected PHY */
  6698. #define ETH_MACMIIAR_CR ((uint32_t)0x0000001C) /* CR clock range: 6 cases */
  6699. #define ETH_MACMIIAR_CR_Div42 ((uint32_t)0x00000000) /* HCLK:60-100 MHz; MDC clock= HCLK/42 */
  6700. #define ETH_MACMIIAR_CR_Div62 ((uint32_t)0x00000004) /* HCLK:100-150 MHz; MDC clock= HCLK/62 */
  6701. #define ETH_MACMIIAR_CR_Div16 ((uint32_t)0x00000008) /* HCLK:20-35 MHz; MDC clock= HCLK/16 */
  6702. #define ETH_MACMIIAR_CR_Div26 ((uint32_t)0x0000000C) /* HCLK:35-60 MHz; MDC clock= HCLK/26 */
  6703. #define ETH_MACMIIAR_CR_Div102 ((uint32_t)0x00000010) /* HCLK:150-168 MHz; MDC clock= HCLK/102 */
  6704. #define ETH_MACMIIAR_MW ((uint32_t)0x00000002) /* MII write */
  6705. #define ETH_MACMIIAR_MB ((uint32_t)0x00000001) /* MII busy */
  6706. /* Bit definition for Ethernet MAC MII Data Register */
  6707. #define ETH_MACMIIDR_MD ((uint32_t)0x0000FFFF) /* MII data: read/write data from/to PHY */
  6708. /* Bit definition for Ethernet MAC Flow Control Register */
  6709. #define ETH_MACFCR_PT ((uint32_t)0xFFFF0000) /* Pause time */
  6710. #define ETH_MACFCR_ZQPD ((uint32_t)0x00000080) /* Zero-quanta pause disable */
  6711. #define ETH_MACFCR_PLT ((uint32_t)0x00000030) /* Pause low threshold: 4 cases */
  6712. #define ETH_MACFCR_PLT_Minus4 ((uint32_t)0x00000000) /* Pause time minus 4 slot times */
  6713. #define ETH_MACFCR_PLT_Minus28 ((uint32_t)0x00000010) /* Pause time minus 28 slot times */
  6714. #define ETH_MACFCR_PLT_Minus144 ((uint32_t)0x00000020) /* Pause time minus 144 slot times */
  6715. #define ETH_MACFCR_PLT_Minus256 ((uint32_t)0x00000030) /* Pause time minus 256 slot times */
  6716. #define ETH_MACFCR_UPFD ((uint32_t)0x00000008) /* Unicast pause frame detect */
  6717. #define ETH_MACFCR_RFCE ((uint32_t)0x00000004) /* Receive flow control enable */
  6718. #define ETH_MACFCR_TFCE ((uint32_t)0x00000002) /* Transmit flow control enable */
  6719. #define ETH_MACFCR_FCBBPA ((uint32_t)0x00000001) /* Flow control busy/backpressure activate */
  6720. /* Bit definition for Ethernet MAC VLAN Tag Register */
  6721. #define ETH_MACVLANTR_VLANTC ((uint32_t)0x00010000) /* 12-bit VLAN tag comparison */
  6722. #define ETH_MACVLANTR_VLANTI ((uint32_t)0x0000FFFF) /* VLAN tag identifier (for receive frames) */
  6723. /* Bit definition for Ethernet MAC Remote Wake-UpFrame Filter Register */
  6724. #define ETH_MACRWUFFR_D ((uint32_t)0xFFFFFFFF) /* Wake-up frame filter register data */
  6725. /* Eight sequential Writes to this address (offset 0x28) will write all Wake-UpFrame Filter Registers.
  6726. Eight sequential Reads from this address (offset 0x28) will read all Wake-UpFrame Filter Registers. */
  6727. /* Wake-UpFrame Filter Reg0 : Filter 0 Byte Mask
  6728. Wake-UpFrame Filter Reg1 : Filter 1 Byte Mask
  6729. Wake-UpFrame Filter Reg2 : Filter 2 Byte Mask
  6730. Wake-UpFrame Filter Reg3 : Filter 3 Byte Mask
  6731. Wake-UpFrame Filter Reg4 : RSVD - Filter3 Command - RSVD - Filter2 Command -
  6732. RSVD - Filter1 Command - RSVD - Filter0 Command
  6733. Wake-UpFrame Filter Re5 : Filter3 Offset - Filter2 Offset - Filter1 Offset - Filter0 Offset
  6734. Wake-UpFrame Filter Re6 : Filter1 CRC16 - Filter0 CRC16
  6735. Wake-UpFrame Filter Re7 : Filter3 CRC16 - Filter2 CRC16 */
  6736. /* Bit definition for Ethernet MAC PMT Control and Status Register */
  6737. #define ETH_MACPMTCSR_WFFRPR ((uint32_t)0x80000000) /* Wake-Up Frame Filter Register Pointer Reset */
  6738. #define ETH_MACPMTCSR_GU ((uint32_t)0x00000200) /* Global Unicast */
  6739. #define ETH_MACPMTCSR_WFR ((uint32_t)0x00000040) /* Wake-Up Frame Received */
  6740. #define ETH_MACPMTCSR_MPR ((uint32_t)0x00000020) /* Magic Packet Received */
  6741. #define ETH_MACPMTCSR_WFE ((uint32_t)0x00000004) /* Wake-Up Frame Enable */
  6742. #define ETH_MACPMTCSR_MPE ((uint32_t)0x00000002) /* Magic Packet Enable */
  6743. #define ETH_MACPMTCSR_PD ((uint32_t)0x00000001) /* Power Down */
  6744. /* Bit definition for Ethernet MAC Status Register */
  6745. #define ETH_MACSR_TSTS ((uint32_t)0x00000200) /* Time stamp trigger status */
  6746. #define ETH_MACSR_MMCTS ((uint32_t)0x00000040) /* MMC transmit status */
  6747. #define ETH_MACSR_MMMCRS ((uint32_t)0x00000020) /* MMC receive status */
  6748. #define ETH_MACSR_MMCS ((uint32_t)0x00000010) /* MMC status */
  6749. #define ETH_MACSR_PMTS ((uint32_t)0x00000008) /* PMT status */
  6750. /* Bit definition for Ethernet MAC Interrupt Mask Register */
  6751. #define ETH_MACIMR_TSTIM ((uint32_t)0x00000200) /* Time stamp trigger interrupt mask */
  6752. #define ETH_MACIMR_PMTIM ((uint32_t)0x00000008) /* PMT interrupt mask */
  6753. /* Bit definition for Ethernet MAC Address0 High Register */
  6754. #define ETH_MACA0HR_MACA0H ((uint32_t)0x0000FFFF) /* MAC address0 high */
  6755. /* Bit definition for Ethernet MAC Address0 Low Register */
  6756. #define ETH_MACA0LR_MACA0L ((uint32_t)0xFFFFFFFF) /* MAC address0 low */
  6757. /* Bit definition for Ethernet MAC Address1 High Register */
  6758. #define ETH_MACA1HR_AE ((uint32_t)0x80000000) /* Address enable */
  6759. #define ETH_MACA1HR_SA ((uint32_t)0x40000000) /* Source address */
  6760. #define ETH_MACA1HR_MBC ((uint32_t)0x3F000000) /* Mask byte control: bits to mask for comparison of the MAC Address bytes */
  6761. #define ETH_MACA1HR_MBC_HBits15_8 ((uint32_t)0x20000000) /* Mask MAC Address high reg bits [15:8] */
  6762. #define ETH_MACA1HR_MBC_HBits7_0 ((uint32_t)0x10000000) /* Mask MAC Address high reg bits [7:0] */
  6763. #define ETH_MACA1HR_MBC_LBits31_24 ((uint32_t)0x08000000) /* Mask MAC Address low reg bits [31:24] */
  6764. #define ETH_MACA1HR_MBC_LBits23_16 ((uint32_t)0x04000000) /* Mask MAC Address low reg bits [23:16] */
  6765. #define ETH_MACA1HR_MBC_LBits15_8 ((uint32_t)0x02000000) /* Mask MAC Address low reg bits [15:8] */
  6766. #define ETH_MACA1HR_MBC_LBits7_0 ((uint32_t)0x01000000) /* Mask MAC Address low reg bits [7:0] */
  6767. #define ETH_MACA1HR_MACA1H ((uint32_t)0x0000FFFF) /* MAC address1 high */
  6768. /* Bit definition for Ethernet MAC Address1 Low Register */
  6769. #define ETH_MACA1LR_MACA1L ((uint32_t)0xFFFFFFFF) /* MAC address1 low */
  6770. /* Bit definition for Ethernet MAC Address2 High Register */
  6771. #define ETH_MACA2HR_AE ((uint32_t)0x80000000) /* Address enable */
  6772. #define ETH_MACA2HR_SA ((uint32_t)0x40000000) /* Source address */
  6773. #define ETH_MACA2HR_MBC ((uint32_t)0x3F000000) /* Mask byte control */
  6774. #define ETH_MACA2HR_MBC_HBits15_8 ((uint32_t)0x20000000) /* Mask MAC Address high reg bits [15:8] */
  6775. #define ETH_MACA2HR_MBC_HBits7_0 ((uint32_t)0x10000000) /* Mask MAC Address high reg bits [7:0] */
  6776. #define ETH_MACA2HR_MBC_LBits31_24 ((uint32_t)0x08000000) /* Mask MAC Address low reg bits [31:24] */
  6777. #define ETH_MACA2HR_MBC_LBits23_16 ((uint32_t)0x04000000) /* Mask MAC Address low reg bits [23:16] */
  6778. #define ETH_MACA2HR_MBC_LBits15_8 ((uint32_t)0x02000000) /* Mask MAC Address low reg bits [15:8] */
  6779. #define ETH_MACA2HR_MBC_LBits7_0 ((uint32_t)0x01000000) /* Mask MAC Address low reg bits [70] */
  6780. #define ETH_MACA2HR_MACA2H ((uint32_t)0x0000FFFF) /* MAC address1 high */
  6781. /* Bit definition for Ethernet MAC Address2 Low Register */
  6782. #define ETH_MACA2LR_MACA2L ((uint32_t)0xFFFFFFFF) /* MAC address2 low */
  6783. /* Bit definition for Ethernet MAC Address3 High Register */
  6784. #define ETH_MACA3HR_AE ((uint32_t)0x80000000) /* Address enable */
  6785. #define ETH_MACA3HR_SA ((uint32_t)0x40000000) /* Source address */
  6786. #define ETH_MACA3HR_MBC ((uint32_t)0x3F000000) /* Mask byte control */
  6787. #define ETH_MACA3HR_MBC_HBits15_8 ((uint32_t)0x20000000) /* Mask MAC Address high reg bits [15:8] */
  6788. #define ETH_MACA3HR_MBC_HBits7_0 ((uint32_t)0x10000000) /* Mask MAC Address high reg bits [7:0] */
  6789. #define ETH_MACA3HR_MBC_LBits31_24 ((uint32_t)0x08000000) /* Mask MAC Address low reg bits [31:24] */
  6790. #define ETH_MACA3HR_MBC_LBits23_16 ((uint32_t)0x04000000) /* Mask MAC Address low reg bits [23:16] */
  6791. #define ETH_MACA3HR_MBC_LBits15_8 ((uint32_t)0x02000000) /* Mask MAC Address low reg bits [15:8] */
  6792. #define ETH_MACA3HR_MBC_LBits7_0 ((uint32_t)0x01000000) /* Mask MAC Address low reg bits [70] */
  6793. #define ETH_MACA3HR_MACA3H ((uint32_t)0x0000FFFF) /* MAC address3 high */
  6794. /* Bit definition for Ethernet MAC Address3 Low Register */
  6795. #define ETH_MACA3LR_MACA3L ((uint32_t)0xFFFFFFFF) /* MAC address3 low */
  6796. /******************************************************************************/
  6797. /* Ethernet MMC Registers bits definition */
  6798. /******************************************************************************/
  6799. /* Bit definition for Ethernet MMC Contol Register */
  6800. #define ETH_MMCCR_MCFHP ((uint32_t)0x00000020) /* MMC counter Full-Half preset */
  6801. #define ETH_MMCCR_MCP ((uint32_t)0x00000010) /* MMC counter preset */
  6802. #define ETH_MMCCR_MCF ((uint32_t)0x00000008) /* MMC Counter Freeze */
  6803. #define ETH_MMCCR_ROR ((uint32_t)0x00000004) /* Reset on Read */
  6804. #define ETH_MMCCR_CSR ((uint32_t)0x00000002) /* Counter Stop Rollover */
  6805. #define ETH_MMCCR_CR ((uint32_t)0x00000001) /* Counters Reset */
  6806. /* Bit definition for Ethernet MMC Receive Interrupt Register */
  6807. #define ETH_MMCRIR_RGUFS ((uint32_t)0x00020000) /* Set when Rx good unicast frames counter reaches half the maximum value */
  6808. #define ETH_MMCRIR_RFAES ((uint32_t)0x00000040) /* Set when Rx alignment error counter reaches half the maximum value */
  6809. #define ETH_MMCRIR_RFCES ((uint32_t)0x00000020) /* Set when Rx crc error counter reaches half the maximum value */
  6810. /* Bit definition for Ethernet MMC Transmit Interrupt Register */
  6811. #define ETH_MMCTIR_TGFS ((uint32_t)0x00200000) /* Set when Tx good frame count counter reaches half the maximum value */
  6812. #define ETH_MMCTIR_TGFMSCS ((uint32_t)0x00008000) /* Set when Tx good multi col counter reaches half the maximum value */
  6813. #define ETH_MMCTIR_TGFSCS ((uint32_t)0x00004000) /* Set when Tx good single col counter reaches half the maximum value */
  6814. /* Bit definition for Ethernet MMC Receive Interrupt Mask Register */
  6815. #define ETH_MMCRIMR_RGUFM ((uint32_t)0x00020000) /* Mask the interrupt when Rx good unicast frames counter reaches half the maximum value */
  6816. #define ETH_MMCRIMR_RFAEM ((uint32_t)0x00000040) /* Mask the interrupt when when Rx alignment error counter reaches half the maximum value */
  6817. #define ETH_MMCRIMR_RFCEM ((uint32_t)0x00000020) /* Mask the interrupt when Rx crc error counter reaches half the maximum value */
  6818. /* Bit definition for Ethernet MMC Transmit Interrupt Mask Register */
  6819. #define ETH_MMCTIMR_TGFM ((uint32_t)0x00200000) /* Mask the interrupt when Tx good frame count counter reaches half the maximum value */
  6820. #define ETH_MMCTIMR_TGFMSCM ((uint32_t)0x00008000) /* Mask the interrupt when Tx good multi col counter reaches half the maximum value */
  6821. #define ETH_MMCTIMR_TGFSCM ((uint32_t)0x00004000) /* Mask the interrupt when Tx good single col counter reaches half the maximum value */
  6822. /* Bit definition for Ethernet MMC Transmitted Good Frames after Single Collision Counter Register */
  6823. #define ETH_MMCTGFSCCR_TGFSCC ((uint32_t)0xFFFFFFFF) /* Number of successfully transmitted frames after a single collision in Half-duplex mode. */
  6824. /* Bit definition for Ethernet MMC Transmitted Good Frames after More than a Single Collision Counter Register */
  6825. #define ETH_MMCTGFMSCCR_TGFMSCC ((uint32_t)0xFFFFFFFF) /* Number of successfully transmitted frames after more than a single collision in Half-duplex mode. */
  6826. /* Bit definition for Ethernet MMC Transmitted Good Frames Counter Register */
  6827. #define ETH_MMCTGFCR_TGFC ((uint32_t)0xFFFFFFFF) /* Number of good frames transmitted. */
  6828. /* Bit definition for Ethernet MMC Received Frames with CRC Error Counter Register */
  6829. #define ETH_MMCRFCECR_RFCEC ((uint32_t)0xFFFFFFFF) /* Number of frames received with CRC error. */
  6830. /* Bit definition for Ethernet MMC Received Frames with Alignement Error Counter Register */
  6831. #define ETH_MMCRFAECR_RFAEC ((uint32_t)0xFFFFFFFF) /* Number of frames received with alignment (dribble) error */
  6832. /* Bit definition for Ethernet MMC Received Good Unicast Frames Counter Register */
  6833. #define ETH_MMCRGUFCR_RGUFC ((uint32_t)0xFFFFFFFF) /* Number of good unicast frames received. */
  6834. /******************************************************************************/
  6835. /* Ethernet PTP Registers bits definition */
  6836. /******************************************************************************/
  6837. /* Bit definition for Ethernet PTP Time Stamp Contol Register */
  6838. #define ETH_PTPTSCR_TSCNT ((uint32_t)0x00030000) /* Time stamp clock node type */
  6839. #define ETH_PTPTSSR_TSSMRME ((uint32_t)0x00008000) /* Time stamp snapshot for message relevant to master enable */
  6840. #define ETH_PTPTSSR_TSSEME ((uint32_t)0x00004000) /* Time stamp snapshot for event message enable */
  6841. #define ETH_PTPTSSR_TSSIPV4FE ((uint32_t)0x00002000) /* Time stamp snapshot for IPv4 frames enable */
  6842. #define ETH_PTPTSSR_TSSIPV6FE ((uint32_t)0x00001000) /* Time stamp snapshot for IPv6 frames enable */
  6843. #define ETH_PTPTSSR_TSSPTPOEFE ((uint32_t)0x00000800) /* Time stamp snapshot for PTP over ethernet frames enable */
  6844. #define ETH_PTPTSSR_TSPTPPSV2E ((uint32_t)0x00000400) /* Time stamp PTP packet snooping for version2 format enable */
  6845. #define ETH_PTPTSSR_TSSSR ((uint32_t)0x00000200) /* Time stamp Sub-seconds rollover */
  6846. #define ETH_PTPTSSR_TSSARFE ((uint32_t)0x00000100) /* Time stamp snapshot for all received frames enable */
  6847. #define ETH_PTPTSCR_TSARU ((uint32_t)0x00000020) /* Addend register update */
  6848. #define ETH_PTPTSCR_TSITE ((uint32_t)0x00000010) /* Time stamp interrupt trigger enable */
  6849. #define ETH_PTPTSCR_TSSTU ((uint32_t)0x00000008) /* Time stamp update */
  6850. #define ETH_PTPTSCR_TSSTI ((uint32_t)0x00000004) /* Time stamp initialize */
  6851. #define ETH_PTPTSCR_TSFCU ((uint32_t)0x00000002) /* Time stamp fine or coarse update */
  6852. #define ETH_PTPTSCR_TSE ((uint32_t)0x00000001) /* Time stamp enable */
  6853. /* Bit definition for Ethernet PTP Sub-Second Increment Register */
  6854. #define ETH_PTPSSIR_STSSI ((uint32_t)0x000000FF) /* System time Sub-second increment value */
  6855. /* Bit definition for Ethernet PTP Time Stamp High Register */
  6856. #define ETH_PTPTSHR_STS ((uint32_t)0xFFFFFFFF) /* System Time second */
  6857. /* Bit definition for Ethernet PTP Time Stamp Low Register */
  6858. #define ETH_PTPTSLR_STPNS ((uint32_t)0x80000000) /* System Time Positive or negative time */
  6859. #define ETH_PTPTSLR_STSS ((uint32_t)0x7FFFFFFF) /* System Time sub-seconds */
  6860. /* Bit definition for Ethernet PTP Time Stamp High Update Register */
  6861. #define ETH_PTPTSHUR_TSUS ((uint32_t)0xFFFFFFFF) /* Time stamp update seconds */
  6862. /* Bit definition for Ethernet PTP Time Stamp Low Update Register */
  6863. #define ETH_PTPTSLUR_TSUPNS ((uint32_t)0x80000000) /* Time stamp update Positive or negative time */
  6864. #define ETH_PTPTSLUR_TSUSS ((uint32_t)0x7FFFFFFF) /* Time stamp update sub-seconds */
  6865. /* Bit definition for Ethernet PTP Time Stamp Addend Register */
  6866. #define ETH_PTPTSAR_TSA ((uint32_t)0xFFFFFFFF) /* Time stamp addend */
  6867. /* Bit definition for Ethernet PTP Target Time High Register */
  6868. #define ETH_PTPTTHR_TTSH ((uint32_t)0xFFFFFFFF) /* Target time stamp high */
  6869. /* Bit definition for Ethernet PTP Target Time Low Register */
  6870. #define ETH_PTPTTLR_TTSL ((uint32_t)0xFFFFFFFF) /* Target time stamp low */
  6871. /* Bit definition for Ethernet PTP Time Stamp Status Register */
  6872. #define ETH_PTPTSSR_TSTTR ((uint32_t)0x00000020) /* Time stamp target time reached */
  6873. #define ETH_PTPTSSR_TSSO ((uint32_t)0x00000010) /* Time stamp seconds overflow */
  6874. /******************************************************************************/
  6875. /* Ethernet DMA Registers bits definition */
  6876. /******************************************************************************/
  6877. /* Bit definition for Ethernet DMA Bus Mode Register */
  6878. #define ETH_DMABMR_AAB ((uint32_t)0x02000000) /* Address-Aligned beats */
  6879. #define ETH_DMABMR_FPM ((uint32_t)0x01000000) /* 4xPBL mode */
  6880. #define ETH_DMABMR_USP ((uint32_t)0x00800000) /* Use separate PBL */
  6881. #define ETH_DMABMR_RDP ((uint32_t)0x007E0000) /* RxDMA PBL */
  6882. #define ETH_DMABMR_RDP_1Beat ((uint32_t)0x00020000) /* maximum number of beats to be transferred in one RxDMA transaction is 1 */
  6883. #define ETH_DMABMR_RDP_2Beat ((uint32_t)0x00040000) /* maximum number of beats to be transferred in one RxDMA transaction is 2 */
  6884. #define ETH_DMABMR_RDP_4Beat ((uint32_t)0x00080000) /* maximum number of beats to be transferred in one RxDMA transaction is 4 */
  6885. #define ETH_DMABMR_RDP_8Beat ((uint32_t)0x00100000) /* maximum number of beats to be transferred in one RxDMA transaction is 8 */
  6886. #define ETH_DMABMR_RDP_16Beat ((uint32_t)0x00200000) /* maximum number of beats to be transferred in one RxDMA transaction is 16 */
  6887. #define ETH_DMABMR_RDP_32Beat ((uint32_t)0x00400000) /* maximum number of beats to be transferred in one RxDMA transaction is 32 */
  6888. #define ETH_DMABMR_RDP_4xPBL_4Beat ((uint32_t)0x01020000) /* maximum number of beats to be transferred in one RxDMA transaction is 4 */
  6889. #define ETH_DMABMR_RDP_4xPBL_8Beat ((uint32_t)0x01040000) /* maximum number of beats to be transferred in one RxDMA transaction is 8 */
  6890. #define ETH_DMABMR_RDP_4xPBL_16Beat ((uint32_t)0x01080000) /* maximum number of beats to be transferred in one RxDMA transaction is 16 */
  6891. #define ETH_DMABMR_RDP_4xPBL_32Beat ((uint32_t)0x01100000) /* maximum number of beats to be transferred in one RxDMA transaction is 32 */
  6892. #define ETH_DMABMR_RDP_4xPBL_64Beat ((uint32_t)0x01200000) /* maximum number of beats to be transferred in one RxDMA transaction is 64 */
  6893. #define ETH_DMABMR_RDP_4xPBL_128Beat ((uint32_t)0x01400000) /* maximum number of beats to be transferred in one RxDMA transaction is 128 */
  6894. #define ETH_DMABMR_FB ((uint32_t)0x00010000) /* Fixed Burst */
  6895. #define ETH_DMABMR_RTPR ((uint32_t)0x0000C000) /* Rx Tx priority ratio */
  6896. #define ETH_DMABMR_RTPR_1_1 ((uint32_t)0x00000000) /* Rx Tx priority ratio */
  6897. #define ETH_DMABMR_RTPR_2_1 ((uint32_t)0x00004000) /* Rx Tx priority ratio */
  6898. #define ETH_DMABMR_RTPR_3_1 ((uint32_t)0x00008000) /* Rx Tx priority ratio */
  6899. #define ETH_DMABMR_RTPR_4_1 ((uint32_t)0x0000C000) /* Rx Tx priority ratio */
  6900. #define ETH_DMABMR_PBL ((uint32_t)0x00003F00) /* Programmable burst length */
  6901. #define ETH_DMABMR_PBL_1Beat ((uint32_t)0x00000100) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 1 */
  6902. #define ETH_DMABMR_PBL_2Beat ((uint32_t)0x00000200) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 2 */
  6903. #define ETH_DMABMR_PBL_4Beat ((uint32_t)0x00000400) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 4 */
  6904. #define ETH_DMABMR_PBL_8Beat ((uint32_t)0x00000800) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 8 */
  6905. #define ETH_DMABMR_PBL_16Beat ((uint32_t)0x00001000) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 16 */
  6906. #define ETH_DMABMR_PBL_32Beat ((uint32_t)0x00002000) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 32 */
  6907. #define ETH_DMABMR_PBL_4xPBL_4Beat ((uint32_t)0x01000100) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 4 */
  6908. #define ETH_DMABMR_PBL_4xPBL_8Beat ((uint32_t)0x01000200) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 8 */
  6909. #define ETH_DMABMR_PBL_4xPBL_16Beat ((uint32_t)0x01000400) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 16 */
  6910. #define ETH_DMABMR_PBL_4xPBL_32Beat ((uint32_t)0x01000800) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 32 */
  6911. #define ETH_DMABMR_PBL_4xPBL_64Beat ((uint32_t)0x01001000) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 64 */
  6912. #define ETH_DMABMR_PBL_4xPBL_128Beat ((uint32_t)0x01002000) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 128 */
  6913. #define ETH_DMABMR_EDE ((uint32_t)0x00000080) /* Enhanced Descriptor Enable */
  6914. #define ETH_DMABMR_DSL ((uint32_t)0x0000007C) /* Descriptor Skip Length */
  6915. #define ETH_DMABMR_DA ((uint32_t)0x00000002) /* DMA arbitration scheme */
  6916. #define ETH_DMABMR_SR ((uint32_t)0x00000001) /* Software reset */
  6917. /* Bit definition for Ethernet DMA Transmit Poll Demand Register */
  6918. #define ETH_DMATPDR_TPD ((uint32_t)0xFFFFFFFF) /* Transmit poll demand */
  6919. /* Bit definition for Ethernet DMA Receive Poll Demand Register */
  6920. #define ETH_DMARPDR_RPD ((uint32_t)0xFFFFFFFF) /* Receive poll demand */
  6921. /* Bit definition for Ethernet DMA Receive Descriptor List Address Register */
  6922. #define ETH_DMARDLAR_SRL ((uint32_t)0xFFFFFFFF) /* Start of receive list */
  6923. /* Bit definition for Ethernet DMA Transmit Descriptor List Address Register */
  6924. #define ETH_DMATDLAR_STL ((uint32_t)0xFFFFFFFF) /* Start of transmit list */
  6925. /* Bit definition for Ethernet DMA Status Register */
  6926. #define ETH_DMASR_TSTS ((uint32_t)0x20000000) /* Time-stamp trigger status */
  6927. #define ETH_DMASR_PMTS ((uint32_t)0x10000000) /* PMT status */
  6928. #define ETH_DMASR_MMCS ((uint32_t)0x08000000) /* MMC status */
  6929. #define ETH_DMASR_EBS ((uint32_t)0x03800000) /* Error bits status */
  6930. /* combination with EBS[2:0] for GetFlagStatus function */
  6931. #define ETH_DMASR_EBS_DescAccess ((uint32_t)0x02000000) /* Error bits 0-data buffer, 1-desc. access */
  6932. #define ETH_DMASR_EBS_ReadTransf ((uint32_t)0x01000000) /* Error bits 0-write trnsf, 1-read transfr */
  6933. #define ETH_DMASR_EBS_DataTransfTx ((uint32_t)0x00800000) /* Error bits 0-Rx DMA, 1-Tx DMA */
  6934. #define ETH_DMASR_TPS ((uint32_t)0x00700000) /* Transmit process state */
  6935. #define ETH_DMASR_TPS_Stopped ((uint32_t)0x00000000) /* Stopped - Reset or Stop Tx Command issued */
  6936. #define ETH_DMASR_TPS_Fetching ((uint32_t)0x00100000) /* Running - fetching the Tx descriptor */
  6937. #define ETH_DMASR_TPS_Waiting ((uint32_t)0x00200000) /* Running - waiting for status */
  6938. #define ETH_DMASR_TPS_Reading ((uint32_t)0x00300000) /* Running - reading the data from host memory */
  6939. #define ETH_DMASR_TPS_Suspended ((uint32_t)0x00600000) /* Suspended - Tx Descriptor unavailabe */
  6940. #define ETH_DMASR_TPS_Closing ((uint32_t)0x00700000) /* Running - closing Rx descriptor */
  6941. #define ETH_DMASR_RPS ((uint32_t)0x000E0000) /* Receive process state */
  6942. #define ETH_DMASR_RPS_Stopped ((uint32_t)0x00000000) /* Stopped - Reset or Stop Rx Command issued */
  6943. #define ETH_DMASR_RPS_Fetching ((uint32_t)0x00020000) /* Running - fetching the Rx descriptor */
  6944. #define ETH_DMASR_RPS_Waiting ((uint32_t)0x00060000) /* Running - waiting for packet */
  6945. #define ETH_DMASR_RPS_Suspended ((uint32_t)0x00080000) /* Suspended - Rx Descriptor unavailable */
  6946. #define ETH_DMASR_RPS_Closing ((uint32_t)0x000A0000) /* Running - closing descriptor */
  6947. #define ETH_DMASR_RPS_Queuing ((uint32_t)0x000E0000) /* Running - queuing the recieve frame into host memory */
  6948. #define ETH_DMASR_NIS ((uint32_t)0x00010000) /* Normal interrupt summary */
  6949. #define ETH_DMASR_AIS ((uint32_t)0x00008000) /* Abnormal interrupt summary */
  6950. #define ETH_DMASR_ERS ((uint32_t)0x00004000) /* Early receive status */
  6951. #define ETH_DMASR_FBES ((uint32_t)0x00002000) /* Fatal bus error status */
  6952. #define ETH_DMASR_ETS ((uint32_t)0x00000400) /* Early transmit status */
  6953. #define ETH_DMASR_RWTS ((uint32_t)0x00000200) /* Receive watchdog timeout status */
  6954. #define ETH_DMASR_RPSS ((uint32_t)0x00000100) /* Receive process stopped status */
  6955. #define ETH_DMASR_RBUS ((uint32_t)0x00000080) /* Receive buffer unavailable status */
  6956. #define ETH_DMASR_RS ((uint32_t)0x00000040) /* Receive status */
  6957. #define ETH_DMASR_TUS ((uint32_t)0x00000020) /* Transmit underflow status */
  6958. #define ETH_DMASR_ROS ((uint32_t)0x00000010) /* Receive overflow status */
  6959. #define ETH_DMASR_TJTS ((uint32_t)0x00000008) /* Transmit jabber timeout status */
  6960. #define ETH_DMASR_TBUS ((uint32_t)0x00000004) /* Transmit buffer unavailable status */
  6961. #define ETH_DMASR_TPSS ((uint32_t)0x00000002) /* Transmit process stopped status */
  6962. #define ETH_DMASR_TS ((uint32_t)0x00000001) /* Transmit status */
  6963. /* Bit definition for Ethernet DMA Operation Mode Register */
  6964. #define ETH_DMAOMR_DTCEFD ((uint32_t)0x04000000) /* Disable Dropping of TCP/IP checksum error frames */
  6965. #define ETH_DMAOMR_RSF ((uint32_t)0x02000000) /* Receive store and forward */
  6966. #define ETH_DMAOMR_DFRF ((uint32_t)0x01000000) /* Disable flushing of received frames */
  6967. #define ETH_DMAOMR_TSF ((uint32_t)0x00200000) /* Transmit store and forward */
  6968. #define ETH_DMAOMR_FTF ((uint32_t)0x00100000) /* Flush transmit FIFO */
  6969. #define ETH_DMAOMR_TTC ((uint32_t)0x0001C000) /* Transmit threshold control */
  6970. #define ETH_DMAOMR_TTC_64Bytes ((uint32_t)0x00000000) /* threshold level of the MTL Transmit FIFO is 64 Bytes */
  6971. #define ETH_DMAOMR_TTC_128Bytes ((uint32_t)0x00004000) /* threshold level of the MTL Transmit FIFO is 128 Bytes */
  6972. #define ETH_DMAOMR_TTC_192Bytes ((uint32_t)0x00008000) /* threshold level of the MTL Transmit FIFO is 192 Bytes */
  6973. #define ETH_DMAOMR_TTC_256Bytes ((uint32_t)0x0000C000) /* threshold level of the MTL Transmit FIFO is 256 Bytes */
  6974. #define ETH_DMAOMR_TTC_40Bytes ((uint32_t)0x00010000) /* threshold level of the MTL Transmit FIFO is 40 Bytes */
  6975. #define ETH_DMAOMR_TTC_32Bytes ((uint32_t)0x00014000) /* threshold level of the MTL Transmit FIFO is 32 Bytes */
  6976. #define ETH_DMAOMR_TTC_24Bytes ((uint32_t)0x00018000) /* threshold level of the MTL Transmit FIFO is 24 Bytes */
  6977. #define ETH_DMAOMR_TTC_16Bytes ((uint32_t)0x0001C000) /* threshold level of the MTL Transmit FIFO is 16 Bytes */
  6978. #define ETH_DMAOMR_ST ((uint32_t)0x00002000) /* Start/stop transmission command */
  6979. #define ETH_DMAOMR_FEF ((uint32_t)0x00000080) /* Forward error frames */
  6980. #define ETH_DMAOMR_FUGF ((uint32_t)0x00000040) /* Forward undersized good frames */
  6981. #define ETH_DMAOMR_RTC ((uint32_t)0x00000018) /* receive threshold control */
  6982. #define ETH_DMAOMR_RTC_64Bytes ((uint32_t)0x00000000) /* threshold level of the MTL Receive FIFO is 64 Bytes */
  6983. #define ETH_DMAOMR_RTC_32Bytes ((uint32_t)0x00000008) /* threshold level of the MTL Receive FIFO is 32 Bytes */
  6984. #define ETH_DMAOMR_RTC_96Bytes ((uint32_t)0x00000010) /* threshold level of the MTL Receive FIFO is 96 Bytes */
  6985. #define ETH_DMAOMR_RTC_128Bytes ((uint32_t)0x00000018) /* threshold level of the MTL Receive FIFO is 128 Bytes */
  6986. #define ETH_DMAOMR_OSF ((uint32_t)0x00000004) /* operate on second frame */
  6987. #define ETH_DMAOMR_SR ((uint32_t)0x00000002) /* Start/stop receive */
  6988. /* Bit definition for Ethernet DMA Interrupt Enable Register */
  6989. #define ETH_DMAIER_NISE ((uint32_t)0x00010000) /* Normal interrupt summary enable */
  6990. #define ETH_DMAIER_AISE ((uint32_t)0x00008000) /* Abnormal interrupt summary enable */
  6991. #define ETH_DMAIER_ERIE ((uint32_t)0x00004000) /* Early receive interrupt enable */
  6992. #define ETH_DMAIER_FBEIE ((uint32_t)0x00002000) /* Fatal bus error interrupt enable */
  6993. #define ETH_DMAIER_ETIE ((uint32_t)0x00000400) /* Early transmit interrupt enable */
  6994. #define ETH_DMAIER_RWTIE ((uint32_t)0x00000200) /* Receive watchdog timeout interrupt enable */
  6995. #define ETH_DMAIER_RPSIE ((uint32_t)0x00000100) /* Receive process stopped interrupt enable */
  6996. #define ETH_DMAIER_RBUIE ((uint32_t)0x00000080) /* Receive buffer unavailable interrupt enable */
  6997. #define ETH_DMAIER_RIE ((uint32_t)0x00000040) /* Receive interrupt enable */
  6998. #define ETH_DMAIER_TUIE ((uint32_t)0x00000020) /* Transmit Underflow interrupt enable */
  6999. #define ETH_DMAIER_ROIE ((uint32_t)0x00000010) /* Receive Overflow interrupt enable */
  7000. #define ETH_DMAIER_TJTIE ((uint32_t)0x00000008) /* Transmit jabber timeout interrupt enable */
  7001. #define ETH_DMAIER_TBUIE ((uint32_t)0x00000004) /* Transmit buffer unavailable interrupt enable */
  7002. #define ETH_DMAIER_TPSIE ((uint32_t)0x00000002) /* Transmit process stopped interrupt enable */
  7003. #define ETH_DMAIER_TIE ((uint32_t)0x00000001) /* Transmit interrupt enable */
  7004. /* Bit definition for Ethernet DMA Missed Frame and Buffer Overflow Counter Register */
  7005. #define ETH_DMAMFBOCR_OFOC ((uint32_t)0x10000000) /* Overflow bit for FIFO overflow counter */
  7006. #define ETH_DMAMFBOCR_MFA ((uint32_t)0x0FFE0000) /* Number of frames missed by the application */
  7007. #define ETH_DMAMFBOCR_OMFC ((uint32_t)0x00010000) /* Overflow bit for missed frame counter */
  7008. #define ETH_DMAMFBOCR_MFC ((uint32_t)0x0000FFFF) /* Number of frames missed by the controller */
  7009. /* Bit definition for Ethernet DMA Current Host Transmit Descriptor Register */
  7010. #define ETH_DMACHTDR_HTDAP ((uint32_t)0xFFFFFFFF) /* Host transmit descriptor address pointer */
  7011. /* Bit definition for Ethernet DMA Current Host Receive Descriptor Register */
  7012. #define ETH_DMACHRDR_HRDAP ((uint32_t)0xFFFFFFFF) /* Host receive descriptor address pointer */
  7013. /* Bit definition for Ethernet DMA Current Host Transmit Buffer Address Register */
  7014. #define ETH_DMACHTBAR_HTBAP ((uint32_t)0xFFFFFFFF) /* Host transmit buffer address pointer */
  7015. /* Bit definition for Ethernet DMA Current Host Receive Buffer Address Register */
  7016. #define ETH_DMACHRBAR_HRBAP ((uint32_t)0xFFFFFFFF) /* Host receive buffer address pointer */
  7017. /******************************************************************************/
  7018. /* */
  7019. /* USB_OTG */
  7020. /* */
  7021. /******************************************************************************/
  7022. /******************** Bit definition forUSB_OTG_GOTGCTL register ********************/
  7023. #define USB_OTG_GOTGCTL_SRQSCS ((uint32_t)0x00000001) /*!< Session request success */
  7024. #define USB_OTG_GOTGCTL_SRQ ((uint32_t)0x00000002) /*!< Session request */
  7025. #define USB_OTG_GOTGCTL_HNGSCS ((uint32_t)0x00000100) /*!< Host negotiation success */
  7026. #define USB_OTG_GOTGCTL_HNPRQ ((uint32_t)0x00000200) /*!< HNP request */
  7027. #define USB_OTG_GOTGCTL_HSHNPEN ((uint32_t)0x00000400) /*!< Host set HNP enable */
  7028. #define USB_OTG_GOTGCTL_DHNPEN ((uint32_t)0x00000800) /*!< Device HNP enabled */
  7029. #define USB_OTG_GOTGCTL_CIDSTS ((uint32_t)0x00010000) /*!< Connector ID status */
  7030. #define USB_OTG_GOTGCTL_DBCT ((uint32_t)0x00020000) /*!< Long/short debounce time */
  7031. #define USB_OTG_GOTGCTL_ASVLD ((uint32_t)0x00040000) /*!< A-session valid */
  7032. #define USB_OTG_GOTGCTL_BSVLD ((uint32_t)0x00080000) /*!< B-session valid */
  7033. /******************** Bit definition forUSB_OTG_HCFG register ********************/
  7034. #define USB_OTG_HCFG_FSLSPCS ((uint32_t)0x00000003) /*!< FS/LS PHY clock select */
  7035. #define USB_OTG_HCFG_FSLSPCS_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  7036. #define USB_OTG_HCFG_FSLSPCS_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  7037. #define USB_OTG_HCFG_FSLSS ((uint32_t)0x00000004) /*!< FS- and LS-only support */
  7038. /******************** Bit definition forUSB_OTG_DCFG register ********************/
  7039. #define USB_OTG_DCFG_DSPD ((uint32_t)0x00000003) /*!< Device speed */
  7040. #define USB_OTG_DCFG_DSPD_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  7041. #define USB_OTG_DCFG_DSPD_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  7042. #define USB_OTG_DCFG_NZLSOHSK ((uint32_t)0x00000004) /*!< Nonzero-length status OUT handshake */
  7043. #define USB_OTG_DCFG_DAD ((uint32_t)0x000007F0) /*!< Device address */
  7044. #define USB_OTG_DCFG_DAD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  7045. #define USB_OTG_DCFG_DAD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  7046. #define USB_OTG_DCFG_DAD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  7047. #define USB_OTG_DCFG_DAD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  7048. #define USB_OTG_DCFG_DAD_4 ((uint32_t)0x00000100) /*!<Bit 4 */
  7049. #define USB_OTG_DCFG_DAD_5 ((uint32_t)0x00000200) /*!<Bit 5 */
  7050. #define USB_OTG_DCFG_DAD_6 ((uint32_t)0x00000400) /*!<Bit 6 */
  7051. #define USB_OTG_DCFG_PFIVL ((uint32_t)0x00001800) /*!< Periodic (micro)frame interval */
  7052. #define USB_OTG_DCFG_PFIVL_0 ((uint32_t)0x00000800) /*!<Bit 0 */
  7053. #define USB_OTG_DCFG_PFIVL_1 ((uint32_t)0x00001000) /*!<Bit 1 */
  7054. #define USB_OTG_DCFG_PERSCHIVL ((uint32_t)0x03000000) /*!< Periodic scheduling interval */
  7055. #define USB_OTG_DCFG_PERSCHIVL_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  7056. #define USB_OTG_DCFG_PERSCHIVL_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  7057. /******************** Bit definition forUSB_OTG_PCGCR register ********************/
  7058. #define USB_OTG_PCGCR_STPPCLK ((uint32_t)0x00000001) /*!< Stop PHY clock */
  7059. #define USB_OTG_PCGCR_GATEHCLK ((uint32_t)0x00000002) /*!< Gate HCLK */
  7060. #define USB_OTG_PCGCR_PHYSUSP ((uint32_t)0x00000010) /*!< PHY suspended */
  7061. /******************** Bit definition forUSB_OTG_GOTGINT register ********************/
  7062. #define USB_OTG_GOTGINT_SEDET ((uint32_t)0x00000004) /*!< Session end detected */
  7063. #define USB_OTG_GOTGINT_SRSSCHG ((uint32_t)0x00000100) /*!< Session request success status change */
  7064. #define USB_OTG_GOTGINT_HNSSCHG ((uint32_t)0x00000200) /*!< Host negotiation success status change */
  7065. #define USB_OTG_GOTGINT_HNGDET ((uint32_t)0x00020000) /*!< Host negotiation detected */
  7066. #define USB_OTG_GOTGINT_ADTOCHG ((uint32_t)0x00040000) /*!< A-device timeout change */
  7067. #define USB_OTG_GOTGINT_DBCDNE ((uint32_t)0x00080000) /*!< Debounce done */
  7068. /******************** Bit definition forUSB_OTG_DCTL register ********************/
  7069. #define USB_OTG_DCTL_RWUSIG ((uint32_t)0x00000001) /*!< Remote wakeup signaling */
  7070. #define USB_OTG_DCTL_SDIS ((uint32_t)0x00000002) /*!< Soft disconnect */
  7071. #define USB_OTG_DCTL_GINSTS ((uint32_t)0x00000004) /*!< Global IN NAK status */
  7072. #define USB_OTG_DCTL_GONSTS ((uint32_t)0x00000008) /*!< Global OUT NAK status */
  7073. #define USB_OTG_DCTL_TCTL ((uint32_t)0x00000070) /*!< Test control */
  7074. #define USB_OTG_DCTL_TCTL_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  7075. #define USB_OTG_DCTL_TCTL_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  7076. #define USB_OTG_DCTL_TCTL_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  7077. #define USB_OTG_DCTL_SGINAK ((uint32_t)0x00000080) /*!< Set global IN NAK */
  7078. #define USB_OTG_DCTL_CGINAK ((uint32_t)0x00000100) /*!< Clear global IN NAK */
  7079. #define USB_OTG_DCTL_SGONAK ((uint32_t)0x00000200) /*!< Set global OUT NAK */
  7080. #define USB_OTG_DCTL_CGONAK ((uint32_t)0x00000400) /*!< Clear global OUT NAK */
  7081. #define USB_OTG_DCTL_POPRGDNE ((uint32_t)0x00000800) /*!< Power-on programming done */
  7082. /******************** Bit definition forUSB_OTG_HFIR register ********************/
  7083. #define USB_OTG_HFIR_FRIVL ((uint32_t)0x0000FFFF) /*!< Frame interval */
  7084. /******************** Bit definition forUSB_OTG_HFNUM register ********************/
  7085. #define USB_OTG_HFNUM_FRNUM ((uint32_t)0x0000FFFF) /*!< Frame number */
  7086. #define USB_OTG_HFNUM_FTREM ((uint32_t)0xFFFF0000) /*!< Frame time remaining */
  7087. /******************** Bit definition forUSB_OTG_DSTS register ********************/
  7088. #define USB_OTG_DSTS_SUSPSTS ((uint32_t)0x00000001) /*!< Suspend status */
  7089. #define USB_OTG_DSTS_ENUMSPD ((uint32_t)0x00000006) /*!< Enumerated speed */
  7090. #define USB_OTG_DSTS_ENUMSPD_0 ((uint32_t)0x00000002) /*!<Bit 0 */
  7091. #define USB_OTG_DSTS_ENUMSPD_1 ((uint32_t)0x00000004) /*!<Bit 1 */
  7092. #define USB_OTG_DSTS_EERR ((uint32_t)0x00000008) /*!< Erratic error */
  7093. #define USB_OTG_DSTS_FNSOF ((uint32_t)0x003FFF00) /*!< Frame number of the received SOF */
  7094. /******************** Bit definition forUSB_OTG_GAHBCFG register ********************/
  7095. #define USB_OTG_GAHBCFG_GINT ((uint32_t)0x00000001) /*!< Global interrupt mask */
  7096. #define USB_OTG_GAHBCFG_HBSTLEN ((uint32_t)0x0000001E) /*!< Burst length/type */
  7097. #define USB_OTG_GAHBCFG_HBSTLEN_0 ((uint32_t)0x00000002) /*!<Bit 0 */
  7098. #define USB_OTG_GAHBCFG_HBSTLEN_1 ((uint32_t)0x00000004) /*!<Bit 1 */
  7099. #define USB_OTG_GAHBCFG_HBSTLEN_2 ((uint32_t)0x00000008) /*!<Bit 2 */
  7100. #define USB_OTG_GAHBCFG_HBSTLEN_3 ((uint32_t)0x00000010) /*!<Bit 3 */
  7101. #define USB_OTG_GAHBCFG_DMAEN ((uint32_t)0x00000020) /*!< DMA enable */
  7102. #define USB_OTG_GAHBCFG_TXFELVL ((uint32_t)0x00000080) /*!< TxFIFO empty level */
  7103. #define USB_OTG_GAHBCFG_PTXFELVL ((uint32_t)0x00000100) /*!< Periodic TxFIFO empty level */
  7104. /******************** Bit definition forUSB_OTG_GUSBCFG register ********************/
  7105. #define USB_OTG_GUSBCFG_TOCAL ((uint32_t)0x00000007) /*!< FS timeout calibration */
  7106. #define USB_OTG_GUSBCFG_TOCAL_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  7107. #define USB_OTG_GUSBCFG_TOCAL_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  7108. #define USB_OTG_GUSBCFG_TOCAL_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  7109. #define USB_OTG_GUSBCFG_PHYSEL ((uint32_t)0x00000040) /*!< USB 2.0 high-speed ULPI PHY or USB 1.1 full-speed serial transceiver select */
  7110. #define USB_OTG_GUSBCFG_SRPCAP ((uint32_t)0x00000100) /*!< SRP-capable */
  7111. #define USB_OTG_GUSBCFG_HNPCAP ((uint32_t)0x00000200) /*!< HNP-capable */
  7112. #define USB_OTG_GUSBCFG_TRDT ((uint32_t)0x00003C00) /*!< USB turnaround time */
  7113. #define USB_OTG_GUSBCFG_TRDT_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  7114. #define USB_OTG_GUSBCFG_TRDT_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  7115. #define USB_OTG_GUSBCFG_TRDT_2 ((uint32_t)0x00001000) /*!<Bit 2 */
  7116. #define USB_OTG_GUSBCFG_TRDT_3 ((uint32_t)0x00002000) /*!<Bit 3 */
  7117. #define USB_OTG_GUSBCFG_PHYLPCS ((uint32_t)0x00008000) /*!< PHY Low-power clock select */
  7118. #define USB_OTG_GUSBCFG_ULPIFSLS ((uint32_t)0x00020000) /*!< ULPI FS/LS select */
  7119. #define USB_OTG_GUSBCFG_ULPIAR ((uint32_t)0x00040000) /*!< ULPI Auto-resume */
  7120. #define USB_OTG_GUSBCFG_ULPICSM ((uint32_t)0x00080000) /*!< ULPI Clock SuspendM */
  7121. #define USB_OTG_GUSBCFG_ULPIEVBUSD ((uint32_t)0x00100000) /*!< ULPI External VBUS Drive */
  7122. #define USB_OTG_GUSBCFG_ULPIEVBUSI ((uint32_t)0x00200000) /*!< ULPI external VBUS indicator */
  7123. #define USB_OTG_GUSBCFG_TSDPS ((uint32_t)0x00400000) /*!< TermSel DLine pulsing selection */
  7124. #define USB_OTG_GUSBCFG_PCCI ((uint32_t)0x00800000) /*!< Indicator complement */
  7125. #define USB_OTG_GUSBCFG_PTCI ((uint32_t)0x01000000) /*!< Indicator pass through */
  7126. #define USB_OTG_GUSBCFG_ULPIIPD ((uint32_t)0x02000000) /*!< ULPI interface protect disable */
  7127. #define USB_OTG_GUSBCFG_FHMOD ((uint32_t)0x20000000) /*!< Forced host mode */
  7128. #define USB_OTG_GUSBCFG_FDMOD ((uint32_t)0x40000000) /*!< Forced peripheral mode */
  7129. #define USB_OTG_GUSBCFG_CTXPKT ((uint32_t)0x80000000) /*!< Corrupt Tx packet */
  7130. /******************** Bit definition forUSB_OTG_GRSTCTL register ********************/
  7131. #define USB_OTG_GRSTCTL_CSRST ((uint32_t)0x00000001) /*!< Core soft reset */
  7132. #define USB_OTG_GRSTCTL_HSRST ((uint32_t)0x00000002) /*!< HCLK soft reset */
  7133. #define USB_OTG_GRSTCTL_FCRST ((uint32_t)0x00000004) /*!< Host frame counter reset */
  7134. #define USB_OTG_GRSTCTL_RXFFLSH ((uint32_t)0x00000010) /*!< RxFIFO flush */
  7135. #define USB_OTG_GRSTCTL_TXFFLSH ((uint32_t)0x00000020) /*!< TxFIFO flush */
  7136. #define USB_OTG_GRSTCTL_TXFNUM ((uint32_t)0x000007C0) /*!< TxFIFO number */
  7137. #define USB_OTG_GRSTCTL_TXFNUM_0 ((uint32_t)0x00000040) /*!<Bit 0 */
  7138. #define USB_OTG_GRSTCTL_TXFNUM_1 ((uint32_t)0x00000080) /*!<Bit 1 */
  7139. #define USB_OTG_GRSTCTL_TXFNUM_2 ((uint32_t)0x00000100) /*!<Bit 2 */
  7140. #define USB_OTG_GRSTCTL_TXFNUM_3 ((uint32_t)0x00000200) /*!<Bit 3 */
  7141. #define USB_OTG_GRSTCTL_TXFNUM_4 ((uint32_t)0x00000400) /*!<Bit 4 */
  7142. #define USB_OTG_GRSTCTL_DMAREQ ((uint32_t)0x40000000) /*!< DMA request signal */
  7143. #define USB_OTG_GRSTCTL_AHBIDL ((uint32_t)0x80000000) /*!< AHB master idle */
  7144. /******************** Bit definition forUSB_OTG_DIEPMSK register ********************/
  7145. #define USB_OTG_DIEPMSK_XFRCM ((uint32_t)0x00000001) /*!< Transfer completed interrupt mask */
  7146. #define USB_OTG_DIEPMSK_EPDM ((uint32_t)0x00000002) /*!< Endpoint disabled interrupt mask */
  7147. #define USB_OTG_DIEPMSK_TOM ((uint32_t)0x00000008) /*!< Timeout condition mask (nonisochronous endpoints) */
  7148. #define USB_OTG_DIEPMSK_ITTXFEMSK ((uint32_t)0x00000010) /*!< IN token received when TxFIFO empty mask */
  7149. #define USB_OTG_DIEPMSK_INEPNMM ((uint32_t)0x00000020) /*!< IN token received with EP mismatch mask */
  7150. #define USB_OTG_DIEPMSK_INEPNEM ((uint32_t)0x00000040) /*!< IN endpoint NAK effective mask */
  7151. #define USB_OTG_DIEPMSK_TXFURM ((uint32_t)0x00000100) /*!< FIFO underrun mask */
  7152. #define USB_OTG_DIEPMSK_BIM ((uint32_t)0x00000200) /*!< BNA interrupt mask */
  7153. /******************** Bit definition forUSB_OTG_HPTXSTS register ********************/
  7154. #define USB_OTG_HPTXSTS_PTXFSAVL ((uint32_t)0x0000FFFF) /*!< Periodic transmit data FIFO space available */
  7155. #define USB_OTG_HPTXSTS_PTXQSAV ((uint32_t)0x00FF0000) /*!< Periodic transmit request queue space available */
  7156. #define USB_OTG_HPTXSTS_PTXQSAV_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  7157. #define USB_OTG_HPTXSTS_PTXQSAV_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  7158. #define USB_OTG_HPTXSTS_PTXQSAV_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  7159. #define USB_OTG_HPTXSTS_PTXQSAV_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  7160. #define USB_OTG_HPTXSTS_PTXQSAV_4 ((uint32_t)0x00100000) /*!<Bit 4 */
  7161. #define USB_OTG_HPTXSTS_PTXQSAV_5 ((uint32_t)0x00200000) /*!<Bit 5 */
  7162. #define USB_OTG_HPTXSTS_PTXQSAV_6 ((uint32_t)0x00400000) /*!<Bit 6 */
  7163. #define USB_OTG_HPTXSTS_PTXQSAV_7 ((uint32_t)0x00800000) /*!<Bit 7 */
  7164. #define USB_OTG_HPTXSTS_PTXQTOP ((uint32_t)0xFF000000) /*!< Top of the periodic transmit request queue */
  7165. #define USB_OTG_HPTXSTS_PTXQTOP_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  7166. #define USB_OTG_HPTXSTS_PTXQTOP_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  7167. #define USB_OTG_HPTXSTS_PTXQTOP_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  7168. #define USB_OTG_HPTXSTS_PTXQTOP_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  7169. #define USB_OTG_HPTXSTS_PTXQTOP_4 ((uint32_t)0x10000000) /*!<Bit 4 */
  7170. #define USB_OTG_HPTXSTS_PTXQTOP_5 ((uint32_t)0x20000000) /*!<Bit 5 */
  7171. #define USB_OTG_HPTXSTS_PTXQTOP_6 ((uint32_t)0x40000000) /*!<Bit 6 */
  7172. #define USB_OTG_HPTXSTS_PTXQTOP_7 ((uint32_t)0x80000000) /*!<Bit 7 */
  7173. /******************** Bit definition forUSB_OTG_HAINT register ********************/
  7174. #define USB_OTG_HAINT_HAINT ((uint32_t)0x0000FFFF) /*!< Channel interrupts */
  7175. /******************** Bit definition forUSB_OTG_DOEPMSK register ********************/
  7176. #define USB_OTG_DOEPMSK_XFRCM ((uint32_t)0x00000001) /*!< Transfer completed interrupt mask */
  7177. #define USB_OTG_DOEPMSK_EPDM ((uint32_t)0x00000002) /*!< Endpoint disabled interrupt mask */
  7178. #define USB_OTG_DOEPMSK_STUPM ((uint32_t)0x00000008) /*!< SETUP phase done mask */
  7179. #define USB_OTG_DOEPMSK_OTEPDM ((uint32_t)0x00000010) /*!< OUT token received when endpoint disabled mask */
  7180. #define USB_OTG_DOEPMSK_B2BSTUP ((uint32_t)0x00000040) /*!< Back-to-back SETUP packets received mask */
  7181. #define USB_OTG_DOEPMSK_OPEM ((uint32_t)0x00000100) /*!< OUT packet error mask */
  7182. #define USB_OTG_DOEPMSK_BOIM ((uint32_t)0x00000200) /*!< BNA interrupt mask */
  7183. /******************** Bit definition forUSB_OTG_GINTSTS register ********************/
  7184. #define USB_OTG_GINTSTS_CMOD ((uint32_t)0x00000001) /*!< Current mode of operation */
  7185. #define USB_OTG_GINTSTS_MMIS ((uint32_t)0x00000002) /*!< Mode mismatch interrupt */
  7186. #define USB_OTG_GINTSTS_OTGINT ((uint32_t)0x00000004) /*!< OTG interrupt */
  7187. #define USB_OTG_GINTSTS_SOF ((uint32_t)0x00000008) /*!< Start of frame */
  7188. #define USB_OTG_GINTSTS_RXFLVL ((uint32_t)0x00000010) /*!< RxFIFO nonempty */
  7189. #define USB_OTG_GINTSTS_NPTXFE ((uint32_t)0x00000020) /*!< Nonperiodic TxFIFO empty */
  7190. #define USB_OTG_GINTSTS_GINAKEFF ((uint32_t)0x00000040) /*!< Global IN nonperiodic NAK effective */
  7191. #define USB_OTG_GINTSTS_BOUTNAKEFF ((uint32_t)0x00000080) /*!< Global OUT NAK effective */
  7192. #define USB_OTG_GINTSTS_ESUSP ((uint32_t)0x00000400) /*!< Early suspend */
  7193. #define USB_OTG_GINTSTS_USBSUSP ((uint32_t)0x00000800) /*!< USB suspend */
  7194. #define USB_OTG_GINTSTS_USBRST ((uint32_t)0x00001000) /*!< USB reset */
  7195. #define USB_OTG_GINTSTS_ENUMDNE ((uint32_t)0x00002000) /*!< Enumeration done */
  7196. #define USB_OTG_GINTSTS_ISOODRP ((uint32_t)0x00004000) /*!< Isochronous OUT packet dropped interrupt */
  7197. #define USB_OTG_GINTSTS_EOPF ((uint32_t)0x00008000) /*!< End of periodic frame interrupt */
  7198. #define USB_OTG_GINTSTS_IEPINT ((uint32_t)0x00040000) /*!< IN endpoint interrupt */
  7199. #define USB_OTG_GINTSTS_OEPINT ((uint32_t)0x00080000) /*!< OUT endpoint interrupt */
  7200. #define USB_OTG_GINTSTS_IISOIXFR ((uint32_t)0x00100000) /*!< Incomplete isochronous IN transfer */
  7201. #define USB_OTG_GINTSTS_PXFR_INCOMPISOOUT ((uint32_t)0x00200000) /*!< Incomplete periodic transfer */
  7202. #define USB_OTG_GINTSTS_DATAFSUSP ((uint32_t)0x00400000) /*!< Data fetch suspended */
  7203. #define USB_OTG_GINTSTS_HPRTINT ((uint32_t)0x01000000) /*!< Host port interrupt */
  7204. #define USB_OTG_GINTSTS_HCINT ((uint32_t)0x02000000) /*!< Host channels interrupt */
  7205. #define USB_OTG_GINTSTS_PTXFE ((uint32_t)0x04000000) /*!< Periodic TxFIFO empty */
  7206. #define USB_OTG_GINTSTS_CIDSCHG ((uint32_t)0x10000000) /*!< Connector ID status change */
  7207. #define USB_OTG_GINTSTS_DISCINT ((uint32_t)0x20000000) /*!< Disconnect detected interrupt */
  7208. #define USB_OTG_GINTSTS_SRQINT ((uint32_t)0x40000000) /*!< Session request/new session detected interrupt */
  7209. #define USB_OTG_GINTSTS_WKUINT ((uint32_t)0x80000000) /*!< Resume/remote wakeup detected interrupt */
  7210. /******************** Bit definition forUSB_OTG_GINTMSK register ********************/
  7211. #define USB_OTG_GINTMSK_MMISM ((uint32_t)0x00000002) /*!< Mode mismatch interrupt mask */
  7212. #define USB_OTG_GINTMSK_OTGINT ((uint32_t)0x00000004) /*!< OTG interrupt mask */
  7213. #define USB_OTG_GINTMSK_SOFM ((uint32_t)0x00000008) /*!< Start of frame mask */
  7214. #define USB_OTG_GINTMSK_RXFLVLM ((uint32_t)0x00000010) /*!< Receive FIFO nonempty mask */
  7215. #define USB_OTG_GINTMSK_NPTXFEM ((uint32_t)0x00000020) /*!< Nonperiodic TxFIFO empty mask */
  7216. #define USB_OTG_GINTMSK_GINAKEFFM ((uint32_t)0x00000040) /*!< Global nonperiodic IN NAK effective mask */
  7217. #define USB_OTG_GINTMSK_GONAKEFFM ((uint32_t)0x00000080) /*!< Global OUT NAK effective mask */
  7218. #define USB_OTG_GINTMSK_ESUSPM ((uint32_t)0x00000400) /*!< Early suspend mask */
  7219. #define USB_OTG_GINTMSK_USBSUSPM ((uint32_t)0x00000800) /*!< USB suspend mask */
  7220. #define USB_OTG_GINTMSK_USBRST ((uint32_t)0x00001000) /*!< USB reset mask */
  7221. #define USB_OTG_GINTMSK_ENUMDNEM ((uint32_t)0x00002000) /*!< Enumeration done mask */
  7222. #define USB_OTG_GINTMSK_ISOODRPM ((uint32_t)0x00004000) /*!< Isochronous OUT packet dropped interrupt mask */
  7223. #define USB_OTG_GINTMSK_EOPFM ((uint32_t)0x00008000) /*!< End of periodic frame interrupt mask */
  7224. #define USB_OTG_GINTMSK_EPMISM ((uint32_t)0x00020000) /*!< Endpoint mismatch interrupt mask */
  7225. #define USB_OTG_GINTMSK_IEPINT ((uint32_t)0x00040000) /*!< IN endpoints interrupt mask */
  7226. #define USB_OTG_GINTMSK_OEPINT ((uint32_t)0x00080000) /*!< OUT endpoints interrupt mask */
  7227. #define USB_OTG_GINTMSK_IISOIXFRM ((uint32_t)0x00100000) /*!< Incomplete isochronous IN transfer mask */
  7228. #define USB_OTG_GINTMSK_PXFRM_IISOOXFRM ((uint32_t)0x00200000) /*!< Incomplete periodic transfer mask */
  7229. #define USB_OTG_GINTMSK_FSUSPM ((uint32_t)0x00400000) /*!< Data fetch suspended mask */
  7230. #define USB_OTG_GINTMSK_PRTIM ((uint32_t)0x01000000) /*!< Host port interrupt mask */
  7231. #define USB_OTG_GINTMSK_HCIM ((uint32_t)0x02000000) /*!< Host channels interrupt mask */
  7232. #define USB_OTG_GINTMSK_PTXFEM ((uint32_t)0x04000000) /*!< Periodic TxFIFO empty mask */
  7233. #define USB_OTG_GINTMSK_CIDSCHGM ((uint32_t)0x10000000) /*!< Connector ID status change mask */
  7234. #define USB_OTG_GINTMSK_DISCINT ((uint32_t)0x20000000) /*!< Disconnect detected interrupt mask */
  7235. #define USB_OTG_GINTMSK_SRQIM ((uint32_t)0x40000000) /*!< Session request/new session detected interrupt mask */
  7236. #define USB_OTG_GINTMSK_WUIM ((uint32_t)0x80000000) /*!< Resume/remote wakeup detected interrupt mask */
  7237. /******************** Bit definition forUSB_OTG_DAINT register ********************/
  7238. #define USB_OTG_DAINT_IEPINT ((uint32_t)0x0000FFFF) /*!< IN endpoint interrupt bits */
  7239. #define USB_OTG_DAINT_OEPINT ((uint32_t)0xFFFF0000) /*!< OUT endpoint interrupt bits */
  7240. /******************** Bit definition forUSB_OTG_HAINTMSK register ********************/
  7241. #define USB_OTG_HAINTMSK_HAINTM ((uint32_t)0x0000FFFF) /*!< Channel interrupt mask */
  7242. /******************** Bit definition for USB_OTG_GRXSTSP register ********************/
  7243. #define USB_OTG_GRXSTSP_EPNUM ((uint32_t)0x0000000F) /*!< IN EP interrupt mask bits */
  7244. #define USB_OTG_GRXSTSP_BCNT ((uint32_t)0x00007FF0) /*!< OUT EP interrupt mask bits */
  7245. #define USB_OTG_GRXSTSP_DPID ((uint32_t)0x00018000) /*!< OUT EP interrupt mask bits */
  7246. #define USB_OTG_GRXSTSP_PKTSTS ((uint32_t)0x001E0000) /*!< OUT EP interrupt mask bits */
  7247. /******************** Bit definition forUSB_OTG_DAINTMSK register ********************/
  7248. #define USB_OTG_DAINTMSK_IEPM ((uint32_t)0x0000FFFF) /*!< IN EP interrupt mask bits */
  7249. #define USB_OTG_DAINTMSK_OEPM ((uint32_t)0xFFFF0000) /*!< OUT EP interrupt mask bits */
  7250. /******************** Bit definition for OTG register ********************/
  7251. #define USB_OTG_CHNUM ((uint32_t)0x0000000F) /*!< Channel number */
  7252. #define USB_OTG_CHNUM_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  7253. #define USB_OTG_CHNUM_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  7254. #define USB_OTG_CHNUM_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  7255. #define USB_OTG_CHNUM_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  7256. #define USB_OTG_BCNT ((uint32_t)0x00007FF0) /*!< Byte count */
  7257. #define USB_OTG_DPID ((uint32_t)0x00018000) /*!< Data PID */
  7258. #define USB_OTG_DPID_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  7259. #define USB_OTG_DPID_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  7260. #define USB_OTG_PKTSTS ((uint32_t)0x001E0000) /*!< Packet status */
  7261. #define USB_OTG_PKTSTS_0 ((uint32_t)0x00020000) /*!<Bit 0 */
  7262. #define USB_OTG_PKTSTS_1 ((uint32_t)0x00040000) /*!<Bit 1 */
  7263. #define USB_OTG_PKTSTS_2 ((uint32_t)0x00080000) /*!<Bit 2 */
  7264. #define USB_OTG_PKTSTS_3 ((uint32_t)0x00100000) /*!<Bit 3 */
  7265. #define USB_OTG_EPNUM ((uint32_t)0x0000000F) /*!< Endpoint number */
  7266. #define USB_OTG_EPNUM_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  7267. #define USB_OTG_EPNUM_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  7268. #define USB_OTG_EPNUM_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  7269. #define USB_OTG_EPNUM_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  7270. #define USB_OTG_FRMNUM ((uint32_t)0x01E00000) /*!< Frame number */
  7271. #define USB_OTG_FRMNUM_0 ((uint32_t)0x00200000) /*!<Bit 0 */
  7272. #define USB_OTG_FRMNUM_1 ((uint32_t)0x00400000) /*!<Bit 1 */
  7273. #define USB_OTG_FRMNUM_2 ((uint32_t)0x00800000) /*!<Bit 2 */
  7274. #define USB_OTG_FRMNUM_3 ((uint32_t)0x01000000) /*!<Bit 3 */
  7275. /******************** Bit definition for OTG register ********************/
  7276. #define USB_OTG_CHNUM ((uint32_t)0x0000000F) /*!< Channel number */
  7277. #define USB_OTG_CHNUM_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  7278. #define USB_OTG_CHNUM_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  7279. #define USB_OTG_CHNUM_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  7280. #define USB_OTG_CHNUM_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  7281. #define USB_OTG_BCNT ((uint32_t)0x00007FF0) /*!< Byte count */
  7282. #define USB_OTG_DPID ((uint32_t)0x00018000) /*!< Data PID */
  7283. #define USB_OTG_DPID_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  7284. #define USB_OTG_DPID_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  7285. #define USB_OTG_PKTSTS ((uint32_t)0x001E0000) /*!< Packet status */
  7286. #define USB_OTG_PKTSTS_0 ((uint32_t)0x00020000) /*!<Bit 0 */
  7287. #define USB_OTG_PKTSTS_1 ((uint32_t)0x00040000) /*!<Bit 1 */
  7288. #define USB_OTG_PKTSTS_2 ((uint32_t)0x00080000) /*!<Bit 2 */
  7289. #define USB_OTG_PKTSTS_3 ((uint32_t)0x00100000) /*!<Bit 3 */
  7290. #define USB_OTG_EPNUM ((uint32_t)0x0000000F) /*!< Endpoint number */
  7291. #define USB_OTG_EPNUM_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  7292. #define USB_OTG_EPNUM_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  7293. #define USB_OTG_EPNUM_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  7294. #define USB_OTG_EPNUM_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  7295. #define USB_OTG_FRMNUM ((uint32_t)0x01E00000) /*!< Frame number */
  7296. #define USB_OTG_FRMNUM_0 ((uint32_t)0x00200000) /*!<Bit 0 */
  7297. #define USB_OTG_FRMNUM_1 ((uint32_t)0x00400000) /*!<Bit 1 */
  7298. #define USB_OTG_FRMNUM_2 ((uint32_t)0x00800000) /*!<Bit 2 */
  7299. #define USB_OTG_FRMNUM_3 ((uint32_t)0x01000000) /*!<Bit 3 */
  7300. /******************** Bit definition forUSB_OTG_GRXFSIZ register ********************/
  7301. #define USB_OTG_GRXFSIZ_RXFD ((uint32_t)0x0000FFFF) /*!< RxFIFO depth */
  7302. /******************** Bit definition forUSB_OTG_DVBUSDIS register ********************/
  7303. #define USB_OTG_DVBUSDIS_VBUSDT ((uint32_t)0x0000FFFF) /*!< Device VBUS discharge time */
  7304. /******************** Bit definition for OTG register ********************/
  7305. #define USB_OTG_NPTXFSA ((uint32_t)0x0000FFFF) /*!< Nonperiodic transmit RAM start address */
  7306. #define USB_OTG_NPTXFD ((uint32_t)0xFFFF0000) /*!< Nonperiodic TxFIFO depth */
  7307. #define USB_OTG_TX0FSA ((uint32_t)0x0000FFFF) /*!< Endpoint 0 transmit RAM start address */
  7308. #define USB_OTG_TX0FD ((uint32_t)0xFFFF0000) /*!< Endpoint 0 TxFIFO depth */
  7309. /******************** Bit definition forUSB_OTG_DVBUSPULSE register ********************/
  7310. #define USB_OTG_DVBUSPULSE_DVBUSP ((uint32_t)0x00000FFF) /*!< Device VBUS pulsing time */
  7311. /******************** Bit definition forUSB_OTG_GNPTXSTS register ********************/
  7312. #define USB_OTG_GNPTXSTS_NPTXFSAV ((uint32_t)0x0000FFFF) /*!< Nonperiodic TxFIFO space available */
  7313. #define USB_OTG_GNPTXSTS_NPTQXSAV ((uint32_t)0x00FF0000) /*!< Nonperiodic transmit request queue space available */
  7314. #define USB_OTG_GNPTXSTS_NPTQXSAV_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  7315. #define USB_OTG_GNPTXSTS_NPTQXSAV_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  7316. #define USB_OTG_GNPTXSTS_NPTQXSAV_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  7317. #define USB_OTG_GNPTXSTS_NPTQXSAV_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  7318. #define USB_OTG_GNPTXSTS_NPTQXSAV_4 ((uint32_t)0x00100000) /*!<Bit 4 */
  7319. #define USB_OTG_GNPTXSTS_NPTQXSAV_5 ((uint32_t)0x00200000) /*!<Bit 5 */
  7320. #define USB_OTG_GNPTXSTS_NPTQXSAV_6 ((uint32_t)0x00400000) /*!<Bit 6 */
  7321. #define USB_OTG_GNPTXSTS_NPTQXSAV_7 ((uint32_t)0x00800000) /*!<Bit 7 */
  7322. #define USB_OTG_GNPTXSTS_NPTXQTOP ((uint32_t)0x7F000000) /*!< Top of the nonperiodic transmit request queue */
  7323. #define USB_OTG_GNPTXSTS_NPTXQTOP_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  7324. #define USB_OTG_GNPTXSTS_NPTXQTOP_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  7325. #define USB_OTG_GNPTXSTS_NPTXQTOP_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  7326. #define USB_OTG_GNPTXSTS_NPTXQTOP_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  7327. #define USB_OTG_GNPTXSTS_NPTXQTOP_4 ((uint32_t)0x10000000) /*!<Bit 4 */
  7328. #define USB_OTG_GNPTXSTS_NPTXQTOP_5 ((uint32_t)0x20000000) /*!<Bit 5 */
  7329. #define USB_OTG_GNPTXSTS_NPTXQTOP_6 ((uint32_t)0x40000000) /*!<Bit 6 */
  7330. /******************** Bit definition forUSB_OTG_DTHRCTL register ********************/
  7331. #define USB_OTG_DTHRCTL_NONISOTHREN ((uint32_t)0x00000001) /*!< Nonisochronous IN endpoints threshold enable */
  7332. #define USB_OTG_DTHRCTL_ISOTHREN ((uint32_t)0x00000002) /*!< ISO IN endpoint threshold enable */
  7333. #define USB_OTG_DTHRCTL_TXTHRLEN ((uint32_t)0x000007FC) /*!< Transmit threshold length */
  7334. #define USB_OTG_DTHRCTL_TXTHRLEN_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  7335. #define USB_OTG_DTHRCTL_TXTHRLEN_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  7336. #define USB_OTG_DTHRCTL_TXTHRLEN_2 ((uint32_t)0x00000010) /*!<Bit 2 */
  7337. #define USB_OTG_DTHRCTL_TXTHRLEN_3 ((uint32_t)0x00000020) /*!<Bit 3 */
  7338. #define USB_OTG_DTHRCTL_TXTHRLEN_4 ((uint32_t)0x00000040) /*!<Bit 4 */
  7339. #define USB_OTG_DTHRCTL_TXTHRLEN_5 ((uint32_t)0x00000080) /*!<Bit 5 */
  7340. #define USB_OTG_DTHRCTL_TXTHRLEN_6 ((uint32_t)0x00000100) /*!<Bit 6 */
  7341. #define USB_OTG_DTHRCTL_TXTHRLEN_7 ((uint32_t)0x00000200) /*!<Bit 7 */
  7342. #define USB_OTG_DTHRCTL_TXTHRLEN_8 ((uint32_t)0x00000400) /*!<Bit 8 */
  7343. #define USB_OTG_DTHRCTL_RXTHREN ((uint32_t)0x00010000) /*!< Receive threshold enable */
  7344. #define USB_OTG_DTHRCTL_RXTHRLEN ((uint32_t)0x03FE0000) /*!< Receive threshold length */
  7345. #define USB_OTG_DTHRCTL_RXTHRLEN_0 ((uint32_t)0x00020000) /*!<Bit 0 */
  7346. #define USB_OTG_DTHRCTL_RXTHRLEN_1 ((uint32_t)0x00040000) /*!<Bit 1 */
  7347. #define USB_OTG_DTHRCTL_RXTHRLEN_2 ((uint32_t)0x00080000) /*!<Bit 2 */
  7348. #define USB_OTG_DTHRCTL_RXTHRLEN_3 ((uint32_t)0x00100000) /*!<Bit 3 */
  7349. #define USB_OTG_DTHRCTL_RXTHRLEN_4 ((uint32_t)0x00200000) /*!<Bit 4 */
  7350. #define USB_OTG_DTHRCTL_RXTHRLEN_5 ((uint32_t)0x00400000) /*!<Bit 5 */
  7351. #define USB_OTG_DTHRCTL_RXTHRLEN_6 ((uint32_t)0x00800000) /*!<Bit 6 */
  7352. #define USB_OTG_DTHRCTL_RXTHRLEN_7 ((uint32_t)0x01000000) /*!<Bit 7 */
  7353. #define USB_OTG_DTHRCTL_RXTHRLEN_8 ((uint32_t)0x02000000) /*!<Bit 8 */
  7354. #define USB_OTG_DTHRCTL_ARPEN ((uint32_t)0x08000000) /*!< Arbiter parking enable */
  7355. /******************** Bit definition forUSB_OTG_DIEPEMPMSK register ********************/
  7356. #define USB_OTG_DIEPEMPMSK_INEPTXFEM ((uint32_t)0x0000FFFF) /*!< IN EP Tx FIFO empty interrupt mask bits */
  7357. /******************** Bit definition forUSB_OTG_DEACHINT register ********************/
  7358. #define USB_OTG_DEACHINT_IEP1INT ((uint32_t)0x00000002) /*!< IN endpoint 1interrupt bit */
  7359. #define USB_OTG_DEACHINT_OEP1INT ((uint32_t)0x00020000) /*!< OUT endpoint 1 interrupt bit */
  7360. /******************** Bit definition forUSB_OTG_GCCFG register ********************/
  7361. #define USB_OTG_GCCFG_PWRDWN ((uint32_t)0x00010000) /*!< Power down */
  7362. #define USB_OTG_GCCFG_I2CPADEN ((uint32_t)0x00020000) /*!< Enable I2C bus connection for the external I2C PHY interface */
  7363. #define USB_OTG_GCCFG_VBUSASEN ((uint32_t)0x00040000) /*!< Enable the VBUS sensing device */
  7364. #define USB_OTG_GCCFG_VBUSBSEN ((uint32_t)0x00080000) /*!< Enable the VBUS sensing device */
  7365. #define USB_OTG_GCCFG_SOFOUTEN ((uint32_t)0x00100000) /*!< SOF output enable */
  7366. #define USB_OTG_GCCFG_NOVBUSSENS ((uint32_t)0x00200000) /*!< VBUS sensing disable option */
  7367. /******************** Bit definition forUSB_OTG_DEACHINTMSK register ********************/
  7368. #define USB_OTG_DEACHINTMSK_IEP1INTM ((uint32_t)0x00000002) /*!< IN Endpoint 1 interrupt mask bit */
  7369. #define USB_OTG_DEACHINTMSK_OEP1INTM ((uint32_t)0x00020000) /*!< OUT Endpoint 1 interrupt mask bit */
  7370. /******************** Bit definition forUSB_OTG_CID register ********************/
  7371. #define USB_OTG_CID_PRODUCT_ID ((uint32_t)0xFFFFFFFF) /*!< Product ID field */
  7372. /******************** Bit definition forUSB_OTG_DIEPEACHMSK1 register ********************/
  7373. #define USB_OTG_DIEPEACHMSK1_XFRCM ((uint32_t)0x00000001) /*!< Transfer completed interrupt mask */
  7374. #define USB_OTG_DIEPEACHMSK1_EPDM ((uint32_t)0x00000002) /*!< Endpoint disabled interrupt mask */
  7375. #define USB_OTG_DIEPEACHMSK1_TOM ((uint32_t)0x00000008) /*!< Timeout condition mask (nonisochronous endpoints) */
  7376. #define USB_OTG_DIEPEACHMSK1_ITTXFEMSK ((uint32_t)0x00000010) /*!< IN token received when TxFIFO empty mask */
  7377. #define USB_OTG_DIEPEACHMSK1_INEPNMM ((uint32_t)0x00000020) /*!< IN token received with EP mismatch mask */
  7378. #define USB_OTG_DIEPEACHMSK1_INEPNEM ((uint32_t)0x00000040) /*!< IN endpoint NAK effective mask */
  7379. #define USB_OTG_DIEPEACHMSK1_TXFURM ((uint32_t)0x00000100) /*!< FIFO underrun mask */
  7380. #define USB_OTG_DIEPEACHMSK1_BIM ((uint32_t)0x00000200) /*!< BNA interrupt mask */
  7381. #define USB_OTG_DIEPEACHMSK1_NAKM ((uint32_t)0x00002000) /*!< NAK interrupt mask */
  7382. /******************** Bit definition forUSB_OTG_HPRT register ********************/
  7383. #define USB_OTG_HPRT_PCSTS ((uint32_t)0x00000001) /*!< Port connect status */
  7384. #define USB_OTG_HPRT_PCDET ((uint32_t)0x00000002) /*!< Port connect detected */
  7385. #define USB_OTG_HPRT_PENA ((uint32_t)0x00000004) /*!< Port enable */
  7386. #define USB_OTG_HPRT_PENCHNG ((uint32_t)0x00000008) /*!< Port enable/disable change */
  7387. #define USB_OTG_HPRT_POCA ((uint32_t)0x00000010) /*!< Port overcurrent active */
  7388. #define USB_OTG_HPRT_POCCHNG ((uint32_t)0x00000020) /*!< Port overcurrent change */
  7389. #define USB_OTG_HPRT_PRES ((uint32_t)0x00000040) /*!< Port resume */
  7390. #define USB_OTG_HPRT_PSUSP ((uint32_t)0x00000080) /*!< Port suspend */
  7391. #define USB_OTG_HPRT_PRST ((uint32_t)0x00000100) /*!< Port reset */
  7392. #define USB_OTG_HPRT_PLSTS ((uint32_t)0x00000C00) /*!< Port line status */
  7393. #define USB_OTG_HPRT_PLSTS_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  7394. #define USB_OTG_HPRT_PLSTS_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  7395. #define USB_OTG_HPRT_PPWR ((uint32_t)0x00001000) /*!< Port power */
  7396. #define USB_OTG_HPRT_PTCTL ((uint32_t)0x0001E000) /*!< Port test control */
  7397. #define USB_OTG_HPRT_PTCTL_0 ((uint32_t)0x00002000) /*!<Bit 0 */
  7398. #define USB_OTG_HPRT_PTCTL_1 ((uint32_t)0x00004000) /*!<Bit 1 */
  7399. #define USB_OTG_HPRT_PTCTL_2 ((uint32_t)0x00008000) /*!<Bit 2 */
  7400. #define USB_OTG_HPRT_PTCTL_3 ((uint32_t)0x00010000) /*!<Bit 3 */
  7401. #define USB_OTG_HPRT_PSPD ((uint32_t)0x00060000) /*!< Port speed */
  7402. #define USB_OTG_HPRT_PSPD_0 ((uint32_t)0x00020000) /*!<Bit 0 */
  7403. #define USB_OTG_HPRT_PSPD_1 ((uint32_t)0x00040000) /*!<Bit 1 */
  7404. /******************** Bit definition forUSB_OTG_DOEPEACHMSK1 register ********************/
  7405. #define USB_OTG_DOEPEACHMSK1_XFRCM ((uint32_t)0x00000001) /*!< Transfer completed interrupt mask */
  7406. #define USB_OTG_DOEPEACHMSK1_EPDM ((uint32_t)0x00000002) /*!< Endpoint disabled interrupt mask */
  7407. #define USB_OTG_DOEPEACHMSK1_TOM ((uint32_t)0x00000008) /*!< Timeout condition mask */
  7408. #define USB_OTG_DOEPEACHMSK1_ITTXFEMSK ((uint32_t)0x00000010) /*!< IN token received when TxFIFO empty mask */
  7409. #define USB_OTG_DOEPEACHMSK1_INEPNMM ((uint32_t)0x00000020) /*!< IN token received with EP mismatch mask */
  7410. #define USB_OTG_DOEPEACHMSK1_INEPNEM ((uint32_t)0x00000040) /*!< IN endpoint NAK effective mask */
  7411. #define USB_OTG_DOEPEACHMSK1_TXFURM ((uint32_t)0x00000100) /*!< OUT packet error mask */
  7412. #define USB_OTG_DOEPEACHMSK1_BIM ((uint32_t)0x00000200) /*!< BNA interrupt mask */
  7413. #define USB_OTG_DOEPEACHMSK1_BERRM ((uint32_t)0x00001000) /*!< Bubble error interrupt mask */
  7414. #define USB_OTG_DOEPEACHMSK1_NAKM ((uint32_t)0x00002000) /*!< NAK interrupt mask */
  7415. #define USB_OTG_DOEPEACHMSK1_NYETM ((uint32_t)0x00004000) /*!< NYET interrupt mask */
  7416. /******************** Bit definition forUSB_OTG_HPTXFSIZ register ********************/
  7417. #define USB_OTG_HPTXFSIZ_PTXSA ((uint32_t)0x0000FFFF) /*!< Host periodic TxFIFO start address */
  7418. #define USB_OTG_HPTXFSIZ_PTXFD ((uint32_t)0xFFFF0000) /*!< Host periodic TxFIFO depth */
  7419. /******************** Bit definition forUSB_OTG_DIEPCTL register ********************/
  7420. #define USB_OTG_DIEPCTL_MPSIZ ((uint32_t)0x000007FF) /*!< Maximum packet size */
  7421. #define USB_OTG_DIEPCTL_USBAEP ((uint32_t)0x00008000) /*!< USB active endpoint */
  7422. #define USB_OTG_DIEPCTL_EONUM_DPID ((uint32_t)0x00010000) /*!< Even/odd frame */
  7423. #define USB_OTG_DIEPCTL_NAKSTS ((uint32_t)0x00020000) /*!< NAK status */
  7424. #define USB_OTG_DIEPCTL_EPTYP ((uint32_t)0x000C0000) /*!< Endpoint type */
  7425. #define USB_OTG_DIEPCTL_EPTYP_0 ((uint32_t)0x00040000) /*!<Bit 0 */
  7426. #define USB_OTG_DIEPCTL_EPTYP_1 ((uint32_t)0x00080000) /*!<Bit 1 */
  7427. #define USB_OTG_DIEPCTL_STALL ((uint32_t)0x00200000) /*!< STALL handshake */
  7428. #define USB_OTG_DIEPCTL_TXFNUM ((uint32_t)0x03C00000) /*!< TxFIFO number */
  7429. #define USB_OTG_DIEPCTL_TXFNUM_0 ((uint32_t)0x00400000) /*!<Bit 0 */
  7430. #define USB_OTG_DIEPCTL_TXFNUM_1 ((uint32_t)0x00800000) /*!<Bit 1 */
  7431. #define USB_OTG_DIEPCTL_TXFNUM_2 ((uint32_t)0x01000000) /*!<Bit 2 */
  7432. #define USB_OTG_DIEPCTL_TXFNUM_3 ((uint32_t)0x02000000) /*!<Bit 3 */
  7433. #define USB_OTG_DIEPCTL_CNAK ((uint32_t)0x04000000) /*!< Clear NAK */
  7434. #define USB_OTG_DIEPCTL_SNAK ((uint32_t)0x08000000) /*!< Set NAK */
  7435. #define USB_OTG_DIEPCTL_SD0PID_SEVNFRM ((uint32_t)0x10000000) /*!< Set DATA0 PID */
  7436. #define USB_OTG_DIEPCTL_SODDFRM ((uint32_t)0x20000000) /*!< Set odd frame */
  7437. #define USB_OTG_DIEPCTL_EPDIS ((uint32_t)0x40000000) /*!< Endpoint disable */
  7438. #define USB_OTG_DIEPCTL_EPENA ((uint32_t)0x80000000) /*!< Endpoint enable */
  7439. /******************** Bit definition forUSB_OTG_HCCHAR register ********************/
  7440. #define USB_OTG_HCCHAR_MPSIZ ((uint32_t)0x000007FF) /*!< Maximum packet size */
  7441. #define USB_OTG_HCCHAR_EPNUM ((uint32_t)0x00007800) /*!< Endpoint number */
  7442. #define USB_OTG_HCCHAR_EPNUM_0 ((uint32_t)0x00000800) /*!<Bit 0 */
  7443. #define USB_OTG_HCCHAR_EPNUM_1 ((uint32_t)0x00001000) /*!<Bit 1 */
  7444. #define USB_OTG_HCCHAR_EPNUM_2 ((uint32_t)0x00002000) /*!<Bit 2 */
  7445. #define USB_OTG_HCCHAR_EPNUM_3 ((uint32_t)0x00004000) /*!<Bit 3 */
  7446. #define USB_OTG_HCCHAR_EPDIR ((uint32_t)0x00008000) /*!< Endpoint direction */
  7447. #define USB_OTG_HCCHAR_LSDEV ((uint32_t)0x00020000) /*!< Low-speed device */
  7448. #define USB_OTG_HCCHAR_EPTYP ((uint32_t)0x000C0000) /*!< Endpoint type */
  7449. #define USB_OTG_HCCHAR_EPTYP_0 ((uint32_t)0x00040000) /*!<Bit 0 */
  7450. #define USB_OTG_HCCHAR_EPTYP_1 ((uint32_t)0x00080000) /*!<Bit 1 */
  7451. #define USB_OTG_HCCHAR_MC ((uint32_t)0x00300000) /*!< Multi Count (MC) / Error Count (EC) */
  7452. #define USB_OTG_HCCHAR_MC_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  7453. #define USB_OTG_HCCHAR_MC_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  7454. #define USB_OTG_HCCHAR_DAD ((uint32_t)0x1FC00000) /*!< Device address */
  7455. #define USB_OTG_HCCHAR_DAD_0 ((uint32_t)0x00400000) /*!<Bit 0 */
  7456. #define USB_OTG_HCCHAR_DAD_1 ((uint32_t)0x00800000) /*!<Bit 1 */
  7457. #define USB_OTG_HCCHAR_DAD_2 ((uint32_t)0x01000000) /*!<Bit 2 */
  7458. #define USB_OTG_HCCHAR_DAD_3 ((uint32_t)0x02000000) /*!<Bit 3 */
  7459. #define USB_OTG_HCCHAR_DAD_4 ((uint32_t)0x04000000) /*!<Bit 4 */
  7460. #define USB_OTG_HCCHAR_DAD_5 ((uint32_t)0x08000000) /*!<Bit 5 */
  7461. #define USB_OTG_HCCHAR_DAD_6 ((uint32_t)0x10000000) /*!<Bit 6 */
  7462. #define USB_OTG_HCCHAR_ODDFRM ((uint32_t)0x20000000) /*!< Odd frame */
  7463. #define USB_OTG_HCCHAR_CHDIS ((uint32_t)0x40000000) /*!< Channel disable */
  7464. #define USB_OTG_HCCHAR_CHENA ((uint32_t)0x80000000) /*!< Channel enable */
  7465. /******************** Bit definition forUSB_OTG_HCSPLT register ********************/
  7466. #define USB_OTG_HCSPLT_PRTADDR ((uint32_t)0x0000007F) /*!< Port address */
  7467. #define USB_OTG_HCSPLT_PRTADDR_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  7468. #define USB_OTG_HCSPLT_PRTADDR_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  7469. #define USB_OTG_HCSPLT_PRTADDR_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  7470. #define USB_OTG_HCSPLT_PRTADDR_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  7471. #define USB_OTG_HCSPLT_PRTADDR_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  7472. #define USB_OTG_HCSPLT_PRTADDR_5 ((uint32_t)0x00000020) /*!<Bit 5 */
  7473. #define USB_OTG_HCSPLT_PRTADDR_6 ((uint32_t)0x00000040) /*!<Bit 6 */
  7474. #define USB_OTG_HCSPLT_HUBADDR ((uint32_t)0x00003F80) /*!< Hub address */
  7475. #define USB_OTG_HCSPLT_HUBADDR_0 ((uint32_t)0x00000080) /*!<Bit 0 */
  7476. #define USB_OTG_HCSPLT_HUBADDR_1 ((uint32_t)0x00000100) /*!<Bit 1 */
  7477. #define USB_OTG_HCSPLT_HUBADDR_2 ((uint32_t)0x00000200) /*!<Bit 2 */
  7478. #define USB_OTG_HCSPLT_HUBADDR_3 ((uint32_t)0x00000400) /*!<Bit 3 */
  7479. #define USB_OTG_HCSPLT_HUBADDR_4 ((uint32_t)0x00000800) /*!<Bit 4 */
  7480. #define USB_OTG_HCSPLT_HUBADDR_5 ((uint32_t)0x00001000) /*!<Bit 5 */
  7481. #define USB_OTG_HCSPLT_HUBADDR_6 ((uint32_t)0x00002000) /*!<Bit 6 */
  7482. #define USB_OTG_HCSPLT_XACTPOS ((uint32_t)0x0000C000) /*!< XACTPOS */
  7483. #define USB_OTG_HCSPLT_XACTPOS_0 ((uint32_t)0x00004000) /*!<Bit 0 */
  7484. #define USB_OTG_HCSPLT_XACTPOS_1 ((uint32_t)0x00008000) /*!<Bit 1 */
  7485. #define USB_OTG_HCSPLT_COMPLSPLT ((uint32_t)0x00010000) /*!< Do complete split */
  7486. #define USB_OTG_HCSPLT_SPLITEN ((uint32_t)0x80000000) /*!< Split enable */
  7487. /******************** Bit definition forUSB_OTG_HCINT register ********************/
  7488. #define USB_OTG_HCINT_XFRC ((uint32_t)0x00000001) /*!< Transfer completed */
  7489. #define USB_OTG_HCINT_CHH ((uint32_t)0x00000002) /*!< Channel halted */
  7490. #define USB_OTG_HCINT_AHBERR ((uint32_t)0x00000004) /*!< AHB error */
  7491. #define USB_OTG_HCINT_STALL ((uint32_t)0x00000008) /*!< STALL response received interrupt */
  7492. #define USB_OTG_HCINT_NAK ((uint32_t)0x00000010) /*!< NAK response received interrupt */
  7493. #define USB_OTG_HCINT_ACK ((uint32_t)0x00000020) /*!< ACK response received/transmitted interrupt */
  7494. #define USB_OTG_HCINT_NYET ((uint32_t)0x00000040) /*!< Response received interrupt */
  7495. #define USB_OTG_HCINT_TXERR ((uint32_t)0x00000080) /*!< Transaction error */
  7496. #define USB_OTG_HCINT_BBERR ((uint32_t)0x00000100) /*!< Babble error */
  7497. #define USB_OTG_HCINT_FRMOR ((uint32_t)0x00000200) /*!< Frame overrun */
  7498. #define USB_OTG_HCINT_DTERR ((uint32_t)0x00000400) /*!< Data toggle error */
  7499. /******************** Bit definition forUSB_OTG_DIEPINT register ********************/
  7500. #define USB_OTG_DIEPINT_XFRC ((uint32_t)0x00000001) /*!< Transfer completed interrupt */
  7501. #define USB_OTG_DIEPINT_EPDISD ((uint32_t)0x00000002) /*!< Endpoint disabled interrupt */
  7502. #define USB_OTG_DIEPINT_TOC ((uint32_t)0x00000008) /*!< Timeout condition */
  7503. #define USB_OTG_DIEPINT_ITTXFE ((uint32_t)0x00000010) /*!< IN token received when TxFIFO is empty */
  7504. #define USB_OTG_DIEPINT_INEPNE ((uint32_t)0x00000040) /*!< IN endpoint NAK effective */
  7505. #define USB_OTG_DIEPINT_TXFE ((uint32_t)0x00000080) /*!< Transmit FIFO empty */
  7506. #define USB_OTG_DIEPINT_TXFIFOUDRN ((uint32_t)0x00000100) /*!< Transmit Fifo Underrun */
  7507. #define USB_OTG_DIEPINT_BNA ((uint32_t)0x00000200) /*!< Buffer not available interrupt */
  7508. #define USB_OTG_DIEPINT_PKTDRPSTS ((uint32_t)0x00000800) /*!< Packet dropped status */
  7509. #define USB_OTG_DIEPINT_BERR ((uint32_t)0x00001000) /*!< Babble error interrupt */
  7510. #define USB_OTG_DIEPINT_NAK ((uint32_t)0x00002000) /*!< NAK interrupt */
  7511. /******************** Bit definition forUSB_OTG_HCINTMSK register ********************/
  7512. #define USB_OTG_HCINTMSK_XFRCM ((uint32_t)0x00000001) /*!< Transfer completed mask */
  7513. #define USB_OTG_HCINTMSK_CHHM ((uint32_t)0x00000002) /*!< Channel halted mask */
  7514. #define USB_OTG_HCINTMSK_AHBERR ((uint32_t)0x00000004) /*!< AHB error */
  7515. #define USB_OTG_HCINTMSK_STALLM ((uint32_t)0x00000008) /*!< STALL response received interrupt mask */
  7516. #define USB_OTG_HCINTMSK_NAKM ((uint32_t)0x00000010) /*!< NAK response received interrupt mask */
  7517. #define USB_OTG_HCINTMSK_ACKM ((uint32_t)0x00000020) /*!< ACK response received/transmitted interrupt mask */
  7518. #define USB_OTG_HCINTMSK_NYET ((uint32_t)0x00000040) /*!< response received interrupt mask */
  7519. #define USB_OTG_HCINTMSK_TXERRM ((uint32_t)0x00000080) /*!< Transaction error mask */
  7520. #define USB_OTG_HCINTMSK_BBERRM ((uint32_t)0x00000100) /*!< Babble error mask */
  7521. #define USB_OTG_HCINTMSK_FRMORM ((uint32_t)0x00000200) /*!< Frame overrun mask */
  7522. #define USB_OTG_HCINTMSK_DTERRM ((uint32_t)0x00000400) /*!< Data toggle error mask */
  7523. /******************** Bit definition for USB_OTG_DIEPTSIZ register ********************/
  7524. #define USB_OTG_DIEPTSIZ_XFRSIZ ((uint32_t)0x0007FFFF) /*!< Transfer size */
  7525. #define USB_OTG_DIEPTSIZ_PKTCNT ((uint32_t)0x1FF80000) /*!< Packet count */
  7526. #define USB_OTG_DIEPTSIZ_MULCNT ((uint32_t)0x60000000) /*!< Packet count */
  7527. /******************** Bit definition forUSB_OTG_HCTSIZ register ********************/
  7528. #define USB_OTG_HCTSIZ_XFRSIZ ((uint32_t)0x0007FFFF) /*!< Transfer size */
  7529. #define USB_OTG_HCTSIZ_PKTCNT ((uint32_t)0x1FF80000) /*!< Packet count */
  7530. #define USB_OTG_HCTSIZ_DOPING ((uint32_t)0x80000000) /*!< Do PING */
  7531. #define USB_OTG_HCTSIZ_DPID ((uint32_t)0x60000000) /*!< Data PID */
  7532. #define USB_OTG_HCTSIZ_DPID_0 ((uint32_t)0x20000000) /*!<Bit 0 */
  7533. #define USB_OTG_HCTSIZ_DPID_1 ((uint32_t)0x40000000) /*!<Bit 1 */
  7534. /******************** Bit definition forUSB_OTG_DIEPDMA register ********************/
  7535. #define USB_OTG_DIEPDMA_DMAADDR ((uint32_t)0xFFFFFFFF) /*!< DMA address */
  7536. /******************** Bit definition forUSB_OTG_HCDMA register ********************/
  7537. #define USB_OTG_HCDMA_DMAADDR ((uint32_t)0xFFFFFFFF) /*!< DMA address */
  7538. /******************** Bit definition forUSB_OTG_DTXFSTS register ********************/
  7539. #define USB_OTG_DTXFSTS_INEPTFSAV ((uint32_t)0x0000FFFF) /*!< IN endpoint TxFIFO space available */
  7540. /******************** Bit definition forUSB_OTG_DIEPTXF register ********************/
  7541. #define USB_OTG_DIEPTXF_INEPTXSA ((uint32_t)0x0000FFFF) /*!< IN endpoint FIFOx transmit RAM start address */
  7542. #define USB_OTG_DIEPTXF_INEPTXFD ((uint32_t)0xFFFF0000) /*!< IN endpoint TxFIFO depth */
  7543. /******************** Bit definition forUSB_OTG_DOEPCTL register ********************/
  7544. #define USB_OTG_DOEPCTL_MPSIZ ((uint32_t)0x000007FF) /*!< Maximum packet size */ /*!<Bit 1 */
  7545. #define USB_OTG_DOEPCTL_USBAEP ((uint32_t)0x00008000) /*!< USB active endpoint */
  7546. #define USB_OTG_DOEPCTL_NAKSTS ((uint32_t)0x00020000) /*!< NAK status */
  7547. #define USB_OTG_DOEPCTL_SD0PID_SEVNFRM ((uint32_t)0x10000000) /*!< Set DATA0 PID */
  7548. #define USB_OTG_DOEPCTL_SODDFRM ((uint32_t)0x20000000) /*!< Set odd frame */
  7549. #define USB_OTG_DOEPCTL_EPTYP ((uint32_t)0x000C0000) /*!< Endpoint type */
  7550. #define USB_OTG_DOEPCTL_EPTYP_0 ((uint32_t)0x00040000) /*!<Bit 0 */
  7551. #define USB_OTG_DOEPCTL_EPTYP_1 ((uint32_t)0x00080000) /*!<Bit 1 */
  7552. #define USB_OTG_DOEPCTL_SNPM ((uint32_t)0x00100000) /*!< Snoop mode */
  7553. #define USB_OTG_DOEPCTL_STALL ((uint32_t)0x00200000) /*!< STALL handshake */
  7554. #define USB_OTG_DOEPCTL_CNAK ((uint32_t)0x04000000) /*!< Clear NAK */
  7555. #define USB_OTG_DOEPCTL_SNAK ((uint32_t)0x08000000) /*!< Set NAK */
  7556. #define USB_OTG_DOEPCTL_EPDIS ((uint32_t)0x40000000) /*!< Endpoint disable */
  7557. #define USB_OTG_DOEPCTL_EPENA ((uint32_t)0x80000000) /*!< Endpoint enable */
  7558. /******************** Bit definition forUSB_OTG_DOEPINT register ********************/
  7559. #define USB_OTG_DOEPINT_XFRC ((uint32_t)0x00000001) /*!< Transfer completed interrupt */
  7560. #define USB_OTG_DOEPINT_EPDISD ((uint32_t)0x00000002) /*!< Endpoint disabled interrupt */
  7561. #define USB_OTG_DOEPINT_STUP ((uint32_t)0x00000008) /*!< SETUP phase done */
  7562. #define USB_OTG_DOEPINT_OTEPDIS ((uint32_t)0x00000010) /*!< OUT token received when endpoint disabled */
  7563. #define USB_OTG_DOEPINT_B2BSTUP ((uint32_t)0x00000040) /*!< Back-to-back SETUP packets received */
  7564. #define USB_OTG_DOEPINT_NYET ((uint32_t)0x00004000) /*!< NYET interrupt */
  7565. /******************** Bit definition forUSB_OTG_DOEPTSIZ register ********************/
  7566. #define USB_OTG_DOEPTSIZ_XFRSIZ ((uint32_t)0x0007FFFF) /*!< Transfer size */
  7567. #define USB_OTG_DOEPTSIZ_PKTCNT ((uint32_t)0x1FF80000) /*!< Packet count */
  7568. #define USB_OTG_DOEPTSIZ_STUPCNT ((uint32_t)0x60000000) /*!< SETUP packet count */
  7569. #define USB_OTG_DOEPTSIZ_STUPCNT_0 ((uint32_t)0x20000000) /*!<Bit 0 */
  7570. #define USB_OTG_DOEPTSIZ_STUPCNT_1 ((uint32_t)0x40000000) /*!<Bit 1 */
  7571. /******************** Bit definition for PCGCCTL register ********************/
  7572. #define USB_OTG_PCGCCTL_STOPCLK ((uint32_t)0x00000001) /*!< SETUP packet count */
  7573. #define USB_OTG_PCGCCTL_GATECLK ((uint32_t)0x00000002) /*!<Bit 0 */
  7574. #define USB_OTG_PCGCCTL_PHYSUSP ((uint32_t)0x00000010) /*!<Bit 1 */
  7575. /**
  7576. * @}
  7577. */
  7578. /**
  7579. * @}
  7580. */
  7581. /** @addtogroup Exported_macros
  7582. * @{
  7583. */
  7584. /******************************* ADC Instances ********************************/
  7585. #define IS_ADC_ALL_INSTANCE(INSTANCE) (((INSTANCE) == ADC1) || \
  7586. ((INSTANCE) == ADC2) || \
  7587. ((INSTANCE) == ADC3))
  7588. /******************************* CAN Instances ********************************/
  7589. #define IS_CAN_ALL_INSTANCE(INSTANCE) (((INSTANCE) == CAN1) || \
  7590. ((INSTANCE) == CAN2))
  7591. /******************************* CRC Instances ********************************/
  7592. #define IS_CRC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CRC)
  7593. /******************************* DAC Instances ********************************/
  7594. #define IS_DAC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == DAC)
  7595. /******************************* DCMI Instances *******************************/
  7596. #define IS_DCMI_ALL_INSTANCE(INSTANCE) ((INSTANCE) == DCMI)
  7597. /******************************* DMA2D Instances *******************************/
  7598. #define IS_DMA2D_ALL_INSTANCE(INSTANCE) ((INSTANCE) == DMA2D)
  7599. /******************************** DMA Instances *******************************/
  7600. #define IS_DMA_STREAM_ALL_INSTANCE(INSTANCE) (((INSTANCE) == DMA1_Stream0) || \
  7601. ((INSTANCE) == DMA1_Stream1) || \
  7602. ((INSTANCE) == DMA1_Stream2) || \
  7603. ((INSTANCE) == DMA1_Stream3) || \
  7604. ((INSTANCE) == DMA1_Stream4) || \
  7605. ((INSTANCE) == DMA1_Stream5) || \
  7606. ((INSTANCE) == DMA1_Stream6) || \
  7607. ((INSTANCE) == DMA1_Stream7) || \
  7608. ((INSTANCE) == DMA2_Stream0) || \
  7609. ((INSTANCE) == DMA2_Stream1) || \
  7610. ((INSTANCE) == DMA2_Stream2) || \
  7611. ((INSTANCE) == DMA2_Stream3) || \
  7612. ((INSTANCE) == DMA2_Stream4) || \
  7613. ((INSTANCE) == DMA2_Stream5) || \
  7614. ((INSTANCE) == DMA2_Stream6) || \
  7615. ((INSTANCE) == DMA2_Stream7))
  7616. /******************************* GPIO Instances *******************************/
  7617. #define IS_GPIO_ALL_INSTANCE(INSTANCE) (((INSTANCE) == GPIOA) || \
  7618. ((INSTANCE) == GPIOB) || \
  7619. ((INSTANCE) == GPIOC) || \
  7620. ((INSTANCE) == GPIOD) || \
  7621. ((INSTANCE) == GPIOE) || \
  7622. ((INSTANCE) == GPIOF) || \
  7623. ((INSTANCE) == GPIOG) || \
  7624. ((INSTANCE) == GPIOH) || \
  7625. ((INSTANCE) == GPIOI) || \
  7626. ((INSTANCE) == GPIOJ) || \
  7627. ((INSTANCE) == GPIOK))
  7628. /******************************** I2C Instances *******************************/
  7629. #define IS_I2C_ALL_INSTANCE(INSTANCE) (((INSTANCE) == I2C1) || \
  7630. ((INSTANCE) == I2C2) || \
  7631. ((INSTANCE) == I2C3))
  7632. /******************************** I2S Instances *******************************/
  7633. #define IS_I2S_ALL_INSTANCE(INSTANCE) (((INSTANCE) == SPI2) || \
  7634. ((INSTANCE) == SPI3))
  7635. /*************************** I2S Extended Instances ***************************/
  7636. #define IS_I2S_ALL_INSTANCE_EXT(PERIPH) (((INSTANCE) == SPI2) || \
  7637. ((INSTANCE) == SPI3) || \
  7638. ((INSTANCE) == I2S2ext) || \
  7639. ((INSTANCE) == I2S3ext))
  7640. /******************************* RNG Instances ********************************/
  7641. #define IS_RNG_ALL_INSTANCE(INSTANCE) ((INSTANCE) == RNG)
  7642. /****************************** RTC Instances *********************************/
  7643. #define IS_RTC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == RTC)
  7644. /******************************* SAI Instances ********************************/
  7645. #define IS_SAI_BLOCK_PERIPH(PERIPH) (((PERIPH) == SAI1_Block_A) || \
  7646. ((PERIPH) == SAI1_Block_B))
  7647. /******************************** SPI Instances *******************************/
  7648. #define IS_SPI_ALL_INSTANCE(INSTANCE) (((INSTANCE) == SPI1) || \
  7649. ((INSTANCE) == SPI2) || \
  7650. ((INSTANCE) == SPI3) || \
  7651. ((INSTANCE) == SPI4) || \
  7652. ((INSTANCE) == SPI5) || \
  7653. ((INSTANCE) == SPI6))
  7654. /*************************** SPI Extended Instances ***************************/
  7655. #define IS_SPI_ALL_INSTANCE_EXT(INSTANCE) (((INSTANCE) == SPI1) || \
  7656. ((INSTANCE) == SPI2) || \
  7657. ((INSTANCE) == SPI3) || \
  7658. ((INSTANCE) == SPI4) || \
  7659. ((INSTANCE) == SPI5) || \
  7660. ((INSTANCE) == SPI6) || \
  7661. ((INSTANCE) == I2S2ext) || \
  7662. ((INSTANCE) == I2S3ext))
  7663. /****************** TIM Instances : All supported instances *******************/
  7664. #define IS_TIM_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  7665. ((INSTANCE) == TIM2) || \
  7666. ((INSTANCE) == TIM3) || \
  7667. ((INSTANCE) == TIM4) || \
  7668. ((INSTANCE) == TIM5) || \
  7669. ((INSTANCE) == TIM6) || \
  7670. ((INSTANCE) == TIM7) || \
  7671. ((INSTANCE) == TIM8) || \
  7672. ((INSTANCE) == TIM9) || \
  7673. ((INSTANCE) == TIM10) || \
  7674. ((INSTANCE) == TIM11) || \
  7675. ((INSTANCE) == TIM12) || \
  7676. ((INSTANCE) == TIM13) || \
  7677. ((INSTANCE) == TIM14))
  7678. /************* TIM Instances : at least 1 capture/compare channel *************/
  7679. #define IS_TIM_CC1_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  7680. ((INSTANCE) == TIM2) || \
  7681. ((INSTANCE) == TIM3) || \
  7682. ((INSTANCE) == TIM4) || \
  7683. ((INSTANCE) == TIM5) || \
  7684. ((INSTANCE) == TIM8) || \
  7685. ((INSTANCE) == TIM9) || \
  7686. ((INSTANCE) == TIM10) || \
  7687. ((INSTANCE) == TIM11) || \
  7688. ((INSTANCE) == TIM12) || \
  7689. ((INSTANCE) == TIM13) || \
  7690. ((INSTANCE) == TIM14))
  7691. /************ TIM Instances : at least 2 capture/compare channels *************/
  7692. #define IS_TIM_CC2_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  7693. ((INSTANCE) == TIM2) || \
  7694. ((INSTANCE) == TIM3) || \
  7695. ((INSTANCE) == TIM4) || \
  7696. ((INSTANCE) == TIM5) || \
  7697. ((INSTANCE) == TIM8) || \
  7698. ((INSTANCE) == TIM9) || \
  7699. ((INSTANCE) == TIM12))
  7700. /************ TIM Instances : at least 3 capture/compare channels *************/
  7701. #define IS_TIM_CC3_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  7702. ((INSTANCE) == TIM2) || \
  7703. ((INSTANCE) == TIM3) || \
  7704. ((INSTANCE) == TIM4) || \
  7705. ((INSTANCE) == TIM5) || \
  7706. ((INSTANCE) == TIM8))
  7707. /************ TIM Instances : at least 4 capture/compare channels *************/
  7708. #define IS_TIM_CC4_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  7709. ((INSTANCE) == TIM2) || \
  7710. ((INSTANCE) == TIM3) || \
  7711. ((INSTANCE) == TIM4) || \
  7712. ((INSTANCE) == TIM5) || \
  7713. ((INSTANCE) == TIM8))
  7714. /******************** TIM Instances : Advanced-control timers *****************/
  7715. #define IS_TIM_ADVANCED_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  7716. ((INSTANCE) == TIM8))
  7717. /******************* TIM Instances : Timer input XOR function *****************/
  7718. #define IS_TIM_XOR_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  7719. ((INSTANCE) == TIM2) || \
  7720. ((INSTANCE) == TIM3) || \
  7721. ((INSTANCE) == TIM4) || \
  7722. ((INSTANCE) == TIM5) || \
  7723. ((INSTANCE) == TIM8))
  7724. /****************** TIM Instances : DMA requests generation (UDE) *************/
  7725. #define IS_TIM_DMA_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  7726. ((INSTANCE) == TIM2) || \
  7727. ((INSTANCE) == TIM3) || \
  7728. ((INSTANCE) == TIM4) || \
  7729. ((INSTANCE) == TIM5) || \
  7730. ((INSTANCE) == TIM6) || \
  7731. ((INSTANCE) == TIM7) || \
  7732. ((INSTANCE) == TIM8))
  7733. /************ TIM Instances : DMA requests generation (CCxDE) *****************/
  7734. #define IS_TIM_DMA_CC_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  7735. ((INSTANCE) == TIM2) || \
  7736. ((INSTANCE) == TIM3) || \
  7737. ((INSTANCE) == TIM4) || \
  7738. ((INSTANCE) == TIM5) || \
  7739. ((INSTANCE) == TIM8))
  7740. /************ TIM Instances : DMA requests generation (COMDE) *****************/
  7741. #define IS_TIM_CCDMA_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  7742. ((INSTANCE) == TIM2) || \
  7743. ((INSTANCE) == TIM3) || \
  7744. ((INSTANCE) == TIM4) || \
  7745. ((INSTANCE) == TIM5) || \
  7746. ((INSTANCE) == TIM8))
  7747. /******************** TIM Instances : DMA burst feature ***********************/
  7748. #define IS_TIM_DMABURST_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  7749. ((INSTANCE) == TIM2) || \
  7750. ((INSTANCE) == TIM3) || \
  7751. ((INSTANCE) == TIM4) || \
  7752. ((INSTANCE) == TIM5) || \
  7753. ((INSTANCE) == TIM8))
  7754. /****** TIM Instances : master mode available (TIMx_CR2.MMS available )********/
  7755. #define IS_TIM_MASTER_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  7756. ((INSTANCE) == TIM2) || \
  7757. ((INSTANCE) == TIM3) || \
  7758. ((INSTANCE) == TIM4) || \
  7759. ((INSTANCE) == TIM5) || \
  7760. ((INSTANCE) == TIM6) || \
  7761. ((INSTANCE) == TIM7) || \
  7762. ((INSTANCE) == TIM8) || \
  7763. ((INSTANCE) == TIM9) || \
  7764. ((INSTANCE) == TIM12))
  7765. /*********** TIM Instances : Slave mode available (TIMx_SMCR available )*******/
  7766. #define IS_TIM_SLAVE_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  7767. ((INSTANCE) == TIM2) || \
  7768. ((INSTANCE) == TIM3) || \
  7769. ((INSTANCE) == TIM4) || \
  7770. ((INSTANCE) == TIM5) || \
  7771. ((INSTANCE) == TIM8) || \
  7772. ((INSTANCE) == TIM9) || \
  7773. ((INSTANCE) == TIM12))
  7774. /********************** TIM Instances : 32 bit Counter ************************/
  7775. #define IS_TIM_32B_COUNTER_INSTANCE(INSTANCE)(((INSTANCE) == TIM2) || \
  7776. ((INSTANCE) == TIM5))
  7777. /***************** TIM Instances : external trigger input availabe ************/
  7778. #define IS_TIM_ETR_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  7779. ((INSTANCE) == TIM2) || \
  7780. ((INSTANCE) == TIM3) || \
  7781. ((INSTANCE) == TIM4) || \
  7782. ((INSTANCE) == TIM5) || \
  7783. ((INSTANCE) == TIM8))
  7784. /****************** TIM Instances : remapping capability **********************/
  7785. #define IS_TIM_REMAP_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  7786. ((INSTANCE) == TIM5) || \
  7787. ((INSTANCE) == TIM11))
  7788. /******************* TIM Instances : output(s) available **********************/
  7789. #define IS_TIM_CCX_INSTANCE(INSTANCE, CHANNEL) \
  7790. ((((INSTANCE) == TIM1) && \
  7791. (((CHANNEL) == TIM_CHANNEL_1) || \
  7792. ((CHANNEL) == TIM_CHANNEL_2) || \
  7793. ((CHANNEL) == TIM_CHANNEL_3) || \
  7794. ((CHANNEL) == TIM_CHANNEL_4))) \
  7795. || \
  7796. (((INSTANCE) == TIM2) && \
  7797. (((CHANNEL) == TIM_CHANNEL_1) || \
  7798. ((CHANNEL) == TIM_CHANNEL_2) || \
  7799. ((CHANNEL) == TIM_CHANNEL_3) || \
  7800. ((CHANNEL) == TIM_CHANNEL_4))) \
  7801. || \
  7802. (((INSTANCE) == TIM3) && \
  7803. (((CHANNEL) == TIM_CHANNEL_1) || \
  7804. ((CHANNEL) == TIM_CHANNEL_2) || \
  7805. ((CHANNEL) == TIM_CHANNEL_3) || \
  7806. ((CHANNEL) == TIM_CHANNEL_4))) \
  7807. || \
  7808. (((INSTANCE) == TIM4) && \
  7809. (((CHANNEL) == TIM_CHANNEL_1) || \
  7810. ((CHANNEL) == TIM_CHANNEL_2) || \
  7811. ((CHANNEL) == TIM_CHANNEL_3) || \
  7812. ((CHANNEL) == TIM_CHANNEL_4))) \
  7813. || \
  7814. (((INSTANCE) == TIM5) && \
  7815. (((CHANNEL) == TIM_CHANNEL_1) || \
  7816. ((CHANNEL) == TIM_CHANNEL_2) || \
  7817. ((CHANNEL) == TIM_CHANNEL_3) || \
  7818. ((CHANNEL) == TIM_CHANNEL_4))) \
  7819. || \
  7820. (((INSTANCE) == TIM8) && \
  7821. (((CHANNEL) == TIM_CHANNEL_1) || \
  7822. ((CHANNEL) == TIM_CHANNEL_2) || \
  7823. ((CHANNEL) == TIM_CHANNEL_3) || \
  7824. ((CHANNEL) == TIM_CHANNEL_4))) \
  7825. || \
  7826. (((INSTANCE) == TIM9) && \
  7827. (((CHANNEL) == TIM_CHANNEL_1) || \
  7828. ((CHANNEL) == TIM_CHANNEL_2))) \
  7829. || \
  7830. (((INSTANCE) == TIM10) && \
  7831. (((CHANNEL) == TIM_CHANNEL_1))) \
  7832. || \
  7833. (((INSTANCE) == TIM11) && \
  7834. (((CHANNEL) == TIM_CHANNEL_1))) \
  7835. || \
  7836. (((INSTANCE) == TIM12) && \
  7837. (((CHANNEL) == TIM_CHANNEL_1) || \
  7838. ((CHANNEL) == TIM_CHANNEL_2))) \
  7839. || \
  7840. (((INSTANCE) == TIM13) && \
  7841. (((CHANNEL) == TIM_CHANNEL_1))) \
  7842. || \
  7843. (((INSTANCE) == TIM14) && \
  7844. (((CHANNEL) == TIM_CHANNEL_1))))
  7845. /************ TIM Instances : complementary output(s) available ***************/
  7846. #define IS_TIM_CCXN_INSTANCE(INSTANCE, CHANNEL) \
  7847. ((((INSTANCE) == TIM1) && \
  7848. (((CHANNEL) == TIM_CHANNEL_1) || \
  7849. ((CHANNEL) == TIM_CHANNEL_2) || \
  7850. ((CHANNEL) == TIM_CHANNEL_3))) \
  7851. || \
  7852. (((INSTANCE) == TIM8) && \
  7853. (((CHANNEL) == TIM_CHANNEL_1) || \
  7854. ((CHANNEL) == TIM_CHANNEL_2) || \
  7855. ((CHANNEL) == TIM_CHANNEL_3))))
  7856. /******************** USART Instances : Synchronous mode **********************/
  7857. #define IS_USART_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  7858. ((INSTANCE) == USART2) || \
  7859. ((INSTANCE) == USART3) || \
  7860. ((INSTANCE) == USART6))
  7861. /******************** UART Instances : Asynchronous mode **********************/
  7862. #define IS_UART_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  7863. ((INSTANCE) == USART2) || \
  7864. ((INSTANCE) == USART3) || \
  7865. ((INSTANCE) == UART4) || \
  7866. ((INSTANCE) == UART5) || \
  7867. ((INSTANCE) == USART6) || \
  7868. ((INSTANCE) == UART7) || \
  7869. ((INSTANCE) == UART8))
  7870. /****************** UART Instances : Hardware Flow control ********************/
  7871. #define IS_UART_HWFLOW_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  7872. ((INSTANCE) == USART2) || \
  7873. ((INSTANCE) == USART3) || \
  7874. ((INSTANCE) == USART6))
  7875. /********************* UART Instances : Smard card mode ***********************/
  7876. #define IS_SMARTCARD_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  7877. ((INSTANCE) == USART2) || \
  7878. ((INSTANCE) == USART3) || \
  7879. ((INSTANCE) == USART6))
  7880. /*********************** UART Instances : IRDA mode ***************************/
  7881. #define IS_IRDA_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  7882. ((INSTANCE) == USART2) || \
  7883. ((INSTANCE) == USART3) || \
  7884. ((INSTANCE) == UART4) || \
  7885. ((INSTANCE) == UART5) || \
  7886. ((INSTANCE) == USART6) || \
  7887. ((INSTANCE) == UART7) || \
  7888. ((INSTANCE) == UART8))
  7889. /*********************** PCD Instances ****************************************/
  7890. #define IS_PCD_ALL_INSTANCE(INSTANCE) (((INSTANCE) == USB_OTG_FS) || \
  7891. ((INSTANCE) == USB_OTG_HS))
  7892. /*********************** HCD Instances ****************************************/
  7893. #define IS_HCD_ALL_INSTANCE(INSTANCE) (((INSTANCE) == USB_OTG_FS) || \
  7894. ((INSTANCE) == USB_OTG_HS))
  7895. /****************************** IWDG Instances ********************************/
  7896. #define IS_IWDG_ALL_INSTANCE(INSTANCE) ((INSTANCE) == IWDG)
  7897. /****************************** WWDG Instances ********************************/
  7898. #define IS_WWDG_ALL_INSTANCE(INSTANCE) ((INSTANCE) == WWDG)
  7899. /****************************** SDIO Instances ********************************/
  7900. #define IS_SDIO_ALL_INSTANCE(INSTANCE) ((INSTANCE) == SDIO)
  7901. /****************************** USB Exported Constants ************************/
  7902. #define USB_OTG_FS_HOST_MAX_CHANNEL_NBR 8
  7903. #define USB_OTG_FS_MAX_IN_ENDPOINTS 4 /* Including EP0 */
  7904. #define USB_OTG_FS_MAX_OUT_ENDPOINTS 4 /* Including EP0 */
  7905. #define USB_OTG_FS_TOTAL_FIFO_SIZE 1280 /* in Bytes */
  7906. #define USB_OTG_HS_HOST_MAX_CHANNEL_NBR 12
  7907. #define USB_OTG_HS_MAX_IN_ENDPOINTS 6 /* Including EP0 */
  7908. #define USB_OTG_HS_MAX_IN_ENDPOINTS 6 /* Including EP0 */
  7909. #define USB_OTG_HS_TOTAL_FIFO_SIZE 4096 /* in Bytes */
  7910. /******************************************************************************/
  7911. /* For a painless codes migration between the STM32F4xx device product */
  7912. /* lines, the aliases defined below are put in place to overcome the */
  7913. /* differences in the interrupt handlers and IRQn definitions. */
  7914. /* No need to update developed interrupt code when moving across */
  7915. /* product lines within the same STM32F4 Family */
  7916. /******************************************************************************/
  7917. /* Aliases for __IRQn */
  7918. #define FSMC_IRQn FMC_IRQn
  7919. /* Aliases for __IRQHandler */
  7920. #define FSMC_IRQHandler FMC_IRQHandler
  7921. /**
  7922. * @}
  7923. */
  7924. /**
  7925. * @}
  7926. */
  7927. /**
  7928. * @}
  7929. */
  7930. #ifdef __cplusplus
  7931. }
  7932. #endif /* __cplusplus */
  7933. #endif /* __STM32F437xx_H */
  7934. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/