stm32f446xx.h 622 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225
  1. /**
  2. ******************************************************************************
  3. * @file stm32f446xx.h
  4. * @author MCD Application Team
  5. * @version V2.4.2
  6. * @date 13-November-2015
  7. * @brief CMSIS STM32F446xx 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 stm32f446xx
  47. * @{
  48. */
  49. #ifndef __STM32F446xx_H
  50. #define __STM32F446xx_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 global 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. CAN2_TX_IRQn = 63, /*!< CAN2 TX Interrupt */
  149. CAN2_RX0_IRQn = 64, /*!< CAN2 RX0 Interrupt */
  150. CAN2_RX1_IRQn = 65, /*!< CAN2 RX1 Interrupt */
  151. CAN2_SCE_IRQn = 66, /*!< CAN2 SCE Interrupt */
  152. OTG_FS_IRQn = 67, /*!< USB OTG FS global Interrupt */
  153. DMA2_Stream5_IRQn = 68, /*!< DMA2 Stream 5 global interrupt */
  154. DMA2_Stream6_IRQn = 69, /*!< DMA2 Stream 6 global interrupt */
  155. DMA2_Stream7_IRQn = 70, /*!< DMA2 Stream 7 global interrupt */
  156. USART6_IRQn = 71, /*!< USART6 global interrupt */
  157. I2C3_EV_IRQn = 72, /*!< I2C3 event interrupt */
  158. I2C3_ER_IRQn = 73, /*!< I2C3 error interrupt */
  159. OTG_HS_EP1_OUT_IRQn = 74, /*!< USB OTG HS End Point 1 Out global interrupt */
  160. OTG_HS_EP1_IN_IRQn = 75, /*!< USB OTG HS End Point 1 In global interrupt */
  161. OTG_HS_WKUP_IRQn = 76, /*!< USB OTG HS Wakeup through EXTI interrupt */
  162. OTG_HS_IRQn = 77, /*!< USB OTG HS global interrupt */
  163. DCMI_IRQn = 78, /*!< DCMI global interrupt */
  164. FPU_IRQn = 81, /*!< FPU global interrupt */
  165. SPI4_IRQn = 84, /*!< SPI4 global Interrupt */
  166. SAI1_IRQn = 87, /*!< SAI1 global Interrupt */
  167. SAI2_IRQn = 91, /*!< SAI2 global Interrupt */
  168. QUADSPI_IRQn = 92, /*!< QuadSPI global Interrupt */
  169. CEC_IRQn = 93, /*!< CEC global Interrupt */
  170. SPDIF_RX_IRQn = 94, /*!< SPDIF-RX global Interrupt */
  171. FMPI2C1_EV_IRQn = 95, /*!< FMPI2C1 Event Interrupt */
  172. FMPI2C1_ER_IRQn = 96 /*!< FMPI2C1 Error Interrupt */
  173. } IRQn_Type;
  174. /**
  175. * @}
  176. */
  177. #include "core_cm4.h" /* Cortex-M4 processor and core peripherals */
  178. #include "system_stm32f4xx.h"
  179. #include <stdint.h>
  180. /** @addtogroup Peripheral_registers_structures
  181. * @{
  182. */
  183. /**
  184. * @brief Analog to Digital Converter
  185. */
  186. typedef struct
  187. {
  188. __IO uint32_t SR; /*!< ADC status register, Address offset: 0x00 */
  189. __IO uint32_t CR1; /*!< ADC control register 1, Address offset: 0x04 */
  190. __IO uint32_t CR2; /*!< ADC control register 2, Address offset: 0x08 */
  191. __IO uint32_t SMPR1; /*!< ADC sample time register 1, Address offset: 0x0C */
  192. __IO uint32_t SMPR2; /*!< ADC sample time register 2, Address offset: 0x10 */
  193. __IO uint32_t JOFR1; /*!< ADC injected channel data offset register 1, Address offset: 0x14 */
  194. __IO uint32_t JOFR2; /*!< ADC injected channel data offset register 2, Address offset: 0x18 */
  195. __IO uint32_t JOFR3; /*!< ADC injected channel data offset register 3, Address offset: 0x1C */
  196. __IO uint32_t JOFR4; /*!< ADC injected channel data offset register 4, Address offset: 0x20 */
  197. __IO uint32_t HTR; /*!< ADC watchdog higher threshold register, Address offset: 0x24 */
  198. __IO uint32_t LTR; /*!< ADC watchdog lower threshold register, Address offset: 0x28 */
  199. __IO uint32_t SQR1; /*!< ADC regular sequence register 1, Address offset: 0x2C */
  200. __IO uint32_t SQR2; /*!< ADC regular sequence register 2, Address offset: 0x30 */
  201. __IO uint32_t SQR3; /*!< ADC regular sequence register 3, Address offset: 0x34 */
  202. __IO uint32_t JSQR; /*!< ADC injected sequence register, Address offset: 0x38*/
  203. __IO uint32_t JDR1; /*!< ADC injected data register 1, Address offset: 0x3C */
  204. __IO uint32_t JDR2; /*!< ADC injected data register 2, Address offset: 0x40 */
  205. __IO uint32_t JDR3; /*!< ADC injected data register 3, Address offset: 0x44 */
  206. __IO uint32_t JDR4; /*!< ADC injected data register 4, Address offset: 0x48 */
  207. __IO uint32_t DR; /*!< ADC regular data register, Address offset: 0x4C */
  208. } ADC_TypeDef;
  209. typedef struct
  210. {
  211. __IO uint32_t CSR; /*!< ADC Common status register, Address offset: ADC1 base address + 0x300 */
  212. __IO uint32_t CCR; /*!< ADC common control register, Address offset: ADC1 base address + 0x304 */
  213. __IO uint32_t CDR; /*!< ADC common regular data register for dual
  214. AND triple modes, Address offset: ADC1 base address + 0x308 */
  215. } ADC_Common_TypeDef;
  216. /**
  217. * @brief Controller Area Network TxMailBox
  218. */
  219. typedef struct
  220. {
  221. __IO uint32_t TIR; /*!< CAN TX mailbox identifier register */
  222. __IO uint32_t TDTR; /*!< CAN mailbox data length control and time stamp register */
  223. __IO uint32_t TDLR; /*!< CAN mailbox data low register */
  224. __IO uint32_t TDHR; /*!< CAN mailbox data high register */
  225. } CAN_TxMailBox_TypeDef;
  226. /**
  227. * @brief Controller Area Network FIFOMailBox
  228. */
  229. typedef struct
  230. {
  231. __IO uint32_t RIR; /*!< CAN receive FIFO mailbox identifier register */
  232. __IO uint32_t RDTR; /*!< CAN receive FIFO mailbox data length control and time stamp register */
  233. __IO uint32_t RDLR; /*!< CAN receive FIFO mailbox data low register */
  234. __IO uint32_t RDHR; /*!< CAN receive FIFO mailbox data high register */
  235. } CAN_FIFOMailBox_TypeDef;
  236. /**
  237. * @brief Controller Area Network FilterRegister
  238. */
  239. typedef struct
  240. {
  241. __IO uint32_t FR1; /*!< CAN Filter bank register 1 */
  242. __IO uint32_t FR2; /*!< CAN Filter bank register 1 */
  243. } CAN_FilterRegister_TypeDef;
  244. /**
  245. * @brief Controller Area Network
  246. */
  247. typedef struct
  248. {
  249. __IO uint32_t MCR; /*!< CAN master control register, Address offset: 0x00 */
  250. __IO uint32_t MSR; /*!< CAN master status register, Address offset: 0x04 */
  251. __IO uint32_t TSR; /*!< CAN transmit status register, Address offset: 0x08 */
  252. __IO uint32_t RF0R; /*!< CAN receive FIFO 0 register, Address offset: 0x0C */
  253. __IO uint32_t RF1R; /*!< CAN receive FIFO 1 register, Address offset: 0x10 */
  254. __IO uint32_t IER; /*!< CAN interrupt enable register, Address offset: 0x14 */
  255. __IO uint32_t ESR; /*!< CAN error status register, Address offset: 0x18 */
  256. __IO uint32_t BTR; /*!< CAN bit timing register, Address offset: 0x1C */
  257. uint32_t RESERVED0[88]; /*!< Reserved, 0x020 - 0x17F */
  258. CAN_TxMailBox_TypeDef sTxMailBox[3]; /*!< CAN Tx MailBox, Address offset: 0x180 - 0x1AC */
  259. CAN_FIFOMailBox_TypeDef sFIFOMailBox[2]; /*!< CAN FIFO MailBox, Address offset: 0x1B0 - 0x1CC */
  260. uint32_t RESERVED1[12]; /*!< Reserved, 0x1D0 - 0x1FF */
  261. __IO uint32_t FMR; /*!< CAN filter master register, Address offset: 0x200 */
  262. __IO uint32_t FM1R; /*!< CAN filter mode register, Address offset: 0x204 */
  263. uint32_t RESERVED2; /*!< Reserved, 0x208 */
  264. __IO uint32_t FS1R; /*!< CAN filter scale register, Address offset: 0x20C */
  265. uint32_t RESERVED3; /*!< Reserved, 0x210 */
  266. __IO uint32_t FFA1R; /*!< CAN filter FIFO assignment register, Address offset: 0x214 */
  267. uint32_t RESERVED4; /*!< Reserved, 0x218 */
  268. __IO uint32_t FA1R; /*!< CAN filter activation register, Address offset: 0x21C */
  269. uint32_t RESERVED5[8]; /*!< Reserved, 0x220-0x23F */
  270. CAN_FilterRegister_TypeDef sFilterRegister[28]; /*!< CAN Filter Register, Address offset: 0x240-0x31C */
  271. } CAN_TypeDef;
  272. /**
  273. * @brief Consumer Electronics Control
  274. */
  275. typedef struct
  276. {
  277. __IO uint32_t CR; /*!< CEC control register, Address offset:0x00 */
  278. __IO uint32_t CFGR; /*!< CEC configuration register, Address offset:0x04 */
  279. __IO uint32_t TXDR; /*!< CEC Tx data register , Address offset:0x08 */
  280. __IO uint32_t RXDR; /*!< CEC Rx Data Register, Address offset:0x0C */
  281. __IO uint32_t ISR; /*!< CEC Interrupt and Status Register, Address offset:0x10 */
  282. __IO uint32_t IER; /*!< CEC interrupt enable register, Address offset:0x14 */
  283. }CEC_TypeDef;
  284. /**
  285. * @brief CRC calculation unit
  286. */
  287. typedef struct
  288. {
  289. __IO uint32_t DR; /*!< CRC Data register, Address offset: 0x00 */
  290. __IO uint8_t IDR; /*!< CRC Independent data register, Address offset: 0x04 */
  291. uint8_t RESERVED0; /*!< Reserved, 0x05 */
  292. uint16_t RESERVED1; /*!< Reserved, 0x06 */
  293. __IO uint32_t CR; /*!< CRC Control register, Address offset: 0x08 */
  294. } CRC_TypeDef;
  295. /**
  296. * @brief Digital to Analog Converter
  297. */
  298. typedef struct
  299. {
  300. __IO uint32_t CR; /*!< DAC control register, Address offset: 0x00 */
  301. __IO uint32_t SWTRIGR; /*!< DAC software trigger register, Address offset: 0x04 */
  302. __IO uint32_t DHR12R1; /*!< DAC channel1 12-bit right-aligned data holding register, Address offset: 0x08 */
  303. __IO uint32_t DHR12L1; /*!< DAC channel1 12-bit left aligned data holding register, Address offset: 0x0C */
  304. __IO uint32_t DHR8R1; /*!< DAC channel1 8-bit right aligned data holding register, Address offset: 0x10 */
  305. __IO uint32_t DHR12R2; /*!< DAC channel2 12-bit right aligned data holding register, Address offset: 0x14 */
  306. __IO uint32_t DHR12L2; /*!< DAC channel2 12-bit left aligned data holding register, Address offset: 0x18 */
  307. __IO uint32_t DHR8R2; /*!< DAC channel2 8-bit right-aligned data holding register, Address offset: 0x1C */
  308. __IO uint32_t DHR12RD; /*!< Dual DAC 12-bit right-aligned data holding register, Address offset: 0x20 */
  309. __IO uint32_t DHR12LD; /*!< DUAL DAC 12-bit left aligned data holding register, Address offset: 0x24 */
  310. __IO uint32_t DHR8RD; /*!< DUAL DAC 8-bit right aligned data holding register, Address offset: 0x28 */
  311. __IO uint32_t DOR1; /*!< DAC channel1 data output register, Address offset: 0x2C */
  312. __IO uint32_t DOR2; /*!< DAC channel2 data output register, Address offset: 0x30 */
  313. __IO uint32_t SR; /*!< DAC status register, Address offset: 0x34 */
  314. } DAC_TypeDef;
  315. /**
  316. * @brief Debug MCU
  317. */
  318. typedef struct
  319. {
  320. __IO uint32_t IDCODE; /*!< MCU device ID code, Address offset: 0x00 */
  321. __IO uint32_t CR; /*!< Debug MCU configuration register, Address offset: 0x04 */
  322. __IO uint32_t APB1FZ; /*!< Debug MCU APB1 freeze register, Address offset: 0x08 */
  323. __IO uint32_t APB2FZ; /*!< Debug MCU APB2 freeze register, Address offset: 0x0C */
  324. }DBGMCU_TypeDef;
  325. /**
  326. * @brief DCMI
  327. */
  328. typedef struct
  329. {
  330. __IO uint32_t CR; /*!< DCMI control register 1, Address offset: 0x00 */
  331. __IO uint32_t SR; /*!< DCMI status register, Address offset: 0x04 */
  332. __IO uint32_t RISR; /*!< DCMI raw interrupt status register, Address offset: 0x08 */
  333. __IO uint32_t IER; /*!< DCMI interrupt enable register, Address offset: 0x0C */
  334. __IO uint32_t MISR; /*!< DCMI masked interrupt status register, Address offset: 0x10 */
  335. __IO uint32_t ICR; /*!< DCMI interrupt clear register, Address offset: 0x14 */
  336. __IO uint32_t ESCR; /*!< DCMI embedded synchronization code register, Address offset: 0x18 */
  337. __IO uint32_t ESUR; /*!< DCMI embedded synchronization unmask register, Address offset: 0x1C */
  338. __IO uint32_t CWSTRTR; /*!< DCMI crop window start, Address offset: 0x20 */
  339. __IO uint32_t CWSIZER; /*!< DCMI crop window size, Address offset: 0x24 */
  340. __IO uint32_t DR; /*!< DCMI data register, Address offset: 0x28 */
  341. } DCMI_TypeDef;
  342. /**
  343. * @brief DMA Controller
  344. */
  345. typedef struct
  346. {
  347. __IO uint32_t CR; /*!< DMA stream x configuration register */
  348. __IO uint32_t NDTR; /*!< DMA stream x number of data register */
  349. __IO uint32_t PAR; /*!< DMA stream x peripheral address register */
  350. __IO uint32_t M0AR; /*!< DMA stream x memory 0 address register */
  351. __IO uint32_t M1AR; /*!< DMA stream x memory 1 address register */
  352. __IO uint32_t FCR; /*!< DMA stream x FIFO control register */
  353. } DMA_Stream_TypeDef;
  354. typedef struct
  355. {
  356. __IO uint32_t LISR; /*!< DMA low interrupt status register, Address offset: 0x00 */
  357. __IO uint32_t HISR; /*!< DMA high interrupt status register, Address offset: 0x04 */
  358. __IO uint32_t LIFCR; /*!< DMA low interrupt flag clear register, Address offset: 0x08 */
  359. __IO uint32_t HIFCR; /*!< DMA high interrupt flag clear register, Address offset: 0x0C */
  360. } DMA_TypeDef;
  361. /**
  362. * @brief External Interrupt/Event Controller
  363. */
  364. typedef struct
  365. {
  366. __IO uint32_t IMR; /*!< EXTI Interrupt mask register, Address offset: 0x00 */
  367. __IO uint32_t EMR; /*!< EXTI Event mask register, Address offset: 0x04 */
  368. __IO uint32_t RTSR; /*!< EXTI Rising trigger selection register, Address offset: 0x08 */
  369. __IO uint32_t FTSR; /*!< EXTI Falling trigger selection register, Address offset: 0x0C */
  370. __IO uint32_t SWIER; /*!< EXTI Software interrupt event register, Address offset: 0x10 */
  371. __IO uint32_t PR; /*!< EXTI Pending register, Address offset: 0x14 */
  372. } EXTI_TypeDef;
  373. /**
  374. * @brief FLASH Registers
  375. */
  376. typedef struct
  377. {
  378. __IO uint32_t ACR; /*!< FLASH access control register, Address offset: 0x00 */
  379. __IO uint32_t KEYR; /*!< FLASH key register, Address offset: 0x04 */
  380. __IO uint32_t OPTKEYR; /*!< FLASH option key register, Address offset: 0x08 */
  381. __IO uint32_t SR; /*!< FLASH status register, Address offset: 0x0C */
  382. __IO uint32_t CR; /*!< FLASH control register, Address offset: 0x10 */
  383. __IO uint32_t OPTCR; /*!< FLASH option control register , Address offset: 0x14 */
  384. __IO uint32_t OPTCR1; /*!< FLASH option control register 1, Address offset: 0x18 */
  385. } FLASH_TypeDef;
  386. /**
  387. * @brief Flexible Memory Controller
  388. */
  389. typedef struct
  390. {
  391. __IO uint32_t BTCR[8]; /*!< NOR/PSRAM chip-select control register(BCR) and chip-select timing register(BTR), Address offset: 0x00-1C */
  392. } FMC_Bank1_TypeDef;
  393. /**
  394. * @brief Flexible Memory Controller Bank1E
  395. */
  396. typedef struct
  397. {
  398. __IO uint32_t BWTR[7]; /*!< NOR/PSRAM write timing registers, Address offset: 0x104-0x11C */
  399. } FMC_Bank1E_TypeDef;
  400. /**
  401. * @brief Flexible Memory Controller Bank3
  402. */
  403. typedef struct
  404. {
  405. __IO uint32_t PCR; /*!< NAND Flash control register, Address offset: 0x80 */
  406. __IO uint32_t SR; /*!< NAND Flash FIFO status and interrupt register, Address offset: 0x84 */
  407. __IO uint32_t PMEM; /*!< NAND Flash Common memory space timing register, Address offset: 0x88 */
  408. __IO uint32_t PATT; /*!< NAND Flash Attribute memory space timing register, Address offset: 0x8C */
  409. uint32_t RESERVED; /*!< Reserved, 0x90 */
  410. __IO uint32_t ECCR; /*!< NAND Flash ECC result registers, Address offset: 0x94 */
  411. } FMC_Bank3_TypeDef;
  412. /**
  413. * @brief Flexible Memory Controller Bank5_6
  414. */
  415. typedef struct
  416. {
  417. __IO uint32_t SDCR[2]; /*!< SDRAM Control registers , Address offset: 0x140-0x144 */
  418. __IO uint32_t SDTR[2]; /*!< SDRAM Timing registers , Address offset: 0x148-0x14C */
  419. __IO uint32_t SDCMR; /*!< SDRAM Command Mode register, Address offset: 0x150 */
  420. __IO uint32_t SDRTR; /*!< SDRAM Refresh Timer register, Address offset: 0x154 */
  421. __IO uint32_t SDSR; /*!< SDRAM Status register, Address offset: 0x158 */
  422. } FMC_Bank5_6_TypeDef;
  423. /**
  424. * @brief General Purpose I/O
  425. */
  426. typedef struct
  427. {
  428. __IO uint32_t MODER; /*!< GPIO port mode register, Address offset: 0x00 */
  429. __IO uint32_t OTYPER; /*!< GPIO port output type register, Address offset: 0x04 */
  430. __IO uint32_t OSPEEDR; /*!< GPIO port output speed register, Address offset: 0x08 */
  431. __IO uint32_t PUPDR; /*!< GPIO port pull-up/pull-down register, Address offset: 0x0C */
  432. __IO uint32_t IDR; /*!< GPIO port input data register, Address offset: 0x10 */
  433. __IO uint32_t ODR; /*!< GPIO port output data register, Address offset: 0x14 */
  434. __IO uint32_t BSRR; /*!< GPIO port bit set/reset register, Address offset: 0x18 */
  435. __IO uint32_t LCKR; /*!< GPIO port configuration lock register, Address offset: 0x1C */
  436. __IO uint32_t AFR[2]; /*!< GPIO alternate function registers, Address offset: 0x20-0x24 */
  437. } GPIO_TypeDef;
  438. /**
  439. * @brief System configuration controller
  440. */
  441. typedef struct
  442. {
  443. __IO uint32_t MEMRMP; /*!< SYSCFG memory remap register, Address offset: 0x00 */
  444. __IO uint32_t PMC; /*!< SYSCFG peripheral mode configuration register, Address offset: 0x04 */
  445. __IO uint32_t EXTICR[4]; /*!< SYSCFG external interrupt configuration registers, Address offset: 0x08-0x14 */
  446. uint32_t RESERVED[2]; /*!< Reserved, 0x18-0x1C */
  447. __IO uint32_t CMPCR; /*!< SYSCFG Compensation cell control register, Address offset: 0x20 */
  448. uint32_t RESERVED1[2]; /*!< Reserved, 0x24-0x28 */
  449. __IO uint32_t CFGR; /*!< SYSCFG Configuration register, Address offset: 0x2C */
  450. } SYSCFG_TypeDef;
  451. /**
  452. * @brief Inter-integrated Circuit Interface
  453. */
  454. typedef struct
  455. {
  456. __IO uint32_t CR1; /*!< I2C Control register 1, Address offset: 0x00 */
  457. __IO uint32_t CR2; /*!< I2C Control register 2, Address offset: 0x04 */
  458. __IO uint32_t OAR1; /*!< I2C Own address register 1, Address offset: 0x08 */
  459. __IO uint32_t OAR2; /*!< I2C Own address register 2, Address offset: 0x0C */
  460. __IO uint32_t DR; /*!< I2C Data register, Address offset: 0x10 */
  461. __IO uint32_t SR1; /*!< I2C Status register 1, Address offset: 0x14 */
  462. __IO uint32_t SR2; /*!< I2C Status register 2, Address offset: 0x18 */
  463. __IO uint32_t CCR; /*!< I2C Clock control register, Address offset: 0x1C */
  464. __IO uint32_t TRISE; /*!< I2C TRISE register, Address offset: 0x20 */
  465. __IO uint32_t FLTR; /*!< I2C FLTR register, Address offset: 0x24 */
  466. } I2C_TypeDef;
  467. /**
  468. * @brief Inter-integrated Circuit Interface
  469. */
  470. typedef struct
  471. {
  472. __IO uint32_t CR1; /*!< FMPI2C Control register 1, Address offset: 0x00 */
  473. __IO uint32_t CR2; /*!< FMPI2C Control register 2, Address offset: 0x04 */
  474. __IO uint32_t OAR1; /*!< FMPI2C Own address 1 register, Address offset: 0x08 */
  475. __IO uint32_t OAR2; /*!< FMPI2C Own address 2 register, Address offset: 0x0C */
  476. __IO uint32_t TIMINGR; /*!< FMPI2C Timing register, Address offset: 0x10 */
  477. __IO uint32_t TIMEOUTR; /*!< FMPI2C Timeout register, Address offset: 0x14 */
  478. __IO uint32_t ISR; /*!< FMPI2C Interrupt and status register, Address offset: 0x18 */
  479. __IO uint32_t ICR; /*!< FMPI2C Interrupt clear register, Address offset: 0x1C */
  480. __IO uint32_t PECR; /*!< FMPI2C PEC register, Address offset: 0x20 */
  481. __IO uint32_t RXDR; /*!< FMPI2C Receive data register, Address offset: 0x24 */
  482. __IO uint32_t TXDR; /*!< FMPI2C Transmit data register, Address offset: 0x28 */
  483. } FMPI2C_TypeDef;
  484. /**
  485. * @brief Independent WATCHDOG
  486. */
  487. typedef struct
  488. {
  489. __IO uint32_t KR; /*!< IWDG Key register, Address offset: 0x00 */
  490. __IO uint32_t PR; /*!< IWDG Prescaler register, Address offset: 0x04 */
  491. __IO uint32_t RLR; /*!< IWDG Reload register, Address offset: 0x08 */
  492. __IO uint32_t SR; /*!< IWDG Status register, Address offset: 0x0C */
  493. } IWDG_TypeDef;
  494. /**
  495. * @brief Power Control
  496. */
  497. typedef struct
  498. {
  499. __IO uint32_t CR; /*!< PWR power control register, Address offset: 0x00 */
  500. __IO uint32_t CSR; /*!< PWR power control/status register, Address offset: 0x04 */
  501. } PWR_TypeDef;
  502. /**
  503. * @brief Reset and Clock Control
  504. */
  505. typedef struct
  506. {
  507. __IO uint32_t CR; /*!< RCC clock control register, Address offset: 0x00 */
  508. __IO uint32_t PLLCFGR; /*!< RCC PLL configuration register, Address offset: 0x04 */
  509. __IO uint32_t CFGR; /*!< RCC clock configuration register, Address offset: 0x08 */
  510. __IO uint32_t CIR; /*!< RCC clock interrupt register, Address offset: 0x0C */
  511. __IO uint32_t AHB1RSTR; /*!< RCC AHB1 peripheral reset register, Address offset: 0x10 */
  512. __IO uint32_t AHB2RSTR; /*!< RCC AHB2 peripheral reset register, Address offset: 0x14 */
  513. __IO uint32_t AHB3RSTR; /*!< RCC AHB3 peripheral reset register, Address offset: 0x18 */
  514. uint32_t RESERVED0; /*!< Reserved, 0x1C */
  515. __IO uint32_t APB1RSTR; /*!< RCC APB1 peripheral reset register, Address offset: 0x20 */
  516. __IO uint32_t APB2RSTR; /*!< RCC APB2 peripheral reset register, Address offset: 0x24 */
  517. uint32_t RESERVED1[2]; /*!< Reserved, 0x28-0x2C */
  518. __IO uint32_t AHB1ENR; /*!< RCC AHB1 peripheral clock register, Address offset: 0x30 */
  519. __IO uint32_t AHB2ENR; /*!< RCC AHB2 peripheral clock register, Address offset: 0x34 */
  520. __IO uint32_t AHB3ENR; /*!< RCC AHB3 peripheral clock register, Address offset: 0x38 */
  521. uint32_t RESERVED2; /*!< Reserved, 0x3C */
  522. __IO uint32_t APB1ENR; /*!< RCC APB1 peripheral clock enable register, Address offset: 0x40 */
  523. __IO uint32_t APB2ENR; /*!< RCC APB2 peripheral clock enable register, Address offset: 0x44 */
  524. uint32_t RESERVED3[2]; /*!< Reserved, 0x48-0x4C */
  525. __IO uint32_t AHB1LPENR; /*!< RCC AHB1 peripheral clock enable in low power mode register, Address offset: 0x50 */
  526. __IO uint32_t AHB2LPENR; /*!< RCC AHB2 peripheral clock enable in low power mode register, Address offset: 0x54 */
  527. __IO uint32_t AHB3LPENR; /*!< RCC AHB3 peripheral clock enable in low power mode register, Address offset: 0x58 */
  528. uint32_t RESERVED4; /*!< Reserved, 0x5C */
  529. __IO uint32_t APB1LPENR; /*!< RCC APB1 peripheral clock enable in low power mode register, Address offset: 0x60 */
  530. __IO uint32_t APB2LPENR; /*!< RCC APB2 peripheral clock enable in low power mode register, Address offset: 0x64 */
  531. uint32_t RESERVED5[2]; /*!< Reserved, 0x68-0x6C */
  532. __IO uint32_t BDCR; /*!< RCC Backup domain control register, Address offset: 0x70 */
  533. __IO uint32_t CSR; /*!< RCC clock control & status register, Address offset: 0x74 */
  534. uint32_t RESERVED6[2]; /*!< Reserved, 0x78-0x7C */
  535. __IO uint32_t SSCGR; /*!< RCC spread spectrum clock generation register, Address offset: 0x80 */
  536. __IO uint32_t PLLI2SCFGR; /*!< RCC PLLI2S configuration register, Address offset: 0x84 */
  537. __IO uint32_t PLLSAICFGR; /*!< RCC PLLSAI configuration register, Address offset: 0x88 */
  538. __IO uint32_t DCKCFGR; /*!< RCC Dedicated Clocks configuration register, Address offset: 0x8C */
  539. __IO uint32_t CKGATENR; /*!< RCC Clocks Gated ENable Register, Address offset: 0x90 */
  540. __IO uint32_t DCKCFGR2; /*!< RCC Dedicated Clocks configuration register 2, Address offset: 0x94 */
  541. } RCC_TypeDef;
  542. /**
  543. * @brief Real-Time Clock
  544. */
  545. typedef struct
  546. {
  547. __IO uint32_t TR; /*!< RTC time register, Address offset: 0x00 */
  548. __IO uint32_t DR; /*!< RTC date register, Address offset: 0x04 */
  549. __IO uint32_t CR; /*!< RTC control register, Address offset: 0x08 */
  550. __IO uint32_t ISR; /*!< RTC initialization and status register, Address offset: 0x0C */
  551. __IO uint32_t PRER; /*!< RTC prescaler register, Address offset: 0x10 */
  552. __IO uint32_t WUTR; /*!< RTC wakeup timer register, Address offset: 0x14 */
  553. __IO uint32_t CALIBR; /*!< RTC calibration register, Address offset: 0x18 */
  554. __IO uint32_t ALRMAR; /*!< RTC alarm A register, Address offset: 0x1C */
  555. __IO uint32_t ALRMBR; /*!< RTC alarm B register, Address offset: 0x20 */
  556. __IO uint32_t WPR; /*!< RTC write protection register, Address offset: 0x24 */
  557. __IO uint32_t SSR; /*!< RTC sub second register, Address offset: 0x28 */
  558. __IO uint32_t SHIFTR; /*!< RTC shift control register, Address offset: 0x2C */
  559. __IO uint32_t TSTR; /*!< RTC time stamp time register, Address offset: 0x30 */
  560. __IO uint32_t TSDR; /*!< RTC time stamp date register, Address offset: 0x34 */
  561. __IO uint32_t TSSSR; /*!< RTC time-stamp sub second register, Address offset: 0x38 */
  562. __IO uint32_t CALR; /*!< RTC calibration register, Address offset: 0x3C */
  563. __IO uint32_t TAFCR; /*!< RTC tamper and alternate function configuration register, Address offset: 0x40 */
  564. __IO uint32_t ALRMASSR;/*!< RTC alarm A sub second register, Address offset: 0x44 */
  565. __IO uint32_t ALRMBSSR;/*!< RTC alarm B sub second register, Address offset: 0x48 */
  566. uint32_t RESERVED7; /*!< Reserved, 0x4C */
  567. __IO uint32_t BKP0R; /*!< RTC backup register 1, Address offset: 0x50 */
  568. __IO uint32_t BKP1R; /*!< RTC backup register 1, Address offset: 0x54 */
  569. __IO uint32_t BKP2R; /*!< RTC backup register 2, Address offset: 0x58 */
  570. __IO uint32_t BKP3R; /*!< RTC backup register 3, Address offset: 0x5C */
  571. __IO uint32_t BKP4R; /*!< RTC backup register 4, Address offset: 0x60 */
  572. __IO uint32_t BKP5R; /*!< RTC backup register 5, Address offset: 0x64 */
  573. __IO uint32_t BKP6R; /*!< RTC backup register 6, Address offset: 0x68 */
  574. __IO uint32_t BKP7R; /*!< RTC backup register 7, Address offset: 0x6C */
  575. __IO uint32_t BKP8R; /*!< RTC backup register 8, Address offset: 0x70 */
  576. __IO uint32_t BKP9R; /*!< RTC backup register 9, Address offset: 0x74 */
  577. __IO uint32_t BKP10R; /*!< RTC backup register 10, Address offset: 0x78 */
  578. __IO uint32_t BKP11R; /*!< RTC backup register 11, Address offset: 0x7C */
  579. __IO uint32_t BKP12R; /*!< RTC backup register 12, Address offset: 0x80 */
  580. __IO uint32_t BKP13R; /*!< RTC backup register 13, Address offset: 0x84 */
  581. __IO uint32_t BKP14R; /*!< RTC backup register 14, Address offset: 0x88 */
  582. __IO uint32_t BKP15R; /*!< RTC backup register 15, Address offset: 0x8C */
  583. __IO uint32_t BKP16R; /*!< RTC backup register 16, Address offset: 0x90 */
  584. __IO uint32_t BKP17R; /*!< RTC backup register 17, Address offset: 0x94 */
  585. __IO uint32_t BKP18R; /*!< RTC backup register 18, Address offset: 0x98 */
  586. __IO uint32_t BKP19R; /*!< RTC backup register 19, Address offset: 0x9C */
  587. } RTC_TypeDef;
  588. /**
  589. * @brief Serial Audio Interface
  590. */
  591. typedef struct
  592. {
  593. __IO uint32_t GCR; /*!< SAI global configuration register, Address offset: 0x00 */
  594. } SAI_TypeDef;
  595. typedef struct
  596. {
  597. __IO uint32_t CR1; /*!< SAI block x configuration register 1, Address offset: 0x04 */
  598. __IO uint32_t CR2; /*!< SAI block x configuration register 2, Address offset: 0x08 */
  599. __IO uint32_t FRCR; /*!< SAI block x frame configuration register, Address offset: 0x0C */
  600. __IO uint32_t SLOTR; /*!< SAI block x slot register, Address offset: 0x10 */
  601. __IO uint32_t IMR; /*!< SAI block x interrupt mask register, Address offset: 0x14 */
  602. __IO uint32_t SR; /*!< SAI block x status register, Address offset: 0x18 */
  603. __IO uint32_t CLRFR; /*!< SAI block x clear flag register, Address offset: 0x1C */
  604. __IO uint32_t DR; /*!< SAI block x data register, Address offset: 0x20 */
  605. } SAI_Block_TypeDef;
  606. /**
  607. * @brief SD host Interface
  608. */
  609. typedef struct
  610. {
  611. __IO uint32_t POWER; /*!< SDIO power control register, Address offset: 0x00 */
  612. __IO uint32_t CLKCR; /*!< SDI clock control register, Address offset: 0x04 */
  613. __IO uint32_t ARG; /*!< SDIO argument register, Address offset: 0x08 */
  614. __IO uint32_t CMD; /*!< SDIO command register, Address offset: 0x0C */
  615. __I uint32_t RESPCMD; /*!< SDIO command response register, Address offset: 0x10 */
  616. __I uint32_t RESP1; /*!< SDIO response 1 register, Address offset: 0x14 */
  617. __I uint32_t RESP2; /*!< SDIO response 2 register, Address offset: 0x18 */
  618. __I uint32_t RESP3; /*!< SDIO response 3 register, Address offset: 0x1C */
  619. __I uint32_t RESP4; /*!< SDIO response 4 register, Address offset: 0x20 */
  620. __IO uint32_t DTIMER; /*!< SDIO data timer register, Address offset: 0x24 */
  621. __IO uint32_t DLEN; /*!< SDIO data length register, Address offset: 0x28 */
  622. __IO uint32_t DCTRL; /*!< SDIO data control register, Address offset: 0x2C */
  623. __I uint32_t DCOUNT; /*!< SDIO data counter register, Address offset: 0x30 */
  624. __I uint32_t STA; /*!< SDIO status register, Address offset: 0x34 */
  625. __IO uint32_t ICR; /*!< SDIO interrupt clear register, Address offset: 0x38 */
  626. __IO uint32_t MASK; /*!< SDIO mask register, Address offset: 0x3C */
  627. uint32_t RESERVED0[2]; /*!< Reserved, 0x40-0x44 */
  628. __I uint32_t FIFOCNT; /*!< SDIO FIFO counter register, Address offset: 0x48 */
  629. uint32_t RESERVED1[13]; /*!< Reserved, 0x4C-0x7C */
  630. __IO uint32_t FIFO; /*!< SDIO data FIFO register, Address offset: 0x80 */
  631. } SDIO_TypeDef;
  632. /**
  633. * @brief Serial Peripheral Interface
  634. */
  635. typedef struct
  636. {
  637. __IO uint32_t CR1; /*!< SPI control register 1 (not used in I2S mode), Address offset: 0x00 */
  638. __IO uint32_t CR2; /*!< SPI control register 2, Address offset: 0x04 */
  639. __IO uint32_t SR; /*!< SPI status register, Address offset: 0x08 */
  640. __IO uint32_t DR; /*!< SPI data register, Address offset: 0x0C */
  641. __IO uint32_t CRCPR; /*!< SPI CRC polynomial register (not used in I2S mode), Address offset: 0x10 */
  642. __IO uint32_t RXCRCR; /*!< SPI RX CRC register (not used in I2S mode), Address offset: 0x14 */
  643. __IO uint32_t TXCRCR; /*!< SPI TX CRC register (not used in I2S mode), Address offset: 0x18 */
  644. __IO uint32_t I2SCFGR; /*!< SPI_I2S configuration register, Address offset: 0x1C */
  645. __IO uint32_t I2SPR; /*!< SPI_I2S prescaler register, Address offset: 0x20 */
  646. } SPI_TypeDef;
  647. /**
  648. * @brief QUAD Serial Peripheral Interface
  649. */
  650. typedef struct
  651. {
  652. __IO uint32_t CR; /*!< QUADSPI Control register, Address offset: 0x00 */
  653. __IO uint32_t DCR; /*!< QUADSPI Device Configuration register, Address offset: 0x04 */
  654. __IO uint32_t SR; /*!< QUADSPI Status register, Address offset: 0x08 */
  655. __IO uint32_t FCR; /*!< QUADSPI Flag Clear register, Address offset: 0x0C */
  656. __IO uint32_t DLR; /*!< QUADSPI Data Length register, Address offset: 0x10 */
  657. __IO uint32_t CCR; /*!< QUADSPI Communication Configuration register, Address offset: 0x14 */
  658. __IO uint32_t AR; /*!< QUADSPI Address register, Address offset: 0x18 */
  659. __IO uint32_t ABR; /*!< QUADSPI Alternate Bytes register, Address offset: 0x1C */
  660. __IO uint32_t DR; /*!< QUADSPI Data register, Address offset: 0x20 */
  661. __IO uint32_t PSMKR; /*!< QUADSPI Polling Status Mask register, Address offset: 0x24 */
  662. __IO uint32_t PSMAR; /*!< QUADSPI Polling Status Match register, Address offset: 0x28 */
  663. __IO uint32_t PIR; /*!< QUADSPI Polling Interval register, Address offset: 0x2C */
  664. __IO uint32_t LPTR; /*!< QUADSPI Low Power Timeout register, Address offset: 0x30 */
  665. } QUADSPI_TypeDef;
  666. /**
  667. * @brief SPDIFRX Interface
  668. */
  669. typedef struct
  670. {
  671. __IO uint32_t CR; /*!< Control register, Address offset: 0x00 */
  672. __IO uint16_t IMR; /*!< Interrupt mask register, Address offset: 0x04 */
  673. uint16_t RESERVED0; /*!< Reserved, 0x06 */
  674. __IO uint32_t SR; /*!< Status register, Address offset: 0x08 */
  675. __IO uint16_t IFCR; /*!< Interrupt Flag Clear register, Address offset: 0x0C */
  676. uint16_t RESERVED1; /*!< Reserved, 0x0E */
  677. __IO uint32_t DR; /*!< Data input register, Address offset: 0x10 */
  678. __IO uint32_t CSR; /*!< Channel Status register, Address offset: 0x14 */
  679. __IO uint32_t DIR; /*!< Debug Information register, Address offset: 0x18 */
  680. uint16_t RESERVED2; /*!< Reserved, 0x1A */
  681. } SPDIFRX_TypeDef;
  682. /**
  683. * @brief TIM
  684. */
  685. typedef struct
  686. {
  687. __IO uint32_t CR1; /*!< TIM control register 1, Address offset: 0x00 */
  688. __IO uint32_t CR2; /*!< TIM control register 2, Address offset: 0x04 */
  689. __IO uint32_t SMCR; /*!< TIM slave mode control register, Address offset: 0x08 */
  690. __IO uint32_t DIER; /*!< TIM DMA/interrupt enable register, Address offset: 0x0C */
  691. __IO uint32_t SR; /*!< TIM status register, Address offset: 0x10 */
  692. __IO uint32_t EGR; /*!< TIM event generation register, Address offset: 0x14 */
  693. __IO uint32_t CCMR1; /*!< TIM capture/compare mode register 1, Address offset: 0x18 */
  694. __IO uint32_t CCMR2; /*!< TIM capture/compare mode register 2, Address offset: 0x1C */
  695. __IO uint32_t CCER; /*!< TIM capture/compare enable register, Address offset: 0x20 */
  696. __IO uint32_t CNT; /*!< TIM counter register, Address offset: 0x24 */
  697. __IO uint32_t PSC; /*!< TIM prescaler, Address offset: 0x28 */
  698. __IO uint32_t ARR; /*!< TIM auto-reload register, Address offset: 0x2C */
  699. __IO uint32_t RCR; /*!< TIM repetition counter register, Address offset: 0x30 */
  700. __IO uint32_t CCR1; /*!< TIM capture/compare register 1, Address offset: 0x34 */
  701. __IO uint32_t CCR2; /*!< TIM capture/compare register 2, Address offset: 0x38 */
  702. __IO uint32_t CCR3; /*!< TIM capture/compare register 3, Address offset: 0x3C */
  703. __IO uint32_t CCR4; /*!< TIM capture/compare register 4, Address offset: 0x40 */
  704. __IO uint32_t BDTR; /*!< TIM break and dead-time register, Address offset: 0x44 */
  705. __IO uint32_t DCR; /*!< TIM DMA control register, Address offset: 0x48 */
  706. __IO uint32_t DMAR; /*!< TIM DMA address for full transfer, Address offset: 0x4C */
  707. __IO uint32_t OR; /*!< TIM option register, Address offset: 0x50 */
  708. } TIM_TypeDef;
  709. /**
  710. * @brief Universal Synchronous Asynchronous Receiver Transmitter
  711. */
  712. typedef struct
  713. {
  714. __IO uint32_t SR; /*!< USART Status register, Address offset: 0x00 */
  715. __IO uint32_t DR; /*!< USART Data register, Address offset: 0x04 */
  716. __IO uint32_t BRR; /*!< USART Baud rate register, Address offset: 0x08 */
  717. __IO uint32_t CR1; /*!< USART Control register 1, Address offset: 0x0C */
  718. __IO uint32_t CR2; /*!< USART Control register 2, Address offset: 0x10 */
  719. __IO uint32_t CR3; /*!< USART Control register 3, Address offset: 0x14 */
  720. __IO uint32_t GTPR; /*!< USART Guard time and prescaler register, Address offset: 0x18 */
  721. } USART_TypeDef;
  722. /**
  723. * @brief Window WATCHDOG
  724. */
  725. typedef struct
  726. {
  727. __IO uint32_t CR; /*!< WWDG Control register, Address offset: 0x00 */
  728. __IO uint32_t CFR; /*!< WWDG Configuration register, Address offset: 0x04 */
  729. __IO uint32_t SR; /*!< WWDG Status register, Address offset: 0x08 */
  730. } WWDG_TypeDef;
  731. /**
  732. * @brief USB_OTG_Core_Registers
  733. */
  734. typedef struct
  735. {
  736. __IO uint32_t GOTGCTL; /*!< USB_OTG Control and Status Register 000h */
  737. __IO uint32_t GOTGINT; /*!< USB_OTG Interrupt Register 004h */
  738. __IO uint32_t GAHBCFG; /*!< Core AHB Configuration Register 008h */
  739. __IO uint32_t GUSBCFG; /*!< Core USB Configuration Register 00Ch */
  740. __IO uint32_t GRSTCTL; /*!< Core Reset Register 010h */
  741. __IO uint32_t GINTSTS; /*!< Core Interrupt Register 014h */
  742. __IO uint32_t GINTMSK; /*!< Core Interrupt Mask Register 018h */
  743. __IO uint32_t GRXSTSR; /*!< Receive Sts Q Read Register 01Ch */
  744. __IO uint32_t GRXSTSP; /*!< Receive Sts Q Read & POP Register 020h */
  745. __IO uint32_t GRXFSIZ; /*!< Receive FIFO Size Register 024h */
  746. __IO uint32_t DIEPTXF0_HNPTXFSIZ; /*!< EP0 / Non Periodic Tx FIFO Size Register 028h */
  747. __IO uint32_t HNPTXSTS; /*!< Non Periodic Tx FIFO/Queue Sts reg 02Ch */
  748. uint32_t Reserved30[2]; /*!< Reserved 030h */
  749. __IO uint32_t GCCFG; /*!< General Purpose IO Register 038h */
  750. __IO uint32_t CID; /*!< User ID Register 03Ch */
  751. uint32_t Reserved5[3]; /*!< Reserved 040h-048h */
  752. __IO uint32_t GHWCFG3; /*!< User HW config3 04Ch */
  753. uint32_t Reserved6; /*!< Reserved 050h */
  754. __IO uint32_t GLPMCFG; /*!< LPM Register 054h */
  755. uint32_t Reserved; /*!< Reserved 058h */
  756. __IO uint32_t GDFIFOCFG; /*!< DFIFO Software Config Register 05Ch */
  757. uint32_t Reserved43[40]; /*!< Reserved 058h-0FFh */
  758. __IO uint32_t HPTXFSIZ; /*!< Host Periodic Tx FIFO Size Reg 100h */
  759. __IO uint32_t DIEPTXF[0x0F]; /*!< dev Periodic Transmit FIFO */
  760. } USB_OTG_GlobalTypeDef;
  761. /**
  762. * @brief USB_OTG_device_Registers
  763. */
  764. typedef struct
  765. {
  766. __IO uint32_t DCFG; /*!< dev Configuration Register 800h */
  767. __IO uint32_t DCTL; /*!< dev Control Register 804h */
  768. __IO uint32_t DSTS; /*!< dev Status Register (RO) 808h */
  769. uint32_t Reserved0C; /*!< Reserved 80Ch */
  770. __IO uint32_t DIEPMSK; /*!< dev IN Endpoint Mask 810h */
  771. __IO uint32_t DOEPMSK; /*!< dev OUT Endpoint Mask 814h */
  772. __IO uint32_t DAINT; /*!< dev All Endpoints Itr Reg 818h */
  773. __IO uint32_t DAINTMSK; /*!< dev All Endpoints Itr Mask 81Ch */
  774. uint32_t Reserved20; /*!< Reserved 820h */
  775. uint32_t Reserved9; /*!< Reserved 824h */
  776. __IO uint32_t DVBUSDIS; /*!< dev VBUS discharge Register 828h */
  777. __IO uint32_t DVBUSPULSE; /*!< dev VBUS Pulse Register 82Ch */
  778. __IO uint32_t DTHRCTL; /*!< dev threshold 830h */
  779. __IO uint32_t DIEPEMPMSK; /*!< dev empty msk 834h */
  780. __IO uint32_t DEACHINT; /*!< dedicated EP interrupt 838h */
  781. __IO uint32_t DEACHMSK; /*!< dedicated EP msk 83Ch */
  782. uint32_t Reserved40; /*!< dedicated EP mask 840h */
  783. __IO uint32_t DINEP1MSK; /*!< dedicated EP mask 844h */
  784. uint32_t Reserved44[15]; /*!< Reserved 844-87Ch */
  785. __IO uint32_t DOUTEP1MSK; /*!< dedicated EP msk 884h */
  786. } USB_OTG_DeviceTypeDef;
  787. /**
  788. * @brief USB_OTG_IN_Endpoint-Specific_Register
  789. */
  790. typedef struct
  791. {
  792. __IO uint32_t DIEPCTL; /*!< dev IN Endpoint Control Reg 900h + (ep_num * 20h) + 00h */
  793. uint32_t Reserved04; /*!< Reserved 900h + (ep_num * 20h) + 04h */
  794. __IO uint32_t DIEPINT; /*!< dev IN Endpoint Itr Reg 900h + (ep_num * 20h) + 08h */
  795. uint32_t Reserved0C; /*!< Reserved 900h + (ep_num * 20h) + 0Ch */
  796. __IO uint32_t DIEPTSIZ; /*!< IN Endpoint Txfer Size 900h + (ep_num * 20h) + 10h */
  797. __IO uint32_t DIEPDMA; /*!< IN Endpoint DMA Address Reg 900h + (ep_num * 20h) + 14h */
  798. __IO uint32_t DTXFSTS; /*!< IN Endpoint Tx FIFO Status Reg 900h + (ep_num * 20h) + 18h */
  799. uint32_t Reserved18; /*!< Reserved 900h+(ep_num*20h)+1Ch-900h+ (ep_num * 20h) + 1Ch */
  800. } USB_OTG_INEndpointTypeDef;
  801. /**
  802. * @brief USB_OTG_OUT_Endpoint-Specific_Registers
  803. */
  804. typedef struct
  805. {
  806. __IO uint32_t DOEPCTL; /*!< dev OUT Endpoint Control Reg B00h + (ep_num * 20h) + 00h */
  807. uint32_t Reserved04; /*!< Reserved B00h + (ep_num * 20h) + 04h */
  808. __IO uint32_t DOEPINT; /*!< dev OUT Endpoint Itr Reg B00h + (ep_num * 20h) + 08h */
  809. uint32_t Reserved0C; /*!< Reserved B00h + (ep_num * 20h) + 0Ch */
  810. __IO uint32_t DOEPTSIZ; /*!< dev OUT Endpoint Txfer Size B00h + (ep_num * 20h) + 10h */
  811. __IO uint32_t DOEPDMA; /*!< dev OUT Endpoint DMA Address B00h + (ep_num * 20h) + 14h */
  812. uint32_t Reserved18[2]; /*!< Reserved B00h + (ep_num * 20h) + 18h - B00h + (ep_num * 20h) + 1Ch */
  813. } USB_OTG_OUTEndpointTypeDef;
  814. /**
  815. * @brief USB_OTG_Host_Mode_Register_Structures
  816. */
  817. typedef struct
  818. {
  819. __IO uint32_t HCFG; /*!< Host Configuration Register 400h */
  820. __IO uint32_t HFIR; /*!< Host Frame Interval Register 404h */
  821. __IO uint32_t HFNUM; /*!< Host Frame Nbr/Frame Remaining 408h */
  822. uint32_t Reserved40C; /*!< Reserved 40Ch */
  823. __IO uint32_t HPTXSTS; /*!< Host Periodic Tx FIFO/ Queue Status 410h */
  824. __IO uint32_t HAINT; /*!< Host All Channels Interrupt Register 414h */
  825. __IO uint32_t HAINTMSK; /*!< Host All Channels Interrupt Mask 418h */
  826. } USB_OTG_HostTypeDef;
  827. /**
  828. * @brief USB_OTG_Host_Channel_Specific_Registers
  829. */
  830. typedef struct
  831. {
  832. __IO uint32_t HCCHAR; /*!< Host Channel Characteristics Register 500h */
  833. __IO uint32_t HCSPLT; /*!< Host Channel Split Control Register 504h */
  834. __IO uint32_t HCINT; /*!< Host Channel Interrupt Register 508h */
  835. __IO uint32_t HCINTMSK; /*!< Host Channel Interrupt Mask Register 50Ch */
  836. __IO uint32_t HCTSIZ; /*!< Host Channel Transfer Size Register 510h */
  837. __IO uint32_t HCDMA; /*!< Host Channel DMA Address Register 514h */
  838. uint32_t Reserved[2]; /*!< Reserved */
  839. } USB_OTG_HostChannelTypeDef;
  840. /**
  841. * @}
  842. */
  843. /** @addtogroup Peripheral_memory_map
  844. * @{
  845. */
  846. #define FLASH_BASE ((uint32_t)0x08000000) /*!< FLASH(up to 1 MB) base address in the alias region */
  847. #define SRAM1_BASE ((uint32_t)0x20000000) /*!< SRAM1(112 KB) base address in the alias region */
  848. #define SRAM2_BASE ((uint32_t)0x2001C000) /*!< SRAM2(16 KB) base address in the alias region */
  849. #define PERIPH_BASE ((uint32_t)0x40000000) /*!< Peripheral base address in the alias region */
  850. #define BKPSRAM_BASE ((uint32_t)0x40024000) /*!< Backup SRAM(4 KB) base address in the alias region */
  851. #define FMC_R_BASE ((uint32_t)0xA0000000) /*!< FMC registers base address */
  852. #define QSPI_R_BASE ((uint32_t)0xA0001000) /*!< QuadSPI registers base address */
  853. #define SRAM1_BB_BASE ((uint32_t)0x22000000) /*!< SRAM1(112 KB) base address in the bit-band region */
  854. #define SRAM2_BB_BASE ((uint32_t)0x22380000) /*!< SRAM2(16 KB) base address in the bit-band region */
  855. #define PERIPH_BB_BASE ((uint32_t)0x42000000) /*!< Peripheral base address in the bit-band region */
  856. #define BKPSRAM_BB_BASE ((uint32_t)0x42480000) /*!< Backup SRAM(4 KB) base address in the bit-band region */
  857. #define FLASH_END ((uint32_t)0x0807FFFF) /*!< FLASH end address */
  858. /* Legacy defines */
  859. #define SRAM_BASE SRAM1_BASE
  860. #define SRAM_BB_BASE SRAM1_BB_BASE
  861. /*!< Peripheral memory map */
  862. #define APB1PERIPH_BASE PERIPH_BASE
  863. #define APB2PERIPH_BASE (PERIPH_BASE + 0x00010000)
  864. #define AHB1PERIPH_BASE (PERIPH_BASE + 0x00020000)
  865. #define AHB2PERIPH_BASE (PERIPH_BASE + 0x10000000)
  866. /*!< APB1 peripherals */
  867. #define TIM2_BASE (APB1PERIPH_BASE + 0x0000)
  868. #define TIM3_BASE (APB1PERIPH_BASE + 0x0400)
  869. #define TIM4_BASE (APB1PERIPH_BASE + 0x0800)
  870. #define TIM5_BASE (APB1PERIPH_BASE + 0x0C00)
  871. #define TIM6_BASE (APB1PERIPH_BASE + 0x1000)
  872. #define TIM7_BASE (APB1PERIPH_BASE + 0x1400)
  873. #define TIM12_BASE (APB1PERIPH_BASE + 0x1800)
  874. #define TIM13_BASE (APB1PERIPH_BASE + 0x1C00)
  875. #define TIM14_BASE (APB1PERIPH_BASE + 0x2000)
  876. #define RTC_BASE (APB1PERIPH_BASE + 0x2800)
  877. #define WWDG_BASE (APB1PERIPH_BASE + 0x2C00)
  878. #define IWDG_BASE (APB1PERIPH_BASE + 0x3000)
  879. #define SPI2_BASE (APB1PERIPH_BASE + 0x3800)
  880. #define SPI3_BASE (APB1PERIPH_BASE + 0x3C00)
  881. #define SPDIFRX_BASE (APB1PERIPH_BASE + 0x4000)
  882. #define USART2_BASE (APB1PERIPH_BASE + 0x4400)
  883. #define USART3_BASE (APB1PERIPH_BASE + 0x4800)
  884. #define UART4_BASE (APB1PERIPH_BASE + 0x4C00)
  885. #define UART5_BASE (APB1PERIPH_BASE + 0x5000)
  886. #define I2C1_BASE (APB1PERIPH_BASE + 0x5400)
  887. #define I2C2_BASE (APB1PERIPH_BASE + 0x5800)
  888. #define I2C3_BASE (APB1PERIPH_BASE + 0x5C00)
  889. #define FMPI2C1_BASE (APB1PERIPH_BASE + 0x6000)
  890. #define CAN1_BASE (APB1PERIPH_BASE + 0x6400)
  891. #define CAN2_BASE (APB1PERIPH_BASE + 0x6800)
  892. #define CEC_BASE (APB1PERIPH_BASE + 0x6C00)
  893. #define PWR_BASE (APB1PERIPH_BASE + 0x7000)
  894. #define DAC_BASE (APB1PERIPH_BASE + 0x7400)
  895. /*!< APB2 peripherals */
  896. #define TIM1_BASE (APB2PERIPH_BASE + 0x0000)
  897. #define TIM8_BASE (APB2PERIPH_BASE + 0x0400)
  898. #define USART1_BASE (APB2PERIPH_BASE + 0x1000)
  899. #define USART6_BASE (APB2PERIPH_BASE + 0x1400)
  900. #define ADC1_BASE (APB2PERIPH_BASE + 0x2000)
  901. #define ADC2_BASE (APB2PERIPH_BASE + 0x2100)
  902. #define ADC3_BASE (APB2PERIPH_BASE + 0x2200)
  903. #define ADC_BASE (APB2PERIPH_BASE + 0x2300)
  904. #define SDIO_BASE (APB2PERIPH_BASE + 0x2C00)
  905. #define SPI1_BASE (APB2PERIPH_BASE + 0x3000)
  906. #define SPI4_BASE (APB2PERIPH_BASE + 0x3400)
  907. #define SYSCFG_BASE (APB2PERIPH_BASE + 0x3800)
  908. #define EXTI_BASE (APB2PERIPH_BASE + 0x3C00)
  909. #define TIM9_BASE (APB2PERIPH_BASE + 0x4000)
  910. #define TIM10_BASE (APB2PERIPH_BASE + 0x4400)
  911. #define TIM11_BASE (APB2PERIPH_BASE + 0x4800)
  912. #define SAI1_BASE (APB2PERIPH_BASE + 0x5800)
  913. #define SAI1_Block_A_BASE (SAI1_BASE + 0x004)
  914. #define SAI1_Block_B_BASE (SAI1_BASE + 0x024)
  915. #define SAI2_BASE (APB2PERIPH_BASE + 0x5C00)
  916. #define SAI2_Block_A_BASE (SAI2_BASE + 0x004)
  917. #define SAI2_Block_B_BASE (SAI2_BASE + 0x024)
  918. /*!< AHB1 peripherals */
  919. #define GPIOA_BASE (AHB1PERIPH_BASE + 0x0000)
  920. #define GPIOB_BASE (AHB1PERIPH_BASE + 0x0400)
  921. #define GPIOC_BASE (AHB1PERIPH_BASE + 0x0800)
  922. #define GPIOD_BASE (AHB1PERIPH_BASE + 0x0C00)
  923. #define GPIOE_BASE (AHB1PERIPH_BASE + 0x1000)
  924. #define GPIOF_BASE (AHB1PERIPH_BASE + 0x1400)
  925. #define GPIOG_BASE (AHB1PERIPH_BASE + 0x1800)
  926. #define GPIOH_BASE (AHB1PERIPH_BASE + 0x1C00)
  927. #define CRC_BASE (AHB1PERIPH_BASE + 0x3000)
  928. #define RCC_BASE (AHB1PERIPH_BASE + 0x3800)
  929. #define FLASH_R_BASE (AHB1PERIPH_BASE + 0x3C00)
  930. #define DMA1_BASE (AHB1PERIPH_BASE + 0x6000)
  931. #define DMA1_Stream0_BASE (DMA1_BASE + 0x010)
  932. #define DMA1_Stream1_BASE (DMA1_BASE + 0x028)
  933. #define DMA1_Stream2_BASE (DMA1_BASE + 0x040)
  934. #define DMA1_Stream3_BASE (DMA1_BASE + 0x058)
  935. #define DMA1_Stream4_BASE (DMA1_BASE + 0x070)
  936. #define DMA1_Stream5_BASE (DMA1_BASE + 0x088)
  937. #define DMA1_Stream6_BASE (DMA1_BASE + 0x0A0)
  938. #define DMA1_Stream7_BASE (DMA1_BASE + 0x0B8)
  939. #define DMA2_BASE (AHB1PERIPH_BASE + 0x6400)
  940. #define DMA2_Stream0_BASE (DMA2_BASE + 0x010)
  941. #define DMA2_Stream1_BASE (DMA2_BASE + 0x028)
  942. #define DMA2_Stream2_BASE (DMA2_BASE + 0x040)
  943. #define DMA2_Stream3_BASE (DMA2_BASE + 0x058)
  944. #define DMA2_Stream4_BASE (DMA2_BASE + 0x070)
  945. #define DMA2_Stream5_BASE (DMA2_BASE + 0x088)
  946. #define DMA2_Stream6_BASE (DMA2_BASE + 0x0A0)
  947. #define DMA2_Stream7_BASE (DMA2_BASE + 0x0B8)
  948. /*!< AHB2 peripherals */
  949. #define DCMI_BASE (AHB2PERIPH_BASE + 0x50000)
  950. /*!< FMC Bankx registers base address */
  951. #define FMC_Bank1_R_BASE (FMC_R_BASE + 0x0000)
  952. #define FMC_Bank1E_R_BASE (FMC_R_BASE + 0x0104)
  953. #define FMC_Bank3_R_BASE (FMC_R_BASE + 0x0080)
  954. #define FMC_Bank5_6_R_BASE (FMC_R_BASE + 0x0140)
  955. /*!< Debug MCU registers base address */
  956. #define DBGMCU_BASE ((uint32_t )0xE0042000)
  957. /*!< USB registers base address */
  958. #define USB_OTG_HS_PERIPH_BASE ((uint32_t )0x40040000)
  959. #define USB_OTG_FS_PERIPH_BASE ((uint32_t )0x50000000)
  960. #define USB_OTG_GLOBAL_BASE ((uint32_t )0x000)
  961. #define USB_OTG_DEVICE_BASE ((uint32_t )0x800)
  962. #define USB_OTG_IN_ENDPOINT_BASE ((uint32_t )0x900)
  963. #define USB_OTG_OUT_ENDPOINT_BASE ((uint32_t )0xB00)
  964. #define USB_OTG_EP_REG_SIZE ((uint32_t )0x20)
  965. #define USB_OTG_HOST_BASE ((uint32_t )0x400)
  966. #define USB_OTG_HOST_PORT_BASE ((uint32_t )0x440)
  967. #define USB_OTG_HOST_CHANNEL_BASE ((uint32_t )0x500)
  968. #define USB_OTG_HOST_CHANNEL_SIZE ((uint32_t )0x20)
  969. #define USB_OTG_PCGCCTL_BASE ((uint32_t )0xE00)
  970. #define USB_OTG_FIFO_BASE ((uint32_t )0x1000)
  971. #define USB_OTG_FIFO_SIZE ((uint32_t )0x1000)
  972. /**
  973. * @}
  974. */
  975. /** @addtogroup Peripheral_declaration
  976. * @{
  977. */
  978. #define TIM2 ((TIM_TypeDef *) TIM2_BASE)
  979. #define TIM3 ((TIM_TypeDef *) TIM3_BASE)
  980. #define TIM4 ((TIM_TypeDef *) TIM4_BASE)
  981. #define TIM5 ((TIM_TypeDef *) TIM5_BASE)
  982. #define TIM6 ((TIM_TypeDef *) TIM6_BASE)
  983. #define TIM7 ((TIM_TypeDef *) TIM7_BASE)
  984. #define TIM12 ((TIM_TypeDef *) TIM12_BASE)
  985. #define TIM13 ((TIM_TypeDef *) TIM13_BASE)
  986. #define TIM14 ((TIM_TypeDef *) TIM14_BASE)
  987. #define RTC ((RTC_TypeDef *) RTC_BASE)
  988. #define WWDG ((WWDG_TypeDef *) WWDG_BASE)
  989. #define IWDG ((IWDG_TypeDef *) IWDG_BASE)
  990. #define SPI2 ((SPI_TypeDef *) SPI2_BASE)
  991. #define SPI3 ((SPI_TypeDef *) SPI3_BASE)
  992. #define SPDIFRX ((SPDIFRX_TypeDef *) SPDIFRX_BASE)
  993. #define USART2 ((USART_TypeDef *) USART2_BASE)
  994. #define USART3 ((USART_TypeDef *) USART3_BASE)
  995. #define UART4 ((USART_TypeDef *) UART4_BASE)
  996. #define UART5 ((USART_TypeDef *) UART5_BASE)
  997. #define I2C1 ((I2C_TypeDef *) I2C1_BASE)
  998. #define I2C2 ((I2C_TypeDef *) I2C2_BASE)
  999. #define I2C3 ((I2C_TypeDef *) I2C3_BASE)
  1000. #define FMPI2C1 ((FMPI2C_TypeDef *) FMPI2C1_BASE)
  1001. #define CAN1 ((CAN_TypeDef *) CAN1_BASE)
  1002. #define CAN2 ((CAN_TypeDef *) CAN2_BASE)
  1003. #define CEC ((CEC_TypeDef *) CEC_BASE)
  1004. #define PWR ((PWR_TypeDef *) PWR_BASE)
  1005. #define DAC ((DAC_TypeDef *) DAC_BASE)
  1006. #define TIM1 ((TIM_TypeDef *) TIM1_BASE)
  1007. #define TIM8 ((TIM_TypeDef *) TIM8_BASE)
  1008. #define USART1 ((USART_TypeDef *) USART1_BASE)
  1009. #define USART6 ((USART_TypeDef *) USART6_BASE)
  1010. #define ADC ((ADC_Common_TypeDef *) ADC_BASE)
  1011. #define ADC1 ((ADC_TypeDef *) ADC1_BASE)
  1012. #define ADC2 ((ADC_TypeDef *) ADC2_BASE)
  1013. #define ADC3 ((ADC_TypeDef *) ADC3_BASE)
  1014. #define SDIO ((SDIO_TypeDef *) SDIO_BASE)
  1015. #define SPI1 ((SPI_TypeDef *) SPI1_BASE)
  1016. #define SPI4 ((SPI_TypeDef *) SPI4_BASE)
  1017. #define SYSCFG ((SYSCFG_TypeDef *) SYSCFG_BASE)
  1018. #define EXTI ((EXTI_TypeDef *) EXTI_BASE)
  1019. #define TIM9 ((TIM_TypeDef *) TIM9_BASE)
  1020. #define TIM10 ((TIM_TypeDef *) TIM10_BASE)
  1021. #define TIM11 ((TIM_TypeDef *) TIM11_BASE)
  1022. #define SAI1 ((SAI_TypeDef *) SAI1_BASE)
  1023. #define SAI1_Block_A ((SAI_Block_TypeDef *)SAI1_Block_A_BASE)
  1024. #define SAI1_Block_B ((SAI_Block_TypeDef *)SAI1_Block_B_BASE)
  1025. #define SAI2 ((SAI_TypeDef *) SAI2_BASE)
  1026. #define SAI2_Block_A ((SAI_Block_TypeDef *)SAI2_Block_A_BASE)
  1027. #define SAI2_Block_B ((SAI_Block_TypeDef *)SAI2_Block_B_BASE)
  1028. #define GPIOA ((GPIO_TypeDef *) GPIOA_BASE)
  1029. #define GPIOB ((GPIO_TypeDef *) GPIOB_BASE)
  1030. #define GPIOC ((GPIO_TypeDef *) GPIOC_BASE)
  1031. #define GPIOD ((GPIO_TypeDef *) GPIOD_BASE)
  1032. #define GPIOE ((GPIO_TypeDef *) GPIOE_BASE)
  1033. #define GPIOF ((GPIO_TypeDef *) GPIOF_BASE)
  1034. #define GPIOG ((GPIO_TypeDef *) GPIOG_BASE)
  1035. #define GPIOH ((GPIO_TypeDef *) GPIOH_BASE)
  1036. #define CRC ((CRC_TypeDef *) CRC_BASE)
  1037. #define RCC ((RCC_TypeDef *) RCC_BASE)
  1038. #define FLASH ((FLASH_TypeDef *) FLASH_R_BASE)
  1039. #define DMA1 ((DMA_TypeDef *) DMA1_BASE)
  1040. #define DMA1_Stream0 ((DMA_Stream_TypeDef *) DMA1_Stream0_BASE)
  1041. #define DMA1_Stream1 ((DMA_Stream_TypeDef *) DMA1_Stream1_BASE)
  1042. #define DMA1_Stream2 ((DMA_Stream_TypeDef *) DMA1_Stream2_BASE)
  1043. #define DMA1_Stream3 ((DMA_Stream_TypeDef *) DMA1_Stream3_BASE)
  1044. #define DMA1_Stream4 ((DMA_Stream_TypeDef *) DMA1_Stream4_BASE)
  1045. #define DMA1_Stream5 ((DMA_Stream_TypeDef *) DMA1_Stream5_BASE)
  1046. #define DMA1_Stream6 ((DMA_Stream_TypeDef *) DMA1_Stream6_BASE)
  1047. #define DMA1_Stream7 ((DMA_Stream_TypeDef *) DMA1_Stream7_BASE)
  1048. #define DMA2 ((DMA_TypeDef *) DMA2_BASE)
  1049. #define DMA2_Stream0 ((DMA_Stream_TypeDef *) DMA2_Stream0_BASE)
  1050. #define DMA2_Stream1 ((DMA_Stream_TypeDef *) DMA2_Stream1_BASE)
  1051. #define DMA2_Stream2 ((DMA_Stream_TypeDef *) DMA2_Stream2_BASE)
  1052. #define DMA2_Stream3 ((DMA_Stream_TypeDef *) DMA2_Stream3_BASE)
  1053. #define DMA2_Stream4 ((DMA_Stream_TypeDef *) DMA2_Stream4_BASE)
  1054. #define DMA2_Stream5 ((DMA_Stream_TypeDef *) DMA2_Stream5_BASE)
  1055. #define DMA2_Stream6 ((DMA_Stream_TypeDef *) DMA2_Stream6_BASE)
  1056. #define DMA2_Stream7 ((DMA_Stream_TypeDef *) DMA2_Stream7_BASE)
  1057. #define DCMI ((DCMI_TypeDef *) DCMI_BASE)
  1058. #define FMC_Bank1 ((FMC_Bank1_TypeDef *) FMC_Bank1_R_BASE)
  1059. #define FMC_Bank1E ((FMC_Bank1E_TypeDef *) FMC_Bank1E_R_BASE)
  1060. #define FMC_Bank3 ((FMC_Bank3_TypeDef *) FMC_Bank3_R_BASE)
  1061. #define FMC_Bank5_6 ((FMC_Bank5_6_TypeDef *) FMC_Bank5_6_R_BASE)
  1062. #define QUADSPI ((QUADSPI_TypeDef *) QSPI_R_BASE)
  1063. #define DBGMCU ((DBGMCU_TypeDef *) DBGMCU_BASE)
  1064. #define USB_OTG_FS ((USB_OTG_GlobalTypeDef *) USB_OTG_FS_PERIPH_BASE)
  1065. #define USB_OTG_HS ((USB_OTG_GlobalTypeDef *) USB_OTG_HS_PERIPH_BASE)
  1066. /**
  1067. * @}
  1068. */
  1069. /** @addtogroup Exported_constants
  1070. * @{
  1071. */
  1072. /** @addtogroup Peripheral_Registers_Bits_Definition
  1073. * @{
  1074. */
  1075. /******************************************************************************/
  1076. /* Peripheral Registers_Bits_Definition */
  1077. /******************************************************************************/
  1078. /******************************************************************************/
  1079. /* */
  1080. /* Analog to Digital Converter */
  1081. /* */
  1082. /******************************************************************************/
  1083. /******************** Bit definition for ADC_SR register ********************/
  1084. #define ADC_SR_AWD ((uint32_t)0x00000001) /*!<Analog watchdog flag */
  1085. #define ADC_SR_EOC ((uint32_t)0x00000002) /*!<End of conversion */
  1086. #define ADC_SR_JEOC ((uint32_t)0x00000004) /*!<Injected channel end of conversion */
  1087. #define ADC_SR_JSTRT ((uint32_t)0x00000008) /*!<Injected channel Start flag */
  1088. #define ADC_SR_STRT ((uint32_t)0x00000010) /*!<Regular channel Start flag */
  1089. #define ADC_SR_OVR ((uint32_t)0x00000020) /*!<Overrun flag */
  1090. /******************* Bit definition for ADC_CR1 register ********************/
  1091. #define ADC_CR1_AWDCH ((uint32_t)0x0000001F) /*!<AWDCH[4:0] bits (Analog watchdog channel select bits) */
  1092. #define ADC_CR1_AWDCH_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1093. #define ADC_CR1_AWDCH_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1094. #define ADC_CR1_AWDCH_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1095. #define ADC_CR1_AWDCH_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  1096. #define ADC_CR1_AWDCH_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  1097. #define ADC_CR1_EOCIE ((uint32_t)0x00000020) /*!<Interrupt enable for EOC */
  1098. #define ADC_CR1_AWDIE ((uint32_t)0x00000040) /*!<AAnalog Watchdog interrupt enable */
  1099. #define ADC_CR1_JEOCIE ((uint32_t)0x00000080) /*!<Interrupt enable for injected channels */
  1100. #define ADC_CR1_SCAN ((uint32_t)0x00000100) /*!<Scan mode */
  1101. #define ADC_CR1_AWDSGL ((uint32_t)0x00000200) /*!<Enable the watchdog on a single channel in scan mode */
  1102. #define ADC_CR1_JAUTO ((uint32_t)0x00000400) /*!<Automatic injected group conversion */
  1103. #define ADC_CR1_DISCEN ((uint32_t)0x00000800) /*!<Discontinuous mode on regular channels */
  1104. #define ADC_CR1_JDISCEN ((uint32_t)0x00001000) /*!<Discontinuous mode on injected channels */
  1105. #define ADC_CR1_DISCNUM ((uint32_t)0x0000E000) /*!<DISCNUM[2:0] bits (Discontinuous mode channel count) */
  1106. #define ADC_CR1_DISCNUM_0 ((uint32_t)0x00002000) /*!<Bit 0 */
  1107. #define ADC_CR1_DISCNUM_1 ((uint32_t)0x00004000) /*!<Bit 1 */
  1108. #define ADC_CR1_DISCNUM_2 ((uint32_t)0x00008000) /*!<Bit 2 */
  1109. #define ADC_CR1_JAWDEN ((uint32_t)0x00400000) /*!<Analog watchdog enable on injected channels */
  1110. #define ADC_CR1_AWDEN ((uint32_t)0x00800000) /*!<Analog watchdog enable on regular channels */
  1111. #define ADC_CR1_RES ((uint32_t)0x03000000) /*!<RES[2:0] bits (Resolution) */
  1112. #define ADC_CR1_RES_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  1113. #define ADC_CR1_RES_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  1114. #define ADC_CR1_OVRIE ((uint32_t)0x04000000) /*!<overrun interrupt enable */
  1115. /******************* Bit definition for ADC_CR2 register ********************/
  1116. #define ADC_CR2_ADON ((uint32_t)0x00000001) /*!<A/D Converter ON / OFF */
  1117. #define ADC_CR2_CONT ((uint32_t)0x00000002) /*!<Continuous Conversion */
  1118. #define ADC_CR2_DMA ((uint32_t)0x00000100) /*!<Direct Memory access mode */
  1119. #define ADC_CR2_DDS ((uint32_t)0x00000200) /*!<DMA disable selection (Single ADC) */
  1120. #define ADC_CR2_EOCS ((uint32_t)0x00000400) /*!<End of conversion selection */
  1121. #define ADC_CR2_ALIGN ((uint32_t)0x00000800) /*!<Data Alignment */
  1122. #define ADC_CR2_JEXTSEL ((uint32_t)0x000F0000) /*!<JEXTSEL[3:0] bits (External event select for injected group) */
  1123. #define ADC_CR2_JEXTSEL_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  1124. #define ADC_CR2_JEXTSEL_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  1125. #define ADC_CR2_JEXTSEL_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  1126. #define ADC_CR2_JEXTSEL_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  1127. #define ADC_CR2_JEXTEN ((uint32_t)0x00300000) /*!<JEXTEN[1:0] bits (External Trigger Conversion mode for injected channelsp) */
  1128. #define ADC_CR2_JEXTEN_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  1129. #define ADC_CR2_JEXTEN_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  1130. #define ADC_CR2_JSWSTART ((uint32_t)0x00400000) /*!<Start Conversion of injected channels */
  1131. #define ADC_CR2_EXTSEL ((uint32_t)0x0F000000) /*!<EXTSEL[3:0] bits (External Event Select for regular group) */
  1132. #define ADC_CR2_EXTSEL_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  1133. #define ADC_CR2_EXTSEL_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  1134. #define ADC_CR2_EXTSEL_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  1135. #define ADC_CR2_EXTSEL_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  1136. #define ADC_CR2_EXTEN ((uint32_t)0x30000000) /*!<EXTEN[1:0] bits (External Trigger Conversion mode for regular channelsp) */
  1137. #define ADC_CR2_EXTEN_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  1138. #define ADC_CR2_EXTEN_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  1139. #define ADC_CR2_SWSTART ((uint32_t)0x40000000) /*!<Start Conversion of regular channels */
  1140. /****************** Bit definition for ADC_SMPR1 register *******************/
  1141. #define ADC_SMPR1_SMP10 ((uint32_t)0x00000007) /*!<SMP10[2:0] bits (Channel 10 Sample time selection) */
  1142. #define ADC_SMPR1_SMP10_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1143. #define ADC_SMPR1_SMP10_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1144. #define ADC_SMPR1_SMP10_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1145. #define ADC_SMPR1_SMP11 ((uint32_t)0x00000038) /*!<SMP11[2:0] bits (Channel 11 Sample time selection) */
  1146. #define ADC_SMPR1_SMP11_0 ((uint32_t)0x00000008) /*!<Bit 0 */
  1147. #define ADC_SMPR1_SMP11_1 ((uint32_t)0x00000010) /*!<Bit 1 */
  1148. #define ADC_SMPR1_SMP11_2 ((uint32_t)0x00000020) /*!<Bit 2 */
  1149. #define ADC_SMPR1_SMP12 ((uint32_t)0x000001C0) /*!<SMP12[2:0] bits (Channel 12 Sample time selection) */
  1150. #define ADC_SMPR1_SMP12_0 ((uint32_t)0x00000040) /*!<Bit 0 */
  1151. #define ADC_SMPR1_SMP12_1 ((uint32_t)0x00000080) /*!<Bit 1 */
  1152. #define ADC_SMPR1_SMP12_2 ((uint32_t)0x00000100) /*!<Bit 2 */
  1153. #define ADC_SMPR1_SMP13 ((uint32_t)0x00000E00) /*!<SMP13[2:0] bits (Channel 13 Sample time selection) */
  1154. #define ADC_SMPR1_SMP13_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  1155. #define ADC_SMPR1_SMP13_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  1156. #define ADC_SMPR1_SMP13_2 ((uint32_t)0x00000800) /*!<Bit 2 */
  1157. #define ADC_SMPR1_SMP14 ((uint32_t)0x00007000) /*!<SMP14[2:0] bits (Channel 14 Sample time selection) */
  1158. #define ADC_SMPR1_SMP14_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  1159. #define ADC_SMPR1_SMP14_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  1160. #define ADC_SMPR1_SMP14_2 ((uint32_t)0x00004000) /*!<Bit 2 */
  1161. #define ADC_SMPR1_SMP15 ((uint32_t)0x00038000) /*!<SMP15[2:0] bits (Channel 15 Sample time selection) */
  1162. #define ADC_SMPR1_SMP15_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  1163. #define ADC_SMPR1_SMP15_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  1164. #define ADC_SMPR1_SMP15_2 ((uint32_t)0x00020000) /*!<Bit 2 */
  1165. #define ADC_SMPR1_SMP16 ((uint32_t)0x001C0000) /*!<SMP16[2:0] bits (Channel 16 Sample time selection) */
  1166. #define ADC_SMPR1_SMP16_0 ((uint32_t)0x00040000) /*!<Bit 0 */
  1167. #define ADC_SMPR1_SMP16_1 ((uint32_t)0x00080000) /*!<Bit 1 */
  1168. #define ADC_SMPR1_SMP16_2 ((uint32_t)0x00100000) /*!<Bit 2 */
  1169. #define ADC_SMPR1_SMP17 ((uint32_t)0x00E00000) /*!<SMP17[2:0] bits (Channel 17 Sample time selection) */
  1170. #define ADC_SMPR1_SMP17_0 ((uint32_t)0x00200000) /*!<Bit 0 */
  1171. #define ADC_SMPR1_SMP17_1 ((uint32_t)0x00400000) /*!<Bit 1 */
  1172. #define ADC_SMPR1_SMP17_2 ((uint32_t)0x00800000) /*!<Bit 2 */
  1173. #define ADC_SMPR1_SMP18 ((uint32_t)0x07000000) /*!<SMP18[2:0] bits (Channel 18 Sample time selection) */
  1174. #define ADC_SMPR1_SMP18_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  1175. #define ADC_SMPR1_SMP18_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  1176. #define ADC_SMPR1_SMP18_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  1177. /****************** Bit definition for ADC_SMPR2 register *******************/
  1178. #define ADC_SMPR2_SMP0 ((uint32_t)0x00000007) /*!<SMP0[2:0] bits (Channel 0 Sample time selection) */
  1179. #define ADC_SMPR2_SMP0_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1180. #define ADC_SMPR2_SMP0_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1181. #define ADC_SMPR2_SMP0_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1182. #define ADC_SMPR2_SMP1 ((uint32_t)0x00000038) /*!<SMP1[2:0] bits (Channel 1 Sample time selection) */
  1183. #define ADC_SMPR2_SMP1_0 ((uint32_t)0x00000008) /*!<Bit 0 */
  1184. #define ADC_SMPR2_SMP1_1 ((uint32_t)0x00000010) /*!<Bit 1 */
  1185. #define ADC_SMPR2_SMP1_2 ((uint32_t)0x00000020) /*!<Bit 2 */
  1186. #define ADC_SMPR2_SMP2 ((uint32_t)0x000001C0) /*!<SMP2[2:0] bits (Channel 2 Sample time selection) */
  1187. #define ADC_SMPR2_SMP2_0 ((uint32_t)0x00000040) /*!<Bit 0 */
  1188. #define ADC_SMPR2_SMP2_1 ((uint32_t)0x00000080) /*!<Bit 1 */
  1189. #define ADC_SMPR2_SMP2_2 ((uint32_t)0x00000100) /*!<Bit 2 */
  1190. #define ADC_SMPR2_SMP3 ((uint32_t)0x00000E00) /*!<SMP3[2:0] bits (Channel 3 Sample time selection) */
  1191. #define ADC_SMPR2_SMP3_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  1192. #define ADC_SMPR2_SMP3_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  1193. #define ADC_SMPR2_SMP3_2 ((uint32_t)0x00000800) /*!<Bit 2 */
  1194. #define ADC_SMPR2_SMP4 ((uint32_t)0x00007000) /*!<SMP4[2:0] bits (Channel 4 Sample time selection) */
  1195. #define ADC_SMPR2_SMP4_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  1196. #define ADC_SMPR2_SMP4_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  1197. #define ADC_SMPR2_SMP4_2 ((uint32_t)0x00004000) /*!<Bit 2 */
  1198. #define ADC_SMPR2_SMP5 ((uint32_t)0x00038000) /*!<SMP5[2:0] bits (Channel 5 Sample time selection) */
  1199. #define ADC_SMPR2_SMP5_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  1200. #define ADC_SMPR2_SMP5_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  1201. #define ADC_SMPR2_SMP5_2 ((uint32_t)0x00020000) /*!<Bit 2 */
  1202. #define ADC_SMPR2_SMP6 ((uint32_t)0x001C0000) /*!<SMP6[2:0] bits (Channel 6 Sample time selection) */
  1203. #define ADC_SMPR2_SMP6_0 ((uint32_t)0x00040000) /*!<Bit 0 */
  1204. #define ADC_SMPR2_SMP6_1 ((uint32_t)0x00080000) /*!<Bit 1 */
  1205. #define ADC_SMPR2_SMP6_2 ((uint32_t)0x00100000) /*!<Bit 2 */
  1206. #define ADC_SMPR2_SMP7 ((uint32_t)0x00E00000) /*!<SMP7[2:0] bits (Channel 7 Sample time selection) */
  1207. #define ADC_SMPR2_SMP7_0 ((uint32_t)0x00200000) /*!<Bit 0 */
  1208. #define ADC_SMPR2_SMP7_1 ((uint32_t)0x00400000) /*!<Bit 1 */
  1209. #define ADC_SMPR2_SMP7_2 ((uint32_t)0x00800000) /*!<Bit 2 */
  1210. #define ADC_SMPR2_SMP8 ((uint32_t)0x07000000) /*!<SMP8[2:0] bits (Channel 8 Sample time selection) */
  1211. #define ADC_SMPR2_SMP8_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  1212. #define ADC_SMPR2_SMP8_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  1213. #define ADC_SMPR2_SMP8_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  1214. #define ADC_SMPR2_SMP9 ((uint32_t)0x38000000) /*!<SMP9[2:0] bits (Channel 9 Sample time selection) */
  1215. #define ADC_SMPR2_SMP9_0 ((uint32_t)0x08000000) /*!<Bit 0 */
  1216. #define ADC_SMPR2_SMP9_1 ((uint32_t)0x10000000) /*!<Bit 1 */
  1217. #define ADC_SMPR2_SMP9_2 ((uint32_t)0x20000000) /*!<Bit 2 */
  1218. /****************** Bit definition for ADC_JOFR1 register *******************/
  1219. #define ADC_JOFR1_JOFFSET1 ((uint32_t)0x0FFF) /*!<Data offset for injected channel 1 */
  1220. /****************** Bit definition for ADC_JOFR2 register *******************/
  1221. #define ADC_JOFR2_JOFFSET2 ((uint32_t)0x0FFF) /*!<Data offset for injected channel 2 */
  1222. /****************** Bit definition for ADC_JOFR3 register *******************/
  1223. #define ADC_JOFR3_JOFFSET3 ((uint32_t)0x0FFF) /*!<Data offset for injected channel 3 */
  1224. /****************** Bit definition for ADC_JOFR4 register *******************/
  1225. #define ADC_JOFR4_JOFFSET4 ((uint32_t)0x0FFF) /*!<Data offset for injected channel 4 */
  1226. /******************* Bit definition for ADC_HTR register ********************/
  1227. #define ADC_HTR_HT ((uint32_t)0x0FFF) /*!<Analog watchdog high threshold */
  1228. /******************* Bit definition for ADC_LTR register ********************/
  1229. #define ADC_LTR_LT ((uint32_t)0x0FFF) /*!<Analog watchdog low threshold */
  1230. /******************* Bit definition for ADC_SQR1 register *******************/
  1231. #define ADC_SQR1_SQ13 ((uint32_t)0x0000001F) /*!<SQ13[4:0] bits (13th conversion in regular sequence) */
  1232. #define ADC_SQR1_SQ13_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1233. #define ADC_SQR1_SQ13_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1234. #define ADC_SQR1_SQ13_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1235. #define ADC_SQR1_SQ13_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  1236. #define ADC_SQR1_SQ13_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  1237. #define ADC_SQR1_SQ14 ((uint32_t)0x000003E0) /*!<SQ14[4:0] bits (14th conversion in regular sequence) */
  1238. #define ADC_SQR1_SQ14_0 ((uint32_t)0x00000020) /*!<Bit 0 */
  1239. #define ADC_SQR1_SQ14_1 ((uint32_t)0x00000040) /*!<Bit 1 */
  1240. #define ADC_SQR1_SQ14_2 ((uint32_t)0x00000080) /*!<Bit 2 */
  1241. #define ADC_SQR1_SQ14_3 ((uint32_t)0x00000100) /*!<Bit 3 */
  1242. #define ADC_SQR1_SQ14_4 ((uint32_t)0x00000200) /*!<Bit 4 */
  1243. #define ADC_SQR1_SQ15 ((uint32_t)0x00007C00) /*!<SQ15[4:0] bits (15th conversion in regular sequence) */
  1244. #define ADC_SQR1_SQ15_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  1245. #define ADC_SQR1_SQ15_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  1246. #define ADC_SQR1_SQ15_2 ((uint32_t)0x00001000) /*!<Bit 2 */
  1247. #define ADC_SQR1_SQ15_3 ((uint32_t)0x00002000) /*!<Bit 3 */
  1248. #define ADC_SQR1_SQ15_4 ((uint32_t)0x00004000) /*!<Bit 4 */
  1249. #define ADC_SQR1_SQ16 ((uint32_t)0x000F8000) /*!<SQ16[4:0] bits (16th conversion in regular sequence) */
  1250. #define ADC_SQR1_SQ16_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  1251. #define ADC_SQR1_SQ16_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  1252. #define ADC_SQR1_SQ16_2 ((uint32_t)0x00020000) /*!<Bit 2 */
  1253. #define ADC_SQR1_SQ16_3 ((uint32_t)0x00040000) /*!<Bit 3 */
  1254. #define ADC_SQR1_SQ16_4 ((uint32_t)0x00080000) /*!<Bit 4 */
  1255. #define ADC_SQR1_L ((uint32_t)0x00F00000) /*!<L[3:0] bits (Regular channel sequence length) */
  1256. #define ADC_SQR1_L_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  1257. #define ADC_SQR1_L_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  1258. #define ADC_SQR1_L_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  1259. #define ADC_SQR1_L_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  1260. /******************* Bit definition for ADC_SQR2 register *******************/
  1261. #define ADC_SQR2_SQ7 ((uint32_t)0x0000001F) /*!<SQ7[4:0] bits (7th conversion in regular sequence) */
  1262. #define ADC_SQR2_SQ7_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1263. #define ADC_SQR2_SQ7_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1264. #define ADC_SQR2_SQ7_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1265. #define ADC_SQR2_SQ7_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  1266. #define ADC_SQR2_SQ7_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  1267. #define ADC_SQR2_SQ8 ((uint32_t)0x000003E0) /*!<SQ8[4:0] bits (8th conversion in regular sequence) */
  1268. #define ADC_SQR2_SQ8_0 ((uint32_t)0x00000020) /*!<Bit 0 */
  1269. #define ADC_SQR2_SQ8_1 ((uint32_t)0x00000040) /*!<Bit 1 */
  1270. #define ADC_SQR2_SQ8_2 ((uint32_t)0x00000080) /*!<Bit 2 */
  1271. #define ADC_SQR2_SQ8_3 ((uint32_t)0x00000100) /*!<Bit 3 */
  1272. #define ADC_SQR2_SQ8_4 ((uint32_t)0x00000200) /*!<Bit 4 */
  1273. #define ADC_SQR2_SQ9 ((uint32_t)0x00007C00) /*!<SQ9[4:0] bits (9th conversion in regular sequence) */
  1274. #define ADC_SQR2_SQ9_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  1275. #define ADC_SQR2_SQ9_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  1276. #define ADC_SQR2_SQ9_2 ((uint32_t)0x00001000) /*!<Bit 2 */
  1277. #define ADC_SQR2_SQ9_3 ((uint32_t)0x00002000) /*!<Bit 3 */
  1278. #define ADC_SQR2_SQ9_4 ((uint32_t)0x00004000) /*!<Bit 4 */
  1279. #define ADC_SQR2_SQ10 ((uint32_t)0x000F8000) /*!<SQ10[4:0] bits (10th conversion in regular sequence) */
  1280. #define ADC_SQR2_SQ10_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  1281. #define ADC_SQR2_SQ10_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  1282. #define ADC_SQR2_SQ10_2 ((uint32_t)0x00020000) /*!<Bit 2 */
  1283. #define ADC_SQR2_SQ10_3 ((uint32_t)0x00040000) /*!<Bit 3 */
  1284. #define ADC_SQR2_SQ10_4 ((uint32_t)0x00080000) /*!<Bit 4 */
  1285. #define ADC_SQR2_SQ11 ((uint32_t)0x01F00000) /*!<SQ11[4:0] bits (11th conversion in regular sequence) */
  1286. #define ADC_SQR2_SQ11_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  1287. #define ADC_SQR2_SQ11_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  1288. #define ADC_SQR2_SQ11_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  1289. #define ADC_SQR2_SQ11_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  1290. #define ADC_SQR2_SQ11_4 ((uint32_t)0x01000000) /*!<Bit 4 */
  1291. #define ADC_SQR2_SQ12 ((uint32_t)0x3E000000) /*!<SQ12[4:0] bits (12th conversion in regular sequence) */
  1292. #define ADC_SQR2_SQ12_0 ((uint32_t)0x02000000) /*!<Bit 0 */
  1293. #define ADC_SQR2_SQ12_1 ((uint32_t)0x04000000) /*!<Bit 1 */
  1294. #define ADC_SQR2_SQ12_2 ((uint32_t)0x08000000) /*!<Bit 2 */
  1295. #define ADC_SQR2_SQ12_3 ((uint32_t)0x10000000) /*!<Bit 3 */
  1296. #define ADC_SQR2_SQ12_4 ((uint32_t)0x20000000) /*!<Bit 4 */
  1297. /******************* Bit definition for ADC_SQR3 register *******************/
  1298. #define ADC_SQR3_SQ1 ((uint32_t)0x0000001F) /*!<SQ1[4:0] bits (1st conversion in regular sequence) */
  1299. #define ADC_SQR3_SQ1_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1300. #define ADC_SQR3_SQ1_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1301. #define ADC_SQR3_SQ1_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1302. #define ADC_SQR3_SQ1_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  1303. #define ADC_SQR3_SQ1_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  1304. #define ADC_SQR3_SQ2 ((uint32_t)0x000003E0) /*!<SQ2[4:0] bits (2nd conversion in regular sequence) */
  1305. #define ADC_SQR3_SQ2_0 ((uint32_t)0x00000020) /*!<Bit 0 */
  1306. #define ADC_SQR3_SQ2_1 ((uint32_t)0x00000040) /*!<Bit 1 */
  1307. #define ADC_SQR3_SQ2_2 ((uint32_t)0x00000080) /*!<Bit 2 */
  1308. #define ADC_SQR3_SQ2_3 ((uint32_t)0x00000100) /*!<Bit 3 */
  1309. #define ADC_SQR3_SQ2_4 ((uint32_t)0x00000200) /*!<Bit 4 */
  1310. #define ADC_SQR3_SQ3 ((uint32_t)0x00007C00) /*!<SQ3[4:0] bits (3rd conversion in regular sequence) */
  1311. #define ADC_SQR3_SQ3_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  1312. #define ADC_SQR3_SQ3_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  1313. #define ADC_SQR3_SQ3_2 ((uint32_t)0x00001000) /*!<Bit 2 */
  1314. #define ADC_SQR3_SQ3_3 ((uint32_t)0x00002000) /*!<Bit 3 */
  1315. #define ADC_SQR3_SQ3_4 ((uint32_t)0x00004000) /*!<Bit 4 */
  1316. #define ADC_SQR3_SQ4 ((uint32_t)0x000F8000) /*!<SQ4[4:0] bits (4th conversion in regular sequence) */
  1317. #define ADC_SQR3_SQ4_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  1318. #define ADC_SQR3_SQ4_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  1319. #define ADC_SQR3_SQ4_2 ((uint32_t)0x00020000) /*!<Bit 2 */
  1320. #define ADC_SQR3_SQ4_3 ((uint32_t)0x00040000) /*!<Bit 3 */
  1321. #define ADC_SQR3_SQ4_4 ((uint32_t)0x00080000) /*!<Bit 4 */
  1322. #define ADC_SQR3_SQ5 ((uint32_t)0x01F00000) /*!<SQ5[4:0] bits (5th conversion in regular sequence) */
  1323. #define ADC_SQR3_SQ5_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  1324. #define ADC_SQR3_SQ5_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  1325. #define ADC_SQR3_SQ5_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  1326. #define ADC_SQR3_SQ5_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  1327. #define ADC_SQR3_SQ5_4 ((uint32_t)0x01000000) /*!<Bit 4 */
  1328. #define ADC_SQR3_SQ6 ((uint32_t)0x3E000000) /*!<SQ6[4:0] bits (6th conversion in regular sequence) */
  1329. #define ADC_SQR3_SQ6_0 ((uint32_t)0x02000000) /*!<Bit 0 */
  1330. #define ADC_SQR3_SQ6_1 ((uint32_t)0x04000000) /*!<Bit 1 */
  1331. #define ADC_SQR3_SQ6_2 ((uint32_t)0x08000000) /*!<Bit 2 */
  1332. #define ADC_SQR3_SQ6_3 ((uint32_t)0x10000000) /*!<Bit 3 */
  1333. #define ADC_SQR3_SQ6_4 ((uint32_t)0x20000000) /*!<Bit 4 */
  1334. /******************* Bit definition for ADC_JSQR register *******************/
  1335. #define ADC_JSQR_JSQ1 ((uint32_t)0x0000001F) /*!<JSQ1[4:0] bits (1st conversion in injected sequence) */
  1336. #define ADC_JSQR_JSQ1_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1337. #define ADC_JSQR_JSQ1_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1338. #define ADC_JSQR_JSQ1_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1339. #define ADC_JSQR_JSQ1_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  1340. #define ADC_JSQR_JSQ1_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  1341. #define ADC_JSQR_JSQ2 ((uint32_t)0x000003E0) /*!<JSQ2[4:0] bits (2nd conversion in injected sequence) */
  1342. #define ADC_JSQR_JSQ2_0 ((uint32_t)0x00000020) /*!<Bit 0 */
  1343. #define ADC_JSQR_JSQ2_1 ((uint32_t)0x00000040) /*!<Bit 1 */
  1344. #define ADC_JSQR_JSQ2_2 ((uint32_t)0x00000080) /*!<Bit 2 */
  1345. #define ADC_JSQR_JSQ2_3 ((uint32_t)0x00000100) /*!<Bit 3 */
  1346. #define ADC_JSQR_JSQ2_4 ((uint32_t)0x00000200) /*!<Bit 4 */
  1347. #define ADC_JSQR_JSQ3 ((uint32_t)0x00007C00) /*!<JSQ3[4:0] bits (3rd conversion in injected sequence) */
  1348. #define ADC_JSQR_JSQ3_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  1349. #define ADC_JSQR_JSQ3_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  1350. #define ADC_JSQR_JSQ3_2 ((uint32_t)0x00001000) /*!<Bit 2 */
  1351. #define ADC_JSQR_JSQ3_3 ((uint32_t)0x00002000) /*!<Bit 3 */
  1352. #define ADC_JSQR_JSQ3_4 ((uint32_t)0x00004000) /*!<Bit 4 */
  1353. #define ADC_JSQR_JSQ4 ((uint32_t)0x000F8000) /*!<JSQ4[4:0] bits (4th conversion in injected sequence) */
  1354. #define ADC_JSQR_JSQ4_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  1355. #define ADC_JSQR_JSQ4_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  1356. #define ADC_JSQR_JSQ4_2 ((uint32_t)0x00020000) /*!<Bit 2 */
  1357. #define ADC_JSQR_JSQ4_3 ((uint32_t)0x00040000) /*!<Bit 3 */
  1358. #define ADC_JSQR_JSQ4_4 ((uint32_t)0x00080000) /*!<Bit 4 */
  1359. #define ADC_JSQR_JL ((uint32_t)0x00300000) /*!<JL[1:0] bits (Injected Sequence length) */
  1360. #define ADC_JSQR_JL_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  1361. #define ADC_JSQR_JL_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  1362. /******************* Bit definition for ADC_JDR1 register *******************/
  1363. #define ADC_JDR1_JDATA ((uint32_t)0xFFFF) /*!<Injected data */
  1364. /******************* Bit definition for ADC_JDR2 register *******************/
  1365. #define ADC_JDR2_JDATA ((uint32_t)0xFFFF) /*!<Injected data */
  1366. /******************* Bit definition for ADC_JDR3 register *******************/
  1367. #define ADC_JDR3_JDATA ((uint32_t)0xFFFF) /*!<Injected data */
  1368. /******************* Bit definition for ADC_JDR4 register *******************/
  1369. #define ADC_JDR4_JDATA ((uint32_t)0xFFFF) /*!<Injected data */
  1370. /******************** Bit definition for ADC_DR register ********************/
  1371. #define ADC_DR_DATA ((uint32_t)0x0000FFFF) /*!<Regular data */
  1372. #define ADC_DR_ADC2DATA ((uint32_t)0xFFFF0000) /*!<ADC2 data */
  1373. /******************* Bit definition for ADC_CSR register ********************/
  1374. #define ADC_CSR_AWD1 ((uint32_t)0x00000001) /*!<ADC1 Analog watchdog flag */
  1375. #define ADC_CSR_EOC1 ((uint32_t)0x00000002) /*!<ADC1 End of conversion */
  1376. #define ADC_CSR_JEOC1 ((uint32_t)0x00000004) /*!<ADC1 Injected channel end of conversion */
  1377. #define ADC_CSR_JSTRT1 ((uint32_t)0x00000008) /*!<ADC1 Injected channel Start flag */
  1378. #define ADC_CSR_STRT1 ((uint32_t)0x00000010) /*!<ADC1 Regular channel Start flag */
  1379. #define ADC_CSR_DOVR1 ((uint32_t)0x00000020) /*!<ADC1 DMA overrun flag */
  1380. #define ADC_CSR_AWD2 ((uint32_t)0x00000100) /*!<ADC2 Analog watchdog flag */
  1381. #define ADC_CSR_EOC2 ((uint32_t)0x00000200) /*!<ADC2 End of conversion */
  1382. #define ADC_CSR_JEOC2 ((uint32_t)0x00000400) /*!<ADC2 Injected channel end of conversion */
  1383. #define ADC_CSR_JSTRT2 ((uint32_t)0x00000800) /*!<ADC2 Injected channel Start flag */
  1384. #define ADC_CSR_STRT2 ((uint32_t)0x00001000) /*!<ADC2 Regular channel Start flag */
  1385. #define ADC_CSR_DOVR2 ((uint32_t)0x00002000) /*!<ADC2 DMA overrun flag */
  1386. #define ADC_CSR_AWD3 ((uint32_t)0x00010000) /*!<ADC3 Analog watchdog flag */
  1387. #define ADC_CSR_EOC3 ((uint32_t)0x00020000) /*!<ADC3 End of conversion */
  1388. #define ADC_CSR_JEOC3 ((uint32_t)0x00040000) /*!<ADC3 Injected channel end of conversion */
  1389. #define ADC_CSR_JSTRT3 ((uint32_t)0x00080000) /*!<ADC3 Injected channel Start flag */
  1390. #define ADC_CSR_STRT3 ((uint32_t)0x00100000) /*!<ADC3 Regular channel Start flag */
  1391. #define ADC_CSR_DOVR3 ((uint32_t)0x00200000) /*!<ADC3 DMA overrun flag */
  1392. /******************* Bit definition for ADC_CCR register ********************/
  1393. #define ADC_CCR_MULTI ((uint32_t)0x0000001F) /*!<MULTI[4:0] bits (Multi-ADC mode selection) */
  1394. #define ADC_CCR_MULTI_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  1395. #define ADC_CCR_MULTI_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  1396. #define ADC_CCR_MULTI_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  1397. #define ADC_CCR_MULTI_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  1398. #define ADC_CCR_MULTI_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  1399. #define ADC_CCR_DELAY ((uint32_t)0x00000F00) /*!<DELAY[3:0] bits (Delay between 2 sampling phases) */
  1400. #define ADC_CCR_DELAY_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  1401. #define ADC_CCR_DELAY_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  1402. #define ADC_CCR_DELAY_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  1403. #define ADC_CCR_DELAY_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  1404. #define ADC_CCR_DDS ((uint32_t)0x00002000) /*!<DMA disable selection (Multi-ADC mode) */
  1405. #define ADC_CCR_DMA ((uint32_t)0x0000C000) /*!<DMA[1:0] bits (Direct Memory Access mode for multimode) */
  1406. #define ADC_CCR_DMA_0 ((uint32_t)0x00004000) /*!<Bit 0 */
  1407. #define ADC_CCR_DMA_1 ((uint32_t)0x00008000) /*!<Bit 1 */
  1408. #define ADC_CCR_ADCPRE ((uint32_t)0x00030000) /*!<ADCPRE[1:0] bits (ADC prescaler) */
  1409. #define ADC_CCR_ADCPRE_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  1410. #define ADC_CCR_ADCPRE_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  1411. #define ADC_CCR_VBATE ((uint32_t)0x00400000) /*!<VBAT Enable */
  1412. #define ADC_CCR_TSVREFE ((uint32_t)0x00800000) /*!<Temperature Sensor and VREFINT Enable */
  1413. /******************* Bit definition for ADC_CDR register ********************/
  1414. #define ADC_CDR_DATA1 ((uint32_t)0x0000FFFF) /*!<1st data of a pair of regular conversions */
  1415. #define ADC_CDR_DATA2 ((uint32_t)0xFFFF0000) /*!<2nd data of a pair of regular conversions */
  1416. /******************************************************************************/
  1417. /* */
  1418. /* Controller Area Network */
  1419. /* */
  1420. /******************************************************************************/
  1421. /*!<CAN control and status registers */
  1422. /******************* Bit definition for CAN_MCR register ********************/
  1423. #define CAN_MCR_INRQ ((uint32_t)0x00000001) /*!<Initialization Request */
  1424. #define CAN_MCR_SLEEP ((uint32_t)0x00000002) /*!<Sleep Mode Request */
  1425. #define CAN_MCR_TXFP ((uint32_t)0x00000004) /*!<Transmit FIFO Priority */
  1426. #define CAN_MCR_RFLM ((uint32_t)0x00000008) /*!<Receive FIFO Locked Mode */
  1427. #define CAN_MCR_NART ((uint32_t)0x00000010) /*!<No Automatic Retransmission */
  1428. #define CAN_MCR_AWUM ((uint32_t)0x00000020) /*!<Automatic Wakeup Mode */
  1429. #define CAN_MCR_ABOM ((uint32_t)0x00000040) /*!<Automatic Bus-Off Management */
  1430. #define CAN_MCR_TTCM ((uint32_t)0x00000080) /*!<Time Triggered Communication Mode */
  1431. #define CAN_MCR_RESET ((uint32_t)0x00008000) /*!<bxCAN software master reset */
  1432. #define CAN_MCR_DBF ((uint32_t)0x00010000) /*!<bxCAN Debug freeze */
  1433. /******************* Bit definition for CAN_MSR register ********************/
  1434. #define CAN_MSR_INAK ((uint32_t)0x0001) /*!<Initialization Acknowledge */
  1435. #define CAN_MSR_SLAK ((uint32_t)0x0002) /*!<Sleep Acknowledge */
  1436. #define CAN_MSR_ERRI ((uint32_t)0x0004) /*!<Error Interrupt */
  1437. #define CAN_MSR_WKUI ((uint32_t)0x0008) /*!<Wakeup Interrupt */
  1438. #define CAN_MSR_SLAKI ((uint32_t)0x0010) /*!<Sleep Acknowledge Interrupt */
  1439. #define CAN_MSR_TXM ((uint32_t)0x0100) /*!<Transmit Mode */
  1440. #define CAN_MSR_RXM ((uint32_t)0x0200) /*!<Receive Mode */
  1441. #define CAN_MSR_SAMP ((uint32_t)0x0400) /*!<Last Sample Point */
  1442. #define CAN_MSR_RX ((uint32_t)0x0800) /*!<CAN Rx Signal */
  1443. /******************* Bit definition for CAN_TSR register ********************/
  1444. #define CAN_TSR_RQCP0 ((uint32_t)0x00000001) /*!<Request Completed Mailbox0 */
  1445. #define CAN_TSR_TXOK0 ((uint32_t)0x00000002) /*!<Transmission OK of Mailbox0 */
  1446. #define CAN_TSR_ALST0 ((uint32_t)0x00000004) /*!<Arbitration Lost for Mailbox0 */
  1447. #define CAN_TSR_TERR0 ((uint32_t)0x00000008) /*!<Transmission Error of Mailbox0 */
  1448. #define CAN_TSR_ABRQ0 ((uint32_t)0x00000080) /*!<Abort Request for Mailbox0 */
  1449. #define CAN_TSR_RQCP1 ((uint32_t)0x00000100) /*!<Request Completed Mailbox1 */
  1450. #define CAN_TSR_TXOK1 ((uint32_t)0x00000200) /*!<Transmission OK of Mailbox1 */
  1451. #define CAN_TSR_ALST1 ((uint32_t)0x00000400) /*!<Arbitration Lost for Mailbox1 */
  1452. #define CAN_TSR_TERR1 ((uint32_t)0x00000800) /*!<Transmission Error of Mailbox1 */
  1453. #define CAN_TSR_ABRQ1 ((uint32_t)0x00008000) /*!<Abort Request for Mailbox 1 */
  1454. #define CAN_TSR_RQCP2 ((uint32_t)0x00010000) /*!<Request Completed Mailbox2 */
  1455. #define CAN_TSR_TXOK2 ((uint32_t)0x00020000) /*!<Transmission OK of Mailbox 2 */
  1456. #define CAN_TSR_ALST2 ((uint32_t)0x00040000) /*!<Arbitration Lost for mailbox 2 */
  1457. #define CAN_TSR_TERR2 ((uint32_t)0x00080000) /*!<Transmission Error of Mailbox 2 */
  1458. #define CAN_TSR_ABRQ2 ((uint32_t)0x00800000) /*!<Abort Request for Mailbox 2 */
  1459. #define CAN_TSR_CODE ((uint32_t)0x03000000) /*!<Mailbox Code */
  1460. #define CAN_TSR_TME ((uint32_t)0x1C000000) /*!<TME[2:0] bits */
  1461. #define CAN_TSR_TME0 ((uint32_t)0x04000000) /*!<Transmit Mailbox 0 Empty */
  1462. #define CAN_TSR_TME1 ((uint32_t)0x08000000) /*!<Transmit Mailbox 1 Empty */
  1463. #define CAN_TSR_TME2 ((uint32_t)0x10000000) /*!<Transmit Mailbox 2 Empty */
  1464. #define CAN_TSR_LOW ((uint32_t)0xE0000000) /*!<LOW[2:0] bits */
  1465. #define CAN_TSR_LOW0 ((uint32_t)0x20000000) /*!<Lowest Priority Flag for Mailbox 0 */
  1466. #define CAN_TSR_LOW1 ((uint32_t)0x40000000) /*!<Lowest Priority Flag for Mailbox 1 */
  1467. #define CAN_TSR_LOW2 ((uint32_t)0x80000000) /*!<Lowest Priority Flag for Mailbox 2 */
  1468. /******************* Bit definition for CAN_RF0R register *******************/
  1469. #define CAN_RF0R_FMP0 ((uint32_t)0x03) /*!<FIFO 0 Message Pending */
  1470. #define CAN_RF0R_FULL0 ((uint32_t)0x08) /*!<FIFO 0 Full */
  1471. #define CAN_RF0R_FOVR0 ((uint32_t)0x10) /*!<FIFO 0 Overrun */
  1472. #define CAN_RF0R_RFOM0 ((uint32_t)0x20) /*!<Release FIFO 0 Output Mailbox */
  1473. /******************* Bit definition for CAN_RF1R register *******************/
  1474. #define CAN_RF1R_FMP1 ((uint32_t)0x03) /*!<FIFO 1 Message Pending */
  1475. #define CAN_RF1R_FULL1 ((uint32_t)0x08) /*!<FIFO 1 Full */
  1476. #define CAN_RF1R_FOVR1 ((uint32_t)0x10) /*!<FIFO 1 Overrun */
  1477. #define CAN_RF1R_RFOM1 ((uint32_t)0x20) /*!<Release FIFO 1 Output Mailbox */
  1478. /******************** Bit definition for CAN_IER register *******************/
  1479. #define CAN_IER_TMEIE ((uint32_t)0x00000001) /*!<Transmit Mailbox Empty Interrupt Enable */
  1480. #define CAN_IER_FMPIE0 ((uint32_t)0x00000002) /*!<FIFO Message Pending Interrupt Enable */
  1481. #define CAN_IER_FFIE0 ((uint32_t)0x00000004) /*!<FIFO Full Interrupt Enable */
  1482. #define CAN_IER_FOVIE0 ((uint32_t)0x00000008) /*!<FIFO Overrun Interrupt Enable */
  1483. #define CAN_IER_FMPIE1 ((uint32_t)0x00000010) /*!<FIFO Message Pending Interrupt Enable */
  1484. #define CAN_IER_FFIE1 ((uint32_t)0x00000020) /*!<FIFO Full Interrupt Enable */
  1485. #define CAN_IER_FOVIE1 ((uint32_t)0x00000040) /*!<FIFO Overrun Interrupt Enable */
  1486. #define CAN_IER_EWGIE ((uint32_t)0x00000100) /*!<Error Warning Interrupt Enable */
  1487. #define CAN_IER_EPVIE ((uint32_t)0x00000200) /*!<Error Passive Interrupt Enable */
  1488. #define CAN_IER_BOFIE ((uint32_t)0x00000400) /*!<Bus-Off Interrupt Enable */
  1489. #define CAN_IER_LECIE ((uint32_t)0x00000800) /*!<Last Error Code Interrupt Enable */
  1490. #define CAN_IER_ERRIE ((uint32_t)0x00008000) /*!<Error Interrupt Enable */
  1491. #define CAN_IER_WKUIE ((uint32_t)0x00010000) /*!<Wakeup Interrupt Enable */
  1492. #define CAN_IER_SLKIE ((uint32_t)0x00020000) /*!<Sleep Interrupt Enable */
  1493. #define CAN_IER_EWGIE ((uint32_t)0x00000100) /*!<Error warning interrupt enable */
  1494. #define CAN_IER_EPVIE ((uint32_t)0x00000200) /*!<Error passive interrupt enable */
  1495. #define CAN_IER_BOFIE ((uint32_t)0x00000400) /*!<Bus-off interrupt enable */
  1496. #define CAN_IER_LECIE ((uint32_t)0x00000800) /*!<Last error code interrupt enable */
  1497. #define CAN_IER_ERRIE ((uint32_t)0x00008000) /*!<Error interrupt enable */
  1498. /******************** Bit definition for CAN_ESR register *******************/
  1499. #define CAN_ESR_EWGF ((uint32_t)0x00000001) /*!<Error Warning Flag */
  1500. #define CAN_ESR_EPVF ((uint32_t)0x00000002) /*!<Error Passive Flag */
  1501. #define CAN_ESR_BOFF ((uint32_t)0x00000004) /*!<Bus-Off Flag */
  1502. #define CAN_ESR_LEC ((uint32_t)0x00000070) /*!<LEC[2:0] bits (Last Error Code) */
  1503. #define CAN_ESR_LEC_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  1504. #define CAN_ESR_LEC_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  1505. #define CAN_ESR_LEC_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  1506. #define CAN_ESR_TEC ((uint32_t)0x00FF0000) /*!<Least significant byte of the 9-bit Transmit Error Counter */
  1507. #define CAN_ESR_REC ((uint32_t)0xFF000000) /*!<Receive Error Counter */
  1508. /******************* Bit definition for CAN_BTR register ********************/
  1509. #define CAN_BTR_BRP ((uint32_t)0x000003FF) /*!<Baud Rate Prescaler */
  1510. #define CAN_BTR_TS1 ((uint32_t)0x000F0000) /*!<Time Segment 1 */
  1511. #define CAN_BTR_TS1_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  1512. #define CAN_BTR_TS1_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  1513. #define CAN_BTR_TS1_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  1514. #define CAN_BTR_TS1_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  1515. #define CAN_BTR_TS2 ((uint32_t)0x00700000) /*!<Time Segment 2 */
  1516. #define CAN_BTR_TS2_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  1517. #define CAN_BTR_TS2_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  1518. #define CAN_BTR_TS2_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  1519. #define CAN_BTR_SJW ((uint32_t)0x03000000) /*!<Resynchronization Jump Width */
  1520. #define CAN_BTR_SJW_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  1521. #define CAN_BTR_SJW_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  1522. #define CAN_BTR_LBKM ((uint32_t)0x40000000) /*!<Loop Back Mode (Debug) */
  1523. #define CAN_BTR_SILM ((uint32_t)0x80000000) /*!<Silent Mode */
  1524. /*!<Mailbox registers */
  1525. /****************** Bit definition for CAN_TI0R register ********************/
  1526. #define CAN_TI0R_TXRQ ((uint32_t)0x00000001) /*!<Transmit Mailbox Request */
  1527. #define CAN_TI0R_RTR ((uint32_t)0x00000002) /*!<Remote Transmission Request */
  1528. #define CAN_TI0R_IDE ((uint32_t)0x00000004) /*!<Identifier Extension */
  1529. #define CAN_TI0R_EXID ((uint32_t)0x001FFFF8) /*!<Extended Identifier */
  1530. #define CAN_TI0R_STID ((uint32_t)0xFFE00000) /*!<Standard Identifier or Extended Identifier */
  1531. /****************** Bit definition for CAN_TDT0R register *******************/
  1532. #define CAN_TDT0R_DLC ((uint32_t)0x0000000F) /*!<Data Length Code */
  1533. #define CAN_TDT0R_TGT ((uint32_t)0x00000100) /*!<Transmit Global Time */
  1534. #define CAN_TDT0R_TIME ((uint32_t)0xFFFF0000) /*!<Message Time Stamp */
  1535. /****************** Bit definition for CAN_TDL0R register *******************/
  1536. #define CAN_TDL0R_DATA0 ((uint32_t)0x000000FF) /*!<Data byte 0 */
  1537. #define CAN_TDL0R_DATA1 ((uint32_t)0x0000FF00) /*!<Data byte 1 */
  1538. #define CAN_TDL0R_DATA2 ((uint32_t)0x00FF0000) /*!<Data byte 2 */
  1539. #define CAN_TDL0R_DATA3 ((uint32_t)0xFF000000) /*!<Data byte 3 */
  1540. /****************** Bit definition for CAN_TDH0R register *******************/
  1541. #define CAN_TDH0R_DATA4 ((uint32_t)0x000000FF) /*!<Data byte 4 */
  1542. #define CAN_TDH0R_DATA5 ((uint32_t)0x0000FF00) /*!<Data byte 5 */
  1543. #define CAN_TDH0R_DATA6 ((uint32_t)0x00FF0000) /*!<Data byte 6 */
  1544. #define CAN_TDH0R_DATA7 ((uint32_t)0xFF000000) /*!<Data byte 7 */
  1545. /******************* Bit definition for CAN_TI1R register *******************/
  1546. #define CAN_TI1R_TXRQ ((uint32_t)0x00000001) /*!<Transmit Mailbox Request */
  1547. #define CAN_TI1R_RTR ((uint32_t)0x00000002) /*!<Remote Transmission Request */
  1548. #define CAN_TI1R_IDE ((uint32_t)0x00000004) /*!<Identifier Extension */
  1549. #define CAN_TI1R_EXID ((uint32_t)0x001FFFF8) /*!<Extended Identifier */
  1550. #define CAN_TI1R_STID ((uint32_t)0xFFE00000) /*!<Standard Identifier or Extended Identifier */
  1551. /******************* Bit definition for CAN_TDT1R register ******************/
  1552. #define CAN_TDT1R_DLC ((uint32_t)0x0000000F) /*!<Data Length Code */
  1553. #define CAN_TDT1R_TGT ((uint32_t)0x00000100) /*!<Transmit Global Time */
  1554. #define CAN_TDT1R_TIME ((uint32_t)0xFFFF0000) /*!<Message Time Stamp */
  1555. /******************* Bit definition for CAN_TDL1R register ******************/
  1556. #define CAN_TDL1R_DATA0 ((uint32_t)0x000000FF) /*!<Data byte 0 */
  1557. #define CAN_TDL1R_DATA1 ((uint32_t)0x0000FF00) /*!<Data byte 1 */
  1558. #define CAN_TDL1R_DATA2 ((uint32_t)0x00FF0000) /*!<Data byte 2 */
  1559. #define CAN_TDL1R_DATA3 ((uint32_t)0xFF000000) /*!<Data byte 3 */
  1560. /******************* Bit definition for CAN_TDH1R register ******************/
  1561. #define CAN_TDH1R_DATA4 ((uint32_t)0x000000FF) /*!<Data byte 4 */
  1562. #define CAN_TDH1R_DATA5 ((uint32_t)0x0000FF00) /*!<Data byte 5 */
  1563. #define CAN_TDH1R_DATA6 ((uint32_t)0x00FF0000) /*!<Data byte 6 */
  1564. #define CAN_TDH1R_DATA7 ((uint32_t)0xFF000000) /*!<Data byte 7 */
  1565. /******************* Bit definition for CAN_TI2R register *******************/
  1566. #define CAN_TI2R_TXRQ ((uint32_t)0x00000001) /*!<Transmit Mailbox Request */
  1567. #define CAN_TI2R_RTR ((uint32_t)0x00000002) /*!<Remote Transmission Request */
  1568. #define CAN_TI2R_IDE ((uint32_t)0x00000004) /*!<Identifier Extension */
  1569. #define CAN_TI2R_EXID ((uint32_t)0x001FFFF8) /*!<Extended identifier */
  1570. #define CAN_TI2R_STID ((uint32_t)0xFFE00000) /*!<Standard Identifier or Extended Identifier */
  1571. /******************* Bit definition for CAN_TDT2R register ******************/
  1572. #define CAN_TDT2R_DLC ((uint32_t)0x0000000F) /*!<Data Length Code */
  1573. #define CAN_TDT2R_TGT ((uint32_t)0x00000100) /*!<Transmit Global Time */
  1574. #define CAN_TDT2R_TIME ((uint32_t)0xFFFF0000) /*!<Message Time Stamp */
  1575. /******************* Bit definition for CAN_TDL2R register ******************/
  1576. #define CAN_TDL2R_DATA0 ((uint32_t)0x000000FF) /*!<Data byte 0 */
  1577. #define CAN_TDL2R_DATA1 ((uint32_t)0x0000FF00) /*!<Data byte 1 */
  1578. #define CAN_TDL2R_DATA2 ((uint32_t)0x00FF0000) /*!<Data byte 2 */
  1579. #define CAN_TDL2R_DATA3 ((uint32_t)0xFF000000) /*!<Data byte 3 */
  1580. /******************* Bit definition for CAN_TDH2R register ******************/
  1581. #define CAN_TDH2R_DATA4 ((uint32_t)0x000000FF) /*!<Data byte 4 */
  1582. #define CAN_TDH2R_DATA5 ((uint32_t)0x0000FF00) /*!<Data byte 5 */
  1583. #define CAN_TDH2R_DATA6 ((uint32_t)0x00FF0000) /*!<Data byte 6 */
  1584. #define CAN_TDH2R_DATA7 ((uint32_t)0xFF000000) /*!<Data byte 7 */
  1585. /******************* Bit definition for CAN_RI0R register *******************/
  1586. #define CAN_RI0R_RTR ((uint32_t)0x00000002) /*!<Remote Transmission Request */
  1587. #define CAN_RI0R_IDE ((uint32_t)0x00000004) /*!<Identifier Extension */
  1588. #define CAN_RI0R_EXID ((uint32_t)0x001FFFF8) /*!<Extended Identifier */
  1589. #define CAN_RI0R_STID ((uint32_t)0xFFE00000) /*!<Standard Identifier or Extended Identifier */
  1590. /******************* Bit definition for CAN_RDT0R register ******************/
  1591. #define CAN_RDT0R_DLC ((uint32_t)0x0000000F) /*!<Data Length Code */
  1592. #define CAN_RDT0R_FMI ((uint32_t)0x0000FF00) /*!<Filter Match Index */
  1593. #define CAN_RDT0R_TIME ((uint32_t)0xFFFF0000) /*!<Message Time Stamp */
  1594. /******************* Bit definition for CAN_RDL0R register ******************/
  1595. #define CAN_RDL0R_DATA0 ((uint32_t)0x000000FF) /*!<Data byte 0 */
  1596. #define CAN_RDL0R_DATA1 ((uint32_t)0x0000FF00) /*!<Data byte 1 */
  1597. #define CAN_RDL0R_DATA2 ((uint32_t)0x00FF0000) /*!<Data byte 2 */
  1598. #define CAN_RDL0R_DATA3 ((uint32_t)0xFF000000) /*!<Data byte 3 */
  1599. /******************* Bit definition for CAN_RDH0R register ******************/
  1600. #define CAN_RDH0R_DATA4 ((uint32_t)0x000000FF) /*!<Data byte 4 */
  1601. #define CAN_RDH0R_DATA5 ((uint32_t)0x0000FF00) /*!<Data byte 5 */
  1602. #define CAN_RDH0R_DATA6 ((uint32_t)0x00FF0000) /*!<Data byte 6 */
  1603. #define CAN_RDH0R_DATA7 ((uint32_t)0xFF000000) /*!<Data byte 7 */
  1604. /******************* Bit definition for CAN_RI1R register *******************/
  1605. #define CAN_RI1R_RTR ((uint32_t)0x00000002) /*!<Remote Transmission Request */
  1606. #define CAN_RI1R_IDE ((uint32_t)0x00000004) /*!<Identifier Extension */
  1607. #define CAN_RI1R_EXID ((uint32_t)0x001FFFF8) /*!<Extended identifier */
  1608. #define CAN_RI1R_STID ((uint32_t)0xFFE00000) /*!<Standard Identifier or Extended Identifier */
  1609. /******************* Bit definition for CAN_RDT1R register ******************/
  1610. #define CAN_RDT1R_DLC ((uint32_t)0x0000000F) /*!<Data Length Code */
  1611. #define CAN_RDT1R_FMI ((uint32_t)0x0000FF00) /*!<Filter Match Index */
  1612. #define CAN_RDT1R_TIME ((uint32_t)0xFFFF0000) /*!<Message Time Stamp */
  1613. /******************* Bit definition for CAN_RDL1R register ******************/
  1614. #define CAN_RDL1R_DATA0 ((uint32_t)0x000000FF) /*!<Data byte 0 */
  1615. #define CAN_RDL1R_DATA1 ((uint32_t)0x0000FF00) /*!<Data byte 1 */
  1616. #define CAN_RDL1R_DATA2 ((uint32_t)0x00FF0000) /*!<Data byte 2 */
  1617. #define CAN_RDL1R_DATA3 ((uint32_t)0xFF000000) /*!<Data byte 3 */
  1618. /******************* Bit definition for CAN_RDH1R register ******************/
  1619. #define CAN_RDH1R_DATA4 ((uint32_t)0x000000FF) /*!<Data byte 4 */
  1620. #define CAN_RDH1R_DATA5 ((uint32_t)0x0000FF00) /*!<Data byte 5 */
  1621. #define CAN_RDH1R_DATA6 ((uint32_t)0x00FF0000) /*!<Data byte 6 */
  1622. #define CAN_RDH1R_DATA7 ((uint32_t)0xFF000000) /*!<Data byte 7 */
  1623. /*!<CAN filter registers */
  1624. /******************* Bit definition for CAN_FMR register ********************/
  1625. #define CAN_FMR_FINIT ((uint32_t)0x01) /*!<Filter Init Mode */
  1626. #define CAN_FMR_CAN2SB ((uint32_t)0x00003F00) /*!<CAN2 start bank */
  1627. /******************* Bit definition for CAN_FM1R register *******************/
  1628. #define CAN_FM1R_FBM ((uint32_t)0x0FFFFFFF) /*!<Filter Mode */
  1629. #define CAN_FM1R_FBM0 ((uint32_t)0x00000001) /*!<Filter Init Mode bit 0 */
  1630. #define CAN_FM1R_FBM1 ((uint32_t)0x00000002) /*!<Filter Init Mode bit 1 */
  1631. #define CAN_FM1R_FBM2 ((uint32_t)0x00000004) /*!<Filter Init Mode bit 2 */
  1632. #define CAN_FM1R_FBM3 ((uint32_t)0x00000008) /*!<Filter Init Mode bit 3 */
  1633. #define CAN_FM1R_FBM4 ((uint32_t)0x00000010) /*!<Filter Init Mode bit 4 */
  1634. #define CAN_FM1R_FBM5 ((uint32_t)0x00000020) /*!<Filter Init Mode bit 5 */
  1635. #define CAN_FM1R_FBM6 ((uint32_t)0x00000040) /*!<Filter Init Mode bit 6 */
  1636. #define CAN_FM1R_FBM7 ((uint32_t)0x00000080) /*!<Filter Init Mode bit 7 */
  1637. #define CAN_FM1R_FBM8 ((uint32_t)0x00000100) /*!<Filter Init Mode bit 8 */
  1638. #define CAN_FM1R_FBM9 ((uint32_t)0x00000200) /*!<Filter Init Mode bit 9 */
  1639. #define CAN_FM1R_FBM10 ((uint32_t)0x00000400) /*!<Filter Init Mode bit 10 */
  1640. #define CAN_FM1R_FBM11 ((uint32_t)0x00000800) /*!<Filter Init Mode bit 11 */
  1641. #define CAN_FM1R_FBM12 ((uint32_t)0x00001000) /*!<Filter Init Mode bit 12 */
  1642. #define CAN_FM1R_FBM13 ((uint32_t)0x00002000) /*!<Filter Init Mode bit 13 */
  1643. #define CAN_FM1R_FBM14 ((uint32_t)0x00004000) /*!<Filter Init Mode bit 14 */
  1644. #define CAN_FM1R_FBM15 ((uint32_t)0x00008000) /*!<Filter Init Mode bit 15 */
  1645. #define CAN_FM1R_FBM16 ((uint32_t)0x00010000) /*!<Filter Init Mode bit 16 */
  1646. #define CAN_FM1R_FBM17 ((uint32_t)0x00020000) /*!<Filter Init Mode bit 17 */
  1647. #define CAN_FM1R_FBM18 ((uint32_t)0x00040000) /*!<Filter Init Mode bit 18 */
  1648. #define CAN_FM1R_FBM19 ((uint32_t)0x00080000) /*!<Filter Init Mode bit 19 */
  1649. #define CAN_FM1R_FBM20 ((uint32_t)0x00100000) /*!<Filter Init Mode bit 20 */
  1650. #define CAN_FM1R_FBM21 ((uint32_t)0x00200000) /*!<Filter Init Mode bit 21 */
  1651. #define CAN_FM1R_FBM22 ((uint32_t)0x00400000) /*!<Filter Init Mode bit 22 */
  1652. #define CAN_FM1R_FBM23 ((uint32_t)0x00800000) /*!<Filter Init Mode bit 23 */
  1653. #define CAN_FM1R_FBM24 ((uint32_t)0x01000000) /*!<Filter Init Mode bit 24 */
  1654. #define CAN_FM1R_FBM25 ((uint32_t)0x02000000) /*!<Filter Init Mode bit 25 */
  1655. #define CAN_FM1R_FBM26 ((uint32_t)0x04000000) /*!<Filter Init Mode bit 26 */
  1656. #define CAN_FM1R_FBM27 ((uint32_t)0x08000000) /*!<Filter Init Mode bit 27 */
  1657. /******************* Bit definition for CAN_FS1R register *******************/
  1658. #define CAN_FS1R_FSC ((uint32_t)0x0FFFFFFF) /*!<Filter Scale Configuration */
  1659. #define CAN_FS1R_FSC0 ((uint32_t)0x00000001) /*!<Filter Scale Configuration bit 0 */
  1660. #define CAN_FS1R_FSC1 ((uint32_t)0x00000002) /*!<Filter Scale Configuration bit 1 */
  1661. #define CAN_FS1R_FSC2 ((uint32_t)0x00000004) /*!<Filter Scale Configuration bit 2 */
  1662. #define CAN_FS1R_FSC3 ((uint32_t)0x00000008) /*!<Filter Scale Configuration bit 3 */
  1663. #define CAN_FS1R_FSC4 ((uint32_t)0x00000010) /*!<Filter Scale Configuration bit 4 */
  1664. #define CAN_FS1R_FSC5 ((uint32_t)0x00000020) /*!<Filter Scale Configuration bit 5 */
  1665. #define CAN_FS1R_FSC6 ((uint32_t)0x00000040) /*!<Filter Scale Configuration bit 6 */
  1666. #define CAN_FS1R_FSC7 ((uint32_t)0x00000080) /*!<Filter Scale Configuration bit 7 */
  1667. #define CAN_FS1R_FSC8 ((uint32_t)0x00000100) /*!<Filter Scale Configuration bit 8 */
  1668. #define CAN_FS1R_FSC9 ((uint32_t)0x00000200) /*!<Filter Scale Configuration bit 9 */
  1669. #define CAN_FS1R_FSC10 ((uint32_t)0x00000400) /*!<Filter Scale Configuration bit 10 */
  1670. #define CAN_FS1R_FSC11 ((uint32_t)0x00000800) /*!<Filter Scale Configuration bit 11 */
  1671. #define CAN_FS1R_FSC12 ((uint32_t)0x00001000) /*!<Filter Scale Configuration bit 12 */
  1672. #define CAN_FS1R_FSC13 ((uint32_t)0x00002000) /*!<Filter Scale Configuration bit 13 */
  1673. #define CAN_FS1R_FSC14 ((uint32_t)0x00004000) /*!<Filter Scale Configuration bit 14 */
  1674. #define CAN_FS1R_FSC15 ((uint32_t)0x00008000) /*!<Filter Scale Configuration bit 15 */
  1675. #define CAN_FS1R_FSC16 ((uint32_t)0x00010000) /*!<Filter Scale Configuration bit 16 */
  1676. #define CAN_FS1R_FSC17 ((uint32_t)0x00020000) /*!<Filter Scale Configuration bit 17 */
  1677. #define CAN_FS1R_FSC18 ((uint32_t)0x00040000) /*!<Filter Scale Configuration bit 18 */
  1678. #define CAN_FS1R_FSC19 ((uint32_t)0x00080000) /*!<Filter Scale Configuration bit 19 */
  1679. #define CAN_FS1R_FSC20 ((uint32_t)0x00100000) /*!<Filter Scale Configuration bit 20 */
  1680. #define CAN_FS1R_FSC21 ((uint32_t)0x00200000) /*!<Filter Scale Configuration bit 21 */
  1681. #define CAN_FS1R_FSC22 ((uint32_t)0x00400000) /*!<Filter Scale Configuration bit 22 */
  1682. #define CAN_FS1R_FSC23 ((uint32_t)0x00800000) /*!<Filter Scale Configuration bit 23 */
  1683. #define CAN_FS1R_FSC24 ((uint32_t)0x01000000) /*!<Filter Scale Configuration bit 24 */
  1684. #define CAN_FS1R_FSC25 ((uint32_t)0x02000000) /*!<Filter Scale Configuration bit 25 */
  1685. #define CAN_FS1R_FSC26 ((uint32_t)0x04000000) /*!<Filter Scale Configuration bit 26 */
  1686. #define CAN_FS1R_FSC27 ((uint32_t)0x08000000) /*!<Filter Scale Configuration bit 27 */
  1687. /****************** Bit definition for CAN_FFA1R register *******************/
  1688. #define CAN_FFA1R_FFA ((uint32_t)0x0FFFFFFF) /*!<Filter FIFO Assignment */
  1689. #define CAN_FFA1R_FFA0 ((uint32_t)0x00000001) /*!<Filter FIFO Assignment bit 0 */
  1690. #define CAN_FFA1R_FFA1 ((uint32_t)0x00000002) /*!<Filter FIFO Assignment bit 1 */
  1691. #define CAN_FFA1R_FFA2 ((uint32_t)0x00000004) /*!<Filter FIFO Assignment bit 2 */
  1692. #define CAN_FFA1R_FFA3 ((uint32_t)0x00000008) /*!<Filter FIFO Assignment bit 3 */
  1693. #define CAN_FFA1R_FFA4 ((uint32_t)0x00000010) /*!<Filter FIFO Assignment bit 4 */
  1694. #define CAN_FFA1R_FFA5 ((uint32_t)0x00000020) /*!<Filter FIFO Assignment bit 5 */
  1695. #define CAN_FFA1R_FFA6 ((uint32_t)0x00000040) /*!<Filter FIFO Assignment bit 6 */
  1696. #define CAN_FFA1R_FFA7 ((uint32_t)0x00000080) /*!<Filter FIFO Assignment bit 7 */
  1697. #define CAN_FFA1R_FFA8 ((uint32_t)0x00000100) /*!<Filter FIFO Assignment bit 8 */
  1698. #define CAN_FFA1R_FFA9 ((uint32_t)0x00000200) /*!<Filter FIFO Assignment bit 9 */
  1699. #define CAN_FFA1R_FFA10 ((uint32_t)0x00000400) /*!<Filter FIFO Assignment bit 10 */
  1700. #define CAN_FFA1R_FFA11 ((uint32_t)0x00000800) /*!<Filter FIFO Assignment bit 11 */
  1701. #define CAN_FFA1R_FFA12 ((uint32_t)0x00001000) /*!<Filter FIFO Assignment bit 12 */
  1702. #define CAN_FFA1R_FFA13 ((uint32_t)0x00002000) /*!<Filter FIFO Assignment bit 13 */
  1703. #define CAN_FFA1R_FFA14 ((uint32_t)0x00004000) /*!<Filter FIFO Assignment bit 14 */
  1704. #define CAN_FFA1R_FFA15 ((uint32_t)0x00008000) /*!<Filter FIFO Assignment bit 15 */
  1705. #define CAN_FFA1R_FFA16 ((uint32_t)0x00010000) /*!<Filter FIFO Assignment bit 16 */
  1706. #define CAN_FFA1R_FFA17 ((uint32_t)0x00020000) /*!<Filter FIFO Assignment bit 17 */
  1707. #define CAN_FFA1R_FFA18 ((uint32_t)0x00040000) /*!<Filter FIFO Assignment bit 18 */
  1708. #define CAN_FFA1R_FFA19 ((uint32_t)0x00080000) /*!<Filter FIFO Assignment bit 19 */
  1709. #define CAN_FFA1R_FFA20 ((uint32_t)0x00100000) /*!<Filter FIFO Assignment bit 20 */
  1710. #define CAN_FFA1R_FFA21 ((uint32_t)0x00200000) /*!<Filter FIFO Assignment bit 21 */
  1711. #define CAN_FFA1R_FFA22 ((uint32_t)0x00400000) /*!<Filter FIFO Assignment bit 22 */
  1712. #define CAN_FFA1R_FFA23 ((uint32_t)0x00800000) /*!<Filter FIFO Assignment bit 23 */
  1713. #define CAN_FFA1R_FFA24 ((uint32_t)0x01000000) /*!<Filter FIFO Assignment bit 24 */
  1714. #define CAN_FFA1R_FFA25 ((uint32_t)0x02000000) /*!<Filter FIFO Assignment bit 25 */
  1715. #define CAN_FFA1R_FFA26 ((uint32_t)0x04000000) /*!<Filter FIFO Assignment bit 26 */
  1716. #define CAN_FFA1R_FFA27 ((uint32_t)0x08000000) /*!<Filter FIFO Assignment bit 27 */
  1717. /******************* Bit definition for CAN_FA1R register *******************/
  1718. #define CAN_FA1R_FACT ((uint32_t)0x0FFFFFFF) /*!<Filter Active */
  1719. #define CAN_FA1R_FACT0 ((uint32_t)0x00000001) /*!<Filter Active bit 0 */
  1720. #define CAN_FA1R_FACT1 ((uint32_t)0x00000002) /*!<Filter Active bit 1 */
  1721. #define CAN_FA1R_FACT2 ((uint32_t)0x00000004) /*!<Filter Active bit 2 */
  1722. #define CAN_FA1R_FACT3 ((uint32_t)0x00000008) /*!<Filter Active bit 3 */
  1723. #define CAN_FA1R_FACT4 ((uint32_t)0x00000010) /*!<Filter Active bit 4 */
  1724. #define CAN_FA1R_FACT5 ((uint32_t)0x00000020) /*!<Filter Active bit 5 */
  1725. #define CAN_FA1R_FACT6 ((uint32_t)0x00000040) /*!<Filter Active bit 6 */
  1726. #define CAN_FA1R_FACT7 ((uint32_t)0x00000080) /*!<Filter Active bit 7 */
  1727. #define CAN_FA1R_FACT8 ((uint32_t)0x00000100) /*!<Filter Active bit 8 */
  1728. #define CAN_FA1R_FACT9 ((uint32_t)0x00000200) /*!<Filter Active bit 9 */
  1729. #define CAN_FA1R_FACT10 ((uint32_t)0x00000400) /*!<Filter Active bit 10 */
  1730. #define CAN_FA1R_FACT11 ((uint32_t)0x00000800) /*!<Filter Active bit 11 */
  1731. #define CAN_FA1R_FACT12 ((uint32_t)0x00001000) /*!<Filter Active bit 12 */
  1732. #define CAN_FA1R_FACT13 ((uint32_t)0x00002000) /*!<Filter Active bit 13 */
  1733. #define CAN_FA1R_FACT14 ((uint32_t)0x00004000) /*!<Filter Active bit 14 */
  1734. #define CAN_FA1R_FACT15 ((uint32_t)0x00008000) /*!<Filter Active bit 15 */
  1735. #define CAN_FA1R_FACT16 ((uint32_t)0x00010000) /*!<Filter Active bit 16 */
  1736. #define CAN_FA1R_FACT17 ((uint32_t)0x00020000) /*!<Filter Active bit 17 */
  1737. #define CAN_FA1R_FACT18 ((uint32_t)0x00040000) /*!<Filter Active bit 18 */
  1738. #define CAN_FA1R_FACT19 ((uint32_t)0x00080000) /*!<Filter Active bit 19 */
  1739. #define CAN_FA1R_FACT20 ((uint32_t)0x00100000) /*!<Filter Active bit 20 */
  1740. #define CAN_FA1R_FACT21 ((uint32_t)0x00200000) /*!<Filter Active bit 21 */
  1741. #define CAN_FA1R_FACT22 ((uint32_t)0x00400000) /*!<Filter Active bit 22 */
  1742. #define CAN_FA1R_FACT23 ((uint32_t)0x00800000) /*!<Filter Active bit 23 */
  1743. #define CAN_FA1R_FACT24 ((uint32_t)0x01000000) /*!<Filter Active bit 24 */
  1744. #define CAN_FA1R_FACT25 ((uint32_t)0x02000000) /*!<Filter Active bit 25 */
  1745. #define CAN_FA1R_FACT26 ((uint32_t)0x04000000) /*!<Filter Active bit 26 */
  1746. #define CAN_FA1R_FACT27 ((uint32_t)0x08000000) /*!<Filter Active bit 27 */
  1747. /******************* Bit definition for CAN_F0R1 register *******************/
  1748. #define CAN_F0R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  1749. #define CAN_F0R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  1750. #define CAN_F0R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  1751. #define CAN_F0R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  1752. #define CAN_F0R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  1753. #define CAN_F0R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  1754. #define CAN_F0R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  1755. #define CAN_F0R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  1756. #define CAN_F0R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  1757. #define CAN_F0R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  1758. #define CAN_F0R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  1759. #define CAN_F0R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  1760. #define CAN_F0R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  1761. #define CAN_F0R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  1762. #define CAN_F0R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  1763. #define CAN_F0R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  1764. #define CAN_F0R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  1765. #define CAN_F0R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  1766. #define CAN_F0R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  1767. #define CAN_F0R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  1768. #define CAN_F0R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  1769. #define CAN_F0R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  1770. #define CAN_F0R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  1771. #define CAN_F0R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  1772. #define CAN_F0R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  1773. #define CAN_F0R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  1774. #define CAN_F0R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  1775. #define CAN_F0R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  1776. #define CAN_F0R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  1777. #define CAN_F0R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  1778. #define CAN_F0R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  1779. #define CAN_F0R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  1780. /******************* Bit definition for CAN_F1R1 register *******************/
  1781. #define CAN_F1R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  1782. #define CAN_F1R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  1783. #define CAN_F1R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  1784. #define CAN_F1R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  1785. #define CAN_F1R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  1786. #define CAN_F1R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  1787. #define CAN_F1R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  1788. #define CAN_F1R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  1789. #define CAN_F1R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  1790. #define CAN_F1R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  1791. #define CAN_F1R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  1792. #define CAN_F1R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  1793. #define CAN_F1R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  1794. #define CAN_F1R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  1795. #define CAN_F1R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  1796. #define CAN_F1R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  1797. #define CAN_F1R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  1798. #define CAN_F1R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  1799. #define CAN_F1R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  1800. #define CAN_F1R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  1801. #define CAN_F1R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  1802. #define CAN_F1R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  1803. #define CAN_F1R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  1804. #define CAN_F1R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  1805. #define CAN_F1R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  1806. #define CAN_F1R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  1807. #define CAN_F1R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  1808. #define CAN_F1R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  1809. #define CAN_F1R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  1810. #define CAN_F1R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  1811. #define CAN_F1R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  1812. #define CAN_F1R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  1813. /******************* Bit definition for CAN_F2R1 register *******************/
  1814. #define CAN_F2R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  1815. #define CAN_F2R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  1816. #define CAN_F2R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  1817. #define CAN_F2R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  1818. #define CAN_F2R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  1819. #define CAN_F2R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  1820. #define CAN_F2R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  1821. #define CAN_F2R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  1822. #define CAN_F2R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  1823. #define CAN_F2R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  1824. #define CAN_F2R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  1825. #define CAN_F2R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  1826. #define CAN_F2R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  1827. #define CAN_F2R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  1828. #define CAN_F2R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  1829. #define CAN_F2R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  1830. #define CAN_F2R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  1831. #define CAN_F2R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  1832. #define CAN_F2R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  1833. #define CAN_F2R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  1834. #define CAN_F2R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  1835. #define CAN_F2R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  1836. #define CAN_F2R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  1837. #define CAN_F2R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  1838. #define CAN_F2R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  1839. #define CAN_F2R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  1840. #define CAN_F2R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  1841. #define CAN_F2R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  1842. #define CAN_F2R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  1843. #define CAN_F2R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  1844. #define CAN_F2R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  1845. #define CAN_F2R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  1846. /******************* Bit definition for CAN_F3R1 register *******************/
  1847. #define CAN_F3R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  1848. #define CAN_F3R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  1849. #define CAN_F3R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  1850. #define CAN_F3R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  1851. #define CAN_F3R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  1852. #define CAN_F3R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  1853. #define CAN_F3R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  1854. #define CAN_F3R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  1855. #define CAN_F3R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  1856. #define CAN_F3R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  1857. #define CAN_F3R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  1858. #define CAN_F3R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  1859. #define CAN_F3R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  1860. #define CAN_F3R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  1861. #define CAN_F3R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  1862. #define CAN_F3R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  1863. #define CAN_F3R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  1864. #define CAN_F3R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  1865. #define CAN_F3R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  1866. #define CAN_F3R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  1867. #define CAN_F3R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  1868. #define CAN_F3R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  1869. #define CAN_F3R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  1870. #define CAN_F3R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  1871. #define CAN_F3R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  1872. #define CAN_F3R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  1873. #define CAN_F3R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  1874. #define CAN_F3R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  1875. #define CAN_F3R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  1876. #define CAN_F3R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  1877. #define CAN_F3R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  1878. #define CAN_F3R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  1879. /******************* Bit definition for CAN_F4R1 register *******************/
  1880. #define CAN_F4R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  1881. #define CAN_F4R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  1882. #define CAN_F4R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  1883. #define CAN_F4R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  1884. #define CAN_F4R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  1885. #define CAN_F4R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  1886. #define CAN_F4R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  1887. #define CAN_F4R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  1888. #define CAN_F4R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  1889. #define CAN_F4R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  1890. #define CAN_F4R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  1891. #define CAN_F4R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  1892. #define CAN_F4R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  1893. #define CAN_F4R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  1894. #define CAN_F4R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  1895. #define CAN_F4R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  1896. #define CAN_F4R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  1897. #define CAN_F4R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  1898. #define CAN_F4R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  1899. #define CAN_F4R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  1900. #define CAN_F4R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  1901. #define CAN_F4R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  1902. #define CAN_F4R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  1903. #define CAN_F4R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  1904. #define CAN_F4R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  1905. #define CAN_F4R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  1906. #define CAN_F4R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  1907. #define CAN_F4R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  1908. #define CAN_F4R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  1909. #define CAN_F4R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  1910. #define CAN_F4R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  1911. #define CAN_F4R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  1912. /******************* Bit definition for CAN_F5R1 register *******************/
  1913. #define CAN_F5R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  1914. #define CAN_F5R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  1915. #define CAN_F5R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  1916. #define CAN_F5R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  1917. #define CAN_F5R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  1918. #define CAN_F5R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  1919. #define CAN_F5R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  1920. #define CAN_F5R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  1921. #define CAN_F5R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  1922. #define CAN_F5R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  1923. #define CAN_F5R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  1924. #define CAN_F5R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  1925. #define CAN_F5R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  1926. #define CAN_F5R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  1927. #define CAN_F5R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  1928. #define CAN_F5R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  1929. #define CAN_F5R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  1930. #define CAN_F5R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  1931. #define CAN_F5R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  1932. #define CAN_F5R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  1933. #define CAN_F5R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  1934. #define CAN_F5R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  1935. #define CAN_F5R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  1936. #define CAN_F5R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  1937. #define CAN_F5R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  1938. #define CAN_F5R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  1939. #define CAN_F5R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  1940. #define CAN_F5R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  1941. #define CAN_F5R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  1942. #define CAN_F5R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  1943. #define CAN_F5R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  1944. #define CAN_F5R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  1945. /******************* Bit definition for CAN_F6R1 register *******************/
  1946. #define CAN_F6R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  1947. #define CAN_F6R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  1948. #define CAN_F6R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  1949. #define CAN_F6R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  1950. #define CAN_F6R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  1951. #define CAN_F6R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  1952. #define CAN_F6R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  1953. #define CAN_F6R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  1954. #define CAN_F6R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  1955. #define CAN_F6R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  1956. #define CAN_F6R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  1957. #define CAN_F6R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  1958. #define CAN_F6R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  1959. #define CAN_F6R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  1960. #define CAN_F6R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  1961. #define CAN_F6R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  1962. #define CAN_F6R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  1963. #define CAN_F6R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  1964. #define CAN_F6R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  1965. #define CAN_F6R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  1966. #define CAN_F6R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  1967. #define CAN_F6R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  1968. #define CAN_F6R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  1969. #define CAN_F6R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  1970. #define CAN_F6R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  1971. #define CAN_F6R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  1972. #define CAN_F6R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  1973. #define CAN_F6R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  1974. #define CAN_F6R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  1975. #define CAN_F6R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  1976. #define CAN_F6R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  1977. #define CAN_F6R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  1978. /******************* Bit definition for CAN_F7R1 register *******************/
  1979. #define CAN_F7R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  1980. #define CAN_F7R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  1981. #define CAN_F7R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  1982. #define CAN_F7R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  1983. #define CAN_F7R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  1984. #define CAN_F7R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  1985. #define CAN_F7R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  1986. #define CAN_F7R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  1987. #define CAN_F7R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  1988. #define CAN_F7R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  1989. #define CAN_F7R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  1990. #define CAN_F7R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  1991. #define CAN_F7R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  1992. #define CAN_F7R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  1993. #define CAN_F7R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  1994. #define CAN_F7R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  1995. #define CAN_F7R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  1996. #define CAN_F7R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  1997. #define CAN_F7R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  1998. #define CAN_F7R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  1999. #define CAN_F7R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2000. #define CAN_F7R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2001. #define CAN_F7R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2002. #define CAN_F7R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2003. #define CAN_F7R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2004. #define CAN_F7R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2005. #define CAN_F7R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2006. #define CAN_F7R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2007. #define CAN_F7R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2008. #define CAN_F7R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2009. #define CAN_F7R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2010. #define CAN_F7R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2011. /******************* Bit definition for CAN_F8R1 register *******************/
  2012. #define CAN_F8R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2013. #define CAN_F8R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2014. #define CAN_F8R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2015. #define CAN_F8R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2016. #define CAN_F8R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2017. #define CAN_F8R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2018. #define CAN_F8R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2019. #define CAN_F8R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2020. #define CAN_F8R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2021. #define CAN_F8R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2022. #define CAN_F8R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2023. #define CAN_F8R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2024. #define CAN_F8R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2025. #define CAN_F8R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2026. #define CAN_F8R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2027. #define CAN_F8R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2028. #define CAN_F8R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2029. #define CAN_F8R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2030. #define CAN_F8R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2031. #define CAN_F8R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2032. #define CAN_F8R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2033. #define CAN_F8R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2034. #define CAN_F8R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2035. #define CAN_F8R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2036. #define CAN_F8R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2037. #define CAN_F8R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2038. #define CAN_F8R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2039. #define CAN_F8R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2040. #define CAN_F8R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2041. #define CAN_F8R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2042. #define CAN_F8R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2043. #define CAN_F8R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2044. /******************* Bit definition for CAN_F9R1 register *******************/
  2045. #define CAN_F9R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2046. #define CAN_F9R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2047. #define CAN_F9R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2048. #define CAN_F9R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2049. #define CAN_F9R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2050. #define CAN_F9R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2051. #define CAN_F9R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2052. #define CAN_F9R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2053. #define CAN_F9R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2054. #define CAN_F9R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2055. #define CAN_F9R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2056. #define CAN_F9R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2057. #define CAN_F9R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2058. #define CAN_F9R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2059. #define CAN_F9R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2060. #define CAN_F9R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2061. #define CAN_F9R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2062. #define CAN_F9R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2063. #define CAN_F9R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2064. #define CAN_F9R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2065. #define CAN_F9R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2066. #define CAN_F9R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2067. #define CAN_F9R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2068. #define CAN_F9R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2069. #define CAN_F9R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2070. #define CAN_F9R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2071. #define CAN_F9R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2072. #define CAN_F9R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2073. #define CAN_F9R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2074. #define CAN_F9R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2075. #define CAN_F9R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2076. #define CAN_F9R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2077. /******************* Bit definition for CAN_F10R1 register ******************/
  2078. #define CAN_F10R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2079. #define CAN_F10R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2080. #define CAN_F10R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2081. #define CAN_F10R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2082. #define CAN_F10R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2083. #define CAN_F10R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2084. #define CAN_F10R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2085. #define CAN_F10R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2086. #define CAN_F10R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2087. #define CAN_F10R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2088. #define CAN_F10R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2089. #define CAN_F10R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2090. #define CAN_F10R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2091. #define CAN_F10R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2092. #define CAN_F10R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2093. #define CAN_F10R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2094. #define CAN_F10R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2095. #define CAN_F10R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2096. #define CAN_F10R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2097. #define CAN_F10R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2098. #define CAN_F10R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2099. #define CAN_F10R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2100. #define CAN_F10R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2101. #define CAN_F10R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2102. #define CAN_F10R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2103. #define CAN_F10R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2104. #define CAN_F10R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2105. #define CAN_F10R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2106. #define CAN_F10R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2107. #define CAN_F10R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2108. #define CAN_F10R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2109. #define CAN_F10R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2110. /******************* Bit definition for CAN_F11R1 register ******************/
  2111. #define CAN_F11R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2112. #define CAN_F11R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2113. #define CAN_F11R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2114. #define CAN_F11R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2115. #define CAN_F11R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2116. #define CAN_F11R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2117. #define CAN_F11R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2118. #define CAN_F11R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2119. #define CAN_F11R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2120. #define CAN_F11R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2121. #define CAN_F11R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2122. #define CAN_F11R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2123. #define CAN_F11R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2124. #define CAN_F11R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2125. #define CAN_F11R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2126. #define CAN_F11R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2127. #define CAN_F11R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2128. #define CAN_F11R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2129. #define CAN_F11R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2130. #define CAN_F11R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2131. #define CAN_F11R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2132. #define CAN_F11R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2133. #define CAN_F11R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2134. #define CAN_F11R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2135. #define CAN_F11R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2136. #define CAN_F11R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2137. #define CAN_F11R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2138. #define CAN_F11R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2139. #define CAN_F11R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2140. #define CAN_F11R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2141. #define CAN_F11R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2142. #define CAN_F11R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2143. /******************* Bit definition for CAN_F12R1 register ******************/
  2144. #define CAN_F12R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2145. #define CAN_F12R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2146. #define CAN_F12R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2147. #define CAN_F12R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2148. #define CAN_F12R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2149. #define CAN_F12R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2150. #define CAN_F12R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2151. #define CAN_F12R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2152. #define CAN_F12R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2153. #define CAN_F12R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2154. #define CAN_F12R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2155. #define CAN_F12R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2156. #define CAN_F12R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2157. #define CAN_F12R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2158. #define CAN_F12R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2159. #define CAN_F12R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2160. #define CAN_F12R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2161. #define CAN_F12R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2162. #define CAN_F12R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2163. #define CAN_F12R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2164. #define CAN_F12R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2165. #define CAN_F12R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2166. #define CAN_F12R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2167. #define CAN_F12R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2168. #define CAN_F12R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2169. #define CAN_F12R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2170. #define CAN_F12R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2171. #define CAN_F12R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2172. #define CAN_F12R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2173. #define CAN_F12R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2174. #define CAN_F12R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2175. #define CAN_F12R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2176. /******************* Bit definition for CAN_F13R1 register ******************/
  2177. #define CAN_F13R1_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2178. #define CAN_F13R1_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2179. #define CAN_F13R1_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2180. #define CAN_F13R1_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2181. #define CAN_F13R1_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2182. #define CAN_F13R1_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2183. #define CAN_F13R1_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2184. #define CAN_F13R1_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2185. #define CAN_F13R1_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2186. #define CAN_F13R1_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2187. #define CAN_F13R1_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2188. #define CAN_F13R1_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2189. #define CAN_F13R1_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2190. #define CAN_F13R1_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2191. #define CAN_F13R1_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2192. #define CAN_F13R1_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2193. #define CAN_F13R1_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2194. #define CAN_F13R1_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2195. #define CAN_F13R1_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2196. #define CAN_F13R1_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2197. #define CAN_F13R1_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2198. #define CAN_F13R1_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2199. #define CAN_F13R1_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2200. #define CAN_F13R1_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2201. #define CAN_F13R1_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2202. #define CAN_F13R1_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2203. #define CAN_F13R1_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2204. #define CAN_F13R1_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2205. #define CAN_F13R1_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2206. #define CAN_F13R1_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2207. #define CAN_F13R1_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2208. #define CAN_F13R1_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2209. /******************* Bit definition for CAN_F0R2 register *******************/
  2210. #define CAN_F0R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2211. #define CAN_F0R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2212. #define CAN_F0R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2213. #define CAN_F0R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2214. #define CAN_F0R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2215. #define CAN_F0R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2216. #define CAN_F0R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2217. #define CAN_F0R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2218. #define CAN_F0R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2219. #define CAN_F0R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2220. #define CAN_F0R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2221. #define CAN_F0R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2222. #define CAN_F0R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2223. #define CAN_F0R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2224. #define CAN_F0R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2225. #define CAN_F0R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2226. #define CAN_F0R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2227. #define CAN_F0R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2228. #define CAN_F0R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2229. #define CAN_F0R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2230. #define CAN_F0R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2231. #define CAN_F0R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2232. #define CAN_F0R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2233. #define CAN_F0R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2234. #define CAN_F0R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2235. #define CAN_F0R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2236. #define CAN_F0R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2237. #define CAN_F0R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2238. #define CAN_F0R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2239. #define CAN_F0R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2240. #define CAN_F0R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2241. #define CAN_F0R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2242. /******************* Bit definition for CAN_F1R2 register *******************/
  2243. #define CAN_F1R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2244. #define CAN_F1R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2245. #define CAN_F1R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2246. #define CAN_F1R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2247. #define CAN_F1R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2248. #define CAN_F1R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2249. #define CAN_F1R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2250. #define CAN_F1R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2251. #define CAN_F1R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2252. #define CAN_F1R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2253. #define CAN_F1R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2254. #define CAN_F1R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2255. #define CAN_F1R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2256. #define CAN_F1R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2257. #define CAN_F1R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2258. #define CAN_F1R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2259. #define CAN_F1R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2260. #define CAN_F1R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2261. #define CAN_F1R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2262. #define CAN_F1R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2263. #define CAN_F1R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2264. #define CAN_F1R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2265. #define CAN_F1R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2266. #define CAN_F1R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2267. #define CAN_F1R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2268. #define CAN_F1R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2269. #define CAN_F1R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2270. #define CAN_F1R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2271. #define CAN_F1R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2272. #define CAN_F1R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2273. #define CAN_F1R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2274. #define CAN_F1R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2275. /******************* Bit definition for CAN_F2R2 register *******************/
  2276. #define CAN_F2R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2277. #define CAN_F2R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2278. #define CAN_F2R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2279. #define CAN_F2R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2280. #define CAN_F2R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2281. #define CAN_F2R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2282. #define CAN_F2R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2283. #define CAN_F2R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2284. #define CAN_F2R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2285. #define CAN_F2R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2286. #define CAN_F2R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2287. #define CAN_F2R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2288. #define CAN_F2R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2289. #define CAN_F2R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2290. #define CAN_F2R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2291. #define CAN_F2R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2292. #define CAN_F2R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2293. #define CAN_F2R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2294. #define CAN_F2R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2295. #define CAN_F2R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2296. #define CAN_F2R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2297. #define CAN_F2R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2298. #define CAN_F2R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2299. #define CAN_F2R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2300. #define CAN_F2R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2301. #define CAN_F2R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2302. #define CAN_F2R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2303. #define CAN_F2R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2304. #define CAN_F2R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2305. #define CAN_F2R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2306. #define CAN_F2R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2307. #define CAN_F2R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2308. /******************* Bit definition for CAN_F3R2 register *******************/
  2309. #define CAN_F3R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2310. #define CAN_F3R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2311. #define CAN_F3R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2312. #define CAN_F3R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2313. #define CAN_F3R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2314. #define CAN_F3R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2315. #define CAN_F3R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2316. #define CAN_F3R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2317. #define CAN_F3R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2318. #define CAN_F3R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2319. #define CAN_F3R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2320. #define CAN_F3R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2321. #define CAN_F3R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2322. #define CAN_F3R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2323. #define CAN_F3R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2324. #define CAN_F3R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2325. #define CAN_F3R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2326. #define CAN_F3R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2327. #define CAN_F3R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2328. #define CAN_F3R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2329. #define CAN_F3R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2330. #define CAN_F3R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2331. #define CAN_F3R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2332. #define CAN_F3R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2333. #define CAN_F3R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2334. #define CAN_F3R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2335. #define CAN_F3R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2336. #define CAN_F3R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2337. #define CAN_F3R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2338. #define CAN_F3R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2339. #define CAN_F3R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2340. #define CAN_F3R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2341. /******************* Bit definition for CAN_F4R2 register *******************/
  2342. #define CAN_F4R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2343. #define CAN_F4R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2344. #define CAN_F4R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2345. #define CAN_F4R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2346. #define CAN_F4R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2347. #define CAN_F4R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2348. #define CAN_F4R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2349. #define CAN_F4R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2350. #define CAN_F4R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2351. #define CAN_F4R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2352. #define CAN_F4R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2353. #define CAN_F4R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2354. #define CAN_F4R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2355. #define CAN_F4R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2356. #define CAN_F4R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2357. #define CAN_F4R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2358. #define CAN_F4R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2359. #define CAN_F4R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2360. #define CAN_F4R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2361. #define CAN_F4R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2362. #define CAN_F4R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2363. #define CAN_F4R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2364. #define CAN_F4R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2365. #define CAN_F4R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2366. #define CAN_F4R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2367. #define CAN_F4R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2368. #define CAN_F4R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2369. #define CAN_F4R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2370. #define CAN_F4R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2371. #define CAN_F4R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2372. #define CAN_F4R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2373. #define CAN_F4R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2374. /******************* Bit definition for CAN_F5R2 register *******************/
  2375. #define CAN_F5R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2376. #define CAN_F5R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2377. #define CAN_F5R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2378. #define CAN_F5R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2379. #define CAN_F5R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2380. #define CAN_F5R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2381. #define CAN_F5R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2382. #define CAN_F5R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2383. #define CAN_F5R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2384. #define CAN_F5R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2385. #define CAN_F5R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2386. #define CAN_F5R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2387. #define CAN_F5R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2388. #define CAN_F5R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2389. #define CAN_F5R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2390. #define CAN_F5R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2391. #define CAN_F5R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2392. #define CAN_F5R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2393. #define CAN_F5R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2394. #define CAN_F5R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2395. #define CAN_F5R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2396. #define CAN_F5R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2397. #define CAN_F5R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2398. #define CAN_F5R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2399. #define CAN_F5R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2400. #define CAN_F5R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2401. #define CAN_F5R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2402. #define CAN_F5R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2403. #define CAN_F5R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2404. #define CAN_F5R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2405. #define CAN_F5R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2406. #define CAN_F5R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2407. /******************* Bit definition for CAN_F6R2 register *******************/
  2408. #define CAN_F6R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2409. #define CAN_F6R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2410. #define CAN_F6R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2411. #define CAN_F6R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2412. #define CAN_F6R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2413. #define CAN_F6R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2414. #define CAN_F6R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2415. #define CAN_F6R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2416. #define CAN_F6R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2417. #define CAN_F6R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2418. #define CAN_F6R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2419. #define CAN_F6R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2420. #define CAN_F6R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2421. #define CAN_F6R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2422. #define CAN_F6R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2423. #define CAN_F6R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2424. #define CAN_F6R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2425. #define CAN_F6R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2426. #define CAN_F6R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2427. #define CAN_F6R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2428. #define CAN_F6R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2429. #define CAN_F6R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2430. #define CAN_F6R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2431. #define CAN_F6R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2432. #define CAN_F6R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2433. #define CAN_F6R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2434. #define CAN_F6R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2435. #define CAN_F6R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2436. #define CAN_F6R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2437. #define CAN_F6R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2438. #define CAN_F6R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2439. #define CAN_F6R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2440. /******************* Bit definition for CAN_F7R2 register *******************/
  2441. #define CAN_F7R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2442. #define CAN_F7R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2443. #define CAN_F7R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2444. #define CAN_F7R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2445. #define CAN_F7R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2446. #define CAN_F7R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2447. #define CAN_F7R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2448. #define CAN_F7R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2449. #define CAN_F7R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2450. #define CAN_F7R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2451. #define CAN_F7R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2452. #define CAN_F7R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2453. #define CAN_F7R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2454. #define CAN_F7R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2455. #define CAN_F7R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2456. #define CAN_F7R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2457. #define CAN_F7R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2458. #define CAN_F7R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2459. #define CAN_F7R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2460. #define CAN_F7R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2461. #define CAN_F7R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2462. #define CAN_F7R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2463. #define CAN_F7R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2464. #define CAN_F7R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2465. #define CAN_F7R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2466. #define CAN_F7R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2467. #define CAN_F7R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2468. #define CAN_F7R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2469. #define CAN_F7R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2470. #define CAN_F7R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2471. #define CAN_F7R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2472. #define CAN_F7R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2473. /******************* Bit definition for CAN_F8R2 register *******************/
  2474. #define CAN_F8R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2475. #define CAN_F8R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2476. #define CAN_F8R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2477. #define CAN_F8R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2478. #define CAN_F8R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2479. #define CAN_F8R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2480. #define CAN_F8R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2481. #define CAN_F8R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2482. #define CAN_F8R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2483. #define CAN_F8R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2484. #define CAN_F8R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2485. #define CAN_F8R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2486. #define CAN_F8R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2487. #define CAN_F8R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2488. #define CAN_F8R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2489. #define CAN_F8R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2490. #define CAN_F8R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2491. #define CAN_F8R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2492. #define CAN_F8R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2493. #define CAN_F8R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2494. #define CAN_F8R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2495. #define CAN_F8R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2496. #define CAN_F8R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2497. #define CAN_F8R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2498. #define CAN_F8R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2499. #define CAN_F8R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2500. #define CAN_F8R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2501. #define CAN_F8R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2502. #define CAN_F8R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2503. #define CAN_F8R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2504. #define CAN_F8R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2505. #define CAN_F8R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2506. /******************* Bit definition for CAN_F9R2 register *******************/
  2507. #define CAN_F9R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2508. #define CAN_F9R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2509. #define CAN_F9R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2510. #define CAN_F9R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2511. #define CAN_F9R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2512. #define CAN_F9R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2513. #define CAN_F9R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2514. #define CAN_F9R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2515. #define CAN_F9R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2516. #define CAN_F9R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2517. #define CAN_F9R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2518. #define CAN_F9R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2519. #define CAN_F9R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2520. #define CAN_F9R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2521. #define CAN_F9R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2522. #define CAN_F9R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2523. #define CAN_F9R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2524. #define CAN_F9R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2525. #define CAN_F9R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2526. #define CAN_F9R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2527. #define CAN_F9R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2528. #define CAN_F9R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2529. #define CAN_F9R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2530. #define CAN_F9R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2531. #define CAN_F9R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2532. #define CAN_F9R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2533. #define CAN_F9R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2534. #define CAN_F9R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2535. #define CAN_F9R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2536. #define CAN_F9R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2537. #define CAN_F9R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2538. #define CAN_F9R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2539. /******************* Bit definition for CAN_F10R2 register ******************/
  2540. #define CAN_F10R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2541. #define CAN_F10R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2542. #define CAN_F10R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2543. #define CAN_F10R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2544. #define CAN_F10R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2545. #define CAN_F10R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2546. #define CAN_F10R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2547. #define CAN_F10R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2548. #define CAN_F10R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2549. #define CAN_F10R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2550. #define CAN_F10R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2551. #define CAN_F10R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2552. #define CAN_F10R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2553. #define CAN_F10R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2554. #define CAN_F10R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2555. #define CAN_F10R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2556. #define CAN_F10R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2557. #define CAN_F10R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2558. #define CAN_F10R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2559. #define CAN_F10R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2560. #define CAN_F10R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2561. #define CAN_F10R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2562. #define CAN_F10R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2563. #define CAN_F10R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2564. #define CAN_F10R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2565. #define CAN_F10R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2566. #define CAN_F10R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2567. #define CAN_F10R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2568. #define CAN_F10R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2569. #define CAN_F10R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2570. #define CAN_F10R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2571. #define CAN_F10R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2572. /******************* Bit definition for CAN_F11R2 register ******************/
  2573. #define CAN_F11R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2574. #define CAN_F11R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2575. #define CAN_F11R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2576. #define CAN_F11R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2577. #define CAN_F11R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2578. #define CAN_F11R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2579. #define CAN_F11R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2580. #define CAN_F11R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2581. #define CAN_F11R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2582. #define CAN_F11R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2583. #define CAN_F11R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2584. #define CAN_F11R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2585. #define CAN_F11R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2586. #define CAN_F11R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2587. #define CAN_F11R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2588. #define CAN_F11R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2589. #define CAN_F11R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2590. #define CAN_F11R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2591. #define CAN_F11R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2592. #define CAN_F11R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2593. #define CAN_F11R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2594. #define CAN_F11R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2595. #define CAN_F11R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2596. #define CAN_F11R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2597. #define CAN_F11R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2598. #define CAN_F11R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2599. #define CAN_F11R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2600. #define CAN_F11R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2601. #define CAN_F11R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2602. #define CAN_F11R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2603. #define CAN_F11R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2604. #define CAN_F11R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2605. /******************* Bit definition for CAN_F12R2 register ******************/
  2606. #define CAN_F12R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2607. #define CAN_F12R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2608. #define CAN_F12R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2609. #define CAN_F12R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2610. #define CAN_F12R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2611. #define CAN_F12R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2612. #define CAN_F12R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2613. #define CAN_F12R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2614. #define CAN_F12R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2615. #define CAN_F12R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2616. #define CAN_F12R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2617. #define CAN_F12R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2618. #define CAN_F12R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2619. #define CAN_F12R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2620. #define CAN_F12R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2621. #define CAN_F12R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2622. #define CAN_F12R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2623. #define CAN_F12R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2624. #define CAN_F12R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2625. #define CAN_F12R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2626. #define CAN_F12R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2627. #define CAN_F12R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2628. #define CAN_F12R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2629. #define CAN_F12R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2630. #define CAN_F12R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2631. #define CAN_F12R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2632. #define CAN_F12R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2633. #define CAN_F12R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2634. #define CAN_F12R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2635. #define CAN_F12R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2636. #define CAN_F12R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2637. #define CAN_F12R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2638. /******************* Bit definition for CAN_F13R2 register ******************/
  2639. #define CAN_F13R2_FB0 ((uint32_t)0x00000001) /*!<Filter bit 0 */
  2640. #define CAN_F13R2_FB1 ((uint32_t)0x00000002) /*!<Filter bit 1 */
  2641. #define CAN_F13R2_FB2 ((uint32_t)0x00000004) /*!<Filter bit 2 */
  2642. #define CAN_F13R2_FB3 ((uint32_t)0x00000008) /*!<Filter bit 3 */
  2643. #define CAN_F13R2_FB4 ((uint32_t)0x00000010) /*!<Filter bit 4 */
  2644. #define CAN_F13R2_FB5 ((uint32_t)0x00000020) /*!<Filter bit 5 */
  2645. #define CAN_F13R2_FB6 ((uint32_t)0x00000040) /*!<Filter bit 6 */
  2646. #define CAN_F13R2_FB7 ((uint32_t)0x00000080) /*!<Filter bit 7 */
  2647. #define CAN_F13R2_FB8 ((uint32_t)0x00000100) /*!<Filter bit 8 */
  2648. #define CAN_F13R2_FB9 ((uint32_t)0x00000200) /*!<Filter bit 9 */
  2649. #define CAN_F13R2_FB10 ((uint32_t)0x00000400) /*!<Filter bit 10 */
  2650. #define CAN_F13R2_FB11 ((uint32_t)0x00000800) /*!<Filter bit 11 */
  2651. #define CAN_F13R2_FB12 ((uint32_t)0x00001000) /*!<Filter bit 12 */
  2652. #define CAN_F13R2_FB13 ((uint32_t)0x00002000) /*!<Filter bit 13 */
  2653. #define CAN_F13R2_FB14 ((uint32_t)0x00004000) /*!<Filter bit 14 */
  2654. #define CAN_F13R2_FB15 ((uint32_t)0x00008000) /*!<Filter bit 15 */
  2655. #define CAN_F13R2_FB16 ((uint32_t)0x00010000) /*!<Filter bit 16 */
  2656. #define CAN_F13R2_FB17 ((uint32_t)0x00020000) /*!<Filter bit 17 */
  2657. #define CAN_F13R2_FB18 ((uint32_t)0x00040000) /*!<Filter bit 18 */
  2658. #define CAN_F13R2_FB19 ((uint32_t)0x00080000) /*!<Filter bit 19 */
  2659. #define CAN_F13R2_FB20 ((uint32_t)0x00100000) /*!<Filter bit 20 */
  2660. #define CAN_F13R2_FB21 ((uint32_t)0x00200000) /*!<Filter bit 21 */
  2661. #define CAN_F13R2_FB22 ((uint32_t)0x00400000) /*!<Filter bit 22 */
  2662. #define CAN_F13R2_FB23 ((uint32_t)0x00800000) /*!<Filter bit 23 */
  2663. #define CAN_F13R2_FB24 ((uint32_t)0x01000000) /*!<Filter bit 24 */
  2664. #define CAN_F13R2_FB25 ((uint32_t)0x02000000) /*!<Filter bit 25 */
  2665. #define CAN_F13R2_FB26 ((uint32_t)0x04000000) /*!<Filter bit 26 */
  2666. #define CAN_F13R2_FB27 ((uint32_t)0x08000000) /*!<Filter bit 27 */
  2667. #define CAN_F13R2_FB28 ((uint32_t)0x10000000) /*!<Filter bit 28 */
  2668. #define CAN_F13R2_FB29 ((uint32_t)0x20000000) /*!<Filter bit 29 */
  2669. #define CAN_F13R2_FB30 ((uint32_t)0x40000000) /*!<Filter bit 30 */
  2670. #define CAN_F13R2_FB31 ((uint32_t)0x80000000) /*!<Filter bit 31 */
  2671. /******************************************************************************/
  2672. /* */
  2673. /* HDMI-CEC (CEC) */
  2674. /* */
  2675. /******************************************************************************/
  2676. /******************* Bit definition for CEC_CR register *********************/
  2677. #define CEC_CR_CECEN ((uint32_t)0x00000001) /*!< CEC Enable */
  2678. #define CEC_CR_TXSOM ((uint32_t)0x00000002) /*!< CEC Tx Start Of Message */
  2679. #define CEC_CR_TXEOM ((uint32_t)0x00000004) /*!< CEC Tx End Of Message */
  2680. /******************* Bit definition for CEC_CFGR register *******************/
  2681. #define CEC_CFGR_SFT ((uint32_t)0x00000007) /*!< CEC Signal Free Time */
  2682. #define CEC_CFGR_RXTOL ((uint32_t)0x00000008) /*!< CEC Tolerance */
  2683. #define CEC_CFGR_BRESTP ((uint32_t)0x00000010) /*!< CEC Rx Stop */
  2684. #define CEC_CFGR_BREGEN ((uint32_t)0x00000020) /*!< CEC Bit Rising Error generation */
  2685. #define CEC_CFGR_LBPEGEN ((uint32_t)0x00000040) /*!< CEC Long Bit Period Error generation */
  2686. #define CEC_CFGR_SFTOPT ((uint32_t)0x00000100) /*!< CEC Signal Free Time optional */
  2687. #define CEC_CFGR_BRDNOGEN ((uint32_t)0x00000080) /*!< CEC Broadcast No error generation */
  2688. #define CEC_CFGR_OAR ((uint32_t)0x7FFF0000) /*!< CEC Own Address */
  2689. #define CEC_CFGR_LSTN ((uint32_t)0x80000000) /*!< CEC Listen mode */
  2690. /******************* Bit definition for CEC_TXDR register *******************/
  2691. #define CEC_TXDR_TXD ((uint32_t)0x000000FF) /*!< CEC Tx Data */
  2692. /******************* Bit definition for CEC_RXDR register *******************/
  2693. #define CEC_TXDR_RXD ((uint32_t)0x000000FF) /*!< CEC Rx Data */
  2694. /******************* Bit definition for CEC_ISR register ********************/
  2695. #define CEC_ISR_RXBR ((uint32_t)0x00000001) /*!< CEC Rx-Byte Received */
  2696. #define CEC_ISR_RXEND ((uint32_t)0x00000002) /*!< CEC End Of Reception */
  2697. #define CEC_ISR_RXOVR ((uint32_t)0x00000004) /*!< CEC Rx-Overrun */
  2698. #define CEC_ISR_BRE ((uint32_t)0x00000008) /*!< CEC Rx Bit Rising Error */
  2699. #define CEC_ISR_SBPE ((uint32_t)0x00000010) /*!< CEC Rx Short Bit period Error */
  2700. #define CEC_ISR_LBPE ((uint32_t)0x00000020) /*!< CEC Rx Long Bit period Error */
  2701. #define CEC_ISR_RXACKE ((uint32_t)0x00000040) /*!< CEC Rx Missing Acknowledge */
  2702. #define CEC_ISR_ARBLST ((uint32_t)0x00000080) /*!< CEC Arbitration Lost */
  2703. #define CEC_ISR_TXBR ((uint32_t)0x00000100) /*!< CEC Tx Byte Request */
  2704. #define CEC_ISR_TXEND ((uint32_t)0x00000200) /*!< CEC End of Transmission */
  2705. #define CEC_ISR_TXUDR ((uint32_t)0x00000400) /*!< CEC Tx-Buffer Underrun */
  2706. #define CEC_ISR_TXERR ((uint32_t)0x00000800) /*!< CEC Tx-Error */
  2707. #define CEC_ISR_TXACKE ((uint32_t)0x00001000) /*!< CEC Tx Missing Acknowledge */
  2708. /******************* Bit definition for CEC_IER register ********************/
  2709. #define CEC_IER_RXBRIE ((uint32_t)0x00000001) /*!< CEC Rx-Byte Received IT Enable */
  2710. #define CEC_IER_RXENDIE ((uint32_t)0x00000002) /*!< CEC End Of Reception IT Enable */
  2711. #define CEC_IER_RXOVRIE ((uint32_t)0x00000004) /*!< CEC Rx-Overrun IT Enable */
  2712. #define CEC_IER_BREIE ((uint32_t)0x00000008) /*!< CEC Rx Bit Rising Error IT Enable */
  2713. #define CEC_IER_SBPEIE ((uint32_t)0x00000010) /*!< CEC Rx Short Bit period Error IT Enable */
  2714. #define CEC_IER_LBPEIE ((uint32_t)0x00000020) /*!< CEC Rx Long Bit period Error IT Enable */
  2715. #define CEC_IER_RXACKEIE ((uint32_t)0x00000040) /*!< CEC Rx Missing Acknowledge IT Enable */
  2716. #define CEC_IER_ARBLSTIE ((uint32_t)0x00000080) /*!< CEC Arbitration Lost IT Enable */
  2717. #define CEC_IER_TXBRIE ((uint32_t)0x00000100) /*!< CEC Tx Byte Request IT Enable */
  2718. #define CEC_IER_TXENDIE ((uint32_t)0x00000200) /*!< CEC End of Transmission IT Enable */
  2719. #define CEC_IER_TXUDRIE ((uint32_t)0x00000400) /*!< CEC Tx-Buffer Underrun IT Enable */
  2720. #define CEC_IER_TXERRIE ((uint32_t)0x00000800) /*!< CEC Tx-Error IT Enable */
  2721. #define CEC_IER_TXACKEIE ((uint32_t)0x00001000) /*!< CEC Tx Missing Acknowledge IT Enable */
  2722. /******************************************************************************/
  2723. /* */
  2724. /* CRC calculation unit */
  2725. /* */
  2726. /******************************************************************************/
  2727. /******************* Bit definition for CRC_DR register *********************/
  2728. #define CRC_DR_DR ((uint32_t)0xFFFFFFFF) /*!< Data register bits */
  2729. /******************* Bit definition for CRC_IDR register ********************/
  2730. #define CRC_IDR_IDR ((uint32_t)0xFF) /*!< General-purpose 8-bit data register bits */
  2731. /******************** Bit definition for CRC_CR register ********************/
  2732. #define CRC_CR_RESET ((uint32_t)0x01) /*!< RESET bit */
  2733. /******************************************************************************/
  2734. /* */
  2735. /* Digital to Analog Converter */
  2736. /* */
  2737. /******************************************************************************/
  2738. /******************** Bit definition for DAC_CR register ********************/
  2739. #define DAC_CR_EN1 ((uint32_t)0x00000001) /*!<DAC channel1 enable */
  2740. #define DAC_CR_BOFF1 ((uint32_t)0x00000002) /*!<DAC channel1 output buffer disable */
  2741. #define DAC_CR_TEN1 ((uint32_t)0x00000004) /*!<DAC channel1 Trigger enable */
  2742. #define DAC_CR_TSEL1 ((uint32_t)0x00000038) /*!<TSEL1[2:0] (DAC channel1 Trigger selection) */
  2743. #define DAC_CR_TSEL1_0 ((uint32_t)0x00000008) /*!<Bit 0 */
  2744. #define DAC_CR_TSEL1_1 ((uint32_t)0x00000010) /*!<Bit 1 */
  2745. #define DAC_CR_TSEL1_2 ((uint32_t)0x00000020) /*!<Bit 2 */
  2746. #define DAC_CR_WAVE1 ((uint32_t)0x000000C0) /*!<WAVE1[1:0] (DAC channel1 noise/triangle wave generation enable) */
  2747. #define DAC_CR_WAVE1_0 ((uint32_t)0x00000040) /*!<Bit 0 */
  2748. #define DAC_CR_WAVE1_1 ((uint32_t)0x00000080) /*!<Bit 1 */
  2749. #define DAC_CR_MAMP1 ((uint32_t)0x00000F00) /*!<MAMP1[3:0] (DAC channel1 Mask/Amplitude selector) */
  2750. #define DAC_CR_MAMP1_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  2751. #define DAC_CR_MAMP1_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  2752. #define DAC_CR_MAMP1_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  2753. #define DAC_CR_MAMP1_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  2754. #define DAC_CR_DMAEN1 ((uint32_t)0x00001000) /*!<DAC channel1 DMA enable */
  2755. #define DAC_CR_EN2 ((uint32_t)0x00010000) /*!<DAC channel2 enable */
  2756. #define DAC_CR_BOFF2 ((uint32_t)0x00020000) /*!<DAC channel2 output buffer disable */
  2757. #define DAC_CR_TEN2 ((uint32_t)0x00040000) /*!<DAC channel2 Trigger enable */
  2758. #define DAC_CR_TSEL2 ((uint32_t)0x00380000) /*!<TSEL2[2:0] (DAC channel2 Trigger selection) */
  2759. #define DAC_CR_TSEL2_0 ((uint32_t)0x00080000) /*!<Bit 0 */
  2760. #define DAC_CR_TSEL2_1 ((uint32_t)0x00100000) /*!<Bit 1 */
  2761. #define DAC_CR_TSEL2_2 ((uint32_t)0x00200000) /*!<Bit 2 */
  2762. #define DAC_CR_WAVE2 ((uint32_t)0x00C00000) /*!<WAVE2[1:0] (DAC channel2 noise/triangle wave generation enable) */
  2763. #define DAC_CR_WAVE2_0 ((uint32_t)0x00400000) /*!<Bit 0 */
  2764. #define DAC_CR_WAVE2_1 ((uint32_t)0x00800000) /*!<Bit 1 */
  2765. #define DAC_CR_MAMP2 ((uint32_t)0x0F000000) /*!<MAMP2[3:0] (DAC channel2 Mask/Amplitude selector) */
  2766. #define DAC_CR_MAMP2_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  2767. #define DAC_CR_MAMP2_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  2768. #define DAC_CR_MAMP2_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  2769. #define DAC_CR_MAMP2_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  2770. #define DAC_CR_DMAEN2 ((uint32_t)0x10000000) /*!<DAC channel2 DMA enabled */
  2771. /***************** Bit definition for DAC_SWTRIGR register ******************/
  2772. #define DAC_SWTRIGR_SWTRIG1 ((uint32_t)0x01) /*!<DAC channel1 software trigger */
  2773. #define DAC_SWTRIGR_SWTRIG2 ((uint32_t)0x02) /*!<DAC channel2 software trigger */
  2774. /***************** Bit definition for DAC_DHR12R1 register ******************/
  2775. #define DAC_DHR12R1_DACC1DHR ((uint32_t)0x0FFF) /*!<DAC channel1 12-bit Right aligned data */
  2776. /***************** Bit definition for DAC_DHR12L1 register ******************/
  2777. #define DAC_DHR12L1_DACC1DHR ((uint32_t)0xFFF0) /*!<DAC channel1 12-bit Left aligned data */
  2778. /****************** Bit definition for DAC_DHR8R1 register ******************/
  2779. #define DAC_DHR8R1_DACC1DHR ((uint32_t)0xFF) /*!<DAC channel1 8-bit Right aligned data */
  2780. /***************** Bit definition for DAC_DHR12R2 register ******************/
  2781. #define DAC_DHR12R2_DACC2DHR ((uint32_t)0x0FFF) /*!<DAC channel2 12-bit Right aligned data */
  2782. /***************** Bit definition for DAC_DHR12L2 register ******************/
  2783. #define DAC_DHR12L2_DACC2DHR ((uint32_t)0xFFF0) /*!<DAC channel2 12-bit Left aligned data */
  2784. /****************** Bit definition for DAC_DHR8R2 register ******************/
  2785. #define DAC_DHR8R2_DACC2DHR ((uint32_t)0xFF) /*!<DAC channel2 8-bit Right aligned data */
  2786. /***************** Bit definition for DAC_DHR12RD register ******************/
  2787. #define DAC_DHR12RD_DACC1DHR ((uint32_t)0x00000FFF) /*!<DAC channel1 12-bit Right aligned data */
  2788. #define DAC_DHR12RD_DACC2DHR ((uint32_t)0x0FFF0000) /*!<DAC channel2 12-bit Right aligned data */
  2789. /***************** Bit definition for DAC_DHR12LD register ******************/
  2790. #define DAC_DHR12LD_DACC1DHR ((uint32_t)0x0000FFF0) /*!<DAC channel1 12-bit Left aligned data */
  2791. #define DAC_DHR12LD_DACC2DHR ((uint32_t)0xFFF00000) /*!<DAC channel2 12-bit Left aligned data */
  2792. /****************** Bit definition for DAC_DHR8RD register ******************/
  2793. #define DAC_DHR8RD_DACC1DHR ((uint32_t)0x00FF) /*!<DAC channel1 8-bit Right aligned data */
  2794. #define DAC_DHR8RD_DACC2DHR ((uint32_t)0xFF00) /*!<DAC channel2 8-bit Right aligned data */
  2795. /******************* Bit definition for DAC_DOR1 register *******************/
  2796. #define DAC_DOR1_DACC1DOR ((uint32_t)0x0FFF) /*!<DAC channel1 data output */
  2797. /******************* Bit definition for DAC_DOR2 register *******************/
  2798. #define DAC_DOR2_DACC2DOR ((uint32_t)0x0FFF) /*!<DAC channel2 data output */
  2799. /******************** Bit definition for DAC_SR register ********************/
  2800. #define DAC_SR_DMAUDR1 ((uint32_t)0x00002000) /*!<DAC channel1 DMA underrun flag */
  2801. #define DAC_SR_DMAUDR2 ((uint32_t)0x20000000) /*!<DAC channel2 DMA underrun flag */
  2802. /******************************************************************************/
  2803. /* */
  2804. /* Debug MCU */
  2805. /* */
  2806. /******************************************************************************/
  2807. /******************************************************************************/
  2808. /* */
  2809. /* DCMI */
  2810. /* */
  2811. /******************************************************************************/
  2812. /******************** Bits definition for DCMI_CR register ******************/
  2813. #define DCMI_CR_CAPTURE ((uint32_t)0x00000001)
  2814. #define DCMI_CR_CM ((uint32_t)0x00000002)
  2815. #define DCMI_CR_CROP ((uint32_t)0x00000004)
  2816. #define DCMI_CR_JPEG ((uint32_t)0x00000008)
  2817. #define DCMI_CR_ESS ((uint32_t)0x00000010)
  2818. #define DCMI_CR_PCKPOL ((uint32_t)0x00000020)
  2819. #define DCMI_CR_HSPOL ((uint32_t)0x00000040)
  2820. #define DCMI_CR_VSPOL ((uint32_t)0x00000080)
  2821. #define DCMI_CR_FCRC_0 ((uint32_t)0x00000100)
  2822. #define DCMI_CR_FCRC_1 ((uint32_t)0x00000200)
  2823. #define DCMI_CR_EDM_0 ((uint32_t)0x00000400)
  2824. #define DCMI_CR_EDM_1 ((uint32_t)0x00000800)
  2825. #define DCMI_CR_OUTEN ((uint32_t)0x00002000)
  2826. #define DCMI_CR_ENABLE ((uint32_t)0x00004000)
  2827. #define DCMI_CR_BSM_0 ((uint32_t)0x00010000)
  2828. #define DCMI_CR_BSM_1 ((uint32_t)0x00020000)
  2829. #define DCMI_CR_OEBS ((uint32_t)0x00040000)
  2830. #define DCMI_CR_LSM ((uint32_t)0x00080000)
  2831. #define DCMI_CR_OELS ((uint32_t)0x00100000)
  2832. /******************** Bits definition for DCMI_SR register ******************/
  2833. #define DCMI_SR_HSYNC ((uint32_t)0x00000001)
  2834. #define DCMI_SR_VSYNC ((uint32_t)0x00000002)
  2835. #define DCMI_SR_FNE ((uint32_t)0x00000004)
  2836. /******************** Bits definition for DCMI_RISR register ****************/
  2837. #define DCMI_RISR_FRAME_RIS ((uint32_t)0x00000001)
  2838. #define DCMI_RISR_OVF_RIS ((uint32_t)0x00000002)
  2839. #define DCMI_RISR_ERR_RIS ((uint32_t)0x00000004)
  2840. #define DCMI_RISR_VSYNC_RIS ((uint32_t)0x00000008)
  2841. #define DCMI_RISR_LINE_RIS ((uint32_t)0x00000010)
  2842. /******************** Bits definition for DCMI_IER register *****************/
  2843. #define DCMI_IER_FRAME_IE ((uint32_t)0x00000001)
  2844. #define DCMI_IER_OVF_IE ((uint32_t)0x00000002)
  2845. #define DCMI_IER_ERR_IE ((uint32_t)0x00000004)
  2846. #define DCMI_IER_VSYNC_IE ((uint32_t)0x00000008)
  2847. #define DCMI_IER_LINE_IE ((uint32_t)0x00000010)
  2848. /******************** Bits definition for DCMI_MISR register ****************/
  2849. #define DCMI_MISR_FRAME_MIS ((uint32_t)0x00000001)
  2850. #define DCMI_MISR_OVF_MIS ((uint32_t)0x00000002)
  2851. #define DCMI_MISR_ERR_MIS ((uint32_t)0x00000004)
  2852. #define DCMI_MISR_VSYNC_MIS ((uint32_t)0x00000008)
  2853. #define DCMI_MISR_LINE_MIS ((uint32_t)0x00000010)
  2854. /******************** Bits definition for DCMI_ICR register *****************/
  2855. #define DCMI_ICR_FRAME_ISC ((uint32_t)0x00000001)
  2856. #define DCMI_ICR_OVF_ISC ((uint32_t)0x00000002)
  2857. #define DCMI_ICR_ERR_ISC ((uint32_t)0x00000004)
  2858. #define DCMI_ICR_VSYNC_ISC ((uint32_t)0x00000008)
  2859. #define DCMI_ICR_LINE_ISC ((uint32_t)0x00000010)
  2860. /******************************************************************************/
  2861. /* */
  2862. /* DMA Controller */
  2863. /* */
  2864. /******************************************************************************/
  2865. /******************** Bits definition for DMA_SxCR register *****************/
  2866. #define DMA_SxCR_CHSEL ((uint32_t)0x0E000000)
  2867. #define DMA_SxCR_CHSEL_0 ((uint32_t)0x02000000)
  2868. #define DMA_SxCR_CHSEL_1 ((uint32_t)0x04000000)
  2869. #define DMA_SxCR_CHSEL_2 ((uint32_t)0x08000000)
  2870. #define DMA_SxCR_MBURST ((uint32_t)0x01800000)
  2871. #define DMA_SxCR_MBURST_0 ((uint32_t)0x00800000)
  2872. #define DMA_SxCR_MBURST_1 ((uint32_t)0x01000000)
  2873. #define DMA_SxCR_PBURST ((uint32_t)0x00600000)
  2874. #define DMA_SxCR_PBURST_0 ((uint32_t)0x00200000)
  2875. #define DMA_SxCR_PBURST_1 ((uint32_t)0x00400000)
  2876. #define DMA_SxCR_ACK ((uint32_t)0x00100000)
  2877. #define DMA_SxCR_CT ((uint32_t)0x00080000)
  2878. #define DMA_SxCR_DBM ((uint32_t)0x00040000)
  2879. #define DMA_SxCR_PL ((uint32_t)0x00030000)
  2880. #define DMA_SxCR_PL_0 ((uint32_t)0x00010000)
  2881. #define DMA_SxCR_PL_1 ((uint32_t)0x00020000)
  2882. #define DMA_SxCR_PINCOS ((uint32_t)0x00008000)
  2883. #define DMA_SxCR_MSIZE ((uint32_t)0x00006000)
  2884. #define DMA_SxCR_MSIZE_0 ((uint32_t)0x00002000)
  2885. #define DMA_SxCR_MSIZE_1 ((uint32_t)0x00004000)
  2886. #define DMA_SxCR_PSIZE ((uint32_t)0x00001800)
  2887. #define DMA_SxCR_PSIZE_0 ((uint32_t)0x00000800)
  2888. #define DMA_SxCR_PSIZE_1 ((uint32_t)0x00001000)
  2889. #define DMA_SxCR_MINC ((uint32_t)0x00000400)
  2890. #define DMA_SxCR_PINC ((uint32_t)0x00000200)
  2891. #define DMA_SxCR_CIRC ((uint32_t)0x00000100)
  2892. #define DMA_SxCR_DIR ((uint32_t)0x000000C0)
  2893. #define DMA_SxCR_DIR_0 ((uint32_t)0x00000040)
  2894. #define DMA_SxCR_DIR_1 ((uint32_t)0x00000080)
  2895. #define DMA_SxCR_PFCTRL ((uint32_t)0x00000020)
  2896. #define DMA_SxCR_TCIE ((uint32_t)0x00000010)
  2897. #define DMA_SxCR_HTIE ((uint32_t)0x00000008)
  2898. #define DMA_SxCR_TEIE ((uint32_t)0x00000004)
  2899. #define DMA_SxCR_DMEIE ((uint32_t)0x00000002)
  2900. #define DMA_SxCR_EN ((uint32_t)0x00000001)
  2901. /******************** Bits definition for DMA_SxCNDTR register **************/
  2902. #define DMA_SxNDT ((uint32_t)0x0000FFFF)
  2903. #define DMA_SxNDT_0 ((uint32_t)0x00000001)
  2904. #define DMA_SxNDT_1 ((uint32_t)0x00000002)
  2905. #define DMA_SxNDT_2 ((uint32_t)0x00000004)
  2906. #define DMA_SxNDT_3 ((uint32_t)0x00000008)
  2907. #define DMA_SxNDT_4 ((uint32_t)0x00000010)
  2908. #define DMA_SxNDT_5 ((uint32_t)0x00000020)
  2909. #define DMA_SxNDT_6 ((uint32_t)0x00000040)
  2910. #define DMA_SxNDT_7 ((uint32_t)0x00000080)
  2911. #define DMA_SxNDT_8 ((uint32_t)0x00000100)
  2912. #define DMA_SxNDT_9 ((uint32_t)0x00000200)
  2913. #define DMA_SxNDT_10 ((uint32_t)0x00000400)
  2914. #define DMA_SxNDT_11 ((uint32_t)0x00000800)
  2915. #define DMA_SxNDT_12 ((uint32_t)0x00001000)
  2916. #define DMA_SxNDT_13 ((uint32_t)0x00002000)
  2917. #define DMA_SxNDT_14 ((uint32_t)0x00004000)
  2918. #define DMA_SxNDT_15 ((uint32_t)0x00008000)
  2919. /******************** Bits definition for DMA_SxFCR register ****************/
  2920. #define DMA_SxFCR_FEIE ((uint32_t)0x00000080)
  2921. #define DMA_SxFCR_FS ((uint32_t)0x00000038)
  2922. #define DMA_SxFCR_FS_0 ((uint32_t)0x00000008)
  2923. #define DMA_SxFCR_FS_1 ((uint32_t)0x00000010)
  2924. #define DMA_SxFCR_FS_2 ((uint32_t)0x00000020)
  2925. #define DMA_SxFCR_DMDIS ((uint32_t)0x00000004)
  2926. #define DMA_SxFCR_FTH ((uint32_t)0x00000003)
  2927. #define DMA_SxFCR_FTH_0 ((uint32_t)0x00000001)
  2928. #define DMA_SxFCR_FTH_1 ((uint32_t)0x00000002)
  2929. /******************** Bits definition for DMA_LISR register *****************/
  2930. #define DMA_LISR_TCIF3 ((uint32_t)0x08000000)
  2931. #define DMA_LISR_HTIF3 ((uint32_t)0x04000000)
  2932. #define DMA_LISR_TEIF3 ((uint32_t)0x02000000)
  2933. #define DMA_LISR_DMEIF3 ((uint32_t)0x01000000)
  2934. #define DMA_LISR_FEIF3 ((uint32_t)0x00400000)
  2935. #define DMA_LISR_TCIF2 ((uint32_t)0x00200000)
  2936. #define DMA_LISR_HTIF2 ((uint32_t)0x00100000)
  2937. #define DMA_LISR_TEIF2 ((uint32_t)0x00080000)
  2938. #define DMA_LISR_DMEIF2 ((uint32_t)0x00040000)
  2939. #define DMA_LISR_FEIF2 ((uint32_t)0x00010000)
  2940. #define DMA_LISR_TCIF1 ((uint32_t)0x00000800)
  2941. #define DMA_LISR_HTIF1 ((uint32_t)0x00000400)
  2942. #define DMA_LISR_TEIF1 ((uint32_t)0x00000200)
  2943. #define DMA_LISR_DMEIF1 ((uint32_t)0x00000100)
  2944. #define DMA_LISR_FEIF1 ((uint32_t)0x00000040)
  2945. #define DMA_LISR_TCIF0 ((uint32_t)0x00000020)
  2946. #define DMA_LISR_HTIF0 ((uint32_t)0x00000010)
  2947. #define DMA_LISR_TEIF0 ((uint32_t)0x00000008)
  2948. #define DMA_LISR_DMEIF0 ((uint32_t)0x00000004)
  2949. #define DMA_LISR_FEIF0 ((uint32_t)0x00000001)
  2950. /******************** Bits definition for DMA_HISR register *****************/
  2951. #define DMA_HISR_TCIF7 ((uint32_t)0x08000000)
  2952. #define DMA_HISR_HTIF7 ((uint32_t)0x04000000)
  2953. #define DMA_HISR_TEIF7 ((uint32_t)0x02000000)
  2954. #define DMA_HISR_DMEIF7 ((uint32_t)0x01000000)
  2955. #define DMA_HISR_FEIF7 ((uint32_t)0x00400000)
  2956. #define DMA_HISR_TCIF6 ((uint32_t)0x00200000)
  2957. #define DMA_HISR_HTIF6 ((uint32_t)0x00100000)
  2958. #define DMA_HISR_TEIF6 ((uint32_t)0x00080000)
  2959. #define DMA_HISR_DMEIF6 ((uint32_t)0x00040000)
  2960. #define DMA_HISR_FEIF6 ((uint32_t)0x00010000)
  2961. #define DMA_HISR_TCIF5 ((uint32_t)0x00000800)
  2962. #define DMA_HISR_HTIF5 ((uint32_t)0x00000400)
  2963. #define DMA_HISR_TEIF5 ((uint32_t)0x00000200)
  2964. #define DMA_HISR_DMEIF5 ((uint32_t)0x00000100)
  2965. #define DMA_HISR_FEIF5 ((uint32_t)0x00000040)
  2966. #define DMA_HISR_TCIF4 ((uint32_t)0x00000020)
  2967. #define DMA_HISR_HTIF4 ((uint32_t)0x00000010)
  2968. #define DMA_HISR_TEIF4 ((uint32_t)0x00000008)
  2969. #define DMA_HISR_DMEIF4 ((uint32_t)0x00000004)
  2970. #define DMA_HISR_FEIF4 ((uint32_t)0x00000001)
  2971. /******************** Bits definition for DMA_LIFCR register ****************/
  2972. #define DMA_LIFCR_CTCIF3 ((uint32_t)0x08000000)
  2973. #define DMA_LIFCR_CHTIF3 ((uint32_t)0x04000000)
  2974. #define DMA_LIFCR_CTEIF3 ((uint32_t)0x02000000)
  2975. #define DMA_LIFCR_CDMEIF3 ((uint32_t)0x01000000)
  2976. #define DMA_LIFCR_CFEIF3 ((uint32_t)0x00400000)
  2977. #define DMA_LIFCR_CTCIF2 ((uint32_t)0x00200000)
  2978. #define DMA_LIFCR_CHTIF2 ((uint32_t)0x00100000)
  2979. #define DMA_LIFCR_CTEIF2 ((uint32_t)0x00080000)
  2980. #define DMA_LIFCR_CDMEIF2 ((uint32_t)0x00040000)
  2981. #define DMA_LIFCR_CFEIF2 ((uint32_t)0x00010000)
  2982. #define DMA_LIFCR_CTCIF1 ((uint32_t)0x00000800)
  2983. #define DMA_LIFCR_CHTIF1 ((uint32_t)0x00000400)
  2984. #define DMA_LIFCR_CTEIF1 ((uint32_t)0x00000200)
  2985. #define DMA_LIFCR_CDMEIF1 ((uint32_t)0x00000100)
  2986. #define DMA_LIFCR_CFEIF1 ((uint32_t)0x00000040)
  2987. #define DMA_LIFCR_CTCIF0 ((uint32_t)0x00000020)
  2988. #define DMA_LIFCR_CHTIF0 ((uint32_t)0x00000010)
  2989. #define DMA_LIFCR_CTEIF0 ((uint32_t)0x00000008)
  2990. #define DMA_LIFCR_CDMEIF0 ((uint32_t)0x00000004)
  2991. #define DMA_LIFCR_CFEIF0 ((uint32_t)0x00000001)
  2992. /******************** Bits definition for DMA_HIFCR register ****************/
  2993. #define DMA_HIFCR_CTCIF7 ((uint32_t)0x08000000)
  2994. #define DMA_HIFCR_CHTIF7 ((uint32_t)0x04000000)
  2995. #define DMA_HIFCR_CTEIF7 ((uint32_t)0x02000000)
  2996. #define DMA_HIFCR_CDMEIF7 ((uint32_t)0x01000000)
  2997. #define DMA_HIFCR_CFEIF7 ((uint32_t)0x00400000)
  2998. #define DMA_HIFCR_CTCIF6 ((uint32_t)0x00200000)
  2999. #define DMA_HIFCR_CHTIF6 ((uint32_t)0x00100000)
  3000. #define DMA_HIFCR_CTEIF6 ((uint32_t)0x00080000)
  3001. #define DMA_HIFCR_CDMEIF6 ((uint32_t)0x00040000)
  3002. #define DMA_HIFCR_CFEIF6 ((uint32_t)0x00010000)
  3003. #define DMA_HIFCR_CTCIF5 ((uint32_t)0x00000800)
  3004. #define DMA_HIFCR_CHTIF5 ((uint32_t)0x00000400)
  3005. #define DMA_HIFCR_CTEIF5 ((uint32_t)0x00000200)
  3006. #define DMA_HIFCR_CDMEIF5 ((uint32_t)0x00000100)
  3007. #define DMA_HIFCR_CFEIF5 ((uint32_t)0x00000040)
  3008. #define DMA_HIFCR_CTCIF4 ((uint32_t)0x00000020)
  3009. #define DMA_HIFCR_CHTIF4 ((uint32_t)0x00000010)
  3010. #define DMA_HIFCR_CTEIF4 ((uint32_t)0x00000008)
  3011. #define DMA_HIFCR_CDMEIF4 ((uint32_t)0x00000004)
  3012. #define DMA_HIFCR_CFEIF4 ((uint32_t)0x00000001)
  3013. /******************************************************************************/
  3014. /* */
  3015. /* External Interrupt/Event Controller */
  3016. /* */
  3017. /******************************************************************************/
  3018. /******************* Bit definition for EXTI_IMR register *******************/
  3019. #define EXTI_IMR_MR0 ((uint32_t)0x00000001) /*!< Interrupt Mask on line 0 */
  3020. #define EXTI_IMR_MR1 ((uint32_t)0x00000002) /*!< Interrupt Mask on line 1 */
  3021. #define EXTI_IMR_MR2 ((uint32_t)0x00000004) /*!< Interrupt Mask on line 2 */
  3022. #define EXTI_IMR_MR3 ((uint32_t)0x00000008) /*!< Interrupt Mask on line 3 */
  3023. #define EXTI_IMR_MR4 ((uint32_t)0x00000010) /*!< Interrupt Mask on line 4 */
  3024. #define EXTI_IMR_MR5 ((uint32_t)0x00000020) /*!< Interrupt Mask on line 5 */
  3025. #define EXTI_IMR_MR6 ((uint32_t)0x00000040) /*!< Interrupt Mask on line 6 */
  3026. #define EXTI_IMR_MR7 ((uint32_t)0x00000080) /*!< Interrupt Mask on line 7 */
  3027. #define EXTI_IMR_MR8 ((uint32_t)0x00000100) /*!< Interrupt Mask on line 8 */
  3028. #define EXTI_IMR_MR9 ((uint32_t)0x00000200) /*!< Interrupt Mask on line 9 */
  3029. #define EXTI_IMR_MR10 ((uint32_t)0x00000400) /*!< Interrupt Mask on line 10 */
  3030. #define EXTI_IMR_MR11 ((uint32_t)0x00000800) /*!< Interrupt Mask on line 11 */
  3031. #define EXTI_IMR_MR12 ((uint32_t)0x00001000) /*!< Interrupt Mask on line 12 */
  3032. #define EXTI_IMR_MR13 ((uint32_t)0x00002000) /*!< Interrupt Mask on line 13 */
  3033. #define EXTI_IMR_MR14 ((uint32_t)0x00004000) /*!< Interrupt Mask on line 14 */
  3034. #define EXTI_IMR_MR15 ((uint32_t)0x00008000) /*!< Interrupt Mask on line 15 */
  3035. #define EXTI_IMR_MR16 ((uint32_t)0x00010000) /*!< Interrupt Mask on line 16 */
  3036. #define EXTI_IMR_MR17 ((uint32_t)0x00020000) /*!< Interrupt Mask on line 17 */
  3037. #define EXTI_IMR_MR18 ((uint32_t)0x00040000) /*!< Interrupt Mask on line 18 */
  3038. #define EXTI_IMR_MR19 ((uint32_t)0x00080000) /*!< Interrupt Mask on line 19 */
  3039. #define EXTI_IMR_MR20 ((uint32_t)0x00100000) /*!< Interrupt Mask on line 20 */
  3040. #define EXTI_IMR_MR21 ((uint32_t)0x00200000) /*!< Interrupt Mask on line 21 */
  3041. #define EXTI_IMR_MR22 ((uint32_t)0x00400000) /*!< Interrupt Mask on line 22 */
  3042. /******************* Bit definition for EXTI_EMR register *******************/
  3043. #define EXTI_EMR_MR0 ((uint32_t)0x00000001) /*!< Event Mask on line 0 */
  3044. #define EXTI_EMR_MR1 ((uint32_t)0x00000002) /*!< Event Mask on line 1 */
  3045. #define EXTI_EMR_MR2 ((uint32_t)0x00000004) /*!< Event Mask on line 2 */
  3046. #define EXTI_EMR_MR3 ((uint32_t)0x00000008) /*!< Event Mask on line 3 */
  3047. #define EXTI_EMR_MR4 ((uint32_t)0x00000010) /*!< Event Mask on line 4 */
  3048. #define EXTI_EMR_MR5 ((uint32_t)0x00000020) /*!< Event Mask on line 5 */
  3049. #define EXTI_EMR_MR6 ((uint32_t)0x00000040) /*!< Event Mask on line 6 */
  3050. #define EXTI_EMR_MR7 ((uint32_t)0x00000080) /*!< Event Mask on line 7 */
  3051. #define EXTI_EMR_MR8 ((uint32_t)0x00000100) /*!< Event Mask on line 8 */
  3052. #define EXTI_EMR_MR9 ((uint32_t)0x00000200) /*!< Event Mask on line 9 */
  3053. #define EXTI_EMR_MR10 ((uint32_t)0x00000400) /*!< Event Mask on line 10 */
  3054. #define EXTI_EMR_MR11 ((uint32_t)0x00000800) /*!< Event Mask on line 11 */
  3055. #define EXTI_EMR_MR12 ((uint32_t)0x00001000) /*!< Event Mask on line 12 */
  3056. #define EXTI_EMR_MR13 ((uint32_t)0x00002000) /*!< Event Mask on line 13 */
  3057. #define EXTI_EMR_MR14 ((uint32_t)0x00004000) /*!< Event Mask on line 14 */
  3058. #define EXTI_EMR_MR15 ((uint32_t)0x00008000) /*!< Event Mask on line 15 */
  3059. #define EXTI_EMR_MR16 ((uint32_t)0x00010000) /*!< Event Mask on line 16 */
  3060. #define EXTI_EMR_MR17 ((uint32_t)0x00020000) /*!< Event Mask on line 17 */
  3061. #define EXTI_EMR_MR18 ((uint32_t)0x00040000) /*!< Event Mask on line 18 */
  3062. #define EXTI_EMR_MR19 ((uint32_t)0x00080000) /*!< Event Mask on line 19 */
  3063. #define EXTI_EMR_MR20 ((uint32_t)0x00100000) /*!< Event Mask on line 20 */
  3064. #define EXTI_EMR_MR21 ((uint32_t)0x00200000) /*!< Event Mask on line 21 */
  3065. #define EXTI_EMR_MR22 ((uint32_t)0x00400000) /*!< Event Mask on line 22 */
  3066. /****************** Bit definition for EXTI_RTSR register *******************/
  3067. #define EXTI_RTSR_TR0 ((uint32_t)0x00000001) /*!< Rising trigger event configuration bit of line 0 */
  3068. #define EXTI_RTSR_TR1 ((uint32_t)0x00000002) /*!< Rising trigger event configuration bit of line 1 */
  3069. #define EXTI_RTSR_TR2 ((uint32_t)0x00000004) /*!< Rising trigger event configuration bit of line 2 */
  3070. #define EXTI_RTSR_TR3 ((uint32_t)0x00000008) /*!< Rising trigger event configuration bit of line 3 */
  3071. #define EXTI_RTSR_TR4 ((uint32_t)0x00000010) /*!< Rising trigger event configuration bit of line 4 */
  3072. #define EXTI_RTSR_TR5 ((uint32_t)0x00000020) /*!< Rising trigger event configuration bit of line 5 */
  3073. #define EXTI_RTSR_TR6 ((uint32_t)0x00000040) /*!< Rising trigger event configuration bit of line 6 */
  3074. #define EXTI_RTSR_TR7 ((uint32_t)0x00000080) /*!< Rising trigger event configuration bit of line 7 */
  3075. #define EXTI_RTSR_TR8 ((uint32_t)0x00000100) /*!< Rising trigger event configuration bit of line 8 */
  3076. #define EXTI_RTSR_TR9 ((uint32_t)0x00000200) /*!< Rising trigger event configuration bit of line 9 */
  3077. #define EXTI_RTSR_TR10 ((uint32_t)0x00000400) /*!< Rising trigger event configuration bit of line 10 */
  3078. #define EXTI_RTSR_TR11 ((uint32_t)0x00000800) /*!< Rising trigger event configuration bit of line 11 */
  3079. #define EXTI_RTSR_TR12 ((uint32_t)0x00001000) /*!< Rising trigger event configuration bit of line 12 */
  3080. #define EXTI_RTSR_TR13 ((uint32_t)0x00002000) /*!< Rising trigger event configuration bit of line 13 */
  3081. #define EXTI_RTSR_TR14 ((uint32_t)0x00004000) /*!< Rising trigger event configuration bit of line 14 */
  3082. #define EXTI_RTSR_TR15 ((uint32_t)0x00008000) /*!< Rising trigger event configuration bit of line 15 */
  3083. #define EXTI_RTSR_TR16 ((uint32_t)0x00010000) /*!< Rising trigger event configuration bit of line 16 */
  3084. #define EXTI_RTSR_TR17 ((uint32_t)0x00020000) /*!< Rising trigger event configuration bit of line 17 */
  3085. #define EXTI_RTSR_TR18 ((uint32_t)0x00040000) /*!< Rising trigger event configuration bit of line 18 */
  3086. #define EXTI_RTSR_TR19 ((uint32_t)0x00080000) /*!< Rising trigger event configuration bit of line 19 */
  3087. #define EXTI_RTSR_TR20 ((uint32_t)0x00100000) /*!< Rising trigger event configuration bit of line 20 */
  3088. #define EXTI_RTSR_TR21 ((uint32_t)0x00200000) /*!< Rising trigger event configuration bit of line 21 */
  3089. #define EXTI_RTSR_TR22 ((uint32_t)0x00400000) /*!< Rising trigger event configuration bit of line 22 */
  3090. /****************** Bit definition for EXTI_FTSR register *******************/
  3091. #define EXTI_FTSR_TR0 ((uint32_t)0x00000001) /*!< Falling trigger event configuration bit of line 0 */
  3092. #define EXTI_FTSR_TR1 ((uint32_t)0x00000002) /*!< Falling trigger event configuration bit of line 1 */
  3093. #define EXTI_FTSR_TR2 ((uint32_t)0x00000004) /*!< Falling trigger event configuration bit of line 2 */
  3094. #define EXTI_FTSR_TR3 ((uint32_t)0x00000008) /*!< Falling trigger event configuration bit of line 3 */
  3095. #define EXTI_FTSR_TR4 ((uint32_t)0x00000010) /*!< Falling trigger event configuration bit of line 4 */
  3096. #define EXTI_FTSR_TR5 ((uint32_t)0x00000020) /*!< Falling trigger event configuration bit of line 5 */
  3097. #define EXTI_FTSR_TR6 ((uint32_t)0x00000040) /*!< Falling trigger event configuration bit of line 6 */
  3098. #define EXTI_FTSR_TR7 ((uint32_t)0x00000080) /*!< Falling trigger event configuration bit of line 7 */
  3099. #define EXTI_FTSR_TR8 ((uint32_t)0x00000100) /*!< Falling trigger event configuration bit of line 8 */
  3100. #define EXTI_FTSR_TR9 ((uint32_t)0x00000200) /*!< Falling trigger event configuration bit of line 9 */
  3101. #define EXTI_FTSR_TR10 ((uint32_t)0x00000400) /*!< Falling trigger event configuration bit of line 10 */
  3102. #define EXTI_FTSR_TR11 ((uint32_t)0x00000800) /*!< Falling trigger event configuration bit of line 11 */
  3103. #define EXTI_FTSR_TR12 ((uint32_t)0x00001000) /*!< Falling trigger event configuration bit of line 12 */
  3104. #define EXTI_FTSR_TR13 ((uint32_t)0x00002000) /*!< Falling trigger event configuration bit of line 13 */
  3105. #define EXTI_FTSR_TR14 ((uint32_t)0x00004000) /*!< Falling trigger event configuration bit of line 14 */
  3106. #define EXTI_FTSR_TR15 ((uint32_t)0x00008000) /*!< Falling trigger event configuration bit of line 15 */
  3107. #define EXTI_FTSR_TR16 ((uint32_t)0x00010000) /*!< Falling trigger event configuration bit of line 16 */
  3108. #define EXTI_FTSR_TR17 ((uint32_t)0x00020000) /*!< Falling trigger event configuration bit of line 17 */
  3109. #define EXTI_FTSR_TR18 ((uint32_t)0x00040000) /*!< Falling trigger event configuration bit of line 18 */
  3110. #define EXTI_FTSR_TR19 ((uint32_t)0x00080000) /*!< Falling trigger event configuration bit of line 19 */
  3111. #define EXTI_FTSR_TR20 ((uint32_t)0x00100000) /*!< Falling trigger event configuration bit of line 20 */
  3112. #define EXTI_FTSR_TR21 ((uint32_t)0x00200000) /*!< Falling trigger event configuration bit of line 21 */
  3113. #define EXTI_FTSR_TR22 ((uint32_t)0x00400000) /*!< Falling trigger event configuration bit of line 22 */
  3114. /****************** Bit definition for EXTI_SWIER register ******************/
  3115. #define EXTI_SWIER_SWIER0 ((uint32_t)0x00000001) /*!< Software Interrupt on line 0 */
  3116. #define EXTI_SWIER_SWIER1 ((uint32_t)0x00000002) /*!< Software Interrupt on line 1 */
  3117. #define EXTI_SWIER_SWIER2 ((uint32_t)0x00000004) /*!< Software Interrupt on line 2 */
  3118. #define EXTI_SWIER_SWIER3 ((uint32_t)0x00000008) /*!< Software Interrupt on line 3 */
  3119. #define EXTI_SWIER_SWIER4 ((uint32_t)0x00000010) /*!< Software Interrupt on line 4 */
  3120. #define EXTI_SWIER_SWIER5 ((uint32_t)0x00000020) /*!< Software Interrupt on line 5 */
  3121. #define EXTI_SWIER_SWIER6 ((uint32_t)0x00000040) /*!< Software Interrupt on line 6 */
  3122. #define EXTI_SWIER_SWIER7 ((uint32_t)0x00000080) /*!< Software Interrupt on line 7 */
  3123. #define EXTI_SWIER_SWIER8 ((uint32_t)0x00000100) /*!< Software Interrupt on line 8 */
  3124. #define EXTI_SWIER_SWIER9 ((uint32_t)0x00000200) /*!< Software Interrupt on line 9 */
  3125. #define EXTI_SWIER_SWIER10 ((uint32_t)0x00000400) /*!< Software Interrupt on line 10 */
  3126. #define EXTI_SWIER_SWIER11 ((uint32_t)0x00000800) /*!< Software Interrupt on line 11 */
  3127. #define EXTI_SWIER_SWIER12 ((uint32_t)0x00001000) /*!< Software Interrupt on line 12 */
  3128. #define EXTI_SWIER_SWIER13 ((uint32_t)0x00002000) /*!< Software Interrupt on line 13 */
  3129. #define EXTI_SWIER_SWIER14 ((uint32_t)0x00004000) /*!< Software Interrupt on line 14 */
  3130. #define EXTI_SWIER_SWIER15 ((uint32_t)0x00008000) /*!< Software Interrupt on line 15 */
  3131. #define EXTI_SWIER_SWIER16 ((uint32_t)0x00010000) /*!< Software Interrupt on line 16 */
  3132. #define EXTI_SWIER_SWIER17 ((uint32_t)0x00020000) /*!< Software Interrupt on line 17 */
  3133. #define EXTI_SWIER_SWIER18 ((uint32_t)0x00040000) /*!< Software Interrupt on line 18 */
  3134. #define EXTI_SWIER_SWIER19 ((uint32_t)0x00080000) /*!< Software Interrupt on line 19 */
  3135. #define EXTI_SWIER_SWIER20 ((uint32_t)0x00100000) /*!< Software Interrupt on line 20 */
  3136. #define EXTI_SWIER_SWIER21 ((uint32_t)0x00200000) /*!< Software Interrupt on line 21 */
  3137. #define EXTI_SWIER_SWIER22 ((uint32_t)0x00400000) /*!< Software Interrupt on line 22 */
  3138. /******************* Bit definition for EXTI_PR register ********************/
  3139. #define EXTI_PR_PR0 ((uint32_t)0x00000001) /*!< Pending bit for line 0 */
  3140. #define EXTI_PR_PR1 ((uint32_t)0x00000002) /*!< Pending bit for line 1 */
  3141. #define EXTI_PR_PR2 ((uint32_t)0x00000004) /*!< Pending bit for line 2 */
  3142. #define EXTI_PR_PR3 ((uint32_t)0x00000008) /*!< Pending bit for line 3 */
  3143. #define EXTI_PR_PR4 ((uint32_t)0x00000010) /*!< Pending bit for line 4 */
  3144. #define EXTI_PR_PR5 ((uint32_t)0x00000020) /*!< Pending bit for line 5 */
  3145. #define EXTI_PR_PR6 ((uint32_t)0x00000040) /*!< Pending bit for line 6 */
  3146. #define EXTI_PR_PR7 ((uint32_t)0x00000080) /*!< Pending bit for line 7 */
  3147. #define EXTI_PR_PR8 ((uint32_t)0x00000100) /*!< Pending bit for line 8 */
  3148. #define EXTI_PR_PR9 ((uint32_t)0x00000200) /*!< Pending bit for line 9 */
  3149. #define EXTI_PR_PR10 ((uint32_t)0x00000400) /*!< Pending bit for line 10 */
  3150. #define EXTI_PR_PR11 ((uint32_t)0x00000800) /*!< Pending bit for line 11 */
  3151. #define EXTI_PR_PR12 ((uint32_t)0x00001000) /*!< Pending bit for line 12 */
  3152. #define EXTI_PR_PR13 ((uint32_t)0x00002000) /*!< Pending bit for line 13 */
  3153. #define EXTI_PR_PR14 ((uint32_t)0x00004000) /*!< Pending bit for line 14 */
  3154. #define EXTI_PR_PR15 ((uint32_t)0x00008000) /*!< Pending bit for line 15 */
  3155. #define EXTI_PR_PR16 ((uint32_t)0x00010000) /*!< Pending bit for line 16 */
  3156. #define EXTI_PR_PR17 ((uint32_t)0x00020000) /*!< Pending bit for line 17 */
  3157. #define EXTI_PR_PR18 ((uint32_t)0x00040000) /*!< Pending bit for line 18 */
  3158. #define EXTI_PR_PR19 ((uint32_t)0x00080000) /*!< Pending bit for line 19 */
  3159. #define EXTI_PR_PR20 ((uint32_t)0x00100000) /*!< Pending bit for line 20 */
  3160. #define EXTI_PR_PR21 ((uint32_t)0x00200000) /*!< Pending bit for line 21 */
  3161. #define EXTI_PR_PR22 ((uint32_t)0x00400000) /*!< Pending bit for line 22 */
  3162. /******************************************************************************/
  3163. /* */
  3164. /* FLASH */
  3165. /* */
  3166. /******************************************************************************/
  3167. /******************* Bits definition for FLASH_ACR register *****************/
  3168. #define FLASH_ACR_LATENCY ((uint32_t)0x0000000F)
  3169. #define FLASH_ACR_LATENCY_0WS ((uint32_t)0x00000000)
  3170. #define FLASH_ACR_LATENCY_1WS ((uint32_t)0x00000001)
  3171. #define FLASH_ACR_LATENCY_2WS ((uint32_t)0x00000002)
  3172. #define FLASH_ACR_LATENCY_3WS ((uint32_t)0x00000003)
  3173. #define FLASH_ACR_LATENCY_4WS ((uint32_t)0x00000004)
  3174. #define FLASH_ACR_LATENCY_5WS ((uint32_t)0x00000005)
  3175. #define FLASH_ACR_LATENCY_6WS ((uint32_t)0x00000006)
  3176. #define FLASH_ACR_LATENCY_7WS ((uint32_t)0x00000007)
  3177. #define FLASH_ACR_LATENCY_8WS ((uint32_t)0x00000008)
  3178. #define FLASH_ACR_LATENCY_9WS ((uint32_t)0x00000009)
  3179. #define FLASH_ACR_LATENCY_10WS ((uint32_t)0x0000000A)
  3180. #define FLASH_ACR_LATENCY_11WS ((uint32_t)0x0000000B)
  3181. #define FLASH_ACR_LATENCY_12WS ((uint32_t)0x0000000C)
  3182. #define FLASH_ACR_LATENCY_13WS ((uint32_t)0x0000000D)
  3183. #define FLASH_ACR_LATENCY_14WS ((uint32_t)0x0000000E)
  3184. #define FLASH_ACR_LATENCY_15WS ((uint32_t)0x0000000F)
  3185. #define FLASH_ACR_PRFTEN ((uint32_t)0x00000100)
  3186. #define FLASH_ACR_ICEN ((uint32_t)0x00000200)
  3187. #define FLASH_ACR_DCEN ((uint32_t)0x00000400)
  3188. #define FLASH_ACR_ICRST ((uint32_t)0x00000800)
  3189. #define FLASH_ACR_DCRST ((uint32_t)0x00001000)
  3190. #define FLASH_ACR_BYTE0_ADDRESS ((uint32_t)0x40023C00)
  3191. #define FLASH_ACR_BYTE2_ADDRESS ((uint32_t)0x40023C03)
  3192. /******************* Bits definition for FLASH_SR register ******************/
  3193. #define FLASH_SR_EOP ((uint32_t)0x00000001)
  3194. #define FLASH_SR_SOP ((uint32_t)0x00000002)
  3195. #define FLASH_SR_WRPERR ((uint32_t)0x00000010)
  3196. #define FLASH_SR_PGAERR ((uint32_t)0x00000020)
  3197. #define FLASH_SR_PGPERR ((uint32_t)0x00000040)
  3198. #define FLASH_SR_PGSERR ((uint32_t)0x00000080)
  3199. #define FLASH_SR_BSY ((uint32_t)0x00010000)
  3200. /******************* Bits definition for FLASH_CR register ******************/
  3201. #define FLASH_CR_PG ((uint32_t)0x00000001)
  3202. #define FLASH_CR_SER ((uint32_t)0x00000002)
  3203. #define FLASH_CR_MER ((uint32_t)0x00000004)
  3204. #define FLASH_CR_MER1 FLASH_CR_MER
  3205. #define FLASH_CR_SNB ((uint32_t)0x000000F8)
  3206. #define FLASH_CR_SNB_0 ((uint32_t)0x00000008)
  3207. #define FLASH_CR_SNB_1 ((uint32_t)0x00000010)
  3208. #define FLASH_CR_SNB_2 ((uint32_t)0x00000020)
  3209. #define FLASH_CR_SNB_3 ((uint32_t)0x00000040)
  3210. #define FLASH_CR_SNB_4 ((uint32_t)0x00000080)
  3211. #define FLASH_CR_PSIZE ((uint32_t)0x00000300)
  3212. #define FLASH_CR_PSIZE_0 ((uint32_t)0x00000100)
  3213. #define FLASH_CR_PSIZE_1 ((uint32_t)0x00000200)
  3214. #define FLASH_CR_MER2 ((uint32_t)0x00008000)
  3215. #define FLASH_CR_STRT ((uint32_t)0x00010000)
  3216. #define FLASH_CR_EOPIE ((uint32_t)0x01000000)
  3217. #define FLASH_CR_LOCK ((uint32_t)0x80000000)
  3218. /******************* Bits definition for FLASH_OPTCR register ***************/
  3219. #define FLASH_OPTCR_OPTLOCK ((uint32_t)0x00000001)
  3220. #define FLASH_OPTCR_OPTSTRT ((uint32_t)0x00000002)
  3221. #define FLASH_OPTCR_BOR_LEV_0 ((uint32_t)0x00000004)
  3222. #define FLASH_OPTCR_BOR_LEV_1 ((uint32_t)0x00000008)
  3223. #define FLASH_OPTCR_BOR_LEV ((uint32_t)0x0000000C)
  3224. #define FLASH_OPTCR_BFB2 ((uint32_t)0x00000010)
  3225. #define FLASH_OPTCR_WDG_SW ((uint32_t)0x00000020)
  3226. #define FLASH_OPTCR_nRST_STOP ((uint32_t)0x00000040)
  3227. #define FLASH_OPTCR_nRST_STDBY ((uint32_t)0x00000080)
  3228. #define FLASH_OPTCR_RDP ((uint32_t)0x0000FF00)
  3229. #define FLASH_OPTCR_RDP_0 ((uint32_t)0x00000100)
  3230. #define FLASH_OPTCR_RDP_1 ((uint32_t)0x00000200)
  3231. #define FLASH_OPTCR_RDP_2 ((uint32_t)0x00000400)
  3232. #define FLASH_OPTCR_RDP_3 ((uint32_t)0x00000800)
  3233. #define FLASH_OPTCR_RDP_4 ((uint32_t)0x00001000)
  3234. #define FLASH_OPTCR_RDP_5 ((uint32_t)0x00002000)
  3235. #define FLASH_OPTCR_RDP_6 ((uint32_t)0x00004000)
  3236. #define FLASH_OPTCR_RDP_7 ((uint32_t)0x00008000)
  3237. #define FLASH_OPTCR_nWRP ((uint32_t)0x0FFF0000)
  3238. #define FLASH_OPTCR_nWRP_0 ((uint32_t)0x00010000)
  3239. #define FLASH_OPTCR_nWRP_1 ((uint32_t)0x00020000)
  3240. #define FLASH_OPTCR_nWRP_2 ((uint32_t)0x00040000)
  3241. #define FLASH_OPTCR_nWRP_3 ((uint32_t)0x00080000)
  3242. #define FLASH_OPTCR_nWRP_4 ((uint32_t)0x00100000)
  3243. #define FLASH_OPTCR_nWRP_5 ((uint32_t)0x00200000)
  3244. #define FLASH_OPTCR_nWRP_6 ((uint32_t)0x00400000)
  3245. #define FLASH_OPTCR_nWRP_7 ((uint32_t)0x00800000)
  3246. #define FLASH_OPTCR_nWRP_8 ((uint32_t)0x01000000)
  3247. #define FLASH_OPTCR_nWRP_9 ((uint32_t)0x02000000)
  3248. #define FLASH_OPTCR_nWRP_10 ((uint32_t)0x04000000)
  3249. #define FLASH_OPTCR_nWRP_11 ((uint32_t)0x08000000)
  3250. #define FLASH_OPTCR_DB1M ((uint32_t)0x40000000)
  3251. #define FLASH_OPTCR_SPRMOD ((uint32_t)0x80000000)
  3252. /****************** Bits definition for FLASH_OPTCR1 register ***************/
  3253. #define FLASH_OPTCR1_nWRP ((uint32_t)0x0FFF0000)
  3254. #define FLASH_OPTCR1_nWRP_0 ((uint32_t)0x00010000)
  3255. #define FLASH_OPTCR1_nWRP_1 ((uint32_t)0x00020000)
  3256. #define FLASH_OPTCR1_nWRP_2 ((uint32_t)0x00040000)
  3257. #define FLASH_OPTCR1_nWRP_3 ((uint32_t)0x00080000)
  3258. #define FLASH_OPTCR1_nWRP_4 ((uint32_t)0x00100000)
  3259. #define FLASH_OPTCR1_nWRP_5 ((uint32_t)0x00200000)
  3260. #define FLASH_OPTCR1_nWRP_6 ((uint32_t)0x00400000)
  3261. #define FLASH_OPTCR1_nWRP_7 ((uint32_t)0x00800000)
  3262. #define FLASH_OPTCR1_nWRP_8 ((uint32_t)0x01000000)
  3263. #define FLASH_OPTCR1_nWRP_9 ((uint32_t)0x02000000)
  3264. #define FLASH_OPTCR1_nWRP_10 ((uint32_t)0x04000000)
  3265. #define FLASH_OPTCR1_nWRP_11 ((uint32_t)0x08000000)
  3266. /******************************************************************************/
  3267. /* */
  3268. /* Flexible Memory Controller */
  3269. /* */
  3270. /******************************************************************************/
  3271. /****************** Bit definition for FMC_BCR1 register *******************/
  3272. #define FMC_BCR1_MBKEN ((uint32_t)0x00000001) /*!<Memory bank enable bit */
  3273. #define FMC_BCR1_MUXEN ((uint32_t)0x00000002) /*!<Address/data multiplexing enable bit */
  3274. #define FMC_BCR1_MTYP ((uint32_t)0x0000000C) /*!<MTYP[1:0] bits (Memory type) */
  3275. #define FMC_BCR1_MTYP_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  3276. #define FMC_BCR1_MTYP_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  3277. #define FMC_BCR1_MWID ((uint32_t)0x00000030) /*!<MWID[1:0] bits (Memory data bus width) */
  3278. #define FMC_BCR1_MWID_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3279. #define FMC_BCR1_MWID_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3280. #define FMC_BCR1_FACCEN ((uint32_t)0x00000040) /*!<Flash access enable */
  3281. #define FMC_BCR1_BURSTEN ((uint32_t)0x00000100) /*!<Burst enable bit */
  3282. #define FMC_BCR1_WAITPOL ((uint32_t)0x00000200) /*!<Wait signal polarity bit */
  3283. #define FMC_BCR1_WAITCFG ((uint32_t)0x00000800) /*!<Wait timing configuration */
  3284. #define FMC_BCR1_WREN ((uint32_t)0x00001000) /*!<Write enable bit */
  3285. #define FMC_BCR1_WAITEN ((uint32_t)0x00002000) /*!<Wait enable bit */
  3286. #define FMC_BCR1_EXTMOD ((uint32_t)0x00004000) /*!<Extended mode enable */
  3287. #define FMC_BCR1_ASYNCWAIT ((uint32_t)0x00008000) /*!<Asynchronous wait */
  3288. #define FMC_BCR1_CPSIZE ((uint32_t)0x00070000) /*!<CRAM page size */
  3289. #define FMC_BCR1_CPSIZE_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3290. #define FMC_BCR1_CPSIZE_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3291. #define FMC_BCR1_CPSIZE_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3292. #define FMC_BCR1_CBURSTRW ((uint32_t)0x00080000) /*!<Write burst enable */
  3293. #define FMC_BCR1_CCLKEN ((uint32_t)0x00100000) /*!<Continous clock enable */
  3294. #define FMC_BCR1_WFDIS ((uint32_t)0x00200000) /*!<Write FIFO Disable */
  3295. /****************** Bit definition for FMC_BCR2 register *******************/
  3296. #define FMC_BCR2_MBKEN ((uint32_t)0x00000001) /*!<Memory bank enable bit */
  3297. #define FMC_BCR2_MUXEN ((uint32_t)0x00000002) /*!<Address/data multiplexing enable bit */
  3298. #define FMC_BCR2_MTYP ((uint32_t)0x0000000C) /*!<MTYP[1:0] bits (Memory type) */
  3299. #define FMC_BCR2_MTYP_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  3300. #define FMC_BCR2_MTYP_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  3301. #define FMC_BCR2_MWID ((uint32_t)0x00000030) /*!<MWID[1:0] bits (Memory data bus width) */
  3302. #define FMC_BCR2_MWID_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3303. #define FMC_BCR2_MWID_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3304. #define FMC_BCR2_FACCEN ((uint32_t)0x00000040) /*!<Flash access enable */
  3305. #define FMC_BCR2_BURSTEN ((uint32_t)0x00000100) /*!<Burst enable bit */
  3306. #define FMC_BCR2_WAITPOL ((uint32_t)0x00000200) /*!<Wait signal polarity bit */
  3307. #define FMC_BCR2_WAITCFG ((uint32_t)0x00000800) /*!<Wait timing configuration */
  3308. #define FMC_BCR2_WREN ((uint32_t)0x00001000) /*!<Write enable bit */
  3309. #define FMC_BCR2_WAITEN ((uint32_t)0x00002000) /*!<Wait enable bit */
  3310. #define FMC_BCR2_EXTMOD ((uint32_t)0x00004000) /*!<Extended mode enable */
  3311. #define FMC_BCR2_ASYNCWAIT ((uint32_t)0x00008000) /*!<Asynchronous wait */
  3312. #define FMC_BCR2_CBURSTRW ((uint32_t)0x00080000) /*!<Write burst enable */
  3313. /****************** Bit definition for FMC_BCR3 register *******************/
  3314. #define FMC_BCR3_MBKEN ((uint32_t)0x00000001) /*!<Memory bank enable bit */
  3315. #define FMC_BCR3_MUXEN ((uint32_t)0x00000002) /*!<Address/data multiplexing enable bit */
  3316. #define FMC_BCR3_MTYP ((uint32_t)0x0000000C) /*!<MTYP[1:0] bits (Memory type) */
  3317. #define FMC_BCR3_MTYP_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  3318. #define FMC_BCR3_MTYP_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  3319. #define FMC_BCR3_MWID ((uint32_t)0x00000030) /*!<MWID[1:0] bits (Memory data bus width) */
  3320. #define FMC_BCR3_MWID_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3321. #define FMC_BCR3_MWID_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3322. #define FMC_BCR3_FACCEN ((uint32_t)0x00000040) /*!<Flash access enable */
  3323. #define FMC_BCR3_BURSTEN ((uint32_t)0x00000100) /*!<Burst enable bit */
  3324. #define FMC_BCR3_WAITPOL ((uint32_t)0x00000200) /*!<Wait signal polarity bit */
  3325. #define FMC_BCR3_WAITCFG ((uint32_t)0x00000800) /*!<Wait timing configuration */
  3326. #define FMC_BCR3_WREN ((uint32_t)0x00001000) /*!<Write enable bit */
  3327. #define FMC_BCR3_WAITEN ((uint32_t)0x00002000) /*!<Wait enable bit */
  3328. #define FMC_BCR3_EXTMOD ((uint32_t)0x00004000) /*!<Extended mode enable */
  3329. #define FMC_BCR3_ASYNCWAIT ((uint32_t)0x00008000) /*!<Asynchronous wait */
  3330. #define FMC_BCR3_CBURSTRW ((uint32_t)0x00080000) /*!<Write burst enable */
  3331. /****************** Bit definition for FMC_BCR4 register *******************/
  3332. #define FMC_BCR4_MBKEN ((uint32_t)0x00000001) /*!<Memory bank enable bit */
  3333. #define FMC_BCR4_MUXEN ((uint32_t)0x00000002) /*!<Address/data multiplexing enable bit */
  3334. #define FMC_BCR4_MTYP ((uint32_t)0x0000000C) /*!<MTYP[1:0] bits (Memory type) */
  3335. #define FMC_BCR4_MTYP_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  3336. #define FMC_BCR4_MTYP_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  3337. #define FMC_BCR4_MWID ((uint32_t)0x00000030) /*!<MWID[1:0] bits (Memory data bus width) */
  3338. #define FMC_BCR4_MWID_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3339. #define FMC_BCR4_MWID_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3340. #define FMC_BCR4_FACCEN ((uint32_t)0x00000040) /*!<Flash access enable */
  3341. #define FMC_BCR4_BURSTEN ((uint32_t)0x00000100) /*!<Burst enable bit */
  3342. #define FMC_BCR4_WAITPOL ((uint32_t)0x00000200) /*!<Wait signal polarity bit */
  3343. #define FMC_BCR4_WAITCFG ((uint32_t)0x00000800) /*!<Wait timing configuration */
  3344. #define FMC_BCR4_WREN ((uint32_t)0x00001000) /*!<Write enable bit */
  3345. #define FMC_BCR4_WAITEN ((uint32_t)0x00002000) /*!<Wait enable bit */
  3346. #define FMC_BCR4_EXTMOD ((uint32_t)0x00004000) /*!<Extended mode enable */
  3347. #define FMC_BCR4_ASYNCWAIT ((uint32_t)0x00008000) /*!<Asynchronous wait */
  3348. #define FMC_BCR4_CBURSTRW ((uint32_t)0x00080000) /*!<Write burst enable */
  3349. /****************** Bit definition for FMC_BTR1 register ******************/
  3350. #define FMC_BTR1_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  3351. #define FMC_BTR1_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3352. #define FMC_BTR1_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3353. #define FMC_BTR1_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3354. #define FMC_BTR1_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3355. #define FMC_BTR1_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  3356. #define FMC_BTR1_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3357. #define FMC_BTR1_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3358. #define FMC_BTR1_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3359. #define FMC_BTR1_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  3360. #define FMC_BTR1_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  3361. #define FMC_BTR1_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3362. #define FMC_BTR1_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3363. #define FMC_BTR1_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3364. #define FMC_BTR1_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3365. #define FMC_BTR1_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  3366. #define FMC_BTR1_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  3367. #define FMC_BTR1_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  3368. #define FMC_BTR1_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  3369. #define FMC_BTR1_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround phase duration) */
  3370. #define FMC_BTR1_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3371. #define FMC_BTR1_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3372. #define FMC_BTR1_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3373. #define FMC_BTR1_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  3374. #define FMC_BTR1_CLKDIV ((uint32_t)0x00F00000) /*!<CLKDIV[3:0] bits (Clock divide ratio) */
  3375. #define FMC_BTR1_CLKDIV_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  3376. #define FMC_BTR1_CLKDIV_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  3377. #define FMC_BTR1_CLKDIV_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  3378. #define FMC_BTR1_CLKDIV_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  3379. #define FMC_BTR1_DATLAT ((uint32_t)0x0F000000) /*!<DATLA[3:0] bits (Data latency) */
  3380. #define FMC_BTR1_DATLAT_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  3381. #define FMC_BTR1_DATLAT_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  3382. #define FMC_BTR1_DATLAT_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  3383. #define FMC_BTR1_DATLAT_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  3384. #define FMC_BTR1_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  3385. #define FMC_BTR1_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  3386. #define FMC_BTR1_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  3387. /****************** Bit definition for FMC_BTR2 register *******************/
  3388. #define FMC_BTR2_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  3389. #define FMC_BTR2_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3390. #define FMC_BTR2_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3391. #define FMC_BTR2_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3392. #define FMC_BTR2_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3393. #define FMC_BTR2_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  3394. #define FMC_BTR2_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3395. #define FMC_BTR2_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3396. #define FMC_BTR2_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3397. #define FMC_BTR2_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  3398. #define FMC_BTR2_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  3399. #define FMC_BTR2_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3400. #define FMC_BTR2_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3401. #define FMC_BTR2_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3402. #define FMC_BTR2_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3403. #define FMC_BTR2_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  3404. #define FMC_BTR2_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  3405. #define FMC_BTR2_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  3406. #define FMC_BTR2_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  3407. #define FMC_BTR2_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround phase duration) */
  3408. #define FMC_BTR2_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3409. #define FMC_BTR2_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3410. #define FMC_BTR2_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3411. #define FMC_BTR2_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  3412. #define FMC_BTR2_CLKDIV ((uint32_t)0x00F00000) /*!<CLKDIV[3:0] bits (Clock divide ratio) */
  3413. #define FMC_BTR2_CLKDIV_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  3414. #define FMC_BTR2_CLKDIV_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  3415. #define FMC_BTR2_CLKDIV_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  3416. #define FMC_BTR2_CLKDIV_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  3417. #define FMC_BTR2_DATLAT ((uint32_t)0x0F000000) /*!<DATLA[3:0] bits (Data latency) */
  3418. #define FMC_BTR2_DATLAT_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  3419. #define FMC_BTR2_DATLAT_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  3420. #define FMC_BTR2_DATLAT_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  3421. #define FMC_BTR2_DATLAT_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  3422. #define FMC_BTR2_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  3423. #define FMC_BTR2_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  3424. #define FMC_BTR2_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  3425. /******************* Bit definition for FMC_BTR3 register *******************/
  3426. #define FMC_BTR3_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  3427. #define FMC_BTR3_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3428. #define FMC_BTR3_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3429. #define FMC_BTR3_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3430. #define FMC_BTR3_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3431. #define FMC_BTR3_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  3432. #define FMC_BTR3_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3433. #define FMC_BTR3_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3434. #define FMC_BTR3_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3435. #define FMC_BTR3_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  3436. #define FMC_BTR3_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  3437. #define FMC_BTR3_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3438. #define FMC_BTR3_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3439. #define FMC_BTR3_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3440. #define FMC_BTR3_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3441. #define FMC_BTR3_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  3442. #define FMC_BTR3_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  3443. #define FMC_BTR3_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  3444. #define FMC_BTR3_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  3445. #define FMC_BTR3_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround phase duration) */
  3446. #define FMC_BTR3_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3447. #define FMC_BTR3_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3448. #define FMC_BTR3_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3449. #define FMC_BTR3_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  3450. #define FMC_BTR3_CLKDIV ((uint32_t)0x00F00000) /*!<CLKDIV[3:0] bits (Clock divide ratio) */
  3451. #define FMC_BTR3_CLKDIV_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  3452. #define FMC_BTR3_CLKDIV_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  3453. #define FMC_BTR3_CLKDIV_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  3454. #define FMC_BTR3_CLKDIV_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  3455. #define FMC_BTR3_DATLAT ((uint32_t)0x0F000000) /*!<DATLA[3:0] bits (Data latency) */
  3456. #define FMC_BTR3_DATLAT_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  3457. #define FMC_BTR3_DATLAT_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  3458. #define FMC_BTR3_DATLAT_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  3459. #define FMC_BTR3_DATLAT_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  3460. #define FMC_BTR3_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  3461. #define FMC_BTR3_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  3462. #define FMC_BTR3_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  3463. /****************** Bit definition for FMC_BTR4 register *******************/
  3464. #define FMC_BTR4_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  3465. #define FMC_BTR4_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3466. #define FMC_BTR4_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3467. #define FMC_BTR4_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3468. #define FMC_BTR4_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3469. #define FMC_BTR4_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  3470. #define FMC_BTR4_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3471. #define FMC_BTR4_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3472. #define FMC_BTR4_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3473. #define FMC_BTR4_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  3474. #define FMC_BTR4_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  3475. #define FMC_BTR4_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3476. #define FMC_BTR4_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3477. #define FMC_BTR4_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3478. #define FMC_BTR4_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3479. #define FMC_BTR4_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  3480. #define FMC_BTR4_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  3481. #define FMC_BTR4_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  3482. #define FMC_BTR4_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  3483. #define FMC_BTR4_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround phase duration) */
  3484. #define FMC_BTR4_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3485. #define FMC_BTR4_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3486. #define FMC_BTR4_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3487. #define FMC_BTR4_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  3488. #define FMC_BTR4_CLKDIV ((uint32_t)0x00F00000) /*!<CLKDIV[3:0] bits (Clock divide ratio) */
  3489. #define FMC_BTR4_CLKDIV_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  3490. #define FMC_BTR4_CLKDIV_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  3491. #define FMC_BTR4_CLKDIV_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  3492. #define FMC_BTR4_CLKDIV_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  3493. #define FMC_BTR4_DATLAT ((uint32_t)0x0F000000) /*!<DATLA[3:0] bits (Data latency) */
  3494. #define FMC_BTR4_DATLAT_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  3495. #define FMC_BTR4_DATLAT_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  3496. #define FMC_BTR4_DATLAT_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  3497. #define FMC_BTR4_DATLAT_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  3498. #define FMC_BTR4_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  3499. #define FMC_BTR4_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  3500. #define FMC_BTR4_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  3501. /****************** Bit definition for FMC_BWTR1 register ******************/
  3502. #define FMC_BWTR1_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  3503. #define FMC_BWTR1_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3504. #define FMC_BWTR1_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3505. #define FMC_BWTR1_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3506. #define FMC_BWTR1_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3507. #define FMC_BWTR1_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  3508. #define FMC_BWTR1_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3509. #define FMC_BWTR1_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3510. #define FMC_BWTR1_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3511. #define FMC_BWTR1_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  3512. #define FMC_BWTR1_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  3513. #define FMC_BWTR1_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3514. #define FMC_BWTR1_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3515. #define FMC_BWTR1_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3516. #define FMC_BWTR1_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3517. #define FMC_BWTR1_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  3518. #define FMC_BWTR1_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  3519. #define FMC_BWTR1_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  3520. #define FMC_BWTR1_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  3521. #define FMC_BWTR1_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround duration) */
  3522. #define FMC_BWTR1_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3523. #define FMC_BWTR1_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3524. #define FMC_BWTR1_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3525. #define FMC_BWTR1_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  3526. #define FMC_BWTR1_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  3527. #define FMC_BWTR1_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  3528. #define FMC_BWTR1_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  3529. /****************** Bit definition for FMC_BWTR2 register ******************/
  3530. #define FMC_BWTR2_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  3531. #define FMC_BWTR2_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3532. #define FMC_BWTR2_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3533. #define FMC_BWTR2_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3534. #define FMC_BWTR2_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3535. #define FMC_BWTR2_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  3536. #define FMC_BWTR2_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3537. #define FMC_BWTR2_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3538. #define FMC_BWTR2_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3539. #define FMC_BWTR2_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  3540. #define FMC_BWTR2_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  3541. #define FMC_BWTR2_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3542. #define FMC_BWTR2_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3543. #define FMC_BWTR2_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3544. #define FMC_BWTR2_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3545. #define FMC_BWTR2_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  3546. #define FMC_BWTR2_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  3547. #define FMC_BWTR2_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  3548. #define FMC_BWTR2_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  3549. #define FMC_BWTR2_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround duration) */
  3550. #define FMC_BWTR2_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3551. #define FMC_BWTR2_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3552. #define FMC_BWTR2_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3553. #define FMC_BWTR2_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  3554. #define FMC_BWTR2_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  3555. #define FMC_BWTR2_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  3556. #define FMC_BWTR2_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  3557. /****************** Bit definition for FMC_BWTR3 register ******************/
  3558. #define FMC_BWTR3_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  3559. #define FMC_BWTR3_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3560. #define FMC_BWTR3_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3561. #define FMC_BWTR3_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3562. #define FMC_BWTR3_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3563. #define FMC_BWTR3_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  3564. #define FMC_BWTR3_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3565. #define FMC_BWTR3_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3566. #define FMC_BWTR3_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3567. #define FMC_BWTR3_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  3568. #define FMC_BWTR3_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  3569. #define FMC_BWTR3_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3570. #define FMC_BWTR3_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3571. #define FMC_BWTR3_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3572. #define FMC_BWTR3_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3573. #define FMC_BWTR3_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  3574. #define FMC_BWTR3_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  3575. #define FMC_BWTR3_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  3576. #define FMC_BWTR3_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  3577. #define FMC_BWTR3_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround duration) */
  3578. #define FMC_BWTR3_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3579. #define FMC_BWTR3_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3580. #define FMC_BWTR3_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3581. #define FMC_BWTR3_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  3582. #define FMC_BWTR3_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  3583. #define FMC_BWTR3_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  3584. #define FMC_BWTR3_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  3585. /****************** Bit definition for FMC_BWTR4 register ******************/
  3586. #define FMC_BWTR4_ADDSET ((uint32_t)0x0000000F) /*!<ADDSET[3:0] bits (Address setup phase duration) */
  3587. #define FMC_BWTR4_ADDSET_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3588. #define FMC_BWTR4_ADDSET_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3589. #define FMC_BWTR4_ADDSET_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3590. #define FMC_BWTR4_ADDSET_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3591. #define FMC_BWTR4_ADDHLD ((uint32_t)0x000000F0) /*!<ADDHLD[3:0] bits (Address-hold phase duration) */
  3592. #define FMC_BWTR4_ADDHLD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3593. #define FMC_BWTR4_ADDHLD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3594. #define FMC_BWTR4_ADDHLD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3595. #define FMC_BWTR4_ADDHLD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  3596. #define FMC_BWTR4_DATAST ((uint32_t)0x0000FF00) /*!<DATAST [3:0] bits (Data-phase duration) */
  3597. #define FMC_BWTR4_DATAST_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3598. #define FMC_BWTR4_DATAST_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3599. #define FMC_BWTR4_DATAST_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3600. #define FMC_BWTR4_DATAST_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3601. #define FMC_BWTR4_DATAST_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  3602. #define FMC_BWTR4_DATAST_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  3603. #define FMC_BWTR4_DATAST_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  3604. #define FMC_BWTR4_DATAST_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  3605. #define FMC_BWTR4_BUSTURN ((uint32_t)0x000F0000) /*!<BUSTURN[3:0] bits (Bus turnaround duration) */
  3606. #define FMC_BWTR4_BUSTURN_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3607. #define FMC_BWTR4_BUSTURN_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3608. #define FMC_BWTR4_BUSTURN_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3609. #define FMC_BWTR4_BUSTURN_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  3610. #define FMC_BWTR4_ACCMOD ((uint32_t)0x30000000) /*!<ACCMOD[1:0] bits (Access mode) */
  3611. #define FMC_BWTR4_ACCMOD_0 ((uint32_t)0x10000000) /*!<Bit 0 */
  3612. #define FMC_BWTR4_ACCMOD_1 ((uint32_t)0x20000000) /*!<Bit 1 */
  3613. /****************** Bit definition for FMC_PCR register *******************/
  3614. #define FMC_PCR_PWAITEN ((uint32_t)0x00000002) /*!<Wait feature enable bit */
  3615. #define FMC_PCR_PBKEN ((uint32_t)0x00000004) /*!<PC Card/NAND Flash memory bank enable bit */
  3616. #define FMC_PCR_PTYP ((uint32_t)0x00000008) /*!<Memory type */
  3617. #define FMC_PCR_PWID ((uint32_t)0x00000030) /*!<PWID[1:0] bits (NAND Flash databus width) */
  3618. #define FMC_PCR_PWID_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3619. #define FMC_PCR_PWID_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3620. #define FMC_PCR_ECCEN ((uint32_t)0x00000040) /*!<ECC computation logic enable bit */
  3621. #define FMC_PCR_TCLR ((uint32_t)0x00001E00) /*!<TCLR[3:0] bits (CLE to RE delay) */
  3622. #define FMC_PCR_TCLR_0 ((uint32_t)0x00000200) /*!<Bit 0 */
  3623. #define FMC_PCR_TCLR_1 ((uint32_t)0x00000400) /*!<Bit 1 */
  3624. #define FMC_PCR_TCLR_2 ((uint32_t)0x00000800) /*!<Bit 2 */
  3625. #define FMC_PCR_TCLR_3 ((uint32_t)0x00001000) /*!<Bit 3 */
  3626. #define FMC_PCR_TAR ((uint32_t)0x0001E000) /*!<TAR[3:0] bits (ALE to RE delay) */
  3627. #define FMC_PCR_TAR_0 ((uint32_t)0x00002000) /*!<Bit 0 */
  3628. #define FMC_PCR_TAR_1 ((uint32_t)0x00004000) /*!<Bit 1 */
  3629. #define FMC_PCR_TAR_2 ((uint32_t)0x00008000) /*!<Bit 2 */
  3630. #define FMC_PCR_TAR_3 ((uint32_t)0x00010000) /*!<Bit 3 */
  3631. #define FMC_PCR_ECCPS ((uint32_t)0x000E0000) /*!<ECCPS[1:0] bits (ECC page size) */
  3632. #define FMC_PCR_ECCPS_0 ((uint32_t)0x00020000) /*!<Bit 0 */
  3633. #define FMC_PCR_ECCPS_1 ((uint32_t)0x00040000) /*!<Bit 1 */
  3634. #define FMC_PCR_ECCPS_2 ((uint32_t)0x00080000) /*!<Bit 2 */
  3635. /******************* Bit definition for FMC_SR register *******************/
  3636. #define FMC_SR_IRS ((uint32_t)0x01) /*!<Interrupt Rising Edge status */
  3637. #define FMC_SR_ILS ((uint32_t)0x02) /*!<Interrupt Level status */
  3638. #define FMC_SR_IFS ((uint32_t)0x04) /*!<Interrupt Falling Edge status */
  3639. #define FMC_SR_IREN ((uint32_t)0x08) /*!<Interrupt Rising Edge detection Enable bit */
  3640. #define FMC_SR_ILEN ((uint32_t)0x10) /*!<Interrupt Level detection Enable bit */
  3641. #define FMC_SR_IFEN ((uint32_t)0x20) /*!<Interrupt Falling Edge detection Enable bit */
  3642. #define FMC_SR_FEMPT ((uint32_t)0x40) /*!<FIFO empty */
  3643. /****************** Bit definition for FMC_PMEM register ******************/
  3644. #define FMC_PMEM_MEMSET2 ((uint32_t)0x000000FF) /*!<MEMSET2[7:0] bits (Common memory 2 setup time) */
  3645. #define FMC_PMEM_MEMSET2_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3646. #define FMC_PMEM_MEMSET2_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3647. #define FMC_PMEM_MEMSET2_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3648. #define FMC_PMEM_MEMSET2_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3649. #define FMC_PMEM_MEMSET2_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  3650. #define FMC_PMEM_MEMSET2_5 ((uint32_t)0x00000020) /*!<Bit 5 */
  3651. #define FMC_PMEM_MEMSET2_6 ((uint32_t)0x00000040) /*!<Bit 6 */
  3652. #define FMC_PMEM_MEMSET2_7 ((uint32_t)0x00000080) /*!<Bit 7 */
  3653. #define FMC_PMEM_MEMWAIT2 ((uint32_t)0x0000FF00) /*!<MEMWAIT2[7:0] bits (Common memory 2 wait time) */
  3654. #define FMC_PMEM_MEMWAIT2_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3655. #define FMC_PMEM_MEMWAIT2_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3656. #define FMC_PMEM_MEMWAIT2_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3657. #define FMC_PMEM_MEMWAIT2_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3658. #define FMC_PMEM_MEMWAIT2_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  3659. #define FMC_PMEM_MEMWAIT2_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  3660. #define FMC_PMEM_MEMWAIT2_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  3661. #define FMC_PMEM_MEMWAIT2_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  3662. #define FMC_PMEM_MEMHOLD2 ((uint32_t)0x00FF0000) /*!<MEMHOLD2[7:0] bits (Common memory 2 hold time) */
  3663. #define FMC_PMEM_MEMHOLD2_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3664. #define FMC_PMEM_MEMHOLD2_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3665. #define FMC_PMEM_MEMHOLD2_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3666. #define FMC_PMEM_MEMHOLD2_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  3667. #define FMC_PMEM_MEMHOLD2_4 ((uint32_t)0x00100000) /*!<Bit 4 */
  3668. #define FMC_PMEM_MEMHOLD2_5 ((uint32_t)0x00200000) /*!<Bit 5 */
  3669. #define FMC_PMEM_MEMHOLD2_6 ((uint32_t)0x00400000) /*!<Bit 6 */
  3670. #define FMC_PMEM_MEMHOLD2_7 ((uint32_t)0x00800000) /*!<Bit 7 */
  3671. #define FMC_PMEM_MEMHIZ2 ((uint32_t)0xFF000000) /*!<MEMHIZ2[7:0] bits (Common memory 2 databus HiZ time) */
  3672. #define FMC_PMEM_MEMHIZ2_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  3673. #define FMC_PMEM_MEMHIZ2_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  3674. #define FMC_PMEM_MEMHIZ2_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  3675. #define FMC_PMEM_MEMHIZ2_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  3676. #define FMC_PMEM_MEMHIZ2_4 ((uint32_t)0x10000000) /*!<Bit 4 */
  3677. #define FMC_PMEM_MEMHIZ2_5 ((uint32_t)0x20000000) /*!<Bit 5 */
  3678. #define FMC_PMEM_MEMHIZ2_6 ((uint32_t)0x40000000) /*!<Bit 6 */
  3679. #define FMC_PMEM_MEMHIZ2_7 ((uint32_t)0x80000000) /*!<Bit 7 */
  3680. /****************** Bit definition for FMC_PATT register ******************/
  3681. #define FMC_PATT_ATTSET2 ((uint32_t)0x000000FF) /*!<ATTSET2[7:0] bits (Attribute memory 2 setup time) */
  3682. #define FMC_PATT_ATTSET2_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3683. #define FMC_PATT_ATTSET2_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3684. #define FMC_PATT_ATTSET2_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3685. #define FMC_PATT_ATTSET2_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3686. #define FMC_PATT_ATTSET2_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  3687. #define FMC_PATT_ATTSET2_5 ((uint32_t)0x00000020) /*!<Bit 5 */
  3688. #define FMC_PATT_ATTSET2_6 ((uint32_t)0x00000040) /*!<Bit 6 */
  3689. #define FMC_PATT_ATTSET2_7 ((uint32_t)0x00000080) /*!<Bit 7 */
  3690. #define FMC_PATT_ATTWAIT2 ((uint32_t)0x0000FF00) /*!<ATTWAIT2[7:0] bits (Attribute memory 2 wait time) */
  3691. #define FMC_PATT_ATTWAIT2_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3692. #define FMC_PATT_ATTWAIT2_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3693. #define FMC_PATT_ATTWAIT2_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3694. #define FMC_PATT_ATTWAIT2_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3695. #define FMC_PATT_ATTWAIT2_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  3696. #define FMC_PATT_ATTWAIT2_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  3697. #define FMC_PATT_ATTWAIT2_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  3698. #define FMC_PATT_ATTWAIT2_7 ((uint32_t)0x00008000) /*!<Bit 7 */
  3699. #define FMC_PATT_ATTHOLD2 ((uint32_t)0x00FF0000) /*!<ATTHOLD2[7:0] bits (Attribute memory 2 hold time) */
  3700. #define FMC_PATT_ATTHOLD2_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3701. #define FMC_PATT_ATTHOLD2_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3702. #define FMC_PATT_ATTHOLD2_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3703. #define FMC_PATT_ATTHOLD2_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  3704. #define FMC_PATT_ATTHOLD2_4 ((uint32_t)0x00100000) /*!<Bit 4 */
  3705. #define FMC_PATT_ATTHOLD2_5 ((uint32_t)0x00200000) /*!<Bit 5 */
  3706. #define FMC_PATT_ATTHOLD2_6 ((uint32_t)0x00400000) /*!<Bit 6 */
  3707. #define FMC_PATT_ATTHOLD2_7 ((uint32_t)0x00800000) /*!<Bit 7 */
  3708. #define FMC_PATT_ATTHIZ2 ((uint32_t)0xFF000000) /*!<ATTHIZ2[7:0] bits (Attribute memory 2 databus HiZ time) */
  3709. #define FMC_PATT_ATTHIZ2_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  3710. #define FMC_PATT_ATTHIZ2_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  3711. #define FMC_PATT_ATTHIZ2_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  3712. #define FMC_PATT_ATTHIZ2_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  3713. #define FMC_PATT_ATTHIZ2_4 ((uint32_t)0x10000000) /*!<Bit 4 */
  3714. #define FMC_PATT_ATTHIZ2_5 ((uint32_t)0x20000000) /*!<Bit 5 */
  3715. #define FMC_PATT_ATTHIZ2_6 ((uint32_t)0x40000000) /*!<Bit 6 */
  3716. #define FMC_PATT_ATTHIZ2_7 ((uint32_t)0x80000000) /*!<Bit 7 */
  3717. /****************** Bit definition for FMC_ECCR register ******************/
  3718. #define FMC_ECCR_ECC2 ((uint32_t)0xFFFFFFFF) /*!<ECC result */
  3719. /****************** Bit definition for FMC_SDCR1 register ******************/
  3720. #define FMC_SDCR1_NC ((uint32_t)0x00000003) /*!<NC[1:0] bits (Number of column bits) */
  3721. #define FMC_SDCR1_NC_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3722. #define FMC_SDCR1_NC_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3723. #define FMC_SDCR1_NR ((uint32_t)0x0000000C) /*!<NR[1:0] bits (Number of row bits) */
  3724. #define FMC_SDCR1_NR_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  3725. #define FMC_SDCR1_NR_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  3726. #define FMC_SDCR1_MWID ((uint32_t)0x00000030) /*!<NR[1:0] bits (Number of row bits) */
  3727. #define FMC_SDCR1_MWID_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3728. #define FMC_SDCR1_MWID_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3729. #define FMC_SDCR1_NB ((uint32_t)0x00000040) /*!<Number of internal bank */
  3730. #define FMC_SDCR1_CAS ((uint32_t)0x00000180) /*!<CAS[1:0] bits (CAS latency) */
  3731. #define FMC_SDCR1_CAS_0 ((uint32_t)0x00000080) /*!<Bit 0 */
  3732. #define FMC_SDCR1_CAS_1 ((uint32_t)0x00000100) /*!<Bit 1 */
  3733. #define FMC_SDCR1_WP ((uint32_t)0x00000200) /*!<Write protection */
  3734. #define FMC_SDCR1_SDCLK ((uint32_t)0x00000C00) /*!<SDRAM clock configuration */
  3735. #define FMC_SDCR1_SDCLK_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  3736. #define FMC_SDCR1_SDCLK_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  3737. #define FMC_SDCR1_RBURST ((uint32_t)0x00001000) /*!<Read burst */
  3738. #define FMC_SDCR1_RPIPE ((uint32_t)0x00006000) /*!<Write protection */
  3739. #define FMC_SDCR1_RPIPE_0 ((uint32_t)0x00002000) /*!<Bit 0 */
  3740. #define FMC_SDCR1_RPIPE_1 ((uint32_t)0x00004000) /*!<Bit 1 */
  3741. /****************** Bit definition for FMC_SDCR2 register ******************/
  3742. #define FMC_SDCR2_NC ((uint32_t)0x00000003) /*!<NC[1:0] bits (Number of column bits) */
  3743. #define FMC_SDCR2_NC_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3744. #define FMC_SDCR2_NC_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3745. #define FMC_SDCR2_NR ((uint32_t)0x0000000C) /*!<NR[1:0] bits (Number of row bits) */
  3746. #define FMC_SDCR2_NR_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  3747. #define FMC_SDCR2_NR_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  3748. #define FMC_SDCR2_MWID ((uint32_t)0x00000030) /*!<NR[1:0] bits (Number of row bits) */
  3749. #define FMC_SDCR2_MWID_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3750. #define FMC_SDCR2_MWID_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3751. #define FMC_SDCR2_NB ((uint32_t)0x00000040) /*!<Number of internal bank */
  3752. #define FMC_SDCR2_CAS ((uint32_t)0x00000180) /*!<CAS[1:0] bits (CAS latency) */
  3753. #define FMC_SDCR2_CAS_0 ((uint32_t)0x00000080) /*!<Bit 0 */
  3754. #define FMC_SDCR2_CAS_1 ((uint32_t)0x00000100) /*!<Bit 1 */
  3755. #define FMC_SDCR2_WP ((uint32_t)0x00000200) /*!<Write protection */
  3756. #define FMC_SDCR2_SDCLK ((uint32_t)0x00000C00) /*!<SDCLK[1:0] (SDRAM clock configuration) */
  3757. #define FMC_SDCR2_SDCLK_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  3758. #define FMC_SDCR2_SDCLK_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  3759. #define FMC_SDCR2_RBURST ((uint32_t)0x00001000) /*!<Read burst */
  3760. #define FMC_SDCR2_RPIPE ((uint32_t)0x00006000) /*!<RPIPE[1:0](Read pipe) */
  3761. #define FMC_SDCR2_RPIPE_0 ((uint32_t)0x00002000) /*!<Bit 0 */
  3762. #define FMC_SDCR2_RPIPE_1 ((uint32_t)0x00004000) /*!<Bit 1 */
  3763. /****************** Bit definition for FMC_SDTR1 register ******************/
  3764. #define FMC_SDTR1_TMRD ((uint32_t)0x0000000F) /*!<TMRD[3:0] bits (Load mode register to active) */
  3765. #define FMC_SDTR1_TMRD_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3766. #define FMC_SDTR1_TMRD_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3767. #define FMC_SDTR1_TMRD_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3768. #define FMC_SDTR1_TMRD_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3769. #define FMC_SDTR1_TXSR ((uint32_t)0x000000F0) /*!<TXSR[3:0] bits (Exit self refresh) */
  3770. #define FMC_SDTR1_TXSR_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3771. #define FMC_SDTR1_TXSR_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3772. #define FMC_SDTR1_TXSR_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3773. #define FMC_SDTR1_TXSR_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  3774. #define FMC_SDTR1_TRAS ((uint32_t)0x00000F00) /*!<TRAS[3:0] bits (Self refresh time) */
  3775. #define FMC_SDTR1_TRAS_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3776. #define FMC_SDTR1_TRAS_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3777. #define FMC_SDTR1_TRAS_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3778. #define FMC_SDTR1_TRAS_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3779. #define FMC_SDTR1_TRC ((uint32_t)0x0000F000) /*!<TRC[2:0] bits (Row cycle delay) */
  3780. #define FMC_SDTR1_TRC_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  3781. #define FMC_SDTR1_TRC_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  3782. #define FMC_SDTR1_TRC_2 ((uint32_t)0x00004000) /*!<Bit 2 */
  3783. #define FMC_SDTR1_TWR ((uint32_t)0x000F0000) /*!<TRC[2:0] bits (Write recovery delay) */
  3784. #define FMC_SDTR1_TWR_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3785. #define FMC_SDTR1_TWR_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3786. #define FMC_SDTR1_TWR_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3787. #define FMC_SDTR1_TRP ((uint32_t)0x00F00000) /*!<TRP[2:0] bits (Row precharge delay) */
  3788. #define FMC_SDTR1_TRP_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  3789. #define FMC_SDTR1_TRP_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  3790. #define FMC_SDTR1_TRP_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  3791. #define FMC_SDTR1_TRCD ((uint32_t)0x0F000000) /*!<TRP[2:0] bits (Row to column delay) */
  3792. #define FMC_SDTR1_TRCD_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  3793. #define FMC_SDTR1_TRCD_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  3794. #define FMC_SDTR1_TRCD_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  3795. /****************** Bit definition for FMC_SDTR2 register ******************/
  3796. #define FMC_SDTR2_TMRD ((uint32_t)0x0000000F) /*!<TMRD[3:0] bits (Load mode register to active) */
  3797. #define FMC_SDTR2_TMRD_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3798. #define FMC_SDTR2_TMRD_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3799. #define FMC_SDTR2_TMRD_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3800. #define FMC_SDTR2_TMRD_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  3801. #define FMC_SDTR2_TXSR ((uint32_t)0x000000F0) /*!<TXSR[3:0] bits (Exit self refresh) */
  3802. #define FMC_SDTR2_TXSR_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  3803. #define FMC_SDTR2_TXSR_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  3804. #define FMC_SDTR2_TXSR_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  3805. #define FMC_SDTR2_TXSR_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  3806. #define FMC_SDTR2_TRAS ((uint32_t)0x00000F00) /*!<TRAS[3:0] bits (Self refresh time) */
  3807. #define FMC_SDTR2_TRAS_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  3808. #define FMC_SDTR2_TRAS_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  3809. #define FMC_SDTR2_TRAS_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  3810. #define FMC_SDTR2_TRAS_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  3811. #define FMC_SDTR2_TRC ((uint32_t)0x0000F000) /*!<TRC[2:0] bits (Row cycle delay) */
  3812. #define FMC_SDTR2_TRC_0 ((uint32_t)0x00001000) /*!<Bit 0 */
  3813. #define FMC_SDTR2_TRC_1 ((uint32_t)0x00002000) /*!<Bit 1 */
  3814. #define FMC_SDTR2_TRC_2 ((uint32_t)0x00004000) /*!<Bit 2 */
  3815. #define FMC_SDTR2_TWR ((uint32_t)0x000F0000) /*!<TRC[2:0] bits (Write recovery delay) */
  3816. #define FMC_SDTR2_TWR_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  3817. #define FMC_SDTR2_TWR_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  3818. #define FMC_SDTR2_TWR_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  3819. #define FMC_SDTR2_TRP ((uint32_t)0x00F00000) /*!<TRP[2:0] bits (Row precharge delay) */
  3820. #define FMC_SDTR2_TRP_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  3821. #define FMC_SDTR2_TRP_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  3822. #define FMC_SDTR2_TRP_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  3823. #define FMC_SDTR2_TRCD ((uint32_t)0x0F000000) /*!<TRP[2:0] bits (Row to column delay) */
  3824. #define FMC_SDTR2_TRCD_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  3825. #define FMC_SDTR2_TRCD_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  3826. #define FMC_SDTR2_TRCD_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  3827. /****************** Bit definition for FMC_SDCMR register ******************/
  3828. #define FMC_SDCMR_MODE ((uint32_t)0x00000007) /*!<MODE[2:0] bits (Command mode) */
  3829. #define FMC_SDCMR_MODE_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  3830. #define FMC_SDCMR_MODE_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  3831. #define FMC_SDCMR_MODE_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  3832. #define FMC_SDCMR_CTB2 ((uint32_t)0x00000008) /*!<Command target 2 */
  3833. #define FMC_SDCMR_CTB1 ((uint32_t)0x00000010) /*!<Command target 1 */
  3834. #define FMC_SDCMR_NRFS ((uint32_t)0x000001E0) /*!<NRFS[3:0] bits (Number of auto-refresh) */
  3835. #define FMC_SDCMR_NRFS_0 ((uint32_t)0x00000020) /*!<Bit 0 */
  3836. #define FMC_SDCMR_NRFS_1 ((uint32_t)0x00000040) /*!<Bit 1 */
  3837. #define FMC_SDCMR_NRFS_2 ((uint32_t)0x00000080) /*!<Bit 2 */
  3838. #define FMC_SDCMR_NRFS_3 ((uint32_t)0x00000100) /*!<Bit 3 */
  3839. #define FMC_SDCMR_MRD ((uint32_t)0x003FFE00) /*!<MRD[12:0] bits (Mode register definition) */
  3840. /****************** Bit definition for FMC_SDRTR register ******************/
  3841. #define FMC_SDRTR_CRE ((uint32_t)0x00000001) /*!<Clear refresh error flag */
  3842. #define FMC_SDRTR_COUNT ((uint32_t)0x00003FFE) /*!<COUNT[12:0] bits (Refresh timer count) */
  3843. #define FMC_SDRTR_REIE ((uint32_t)0x00004000) /*!<RES interupt enable */
  3844. /****************** Bit definition for FMC_SDSR register ******************/
  3845. #define FMC_SDSR_RE ((uint32_t)0x00000001) /*!<Refresh error flag */
  3846. #define FMC_SDSR_MODES1 ((uint32_t)0x00000006) /*!<MODES1[1:0]bits (Status mode for bank 1) */
  3847. #define FMC_SDSR_MODES1_0 ((uint32_t)0x00000002) /*!<Bit 0 */
  3848. #define FMC_SDSR_MODES1_1 ((uint32_t)0x00000004) /*!<Bit 1 */
  3849. #define FMC_SDSR_MODES2 ((uint32_t)0x00000018) /*!<MODES2[1:0]bits (Status mode for bank 2) */
  3850. #define FMC_SDSR_MODES2_0 ((uint32_t)0x00000008) /*!<Bit 0 */
  3851. #define FMC_SDSR_MODES2_1 ((uint32_t)0x00000010) /*!<Bit 1 */
  3852. #define FMC_SDSR_BUSY ((uint32_t)0x00000020) /*!<Busy status */
  3853. /******************************************************************************/
  3854. /* */
  3855. /* General Purpose I/O */
  3856. /* */
  3857. /******************************************************************************/
  3858. /****************** Bits definition for GPIO_MODER register *****************/
  3859. #define GPIO_MODER_MODER0 ((uint32_t)0x00000003)
  3860. #define GPIO_MODER_MODER0_0 ((uint32_t)0x00000001)
  3861. #define GPIO_MODER_MODER0_1 ((uint32_t)0x00000002)
  3862. #define GPIO_MODER_MODER1 ((uint32_t)0x0000000C)
  3863. #define GPIO_MODER_MODER1_0 ((uint32_t)0x00000004)
  3864. #define GPIO_MODER_MODER1_1 ((uint32_t)0x00000008)
  3865. #define GPIO_MODER_MODER2 ((uint32_t)0x00000030)
  3866. #define GPIO_MODER_MODER2_0 ((uint32_t)0x00000010)
  3867. #define GPIO_MODER_MODER2_1 ((uint32_t)0x00000020)
  3868. #define GPIO_MODER_MODER3 ((uint32_t)0x000000C0)
  3869. #define GPIO_MODER_MODER3_0 ((uint32_t)0x00000040)
  3870. #define GPIO_MODER_MODER3_1 ((uint32_t)0x00000080)
  3871. #define GPIO_MODER_MODER4 ((uint32_t)0x00000300)
  3872. #define GPIO_MODER_MODER4_0 ((uint32_t)0x00000100)
  3873. #define GPIO_MODER_MODER4_1 ((uint32_t)0x00000200)
  3874. #define GPIO_MODER_MODER5 ((uint32_t)0x00000C00)
  3875. #define GPIO_MODER_MODER5_0 ((uint32_t)0x00000400)
  3876. #define GPIO_MODER_MODER5_1 ((uint32_t)0x00000800)
  3877. #define GPIO_MODER_MODER6 ((uint32_t)0x00003000)
  3878. #define GPIO_MODER_MODER6_0 ((uint32_t)0x00001000)
  3879. #define GPIO_MODER_MODER6_1 ((uint32_t)0x00002000)
  3880. #define GPIO_MODER_MODER7 ((uint32_t)0x0000C000)
  3881. #define GPIO_MODER_MODER7_0 ((uint32_t)0x00004000)
  3882. #define GPIO_MODER_MODER7_1 ((uint32_t)0x00008000)
  3883. #define GPIO_MODER_MODER8 ((uint32_t)0x00030000)
  3884. #define GPIO_MODER_MODER8_0 ((uint32_t)0x00010000)
  3885. #define GPIO_MODER_MODER8_1 ((uint32_t)0x00020000)
  3886. #define GPIO_MODER_MODER9 ((uint32_t)0x000C0000)
  3887. #define GPIO_MODER_MODER9_0 ((uint32_t)0x00040000)
  3888. #define GPIO_MODER_MODER9_1 ((uint32_t)0x00080000)
  3889. #define GPIO_MODER_MODER10 ((uint32_t)0x00300000)
  3890. #define GPIO_MODER_MODER10_0 ((uint32_t)0x00100000)
  3891. #define GPIO_MODER_MODER10_1 ((uint32_t)0x00200000)
  3892. #define GPIO_MODER_MODER11 ((uint32_t)0x00C00000)
  3893. #define GPIO_MODER_MODER11_0 ((uint32_t)0x00400000)
  3894. #define GPIO_MODER_MODER11_1 ((uint32_t)0x00800000)
  3895. #define GPIO_MODER_MODER12 ((uint32_t)0x03000000)
  3896. #define GPIO_MODER_MODER12_0 ((uint32_t)0x01000000)
  3897. #define GPIO_MODER_MODER12_1 ((uint32_t)0x02000000)
  3898. #define GPIO_MODER_MODER13 ((uint32_t)0x0C000000)
  3899. #define GPIO_MODER_MODER13_0 ((uint32_t)0x04000000)
  3900. #define GPIO_MODER_MODER13_1 ((uint32_t)0x08000000)
  3901. #define GPIO_MODER_MODER14 ((uint32_t)0x30000000)
  3902. #define GPIO_MODER_MODER14_0 ((uint32_t)0x10000000)
  3903. #define GPIO_MODER_MODER14_1 ((uint32_t)0x20000000)
  3904. #define GPIO_MODER_MODER15 ((uint32_t)0xC0000000)
  3905. #define GPIO_MODER_MODER15_0 ((uint32_t)0x40000000)
  3906. #define GPIO_MODER_MODER15_1 ((uint32_t)0x80000000)
  3907. /****************** Bits definition for GPIO_OTYPER register ****************/
  3908. #define GPIO_OTYPER_OT_0 ((uint32_t)0x00000001)
  3909. #define GPIO_OTYPER_OT_1 ((uint32_t)0x00000002)
  3910. #define GPIO_OTYPER_OT_2 ((uint32_t)0x00000004)
  3911. #define GPIO_OTYPER_OT_3 ((uint32_t)0x00000008)
  3912. #define GPIO_OTYPER_OT_4 ((uint32_t)0x00000010)
  3913. #define GPIO_OTYPER_OT_5 ((uint32_t)0x00000020)
  3914. #define GPIO_OTYPER_OT_6 ((uint32_t)0x00000040)
  3915. #define GPIO_OTYPER_OT_7 ((uint32_t)0x00000080)
  3916. #define GPIO_OTYPER_OT_8 ((uint32_t)0x00000100)
  3917. #define GPIO_OTYPER_OT_9 ((uint32_t)0x00000200)
  3918. #define GPIO_OTYPER_OT_10 ((uint32_t)0x00000400)
  3919. #define GPIO_OTYPER_OT_11 ((uint32_t)0x00000800)
  3920. #define GPIO_OTYPER_OT_12 ((uint32_t)0x00001000)
  3921. #define GPIO_OTYPER_OT_13 ((uint32_t)0x00002000)
  3922. #define GPIO_OTYPER_OT_14 ((uint32_t)0x00004000)
  3923. #define GPIO_OTYPER_OT_15 ((uint32_t)0x00008000)
  3924. /****************** Bits definition for GPIO_OSPEEDR register ***************/
  3925. #define GPIO_OSPEEDER_OSPEEDR0 ((uint32_t)0x00000003)
  3926. #define GPIO_OSPEEDER_OSPEEDR0_0 ((uint32_t)0x00000001)
  3927. #define GPIO_OSPEEDER_OSPEEDR0_1 ((uint32_t)0x00000002)
  3928. #define GPIO_OSPEEDER_OSPEEDR1 ((uint32_t)0x0000000C)
  3929. #define GPIO_OSPEEDER_OSPEEDR1_0 ((uint32_t)0x00000004)
  3930. #define GPIO_OSPEEDER_OSPEEDR1_1 ((uint32_t)0x00000008)
  3931. #define GPIO_OSPEEDER_OSPEEDR2 ((uint32_t)0x00000030)
  3932. #define GPIO_OSPEEDER_OSPEEDR2_0 ((uint32_t)0x00000010)
  3933. #define GPIO_OSPEEDER_OSPEEDR2_1 ((uint32_t)0x00000020)
  3934. #define GPIO_OSPEEDER_OSPEEDR3 ((uint32_t)0x000000C0)
  3935. #define GPIO_OSPEEDER_OSPEEDR3_0 ((uint32_t)0x00000040)
  3936. #define GPIO_OSPEEDER_OSPEEDR3_1 ((uint32_t)0x00000080)
  3937. #define GPIO_OSPEEDER_OSPEEDR4 ((uint32_t)0x00000300)
  3938. #define GPIO_OSPEEDER_OSPEEDR4_0 ((uint32_t)0x00000100)
  3939. #define GPIO_OSPEEDER_OSPEEDR4_1 ((uint32_t)0x00000200)
  3940. #define GPIO_OSPEEDER_OSPEEDR5 ((uint32_t)0x00000C00)
  3941. #define GPIO_OSPEEDER_OSPEEDR5_0 ((uint32_t)0x00000400)
  3942. #define GPIO_OSPEEDER_OSPEEDR5_1 ((uint32_t)0x00000800)
  3943. #define GPIO_OSPEEDER_OSPEEDR6 ((uint32_t)0x00003000)
  3944. #define GPIO_OSPEEDER_OSPEEDR6_0 ((uint32_t)0x00001000)
  3945. #define GPIO_OSPEEDER_OSPEEDR6_1 ((uint32_t)0x00002000)
  3946. #define GPIO_OSPEEDER_OSPEEDR7 ((uint32_t)0x0000C000)
  3947. #define GPIO_OSPEEDER_OSPEEDR7_0 ((uint32_t)0x00004000)
  3948. #define GPIO_OSPEEDER_OSPEEDR7_1 ((uint32_t)0x00008000)
  3949. #define GPIO_OSPEEDER_OSPEEDR8 ((uint32_t)0x00030000)
  3950. #define GPIO_OSPEEDER_OSPEEDR8_0 ((uint32_t)0x00010000)
  3951. #define GPIO_OSPEEDER_OSPEEDR8_1 ((uint32_t)0x00020000)
  3952. #define GPIO_OSPEEDER_OSPEEDR9 ((uint32_t)0x000C0000)
  3953. #define GPIO_OSPEEDER_OSPEEDR9_0 ((uint32_t)0x00040000)
  3954. #define GPIO_OSPEEDER_OSPEEDR9_1 ((uint32_t)0x00080000)
  3955. #define GPIO_OSPEEDER_OSPEEDR10 ((uint32_t)0x00300000)
  3956. #define GPIO_OSPEEDER_OSPEEDR10_0 ((uint32_t)0x00100000)
  3957. #define GPIO_OSPEEDER_OSPEEDR10_1 ((uint32_t)0x00200000)
  3958. #define GPIO_OSPEEDER_OSPEEDR11 ((uint32_t)0x00C00000)
  3959. #define GPIO_OSPEEDER_OSPEEDR11_0 ((uint32_t)0x00400000)
  3960. #define GPIO_OSPEEDER_OSPEEDR11_1 ((uint32_t)0x00800000)
  3961. #define GPIO_OSPEEDER_OSPEEDR12 ((uint32_t)0x03000000)
  3962. #define GPIO_OSPEEDER_OSPEEDR12_0 ((uint32_t)0x01000000)
  3963. #define GPIO_OSPEEDER_OSPEEDR12_1 ((uint32_t)0x02000000)
  3964. #define GPIO_OSPEEDER_OSPEEDR13 ((uint32_t)0x0C000000)
  3965. #define GPIO_OSPEEDER_OSPEEDR13_0 ((uint32_t)0x04000000)
  3966. #define GPIO_OSPEEDER_OSPEEDR13_1 ((uint32_t)0x08000000)
  3967. #define GPIO_OSPEEDER_OSPEEDR14 ((uint32_t)0x30000000)
  3968. #define GPIO_OSPEEDER_OSPEEDR14_0 ((uint32_t)0x10000000)
  3969. #define GPIO_OSPEEDER_OSPEEDR14_1 ((uint32_t)0x20000000)
  3970. #define GPIO_OSPEEDER_OSPEEDR15 ((uint32_t)0xC0000000)
  3971. #define GPIO_OSPEEDER_OSPEEDR15_0 ((uint32_t)0x40000000)
  3972. #define GPIO_OSPEEDER_OSPEEDR15_1 ((uint32_t)0x80000000)
  3973. /****************** Bits definition for GPIO_PUPDR register *****************/
  3974. #define GPIO_PUPDR_PUPDR0 ((uint32_t)0x00000003)
  3975. #define GPIO_PUPDR_PUPDR0_0 ((uint32_t)0x00000001)
  3976. #define GPIO_PUPDR_PUPDR0_1 ((uint32_t)0x00000002)
  3977. #define GPIO_PUPDR_PUPDR1 ((uint32_t)0x0000000C)
  3978. #define GPIO_PUPDR_PUPDR1_0 ((uint32_t)0x00000004)
  3979. #define GPIO_PUPDR_PUPDR1_1 ((uint32_t)0x00000008)
  3980. #define GPIO_PUPDR_PUPDR2 ((uint32_t)0x00000030)
  3981. #define GPIO_PUPDR_PUPDR2_0 ((uint32_t)0x00000010)
  3982. #define GPIO_PUPDR_PUPDR2_1 ((uint32_t)0x00000020)
  3983. #define GPIO_PUPDR_PUPDR3 ((uint32_t)0x000000C0)
  3984. #define GPIO_PUPDR_PUPDR3_0 ((uint32_t)0x00000040)
  3985. #define GPIO_PUPDR_PUPDR3_1 ((uint32_t)0x00000080)
  3986. #define GPIO_PUPDR_PUPDR4 ((uint32_t)0x00000300)
  3987. #define GPIO_PUPDR_PUPDR4_0 ((uint32_t)0x00000100)
  3988. #define GPIO_PUPDR_PUPDR4_1 ((uint32_t)0x00000200)
  3989. #define GPIO_PUPDR_PUPDR5 ((uint32_t)0x00000C00)
  3990. #define GPIO_PUPDR_PUPDR5_0 ((uint32_t)0x00000400)
  3991. #define GPIO_PUPDR_PUPDR5_1 ((uint32_t)0x00000800)
  3992. #define GPIO_PUPDR_PUPDR6 ((uint32_t)0x00003000)
  3993. #define GPIO_PUPDR_PUPDR6_0 ((uint32_t)0x00001000)
  3994. #define GPIO_PUPDR_PUPDR6_1 ((uint32_t)0x00002000)
  3995. #define GPIO_PUPDR_PUPDR7 ((uint32_t)0x0000C000)
  3996. #define GPIO_PUPDR_PUPDR7_0 ((uint32_t)0x00004000)
  3997. #define GPIO_PUPDR_PUPDR7_1 ((uint32_t)0x00008000)
  3998. #define GPIO_PUPDR_PUPDR8 ((uint32_t)0x00030000)
  3999. #define GPIO_PUPDR_PUPDR8_0 ((uint32_t)0x00010000)
  4000. #define GPIO_PUPDR_PUPDR8_1 ((uint32_t)0x00020000)
  4001. #define GPIO_PUPDR_PUPDR9 ((uint32_t)0x000C0000)
  4002. #define GPIO_PUPDR_PUPDR9_0 ((uint32_t)0x00040000)
  4003. #define GPIO_PUPDR_PUPDR9_1 ((uint32_t)0x00080000)
  4004. #define GPIO_PUPDR_PUPDR10 ((uint32_t)0x00300000)
  4005. #define GPIO_PUPDR_PUPDR10_0 ((uint32_t)0x00100000)
  4006. #define GPIO_PUPDR_PUPDR10_1 ((uint32_t)0x00200000)
  4007. #define GPIO_PUPDR_PUPDR11 ((uint32_t)0x00C00000)
  4008. #define GPIO_PUPDR_PUPDR11_0 ((uint32_t)0x00400000)
  4009. #define GPIO_PUPDR_PUPDR11_1 ((uint32_t)0x00800000)
  4010. #define GPIO_PUPDR_PUPDR12 ((uint32_t)0x03000000)
  4011. #define GPIO_PUPDR_PUPDR12_0 ((uint32_t)0x01000000)
  4012. #define GPIO_PUPDR_PUPDR12_1 ((uint32_t)0x02000000)
  4013. #define GPIO_PUPDR_PUPDR13 ((uint32_t)0x0C000000)
  4014. #define GPIO_PUPDR_PUPDR13_0 ((uint32_t)0x04000000)
  4015. #define GPIO_PUPDR_PUPDR13_1 ((uint32_t)0x08000000)
  4016. #define GPIO_PUPDR_PUPDR14 ((uint32_t)0x30000000)
  4017. #define GPIO_PUPDR_PUPDR14_0 ((uint32_t)0x10000000)
  4018. #define GPIO_PUPDR_PUPDR14_1 ((uint32_t)0x20000000)
  4019. #define GPIO_PUPDR_PUPDR15 ((uint32_t)0xC0000000)
  4020. #define GPIO_PUPDR_PUPDR15_0 ((uint32_t)0x40000000)
  4021. #define GPIO_PUPDR_PUPDR15_1 ((uint32_t)0x80000000)
  4022. /****************** Bits definition for GPIO_IDR register *******************/
  4023. #define GPIO_IDR_IDR_0 ((uint32_t)0x00000001)
  4024. #define GPIO_IDR_IDR_1 ((uint32_t)0x00000002)
  4025. #define GPIO_IDR_IDR_2 ((uint32_t)0x00000004)
  4026. #define GPIO_IDR_IDR_3 ((uint32_t)0x00000008)
  4027. #define GPIO_IDR_IDR_4 ((uint32_t)0x00000010)
  4028. #define GPIO_IDR_IDR_5 ((uint32_t)0x00000020)
  4029. #define GPIO_IDR_IDR_6 ((uint32_t)0x00000040)
  4030. #define GPIO_IDR_IDR_7 ((uint32_t)0x00000080)
  4031. #define GPIO_IDR_IDR_8 ((uint32_t)0x00000100)
  4032. #define GPIO_IDR_IDR_9 ((uint32_t)0x00000200)
  4033. #define GPIO_IDR_IDR_10 ((uint32_t)0x00000400)
  4034. #define GPIO_IDR_IDR_11 ((uint32_t)0x00000800)
  4035. #define GPIO_IDR_IDR_12 ((uint32_t)0x00001000)
  4036. #define GPIO_IDR_IDR_13 ((uint32_t)0x00002000)
  4037. #define GPIO_IDR_IDR_14 ((uint32_t)0x00004000)
  4038. #define GPIO_IDR_IDR_15 ((uint32_t)0x00008000)
  4039. /* Old GPIO_IDR register bits definition, maintained for legacy purpose */
  4040. #define GPIO_OTYPER_IDR_0 GPIO_IDR_IDR_0
  4041. #define GPIO_OTYPER_IDR_1 GPIO_IDR_IDR_1
  4042. #define GPIO_OTYPER_IDR_2 GPIO_IDR_IDR_2
  4043. #define GPIO_OTYPER_IDR_3 GPIO_IDR_IDR_3
  4044. #define GPIO_OTYPER_IDR_4 GPIO_IDR_IDR_4
  4045. #define GPIO_OTYPER_IDR_5 GPIO_IDR_IDR_5
  4046. #define GPIO_OTYPER_IDR_6 GPIO_IDR_IDR_6
  4047. #define GPIO_OTYPER_IDR_7 GPIO_IDR_IDR_7
  4048. #define GPIO_OTYPER_IDR_8 GPIO_IDR_IDR_8
  4049. #define GPIO_OTYPER_IDR_9 GPIO_IDR_IDR_9
  4050. #define GPIO_OTYPER_IDR_10 GPIO_IDR_IDR_10
  4051. #define GPIO_OTYPER_IDR_11 GPIO_IDR_IDR_11
  4052. #define GPIO_OTYPER_IDR_12 GPIO_IDR_IDR_12
  4053. #define GPIO_OTYPER_IDR_13 GPIO_IDR_IDR_13
  4054. #define GPIO_OTYPER_IDR_14 GPIO_IDR_IDR_14
  4055. #define GPIO_OTYPER_IDR_15 GPIO_IDR_IDR_15
  4056. /****************** Bits definition for GPIO_ODR register *******************/
  4057. #define GPIO_ODR_ODR_0 ((uint32_t)0x00000001)
  4058. #define GPIO_ODR_ODR_1 ((uint32_t)0x00000002)
  4059. #define GPIO_ODR_ODR_2 ((uint32_t)0x00000004)
  4060. #define GPIO_ODR_ODR_3 ((uint32_t)0x00000008)
  4061. #define GPIO_ODR_ODR_4 ((uint32_t)0x00000010)
  4062. #define GPIO_ODR_ODR_5 ((uint32_t)0x00000020)
  4063. #define GPIO_ODR_ODR_6 ((uint32_t)0x00000040)
  4064. #define GPIO_ODR_ODR_7 ((uint32_t)0x00000080)
  4065. #define GPIO_ODR_ODR_8 ((uint32_t)0x00000100)
  4066. #define GPIO_ODR_ODR_9 ((uint32_t)0x00000200)
  4067. #define GPIO_ODR_ODR_10 ((uint32_t)0x00000400)
  4068. #define GPIO_ODR_ODR_11 ((uint32_t)0x00000800)
  4069. #define GPIO_ODR_ODR_12 ((uint32_t)0x00001000)
  4070. #define GPIO_ODR_ODR_13 ((uint32_t)0x00002000)
  4071. #define GPIO_ODR_ODR_14 ((uint32_t)0x00004000)
  4072. #define GPIO_ODR_ODR_15 ((uint32_t)0x00008000)
  4073. /* Old GPIO_ODR register bits definition, maintained for legacy purpose */
  4074. #define GPIO_OTYPER_ODR_0 GPIO_ODR_ODR_0
  4075. #define GPIO_OTYPER_ODR_1 GPIO_ODR_ODR_1
  4076. #define GPIO_OTYPER_ODR_2 GPIO_ODR_ODR_2
  4077. #define GPIO_OTYPER_ODR_3 GPIO_ODR_ODR_3
  4078. #define GPIO_OTYPER_ODR_4 GPIO_ODR_ODR_4
  4079. #define GPIO_OTYPER_ODR_5 GPIO_ODR_ODR_5
  4080. #define GPIO_OTYPER_ODR_6 GPIO_ODR_ODR_6
  4081. #define GPIO_OTYPER_ODR_7 GPIO_ODR_ODR_7
  4082. #define GPIO_OTYPER_ODR_8 GPIO_ODR_ODR_8
  4083. #define GPIO_OTYPER_ODR_9 GPIO_ODR_ODR_9
  4084. #define GPIO_OTYPER_ODR_10 GPIO_ODR_ODR_10
  4085. #define GPIO_OTYPER_ODR_11 GPIO_ODR_ODR_11
  4086. #define GPIO_OTYPER_ODR_12 GPIO_ODR_ODR_12
  4087. #define GPIO_OTYPER_ODR_13 GPIO_ODR_ODR_13
  4088. #define GPIO_OTYPER_ODR_14 GPIO_ODR_ODR_14
  4089. #define GPIO_OTYPER_ODR_15 GPIO_ODR_ODR_15
  4090. /****************** Bits definition for GPIO_BSRR register ******************/
  4091. #define GPIO_BSRR_BS_0 ((uint32_t)0x00000001)
  4092. #define GPIO_BSRR_BS_1 ((uint32_t)0x00000002)
  4093. #define GPIO_BSRR_BS_2 ((uint32_t)0x00000004)
  4094. #define GPIO_BSRR_BS_3 ((uint32_t)0x00000008)
  4095. #define GPIO_BSRR_BS_4 ((uint32_t)0x00000010)
  4096. #define GPIO_BSRR_BS_5 ((uint32_t)0x00000020)
  4097. #define GPIO_BSRR_BS_6 ((uint32_t)0x00000040)
  4098. #define GPIO_BSRR_BS_7 ((uint32_t)0x00000080)
  4099. #define GPIO_BSRR_BS_8 ((uint32_t)0x00000100)
  4100. #define GPIO_BSRR_BS_9 ((uint32_t)0x00000200)
  4101. #define GPIO_BSRR_BS_10 ((uint32_t)0x00000400)
  4102. #define GPIO_BSRR_BS_11 ((uint32_t)0x00000800)
  4103. #define GPIO_BSRR_BS_12 ((uint32_t)0x00001000)
  4104. #define GPIO_BSRR_BS_13 ((uint32_t)0x00002000)
  4105. #define GPIO_BSRR_BS_14 ((uint32_t)0x00004000)
  4106. #define GPIO_BSRR_BS_15 ((uint32_t)0x00008000)
  4107. #define GPIO_BSRR_BR_0 ((uint32_t)0x00010000)
  4108. #define GPIO_BSRR_BR_1 ((uint32_t)0x00020000)
  4109. #define GPIO_BSRR_BR_2 ((uint32_t)0x00040000)
  4110. #define GPIO_BSRR_BR_3 ((uint32_t)0x00080000)
  4111. #define GPIO_BSRR_BR_4 ((uint32_t)0x00100000)
  4112. #define GPIO_BSRR_BR_5 ((uint32_t)0x00200000)
  4113. #define GPIO_BSRR_BR_6 ((uint32_t)0x00400000)
  4114. #define GPIO_BSRR_BR_7 ((uint32_t)0x00800000)
  4115. #define GPIO_BSRR_BR_8 ((uint32_t)0x01000000)
  4116. #define GPIO_BSRR_BR_9 ((uint32_t)0x02000000)
  4117. #define GPIO_BSRR_BR_10 ((uint32_t)0x04000000)
  4118. #define GPIO_BSRR_BR_11 ((uint32_t)0x08000000)
  4119. #define GPIO_BSRR_BR_12 ((uint32_t)0x10000000)
  4120. #define GPIO_BSRR_BR_13 ((uint32_t)0x20000000)
  4121. #define GPIO_BSRR_BR_14 ((uint32_t)0x40000000)
  4122. #define GPIO_BSRR_BR_15 ((uint32_t)0x80000000)
  4123. /****************** Bit definition for GPIO_LCKR register *********************/
  4124. #define GPIO_LCKR_LCK0 ((uint32_t)0x00000001)
  4125. #define GPIO_LCKR_LCK1 ((uint32_t)0x00000002)
  4126. #define GPIO_LCKR_LCK2 ((uint32_t)0x00000004)
  4127. #define GPIO_LCKR_LCK3 ((uint32_t)0x00000008)
  4128. #define GPIO_LCKR_LCK4 ((uint32_t)0x00000010)
  4129. #define GPIO_LCKR_LCK5 ((uint32_t)0x00000020)
  4130. #define GPIO_LCKR_LCK6 ((uint32_t)0x00000040)
  4131. #define GPIO_LCKR_LCK7 ((uint32_t)0x00000080)
  4132. #define GPIO_LCKR_LCK8 ((uint32_t)0x00000100)
  4133. #define GPIO_LCKR_LCK9 ((uint32_t)0x00000200)
  4134. #define GPIO_LCKR_LCK10 ((uint32_t)0x00000400)
  4135. #define GPIO_LCKR_LCK11 ((uint32_t)0x00000800)
  4136. #define GPIO_LCKR_LCK12 ((uint32_t)0x00001000)
  4137. #define GPIO_LCKR_LCK13 ((uint32_t)0x00002000)
  4138. #define GPIO_LCKR_LCK14 ((uint32_t)0x00004000)
  4139. #define GPIO_LCKR_LCK15 ((uint32_t)0x00008000)
  4140. #define GPIO_LCKR_LCKK ((uint32_t)0x00010000)
  4141. /******************************************************************************/
  4142. /* */
  4143. /* Inter-integrated Circuit Interface */
  4144. /* */
  4145. /******************************************************************************/
  4146. /******************* Bit definition for I2C_CR1 register ********************/
  4147. #define I2C_CR1_PE ((uint32_t)0x00000001) /*!<Peripheral Enable */
  4148. #define I2C_CR1_SMBUS ((uint32_t)0x00000002) /*!<SMBus Mode */
  4149. #define I2C_CR1_SMBTYPE ((uint32_t)0x00000008) /*!<SMBus Type */
  4150. #define I2C_CR1_ENARP ((uint32_t)0x00000010) /*!<ARP Enable */
  4151. #define I2C_CR1_ENPEC ((uint32_t)0x00000020) /*!<PEC Enable */
  4152. #define I2C_CR1_ENGC ((uint32_t)0x00000040) /*!<General Call Enable */
  4153. #define I2C_CR1_NOSTRETCH ((uint32_t)0x00000080) /*!<Clock Stretching Disable (Slave mode) */
  4154. #define I2C_CR1_START ((uint32_t)0x00000100) /*!<Start Generation */
  4155. #define I2C_CR1_STOP ((uint32_t)0x00000200) /*!<Stop Generation */
  4156. #define I2C_CR1_ACK ((uint32_t)0x00000400) /*!<Acknowledge Enable */
  4157. #define I2C_CR1_POS ((uint32_t)0x00000800) /*!<Acknowledge/PEC Position (for data reception) */
  4158. #define I2C_CR1_PEC ((uint32_t)0x00001000) /*!<Packet Error Checking */
  4159. #define I2C_CR1_ALERT ((uint32_t)0x00002000) /*!<SMBus Alert */
  4160. #define I2C_CR1_SWRST ((uint32_t)0x00008000) /*!<Software Reset */
  4161. /******************* Bit definition for I2C_CR2 register ********************/
  4162. #define I2C_CR2_FREQ ((uint32_t)0x0000003F) /*!<FREQ[5:0] bits (Peripheral Clock Frequency) */
  4163. #define I2C_CR2_FREQ_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4164. #define I2C_CR2_FREQ_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4165. #define I2C_CR2_FREQ_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  4166. #define I2C_CR2_FREQ_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  4167. #define I2C_CR2_FREQ_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  4168. #define I2C_CR2_FREQ_5 ((uint32_t)0x00000020) /*!<Bit 5 */
  4169. #define I2C_CR2_ITERREN ((uint32_t)0x00000100) /*!<Error Interrupt Enable */
  4170. #define I2C_CR2_ITEVTEN ((uint32_t)0x00000200) /*!<Event Interrupt Enable */
  4171. #define I2C_CR2_ITBUFEN ((uint32_t)0x00000400) /*!<Buffer Interrupt Enable */
  4172. #define I2C_CR2_DMAEN ((uint32_t)0x00000800) /*!<DMA Requests Enable */
  4173. #define I2C_CR2_LAST ((uint32_t)0x00001000) /*!<DMA Last Transfer */
  4174. /******************* Bit definition for I2C_OAR1 register *******************/
  4175. #define I2C_OAR1_ADD1_7 ((uint32_t)0x000000FE) /*!<Interface Address */
  4176. #define I2C_OAR1_ADD8_9 ((uint32_t)0x00000300) /*!<Interface Address */
  4177. #define I2C_OAR1_ADD0 ((uint32_t)0x00000001) /*!<Bit 0 */
  4178. #define I2C_OAR1_ADD1 ((uint32_t)0x00000002) /*!<Bit 1 */
  4179. #define I2C_OAR1_ADD2 ((uint32_t)0x00000004) /*!<Bit 2 */
  4180. #define I2C_OAR1_ADD3 ((uint32_t)0x00000008) /*!<Bit 3 */
  4181. #define I2C_OAR1_ADD4 ((uint32_t)0x00000010) /*!<Bit 4 */
  4182. #define I2C_OAR1_ADD5 ((uint32_t)0x00000020) /*!<Bit 5 */
  4183. #define I2C_OAR1_ADD6 ((uint32_t)0x00000040) /*!<Bit 6 */
  4184. #define I2C_OAR1_ADD7 ((uint32_t)0x00000080) /*!<Bit 7 */
  4185. #define I2C_OAR1_ADD8 ((uint32_t)0x00000100) /*!<Bit 8 */
  4186. #define I2C_OAR1_ADD9 ((uint32_t)0x00000200) /*!<Bit 9 */
  4187. #define I2C_OAR1_ADDMODE ((uint32_t)0x00008000) /*!<Addressing Mode (Slave mode) */
  4188. /******************* Bit definition for I2C_OAR2 register *******************/
  4189. #define I2C_OAR2_ENDUAL ((uint32_t)0x00000001) /*!<Dual addressing mode enable */
  4190. #define I2C_OAR2_ADD2 ((uint32_t)0x000000FE) /*!<Interface address */
  4191. /******************** Bit definition for I2C_DR register ********************/
  4192. #define I2C_DR_DR ((uint32_t)0x000000FF) /*!<8-bit Data Register */
  4193. /******************* Bit definition for I2C_SR1 register ********************/
  4194. #define I2C_SR1_SB ((uint32_t)0x00000001) /*!<Start Bit (Master mode) */
  4195. #define I2C_SR1_ADDR ((uint32_t)0x00000002) /*!<Address sent (master mode)/matched (slave mode) */
  4196. #define I2C_SR1_BTF ((uint32_t)0x00000004) /*!<Byte Transfer Finished */
  4197. #define I2C_SR1_ADD10 ((uint32_t)0x00000008) /*!<10-bit header sent (Master mode) */
  4198. #define I2C_SR1_STOPF ((uint32_t)0x00000010) /*!<Stop detection (Slave mode) */
  4199. #define I2C_SR1_RXNE ((uint32_t)0x00000040) /*!<Data Register not Empty (receivers) */
  4200. #define I2C_SR1_TXE ((uint32_t)0x00000080) /*!<Data Register Empty (transmitters) */
  4201. #define I2C_SR1_BERR ((uint32_t)0x00000100) /*!<Bus Error */
  4202. #define I2C_SR1_ARLO ((uint32_t)0x00000200) /*!<Arbitration Lost (master mode) */
  4203. #define I2C_SR1_AF ((uint32_t)0x00000400) /*!<Acknowledge Failure */
  4204. #define I2C_SR1_OVR ((uint32_t)0x00000800) /*!<Overrun/Underrun */
  4205. #define I2C_SR1_PECERR ((uint32_t)0x00001000) /*!<PEC Error in reception */
  4206. #define I2C_SR1_TIMEOUT ((uint32_t)0x00004000) /*!<Timeout or Tlow Error */
  4207. #define I2C_SR1_SMBALERT ((uint32_t)0x00008000) /*!<SMBus Alert */
  4208. /******************* Bit definition for I2C_SR2 register ********************/
  4209. #define I2C_SR2_MSL ((uint32_t)0x00000001) /*!<Master/Slave */
  4210. #define I2C_SR2_BUSY ((uint32_t)0x00000002) /*!<Bus Busy */
  4211. #define I2C_SR2_TRA ((uint32_t)0x00000004) /*!<Transmitter/Receiver */
  4212. #define I2C_SR2_GENCALL ((uint32_t)0x00000010) /*!<General Call Address (Slave mode) */
  4213. #define I2C_SR2_SMBDEFAULT ((uint32_t)0x00000020) /*!<SMBus Device Default Address (Slave mode) */
  4214. #define I2C_SR2_SMBHOST ((uint32_t)0x00000040) /*!<SMBus Host Header (Slave mode) */
  4215. #define I2C_SR2_DUALF ((uint32_t)0x00000080) /*!<Dual Flag (Slave mode) */
  4216. #define I2C_SR2_PEC ((uint32_t)0x0000FF00) /*!<Packet Error Checking Register */
  4217. /******************* Bit definition for I2C_CCR register ********************/
  4218. #define I2C_CCR_CCR ((uint32_t)0x00000FFF) /*!<Clock Control Register in Fast/Standard mode (Master mode) */
  4219. #define I2C_CCR_DUTY ((uint32_t)0x00004000) /*!<Fast Mode Duty Cycle */
  4220. #define I2C_CCR_FS ((uint32_t)0x00008000) /*!<I2C Master Mode Selection */
  4221. /****************** Bit definition for I2C_TRISE register *******************/
  4222. #define I2C_TRISE_TRISE ((uint32_t)0x0000003F) /*!<Maximum Rise Time in Fast/Standard mode (Master mode) */
  4223. /****************** Bit definition for I2C_FLTR register *******************/
  4224. #define I2C_FLTR_DNF ((uint32_t)0x0000000F) /*!<Digital Noise Filter */
  4225. #define I2C_FLTR_ANOFF ((uint32_t)0x00000010) /*!<Analog Noise Filter OFF */
  4226. /******************************************************************************/
  4227. /* */
  4228. /* Fast Mode Plus Inter-integrated Circuit Interface (I2C) */
  4229. /* */
  4230. /******************************************************************************/
  4231. /******************* Bit definition for I2C_CR1 register *******************/
  4232. #define FMPI2C_CR1_PE ((uint32_t)0x00000001) /*!< Peripheral enable */
  4233. #define FMPI2C_CR1_TXIE ((uint32_t)0x00000002) /*!< TX interrupt enable */
  4234. #define FMPI2C_CR1_RXIE ((uint32_t)0x00000004) /*!< RX interrupt enable */
  4235. #define FMPI2C_CR1_ADDRIE ((uint32_t)0x00000008) /*!< Address match interrupt enable */
  4236. #define FMPI2C_CR1_NACKIE ((uint32_t)0x00000010) /*!< NACK received interrupt enable */
  4237. #define FMPI2C_CR1_STOPIE ((uint32_t)0x00000020) /*!< STOP detection interrupt enable */
  4238. #define FMPI2C_CR1_TCIE ((uint32_t)0x00000040) /*!< Transfer complete interrupt enable */
  4239. #define FMPI2C_CR1_ERRIE ((uint32_t)0x00000080) /*!< Errors interrupt enable */
  4240. #define FMPI2C_CR1_DFN ((uint32_t)0x00000F00) /*!< Digital noise filter */
  4241. #define FMPI2C_CR1_ANFOFF ((uint32_t)0x00001000) /*!< Analog noise filter OFF */
  4242. #define FMPI2C_CR1_SWRST ((uint32_t)0x00002000) /*!< Software reset */
  4243. #define FMPI2C_CR1_TXDMAEN ((uint32_t)0x00004000) /*!< DMA transmission requests enable */
  4244. #define FMPI2C_CR1_RXDMAEN ((uint32_t)0x00008000) /*!< DMA reception requests enable */
  4245. #define FMPI2C_CR1_SBC ((uint32_t)0x00010000) /*!< Slave byte control */
  4246. #define FMPI2C_CR1_NOSTRETCH ((uint32_t)0x00020000) /*!< Clock stretching disable */
  4247. #define FMPI2C_CR1_WUPEN ((uint32_t)0x00040000) /*!< Wakeup from STOP enable */
  4248. #define FMPI2C_CR1_GCEN ((uint32_t)0x00080000) /*!< General call enable */
  4249. #define FMPI2C_CR1_SMBHEN ((uint32_t)0x00100000) /*!< SMBus host address enable */
  4250. #define FMPI2C_CR1_SMBDEN ((uint32_t)0x00200000) /*!< SMBus device default address enable */
  4251. #define FMPI2C_CR1_ALERTEN ((uint32_t)0x00400000) /*!< SMBus alert enable */
  4252. #define FMPI2C_CR1_PECEN ((uint32_t)0x00800000) /*!< PEC enable */
  4253. /****************** Bit definition for I2C_CR2 register ********************/
  4254. #define FMPI2C_CR2_SADD ((uint32_t)0x000003FF) /*!< Slave address (master mode) */
  4255. #define FMPI2C_CR2_RD_WRN ((uint32_t)0x00000400) /*!< Transfer direction (master mode) */
  4256. #define FMPI2C_CR2_ADD10 ((uint32_t)0x00000800) /*!< 10-bit addressing mode (master mode) */
  4257. #define FMPI2C_CR2_HEAD10R ((uint32_t)0x00001000) /*!< 10-bit address header only read direction (master mode) */
  4258. #define FMPI2C_CR2_START ((uint32_t)0x00002000) /*!< START generation */
  4259. #define FMPI2C_CR2_STOP ((uint32_t)0x00004000) /*!< STOP generation (master mode) */
  4260. #define FMPI2C_CR2_NACK ((uint32_t)0x00008000) /*!< NACK generation (slave mode) */
  4261. #define FMPI2C_CR2_NBYTES ((uint32_t)0x00FF0000) /*!< Number of bytes */
  4262. #define FMPI2C_CR2_RELOAD ((uint32_t)0x01000000) /*!< NBYTES reload mode */
  4263. #define FMPI2C_CR2_AUTOEND ((uint32_t)0x02000000) /*!< Automatic end mode (master mode) */
  4264. #define FMPI2C_CR2_PECBYTE ((uint32_t)0x04000000) /*!< Packet error checking byte */
  4265. /******************* Bit definition for I2C_OAR1 register ******************/
  4266. #define FMPI2C_OAR1_OA1 ((uint32_t)0x000003FF) /*!< Interface own address 1 */
  4267. #define FMPI2C_OAR1_OA1MODE ((uint32_t)0x00000400) /*!< Own address 1 10-bit mode */
  4268. #define FMPI2C_OAR1_OA1EN ((uint32_t)0x00008000) /*!< Own address 1 enable */
  4269. /******************* Bit definition for I2C_OAR2 register ******************/
  4270. #define FMPI2C_OAR2_OA2 ((uint32_t)0x000000FE) /*!< Interface own address 2 */
  4271. #define FMPI2C_OAR2_OA2MSK ((uint32_t)0x00000700) /*!< Own address 2 masks */
  4272. #define FMPI2C_OAR2_OA2EN ((uint32_t)0x00008000) /*!< Own address 2 enable */
  4273. /******************* Bit definition for I2C_TIMINGR register *******************/
  4274. #define FMPI2C_TIMINGR_SCLL ((uint32_t)0x000000FF) /*!< SCL low period (master mode) */
  4275. #define FMPI2C_TIMINGR_SCLH ((uint32_t)0x0000FF00) /*!< SCL high period (master mode) */
  4276. #define FMPI2C_TIMINGR_SDADEL ((uint32_t)0x000F0000) /*!< Data hold time */
  4277. #define FMPI2C_TIMINGR_SCLDEL ((uint32_t)0x00F00000) /*!< Data setup time */
  4278. #define FMPI2C_TIMINGR_PRESC ((uint32_t)0xF0000000) /*!< Timings prescaler */
  4279. /******************* Bit definition for I2C_TIMEOUTR register *******************/
  4280. #define FMPI2C_TIMEOUTR_TIMEOUTA ((uint32_t)0x00000FFF) /*!< Bus timeout A */
  4281. #define FMPI2C_TIMEOUTR_TIDLE ((uint32_t)0x00001000) /*!< Idle clock timeout detection */
  4282. #define FMPI2C_TIMEOUTR_TIMOUTEN ((uint32_t)0x00008000) /*!< Clock timeout enable */
  4283. #define FMPI2C_TIMEOUTR_TIMEOUTB ((uint32_t)0x0FFF0000) /*!< Bus timeout B */
  4284. #define FMPI2C_TIMEOUTR_TEXTEN ((uint32_t)0x80000000) /*!< Extended clock timeout enable */
  4285. /****************** Bit definition for I2C_ISR register *********************/
  4286. #define FMPI2C_ISR_TXE ((uint32_t)0x00000001) /*!< Transmit data register empty */
  4287. #define FMPI2C_ISR_TXIS ((uint32_t)0x00000002) /*!< Transmit interrupt status */
  4288. #define FMPI2C_ISR_RXNE ((uint32_t)0x00000004) /*!< Receive data register not empty */
  4289. #define FMPI2C_ISR_ADDR ((uint32_t)0x00000008) /*!< Address matched (slave mode) */
  4290. #define FMPI2C_ISR_NACKF ((uint32_t)0x00000010) /*!< NACK received flag */
  4291. #define FMPI2C_ISR_STOPF ((uint32_t)0x00000020) /*!< STOP detection flag */
  4292. #define FMPI2C_ISR_TC ((uint32_t)0x00000040) /*!< Transfer complete (master mode) */
  4293. #define FMPI2C_ISR_TCR ((uint32_t)0x00000080) /*!< Transfer complete reload */
  4294. #define FMPI2C_ISR_BERR ((uint32_t)0x00000100) /*!< Bus error */
  4295. #define FMPI2C_ISR_ARLO ((uint32_t)0x00000200) /*!< Arbitration lost */
  4296. #define FMPI2C_ISR_OVR ((uint32_t)0x00000400) /*!< Overrun/Underrun */
  4297. #define FMPI2C_ISR_PECERR ((uint32_t)0x00000800) /*!< PEC error in reception */
  4298. #define FMPI2C_ISR_TIMEOUT ((uint32_t)0x00001000) /*!< Timeout or Tlow detection flag */
  4299. #define FMPI2C_ISR_ALERT ((uint32_t)0x00002000) /*!< SMBus alert */
  4300. #define FMPI2C_ISR_BUSY ((uint32_t)0x00008000) /*!< Bus busy */
  4301. #define FMPI2C_ISR_DIR ((uint32_t)0x00010000) /*!< Transfer direction (slave mode) */
  4302. #define FMPI2C_ISR_ADDCODE ((uint32_t)0x00FE0000) /*!< Address match code (slave mode) */
  4303. /****************** Bit definition for I2C_ICR register *********************/
  4304. #define FMPI2C_ICR_ADDRCF ((uint32_t)0x00000008) /*!< Address matched clear flag */
  4305. #define FMPI2C_ICR_NACKCF ((uint32_t)0x00000010) /*!< NACK clear flag */
  4306. #define FMPI2C_ICR_STOPCF ((uint32_t)0x00000020) /*!< STOP detection clear flag */
  4307. #define FMPI2C_ICR_BERRCF ((uint32_t)0x00000100) /*!< Bus error clear flag */
  4308. #define FMPI2C_ICR_ARLOCF ((uint32_t)0x00000200) /*!< Arbitration lost clear flag */
  4309. #define FMPI2C_ICR_OVRCF ((uint32_t)0x00000400) /*!< Overrun/Underrun clear flag */
  4310. #define FMPI2C_ICR_PECCF ((uint32_t)0x00000800) /*!< PAC error clear flag */
  4311. #define FMPI2C_ICR_TIMOUTCF ((uint32_t)0x00001000) /*!< Timeout clear flag */
  4312. #define FMPI2C_ICR_ALERTCF ((uint32_t)0x00002000) /*!< Alert clear flag */
  4313. /****************** Bit definition for I2C_PECR register *********************/
  4314. #define FMPI2C_PECR_PEC ((uint32_t)0x000000FF) /*!< PEC register */
  4315. /****************** Bit definition for I2C_RXDR register *********************/
  4316. #define FMPI2C_RXDR_RXDATA ((uint32_t)0x000000FF) /*!< 8-bit receive data */
  4317. /****************** Bit definition for I2C_TXDR register *********************/
  4318. #define FMPI2C_TXDR_TXDATA ((uint32_t)0x000000FF) /*!< 8-bit transmit data */
  4319. /******************************************************************************/
  4320. /* */
  4321. /* Independent WATCHDOG */
  4322. /* */
  4323. /******************************************************************************/
  4324. /******************* Bit definition for IWDG_KR register ********************/
  4325. #define IWDG_KR_KEY ((uint32_t)0xFFFF) /*!<Key value (write only, read 0000h) */
  4326. /******************* Bit definition for IWDG_PR register ********************/
  4327. #define IWDG_PR_PR ((uint32_t)0x07) /*!<PR[2:0] (Prescaler divider) */
  4328. #define IWDG_PR_PR_0 ((uint32_t)0x01) /*!<Bit 0 */
  4329. #define IWDG_PR_PR_1 ((uint32_t)0x02) /*!<Bit 1 */
  4330. #define IWDG_PR_PR_2 ((uint32_t)0x04) /*!<Bit 2 */
  4331. /******************* Bit definition for IWDG_RLR register *******************/
  4332. #define IWDG_RLR_RL ((uint32_t)0x0FFF) /*!<Watchdog counter reload value */
  4333. /******************* Bit definition for IWDG_SR register ********************/
  4334. #define IWDG_SR_PVU ((uint32_t)0x01) /*!<Watchdog prescaler value update */
  4335. #define IWDG_SR_RVU ((uint32_t)0x02) /*!<Watchdog counter reload value update */
  4336. /******************************************************************************/
  4337. /* */
  4338. /* Power Control */
  4339. /* */
  4340. /******************************************************************************/
  4341. /******************** Bit definition for PWR_CR register ********************/
  4342. #define PWR_CR_LPDS ((uint32_t)0x00000001) /*!< Low-Power Deepsleep */
  4343. #define PWR_CR_PDDS ((uint32_t)0x00000002) /*!< Power Down Deepsleep */
  4344. #define PWR_CR_CWUF ((uint32_t)0x00000004) /*!< Clear Wakeup Flag */
  4345. #define PWR_CR_CSBF ((uint32_t)0x00000008) /*!< Clear Standby Flag */
  4346. #define PWR_CR_PVDE ((uint32_t)0x00000010) /*!< Power Voltage Detector Enable */
  4347. #define PWR_CR_PLS ((uint32_t)0x000000E0) /*!< PLS[2:0] bits (PVD Level Selection) */
  4348. #define PWR_CR_PLS_0 ((uint32_t)0x00000020) /*!< Bit 0 */
  4349. #define PWR_CR_PLS_1 ((uint32_t)0x00000040) /*!< Bit 1 */
  4350. #define PWR_CR_PLS_2 ((uint32_t)0x00000080) /*!< Bit 2 */
  4351. /*!< PVD level configuration */
  4352. #define PWR_CR_PLS_LEV0 ((uint32_t)0x00000000) /*!< PVD level 0 */
  4353. #define PWR_CR_PLS_LEV1 ((uint32_t)0x00000020) /*!< PVD level 1 */
  4354. #define PWR_CR_PLS_LEV2 ((uint32_t)0x00000040) /*!< PVD level 2 */
  4355. #define PWR_CR_PLS_LEV3 ((uint32_t)0x00000060) /*!< PVD level 3 */
  4356. #define PWR_CR_PLS_LEV4 ((uint32_t)0x00000080) /*!< PVD level 4 */
  4357. #define PWR_CR_PLS_LEV5 ((uint32_t)0x000000A0) /*!< PVD level 5 */
  4358. #define PWR_CR_PLS_LEV6 ((uint32_t)0x000000C0) /*!< PVD level 6 */
  4359. #define PWR_CR_PLS_LEV7 ((uint32_t)0x000000E0) /*!< PVD level 7 */
  4360. #define PWR_CR_DBP ((uint32_t)0x00000100) /*!< Disable Backup Domain write protection */
  4361. #define PWR_CR_FPDS ((uint32_t)0x00000200) /*!< Flash power down in Stop mode */
  4362. #define PWR_CR_LPLVDS ((uint32_t)0x00000400) /*!< Low-Power Regulator Low Voltage Scaling in Stop mode */
  4363. #define PWR_CR_MRLVDS ((uint32_t)0x00000800) /*!< Main regulator Low Voltage Scaling in Stop mode */
  4364. #define PWR_CR_ADCDC1 ((uint32_t)0x00002000) /*!< Refer to AN4073 on how to use this bit */
  4365. #define PWR_CR_VOS ((uint32_t)0x0000C000) /*!< VOS[1:0] bits (Regulator voltage scaling output selection) */
  4366. #define PWR_CR_VOS_0 ((uint32_t)0x00004000) /*!< Bit 0 */
  4367. #define PWR_CR_VOS_1 ((uint32_t)0x00008000) /*!< Bit 1 */
  4368. #define PWR_CR_ODEN ((uint32_t)0x00010000) /*!< Over Drive enable */
  4369. #define PWR_CR_ODSWEN ((uint32_t)0x00020000) /*!< Over Drive switch enabled */
  4370. #define PWR_CR_UDEN ((uint32_t)0x000C0000) /*!< Under Drive enable in stop mode */
  4371. #define PWR_CR_UDEN_0 ((uint32_t)0x00040000) /*!< Bit 0 */
  4372. #define PWR_CR_UDEN_1 ((uint32_t)0x00080000) /*!< Bit 1 */
  4373. #define PWR_CR_FMSSR ((uint32_t)0x00100000) /*!< Flash Memory Sleep System Run */
  4374. #define PWR_CR_FISSR ((uint32_t)0x00200000) /*!< Flash Interface Stop while System Run */
  4375. /* Legacy define */
  4376. #define PWR_CR_PMODE PWR_CR_VOS
  4377. #define PWR_CR_LPUDS PWR_CR_LPLVDS /*!< Low-Power Regulator in deepsleep under-drive mode */
  4378. #define PWR_CR_MRUDS PWR_CR_MRLVDS /*!< Main regulator in deepsleep under-drive mode */
  4379. /******************* Bit definition for PWR_CSR register ********************/
  4380. #define PWR_CSR_WUF ((uint32_t)0x00000001) /*!< Wakeup Flag */
  4381. #define PWR_CSR_SBF ((uint32_t)0x00000002) /*!< Standby Flag */
  4382. #define PWR_CSR_PVDO ((uint32_t)0x00000004) /*!< PVD Output */
  4383. #define PWR_CSR_BRR ((uint32_t)0x00000008) /*!< Backup regulator ready */
  4384. #define PWR_CSR_EWUP2 ((uint32_t)0x00000080) /*!< Enable WKUP pin 2 */
  4385. #define PWR_CSR_EWUP1 ((uint32_t)0x00000100) /*!< Enable WKUP pin 1 */
  4386. #define PWR_CSR_BRE ((uint32_t)0x00000200) /*!< Backup regulator enable */
  4387. #define PWR_CSR_VOSRDY ((uint32_t)0x00004000) /*!< Regulator voltage scaling output selection ready */
  4388. #define PWR_CSR_ODRDY ((uint32_t)0x00010000) /*!< Over Drive generator ready */
  4389. #define PWR_CSR_ODSWRDY ((uint32_t)0x00020000) /*!< Over Drive Switch ready */
  4390. #define PWR_CSR_UDSWRDY ((uint32_t)0x000C0000) /*!< Under Drive ready */
  4391. /* Legacy define */
  4392. #define PWR_CSR_REGRDY PWR_CSR_VOSRDY
  4393. /******************************************************************************/
  4394. /* */
  4395. /* QUADSPI */
  4396. /* */
  4397. /******************************************************************************/
  4398. /***************** Bit definition for QUADSPI_CR register *******************/
  4399. #define QUADSPI_CR_EN ((uint32_t)0x00000001) /*!< Enable */
  4400. #define QUADSPI_CR_ABORT ((uint32_t)0x00000002) /*!< Abort request */
  4401. #define QUADSPI_CR_DMAEN ((uint32_t)0x00000004) /*!< DMA Enable */
  4402. #define QUADSPI_CR_TCEN ((uint32_t)0x00000008) /*!< Timeout Counter Enable */
  4403. #define QUADSPI_CR_SSHIFT ((uint32_t)0x00000010) /*!< SSHIFT Sample Shift */
  4404. #define QUADSPI_CR_DFM ((uint32_t)0x00000040) /*!< Dual Flash Mode */
  4405. #define QUADSPI_CR_FSEL ((uint32_t)0x00000080) /*!< Flash Select */
  4406. #define QUADSPI_CR_FTHRES ((uint32_t)0x00000F00) /*!< FTHRES[3:0] FIFO Level */
  4407. #define QUADSPI_CR_FTHRES_0 ((uint32_t)0x00000100) /*!< Bit 0 */
  4408. #define QUADSPI_CR_FTHRES_1 ((uint32_t)0x00000200) /*!< Bit 1 */
  4409. #define QUADSPI_CR_FTHRES_2 ((uint32_t)0x00000400) /*!< Bit 2 */
  4410. #define QUADSPI_CR_FTHRES_3 ((uint32_t)0x00000800) /*!< Bit 3 */
  4411. #define QUADSPI_CR_TEIE ((uint32_t)0x00010000) /*!< Transfer Error Interrupt Enable */
  4412. #define QUADSPI_CR_TCIE ((uint32_t)0x00020000) /*!< Transfer Complete Interrupt Enable */
  4413. #define QUADSPI_CR_FTIE ((uint32_t)0x00040000) /*!< FIFO Threshold Interrupt Enable */
  4414. #define QUADSPI_CR_SMIE ((uint32_t)0x00080000) /*!< Status Match Interrupt Enable */
  4415. #define QUADSPI_CR_TOIE ((uint32_t)0x00100000) /*!< TimeOut Interrupt Enable */
  4416. #define QUADSPI_CR_APMS ((uint32_t)0x00400000) /*!< Bit 1 */
  4417. #define QUADSPI_CR_PMM ((uint32_t)0x00800000) /*!< Polling Match Mode */
  4418. #define QUADSPI_CR_PRESCALER ((uint32_t)0xFF000000) /*!< PRESCALER[7:0] Clock prescaler */
  4419. #define QUADSPI_CR_PRESCALER_0 ((uint32_t)0x01000000) /*!< Bit 0 */
  4420. #define QUADSPI_CR_PRESCALER_1 ((uint32_t)0x02000000) /*!< Bit 1 */
  4421. #define QUADSPI_CR_PRESCALER_2 ((uint32_t)0x04000000) /*!< Bit 2 */
  4422. #define QUADSPI_CR_PRESCALER_3 ((uint32_t)0x08000000) /*!< Bit 3 */
  4423. #define QUADSPI_CR_PRESCALER_4 ((uint32_t)0x10000000) /*!< Bit 4 */
  4424. #define QUADSPI_CR_PRESCALER_5 ((uint32_t)0x20000000) /*!< Bit 5 */
  4425. #define QUADSPI_CR_PRESCALER_6 ((uint32_t)0x40000000) /*!< Bit 6 */
  4426. #define QUADSPI_CR_PRESCALER_7 ((uint32_t)0x80000000) /*!< Bit 7 */
  4427. /***************** Bit definition for QUADSPI_DCR register ******************/
  4428. #define QUADSPI_DCR_CKMODE ((uint32_t)0x00000001) /*!< Mode 0 / Mode 3 */
  4429. #define QUADSPI_DCR_CSHT ((uint32_t)0x00000700) /*!< CSHT[2:0]: ChipSelect High Time */
  4430. #define QUADSPI_DCR_CSHT_0 ((uint32_t)0x00000100) /*!< Bit 0 */
  4431. #define QUADSPI_DCR_CSHT_1 ((uint32_t)0x00000200) /*!< Bit 1 */
  4432. #define QUADSPI_DCR_CSHT_2 ((uint32_t)0x00000400) /*!< Bit 2 */
  4433. #define QUADSPI_DCR_FSIZE ((uint32_t)0x001F0000) /*!< FSIZE[4:0]: Flash Size */
  4434. #define QUADSPI_DCR_FSIZE_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  4435. #define QUADSPI_DCR_FSIZE_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  4436. #define QUADSPI_DCR_FSIZE_2 ((uint32_t)0x00040000) /*!< Bit 2 */
  4437. #define QUADSPI_DCR_FSIZE_3 ((uint32_t)0x00080000) /*!< Bit 3 */
  4438. #define QUADSPI_DCR_FSIZE_4 ((uint32_t)0x00100000) /*!< Bit 4 */
  4439. /****************** Bit definition for QUADSPI_SR register *******************/
  4440. #define QUADSPI_SR_TEF ((uint32_t)0x00000001) /*!< Transfer Error Flag */
  4441. #define QUADSPI_SR_TCF ((uint32_t)0x00000002) /*!< Transfer Complete Flag */
  4442. #define QUADSPI_SR_FTF ((uint32_t)0x00000004) /*!< FIFO Threshlod Flag */
  4443. #define QUADSPI_SR_SMF ((uint32_t)0x00000008) /*!< Status Match Flag */
  4444. #define QUADSPI_SR_TOF ((uint32_t)0x00000010) /*!< Timeout Flag */
  4445. #define QUADSPI_SR_BUSY ((uint32_t)0x00000020) /*!< Busy */
  4446. #define QUADSPI_SR_FLEVEL ((uint32_t)0x00003F00) /*!< FIFO Threshlod Flag */
  4447. #define QUADSPI_SR_FLEVEL_0 ((uint32_t)0x00000100) /*!< Bit 0 */
  4448. #define QUADSPI_SR_FLEVEL_1 ((uint32_t)0x00000200) /*!< Bit 1 */
  4449. #define QUADSPI_SR_FLEVEL_2 ((uint32_t)0x00000400) /*!< Bit 2 */
  4450. #define QUADSPI_SR_FLEVEL_3 ((uint32_t)0x00000800) /*!< Bit 3 */
  4451. #define QUADSPI_SR_FLEVEL_4 ((uint32_t)0x00001000) /*!< Bit 4 */
  4452. #define QUADSPI_SR_FLEVEL_5 ((uint32_t)0x00002000) /*!< Bit 5 */
  4453. /****************** Bit definition for QUADSPI_FCR register ******************/
  4454. #define QUADSPI_FCR_CTEF ((uint32_t)0x00000001) /*!< Clear Transfer Error Flag */
  4455. #define QUADSPI_FCR_CTCF ((uint32_t)0x00000002) /*!< Clear Transfer Complete Flag */
  4456. #define QUADSPI_FCR_CSMF ((uint32_t)0x00000008) /*!< Clear Status Match Flag */
  4457. #define QUADSPI_FCR_CTOF ((uint32_t)0x00000010) /*!< Clear Timeout Flag */
  4458. /****************** Bit definition for QUADSPI_DLR register ******************/
  4459. #define QUADSPI_DLR_DL ((uint32_t)0xFFFFFFFF) /*!< DL[31:0]: Data Length */
  4460. /****************** Bit definition for QUADSPI_CCR register ******************/
  4461. #define QUADSPI_CCR_INSTRUCTION ((uint32_t)0x000000FF) /*!< INSTRUCTION[7:0]: Instruction */
  4462. #define QUADSPI_CCR_INSTRUCTION_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  4463. #define QUADSPI_CCR_INSTRUCTION_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  4464. #define QUADSPI_CCR_INSTRUCTION_2 ((uint32_t)0x00000004) /*!< Bit 2 */
  4465. #define QUADSPI_CCR_INSTRUCTION_3 ((uint32_t)0x00000008) /*!< Bit 3 */
  4466. #define QUADSPI_CCR_INSTRUCTION_4 ((uint32_t)0x00000010) /*!< Bit 4 */
  4467. #define QUADSPI_CCR_INSTRUCTION_5 ((uint32_t)0x00000020) /*!< Bit 5 */
  4468. #define QUADSPI_CCR_INSTRUCTION_6 ((uint32_t)0x00000040) /*!< Bit 6 */
  4469. #define QUADSPI_CCR_INSTRUCTION_7 ((uint32_t)0x00000080) /*!< Bit 7 */
  4470. #define QUADSPI_CCR_IMODE ((uint32_t)0x00000300) /*!< IMODE[1:0]: Instruction Mode */
  4471. #define QUADSPI_CCR_IMODE_0 ((uint32_t)0x00000100) /*!< Bit 0 */
  4472. #define QUADSPI_CCR_IMODE_1 ((uint32_t)0x00000200) /*!< Bit 1 */
  4473. #define QUADSPI_CCR_ADMODE ((uint32_t)0x00000C00) /*!< ADMODE[1:0]: Address Mode */
  4474. #define QUADSPI_CCR_ADMODE_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4475. #define QUADSPI_CCR_ADMODE_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4476. #define QUADSPI_CCR_ADSIZE ((uint32_t)0x00003000) /*!< ADSIZE[1:0]: Address Size */
  4477. #define QUADSPI_CCR_ADSIZE_0 ((uint32_t)0x00001000) /*!< Bit 0 */
  4478. #define QUADSPI_CCR_ADSIZE_1 ((uint32_t)0x00002000) /*!< Bit 1 */
  4479. #define QUADSPI_CCR_ABMODE ((uint32_t)0x0000C000) /*!< ABMODE[1:0]: Alternate Bytes Mode */
  4480. #define QUADSPI_CCR_ABMODE_0 ((uint32_t)0x00004000) /*!< Bit 0 */
  4481. #define QUADSPI_CCR_ABMODE_1 ((uint32_t)0x00008000) /*!< Bit 1 */
  4482. #define QUADSPI_CCR_ABSIZE ((uint32_t)0x00030000) /*!< ABSIZE[1:0]: Instruction Mode */
  4483. #define QUADSPI_CCR_ABSIZE_0 ((uint32_t)0x00010000) /*!< Bit 0 */
  4484. #define QUADSPI_CCR_ABSIZE_1 ((uint32_t)0x00020000) /*!< Bit 1 */
  4485. #define QUADSPI_CCR_DCYC ((uint32_t)0x007C0000) /*!< DCYC[4:0]: Dummy Cycles */
  4486. #define QUADSPI_CCR_DCYC_0 ((uint32_t)0x00040000) /*!< Bit 0 */
  4487. #define QUADSPI_CCR_DCYC_1 ((uint32_t)0x00080000) /*!< Bit 1 */
  4488. #define QUADSPI_CCR_DCYC_2 ((uint32_t)0x00100000) /*!< Bit 2 */
  4489. #define QUADSPI_CCR_DCYC_3 ((uint32_t)0x00200000) /*!< Bit 3 */
  4490. #define QUADSPI_CCR_DCYC_4 ((uint32_t)0x00400000) /*!< Bit 4 */
  4491. #define QUADSPI_CCR_DMODE ((uint32_t)0x03000000) /*!< DMODE[1:0]: Data Mode */
  4492. #define QUADSPI_CCR_DMODE_0 ((uint32_t)0x01000000) /*!< Bit 0 */
  4493. #define QUADSPI_CCR_DMODE_1 ((uint32_t)0x02000000) /*!< Bit 1 */
  4494. #define QUADSPI_CCR_FMODE ((uint32_t)0x0C000000) /*!< FMODE[1:0]: Functional Mode */
  4495. #define QUADSPI_CCR_FMODE_0 ((uint32_t)0x04000000) /*!< Bit 0 */
  4496. #define QUADSPI_CCR_FMODE_1 ((uint32_t)0x08000000) /*!< Bit 1 */
  4497. #define QUADSPI_CCR_SIOO ((uint32_t)0x10000000) /*!< SIOO: Send Instruction Only Once Mode */
  4498. #define QUADSPI_CCR_DHHC ((uint32_t)0x40000000) /*!< DHHC: Delay Half Hclk Cycle */
  4499. #define QUADSPI_CCR_DDRM ((uint32_t)0x80000000) /*!< DDRM: Double Data Rate Mode */
  4500. /****************** Bit definition for QUADSPI_AR register *******************/
  4501. #define QUADSPI_AR_ADDRESS ((uint32_t)0xFFFFFFFF) /*!< ADDRESS[31:0]: Address */
  4502. /****************** Bit definition for QUADSPI_ABR register ******************/
  4503. #define QUADSPI_ABR_ALTERNATE ((uint32_t)0xFFFFFFFF) /*!< ALTERNATE[31:0]: Alternate Bytes */
  4504. /****************** Bit definition for QUADSPI_DR register *******************/
  4505. #define QUADSPI_DR_DATA ((uint32_t)0xFFFFFFFF) /*!< DATA[31:0]: Data */
  4506. /****************** Bit definition for QUADSPI_PSMKR register ****************/
  4507. #define QUADSPI_PSMKR_MASK ((uint32_t)0xFFFFFFFF) /*!< MASK[31:0]: Status Mask */
  4508. /****************** Bit definition for QUADSPI_PSMAR register ****************/
  4509. #define QUADSPI_PSMAR_MATCH ((uint32_t)0xFFFFFFFF) /*!< MATCH[31:0]: Status Match */
  4510. /****************** Bit definition for QUADSPI_PIR register *****************/
  4511. #define QUADSPI_PIR_INTERVAL ((uint32_t)0x0000FFFF) /*!< INTERVAL[15:0]: Polling Interval */
  4512. /****************** Bit definition for QUADSPI_LPTR register *****************/
  4513. #define QUADSPI_LPTR_TIMEOUT ((uint32_t)0x0000FFFF) /*!< TIMEOUT[15:0]: Timeout period */
  4514. /******************************************************************************/
  4515. /* */
  4516. /* Reset and Clock Control */
  4517. /* */
  4518. /******************************************************************************/
  4519. /******************** Bit definition for RCC_CR register ********************/
  4520. #define RCC_CR_HSION ((uint32_t)0x00000001)
  4521. #define RCC_CR_HSIRDY ((uint32_t)0x00000002)
  4522. #define RCC_CR_HSITRIM ((uint32_t)0x000000F8)
  4523. #define RCC_CR_HSITRIM_0 ((uint32_t)0x00000008)/*!<Bit 0 */
  4524. #define RCC_CR_HSITRIM_1 ((uint32_t)0x00000010)/*!<Bit 1 */
  4525. #define RCC_CR_HSITRIM_2 ((uint32_t)0x00000020)/*!<Bit 2 */
  4526. #define RCC_CR_HSITRIM_3 ((uint32_t)0x00000040)/*!<Bit 3 */
  4527. #define RCC_CR_HSITRIM_4 ((uint32_t)0x00000080)/*!<Bit 4 */
  4528. #define RCC_CR_HSICAL ((uint32_t)0x0000FF00)
  4529. #define RCC_CR_HSICAL_0 ((uint32_t)0x00000100)/*!<Bit 0 */
  4530. #define RCC_CR_HSICAL_1 ((uint32_t)0x00000200)/*!<Bit 1 */
  4531. #define RCC_CR_HSICAL_2 ((uint32_t)0x00000400)/*!<Bit 2 */
  4532. #define RCC_CR_HSICAL_3 ((uint32_t)0x00000800)/*!<Bit 3 */
  4533. #define RCC_CR_HSICAL_4 ((uint32_t)0x00001000)/*!<Bit 4 */
  4534. #define RCC_CR_HSICAL_5 ((uint32_t)0x00002000)/*!<Bit 5 */
  4535. #define RCC_CR_HSICAL_6 ((uint32_t)0x00004000)/*!<Bit 6 */
  4536. #define RCC_CR_HSICAL_7 ((uint32_t)0x00008000)/*!<Bit 7 */
  4537. #define RCC_CR_HSEON ((uint32_t)0x00010000)
  4538. #define RCC_CR_HSERDY ((uint32_t)0x00020000)
  4539. #define RCC_CR_HSEBYP ((uint32_t)0x00040000)
  4540. #define RCC_CR_CSSON ((uint32_t)0x00080000)
  4541. #define RCC_CR_PLLON ((uint32_t)0x01000000)
  4542. #define RCC_CR_PLLRDY ((uint32_t)0x02000000)
  4543. #define RCC_CR_PLLI2SON ((uint32_t)0x04000000)
  4544. #define RCC_CR_PLLI2SRDY ((uint32_t)0x08000000)
  4545. #define RCC_CR_PLLSAION ((uint32_t)0x10000000)
  4546. #define RCC_CR_PLLSAIRDY ((uint32_t)0x20000000)
  4547. /******************** Bit definition for RCC_PLLCFGR register ***************/
  4548. #define RCC_PLLCFGR_PLLM ((uint32_t)0x0000003F)
  4549. #define RCC_PLLCFGR_PLLM_0 ((uint32_t)0x00000001)
  4550. #define RCC_PLLCFGR_PLLM_1 ((uint32_t)0x00000002)
  4551. #define RCC_PLLCFGR_PLLM_2 ((uint32_t)0x00000004)
  4552. #define RCC_PLLCFGR_PLLM_3 ((uint32_t)0x00000008)
  4553. #define RCC_PLLCFGR_PLLM_4 ((uint32_t)0x00000010)
  4554. #define RCC_PLLCFGR_PLLM_5 ((uint32_t)0x00000020)
  4555. #define RCC_PLLCFGR_PLLN ((uint32_t)0x00007FC0)
  4556. #define RCC_PLLCFGR_PLLN_0 ((uint32_t)0x00000040)
  4557. #define RCC_PLLCFGR_PLLN_1 ((uint32_t)0x00000080)
  4558. #define RCC_PLLCFGR_PLLN_2 ((uint32_t)0x00000100)
  4559. #define RCC_PLLCFGR_PLLN_3 ((uint32_t)0x00000200)
  4560. #define RCC_PLLCFGR_PLLN_4 ((uint32_t)0x00000400)
  4561. #define RCC_PLLCFGR_PLLN_5 ((uint32_t)0x00000800)
  4562. #define RCC_PLLCFGR_PLLN_6 ((uint32_t)0x00001000)
  4563. #define RCC_PLLCFGR_PLLN_7 ((uint32_t)0x00002000)
  4564. #define RCC_PLLCFGR_PLLN_8 ((uint32_t)0x00004000)
  4565. #define RCC_PLLCFGR_PLLP ((uint32_t)0x00030000)
  4566. #define RCC_PLLCFGR_PLLP_0 ((uint32_t)0x00010000)
  4567. #define RCC_PLLCFGR_PLLP_1 ((uint32_t)0x00020000)
  4568. #define RCC_PLLCFGR_PLLSRC ((uint32_t)0x00400000)
  4569. #define RCC_PLLCFGR_PLLSRC_HSE ((uint32_t)0x00400000)
  4570. #define RCC_PLLCFGR_PLLSRC_HSI ((uint32_t)0x00000000)
  4571. #define RCC_PLLCFGR_PLLQ ((uint32_t)0x0F000000)
  4572. #define RCC_PLLCFGR_PLLQ_0 ((uint32_t)0x01000000)
  4573. #define RCC_PLLCFGR_PLLQ_1 ((uint32_t)0x02000000)
  4574. #define RCC_PLLCFGR_PLLQ_2 ((uint32_t)0x04000000)
  4575. #define RCC_PLLCFGR_PLLQ_3 ((uint32_t)0x08000000)
  4576. #define RCC_PLLCFGR_PLLR ((uint32_t)0x70000000)
  4577. #define RCC_PLLCFGR_PLLR_0 ((uint32_t)0x10000000)
  4578. #define RCC_PLLCFGR_PLLR_1 ((uint32_t)0x20000000)
  4579. #define RCC_PLLCFGR_PLLR_2 ((uint32_t)0x40000000)
  4580. /******************** Bit definition for RCC_CFGR register ******************/
  4581. /*!< SW configuration */
  4582. #define RCC_CFGR_SW ((uint32_t)0x00000003) /*!< SW[1:0] bits (System clock Switch) */
  4583. #define RCC_CFGR_SW_0 ((uint32_t)0x00000001) /*!< Bit 0 */
  4584. #define RCC_CFGR_SW_1 ((uint32_t)0x00000002) /*!< Bit 1 */
  4585. #define RCC_CFGR_SW_HSI ((uint32_t)0x00000000) /*!< HSI selected as system clock */
  4586. #define RCC_CFGR_SW_HSE ((uint32_t)0x00000001) /*!< HSE selected as system clock */
  4587. #define RCC_CFGR_SW_PLL ((uint32_t)0x00000002) /*!< PLL/PLLP selected as system clock */
  4588. #define RCC_CFGR_SW_PLLR ((uint32_t)0x00000003) /*!< PLL/PLLR selected as system clock */
  4589. /*!< SWS configuration */
  4590. #define RCC_CFGR_SWS ((uint32_t)0x0000000C) /*!< SWS[1:0] bits (System Clock Switch Status) */
  4591. #define RCC_CFGR_SWS_0 ((uint32_t)0x00000004) /*!< Bit 0 */
  4592. #define RCC_CFGR_SWS_1 ((uint32_t)0x00000008) /*!< Bit 1 */
  4593. #define RCC_CFGR_SWS_HSI ((uint32_t)0x00000000) /*!< HSI oscillator used as system clock */
  4594. #define RCC_CFGR_SWS_HSE ((uint32_t)0x00000004) /*!< HSE oscillator used as system clock */
  4595. #define RCC_CFGR_SWS_PLL ((uint32_t)0x00000008) /*!< PLL/PLLP used as system clock */
  4596. #define RCC_CFGR_SWS_PLLR ((uint32_t)0x0000000C) /*!< PLL/PLLR used as system clock */
  4597. /*!< HPRE configuration */
  4598. #define RCC_CFGR_HPRE ((uint32_t)0x000000F0) /*!< HPRE[3:0] bits (AHB prescaler) */
  4599. #define RCC_CFGR_HPRE_0 ((uint32_t)0x00000010) /*!< Bit 0 */
  4600. #define RCC_CFGR_HPRE_1 ((uint32_t)0x00000020) /*!< Bit 1 */
  4601. #define RCC_CFGR_HPRE_2 ((uint32_t)0x00000040) /*!< Bit 2 */
  4602. #define RCC_CFGR_HPRE_3 ((uint32_t)0x00000080) /*!< Bit 3 */
  4603. #define RCC_CFGR_HPRE_DIV1 ((uint32_t)0x00000000) /*!< SYSCLK not divided */
  4604. #define RCC_CFGR_HPRE_DIV2 ((uint32_t)0x00000080) /*!< SYSCLK divided by 2 */
  4605. #define RCC_CFGR_HPRE_DIV4 ((uint32_t)0x00000090) /*!< SYSCLK divided by 4 */
  4606. #define RCC_CFGR_HPRE_DIV8 ((uint32_t)0x000000A0) /*!< SYSCLK divided by 8 */
  4607. #define RCC_CFGR_HPRE_DIV16 ((uint32_t)0x000000B0) /*!< SYSCLK divided by 16 */
  4608. #define RCC_CFGR_HPRE_DIV64 ((uint32_t)0x000000C0) /*!< SYSCLK divided by 64 */
  4609. #define RCC_CFGR_HPRE_DIV128 ((uint32_t)0x000000D0) /*!< SYSCLK divided by 128 */
  4610. #define RCC_CFGR_HPRE_DIV256 ((uint32_t)0x000000E0) /*!< SYSCLK divided by 256 */
  4611. #define RCC_CFGR_HPRE_DIV512 ((uint32_t)0x000000F0) /*!< SYSCLK divided by 512 */
  4612. /*!< PPRE1 configuration */
  4613. #define RCC_CFGR_PPRE1 ((uint32_t)0x00001C00) /*!< PRE1[2:0] bits (APB1 prescaler) */
  4614. #define RCC_CFGR_PPRE1_0 ((uint32_t)0x00000400) /*!< Bit 0 */
  4615. #define RCC_CFGR_PPRE1_1 ((uint32_t)0x00000800) /*!< Bit 1 */
  4616. #define RCC_CFGR_PPRE1_2 ((uint32_t)0x00001000) /*!< Bit 2 */
  4617. #define RCC_CFGR_PPRE1_DIV1 ((uint32_t)0x00000000) /*!< HCLK not divided */
  4618. #define RCC_CFGR_PPRE1_DIV2 ((uint32_t)0x00001000) /*!< HCLK divided by 2 */
  4619. #define RCC_CFGR_PPRE1_DIV4 ((uint32_t)0x00001400) /*!< HCLK divided by 4 */
  4620. #define RCC_CFGR_PPRE1_DIV8 ((uint32_t)0x00001800) /*!< HCLK divided by 8 */
  4621. #define RCC_CFGR_PPRE1_DIV16 ((uint32_t)0x00001C00) /*!< HCLK divided by 16 */
  4622. /*!< PPRE2 configuration */
  4623. #define RCC_CFGR_PPRE2 ((uint32_t)0x0000E000) /*!< PRE2[2:0] bits (APB2 prescaler) */
  4624. #define RCC_CFGR_PPRE2_0 ((uint32_t)0x00002000) /*!< Bit 0 */
  4625. #define RCC_CFGR_PPRE2_1 ((uint32_t)0x00004000) /*!< Bit 1 */
  4626. #define RCC_CFGR_PPRE2_2 ((uint32_t)0x00008000) /*!< Bit 2 */
  4627. #define RCC_CFGR_PPRE2_DIV1 ((uint32_t)0x00000000) /*!< HCLK not divided */
  4628. #define RCC_CFGR_PPRE2_DIV2 ((uint32_t)0x00008000) /*!< HCLK divided by 2 */
  4629. #define RCC_CFGR_PPRE2_DIV4 ((uint32_t)0x0000A000) /*!< HCLK divided by 4 */
  4630. #define RCC_CFGR_PPRE2_DIV8 ((uint32_t)0x0000C000) /*!< HCLK divided by 8 */
  4631. #define RCC_CFGR_PPRE2_DIV16 ((uint32_t)0x0000E000) /*!< HCLK divided by 16 */
  4632. /*!< RTCPRE configuration */
  4633. #define RCC_CFGR_RTCPRE ((uint32_t)0x001F0000)
  4634. #define RCC_CFGR_RTCPRE_0 ((uint32_t)0x00010000)
  4635. #define RCC_CFGR_RTCPRE_1 ((uint32_t)0x00020000)
  4636. #define RCC_CFGR_RTCPRE_2 ((uint32_t)0x00040000)
  4637. #define RCC_CFGR_RTCPRE_3 ((uint32_t)0x00080000)
  4638. #define RCC_CFGR_RTCPRE_4 ((uint32_t)0x00100000)
  4639. /*!< MCO1 configuration */
  4640. #define RCC_CFGR_MCO1 ((uint32_t)0x00600000)
  4641. #define RCC_CFGR_MCO1_0 ((uint32_t)0x00200000)
  4642. #define RCC_CFGR_MCO1_1 ((uint32_t)0x00400000)
  4643. #define RCC_CFGR_I2SSRC ((uint32_t)0x00800000)
  4644. #define RCC_CFGR_MCO1PRE ((uint32_t)0x07000000)
  4645. #define RCC_CFGR_MCO1PRE_0 ((uint32_t)0x01000000)
  4646. #define RCC_CFGR_MCO1PRE_1 ((uint32_t)0x02000000)
  4647. #define RCC_CFGR_MCO1PRE_2 ((uint32_t)0x04000000)
  4648. #define RCC_CFGR_MCO2PRE ((uint32_t)0x38000000)
  4649. #define RCC_CFGR_MCO2PRE_0 ((uint32_t)0x08000000)
  4650. #define RCC_CFGR_MCO2PRE_1 ((uint32_t)0x10000000)
  4651. #define RCC_CFGR_MCO2PRE_2 ((uint32_t)0x20000000)
  4652. #define RCC_CFGR_MCO2 ((uint32_t)0xC0000000)
  4653. #define RCC_CFGR_MCO2_0 ((uint32_t)0x40000000)
  4654. #define RCC_CFGR_MCO2_1 ((uint32_t)0x80000000)
  4655. /******************** Bit definition for RCC_CIR register *******************/
  4656. #define RCC_CIR_LSIRDYF ((uint32_t)0x00000001)
  4657. #define RCC_CIR_LSERDYF ((uint32_t)0x00000002)
  4658. #define RCC_CIR_HSIRDYF ((uint32_t)0x00000004)
  4659. #define RCC_CIR_HSERDYF ((uint32_t)0x00000008)
  4660. #define RCC_CIR_PLLRDYF ((uint32_t)0x00000010)
  4661. #define RCC_CIR_PLLI2SRDYF ((uint32_t)0x00000020)
  4662. #define RCC_CIR_PLLSAIRDYF ((uint32_t)0x00000040)
  4663. #define RCC_CIR_CSSF ((uint32_t)0x00000080)
  4664. #define RCC_CIR_LSIRDYIE ((uint32_t)0x00000100)
  4665. #define RCC_CIR_LSERDYIE ((uint32_t)0x00000200)
  4666. #define RCC_CIR_HSIRDYIE ((uint32_t)0x00000400)
  4667. #define RCC_CIR_HSERDYIE ((uint32_t)0x00000800)
  4668. #define RCC_CIR_PLLRDYIE ((uint32_t)0x00001000)
  4669. #define RCC_CIR_PLLI2SRDYIE ((uint32_t)0x00002000)
  4670. #define RCC_CIR_PLLSAIRDYIE ((uint32_t)0x00004000)
  4671. #define RCC_CIR_LSIRDYC ((uint32_t)0x00010000)
  4672. #define RCC_CIR_LSERDYC ((uint32_t)0x00020000)
  4673. #define RCC_CIR_HSIRDYC ((uint32_t)0x00040000)
  4674. #define RCC_CIR_HSERDYC ((uint32_t)0x00080000)
  4675. #define RCC_CIR_PLLRDYC ((uint32_t)0x00100000)
  4676. #define RCC_CIR_PLLI2SRDYC ((uint32_t)0x00200000)
  4677. #define RCC_CIR_PLLSAIRDYC ((uint32_t)0x00400000)
  4678. #define RCC_CIR_CSSC ((uint32_t)0x00800000)
  4679. /******************** Bit definition for RCC_AHB1RSTR register **************/
  4680. #define RCC_AHB1RSTR_GPIOARST ((uint32_t)0x00000001)
  4681. #define RCC_AHB1RSTR_GPIOBRST ((uint32_t)0x00000002)
  4682. #define RCC_AHB1RSTR_GPIOCRST ((uint32_t)0x00000004)
  4683. #define RCC_AHB1RSTR_GPIODRST ((uint32_t)0x00000008)
  4684. #define RCC_AHB1RSTR_GPIOERST ((uint32_t)0x00000010)
  4685. #define RCC_AHB1RSTR_GPIOFRST ((uint32_t)0x00000020)
  4686. #define RCC_AHB1RSTR_GPIOGRST ((uint32_t)0x00000040)
  4687. #define RCC_AHB1RSTR_GPIOHRST ((uint32_t)0x00000080)
  4688. #define RCC_AHB1RSTR_CRCRST ((uint32_t)0x00001000)
  4689. #define RCC_AHB1RSTR_DMA1RST ((uint32_t)0x00200000)
  4690. #define RCC_AHB1RSTR_DMA2RST ((uint32_t)0x00400000)
  4691. #define RCC_AHB1RSTR_OTGHRST ((uint32_t)0x20000000)
  4692. /******************** Bit definition for RCC_AHB2RSTR register **************/
  4693. #define RCC_AHB2RSTR_DCMIRST ((uint32_t)0x00000001)
  4694. #define RCC_AHB2RSTR_OTGFSRST ((uint32_t)0x00000080)
  4695. /******************** Bit definition for RCC_AHB3RSTR register **************/
  4696. #define RCC_AHB3RSTR_FMCRST ((uint32_t)0x00000001)
  4697. #define RCC_AHB3RSTR_QSPIRST ((uint32_t)0x00000002)
  4698. /******************** Bit definition for RCC_APB1RSTR register **************/
  4699. #define RCC_APB1RSTR_TIM2RST ((uint32_t)0x00000001)
  4700. #define RCC_APB1RSTR_TIM3RST ((uint32_t)0x00000002)
  4701. #define RCC_APB1RSTR_TIM4RST ((uint32_t)0x00000004)
  4702. #define RCC_APB1RSTR_TIM5RST ((uint32_t)0x00000008)
  4703. #define RCC_APB1RSTR_TIM6RST ((uint32_t)0x00000010)
  4704. #define RCC_APB1RSTR_TIM7RST ((uint32_t)0x00000020)
  4705. #define RCC_APB1RSTR_TIM12RST ((uint32_t)0x00000040)
  4706. #define RCC_APB1RSTR_TIM13RST ((uint32_t)0x00000080)
  4707. #define RCC_APB1RSTR_TIM14RST ((uint32_t)0x00000100)
  4708. #define RCC_APB1RSTR_WWDGRST ((uint32_t)0x00000800)
  4709. #define RCC_APB1RSTR_SPI2RST ((uint32_t)0x00004000)
  4710. #define RCC_APB1RSTR_SPI3RST ((uint32_t)0x00008000)
  4711. #define RCC_APB1RSTR_SPDIFRXRST ((uint32_t)0x00010000)
  4712. #define RCC_APB1RSTR_USART2RST ((uint32_t)0x00020000)
  4713. #define RCC_APB1RSTR_USART3RST ((uint32_t)0x00040000)
  4714. #define RCC_APB1RSTR_UART4RST ((uint32_t)0x00080000)
  4715. #define RCC_APB1RSTR_UART5RST ((uint32_t)0x00100000)
  4716. #define RCC_APB1RSTR_I2C1RST ((uint32_t)0x00200000)
  4717. #define RCC_APB1RSTR_I2C2RST ((uint32_t)0x00400000)
  4718. #define RCC_APB1RSTR_I2C3RST ((uint32_t)0x00800000)
  4719. #define RCC_APB1RSTR_FMPI2C1RST ((uint32_t)0x01000000)
  4720. #define RCC_APB1RSTR_CAN1RST ((uint32_t)0x02000000)
  4721. #define RCC_APB1RSTR_CAN2RST ((uint32_t)0x04000000)
  4722. #define RCC_APB1RSTR_CECRST ((uint32_t)0x08000000)
  4723. #define RCC_APB1RSTR_PWRRST ((uint32_t)0x10000000)
  4724. #define RCC_APB1RSTR_DACRST ((uint32_t)0x20000000)
  4725. /******************** Bit definition for RCC_APB2RSTR register **************/
  4726. #define RCC_APB2RSTR_TIM1RST ((uint32_t)0x00000001)
  4727. #define RCC_APB2RSTR_TIM8RST ((uint32_t)0x00000002)
  4728. #define RCC_APB2RSTR_USART1RST ((uint32_t)0x00000010)
  4729. #define RCC_APB2RSTR_USART6RST ((uint32_t)0x00000020)
  4730. #define RCC_APB2RSTR_ADCRST ((uint32_t)0x00000100)
  4731. #define RCC_APB2RSTR_SDIORST ((uint32_t)0x00000800)
  4732. #define RCC_APB2RSTR_SPI1RST ((uint32_t)0x00001000)
  4733. #define RCC_APB2RSTR_SPI4RST ((uint32_t)0x00002000)
  4734. #define RCC_APB2RSTR_SYSCFGRST ((uint32_t)0x00004000)
  4735. #define RCC_APB2RSTR_TIM9RST ((uint32_t)0x00010000)
  4736. #define RCC_APB2RSTR_TIM10RST ((uint32_t)0x00020000)
  4737. #define RCC_APB2RSTR_TIM11RST ((uint32_t)0x00040000)
  4738. #define RCC_APB2RSTR_SAI1RST ((uint32_t)0x00400000)
  4739. #define RCC_APB2RSTR_SAI2RST ((uint32_t)0x00800000)
  4740. /* Old SPI1RST bit definition, maintained for legacy purpose */
  4741. #define RCC_APB2RSTR_SPI1 RCC_APB2RSTR_SPI1RST
  4742. /******************** Bit definition for RCC_AHB1ENR register ***************/
  4743. #define RCC_AHB1ENR_GPIOAEN ((uint32_t)0x00000001)
  4744. #define RCC_AHB1ENR_GPIOBEN ((uint32_t)0x00000002)
  4745. #define RCC_AHB1ENR_GPIOCEN ((uint32_t)0x00000004)
  4746. #define RCC_AHB1ENR_GPIODEN ((uint32_t)0x00000008)
  4747. #define RCC_AHB1ENR_GPIOEEN ((uint32_t)0x00000010)
  4748. #define RCC_AHB1ENR_GPIOFEN ((uint32_t)0x00000020)
  4749. #define RCC_AHB1ENR_GPIOGEN ((uint32_t)0x00000040)
  4750. #define RCC_AHB1ENR_GPIOHEN ((uint32_t)0x00000080)
  4751. #define RCC_AHB1ENR_CRCEN ((uint32_t)0x00001000)
  4752. #define RCC_AHB1ENR_BKPSRAMEN ((uint32_t)0x00040000)
  4753. #define RCC_AHB1ENR_DMA1EN ((uint32_t)0x00200000)
  4754. #define RCC_AHB1ENR_DMA2EN ((uint32_t)0x00400000)
  4755. #define RCC_AHB1ENR_OTGHSEN ((uint32_t)0x20000000)
  4756. #define RCC_AHB1ENR_OTGHSULPIEN ((uint32_t)0x40000000)
  4757. /******************** Bit definition for RCC_AHB2ENR register ***************/
  4758. #define RCC_AHB2ENR_DCMIEN ((uint32_t)0x00000001)
  4759. #define RCC_AHB2ENR_OTGFSEN ((uint32_t)0x00000080)
  4760. /******************** Bit definition for RCC_AHB3ENR register ***************/
  4761. #define RCC_AHB3ENR_FMCEN ((uint32_t)0x00000001)
  4762. #define RCC_AHB3ENR_QSPIEN ((uint32_t)0x00000002)
  4763. /******************** Bit definition for RCC_APB1ENR register ***************/
  4764. #define RCC_APB1ENR_TIM2EN ((uint32_t)0x00000001)
  4765. #define RCC_APB1ENR_TIM3EN ((uint32_t)0x00000002)
  4766. #define RCC_APB1ENR_TIM4EN ((uint32_t)0x00000004)
  4767. #define RCC_APB1ENR_TIM5EN ((uint32_t)0x00000008)
  4768. #define RCC_APB1ENR_TIM6EN ((uint32_t)0x00000010)
  4769. #define RCC_APB1ENR_TIM7EN ((uint32_t)0x00000020)
  4770. #define RCC_APB1ENR_TIM12EN ((uint32_t)0x00000040)
  4771. #define RCC_APB1ENR_TIM13EN ((uint32_t)0x00000080)
  4772. #define RCC_APB1ENR_TIM14EN ((uint32_t)0x00000100)
  4773. #define RCC_APB1ENR_WWDGEN ((uint32_t)0x00000800)
  4774. #define RCC_APB1ENR_SPI2EN ((uint32_t)0x00004000)
  4775. #define RCC_APB1ENR_SPI3EN ((uint32_t)0x00008000)
  4776. #define RCC_APB1ENR_SPDIFRXEN ((uint32_t)0x00010000)
  4777. #define RCC_APB1ENR_USART2EN ((uint32_t)0x00020000)
  4778. #define RCC_APB1ENR_USART3EN ((uint32_t)0x00040000)
  4779. #define RCC_APB1ENR_UART4EN ((uint32_t)0x00080000)
  4780. #define RCC_APB1ENR_UART5EN ((uint32_t)0x00100000)
  4781. #define RCC_APB1ENR_I2C1EN ((uint32_t)0x00200000)
  4782. #define RCC_APB1ENR_I2C2EN ((uint32_t)0x00400000)
  4783. #define RCC_APB1ENR_I2C3EN ((uint32_t)0x00800000)
  4784. #define RCC_APB1ENR_FMPI2C1EN ((uint32_t)0x01000000)
  4785. #define RCC_APB1ENR_CAN1EN ((uint32_t)0x02000000)
  4786. #define RCC_APB1ENR_CAN2EN ((uint32_t)0x04000000)
  4787. #define RCC_APB1ENR_CECEN ((uint32_t)0x08000000)
  4788. #define RCC_APB1ENR_PWREN ((uint32_t)0x10000000)
  4789. #define RCC_APB1ENR_DACEN ((uint32_t)0x20000000)
  4790. /******************** Bit definition for RCC_APB2ENR register ***************/
  4791. #define RCC_APB2ENR_TIM1EN ((uint32_t)0x00000001)
  4792. #define RCC_APB2ENR_TIM8EN ((uint32_t)0x00000002)
  4793. #define RCC_APB2ENR_USART1EN ((uint32_t)0x00000010)
  4794. #define RCC_APB2ENR_USART6EN ((uint32_t)0x00000020)
  4795. #define RCC_APB2ENR_ADC1EN ((uint32_t)0x00000100)
  4796. #define RCC_APB2ENR_ADC2EN ((uint32_t)0x00000200)
  4797. #define RCC_APB2ENR_ADC3EN ((uint32_t)0x00000400)
  4798. #define RCC_APB2ENR_SDIOEN ((uint32_t)0x00000800)
  4799. #define RCC_APB2ENR_SPI1EN ((uint32_t)0x00001000)
  4800. #define RCC_APB2ENR_SPI4EN ((uint32_t)0x00002000)
  4801. #define RCC_APB2ENR_SYSCFGEN ((uint32_t)0x00004000)
  4802. #define RCC_APB2ENR_TIM9EN ((uint32_t)0x00010000)
  4803. #define RCC_APB2ENR_TIM10EN ((uint32_t)0x00020000)
  4804. #define RCC_APB2ENR_TIM11EN ((uint32_t)0x00040000)
  4805. #define RCC_APB2ENR_SAI1EN ((uint32_t)0x00400000)
  4806. #define RCC_APB2ENR_SAI2EN ((uint32_t)0x00800000)
  4807. /******************** Bit definition for RCC_AHB1LPENR register *************/
  4808. #define RCC_AHB1LPENR_GPIOALPEN ((uint32_t)0x00000001)
  4809. #define RCC_AHB1LPENR_GPIOBLPEN ((uint32_t)0x00000002)
  4810. #define RCC_AHB1LPENR_GPIOCLPEN ((uint32_t)0x00000004)
  4811. #define RCC_AHB1LPENR_GPIODLPEN ((uint32_t)0x00000008)
  4812. #define RCC_AHB1LPENR_GPIOELPEN ((uint32_t)0x00000010)
  4813. #define RCC_AHB1LPENR_GPIOFLPEN ((uint32_t)0x00000020)
  4814. #define RCC_AHB1LPENR_GPIOGLPEN ((uint32_t)0x00000040)
  4815. #define RCC_AHB1LPENR_GPIOHLPEN ((uint32_t)0x00000080)
  4816. #define RCC_AHB1LPENR_GPIOILPEN ((uint32_t)0x00000100)
  4817. #define RCC_AHB1LPENR_GPIOJLPEN ((uint32_t)0x00000200)
  4818. #define RCC_AHB1LPENR_GPIOKLPEN ((uint32_t)0x00000400)
  4819. #define RCC_AHB1LPENR_CRCLPEN ((uint32_t)0x00001000)
  4820. #define RCC_AHB1LPENR_FLITFLPEN ((uint32_t)0x00008000)
  4821. #define RCC_AHB1LPENR_SRAM1LPEN ((uint32_t)0x00010000)
  4822. #define RCC_AHB1LPENR_SRAM2LPEN ((uint32_t)0x00020000)
  4823. #define RCC_AHB1LPENR_BKPSRAMLPEN ((uint32_t)0x00040000)
  4824. #define RCC_AHB1LPENR_DMA1LPEN ((uint32_t)0x00200000)
  4825. #define RCC_AHB1LPENR_DMA2LPEN ((uint32_t)0x00400000)
  4826. #define RCC_AHB1LPENR_OTGHSLPEN ((uint32_t)0x20000000)
  4827. #define RCC_AHB1LPENR_OTGHSULPILPEN ((uint32_t)0x40000000)
  4828. /******************** Bit definition for RCC_AHB2LPENR register *************/
  4829. #define RCC_AHB2LPENR_DCMILPEN ((uint32_t)0x00000001)
  4830. #define RCC_AHB2LPENR_OTGFSLPEN ((uint32_t)0x00000080)
  4831. /******************** Bit definition for RCC_AHB3LPENR register *************/
  4832. #define RCC_AHB3LPENR_FMCLPEN ((uint32_t)0x00000001)
  4833. #define RCC_AHB3LPENR_QSPILPEN ((uint32_t)0x00000002)
  4834. /******************** Bit definition for RCC_APB1LPENR register *************/
  4835. #define RCC_APB1LPENR_TIM2LPEN ((uint32_t)0x00000001)
  4836. #define RCC_APB1LPENR_TIM3LPEN ((uint32_t)0x00000002)
  4837. #define RCC_APB1LPENR_TIM4LPEN ((uint32_t)0x00000004)
  4838. #define RCC_APB1LPENR_TIM5LPEN ((uint32_t)0x00000008)
  4839. #define RCC_APB1LPENR_TIM6LPEN ((uint32_t)0x00000010)
  4840. #define RCC_APB1LPENR_TIM7LPEN ((uint32_t)0x00000020)
  4841. #define RCC_APB1LPENR_TIM12LPEN ((uint32_t)0x00000040)
  4842. #define RCC_APB1LPENR_TIM13LPEN ((uint32_t)0x00000080)
  4843. #define RCC_APB1LPENR_TIM14LPEN ((uint32_t)0x00000100)
  4844. #define RCC_APB1LPENR_WWDGLPEN ((uint32_t)0x00000800)
  4845. #define RCC_APB1LPENR_SPI2LPEN ((uint32_t)0x00004000)
  4846. #define RCC_APB1LPENR_SPI3LPEN ((uint32_t)0x00008000)
  4847. #define RCC_APB1LPENR_SPDIFRXLPEN ((uint32_t)0x00010000)
  4848. #define RCC_APB1LPENR_USART2LPEN ((uint32_t)0x00020000)
  4849. #define RCC_APB1LPENR_USART3LPEN ((uint32_t)0x00040000)
  4850. #define RCC_APB1LPENR_UART4LPEN ((uint32_t)0x00080000)
  4851. #define RCC_APB1LPENR_UART5LPEN ((uint32_t)0x00100000)
  4852. #define RCC_APB1LPENR_I2C1LPEN ((uint32_t)0x00200000)
  4853. #define RCC_APB1LPENR_I2C2LPEN ((uint32_t)0x00400000)
  4854. #define RCC_APB1LPENR_I2C3LPEN ((uint32_t)0x00800000)
  4855. #define RCC_APB1LPENR_FMPI2C1LPEN ((uint32_t)0x01000000)
  4856. #define RCC_APB1LPENR_CAN1LPEN ((uint32_t)0x02000000)
  4857. #define RCC_APB1LPENR_CAN2LPEN ((uint32_t)0x04000000)
  4858. #define RCC_APB1LPENR_CECLPEN ((uint32_t)0x08000000)
  4859. #define RCC_APB1LPENR_PWRLPEN ((uint32_t)0x10000000)
  4860. #define RCC_APB1LPENR_DACLPEN ((uint32_t)0x20000000)
  4861. /******************** Bit definition for RCC_APB2LPENR register *************/
  4862. #define RCC_APB2LPENR_TIM1LPEN ((uint32_t)0x00000001)
  4863. #define RCC_APB2LPENR_TIM8LPEN ((uint32_t)0x00000002)
  4864. #define RCC_APB2LPENR_USART1LPEN ((uint32_t)0x00000010)
  4865. #define RCC_APB2LPENR_USART6LPEN ((uint32_t)0x00000020)
  4866. #define RCC_APB2LPENR_ADC1LPEN ((uint32_t)0x00000100)
  4867. #define RCC_APB2LPENR_ADC2LPEN ((uint32_t)0x00000200)
  4868. #define RCC_APB2LPENR_ADC3LPEN ((uint32_t)0x00000400)
  4869. #define RCC_APB2LPENR_SDIOLPEN ((uint32_t)0x00000800)
  4870. #define RCC_APB2LPENR_SPI1LPEN ((uint32_t)0x00001000)
  4871. #define RCC_APB2LPENR_SPI4LPEN ((uint32_t)0x00002000)
  4872. #define RCC_APB2LPENR_SYSCFGLPEN ((uint32_t)0x00004000)
  4873. #define RCC_APB2LPENR_TIM9LPEN ((uint32_t)0x00010000)
  4874. #define RCC_APB2LPENR_TIM10LPEN ((uint32_t)0x00020000)
  4875. #define RCC_APB2LPENR_TIM11LPEN ((uint32_t)0x00040000)
  4876. #define RCC_APB2LPENR_SAI1LPEN ((uint32_t)0x00400000)
  4877. #define RCC_APB2LPENR_SAI2LPEN ((uint32_t)0x00800000)
  4878. /******************** Bit definition for RCC_BDCR register ******************/
  4879. #define RCC_BDCR_LSEON ((uint32_t)0x00000001)
  4880. #define RCC_BDCR_LSERDY ((uint32_t)0x00000002)
  4881. #define RCC_BDCR_LSEBYP ((uint32_t)0x00000004)
  4882. #define RCC_BDCR_LSEMOD ((uint32_t)0x00000008)
  4883. #define RCC_BDCR_RTCSEL ((uint32_t)0x00000300)
  4884. #define RCC_BDCR_RTCSEL_0 ((uint32_t)0x00000100)
  4885. #define RCC_BDCR_RTCSEL_1 ((uint32_t)0x00000200)
  4886. #define RCC_BDCR_RTCEN ((uint32_t)0x00008000)
  4887. #define RCC_BDCR_BDRST ((uint32_t)0x00010000)
  4888. /******************** Bit definition for RCC_CSR register *******************/
  4889. #define RCC_CSR_LSION ((uint32_t)0x00000001)
  4890. #define RCC_CSR_LSIRDY ((uint32_t)0x00000002)
  4891. #define RCC_CSR_RMVF ((uint32_t)0x01000000)
  4892. #define RCC_CSR_BORRSTF ((uint32_t)0x02000000)
  4893. #define RCC_CSR_PADRSTF ((uint32_t)0x04000000)
  4894. #define RCC_CSR_PORRSTF ((uint32_t)0x08000000)
  4895. #define RCC_CSR_SFTRSTF ((uint32_t)0x10000000)
  4896. #define RCC_CSR_WDGRSTF ((uint32_t)0x20000000)
  4897. #define RCC_CSR_WWDGRSTF ((uint32_t)0x40000000)
  4898. #define RCC_CSR_LPWRRSTF ((uint32_t)0x80000000)
  4899. /******************** Bit definition for RCC_SSCGR register *****************/
  4900. #define RCC_SSCGR_MODPER ((uint32_t)0x00001FFF)
  4901. #define RCC_SSCGR_INCSTEP ((uint32_t)0x0FFFE000)
  4902. #define RCC_SSCGR_SPREADSEL ((uint32_t)0x40000000)
  4903. #define RCC_SSCGR_SSCGEN ((uint32_t)0x80000000)
  4904. /******************** Bit definition for RCC_PLLI2SCFGR register ************/
  4905. #define RCC_PLLI2SCFGR_PLLI2SM ((uint32_t)0x0000003F)
  4906. #define RCC_PLLI2SCFGR_PLLI2SM_0 ((uint32_t)0x00000001)
  4907. #define RCC_PLLI2SCFGR_PLLI2SM_1 ((uint32_t)0x00000002)
  4908. #define RCC_PLLI2SCFGR_PLLI2SM_2 ((uint32_t)0x00000004)
  4909. #define RCC_PLLI2SCFGR_PLLI2SM_3 ((uint32_t)0x00000008)
  4910. #define RCC_PLLI2SCFGR_PLLI2SM_4 ((uint32_t)0x00000010)
  4911. #define RCC_PLLI2SCFGR_PLLI2SM_5 ((uint32_t)0x00000020)
  4912. #define RCC_PLLI2SCFGR_PLLI2SN ((uint32_t)0x00007FC0)
  4913. #define RCC_PLLI2SCFGR_PLLI2SN_0 ((uint32_t)0x00000040)
  4914. #define RCC_PLLI2SCFGR_PLLI2SN_1 ((uint32_t)0x00000080)
  4915. #define RCC_PLLI2SCFGR_PLLI2SN_2 ((uint32_t)0x00000100)
  4916. #define RCC_PLLI2SCFGR_PLLI2SN_3 ((uint32_t)0x00000200)
  4917. #define RCC_PLLI2SCFGR_PLLI2SN_4 ((uint32_t)0x00000400)
  4918. #define RCC_PLLI2SCFGR_PLLI2SN_5 ((uint32_t)0x00000800)
  4919. #define RCC_PLLI2SCFGR_PLLI2SN_6 ((uint32_t)0x00001000)
  4920. #define RCC_PLLI2SCFGR_PLLI2SN_7 ((uint32_t)0x00002000)
  4921. #define RCC_PLLI2SCFGR_PLLI2SN_8 ((uint32_t)0x00004000)
  4922. #define RCC_PLLI2SCFGR_PLLI2SP ((uint32_t)0x00030000)
  4923. #define RCC_PLLI2SCFGR_PLLI2SP_0 ((uint32_t)0x00010000)
  4924. #define RCC_PLLI2SCFGR_PLLI2SP_1 ((uint32_t)0x00020000)
  4925. #define RCC_PLLI2SCFGR_PLLI2SQ ((uint32_t)0x0F000000)
  4926. #define RCC_PLLI2SCFGR_PLLI2SQ_0 ((uint32_t)0x01000000)
  4927. #define RCC_PLLI2SCFGR_PLLI2SQ_1 ((uint32_t)0x02000000)
  4928. #define RCC_PLLI2SCFGR_PLLI2SQ_2 ((uint32_t)0x04000000)
  4929. #define RCC_PLLI2SCFGR_PLLI2SQ_3 ((uint32_t)0x08000000)
  4930. #define RCC_PLLI2SCFGR_PLLI2SR ((uint32_t)0x70000000)
  4931. #define RCC_PLLI2SCFGR_PLLI2SR_0 ((uint32_t)0x10000000)
  4932. #define RCC_PLLI2SCFGR_PLLI2SR_1 ((uint32_t)0x20000000)
  4933. #define RCC_PLLI2SCFGR_PLLI2SR_2 ((uint32_t)0x40000000)
  4934. /******************** Bit definition for RCC_PLLSAICFGR register ************/
  4935. #define RCC_PLLSAICFGR_PLLSAIM ((uint32_t)0x0000003F)
  4936. #define RCC_PLLSAICFGR_PLLSAIM_0 ((uint32_t)0x00000001)
  4937. #define RCC_PLLSAICFGR_PLLSAIM_1 ((uint32_t)0x00000002)
  4938. #define RCC_PLLSAICFGR_PLLSAIM_2 ((uint32_t)0x00000004)
  4939. #define RCC_PLLSAICFGR_PLLSAIM_3 ((uint32_t)0x00000008)
  4940. #define RCC_PLLSAICFGR_PLLSAIM_4 ((uint32_t)0x00000010)
  4941. #define RCC_PLLSAICFGR_PLLSAIM_5 ((uint32_t)0x00000020)
  4942. #define RCC_PLLSAICFGR_PLLSAIN ((uint32_t)0x00007FC0)
  4943. #define RCC_PLLSAICFGR_PLLSAIN_0 ((uint32_t)0x00000040)
  4944. #define RCC_PLLSAICFGR_PLLSAIN_1 ((uint32_t)0x00000080)
  4945. #define RCC_PLLSAICFGR_PLLSAIN_2 ((uint32_t)0x00000100)
  4946. #define RCC_PLLSAICFGR_PLLSAIN_3 ((uint32_t)0x00000200)
  4947. #define RCC_PLLSAICFGR_PLLSAIN_4 ((uint32_t)0x00000400)
  4948. #define RCC_PLLSAICFGR_PLLSAIN_5 ((uint32_t)0x00000800)
  4949. #define RCC_PLLSAICFGR_PLLSAIN_6 ((uint32_t)0x00001000)
  4950. #define RCC_PLLSAICFGR_PLLSAIN_7 ((uint32_t)0x00002000)
  4951. #define RCC_PLLSAICFGR_PLLSAIN_8 ((uint32_t)0x00004000)
  4952. #define RCC_PLLSAICFGR_PLLSAIP ((uint32_t)0x00030000)
  4953. #define RCC_PLLSAICFGR_PLLSAIP_0 ((uint32_t)0x00010000)
  4954. #define RCC_PLLSAICFGR_PLLSAIP_1 ((uint32_t)0x00020000)
  4955. #define RCC_PLLSAICFGR_PLLSAIQ ((uint32_t)0x0F000000)
  4956. #define RCC_PLLSAICFGR_PLLSAIQ_0 ((uint32_t)0x01000000)
  4957. #define RCC_PLLSAICFGR_PLLSAIQ_1 ((uint32_t)0x02000000)
  4958. #define RCC_PLLSAICFGR_PLLSAIQ_2 ((uint32_t)0x04000000)
  4959. #define RCC_PLLSAICFGR_PLLSAIQ_3 ((uint32_t)0x08000000)
  4960. /******************** Bit definition for RCC_DCKCFGR register ***************/
  4961. #define RCC_DCKCFGR_PLLI2SDIVQ ((uint32_t)0x0000001F)
  4962. #define RCC_DCKCFGR_PLLSAIDIVQ ((uint32_t)0x00001F00)
  4963. #define RCC_DCKCFGR_SAI1SRC ((uint32_t)0x00300000)
  4964. #define RCC_DCKCFGR_SAI1SRC_0 ((uint32_t)0x00100000)
  4965. #define RCC_DCKCFGR_SAI1SRC_1 ((uint32_t)0x00200000)
  4966. #define RCC_DCKCFGR_SAI2SRC ((uint32_t)0x00C00000)
  4967. #define RCC_DCKCFGR_SAI2SRC_0 ((uint32_t)0x00400000)
  4968. #define RCC_DCKCFGR_SAI2SRC_1 ((uint32_t)0x00800000)
  4969. #define RCC_DCKCFGR_TIMPRE ((uint32_t)0x01000000)
  4970. #define RCC_DCKCFGR_I2S1SRC ((uint32_t)0x06000000)
  4971. #define RCC_DCKCFGR_I2S1SRC_0 ((uint32_t)0x02000000)
  4972. #define RCC_DCKCFGR_I2S1SRC_1 ((uint32_t)0x04000000)
  4973. #define RCC_DCKCFGR_I2S2SRC ((uint32_t)0x18000000)
  4974. #define RCC_DCKCFGR_I2S2SRC_0 ((uint32_t)0x08000000)
  4975. #define RCC_DCKCFGR_I2S2SRC_1 ((uint32_t)0x10000000)
  4976. /******************** Bit definition for RCC_CKGATENR register ***************/
  4977. #define RCC_CKGATENR_AHB2APB1_CKEN ((uint32_t)0x00000001)
  4978. #define RCC_CKGATENR_AHB2APB2_CKEN ((uint32_t)0x00000002)
  4979. #define RCC_CKGATENR_CM4DBG_CKEN ((uint32_t)0x00000004)
  4980. #define RCC_CKGATENR_SPARE_CKEN ((uint32_t)0x00000008)
  4981. #define RCC_CKGATENR_SRAM_CKEN ((uint32_t)0x00000010)
  4982. #define RCC_CKGATENR_FLITF_CKEN ((uint32_t)0x00000020)
  4983. #define RCC_CKGATENR_RCC_CKEN ((uint32_t)0x00000040)
  4984. /******************** Bit definition for RCC_DCKCFGR2 register ***************/
  4985. #define RCC_DCKCFGR2_FMPI2C1SEL ((uint32_t)0x00C00000)
  4986. #define RCC_DCKCFGR2_FMPI2C1SEL_0 ((uint32_t)0x00400000)
  4987. #define RCC_DCKCFGR2_FMPI2C1SEL_1 ((uint32_t)0x00800000)
  4988. #define RCC_DCKCFGR2_CECSEL ((uint32_t)0x04000000)
  4989. #define RCC_DCKCFGR2_CK48MSEL ((uint32_t)0x08000000)
  4990. #define RCC_DCKCFGR2_SDIOSEL ((uint32_t)0x10000000)
  4991. #define RCC_DCKCFGR2_SPDIFRXSEL ((uint32_t)0x20000000)
  4992. /******************************************************************************/
  4993. /* */
  4994. /* Real-Time Clock (RTC) */
  4995. /* */
  4996. /******************************************************************************/
  4997. /******************** Bits definition for RTC_TR register *******************/
  4998. #define RTC_TR_PM ((uint32_t)0x00400000)
  4999. #define RTC_TR_HT ((uint32_t)0x00300000)
  5000. #define RTC_TR_HT_0 ((uint32_t)0x00100000)
  5001. #define RTC_TR_HT_1 ((uint32_t)0x00200000)
  5002. #define RTC_TR_HU ((uint32_t)0x000F0000)
  5003. #define RTC_TR_HU_0 ((uint32_t)0x00010000)
  5004. #define RTC_TR_HU_1 ((uint32_t)0x00020000)
  5005. #define RTC_TR_HU_2 ((uint32_t)0x00040000)
  5006. #define RTC_TR_HU_3 ((uint32_t)0x00080000)
  5007. #define RTC_TR_MNT ((uint32_t)0x00007000)
  5008. #define RTC_TR_MNT_0 ((uint32_t)0x00001000)
  5009. #define RTC_TR_MNT_1 ((uint32_t)0x00002000)
  5010. #define RTC_TR_MNT_2 ((uint32_t)0x00004000)
  5011. #define RTC_TR_MNU ((uint32_t)0x00000F00)
  5012. #define RTC_TR_MNU_0 ((uint32_t)0x00000100)
  5013. #define RTC_TR_MNU_1 ((uint32_t)0x00000200)
  5014. #define RTC_TR_MNU_2 ((uint32_t)0x00000400)
  5015. #define RTC_TR_MNU_3 ((uint32_t)0x00000800)
  5016. #define RTC_TR_ST ((uint32_t)0x00000070)
  5017. #define RTC_TR_ST_0 ((uint32_t)0x00000010)
  5018. #define RTC_TR_ST_1 ((uint32_t)0x00000020)
  5019. #define RTC_TR_ST_2 ((uint32_t)0x00000040)
  5020. #define RTC_TR_SU ((uint32_t)0x0000000F)
  5021. #define RTC_TR_SU_0 ((uint32_t)0x00000001)
  5022. #define RTC_TR_SU_1 ((uint32_t)0x00000002)
  5023. #define RTC_TR_SU_2 ((uint32_t)0x00000004)
  5024. #define RTC_TR_SU_3 ((uint32_t)0x00000008)
  5025. /******************** Bits definition for RTC_DR register *******************/
  5026. #define RTC_DR_YT ((uint32_t)0x00F00000)
  5027. #define RTC_DR_YT_0 ((uint32_t)0x00100000)
  5028. #define RTC_DR_YT_1 ((uint32_t)0x00200000)
  5029. #define RTC_DR_YT_2 ((uint32_t)0x00400000)
  5030. #define RTC_DR_YT_3 ((uint32_t)0x00800000)
  5031. #define RTC_DR_YU ((uint32_t)0x000F0000)
  5032. #define RTC_DR_YU_0 ((uint32_t)0x00010000)
  5033. #define RTC_DR_YU_1 ((uint32_t)0x00020000)
  5034. #define RTC_DR_YU_2 ((uint32_t)0x00040000)
  5035. #define RTC_DR_YU_3 ((uint32_t)0x00080000)
  5036. #define RTC_DR_WDU ((uint32_t)0x0000E000)
  5037. #define RTC_DR_WDU_0 ((uint32_t)0x00002000)
  5038. #define RTC_DR_WDU_1 ((uint32_t)0x00004000)
  5039. #define RTC_DR_WDU_2 ((uint32_t)0x00008000)
  5040. #define RTC_DR_MT ((uint32_t)0x00001000)
  5041. #define RTC_DR_MU ((uint32_t)0x00000F00)
  5042. #define RTC_DR_MU_0 ((uint32_t)0x00000100)
  5043. #define RTC_DR_MU_1 ((uint32_t)0x00000200)
  5044. #define RTC_DR_MU_2 ((uint32_t)0x00000400)
  5045. #define RTC_DR_MU_3 ((uint32_t)0x00000800)
  5046. #define RTC_DR_DT ((uint32_t)0x00000030)
  5047. #define RTC_DR_DT_0 ((uint32_t)0x00000010)
  5048. #define RTC_DR_DT_1 ((uint32_t)0x00000020)
  5049. #define RTC_DR_DU ((uint32_t)0x0000000F)
  5050. #define RTC_DR_DU_0 ((uint32_t)0x00000001)
  5051. #define RTC_DR_DU_1 ((uint32_t)0x00000002)
  5052. #define RTC_DR_DU_2 ((uint32_t)0x00000004)
  5053. #define RTC_DR_DU_3 ((uint32_t)0x00000008)
  5054. /******************** Bits definition for RTC_CR register *******************/
  5055. #define RTC_CR_COE ((uint32_t)0x00800000)
  5056. #define RTC_CR_OSEL ((uint32_t)0x00600000)
  5057. #define RTC_CR_OSEL_0 ((uint32_t)0x00200000)
  5058. #define RTC_CR_OSEL_1 ((uint32_t)0x00400000)
  5059. #define RTC_CR_POL ((uint32_t)0x00100000)
  5060. #define RTC_CR_COSEL ((uint32_t)0x00080000)
  5061. #define RTC_CR_BCK ((uint32_t)0x00040000)
  5062. #define RTC_CR_SUB1H ((uint32_t)0x00020000)
  5063. #define RTC_CR_ADD1H ((uint32_t)0x00010000)
  5064. #define RTC_CR_TSIE ((uint32_t)0x00008000)
  5065. #define RTC_CR_WUTIE ((uint32_t)0x00004000)
  5066. #define RTC_CR_ALRBIE ((uint32_t)0x00002000)
  5067. #define RTC_CR_ALRAIE ((uint32_t)0x00001000)
  5068. #define RTC_CR_TSE ((uint32_t)0x00000800)
  5069. #define RTC_CR_WUTE ((uint32_t)0x00000400)
  5070. #define RTC_CR_ALRBE ((uint32_t)0x00000200)
  5071. #define RTC_CR_ALRAE ((uint32_t)0x00000100)
  5072. #define RTC_CR_DCE ((uint32_t)0x00000080)
  5073. #define RTC_CR_FMT ((uint32_t)0x00000040)
  5074. #define RTC_CR_BYPSHAD ((uint32_t)0x00000020)
  5075. #define RTC_CR_REFCKON ((uint32_t)0x00000010)
  5076. #define RTC_CR_TSEDGE ((uint32_t)0x00000008)
  5077. #define RTC_CR_WUCKSEL ((uint32_t)0x00000007)
  5078. #define RTC_CR_WUCKSEL_0 ((uint32_t)0x00000001)
  5079. #define RTC_CR_WUCKSEL_1 ((uint32_t)0x00000002)
  5080. #define RTC_CR_WUCKSEL_2 ((uint32_t)0x00000004)
  5081. /******************** Bits definition for RTC_ISR register ******************/
  5082. #define RTC_ISR_RECALPF ((uint32_t)0x00010000)
  5083. #define RTC_ISR_TAMP1F ((uint32_t)0x00002000)
  5084. #define RTC_ISR_TAMP2F ((uint32_t)0x00004000)
  5085. #define RTC_ISR_TSOVF ((uint32_t)0x00001000)
  5086. #define RTC_ISR_TSF ((uint32_t)0x00000800)
  5087. #define RTC_ISR_WUTF ((uint32_t)0x00000400)
  5088. #define RTC_ISR_ALRBF ((uint32_t)0x00000200)
  5089. #define RTC_ISR_ALRAF ((uint32_t)0x00000100)
  5090. #define RTC_ISR_INIT ((uint32_t)0x00000080)
  5091. #define RTC_ISR_INITF ((uint32_t)0x00000040)
  5092. #define RTC_ISR_RSF ((uint32_t)0x00000020)
  5093. #define RTC_ISR_INITS ((uint32_t)0x00000010)
  5094. #define RTC_ISR_SHPF ((uint32_t)0x00000008)
  5095. #define RTC_ISR_WUTWF ((uint32_t)0x00000004)
  5096. #define RTC_ISR_ALRBWF ((uint32_t)0x00000002)
  5097. #define RTC_ISR_ALRAWF ((uint32_t)0x00000001)
  5098. /******************** Bits definition for RTC_PRER register *****************/
  5099. #define RTC_PRER_PREDIV_A ((uint32_t)0x007F0000)
  5100. #define RTC_PRER_PREDIV_S ((uint32_t)0x00007FFF)
  5101. /******************** Bits definition for RTC_WUTR register *****************/
  5102. #define RTC_WUTR_WUT ((uint32_t)0x0000FFFF)
  5103. /******************** Bits definition for RTC_CALIBR register ***************/
  5104. #define RTC_CALIBR_DCS ((uint32_t)0x00000080)
  5105. #define RTC_CALIBR_DC ((uint32_t)0x0000001F)
  5106. /******************** Bits definition for RTC_ALRMAR register ***************/
  5107. #define RTC_ALRMAR_MSK4 ((uint32_t)0x80000000)
  5108. #define RTC_ALRMAR_WDSEL ((uint32_t)0x40000000)
  5109. #define RTC_ALRMAR_DT ((uint32_t)0x30000000)
  5110. #define RTC_ALRMAR_DT_0 ((uint32_t)0x10000000)
  5111. #define RTC_ALRMAR_DT_1 ((uint32_t)0x20000000)
  5112. #define RTC_ALRMAR_DU ((uint32_t)0x0F000000)
  5113. #define RTC_ALRMAR_DU_0 ((uint32_t)0x01000000)
  5114. #define RTC_ALRMAR_DU_1 ((uint32_t)0x02000000)
  5115. #define RTC_ALRMAR_DU_2 ((uint32_t)0x04000000)
  5116. #define RTC_ALRMAR_DU_3 ((uint32_t)0x08000000)
  5117. #define RTC_ALRMAR_MSK3 ((uint32_t)0x00800000)
  5118. #define RTC_ALRMAR_PM ((uint32_t)0x00400000)
  5119. #define RTC_ALRMAR_HT ((uint32_t)0x00300000)
  5120. #define RTC_ALRMAR_HT_0 ((uint32_t)0x00100000)
  5121. #define RTC_ALRMAR_HT_1 ((uint32_t)0x00200000)
  5122. #define RTC_ALRMAR_HU ((uint32_t)0x000F0000)
  5123. #define RTC_ALRMAR_HU_0 ((uint32_t)0x00010000)
  5124. #define RTC_ALRMAR_HU_1 ((uint32_t)0x00020000)
  5125. #define RTC_ALRMAR_HU_2 ((uint32_t)0x00040000)
  5126. #define RTC_ALRMAR_HU_3 ((uint32_t)0x00080000)
  5127. #define RTC_ALRMAR_MSK2 ((uint32_t)0x00008000)
  5128. #define RTC_ALRMAR_MNT ((uint32_t)0x00007000)
  5129. #define RTC_ALRMAR_MNT_0 ((uint32_t)0x00001000)
  5130. #define RTC_ALRMAR_MNT_1 ((uint32_t)0x00002000)
  5131. #define RTC_ALRMAR_MNT_2 ((uint32_t)0x00004000)
  5132. #define RTC_ALRMAR_MNU ((uint32_t)0x00000F00)
  5133. #define RTC_ALRMAR_MNU_0 ((uint32_t)0x00000100)
  5134. #define RTC_ALRMAR_MNU_1 ((uint32_t)0x00000200)
  5135. #define RTC_ALRMAR_MNU_2 ((uint32_t)0x00000400)
  5136. #define RTC_ALRMAR_MNU_3 ((uint32_t)0x00000800)
  5137. #define RTC_ALRMAR_MSK1 ((uint32_t)0x00000080)
  5138. #define RTC_ALRMAR_ST ((uint32_t)0x00000070)
  5139. #define RTC_ALRMAR_ST_0 ((uint32_t)0x00000010)
  5140. #define RTC_ALRMAR_ST_1 ((uint32_t)0x00000020)
  5141. #define RTC_ALRMAR_ST_2 ((uint32_t)0x00000040)
  5142. #define RTC_ALRMAR_SU ((uint32_t)0x0000000F)
  5143. #define RTC_ALRMAR_SU_0 ((uint32_t)0x00000001)
  5144. #define RTC_ALRMAR_SU_1 ((uint32_t)0x00000002)
  5145. #define RTC_ALRMAR_SU_2 ((uint32_t)0x00000004)
  5146. #define RTC_ALRMAR_SU_3 ((uint32_t)0x00000008)
  5147. /******************** Bits definition for RTC_ALRMBR register ***************/
  5148. #define RTC_ALRMBR_MSK4 ((uint32_t)0x80000000)
  5149. #define RTC_ALRMBR_WDSEL ((uint32_t)0x40000000)
  5150. #define RTC_ALRMBR_DT ((uint32_t)0x30000000)
  5151. #define RTC_ALRMBR_DT_0 ((uint32_t)0x10000000)
  5152. #define RTC_ALRMBR_DT_1 ((uint32_t)0x20000000)
  5153. #define RTC_ALRMBR_DU ((uint32_t)0x0F000000)
  5154. #define RTC_ALRMBR_DU_0 ((uint32_t)0x01000000)
  5155. #define RTC_ALRMBR_DU_1 ((uint32_t)0x02000000)
  5156. #define RTC_ALRMBR_DU_2 ((uint32_t)0x04000000)
  5157. #define RTC_ALRMBR_DU_3 ((uint32_t)0x08000000)
  5158. #define RTC_ALRMBR_MSK3 ((uint32_t)0x00800000)
  5159. #define RTC_ALRMBR_PM ((uint32_t)0x00400000)
  5160. #define RTC_ALRMBR_HT ((uint32_t)0x00300000)
  5161. #define RTC_ALRMBR_HT_0 ((uint32_t)0x00100000)
  5162. #define RTC_ALRMBR_HT_1 ((uint32_t)0x00200000)
  5163. #define RTC_ALRMBR_HU ((uint32_t)0x000F0000)
  5164. #define RTC_ALRMBR_HU_0 ((uint32_t)0x00010000)
  5165. #define RTC_ALRMBR_HU_1 ((uint32_t)0x00020000)
  5166. #define RTC_ALRMBR_HU_2 ((uint32_t)0x00040000)
  5167. #define RTC_ALRMBR_HU_3 ((uint32_t)0x00080000)
  5168. #define RTC_ALRMBR_MSK2 ((uint32_t)0x00008000)
  5169. #define RTC_ALRMBR_MNT ((uint32_t)0x00007000)
  5170. #define RTC_ALRMBR_MNT_0 ((uint32_t)0x00001000)
  5171. #define RTC_ALRMBR_MNT_1 ((uint32_t)0x00002000)
  5172. #define RTC_ALRMBR_MNT_2 ((uint32_t)0x00004000)
  5173. #define RTC_ALRMBR_MNU ((uint32_t)0x00000F00)
  5174. #define RTC_ALRMBR_MNU_0 ((uint32_t)0x00000100)
  5175. #define RTC_ALRMBR_MNU_1 ((uint32_t)0x00000200)
  5176. #define RTC_ALRMBR_MNU_2 ((uint32_t)0x00000400)
  5177. #define RTC_ALRMBR_MNU_3 ((uint32_t)0x00000800)
  5178. #define RTC_ALRMBR_MSK1 ((uint32_t)0x00000080)
  5179. #define RTC_ALRMBR_ST ((uint32_t)0x00000070)
  5180. #define RTC_ALRMBR_ST_0 ((uint32_t)0x00000010)
  5181. #define RTC_ALRMBR_ST_1 ((uint32_t)0x00000020)
  5182. #define RTC_ALRMBR_ST_2 ((uint32_t)0x00000040)
  5183. #define RTC_ALRMBR_SU ((uint32_t)0x0000000F)
  5184. #define RTC_ALRMBR_SU_0 ((uint32_t)0x00000001)
  5185. #define RTC_ALRMBR_SU_1 ((uint32_t)0x00000002)
  5186. #define RTC_ALRMBR_SU_2 ((uint32_t)0x00000004)
  5187. #define RTC_ALRMBR_SU_3 ((uint32_t)0x00000008)
  5188. /******************** Bits definition for RTC_WPR register ******************/
  5189. #define RTC_WPR_KEY ((uint32_t)0x000000FF)
  5190. /******************** Bits definition for RTC_SSR register ******************/
  5191. #define RTC_SSR_SS ((uint32_t)0x0000FFFF)
  5192. /******************** Bits definition for RTC_SHIFTR register ***************/
  5193. #define RTC_SHIFTR_SUBFS ((uint32_t)0x00007FFF)
  5194. #define RTC_SHIFTR_ADD1S ((uint32_t)0x80000000)
  5195. /******************** Bits definition for RTC_TSTR register *****************/
  5196. #define RTC_TSTR_PM ((uint32_t)0x00400000)
  5197. #define RTC_TSTR_HT ((uint32_t)0x00300000)
  5198. #define RTC_TSTR_HT_0 ((uint32_t)0x00100000)
  5199. #define RTC_TSTR_HT_1 ((uint32_t)0x00200000)
  5200. #define RTC_TSTR_HU ((uint32_t)0x000F0000)
  5201. #define RTC_TSTR_HU_0 ((uint32_t)0x00010000)
  5202. #define RTC_TSTR_HU_1 ((uint32_t)0x00020000)
  5203. #define RTC_TSTR_HU_2 ((uint32_t)0x00040000)
  5204. #define RTC_TSTR_HU_3 ((uint32_t)0x00080000)
  5205. #define RTC_TSTR_MNT ((uint32_t)0x00007000)
  5206. #define RTC_TSTR_MNT_0 ((uint32_t)0x00001000)
  5207. #define RTC_TSTR_MNT_1 ((uint32_t)0x00002000)
  5208. #define RTC_TSTR_MNT_2 ((uint32_t)0x00004000)
  5209. #define RTC_TSTR_MNU ((uint32_t)0x00000F00)
  5210. #define RTC_TSTR_MNU_0 ((uint32_t)0x00000100)
  5211. #define RTC_TSTR_MNU_1 ((uint32_t)0x00000200)
  5212. #define RTC_TSTR_MNU_2 ((uint32_t)0x00000400)
  5213. #define RTC_TSTR_MNU_3 ((uint32_t)0x00000800)
  5214. #define RTC_TSTR_ST ((uint32_t)0x00000070)
  5215. #define RTC_TSTR_ST_0 ((uint32_t)0x00000010)
  5216. #define RTC_TSTR_ST_1 ((uint32_t)0x00000020)
  5217. #define RTC_TSTR_ST_2 ((uint32_t)0x00000040)
  5218. #define RTC_TSTR_SU ((uint32_t)0x0000000F)
  5219. #define RTC_TSTR_SU_0 ((uint32_t)0x00000001)
  5220. #define RTC_TSTR_SU_1 ((uint32_t)0x00000002)
  5221. #define RTC_TSTR_SU_2 ((uint32_t)0x00000004)
  5222. #define RTC_TSTR_SU_3 ((uint32_t)0x00000008)
  5223. /******************** Bits definition for RTC_TSDR register *****************/
  5224. #define RTC_TSDR_WDU ((uint32_t)0x0000E000)
  5225. #define RTC_TSDR_WDU_0 ((uint32_t)0x00002000)
  5226. #define RTC_TSDR_WDU_1 ((uint32_t)0x00004000)
  5227. #define RTC_TSDR_WDU_2 ((uint32_t)0x00008000)
  5228. #define RTC_TSDR_MT ((uint32_t)0x00001000)
  5229. #define RTC_TSDR_MU ((uint32_t)0x00000F00)
  5230. #define RTC_TSDR_MU_0 ((uint32_t)0x00000100)
  5231. #define RTC_TSDR_MU_1 ((uint32_t)0x00000200)
  5232. #define RTC_TSDR_MU_2 ((uint32_t)0x00000400)
  5233. #define RTC_TSDR_MU_3 ((uint32_t)0x00000800)
  5234. #define RTC_TSDR_DT ((uint32_t)0x00000030)
  5235. #define RTC_TSDR_DT_0 ((uint32_t)0x00000010)
  5236. #define RTC_TSDR_DT_1 ((uint32_t)0x00000020)
  5237. #define RTC_TSDR_DU ((uint32_t)0x0000000F)
  5238. #define RTC_TSDR_DU_0 ((uint32_t)0x00000001)
  5239. #define RTC_TSDR_DU_1 ((uint32_t)0x00000002)
  5240. #define RTC_TSDR_DU_2 ((uint32_t)0x00000004)
  5241. #define RTC_TSDR_DU_3 ((uint32_t)0x00000008)
  5242. /******************** Bits definition for RTC_TSSSR register ****************/
  5243. #define RTC_TSSSR_SS ((uint32_t)0x0000FFFF)
  5244. /******************** Bits definition for RTC_CAL register *****************/
  5245. #define RTC_CALR_CALP ((uint32_t)0x00008000)
  5246. #define RTC_CALR_CALW8 ((uint32_t)0x00004000)
  5247. #define RTC_CALR_CALW16 ((uint32_t)0x00002000)
  5248. #define RTC_CALR_CALM ((uint32_t)0x000001FF)
  5249. #define RTC_CALR_CALM_0 ((uint32_t)0x00000001)
  5250. #define RTC_CALR_CALM_1 ((uint32_t)0x00000002)
  5251. #define RTC_CALR_CALM_2 ((uint32_t)0x00000004)
  5252. #define RTC_CALR_CALM_3 ((uint32_t)0x00000008)
  5253. #define RTC_CALR_CALM_4 ((uint32_t)0x00000010)
  5254. #define RTC_CALR_CALM_5 ((uint32_t)0x00000020)
  5255. #define RTC_CALR_CALM_6 ((uint32_t)0x00000040)
  5256. #define RTC_CALR_CALM_7 ((uint32_t)0x00000080)
  5257. #define RTC_CALR_CALM_8 ((uint32_t)0x00000100)
  5258. /******************** Bits definition for RTC_TAFCR register ****************/
  5259. #define RTC_TAFCR_ALARMOUTTYPE ((uint32_t)0x00040000)
  5260. #define RTC_TAFCR_TSINSEL ((uint32_t)0x00020000)
  5261. #define RTC_TAFCR_TAMPINSEL ((uint32_t)0x00010000)
  5262. #define RTC_TAFCR_TAMPPUDIS ((uint32_t)0x00008000)
  5263. #define RTC_TAFCR_TAMPPRCH ((uint32_t)0x00006000)
  5264. #define RTC_TAFCR_TAMPPRCH_0 ((uint32_t)0x00002000)
  5265. #define RTC_TAFCR_TAMPPRCH_1 ((uint32_t)0x00004000)
  5266. #define RTC_TAFCR_TAMPFLT ((uint32_t)0x00001800)
  5267. #define RTC_TAFCR_TAMPFLT_0 ((uint32_t)0x00000800)
  5268. #define RTC_TAFCR_TAMPFLT_1 ((uint32_t)0x00001000)
  5269. #define RTC_TAFCR_TAMPFREQ ((uint32_t)0x00000700)
  5270. #define RTC_TAFCR_TAMPFREQ_0 ((uint32_t)0x00000100)
  5271. #define RTC_TAFCR_TAMPFREQ_1 ((uint32_t)0x00000200)
  5272. #define RTC_TAFCR_TAMPFREQ_2 ((uint32_t)0x00000400)
  5273. #define RTC_TAFCR_TAMPTS ((uint32_t)0x00000080)
  5274. #define RTC_TAFCR_TAMP2TRG ((uint32_t)0x00000010)
  5275. #define RTC_TAFCR_TAMP2E ((uint32_t)0x00000008)
  5276. #define RTC_TAFCR_TAMPIE ((uint32_t)0x00000004)
  5277. #define RTC_TAFCR_TAMP1TRG ((uint32_t)0x00000002)
  5278. #define RTC_TAFCR_TAMP1E ((uint32_t)0x00000001)
  5279. /******************** Bits definition for RTC_ALRMASSR register *************/
  5280. #define RTC_ALRMASSR_MASKSS ((uint32_t)0x0F000000)
  5281. #define RTC_ALRMASSR_MASKSS_0 ((uint32_t)0x01000000)
  5282. #define RTC_ALRMASSR_MASKSS_1 ((uint32_t)0x02000000)
  5283. #define RTC_ALRMASSR_MASKSS_2 ((uint32_t)0x04000000)
  5284. #define RTC_ALRMASSR_MASKSS_3 ((uint32_t)0x08000000)
  5285. #define RTC_ALRMASSR_SS ((uint32_t)0x00007FFF)
  5286. /******************** Bits definition for RTC_ALRMBSSR register *************/
  5287. #define RTC_ALRMBSSR_MASKSS ((uint32_t)0x0F000000)
  5288. #define RTC_ALRMBSSR_MASKSS_0 ((uint32_t)0x01000000)
  5289. #define RTC_ALRMBSSR_MASKSS_1 ((uint32_t)0x02000000)
  5290. #define RTC_ALRMBSSR_MASKSS_2 ((uint32_t)0x04000000)
  5291. #define RTC_ALRMBSSR_MASKSS_3 ((uint32_t)0x08000000)
  5292. #define RTC_ALRMBSSR_SS ((uint32_t)0x00007FFF)
  5293. /******************** Bits definition for RTC_BKP0R register ****************/
  5294. #define RTC_BKP0R ((uint32_t)0xFFFFFFFF)
  5295. /******************** Bits definition for RTC_BKP1R register ****************/
  5296. #define RTC_BKP1R ((uint32_t)0xFFFFFFFF)
  5297. /******************** Bits definition for RTC_BKP2R register ****************/
  5298. #define RTC_BKP2R ((uint32_t)0xFFFFFFFF)
  5299. /******************** Bits definition for RTC_BKP3R register ****************/
  5300. #define RTC_BKP3R ((uint32_t)0xFFFFFFFF)
  5301. /******************** Bits definition for RTC_BKP4R register ****************/
  5302. #define RTC_BKP4R ((uint32_t)0xFFFFFFFF)
  5303. /******************** Bits definition for RTC_BKP5R register ****************/
  5304. #define RTC_BKP5R ((uint32_t)0xFFFFFFFF)
  5305. /******************** Bits definition for RTC_BKP6R register ****************/
  5306. #define RTC_BKP6R ((uint32_t)0xFFFFFFFF)
  5307. /******************** Bits definition for RTC_BKP7R register ****************/
  5308. #define RTC_BKP7R ((uint32_t)0xFFFFFFFF)
  5309. /******************** Bits definition for RTC_BKP8R register ****************/
  5310. #define RTC_BKP8R ((uint32_t)0xFFFFFFFF)
  5311. /******************** Bits definition for RTC_BKP9R register ****************/
  5312. #define RTC_BKP9R ((uint32_t)0xFFFFFFFF)
  5313. /******************** Bits definition for RTC_BKP10R register ***************/
  5314. #define RTC_BKP10R ((uint32_t)0xFFFFFFFF)
  5315. /******************** Bits definition for RTC_BKP11R register ***************/
  5316. #define RTC_BKP11R ((uint32_t)0xFFFFFFFF)
  5317. /******************** Bits definition for RTC_BKP12R register ***************/
  5318. #define RTC_BKP12R ((uint32_t)0xFFFFFFFF)
  5319. /******************** Bits definition for RTC_BKP13R register ***************/
  5320. #define RTC_BKP13R ((uint32_t)0xFFFFFFFF)
  5321. /******************** Bits definition for RTC_BKP14R register ***************/
  5322. #define RTC_BKP14R ((uint32_t)0xFFFFFFFF)
  5323. /******************** Bits definition for RTC_BKP15R register ***************/
  5324. #define RTC_BKP15R ((uint32_t)0xFFFFFFFF)
  5325. /******************** Bits definition for RTC_BKP16R register ***************/
  5326. #define RTC_BKP16R ((uint32_t)0xFFFFFFFF)
  5327. /******************** Bits definition for RTC_BKP17R register ***************/
  5328. #define RTC_BKP17R ((uint32_t)0xFFFFFFFF)
  5329. /******************** Bits definition for RTC_BKP18R register ***************/
  5330. #define RTC_BKP18R ((uint32_t)0xFFFFFFFF)
  5331. /******************** Bits definition for RTC_BKP19R register ***************/
  5332. #define RTC_BKP19R ((uint32_t)0xFFFFFFFF)
  5333. /******************************************************************************/
  5334. /* */
  5335. /* Serial Audio Interface */
  5336. /* */
  5337. /******************************************************************************/
  5338. /******************** Bit definition for SAI_GCR register *******************/
  5339. #define SAI_GCR_SYNCIN ((uint32_t)0x00000003) /*!<SYNCIN[1:0] bits (Synchronization Inputs) */
  5340. #define SAI_GCR_SYNCIN_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  5341. #define SAI_GCR_SYNCIN_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  5342. #define SAI_GCR_SYNCOUT ((uint32_t)0x00000030) /*!<SYNCOUT[1:0] bits (Synchronization Outputs) */
  5343. #define SAI_GCR_SYNCOUT_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  5344. #define SAI_GCR_SYNCOUT_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  5345. /******************* Bit definition for SAI_xCR1 register *******************/
  5346. #define SAI_xCR1_MODE ((uint32_t)0x00000003) /*!<MODE[1:0] bits (Audio Block Mode) */
  5347. #define SAI_xCR1_MODE_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  5348. #define SAI_xCR1_MODE_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  5349. #define SAI_xCR1_PRTCFG ((uint32_t)0x0000000C) /*!<PRTCFG[1:0] bits (Protocol Configuration) */
  5350. #define SAI_xCR1_PRTCFG_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  5351. #define SAI_xCR1_PRTCFG_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  5352. #define SAI_xCR1_DS ((uint32_t)0x000000E0) /*!<DS[1:0] bits (Data Size) */
  5353. #define SAI_xCR1_DS_0 ((uint32_t)0x00000020) /*!<Bit 0 */
  5354. #define SAI_xCR1_DS_1 ((uint32_t)0x00000040) /*!<Bit 1 */
  5355. #define SAI_xCR1_DS_2 ((uint32_t)0x00000080) /*!<Bit 2 */
  5356. #define SAI_xCR1_LSBFIRST ((uint32_t)0x00000100) /*!<LSB First Configuration */
  5357. #define SAI_xCR1_CKSTR ((uint32_t)0x00000200) /*!<ClocK STRobing edge */
  5358. #define SAI_xCR1_SYNCEN ((uint32_t)0x00000C00) /*!<SYNCEN[1:0](SYNChronization ENable) */
  5359. #define SAI_xCR1_SYNCEN_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  5360. #define SAI_xCR1_SYNCEN_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  5361. #define SAI_xCR1_MONO ((uint32_t)0x00001000) /*!<Mono mode */
  5362. #define SAI_xCR1_OUTDRIV ((uint32_t)0x00002000) /*!<Output Drive */
  5363. #define SAI_xCR1_SAIEN ((uint32_t)0x00010000) /*!<Audio Block enable */
  5364. #define SAI_xCR1_DMAEN ((uint32_t)0x00020000) /*!<DMA enable */
  5365. #define SAI_xCR1_NODIV ((uint32_t)0x00080000) /*!<No Divider Configuration */
  5366. #define SAI_xCR1_MCKDIV ((uint32_t)0x00F00000) /*!<MCKDIV[3:0] (Master ClocK Divider) */
  5367. #define SAI_xCR1_MCKDIV_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  5368. #define SAI_xCR1_MCKDIV_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  5369. #define SAI_xCR1_MCKDIV_2 ((uint32_t)0x00400000) /*!<Bit 2 */
  5370. #define SAI_xCR1_MCKDIV_3 ((uint32_t)0x00800000) /*!<Bit 3 */
  5371. /******************* Bit definition for SAI_xCR2 register *******************/
  5372. #define SAI_xCR2_FTH ((uint32_t)0x00000007) /*!<FTH[2:0](Fifo THreshold) */
  5373. #define SAI_xCR2_FTH_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  5374. #define SAI_xCR2_FTH_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  5375. #define SAI_xCR2_FTH_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  5376. #define SAI_xCR2_FFLUSH ((uint32_t)0x00000008) /*!<Fifo FLUSH */
  5377. #define SAI_xCR2_TRIS ((uint32_t)0x00000010) /*!<TRIState Management on data line */
  5378. #define SAI_xCR2_MUTE ((uint32_t)0x00000020) /*!<Mute mode */
  5379. #define SAI_xCR2_MUTEVAL ((uint32_t)0x00000040) /*!<Muate value */
  5380. #define SAI_xCR2_MUTECNT ((uint32_t)0x00001F80) /*!<MUTECNT[5:0] (MUTE counter) */
  5381. #define SAI_xCR2_MUTECNT_0 ((uint32_t)0x00000080) /*!<Bit 0 */
  5382. #define SAI_xCR2_MUTECNT_1 ((uint32_t)0x00000100) /*!<Bit 1 */
  5383. #define SAI_xCR2_MUTECNT_2 ((uint32_t)0x00000200) /*!<Bit 2 */
  5384. #define SAI_xCR2_MUTECNT_3 ((uint32_t)0x00000400) /*!<Bit 3 */
  5385. #define SAI_xCR2_MUTECNT_4 ((uint32_t)0x00000800) /*!<Bit 4 */
  5386. #define SAI_xCR2_MUTECNT_5 ((uint32_t)0x00001000) /*!<Bit 5 */
  5387. #define SAI_xCR2_CPL ((uint32_t)0x00080000) /*!< Complement Bit */
  5388. #define SAI_xCR2_COMP ((uint32_t)0x0000C000) /*!<COMP[1:0] (Companding mode) */
  5389. #define SAI_xCR2_COMP_0 ((uint32_t)0x00004000) /*!<Bit 0 */
  5390. #define SAI_xCR2_COMP_1 ((uint32_t)0x00008000) /*!<Bit 1 */
  5391. /****************** Bit definition for SAI_xFRCR register *******************/
  5392. #define SAI_xFRCR_FRL ((uint32_t)0x000000FF) /*!<FRL[1:0](Frame length) */
  5393. #define SAI_xFRCR_FRL_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  5394. #define SAI_xFRCR_FRL_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  5395. #define SAI_xFRCR_FRL_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  5396. #define SAI_xFRCR_FRL_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  5397. #define SAI_xFRCR_FRL_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  5398. #define SAI_xFRCR_FRL_5 ((uint32_t)0x00000020) /*!<Bit 5 */
  5399. #define SAI_xFRCR_FRL_6 ((uint32_t)0x00000040) /*!<Bit 6 */
  5400. #define SAI_xFRCR_FRL_7 ((uint32_t)0x00000080) /*!<Bit 7 */
  5401. #define SAI_xFRCR_FSALL ((uint32_t)0x00007F00) /*!<FRL[1:0] (Frame synchronization active level length) */
  5402. #define SAI_xFRCR_FSALL_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  5403. #define SAI_xFRCR_FSALL_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  5404. #define SAI_xFRCR_FSALL_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  5405. #define SAI_xFRCR_FSALL_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  5406. #define SAI_xFRCR_FSALL_4 ((uint32_t)0x00001000) /*!<Bit 4 */
  5407. #define SAI_xFRCR_FSALL_5 ((uint32_t)0x00002000) /*!<Bit 5 */
  5408. #define SAI_xFRCR_FSALL_6 ((uint32_t)0x00004000) /*!<Bit 6 */
  5409. #define SAI_xFRCR_FSDEF ((uint32_t)0x00010000) /*!< Frame Synchronization Definition */
  5410. #define SAI_xFRCR_FSPO ((uint32_t)0x00020000) /*!<Frame Synchronization POLarity */
  5411. #define SAI_xFRCR_FSOFF ((uint32_t)0x00040000) /*!<Frame Synchronization OFFset */
  5412. /****************** Bit definition for SAI_xSLOTR register *******************/
  5413. #define SAI_xSLOTR_FBOFF ((uint32_t)0x0000001F) /*!<FRL[4:0](First Bit Offset) */
  5414. #define SAI_xSLOTR_FBOFF_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  5415. #define SAI_xSLOTR_FBOFF_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  5416. #define SAI_xSLOTR_FBOFF_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  5417. #define SAI_xSLOTR_FBOFF_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  5418. #define SAI_xSLOTR_FBOFF_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  5419. #define SAI_xSLOTR_SLOTSZ ((uint32_t)0x000000C0) /*!<SLOTSZ[1:0] (Slot size) */
  5420. #define SAI_xSLOTR_SLOTSZ_0 ((uint32_t)0x00000040) /*!<Bit 0 */
  5421. #define SAI_xSLOTR_SLOTSZ_1 ((uint32_t)0x00000080) /*!<Bit 1 */
  5422. #define SAI_xSLOTR_NBSLOT ((uint32_t)0x00000F00) /*!<NBSLOT[3:0] (Number of Slot in audio Frame) */
  5423. #define SAI_xSLOTR_NBSLOT_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  5424. #define SAI_xSLOTR_NBSLOT_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  5425. #define SAI_xSLOTR_NBSLOT_2 ((uint32_t)0x00000400) /*!<Bit 2 */
  5426. #define SAI_xSLOTR_NBSLOT_3 ((uint32_t)0x00000800) /*!<Bit 3 */
  5427. #define SAI_xSLOTR_SLOTEN ((uint32_t)0xFFFF0000) /*!<SLOTEN[15:0] (Slot Enable) */
  5428. /******************* Bit definition for SAI_xIMR register *******************/
  5429. #define SAI_xIMR_OVRUDRIE ((uint32_t)0x00000001) /*!<Overrun underrun interrupt enable */
  5430. #define SAI_xIMR_MUTEDETIE ((uint32_t)0x00000002) /*!<Mute detection interrupt enable */
  5431. #define SAI_xIMR_WCKCFGIE ((uint32_t)0x00000004) /*!<Wrong Clock Configuration interrupt enable */
  5432. #define SAI_xIMR_FREQIE ((uint32_t)0x00000008) /*!<FIFO request interrupt enable */
  5433. #define SAI_xIMR_CNRDYIE ((uint32_t)0x00000010) /*!<Codec not ready interrupt enable */
  5434. #define SAI_xIMR_AFSDETIE ((uint32_t)0x00000020) /*!<Anticipated frame synchronization detection interrupt enable */
  5435. #define SAI_xIMR_LFSDETIE ((uint32_t)0x00000040) /*!<Late frame synchronization detection interrupt enable */
  5436. /******************** Bit definition for SAI_xSR register *******************/
  5437. #define SAI_xSR_OVRUDR ((uint32_t)0x00000001) /*!<Overrun underrun */
  5438. #define SAI_xSR_MUTEDET ((uint32_t)0x00000002) /*!<Mute detection */
  5439. #define SAI_xSR_WCKCFG ((uint32_t)0x00000004) /*!<Wrong Clock Configuration */
  5440. #define SAI_xSR_FREQ ((uint32_t)0x00000008) /*!<FIFO request */
  5441. #define SAI_xSR_CNRDY ((uint32_t)0x00000010) /*!<Codec not ready */
  5442. #define SAI_xSR_AFSDET ((uint32_t)0x00000020) /*!<Anticipated frame synchronization detection */
  5443. #define SAI_xSR_LFSDET ((uint32_t)0x00000040) /*!<Late frame synchronization detection */
  5444. #define SAI_xSR_FLVL ((uint32_t)0x00070000) /*!<FLVL[2:0] (FIFO Level Threshold) */
  5445. #define SAI_xSR_FLVL_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  5446. #define SAI_xSR_FLVL_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  5447. #define SAI_xSR_FLVL_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  5448. /****************** Bit definition for SAI_xCLRFR register ******************/
  5449. #define SAI_xCLRFR_COVRUDR ((uint32_t)0x00000001) /*!<Clear Overrun underrun */
  5450. #define SAI_xCLRFR_CMUTEDET ((uint32_t)0x00000002) /*!<Clear Mute detection */
  5451. #define SAI_xCLRFR_CWCKCFG ((uint32_t)0x00000004) /*!<Clear Wrong Clock Configuration */
  5452. #define SAI_xCLRFR_CFREQ ((uint32_t)0x00000008) /*!<Clear FIFO request */
  5453. #define SAI_xCLRFR_CCNRDY ((uint32_t)0x00000010) /*!<Clear Codec not ready */
  5454. #define SAI_xCLRFR_CAFSDET ((uint32_t)0x00000020) /*!<Clear Anticipated frame synchronization detection */
  5455. #define SAI_xCLRFR_CLFSDET ((uint32_t)0x00000040) /*!<Clear Late frame synchronization detection */
  5456. /****************** Bit definition for SAI_xDR register ******************/
  5457. #define SAI_xDR_DATA ((uint32_t)0xFFFFFFFF)
  5458. /******************************************************************************/
  5459. /* */
  5460. /* SPDIF-RX Interface */
  5461. /* */
  5462. /******************************************************************************/
  5463. /******************** Bit definition for SPDIFRX_CR register *******************/
  5464. #define SPDIFRX_CR_SPDIFEN ((uint32_t)0x00000003) /*!<Peripheral Block Enable */
  5465. #define SPDIFRX_CR_RXDMAEN ((uint32_t)0x00000004) /*!<Receiver DMA Enable for data flow */
  5466. #define SPDIFRX_CR_RXSTEO ((uint32_t)0x00000008) /*!<Stereo Mode */
  5467. #define SPDIFRX_CR_DRFMT ((uint32_t)0x00000030) /*!<RX Data format */
  5468. #define SPDIFRX_CR_PMSK ((uint32_t)0x00000040) /*!<Mask Parity error bit */
  5469. #define SPDIFRX_CR_VMSK ((uint32_t)0x00000080) /*!<Mask of Validity bit */
  5470. #define SPDIFRX_CR_CUMSK ((uint32_t)0x00000100) /*!<Mask of channel status and user bits */
  5471. #define SPDIFRX_CR_PTMSK ((uint32_t)0x00000200) /*!<Mask of Preamble Type bits */
  5472. #define SPDIFRX_CR_CBDMAEN ((uint32_t)0x00000400) /*!<Control Buffer DMA ENable for control flow */
  5473. #define SPDIFRX_CR_CHSEL ((uint32_t)0x00000800) /*!<Channel Selection */
  5474. #define SPDIFRX_CR_NBTR ((uint32_t)0x00003000) /*!<Maximum allowed re-tries during synchronization phase */
  5475. #define SPDIFRX_CR_WFA ((uint32_t)0x00004000) /*!<Wait For Activity */
  5476. #define SPDIFRX_CR_INSEL ((uint32_t)0x00070000) /*!<SPDIFRX input selection */
  5477. /******************* Bit definition for SPDIFRX_IMR register *******************/
  5478. #define SPDIFRX_IMR_RXNEIE ((uint32_t)0x00000001) /*!<RXNE interrupt enable */
  5479. #define SPDIFRX_IMR_CSRNEIE ((uint32_t)0x00000002) /*!<Control Buffer Ready Interrupt Enable */
  5480. #define SPDIFRX_IMR_PERRIE ((uint32_t)0x00000004) /*!<Parity error interrupt enable */
  5481. #define SPDIFRX_IMR_OVRIE ((uint32_t)0x00000008) /*!<Overrun error Interrupt Enable */
  5482. #define SPDIFRX_IMR_SBLKIE ((uint32_t)0x00000010) /*!<Synchronization Block Detected Interrupt Enable */
  5483. #define SPDIFRX_IMR_SYNCDIE ((uint32_t)0x00000020) /*!<Synchronization Done */
  5484. #define SPDIFRX_IMR_IFEIE ((uint32_t)0x00000040) /*!<Serial Interface Error Interrupt Enable */
  5485. /******************* Bit definition for SPDIFRX_SR register *******************/
  5486. #define SPDIFRX_SR_RXNE ((uint32_t)0x00000001) /*!<Read data register not empty */
  5487. #define SPDIFRX_SR_CSRNE ((uint32_t)0x00000002) /*!<The Control Buffer register is not empty */
  5488. #define SPDIFRX_SR_PERR ((uint32_t)0x00000004) /*!<Parity error */
  5489. #define SPDIFRX_SR_OVR ((uint32_t)0x00000008) /*!<Overrun error */
  5490. #define SPDIFRX_SR_SBD ((uint32_t)0x00000010) /*!<Synchronization Block Detected */
  5491. #define SPDIFRX_SR_SYNCD ((uint32_t)0x00000020) /*!<Synchronization Done */
  5492. #define SPDIFRX_SR_FERR ((uint32_t)0x00000040) /*!<Framing error */
  5493. #define SPDIFRX_SR_SERR ((uint32_t)0x00000080) /*!<Synchronization error */
  5494. #define SPDIFRX_SR_TERR ((uint32_t)0x00000100) /*!<Time-out error */
  5495. #define SPDIFRX_SR_WIDTH5 ((uint32_t)0x7FFF0000) /*!<Duration of 5 symbols counted with SPDIFRX_clk */
  5496. /******************* Bit definition for SPDIFRX_IFCR register *******************/
  5497. #define SPDIFRX_IFCR_PERRCF ((uint32_t)0x00000004) /*!<Clears the Parity error flag */
  5498. #define SPDIFRX_IFCR_OVRCF ((uint32_t)0x00000008) /*!<Clears the Overrun error flag */
  5499. #define SPDIFRX_IFCR_SBDCF ((uint32_t)0x00000010) /*!<Clears the Synchronization Block Detected flag */
  5500. #define SPDIFRX_IFCR_SYNCDCF ((uint32_t)0x00000020) /*!<Clears the Synchronization Done flag */
  5501. /******************* Bit definition for SPDIFRX_DR register (DRFMT = 0b00 case) *******************/
  5502. #define SPDIFRX_DR0_DR ((uint32_t)0x00FFFFFF) /*!<Data value */
  5503. #define SPDIFRX_DR0_PE ((uint32_t)0x01000000) /*!<Parity Error bit */
  5504. #define SPDIFRX_DR0_V ((uint32_t)0x02000000) /*!<Validity bit */
  5505. #define SPDIFRX_DR0_U ((uint32_t)0x04000000) /*!<User bit */
  5506. #define SPDIFRX_DR0_C ((uint32_t)0x08000000) /*!<Channel Status bit */
  5507. #define SPDIFRX_DR0_PT ((uint32_t)0x30000000) /*!<Preamble Type */
  5508. /******************* Bit definition for SPDIFRX_DR register (DRFMT = 0b01 case) *******************/
  5509. #define SPDIFRX_DR1_DR ((uint32_t)0xFFFFFF00) /*!<Data value */
  5510. #define SPDIFRX_DR1_PT ((uint32_t)0x00000030) /*!<Preamble Type */
  5511. #define SPDIFRX_DR1_C ((uint32_t)0x00000008) /*!<Channel Status bit */
  5512. #define SPDIFRX_DR1_U ((uint32_t)0x00000004) /*!<User bit */
  5513. #define SPDIFRX_DR1_V ((uint32_t)0x00000002) /*!<Validity bit */
  5514. #define SPDIFRX_DR1_PE ((uint32_t)0x00000001) /*!<Parity Error bit */
  5515. /******************* Bit definition for SPDIFRX_DR register (DRFMT = 0b10 case) *******************/
  5516. #define SPDIFRX_DR1_DRNL1 ((uint32_t)0xFFFF0000) /*!<Data value Channel B */
  5517. #define SPDIFRX_DR1_DRNL2 ((uint32_t)0x0000FFFF) /*!<Data value Channel A */
  5518. /******************* Bit definition for SPDIFRX_CSR register *******************/
  5519. #define SPDIFRX_CSR_USR ((uint32_t)0x0000FFFF) /*!<User data information */
  5520. #define SPDIFRX_CSR_CS ((uint32_t)0x00FF0000) /*!<Channel A status information */
  5521. #define SPDIFRX_CSR_SOB ((uint32_t)0x01000000) /*!<Start Of Block */
  5522. /******************* Bit definition for SPDIFRX_DIR register *******************/
  5523. #define SPDIFRX_DIR_THI ((uint32_t)0x000013FF) /*!<Threshold LOW */
  5524. #define SPDIFRX_DIR_TLO ((uint32_t)0x1FFF0000) /*!<Threshold HIGH */
  5525. /******************************************************************************/
  5526. /* */
  5527. /* SD host Interface */
  5528. /* */
  5529. /******************************************************************************/
  5530. /****************** Bit definition for SDIO_POWER register ******************/
  5531. #define SDIO_POWER_PWRCTRL ((uint32_t)0x03) /*!<PWRCTRL[1:0] bits (Power supply control bits) */
  5532. #define SDIO_POWER_PWRCTRL_0 ((uint32_t)0x01) /*!<Bit 0 */
  5533. #define SDIO_POWER_PWRCTRL_1 ((uint32_t)0x02) /*!<Bit 1 */
  5534. /****************** Bit definition for SDIO_CLKCR register ******************/
  5535. #define SDIO_CLKCR_CLKDIV ((uint32_t)0x00FF) /*!<Clock divide factor */
  5536. #define SDIO_CLKCR_CLKEN ((uint32_t)0x0100) /*!<Clock enable bit */
  5537. #define SDIO_CLKCR_PWRSAV ((uint32_t)0x0200) /*!<Power saving configuration bit */
  5538. #define SDIO_CLKCR_BYPASS ((uint32_t)0x0400) /*!<Clock divider bypass enable bit */
  5539. #define SDIO_CLKCR_WIDBUS ((uint32_t)0x1800) /*!<WIDBUS[1:0] bits (Wide bus mode enable bit) */
  5540. #define SDIO_CLKCR_WIDBUS_0 ((uint32_t)0x0800) /*!<Bit 0 */
  5541. #define SDIO_CLKCR_WIDBUS_1 ((uint32_t)0x1000) /*!<Bit 1 */
  5542. #define SDIO_CLKCR_NEGEDGE ((uint32_t)0x2000) /*!<SDIO_CK dephasing selection bit */
  5543. #define SDIO_CLKCR_HWFC_EN ((uint32_t)0x4000) /*!<HW Flow Control enable */
  5544. /******************* Bit definition for SDIO_ARG register *******************/
  5545. #define SDIO_ARG_CMDARG ((uint32_t)0xFFFFFFFF) /*!<Command argument */
  5546. /******************* Bit definition for SDIO_CMD register *******************/
  5547. #define SDIO_CMD_CMDINDEX ((uint32_t)0x003F) /*!<Command Index */
  5548. #define SDIO_CMD_WAITRESP ((uint32_t)0x00C0) /*!<WAITRESP[1:0] bits (Wait for response bits) */
  5549. #define SDIO_CMD_WAITRESP_0 ((uint32_t)0x0040) /*!< Bit 0 */
  5550. #define SDIO_CMD_WAITRESP_1 ((uint32_t)0x0080) /*!< Bit 1 */
  5551. #define SDIO_CMD_WAITINT ((uint32_t)0x0100) /*!<CPSM Waits for Interrupt Request */
  5552. #define SDIO_CMD_WAITPEND ((uint32_t)0x0200) /*!<CPSM Waits for ends of data transfer (CmdPend internal signal) */
  5553. #define SDIO_CMD_CPSMEN ((uint32_t)0x0400) /*!<Command path state machine (CPSM) Enable bit */
  5554. #define SDIO_CMD_SDIOSUSPEND ((uint32_t)0x0800) /*!<SD I/O suspend command */
  5555. /***************** Bit definition for SDIO_RESPCMD register *****************/
  5556. #define SDIO_RESPCMD_RESPCMD ((uint32_t)0x3F) /*!<Response command index */
  5557. /****************** Bit definition for SDIO_RESP0 register ******************/
  5558. #define SDIO_RESP0_CARDSTATUS0 ((uint32_t)0xFFFFFFFF) /*!<Card Status */
  5559. /****************** Bit definition for SDIO_RESP1 register ******************/
  5560. #define SDIO_RESP1_CARDSTATUS1 ((uint32_t)0xFFFFFFFF) /*!<Card Status */
  5561. /****************** Bit definition for SDIO_RESP2 register ******************/
  5562. #define SDIO_RESP2_CARDSTATUS2 ((uint32_t)0xFFFFFFFF) /*!<Card Status */
  5563. /****************** Bit definition for SDIO_RESP3 register ******************/
  5564. #define SDIO_RESP3_CARDSTATUS3 ((uint32_t)0xFFFFFFFF) /*!<Card Status */
  5565. /****************** Bit definition for SDIO_RESP4 register ******************/
  5566. #define SDIO_RESP4_CARDSTATUS4 ((uint32_t)0xFFFFFFFF) /*!<Card Status */
  5567. /****************** Bit definition for SDIO_DTIMER register *****************/
  5568. #define SDIO_DTIMER_DATATIME ((uint32_t)0xFFFFFFFF) /*!<Data timeout period. */
  5569. /****************** Bit definition for SDIO_DLEN register *******************/
  5570. #define SDIO_DLEN_DATALENGTH ((uint32_t)0x01FFFFFF) /*!<Data length value */
  5571. /****************** Bit definition for SDIO_DCTRL register ******************/
  5572. #define SDIO_DCTRL_DTEN ((uint32_t)0x0001) /*!<Data transfer enabled bit */
  5573. #define SDIO_DCTRL_DTDIR ((uint32_t)0x0002) /*!<Data transfer direction selection */
  5574. #define SDIO_DCTRL_DTMODE ((uint32_t)0x0004) /*!<Data transfer mode selection */
  5575. #define SDIO_DCTRL_DMAEN ((uint32_t)0x0008) /*!<DMA enabled bit */
  5576. #define SDIO_DCTRL_DBLOCKSIZE ((uint32_t)0x00F0) /*!<DBLOCKSIZE[3:0] bits (Data block size) */
  5577. #define SDIO_DCTRL_DBLOCKSIZE_0 ((uint32_t)0x0010) /*!<Bit 0 */
  5578. #define SDIO_DCTRL_DBLOCKSIZE_1 ((uint32_t)0x0020) /*!<Bit 1 */
  5579. #define SDIO_DCTRL_DBLOCKSIZE_2 ((uint32_t)0x0040) /*!<Bit 2 */
  5580. #define SDIO_DCTRL_DBLOCKSIZE_3 ((uint32_t)0x0080) /*!<Bit 3 */
  5581. #define SDIO_DCTRL_RWSTART ((uint32_t)0x0100) /*!<Read wait start */
  5582. #define SDIO_DCTRL_RWSTOP ((uint32_t)0x0200) /*!<Read wait stop */
  5583. #define SDIO_DCTRL_RWMOD ((uint32_t)0x0400) /*!<Read wait mode */
  5584. #define SDIO_DCTRL_SDIOEN ((uint32_t)0x0800) /*!<SD I/O enable functions */
  5585. /****************** Bit definition for SDIO_DCOUNT register *****************/
  5586. #define SDIO_DCOUNT_DATACOUNT ((uint32_t)0x01FFFFFF) /*!<Data count value */
  5587. /****************** Bit definition for SDIO_STA register ********************/
  5588. #define SDIO_STA_CCRCFAIL ((uint32_t)0x00000001) /*!<Command response received (CRC check failed) */
  5589. #define SDIO_STA_DCRCFAIL ((uint32_t)0x00000002) /*!<Data block sent/received (CRC check failed) */
  5590. #define SDIO_STA_CTIMEOUT ((uint32_t)0x00000004) /*!<Command response timeout */
  5591. #define SDIO_STA_DTIMEOUT ((uint32_t)0x00000008) /*!<Data timeout */
  5592. #define SDIO_STA_TXUNDERR ((uint32_t)0x00000010) /*!<Transmit FIFO underrun error */
  5593. #define SDIO_STA_RXOVERR ((uint32_t)0x00000020) /*!<Received FIFO overrun error */
  5594. #define SDIO_STA_CMDREND ((uint32_t)0x00000040) /*!<Command response received (CRC check passed) */
  5595. #define SDIO_STA_CMDSENT ((uint32_t)0x00000080) /*!<Command sent (no response required) */
  5596. #define SDIO_STA_DATAEND ((uint32_t)0x00000100) /*!<Data end (data counter, SDIDCOUNT, is zero) */
  5597. #define SDIO_STA_DBCKEND ((uint32_t)0x00000400) /*!<Data block sent/received (CRC check passed) */
  5598. #define SDIO_STA_CMDACT ((uint32_t)0x00000800) /*!<Command transfer in progress */
  5599. #define SDIO_STA_TXACT ((uint32_t)0x00001000) /*!<Data transmit in progress */
  5600. #define SDIO_STA_RXACT ((uint32_t)0x00002000) /*!<Data receive in progress */
  5601. #define SDIO_STA_TXFIFOHE ((uint32_t)0x00004000) /*!<Transmit FIFO Half Empty: at least 8 words can be written into the FIFO */
  5602. #define SDIO_STA_RXFIFOHF ((uint32_t)0x00008000) /*!<Receive FIFO Half Full: there are at least 8 words in the FIFO */
  5603. #define SDIO_STA_TXFIFOF ((uint32_t)0x00010000) /*!<Transmit FIFO full */
  5604. #define SDIO_STA_RXFIFOF ((uint32_t)0x00020000) /*!<Receive FIFO full */
  5605. #define SDIO_STA_TXFIFOE ((uint32_t)0x00040000) /*!<Transmit FIFO empty */
  5606. #define SDIO_STA_RXFIFOE ((uint32_t)0x00080000) /*!<Receive FIFO empty */
  5607. #define SDIO_STA_TXDAVL ((uint32_t)0x00100000) /*!<Data available in transmit FIFO */
  5608. #define SDIO_STA_RXDAVL ((uint32_t)0x00200000) /*!<Data available in receive FIFO */
  5609. #define SDIO_STA_SDIOIT ((uint32_t)0x00400000) /*!<SDIO interrupt received */
  5610. /******************* Bit definition for SDIO_ICR register *******************/
  5611. #define SDIO_ICR_CCRCFAILC ((uint32_t)0x00000001) /*!<CCRCFAIL flag clear bit */
  5612. #define SDIO_ICR_DCRCFAILC ((uint32_t)0x00000002) /*!<DCRCFAIL flag clear bit */
  5613. #define SDIO_ICR_CTIMEOUTC ((uint32_t)0x00000004) /*!<CTIMEOUT flag clear bit */
  5614. #define SDIO_ICR_DTIMEOUTC ((uint32_t)0x00000008) /*!<DTIMEOUT flag clear bit */
  5615. #define SDIO_ICR_TXUNDERRC ((uint32_t)0x00000010) /*!<TXUNDERR flag clear bit */
  5616. #define SDIO_ICR_RXOVERRC ((uint32_t)0x00000020) /*!<RXOVERR flag clear bit */
  5617. #define SDIO_ICR_CMDRENDC ((uint32_t)0x00000040) /*!<CMDREND flag clear bit */
  5618. #define SDIO_ICR_CMDSENTC ((uint32_t)0x00000080) /*!<CMDSENT flag clear bit */
  5619. #define SDIO_ICR_DATAENDC ((uint32_t)0x00000100) /*!<DATAEND flag clear bit */
  5620. #define SDIO_ICR_DBCKENDC ((uint32_t)0x00000400) /*!<DBCKEND flag clear bit */
  5621. #define SDIO_ICR_SDIOITC ((uint32_t)0x00400000) /*!<SDIOIT flag clear bit */
  5622. /****************** Bit definition for SDIO_MASK register *******************/
  5623. #define SDIO_MASK_CCRCFAILIE ((uint32_t)0x00000001) /*!<Command CRC Fail Interrupt Enable */
  5624. #define SDIO_MASK_DCRCFAILIE ((uint32_t)0x00000002) /*!<Data CRC Fail Interrupt Enable */
  5625. #define SDIO_MASK_CTIMEOUTIE ((uint32_t)0x00000004) /*!<Command TimeOut Interrupt Enable */
  5626. #define SDIO_MASK_DTIMEOUTIE ((uint32_t)0x00000008) /*!<Data TimeOut Interrupt Enable */
  5627. #define SDIO_MASK_TXUNDERRIE ((uint32_t)0x00000010) /*!<Tx FIFO UnderRun Error Interrupt Enable */
  5628. #define SDIO_MASK_RXOVERRIE ((uint32_t)0x00000020) /*!<Rx FIFO OverRun Error Interrupt Enable */
  5629. #define SDIO_MASK_CMDRENDIE ((uint32_t)0x00000040) /*!<Command Response Received Interrupt Enable */
  5630. #define SDIO_MASK_CMDSENTIE ((uint32_t)0x00000080) /*!<Command Sent Interrupt Enable */
  5631. #define SDIO_MASK_DATAENDIE ((uint32_t)0x00000100) /*!<Data End Interrupt Enable */
  5632. #define SDIO_MASK_DBCKENDIE ((uint32_t)0x00000400) /*!<Data Block End Interrupt Enable */
  5633. #define SDIO_MASK_CMDACTIE ((uint32_t)0x00000800) /*!<CCommand Acting Interrupt Enable */
  5634. #define SDIO_MASK_TXACTIE ((uint32_t)0x00001000) /*!<Data Transmit Acting Interrupt Enable */
  5635. #define SDIO_MASK_RXACTIE ((uint32_t)0x00002000) /*!<Data receive acting interrupt enabled */
  5636. #define SDIO_MASK_TXFIFOHEIE ((uint32_t)0x00004000) /*!<Tx FIFO Half Empty interrupt Enable */
  5637. #define SDIO_MASK_RXFIFOHFIE ((uint32_t)0x00008000) /*!<Rx FIFO Half Full interrupt Enable */
  5638. #define SDIO_MASK_TXFIFOFIE ((uint32_t)0x00010000) /*!<Tx FIFO Full interrupt Enable */
  5639. #define SDIO_MASK_RXFIFOFIE ((uint32_t)0x00020000) /*!<Rx FIFO Full interrupt Enable */
  5640. #define SDIO_MASK_TXFIFOEIE ((uint32_t)0x00040000) /*!<Tx FIFO Empty interrupt Enable */
  5641. #define SDIO_MASK_RXFIFOEIE ((uint32_t)0x00080000) /*!<Rx FIFO Empty interrupt Enable */
  5642. #define SDIO_MASK_TXDAVLIE ((uint32_t)0x00100000) /*!<Data available in Tx FIFO interrupt Enable */
  5643. #define SDIO_MASK_RXDAVLIE ((uint32_t)0x00200000) /*!<Data available in Rx FIFO interrupt Enable */
  5644. #define SDIO_MASK_SDIOITIE ((uint32_t)0x00400000) /*!<SDIO Mode Interrupt Received interrupt Enable */
  5645. /***************** Bit definition for SDIO_FIFOCNT register *****************/
  5646. #define SDIO_FIFOCNT_FIFOCOUNT ((uint32_t)0x00FFFFFF) /*!<Remaining number of words to be written to or read from the FIFO */
  5647. /****************** Bit definition for SDIO_FIFO register *******************/
  5648. #define SDIO_FIFO_FIFODATA ((uint32_t)0xFFFFFFFF) /*!<Receive and transmit FIFO data */
  5649. /******************************************************************************/
  5650. /* */
  5651. /* Serial Peripheral Interface */
  5652. /* */
  5653. /******************************************************************************/
  5654. /******************* Bit definition for SPI_CR1 register ********************/
  5655. #define SPI_CR1_CPHA ((uint32_t)0x00000001) /*!<Clock Phase */
  5656. #define SPI_CR1_CPOL ((uint32_t)0x00000002) /*!<Clock Polarity */
  5657. #define SPI_CR1_MSTR ((uint32_t)0x00000004) /*!<Master Selection */
  5658. #define SPI_CR1_BR ((uint32_t)0x00000038) /*!<BR[2:0] bits (Baud Rate Control) */
  5659. #define SPI_CR1_BR_0 ((uint32_t)0x00000008) /*!<Bit 0 */
  5660. #define SPI_CR1_BR_1 ((uint32_t)0x00000010) /*!<Bit 1 */
  5661. #define SPI_CR1_BR_2 ((uint32_t)0x00000020) /*!<Bit 2 */
  5662. #define SPI_CR1_SPE ((uint32_t)0x00000040) /*!<SPI Enable */
  5663. #define SPI_CR1_LSBFIRST ((uint32_t)0x00000080) /*!<Frame Format */
  5664. #define SPI_CR1_SSI ((uint32_t)0x00000100) /*!<Internal slave select */
  5665. #define SPI_CR1_SSM ((uint32_t)0x00000200) /*!<Software slave management */
  5666. #define SPI_CR1_RXONLY ((uint32_t)0x00000400) /*!<Receive only */
  5667. #define SPI_CR1_DFF ((uint32_t)0x00000800) /*!<Data Frame Format */
  5668. #define SPI_CR1_CRCNEXT ((uint32_t)0x00001000) /*!<Transmit CRC next */
  5669. #define SPI_CR1_CRCEN ((uint32_t)0x00002000) /*!<Hardware CRC calculation enable */
  5670. #define SPI_CR1_BIDIOE ((uint32_t)0x00004000) /*!<Output enable in bidirectional mode */
  5671. #define SPI_CR1_BIDIMODE ((uint32_t)0x00008000) /*!<Bidirectional data mode enable */
  5672. /******************* Bit definition for SPI_CR2 register ********************/
  5673. #define SPI_CR2_RXDMAEN ((uint32_t)0x00000001) /*!<Rx Buffer DMA Enable */
  5674. #define SPI_CR2_TXDMAEN ((uint32_t)0x00000002) /*!<Tx Buffer DMA Enable */
  5675. #define SPI_CR2_SSOE ((uint32_t)0x00000004) /*!<SS Output Enable */
  5676. #define SPI_CR2_FRF ((uint32_t)0x00000010) /*!<Frame Format */
  5677. #define SPI_CR2_ERRIE ((uint32_t)0x00000020) /*!<Error Interrupt Enable */
  5678. #define SPI_CR2_RXNEIE ((uint32_t)0x00000040) /*!<RX buffer Not Empty Interrupt Enable */
  5679. #define SPI_CR2_TXEIE ((uint32_t)0x00000080) /*!<Tx buffer Empty Interrupt Enable */
  5680. /******************** Bit definition for SPI_SR register ********************/
  5681. #define SPI_SR_RXNE ((uint32_t)0x00000001) /*!<Receive buffer Not Empty */
  5682. #define SPI_SR_TXE ((uint32_t)0x00000002) /*!<Transmit buffer Empty */
  5683. #define SPI_SR_CHSIDE ((uint32_t)0x00000004) /*!<Channel side */
  5684. #define SPI_SR_UDR ((uint32_t)0x00000008) /*!<Underrun flag */
  5685. #define SPI_SR_CRCERR ((uint32_t)0x00000010) /*!<CRC Error flag */
  5686. #define SPI_SR_MODF ((uint32_t)0x00000020) /*!<Mode fault */
  5687. #define SPI_SR_OVR ((uint32_t)0x00000040) /*!<Overrun flag */
  5688. #define SPI_SR_BSY ((uint32_t)0x00000080) /*!<Busy flag */
  5689. #define SPI_SR_FRE ((uint32_t)0x00000100) /*!<Frame format error flag */
  5690. /******************** Bit definition for SPI_DR register ********************/
  5691. #define SPI_DR_DR ((uint32_t)0x0000FFFF) /*!<Data Register */
  5692. /******************* Bit definition for SPI_CRCPR register ******************/
  5693. #define SPI_CRCPR_CRCPOLY ((uint32_t)0x0000FFFF) /*!<CRC polynomial register */
  5694. /****************** Bit definition for SPI_RXCRCR register ******************/
  5695. #define SPI_RXCRCR_RXCRC ((uint32_t)0x0000FFFF) /*!<Rx CRC Register */
  5696. /****************** Bit definition for SPI_TXCRCR register ******************/
  5697. #define SPI_TXCRCR_TXCRC ((uint32_t)0x0000FFFF) /*!<Tx CRC Register */
  5698. /****************** Bit definition for SPI_I2SCFGR register *****************/
  5699. #define SPI_I2SCFGR_CHLEN ((uint32_t)0x00000001) /*!<Channel length (number of bits per audio channel) */
  5700. #define SPI_I2SCFGR_DATLEN ((uint32_t)0x00000006) /*!<DATLEN[1:0] bits (Data length to be transferred) */
  5701. #define SPI_I2SCFGR_DATLEN_0 ((uint32_t)0x00000002) /*!<Bit 0 */
  5702. #define SPI_I2SCFGR_DATLEN_1 ((uint32_t)0x00000004) /*!<Bit 1 */
  5703. #define SPI_I2SCFGR_CKPOL ((uint32_t)0x00000008) /*!<steady state clock polarity */
  5704. #define SPI_I2SCFGR_I2SSTD ((uint32_t)0x00000030) /*!<I2SSTD[1:0] bits (I2S standard selection) */
  5705. #define SPI_I2SCFGR_I2SSTD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  5706. #define SPI_I2SCFGR_I2SSTD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  5707. #define SPI_I2SCFGR_PCMSYNC ((uint32_t)0x00000080) /*!<PCM frame synchronization */
  5708. #define SPI_I2SCFGR_I2SCFG ((uint32_t)0x00000300) /*!<I2SCFG[1:0] bits (I2S configuration mode) */
  5709. #define SPI_I2SCFGR_I2SCFG_0 ((uint32_t)0x00000100) /*!<Bit 0 */
  5710. #define SPI_I2SCFGR_I2SCFG_1 ((uint32_t)0x00000200) /*!<Bit 1 */
  5711. #define SPI_I2SCFGR_I2SE ((uint32_t)0x00000400) /*!<I2S Enable */
  5712. #define SPI_I2SCFGR_I2SMOD ((uint32_t)0x00000800) /*!<I2S mode selection */
  5713. #define SPI_I2SCFGR_ASTRTEN ((uint32_t)0x00001000) /*!<Asynchronous start enable */
  5714. /****************** Bit definition for SPI_I2SPR register *******************/
  5715. #define SPI_I2SPR_I2SDIV ((uint32_t)0x000000FF) /*!<I2S Linear prescaler */
  5716. #define SPI_I2SPR_ODD ((uint32_t)0x00000100) /*!<Odd factor for the prescaler */
  5717. #define SPI_I2SPR_MCKOE ((uint32_t)0x00000200) /*!<Master Clock Output Enable */
  5718. /******************************************************************************/
  5719. /* */
  5720. /* SYSCFG */
  5721. /* */
  5722. /******************************************************************************/
  5723. /****************** Bit definition for SYSCFG_MEMRMP register ***************/
  5724. #define SYSCFG_MEMRMP_MEM_MODE ((uint32_t)0x00000007) /*!< SYSCFG_Memory Remap Config */
  5725. #define SYSCFG_MEMRMP_MEM_MODE_0 ((uint32_t)0x00000001)
  5726. #define SYSCFG_MEMRMP_MEM_MODE_1 ((uint32_t)0x00000002)
  5727. #define SYSCFG_MEMRMP_MEM_MODE_2 ((uint32_t)0x00000004)
  5728. #define SYSCFG_MEMRMP_UFB_MODE ((uint32_t)0x00000100) /*!< User Flash Bank mode */
  5729. #define SYSCFG_SWP_FMC ((uint32_t)0x00000C00) /*!< FMC memory mapping swap */
  5730. /****************** Bit definition for SYSCFG_PMC register ******************/
  5731. #define SYSCFG_PMC_ADCxDC2 ((uint32_t)0x00070000) /*!< Refer to AN4073 on how to use this bit */
  5732. #define SYSCFG_PMC_ADC1DC2 ((uint32_t)0x00010000) /*!< Refer to AN4073 on how to use this bit */
  5733. #define SYSCFG_PMC_ADC2DC2 ((uint32_t)0x00020000) /*!< Refer to AN4073 on how to use this bit */
  5734. #define SYSCFG_PMC_ADC3DC2 ((uint32_t)0x00040000) /*!< Refer to AN4073 on how to use this bit */
  5735. /***************** Bit definition for SYSCFG_EXTICR1 register ***************/
  5736. #define SYSCFG_EXTICR1_EXTI0 ((uint32_t)0x000F) /*!<EXTI 0 configuration */
  5737. #define SYSCFG_EXTICR1_EXTI1 ((uint32_t)0x00F0) /*!<EXTI 1 configuration */
  5738. #define SYSCFG_EXTICR1_EXTI2 ((uint32_t)0x0F00) /*!<EXTI 2 configuration */
  5739. #define SYSCFG_EXTICR1_EXTI3 ((uint32_t)0xF000) /*!<EXTI 3 configuration */
  5740. /**
  5741. * @brief EXTI0 configuration
  5742. */
  5743. #define SYSCFG_EXTICR1_EXTI0_PA ((uint32_t)0x0000) /*!<PA[0] pin */
  5744. #define SYSCFG_EXTICR1_EXTI0_PB ((uint32_t)0x0001) /*!<PB[0] pin */
  5745. #define SYSCFG_EXTICR1_EXTI0_PC ((uint32_t)0x0002) /*!<PC[0] pin */
  5746. #define SYSCFG_EXTICR1_EXTI0_PD ((uint32_t)0x0003) /*!<PD[0] pin */
  5747. #define SYSCFG_EXTICR1_EXTI0_PE ((uint32_t)0x0004) /*!<PE[0] pin */
  5748. #define SYSCFG_EXTICR1_EXTI0_PF ((uint32_t)0x0005) /*!<PF[0] pin */
  5749. #define SYSCFG_EXTICR1_EXTI0_PG ((uint32_t)0x0006) /*!<PG[0] pin */
  5750. #define SYSCFG_EXTICR1_EXTI0_PH ((uint32_t)0x0007) /*!<PH[0] pin */
  5751. #define SYSCFG_EXTICR1_EXTI0_PI ((uint32_t)0x0008) /*!<PI[0] pin */
  5752. #define SYSCFG_EXTICR1_EXTI0_PJ ((uint32_t)0x0009) /*!<PJ[0] pin */
  5753. #define SYSCFG_EXTICR1_EXTI0_PK ((uint32_t)0x000A) /*!<PK[0] pin */
  5754. /**
  5755. * @brief EXTI1 configuration
  5756. */
  5757. #define SYSCFG_EXTICR1_EXTI1_PA ((uint32_t)0x0000) /*!<PA[1] pin */
  5758. #define SYSCFG_EXTICR1_EXTI1_PB ((uint32_t)0x0010) /*!<PB[1] pin */
  5759. #define SYSCFG_EXTICR1_EXTI1_PC ((uint32_t)0x0020) /*!<PC[1] pin */
  5760. #define SYSCFG_EXTICR1_EXTI1_PD ((uint32_t)0x0030) /*!<PD[1] pin */
  5761. #define SYSCFG_EXTICR1_EXTI1_PE ((uint32_t)0x0040) /*!<PE[1] pin */
  5762. #define SYSCFG_EXTICR1_EXTI1_PF ((uint32_t)0x0050) /*!<PF[1] pin */
  5763. #define SYSCFG_EXTICR1_EXTI1_PG ((uint32_t)0x0060) /*!<PG[1] pin */
  5764. #define SYSCFG_EXTICR1_EXTI1_PH ((uint32_t)0x0070) /*!<PH[1] pin */
  5765. #define SYSCFG_EXTICR1_EXTI1_PI ((uint32_t)0x0080) /*!<PI[1] pin */
  5766. #define SYSCFG_EXTICR1_EXTI1_PJ ((uint32_t)0x0090) /*!<PJ[1] pin */
  5767. #define SYSCFG_EXTICR1_EXTI1_PK ((uint32_t)0x00A0) /*!<PK[1] pin */
  5768. /**
  5769. * @brief EXTI2 configuration
  5770. */
  5771. #define SYSCFG_EXTICR1_EXTI2_PA ((uint32_t)0x0000) /*!<PA[2] pin */
  5772. #define SYSCFG_EXTICR1_EXTI2_PB ((uint32_t)0x0100) /*!<PB[2] pin */
  5773. #define SYSCFG_EXTICR1_EXTI2_PC ((uint32_t)0x0200) /*!<PC[2] pin */
  5774. #define SYSCFG_EXTICR1_EXTI2_PD ((uint32_t)0x0300) /*!<PD[2] pin */
  5775. #define SYSCFG_EXTICR1_EXTI2_PE ((uint32_t)0x0400) /*!<PE[2] pin */
  5776. #define SYSCFG_EXTICR1_EXTI2_PF ((uint32_t)0x0500) /*!<PF[2] pin */
  5777. #define SYSCFG_EXTICR1_EXTI2_PG ((uint32_t)0x0600) /*!<PG[2] pin */
  5778. #define SYSCFG_EXTICR1_EXTI2_PH ((uint32_t)0x0700) /*!<PH[2] pin */
  5779. #define SYSCFG_EXTICR1_EXTI2_PI ((uint32_t)0x0800) /*!<PI[2] pin */
  5780. #define SYSCFG_EXTICR1_EXTI2_PJ ((uint32_t)0x0900) /*!<PJ[2] pin */
  5781. #define SYSCFG_EXTICR1_EXTI2_PK ((uint32_t)0x0A00) /*!<PK[2] pin */
  5782. /**
  5783. * @brief EXTI3 configuration
  5784. */
  5785. #define SYSCFG_EXTICR1_EXTI3_PA ((uint32_t)0x0000) /*!<PA[3] pin */
  5786. #define SYSCFG_EXTICR1_EXTI3_PB ((uint32_t)0x1000) /*!<PB[3] pin */
  5787. #define SYSCFG_EXTICR1_EXTI3_PC ((uint32_t)0x2000) /*!<PC[3] pin */
  5788. #define SYSCFG_EXTICR1_EXTI3_PD ((uint32_t)0x3000) /*!<PD[3] pin */
  5789. #define SYSCFG_EXTICR1_EXTI3_PE ((uint32_t)0x4000) /*!<PE[3] pin */
  5790. #define SYSCFG_EXTICR1_EXTI3_PF ((uint32_t)0x5000) /*!<PF[3] pin */
  5791. #define SYSCFG_EXTICR1_EXTI3_PG ((uint32_t)0x6000) /*!<PG[3] pin */
  5792. #define SYSCFG_EXTICR1_EXTI3_PH ((uint32_t)0x7000) /*!<PH[3] pin */
  5793. #define SYSCFG_EXTICR1_EXTI3_PI ((uint32_t)0x8000) /*!<PI[3] pin */
  5794. #define SYSCFG_EXTICR1_EXTI3_PJ ((uint32_t)0x9000) /*!<PJ[3] pin */
  5795. #define SYSCFG_EXTICR1_EXTI3_PK ((uint32_t)0xA000) /*!<PK[3] pin */
  5796. /***************** Bit definition for SYSCFG_EXTICR2 register ***************/
  5797. #define SYSCFG_EXTICR2_EXTI4 ((uint32_t)0x000F) /*!<EXTI 4 configuration */
  5798. #define SYSCFG_EXTICR2_EXTI5 ((uint32_t)0x00F0) /*!<EXTI 5 configuration */
  5799. #define SYSCFG_EXTICR2_EXTI6 ((uint32_t)0x0F00) /*!<EXTI 6 configuration */
  5800. #define SYSCFG_EXTICR2_EXTI7 ((uint32_t)0xF000) /*!<EXTI 7 configuration */
  5801. /**
  5802. * @brief EXTI4 configuration
  5803. */
  5804. #define SYSCFG_EXTICR2_EXTI4_PA ((uint32_t)0x0000) /*!<PA[4] pin */
  5805. #define SYSCFG_EXTICR2_EXTI4_PB ((uint32_t)0x0001) /*!<PB[4] pin */
  5806. #define SYSCFG_EXTICR2_EXTI4_PC ((uint32_t)0x0002) /*!<PC[4] pin */
  5807. #define SYSCFG_EXTICR2_EXTI4_PD ((uint32_t)0x0003) /*!<PD[4] pin */
  5808. #define SYSCFG_EXTICR2_EXTI4_PE ((uint32_t)0x0004) /*!<PE[4] pin */
  5809. #define SYSCFG_EXTICR2_EXTI4_PF ((uint32_t)0x0005) /*!<PF[4] pin */
  5810. #define SYSCFG_EXTICR2_EXTI4_PG ((uint32_t)0x0006) /*!<PG[4] pin */
  5811. #define SYSCFG_EXTICR2_EXTI4_PH ((uint32_t)0x0007) /*!<PH[4] pin */
  5812. #define SYSCFG_EXTICR2_EXTI4_PI ((uint32_t)0x0008) /*!<PI[4] pin */
  5813. #define SYSCFG_EXTICR2_EXTI4_PJ ((uint32_t)0x0009) /*!<PJ[4] pin */
  5814. #define SYSCFG_EXTICR2_EXTI4_PK ((uint32_t)0x000A) /*!<PK[4] pin */
  5815. /**
  5816. * @brief EXTI5 configuration
  5817. */
  5818. #define SYSCFG_EXTICR2_EXTI5_PA ((uint32_t)0x0000) /*!<PA[5] pin */
  5819. #define SYSCFG_EXTICR2_EXTI5_PB ((uint32_t)0x0010) /*!<PB[5] pin */
  5820. #define SYSCFG_EXTICR2_EXTI5_PC ((uint32_t)0x0020) /*!<PC[5] pin */
  5821. #define SYSCFG_EXTICR2_EXTI5_PD ((uint32_t)0x0030) /*!<PD[5] pin */
  5822. #define SYSCFG_EXTICR2_EXTI5_PE ((uint32_t)0x0040) /*!<PE[5] pin */
  5823. #define SYSCFG_EXTICR2_EXTI5_PF ((uint32_t)0x0050) /*!<PF[5] pin */
  5824. #define SYSCFG_EXTICR2_EXTI5_PG ((uint32_t)0x0060) /*!<PG[5] pin */
  5825. #define SYSCFG_EXTICR2_EXTI5_PH ((uint32_t)0x0070) /*!<PH[5] pin */
  5826. #define SYSCFG_EXTICR2_EXTI5_PI ((uint32_t)0x0080) /*!<PI[5] pin */
  5827. #define SYSCFG_EXTICR2_EXTI5_PJ ((uint32_t)0x0090) /*!<PJ[5] pin */
  5828. #define SYSCFG_EXTICR2_EXTI5_PK ((uint32_t)0x00A0) /*!<PK[5] pin */
  5829. /**
  5830. * @brief EXTI6 configuration
  5831. */
  5832. #define SYSCFG_EXTICR2_EXTI6_PA ((uint32_t)0x0000) /*!<PA[6] pin */
  5833. #define SYSCFG_EXTICR2_EXTI6_PB ((uint32_t)0x0100) /*!<PB[6] pin */
  5834. #define SYSCFG_EXTICR2_EXTI6_PC ((uint32_t)0x0200) /*!<PC[6] pin */
  5835. #define SYSCFG_EXTICR2_EXTI6_PD ((uint32_t)0x0300) /*!<PD[6] pin */
  5836. #define SYSCFG_EXTICR2_EXTI6_PE ((uint32_t)0x0400) /*!<PE[6] pin */
  5837. #define SYSCFG_EXTICR2_EXTI6_PF ((uint32_t)0x0500) /*!<PF[6] pin */
  5838. #define SYSCFG_EXTICR2_EXTI6_PG ((uint32_t)0x0600) /*!<PG[6] pin */
  5839. #define SYSCFG_EXTICR2_EXTI6_PH ((uint32_t)0x0700) /*!<PH[6] pin */
  5840. #define SYSCFG_EXTICR2_EXTI6_PI ((uint32_t)0x0800) /*!<PI[6] pin */
  5841. #define SYSCFG_EXTICR2_EXTI6_PJ ((uint32_t)0x0900) /*!<PJ[6] pin */
  5842. #define SYSCFG_EXTICR2_EXTI6_PK ((uint32_t)0x0A00) /*!<PK[6] pin */
  5843. /**
  5844. * @brief EXTI7 configuration
  5845. */
  5846. #define SYSCFG_EXTICR2_EXTI7_PA ((uint32_t)0x0000) /*!<PA[7] pin */
  5847. #define SYSCFG_EXTICR2_EXTI7_PB ((uint32_t)0x1000) /*!<PB[7] pin */
  5848. #define SYSCFG_EXTICR2_EXTI7_PC ((uint32_t)0x2000) /*!<PC[7] pin */
  5849. #define SYSCFG_EXTICR2_EXTI7_PD ((uint32_t)0x3000) /*!<PD[7] pin */
  5850. #define SYSCFG_EXTICR2_EXTI7_PE ((uint32_t)0x4000) /*!<PE[7] pin */
  5851. #define SYSCFG_EXTICR2_EXTI7_PF ((uint32_t)0x5000) /*!<PF[7] pin */
  5852. #define SYSCFG_EXTICR2_EXTI7_PG ((uint32_t)0x6000) /*!<PG[7] pin */
  5853. #define SYSCFG_EXTICR2_EXTI7_PH ((uint32_t)0x7000) /*!<PH[7] pin */
  5854. #define SYSCFG_EXTICR2_EXTI7_PI ((uint32_t)0x8000) /*!<PI[7] pin */
  5855. #define SYSCFG_EXTICR2_EXTI7_PJ ((uint32_t)0x9000) /*!<PJ[7] pin */
  5856. #define SYSCFG_EXTICR2_EXTI7_PK ((uint32_t)0xA000) /*!<PK[7] pin */
  5857. /***************** Bit definition for SYSCFG_EXTICR3 register ***************/
  5858. #define SYSCFG_EXTICR3_EXTI8 ((uint32_t)0x000F) /*!<EXTI 8 configuration */
  5859. #define SYSCFG_EXTICR3_EXTI9 ((uint32_t)0x00F0) /*!<EXTI 9 configuration */
  5860. #define SYSCFG_EXTICR3_EXTI10 ((uint32_t)0x0F00) /*!<EXTI 10 configuration */
  5861. #define SYSCFG_EXTICR3_EXTI11 ((uint32_t)0xF000) /*!<EXTI 11 configuration */
  5862. /**
  5863. * @brief EXTI8 configuration
  5864. */
  5865. #define SYSCFG_EXTICR3_EXTI8_PA ((uint32_t)0x0000) /*!<PA[8] pin */
  5866. #define SYSCFG_EXTICR3_EXTI8_PB ((uint32_t)0x0001) /*!<PB[8] pin */
  5867. #define SYSCFG_EXTICR3_EXTI8_PC ((uint32_t)0x0002) /*!<PC[8] pin */
  5868. #define SYSCFG_EXTICR3_EXTI8_PD ((uint32_t)0x0003) /*!<PD[8] pin */
  5869. #define SYSCFG_EXTICR3_EXTI8_PE ((uint32_t)0x0004) /*!<PE[8] pin */
  5870. #define SYSCFG_EXTICR3_EXTI8_PF ((uint32_t)0x0005) /*!<PF[8] pin */
  5871. #define SYSCFG_EXTICR3_EXTI8_PG ((uint32_t)0x0006) /*!<PG[8] pin */
  5872. #define SYSCFG_EXTICR3_EXTI8_PH ((uint32_t)0x0007) /*!<PH[8] pin */
  5873. #define SYSCFG_EXTICR3_EXTI8_PI ((uint32_t)0x0008) /*!<PI[8] pin */
  5874. #define SYSCFG_EXTICR3_EXTI8_PJ ((uint32_t)0x0009) /*!<PJ[8] pin */
  5875. /**
  5876. * @brief EXTI9 configuration
  5877. */
  5878. #define SYSCFG_EXTICR3_EXTI9_PA ((uint32_t)0x0000) /*!<PA[9] pin */
  5879. #define SYSCFG_EXTICR3_EXTI9_PB ((uint32_t)0x0010) /*!<PB[9] pin */
  5880. #define SYSCFG_EXTICR3_EXTI9_PC ((uint32_t)0x0020) /*!<PC[9] pin */
  5881. #define SYSCFG_EXTICR3_EXTI9_PD ((uint32_t)0x0030) /*!<PD[9] pin */
  5882. #define SYSCFG_EXTICR3_EXTI9_PE ((uint32_t)0x0040) /*!<PE[9] pin */
  5883. #define SYSCFG_EXTICR3_EXTI9_PF ((uint32_t)0x0050) /*!<PF[9] pin */
  5884. #define SYSCFG_EXTICR3_EXTI9_PG ((uint32_t)0x0060) /*!<PG[9] pin */
  5885. #define SYSCFG_EXTICR3_EXTI9_PH ((uint32_t)0x0070) /*!<PH[9] pin */
  5886. #define SYSCFG_EXTICR3_EXTI9_PI ((uint32_t)0x0080) /*!<PI[9] pin */
  5887. #define SYSCFG_EXTICR3_EXTI9_PJ ((uint32_t)0x0090) /*!<PJ[9] pin */
  5888. /**
  5889. * @brief EXTI10 configuration
  5890. */
  5891. #define SYSCFG_EXTICR3_EXTI10_PA ((uint32_t)0x0000) /*!<PA[10] pin */
  5892. #define SYSCFG_EXTICR3_EXTI10_PB ((uint32_t)0x0100) /*!<PB[10] pin */
  5893. #define SYSCFG_EXTICR3_EXTI10_PC ((uint32_t)0x0200) /*!<PC[10] pin */
  5894. #define SYSCFG_EXTICR3_EXTI10_PD ((uint32_t)0x0300) /*!<PD[10] pin */
  5895. #define SYSCFG_EXTICR3_EXTI10_PE ((uint32_t)0x0400) /*!<PE[10] pin */
  5896. #define SYSCFG_EXTICR3_EXTI10_PF ((uint32_t)0x0500) /*!<PF[10] pin */
  5897. #define SYSCFG_EXTICR3_EXTI10_PG ((uint32_t)0x0600) /*!<PG[10] pin */
  5898. #define SYSCFG_EXTICR3_EXTI10_PH ((uint32_t)0x0700) /*!<PH[10] pin */
  5899. #define SYSCFG_EXTICR3_EXTI10_PI ((uint32_t)0x0800) /*!<PI[10] pin */
  5900. #define SYSCFG_EXTICR3_EXTI10_PJ ((uint32_t)0x0900) /*!<PJ[10] pin */
  5901. /**
  5902. * @brief EXTI11 configuration
  5903. */
  5904. #define SYSCFG_EXTICR3_EXTI11_PA ((uint32_t)0x0000) /*!<PA[11] pin */
  5905. #define SYSCFG_EXTICR3_EXTI11_PB ((uint32_t)0x1000) /*!<PB[11] pin */
  5906. #define SYSCFG_EXTICR3_EXTI11_PC ((uint32_t)0x2000) /*!<PC[11] pin */
  5907. #define SYSCFG_EXTICR3_EXTI11_PD ((uint32_t)0x3000) /*!<PD[11] pin */
  5908. #define SYSCFG_EXTICR3_EXTI11_PE ((uint32_t)0x4000) /*!<PE[11] pin */
  5909. #define SYSCFG_EXTICR3_EXTI11_PF ((uint32_t)0x5000) /*!<PF[11] pin */
  5910. #define SYSCFG_EXTICR3_EXTI11_PG ((uint32_t)0x6000) /*!<PG[11] pin */
  5911. #define SYSCFG_EXTICR3_EXTI11_PH ((uint32_t)0x7000) /*!<PH[11] pin */
  5912. #define SYSCFG_EXTICR3_EXTI11_PI ((uint32_t)0x8000) /*!<PI[11] pin */
  5913. #define SYSCFG_EXTICR3_EXTI11_PJ ((uint32_t)0x9000) /*!<PJ[11] pin */
  5914. /***************** Bit definition for SYSCFG_EXTICR4 register ***************/
  5915. #define SYSCFG_EXTICR4_EXTI12 ((uint32_t)0x000F) /*!<EXTI 12 configuration */
  5916. #define SYSCFG_EXTICR4_EXTI13 ((uint32_t)0x00F0) /*!<EXTI 13 configuration */
  5917. #define SYSCFG_EXTICR4_EXTI14 ((uint32_t)0x0F00) /*!<EXTI 14 configuration */
  5918. #define SYSCFG_EXTICR4_EXTI15 ((uint32_t)0xF000) /*!<EXTI 15 configuration */
  5919. /**
  5920. * @brief EXTI12 configuration
  5921. */
  5922. #define SYSCFG_EXTICR4_EXTI12_PA ((uint32_t)0x0000) /*!<PA[12] pin */
  5923. #define SYSCFG_EXTICR4_EXTI12_PB ((uint32_t)0x0001) /*!<PB[12] pin */
  5924. #define SYSCFG_EXTICR4_EXTI12_PC ((uint32_t)0x0002) /*!<PC[12] pin */
  5925. #define SYSCFG_EXTICR4_EXTI12_PD ((uint32_t)0x0003) /*!<PD[12] pin */
  5926. #define SYSCFG_EXTICR4_EXTI12_PE ((uint32_t)0x0004) /*!<PE[12] pin */
  5927. #define SYSCFG_EXTICR4_EXTI12_PF ((uint32_t)0x0005) /*!<PF[12] pin */
  5928. #define SYSCFG_EXTICR4_EXTI12_PG ((uint32_t)0x0006) /*!<PG[12] pin */
  5929. #define SYSCFG_EXTICR4_EXTI12_PH ((uint32_t)0x0007) /*!<PH[12] pin */
  5930. #define SYSCFG_EXTICR4_EXTI12_PI ((uint32_t)0x0008) /*!<PI[12] pin */
  5931. #define SYSCFG_EXTICR4_EXTI12_PJ ((uint32_t)0x0009) /*!<PJ[12] pin */
  5932. /**
  5933. * @brief EXTI13 configuration
  5934. */
  5935. #define SYSCFG_EXTICR4_EXTI13_PA ((uint32_t)0x0000) /*!<PA[13] pin */
  5936. #define SYSCFG_EXTICR4_EXTI13_PB ((uint32_t)0x0010) /*!<PB[13] pin */
  5937. #define SYSCFG_EXTICR4_EXTI13_PC ((uint32_t)0x0020) /*!<PC[13] pin */
  5938. #define SYSCFG_EXTICR4_EXTI13_PD ((uint32_t)0x0030) /*!<PD[13] pin */
  5939. #define SYSCFG_EXTICR4_EXTI13_PE ((uint32_t)0x0040) /*!<PE[13] pin */
  5940. #define SYSCFG_EXTICR4_EXTI13_PF ((uint32_t)0x0050) /*!<PF[13] pin */
  5941. #define SYSCFG_EXTICR4_EXTI13_PG ((uint32_t)0x0060) /*!<PG[13] pin */
  5942. #define SYSCFG_EXTICR4_EXTI13_PH ((uint32_t)0x0070) /*!<PH[13] pin */
  5943. #define SYSCFG_EXTICR4_EXTI13_PI ((uint32_t)0x0008) /*!<PI[13] pin */
  5944. #define SYSCFG_EXTICR4_EXTI13_PJ ((uint32_t)0x0009) /*!<PJ[13] pin */
  5945. /**
  5946. * @brief EXTI14 configuration
  5947. */
  5948. #define SYSCFG_EXTICR4_EXTI14_PA ((uint32_t)0x0000) /*!<PA[14] pin */
  5949. #define SYSCFG_EXTICR4_EXTI14_PB ((uint32_t)0x0100) /*!<PB[14] pin */
  5950. #define SYSCFG_EXTICR4_EXTI14_PC ((uint32_t)0x0200) /*!<PC[14] pin */
  5951. #define SYSCFG_EXTICR4_EXTI14_PD ((uint32_t)0x0300) /*!<PD[14] pin */
  5952. #define SYSCFG_EXTICR4_EXTI14_PE ((uint32_t)0x0400) /*!<PE[14] pin */
  5953. #define SYSCFG_EXTICR4_EXTI14_PF ((uint32_t)0x0500) /*!<PF[14] pin */
  5954. #define SYSCFG_EXTICR4_EXTI14_PG ((uint32_t)0x0600) /*!<PG[14] pin */
  5955. #define SYSCFG_EXTICR4_EXTI14_PH ((uint32_t)0x0700) /*!<PH[14] pin */
  5956. #define SYSCFG_EXTICR4_EXTI14_PI ((uint32_t)0x0800) /*!<PI[14] pin */
  5957. #define SYSCFG_EXTICR4_EXTI14_PJ ((uint32_t)0x0900) /*!<PJ[14] pin */
  5958. /**
  5959. * @brief EXTI15 configuration
  5960. */
  5961. #define SYSCFG_EXTICR4_EXTI15_PA ((uint32_t)0x0000) /*!<PA[15] pin */
  5962. #define SYSCFG_EXTICR4_EXTI15_PB ((uint32_t)0x1000) /*!<PB[15] pin */
  5963. #define SYSCFG_EXTICR4_EXTI15_PC ((uint32_t)0x2000) /*!<PC[15] pin */
  5964. #define SYSCFG_EXTICR4_EXTI15_PD ((uint32_t)0x3000) /*!<PD[15] pin */
  5965. #define SYSCFG_EXTICR4_EXTI15_PE ((uint32_t)0x4000) /*!<PE[15] pin */
  5966. #define SYSCFG_EXTICR4_EXTI15_PF ((uint32_t)0x5000) /*!<PF[15] pin */
  5967. #define SYSCFG_EXTICR4_EXTI15_PG ((uint32_t)0x6000) /*!<PG[15] pin */
  5968. #define SYSCFG_EXTICR4_EXTI15_PH ((uint32_t)0x7000) /*!<PH[15] pin */
  5969. #define SYSCFG_EXTICR4_EXTI15_PI ((uint32_t)0x8000) /*!<PI[15] pin */
  5970. #define SYSCFG_EXTICR4_EXTI15_PJ ((uint32_t)0x9000) /*!<PJ[15] pin */
  5971. /****************** Bit definition for SYSCFG_CMPCR register ****************/
  5972. #define SYSCFG_CMPCR_CMP_PD ((uint32_t)0x00000001) /*!<Compensation cell ready flag */
  5973. #define SYSCFG_CMPCR_READY ((uint32_t)0x00000100) /*!<Compensation cell power-down */
  5974. /****************** Bit definition for SYSCFG_CFGR register ****************/
  5975. #define SYSCFG_CFGR_FMPI2C1_SCL ((uint32_t)0x00000001) /*!<FM+ drive capability for FMPI2C1_SCL pin */
  5976. #define SYSCFG_CFGR_FMPI2C1_SDA ((uint32_t)0x00000002) /*!<FM+ drive capability for FMPI2C1_SDA pin */
  5977. /******************************************************************************/
  5978. /* */
  5979. /* TIM */
  5980. /* */
  5981. /******************************************************************************/
  5982. /******************* Bit definition for TIM_CR1 register ********************/
  5983. #define TIM_CR1_CEN ((uint32_t)0x0001) /*!<Counter enable */
  5984. #define TIM_CR1_UDIS ((uint32_t)0x0002) /*!<Update disable */
  5985. #define TIM_CR1_URS ((uint32_t)0x0004) /*!<Update request source */
  5986. #define TIM_CR1_OPM ((uint32_t)0x0008) /*!<One pulse mode */
  5987. #define TIM_CR1_DIR ((uint32_t)0x0010) /*!<Direction */
  5988. #define TIM_CR1_CMS ((uint32_t)0x0060) /*!<CMS[1:0] bits (Center-aligned mode selection) */
  5989. #define TIM_CR1_CMS_0 ((uint32_t)0x0020) /*!<Bit 0 */
  5990. #define TIM_CR1_CMS_1 ((uint32_t)0x0040) /*!<Bit 1 */
  5991. #define TIM_CR1_ARPE ((uint32_t)0x0080) /*!<Auto-reload preload enable */
  5992. #define TIM_CR1_CKD ((uint32_t)0x0300) /*!<CKD[1:0] bits (clock division) */
  5993. #define TIM_CR1_CKD_0 ((uint32_t)0x0100) /*!<Bit 0 */
  5994. #define TIM_CR1_CKD_1 ((uint32_t)0x0200) /*!<Bit 1 */
  5995. /******************* Bit definition for TIM_CR2 register ********************/
  5996. #define TIM_CR2_CCPC ((uint32_t)0x0001) /*!<Capture/Compare Preloaded Control */
  5997. #define TIM_CR2_CCUS ((uint32_t)0x0004) /*!<Capture/Compare Control Update Selection */
  5998. #define TIM_CR2_CCDS ((uint32_t)0x0008) /*!<Capture/Compare DMA Selection */
  5999. #define TIM_CR2_MMS ((uint32_t)0x0070) /*!<MMS[2:0] bits (Master Mode Selection) */
  6000. #define TIM_CR2_MMS_0 ((uint32_t)0x0010) /*!<Bit 0 */
  6001. #define TIM_CR2_MMS_1 ((uint32_t)0x0020) /*!<Bit 1 */
  6002. #define TIM_CR2_MMS_2 ((uint32_t)0x0040) /*!<Bit 2 */
  6003. #define TIM_CR2_TI1S ((uint32_t)0x0080) /*!<TI1 Selection */
  6004. #define TIM_CR2_OIS1 ((uint32_t)0x0100) /*!<Output Idle state 1 (OC1 output) */
  6005. #define TIM_CR2_OIS1N ((uint32_t)0x0200) /*!<Output Idle state 1 (OC1N output) */
  6006. #define TIM_CR2_OIS2 ((uint32_t)0x0400) /*!<Output Idle state 2 (OC2 output) */
  6007. #define TIM_CR2_OIS2N ((uint32_t)0x0800) /*!<Output Idle state 2 (OC2N output) */
  6008. #define TIM_CR2_OIS3 ((uint32_t)0x1000) /*!<Output Idle state 3 (OC3 output) */
  6009. #define TIM_CR2_OIS3N ((uint32_t)0x2000) /*!<Output Idle state 3 (OC3N output) */
  6010. #define TIM_CR2_OIS4 ((uint32_t)0x4000) /*!<Output Idle state 4 (OC4 output) */
  6011. /******************* Bit definition for TIM_SMCR register *******************/
  6012. #define TIM_SMCR_SMS ((uint32_t)0x0007) /*!<SMS[2:0] bits (Slave mode selection) */
  6013. #define TIM_SMCR_SMS_0 ((uint32_t)0x0001) /*!<Bit 0 */
  6014. #define TIM_SMCR_SMS_1 ((uint32_t)0x0002) /*!<Bit 1 */
  6015. #define TIM_SMCR_SMS_2 ((uint32_t)0x0004) /*!<Bit 2 */
  6016. #define TIM_SMCR_TS ((uint32_t)0x0070) /*!<TS[2:0] bits (Trigger selection) */
  6017. #define TIM_SMCR_TS_0 ((uint32_t)0x0010) /*!<Bit 0 */
  6018. #define TIM_SMCR_TS_1 ((uint32_t)0x0020) /*!<Bit 1 */
  6019. #define TIM_SMCR_TS_2 ((uint32_t)0x0040) /*!<Bit 2 */
  6020. #define TIM_SMCR_MSM ((uint32_t)0x0080) /*!<Master/slave mode */
  6021. #define TIM_SMCR_ETF ((uint32_t)0x0F00) /*!<ETF[3:0] bits (External trigger filter) */
  6022. #define TIM_SMCR_ETF_0 ((uint32_t)0x0100) /*!<Bit 0 */
  6023. #define TIM_SMCR_ETF_1 ((uint32_t)0x0200) /*!<Bit 1 */
  6024. #define TIM_SMCR_ETF_2 ((uint32_t)0x0400) /*!<Bit 2 */
  6025. #define TIM_SMCR_ETF_3 ((uint32_t)0x0800) /*!<Bit 3 */
  6026. #define TIM_SMCR_ETPS ((uint32_t)0x3000) /*!<ETPS[1:0] bits (External trigger prescaler) */
  6027. #define TIM_SMCR_ETPS_0 ((uint32_t)0x1000) /*!<Bit 0 */
  6028. #define TIM_SMCR_ETPS_1 ((uint32_t)0x2000) /*!<Bit 1 */
  6029. #define TIM_SMCR_ECE ((uint32_t)0x4000) /*!<External clock enable */
  6030. #define TIM_SMCR_ETP ((uint32_t)0x8000) /*!<External trigger polarity */
  6031. /******************* Bit definition for TIM_DIER register *******************/
  6032. #define TIM_DIER_UIE ((uint32_t)0x0001) /*!<Update interrupt enable */
  6033. #define TIM_DIER_CC1IE ((uint32_t)0x0002) /*!<Capture/Compare 1 interrupt enable */
  6034. #define TIM_DIER_CC2IE ((uint32_t)0x0004) /*!<Capture/Compare 2 interrupt enable */
  6035. #define TIM_DIER_CC3IE ((uint32_t)0x0008) /*!<Capture/Compare 3 interrupt enable */
  6036. #define TIM_DIER_CC4IE ((uint32_t)0x0010) /*!<Capture/Compare 4 interrupt enable */
  6037. #define TIM_DIER_COMIE ((uint32_t)0x0020) /*!<COM interrupt enable */
  6038. #define TIM_DIER_TIE ((uint32_t)0x0040) /*!<Trigger interrupt enable */
  6039. #define TIM_DIER_BIE ((uint32_t)0x0080) /*!<Break interrupt enable */
  6040. #define TIM_DIER_UDE ((uint32_t)0x0100) /*!<Update DMA request enable */
  6041. #define TIM_DIER_CC1DE ((uint32_t)0x0200) /*!<Capture/Compare 1 DMA request enable */
  6042. #define TIM_DIER_CC2DE ((uint32_t)0x0400) /*!<Capture/Compare 2 DMA request enable */
  6043. #define TIM_DIER_CC3DE ((uint32_t)0x0800) /*!<Capture/Compare 3 DMA request enable */
  6044. #define TIM_DIER_CC4DE ((uint32_t)0x1000) /*!<Capture/Compare 4 DMA request enable */
  6045. #define TIM_DIER_COMDE ((uint32_t)0x2000) /*!<COM DMA request enable */
  6046. #define TIM_DIER_TDE ((uint32_t)0x4000) /*!<Trigger DMA request enable */
  6047. /******************** Bit definition for TIM_SR register ********************/
  6048. #define TIM_SR_UIF ((uint32_t)0x0001) /*!<Update interrupt Flag */
  6049. #define TIM_SR_CC1IF ((uint32_t)0x0002) /*!<Capture/Compare 1 interrupt Flag */
  6050. #define TIM_SR_CC2IF ((uint32_t)0x0004) /*!<Capture/Compare 2 interrupt Flag */
  6051. #define TIM_SR_CC3IF ((uint32_t)0x0008) /*!<Capture/Compare 3 interrupt Flag */
  6052. #define TIM_SR_CC4IF ((uint32_t)0x0010) /*!<Capture/Compare 4 interrupt Flag */
  6053. #define TIM_SR_COMIF ((uint32_t)0x0020) /*!<COM interrupt Flag */
  6054. #define TIM_SR_TIF ((uint32_t)0x0040) /*!<Trigger interrupt Flag */
  6055. #define TIM_SR_BIF ((uint32_t)0x0080) /*!<Break interrupt Flag */
  6056. #define TIM_SR_CC1OF ((uint32_t)0x0200) /*!<Capture/Compare 1 Overcapture Flag */
  6057. #define TIM_SR_CC2OF ((uint32_t)0x0400) /*!<Capture/Compare 2 Overcapture Flag */
  6058. #define TIM_SR_CC3OF ((uint32_t)0x0800) /*!<Capture/Compare 3 Overcapture Flag */
  6059. #define TIM_SR_CC4OF ((uint32_t)0x1000) /*!<Capture/Compare 4 Overcapture Flag */
  6060. /******************* Bit definition for TIM_EGR register ********************/
  6061. #define TIM_EGR_UG ((uint32_t)0x01) /*!<Update Generation */
  6062. #define TIM_EGR_CC1G ((uint32_t)0x02) /*!<Capture/Compare 1 Generation */
  6063. #define TIM_EGR_CC2G ((uint32_t)0x04) /*!<Capture/Compare 2 Generation */
  6064. #define TIM_EGR_CC3G ((uint32_t)0x08) /*!<Capture/Compare 3 Generation */
  6065. #define TIM_EGR_CC4G ((uint32_t)0x10) /*!<Capture/Compare 4 Generation */
  6066. #define TIM_EGR_COMG ((uint32_t)0x20) /*!<Capture/Compare Control Update Generation */
  6067. #define TIM_EGR_TG ((uint32_t)0x40) /*!<Trigger Generation */
  6068. #define TIM_EGR_BG ((uint32_t)0x80) /*!<Break Generation */
  6069. /****************** Bit definition for TIM_CCMR1 register *******************/
  6070. #define TIM_CCMR1_CC1S ((uint32_t)0x0003) /*!<CC1S[1:0] bits (Capture/Compare 1 Selection) */
  6071. #define TIM_CCMR1_CC1S_0 ((uint32_t)0x0001) /*!<Bit 0 */
  6072. #define TIM_CCMR1_CC1S_1 ((uint32_t)0x0002) /*!<Bit 1 */
  6073. #define TIM_CCMR1_OC1FE ((uint32_t)0x0004) /*!<Output Compare 1 Fast enable */
  6074. #define TIM_CCMR1_OC1PE ((uint32_t)0x0008) /*!<Output Compare 1 Preload enable */
  6075. #define TIM_CCMR1_OC1M ((uint32_t)0x0070) /*!<OC1M[2:0] bits (Output Compare 1 Mode) */
  6076. #define TIM_CCMR1_OC1M_0 ((uint32_t)0x0010) /*!<Bit 0 */
  6077. #define TIM_CCMR1_OC1M_1 ((uint32_t)0x0020) /*!<Bit 1 */
  6078. #define TIM_CCMR1_OC1M_2 ((uint32_t)0x0040) /*!<Bit 2 */
  6079. #define TIM_CCMR1_OC1CE ((uint32_t)0x0080) /*!<Output Compare 1Clear Enable */
  6080. #define TIM_CCMR1_CC2S ((uint32_t)0x0300) /*!<CC2S[1:0] bits (Capture/Compare 2 Selection) */
  6081. #define TIM_CCMR1_CC2S_0 ((uint32_t)0x0100) /*!<Bit 0 */
  6082. #define TIM_CCMR1_CC2S_1 ((uint32_t)0x0200) /*!<Bit 1 */
  6083. #define TIM_CCMR1_OC2FE ((uint32_t)0x0400) /*!<Output Compare 2 Fast enable */
  6084. #define TIM_CCMR1_OC2PE ((uint32_t)0x0800) /*!<Output Compare 2 Preload enable */
  6085. #define TIM_CCMR1_OC2M ((uint32_t)0x7000) /*!<OC2M[2:0] bits (Output Compare 2 Mode) */
  6086. #define TIM_CCMR1_OC2M_0 ((uint32_t)0x1000) /*!<Bit 0 */
  6087. #define TIM_CCMR1_OC2M_1 ((uint32_t)0x2000) /*!<Bit 1 */
  6088. #define TIM_CCMR1_OC2M_2 ((uint32_t)0x4000) /*!<Bit 2 */
  6089. #define TIM_CCMR1_OC2CE ((uint32_t)0x8000) /*!<Output Compare 2 Clear Enable */
  6090. /*----------------------------------------------------------------------------*/
  6091. #define TIM_CCMR1_IC1PSC ((uint32_t)0x000C) /*!<IC1PSC[1:0] bits (Input Capture 1 Prescaler) */
  6092. #define TIM_CCMR1_IC1PSC_0 ((uint32_t)0x0004) /*!<Bit 0 */
  6093. #define TIM_CCMR1_IC1PSC_1 ((uint32_t)0x0008) /*!<Bit 1 */
  6094. #define TIM_CCMR1_IC1F ((uint32_t)0x00F0) /*!<IC1F[3:0] bits (Input Capture 1 Filter) */
  6095. #define TIM_CCMR1_IC1F_0 ((uint32_t)0x0010) /*!<Bit 0 */
  6096. #define TIM_CCMR1_IC1F_1 ((uint32_t)0x0020) /*!<Bit 1 */
  6097. #define TIM_CCMR1_IC1F_2 ((uint32_t)0x0040) /*!<Bit 2 */
  6098. #define TIM_CCMR1_IC1F_3 ((uint32_t)0x0080) /*!<Bit 3 */
  6099. #define TIM_CCMR1_IC2PSC ((uint32_t)0x0C00) /*!<IC2PSC[1:0] bits (Input Capture 2 Prescaler) */
  6100. #define TIM_CCMR1_IC2PSC_0 ((uint32_t)0x0400) /*!<Bit 0 */
  6101. #define TIM_CCMR1_IC2PSC_1 ((uint32_t)0x0800) /*!<Bit 1 */
  6102. #define TIM_CCMR1_IC2F ((uint32_t)0xF000) /*!<IC2F[3:0] bits (Input Capture 2 Filter) */
  6103. #define TIM_CCMR1_IC2F_0 ((uint32_t)0x1000) /*!<Bit 0 */
  6104. #define TIM_CCMR1_IC2F_1 ((uint32_t)0x2000) /*!<Bit 1 */
  6105. #define TIM_CCMR1_IC2F_2 ((uint32_t)0x4000) /*!<Bit 2 */
  6106. #define TIM_CCMR1_IC2F_3 ((uint32_t)0x8000) /*!<Bit 3 */
  6107. /****************** Bit definition for TIM_CCMR2 register *******************/
  6108. #define TIM_CCMR2_CC3S ((uint32_t)0x0003) /*!<CC3S[1:0] bits (Capture/Compare 3 Selection) */
  6109. #define TIM_CCMR2_CC3S_0 ((uint32_t)0x0001) /*!<Bit 0 */
  6110. #define TIM_CCMR2_CC3S_1 ((uint32_t)0x0002) /*!<Bit 1 */
  6111. #define TIM_CCMR2_OC3FE ((uint32_t)0x0004) /*!<Output Compare 3 Fast enable */
  6112. #define TIM_CCMR2_OC3PE ((uint32_t)0x0008) /*!<Output Compare 3 Preload enable */
  6113. #define TIM_CCMR2_OC3M ((uint32_t)0x0070) /*!<OC3M[2:0] bits (Output Compare 3 Mode) */
  6114. #define TIM_CCMR2_OC3M_0 ((uint32_t)0x0010) /*!<Bit 0 */
  6115. #define TIM_CCMR2_OC3M_1 ((uint32_t)0x0020) /*!<Bit 1 */
  6116. #define TIM_CCMR2_OC3M_2 ((uint32_t)0x0040) /*!<Bit 2 */
  6117. #define TIM_CCMR2_OC3CE ((uint32_t)0x0080) /*!<Output Compare 3 Clear Enable */
  6118. #define TIM_CCMR2_CC4S ((uint32_t)0x0300) /*!<CC4S[1:0] bits (Capture/Compare 4 Selection) */
  6119. #define TIM_CCMR2_CC4S_0 ((uint32_t)0x0100) /*!<Bit 0 */
  6120. #define TIM_CCMR2_CC4S_1 ((uint32_t)0x0200) /*!<Bit 1 */
  6121. #define TIM_CCMR2_OC4FE ((uint32_t)0x0400) /*!<Output Compare 4 Fast enable */
  6122. #define TIM_CCMR2_OC4PE ((uint32_t)0x0800) /*!<Output Compare 4 Preload enable */
  6123. #define TIM_CCMR2_OC4M ((uint32_t)0x7000) /*!<OC4M[2:0] bits (Output Compare 4 Mode) */
  6124. #define TIM_CCMR2_OC4M_0 ((uint32_t)0x1000) /*!<Bit 0 */
  6125. #define TIM_CCMR2_OC4M_1 ((uint32_t)0x2000) /*!<Bit 1 */
  6126. #define TIM_CCMR2_OC4M_2 ((uint32_t)0x4000) /*!<Bit 2 */
  6127. #define TIM_CCMR2_OC4CE ((uint32_t)0x8000) /*!<Output Compare 4 Clear Enable */
  6128. /*----------------------------------------------------------------------------*/
  6129. #define TIM_CCMR2_IC3PSC ((uint32_t)0x000C) /*!<IC3PSC[1:0] bits (Input Capture 3 Prescaler) */
  6130. #define TIM_CCMR2_IC3PSC_0 ((uint32_t)0x0004) /*!<Bit 0 */
  6131. #define TIM_CCMR2_IC3PSC_1 ((uint32_t)0x0008) /*!<Bit 1 */
  6132. #define TIM_CCMR2_IC3F ((uint32_t)0x00F0) /*!<IC3F[3:0] bits (Input Capture 3 Filter) */
  6133. #define TIM_CCMR2_IC3F_0 ((uint32_t)0x0010) /*!<Bit 0 */
  6134. #define TIM_CCMR2_IC3F_1 ((uint32_t)0x0020) /*!<Bit 1 */
  6135. #define TIM_CCMR2_IC3F_2 ((uint32_t)0x0040) /*!<Bit 2 */
  6136. #define TIM_CCMR2_IC3F_3 ((uint32_t)0x0080) /*!<Bit 3 */
  6137. #define TIM_CCMR2_IC4PSC ((uint32_t)0x0C00) /*!<IC4PSC[1:0] bits (Input Capture 4 Prescaler) */
  6138. #define TIM_CCMR2_IC4PSC_0 ((uint32_t)0x0400) /*!<Bit 0 */
  6139. #define TIM_CCMR2_IC4PSC_1 ((uint32_t)0x0800) /*!<Bit 1 */
  6140. #define TIM_CCMR2_IC4F ((uint32_t)0xF000) /*!<IC4F[3:0] bits (Input Capture 4 Filter) */
  6141. #define TIM_CCMR2_IC4F_0 ((uint32_t)0x1000) /*!<Bit 0 */
  6142. #define TIM_CCMR2_IC4F_1 ((uint32_t)0x2000) /*!<Bit 1 */
  6143. #define TIM_CCMR2_IC4F_2 ((uint32_t)0x4000) /*!<Bit 2 */
  6144. #define TIM_CCMR2_IC4F_3 ((uint32_t)0x8000) /*!<Bit 3 */
  6145. /******************* Bit definition for TIM_CCER register *******************/
  6146. #define TIM_CCER_CC1E ((uint32_t)0x0001) /*!<Capture/Compare 1 output enable */
  6147. #define TIM_CCER_CC1P ((uint32_t)0x0002) /*!<Capture/Compare 1 output Polarity */
  6148. #define TIM_CCER_CC1NE ((uint32_t)0x0004) /*!<Capture/Compare 1 Complementary output enable */
  6149. #define TIM_CCER_CC1NP ((uint32_t)0x0008) /*!<Capture/Compare 1 Complementary output Polarity */
  6150. #define TIM_CCER_CC2E ((uint32_t)0x0010) /*!<Capture/Compare 2 output enable */
  6151. #define TIM_CCER_CC2P ((uint32_t)0x0020) /*!<Capture/Compare 2 output Polarity */
  6152. #define TIM_CCER_CC2NE ((uint32_t)0x0040) /*!<Capture/Compare 2 Complementary output enable */
  6153. #define TIM_CCER_CC2NP ((uint32_t)0x0080) /*!<Capture/Compare 2 Complementary output Polarity */
  6154. #define TIM_CCER_CC3E ((uint32_t)0x0100) /*!<Capture/Compare 3 output enable */
  6155. #define TIM_CCER_CC3P ((uint32_t)0x0200) /*!<Capture/Compare 3 output Polarity */
  6156. #define TIM_CCER_CC3NE ((uint32_t)0x0400) /*!<Capture/Compare 3 Complementary output enable */
  6157. #define TIM_CCER_CC3NP ((uint32_t)0x0800) /*!<Capture/Compare 3 Complementary output Polarity */
  6158. #define TIM_CCER_CC4E ((uint32_t)0x1000) /*!<Capture/Compare 4 output enable */
  6159. #define TIM_CCER_CC4P ((uint32_t)0x2000) /*!<Capture/Compare 4 output Polarity */
  6160. #define TIM_CCER_CC4NP ((uint32_t)0x8000) /*!<Capture/Compare 4 Complementary output Polarity */
  6161. /******************* Bit definition for TIM_CNT register ********************/
  6162. #define TIM_CNT_CNT ((uint32_t)0xFFFF) /*!<Counter Value */
  6163. /******************* Bit definition for TIM_PSC register ********************/
  6164. #define TIM_PSC_PSC ((uint32_t)0xFFFF) /*!<Prescaler Value */
  6165. /******************* Bit definition for TIM_ARR register ********************/
  6166. #define TIM_ARR_ARR ((uint32_t)0xFFFF) /*!<actual auto-reload Value */
  6167. /******************* Bit definition for TIM_RCR register ********************/
  6168. #define TIM_RCR_REP ((uint32_t)0xFF) /*!<Repetition Counter Value */
  6169. /******************* Bit definition for TIM_CCR1 register *******************/
  6170. #define TIM_CCR1_CCR1 ((uint32_t)0xFFFF) /*!<Capture/Compare 1 Value */
  6171. /******************* Bit definition for TIM_CCR2 register *******************/
  6172. #define TIM_CCR2_CCR2 ((uint32_t)0xFFFF) /*!<Capture/Compare 2 Value */
  6173. /******************* Bit definition for TIM_CCR3 register *******************/
  6174. #define TIM_CCR3_CCR3 ((uint32_t)0xFFFF) /*!<Capture/Compare 3 Value */
  6175. /******************* Bit definition for TIM_CCR4 register *******************/
  6176. #define TIM_CCR4_CCR4 ((uint32_t)0xFFFF) /*!<Capture/Compare 4 Value */
  6177. /******************* Bit definition for TIM_BDTR register *******************/
  6178. #define TIM_BDTR_DTG ((uint32_t)0x00FF) /*!<DTG[0:7] bits (Dead-Time Generator set-up) */
  6179. #define TIM_BDTR_DTG_0 ((uint32_t)0x0001) /*!<Bit 0 */
  6180. #define TIM_BDTR_DTG_1 ((uint32_t)0x0002) /*!<Bit 1 */
  6181. #define TIM_BDTR_DTG_2 ((uint32_t)0x0004) /*!<Bit 2 */
  6182. #define TIM_BDTR_DTG_3 ((uint32_t)0x0008) /*!<Bit 3 */
  6183. #define TIM_BDTR_DTG_4 ((uint32_t)0x0010) /*!<Bit 4 */
  6184. #define TIM_BDTR_DTG_5 ((uint32_t)0x0020) /*!<Bit 5 */
  6185. #define TIM_BDTR_DTG_6 ((uint32_t)0x0040) /*!<Bit 6 */
  6186. #define TIM_BDTR_DTG_7 ((uint32_t)0x0080) /*!<Bit 7 */
  6187. #define TIM_BDTR_LOCK ((uint32_t)0x0300) /*!<LOCK[1:0] bits (Lock Configuration) */
  6188. #define TIM_BDTR_LOCK_0 ((uint32_t)0x0100) /*!<Bit 0 */
  6189. #define TIM_BDTR_LOCK_1 ((uint32_t)0x0200) /*!<Bit 1 */
  6190. #define TIM_BDTR_OSSI ((uint32_t)0x0400) /*!<Off-State Selection for Idle mode */
  6191. #define TIM_BDTR_OSSR ((uint32_t)0x0800) /*!<Off-State Selection for Run mode */
  6192. #define TIM_BDTR_BKE ((uint32_t)0x1000) /*!<Break enable */
  6193. #define TIM_BDTR_BKP ((uint32_t)0x2000) /*!<Break Polarity */
  6194. #define TIM_BDTR_AOE ((uint32_t)0x4000) /*!<Automatic Output enable */
  6195. #define TIM_BDTR_MOE ((uint32_t)0x8000) /*!<Main Output enable */
  6196. /******************* Bit definition for TIM_DCR register ********************/
  6197. #define TIM_DCR_DBA ((uint32_t)0x001F) /*!<DBA[4:0] bits (DMA Base Address) */
  6198. #define TIM_DCR_DBA_0 ((uint32_t)0x0001) /*!<Bit 0 */
  6199. #define TIM_DCR_DBA_1 ((uint32_t)0x0002) /*!<Bit 1 */
  6200. #define TIM_DCR_DBA_2 ((uint32_t)0x0004) /*!<Bit 2 */
  6201. #define TIM_DCR_DBA_3 ((uint32_t)0x0008) /*!<Bit 3 */
  6202. #define TIM_DCR_DBA_4 ((uint32_t)0x0010) /*!<Bit 4 */
  6203. #define TIM_DCR_DBL ((uint32_t)0x1F00) /*!<DBL[4:0] bits (DMA Burst Length) */
  6204. #define TIM_DCR_DBL_0 ((uint32_t)0x0100) /*!<Bit 0 */
  6205. #define TIM_DCR_DBL_1 ((uint32_t)0x0200) /*!<Bit 1 */
  6206. #define TIM_DCR_DBL_2 ((uint32_t)0x0400) /*!<Bit 2 */
  6207. #define TIM_DCR_DBL_3 ((uint32_t)0x0800) /*!<Bit 3 */
  6208. #define TIM_DCR_DBL_4 ((uint32_t)0x1000) /*!<Bit 4 */
  6209. /******************* Bit definition for TIM_DMAR register *******************/
  6210. #define TIM_DMAR_DMAB ((uint32_t)0xFFFF) /*!<DMA register for burst accesses */
  6211. /******************* Bit definition for TIM_OR register *********************/
  6212. #define TIM_OR_TI4_RMP ((uint32_t)0x00C0) /*!<TI4_RMP[1:0] bits (TIM5 Input 4 remap) */
  6213. #define TIM_OR_TI4_RMP_0 ((uint32_t)0x0040) /*!<Bit 0 */
  6214. #define TIM_OR_TI4_RMP_1 ((uint32_t)0x0080) /*!<Bit 1 */
  6215. #define TIM_OR_ITR1_RMP ((uint32_t)0x0C00) /*!<ITR1_RMP[1:0] bits (TIM2 Internal trigger 1 remap) */
  6216. #define TIM_OR_ITR1_RMP_0 ((uint32_t)0x0400) /*!<Bit 0 */
  6217. #define TIM_OR_ITR1_RMP_1 ((uint32_t)0x0800) /*!<Bit 1 */
  6218. /******************************************************************************/
  6219. /* */
  6220. /* Universal Synchronous Asynchronous Receiver Transmitter */
  6221. /* */
  6222. /******************************************************************************/
  6223. /******************* Bit definition for USART_SR register *******************/
  6224. #define USART_SR_PE ((uint32_t)0x0001) /*!<Parity Error */
  6225. #define USART_SR_FE ((uint32_t)0x0002) /*!<Framing Error */
  6226. #define USART_SR_NE ((uint32_t)0x0004) /*!<Noise Error Flag */
  6227. #define USART_SR_ORE ((uint32_t)0x0008) /*!<OverRun Error */
  6228. #define USART_SR_IDLE ((uint32_t)0x0010) /*!<IDLE line detected */
  6229. #define USART_SR_RXNE ((uint32_t)0x0020) /*!<Read Data Register Not Empty */
  6230. #define USART_SR_TC ((uint32_t)0x0040) /*!<Transmission Complete */
  6231. #define USART_SR_TXE ((uint32_t)0x0080) /*!<Transmit Data Register Empty */
  6232. #define USART_SR_LBD ((uint32_t)0x0100) /*!<LIN Break Detection Flag */
  6233. #define USART_SR_CTS ((uint32_t)0x0200) /*!<CTS Flag */
  6234. /******************* Bit definition for USART_DR register *******************/
  6235. #define USART_DR_DR ((uint32_t)0x01FF) /*!<Data value */
  6236. /****************** Bit definition for USART_BRR register *******************/
  6237. #define USART_BRR_DIV_Fraction ((uint32_t)0x000F) /*!<Fraction of USARTDIV */
  6238. #define USART_BRR_DIV_Mantissa ((uint32_t)0xFFF0) /*!<Mantissa of USARTDIV */
  6239. /****************** Bit definition for USART_CR1 register *******************/
  6240. #define USART_CR1_SBK ((uint32_t)0x0001) /*!<Send Break */
  6241. #define USART_CR1_RWU ((uint32_t)0x0002) /*!<Receiver wakeup */
  6242. #define USART_CR1_RE ((uint32_t)0x0004) /*!<Receiver Enable */
  6243. #define USART_CR1_TE ((uint32_t)0x0008) /*!<Transmitter Enable */
  6244. #define USART_CR1_IDLEIE ((uint32_t)0x0010) /*!<IDLE Interrupt Enable */
  6245. #define USART_CR1_RXNEIE ((uint32_t)0x0020) /*!<RXNE Interrupt Enable */
  6246. #define USART_CR1_TCIE ((uint32_t)0x0040) /*!<Transmission Complete Interrupt Enable */
  6247. #define USART_CR1_TXEIE ((uint32_t)0x0080) /*!<PE Interrupt Enable */
  6248. #define USART_CR1_PEIE ((uint32_t)0x0100) /*!<PE Interrupt Enable */
  6249. #define USART_CR1_PS ((uint32_t)0x0200) /*!<Parity Selection */
  6250. #define USART_CR1_PCE ((uint32_t)0x0400) /*!<Parity Control Enable */
  6251. #define USART_CR1_WAKE ((uint32_t)0x0800) /*!<Wakeup method */
  6252. #define USART_CR1_M ((uint32_t)0x1000) /*!<Word length */
  6253. #define USART_CR1_UE ((uint32_t)0x2000) /*!<USART Enable */
  6254. #define USART_CR1_OVER8 ((uint32_t)0x8000) /*!<USART Oversampling by 8 enable */
  6255. /****************** Bit definition for USART_CR2 register *******************/
  6256. #define USART_CR2_ADD ((uint32_t)0x000F) /*!<Address of the USART node */
  6257. #define USART_CR2_LBDL ((uint32_t)0x0020) /*!<LIN Break Detection Length */
  6258. #define USART_CR2_LBDIE ((uint32_t)0x0040) /*!<LIN Break Detection Interrupt Enable */
  6259. #define USART_CR2_LBCL ((uint32_t)0x0100) /*!<Last Bit Clock pulse */
  6260. #define USART_CR2_CPHA ((uint32_t)0x0200) /*!<Clock Phase */
  6261. #define USART_CR2_CPOL ((uint32_t)0x0400) /*!<Clock Polarity */
  6262. #define USART_CR2_CLKEN ((uint32_t)0x0800) /*!<Clock Enable */
  6263. #define USART_CR2_STOP ((uint32_t)0x3000) /*!<STOP[1:0] bits (STOP bits) */
  6264. #define USART_CR2_STOP_0 ((uint32_t)0x1000) /*!<Bit 0 */
  6265. #define USART_CR2_STOP_1 ((uint32_t)0x2000) /*!<Bit 1 */
  6266. #define USART_CR2_LINEN ((uint32_t)0x4000) /*!<LIN mode enable */
  6267. /****************** Bit definition for USART_CR3 register *******************/
  6268. #define USART_CR3_EIE ((uint32_t)0x0001) /*!<Error Interrupt Enable */
  6269. #define USART_CR3_IREN ((uint32_t)0x0002) /*!<IrDA mode Enable */
  6270. #define USART_CR3_IRLP ((uint32_t)0x0004) /*!<IrDA Low-Power */
  6271. #define USART_CR3_HDSEL ((uint32_t)0x0008) /*!<Half-Duplex Selection */
  6272. #define USART_CR3_NACK ((uint32_t)0x0010) /*!<Smartcard NACK enable */
  6273. #define USART_CR3_SCEN ((uint32_t)0x0020) /*!<Smartcard mode enable */
  6274. #define USART_CR3_DMAR ((uint32_t)0x0040) /*!<DMA Enable Receiver */
  6275. #define USART_CR3_DMAT ((uint32_t)0x0080) /*!<DMA Enable Transmitter */
  6276. #define USART_CR3_RTSE ((uint32_t)0x0100) /*!<RTS Enable */
  6277. #define USART_CR3_CTSE ((uint32_t)0x0200) /*!<CTS Enable */
  6278. #define USART_CR3_CTSIE ((uint32_t)0x0400) /*!<CTS Interrupt Enable */
  6279. #define USART_CR3_ONEBIT ((uint32_t)0x0800) /*!<USART One bit method enable */
  6280. /****************** Bit definition for USART_GTPR register ******************/
  6281. #define USART_GTPR_PSC ((uint32_t)0x00FF) /*!<PSC[7:0] bits (Prescaler value) */
  6282. #define USART_GTPR_PSC_0 ((uint32_t)0x0001) /*!<Bit 0 */
  6283. #define USART_GTPR_PSC_1 ((uint32_t)0x0002) /*!<Bit 1 */
  6284. #define USART_GTPR_PSC_2 ((uint32_t)0x0004) /*!<Bit 2 */
  6285. #define USART_GTPR_PSC_3 ((uint32_t)0x0008) /*!<Bit 3 */
  6286. #define USART_GTPR_PSC_4 ((uint32_t)0x0010) /*!<Bit 4 */
  6287. #define USART_GTPR_PSC_5 ((uint32_t)0x0020) /*!<Bit 5 */
  6288. #define USART_GTPR_PSC_6 ((uint32_t)0x0040) /*!<Bit 6 */
  6289. #define USART_GTPR_PSC_7 ((uint32_t)0x0080) /*!<Bit 7 */
  6290. #define USART_GTPR_GT ((uint32_t)0xFF00) /*!<Guard time value */
  6291. /******************************************************************************/
  6292. /* */
  6293. /* Window WATCHDOG */
  6294. /* */
  6295. /******************************************************************************/
  6296. /******************* Bit definition for WWDG_CR register ********************/
  6297. #define WWDG_CR_T ((uint32_t)0x7F) /*!<T[6:0] bits (7-Bit counter (MSB to LSB)) */
  6298. #define WWDG_CR_T0 ((uint32_t)0x01) /*!<Bit 0 */
  6299. #define WWDG_CR_T1 ((uint32_t)0x02) /*!<Bit 1 */
  6300. #define WWDG_CR_T2 ((uint32_t)0x04) /*!<Bit 2 */
  6301. #define WWDG_CR_T3 ((uint32_t)0x08) /*!<Bit 3 */
  6302. #define WWDG_CR_T4 ((uint32_t)0x10) /*!<Bit 4 */
  6303. #define WWDG_CR_T5 ((uint32_t)0x20) /*!<Bit 5 */
  6304. #define WWDG_CR_T6 ((uint32_t)0x40) /*!<Bit 6 */
  6305. #define WWDG_CR_WDGA ((uint32_t)0x80) /*!<Activation bit */
  6306. /******************* Bit definition for WWDG_CFR register *******************/
  6307. #define WWDG_CFR_W ((uint32_t)0x007F) /*!<W[6:0] bits (7-bit window value) */
  6308. #define WWDG_CFR_W0 ((uint32_t)0x0001) /*!<Bit 0 */
  6309. #define WWDG_CFR_W1 ((uint32_t)0x0002) /*!<Bit 1 */
  6310. #define WWDG_CFR_W2 ((uint32_t)0x0004) /*!<Bit 2 */
  6311. #define WWDG_CFR_W3 ((uint32_t)0x0008) /*!<Bit 3 */
  6312. #define WWDG_CFR_W4 ((uint32_t)0x0010) /*!<Bit 4 */
  6313. #define WWDG_CFR_W5 ((uint32_t)0x0020) /*!<Bit 5 */
  6314. #define WWDG_CFR_W6 ((uint32_t)0x0040) /*!<Bit 6 */
  6315. #define WWDG_CFR_WDGTB ((uint32_t)0x0180) /*!<WDGTB[1:0] bits (Timer Base) */
  6316. #define WWDG_CFR_WDGTB0 ((uint32_t)0x0080) /*!<Bit 0 */
  6317. #define WWDG_CFR_WDGTB1 ((uint32_t)0x0100) /*!<Bit 1 */
  6318. #define WWDG_CFR_EWI ((uint32_t)0x0200) /*!<Early Wakeup Interrupt */
  6319. /******************* Bit definition for WWDG_SR register ********************/
  6320. #define WWDG_SR_EWIF ((uint32_t)0x01) /*!<Early Wakeup Interrupt Flag */
  6321. /******************************************************************************/
  6322. /* */
  6323. /* DBG */
  6324. /* */
  6325. /******************************************************************************/
  6326. /******************** Bit definition for DBGMCU_IDCODE register *************/
  6327. #define DBGMCU_IDCODE_DEV_ID ((uint32_t)0x00000FFF)
  6328. #define DBGMCU_IDCODE_REV_ID ((uint32_t)0xFFFF0000)
  6329. /******************** Bit definition for DBGMCU_CR register *****************/
  6330. #define DBGMCU_CR_DBG_SLEEP ((uint32_t)0x00000001)
  6331. #define DBGMCU_CR_DBG_STOP ((uint32_t)0x00000002)
  6332. #define DBGMCU_CR_DBG_STANDBY ((uint32_t)0x00000004)
  6333. #define DBGMCU_CR_TRACE_IOEN ((uint32_t)0x00000020)
  6334. #define DBGMCU_CR_TRACE_MODE ((uint32_t)0x000000C0)
  6335. #define DBGMCU_CR_TRACE_MODE_0 ((uint32_t)0x00000040)/*!<Bit 0 */
  6336. #define DBGMCU_CR_TRACE_MODE_1 ((uint32_t)0x00000080)/*!<Bit 1 */
  6337. /******************** Bit definition for DBGMCU_APB1_FZ register ************/
  6338. #define DBGMCU_APB1_FZ_DBG_TIM2_STOP ((uint32_t)0x00000001)
  6339. #define DBGMCU_APB1_FZ_DBG_TIM3_STOP ((uint32_t)0x00000002)
  6340. #define DBGMCU_APB1_FZ_DBG_TIM4_STOP ((uint32_t)0x00000004)
  6341. #define DBGMCU_APB1_FZ_DBG_TIM5_STOP ((uint32_t)0x00000008)
  6342. #define DBGMCU_APB1_FZ_DBG_TIM6_STOP ((uint32_t)0x00000010)
  6343. #define DBGMCU_APB1_FZ_DBG_TIM7_STOP ((uint32_t)0x00000020)
  6344. #define DBGMCU_APB1_FZ_DBG_TIM12_STOP ((uint32_t)0x00000040)
  6345. #define DBGMCU_APB1_FZ_DBG_TIM13_STOP ((uint32_t)0x00000080)
  6346. #define DBGMCU_APB1_FZ_DBG_TIM14_STOP ((uint32_t)0x00000100)
  6347. #define DBGMCU_APB1_FZ_DBG_RTC_STOP ((uint32_t)0x00000400)
  6348. #define DBGMCU_APB1_FZ_DBG_WWDG_STOP ((uint32_t)0x00000800)
  6349. #define DBGMCU_APB1_FZ_DBG_IWDG_STOP ((uint32_t)0x00001000)
  6350. #define DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT ((uint32_t)0x00200000)
  6351. #define DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT ((uint32_t)0x00400000)
  6352. #define DBGMCU_APB1_FZ_DBG_I2C3_SMBUS_TIMEOUT ((uint32_t)0x00800000)
  6353. #define DBGMCU_APB1_FZ_DBG_CAN1_STOP ((uint32_t)0x02000000)
  6354. #define DBGMCU_APB1_FZ_DBG_CAN2_STOP ((uint32_t)0x04000000)
  6355. /* Old IWDGSTOP bit definition, maintained for legacy purpose */
  6356. #define DBGMCU_APB1_FZ_DBG_IWDEG_STOP DBGMCU_APB1_FZ_DBG_IWDG_STOP
  6357. /******************** Bit definition for DBGMCU_APB2_FZ register ************/
  6358. #define DBGMCU_APB2_FZ_DBG_TIM1_STOP ((uint32_t)0x00000001)
  6359. #define DBGMCU_APB2_FZ_DBG_TIM8_STOP ((uint32_t)0x00000002)
  6360. #define DBGMCU_APB2_FZ_DBG_TIM9_STOP ((uint32_t)0x00010000)
  6361. #define DBGMCU_APB2_FZ_DBG_TIM10_STOP ((uint32_t)0x00020000)
  6362. #define DBGMCU_APB2_FZ_DBG_TIM11_STOP ((uint32_t)0x00040000)
  6363. /******************************************************************************/
  6364. /* */
  6365. /* USB_OTG */
  6366. /* */
  6367. /******************************************************************************/
  6368. /******************** Bit definition for USB_OTG_GOTGCTL register ********************/
  6369. #define USB_OTG_GOTGCTL_SRQSCS ((uint32_t)0x00000001) /*!< Session request success */
  6370. #define USB_OTG_GOTGCTL_SRQ ((uint32_t)0x00000002) /*!< Session request */
  6371. #define USB_OTG_GOTGCTL_VBVALOEN ((uint32_t)0x00000004) /*!< VBUS valid override enable */
  6372. #define USB_OTG_GOTGCTL_VBVALOVAL ((uint32_t)0x00000008) /*!< VBUS valid override value */
  6373. #define USB_OTG_GOTGCTL_AVALOEN ((uint32_t)0x00000010) /*!< A-peripheral session valid override enable */
  6374. #define USB_OTG_GOTGCTL_AVALOVAL ((uint32_t)0x00000020) /*!< A-peripheral session valid override value */
  6375. #define USB_OTG_GOTGCTL_BVALOEN ((uint32_t)0x00000040) /*!< B-peripheral session valid override enable */
  6376. #define USB_OTG_GOTGCTL_BVALOVAL ((uint32_t)0x00000080) /*!< B-peripheral session valid override value */
  6377. #define USB_OTG_GOTGCTL_HNGSCS ((uint32_t)0x00000100) /*!< Host set HNP enable */
  6378. #define USB_OTG_GOTGCTL_HNPRQ ((uint32_t)0x00000200) /*!< HNP request */
  6379. #define USB_OTG_GOTGCTL_HSHNPEN ((uint32_t)0x00000400) /*!< Host set HNP enable */
  6380. #define USB_OTG_GOTGCTL_DHNPEN ((uint32_t)0x00000800) /*!< Device HNP enabled */
  6381. #define USB_OTG_GOTGCTL_EHEN ((uint32_t)0x00001000) /*!< Embedded host enable */
  6382. #define USB_OTG_GOTGCTL_CIDSTS ((uint32_t)0x00010000) /*!< Connector ID status */
  6383. #define USB_OTG_GOTGCTL_DBCT ((uint32_t)0x00020000) /*!< Long/short debounce time */
  6384. #define USB_OTG_GOTGCTL_ASVLD ((uint32_t)0x00040000) /*!< A-session valid */
  6385. #define USB_OTG_GOTGCTL_BSESVLD ((uint32_t)0x00080000) /*!< B-session valid */
  6386. #define USB_OTG_GOTGCTL_OTGVER ((uint32_t)0x00100000) /*!< OTG version */
  6387. /******************** Bit definition for USB_OTG_HCFG register ********************/
  6388. #define USB_OTG_HCFG_FSLSPCS ((uint32_t)0x00000003) /*!< FS/LS PHY clock select */
  6389. #define USB_OTG_HCFG_FSLSPCS_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  6390. #define USB_OTG_HCFG_FSLSPCS_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  6391. #define USB_OTG_HCFG_FSLSS ((uint32_t)0x00000004) /*!< FS- and LS-only support */
  6392. /******************** Bit definition for USB_OTG_DCFG register ********************/
  6393. #define USB_OTG_DCFG_DSPD ((uint32_t)0x00000003) /*!< Device speed */
  6394. #define USB_OTG_DCFG_DSPD_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  6395. #define USB_OTG_DCFG_DSPD_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  6396. #define USB_OTG_DCFG_NZLSOHSK ((uint32_t)0x00000004) /*!< Nonzero-length status OUT handshake */
  6397. #define USB_OTG_DCFG_DAD ((uint32_t)0x000007F0) /*!< Device address */
  6398. #define USB_OTG_DCFG_DAD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  6399. #define USB_OTG_DCFG_DAD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  6400. #define USB_OTG_DCFG_DAD_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  6401. #define USB_OTG_DCFG_DAD_3 ((uint32_t)0x00000080) /*!<Bit 3 */
  6402. #define USB_OTG_DCFG_DAD_4 ((uint32_t)0x00000100) /*!<Bit 4 */
  6403. #define USB_OTG_DCFG_DAD_5 ((uint32_t)0x00000200) /*!<Bit 5 */
  6404. #define USB_OTG_DCFG_DAD_6 ((uint32_t)0x00000400) /*!<Bit 6 */
  6405. #define USB_OTG_DCFG_PFIVL ((uint32_t)0x00001800) /*!< Periodic (micro)frame interval */
  6406. #define USB_OTG_DCFG_PFIVL_0 ((uint32_t)0x00000800) /*!<Bit 0 */
  6407. #define USB_OTG_DCFG_PFIVL_1 ((uint32_t)0x00001000) /*!<Bit 1 */
  6408. #define USB_OTG_DCFG_PERSCHIVL ((uint32_t)0x03000000) /*!< Periodic scheduling interval */
  6409. #define USB_OTG_DCFG_PERSCHIVL_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  6410. #define USB_OTG_DCFG_PERSCHIVL_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  6411. /******************** Bit definition for USB_OTG_PCGCR register ********************/
  6412. #define USB_OTG_PCGCR_STPPCLK ((uint32_t)0x00000001) /*!< Stop PHY clock */
  6413. #define USB_OTG_PCGCR_GATEHCLK ((uint32_t)0x00000002) /*!< Gate HCLK */
  6414. #define USB_OTG_PCGCR_PHYSUSP ((uint32_t)0x00000010) /*!< PHY suspended */
  6415. /******************** Bit definition for USB_OTG_GOTGINT register ********************/
  6416. #define USB_OTG_GOTGINT_SEDET ((uint32_t)0x00000004) /*!< Session end detected */
  6417. #define USB_OTG_GOTGINT_SRSSCHG ((uint32_t)0x00000100) /*!< Session request success status change */
  6418. #define USB_OTG_GOTGINT_HNSSCHG ((uint32_t)0x00000200) /*!< Host negotiation success status change */
  6419. #define USB_OTG_GOTGINT_HNGDET ((uint32_t)0x00020000) /*!< Host negotiation detected */
  6420. #define USB_OTG_GOTGINT_ADTOCHG ((uint32_t)0x00040000) /*!< A-device timeout change */
  6421. #define USB_OTG_GOTGINT_DBCDNE ((uint32_t)0x00080000) /*!< Debounce done */
  6422. #define USB_OTG_GOTGINT_IDCHNG ((uint32_t)0x00100000) /*!< Change in ID pin input value */
  6423. /******************** Bit definition for USB_OTG_DCTL register ********************/
  6424. #define USB_OTG_DCTL_RWUSIG ((uint32_t)0x00000001) /*!< Remote wakeup signaling */
  6425. #define USB_OTG_DCTL_SDIS ((uint32_t)0x00000002) /*!< Soft disconnect */
  6426. #define USB_OTG_DCTL_GINSTS ((uint32_t)0x00000004) /*!< Global IN NAK status */
  6427. #define USB_OTG_DCTL_GONSTS ((uint32_t)0x00000008) /*!< Global OUT NAK status */
  6428. #define USB_OTG_DCTL_TCTL ((uint32_t)0x00000070) /*!< Test control */
  6429. #define USB_OTG_DCTL_TCTL_0 ((uint32_t)0x00000010) /*!<Bit 0 */
  6430. #define USB_OTG_DCTL_TCTL_1 ((uint32_t)0x00000020) /*!<Bit 1 */
  6431. #define USB_OTG_DCTL_TCTL_2 ((uint32_t)0x00000040) /*!<Bit 2 */
  6432. #define USB_OTG_DCTL_SGINAK ((uint32_t)0x00000080) /*!< Set global IN NAK */
  6433. #define USB_OTG_DCTL_CGINAK ((uint32_t)0x00000100) /*!< Clear global IN NAK */
  6434. #define USB_OTG_DCTL_SGONAK ((uint32_t)0x00000200) /*!< Set global OUT NAK */
  6435. #define USB_OTG_DCTL_CGONAK ((uint32_t)0x00000400) /*!< Clear global OUT NAK */
  6436. #define USB_OTG_DCTL_POPRGDNE ((uint32_t)0x00000800) /*!< Power-on programming done */
  6437. /******************** Bit definition for USB_OTG_HFIR register ********************/
  6438. #define USB_OTG_HFIR_FRIVL ((uint32_t)0x0000FFFF) /*!< Frame interval */
  6439. /******************** Bit definition for USB_OTG_HFNUM register ********************/
  6440. #define USB_OTG_HFNUM_FRNUM ((uint32_t)0x0000FFFF) /*!< Frame number */
  6441. #define USB_OTG_HFNUM_FTREM ((uint32_t)0xFFFF0000) /*!< Frame time remaining */
  6442. /******************** Bit definition for USB_OTG_DSTS register ********************/
  6443. #define USB_OTG_DSTS_SUSPSTS ((uint32_t)0x00000001) /*!< Suspend status */
  6444. #define USB_OTG_DSTS_ENUMSPD ((uint32_t)0x00000006) /*!< Enumerated speed */
  6445. #define USB_OTG_DSTS_ENUMSPD_0 ((uint32_t)0x00000002) /*!<Bit 0 */
  6446. #define USB_OTG_DSTS_ENUMSPD_1 ((uint32_t)0x00000004) /*!<Bit 1 */
  6447. #define USB_OTG_DSTS_EERR ((uint32_t)0x00000008) /*!< Erratic error */
  6448. #define USB_OTG_DSTS_FNSOF ((uint32_t)0x003FFF00) /*!< Frame number of the received SOF */
  6449. /******************** Bit definition for USB_OTG_GAHBCFG register ********************/
  6450. #define USB_OTG_GAHBCFG_GINT ((uint32_t)0x00000001) /*!< Global interrupt mask */
  6451. #define USB_OTG_GAHBCFG_HBSTLEN ((uint32_t)0x0000001E) /*!< Burst length/type */
  6452. #define USB_OTG_GAHBCFG_HBSTLEN_0 ((uint32_t)0x00000002) /*!<Bit 0 */
  6453. #define USB_OTG_GAHBCFG_HBSTLEN_1 ((uint32_t)0x00000004) /*!<Bit 1 */
  6454. #define USB_OTG_GAHBCFG_HBSTLEN_2 ((uint32_t)0x00000008) /*!<Bit 2 */
  6455. #define USB_OTG_GAHBCFG_HBSTLEN_3 ((uint32_t)0x00000010) /*!<Bit 3 */
  6456. #define USB_OTG_GAHBCFG_DMAEN ((uint32_t)0x00000020) /*!< DMA enable */
  6457. #define USB_OTG_GAHBCFG_TXFELVL ((uint32_t)0x00000080) /*!< TxFIFO empty level */
  6458. #define USB_OTG_GAHBCFG_PTXFELVL ((uint32_t)0x00000100) /*!< Periodic TxFIFO empty level */
  6459. /******************** Bit definition for USB_OTG_GUSBCFG register ********************/
  6460. #define USB_OTG_GUSBCFG_TOCAL ((uint32_t)0x00000007) /*!< FS timeout calibration */
  6461. #define USB_OTG_GUSBCFG_TOCAL_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  6462. #define USB_OTG_GUSBCFG_TOCAL_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  6463. #define USB_OTG_GUSBCFG_TOCAL_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  6464. #define USB_OTG_GUSBCFG_PHYSEL ((uint32_t)0x00000040) /*!< USB 2.0 high-speed ULPI PHY or USB 1.1 full-speed serial transceiver select */
  6465. #define USB_OTG_GUSBCFG_SRPCAP ((uint32_t)0x00000100) /*!< SRP-capable */
  6466. #define USB_OTG_GUSBCFG_HNPCAP ((uint32_t)0x00000200) /*!< HNP-capable */
  6467. #define USB_OTG_GUSBCFG_TRDT ((uint32_t)0x00003C00) /*!< USB turnaround time */
  6468. #define USB_OTG_GUSBCFG_TRDT_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  6469. #define USB_OTG_GUSBCFG_TRDT_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  6470. #define USB_OTG_GUSBCFG_TRDT_2 ((uint32_t)0x00001000) /*!<Bit 2 */
  6471. #define USB_OTG_GUSBCFG_TRDT_3 ((uint32_t)0x00002000) /*!<Bit 3 */
  6472. #define USB_OTG_GUSBCFG_PHYLPCS ((uint32_t)0x00008000) /*!< PHY Low-power clock select */
  6473. #define USB_OTG_GUSBCFG_ULPIFSLS ((uint32_t)0x00020000) /*!< ULPI FS/LS select */
  6474. #define USB_OTG_GUSBCFG_ULPIAR ((uint32_t)0x00040000) /*!< ULPI Auto-resume */
  6475. #define USB_OTG_GUSBCFG_ULPICSM ((uint32_t)0x00080000) /*!< ULPI Clock SuspendM */
  6476. #define USB_OTG_GUSBCFG_ULPIEVBUSD ((uint32_t)0x00100000) /*!< ULPI External VBUS Drive */
  6477. #define USB_OTG_GUSBCFG_ULPIEVBUSI ((uint32_t)0x00200000) /*!< ULPI external VBUS indicator */
  6478. #define USB_OTG_GUSBCFG_TSDPS ((uint32_t)0x00400000) /*!< TermSel DLine pulsing selection */
  6479. #define USB_OTG_GUSBCFG_PCCI ((uint32_t)0x00800000) /*!< Indicator complement */
  6480. #define USB_OTG_GUSBCFG_PTCI ((uint32_t)0x01000000) /*!< Indicator pass through */
  6481. #define USB_OTG_GUSBCFG_ULPIIPD ((uint32_t)0x02000000) /*!< ULPI interface protect disable */
  6482. #define USB_OTG_GUSBCFG_FHMOD ((uint32_t)0x20000000) /*!< Forced host mode */
  6483. #define USB_OTG_GUSBCFG_FDMOD ((uint32_t)0x40000000) /*!< Forced peripheral mode */
  6484. #define USB_OTG_GUSBCFG_CTXPKT ((uint32_t)0x80000000) /*!< Corrupt Tx packet */
  6485. /******************** Bit definition for USB_OTG_GRSTCTL register ********************/
  6486. #define USB_OTG_GRSTCTL_CSRST ((uint32_t)0x00000001) /*!< Core soft reset */
  6487. #define USB_OTG_GRSTCTL_HSRST ((uint32_t)0x00000002) /*!< HCLK soft reset */
  6488. #define USB_OTG_GRSTCTL_FCRST ((uint32_t)0x00000004) /*!< Host frame counter reset */
  6489. #define USB_OTG_GRSTCTL_RXFFLSH ((uint32_t)0x00000010) /*!< RxFIFO flush */
  6490. #define USB_OTG_GRSTCTL_TXFFLSH ((uint32_t)0x00000020) /*!< TxFIFO flush */
  6491. #define USB_OTG_GRSTCTL_TXFNUM ((uint32_t)0x000007C0) /*!< TxFIFO number */
  6492. #define USB_OTG_GRSTCTL_TXFNUM_0 ((uint32_t)0x00000040) /*!<Bit 0 */
  6493. #define USB_OTG_GRSTCTL_TXFNUM_1 ((uint32_t)0x00000080) /*!<Bit 1 */
  6494. #define USB_OTG_GRSTCTL_TXFNUM_2 ((uint32_t)0x00000100) /*!<Bit 2 */
  6495. #define USB_OTG_GRSTCTL_TXFNUM_3 ((uint32_t)0x00000200) /*!<Bit 3 */
  6496. #define USB_OTG_GRSTCTL_TXFNUM_4 ((uint32_t)0x00000400) /*!<Bit 4 */
  6497. #define USB_OTG_GRSTCTL_DMAREQ ((uint32_t)0x40000000) /*!< DMA request signal */
  6498. #define USB_OTG_GRSTCTL_AHBIDL ((uint32_t)0x80000000) /*!< AHB master idle */
  6499. /******************** Bit definition for USB_OTG_DIEPMSK register ********************/
  6500. #define USB_OTG_DIEPMSK_XFRCM ((uint32_t)0x00000001) /*!< Transfer completed interrupt mask */
  6501. #define USB_OTG_DIEPMSK_EPDM ((uint32_t)0x00000002) /*!< Endpoint disabled interrupt mask */
  6502. #define USB_OTG_DIEPMSK_TOM ((uint32_t)0x00000008) /*!< Timeout condition mask (nonisochronous endpoints) */
  6503. #define USB_OTG_DIEPMSK_ITTXFEMSK ((uint32_t)0x00000010) /*!< IN token received when TxFIFO empty mask */
  6504. #define USB_OTG_DIEPMSK_INEPNMM ((uint32_t)0x00000020) /*!< IN token received with EP mismatch mask */
  6505. #define USB_OTG_DIEPMSK_INEPNEM ((uint32_t)0x00000040) /*!< IN endpoint NAK effective mask */
  6506. #define USB_OTG_DIEPMSK_TXFURM ((uint32_t)0x00000100) /*!< FIFO underrun mask */
  6507. #define USB_OTG_DIEPMSK_BIM ((uint32_t)0x00000200) /*!< BNA interrupt mask */
  6508. /******************** Bit definition for USB_OTG_HPTXSTS register ********************/
  6509. #define USB_OTG_HPTXSTS_PTXFSAVL ((uint32_t)0x0000FFFF) /*!< Periodic transmit data FIFO space available */
  6510. #define USB_OTG_HPTXSTS_PTXQSAV ((uint32_t)0x00FF0000) /*!< Periodic transmit request queue space available */
  6511. #define USB_OTG_HPTXSTS_PTXQSAV_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  6512. #define USB_OTG_HPTXSTS_PTXQSAV_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  6513. #define USB_OTG_HPTXSTS_PTXQSAV_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  6514. #define USB_OTG_HPTXSTS_PTXQSAV_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  6515. #define USB_OTG_HPTXSTS_PTXQSAV_4 ((uint32_t)0x00100000) /*!<Bit 4 */
  6516. #define USB_OTG_HPTXSTS_PTXQSAV_5 ((uint32_t)0x00200000) /*!<Bit 5 */
  6517. #define USB_OTG_HPTXSTS_PTXQSAV_6 ((uint32_t)0x00400000) /*!<Bit 6 */
  6518. #define USB_OTG_HPTXSTS_PTXQSAV_7 ((uint32_t)0x00800000) /*!<Bit 7 */
  6519. #define USB_OTG_HPTXSTS_PTXQTOP ((uint32_t)0xFF000000) /*!< Top of the periodic transmit request queue */
  6520. #define USB_OTG_HPTXSTS_PTXQTOP_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  6521. #define USB_OTG_HPTXSTS_PTXQTOP_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  6522. #define USB_OTG_HPTXSTS_PTXQTOP_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  6523. #define USB_OTG_HPTXSTS_PTXQTOP_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  6524. #define USB_OTG_HPTXSTS_PTXQTOP_4 ((uint32_t)0x10000000) /*!<Bit 4 */
  6525. #define USB_OTG_HPTXSTS_PTXQTOP_5 ((uint32_t)0x20000000) /*!<Bit 5 */
  6526. #define USB_OTG_HPTXSTS_PTXQTOP_6 ((uint32_t)0x40000000) /*!<Bit 6 */
  6527. #define USB_OTG_HPTXSTS_PTXQTOP_7 ((uint32_t)0x80000000) /*!<Bit 7 */
  6528. /******************** Bit definition for USB_OTG_HAINT register ********************/
  6529. #define USB_OTG_HAINT_HAINT ((uint32_t)0x0000FFFF) /*!< Channel interrupts */
  6530. /******************** Bit definition for USB_OTG_DOEPMSK register ********************/
  6531. #define USB_OTG_DOEPMSK_XFRCM ((uint32_t)0x00000001) /*!< Transfer completed interrupt mask */
  6532. #define USB_OTG_DOEPMSK_EPDM ((uint32_t)0x00000002) /*!< Endpoint disabled interrupt mask */
  6533. #define USB_OTG_DOEPMSK_STUPM ((uint32_t)0x00000008) /*!< SETUP phase done mask */
  6534. #define USB_OTG_DOEPMSK_OTEPDM ((uint32_t)0x00000010) /*!< OUT token received when endpoint disabled mask */
  6535. #define USB_OTG_DOEPMSK_OTEPSPRM ((uint32_t)0x00000020) /*!< Status Phase Received mask */
  6536. #define USB_OTG_DOEPMSK_B2BSTUP ((uint32_t)0x00000040) /*!< Back-to-back SETUP packets received mask */
  6537. #define USB_OTG_DOEPMSK_OPEM ((uint32_t)0x00000100) /*!< OUT packet error mask */
  6538. #define USB_OTG_DOEPMSK_BOIM ((uint32_t)0x00000200) /*!< BNA interrupt mask */
  6539. /******************** Bit definition for USB_OTG_GINTSTS register ********************/
  6540. #define USB_OTG_GINTSTS_CMOD ((uint32_t)0x00000001) /*!< Current mode of operation */
  6541. #define USB_OTG_GINTSTS_MMIS ((uint32_t)0x00000002) /*!< Mode mismatch interrupt */
  6542. #define USB_OTG_GINTSTS_OTGINT ((uint32_t)0x00000004) /*!< OTG interrupt */
  6543. #define USB_OTG_GINTSTS_SOF ((uint32_t)0x00000008) /*!< Start of frame */
  6544. #define USB_OTG_GINTSTS_RXFLVL ((uint32_t)0x00000010) /*!< RxFIFO nonempty */
  6545. #define USB_OTG_GINTSTS_NPTXFE ((uint32_t)0x00000020) /*!< Nonperiodic TxFIFO empty */
  6546. #define USB_OTG_GINTSTS_GINAKEFF ((uint32_t)0x00000040) /*!< Global IN nonperiodic NAK effective */
  6547. #define USB_OTG_GINTSTS_BOUTNAKEFF ((uint32_t)0x00000080) /*!< Global OUT NAK effective */
  6548. #define USB_OTG_GINTSTS_ESUSP ((uint32_t)0x00000400) /*!< Early suspend */
  6549. #define USB_OTG_GINTSTS_USBSUSP ((uint32_t)0x00000800) /*!< USB suspend */
  6550. #define USB_OTG_GINTSTS_USBRST ((uint32_t)0x00001000) /*!< USB reset */
  6551. #define USB_OTG_GINTSTS_ENUMDNE ((uint32_t)0x00002000) /*!< Enumeration done */
  6552. #define USB_OTG_GINTSTS_ISOODRP ((uint32_t)0x00004000) /*!< Isochronous OUT packet dropped interrupt */
  6553. #define USB_OTG_GINTSTS_EOPF ((uint32_t)0x00008000) /*!< End of periodic frame interrupt */
  6554. #define USB_OTG_GINTSTS_IEPINT ((uint32_t)0x00040000) /*!< IN endpoint interrupt */
  6555. #define USB_OTG_GINTSTS_OEPINT ((uint32_t)0x00080000) /*!< OUT endpoint interrupt */
  6556. #define USB_OTG_GINTSTS_IISOIXFR ((uint32_t)0x00100000) /*!< Incomplete isochronous IN transfer */
  6557. #define USB_OTG_GINTSTS_PXFR_INCOMPISOOUT ((uint32_t)0x00200000) /*!< Incomplete periodic transfer */
  6558. #define USB_OTG_GINTSTS_DATAFSUSP ((uint32_t)0x00400000) /*!< Data fetch suspended */
  6559. #define USB_OTG_GINTSTS_RSTDET ((uint32_t)0x00800000) /*!< Reset detected interrupt */
  6560. #define USB_OTG_GINTSTS_HPRTINT ((uint32_t)0x01000000) /*!< Host port interrupt */
  6561. #define USB_OTG_GINTSTS_HCINT ((uint32_t)0x02000000) /*!< Host channels interrupt */
  6562. #define USB_OTG_GINTSTS_PTXFE ((uint32_t)0x04000000) /*!< Periodic TxFIFO empty */
  6563. #define USB_OTG_GINTSTS_LPMINT ((uint32_t)0x08000000) /*!< LPM interrupt */
  6564. #define USB_OTG_GINTSTS_CIDSCHG ((uint32_t)0x10000000) /*!< Connector ID status change */
  6565. #define USB_OTG_GINTSTS_DISCINT ((uint32_t)0x20000000) /*!< Disconnect detected interrupt */
  6566. #define USB_OTG_GINTSTS_SRQINT ((uint32_t)0x40000000) /*!< Session request/new session detected interrupt */
  6567. #define USB_OTG_GINTSTS_WKUINT ((uint32_t)0x80000000) /*!< Resume/remote wakeup detected interrupt */
  6568. /******************** Bit definition for USB_OTG_GINTMSK register ********************/
  6569. #define USB_OTG_GINTMSK_MMISM ((uint32_t)0x00000002) /*!< Mode mismatch interrupt mask */
  6570. #define USB_OTG_GINTMSK_OTGINT ((uint32_t)0x00000004) /*!< OTG interrupt mask */
  6571. #define USB_OTG_GINTMSK_SOFM ((uint32_t)0x00000008) /*!< Start of frame mask */
  6572. #define USB_OTG_GINTMSK_RXFLVLM ((uint32_t)0x00000010) /*!< Receive FIFO nonempty mask */
  6573. #define USB_OTG_GINTMSK_NPTXFEM ((uint32_t)0x00000020) /*!< Nonperiodic TxFIFO empty mask */
  6574. #define USB_OTG_GINTMSK_GINAKEFFM ((uint32_t)0x00000040) /*!< Global nonperiodic IN NAK effective mask */
  6575. #define USB_OTG_GINTMSK_GONAKEFFM ((uint32_t)0x00000080) /*!< Global OUT NAK effective mask */
  6576. #define USB_OTG_GINTMSK_ESUSPM ((uint32_t)0x00000400) /*!< Early suspend mask */
  6577. #define USB_OTG_GINTMSK_USBSUSPM ((uint32_t)0x00000800) /*!< USB suspend mask */
  6578. #define USB_OTG_GINTMSK_USBRST ((uint32_t)0x00001000) /*!< USB reset mask */
  6579. #define USB_OTG_GINTMSK_ENUMDNEM ((uint32_t)0x00002000) /*!< Enumeration done mask */
  6580. #define USB_OTG_GINTMSK_ISOODRPM ((uint32_t)0x00004000) /*!< Isochronous OUT packet dropped interrupt mask */
  6581. #define USB_OTG_GINTMSK_EOPFM ((uint32_t)0x00008000) /*!< End of periodic frame interrupt mask */
  6582. #define USB_OTG_GINTMSK_EPMISM ((uint32_t)0x00020000) /*!< Endpoint mismatch interrupt mask */
  6583. #define USB_OTG_GINTMSK_IEPINT ((uint32_t)0x00040000) /*!< IN endpoints interrupt mask */
  6584. #define USB_OTG_GINTMSK_OEPINT ((uint32_t)0x00080000) /*!< OUT endpoints interrupt mask */
  6585. #define USB_OTG_GINTMSK_IISOIXFRM ((uint32_t)0x00100000) /*!< Incomplete isochronous IN transfer mask */
  6586. #define USB_OTG_GINTMSK_PXFRM_IISOOXFRM ((uint32_t)0x00200000) /*!< Incomplete periodic transfer mask */
  6587. #define USB_OTG_GINTMSK_FSUSPM ((uint32_t)0x00400000) /*!< Data fetch suspended mask */
  6588. #define USB_OTG_GINTMSK_RSTDEM ((uint32_t)0x00800000) /*!< Reset detected interrupt mask */
  6589. #define USB_OTG_GINTMSK_PRTIM ((uint32_t)0x01000000) /*!< Host port interrupt mask */
  6590. #define USB_OTG_GINTMSK_HCIM ((uint32_t)0x02000000) /*!< Host channels interrupt mask */
  6591. #define USB_OTG_GINTMSK_PTXFEM ((uint32_t)0x04000000) /*!< Periodic TxFIFO empty mask */
  6592. #define USB_OTG_GINTMSK_LPMINTM ((uint32_t)0x08000000) /*!< LPM interrupt Mask */
  6593. #define USB_OTG_GINTMSK_CIDSCHGM ((uint32_t)0x10000000) /*!< Connector ID status change mask */
  6594. #define USB_OTG_GINTMSK_DISCINT ((uint32_t)0x20000000) /*!< Disconnect detected interrupt mask */
  6595. #define USB_OTG_GINTMSK_SRQIM ((uint32_t)0x40000000) /*!< Session request/new session detected interrupt mask */
  6596. #define USB_OTG_GINTMSK_WUIM ((uint32_t)0x80000000) /*!< Resume/remote wakeup detected interrupt mask */
  6597. /******************** Bit definition for USB_OTG_DAINT register ********************/
  6598. #define USB_OTG_DAINT_IEPINT ((uint32_t)0x0000FFFF) /*!< IN endpoint interrupt bits */
  6599. #define USB_OTG_DAINT_OEPINT ((uint32_t)0xFFFF0000) /*!< OUT endpoint interrupt bits */
  6600. /******************** Bit definition for USB_OTG_HAINTMSK register ********************/
  6601. #define USB_OTG_HAINTMSK_HAINTM ((uint32_t)0x0000FFFF) /*!< Channel interrupt mask */
  6602. /******************** Bit definition for USB_OTG_GRXSTSP register ********************/
  6603. #define USB_OTG_GRXSTSP_EPNUM ((uint32_t)0x0000000F) /*!< IN EP interrupt mask bits */
  6604. #define USB_OTG_GRXSTSP_BCNT ((uint32_t)0x00007FF0) /*!< OUT EP interrupt mask bits */
  6605. #define USB_OTG_GRXSTSP_DPID ((uint32_t)0x00018000) /*!< OUT EP interrupt mask bits */
  6606. #define USB_OTG_GRXSTSP_PKTSTS ((uint32_t)0x001E0000) /*!< OUT EP interrupt mask bits */
  6607. /******************** Bit definition for USB_OTG_DAINTMSK register ********************/
  6608. #define USB_OTG_DAINTMSK_IEPM ((uint32_t)0x0000FFFF) /*!< IN EP interrupt mask bits */
  6609. #define USB_OTG_DAINTMSK_OEPM ((uint32_t)0xFFFF0000) /*!< OUT EP interrupt mask bits */
  6610. /******************** Bit definition for OTG register ********************/
  6611. #define USB_OTG_CHNUM ((uint32_t)0x0000000F) /*!< Channel number */
  6612. #define USB_OTG_CHNUM_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  6613. #define USB_OTG_CHNUM_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  6614. #define USB_OTG_CHNUM_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  6615. #define USB_OTG_CHNUM_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  6616. #define USB_OTG_BCNT ((uint32_t)0x00007FF0) /*!< Byte count */
  6617. #define USB_OTG_DPID ((uint32_t)0x00018000) /*!< Data PID */
  6618. #define USB_OTG_DPID_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  6619. #define USB_OTG_DPID_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  6620. #define USB_OTG_PKTSTS ((uint32_t)0x001E0000) /*!< Packet status */
  6621. #define USB_OTG_PKTSTS_0 ((uint32_t)0x00020000) /*!<Bit 0 */
  6622. #define USB_OTG_PKTSTS_1 ((uint32_t)0x00040000) /*!<Bit 1 */
  6623. #define USB_OTG_PKTSTS_2 ((uint32_t)0x00080000) /*!<Bit 2 */
  6624. #define USB_OTG_PKTSTS_3 ((uint32_t)0x00100000) /*!<Bit 3 */
  6625. #define USB_OTG_EPNUM ((uint32_t)0x0000000F) /*!< Endpoint number */
  6626. #define USB_OTG_EPNUM_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  6627. #define USB_OTG_EPNUM_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  6628. #define USB_OTG_EPNUM_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  6629. #define USB_OTG_EPNUM_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  6630. #define USB_OTG_FRMNUM ((uint32_t)0x01E00000) /*!< Frame number */
  6631. #define USB_OTG_FRMNUM_0 ((uint32_t)0x00200000) /*!<Bit 0 */
  6632. #define USB_OTG_FRMNUM_1 ((uint32_t)0x00400000) /*!<Bit 1 */
  6633. #define USB_OTG_FRMNUM_2 ((uint32_t)0x00800000) /*!<Bit 2 */
  6634. #define USB_OTG_FRMNUM_3 ((uint32_t)0x01000000) /*!<Bit 3 */
  6635. /******************** Bit definition for OTG register ********************/
  6636. #define USB_OTG_CHNUM ((uint32_t)0x0000000F) /*!< Channel number */
  6637. #define USB_OTG_CHNUM_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  6638. #define USB_OTG_CHNUM_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  6639. #define USB_OTG_CHNUM_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  6640. #define USB_OTG_CHNUM_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  6641. #define USB_OTG_BCNT ((uint32_t)0x00007FF0) /*!< Byte count */
  6642. #define USB_OTG_DPID ((uint32_t)0x00018000) /*!< Data PID */
  6643. #define USB_OTG_DPID_0 ((uint32_t)0x00008000) /*!<Bit 0 */
  6644. #define USB_OTG_DPID_1 ((uint32_t)0x00010000) /*!<Bit 1 */
  6645. #define USB_OTG_PKTSTS ((uint32_t)0x001E0000) /*!< Packet status */
  6646. #define USB_OTG_PKTSTS_0 ((uint32_t)0x00020000) /*!<Bit 0 */
  6647. #define USB_OTG_PKTSTS_1 ((uint32_t)0x00040000) /*!<Bit 1 */
  6648. #define USB_OTG_PKTSTS_2 ((uint32_t)0x00080000) /*!<Bit 2 */
  6649. #define USB_OTG_PKTSTS_3 ((uint32_t)0x00100000) /*!<Bit 3 */
  6650. #define USB_OTG_EPNUM ((uint32_t)0x0000000F) /*!< Endpoint number */
  6651. #define USB_OTG_EPNUM_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  6652. #define USB_OTG_EPNUM_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  6653. #define USB_OTG_EPNUM_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  6654. #define USB_OTG_EPNUM_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  6655. #define USB_OTG_FRMNUM ((uint32_t)0x01E00000) /*!< Frame number */
  6656. #define USB_OTG_FRMNUM_0 ((uint32_t)0x00200000) /*!<Bit 0 */
  6657. #define USB_OTG_FRMNUM_1 ((uint32_t)0x00400000) /*!<Bit 1 */
  6658. #define USB_OTG_FRMNUM_2 ((uint32_t)0x00800000) /*!<Bit 2 */
  6659. #define USB_OTG_FRMNUM_3 ((uint32_t)0x01000000) /*!<Bit 3 */
  6660. /******************** Bit definition for USB_OTG_GRXFSIZ register ********************/
  6661. #define USB_OTG_GRXFSIZ_RXFD ((uint32_t)0x0000FFFF) /*!< RxFIFO depth */
  6662. /******************** Bit definition for USB_OTG_DVBUSDIS register ********************/
  6663. #define USB_OTG_DVBUSDIS_VBUSDT ((uint32_t)0x0000FFFF) /*!< Device VBUS discharge time */
  6664. /******************** Bit definition for OTG register ********************/
  6665. #define USB_OTG_NPTXFSA ((uint32_t)0x0000FFFF) /*!< Nonperiodic transmit RAM start address */
  6666. #define USB_OTG_NPTXFD ((uint32_t)0xFFFF0000) /*!< Nonperiodic TxFIFO depth */
  6667. #define USB_OTG_TX0FSA ((uint32_t)0x0000FFFF) /*!< Endpoint 0 transmit RAM start address */
  6668. #define USB_OTG_TX0FD ((uint32_t)0xFFFF0000) /*!< Endpoint 0 TxFIFO depth */
  6669. /******************** Bit definition for USB_OTG_DVBUSPULSE register ********************/
  6670. #define USB_OTG_DVBUSPULSE_DVBUSP ((uint32_t)0x00000FFF) /*!< Device VBUS pulsing time */
  6671. /******************** Bit definition for USB_OTG_GNPTXSTS register ********************/
  6672. #define USB_OTG_GNPTXSTS_NPTXFSAV ((uint32_t)0x0000FFFF) /*!< Nonperiodic TxFIFO space available */
  6673. #define USB_OTG_GNPTXSTS_NPTQXSAV ((uint32_t)0x00FF0000) /*!< Nonperiodic transmit request queue space available */
  6674. #define USB_OTG_GNPTXSTS_NPTQXSAV_0 ((uint32_t)0x00010000) /*!<Bit 0 */
  6675. #define USB_OTG_GNPTXSTS_NPTQXSAV_1 ((uint32_t)0x00020000) /*!<Bit 1 */
  6676. #define USB_OTG_GNPTXSTS_NPTQXSAV_2 ((uint32_t)0x00040000) /*!<Bit 2 */
  6677. #define USB_OTG_GNPTXSTS_NPTQXSAV_3 ((uint32_t)0x00080000) /*!<Bit 3 */
  6678. #define USB_OTG_GNPTXSTS_NPTQXSAV_4 ((uint32_t)0x00100000) /*!<Bit 4 */
  6679. #define USB_OTG_GNPTXSTS_NPTQXSAV_5 ((uint32_t)0x00200000) /*!<Bit 5 */
  6680. #define USB_OTG_GNPTXSTS_NPTQXSAV_6 ((uint32_t)0x00400000) /*!<Bit 6 */
  6681. #define USB_OTG_GNPTXSTS_NPTQXSAV_7 ((uint32_t)0x00800000) /*!<Bit 7 */
  6682. #define USB_OTG_GNPTXSTS_NPTXQTOP ((uint32_t)0x7F000000) /*!< Top of the nonperiodic transmit request queue */
  6683. #define USB_OTG_GNPTXSTS_NPTXQTOP_0 ((uint32_t)0x01000000) /*!<Bit 0 */
  6684. #define USB_OTG_GNPTXSTS_NPTXQTOP_1 ((uint32_t)0x02000000) /*!<Bit 1 */
  6685. #define USB_OTG_GNPTXSTS_NPTXQTOP_2 ((uint32_t)0x04000000) /*!<Bit 2 */
  6686. #define USB_OTG_GNPTXSTS_NPTXQTOP_3 ((uint32_t)0x08000000) /*!<Bit 3 */
  6687. #define USB_OTG_GNPTXSTS_NPTXQTOP_4 ((uint32_t)0x10000000) /*!<Bit 4 */
  6688. #define USB_OTG_GNPTXSTS_NPTXQTOP_5 ((uint32_t)0x20000000) /*!<Bit 5 */
  6689. #define USB_OTG_GNPTXSTS_NPTXQTOP_6 ((uint32_t)0x40000000) /*!<Bit 6 */
  6690. /******************** Bit definition for USB_OTG_DTHRCTL register ********************/
  6691. #define USB_OTG_DTHRCTL_NONISOTHREN ((uint32_t)0x00000001) /*!< Nonisochronous IN endpoints threshold enable */
  6692. #define USB_OTG_DTHRCTL_ISOTHREN ((uint32_t)0x00000002) /*!< ISO IN endpoint threshold enable */
  6693. #define USB_OTG_DTHRCTL_TXTHRLEN ((uint32_t)0x000007FC) /*!< Transmit threshold length */
  6694. #define USB_OTG_DTHRCTL_TXTHRLEN_0 ((uint32_t)0x00000004) /*!<Bit 0 */
  6695. #define USB_OTG_DTHRCTL_TXTHRLEN_1 ((uint32_t)0x00000008) /*!<Bit 1 */
  6696. #define USB_OTG_DTHRCTL_TXTHRLEN_2 ((uint32_t)0x00000010) /*!<Bit 2 */
  6697. #define USB_OTG_DTHRCTL_TXTHRLEN_3 ((uint32_t)0x00000020) /*!<Bit 3 */
  6698. #define USB_OTG_DTHRCTL_TXTHRLEN_4 ((uint32_t)0x00000040) /*!<Bit 4 */
  6699. #define USB_OTG_DTHRCTL_TXTHRLEN_5 ((uint32_t)0x00000080) /*!<Bit 5 */
  6700. #define USB_OTG_DTHRCTL_TXTHRLEN_6 ((uint32_t)0x00000100) /*!<Bit 6 */
  6701. #define USB_OTG_DTHRCTL_TXTHRLEN_7 ((uint32_t)0x00000200) /*!<Bit 7 */
  6702. #define USB_OTG_DTHRCTL_TXTHRLEN_8 ((uint32_t)0x00000400) /*!<Bit 8 */
  6703. #define USB_OTG_DTHRCTL_RXTHREN ((uint32_t)0x00010000) /*!< Receive threshold enable */
  6704. #define USB_OTG_DTHRCTL_RXTHRLEN ((uint32_t)0x03FE0000) /*!< Receive threshold length */
  6705. #define USB_OTG_DTHRCTL_RXTHRLEN_0 ((uint32_t)0x00020000) /*!<Bit 0 */
  6706. #define USB_OTG_DTHRCTL_RXTHRLEN_1 ((uint32_t)0x00040000) /*!<Bit 1 */
  6707. #define USB_OTG_DTHRCTL_RXTHRLEN_2 ((uint32_t)0x00080000) /*!<Bit 2 */
  6708. #define USB_OTG_DTHRCTL_RXTHRLEN_3 ((uint32_t)0x00100000) /*!<Bit 3 */
  6709. #define USB_OTG_DTHRCTL_RXTHRLEN_4 ((uint32_t)0x00200000) /*!<Bit 4 */
  6710. #define USB_OTG_DTHRCTL_RXTHRLEN_5 ((uint32_t)0x00400000) /*!<Bit 5 */
  6711. #define USB_OTG_DTHRCTL_RXTHRLEN_6 ((uint32_t)0x00800000) /*!<Bit 6 */
  6712. #define USB_OTG_DTHRCTL_RXTHRLEN_7 ((uint32_t)0x01000000) /*!<Bit 7 */
  6713. #define USB_OTG_DTHRCTL_RXTHRLEN_8 ((uint32_t)0x02000000) /*!<Bit 8 */
  6714. #define USB_OTG_DTHRCTL_ARPEN ((uint32_t)0x08000000) /*!< Arbiter parking enable */
  6715. /******************** Bit definition for USB_OTG_DIEPEMPMSK register ********************/
  6716. #define USB_OTG_DIEPEMPMSK_INEPTXFEM ((uint32_t)0x0000FFFF) /*!< IN EP Tx FIFO empty interrupt mask bits */
  6717. /******************** Bit definition for USB_OTG_DEACHINT register ********************/
  6718. #define USB_OTG_DEACHINT_IEP1INT ((uint32_t)0x00000002) /*!< IN endpoint 1interrupt bit */
  6719. #define USB_OTG_DEACHINT_OEP1INT ((uint32_t)0x00020000) /*!< OUT endpoint 1 interrupt bit */
  6720. /******************** Bit definition for USB_OTG_GCCFG register ********************/
  6721. #define USB_OTG_GCCFG_PWRDWN ((uint32_t)0x00010000) /*!< Power down */
  6722. #define USB_OTG_GCCFG_VBDEN ((uint32_t)0x00200000) /*!< USB VBUS Detection Enable */
  6723. /******************** Bit definition for USB_OTG_DEACHINTMSK register ********************/
  6724. #define USB_OTG_DEACHINTMSK_IEP1INTM ((uint32_t)0x00000002) /*!< IN Endpoint 1 interrupt mask bit */
  6725. #define USB_OTG_DEACHINTMSK_OEP1INTM ((uint32_t)0x00020000) /*!< OUT Endpoint 1 interrupt mask bit */
  6726. /******************** Bit definition for USB_OTG_CID register ********************/
  6727. #define USB_OTG_CID_PRODUCT_ID ((uint32_t)0xFFFFFFFF) /*!< Product ID field */
  6728. /******************** Bit definition for USB_OTG_GLPMCFG register ********************/
  6729. #define USB_OTG_GLPMCFG_LPMEN ((uint32_t)0x00000001) /*!< LPM support enable */
  6730. #define USB_OTG_GLPMCFG_LPMACK ((uint32_t)0x00000002) /*!< LPM Token acknowledge enable */
  6731. #define USB_OTG_GLPMCFG_BESL ((uint32_t)0x0000003C) /*!< BESL value received with last ACKed LPM Token */
  6732. #define USB_OTG_GLPMCFG_REMWAKE ((uint32_t)0x00000040) /*!< bRemoteWake value received with last ACKed LPM Token */
  6733. #define USB_OTG_GLPMCFG_L1SSEN ((uint32_t)0x00000080) /*!< L1 shallow sleep enable */
  6734. #define USB_OTG_GLPMCFG_BESLTHRS ((uint32_t)0x00000F00) /*!< BESL threshold */
  6735. #define USB_OTG_GLPMCFG_L1DSEN ((uint32_t)0x00001000) /*!< L1 deep sleep enable */
  6736. #define USB_OTG_GLPMCFG_LPMRSP ((uint32_t)0x00006000) /*!< LPM response */
  6737. #define USB_OTG_GLPMCFG_SLPSTS ((uint32_t)0x00008000) /*!< Port sleep status */
  6738. #define USB_OTG_GLPMCFG_L1RSMOK ((uint32_t)0x00010000) /*!< Sleep State Resume OK */
  6739. #define USB_OTG_GLPMCFG_LPMCHIDX ((uint32_t)0x001E0000) /*!< LPM Channel Index */
  6740. #define USB_OTG_GLPMCFG_LPMRCNT ((uint32_t)0x00E00000) /*!< LPM retry count */
  6741. #define USB_OTG_GLPMCFG_SNDLPM ((uint32_t)0x01000000) /*!< Send LPM transaction */
  6742. #define USB_OTG_GLPMCFG_LPMRCNTSTS ((uint32_t)0x0E000000) /*!< LPM retry count status */
  6743. #define USB_OTG_GLPMCFG_ENBESL ((uint32_t)0x10000000) /*!< Enable best effort service latency */
  6744. /******************** Bit definition for USB_OTG_DIEPEACHMSK1 register ********************/
  6745. #define USB_OTG_DIEPEACHMSK1_XFRCM ((uint32_t)0x00000001) /*!< Transfer completed interrupt mask */
  6746. #define USB_OTG_DIEPEACHMSK1_EPDM ((uint32_t)0x00000002) /*!< Endpoint disabled interrupt mask */
  6747. #define USB_OTG_DIEPEACHMSK1_TOM ((uint32_t)0x00000008) /*!< Timeout condition mask (nonisochronous endpoints) */
  6748. #define USB_OTG_DIEPEACHMSK1_ITTXFEMSK ((uint32_t)0x00000010) /*!< IN token received when TxFIFO empty mask */
  6749. #define USB_OTG_DIEPEACHMSK1_INEPNMM ((uint32_t)0x00000020) /*!< IN token received with EP mismatch mask */
  6750. #define USB_OTG_DIEPEACHMSK1_INEPNEM ((uint32_t)0x00000040) /*!< IN endpoint NAK effective mask */
  6751. #define USB_OTG_DIEPEACHMSK1_TXFURM ((uint32_t)0x00000100) /*!< FIFO underrun mask */
  6752. #define USB_OTG_DIEPEACHMSK1_BIM ((uint32_t)0x00000200) /*!< BNA interrupt mask */
  6753. #define USB_OTG_DIEPEACHMSK1_NAKM ((uint32_t)0x00002000) /*!< NAK interrupt mask */
  6754. /******************** Bit definition for USB_OTG_HPRT register ********************/
  6755. #define USB_OTG_HPRT_PCSTS ((uint32_t)0x00000001) /*!< Port connect status */
  6756. #define USB_OTG_HPRT_PCDET ((uint32_t)0x00000002) /*!< Port connect detected */
  6757. #define USB_OTG_HPRT_PENA ((uint32_t)0x00000004) /*!< Port enable */
  6758. #define USB_OTG_HPRT_PENCHNG ((uint32_t)0x00000008) /*!< Port enable/disable change */
  6759. #define USB_OTG_HPRT_POCA ((uint32_t)0x00000010) /*!< Port overcurrent active */
  6760. #define USB_OTG_HPRT_POCCHNG ((uint32_t)0x00000020) /*!< Port overcurrent change */
  6761. #define USB_OTG_HPRT_PRES ((uint32_t)0x00000040) /*!< Port resume */
  6762. #define USB_OTG_HPRT_PSUSP ((uint32_t)0x00000080) /*!< Port suspend */
  6763. #define USB_OTG_HPRT_PRST ((uint32_t)0x00000100) /*!< Port reset */
  6764. #define USB_OTG_HPRT_PLSTS ((uint32_t)0x00000C00) /*!< Port line status */
  6765. #define USB_OTG_HPRT_PLSTS_0 ((uint32_t)0x00000400) /*!<Bit 0 */
  6766. #define USB_OTG_HPRT_PLSTS_1 ((uint32_t)0x00000800) /*!<Bit 1 */
  6767. #define USB_OTG_HPRT_PPWR ((uint32_t)0x00001000) /*!< Port power */
  6768. #define USB_OTG_HPRT_PTCTL ((uint32_t)0x0001E000) /*!< Port test control */
  6769. #define USB_OTG_HPRT_PTCTL_0 ((uint32_t)0x00002000) /*!<Bit 0 */
  6770. #define USB_OTG_HPRT_PTCTL_1 ((uint32_t)0x00004000) /*!<Bit 1 */
  6771. #define USB_OTG_HPRT_PTCTL_2 ((uint32_t)0x00008000) /*!<Bit 2 */
  6772. #define USB_OTG_HPRT_PTCTL_3 ((uint32_t)0x00010000) /*!<Bit 3 */
  6773. #define USB_OTG_HPRT_PSPD ((uint32_t)0x00060000) /*!< Port speed */
  6774. #define USB_OTG_HPRT_PSPD_0 ((uint32_t)0x00020000) /*!<Bit 0 */
  6775. #define USB_OTG_HPRT_PSPD_1 ((uint32_t)0x00040000) /*!<Bit 1 */
  6776. /******************** Bit definition for USB_OTG_DOEPEACHMSK1 register ********************/
  6777. #define USB_OTG_DOEPEACHMSK1_XFRCM ((uint32_t)0x00000001) /*!< Transfer completed interrupt mask */
  6778. #define USB_OTG_DOEPEACHMSK1_EPDM ((uint32_t)0x00000002) /*!< Endpoint disabled interrupt mask */
  6779. #define USB_OTG_DOEPEACHMSK1_TOM ((uint32_t)0x00000008) /*!< Timeout condition mask */
  6780. #define USB_OTG_DOEPEACHMSK1_ITTXFEMSK ((uint32_t)0x00000010) /*!< IN token received when TxFIFO empty mask */
  6781. #define USB_OTG_DOEPEACHMSK1_INEPNMM ((uint32_t)0x00000020) /*!< IN token received with EP mismatch mask */
  6782. #define USB_OTG_DOEPEACHMSK1_INEPNEM ((uint32_t)0x00000040) /*!< IN endpoint NAK effective mask */
  6783. #define USB_OTG_DOEPEACHMSK1_TXFURM ((uint32_t)0x00000100) /*!< OUT packet error mask */
  6784. #define USB_OTG_DOEPEACHMSK1_BIM ((uint32_t)0x00000200) /*!< BNA interrupt mask */
  6785. #define USB_OTG_DOEPEACHMSK1_BERRM ((uint32_t)0x00001000) /*!< Bubble error interrupt mask */
  6786. #define USB_OTG_DOEPEACHMSK1_NAKM ((uint32_t)0x00002000) /*!< NAK interrupt mask */
  6787. #define USB_OTG_DOEPEACHMSK1_NYETM ((uint32_t)0x00004000) /*!< NYET interrupt mask */
  6788. /******************** Bit definition for USB_OTG_HPTXFSIZ register ********************/
  6789. #define USB_OTG_HPTXFSIZ_PTXSA ((uint32_t)0x0000FFFF) /*!< Host periodic TxFIFO start address */
  6790. #define USB_OTG_HPTXFSIZ_PTXFD ((uint32_t)0xFFFF0000) /*!< Host periodic TxFIFO depth */
  6791. /******************** Bit definition for USB_OTG_DIEPCTL register ********************/
  6792. #define USB_OTG_DIEPCTL_MPSIZ ((uint32_t)0x000007FF) /*!< Maximum packet size */
  6793. #define USB_OTG_DIEPCTL_USBAEP ((uint32_t)0x00008000) /*!< USB active endpoint */
  6794. #define USB_OTG_DIEPCTL_EONUM_DPID ((uint32_t)0x00010000) /*!< Even/odd frame */
  6795. #define USB_OTG_DIEPCTL_NAKSTS ((uint32_t)0x00020000) /*!< NAK status */
  6796. #define USB_OTG_DIEPCTL_EPTYP ((uint32_t)0x000C0000) /*!< Endpoint type */
  6797. #define USB_OTG_DIEPCTL_EPTYP_0 ((uint32_t)0x00040000) /*!<Bit 0 */
  6798. #define USB_OTG_DIEPCTL_EPTYP_1 ((uint32_t)0x00080000) /*!<Bit 1 */
  6799. #define USB_OTG_DIEPCTL_STALL ((uint32_t)0x00200000) /*!< STALL handshake */
  6800. #define USB_OTG_DIEPCTL_TXFNUM ((uint32_t)0x03C00000) /*!< TxFIFO number */
  6801. #define USB_OTG_DIEPCTL_TXFNUM_0 ((uint32_t)0x00400000) /*!<Bit 0 */
  6802. #define USB_OTG_DIEPCTL_TXFNUM_1 ((uint32_t)0x00800000) /*!<Bit 1 */
  6803. #define USB_OTG_DIEPCTL_TXFNUM_2 ((uint32_t)0x01000000) /*!<Bit 2 */
  6804. #define USB_OTG_DIEPCTL_TXFNUM_3 ((uint32_t)0x02000000) /*!<Bit 3 */
  6805. #define USB_OTG_DIEPCTL_CNAK ((uint32_t)0x04000000) /*!< Clear NAK */
  6806. #define USB_OTG_DIEPCTL_SNAK ((uint32_t)0x08000000) /*!< Set NAK */
  6807. #define USB_OTG_DIEPCTL_SD0PID_SEVNFRM ((uint32_t)0x10000000) /*!< Set DATA0 PID */
  6808. #define USB_OTG_DIEPCTL_SODDFRM ((uint32_t)0x20000000) /*!< Set odd frame */
  6809. #define USB_OTG_DIEPCTL_EPDIS ((uint32_t)0x40000000) /*!< Endpoint disable */
  6810. #define USB_OTG_DIEPCTL_EPENA ((uint32_t)0x80000000) /*!< Endpoint enable */
  6811. /******************** Bit definition for USB_OTG_HCCHAR register ********************/
  6812. #define USB_OTG_HCCHAR_MPSIZ ((uint32_t)0x000007FF) /*!< Maximum packet size */
  6813. #define USB_OTG_HCCHAR_EPNUM ((uint32_t)0x00007800) /*!< Endpoint number */
  6814. #define USB_OTG_HCCHAR_EPNUM_0 ((uint32_t)0x00000800) /*!<Bit 0 */
  6815. #define USB_OTG_HCCHAR_EPNUM_1 ((uint32_t)0x00001000) /*!<Bit 1 */
  6816. #define USB_OTG_HCCHAR_EPNUM_2 ((uint32_t)0x00002000) /*!<Bit 2 */
  6817. #define USB_OTG_HCCHAR_EPNUM_3 ((uint32_t)0x00004000) /*!<Bit 3 */
  6818. #define USB_OTG_HCCHAR_EPDIR ((uint32_t)0x00008000) /*!< Endpoint direction */
  6819. #define USB_OTG_HCCHAR_LSDEV ((uint32_t)0x00020000) /*!< Low-speed device */
  6820. #define USB_OTG_HCCHAR_EPTYP ((uint32_t)0x000C0000) /*!< Endpoint type */
  6821. #define USB_OTG_HCCHAR_EPTYP_0 ((uint32_t)0x00040000) /*!<Bit 0 */
  6822. #define USB_OTG_HCCHAR_EPTYP_1 ((uint32_t)0x00080000) /*!<Bit 1 */
  6823. #define USB_OTG_HCCHAR_MC ((uint32_t)0x00300000) /*!< Multi Count (MC) / Error Count (EC) */
  6824. #define USB_OTG_HCCHAR_MC_0 ((uint32_t)0x00100000) /*!<Bit 0 */
  6825. #define USB_OTG_HCCHAR_MC_1 ((uint32_t)0x00200000) /*!<Bit 1 */
  6826. #define USB_OTG_HCCHAR_DAD ((uint32_t)0x1FC00000) /*!< Device address */
  6827. #define USB_OTG_HCCHAR_DAD_0 ((uint32_t)0x00400000) /*!<Bit 0 */
  6828. #define USB_OTG_HCCHAR_DAD_1 ((uint32_t)0x00800000) /*!<Bit 1 */
  6829. #define USB_OTG_HCCHAR_DAD_2 ((uint32_t)0x01000000) /*!<Bit 2 */
  6830. #define USB_OTG_HCCHAR_DAD_3 ((uint32_t)0x02000000) /*!<Bit 3 */
  6831. #define USB_OTG_HCCHAR_DAD_4 ((uint32_t)0x04000000) /*!<Bit 4 */
  6832. #define USB_OTG_HCCHAR_DAD_5 ((uint32_t)0x08000000) /*!<Bit 5 */
  6833. #define USB_OTG_HCCHAR_DAD_6 ((uint32_t)0x10000000) /*!<Bit 6 */
  6834. #define USB_OTG_HCCHAR_ODDFRM ((uint32_t)0x20000000) /*!< Odd frame */
  6835. #define USB_OTG_HCCHAR_CHDIS ((uint32_t)0x40000000) /*!< Channel disable */
  6836. #define USB_OTG_HCCHAR_CHENA ((uint32_t)0x80000000) /*!< Channel enable */
  6837. /******************** Bit definition for USB_OTG_HCSPLT register ********************/
  6838. #define USB_OTG_HCSPLT_PRTADDR ((uint32_t)0x0000007F) /*!< Port address */
  6839. #define USB_OTG_HCSPLT_PRTADDR_0 ((uint32_t)0x00000001) /*!<Bit 0 */
  6840. #define USB_OTG_HCSPLT_PRTADDR_1 ((uint32_t)0x00000002) /*!<Bit 1 */
  6841. #define USB_OTG_HCSPLT_PRTADDR_2 ((uint32_t)0x00000004) /*!<Bit 2 */
  6842. #define USB_OTG_HCSPLT_PRTADDR_3 ((uint32_t)0x00000008) /*!<Bit 3 */
  6843. #define USB_OTG_HCSPLT_PRTADDR_4 ((uint32_t)0x00000010) /*!<Bit 4 */
  6844. #define USB_OTG_HCSPLT_PRTADDR_5 ((uint32_t)0x00000020) /*!<Bit 5 */
  6845. #define USB_OTG_HCSPLT_PRTADDR_6 ((uint32_t)0x00000040) /*!<Bit 6 */
  6846. #define USB_OTG_HCSPLT_HUBADDR ((uint32_t)0x00003F80) /*!< Hub address */
  6847. #define USB_OTG_HCSPLT_HUBADDR_0 ((uint32_t)0x00000080) /*!<Bit 0 */
  6848. #define USB_OTG_HCSPLT_HUBADDR_1 ((uint32_t)0x00000100) /*!<Bit 1 */
  6849. #define USB_OTG_HCSPLT_HUBADDR_2 ((uint32_t)0x00000200) /*!<Bit 2 */
  6850. #define USB_OTG_HCSPLT_HUBADDR_3 ((uint32_t)0x00000400) /*!<Bit 3 */
  6851. #define USB_OTG_HCSPLT_HUBADDR_4 ((uint32_t)0x00000800) /*!<Bit 4 */
  6852. #define USB_OTG_HCSPLT_HUBADDR_5 ((uint32_t)0x00001000) /*!<Bit 5 */
  6853. #define USB_OTG_HCSPLT_HUBADDR_6 ((uint32_t)0x00002000) /*!<Bit 6 */
  6854. #define USB_OTG_HCSPLT_XACTPOS ((uint32_t)0x0000C000) /*!< XACTPOS */
  6855. #define USB_OTG_HCSPLT_XACTPOS_0 ((uint32_t)0x00004000) /*!<Bit 0 */
  6856. #define USB_OTG_HCSPLT_XACTPOS_1 ((uint32_t)0x00008000) /*!<Bit 1 */
  6857. #define USB_OTG_HCSPLT_COMPLSPLT ((uint32_t)0x00010000) /*!< Do complete split */
  6858. #define USB_OTG_HCSPLT_SPLITEN ((uint32_t)0x80000000) /*!< Split enable */
  6859. /******************** Bit definition for USB_OTG_HCINT register ********************/
  6860. #define USB_OTG_HCINT_XFRC ((uint32_t)0x00000001) /*!< Transfer completed */
  6861. #define USB_OTG_HCINT_CHH ((uint32_t)0x00000002) /*!< Channel halted */
  6862. #define USB_OTG_HCINT_AHBERR ((uint32_t)0x00000004) /*!< AHB error */
  6863. #define USB_OTG_HCINT_STALL ((uint32_t)0x00000008) /*!< STALL response received interrupt */
  6864. #define USB_OTG_HCINT_NAK ((uint32_t)0x00000010) /*!< NAK response received interrupt */
  6865. #define USB_OTG_HCINT_ACK ((uint32_t)0x00000020) /*!< ACK response received/transmitted interrupt */
  6866. #define USB_OTG_HCINT_NYET ((uint32_t)0x00000040) /*!< Response received interrupt */
  6867. #define USB_OTG_HCINT_TXERR ((uint32_t)0x00000080) /*!< Transaction error */
  6868. #define USB_OTG_HCINT_BBERR ((uint32_t)0x00000100) /*!< Babble error */
  6869. #define USB_OTG_HCINT_FRMOR ((uint32_t)0x00000200) /*!< Frame overrun */
  6870. #define USB_OTG_HCINT_DTERR ((uint32_t)0x00000400) /*!< Data toggle error */
  6871. /******************** Bit definition for USB_OTG_DIEPINT register ********************/
  6872. #define USB_OTG_DIEPINT_XFRC ((uint32_t)0x00000001) /*!< Transfer completed interrupt */
  6873. #define USB_OTG_DIEPINT_EPDISD ((uint32_t)0x00000002) /*!< Endpoint disabled interrupt */
  6874. #define USB_OTG_DIEPINT_TOC ((uint32_t)0x00000008) /*!< Timeout condition */
  6875. #define USB_OTG_DIEPINT_ITTXFE ((uint32_t)0x00000010) /*!< IN token received when TxFIFO is empty */
  6876. #define USB_OTG_DIEPINT_INEPNE ((uint32_t)0x00000040) /*!< IN endpoint NAK effective */
  6877. #define USB_OTG_DIEPINT_TXFE ((uint32_t)0x00000080) /*!< Transmit FIFO empty */
  6878. #define USB_OTG_DIEPINT_TXFIFOUDRN ((uint32_t)0x00000100) /*!< Transmit Fifo Underrun */
  6879. #define USB_OTG_DIEPINT_BNA ((uint32_t)0x00000200) /*!< Buffer not available interrupt */
  6880. #define USB_OTG_DIEPINT_PKTDRPSTS ((uint32_t)0x00000800) /*!< Packet dropped status */
  6881. #define USB_OTG_DIEPINT_BERR ((uint32_t)0x00001000) /*!< Babble error interrupt */
  6882. #define USB_OTG_DIEPINT_NAK ((uint32_t)0x00002000) /*!< NAK interrupt */
  6883. /******************** Bit definition for USB_OTG_HCINTMSK register ********************/
  6884. #define USB_OTG_HCINTMSK_XFRCM ((uint32_t)0x00000001) /*!< Transfer completed mask */
  6885. #define USB_OTG_HCINTMSK_CHHM ((uint32_t)0x00000002) /*!< Channel halted mask */
  6886. #define USB_OTG_HCINTMSK_AHBERR ((uint32_t)0x00000004) /*!< AHB error */
  6887. #define USB_OTG_HCINTMSK_STALLM ((uint32_t)0x00000008) /*!< STALL response received interrupt mask */
  6888. #define USB_OTG_HCINTMSK_NAKM ((uint32_t)0x00000010) /*!< NAK response received interrupt mask */
  6889. #define USB_OTG_HCINTMSK_ACKM ((uint32_t)0x00000020) /*!< ACK response received/transmitted interrupt mask */
  6890. #define USB_OTG_HCINTMSK_NYET ((uint32_t)0x00000040) /*!< response received interrupt mask */
  6891. #define USB_OTG_HCINTMSK_TXERRM ((uint32_t)0x00000080) /*!< Transaction error mask */
  6892. #define USB_OTG_HCINTMSK_BBERRM ((uint32_t)0x00000100) /*!< Babble error mask */
  6893. #define USB_OTG_HCINTMSK_FRMORM ((uint32_t)0x00000200) /*!< Frame overrun mask */
  6894. #define USB_OTG_HCINTMSK_DTERRM ((uint32_t)0x00000400) /*!< Data toggle error mask */
  6895. /******************** Bit definition for USB_OTG_DIEPTSIZ register ********************/
  6896. #define USB_OTG_DIEPTSIZ_XFRSIZ ((uint32_t)0x0007FFFF) /*!< Transfer size */
  6897. #define USB_OTG_DIEPTSIZ_PKTCNT ((uint32_t)0x1FF80000) /*!< Packet count */
  6898. #define USB_OTG_DIEPTSIZ_MULCNT ((uint32_t)0x60000000) /*!< Packet count */
  6899. /******************** Bit definition for USB_OTG_HCTSIZ register ********************/
  6900. #define USB_OTG_HCTSIZ_XFRSIZ ((uint32_t)0x0007FFFF) /*!< Transfer size */
  6901. #define USB_OTG_HCTSIZ_PKTCNT ((uint32_t)0x1FF80000) /*!< Packet count */
  6902. #define USB_OTG_HCTSIZ_DOPING ((uint32_t)0x80000000) /*!< Do PING */
  6903. #define USB_OTG_HCTSIZ_DPID ((uint32_t)0x60000000) /*!< Data PID */
  6904. #define USB_OTG_HCTSIZ_DPID_0 ((uint32_t)0x20000000) /*!<Bit 0 */
  6905. #define USB_OTG_HCTSIZ_DPID_1 ((uint32_t)0x40000000) /*!<Bit 1 */
  6906. /******************** Bit definition for USB_OTG_DIEPDMA register ********************/
  6907. #define USB_OTG_DIEPDMA_DMAADDR ((uint32_t)0xFFFFFFFF) /*!< DMA address */
  6908. /******************** Bit definition for USB_OTG_HCDMA register ********************/
  6909. #define USB_OTG_HCDMA_DMAADDR ((uint32_t)0xFFFFFFFF) /*!< DMA address */
  6910. /******************** Bit definition for USB_OTG_DTXFSTS register ********************/
  6911. #define USB_OTG_DTXFSTS_INEPTFSAV ((uint32_t)0x0000FFFF) /*!< IN endpoint TxFIFO space available */
  6912. /******************** Bit definition for USB_OTG_DIEPTXF register ********************/
  6913. #define USB_OTG_DIEPTXF_INEPTXSA ((uint32_t)0x0000FFFF) /*!< IN endpoint FIFOx transmit RAM start address */
  6914. #define USB_OTG_DIEPTXF_INEPTXFD ((uint32_t)0xFFFF0000) /*!< IN endpoint TxFIFO depth */
  6915. /******************** Bit definition for USB_OTG_DOEPCTL register ********************/
  6916. #define USB_OTG_DOEPCTL_MPSIZ ((uint32_t)0x000007FF) /*!< Maximum packet size */ /*!<Bit 1 */
  6917. #define USB_OTG_DOEPCTL_USBAEP ((uint32_t)0x00008000) /*!< USB active endpoint */
  6918. #define USB_OTG_DOEPCTL_NAKSTS ((uint32_t)0x00020000) /*!< NAK status */
  6919. #define USB_OTG_DOEPCTL_SD0PID_SEVNFRM ((uint32_t)0x10000000) /*!< Set DATA0 PID */
  6920. #define USB_OTG_DOEPCTL_SODDFRM ((uint32_t)0x20000000) /*!< Set odd frame */
  6921. #define USB_OTG_DOEPCTL_EPTYP ((uint32_t)0x000C0000) /*!< Endpoint type */
  6922. #define USB_OTG_DOEPCTL_EPTYP_0 ((uint32_t)0x00040000) /*!<Bit 0 */
  6923. #define USB_OTG_DOEPCTL_EPTYP_1 ((uint32_t)0x00080000) /*!<Bit 1 */
  6924. #define USB_OTG_DOEPCTL_SNPM ((uint32_t)0x00100000) /*!< Snoop mode */
  6925. #define USB_OTG_DOEPCTL_STALL ((uint32_t)0x00200000) /*!< STALL handshake */
  6926. #define USB_OTG_DOEPCTL_CNAK ((uint32_t)0x04000000) /*!< Clear NAK */
  6927. #define USB_OTG_DOEPCTL_SNAK ((uint32_t)0x08000000) /*!< Set NAK */
  6928. #define USB_OTG_DOEPCTL_EPDIS ((uint32_t)0x40000000) /*!< Endpoint disable */
  6929. #define USB_OTG_DOEPCTL_EPENA ((uint32_t)0x80000000) /*!< Endpoint enable */
  6930. /******************** Bit definition for USB_OTG_DOEPINT register ********************/
  6931. #define USB_OTG_DOEPINT_XFRC ((uint32_t)0x00000001) /*!< Transfer completed interrupt */
  6932. #define USB_OTG_DOEPINT_EPDISD ((uint32_t)0x00000002) /*!< Endpoint disabled interrupt */
  6933. #define USB_OTG_DOEPINT_STUP ((uint32_t)0x00000008) /*!< SETUP phase done */
  6934. #define USB_OTG_DOEPINT_OTEPDIS ((uint32_t)0x00000010) /*!< OUT token received when endpoint disabled */
  6935. #define USB_OTG_DOEPINT_OTEPSPR ((uint32_t)0x00000020) /*!< Status Phase Received For Control Write */
  6936. #define USB_OTG_DOEPINT_B2BSTUP ((uint32_t)0x00000040) /*!< Back-to-back SETUP packets received */
  6937. #define USB_OTG_DOEPINT_NYET ((uint32_t)0x00004000) /*!< NYET interrupt */
  6938. /******************** Bit definition for USB_OTG_DOEPTSIZ register ********************/
  6939. #define USB_OTG_DOEPTSIZ_XFRSIZ ((uint32_t)0x0007FFFF) /*!< Transfer size */
  6940. #define USB_OTG_DOEPTSIZ_PKTCNT ((uint32_t)0x1FF80000) /*!< Packet count */
  6941. #define USB_OTG_DOEPTSIZ_STUPCNT ((uint32_t)0x60000000) /*!< SETUP packet count */
  6942. #define USB_OTG_DOEPTSIZ_STUPCNT_0 ((uint32_t)0x20000000) /*!<Bit 0 */
  6943. #define USB_OTG_DOEPTSIZ_STUPCNT_1 ((uint32_t)0x40000000) /*!<Bit 1 */
  6944. /******************** Bit definition for PCGCCTL register ********************/
  6945. #define USB_OTG_PCGCCTL_STOPCLK ((uint32_t)0x00000001) /*!< SETUP packet count */
  6946. #define USB_OTG_PCGCCTL_GATECLK ((uint32_t)0x00000002) /*!<Bit 0 */
  6947. #define USB_OTG_PCGCCTL_PHYSUSP ((uint32_t)0x00000010) /*!<Bit 1 */
  6948. /**
  6949. * @}
  6950. */
  6951. /**
  6952. * @}
  6953. */
  6954. /** @addtogroup Exported_macros
  6955. * @{
  6956. */
  6957. /******************************* ADC Instances ********************************/
  6958. #define IS_ADC_ALL_INSTANCE(INSTANCE) (((INSTANCE) == ADC1) || \
  6959. ((INSTANCE) == ADC2) || \
  6960. ((INSTANCE) == ADC3))
  6961. /******************************* CAN Instances ********************************/
  6962. #define IS_CAN_ALL_INSTANCE(INSTANCE) (((INSTANCE) == CAN1) || \
  6963. ((INSTANCE) == CAN2))
  6964. /******************************* CRC Instances ********************************/
  6965. #define IS_CRC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CRC)
  6966. /******************************* DAC Instances ********************************/
  6967. #define IS_DAC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == DAC)
  6968. /******************************* DCMI Instances *******************************/
  6969. #define IS_DCMI_ALL_INSTANCE(INSTANCE) ((INSTANCE) == DCMI)
  6970. /******************************** DMA Instances *******************************/
  6971. #define IS_DMA_STREAM_ALL_INSTANCE(INSTANCE) (((INSTANCE) == DMA1_Stream0) || \
  6972. ((INSTANCE) == DMA1_Stream1) || \
  6973. ((INSTANCE) == DMA1_Stream2) || \
  6974. ((INSTANCE) == DMA1_Stream3) || \
  6975. ((INSTANCE) == DMA1_Stream4) || \
  6976. ((INSTANCE) == DMA1_Stream5) || \
  6977. ((INSTANCE) == DMA1_Stream6) || \
  6978. ((INSTANCE) == DMA1_Stream7) || \
  6979. ((INSTANCE) == DMA2_Stream0) || \
  6980. ((INSTANCE) == DMA2_Stream1) || \
  6981. ((INSTANCE) == DMA2_Stream2) || \
  6982. ((INSTANCE) == DMA2_Stream3) || \
  6983. ((INSTANCE) == DMA2_Stream4) || \
  6984. ((INSTANCE) == DMA2_Stream5) || \
  6985. ((INSTANCE) == DMA2_Stream6) || \
  6986. ((INSTANCE) == DMA2_Stream7))
  6987. /******************************* GPIO Instances *******************************/
  6988. #define IS_GPIO_ALL_INSTANCE(INSTANCE) (((INSTANCE) == GPIOA) || \
  6989. ((INSTANCE) == GPIOB) || \
  6990. ((INSTANCE) == GPIOC) || \
  6991. ((INSTANCE) == GPIOD) || \
  6992. ((INSTANCE) == GPIOE) || \
  6993. ((INSTANCE) == GPIOF) || \
  6994. ((INSTANCE) == GPIOG) || \
  6995. ((INSTANCE) == GPIOH))
  6996. /******************************** I2C Instances *******************************/
  6997. #define IS_I2C_ALL_INSTANCE(INSTANCE) (((INSTANCE) == I2C1) || \
  6998. ((INSTANCE) == I2C2) || \
  6999. ((INSTANCE) == I2C3))
  7000. /******************************** I2S Instances *******************************/
  7001. #define IS_I2S_ALL_INSTANCE(INSTANCE) (((INSTANCE) == SPI1) || \
  7002. ((INSTANCE) == SPI2) || \
  7003. ((INSTANCE) == SPI3))
  7004. /****************************** RTC Instances *********************************/
  7005. #define IS_RTC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == RTC)
  7006. /******************************* SAI Instances ********************************/
  7007. #define IS_SAI_BLOCK_PERIPH(PERIPH) (((PERIPH) == SAI1_Block_A) || \
  7008. ((PERIPH) == SAI1_Block_B) || \
  7009. ((PERIPH) == SAI2_Block_A) || \
  7010. ((PERIPH) == SAI2_Block_B))
  7011. /******************************** SPI Instances *******************************/
  7012. #define IS_SPI_ALL_INSTANCE(INSTANCE) (((INSTANCE) == SPI1) || \
  7013. ((INSTANCE) == SPI2) || \
  7014. ((INSTANCE) == SPI3) || \
  7015. ((INSTANCE) == SPI4))
  7016. /****************** TIM Instances : All supported instances *******************/
  7017. #define IS_TIM_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  7018. ((INSTANCE) == TIM2) || \
  7019. ((INSTANCE) == TIM3) || \
  7020. ((INSTANCE) == TIM4) || \
  7021. ((INSTANCE) == TIM5) || \
  7022. ((INSTANCE) == TIM6) || \
  7023. ((INSTANCE) == TIM7) || \
  7024. ((INSTANCE) == TIM8) || \
  7025. ((INSTANCE) == TIM9) || \
  7026. ((INSTANCE) == TIM10) || \
  7027. ((INSTANCE) == TIM11) || \
  7028. ((INSTANCE) == TIM12) || \
  7029. ((INSTANCE) == TIM13) || \
  7030. ((INSTANCE) == TIM14))
  7031. /************* TIM Instances : at least 1 capture/compare channel *************/
  7032. #define IS_TIM_CC1_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  7033. ((INSTANCE) == TIM2) || \
  7034. ((INSTANCE) == TIM3) || \
  7035. ((INSTANCE) == TIM4) || \
  7036. ((INSTANCE) == TIM5) || \
  7037. ((INSTANCE) == TIM8) || \
  7038. ((INSTANCE) == TIM9) || \
  7039. ((INSTANCE) == TIM10) || \
  7040. ((INSTANCE) == TIM11) || \
  7041. ((INSTANCE) == TIM12) || \
  7042. ((INSTANCE) == TIM13) || \
  7043. ((INSTANCE) == TIM14))
  7044. /************ TIM Instances : at least 2 capture/compare channels *************/
  7045. #define IS_TIM_CC2_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  7046. ((INSTANCE) == TIM2) || \
  7047. ((INSTANCE) == TIM3) || \
  7048. ((INSTANCE) == TIM4) || \
  7049. ((INSTANCE) == TIM5) || \
  7050. ((INSTANCE) == TIM8) || \
  7051. ((INSTANCE) == TIM9) || \
  7052. ((INSTANCE) == TIM12))
  7053. /************ TIM Instances : at least 3 capture/compare channels *************/
  7054. #define IS_TIM_CC3_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  7055. ((INSTANCE) == TIM2) || \
  7056. ((INSTANCE) == TIM3) || \
  7057. ((INSTANCE) == TIM4) || \
  7058. ((INSTANCE) == TIM5) || \
  7059. ((INSTANCE) == TIM8))
  7060. /************ TIM Instances : at least 4 capture/compare channels *************/
  7061. #define IS_TIM_CC4_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  7062. ((INSTANCE) == TIM2) || \
  7063. ((INSTANCE) == TIM3) || \
  7064. ((INSTANCE) == TIM4) || \
  7065. ((INSTANCE) == TIM5) || \
  7066. ((INSTANCE) == TIM8))
  7067. /******************** TIM Instances : Advanced-control timers *****************/
  7068. #define IS_TIM_ADVANCED_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  7069. ((INSTANCE) == TIM8))
  7070. /******************* TIM Instances : Timer input XOR function *****************/
  7071. #define IS_TIM_XOR_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  7072. ((INSTANCE) == TIM2) || \
  7073. ((INSTANCE) == TIM3) || \
  7074. ((INSTANCE) == TIM4) || \
  7075. ((INSTANCE) == TIM5) || \
  7076. ((INSTANCE) == TIM8))
  7077. /****************** TIM Instances : DMA requests generation (UDE) *************/
  7078. #define IS_TIM_DMA_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  7079. ((INSTANCE) == TIM2) || \
  7080. ((INSTANCE) == TIM3) || \
  7081. ((INSTANCE) == TIM4) || \
  7082. ((INSTANCE) == TIM5) || \
  7083. ((INSTANCE) == TIM6) || \
  7084. ((INSTANCE) == TIM7) || \
  7085. ((INSTANCE) == TIM8))
  7086. /************ TIM Instances : DMA requests generation (CCxDE) *****************/
  7087. #define IS_TIM_DMA_CC_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  7088. ((INSTANCE) == TIM2) || \
  7089. ((INSTANCE) == TIM3) || \
  7090. ((INSTANCE) == TIM4) || \
  7091. ((INSTANCE) == TIM5) || \
  7092. ((INSTANCE) == TIM8))
  7093. /************ TIM Instances : DMA requests generation (COMDE) *****************/
  7094. #define IS_TIM_CCDMA_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  7095. ((INSTANCE) == TIM2) || \
  7096. ((INSTANCE) == TIM3) || \
  7097. ((INSTANCE) == TIM4) || \
  7098. ((INSTANCE) == TIM5) || \
  7099. ((INSTANCE) == TIM8))
  7100. /******************** TIM Instances : DMA burst feature ***********************/
  7101. #define IS_TIM_DMABURST_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  7102. ((INSTANCE) == TIM2) || \
  7103. ((INSTANCE) == TIM3) || \
  7104. ((INSTANCE) == TIM4) || \
  7105. ((INSTANCE) == TIM5) || \
  7106. ((INSTANCE) == TIM8))
  7107. /****** TIM Instances : master mode available (TIMx_CR2.MMS available )********/
  7108. #define IS_TIM_MASTER_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  7109. ((INSTANCE) == TIM2) || \
  7110. ((INSTANCE) == TIM3) || \
  7111. ((INSTANCE) == TIM4) || \
  7112. ((INSTANCE) == TIM5) || \
  7113. ((INSTANCE) == TIM6) || \
  7114. ((INSTANCE) == TIM7) || \
  7115. ((INSTANCE) == TIM8) || \
  7116. ((INSTANCE) == TIM9) || \
  7117. ((INSTANCE) == TIM12))
  7118. /*********** TIM Instances : Slave mode available (TIMx_SMCR available )*******/
  7119. #define IS_TIM_SLAVE_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  7120. ((INSTANCE) == TIM2) || \
  7121. ((INSTANCE) == TIM3) || \
  7122. ((INSTANCE) == TIM4) || \
  7123. ((INSTANCE) == TIM5) || \
  7124. ((INSTANCE) == TIM8) || \
  7125. ((INSTANCE) == TIM9) || \
  7126. ((INSTANCE) == TIM12))
  7127. /********************** TIM Instances : 32 bit Counter ************************/
  7128. #define IS_TIM_32B_COUNTER_INSTANCE(INSTANCE)(((INSTANCE) == TIM2) || \
  7129. ((INSTANCE) == TIM5))
  7130. /***************** TIM Instances : external trigger input availabe ************/
  7131. #define IS_TIM_ETR_INSTANCE(INSTANCE) (((INSTANCE) == TIM1) || \
  7132. ((INSTANCE) == TIM2) || \
  7133. ((INSTANCE) == TIM3) || \
  7134. ((INSTANCE) == TIM4) || \
  7135. ((INSTANCE) == TIM5) || \
  7136. ((INSTANCE) == TIM8))
  7137. /****************** TIM Instances : remapping capability **********************/
  7138. #define IS_TIM_REMAP_INSTANCE(INSTANCE) (((INSTANCE) == TIM2) || \
  7139. ((INSTANCE) == TIM5) || \
  7140. ((INSTANCE) == TIM11))
  7141. /******************* TIM Instances : output(s) available **********************/
  7142. #define IS_TIM_CCX_INSTANCE(INSTANCE, CHANNEL) \
  7143. ((((INSTANCE) == TIM1) && \
  7144. (((CHANNEL) == TIM_CHANNEL_1) || \
  7145. ((CHANNEL) == TIM_CHANNEL_2) || \
  7146. ((CHANNEL) == TIM_CHANNEL_3) || \
  7147. ((CHANNEL) == TIM_CHANNEL_4))) \
  7148. || \
  7149. (((INSTANCE) == TIM2) && \
  7150. (((CHANNEL) == TIM_CHANNEL_1) || \
  7151. ((CHANNEL) == TIM_CHANNEL_2) || \
  7152. ((CHANNEL) == TIM_CHANNEL_3) || \
  7153. ((CHANNEL) == TIM_CHANNEL_4))) \
  7154. || \
  7155. (((INSTANCE) == TIM3) && \
  7156. (((CHANNEL) == TIM_CHANNEL_1) || \
  7157. ((CHANNEL) == TIM_CHANNEL_2) || \
  7158. ((CHANNEL) == TIM_CHANNEL_3) || \
  7159. ((CHANNEL) == TIM_CHANNEL_4))) \
  7160. || \
  7161. (((INSTANCE) == TIM4) && \
  7162. (((CHANNEL) == TIM_CHANNEL_1) || \
  7163. ((CHANNEL) == TIM_CHANNEL_2) || \
  7164. ((CHANNEL) == TIM_CHANNEL_3) || \
  7165. ((CHANNEL) == TIM_CHANNEL_4))) \
  7166. || \
  7167. (((INSTANCE) == TIM5) && \
  7168. (((CHANNEL) == TIM_CHANNEL_1) || \
  7169. ((CHANNEL) == TIM_CHANNEL_2) || \
  7170. ((CHANNEL) == TIM_CHANNEL_3) || \
  7171. ((CHANNEL) == TIM_CHANNEL_4))) \
  7172. || \
  7173. (((INSTANCE) == TIM8) && \
  7174. (((CHANNEL) == TIM_CHANNEL_1) || \
  7175. ((CHANNEL) == TIM_CHANNEL_2) || \
  7176. ((CHANNEL) == TIM_CHANNEL_3) || \
  7177. ((CHANNEL) == TIM_CHANNEL_4))) \
  7178. || \
  7179. (((INSTANCE) == TIM9) && \
  7180. (((CHANNEL) == TIM_CHANNEL_1) || \
  7181. ((CHANNEL) == TIM_CHANNEL_2))) \
  7182. || \
  7183. (((INSTANCE) == TIM10) && \
  7184. (((CHANNEL) == TIM_CHANNEL_1))) \
  7185. || \
  7186. (((INSTANCE) == TIM11) && \
  7187. (((CHANNEL) == TIM_CHANNEL_1))) \
  7188. || \
  7189. (((INSTANCE) == TIM12) && \
  7190. (((CHANNEL) == TIM_CHANNEL_1) || \
  7191. ((CHANNEL) == TIM_CHANNEL_2))) \
  7192. || \
  7193. (((INSTANCE) == TIM13) && \
  7194. (((CHANNEL) == TIM_CHANNEL_1))) \
  7195. || \
  7196. (((INSTANCE) == TIM14) && \
  7197. (((CHANNEL) == TIM_CHANNEL_1))))
  7198. /************ TIM Instances : complementary output(s) available ***************/
  7199. #define IS_TIM_CCXN_INSTANCE(INSTANCE, CHANNEL) \
  7200. ((((INSTANCE) == TIM1) && \
  7201. (((CHANNEL) == TIM_CHANNEL_1) || \
  7202. ((CHANNEL) == TIM_CHANNEL_2) || \
  7203. ((CHANNEL) == TIM_CHANNEL_3))) \
  7204. || \
  7205. (((INSTANCE) == TIM8) && \
  7206. (((CHANNEL) == TIM_CHANNEL_1) || \
  7207. ((CHANNEL) == TIM_CHANNEL_2) || \
  7208. ((CHANNEL) == TIM_CHANNEL_3))))
  7209. /******************** USART Instances : Synchronous mode **********************/
  7210. #define IS_USART_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  7211. ((INSTANCE) == USART2) || \
  7212. ((INSTANCE) == USART3) || \
  7213. ((INSTANCE) == USART6))
  7214. /******************** UART Instances : Asynchronous mode **********************/
  7215. #define IS_UART_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  7216. ((INSTANCE) == USART2) || \
  7217. ((INSTANCE) == USART3) || \
  7218. ((INSTANCE) == UART4) || \
  7219. ((INSTANCE) == UART5) || \
  7220. ((INSTANCE) == USART6))
  7221. /****************** UART Instances : Hardware Flow control ********************/
  7222. #define IS_UART_HWFLOW_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  7223. ((INSTANCE) == USART2) || \
  7224. ((INSTANCE) == USART3) || \
  7225. ((INSTANCE) == USART6))
  7226. /********************* UART Instances : Smard card mode ***********************/
  7227. #define IS_SMARTCARD_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  7228. ((INSTANCE) == USART2) || \
  7229. ((INSTANCE) == USART3) || \
  7230. ((INSTANCE) == USART6))
  7231. /*********************** UART Instances : IRDA mode ***************************/
  7232. #define IS_IRDA_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  7233. ((INSTANCE) == USART2) || \
  7234. ((INSTANCE) == USART3) || \
  7235. ((INSTANCE) == UART4) || \
  7236. ((INSTANCE) == UART5) || \
  7237. ((INSTANCE) == USART6))
  7238. /*********************** PCD Instances ****************************************/
  7239. #define IS_PCD_ALL_INSTANCE(INSTANCE) (((INSTANCE) == USB_OTG_FS) || \
  7240. ((INSTANCE) == USB_OTG_HS))
  7241. /*********************** HCD Instances ****************************************/
  7242. #define IS_HCD_ALL_INSTANCE(INSTANCE) (((INSTANCE) == USB_OTG_FS) || \
  7243. ((INSTANCE) == USB_OTG_HS))
  7244. /****************************** SDIO Instances ********************************/
  7245. #define IS_SDIO_ALL_INSTANCE(INSTANCE) ((INSTANCE) == SDIO)
  7246. /****************************** IWDG Instances ********************************/
  7247. #define IS_IWDG_ALL_INSTANCE(INSTANCE) ((INSTANCE) == IWDG)
  7248. /****************************** WWDG Instances ********************************/
  7249. #define IS_WWDG_ALL_INSTANCE(INSTANCE) ((INSTANCE) == WWDG)
  7250. /****************************** QSPI Instances ********************************/
  7251. #define IS_QSPI_ALL_INSTANCE(__INSTANCE__) ((__INSTANCE__) == QUADSPI)
  7252. /******************************* CEC Instances ********************************/
  7253. #define IS_CEC_ALL_INSTANCE(__INSTANCE__) ((__INSTANCE__) == CEC)
  7254. /***************************** FMPI2C Instances *******************************/
  7255. #define IS_FMPI2C_ALL_INSTANCE(__INSTANCE__) ((__INSTANCE__) == FMPI2C1)
  7256. /******************************* SPDIFRX Instances ********************************/
  7257. #define IS_SPDIFRX_ALL_INSTANCE(INSTANCE) ((INSTANCE) == SPDIFRX)
  7258. /****************************** USB Exported Constants ************************/
  7259. #define USB_OTG_FS_HOST_MAX_CHANNEL_NBR 8
  7260. #define USB_OTG_FS_MAX_IN_ENDPOINTS 5 /* Including EP0 */
  7261. #define USB_OTG_FS_MAX_OUT_ENDPOINTS 5 /* Including EP0 */
  7262. #define USB_OTG_FS_TOTAL_FIFO_SIZE 1280 /* in Bytes */
  7263. #define USB_OTG_HS_HOST_MAX_CHANNEL_NBR 16
  7264. #define USB_OTG_HS_MAX_IN_ENDPOINTS 8 /* Including EP0 */
  7265. #define USB_OTG_HS_MAX_IN_ENDPOINTS 8 /* Including EP0 */
  7266. #define USB_OTG_HS_TOTAL_FIFO_SIZE 4096 /* in Bytes */
  7267. /******************************************************************************/
  7268. /* For a painless codes migration between the STM32F4xx device product */
  7269. /* lines, the aliases defined below are put in place to overcome the */
  7270. /* differences in the interrupt handlers and IRQn definitions. */
  7271. /* No need to update developed interrupt code when moving across */
  7272. /* product lines within the same STM32F4 Family */
  7273. /******************************************************************************/
  7274. /* Aliases for __IRQHandler */
  7275. #define QuadSPI_IRQHandler QUADSPI_IRQHandler
  7276. /**
  7277. * @}
  7278. */
  7279. /**
  7280. * @}
  7281. */
  7282. /**
  7283. * @}
  7284. */
  7285. #ifdef __cplusplus
  7286. }
  7287. #endif /* __cplusplus */
  7288. #endif /* __STM32F446xx_H */
  7289. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/