1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886 |
- /**
- ******************************************************************************
- * @file stm32g0xx_ll_rcc.h
- * @author MCD Application Team
- * @brief Header file of RCC LL module.
- ******************************************************************************
- * @attention
- *
- * <h2><center>© Copyright (c) 2018 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under BSD 3-Clause license,
- * the "License"; You may not use this file except in compliance with the
- * License. You may obtain a copy of the License at:
- * opensource.org/licenses/BSD-3-Clause
- *
- ******************************************************************************
- */
- /* Define to prevent recursive inclusion -------------------------------------*/
- #ifndef STM32G0xx_LL_RCC_H
- #define STM32G0xx_LL_RCC_H
- #ifdef __cplusplus
- extern "C" {
- #endif
- /* Includes ------------------------------------------------------------------*/
- #include "stm32g0xx.h"
- /** @addtogroup STM32G0xx_LL_Driver
- * @{
- */
- #if defined(RCC)
- /** @defgroup RCC_LL RCC
- * @{
- */
- /* Private types -------------------------------------------------------------*/
- /* Private variables ---------------------------------------------------------*/
- /** @defgroup RCC_LL_Private_Variables RCC Private Variables
- * @{
- */
- /**
- * @}
- */
- /* Private constants ---------------------------------------------------------*/
- /* Private macros ------------------------------------------------------------*/
- #if defined(USE_FULL_LL_DRIVER)
- /** @defgroup RCC_LL_Private_Macros RCC Private Macros
- * @{
- */
- /**
- * @}
- */
- #endif /*USE_FULL_LL_DRIVER*/
- /* Exported types ------------------------------------------------------------*/
- #if defined(USE_FULL_LL_DRIVER)
- /** @defgroup RCC_LL_Exported_Types RCC Exported Types
- * @{
- */
- /** @defgroup LL_ES_CLOCK_FREQ Clocks Frequency Structure
- * @{
- */
- /**
- * @brief RCC Clocks Frequency Structure
- */
- typedef struct
- {
- uint32_t SYSCLK_Frequency; /*!< SYSCLK clock frequency */
- uint32_t HCLK_Frequency; /*!< HCLK clock frequency */
- uint32_t PCLK1_Frequency; /*!< PCLK1 clock frequency */
- } LL_RCC_ClocksTypeDef;
- /**
- * @}
- */
- /**
- * @}
- */
- #endif /* USE_FULL_LL_DRIVER */
- /* Exported constants --------------------------------------------------------*/
- /** @defgroup RCC_LL_Exported_Constants RCC Exported Constants
- * @{
- */
- /** @defgroup RCC_LL_EC_OSC_VALUES Oscillator Values adaptation
- * @brief Defines used to adapt values of different oscillators
- * @note These values could be modified in the user environment according to
- * HW set-up.
- * @{
- */
- #if !defined (HSE_VALUE)
- #define HSE_VALUE 8000000U /*!< Value of the HSE oscillator in Hz */
- #endif /* HSE_VALUE */
- #if !defined (HSI_VALUE)
- #define HSI_VALUE 16000000U /*!< Value of the HSI oscillator in Hz */
- #endif /* HSI_VALUE */
- #if !defined (LSE_VALUE)
- #define LSE_VALUE 32768U /*!< Value of the LSE oscillator in Hz */
- #endif /* LSE_VALUE */
- #if !defined (LSI_VALUE)
- #define LSI_VALUE 32000U /*!< Value of the LSI oscillator in Hz */
- #endif /* LSI_VALUE */
- #if !defined (EXTERNAL_CLOCK_VALUE)
- #define EXTERNAL_CLOCK_VALUE 48000000U /*!< Value of the I2S_CKIN external oscillator in Hz */
- #endif /* EXTERNAL_CLOCK_VALUE */
- #if defined(RCC_HSI48_SUPPORT)
- #if !defined (HSI48_VALUE)
- #define HSI48_VALUE 48000000U /*!< Value of the HSI48 oscillator in Hz */
- #endif /* HSI48_VALUE */
- #endif /* RCC_HSI48_SUPPORT */
- /**
- * @}
- */
- /** @defgroup RCC_LL_EC_CLEAR_FLAG Clear Flags Defines
- * @brief Flags defines which can be used with LL_RCC_WriteReg function
- * @{
- */
- #define LL_RCC_CICR_LSIRDYC RCC_CICR_LSIRDYC /*!< LSI Ready Interrupt Clear */
- #define LL_RCC_CICR_LSERDYC RCC_CICR_LSERDYC /*!< LSE Ready Interrupt Clear */
- #define LL_RCC_CICR_HSIRDYC RCC_CICR_HSIRDYC /*!< HSI Ready Interrupt Clear */
- #define LL_RCC_CICR_HSERDYC RCC_CICR_HSERDYC /*!< HSE Ready Interrupt Clear */
- #define LL_RCC_CICR_PLLRDYC RCC_CICR_PLLRDYC /*!< PLL Ready Interrupt Clear */
- #define LL_RCC_CICR_LSECSSC RCC_CICR_LSECSSC /*!< LSE Clock Security System Interrupt Clear */
- #define LL_RCC_CICR_CSSC RCC_CICR_CSSC /*!< Clock Security System Interrupt Clear */
- #if defined(RCC_HSI48_SUPPORT)
- #define LL_RCC_CICR_HSI48RDYC RCC_CICR_HSI48RDYC /*!< HSI48 Ready Interrupt Clear */
- #endif /* RCC_HSI48_SUPPORT */
- /**
- * @}
- */
- /** @defgroup RCC_LL_EC_GET_FLAG Get Flags Defines
- * @brief Flags defines which can be used with LL_RCC_ReadReg function
- * @{
- */
- #define LL_RCC_CIFR_LSIRDYF RCC_CIFR_LSIRDYF /*!< LSI Ready Interrupt flag */
- #define LL_RCC_CIFR_LSERDYF RCC_CIFR_LSERDYF /*!< LSE Ready Interrupt flag */
- #define LL_RCC_CIFR_HSIRDYF RCC_CIFR_HSIRDYF /*!< HSI Ready Interrupt flag */
- #if defined(RCC_HSI48_SUPPORT)
- #define LL_RCC_CIFR_HSI48RDYF RCC_CIFR_HSI48RDYF /*!< HSI48 Ready Interrupt flag */
- #endif /* RCC_HSI48_SUPPORT */
- #define LL_RCC_CIFR_HSERDYF RCC_CIFR_HSERDYF /*!< HSE Ready Interrupt flag */
- #define LL_RCC_CIFR_PLLRDYF RCC_CIFR_PLLRDYF /*!< PLL Ready Interrupt flag */
- #define LL_RCC_CIFR_LSECSSF RCC_CIFR_LSECSSF /*!< LSE Clock Security System Interrupt flag */
- #define LL_RCC_CIFR_CSSF RCC_CIFR_CSSF /*!< Clock Security System Interrupt flag */
- #define LL_RCC_CSR_LPWRRSTF RCC_CSR_LPWRRSTF /*!< Low-Power reset flag */
- #define LL_RCC_CSR_OBLRSTF RCC_CSR_OBLRSTF /*!< OBL reset flag */
- #define LL_RCC_CSR_PINRSTF RCC_CSR_PINRSTF /*!< PIN reset flag */
- #define LL_RCC_CSR_SFTRSTF RCC_CSR_SFTRSTF /*!< Software Reset flag */
- #define LL_RCC_CSR_IWDGRSTF RCC_CSR_IWDGRSTF /*!< Independent Watchdog reset flag */
- #define LL_RCC_CSR_WWDGRSTF RCC_CSR_WWDGRSTF /*!< Window watchdog reset flag */
- #define LL_RCC_CSR_PWRRSTF RCC_CSR_PWRRSTF /*!< BOR or POR/PDR reset flag */
- /**
- * @}
- */
- /** @defgroup RCC_LL_EC_IT IT Defines
- * @brief IT defines which can be used with LL_RCC_ReadReg and LL_RCC_WriteReg functions
- * @{
- */
- #define LL_RCC_CIER_LSIRDYIE RCC_CIER_LSIRDYIE /*!< LSI Ready Interrupt Enable */
- #define LL_RCC_CIER_LSERDYIE RCC_CIER_LSERDYIE /*!< LSE Ready Interrupt Enable */
- #define LL_RCC_CIER_HSIRDYIE RCC_CIER_HSIRDYIE /*!< HSI Ready Interrupt Enable */
- #define LL_RCC_CIER_HSERDYIE RCC_CIER_HSERDYIE /*!< HSE Ready Interrupt Enable */
- #define LL_RCC_CIER_PLLRDYIE RCC_CIER_PLLRDYIE /*!< PLL Ready Interrupt Enable */
- #if defined(RCC_HSI48_SUPPORT)
- #define LL_RCC_CIER_HSI48RDYIE RCC_CIER_HSI48RDYIE /*!< HSI48 Ready Interrupt Enable */
- #endif /* RCC_HSI48_SUPPORT */
- /**
- * @}
- */
- /** @defgroup RCC_LL_EC_LSEDRIVE LSE oscillator drive capability
- * @{
- */
- #define LL_RCC_LSEDRIVE_LOW 0x00000000U /*!< Xtal mode lower driving capability */
- #define LL_RCC_LSEDRIVE_MEDIUMLOW RCC_BDCR_LSEDRV_0 /*!< Xtal mode medium low driving capability */
- #define LL_RCC_LSEDRIVE_MEDIUMHIGH RCC_BDCR_LSEDRV_1 /*!< Xtal mode medium high driving capability */
- #define LL_RCC_LSEDRIVE_HIGH RCC_BDCR_LSEDRV /*!< Xtal mode higher driving capability */
- /**
- * @}
- */
- /** @defgroup RCC_LL_EC_LSCO_CLKSOURCE LSCO Selection
- * @{
- */
- #define LL_RCC_LSCO_CLKSOURCE_LSI 0x00000000U /*!< LSI selection for low speed clock */
- #define LL_RCC_LSCO_CLKSOURCE_LSE RCC_BDCR_LSCOSEL /*!< LSE selection for low speed clock */
- /**
- * @}
- */
- /** @defgroup RCC_LL_EC_SYS_CLKSOURCE System clock switch
- * @{
- */
- #define LL_RCC_SYS_CLKSOURCE_HSI 0x00000000U /*!< HSI selection as system clock */
- #define LL_RCC_SYS_CLKSOURCE_HSE RCC_CFGR_SW_0 /*!< HSE selection as system clock */
- #define LL_RCC_SYS_CLKSOURCE_PLL RCC_CFGR_SW_1 /*!< PLL selection as system clock */
- #define LL_RCC_SYS_CLKSOURCE_LSI (RCC_CFGR_SW_1 | RCC_CFGR_SW_0) /*!< LSI selection used as system clock */
- #define LL_RCC_SYS_CLKSOURCE_LSE RCC_CFGR_SW_2 /*!< LSE selection used as system clock */
- /**
- * @}
- */
- /** @defgroup RCC_LL_EC_SYS_CLKSOURCE_STATUS System clock switch status
- * @{
- */
- #define LL_RCC_SYS_CLKSOURCE_STATUS_HSI 0x00000000U /*!< HSI used as system clock */
- #define LL_RCC_SYS_CLKSOURCE_STATUS_HSE RCC_CFGR_SWS_0 /*!< HSE used as system clock */
- #define LL_RCC_SYS_CLKSOURCE_STATUS_PLL RCC_CFGR_SWS_1 /*!< PLL used as system clock */
- #define LL_RCC_SYS_CLKSOURCE_STATUS_LSI (RCC_CFGR_SWS_1 | RCC_CFGR_SWS_0) /*!< LSI used as system clock */
- #define LL_RCC_SYS_CLKSOURCE_STATUS_LSE RCC_CFGR_SWS_2 /*!< LSE used as system clock */
- /**
- * @}
- */
- /** @defgroup RCC_LL_EC_SYSCLK_DIV AHB prescaler
- * @{
- */
- #define LL_RCC_SYSCLK_DIV_1 0x00000000U /*!< SYSCLK not divided */
- #define LL_RCC_SYSCLK_DIV_2 RCC_CFGR_HPRE_3 /*!< SYSCLK divided by 2 */
- #define LL_RCC_SYSCLK_DIV_4 (RCC_CFGR_HPRE_3 | RCC_CFGR_HPRE_0) /*!< SYSCLK divided by 4 */
- #define LL_RCC_SYSCLK_DIV_8 (RCC_CFGR_HPRE_3 | RCC_CFGR_HPRE_1) /*!< SYSCLK divided by 8 */
- #define LL_RCC_SYSCLK_DIV_16 (RCC_CFGR_HPRE_3 | RCC_CFGR_HPRE_1 | RCC_CFGR_HPRE_0) /*!< SYSCLK divided by 16 */
- #define LL_RCC_SYSCLK_DIV_64 (RCC_CFGR_HPRE_3 | RCC_CFGR_HPRE_2) /*!< SYSCLK divided by 64 */
- #define LL_RCC_SYSCLK_DIV_128 (RCC_CFGR_HPRE_3 | RCC_CFGR_HPRE_2 | RCC_CFGR_HPRE_0) /*!< SYSCLK divided by 128 */
- #define LL_RCC_SYSCLK_DIV_256 (RCC_CFGR_HPRE_3 | RCC_CFGR_HPRE_2 | RCC_CFGR_HPRE_1) /*!< SYSCLK divided by 256 */
- #define LL_RCC_SYSCLK_DIV_512 (RCC_CFGR_HPRE_3 | RCC_CFGR_HPRE_2 | RCC_CFGR_HPRE_1 | RCC_CFGR_HPRE_0) /*!< SYSCLK divided by 512 */
- /**
- * @}
- */
- /** @defgroup RCC_LL_EC_APB1_DIV APB low-speed prescaler (APB1)
- * @{
- */
- #define LL_RCC_APB1_DIV_1 0x00000000U /*!< HCLK not divided */
- #define LL_RCC_APB1_DIV_2 RCC_CFGR_PPRE_2 /*!< HCLK divided by 2 */
- #define LL_RCC_APB1_DIV_4 (RCC_CFGR_PPRE_2 | RCC_CFGR_PPRE_0) /*!< HCLK divided by 4 */
- #define LL_RCC_APB1_DIV_8 (RCC_CFGR_PPRE_2 | RCC_CFGR_PPRE_1) /*!< HCLK divided by 8 */
- #define LL_RCC_APB1_DIV_16 (RCC_CFGR_PPRE_2 | RCC_CFGR_PPRE_1 | RCC_CFGR_PPRE_0) /*!< HCLK divided by 16 */
- /**
- * @}
- */
- /** @defgroup RCC_LL_EC_HSI_DIV HSI division factor
- * @{
- */
- #define LL_RCC_HSI_DIV_1 0x00000000U /*!< HSI not divided */
- #define LL_RCC_HSI_DIV_2 RCC_CR_HSIDIV_0 /*!< HSI divided by 2 */
- #define LL_RCC_HSI_DIV_4 RCC_CR_HSIDIV_1 /*!< HSI divided by 4 */
- #define LL_RCC_HSI_DIV_8 (RCC_CR_HSIDIV_1 | RCC_CR_HSIDIV_0) /*!< HSI divided by 8 */
- #define LL_RCC_HSI_DIV_16 RCC_CR_HSIDIV_2 /*!< HSI divided by 16 */
- #define LL_RCC_HSI_DIV_32 (RCC_CR_HSIDIV_2 | RCC_CR_HSIDIV_0) /*!< HSI divided by 32 */
- #define LL_RCC_HSI_DIV_64 (RCC_CR_HSIDIV_2 | RCC_CR_HSIDIV_1) /*!< HSI divided by 64 */
- #define LL_RCC_HSI_DIV_128 RCC_CR_HSIDIV /*!< HSI divided by 128 */
- /**
- * @}
- */
- /** @defgroup RCC_LL_EC_MCO1SOURCE MCO1 SOURCE selection
- * @{
- */
- #define LL_RCC_MCO1SOURCE_NOCLOCK 0x00000000U /*!< MCO output disabled, no clock on MCO */
- #define LL_RCC_MCO1SOURCE_SYSCLK RCC_CFGR_MCOSEL_0 /*!< SYSCLK selection as MCO1 source */
- #if defined(RCC_HSI48_SUPPORT)
- #define LL_RCC_MCO1SOURCE_HSI48 RCC_CFGR_MCOSEL_1 /*!< HSI48 selection as MCO1 source */
- #endif /* RCC_HSI48_SUPPORT */
- #define LL_RCC_MCO1SOURCE_HSI (RCC_CFGR_MCOSEL_0| RCC_CFGR_MCOSEL_1) /*!< HSI16 selection as MCO1 source */
- #define LL_RCC_MCO1SOURCE_HSE RCC_CFGR_MCOSEL_2 /*!< HSE selection as MCO1 source */
- #define LL_RCC_MCO1SOURCE_PLLCLK (RCC_CFGR_MCOSEL_0|RCC_CFGR_MCOSEL_2) /*!< Main PLL selection as MCO1 source */
- #define LL_RCC_MCO1SOURCE_LSI (RCC_CFGR_MCOSEL_1|RCC_CFGR_MCOSEL_2) /*!< LSI selection as MCO1 source */
- #define LL_RCC_MCO1SOURCE_LSE (RCC_CFGR_MCOSEL_0|RCC_CFGR_MCOSEL_1|RCC_CFGR_MCOSEL_2) /*!< LSE selection as MCO1 source */
- #if defined(RCC_CFGR_MCOSEL_3)
- #define LL_RCC_MCO1SOURCE_PLLPCLK RCC_CFGR_MCOSEL_3 /*!< PLLPCLK selection as MCO1 source */
- #define LL_RCC_MCO1SOURCE_PLLQCLK (RCC_CFGR_MCOSEL_3|RCC_CFGR_MCOSEL_0) /*!< PLLQCLK selection as MCO1 source */
- #define LL_RCC_MCO1SOURCE_RTCCLK (RCC_CFGR_MCOSEL_3|RCC_CFGR_MCOSEL_1) /*!< RTCCLK selection as MCO1 source */
- #define LL_RCC_MCO1SOURCE_RTC_WKUP (RCC_CFGR_MCOSEL_3|RCC_CFGR_MCOSEL_1|RCC_CFGR_MCOSEL_0) /*!< RTC_Wakeup selection as MCO1 source */
- #endif /* RCC_CFGR_MCOSEL_3 */
- /**
- * @}
- */
- /** @defgroup RCC_LL_EC_MCO1_DIV MCO1 prescaler
- * @{
- */
- #define LL_RCC_MCO1_DIV_1 0x00000000U /*!< MCO1 not divided */
- #define LL_RCC_MCO1_DIV_2 RCC_CFGR_MCOPRE_0 /*!< MCO1 divided by 2 */
- #define LL_RCC_MCO1_DIV_4 RCC_CFGR_MCOPRE_1 /*!< MCO1 divided by 4 */
- #define LL_RCC_MCO1_DIV_8 (RCC_CFGR_MCOPRE_1 | RCC_CFGR_MCOPRE_0) /*!< MCO1 divided by 8 */
- #define LL_RCC_MCO1_DIV_16 RCC_CFGR_MCOPRE_2 /*!< MCO1 divided by 16 */
- #define LL_RCC_MCO1_DIV_32 (RCC_CFGR_MCOPRE_2 | RCC_CFGR_MCOPRE_0) /*!< MCO1 divided by 32 */
- #define LL_RCC_MCO1_DIV_64 (RCC_CFGR_MCOPRE_2 | RCC_CFGR_MCOPRE_1) /*!< MCO1 divided by 64 */
- #define LL_RCC_MCO1_DIV_128 (RCC_CFGR_MCOPRE_2 | RCC_CFGR_MCOPRE_1 | RCC_CFGR_MCOPRE_0) /*!< MCO1 divided by 128 */
- #if defined(RCC_CFGR_MCOPRE_3)
- #define LL_RCC_MCO1_DIV_256 RCC_CFGR_MCOPRE_3 /*!< MCO divided by 256 */
- #define LL_RCC_MCO1_DIV_512 (RCC_CFGR_MCOPRE_3 | RCC_CFGR_MCOPRE_0) /*!< MCO divided by 512 */
- #define LL_RCC_MCO1_DIV_1024 (RCC_CFGR_MCOPRE_3 | RCC_CFGR_MCOPRE_1) /*!< MCO divided by 1024 */
- #endif /* RCC_CFGR_MCOPRE_3 */
- /**
- * @}
- */
- #if defined(RCC_MCO2_SUPPORT)
- /** @defgroup RCC_LL_EC_MCO2SOURCE MCO2 SOURCE selection
- * @{
- */
- #define LL_RCC_MCO2SOURCE_NOCLOCK 0x00000000U /*!< MCO output disabled, no clock on MCO */
- #define LL_RCC_MCO2SOURCE_SYSCLK RCC_CFGR_MCO2SEL_0 /*!< SYSCLK selection as MCO2 source */
- #if defined(RCC_HSI48_SUPPORT)
- #define LL_RCC_MCO2SOURCE_HSI48 RCC_CFGR_MCO2SEL_1 /*!< HSI48 selection as MCO2 source */
- #endif /* RCC_HSI48_SUPPORT */
- #define LL_RCC_MCO2SOURCE_HSI (RCC_CFGR_MCO2SEL_1 | RCC_CFGR_MCO2SEL_0) /*!< HSI16 selection as MCO2 source */
- #define LL_RCC_MCO2SOURCE_HSE RCC_CFGR_MCO2SEL_2 /*!< HSE selection as MCO2 source */
- #define LL_RCC_MCO2SOURCE_PLLCLK (RCC_CFGR_MCO2SEL_2 | RCC_CFGR_MCO2SEL_0) /*!< Main PLL "R" clock selection as MCO2 source */
- #define LL_RCC_MCO2SOURCE_LSI (RCC_CFGR_MCO2SEL_2 | RCC_CFGR_MCO2SEL_1) /*!< LSI selection as MCO2 source */
- #define LL_RCC_MCO2SOURCE_LSE (RCC_CFGR_MCO2SEL_2 | RCC_CFGR_MCO2SEL_1 | RCC_CFGR_MCO2SEL_0) /*!< LSE selection as MCO2 source */
- #define LL_RCC_MCO2SOURCE_PLLPCLK RCC_CFGR_MCO2SEL_3 /*!< PLL "P" clock selection as MCO2 source */
- #define LL_RCC_MCO2SOURCE_PLLQCLK (RCC_CFGR_MCO2SEL_3 | RCC_CFGR_MCO2SEL_0) /*!< PLL "Q" clock selection as MCO2 source */
- #define LL_RCC_MCO2SOURCE_RTCCLK (RCC_CFGR_MCO2SEL_3 | RCC_CFGR_MCO2SEL_1) /*!< RTC Clock selection as MCO2 source */
- #define LL_RCC_MCO2SOURCE_RTC_WKUP (RCC_CFGR_MCO2SEL_3 | RCC_CFGR_MCO2SEL_1 | RCC_CFGR_MCO2SEL_0) /*!< RTC Wakeup timer selection as MCO2 source */
- /**
- * @}
- */
- /** @defgroup RCC_LL_EC_MCO2_DIV MCO2 prescaler
- * @{
- */
- #define LL_RCC_MCO2_DIV_1 0x00000000U /*!< MCO2 not divided */
- #define LL_RCC_MCO2_DIV_2 RCC_CFGR_MCO2PRE_0 /*!< MCO2 divided by 2 */
- #define LL_RCC_MCO2_DIV_4 RCC_CFGR_MCO2PRE_1 /*!< MCO2 divided by 4 */
- #define LL_RCC_MCO2_DIV_8 (RCC_CFGR_MCO2PRE_1 | RCC_CFGR_MCO2PRE_0) /*!< MCO2 divided by 8 */
- #define LL_RCC_MCO2_DIV_16 RCC_CFGR_MCO2PRE_2 /*!< MCO2 divided by 16 */
- #define LL_RCC_MCO2_DIV_32 (RCC_CFGR_MCO2PRE_2 | RCC_CFGR_MCO2PRE_0) /*!< MCO2 divided by 32 */
- #define LL_RCC_MCO2_DIV_64 (RCC_CFGR_MCO2PRE_2 | RCC_CFGR_MCO2PRE_1) /*!< MCO2 divided by 64 */
- #define LL_RCC_MCO2_DIV_128 (RCC_CFGR_MCO2PRE_2 | RCC_CFGR_MCO2PRE_1 | RCC_CFGR_MCO2PRE_0) /*!< MCO2 divided by 128 */
- #define LL_RCC_MCO2_DIV_256 RCC_CFGR_MCO2PRE_3 /*!< MCO2 divided by 256 */
- #define LL_RCC_MCO2_DIV_512 (RCC_CFGR_MCO2PRE_3 | RCC_CFGR_MCO2PRE_0) /*!< MCO2 divided by 512 */
- #define LL_RCC_MCO2_DIV_1024 (RCC_CFGR_MCO2PRE_3 | RCC_CFGR_MCO2PRE_1) /*!< MCO2 divided by 1024 */
- /**
- * @}
- */
- #endif /* RCC_MCO2_SUPPORT */
- #if defined(USE_FULL_LL_DRIVER)
- /** @defgroup RCC_LL_EC_PERIPH_FREQUENCY Peripheral clock frequency
- * @{
- */
- #define LL_RCC_PERIPH_FREQUENCY_NO 0x00000000U /*!< No clock enabled for the peripheral */
- #define LL_RCC_PERIPH_FREQUENCY_NA 0xFFFFFFFFU /*!< Frequency cannot be provided as external clock */
- /**
- * @}
- */
- #endif /* USE_FULL_LL_DRIVER */
- /** @defgroup RCC_LL_EC_USARTx_CLKSOURCE Peripheral USART clock source selection
- * @{
- */
- #define LL_RCC_USART1_CLKSOURCE_PCLK1 ((RCC_CCIPR_USART1SEL << 16U) | 0x00000000U) /*!< PCLK1 clock used as USART1 clock source */
- #define LL_RCC_USART1_CLKSOURCE_SYSCLK ((RCC_CCIPR_USART1SEL << 16U) | RCC_CCIPR_USART1SEL_0) /*!< SYSCLK clock used as USART1 clock source */
- #define LL_RCC_USART1_CLKSOURCE_HSI ((RCC_CCIPR_USART1SEL << 16U) | RCC_CCIPR_USART1SEL_1) /*!< HSI clock used as USART1 clock source */
- #define LL_RCC_USART1_CLKSOURCE_LSE ((RCC_CCIPR_USART1SEL << 16U) | RCC_CCIPR_USART1SEL) /*!< LSE clock used as USART1 clock source */
- #define LL_RCC_USART2_CLKSOURCE_PCLK1 ((RCC_CCIPR_USART2SEL << 16U) | 0x00000000U) /*!< PCLK1 clock used as USART2 clock source */
- #define LL_RCC_USART2_CLKSOURCE_SYSCLK ((RCC_CCIPR_USART2SEL << 16U) | RCC_CCIPR_USART2SEL_0) /*!< SYSCLK clock used as USART2 clock source */
- #define LL_RCC_USART2_CLKSOURCE_HSI ((RCC_CCIPR_USART2SEL << 16U) | RCC_CCIPR_USART2SEL_1) /*!< HSI clock used as USART2 clock source */
- #define LL_RCC_USART2_CLKSOURCE_LSE ((RCC_CCIPR_USART2SEL << 16U) | RCC_CCIPR_USART2SEL) /*!< LSE clock used as USART2 clock source */
- #if defined(RCC_CCIPR_USART3SEL)
- #define LL_RCC_USART3_CLKSOURCE_PCLK1 ((RCC_CCIPR_USART3SEL << 16U) | 0x00000000U) /*!< PCLK1 clock used as USART3 clock source */
- #define LL_RCC_USART3_CLKSOURCE_SYSCLK ((RCC_CCIPR_USART3SEL << 16U) | RCC_CCIPR_USART3SEL_0) /*!< SYSCLK clock used as USART3 clock source */
- #define LL_RCC_USART3_CLKSOURCE_HSI ((RCC_CCIPR_USART3SEL << 16U) | RCC_CCIPR_USART3SEL_1) /*!< HSI clock used as USART3 clock source */
- #define LL_RCC_USART3_CLKSOURCE_LSE ((RCC_CCIPR_USART3SEL << 16U) | RCC_CCIPR_USART3SEL) /*!< LSE clock used as USART3 clock source */
- #endif /* RCC_CCIPR_USART3SEL */
- /**
- * @}
- */
- #if defined(LPUART1) || defined(LPUART2)
- /** @defgroup RCC_LL_EC_LPUARTx_CLKSOURCE Peripheral LPUART clock source selection
- * @{
- */
- #if defined(LPUART2)
- #define LL_RCC_LPUART2_CLKSOURCE_PCLK1 ((RCC_CCIPR_LPUART2SEL << 16U) | 0x00000000U) /*!< PCLK1 clock used as LPUART2 clock source */
- #define LL_RCC_LPUART2_CLKSOURCE_SYSCLK ((RCC_CCIPR_LPUART2SEL << 16U) | RCC_CCIPR_LPUART2SEL_0) /*!< SYSCLK clock used as LPUART2 clock source */
- #define LL_RCC_LPUART2_CLKSOURCE_HSI ((RCC_CCIPR_LPUART2SEL << 16U) | RCC_CCIPR_LPUART2SEL_1) /*!< HSI clock used as LPUART2 clock source */
- #define LL_RCC_LPUART2_CLKSOURCE_LSE ((RCC_CCIPR_LPUART2SEL << 16U) | RCC_CCIPR_LPUART2SEL) /*!< LSE clock used as LPUART2 clock source */
- #endif /* LPUART2 */
- #define LL_RCC_LPUART1_CLKSOURCE_PCLK1 ((RCC_CCIPR_LPUART1SEL << 16U) | 0x00000000U) /*!< PCLK1 clock used as LPUART1 clock source */
- #define LL_RCC_LPUART1_CLKSOURCE_SYSCLK ((RCC_CCIPR_LPUART1SEL << 16U) | RCC_CCIPR_LPUART1SEL_0) /*!< SYSCLK clock used as LPUART1 clock source */
- #define LL_RCC_LPUART1_CLKSOURCE_HSI ((RCC_CCIPR_LPUART1SEL << 16U) | RCC_CCIPR_LPUART1SEL_1) /*!< HSI clock used as LPUART1 clock source */
- #define LL_RCC_LPUART1_CLKSOURCE_LSE ((RCC_CCIPR_LPUART1SEL << 16U) | RCC_CCIPR_LPUART1SEL) /*!< LSE clock used as LPUART1 clock source */
- /**
- * @}
- */
- #endif /* LPUART1 || LPUART2 */
- /** @defgroup RCC_LL_EC_I2Cx_CLKSOURCE Peripheral I2C clock source selection
- * @{
- */
- #define LL_RCC_I2C1_CLKSOURCE_PCLK1 ((RCC_CCIPR_I2C1SEL << 16U) | 0x00000000U) /*!< PCLK1 clock used as I2C1 clock source */
- #define LL_RCC_I2C1_CLKSOURCE_SYSCLK ((RCC_CCIPR_I2C1SEL << 16U) | RCC_CCIPR_I2C1SEL_0) /*!< SYSCLK clock used as I2C1 clock source */
- #define LL_RCC_I2C1_CLKSOURCE_HSI ((RCC_CCIPR_I2C1SEL << 16U) | RCC_CCIPR_I2C1SEL_1) /*!< HSI clock used as I2C1 clock source */
- #if defined(RCC_CCIPR_I2C2SEL)
- #define LL_RCC_I2C2_CLKSOURCE_PCLK1 ((RCC_CCIPR_I2C2SEL << 16U) | 0x00000000U) /*!< PCLK1 clock used as I2C2 clock source */
- #define LL_RCC_I2C2_CLKSOURCE_SYSCLK ((RCC_CCIPR_I2C2SEL << 16U) | RCC_CCIPR_I2C2SEL_0) /*!< SYSCLK clock used as I2C2 clock source */
- #define LL_RCC_I2C2_CLKSOURCE_HSI ((RCC_CCIPR_I2C2SEL << 16U) | RCC_CCIPR_I2C2SEL_1) /*!< HSI clock used as I2C2 clock source */
- #endif /* RCC_CCIPR_I2C2SEL */
- /**
- * @}
- */
- /** @defgroup RCC_LL_EC_I2Sx_CLKSOURCE Peripheral I2S clock source selection
- * @{
- */
- #if defined(STM32G0C1xx) || defined(STM32G0B1xx) || defined(STM32G0B0xx)
- #define LL_RCC_I2S1_CLKSOURCE_SYSCLK ((RCC_CCIPR2_I2S1SEL << 16U) | 0x00000000U) /*!< SYSCLK clock used as I2S1 clock source */
- #define LL_RCC_I2S1_CLKSOURCE_PLL ((RCC_CCIPR2_I2S1SEL << 16U) | RCC_CCIPR2_I2S1SEL_0) /*!< PLL clock used as I2S1 clock source */
- #define LL_RCC_I2S1_CLKSOURCE_HSI ((RCC_CCIPR2_I2S1SEL << 16U) | RCC_CCIPR2_I2S1SEL_1) /*!< HSI clock used as I2S1 clock source */
- #define LL_RCC_I2S1_CLKSOURCE_PIN ((RCC_CCIPR2_I2S1SEL << 16U) | RCC_CCIPR2_I2S1SEL) /*!< External clock used as I2S1 clock source */
- #define LL_RCC_I2S2_CLKSOURCE_SYSCLK ((RCC_CCIPR2_I2S2SEL << 16U) | 0x00000000U) /*!< SYSCLK clock used as I2S2 clock source */
- #define LL_RCC_I2S2_CLKSOURCE_PLL ((RCC_CCIPR2_I2S2SEL << 16U) | RCC_CCIPR2_I2S2SEL_0) /*!< PLL clock used as I2S2 clock source */
- #define LL_RCC_I2S2_CLKSOURCE_HSI ((RCC_CCIPR2_I2S2SEL << 16U) | RCC_CCIPR2_I2S2SEL_1) /*!< HSI clock used as I2S2 clock source */
- #define LL_RCC_I2S2_CLKSOURCE_PIN ((RCC_CCIPR2_I2S2SEL << 16U) | RCC_CCIPR2_I2S2SEL) /*!< External clock used as I2S2 clock source */
- #else
- #define LL_RCC_I2S1_CLKSOURCE_SYSCLK 0x00000000U /*!< SYSCLK clock used as I2S1 clock source */
- #define LL_RCC_I2S1_CLKSOURCE_PLL RCC_CCIPR_I2S1SEL_0 /*!< PLL clock used as I2S1 clock source */
- #define LL_RCC_I2S1_CLKSOURCE_HSI RCC_CCIPR_I2S1SEL_1 /*!< HSI clock used as I2S1 clock source */
- #define LL_RCC_I2S1_CLKSOURCE_PIN RCC_CCIPR_I2S1SEL /*!< External clock used as I2S1 clock source */
- #endif /* STM32G0C1xx || STM32G0B1xx || STM32G0B0xx */
- /**
- * @}
- */
- #if defined(RCC_CCIPR_TIM1SEL)
- /** @defgroup RCC_LL_EC_TIMx_CLKSOURCE Peripheral TIM clock source selection
- * @{
- */
- #define LL_RCC_TIM1_CLKSOURCE_PCLK1 (RCC_CCIPR_TIM1SEL | (0x00000000U >> 16U)) /*!< PCLK1 clock used as TIM1 clock source */
- #define LL_RCC_TIM1_CLKSOURCE_PLL (RCC_CCIPR_TIM1SEL | (RCC_CCIPR_TIM1SEL >> 16U)) /*!< PLL used as TIM1 clock source */
- /**
- * @}
- */
- #endif /* RCC_CCIPR_TIM1SEL */
- #if defined(RCC_CCIPR_TIM15SEL)
- /** @addtogroup RCC_LL_EC_TIMx_CLKSOURCE
- * @{
- */
- #define LL_RCC_TIM15_CLKSOURCE_PCLK1 (RCC_CCIPR_TIM15SEL | (0x00000000U >> 16U)) /*!< PCLK1 clock used as TIM15 clock source */
- #define LL_RCC_TIM15_CLKSOURCE_PLL (RCC_CCIPR_TIM15SEL | (RCC_CCIPR_TIM15SEL >> 16U)) /*!< PLL used as TIM15 clock source */
- /**
- * @}
- */
- #endif /* RCC_CCIPR_TIM15SEL */
- #if defined(LPTIM1) && defined(LPTIM2)
- /** @defgroup RCC_LL_EC_LPTIMx_CLKSOURCE Peripheral LPTIM clock source selection
- * @{
- */
- #define LL_RCC_LPTIM1_CLKSOURCE_PCLK1 (RCC_CCIPR_LPTIM1SEL | (0x00000000U >> 16U)) /*!< PCLK1 selected as LPTIM1 clock */
- #define LL_RCC_LPTIM1_CLKSOURCE_LSI (RCC_CCIPR_LPTIM1SEL | (RCC_CCIPR_LPTIM1SEL_0 >> 16U)) /*!< LSI selected as LPTIM1 clock */
- #define LL_RCC_LPTIM1_CLKSOURCE_HSI (RCC_CCIPR_LPTIM1SEL | (RCC_CCIPR_LPTIM1SEL_1 >> 16U)) /*!< HSI selected as LPTIM1 clock */
- #define LL_RCC_LPTIM1_CLKSOURCE_LSE (RCC_CCIPR_LPTIM1SEL | (RCC_CCIPR_LPTIM1SEL >> 16U)) /*!< LSE selected as LPTIM1 clock */
- #define LL_RCC_LPTIM2_CLKSOURCE_PCLK1 (RCC_CCIPR_LPTIM2SEL | (0x00000000U >> 16U)) /*!< PCLK1 selected as LPTIM2 clock */
- #define LL_RCC_LPTIM2_CLKSOURCE_LSI (RCC_CCIPR_LPTIM2SEL | (RCC_CCIPR_LPTIM2SEL_0 >> 16U)) /*!< LSI selected as LPTIM2 clock */
- #define LL_RCC_LPTIM2_CLKSOURCE_HSI (RCC_CCIPR_LPTIM2SEL | (RCC_CCIPR_LPTIM2SEL_1 >> 16U)) /*!< HSI selected as LPTIM2 clock */
- #define LL_RCC_LPTIM2_CLKSOURCE_LSE (RCC_CCIPR_LPTIM2SEL | (RCC_CCIPR_LPTIM2SEL >> 16U)) /*!< LSE selected as LPTIM2 clock */
- /**
- * @}
- */
- #endif /* LPTIM1 && LPTIM2*/
- #if defined(CEC)
- /** @defgroup RCC_LL_EC_CEC_CLKSOURCE_HSI Peripheral CEC clock source selection
- * @{
- */
- #define LL_RCC_CEC_CLKSOURCE_HSI_DIV488 0x00000000U /*!< HSI oscillator clock divided by 488 used as CEC clock */
- #define LL_RCC_CEC_CLKSOURCE_LSE RCC_CCIPR_CECSEL /*!< LSE oscillator clock used as CEC clock */
- /**
- * @}
- */
- #endif /* CEC */
- #if defined(FDCAN1) || defined(FDCAN2)
- /** @defgroup RCC_LL_EC_FDCAN_CLKSOURCE_HSI Peripheral FDCAN clock source selection
- * @{
- */
- #define LL_RCC_FDCAN_CLKSOURCE_PCLK1 0x00000000U /*!< PCLK1 oscillator clock used as FDCAN clock */
- #define LL_RCC_FDCAN_CLKSOURCE_PLL RCC_CCIPR2_FDCANSEL_0 /*!< PLL "Q" oscillator clock used as FDCAN clock */
- #define LL_RCC_FDCAN_CLKSOURCE_HSE RCC_CCIPR2_FDCANSEL_1 /*!< HSE oscillator clock used as FDCAN clock */
- /**
- * @}
- */
- #endif /* FDCAN1 || FDCAN2 */
- #if defined(RNG)
- /** @defgroup RCC_LL_EC_RNG_CLKSOURCE Peripheral RNG clock source selection
- * @{
- */
- #define LL_RCC_RNG_CLKSOURCE_NONE 0x00000000U /*!< No clock used as RNG clock */
- #define LL_RCC_RNG_CLKSOURCE_HSI_DIV8 RCC_CCIPR_RNGSEL_0 /*!< HSI oscillator clock divided by 8 used as RNG clock, available on cut2.0 */
- #define LL_RCC_RNG_CLKSOURCE_SYSCLK RCC_CCIPR_RNGSEL_1 /*!< SYSCLK divided by 1 used as RNG clock */
- #define LL_RCC_RNG_CLKSOURCE_PLL RCC_CCIPR_RNGSEL /*!< PLL used as RNG clock */
- /**
- * @}
- */
- #endif /* RNG */
- #if defined(RNG)
- /** @defgroup RCC_LL_EC_RNG_CLK_DIV Peripheral RNG clock division factor
- * @{
- */
- #define LL_RCC_RNG_CLK_DIV1 0x00000000U /*!< RNG clock not divided */
- #define LL_RCC_RNG_CLK_DIV2 RCC_CCIPR_RNGDIV_0 /*!< RNG clock divided by 2 */
- #define LL_RCC_RNG_CLK_DIV4 RCC_CCIPR_RNGDIV_1 /*!< RNG clock divided by 4 */
- #define LL_RCC_RNG_CLK_DIV8 RCC_CCIPR_RNGDIV /*!< RNG clock divided by 8 */
- /**
- * @}
- */
- #endif /* RNG */
- #if defined(STM32G0C1xx) || defined(STM32G0B1xx) || defined(STM32G0B0xx)
- /** @defgroup RCC_LL_EC_USB_CLKSOURCE Peripheral USB clock source selection
- * @{
- */
- #if defined(RCC_HSI48_SUPPORT)
- #define LL_RCC_USB_CLKSOURCE_HSI48 0x00000000U /*!< HSI48 clock used as USB clock source */
- #endif /* RCC_HSI48_SUPPORT */
- #define LL_RCC_USB_CLKSOURCE_HSE RCC_CCIPR2_USBSEL_0 /*!< PLL clock used as USB clock source */
- #define LL_RCC_USB_CLKSOURCE_PLL RCC_CCIPR2_USBSEL_1 /*!< PLL clock used as USB clock source */
- /**
- * @}
- */
- #endif /* STM32G0C1xx || STM32G0B1xx || STM32G0B0xx */
- /** @defgroup RCC_LL_EC_ADC_CLKSOURCE Peripheral ADC clock source selection
- * @{
- */
- #define LL_RCC_ADC_CLKSOURCE_SYSCLK 0x00000000U /*!< SYSCLK used as ADC clock */
- #define LL_RCC_ADC_CLKSOURCE_PLL RCC_CCIPR_ADCSEL_0 /*!< PLL used as ADC clock */
- #define LL_RCC_ADC_CLKSOURCE_HSI RCC_CCIPR_ADCSEL_1 /*!< HSI used as ADC clock */
- /**
- * @}
- */
- /** @defgroup RCC_LL_EC_USARTx Peripheral USARTx get clock source
- * @{
- */
- #define LL_RCC_USART1_CLKSOURCE RCC_CCIPR_USART1SEL /*!< USART1 Clock source selection */
- #define LL_RCC_USART2_CLKSOURCE RCC_CCIPR_USART2SEL /*!< USART2 Clock source selection */
- #if defined(RCC_CCIPR_USART3SEL)
- #define LL_RCC_USART3_CLKSOURCE RCC_CCIPR_USART3SEL /*!< USART3 Clock source selection */
- #endif /* RCC_CCIPR_USART3SEL */
- /**
- * @}
- */
- #if defined(LPUART1)
- /** @defgroup RCC_LL_EC_LPUART1 Peripheral LPUART get clock source
- * @{
- */
- #define LL_RCC_LPUART1_CLKSOURCE RCC_CCIPR_LPUART1SEL /*!< LPUART1 Clock source selection */
- #if defined(LPUART2)
- #define LL_RCC_LPUART2_CLKSOURCE RCC_CCIPR_LPUART2SEL /*!< LPUART2 Clock source selection */
- #endif /* LPUART2 */
- /**
- * @}
- */
- #endif /* LPUART1 */
- /** @defgroup RCC_LL_EC_I2C1 Peripheral I2C get clock source
- * @{
- */
- #define LL_RCC_I2C1_CLKSOURCE RCC_CCIPR_I2C1SEL /*!< I2C1 Clock source selection */
- #if defined(RCC_CCIPR_I2C2SEL)
- #define LL_RCC_I2C2_CLKSOURCE RCC_CCIPR_I2C2SEL /*!< I2C2 Clock source selection */
- #endif /* RCC_CCIPR_I2C2SEL */
- /**
- * @}
- */
- /** @defgroup RCC_LL_EC_I2S1 Peripheral I2S get clock source
- * @{
- */
- #if defined(STM32G0C1xx) || defined(STM32G0B1xx) || defined(STM32G0B0xx)
- #define LL_RCC_I2S1_CLKSOURCE RCC_CCIPR2_I2S1SEL /*!< I2S1 Clock source selection */
- #define LL_RCC_I2S2_CLKSOURCE RCC_CCIPR2_I2S2SEL /*!< I2S2 Clock source selection */
- #else
- #define LL_RCC_I2S1_CLKSOURCE RCC_CCIPR_I2S1SEL /*!< I2S1 Clock source selection */
- #endif /* STM32G0C1xx || STM32G0B1xx || STM32G0B0xx */
- /**
- * @}
- */
- #if defined(RCC_CCIPR_TIM1SEL)
- /** @defgroup RCC_LL_EC_TIMx Peripheral TIMx get clock source
- * @{
- */
- #define LL_RCC_TIM1_CLKSOURCE RCC_CCIPR_TIM1SEL /*!< TIM1 Clock source selection */
- #if defined(RCC_CCIPR_TIM15SEL)
- #define LL_RCC_TIM15_CLKSOURCE RCC_CCIPR_TIM15SEL /*!< TIM15 Clock source selection */
- #endif /* RCC_CCIPR_TIM15SEL */
- /**
- * @}
- */
- #endif /* RCC_CCIPR_TIM1SEL */
- #if defined(LPTIM1) && defined(LPTIM2)
- /** @defgroup RCC_LL_EC_LPTIM1 Peripheral LPTIM get clock source
- * @{
- */
- #define LL_RCC_LPTIM1_CLKSOURCE RCC_CCIPR_LPTIM1SEL /*!< LPTIM2 Clock source selection */
- #define LL_RCC_LPTIM2_CLKSOURCE RCC_CCIPR_LPTIM2SEL /*!< LPTIM2 Clock source selection */
- /**
- * @}
- */
- #endif /* LPTIM1 && LPTIM2 */
- #if defined(CEC)
- /** @defgroup RCC_LL_EC_CEC Peripheral CEC get clock source
- * @{
- */
- #define LL_RCC_CEC_CLKSOURCE RCC_CCIPR_CECSEL /*!< CEC Clock source selection */
- /**
- * @}
- */
- #endif /* CEC */
- #if defined(FDCAN1) || defined(FDCAN2)
- /** @defgroup RCC_LL_EC_FDCAN Peripheral FDCAN get clock source
- * @{
- */
- #define LL_RCC_FDCAN_CLKSOURCE RCC_CCIPR2_FDCANSEL /*!< FDCAN Clock source selection */
- /**
- * @}
- */
- #endif /* FDCAN1 */
- #if defined(STM32G0C1xx) || defined(STM32G0B1xx) || defined(STM32G0B0xx)
- /** @defgroup RCC_LL_EC_USB Peripheral USB get clock source
- * @{
- */
- #define LL_RCC_USB_CLKSOURCE RCC_CCIPR2_USBSEL /*!< USB Clock source selection */
- /**
- * @}
- */
- #endif /* STM32G0C1xx || STM32G0B1xx || STM32G0B0xx */
- #if defined(RNG)
- /** @defgroup RCC_LL_EC_RNG Peripheral RNG get clock source
- * @{
- */
- #define LL_RCC_RNG_CLKSOURCE RCC_CCIPR_RNGSEL /*!< RNG Clock source selection */
- /**
- * @}
- */
- /** @defgroup RCC_LL_EC_RNG_DIV Peripheral RNG get clock division factor
- * @{
- */
- #define LL_RCC_RNG_CLKDIV RCC_CCIPR_RNGDIV /*!< RNG Clock division factor */
- /**
- * @}
- */
- #endif /* RNG */
- /** @defgroup RCC_LL_EC_ADC Peripheral ADC get clock source
- * @{
- */
- #define LL_RCC_ADC_CLKSOURCE RCC_CCIPR_ADCSEL /*!< ADC Clock source selection */
- /**
- * @}
- */
- /** @defgroup RCC_LL_EC_RTC_CLKSOURCE RTC clock source selection
- * @{
- */
- #define LL_RCC_RTC_CLKSOURCE_NONE 0x00000000U /*!< No clock used as RTC clock */
- #define LL_RCC_RTC_CLKSOURCE_LSE RCC_BDCR_RTCSEL_0 /*!< LSE oscillator clock used as RTC clock */
- #define LL_RCC_RTC_CLKSOURCE_LSI RCC_BDCR_RTCSEL_1 /*!< LSI oscillator clock used as RTC clock */
- #define LL_RCC_RTC_CLKSOURCE_HSE_DIV32 RCC_BDCR_RTCSEL /*!< HSE oscillator clock divided by 32 used as RTC clock */
- /**
- * @}
- */
- /** @defgroup RCC_LL_EC_PLLSOURCE PLL entry clock source
- * @{
- */
- #define LL_RCC_PLLSOURCE_NONE 0x00000000U /*!< No clock */
- #define LL_RCC_PLLSOURCE_HSI RCC_PLLCFGR_PLLSRC_HSI /*!< HSI16 clock selected as PLL entry clock source */
- #define LL_RCC_PLLSOURCE_HSE RCC_PLLCFGR_PLLSRC_HSE /*!< HSE clock selected as PLL entry clock source */
- /**
- * @}
- */
- /** @defgroup RCC_LL_EC_PLLM_DIV PLL division factor (PLLM)
- * @{
- */
- #define LL_RCC_PLLM_DIV_1 0x00000000U /*!< PLL division factor by 1 */
- #define LL_RCC_PLLM_DIV_2 (RCC_PLLCFGR_PLLM_0) /*!< PLL division factor by 2 */
- #define LL_RCC_PLLM_DIV_3 (RCC_PLLCFGR_PLLM_1) /*!< PLL division factor by 3 */
- #define LL_RCC_PLLM_DIV_4 ((RCC_PLLCFGR_PLLM_1 | RCC_PLLCFGR_PLLM_0)) /*!< PLL division factor by 4 */
- #define LL_RCC_PLLM_DIV_5 (RCC_PLLCFGR_PLLM_2) /*!< PLL division factor by 5 */
- #define LL_RCC_PLLM_DIV_6 ((RCC_PLLCFGR_PLLM_2 | RCC_PLLCFGR_PLLM_0)) /*!< PLL division factor by 6 */
- #define LL_RCC_PLLM_DIV_7 ((RCC_PLLCFGR_PLLM_2 | RCC_PLLCFGR_PLLM_1)) /*!< PLL division factor by 7 */
- #define LL_RCC_PLLM_DIV_8 (RCC_PLLCFGR_PLLM) /*!< PLL division factor by 8 */
- /**
- * @}
- */
- /** @defgroup RCC_LL_EC_PLLR_DIV PLL division factor (PLLR)
- * @{
- */
- #define LL_RCC_PLLR_DIV_2 (RCC_PLLCFGR_PLLR_0) /*!< Main PLL division factor for PLLCLK (system clock) by 2 */
- #define LL_RCC_PLLR_DIV_3 (RCC_PLLCFGR_PLLR_1) /*!< Main PLL division factor for PLLCLK (system clock) by 3 */
- #define LL_RCC_PLLR_DIV_4 (RCC_PLLCFGR_PLLR_1|RCC_PLLCFGR_PLLR_0) /*!< Main PLL division factor for PLLCLK (system clock) by 4 */
- #define LL_RCC_PLLR_DIV_5 (RCC_PLLCFGR_PLLR_2) /*!< Main PLL division factor for PLLCLK (system clock) by 5 */
- #define LL_RCC_PLLR_DIV_6 (RCC_PLLCFGR_PLLR_2|RCC_PLLCFGR_PLLR_0) /*!< Main PLL division factor for PLLCLK (system clock) by 6 */
- #define LL_RCC_PLLR_DIV_7 (RCC_PLLCFGR_PLLR_2|RCC_PLLCFGR_PLLR_1) /*!< Main PLL division factor for PLLCLK (system clock) by 7 */
- #define LL_RCC_PLLR_DIV_8 (RCC_PLLCFGR_PLLR) /*!< Main PLL division factor for PLLCLK (system clock) by 8 */
- /**
- * @}
- */
- /** @defgroup RCC_LL_EC_PLLP_DIV PLL division factor (PLLP)
- * @{
- */
- #define LL_RCC_PLLP_DIV_2 (RCC_PLLCFGR_PLLP_0) /*!< Main PLL division factor for PLLP output by 2 */
- #define LL_RCC_PLLP_DIV_3 (RCC_PLLCFGR_PLLP_1) /*!< Main PLL division factor for PLLP output by 3 */
- #define LL_RCC_PLLP_DIV_4 (RCC_PLLCFGR_PLLP_0|RCC_PLLCFGR_PLLP_1) /*!< Main PLL division factor for PLLP output by 4 */
- #define LL_RCC_PLLP_DIV_5 (RCC_PLLCFGR_PLLP_2) /*!< Main PLL division factor for PLLP output by 5 */
- #define LL_RCC_PLLP_DIV_6 (RCC_PLLCFGR_PLLP_0|RCC_PLLCFGR_PLLP_2) /*!< Main PLL division factor for PLLP output by 6 */
- #define LL_RCC_PLLP_DIV_7 (RCC_PLLCFGR_PLLP_1|RCC_PLLCFGR_PLLP_2) /*!< Main PLL division factor for PLLP output by 7 */
- #define LL_RCC_PLLP_DIV_8 (RCC_PLLCFGR_PLLP_0|RCC_PLLCFGR_PLLP_1|RCC_PLLCFGR_PLLP_2) /*!< Main PLL division factor for PLLP output by 8 */
- #define LL_RCC_PLLP_DIV_9 (RCC_PLLCFGR_PLLP_3) /*!< Main PLL division factor for PLLP output by 9 */
- #define LL_RCC_PLLP_DIV_10 (RCC_PLLCFGR_PLLP_0|RCC_PLLCFGR_PLLP_3) /*!< Main PLL division factor for PLLP output by 10 */
- #define LL_RCC_PLLP_DIV_11 (RCC_PLLCFGR_PLLP_1|RCC_PLLCFGR_PLLP_3) /*!< Main PLL division factor for PLLP output by 11 */
- #define LL_RCC_PLLP_DIV_12 (RCC_PLLCFGR_PLLP_0|RCC_PLLCFGR_PLLP_1|RCC_PLLCFGR_PLLP_3) /*!< Main PLL division factor for PLLP output by 12 */
- #define LL_RCC_PLLP_DIV_13 (RCC_PLLCFGR_PLLP_2|RCC_PLLCFGR_PLLP_3) /*!< Main PLL division factor for PLLP output by 13 */
- #define LL_RCC_PLLP_DIV_14 (RCC_PLLCFGR_PLLP_0|RCC_PLLCFGR_PLLP_2|RCC_PLLCFGR_PLLP_3) /*!< Main PLL division factor for PLLP output by 14 */
- #define LL_RCC_PLLP_DIV_15 (RCC_PLLCFGR_PLLP_1|RCC_PLLCFGR_PLLP_2|RCC_PLLCFGR_PLLP_3) /*!< Main PLL division factor for PLLP output by 15 */
- #define LL_RCC_PLLP_DIV_16 (RCC_PLLCFGR_PLLP_0|RCC_PLLCFGR_PLLP_1|RCC_PLLCFGR_PLLP_2|RCC_PLLCFGR_PLLP_3)/*!< Main PLL division factor for PLLP output by 16 */
- #define LL_RCC_PLLP_DIV_17 (RCC_PLLCFGR_PLLP_4) /*!< Main PLL division factor for PLLP output by 17 */
- #define LL_RCC_PLLP_DIV_18 (RCC_PLLCFGR_PLLP_0|RCC_PLLCFGR_PLLP_4) /*!< Main PLL division factor for PLLP output by 18 */
- #define LL_RCC_PLLP_DIV_19 (RCC_PLLCFGR_PLLP_1|RCC_PLLCFGR_PLLP_4) /*!< Main PLL division factor for PLLP output by 19 */
- #define LL_RCC_PLLP_DIV_20 (RCC_PLLCFGR_PLLP_0|RCC_PLLCFGR_PLLP_1|RCC_PLLCFGR_PLLP_4) /*!< Main PLL division factor for PLLP output by 20 */
- #define LL_RCC_PLLP_DIV_21 (RCC_PLLCFGR_PLLP_2|RCC_PLLCFGR_PLLP_4) /*!< Main PLL division factor for PLLP output by 21 */
- #define LL_RCC_PLLP_DIV_22 (RCC_PLLCFGR_PLLP_0|RCC_PLLCFGR_PLLP_2|RCC_PLLCFGR_PLLP_4) /*!< Main PLL division factor for PLLP output by 22 */
- #define LL_RCC_PLLP_DIV_23 (RCC_PLLCFGR_PLLP_1|RCC_PLLCFGR_PLLP_2|RCC_PLLCFGR_PLLP_4) /*!< Main PLL division factor for PLLP output by 23 */
- #define LL_RCC_PLLP_DIV_24 (RCC_PLLCFGR_PLLP_0|RCC_PLLCFGR_PLLP_1|RCC_PLLCFGR_PLLP_2|RCC_PLLCFGR_PLLP_4)/*!< Main PLL division factor for PLLP output by 24 */
- #define LL_RCC_PLLP_DIV_25 (RCC_PLLCFGR_PLLP_3|RCC_PLLCFGR_PLLP_4) /*!< Main PLL division factor for PLLP output by 25 */
- #define LL_RCC_PLLP_DIV_26 (RCC_PLLCFGR_PLLP_0|RCC_PLLCFGR_PLLP_3|RCC_PLLCFGR_PLLP_4) /*!< Main PLL division factor for PLLP output by 26 */
- #define LL_RCC_PLLP_DIV_27 (RCC_PLLCFGR_PLLP_1|RCC_PLLCFGR_PLLP_3|RCC_PLLCFGR_PLLP_4) /*!< Main PLL division factor for PLLP output by 27*/
- #define LL_RCC_PLLP_DIV_28 (RCC_PLLCFGR_PLLP_0|RCC_PLLCFGR_PLLP_1|RCC_PLLCFGR_PLLP_3|RCC_PLLCFGR_PLLP_4)/*!< Main PLL division factor for PLLP output by 28 */
- #define LL_RCC_PLLP_DIV_29 (RCC_PLLCFGR_PLLP_2|RCC_PLLCFGR_PLLP_3|RCC_PLLCFGR_PLLP_4) /*!< Main PLL division factor for PLLP output by 29 */
- #define LL_RCC_PLLP_DIV_30 (RCC_PLLCFGR_PLLP_0|RCC_PLLCFGR_PLLP_2|RCC_PLLCFGR_PLLP_3|RCC_PLLCFGR_PLLP_4)/*!< Main PLL division factor for PLLP output by 30 */
- #define LL_RCC_PLLP_DIV_31 (RCC_PLLCFGR_PLLP_1|RCC_PLLCFGR_PLLP_2|RCC_PLLCFGR_PLLP_3|RCC_PLLCFGR_PLLP_4)/*!< Main PLL division factor for PLLP output by 31 */
- #define LL_RCC_PLLP_DIV_32 (RCC_PLLCFGR_PLLP_0|RCC_PLLCFGR_PLLP_1|RCC_PLLCFGR_PLLP_2|RCC_PLLCFGR_PLLP_3|RCC_PLLCFGR_PLLP_4)/*!< Main PLL division factor for PLLP output by 32 */
- /**
- * @}
- */
- #if defined(RCC_PLLQ_SUPPORT)
- /** @defgroup RCC_LL_EC_PLLQ_DIV PLL division factor (PLLQ)
- * @{
- */
- #define LL_RCC_PLLQ_DIV_2 (RCC_PLLCFGR_PLLQ_0) /*!< Main PLL division factor for PLLQ output by 2 */
- #define LL_RCC_PLLQ_DIV_3 (RCC_PLLCFGR_PLLQ_1) /*!< Main PLL division factor for PLLQ output by 3 */
- #define LL_RCC_PLLQ_DIV_4 (RCC_PLLCFGR_PLLQ_1|RCC_PLLCFGR_PLLQ_0) /*!< Main PLL division factor for PLLQ output by 4 */
- #define LL_RCC_PLLQ_DIV_5 (RCC_PLLCFGR_PLLQ_2) /*!< Main PLL division factor for PLLQ output by 5 */
- #define LL_RCC_PLLQ_DIV_6 (RCC_PLLCFGR_PLLQ_2|RCC_PLLCFGR_PLLQ_0) /*!< Main PLL division factor for PLLQ output by 6 */
- #define LL_RCC_PLLQ_DIV_7 (RCC_PLLCFGR_PLLQ_2|RCC_PLLCFGR_PLLQ_1) /*!< Main PLL division factor for PLLQ output by 7 */
- #define LL_RCC_PLLQ_DIV_8 (RCC_PLLCFGR_PLLQ) /*!< Main PLL division factor for PLLQ output by 8 */
- /**
- * @}
- */
- #endif /* RCC_PLLQ_SUPPORT */
- /**
- * @}
- */
- /* Exported macro ------------------------------------------------------------*/
- /** @defgroup RCC_LL_Exported_Macros RCC Exported Macros
- * @{
- */
- /** @defgroup RCC_LL_EM_WRITE_READ Common Write and read registers Macros
- * @{
- */
- /**
- * @brief Write a value in RCC register
- * @param __REG__ Register to be written
- * @param __VALUE__ Value to be written in the register
- * @retval None
- */
- #define LL_RCC_WriteReg(__REG__, __VALUE__) WRITE_REG((RCC->__REG__), (__VALUE__))
- /**
- * @brief Read a value in RCC register
- * @param __REG__ Register to be read
- * @retval Register value
- */
- #define LL_RCC_ReadReg(__REG__) READ_REG(RCC->__REG__)
- /**
- * @}
- */
- /** @defgroup RCC_LL_EM_CALC_FREQ Calculate frequencies
- * @{
- */
- /**
- * @brief Helper macro to calculate the PLLCLK frequency on system domain
- * @note ex: @ref __LL_RCC_CALC_PLLCLK_FREQ (HSE_VALUE,@ref LL_RCC_PLL_GetDivider (),
- * @ref LL_RCC_PLL_GetN (), @ref LL_RCC_PLL_GetR ());
- * @param __INPUTFREQ__ PLL Input frequency (based on HSE/HSI)
- * @param __PLLM__ This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLM_DIV_1
- * @arg @ref LL_RCC_PLLM_DIV_2
- * @arg @ref LL_RCC_PLLM_DIV_3
- * @arg @ref LL_RCC_PLLM_DIV_4
- * @arg @ref LL_RCC_PLLM_DIV_5
- * @arg @ref LL_RCC_PLLM_DIV_6
- * @arg @ref LL_RCC_PLLM_DIV_7
- * @arg @ref LL_RCC_PLLM_DIV_8
- * @param __PLLN__ Between Min_Data = 8 and Max_Data = 86
- * @param __PLLR__ This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLR_DIV_2
- * @arg @ref LL_RCC_PLLR_DIV_3
- * @arg @ref LL_RCC_PLLR_DIV_4
- * @arg @ref LL_RCC_PLLR_DIV_5
- * @arg @ref LL_RCC_PLLR_DIV_6
- * @arg @ref LL_RCC_PLLR_DIV_7
- * @arg @ref LL_RCC_PLLR_DIV_8
- * @retval PLL clock frequency (in Hz)
- */
- #define __LL_RCC_CALC_PLLCLK_FREQ(__INPUTFREQ__, __PLLM__, __PLLN__, __PLLR__) \
- ((__INPUTFREQ__) * (__PLLN__) / ((((__PLLM__)>> RCC_PLLCFGR_PLLM_Pos) + 1U)) / \
- (((__PLLR__) >> RCC_PLLCFGR_PLLR_Pos) + 1U))
- /**
- * @brief Helper macro to calculate the PLLPCLK frequency used on I2S domain
- * @note ex: @ref __LL_RCC_CALC_PLLCLK_I2S1_FREQ (HSE_VALUE,@ref LL_RCC_PLL_GetDivider (),
- * @ref LL_RCC_PLL_GetN (), @ref LL_RCC_PLL_GetP ());
- * @param __INPUTFREQ__ PLL Input frequency (based on HSE/HSI)
- * @param __PLLM__ This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLM_DIV_1
- * @arg @ref LL_RCC_PLLM_DIV_2
- * @arg @ref LL_RCC_PLLM_DIV_3
- * @arg @ref LL_RCC_PLLM_DIV_4
- * @arg @ref LL_RCC_PLLM_DIV_5
- * @arg @ref LL_RCC_PLLM_DIV_6
- * @arg @ref LL_RCC_PLLM_DIV_7
- * @arg @ref LL_RCC_PLLM_DIV_8
- * @param __PLLN__ Between Min_Data = 8 and Max_Data = 86
- * @param __PLLP__ This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLP_DIV_2
- * @arg @ref LL_RCC_PLLP_DIV_3
- * @arg @ref LL_RCC_PLLP_DIV_4
- * @arg @ref LL_RCC_PLLP_DIV_5
- * @arg @ref LL_RCC_PLLP_DIV_6
- * @arg @ref LL_RCC_PLLP_DIV_7
- * @arg @ref LL_RCC_PLLP_DIV_8
- * @arg @ref LL_RCC_PLLP_DIV_9
- * @arg @ref LL_RCC_PLLP_DIV_10
- * @arg @ref LL_RCC_PLLP_DIV_11
- * @arg @ref LL_RCC_PLLP_DIV_12
- * @arg @ref LL_RCC_PLLP_DIV_13
- * @arg @ref LL_RCC_PLLP_DIV_14
- * @arg @ref LL_RCC_PLLP_DIV_15
- * @arg @ref LL_RCC_PLLP_DIV_16
- * @arg @ref LL_RCC_PLLP_DIV_17
- * @arg @ref LL_RCC_PLLP_DIV_18
- * @arg @ref LL_RCC_PLLP_DIV_19
- * @arg @ref LL_RCC_PLLP_DIV_20
- * @arg @ref LL_RCC_PLLP_DIV_21
- * @arg @ref LL_RCC_PLLP_DIV_22
- * @arg @ref LL_RCC_PLLP_DIV_23
- * @arg @ref LL_RCC_PLLP_DIV_24
- * @arg @ref LL_RCC_PLLP_DIV_25
- * @arg @ref LL_RCC_PLLP_DIV_26
- * @arg @ref LL_RCC_PLLP_DIV_27
- * @arg @ref LL_RCC_PLLP_DIV_28
- * @arg @ref LL_RCC_PLLP_DIV_29
- * @arg @ref LL_RCC_PLLP_DIV_30
- * @arg @ref LL_RCC_PLLP_DIV_31
- * @arg @ref LL_RCC_PLLP_DIV_32
- * @retval PLL clock frequency (in Hz)
- */
- #define __LL_RCC_CALC_PLLCLK_I2S1_FREQ(__INPUTFREQ__, __PLLM__, __PLLN__, __PLLP__) \
- ((__INPUTFREQ__) * (__PLLN__) / ((((__PLLM__)>> RCC_PLLCFGR_PLLM_Pos) + 1U)) / \
- (((__PLLP__) >> RCC_PLLCFGR_PLLP_Pos) + 1U))
- #if defined(RCC_CCIPR2_I2S2SEL)
- /**
- * @brief Helper macro to calculate the PLLPCLK frequency used on I2S2 domain
- * @note ex: @ref __LL_RCC_CALC_PLLCLK_I2S2_FREQ (HSE_VALUE,@ref LL_RCC_PLL_GetDivider (),
- * @ref LL_RCC_PLL_GetN (), @ref LL_RCC_PLL_GetP ());
- * @param __INPUTFREQ__ PLL Input frequency (based on HSE/HSI)
- * @param __PLLM__ This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLM_DIV_1
- * @arg @ref LL_RCC_PLLM_DIV_2
- * @arg @ref LL_RCC_PLLM_DIV_3
- * @arg @ref LL_RCC_PLLM_DIV_4
- * @arg @ref LL_RCC_PLLM_DIV_5
- * @arg @ref LL_RCC_PLLM_DIV_6
- * @arg @ref LL_RCC_PLLM_DIV_7
- * @arg @ref LL_RCC_PLLM_DIV_8
- * @param __PLLN__ Between Min_Data = 8 and Max_Data = 86
- * @param __PLLP__ This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLP_DIV_2
- * @arg @ref LL_RCC_PLLP_DIV_3
- * @arg @ref LL_RCC_PLLP_DIV_4
- * @arg @ref LL_RCC_PLLP_DIV_5
- * @arg @ref LL_RCC_PLLP_DIV_6
- * @arg @ref LL_RCC_PLLP_DIV_7
- * @arg @ref LL_RCC_PLLP_DIV_8
- * @arg @ref LL_RCC_PLLP_DIV_9
- * @arg @ref LL_RCC_PLLP_DIV_10
- * @arg @ref LL_RCC_PLLP_DIV_11
- * @arg @ref LL_RCC_PLLP_DIV_12
- * @arg @ref LL_RCC_PLLP_DIV_13
- * @arg @ref LL_RCC_PLLP_DIV_14
- * @arg @ref LL_RCC_PLLP_DIV_15
- * @arg @ref LL_RCC_PLLP_DIV_16
- * @arg @ref LL_RCC_PLLP_DIV_17
- * @arg @ref LL_RCC_PLLP_DIV_18
- * @arg @ref LL_RCC_PLLP_DIV_19
- * @arg @ref LL_RCC_PLLP_DIV_20
- * @arg @ref LL_RCC_PLLP_DIV_21
- * @arg @ref LL_RCC_PLLP_DIV_22
- * @arg @ref LL_RCC_PLLP_DIV_23
- * @arg @ref LL_RCC_PLLP_DIV_24
- * @arg @ref LL_RCC_PLLP_DIV_25
- * @arg @ref LL_RCC_PLLP_DIV_26
- * @arg @ref LL_RCC_PLLP_DIV_27
- * @arg @ref LL_RCC_PLLP_DIV_28
- * @arg @ref LL_RCC_PLLP_DIV_29
- * @arg @ref LL_RCC_PLLP_DIV_30
- * @arg @ref LL_RCC_PLLP_DIV_31
- * @arg @ref LL_RCC_PLLP_DIV_32
- * @retval PLL clock frequency (in Hz)
- */
- #define __LL_RCC_CALC_PLLCLK_I2S2_FREQ(__INPUTFREQ__, __PLLM__, __PLLN__, __PLLP__) \
- ((__INPUTFREQ__) * (__PLLN__) / ((((__PLLM__)>> RCC_PLLCFGR_PLLM_Pos) + 1U)) / \
- (((__PLLP__) >> RCC_PLLCFGR_PLLP_Pos) + 1U))
- #endif /* RCC_CCIPR2_I2S2SEL */
- /**
- * @brief Helper macro to calculate the PLLPCLK frequency used on ADC domain
- * @note ex: @ref __LL_RCC_CALC_PLLCLK_ADC_FREQ (HSE_VALUE,@ref LL_RCC_PLL_GetDivider (),
- * @ref LL_RCC_PLL_GetN (), @ref LL_RCC_PLL_GetP ());
- * @param __INPUTFREQ__ PLL Input frequency (based on HSE/HSI)
- * @param __PLLM__ This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLM_DIV_1
- * @arg @ref LL_RCC_PLLM_DIV_2
- * @arg @ref LL_RCC_PLLM_DIV_3
- * @arg @ref LL_RCC_PLLM_DIV_4
- * @arg @ref LL_RCC_PLLM_DIV_5
- * @arg @ref LL_RCC_PLLM_DIV_6
- * @arg @ref LL_RCC_PLLM_DIV_7
- * @arg @ref LL_RCC_PLLM_DIV_8
- * @param __PLLN__ Between Min_Data = 8 and Max_Data = 86
- * @param __PLLP__ This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLP_DIV_2
- * @arg @ref LL_RCC_PLLP_DIV_3
- * @arg @ref LL_RCC_PLLP_DIV_4
- * @arg @ref LL_RCC_PLLP_DIV_5
- * @arg @ref LL_RCC_PLLP_DIV_6
- * @arg @ref LL_RCC_PLLP_DIV_7
- * @arg @ref LL_RCC_PLLP_DIV_8
- * @arg @ref LL_RCC_PLLP_DIV_9
- * @arg @ref LL_RCC_PLLP_DIV_10
- * @arg @ref LL_RCC_PLLP_DIV_11
- * @arg @ref LL_RCC_PLLP_DIV_12
- * @arg @ref LL_RCC_PLLP_DIV_13
- * @arg @ref LL_RCC_PLLP_DIV_14
- * @arg @ref LL_RCC_PLLP_DIV_15
- * @arg @ref LL_RCC_PLLP_DIV_16
- * @arg @ref LL_RCC_PLLP_DIV_17
- * @arg @ref LL_RCC_PLLP_DIV_18
- * @arg @ref LL_RCC_PLLP_DIV_19
- * @arg @ref LL_RCC_PLLP_DIV_20
- * @arg @ref LL_RCC_PLLP_DIV_21
- * @arg @ref LL_RCC_PLLP_DIV_22
- * @arg @ref LL_RCC_PLLP_DIV_23
- * @arg @ref LL_RCC_PLLP_DIV_24
- * @arg @ref LL_RCC_PLLP_DIV_25
- * @arg @ref LL_RCC_PLLP_DIV_26
- * @arg @ref LL_RCC_PLLP_DIV_27
- * @arg @ref LL_RCC_PLLP_DIV_28
- * @arg @ref LL_RCC_PLLP_DIV_29
- * @arg @ref LL_RCC_PLLP_DIV_30
- * @arg @ref LL_RCC_PLLP_DIV_31
- * @arg @ref LL_RCC_PLLP_DIV_32
- * @retval PLL clock frequency (in Hz)
- */
- #define __LL_RCC_CALC_PLLCLK_ADC_FREQ(__INPUTFREQ__, __PLLM__, __PLLN__, __PLLP__) \
- ((__INPUTFREQ__) * (__PLLN__) / ((((__PLLM__)>> RCC_PLLCFGR_PLLM_Pos) + 1U)) / \
- (((__PLLP__) >> RCC_PLLCFGR_PLLP_Pos) + 1U))
- #if defined(RNG)
- /**
- * @brief Helper macro to calculate the PLLQCLK frequency used on RNG domain
- * @note ex: @ref __LL_RCC_CALC_PLLCLK_RNG_FREQ (HSE_VALUE,@ref LL_RCC_PLL_GetDivider (),
- * @ref LL_RCC_PLL_GetN (), @ref LL_RCC_PLL_GetQ ());
- * @param __INPUTFREQ__ PLL Input frequency (based on HSE/HSI)
- * @param __PLLM__ This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLM_DIV_1
- * @arg @ref LL_RCC_PLLM_DIV_2
- * @arg @ref LL_RCC_PLLM_DIV_3
- * @arg @ref LL_RCC_PLLM_DIV_4
- * @arg @ref LL_RCC_PLLM_DIV_5
- * @arg @ref LL_RCC_PLLM_DIV_6
- * @arg @ref LL_RCC_PLLM_DIV_7
- * @arg @ref LL_RCC_PLLM_DIV_8
- * @param __PLLN__ Between Min_Data = 8 and Max_Data = 86
- * @param __PLLQ__ This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLQ_DIV_2
- * @arg @ref LL_RCC_PLLQ_DIV_3
- * @arg @ref LL_RCC_PLLQ_DIV_4
- * @arg @ref LL_RCC_PLLQ_DIV_5
- * @arg @ref LL_RCC_PLLQ_DIV_6
- * @arg @ref LL_RCC_PLLQ_DIV_7
- * @arg @ref LL_RCC_PLLQ_DIV_8
- * @retval PLL clock frequency (in Hz)
- */
- #define __LL_RCC_CALC_PLLCLK_RNG_FREQ(__INPUTFREQ__, __PLLM__, __PLLN__, __PLLQ__) \
- ((__INPUTFREQ__) * (__PLLN__) / ((((__PLLM__)>> RCC_PLLCFGR_PLLM_Pos) + 1U)) / \
- (((__PLLQ__) >> RCC_PLLCFGR_PLLQ_Pos) + 1U))
- #endif /* RNG */
- #if defined(RCC_PLLQ_SUPPORT)
- /**
- * @brief Helper macro to calculate the PLLQCLK frequency used on TIM1 domain
- * @note ex: @ref __LL_RCC_CALC_PLLCLK_TIM1_FREQ (HSE_VALUE,@ref LL_RCC_PLL_GetDivider (),
- * @ref LL_RCC_PLL_GetN (), @ref LL_RCC_PLL_GetQ ());
- * @param __INPUTFREQ__ PLL Input frequency (based on HSE/HSI)
- * @param __PLLM__ This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLM_DIV_1
- * @arg @ref LL_RCC_PLLM_DIV_2
- * @arg @ref LL_RCC_PLLM_DIV_3
- * @arg @ref LL_RCC_PLLM_DIV_4
- * @arg @ref LL_RCC_PLLM_DIV_5
- * @arg @ref LL_RCC_PLLM_DIV_6
- * @arg @ref LL_RCC_PLLM_DIV_7
- * @arg @ref LL_RCC_PLLM_DIV_8
- * @param __PLLN__ Between Min_Data = 8 and Max_Data = 86
- * @param __PLLQ__ This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLQ_DIV_2
- * @arg @ref LL_RCC_PLLQ_DIV_3
- * @arg @ref LL_RCC_PLLQ_DIV_4
- * @arg @ref LL_RCC_PLLQ_DIV_5
- * @arg @ref LL_RCC_PLLQ_DIV_6
- * @arg @ref LL_RCC_PLLQ_DIV_7
- * @arg @ref LL_RCC_PLLQ_DIV_8
- * @retval PLL clock frequency (in Hz)
- */
- #define __LL_RCC_CALC_PLLCLK_TIM1_FREQ(__INPUTFREQ__, __PLLM__, __PLLN__, __PLLQ__) \
- ((__INPUTFREQ__) * (__PLLN__) / ((((__PLLM__)>> RCC_PLLCFGR_PLLM_Pos) + 1U)) / \
- (((__PLLQ__) >> RCC_PLLCFGR_PLLQ_Pos) + 1U))
- #if defined(TIM15)
- /**
- * @brief Helper macro to calculate the PLLQCLK frequency used on TIM15 domain
- * @note ex: @ref __LL_RCC_CALC_PLLCLK_TIM15_FREQ (HSE_VALUE,@ref LL_RCC_PLL_GetDivider (),
- * @ref LL_RCC_PLL_GetN (), @ref LL_RCC_PLL_GetQ ());
- * @param __INPUTFREQ__ PLL Input frequency (based on HSE/HSI)
- * @param __PLLM__ This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLM_DIV_1
- * @arg @ref LL_RCC_PLLM_DIV_2
- * @arg @ref LL_RCC_PLLM_DIV_3
- * @arg @ref LL_RCC_PLLM_DIV_4
- * @arg @ref LL_RCC_PLLM_DIV_5
- * @arg @ref LL_RCC_PLLM_DIV_6
- * @arg @ref LL_RCC_PLLM_DIV_7
- * @arg @ref LL_RCC_PLLM_DIV_8
- * @param __PLLN__ Between Min_Data = 8 and Max_Data = 86
- * @param __PLLQ__ This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLQ_DIV_2
- * @arg @ref LL_RCC_PLLQ_DIV_3
- * @arg @ref LL_RCC_PLLQ_DIV_4
- * @arg @ref LL_RCC_PLLQ_DIV_5
- * @arg @ref LL_RCC_PLLQ_DIV_6
- * @arg @ref LL_RCC_PLLQ_DIV_7
- * @arg @ref LL_RCC_PLLQ_DIV_8
- * @retval PLL clock frequency (in Hz)
- */
- #define __LL_RCC_CALC_PLLCLK_TIM15_FREQ(__INPUTFREQ__, __PLLM__, __PLLN__, __PLLQ__) \
- ((__INPUTFREQ__) * (__PLLN__) / ((((__PLLM__)>> RCC_PLLCFGR_PLLM_Pos) + 1U)) / \
- (((__PLLQ__) >> RCC_PLLCFGR_PLLQ_Pos) + 1U))
- #endif /* TIM15 */
- #endif /* RCC_PLLQ_SUPPORT */
- #if defined(FDCAN1) || defined(FDCAN2)
- /**
- * @brief Helper macro to calculate the PLLQCLK frequency used on FDCAN domain
- * @note ex: @ref __LL_RCC_CALC_PLLCLK_FDCAN_FREQ (HSE_VALUE,@ref LL_RCC_PLL_GetDivider (),
- * @ref LL_RCC_PLL_GetN (), @ref LL_RCC_PLL_GetQ ());
- * @param __INPUTFREQ__ PLL Input frequency (based on HSE/HSI)
- * @param __PLLM__ This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLM_DIV_1
- * @arg @ref LL_RCC_PLLM_DIV_2
- * @arg @ref LL_RCC_PLLM_DIV_3
- * @arg @ref LL_RCC_PLLM_DIV_4
- * @arg @ref LL_RCC_PLLM_DIV_5
- * @arg @ref LL_RCC_PLLM_DIV_6
- * @arg @ref LL_RCC_PLLM_DIV_7
- * @arg @ref LL_RCC_PLLM_DIV_8
- * @param __PLLN__ Between Min_Data = 8 and Max_Data = 86
- * @param __PLLQ__ This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLQ_DIV_2
- * @arg @ref LL_RCC_PLLQ_DIV_3
- * @arg @ref LL_RCC_PLLQ_DIV_4
- * @arg @ref LL_RCC_PLLQ_DIV_5
- * @arg @ref LL_RCC_PLLQ_DIV_6
- * @arg @ref LL_RCC_PLLQ_DIV_7
- * @arg @ref LL_RCC_PLLQ_DIV_8
- * @retval PLL clock frequency (in Hz)
- */
- #define __LL_RCC_CALC_PLLCLK_FDCAN_FREQ(__INPUTFREQ__, __PLLM__, __PLLN__, __PLLQ__) \
- ((__INPUTFREQ__) * (__PLLN__) / ((((__PLLM__)>> RCC_PLLCFGR_PLLM_Pos) + 1U)) / \
- (((__PLLQ__) >> RCC_PLLCFGR_PLLQ_Pos) + 1U))
- #endif /* FDCAN1 || FDCAN2 */
- #if defined(STM32G0C1xx) || defined(STM32G0B1xx) || defined(STM32G0B0xx)
- /**
- * @brief Helper macro to calculate the PLLQCLK frequency used on USB domain
- * @note ex: @ref __LL_RCC_CALC_PLLCLK_USB_FREQ (HSE_VALUE,@ref LL_RCC_PLL_GetDivider (),
- * @ref LL_RCC_PLL_GetN (), @ref LL_RCC_PLL_GetQ ());
- * @param __INPUTFREQ__ PLL Input frequency (based on HSE/HSI)
- * @param __PLLM__ This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLM_DIV_1
- * @arg @ref LL_RCC_PLLM_DIV_2
- * @arg @ref LL_RCC_PLLM_DIV_3
- * @arg @ref LL_RCC_PLLM_DIV_4
- * @arg @ref LL_RCC_PLLM_DIV_5
- * @arg @ref LL_RCC_PLLM_DIV_6
- * @arg @ref LL_RCC_PLLM_DIV_7
- * @arg @ref LL_RCC_PLLM_DIV_8
- * @param __PLLN__ Between Min_Data = 8 and Max_Data = 86
- * @param __PLLQ__ This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLQ_DIV_2
- * @arg @ref LL_RCC_PLLQ_DIV_3
- * @arg @ref LL_RCC_PLLQ_DIV_4
- * @arg @ref LL_RCC_PLLQ_DIV_5
- * @arg @ref LL_RCC_PLLQ_DIV_6
- * @arg @ref LL_RCC_PLLQ_DIV_7
- * @arg @ref LL_RCC_PLLQ_DIV_8
- * @retval PLL clock frequency (in Hz)
- */
- #define __LL_RCC_CALC_PLLCLK_USB_FREQ(__INPUTFREQ__, __PLLM__, __PLLN__, __PLLQ__) \
- ((__INPUTFREQ__) * (__PLLN__) / ((((__PLLM__)>> RCC_PLLCFGR_PLLM_Pos) + 1U)) / \
- (((__PLLQ__) >> RCC_PLLCFGR_PLLQ_Pos) + 1U))
- #endif /* STM32G0C1xx || STM32G0B1xx || STM32G0B0xx */
- /**
- * @brief Helper macro to calculate the HCLK frequency
- * @param __SYSCLKFREQ__ SYSCLK frequency (based on HSE/HSI/PLLCLK)
- * @param __AHBPRESCALER__ This parameter can be one of the following values:
- * @arg @ref LL_RCC_SYSCLK_DIV_1
- * @arg @ref LL_RCC_SYSCLK_DIV_2
- * @arg @ref LL_RCC_SYSCLK_DIV_4
- * @arg @ref LL_RCC_SYSCLK_DIV_8
- * @arg @ref LL_RCC_SYSCLK_DIV_16
- * @arg @ref LL_RCC_SYSCLK_DIV_64
- * @arg @ref LL_RCC_SYSCLK_DIV_128
- * @arg @ref LL_RCC_SYSCLK_DIV_256
- * @arg @ref LL_RCC_SYSCLK_DIV_512
- * @retval HCLK clock frequency (in Hz)
- */
- #define __LL_RCC_CALC_HCLK_FREQ(__SYSCLKFREQ__,__AHBPRESCALER__) \
- ((__SYSCLKFREQ__) >> (AHBPrescTable[((__AHBPRESCALER__) & RCC_CFGR_HPRE) >> RCC_CFGR_HPRE_Pos] & 0x1FU))
- /**
- * @brief Helper macro to calculate the PCLK1 frequency (ABP1)
- * @param __HCLKFREQ__ HCLK frequency
- * @param __APB1PRESCALER__ This parameter can be one of the following values:
- * @arg @ref LL_RCC_APB1_DIV_1
- * @arg @ref LL_RCC_APB1_DIV_2
- * @arg @ref LL_RCC_APB1_DIV_4
- * @arg @ref LL_RCC_APB1_DIV_8
- * @arg @ref LL_RCC_APB1_DIV_16
- * @retval PCLK1 clock frequency (in Hz)
- */
- #define __LL_RCC_CALC_PCLK1_FREQ(__HCLKFREQ__, __APB1PRESCALER__) \
- ((__HCLKFREQ__) >> (APBPrescTable[(__APB1PRESCALER__) >> RCC_CFGR_PPRE_Pos] & 0x1FU))
- /**
- * @brief Helper macro to calculate the HSISYS frequency
- * @param __HSIDIV__ This parameter can be one of the following values:
- * @arg @ref LL_RCC_HSI_DIV_1
- * @arg @ref LL_RCC_HSI_DIV_2
- * @arg @ref LL_RCC_HSI_DIV_4
- * @arg @ref LL_RCC_HSI_DIV_8
- * @arg @ref LL_RCC_HSI_DIV_16
- * @arg @ref LL_RCC_HSI_DIV_32
- * @arg @ref LL_RCC_HSI_DIV_64
- * @arg @ref LL_RCC_HSI_DIV_128
- * @retval HSISYS clock frequency (in Hz)
- */
- #define __LL_RCC_CALC_HSI_FREQ(__HSIDIV__) (HSI_VALUE / (1U << ((__HSIDIV__)>> RCC_CR_HSIDIV_Pos)))
- /**
- * @}
- */
- /**
- * @}
- */
- /* Exported functions --------------------------------------------------------*/
- /** @defgroup RCC_LL_Exported_Functions RCC Exported Functions
- * @{
- */
- /** @defgroup RCC_LL_EF_HSE HSE
- * @{
- */
- /**
- * @brief Enable the Clock Security System.
- * @rmtoll CR CSSON LL_RCC_HSE_EnableCSS
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_HSE_EnableCSS(void)
- {
- SET_BIT(RCC->CR, RCC_CR_CSSON);
- }
- /**
- * @brief Enable HSE external oscillator (HSE Bypass)
- * @rmtoll CR HSEBYP LL_RCC_HSE_EnableBypass
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_HSE_EnableBypass(void)
- {
- SET_BIT(RCC->CR, RCC_CR_HSEBYP);
- }
- /**
- * @brief Disable HSE external oscillator (HSE Bypass)
- * @rmtoll CR HSEBYP LL_RCC_HSE_DisableBypass
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_HSE_DisableBypass(void)
- {
- CLEAR_BIT(RCC->CR, RCC_CR_HSEBYP);
- }
- /**
- * @brief Enable HSE crystal oscillator (HSE ON)
- * @rmtoll CR HSEON LL_RCC_HSE_Enable
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_HSE_Enable(void)
- {
- SET_BIT(RCC->CR, RCC_CR_HSEON);
- }
- /**
- * @brief Disable HSE crystal oscillator (HSE ON)
- * @rmtoll CR HSEON LL_RCC_HSE_Disable
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_HSE_Disable(void)
- {
- CLEAR_BIT(RCC->CR, RCC_CR_HSEON);
- }
- /**
- * @brief Check if HSE oscillator Ready
- * @rmtoll CR HSERDY LL_RCC_HSE_IsReady
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_RCC_HSE_IsReady(void)
- {
- return ((READ_BIT(RCC->CR, RCC_CR_HSERDY) == (RCC_CR_HSERDY)) ? 1UL : 0UL);
- }
- /**
- * @}
- */
- /** @defgroup RCC_LL_EF_HSI HSI
- * @{
- */
- /**
- * @brief Enable HSI even in stop mode
- * @note HSI oscillator is forced ON even in Stop mode
- * @rmtoll CR HSIKERON LL_RCC_HSI_EnableInStopMode
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_HSI_EnableInStopMode(void)
- {
- SET_BIT(RCC->CR, RCC_CR_HSIKERON);
- }
- /**
- * @brief Disable HSI in stop mode
- * @rmtoll CR HSIKERON LL_RCC_HSI_DisableInStopMode
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_HSI_DisableInStopMode(void)
- {
- CLEAR_BIT(RCC->CR, RCC_CR_HSIKERON);
- }
- /**
- * @brief Check if HSI in stop mode is enabled
- * @rmtoll CR HSIKERON LL_RCC_HSI_IsEnabledInStopMode
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_RCC_HSI_IsEnabledInStopMode(void)
- {
- return ((READ_BIT(RCC->CR, RCC_CR_HSIKERON) == (RCC_CR_HSIKERON)) ? 1UL : 0UL);
- }
- /**
- * @brief Enable HSI oscillator
- * @rmtoll CR HSION LL_RCC_HSI_Enable
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_HSI_Enable(void)
- {
- SET_BIT(RCC->CR, RCC_CR_HSION);
- }
- /**
- * @brief Disable HSI oscillator
- * @rmtoll CR HSION LL_RCC_HSI_Disable
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_HSI_Disable(void)
- {
- CLEAR_BIT(RCC->CR, RCC_CR_HSION);
- }
- /**
- * @brief Check if HSI clock is ready
- * @rmtoll CR HSIRDY LL_RCC_HSI_IsReady
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_RCC_HSI_IsReady(void)
- {
- return ((READ_BIT(RCC->CR, RCC_CR_HSIRDY) == (RCC_CR_HSIRDY)) ? 1UL : 0UL);
- }
- /**
- * @brief Get HSI Calibration value
- * @note When HSITRIM is written, HSICAL is updated with the sum of
- * HSITRIM and the factory trim value
- * @rmtoll ICSCR HSICAL LL_RCC_HSI_GetCalibration
- * @retval Between Min_Data = 0x00 and Max_Data = 0xFF
- */
- __STATIC_INLINE uint32_t LL_RCC_HSI_GetCalibration(void)
- {
- return (uint32_t)(READ_BIT(RCC->ICSCR, RCC_ICSCR_HSICAL) >> RCC_ICSCR_HSICAL_Pos);
- }
- /**
- * @brief Set HSI Calibration trimming
- * @note user-programmable trimming value that is added to the HSICAL
- * @note Default value is 64, which, when added to the HSICAL value,
- * should trim the HSI to 16 MHz +/- 1 %
- * @rmtoll ICSCR HSITRIM LL_RCC_HSI_SetCalibTrimming
- * @param Value Between Min_Data = 0 and Max_Data = 127
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_HSI_SetCalibTrimming(uint32_t Value)
- {
- MODIFY_REG(RCC->ICSCR, RCC_ICSCR_HSITRIM, Value << RCC_ICSCR_HSITRIM_Pos);
- }
- /**
- * @brief Get HSI Calibration trimming
- * @rmtoll ICSCR HSITRIM LL_RCC_HSI_GetCalibTrimming
- * @retval Between Min_Data = 0 and Max_Data = 127
- */
- __STATIC_INLINE uint32_t LL_RCC_HSI_GetCalibTrimming(void)
- {
- return (uint32_t)(READ_BIT(RCC->ICSCR, RCC_ICSCR_HSITRIM) >> RCC_ICSCR_HSITRIM_Pos);
- }
- /**
- * @}
- */
- #if defined(RCC_HSI48_SUPPORT)
- /** @defgroup RCC_LL_EF_HSI48 HSI48
- * @{
- */
- /**
- * @brief Enable HSI48
- * @rmtoll CR HSI48ON LL_RCC_HSI48_Enable
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_HSI48_Enable(void)
- {
- SET_BIT(RCC->CR, RCC_CR_HSI48ON);
- }
- /**
- * @brief Disable HSI48
- * @rmtoll CR HSI48ON LL_RCC_HSI48_Disable
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_HSI48_Disable(void)
- {
- CLEAR_BIT(RCC->CR, RCC_CR_HSI48ON);
- }
- /**
- * @brief Check if HSI48 oscillator Ready
- * @rmtoll CR HSI48RDY LL_RCC_HSI48_IsReady
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_RCC_HSI48_IsReady(void)
- {
- return ((READ_BIT(RCC->CR, RCC_CR_HSI48RDY) == RCC_CR_HSI48RDY) ? 1UL : 0UL);
- }
- /**
- * @brief Get HSI48 Calibration value
- * @rmtoll CRRCR HSI48CAL LL_RCC_HSI48_GetCalibration
- * @retval Between Min_Data = 0x00 and Max_Data = 0x1FF
- */
- __STATIC_INLINE uint32_t LL_RCC_HSI48_GetCalibration(void)
- {
- return (uint32_t)(READ_BIT(RCC->CRRCR, RCC_CRRCR_HSI48CAL) >> RCC_CRRCR_HSI48CAL_Pos);
- }
- /**
- * @}
- */
- #endif /* RCC_HSI48_SUPPORT */
- /** @defgroup RCC_LL_EF_LSE LSE
- * @{
- */
- /**
- * @brief Enable Low Speed External (LSE) crystal.
- * @rmtoll BDCR LSEON LL_RCC_LSE_Enable
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_LSE_Enable(void)
- {
- SET_BIT(RCC->BDCR, RCC_BDCR_LSEON);
- }
- /**
- * @brief Disable Low Speed External (LSE) crystal.
- * @rmtoll BDCR LSEON LL_RCC_LSE_Disable
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_LSE_Disable(void)
- {
- CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEON);
- }
- /**
- * @brief Enable external clock source (LSE bypass).
- * @rmtoll BDCR LSEBYP LL_RCC_LSE_EnableBypass
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_LSE_EnableBypass(void)
- {
- SET_BIT(RCC->BDCR, RCC_BDCR_LSEBYP);
- }
- /**
- * @brief Disable external clock source (LSE bypass).
- * @rmtoll BDCR LSEBYP LL_RCC_LSE_DisableBypass
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_LSE_DisableBypass(void)
- {
- CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEBYP);
- }
- /**
- * @brief Set LSE oscillator drive capability
- * @note The oscillator is in Xtal mode when it is not in bypass mode.
- * @rmtoll BDCR LSEDRV LL_RCC_LSE_SetDriveCapability
- * @param LSEDrive This parameter can be one of the following values:
- * @arg @ref LL_RCC_LSEDRIVE_LOW
- * @arg @ref LL_RCC_LSEDRIVE_MEDIUMLOW
- * @arg @ref LL_RCC_LSEDRIVE_MEDIUMHIGH
- * @arg @ref LL_RCC_LSEDRIVE_HIGH
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_LSE_SetDriveCapability(uint32_t LSEDrive)
- {
- MODIFY_REG(RCC->BDCR, RCC_BDCR_LSEDRV, LSEDrive);
- }
- /**
- * @brief Get LSE oscillator drive capability
- * @rmtoll BDCR LSEDRV LL_RCC_LSE_GetDriveCapability
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_RCC_LSEDRIVE_LOW
- * @arg @ref LL_RCC_LSEDRIVE_MEDIUMLOW
- * @arg @ref LL_RCC_LSEDRIVE_MEDIUMHIGH
- * @arg @ref LL_RCC_LSEDRIVE_HIGH
- */
- __STATIC_INLINE uint32_t LL_RCC_LSE_GetDriveCapability(void)
- {
- return (uint32_t)(READ_BIT(RCC->BDCR, RCC_BDCR_LSEDRV));
- }
- /**
- * @brief Enable Clock security system on LSE.
- * @rmtoll BDCR LSECSSON LL_RCC_LSE_EnableCSS
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_LSE_EnableCSS(void)
- {
- SET_BIT(RCC->BDCR, RCC_BDCR_LSECSSON);
- }
- /**
- * @brief Disable Clock security system on LSE.
- * @note Clock security system can be disabled only after a LSE
- * failure detection. In that case it MUST be disabled by software.
- * @rmtoll BDCR LSECSSON LL_RCC_LSE_DisableCSS
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_LSE_DisableCSS(void)
- {
- CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSECSSON);
- }
- /**
- * @brief Check if LSE oscillator Ready
- * @rmtoll BDCR LSERDY LL_RCC_LSE_IsReady
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_RCC_LSE_IsReady(void)
- {
- return ((READ_BIT(RCC->BDCR, RCC_BDCR_LSERDY) == (RCC_BDCR_LSERDY)) ? 1UL : 0UL);
- }
- /**
- * @brief Check if CSS on LSE failure Detection
- * @rmtoll BDCR LSECSSD LL_RCC_LSE_IsCSSDetected
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_RCC_LSE_IsCSSDetected(void)
- {
- return ((READ_BIT(RCC->BDCR, RCC_BDCR_LSECSSD) == (RCC_BDCR_LSECSSD)) ? 1UL : 0UL);
- }
- /**
- * @}
- */
- /** @defgroup RCC_LL_EF_LSI LSI
- * @{
- */
- /**
- * @brief Enable LSI Oscillator
- * @rmtoll CSR LSION LL_RCC_LSI_Enable
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_LSI_Enable(void)
- {
- SET_BIT(RCC->CSR, RCC_CSR_LSION);
- }
- /**
- * @brief Disable LSI Oscillator
- * @rmtoll CSR LSION LL_RCC_LSI_Disable
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_LSI_Disable(void)
- {
- CLEAR_BIT(RCC->CSR, RCC_CSR_LSION);
- }
- /**
- * @brief Check if LSI is Ready
- * @rmtoll CSR LSIRDY LL_RCC_LSI_IsReady
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_RCC_LSI_IsReady(void)
- {
- return ((READ_BIT(RCC->CSR, RCC_CSR_LSIRDY) == (RCC_CSR_LSIRDY)) ? 1UL : 0UL);
- }
- /**
- * @}
- */
- /** @defgroup RCC_LL_EF_LSCO LSCO
- * @{
- */
- /**
- * @brief Enable Low speed clock
- * @rmtoll BDCR LSCOEN LL_RCC_LSCO_Enable
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_LSCO_Enable(void)
- {
- SET_BIT(RCC->BDCR, RCC_BDCR_LSCOEN);
- }
- /**
- * @brief Disable Low speed clock
- * @rmtoll BDCR LSCOEN LL_RCC_LSCO_Disable
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_LSCO_Disable(void)
- {
- CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSCOEN);
- }
- /**
- * @brief Configure Low speed clock selection
- * @rmtoll BDCR LSCOSEL LL_RCC_LSCO_SetSource
- * @param Source This parameter can be one of the following values:
- * @arg @ref LL_RCC_LSCO_CLKSOURCE_LSI
- * @arg @ref LL_RCC_LSCO_CLKSOURCE_LSE
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_LSCO_SetSource(uint32_t Source)
- {
- MODIFY_REG(RCC->BDCR, RCC_BDCR_LSCOSEL, Source);
- }
- /**
- * @brief Get Low speed clock selection
- * @rmtoll BDCR LSCOSEL LL_RCC_LSCO_GetSource
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_RCC_LSCO_CLKSOURCE_LSI
- * @arg @ref LL_RCC_LSCO_CLKSOURCE_LSE
- */
- __STATIC_INLINE uint32_t LL_RCC_LSCO_GetSource(void)
- {
- return (uint32_t)(READ_BIT(RCC->BDCR, RCC_BDCR_LSCOSEL));
- }
- /**
- * @}
- */
- /** @defgroup RCC_LL_EF_System System
- * @{
- */
- /**
- * @brief Configure the system clock source
- * @rmtoll CFGR SW LL_RCC_SetSysClkSource
- * @param Source This parameter can be one of the following values:
- * @arg @ref LL_RCC_SYS_CLKSOURCE_HSI
- * @arg @ref LL_RCC_SYS_CLKSOURCE_HSE
- * @arg @ref LL_RCC_SYS_CLKSOURCE_PLL
- * @arg @ref LL_RCC_SYS_CLKSOURCE_LSI
- * @arg @ref LL_RCC_SYS_CLKSOURCE_LSE
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_SetSysClkSource(uint32_t Source)
- {
- MODIFY_REG(RCC->CFGR, RCC_CFGR_SW, Source);
- }
- /**
- * @brief Get the system clock source
- * @rmtoll CFGR SWS LL_RCC_GetSysClkSource
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_RCC_SYS_CLKSOURCE_STATUS_HSI
- * @arg @ref LL_RCC_SYS_CLKSOURCE_STATUS_HSE
- * @arg @ref LL_RCC_SYS_CLKSOURCE_STATUS_PLL
- * @arg @ref LL_RCC_SYS_CLKSOURCE_STATUS_LSI
- * @arg @ref LL_RCC_SYS_CLKSOURCE_STATUS_LSE
- */
- __STATIC_INLINE uint32_t LL_RCC_GetSysClkSource(void)
- {
- return (uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_SWS));
- }
- /**
- * @brief Set AHB prescaler
- * @rmtoll CFGR HPRE LL_RCC_SetAHBPrescaler
- * @param Prescaler This parameter can be one of the following values:
- * @arg @ref LL_RCC_SYSCLK_DIV_1
- * @arg @ref LL_RCC_SYSCLK_DIV_2
- * @arg @ref LL_RCC_SYSCLK_DIV_4
- * @arg @ref LL_RCC_SYSCLK_DIV_8
- * @arg @ref LL_RCC_SYSCLK_DIV_16
- * @arg @ref LL_RCC_SYSCLK_DIV_64
- * @arg @ref LL_RCC_SYSCLK_DIV_128
- * @arg @ref LL_RCC_SYSCLK_DIV_256
- * @arg @ref LL_RCC_SYSCLK_DIV_512
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_SetAHBPrescaler(uint32_t Prescaler)
- {
- MODIFY_REG(RCC->CFGR, RCC_CFGR_HPRE, Prescaler);
- }
- /**
- * @brief Set APB1 prescaler
- * @rmtoll CFGR PPRE LL_RCC_SetAPB1Prescaler
- * @param Prescaler This parameter can be one of the following values:
- * @arg @ref LL_RCC_APB1_DIV_1
- * @arg @ref LL_RCC_APB1_DIV_2
- * @arg @ref LL_RCC_APB1_DIV_4
- * @arg @ref LL_RCC_APB1_DIV_8
- * @arg @ref LL_RCC_APB1_DIV_16
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_SetAPB1Prescaler(uint32_t Prescaler)
- {
- MODIFY_REG(RCC->CFGR, RCC_CFGR_PPRE, Prescaler);
- }
- /**
- * @brief Set HSI16 division factor
- * @rmtoll CR HSIDIV LL_RCC_SetHSIDiv
- * @note HSIDIV parameter is only applied to SYSCLK_Frequency when HSI is used as
- * system clock source.
- * @param HSIDiv This parameter can be one of the following values:
- * @arg @ref LL_RCC_HSI_DIV_1
- * @arg @ref LL_RCC_HSI_DIV_2
- * @arg @ref LL_RCC_HSI_DIV_4
- * @arg @ref LL_RCC_HSI_DIV_8
- * @arg @ref LL_RCC_HSI_DIV_16
- * @arg @ref LL_RCC_HSI_DIV_32
- * @arg @ref LL_RCC_HSI_DIV_64
- * @arg @ref LL_RCC_HSI_DIV_128
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_SetHSIDiv(uint32_t HSIDiv)
- {
- MODIFY_REG(RCC->CR, RCC_CR_HSIDIV, HSIDiv);
- }
- /**
- * @brief Get AHB prescaler
- * @rmtoll CFGR HPRE LL_RCC_GetAHBPrescaler
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_RCC_SYSCLK_DIV_1
- * @arg @ref LL_RCC_SYSCLK_DIV_2
- * @arg @ref LL_RCC_SYSCLK_DIV_4
- * @arg @ref LL_RCC_SYSCLK_DIV_8
- * @arg @ref LL_RCC_SYSCLK_DIV_16
- * @arg @ref LL_RCC_SYSCLK_DIV_64
- * @arg @ref LL_RCC_SYSCLK_DIV_128
- * @arg @ref LL_RCC_SYSCLK_DIV_256
- * @arg @ref LL_RCC_SYSCLK_DIV_512
- */
- __STATIC_INLINE uint32_t LL_RCC_GetAHBPrescaler(void)
- {
- return (uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_HPRE));
- }
- /**
- * @brief Get APB1 prescaler
- * @rmtoll CFGR PPRE LL_RCC_GetAPB1Prescaler
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_RCC_APB1_DIV_1
- * @arg @ref LL_RCC_APB1_DIV_2
- * @arg @ref LL_RCC_APB1_DIV_4
- * @arg @ref LL_RCC_APB1_DIV_8
- * @arg @ref LL_RCC_APB1_DIV_16
- */
- __STATIC_INLINE uint32_t LL_RCC_GetAPB1Prescaler(void)
- {
- return (uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_PPRE));
- }
- /**
- * @brief Get HSI16 Division factor
- * @rmtoll CR HSIDIV LL_RCC_GetHSIDiv
- * @note HSIDIV parameter is only applied to SYSCLK_Frequency when HSI is used as
- * system clock source.
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_RCC_HSI_DIV_1
- * @arg @ref LL_RCC_HSI_DIV_2
- * @arg @ref LL_RCC_HSI_DIV_4
- * @arg @ref LL_RCC_HSI_DIV_8
- * @arg @ref LL_RCC_HSI_DIV_16
- * @arg @ref LL_RCC_HSI_DIV_32
- * @arg @ref LL_RCC_HSI_DIV_64
- * @arg @ref LL_RCC_HSI_DIV_128
- */
- __STATIC_INLINE uint32_t LL_RCC_GetHSIDiv(void)
- {
- return (uint32_t)(READ_BIT(RCC->CR, RCC_CR_HSIDIV));
- }
- /**
- * @}
- */
- /** @defgroup RCC_LL_EF_MCO1 MCO1
- * @{
- */
- /**
- * @brief Configure MCOx
- * @rmtoll CFGR MCOSEL LL_RCC_ConfigMCO\n
- * CFGR MCOPRE LL_RCC_ConfigMCO
- * @param MCOxSource This parameter can be one of the following values:
- * @arg @ref LL_RCC_MCO1SOURCE_NOCLOCK
- * @arg @ref LL_RCC_MCO1SOURCE_SYSCLK
- * @arg @ref LL_RCC_MCO1SOURCE_HSI
- * @arg @ref LL_RCC_MCO1SOURCE_HSI48 (*)
- * @arg @ref LL_RCC_MCO1SOURCE_HSE
- * @arg @ref LL_RCC_MCO1SOURCE_PLLCLK
- * @arg @ref LL_RCC_MCO1SOURCE_LSI
- * @arg @ref LL_RCC_MCO1SOURCE_LSE
- * @arg @ref LL_RCC_MCO1SOURCE_PLLPCLK (*)
- * @arg @ref LL_RCC_MCO1SOURCE_PLLQCLK (*)
- * @arg @ref LL_RCC_MCO1SOURCE_RTCCLK (*)
- * @arg @ref LL_RCC_MCO1SOURCE_RTC_WKUP (*)
- *
- * (*) value not defined in all devices.
- * @param MCOxPrescaler This parameter can be one of the following values:
- * @arg @ref LL_RCC_MCO1_DIV_1
- * @arg @ref LL_RCC_MCO1_DIV_2
- * @arg @ref LL_RCC_MCO1_DIV_4
- * @arg @ref LL_RCC_MCO1_DIV_8
- * @arg @ref LL_RCC_MCO1_DIV_32
- * @arg @ref LL_RCC_MCO1_DIV_64
- * @arg @ref LL_RCC_MCO1_DIV_128
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_ConfigMCO(uint32_t MCOxSource, uint32_t MCOxPrescaler)
- {
- MODIFY_REG(RCC->CFGR, RCC_CFGR_MCOSEL | RCC_CFGR_MCOPRE, MCOxSource | MCOxPrescaler);
- }
- /**
- * @}
- */
- #if defined(RCC_MCO2_SUPPORT)
- /** @defgroup RCC_LL_EF_MCO2 MCO2
- * @{
- */
- /**
- * @brief Configure MCO2
- * @rmtoll CFGR MCO2SEL LL_RCC_ConfigMCO2\n
- * CFGR MCO2PRE LL_RCC_ConfigMCO2
- * @note feature not available in all devices.
- * @param MCOxSource This parameter can be one of the following values:
- * @arg @ref LL_RCC_MCO2SOURCE_NOCLOCK
- * @arg @ref LL_RCC_MCO2SOURCE_SYSCLK
- * @arg @ref LL_RCC_MCO2SOURCE_HSI
- * @arg @ref LL_RCC_MCO2SOURCE_HSI48
- * @arg @ref LL_RCC_MCO2SOURCE_HSE
- * @arg @ref LL_RCC_MCO2SOURCE_PLLCLK
- * @arg @ref LL_RCC_MCO2SOURCE_LSI
- * @arg @ref LL_RCC_MCO2SOURCE_LSE
- * @arg @ref LL_RCC_MCO2SOURCE_PLLPCLK
- * @arg @ref LL_RCC_MCO2SOURCE_PLLQCLK
- * @arg @ref LL_RCC_MCO2SOURCE_RTCCLK
- * @arg @ref LL_RCC_MCO2SOURCE_RTC_WKUP
- *
- * @param MCOxPrescaler This parameter can be one of the following values:
- * @arg @ref LL_RCC_MCO2_DIV_1
- * @arg @ref LL_RCC_MCO2_DIV_2
- * @arg @ref LL_RCC_MCO2_DIV_4
- * @arg @ref LL_RCC_MCO2_DIV_8
- * @arg @ref LL_RCC_MCO2_DIV_16
- * @arg @ref LL_RCC_MCO2_DIV_32
- * @arg @ref LL_RCC_MCO2_DIV_64
- * @arg @ref LL_RCC_MCO2_DIV_128
- * @arg @ref LL_RCC_MCO2_DIV_256
- * @arg @ref LL_RCC_MCO2_DIV_512
- * @arg @ref LL_RCC_MCO2_DIV_1024
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_ConfigMCO2(uint32_t MCOxSource, uint32_t MCOxPrescaler)
- {
- MODIFY_REG(RCC->CFGR, RCC_CFGR_MCO2SEL | RCC_CFGR_MCO2PRE, MCOxSource | MCOxPrescaler);
- }
- /**
- * @}
- */
- #endif /* RCC_MCO2_SUPPORT */
- /** @defgroup RCC_LL_EF_Peripheral_Clock_Source Peripheral Clock Source
- * @{
- */
- /**
- * @brief Configure USARTx clock source
- * @rmtoll CCIPR USARTxSEL LL_RCC_SetUSARTClockSource
- * @param USARTxSource This parameter can be one of the following values:
- * @arg @ref LL_RCC_USART1_CLKSOURCE_PCLK1
- * @arg @ref LL_RCC_USART1_CLKSOURCE_SYSCLK
- * @arg @ref LL_RCC_USART1_CLKSOURCE_HSI
- * @arg @ref LL_RCC_USART1_CLKSOURCE_LSE
- * @arg @ref LL_RCC_USART2_CLKSOURCE_PCLK1
- * @arg @ref LL_RCC_USART2_CLKSOURCE_SYSCLK
- * @arg @ref LL_RCC_USART2_CLKSOURCE_HSI
- * @arg @ref LL_RCC_USART2_CLKSOURCE_LSE
- * @arg @ref LL_RCC_USART3_CLKSOURCE_PCLK1 (*)
- * @arg @ref LL_RCC_USART3_CLKSOURCE_SYSCLK (*)
- * @arg @ref LL_RCC_USART3_CLKSOURCE_HSI (*)
- * @arg @ref LL_RCC_USART3_CLKSOURCE_LSE (*)
- *
- * (*) value not defined in all devices.
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_SetUSARTClockSource(uint32_t USARTxSource)
- {
- MODIFY_REG(RCC->CCIPR, (USARTxSource >> 16U), (USARTxSource & 0x0000FFFFU));
- }
- #if defined(LPUART1)
- /**
- * @brief Configure LPUARTx clock source
- * @rmtoll CCIPR LPUART1SEL LL_RCC_SetLPUARTClockSource
- * @rmtoll CCIPR LPUART2SEL LL_RCC_SetLPUARTClockSource
- * @param LPUARTxSource This parameter can be one of the following values:
- * @arg @ref LL_RCC_LPUART1_CLKSOURCE_PCLK1
- * @arg @ref LL_RCC_LPUART1_CLKSOURCE_SYSCLK
- * @arg @ref LL_RCC_LPUART1_CLKSOURCE_HSI
- * @arg @ref LL_RCC_LPUART1_CLKSOURCE_LSE
- * @arg @ref LL_RCC_LPUART2_CLKSOURCE_PCLK1 (*)
- * @arg @ref LL_RCC_LPUART2_CLKSOURCE_SYSCLK (*)
- * @arg @ref LL_RCC_LPUART2_CLKSOURCE_HSI (*)
- * @arg @ref LL_RCC_LPUART2_CLKSOURCE_LSE (*)
- * (*) feature not available on all devices
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_SetLPUARTClockSource(uint32_t LPUARTxSource)
- {
- MODIFY_REG(RCC->CCIPR, (LPUARTxSource >> 16U), (LPUARTxSource & 0x0000FFFFU));
- }
- #endif /* LPUART1 */
- /**
- * @brief Configure I2Cx clock source
- * @rmtoll CCIPR I2C1SEL LL_RCC_SetI2CClockSource
- * @param I2CxSource This parameter can be one of the following values:
- * @arg @ref LL_RCC_I2C1_CLKSOURCE_PCLK1
- * @arg @ref LL_RCC_I2C1_CLKSOURCE_SYSCLK
- * @arg @ref LL_RCC_I2C1_CLKSOURCE_HSI
- * @arg @ref LL_RCC_I2C2_CLKSOURCE_PCLK1 (*)
- * @arg @ref LL_RCC_I2C2_CLKSOURCE_SYSCLK (*)
- * @arg @ref LL_RCC_I2C2_CLKSOURCE_HSI (*)
- * (*) value not defined in all devices.
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_SetI2CClockSource(uint32_t I2CxSource)
- {
- MODIFY_REG(RCC->CCIPR, (I2CxSource >> 16U), (I2CxSource & 0x0000FFFFU));
- }
- #if defined(RCC_CCIPR_TIM1SEL) || defined(RCC_CCIPR_TIM15SEL)
- /**
- * @brief Configure TIMx clock source
- * @rmtoll CCIPR TIMxSEL LL_RCC_SetTIMClockSource
- * @param TIMxSource This parameter can be one of the following values:
- * @arg @ref LL_RCC_TIM1_CLKSOURCE_PLL
- * @arg @ref LL_RCC_TIM1_CLKSOURCE_PCLK1
- * @if defined(STM32G081xx)
- * @arg @ref LL_RCC_TIM15_CLKSOURCE_PLL
- * @arg @ref LL_RCC_TIM15_CLKSOURCE_PCLK1
- * @endif
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_SetTIMClockSource(uint32_t TIMxSource)
- {
- MODIFY_REG(RCC->CCIPR, (TIMxSource & 0xFFFF0000U), (TIMxSource << 16));
- }
- #endif /* RCC_CCIPR_TIM1SEL && RCC_CCIPR_TIM15SEL */
- #if defined(LPTIM1) && defined(LPTIM2)
- /**
- * @brief Configure LPTIMx clock source
- * @rmtoll CCIPR LPTIMxSEL LL_RCC_SetLPTIMClockSource
- * @param LPTIMxSource This parameter can be one of the following values:
- * @arg @ref LL_RCC_LPTIM1_CLKSOURCE_PCLK1
- * @arg @ref LL_RCC_LPTIM1_CLKSOURCE_LSI
- * @arg @ref LL_RCC_LPTIM1_CLKSOURCE_HSI
- * @arg @ref LL_RCC_LPTIM1_CLKSOURCE_LSE
- * @arg @ref LL_RCC_LPTIM2_CLKSOURCE_PCLK1
- * @arg @ref LL_RCC_LPTIM2_CLKSOURCE_LSI
- * @arg @ref LL_RCC_LPTIM2_CLKSOURCE_HSI
- * @arg @ref LL_RCC_LPTIM2_CLKSOURCE_LSE
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_SetLPTIMClockSource(uint32_t LPTIMxSource)
- {
- MODIFY_REG(RCC->CCIPR, (LPTIMxSource & 0xFFFF0000U), (LPTIMxSource << 16U));
- }
- #endif /* LPTIM1 && LPTIM2 */
- #if defined(CEC)
- /**
- * @brief Configure CEC clock source
- * @rmtoll CCIPR CECSEL LL_RCC_SetCECClockSource
- * @param CECxSource This parameter can be one of the following values:
- * @arg @ref LL_RCC_CEC_CLKSOURCE_HSI_DIV488
- * @arg @ref LL_RCC_CEC_CLKSOURCE_LSE
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_SetCECClockSource(uint32_t CECxSource)
- {
- MODIFY_REG(RCC->CCIPR, RCC_CCIPR_CECSEL, CECxSource);
- }
- #endif /* CEC */
- #if defined(RCC_CCIPR_RNGDIV)
- /**
- * @brief Configure RNG division factor
- * @rmtoll CCIPR RNGDIV LL_RCC_SetRNGClockDiv
- * @param RNGxDiv This parameter can be one of the following values:
- * @arg @ref LL_RCC_RNG_CLK_DIV1
- * @arg @ref LL_RCC_RNG_CLK_DIV2
- * @arg @ref LL_RCC_RNG_CLK_DIV4
- * @arg @ref LL_RCC_RNG_CLK_DIV8
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_SetRNGClockDiv(uint32_t RNGxDiv)
- {
- MODIFY_REG(RCC->CCIPR, RCC_CCIPR_RNGDIV, RNGxDiv);
- }
- #endif /* RNG */
- #if defined (RCC_CCIPR_RNGSEL)
- /**
- * @brief Configure RNG clock source
- * @rmtoll CCIPR RNGSEL LL_RCC_SetRNGClockSource
- * @param RNGxSource This parameter can be one of the following values:
- * @arg @ref LL_RCC_RNG_CLKSOURCE_NONE
- * @arg @ref LL_RCC_RNG_CLKSOURCE_HSI_DIV8
- * @arg @ref LL_RCC_RNG_CLKSOURCE_SYSCLK
- * @arg @ref LL_RCC_RNG_CLKSOURCE_PLL
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_SetRNGClockSource(uint32_t RNGxSource)
- {
- MODIFY_REG(RCC->CCIPR, RCC_CCIPR_RNGSEL, RNGxSource);
- }
- #endif /* RNG */
- #if defined(STM32G0C1xx) || defined(STM32G0B1xx) || defined(STM32G0B0xx)
- /**
- * @brief Configure USB clock source
- * @rmtoll CCIPR2 CK48MSEL LL_RCC_SetUSBClockSource
- * @param USBxSource This parameter can be one of the following values:
- * @arg @ref LL_RCC_USB_CLKSOURCE_HSI48
- * @arg @ref LL_RCC_USB_CLKSOURCE_HSE
- * @arg @ref LL_RCC_USB_CLKSOURCE_PLL
- *
- * (*) value not defined in all devices.
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_SetUSBClockSource(uint32_t USBxSource)
- {
- MODIFY_REG(RCC->CCIPR2, RCC_CCIPR2_USBSEL, USBxSource);
- }
- #endif /* STM32G0C1xx || STM32G0B1xx || STM32G0B0xx */
- #if defined (FDCAN1) || defined (FDCAN2)
- /**
- * @brief Configure FDCAN clock source
- * @rmtoll CCIPR2 FDCANSEL LL_RCC_SetFDCANClockSource
- * @param FDCANxSource This parameter can be one of the following values:
- * @arg @ref LL_RCC_FDCAN_CLKSOURCE_HSE
- * @arg @ref LL_RCC_FDCAN_CLKSOURCE_PCLK1
- * @arg @ref LL_RCC_FDCAN_CLKSOURCE_PLL
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_SetFDCANClockSource(uint32_t FDCANxSource)
- {
- MODIFY_REG(RCC->CCIPR2, RCC_CCIPR2_FDCANSEL, FDCANxSource);
- }
- #endif /* FDCAN1 || FDCAN2 */
- /**
- * @brief Configure ADC clock source
- * @rmtoll CCIPR ADCSEL LL_RCC_SetADCClockSource
- * @param ADCxSource This parameter can be one of the following values:
- * @arg @ref LL_RCC_ADC_CLKSOURCE_PLL
- * @arg @ref LL_RCC_ADC_CLKSOURCE_SYSCLK
- * @arg @ref LL_RCC_ADC_CLKSOURCE_HSI
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_SetADCClockSource(uint32_t ADCxSource)
- {
- MODIFY_REG(RCC->CCIPR, RCC_CCIPR_ADCSEL, ADCxSource);
- }
- #if defined(STM32G0C1xx) || defined(STM32G0B1xx) || defined(STM32G0B0xx)
- /**
- * @brief Configure I2Sx clock source
- * @rmtoll CCIPR2 I2SxSEL LL_RCC_SetI2SClockSource
- * @param I2SxSource This parameter can be one of the following values:
- * @arg @ref LL_RCC_I2S1_CLKSOURCE_SYSCLK
- * @arg @ref LL_RCC_I2S1_CLKSOURCE_PIN
- * @arg @ref LL_RCC_I2S1_CLKSOURCE_PLL
- * @arg @ref LL_RCC_I2S1_CLKSOURCE_HSI
- * @arg @ref LL_RCC_I2S2_CLKSOURCE_SYSCLK
- * @arg @ref LL_RCC_I2S2_CLKSOURCE_PIN
- * @arg @ref LL_RCC_I2S2_CLKSOURCE_PLL
- * @arg @ref LL_RCC_I2S2_CLKSOURCE_HSI
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_SetI2SClockSource(uint32_t I2SxSource)
- {
- MODIFY_REG(RCC->CCIPR2, (I2SxSource >> 16U), (I2SxSource & 0x0000FFFFU));
- }
- #else
- /**
- * @brief Configure I2Sx clock source
- * @rmtoll CCIPR I2S1SEL LL_RCC_SetI2SClockSource
- * @param I2SxSource This parameter can be one of the following values:
- * @arg @ref LL_RCC_I2S1_CLKSOURCE_SYSCLK
- * @arg @ref LL_RCC_I2S1_CLKSOURCE_PIN
- * @arg @ref LL_RCC_I2S1_CLKSOURCE_PLL
- * @arg @ref LL_RCC_I2S1_CLKSOURCE_HSI
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_SetI2SClockSource(uint32_t I2SxSource)
- {
- MODIFY_REG(RCC->CCIPR, RCC_CCIPR_I2S1SEL, I2SxSource);
- }
- #endif /* STM32G0C1xx || STM32G0B1xx || STM32G0B0xx */
- /**
- * @brief Get USARTx clock source
- * @rmtoll CCIPR USARTxSEL LL_RCC_GetUSARTClockSource
- * @param USARTx This parameter can be one of the following values:
- * @arg @ref LL_RCC_USART1_CLKSOURCE
- * @arg @ref LL_RCC_USART2_CLKSOURCE
- * @arg @ref LL_RCC_USART3_CLKSOURCE (*)
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_RCC_USART1_CLKSOURCE_PCLK1
- * @arg @ref LL_RCC_USART1_CLKSOURCE_SYSCLK
- * @arg @ref LL_RCC_USART1_CLKSOURCE_HSI
- * @arg @ref LL_RCC_USART1_CLKSOURCE_LSE
- * @arg @ref LL_RCC_USART2_CLKSOURCE_PCLK1
- * @arg @ref LL_RCC_USART2_CLKSOURCE_SYSCLK
- * @arg @ref LL_RCC_USART2_CLKSOURCE_HSI
- * @arg @ref LL_RCC_USART2_CLKSOURCE_LSE
- * @arg @ref LL_RCC_USART3_CLKSOURCE_PCLK1 (*)
- * @arg @ref LL_RCC_USART3_CLKSOURCE_SYSCLK (*)
- * @arg @ref LL_RCC_USART3_CLKSOURCE_HSI (*)
- * @arg @ref LL_RCC_USART3_CLKSOURCE_LSE (*)
- * (*) feature not available on all devices
- */
- __STATIC_INLINE uint32_t LL_RCC_GetUSARTClockSource(uint32_t USARTx)
- {
- return (uint32_t)(READ_BIT(RCC->CCIPR, USARTx) | (USARTx << 16U));
- }
- #if defined (LPUART2) || defined (LPUART1)
- /**
- * @brief Get LPUARTx clock source
- * @rmtoll CCIPR LPUART1SEL LL_RCC_GetLPUARTClockSource\n
- * CCIPR LPUART2SEL LL_RCC_GetLPUARTClockSource
- * @param LPUARTx This parameter can be one of the following values:
- * @arg @ref LL_RCC_LPUART1_CLKSOURCE
- * @arg @ref LL_RCC_LPUART2_CLKSOURCE (*)
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_RCC_LPUART1_CLKSOURCE_PCLK1
- * @arg @ref LL_RCC_LPUART1_CLKSOURCE_SYSCLK
- * @arg @ref LL_RCC_LPUART1_CLKSOURCE_HSI
- * @arg @ref LL_RCC_LPUART1_CLKSOURCE_LSE
- * @arg @ref LL_RCC_LPUART2_CLKSOURCE_PCLK1 (*)
- * @arg @ref LL_RCC_LPUART2_CLKSOURCE_SYSCLK (*)
- * @arg @ref LL_RCC_LPUART2_CLKSOURCE_HSI (*)
- * @arg @ref LL_RCC_LPUART2_CLKSOURCE_LSE (*)
- * (*) feature not available on all devices
- */
- __STATIC_INLINE uint32_t LL_RCC_GetLPUARTClockSource(uint32_t LPUARTx)
- {
- return (uint32_t)(READ_BIT(RCC->CCIPR, LPUARTx) | (LPUARTx << 16U));
- }
- #endif /* LPUART2 || LPUART1 */
- /**
- * @brief Get I2Cx clock source
- * @rmtoll CCIPR I2C1SEL LL_RCC_GetI2CClockSource\n
- * CCIPR I2C2SEL LL_RCC_GetI2CClockSource
- * @param I2Cx This parameter can be one of the following values:
- * @arg @ref LL_RCC_I2C1_CLKSOURCE
- * @arg @ref LL_RCC_I2C2_CLKSOURCE
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_RCC_I2C1_CLKSOURCE_PCLK1
- * @arg @ref LL_RCC_I2C1_CLKSOURCE_SYSCLK
- * @arg @ref LL_RCC_I2C1_CLKSOURCE_HSI
- * @arg @ref LL_RCC_I2C2_CLKSOURCE_PCLK1
- * @arg @ref LL_RCC_I2C2_CLKSOURCE_SYSCLK
- * @arg @ref LL_RCC_I2C2_CLKSOURCE_HSI
- */
- __STATIC_INLINE uint32_t LL_RCC_GetI2CClockSource(uint32_t I2Cx)
- {
- return (uint32_t)(READ_BIT(RCC->CCIPR, I2Cx) | (I2Cx << 16U));
- }
- #if defined(RCC_CCIPR_TIM1SEL) || defined(RCC_CCIPR_TIM15SEL)
- /**
- * @brief Get TIMx clock source
- * @rmtoll CCIPR TIMxSEL LL_RCC_GetTIMClockSource
- * @param TIMx This parameter can be one of the following values:
- * @arg @ref LL_RCC_TIM1_CLKSOURCE
- * @arg @ref LL_RCC_TIM15_CLKSOURCE
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_RCC_TIM1_CLKSOURCE_PLL
- * @arg @ref LL_RCC_TIM1_CLKSOURCE_PCLK1
- * @if defined(STM32G081xx)
- * @arg @ref LL_RCC_TIM15_CLKSOURCE_PLL
- * @arg @ref LL_RCC_TIM15_CLKSOURCE_PCLK1
- * @endif
- */
- __STATIC_INLINE uint32_t LL_RCC_GetTIMClockSource(uint32_t TIMx)
- {
- return (uint32_t)((READ_BIT(RCC->CCIPR, TIMx) >> 16U) | TIMx);
- }
- #endif /* RCC_CCIPR_TIM1SEL || RCC_CCIPR_TIM15SEL */
- #if defined(LPTIM1) && defined(LPTIM2)
- /**
- * @brief Get LPTIMx clock source
- * @rmtoll CCIPR LPTIM1SEL LL_RCC_GetLPTIMClockSource\n
- CCIPR LPTIM2SEL LL_RCC_GetLPTIMClockSource
- * @param LPTIMx This parameter can be one of the following values:
- * @arg @ref LL_RCC_LPTIM1_CLKSOURCE
- * @arg @ref LL_RCC_LPTIM2_CLKSOURCE
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_RCC_LPTIM1_CLKSOURCE_PCLK1
- * @arg @ref LL_RCC_LPTIM1_CLKSOURCE_LSI
- * @arg @ref LL_RCC_LPTIM1_CLKSOURCE_HSI
- * @arg @ref LL_RCC_LPTIM1_CLKSOURCE_LSE
- * @arg @ref LL_RCC_LPTIM2_CLKSOURCE_PCLK1
- * @arg @ref LL_RCC_LPTIM2_CLKSOURCE_LSI
- * @arg @ref LL_RCC_LPTIM2_CLKSOURCE_HSI
- * @arg @ref LL_RCC_LPTIM2_CLKSOURCE_LSE
- */
- __STATIC_INLINE uint32_t LL_RCC_GetLPTIMClockSource(uint32_t LPTIMx)
- {
- return (uint32_t)((READ_BIT(RCC->CCIPR, LPTIMx) >> 16U) | LPTIMx);
- }
- #endif /* LPTIM1 && LPTIM2 */
- #if defined (RCC_CCIPR_CECSEL)
- /**
- * @brief Get CEC clock source
- * @rmtoll CCIPR CECSEL LL_RCC_GetCECClockSource
- * @param CECx This parameter can be one of the following values:
- * @arg @ref LL_RCC_CEC_CLKSOURCE
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_RCC_CEC_CLKSOURCE_HSI_DIV488
- * @arg @ref LL_RCC_CEC_CLKSOURCE_LSE
- */
- __STATIC_INLINE uint32_t LL_RCC_GetCECClockSource(uint32_t CECx)
- {
- return (uint32_t)(READ_BIT(RCC->CCIPR, CECx));
- }
- #endif /* CEC */
- #if defined(RCC_CCIPR2_FDCANSEL)
- /**
- * @brief Get FDCAN clock source
- * @rmtoll CCIPR2 FDCANSEL LL_RCC_GetFDCANClockSource
- * @param FDCANx This parameter can be one of the following values:
- * @arg @ref LL_RCC_FDCAN_CLKSOURCE
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_RCC_FDCAN_CLKSOURCE_PCLK1
- * @arg @ref LL_RCC_FDCAN_CLKSOURCE_HSE
- */
- __STATIC_INLINE uint32_t LL_RCC_GetFDCANClockSource(uint32_t FDCANx)
- {
- return (uint32_t)(READ_BIT(RCC->CCIPR2, FDCANx));
- }
- #endif /* RCC_CCIPR2_FDCANSEL */
- #if defined(RNG)
- /**
- * @brief Get RNGx clock source
- * @rmtoll CCIPR RNGSEL LL_RCC_GetRNGClockSource
- * @param RNGx This parameter can be one of the following values:
- * @arg @ref LL_RCC_RNG_CLKSOURCE
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_RCC_RNG_CLKSOURCE_NONE
- * @arg @ref LL_RCC_RNG_CLKSOURCE_HSI_DIV8
- * @arg @ref LL_RCC_RNG_CLKSOURCE_SYSCLK
- * @arg @ref LL_RCC_RNG_CLKSOURCE_PLL
- */
- __STATIC_INLINE uint32_t LL_RCC_GetRNGClockSource(uint32_t RNGx)
- {
- return (uint32_t)(READ_BIT(RCC->CCIPR, RNGx));
- }
- #endif /* RNG */
- #if defined(RNG)
- /**
- * @brief Get RNGx clock division factor
- * @rmtoll CCIPR RNGDIV LL_RCC_GetRNGClockDiv
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_RCC_RNG_CLK_DIV1
- * @arg @ref LL_RCC_RNG_CLK_DIV2
- * @arg @ref LL_RCC_RNG_CLK_DIV4
- * @arg @ref LL_RCC_RNG_CLK_DIV8
- */
- __STATIC_INLINE uint32_t LL_RCC_GetRNGClockDiv(void)
- {
- return (uint32_t)(READ_BIT(RCC->CCIPR, RCC_CCIPR_RNGDIV));
- }
- #endif /* RNG */
- #if defined(STM32G0C1xx) || defined(STM32G0B1xx) || defined(STM32G0B0xx)
- /**
- * @brief Get USBx clock source
- * @rmtoll CCIPR2 CK48MSEL LL_RCC_GetUSBClockSource
- * @param USBx This parameter can be one of the following values:
- * @arg @ref LL_RCC_USB_CLKSOURCE
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_RCC_USB_CLKSOURCE_HSI48
- * @arg @ref LL_RCC_USB_CLKSOURCE_PLL
- */
- __STATIC_INLINE uint32_t LL_RCC_GetUSBClockSource(uint32_t USBx)
- {
- return (uint32_t)(READ_BIT(RCC->CCIPR2, USBx));
- }
- #endif /* STM32G0C1xx || STM32G0B1xx || STM32G0B0xx */
- /**
- * @brief Get ADCx clock source
- * @rmtoll CCIPR ADCSEL LL_RCC_GetADCClockSource
- * @param ADCx This parameter can be one of the following values:
- * @arg @ref LL_RCC_ADC_CLKSOURCE
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_RCC_ADC_CLKSOURCE_HSI
- * @arg @ref LL_RCC_ADC_CLKSOURCE_PLL
- * @arg @ref LL_RCC_ADC_CLKSOURCE_SYSCLK
- */
- __STATIC_INLINE uint32_t LL_RCC_GetADCClockSource(uint32_t ADCx)
- {
- return (uint32_t)(READ_BIT(RCC->CCIPR, ADCx));
- }
- #if defined(STM32G0C1xx) || defined(STM32G0B1xx) || defined(STM32G0B0xx)
- /**
- * @brief Get I2Sx clock source
- * @rmtoll CCIPR2 I2S1SEL LL_RCC_GetI2SClockSource\n
- * CCIPR2 I2S2SEL LL_RCC_GetI2SClockSource
- * @param I2Sx This parameter can be one of the following values:
- * @arg @ref LL_RCC_I2S1_CLKSOURCE
- * @arg @ref LL_RCC_I2S2_CLKSOURCE
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_RCC_I2S1_CLKSOURCE_PIN
- * @arg @ref LL_RCC_I2S1_CLKSOURCE_SYSCLK
- * @arg @ref LL_RCC_I2S1_CLKSOURCE_HSI
- * @arg @ref LL_RCC_I2S1_CLKSOURCE_PLL
- * @arg @ref LL_RCC_I2S2_CLKSOURCE_PIN
- * @arg @ref LL_RCC_I2S2_CLKSOURCE_SYSCLK
- * @arg @ref LL_RCC_I2S2_CLKSOURCE_HSI
- * @arg @ref LL_RCC_I2S2_CLKSOURCE_PLL
- */
- __STATIC_INLINE uint32_t LL_RCC_GetI2SClockSource(uint32_t I2Sx)
- {
- return (uint32_t)(READ_BIT(RCC->CCIPR2, I2Sx) | (I2Sx << 16U));
- }
- #else
- /**
- * @brief Get I2Sx clock source
- * @rmtoll CCIPR I2S1SEL LL_RCC_GetI2SClockSource
- * @param I2Sx This parameter can be one of the following values:
- * @arg @ref LL_RCC_I2S1_CLKSOURCE
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_RCC_I2S1_CLKSOURCE_PIN
- * @arg @ref LL_RCC_I2S1_CLKSOURCE_SYSCLK
- * @arg @ref LL_RCC_I2S1_CLKSOURCE_HSI
- * @arg @ref LL_RCC_I2S1_CLKSOURCE_PLL
- */
- __STATIC_INLINE uint32_t LL_RCC_GetI2SClockSource(uint32_t I2Sx)
- {
- return (uint32_t)(READ_BIT(RCC->CCIPR, I2Sx));
- }
- #endif /* STM32G0C1xx || STM32G0B1xx || STM32G0B0xx */
- /**
- * @}
- */
- /** @defgroup RCC_LL_EF_RTC RTC
- * @{
- */
- /**
- * @brief Set RTC Clock Source
- * @note Once the RTC clock source has been selected, it cannot be changed anymore unless
- * the Backup domain is reset, or unless a failure is detected on LSE (LSECSSD is
- * set). The BDRST bit can be used to reset them.
- * @rmtoll BDCR RTCSEL LL_RCC_SetRTCClockSource
- * @param Source This parameter can be one of the following values:
- * @arg @ref LL_RCC_RTC_CLKSOURCE_NONE
- * @arg @ref LL_RCC_RTC_CLKSOURCE_LSE
- * @arg @ref LL_RCC_RTC_CLKSOURCE_LSI
- * @arg @ref LL_RCC_RTC_CLKSOURCE_HSE_DIV32
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_SetRTCClockSource(uint32_t Source)
- {
- MODIFY_REG(RCC->BDCR, RCC_BDCR_RTCSEL, Source);
- }
- /**
- * @brief Get RTC Clock Source
- * @rmtoll BDCR RTCSEL LL_RCC_GetRTCClockSource
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_RCC_RTC_CLKSOURCE_NONE
- * @arg @ref LL_RCC_RTC_CLKSOURCE_LSE
- * @arg @ref LL_RCC_RTC_CLKSOURCE_LSI
- * @arg @ref LL_RCC_RTC_CLKSOURCE_HSE_DIV32
- */
- __STATIC_INLINE uint32_t LL_RCC_GetRTCClockSource(void)
- {
- return (uint32_t)(READ_BIT(RCC->BDCR, RCC_BDCR_RTCSEL));
- }
- /**
- * @brief Enable RTC
- * @rmtoll BDCR RTCEN LL_RCC_EnableRTC
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_EnableRTC(void)
- {
- SET_BIT(RCC->BDCR, RCC_BDCR_RTCEN);
- }
- /**
- * @brief Disable RTC
- * @rmtoll BDCR RTCEN LL_RCC_DisableRTC
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_DisableRTC(void)
- {
- CLEAR_BIT(RCC->BDCR, RCC_BDCR_RTCEN);
- }
- /**
- * @brief Check if RTC has been enabled or not
- * @rmtoll BDCR RTCEN LL_RCC_IsEnabledRTC
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_RCC_IsEnabledRTC(void)
- {
- return ((READ_BIT(RCC->BDCR, RCC_BDCR_RTCEN) == (RCC_BDCR_RTCEN)) ? 1UL : 0UL);
- }
- /**
- * @brief Force the Backup domain reset
- * @rmtoll BDCR BDRST LL_RCC_ForceBackupDomainReset
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_ForceBackupDomainReset(void)
- {
- SET_BIT(RCC->BDCR, RCC_BDCR_BDRST);
- }
- /**
- * @brief Release the Backup domain reset
- * @rmtoll BDCR BDRST LL_RCC_ReleaseBackupDomainReset
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_ReleaseBackupDomainReset(void)
- {
- CLEAR_BIT(RCC->BDCR, RCC_BDCR_BDRST);
- }
- /**
- * @}
- */
- /** @defgroup RCC_LL_EF_PLL PLL
- * @{
- */
- /**
- * @brief Enable PLL
- * @rmtoll CR PLLON LL_RCC_PLL_Enable
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_PLL_Enable(void)
- {
- SET_BIT(RCC->CR, RCC_CR_PLLON);
- }
- /**
- * @brief Disable PLL
- * @note Cannot be disabled if the PLL clock is used as the system clock
- * @rmtoll CR PLLON LL_RCC_PLL_Disable
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_PLL_Disable(void)
- {
- CLEAR_BIT(RCC->CR, RCC_CR_PLLON);
- }
- /**
- * @brief Check if PLL Ready
- * @rmtoll CR PLLRDY LL_RCC_PLL_IsReady
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_RCC_PLL_IsReady(void)
- {
- return ((READ_BIT(RCC->CR, RCC_CR_PLLRDY) == (RCC_CR_PLLRDY)) ? 1UL : 0UL);
- }
- /**
- * @brief Configure PLL used for SYSCLK Domain
- * @note PLL Source and PLLM Divider can be written only when PLL is disabled
- * @note PLLN/PLLR can be written only when PLL is disabled
- * @rmtoll PLLCFGR PLLSRC LL_RCC_PLL_ConfigDomain_SYS\n
- * PLLCFGR PLLM LL_RCC_PLL_ConfigDomain_SYS\n
- * PLLCFGR PLLN LL_RCC_PLL_ConfigDomain_SYS\n
- * PLLCFGR PLLR LL_RCC_PLL_ConfigDomain_SYS
- * @param Source This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLSOURCE_NONE
- * @arg @ref LL_RCC_PLLSOURCE_HSI
- * @arg @ref LL_RCC_PLLSOURCE_HSE
- * @param PLLM This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLM_DIV_1
- * @arg @ref LL_RCC_PLLM_DIV_2
- * @arg @ref LL_RCC_PLLM_DIV_3
- * @arg @ref LL_RCC_PLLM_DIV_4
- * @arg @ref LL_RCC_PLLM_DIV_5
- * @arg @ref LL_RCC_PLLM_DIV_6
- * @arg @ref LL_RCC_PLLM_DIV_7
- * @arg @ref LL_RCC_PLLM_DIV_8
- * @param PLLN Between 8 and 86
- * @param PLLR This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLR_DIV_2
- * @arg @ref LL_RCC_PLLR_DIV_3
- * @arg @ref LL_RCC_PLLR_DIV_4
- * @arg @ref LL_RCC_PLLR_DIV_5
- * @arg @ref LL_RCC_PLLR_DIV_6
- * @arg @ref LL_RCC_PLLR_DIV_7
- * @arg @ref LL_RCC_PLLR_DIV_8
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_PLL_ConfigDomain_SYS(uint32_t Source, uint32_t PLLM, uint32_t PLLN, uint32_t PLLR)
- {
- MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC | RCC_PLLCFGR_PLLM | RCC_PLLCFGR_PLLN | RCC_PLLCFGR_PLLR,
- Source | PLLM | (PLLN << RCC_PLLCFGR_PLLN_Pos) | PLLR);
- }
- /**
- * @brief Configure PLL used for ADC domain clock
- * @note PLL Source and PLLM Divider can be written only when PLL is disabled
- * @note PLLN/PLLP can be written only when PLL is disabled
- * @note User shall verify whether the PLL configuration is not done through
- * other functions (ex: I2S1)
- * @note This can be selected for ADC
- * @rmtoll PLLCFGR PLLSRC LL_RCC_PLL_ConfigDomain_ADC\n
- * PLLCFGR PLLM LL_RCC_PLL_ConfigDomain_ADC\n
- * PLLCFGR PLLN LL_RCC_PLL_ConfigDomain_ADC\n
- * PLLCFGR PLLP LL_RCC_PLL_ConfigDomain_ADC
- * @param Source This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLSOURCE_NONE
- * @arg @ref LL_RCC_PLLSOURCE_HSI
- * @arg @ref LL_RCC_PLLSOURCE_HSE
- * @param PLLM This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLM_DIV_1
- * @arg @ref LL_RCC_PLLM_DIV_2
- * @arg @ref LL_RCC_PLLM_DIV_3
- * @arg @ref LL_RCC_PLLM_DIV_4
- * @arg @ref LL_RCC_PLLM_DIV_5
- * @arg @ref LL_RCC_PLLM_DIV_6
- * @arg @ref LL_RCC_PLLM_DIV_7
- * @arg @ref LL_RCC_PLLM_DIV_8
- * @param PLLN Between 8 and 86
- * @param PLLP This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLP_DIV_2
- * @arg @ref LL_RCC_PLLP_DIV_3
- * @arg @ref LL_RCC_PLLP_DIV_4
- * @arg @ref LL_RCC_PLLP_DIV_5
- * @arg @ref LL_RCC_PLLP_DIV_6
- * @arg @ref LL_RCC_PLLP_DIV_7
- * @arg @ref LL_RCC_PLLP_DIV_8
- * @arg @ref LL_RCC_PLLP_DIV_9
- * @arg @ref LL_RCC_PLLP_DIV_10
- * @arg @ref LL_RCC_PLLP_DIV_11
- * @arg @ref LL_RCC_PLLP_DIV_12
- * @arg @ref LL_RCC_PLLP_DIV_13
- * @arg @ref LL_RCC_PLLP_DIV_14
- * @arg @ref LL_RCC_PLLP_DIV_15
- * @arg @ref LL_RCC_PLLP_DIV_16
- * @arg @ref LL_RCC_PLLP_DIV_17
- * @arg @ref LL_RCC_PLLP_DIV_18
- * @arg @ref LL_RCC_PLLP_DIV_19
- * @arg @ref LL_RCC_PLLP_DIV_20
- * @arg @ref LL_RCC_PLLP_DIV_21
- * @arg @ref LL_RCC_PLLP_DIV_22
- * @arg @ref LL_RCC_PLLP_DIV_23
- * @arg @ref LL_RCC_PLLP_DIV_24
- * @arg @ref LL_RCC_PLLP_DIV_25
- * @arg @ref LL_RCC_PLLP_DIV_26
- * @arg @ref LL_RCC_PLLP_DIV_27
- * @arg @ref LL_RCC_PLLP_DIV_28
- * @arg @ref LL_RCC_PLLP_DIV_29
- * @arg @ref LL_RCC_PLLP_DIV_30
- * @arg @ref LL_RCC_PLLP_DIV_31
- * @arg @ref LL_RCC_PLLP_DIV_32
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_PLL_ConfigDomain_ADC(uint32_t Source, uint32_t PLLM, uint32_t PLLN, uint32_t PLLP)
- {
- MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC | RCC_PLLCFGR_PLLM | RCC_PLLCFGR_PLLN | RCC_PLLCFGR_PLLP,
- Source | PLLM | (PLLN << RCC_PLLCFGR_PLLN_Pos) | PLLP);
- }
- /**
- * @brief Configure PLL used for I2S1 domain clock
- * @note PLL Source and PLLM Divider can be written only when PLL is disabled
- * @note PLLN/PLLP can be written only when PLL is disabled
- * @note User shall verify whether the PLL configuration is not done through
- * other functions (ex: ADC)
- * @note This can be selected for I2S1
- * @rmtoll PLLCFGR PLLSRC LL_RCC_PLL_ConfigDomain_I2S1\n
- * PLLCFGR PLLM LL_RCC_PLL_ConfigDomain_I2S1\n
- * PLLCFGR PLLN LL_RCC_PLL_ConfigDomain_I2S1\n
- * PLLCFGR PLLP LL_RCC_PLL_ConfigDomain_I2S1
- * @param Source This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLSOURCE_NONE
- * @arg @ref LL_RCC_PLLSOURCE_HSI
- * @arg @ref LL_RCC_PLLSOURCE_HSE
- * @param PLLM This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLM_DIV_1
- * @arg @ref LL_RCC_PLLM_DIV_2
- * @arg @ref LL_RCC_PLLM_DIV_3
- * @arg @ref LL_RCC_PLLM_DIV_4
- * @arg @ref LL_RCC_PLLM_DIV_5
- * @arg @ref LL_RCC_PLLM_DIV_6
- * @arg @ref LL_RCC_PLLM_DIV_7
- * @arg @ref LL_RCC_PLLM_DIV_8
- * @param PLLN Between 8 and 86
- * @param PLLP This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLP_DIV_2
- * @arg @ref LL_RCC_PLLP_DIV_3
- * @arg @ref LL_RCC_PLLP_DIV_4
- * @arg @ref LL_RCC_PLLP_DIV_5
- * @arg @ref LL_RCC_PLLP_DIV_6
- * @arg @ref LL_RCC_PLLP_DIV_7
- * @arg @ref LL_RCC_PLLP_DIV_8
- * @arg @ref LL_RCC_PLLP_DIV_9
- * @arg @ref LL_RCC_PLLP_DIV_10
- * @arg @ref LL_RCC_PLLP_DIV_11
- * @arg @ref LL_RCC_PLLP_DIV_12
- * @arg @ref LL_RCC_PLLP_DIV_13
- * @arg @ref LL_RCC_PLLP_DIV_14
- * @arg @ref LL_RCC_PLLP_DIV_15
- * @arg @ref LL_RCC_PLLP_DIV_16
- * @arg @ref LL_RCC_PLLP_DIV_17
- * @arg @ref LL_RCC_PLLP_DIV_18
- * @arg @ref LL_RCC_PLLP_DIV_19
- * @arg @ref LL_RCC_PLLP_DIV_20
- * @arg @ref LL_RCC_PLLP_DIV_21
- * @arg @ref LL_RCC_PLLP_DIV_22
- * @arg @ref LL_RCC_PLLP_DIV_23
- * @arg @ref LL_RCC_PLLP_DIV_24
- * @arg @ref LL_RCC_PLLP_DIV_25
- * @arg @ref LL_RCC_PLLP_DIV_26
- * @arg @ref LL_RCC_PLLP_DIV_27
- * @arg @ref LL_RCC_PLLP_DIV_28
- * @arg @ref LL_RCC_PLLP_DIV_29
- * @arg @ref LL_RCC_PLLP_DIV_30
- * @arg @ref LL_RCC_PLLP_DIV_31
- * @arg @ref LL_RCC_PLLP_DIV_32
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_PLL_ConfigDomain_I2S1(uint32_t Source, uint32_t PLLM, uint32_t PLLN, uint32_t PLLP)
- {
- MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC | RCC_PLLCFGR_PLLM | RCC_PLLCFGR_PLLN | RCC_PLLCFGR_PLLP,
- Source | PLLM | (PLLN << RCC_PLLCFGR_PLLN_Pos) | PLLP);
- }
- #if defined(RCC_CCIPR2_I2S2SEL)
- /**
- * @brief Configure PLL used for I2S2 domain clock
- * @note PLL Source and PLLM Divider can be written only when PLL is disabled
- * @note PLLN/PLLP can be written only when PLL is disabled
- * @note User shall verify whether the PLL configuration is not done through
- * other functions (ex: ADC)
- * @note This can be selected for I2S2
- * @rmtoll PLLCFGR PLLSRC LL_RCC_PLL_ConfigDomain_I2S2\n
- * PLLCFGR PLLM LL_RCC_PLL_ConfigDomain_I2S2\n
- * PLLCFGR PLLN LL_RCC_PLL_ConfigDomain_I2S2\n
- * PLLCFGR PLLP LL_RCC_PLL_ConfigDomain_I2S2
- * @param Source This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLSOURCE_NONE
- * @arg @ref LL_RCC_PLLSOURCE_HSI
- * @arg @ref LL_RCC_PLLSOURCE_HSE
- * @param PLLM This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLM_DIV_1
- * @arg @ref LL_RCC_PLLM_DIV_2
- * @arg @ref LL_RCC_PLLM_DIV_3
- * @arg @ref LL_RCC_PLLM_DIV_4
- * @arg @ref LL_RCC_PLLM_DIV_5
- * @arg @ref LL_RCC_PLLM_DIV_6
- * @arg @ref LL_RCC_PLLM_DIV_7
- * @arg @ref LL_RCC_PLLM_DIV_8
- * @param PLLN Between 8 and 86
- * @param PLLP This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLP_DIV_2
- * @arg @ref LL_RCC_PLLP_DIV_3
- * @arg @ref LL_RCC_PLLP_DIV_4
- * @arg @ref LL_RCC_PLLP_DIV_5
- * @arg @ref LL_RCC_PLLP_DIV_6
- * @arg @ref LL_RCC_PLLP_DIV_7
- * @arg @ref LL_RCC_PLLP_DIV_8
- * @arg @ref LL_RCC_PLLP_DIV_9
- * @arg @ref LL_RCC_PLLP_DIV_10
- * @arg @ref LL_RCC_PLLP_DIV_11
- * @arg @ref LL_RCC_PLLP_DIV_12
- * @arg @ref LL_RCC_PLLP_DIV_13
- * @arg @ref LL_RCC_PLLP_DIV_14
- * @arg @ref LL_RCC_PLLP_DIV_15
- * @arg @ref LL_RCC_PLLP_DIV_16
- * @arg @ref LL_RCC_PLLP_DIV_17
- * @arg @ref LL_RCC_PLLP_DIV_18
- * @arg @ref LL_RCC_PLLP_DIV_19
- * @arg @ref LL_RCC_PLLP_DIV_20
- * @arg @ref LL_RCC_PLLP_DIV_21
- * @arg @ref LL_RCC_PLLP_DIV_22
- * @arg @ref LL_RCC_PLLP_DIV_23
- * @arg @ref LL_RCC_PLLP_DIV_24
- * @arg @ref LL_RCC_PLLP_DIV_25
- * @arg @ref LL_RCC_PLLP_DIV_26
- * @arg @ref LL_RCC_PLLP_DIV_27
- * @arg @ref LL_RCC_PLLP_DIV_28
- * @arg @ref LL_RCC_PLLP_DIV_29
- * @arg @ref LL_RCC_PLLP_DIV_30
- * @arg @ref LL_RCC_PLLP_DIV_31
- * @arg @ref LL_RCC_PLLP_DIV_32
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_PLL_ConfigDomain_I2S2(uint32_t Source, uint32_t PLLM, uint32_t PLLN, uint32_t PLLP)
- {
- MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC | RCC_PLLCFGR_PLLM | RCC_PLLCFGR_PLLN | RCC_PLLCFGR_PLLP,
- Source | PLLM | (PLLN << RCC_PLLCFGR_PLLN_Pos) | PLLP);
- }
- #endif /* RCC_CCIPR2_I2S2SEL */
- #if defined(RNG)
- /**
- * @brief Configure PLL used for RNG domain clock
- * @note PLL Source and PLLM Divider can be written only when PLL is disabled
- * @note PLLN/PLLQ can be written only when PLL is disabled
- * @note User shall verify whether the PLL configuration is not done through
- * other functions (ex: TIM1, TIM15)
- * @note This can be selected for RNG
- * @rmtoll PLLCFGR PLLSRC LL_RCC_PLL_ConfigDomain_RNG\n
- * PLLCFGR PLLM LL_RCC_PLL_ConfigDomain_RNG\n
- * PLLCFGR PLLN LL_RCC_PLL_ConfigDomain_RNG\n
- * PLLCFGR PLLQ LL_RCC_PLL_ConfigDomain_RNG
- * @param Source This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLSOURCE_NONE
- * @arg @ref LL_RCC_PLLSOURCE_HSI
- * @arg @ref LL_RCC_PLLSOURCE_HSE
- * @param PLLM This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLM_DIV_1
- * @arg @ref LL_RCC_PLLM_DIV_2
- * @arg @ref LL_RCC_PLLM_DIV_3
- * @arg @ref LL_RCC_PLLM_DIV_4
- * @arg @ref LL_RCC_PLLM_DIV_5
- * @arg @ref LL_RCC_PLLM_DIV_6
- * @arg @ref LL_RCC_PLLM_DIV_7
- * @arg @ref LL_RCC_PLLM_DIV_8
- * @param PLLN Between 8 and 86
- * @param PLLQ This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLQ_DIV_2
- * @arg @ref LL_RCC_PLLQ_DIV_3
- * @arg @ref LL_RCC_PLLQ_DIV_4
- * @arg @ref LL_RCC_PLLQ_DIV_5
- * @arg @ref LL_RCC_PLLQ_DIV_6
- * @arg @ref LL_RCC_PLLQ_DIV_7
- * @arg @ref LL_RCC_PLLQ_DIV_8
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_PLL_ConfigDomain_RNG(uint32_t Source, uint32_t PLLM, uint32_t PLLN, uint32_t PLLQ)
- {
- MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC | RCC_PLLCFGR_PLLM | RCC_PLLCFGR_PLLN | RCC_PLLCFGR_PLLQ,
- Source | PLLM | (PLLN << RCC_PLLCFGR_PLLN_Pos) | PLLQ);
- }
- #endif /* RNG */
- #if defined(FDCAN1) || defined(FDCAN2)
- /**
- * @brief Configure PLL used for FDCAN domain clock
- * @note PLL Source and PLLM Divider can be written only when PLL is disabled
- * @note PLLN/PLLQ can be written only when PLL is disabled
- * @note User shall verify whether the PLL configuration is not done through
- * other functions (ex: TIM1, TIM15)
- * @note This can be selected for FDCAN
- * @rmtoll PLLCFGR PLLSRC LL_RCC_PLL_ConfigDomain_FDCAN\n
- * PLLCFGR PLLM LL_RCC_PLL_ConfigDomain_FDCAN\n
- * PLLCFGR PLLN LL_RCC_PLL_ConfigDomain_FDCAN\n
- * PLLCFGR PLLQ LL_RCC_PLL_ConfigDomain_FDCAN
- * @param Source This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLSOURCE_NONE
- * @arg @ref LL_RCC_PLLSOURCE_HSI
- * @arg @ref LL_RCC_PLLSOURCE_HSE
- * @param PLLM This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLM_DIV_1
- * @arg @ref LL_RCC_PLLM_DIV_2
- * @arg @ref LL_RCC_PLLM_DIV_3
- * @arg @ref LL_RCC_PLLM_DIV_4
- * @arg @ref LL_RCC_PLLM_DIV_5
- * @arg @ref LL_RCC_PLLM_DIV_6
- * @arg @ref LL_RCC_PLLM_DIV_7
- * @arg @ref LL_RCC_PLLM_DIV_8
- * @param PLLN Between 8 and 86
- * @param PLLQ This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLQ_DIV_2
- * @arg @ref LL_RCC_PLLQ_DIV_3
- * @arg @ref LL_RCC_PLLQ_DIV_4
- * @arg @ref LL_RCC_PLLQ_DIV_5
- * @arg @ref LL_RCC_PLLQ_DIV_6
- * @arg @ref LL_RCC_PLLQ_DIV_7
- * @arg @ref LL_RCC_PLLQ_DIV_8
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_PLL_ConfigDomain_FDCAN(uint32_t Source, uint32_t PLLM, uint32_t PLLN, uint32_t PLLQ)
- {
- MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC | RCC_PLLCFGR_PLLM | RCC_PLLCFGR_PLLN | RCC_PLLCFGR_PLLQ,
- Source | PLLM | (PLLN << RCC_PLLCFGR_PLLN_Pos) | PLLQ);
- }
- #endif /* FDCAN1 || FDCAN2 */
- #if defined(STM32G0C1xx) || defined(STM32G0B1xx) || defined(STM32G0B0xx)
- /**
- * @brief Configure PLL used for USB domain clock
- * @note PLL Source and PLLM Divider can be written only when PLL is disabled
- * @note PLLN/PLLQ can be written only when PLL is disabled
- * @note User shall verify whether the PLL configuration is not done through
- * other functions (ex: TIM1, TIM15)
- * @note This can be selected for USB
- * @rmtoll PLLCFGR PLLSRC LL_RCC_PLL_ConfigDomain_USB\n
- * PLLCFGR PLLM LL_RCC_PLL_ConfigDomain_USB\n
- * PLLCFGR PLLN LL_RCC_PLL_ConfigDomain_USB\n
- * PLLCFGR PLLQ LL_RCC_PLL_ConfigDomain_USB
- * @param Source This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLSOURCE_NONE
- * @arg @ref LL_RCC_PLLSOURCE_HSI
- * @arg @ref LL_RCC_PLLSOURCE_HSE
- * @param PLLM This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLM_DIV_1
- * @arg @ref LL_RCC_PLLM_DIV_2
- * @arg @ref LL_RCC_PLLM_DIV_3
- * @arg @ref LL_RCC_PLLM_DIV_4
- * @arg @ref LL_RCC_PLLM_DIV_5
- * @arg @ref LL_RCC_PLLM_DIV_6
- * @arg @ref LL_RCC_PLLM_DIV_7
- * @arg @ref LL_RCC_PLLM_DIV_8
- * @param PLLN Between 8 and 86
- * @param PLLQ This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLQ_DIV_2
- * @arg @ref LL_RCC_PLLQ_DIV_3
- * @arg @ref LL_RCC_PLLQ_DIV_4
- * @arg @ref LL_RCC_PLLQ_DIV_5
- * @arg @ref LL_RCC_PLLQ_DIV_6
- * @arg @ref LL_RCC_PLLQ_DIV_7
- * @arg @ref LL_RCC_PLLQ_DIV_8
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_PLL_ConfigDomain_USB(uint32_t Source, uint32_t PLLM, uint32_t PLLN, uint32_t PLLQ)
- {
- MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC | RCC_PLLCFGR_PLLM | RCC_PLLCFGR_PLLN | RCC_PLLCFGR_PLLQ,
- Source | PLLM | (PLLN << RCC_PLLCFGR_PLLN_Pos) | PLLQ);
- }
- #endif /* STM32G0C1xx || STM32G0B1xx || STM32G0B0xx */
- #if defined(RCC_PLLQ_SUPPORT)
- /**
- * @brief Configure PLL used for TIM1 domain clock
- * @note PLL Source and PLLM Divider can be written only when PLL is disabled
- * @note PLLN/PLLQ can be written only when PLL is disabled
- * @note User shall verify whether the PLL configuration is not done through
- * other functions (ex: RNG, TIM15)
- * @note This can be selected for TIM1
- * @rmtoll PLLCFGR PLLSRC LL_RCC_PLL_ConfigDomain_TIM1\n
- * PLLCFGR PLLM LL_RCC_PLL_ConfigDomain_TIM1\n
- * PLLCFGR PLLN LL_RCC_PLL_ConfigDomain_TIM1\n
- * PLLCFGR PLLQ LL_RCC_PLL_ConfigDomain_TIM1
- * @param Source This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLSOURCE_NONE
- * @arg @ref LL_RCC_PLLSOURCE_HSI
- * @arg @ref LL_RCC_PLLSOURCE_HSE
- * @param PLLM This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLM_DIV_1
- * @arg @ref LL_RCC_PLLM_DIV_2
- * @arg @ref LL_RCC_PLLM_DIV_3
- * @arg @ref LL_RCC_PLLM_DIV_4
- * @arg @ref LL_RCC_PLLM_DIV_5
- * @arg @ref LL_RCC_PLLM_DIV_6
- * @arg @ref LL_RCC_PLLM_DIV_7
- * @arg @ref LL_RCC_PLLM_DIV_8
- * @param PLLN Between 8 and 86
- * @param PLLQ This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLQ_DIV_2
- * @arg @ref LL_RCC_PLLQ_DIV_3
- * @arg @ref LL_RCC_PLLQ_DIV_4
- * @arg @ref LL_RCC_PLLQ_DIV_5
- * @arg @ref LL_RCC_PLLQ_DIV_6
- * @arg @ref LL_RCC_PLLQ_DIV_7
- * @arg @ref LL_RCC_PLLQ_DIV_8
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_PLL_ConfigDomain_TIM1(uint32_t Source, uint32_t PLLM, uint32_t PLLN, uint32_t PLLQ)
- {
- MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC | RCC_PLLCFGR_PLLM | RCC_PLLCFGR_PLLN | RCC_PLLCFGR_PLLQ,
- Source | PLLM | (PLLN << RCC_PLLCFGR_PLLN_Pos) | PLLQ);
- }
- #endif /* RCC_PLLQ_SUPPORT */
- #if defined(RCC_PLLQ_SUPPORT) && defined(TIM15)
- /**
- * @brief Configure PLL used for TIM15 domain clock
- * @note PLL Source and PLLM Divider can be written only when PLL is disabled
- * @note PLLN/PLLQ can be written only when PLL is disabled
- * @note User shall verify whether the PLL configuration is not done through
- * other functions (ex: RNG, TIM1)
- * @note This can be selected for TIM15
- * @rmtoll PLLCFGR PLLSRC LL_RCC_PLL_ConfigDomain_TIM15\n
- * PLLCFGR PLLM LL_RCC_PLL_ConfigDomain_TIM15\n
- * PLLCFGR PLLN LL_RCC_PLL_ConfigDomain_TIM15\n
- * PLLCFGR PLLQ LL_RCC_PLL_ConfigDomain_TIM15
- * @param Source This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLSOURCE_NONE
- * @arg @ref LL_RCC_PLLSOURCE_HSI
- * @arg @ref LL_RCC_PLLSOURCE_HSE
- * @param PLLM This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLM_DIV_1
- * @arg @ref LL_RCC_PLLM_DIV_2
- * @arg @ref LL_RCC_PLLM_DIV_3
- * @arg @ref LL_RCC_PLLM_DIV_4
- * @arg @ref LL_RCC_PLLM_DIV_5
- * @arg @ref LL_RCC_PLLM_DIV_6
- * @arg @ref LL_RCC_PLLM_DIV_7
- * @arg @ref LL_RCC_PLLM_DIV_8
- * @param PLLN Between 8 and 86
- * @param PLLQ This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLQ_DIV_2
- * @arg @ref LL_RCC_PLLQ_DIV_3
- * @arg @ref LL_RCC_PLLQ_DIV_4
- * @arg @ref LL_RCC_PLLQ_DIV_5
- * @arg @ref LL_RCC_PLLQ_DIV_6
- * @arg @ref LL_RCC_PLLQ_DIV_7
- * @arg @ref LL_RCC_PLLQ_DIV_8
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_PLL_ConfigDomain_TIM15(uint32_t Source, uint32_t PLLM, uint32_t PLLN, uint32_t PLLQ)
- {
- MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC | RCC_PLLCFGR_PLLM | RCC_PLLCFGR_PLLN | RCC_PLLCFGR_PLLQ,
- Source | PLLM | (PLLN << RCC_PLLCFGR_PLLN_Pos) | PLLQ);
- }
- #endif /* RCC_PLLQ_SUPPORT && TIM15 */
- /**
- * @brief Get Main PLL multiplication factor for VCO
- * @rmtoll PLLCFGR PLLN LL_RCC_PLL_GetN
- * @retval Between 8 and 86
- */
- __STATIC_INLINE uint32_t LL_RCC_PLL_GetN(void)
- {
- return (uint32_t)(READ_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLN) >> RCC_PLLCFGR_PLLN_Pos);
- }
- /**
- * @brief Get Main PLL division factor for PLLP
- * @note used for PLLPCLK (ADC & I2S clock)
- * @rmtoll PLLCFGR PLLP LL_RCC_PLL_GetP
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_RCC_PLLP_DIV_2
- * @arg @ref LL_RCC_PLLP_DIV_3
- * @arg @ref LL_RCC_PLLP_DIV_4
- * @arg @ref LL_RCC_PLLP_DIV_5
- * @arg @ref LL_RCC_PLLP_DIV_6
- * @arg @ref LL_RCC_PLLP_DIV_7
- * @arg @ref LL_RCC_PLLP_DIV_8
- * @arg @ref LL_RCC_PLLP_DIV_9
- * @arg @ref LL_RCC_PLLP_DIV_10
- * @arg @ref LL_RCC_PLLP_DIV_11
- * @arg @ref LL_RCC_PLLP_DIV_12
- * @arg @ref LL_RCC_PLLP_DIV_13
- * @arg @ref LL_RCC_PLLP_DIV_14
- * @arg @ref LL_RCC_PLLP_DIV_15
- * @arg @ref LL_RCC_PLLP_DIV_16
- * @arg @ref LL_RCC_PLLP_DIV_17
- * @arg @ref LL_RCC_PLLP_DIV_18
- * @arg @ref LL_RCC_PLLP_DIV_19
- * @arg @ref LL_RCC_PLLP_DIV_20
- * @arg @ref LL_RCC_PLLP_DIV_21
- * @arg @ref LL_RCC_PLLP_DIV_22
- * @arg @ref LL_RCC_PLLP_DIV_23
- * @arg @ref LL_RCC_PLLP_DIV_24
- * @arg @ref LL_RCC_PLLP_DIV_25
- * @arg @ref LL_RCC_PLLP_DIV_26
- * @arg @ref LL_RCC_PLLP_DIV_27
- * @arg @ref LL_RCC_PLLP_DIV_28
- * @arg @ref LL_RCC_PLLP_DIV_29
- * @arg @ref LL_RCC_PLLP_DIV_30
- * @arg @ref LL_RCC_PLLP_DIV_31
- * @arg @ref LL_RCC_PLLP_DIV_32
- */
- __STATIC_INLINE uint32_t LL_RCC_PLL_GetP(void)
- {
- return (uint32_t)(READ_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLP));
- }
- #if defined(RCC_PLLQ_SUPPORT)
- /**
- * @brief Get Main PLL division factor for PLLQ
- * @note used for PLLQCLK selected for RNG, TIM1, TIM15 clock
- * @rmtoll PLLCFGR PLLQ LL_RCC_PLL_GetQ
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_RCC_PLLQ_DIV_2
- * @arg @ref LL_RCC_PLLQ_DIV_3
- * @arg @ref LL_RCC_PLLQ_DIV_4
- * @arg @ref LL_RCC_PLLQ_DIV_5
- * @arg @ref LL_RCC_PLLQ_DIV_6
- * @arg @ref LL_RCC_PLLQ_DIV_7
- * @arg @ref LL_RCC_PLLQ_DIV_8
- */
- __STATIC_INLINE uint32_t LL_RCC_PLL_GetQ(void)
- {
- return (uint32_t)(READ_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLQ));
- }
- #endif /* RCC_PLLQ_SUPPORT */
- /**
- * @brief Get Main PLL division factor for PLLR
- * @note used for PLLCLK (system clock)
- * @rmtoll PLLCFGR PLLR LL_RCC_PLL_GetR
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_RCC_PLLR_DIV_2
- * @arg @ref LL_RCC_PLLR_DIV_3
- * @arg @ref LL_RCC_PLLR_DIV_4
- * @arg @ref LL_RCC_PLLR_DIV_5
- * @arg @ref LL_RCC_PLLR_DIV_6
- * @arg @ref LL_RCC_PLLR_DIV_7
- * @arg @ref LL_RCC_PLLR_DIV_8
- */
- __STATIC_INLINE uint32_t LL_RCC_PLL_GetR(void)
- {
- return (uint32_t)(READ_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLR));
- }
- /**
- * @brief Configure PLL clock source
- * @rmtoll PLLCFGR PLLSRC LL_RCC_PLL_SetMainSource
- * @param PLLSource This parameter can be one of the following values:
- * @arg @ref LL_RCC_PLLSOURCE_HSI
- * @arg @ref LL_RCC_PLLSOURCE_HSE
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_PLL_SetMainSource(uint32_t PLLSource)
- {
- MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC, PLLSource);
- }
- /**
- * @brief Get the oscillator used as PLL clock source.
- * @rmtoll PLLCFGR PLLSRC LL_RCC_PLL_GetMainSource
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_RCC_PLLSOURCE_NONE
- * @arg @ref LL_RCC_PLLSOURCE_HSI
- * @arg @ref LL_RCC_PLLSOURCE_HSE
- */
- __STATIC_INLINE uint32_t LL_RCC_PLL_GetMainSource(void)
- {
- return (uint32_t)(READ_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC));
- }
- /**
- * @brief Get Division factor for the main PLL and other PLL
- * @rmtoll PLLCFGR PLLM LL_RCC_PLL_GetDivider
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_RCC_PLLM_DIV_1
- * @arg @ref LL_RCC_PLLM_DIV_2
- * @arg @ref LL_RCC_PLLM_DIV_3
- * @arg @ref LL_RCC_PLLM_DIV_4
- * @arg @ref LL_RCC_PLLM_DIV_5
- * @arg @ref LL_RCC_PLLM_DIV_6
- * @arg @ref LL_RCC_PLLM_DIV_7
- * @arg @ref LL_RCC_PLLM_DIV_8
- */
- __STATIC_INLINE uint32_t LL_RCC_PLL_GetDivider(void)
- {
- return (uint32_t)(READ_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLM));
- }
- /**
- * @brief Enable PLL output mapped on ADC domain clock
- * @rmtoll PLLCFGR PLLPEN LL_RCC_PLL_EnableDomain_ADC
- * @note User shall check that PLL enable is not done through
- * other functions (ex: I2S1)
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_PLL_EnableDomain_ADC(void)
- {
- SET_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLPEN);
- }
- /**
- * @brief Disable PLL output mapped on ADC domain clock
- * @note Cannot be disabled if the PLL clock is used as the system clock
- * @note User shall check that PLL is not used by any other peripheral
- * (ex: I2S1)
- * @note In order to save power, when the PLLCLK of the PLL is
- * not used, should be 0
- * @rmtoll PLLCFGR PLLPEN LL_RCC_PLL_DisableDomain_ADC
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_PLL_DisableDomain_ADC(void)
- {
- CLEAR_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLPEN);
- }
- /**
- * @brief Enable PLL output mapped on I2S domain clock
- * @rmtoll PLLCFGR PLLPEN LL_RCC_PLL_EnableDomain_I2S1
- * @note User shall check that PLL enable is not done through
- * other functions (ex: ADC)
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_PLL_EnableDomain_I2S1(void)
- {
- SET_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLPEN);
- }
- #if defined(RCC_CCIPR2_I2S2SEL)
- /**
- * @brief Enable PLL output mapped on I2S2 domain clock
- * @rmtoll PLLCFGR PLLPEN LL_RCC_PLL_EnableDomain_I2S2
- * @note User shall check that PLL enable is not done through
- * other functions (ex: ADC)
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_PLL_EnableDomain_I2S2(void)
- {
- SET_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLPEN);
- }
- #endif /* RCC_CCIPR2_I2S2SEL */
- /**
- * @brief Disable PLL output mapped on I2S1 domain clock
- * @note Cannot be disabled if the PLL clock is used as the system clock
- * @note User shall check that PLL is not used by any other peripheral
- * (ex: RNG)
- * @note In order to save power, when the PLLCLK of the PLL is
- * not used, should be 0
- * @rmtoll PLLCFGR PLLPEN LL_RCC_PLL_DisableDomain_I2S1
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_PLL_DisableDomain_I2S1(void)
- {
- CLEAR_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLPEN);
- }
- #if defined(RCC_CCIPR2_I2S2SEL)
- /**
- * @brief Disable PLL output mapped on I2S2 domain clock
- * @note Cannot be disabled if the PLL clock is used as the system clock
- * @note User shall check that PLL is not used by any other peripheral
- * (ex: RNG)
- * @note In order to save power, when the PLLCLK of the PLL is
- * not used, should be 0
- * @rmtoll PLLCFGR PLLPEN LL_RCC_PLL_DisableDomain_I2S2
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_PLL_DisableDomain_I2S2(void)
- {
- CLEAR_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLPEN);
- }
- #endif /* RCC_CCIPR2_I2S2SEL */
- #if defined(RNG)
- /**
- * @brief Enable PLL output mapped on RNG domain clock
- * @rmtoll PLLCFGR PLLQEN LL_RCC_PLL_EnableDomain_RNG
- * @note User shall check that PLL enable is not done through
- * other functions (ex: TIM1, TIM15)
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_PLL_EnableDomain_RNG(void)
- {
- SET_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLQEN);
- }
- /**
- * @brief Disable PLL output mapped on RNG domain clock
- * @note Cannot be disabled if the PLL clock is used as the system clock
- * @note User shall check that PLL is not used by any other peripheral
- * (ex: TIM, TIM15)
- * @note In order to save power, when the PLLCLK of the PLL is
- * not used, should be 0
- * @rmtoll PLLCFGR PLLQEN LL_RCC_PLL_DisableDomain_RNG
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_PLL_DisableDomain_RNG(void)
- {
- CLEAR_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLQEN);
- }
- #endif /* RNG */
- #if defined(FDCAN1) || defined(FDCAN2)
- /**
- * @brief Enable PLL output mapped on FDCAN domain clock
- * @rmtoll PLLCFGR PLLQEN LL_RCC_PLL_EnableDomain_FDCAN
- * @note User shall check that PLL enable is not done through
- * other functions (ex: TIM1, TIM15)
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_PLL_EnableDomain_FDCAN(void)
- {
- SET_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLQEN);
- }
- /**
- * @brief Disable PLL output mapped on FDCAN domain clock
- * @note Cannot be disabled if the PLL clock is used as the system clock
- * @note User shall check that PLL is not used by any other peripheral
- * (ex: TIM, TIM15)
- * @note In order to save power, when the PLLCLK of the PLL is
- * not used, should be 0
- * @rmtoll PLLCFGR PLLQEN LL_RCC_PLL_DisableDomain_FDCAN
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_PLL_DisableDomain_FDCAN(void)
- {
- CLEAR_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLQEN);
- }
- #endif /* FDCAN1 || FDCAN2 */
- #if defined(STM32G0C1xx) || defined(STM32G0B1xx) || defined(STM32G0B0xx)
- /**
- * @brief Enable PLL output mapped on USB domain clock
- * @rmtoll PLLCFGR PLLQEN LL_RCC_PLL_EnableDomain_USB
- * @note User shall check that PLL enable is not done through
- * other functions (ex: TIM1, TIM15)
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_PLL_EnableDomain_USB(void)
- {
- SET_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLQEN);
- }
- /**
- * @brief Disable PLL output mapped on USB domain clock
- * @note Cannot be disabled if the PLL clock is used as the system clock
- * @note User shall check that PLL is not used by any other peripheral
- * (ex: TIM, TIM15)
- * @note In order to save power, when the PLLCLK of the PLL is
- * not used, should be 0
- * @rmtoll PLLCFGR PLLQEN LL_RCC_PLL_DisableDomain_USB
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_PLL_DisableDomain_USB(void)
- {
- CLEAR_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLQEN);
- }
- #endif /* STM32G0C1xx || STM32G0B1xx || STM32G0B0xx */
- #if defined(RCC_PLLQ_SUPPORT)
- /**
- * @brief Enable PLL output mapped on TIM1 domain clock
- * @rmtoll PLLCFGR PLLQEN LL_RCC_PLL_EnableDomain_TIM1
- * @note User shall check that PLL enable is not done through
- * other functions (ex: RNG, TIM15)
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_PLL_EnableDomain_TIM1(void)
- {
- SET_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLQEN);
- }
- /**
- * @brief Disable PLL output mapped on TIM1 domain clock
- * @note Cannot be disabled if the PLL clock is used as the system clock
- * @note User shall check that PLL is not used by any other peripheral
- * (ex: RNG, TIM15)
- * @note In order to save power, when the PLLCLK of the PLL is
- * not used, should be 0
- * @rmtoll PLLCFGR PLLQEN LL_RCC_PLL_DisableDomain_TIM1
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_PLL_DisableDomain_TIM1(void)
- {
- CLEAR_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLQEN);
- }
- #endif /* RCC_PLLQ_SUPPORT */
- #if defined(RCC_PLLQ_SUPPORT) && defined(TIM15)
- /**
- * @brief Enable PLL output mapped on TIM15 domain clock
- * @rmtoll PLLCFGR PLLQEN LL_RCC_PLL_EnableDomain_TIM15
- * @note User shall check that PLL enable is not done through
- * other functions (ex: RNG, TIM1)
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_PLL_EnableDomain_TIM15(void)
- {
- SET_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLQEN);
- }
- /**
- * @brief Disable PLL output mapped on TIM15 domain clock
- * @note Cannot be disabled if the PLL clock is used as the system clock
- * @note User shall check that PLL is not used by any other peripheral
- * (ex: RNG, TIM1)
- * @note In order to save power, when the PLLCLK of the PLL is
- * not used, should be 0
- * @rmtoll PLLCFGR PLLQEN LL_RCC_PLL_DisableDomain_TIM15
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_PLL_DisableDomain_TIM15(void)
- {
- CLEAR_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLQEN);
- }
- #endif /* RCC_PLLQ_SUPPORT && TIM15 */
- /**
- * @brief Enable PLL output mapped on SYSCLK domain
- * @rmtoll PLLCFGR PLLREN LL_RCC_PLL_EnableDomain_SYS
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_PLL_EnableDomain_SYS(void)
- {
- SET_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLREN);
- }
- /**
- * @brief Disable PLL output mapped on SYSCLK domain
- * @note Cannot be disabled if the PLL clock is used as the system clock
- * @note In order to save power, when the PLLCLK of the PLL is
- * not used, Main PLL should be 0
- * @rmtoll PLLCFGR PLLREN LL_RCC_PLL_DisableDomain_SYS
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_PLL_DisableDomain_SYS(void)
- {
- CLEAR_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLREN);
- }
- /**
- * @}
- */
- /** @defgroup RCC_LL_EF_FLAG_Management FLAG Management
- * @{
- */
- /**
- * @brief Clear LSI ready interrupt flag
- * @rmtoll CICR LSIRDYC LL_RCC_ClearFlag_LSIRDY
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_ClearFlag_LSIRDY(void)
- {
- SET_BIT(RCC->CICR, RCC_CICR_LSIRDYC);
- }
- /**
- * @brief Clear LSE ready interrupt flag
- * @rmtoll CICR LSERDYC LL_RCC_ClearFlag_LSERDY
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_ClearFlag_LSERDY(void)
- {
- SET_BIT(RCC->CICR, RCC_CICR_LSERDYC);
- }
- /**
- * @brief Clear HSI ready interrupt flag
- * @rmtoll CICR HSIRDYC LL_RCC_ClearFlag_HSIRDY
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_ClearFlag_HSIRDY(void)
- {
- SET_BIT(RCC->CICR, RCC_CICR_HSIRDYC);
- }
- /**
- * @brief Clear HSE ready interrupt flag
- * @rmtoll CICR HSERDYC LL_RCC_ClearFlag_HSERDY
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_ClearFlag_HSERDY(void)
- {
- SET_BIT(RCC->CICR, RCC_CICR_HSERDYC);
- }
- /**
- * @brief Clear PLL ready interrupt flag
- * @rmtoll CICR PLLRDYC LL_RCC_ClearFlag_PLLRDY
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_ClearFlag_PLLRDY(void)
- {
- SET_BIT(RCC->CICR, RCC_CICR_PLLRDYC);
- }
- #if defined(RCC_HSI48_SUPPORT)
- /**
- * @brief Clear HSI48 ready interrupt flag
- * @rmtoll CICR HSI48RDYC LL_RCC_ClearFlag_HSI48RDY
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_ClearFlag_HSI48RDY(void)
- {
- SET_BIT(RCC->CICR, RCC_CICR_HSI48RDYC);
- }
- #endif /* RCC_HSI48_SUPPORT */
- /**
- * @brief Clear Clock security system interrupt flag
- * @rmtoll CICR CSSC LL_RCC_ClearFlag_HSECSS
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_ClearFlag_HSECSS(void)
- {
- SET_BIT(RCC->CICR, RCC_CICR_CSSC);
- }
- /**
- * @brief Clear LSE Clock security system interrupt flag
- * @rmtoll CICR LSECSSC LL_RCC_ClearFlag_LSECSS
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_ClearFlag_LSECSS(void)
- {
- SET_BIT(RCC->CICR, RCC_CICR_LSECSSC);
- }
- /**
- * @brief Check if LSI ready interrupt occurred or not
- * @rmtoll CIFR LSIRDYF LL_RCC_IsActiveFlag_LSIRDY
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_LSIRDY(void)
- {
- return ((READ_BIT(RCC->CIFR, RCC_CIFR_LSIRDYF) == (RCC_CIFR_LSIRDYF)) ? 1UL : 0UL);
- }
- /**
- * @brief Check if LSE ready interrupt occurred or not
- * @rmtoll CIFR LSERDYF LL_RCC_IsActiveFlag_LSERDY
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_LSERDY(void)
- {
- return ((READ_BIT(RCC->CIFR, RCC_CIFR_LSERDYF) == (RCC_CIFR_LSERDYF)) ? 1UL : 0UL);
- }
- /**
- * @brief Check if HSI ready interrupt occurred or not
- * @rmtoll CIFR HSIRDYF LL_RCC_IsActiveFlag_HSIRDY
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_HSIRDY(void)
- {
- return ((READ_BIT(RCC->CIFR, RCC_CIFR_HSIRDYF) == (RCC_CIFR_HSIRDYF)) ? 1UL : 0UL);
- }
- /**
- * @brief Check if HSE ready interrupt occurred or not
- * @rmtoll CIFR HSERDYF LL_RCC_IsActiveFlag_HSERDY
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_HSERDY(void)
- {
- return ((READ_BIT(RCC->CIFR, RCC_CIFR_HSERDYF) == (RCC_CIFR_HSERDYF)) ? 1UL : 0UL);
- }
- /**
- * @brief Check if PLL ready interrupt occurred or not
- * @rmtoll CIFR PLLRDYF LL_RCC_IsActiveFlag_PLLRDY
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_PLLRDY(void)
- {
- return ((READ_BIT(RCC->CIFR, RCC_CIFR_PLLRDYF) == (RCC_CIFR_PLLRDYF)) ? 1UL : 0UL);
- }
- #if defined(RCC_HSI48_SUPPORT)
- /**
- * @brief Check if HSI48 ready interrupt occurred or not
- * @rmtoll CIR HSI48RDYF LL_RCC_IsActiveFlag_HSI48RDY
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_HSI48RDY(void)
- {
- return ((READ_BIT(RCC->CIFR, RCC_CIFR_HSI48RDYF) == (RCC_CIFR_HSI48RDYF)) ? 1UL : 0UL);
- }
- #endif /* RCC_HSI48_SUPPORT */
- /**
- * @brief Check if Clock security system interrupt occurred or not
- * @rmtoll CIFR CSSF LL_RCC_IsActiveFlag_HSECSS
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_HSECSS(void)
- {
- return ((READ_BIT(RCC->CIFR, RCC_CIFR_CSSF) == (RCC_CIFR_CSSF)) ? 1UL : 0UL);
- }
- /**
- * @brief Check if LSE Clock security system interrupt occurred or not
- * @rmtoll CIFR LSECSSF LL_RCC_IsActiveFlag_LSECSS
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_LSECSS(void)
- {
- return ((READ_BIT(RCC->CIFR, RCC_CIFR_LSECSSF) == (RCC_CIFR_LSECSSF)) ? 1UL : 0UL);
- }
- /**
- * @brief Check if RCC flag Independent Watchdog reset is set or not.
- * @rmtoll CSR IWDGRSTF LL_RCC_IsActiveFlag_IWDGRST
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_IWDGRST(void)
- {
- return ((READ_BIT(RCC->CSR, RCC_CSR_IWDGRSTF) == (RCC_CSR_IWDGRSTF)) ? 1UL : 0UL);
- }
- /**
- * @brief Check if RCC flag Low Power reset is set or not.
- * @rmtoll CSR LPWRRSTF LL_RCC_IsActiveFlag_LPWRRST
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_LPWRRST(void)
- {
- return ((READ_BIT(RCC->CSR, RCC_CSR_LPWRRSTF) == (RCC_CSR_LPWRRSTF)) ? 1UL : 0UL);
- }
- /**
- * @brief Check if RCC flag Option byte reset is set or not.
- * @rmtoll CSR OBLRSTF LL_RCC_IsActiveFlag_OBLRST
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_OBLRST(void)
- {
- return ((READ_BIT(RCC->CSR, RCC_CSR_OBLRSTF) == (RCC_CSR_OBLRSTF)) ? 1UL : 0UL);
- }
- /**
- * @brief Check if RCC flag Pin reset is set or not.
- * @rmtoll CSR PINRSTF LL_RCC_IsActiveFlag_PINRST
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_PINRST(void)
- {
- return ((READ_BIT(RCC->CSR, RCC_CSR_PINRSTF) == (RCC_CSR_PINRSTF)) ? 1UL : 0UL);
- }
- /**
- * @brief Check if RCC flag Software reset is set or not.
- * @rmtoll CSR SFTRSTF LL_RCC_IsActiveFlag_SFTRST
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_SFTRST(void)
- {
- return ((READ_BIT(RCC->CSR, RCC_CSR_SFTRSTF) == (RCC_CSR_SFTRSTF)) ? 1UL : 0UL);
- }
- /**
- * @brief Check if RCC flag Window Watchdog reset is set or not.
- * @rmtoll CSR WWDGRSTF LL_RCC_IsActiveFlag_WWDGRST
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_WWDGRST(void)
- {
- return ((READ_BIT(RCC->CSR, RCC_CSR_WWDGRSTF) == (RCC_CSR_WWDGRSTF)) ? 1UL : 0UL);
- }
- /**
- * @brief Check if RCC flag BOR or POR/PDR reset is set or not.
- * @rmtoll CSR PWRRSTF LL_RCC_IsActiveFlag_PWRRST
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_PWRRST(void)
- {
- return ((READ_BIT(RCC->CSR, RCC_CSR_PWRRSTF) == (RCC_CSR_PWRRSTF)) ? 1UL : 0UL);
- }
- /**
- * @brief Set RMVF bit to clear the reset flags.
- * @rmtoll CSR RMVF LL_RCC_ClearResetFlags
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_ClearResetFlags(void)
- {
- SET_BIT(RCC->CSR, RCC_CSR_RMVF);
- }
- /**
- * @}
- */
- /** @defgroup RCC_LL_EF_IT_Management IT Management
- * @{
- */
- /**
- * @brief Enable LSI ready interrupt
- * @rmtoll CIER LSIRDYIE LL_RCC_EnableIT_LSIRDY
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_EnableIT_LSIRDY(void)
- {
- SET_BIT(RCC->CIER, RCC_CIER_LSIRDYIE);
- }
- /**
- * @brief Enable LSE ready interrupt
- * @rmtoll CIER LSERDYIE LL_RCC_EnableIT_LSERDY
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_EnableIT_LSERDY(void)
- {
- SET_BIT(RCC->CIER, RCC_CIER_LSERDYIE);
- }
- /**
- * @brief Enable HSI ready interrupt
- * @rmtoll CIER HSIRDYIE LL_RCC_EnableIT_HSIRDY
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_EnableIT_HSIRDY(void)
- {
- SET_BIT(RCC->CIER, RCC_CIER_HSIRDYIE);
- }
- /**
- * @brief Enable HSE ready interrupt
- * @rmtoll CIER HSERDYIE LL_RCC_EnableIT_HSERDY
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_EnableIT_HSERDY(void)
- {
- SET_BIT(RCC->CIER, RCC_CIER_HSERDYIE);
- }
- /**
- * @brief Enable PLL ready interrupt
- * @rmtoll CIER PLLRDYIE LL_RCC_EnableIT_PLLRDY
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_EnableIT_PLLRDY(void)
- {
- SET_BIT(RCC->CIER, RCC_CIER_PLLRDYIE);
- }
- #if defined(RCC_HSI48_SUPPORT)
- /**
- * @brief Enable HSI48 ready interrupt
- * @rmtoll CIER HSI48RDYIE LL_RCC_EnableIT_HSI48RDY
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_EnableIT_HSI48RDY(void)
- {
- SET_BIT(RCC->CIER, RCC_CIER_HSI48RDYIE);
- }
- #endif /* RCC_HSI48_SUPPORT */
- /**
- * @brief Disable LSI ready interrupt
- * @rmtoll CIER LSIRDYIE LL_RCC_DisableIT_LSIRDY
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_DisableIT_LSIRDY(void)
- {
- CLEAR_BIT(RCC->CIER, RCC_CIER_LSIRDYIE);
- }
- /**
- * @brief Disable LSE ready interrupt
- * @rmtoll CIER LSERDYIE LL_RCC_DisableIT_LSERDY
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_DisableIT_LSERDY(void)
- {
- CLEAR_BIT(RCC->CIER, RCC_CIER_LSERDYIE);
- }
- /**
- * @brief Disable HSI ready interrupt
- * @rmtoll CIER HSIRDYIE LL_RCC_DisableIT_HSIRDY
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_DisableIT_HSIRDY(void)
- {
- CLEAR_BIT(RCC->CIER, RCC_CIER_HSIRDYIE);
- }
- /**
- * @brief Disable HSE ready interrupt
- * @rmtoll CIER HSERDYIE LL_RCC_DisableIT_HSERDY
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_DisableIT_HSERDY(void)
- {
- CLEAR_BIT(RCC->CIER, RCC_CIER_HSERDYIE);
- }
- /**
- * @brief Disable PLL ready interrupt
- * @rmtoll CIER PLLRDYIE LL_RCC_DisableIT_PLLRDY
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_DisableIT_PLLRDY(void)
- {
- CLEAR_BIT(RCC->CIER, RCC_CIER_PLLRDYIE);
- }
- #if defined(RCC_HSI48_SUPPORT)
- /**
- * @brief Disable HSI48 ready interrupt
- * @rmtoll CIER HSI48RDYIE LL_RCC_DisableIT_HSI48RDY
- * @retval None
- */
- __STATIC_INLINE void LL_RCC_DisableIT_HSI48RDY(void)
- {
- CLEAR_BIT(RCC->CIER, RCC_CIER_HSI48RDYIE);
- }
- #endif /* RCC_HSI48_SUPPORT */
- /**
- * @brief Checks if LSI ready interrupt source is enabled or disabled.
- * @rmtoll CIER LSIRDYIE LL_RCC_IsEnabledIT_LSIRDY
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_RCC_IsEnabledIT_LSIRDY(void)
- {
- return ((READ_BIT(RCC->CIER, RCC_CIER_LSIRDYIE) == (RCC_CIER_LSIRDYIE)) ? 1UL : 0UL);
- }
- /**
- * @brief Checks if LSE ready interrupt source is enabled or disabled.
- * @rmtoll CIER LSERDYIE LL_RCC_IsEnabledIT_LSERDY
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_RCC_IsEnabledIT_LSERDY(void)
- {
- return ((READ_BIT(RCC->CIER, RCC_CIER_LSERDYIE) == (RCC_CIER_LSERDYIE)) ? 1UL : 0UL);
- }
- /**
- * @brief Checks if HSI ready interrupt source is enabled or disabled.
- * @rmtoll CIER HSIRDYIE LL_RCC_IsEnabledIT_HSIRDY
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_RCC_IsEnabledIT_HSIRDY(void)
- {
- return ((READ_BIT(RCC->CIER, RCC_CIER_HSIRDYIE) == (RCC_CIER_HSIRDYIE)) ? 1UL : 0UL);
- }
- #if defined(RCC_HSI48_SUPPORT)
- /**
- * @brief Checks if HSI48 ready interrupt source is enabled or disabled.
- * @rmtoll CIER HSI48RDYIE LL_RCC_IsEnabledIT_HSI48RDY
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_RCC_IsEnabledIT_HSI48RDY(void)
- {
- return ((READ_BIT(RCC->CIER, RCC_CIER_HSI48RDYIE) == (RCC_CIER_HSI48RDYIE)) ? 1UL : 0UL);
- }
- #endif /* RCC_HSI48_SUPPORT */
- /**
- * @brief Checks if HSE ready interrupt source is enabled or disabled.
- * @rmtoll CIER HSERDYIE LL_RCC_IsEnabledIT_HSERDY
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_RCC_IsEnabledIT_HSERDY(void)
- {
- return ((READ_BIT(RCC->CIER, RCC_CIER_HSERDYIE) == (RCC_CIER_HSERDYIE)) ? 1UL : 0UL);
- }
- /**
- * @brief Checks if PLL ready interrupt source is enabled or disabled.
- * @rmtoll CIER PLLRDYIE LL_RCC_IsEnabledIT_PLLRDY
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_RCC_IsEnabledIT_PLLRDY(void)
- {
- return ((READ_BIT(RCC->CIER, RCC_CIER_PLLRDYIE) == (RCC_CIER_PLLRDYIE)) ? 1UL : 0UL);
- }
- /**
- * @}
- */
- #if defined(USE_FULL_LL_DRIVER)
- /** @defgroup RCC_LL_EF_Init De-initialization function
- * @{
- */
- ErrorStatus LL_RCC_DeInit(void);
- /**
- * @}
- */
- /** @defgroup RCC_LL_EF_Get_Freq Get system and peripherals clocks frequency functions
- * @{
- */
- void LL_RCC_GetSystemClocksFreq(LL_RCC_ClocksTypeDef *RCC_Clocks);
- uint32_t LL_RCC_GetUSARTClockFreq(uint32_t USARTxSource);
- uint32_t LL_RCC_GetI2CClockFreq(uint32_t I2CxSource);
- #if defined(LPUART1) || defined(LPUART2)
- uint32_t LL_RCC_GetLPUARTClockFreq(uint32_t LPUARTxSource);
- #endif /* LPUART1 */
- #if defined(LPTIM1) && defined(LPTIM2)
- uint32_t LL_RCC_GetLPTIMClockFreq(uint32_t LPTIMxSource);
- #endif /* LPTIM1 && LPTIM2 */
- #if defined(RNG)
- uint32_t LL_RCC_GetRNGClockFreq(uint32_t RNGxSource);
- #endif /* RNG */
- uint32_t LL_RCC_GetADCClockFreq(uint32_t ADCxSource);
- uint32_t LL_RCC_GetI2SClockFreq(uint32_t I2SxSource);
- #if defined(CEC)
- uint32_t LL_RCC_GetCECClockFreq(uint32_t CECxSource);
- #endif /* CEC */
- #if defined(FDCAN1) || defined(FDCAN2)
- uint32_t LL_RCC_GetFDCANClockFreq(uint32_t FDCANxSource);
- #endif /* FDCAN1 */
- uint32_t LL_RCC_GetTIMClockFreq(uint32_t TIMxSource);
- uint32_t LL_RCC_GetRTCClockFreq(void);
- #if defined(STM32G0C1xx) || defined(STM32G0B1xx) || defined(STM32G0B0xx)
- uint32_t LL_RCC_GetUSBClockFreq(uint32_t USBxSource);
- #endif /* STM32G0C1xx || STM32G0B1xx || STM32G0B0xx */
- /**
- * @}
- */
- #endif /* USE_FULL_LL_DRIVER */
- /**
- * @}
- */
- /**
- * @}
- */
- #endif /* RCC */
- /**
- * @}
- */
- #ifdef __cplusplus
- }
- #endif
- #endif /* STM32G0xx_LL_RCC_H */
- /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|