stm32h7xx_hal_rcc.h 493 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266
  1. /**
  2. ******************************************************************************
  3. * @file stm32h7xx_hal_rcc.h
  4. * @author MCD Application Team
  5. * @brief Header file of RCC HAL module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * Copyright (c) 2017 STMicroelectronics.
  10. * All rights reserved.
  11. *
  12. * This software is licensed under terms that can be found in the LICENSE file in
  13. * the root directory of this software component.
  14. * If no LICENSE file comes with this software, it is provided AS-IS.
  15. ******************************************************************************
  16. */
  17. /* Define to prevent recursive inclusion -------------------------------------*/
  18. #ifndef STM32H7xx_HAL_RCC_H
  19. #define STM32H7xx_HAL_RCC_H
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. /* Includes ------------------------------------------------------------------*/
  24. #include "stm32h7xx_hal_def.h"
  25. /** @addtogroup STM32H7xx_HAL_Driver
  26. * @{
  27. */
  28. /** @addtogroup RCC
  29. * @{
  30. */
  31. /* Exported types ------------------------------------------------------------*/
  32. /** @defgroup RCC_Exported_Types RCC Exported Types
  33. * @{
  34. */
  35. /**
  36. * @brief RCC PLL configuration structure definition
  37. */
  38. typedef struct
  39. {
  40. uint32_t PLLState; /*!< The new state of the PLL.
  41. This parameter can be a value of @ref RCC_PLL_Config */
  42. uint32_t PLLSource; /*!< RCC_PLLSource: PLL entry clock source.
  43. This parameter must be a value of @ref RCC_PLL_Clock_Source */
  44. uint32_t PLLM; /*!< PLLM: Division factor for PLL VCO input clock.
  45. This parameter must be a number between Min_Data = 1 and Max_Data = 63 */
  46. uint32_t PLLN; /*!< PLLN: Multiplication factor for PLL VCO output clock.
  47. This parameter must be a number between Min_Data = 4 and Max_Data = 512
  48. or between Min_Data = 8 and Max_Data = 420(*)
  49. (*) : For stm32h7a3xx and stm32h7b3xx family lines. */
  50. uint32_t PLLP; /*!< PLLP: Division factor for system clock.
  51. This parameter must be a number between Min_Data = 2 and Max_Data = 128
  52. odd division factors are not allowed */
  53. uint32_t PLLQ; /*!< PLLQ: Division factor for peripheral clocks.
  54. This parameter must be a number between Min_Data = 1 and Max_Data = 128 */
  55. uint32_t PLLR; /*!< PLLR: Division factor for peripheral clocks.
  56. This parameter must be a number between Min_Data = 1 and Max_Data = 128 */
  57. uint32_t PLLRGE; /*!<PLLRGE: PLL1 clock Input range
  58. This parameter must be a value of @ref RCC_PLL1_VCI_Range */
  59. uint32_t PLLVCOSEL; /*!<PLLVCOSEL: PLL1 clock Output range
  60. This parameter must be a value of @ref RCC_PLL1_VCO_Range */
  61. uint32_t PLLFRACN; /*!<PLLFRACN: Specifies Fractional Part Of The Multiplication Factor for
  62. PLL1 VCO It should be a value between 0 and 8191 */
  63. } RCC_PLLInitTypeDef;
  64. /**
  65. * @brief RCC Internal/External Oscillator (HSE, HSI, CSI, LSE and LSI) configuration structure definition
  66. */
  67. typedef struct
  68. {
  69. uint32_t OscillatorType; /*!< The oscillators to be configured.
  70. This parameter can be a value of @ref RCC_Oscillator_Type */
  71. uint32_t HSEState; /*!< The new state of the HSE.
  72. This parameter can be a value of @ref RCC_HSE_Config */
  73. uint32_t LSEState; /*!< The new state of the LSE.
  74. This parameter can be a value of @ref RCC_LSE_Config */
  75. uint32_t HSIState; /*!< The new state of the HSI.
  76. This parameter can be a value of @ref RCC_HSI_Config */
  77. uint32_t HSICalibrationValue; /*!< The calibration trimming value.
  78. This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x3F for STM32H7 rev.Y
  79. This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x7F for STM32H7 rev.B and above */
  80. uint32_t LSIState; /*!< The new state of the LSI.
  81. This parameter can be a value of @ref RCC_LSI_Config */
  82. uint32_t HSI48State; /*!< The new state of the HSI48.
  83. This parameter can be a value of @ref RCC_HSI48_Config */
  84. uint32_t CSIState; /*!< The new state of the CSI.
  85. This parameter can be a value of @ref RCC_CSI_Config */
  86. uint32_t CSICalibrationValue; /*!< The calibration trimming value.
  87. This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x1F for STM32H7 rev.Y
  88. This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x3F for STM32H7 rev.B and above */
  89. RCC_PLLInitTypeDef PLL; /*!< PLL structure parameters */
  90. } RCC_OscInitTypeDef;
  91. /**
  92. * @brief RCC System, AHB and APB busses clock configuration structure definition
  93. */
  94. typedef struct
  95. {
  96. uint32_t ClockType; /*!< The clock to be configured.
  97. This parameter can be a value of @ref RCC_System_Clock_Type */
  98. uint32_t SYSCLKSource; /*!< The clock source (SYSCLKS) used as system clock.
  99. This parameter can be a value of @ref RCC_System_Clock_Source */
  100. uint32_t SYSCLKDivider; /*!< The system clock divider. This parameter can be
  101. a value of @ref RCC_SYS_Clock_Source */
  102. uint32_t AHBCLKDivider; /*!< The AHB clock (HCLK) divider. This clock is derived from the system clock (SYSCLK).
  103. This parameter can be a value of @ref RCC_HCLK_Clock_Source */
  104. uint32_t APB3CLKDivider; /*!< The APB3 clock (D1PCLK1) divider. This clock is derived from the AHB clock (HCLK).
  105. This parameter can be a value of @ref RCC_APB3_Clock_Source */
  106. uint32_t APB1CLKDivider; /*!< The APB1 clock (PCLK1) divider. This clock is derived from the AHB clock (HCLK).
  107. This parameter can be a value of @ref RCC_APB1_Clock_Source */
  108. uint32_t APB2CLKDivider; /*!< The APB2 clock (PCLK2) divider. This clock is derived from the AHB clock (HCLK).
  109. This parameter can be a value of @ref RCC_APB2_Clock_Source */
  110. uint32_t APB4CLKDivider; /*!< The APB4 clock (D3PCLK1) divider. This clock is derived from the AHB clock (HCLK).
  111. This parameter can be a value of @ref RCC_APB4_Clock_Source */
  112. } RCC_ClkInitTypeDef;
  113. /**
  114. * @}
  115. */
  116. /* Exported constants --------------------------------------------------------*/
  117. /** @defgroup RCC_Exported_Constants RCC Exported Constants
  118. * @{
  119. */
  120. /** @defgroup RCC_Oscillator_Type RCC Oscillator Type
  121. * @{
  122. */
  123. #define RCC_OSCILLATORTYPE_NONE (0x00000000U)
  124. #define RCC_OSCILLATORTYPE_HSE (0x00000001U)
  125. #define RCC_OSCILLATORTYPE_HSI (0x00000002U)
  126. #define RCC_OSCILLATORTYPE_LSE (0x00000004U)
  127. #define RCC_OSCILLATORTYPE_LSI (0x00000008U)
  128. #define RCC_OSCILLATORTYPE_CSI (0x00000010U)
  129. #define RCC_OSCILLATORTYPE_HSI48 (0x00000020U)
  130. /**
  131. * @}
  132. */
  133. /** @defgroup RCC_HSE_Config RCC HSE Config
  134. * @{
  135. */
  136. #define RCC_HSE_OFF (0x00000000U)
  137. #define RCC_HSE_ON RCC_CR_HSEON
  138. #define RCC_HSE_BYPASS ((uint32_t)(RCC_CR_HSEBYP | RCC_CR_HSEON))
  139. #if defined(RCC_CR_HSEEXT)
  140. #define RCC_HSE_BYPASS_DIGITAL ((uint32_t)(RCC_CR_HSEEXT | RCC_CR_HSEBYP | RCC_CR_HSEON))
  141. #endif /* RCC_CR_HSEEXT */
  142. /**
  143. * @}
  144. */
  145. /** @defgroup RCC_LSE_Config RCC LSE Config
  146. * @{
  147. */
  148. #define RCC_LSE_OFF (0x00000000U)
  149. #define RCC_LSE_ON RCC_BDCR_LSEON
  150. #define RCC_LSE_BYPASS ((uint32_t)(RCC_BDCR_LSEBYP | RCC_BDCR_LSEON))
  151. #if defined(RCC_BDCR_LSEEXT)
  152. #define RCC_LSE_BYPASS_DIGITAL ((uint32_t)(RCC_BDCR_LSEEXT | RCC_BDCR_LSEBYP | RCC_BDCR_LSEON))
  153. #endif /* RCC_BDCR_LSEEXT */
  154. /**
  155. * @}
  156. */
  157. /** @defgroup RCC_HSI_Config RCC HSI Config
  158. * @{
  159. */
  160. #define RCC_HSI_OFF (0x00000000U) /*!< HSI clock deactivation */
  161. #define RCC_HSI_ON RCC_CR_HSION /*!< HSI clock activation */
  162. #define RCC_HSI_DIV1 (RCC_CR_HSIDIV_1 | RCC_CR_HSION) /*!< HSI_DIV1 clock activation */
  163. #define RCC_HSI_DIV2 (RCC_CR_HSIDIV_2 | RCC_CR_HSION) /*!< HSI_DIV2 clock activation */
  164. #define RCC_HSI_DIV4 (RCC_CR_HSIDIV_4 | RCC_CR_HSION) /*!< HSI_DIV4 clock activation */
  165. #define RCC_HSI_DIV8 (RCC_CR_HSIDIV | RCC_CR_HSION) /*!< HSI_DIV8 clock activation */
  166. #define RCC_HSICALIBRATION_DEFAULT (0x40U) /* Default HSI calibration trimming value for STM32H7 rev.V and above. (0x20 value for rev.Y handled within __HAL_RCC_HSI_CALIBRATIONVALUE_ADJUST macro ) */
  167. /**
  168. * @}
  169. */
  170. /** @defgroup RCC_HSI48_Config RCC HSI48 Config
  171. * @{
  172. */
  173. #define RCC_HSI48_OFF ((uint8_t)0x00)
  174. #define RCC_HSI48_ON ((uint8_t)0x01)
  175. /**
  176. * @}
  177. */
  178. /** @defgroup RCC_LSI_Config RCC LSI Config
  179. * @{
  180. */
  181. #define RCC_LSI_OFF (0x00000000U)
  182. #define RCC_LSI_ON RCC_CSR_LSION
  183. /**
  184. * @}
  185. */
  186. /** @defgroup RCC_CSI_Config RCC CSI Config
  187. * @{
  188. */
  189. #define RCC_CSI_OFF (0x00000000U)
  190. #define RCC_CSI_ON RCC_CR_CSION
  191. #define RCC_CSICALIBRATION_DEFAULT (0x20U) /* Default CSI calibration trimming value for STM32H7 rev.V and above. (0x10 value for rev.Y handled within __HAL_RCC_CSI_CALIBRATIONVALUE_ADJUST macro ) */
  192. /**
  193. * @}
  194. */
  195. /** @defgroup RCC_PLL_Config RCC PLL Config
  196. * @{
  197. */
  198. #define RCC_PLL_NONE (0x00000000U)
  199. #define RCC_PLL_OFF (0x00000001U)
  200. #define RCC_PLL_ON (0x00000002U)
  201. /**
  202. * @}
  203. */
  204. /** @defgroup RCC_PLL_Clock_Source RCC PLL Clock Source
  205. * @{
  206. */
  207. #define RCC_PLLSOURCE_HSI (0x00000000U)
  208. #define RCC_PLLSOURCE_CSI (0x00000001U)
  209. #define RCC_PLLSOURCE_HSE (0x00000002U)
  210. #define RCC_PLLSOURCE_NONE (0x00000003U)
  211. /**
  212. * @}
  213. */
  214. /** @defgroup RCC_PLL_Clock_Output RCC PLL Clock Output
  215. * @{
  216. */
  217. #define RCC_PLL1_DIVP RCC_PLLCFGR_DIVP1EN
  218. #define RCC_PLL1_DIVQ RCC_PLLCFGR_DIVQ1EN
  219. #define RCC_PLL1_DIVR RCC_PLLCFGR_DIVR1EN
  220. /**
  221. * @}
  222. */
  223. /** @defgroup RCC_PLL1_VCI_Range RCC PLL1 VCI Range
  224. * @{
  225. */
  226. #define RCC_PLL1VCIRANGE_0 RCC_PLLCFGR_PLL1RGE_0 /*!< Clock range frequency between 1 and 2 MHz */
  227. #define RCC_PLL1VCIRANGE_1 RCC_PLLCFGR_PLL1RGE_1 /*!< Clock range frequency between 2 and 4 MHz */
  228. #define RCC_PLL1VCIRANGE_2 RCC_PLLCFGR_PLL1RGE_2 /*!< Clock range frequency between 4 and 8 MHz */
  229. #define RCC_PLL1VCIRANGE_3 RCC_PLLCFGR_PLL1RGE_3 /*!< Clock range frequency between 8 and 16 MHz */
  230. /**
  231. * @}
  232. */
  233. /** @defgroup RCC_PLL1_VCO_Range RCC PLL1 VCO Range
  234. * @{
  235. */
  236. #define RCC_PLL1VCOWIDE (0x00000000U)
  237. #define RCC_PLL1VCOMEDIUM RCC_PLLCFGR_PLL1VCOSEL
  238. /**
  239. * @}
  240. */
  241. /** @defgroup RCC_System_Clock_Type RCC System Clock Type
  242. * @{
  243. */
  244. #define RCC_CLOCKTYPE_SYSCLK (0x00000001U)
  245. #define RCC_CLOCKTYPE_HCLK (0x00000002U)
  246. #define RCC_CLOCKTYPE_D1PCLK1 (0x00000004U)
  247. #define RCC_CLOCKTYPE_PCLK1 (0x00000008U)
  248. #define RCC_CLOCKTYPE_PCLK2 (0x00000010U)
  249. #define RCC_CLOCKTYPE_D3PCLK1 (0x00000020U)
  250. /**
  251. * @}
  252. */
  253. /** @defgroup RCC_System_Clock_Source RCC System Clock Source
  254. * @{
  255. */
  256. #define RCC_SYSCLKSOURCE_CSI RCC_CFGR_SW_CSI
  257. #define RCC_SYSCLKSOURCE_HSI RCC_CFGR_SW_HSI
  258. #define RCC_SYSCLKSOURCE_HSE RCC_CFGR_SW_HSE
  259. #define RCC_SYSCLKSOURCE_PLLCLK RCC_CFGR_SW_PLL1
  260. /**
  261. * @}
  262. */
  263. /** @defgroup RCC_System_Clock_Source_Status System Clock Source Status
  264. * @{
  265. */
  266. #define RCC_SYSCLKSOURCE_STATUS_CSI RCC_CFGR_SWS_CSI /*!< CSI used as system clock */
  267. #define RCC_SYSCLKSOURCE_STATUS_HSI RCC_CFGR_SWS_HSI /*!< HSI used as system clock */
  268. #define RCC_SYSCLKSOURCE_STATUS_HSE RCC_CFGR_SWS_HSE /*!< HSE used as system clock */
  269. #define RCC_SYSCLKSOURCE_STATUS_PLLCLK RCC_CFGR_SWS_PLL1 /*!< PLL1 used as system clock */
  270. /**
  271. * @}
  272. */
  273. /** @defgroup RCC_SYS_Clock_Source RCC SYS Clock Source
  274. * @{
  275. */
  276. #if defined(RCC_D1CFGR_D1CPRE_DIV1)
  277. #define RCC_SYSCLK_DIV1 RCC_D1CFGR_D1CPRE_DIV1
  278. #define RCC_SYSCLK_DIV2 RCC_D1CFGR_D1CPRE_DIV2
  279. #define RCC_SYSCLK_DIV4 RCC_D1CFGR_D1CPRE_DIV4
  280. #define RCC_SYSCLK_DIV8 RCC_D1CFGR_D1CPRE_DIV8
  281. #define RCC_SYSCLK_DIV16 RCC_D1CFGR_D1CPRE_DIV16
  282. #define RCC_SYSCLK_DIV64 RCC_D1CFGR_D1CPRE_DIV64
  283. #define RCC_SYSCLK_DIV128 RCC_D1CFGR_D1CPRE_DIV128
  284. #define RCC_SYSCLK_DIV256 RCC_D1CFGR_D1CPRE_DIV256
  285. #define RCC_SYSCLK_DIV512 RCC_D1CFGR_D1CPRE_DIV512
  286. #else
  287. #define RCC_SYSCLK_DIV1 RCC_CDCFGR1_CDCPRE_DIV1
  288. #define RCC_SYSCLK_DIV2 RCC_CDCFGR1_CDCPRE_DIV2
  289. #define RCC_SYSCLK_DIV4 RCC_CDCFGR1_CDCPRE_DIV4
  290. #define RCC_SYSCLK_DIV8 RCC_CDCFGR1_CDCPRE_DIV8
  291. #define RCC_SYSCLK_DIV16 RCC_CDCFGR1_CDCPRE_DIV16
  292. #define RCC_SYSCLK_DIV64 RCC_CDCFGR1_CDCPRE_DIV64
  293. #define RCC_SYSCLK_DIV128 RCC_CDCFGR1_CDCPRE_DIV128
  294. #define RCC_SYSCLK_DIV256 RCC_CDCFGR1_CDCPRE_DIV256
  295. #define RCC_SYSCLK_DIV512 RCC_CDCFGR1_CDCPRE_DIV512
  296. #endif
  297. /**
  298. * @}
  299. */
  300. /** @defgroup RCC_HCLK_Clock_Source RCC HCLK Clock Source
  301. * @{
  302. */
  303. #if defined(RCC_D1CFGR_HPRE_DIV1)
  304. #define RCC_HCLK_DIV1 RCC_D1CFGR_HPRE_DIV1
  305. #define RCC_HCLK_DIV2 RCC_D1CFGR_HPRE_DIV2
  306. #define RCC_HCLK_DIV4 RCC_D1CFGR_HPRE_DIV4
  307. #define RCC_HCLK_DIV8 RCC_D1CFGR_HPRE_DIV8
  308. #define RCC_HCLK_DIV16 RCC_D1CFGR_HPRE_DIV16
  309. #define RCC_HCLK_DIV64 RCC_D1CFGR_HPRE_DIV64
  310. #define RCC_HCLK_DIV128 RCC_D1CFGR_HPRE_DIV128
  311. #define RCC_HCLK_DIV256 RCC_D1CFGR_HPRE_DIV256
  312. #define RCC_HCLK_DIV512 RCC_D1CFGR_HPRE_DIV512
  313. #else
  314. #define RCC_HCLK_DIV1 RCC_CDCFGR1_HPRE_DIV1
  315. #define RCC_HCLK_DIV2 RCC_CDCFGR1_HPRE_DIV2
  316. #define RCC_HCLK_DIV4 RCC_CDCFGR1_HPRE_DIV4
  317. #define RCC_HCLK_DIV8 RCC_CDCFGR1_HPRE_DIV8
  318. #define RCC_HCLK_DIV16 RCC_CDCFGR1_HPRE_DIV16
  319. #define RCC_HCLK_DIV64 RCC_CDCFGR1_HPRE_DIV64
  320. #define RCC_HCLK_DIV128 RCC_CDCFGR1_HPRE_DIV128
  321. #define RCC_HCLK_DIV256 RCC_CDCFGR1_HPRE_DIV256
  322. #define RCC_HCLK_DIV512 RCC_CDCFGR1_HPRE_DIV512
  323. #endif
  324. /**
  325. * @}
  326. */
  327. /** @defgroup RCC_APB3_Clock_Source RCC APB3 Clock Source
  328. * @{
  329. */
  330. #if defined (RCC_D1CFGR_D1PPRE_DIV1)
  331. #define RCC_APB3_DIV1 RCC_D1CFGR_D1PPRE_DIV1
  332. #define RCC_APB3_DIV2 RCC_D1CFGR_D1PPRE_DIV2
  333. #define RCC_APB3_DIV4 RCC_D1CFGR_D1PPRE_DIV4
  334. #define RCC_APB3_DIV8 RCC_D1CFGR_D1PPRE_DIV8
  335. #define RCC_APB3_DIV16 RCC_D1CFGR_D1PPRE_DIV16
  336. #else
  337. #define RCC_APB3_DIV1 RCC_CDCFGR1_CDPPRE_DIV1
  338. #define RCC_APB3_DIV2 RCC_CDCFGR1_CDPPRE_DIV2
  339. #define RCC_APB3_DIV4 RCC_CDCFGR1_CDPPRE_DIV4
  340. #define RCC_APB3_DIV8 RCC_CDCFGR1_CDPPRE_DIV8
  341. #define RCC_APB3_DIV16 RCC_CDCFGR1_CDPPRE_DIV16
  342. #endif
  343. /**
  344. * @}
  345. */
  346. /** @defgroup RCC_APB1_Clock_Source RCC APB1 Clock Source
  347. * @{
  348. */
  349. #if defined (RCC_D2CFGR_D2PPRE1_DIV1)
  350. #define RCC_APB1_DIV1 RCC_D2CFGR_D2PPRE1_DIV1
  351. #define RCC_APB1_DIV2 RCC_D2CFGR_D2PPRE1_DIV2
  352. #define RCC_APB1_DIV4 RCC_D2CFGR_D2PPRE1_DIV4
  353. #define RCC_APB1_DIV8 RCC_D2CFGR_D2PPRE1_DIV8
  354. #define RCC_APB1_DIV16 RCC_D2CFGR_D2PPRE1_DIV16
  355. #else
  356. #define RCC_APB1_DIV1 RCC_CDCFGR2_CDPPRE1_DIV1
  357. #define RCC_APB1_DIV2 RCC_CDCFGR2_CDPPRE1_DIV2
  358. #define RCC_APB1_DIV4 RCC_CDCFGR2_CDPPRE1_DIV4
  359. #define RCC_APB1_DIV8 RCC_CDCFGR2_CDPPRE1_DIV8
  360. #define RCC_APB1_DIV16 RCC_CDCFGR2_CDPPRE1_DIV16
  361. #endif
  362. /**
  363. * @}
  364. */
  365. /** @defgroup RCC_APB2_Clock_Source RCC APB2 Clock Source
  366. * @{
  367. */
  368. #if defined (RCC_D2CFGR_D2PPRE2_DIV1)
  369. #define RCC_APB2_DIV1 RCC_D2CFGR_D2PPRE2_DIV1
  370. #define RCC_APB2_DIV2 RCC_D2CFGR_D2PPRE2_DIV2
  371. #define RCC_APB2_DIV4 RCC_D2CFGR_D2PPRE2_DIV4
  372. #define RCC_APB2_DIV8 RCC_D2CFGR_D2PPRE2_DIV8
  373. #define RCC_APB2_DIV16 RCC_D2CFGR_D2PPRE2_DIV16
  374. #else
  375. #define RCC_APB2_DIV1 RCC_CDCFGR2_CDPPRE2_DIV1
  376. #define RCC_APB2_DIV2 RCC_CDCFGR2_CDPPRE2_DIV2
  377. #define RCC_APB2_DIV4 RCC_CDCFGR2_CDPPRE2_DIV4
  378. #define RCC_APB2_DIV8 RCC_CDCFGR2_CDPPRE2_DIV8
  379. #define RCC_APB2_DIV16 RCC_CDCFGR2_CDPPRE2_DIV16
  380. #endif
  381. /**
  382. * @}
  383. */
  384. /** @defgroup RCC_APB4_Clock_Source RCC APB4 Clock Source
  385. * @{
  386. */
  387. #if defined(RCC_D3CFGR_D3PPRE_DIV1)
  388. #define RCC_APB4_DIV1 RCC_D3CFGR_D3PPRE_DIV1
  389. #define RCC_APB4_DIV2 RCC_D3CFGR_D3PPRE_DIV2
  390. #define RCC_APB4_DIV4 RCC_D3CFGR_D3PPRE_DIV4
  391. #define RCC_APB4_DIV8 RCC_D3CFGR_D3PPRE_DIV8
  392. #define RCC_APB4_DIV16 RCC_D3CFGR_D3PPRE_DIV16
  393. #else
  394. #define RCC_APB4_DIV1 RCC_SRDCFGR_SRDPPRE_DIV1
  395. #define RCC_APB4_DIV2 RCC_SRDCFGR_SRDPPRE_DIV2
  396. #define RCC_APB4_DIV4 RCC_SRDCFGR_SRDPPRE_DIV4
  397. #define RCC_APB4_DIV8 RCC_SRDCFGR_SRDPPRE_DIV8
  398. #define RCC_APB4_DIV16 RCC_SRDCFGR_SRDPPRE_DIV16
  399. #endif
  400. /**
  401. * @}
  402. */
  403. /** @defgroup RCC_RTC_Clock_Source RCC RTC Clock Source
  404. * @{
  405. */
  406. #define RCC_RTCCLKSOURCE_NO_CLK (0x00000000U)
  407. #define RCC_RTCCLKSOURCE_LSE (0x00000100U)
  408. #define RCC_RTCCLKSOURCE_LSI (0x00000200U)
  409. #define RCC_RTCCLKSOURCE_HSE_DIV2 (0x00002300U)
  410. #define RCC_RTCCLKSOURCE_HSE_DIV3 (0x00003300U)
  411. #define RCC_RTCCLKSOURCE_HSE_DIV4 (0x00004300U)
  412. #define RCC_RTCCLKSOURCE_HSE_DIV5 (0x00005300U)
  413. #define RCC_RTCCLKSOURCE_HSE_DIV6 (0x00006300U)
  414. #define RCC_RTCCLKSOURCE_HSE_DIV7 (0x00007300U)
  415. #define RCC_RTCCLKSOURCE_HSE_DIV8 (0x00008300U)
  416. #define RCC_RTCCLKSOURCE_HSE_DIV9 (0x00009300U)
  417. #define RCC_RTCCLKSOURCE_HSE_DIV10 (0x0000A300U)
  418. #define RCC_RTCCLKSOURCE_HSE_DIV11 (0x0000B300U)
  419. #define RCC_RTCCLKSOURCE_HSE_DIV12 (0x0000C300U)
  420. #define RCC_RTCCLKSOURCE_HSE_DIV13 (0x0000D300U)
  421. #define RCC_RTCCLKSOURCE_HSE_DIV14 (0x0000E300U)
  422. #define RCC_RTCCLKSOURCE_HSE_DIV15 (0x0000F300U)
  423. #define RCC_RTCCLKSOURCE_HSE_DIV16 (0x00010300U)
  424. #define RCC_RTCCLKSOURCE_HSE_DIV17 (0x00011300U)
  425. #define RCC_RTCCLKSOURCE_HSE_DIV18 (0x00012300U)
  426. #define RCC_RTCCLKSOURCE_HSE_DIV19 (0x00013300U)
  427. #define RCC_RTCCLKSOURCE_HSE_DIV20 (0x00014300U)
  428. #define RCC_RTCCLKSOURCE_HSE_DIV21 (0x00015300U)
  429. #define RCC_RTCCLKSOURCE_HSE_DIV22 (0x00016300U)
  430. #define RCC_RTCCLKSOURCE_HSE_DIV23 (0x00017300U)
  431. #define RCC_RTCCLKSOURCE_HSE_DIV24 (0x00018300U)
  432. #define RCC_RTCCLKSOURCE_HSE_DIV25 (0x00019300U)
  433. #define RCC_RTCCLKSOURCE_HSE_DIV26 (0x0001A300U)
  434. #define RCC_RTCCLKSOURCE_HSE_DIV27 (0x0001B300U)
  435. #define RCC_RTCCLKSOURCE_HSE_DIV28 (0x0001C300U)
  436. #define RCC_RTCCLKSOURCE_HSE_DIV29 (0x0001D300U)
  437. #define RCC_RTCCLKSOURCE_HSE_DIV30 (0x0001E300U)
  438. #define RCC_RTCCLKSOURCE_HSE_DIV31 (0x0001F300U)
  439. #define RCC_RTCCLKSOURCE_HSE_DIV32 (0x00020300U)
  440. #define RCC_RTCCLKSOURCE_HSE_DIV33 (0x00021300U)
  441. #define RCC_RTCCLKSOURCE_HSE_DIV34 (0x00022300U)
  442. #define RCC_RTCCLKSOURCE_HSE_DIV35 (0x00023300U)
  443. #define RCC_RTCCLKSOURCE_HSE_DIV36 (0x00024300U)
  444. #define RCC_RTCCLKSOURCE_HSE_DIV37 (0x00025300U)
  445. #define RCC_RTCCLKSOURCE_HSE_DIV38 (0x00026300U)
  446. #define RCC_RTCCLKSOURCE_HSE_DIV39 (0x00027300U)
  447. #define RCC_RTCCLKSOURCE_HSE_DIV40 (0x00028300U)
  448. #define RCC_RTCCLKSOURCE_HSE_DIV41 (0x00029300U)
  449. #define RCC_RTCCLKSOURCE_HSE_DIV42 (0x0002A300U)
  450. #define RCC_RTCCLKSOURCE_HSE_DIV43 (0x0002B300U)
  451. #define RCC_RTCCLKSOURCE_HSE_DIV44 (0x0002C300U)
  452. #define RCC_RTCCLKSOURCE_HSE_DIV45 (0x0002D300U)
  453. #define RCC_RTCCLKSOURCE_HSE_DIV46 (0x0002E300U)
  454. #define RCC_RTCCLKSOURCE_HSE_DIV47 (0x0002F300U)
  455. #define RCC_RTCCLKSOURCE_HSE_DIV48 (0x00030300U)
  456. #define RCC_RTCCLKSOURCE_HSE_DIV49 (0x00031300U)
  457. #define RCC_RTCCLKSOURCE_HSE_DIV50 (0x00032300U)
  458. #define RCC_RTCCLKSOURCE_HSE_DIV51 (0x00033300U)
  459. #define RCC_RTCCLKSOURCE_HSE_DIV52 (0x00034300U)
  460. #define RCC_RTCCLKSOURCE_HSE_DIV53 (0x00035300U)
  461. #define RCC_RTCCLKSOURCE_HSE_DIV54 (0x00036300U)
  462. #define RCC_RTCCLKSOURCE_HSE_DIV55 (0x00037300U)
  463. #define RCC_RTCCLKSOURCE_HSE_DIV56 (0x00038300U)
  464. #define RCC_RTCCLKSOURCE_HSE_DIV57 (0x00039300U)
  465. #define RCC_RTCCLKSOURCE_HSE_DIV58 (0x0003A300U)
  466. #define RCC_RTCCLKSOURCE_HSE_DIV59 (0x0003B300U)
  467. #define RCC_RTCCLKSOURCE_HSE_DIV60 (0x0003C300U)
  468. #define RCC_RTCCLKSOURCE_HSE_DIV61 (0x0003D300U)
  469. #define RCC_RTCCLKSOURCE_HSE_DIV62 (0x0003E300U)
  470. #define RCC_RTCCLKSOURCE_HSE_DIV63 (0x0003F300U)
  471. /**
  472. * @}
  473. */
  474. /** @defgroup RCC_MCO_Index RCC MCO Index
  475. * @{
  476. */
  477. #define RCC_MCO1 (0x00000000U)
  478. #define RCC_MCO2 (0x00000001U)
  479. /**
  480. * @}
  481. */
  482. /** @defgroup RCC_MCO1_Clock_Source RCC MCO1 Clock Source
  483. * @{
  484. */
  485. #define RCC_MCO1SOURCE_HSI (0x00000000U)
  486. #define RCC_MCO1SOURCE_LSE RCC_CFGR_MCO1_0
  487. #define RCC_MCO1SOURCE_HSE RCC_CFGR_MCO1_1
  488. #define RCC_MCO1SOURCE_PLL1QCLK ((uint32_t)RCC_CFGR_MCO1_0 | RCC_CFGR_MCO1_1)
  489. #define RCC_MCO1SOURCE_HSI48 RCC_CFGR_MCO1_2
  490. /**
  491. * @}
  492. */
  493. /** @defgroup RCC_MCO2_Clock_Source RCC MCO2 Clock Source
  494. * @{
  495. */
  496. #define RCC_MCO2SOURCE_SYSCLK (0x00000000U)
  497. #define RCC_MCO2SOURCE_PLL2PCLK RCC_CFGR_MCO2_0
  498. #define RCC_MCO2SOURCE_HSE RCC_CFGR_MCO2_1
  499. #define RCC_MCO2SOURCE_PLLCLK ((uint32_t)RCC_CFGR_MCO2_0 | RCC_CFGR_MCO2_1)
  500. #define RCC_MCO2SOURCE_CSICLK RCC_CFGR_MCO2_2
  501. #define RCC_MCO2SOURCE_LSICLK ((uint32_t)RCC_CFGR_MCO2_0 | RCC_CFGR_MCO2_2)
  502. /**
  503. * @}
  504. */
  505. /** @defgroup RCC_MCOx_Clock_Prescaler RCC MCOx Clock Prescaler
  506. * @{
  507. */
  508. #define RCC_MCODIV_1 RCC_CFGR_MCO1PRE_0
  509. #define RCC_MCODIV_2 RCC_CFGR_MCO1PRE_1
  510. #define RCC_MCODIV_3 ((uint32_t)RCC_CFGR_MCO1PRE_0 | RCC_CFGR_MCO1PRE_1)
  511. #define RCC_MCODIV_4 RCC_CFGR_MCO1PRE_2
  512. #define RCC_MCODIV_5 ((uint32_t)RCC_CFGR_MCO1PRE_0 | RCC_CFGR_MCO1PRE_2)
  513. #define RCC_MCODIV_6 ((uint32_t)RCC_CFGR_MCO1PRE_1 | RCC_CFGR_MCO1PRE_2)
  514. #define RCC_MCODIV_7 ((uint32_t)RCC_CFGR_MCO1PRE_0 | RCC_CFGR_MCO1PRE_1 | RCC_CFGR_MCO1PRE_2)
  515. #define RCC_MCODIV_8 RCC_CFGR_MCO1PRE_3
  516. #define RCC_MCODIV_9 ((uint32_t)RCC_CFGR_MCO1PRE_0 | RCC_CFGR_MCO1PRE_3)
  517. #define RCC_MCODIV_10 ((uint32_t)RCC_CFGR_MCO1PRE_1 | RCC_CFGR_MCO1PRE_3)
  518. #define RCC_MCODIV_11 ((uint32_t)RCC_CFGR_MCO1PRE_0 | RCC_CFGR_MCO1PRE_1 | RCC_CFGR_MCO1PRE_3)
  519. #define RCC_MCODIV_12 ((uint32_t)RCC_CFGR_MCO1PRE_2 | RCC_CFGR_MCO1PRE_3)
  520. #define RCC_MCODIV_13 ((uint32_t)RCC_CFGR_MCO1PRE_0 | RCC_CFGR_MCO1PRE_2 | RCC_CFGR_MCO1PRE_3)
  521. #define RCC_MCODIV_14 ((uint32_t)RCC_CFGR_MCO1PRE_1 | RCC_CFGR_MCO1PRE_2 | RCC_CFGR_MCO1PRE_3)
  522. #define RCC_MCODIV_15 RCC_CFGR_MCO1PRE
  523. /**
  524. * @}
  525. */
  526. /** @defgroup RCC_Interrupt RCC Interrupt
  527. * @{
  528. */
  529. #define RCC_IT_LSIRDY (0x00000001U)
  530. #define RCC_IT_LSERDY (0x00000002U)
  531. #define RCC_IT_HSIRDY (0x00000004U)
  532. #define RCC_IT_HSERDY (0x00000008U)
  533. #define RCC_IT_CSIRDY (0x00000010U)
  534. #define RCC_IT_HSI48RDY (0x00000020U)
  535. #define RCC_IT_PLLRDY (0x00000040U)
  536. #define RCC_IT_PLL2RDY (0x00000080U)
  537. #define RCC_IT_PLL3RDY (0x00000100U)
  538. #define RCC_IT_LSECSS (0x00000200U)
  539. #define RCC_IT_CSS (0x00000400U)
  540. /**
  541. * @}
  542. */
  543. /** @defgroup RCC_Flag RCC Flag
  544. * Elements values convention: XXXYYYYYb
  545. * - YYYYY : Flag position in the register
  546. * - XXX : Register index
  547. * - 001: CR register
  548. * - 010: BDCR register
  549. * - 011: CSR register
  550. * - 100: RSR register
  551. * @{
  552. */
  553. /* Flags in the CR register */
  554. #define RCC_FLAG_HSIRDY ((uint8_t)0x22)
  555. #define RCC_FLAG_HSIDIV ((uint8_t)0x25)
  556. #define RCC_FLAG_CSIRDY ((uint8_t)0x28)
  557. #define RCC_FLAG_HSI48RDY ((uint8_t)0x2D)
  558. #if defined(RCC_CR_D1CKRDY)
  559. #define RCC_FLAG_D1CKRDY ((uint8_t)0x2E)
  560. #else
  561. #define RCC_FLAG_CPUCKRDY ((uint8_t)0x2E)
  562. #define RCC_FLAG_D1CKRDY RCC_FLAG_CPUCKRDY /* alias */
  563. #endif /* RCC_CR_D1CKRDY */
  564. #if defined(RCC_CR_D2CKRDY)
  565. #define RCC_FLAG_D2CKRDY ((uint8_t)0x2F)
  566. #else
  567. #define RCC_FLAG_CDCKRDY ((uint8_t)0x2F)
  568. #define RCC_FLAG_D2CKRDY RCC_FLAG_CDCKRDY /* alias */
  569. #endif /* RCC_CR_D2CKRDY */
  570. #define RCC_FLAG_HSERDY ((uint8_t)0x31)
  571. #define RCC_FLAG_PLLRDY ((uint8_t)0x39)
  572. #define RCC_FLAG_PLL2RDY ((uint8_t)0x3B)
  573. #define RCC_FLAG_PLL3RDY ((uint8_t)0x3D)
  574. /* Flags in the BDCR register */
  575. #define RCC_FLAG_LSERDY ((uint8_t)0x41)
  576. /* Flags in the CSR register */
  577. #define RCC_FLAG_LSIRDY ((uint8_t)0x61)
  578. /* Flags in the RSR register */
  579. #if defined(RCC_RSR_CPURSTF)
  580. #define RCC_FLAG_CPURST ((uint8_t)0x91)
  581. #endif /* RCC_RSR_CPURSTF */
  582. #if defined(RCC_RSR_D1RSTF)
  583. #define RCC_FLAG_D1RST ((uint8_t)0x93)
  584. #else
  585. #define RCC_FLAG_CDRST ((uint8_t)0x93)
  586. #endif /* RCC_RSR_D1RSTF */
  587. #if defined(RCC_RSR_D2RSTF)
  588. #define RCC_FLAG_D2RST ((uint8_t)0x94)
  589. #endif /* RCC_RSR_D2RSTF */
  590. #define RCC_FLAG_BORRST ((uint8_t)0x95)
  591. #define RCC_FLAG_PINRST ((uint8_t)0x96)
  592. #define RCC_FLAG_PORRST ((uint8_t)0x97)
  593. #define RCC_FLAG_SFTRST ((uint8_t)0x98)
  594. #define RCC_FLAG_IWDG1RST ((uint8_t)0x9A)
  595. #define RCC_FLAG_WWDG1RST ((uint8_t)0x9C)
  596. #define RCC_FLAG_LPWR1RST ((uint8_t)0x9E)
  597. #define RCC_FLAG_LPWR2RST ((uint8_t)0x9F)
  598. #if defined(DUAL_CORE)
  599. #define RCC_FLAG_C1RST (RCC_FLAG_CPURST)
  600. #define RCC_FLAG_C2RST ((uint8_t)0x92)
  601. #define RCC_FLAG_SFTR1ST (RCC_FLAG_SFTRST)
  602. #define RCC_FLAG_SFTR2ST ((uint8_t)0x99)
  603. #define RCC_FLAG_WWDG2RST ((uint8_t)0x9D)
  604. #define RCC_FLAG_IWDG2RST ((uint8_t)0x9B)
  605. #endif /*DUAL_CORE*/
  606. /**
  607. * @}
  608. */
  609. /** @defgroup RCC_LSEDrive_Config LSE Drive Config
  610. * @{
  611. */
  612. #define RCC_LSEDRIVE_LOW (0x00000000U) /*!< LSE low drive capability */
  613. #define RCC_LSEDRIVE_MEDIUMLOW RCC_BDCR_LSEDRV_0 /*!< LSE medium low drive capability */
  614. #define RCC_LSEDRIVE_MEDIUMHIGH RCC_BDCR_LSEDRV_1 /*!< LSE medium high drive capability */
  615. #define RCC_LSEDRIVE_HIGH RCC_BDCR_LSEDRV /*!< LSE high drive capability */
  616. /**
  617. * @}
  618. */
  619. /** @defgroup RCC_Stop_WakeUpClock RCC Stop WakeUpClock
  620. * @{
  621. */
  622. #define RCC_STOP_WAKEUPCLOCK_HSI (0x00000000U)
  623. #define RCC_STOP_WAKEUPCLOCK_CSI RCC_CFGR_STOPWUCK
  624. /**
  625. * @}
  626. */
  627. /** @defgroup RCC_Stop_KernelWakeUpClock RCC Stop KernelWakeUpClock
  628. * @{
  629. */
  630. #define RCC_STOP_KERWAKEUPCLOCK_HSI (0x00000000U)
  631. #define RCC_STOP_KERWAKEUPCLOCK_CSI RCC_CFGR_STOPKERWUCK
  632. /**
  633. * @}
  634. */
  635. #if defined(RCC_VER_X)
  636. #define HAL_RCC_REV_Y_HSITRIM_Pos (12U)
  637. #define HAL_RCC_REV_Y_HSITRIM_Msk (0x3F000U)
  638. #define HAL_RCC_REV_Y_CSITRIM_Pos (26U)
  639. #define HAL_RCC_REV_Y_CSITRIM_Msk (0x7C000000U)
  640. #endif /* RCC_VER_X */
  641. /**
  642. * @}
  643. */
  644. /* Exported macros -----------------------------------------------------------*/
  645. /** @defgroup RCC_Exported_Macros RCC Exported Macros
  646. * @{
  647. */
  648. /** @brief Enable or disable the AHB3 peripheral clock.
  649. * @note After reset, the peripheral clock (used for registers read/write access)
  650. * is disabled and the application software has to enable this clock before
  651. * using it.
  652. */
  653. #define __HAL_RCC_MDMA_CLK_ENABLE() do { \
  654. __IO uint32_t tmpreg; \
  655. SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_MDMAEN);\
  656. /* Delay after an RCC peripheral clock enabling */ \
  657. tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_MDMAEN);\
  658. UNUSED(tmpreg); \
  659. } while(0)
  660. #define __HAL_RCC_DMA2D_CLK_ENABLE() do { \
  661. __IO uint32_t tmpreg; \
  662. SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_DMA2DEN);\
  663. /* Delay after an RCC peripheral clock enabling */ \
  664. tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_DMA2DEN);\
  665. UNUSED(tmpreg); \
  666. } while(0)
  667. #if defined(JPEG)
  668. #define __HAL_RCC_JPGDECEN_CLK_ENABLE() do { \
  669. __IO uint32_t tmpreg; \
  670. SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_JPGDECEN);\
  671. /* Delay after an RCC peripheral clock enabling */ \
  672. tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_JPGDECEN);\
  673. UNUSED(tmpreg); \
  674. } while(0)
  675. #endif /* JPEG */
  676. #define __HAL_RCC_FMC_CLK_ENABLE() do { \
  677. __IO uint32_t tmpreg; \
  678. SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN);\
  679. /* Delay after an RCC peripheral clock enabling */ \
  680. tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN);\
  681. UNUSED(tmpreg); \
  682. } while(0)
  683. #if defined(QUADSPI)
  684. #define __HAL_RCC_QSPI_CLK_ENABLE() do { \
  685. __IO uint32_t tmpreg; \
  686. SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_QSPIEN);\
  687. /* Delay after an RCC peripheral clock enabling */ \
  688. tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_QSPIEN);\
  689. UNUSED(tmpreg); \
  690. } while(0)
  691. #endif /* QUADSPI */
  692. #if defined(OCTOSPI1)
  693. #define __HAL_RCC_OSPI1_CLK_ENABLE() do { \
  694. __IO uint32_t tmpreg; \
  695. SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_OSPI1EN);\
  696. /* Delay after an RCC peripheral clock enabling */ \
  697. tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_OSPI1EN);\
  698. UNUSED(tmpreg); \
  699. } while(0)
  700. #endif /* OCTOSPI1 */
  701. #if defined(OCTOSPI2)
  702. #define __HAL_RCC_OSPI2_CLK_ENABLE() do { \
  703. __IO uint32_t tmpreg; \
  704. SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_OSPI2EN);\
  705. /* Delay after an RCC peripheral clock enabling */ \
  706. tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_OSPI2EN);\
  707. UNUSED(tmpreg); \
  708. } while(0)
  709. #endif /* OCTOSPI2 */
  710. #if defined(OCTOSPIM)
  711. #define __HAL_RCC_OCTOSPIM_CLK_ENABLE() do { \
  712. __IO uint32_t tmpreg; \
  713. SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_IOMNGREN);\
  714. /* Delay after an RCC peripheral clock enabling */ \
  715. tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_IOMNGREN);\
  716. UNUSED(tmpreg); \
  717. } while(0)
  718. #endif /* OCTOSPIM */
  719. #if defined(OTFDEC1)
  720. #define __HAL_RCC_OTFDEC1_CLK_ENABLE() do { \
  721. __IO uint32_t tmpreg; \
  722. SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_OTFDEC1EN);\
  723. /* Delay after an RCC peripheral clock enabling */ \
  724. tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_OTFDEC1EN);\
  725. UNUSED(tmpreg); \
  726. } while(0)
  727. #endif /* OTFDEC1 */
  728. #if defined(OTFDEC2)
  729. #define __HAL_RCC_OTFDEC2_CLK_ENABLE() do { \
  730. __IO uint32_t tmpreg; \
  731. SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_OTFDEC2EN);\
  732. /* Delay after an RCC peripheral clock enabling */ \
  733. tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_OTFDEC2EN);\
  734. UNUSED(tmpreg); \
  735. } while(0)
  736. #endif /* OTFDEC2 */
  737. #if defined(GFXMMU)
  738. #define __HAL_RCC_GFXMMU_CLK_ENABLE() do { \
  739. __IO uint32_t tmpreg; \
  740. SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_GFXMMUEN);\
  741. /* Delay after an RCC peripheral clock enabling */ \
  742. tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_GFXMMUEN);\
  743. UNUSED(tmpreg); \
  744. } while(0)
  745. #endif /* GFXMMU */
  746. #define __HAL_RCC_SDMMC1_CLK_ENABLE() do { \
  747. __IO uint32_t tmpreg; \
  748. SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_SDMMC1EN);\
  749. /* Delay after an RCC peripheral clock enabling */ \
  750. tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_SDMMC1EN);\
  751. UNUSED(tmpreg); \
  752. } while(0)
  753. #define __HAL_RCC_MDMA_CLK_DISABLE() (RCC->AHB3ENR &= ~ (RCC_AHB3ENR_MDMAEN))
  754. #define __HAL_RCC_DMA2D_CLK_DISABLE() (RCC->AHB3ENR &= ~ (RCC_AHB3ENR_DMA2DEN))
  755. #if defined(JPEG)
  756. #define __HAL_RCC_JPGDECEN_CLK_DISABLE() (RCC->AHB3ENR &= ~ (RCC_AHB3ENR_JPGDECEN))
  757. #endif /* JPEG */
  758. #define __HAL_RCC_FMC_CLK_DISABLE() (RCC->AHB3ENR &= ~ (RCC_AHB3ENR_FMCEN))
  759. #if defined(QUADSPI)
  760. #define __HAL_RCC_QSPI_CLK_DISABLE() (RCC->AHB3ENR &= ~ (RCC_AHB3ENR_QSPIEN))
  761. #endif /* QUADSPI */
  762. #if defined(OCTOSPI1)
  763. #define __HAL_RCC_OSPI1_CLK_DISABLE() (RCC->AHB3ENR &= ~ (RCC_AHB3ENR_OSPI1EN))
  764. #endif /* OCTOSPII */
  765. #if defined(OCTOSPI2)
  766. #define __HAL_RCC_OSPI2_CLK_DISABLE() (RCC->AHB3ENR &= ~ (RCC_AHB3ENR_OSPI2EN))
  767. #endif /* OCTOSPI2 */
  768. #define __HAL_RCC_SDMMC1_CLK_DISABLE() (RCC->AHB3ENR &= ~ (RCC_AHB3ENR_SDMMC1EN))
  769. #if defined(OCTOSPIM)
  770. #define __HAL_RCC_OCTOSPIM_CLK_DISABLE() (RCC->AHB3ENR &= ~ (RCC_AHB3ENR_IOMNGREN))
  771. #endif /* OCTOSPIM */
  772. #if defined(OTFDEC1)
  773. #define __HAL_RCC_OTFDEC1_CLK_DISABLE() (RCC->AHB3ENR &= ~ (RCC_AHB3ENR_OTFDEC1EN))
  774. #endif /* OTOFDEC1 */
  775. #if defined(OTFDEC2)
  776. #define __HAL_RCC_OTFDEC2_CLK_DISABLE() (RCC->AHB3ENR &= ~ (RCC_AHB3ENR_OTFDEC2EN))
  777. #endif /* OTOFDEC2 */
  778. #if defined(GFXMMU)
  779. #define __HAL_RCC_GFXMMU_CLK_DISABLE() (RCC->AHB3ENR &= ~ (RCC_AHB3ENR_GFXMMUEN))
  780. #endif /* GFXMMU */
  781. /** @brief Get the enable or disable status of the AHB3 peripheral clock
  782. * @note After reset, the peripheral clock (used for registers read/write access)
  783. * is disabled and the application software has to enable this clock before
  784. * using it.
  785. */
  786. #define __HAL_RCC_MDMA_IS_CLK_ENABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_MDMAEN) != 0U)
  787. #define __HAL_RCC_DMA2D_IS_CLK_ENABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_DMA2DEN) != 0U)
  788. #if defined(JPEG)
  789. #define __HAL_RCC_JPGDECEN_IS_CLK_ENABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_JPGDECEN) != 0U)
  790. #endif /* JPEG */
  791. #define __HAL_RCC_FMC_IS_CLK_ENABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_FMCEN) != 0U)
  792. #if defined (QUADSPI)
  793. #define __HAL_RCC_QSPI_IS_CLK_ENABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_QSPIEN) != 0U)
  794. #endif /* QUADSPI */
  795. #if defined(OCTOSPI1)
  796. #define __HAL_RCC_OSPI1_IS_CLK_ENABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_OSPI1EN) != 0U)
  797. #endif /* OCTOSPII */
  798. #if defined(OCTOSPI2)
  799. #define __HAL_RCC_OSPI2_IS_CLK_ENABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_OSPI2EN) != 0U)
  800. #endif /* OCTOSPI2 */
  801. #define __HAL_RCC_SDMMC1_IS_CLK_ENABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_SDMMC1EN) != 0U)
  802. #if defined(OCTOSPIM)
  803. #define __HAL_RCC_OCTOSPIM_IS_CLK_ENABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_IOMNGREN) != 0U)
  804. #endif /* OCTOSPIM */
  805. #if defined(OTFDEC1)
  806. #define __HAL_RCC_OTFDEC1_IS_CLK_ENABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_OTFDEC1EN) != 0U)
  807. #endif /* OTOFDEC1 */
  808. #if defined(OTFDEC2)
  809. #define __HAL_RCC_OTFDEC2_IS_CLK_ENABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_OTFDEC2EN) != 0U)
  810. #endif /* OTOFDEC2 */
  811. #if defined(GFXMMU)
  812. #define __HAL_RCC_GFXMMU_IS_CLK_ENABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_GFXMMUEN) != 0U)
  813. #endif /* GFXMMU */
  814. #define __HAL_RCC_MDMA_IS_CLK_DISABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_MDMAEN) == 0U)
  815. #define __HAL_RCC_DMA2D_IS_CLK_DISABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_DMA2DEN) == 0U)
  816. #if defined(JPEG)
  817. #define __HAL_RCC_JPGDECEN_IS_CLK_DISABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_JPGDECEN) == 0U)
  818. #endif /* JPEG */
  819. #define __HAL_RCC_FMC_IS_CLK_DISABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_FMCEN) == 0U)
  820. #if defined (QUADSPI)
  821. #define __HAL_RCC_QSPI_IS_CLK_DISABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_QSPIEN) == 0U)
  822. #endif /* QUADSPI */
  823. #define __HAL_RCC_SDMMC1_IS_CLK_DISABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_SDMMC1EN) == 0U)
  824. #if defined(OCTOSPI1)
  825. #define __HAL_RCC_OSPI1_IS_CLK_DISABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_OSPI1EN) == 0U)
  826. #endif
  827. #if defined(OCTOSPI2)
  828. #define __HAL_RCC_OSPI2_IS_CLK_DISABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_OSPI2EN) == 0U)
  829. #endif
  830. #if defined(OCTOSPIM)
  831. #define __HAL_RCC_OCTOSPIM_IS_CLK_DISABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_IOMNGREN) == 0U)
  832. #endif
  833. #if defined(OTFDEC1)
  834. #define __HAL_RCC_OTFDEC1_IS_CLK_DISABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_OTFDEC1EN) == 0U)
  835. #endif
  836. #if defined(OTFDEC2)
  837. #define __HAL_RCC_OTFDEC2_IS_CLK_DISABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_OTFDEC2EN) == 0U)
  838. #endif
  839. #if defined(GFXMMU)
  840. #define __HAL_RCC_GFXMMU_IS_CLK_DISABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_GFXMMUEN) == 0U)
  841. #endif
  842. /** @brief Enable or disable the AHB1 peripheral clock.
  843. * @note After reset, the peripheral clock (used for registers read/write access)
  844. * is disabled and the application software has to enable this clock before
  845. * using it.
  846. */
  847. #define __HAL_RCC_DMA1_CLK_ENABLE() do { \
  848. __IO uint32_t tmpreg; \
  849. SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_DMA1EN);\
  850. /* Delay after an RCC peripheral clock enabling */ \
  851. tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_DMA1EN);\
  852. UNUSED(tmpreg); \
  853. } while(0)
  854. #define __HAL_RCC_DMA2_CLK_ENABLE() do { \
  855. __IO uint32_t tmpreg; \
  856. SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_DMA2EN);\
  857. /* Delay after an RCC peripheral clock enabling */ \
  858. tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_DMA2EN);\
  859. UNUSED(tmpreg); \
  860. } while(0)
  861. #define __HAL_RCC_ADC12_CLK_ENABLE() do { \
  862. __IO uint32_t tmpreg; \
  863. SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ADC12EN);\
  864. /* Delay after an RCC peripheral clock enabling */ \
  865. tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ADC12EN);\
  866. UNUSED(tmpreg); \
  867. } while(0)
  868. #if defined(DUAL_CORE)
  869. #define __HAL_RCC_ART_CLK_ENABLE() do { \
  870. __IO uint32_t tmpreg; \
  871. SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ARTEN);\
  872. /* Delay after an RCC peripheral clock enabling */ \
  873. tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ARTEN);\
  874. UNUSED(tmpreg); \
  875. } while(0)
  876. #endif /*DUAL_CORE*/
  877. #if defined(RCC_AHB1ENR_CRCEN)
  878. #define __HAL_RCC_CRC_CLK_ENABLE() do { \
  879. __IO uint32_t tmpreg; \
  880. SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_CRCEN);\
  881. /* Delay after an RCC peripheral clock enabling */ \
  882. tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_CRCEN);\
  883. UNUSED(tmpreg); \
  884. } while(0)
  885. #endif
  886. #if defined(ETH)
  887. #define __HAL_RCC_ETH1MAC_CLK_ENABLE() do { \
  888. __IO uint32_t tmpreg; \
  889. SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETH1MACEN);\
  890. /* Delay after an RCC peripheral clock enabling */ \
  891. tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETH1MACEN);\
  892. UNUSED(tmpreg); \
  893. } while(0)
  894. #define __HAL_RCC_ETH1TX_CLK_ENABLE() do { \
  895. __IO uint32_t tmpreg; \
  896. SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETH1TXEN);\
  897. /* Delay after an RCC peripheral clock enabling */ \
  898. tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETH1TXEN);\
  899. UNUSED(tmpreg); \
  900. } while(0)
  901. #define __HAL_RCC_ETH1RX_CLK_ENABLE() do { \
  902. __IO uint32_t tmpreg; \
  903. SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETH1RXEN);\
  904. /* Delay after an RCC peripheral clock enabling */ \
  905. tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETH1RXEN);\
  906. UNUSED(tmpreg); \
  907. } while(0)
  908. #endif
  909. #define __HAL_RCC_USB1_OTG_HS_CLK_ENABLE() do { \
  910. __IO uint32_t tmpreg; \
  911. SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_USB1OTGHSEN);\
  912. /* Delay after an RCC peripheral clock enabling */ \
  913. tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_USB1OTGHSEN);\
  914. UNUSED(tmpreg); \
  915. } while(0)
  916. #define __HAL_RCC_USB1_OTG_HS_ULPI_CLK_ENABLE() do { \
  917. __IO uint32_t tmpreg; \
  918. SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_USB1OTGHSULPIEN);\
  919. /* Delay after an RCC peripheral clock enabling */ \
  920. tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_USB1OTGHSULPIEN);\
  921. UNUSED(tmpreg); \
  922. } while(0)
  923. #if defined(USB2_OTG_FS)
  924. #define __HAL_RCC_USB2_OTG_FS_CLK_ENABLE() do { \
  925. __IO uint32_t tmpreg; \
  926. SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_USB2OTGHSEN);\
  927. /* Delay after an RCC peripheral clock enabling */ \
  928. tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_USB2OTGHSEN);\
  929. UNUSED(tmpreg); \
  930. } while(0)
  931. #define __HAL_RCC_USB2_OTG_FS_ULPI_CLK_ENABLE() do { \
  932. __IO uint32_t tmpreg; \
  933. SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_USB2OTGHSULPIEN);\
  934. /* Delay after an RCC peripheral clock enabling */ \
  935. tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_USB2OTGHSULPIEN);\
  936. UNUSED(tmpreg); \
  937. } while(0)
  938. #endif
  939. #define __HAL_RCC_DMA1_CLK_DISABLE() (RCC->AHB1ENR &= ~ (RCC_AHB1ENR_DMA1EN))
  940. #define __HAL_RCC_DMA2_CLK_DISABLE() (RCC->AHB1ENR &= ~ (RCC_AHB1ENR_DMA2EN))
  941. #define __HAL_RCC_ADC12_CLK_DISABLE() (RCC->AHB1ENR &= ~ (RCC_AHB1ENR_ADC12EN))
  942. #if defined(DUAL_CORE)
  943. #define __HAL_RCC_ART_CLK_DISABLE() (RCC->AHB1ENR &= ~ (RCC_AHB1ENR_ARTEN))
  944. #endif /*DUAL_CORE*/
  945. #if defined(RCC_AHB1ENR_CRCEN)
  946. #define __HAL_RCC_CRC_CLK_DISABLE() (RCC->AHB1ENR &= ~ (RCC_AHB1ENR_CRCEN))
  947. #endif
  948. #if defined(ETH)
  949. #define __HAL_RCC_ETH1MAC_CLK_DISABLE() (RCC->AHB1ENR &= ~ (RCC_AHB1ENR_ETH1MACEN))
  950. #define __HAL_RCC_ETH1TX_CLK_DISABLE() (RCC->AHB1ENR &= ~ (RCC_AHB1ENR_ETH1TXEN))
  951. #define __HAL_RCC_ETH1RX_CLK_DISABLE() (RCC->AHB1ENR &= ~ (RCC_AHB1ENR_ETH1RXEN))
  952. #endif
  953. #define __HAL_RCC_USB1_OTG_HS_CLK_DISABLE() (RCC->AHB1ENR &= ~ (RCC_AHB1ENR_USB1OTGHSEN))
  954. #define __HAL_RCC_USB1_OTG_HS_ULPI_CLK_DISABLE() (RCC->AHB1ENR &= ~ (RCC_AHB1ENR_USB1OTGHSULPIEN))
  955. #if defined(USB2_OTG_FS)
  956. #define __HAL_RCC_USB2_OTG_FS_CLK_DISABLE() (RCC->AHB1ENR &= ~ (RCC_AHB1ENR_USB2OTGHSEN))
  957. #define __HAL_RCC_USB2_OTG_FS_ULPI_CLK_DISABLE() (RCC->AHB1ENR &= ~ (RCC_AHB1ENR_USB2OTGHSULPIEN))
  958. #endif /* USB2_OTG_FS */
  959. /** @brief Get the enable or disable status of the AHB1 peripheral clock
  960. * @note After reset, the peripheral clock (used for registers read/write access)
  961. * is disabled and the application software has to enable this clock before
  962. * using it.
  963. */
  964. #define __HAL_RCC_DMA1_IS_CLK_ENABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_DMA1EN) != 0U)
  965. #define __HAL_RCC_DMA2_IS_CLK_ENABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_DMA2EN) != 0U)
  966. #define __HAL_RCC_ADC12_IS_CLK_ENABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_ADC12EN) != 0U)
  967. #if defined(DUAL_CORE)
  968. #define __HAL_RCC_ART_IS_CLK_ENABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_ARTEN) != 0U)
  969. #endif /*DUAL_CORE*/
  970. #if defined(RCC_AHB1ENR_CRCEN)
  971. #define __HAL_RCC_CRC_IS_CLK_ENABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_CRCEN) != 0U)
  972. #endif
  973. #if defined(ETH)
  974. #define __HAL_RCC_ETH1MAC_IS_CLK_ENABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_ETH1MACEN) != 0U)
  975. #define __HAL_RCC_ETH1TX_IS_CLK_ENABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_ETH1TXEN) != 0U)
  976. #define __HAL_RCC_ETH1RX_IS_CLK_ENABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_ETH1RXEN) != 0U)
  977. #endif
  978. #define __HAL_RCC_USB1_OTG_HS_IS_CLK_ENABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_USB1OTGHSEN) != 0U)
  979. #define __HAL_RCC_USB1_OTG_HS_ULPI_IS_CLK_ENABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_USB1OTGHSULPIEN) != 0U)
  980. #if defined(USB2_OTG_FS)
  981. #define __HAL_RCC_USB2_OTG_FS_IS_CLK_ENABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_USB2OTGHSEN) != 0U)
  982. #define __HAL_RCC_USB2_OTG_FS_ULPI_IS_CLK_ENABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_USB2OTGHSULPIEN) != 0U)
  983. #endif /* USB2_OTG_FS */
  984. #define __HAL_RCC_DMA1_IS_CLK_DISABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_DMA1EN) == 0U)
  985. #define __HAL_RCC_DMA2_IS_CLK_DISABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_DMA2EN) == 0U)
  986. #define __HAL_RCC_ADC12_IS_CLK_DISABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_ADC12EN) == 0U)
  987. #if defined(DUAL_CORE)
  988. #define __HAL_RCC_ART_IS_CLK_DISABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_ARTEN) == 0U)
  989. #endif /*DUAL_CORE*/
  990. #if defined(RCC_AHB1ENR_CRCEN)
  991. #define __HAL_RCC_CRC_IS_CLK_DISABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_CRCEN) == 0U)
  992. #endif
  993. #if defined(ETH)
  994. #define __HAL_RCC_ETH1MAC_IS_CLK_DISABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_ETH1MACEN) == 0U)
  995. #define __HAL_RCC_ETH1TX_IS_CLK_DISABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_ETH1TXEN) == 0U)
  996. #define __HAL_RCC_ETH1RX_IS_CLK_DISABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_ETH1RXEN) == 0U)
  997. #endif
  998. #define __HAL_RCC_USB1_OTG_HS_IS_CLK_DISABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_USB1OTGHSEN) == 0U)
  999. #define __HAL_RCC_USB1_OTG_HS_ULPI_IS_CLK_DISABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_USB1OTGHSULPIEN) == 0U)
  1000. #if defined(USB2_OTG_FS)
  1001. #define __HAL_RCC_USB2_OTG_FS_IS_CLK_DISABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_USB2OTGHSEN) == 0U)
  1002. #define __HAL_RCC_USB2_OTG_FS_ULPI_IS_CLK_DISABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_USB2OTGHSULPIEN) == 0U)
  1003. #endif /* USB2_OTG_FS */
  1004. /** @brief Enable or disable the AHB2 peripheral clock.
  1005. * @note After reset, the peripheral clock (used for registers read/write access)
  1006. * is disabled and the application software has to enable this clock before
  1007. * using it.
  1008. */
  1009. #if defined(DCMI) && defined(PSSI)
  1010. #define __HAL_RCC_DCMI_PSSI_CLK_ENABLE() do { \
  1011. __IO uint32_t tmpreg; \
  1012. SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_DCMI_PSSIEN);\
  1013. /* Delay after an RCC peripheral clock enabling */ \
  1014. tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_DCMI_PSSIEN);\
  1015. UNUSED(tmpreg); \
  1016. } while(0)
  1017. #define __HAL_RCC_DCMI_CLK_ENABLE() __HAL_RCC_DCMI_PSSI_CLK_ENABLE() /* for API backward compatibility*/
  1018. #else
  1019. #define __HAL_RCC_DCMI_CLK_ENABLE() do { \
  1020. __IO uint32_t tmpreg; \
  1021. SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_DCMIEN);\
  1022. /* Delay after an RCC peripheral clock enabling */ \
  1023. tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_DCMIEN);\
  1024. UNUSED(tmpreg); \
  1025. } while(0)
  1026. #endif /* DCMI && PSSI */
  1027. #if defined(CRYP)
  1028. #define __HAL_RCC_CRYP_CLK_ENABLE() do { \
  1029. __IO uint32_t tmpreg; \
  1030. SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_CRYPEN);\
  1031. /* Delay after an RCC peripheral clock enabling */ \
  1032. tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_CRYPEN);\
  1033. UNUSED(tmpreg); \
  1034. } while(0)
  1035. #endif /* CRYP */
  1036. #if defined(HASH)
  1037. #define __HAL_RCC_HASH_CLK_ENABLE() do { \
  1038. __IO uint32_t tmpreg; \
  1039. SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_HASHEN);\
  1040. /* Delay after an RCC peripheral clock enabling */ \
  1041. tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_HASHEN);\
  1042. UNUSED(tmpreg); \
  1043. } while(0)
  1044. #endif /* HASH */
  1045. #define __HAL_RCC_RNG_CLK_ENABLE() do { \
  1046. __IO uint32_t tmpreg; \
  1047. SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_RNGEN);\
  1048. /* Delay after an RCC peripheral clock enabling */ \
  1049. tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_RNGEN);\
  1050. UNUSED(tmpreg); \
  1051. } while(0)
  1052. #define __HAL_RCC_SDMMC2_CLK_ENABLE() do { \
  1053. __IO uint32_t tmpreg; \
  1054. SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_SDMMC2EN);\
  1055. /* Delay after an RCC peripheral clock enabling */ \
  1056. tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_SDMMC2EN);\
  1057. UNUSED(tmpreg); \
  1058. } while(0)
  1059. #if defined(FMAC)
  1060. #define __HAL_RCC_FMAC_CLK_ENABLE() do { \
  1061. __IO uint32_t tmpreg; \
  1062. SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_FMACEN);\
  1063. /* Delay after an RCC peripheral clock enabling */ \
  1064. tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_FMACEN);\
  1065. UNUSED(tmpreg); \
  1066. } while(0)
  1067. #endif /* FMAC */
  1068. #if defined(CORDIC)
  1069. #define __HAL_RCC_CORDIC_CLK_ENABLE() do { \
  1070. __IO uint32_t tmpreg; \
  1071. SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_CORDICEN);\
  1072. /* Delay after an RCC peripheral clock enabling */ \
  1073. tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_CORDICEN);\
  1074. UNUSED(tmpreg); \
  1075. } while(0)
  1076. #endif /* CORDIC */
  1077. #if defined(RCC_AHB2ENR_D2SRAM1EN)
  1078. #define __HAL_RCC_D2SRAM1_CLK_ENABLE() do { \
  1079. __IO uint32_t tmpreg; \
  1080. SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_D2SRAM1EN);\
  1081. /* Delay after an RCC peripheral clock enabling */ \
  1082. tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_D2SRAM1EN);\
  1083. UNUSED(tmpreg); \
  1084. } while(0)
  1085. #else
  1086. #define __HAL_RCC_AHBSRAM1_CLK_ENABLE() do { \
  1087. __IO uint32_t tmpreg; \
  1088. SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_AHBSRAM1EN);\
  1089. /* Delay after an RCC peripheral clock enabling */ \
  1090. tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_AHBSRAM1EN);\
  1091. UNUSED(tmpreg); \
  1092. } while(0)
  1093. #endif /* RCC_AHB2ENR_D2SRAM1EN */
  1094. #if defined(RCC_AHB2ENR_D2SRAM2EN)
  1095. #define __HAL_RCC_D2SRAM2_CLK_ENABLE() do { \
  1096. __IO uint32_t tmpreg; \
  1097. SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_D2SRAM2EN);\
  1098. /* Delay after an RCC peripheral clock enabling */ \
  1099. tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_D2SRAM2EN);\
  1100. UNUSED(tmpreg); \
  1101. } while(0)
  1102. #else
  1103. #define __HAL_RCC_AHBSRAM2_CLK_ENABLE() do { \
  1104. __IO uint32_t tmpreg; \
  1105. SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_AHBSRAM2EN);\
  1106. /* Delay after an RCC peripheral clock enabling */ \
  1107. tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_AHBSRAM2EN);\
  1108. UNUSED(tmpreg); \
  1109. } while(0)
  1110. #endif /* RCC_AHB2ENR_D2SRAM2EN */
  1111. #if defined(RCC_AHB2ENR_D2SRAM3EN)
  1112. #define __HAL_RCC_D2SRAM3_CLK_ENABLE() do { \
  1113. __IO uint32_t tmpreg; \
  1114. SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_D2SRAM3EN);\
  1115. /* Delay after an RCC peripheral clock enabling */ \
  1116. tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_D2SRAM3EN);\
  1117. UNUSED(tmpreg); \
  1118. } while(0)
  1119. #endif
  1120. #if defined(RCC_AHB2ENR_HSEMEN)
  1121. #define __HAL_RCC_HSEM_CLK_ENABLE() do { \
  1122. __IO uint32_t tmpreg; \
  1123. SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_HSEMEN);\
  1124. /* Delay after an RCC peripheral clock enabling */ \
  1125. tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_HSEMEN);\
  1126. UNUSED(tmpreg); \
  1127. } while(0)
  1128. #endif /* RCC_AHB2ENR_HSEMEN */
  1129. #if defined(BDMA1)
  1130. #define __HAL_RCC_BDMA1_CLK_ENABLE() do { \
  1131. __IO uint32_t tmpreg; \
  1132. SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_BDMA1EN);\
  1133. /* Delay after an RCC peripheral clock enabling */ \
  1134. tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_BDMA1EN);\
  1135. UNUSED(tmpreg); \
  1136. } while(0)
  1137. #endif /* BDMA1 */
  1138. #if defined(DCMI) && defined(PSSI)
  1139. #define __HAL_RCC_DCMI_PSSI_CLK_DISABLE() (RCC->AHB2ENR &= ~ (RCC_AHB2ENR_DCMI_PSSIEN))
  1140. #define __HAL_RCC_DCMI_CLK_DISABLE() __HAL_RCC_DCMI_PSSI_CLK_DISABLE() /* for API backward compatibility*/
  1141. #else
  1142. #define __HAL_RCC_DCMI_CLK_DISABLE() (RCC->AHB2ENR &= ~ (RCC_AHB2ENR_DCMIEN))
  1143. #endif /* DCMI && PSSI */
  1144. #if defined(CRYP)
  1145. #define __HAL_RCC_CRYP_CLK_DISABLE() (RCC->AHB2ENR &= ~ (RCC_AHB2ENR_CRYPEN))
  1146. #endif /* CRYP */
  1147. #if defined(HASH)
  1148. #define __HAL_RCC_HASH_CLK_DISABLE() (RCC->AHB2ENR &= ~ (RCC_AHB2ENR_HASHEN))
  1149. #endif /* HASH */
  1150. #define __HAL_RCC_RNG_CLK_DISABLE() (RCC->AHB2ENR &= ~ (RCC_AHB2ENR_RNGEN))
  1151. #define __HAL_RCC_SDMMC2_CLK_DISABLE() (RCC->AHB2ENR &= ~ (RCC_AHB2ENR_SDMMC2EN))
  1152. #if defined(FMAC)
  1153. #define __HAL_RCC_FMAC_CLK_DISABLE() (RCC->AHB2ENR &= ~ (RCC_AHB2ENR_FMACEN))
  1154. #endif /* FMAC */
  1155. #if defined(CORDIC)
  1156. #define __HAL_RCC_CORDIC_CLK_DISABLE() (RCC->AHB2ENR &= ~ (RCC_AHB2ENR_CORDICEN))
  1157. #endif /* CORDIC */
  1158. #if defined(RCC_AHB2ENR_D2SRAM1EN)
  1159. #define __HAL_RCC_D2SRAM1_CLK_DISABLE() (RCC->AHB2ENR &= ~ (RCC_AHB2ENR_D2SRAM1EN))
  1160. #else
  1161. #define __HAL_RCC_AHBSRAM1_CLK_DISABLE() (RCC->AHB2ENR &= ~ (RCC_AHB2ENR_AHBSRAM1EN))
  1162. #endif /* RCC_AHB2ENR_D2SRAM1EN */
  1163. #if defined(RCC_AHB2ENR_D2SRAM2EN)
  1164. #define __HAL_RCC_D2SRAM2_CLK_DISABLE() (RCC->AHB2ENR &= ~ (RCC_AHB2ENR_D2SRAM2EN))
  1165. #else
  1166. #define __HAL_RCC_AHBSRAM2_CLK_DISABLE() (RCC->AHB2ENR &= ~ (RCC_AHB2ENR_AHBSRAM2EN))
  1167. #endif /* RCC_AHB2ENR_D2SRAM2EN */
  1168. #if defined(RCC_AHB2ENR_D2SRAM3EN)
  1169. #define __HAL_RCC_D2SRAM3_CLK_DISABLE() (RCC->AHB2ENR &= ~ (RCC_AHB2ENR_D2SRAM3EN))
  1170. #endif
  1171. #if defined(RCC_AHB2ENR_HSEMEN)
  1172. #define __HAL_RCC_HSEM_CLK_DISABLE() (RCC->AHB2ENR &= ~ (RCC_AHB2ENR_HSEMEN))
  1173. #endif
  1174. #if defined(BDMA1)
  1175. #define __HAL_RCC_BDMA1_CLK_DISABLE() (RCC->AHB2ENR &= ~ (RCC_AHB2ENR_BDMA1EN))
  1176. #endif
  1177. /** @brief Get the enable or disable status of the AHB2 peripheral clock
  1178. * @note After reset, the peripheral clock (used for registers read/write access)
  1179. * is disabled and the application software has to enable this clock before
  1180. * using it.
  1181. */
  1182. #if defined(DCMI) && defined(PSSI)
  1183. #define __HAL_RCC_DCMI_PSSI_IS_CLK_ENABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_DCMI_PSSIEN) != 0U)
  1184. #define __HAL_RCC_DCMI_IS_CLK_ENABLED() __HAL_RCC_DCMI_PSSI_IS_CLK_ENABLED() /* for API backward compatibility*/
  1185. #else
  1186. #define __HAL_RCC_DCMI_IS_CLK_ENABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_DCMIEN) != 0U)
  1187. #endif /* DCMI && PSSI */
  1188. #if defined(CRYP)
  1189. #define __HAL_RCC_CRYP_IS_CLK_ENABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_CRYPEN) != 0U)
  1190. #endif /* CRYP */
  1191. #if defined(HASH)
  1192. #define __HAL_RCC_HASH_IS_CLK_ENABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_HASHEN) != 0U)
  1193. #endif /* HASH */
  1194. #define __HAL_RCC_RNG_IS_CLK_ENABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_RNGEN) != 0U)
  1195. #define __HAL_RCC_SDMMC2_IS_CLK_ENABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_SDMMC2EN) != 0U)
  1196. #if defined(FMAC)
  1197. #define __HAL_RCC_FMAC_IS_CLK_ENABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_FMACEN) != 0U)
  1198. #endif /* FMAC */
  1199. #if defined(CORDIC)
  1200. #define __HAL_RCC_CORDIC_IS_CLK_ENABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_CORDICEN) != 0U)
  1201. #endif /* CORDIC */
  1202. #if defined(RCC_AHB2ENR_D2SRAM1EN)
  1203. #define __HAL_RCC_D2SRAM1_IS_CLK_ENABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_D2SRAM1EN) != 0U)
  1204. #else
  1205. #define __HAL_RCC_AHBSRAM1_IS_CLK_ENABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_AHBSRAM1EN) != 0U)
  1206. #endif /* RCC_AHB2ENR_D2SRAM1EN */
  1207. #if defined(RCC_AHB2ENR_D2SRAM2EN)
  1208. #define __HAL_RCC_D2SRAM2_IS_CLK_ENABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_D2SRAM2EN) != 0U)
  1209. #else
  1210. #define __HAL_RCC_AHBSRAM2_IS_CLK_ENABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_AHBSRAM2EN) != 0U)
  1211. #endif /* RCC_AHB2ENR_D2SRAM2EN */
  1212. #if defined(RCC_AHB2ENR_D2SRAM3EN)
  1213. #define __HAL_RCC_D2SRAM3_IS_CLK_ENABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_D2SRAM3EN) != 0U)
  1214. #endif
  1215. #if defined(RCC_AHB2ENR_HSEMEN)
  1216. #define __HAL_RCC_HSEM_IS_CLK_ENABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_HSEMEN) != 0U)
  1217. #endif
  1218. #if defined(BDMA1)
  1219. #define __HAL_RCC_BDMA1_IS_CLK_ENABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_BDMA1EN) != 0U)
  1220. #endif
  1221. #if defined(DCMI) && defined(PSSI)
  1222. #define __HAL_RCC_DCMI_PSSI_IS_CLK_DISABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_DCMI_PSSIEN) == 0U)
  1223. #define __HAL_RCC_DCMI_IS_CLK_DISABLED() __HAL_RCC_DCMI_PSSI_IS_CLK_DISABLED() /* for API backward compatibility*/
  1224. #else
  1225. #define __HAL_RCC_DCMI_IS_CLK_DISABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_DCMIEN) == 0U)
  1226. #endif /* DCMI && PSSI */
  1227. #if defined(CRYP)
  1228. #define __HAL_RCC_CRYP_IS_CLK_DISABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_CRYPEN) == 0U)
  1229. #endif /* CRYP */
  1230. #if defined(HASH)
  1231. #define __HAL_RCC_HASH_IS_CLK_DISABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_HASHEN) == 0U)
  1232. #endif /* HASH */
  1233. #define __HAL_RCC_RNG_IS_CLK_DISABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_RNGEN) == 0U)
  1234. #define __HAL_RCC_SDMMC2_IS_CLK_DISABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_SDMMC2EN) == 0U)
  1235. #if defined(FMAC)
  1236. #define __HAL_RCC_FMAC_IS_CLK_DISABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_FMACEN) == 0U)
  1237. #endif /* FMAC */
  1238. #if defined(CORDIC)
  1239. #define __HAL_RCC_CORDIC_IS_CLK_DISABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_CORDICEN) == 0U)
  1240. #endif /* CORDIC */
  1241. #if defined(RCC_AHB2ENR_D2SRAM1EN)
  1242. #define __HAL_RCC_D2SRAM1_IS_CLK_DISABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_D2SRAM1EN) == 0U)
  1243. #else
  1244. #define __HAL_RCC_AHBSRAM1_IS_CLK_DISABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_AHBSRAM1EN) == 0U)
  1245. #endif /* RCC_AHB2ENR_D2SRAM1EN */
  1246. #if defined(RCC_AHB2ENR_D2SRAM2EN)
  1247. #define __HAL_RCC_D2SRAM2_IS_CLK_DISABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_D2SRAM2EN) == 0U)
  1248. #else
  1249. #define __HAL_RCC_AHBSRAM2_IS_CLK_DISABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_AHBSRAM2EN) == 0U)
  1250. #endif /* RCC_AHB2ENR_D2SRAM2EN */
  1251. #if defined(RCC_AHB2ENR_D2SRAM3EN)
  1252. #define __HAL_RCC_D2SRAM3_IS_CLK_DISABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_D2SRAM3EN) == 0U)
  1253. #endif
  1254. #if defined(RCC_AHB2ENR_HSEMEN)
  1255. #define __HAL_RCC_HSEM_IS_CLK_DISABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_HSEMEN) == 0U)
  1256. #endif
  1257. #if defined(BDMA1)
  1258. #define __HAL_RCC_BDMA1_IS_CLK_DISABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_BDMA1EN) == 0U)
  1259. #endif
  1260. /** @brief Enable or disable the AHB4 peripheral clock.
  1261. * @note After reset, the peripheral clock (used for registers read/write access)
  1262. * is disabled and the application software has to enable this clock before
  1263. * using it.
  1264. */
  1265. #define __HAL_RCC_GPIOA_CLK_ENABLE() do { \
  1266. __IO uint32_t tmpreg; \
  1267. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOAEN);\
  1268. /* Delay after an RCC peripheral clock enabling */ \
  1269. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOAEN);\
  1270. UNUSED(tmpreg); \
  1271. } while(0)
  1272. #define __HAL_RCC_GPIOB_CLK_ENABLE() do { \
  1273. __IO uint32_t tmpreg; \
  1274. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOBEN);\
  1275. /* Delay after an RCC peripheral clock enabling */ \
  1276. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOBEN);\
  1277. UNUSED(tmpreg); \
  1278. } while(0)
  1279. #define __HAL_RCC_GPIOC_CLK_ENABLE() do { \
  1280. __IO uint32_t tmpreg; \
  1281. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOCEN);\
  1282. /* Delay after an RCC peripheral clock enabling */ \
  1283. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOCEN);\
  1284. UNUSED(tmpreg); \
  1285. } while(0)
  1286. #define __HAL_RCC_GPIOD_CLK_ENABLE() do { \
  1287. __IO uint32_t tmpreg; \
  1288. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIODEN);\
  1289. /* Delay after an RCC peripheral clock enabling */ \
  1290. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIODEN);\
  1291. UNUSED(tmpreg); \
  1292. } while(0)
  1293. #define __HAL_RCC_GPIOE_CLK_ENABLE() do { \
  1294. __IO uint32_t tmpreg; \
  1295. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOEEN);\
  1296. /* Delay after an RCC peripheral clock enabling */ \
  1297. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOEEN);\
  1298. UNUSED(tmpreg); \
  1299. } while(0)
  1300. #define __HAL_RCC_GPIOF_CLK_ENABLE() do { \
  1301. __IO uint32_t tmpreg; \
  1302. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOFEN);\
  1303. /* Delay after an RCC peripheral clock enabling */ \
  1304. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOFEN);\
  1305. UNUSED(tmpreg); \
  1306. } while(0)
  1307. #define __HAL_RCC_GPIOG_CLK_ENABLE() do { \
  1308. __IO uint32_t tmpreg; \
  1309. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOGEN);\
  1310. /* Delay after an RCC peripheral clock enabling */ \
  1311. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOGEN);\
  1312. UNUSED(tmpreg); \
  1313. } while(0)
  1314. #define __HAL_RCC_GPIOH_CLK_ENABLE() do { \
  1315. __IO uint32_t tmpreg; \
  1316. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOHEN);\
  1317. /* Delay after an RCC peripheral clock enabling */ \
  1318. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOHEN);\
  1319. UNUSED(tmpreg); \
  1320. } while(0)
  1321. #if defined(GPIOI)
  1322. #define __HAL_RCC_GPIOI_CLK_ENABLE() do { \
  1323. __IO uint32_t tmpreg; \
  1324. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOIEN);\
  1325. /* Delay after an RCC peripheral clock enabling */ \
  1326. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOIEN);\
  1327. UNUSED(tmpreg); \
  1328. } while(0)
  1329. #endif /* GPIOI */
  1330. #define __HAL_RCC_GPIOJ_CLK_ENABLE() do { \
  1331. __IO uint32_t tmpreg; \
  1332. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOJEN);\
  1333. /* Delay after an RCC peripheral clock enabling */ \
  1334. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOJEN);\
  1335. UNUSED(tmpreg); \
  1336. } while(0)
  1337. #define __HAL_RCC_GPIOK_CLK_ENABLE() do { \
  1338. __IO uint32_t tmpreg; \
  1339. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOKEN);\
  1340. /* Delay after an RCC peripheral clock enabling */ \
  1341. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOKEN);\
  1342. UNUSED(tmpreg); \
  1343. } while(0)
  1344. #if defined(RCC_AHB4ENR_CRCEN)
  1345. #define __HAL_RCC_CRC_CLK_ENABLE() do { \
  1346. __IO uint32_t tmpreg; \
  1347. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_CRCEN);\
  1348. /* Delay after an RCC peripheral clock enabling */ \
  1349. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_CRCEN);\
  1350. UNUSED(tmpreg); \
  1351. } while(0)
  1352. #endif
  1353. #if defined(BDMA2)
  1354. #define __HAL_RCC_BDMA2_CLK_ENABLE() do { \
  1355. __IO uint32_t tmpreg; \
  1356. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_BDMA2EN);\
  1357. /* Delay after an RCC peripheral clock enabling */ \
  1358. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_BDMA2EN);\
  1359. UNUSED(tmpreg); \
  1360. } while(0)
  1361. #define __HAL_RCC_BDMA_CLK_ENABLE() __HAL_RCC_BDMA2_CLK_ENABLE() /* for API backward compatibility*/
  1362. #else
  1363. #define __HAL_RCC_BDMA_CLK_ENABLE() do { \
  1364. __IO uint32_t tmpreg; \
  1365. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_BDMAEN);\
  1366. /* Delay after an RCC peripheral clock enabling */ \
  1367. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_BDMAEN);\
  1368. UNUSED(tmpreg); \
  1369. } while(0)
  1370. #endif
  1371. #if defined(ADC3)
  1372. #define __HAL_RCC_ADC3_CLK_ENABLE() do { \
  1373. __IO uint32_t tmpreg; \
  1374. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_ADC3EN);\
  1375. /* Delay after an RCC peripheral clock enabling */ \
  1376. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_ADC3EN);\
  1377. UNUSED(tmpreg); \
  1378. } while(0)
  1379. #endif
  1380. #if defined(RCC_AHB4ENR_HSEMEN)
  1381. #define __HAL_RCC_HSEM_CLK_ENABLE() do { \
  1382. __IO uint32_t tmpreg; \
  1383. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_HSEMEN);\
  1384. /* Delay after an RCC peripheral clock enabling */ \
  1385. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_HSEMEN);\
  1386. UNUSED(tmpreg); \
  1387. } while(0)
  1388. #endif
  1389. #if defined(RCC_AHB4ENR_SRDSRAMEN)
  1390. #define __HAL_RCC_SRDSRAM_CLK_ENABLE() do { \
  1391. __IO uint32_t tmpreg; \
  1392. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_SRDSRAMEN);\
  1393. /* Delay after an RCC peripheral clock enabling */ \
  1394. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_SRDSRAMEN);\
  1395. UNUSED(tmpreg); \
  1396. } while(0)
  1397. #endif
  1398. #define __HAL_RCC_BKPRAM_CLK_ENABLE() do { \
  1399. __IO uint32_t tmpreg; \
  1400. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_BKPRAMEN);\
  1401. /* Delay after an RCC peripheral clock enabling */ \
  1402. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_BKPRAMEN);\
  1403. UNUSED(tmpreg); \
  1404. } while(0)
  1405. #define __HAL_RCC_GPIOA_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOAEN)
  1406. #define __HAL_RCC_GPIOB_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOBEN)
  1407. #define __HAL_RCC_GPIOC_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOCEN)
  1408. #define __HAL_RCC_GPIOD_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIODEN)
  1409. #define __HAL_RCC_GPIOE_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOEEN)
  1410. #define __HAL_RCC_GPIOF_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOFEN)
  1411. #define __HAL_RCC_GPIOG_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOGEN)
  1412. #define __HAL_RCC_GPIOH_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOHEN)
  1413. #if defined(GPIOI)
  1414. #define __HAL_RCC_GPIOI_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOIEN)
  1415. #endif /* GPIOI */
  1416. #define __HAL_RCC_GPIOJ_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOJEN)
  1417. #define __HAL_RCC_GPIOK_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOKEN)
  1418. #if defined(RCC_AHB4ENR_CRCEN)
  1419. #define __HAL_RCC_CRC_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_CRCEN)
  1420. #endif
  1421. #if defined(BDMA2)
  1422. #define __HAL_RCC_BDMA2_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_BDMA2EN)
  1423. #define __HAL_RCC_BDMA_CLK_DISABLE() __HAL_RCC_BDMA2_CLK_DISABLE() /* for API backward compatibility*/
  1424. #else
  1425. #define __HAL_RCC_BDMA_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_BDMAEN)
  1426. #endif
  1427. #if defined(ADC3)
  1428. #define __HAL_RCC_ADC3_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_ADC3EN)
  1429. #endif
  1430. #if defined(RCC_AHB4ENR_HSEMEN)
  1431. #define __HAL_RCC_HSEM_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_HSEMEN)
  1432. #endif
  1433. #if defined(RCC_AHB4ENR_SRDSRAMEN)
  1434. #define __HAL_RCC_SRDSRAM_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_SRDSRAMEN)
  1435. #endif
  1436. #define __HAL_RCC_BKPRAM_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_BKPRAMEN)
  1437. /** @brief Get the enable or disable status of the AHB4 peripheral clock
  1438. * @note After reset, the peripheral clock (used for registers read/write access)
  1439. * is disabled and the application software has to enable this clock before
  1440. * using it.
  1441. */
  1442. #define __HAL_RCC_GPIOA_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOAEN) != 0U)
  1443. #define __HAL_RCC_GPIOB_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOBEN) != 0U)
  1444. #define __HAL_RCC_GPIOC_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOCEN) != 0U)
  1445. #define __HAL_RCC_GPIOD_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIODEN) != 0U)
  1446. #define __HAL_RCC_GPIOE_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOEEN) != 0U)
  1447. #define __HAL_RCC_GPIOF_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOFEN) != 0U)
  1448. #define __HAL_RCC_GPIOG_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOGEN) != 0U)
  1449. #define __HAL_RCC_GPIOH_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOHEN) != 0U)
  1450. #if defined(GPIOI)
  1451. #define __HAL_RCC_GPIOI_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOIEN) != 0U)
  1452. #endif /* GPIOI */
  1453. #define __HAL_RCC_GPIOJ_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOJEN) != 0U)
  1454. #define __HAL_RCC_GPIOK_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOKEN) != 0U)
  1455. #if defined(RCC_AHB4ENR_CRCEN)
  1456. #define __HAL_RCC_CRC_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_CRCEN) != 0U)
  1457. #endif
  1458. #if defined(BDMA2)
  1459. #define __HAL_RCC_BDMA2_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_BDMA2EN) != 0U)
  1460. #define __HAL_RCC_BDMA_IS_CLK_ENABLED() __HAL_RCC_BDMA2_IS_CLK_ENABLED() /* for API backward compatibility*/
  1461. #else
  1462. #define __HAL_RCC_BDMA_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_BDMAEN) != 0U)
  1463. #endif
  1464. #if defined(ADC3)
  1465. #define __HAL_RCC_ADC3_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_ADC3EN) != 0U)
  1466. #endif
  1467. #if defined(RCC_AHB4ENR_HSEMEN)
  1468. #define __HAL_RCC_HSEM_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_HSEMEN) != 0U)
  1469. #endif
  1470. #if defined(RCC_AHB4ENR_SRDSRAMEN)
  1471. #define __HAL_RCC_SRDSRAM_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_SRDSRAMEN) != 0U)
  1472. #endif
  1473. #define __HAL_RCC_BKPRAM_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_BKPRAMEN) != 0U)
  1474. #define __HAL_RCC_GPIOA_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOAEN) == 0U)
  1475. #define __HAL_RCC_GPIOB_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOBEN) == 0U)
  1476. #define __HAL_RCC_GPIOC_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOCEN) == 0U)
  1477. #define __HAL_RCC_GPIOD_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIODEN) == 0U)
  1478. #define __HAL_RCC_GPIOE_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOEEN) == 0U)
  1479. #define __HAL_RCC_GPIOF_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOFEN) == 0U)
  1480. #define __HAL_RCC_GPIOG_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOGEN) == 0U)
  1481. #define __HAL_RCC_GPIOH_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOHEN) == 0U)
  1482. #if defined(GPIOI)
  1483. #define __HAL_RCC_GPIOI_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOIEN) == 0U)
  1484. #endif /* GPIOI */
  1485. #define __HAL_RCC_GPIOJ_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOJEN) == 0U)
  1486. #define __HAL_RCC_GPIOK_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOKEN) == 0U)
  1487. #if defined(RCC_AHB4ENR_CRCEN)
  1488. #define __HAL_RCC_CRC_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_CRCEN) == 0U)
  1489. #endif
  1490. #if defined(BDMA2)
  1491. #define __HAL_RCC_BDMA2_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_BDMA2EN) == 0U)
  1492. #define __HAL_RCC_BDMA_IS_CLK_DISABLED() __HAL_RCC_BDMA2_IS_CLK_DISABLED() /* for API backward compatibility*/
  1493. #else
  1494. #define __HAL_RCC_BDMA_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_BDMAEN) == 0U)
  1495. #endif
  1496. #if defined(ADC3)
  1497. #define __HAL_RCC_ADC3_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_ADC3EN) == 0U)
  1498. #endif
  1499. #if defined(RCC_AHB4ENR_HSEMEN)
  1500. #define __HAL_RCC_HSEM_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_HSEMEN) == 0U)
  1501. #endif
  1502. #if defined(RCC_AHB4ENR_SRDSRAMEN)
  1503. #define __HAL_RCC_SRDSRAM_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_SRDSRAMEN) == 0U)
  1504. #endif
  1505. #define __HAL_RCC_BKPRAM_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_BKPRAMEN) == 0U)
  1506. /** @brief Enable or disable the APB3 peripheral clock.
  1507. * @note After reset, the peripheral clock (used for registers read/write access)
  1508. * is disabled and the application software has to enable this clock before
  1509. * using it.
  1510. */
  1511. #if defined(LTDC)
  1512. #define __HAL_RCC_LTDC_CLK_ENABLE() do { \
  1513. __IO uint32_t tmpreg; \
  1514. SET_BIT(RCC->APB3ENR, RCC_APB3ENR_LTDCEN);\
  1515. /* Delay after an RCC peripheral clock enabling */ \
  1516. tmpreg = READ_BIT(RCC->APB3ENR, RCC_APB3ENR_LTDCEN);\
  1517. UNUSED(tmpreg); \
  1518. } while(0)
  1519. #endif /* LTDC */
  1520. #if defined(DSI)
  1521. #define __HAL_RCC_DSI_CLK_ENABLE() do { \
  1522. __IO uint32_t tmpreg; \
  1523. SET_BIT(RCC->APB3ENR, RCC_APB3ENR_DSIEN);\
  1524. /* Delay after an RCC peripheral clock enabling */ \
  1525. tmpreg = READ_BIT(RCC->APB3ENR, RCC_APB3ENR_DSIEN);\
  1526. UNUSED(tmpreg); \
  1527. } while(0)
  1528. #endif /*DSI*/
  1529. #define __HAL_RCC_WWDG1_CLK_ENABLE() do { \
  1530. __IO uint32_t tmpreg; \
  1531. SET_BIT(RCC->APB3ENR, RCC_APB3ENR_WWDG1EN);\
  1532. /* Delay after an RCC peripheral clock enabling */ \
  1533. tmpreg = READ_BIT(RCC->APB3ENR, RCC_APB3ENR_WWDG1EN);\
  1534. UNUSED(tmpreg); \
  1535. } while(0)
  1536. #if defined(LTDC)
  1537. #define __HAL_RCC_LTDC_CLK_DISABLE() (RCC->APB3ENR) &= ~ (RCC_APB3ENR_LTDCEN)
  1538. #endif /* LTDC */
  1539. #if defined(DSI)
  1540. #define __HAL_RCC_DSI_CLK_DISABLE() (RCC->APB3ENR) &= ~ (RCC_APB3ENR_DSIEN)
  1541. #endif /*DSI*/
  1542. #define __HAL_RCC_WWDG1_CLK_DISABLE() (RCC->APB3ENR) &= ~ (RCC_APB3ENR_WWDG1EN)
  1543. /** @brief Get the enable or disable status of the APB3 peripheral clock
  1544. * @note After reset, the peripheral clock (used for registers read/write access)
  1545. * is disabled and the application software has to enable this clock before
  1546. * using it.
  1547. */
  1548. #if defined(LTDC)
  1549. #define __HAL_RCC_LTDC_IS_CLK_ENABLED() ((RCC->APB3ENR & RCC_APB3ENR_LTDCEN) != 0U)
  1550. #endif /* LTDC */
  1551. #if defined(DSI)
  1552. #define __HAL_RCC_DSI_IS_CLK_ENABLED() ((RCC->APB3ENR & RCC_APB3ENR_DSIEN) != 0U)
  1553. #endif /*DSI*/
  1554. #define __HAL_RCC_WWDG1_IS_CLK_ENABLED() ((RCC->APB3ENR & RCC_APB3ENR_WWDG1EN) != 0U)
  1555. #if defined(LTDC)
  1556. #define __HAL_RCC_LTDC_IS_CLK_DISABLED() ((RCC->APB3ENR & RCC_APB3ENR_LTDCEN) == 0U)
  1557. #endif /* LTDC */
  1558. #if defined(DSI)
  1559. #define __HAL_RCC_DSI_IS_CLK_DISABLED() ((RCC->APB3ENR & RCC_APB3ENR_DSIEN) == 0U)
  1560. #endif /*DSI*/
  1561. #define __HAL_RCC_WWDG1_IS_CLK_DISABLED() ((RCC->APB3ENR & RCC_APB3ENR_WWDG1EN) == 0U)
  1562. /** @brief Enable or disable the APB1 peripheral clock.
  1563. * @note After reset, the peripheral clock (used for registers read/write access)
  1564. * is disabled and the application software has to enable this clock before
  1565. * using it.
  1566. */
  1567. #define __HAL_RCC_TIM2_CLK_ENABLE() do { \
  1568. __IO uint32_t tmpreg; \
  1569. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM2EN);\
  1570. /* Delay after an RCC peripheral clock enabling */ \
  1571. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM2EN);\
  1572. UNUSED(tmpreg); \
  1573. } while(0)
  1574. #define __HAL_RCC_TIM3_CLK_ENABLE() do { \
  1575. __IO uint32_t tmpreg; \
  1576. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM3EN);\
  1577. /* Delay after an RCC peripheral clock enabling */ \
  1578. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM3EN);\
  1579. UNUSED(tmpreg); \
  1580. } while(0)
  1581. #define __HAL_RCC_TIM4_CLK_ENABLE() do { \
  1582. __IO uint32_t tmpreg; \
  1583. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM4EN);\
  1584. /* Delay after an RCC peripheral clock enabling */ \
  1585. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM4EN);\
  1586. UNUSED(tmpreg); \
  1587. } while(0)
  1588. #define __HAL_RCC_TIM5_CLK_ENABLE() do { \
  1589. __IO uint32_t tmpreg; \
  1590. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM5EN);\
  1591. /* Delay after an RCC peripheral clock enabling */ \
  1592. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM5EN);\
  1593. UNUSED(tmpreg); \
  1594. } while(0)
  1595. #define __HAL_RCC_TIM6_CLK_ENABLE() do { \
  1596. __IO uint32_t tmpreg; \
  1597. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM6EN);\
  1598. /* Delay after an RCC peripheral clock enabling */ \
  1599. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM6EN);\
  1600. UNUSED(tmpreg); \
  1601. } while(0)
  1602. #define __HAL_RCC_TIM7_CLK_ENABLE() do { \
  1603. __IO uint32_t tmpreg; \
  1604. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM7EN);\
  1605. /* Delay after an RCC peripheral clock enabling */ \
  1606. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM7EN);\
  1607. UNUSED(tmpreg); \
  1608. } while(0)
  1609. #define __HAL_RCC_TIM12_CLK_ENABLE() do { \
  1610. __IO uint32_t tmpreg; \
  1611. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM12EN);\
  1612. /* Delay after an RCC peripheral clock enabling */ \
  1613. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM12EN);\
  1614. UNUSED(tmpreg); \
  1615. } while(0)
  1616. #define __HAL_RCC_TIM13_CLK_ENABLE() do { \
  1617. __IO uint32_t tmpreg; \
  1618. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM13EN);\
  1619. /* Delay after an RCC peripheral clock enabling */ \
  1620. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM13EN);\
  1621. UNUSED(tmpreg); \
  1622. } while(0)
  1623. #define __HAL_RCC_TIM14_CLK_ENABLE() do { \
  1624. __IO uint32_t tmpreg; \
  1625. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM14EN);\
  1626. /* Delay after an RCC peripheral clock enabling */ \
  1627. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM14EN);\
  1628. UNUSED(tmpreg); \
  1629. } while(0)
  1630. #define __HAL_RCC_LPTIM1_CLK_ENABLE() do { \
  1631. __IO uint32_t tmpreg; \
  1632. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_LPTIM1EN);\
  1633. /* Delay after an RCC peripheral clock enabling */ \
  1634. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_LPTIM1EN);\
  1635. UNUSED(tmpreg); \
  1636. } while(0)
  1637. #if defined(DUAL_CORE)
  1638. #define __HAL_RCC_WWDG2_CLK_ENABLE() do { \
  1639. __IO uint32_t tmpreg; \
  1640. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_WWDG2EN);\
  1641. /* Delay after an RCC peripheral clock enabling */ \
  1642. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_WWDG2EN);\
  1643. UNUSED(tmpreg); \
  1644. } while(0)
  1645. #endif /*DUAL_CORE*/
  1646. #define __HAL_RCC_SPI2_CLK_ENABLE() do { \
  1647. __IO uint32_t tmpreg; \
  1648. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_SPI2EN);\
  1649. /* Delay after an RCC peripheral clock enabling */ \
  1650. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_SPI2EN);\
  1651. UNUSED(tmpreg); \
  1652. } while(0)
  1653. #define __HAL_RCC_SPI3_CLK_ENABLE() do { \
  1654. __IO uint32_t tmpreg; \
  1655. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_SPI3EN);\
  1656. /* Delay after an RCC peripheral clock enabling */ \
  1657. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_SPI3EN);\
  1658. UNUSED(tmpreg); \
  1659. } while(0)
  1660. #define __HAL_RCC_SPDIFRX_CLK_ENABLE() do { \
  1661. __IO uint32_t tmpreg; \
  1662. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_SPDIFRXEN);\
  1663. /* Delay after an RCC peripheral clock enabling */ \
  1664. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_SPDIFRXEN);\
  1665. UNUSED(tmpreg); \
  1666. } while(0)
  1667. #define __HAL_RCC_USART2_CLK_ENABLE() do { \
  1668. __IO uint32_t tmpreg; \
  1669. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_USART2EN);\
  1670. /* Delay after an RCC peripheral clock enabling */ \
  1671. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_USART2EN);\
  1672. UNUSED(tmpreg); \
  1673. } while(0)
  1674. #define __HAL_RCC_USART3_CLK_ENABLE() do { \
  1675. __IO uint32_t tmpreg; \
  1676. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_USART3EN);\
  1677. /* Delay after an RCC peripheral clock enabling */ \
  1678. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_USART3EN);\
  1679. UNUSED(tmpreg); \
  1680. } while(0)
  1681. #define __HAL_RCC_UART4_CLK_ENABLE() do { \
  1682. __IO uint32_t tmpreg; \
  1683. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_UART4EN);\
  1684. /* Delay after an RCC peripheral clock enabling */ \
  1685. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_UART4EN);\
  1686. UNUSED(tmpreg); \
  1687. } while(0)
  1688. #define __HAL_RCC_UART5_CLK_ENABLE() do { \
  1689. __IO uint32_t tmpreg; \
  1690. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_UART5EN);\
  1691. /* Delay after an RCC peripheral clock enabling */ \
  1692. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_UART5EN);\
  1693. UNUSED(tmpreg); \
  1694. } while(0)
  1695. #define __HAL_RCC_I2C1_CLK_ENABLE() do { \
  1696. __IO uint32_t tmpreg; \
  1697. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_I2C1EN);\
  1698. /* Delay after an RCC peripheral clock enabling */ \
  1699. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_I2C1EN);\
  1700. UNUSED(tmpreg); \
  1701. } while(0)
  1702. #define __HAL_RCC_I2C2_CLK_ENABLE() do { \
  1703. __IO uint32_t tmpreg; \
  1704. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_I2C2EN);\
  1705. /* Delay after an RCC peripheral clock enabling */ \
  1706. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_I2C2EN);\
  1707. UNUSED(tmpreg); \
  1708. } while(0)
  1709. #define __HAL_RCC_I2C3_CLK_ENABLE() do { \
  1710. __IO uint32_t tmpreg; \
  1711. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_I2C3EN);\
  1712. /* Delay after an RCC peripheral clock enabling */ \
  1713. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_I2C3EN);\
  1714. UNUSED(tmpreg); \
  1715. } while(0)
  1716. #if defined(I2C5)
  1717. #define __HAL_RCC_I2C5_CLK_ENABLE() do { \
  1718. __IO uint32_t tmpreg; \
  1719. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_I2C5EN);\
  1720. /* Delay after an RCC peripheral clock enabling */ \
  1721. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_I2C5EN);\
  1722. UNUSED(tmpreg); \
  1723. } while(0)
  1724. #endif /* I2C5 */
  1725. #define __HAL_RCC_CEC_CLK_ENABLE() do { \
  1726. __IO uint32_t tmpreg; \
  1727. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_CECEN);\
  1728. /* Delay after an RCC peripheral clock enabling */ \
  1729. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_CECEN);\
  1730. UNUSED(tmpreg); \
  1731. } while(0)
  1732. #define __HAL_RCC_DAC12_CLK_ENABLE() do { \
  1733. __IO uint32_t tmpreg; \
  1734. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_DAC12EN);\
  1735. /* Delay after an RCC peripheral clock enabling */ \
  1736. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_DAC12EN);\
  1737. UNUSED(tmpreg); \
  1738. } while(0)
  1739. #define __HAL_RCC_UART7_CLK_ENABLE() do { \
  1740. __IO uint32_t tmpreg; \
  1741. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_UART7EN);\
  1742. /* Delay after an RCC peripheral clock enabling */ \
  1743. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_UART7EN);\
  1744. UNUSED(tmpreg); \
  1745. } while(0)
  1746. #define __HAL_RCC_UART8_CLK_ENABLE() do { \
  1747. __IO uint32_t tmpreg; \
  1748. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_UART8EN);\
  1749. /* Delay after an RCC peripheral clock enabling */ \
  1750. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_UART8EN);\
  1751. UNUSED(tmpreg); \
  1752. } while(0)
  1753. #define __HAL_RCC_CRS_CLK_ENABLE() do { \
  1754. __IO uint32_t tmpreg; \
  1755. SET_BIT(RCC->APB1HENR, RCC_APB1HENR_CRSEN);\
  1756. /* Delay after an RCC peripheral clock enabling */ \
  1757. tmpreg = READ_BIT(RCC->APB1HENR, RCC_APB1HENR_CRSEN);\
  1758. UNUSED(tmpreg); \
  1759. } while(0)
  1760. #define __HAL_RCC_SWPMI1_CLK_ENABLE() do { \
  1761. __IO uint32_t tmpreg; \
  1762. SET_BIT(RCC->APB1HENR, RCC_APB1HENR_SWPMIEN);\
  1763. /* Delay after an RCC peripheral clock enabling */ \
  1764. tmpreg = READ_BIT(RCC->APB1HENR, RCC_APB1HENR_SWPMIEN);\
  1765. UNUSED(tmpreg); \
  1766. } while(0)
  1767. #define __HAL_RCC_OPAMP_CLK_ENABLE() do { \
  1768. __IO uint32_t tmpreg; \
  1769. SET_BIT(RCC->APB1HENR, RCC_APB1HENR_OPAMPEN);\
  1770. /* Delay after an RCC peripheral clock enabling */ \
  1771. tmpreg = READ_BIT(RCC->APB1HENR, RCC_APB1HENR_OPAMPEN);\
  1772. UNUSED(tmpreg); \
  1773. } while(0)
  1774. #define __HAL_RCC_MDIOS_CLK_ENABLE() do { \
  1775. __IO uint32_t tmpreg; \
  1776. SET_BIT(RCC->APB1HENR, RCC_APB1HENR_MDIOSEN);\
  1777. /* Delay after an RCC peripheral clock enabling */ \
  1778. tmpreg = READ_BIT(RCC->APB1HENR, RCC_APB1HENR_MDIOSEN);\
  1779. UNUSED(tmpreg); \
  1780. } while(0)
  1781. #define __HAL_RCC_FDCAN_CLK_ENABLE() do { \
  1782. __IO uint32_t tmpreg; \
  1783. SET_BIT(RCC->APB1HENR, RCC_APB1HENR_FDCANEN);\
  1784. /* Delay after an RCC peripheral clock enabling */ \
  1785. tmpreg = READ_BIT(RCC->APB1HENR, RCC_APB1HENR_FDCANEN);\
  1786. UNUSED(tmpreg); \
  1787. } while(0)
  1788. #if defined(TIM23)
  1789. #define __HAL_RCC_TIM23_CLK_ENABLE() do { \
  1790. __IO uint32_t tmpreg; \
  1791. SET_BIT(RCC->APB1HENR, RCC_APB1HENR_TIM23EN);\
  1792. /* Delay after an RCC peripheral clock enabling */ \
  1793. tmpreg = READ_BIT(RCC->APB1HENR, RCC_APB1HENR_TIM23EN);\
  1794. UNUSED(tmpreg); \
  1795. } while(0)
  1796. #endif /* TIM23 */
  1797. #if defined(TIM24)
  1798. #define __HAL_RCC_TIM24_CLK_ENABLE() do { \
  1799. __IO uint32_t tmpreg; \
  1800. SET_BIT(RCC->APB1HENR, RCC_APB1HENR_TIM24EN);\
  1801. /* Delay after an RCC peripheral clock enabling */ \
  1802. tmpreg = READ_BIT(RCC->APB1HENR, RCC_APB1HENR_TIM24EN);\
  1803. UNUSED(tmpreg); \
  1804. } while(0)
  1805. #endif /* TIM24 */
  1806. #define __HAL_RCC_TIM2_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_TIM2EN)
  1807. #define __HAL_RCC_TIM3_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_TIM3EN)
  1808. #define __HAL_RCC_TIM4_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_TIM4EN)
  1809. #define __HAL_RCC_TIM5_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_TIM5EN)
  1810. #define __HAL_RCC_TIM6_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_TIM6EN)
  1811. #define __HAL_RCC_TIM7_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_TIM7EN)
  1812. #define __HAL_RCC_TIM12_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_TIM12EN)
  1813. #define __HAL_RCC_TIM13_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_TIM13EN)
  1814. #define __HAL_RCC_TIM14_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_TIM14EN)
  1815. #define __HAL_RCC_LPTIM1_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_LPTIM1EN)
  1816. #if defined(DUAL_CORE)
  1817. #define __HAL_RCC_WWDG2_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_WWDG2EN)
  1818. #endif /*DUAL_CORE*/
  1819. #define __HAL_RCC_SPI2_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_SPI2EN)
  1820. #define __HAL_RCC_SPI3_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_SPI3EN)
  1821. #define __HAL_RCC_SPDIFRX_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_SPDIFRXEN)
  1822. #define __HAL_RCC_USART2_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_USART2EN)
  1823. #define __HAL_RCC_USART3_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_USART3EN)
  1824. #define __HAL_RCC_UART4_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_UART4EN)
  1825. #define __HAL_RCC_UART5_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_UART5EN)
  1826. #define __HAL_RCC_I2C1_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_I2C1EN)
  1827. #define __HAL_RCC_I2C2_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_I2C2EN)
  1828. #define __HAL_RCC_I2C3_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_I2C3EN)
  1829. #if defined(I2C5)
  1830. #define __HAL_RCC_I2C5_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_I2C5EN)
  1831. #endif /* I2C5 */
  1832. #define __HAL_RCC_CEC_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_CECEN)
  1833. #define __HAL_RCC_DAC12_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_DAC12EN)
  1834. #define __HAL_RCC_UART7_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_UART7EN)
  1835. #define __HAL_RCC_UART8_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_UART8EN)
  1836. #define __HAL_RCC_CRS_CLK_DISABLE() (RCC->APB1HENR) &= ~ (RCC_APB1HENR_CRSEN)
  1837. #define __HAL_RCC_SWPMI1_CLK_DISABLE() (RCC->APB1HENR) &= ~ (RCC_APB1HENR_SWPMIEN)
  1838. #define __HAL_RCC_OPAMP_CLK_DISABLE() (RCC->APB1HENR) &= ~ (RCC_APB1HENR_OPAMPEN)
  1839. #define __HAL_RCC_MDIOS_CLK_DISABLE() (RCC->APB1HENR) &= ~ (RCC_APB1HENR_MDIOSEN)
  1840. #define __HAL_RCC_FDCAN_CLK_DISABLE() (RCC->APB1HENR) &= ~ (RCC_APB1HENR_FDCANEN)
  1841. #if defined(TIM23)
  1842. #define __HAL_RCC_TIM23_CLK_DISABLE() (RCC->APB1HENR) &= ~ (RCC_APB1HENR_TIM23EN)
  1843. #endif /* TIM23 */
  1844. #if defined(TIM24)
  1845. #define __HAL_RCC_TIM24_CLK_DISABLE() (RCC->APB1HENR) &= ~ (RCC_APB1HENR_TIM24EN)
  1846. #endif /* TIM24 */
  1847. /** @brief Get the enable or disable status of the APB1 peripheral clock
  1848. * @note After reset, the peripheral clock (used for registers read/write access)
  1849. * is disabled and the application software has to enable this clock before
  1850. * using it.
  1851. */
  1852. #define __HAL_RCC_TIM2_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM2EN) != 0U)
  1853. #define __HAL_RCC_TIM3_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM3EN) != 0U)
  1854. #define __HAL_RCC_TIM4_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM4EN) != 0U)
  1855. #define __HAL_RCC_TIM5_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM5EN) != 0U)
  1856. #define __HAL_RCC_TIM6_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM6EN) != 0U)
  1857. #define __HAL_RCC_TIM7_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM7EN) != 0U)
  1858. #define __HAL_RCC_TIM12_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM12EN) != 0U)
  1859. #define __HAL_RCC_TIM13_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM13EN) != 0U)
  1860. #define __HAL_RCC_TIM14_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM14EN) != 0U)
  1861. #define __HAL_RCC_LPTIM1_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_LPTIM1EN) != 0U)
  1862. #if defined(DUAL_CORE)
  1863. #define __HAL_RCC_WWDG2_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_WWDG2EN) != 0U)
  1864. #endif /*DUAL_CORE*/
  1865. #define __HAL_RCC_SPI2_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_SPI2EN) != 0U)
  1866. #define __HAL_RCC_SPI3_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_SPI3EN) != 0U)
  1867. #define __HAL_RCC_SPDIFRX_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_SPDIFRXEN) != 0U)
  1868. #define __HAL_RCC_USART2_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_USART2EN) != 0U)
  1869. #define __HAL_RCC_USART3_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_USART3EN) != 0U)
  1870. #define __HAL_RCC_UART4_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_UART4EN) != 0U)
  1871. #define __HAL_RCC_UART5_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_UART5EN) != 0U)
  1872. #define __HAL_RCC_I2C1_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_I2C1EN) != 0U)
  1873. #define __HAL_RCC_I2C2_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_I2C2EN) != 0U)
  1874. #define __HAL_RCC_I2C3_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_I2C3EN) != 0U)
  1875. #if defined(I2C5)
  1876. #define __HAL_RCC_I2C5_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_I2C5EN) != 0U)
  1877. #endif /* I2C5 */
  1878. #define __HAL_RCC_CEC_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_CECEN) != 0U)
  1879. #define __HAL_RCC_DAC12_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_DAC12EN) != 0U)
  1880. #define __HAL_RCC_UART7_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_UART7EN) != 0U)
  1881. #define __HAL_RCC_UART8_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_UART8EN) != 0U)
  1882. #define __HAL_RCC_CRS_IS_CLK_ENABLED() ((RCC->APB1HENR & RCC_APB1HENR_CRSEN) != 0U)
  1883. #define __HAL_RCC_SWPMI1_IS_CLK_ENABLED() ((RCC->APB1HENR & RCC_APB1HENR_SWPMIEN) != 0U)
  1884. #define __HAL_RCC_OPAMP_IS_CLK_ENABLED() ((RCC->APB1HENR & RCC_APB1HENR_OPAMPEN) != 0U)
  1885. #define __HAL_RCC_MDIOS_IS_CLK_ENABLED() ((RCC->APB1HENR & RCC_APB1HENR_MDIOSEN) != 0U)
  1886. #define __HAL_RCC_FDCAN_IS_CLK_ENABLED() ((RCC->APB1HENR & RCC_APB1HENR_FDCANEN) != 0U)
  1887. #if defined(TIM23)
  1888. #define __HAL_RCC_TIM23_IS_CLK_ENABLED() ((RCC->APB1HENR & RCC_APB1HENR_TIM23EN) != 0U)
  1889. #endif /* TIM23 */
  1890. #if defined(TIM24)
  1891. #define __HAL_RCC_TIM24_IS_CLK_ENABLED() ((RCC->APB1HENR & RCC_APB1HENR_TIM24EN) != 0U)
  1892. #endif /* TIM24 */
  1893. #define __HAL_RCC_TIM2_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM2EN) == 0U)
  1894. #define __HAL_RCC_TIM3_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM3EN) == 0U)
  1895. #define __HAL_RCC_TIM4_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM4EN) == 0U)
  1896. #define __HAL_RCC_TIM5_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM5EN) == 0U)
  1897. #define __HAL_RCC_TIM6_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM6EN) == 0U)
  1898. #define __HAL_RCC_TIM7_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM7EN) == 0U)
  1899. #define __HAL_RCC_TIM12_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM12EN) == 0U)
  1900. #define __HAL_RCC_TIM13_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM13EN) == 0U)
  1901. #define __HAL_RCC_TIM14_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM14EN) == 0U)
  1902. #define __HAL_RCC_LPTIM1_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_LPTIM1EN) == 0U)
  1903. #if defined(DUAL_CORE)
  1904. #define __HAL_RCC_WWDG2_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_WWDG2EN) == 0U)
  1905. #endif /*DUAL_CORE*/
  1906. #define __HAL_RCC_SPI2_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_SPI2EN) == 0U)
  1907. #define __HAL_RCC_SPI3_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_SPI3EN) == 0U)
  1908. #define __HAL_RCC_SPDIFRX_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_SPDIFRXEN) == 0U)
  1909. #define __HAL_RCC_USART2_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_USART2EN) == 0U)
  1910. #define __HAL_RCC_USART3_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_USART3EN) == 0U)
  1911. #define __HAL_RCC_UART4_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_UART4EN) == 0U)
  1912. #define __HAL_RCC_UART5_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_UART5EN) == 0U)
  1913. #define __HAL_RCC_I2C1_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_I2C1EN) == 0U)
  1914. #define __HAL_RCC_I2C2_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_I2C2EN) == 0U)
  1915. #define __HAL_RCC_I2C3_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_I2C3EN) == 0U)
  1916. #if defined(I2C5)
  1917. #define __HAL_RCC_I2C5_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_I2C5EN) == 0U)
  1918. #endif /* I2C5 */
  1919. #define __HAL_RCC_CEC_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_CECEN) == 0U)
  1920. #define __HAL_RCC_DAC12_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_DAC12EN) == 0U)
  1921. #define __HAL_RCC_UART7_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_UART7EN) == 0U)
  1922. #define __HAL_RCC_UART8_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_UART8EN) == 0U)
  1923. #define __HAL_RCC_CRS_IS_CLK_DISABLED() ((RCC->APB1HENR & RCC_APB1HENR_CRSEN) == 0U)
  1924. #define __HAL_RCC_SWPMI1_IS_CLK_DISABLED() ((RCC->APB1HENR & RCC_APB1HENR_SWPMIEN) == 0U)
  1925. #define __HAL_RCC_OPAMP_IS_CLK_DISABLED() ((RCC->APB1HENR & RCC_APB1HENR_OPAMPEN) == 0U)
  1926. #define __HAL_RCC_MDIOS_IS_CLK_DISABLED() ((RCC->APB1HENR & RCC_APB1HENR_MDIOSEN) == 0U)
  1927. #define __HAL_RCC_FDCAN_IS_CLK_DISABLED() ((RCC->APB1HENR & RCC_APB1HENR_FDCANEN) == 0U)
  1928. #if defined(TIM23)
  1929. #define __HAL_RCC_TIM23_IS_CLK_DISABLED() ((RCC->APB1HENR & RCC_APB1HENR_TIM23EN) == 0U)
  1930. #endif /* TIM23 */
  1931. #if defined(TIM24)
  1932. #define __HAL_RCC_TIM24_IS_CLK_DISABLED() ((RCC->APB1HENR & RCC_APB1HENR_TIM24EN) == 0U)
  1933. #endif /* TIM24 */
  1934. /** @brief Enable or disable the APB2 peripheral clock.
  1935. * @note After reset, the peripheral clock (used for registers read/write access)
  1936. * is disabled and the application software has to enable this clock before
  1937. * using it.
  1938. */
  1939. #define __HAL_RCC_TIM1_CLK_ENABLE() do { \
  1940. __IO uint32_t tmpreg; \
  1941. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM1EN);\
  1942. /* Delay after an RCC peripheral clock enabling */ \
  1943. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM1EN);\
  1944. UNUSED(tmpreg); \
  1945. } while(0)
  1946. #define __HAL_RCC_TIM8_CLK_ENABLE() do { \
  1947. __IO uint32_t tmpreg; \
  1948. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM8EN);\
  1949. /* Delay after an RCC peripheral clock enabling */ \
  1950. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM8EN);\
  1951. UNUSED(tmpreg); \
  1952. } while(0)
  1953. #define __HAL_RCC_USART1_CLK_ENABLE() do { \
  1954. __IO uint32_t tmpreg; \
  1955. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_USART1EN);\
  1956. /* Delay after an RCC peripheral clock enabling */ \
  1957. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_USART1EN);\
  1958. UNUSED(tmpreg); \
  1959. } while(0)
  1960. #define __HAL_RCC_USART6_CLK_ENABLE() do { \
  1961. __IO uint32_t tmpreg; \
  1962. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_USART6EN);\
  1963. /* Delay after an RCC peripheral clock enabling */ \
  1964. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_USART6EN);\
  1965. UNUSED(tmpreg); \
  1966. } while(0)
  1967. #if defined(UART9)
  1968. #define __HAL_RCC_UART9_CLK_ENABLE() do { \
  1969. __IO uint32_t tmpreg; \
  1970. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_UART9EN);\
  1971. /* Delay after an RCC peripheral clock enabling */ \
  1972. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_UART9EN);\
  1973. UNUSED(tmpreg); \
  1974. } while(0)
  1975. #endif /*UART9*/
  1976. #if defined(USART10)
  1977. #define __HAL_RCC_USART10_CLK_ENABLE() do { \
  1978. __IO uint32_t tmpreg; \
  1979. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_USART10EN);\
  1980. /* Delay after an RCC peripheral clock enabling */ \
  1981. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_USART10EN);\
  1982. UNUSED(tmpreg); \
  1983. } while(0)
  1984. #endif /*USART10*/
  1985. #define __HAL_RCC_SPI1_CLK_ENABLE() do { \
  1986. __IO uint32_t tmpreg; \
  1987. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI1EN);\
  1988. /* Delay after an RCC peripheral clock enabling */ \
  1989. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI1EN);\
  1990. UNUSED(tmpreg); \
  1991. } while(0)
  1992. #define __HAL_RCC_SPI4_CLK_ENABLE() do { \
  1993. __IO uint32_t tmpreg; \
  1994. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI4EN);\
  1995. /* Delay after an RCC peripheral clock enabling */ \
  1996. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI4EN);\
  1997. UNUSED(tmpreg); \
  1998. } while(0)
  1999. #define __HAL_RCC_TIM15_CLK_ENABLE() do { \
  2000. __IO uint32_t tmpreg; \
  2001. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM15EN);\
  2002. /* Delay after an RCC peripheral clock enabling */ \
  2003. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM15EN);\
  2004. UNUSED(tmpreg); \
  2005. } while(0)
  2006. #define __HAL_RCC_TIM16_CLK_ENABLE() do { \
  2007. __IO uint32_t tmpreg; \
  2008. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM16EN);\
  2009. /* Delay after an RCC peripheral clock enabling */ \
  2010. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM16EN);\
  2011. UNUSED(tmpreg); \
  2012. } while(0)
  2013. #define __HAL_RCC_TIM17_CLK_ENABLE() do { \
  2014. __IO uint32_t tmpreg; \
  2015. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM17EN);\
  2016. /* Delay after an RCC peripheral clock enabling */ \
  2017. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM17EN);\
  2018. UNUSED(tmpreg); \
  2019. } while(0)
  2020. #define __HAL_RCC_SPI5_CLK_ENABLE() do { \
  2021. __IO uint32_t tmpreg; \
  2022. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI5EN);\
  2023. /* Delay after an RCC peripheral clock enabling */ \
  2024. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI5EN);\
  2025. UNUSED(tmpreg); \
  2026. } while(0)
  2027. #define __HAL_RCC_SAI1_CLK_ENABLE() do { \
  2028. __IO uint32_t tmpreg; \
  2029. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI1EN);\
  2030. /* Delay after an RCC peripheral clock enabling */ \
  2031. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI1EN);\
  2032. UNUSED(tmpreg); \
  2033. } while(0)
  2034. #if defined(SAI2)
  2035. #define __HAL_RCC_SAI2_CLK_ENABLE() do { \
  2036. __IO uint32_t tmpreg; \
  2037. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI2EN);\
  2038. /* Delay after an RCC peripheral clock enabling */ \
  2039. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI2EN);\
  2040. UNUSED(tmpreg); \
  2041. } while(0)
  2042. #endif /*SAI2*/
  2043. #if defined(SAI3)
  2044. #define __HAL_RCC_SAI3_CLK_ENABLE() do { \
  2045. __IO uint32_t tmpreg; \
  2046. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI3EN);\
  2047. /* Delay after an RCC peripheral clock enabling */ \
  2048. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI3EN);\
  2049. UNUSED(tmpreg); \
  2050. } while(0)
  2051. #endif /*SAI3*/
  2052. #define __HAL_RCC_DFSDM1_CLK_ENABLE() do { \
  2053. __IO uint32_t tmpreg; \
  2054. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_DFSDM1EN);\
  2055. /* Delay after an RCC peripheral clock enabling */ \
  2056. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_DFSDM1EN);\
  2057. UNUSED(tmpreg); \
  2058. } while(0)
  2059. #if defined(HRTIM1)
  2060. #define __HAL_RCC_HRTIM1_CLK_ENABLE() do { \
  2061. __IO uint32_t tmpreg; \
  2062. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_HRTIMEN);\
  2063. /* Delay after an RCC peripheral clock enabling */ \
  2064. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_HRTIMEN);\
  2065. UNUSED(tmpreg); \
  2066. } while(0)
  2067. #endif /*HRTIM1*/
  2068. #define __HAL_RCC_TIM1_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_TIM1EN)
  2069. #define __HAL_RCC_TIM8_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_TIM8EN)
  2070. #define __HAL_RCC_USART1_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_USART1EN)
  2071. #define __HAL_RCC_USART6_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_USART6EN)
  2072. #if defined(UART9)
  2073. #define __HAL_RCC_UART9_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_UART9EN)
  2074. #endif /*UART9*/
  2075. #if defined(USART10)
  2076. #define __HAL_RCC_USART10_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_USART10EN)
  2077. #endif /*USART10*/
  2078. #define __HAL_RCC_SPI1_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_SPI1EN)
  2079. #define __HAL_RCC_SPI4_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_SPI4EN)
  2080. #define __HAL_RCC_TIM15_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_TIM15EN)
  2081. #define __HAL_RCC_TIM16_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_TIM16EN)
  2082. #define __HAL_RCC_TIM17_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_TIM17EN)
  2083. #define __HAL_RCC_SPI5_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_SPI5EN)
  2084. #define __HAL_RCC_SAI1_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_SAI1EN)
  2085. #if defined(SAI2)
  2086. #define __HAL_RCC_SAI2_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_SAI2EN)
  2087. #endif /*SAI2*/
  2088. #if defined(SAI3)
  2089. #define __HAL_RCC_SAI3_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_SAI3EN)
  2090. #endif /*SAI3*/
  2091. #define __HAL_RCC_DFSDM1_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_DFSDM1EN)
  2092. #if defined(HRTIM1)
  2093. #define __HAL_RCC_HRTIM1_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_HRTIMEN)
  2094. #endif /*HRTIM*/
  2095. /** @brief Get the enable or disable status of the APB2 peripheral clock
  2096. * @note After reset, the peripheral clock (used for registers read/write access)
  2097. * is disabled and the application software has to enable this clock before
  2098. * using it.
  2099. */
  2100. #define __HAL_RCC_TIM1_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_TIM1EN) != 0U)
  2101. #define __HAL_RCC_TIM8_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_TIM8EN) != 0U)
  2102. #define __HAL_RCC_USART1_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_USART1EN) != 0U)
  2103. #define __HAL_RCC_USART6_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_USART6EN) != 0U)
  2104. #if defined(UART9)
  2105. #define __HAL_RCC_UART9_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_UART9EN) != 0U)
  2106. #endif /*UART9*/
  2107. #if defined(USART10)
  2108. #define __HAL_RCC_USART10_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_USART10EN) != 0U)
  2109. #endif /*USART10*/
  2110. #define __HAL_RCC_SPI1_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_SPI1EN) != 0U)
  2111. #define __HAL_RCC_SPI4_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_SPI4EN) != 0U)
  2112. #define __HAL_RCC_TIM15_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_TIM15EN) != 0U)
  2113. #define __HAL_RCC_TIM16_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_TIM16EN) != 0U)
  2114. #define __HAL_RCC_TIM17_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_TIM17EN) != 0U)
  2115. #define __HAL_RCC_SPI5_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_SPI5EN) != 0U)
  2116. #define __HAL_RCC_SAI1_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_SAI1EN) != 0U)
  2117. #if defined(SAI2)
  2118. #define __HAL_RCC_SAI2_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_SAI2EN) != 0U)
  2119. #endif /*SAI2*/
  2120. #if defined(SAI3)
  2121. #define __HAL_RCC_SAI3_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_SAI3EN) != 0U)
  2122. #endif /* SAI3 */
  2123. #define __HAL_RCC_DFSDM1_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_DFSDM1EN) != 0U)
  2124. #if defined(HRTIM1)
  2125. #define __HAL_RCC_HRTIM1_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_HRTIMEN) != 0U)
  2126. #endif /*HRTIM1*/
  2127. #define __HAL_RCC_TIM1_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_TIM1EN) == 0U)
  2128. #define __HAL_RCC_TIM8_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_TIM8EN) == 0U)
  2129. #define __HAL_RCC_USART1_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_USART1EN) == 0U)
  2130. #define __HAL_RCC_USART6_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_USART6EN) == 0U)
  2131. #if defined(UART9)
  2132. #define __HAL_RCC_UART9_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_UART9EN) == 0U)
  2133. #endif /*UART9*/
  2134. #if defined(USART10)
  2135. #define __HAL_RCC_USART10_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_USART10EN) == 0U)
  2136. #endif /*USART10*/
  2137. #define __HAL_RCC_SPI1_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_SPI1EN) == 0U)
  2138. #define __HAL_RCC_SPI4_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_SPI4EN) == 0U)
  2139. #define __HAL_RCC_TIM15_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_TIM15EN) == 0U)
  2140. #define __HAL_RCC_TIM16_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_TIM16EN) == 0U)
  2141. #define __HAL_RCC_TIM17_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_TIM17EN) == 0U)
  2142. #define __HAL_RCC_SPI5_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_SPI5EN) == 0U)
  2143. #define __HAL_RCC_SAI1_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_SAI1EN) == 0U)
  2144. #if defined(SAI2)
  2145. #define __HAL_RCC_SAI2_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_SAI2EN) == 0U)
  2146. #endif /*SAI2*/
  2147. #if defined(SAI3)
  2148. #define __HAL_RCC_SAI3_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_SAI3EN) == 0U)
  2149. #endif /*SAI3*/
  2150. #define __HAL_RCC_DFSDM1_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_DFSDM1EN) == 0U)
  2151. #if defined(HRTIM1)
  2152. #define __HAL_RCC_HRTIM1_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_HRTIMEN) == 0U)
  2153. #endif /*HRTIM1*/
  2154. /** @brief Enable or disable the APB4 peripheral clock.
  2155. * @note After reset, the peripheral clock (used for registers read/write access)
  2156. * is disabled and the application software has to enable this clock before
  2157. * using it.
  2158. */
  2159. #define __HAL_RCC_SYSCFG_CLK_ENABLE() do { \
  2160. __IO uint32_t tmpreg; \
  2161. SET_BIT(RCC->APB4ENR, RCC_APB4ENR_SYSCFGEN);\
  2162. /* Delay after an RCC peripheral clock enabling */ \
  2163. tmpreg = READ_BIT(RCC->APB4ENR, RCC_APB4ENR_SYSCFGEN);\
  2164. UNUSED(tmpreg); \
  2165. } while(0)
  2166. #define __HAL_RCC_LPUART1_CLK_ENABLE() do { \
  2167. __IO uint32_t tmpreg; \
  2168. SET_BIT(RCC->APB4ENR, RCC_APB4ENR_LPUART1EN);\
  2169. /* Delay after an RCC peripheral clock enabling */ \
  2170. tmpreg = READ_BIT(RCC->APB4ENR, RCC_APB4ENR_LPUART1EN);\
  2171. UNUSED(tmpreg); \
  2172. } while(0)
  2173. #define __HAL_RCC_SPI6_CLK_ENABLE() do { \
  2174. __IO uint32_t tmpreg; \
  2175. SET_BIT(RCC->APB4ENR, RCC_APB4ENR_SPI6EN);\
  2176. /* Delay after an RCC peripheral clock enabling */ \
  2177. tmpreg = READ_BIT(RCC->APB4ENR, RCC_APB4ENR_SPI6EN);\
  2178. UNUSED(tmpreg); \
  2179. } while(0)
  2180. #define __HAL_RCC_I2C4_CLK_ENABLE() do { \
  2181. __IO uint32_t tmpreg; \
  2182. SET_BIT(RCC->APB4ENR, RCC_APB4ENR_I2C4EN);\
  2183. /* Delay after an RCC peripheral clock enabling */ \
  2184. tmpreg = READ_BIT(RCC->APB4ENR, RCC_APB4ENR_I2C4EN);\
  2185. UNUSED(tmpreg); \
  2186. } while(0)
  2187. #define __HAL_RCC_LPTIM2_CLK_ENABLE() do { \
  2188. __IO uint32_t tmpreg; \
  2189. SET_BIT(RCC->APB4ENR, RCC_APB4ENR_LPTIM2EN);\
  2190. /* Delay after an RCC peripheral clock enabling */ \
  2191. tmpreg = READ_BIT(RCC->APB4ENR, RCC_APB4ENR_LPTIM2EN);\
  2192. UNUSED(tmpreg); \
  2193. } while(0)
  2194. #define __HAL_RCC_LPTIM3_CLK_ENABLE() do { \
  2195. __IO uint32_t tmpreg; \
  2196. SET_BIT(RCC->APB4ENR, RCC_APB4ENR_LPTIM3EN);\
  2197. /* Delay after an RCC peripheral clock enabling */ \
  2198. tmpreg = READ_BIT(RCC->APB4ENR, RCC_APB4ENR_LPTIM3EN);\
  2199. UNUSED(tmpreg); \
  2200. } while(0)
  2201. #if defined(LPTIM4)
  2202. #define __HAL_RCC_LPTIM4_CLK_ENABLE() do { \
  2203. __IO uint32_t tmpreg; \
  2204. SET_BIT(RCC->APB4ENR, RCC_APB4ENR_LPTIM4EN);\
  2205. /* Delay after an RCC peripheral clock enabling */ \
  2206. tmpreg = READ_BIT(RCC->APB4ENR, RCC_APB4ENR_LPTIM4EN);\
  2207. UNUSED(tmpreg); \
  2208. } while(0)
  2209. #endif /* LPTIM4 */
  2210. #if defined(LPTIM5)
  2211. #define __HAL_RCC_LPTIM5_CLK_ENABLE() do { \
  2212. __IO uint32_t tmpreg; \
  2213. SET_BIT(RCC->APB4ENR, RCC_APB4ENR_LPTIM5EN);\
  2214. /* Delay after an RCC peripheral clock enabling */ \
  2215. tmpreg = READ_BIT(RCC->APB4ENR, RCC_APB4ENR_LPTIM5EN);\
  2216. UNUSED(tmpreg); \
  2217. } while(0)
  2218. #endif /* LPTIM5 */
  2219. #if defined(DAC2)
  2220. #define __HAL_RCC_DAC2_CLK_ENABLE() do { \
  2221. __IO uint32_t tmpreg; \
  2222. SET_BIT(RCC->APB4ENR, RCC_APB4ENR_DAC2EN);\
  2223. /* Delay after an RCC peripheral clock enabling */ \
  2224. tmpreg = READ_BIT(RCC->APB4ENR, RCC_APB4ENR_DAC2EN);\
  2225. UNUSED(tmpreg); \
  2226. } while(0)
  2227. #endif /* DAC2 */
  2228. #define __HAL_RCC_COMP12_CLK_ENABLE() do { \
  2229. __IO uint32_t tmpreg; \
  2230. SET_BIT(RCC->APB4ENR, RCC_APB4ENR_COMP12EN);\
  2231. /* Delay after an RCC peripheral clock enabling */ \
  2232. tmpreg = READ_BIT(RCC->APB4ENR, RCC_APB4ENR_COMP12EN);\
  2233. UNUSED(tmpreg); \
  2234. } while(0)
  2235. #define __HAL_RCC_VREF_CLK_ENABLE() do { \
  2236. __IO uint32_t tmpreg; \
  2237. SET_BIT(RCC->APB4ENR, RCC_APB4ENR_VREFEN);\
  2238. /* Delay after an RCC peripheral clock enabling */ \
  2239. tmpreg = READ_BIT(RCC->APB4ENR, RCC_APB4ENR_VREFEN);\
  2240. UNUSED(tmpreg); \
  2241. } while(0)
  2242. #if defined(SAI4)
  2243. #define __HAL_RCC_SAI4_CLK_ENABLE() do { \
  2244. __IO uint32_t tmpreg; \
  2245. SET_BIT(RCC->APB4ENR, RCC_APB4ENR_SAI4EN);\
  2246. /* Delay after an RCC peripheral clock enabling */ \
  2247. tmpreg = READ_BIT(RCC->APB4ENR, RCC_APB4ENR_SAI4EN);\
  2248. UNUSED(tmpreg); \
  2249. } while(0)
  2250. #endif /* SAI4 */
  2251. #define __HAL_RCC_RTC_CLK_ENABLE() do { \
  2252. __IO uint32_t tmpreg; \
  2253. SET_BIT(RCC->APB4ENR, RCC_APB4ENR_RTCAPBEN);\
  2254. /* Delay after an RCC peripheral clock enabling */ \
  2255. tmpreg = READ_BIT(RCC->APB4ENR, RCC_APB4ENR_RTCAPBEN);\
  2256. UNUSED(tmpreg); \
  2257. } while(0)
  2258. #if defined(DTS)
  2259. #define __HAL_RCC_DTS_CLK_ENABLE() do { \
  2260. __IO uint32_t tmpreg; \
  2261. SET_BIT(RCC->APB4ENR, RCC_APB4ENR_DTSEN);\
  2262. /* Delay after an RCC peripheral clock enabling */ \
  2263. tmpreg = READ_BIT(RCC->APB4ENR, RCC_APB4ENR_DTSEN);\
  2264. UNUSED(tmpreg); \
  2265. } while(0)
  2266. #endif /*DTS*/
  2267. #if defined(DFSDM2_BASE)
  2268. #define __HAL_RCC_DFSDM2_CLK_ENABLE() do { \
  2269. __IO uint32_t tmpreg; \
  2270. SET_BIT(RCC->APB4ENR, RCC_APB4ENR_DFSDM2EN);\
  2271. /* Delay after an RCC peripheral clock enabling */ \
  2272. tmpreg = READ_BIT(RCC->APB4ENR, RCC_APB4ENR_DFSDM2EN);\
  2273. UNUSED(tmpreg); \
  2274. } while(0)
  2275. #endif /*DFSDM2*/
  2276. #define __HAL_RCC_SYSCFG_CLK_DISABLE() (RCC->APB4ENR) &= ~ (RCC_APB4ENR_SYSCFGEN)
  2277. #define __HAL_RCC_LPUART1_CLK_DISABLE() (RCC->APB4ENR) &= ~ (RCC_APB4ENR_LPUART1EN)
  2278. #define __HAL_RCC_SPI6_CLK_DISABLE() (RCC->APB4ENR) &= ~ (RCC_APB4ENR_SPI6EN)
  2279. #define __HAL_RCC_I2C4_CLK_DISABLE() (RCC->APB4ENR) &= ~ (RCC_APB4ENR_I2C4EN)
  2280. #define __HAL_RCC_LPTIM2_CLK_DISABLE() (RCC->APB4ENR) &= ~ (RCC_APB4ENR_LPTIM2EN)
  2281. #define __HAL_RCC_LPTIM3_CLK_DISABLE() (RCC->APB4ENR) &= ~ (RCC_APB4ENR_LPTIM3EN)
  2282. #if defined(LPTIM4)
  2283. #define __HAL_RCC_LPTIM4_CLK_DISABLE() (RCC->APB4ENR) &= ~ (RCC_APB4ENR_LPTIM4EN)
  2284. #endif /*LPTIM4*/
  2285. #if defined(LPTIM5)
  2286. #define __HAL_RCC_LPTIM5_CLK_DISABLE() (RCC->APB4ENR) &= ~ (RCC_APB4ENR_LPTIM5EN)
  2287. #endif /*LPTIM5*/
  2288. #if defined(DAC2)
  2289. #define __HAL_RCC_DAC2_CLK_DISABLE() (RCC->APB4ENR) &= ~ (RCC_APB4ENR_DAC2EN)
  2290. #endif /*DAC2*/
  2291. #define __HAL_RCC_COMP12_CLK_DISABLE() (RCC->APB4ENR) &= ~ (RCC_APB4ENR_COMP12EN)
  2292. #define __HAL_RCC_VREF_CLK_DISABLE() (RCC->APB4ENR) &= ~ (RCC_APB4ENR_VREFEN)
  2293. #define __HAL_RCC_RTC_CLK_DISABLE() (RCC->APB4ENR) &= ~ (RCC_APB4ENR_RTCAPBEN)
  2294. #if defined(SAI4)
  2295. #define __HAL_RCC_SAI4_CLK_DISABLE() (RCC->APB4ENR) &= ~ (RCC_APB4ENR_SAI4EN)
  2296. #endif /*SAI4*/
  2297. #if defined(DTS)
  2298. #define __HAL_RCC_DTS_CLK_DISABLE() (RCC->APB4ENR) &= ~ (RCC_APB4ENR_DTSEN)
  2299. #endif /*DTS*/
  2300. #if defined(DFSDM2_BASE)
  2301. #define __HAL_RCC_DFSDM2_CLK_DISABLE() (RCC->APB4ENR) &= ~ (RCC_APB4ENR_DFSDM2EN)
  2302. #endif /*DFSDM2*/
  2303. /** @brief Get the enable or disable status of the APB4 peripheral clock
  2304. * @note After reset, the peripheral clock (used for registers read/write access)
  2305. * is disabled and the application software has to enable this clock before
  2306. * using it.
  2307. */
  2308. #define __HAL_RCC_SYSCFG_IS_CLK_ENABLED() ((RCC->APB4ENR & RCC_APB4ENR_SYSCFGEN) != 0U)
  2309. #define __HAL_RCC_LPUART1_IS_CLK_ENABLED() ((RCC->APB4ENR & RCC_APB4ENR_LPUART1EN) != 0U)
  2310. #define __HAL_RCC_SPI6_IS_CLK_ENABLED() ((RCC->APB4ENR & RCC_APB4ENR_SPI6EN) != 0U)
  2311. #define __HAL_RCC_I2C4_IS_CLK_ENABLED() ((RCC->APB4ENR & RCC_APB4ENR_I2C4EN) != 0U)
  2312. #define __HAL_RCC_LPTIM2_IS_CLK_ENABLED() ((RCC->APB4ENR & RCC_APB4ENR_LPTIM2EN) != 0U)
  2313. #define __HAL_RCC_LPTIM3_IS_CLK_ENABLED() ((RCC->APB4ENR & RCC_APB4ENR_LPTIM3EN) != 0U)
  2314. #if defined(LPTIM4)
  2315. #define __HAL_RCC_LPTIM4_IS_CLK_ENABLED() ((RCC->APB4ENR & RCC_APB4ENR_LPTIM4EN) != 0U)
  2316. #endif /*LPTIM4*/
  2317. #if defined(LPTIM5)
  2318. #define __HAL_RCC_LPTIM5_IS_CLK_ENABLED() ((RCC->APB4ENR & RCC_APB4ENR_LPTIM5EN) != 0U)
  2319. #endif /*LPTIM5*/
  2320. #if defined(DAC2)
  2321. #define __HAL_RCC_DAC2_IS_CLK_ENABLED() ((RCC->APB4ENR & RCC_APB4ENR_DAC2EN) != 0U)
  2322. #endif /*DAC2*/
  2323. #define __HAL_RCC_COMP12_IS_CLK_ENABLED() ((RCC->APB4ENR & RCC_APB4ENR_COMP12EN) != 0U)
  2324. #define __HAL_RCC_VREF_IS_CLK_ENABLED() ((RCC->APB4ENR & RCC_APB4ENR_VREFEN) != 0U)
  2325. #define __HAL_RCC_RTC_IS_CLK_ENABLED() ((RCC->APB4ENR & RCC_APB4ENR_RTCAPBEN) != 0U)
  2326. #if defined(SAI4)
  2327. #define __HAL_RCC_SAI4_IS_CLK_ENABLED() ((RCC->APB4ENR & RCC_APB4ENR_SAI4EN) != 0U)
  2328. #endif /*SAI4*/
  2329. #if defined(DTS)
  2330. #define __HAL_RCC_DTS_IS_CLK_ENABLED() ((RCC->APB4ENR & RCC_APB4ENR_DTSEN) != 0U)
  2331. #endif /*DTS*/
  2332. #if defined(DFSDM2_BASE)
  2333. #define __HAL_RCC_DFSDM2_IS_CLK_ENABLED() ((RCC->APB4ENR & RCC_APB4ENR_DFSDM2EN) != 0U)
  2334. #endif /*DFSDM2*/
  2335. #define __HAL_RCC_SYSCFG_IS_CLK_DISABLED() ((RCC->APB4ENR & RCC_APB4ENR_SYSCFGEN) == 0U)
  2336. #define __HAL_RCC_LPUART1_IS_CLK_DISABLED() ((RCC->APB4ENR & RCC_APB4ENR_LPUART1EN) == 0U)
  2337. #define __HAL_RCC_SPI6_IS_CLK_DISABLED() ((RCC->APB4ENR & RCC_APB4ENR_SPI6EN) == 0U)
  2338. #define __HAL_RCC_I2C4_IS_CLK_DISABLED() ((RCC->APB4ENR & RCC_APB4ENR_I2C4EN) == 0U)
  2339. #define __HAL_RCC_LPTIM2_IS_CLK_DISABLED() ((RCC->APB4ENR & RCC_APB4ENR_LPTIM2EN) == 0U)
  2340. #define __HAL_RCC_LPTIM3_IS_CLK_DISABLED() ((RCC->APB4ENR & RCC_APB4ENR_LPTIM3EN) == 0U)
  2341. #if defined(LPTIM4)
  2342. #define __HAL_RCC_LPTIM4_IS_CLK_DISABLED() ((RCC->APB4ENR & RCC_APB4ENR_LPTIM4EN) == 0U)
  2343. #endif /*LPTIM4*/
  2344. #if defined(LPTIM5)
  2345. #define __HAL_RCC_LPTIM5_IS_CLK_DISABLED() ((RCC->APB4ENR & RCC_APB4ENR_LPTIM5EN) == 0U)
  2346. #endif /*LPTIM5*/
  2347. #if defined(DAC2)
  2348. #define __HAL_RCC_DAC2_IS_CLK_DISABLED() ((RCC->APB4ENR & RCC_APB4ENR_DAC2EN) == 0U)
  2349. #endif /*DAC2*/
  2350. #define __HAL_RCC_COMP12_IS_CLK_DISABLED() ((RCC->APB4ENR & RCC_APB4ENR_COMP12EN) == 0U)
  2351. #define __HAL_RCC_VREF_IS_CLK_DISABLED() ((RCC->APB4ENR & RCC_APB4ENR_VREFEN) == 0U)
  2352. #define __HAL_RCC_RTC_IS_CLK_DISABLED() ((RCC->APB4ENR & RCC_APB4ENR_RTCAPBEN) == 0U)
  2353. #if defined(SAI4)
  2354. #define __HAL_RCC_SAI4_IS_CLK_DISABLED() ((RCC->APB4ENR & RCC_APB4ENR_SAI4EN) == 0U)
  2355. #endif /*SAI4*/
  2356. #if defined(DTS)
  2357. #define __HAL_RCC_DTS_IS_CLK_DISABLED() ((RCC->APB4ENR & RCC_APB4ENR_DTSEN) == 0U)
  2358. #endif /*DTS*/
  2359. #if defined(DFSDM2_BASE)
  2360. #define __HAL_RCC_DFSDM2_IS_CLK_DISABLED() ((RCC->APB4ENR & RCC_APB4ENR_DFSDM2EN) == 0U)
  2361. #endif /*DFSDM2*/
  2362. #if defined(DUAL_CORE)
  2363. /* Exported macros for RCC_C1 -------------------------------------------------*/
  2364. /** @brief Enable or disable the AHB3 peripheral clock.
  2365. * @note After reset, the peripheral clock (used for registers read/write access)
  2366. * is disabled and the application software has to enable this clock before
  2367. * using it.
  2368. */
  2369. #define __HAL_RCC_C1_MDMA_CLK_ENABLE() do { \
  2370. __IO uint32_t tmpreg; \
  2371. SET_BIT(RCC_C1->AHB3ENR, RCC_AHB3ENR_MDMAEN);\
  2372. /* Delay after an RCC peripheral clock enabling */ \
  2373. tmpreg = READ_BIT(RCC_C1->AHB3ENR, RCC_AHB3ENR_MDMAEN);\
  2374. UNUSED(tmpreg); \
  2375. } while(0)
  2376. #define __HAL_RCC_C1_DMA2D_CLK_ENABLE() do { \
  2377. __IO uint32_t tmpreg; \
  2378. SET_BIT(RCC_C1->AHB3ENR, RCC_AHB3ENR_DMA2DEN);\
  2379. /* Delay after an RCC peripheral clock enabling */ \
  2380. tmpreg = READ_BIT(RCC_C1->AHB3ENR, RCC_AHB3ENR_DMA2DEN);\
  2381. UNUSED(tmpreg); \
  2382. } while(0)
  2383. #define __HAL_RCC_C1_JPGDECEN_CLK_ENABLE() do { \
  2384. __IO uint32_t tmpreg; \
  2385. SET_BIT(RCC_C1->AHB3ENR, RCC_AHB3ENR_JPGDECEN);\
  2386. /* Delay after an RCC peripheral clock enabling */ \
  2387. tmpreg = READ_BIT(RCC_C1->AHB3ENR, RCC_AHB3ENR_JPGDECEN);\
  2388. UNUSED(tmpreg); \
  2389. } while(0)
  2390. #define __HAL_RCC_C1_FMC_CLK_ENABLE() do { \
  2391. __IO uint32_t tmpreg; \
  2392. SET_BIT(RCC_C1->AHB3ENR, RCC_AHB3ENR_FMCEN);\
  2393. /* Delay after an RCC peripheral clock enabling */ \
  2394. tmpreg = READ_BIT(RCC_C1->AHB3ENR, RCC_AHB3ENR_FMCEN);\
  2395. UNUSED(tmpreg); \
  2396. } while(0)
  2397. #define __HAL_RCC_C1_QSPI_CLK_ENABLE() do { \
  2398. __IO uint32_t tmpreg; \
  2399. SET_BIT(RCC_C1->AHB3ENR, RCC_AHB3ENR_QSPIEN);\
  2400. /* Delay after an RCC peripheral clock enabling */ \
  2401. tmpreg = READ_BIT(RCC_C1->AHB3ENR, RCC_AHB3ENR_QSPIEN);\
  2402. UNUSED(tmpreg); \
  2403. } while(0)
  2404. #define __HAL_RCC_C1_SDMMC1_CLK_ENABLE() do { \
  2405. __IO uint32_t tmpreg; \
  2406. SET_BIT(RCC_C1->AHB3ENR, RCC_AHB3ENR_SDMMC1EN);\
  2407. /* Delay after an RCC peripheral clock enabling */ \
  2408. tmpreg = READ_BIT(RCC_C1->AHB3ENR, RCC_AHB3ENR_SDMMC1EN);\
  2409. UNUSED(tmpreg); \
  2410. } while(0)
  2411. #define __HAL_RCC_C1_MDMA_CLK_DISABLE() (RCC_C1->AHB3ENR &= ~ (RCC_AHB3ENR_MDMAEN))
  2412. #define __HAL_RCC_C1_DMA2D_CLK_DISABLE() (RCC_C1->AHB3ENR &= ~ (RCC_AHB3ENR_DMA2DEN))
  2413. #define __HAL_RCC_C1_JPGDECEN_CLK_DISABLE() (RCC_C1->AHB3ENR &= ~ (RCC_AHB3ENR_JPGDECEN))
  2414. #define __HAL_RCC_C1_FMC_CLK_DISABLE() (RCC_C1->AHB3ENR &= ~ (RCC_AHB3ENR_FMCEN))
  2415. #define __HAL_RCC_C1_QSPI_CLK_DISABLE() (RCC_C1->AHB3ENR &= ~ (RCC_AHB3ENR_QSPIEN))
  2416. #define __HAL_RCC_C1_SDMMC1_CLK_DISABLE() (RCC_C1->AHB3ENR &= ~ (RCC_AHB3ENR_SDMMC1EN))
  2417. /** @brief Enable or disable the AHB1 peripheral clock.
  2418. * @note After reset, the peripheral clock (used for registers read/write access)
  2419. * is disabled and the application software has to enable this clock before
  2420. * using it.
  2421. */
  2422. #define __HAL_RCC_C1_DMA1_CLK_ENABLE() do { \
  2423. __IO uint32_t tmpreg; \
  2424. SET_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_DMA1EN);\
  2425. /* Delay after an RCC peripheral clock enabling */ \
  2426. tmpreg = READ_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_DMA1EN);\
  2427. UNUSED(tmpreg); \
  2428. } while(0)
  2429. #define __HAL_RCC_C1_DMA2_CLK_ENABLE() do { \
  2430. __IO uint32_t tmpreg; \
  2431. SET_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_DMA2EN);\
  2432. /* Delay after an RCC peripheral clock enabling */ \
  2433. tmpreg = READ_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_DMA2EN);\
  2434. UNUSED(tmpreg); \
  2435. } while(0)
  2436. #define __HAL_RCC_C1_ADC12_CLK_ENABLE() do { \
  2437. __IO uint32_t tmpreg; \
  2438. SET_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_ADC12EN);\
  2439. /* Delay after an RCC peripheral clock enabling */ \
  2440. tmpreg = READ_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_ADC12EN);\
  2441. UNUSED(tmpreg); \
  2442. } while(0)
  2443. #define __HAL_RCC_C1_ART_CLK_ENABLE() do { \
  2444. __IO uint32_t tmpreg; \
  2445. SET_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_ARTEN);\
  2446. /* Delay after an RCC peripheral clock enabling */ \
  2447. tmpreg = READ_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_ARTEN);\
  2448. UNUSED(tmpreg); \
  2449. } while(0)
  2450. #define __HAL_RCC_C1_ETH1MAC_CLK_ENABLE() do { \
  2451. __IO uint32_t tmpreg; \
  2452. SET_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_ETH1MACEN);\
  2453. /* Delay after an RCC peripheral clock enabling */ \
  2454. tmpreg = READ_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_ETH1MACEN);\
  2455. UNUSED(tmpreg); \
  2456. } while(0)
  2457. #define __HAL_RCC_C1_ETH1TX_CLK_ENABLE() do { \
  2458. __IO uint32_t tmpreg; \
  2459. SET_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_ETH1TXEN);\
  2460. /* Delay after an RCC peripheral clock enabling */ \
  2461. tmpreg = READ_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_ETH1TXEN);\
  2462. UNUSED(tmpreg); \
  2463. } while(0)
  2464. #define __HAL_RCC_C1_ETH1RX_CLK_ENABLE() do { \
  2465. __IO uint32_t tmpreg; \
  2466. SET_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_ETH1RXEN);\
  2467. /* Delay after an RCC peripheral clock enabling */ \
  2468. tmpreg = READ_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_ETH1RXEN);\
  2469. UNUSED(tmpreg); \
  2470. } while(0)
  2471. #define __HAL_RCC_C1_USB1_OTG_HS_CLK_ENABLE() do { \
  2472. __IO uint32_t tmpreg; \
  2473. SET_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_USB1OTGHSEN);\
  2474. /* Delay after an RCC peripheral clock enabling */ \
  2475. tmpreg = READ_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_USB1OTGHSEN);\
  2476. UNUSED(tmpreg); \
  2477. } while(0)
  2478. #define __HAL_RCC_C1_USB1_OTG_HS_ULPI_CLK_ENABLE() do { \
  2479. __IO uint32_t tmpreg; \
  2480. SET_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_USB1OTGHSULPIEN);\
  2481. /* Delay after an RCC peripheral clock enabling */ \
  2482. tmpreg = READ_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_USB1OTGHSULPIEN);\
  2483. UNUSED(tmpreg); \
  2484. } while(0)
  2485. #define __HAL_RCC_C1_USB2_OTG_FS_CLK_ENABLE() do { \
  2486. __IO uint32_t tmpreg; \
  2487. SET_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_USB2OTGHSEN);\
  2488. /* Delay after an RCC peripheral clock enabling */ \
  2489. tmpreg = READ_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_USB2OTGHSEN);\
  2490. UNUSED(tmpreg); \
  2491. } while(0)
  2492. #define __HAL_RCC_C1_USB2_OTG_FS_ULPI_CLK_ENABLE() do { \
  2493. __IO uint32_t tmpreg; \
  2494. SET_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_USB2OTGHSULPIEN);\
  2495. /* Delay after an RCC peripheral clock enabling */ \
  2496. tmpreg = READ_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_USB2OTGHSULPIEN);\
  2497. UNUSED(tmpreg); \
  2498. } while(0)
  2499. #define __HAL_RCC_C1_DMA1_CLK_DISABLE() (RCC_C1->AHB1ENR &= ~ (RCC_AHB1ENR_DMA1EN))
  2500. #define __HAL_RCC_C1_DMA2_CLK_DISABLE() (RCC_C1->AHB1ENR &= ~ (RCC_AHB1ENR_DMA2EN))
  2501. #define __HAL_RCC_C1_ADC12_CLK_DISABLE() (RCC_C1->AHB1ENR &= ~ (RCC_AHB1ENR_ADC12EN))
  2502. #define __HAL_RCC_C1_ART_CLK_DISABLE() (RCC_C1->AHB1ENR &= ~ (RCC_AHB1ENR_ARTEN))
  2503. #define __HAL_RCC_C1_ETH1MAC_CLK_DISABLE() (RCC_C1->AHB1ENR &= ~ (RCC_AHB1ENR_ETH1MACEN))
  2504. #define __HAL_RCC_C1_ETH1TX_CLK_DISABLE() (RCC_C1->AHB1ENR &= ~ (RCC_AHB1ENR_ETH1TXEN))
  2505. #define __HAL_RCC_C1_ETH1RX_CLK_DISABLE() (RCC_C1->AHB1ENR &= ~ (RCC_AHB1ENR_ETH1RXEN))
  2506. #define __HAL_RCC_C1_USB1_OTG_HS_CLK_DISABLE() (RCC_C1->AHB1ENR &= ~ (RCC_AHB1ENR_USB1OTGHSEN))
  2507. #define __HAL_RCC_C1_USB1_OTG_HS_ULPI_CLK_DISABLE() (RCC_C1->AHB1ENR &= ~ (RCC_AHB1ENR_USB1OTGHSULPIEN))
  2508. #define __HAL_RCC_C1_USB2_OTG_FS_CLK_DISABLE() (RCC_C1->AHB1ENR &= ~ (RCC_AHB1ENR_USB2OTGHSEN))
  2509. #define __HAL_RCC_C1_USB2_OTG_FS_ULPI_CLK_DISABLE() (RCC_C1->AHB1ENR &= ~ (RCC_AHB1ENR_USB2OTGHSULPIEN))
  2510. /** @brief Enable or disable the AHB2 peripheral clock.
  2511. * @note After reset, the peripheral clock (used for registers read/write access)
  2512. * is disabled and the application software has to enable this clock before
  2513. * using it.
  2514. */
  2515. #define __HAL_RCC_C1_DCMI_CLK_ENABLE() do { \
  2516. __IO uint32_t tmpreg; \
  2517. SET_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_DCMIEN);\
  2518. /* Delay after an RCC peripheral clock enabling */ \
  2519. tmpreg = READ_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_DCMIEN);\
  2520. UNUSED(tmpreg); \
  2521. } while(0)
  2522. #if defined(CRYP)
  2523. #define __HAL_RCC_C1_CRYP_CLK_ENABLE() do { \
  2524. __IO uint32_t tmpreg; \
  2525. SET_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_CRYPEN);\
  2526. /* Delay after an RCC peripheral clock enabling */ \
  2527. tmpreg = READ_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_CRYPEN);\
  2528. UNUSED(tmpreg); \
  2529. } while(0)
  2530. #endif /* CRYP */
  2531. #if defined(HASH)
  2532. #define __HAL_RCC_C1_HASH_CLK_ENABLE() do { \
  2533. __IO uint32_t tmpreg; \
  2534. SET_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_HASHEN);\
  2535. /* Delay after an RCC peripheral clock enabling */ \
  2536. tmpreg = READ_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_HASHEN);\
  2537. UNUSED(tmpreg); \
  2538. } while(0)
  2539. #endif /* HASH */
  2540. #define __HAL_RCC_C1_RNG_CLK_ENABLE() do { \
  2541. __IO uint32_t tmpreg; \
  2542. SET_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_RNGEN);\
  2543. /* Delay after an RCC peripheral clock enabling */ \
  2544. tmpreg = READ_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_RNGEN);\
  2545. UNUSED(tmpreg); \
  2546. } while(0)
  2547. #define __HAL_RCC_C1_SDMMC2_CLK_ENABLE() do { \
  2548. __IO uint32_t tmpreg; \
  2549. SET_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_SDMMC2EN);\
  2550. /* Delay after an RCC peripheral clock enabling */ \
  2551. tmpreg = READ_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_SDMMC2EN);\
  2552. UNUSED(tmpreg); \
  2553. } while(0)
  2554. #define __HAL_RCC_C1_D2SRAM1_CLK_ENABLE() do { \
  2555. __IO uint32_t tmpreg; \
  2556. SET_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_D2SRAM1EN);\
  2557. /* Delay after an RCC peripheral clock enabling */ \
  2558. tmpreg = READ_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_D2SRAM1EN);\
  2559. UNUSED(tmpreg); \
  2560. } while(0)
  2561. #define __HAL_RCC_C1_D2SRAM2_CLK_ENABLE() do { \
  2562. __IO uint32_t tmpreg; \
  2563. SET_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_D2SRAM2EN);\
  2564. /* Delay after an RCC peripheral clock enabling */ \
  2565. tmpreg = READ_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_D2SRAM2EN);\
  2566. UNUSED(tmpreg); \
  2567. } while(0)
  2568. #define __HAL_RCC_C1_D2SRAM3_CLK_ENABLE() do { \
  2569. __IO uint32_t tmpreg; \
  2570. SET_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_D2SRAM3EN);\
  2571. /* Delay after an RCC peripheral clock enabling */ \
  2572. tmpreg = READ_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_D2SRAM3EN);\
  2573. UNUSED(tmpreg); \
  2574. } while(0)
  2575. #define __HAL_RCC_C1_DCMI_CLK_DISABLE() (RCC_C1->AHB2ENR &= ~ (RCC_AHB2ENR_DCMIEN))
  2576. #if defined(CRYP)
  2577. #define __HAL_RCC_C1_CRYP_CLK_DISABLE() (RCC_C1->AHB2ENR &= ~ (RCC_AHB2ENR_CRYPEN))
  2578. #endif /* CRYP */
  2579. #if defined(HASH)
  2580. #define __HAL_RCC_C1_HASH_CLK_DISABLE() (RCC_C1->AHB2ENR &= ~ (RCC_AHB2ENR_HASHEN))
  2581. #endif /* HASH */
  2582. #define __HAL_RCC_C1_RNG_CLK_DISABLE() (RCC_C1->AHB2ENR &= ~ (RCC_AHB2ENR_RNGEN))
  2583. #define __HAL_RCC_C1_SDMMC2_CLK_DISABLE() (RCC_C1->AHB2ENR &= ~ (RCC_AHB2ENR_SDMMC2EN))
  2584. #define __HAL_RCC_C1_D2SRAM1_CLK_DISABLE() (RCC_C1->AHB2ENR &= ~ (RCC_AHB2ENR_D2SRAM1EN))
  2585. #define __HAL_RCC_C1_D2SRAM2_CLK_DISABLE() (RCC_C1->AHB2ENR &= ~ (RCC_AHB2ENR_D2SRAM2EN))
  2586. #define __HAL_RCC_C1_D2SRAM3_CLK_DISABLE() (RCC_C1->AHB2ENR &= ~ (RCC_AHB2ENR_D2SRAM3EN))
  2587. /** @brief Enable or disable the AHB4 peripheral clock.
  2588. * @note After reset, the peripheral clock (used for registers read/write access)
  2589. * is disabled and the application software has to enable this clock before
  2590. * using it.
  2591. */
  2592. #define __HAL_RCC_C1_GPIOA_CLK_ENABLE() do { \
  2593. __IO uint32_t tmpreg; \
  2594. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOAEN);\
  2595. /* Delay after an RCC peripheral clock enabling */ \
  2596. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOAEN);\
  2597. UNUSED(tmpreg); \
  2598. } while(0)
  2599. #define __HAL_RCC_C1_GPIOB_CLK_ENABLE() do { \
  2600. __IO uint32_t tmpreg; \
  2601. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOBEN);\
  2602. /* Delay after an RCC peripheral clock enabling */ \
  2603. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOBEN);\
  2604. UNUSED(tmpreg); \
  2605. } while(0)
  2606. #define __HAL_RCC_C1_GPIOC_CLK_ENABLE() do { \
  2607. __IO uint32_t tmpreg; \
  2608. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOCEN);\
  2609. /* Delay after an RCC peripheral clock enabling */ \
  2610. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOCEN);\
  2611. UNUSED(tmpreg); \
  2612. } while(0)
  2613. #define __HAL_RCC_C1_GPIOD_CLK_ENABLE() do { \
  2614. __IO uint32_t tmpreg; \
  2615. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIODEN);\
  2616. /* Delay after an RCC peripheral clock enabling */ \
  2617. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIODEN);\
  2618. UNUSED(tmpreg); \
  2619. } while(0)
  2620. #define __HAL_RCC_C1_GPIOE_CLK_ENABLE() do { \
  2621. __IO uint32_t tmpreg; \
  2622. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOEEN);\
  2623. /* Delay after an RCC peripheral clock enabling */ \
  2624. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOEEN);\
  2625. UNUSED(tmpreg); \
  2626. } while(0)
  2627. #define __HAL_RCC_C1_GPIOF_CLK_ENABLE() do { \
  2628. __IO uint32_t tmpreg; \
  2629. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOFEN);\
  2630. /* Delay after an RCC peripheral clock enabling */ \
  2631. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOFEN);\
  2632. UNUSED(tmpreg); \
  2633. } while(0)
  2634. #define __HAL_RCC_C1_GPIOG_CLK_ENABLE() do { \
  2635. __IO uint32_t tmpreg; \
  2636. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOGEN);\
  2637. /* Delay after an RCC peripheral clock enabling */ \
  2638. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOGEN);\
  2639. UNUSED(tmpreg); \
  2640. } while(0)
  2641. #define __HAL_RCC_C1_GPIOH_CLK_ENABLE() do { \
  2642. __IO uint32_t tmpreg; \
  2643. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOHEN);\
  2644. /* Delay after an RCC peripheral clock enabling */ \
  2645. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOHEN);\
  2646. UNUSED(tmpreg); \
  2647. } while(0)
  2648. #define __HAL_RCC_C1_GPIOI_CLK_ENABLE() do { \
  2649. __IO uint32_t tmpreg; \
  2650. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOIEN);\
  2651. /* Delay after an RCC peripheral clock enabling */ \
  2652. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOIEN);\
  2653. UNUSED(tmpreg); \
  2654. } while(0)
  2655. #define __HAL_RCC_C1_GPIOJ_CLK_ENABLE() do { \
  2656. __IO uint32_t tmpreg; \
  2657. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOJEN);\
  2658. /* Delay after an RCC peripheral clock enabling */ \
  2659. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOJEN);\
  2660. UNUSED(tmpreg); \
  2661. } while(0)
  2662. #define __HAL_RCC_C1_GPIOK_CLK_ENABLE() do { \
  2663. __IO uint32_t tmpreg; \
  2664. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOKEN);\
  2665. /* Delay after an RCC peripheral clock enabling */ \
  2666. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOKEN);\
  2667. UNUSED(tmpreg); \
  2668. } while(0)
  2669. #define __HAL_RCC_C1_CRC_CLK_ENABLE() do { \
  2670. __IO uint32_t tmpreg; \
  2671. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_CRCEN);\
  2672. /* Delay after an RCC peripheral clock enabling */ \
  2673. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_CRCEN);\
  2674. UNUSED(tmpreg); \
  2675. } while(0)
  2676. #define __HAL_RCC_C1_BDMA_CLK_ENABLE() do { \
  2677. __IO uint32_t tmpreg; \
  2678. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_BDMAEN);\
  2679. /* Delay after an RCC peripheral clock enabling */ \
  2680. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_BDMAEN);\
  2681. UNUSED(tmpreg); \
  2682. } while(0)
  2683. #define __HAL_RCC_C1_ADC3_CLK_ENABLE() do { \
  2684. __IO uint32_t tmpreg; \
  2685. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_ADC3EN);\
  2686. /* Delay after an RCC peripheral clock enabling */ \
  2687. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_ADC3EN);\
  2688. UNUSED(tmpreg); \
  2689. } while(0)
  2690. #define __HAL_RCC_C1_HSEM_CLK_ENABLE() do { \
  2691. __IO uint32_t tmpreg; \
  2692. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_HSEMEN);\
  2693. /* Delay after an RCC peripheral clock enabling */ \
  2694. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_HSEMEN);\
  2695. UNUSED(tmpreg); \
  2696. } while(0)
  2697. #define __HAL_RCC_C1_BKPRAM_CLK_ENABLE() do { \
  2698. __IO uint32_t tmpreg; \
  2699. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_BKPRAMEN);\
  2700. /* Delay after an RCC peripheral clock enabling */ \
  2701. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_BKPRAMEN);\
  2702. UNUSED(tmpreg); \
  2703. } while(0)
  2704. #define __HAL_RCC_C1_GPIOA_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOAEN)
  2705. #define __HAL_RCC_C1_GPIOB_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOBEN)
  2706. #define __HAL_RCC_C1_GPIOC_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOCEN)
  2707. #define __HAL_RCC_C1_GPIOD_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIODEN)
  2708. #define __HAL_RCC_C1_GPIOE_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOEEN)
  2709. #define __HAL_RCC_C1_GPIOF_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOFEN)
  2710. #define __HAL_RCC_C1_GPIOG_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOGEN)
  2711. #define __HAL_RCC_C1_GPIOH_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOHEN)
  2712. #define __HAL_RCC_C1_GPIOI_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOIEN)
  2713. #define __HAL_RCC_C1_GPIOJ_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOJEN)
  2714. #define __HAL_RCC_C1_GPIOK_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOKEN)
  2715. #define __HAL_RCC_C1_CRC_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_CRCEN)
  2716. #define __HAL_RCC_C1_BDMA_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_BDMAEN)
  2717. #define __HAL_RCC_C1_ADC3_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_ADC3EN)
  2718. #define __HAL_RCC_C1_HSEM_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_HSEMEN)
  2719. #define __HAL_RCC_C1_BKPRAM_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_BKPRAMEN)
  2720. /** @brief Enable or disable the APB3 peripheral clock.
  2721. * @note After reset, the peripheral clock (used for registers read/write access)
  2722. * is disabled and the application software has to enable this clock before
  2723. * using it.
  2724. */
  2725. #define __HAL_RCC_C1_LTDC_CLK_ENABLE() do { \
  2726. __IO uint32_t tmpreg; \
  2727. SET_BIT(RCC_C1->APB3ENR, RCC_APB3ENR_LTDCEN);\
  2728. /* Delay after an RCC peripheral clock enabling */ \
  2729. tmpreg = READ_BIT(RCC_C1->APB3ENR, RCC_APB3ENR_LTDCEN);\
  2730. UNUSED(tmpreg); \
  2731. } while(0)
  2732. #define __HAL_RCC_C1_DSI_CLK_ENABLE() do { \
  2733. __IO uint32_t tmpreg; \
  2734. SET_BIT(RCC_C1->APB3ENR, RCC_APB3ENR_DSIEN);\
  2735. /* Delay after an RCC peripheral clock enabling */ \
  2736. tmpreg = READ_BIT(RCC_C1->APB3ENR, RCC_APB3ENR_DSIEN);\
  2737. UNUSED(tmpreg); \
  2738. } while(0)
  2739. #define __HAL_RCC_C1_WWDG1_CLK_ENABLE() do { \
  2740. __IO uint32_t tmpreg; \
  2741. SET_BIT(RCC_C1->APB3ENR, RCC_APB3ENR_WWDG1EN);\
  2742. /* Delay after an RCC peripheral clock enabling */ \
  2743. tmpreg = READ_BIT(RCC_C1->APB3ENR, RCC_APB3ENR_WWDG1EN);\
  2744. UNUSED(tmpreg); \
  2745. } while(0)
  2746. #define __HAL_RCC_C1_LTDC_CLK_DISABLE() (RCC_C1->APB3ENR) &= ~ (RCC_APB3ENR_LTDCEN)
  2747. #define __HAL_RCC_C1_DSI_CLK_DISABLE() (RCC_C1->APB3ENR) &= ~ (RCC_APB3ENR_DSIEN)
  2748. #define __HAL_RCC_C1_WWDG1_CLK_DISABLE() (RCC_C1->APB3ENR) &= ~ (RCC_APB3ENR_WWDG1EN)
  2749. /** @brief Enable or disable the APB1 peripheral clock.
  2750. * @note After reset, the peripheral clock (used for registers read/write access)
  2751. * is disabled and the application software has to enable this clock before
  2752. * using it.
  2753. */
  2754. #define __HAL_RCC_C1_TIM2_CLK_ENABLE() do { \
  2755. __IO uint32_t tmpreg; \
  2756. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM2EN);\
  2757. /* Delay after an RCC peripheral clock enabling */ \
  2758. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM2EN);\
  2759. UNUSED(tmpreg); \
  2760. } while(0)
  2761. #define __HAL_RCC_C1_TIM3_CLK_ENABLE() do { \
  2762. __IO uint32_t tmpreg; \
  2763. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM3EN);\
  2764. /* Delay after an RCC peripheral clock enabling */ \
  2765. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM3EN);\
  2766. UNUSED(tmpreg); \
  2767. } while(0)
  2768. #define __HAL_RCC_C1_TIM4_CLK_ENABLE() do { \
  2769. __IO uint32_t tmpreg; \
  2770. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM4EN);\
  2771. /* Delay after an RCC peripheral clock enabling */ \
  2772. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM4EN);\
  2773. UNUSED(tmpreg); \
  2774. } while(0)
  2775. #define __HAL_RCC_C1_TIM5_CLK_ENABLE() do { \
  2776. __IO uint32_t tmpreg; \
  2777. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM5EN);\
  2778. /* Delay after an RCC peripheral clock enabling */ \
  2779. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM5EN);\
  2780. UNUSED(tmpreg); \
  2781. } while(0)
  2782. #define __HAL_RCC_C1_TIM6_CLK_ENABLE() do { \
  2783. __IO uint32_t tmpreg; \
  2784. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM6EN);\
  2785. /* Delay after an RCC peripheral clock enabling */ \
  2786. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM6EN);\
  2787. UNUSED(tmpreg); \
  2788. } while(0)
  2789. #define __HAL_RCC_C1_TIM7_CLK_ENABLE() do { \
  2790. __IO uint32_t tmpreg; \
  2791. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM7EN);\
  2792. /* Delay after an RCC peripheral clock enabling */ \
  2793. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM7EN);\
  2794. UNUSED(tmpreg); \
  2795. } while(0)
  2796. #define __HAL_RCC_C1_TIM12_CLK_ENABLE() do { \
  2797. __IO uint32_t tmpreg; \
  2798. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM12EN);\
  2799. /* Delay after an RCC peripheral clock enabling */ \
  2800. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM12EN);\
  2801. UNUSED(tmpreg); \
  2802. } while(0)
  2803. #define __HAL_RCC_C1_TIM13_CLK_ENABLE() do { \
  2804. __IO uint32_t tmpreg; \
  2805. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM13EN);\
  2806. /* Delay after an RCC peripheral clock enabling */ \
  2807. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM13EN);\
  2808. UNUSED(tmpreg); \
  2809. } while(0)
  2810. #define __HAL_RCC_C1_TIM14_CLK_ENABLE() do { \
  2811. __IO uint32_t tmpreg; \
  2812. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM14EN);\
  2813. /* Delay after an RCC peripheral clock enabling */ \
  2814. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM14EN);\
  2815. UNUSED(tmpreg); \
  2816. } while(0)
  2817. #define __HAL_RCC_C1_LPTIM1_CLK_ENABLE() do { \
  2818. __IO uint32_t tmpreg; \
  2819. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_LPTIM1EN);\
  2820. /* Delay after an RCC peripheral clock enabling */ \
  2821. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_LPTIM1EN);\
  2822. UNUSED(tmpreg); \
  2823. } while(0)
  2824. #define __HAL_RCC_C1_WWDG2_CLK_ENABLE() do { \
  2825. __IO uint32_t tmpreg; \
  2826. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_WWDG2EN);\
  2827. /* Delay after an RCC peripheral clock enabling */ \
  2828. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_WWDG2EN);\
  2829. UNUSED(tmpreg); \
  2830. } while(0)
  2831. #define __HAL_RCC_C1_SPI2_CLK_ENABLE() do { \
  2832. __IO uint32_t tmpreg; \
  2833. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_SPI2EN);\
  2834. /* Delay after an RCC peripheral clock enabling */ \
  2835. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_SPI2EN);\
  2836. UNUSED(tmpreg); \
  2837. } while(0)
  2838. #define __HAL_RCC_C1_SPI3_CLK_ENABLE() do { \
  2839. __IO uint32_t tmpreg; \
  2840. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_SPI3EN);\
  2841. /* Delay after an RCC peripheral clock enabling */ \
  2842. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_SPI3EN);\
  2843. UNUSED(tmpreg); \
  2844. } while(0)
  2845. #define __HAL_RCC_C1_SPDIFRX_CLK_ENABLE() do { \
  2846. __IO uint32_t tmpreg; \
  2847. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_SPDIFRXEN);\
  2848. /* Delay after an RCC peripheral clock enabling */ \
  2849. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_SPDIFRXEN);\
  2850. UNUSED(tmpreg); \
  2851. } while(0)
  2852. #define __HAL_RCC_C1_USART2_CLK_ENABLE() do { \
  2853. __IO uint32_t tmpreg; \
  2854. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_USART2EN);\
  2855. /* Delay after an RCC peripheral clock enabling */ \
  2856. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_USART2EN);\
  2857. UNUSED(tmpreg); \
  2858. } while(0)
  2859. #define __HAL_RCC_C1_USART3_CLK_ENABLE() do { \
  2860. __IO uint32_t tmpreg; \
  2861. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_USART3EN);\
  2862. /* Delay after an RCC peripheral clock enabling */ \
  2863. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_USART3EN);\
  2864. UNUSED(tmpreg); \
  2865. } while(0)
  2866. #define __HAL_RCC_C1_UART4_CLK_ENABLE() do { \
  2867. __IO uint32_t tmpreg; \
  2868. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_UART4EN);\
  2869. /* Delay after an RCC peripheral clock enabling */ \
  2870. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_UART4EN);\
  2871. UNUSED(tmpreg); \
  2872. } while(0)
  2873. #define __HAL_RCC_C1_UART5_CLK_ENABLE() do { \
  2874. __IO uint32_t tmpreg; \
  2875. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_UART5EN);\
  2876. /* Delay after an RCC peripheral clock enabling */ \
  2877. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_UART5EN);\
  2878. UNUSED(tmpreg); \
  2879. } while(0)
  2880. #define __HAL_RCC_C1_I2C1_CLK_ENABLE() do { \
  2881. __IO uint32_t tmpreg; \
  2882. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_I2C1EN);\
  2883. /* Delay after an RCC peripheral clock enabling */ \
  2884. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_I2C1EN);\
  2885. UNUSED(tmpreg); \
  2886. } while(0)
  2887. #define __HAL_RCC_C1_I2C2_CLK_ENABLE() do { \
  2888. __IO uint32_t tmpreg; \
  2889. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_I2C2EN);\
  2890. /* Delay after an RCC peripheral clock enabling */ \
  2891. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_I2C2EN);\
  2892. UNUSED(tmpreg); \
  2893. } while(0)
  2894. #define __HAL_RCC_C1_I2C3_CLK_ENABLE() do { \
  2895. __IO uint32_t tmpreg; \
  2896. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_I2C3EN);\
  2897. /* Delay after an RCC peripheral clock enabling */ \
  2898. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_I2C3EN);\
  2899. UNUSED(tmpreg); \
  2900. } while(0)
  2901. #define __HAL_RCC_C1_CEC_CLK_ENABLE() do { \
  2902. __IO uint32_t tmpreg; \
  2903. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_CECEN);\
  2904. /* Delay after an RCC peripheral clock enabling */ \
  2905. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_CECEN);\
  2906. UNUSED(tmpreg); \
  2907. } while(0)
  2908. #define __HAL_RCC_C1_DAC12_CLK_ENABLE() do { \
  2909. __IO uint32_t tmpreg; \
  2910. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_DAC12EN);\
  2911. /* Delay after an RCC peripheral clock enabling */ \
  2912. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_DAC12EN);\
  2913. UNUSED(tmpreg); \
  2914. } while(0)
  2915. #define __HAL_RCC_C1_UART7_CLK_ENABLE() do { \
  2916. __IO uint32_t tmpreg; \
  2917. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_UART7EN);\
  2918. /* Delay after an RCC peripheral clock enabling */ \
  2919. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_UART7EN);\
  2920. UNUSED(tmpreg); \
  2921. } while(0)
  2922. #define __HAL_RCC_C1_UART8_CLK_ENABLE() do { \
  2923. __IO uint32_t tmpreg; \
  2924. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_UART8EN);\
  2925. /* Delay after an RCC peripheral clock enabling */ \
  2926. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_UART8EN);\
  2927. UNUSED(tmpreg); \
  2928. } while(0)
  2929. #define __HAL_RCC_C1_CRS_CLK_ENABLE() do { \
  2930. __IO uint32_t tmpreg; \
  2931. SET_BIT(RCC_C1->APB1HENR, RCC_APB1HENR_CRSEN);\
  2932. /* Delay after an RCC peripheral clock enabling */ \
  2933. tmpreg = READ_BIT(RCC_C1->APB1HENR, RCC_APB1HENR_CRSEN);\
  2934. UNUSED(tmpreg); \
  2935. } while(0)
  2936. #define __HAL_RCC_C1_SWPMI_CLK_ENABLE() do { \
  2937. __IO uint32_t tmpreg; \
  2938. SET_BIT(RCC_C1->APB1HENR, RCC_APB1HENR_SWPMIEN);\
  2939. /* Delay after an RCC peripheral clock enabling */ \
  2940. tmpreg = READ_BIT(RCC_C1->APB1HENR, RCC_APB1HENR_SWPMIEN);\
  2941. UNUSED(tmpreg); \
  2942. } while(0)
  2943. #define __HAL_RCC_C1_OPAMP_CLK_ENABLE() do { \
  2944. __IO uint32_t tmpreg; \
  2945. SET_BIT(RCC_C1->APB1HENR, RCC_APB1HENR_OPAMPEN);\
  2946. /* Delay after an RCC peripheral clock enabling */ \
  2947. tmpreg = READ_BIT(RCC_C1->APB1HENR, RCC_APB1HENR_OPAMPEN);\
  2948. UNUSED(tmpreg); \
  2949. } while(0)
  2950. #define __HAL_RCC_C1_MDIOS_CLK_ENABLE() do { \
  2951. __IO uint32_t tmpreg; \
  2952. SET_BIT(RCC_C1->APB1HENR, RCC_APB1HENR_MDIOSEN);\
  2953. /* Delay after an RCC peripheral clock enabling */ \
  2954. tmpreg = READ_BIT(RCC_C1->APB1HENR, RCC_APB1HENR_MDIOSEN);\
  2955. UNUSED(tmpreg); \
  2956. } while(0)
  2957. #define __HAL_RCC_C1_FDCAN_CLK_ENABLE() do { \
  2958. __IO uint32_t tmpreg; \
  2959. SET_BIT(RCC_C1->APB1HENR, RCC_APB1HENR_FDCANEN);\
  2960. /* Delay after an RCC peripheral clock enabling */ \
  2961. tmpreg = READ_BIT(RCC_C1->APB1HENR, RCC_APB1HENR_FDCANEN);\
  2962. UNUSED(tmpreg); \
  2963. } while(0)
  2964. #define __HAL_RCC_C1_TIM2_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_TIM2EN)
  2965. #define __HAL_RCC_C1_TIM3_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_TIM3EN)
  2966. #define __HAL_RCC_C1_TIM4_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_TIM4EN)
  2967. #define __HAL_RCC_C1_TIM5_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_TIM5EN)
  2968. #define __HAL_RCC_C1_TIM6_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_TIM6EN)
  2969. #define __HAL_RCC_C1_TIM7_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_TIM7EN)
  2970. #define __HAL_RCC_C1_TIM12_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_TIM12EN)
  2971. #define __HAL_RCC_C1_TIM13_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_TIM13EN)
  2972. #define __HAL_RCC_C1_TIM14_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_TIM14EN)
  2973. #define __HAL_RCC_C1_LPTIM1_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_LPTIM1EN)
  2974. #define __HAL_RCC_C1_WWDG2_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_WWDG2EN)
  2975. #define __HAL_RCC_C1_SPI2_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_SPI2EN)
  2976. #define __HAL_RCC_C1_SPI3_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_SPI3EN)
  2977. #define __HAL_RCC_C1_SPDIFRX_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_SPDIFRXEN)
  2978. #define __HAL_RCC_C1_USART2_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_USART2EN)
  2979. #define __HAL_RCC_C1_USART3_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_USART3EN)
  2980. #define __HAL_RCC_C1_UART4_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_UART4EN)
  2981. #define __HAL_RCC_C1_UART5_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_UART5EN)
  2982. #define __HAL_RCC_C1_I2C1_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_I2C1EN)
  2983. #define __HAL_RCC_C1_I2C2_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_I2C2EN)
  2984. #define __HAL_RCC_C1_I2C3_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_I2C3EN)
  2985. #define __HAL_RCC_C1_CEC_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_CECEN)
  2986. #define __HAL_RCC_C1_DAC12_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_DAC12EN)
  2987. #define __HAL_RCC_C1_UART7_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_UART7EN)
  2988. #define __HAL_RCC_C1_UART8_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_UART8EN)
  2989. #define __HAL_RCC_C1_CRS_CLK_DISABLE() (RCC_C1->APB1HENR) &= ~ (RCC_APB1HENR_CRSEN)
  2990. #define __HAL_RCC_C1_SWPMI_CLK_DISABLE() (RCC_C1->APB1HENR) &= ~ (RCC_APB1HENR_SWPMIEN)
  2991. #define __HAL_RCC_C1_OPAMP_CLK_DISABLE() (RCC_C1->APB1HENR) &= ~ (RCC_APB1HENR_OPAMPEN)
  2992. #define __HAL_RCC_C1_MDIOS_CLK_DISABLE() (RCC_C1->APB1HENR) &= ~ (RCC_APB1HENR_MDIOSEN)
  2993. #define __HAL_RCC_C1_FDCAN_CLK_DISABLE() (RCC_C1->APB1HENR) &= ~ (RCC_APB1HENR_FDCANEN)
  2994. /** @brief Enable or disable the APB2 peripheral clock.
  2995. * @note After reset, the peripheral clock (used for registers read/write access)
  2996. * is disabled and the application software has to enable this clock before
  2997. * using it.
  2998. */
  2999. #define __HAL_RCC_C1_TIM1_CLK_ENABLE() do { \
  3000. __IO uint32_t tmpreg; \
  3001. SET_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_TIM1EN);\
  3002. /* Delay after an RCC peripheral clock enabling */ \
  3003. tmpreg = READ_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_TIM1EN);\
  3004. UNUSED(tmpreg); \
  3005. } while(0)
  3006. #define __HAL_RCC_C1_TIM8_CLK_ENABLE() do { \
  3007. __IO uint32_t tmpreg; \
  3008. SET_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_TIM8EN);\
  3009. /* Delay after an RCC peripheral clock enabling */ \
  3010. tmpreg = READ_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_TIM8EN);\
  3011. UNUSED(tmpreg); \
  3012. } while(0)
  3013. #define __HAL_RCC_C1_USART1_CLK_ENABLE() do { \
  3014. __IO uint32_t tmpreg; \
  3015. SET_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_USART1EN);\
  3016. /* Delay after an RCC peripheral clock enabling */ \
  3017. tmpreg = READ_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_USART1EN);\
  3018. UNUSED(tmpreg); \
  3019. } while(0)
  3020. #define __HAL_RCC_C1_USART6_CLK_ENABLE() do { \
  3021. __IO uint32_t tmpreg; \
  3022. SET_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_USART6EN);\
  3023. /* Delay after an RCC peripheral clock enabling */ \
  3024. tmpreg = READ_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_USART6EN);\
  3025. UNUSED(tmpreg); \
  3026. } while(0)
  3027. #define __HAL_RCC_C1_SPI1_CLK_ENABLE() do { \
  3028. __IO uint32_t tmpreg; \
  3029. SET_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_SPI1EN);\
  3030. /* Delay after an RCC peripheral clock enabling */ \
  3031. tmpreg = READ_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_SPI1EN);\
  3032. UNUSED(tmpreg); \
  3033. } while(0)
  3034. #define __HAL_RCC_C1_SPI4_CLK_ENABLE() do { \
  3035. __IO uint32_t tmpreg; \
  3036. SET_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_SPI4EN);\
  3037. /* Delay after an RCC peripheral clock enabling */ \
  3038. tmpreg = READ_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_SPI4EN);\
  3039. UNUSED(tmpreg); \
  3040. } while(0)
  3041. #define __HAL_RCC_C1_TIM15_CLK_ENABLE() do { \
  3042. __IO uint32_t tmpreg; \
  3043. SET_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_TIM15EN);\
  3044. /* Delay after an RCC peripheral clock enabling */ \
  3045. tmpreg = READ_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_TIM15EN);\
  3046. UNUSED(tmpreg); \
  3047. } while(0)
  3048. #define __HAL_RCC_C1_TIM16_CLK_ENABLE() do { \
  3049. __IO uint32_t tmpreg; \
  3050. SET_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_TIM16EN);\
  3051. /* Delay after an RCC peripheral clock enabling */ \
  3052. tmpreg = READ_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_TIM16EN);\
  3053. UNUSED(tmpreg); \
  3054. } while(0)
  3055. #define __HAL_RCC_C1_TIM17_CLK_ENABLE() do { \
  3056. __IO uint32_t tmpreg; \
  3057. SET_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_TIM17EN);\
  3058. /* Delay after an RCC peripheral clock enabling */ \
  3059. tmpreg = READ_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_TIM17EN);\
  3060. UNUSED(tmpreg); \
  3061. } while(0)
  3062. #define __HAL_RCC_C1_SPI5_CLK_ENABLE() do { \
  3063. __IO uint32_t tmpreg; \
  3064. SET_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_SPI5EN);\
  3065. /* Delay after an RCC peripheral clock enabling */ \
  3066. tmpreg = READ_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_SPI5EN);\
  3067. UNUSED(tmpreg); \
  3068. } while(0)
  3069. #define __HAL_RCC_C1_SAI1_CLK_ENABLE() do { \
  3070. __IO uint32_t tmpreg; \
  3071. SET_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_SAI1EN);\
  3072. /* Delay after an RCC peripheral clock enabling */ \
  3073. tmpreg = READ_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_SAI1EN);\
  3074. UNUSED(tmpreg); \
  3075. } while(0)
  3076. #define __HAL_RCC_C1_SAI2_CLK_ENABLE() do { \
  3077. __IO uint32_t tmpreg; \
  3078. SET_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_SAI2EN);\
  3079. /* Delay after an RCC peripheral clock enabling */ \
  3080. tmpreg = READ_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_SAI2EN);\
  3081. UNUSED(tmpreg); \
  3082. } while(0)
  3083. #define __HAL_RCC_C1_SAI3_CLK_ENABLE() do { \
  3084. __IO uint32_t tmpreg; \
  3085. SET_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_SAI3EN);\
  3086. /* Delay after an RCC peripheral clock enabling */ \
  3087. tmpreg = READ_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_SAI3EN);\
  3088. UNUSED(tmpreg); \
  3089. } while(0)
  3090. #define __HAL_RCC_C1_DFSDM1_CLK_ENABLE() do { \
  3091. __IO uint32_t tmpreg; \
  3092. SET_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_DFSDM1EN);\
  3093. /* Delay after an RCC peripheral clock enabling */ \
  3094. tmpreg = READ_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_DFSDM1EN);\
  3095. UNUSED(tmpreg); \
  3096. } while(0)
  3097. #define __HAL_RCC_C1_HRTIM1_CLK_ENABLE() do { \
  3098. __IO uint32_t tmpreg; \
  3099. SET_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_HRTIMEN);\
  3100. /* Delay after an RCC peripheral clock enabling */ \
  3101. tmpreg = READ_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_HRTIMEN);\
  3102. UNUSED(tmpreg); \
  3103. } while(0)
  3104. #define __HAL_RCC_C1_TIM1_CLK_DISABLE() (RCC_C1->APB2ENR) &= ~ (RCC_APB2ENR_TIM1EN)
  3105. #define __HAL_RCC_C1_TIM8_CLK_DISABLE() (RCC_C1->APB2ENR) &= ~ (RCC_APB2ENR_TIM8EN)
  3106. #define __HAL_RCC_C1_USART1_CLK_DISABLE() (RCC_C1->APB2ENR) &= ~ (RCC_APB2ENR_USART1EN)
  3107. #define __HAL_RCC_C1_USART6_CLK_DISABLE() (RCC_C1->APB2ENR) &= ~ (RCC_APB2ENR_USART6EN)
  3108. #define __HAL_RCC_C1_SPI1_CLK_DISABLE() (RCC_C1->APB2ENR) &= ~ (RCC_APB2ENR_SPI1EN)
  3109. #define __HAL_RCC_C1_SPI4_CLK_DISABLE() (RCC_C1->APB2ENR) &= ~ (RCC_APB2ENR_SPI4EN)
  3110. #define __HAL_RCC_C1_TIM15_CLK_DISABLE() (RCC_C1->APB2ENR) &= ~ (RCC_APB2ENR_TIM15EN)
  3111. #define __HAL_RCC_C1_TIM16_CLK_DISABLE() (RCC_C1->APB2ENR) &= ~ (RCC_APB2ENR_TIM16EN)
  3112. #define __HAL_RCC_C1_TIM17_CLK_DISABLE() (RCC_C1->APB2ENR) &= ~ (RCC_APB2ENR_TIM17EN)
  3113. #define __HAL_RCC_C1_SPI5_CLK_DISABLE() (RCC_C1->APB2ENR) &= ~ (RCC_APB2ENR_SPI5EN)
  3114. #define __HAL_RCC_C1_SAI1_CLK_DISABLE() (RCC_C1->APB2ENR) &= ~ (RCC_APB2ENR_SAI1EN)
  3115. #define __HAL_RCC_C1_SAI2_CLK_DISABLE() (RCC_C1->APB2ENR) &= ~ (RCC_APB2ENR_SAI2EN)
  3116. #define __HAL_RCC_C1_SAI3_CLK_DISABLE() (RCC_C1->APB2ENR) &= ~ (RCC_APB2ENR_SAI3EN)
  3117. #define __HAL_RCC_C1_DFSDM1_CLK_DISABLE() (RCC_C1->APB2ENR) &= ~ (RCC_APB2ENR_DFSDM1EN)
  3118. #define __HAL_RCC_C1_HRTIM1_CLK_DISABLE() (RCC_C1->APB2ENR) &= ~ (RCC_APB2ENR_HRTIMEN)
  3119. /** @brief Enable or disable the APB4 peripheral clock.
  3120. * @note After reset, the peripheral clock (used for registers read/write access)
  3121. * is disabled and the application software has to enable this clock before
  3122. * using it.
  3123. */
  3124. #define __HAL_RCC_C1_SYSCFG_CLK_ENABLE() do { \
  3125. __IO uint32_t tmpreg; \
  3126. SET_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_SYSCFGEN);\
  3127. /* Delay after an RCC peripheral clock enabling */ \
  3128. tmpreg = READ_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_SYSCFGEN);\
  3129. UNUSED(tmpreg); \
  3130. } while(0)
  3131. #define __HAL_RCC_C1_LPUART1_CLK_ENABLE() do { \
  3132. __IO uint32_t tmpreg; \
  3133. SET_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_LPUART1EN);\
  3134. /* Delay after an RCC peripheral clock enabling */ \
  3135. tmpreg = READ_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_LPUART1EN);\
  3136. UNUSED(tmpreg); \
  3137. } while(0)
  3138. #define __HAL_RCC_C1_SPI6_CLK_ENABLE() do { \
  3139. __IO uint32_t tmpreg; \
  3140. SET_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_SPI6EN);\
  3141. /* Delay after an RCC peripheral clock enabling */ \
  3142. tmpreg = READ_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_SPI6EN);\
  3143. UNUSED(tmpreg); \
  3144. } while(0)
  3145. #define __HAL_RCC_C1_I2C4_CLK_ENABLE() do { \
  3146. __IO uint32_t tmpreg; \
  3147. SET_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_I2C4EN);\
  3148. /* Delay after an RCC peripheral clock enabling */ \
  3149. tmpreg = READ_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_I2C4EN);\
  3150. UNUSED(tmpreg); \
  3151. } while(0)
  3152. #define __HAL_RCC_C1_LPTIM2_CLK_ENABLE() do { \
  3153. __IO uint32_t tmpreg; \
  3154. SET_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_LPTIM2EN);\
  3155. /* Delay after an RCC peripheral clock enabling */ \
  3156. tmpreg = READ_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_LPTIM2EN);\
  3157. UNUSED(tmpreg); \
  3158. } while(0)
  3159. #define __HAL_RCC_C1_LPTIM3_CLK_ENABLE() do { \
  3160. __IO uint32_t tmpreg; \
  3161. SET_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_LPTIM3EN);\
  3162. /* Delay after an RCC peripheral clock enabling */ \
  3163. tmpreg = READ_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_LPTIM3EN);\
  3164. UNUSED(tmpreg); \
  3165. } while(0)
  3166. #define __HAL_RCC_C1_LPTIM4_CLK_ENABLE() do { \
  3167. __IO uint32_t tmpreg; \
  3168. SET_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_LPTIM4EN);\
  3169. /* Delay after an RCC peripheral clock enabling */ \
  3170. tmpreg = READ_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_LPTIM4EN);\
  3171. UNUSED(tmpreg); \
  3172. } while(0)
  3173. #define __HAL_RCC_C1_LPTIM5_CLK_ENABLE() do { \
  3174. __IO uint32_t tmpreg; \
  3175. SET_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_LPTIM5EN);\
  3176. /* Delay after an RCC peripheral clock enabling */ \
  3177. tmpreg = READ_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_LPTIM5EN);\
  3178. UNUSED(tmpreg); \
  3179. } while(0)
  3180. #define __HAL_RCC_C1_COMP12_CLK_ENABLE() do { \
  3181. __IO uint32_t tmpreg; \
  3182. SET_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_COMP12EN);\
  3183. /* Delay after an RCC peripheral clock enabling */ \
  3184. tmpreg = READ_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_COMP12EN);\
  3185. UNUSED(tmpreg); \
  3186. } while(0)
  3187. #define __HAL_RCC_C1_VREF_CLK_ENABLE() do { \
  3188. __IO uint32_t tmpreg; \
  3189. SET_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_VREFEN);\
  3190. /* Delay after an RCC peripheral clock enabling */ \
  3191. tmpreg = READ_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_VREFEN);\
  3192. UNUSED(tmpreg); \
  3193. } while(0)
  3194. #define __HAL_RCC_C1_RTC_CLK_ENABLE() do { \
  3195. __IO uint32_t tmpreg; \
  3196. SET_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_RTCAPBEN);\
  3197. /* Delay after an RCC peripheral clock enabling */ \
  3198. tmpreg = READ_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_RTCAPBEN);\
  3199. UNUSED(tmpreg); \
  3200. } while(0)
  3201. #define __HAL_RCC_C1_SAI4_CLK_ENABLE() do { \
  3202. __IO uint32_t tmpreg; \
  3203. SET_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_SAI4EN);\
  3204. /* Delay after an RCC peripheral clock enabling */ \
  3205. tmpreg = READ_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_SAI4EN);\
  3206. UNUSED(tmpreg); \
  3207. } while(0)
  3208. #define __HAL_RCC_C1_SYSCFG_CLK_DISABLE() (RCC_C1->APB4ENR) &= ~ (RCC_APB4ENR_SYSCFGEN)
  3209. #define __HAL_RCC_C1_LPUART1_CLK_DISABLE() (RCC_C1->APB4ENR) &= ~ (RCC_APB4ENR_LPUART1EN)
  3210. #define __HAL_RCC_C1_SPI6_CLK_DISABLE() (RCC_C1->APB4ENR) &= ~ (RCC_APB4ENR_SPI6EN)
  3211. #define __HAL_RCC_C1_I2C4_CLK_DISABLE() (RCC_C1->APB4ENR) &= ~ (RCC_APB4ENR_I2C4EN)
  3212. #define __HAL_RCC_C1_LPTIM2_CLK_DISABLE() (RCC_C1->APB4ENR) &= ~ (RCC_APB4ENR_LPTIM2EN)
  3213. #define __HAL_RCC_C1_LPTIM3_CLK_DISABLE() (RCC_C1->APB4ENR) &= ~ (RCC_APB4ENR_LPTIM3EN)
  3214. #define __HAL_RCC_C1_LPTIM4_CLK_DISABLE() (RCC_C1->APB4ENR) &= ~ (RCC_APB4ENR_LPTIM4EN)
  3215. #define __HAL_RCC_C1_LPTIM5_CLK_DISABLE() (RCC_C1->APB4ENR) &= ~ (RCC_APB4ENR_LPTIM5EN)
  3216. #define __HAL_RCC_C1_COMP12_CLK_DISABLE() (RCC_C1->APB4ENR) &= ~ (RCC_APB4ENR_COMP12EN)
  3217. #define __HAL_RCC_C1_VREF_CLK_DISABLE() (RCC_C1->APB4ENR) &= ~ (RCC_APB4ENR_VREFEN)
  3218. #define __HAL_RCC_C1_RTC_CLK_DISABLE() (RCC_C1->APB4ENR) &= ~ (RCC_APB4ENR_RTCAPBEN)
  3219. #define __HAL_RCC_C1_SAI4_CLK_DISABLE() (RCC_C1->APB4ENR) &= ~ (RCC_APB4ENR_SAI4EN)
  3220. /* Exported macros for RCC_C2 -------------------------------------------------*/
  3221. /** @brief Enable or disable the AHB3 peripheral clock.
  3222. * @note After reset, the peripheral clock (used for registers read/write access)
  3223. * is disabled and the application software has to enable this clock before
  3224. * using it.
  3225. */
  3226. #define __HAL_RCC_C2_MDMA_CLK_ENABLE() do { \
  3227. __IO uint32_t tmpreg; \
  3228. SET_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_MDMAEN);\
  3229. /* Delay after an RCC peripheral clock enabling */ \
  3230. tmpreg = READ_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_MDMAEN);\
  3231. UNUSED(tmpreg); \
  3232. } while(0)
  3233. #define __HAL_RCC_C2_DMA2D_CLK_ENABLE() do { \
  3234. __IO uint32_t tmpreg; \
  3235. SET_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_DMA2DEN);\
  3236. /* Delay after an RCC peripheral clock enabling */ \
  3237. tmpreg = READ_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_DMA2DEN);\
  3238. UNUSED(tmpreg); \
  3239. } while(0)
  3240. #define __HAL_RCC_C2_JPGDECEN_CLK_ENABLE() do { \
  3241. __IO uint32_t tmpreg; \
  3242. SET_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_JPGDECEN);\
  3243. /* Delay after an RCC peripheral clock enabling */ \
  3244. tmpreg = READ_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_JPGDECEN);\
  3245. UNUSED(tmpreg); \
  3246. } while(0)
  3247. #define __HAL_RCC_FLASH_C2_ALLOCATE() do { \
  3248. __IO uint32_t tmpreg; \
  3249. SET_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_FLASHEN);\
  3250. /* Delay after an RCC peripheral clock enabling */ \
  3251. tmpreg = READ_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_FLASHEN);\
  3252. UNUSED(tmpreg); \
  3253. } while(0)
  3254. #define __HAL_RCC_DTCM1_C2_ALLOCATE() do { \
  3255. __IO uint32_t tmpreg; \
  3256. SET_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_DTCM1EN);\
  3257. /* Delay after an RCC peripheral clock enabling */ \
  3258. tmpreg = READ_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_DTCM1EN);\
  3259. UNUSED(tmpreg); \
  3260. } while(0)
  3261. #define __HAL_RCC_DTCM2_C2_ALLOCATE() do { \
  3262. __IO uint32_t tmpreg; \
  3263. SET_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_DTCM2EN);\
  3264. /* Delay after an RCC peripheral clock enabling */ \
  3265. tmpreg = READ_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_DTCM2EN);\
  3266. UNUSED(tmpreg); \
  3267. } while(0)
  3268. #define __HAL_RCC_ITCM_C2_ALLOCATE() do { \
  3269. __IO uint32_t tmpreg; \
  3270. SET_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_ITCMEN);\
  3271. /* Delay after an RCC peripheral clock enabling */ \
  3272. tmpreg = READ_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_ITCMEN);\
  3273. UNUSED(tmpreg); \
  3274. } while(0)
  3275. #define __HAL_RCC_D1SRAM1_C2_ALLOCATE() do { \
  3276. __IO uint32_t tmpreg; \
  3277. SET_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_AXISRAMEN);\
  3278. /* Delay after an RCC peripheral clock enabling */ \
  3279. tmpreg = READ_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_AXISRAMEN);\
  3280. UNUSED(tmpreg); \
  3281. } while(0)
  3282. #define __HAL_RCC_C2_FMC_CLK_ENABLE() do { \
  3283. __IO uint32_t tmpreg; \
  3284. SET_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_FMCEN);\
  3285. /* Delay after an RCC peripheral clock enabling */ \
  3286. tmpreg = READ_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_FMCEN);\
  3287. UNUSED(tmpreg); \
  3288. } while(0)
  3289. #define __HAL_RCC_C2_QSPI_CLK_ENABLE() do { \
  3290. __IO uint32_t tmpreg; \
  3291. SET_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_QSPIEN);\
  3292. /* Delay after an RCC peripheral clock enabling */ \
  3293. tmpreg = READ_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_QSPIEN);\
  3294. UNUSED(tmpreg); \
  3295. } while(0)
  3296. #define __HAL_RCC_C2_SDMMC1_CLK_ENABLE() do { \
  3297. __IO uint32_t tmpreg; \
  3298. SET_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_SDMMC1EN);\
  3299. /* Delay after an RCC peripheral clock enabling */ \
  3300. tmpreg = READ_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_SDMMC1EN);\
  3301. UNUSED(tmpreg); \
  3302. } while(0)
  3303. #define __HAL_RCC_C2_MDMA_CLK_DISABLE() (RCC_C2->AHB3ENR &= ~ (RCC_AHB3ENR_MDMAEN))
  3304. #define __HAL_RCC_C2_DMA2D_CLK_DISABLE() (RCC_C2->AHB3ENR &= ~ (RCC_AHB3ENR_DMA2DEN))
  3305. #define __HAL_RCC_C2_JPGDECEN_CLK_DISABLE() (RCC_C2->AHB3ENR &= ~ (RCC_AHB3ENR_JPGDECEN))
  3306. #define __HAL_RCC_C2_FMC_CLK_DISABLE() (RCC_C2->AHB3ENR &= ~ (RCC_AHB3ENR_FMCEN))
  3307. #define __HAL_RCC_C2_QSPI_CLK_DISABLE() (RCC_C2->AHB3ENR &= ~ (RCC_AHB3ENR_QSPIEN))
  3308. #define __HAL_RCC_C2_SDMMC1_CLK_DISABLE() (RCC_C2->AHB3ENR &= ~ (RCC_AHB3ENR_SDMMC1EN))
  3309. #define __HAL_RCC_FLASH_C2_DEALLOCATE() (RCC_C2->AHB3ENR &= ~ (RCC_AHB3ENR_FLASHEN))
  3310. #define __HAL_RCC_DTCM1_C2_DEALLOCATE() (RCC_C2->AHB3ENR &= ~ (RCC_AHB3ENR_DTCM1EN))
  3311. #define __HAL_RCC_DTCM2_C2_DEALLOCATE() (RCC_C2->AHB3ENR &= ~ (RCC_AHB3ENR_DTCM2EN))
  3312. #define __HAL_RCC_ITCM_C2_DEALLOCATE() (RCC_C2->AHB3ENR &= ~ (RCC_AHB3ENR_ITCMEN))
  3313. #define __HAL_RCC_D1SRAM1_C2_DEALLOCATE() (RCC_C2->AHB3ENR &= ~ (RCC_AHB3ENR_AXISRAMEN))
  3314. /** @brief Enable or disable the AHB1 peripheral clock.
  3315. * @note After reset, the peripheral clock (used for registers read/write access)
  3316. * is disabled and the application software has to enable this clock before
  3317. * using it.
  3318. */
  3319. #define __HAL_RCC_C2_DMA1_CLK_ENABLE() do { \
  3320. __IO uint32_t tmpreg; \
  3321. SET_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_DMA1EN);\
  3322. /* Delay after an RCC peripheral clock enabling */ \
  3323. tmpreg = READ_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_DMA1EN);\
  3324. UNUSED(tmpreg); \
  3325. } while(0)
  3326. #define __HAL_RCC_C2_DMA2_CLK_ENABLE() do { \
  3327. __IO uint32_t tmpreg; \
  3328. SET_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_DMA2EN);\
  3329. /* Delay after an RCC peripheral clock enabling */ \
  3330. tmpreg = READ_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_DMA2EN);\
  3331. UNUSED(tmpreg); \
  3332. } while(0)
  3333. #define __HAL_RCC_C2_ADC12_CLK_ENABLE() do { \
  3334. __IO uint32_t tmpreg; \
  3335. SET_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_ADC12EN);\
  3336. /* Delay after an RCC peripheral clock enabling */ \
  3337. tmpreg = READ_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_ADC12EN);\
  3338. UNUSED(tmpreg); \
  3339. } while(0)
  3340. #define __HAL_RCC_C2_ART_CLK_ENABLE() do { \
  3341. __IO uint32_t tmpreg; \
  3342. SET_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_ARTEN);\
  3343. /* Delay after an RCC peripheral clock enabling */ \
  3344. tmpreg = READ_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_ARTEN);\
  3345. UNUSED(tmpreg); \
  3346. } while(0)
  3347. #define __HAL_RCC_C2_ETH1MAC_CLK_ENABLE() do { \
  3348. __IO uint32_t tmpreg; \
  3349. SET_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_ETH1MACEN);\
  3350. /* Delay after an RCC peripheral clock enabling */ \
  3351. tmpreg = READ_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_ETH1MACEN);\
  3352. UNUSED(tmpreg); \
  3353. } while(0)
  3354. #define __HAL_RCC_C2_ETH1TX_CLK_ENABLE() do { \
  3355. __IO uint32_t tmpreg; \
  3356. SET_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_ETH1TXEN);\
  3357. /* Delay after an RCC peripheral clock enabling */ \
  3358. tmpreg = READ_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_ETH1TXEN);\
  3359. UNUSED(tmpreg); \
  3360. } while(0)
  3361. #define __HAL_RCC_C2_ETH1RX_CLK_ENABLE() do { \
  3362. __IO uint32_t tmpreg; \
  3363. SET_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_ETH1RXEN);\
  3364. /* Delay after an RCC peripheral clock enabling */ \
  3365. tmpreg = READ_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_ETH1RXEN);\
  3366. UNUSED(tmpreg); \
  3367. } while(0)
  3368. #define __HAL_RCC_C2_USB1_OTG_HS_CLK_ENABLE() do { \
  3369. __IO uint32_t tmpreg; \
  3370. SET_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_USB1OTGHSEN);\
  3371. /* Delay after an RCC peripheral clock enabling */ \
  3372. tmpreg = READ_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_USB1OTGHSEN);\
  3373. UNUSED(tmpreg); \
  3374. } while(0)
  3375. #define __HAL_RCC_C2_USB1_OTG_HS_ULPI_CLK_ENABLE() do { \
  3376. __IO uint32_t tmpreg; \
  3377. SET_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_USB1OTGHSULPIEN);\
  3378. /* Delay after an RCC peripheral clock enabling */ \
  3379. tmpreg = READ_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_USB1OTGHSULPIEN);\
  3380. UNUSED(tmpreg); \
  3381. } while(0)
  3382. #define __HAL_RCC_C2_USB2_OTG_FS_CLK_ENABLE() do { \
  3383. __IO uint32_t tmpreg; \
  3384. SET_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_USB2OTGHSEN);\
  3385. /* Delay after an RCC peripheral clock enabling */ \
  3386. tmpreg = READ_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_USB2OTGHSEN);\
  3387. UNUSED(tmpreg); \
  3388. } while(0)
  3389. #define __HAL_RCC_C2_USB2_OTG_FS_ULPI_CLK_ENABLE() do { \
  3390. __IO uint32_t tmpreg; \
  3391. SET_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_USB2OTGHSULPIEN);\
  3392. /* Delay after an RCC peripheral clock enabling */ \
  3393. tmpreg = READ_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_USB2OTGHSULPIEN);\
  3394. UNUSED(tmpreg); \
  3395. } while(0)
  3396. #define __HAL_RCC_C2_DMA1_CLK_DISABLE() (RCC_C2->AHB1ENR &= ~ (RCC_AHB1ENR_DMA1EN))
  3397. #define __HAL_RCC_C2_DMA2_CLK_DISABLE() (RCC_C2->AHB1ENR &= ~ (RCC_AHB1ENR_DMA2EN))
  3398. #define __HAL_RCC_C2_ADC12_CLK_DISABLE() (RCC_C2->AHB1ENR &= ~ (RCC_AHB1ENR_ADC12EN))
  3399. #define __HAL_RCC_C2_ART_CLK_DISABLE() (RCC_C2->AHB1ENR &= ~ (RCC_AHB1ENR_ARTEN))
  3400. #define __HAL_RCC_C2_ETH1MAC_CLK_DISABLE() (RCC_C2->AHB1ENR &= ~ (RCC_AHB1ENR_ETH1MACEN))
  3401. #define __HAL_RCC_C2_ETH1TX_CLK_DISABLE() (RCC_C2->AHB1ENR &= ~ (RCC_AHB1ENR_ETH1TXEN))
  3402. #define __HAL_RCC_C2_ETH1RX_CLK_DISABLE() (RCC_C2->AHB1ENR &= ~ (RCC_AHB1ENR_ETH1RXEN))
  3403. #define __HAL_RCC_C2_USB1_OTG_HS_CLK_DISABLE() (RCC_C2->AHB1ENR &= ~ (RCC_AHB1ENR_USB1OTGHSEN))
  3404. #define __HAL_RCC_C2_USB1_OTG_HS_ULPI_CLK_DISABLE() (RCC_C2->AHB1ENR &= ~ (RCC_AHB1ENR_USB1OTGHSULPIEN))
  3405. #define __HAL_RCC_C2_USB2_OTG_FS_CLK_DISABLE() (RCC_C2->AHB1ENR &= ~ (RCC_AHB1ENR_USB2OTGHSEN))
  3406. #define __HAL_RCC_C2_USB2_OTG_FS_ULPI_CLK_DISABLE() (RCC_C2->AHB1ENR &= ~ (RCC_AHB1ENR_USB2OTGHSULPIEN))
  3407. /** @brief Enable or disable the AHB2 peripheral clock.
  3408. * @note After reset, the peripheral clock (used for registers read/write access)
  3409. * is disabled and the application software has to enable this clock before
  3410. * using it.
  3411. */
  3412. #define __HAL_RCC_C2_DCMI_CLK_ENABLE() do { \
  3413. __IO uint32_t tmpreg; \
  3414. SET_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_DCMIEN);\
  3415. /* Delay after an RCC peripheral clock enabling */ \
  3416. tmpreg = READ_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_DCMIEN);\
  3417. UNUSED(tmpreg); \
  3418. } while(0)
  3419. #if defined(CRYP)
  3420. #define __HAL_RCC_C2_CRYP_CLK_ENABLE() do { \
  3421. __IO uint32_t tmpreg; \
  3422. SET_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_CRYPEN);\
  3423. /* Delay after an RCC peripheral clock enabling */ \
  3424. tmpreg = READ_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_CRYPEN);\
  3425. UNUSED(tmpreg); \
  3426. } while(0)
  3427. #endif /* CRYP */
  3428. #if defined(HASH)
  3429. #define __HAL_RCC_C2_HASH_CLK_ENABLE() do { \
  3430. __IO uint32_t tmpreg; \
  3431. SET_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_HASHEN);\
  3432. /* Delay after an RCC peripheral clock enabling */ \
  3433. tmpreg = READ_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_HASHEN);\
  3434. UNUSED(tmpreg); \
  3435. } while(0)
  3436. #endif /* HASH */
  3437. #define __HAL_RCC_C2_RNG_CLK_ENABLE() do { \
  3438. __IO uint32_t tmpreg; \
  3439. SET_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_RNGEN);\
  3440. /* Delay after an RCC peripheral clock enabling */ \
  3441. tmpreg = READ_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_RNGEN);\
  3442. UNUSED(tmpreg); \
  3443. } while(0)
  3444. #define __HAL_RCC_C2_SDMMC2_CLK_ENABLE() do { \
  3445. __IO uint32_t tmpreg; \
  3446. SET_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_SDMMC2EN);\
  3447. /* Delay after an RCC peripheral clock enabling */ \
  3448. tmpreg = READ_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_SDMMC2EN);\
  3449. UNUSED(tmpreg); \
  3450. } while(0)
  3451. #define __HAL_RCC_C2_D2SRAM1_CLK_ENABLE() do { \
  3452. __IO uint32_t tmpreg; \
  3453. SET_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_D2SRAM1EN);\
  3454. /* Delay after an RCC peripheral clock enabling */ \
  3455. tmpreg = READ_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_D2SRAM1EN);\
  3456. UNUSED(tmpreg); \
  3457. } while(0)
  3458. #define __HAL_RCC_C2_D2SRAM2_CLK_ENABLE() do { \
  3459. __IO uint32_t tmpreg; \
  3460. SET_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_D2SRAM2EN);\
  3461. /* Delay after an RCC peripheral clock enabling */ \
  3462. tmpreg = READ_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_D2SRAM2EN);\
  3463. UNUSED(tmpreg); \
  3464. } while(0)
  3465. #define __HAL_RCC_C2_D2SRAM3_CLK_ENABLE() do { \
  3466. __IO uint32_t tmpreg; \
  3467. SET_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_D2SRAM3EN);\
  3468. /* Delay after an RCC peripheral clock enabling */ \
  3469. tmpreg = READ_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_D2SRAM3EN);\
  3470. UNUSED(tmpreg); \
  3471. } while(0)
  3472. #define __HAL_RCC_C2_DCMI_CLK_DISABLE() (RCC_C2->AHB2ENR &= ~ (RCC_AHB2ENR_DCMIEN))
  3473. #if defined(CRYP)
  3474. #define __HAL_RCC_C2_CRYP_CLK_DISABLE() (RCC_C2->AHB2ENR &= ~ (RCC_AHB2ENR_CRYPEN))
  3475. #endif /* CRYP */
  3476. #if defined(HASH)
  3477. #define __HAL_RCC_C2_HASH_CLK_DISABLE() (RCC_C2->AHB2ENR &= ~ (RCC_AHB2ENR_HASHEN))
  3478. #endif /* HASH */
  3479. #define __HAL_RCC_C2_RNG_CLK_DISABLE() (RCC_C2->AHB2ENR &= ~ (RCC_AHB2ENR_RNGEN))
  3480. #define __HAL_RCC_C2_SDMMC2_CLK_DISABLE() (RCC_C2->AHB2ENR &= ~ (RCC_AHB2ENR_SDMMC2EN))
  3481. #define __HAL_RCC_C2_D2SRAM1_CLK_DISABLE() (RCC_C2->AHB2ENR &= ~ (RCC_AHB2ENR_D2SRAM1EN))
  3482. #define __HAL_RCC_C2_D2SRAM2_CLK_DISABLE() (RCC_C2->AHB2ENR &= ~ (RCC_AHB2ENR_D2SRAM2EN))
  3483. #define __HAL_RCC_C2_D2SRAM3_CLK_DISABLE() (RCC_C2->AHB2ENR &= ~ (RCC_AHB2ENR_D2SRAM3EN))
  3484. /** @brief Enable or disable the AHB4 peripheral clock.
  3485. * @note After reset, the peripheral clock (used for registers read/write access)
  3486. * is disabled and the application software has to enable this clock before
  3487. * using it.
  3488. */
  3489. #define __HAL_RCC_C2_GPIOA_CLK_ENABLE() do { \
  3490. __IO uint32_t tmpreg; \
  3491. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOAEN);\
  3492. /* Delay after an RCC peripheral clock enabling */ \
  3493. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOAEN);\
  3494. UNUSED(tmpreg); \
  3495. } while(0)
  3496. #define __HAL_RCC_C2_GPIOB_CLK_ENABLE() do { \
  3497. __IO uint32_t tmpreg; \
  3498. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOBEN);\
  3499. /* Delay after an RCC peripheral clock enabling */ \
  3500. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOBEN);\
  3501. UNUSED(tmpreg); \
  3502. } while(0)
  3503. #define __HAL_RCC_C2_GPIOC_CLK_ENABLE() do { \
  3504. __IO uint32_t tmpreg; \
  3505. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOCEN);\
  3506. /* Delay after an RCC peripheral clock enabling */ \
  3507. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOCEN);\
  3508. UNUSED(tmpreg); \
  3509. } while(0)
  3510. #define __HAL_RCC_C2_GPIOD_CLK_ENABLE() do { \
  3511. __IO uint32_t tmpreg; \
  3512. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIODEN);\
  3513. /* Delay after an RCC peripheral clock enabling */ \
  3514. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIODEN);\
  3515. UNUSED(tmpreg); \
  3516. } while(0)
  3517. #define __HAL_RCC_C2_GPIOE_CLK_ENABLE() do { \
  3518. __IO uint32_t tmpreg; \
  3519. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOEEN);\
  3520. /* Delay after an RCC peripheral clock enabling */ \
  3521. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOEEN);\
  3522. UNUSED(tmpreg); \
  3523. } while(0)
  3524. #define __HAL_RCC_C2_GPIOF_CLK_ENABLE() do { \
  3525. __IO uint32_t tmpreg; \
  3526. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOFEN);\
  3527. /* Delay after an RCC peripheral clock enabling */ \
  3528. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOFEN);\
  3529. UNUSED(tmpreg); \
  3530. } while(0)
  3531. #define __HAL_RCC_C2_GPIOG_CLK_ENABLE() do { \
  3532. __IO uint32_t tmpreg; \
  3533. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOGEN);\
  3534. /* Delay after an RCC peripheral clock enabling */ \
  3535. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOGEN);\
  3536. UNUSED(tmpreg); \
  3537. } while(0)
  3538. #define __HAL_RCC_C2_GPIOH_CLK_ENABLE() do { \
  3539. __IO uint32_t tmpreg; \
  3540. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOHEN);\
  3541. /* Delay after an RCC peripheral clock enabling */ \
  3542. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOHEN);\
  3543. UNUSED(tmpreg); \
  3544. } while(0)
  3545. #define __HAL_RCC_C2_GPIOI_CLK_ENABLE() do { \
  3546. __IO uint32_t tmpreg; \
  3547. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOIEN);\
  3548. /* Delay after an RCC peripheral clock enabling */ \
  3549. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOIEN);\
  3550. UNUSED(tmpreg); \
  3551. } while(0)
  3552. #define __HAL_RCC_C2_GPIOJ_CLK_ENABLE() do { \
  3553. __IO uint32_t tmpreg; \
  3554. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOJEN);\
  3555. /* Delay after an RCC peripheral clock enabling */ \
  3556. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOJEN);\
  3557. UNUSED(tmpreg); \
  3558. } while(0)
  3559. #define __HAL_RCC_C2_GPIOK_CLK_ENABLE() do { \
  3560. __IO uint32_t tmpreg; \
  3561. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOKEN);\
  3562. /* Delay after an RCC peripheral clock enabling */ \
  3563. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOKEN);\
  3564. UNUSED(tmpreg); \
  3565. } while(0)
  3566. #define __HAL_RCC_C2_CRC_CLK_ENABLE() do { \
  3567. __IO uint32_t tmpreg; \
  3568. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_CRCEN);\
  3569. /* Delay after an RCC peripheral clock enabling */ \
  3570. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_CRCEN);\
  3571. UNUSED(tmpreg); \
  3572. } while(0)
  3573. #define __HAL_RCC_C2_BDMA_CLK_ENABLE() do { \
  3574. __IO uint32_t tmpreg; \
  3575. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_BDMAEN);\
  3576. /* Delay after an RCC peripheral clock enabling */ \
  3577. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_BDMAEN);\
  3578. UNUSED(tmpreg); \
  3579. } while(0)
  3580. #define __HAL_RCC_C2_ADC3_CLK_ENABLE() do { \
  3581. __IO uint32_t tmpreg; \
  3582. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_ADC3EN);\
  3583. /* Delay after an RCC peripheral clock enabling */ \
  3584. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_ADC3EN);\
  3585. UNUSED(tmpreg); \
  3586. } while(0)
  3587. #define __HAL_RCC_C2_HSEM_CLK_ENABLE() do { \
  3588. __IO uint32_t tmpreg; \
  3589. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_HSEMEN);\
  3590. /* Delay after an RCC peripheral clock enabling */ \
  3591. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_HSEMEN);\
  3592. UNUSED(tmpreg); \
  3593. } while(0)
  3594. #define __HAL_RCC_C2_BKPRAM_CLK_ENABLE() do { \
  3595. __IO uint32_t tmpreg; \
  3596. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_BKPRAMEN);\
  3597. /* Delay after an RCC peripheral clock enabling */ \
  3598. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_BKPRAMEN);\
  3599. UNUSED(tmpreg); \
  3600. } while(0)
  3601. #define __HAL_RCC_C2_GPIOA_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOAEN)
  3602. #define __HAL_RCC_C2_GPIOB_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOBEN)
  3603. #define __HAL_RCC_C2_GPIOC_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOCEN)
  3604. #define __HAL_RCC_C2_GPIOD_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIODEN)
  3605. #define __HAL_RCC_C2_GPIOE_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOEEN)
  3606. #define __HAL_RCC_C2_GPIOF_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOFEN)
  3607. #define __HAL_RCC_C2_GPIOG_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOGEN)
  3608. #define __HAL_RCC_C2_GPIOH_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOHEN)
  3609. #define __HAL_RCC_C2_GPIOI_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOIEN)
  3610. #define __HAL_RCC_C2_GPIOJ_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOJEN)
  3611. #define __HAL_RCC_C2_GPIOK_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOKEN)
  3612. #define __HAL_RCC_C2_CRC_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_CRCEN)
  3613. #define __HAL_RCC_C2_BDMA_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_BDMAEN)
  3614. #define __HAL_RCC_C2_ADC3_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_ADC3EN)
  3615. #define __HAL_RCC_C2_HSEM_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_HSEMEN)
  3616. #define __HAL_RCC_C2_BKPRAM_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_BKPRAMEN)
  3617. /** @brief Enable or disable the APB3 peripheral clock.
  3618. * @note After reset, the peripheral clock (used for registers read/write access)
  3619. * is disabled and the application software has to enable this clock before
  3620. * using it.
  3621. */
  3622. #define __HAL_RCC_C2_LTDC_CLK_ENABLE() do { \
  3623. __IO uint32_t tmpreg; \
  3624. SET_BIT(RCC_C2->APB3ENR, RCC_APB3ENR_LTDCEN);\
  3625. /* Delay after an RCC peripheral clock enabling */ \
  3626. tmpreg = READ_BIT(RCC_C2->APB3ENR, RCC_APB3ENR_LTDCEN);\
  3627. UNUSED(tmpreg); \
  3628. } while(0)
  3629. #define __HAL_RCC_C2_DSI_CLK_ENABLE() do { \
  3630. __IO uint32_t tmpreg; \
  3631. SET_BIT(RCC_C2->APB3ENR, RCC_APB3ENR_DSIEN);\
  3632. /* Delay after an RCC peripheral clock enabling */ \
  3633. tmpreg = READ_BIT(RCC_C2->APB3ENR, RCC_APB3ENR_DSIEN);\
  3634. UNUSED(tmpreg); \
  3635. } while(0)
  3636. #define __HAL_RCC_C2_WWDG1_CLK_ENABLE() do { \
  3637. __IO uint32_t tmpreg; \
  3638. SET_BIT(RCC_C2->APB3ENR, RCC_APB3ENR_WWDG1EN);\
  3639. /* Delay after an RCC peripheral clock enabling */ \
  3640. tmpreg = READ_BIT(RCC_C2->APB3ENR, RCC_APB3ENR_WWDG1EN);\
  3641. UNUSED(tmpreg); \
  3642. } while(0)
  3643. #define __HAL_RCC_C2_LTDC_CLK_DISABLE() (RCC_C2->APB3ENR) &= ~ (RCC_APB3ENR_LTDCEN)
  3644. #define __HAL_RCC_C2_DSI_CLK_DISABLE() (RCC_C2->APB3ENR) &= ~ (RCC_APB3ENR_DSIEN)
  3645. #define __HAL_RCC_C2_WWDG1_CLK_DISABLE() (RCC_C2->APB3ENR) &= ~ (RCC_APB3ENR_WWDG1EN)
  3646. /** @brief Enable or disable the APB1 peripheral clock.
  3647. * @note After reset, the peripheral clock (used for registers read/write access)
  3648. * is disabled and the application software has to enable this clock before
  3649. * using it.
  3650. */
  3651. #define __HAL_RCC_C2_TIM2_CLK_ENABLE() do { \
  3652. __IO uint32_t tmpreg; \
  3653. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM2EN);\
  3654. /* Delay after an RCC peripheral clock enabling */ \
  3655. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM2EN);\
  3656. UNUSED(tmpreg); \
  3657. } while(0)
  3658. #define __HAL_RCC_C2_TIM3_CLK_ENABLE() do { \
  3659. __IO uint32_t tmpreg; \
  3660. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM3EN);\
  3661. /* Delay after an RCC peripheral clock enabling */ \
  3662. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM3EN);\
  3663. UNUSED(tmpreg); \
  3664. } while(0)
  3665. #define __HAL_RCC_C2_TIM4_CLK_ENABLE() do { \
  3666. __IO uint32_t tmpreg; \
  3667. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM4EN);\
  3668. /* Delay after an RCC peripheral clock enabling */ \
  3669. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM4EN);\
  3670. UNUSED(tmpreg); \
  3671. } while(0)
  3672. #define __HAL_RCC_C2_TIM5_CLK_ENABLE() do { \
  3673. __IO uint32_t tmpreg; \
  3674. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM5EN);\
  3675. /* Delay after an RCC peripheral clock enabling */ \
  3676. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM5EN);\
  3677. UNUSED(tmpreg); \
  3678. } while(0)
  3679. #define __HAL_RCC_C2_TIM6_CLK_ENABLE() do { \
  3680. __IO uint32_t tmpreg; \
  3681. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM6EN);\
  3682. /* Delay after an RCC peripheral clock enabling */ \
  3683. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM6EN);\
  3684. UNUSED(tmpreg); \
  3685. } while(0)
  3686. #define __HAL_RCC_C2_TIM7_CLK_ENABLE() do { \
  3687. __IO uint32_t tmpreg; \
  3688. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM7EN);\
  3689. /* Delay after an RCC peripheral clock enabling */ \
  3690. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM7EN);\
  3691. UNUSED(tmpreg); \
  3692. } while(0)
  3693. #define __HAL_RCC_C2_TIM12_CLK_ENABLE() do { \
  3694. __IO uint32_t tmpreg; \
  3695. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM12EN);\
  3696. /* Delay after an RCC peripheral clock enabling */ \
  3697. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM12EN);\
  3698. UNUSED(tmpreg); \
  3699. } while(0)
  3700. #define __HAL_RCC_C2_TIM13_CLK_ENABLE() do { \
  3701. __IO uint32_t tmpreg; \
  3702. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM13EN);\
  3703. /* Delay after an RCC peripheral clock enabling */ \
  3704. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM13EN);\
  3705. UNUSED(tmpreg); \
  3706. } while(0)
  3707. #define __HAL_RCC_C2_TIM14_CLK_ENABLE() do { \
  3708. __IO uint32_t tmpreg; \
  3709. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM14EN);\
  3710. /* Delay after an RCC peripheral clock enabling */ \
  3711. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM14EN);\
  3712. UNUSED(tmpreg); \
  3713. } while(0)
  3714. #define __HAL_RCC_C2_LPTIM1_CLK_ENABLE() do { \
  3715. __IO uint32_t tmpreg; \
  3716. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_LPTIM1EN);\
  3717. /* Delay after an RCC peripheral clock enabling */ \
  3718. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_LPTIM1EN);\
  3719. UNUSED(tmpreg); \
  3720. } while(0)
  3721. #define __HAL_RCC_C2_WWDG2_CLK_ENABLE() do { \
  3722. __IO uint32_t tmpreg; \
  3723. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_WWDG2EN);\
  3724. /* Delay after an RCC peripheral clock enabling */ \
  3725. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_WWDG2EN);\
  3726. UNUSED(tmpreg); \
  3727. } while(0)
  3728. #define __HAL_RCC_C2_SPI2_CLK_ENABLE() do { \
  3729. __IO uint32_t tmpreg; \
  3730. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_SPI2EN);\
  3731. /* Delay after an RCC peripheral clock enabling */ \
  3732. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_SPI2EN);\
  3733. UNUSED(tmpreg); \
  3734. } while(0)
  3735. #define __HAL_RCC_C2_SPI3_CLK_ENABLE() do { \
  3736. __IO uint32_t tmpreg; \
  3737. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_SPI3EN);\
  3738. /* Delay after an RCC peripheral clock enabling */ \
  3739. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_SPI3EN);\
  3740. UNUSED(tmpreg); \
  3741. } while(0)
  3742. #define __HAL_RCC_C2_SPDIFRX_CLK_ENABLE() do { \
  3743. __IO uint32_t tmpreg; \
  3744. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_SPDIFRXEN);\
  3745. /* Delay after an RCC peripheral clock enabling */ \
  3746. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_SPDIFRXEN);\
  3747. UNUSED(tmpreg); \
  3748. } while(0)
  3749. #define __HAL_RCC_C2_USART2_CLK_ENABLE() do { \
  3750. __IO uint32_t tmpreg; \
  3751. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_USART2EN);\
  3752. /* Delay after an RCC peripheral clock enabling */ \
  3753. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_USART2EN);\
  3754. UNUSED(tmpreg); \
  3755. } while(0)
  3756. #define __HAL_RCC_C2_USART3_CLK_ENABLE() do { \
  3757. __IO uint32_t tmpreg; \
  3758. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_USART3EN);\
  3759. /* Delay after an RCC peripheral clock enabling */ \
  3760. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_USART3EN);\
  3761. UNUSED(tmpreg); \
  3762. } while(0)
  3763. #define __HAL_RCC_C2_UART4_CLK_ENABLE() do { \
  3764. __IO uint32_t tmpreg; \
  3765. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_UART4EN);\
  3766. /* Delay after an RCC peripheral clock enabling */ \
  3767. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_UART4EN);\
  3768. UNUSED(tmpreg); \
  3769. } while(0)
  3770. #define __HAL_RCC_C2_UART5_CLK_ENABLE() do { \
  3771. __IO uint32_t tmpreg; \
  3772. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_UART5EN);\
  3773. /* Delay after an RCC peripheral clock enabling */ \
  3774. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_UART5EN);\
  3775. UNUSED(tmpreg); \
  3776. } while(0)
  3777. #define __HAL_RCC_C2_I2C1_CLK_ENABLE() do { \
  3778. __IO uint32_t tmpreg; \
  3779. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_I2C1EN);\
  3780. /* Delay after an RCC peripheral clock enabling */ \
  3781. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_I2C1EN);\
  3782. UNUSED(tmpreg); \
  3783. } while(0)
  3784. #define __HAL_RCC_C2_I2C2_CLK_ENABLE() do { \
  3785. __IO uint32_t tmpreg; \
  3786. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_I2C2EN);\
  3787. /* Delay after an RCC peripheral clock enabling */ \
  3788. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_I2C2EN);\
  3789. UNUSED(tmpreg); \
  3790. } while(0)
  3791. #define __HAL_RCC_C2_I2C3_CLK_ENABLE() do { \
  3792. __IO uint32_t tmpreg; \
  3793. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_I2C3EN);\
  3794. /* Delay after an RCC peripheral clock enabling */ \
  3795. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_I2C3EN);\
  3796. UNUSED(tmpreg); \
  3797. } while(0)
  3798. #define __HAL_RCC_C2_CEC_CLK_ENABLE() do { \
  3799. __IO uint32_t tmpreg; \
  3800. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_CECEN);\
  3801. /* Delay after an RCC peripheral clock enabling */ \
  3802. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_CECEN);\
  3803. UNUSED(tmpreg); \
  3804. } while(0)
  3805. #define __HAL_RCC_C2_DAC12_CLK_ENABLE() do { \
  3806. __IO uint32_t tmpreg; \
  3807. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_DAC12EN);\
  3808. /* Delay after an RCC peripheral clock enabling */ \
  3809. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_DAC12EN);\
  3810. UNUSED(tmpreg); \
  3811. } while(0)
  3812. #define __HAL_RCC_C2_UART7_CLK_ENABLE() do { \
  3813. __IO uint32_t tmpreg; \
  3814. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_UART7EN);\
  3815. /* Delay after an RCC peripheral clock enabling */ \
  3816. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_UART7EN);\
  3817. UNUSED(tmpreg); \
  3818. } while(0)
  3819. #define __HAL_RCC_C2_UART8_CLK_ENABLE() do { \
  3820. __IO uint32_t tmpreg; \
  3821. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_UART8EN);\
  3822. /* Delay after an RCC peripheral clock enabling */ \
  3823. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_UART8EN);\
  3824. UNUSED(tmpreg); \
  3825. } while(0)
  3826. #define __HAL_RCC_C2_CRS_CLK_ENABLE() do { \
  3827. __IO uint32_t tmpreg; \
  3828. SET_BIT(RCC_C2->APB1HENR, RCC_APB1HENR_CRSEN);\
  3829. /* Delay after an RCC peripheral clock enabling */ \
  3830. tmpreg = READ_BIT(RCC_C2->APB1HENR, RCC_APB1HENR_CRSEN);\
  3831. UNUSED(tmpreg); \
  3832. } while(0)
  3833. #define __HAL_RCC_C2_SWPMI_CLK_ENABLE() do { \
  3834. __IO uint32_t tmpreg; \
  3835. SET_BIT(RCC_C2->APB1HENR, RCC_APB1HENR_SWPMIEN);\
  3836. /* Delay after an RCC peripheral clock enabling */ \
  3837. tmpreg = READ_BIT(RCC_C2->APB1HENR, RCC_APB1HENR_SWPMIEN);\
  3838. UNUSED(tmpreg); \
  3839. } while(0)
  3840. #define __HAL_RCC_C2_OPAMP_CLK_ENABLE() do { \
  3841. __IO uint32_t tmpreg; \
  3842. SET_BIT(RCC_C2->APB1HENR, RCC_APB1HENR_OPAMPEN);\
  3843. /* Delay after an RCC peripheral clock enabling */ \
  3844. tmpreg = READ_BIT(RCC_C2->APB1HENR, RCC_APB1HENR_OPAMPEN);\
  3845. UNUSED(tmpreg); \
  3846. } while(0)
  3847. #define __HAL_RCC_C2_MDIOS_CLK_ENABLE() do { \
  3848. __IO uint32_t tmpreg; \
  3849. SET_BIT(RCC_C2->APB1HENR, RCC_APB1HENR_MDIOSEN);\
  3850. /* Delay after an RCC peripheral clock enabling */ \
  3851. tmpreg = READ_BIT(RCC_C2->APB1HENR, RCC_APB1HENR_MDIOSEN);\
  3852. UNUSED(tmpreg); \
  3853. } while(0)
  3854. #define __HAL_RCC_C2_FDCAN_CLK_ENABLE() do { \
  3855. __IO uint32_t tmpreg; \
  3856. SET_BIT(RCC_C2->APB1HENR, RCC_APB1HENR_FDCANEN);\
  3857. /* Delay after an RCC peripheral clock enabling */ \
  3858. tmpreg = READ_BIT(RCC_C2->APB1HENR, RCC_APB1HENR_FDCANEN);\
  3859. UNUSED(tmpreg); \
  3860. } while(0)
  3861. #define __HAL_RCC_C2_TIM2_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_TIM2EN)
  3862. #define __HAL_RCC_C2_TIM3_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_TIM3EN)
  3863. #define __HAL_RCC_C2_TIM4_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_TIM4EN)
  3864. #define __HAL_RCC_C2_TIM5_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_TIM5EN)
  3865. #define __HAL_RCC_C2_TIM6_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_TIM6EN)
  3866. #define __HAL_RCC_C2_TIM7_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_TIM7EN)
  3867. #define __HAL_RCC_C2_TIM12_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_TIM12EN)
  3868. #define __HAL_RCC_C2_TIM13_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_TIM13EN)
  3869. #define __HAL_RCC_C2_TIM14_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_TIM14EN)
  3870. #define __HAL_RCC_C2_LPTIM1_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_LPTIM1EN)
  3871. #define __HAL_RCC_C2_WWDG2_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_WWDG2EN)
  3872. #define __HAL_RCC_C2_SPI2_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_SPI2EN)
  3873. #define __HAL_RCC_C2_SPI3_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_SPI3EN)
  3874. #define __HAL_RCC_C2_SPDIFRX_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_SPDIFRXEN)
  3875. #define __HAL_RCC_C2_USART2_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_USART2EN)
  3876. #define __HAL_RCC_C2_USART3_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_USART3EN)
  3877. #define __HAL_RCC_C2_UART4_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_UART4EN)
  3878. #define __HAL_RCC_C2_UART5_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_UART5EN)
  3879. #define __HAL_RCC_C2_I2C1_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_I2C1EN)
  3880. #define __HAL_RCC_C2_I2C2_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_I2C2EN)
  3881. #define __HAL_RCC_C2_I2C3_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_I2C3EN)
  3882. #define __HAL_RCC_C2_CEC_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_CECEN)
  3883. #define __HAL_RCC_C2_DAC12_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_DAC12EN)
  3884. #define __HAL_RCC_C2_UART7_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_UART7EN)
  3885. #define __HAL_RCC_C2_UART8_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_UART8EN)
  3886. #define __HAL_RCC_C2_CRS_CLK_DISABLE() (RCC_C2->APB1HENR) &= ~ (RCC_APB1HENR_CRSEN)
  3887. #define __HAL_RCC_C2_SWPMI_CLK_DISABLE() (RCC_C2->APB1HENR) &= ~ (RCC_APB1HENR_SWPMIEN)
  3888. #define __HAL_RCC_C2_OPAMP_CLK_DISABLE() (RCC_C2->APB1HENR) &= ~ (RCC_APB1HENR_OPAMPEN)
  3889. #define __HAL_RCC_C2_MDIOS_CLK_DISABLE() (RCC_C2->APB1HENR) &= ~ (RCC_APB1HENR_MDIOSEN)
  3890. #define __HAL_RCC_C2_FDCAN_CLK_DISABLE() (RCC_C2->APB1HENR) &= ~ (RCC_APB1HENR_FDCANEN)
  3891. /** @brief Enable or disable the APB2 peripheral clock.
  3892. * @note After reset, the peripheral clock (used for registers read/write access)
  3893. * is disabled and the application software has to enable this clock before
  3894. * using it.
  3895. */
  3896. #define __HAL_RCC_C2_TIM1_CLK_ENABLE() do { \
  3897. __IO uint32_t tmpreg; \
  3898. SET_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_TIM1EN);\
  3899. /* Delay after an RCC peripheral clock enabling */ \
  3900. tmpreg = READ_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_TIM1EN);\
  3901. UNUSED(tmpreg); \
  3902. } while(0)
  3903. #define __HAL_RCC_C2_TIM8_CLK_ENABLE() do { \
  3904. __IO uint32_t tmpreg; \
  3905. SET_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_TIM8EN);\
  3906. /* Delay after an RCC peripheral clock enabling */ \
  3907. tmpreg = READ_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_TIM8EN);\
  3908. UNUSED(tmpreg); \
  3909. } while(0)
  3910. #define __HAL_RCC_C2_USART1_CLK_ENABLE() do { \
  3911. __IO uint32_t tmpreg; \
  3912. SET_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_USART1EN);\
  3913. /* Delay after an RCC peripheral clock enabling */ \
  3914. tmpreg = READ_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_USART1EN);\
  3915. UNUSED(tmpreg); \
  3916. } while(0)
  3917. #define __HAL_RCC_C2_USART6_CLK_ENABLE() do { \
  3918. __IO uint32_t tmpreg; \
  3919. SET_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_USART6EN);\
  3920. /* Delay after an RCC peripheral clock enabling */ \
  3921. tmpreg = READ_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_USART6EN);\
  3922. UNUSED(tmpreg); \
  3923. } while(0)
  3924. #define __HAL_RCC_C2_SPI1_CLK_ENABLE() do { \
  3925. __IO uint32_t tmpreg; \
  3926. SET_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_SPI1EN);\
  3927. /* Delay after an RCC peripheral clock enabling */ \
  3928. tmpreg = READ_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_SPI1EN);\
  3929. UNUSED(tmpreg); \
  3930. } while(0)
  3931. #define __HAL_RCC_C2_SPI4_CLK_ENABLE() do { \
  3932. __IO uint32_t tmpreg; \
  3933. SET_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_SPI4EN);\
  3934. /* Delay after an RCC peripheral clock enabling */ \
  3935. tmpreg = READ_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_SPI4EN);\
  3936. UNUSED(tmpreg); \
  3937. } while(0)
  3938. #define __HAL_RCC_C2_TIM15_CLK_ENABLE() do { \
  3939. __IO uint32_t tmpreg; \
  3940. SET_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_TIM15EN);\
  3941. /* Delay after an RCC peripheral clock enabling */ \
  3942. tmpreg = READ_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_TIM15EN);\
  3943. UNUSED(tmpreg); \
  3944. } while(0)
  3945. #define __HAL_RCC_C2_TIM16_CLK_ENABLE() do { \
  3946. __IO uint32_t tmpreg; \
  3947. SET_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_TIM16EN);\
  3948. /* Delay after an RCC peripheral clock enabling */ \
  3949. tmpreg = READ_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_TIM16EN);\
  3950. UNUSED(tmpreg); \
  3951. } while(0)
  3952. #define __HAL_RCC_C2_TIM17_CLK_ENABLE() do { \
  3953. __IO uint32_t tmpreg; \
  3954. SET_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_TIM17EN);\
  3955. /* Delay after an RCC peripheral clock enabling */ \
  3956. tmpreg = READ_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_TIM17EN);\
  3957. UNUSED(tmpreg); \
  3958. } while(0)
  3959. #define __HAL_RCC_C2_SPI5_CLK_ENABLE() do { \
  3960. __IO uint32_t tmpreg; \
  3961. SET_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_SPI5EN);\
  3962. /* Delay after an RCC peripheral clock enabling */ \
  3963. tmpreg = READ_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_SPI5EN);\
  3964. UNUSED(tmpreg); \
  3965. } while(0)
  3966. #define __HAL_RCC_C2_SAI1_CLK_ENABLE() do { \
  3967. __IO uint32_t tmpreg; \
  3968. SET_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_SAI1EN);\
  3969. /* Delay after an RCC peripheral clock enabling */ \
  3970. tmpreg = READ_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_SAI1EN);\
  3971. UNUSED(tmpreg); \
  3972. } while(0)
  3973. #define __HAL_RCC_C2_SAI2_CLK_ENABLE() do { \
  3974. __IO uint32_t tmpreg; \
  3975. SET_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_SAI2EN);\
  3976. /* Delay after an RCC peripheral clock enabling */ \
  3977. tmpreg = READ_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_SAI2EN);\
  3978. UNUSED(tmpreg); \
  3979. } while(0)
  3980. #define __HAL_RCC_C2_SAI3_CLK_ENABLE() do { \
  3981. __IO uint32_t tmpreg; \
  3982. SET_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_SAI3EN);\
  3983. /* Delay after an RCC peripheral clock enabling */ \
  3984. tmpreg = READ_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_SAI3EN);\
  3985. UNUSED(tmpreg); \
  3986. } while(0)
  3987. #define __HAL_RCC_C2_DFSDM1_CLK_ENABLE() do { \
  3988. __IO uint32_t tmpreg; \
  3989. SET_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_DFSDM1EN);\
  3990. /* Delay after an RCC peripheral clock enabling */ \
  3991. tmpreg = READ_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_DFSDM1EN);\
  3992. UNUSED(tmpreg); \
  3993. } while(0)
  3994. #define __HAL_RCC_C2_HRTIM1_CLK_ENABLE() do { \
  3995. __IO uint32_t tmpreg; \
  3996. SET_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_HRTIMEN);\
  3997. /* Delay after an RCC peripheral clock enabling */ \
  3998. tmpreg = READ_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_HRTIMEN);\
  3999. UNUSED(tmpreg); \
  4000. } while(0)
  4001. #define __HAL_RCC_C2_TIM1_CLK_DISABLE() (RCC_C2->APB2ENR) &= ~ (RCC_APB2ENR_TIM1EN)
  4002. #define __HAL_RCC_C2_TIM8_CLK_DISABLE() (RCC_C2->APB2ENR) &= ~ (RCC_APB2ENR_TIM8EN)
  4003. #define __HAL_RCC_C2_USART1_CLK_DISABLE() (RCC_C2->APB2ENR) &= ~ (RCC_APB2ENR_USART1EN)
  4004. #define __HAL_RCC_C2_USART6_CLK_DISABLE() (RCC_C2->APB2ENR) &= ~ (RCC_APB2ENR_USART6EN)
  4005. #define __HAL_RCC_C2_SPI1_CLK_DISABLE() (RCC_C2->APB2ENR) &= ~ (RCC_APB2ENR_SPI1EN)
  4006. #define __HAL_RCC_C2_SPI4_CLK_DISABLE() (RCC_C2->APB2ENR) &= ~ (RCC_APB2ENR_SPI4EN)
  4007. #define __HAL_RCC_C2_TIM15_CLK_DISABLE() (RCC_C2->APB2ENR) &= ~ (RCC_APB2ENR_TIM15EN)
  4008. #define __HAL_RCC_C2_TIM16_CLK_DISABLE() (RCC_C2->APB2ENR) &= ~ (RCC_APB2ENR_TIM16EN)
  4009. #define __HAL_RCC_C2_TIM17_CLK_DISABLE() (RCC_C2->APB2ENR) &= ~ (RCC_APB2ENR_TIM17EN)
  4010. #define __HAL_RCC_C2_SPI5_CLK_DISABLE() (RCC_C2->APB2ENR) &= ~ (RCC_APB2ENR_SPI5EN)
  4011. #define __HAL_RCC_C2_SAI1_CLK_DISABLE() (RCC_C2->APB2ENR) &= ~ (RCC_APB2ENR_SAI1EN)
  4012. #define __HAL_RCC_C2_SAI2_CLK_DISABLE() (RCC_C2->APB2ENR) &= ~ (RCC_APB2ENR_SAI2EN)
  4013. #define __HAL_RCC_C2_SAI3_CLK_DISABLE() (RCC_C2->APB2ENR) &= ~ (RCC_APB2ENR_SAI3EN)
  4014. #define __HAL_RCC_C2_DFSDM1_CLK_DISABLE() (RCC_C2->APB2ENR) &= ~ (RCC_APB2ENR_DFSDM1EN)
  4015. #define __HAL_RCC_C2_HRTIM1_CLK_DISABLE() (RCC_C2->APB2ENR) &= ~ (RCC_APB2ENR_HRTIMEN)
  4016. /** @brief Enable or disable the APB4 peripheral clock.
  4017. * @note After reset, the peripheral clock (used for registers read/write access)
  4018. * is disabled and the application software has to enable this clock before
  4019. * using it.
  4020. */
  4021. #define __HAL_RCC_C2_SYSCFG_CLK_ENABLE() do { \
  4022. __IO uint32_t tmpreg; \
  4023. SET_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_SYSCFGEN);\
  4024. /* Delay after an RCC peripheral clock enabling */ \
  4025. tmpreg = READ_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_SYSCFGEN);\
  4026. UNUSED(tmpreg); \
  4027. } while(0)
  4028. #define __HAL_RCC_C2_LPUART1_CLK_ENABLE() do { \
  4029. __IO uint32_t tmpreg; \
  4030. SET_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_LPUART1EN);\
  4031. /* Delay after an RCC peripheral clock enabling */ \
  4032. tmpreg = READ_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_LPUART1EN);\
  4033. UNUSED(tmpreg); \
  4034. } while(0)
  4035. #define __HAL_RCC_C2_SPI6_CLK_ENABLE() do { \
  4036. __IO uint32_t tmpreg; \
  4037. SET_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_SPI6EN);\
  4038. /* Delay after an RCC peripheral clock enabling */ \
  4039. tmpreg = READ_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_SPI6EN);\
  4040. UNUSED(tmpreg); \
  4041. } while(0)
  4042. #define __HAL_RCC_C2_I2C4_CLK_ENABLE() do { \
  4043. __IO uint32_t tmpreg; \
  4044. SET_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_I2C4EN);\
  4045. /* Delay after an RCC peripheral clock enabling */ \
  4046. tmpreg = READ_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_I2C4EN);\
  4047. UNUSED(tmpreg); \
  4048. } while(0)
  4049. #define __HAL_RCC_C2_LPTIM2_CLK_ENABLE() do { \
  4050. __IO uint32_t tmpreg; \
  4051. SET_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_LPTIM2EN);\
  4052. /* Delay after an RCC peripheral clock enabling */ \
  4053. tmpreg = READ_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_LPTIM2EN);\
  4054. UNUSED(tmpreg); \
  4055. } while(0)
  4056. #define __HAL_RCC_C2_LPTIM3_CLK_ENABLE() do { \
  4057. __IO uint32_t tmpreg; \
  4058. SET_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_LPTIM3EN);\
  4059. /* Delay after an RCC peripheral clock enabling */ \
  4060. tmpreg = READ_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_LPTIM3EN);\
  4061. UNUSED(tmpreg); \
  4062. } while(0)
  4063. #define __HAL_RCC_C2_LPTIM4_CLK_ENABLE() do { \
  4064. __IO uint32_t tmpreg; \
  4065. SET_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_LPTIM4EN);\
  4066. /* Delay after an RCC peripheral clock enabling */ \
  4067. tmpreg = READ_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_LPTIM4EN);\
  4068. UNUSED(tmpreg); \
  4069. } while(0)
  4070. #define __HAL_RCC_C2_LPTIM5_CLK_ENABLE() do { \
  4071. __IO uint32_t tmpreg; \
  4072. SET_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_LPTIM5EN);\
  4073. /* Delay after an RCC peripheral clock enabling */ \
  4074. tmpreg = READ_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_LPTIM5EN);\
  4075. UNUSED(tmpreg); \
  4076. } while(0)
  4077. #define __HAL_RCC_C2_COMP12_CLK_ENABLE() do { \
  4078. __IO uint32_t tmpreg; \
  4079. SET_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_COMP12EN);\
  4080. /* Delay after an RCC peripheral clock enabling */ \
  4081. tmpreg = READ_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_COMP12EN);\
  4082. UNUSED(tmpreg); \
  4083. } while(0)
  4084. #define __HAL_RCC_C2_VREF_CLK_ENABLE() do { \
  4085. __IO uint32_t tmpreg; \
  4086. SET_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_VREFEN);\
  4087. /* Delay after an RCC peripheral clock enabling */ \
  4088. tmpreg = READ_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_VREFEN);\
  4089. UNUSED(tmpreg); \
  4090. } while(0)
  4091. #define __HAL_RCC_C2_RTC_CLK_ENABLE() do { \
  4092. __IO uint32_t tmpreg; \
  4093. SET_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_RTCAPBEN);\
  4094. /* Delay after an RCC peripheral clock enabling */ \
  4095. tmpreg = READ_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_RTCAPBEN);\
  4096. UNUSED(tmpreg); \
  4097. } while(0)
  4098. #define __HAL_RCC_C2_SAI4_CLK_ENABLE() do { \
  4099. __IO uint32_t tmpreg; \
  4100. SET_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_SAI4EN);\
  4101. /* Delay after an RCC peripheral clock enabling */ \
  4102. tmpreg = READ_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_SAI4EN);\
  4103. UNUSED(tmpreg); \
  4104. } while(0)
  4105. #define __HAL_RCC_C2_SYSCFG_CLK_DISABLE() (RCC_C2->APB4ENR) &= ~ (RCC_APB4ENR_SYSCFGEN)
  4106. #define __HAL_RCC_C2_LPUART1_CLK_DISABLE() (RCC_C2->APB4ENR) &= ~ (RCC_APB4ENR_LPUART1EN)
  4107. #define __HAL_RCC_C2_SPI6_CLK_DISABLE() (RCC_C2->APB4ENR) &= ~ (RCC_APB4ENR_SPI6EN)
  4108. #define __HAL_RCC_C2_I2C4_CLK_DISABLE() (RCC_C2->APB4ENR) &= ~ (RCC_APB4ENR_I2C4EN)
  4109. #define __HAL_RCC_C2_LPTIM2_CLK_DISABLE() (RCC_C2->APB4ENR) &= ~ (RCC_APB4ENR_LPTIM2EN)
  4110. #define __HAL_RCC_C2_LPTIM3_CLK_DISABLE() (RCC_C2->APB4ENR) &= ~ (RCC_APB4ENR_LPTIM3EN)
  4111. #define __HAL_RCC_C2_LPTIM4_CLK_DISABLE() (RCC_C2->APB4ENR) &= ~ (RCC_APB4ENR_LPTIM4EN)
  4112. #define __HAL_RCC_C2_LPTIM5_CLK_DISABLE() (RCC_C2->APB4ENR) &= ~ (RCC_APB4ENR_LPTIM5EN)
  4113. #define __HAL_RCC_C2_COMP12_CLK_DISABLE() (RCC_C2->APB4ENR) &= ~ (RCC_APB4ENR_COMP12EN)
  4114. #define __HAL_RCC_C2_VREF_CLK_DISABLE() (RCC_C2->APB4ENR) &= ~ (RCC_APB4ENR_VREFEN)
  4115. #define __HAL_RCC_C2_RTC_CLK_DISABLE() (RCC_C2->APB4ENR) &= ~ (RCC_APB4ENR_RTCAPBEN)
  4116. #define __HAL_RCC_C2_SAI4_CLK_DISABLE() (RCC_C2->APB4ENR) &= ~ (RCC_APB4ENR_SAI4EN)
  4117. #endif /*DUAL_CORE*/
  4118. /** @brief Enable or disable the AHB3 peripheral reset.
  4119. */
  4120. #if (STM32H7_DEV_ID == 0x450UL)
  4121. #define __HAL_RCC_AHB3_FORCE_RESET() (RCC->AHB3RSTR = 0x00015031U) /* Resets MDMA, DMA2D, JPEG, FMC, QSPI and SDMMC1 */
  4122. #elif (STM32H7_DEV_ID == 0x480UL)
  4123. #define __HAL_RCC_AHB3_FORCE_RESET() (RCC->AHB3RSTR = 0x01E95031U) /* Resets MDMA, DMA2D, JPEG, FMC, OSPI1, SDMMC1, OSPI2, IOMNGR, OTFD1, OTFD2 and GFXMMU */
  4124. #else
  4125. #define __HAL_RCC_AHB3_FORCE_RESET() (RCC->AHB3RSTR = 0x00E95011U) /* Resets MDMA, DMA2D, FMC, OSPI1, SDMMC1, OSPI2, IOMNGR, OTFD1, OTFD2 */
  4126. #endif /* STM32H7_DEV_ID == 0x450UL */
  4127. #define __HAL_RCC_MDMA_FORCE_RESET() (RCC->AHB3RSTR |= (RCC_AHB3RSTR_MDMARST))
  4128. #define __HAL_RCC_DMA2D_FORCE_RESET() (RCC->AHB3RSTR |= (RCC_AHB3RSTR_DMA2DRST))
  4129. #if defined(JPEG)
  4130. #define __HAL_RCC_JPGDECRST_FORCE_RESET() (RCC->AHB3RSTR |= (RCC_AHB3RSTR_JPGDECRST))
  4131. #endif /* JPEG */
  4132. #define __HAL_RCC_FMC_FORCE_RESET() (RCC->AHB3RSTR |= (RCC_AHB3RSTR_FMCRST))
  4133. #if defined(QUADSPI)
  4134. #define __HAL_RCC_QSPI_FORCE_RESET() (RCC->AHB3RSTR |= (RCC_AHB3RSTR_QSPIRST))
  4135. #endif /*QUADSPI*/
  4136. #if defined(OCTOSPI1)
  4137. #define __HAL_RCC_OSPI1_FORCE_RESET() (RCC->AHB3RSTR |= (RCC_AHB3RSTR_OSPI1RST))
  4138. #endif /*OCTOSPI1*/
  4139. #define __HAL_RCC_SDMMC1_FORCE_RESET() (RCC->AHB3RSTR |= (RCC_AHB3RSTR_SDMMC1RST))
  4140. #if defined(OCTOSPI2)
  4141. #define __HAL_RCC_OSPI2_FORCE_RESET() (RCC->AHB3RSTR |= (RCC_AHB3RSTR_OSPI2RST))
  4142. #endif /*OCTOSPI2*/
  4143. #if defined(OCTOSPIM)
  4144. #define __HAL_RCC_IOMNGR_FORCE_RESET() (RCC->AHB3RSTR |= (RCC_AHB3RSTR_IOMNGRRST))
  4145. #endif /*OCTOSPIM*/
  4146. #if defined(OTFDEC1)
  4147. #define __HAL_RCC_OTFDEC1_FORCE_RESET() (RCC->AHB3RSTR |= (RCC_AHB3RSTR_OTFDEC1RST))
  4148. #endif /*OTFDEC1*/
  4149. #if defined(OTFDEC2)
  4150. #define __HAL_RCC_OTFDEC2_FORCE_RESET() (RCC->AHB3RSTR |= (RCC_AHB3RSTR_OTFDEC2RST))
  4151. #endif /*OTFDEC2*/
  4152. #if defined(GFXMMU)
  4153. #define __HAL_RCC_GFXMMU_FORCE_RESET() (RCC->AHB3RSTR |= (RCC_AHB3RSTR_GFXMMURST))
  4154. #endif /*GFXMMU*/
  4155. #define __HAL_RCC_AHB3_RELEASE_RESET() (RCC->AHB3RSTR = 0x00)
  4156. #define __HAL_RCC_MDMA_RELEASE_RESET() (RCC->AHB3RSTR &= ~ (RCC_AHB3RSTR_MDMARST))
  4157. #define __HAL_RCC_DMA2D_RELEASE_RESET() (RCC->AHB3RSTR &= ~ (RCC_AHB3RSTR_DMA2DRST))
  4158. #if defined(JPEG)
  4159. #define __HAL_RCC_JPGDECRST_RELEASE_RESET() (RCC->AHB3RSTR &= ~ (RCC_AHB3RSTR_JPGDECRST))
  4160. #endif /* JPEG */
  4161. #define __HAL_RCC_FMC_RELEASE_RESET() (RCC->AHB3RSTR &= ~ (RCC_AHB3RSTR_FMCRST))
  4162. #if defined(QUADSPI)
  4163. #define __HAL_RCC_QSPI_RELEASE_RESET() (RCC->AHB3RSTR &= ~ (RCC_AHB3RSTR_QSPIRST))
  4164. #endif /*QUADSPI*/
  4165. #if defined(OCTOSPI1)
  4166. #define __HAL_RCC_OSPI1_RELEASE_RESET() (RCC->AHB3RSTR &= ~ (RCC_AHB3RSTR_OSPI1RST))
  4167. #endif /*OCTOSPI1*/
  4168. #define __HAL_RCC_SDMMC1_RELEASE_RESET() (RCC->AHB3RSTR &= ~ (RCC_AHB3RSTR_SDMMC1RST))
  4169. #if defined(OCTOSPI2)
  4170. #define __HAL_RCC_OSPI2_RELEASE_RESET() (RCC->AHB3RSTR &= ~ (RCC_AHB3RSTR_OSPI2RST))
  4171. #endif /*OCTOSPI2*/
  4172. #if defined(OCTOSPIM)
  4173. #define __HAL_RCC_IOMNGR_RELEASE_RESET() (RCC->AHB3RSTR &= ~ (RCC_AHB3RSTR_IOMNGRRST))
  4174. #endif /*OCTOSPIM*/
  4175. #if defined(OTFDEC1)
  4176. #define __HAL_RCC_OTFDEC1_RELEASE_RESET() (RCC->AHB3RSTR &= ~ (RCC_AHB3RSTR_OTFDEC1RST))
  4177. #endif /*OTFDEC1*/
  4178. #if defined(OTFDEC2)
  4179. #define __HAL_RCC_OTFDEC2_RELEASE_RESET() (RCC->AHB3RSTR &= ~ (RCC_AHB3RSTR_OTFDEC2RST))
  4180. #endif /*OTFDEC2*/
  4181. #if defined(GFXMMU)
  4182. #define __HAL_RCC_GFXMMU_RELEASE_RESET() (RCC->AHB3RSTR &= ~ (RCC_AHB3RSTR_GFXMMURST))
  4183. #endif /*GFXMMU*/
  4184. /** @brief Force or release the AHB1 peripheral reset.
  4185. */
  4186. #if (STM32H7_DEV_ID == 0x450UL)
  4187. #define __HAL_RCC_AHB1_FORCE_RESET() (RCC->AHB1RSTR = 0x0A00C023U) /* Resets DMA1, DMA2, ADC12, ART, ETHMAC, USB1OTG and USB2OTG */
  4188. #elif (STM32H7_DEV_ID == 0x480UL)
  4189. #define __HAL_RCC_AHB1_FORCE_RESET() (RCC->AHB1RSTR = 0x02000223U) /* Resets DMA1, DMA2, ADC12, CRC and USB1OTG */
  4190. #else
  4191. #define __HAL_RCC_AHB1_FORCE_RESET() (RCC->AHB1RSTR = 0x02008023U) /* Resets DMA1, DMA2, ADC12, ETHMAC and USB1OTG */
  4192. #endif /* STM32H7_DEV_ID == 0x450UL */
  4193. #define __HAL_RCC_DMA1_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_DMA1RST))
  4194. #define __HAL_RCC_DMA2_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_DMA2RST))
  4195. #define __HAL_RCC_ADC12_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_ADC12RST))
  4196. #if defined(DUAL_CORE)
  4197. #define __HAL_RCC_ART_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_ARTRST))
  4198. #endif /*DUAL_CORE*/
  4199. #if defined(RCC_AHB1RSTR_CRCRST)
  4200. #define __HAL_RCC_CRC_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_CRCRST))
  4201. #endif
  4202. #if defined(ETH)
  4203. #define __HAL_RCC_ETH1MAC_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_ETH1MACRST))
  4204. #endif /*ETH*/
  4205. #define __HAL_RCC_USB1_OTG_HS_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_USB1OTGHSRST))
  4206. #if defined(USB2_OTG_FS)
  4207. #define __HAL_RCC_USB2_OTG_FS_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_USB2OTGHSRST))
  4208. #endif /*USB2_OTG_FS*/
  4209. #define __HAL_RCC_AHB1_RELEASE_RESET() (RCC->AHB1RSTR = 0x00U)
  4210. #define __HAL_RCC_DMA1_RELEASE_RESET() (RCC->AHB1RSTR &= ~ (RCC_AHB1RSTR_DMA1RST))
  4211. #define __HAL_RCC_DMA2_RELEASE_RESET() (RCC->AHB1RSTR &= ~ (RCC_AHB1RSTR_DMA2RST))
  4212. #define __HAL_RCC_ADC12_RELEASE_RESET() (RCC->AHB1RSTR &= ~ (RCC_AHB1RSTR_ADC12RST))
  4213. #if defined(DUAL_CORE)
  4214. #define __HAL_RCC_ART_RELEASE_RESET() (RCC->AHB1RSTR &= ~ (RCC_AHB1RSTR_ARTRST))
  4215. #endif /*DUAL_CORE*/
  4216. #if defined(RCC_AHB1RSTR_CRCRST)
  4217. #define __HAL_RCC_CRC_RELEASE_RESET() (RCC->AHB1RSTR &= ~ (RCC_AHB1RSTR_CRCRST))
  4218. #endif
  4219. #if defined(ETH)
  4220. #define __HAL_RCC_ETH1MAC_RELEASE_RESET() (RCC->AHB1RSTR &= ~ (RCC_AHB1RSTR_ETH1MACRST))
  4221. #endif /*ETH*/
  4222. #define __HAL_RCC_USB1_OTG_HS_RELEASE_RESET() (RCC->AHB1RSTR &= ~ (RCC_AHB1RSTR_USB1OTGHSRST))
  4223. #if defined(USB2_OTG_FS)
  4224. #define __HAL_RCC_USB2_OTG_FS_RELEASE_RESET() (RCC->AHB1RSTR &= ~ (RCC_AHB1RSTR_USB2OTGHSRST))
  4225. #endif /*USB2_OTG_FS*/
  4226. /** @brief Force or release the AHB2 peripheral reset.
  4227. */
  4228. #if (STM32H7_DEV_ID == 0x450UL)
  4229. #define __HAL_RCC_AHB2_FORCE_RESET() (RCC->AHB2RSTR = 0x00000271U) /* Resets DCMI, CRYPT, HASH, RNG and SDMMC2 */
  4230. #elif (STM32H7_DEV_ID == 0x480UL)
  4231. #define __HAL_RCC_AHB2_FORCE_RESET() (RCC->AHB2RSTR = 0x00000A75U) /* Resets DCMI_PSSI, HSEM, CRYPT, HASH, RNG, SDMMC2 and BDMA1 */
  4232. #else
  4233. #define __HAL_RCC_AHB2_FORCE_RESET() (RCC->AHB2RSTR = 0x00030271U) /* Resets DCMI_PSSI, CRYPT, HASH, RNG, SDMMC2, FMAC and CORDIC */
  4234. #endif /* STM32H7_DEV_ID == 0x450UL */
  4235. #if defined(DCMI) && defined(PSSI)
  4236. #define __HAL_RCC_DCMI_PSSI_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_DCMI_PSSIRST))
  4237. #define __HAL_RCC_DCMI_FORCE_RESET() __HAL_RCC_DCMI_PSSI_FORCE_RESET() /* for API backward compatibility*/
  4238. #else
  4239. #define __HAL_RCC_DCMI_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_DCMIRST))
  4240. #endif /* DCMI && PSSI */
  4241. #if defined(CRYP)
  4242. #define __HAL_RCC_CRYP_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_CRYPRST))
  4243. #endif /* CRYP */
  4244. #if defined(HASH)
  4245. #define __HAL_RCC_HASH_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_HASHRST))
  4246. #endif /* HASH */
  4247. #define __HAL_RCC_RNG_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_RNGRST))
  4248. #define __HAL_RCC_SDMMC2_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_SDMMC2RST))
  4249. #if defined(FMAC)
  4250. #define __HAL_RCC_FMAC_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_FMACRST))
  4251. #endif /*FMAC*/
  4252. #if defined(CORDIC)
  4253. #define __HAL_RCC_CORDIC_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_CORDICRST))
  4254. #endif /*CORDIC*/
  4255. #if defined(RCC_AHB2RSTR_HSEMRST)
  4256. #define __HAL_RCC_HSEM_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_HSEMRST))
  4257. #endif
  4258. #if defined(BDMA1)
  4259. #define __HAL_RCC_BDMA1_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_BDMA1RST))
  4260. #endif /*BDMA1*/
  4261. #define __HAL_RCC_AHB2_RELEASE_RESET() (RCC->AHB2RSTR = 0x00U)
  4262. #if defined(DCMI) && defined(PSSI)
  4263. #define __HAL_RCC_DCMI_PSSI_RELEASE_RESET() (RCC->AHB2RSTR &= ~ (RCC_AHB2RSTR_DCMI_PSSIRST))
  4264. #define __HAL_RCC_DCMI_RELEASE_RESET() __HAL_RCC_DCMI_PSSI_RELEASE_RESET() /* for API backward compatibility*/
  4265. #else
  4266. #define __HAL_RCC_DCMI_RELEASE_RESET() (RCC->AHB2RSTR &= ~ (RCC_AHB2RSTR_DCMIRST))
  4267. #endif /* DCMI && PSSI */
  4268. #if defined(CRYP)
  4269. #define __HAL_RCC_CRYP_RELEASE_RESET() (RCC->AHB2RSTR &= ~ (RCC_AHB2RSTR_CRYPRST))
  4270. #endif /* CRYP */
  4271. #if defined(HASH)
  4272. #define __HAL_RCC_HASH_RELEASE_RESET() (RCC->AHB2RSTR &= ~ (RCC_AHB2RSTR_HASHRST))
  4273. #endif /* HASH */
  4274. #define __HAL_RCC_RNG_RELEASE_RESET() (RCC->AHB2RSTR &= ~ (RCC_AHB2RSTR_RNGRST))
  4275. #define __HAL_RCC_SDMMC2_RELEASE_RESET() (RCC->AHB2RSTR &= ~ (RCC_AHB2RSTR_SDMMC2RST))
  4276. #if defined(FMAC)
  4277. #define __HAL_RCC_FMAC_RELEASE_RESET() (RCC->AHB2RSTR &= ~ (RCC_AHB2RSTR_FMACRST))
  4278. #endif /*FMAC*/
  4279. #if defined(CORDIC)
  4280. #define __HAL_RCC_CORDIC_RELEASE_RESET() (RCC->AHB2RSTR &= ~ (RCC_AHB2RSTR_CORDICRST))
  4281. #endif /*CORDIC*/
  4282. #if defined(RCC_AHB2RSTR_HSEMRST)
  4283. #define __HAL_RCC_HSEM_RELEASE_RESET() (RCC->AHB2RSTR &= ~ (RCC_AHB2RSTR_HSEMRST))
  4284. #endif
  4285. #if defined(BDMA1)
  4286. #define __HAL_RCC_BDMA1_RELEASE_RESET() (RCC->AHB2RSTR &= ~ (RCC_AHB2RSTR_BDMA1RST))
  4287. #endif /*BDMA1*/
  4288. /** @brief Force or release the AHB4 peripheral reset.
  4289. */
  4290. #if (STM32H7_DEV_ID == 0x450UL)
  4291. #define __HAL_RCC_AHB4_FORCE_RESET() (RCC->AHB4RSTR = 0x032807FFU) /* Resets GPIOA..GPIOK, CRC, BDMA, ADC3 and HSEM */
  4292. #elif (STM32H7_DEV_ID == 0x480UL)
  4293. #define __HAL_RCC_AHB4_FORCE_RESET() (RCC->AHB4RSTR = 0x002007FFU) /* Resets GPIOA..GPIOK and BDMA2 */
  4294. #else
  4295. #define __HAL_RCC_AHB4_FORCE_RESET() (RCC->AHB4RSTR = 0x032806FFU) /* Resets GPIOA..GPIOH, GPIOJ, GPIOK, CRC, BDMA, ADC3 and HSEM */
  4296. #endif /* STM32H7_DEV_ID == 0x450UL */
  4297. #define __HAL_RCC_GPIOA_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_GPIOARST)
  4298. #define __HAL_RCC_GPIOB_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_GPIOBRST)
  4299. #define __HAL_RCC_GPIOC_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_GPIOCRST)
  4300. #define __HAL_RCC_GPIOD_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_GPIODRST)
  4301. #define __HAL_RCC_GPIOE_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_GPIOERST)
  4302. #define __HAL_RCC_GPIOF_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_GPIOFRST)
  4303. #define __HAL_RCC_GPIOG_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_GPIOGRST)
  4304. #define __HAL_RCC_GPIOH_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_GPIOHRST)
  4305. #if defined(GPIOI)
  4306. #define __HAL_RCC_GPIOI_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_GPIOIRST)
  4307. #endif /* GPIOI */
  4308. #define __HAL_RCC_GPIOJ_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_GPIOJRST)
  4309. #define __HAL_RCC_GPIOK_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_GPIOKRST)
  4310. #if defined(RCC_AHB4RSTR_CRCRST)
  4311. #define __HAL_RCC_CRC_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_CRCRST)
  4312. #endif
  4313. #if defined(BDMA2)
  4314. #define __HAL_RCC_BDMA2_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_BDMA2RST)
  4315. #define __HAL_RCC_BDMA_FORCE_RESET() __HAL_RCC_BDMA2_FORCE_RESET() /* for API backward compatibility*/
  4316. #else
  4317. #define __HAL_RCC_BDMA_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_BDMARST)
  4318. #endif /*BDMA2*/
  4319. #if defined(ADC3)
  4320. #define __HAL_RCC_ADC3_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_ADC3RST)
  4321. #endif /*ADC3*/
  4322. #if defined(RCC_AHB4RSTR_HSEMRST)
  4323. #define __HAL_RCC_HSEM_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_HSEMRST)
  4324. #endif
  4325. #define __HAL_RCC_AHB4_RELEASE_RESET() (RCC->AHB4RSTR = 0x00U)
  4326. #define __HAL_RCC_GPIOA_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_GPIOARST)
  4327. #define __HAL_RCC_GPIOB_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_GPIOBRST)
  4328. #define __HAL_RCC_GPIOC_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_GPIOCRST)
  4329. #define __HAL_RCC_GPIOD_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_GPIODRST)
  4330. #define __HAL_RCC_GPIOE_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_GPIOERST)
  4331. #define __HAL_RCC_GPIOF_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_GPIOFRST)
  4332. #define __HAL_RCC_GPIOG_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_GPIOGRST)
  4333. #define __HAL_RCC_GPIOH_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_GPIOHRST)
  4334. #if defined(GPIOI)
  4335. #define __HAL_RCC_GPIOI_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_GPIOIRST)
  4336. #endif /* GPIOI */
  4337. #define __HAL_RCC_GPIOJ_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_GPIOJRST)
  4338. #define __HAL_RCC_GPIOK_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_GPIOKRST)
  4339. #if defined(RCC_AHB4RSTR_CRCRST)
  4340. #define __HAL_RCC_CRC_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_CRCRST)
  4341. #endif
  4342. #if defined(BDMA2)
  4343. #define __HAL_RCC_BDMA2_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_BDMA2RST)
  4344. #define __HAL_RCC_BDMA_RELEASE_RESET() __HAL_RCC_BDMA2_RELEASE_RESET() /* for API backward compatibility*/
  4345. #else
  4346. #define __HAL_RCC_BDMA_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_BDMARST)
  4347. #endif /*BDMA2*/
  4348. #if defined(ADC3)
  4349. #define __HAL_RCC_ADC3_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_ADC3RST)
  4350. #endif /*ADC3*/
  4351. #if defined(RCC_AHB4RSTR_HSEMRST)
  4352. #define __HAL_RCC_HSEM_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_HSEMRST)
  4353. #endif
  4354. /** @brief Force or release the APB3 peripheral reset.
  4355. */
  4356. #if (STM32H7_DEV_ID == 0x450UL)
  4357. #define __HAL_RCC_APB3_FORCE_RESET() (RCC->APB3RSTR = 0x00000018U) /* Rests LTDC and DSI */
  4358. #else
  4359. #define __HAL_RCC_APB3_FORCE_RESET() (RCC->APB3RSTR = 0x00000008U) /* Rests LTDC */
  4360. #endif /* STM32H7_DEV_ID == 0x450UL */
  4361. #if defined(LTDC)
  4362. #define __HAL_RCC_LTDC_FORCE_RESET() (RCC->APB3RSTR) |= (RCC_APB3RSTR_LTDCRST)
  4363. #endif /* LTDC */
  4364. #if defined(DSI)
  4365. #define __HAL_RCC_DSI_FORCE_RESET() (RCC->APB3RSTR) |= (RCC_APB3RSTR_DSIRST)
  4366. #endif /*DSI*/
  4367. #define __HAL_RCC_APB3_RELEASE_RESET() (RCC->APB3RSTR = 0x00U)
  4368. #if defined(LTDC)
  4369. #define __HAL_RCC_LTDC_RELEASE_RESET() (RCC->APB3RSTR) &= ~ (RCC_APB3RSTR_LTDCRST)
  4370. #endif /* LTDC */
  4371. #if defined(DSI)
  4372. #define __HAL_RCC_DSI_RELEASE_RESET() (RCC->APB3RSTR) &= ~ (RCC_APB3RSTR_DSIRST)
  4373. #endif /*DSI*/
  4374. /** @brief Force or release the APB1 peripheral reset.
  4375. */
  4376. #if (STM32H7_DEV_ID == 0x450UL) || (STM32H7_DEV_ID == 0x480UL)
  4377. #define __HAL_RCC_APB1L_FORCE_RESET() (RCC->APB1LRSTR = 0xE8FFC3FFU) /* Resets TIM2..TIM7, TIM12..TIM14, LPTIM1, SPI2, SPI3, SPDIFRX, USART2, USART3, UART4, UART5, I2C1..I2C3, CEC, DAC1(2), UART7 and UART8 */
  4378. #else
  4379. #define __HAL_RCC_APB1L_FORCE_RESET() (RCC->APB1LRSTR = 0xEAFFC3FFU) /* Resets TIM2..TIM7, TIM12..TIM14, LPTIM1, SPI2, SPI3, SPDIFRX, USART2, USART3, UART4, UART5, I2C1..I2C3, I2C5, CEC, DAC12, UART7 and UART8 */
  4380. #endif /* STM32H7_DEV_ID == 0x450UL */
  4381. #if (STM32H7_DEV_ID == 0x450UL) || (STM32H7_DEV_ID == 0x480UL)
  4382. #define __HAL_RCC_APB1H_FORCE_RESET() (RCC->APB1HRSTR = 0x00000136U) /* Resets CRS, SWP, OPAMP, MDIOS and FDCAN */
  4383. #else
  4384. #define __HAL_RCC_APB1H_FORCE_RESET() (RCC->APB1HRSTR = 0x03000136U) /* Resets CRS, SWP, OPAMP, MDIOS, FDCAN, TIM23 and TIM24 */
  4385. #endif /* STM32H7_DEV_ID == 0x450UL */
  4386. #define __HAL_RCC_TIM2_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_TIM2RST)
  4387. #define __HAL_RCC_TIM3_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_TIM3RST)
  4388. #define __HAL_RCC_TIM4_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_TIM4RST)
  4389. #define __HAL_RCC_TIM5_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_TIM5RST)
  4390. #define __HAL_RCC_TIM6_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_TIM6RST)
  4391. #define __HAL_RCC_TIM7_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_TIM7RST)
  4392. #define __HAL_RCC_TIM12_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_TIM12RST)
  4393. #define __HAL_RCC_TIM13_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_TIM13RST)
  4394. #define __HAL_RCC_TIM14_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_TIM14RST)
  4395. #define __HAL_RCC_LPTIM1_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_LPTIM1RST)
  4396. #define __HAL_RCC_SPI2_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_SPI2RST)
  4397. #define __HAL_RCC_SPI3_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_SPI3RST)
  4398. #define __HAL_RCC_SPDIFRX_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_SPDIFRXRST)
  4399. #define __HAL_RCC_USART2_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_USART2RST)
  4400. #define __HAL_RCC_USART3_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_USART3RST)
  4401. #define __HAL_RCC_UART4_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_UART4RST)
  4402. #define __HAL_RCC_UART5_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_UART5RST)
  4403. #define __HAL_RCC_I2C1_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_I2C1RST)
  4404. #define __HAL_RCC_I2C2_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_I2C2RST)
  4405. #define __HAL_RCC_I2C3_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_I2C3RST)
  4406. #if defined(I2C5)
  4407. #define __HAL_RCC_I2C5_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_I2C5RST)
  4408. #endif /* I2C5 */
  4409. #define __HAL_RCC_CEC_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_CECRST)
  4410. #define __HAL_RCC_DAC12_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_DAC12RST)
  4411. #define __HAL_RCC_UART7_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_UART7RST)
  4412. #define __HAL_RCC_UART8_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_UART8RST)
  4413. #define __HAL_RCC_CRS_FORCE_RESET() (RCC->APB1HRSTR) |= (RCC_APB1HRSTR_CRSRST)
  4414. #define __HAL_RCC_SWPMI1_FORCE_RESET() (RCC->APB1HRSTR) |= (RCC_APB1HRSTR_SWPMIRST)
  4415. #define __HAL_RCC_OPAMP_FORCE_RESET() (RCC->APB1HRSTR) |= (RCC_APB1HRSTR_OPAMPRST)
  4416. #define __HAL_RCC_MDIOS_FORCE_RESET() (RCC->APB1HRSTR) |= (RCC_APB1HRSTR_MDIOSRST)
  4417. #define __HAL_RCC_FDCAN_FORCE_RESET() (RCC->APB1HRSTR) |= (RCC_APB1HRSTR_FDCANRST)
  4418. #if defined(TIM23)
  4419. #define __HAL_RCC_TIM23_FORCE_RESET() (RCC->APB1HRSTR) |= (RCC_APB1HRSTR_TIM23RST)
  4420. #endif /* TIM23 */
  4421. #if defined(TIM24)
  4422. #define __HAL_RCC_TIM24_FORCE_RESET() (RCC->APB1HRSTR) |= (RCC_APB1HRSTR_TIM24RST)
  4423. #endif /* TIM24 */
  4424. #define __HAL_RCC_APB1L_RELEASE_RESET() (RCC->APB1LRSTR = 0x00U)
  4425. #define __HAL_RCC_APB1H_RELEASE_RESET() (RCC->APB1HRSTR = 0x00U)
  4426. #define __HAL_RCC_TIM2_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_TIM2RST)
  4427. #define __HAL_RCC_TIM3_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_TIM3RST)
  4428. #define __HAL_RCC_TIM4_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_TIM4RST)
  4429. #define __HAL_RCC_TIM5_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_TIM5RST)
  4430. #define __HAL_RCC_TIM6_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_TIM6RST)
  4431. #define __HAL_RCC_TIM7_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_TIM7RST)
  4432. #define __HAL_RCC_TIM12_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_TIM12RST)
  4433. #define __HAL_RCC_TIM13_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_TIM13RST)
  4434. #define __HAL_RCC_TIM14_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_TIM14RST)
  4435. #define __HAL_RCC_LPTIM1_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_LPTIM1RST)
  4436. #define __HAL_RCC_SPI2_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_SPI2RST)
  4437. #define __HAL_RCC_SPI3_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_SPI3RST)
  4438. #define __HAL_RCC_SPDIFRX_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_SPDIFRXRST)
  4439. #define __HAL_RCC_USART2_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_USART2RST)
  4440. #define __HAL_RCC_USART3_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_USART3RST)
  4441. #define __HAL_RCC_UART4_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_UART4RST)
  4442. #define __HAL_RCC_UART5_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_UART5RST)
  4443. #define __HAL_RCC_I2C1_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_I2C1RST)
  4444. #define __HAL_RCC_I2C2_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_I2C2RST)
  4445. #define __HAL_RCC_I2C3_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_I2C3RST)
  4446. #if defined(I2C5)
  4447. #define __HAL_RCC_I2C5_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_I2C5RST)
  4448. #endif /* I2C5 */
  4449. #define __HAL_RCC_CEC_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_CECRST)
  4450. #define __HAL_RCC_DAC12_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_DAC12RST)
  4451. #define __HAL_RCC_UART7_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_UART7RST)
  4452. #define __HAL_RCC_UART8_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_UART8RST)
  4453. #define __HAL_RCC_CRS_RELEASE_RESET() (RCC->APB1HRSTR) &= ~ (RCC_APB1HRSTR_CRSRST)
  4454. #define __HAL_RCC_SWPMI1_RELEASE_RESET() (RCC->APB1HRSTR) &= ~ (RCC_APB1HRSTR_SWPMIRST)
  4455. #define __HAL_RCC_OPAMP_RELEASE_RESET() (RCC->APB1HRSTR) &= ~ (RCC_APB1HRSTR_OPAMPRST)
  4456. #define __HAL_RCC_MDIOS_RELEASE_RESET() (RCC->APB1HRSTR) &= ~ (RCC_APB1HRSTR_MDIOSRST)
  4457. #define __HAL_RCC_FDCAN_RELEASE_RESET() (RCC->APB1HRSTR) &= ~ (RCC_APB1HRSTR_FDCANRST)
  4458. #if defined(TIM23)
  4459. #define __HAL_RCC_TIM23_RELEASE_RESET() (RCC->APB1HRSTR) &= ~ (RCC_APB1HRSTR_TIM23RST)
  4460. #endif /* TIM23 */
  4461. #if defined(TIM24)
  4462. #define __HAL_RCC_TIM24_RELEASE_RESET() (RCC->APB1HRSTR) &= ~ (RCC_APB1HRSTR_TIM24RST)
  4463. #endif /* TIM24 */
  4464. /** @brief Force or release the APB2 peripheral reset.
  4465. */
  4466. #if (STM32H7_DEV_ID == 0x450UL)
  4467. #define __HAL_RCC_APB2_FORCE_RESET() (RCC->APB2RSTR = 0x31D73033U) /* Resets TIM1, TIM8, USART1, USART6, SPI1, SPI4, TIM15..TIM17, SPI5, SAI1..SAI3, DFSDM1 and HRTIM */
  4468. #elif (STM32H7_DEV_ID == 0x480UL)
  4469. #define __HAL_RCC_APB2_FORCE_RESET() (RCC->APB2RSTR = 0x40D730F3U) /* Resets TIM1, TIM8, USART1, USART6, UART9, USART10, SPI1, SPI4, TIM15..TIM17, SPI5, SAI1, SAI2 and DFSDM1 */
  4470. #else
  4471. #define __HAL_RCC_APB2_FORCE_RESET() (RCC->APB2RSTR = 0x405730F3U) /* Resets TIM1, TIM8, USART1, USART6, UART9, USART10, SPI1, SPI4, TIM15..TIM17, SPI5, SAI1 and DFSDM1 */
  4472. #endif /* STM32H7_DEV_ID == 0x450UL */
  4473. #define __HAL_RCC_TIM1_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_TIM1RST)
  4474. #define __HAL_RCC_TIM8_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_TIM8RST)
  4475. #define __HAL_RCC_USART1_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_USART1RST)
  4476. #define __HAL_RCC_USART6_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_USART6RST)
  4477. #if defined(UART9)
  4478. #define __HAL_RCC_UART9_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_UART9RST)
  4479. #endif /*UART9*/
  4480. #if defined(USART10)
  4481. #define __HAL_RCC_USART10_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_USART10RST)
  4482. #endif /*USART10*/
  4483. #define __HAL_RCC_SPI1_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_SPI1RST)
  4484. #define __HAL_RCC_SPI4_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_SPI4RST)
  4485. #define __HAL_RCC_TIM15_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_TIM15RST)
  4486. #define __HAL_RCC_TIM16_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_TIM16RST)
  4487. #define __HAL_RCC_TIM17_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_TIM17RST)
  4488. #define __HAL_RCC_SPI5_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_SPI5RST)
  4489. #define __HAL_RCC_SAI1_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_SAI1RST)
  4490. #if defined(SAI2)
  4491. #define __HAL_RCC_SAI2_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_SAI2RST)
  4492. #endif /* SAI2 */
  4493. #if defined(SAI3)
  4494. #define __HAL_RCC_SAI3_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_SAI3RST)
  4495. #endif /*SAI3*/
  4496. #define __HAL_RCC_DFSDM1_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_DFSDM1RST)
  4497. #if defined(HRTIM1)
  4498. #define __HAL_RCC_HRTIM1_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_HRTIMRST)
  4499. #endif /*HRTIM1*/
  4500. #define __HAL_RCC_APB2_RELEASE_RESET() (RCC->APB2RSTR = 0x00U)
  4501. #define __HAL_RCC_TIM1_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_TIM1RST)
  4502. #define __HAL_RCC_TIM8_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_TIM8RST)
  4503. #define __HAL_RCC_USART1_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_USART1RST)
  4504. #define __HAL_RCC_USART6_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_USART6RST)
  4505. #if defined(UART9)
  4506. #define __HAL_RCC_UART9_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_UART9RST)
  4507. #endif /*UART9*/
  4508. #if defined(USART10)
  4509. #define __HAL_RCC_USART10_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_USART10RST)
  4510. #endif /*USART10*/
  4511. #define __HAL_RCC_SPI1_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_SPI1RST)
  4512. #define __HAL_RCC_SPI4_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_SPI4RST)
  4513. #define __HAL_RCC_TIM15_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_TIM15RST)
  4514. #define __HAL_RCC_TIM16_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_TIM16RST)
  4515. #define __HAL_RCC_TIM17_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_TIM17RST)
  4516. #define __HAL_RCC_SPI5_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_SPI5RST)
  4517. #define __HAL_RCC_SAI1_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_SAI1RST)
  4518. #if defined(SAI2)
  4519. #define __HAL_RCC_SAI2_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_SAI2RST)
  4520. #endif /* SAI2 */
  4521. #if defined(SAI3)
  4522. #define __HAL_RCC_SAI3_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_SAI3RST)
  4523. #endif /*SAI3*/
  4524. #define __HAL_RCC_DFSDM1_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_DFSDM1RST)
  4525. #if defined(HRTIM1)
  4526. #define __HAL_RCC_HRTIM1_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_HRTIMRST)
  4527. #endif /*HRTIM1*/
  4528. /** @brief Force or release the APB4 peripheral reset.
  4529. */
  4530. #if (STM32H7_DEV_ID == 0x450UL)
  4531. #define __HAL_RCC_APB4_FORCE_RESET() (RCC->APB4RSTR = 0x0020DEAAU) /* Resets SYSCFG, LPUART1, SPI6, I2C4, LPTIM2..LPTIM5, COMP12, VREF and SAI4 */
  4532. #elif (STM32H7_DEV_ID == 0x480UL)
  4533. #define __HAL_RCC_APB4_FORCE_RESET() (RCC->APB4RSTR = 0x0C00E6AAU) /* Resets SYSCFG, LPUART1, SPI6, I2C4, LPTIM2, LPTIM3, DAC2, COMP12, VREF, DTS and DFSDM2 */
  4534. #else
  4535. #define __HAL_RCC_APB4_FORCE_RESET() (RCC->APB4RSTR = 0x0420DEAAU) /* Resets SYSCFG, LPUART1, SPI6, I2C4, LPTIM2..LPTIM5, COMP12, VREF, SAI4 and DTS */
  4536. #endif /* STM32H7_DEV_ID == 0x450UL */
  4537. #define __HAL_RCC_SYSCFG_FORCE_RESET() (RCC->APB4RSTR) |= (RCC_APB4RSTR_SYSCFGRST)
  4538. #define __HAL_RCC_LPUART1_FORCE_RESET() (RCC->APB4RSTR) |= (RCC_APB4RSTR_LPUART1RST)
  4539. #define __HAL_RCC_SPI6_FORCE_RESET() (RCC->APB4RSTR) |= (RCC_APB4RSTR_SPI6RST)
  4540. #define __HAL_RCC_I2C4_FORCE_RESET() (RCC->APB4RSTR) |= (RCC_APB4RSTR_I2C4RST)
  4541. #define __HAL_RCC_LPTIM2_FORCE_RESET() (RCC->APB4RSTR) |= (RCC_APB4RSTR_LPTIM2RST)
  4542. #define __HAL_RCC_LPTIM3_FORCE_RESET() (RCC->APB4RSTR) |= (RCC_APB4RSTR_LPTIM3RST)
  4543. #if defined(LPTIM4)
  4544. #define __HAL_RCC_LPTIM4_FORCE_RESET() (RCC->APB4RSTR) |= (RCC_APB4RSTR_LPTIM4RST)
  4545. #endif /*LPTIM4*/
  4546. #if defined(LPTIM5)
  4547. #define __HAL_RCC_LPTIM5_FORCE_RESET() (RCC->APB4RSTR) |= (RCC_APB4RSTR_LPTIM5RST)
  4548. #endif /*LPTIM5*/
  4549. #if defined(DAC2)
  4550. #define __HAL_RCC_DAC2_FORCE_RESET() (RCC->APB4RSTR) |= (RCC_APB4RSTR_DAC2RST)
  4551. #endif /*DAC2*/
  4552. #define __HAL_RCC_COMP12_FORCE_RESET() (RCC->APB4RSTR) |= (RCC_APB4RSTR_COMP12RST)
  4553. #define __HAL_RCC_VREF_FORCE_RESET() (RCC->APB4RSTR) |= (RCC_APB4RSTR_VREFRST)
  4554. #if defined(SAI4)
  4555. #define __HAL_RCC_SAI4_FORCE_RESET() (RCC->APB4RSTR) |= (RCC_APB4RSTR_SAI4RST)
  4556. #endif /*SAI4*/
  4557. #if defined(DTS)
  4558. #define __HAL_RCC_DTS_FORCE_RESET() (RCC->APB4RSTR) |= (RCC_APB4RSTR_DTSRST)
  4559. #endif /*DTS*/
  4560. #if defined(DFSDM2_BASE)
  4561. #define __HAL_RCC_DFSDM2_FORCE_RESET() (RCC->APB4RSTR) |= (RCC_APB4RSTR_DFSDM2RST)
  4562. #endif /*DFSDM2*/
  4563. #define __HAL_RCC_APB4_RELEASE_RESET() (RCC->APB4RSTR = 0x00U)
  4564. #define __HAL_RCC_SYSCFG_RELEASE_RESET() (RCC->APB4RSTR) &= ~ (RCC_APB4RSTR_SYSCFGRST)
  4565. #define __HAL_RCC_LPUART1_RELEASE_RESET() (RCC->APB4RSTR) &= ~ (RCC_APB4RSTR_LPUART1RST)
  4566. #define __HAL_RCC_SPI6_RELEASE_RESET() (RCC->APB4RSTR) &= ~ (RCC_APB4RSTR_SPI6RST)
  4567. #define __HAL_RCC_I2C4_RELEASE_RESET() (RCC->APB4RSTR) &= ~ (RCC_APB4RSTR_I2C4RST)
  4568. #define __HAL_RCC_LPTIM2_RELEASE_RESET() (RCC->APB4RSTR) &= ~ (RCC_APB4RSTR_LPTIM2RST)
  4569. #define __HAL_RCC_LPTIM3_RELEASE_RESET() (RCC->APB4RSTR) &= ~ (RCC_APB4RSTR_LPTIM3RST)
  4570. #if defined(LPTIM4)
  4571. #define __HAL_RCC_LPTIM4_RELEASE_RESET() (RCC->APB4RSTR) &= ~ (RCC_APB4RSTR_LPTIM4RST)
  4572. #endif /*LPTIM4*/
  4573. #if defined(LPTIM5)
  4574. #define __HAL_RCC_LPTIM5_RELEASE_RESET() (RCC->APB4RSTR) &= ~ (RCC_APB4RSTR_LPTIM5RST)
  4575. #endif /*LPTIM5*/
  4576. #if defined(RCC_APB4RSTR_DAC2RST)
  4577. #define __HAL_RCC_DAC2_RELEASE_RESET() (RCC->APB4RSTR) &= ~ (RCC_APB4RSTR_DAC2RST)
  4578. #endif
  4579. #define __HAL_RCC_COMP12_RELEASE_RESET() (RCC->APB4RSTR) &= ~ (RCC_APB4RSTR_COMP12RST)
  4580. #define __HAL_RCC_VREF_RELEASE_RESET() (RCC->APB4RSTR) &= ~ (RCC_APB4RSTR_VREFRST)
  4581. #if defined(SAI4)
  4582. #define __HAL_RCC_SAI4_RELEASE_RESET() (RCC->APB4RSTR) &= ~ (RCC_APB4RSTR_SAI4RST)
  4583. #endif /*SAI4*/
  4584. #if defined(DTS)
  4585. #define __HAL_RCC_DTS_RELEASE_RESET() (RCC->APB4RSTR) &= ~ (RCC_APB4RSTR_DTSRST)
  4586. #endif /*DTS*/
  4587. #if defined(DFSDM2_BASE)
  4588. #define __HAL_RCC_DFSDM2_RELEASE_RESET() (RCC->APB4RSTR) &= ~ (RCC_APB4RSTR_DFSDM2RST)
  4589. #endif /*DFSDM2*/
  4590. /** @brief Enable or disable the AHB3 peripheral clock during Low Power (Sleep) mode.
  4591. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  4592. * power consumption.
  4593. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
  4594. * @note By default, all peripheral clocks are enabled during SLEEP mode.
  4595. */
  4596. #define __HAL_RCC_MDMA_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_MDMALPEN))
  4597. #define __HAL_RCC_DMA2D_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_DMA2DLPEN))
  4598. #if defined(JPEG)
  4599. #define __HAL_RCC_JPGDEC_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_JPGDECLPEN))
  4600. #endif /* JPEG */
  4601. #define __HAL_RCC_FLASH_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_FLASHLPEN))
  4602. #define __HAL_RCC_FMC_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_FMCLPEN))
  4603. #if defined(QUADSPI)
  4604. #define __HAL_RCC_QSPI_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_QSPILPEN))
  4605. #endif /*QUADSPI*/
  4606. #define __HAL_RCC_SDMMC1_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_SDMMC1LPEN))
  4607. #if defined(OCTOSPI1)
  4608. #define __HAL_RCC_OSPI1_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_OSPI1LPEN))
  4609. #endif /*OCTOSPI1*/
  4610. #if defined(OCTOSPI2)
  4611. #define __HAL_RCC_OSPI2_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_OSPI2LPEN))
  4612. #endif /*OCTOSPI2*/
  4613. #if defined(OCTOSPIM)
  4614. #define __HAL_RCC_IOMNGR_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_IOMNGRLPEN))
  4615. #endif /*OCTOSPIM*/
  4616. #if defined(OTFDEC1)
  4617. #define __HAL_RCC_OTFDEC1_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_OTFDEC1LPEN))
  4618. #endif /*OTFDEC1*/
  4619. #if defined(OTFDEC2)
  4620. #define __HAL_RCC_OTFDEC2_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_OTFDEC2LPEN))
  4621. #endif /*OTFDEC2*/
  4622. #if defined(GFXMMU)
  4623. #define __HAL_RCC_GFXMMU_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_GFXMMULPEN))
  4624. #endif /*GFXMMU*/
  4625. #if defined(CD_AXISRAM2_BASE)
  4626. #define __HAL_RCC_AXISRAM2_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_AXISRAM2LPEN))
  4627. #endif
  4628. #if defined(CD_AXISRAM3_BASE)
  4629. #define __HAL_RCC_AXISRAM3_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_AXISRAM3LPEN))
  4630. #endif
  4631. #define __HAL_RCC_DTCM1_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_DTCM1LPEN))
  4632. #define __HAL_RCC_DTCM2_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_DTCM2LPEN))
  4633. #define __HAL_RCC_ITCM_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_ITCMLPEN))
  4634. #if defined(RCC_AHB3LPENR_AXISRAMLPEN)
  4635. #define __HAL_RCC_D1SRAM1_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_AXISRAMLPEN))
  4636. #define __HAL_RCC_AXISRAM_CLK_SLEEP_ENABLE __HAL_RCC_D1SRAM1_CLK_SLEEP_ENABLE
  4637. #else
  4638. #define __HAL_RCC_AXISRAM1_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_AXISRAM1LPEN))
  4639. #define __HAL_RCC_D1SRAM1_CLK_SLEEP_ENABLE __HAL_RCC_AXISRAM1_CLK_SLEEP_ENABLE /* For backward compatibility */
  4640. #endif /* RCC_AHB3LPENR_AXISRAMLPEN */
  4641. #define __HAL_RCC_MDMA_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_MDMALPEN))
  4642. #define __HAL_RCC_DMA2D_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_DMA2DLPEN))
  4643. #if defined(JPEG)
  4644. #define __HAL_RCC_JPGDEC_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_JPGDECLPEN))
  4645. #endif /* JPEG */
  4646. #define __HAL_RCC_FLASH_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_FLASHLPEN))
  4647. #define __HAL_RCC_FMC_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_FMCLPEN))
  4648. #if defined(QUADSPI)
  4649. #define __HAL_RCC_QSPI_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_QSPILPEN))
  4650. #endif /*QUADSPI*/
  4651. #define __HAL_RCC_SDMMC1_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_SDMMC1LPEN))
  4652. #if defined(OCTOSPI1)
  4653. #define __HAL_RCC_OSPI1_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_OSPI1LPEN))
  4654. #endif /*OCTOSPI1*/
  4655. #if defined(OCTOSPI2)
  4656. #define __HAL_RCC_OSPI2_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_OSPI2LPEN))
  4657. #endif /*OCTOSPI2*/
  4658. #if defined(OCTOSPIM)
  4659. #define __HAL_RCC_IOMNGR_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_IOMNGRLPEN))
  4660. #endif /*OCTOSPIM*/
  4661. #if defined(OTFDEC1)
  4662. #define __HAL_RCC_OTFDEC1_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_OTFDEC1LPEN))
  4663. #endif /*OTFDEC1*/
  4664. #if defined(OTFDEC2)
  4665. #define __HAL_RCC_OTFDEC2_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_OTFDEC2LPEN))
  4666. #endif /*OTFDEC2*/
  4667. #if defined(GFXMMU)
  4668. #define __HAL_RCC_GFXMMU_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_GFXMMULPEN))
  4669. #endif /*GFXMMU*/
  4670. #if defined(CD_AXISRAM2_BASE)
  4671. #define __HAL_RCC_AXISRAM2_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_AXISRAM2LPEN))
  4672. #endif
  4673. #if defined(CD_AXISRAM3_BASE)
  4674. #define __HAL_RCC_AXISRAM3_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_AXISRAM3LPEN))
  4675. #endif
  4676. #define __HAL_RCC_DTCM1_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_DTCM1LPEN))
  4677. #define __HAL_RCC_DTCM2_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_DTCM2LPEN))
  4678. #define __HAL_RCC_ITCM_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_ITCMLPEN))
  4679. #if defined(RCC_AHB3LPENR_AXISRAMLPEN)
  4680. #define __HAL_RCC_D1SRAM1_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_AXISRAMLPEN))
  4681. #define __HAL_RCC_AXISRAM_CLK_SLEEP_DISABLE __HAL_RCC_D1SRAM1_CLK_SLEEP_DISABLE
  4682. #else
  4683. #define __HAL_RCC_AXISRAM1_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_AXISRAM1LPEN))
  4684. #define __HAL_RCC_D1SRAM1_CLK_SLEEP_DISABLE __HAL_RCC_AXISRAM1_CLK_SLEEP_DISABLE /* For backward compatibility */
  4685. #endif /* RCC_AHB3LPENR_AXISRAMLPEN */
  4686. /** @brief Get the enable or disable status of the AHB3 peripheral clock during Low Poser (Sleep) mode.
  4687. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  4688. * power consumption.
  4689. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
  4690. * @note By default, all peripheral clocks are enabled during SLEEP mode.
  4691. */
  4692. #define __HAL_RCC_MDMA_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_MDMALPEN) != 0U)
  4693. #define __HAL_RCC_DMA2D_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_DMA2DLPEN) != 0U)
  4694. #if defined(JPEG)
  4695. #define __HAL_RCC_JPGDEC_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_JPGDECLPEN) != 0U)
  4696. #endif /* JPEG */
  4697. #define __HAL_RCC_FLASH_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_FLASHLPEN) != 0U)
  4698. #define __HAL_RCC_FMC_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_FMCLPEN) != 0U)
  4699. #if defined(QUADSPI)
  4700. #define __HAL_RCC_QSPI_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_QSPILPEN) != 0U)
  4701. #endif /*QUADSPI*/
  4702. #define __HAL_RCC_SDMMC1_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_SDMMC1LPEN) != 0U)
  4703. #if defined(OCTOSPI1)
  4704. #define __HAL_RCC_OSPI1_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_OSPI1LPEN) != 0U)
  4705. #endif /*OCTOSPI1*/
  4706. #if defined(OCTOSPI2)
  4707. #define __HAL_RCC_OSPI2_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_OSPI2LPEN) != 0U)
  4708. #endif /*OCTOSPI2*/
  4709. #if defined(OCTOSPIM)
  4710. #define __HAL_RCC_IOMNGR_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_IOMNGRLPEN) != 0U)
  4711. #endif /*OCTOSPIM*/
  4712. #if defined(OTFDEC1)
  4713. #define __HAL_RCC_OTFDEC1_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_OTFDEC1LPEN) != 0U)
  4714. #endif /*OTFDEC1*/
  4715. #if defined(OTFDEC2)
  4716. #define __HAL_RCC_OTFDEC2_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_OTFDEC2LPEN) != 0U)
  4717. #endif /*OTFDEC2*/
  4718. #if defined(GFXMMU)
  4719. #define __HAL_RCC_GFXMMU_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_GFXMMULPEN) != 0U)
  4720. #endif /*GFXMMU*/
  4721. #if defined(CD_AXISRAM2_BASE)
  4722. #define __HAL_RCC_AXISRAM2_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_AXISRAM2LPEN) != 0U)
  4723. #endif
  4724. #if defined(CD_AXISRAM3_BASE)
  4725. #define __HAL_RCC_AXISRAM3_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_AXISRAM3LPEN) != 0U)
  4726. #endif
  4727. #define __HAL_RCC_DTCM1_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_DTCM1LPEN) != 0U)
  4728. #define __HAL_RCC_DTCM2_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_DTCM2LPEN) != 0U)
  4729. #define __HAL_RCC_ITCM_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_ITCMLPEN) != 0U)
  4730. #if defined(RCC_AHB3LPENR_AXISRAMLPEN)
  4731. #define __HAL_RCC_D1SRAM1_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_AXISRAMLPEN) != 0U)
  4732. #else
  4733. #define __HAL_RCC_AXISRAM1_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_AXISRAM1LPEN) != 0U)
  4734. #endif
  4735. #define __HAL_RCC_MDMA_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_MDMALPEN) == 0U)
  4736. #define __HAL_RCC_DMA2D_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_DMA2DLPEN) == 0U)
  4737. #if defined(JPEG)
  4738. #define __HAL_RCC_JPGDEC_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_JPGDECLPEN) == 0U)
  4739. #endif /* JPEG */
  4740. #define __HAL_RCC_FLASH_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_FLASHLPEN) == 0U)
  4741. #define __HAL_RCC_FMC_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_FMCLPEN) == 0U)
  4742. #if defined(QUADSPI)
  4743. #define __HAL_RCC_QSPI_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_QSPILPEN) == 0U)
  4744. #endif /*QUADSPI*/
  4745. #define __HAL_RCC_SDMMC1_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_SDMMC1LPEN) == 0U)
  4746. #if defined(OCTOSPI1)
  4747. #define __HAL_RCC_OSPI1_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_OSPI1LPEN) == 0U)
  4748. #endif /*OCTOSPI1*/
  4749. #if defined(OCTOSPI2)
  4750. #define __HAL_RCC_OSPI2_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_OSPI2LPEN) == 0U)
  4751. #endif /*OCTOSPI2*/
  4752. #if defined(OCTOSPIM)
  4753. #define __HAL_RCC_IOMNGR_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_IOMNGRLPEN) == 0U)
  4754. #endif /*OCTOSPIM*/
  4755. #if defined(OTFDEC1)
  4756. #define __HAL_RCC_OTFDEC1_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_OTFDEC1LPEN) == 0U)
  4757. #endif /*OTFDEC1*/
  4758. #if defined(OTFDEC2)
  4759. #define __HAL_RCC_OTFDEC2_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_OTFDEC2LPEN) == 0U)
  4760. #endif /*OTFDEC2*/
  4761. #if defined(GFXMMU)
  4762. #define __HAL_RCC_GFXMMU_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_GFXMMULPEN) == 0U)
  4763. #endif /*GFXMMU*/
  4764. #if defined(CD_AXISRAM2_BASE)
  4765. #define __HAL_RCC_AXISRAM2_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_AXISRAM2LPEN) == 0U)
  4766. #endif
  4767. #if defined(CD_AXISRAM3_BASE)
  4768. #define __HAL_RCC_AXISRAM3_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_AXISRAM3LPEN) == 0U)
  4769. #endif
  4770. #define __HAL_RCC_DTCM1_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_DTCM1LPEN) == 0U)
  4771. #define __HAL_RCC_DTCM2_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_DTCM2LPEN) == 0U)
  4772. #define __HAL_RCC_ITCM_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_ITCMLPEN) == 0U)
  4773. #if defined(RCC_AHB3LPENR_AXISRAMLPEN)
  4774. #define __HAL_RCC_D1SRAM1_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_AXISRAMLPEN) == 0U)
  4775. #else
  4776. #define __HAL_RCC_AXISRAM1_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_AXISRAML1PEN) == 0U)
  4777. #endif /* RCC_AHB3LPENR_AXISRAMLPEN */
  4778. /** @brief ENABLE or disable the AHB1 peripheral clock during Low Power (Sleep) mode.
  4779. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  4780. * power consumption.
  4781. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  4782. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  4783. */
  4784. #define __HAL_RCC_DMA1_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_DMA1LPEN))
  4785. #define __HAL_RCC_DMA2_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_DMA2LPEN))
  4786. #define __HAL_RCC_ADC12_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_ADC12LPEN))
  4787. #if defined(RCC_AHB1LPENR_CRCLPEN)
  4788. #define __HAL_RCC_CRC_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_CRCLPEN))
  4789. #endif
  4790. #if defined(ETH)
  4791. #define __HAL_RCC_ETH1MAC_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_ETH1MACLPEN))
  4792. #endif /*ETH*/
  4793. #if defined(DUAL_CORE)
  4794. #define __HAL_RCC_ART_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_ARTLPEN))
  4795. #endif /*DUAL_CORE*/
  4796. #if defined(ETH)
  4797. #define __HAL_RCC_ETH1TX_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_ETH1TXLPEN))
  4798. #define __HAL_RCC_ETH1RX_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_ETH1RXLPEN))
  4799. #endif /*ETH*/
  4800. #define __HAL_RCC_USB1_OTG_HS_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_USB1OTGHSLPEN))
  4801. #define __HAL_RCC_USB1_OTG_HS_ULPI_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_USB1OTGHSULPILPEN))
  4802. #if defined(USB2_OTG_FS)
  4803. #define __HAL_RCC_USB2_OTG_FS_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_USB2OTGHSLPEN))
  4804. #define __HAL_RCC_USB2_OTG_FS_ULPI_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_USB2OTGHSULPILPEN))
  4805. #endif /* USB2_OTG_FS */
  4806. #define __HAL_RCC_DMA1_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~ (RCC_AHB1LPENR_DMA1LPEN))
  4807. #define __HAL_RCC_DMA2_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~ (RCC_AHB1LPENR_DMA2LPEN))
  4808. #define __HAL_RCC_ADC12_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~ (RCC_AHB1LPENR_ADC12LPEN))
  4809. #if defined(RCC_AHB1LPENR_CRCLPEN)
  4810. #define __HAL_RCC_CRC_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~ (RCC_AHB1LPENR_CRCLPEN))
  4811. #endif
  4812. #if defined(ETH)
  4813. #define __HAL_RCC_ETH1MAC_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~ (RCC_AHB1LPENR_ETH1MACLPEN))
  4814. #endif /*ETH*/
  4815. #if defined(DUAL_CORE)
  4816. #define __HAL_RCC_ART_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~ (RCC_AHB1LPENR_ARTLPEN))
  4817. #endif /*DUAL_CORE*/
  4818. #if defined(ETH)
  4819. #define __HAL_RCC_ETH1TX_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~ (RCC_AHB1LPENR_ETH1TXLPEN))
  4820. #define __HAL_RCC_ETH1RX_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~ (RCC_AHB1LPENR_ETH1RXLPEN))
  4821. #endif /*ETH*/
  4822. #define __HAL_RCC_USB1_OTG_HS_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~ (RCC_AHB1LPENR_USB1OTGHSLPEN))
  4823. #define __HAL_RCC_USB1_OTG_HS_ULPI_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~ (RCC_AHB1LPENR_USB1OTGHSULPILPEN))
  4824. #if defined(USB2_OTG_FS)
  4825. #define __HAL_RCC_USB2_OTG_FS_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~ (RCC_AHB1LPENR_USB2OTGHSLPEN))
  4826. #define __HAL_RCC_USB2_OTG_FS_ULPI_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~ (RCC_AHB1LPENR_USB2OTGHSULPILPEN))
  4827. #endif /* USB2_OTG_FS */
  4828. /** @brief Get the enable or disable status of the AHB1 peripheral clock during Low Poser (Sleep) mode.
  4829. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  4830. * power consumption.
  4831. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
  4832. * @note By default, all peripheral clocks are enabled during SLEEP mode.
  4833. */
  4834. #define __HAL_RCC_DMA1_IS_CLK_SLEEP_ENABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_DMA1LPEN)) != 0U)
  4835. #define __HAL_RCC_DMA2_IS_CLK_SLEEP_ENABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_DMA2LPEN)) != 0U)
  4836. #define __HAL_RCC_ADC12_IS_CLK_SLEEP_ENABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_ADC12LPEN)) != 0U)
  4837. #if defined(RCC_AHB1LPENR_CRCLPEN)
  4838. #define __HAL_RCC_CRC_IS_CLK_SLEEP_ENABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_CRCLPEN)) != 0U)
  4839. #endif
  4840. #if defined(ETH)
  4841. #define __HAL_RCC_ETH1MAC_IS_CLK_SLEEP_ENABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_ETH1MACLPEN)) != 0U)
  4842. #endif /*ETH*/
  4843. #if defined(DUAL_CORE)
  4844. #define __HAL_RCC_ART_IS_CLK_SLEEP_ENABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_ARTLPEN)) != 0U)
  4845. #endif /*DUAL_CORE*/
  4846. #if defined(ETH)
  4847. #define __HAL_RCC_ETH1TX_IS_CLK_SLEEP_ENABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_ETH1TXLPEN)) != 0U)
  4848. #define __HAL_RCC_ETH1RX_IS_CLK_SLEEP_ENABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_ETH1RXLPEN)) != 0U)
  4849. #endif /*ETH*/
  4850. #define __HAL_RCC_USB1_OTG_HS_IS_CLK_SLEEP_ENABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_USB1OTGHSLPEN)) != 0U)
  4851. #define __HAL_RCC_USB1_OTG_HS_ULPI_IS_CLK_SLEEP_ENABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_USB1OTGHSULPILPEN)) != 0U)
  4852. #if defined(USB2_OTG_FS)
  4853. #define __HAL_RCC_USB2_OTG_FS_IS_CLK_SLEEP_ENABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_USB2OTGHSLPEN)) != 0U)
  4854. #define __HAL_RCC_USB2_OTG_FS_ULPI_IS_CLK_SLEEP_ENABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_USB2OTGHSULPILPEN)) != 0U)
  4855. #endif /* USB2_OTG_FS */
  4856. #define __HAL_RCC_DMA1_IS_CLK_SLEEP_DISABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_DMA1LPEN)) == 0U)
  4857. #define __HAL_RCC_DMA2_IS_CLK_SLEEP_DISABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_DMA2LPEN)) == 0U)
  4858. #define __HAL_RCC_ADC12_IS_CLK_SLEEP_DISABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_ADC12LPEN)) == 0U)
  4859. #if defined(RCC_AHB1LPENR_CRCLPEN)
  4860. #define __HAL_RCC_CRC_IS_CLK_SLEEP_DISABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_CRCLPEN)) == 0U)
  4861. #endif
  4862. #if defined(ETH)
  4863. #define __HAL_RCC_ETH1MAC_IS_CLK_SLEEP_DISABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_ETH1MACLPEN)) == 0U)
  4864. #endif /* ETH */
  4865. #if defined(DUAL_CORE)
  4866. #define __HAL_RCC_ART_IS_CLK_SLEEP_DISABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_ARTLPEN)) == 0U)
  4867. #endif /*DUAL_CORE*/
  4868. #if defined(ETH)
  4869. #define __HAL_RCC_ETH1TX_IS_CLK_SLEEP_DISABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_ETH1TXLPEN)) == 0U)
  4870. #define __HAL_RCC_ETH1RX_IS_CLK_SLEEP_DISABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_ETH1RXLPEN)) == 0U)
  4871. #endif /* ETH */
  4872. #define __HAL_RCC_USB1_OTG_HS_IS_CLK_SLEEP_DISABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_USB1OTGHSLPEN)) == 0U)
  4873. #define __HAL_RCC_USB1_OTG_HS_ULPI_IS_CLK_SLEEP_DISABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_USB1OTGHSULPILPEN)) == 0U)
  4874. #if defined(USB2_OTG_FS)
  4875. #define __HAL_RCC_USB2_OTG_FS_IS_CLK_SLEEP_DISABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_USB2OTGHSLPEN)) == 0U)
  4876. #define __HAL_RCC_USB2_OTG_FS_ULPI_IS_CLK_SLEEP_DISABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_USB2OTGHSULPILPEN)) == 0U)
  4877. #endif /* USB2_OTG_FS */
  4878. /** @brief ENABLE or disable the AHB2 peripheral clock during Low Power (Sleep) mode.
  4879. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  4880. * power consumption.
  4881. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  4882. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  4883. */
  4884. #if defined(DCMI) && defined(PSSI)
  4885. #define __HAL_RCC_DCMI_PSSI_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_DCMI_PSSILPEN))
  4886. #define __HAL_RCC_DCMI_CLK_SLEEP_ENABLE() __HAL_RCC_DCMI_PSSI_CLK_SLEEP_ENABLE() /* for API backward compatibility*/
  4887. #else
  4888. #define __HAL_RCC_DCMI_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_DCMILPEN))
  4889. #endif /* DCMI && PSSI */
  4890. #if defined(CRYP)
  4891. #define __HAL_RCC_CRYP_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_CRYPLPEN))
  4892. #endif /* CRYP */
  4893. #if defined(HASH)
  4894. #define __HAL_RCC_HASH_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_HASHLPEN))
  4895. #endif /* HASH */
  4896. #define __HAL_RCC_RNG_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_RNGLPEN))
  4897. #define __HAL_RCC_SDMMC2_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_SDMMC2LPEN))
  4898. #if defined(RCC_AHB2LPENR_DFSDMDMALPEN)
  4899. #define __HAL_RCC_DFSDMDMA_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_DFSDMDMALPEN))
  4900. #endif
  4901. #if defined(FMAC)
  4902. #define __HAL_RCC_FMAC_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_FMACLPEN))
  4903. #endif /* FMAC */
  4904. #if defined(CORDIC)
  4905. #define __HAL_RCC_CORDIC_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_CORDICLPEN))
  4906. #endif /* CORDIC */
  4907. #if defined(RCC_AHB2LPENR_D2SRAM1LPEN)
  4908. #define __HAL_RCC_D2SRAM1_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_D2SRAM1LPEN))
  4909. #else
  4910. #define __HAL_RCC_AHBSRAM1_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_AHBSRAM1LPEN))
  4911. #endif /* RCC_AHB2LPENR_D2SRAM1LPEN */
  4912. #if defined(RCC_AHB2LPENR_D2SRAM2LPEN)
  4913. #define __HAL_RCC_D2SRAM2_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_D2SRAM2LPEN))
  4914. #else
  4915. #define __HAL_RCC_AHBSRAM2_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_AHBSRAM2LPEN))
  4916. #endif /* RCC_AHB2LPENR_D2SRAM2LPEN */
  4917. #if defined(RCC_AHB2LPENR_D2SRAM3LPEN)
  4918. #define __HAL_RCC_D2SRAM3_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_D2SRAM3LPEN))
  4919. #endif
  4920. #if defined(DCMI) && defined(PSSI)
  4921. #define __HAL_RCC_DCMI_PSSI_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~ (RCC_AHB2LPENR_DCMI_PSSILPEN))
  4922. #define __HAL_RCC_DCMI_CLK_SLEEP_DISABLE() __HAL_RCC_DCMI_PSSI_CLK_SLEEP_DISABLE() /* for API backward compatibility*/
  4923. #else
  4924. #define __HAL_RCC_DCMI_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~ (RCC_AHB2LPENR_DCMILPEN))
  4925. #endif /* DCMI && PSSI */
  4926. #if defined(CRYP)
  4927. #define __HAL_RCC_CRYP_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~ (RCC_AHB2LPENR_CRYPLPEN))
  4928. #endif /* CRYP */
  4929. #if defined(HASH)
  4930. #define __HAL_RCC_HASH_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~ (RCC_AHB2LPENR_HASHLPEN))
  4931. #endif /* HASH */
  4932. #define __HAL_RCC_RNG_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~ (RCC_AHB2LPENR_RNGLPEN))
  4933. #define __HAL_RCC_SDMMC2_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~ (RCC_AHB2LPENR_SDMMC2LPEN))
  4934. #if defined(RCC_AHB2LPENR_DFSDMDMALPEN)
  4935. #define __HAL_RCC_DFSDMDMA_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~ (RCC_AHB2LPENR_DFSDMDMALPEN))
  4936. #endif
  4937. #if defined(FMAC)
  4938. #define __HAL_RCC_FMAC_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~ (RCC_AHB2LPENR_FMACLPEN))
  4939. #endif /* FMAC */
  4940. #if defined(CORDIC)
  4941. #define __HAL_RCC_CORDIC_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~ (RCC_AHB2LPENR_CORDICLPEN))
  4942. #endif /* CORDIC */
  4943. #if defined(RCC_AHB2LPENR_D2SRAM1LPEN)
  4944. #define __HAL_RCC_D2SRAM1_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~ (RCC_AHB2LPENR_D2SRAM1LPEN))
  4945. #else
  4946. #define __HAL_RCC_AHBSRAM1_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~ (RCC_AHB2LPENR_AHBSRAM1LPEN))
  4947. #endif /* RCC_AHB2LPENR_D2SRAM1LPEN */
  4948. #if defined(RCC_AHB2LPENR_D2SRAM2LPEN)
  4949. #define __HAL_RCC_D2SRAM2_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~ (RCC_AHB2LPENR_D2SRAM2LPEN))
  4950. #else
  4951. #define __HAL_RCC_AHBSRAM2_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~ (RCC_AHB2LPENR_AHBSRAM2LPEN))
  4952. #endif /* RCC_AHB2LPENR_D2SRAM2LPEN */
  4953. #if defined(RCC_AHB2LPENR_D2SRAM3LPEN)
  4954. #define __HAL_RCC_D2SRAM3_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~ (RCC_AHB2LPENR_D2SRAM3LPEN))
  4955. #endif
  4956. /** @brief Get the enable or disable status of the AHB2 peripheral clock during Low Poser (Sleep) mode.
  4957. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  4958. * power consumption.
  4959. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
  4960. * @note By default, all peripheral clocks are enabled during SLEEP mode.
  4961. */
  4962. #if defined(DCMI) && defined(PSSI)
  4963. #define __HAL_RCC_DCMI_PSSI_IS_CLK_SLEEP_ENABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_DCMI_PSSILPEN)) != 0U)
  4964. #define __HAL_RCC_DCMI_IS_CLK_SLEEP_ENABLED() __HAL_RCC_DCMI_PSSI_IS_CLK_SLEEP_ENABLED() /* for API backward compatibility*/
  4965. #else
  4966. #define __HAL_RCC_DCMI_IS_CLK_SLEEP_ENABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_DCMILPEN)) != 0U)
  4967. #endif /* DCMI && PSSI */
  4968. #if defined(CRYP)
  4969. #define __HAL_RCC_CRYP_IS_CLK_SLEEP_ENABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_CRYPLPEN)) != 0U)
  4970. #endif /* CRYP */
  4971. #if defined(HASH)
  4972. #define __HAL_RCC_HASH_IS_CLK_SLEEP_ENABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_HASHLPEN)) != 0U)
  4973. #endif /* HASH */
  4974. #define __HAL_RCC_RNG_IS_CLK_SLEEP_ENABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_RNGLPEN)) != 0U)
  4975. #define __HAL_RCC_SDMMC2_IS_CLK_SLEEP_ENABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_SDMMC2LPEN)) != 0U)
  4976. #if defined(RCC_AHB2LPENR_DFSDMDMALPEN)
  4977. #define __HAL_RCC_DFSDMDMA_IS_CLK_SLEEP_ENABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_DFSDMDMALPEN)) != 0U)
  4978. #endif
  4979. #if defined(FMAC)
  4980. #define __HAL_RCC_FMAC_IS_CLK_SLEEP_ENABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_FMACLPEN)) != 0U)
  4981. #endif /* FMAC */
  4982. #if defined(CORDIC)
  4983. #define __HAL_RCC_CORDIC_IS_CLK_SLEEP_ENABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_CORDICLPEN)) != 0U)
  4984. #endif /* CORDIC */
  4985. #if defined(RCC_AHB2LPENR_D2SRAM1LPEN)
  4986. #define __HAL_RCC_D2SRAM1_IS_CLK_SLEEP_ENABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_D2SRAM1LPEN)) != 0U)
  4987. #else
  4988. #define __HAL_RCC_AHBSRAM1_IS_CLK_SLEEP_ENABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_AHBSRAM1LPEN)) != 0U)
  4989. #endif /* RCC_AHB2LPENR_D2SRAM1LPEN */
  4990. #if defined(RCC_AHB2LPENR_D2SRAM2LPEN)
  4991. #define __HAL_RCC_D2SRAM2_IS_CLK_SLEEP_ENABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_D2SRAM2LPEN)) != 0U)
  4992. #else
  4993. #define __HAL_RCC_AHBSRAM2_IS_CLK_SLEEP_ENABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_AHBSRAM2LPEN)) != 0U)
  4994. #endif /* RCC_AHB2LPENR_D2SRAM2LPEN */
  4995. #if defined(RCC_AHB2LPENR_D2SRAM3LPEN)
  4996. #define __HAL_RCC_D2SRAM3_IS_CLK_SLEEP_ENABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_D2SRAM3LPEN)) != 0U)
  4997. #endif /* RCC_AHB2LPENR_D2SRAM3LPEN */
  4998. #if defined(DCMI) && defined(PSSI)
  4999. #define __HAL_RCC_DCMI_PSSI_IS_CLK_SLEEP_DISABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_DCMI_PSSILPEN)) == 0U)
  5000. #define __HAL_RCC_DCMI_IS_CLK_SLEEP_DISABLED() __HAL_RCC_DCMI_PSSI_IS_CLK_SLEEP_DISABLED() /* for API backward compatibility*/
  5001. #else
  5002. #define __HAL_RCC_DCMI_IS_CLK_SLEEP_DISABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_DCMILPEN)) == 0U)
  5003. #endif /* DCMI && PSSI */
  5004. #if defined(CRYP)
  5005. #define __HAL_RCC_CRYP_IS_CLK_SLEEP_DISABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_CRYPLPEN)) == 0U)
  5006. #endif /* CRYP */
  5007. #if defined(HASH)
  5008. #define __HAL_RCC_HASH_IS_CLK_SLEEP_DISABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_HASHLPEN)) == 0U)
  5009. #endif /* HASH */
  5010. #define __HAL_RCC_RNG_IS_CLK_SLEEP_DISABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_RNGLPEN)) == 0U)
  5011. #if defined(RCC_AHB2LPENR_DFSDMDMALPEN)
  5012. #define __HAL_RCC_DFSDMDMA_IS_CLK_SLEEP_DISABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_DFSDMDMALPEN)) == 0U)
  5013. #endif
  5014. #define __HAL_RCC_SDMMC2_IS_CLK_SLEEP_DISABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_SDMMC2LPEN)) == 0U)
  5015. #if defined(FMAC)
  5016. #define __HAL_RCC_FMAC_IS_CLK_SLEEP_DISABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_FMACLPEN)) == 0U)
  5017. #endif /* FMAC */
  5018. #if defined(CORDIC)
  5019. #define __HAL_RCC_CORDIC_IS_CLK_SLEEP_DISABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_CORDICLPEN)) == 0U)
  5020. #endif /* CORDIC */
  5021. #if defined(RCC_AHB2LPENR_D2SRAM1LPEN)
  5022. #define __HAL_RCC_D2SRAM1_IS_CLK_SLEEP_DISABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_D2SRAM1LPEN)) == 0U)
  5023. #else
  5024. #define __HAL_RCC_AHBSRAM1_IS_CLK_SLEEP_DISABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_AHBSRAM1LPEN)) == 0U)
  5025. #endif /* RCC_AHB2LPENR_D2SRAM1LPEN */
  5026. #if defined(RCC_AHB2LPENR_D2SRAM2LPEN)
  5027. #define __HAL_RCC_D2SRAM2_IS_CLK_SLEEP_DISABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_D2SRAM2LPEN)) == 0U)
  5028. #else
  5029. #define __HAL_RCC_AHBSRAM2_IS_CLK_SLEEP_DISABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_AHBSRAM2LPEN)) == 0U)
  5030. #endif /* RCC_AHB2LPENR_D2SRAM2LPEN */
  5031. #if defined(RCC_AHB2LPENR_D2SRAM3LPEN)
  5032. #define __HAL_RCC_D2SRAM3_IS_CLK_SLEEP_DISABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_D2SRAM3LPEN)) == 0U)
  5033. #endif /* RCC_AHB2LPENR_D2SRAM1LPEN*/
  5034. /** @brief ENABLE or disable the AHB4 peripheral clock during Low Power (Sleep) mode.
  5035. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5036. * power consumption.
  5037. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  5038. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  5039. */
  5040. #define __HAL_RCC_GPIOA_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOALPEN)
  5041. #define __HAL_RCC_GPIOB_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOBLPEN)
  5042. #define __HAL_RCC_GPIOC_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOCLPEN)
  5043. #define __HAL_RCC_GPIOD_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_GPIODLPEN)
  5044. #define __HAL_RCC_GPIOE_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOELPEN)
  5045. #define __HAL_RCC_GPIOF_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOFLPEN)
  5046. #define __HAL_RCC_GPIOG_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOGLPEN)
  5047. #define __HAL_RCC_GPIOH_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOHLPEN)
  5048. #if defined(GPIOI)
  5049. #define __HAL_RCC_GPIOI_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOILPEN)
  5050. #endif /* GPIOI */
  5051. #define __HAL_RCC_GPIOJ_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOJLPEN)
  5052. #define __HAL_RCC_GPIOK_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOKLPEN)
  5053. #if defined(RCC_AHB4LPENR_CRCLPEN)
  5054. #define __HAL_RCC_CRC_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_CRCLPEN)
  5055. #endif
  5056. #if defined(BDMA2)
  5057. #define __HAL_RCC_BDMA2_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_BDMA2LPEN)
  5058. #define __HAL_RCC_BDMA_CLK_SLEEP_ENABLE __HAL_RCC_BDMA2_CLK_SLEEP_ENABLE /* for API backward compatibility*/
  5059. #else
  5060. #define __HAL_RCC_BDMA_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_BDMALPEN)
  5061. #endif /* BDMA2 */
  5062. #if defined(ADC3)
  5063. #define __HAL_RCC_ADC3_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_ADC3LPEN)
  5064. #endif /* ADC3 */
  5065. #define __HAL_RCC_BKPRAM_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_BKPRAMLPEN)
  5066. #if defined(RCC_AHB4LPENR_SRDSRAMLPEN)
  5067. #define __HAL_RCC_SRDSRAM_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR |= (RCC_AHB4LPENR_SRDSRAMLPEN))
  5068. #define __HAL_RCC_D3SRAM1_CLK_SLEEP_ENABLE __HAL_RCC_SRDSRAM_CLK_SLEEP_ENABLE /* for API backward compatibility*/
  5069. #else
  5070. #define __HAL_RCC_D3SRAM1_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR |= (RCC_AHB4LPENR_D3SRAM1LPEN))
  5071. #endif /* RCC_AHB4LPENR_SRDSRAMLPEN */
  5072. #define __HAL_RCC_GPIOA_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOALPEN)
  5073. #define __HAL_RCC_GPIOB_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOBLPEN)
  5074. #define __HAL_RCC_GPIOC_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOCLPEN)
  5075. #define __HAL_RCC_GPIOD_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIODLPEN)
  5076. #define __HAL_RCC_GPIOE_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOELPEN)
  5077. #define __HAL_RCC_GPIOF_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOFLPEN)
  5078. #define __HAL_RCC_GPIOG_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOGLPEN)
  5079. #define __HAL_RCC_GPIOH_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOHLPEN)
  5080. #if defined(GPIOI)
  5081. #define __HAL_RCC_GPIOI_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOILPEN)
  5082. #endif /* GPIOI */
  5083. #define __HAL_RCC_GPIOJ_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOJLPEN)
  5084. #define __HAL_RCC_GPIOK_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOKLPEN)
  5085. #if defined(RCC_AHB4LPENR_CRCLPEN)
  5086. #define __HAL_RCC_CRC_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_CRCLPEN)
  5087. #endif
  5088. #if defined(BDMA2)
  5089. #define __HAL_RCC_BDMA2_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_BDMA2LPEN)
  5090. #define __HAL_RCC_BDMA_CLK_SLEEP_DISABLE __HAL_RCC_BDMA2_CLK_SLEEP_DISABLE /* For API backward compatibility*/
  5091. #else
  5092. #define __HAL_RCC_BDMA_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_BDMALPEN)
  5093. #endif /*BDMA2*/
  5094. #if defined(ADC3)
  5095. #define __HAL_RCC_ADC3_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_ADC3LPEN)
  5096. #endif /*ADC3*/
  5097. #define __HAL_RCC_BKPRAM_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_BKPRAMLPEN)
  5098. #if defined(RCC_AHB4LPENR_SRDSRAMLPEN)
  5099. #define __HAL_RCC_SRDSRAM_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR &= ~ (RCC_AHB4LPENR_SRDSRAMLPEN))
  5100. #define __HAL_RCC_D3SRAM1_CLK_SLEEP_DISABLE __HAL_RCC_SRDSRAM_CLK_SLEEP_DISABLE
  5101. #else
  5102. #define __HAL_RCC_D3SRAM1_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR &= ~ (RCC_AHB4LPENR_D3SRAM1LPEN))
  5103. #endif
  5104. /** @brief Get the enable or disable status of the AHB4 peripheral clock during Low Poser (Sleep) mode.
  5105. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5106. * power consumption.
  5107. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
  5108. * @note By default, all peripheral clocks are enabled during SLEEP mode.
  5109. */
  5110. #define __HAL_RCC_GPIOA_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOALPEN)) != 0U)
  5111. #define __HAL_RCC_GPIOB_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOBLPEN)) != 0U)
  5112. #define __HAL_RCC_GPIOC_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOCLPEN)) != 0U)
  5113. #define __HAL_RCC_GPIOD_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIODLPEN)) != 0U)
  5114. #define __HAL_RCC_GPIOE_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOELPEN)) != 0U)
  5115. #define __HAL_RCC_GPIOF_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOFLPEN)) != 0U)
  5116. #define __HAL_RCC_GPIOG_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOGLPEN)) != 0U)
  5117. #define __HAL_RCC_GPIOH_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOHLPEN)) != 0U)
  5118. #if defined(GPIOI)
  5119. #define __HAL_RCC_GPIOI_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOILPEN)) != 0U)
  5120. #endif /* GPIOI */
  5121. #define __HAL_RCC_GPIOJ_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOJLPEN)) != 0U)
  5122. #define __HAL_RCC_GPIOK_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOKLPEN)) != 0U)
  5123. #if defined(RCC_AHB4LPENR_CRCLPEN)
  5124. #define __HAL_RCC_CRC_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_CRCLPEN)) != 0U)
  5125. #endif
  5126. #if defined(BDMA2)
  5127. #define __HAL_RCC_BDMA2_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_BDMA2LPEN)) != 0U)
  5128. #define __HAL_RCC_BDMA_IS_CLK_SLEEP_ENABLED __HAL_RCC_BDMA2_IS_CLK_SLEEP_ENABLED /* For API backward compatibility*/
  5129. #else
  5130. #define __HAL_RCC_BDMA_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_BDMALPEN)) != 0U)
  5131. #endif /*BDMA2*/
  5132. #if defined(ADC3)
  5133. #define __HAL_RCC_ADC3_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_ADC3LPEN)) != 0U)
  5134. #endif /*ADC3*/
  5135. #define __HAL_RCC_BKPRAM_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_BKPRAMLPEN)) != 0U)
  5136. #if defined(RCC_AHB4LPENR_SRDSRAMLPEN)
  5137. #define __HAL_RCC_SRDSRAM_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_SRDSRAMLPEN)) != 0U)
  5138. #define __HAL_RCC_D3SRAM1_IS_CLK_SLEEP_ENABLED __HAL_RCC_SRDSRAM_IS_CLK_SLEEP_ENABLED /* For API backward compatibility*/
  5139. #else
  5140. #define __HAL_RCC_D3SRAM1_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_D3SRAM1LPEN)) != 0U)
  5141. #endif
  5142. #define __HAL_RCC_GPIOA_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOALPEN)) == 0U)
  5143. #define __HAL_RCC_GPIOB_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOBLPEN)) == 0U)
  5144. #define __HAL_RCC_GPIOC_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOCLPEN)) == 0U)
  5145. #define __HAL_RCC_GPIOD_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIODLPEN)) == 0U)
  5146. #define __HAL_RCC_GPIOE_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOELPEN)) == 0U)
  5147. #define __HAL_RCC_GPIOF_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOFLPEN)) == 0U)
  5148. #define __HAL_RCC_GPIOG_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOGLPEN)) == 0U)
  5149. #define __HAL_RCC_GPIOH_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOHLPEN)) == 0U)
  5150. #if defined(GPIOI)
  5151. #define __HAL_RCC_GPIOI_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOILPEN)) == 0U)
  5152. #endif /* GPIOI */
  5153. #define __HAL_RCC_GPIOJ_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOJLPEN)) == 0U)
  5154. #define __HAL_RCC_GPIOK_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOKLPEN)) == 0U)
  5155. #if defined(RCC_AHB4LPENR_CRCLPEN)
  5156. #define __HAL_RCC_CRC_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_CRCLPEN)) == 0U)
  5157. #endif
  5158. #if defined(BDMA2)
  5159. #define __HAL_RCC_BDMA2_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_BDMA2LPEN)) == 0U)
  5160. #define __HAL_RCC_BDMA_IS_CLK_SLEEP_DISABLED __HAL_RCC_BDMA2_IS_CLK_SLEEP_DISABLED /* For API backward compatibility*/
  5161. #else
  5162. #define __HAL_RCC_BDMA_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_BDMALPEN)) == 0U)
  5163. #endif /*BDMA2*/
  5164. #if defined(ADC3)
  5165. #define __HAL_RCC_ADC3_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_ADC3LPEN)) == 0U)
  5166. #endif /*ADC3*/
  5167. #define __HAL_RCC_BKPRAM_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_BKPRAMLPEN)) == 0U)
  5168. #if defined(RCC_AHB4LPENR_SRDSRAMLPEN)
  5169. #define __HAL_RCC_SRDSRAM_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_SRDSRAMLPEN)) == 0U)
  5170. #define __HAL_RCC_D3SRAM1_IS_CLK_SLEEP_DISABLED __HAL_RCC_SRDSRAM_IS_CLK_SLEEP_DISABLED /* For API backward compatibility*/
  5171. #else
  5172. #define __HAL_RCC_D3SRAM1_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_D3SRAM1LPEN)) == 0U)
  5173. #endif
  5174. /** @brief ENABLE or disable the APB3 peripheral clock during Low Power (Sleep) mode.
  5175. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5176. * power consumption.
  5177. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  5178. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  5179. */
  5180. #if defined(LTDC)
  5181. #define __HAL_RCC_LTDC_CLK_SLEEP_ENABLE() (RCC->APB3LPENR) |= (RCC_APB3LPENR_LTDCLPEN)
  5182. #endif /* LTDC */
  5183. #if defined(DSI)
  5184. #define __HAL_RCC_DSI_CLK_SLEEP_ENABLE() (RCC->APB3LPENR) |= (RCC_APB3LPENR_DSILPEN)
  5185. #endif /*DSI*/
  5186. #define __HAL_RCC_WWDG1_CLK_SLEEP_ENABLE() (RCC->APB3LPENR) |= (RCC_APB3LPENR_WWDG1LPEN)
  5187. #if defined(LTDC)
  5188. #define __HAL_RCC_LTDC_CLK_SLEEP_DISABLE() (RCC->APB3LPENR) &= ~ (RCC_APB3LPENR_LTDCLPEN)
  5189. #endif /* LTDC */
  5190. #if defined(DSI)
  5191. #define __HAL_RCC_DSI_CLK_SLEEP_DISABLE() (RCC->APB3LPENR) &= ~ (RCC_APB3LPENR_DSILPEN)
  5192. #endif /*DSI*/
  5193. #define __HAL_RCC_WWDG1_CLK_SLEEP_DISABLE() (RCC->APB3LPENR) &= ~ (RCC_APB3LPENR_WWDG1LPEN)
  5194. /** @brief Get the enable or disable status of the APB3 peripheral clock during Low Poser (Sleep) mode.
  5195. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5196. * power consumption.
  5197. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
  5198. * @note By default, all peripheral clocks are enabled during SLEEP mode.
  5199. */
  5200. #if defined(LTDC)
  5201. #define __HAL_RCC_LTDC_IS_CLK_SLEEP_ENABLED() ((RCC->APB3LPENR & (RCC_APB3LPENR_LTDCLPEN)) != 0U)
  5202. #endif /* LTDC */
  5203. #if defined(DSI)
  5204. #define __HAL_RCC_DSI_IS_CLK_SLEEP_ENABLED() ((RCC->APB3LPENR & (RCC_APB3LPENR_DSILPEN)) != 0U)
  5205. #endif /*DSI*/
  5206. #define __HAL_RCC_WWDG1_IS_CLK_SLEEP_ENABLED() ((RCC->APB3LPENR & (RCC_APB3LPENR_WWDG1LPEN)) != 0U)
  5207. #if defined(LTDC)
  5208. #define __HAL_RCC_LTDC_IS_CLK_SLEEP_DISABLED() ((RCC->APB3LPENR & (RCC_APB3LPENR_LTDCLPEN)) == 0U)
  5209. #endif /* LTDC */
  5210. #if defined(DSI)
  5211. #define __HAL_RCC_DSI_IS_CLK_SLEEP_DISABLED() ((RCC->APB3LPENR & (RCC_APB3LPENR_DSILPEN)) == 0U)
  5212. #endif /*DSI*/
  5213. #define __HAL_RCC_WWDG1_IS_CLK_SLEEP_DISABLED() ((RCC->APB3LPENR & (RCC_APB3LPENR_WWDG1LPEN)) == 0U)
  5214. /** @brief ENABLE or disable the APB1 peripheral clock during Low Power (Sleep) mode.
  5215. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5216. * power consumption.
  5217. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  5218. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  5219. */
  5220. #define __HAL_RCC_TIM2_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_TIM2LPEN)
  5221. #define __HAL_RCC_TIM3_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_TIM3LPEN)
  5222. #define __HAL_RCC_TIM4_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_TIM4LPEN)
  5223. #define __HAL_RCC_TIM5_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_TIM5LPEN)
  5224. #define __HAL_RCC_TIM6_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_TIM6LPEN)
  5225. #define __HAL_RCC_TIM7_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_TIM7LPEN)
  5226. #define __HAL_RCC_TIM12_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_TIM12LPEN)
  5227. #define __HAL_RCC_TIM13_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_TIM13LPEN)
  5228. #define __HAL_RCC_TIM14_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_TIM14LPEN)
  5229. #define __HAL_RCC_LPTIM1_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_LPTIM1LPEN)
  5230. #if defined(DUAL_CORE)
  5231. #define __HAL_RCC_WWDG2_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_WWDG2LPEN)
  5232. #endif /*DUAL_CORE*/
  5233. #define __HAL_RCC_SPI2_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_SPI2LPEN)
  5234. #define __HAL_RCC_SPI3_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_SPI3LPEN)
  5235. #define __HAL_RCC_SPDIFRX_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_SPDIFRXLPEN)
  5236. #define __HAL_RCC_USART2_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_USART2LPEN)
  5237. #define __HAL_RCC_USART3_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_USART3LPEN)
  5238. #define __HAL_RCC_UART4_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_UART4LPEN)
  5239. #define __HAL_RCC_UART5_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_UART5LPEN)
  5240. #define __HAL_RCC_I2C1_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_I2C1LPEN)
  5241. #define __HAL_RCC_I2C2_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_I2C2LPEN)
  5242. #define __HAL_RCC_I2C3_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_I2C3LPEN)
  5243. #if defined(I2C5)
  5244. #define __HAL_RCC_I2C5_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_I2C5LPEN)
  5245. #endif /* I2C5 */
  5246. #define __HAL_RCC_CEC_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_CECLPEN)
  5247. #define __HAL_RCC_DAC12_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_DAC12LPEN)
  5248. #define __HAL_RCC_UART7_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_UART7LPEN)
  5249. #define __HAL_RCC_UART8_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_UART8LPEN)
  5250. #define __HAL_RCC_CRS_CLK_SLEEP_ENABLE() (RCC->APB1HLPENR) |= (RCC_APB1HLPENR_CRSLPEN)
  5251. #define __HAL_RCC_SWPMI1_CLK_SLEEP_ENABLE() (RCC->APB1HLPENR) |= (RCC_APB1HLPENR_SWPMILPEN)
  5252. #define __HAL_RCC_OPAMP_CLK_SLEEP_ENABLE() (RCC->APB1HLPENR) |= (RCC_APB1HLPENR_OPAMPLPEN)
  5253. #define __HAL_RCC_MDIOS_CLK_SLEEP_ENABLE() (RCC->APB1HLPENR) |= (RCC_APB1HLPENR_MDIOSLPEN)
  5254. #define __HAL_RCC_FDCAN_CLK_SLEEP_ENABLE() (RCC->APB1HLPENR) |= (RCC_APB1HLPENR_FDCANLPEN)
  5255. #if defined(TIM23)
  5256. #define __HAL_RCC_TIM23_CLK_SLEEP_ENABLE() (RCC->APB1HLPENR) |= (RCC_APB1HLPENR_TIM23LPEN)
  5257. #endif /* TIM23 */
  5258. #if defined(TIM24)
  5259. #define __HAL_RCC_TIM24_CLK_SLEEP_ENABLE() (RCC->APB1HLPENR) |= (RCC_APB1HLPENR_TIM24LPEN)
  5260. #endif /* TIM24 */
  5261. #define __HAL_RCC_TIM2_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM2LPEN)
  5262. #define __HAL_RCC_TIM3_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM3LPEN)
  5263. #define __HAL_RCC_TIM4_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM4LPEN)
  5264. #define __HAL_RCC_TIM5_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM5LPEN)
  5265. #define __HAL_RCC_TIM6_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM6LPEN)
  5266. #define __HAL_RCC_TIM7_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM7LPEN)
  5267. #define __HAL_RCC_TIM12_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM12LPEN)
  5268. #define __HAL_RCC_TIM13_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM13LPEN)
  5269. #define __HAL_RCC_TIM14_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM14LPEN)
  5270. #define __HAL_RCC_LPTIM1_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_LPTIM1LPEN)
  5271. #if defined(DUAL_CORE)
  5272. #define __HAL_RCC_WWDG2_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_WWDG2LPEN)
  5273. #endif /*DUAL_CORE*/
  5274. #define __HAL_RCC_SPI2_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_SPI2LPEN)
  5275. #define __HAL_RCC_SPI3_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_SPI3LPEN)
  5276. #define __HAL_RCC_SPDIFRX_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_SPDIFRXLPEN)
  5277. #define __HAL_RCC_USART2_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_USART2LPEN)
  5278. #define __HAL_RCC_USART3_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_USART3LPEN)
  5279. #define __HAL_RCC_UART4_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_UART4LPEN)
  5280. #define __HAL_RCC_UART5_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_UART5LPEN)
  5281. #define __HAL_RCC_I2C1_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_I2C1LPEN)
  5282. #define __HAL_RCC_I2C2_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_I2C2LPEN)
  5283. #define __HAL_RCC_I2C3_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_I2C3LPEN)
  5284. #if defined(I2C5)
  5285. #define __HAL_RCC_I2C5_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_I2C5LPEN)
  5286. #endif /* I2C5 */
  5287. #define __HAL_RCC_CEC_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_CECLPEN)
  5288. #define __HAL_RCC_DAC12_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_DAC12LPEN)
  5289. #define __HAL_RCC_UART7_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_UART7LPEN)
  5290. #define __HAL_RCC_UART8_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_UART8LPEN)
  5291. #define __HAL_RCC_CRS_CLK_SLEEP_DISABLE() (RCC->APB1HLPENR) &= ~ (RCC_APB1HLPENR_CRSLPEN)
  5292. #define __HAL_RCC_SWPMI1_CLK_SLEEP_DISABLE() (RCC->APB1HLPENR) &= ~ (RCC_APB1HLPENR_SWPMILPEN)
  5293. #define __HAL_RCC_OPAMP_CLK_SLEEP_DISABLE() (RCC->APB1HLPENR) &= ~ (RCC_APB1HLPENR_OPAMPLPEN)
  5294. #define __HAL_RCC_MDIOS_CLK_SLEEP_DISABLE() (RCC->APB1HLPENR) &= ~ (RCC_APB1HLPENR_MDIOSLPEN)
  5295. #define __HAL_RCC_FDCAN_CLK_SLEEP_DISABLE() (RCC->APB1HLPENR) &= ~ (RCC_APB1HLPENR_FDCANLPEN)
  5296. #if defined(TIM23)
  5297. #define __HAL_RCC_TIM23_CLK_SLEEP_DISABLE() (RCC->APB1HLPENR) &= ~ (RCC_APB1HLPENR_TIM23LPEN)
  5298. #endif /* TIM23 */
  5299. #if defined(TIM24)
  5300. #define __HAL_RCC_TIM24_CLK_SLEEP_DISABLE() (RCC->APB1HLPENR) &= ~ (RCC_APB1HLPENR_TIM24LPEN)
  5301. #endif /* TIM24 */
  5302. /** @brief Get the enable or disable status of the APB1 peripheral clock during Low Poser (Sleep) mode.
  5303. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5304. * power consumption.
  5305. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
  5306. * @note By default, all peripheral clocks are enabled during SLEEP mode.
  5307. */
  5308. #define __HAL_RCC_TIM2_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM2LPEN)) != 0U)
  5309. #define __HAL_RCC_TIM3_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM3LPEN)) != 0U)
  5310. #define __HAL_RCC_TIM4_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM4LPEN)) != 0U)
  5311. #define __HAL_RCC_TIM5_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM5LPEN)) != 0U)
  5312. #define __HAL_RCC_TIM6_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM6LPEN)) != 0U)
  5313. #define __HAL_RCC_TIM7_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM7LPEN)) != 0U)
  5314. #define __HAL_RCC_TIM12_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM12LPEN)) != 0U)
  5315. #define __HAL_RCC_TIM13_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM13LPEN)) != 0U)
  5316. #define __HAL_RCC_TIM14_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM14LPEN)) != 0U)
  5317. #define __HAL_RCC_LPTIM1_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_LPTIM1LPEN)) != 0U)
  5318. #if defined(DUAL_CORE)
  5319. #define __HAL_RCC_WWDG2_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_WWDG2LPEN)) != 0U)
  5320. #endif /*DUAL_CORE*/
  5321. #define __HAL_RCC_SPI2_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_SPI2LPEN)) != 0U)
  5322. #define __HAL_RCC_SPI3_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_SPI3LPEN)) != 0U)
  5323. #define __HAL_RCC_SPDIFRX_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_SPDIFRXLPEN)) != 0U)
  5324. #define __HAL_RCC_USART2_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_USART2LPEN)) != 0U)
  5325. #define __HAL_RCC_USART3_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_USART3LPEN)) != 0U)
  5326. #define __HAL_RCC_UART4_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_UART4LPEN)) != 0U)
  5327. #define __HAL_RCC_UART5_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_UART5LPEN)) != 0U)
  5328. #define __HAL_RCC_I2C1_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_I2C1LPEN)) != 0U)
  5329. #define __HAL_RCC_I2C2_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_I2C2LPEN)) != 0U)
  5330. #define __HAL_RCC_I2C3_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_I2C3LPEN)) != 0U)
  5331. #if defined(I2C5)
  5332. #define __HAL_RCC_I2C5_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_I2C5LPEN)) != 0U)
  5333. #endif /* I2C5 */
  5334. #define __HAL_RCC_CEC_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_CECLPEN)) != 0U)
  5335. #define __HAL_RCC_DAC12_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_DAC12LPEN)) != 0U)
  5336. #define __HAL_RCC_UART7_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_UART7LPEN)) != 0U)
  5337. #define __HAL_RCC_UART8_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_UART8LPEN)) != 0U)
  5338. #define __HAL_RCC_CRS_IS_CLK_SLEEP_ENABLED() ((RCC->APB1HLPENR & (RCC_APB1HLPENR_CRSLPEN)) != 0U)
  5339. #define __HAL_RCC_SWPMI1_IS_CLK_SLEEP_ENABLED() ((RCC->APB1HLPENR & (RCC_APB1HLPENR_SWPMILPEN)) != 0U)
  5340. #define __HAL_RCC_OPAMP_IS_CLK_SLEEP_ENABLED() ((RCC->APB1HLPENR & (RCC_APB1HLPENR_OPAMPLPEN)) != 0U)
  5341. #define __HAL_RCC_MDIOS_IS_CLK_SLEEP_ENABLED() ((RCC->APB1HLPENR & (RCC_APB1HLPENR_MDIOSLPEN)) != 0U)
  5342. #define __HAL_RCC_FDCAN_IS_CLK_SLEEP_ENABLED() ((RCC->APB1HLPENR & (RCC_APB1HLPENR_FDCANLPEN)) != 0U)
  5343. #if defined(TIM23)
  5344. #define __HAL_RCC_TIM23_IS_CLK_SLEEP_ENABLED() ((RCC->APB1HLPENR & (RCC_APB1HLPENR_TIM23LPEN)) != 0U)
  5345. #endif /* TIM23 */
  5346. #if defined(TIM24)
  5347. #define __HAL_RCC_TIM24_IS_CLK_SLEEP_ENABLED() ((RCC->APB1HLPENR & (RCC_APB1HLPENR_TIM24LPEN)) != 0U)
  5348. #endif /* TIM24 */
  5349. #define __HAL_RCC_TIM2_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM2LPEN)) == 0U)
  5350. #define __HAL_RCC_TIM3_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM3LPEN)) == 0U)
  5351. #define __HAL_RCC_TIM4_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM4LPEN)) == 0U)
  5352. #define __HAL_RCC_TIM5_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM5LPEN)) == 0U)
  5353. #define __HAL_RCC_TIM6_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM6LPEN)) == 0U)
  5354. #define __HAL_RCC_TIM7_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM7LPEN)) == 0U)
  5355. #define __HAL_RCC_TIM12_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM12LPEN)) == 0U)
  5356. #define __HAL_RCC_TIM13_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM13LPEN)) == 0U)
  5357. #define __HAL_RCC_TIM14_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM14LPEN)) == 0U)
  5358. #define __HAL_RCC_LPTIM1_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_LPTIM1LPEN)) == 0U)
  5359. #if defined(DUAL_CORE)
  5360. #define __HAL_RCC_WWDG2_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_WWDG2LPEN)) == 0U)
  5361. #endif /*DUAL_CORE*/
  5362. #define __HAL_RCC_SPI2_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_SPI2LPEN)) == 0U)
  5363. #define __HAL_RCC_SPI3_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_SPI3LPEN)) == 0U)
  5364. #define __HAL_RCC_SPDIFRX_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_SPDIFRXLPEN)) == 0U)
  5365. #define __HAL_RCC_USART2_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_USART2LPEN)) == 0U)
  5366. #define __HAL_RCC_USART3_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_USART3LPEN)) == 0U)
  5367. #define __HAL_RCC_UART4_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_UART4LPEN)) == 0U)
  5368. #define __HAL_RCC_UART5_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_UART5LPEN)) == 0U)
  5369. #define __HAL_RCC_I2C1_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_I2C1LPEN)) == 0U)
  5370. #define __HAL_RCC_I2C2_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_I2C2LPEN)) == 0U)
  5371. #define __HAL_RCC_I2C3_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_I2C3LPEN)) == 0U)
  5372. #if defined(I2C5)
  5373. #define __HAL_RCC_I2C5_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_I2C5LPEN)) == 0U)
  5374. #endif /* I2C5 */
  5375. #define __HAL_RCC_CEC_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_CECLPEN)) == 0U)
  5376. #define __HAL_RCC_DAC12_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_DAC12LPEN)) == 0U)
  5377. #define __HAL_RCC_UART7_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_UART7LPEN)) == 0U)
  5378. #define __HAL_RCC_UART8_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_UART8LPEN)) == 0U)
  5379. #define __HAL_RCC_CRS_IS_CLK_SLEEP_DISABLED() ((RCC->APB1HLPENR & (RCC_APB1HLPENR_CRSLPEN)) == 0U)
  5380. #define __HAL_RCC_SWPMI1_IS_CLK_SLEEP_DISABLED() ((RCC->APB1HLPENR & (RCC_APB1HLPENR_SWPMILPEN)) == 0U)
  5381. #define __HAL_RCC_OPAMP_IS_CLK_SLEEP_DISABLED() ((RCC->APB1HLPENR & (RCC_APB1HLPENR_OPAMPLPEN)) == 0U)
  5382. #define __HAL_RCC_MDIOS_IS_CLK_SLEEP_DISABLED() ((RCC->APB1HLPENR & (RCC_APB1HLPENR_MDIOSLPEN)) == 0U)
  5383. #define __HAL_RCC_FDCAN_IS_CLK_SLEEP_DISABLED() ((RCC->APB1HLPENR & (RCC_APB1HLPENR_FDCANLPEN)) == 0U)
  5384. #if defined(TIM23)
  5385. #define __HAL_RCC_TIM23_IS_CLK_SLEEP_DISABLED() ((RCC->APB1HLPENR & (RCC_APB1HLPENR_TIM23LPEN)) == 0U)
  5386. #endif /* TIM23 */
  5387. #if defined(TIM24)
  5388. #define __HAL_RCC_TIM24_IS_CLK_SLEEP_DISABLED() ((RCC->APB1HLPENR & (RCC_APB1HLPENR_TIM24LPEN)) == 0U)
  5389. #endif /* TIM24 */
  5390. /** @brief ENABLE or disable the APB2 peripheral clock during Low Power (Sleep) mode.
  5391. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5392. * power consumption.
  5393. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  5394. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  5395. */
  5396. #define __HAL_RCC_TIM1_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_TIM1LPEN)
  5397. #define __HAL_RCC_TIM8_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_TIM8LPEN)
  5398. #define __HAL_RCC_USART1_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_USART1LPEN)
  5399. #define __HAL_RCC_USART6_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_USART6LPEN)
  5400. #if defined(UART9)
  5401. #define __HAL_RCC_UART9_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_UART9LPEN)
  5402. #endif /*UART9*/
  5403. #if defined(USART10)
  5404. #define __HAL_RCC_USART10_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_USART10LPEN)
  5405. #endif /*USART10*/
  5406. #define __HAL_RCC_SPI1_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_SPI1LPEN)
  5407. #define __HAL_RCC_SPI4_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_SPI4LPEN)
  5408. #define __HAL_RCC_TIM15_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_TIM15LPEN)
  5409. #define __HAL_RCC_TIM16_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_TIM16LPEN)
  5410. #define __HAL_RCC_TIM17_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_TIM17LPEN)
  5411. #define __HAL_RCC_SPI5_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_SPI5LPEN)
  5412. #define __HAL_RCC_SAI1_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_SAI1LPEN)
  5413. #if defined(SAI2)
  5414. #define __HAL_RCC_SAI2_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_SAI2LPEN)
  5415. #endif /* SAI2 */
  5416. #if defined(SAI3)
  5417. #define __HAL_RCC_SAI3_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_SAI3LPEN)
  5418. #endif /*SAI3*/
  5419. #define __HAL_RCC_DFSDM1_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_DFSDM1LPEN)
  5420. #if defined(HRTIM1)
  5421. #define __HAL_RCC_HRTIM1_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_HRTIMLPEN)
  5422. #endif /*HRTIM1*/
  5423. #define __HAL_RCC_TIM1_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_TIM1LPEN)
  5424. #define __HAL_RCC_TIM8_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_TIM8LPEN)
  5425. #define __HAL_RCC_USART1_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_USART1LPEN)
  5426. #define __HAL_RCC_USART6_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_USART6LPEN)
  5427. #if defined(UART9)
  5428. #define __HAL_RCC_UART9_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_UART9LPEN)
  5429. #endif /*UART9*/
  5430. #if defined(USART10)
  5431. #define __HAL_RCC_USART10_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_USART10LPEN)
  5432. #endif /*USART10*/
  5433. #define __HAL_RCC_SPI1_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_SPI1LPEN)
  5434. #define __HAL_RCC_SPI4_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_SPI4LPEN)
  5435. #define __HAL_RCC_TIM15_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_TIM15LPEN)
  5436. #define __HAL_RCC_TIM16_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_TIM16LPEN)
  5437. #define __HAL_RCC_TIM17_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_TIM17LPEN)
  5438. #define __HAL_RCC_SPI5_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_SPI5LPEN)
  5439. #define __HAL_RCC_SAI1_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_SAI1LPEN)
  5440. #if defined(SAI2)
  5441. #define __HAL_RCC_SAI2_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_SAI2LPEN)
  5442. #endif /* SAI2 */
  5443. #if defined(SAI3)
  5444. #define __HAL_RCC_SAI3_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_SAI3LPEN)
  5445. #endif /*SAI3*/
  5446. #define __HAL_RCC_DFSDM1_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_DFSDM1LPEN)
  5447. #if defined(HRTIM1)
  5448. #define __HAL_RCC_HRTIM1_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_HRTIMLPEN)
  5449. #endif /*HRTIM1*/
  5450. /** @brief Get the enable or disable status of the APB2 peripheral clock during Low Poser (Sleep) mode.
  5451. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5452. * power consumption.
  5453. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
  5454. * @note By default, all peripheral clocks are enabled during SLEEP mode.
  5455. */
  5456. #define __HAL_RCC_TIM1_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_TIM1LPEN)) != 0U)
  5457. #define __HAL_RCC_TIM8_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_TIM8LPEN)) != 0U)
  5458. #define __HAL_RCC_USART1_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_USART1LPEN)) != 0U)
  5459. #define __HAL_RCC_USART6_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_USART6LPEN)) != 0U)
  5460. #if defined(UART9)
  5461. #define __HAL_RCC_UART9_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_UART9LPEN)) != 0U)
  5462. #endif /*UART9*/
  5463. #if defined(USART10)
  5464. #define __HAL_RCC_USART10_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_USART10LPEN)) != 0U)
  5465. #endif /*USART10*/
  5466. #define __HAL_RCC_SPI1_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_SPI1LPEN)) != 0U)
  5467. #define __HAL_RCC_SPI4_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_SPI4LPEN)) != 0U)
  5468. #define __HAL_RCC_TIM15_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_TIM15LPEN)) != 0U)
  5469. #define __HAL_RCC_TIM16_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_TIM16LPEN)) != 0U)
  5470. #define __HAL_RCC_TIM17_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_TIM17LPEN)) != 0U)
  5471. #define __HAL_RCC_SPI5_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_SPI5LPEN)) != 0U)
  5472. #define __HAL_RCC_SAI1_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_SAI1LPEN)) != 0U)
  5473. #if defined(SAI2)
  5474. #define __HAL_RCC_SAI2_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_SAI2LPEN)) != 0U)
  5475. #endif /* SAI2 */
  5476. #if defined(SAI3)
  5477. #define __HAL_RCC_SAI3_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_SAI3LPEN)) != 0U)
  5478. #endif /*SAI3*/
  5479. #define __HAL_RCC_DFSDM1_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_DFSDM1LPEN)) != 0U)
  5480. #if defined(HRTIM1)
  5481. #define __HAL_RCC_HRTIM1_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_HRTIMLPEN)) != 0U)
  5482. #endif /*HRTIM1*/
  5483. #define __HAL_RCC_TIM1_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_TIM1LPEN)) == 0U)
  5484. #define __HAL_RCC_TIM8_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_TIM8LPEN)) == 0U)
  5485. #define __HAL_RCC_USART1_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_USART1LPEN)) == 0U)
  5486. #define __HAL_RCC_USART6_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_USART6LPEN)) == 0U)
  5487. #if defined(UART9)
  5488. #define __HAL_RCC_USART9_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_USART9LPEN)) == 0U)
  5489. #endif /*UART9*/
  5490. #if defined(USART10)
  5491. #define __HAL_RCC_USART10_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_USART10LPEN)) == 0U)
  5492. #endif /*USART10*/
  5493. #define __HAL_RCC_SPI1_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_SPI1LPEN)) == 0U)
  5494. #define __HAL_RCC_SPI4_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_SPI4LPEN)) == 0U)
  5495. #define __HAL_RCC_TIM15_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_TIM15LPEN)) == 0U)
  5496. #define __HAL_RCC_TIM16_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_TIM16LPEN)) == 0U)
  5497. #define __HAL_RCC_TIM17_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_TIM17LPEN)) == 0U)
  5498. #define __HAL_RCC_SPI5_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_SPI5LPEN)) == 0U)
  5499. #define __HAL_RCC_SAI1_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_SAI1LPEN)) == 0U)
  5500. #if defined(SAI2)
  5501. #define __HAL_RCC_SAI2_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_SAI2LPEN)) == 0U)
  5502. #endif /* SAI2 */
  5503. #if defined(SAI3)
  5504. #define __HAL_RCC_SAI3_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_SAI3LPEN)) == 0U)
  5505. #endif /*SAI3*/
  5506. #define __HAL_RCC_DFSDM1_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_DFSDM1LPEN)) == 0U)
  5507. #if defined(HRTIM1)
  5508. #define __HAL_RCC_HRTIM1_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_HRTIMLPEN)) == 0U)
  5509. #endif /*HRTIM1*/
  5510. /** @brief ENABLE or disable the APB4 peripheral clock during Low Power (Sleep) mode.
  5511. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5512. * power consumption.
  5513. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  5514. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  5515. */
  5516. #define __HAL_RCC_SYSCFG_CLK_SLEEP_ENABLE() (RCC->APB4LPENR) |= (RCC_APB4LPENR_SYSCFGLPEN)
  5517. #define __HAL_RCC_LPUART1_CLK_SLEEP_ENABLE() (RCC->APB4LPENR) |= (RCC_APB4LPENR_LPUART1LPEN)
  5518. #define __HAL_RCC_SPI6_CLK_SLEEP_ENABLE() (RCC->APB4LPENR) |= (RCC_APB4LPENR_SPI6LPEN)
  5519. #define __HAL_RCC_I2C4_CLK_SLEEP_ENABLE() (RCC->APB4LPENR) |= (RCC_APB4LPENR_I2C4LPEN)
  5520. #define __HAL_RCC_LPTIM2_CLK_SLEEP_ENABLE() (RCC->APB4LPENR) |= (RCC_APB4LPENR_LPTIM2LPEN)
  5521. #define __HAL_RCC_LPTIM3_CLK_SLEEP_ENABLE() (RCC->APB4LPENR) |= (RCC_APB4LPENR_LPTIM3LPEN)
  5522. #if defined(LPTIM4)
  5523. #define __HAL_RCC_LPTIM4_CLK_SLEEP_ENABLE() (RCC->APB4LPENR) |= (RCC_APB4LPENR_LPTIM4LPEN)
  5524. #endif /*LPTIM4*/
  5525. #if defined(LPTIM5)
  5526. #define __HAL_RCC_LPTIM5_CLK_SLEEP_ENABLE() (RCC->APB4LPENR) |= (RCC_APB4LPENR_LPTIM5LPEN)
  5527. #endif /*LPTIM5*/
  5528. #if defined(DAC2)
  5529. #define __HAL_RCC_DAC2_CLK_SLEEP_ENABLE() (RCC->APB4LPENR) |= (RCC_APB4LPENR_DAC2LPEN)
  5530. #endif /*DAC2*/
  5531. #define __HAL_RCC_COMP12_CLK_SLEEP_ENABLE() (RCC->APB4LPENR) |= (RCC_APB4LPENR_COMP12LPEN)
  5532. #define __HAL_RCC_VREF_CLK_SLEEP_ENABLE() (RCC->APB4LPENR) |= (RCC_APB4LPENR_VREFLPEN)
  5533. #define __HAL_RCC_RTC_CLK_SLEEP_ENABLE() (RCC->APB4LPENR) |= (RCC_APB4LPENR_RTCAPBLPEN)
  5534. #if defined(SAI4)
  5535. #define __HAL_RCC_SAI4_CLK_SLEEP_ENABLE() (RCC->APB4LPENR) |= (RCC_APB4LPENR_SAI4LPEN)
  5536. #endif /*SAI4*/
  5537. #if defined(DTS)
  5538. #define __HAL_RCC_DTS_CLK_SLEEP_ENABLE() (RCC->APB4LPENR) |= (RCC_APB4LPENR_DTSLPEN)
  5539. #endif /*DTS*/
  5540. #if defined(DFSDM2_BASE)
  5541. #define __HAL_RCC_DFSDM2_CLK_SLEEP_ENABLE() (RCC->APB4LPENR) |= (RCC_APB4LPENR_DFSDM2LPEN)
  5542. #endif /*DFSDM2*/
  5543. #define __HAL_RCC_SYSCFG_CLK_SLEEP_DISABLE() (RCC->APB4LPENR) &= ~ (RCC_APB4LPENR_SYSCFGLPEN)
  5544. #define __HAL_RCC_LPUART1_CLK_SLEEP_DISABLE() (RCC->APB4LPENR) &= ~ (RCC_APB4LPENR_LPUART1LPEN)
  5545. #define __HAL_RCC_SPI6_CLK_SLEEP_DISABLE() (RCC->APB4LPENR) &= ~ (RCC_APB4LPENR_SPI6LPEN)
  5546. #define __HAL_RCC_I2C4_CLK_SLEEP_DISABLE() (RCC->APB4LPENR) &= ~ (RCC_APB4LPENR_I2C4LPEN)
  5547. #define __HAL_RCC_LPTIM2_CLK_SLEEP_DISABLE() (RCC->APB4LPENR) &= ~ (RCC_APB4LPENR_LPTIM2LPEN)
  5548. #define __HAL_RCC_LPTIM3_CLK_SLEEP_DISABLE() (RCC->APB4LPENR) &= ~ (RCC_APB4LPENR_LPTIM3LPEN)
  5549. #if defined(LPTIM4)
  5550. #define __HAL_RCC_LPTIM4_CLK_SLEEP_DISABLE() (RCC->APB4LPENR) &= ~ (RCC_APB4LPENR_LPTIM4LPEN)
  5551. #endif /*LPTIM4*/
  5552. #if defined(LPTIM5)
  5553. #define __HAL_RCC_LPTIM5_CLK_SLEEP_DISABLE() (RCC->APB4LPENR) &= ~ (RCC_APB4LPENR_LPTIM5LPEN)
  5554. #endif /*LPTIM5*/
  5555. #if defined(DAC2)
  5556. #define __HAL_RCC_DAC2_CLK_SLEEP_DISABLE() (RCC->APB4LPENR) &= ~ (RCC_APB4LPENR_DAC2LPEN)
  5557. #endif /*DAC2*/
  5558. #define __HAL_RCC_COMP12_CLK_SLEEP_DISABLE() (RCC->APB4LPENR) &= ~ (RCC_APB4LPENR_COMP12LPEN)
  5559. #define __HAL_RCC_VREF_CLK_SLEEP_DISABLE() (RCC->APB4LPENR) &= ~ (RCC_APB4LPENR_VREFLPEN)
  5560. #define __HAL_RCC_RTC_CLK_SLEEP_DISABLE() (RCC->APB4LPENR) &= ~ (RCC_APB4LPENR_RTCAPBLPEN)
  5561. #if defined(SAI4)
  5562. #define __HAL_RCC_SAI4_CLK_SLEEP_DISABLE() (RCC->APB4LPENR) &= ~ (RCC_APB4LPENR_SAI4LPEN)
  5563. #endif /*SAI4*/
  5564. #if defined(DTS)
  5565. #define __HAL_RCC_DTS_CLK_SLEEP_DISABLE() (RCC->APB4LPENR) &= ~ (RCC_APB4LPENR_DTSLPEN)
  5566. #endif /*DTS*/
  5567. #if defined(DFSDM2_BASE)
  5568. #define __HAL_RCC_DFSDM2_CLK_SLEEP_DISABLE() (RCC->APB4LPENR) &= ~ (RCC_APB4LPENR_DFSDM2LPEN)
  5569. #endif /*DFSDM2*/
  5570. /** @brief Get the enable or disable status of the APB4 peripheral clock during Low Poser (Sleep) mode.
  5571. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5572. * power consumption.
  5573. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
  5574. * @note By default, all peripheral clocks are enabled during SLEEP mode.
  5575. */
  5576. #define __HAL_RCC_SYSCFG_IS_CLK_SLEEP_ENABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_SYSCFGLPEN)) != 0U)
  5577. #define __HAL_RCC_LPUART1_IS_CLK_SLEEP_ENABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_LPUART1LPEN)) != 0U)
  5578. #define __HAL_RCC_SPI6_IS_CLK_SLEEP_ENABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_SPI6LPEN)) != 0U)
  5579. #define __HAL_RCC_I2C4_IS_CLK_SLEEP_ENABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_I2C4LPEN)) != 0U)
  5580. #define __HAL_RCC_LPTIM2_IS_CLK_SLEEP_ENABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_LPTIM2LPEN)) != 0U)
  5581. #define __HAL_RCC_LPTIM3_IS_CLK_SLEEP_ENABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_LPTIM3LPEN)) != 0U)
  5582. #if defined(LPTIM4)
  5583. #define __HAL_RCC_LPTIM4_IS_CLK_SLEEP_ENABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_LPTIM4LPEN)) != 0U)
  5584. #endif /*LPTIM4*/
  5585. #if defined(LPTIM5)
  5586. #define __HAL_RCC_LPTIM5_IS_CLK_SLEEP_ENABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_LPTIM5LPEN)) != 0U)
  5587. #endif /*LPTIM5*/
  5588. #if defined(DAC2)
  5589. #define __HAL_RCC_DAC2_IS_CLK_SLEEP_ENABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_DAC2LPEN)) != 0U)
  5590. #endif /*DAC2*/
  5591. #define __HAL_RCC_COMP12_IS_CLK_SLEEP_ENABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_COMP12LPEN)) != 0U)
  5592. #define __HAL_RCC_VREF_IS_CLK_SLEEP_ENABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_VREFLPEN)) != 0U)
  5593. #define __HAL_RCC_RTC_IS_CLK_SLEEP_ENABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_RTCAPBLPEN)) != 0U)
  5594. #if defined(SAI4)
  5595. #define __HAL_RCC_SAI4_IS_CLK_SLEEP_ENABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_SAI4LPEN)) != 0U)
  5596. #endif /*SAI4*/
  5597. #if defined(DTS)
  5598. #define __HAL_RCC_DTS_IS_CLK_SLEEP_ENABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_DTSLPEN)) != 0U)
  5599. #endif /*DTS*/
  5600. #if defined(DFSDM2_BASE)
  5601. #define __HAL_RCC_DFSDM2_IS_CLK_SLEEP_ENABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_DFSDM2LPEN)) != 0U)
  5602. #endif /*DFSDM2*/
  5603. #define __HAL_RCC_SYSCFG_IS_CLK_SLEEP_DISABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_SYSCFGLPEN)) == 0U)
  5604. #define __HAL_RCC_LPUART1_IS_CLK_SLEEP_DISABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_LPUART1LPEN)) == 0U)
  5605. #define __HAL_RCC_SPI6_IS_CLK_SLEEP_DISABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_SPI6LPEN)) == 0U)
  5606. #define __HAL_RCC_I2C4_IS_CLK_SLEEP_DISABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_I2C4LPEN)) == 0U)
  5607. #define __HAL_RCC_LPTIM2_IS_CLK_SLEEP_DISABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_LPTIM2LPEN)) == 0U)
  5608. #define __HAL_RCC_LPTIM3_IS_CLK_SLEEP_DISABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_LPTIM3LPEN)) == 0U)
  5609. #if defined(LPTIM4)
  5610. #define __HAL_RCC_LPTIM4_IS_CLK_SLEEP_DISABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_LPTIM4LPEN)) == 0U)
  5611. #endif /*LPTIM4*/
  5612. #if defined(LPTIM5)
  5613. #define __HAL_RCC_LPTIM5_IS_CLK_SLEEP_DISABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_LPTIM5LPEN)) == 0U)
  5614. #endif /*LPTIM5*/
  5615. #if defined(DAC2)
  5616. #define __HAL_RCC_DAC2_IS_CLK_SLEEP_DISABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_DAC2LPEN)) == 0U)
  5617. #endif /*DAC2*/
  5618. #define __HAL_RCC_COMP12_IS_CLK_SLEEP_DISABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_COMP12LPEN)) == 0U)
  5619. #define __HAL_RCC_VREF_IS_CLK_SLEEP_DISABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_VREFLPEN)) == 0U)
  5620. #define __HAL_RCC_RTC_IS_CLK_SLEEP_DISABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_RTCAPBLPEN)) == 0U)
  5621. #if defined(SAI4)
  5622. #define __HAL_RCC_SAI4_IS_CLK_SLEEP_DISABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_SAI4LPEN)) == 0U)
  5623. #endif /*SAI4*/
  5624. #if defined(DTS)
  5625. #define __HAL_RCC_DTS_IS_CLK_SLEEP_DISABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_DTSLPEN)) == 0U)
  5626. #endif /*DTS*/
  5627. #if defined(DFSDM2_BASE)
  5628. #define __HAL_RCC_DFSDM2_IS_CLK_SLEEP_DISABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_DFSDM2LPEN)) == 0U)
  5629. #endif /*DFSDM2*/
  5630. #if defined(DUAL_CORE)
  5631. /** @brief Enable or disable the RCC_C1 AHB3 peripheral clock during Low Power (Sleep) mode.
  5632. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5633. * power consumption.
  5634. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
  5635. * @note By default, all peripheral clocks are enabled during SLEEP mode.
  5636. */
  5637. #define __HAL_RCC_C1_MDMA_CLK_SLEEP_ENABLE() (RCC_C1->AHB3LPENR |= (RCC_AHB3LPENR_MDMALPEN))
  5638. #define __HAL_RCC_C1_DMA2D_CLK_SLEEP_ENABLE() (RCC_C1->AHB3LPENR |= (RCC_AHB3LPENR_DMA2DLPEN))
  5639. #define __HAL_RCC_C1_JPGDEC_CLK_SLEEP_ENABLE() (RCC_C1->AHB3LPENR |= (RCC_AHB3LPENR_JPGDECLPEN))
  5640. #define __HAL_RCC_C1_FLASH_CLK_SLEEP_ENABLE() (RCC_C1->AHB3LPENR |= (RCC_AHB3LPENR_FLASHLPEN))
  5641. #define __HAL_RCC_C1_FMC_CLK_SLEEP_ENABLE() (RCC_C1->AHB3LPENR |= (RCC_AHB3LPENR_FMCLPEN))
  5642. #define __HAL_RCC_C1_QSPI_CLK_SLEEP_ENABLE() (RCC_C1->AHB3LPENR |= (RCC_AHB3LPENR_QSPILPEN))
  5643. #define __HAL_RCC_C1_SDMMC1_CLK_SLEEP_ENABLE() (RCC_C1->AHB3LPENR |= (RCC_AHB3LPENR_SDMMC1LPEN))
  5644. #define __HAL_RCC_C1_DTCM1_CLK_SLEEP_ENABLE() (RCC_C1->AHB3LPENR |= (RCC_AHB3LPENR_DTCM1LPEN))
  5645. #define __HAL_RCC_C1_DTCM2_CLK_SLEEP_ENABLE() (RCC_C1->AHB3LPENR |= (RCC_AHB3LPENR_DTCM2LPEN))
  5646. #define __HAL_RCC_C1_ITCM_CLK_SLEEP_ENABLE() (RCC_C1->AHB3LPENR |= (RCC_AHB3LPENR_ITCMLPEN))
  5647. #define __HAL_RCC_C1_D1SRAM1_CLK_SLEEP_ENABLE() (RCC_C1->AHB3LPENR |= (RCC_AHB3LPENR_AXISRAMLPEN))
  5648. #define __HAL_RCC_C1_MDMA_CLK_SLEEP_DISABLE() (RCC_C1->AHB3LPENR &= ~ (RCC_AHB3LPENR_MDMALPEN))
  5649. #define __HAL_RCC_C1_DMA2D_CLK_SLEEP_DISABLE() (RCC_C1->AHB3LPENR &= ~ (RCC_AHB3LPENR_DMA2DLPEN))
  5650. #define __HAL_RCC_C1_JPGDEC_CLK_SLEEP_DISABLE() (RCC_C1->AHB3LPENR &= ~ (RCC_AHB3LPENR_JPGDECLPEN))
  5651. #define __HAL_RCC_C1_FLASH_CLK_SLEEP_DISABLE() (RCC_C1->AHB3LPENR &= ~ (RCC_AHB3LPENR_FLASHLPEN))
  5652. #define __HAL_RCC_C1_FMC_CLK_SLEEP_DISABLE() (RCC_C1->AHB3LPENR &= ~ (RCC_AHB3LPENR_FMCLPEN))
  5653. #define __HAL_RCC_C1_QSPI_CLK_SLEEP_DISABLE() (RCC_C1->AHB3LPENR &= ~ (RCC_AHB3LPENR_QSPILPEN))
  5654. #define __HAL_RCC_C1_SDMMC1_CLK_SLEEP_DISABLE() (RCC_C1->AHB3LPENR &= ~ (RCC_AHB3LPENR_SDMMC1LPEN))
  5655. #define __HAL_RCC_C1_DTCM1_CLK_SLEEP_DISABLE() (RCC_C1->AHB3LPENR &= ~ (RCC_AHB3LPENR_DTCM1LPEN))
  5656. #define __HAL_RCC_C1_DTCM2_CLK_SLEEP_DISABLE() (RCC_C1->AHB3LPENR &= ~ (RCC_AHB3LPENR_DTCM2LPEN))
  5657. #define __HAL_RCC_C1_ITCM_CLK_SLEEP_DISABLE() (RCC_C1->AHB3LPENR &= ~ (RCC_AHB3LPENR_ITCMLPEN))
  5658. #define __HAL_RCC_C1_D1SRAM1_CLK_SLEEP_DISABLE() (RCC_C1->AHB3LPENR &= ~ (RCC_AHB3LPENR_AXISRAMLPEN))
  5659. /** @brief ENABLE or disable the AHB1 peripheral clock during Low Power (Sleep) mode.
  5660. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5661. * power consumption.
  5662. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  5663. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  5664. */
  5665. #define __HAL_RCC_C1_DMA1_CLK_SLEEP_ENABLE() (RCC_C1->AHB1LPENR |= (RCC_AHB1LPENR_DMA1LPEN))
  5666. #define __HAL_RCC_C1_DMA2_CLK_SLEEP_ENABLE() (RCC_C1->AHB1LPENR |= (RCC_AHB1LPENR_DMA2LPEN))
  5667. #define __HAL_RCC_C1_ADC12_CLK_SLEEP_ENABLE() (RCC_C1->AHB1LPENR |= (RCC_AHB1LPENR_ADC12LPEN))
  5668. #define __HAL_RCC_C1_ETH1MAC_CLK_SLEEP_ENABLE() (RCC_C1->AHB1LPENR |= (RCC_AHB1LPENR_ETH1MACLPEN))
  5669. #define __HAL_RCC_C1_ETH1TX_CLK_SLEEP_ENABLE() (RCC_C1->AHB1LPENR |= (RCC_AHB1LPENR_ETH1TXLPEN))
  5670. #define __HAL_RCC_C1_ETH1RX_CLK_SLEEP_ENABLE() (RCC_C1->AHB1LPENR |= (RCC_AHB1LPENR_ETH1RXLPEN))
  5671. #define __HAL_RCC_C1_USB1_OTG_HS_CLK_SLEEP_ENABLE() (RCC_C1->AHB1LPENR |= (RCC_AHB1LPENR_USB1OTGHSLPEN))
  5672. #define __HAL_RCC_C1_USB1_OTG_HS_ULPI_CLK_SLEEP_ENABLE() (RCC_C1->AHB1LPENR |= (RCC_AHB1LPENR_USB1OTGHSULPILPEN))
  5673. #define __HAL_RCC_C1_USB2_OTG_FS_CLK_SLEEP_ENABLE() (RCC_C1->AHB1LPENR |= (RCC_AHB1LPENR_USB2OTGHSLPEN))
  5674. #define __HAL_RCC_C1_USB2_OTG_FS_ULPI_CLK_SLEEP_ENABLE() (RCC_C1->AHB1LPENR |= (RCC_AHB1LPENR_USB2OTGHSULPILPEN))
  5675. #define __HAL_RCC_C1_DMA1_CLK_SLEEP_DISABLE() (RCC_C1->AHB1LPENR &= ~ (RCC_AHB1LPENR_DMA1LPEN))
  5676. #define __HAL_RCC_C1_DMA2_CLK_SLEEP_DISABLE() (RCC_C1->AHB1LPENR &= ~ (RCC_AHB1LPENR_DMA2LPEN))
  5677. #define __HAL_RCC_C1_ADC12_CLK_SLEEP_DISABLE() (RCC_C1->AHB1LPENR &= ~ (RCC_AHB1LPENR_ADC12LPEN))
  5678. #define __HAL_RCC_C1_ETH1MAC_CLK_SLEEP_DISABLE() (RCC_C1->AHB1LPENR &= ~ (RCC_AHB1LPENR_ETH1MACLPEN))
  5679. #define __HAL_RCC_C1_ETH1TX_CLK_SLEEP_DISABLE() (RCC_C1->AHB1LPENR &= ~ (RCC_AHB1LPENR_ETH1TXLPEN))
  5680. #define __HAL_RCC_C1_ETH1RX_CLK_SLEEP_DISABLE() (RCC_C1->AHB1LPENR &= ~ (RCC_AHB1LPENR_ETH1RXLPEN))
  5681. #define __HAL_RCC_C1_USB1_OTG_HS_CLK_SLEEP_DISABLE() (RCC_C1->AHB1LPENR &= ~ (RCC_AHB1LPENR_USB1OTGHSLPEN))
  5682. #define __HAL_RCC_C1_USB1_OTG_HS_ULPI_CLK_SLEEP_DISABLE() (RCC_C1->AHB1LPENR &= ~ (RCC_AHB1LPENR_USB1OTGHSULPILPEN))
  5683. #define __HAL_RCC_C1_USB2_OTG_FS_CLK_SLEEP_DISABLE() (RCC_C1->AHB1LPENR &= ~ (RCC_AHB1LPENR_USB2OTGHSLPEN))
  5684. #define __HAL_RCC_C1_USB2_OTG_FS_ULPI_CLK_SLEEP_DISABLE() (RCC_C1->AHB1LPENR &= ~ (RCC_AHB1LPENR_USB2OTGHSULPILPEN))
  5685. /** @brief ENABLE or disable the AHB2 peripheral clock during Low Power (Sleep) mode.
  5686. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5687. * power consumption.
  5688. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  5689. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  5690. */
  5691. #define __HAL_RCC_C1_DCMI_CLK_SLEEP_ENABLE() (RCC_C1->AHB2LPENR |= (RCC_AHB2LPENR_DCMILPEN))
  5692. #if defined(CRYP)
  5693. #define __HAL_RCC_C1_CRYP_CLK_SLEEP_ENABLE() (RCC_C1->AHB2LPENR |= (RCC_AHB2LPENR_CRYPLPEN))
  5694. #endif /* CRYP */
  5695. #if defined(HASH)
  5696. #define __HAL_RCC_C1_HASH_CLK_SLEEP_ENABLE() (RCC_C1->AHB2LPENR |= (RCC_AHB2LPENR_HASHLPEN))
  5697. #endif /* HASH */
  5698. #define __HAL_RCC_C1_RNG_CLK_SLEEP_ENABLE() (RCC_C1->AHB2LPENR |= (RCC_AHB2LPENR_RNGLPEN))
  5699. #define __HAL_RCC_C1_SDMMC2_CLK_SLEEP_ENABLE() (RCC_C1->AHB2LPENR |= (RCC_AHB2LPENR_SDMMC2LPEN))
  5700. #define __HAL_RCC_C1_D2SRAM1_CLK_SLEEP_ENABLE() (RCC_C1->AHB2LPENR |= (RCC_AHB2LPENR_D2SRAM1LPEN))
  5701. #define __HAL_RCC_C1_D2SRAM2_CLK_SLEEP_ENABLE() (RCC_C1->AHB2LPENR |= (RCC_AHB2LPENR_D2SRAM2LPEN))
  5702. #define __HAL_RCC_C1_D2SRAM3_CLK_SLEEP_ENABLE() (RCC_C1->AHB2LPENR |= (RCC_AHB2LPENR_D2SRAM3LPEN))
  5703. #define __HAL_RCC_C1_DCMI_CLK_SLEEP_DISABLE() (RCC_C1->AHB2LPENR &= ~ (RCC_AHB2LPENR_DCMILPEN))
  5704. #if defined(CRYP)
  5705. #define __HAL_RCC_C1_CRYP_CLK_SLEEP_DISABLE() (RCC_C1->AHB2LPENR &= ~ (RCC_AHB2LPENR_CRYPLPEN))
  5706. #endif /* CRYP */
  5707. #if defined(HASH)
  5708. #define __HAL_RCC_C1_HASH_CLK_SLEEP_DISABLE() (RCC_C1->AHB2LPENR &= ~ (RCC_AHB2LPENR_HASHLPEN))
  5709. #endif /* HASH */
  5710. #define __HAL_RCC_C1_RNG_CLK_SLEEP_DISABLE() (RCC_C1->AHB2LPENR &= ~ (RCC_AHB2LPENR_RNGLPEN))
  5711. #define __HAL_RCC_C1_SDMMC2_CLK_SLEEP_DISABLE() (RCC_C1->AHB2LPENR &= ~ (RCC_AHB2LPENR_SDMMC2LPEN))
  5712. #define __HAL_RCC_C1_D2SRAM1_CLK_SLEEP_DISABLE() (RCC_C1->AHB2LPENR &= ~ (RCC_AHB2LPENR_D2SRAM1LPEN))
  5713. #define __HAL_RCC_C1_D2SRAM2_CLK_SLEEP_DISABLE() (RCC_C1->AHB2LPENR &= ~ (RCC_AHB2LPENR_D2SRAM2LPEN))
  5714. #define __HAL_RCC_C1_D2SRAM3_CLK_SLEEP_DISABLE() (RCC_C1->AHB2LPENR &= ~ (RCC_AHB2LPENR_D2SRAM3LPEN))
  5715. /** @brief ENABLE or disable the AHB4 peripheral clock during Low Power (Sleep) mode.
  5716. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5717. * power consumption.
  5718. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  5719. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  5720. */
  5721. #define __HAL_RCC_C1_GPIOA_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOALPEN)
  5722. #define __HAL_RCC_C1_GPIOB_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOBLPEN)
  5723. #define __HAL_RCC_C1_GPIOC_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOCLPEN)
  5724. #define __HAL_RCC_C1_GPIOD_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR) |= (RCC_AHB4LPENR_GPIODLPEN)
  5725. #define __HAL_RCC_C1_GPIOE_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOELPEN)
  5726. #define __HAL_RCC_C1_GPIOF_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOFLPEN)
  5727. #define __HAL_RCC_C1_GPIOG_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOGLPEN)
  5728. #define __HAL_RCC_C1_GPIOH_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOHLPEN)
  5729. #define __HAL_RCC_C1_GPIOI_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOILPEN)
  5730. #define __HAL_RCC_C1_GPIOJ_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOJLPEN)
  5731. #define __HAL_RCC_C1_GPIOK_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOKLPEN)
  5732. #define __HAL_RCC_C1_CRC_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR) |= (RCC_AHB4LPENR_CRCLPEN)
  5733. #define __HAL_RCC_C1_BDMA_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR) |= (RCC_AHB4LPENR_BDMALPEN)
  5734. #define __HAL_RCC_C1_ADC3_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR) |= (RCC_AHB4LPENR_ADC3LPEN)
  5735. #define __HAL_RCC_C1_BKPRAM_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR) |= (RCC_AHB4LPENR_BKPRAMLPEN)
  5736. #define __HAL_RCC_C1_D3SRAM1_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR |= (RCC_AHB4LPENR_D3SRAM1LPEN))
  5737. #define __HAL_RCC_C1_GPIOA_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOALPEN)
  5738. #define __HAL_RCC_C1_GPIOB_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOBLPEN)
  5739. #define __HAL_RCC_C1_GPIOC_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOCLPEN)
  5740. #define __HAL_RCC_C1_GPIOD_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIODLPEN)
  5741. #define __HAL_RCC_C1_GPIOE_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOELPEN)
  5742. #define __HAL_RCC_C1_GPIOF_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOFLPEN)
  5743. #define __HAL_RCC_C1_GPIOG_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOGLPEN)
  5744. #define __HAL_RCC_C1_GPIOH_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOHLPEN)
  5745. #define __HAL_RCC_C1_GPIOI_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOILPEN)
  5746. #define __HAL_RCC_C1_GPIOJ_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOJLPEN)
  5747. #define __HAL_RCC_C1_GPIOK_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOKLPEN)
  5748. #define __HAL_RCC_C1_CRC_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR) &= ~ (RCC_AHB4LPENR_CRCLPEN)
  5749. #define __HAL_RCC_C1_BDMA_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR) &= ~ (RCC_AHB4LPENR_BDMALPEN)
  5750. #define __HAL_RCC_C1_ADC3_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR) &= ~ (RCC_AHB4LPENR_ADC3LPEN)
  5751. #define __HAL_RCC_C1_BKPRAM_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR) &= ~ (RCC_AHB4LPENR_BKPRAMLPEN)
  5752. #define __HAL_RCC_C1_D3SRAM1_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR &= ~ (RCC_AHB4LPENR_D3SRAM1LPEN))
  5753. /** @brief ENABLE or disable the APB3 peripheral clock during Low Power (Sleep) mode.
  5754. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5755. * power consumption.
  5756. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  5757. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  5758. */
  5759. #define __HAL_RCC_C1_LTDC_CLK_SLEEP_ENABLE() (RCC_C1->APB3LPENR) |= (RCC_APB3LPENR_LTDCLPEN)
  5760. #define __HAL_RCC_C1_DSI_CLK_SLEEP_ENABLE() (RCC_C1->APB3LPENR) |= (RCC_APB3LPENR_DSILPEN)
  5761. #define __HAL_RCC_C1_WWDG1_CLK_SLEEP_ENABLE() (RCC_C1->APB3LPENR) |= (RCC_APB3LPENR_WWDG1LPEN)
  5762. #define __HAL_RCC_C1_LTDC_CLK_SLEEP_DISABLE() (RCC_C1->APB3LPENR) &= ~ (RCC_APB3LPENR_LTDCLPEN)
  5763. #define __HAL_RCC_C1_DSI_CLK_SLEEP_DISABLE() (RCC_C1->APB3LPENR) &= ~ (RCC_APB3LPENR_DSILPEN)
  5764. #define __HAL_RCC_C1_WWDG1_CLK_SLEEP_DISABLE() (RCC_C1->APB3LPENR) &= ~ (RCC_APB3LPENR_WWDG1LPEN)
  5765. /** @brief ENABLE or disable the APB1 peripheral clock during Low Power (Sleep) mode.
  5766. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5767. * power consumption.
  5768. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  5769. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  5770. */
  5771. #define __HAL_RCC_C1_TIM2_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_TIM2LPEN)
  5772. #define __HAL_RCC_C1_TIM3_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_TIM3LPEN)
  5773. #define __HAL_RCC_C1_TIM4_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_TIM4LPEN)
  5774. #define __HAL_RCC_C1_TIM5_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_TIM5LPEN)
  5775. #define __HAL_RCC_C1_TIM6_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_TIM6LPEN)
  5776. #define __HAL_RCC_C1_TIM7_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_TIM7LPEN)
  5777. #define __HAL_RCC_C1_TIM12_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_TIM12LPEN)
  5778. #define __HAL_RCC_C1_TIM13_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_TIM13LPEN)
  5779. #define __HAL_RCC_C1_TIM14_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_TIM14LPEN)
  5780. #define __HAL_RCC_C1_LPTIM1_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_LPTIM1LPEN)
  5781. #define __HAL_RCC_C1_WWDG2_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_WWDG2LPEN)
  5782. #define __HAL_RCC_C1_SPI2_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_SPI2LPEN)
  5783. #define __HAL_RCC_C1_SPI3_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_SPI3LPEN)
  5784. #define __HAL_RCC_C1_SPDIFRX_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_SPDIFRXLPEN)
  5785. #define __HAL_RCC_C1_USART2_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_USART2LPEN)
  5786. #define __HAL_RCC_C1_USART3_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_USART3LPEN)
  5787. #define __HAL_RCC_C1_UART4_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_UART4LPEN)
  5788. #define __HAL_RCC_C1_UART5_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_UART5LPEN)
  5789. #define __HAL_RCC_C1_I2C1_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_I2C1LPEN)
  5790. #define __HAL_RCC_C1_I2C2_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_I2C2LPEN)
  5791. #define __HAL_RCC_C1_I2C3_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_I2C3LPEN)
  5792. #define __HAL_RCC_C1_CEC_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_CECLPEN)
  5793. #define __HAL_RCC_C1_DAC12_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_DAC12LPEN)
  5794. #define __HAL_RCC_C1_UART7_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_UART7LPEN)
  5795. #define __HAL_RCC_C1_UART8_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_UART8LPEN)
  5796. #define __HAL_RCC_C1_CRS_CLK_SLEEP_ENABLE() (RCC_C1->APB1HLPENR) |= (RCC_APB1HLPENR_CRSLPEN)
  5797. #define __HAL_RCC_C1_SWPMI_CLK_SLEEP_ENABLE() (RCC_C1->APB1HLPENR) |= (RCC_APB1HLPENR_SWPMILPEN)
  5798. #define __HAL_RCC_C1_OPAMP_CLK_SLEEP_ENABLE() (RCC_C1->APB1HLPENR) |= (RCC_APB1HLPENR_OPAMPLPEN)
  5799. #define __HAL_RCC_C1_MDIOS_CLK_SLEEP_ENABLE() (RCC_C1->APB1HLPENR) |= (RCC_APB1HLPENR_MDIOSLPEN)
  5800. #define __HAL_RCC_C1_FDCAN_CLK_SLEEP_ENABLE() (RCC_C1->APB1HLPENR) |= (RCC_APB1HLPENR_FDCANLPEN)
  5801. #define __HAL_RCC_C1_TIM2_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM2LPEN)
  5802. #define __HAL_RCC_C1_TIM3_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM3LPEN)
  5803. #define __HAL_RCC_C1_TIM4_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM4LPEN)
  5804. #define __HAL_RCC_C1_TIM5_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM5LPEN)
  5805. #define __HAL_RCC_C1_TIM6_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM6LPEN)
  5806. #define __HAL_RCC_C1_TIM7_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM7LPEN)
  5807. #define __HAL_RCC_C1_TIM12_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM12LPEN)
  5808. #define __HAL_RCC_C1_TIM13_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM13LPEN)
  5809. #define __HAL_RCC_C1_TIM14_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM14LPEN)
  5810. #define __HAL_RCC_C1_LPTIM1_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_LPTIM1LPEN)
  5811. #define __HAL_RCC_C1_WWDG2_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_WWDG2LPEN)
  5812. #define __HAL_RCC_C1_SPI2_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_SPI2LPEN)
  5813. #define __HAL_RCC_C1_SPI3_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_SPI3LPEN)
  5814. #define __HAL_RCC_C1_SPDIFRX_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_SPDIFRXLPEN)
  5815. #define __HAL_RCC_C1_USART2_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_USART2LPEN)
  5816. #define __HAL_RCC_C1_USART3_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_USART3LPEN)
  5817. #define __HAL_RCC_C1_UART4_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_UART4LPEN)
  5818. #define __HAL_RCC_C1_UART5_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_UART5LPEN)
  5819. #define __HAL_RCC_C1_I2C1_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_I2C1LPEN)
  5820. #define __HAL_RCC_C1_I2C2_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_I2C2LPEN)
  5821. #define __HAL_RCC_C1_I2C3_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_I2C3LPEN)
  5822. #define __HAL_RCC_C1_CEC_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_CECLPEN)
  5823. #define __HAL_RCC_C1_DAC12_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_DAC12LPEN)
  5824. #define __HAL_RCC_C1_UART7_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_UART7LPEN)
  5825. #define __HAL_RCC_C1_UART8_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_UART8LPEN)
  5826. #define __HAL_RCC_C1_CRS_CLK_SLEEP_DISABLE() (RCC_C1->APB1HLPENR) &= ~ (RCC_APB1HLPENR_CRSLPEN)
  5827. #define __HAL_RCC_C1_SWPMI_CLK_SLEEP_DISABLE() (RCC_C1->APB1HLPENR) &= ~ (RCC_APB1HLPENR_SWPMILPEN)
  5828. #define __HAL_RCC_C1_OPAMP_CLK_SLEEP_DISABLE() (RCC_C1->APB1HLPENR) &= ~ (RCC_APB1HLPENR_OPAMPLPEN)
  5829. #define __HAL_RCC_C1_MDIOS_CLK_SLEEP_DISABLE() (RCC_C1->APB1HLPENR) &= ~ (RCC_APB1HLPENR_MDIOSLPEN)
  5830. #define __HAL_RCC_C1_FDCAN_CLK_SLEEP_DISABLE() (RCC_C1->APB1HLPENR) &= ~ (RCC_APB1HLPENR_FDCANLPEN)
  5831. /** @brief ENABLE or disable the APB2 peripheral clock during Low Power (Sleep) mode.
  5832. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5833. * power consumption.
  5834. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  5835. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  5836. */
  5837. #define __HAL_RCC_C1_TIM1_CLK_SLEEP_ENABLE() (RCC_C1->APB2LPENR) |= (RCC_APB2LPENR_TIM1LPEN)
  5838. #define __HAL_RCC_C1_TIM8_CLK_SLEEP_ENABLE() (RCC_C1->APB2LPENR) |= (RCC_APB2LPENR_TIM8LPEN)
  5839. #define __HAL_RCC_C1_USART1_CLK_SLEEP_ENABLE() (RCC_C1->APB2LPENR) |= (RCC_APB2LPENR_USART1LPEN)
  5840. #define __HAL_RCC_C1_USART6_CLK_SLEEP_ENABLE() (RCC_C1->APB2LPENR) |= (RCC_APB2LPENR_USART6LPEN)
  5841. #define __HAL_RCC_C1_SPI1_CLK_SLEEP_ENABLE() (RCC_C1->APB2LPENR) |= (RCC_APB2LPENR_SPI1LPEN)
  5842. #define __HAL_RCC_C1_SPI4_CLK_SLEEP_ENABLE() (RCC_C1->APB2LPENR) |= (RCC_APB2LPENR_SPI4LPEN)
  5843. #define __HAL_RCC_C1_TIM15_CLK_SLEEP_ENABLE() (RCC_C1->APB2LPENR) |= (RCC_APB2LPENR_TIM15LPEN)
  5844. #define __HAL_RCC_C1_TIM16_CLK_SLEEP_ENABLE() (RCC_C1->APB2LPENR) |= (RCC_APB2LPENR_TIM16LPEN)
  5845. #define __HAL_RCC_C1_TIM17_CLK_SLEEP_ENABLE() (RCC_C1->APB2LPENR) |= (RCC_APB2LPENR_TIM17LPEN)
  5846. #define __HAL_RCC_C1_SPI5_CLK_SLEEP_ENABLE() (RCC_C1->APB2LPENR) |= (RCC_APB2LPENR_SPI5LPEN)
  5847. #define __HAL_RCC_C1_SAI1_CLK_SLEEP_ENABLE() (RCC_C1->APB2LPENR) |= (RCC_APB2LPENR_SAI1LPEN)
  5848. #define __HAL_RCC_C1_SAI2_CLK_SLEEP_ENABLE() (RCC_C1->APB2LPENR) |= (RCC_APB2LPENR_SAI2LPEN)
  5849. #define __HAL_RCC_C1_SAI3_CLK_SLEEP_ENABLE() (RCC_C1->APB2LPENR) |= (RCC_APB2LPENR_SAI3LPEN)
  5850. #define __HAL_RCC_C1_DFSDM1_CLK_SLEEP_ENABLE() (RCC_C1->APB2LPENR) |= (RCC_APB2LPENR_DFSDM1LPEN)
  5851. #define __HAL_RCC_C1_HRTIM1_CLK_SLEEP_ENABLE() (RCC_C1->APB2LPENR) |= (RCC_APB2LPENR_HRTIMLPEN)
  5852. #define __HAL_RCC_C1_TIM1_CLK_SLEEP_DISABLE() (RCC_C1->APB2LPENR) &= ~ (RCC_APB2LPENR_TIM1LPEN)
  5853. #define __HAL_RCC_C1_TIM8_CLK_SLEEP_DISABLE() (RCC_C1->APB2LPENR) &= ~ (RCC_APB2LPENR_TIM8LPEN)
  5854. #define __HAL_RCC_C1_USART1_CLK_SLEEP_DISABLE() (RCC_C1->APB2LPENR) &= ~ (RCC_APB2LPENR_USART1LPEN)
  5855. #define __HAL_RCC_C1_USART6_CLK_SLEEP_DISABLE() (RCC_C1->APB2LPENR) &= ~ (RCC_APB2LPENR_USART6LPEN)
  5856. #define __HAL_RCC_C1_SPI1_CLK_SLEEP_DISABLE() (RCC_C1->APB2LPENR) &= ~ (RCC_APB2LPENR_SPI1LPEN)
  5857. #define __HAL_RCC_C1_SPI4_CLK_SLEEP_DISABLE() (RCC_C1->APB2LPENR) &= ~ (RCC_APB2LPENR_SPI4LPEN)
  5858. #define __HAL_RCC_C1_TIM15_CLK_SLEEP_DISABLE() (RCC_C1->APB2LPENR) &= ~ (RCC_APB2LPENR_TIM15LPEN)
  5859. #define __HAL_RCC_C1_TIM16_CLK_SLEEP_DISABLE() (RCC_C1->APB2LPENR) &= ~ (RCC_APB2LPENR_TIM16LPEN)
  5860. #define __HAL_RCC_C1_TIM17_CLK_SLEEP_DISABLE() (RCC_C1->APB2LPENR) &= ~ (RCC_APB2LPENR_TIM17LPEN)
  5861. #define __HAL_RCC_C1_SPI5_CLK_SLEEP_DISABLE() (RCC_C1->APB2LPENR) &= ~ (RCC_APB2LPENR_SPI5LPEN)
  5862. #define __HAL_RCC_C1_SAI1_CLK_SLEEP_DISABLE() (RCC_C1->APB2LPENR) &= ~ (RCC_APB2LPENR_SAI1LPEN)
  5863. #define __HAL_RCC_C1_SAI2_CLK_SLEEP_DISABLE() (RCC_C1->APB2LPENR) &= ~ (RCC_APB2LPENR_SAI2LPEN)
  5864. #define __HAL_RCC_C1_SAI3_CLK_SLEEP_DISABLE() (RCC_C1->APB2LPENR) &= ~ (RCC_APB2LPENR_SAI3LPEN)
  5865. #define __HAL_RCC_C1_DFSDM1_CLK_SLEEP_DISABLE() (RCC_C1->APB2LPENR) &= ~ (RCC_APB2LPENR_DFSDM1LPEN)
  5866. #define __HAL_RCC_C1_HRTIM1_CLK_SLEEP_DISABLE() (RCC_C1->APB2LPENR) &= ~ (RCC_APB2LPENR_HRTIMLPEN)
  5867. /** @brief ENABLE or disable the APB4 peripheral clock during Low Power (Sleep) mode.
  5868. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5869. * power consumption.
  5870. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  5871. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  5872. */
  5873. #define __HAL_RCC_C1_SYSCFG_CLK_SLEEP_ENABLE() (RCC_C1->APB4LPENR) |= (RCC_APB4LPENR_SYSCFGLPEN)
  5874. #define __HAL_RCC_C1_LPUART1_CLK_SLEEP_ENABLE() (RCC_C1->APB4LPENR) |= (RCC_APB4LPENR_LPUART1LPEN)
  5875. #define __HAL_RCC_C1_SPI6_CLK_SLEEP_ENABLE() (RCC_C1->APB4LPENR) |= (RCC_APB4LPENR_SPI6LPEN)
  5876. #define __HAL_RCC_C1_I2C4_CLK_SLEEP_ENABLE() (RCC_C1->APB4LPENR) |= (RCC_APB4LPENR_I2C4LPEN)
  5877. #define __HAL_RCC_C1_LPTIM2_CLK_SLEEP_ENABLE() (RCC_C1->APB4LPENR) |= (RCC_APB4LPENR_LPTIM2LPEN)
  5878. #define __HAL_RCC_C1_LPTIM3_CLK_SLEEP_ENABLE() (RCC_C1->APB4LPENR) |= (RCC_APB4LPENR_LPTIM3LPEN)
  5879. #define __HAL_RCC_C1_LPTIM4_CLK_SLEEP_ENABLE() (RCC_C1->APB4LPENR) |= (RCC_APB4LPENR_LPTIM4LPEN)
  5880. #define __HAL_RCC_C1_LPTIM5_CLK_SLEEP_ENABLE() (RCC_C1->APB4LPENR) |= (RCC_APB4LPENR_LPTIM5LPEN)
  5881. #define __HAL_RCC_C1_COMP12_CLK_SLEEP_ENABLE() (RCC_C1->APB4LPENR) |= (RCC_APB4LPENR_COMP12LPEN)
  5882. #define __HAL_RCC_C1_VREF_CLK_SLEEP_ENABLE() (RCC_C1->APB4LPENR) |= (RCC_APB4LPENR_VREFLPEN)
  5883. #define __HAL_RCC_C1_SAI4_CLK_SLEEP_ENABLE() (RCC_C1->APB4LPENR) |= (RCC_APB4LPENR_SAI4LPEN)
  5884. #define __HAL_RCC_C1_RTC_CLK_SLEEP_ENABLE() (RCC_C1->APB4LPENR) |= (RCC_APB4LPENR_RTCAPBLPEN)
  5885. #define __HAL_RCC_C1_SYSCFG_CLK_SLEEP_DISABLE() (RCC_C1->APB4LPENR) &= ~ (RCC_APB4LPENR_SYSCFGLPEN)
  5886. #define __HAL_RCC_C1_LPUART1_CLK_SLEEP_DISABLE() (RCC_C1->APB4LPENR) &= ~ (RCC_APB4LPENR_LPUART1LPEN)
  5887. #define __HAL_RCC_C1_SPI6_CLK_SLEEP_DISABLE() (RCC_C1->APB4LPENR) &= ~ (RCC_APB4LPENR_SPI6LPEN)
  5888. #define __HAL_RCC_C1_I2C4_CLK_SLEEP_DISABLE() (RCC_C1->APB4LPENR) &= ~ (RCC_APB4LPENR_I2C4LPEN)
  5889. #define __HAL_RCC_C1_LPTIM2_CLK_SLEEP_DISABLE() (RCC_C1->APB4LPENR) &= ~ (RCC_APB4LPENR_LPTIM2LPEN)
  5890. #define __HAL_RCC_C1_LPTIM3_CLK_SLEEP_DISABLE() (RCC_C1->APB4LPENR) &= ~ (RCC_APB4LPENR_LPTIM3LPEN)
  5891. #define __HAL_RCC_C1_LPTIM4_CLK_SLEEP_DISABLE() (RCC_C1->APB4LPENR) &= ~ (RCC_APB4LPENR_LPTIM4LPEN)
  5892. #define __HAL_RCC_C1_LPTIM5_CLK_SLEEP_DISABLE() (RCC_C1->APB4LPENR) &= ~ (RCC_APB4LPENR_LPTIM5LPEN)
  5893. #define __HAL_RCC_C1_COMP12_CLK_SLEEP_DISABLE() (RCC_C1->APB4LPENR) &= ~ (RCC_APB4LPENR_COMP12LPEN)
  5894. #define __HAL_RCC_C1_VREF_CLK_SLEEP_DISABLE() (RCC_C1->APB4LPENR) &= ~ (RCC_APB4LPENR_VREFLPEN)
  5895. #define __HAL_RCC_C1_SAI4_CLK_SLEEP_DISABLE() (RCC_C1->APB4LPENR) &= ~ (RCC_APB4LPENR_SAI4LPEN)
  5896. #define __HAL_RCC_C1_RTC_CLK_SLEEP_DISABLE() (RCC_C1->APB4LPENR) &= ~ (RCC_APB4LPENR_RTCAPBLPEN)
  5897. /** @brief Enable or disable the RCC_C2 AHB3 peripheral clock during Low Power (Sleep) mode.
  5898. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5899. * power consumption.
  5900. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
  5901. * @note By default, all peripheral clocks are enabled during SLEEP mode.
  5902. */
  5903. #define __HAL_RCC_C2_MDMA_CLK_SLEEP_ENABLE() (RCC_C2->AHB3LPENR |= (RCC_AHB3LPENR_MDMALPEN))
  5904. #define __HAL_RCC_C2_DMA2D_CLK_SLEEP_ENABLE() (RCC_C2->AHB3LPENR |= (RCC_AHB3LPENR_DMA2DLPEN))
  5905. #define __HAL_RCC_C2_JPGDEC_CLK_SLEEP_ENABLE() (RCC_C2->AHB3LPENR |= (RCC_AHB3LPENR_JPGDECLPEN))
  5906. #define __HAL_RCC_C2_FLASH_CLK_SLEEP_ENABLE() (RCC_C2->AHB3LPENR |= (RCC_AHB3LPENR_FLASHLPEN))
  5907. #define __HAL_RCC_C2_FMC_CLK_SLEEP_ENABLE() (RCC_C2->AHB3LPENR |= (RCC_AHB3LPENR_FMCLPEN))
  5908. #define __HAL_RCC_C2_QSPI_CLK_SLEEP_ENABLE() (RCC_C2->AHB3LPENR |= (RCC_AHB3LPENR_QSPILPEN))
  5909. #define __HAL_RCC_C2_SDMMC1_CLK_SLEEP_ENABLE() (RCC_C2->AHB3LPENR |= (RCC_AHB3LPENR_SDMMC1LPEN))
  5910. #define __HAL_RCC_C2_DTCM1_CLK_SLEEP_ENABLE() (RCC_C2->AHB3LPENR |= (RCC_AHB3LPENR_DTCM1LPEN))
  5911. #define __HAL_RCC_C2_DTCM2_CLK_SLEEP_ENABLE() (RCC_C2->AHB3LPENR |= (RCC_AHB3LPENR_DTCM2LPEN))
  5912. #define __HAL_RCC_C2_ITCM_CLK_SLEEP_ENABLE() (RCC_C2->AHB3LPENR |= (RCC_AHB3LPENR_ITCMLPEN))
  5913. #define __HAL_RCC_C2_D1SRAM1_CLK_SLEEP_ENABLE() (RCC_C2->AHB3LPENR |= (RCC_AHB3LPENR_AXISRAMLPEN))
  5914. #define __HAL_RCC_C2_MDMA_CLK_SLEEP_DISABLE() (RCC_C2->AHB3LPENR &= ~ (RCC_AHB3LPENR_MDMALPEN))
  5915. #define __HAL_RCC_C2_DMA2D_CLK_SLEEP_DISABLE() (RCC_C2->AHB3LPENR &= ~ (RCC_AHB3LPENR_DMA2DLPEN))
  5916. #define __HAL_RCC_C2_JPGDEC_CLK_SLEEP_DISABLE() (RCC_C2->AHB3LPENR &= ~ (RCC_AHB3LPENR_JPGDECLPEN))
  5917. #define __HAL_RCC_C2_FLASH_CLK_SLEEP_DISABLE() (RCC_C2->AHB3LPENR &= ~ (RCC_AHB3LPENR_FLASHLPEN))
  5918. #define __HAL_RCC_C2_FMC_CLK_SLEEP_DISABLE() (RCC_C2->AHB3LPENR &= ~ (RCC_AHB3LPENR_FMCLPEN))
  5919. #define __HAL_RCC_C2_QSPI_CLK_SLEEP_DISABLE() (RCC_C2->AHB3LPENR &= ~ (RCC_AHB3LPENR_QSPILPEN))
  5920. #define __HAL_RCC_C2_SDMMC1_CLK_SLEEP_DISABLE() (RCC_C2->AHB3LPENR &= ~ (RCC_AHB3LPENR_SDMMC1LPEN))
  5921. #define __HAL_RCC_C2_DTCM1_CLK_SLEEP_DISABLE() (RCC_C2->AHB3LPENR &= ~ (RCC_AHB3LPENR_DTCM1LPEN))
  5922. #define __HAL_RCC_C2_DTCM2_CLK_SLEEP_DISABLE() (RCC_C2->AHB3LPENR &= ~ (RCC_AHB3LPENR_DTCM2LPEN))
  5923. #define __HAL_RCC_C2_ITCM_CLK_SLEEP_DISABLE() (RCC_C2->AHB3LPENR &= ~ (RCC_AHB3LPENR_ITCMLPEN))
  5924. #define __HAL_RCC_C2_D1SRAM1_CLK_SLEEP_DISABLE() (RCC_C2->AHB3LPENR &= ~ (RCC_AHB3LPENR_AXISRAMLPEN))
  5925. /** @brief ENABLE or disable the AHB1 peripheral clock during Low Power (Sleep) mode.
  5926. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5927. * power consumption.
  5928. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  5929. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  5930. */
  5931. #define __HAL_RCC_C2_DMA1_CLK_SLEEP_ENABLE() (RCC_C2->AHB1LPENR |= (RCC_AHB1LPENR_DMA1LPEN))
  5932. #define __HAL_RCC_C2_DMA2_CLK_SLEEP_ENABLE() (RCC_C2->AHB1LPENR |= (RCC_AHB1LPENR_DMA2LPEN))
  5933. #define __HAL_RCC_C2_ADC12_CLK_SLEEP_ENABLE() (RCC_C2->AHB1LPENR |= (RCC_AHB1LPENR_ADC12LPEN))
  5934. #define __HAL_RCC_C2_ETH1MAC_CLK_SLEEP_ENABLE() (RCC_C2->AHB1LPENR |= (RCC_AHB1LPENR_ETH1MACLPEN))
  5935. #define __HAL_RCC_C2_ETH1TX_CLK_SLEEP_ENABLE() (RCC_C2->AHB1LPENR |= (RCC_AHB1LPENR_ETH1TXLPEN))
  5936. #define __HAL_RCC_C2_ETH1RX_CLK_SLEEP_ENABLE() (RCC_C2->AHB1LPENR |= (RCC_AHB1LPENR_ETH1RXLPEN))
  5937. #define __HAL_RCC_C2_USB1_OTG_HS_CLK_SLEEP_ENABLE() (RCC_C2->AHB1LPENR |= (RCC_AHB1LPENR_USB1OTGHSLPEN))
  5938. #define __HAL_RCC_C2_USB1_OTG_HS_ULPI_CLK_SLEEP_ENABLE() (RCC_C2->AHB1LPENR |= (RCC_AHB1LPENR_USB1OTGHSULPILPEN))
  5939. #define __HAL_RCC_C2_USB2_OTG_FS_CLK_SLEEP_ENABLE() (RCC_C2->AHB1LPENR |= (RCC_AHB1LPENR_USB2OTGHSLPEN))
  5940. #define __HAL_RCC_C2_USB2_OTG_FS_ULPI_CLK_SLEEP_ENABLE() (RCC_C2->AHB1LPENR |= (RCC_AHB1LPENR_USB2OTGHSULPILPEN))
  5941. #define __HAL_RCC_C2_DMA1_CLK_SLEEP_DISABLE() (RCC_C2->AHB1LPENR &= ~ (RCC_AHB1LPENR_DMA1LPEN))
  5942. #define __HAL_RCC_C2_DMA2_CLK_SLEEP_DISABLE() (RCC_C2->AHB1LPENR &= ~ (RCC_AHB1LPENR_DMA2LPEN))
  5943. #define __HAL_RCC_C2_ADC12_CLK_SLEEP_DISABLE() (RCC_C2->AHB1LPENR &= ~ (RCC_AHB1LPENR_ADC12LPEN))
  5944. #define __HAL_RCC_C2_ETH1MAC_CLK_SLEEP_DISABLE() (RCC_C2->AHB1LPENR &= ~ (RCC_AHB1LPENR_ETH1MACLPEN))
  5945. #define __HAL_RCC_C2_ETH1TX_CLK_SLEEP_DISABLE() (RCC_C2->AHB1LPENR &= ~ (RCC_AHB1LPENR_ETH1TXLPEN))
  5946. #define __HAL_RCC_C2_ETH1RX_CLK_SLEEP_DISABLE() (RCC_C2->AHB1LPENR &= ~ (RCC_AHB1LPENR_ETH1RXLPEN))
  5947. #define __HAL_RCC_C2_USB1_OTG_HS_CLK_SLEEP_DISABLE() (RCC_C2->AHB1LPENR &= ~ (RCC_AHB1LPENR_USB1OTGHSLPEN))
  5948. #define __HAL_RCC_C2_USB1_OTG_HS_ULPI_CLK_SLEEP_DISABLE() (RCC_C2->AHB1LPENR &= ~ (RCC_AHB1LPENR_USB1OTGHSULPILPEN))
  5949. #define __HAL_RCC_C2_USB2_OTG_FS_CLK_SLEEP_DISABLE() (RCC_C2->AHB1LPENR &= ~ (RCC_AHB1LPENR_USB2OTGHSLPEN))
  5950. #define __HAL_RCC_C2_USB2_OTG_FS_ULPI_CLK_SLEEP_DISABLE() (RCC_C2->AHB1LPENR &= ~ (RCC_AHB1LPENR_USB2OTGHSULPILPEN))
  5951. /** @brief ENABLE or disable the AHB2 peripheral clock during Low Power (Sleep) mode.
  5952. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5953. * power consumption.
  5954. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  5955. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  5956. */
  5957. #define __HAL_RCC_C2_DCMI_CLK_SLEEP_ENABLE() (RCC_C2->AHB2LPENR |= (RCC_AHB2LPENR_DCMILPEN))
  5958. #if defined(CRYP)
  5959. #define __HAL_RCC_C2_CRYP_CLK_SLEEP_ENABLE() (RCC_C2->AHB2LPENR |= (RCC_AHB2LPENR_CRYPLPEN))
  5960. #endif /* CRYP */
  5961. #if defined(HASH)
  5962. #define __HAL_RCC_C2_HASH_CLK_SLEEP_ENABLE() (RCC_C2->AHB2LPENR |= (RCC_AHB2LPENR_HASHLPEN))
  5963. #endif /* HASH */
  5964. #define __HAL_RCC_C2_RNG_CLK_SLEEP_ENABLE() (RCC_C2->AHB2LPENR |= (RCC_AHB2LPENR_RNGLPEN))
  5965. #define __HAL_RCC_C2_SDMMC2_CLK_SLEEP_ENABLE() (RCC_C2->AHB2LPENR |= (RCC_AHB2LPENR_SDMMC2LPEN))
  5966. #define __HAL_RCC_C2_D2SRAM1_CLK_SLEEP_ENABLE() (RCC_C2->AHB2LPENR |= (RCC_AHB2LPENR_D2SRAM1LPEN))
  5967. #define __HAL_RCC_C2_D2SRAM2_CLK_SLEEP_ENABLE() (RCC_C2->AHB2LPENR |= (RCC_AHB2LPENR_D2SRAM2LPEN))
  5968. #define __HAL_RCC_C2_D2SRAM3_CLK_SLEEP_ENABLE() (RCC_C2->AHB2LPENR |= (RCC_AHB2LPENR_D2SRAM3LPEN))
  5969. #define __HAL_RCC_C2_DCMI_CLK_SLEEP_DISABLE() (RCC_C2->AHB2LPENR &= ~ (RCC_AHB2LPENR_DCMILPEN))
  5970. #if defined(CRYP)
  5971. #define __HAL_RCC_C2_CRYP_CLK_SLEEP_DISABLE() (RCC_C2->AHB2LPENR &= ~ (RCC_AHB2LPENR_CRYPLPEN))
  5972. #endif /* CRYP */
  5973. #if defined(HASH)
  5974. #define __HAL_RCC_C2_HASH_CLK_SLEEP_DISABLE() (RCC_C2->AHB2LPENR &= ~ (RCC_AHB2LPENR_HASHLPEN))
  5975. #endif /* HASH */
  5976. #define __HAL_RCC_C2_RNG_CLK_SLEEP_DISABLE() (RCC_C2->AHB2LPENR &= ~ (RCC_AHB2LPENR_RNGLPEN))
  5977. #define __HAL_RCC_C2_SDMMC2_CLK_SLEEP_DISABLE() (RCC_C2->AHB2LPENR &= ~ (RCC_AHB2LPENR_SDMMC2LPEN))
  5978. #define __HAL_RCC_C2_D2SRAM1_CLK_SLEEP_DISABLE() (RCC_C2->AHB2LPENR &= ~ (RCC_AHB2LPENR_D2SRAM1LPEN))
  5979. #define __HAL_RCC_C2_D2SRAM2_CLK_SLEEP_DISABLE() (RCC_C2->AHB2LPENR &= ~ (RCC_AHB2LPENR_D2SRAM2LPEN))
  5980. #define __HAL_RCC_C2_D2SRAM3_CLK_SLEEP_DISABLE() (RCC_C2->AHB2LPENR &= ~ (RCC_AHB2LPENR_D2SRAM3LPEN))
  5981. /** @brief ENABLE or disable the AHB4 peripheral clock during Low Power (Sleep) mode.
  5982. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5983. * power consumption.
  5984. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  5985. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  5986. */
  5987. #define __HAL_RCC_C2_GPIOA_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOALPEN)
  5988. #define __HAL_RCC_C2_GPIOB_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOBLPEN)
  5989. #define __HAL_RCC_C2_GPIOC_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOCLPEN)
  5990. #define __HAL_RCC_C2_GPIOD_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR) |= (RCC_AHB4LPENR_GPIODLPEN)
  5991. #define __HAL_RCC_C2_GPIOE_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOELPEN)
  5992. #define __HAL_RCC_C2_GPIOF_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOFLPEN)
  5993. #define __HAL_RCC_C2_GPIOG_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOGLPEN)
  5994. #define __HAL_RCC_C2_GPIOH_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOHLPEN)
  5995. #define __HAL_RCC_C2_GPIOI_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOILPEN)
  5996. #define __HAL_RCC_C2_GPIOJ_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOJLPEN)
  5997. #define __HAL_RCC_C2_GPIOK_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOKLPEN)
  5998. #define __HAL_RCC_C2_CRC_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR) |= (RCC_AHB4LPENR_CRCLPEN)
  5999. #define __HAL_RCC_C2_BDMA_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR) |= (RCC_AHB4LPENR_BDMALPEN)
  6000. #define __HAL_RCC_C2_ADC3_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR) |= (RCC_AHB4LPENR_ADC3LPEN)
  6001. #define __HAL_RCC_C2_BKPRAM_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR) |= (RCC_AHB4LPENR_BKPRAMLPEN)
  6002. #define __HAL_RCC_C2_D3SRAM1_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR |= (RCC_AHB4LPENR_D3SRAM1LPEN))
  6003. #define __HAL_RCC_C2_GPIOA_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOALPEN)
  6004. #define __HAL_RCC_C2_GPIOB_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOBLPEN)
  6005. #define __HAL_RCC_C2_GPIOC_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOCLPEN)
  6006. #define __HAL_RCC_C2_GPIOD_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIODLPEN)
  6007. #define __HAL_RCC_C2_GPIOE_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOELPEN)
  6008. #define __HAL_RCC_C2_GPIOF_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOFLPEN)
  6009. #define __HAL_RCC_C2_GPIOG_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOGLPEN)
  6010. #define __HAL_RCC_C2_GPIOH_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOHLPEN)
  6011. #define __HAL_RCC_C2_GPIOI_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOILPEN)
  6012. #define __HAL_RCC_C2_GPIOJ_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOJLPEN)
  6013. #define __HAL_RCC_C2_GPIOK_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOKLPEN)
  6014. #define __HAL_RCC_C2_CRC_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR) &= ~ (RCC_AHB4LPENR_CRCLPEN)
  6015. #define __HAL_RCC_C2_BDMA_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR) &= ~ (RCC_AHB4LPENR_BDMALPEN)
  6016. #define __HAL_RCC_C2_ADC3_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR) &= ~ (RCC_AHB4LPENR_ADC3LPEN)
  6017. #define __HAL_RCC_C2_BKPRAM_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR) &= ~ (RCC_AHB4LPENR_BKPRAMLPEN)
  6018. #define __HAL_RCC_C2_D3SRAM1_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR &= ~ (RCC_AHB4LPENR_D3SRAM1LPEN))
  6019. /** @brief ENABLE or disable the APB3 peripheral clock during Low Power (Sleep) mode.
  6020. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  6021. * power consumption.
  6022. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  6023. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  6024. */
  6025. #define __HAL_RCC_C2_LTDC_CLK_SLEEP_ENABLE() (RCC_C2->APB3LPENR) |= (RCC_APB3LPENR_LTDCLPEN)
  6026. #define __HAL_RCC_C2_DSI_CLK_SLEEP_ENABLE() (RCC_C2->APB3LPENR) |= (RCC_APB3LPENR_DSILPEN)
  6027. #define __HAL_RCC_C2_WWDG1_CLK_SLEEP_ENABLE() (RCC_C2->APB3LPENR) |= (RCC_APB3LPENR_WWDG1LPEN)
  6028. #define __HAL_RCC_C2_LTDC_CLK_SLEEP_DISABLE() (RCC_C2->APB3LPENR) &= ~ (RCC_APB3LPENR_LTDCLPEN)
  6029. #define __HAL_RCC_C2_DSI_CLK_SLEEP_DISABLE() (RCC_C2->APB3LPENR) &= ~ (RCC_APB3LPENR_DSILPEN)
  6030. #define __HAL_RCC_C2_WWDG1_CLK_SLEEP_DISABLE() (RCC_C2->APB3LPENR) &= ~ (RCC_APB3LPENR_WWDG1LPEN)
  6031. /** @brief ENABLE or disable the APB1 peripheral clock during Low Power (Sleep) mode.
  6032. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  6033. * power consumption.
  6034. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  6035. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  6036. */
  6037. #define __HAL_RCC_C2_TIM2_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_TIM2LPEN)
  6038. #define __HAL_RCC_C2_TIM3_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_TIM3LPEN)
  6039. #define __HAL_RCC_C2_TIM4_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_TIM4LPEN)
  6040. #define __HAL_RCC_C2_TIM5_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_TIM5LPEN)
  6041. #define __HAL_RCC_C2_TIM6_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_TIM6LPEN)
  6042. #define __HAL_RCC_C2_TIM7_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_TIM7LPEN)
  6043. #define __HAL_RCC_C2_TIM12_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_TIM12LPEN)
  6044. #define __HAL_RCC_C2_TIM13_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_TIM13LPEN)
  6045. #define __HAL_RCC_C2_TIM14_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_TIM14LPEN)
  6046. #define __HAL_RCC_C2_LPTIM1_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_LPTIM1LPEN)
  6047. #define __HAL_RCC_C2_WWDG2_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_WWDG2LPEN)
  6048. #define __HAL_RCC_C2_SPI2_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_SPI2LPEN)
  6049. #define __HAL_RCC_C2_SPI3_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_SPI3LPEN)
  6050. #define __HAL_RCC_C2_SPDIFRX_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_SPDIFRXLPEN)
  6051. #define __HAL_RCC_C2_USART2_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_USART2LPEN)
  6052. #define __HAL_RCC_C2_USART3_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_USART3LPEN)
  6053. #define __HAL_RCC_C2_UART4_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_UART4LPEN)
  6054. #define __HAL_RCC_C2_UART5_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_UART5LPEN)
  6055. #define __HAL_RCC_C2_I2C1_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_I2C1LPEN)
  6056. #define __HAL_RCC_C2_I2C2_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_I2C2LPEN)
  6057. #define __HAL_RCC_C2_I2C3_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_I2C3LPEN)
  6058. #define __HAL_RCC_C2_CEC_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_CECLPEN)
  6059. #define __HAL_RCC_C2_DAC12_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_DAC12LPEN)
  6060. #define __HAL_RCC_C2_UART7_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_UART7LPEN)
  6061. #define __HAL_RCC_C2_UART8_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_UART8LPEN)
  6062. #define __HAL_RCC_C2_CRS_CLK_SLEEP_ENABLE() (RCC_C2->APB1HLPENR) |= (RCC_APB1HLPENR_CRSLPEN)
  6063. #define __HAL_RCC_C2_SWPMI_CLK_SLEEP_ENABLE() (RCC_C2->APB1HLPENR) |= (RCC_APB1HLPENR_SWPMILPEN)
  6064. #define __HAL_RCC_C2_OPAMP_CLK_SLEEP_ENABLE() (RCC_C2->APB1HLPENR) |= (RCC_APB1HLPENR_OPAMPLPEN)
  6065. #define __HAL_RCC_C2_MDIOS_CLK_SLEEP_ENABLE() (RCC_C2->APB1HLPENR) |= (RCC_APB1HLPENR_MDIOSLPEN)
  6066. #define __HAL_RCC_C2_FDCAN_CLK_SLEEP_ENABLE() (RCC_C2->APB1HLPENR) |= (RCC_APB1HLPENR_FDCANLPEN)
  6067. #define __HAL_RCC_C2_TIM2_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM2LPEN)
  6068. #define __HAL_RCC_C2_TIM3_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM3LPEN)
  6069. #define __HAL_RCC_C2_TIM4_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM4LPEN)
  6070. #define __HAL_RCC_C2_TIM5_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM5LPEN)
  6071. #define __HAL_RCC_C2_TIM6_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM6LPEN)
  6072. #define __HAL_RCC_C2_TIM7_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM7LPEN)
  6073. #define __HAL_RCC_C2_TIM12_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM12LPEN)
  6074. #define __HAL_RCC_C2_TIM13_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM13LPEN)
  6075. #define __HAL_RCC_C2_TIM14_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM14LPEN)
  6076. #define __HAL_RCC_C2_LPTIM1_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_LPTIM1LPEN)
  6077. #define __HAL_RCC_C2_WWDG2_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_WWDG2LPEN)
  6078. #define __HAL_RCC_C2_SPI2_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_SPI2LPEN)
  6079. #define __HAL_RCC_C2_SPI3_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_SPI3LPEN)
  6080. #define __HAL_RCC_C2_SPDIFRX_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_SPDIFRXLPEN)
  6081. #define __HAL_RCC_C2_USART2_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_USART2LPEN)
  6082. #define __HAL_RCC_C2_USART3_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_USART3LPEN)
  6083. #define __HAL_RCC_C2_UART4_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_UART4LPEN)
  6084. #define __HAL_RCC_C2_UART5_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_UART5LPEN)
  6085. #define __HAL_RCC_C2_I2C1_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_I2C1LPEN)
  6086. #define __HAL_RCC_C2_I2C2_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_I2C2LPEN)
  6087. #define __HAL_RCC_C2_I2C3_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_I2C3LPEN)
  6088. #define __HAL_RCC_C2_CEC_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_CECLPEN)
  6089. #define __HAL_RCC_C2_DAC12_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_DAC12LPEN)
  6090. #define __HAL_RCC_C2_UART7_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_UART7LPEN)
  6091. #define __HAL_RCC_C2_UART8_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_UART8LPEN)
  6092. #define __HAL_RCC_C2_CRS_CLK_SLEEP_DISABLE() (RCC_C2->APB1HLPENR) &= ~ (RCC_APB1HLPENR_CRSLPEN)
  6093. #define __HAL_RCC_C2_SWPMI_CLK_SLEEP_DISABLE() (RCC_C2->APB1HLPENR) &= ~ (RCC_APB1HLPENR_SWPMILPEN)
  6094. #define __HAL_RCC_C2_OPAMP_CLK_SLEEP_DISABLE() (RCC_C2->APB1HLPENR) &= ~ (RCC_APB1HLPENR_OPAMPLPEN)
  6095. #define __HAL_RCC_C2_MDIOS_CLK_SLEEP_DISABLE() (RCC_C2->APB1HLPENR) &= ~ (RCC_APB1HLPENR_MDIOSLPEN)
  6096. #define __HAL_RCC_C2_FDCAN_CLK_SLEEP_DISABLE() (RCC_C2->APB1HLPENR) &= ~ (RCC_APB1HLPENR_FDCANLPEN)
  6097. /** @brief ENABLE or disable the APB2 peripheral clock during Low Power (Sleep) mode.
  6098. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  6099. * power consumption.
  6100. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  6101. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  6102. */
  6103. #define __HAL_RCC_C2_TIM1_CLK_SLEEP_ENABLE() (RCC_C2->APB2LPENR) |= (RCC_APB2LPENR_TIM1LPEN)
  6104. #define __HAL_RCC_C2_TIM8_CLK_SLEEP_ENABLE() (RCC_C2->APB2LPENR) |= (RCC_APB2LPENR_TIM8LPEN)
  6105. #define __HAL_RCC_C2_USART1_CLK_SLEEP_ENABLE() (RCC_C2->APB2LPENR) |= (RCC_APB2LPENR_USART1LPEN)
  6106. #define __HAL_RCC_C2_USART6_CLK_SLEEP_ENABLE() (RCC_C2->APB2LPENR) |= (RCC_APB2LPENR_USART6LPEN)
  6107. #define __HAL_RCC_C2_SPI1_CLK_SLEEP_ENABLE() (RCC_C2->APB2LPENR) |= (RCC_APB2LPENR_SPI1LPEN)
  6108. #define __HAL_RCC_C2_SPI4_CLK_SLEEP_ENABLE() (RCC_C2->APB2LPENR) |= (RCC_APB2LPENR_SPI4LPEN)
  6109. #define __HAL_RCC_C2_TIM15_CLK_SLEEP_ENABLE() (RCC_C2->APB2LPENR) |= (RCC_APB2LPENR_TIM15LPEN)
  6110. #define __HAL_RCC_C2_TIM16_CLK_SLEEP_ENABLE() (RCC_C2->APB2LPENR) |= (RCC_APB2LPENR_TIM16LPEN)
  6111. #define __HAL_RCC_C2_TIM17_CLK_SLEEP_ENABLE() (RCC_C2->APB2LPENR) |= (RCC_APB2LPENR_TIM17LPEN)
  6112. #define __HAL_RCC_C2_SPI5_CLK_SLEEP_ENABLE() (RCC_C2->APB2LPENR) |= (RCC_APB2LPENR_SPI5LPEN)
  6113. #define __HAL_RCC_C2_SAI1_CLK_SLEEP_ENABLE() (RCC_C2->APB2LPENR) |= (RCC_APB2LPENR_SAI1LPEN)
  6114. #define __HAL_RCC_C2_SAI2_CLK_SLEEP_ENABLE() (RCC_C2->APB2LPENR) |= (RCC_APB2LPENR_SAI2LPEN)
  6115. #define __HAL_RCC_C2_SAI3_CLK_SLEEP_ENABLE() (RCC_C2->APB2LPENR) |= (RCC_APB2LPENR_SAI3LPEN)
  6116. #define __HAL_RCC_C2_DFSDM1_CLK_SLEEP_ENABLE() (RCC_C2->APB2LPENR) |= (RCC_APB2LPENR_DFSDM1LPEN)
  6117. #define __HAL_RCC_C2_HRTIM1_CLK_SLEEP_ENABLE() (RCC_C2->APB2LPENR) |= (RCC_APB2LPENR_HRTIMLPEN)
  6118. #define __HAL_RCC_C2_TIM1_CLK_SLEEP_DISABLE() (RCC_C2->APB2LPENR) &= ~ (RCC_APB2LPENR_TIM1LPEN)
  6119. #define __HAL_RCC_C2_TIM8_CLK_SLEEP_DISABLE() (RCC_C2->APB2LPENR) &= ~ (RCC_APB2LPENR_TIM8LPEN)
  6120. #define __HAL_RCC_C2_USART1_CLK_SLEEP_DISABLE() (RCC_C2->APB2LPENR) &= ~ (RCC_APB2LPENR_USART1LPEN)
  6121. #define __HAL_RCC_C2_USART6_CLK_SLEEP_DISABLE() (RCC_C2->APB2LPENR) &= ~ (RCC_APB2LPENR_USART6LPEN)
  6122. #define __HAL_RCC_C2_SPI1_CLK_SLEEP_DISABLE() (RCC_C2->APB2LPENR) &= ~ (RCC_APB2LPENR_SPI1LPEN)
  6123. #define __HAL_RCC_C2_SPI4_CLK_SLEEP_DISABLE() (RCC_C2->APB2LPENR) &= ~ (RCC_APB2LPENR_SPI4LPEN)
  6124. #define __HAL_RCC_C2_TIM15_CLK_SLEEP_DISABLE() (RCC_C2->APB2LPENR) &= ~ (RCC_APB2LPENR_TIM15LPEN)
  6125. #define __HAL_RCC_C2_TIM16_CLK_SLEEP_DISABLE() (RCC_C2->APB2LPENR) &= ~ (RCC_APB2LPENR_TIM16LPEN)
  6126. #define __HAL_RCC_C2_TIM17_CLK_SLEEP_DISABLE() (RCC_C2->APB2LPENR) &= ~ (RCC_APB2LPENR_TIM17LPEN)
  6127. #define __HAL_RCC_C2_SPI5_CLK_SLEEP_DISABLE() (RCC_C2->APB2LPENR) &= ~ (RCC_APB2LPENR_SPI5LPEN)
  6128. #define __HAL_RCC_C2_SAI1_CLK_SLEEP_DISABLE() (RCC_C2->APB2LPENR) &= ~ (RCC_APB2LPENR_SAI1LPEN)
  6129. #define __HAL_RCC_C2_SAI2_CLK_SLEEP_DISABLE() (RCC_C2->APB2LPENR) &= ~ (RCC_APB2LPENR_SAI2LPEN)
  6130. #define __HAL_RCC_C2_SAI3_CLK_SLEEP_DISABLE() (RCC_C2->APB2LPENR) &= ~ (RCC_APB2LPENR_SAI3LPEN)
  6131. #define __HAL_RCC_C2_DFSDM1_CLK_SLEEP_DISABLE() (RCC_C2->APB2LPENR) &= ~ (RCC_APB2LPENR_DFSDM1LPEN)
  6132. #define __HAL_RCC_C2_HRTIM1_CLK_SLEEP_DISABLE() (RCC_C2->APB2LPENR) &= ~ (RCC_APB2LPENR_HRTIMLPEN)
  6133. /** @brief ENABLE or disable the APB4 peripheral clock during Low Power (Sleep) mode.
  6134. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  6135. * power consumption.
  6136. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  6137. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  6138. */
  6139. #define __HAL_RCC_C2_SYSCFG_CLK_SLEEP_ENABLE() (RCC_C2->APB4LPENR) |= (RCC_APB4LPENR_SYSCFGLPEN)
  6140. #define __HAL_RCC_C2_LPUART1_CLK_SLEEP_ENABLE() (RCC_C2->APB4LPENR) |= (RCC_APB4LPENR_LPUART1LPEN)
  6141. #define __HAL_RCC_C2_SPI6_CLK_SLEEP_ENABLE() (RCC_C2->APB4LPENR) |= (RCC_APB4LPENR_SPI6LPEN)
  6142. #define __HAL_RCC_C2_I2C4_CLK_SLEEP_ENABLE() (RCC_C2->APB4LPENR) |= (RCC_APB4LPENR_I2C4LPEN)
  6143. #define __HAL_RCC_C2_LPTIM2_CLK_SLEEP_ENABLE() (RCC_C2->APB4LPENR) |= (RCC_APB4LPENR_LPTIM2LPEN)
  6144. #define __HAL_RCC_C2_LPTIM3_CLK_SLEEP_ENABLE() (RCC_C2->APB4LPENR) |= (RCC_APB4LPENR_LPTIM3LPEN)
  6145. #define __HAL_RCC_C2_LPTIM4_CLK_SLEEP_ENABLE() (RCC_C2->APB4LPENR) |= (RCC_APB4LPENR_LPTIM4LPEN)
  6146. #define __HAL_RCC_C2_LPTIM5_CLK_SLEEP_ENABLE() (RCC_C2->APB4LPENR) |= (RCC_APB4LPENR_LPTIM5LPEN)
  6147. #define __HAL_RCC_C2_COMP12_CLK_SLEEP_ENABLE() (RCC_C2->APB4LPENR) |= (RCC_APB4LPENR_COMP12LPEN)
  6148. #define __HAL_RCC_C2_VREF_CLK_SLEEP_ENABLE() (RCC_C2->APB4LPENR) |= (RCC_APB4LPENR_VREFLPEN)
  6149. #define __HAL_RCC_C2_SAI4_CLK_SLEEP_ENABLE() (RCC_C2->APB4LPENR) |= (RCC_APB4LPENR_SAI4LPEN)
  6150. #define __HAL_RCC_C2_RTC_CLK_SLEEP_ENABLE() (RCC_C2->APB4LPENR) |= (RCC_APB4LPENR_RTCAPBLPEN)
  6151. #define __HAL_RCC_C2_SYSCFG_CLK_SLEEP_DISABLE() (RCC_C2->APB4LPENR) &= ~ (RCC_APB4LPENR_SYSCFGLPEN)
  6152. #define __HAL_RCC_C2_LPUART1_CLK_SLEEP_DISABLE() (RCC_C2->APB4LPENR) &= ~ (RCC_APB4LPENR_LPUART1LPEN)
  6153. #define __HAL_RCC_C2_SPI6_CLK_SLEEP_DISABLE() (RCC_C2->APB4LPENR) &= ~ (RCC_APB4LPENR_SPI6LPEN)
  6154. #define __HAL_RCC_C2_I2C4_CLK_SLEEP_DISABLE() (RCC_C2->APB4LPENR) &= ~ (RCC_APB4LPENR_I2C4LPEN)
  6155. #define __HAL_RCC_C2_LPTIM2_CLK_SLEEP_DISABLE() (RCC_C2->APB4LPENR) &= ~ (RCC_APB4LPENR_LPTIM2LPEN)
  6156. #define __HAL_RCC_C2_LPTIM3_CLK_SLEEP_DISABLE() (RCC_C2->APB4LPENR) &= ~ (RCC_APB4LPENR_LPTIM3LPEN)
  6157. #define __HAL_RCC_C2_LPTIM4_CLK_SLEEP_DISABLE() (RCC_C2->APB4LPENR) &= ~ (RCC_APB4LPENR_LPTIM4LPEN)
  6158. #define __HAL_RCC_C2_LPTIM5_CLK_SLEEP_DISABLE() (RCC_C2->APB4LPENR) &= ~ (RCC_APB4LPENR_LPTIM5LPEN)
  6159. #define __HAL_RCC_C2_COMP12_CLK_SLEEP_DISABLE() (RCC_C2->APB4LPENR) &= ~ (RCC_APB4LPENR_COMP12LPEN)
  6160. #define __HAL_RCC_C2_VREF_CLK_SLEEP_DISABLE() (RCC_C2->APB4LPENR) &= ~ (RCC_APB4LPENR_VREFLPEN)
  6161. #define __HAL_RCC_C2_SAI4_CLK_SLEEP_DISABLE() (RCC_C2->APB4LPENR) &= ~ (RCC_APB4LPENR_SAI4LPEN)
  6162. #define __HAL_RCC_C2_RTC_CLK_SLEEP_DISABLE() (RCC_C2->APB4LPENR) &= ~ (RCC_APB4LPENR_RTCAPBLPEN)
  6163. #endif /*DUAL_CORE*/
  6164. #if defined(DUAL_CORE)
  6165. /** @brief Enable or disable peripheral bus clock when D3 domain is in DRUN
  6166. * @note After reset (default config), peripheral clock is disabled when both CPUs are in CSTOP
  6167. */
  6168. #else
  6169. /** @brief Enable or disable peripheral bus clock when D3 domain is in DRUN
  6170. * @note After reset (default config), peripheral clock is disabled when CPU is in CSTOP
  6171. */
  6172. #endif /*DUAL_CORE*/
  6173. #if defined(RCC_D3AMR_BDMAAMEN)
  6174. #define __HAL_RCC_BDMA_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_BDMAAMEN)
  6175. #endif
  6176. #if defined(RCC_D3AMR_LPUART1AMEN)
  6177. #define __HAL_RCC_LPUART1_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_LPUART1AMEN)
  6178. #endif
  6179. #if defined(RCC_D3AMR_SPI6AMEN)
  6180. #define __HAL_RCC_SPI6_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_SPI6AMEN)
  6181. #endif
  6182. #if defined(RCC_D3AMR_I2C4AMEN)
  6183. #define __HAL_RCC_I2C4_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_I2C4AMEN)
  6184. #endif
  6185. #if defined(RCC_D3AMR_LPTIM2AMEN)
  6186. #define __HAL_RCC_LPTIM2_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_LPTIM2AMEN)
  6187. #endif
  6188. #if defined(RCC_D3AMR_LPTIM3AMEN)
  6189. #define __HAL_RCC_LPTIM3_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_LPTIM3AMEN)
  6190. #endif
  6191. #if defined(LPTIM4)
  6192. #define __HAL_RCC_LPTIM4_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_LPTIM4AMEN)
  6193. #endif
  6194. #if defined(LPTIM5)
  6195. #define __HAL_RCC_LPTIM5_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_LPTIM5AMEN)
  6196. #endif
  6197. #if defined(RCC_D3AMR_COMP12AMEN)
  6198. #define __HAL_RCC_COMP12_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_COMP12AMEN)
  6199. #endif
  6200. #if defined(RCC_D3AMR_VREFAMEN)
  6201. #define __HAL_RCC_VREF_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_VREFAMEN)
  6202. #endif
  6203. #if defined(RCC_D3AMR_RTCAMEN)
  6204. #define __HAL_RCC_RTC_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_RTCAMEN)
  6205. #endif
  6206. #if defined(RCC_D3AMR_CRCAMEN)
  6207. #define __HAL_RCC_CRC_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_CRCAMEN)
  6208. #endif
  6209. #if defined(SAI4)
  6210. #define __HAL_RCC_SAI4_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_SAI4AMEN)
  6211. #endif
  6212. #if defined(ADC3)
  6213. #define __HAL_RCC_ADC3_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_ADC3AMEN)
  6214. #endif
  6215. #if defined(RCC_D3AMR_DTSAMEN)
  6216. #define __HAL_RCC_DTS_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_DTSAMEN)
  6217. #endif
  6218. #if defined(RCC_D3AMR_BKPRAMAMEN)
  6219. #define __HAL_RCC_BKPRAM_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_BKPRAMAMEN)
  6220. #endif
  6221. #if defined(RCC_D3AMR_SRAM4AMEN)
  6222. #define __HAL_RCC_D3SRAM1_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_SRAM4AMEN)
  6223. #endif
  6224. #if defined(BDMA2)
  6225. #define __HAL_RCC_BDMA2_CLKAM_ENABLE() (RCC->SRDAMR) |= (RCC_SRDAMR_BDMA2AMEN)
  6226. #endif
  6227. #if defined(RCC_SRDAMR_GPIOAMEN)
  6228. #define __HAL_RCC_GPIO_CLKAM_ENABLE() (RCC->SRDAMR) |= (RCC_SRDAMR_GPIOAMEN)
  6229. #endif
  6230. #if defined(RCC_SRDAMR_LPUART1AMEN)
  6231. #define __HAL_RCC_LPUART1_CLKAM_ENABLE() (RCC->SRDAMR) |= (RCC_SRDAMR_LPUART1AMEN)
  6232. #endif
  6233. #if defined(RCC_SRDAMR_SPI6AMEN)
  6234. #define __HAL_RCC_SPI6_CLKAM_ENABLE() (RCC->SRDAMR) |= (RCC_SRDAMR_SPI6AMEN)
  6235. #endif
  6236. #if defined(RCC_SRDAMR_I2C4AMEN)
  6237. #define __HAL_RCC_I2C4_CLKAM_ENABLE() (RCC->SRDAMR) |= (RCC_SRDAMR_I2C4AMEN)
  6238. #endif
  6239. #if defined(RCC_SRDAMR_LPTIM2AMEN)
  6240. #define __HAL_RCC_LPTIM2_CLKAM_ENABLE() (RCC->SRDAMR) |= (RCC_SRDAMR_LPTIM2AMEN)
  6241. #endif
  6242. #if defined(RCC_SRDAMR_LPTIM3AMEN)
  6243. #define __HAL_RCC_LPTIM3_CLKAM_ENABLE() (RCC->SRDAMR) |= (RCC_SRDAMR_LPTIM3AMEN)
  6244. #endif
  6245. #if defined(DAC2)
  6246. #define __HAL_RCC_DAC2_CLKAM_ENABLE() (RCC->SRDAMR) |= (RCC_SRDAMR_DAC2AMEN)
  6247. #endif
  6248. #if defined(RCC_SRDAMR_COMP12AMEN)
  6249. #define __HAL_RCC_COMP12_CLKAM_ENABLE() (RCC->SRDAMR) |= (RCC_SRDAMR_COMP12AMEN)
  6250. #endif
  6251. #if defined(RCC_SRDAMR_VREFAMEN)
  6252. #define __HAL_RCC_VREF_CLKAM_ENABLE() (RCC->SRDAMR) |= (RCC_SRDAMR_VREFAMEN)
  6253. #endif
  6254. #if defined(RCC_SRDAMR_RTCAMEN)
  6255. #define __HAL_RCC_RTC_CLKAM_ENABLE() (RCC->SRDAMR) |= (RCC_SRDAMR_RTCAMEN)
  6256. #endif
  6257. #if defined(RCC_SRDAMR_DTSAMEN)
  6258. #define __HAL_RCC_DTS_CLKAM_ENABLE() (RCC->SRDAMR) |= (RCC_SRDAMR_DTSAMEN)
  6259. #endif
  6260. #if defined(DFSDM2_BASE)
  6261. #define __HAL_RCC_DFSDM2_CLKAM_ENABLE() (RCC->SRDAMR) |= (RCC_SRDAMR_DFSDM2AMEN)
  6262. #endif
  6263. #if defined(RCC_SRDAMR_BKPRAMAMEN)
  6264. #define __HAL_RCC_BKPRAM_CLKAM_ENABLE() (RCC->SRDAMR) |= (RCC_SRDAMR_BKPRAMAMEN)
  6265. #endif
  6266. #if defined(RCC_SRDAMR_SRDSRAMAMEN)
  6267. #define __HAL_RCC_SRDSRAM_CLKAM_ENABLE() (RCC->SRDAMR) |= (RCC_SRDAMR_SRDSRAMAMEN)
  6268. #endif
  6269. #if defined(RCC_D3AMR_BDMAAMEN)
  6270. #define __HAL_RCC_BDMA_CLKAM_DISABLE() (RCC->D3AMR) &= ~ (RCC_D3AMR_BDMAAMEN)
  6271. #endif
  6272. #if defined(RCC_D3AMR_LPUART1AMEN)
  6273. #define __HAL_RCC_LPUART1_CLKAM_DISABLE() (RCC->D3AMR) &= ~ (RCC_D3AMR_LPUART1AMEN)
  6274. #endif
  6275. #if defined(RCC_D3AMR_SPI6AMEN)
  6276. #define __HAL_RCC_SPI6_CLKAM_DISABLE() (RCC->D3AMR) &= ~ (RCC_D3AMR_SPI6AMEN)
  6277. #endif
  6278. #if defined(RCC_D3AMR_I2C4AMEN)
  6279. #define __HAL_RCC_I2C4_CLKAM_DISABLE() (RCC->D3AMR) &= ~ (RCC_D3AMR_I2C4AMEN)
  6280. #endif
  6281. #if defined(RCC_D3AMR_LPTIM2AMEN)
  6282. #define __HAL_RCC_LPTIM2_CLKAM_DISABLE() (RCC->D3AMR) &= ~ (RCC_D3AMR_LPTIM2AMEN)
  6283. #endif
  6284. #if defined(RCC_D3AMR_LPTIM3AMEN)
  6285. #define __HAL_RCC_LPTIM3_CLKAM_DISABLE() (RCC->D3AMR) &= ~ (RCC_D3AMR_LPTIM3AMEN)
  6286. #endif
  6287. #if defined(LPTIM4)
  6288. #define __HAL_RCC_LPTIM4_CLKAM_DISABLE() (RCC->D3AMR) &= ~ (RCC_D3AMR_LPTIM4AMEN)
  6289. #endif
  6290. #if defined(LPTIM5)
  6291. #define __HAL_RCC_LPTIM5_CLKAM_DISABLE() (RCC->D3AMR) &= ~ (RCC_D3AMR_LPTIM5AMEN)
  6292. #endif
  6293. #if defined(RCC_D3AMR_COMP12AMEN)
  6294. #define __HAL_RCC_COMP12_CLKAM_DISABLE() (RCC->D3AMR) &= ~ (RCC_D3AMR_COMP12AMEN)
  6295. #endif
  6296. #if defined(RCC_D3AMR_VREFAMEN)
  6297. #define __HAL_RCC_VREF_CLKAM_DISABLE() (RCC->D3AMR) &= ~ (RCC_D3AMR_VREFAMEN)
  6298. #endif
  6299. #if defined(RCC_D3AMR_RTCAMEN)
  6300. #define __HAL_RCC_RTC_CLKAM_DISABLE() (RCC->D3AMR) &= ~ (RCC_D3AMR_RTCAMEN)
  6301. #endif
  6302. #if defined(RCC_D3AMR_CRCAMEN)
  6303. #define __HAL_RCC_CRC_CLKAM_DISABLE() (RCC->D3AMR) &= ~ (RCC_D3AMR_CRCAMEN)
  6304. #endif
  6305. #if defined(SAI4)
  6306. #define __HAL_RCC_SAI4_CLKAM_DISABLE() (RCC->D3AMR) &= ~ (RCC_D3AMR_SAI4AMEN)
  6307. #endif
  6308. #if defined(ADC3)
  6309. #define __HAL_RCC_ADC3_CLKAM_DISABLE() (RCC->D3AMR) &= ~ (RCC_D3AMR_ADC3AMEN)
  6310. #endif
  6311. #if defined(RCC_D3AMR_DTSAMEN)
  6312. #define __HAL_RCC_DTS_CLKAM_DISABLE() (RCC->D3AMR) &= ~ (RCC_D3AMR_DTSAMEN)
  6313. #endif
  6314. #if defined(RCC_D3AMR_BKPRAMAMEN)
  6315. #define __HAL_RCC_BKPRAM_CLKAM_DISABLE() (RCC->D3AMR) &= ~ (RCC_D3AMR_BKPRAMAMEN)
  6316. #endif
  6317. #if defined(RCC_D3AMR_SRAM4AMEN)
  6318. #define __HAL_RCC_D3SRAM1_CLKAM_DISABLE() (RCC->D3AMR)&= ~ (RCC_D3AMR_SRAM4AMEN)
  6319. #endif
  6320. #if defined(BDMA2)
  6321. #define __HAL_RCC_BDMA2_CLKAM_DISABLE() (RCC->SRDAMR) &= ~ (RCC_SRDAMR_BDMA2AMEN)
  6322. #endif
  6323. #if defined(RCC_SRDAMR_GPIOAMEN)
  6324. #define __HAL_RCC_GPIO_CLKAM_DISABLE() (RCC->SRDAMR) &= ~ (RCC_SRDAMR_GPIOAMEN)
  6325. #endif
  6326. #if defined(RCC_SRDAMR_LPUART1AMEN)
  6327. #define __HAL_RCC_LPUART1_CLKAM_DISABLE() (RCC->SRDAMR) &= ~ (RCC_SRDAMR_LPUART1AMEN)
  6328. #endif
  6329. #if defined(RCC_SRDAMR_SPI6AMEN)
  6330. #define __HAL_RCC_SPI6_CLKAM_DISABLE() (RCC->SRDAMR) &= ~ (RCC_SRDAMR_SPI6AMEN)
  6331. #endif
  6332. #if defined(RCC_SRDAMR_I2C4AMEN)
  6333. #define __HAL_RCC_I2C4_CLKAM_DISABLE() (RCC->SRDAMR) &= ~ (RCC_SRDAMR_I2C4AMEN)
  6334. #endif
  6335. #if defined(RCC_SRDAMR_LPTIM2AMEN)
  6336. #define __HAL_RCC_LPTIM2_CLKAM_DISABLE() (RCC->SRDAMR) &= ~ (RCC_SRDAMR_LPTIM2AMEN)
  6337. #endif
  6338. #if defined(RCC_SRDAMR_LPTIM3AMEN)
  6339. #define __HAL_RCC_LPTIM3_CLKAM_DISABLE() (RCC->SRDAMR) &= ~ (RCC_SRDAMR_LPTIM3AMEN)
  6340. #endif
  6341. #if defined(RCC_SRDAMR_DAC2AMEN)
  6342. #define __HAL_RCC_DAC2_CLKAM_DISABLE() (RCC->SRDAMR) &= ~ (RCC_SRDAMR_DAC2AMEN)
  6343. #endif
  6344. #if defined(RCC_SRDAMR_COMP12AMEN)
  6345. #define __HAL_RCC_COMP12_CLKAM_DISABLE() (RCC->SRDAMR) &= ~ (RCC_SRDAMR_COMP12AMEN)
  6346. #endif
  6347. #if defined(RCC_SRDAMR_VREFAMEN)
  6348. #define __HAL_RCC_VREF_CLKAM_DISABLE() (RCC->SRDAMR) &= ~ (RCC_SRDAMR_VREFAMEN)
  6349. #endif
  6350. #if defined(RCC_SRDAMR_RTCAMEN)
  6351. #define __HAL_RCC_RTC_CLKAM_DISABLE() (RCC->SRDAMR) &= ~(RCC_SRDAMR_RTCAMEN)
  6352. #endif
  6353. #if defined(RCC_SRDAMR_DTSAMEN)
  6354. #define __HAL_RCC_DTS_CLKAM_DISABLE() (RCC->SRDAMR) &= ~(RCC_SRDAMR_DTSAMEN)
  6355. #endif
  6356. #if defined(DFSDM2_BASE)
  6357. #define __HAL_RCC_DFSDM2_CLKAM_DISABLE() (RCC->SRDAMR) &= ~(RCC_SRDAMR_DFSDM2AMEN)
  6358. #endif
  6359. #if defined(RCC_SRDAMR_BKPRAMAMEN)
  6360. #define __HAL_RCC_BKPRAM_CLKAM_DISABLE() (RCC->SRDAMR) &= ~ (RCC_SRDAMR_BKPRAMAMEN)
  6361. #endif
  6362. #if defined(RCC_SRDAMR_SRDSRAMAMEN)
  6363. #define __HAL_RCC_SRDSRAM_CLKAM_DISABLE() (RCC->SRDAMR) &= ~ (RCC_SRDAMR_SRDSRAMAMEN)
  6364. #endif
  6365. #if defined(RCC_CKGAENR_AXICKG)
  6366. /** @brief Macro to enable or disable the RCC_CKGAENR bits (AXI clocks gating enable register).
  6367. */
  6368. #define __HAL_RCC_AXI_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_AXICKG)
  6369. #define __HAL_RCC_AHB_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_AHBCKG)
  6370. #define __HAL_RCC_CPU_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_CPUCKG)
  6371. #define __HAL_RCC_SDMMC_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_SDMMCCKG)
  6372. #define __HAL_RCC_MDMA_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_MDMACKG)
  6373. #define __HAL_RCC_DMA2D_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_DMA2DCKG)
  6374. #define __HAL_RCC_LTDC_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_LTDCCKG)
  6375. #define __HAL_RCC_GFXMMUM_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_GFXMMUMCKG)
  6376. #define __HAL_RCC_AHB12_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_AHB12CKG)
  6377. #define __HAL_RCC_AHB34_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_AHB34CKG)
  6378. #define __HAL_RCC_FLIFT_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_FLIFTCKG)
  6379. #define __HAL_RCC_OCTOSPI2_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_OCTOSPI2CKG)
  6380. #define __HAL_RCC_FMC_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_FMCCKG)
  6381. #define __HAL_RCC_OCTOSPI1_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_OCTOSPI1CKG)
  6382. #define __HAL_RCC_AXIRAM1_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_AXIRAM1CKG)
  6383. #define __HAL_RCC_AXIRAM2_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_AXIRAM2CKG)
  6384. #define __HAL_RCC_AXIRAM3_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_AXIRAM3CKG)
  6385. #define __HAL_RCC_GFXMMUS_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_GFXMMUSCKG)
  6386. #define __HAL_RCC_ECCRAM_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_ECCRAMCKG)
  6387. #define __HAL_RCC_EXTI_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_EXTICKG)
  6388. #define __HAL_RCC_JTAG_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_JTAGCKG)
  6389. #define __HAL_RCC_AXI_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_AXICKG)
  6390. #define __HAL_RCC_AHB_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_AHBCKG)
  6391. #define __HAL_RCC_CPU_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_CPUCKG)
  6392. #define __HAL_RCC_SDMMC_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_SDMMCCKG)
  6393. #define __HAL_RCC_MDMA_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_MDMACKG)
  6394. #define __HAL_RCC_DMA2D_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_DMA2DCKG)
  6395. #define __HAL_RCC_LTDC_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_LTDCCKG)
  6396. #define __HAL_RCC_GFXMMUM_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_GFXMMUMCKG)
  6397. #define __HAL_RCC_AHB12_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_AHB12CKG)
  6398. #define __HAL_RCC_AHB34_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_AHB34CKG)
  6399. #define __HAL_RCC_FLIFT_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_FLIFTCKG)
  6400. #define __HAL_RCC_OCTOSPI2_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_OCTOSPI2CKG)
  6401. #define __HAL_RCC_FMC_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_FMCCKG)
  6402. #define __HAL_RCC_OCTOSPI1_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_OCTOSPI1CKG)
  6403. #define __HAL_RCC_AXIRAM1_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_AXIRAM1CKG)
  6404. #define __HAL_RCC_AXIRAM2_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_AXIRAM2CKG)
  6405. #define __HAL_RCC_AXIRAM3_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_AXIRAM3CKG)
  6406. #define __HAL_RCC_GFXMMUS_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_GFXMMUSCKG)
  6407. #define __HAL_RCC_ECCRAM_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_ECCRAMCKG)
  6408. #define __HAL_RCC_EXTI_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_EXTICKG)
  6409. #define __HAL_RCC_JTAG_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_JTAGCKG)
  6410. #endif /* RCC_CKGAENR_AXICKG */
  6411. /** @brief Macro to enable or disable the Internal High Speed oscillator (HSI).
  6412. * @note After enabling the HSI, the application software should wait on
  6413. * HSIRDY flag to be set indicating that HSI clock is stable and can
  6414. * be used to clock the PLL and/or system clock.
  6415. * @note HSI can not be stopped if it is used directly or through the PLL
  6416. * as system clock. In this case, you have to select another source
  6417. * of the system clock then stop the HSI.
  6418. * @note The HSI is stopped by hardware when entering STOP and STANDBY modes.
  6419. * @param __STATE__ specifies the new state of the HSI.
  6420. * This parameter can be one of the following values:
  6421. * @arg RCC_HSI_OFF turn OFF the HSI oscillator
  6422. * @arg RCC_HSI_ON turn ON the HSI oscillator
  6423. * @arg RCC_HSI_DIV1 turn ON the HSI oscillator and divide it by 1 (default after reset)
  6424. * @arg RCC_HSI_DIV2 turn ON the HSI oscillator and divide it by 2
  6425. * @arg RCC_HSI_DIV4 turn ON the HSI oscillator and divide it by 4
  6426. * @arg RCC_HSI_DIV8 turn ON the HSI oscillator and divide it by 8
  6427. * @note When the HSI is stopped, HSIRDY flag goes low after 6 HSI oscillator
  6428. * clock cycles.
  6429. */
  6430. #define __HAL_RCC_HSI_CONFIG(__STATE__) \
  6431. MODIFY_REG(RCC->CR, RCC_CR_HSION | RCC_CR_HSIDIV , (uint32_t)(__STATE__))
  6432. /** @brief Macro to get the HSI divider.
  6433. * @retval The HSI divider. The returned value can be one
  6434. * of the following:
  6435. * - RCC_CR_HSIDIV_1 HSI oscillator divided by 1 (default after reset)
  6436. * - RCC_CR_HSIDIV_2 HSI oscillator divided by 2
  6437. * - RCC_CR_HSIDIV_4 HSI oscillator divided by 4
  6438. * - RCC_CR_HSIDIV_8 HSI oscillator divided by 8
  6439. */
  6440. #define __HAL_RCC_GET_HSI_DIVIDER() ((uint32_t)(READ_BIT(RCC->CR, RCC_CR_HSIDIV)))
  6441. /** @brief Macros to enable or disable the Internal High Speed oscillator (HSI).
  6442. * @note The HSI is stopped by hardware when entering STOP and STANDBY modes.
  6443. * It is used (enabled by hardware) as system clock source after start-up
  6444. * from Reset, wakeup from STOP and STANDBY mode, or in case of failure
  6445. * of the HSE used directly or indirectly as system clock (if the Clock
  6446. * Security System CSS is enabled).
  6447. * @note HSI can not be stopped if it is used as system clock source. In this case,
  6448. * you have to select another source of the system clock then stop the HSI.
  6449. * @note After enabling the HSI, the application software should wait on HSIRDY
  6450. * flag to be set indicating that HSI clock is stable and can be used as
  6451. * system clock source.
  6452. * This parameter can be: ENABLE or DISABLE.
  6453. * @note When the HSI is stopped, HSIRDY flag goes low after 6 HSI oscillator
  6454. * clock cycles.
  6455. */
  6456. #define __HAL_RCC_HSI_ENABLE() SET_BIT(RCC->CR, RCC_CR_HSION)
  6457. #define __HAL_RCC_HSI_DISABLE() CLEAR_BIT(RCC->CR, RCC_CR_HSION)
  6458. /** @brief Macro to adjust the Internal High Speed oscillator (HSI) calibration value.
  6459. * @note The calibration is used to compensate for the variations in voltage
  6460. * and temperature that influence the frequency of the internal HSI RC.
  6461. * @param __HSICalibrationValue__: specifies the calibration trimming value.
  6462. * This parameter must be a number between 0 and 0x7F (3F for Rev Y device).
  6463. */
  6464. #if defined(RCC_VER_X)
  6465. #define __HAL_RCC_HSI_CALIBRATIONVALUE_ADJUST(__HSICalibrationValue__) \
  6466. do { \
  6467. if(HAL_GetREVID() <= REV_ID_Y) \
  6468. { \
  6469. if((__HSICalibrationValue__) == RCC_HSICALIBRATION_DEFAULT) \
  6470. { \
  6471. MODIFY_REG(RCC->HSICFGR, HAL_RCC_REV_Y_HSITRIM_Msk, ((uint32_t)0x20) << HAL_RCC_REV_Y_HSITRIM_Pos); \
  6472. } \
  6473. else \
  6474. { \
  6475. MODIFY_REG(RCC->HSICFGR, HAL_RCC_REV_Y_HSITRIM_Msk, (uint32_t)(__HSICalibrationValue__) << HAL_RCC_REV_Y_HSITRIM_Pos); \
  6476. } \
  6477. } \
  6478. else \
  6479. { \
  6480. MODIFY_REG(RCC->HSICFGR, RCC_HSICFGR_HSITRIM, (uint32_t)(__HSICalibrationValue__) << RCC_HSICFGR_HSITRIM_Pos); \
  6481. } \
  6482. } while(0)
  6483. #else
  6484. #define __HAL_RCC_HSI_CALIBRATIONVALUE_ADJUST(__HSICalibrationValue__) \
  6485. MODIFY_REG(RCC->HSICFGR, RCC_HSICFGR_HSITRIM, (uint32_t)(__HSICalibrationValue__) << RCC_HSICFGR_HSITRIM_Pos);
  6486. #endif /*RCC_VER_X*/
  6487. /**
  6488. * @brief Macros to enable or disable the force of the Internal High Speed oscillator (HSI)
  6489. * in STOP mode to be quickly available as kernel clock for some peripherals.
  6490. * @note Keeping the HSI ON in STOP mode allows to avoid slowing down the communication
  6491. * speed because of the HSI start-up time.
  6492. * @note The enable of this function has not effect on the HSION bit.
  6493. * This parameter can be: ENABLE or DISABLE.
  6494. * @retval None
  6495. */
  6496. #define __HAL_RCC_HSISTOP_ENABLE() SET_BIT(RCC->CR, RCC_CR_HSIKERON)
  6497. #define __HAL_RCC_HSISTOP_DISABLE() CLEAR_BIT(RCC->CR, RCC_CR_HSIKERON)
  6498. /**
  6499. * @brief Macro to enable or disable the Internal High Speed oscillator for USB (HSI48).
  6500. * @note After enabling the HSI48, the application software should wait on
  6501. * HSI48RDY flag to be set indicating that HSI48 clock is stable and can
  6502. * be used to clock the USB.
  6503. * @note The HSI48 is stopped by hardware when entering STOP and STANDBY modes.
  6504. */
  6505. #define __HAL_RCC_HSI48_ENABLE() SET_BIT(RCC->CR, RCC_CR_HSI48ON);
  6506. #define __HAL_RCC_HSI48_DISABLE() CLEAR_BIT(RCC->CR, RCC_CR_HSI48ON);
  6507. /**
  6508. * @brief Macros to enable or disable the Internal oscillator (CSI).
  6509. * @note The CSI is stopped by hardware when entering STOP and STANDBY modes.
  6510. * It is used (enabled by hardware) as system clock source after
  6511. * start-up from Reset, wakeup from STOP and STANDBY mode, or in case
  6512. * of failure of the HSE used directly or indirectly as system clock
  6513. * (if the Clock Security System CSS is enabled).
  6514. * @note CSI can not be stopped if it is used as system clock source.
  6515. * In this case, you have to select another source of the system
  6516. * clock then stop the CSI.
  6517. * @note After enabling the CSI, the application software should wait on
  6518. * CSIRDY flag to be set indicating that CSI clock is stable and can
  6519. * be used as system clock source.
  6520. * @note When the CSI is stopped, CSIRDY flag goes low after 6 CSI oscillator
  6521. * clock cycles.
  6522. */
  6523. #define __HAL_RCC_CSI_ENABLE() SET_BIT(RCC->CR, RCC_CR_CSION)
  6524. #define __HAL_RCC_CSI_DISABLE() CLEAR_BIT(RCC->CR, RCC_CR_CSION)
  6525. /** @brief Macro Adjusts the Internal oscillator (CSI) calibration value.
  6526. * @note The calibration is used to compensate for the variations in voltage
  6527. * and temperature that influence the frequency of the internal CSI RC.
  6528. * @param __CSICalibrationValue__: specifies the calibration trimming value.
  6529. * This parameter must be a number between 0 and 0x1F.
  6530. */
  6531. #if defined(RCC_VER_X)
  6532. #define __HAL_RCC_CSI_CALIBRATIONVALUE_ADJUST(__CSICalibrationValue__) \
  6533. do { \
  6534. if(HAL_GetREVID() <= REV_ID_Y) \
  6535. { \
  6536. if((__CSICalibrationValue__) == RCC_CSICALIBRATION_DEFAULT) \
  6537. { \
  6538. MODIFY_REG(RCC->HSICFGR, HAL_RCC_REV_Y_CSITRIM_Msk, ((uint32_t)0x10) << HAL_RCC_REV_Y_CSITRIM_Pos); \
  6539. } \
  6540. else \
  6541. { \
  6542. MODIFY_REG(RCC->HSICFGR, HAL_RCC_REV_Y_CSITRIM_Msk, (uint32_t)(__CSICalibrationValue__) << HAL_RCC_REV_Y_CSITRIM_Pos); \
  6543. } \
  6544. } \
  6545. else \
  6546. { \
  6547. MODIFY_REG(RCC->CSICFGR, RCC_CSICFGR_CSITRIM, (uint32_t)(__CSICalibrationValue__) << RCC_CSICFGR_CSITRIM_Pos); \
  6548. } \
  6549. } while(0)
  6550. #else
  6551. #define __HAL_RCC_CSI_CALIBRATIONVALUE_ADJUST(__CSICalibrationValue__) \
  6552. do { \
  6553. MODIFY_REG(RCC->CSICFGR, RCC_CSICFGR_CSITRIM, (uint32_t)(__CSICalibrationValue__) << RCC_CSICFGR_CSITRIM_Pos); \
  6554. } while(0)
  6555. #endif /*RCC_VER_X*/
  6556. /**
  6557. * @brief Macros to enable or disable the force of the Low-power Internal oscillator (CSI)
  6558. * in STOP mode to be quickly available as kernel clock for USARTs and I2Cs.
  6559. * @note Keeping the CSI ON in STOP mode allows to avoid slowing down the communication
  6560. * speed because of the CSI start-up time.
  6561. * @note The enable of this function has not effect on the CSION bit.
  6562. * This parameter can be: ENABLE or DISABLE.
  6563. * @retval None
  6564. */
  6565. #define __HAL_RCC_CSISTOP_ENABLE() SET_BIT(RCC->CR, RCC_CR_CSIKERON)
  6566. #define __HAL_RCC_CSISTOP_DISABLE() CLEAR_BIT(RCC->CR, RCC_CR_CSIKERON)
  6567. /** @brief Macros to enable or disable the Internal Low Speed oscillator (LSI).
  6568. * @note After enabling the LSI, the application software should wait on
  6569. * LSIRDY flag to be set indicating that LSI clock is stable and can
  6570. * be used to clock the IWDG and/or the RTC.
  6571. * @note LSI can not be disabled if the IWDG is running.
  6572. * @note When the LSI is stopped, LSIRDY flag goes low after 6 LSI oscillator
  6573. * clock cycles.
  6574. */
  6575. #define __HAL_RCC_LSI_ENABLE() SET_BIT(RCC->CSR, RCC_CSR_LSION)
  6576. #define __HAL_RCC_LSI_DISABLE() CLEAR_BIT(RCC->CSR, RCC_CSR_LSION)
  6577. /**
  6578. * @brief Macro to configure the External High Speed oscillator (__HSE__).
  6579. * @note After enabling the HSE (RCC_HSE_ON, RCC_HSE_BYPASS or RCC_HSE_BYPASS_DIGITAL),
  6580. * the application software should wait on HSERDY flag to be set indicating
  6581. * that HSE clock is stable and can be used to clock the PLL and/or system clock.
  6582. * @note HSE state can not be changed if it is used directly or through the
  6583. * PLL as system clock. In this case, you have to select another source
  6584. * of the system clock then change the HSE state (ex. disable it).
  6585. * @note The HSE is stopped by hardware when entering STOP and STANDBY modes.
  6586. * @note This function reset the CSSON bit, so if the clock security system(CSS)
  6587. * was previously enabled you have to enable it again after calling this
  6588. * function.
  6589. * @param __STATE__: specifies the new state of the HSE.
  6590. * This parameter can be one of the following values:
  6591. * @arg RCC_HSE_OFF: turn OFF the HSE oscillator, HSERDY flag goes low after
  6592. * 6 HSE oscillator clock cycles.
  6593. * @arg RCC_HSE_ON: turn ON the HSE oscillator.
  6594. * @arg RCC_HSE_BYPASS: HSE oscillator bypassed with external clock.
  6595. * @arg RCC_HSE_BYPASS_DIGITAL: HSE oscillator bypassed with digital external clock. (*)
  6596. *
  6597. * (*): Only available on stm32h7a3xx, stm32h7b3xx and stm32h7b0xx family lines.
  6598. */
  6599. #if defined(RCC_CR_HSEEXT)
  6600. #define __HAL_RCC_HSE_CONFIG(__STATE__) \
  6601. do { \
  6602. if ((__STATE__) == RCC_HSE_ON) \
  6603. { \
  6604. SET_BIT(RCC->CR, RCC_CR_HSEON); \
  6605. } \
  6606. else if ((__STATE__) == RCC_HSE_OFF) \
  6607. { \
  6608. CLEAR_BIT(RCC->CR, RCC_CR_HSEON); \
  6609. CLEAR_BIT(RCC->CR, RCC_CR_HSEEXT); \
  6610. CLEAR_BIT(RCC->CR, RCC_CR_HSEBYP); \
  6611. } \
  6612. else if ((__STATE__) == RCC_HSE_BYPASS) \
  6613. { \
  6614. SET_BIT(RCC->CR, RCC_CR_HSEBYP); \
  6615. CLEAR_BIT(RCC->CR, RCC_CR_HSEEXT); \
  6616. SET_BIT(RCC->CR, RCC_CR_HSEON); \
  6617. } \
  6618. else if((__STATE__) == RCC_HSE_BYPASS_DIGITAL) \
  6619. { \
  6620. SET_BIT(RCC->CR, RCC_CR_HSEBYP); \
  6621. SET_BIT(RCC->CR, RCC_CR_HSEEXT); \
  6622. SET_BIT(RCC->CR, RCC_CR_HSEON); \
  6623. } \
  6624. else \
  6625. { \
  6626. CLEAR_BIT(RCC->CR, RCC_CR_HSEON); \
  6627. CLEAR_BIT(RCC->CR, RCC_CR_HSEBYP); \
  6628. CLEAR_BIT(RCC->CR, RCC_CR_HSEEXT); \
  6629. } \
  6630. } while(0)
  6631. #else
  6632. #define __HAL_RCC_HSE_CONFIG(__STATE__) \
  6633. do { \
  6634. if ((__STATE__) == RCC_HSE_ON) \
  6635. { \
  6636. SET_BIT(RCC->CR, RCC_CR_HSEON); \
  6637. } \
  6638. else if ((__STATE__) == RCC_HSE_OFF) \
  6639. { \
  6640. CLEAR_BIT(RCC->CR, RCC_CR_HSEON); \
  6641. CLEAR_BIT(RCC->CR, RCC_CR_HSEBYP); \
  6642. } \
  6643. else if ((__STATE__) == RCC_HSE_BYPASS) \
  6644. { \
  6645. SET_BIT(RCC->CR, RCC_CR_HSEBYP); \
  6646. SET_BIT(RCC->CR, RCC_CR_HSEON); \
  6647. } \
  6648. else \
  6649. { \
  6650. CLEAR_BIT(RCC->CR, RCC_CR_HSEON); \
  6651. CLEAR_BIT(RCC->CR, RCC_CR_HSEBYP); \
  6652. } \
  6653. } while(0)
  6654. #endif /* RCC_CR_HSEEXT */
  6655. /** @defgroup RCC_LSE_Configuration LSE Configuration
  6656. * @{
  6657. */
  6658. /**
  6659. * @brief Macro to configure the External Low Speed oscillator (LSE).
  6660. * @note Transition LSE Bypass to LSE On and LSE On to LSE Bypass are not supported by this macro.
  6661. * User should request a transition to LSE Off first and then LSE On or LSE Bypass.
  6662. * @note The external input clock can have a frequency up to 1 MHz and be low swing (analog) or digital(*).
  6663. A duty cycle close to 50% is recommended.
  6664. * @note As the LSE is in the Backup domain and write access is denied to
  6665. * this domain after reset, you have to enable write access using
  6666. * HAL_PWR_EnableBkUpAccess() function before to configure the LSE
  6667. * (to be done once after reset).
  6668. * @note After enabling the LSE (RCC_LSE_ON, RCC_LSE_BYPASS or RCC_LSE_BYPASS_DIGITAL*), the application
  6669. * software should wait on LSERDY flag to be set indicating that LSE clock
  6670. * is stable and can be used to clock the RTC.
  6671. * @note If the RTC is used, the LSE bypass must not be configured in digital mode but in low swing analog mode (*)
  6672. * @param __STATE__: specifies the new state of the LSE.
  6673. * This parameter can be one of the following values:
  6674. * @arg RCC_LSE_OFF: turn OFF the LSE oscillator, LSERDY flag goes low after
  6675. * 6 LSE oscillator clock cycles.
  6676. * @arg RCC_LSE_ON: turn ON the LSE oscillator.
  6677. * @arg RCC_LSE_BYPASS: LSE oscillator bypassed with external clock.
  6678. * @arg RCC_LSE_BYPASS_DIGITAL: LSE oscillator bypassed with external digital clock. (*)
  6679. *
  6680. * (*) Available on some STM32H7 lines only.
  6681. */
  6682. #if defined(RCC_BDCR_LSEEXT)
  6683. #define __HAL_RCC_LSE_CONFIG(__STATE__) \
  6684. do { \
  6685. if((__STATE__) == RCC_LSE_ON) \
  6686. { \
  6687. SET_BIT(RCC->BDCR, RCC_BDCR_LSEON); \
  6688. } \
  6689. else if((__STATE__) == RCC_LSE_OFF) \
  6690. { \
  6691. CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEON); \
  6692. CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEEXT); \
  6693. CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEBYP); \
  6694. } \
  6695. else if((__STATE__) == RCC_LSE_BYPASS) \
  6696. { \
  6697. SET_BIT(RCC->BDCR, RCC_BDCR_LSEBYP); \
  6698. CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEEXT); \
  6699. SET_BIT(RCC->BDCR, RCC_BDCR_LSEON); \
  6700. } \
  6701. else if((__STATE__) == RCC_LSE_BYPASS_DIGITAL) \
  6702. { \
  6703. SET_BIT(RCC->BDCR, RCC_BDCR_LSEBYP); \
  6704. SET_BIT(RCC->BDCR, RCC_BDCR_LSEEXT); \
  6705. SET_BIT(RCC->BDCR, RCC_BDCR_LSEON); \
  6706. } \
  6707. else \
  6708. { \
  6709. CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEON); \
  6710. CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEBYP); \
  6711. CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEEXT); \
  6712. } \
  6713. } while(0)
  6714. #else
  6715. #define __HAL_RCC_LSE_CONFIG(__STATE__) \
  6716. do { \
  6717. if((__STATE__) == RCC_LSE_ON) \
  6718. { \
  6719. SET_BIT(RCC->BDCR, RCC_BDCR_LSEON); \
  6720. } \
  6721. else if((__STATE__) == RCC_LSE_OFF) \
  6722. { \
  6723. CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEON); \
  6724. CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEBYP); \
  6725. } \
  6726. else if((__STATE__) == RCC_LSE_BYPASS) \
  6727. { \
  6728. SET_BIT(RCC->BDCR, RCC_BDCR_LSEBYP); \
  6729. SET_BIT(RCC->BDCR, RCC_BDCR_LSEON); \
  6730. } \
  6731. else \
  6732. { \
  6733. CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEON); \
  6734. CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEBYP); \
  6735. } \
  6736. } while(0)
  6737. #endif /* RCC_BDCR_LSEEXT */
  6738. /**
  6739. * @}
  6740. */
  6741. /** @brief Macros to enable or disable the the RTC clock.
  6742. * @note These macros must be used only after the RTC clock source was selected.
  6743. */
  6744. #define __HAL_RCC_RTC_ENABLE() SET_BIT(RCC->BDCR, RCC_BDCR_RTCEN)
  6745. #define __HAL_RCC_RTC_DISABLE() CLEAR_BIT(RCC->BDCR, RCC_BDCR_RTCEN)
  6746. /** @brief Macros to configure the RTC clock (RTCCLK).
  6747. * @note As the RTC clock configuration bits are in the Backup domain and write
  6748. * access is denied to this domain after reset, you have to enable write
  6749. * access using the Power Backup Access macro before to configure
  6750. * the RTC clock source (to be done once after reset).
  6751. * @note Once the RTC clock is configured it can't be changed unless the
  6752. * Backup domain is reset using __HAL_RCC_BackupReset_RELEASE() macro, or by
  6753. * a Power On Reset (POR).
  6754. * @param __RTCCLKSource__: specifies the RTC clock source.
  6755. * This parameter can be one of the following values:
  6756. * @arg RCC_RTCCLKSOURCE_LSE: LSE selected as RTC clock.
  6757. * @arg RCC_RTCCLKSOURCE_LSI: LSI selected as RTC clock.
  6758. * @arg RCC_RTCCLKSOURCE_HSE_DIVx: HSE clock divided by x selected
  6759. * as RTC clock, where x:[2,31]
  6760. * @note If the LSE or LSI is used as RTC clock source, the RTC continues to
  6761. * work in STOP and STANDBY modes, and can be used as wakeup source.
  6762. * However, when the HSE clock is used as RTC clock source, the RTC
  6763. * cannot be used in STOP and STANDBY modes.
  6764. * @note The maximum input clock frequency for RTC is 1MHz (when using HSE as
  6765. * RTC clock source).
  6766. */
  6767. #define __HAL_RCC_RTC_CLKPRESCALER(__RTCCLKSource__) (((__RTCCLKSource__) & RCC_BDCR_RTCSEL) == RCC_BDCR_RTCSEL) ? \
  6768. MODIFY_REG(RCC->CFGR, RCC_CFGR_RTCPRE, (((__RTCCLKSource__) & 0xFFFFCFFU) >> 4)) : CLEAR_BIT(RCC->CFGR, RCC_CFGR_RTCPRE)
  6769. #define __HAL_RCC_RTC_CONFIG(__RTCCLKSource__) do { __HAL_RCC_RTC_CLKPRESCALER(__RTCCLKSource__); \
  6770. RCC->BDCR |= ((__RTCCLKSource__) & 0x00000FFFU); \
  6771. } while (0)
  6772. #define __HAL_RCC_GET_RTC_SOURCE() ((uint32_t)(READ_BIT(RCC->BDCR, RCC_BDCR_RTCSEL)))
  6773. /** @brief Macros to force or release the Backup domain reset.
  6774. * @note This function resets the RTC peripheral (including the backup registers)
  6775. * and the RTC clock source selection in RCC_BDCR register.
  6776. * @note The BKPSRAM is not affected by this reset.
  6777. */
  6778. #define __HAL_RCC_BACKUPRESET_FORCE() SET_BIT(RCC->BDCR, RCC_BDCR_BDRST)
  6779. #define __HAL_RCC_BACKUPRESET_RELEASE() CLEAR_BIT(RCC->BDCR, RCC_BDCR_BDRST)
  6780. /** @brief Macros to enable or disable the main PLL.
  6781. * @note After enabling the main PLL, the application software should wait on
  6782. * PLLRDY flag to be set indicating that PLL clock is stable and can
  6783. * be used as system clock source.
  6784. * @note The main PLL can not be disabled if it is used as system clock source
  6785. * @note The main PLL is disabled by hardware when entering STOP and STANDBY modes.
  6786. */
  6787. #define __HAL_RCC_PLL_ENABLE() SET_BIT(RCC->CR, RCC_CR_PLL1ON)
  6788. #define __HAL_RCC_PLL_DISABLE() CLEAR_BIT(RCC->CR, RCC_CR_PLL1ON)
  6789. /**
  6790. * @brief Enables or disables each clock output (PLL_P_CLK, PLL_Q_CLK, PLL_R_CLK)
  6791. * @note Enabling/disabling those Clocks can be done only when the PLL is disabled.
  6792. * This is mainly used to save Power.
  6793. * (The ck_pll_p of the System PLL cannot be stopped if used as System Clock).
  6794. * @param __RCC_PLL1ClockOut__: specifies the PLL clock to be outputted
  6795. * This parameter can be one of the following values:
  6796. * @arg RCC_PLL1_DIVP: This clock is used to generate system clock up to 550MHZ(*), 480MHZ(**) or 280MHZ(***)
  6797. * @arg RCC_PLL1_DIVQ: This clock is used to generate peripherals clock up to 550MHZ(*), 480MHZ(**) or 280MHZ(***)
  6798. * @arg RCC_PLL1_DIVR: This clock is used to generate peripherals clock up to 550MHZ(*), 480MHZ(**) or 280MHZ(***)
  6799. *
  6800. * (*) : For stm32h72xxx and stm32h73xxx family lines and requires to enable the CPU_FREQ_BOOST flash option byte, 520MHZ otherwise.
  6801. * (**) : For stm32h74xx and stm32h75xx family lines and requires the board to be connected on LDO regulator not SMPS, 400MHZ otherwise.
  6802. * (***): For stm32h7a3xx, stm32h7b3xx and stm32h7b0xx family lines.
  6803. *
  6804. * @retval None
  6805. */
  6806. #define __HAL_RCC_PLLCLKOUT_ENABLE(__RCC_PLL1ClockOut__) SET_BIT(RCC->PLLCFGR, (__RCC_PLL1ClockOut__))
  6807. #define __HAL_RCC_PLLCLKOUT_DISABLE(__RCC_PLL1ClockOut__) CLEAR_BIT(RCC->PLLCFGR, (__RCC_PLL1ClockOut__))
  6808. /**
  6809. * @brief Enables or disables Fractional Part Of The Multiplication Factor of PLL1 VCO
  6810. * @note Enabling/disabling Fractional Part can be any time without the need to stop the PLL1
  6811. * @retval None
  6812. */
  6813. #define __HAL_RCC_PLLFRACN_ENABLE() SET_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLL1FRACEN)
  6814. #define __HAL_RCC_PLLFRACN_DISABLE() CLEAR_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLL1FRACEN)
  6815. /**
  6816. * @brief Macro to configures the main PLL clock source, multiplication and division factors.
  6817. * @note This function must be used only when the main PLL is disabled.
  6818. *
  6819. * @param __RCC_PLLSOURCE__: specifies the PLL entry clock source.
  6820. * This parameter can be one of the following values:
  6821. * @arg RCC_PLLSOURCE_CSI: CSI oscillator clock selected as PLL clock entry
  6822. * @arg RCC_PLLSOURCE_HSI: HSI oscillator clock selected as PLL clock entry
  6823. * @arg RCC_PLLSOURCE_HSE: HSE oscillator clock selected as PLL clock entry
  6824. * @note This clock source (__RCC_PLLSource__) is common for the main PLL1 (main PLL) and PLL2 & PLL3 .
  6825. *
  6826. * @param __PLLM1__: specifies the division factor for PLL VCO input clock
  6827. * This parameter must be a number between 1 and 63.
  6828. * @note You have to set the PLLM parameter correctly to ensure that the VCO input
  6829. * frequency ranges from 1 to 16 MHz.
  6830. *
  6831. * @param __PLLN1__: specifies the multiplication factor for PLL VCO output clock
  6832. * This parameter must be a number between 4 and 512 or between 8 and 420(*).
  6833. * @note You have to set the PLLN parameter correctly to ensure that the VCO
  6834. * output frequency is between 150 and 420 MHz (when in medium VCO range) or
  6835. * between 192 and 836 MHZ or between 128 and 560 MHZ(*) (when in wide VCO range)
  6836. *
  6837. * @param __PLLP1__: specifies the division factor for system clock.
  6838. * This parameter must be a number between 2 or 1(**) and 128 (where odd numbers are not allowed)
  6839. *
  6840. * @param __PLLQ1__: specifies the division factor for peripheral kernel clocks
  6841. * This parameter must be a number between 1 and 128
  6842. *
  6843. * @param __PLLR1__: specifies the division factor for peripheral kernel clocks
  6844. * This parameter must be a number between 1 and 128
  6845. *
  6846. * @note To insure an optimal behavior of the PLL when one of the post-divider (DIVP, DIVQ or DIVR)
  6847. * is not used, application shall clear the enable bit (DIVyEN) and assign lowest possible
  6848. * value to __PLL1P__, __PLL1Q__ or __PLL1R__ parameters.
  6849. * @retval None
  6850. *
  6851. * (*) : For stm32h7a3xx and stm32h7b3xx family lines.
  6852. * (**): For stm32h72xxx and stm32h73xxx family lines.
  6853. */
  6854. #define __HAL_RCC_PLL_CONFIG(__RCC_PLLSOURCE__, __PLLM1__, __PLLN1__, __PLLP1__, __PLLQ1__,__PLLR1__ ) \
  6855. do{ MODIFY_REG(RCC->PLLCKSELR, (RCC_PLLCKSELR_PLLSRC | RCC_PLLCKSELR_DIVM1) , ((__RCC_PLLSOURCE__) | ( (__PLLM1__) <<4U))); \
  6856. WRITE_REG (RCC->PLL1DIVR , ( (((__PLLN1__) - 1U )& RCC_PLL1DIVR_N1) | ((((__PLLP1__) -1U ) << 9U) & RCC_PLL1DIVR_P1) | \
  6857. ((((__PLLQ1__) -1U) << 16U)& RCC_PLL1DIVR_Q1) | ((((__PLLR1__) - 1U) << 24U)& RCC_PLL1DIVR_R1))); \
  6858. } while(0)
  6859. /** @brief Macro to configure the PLLs clock source.
  6860. * @note This function must be used only when all PLLs are disabled.
  6861. * @param __PLLSOURCE__: specifies the PLLs entry clock source.
  6862. * This parameter can be one of the following values:
  6863. * @arg RCC_PLLSOURCE_CSI: CSI oscillator clock selected as PLL clock entry
  6864. * @arg RCC_PLLSOURCE_HSI: HSI oscillator clock selected as PLL clock entry
  6865. * @arg RCC_PLLSOURCE_HSE: HSE oscillator clock selected as PLL clock entry
  6866. *
  6867. */
  6868. #define __HAL_RCC_PLL_PLLSOURCE_CONFIG(__PLLSOURCE__) MODIFY_REG(RCC->PLLCKSELR, RCC_PLLCKSELR_PLLSRC, (__PLLSOURCE__))
  6869. /**
  6870. * @brief Macro to configures the main PLL clock Fractional Part Of The Multiplication Factor
  6871. *
  6872. * @note These bits can be written at any time, allowing dynamic fine-tuning of the PLL1 VCO
  6873. *
  6874. * @param __RCC_PLL1FRACN__: specifies Fractional Part Of The Multiplication Factor for PLL1 VCO
  6875. * It should be a value between 0 and 8191
  6876. * @note Warning: The software has to set correctly these bits to insure that the VCO
  6877. * output frequency is between its valid frequency range, which is:
  6878. * 192 to 836 MHz or 128 to 560 MHz(*) if PLL1VCOSEL = 0
  6879. * 150 to 420 MHz if PLL1VCOSEL = 1.
  6880. *
  6881. * (*) : For stm32h7a3xx and stm32h7b3xx family lines.
  6882. *
  6883. * @retval None
  6884. */
  6885. #define __HAL_RCC_PLLFRACN_CONFIG(__RCC_PLL1FRACN__) MODIFY_REG(RCC->PLL1FRACR, RCC_PLL1FRACR_FRACN1, (uint32_t)(__RCC_PLL1FRACN__) << RCC_PLL1FRACR_FRACN1_Pos)
  6886. /** @brief Macro to select the PLL1 reference frequency range.
  6887. * @param __RCC_PLL1VCIRange__: specifies the PLL1 input frequency range
  6888. * This parameter can be one of the following values:
  6889. * @arg RCC_PLL1VCIRANGE_0: Range frequency is between 1 and 2 MHz
  6890. * @arg RCC_PLL1VCIRANGE_1: Range frequency is between 2 and 4 MHz
  6891. * @arg RCC_PLL1VCIRANGE_2: Range frequency is between 4 and 8 MHz
  6892. * @arg RCC_PLL1VCIRANGE_3: Range frequency is between 8 and 16 MHz
  6893. * @retval None
  6894. */
  6895. #define __HAL_RCC_PLL_VCIRANGE(__RCC_PLL1VCIRange__) \
  6896. MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLL1RGE, (__RCC_PLL1VCIRange__))
  6897. /** @brief Macro to select the PLL1 reference frequency range.
  6898. * @param __RCC_PLL1VCORange__: specifies the PLL1 input frequency range
  6899. * This parameter can be one of the following values:
  6900. * @arg RCC_PLL1VCOWIDE: Range frequency is between 192 and 836 MHz or between 128 to 560 MHz(*)
  6901. * @arg RCC_PLL1VCOMEDIUM: Range frequency is between 150 and 420 MHz
  6902. *
  6903. * (*) : For stm32h7a3xx and stm32h7b3xx family lines.
  6904. *
  6905. * @retval None
  6906. */
  6907. #define __HAL_RCC_PLL_VCORANGE(__RCC_PLL1VCORange__) \
  6908. MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLL1VCOSEL, (__RCC_PLL1VCORange__))
  6909. /** @brief Macro to get the clock source used as system clock.
  6910. * @retval The clock source used as system clock. The returned value can be one
  6911. * of the following:
  6912. * - RCC_CFGR_SWS_CSI: CSI used as system clock.
  6913. * - RCC_CFGR_SWS_HSI: HSI used as system clock.
  6914. * - RCC_CFGR_SWS_HSE: HSE used as system clock.
  6915. * - RCC_CFGR_SWS_PLL: PLL used as system clock.
  6916. */
  6917. #define __HAL_RCC_GET_SYSCLK_SOURCE() ((uint32_t)(RCC->CFGR & RCC_CFGR_SWS))
  6918. /**
  6919. * @brief Macro to configure the system clock source.
  6920. * @param __RCC_SYSCLKSOURCE__: specifies the system clock source.
  6921. * This parameter can be one of the following values:
  6922. * - RCC_SYSCLKSOURCE_HSI: HSI oscillator is used as system clock source.
  6923. * - RCC_SYSCLKSOURCE_CSI: CSI oscillator is used as system clock source.
  6924. * - RCC_SYSCLKSOURCE_HSE: HSE oscillator is used as system clock source.
  6925. * - RCC_SYSCLKSOURCE_PLLCLK: PLL output is used as system clock source.
  6926. */
  6927. #define __HAL_RCC_SYSCLK_CONFIG(__RCC_SYSCLKSOURCE__) MODIFY_REG(RCC->CFGR, RCC_CFGR_SW, (__RCC_SYSCLKSOURCE__))
  6928. /** @brief Macro to get the oscillator used as PLL clock source.
  6929. * @retval The oscillator used as PLL clock source. The returned value can be one
  6930. * of the following:
  6931. * - RCC_PLLSOURCE_NONE: No oscillator is used as PLL clock source.
  6932. * - RCC_PLLSOURCE_CSI: CSI oscillator is used as PLL clock source.
  6933. * - RCC_PLLSOURCE_HSI: HSI oscillator is used as PLL clock source.
  6934. * - RCC_PLLSOURCE_HSE: HSE oscillator is used as PLL clock source.
  6935. */
  6936. #define __HAL_RCC_GET_PLL_OSCSOURCE() ((uint32_t)(RCC->PLLCKSELR & RCC_PLLCKSELR_PLLSRC))
  6937. /** @defgroup RCCEx_MCOx_Clock_Config RCC Extended MCOx Clock Config
  6938. * @{
  6939. */
  6940. /** @brief Macro to configure the MCO1 clock.
  6941. * @param __MCOCLKSOURCE__ specifies the MCO clock source.
  6942. * This parameter can be one of the following values:
  6943. * @arg RCC_MCO1SOURCE_HSI: HSI clock selected as MCO1 source
  6944. * @arg RCC_MCO1SOURCE_LSE: LSE clock selected as MCO1 source
  6945. * @arg RCC_MCO1SOURCE_HSE: HSE clock selected as MCO1 source
  6946. * @arg RCC_MCO1SOURCE_PLL1QCLK: PLL1Q clock selected as MCO1 source
  6947. * @arg RCC_MCO1SOURCE_HSI48: HSI48 (48MHZ) selected as MCO1 source
  6948. * @param __MCODIV__ specifies the MCO clock prescaler.
  6949. * This parameter can be one of the following values:
  6950. * @arg RCC_MCODIV_1 up to RCC_MCODIV_15 : divider applied to MCO1 clock
  6951. */
  6952. #define __HAL_RCC_MCO1_CONFIG(__MCOCLKSOURCE__, __MCODIV__) \
  6953. MODIFY_REG(RCC->CFGR, (RCC_CFGR_MCO1 | RCC_CFGR_MCO1PRE), ((__MCOCLKSOURCE__) | (__MCODIV__)))
  6954. /** @brief Macro to configure the MCO2 clock.
  6955. * @param __MCOCLKSOURCE__ specifies the MCO clock source.
  6956. * This parameter can be one of the following values:
  6957. * @arg RCC_MCO2SOURCE_SYSCLK: System clock (SYSCLK) selected as MCO2 source
  6958. * @arg RCC_MCO2SOURCE_PLL2PCLK: PLL2P clock selected as MCO2 source
  6959. * @arg RCC_MCO2SOURCE_HSE: HSE clock selected as MCO2 source
  6960. * @arg RCC_MCO2SOURCE_PLLCLK: PLL1P clock selected as MCO2 source
  6961. * @arg RCC_MCO2SOURCE_CSICLK: CSI clock selected as MCO2 source
  6962. * @arg RCC_MCO2SOURCE_LSICLK: LSI clock selected as MCO2 source
  6963. * @param __MCODIV__ specifies the MCO clock prescaler.
  6964. * This parameter can be one of the following values:
  6965. * @arg RCC_MCODIV_1 up to RCC_MCODIV_15 : divider applied to MCO2 clock
  6966. */
  6967. #define __HAL_RCC_MCO2_CONFIG(__MCOCLKSOURCE__, __MCODIV__) \
  6968. MODIFY_REG(RCC->CFGR, (RCC_CFGR_MCO2 | RCC_CFGR_MCO2PRE), ((__MCOCLKSOURCE__) | ((__MCODIV__) << 7)));
  6969. /**
  6970. * @}
  6971. */
  6972. /**
  6973. * @brief Macro to configure the External Low Speed oscillator (LSE) drive capability.
  6974. * @note As the LSE is in the Backup domain and write access is denied to
  6975. * this domain after reset, you have to enable write access using
  6976. * HAL_PWR_EnableBkUpAccess() function before to configure the LSE
  6977. * (to be done once after reset).
  6978. * @note On STM32H7 Rev.B and above devices this can't be updated while LSE is ON.
  6979. * @param __LSEDRIVE__: specifies the new state of the LSE drive capability.
  6980. * This parameter can be one of the following values:
  6981. * @arg RCC_LSEDRIVE_LOW: LSE oscillator low drive capability.
  6982. * @arg RCC_LSEDRIVE_MEDIUMLOW: LSE oscillator medium low drive capability.
  6983. * @arg RCC_LSEDRIVE_MEDIUMHIGH: LSE oscillator medium high drive capability.
  6984. * @arg RCC_LSEDRIVE_HIGH: LSE oscillator high drive capability.
  6985. * @retval None
  6986. */
  6987. #if defined(RCC_VER_X)
  6988. #define __HAL_RCC_LSEDRIVE_CONFIG(__LSEDRIVE__) \
  6989. do{ \
  6990. if((HAL_GetREVID() <= REV_ID_Y) && (((__LSEDRIVE__) == RCC_LSEDRIVE_MEDIUMLOW) || ((__LSEDRIVE__) == RCC_LSEDRIVE_MEDIUMHIGH))) \
  6991. { \
  6992. MODIFY_REG(RCC->BDCR, RCC_BDCR_LSEDRV, (~(uint32_t)(__LSEDRIVE__)) & RCC_BDCR_LSEDRV_Msk); \
  6993. } \
  6994. else \
  6995. { \
  6996. MODIFY_REG(RCC->BDCR, RCC_BDCR_LSEDRV, (uint32_t)(__LSEDRIVE__)); \
  6997. } \
  6998. } while(0)
  6999. #else
  7000. #define __HAL_RCC_LSEDRIVE_CONFIG(__LSEDRIVE__) \
  7001. MODIFY_REG(RCC->BDCR, RCC_BDCR_LSEDRV, (uint32_t)(__LSEDRIVE__));
  7002. #endif /*RCC_VER_X*/
  7003. /**
  7004. * @brief Macro to configure the wake up from stop clock.
  7005. * @param __RCC_STOPWUCLK__: specifies the clock source used after wake up from stop
  7006. * This parameter can be one of the following values:
  7007. * @arg RCC_STOP_WAKEUPCLOCK_CSI: CSI selected as system clock source
  7008. * @arg RCC_STOP_WAKEUPCLOCK_HSI: HSI selected as system clock source
  7009. * @retval None
  7010. */
  7011. #define __HAL_RCC_WAKEUPSTOP_CLK_CONFIG(__RCC_STOPWUCLK__) \
  7012. MODIFY_REG(RCC->CFGR, RCC_CFGR_STOPWUCK, (__RCC_STOPWUCLK__))
  7013. /**
  7014. * @brief Macro to configure the Kernel wake up from stop clock.
  7015. * @param __RCC_STOPKERWUCLK__: specifies the Kernel clock source used after wake up from stop
  7016. * This parameter can be one of the following values:
  7017. * @arg RCC_STOP_KERWAKEUPCLOCK_CSI: CSI selected as Kernel clock source
  7018. * @arg RCC_STOP_KERWAKEUPCLOCK_HSI: HSI selected as Kernel clock source
  7019. * @retval None
  7020. */
  7021. #define __HAL_RCC_KERWAKEUPSTOP_CLK_CONFIG(__RCC_STOPKERWUCLK__) \
  7022. MODIFY_REG(RCC->CFGR, RCC_CFGR_STOPKERWUCK, (__RCC_STOPKERWUCLK__))
  7023. /** @defgroup RCC_Flags_Interrupts_Management Flags Interrupts Management
  7024. * @brief macros to manage the specified RCC Flags and interrupts.
  7025. * @{
  7026. */
  7027. /** @brief Enable RCC interrupt.
  7028. * @param __INTERRUPT__: specifies the RCC interrupt sources to be enabled.
  7029. * This parameter can be any combination of the following values:
  7030. * @arg RCC_IT_LSIRDY: LSI ready interrupt
  7031. * @arg RCC_IT_LSERDY: LSE ready interrupt
  7032. * @arg RCC_IT_CSIRDY: HSI ready interrupt
  7033. * @arg RCC_IT_HSIRDY: HSI ready interrupt
  7034. * @arg RCC_IT_HSERDY: HSE ready interrupt
  7035. * @arg RCC_IT_HSI48RDY: HSI48 ready interrupt
  7036. * @arg RCC_IT_PLLRDY: main PLL ready interrupt
  7037. * @arg RCC_IT_PLL2RDY: PLL2 ready interrupt
  7038. * @arg RCC_IT_PLL3RDY: PLL3 ready interrupt
  7039. * @arg RCC_IT_LSECSS: Clock security system interrupt
  7040. */
  7041. #define __HAL_RCC_ENABLE_IT(__INTERRUPT__) SET_BIT(RCC->CIER, (__INTERRUPT__))
  7042. /** @brief Disable RCC interrupt
  7043. * @param __INTERRUPT__: specifies the RCC interrupt sources to be disabled.
  7044. * This parameter can be any combination of the following values:
  7045. * @arg RCC_IT_LSIRDY: LSI ready interrupt
  7046. * @arg RCC_IT_LSERDY: LSE ready interrupt
  7047. * @arg RCC_IT_CSIRDY: HSI ready interrupt
  7048. * @arg RCC_IT_HSIRDY: HSI ready interrupt
  7049. * @arg RCC_IT_HSERDY: HSE ready interrupt
  7050. * @arg RCC_IT_HSI48RDY: HSI48 ready interrupt
  7051. * @arg RCC_IT_PLLRDY: main PLL ready interrupt
  7052. * @arg RCC_IT_PLL2RDY: PLL2 ready interrupt
  7053. * @arg RCC_IT_PLL3RDY: PLL3 ready interrupt
  7054. * @arg RCC_IT_LSECSS: Clock security system interrupt
  7055. */
  7056. #define __HAL_RCC_DISABLE_IT(__INTERRUPT__) CLEAR_BIT(RCC->CIER, (__INTERRUPT__))
  7057. /** @brief Clear the RCC's interrupt pending bits
  7058. * @param __INTERRUPT__: specifies the interrupt pending bit to clear.
  7059. * This parameter can be any combination of the following values:
  7060. * @arg RCC_IT_LSIRDY: LSI ready interrupt
  7061. * @arg RCC_IT_LSERDY: LSE ready interrupt
  7062. * @arg RCC_IT_CSIRDY: CSI ready interrupt
  7063. * @arg RCC_IT_HSIRDY: HSI ready interrupt
  7064. * @arg RCC_IT_HSERDY: HSE ready interrupt
  7065. * @arg RCC_IT_HSI48RDY: HSI48 ready interrupt
  7066. * @arg RCC_IT_PLLRDY: main PLL ready interrupt
  7067. * @arg RCC_IT_PLL2RDY: PLL2 ready interrupt
  7068. * @arg RCC_IT_PLL3RDY: PLL3 ready interrupt
  7069. * @arg RCC_IT_HSECSS: HSE Clock Security interrupt
  7070. * @arg RCC_IT_LSECSS: Clock security system interrupt
  7071. */
  7072. #define __HAL_RCC_CLEAR_IT(__INTERRUPT__) (RCC->CICR = (__INTERRUPT__))
  7073. /** @brief Check the RCC's interrupt has occurred or not.
  7074. * @param __INTERRUPT__: specifies the RCC interrupt source to check.
  7075. * This parameter can be any combination of the following values:
  7076. * @arg RCC_IT_LSIRDY: LSI ready interrupt
  7077. * @arg RCC_IT_LSERDY: LSE ready interrupt
  7078. * @arg RCC_IT_CSIRDY: CSI ready interrupt
  7079. * @arg RCC_IT_HSIRDY: HSI ready interrupt
  7080. * @arg RCC_IT_HSERDY: HSE ready interrupt
  7081. * @arg RCC_IT_HSI48RDY: HSI48 ready interrupt
  7082. * @arg RCC_IT_PLLRDY: main PLL ready interrupt
  7083. * @arg RCC_IT_PLL2RDY: PLL2 ready interrupt
  7084. * @arg RCC_IT_PLL3RDY: PLL3 ready interrupt
  7085. * @arg RCC_IT_HSECSS: HSE Clock Security interrupt
  7086. * @arg RCC_IT_LSECSS: Clock security system interrupt
  7087. * @retval The new state of __INTERRUPT__ (TRUE or FALSE).
  7088. */
  7089. #define __HAL_RCC_GET_IT(__INTERRUPT__) ((RCC->CIFR & (__INTERRUPT__)) == (__INTERRUPT__))
  7090. /** @brief Set RMVF bit to clear the reset flags.
  7091. */
  7092. #define __HAL_RCC_CLEAR_RESET_FLAGS() (RCC->RSR |= RCC_RSR_RMVF)
  7093. #if defined(DUAL_CORE)
  7094. #define __HAL_RCC_C1_CLEAR_RESET_FLAGS() (RCC_C1->RSR |= RCC_RSR_RMVF)
  7095. #define __HAL_RCC_C2_CLEAR_RESET_FLAGS() (RCC_C2->RSR |= RCC_RSR_RMVF)
  7096. #endif /*DUAL_CORE*/
  7097. #if defined(DUAL_CORE)
  7098. /** @brief Check RCC flag is set or not.
  7099. * @param __FLAG__: specifies the flag to check.
  7100. * This parameter can be one of the following values:
  7101. * @arg RCC_FLAG_HSIRDY: HSI oscillator clock ready
  7102. * @arg RCC_FLAG_HSIDIV: HSI divider flag
  7103. * @arg RCC_FLAG_CSIRDY: CSI oscillator clock ready
  7104. * @arg RCC_FLAG_HSI48RDY: HSI48 oscillator clock ready
  7105. * @arg RCC_FLAG_HSERDY: HSE oscillator clock ready
  7106. * @arg RCC_FLAG_D1CKRDY: Domain1 clock ready
  7107. * @arg RCC_FLAG_D2CKRDY: Domain2 clock ready
  7108. * @arg RCC_FLAG_PLLRDY: PLL1 clock ready
  7109. * @arg RCC_FLAG_PLL2RDY: PLL2 clock ready
  7110. * @arg RCC_FLAG_PLL3RDY: PLL3 clock ready
  7111. * @arg RCC_FLAG_LSERDY: LSE oscillator clock ready
  7112. * @arg RCC_FLAG_LSIRDY: LSI oscillator clock ready
  7113. * @arg RCC_FLAG_C1RST: CPU reset flag
  7114. * @arg RCC_FLAG_C2RST: CPU2 reset flag
  7115. * @arg RCC_FLAG_D1RST: D1 domain power switch reset flag
  7116. * @arg RCC_FLAG_D2RST: D2 domain power switch reset flag
  7117. * @arg RCC_FLAG_BORRST: BOR reset flag
  7118. * @arg RCC_FLAG_PINRST: Pin reset
  7119. * @arg RCC_FLAG_PORRST: POR/PDR reset
  7120. * @arg RCC_FLAG_SFTR1ST: System reset from CPU reset flag
  7121. * @arg RCC_FLAG_SFTR2ST: System reset from CPU2 reset flag
  7122. * @arg RCC_FLAG_BORRST: D2 domain power switch reset flag
  7123. * @arg RCC_FLAG_IWDG1RST: CPU Independent Watchdog reset
  7124. * @arg RCC_FLAG_IWDG2RST: CPU2 Independent Watchdog reset
  7125. * @arg RCC_FLAG_WWDG2RST: Window Watchdog2 reset
  7126. * @arg RCC_FLAG_WWDG1RST: Window Watchdog1 reset
  7127. * @arg RCC_FLAG_LPWR1RST: Reset due to illegal D1 DSTANDBY or CPU CSTOP flag
  7128. * @arg RCC_FLAG_LPWR2RST: Reset due to illegal D2 DSTANDBY or CPU2 CSTOP flag
  7129. * @retval The new state of __FLAG__ (TRUE or FALSE).
  7130. */
  7131. #define RCC_FLAG_MASK ((uint8_t)0x1F)
  7132. #define __HAL_RCC_GET_FLAG(__FLAG__) (((((((__FLAG__) >> 5U) == 1U)? RCC->CR :((((__FLAG__) >> 5U) == 2U) ? RCC->BDCR : \
  7133. ((((__FLAG__) >> 5U) == 3U)? RCC->CSR : ((((__FLAG__) >> 5U) == 4U)? RCC->RSR :RCC->CIFR)))) & (1U << ((__FLAG__) & RCC_FLAG_MASK)))!= 0U)? 1U : 0U)
  7134. #define __HAL_RCC_C1_GET_FLAG(__FLAG__) (((((((__FLAG__) >> 5U) == 1U)? RCC->CR :((((__FLAG__) >> 5U) == 2U) ? RCC->BDCR : \
  7135. ((((__FLAG__) >> 5U) == 3U)? RCC->CSR : ((((__FLAG__) >> 5U) == 4U)? RCC_C1->RSR :RCC->CIFR)))) & (1U << ((__FLAG__) & RCC_FLAG_MASK)))!= 0U)? 1U : 0U)
  7136. #define __HAL_RCC_C2_GET_FLAG(__FLAG__) (((((((__FLAG__) >> 5U) == 1U)? RCC->CR :((((__FLAG__) >> 5U) == 2U) ? RCC->BDCR : \
  7137. ((((__FLAG__) >> 5U) == 3U)? RCC->CSR : ((((__FLAG__) >> 5U) == 4U)? RCC_C2->RSR :RCC->CIFR)))) & (1U << ((__FLAG__) & RCC_FLAG_MASK)))!= 0U)? 1U : 0U)
  7138. #else
  7139. /** @brief Check RCC flag is set or not.
  7140. * @param __FLAG__: specifies the flag to check.
  7141. * This parameter can be one of the following values:
  7142. * @arg RCC_FLAG_HSIRDY: HSI oscillator clock ready
  7143. * @arg RCC_FLAG_HSIDIV: HSI divider flag
  7144. * @arg RCC_FLAG_CSIRDY: CSI oscillator clock ready
  7145. * @arg RCC_FLAG_HSI48RDY: HSI48 oscillator clock ready
  7146. * @arg RCC_FLAG_HSERDY: HSE oscillator clock ready
  7147. * @arg RCC_FLAG_D1CKRDY: Domain1 clock ready (*)
  7148. * @arg RCC_FLAG_D2CKRDY: Domain2 clock ready (*)
  7149. * @arg RCC_FLAG_CPUCKRDY: CPU Domain clock ready (CPU, APB3, bus matrix1 and related memories) (*)
  7150. * @arg RCC_FLAG_CDCKRDY: CPU Domain clock ready (*)
  7151. * @arg RCC_FLAG_PLLRDY: PLL1 clock ready
  7152. * @arg RCC_FLAG_PLL2RDY: PLL2 clock ready
  7153. * @arg RCC_FLAG_PLL3RDY: PLL3 clock ready
  7154. * @arg RCC_FLAG_LSERDY: LSE oscillator clock ready
  7155. * @arg RCC_FLAG_LSIRDY: LSI oscillator clock ready
  7156. * @arg RCC_FLAG_CPURST: CPU reset flag
  7157. * @arg RCC_FLAG_D1RST: D1 domain power switch reset flag (*)
  7158. * @arg RCC_FLAG_D2RST: D2 domain power switch reset flag (*)
  7159. * @arg RCC_FLAG_CDRST: CD domain power switch reset flag (*)
  7160. * @arg RCC_FLAG_BORRST: BOR reset flag
  7161. * @arg RCC_FLAG_PINRST: Pin reset
  7162. * @arg RCC_FLAG_PORRST: POR/PDR reset
  7163. * @arg RCC_FLAG_SFTRST: System reset from CPU reset flag
  7164. * @arg RCC_FLAG_BORRST: D2 domain power switch reset flag
  7165. * @arg RCC_FLAG_IWDG1RST: CPU Independent Watchdog reset
  7166. * @arg RCC_FLAG_WWDG1RST: Window Watchdog1 reset
  7167. * @arg RCC_FLAG_LPWR1RST: Reset due to illegal D1 DSTANDBY or CPU CSTOP flag
  7168. * @arg RCC_FLAG_LPWR2RST: Reset due to illegal D2 DSTANDBY flag
  7169. * @retval The new state of __FLAG__ (TRUE or FALSE).
  7170. *
  7171. * (*) Available on some STM32H7 lines only.
  7172. */
  7173. #define RCC_FLAG_MASK ((uint8_t)0x1F)
  7174. #define __HAL_RCC_GET_FLAG(__FLAG__) (((((((__FLAG__) >> 5U) == 1U)? RCC->CR :((((__FLAG__) >> 5U) == 2U) ? RCC->BDCR : \
  7175. ((((__FLAG__) >> 5U) == 3U)? RCC->CSR : ((((__FLAG__) >> 5U) == 4U)? RCC->RSR :RCC->CIFR)))) & (1UL << ((__FLAG__) & RCC_FLAG_MASK)))!= 0U)? 1U : 0U)
  7176. #endif /*DUAL_CORE*/
  7177. /**
  7178. * @}
  7179. */
  7180. #define RCC_GET_PLL_OSCSOURCE() ((RCC->PLLCKSELR & RCC_PLLCKSELR_PLLSRC) >> RCC_PLLCKSELR_PLLSRC_Pos)
  7181. /**
  7182. * @}
  7183. */
  7184. /* Include RCC HAL Extension module */
  7185. #include "stm32h7xx_hal_rcc_ex.h"
  7186. /* Exported functions --------------------------------------------------------*/
  7187. /** @addtogroup RCC_Exported_Functions
  7188. * @{
  7189. */
  7190. /** @addtogroup RCC_Exported_Functions_Group1
  7191. * @{
  7192. */
  7193. /* Initialization and de-initialization functions ******************************/
  7194. HAL_StatusTypeDef HAL_RCC_DeInit(void);
  7195. HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct);
  7196. HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t FLatency);
  7197. /**
  7198. * @}
  7199. */
  7200. /** @addtogroup RCC_Exported_Functions_Group2
  7201. * @{
  7202. */
  7203. /* Peripheral Control functions ************************************************/
  7204. void HAL_RCC_MCOConfig(uint32_t RCC_MCOx, uint32_t RCC_MCOSource, uint32_t RCC_MCODiv);
  7205. void HAL_RCC_EnableCSS(void);
  7206. void HAL_RCC_DisableCSS(void);
  7207. uint32_t HAL_RCC_GetSysClockFreq(void);
  7208. uint32_t HAL_RCC_GetHCLKFreq(void);
  7209. uint32_t HAL_RCC_GetPCLK1Freq(void);
  7210. uint32_t HAL_RCC_GetPCLK2Freq(void);
  7211. void HAL_RCC_GetOscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct);
  7212. void HAL_RCC_GetClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t *pFLatency);
  7213. /* CSS NMI IRQ handler */
  7214. void HAL_RCC_NMI_IRQHandler(void);
  7215. /* User Callbacks in non blocking mode (IT mode) */
  7216. void HAL_RCC_CSSCallback(void);
  7217. /**
  7218. * @}
  7219. */
  7220. /**
  7221. * @}
  7222. */
  7223. /* Private types -------------------------------------------------------------*/
  7224. /* Private variables ---------------------------------------------------------*/
  7225. /* Private constants ---------------------------------------------------------*/
  7226. /** @defgroup RCC_Private_Constants RCC Private Constants
  7227. * @{
  7228. */
  7229. #define HSE_TIMEOUT_VALUE HSE_STARTUP_TIMEOUT
  7230. #define HSI_TIMEOUT_VALUE (2U) /* 2 ms */
  7231. #define HSI48_TIMEOUT_VALUE (2U) /* 2 ms */
  7232. #define CSI_TIMEOUT_VALUE (2U) /* 2 ms */
  7233. #define LSI_TIMEOUT_VALUE (2U) /* 2 ms */
  7234. #define PLL_TIMEOUT_VALUE (2U) /* 2 ms */
  7235. #define PLL_FRAC_TIMEOUT_VALUE (1U) /* PLL Fractional part waiting time before new latch enable : 1 ms */
  7236. #define CLOCKSWITCH_TIMEOUT_VALUE (5000U) /* 5 s */
  7237. #define RCC_DBP_TIMEOUT_VALUE (100U)
  7238. #define RCC_LSE_TIMEOUT_VALUE LSE_STARTUP_TIMEOUT
  7239. /**
  7240. * @}
  7241. */
  7242. /* Private macros ------------------------------------------------------------*/
  7243. /** @addtogroup RCC_Private_Macros RCC Private Macros
  7244. * @{
  7245. */
  7246. /** @defgroup RCC_IS_RCC_Definitions RCC Private macros to check input parameters
  7247. * @{
  7248. */
  7249. #define IS_RCC_OSCILLATORTYPE(OSCILLATOR) (((OSCILLATOR) == RCC_OSCILLATORTYPE_NONE) || \
  7250. (((OSCILLATOR) & RCC_OSCILLATORTYPE_HSE) == RCC_OSCILLATORTYPE_HSE) || \
  7251. (((OSCILLATOR) & RCC_OSCILLATORTYPE_HSI) == RCC_OSCILLATORTYPE_HSI) || \
  7252. (((OSCILLATOR) & RCC_OSCILLATORTYPE_CSI) == RCC_OSCILLATORTYPE_CSI) || \
  7253. (((OSCILLATOR) & RCC_OSCILLATORTYPE_LSI) == RCC_OSCILLATORTYPE_LSI) || \
  7254. (((OSCILLATOR) & RCC_OSCILLATORTYPE_LSE) == RCC_OSCILLATORTYPE_LSE) || \
  7255. (((OSCILLATOR) & RCC_OSCILLATORTYPE_HSI48) == RCC_OSCILLATORTYPE_HSI48))
  7256. #if defined(RCC_CR_HSEEXT)
  7257. #define IS_RCC_HSE(HSE) (((HSE) == RCC_HSE_OFF) || ((HSE) == RCC_HSE_ON) || \
  7258. ((HSE) == RCC_HSE_BYPASS) || ((HSE) == RCC_HSE_BYPASS_DIGITAL))
  7259. #else
  7260. #define IS_RCC_HSE(HSE) (((HSE) == RCC_HSE_OFF) || ((HSE) == RCC_HSE_ON) || \
  7261. ((HSE) == RCC_HSE_BYPASS))
  7262. #endif /* RCC_CR_HSEEXT */
  7263. #if defined(RCC_BDCR_LSEEXT)
  7264. #define IS_RCC_LSE(LSE) (((LSE) == RCC_LSE_OFF) || ((LSE) == RCC_LSE_ON) || \
  7265. ((LSE) == RCC_LSE_BYPASS) || ((LSE) == RCC_LSE_BYPASS_DIGITAL))
  7266. #else
  7267. #define IS_RCC_LSE(LSE) (((LSE) == RCC_LSE_OFF) || ((LSE) == RCC_LSE_ON) || \
  7268. ((LSE) == RCC_LSE_BYPASS))
  7269. #endif /* RCC_BDCR_LSEEXT */
  7270. #define IS_RCC_HSI(HSI) (((HSI) == RCC_HSI_OFF) || ((HSI) == RCC_HSI_ON) || \
  7271. ((HSI) == RCC_HSI_DIV1) || ((HSI) == RCC_HSI_DIV2) || \
  7272. ((HSI) == RCC_HSI_DIV4) || ((HSI) == RCC_HSI_DIV8))
  7273. #define IS_RCC_HSI48(HSI48) (((HSI48) == RCC_HSI48_OFF) || ((HSI48) == RCC_HSI48_ON))
  7274. #define IS_RCC_LSI(LSI) (((LSI) == RCC_LSI_OFF) || ((LSI) == RCC_LSI_ON))
  7275. #define IS_RCC_CSI(CSI) (((CSI) == RCC_CSI_OFF) || ((CSI) == RCC_CSI_ON))
  7276. #define IS_RCC_PLL(PLL) (((PLL) == RCC_PLL_NONE) ||((PLL) == RCC_PLL_OFF) || \
  7277. ((PLL) == RCC_PLL_ON))
  7278. #define IS_RCC_PLLSOURCE(SOURCE) (((SOURCE) == RCC_PLLSOURCE_CSI) || \
  7279. ((SOURCE) == RCC_PLLSOURCE_HSI) || \
  7280. ((SOURCE) == RCC_PLLSOURCE_NONE) || \
  7281. ((SOURCE) == RCC_PLLSOURCE_HSE))
  7282. #define IS_RCC_PLLRGE_VALUE(VALUE) (((VALUE) == RCC_PLL1VCIRANGE_0) || \
  7283. ((VALUE) == RCC_PLL1VCIRANGE_1) || \
  7284. ((VALUE) == RCC_PLL1VCIRANGE_2) || \
  7285. ((VALUE) == RCC_PLL1VCIRANGE_3))
  7286. #define IS_RCC_PLLVCO_VALUE(VALUE) (((VALUE) == RCC_PLL1VCOWIDE) || ((VALUE) == RCC_PLL1VCOMEDIUM))
  7287. #define IS_RCC_PLLFRACN_VALUE(VALUE) ((VALUE) <= 8191U)
  7288. #define IS_RCC_PLLM_VALUE(VALUE) ((1U <= (VALUE)) && ((VALUE) <= 63U))
  7289. #if !defined(RCC_VER_2_0)
  7290. #define IS_RCC_PLLN_VALUE(VALUE) ((4U <= (VALUE)) && ((VALUE) <= 512U))
  7291. #else
  7292. #define IS_RCC_PLLN_VALUE(VALUE) ((8U <= (VALUE)) && ((VALUE) <= 420U))
  7293. #endif /* !RCC_VER_2_0 */
  7294. #define IS_RCC_PLLP_VALUE(VALUE) ((1U <= (VALUE)) && ((VALUE) <= 128U))
  7295. #define IS_RCC_PLLQ_VALUE(VALUE) ((1U <= (VALUE)) && ((VALUE) <= 128U))
  7296. #define IS_RCC_PLLR_VALUE(VALUE) ((1U <= (VALUE)) && ((VALUE) <= 128U))
  7297. #define IS_RCC_PLLCLOCKOUT_VALUE(VALUE) (((VALUE) == RCC_PLL1_DIVP) || \
  7298. ((VALUE) == RCC_PLL1_DIVQ) || \
  7299. ((VALUE) == RCC_PLL1_DIVR))
  7300. #define IS_RCC_CLOCKTYPE(CLK) ((1U <= (CLK)) && ((CLK) <= 0x3FU))
  7301. #define IS_RCC_SYSCLKSOURCE(SOURCE) (((SOURCE) == RCC_SYSCLKSOURCE_CSI) || \
  7302. ((SOURCE) == RCC_SYSCLKSOURCE_HSI) || \
  7303. ((SOURCE) == RCC_SYSCLKSOURCE_HSE) || \
  7304. ((SOURCE) == RCC_SYSCLKSOURCE_PLLCLK))
  7305. #define IS_RCC_SYSCLK(SYSCLK) (((SYSCLK) == RCC_SYSCLK_DIV1) || ((SYSCLK) == RCC_SYSCLK_DIV2) || \
  7306. ((SYSCLK) == RCC_SYSCLK_DIV4) || ((SYSCLK) == RCC_SYSCLK_DIV8) || \
  7307. ((SYSCLK) == RCC_SYSCLK_DIV16) || ((SYSCLK) == RCC_SYSCLK_DIV64) || \
  7308. ((SYSCLK) == RCC_SYSCLK_DIV128) || ((SYSCLK) == RCC_SYSCLK_DIV256) || \
  7309. ((SYSCLK) == RCC_SYSCLK_DIV512))
  7310. #define IS_RCC_HCLK(HCLK) (((HCLK) == RCC_HCLK_DIV1) || ((HCLK) == RCC_HCLK_DIV2) || \
  7311. ((HCLK) == RCC_HCLK_DIV4) || ((HCLK) == RCC_HCLK_DIV8) || \
  7312. ((HCLK) == RCC_HCLK_DIV16) || ((HCLK) == RCC_HCLK_DIV64) || \
  7313. ((HCLK) == RCC_HCLK_DIV128) || ((HCLK) == RCC_HCLK_DIV256) || \
  7314. ((HCLK) == RCC_HCLK_DIV512))
  7315. #define IS_RCC_CDPCLK1(CDPCLK1) (((CDPCLK1) == RCC_APB3_DIV1) || ((CDPCLK1) == RCC_APB3_DIV2) || \
  7316. ((CDPCLK1) == RCC_APB3_DIV4) || ((CDPCLK1) == RCC_APB3_DIV8) || \
  7317. ((CDPCLK1) == RCC_APB3_DIV16))
  7318. #define IS_RCC_D1PCLK1 IS_RCC_CDPCLK1 /* for legacy compatibility between H7 lines */
  7319. #define IS_RCC_PCLK1(PCLK1) (((PCLK1) == RCC_APB1_DIV1) || ((PCLK1) == RCC_APB1_DIV2) || \
  7320. ((PCLK1) == RCC_APB1_DIV4) || ((PCLK1) == RCC_APB1_DIV8) || \
  7321. ((PCLK1) == RCC_APB1_DIV16))
  7322. #define IS_RCC_PCLK2(PCLK2) (((PCLK2) == RCC_APB2_DIV1) || ((PCLK2) == RCC_APB2_DIV2) || \
  7323. ((PCLK2) == RCC_APB2_DIV4) || ((PCLK2) == RCC_APB2_DIV8) || \
  7324. ((PCLK2) == RCC_APB2_DIV16))
  7325. #define IS_RCC_SRDPCLK1(SRDPCLK1) (((SRDPCLK1) == RCC_APB4_DIV1) || ((SRDPCLK1) == RCC_APB4_DIV2) || \
  7326. ((SRDPCLK1) == RCC_APB4_DIV4) || ((SRDPCLK1) == RCC_APB4_DIV8) || \
  7327. ((SRDPCLK1) == RCC_APB4_DIV16))
  7328. #define IS_RCC_D3PCLK1 IS_RCC_SRDPCLK1 /* for legacy compatibility between H7 lines*/
  7329. #define IS_RCC_RTCCLKSOURCE(SOURCE) (((SOURCE) == RCC_RTCCLKSOURCE_LSE) || ((SOURCE) == RCC_RTCCLKSOURCE_LSI) || \
  7330. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV2) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV3) || \
  7331. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV4) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV5) || \
  7332. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV6) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV7) || \
  7333. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV8) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV9) || \
  7334. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV10) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV11) || \
  7335. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV12) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV13) || \
  7336. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV14) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV15) || \
  7337. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV16) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV17) || \
  7338. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV18) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV19) || \
  7339. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV20) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV21) || \
  7340. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV22) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV23) || \
  7341. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV24) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV25) || \
  7342. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV26) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV27) || \
  7343. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV28) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV29) || \
  7344. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV30) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV31) || \
  7345. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV32) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV33) || \
  7346. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV34) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV35) || \
  7347. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV36) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV37) || \
  7348. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV38) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV39) || \
  7349. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV40) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV41) || \
  7350. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV42) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV43) || \
  7351. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV44) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV45) || \
  7352. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV46) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV47) || \
  7353. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV48) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV49) || \
  7354. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV50) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV51) || \
  7355. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV52) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV53) || \
  7356. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV54) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV55) || \
  7357. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV56) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV57) || \
  7358. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV58) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV59) || \
  7359. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV60) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV61) || \
  7360. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV62) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV63))
  7361. #define IS_RCC_MCO(MCOx) (((MCOx) == RCC_MCO1) || ((MCOx) == RCC_MCO2))
  7362. #define IS_RCC_MCO1SOURCE(SOURCE) (((SOURCE) == RCC_MCO1SOURCE_HSI) || ((SOURCE) == RCC_MCO1SOURCE_LSE) || \
  7363. ((SOURCE) == RCC_MCO1SOURCE_HSE) || ((SOURCE) == RCC_MCO1SOURCE_PLL1QCLK) || \
  7364. ((SOURCE) == RCC_MCO1SOURCE_HSI48))
  7365. #define IS_RCC_MCO2SOURCE(SOURCE) (((SOURCE) == RCC_MCO2SOURCE_SYSCLK) || ((SOURCE) == RCC_MCO2SOURCE_PLL2PCLK) || \
  7366. ((SOURCE) == RCC_MCO2SOURCE_HSE) || ((SOURCE) == RCC_MCO2SOURCE_PLLCLK) || \
  7367. ((SOURCE) == RCC_MCO2SOURCE_CSICLK) || ((SOURCE) == RCC_MCO2SOURCE_LSICLK))
  7368. #define IS_RCC_MCODIV(DIV) (((DIV) == RCC_MCODIV_1) || ((DIV) == RCC_MCODIV_2) || \
  7369. ((DIV) == RCC_MCODIV_3) || ((DIV) == RCC_MCODIV_4) || \
  7370. ((DIV) == RCC_MCODIV_5) || ((DIV) == RCC_MCODIV_6) || \
  7371. ((DIV) == RCC_MCODIV_7) || ((DIV) == RCC_MCODIV_8) || \
  7372. ((DIV) == RCC_MCODIV_9) || ((DIV) == RCC_MCODIV_10) || \
  7373. ((DIV) == RCC_MCODIV_11) || ((DIV) == RCC_MCODIV_12) || \
  7374. ((DIV) == RCC_MCODIV_13) || ((DIV) == RCC_MCODIV_14) || \
  7375. ((DIV) == RCC_MCODIV_15))
  7376. #if defined(DUAL_CORE)
  7377. #define IS_RCC_FLAG(FLAG) (((FLAG) == RCC_FLAG_HSIRDY) || ((FLAG) == RCC_FLAG_CSIRDY) || \
  7378. ((FLAG) == RCC_FLAG_HSI48RDY) || ((FLAG) == RCC_FLAG_HSERDY) || \
  7379. ((FLAG) == RCC_FLAG_D1CKRDY) || ((FLAG) == RCC_FLAG_D2CKRDY) || \
  7380. ((FLAG) == RCC_FLAG_PLLRDY) || ((FLAG) == RCC_FLAG_PLL2RDY) || \
  7381. ((FLAG) == RCC_FLAG_PLL3RDY) || ((FLAG) == RCC_FLAG_LSERDY) || \
  7382. ((FLAG) == RCC_FLAG_LSIRDY) || \
  7383. ((FLAG) == RCC_FLAG_C1RST) || ((FLAG) == RCC_FLAG_C2RST) || \
  7384. ((FLAG) == RCC_FLAG_SFTR2ST) || ((FLAG) == RCC_FLAG_WWDG2RST)|| \
  7385. ((FLAG) == RCC_FLAG_IWDG2RST) || ((FLAG) == RCC_FLAG_D1RST) || \
  7386. ((FLAG) == RCC_FLAG_D2RST) || ((FLAG) == RCC_FLAG_BORRST) || \
  7387. ((FLAG) == RCC_FLAG_PINRST) || ((FLAG) == RCC_FLAG_PORRST) || \
  7388. ((FLAG) == RCC_FLAG_SFTR1ST) || ((FLAG) == RCC_FLAG_IWDG1RST)|| \
  7389. ((FLAG) == RCC_FLAG_WWDG1RST) || ((FLAG) == RCC_FLAG_LPWR1RST)|| \
  7390. ((FLAG) == RCC_FLAG_LPWR2RST) || ((FLAG) == RCC_FLAG_HSIDIV))
  7391. #else
  7392. #if defined(RCC_CR_D2CKRDY)
  7393. #define IS_RCC_FLAG(FLAG) (((FLAG) == RCC_FLAG_HSIRDY) || ((FLAG) == RCC_FLAG_CSIRDY) || \
  7394. ((FLAG) == RCC_FLAG_HSI48RDY) || ((FLAG) == RCC_FLAG_HSERDY) || \
  7395. ((FLAG) == RCC_FLAG_D1CKRDY) || ((FLAG) == RCC_FLAG_D2CKRDY) || \
  7396. ((FLAG) == RCC_FLAG_PLLRDY) || ((FLAG) == RCC_FLAG_PLL2RDY) || \
  7397. ((FLAG) == RCC_FLAG_PLL3RDY) || ((FLAG) == RCC_FLAG_LSERDY) || \
  7398. ((FLAG) == RCC_FLAG_LSIRDY) || \
  7399. ((FLAG) == RCC_FLAG_CPURST) || ((FLAG) == RCC_FLAG_D1RST) || \
  7400. ((FLAG) == RCC_FLAG_D2RST) || ((FLAG) == RCC_FLAG_BORRST) || \
  7401. ((FLAG) == RCC_FLAG_PINRST) || ((FLAG) == RCC_FLAG_PORRST) || \
  7402. ((FLAG) == RCC_FLAG_SFTRST) || ((FLAG) == RCC_FLAG_IWDG1RST)|| \
  7403. ((FLAG) == RCC_FLAG_WWDG1RST) || ((FLAG) == RCC_FLAG_LPWR1RST)|| \
  7404. ((FLAG) == RCC_FLAG_LPWR2RST) || ((FLAG) == RCC_FLAG_HSIDIV ))
  7405. #else
  7406. #define IS_RCC_FLAG(FLAG) (((FLAG) == RCC_FLAG_HSIRDY) || ((FLAG) == RCC_FLAG_CSIRDY) || \
  7407. ((FLAG) == RCC_FLAG_HSI48RDY) || ((FLAG) == RCC_FLAG_HSERDY) || \
  7408. ((FLAG) == RCC_FLAG_CPUCKRDY) || ((FLAG) == RCC_FLAG_CDCKRDY) || \
  7409. ((FLAG) == RCC_FLAG_PLLRDY) || ((FLAG) == RCC_FLAG_PLL2RDY) || \
  7410. ((FLAG) == RCC_FLAG_PLL3RDY) || ((FLAG) == RCC_FLAG_LSERDY) || \
  7411. ((FLAG) == RCC_FLAG_LSIRDY) || \
  7412. ((FLAG) == RCC_FLAG_CDRST) || ((FLAG) == RCC_FLAG_BORRST) || \
  7413. ((FLAG) == RCC_FLAG_PINRST) || ((FLAG) == RCC_FLAG_PORRST) || \
  7414. ((FLAG) == RCC_FLAG_SFTRST) || ((FLAG) == RCC_FLAG_IWDG1RST)|| \
  7415. ((FLAG) == RCC_FLAG_WWDG1RST) || ((FLAG) == RCC_FLAG_LPWR1RST)|| \
  7416. ((FLAG) == RCC_FLAG_LPWR2RST) || ((FLAG) == RCC_FLAG_HSIDIV ))
  7417. #endif /* RCC_CR_D2CKRDY */
  7418. #endif /*DUAL_CORE*/
  7419. #define IS_RCC_HSICALIBRATION_VALUE(VALUE) ((VALUE) <= 0x7FU)
  7420. #define IS_RCC_CSICALIBRATION_VALUE(VALUE) ((VALUE) <= 0x3FU)
  7421. #define IS_RCC_STOP_WAKEUPCLOCK(SOURCE) (((SOURCE) == RCC_STOP_WAKEUPCLOCK_CSI) || \
  7422. ((SOURCE) == RCC_STOP_WAKEUPCLOCK_HSI))
  7423. #define IS_RCC_STOP_KERWAKEUPCLOCK(SOURCE) (((SOURCE) == RCC_STOP_KERWAKEUPCLOCK_CSI) || \
  7424. ((SOURCE) == RCC_STOP_KERWAKEUPCLOCK_HSI))
  7425. /**
  7426. * @}
  7427. */
  7428. /**
  7429. * @}
  7430. */
  7431. /**
  7432. * @}
  7433. */
  7434. /**
  7435. * @}
  7436. */
  7437. #ifdef __cplusplus
  7438. }
  7439. #endif
  7440. #endif /* STM32H7xx_HAL_RCC_H */