stm32f7xx_ll_rcc.h 226 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170
  1. /**
  2. ******************************************************************************
  3. * @file stm32f7xx_ll_rcc.h
  4. * @author MCD Application Team
  5. * @brief Header file of RCC LL module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * Copyright (c) 2017 STMicroelectronics.
  10. * All rights reserved.
  11. *
  12. * This software is licensed under terms that can be found in the LICENSE file in
  13. * the root directory of this software component.
  14. * If no LICENSE file comes with this software, it is provided AS-IS.
  15. ******************************************************************************
  16. */
  17. /* Define to prevent recursive inclusion -------------------------------------*/
  18. #ifndef __STM32F7xx_LL_RCC_H
  19. #define __STM32F7xx_LL_RCC_H
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. /* Includes ------------------------------------------------------------------*/
  24. #include "stm32f7xx.h"
  25. /** @addtogroup STM32F7xx_LL_Driver
  26. * @{
  27. */
  28. #if defined(RCC)
  29. /** @defgroup RCC_LL RCC
  30. * @{
  31. */
  32. /* Private types -------------------------------------------------------------*/
  33. /* Private variables ---------------------------------------------------------*/
  34. /** @defgroup RCC_LL_Private_Variables RCC Private Variables
  35. * @{
  36. */
  37. #if defined(RCC_DCKCFGR1_PLLSAIDIVR)
  38. static const uint8_t aRCC_PLLSAIDIVRPrescTable[4] = {2, 4, 8, 16};
  39. #endif /* RCC_DCKCFGR1_PLLSAIDIVR */
  40. /**
  41. * @}
  42. */
  43. /* Private constants ---------------------------------------------------------*/
  44. /* Private macros ------------------------------------------------------------*/
  45. #if defined(USE_FULL_LL_DRIVER)
  46. /** @defgroup RCC_LL_Private_Macros RCC Private Macros
  47. * @{
  48. */
  49. /**
  50. * @}
  51. */
  52. #endif /*USE_FULL_LL_DRIVER*/
  53. /* Exported types ------------------------------------------------------------*/
  54. #if defined(USE_FULL_LL_DRIVER)
  55. /** @defgroup RCC_LL_Exported_Types RCC Exported Types
  56. * @{
  57. */
  58. /** @defgroup LL_ES_CLOCK_FREQ Clocks Frequency Structure
  59. * @{
  60. */
  61. /**
  62. * @brief RCC Clocks Frequency Structure
  63. */
  64. typedef struct
  65. {
  66. uint32_t SYSCLK_Frequency; /*!< SYSCLK clock frequency */
  67. uint32_t HCLK_Frequency; /*!< HCLK clock frequency */
  68. uint32_t PCLK1_Frequency; /*!< PCLK1 clock frequency */
  69. uint32_t PCLK2_Frequency; /*!< PCLK2 clock frequency */
  70. } LL_RCC_ClocksTypeDef;
  71. /**
  72. * @}
  73. */
  74. /**
  75. * @}
  76. */
  77. #endif /* USE_FULL_LL_DRIVER */
  78. /* Exported constants --------------------------------------------------------*/
  79. /** @defgroup RCC_LL_Exported_Constants RCC Exported Constants
  80. * @{
  81. */
  82. /** @defgroup RCC_LL_EC_OSC_VALUES Oscillator Values adaptation
  83. * @brief Defines used to adapt values of different oscillators
  84. * @note These values could be modified in the user environment according to
  85. * HW set-up.
  86. * @{
  87. */
  88. #if !defined (HSE_VALUE)
  89. #define HSE_VALUE 25000000U /*!< Value of the HSE oscillator in Hz */
  90. #endif /* HSE_VALUE */
  91. #if !defined (HSI_VALUE)
  92. #define HSI_VALUE 16000000U /*!< Value of the HSI oscillator in Hz */
  93. #endif /* HSI_VALUE */
  94. #if !defined (LSE_VALUE)
  95. #define LSE_VALUE 32768U /*!< Value of the LSE oscillator in Hz */
  96. #endif /* LSE_VALUE */
  97. #if !defined (LSI_VALUE)
  98. #define LSI_VALUE 32000U /*!< Value of the LSI oscillator in Hz */
  99. #endif /* LSI_VALUE */
  100. #if !defined (EXTERNAL_CLOCK_VALUE)
  101. #define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the I2S_CKIN external oscillator in Hz */
  102. #endif /* EXTERNAL_CLOCK_VALUE */
  103. #if !defined (EXTERNAL_SAI1_CLOCK_VALUE)
  104. #define EXTERNAL_SAI1_CLOCK_VALUE 48000U /*!< Value of the SAI1_EXTCLK external oscillator in Hz */
  105. #endif /* EXTERNAL_SAI1_CLOCK_VALUE */
  106. #if !defined (EXTERNAL_SAI2_CLOCK_VALUE)
  107. #define EXTERNAL_SAI2_CLOCK_VALUE 48000U /*!< Value of the SAI2_EXTCLK external oscillator in Hz */
  108. #endif /* EXTERNAL_SAI2_CLOCK_VALUE */
  109. /**
  110. * @}
  111. */
  112. /** @defgroup RCC_LL_EC_CLEAR_FLAG Clear Flags Defines
  113. * @brief Flags defines which can be used with LL_RCC_WriteReg function
  114. * @{
  115. */
  116. #define LL_RCC_CIR_LSIRDYC RCC_CIR_LSIRDYC /*!< LSI Ready Interrupt Clear */
  117. #define LL_RCC_CIR_LSERDYC RCC_CIR_LSERDYC /*!< LSE Ready Interrupt Clear */
  118. #define LL_RCC_CIR_HSIRDYC RCC_CIR_HSIRDYC /*!< HSI Ready Interrupt Clear */
  119. #define LL_RCC_CIR_HSERDYC RCC_CIR_HSERDYC /*!< HSE Ready Interrupt Clear */
  120. #define LL_RCC_CIR_PLLRDYC RCC_CIR_PLLRDYC /*!< PLL Ready Interrupt Clear */
  121. #define LL_RCC_CIR_PLLI2SRDYC RCC_CIR_PLLI2SRDYC /*!< PLLI2S Ready Interrupt Clear */
  122. #define LL_RCC_CIR_PLLSAIRDYC RCC_CIR_PLLSAIRDYC /*!< PLLSAI Ready Interrupt Clear */
  123. #define LL_RCC_CIR_CSSC RCC_CIR_CSSC /*!< Clock Security System Interrupt Clear */
  124. /**
  125. * @}
  126. */
  127. /** @defgroup RCC_LL_EC_GET_FLAG Get Flags Defines
  128. * @brief Flags defines which can be used with LL_RCC_ReadReg function
  129. * @{
  130. */
  131. #define LL_RCC_CIR_LSIRDYF RCC_CIR_LSIRDYF /*!< LSI Ready Interrupt flag */
  132. #define LL_RCC_CIR_LSERDYF RCC_CIR_LSERDYF /*!< LSE Ready Interrupt flag */
  133. #define LL_RCC_CIR_HSIRDYF RCC_CIR_HSIRDYF /*!< HSI Ready Interrupt flag */
  134. #define LL_RCC_CIR_HSERDYF RCC_CIR_HSERDYF /*!< HSE Ready Interrupt flag */
  135. #define LL_RCC_CIR_PLLRDYF RCC_CIR_PLLRDYF /*!< PLL Ready Interrupt flag */
  136. #define LL_RCC_CIR_PLLI2SRDYF RCC_CIR_PLLI2SRDYF /*!< PLLI2S Ready Interrupt flag */
  137. #define LL_RCC_CIR_PLLSAIRDYF RCC_CIR_PLLSAIRDYF /*!< PLLSAI Ready Interrupt flag */
  138. #define LL_RCC_CIR_CSSF RCC_CIR_CSSF /*!< Clock Security System Interrupt flag */
  139. #define LL_RCC_CSR_LPWRRSTF RCC_CSR_LPWRRSTF /*!< Low-Power reset flag */
  140. #define LL_RCC_CSR_PINRSTF RCC_CSR_PINRSTF /*!< PIN reset flag */
  141. #define LL_RCC_CSR_PORRSTF RCC_CSR_PORRSTF /*!< POR/PDR reset flag */
  142. #define LL_RCC_CSR_SFTRSTF RCC_CSR_SFTRSTF /*!< Software Reset flag */
  143. #define LL_RCC_CSR_IWDGRSTF RCC_CSR_IWDGRSTF /*!< Independent Watchdog reset flag */
  144. #define LL_RCC_CSR_WWDGRSTF RCC_CSR_WWDGRSTF /*!< Window watchdog reset flag */
  145. #define LL_RCC_CSR_BORRSTF RCC_CSR_BORRSTF /*!< BOR reset flag */
  146. /**
  147. * @}
  148. */
  149. /** @defgroup RCC_LL_EC_IT IT Defines
  150. * @brief IT defines which can be used with LL_RCC_ReadReg and LL_RCC_WriteReg functions
  151. * @{
  152. */
  153. #define LL_RCC_CIR_LSIRDYIE RCC_CIR_LSIRDYIE /*!< LSI Ready Interrupt Enable */
  154. #define LL_RCC_CIR_LSERDYIE RCC_CIR_LSERDYIE /*!< LSE Ready Interrupt Enable */
  155. #define LL_RCC_CIR_HSIRDYIE RCC_CIR_HSIRDYIE /*!< HSI Ready Interrupt Enable */
  156. #define LL_RCC_CIR_HSERDYIE RCC_CIR_HSERDYIE /*!< HSE Ready Interrupt Enable */
  157. #define LL_RCC_CIR_PLLRDYIE RCC_CIR_PLLRDYIE /*!< PLL Ready Interrupt Enable */
  158. #define LL_RCC_CIR_PLLI2SRDYIE RCC_CIR_PLLI2SRDYIE /*!< PLLI2S Ready Interrupt Enable */
  159. #define LL_RCC_CIR_PLLSAIRDYIE RCC_CIR_PLLSAIRDYIE /*!< PLLSAI Ready Interrupt Enable */
  160. /**
  161. * @}
  162. */
  163. /** @defgroup RCC_LL_EC_LSEDRIVE LSE oscillator drive capability
  164. * @{
  165. */
  166. #define LL_RCC_LSEDRIVE_LOW 0x00000000U /*!< Xtal mode lower driving capability */
  167. #define LL_RCC_LSEDRIVE_MEDIUMHIGH RCC_BDCR_LSEDRV_0 /*!< Xtal mode medium high driving capability */
  168. #define LL_RCC_LSEDRIVE_MEDIUMLOW RCC_BDCR_LSEDRV_1 /*!< Xtal mode medium low driving capability */
  169. #define LL_RCC_LSEDRIVE_HIGH RCC_BDCR_LSEDRV /*!< Xtal mode higher driving capability */
  170. /**
  171. * @}
  172. */
  173. /** @defgroup RCC_LL_EC_SYS_CLKSOURCE System clock switch
  174. * @{
  175. */
  176. #define LL_RCC_SYS_CLKSOURCE_HSI RCC_CFGR_SW_HSI /*!< HSI selection as system clock */
  177. #define LL_RCC_SYS_CLKSOURCE_HSE RCC_CFGR_SW_HSE /*!< HSE selection as system clock */
  178. #define LL_RCC_SYS_CLKSOURCE_PLL RCC_CFGR_SW_PLL /*!< PLL selection as system clock */
  179. /**
  180. * @}
  181. */
  182. /** @defgroup RCC_LL_EC_SYS_CLKSOURCE_STATUS System clock switch status
  183. * @{
  184. */
  185. #define LL_RCC_SYS_CLKSOURCE_STATUS_HSI RCC_CFGR_SWS_HSI /*!< HSI used as system clock */
  186. #define LL_RCC_SYS_CLKSOURCE_STATUS_HSE RCC_CFGR_SWS_HSE /*!< HSE used as system clock */
  187. #define LL_RCC_SYS_CLKSOURCE_STATUS_PLL RCC_CFGR_SWS_PLL /*!< PLL used as system clock */
  188. /**
  189. * @}
  190. */
  191. /** @defgroup RCC_LL_EC_SYSCLK_DIV AHB prescaler
  192. * @{
  193. */
  194. #define LL_RCC_SYSCLK_DIV_1 RCC_CFGR_HPRE_DIV1 /*!< SYSCLK not divided */
  195. #define LL_RCC_SYSCLK_DIV_2 RCC_CFGR_HPRE_DIV2 /*!< SYSCLK divided by 2 */
  196. #define LL_RCC_SYSCLK_DIV_4 RCC_CFGR_HPRE_DIV4 /*!< SYSCLK divided by 4 */
  197. #define LL_RCC_SYSCLK_DIV_8 RCC_CFGR_HPRE_DIV8 /*!< SYSCLK divided by 8 */
  198. #define LL_RCC_SYSCLK_DIV_16 RCC_CFGR_HPRE_DIV16 /*!< SYSCLK divided by 16 */
  199. #define LL_RCC_SYSCLK_DIV_64 RCC_CFGR_HPRE_DIV64 /*!< SYSCLK divided by 64 */
  200. #define LL_RCC_SYSCLK_DIV_128 RCC_CFGR_HPRE_DIV128 /*!< SYSCLK divided by 128 */
  201. #define LL_RCC_SYSCLK_DIV_256 RCC_CFGR_HPRE_DIV256 /*!< SYSCLK divided by 256 */
  202. #define LL_RCC_SYSCLK_DIV_512 RCC_CFGR_HPRE_DIV512 /*!< SYSCLK divided by 512 */
  203. /**
  204. * @}
  205. */
  206. /** @defgroup RCC_LL_EC_APB1_DIV APB low-speed prescaler (APB1)
  207. * @{
  208. */
  209. #define LL_RCC_APB1_DIV_1 RCC_CFGR_PPRE1_DIV1 /*!< HCLK not divided */
  210. #define LL_RCC_APB1_DIV_2 RCC_CFGR_PPRE1_DIV2 /*!< HCLK divided by 2 */
  211. #define LL_RCC_APB1_DIV_4 RCC_CFGR_PPRE1_DIV4 /*!< HCLK divided by 4 */
  212. #define LL_RCC_APB1_DIV_8 RCC_CFGR_PPRE1_DIV8 /*!< HCLK divided by 8 */
  213. #define LL_RCC_APB1_DIV_16 RCC_CFGR_PPRE1_DIV16 /*!< HCLK divided by 16 */
  214. /**
  215. * @}
  216. */
  217. /** @defgroup RCC_LL_EC_APB2_DIV APB high-speed prescaler (APB2)
  218. * @{
  219. */
  220. #define LL_RCC_APB2_DIV_1 RCC_CFGR_PPRE2_DIV1 /*!< HCLK not divided */
  221. #define LL_RCC_APB2_DIV_2 RCC_CFGR_PPRE2_DIV2 /*!< HCLK divided by 2 */
  222. #define LL_RCC_APB2_DIV_4 RCC_CFGR_PPRE2_DIV4 /*!< HCLK divided by 4 */
  223. #define LL_RCC_APB2_DIV_8 RCC_CFGR_PPRE2_DIV8 /*!< HCLK divided by 8 */
  224. #define LL_RCC_APB2_DIV_16 RCC_CFGR_PPRE2_DIV16 /*!< HCLK divided by 16 */
  225. /**
  226. * @}
  227. */
  228. /** @defgroup RCC_LL_EC_MCOxSOURCE MCO source selection
  229. * @{
  230. */
  231. #define LL_RCC_MCO1SOURCE_HSI (uint32_t)(RCC_CFGR_MCO1|0x00000000U) /*!< HSI selection as MCO1 source */
  232. #define LL_RCC_MCO1SOURCE_LSE (uint32_t)(RCC_CFGR_MCO1|(RCC_CFGR_MCO1_0 >> 16U)) /*!< LSE selection as MCO1 source */
  233. #define LL_RCC_MCO1SOURCE_HSE (uint32_t)(RCC_CFGR_MCO1|(RCC_CFGR_MCO1_1 >> 16U)) /*!< HSE selection as MCO1 source */
  234. #define LL_RCC_MCO1SOURCE_PLLCLK (uint32_t)(RCC_CFGR_MCO1|((RCC_CFGR_MCO1_1|RCC_CFGR_MCO1_0) >> 16U)) /*!< PLLCLK selection as MCO1 source */
  235. #define LL_RCC_MCO2SOURCE_SYSCLK (uint32_t)(RCC_CFGR_MCO2|0x00000000U) /*!< SYSCLK selection as MCO2 source */
  236. #define LL_RCC_MCO2SOURCE_PLLI2S (uint32_t)(RCC_CFGR_MCO2|(RCC_CFGR_MCO2_0 >> 16U)) /*!< PLLI2S selection as MCO2 source */
  237. #define LL_RCC_MCO2SOURCE_HSE (uint32_t)(RCC_CFGR_MCO2|(RCC_CFGR_MCO2_1 >> 16U)) /*!< HSE selection as MCO2 source */
  238. #define LL_RCC_MCO2SOURCE_PLLCLK (uint32_t)(RCC_CFGR_MCO2|((RCC_CFGR_MCO2_1|RCC_CFGR_MCO2_0) >> 16U)) /*!< PLLCLK selection as MCO2 source */
  239. /**
  240. * @}
  241. */
  242. /** @defgroup RCC_LL_EC_MCOx_DIV MCO prescaler
  243. * @{
  244. */
  245. #define LL_RCC_MCO1_DIV_1 (uint32_t)(RCC_CFGR_MCO1PRE|0x00000000U) /*!< MCO1 not divided */
  246. #define LL_RCC_MCO1_DIV_2 (uint32_t)(RCC_CFGR_MCO1PRE|(RCC_CFGR_MCO1PRE_2 >> 16U)) /*!< MCO1 divided by 2 */
  247. #define LL_RCC_MCO1_DIV_3 (uint32_t)(RCC_CFGR_MCO1PRE|((RCC_CFGR_MCO1PRE_2|RCC_CFGR_MCO1PRE_0) >> 16U)) /*!< MCO1 divided by 3 */
  248. #define LL_RCC_MCO1_DIV_4 (uint32_t)(RCC_CFGR_MCO1PRE|((RCC_CFGR_MCO1PRE_2|RCC_CFGR_MCO1PRE_1) >> 16U)) /*!< MCO1 divided by 4 */
  249. #define LL_RCC_MCO1_DIV_5 (uint32_t)(RCC_CFGR_MCO1PRE|(RCC_CFGR_MCO1PRE >> 16U)) /*!< MCO1 divided by 5 */
  250. #define LL_RCC_MCO2_DIV_1 (uint32_t)(RCC_CFGR_MCO2PRE|0x00000000U) /*!< MCO2 not divided */
  251. #define LL_RCC_MCO2_DIV_2 (uint32_t)(RCC_CFGR_MCO2PRE|(RCC_CFGR_MCO2PRE_2 >> 16U)) /*!< MCO2 divided by 2 */
  252. #define LL_RCC_MCO2_DIV_3 (uint32_t)(RCC_CFGR_MCO2PRE|((RCC_CFGR_MCO2PRE_2|RCC_CFGR_MCO2PRE_0) >> 16U)) /*!< MCO2 divided by 3 */
  253. #define LL_RCC_MCO2_DIV_4 (uint32_t)(RCC_CFGR_MCO2PRE|((RCC_CFGR_MCO2PRE_2|RCC_CFGR_MCO2PRE_1) >> 16U)) /*!< MCO2 divided by 4 */
  254. #define LL_RCC_MCO2_DIV_5 (uint32_t)(RCC_CFGR_MCO2PRE|(RCC_CFGR_MCO2PRE >> 16U)) /*!< MCO2 divided by 5 */
  255. /**
  256. * @}
  257. */
  258. /** @defgroup RCC_LL_EC_RTC_HSEDIV HSE prescaler for RTC clock
  259. * @{
  260. */
  261. #define LL_RCC_RTC_NOCLOCK 0x00000000U /*!< HSE not divided */
  262. #define LL_RCC_RTC_HSE_DIV_2 RCC_CFGR_RTCPRE_1 /*!< HSE clock divided by 2 */
  263. #define LL_RCC_RTC_HSE_DIV_3 (RCC_CFGR_RTCPRE_1|RCC_CFGR_RTCPRE_0) /*!< HSE clock divided by 3 */
  264. #define LL_RCC_RTC_HSE_DIV_4 RCC_CFGR_RTCPRE_2 /*!< HSE clock divided by 4 */
  265. #define LL_RCC_RTC_HSE_DIV_5 (RCC_CFGR_RTCPRE_2|RCC_CFGR_RTCPRE_0) /*!< HSE clock divided by 5 */
  266. #define LL_RCC_RTC_HSE_DIV_6 (RCC_CFGR_RTCPRE_2|RCC_CFGR_RTCPRE_1) /*!< HSE clock divided by 6 */
  267. #define LL_RCC_RTC_HSE_DIV_7 (RCC_CFGR_RTCPRE_2|RCC_CFGR_RTCPRE_1|RCC_CFGR_RTCPRE_0) /*!< HSE clock divided by 7 */
  268. #define LL_RCC_RTC_HSE_DIV_8 RCC_CFGR_RTCPRE_3 /*!< HSE clock divided by 8 */
  269. #define LL_RCC_RTC_HSE_DIV_9 (RCC_CFGR_RTCPRE_3|RCC_CFGR_RTCPRE_0) /*!< HSE clock divided by 9 */
  270. #define LL_RCC_RTC_HSE_DIV_10 (RCC_CFGR_RTCPRE_3|RCC_CFGR_RTCPRE_1) /*!< HSE clock divided by 10 */
  271. #define LL_RCC_RTC_HSE_DIV_11 (RCC_CFGR_RTCPRE_3|RCC_CFGR_RTCPRE_1|RCC_CFGR_RTCPRE_0) /*!< HSE clock divided by 11 */
  272. #define LL_RCC_RTC_HSE_DIV_12 (RCC_CFGR_RTCPRE_3|RCC_CFGR_RTCPRE_2) /*!< HSE clock divided by 12 */
  273. #define LL_RCC_RTC_HSE_DIV_13 (RCC_CFGR_RTCPRE_3|RCC_CFGR_RTCPRE_2|RCC_CFGR_RTCPRE_0) /*!< HSE clock divided by 13 */
  274. #define LL_RCC_RTC_HSE_DIV_14 (RCC_CFGR_RTCPRE_3|RCC_CFGR_RTCPRE_2|RCC_CFGR_RTCPRE_1) /*!< HSE clock divided by 14 */
  275. #define LL_RCC_RTC_HSE_DIV_15 (RCC_CFGR_RTCPRE_3|RCC_CFGR_RTCPRE_2|RCC_CFGR_RTCPRE_1|RCC_CFGR_RTCPRE_0) /*!< HSE clock divided by 15 */
  276. #define LL_RCC_RTC_HSE_DIV_16 RCC_CFGR_RTCPRE_4 /*!< HSE clock divided by 16 */
  277. #define LL_RCC_RTC_HSE_DIV_17 (RCC_CFGR_RTCPRE_4|RCC_CFGR_RTCPRE_0) /*!< HSE clock divided by 17 */
  278. #define LL_RCC_RTC_HSE_DIV_18 (RCC_CFGR_RTCPRE_4|RCC_CFGR_RTCPRE_1) /*!< HSE clock divided by 18 */
  279. #define LL_RCC_RTC_HSE_DIV_19 (RCC_CFGR_RTCPRE_4|RCC_CFGR_RTCPRE_1|RCC_CFGR_RTCPRE_0) /*!< HSE clock divided by 19 */
  280. #define LL_RCC_RTC_HSE_DIV_20 (RCC_CFGR_RTCPRE_4|RCC_CFGR_RTCPRE_2) /*!< HSE clock divided by 20 */
  281. #define LL_RCC_RTC_HSE_DIV_21 (RCC_CFGR_RTCPRE_4|RCC_CFGR_RTCPRE_2|RCC_CFGR_RTCPRE_0) /*!< HSE clock divided by 21 */
  282. #define LL_RCC_RTC_HSE_DIV_22 (RCC_CFGR_RTCPRE_4|RCC_CFGR_RTCPRE_2|RCC_CFGR_RTCPRE_1) /*!< HSE clock divided by 22 */
  283. #define LL_RCC_RTC_HSE_DIV_23 (RCC_CFGR_RTCPRE_4|RCC_CFGR_RTCPRE_2|RCC_CFGR_RTCPRE_1|RCC_CFGR_RTCPRE_0) /*!< HSE clock divided by 23 */
  284. #define LL_RCC_RTC_HSE_DIV_24 (RCC_CFGR_RTCPRE_4|RCC_CFGR_RTCPRE_3) /*!< HSE clock divided by 24 */
  285. #define LL_RCC_RTC_HSE_DIV_25 (RCC_CFGR_RTCPRE_4|RCC_CFGR_RTCPRE_3|RCC_CFGR_RTCPRE_0) /*!< HSE clock divided by 25 */
  286. #define LL_RCC_RTC_HSE_DIV_26 (RCC_CFGR_RTCPRE_4|RCC_CFGR_RTCPRE_3|RCC_CFGR_RTCPRE_1) /*!< HSE clock divided by 26 */
  287. #define LL_RCC_RTC_HSE_DIV_27 (RCC_CFGR_RTCPRE_4|RCC_CFGR_RTCPRE_3|RCC_CFGR_RTCPRE_1|RCC_CFGR_RTCPRE_0) /*!< HSE clock divided by 27 */
  288. #define LL_RCC_RTC_HSE_DIV_28 (RCC_CFGR_RTCPRE_4|RCC_CFGR_RTCPRE_3|RCC_CFGR_RTCPRE_2) /*!< HSE clock divided by 28 */
  289. #define LL_RCC_RTC_HSE_DIV_29 (RCC_CFGR_RTCPRE_4|RCC_CFGR_RTCPRE_3|RCC_CFGR_RTCPRE_2|RCC_CFGR_RTCPRE_0) /*!< HSE clock divided by 29 */
  290. #define LL_RCC_RTC_HSE_DIV_30 (RCC_CFGR_RTCPRE_4|RCC_CFGR_RTCPRE_3|RCC_CFGR_RTCPRE_2|RCC_CFGR_RTCPRE_1) /*!< HSE clock divided by 30 */
  291. #define LL_RCC_RTC_HSE_DIV_31 (RCC_CFGR_RTCPRE_4|RCC_CFGR_RTCPRE_3|RCC_CFGR_RTCPRE_2|RCC_CFGR_RTCPRE_1|RCC_CFGR_RTCPRE_0) /*!< HSE clock divided by 31 */
  292. /**
  293. * @}
  294. */
  295. #if defined(USE_FULL_LL_DRIVER)
  296. /** @defgroup RCC_LL_EC_PERIPH_FREQUENCY Peripheral clock frequency
  297. * @{
  298. */
  299. #define LL_RCC_PERIPH_FREQUENCY_NO 0x00000000U /*!< No clock enabled for the peripheral */
  300. #define LL_RCC_PERIPH_FREQUENCY_NA 0xFFFFFFFFU /*!< Frequency cannot be provided as external clock */
  301. /**
  302. * @}
  303. */
  304. #endif /* USE_FULL_LL_DRIVER */
  305. /** @defgroup RCC_LL_EC_USARTx_CLKSOURCE Peripheral USART clock source selection
  306. * @{
  307. */
  308. #define LL_RCC_USART1_CLKSOURCE_PCLK2 (uint32_t)((RCC_DCKCFGR2_USART1SEL << 16U) | 0x00000000U) /*!< PCLK2 clock used as USART1 clock source */
  309. #define LL_RCC_USART1_CLKSOURCE_SYSCLK (uint32_t)((RCC_DCKCFGR2_USART1SEL << 16U) | RCC_DCKCFGR2_USART1SEL_0) /*!< SYSCLK clock used as USART1 clock source */
  310. #define LL_RCC_USART1_CLKSOURCE_HSI (uint32_t)((RCC_DCKCFGR2_USART1SEL << 16U) | RCC_DCKCFGR2_USART1SEL_1) /*!< HSI clock used as USART1 clock source */
  311. #define LL_RCC_USART1_CLKSOURCE_LSE (uint32_t)((RCC_DCKCFGR2_USART1SEL << 16U) | RCC_DCKCFGR2_USART1SEL) /*!< LSE clock used as USART1 clock source */
  312. #define LL_RCC_USART2_CLKSOURCE_PCLK1 (uint32_t)((RCC_DCKCFGR2_USART2SEL << 16U) | 0x00000000U) /*!< PCLK1 clock used as USART2 clock source */
  313. #define LL_RCC_USART2_CLKSOURCE_SYSCLK (uint32_t)((RCC_DCKCFGR2_USART2SEL << 16U) | RCC_DCKCFGR2_USART2SEL_0) /*!< SYSCLK clock used as USART2 clock source */
  314. #define LL_RCC_USART2_CLKSOURCE_HSI (uint32_t)((RCC_DCKCFGR2_USART2SEL << 16U) | RCC_DCKCFGR2_USART2SEL_1) /*!< HSI clock used as USART2 clock source */
  315. #define LL_RCC_USART2_CLKSOURCE_LSE (uint32_t)((RCC_DCKCFGR2_USART2SEL << 16U) | RCC_DCKCFGR2_USART2SEL) /*!< LSE clock used as USART2 clock source */
  316. #define LL_RCC_USART3_CLKSOURCE_PCLK1 (uint32_t)((RCC_DCKCFGR2_USART3SEL << 16U) | 0x00000000U) /*!< PCLK1 clock used as USART3 clock source */
  317. #define LL_RCC_USART3_CLKSOURCE_SYSCLK (uint32_t)((RCC_DCKCFGR2_USART3SEL << 16U) | RCC_DCKCFGR2_USART3SEL_0) /*!< SYSCLK clock used as USART3 clock source */
  318. #define LL_RCC_USART3_CLKSOURCE_HSI (uint32_t)((RCC_DCKCFGR2_USART3SEL << 16U) | RCC_DCKCFGR2_USART3SEL_1) /*!< HSI clock used as USART3 clock source */
  319. #define LL_RCC_USART3_CLKSOURCE_LSE (uint32_t)((RCC_DCKCFGR2_USART3SEL << 16U) | RCC_DCKCFGR2_USART3SEL) /*!< LSE clock used as USART3 clock source */
  320. #define LL_RCC_USART6_CLKSOURCE_PCLK2 (uint32_t)((RCC_DCKCFGR2_USART6SEL << 16U) | 0x00000000U) /*!< PCLK2 clock used as USART6 clock source */
  321. #define LL_RCC_USART6_CLKSOURCE_SYSCLK (uint32_t)((RCC_DCKCFGR2_USART6SEL << 16U) | RCC_DCKCFGR2_USART6SEL_0) /*!< SYSCLK clock used as USART6 clock source */
  322. #define LL_RCC_USART6_CLKSOURCE_HSI (uint32_t)((RCC_DCKCFGR2_USART6SEL << 16U) | RCC_DCKCFGR2_USART6SEL_1) /*!< HSI clock used as USART6 clock source */
  323. #define LL_RCC_USART6_CLKSOURCE_LSE (uint32_t)((RCC_DCKCFGR2_USART6SEL << 16U) | RCC_DCKCFGR2_USART6SEL) /*!< LSE clock used as USART6 clock source */
  324. /**
  325. * @}
  326. */
  327. /** @defgroup RCC_LL_EC_UARTx_CLKSOURCE Peripheral UART clock source selection
  328. * @{
  329. */
  330. #define LL_RCC_UART4_CLKSOURCE_PCLK1 (uint32_t)((RCC_DCKCFGR2_UART4SEL << 16U) | 0x00000000U) /*!< PCLK1 clock used as UART4 clock source */
  331. #define LL_RCC_UART4_CLKSOURCE_SYSCLK (uint32_t)((RCC_DCKCFGR2_UART4SEL << 16U) | RCC_DCKCFGR2_UART4SEL_0) /*!< SYSCLK clock used as UART4 clock source */
  332. #define LL_RCC_UART4_CLKSOURCE_HSI (uint32_t)((RCC_DCKCFGR2_UART4SEL << 16U) | RCC_DCKCFGR2_UART4SEL_1) /*!< HSI clock used as UART4 clock source */
  333. #define LL_RCC_UART4_CLKSOURCE_LSE (uint32_t)((RCC_DCKCFGR2_UART4SEL << 16U) | RCC_DCKCFGR2_UART4SEL) /*!< LSE clock used as UART4 clock source */
  334. #define LL_RCC_UART5_CLKSOURCE_PCLK1 (uint32_t)((RCC_DCKCFGR2_UART5SEL << 16U) | 0x00000000U) /*!< PCLK1 clock used as UART5 clock source */
  335. #define LL_RCC_UART5_CLKSOURCE_SYSCLK (uint32_t)((RCC_DCKCFGR2_UART5SEL << 16U) | RCC_DCKCFGR2_UART5SEL_0) /*!< SYSCLK clock used as UART5 clock source */
  336. #define LL_RCC_UART5_CLKSOURCE_HSI (uint32_t)((RCC_DCKCFGR2_UART5SEL << 16U) | RCC_DCKCFGR2_UART5SEL_1) /*!< HSI clock used as UART5 clock source */
  337. #define LL_RCC_UART5_CLKSOURCE_LSE (uint32_t)((RCC_DCKCFGR2_UART5SEL << 16U) | RCC_DCKCFGR2_UART5SEL) /*!< LSE clock used as UART5 clock source */
  338. #define LL_RCC_UART7_CLKSOURCE_PCLK1 (uint32_t)((RCC_DCKCFGR2_UART7SEL << 16U) | 0x00000000U) /*!< PCLK1 clock used as UART7 clock source */
  339. #define LL_RCC_UART7_CLKSOURCE_SYSCLK (uint32_t)((RCC_DCKCFGR2_UART7SEL << 16U) | RCC_DCKCFGR2_UART7SEL_0) /*!< SYSCLK clock used as UART7 clock source */
  340. #define LL_RCC_UART7_CLKSOURCE_HSI (uint32_t)((RCC_DCKCFGR2_UART7SEL << 16U) | RCC_DCKCFGR2_UART7SEL_1) /*!< HSI clock used as UART7 clock source */
  341. #define LL_RCC_UART7_CLKSOURCE_LSE (uint32_t)((RCC_DCKCFGR2_UART7SEL << 16U) | RCC_DCKCFGR2_UART7SEL) /*!< LSE clock used as UART7 clock source */
  342. #define LL_RCC_UART8_CLKSOURCE_PCLK1 (uint32_t)((RCC_DCKCFGR2_UART8SEL << 16U) | 0x00000000U) /*!< PCLK1 clock used as UART8 clock source */
  343. #define LL_RCC_UART8_CLKSOURCE_SYSCLK (uint32_t)((RCC_DCKCFGR2_UART8SEL << 16U) | RCC_DCKCFGR2_UART8SEL_0) /*!< SYSCLK clock used as UART8 clock source */
  344. #define LL_RCC_UART8_CLKSOURCE_HSI (uint32_t)((RCC_DCKCFGR2_UART8SEL << 16U) | RCC_DCKCFGR2_UART8SEL_1) /*!< HSI clock used as UART8 clock source */
  345. #define LL_RCC_UART8_CLKSOURCE_LSE (uint32_t)((RCC_DCKCFGR2_UART8SEL << 16U) | RCC_DCKCFGR2_UART8SEL) /*!< LSE clock used as UART8 clock source */
  346. /**
  347. * @}
  348. */
  349. /** @defgroup RCC_LL_EC_I2Cx_CLKSOURCE Peripheral I2C clock source selection
  350. * @{
  351. */
  352. #define LL_RCC_I2C1_CLKSOURCE_PCLK1 (uint32_t)(RCC_DCKCFGR2_I2C1SEL|0x00000000U) /*!< PCLK1 clock used as I2C1 clock source */
  353. #define LL_RCC_I2C1_CLKSOURCE_SYSCLK (uint32_t)(RCC_DCKCFGR2_I2C1SEL|(RCC_DCKCFGR2_I2C1SEL_0 >> 16U)) /*!< SYSCLK clock used as I2C1 clock source */
  354. #define LL_RCC_I2C1_CLKSOURCE_HSI (uint32_t)(RCC_DCKCFGR2_I2C1SEL|(RCC_DCKCFGR2_I2C1SEL_1 >> 16U)) /*!< HSI clock used as I2C1 clock source */
  355. #define LL_RCC_I2C2_CLKSOURCE_PCLK1 (uint32_t)(RCC_DCKCFGR2_I2C2SEL|0x00000000U) /*!< PCLK1 clock used as I2C2 clock source */
  356. #define LL_RCC_I2C2_CLKSOURCE_SYSCLK (uint32_t)(RCC_DCKCFGR2_I2C2SEL|(RCC_DCKCFGR2_I2C2SEL_0 >> 16U)) /*!< SYSCLK clock used as I2C2 clock source */
  357. #define LL_RCC_I2C2_CLKSOURCE_HSI (uint32_t)(RCC_DCKCFGR2_I2C2SEL|(RCC_DCKCFGR2_I2C2SEL_1 >> 16U)) /*!< HSI clock used as I2C2 clock source */
  358. #define LL_RCC_I2C3_CLKSOURCE_PCLK1 (uint32_t)(RCC_DCKCFGR2_I2C3SEL|0x00000000U) /*!< PCLK1 clock used as I2C3 clock source */
  359. #define LL_RCC_I2C3_CLKSOURCE_SYSCLK (uint32_t)(RCC_DCKCFGR2_I2C3SEL|(RCC_DCKCFGR2_I2C3SEL_0 >> 16U)) /*!< SYSCLK clock used as I2C3 clock source */
  360. #define LL_RCC_I2C3_CLKSOURCE_HSI (uint32_t)(RCC_DCKCFGR2_I2C3SEL|(RCC_DCKCFGR2_I2C3SEL_1 >> 16U)) /*!< HSI clock used as I2C3 clock source */
  361. #if defined(I2C4)
  362. #define LL_RCC_I2C4_CLKSOURCE_PCLK1 (uint32_t)(RCC_DCKCFGR2_I2C4SEL|0x00000000U) /*!< PCLK1 clock used as I2C4 clock source */
  363. #define LL_RCC_I2C4_CLKSOURCE_SYSCLK (uint32_t)(RCC_DCKCFGR2_I2C4SEL|(RCC_DCKCFGR2_I2C4SEL_0 >> 16U)) /*!< SYSCLK clock used as I2C4 clock source */
  364. #define LL_RCC_I2C4_CLKSOURCE_HSI (uint32_t)(RCC_DCKCFGR2_I2C4SEL|(RCC_DCKCFGR2_I2C4SEL_1 >> 16U)) /*!< HSI clock used as I2C4 clock source */
  365. #endif /* I2C4 */
  366. /**
  367. * @}
  368. */
  369. /** @defgroup RCC_LL_EC_LPTIM1_CLKSOURCE Peripheral LPTIM clock source selection
  370. * @{
  371. */
  372. #define LL_RCC_LPTIM1_CLKSOURCE_PCLK1 0x00000000U /*!< PCLK1 clock used as LPTIM1 clock */
  373. #define LL_RCC_LPTIM1_CLKSOURCE_LSI RCC_DCKCFGR2_LPTIM1SEL_0 /*!< LSI oscillator clock used as LPTIM1 clock */
  374. #define LL_RCC_LPTIM1_CLKSOURCE_HSI RCC_DCKCFGR2_LPTIM1SEL_1 /*!< HSI oscillator clock used as LPTIM1 clock */
  375. #define LL_RCC_LPTIM1_CLKSOURCE_LSE (uint32_t)(RCC_DCKCFGR2_LPTIM1SEL_1 | RCC_DCKCFGR2_LPTIM1SEL_0) /*!< LSE oscillator clock used as LPTIM1 clock */
  376. /**
  377. * @}
  378. */
  379. /** @defgroup RCC_LL_EC_SAIx_CLKSOURCE Peripheral SAI clock source selection
  380. * @{
  381. */
  382. #define LL_RCC_SAI1_CLKSOURCE_PLLSAI (uint32_t)(RCC_DCKCFGR1_SAI1SEL | 0x00000000U) /*!< PLLSAI clock used as SAI1 clock source */
  383. #define LL_RCC_SAI1_CLKSOURCE_PLLI2S (uint32_t)(RCC_DCKCFGR1_SAI1SEL | (RCC_DCKCFGR1_SAI1SEL_0 >> 16U)) /*!< PLLI2S clock used as SAI1 clock source */
  384. #define LL_RCC_SAI1_CLKSOURCE_PIN (uint32_t)(RCC_DCKCFGR1_SAI1SEL | (RCC_DCKCFGR1_SAI1SEL_1 >> 16U)) /*!< External pin clock used as SAI1 clock source */
  385. #if defined(RCC_SAI1SEL_PLLSRC_SUPPORT)
  386. #define LL_RCC_SAI1_CLKSOURCE_PLLSRC (uint32_t)(RCC_DCKCFGR1_SAI1SEL | (RCC_DCKCFGR1_SAI1SEL >> 16U)) /*!< Main source clock used as SAI1 clock source */
  387. #endif /* RCC_SAI1SEL_PLLSRC_SUPPORT */
  388. #define LL_RCC_SAI2_CLKSOURCE_PLLSAI (uint32_t)(RCC_DCKCFGR1_SAI2SEL | 0x00000000U) /*!< PLLSAI clock used as SAI2 clock source */
  389. #define LL_RCC_SAI2_CLKSOURCE_PLLI2S (uint32_t)(RCC_DCKCFGR1_SAI2SEL | (RCC_DCKCFGR1_SAI2SEL_0 >> 16U)) /*!< PLLI2S clock used as SAI2 clock source */
  390. #define LL_RCC_SAI2_CLKSOURCE_PIN (uint32_t)(RCC_DCKCFGR1_SAI2SEL | (RCC_DCKCFGR1_SAI2SEL_1 >> 16U)) /*!< External pin clock used as SAI2 clock source */
  391. #if defined(RCC_SAI2SEL_PLLSRC_SUPPORT)
  392. #define LL_RCC_SAI2_CLKSOURCE_PLLSRC (uint32_t)(RCC_DCKCFGR1_SAI2SEL | (RCC_DCKCFGR1_SAI2SEL >> 16U)) /*!< Main source clock used as SAI2 clock source */
  393. #endif /* RCC_SAI2SEL_PLLSRC_SUPPORT */
  394. /**
  395. * @}
  396. */
  397. /** @defgroup RCC_LL_EC_SDMMCx_CLKSOURCE Peripheral SDMMC clock source selection
  398. * @{
  399. */
  400. #define LL_RCC_SDMMC1_CLKSOURCE_PLL48CLK (uint32_t)(RCC_DCKCFGR2_SDMMC1SEL | 0x00000000U) /*!< PLL 48M domain clock used as SDMMC1 clock */
  401. #define LL_RCC_SDMMC1_CLKSOURCE_SYSCLK (uint32_t)(RCC_DCKCFGR2_SDMMC1SEL | (RCC_DCKCFGR2_SDMMC1SEL >> 16U)) /*!< System clock clock used as SDMMC1 clock */
  402. #if defined(SDMMC2)
  403. #define LL_RCC_SDMMC2_CLKSOURCE_PLL48CLK (uint32_t)(RCC_DCKCFGR2_SDMMC2SEL | 0x00000000U) /*!< PLL 48M domain clock used as SDMMC2 clock */
  404. #define LL_RCC_SDMMC2_CLKSOURCE_SYSCLK (uint32_t)(RCC_DCKCFGR2_SDMMC2SEL | (RCC_DCKCFGR2_SDMMC2SEL >> 16U)) /*!< System clock clock used as SDMMC2 clock */
  405. #endif /* SDMMC2 */
  406. /**
  407. * @}
  408. */
  409. /** @defgroup RCC_LL_EC_RNG_CLKSOURCE Peripheral RNG clock source selection
  410. * @{
  411. */
  412. #define LL_RCC_RNG_CLKSOURCE_PLL 0x00000000U /*!< PLL clock used as RNG clock source */
  413. #define LL_RCC_RNG_CLKSOURCE_PLLSAI RCC_DCKCFGR2_CK48MSEL /*!< PLLSAI clock used as RNG clock source */
  414. /**
  415. * @}
  416. */
  417. /** @defgroup RCC_LL_EC_USB_CLKSOURCE Peripheral USB clock source selection
  418. * @{
  419. */
  420. #define LL_RCC_USB_CLKSOURCE_PLL 0x00000000U /*!< PLL clock used as USB clock source */
  421. #define LL_RCC_USB_CLKSOURCE_PLLSAI RCC_DCKCFGR2_CK48MSEL /*!< PLLSAI1 clock used as USB clock source */
  422. /**
  423. * @}
  424. */
  425. #if defined(DSI)
  426. /** @defgroup RCC_LL_EC_DSI_CLKSOURCE Peripheral DSI clock source selection
  427. * @{
  428. */
  429. #define LL_RCC_DSI_CLKSOURCE_PHY 0x00000000U /*!< DSI-PHY clock used as DSI byte lane clock source */
  430. #define LL_RCC_DSI_CLKSOURCE_PLL RCC_DCKCFGR2_DSISEL /*!< PLL clock used as DSI byte lane clock source */
  431. /**
  432. * @}
  433. */
  434. #endif /* DSI */
  435. #if defined(CEC)
  436. /** @defgroup RCC_LL_EC_CEC_CLKSOURCE Peripheral CEC clock source selection
  437. * @{
  438. */
  439. #define LL_RCC_CEC_CLKSOURCE_LSE 0x00000000U /*!< LSE oscillator clock used as CEC clock */
  440. #define LL_RCC_CEC_CLKSOURCE_HSI_DIV488 RCC_DCKCFGR2_CECSEL /*!< HSI oscillator clock divided by 488 used as CEC clock */
  441. /**
  442. * @}
  443. */
  444. #endif /* CEC */
  445. /** @defgroup RCC_LL_EC_I2S1_CLKSOURCE Peripheral I2S clock source selection
  446. * @{
  447. */
  448. #define LL_RCC_I2S1_CLKSOURCE_PLLI2S 0x00000000U /*!< I2S oscillator clock used as I2S1 clock */
  449. #define LL_RCC_I2S1_CLKSOURCE_PIN RCC_CFGR_I2SSRC /*!< External pin clock used as I2S1 clock */
  450. /**
  451. * @}
  452. */
  453. /** @defgroup RCC_LL_EC_CK48M_CLKSOURCE Peripheral 48Mhz domain clock source selection
  454. * @{
  455. */
  456. #define LL_RCC_CK48M_CLKSOURCE_PLL 0x00000000U /*!< PLL oscillator clock used as 48Mhz domain clock */
  457. #define LL_RCC_CK48M_CLKSOURCE_PLLSAI RCC_DCKCFGR2_CK48MSEL /*!< PLLSAI oscillator clock used as 48Mhz domain clock */
  458. /**
  459. * @}
  460. */
  461. #if defined(DFSDM1_Channel0)
  462. /** @defgroup RCC_LL_EC_DFSDM1_AUDIO_CLKSOURCE Peripheral DFSDM Audio clock source selection
  463. * @{
  464. */
  465. #define LL_RCC_DFSDM1_AUDIO_CLKSOURCE_SAI1 0x00000000U /*!< SAI1 clock used as DFSDM1 Audio clock */
  466. #define LL_RCC_DFSDM1_AUDIO_CLKSOURCE_SAI2 RCC_DCKCFGR1_ADFSDM1SEL /*!< SAI2 clock used as DFSDM1 Audio clock */
  467. /**
  468. * @}
  469. */
  470. /** @defgroup RCC_LL_EC_DFSDM1_CLKSOURCE Peripheral DFSDM clock source selection
  471. * @{
  472. */
  473. #define LL_RCC_DFSDM1_CLKSOURCE_PCLK2 0x00000000U /*!< PCLK2 clock used as DFSDM1 clock */
  474. #define LL_RCC_DFSDM1_CLKSOURCE_SYSCLK RCC_DCKCFGR1_DFSDM1SEL /*!< System clock used as DFSDM1 clock */
  475. /**
  476. * @}
  477. */
  478. #endif /* DFSDM1_Channel0 */
  479. /** @defgroup RCC_LL_EC_USARTx Peripheral USART get clock source
  480. * @{
  481. */
  482. #define LL_RCC_USART1_CLKSOURCE RCC_DCKCFGR2_USART1SEL /*!< USART1 Clock source selection */
  483. #define LL_RCC_USART2_CLKSOURCE RCC_DCKCFGR2_USART2SEL /*!< USART2 Clock source selection */
  484. #define LL_RCC_USART3_CLKSOURCE RCC_DCKCFGR2_USART3SEL /*!< USART3 Clock source selection */
  485. #define LL_RCC_USART6_CLKSOURCE RCC_DCKCFGR2_USART6SEL /*!< USART6 Clock source selection */
  486. /**
  487. * @}
  488. */
  489. /** @defgroup RCC_LL_EC_UARTx Peripheral UART get clock source
  490. * @{
  491. */
  492. #define LL_RCC_UART4_CLKSOURCE RCC_DCKCFGR2_UART4SEL /*!< UART4 Clock source selection */
  493. #define LL_RCC_UART5_CLKSOURCE RCC_DCKCFGR2_UART5SEL /*!< UART5 Clock source selection */
  494. #define LL_RCC_UART7_CLKSOURCE RCC_DCKCFGR2_UART7SEL /*!< UART7 Clock source selection */
  495. #define LL_RCC_UART8_CLKSOURCE RCC_DCKCFGR2_UART8SEL /*!< UART8 Clock source selection */
  496. /**
  497. * @}
  498. */
  499. /** @defgroup RCC_LL_EC_I2Cx Peripheral I2C get clock source
  500. * @{
  501. */
  502. #define LL_RCC_I2C1_CLKSOURCE RCC_DCKCFGR2_I2C1SEL /*!< I2C1 Clock source selection */
  503. #define LL_RCC_I2C2_CLKSOURCE RCC_DCKCFGR2_I2C2SEL /*!< I2C2 Clock source selection */
  504. #define LL_RCC_I2C3_CLKSOURCE RCC_DCKCFGR2_I2C3SEL /*!< I2C3 Clock source selection */
  505. #if defined(I2C4)
  506. #define LL_RCC_I2C4_CLKSOURCE RCC_DCKCFGR2_I2C4SEL /*!< I2C4 Clock source selection */
  507. #endif /* I2C4 */
  508. /**
  509. * @}
  510. */
  511. /** @defgroup RCC_LL_EC_LPTIM1 Peripheral LPTIM get clock source
  512. * @{
  513. */
  514. #define LL_RCC_LPTIM1_CLKSOURCE RCC_DCKCFGR2_LPTIM1SEL /*!< LPTIM1 Clock source selection */
  515. /**
  516. * @}
  517. */
  518. /** @defgroup RCC_LL_EC_SAIx Peripheral SAI get clock source
  519. * @{
  520. */
  521. #define LL_RCC_SAI1_CLKSOURCE RCC_DCKCFGR1_SAI1SEL /*!< SAI1 Clock source selection */
  522. #define LL_RCC_SAI2_CLKSOURCE RCC_DCKCFGR1_SAI2SEL /*!< SAI2 Clock source selection */
  523. /**
  524. * @}
  525. */
  526. /** @defgroup RCC_LL_EC_SDMMCx Peripheral SDMMC get clock source
  527. * @{
  528. */
  529. #define LL_RCC_SDMMC1_CLKSOURCE RCC_DCKCFGR2_SDMMC1SEL /*!< SDMMC1 Clock source selection */
  530. #if defined(SDMMC2)
  531. #define LL_RCC_SDMMC2_CLKSOURCE RCC_DCKCFGR2_SDMMC2SEL /*!< SDMMC2 Clock source selection */
  532. #endif /* SDMMC2 */
  533. /**
  534. * @}
  535. */
  536. /** @defgroup RCC_LL_EC_CK48M Peripheral CK48M get clock source
  537. * @{
  538. */
  539. #define LL_RCC_CK48M_CLKSOURCE RCC_DCKCFGR2_CK48MSEL /*!< CK48M Domain clock source selection */
  540. /**
  541. * @}
  542. */
  543. /** @defgroup RCC_LL_EC_RNG Peripheral RNG get clock source
  544. * @{
  545. */
  546. #define LL_RCC_RNG_CLKSOURCE RCC_DCKCFGR2_CK48MSEL /*!< RNG Clock source selection */
  547. /**
  548. * @}
  549. */
  550. /** @defgroup RCC_LL_EC_USB Peripheral USB get clock source
  551. * @{
  552. */
  553. #define LL_RCC_USB_CLKSOURCE RCC_DCKCFGR2_CK48MSEL /*!< USB Clock source selection */
  554. /**
  555. * @}
  556. */
  557. #if defined(CEC)
  558. /** @defgroup RCC_LL_EC_CEC Peripheral CEC get clock source
  559. * @{
  560. */
  561. #define LL_RCC_CEC_CLKSOURCE RCC_DCKCFGR2_CECSEL /*!< CEC Clock source selection */
  562. /**
  563. * @}
  564. */
  565. #endif /* CEC */
  566. /** @defgroup RCC_LL_EC_I2S1 Peripheral I2S get clock source
  567. * @{
  568. */
  569. #define LL_RCC_I2S1_CLKSOURCE RCC_CFGR_I2SSRC /*!< I2S Clock source selection */
  570. /**
  571. * @}
  572. */
  573. #if defined(DFSDM1_Channel0)
  574. /** @defgroup RCC_LL_EC_DFSDM_AUDIO Peripheral DFSDM Audio get clock source
  575. * @{
  576. */
  577. #define LL_RCC_DFSDM1_AUDIO_CLKSOURCE RCC_DCKCFGR1_ADFSDM1SEL /*!< DFSDM Audio Clock source selection */
  578. /**
  579. * @}
  580. */
  581. /** @defgroup RCC_LL_EC_DFSDM Peripheral DFSDM get clock source
  582. * @{
  583. */
  584. #define LL_RCC_DFSDM1_CLKSOURCE RCC_DCKCFGR1_DFSDM1SEL /*!< DFSDM Clock source selection */
  585. /**
  586. * @}
  587. */
  588. #endif /* DFSDM1_Channel0 */
  589. #if defined(DSI)
  590. /** @defgroup RCC_LL_EC_DSI Peripheral DSI get clock source
  591. * @{
  592. */
  593. #define LL_RCC_DSI_CLKSOURCE RCC_DCKCFGR2_DSISEL /*!< DSI Clock source selection */
  594. /**
  595. * @}
  596. */
  597. #endif /* DSI */
  598. #if defined(LTDC)
  599. /** @defgroup RCC_LL_EC_LTDC Peripheral LTDC get clock source
  600. * @{
  601. */
  602. #define LL_RCC_LTDC_CLKSOURCE RCC_DCKCFGR1_PLLSAIDIVR /*!< LTDC Clock source selection */
  603. /**
  604. * @}
  605. */
  606. #endif /* LTDC */
  607. #if defined(SPDIFRX)
  608. /** @defgroup RCC_LL_EC_SPDIFRX Peripheral SPDIFRX get clock source
  609. * @{
  610. */
  611. #define LL_RCC_SPDIFRX1_CLKSOURCE RCC_PLLI2SCFGR_PLLI2SP /*!< SPDIFRX Clock source selection */
  612. /**
  613. * @}
  614. */
  615. #endif /* SPDIFRX */
  616. /** @defgroup RCC_LL_EC_RTC_CLKSOURCE RTC clock source selection
  617. * @{
  618. */
  619. #define LL_RCC_RTC_CLKSOURCE_NONE 0x00000000U /*!< No clock used as RTC clock */
  620. #define LL_RCC_RTC_CLKSOURCE_LSE RCC_BDCR_RTCSEL_0 /*!< LSE oscillator clock used as RTC clock */
  621. #define LL_RCC_RTC_CLKSOURCE_LSI RCC_BDCR_RTCSEL_1 /*!< LSI oscillator clock used as RTC clock */
  622. #define LL_RCC_RTC_CLKSOURCE_HSE RCC_BDCR_RTCSEL /*!< HSE oscillator clock divided by HSE prescaler used as RTC clock */
  623. /**
  624. * @}
  625. */
  626. /** @defgroup RCC_LL_EC_TIM_CLKPRESCALER Timers clocks prescalers selection
  627. * @{
  628. */
  629. #define LL_RCC_TIM_PRESCALER_TWICE 0x00000000U /*!< Timers clock to twice PCLK */
  630. #define LL_RCC_TIM_PRESCALER_FOUR_TIMES RCC_DCKCFGR1_TIMPRE /*!< Timers clock to four time PCLK */
  631. /**
  632. * @}
  633. */
  634. /** @defgroup RCC_LL_EC_PLLSOURCE PLL, PLLI2S and PLLSAI entry clock source
  635. * @{
  636. */
  637. #define LL_RCC_PLLSOURCE_HSI RCC_PLLCFGR_PLLSRC_HSI /*!< HSI16 clock selected as PLL entry clock source */
  638. #define LL_RCC_PLLSOURCE_HSE RCC_PLLCFGR_PLLSRC_HSE /*!< HSE clock selected as PLL entry clock source */
  639. /**
  640. * @}
  641. */
  642. /** @defgroup RCC_LL_EC_PLLM_DIV PLL, PLLI2S and PLLSAI division factor
  643. * @{
  644. */
  645. #define LL_RCC_PLLM_DIV_2 (RCC_PLLCFGR_PLLM_1) /*!< PLL, PLLI2S and PLLSAI division factor by 2 */
  646. #define LL_RCC_PLLM_DIV_3 (RCC_PLLCFGR_PLLM_1 | RCC_PLLCFGR_PLLM_0) /*!< PLL, PLLI2S and PLLSAI division factor by 3 */
  647. #define LL_RCC_PLLM_DIV_4 (RCC_PLLCFGR_PLLM_2) /*!< PLL, PLLI2S and PLLSAI division factor by 4 */
  648. #define LL_RCC_PLLM_DIV_5 (RCC_PLLCFGR_PLLM_2 | RCC_PLLCFGR_PLLM_0) /*!< PLL, PLLI2S and PLLSAI division factor by 5 */
  649. #define LL_RCC_PLLM_DIV_6 (RCC_PLLCFGR_PLLM_2 | RCC_PLLCFGR_PLLM_1) /*!< PLL, PLLI2S and PLLSAI division factor by 6 */
  650. #define LL_RCC_PLLM_DIV_7 (RCC_PLLCFGR_PLLM_2 | RCC_PLLCFGR_PLLM_1 | RCC_PLLCFGR_PLLM_0) /*!< PLL, PLLI2S and PLLSAI division factor by 7 */
  651. #define LL_RCC_PLLM_DIV_8 (RCC_PLLCFGR_PLLM_3) /*!< PLL, PLLI2S and PLLSAI division factor by 8 */
  652. #define LL_RCC_PLLM_DIV_9 (RCC_PLLCFGR_PLLM_3 | RCC_PLLCFGR_PLLM_0) /*!< PLL, PLLI2S and PLLSAI division factor by 9 */
  653. #define LL_RCC_PLLM_DIV_10 (RCC_PLLCFGR_PLLM_3 | RCC_PLLCFGR_PLLM_1) /*!< PLL, PLLI2S and PLLSAI division factor by 10 */
  654. #define LL_RCC_PLLM_DIV_11 (RCC_PLLCFGR_PLLM_3 | RCC_PLLCFGR_PLLM_1 | RCC_PLLCFGR_PLLM_0) /*!< PLL, PLLI2S and PLLSAI division factor by 11 */
  655. #define LL_RCC_PLLM_DIV_12 (RCC_PLLCFGR_PLLM_3 | RCC_PLLCFGR_PLLM_2) /*!< PLL, PLLI2S and PLLSAI division factor by 12 */
  656. #define LL_RCC_PLLM_DIV_13 (RCC_PLLCFGR_PLLM_3 | RCC_PLLCFGR_PLLM_2 | RCC_PLLCFGR_PLLM_0) /*!< PLL, PLLI2S and PLLSAI division factor by 13 */
  657. #define LL_RCC_PLLM_DIV_14 (RCC_PLLCFGR_PLLM_3 | RCC_PLLCFGR_PLLM_2 | RCC_PLLCFGR_PLLM_1) /*!< PLL, PLLI2S and PLLSAI division factor by 14 */
  658. #define LL_RCC_PLLM_DIV_15 (RCC_PLLCFGR_PLLM_3 | RCC_PLLCFGR_PLLM_2 | RCC_PLLCFGR_PLLM_1 | RCC_PLLCFGR_PLLM_0) /*!< PLL, PLLI2S and PLLSAI division factor by 15 */
  659. #define LL_RCC_PLLM_DIV_16 (RCC_PLLCFGR_PLLM_4) /*!< PLL, PLLI2S and PLLSAI division factor by 16 */
  660. #define LL_RCC_PLLM_DIV_17 (RCC_PLLCFGR_PLLM_4 | RCC_PLLCFGR_PLLM_0) /*!< PLL, PLLI2S and PLLSAI division factor by 17 */
  661. #define LL_RCC_PLLM_DIV_18 (RCC_PLLCFGR_PLLM_4 | RCC_PLLCFGR_PLLM_1) /*!< PLL, PLLI2S and PLLSAI division factor by 18 */
  662. #define LL_RCC_PLLM_DIV_19 (RCC_PLLCFGR_PLLM_4 | RCC_PLLCFGR_PLLM_1 | RCC_PLLCFGR_PLLM_0) /*!< PLL, PLLI2S and PLLSAI division factor by 19 */
  663. #define LL_RCC_PLLM_DIV_20 (RCC_PLLCFGR_PLLM_4 | RCC_PLLCFGR_PLLM_2) /*!< PLL, PLLI2S and PLLSAI division factor by 20 */
  664. #define LL_RCC_PLLM_DIV_21 (RCC_PLLCFGR_PLLM_4 | RCC_PLLCFGR_PLLM_2 | RCC_PLLCFGR_PLLM_0) /*!< PLL, PLLI2S and PLLSAI division factor by 21 */
  665. #define LL_RCC_PLLM_DIV_22 (RCC_PLLCFGR_PLLM_4 | RCC_PLLCFGR_PLLM_2 | RCC_PLLCFGR_PLLM_1) /*!< PLL, PLLI2S and PLLSAI division factor by 22 */
  666. #define LL_RCC_PLLM_DIV_23 (RCC_PLLCFGR_PLLM_4 | RCC_PLLCFGR_PLLM_2 | RCC_PLLCFGR_PLLM_1 | RCC_PLLCFGR_PLLM_0) /*!< PLL, PLLI2S and PLLSAI division factor by 23 */
  667. #define LL_RCC_PLLM_DIV_24 (RCC_PLLCFGR_PLLM_4 | RCC_PLLCFGR_PLLM_3) /*!< PLL, PLLI2S and PLLSAI division factor by 24 */
  668. #define LL_RCC_PLLM_DIV_25 (RCC_PLLCFGR_PLLM_4 | RCC_PLLCFGR_PLLM_3 | RCC_PLLCFGR_PLLM_0) /*!< PLL, PLLI2S and PLLSAI division factor by 25 */
  669. #define LL_RCC_PLLM_DIV_26 (RCC_PLLCFGR_PLLM_4 | RCC_PLLCFGR_PLLM_3 | RCC_PLLCFGR_PLLM_1) /*!< PLL, PLLI2S and PLLSAI division factor by 26 */
  670. #define LL_RCC_PLLM_DIV_27 (RCC_PLLCFGR_PLLM_4 | RCC_PLLCFGR_PLLM_3 | RCC_PLLCFGR_PLLM_1 | RCC_PLLCFGR_PLLM_0) /*!< PLL, PLLI2S and PLLSAI division factor by 27 */
  671. #define LL_RCC_PLLM_DIV_28 (RCC_PLLCFGR_PLLM_4 | RCC_PLLCFGR_PLLM_3 | RCC_PLLCFGR_PLLM_2) /*!< PLL, PLLI2S and PLLSAI division factor by 28 */
  672. #define LL_RCC_PLLM_DIV_29 (RCC_PLLCFGR_PLLM_4 | RCC_PLLCFGR_PLLM_3 | RCC_PLLCFGR_PLLM_2 | RCC_PLLCFGR_PLLM_0) /*!< PLL, PLLI2S and PLLSAI division factor by 29 */
  673. #define LL_RCC_PLLM_DIV_30 (RCC_PLLCFGR_PLLM_4 | RCC_PLLCFGR_PLLM_3 | RCC_PLLCFGR_PLLM_2 | RCC_PLLCFGR_PLLM_1) /*!< PLL, PLLI2S and PLLSAI division factor by 30 */
  674. #define LL_RCC_PLLM_DIV_31 (RCC_PLLCFGR_PLLM_4 | RCC_PLLCFGR_PLLM_3 | RCC_PLLCFGR_PLLM_2 | RCC_PLLCFGR_PLLM_1 | RCC_PLLCFGR_PLLM_0) /*!< PLL, PLLI2S and PLLSAI division factor by 31 */
  675. #define LL_RCC_PLLM_DIV_32 (RCC_PLLCFGR_PLLM_5) /*!< PLL, PLLI2S and PLLSAI division factor by 32 */
  676. #define LL_RCC_PLLM_DIV_33 (RCC_PLLCFGR_PLLM_5 | RCC_PLLCFGR_PLLM_0) /*!< PLL, PLLI2S and PLLSAI division factor by 33 */
  677. #define LL_RCC_PLLM_DIV_34 (RCC_PLLCFGR_PLLM_5 | RCC_PLLCFGR_PLLM_1) /*!< PLL, PLLI2S and PLLSAI division factor by 34 */
  678. #define LL_RCC_PLLM_DIV_35 (RCC_PLLCFGR_PLLM_5 | RCC_PLLCFGR_PLLM_1 | RCC_PLLCFGR_PLLM_0) /*!< PLL, PLLI2S and PLLSAI division factor by 35 */
  679. #define LL_RCC_PLLM_DIV_36 (RCC_PLLCFGR_PLLM_5 | RCC_PLLCFGR_PLLM_2) /*!< PLL, PLLI2S and PLLSAI division factor by 36 */
  680. #define LL_RCC_PLLM_DIV_37 (RCC_PLLCFGR_PLLM_5 | RCC_PLLCFGR_PLLM_2 | RCC_PLLCFGR_PLLM_0) /*!< PLL, PLLI2S and PLLSAI division factor by 37 */
  681. #define LL_RCC_PLLM_DIV_38 (RCC_PLLCFGR_PLLM_5 | RCC_PLLCFGR_PLLM_2 | RCC_PLLCFGR_PLLM_1) /*!< PLL, PLLI2S and PLLSAI division factor by 38 */
  682. #define LL_RCC_PLLM_DIV_39 (RCC_PLLCFGR_PLLM_5 | RCC_PLLCFGR_PLLM_2 | RCC_PLLCFGR_PLLM_1 | RCC_PLLCFGR_PLLM_0) /*!< PLL, PLLI2S and PLLSAI division factor by 39 */
  683. #define LL_RCC_PLLM_DIV_40 (RCC_PLLCFGR_PLLM_5 | RCC_PLLCFGR_PLLM_3) /*!< PLL, PLLI2S and PLLSAI division factor by 40 */
  684. #define LL_RCC_PLLM_DIV_41 (RCC_PLLCFGR_PLLM_5 | RCC_PLLCFGR_PLLM_3 | RCC_PLLCFGR_PLLM_0) /*!< PLL, PLLI2S and PLLSAI division factor by 41 */
  685. #define LL_RCC_PLLM_DIV_42 (RCC_PLLCFGR_PLLM_5 | RCC_PLLCFGR_PLLM_3 | RCC_PLLCFGR_PLLM_1) /*!< PLL, PLLI2S and PLLSAI division factor by 42 */
  686. #define LL_RCC_PLLM_DIV_43 (RCC_PLLCFGR_PLLM_5 | RCC_PLLCFGR_PLLM_3 | RCC_PLLCFGR_PLLM_1 | RCC_PLLCFGR_PLLM_0) /*!< PLL, PLLI2S and PLLSAI division factor by 43 */
  687. #define LL_RCC_PLLM_DIV_44 (RCC_PLLCFGR_PLLM_5 | RCC_PLLCFGR_PLLM_3 | RCC_PLLCFGR_PLLM_2) /*!< PLL, PLLI2S and PLLSAI division factor by 44 */
  688. #define LL_RCC_PLLM_DIV_45 (RCC_PLLCFGR_PLLM_5 | RCC_PLLCFGR_PLLM_3 | RCC_PLLCFGR_PLLM_2 | RCC_PLLCFGR_PLLM_0) /*!< PLL, PLLI2S and PLLSAI division factor by 45 */
  689. #define LL_RCC_PLLM_DIV_46 (RCC_PLLCFGR_PLLM_5 | RCC_PLLCFGR_PLLM_3 | RCC_PLLCFGR_PLLM_2 | RCC_PLLCFGR_PLLM_1) /*!< PLL, PLLI2S and PLLSAI division factor by 46 */
  690. #define LL_RCC_PLLM_DIV_47 (RCC_PLLCFGR_PLLM_5 | RCC_PLLCFGR_PLLM_3 | RCC_PLLCFGR_PLLM_2 | RCC_PLLCFGR_PLLM_1 | RCC_PLLCFGR_PLLM_0) /*!< PLL, PLLI2S and PLLSAI division factor by 47 */
  691. #define LL_RCC_PLLM_DIV_48 (RCC_PLLCFGR_PLLM_5 | RCC_PLLCFGR_PLLM_4) /*!< PLL, PLLI2S and PLLSAI division factor by 48 */
  692. #define LL_RCC_PLLM_DIV_49 (RCC_PLLCFGR_PLLM_5 | RCC_PLLCFGR_PLLM_4 | RCC_PLLCFGR_PLLM_0) /*!< PLL, PLLI2S and PLLSAI division factor by 49 */
  693. #define LL_RCC_PLLM_DIV_50 (RCC_PLLCFGR_PLLM_5 | RCC_PLLCFGR_PLLM_4 | RCC_PLLCFGR_PLLM_1) /*!< PLL, PLLI2S and PLLSAI division factor by 50 */
  694. #define LL_RCC_PLLM_DIV_51 (RCC_PLLCFGR_PLLM_5 | RCC_PLLCFGR_PLLM_4 | RCC_PLLCFGR_PLLM_1 | RCC_PLLCFGR_PLLM_0) /*!< PLL, PLLI2S and PLLSAI division factor by 51 */
  695. #define LL_RCC_PLLM_DIV_52 (RCC_PLLCFGR_PLLM_5 | RCC_PLLCFGR_PLLM_4 | RCC_PLLCFGR_PLLM_2) /*!< PLL, PLLI2S and PLLSAI division factor by 52 */
  696. #define LL_RCC_PLLM_DIV_53 (RCC_PLLCFGR_PLLM_5 | RCC_PLLCFGR_PLLM_4 | RCC_PLLCFGR_PLLM_2 | RCC_PLLCFGR_PLLM_0) /*!< PLL, PLLI2S and PLLSAI division factor by 53 */
  697. #define LL_RCC_PLLM_DIV_54 (RCC_PLLCFGR_PLLM_5 | RCC_PLLCFGR_PLLM_4 | RCC_PLLCFGR_PLLM_2 | RCC_PLLCFGR_PLLM_1) /*!< PLL, PLLI2S and PLLSAI division factor by 54 */
  698. #define LL_RCC_PLLM_DIV_55 (RCC_PLLCFGR_PLLM_5 | RCC_PLLCFGR_PLLM_4 | RCC_PLLCFGR_PLLM_2 | RCC_PLLCFGR_PLLM_1 | RCC_PLLCFGR_PLLM_0) /*!< PLL, PLLI2S and PLLSAI division factor by 55 */
  699. #define LL_RCC_PLLM_DIV_56 (RCC_PLLCFGR_PLLM_5 | RCC_PLLCFGR_PLLM_4 | RCC_PLLCFGR_PLLM_3) /*!< PLL, PLLI2S and PLLSAI division factor by 56 */
  700. #define LL_RCC_PLLM_DIV_57 (RCC_PLLCFGR_PLLM_5 | RCC_PLLCFGR_PLLM_4 | RCC_PLLCFGR_PLLM_3 | RCC_PLLCFGR_PLLM_0) /*!< PLL, PLLI2S and PLLSAI division factor by 57 */
  701. #define LL_RCC_PLLM_DIV_58 (RCC_PLLCFGR_PLLM_5 | RCC_PLLCFGR_PLLM_4 | RCC_PLLCFGR_PLLM_3 | RCC_PLLCFGR_PLLM_1) /*!< PLL, PLLI2S and PLLSAI division factor by 58 */
  702. #define LL_RCC_PLLM_DIV_59 (RCC_PLLCFGR_PLLM_5 | RCC_PLLCFGR_PLLM_4 | RCC_PLLCFGR_PLLM_3 | RCC_PLLCFGR_PLLM_1 | RCC_PLLCFGR_PLLM_0) /*!< PLL, PLLI2S and PLLSAI division factor by 59 */
  703. #define LL_RCC_PLLM_DIV_60 (RCC_PLLCFGR_PLLM_5 | RCC_PLLCFGR_PLLM_4 | RCC_PLLCFGR_PLLM_3 | RCC_PLLCFGR_PLLM_2) /*!< PLL, PLLI2S and PLLSAI division factor by 60 */
  704. #define LL_RCC_PLLM_DIV_61 (RCC_PLLCFGR_PLLM_5 | RCC_PLLCFGR_PLLM_4 | RCC_PLLCFGR_PLLM_3 | RCC_PLLCFGR_PLLM_2 | RCC_PLLCFGR_PLLM_0) /*!< PLL, PLLI2S and PLLSAI division factor by 61 */
  705. #define LL_RCC_PLLM_DIV_62 (RCC_PLLCFGR_PLLM_5 | RCC_PLLCFGR_PLLM_4 | RCC_PLLCFGR_PLLM_3 | RCC_PLLCFGR_PLLM_2 | RCC_PLLCFGR_PLLM_1) /*!< PLL, PLLI2S and PLLSAI division factor by 62 */
  706. #define LL_RCC_PLLM_DIV_63 (RCC_PLLCFGR_PLLM_5 | RCC_PLLCFGR_PLLM_4 | RCC_PLLCFGR_PLLM_3 | RCC_PLLCFGR_PLLM_2 | RCC_PLLCFGR_PLLM_1 | RCC_PLLCFGR_PLLM_0) /*!< PLL, PLLI2S and PLLSAI division factor by 63 */
  707. /**
  708. * @}
  709. */
  710. #if defined(RCC_PLLCFGR_PLLR)
  711. /** @defgroup RCC_LL_EC_PLLR_DIV PLL division factor (PLLR)
  712. * @{
  713. */
  714. #define LL_RCC_PLLR_DIV_2 (RCC_PLLCFGR_PLLR_1) /*!< Main PLL division factor for PLLCLK (system clock) by 2 */
  715. #define LL_RCC_PLLR_DIV_3 (RCC_PLLCFGR_PLLR_1|RCC_PLLCFGR_PLLR_0) /*!< Main PLL division factor for PLLCLK (system clock) by 3 */
  716. #define LL_RCC_PLLR_DIV_4 (RCC_PLLCFGR_PLLR_2) /*!< Main PLL division factor for PLLCLK (system clock) by 4 */
  717. #define LL_RCC_PLLR_DIV_5 (RCC_PLLCFGR_PLLR_2|RCC_PLLCFGR_PLLR_0) /*!< Main PLL division factor for PLLCLK (system clock) by 5 */
  718. #define LL_RCC_PLLR_DIV_6 (RCC_PLLCFGR_PLLR_2|RCC_PLLCFGR_PLLR_1) /*!< Main PLL division factor for PLLCLK (system clock) by 6 */
  719. #define LL_RCC_PLLR_DIV_7 (RCC_PLLCFGR_PLLR) /*!< Main PLL division factor for PLLCLK (system clock) by 7 */
  720. /**
  721. * @}
  722. */
  723. #endif /* RCC_PLLCFGR_PLLR */
  724. /** @defgroup RCC_LL_EC_PLLP_DIV PLL division factor (PLLP)
  725. * @{
  726. */
  727. #define LL_RCC_PLLP_DIV_2 0x00000000U /*!< Main PLL division factor for PLLP output by 2 */
  728. #define LL_RCC_PLLP_DIV_4 RCC_PLLCFGR_PLLP_0 /*!< Main PLL division factor for PLLP output by 4 */
  729. #define LL_RCC_PLLP_DIV_6 RCC_PLLCFGR_PLLP_1 /*!< Main PLL division factor for PLLP output by 6 */
  730. #define LL_RCC_PLLP_DIV_8 (RCC_PLLCFGR_PLLP_1 | RCC_PLLCFGR_PLLP_0) /*!< Main PLL division factor for PLLP output by 8 */
  731. /**
  732. * @}
  733. */
  734. /** @defgroup RCC_LL_EC_PLLQ_DIV PLL division factor (PLLQ)
  735. * @{
  736. */
  737. #define LL_RCC_PLLQ_DIV_2 RCC_PLLCFGR_PLLQ_1 /*!< Main PLL division factor for PLLQ output by 2 */
  738. #define LL_RCC_PLLQ_DIV_3 (RCC_PLLCFGR_PLLQ_1|RCC_PLLCFGR_PLLQ_0) /*!< Main PLL division factor for PLLQ output by 3 */
  739. #define LL_RCC_PLLQ_DIV_4 RCC_PLLCFGR_PLLQ_2 /*!< Main PLL division factor for PLLQ output by 4 */
  740. #define LL_RCC_PLLQ_DIV_5 (RCC_PLLCFGR_PLLQ_2|RCC_PLLCFGR_PLLQ_0) /*!< Main PLL division factor for PLLQ output by 5 */
  741. #define LL_RCC_PLLQ_DIV_6 (RCC_PLLCFGR_PLLQ_2|RCC_PLLCFGR_PLLQ_1) /*!< Main PLL division factor for PLLQ output by 6 */
  742. #define LL_RCC_PLLQ_DIV_7 (RCC_PLLCFGR_PLLQ_2|RCC_PLLCFGR_PLLQ_1|RCC_PLLCFGR_PLLQ_0) /*!< Main PLL division factor for PLLQ output by 7 */
  743. #define LL_RCC_PLLQ_DIV_8 RCC_PLLCFGR_PLLQ_3 /*!< Main PLL division factor for PLLQ output by 8 */
  744. #define LL_RCC_PLLQ_DIV_9 (RCC_PLLCFGR_PLLQ_3|RCC_PLLCFGR_PLLQ_0) /*!< Main PLL division factor for PLLQ output by 9 */
  745. #define LL_RCC_PLLQ_DIV_10 (RCC_PLLCFGR_PLLQ_3|RCC_PLLCFGR_PLLQ_1) /*!< Main PLL division factor for PLLQ output by 10 */
  746. #define LL_RCC_PLLQ_DIV_11 (RCC_PLLCFGR_PLLQ_3|RCC_PLLCFGR_PLLQ_1|RCC_PLLCFGR_PLLQ_0) /*!< Main PLL division factor for PLLQ output by 11 */
  747. #define LL_RCC_PLLQ_DIV_12 (RCC_PLLCFGR_PLLQ_3|RCC_PLLCFGR_PLLQ_2) /*!< Main PLL division factor for PLLQ output by 12 */
  748. #define LL_RCC_PLLQ_DIV_13 (RCC_PLLCFGR_PLLQ_3|RCC_PLLCFGR_PLLQ_2|RCC_PLLCFGR_PLLQ_0) /*!< Main PLL division factor for PLLQ output by 13 */
  749. #define LL_RCC_PLLQ_DIV_14 (RCC_PLLCFGR_PLLQ_3|RCC_PLLCFGR_PLLQ_2|RCC_PLLCFGR_PLLQ_1) /*!< Main PLL division factor for PLLQ output by 14 */
  750. #define LL_RCC_PLLQ_DIV_15 (RCC_PLLCFGR_PLLQ_3|RCC_PLLCFGR_PLLQ_2|RCC_PLLCFGR_PLLQ_1|RCC_PLLCFGR_PLLQ_0) /*!< Main PLL division factor for PLLQ output by 15 */
  751. /**
  752. * @}
  753. */
  754. /** @defgroup RCC_LL_EC_PLL_SPRE_SEL PLL Spread Spectrum Selection
  755. * @{
  756. */
  757. #define LL_RCC_SPREAD_SELECT_CENTER 0x00000000U /*!< PLL center spread spectrum selection */
  758. #define LL_RCC_SPREAD_SELECT_DOWN RCC_SSCGR_SPREADSEL /*!< PLL down spread spectrum selection */
  759. /**
  760. * @}
  761. */
  762. /** @defgroup RCC_LL_EC_PLLI2SQ PLLI2SQ division factor (PLLI2SQ)
  763. * @{
  764. */
  765. #define LL_RCC_PLLI2SQ_DIV_2 RCC_PLLI2SCFGR_PLLI2SQ_1 /*!< PLLI2S division factor for PLLI2SQ output by 2 */
  766. #define LL_RCC_PLLI2SQ_DIV_3 (RCC_PLLI2SCFGR_PLLI2SQ_1 | RCC_PLLI2SCFGR_PLLI2SQ_0) /*!< PLLI2S division factor for PLLI2SQ output by 3 */
  767. #define LL_RCC_PLLI2SQ_DIV_4 RCC_PLLI2SCFGR_PLLI2SQ_2 /*!< PLLI2S division factor for PLLI2SQ output by 4 */
  768. #define LL_RCC_PLLI2SQ_DIV_5 (RCC_PLLI2SCFGR_PLLI2SQ_2 | RCC_PLLI2SCFGR_PLLI2SQ_0) /*!< PLLI2S division factor for PLLI2SQ output by 5 */
  769. #define LL_RCC_PLLI2SQ_DIV_6 (RCC_PLLI2SCFGR_PLLI2SQ_2 | RCC_PLLI2SCFGR_PLLI2SQ_1) /*!< PLLI2S division factor for PLLI2SQ output by 6 */
  770. #define LL_RCC_PLLI2SQ_DIV_7 (RCC_PLLI2SCFGR_PLLI2SQ_2 | RCC_PLLI2SCFGR_PLLI2SQ_1 | RCC_PLLI2SCFGR_PLLI2SQ_0) /*!< PLLI2S division factor for PLLI2SQ output by 7 */
  771. #define LL_RCC_PLLI2SQ_DIV_8 RCC_PLLI2SCFGR_PLLI2SQ_3 /*!< PLLI2S division factor for PLLI2SQ output by 8 */
  772. #define LL_RCC_PLLI2SQ_DIV_9 (RCC_PLLI2SCFGR_PLLI2SQ_3 | RCC_PLLI2SCFGR_PLLI2SQ_0) /*!< PLLI2S division factor for PLLI2SQ output by 9 */
  773. #define LL_RCC_PLLI2SQ_DIV_10 (RCC_PLLI2SCFGR_PLLI2SQ_3 | RCC_PLLI2SCFGR_PLLI2SQ_1) /*!< PLLI2S division factor for PLLI2SQ output by 10 */
  774. #define LL_RCC_PLLI2SQ_DIV_11 (RCC_PLLI2SCFGR_PLLI2SQ_3 | RCC_PLLI2SCFGR_PLLI2SQ_1 | RCC_PLLI2SCFGR_PLLI2SQ_0) /*!< PLLI2S division factor for PLLI2SQ output by 11 */
  775. #define LL_RCC_PLLI2SQ_DIV_12 (RCC_PLLI2SCFGR_PLLI2SQ_3 | RCC_PLLI2SCFGR_PLLI2SQ_2) /*!< PLLI2S division factor for PLLI2SQ output by 12 */
  776. #define LL_RCC_PLLI2SQ_DIV_13 (RCC_PLLI2SCFGR_PLLI2SQ_3 | RCC_PLLI2SCFGR_PLLI2SQ_2 | RCC_PLLI2SCFGR_PLLI2SQ_0) /*!< PLLI2S division factor for PLLI2SQ output by 13 */
  777. #define LL_RCC_PLLI2SQ_DIV_14 (RCC_PLLI2SCFGR_PLLI2SQ_3 | RCC_PLLI2SCFGR_PLLI2SQ_2 | RCC_PLLI2SCFGR_PLLI2SQ_1) /*!< PLLI2S division factor for PLLI2SQ output by 14 */
  778. #define LL_RCC_PLLI2SQ_DIV_15 (RCC_PLLI2SCFGR_PLLI2SQ_3 | RCC_PLLI2SCFGR_PLLI2SQ_2 | RCC_PLLI2SCFGR_PLLI2SQ_1 | RCC_PLLI2SCFGR_PLLI2SQ_0) /*!< PLLI2S division factor for PLLI2SQ output by 15 */
  779. /**
  780. * @}
  781. */
  782. /** @defgroup RCC_LL_EC_PLLI2SDIVQ PLLI2SDIVQ division factor (PLLI2SDIVQ)
  783. * @{
  784. */
  785. #define LL_RCC_PLLI2SDIVQ_DIV_1 0x00000000U /*!< PLLI2S division factor for PLLI2SDIVQ output by 1 */
  786. #define LL_RCC_PLLI2SDIVQ_DIV_2 RCC_DCKCFGR1_PLLI2SDIVQ_0 /*!< PLLI2S division factor for PLLI2SDIVQ output by 2 */
  787. #define LL_RCC_PLLI2SDIVQ_DIV_3 RCC_DCKCFGR1_PLLI2SDIVQ_1 /*!< PLLI2S division factor for PLLI2SDIVQ output by 3 */
  788. #define LL_RCC_PLLI2SDIVQ_DIV_4 (RCC_DCKCFGR1_PLLI2SDIVQ_1 | RCC_DCKCFGR1_PLLI2SDIVQ_0) /*!< PLLI2S division factor for PLLI2SDIVQ output by 4 */
  789. #define LL_RCC_PLLI2SDIVQ_DIV_5 RCC_DCKCFGR1_PLLI2SDIVQ_2 /*!< PLLI2S division factor for PLLI2SDIVQ output by 5 */
  790. #define LL_RCC_PLLI2SDIVQ_DIV_6 (RCC_DCKCFGR1_PLLI2SDIVQ_2 | RCC_DCKCFGR1_PLLI2SDIVQ_0) /*!< PLLI2S division factor for PLLI2SDIVQ output by 6 */
  791. #define LL_RCC_PLLI2SDIVQ_DIV_7 (RCC_DCKCFGR1_PLLI2SDIVQ_2 | RCC_DCKCFGR1_PLLI2SDIVQ_1) /*!< PLLI2S division factor for PLLI2SDIVQ output by 7 */
  792. #define LL_RCC_PLLI2SDIVQ_DIV_8 (RCC_DCKCFGR1_PLLI2SDIVQ_2 | RCC_DCKCFGR1_PLLI2SDIVQ_1 | RCC_DCKCFGR1_PLLI2SDIVQ_0) /*!< PLLI2S division factor for PLLI2SDIVQ output by 8 */
  793. #define LL_RCC_PLLI2SDIVQ_DIV_9 RCC_DCKCFGR1_PLLI2SDIVQ_3 /*!< PLLI2S division factor for PLLI2SDIVQ output by 9 */
  794. #define LL_RCC_PLLI2SDIVQ_DIV_10 (RCC_DCKCFGR1_PLLI2SDIVQ_3 | RCC_DCKCFGR1_PLLI2SDIVQ_0) /*!< PLLI2S division factor for PLLI2SDIVQ output by 10 */
  795. #define LL_RCC_PLLI2SDIVQ_DIV_11 (RCC_DCKCFGR1_PLLI2SDIVQ_3 | RCC_DCKCFGR1_PLLI2SDIVQ_1) /*!< PLLI2S division factor for PLLI2SDIVQ output by 11 */
  796. #define LL_RCC_PLLI2SDIVQ_DIV_12 (RCC_DCKCFGR1_PLLI2SDIVQ_3 | RCC_DCKCFGR1_PLLI2SDIVQ_1 | RCC_DCKCFGR1_PLLI2SDIVQ_0) /*!< PLLI2S division factor for PLLI2SDIVQ output by 12 */
  797. #define LL_RCC_PLLI2SDIVQ_DIV_13 (RCC_DCKCFGR1_PLLI2SDIVQ_3 | RCC_DCKCFGR1_PLLI2SDIVQ_2) /*!< PLLI2S division factor for PLLI2SDIVQ output by 13 */
  798. #define LL_RCC_PLLI2SDIVQ_DIV_14 (RCC_DCKCFGR1_PLLI2SDIVQ_3 | RCC_DCKCFGR1_PLLI2SDIVQ_2 | RCC_DCKCFGR1_PLLI2SDIVQ_0) /*!< PLLI2S division factor for PLLI2SDIVQ output by 14 */
  799. #define LL_RCC_PLLI2SDIVQ_DIV_15 (RCC_DCKCFGR1_PLLI2SDIVQ_3 | RCC_DCKCFGR1_PLLI2SDIVQ_2 | RCC_DCKCFGR1_PLLI2SDIVQ_1) /*!< PLLI2S division factor for PLLI2SDIVQ output by 15 */
  800. #define LL_RCC_PLLI2SDIVQ_DIV_16 (RCC_DCKCFGR1_PLLI2SDIVQ_3 | RCC_DCKCFGR1_PLLI2SDIVQ_2 | RCC_DCKCFGR1_PLLI2SDIVQ_1 | RCC_DCKCFGR1_PLLI2SDIVQ_0) /*!< PLLI2S division factor for PLLI2SDIVQ output by 16 */
  801. #define LL_RCC_PLLI2SDIVQ_DIV_17 RCC_DCKCFGR1_PLLI2SDIVQ_4 /*!< PLLI2S division factor for PLLI2SDIVQ output by 17 */
  802. #define LL_RCC_PLLI2SDIVQ_DIV_18 (RCC_DCKCFGR1_PLLI2SDIVQ_4 | RCC_DCKCFGR1_PLLI2SDIVQ_0) /*!< PLLI2S division factor for PLLI2SDIVQ output by 18 */
  803. #define LL_RCC_PLLI2SDIVQ_DIV_19 (RCC_DCKCFGR1_PLLI2SDIVQ_4 | RCC_DCKCFGR1_PLLI2SDIVQ_1) /*!< PLLI2S division factor for PLLI2SDIVQ output by 19 */
  804. #define LL_RCC_PLLI2SDIVQ_DIV_20 (RCC_DCKCFGR1_PLLI2SDIVQ_4 | RCC_DCKCFGR1_PLLI2SDIVQ_1 | RCC_DCKCFGR1_PLLI2SDIVQ_0) /*!< PLLI2S division factor for PLLI2SDIVQ output by 20 */
  805. #define LL_RCC_PLLI2SDIVQ_DIV_21 (RCC_DCKCFGR1_PLLI2SDIVQ_4 | RCC_DCKCFGR1_PLLI2SDIVQ_2) /*!< PLLI2S division factor for PLLI2SDIVQ output by 21 */
  806. #define LL_RCC_PLLI2SDIVQ_DIV_22 (RCC_DCKCFGR1_PLLI2SDIVQ_4 | RCC_DCKCFGR1_PLLI2SDIVQ_2 | RCC_DCKCFGR1_PLLI2SDIVQ_0) /*!< PLLI2S division factor for PLLI2SDIVQ output by 22 */
  807. #define LL_RCC_PLLI2SDIVQ_DIV_23 (RCC_DCKCFGR1_PLLI2SDIVQ_4 | RCC_DCKCFGR1_PLLI2SDIVQ_2 | RCC_DCKCFGR1_PLLI2SDIVQ_1) /*!< PLLI2S division factor for PLLI2SDIVQ output by 23 */
  808. #define LL_RCC_PLLI2SDIVQ_DIV_24 (RCC_DCKCFGR1_PLLI2SDIVQ_4 | RCC_DCKCFGR1_PLLI2SDIVQ_2 | RCC_DCKCFGR1_PLLI2SDIVQ_1 | RCC_DCKCFGR1_PLLI2SDIVQ_0) /*!< PLLI2S division factor for PLLI2SDIVQ output by 24 */
  809. #define LL_RCC_PLLI2SDIVQ_DIV_25 (RCC_DCKCFGR1_PLLI2SDIVQ_4 | RCC_DCKCFGR1_PLLI2SDIVQ_3) /*!< PLLI2S division factor for PLLI2SDIVQ output by 25 */
  810. #define LL_RCC_PLLI2SDIVQ_DIV_26 (RCC_DCKCFGR1_PLLI2SDIVQ_4 | RCC_DCKCFGR1_PLLI2SDIVQ_3 | RCC_DCKCFGR1_PLLI2SDIVQ_0) /*!< PLLI2S division factor for PLLI2SDIVQ output by 26 */
  811. #define LL_RCC_PLLI2SDIVQ_DIV_27 (RCC_DCKCFGR1_PLLI2SDIVQ_4 | RCC_DCKCFGR1_PLLI2SDIVQ_3 | RCC_DCKCFGR1_PLLI2SDIVQ_1) /*!< PLLI2S division factor for PLLI2SDIVQ output by 27 */
  812. #define LL_RCC_PLLI2SDIVQ_DIV_28 (RCC_DCKCFGR1_PLLI2SDIVQ_4 | RCC_DCKCFGR1_PLLI2SDIVQ_3 | RCC_DCKCFGR1_PLLI2SDIVQ_1 | RCC_DCKCFGR1_PLLI2SDIVQ_0) /*!< PLLI2S division factor for PLLI2SDIVQ output by 28 */
  813. #define LL_RCC_PLLI2SDIVQ_DIV_29 (RCC_DCKCFGR1_PLLI2SDIVQ_4 | RCC_DCKCFGR1_PLLI2SDIVQ_3 | RCC_DCKCFGR1_PLLI2SDIVQ_2) /*!< PLLI2S division factor for PLLI2SDIVQ output by 29 */
  814. #define LL_RCC_PLLI2SDIVQ_DIV_30 (RCC_DCKCFGR1_PLLI2SDIVQ_4 | RCC_DCKCFGR1_PLLI2SDIVQ_3 | RCC_DCKCFGR1_PLLI2SDIVQ_2 | RCC_DCKCFGR1_PLLI2SDIVQ_0) /*!< PLLI2S division factor for PLLI2SDIVQ output by 30 */
  815. #define LL_RCC_PLLI2SDIVQ_DIV_31 (RCC_DCKCFGR1_PLLI2SDIVQ_4 | RCC_DCKCFGR1_PLLI2SDIVQ_3 | RCC_DCKCFGR1_PLLI2SDIVQ_2 | RCC_DCKCFGR1_PLLI2SDIVQ_1) /*!< PLLI2S division factor for PLLI2SDIVQ output by 31 */
  816. #define LL_RCC_PLLI2SDIVQ_DIV_32 (RCC_DCKCFGR1_PLLI2SDIVQ_4 | RCC_DCKCFGR1_PLLI2SDIVQ_3 | RCC_DCKCFGR1_PLLI2SDIVQ_2 | RCC_DCKCFGR1_PLLI2SDIVQ_1 | RCC_DCKCFGR1_PLLI2SDIVQ_0) /*!< PLLI2S division factor for PLLI2SDIVQ output by 32 */
  817. /**
  818. * @}
  819. */
  820. /** @defgroup RCC_LL_EC_PLLI2SR PLLI2SR division factor (PLLI2SR)
  821. * @{
  822. */
  823. #define LL_RCC_PLLI2SR_DIV_2 RCC_PLLI2SCFGR_PLLI2SR_1 /*!< PLLI2S division factor for PLLI2SR output by 2 */
  824. #define LL_RCC_PLLI2SR_DIV_3 (RCC_PLLI2SCFGR_PLLI2SR_1 | RCC_PLLI2SCFGR_PLLI2SR_0) /*!< PLLI2S division factor for PLLI2SR output by 3 */
  825. #define LL_RCC_PLLI2SR_DIV_4 RCC_PLLI2SCFGR_PLLI2SR_2 /*!< PLLI2S division factor for PLLI2SR output by 4 */
  826. #define LL_RCC_PLLI2SR_DIV_5 (RCC_PLLI2SCFGR_PLLI2SR_2 | RCC_PLLI2SCFGR_PLLI2SR_0) /*!< PLLI2S division factor for PLLI2SR output by 5 */
  827. #define LL_RCC_PLLI2SR_DIV_6 (RCC_PLLI2SCFGR_PLLI2SR_2 | RCC_PLLI2SCFGR_PLLI2SR_1) /*!< PLLI2S division factor for PLLI2SR output by 6 */
  828. #define LL_RCC_PLLI2SR_DIV_7 (RCC_PLLI2SCFGR_PLLI2SR_2 | RCC_PLLI2SCFGR_PLLI2SR_1 | RCC_PLLI2SCFGR_PLLI2SR_0) /*!< PLLI2S division factor for PLLI2SR output by 7 */
  829. /**
  830. * @}
  831. */
  832. #if defined(RCC_PLLI2SCFGR_PLLI2SP)
  833. /** @defgroup RCC_LL_EC_PLLI2SP PLLI2SP division factor (PLLI2SP)
  834. * @{
  835. */
  836. #define LL_RCC_PLLI2SP_DIV_2 0x00000000U /*!< PLLI2S division factor for PLLI2SP output by 2 */
  837. #define LL_RCC_PLLI2SP_DIV_4 RCC_PLLI2SCFGR_PLLI2SP_0 /*!< PLLI2S division factor for PLLI2SP output by 4 */
  838. #define LL_RCC_PLLI2SP_DIV_6 RCC_PLLI2SCFGR_PLLI2SP_1 /*!< PLLI2S division factor for PLLI2SP output by 6 */
  839. #define LL_RCC_PLLI2SP_DIV_8 (RCC_PLLI2SCFGR_PLLI2SP_1 | RCC_PLLI2SCFGR_PLLI2SP_0) /*!< PLLI2S division factor for PLLI2SP output by 8 */
  840. /**
  841. * @}
  842. */
  843. #endif /* RCC_PLLI2SCFGR_PLLI2SP */
  844. /** @defgroup RCC_LL_EC_PLLSAIQ PLLSAIQ division factor (PLLSAIQ)
  845. * @{
  846. */
  847. #define LL_RCC_PLLSAIQ_DIV_2 RCC_PLLSAICFGR_PLLSAIQ_1 /*!< PLLSAI division factor for PLLSAIQ output by 2 */
  848. #define LL_RCC_PLLSAIQ_DIV_3 (RCC_PLLSAICFGR_PLLSAIQ_1 | RCC_PLLSAICFGR_PLLSAIQ_0) /*!< PLLSAI division factor for PLLSAIQ output by 3 */
  849. #define LL_RCC_PLLSAIQ_DIV_4 RCC_PLLSAICFGR_PLLSAIQ_2 /*!< PLLSAI division factor for PLLSAIQ output by 4 */
  850. #define LL_RCC_PLLSAIQ_DIV_5 (RCC_PLLSAICFGR_PLLSAIQ_2 | RCC_PLLSAICFGR_PLLSAIQ_0) /*!< PLLSAI division factor for PLLSAIQ output by 5 */
  851. #define LL_RCC_PLLSAIQ_DIV_6 (RCC_PLLSAICFGR_PLLSAIQ_2 | RCC_PLLSAICFGR_PLLSAIQ_1) /*!< PLLSAI division factor for PLLSAIQ output by 6 */
  852. #define LL_RCC_PLLSAIQ_DIV_7 (RCC_PLLSAICFGR_PLLSAIQ_2 | RCC_PLLSAICFGR_PLLSAIQ_1 | RCC_PLLSAICFGR_PLLSAIQ_0) /*!< PLLSAI division factor for PLLSAIQ output by 7 */
  853. #define LL_RCC_PLLSAIQ_DIV_8 RCC_PLLSAICFGR_PLLSAIQ_3 /*!< PLLSAI division factor for PLLSAIQ output by 8 */
  854. #define LL_RCC_PLLSAIQ_DIV_9 (RCC_PLLSAICFGR_PLLSAIQ_3 | RCC_PLLSAICFGR_PLLSAIQ_0) /*!< PLLSAI division factor for PLLSAIQ output by 9 */
  855. #define LL_RCC_PLLSAIQ_DIV_10 (RCC_PLLSAICFGR_PLLSAIQ_3 | RCC_PLLSAICFGR_PLLSAIQ_1) /*!< PLLSAI division factor for PLLSAIQ output by 10 */
  856. #define LL_RCC_PLLSAIQ_DIV_11 (RCC_PLLSAICFGR_PLLSAIQ_3 | RCC_PLLSAICFGR_PLLSAIQ_1 | RCC_PLLSAICFGR_PLLSAIQ_0) /*!< PLLSAI division factor for PLLSAIQ output by 11 */
  857. #define LL_RCC_PLLSAIQ_DIV_12 (RCC_PLLSAICFGR_PLLSAIQ_3 | RCC_PLLSAICFGR_PLLSAIQ_2) /*!< PLLSAI division factor for PLLSAIQ output by 12 */
  858. #define LL_RCC_PLLSAIQ_DIV_13 (RCC_PLLSAICFGR_PLLSAIQ_3 | RCC_PLLSAICFGR_PLLSAIQ_2 | RCC_PLLSAICFGR_PLLSAIQ_0) /*!< PLLSAI division factor for PLLSAIQ output by 13 */
  859. #define LL_RCC_PLLSAIQ_DIV_14 (RCC_PLLSAICFGR_PLLSAIQ_3 | RCC_PLLSAICFGR_PLLSAIQ_2 | RCC_PLLSAICFGR_PLLSAIQ_1) /*!< PLLSAI division factor for PLLSAIQ output by 14 */
  860. #define LL_RCC_PLLSAIQ_DIV_15 (RCC_PLLSAICFGR_PLLSAIQ_3 | RCC_PLLSAICFGR_PLLSAIQ_2 | RCC_PLLSAICFGR_PLLSAIQ_1 | RCC_PLLSAICFGR_PLLSAIQ_0) /*!< PLLSAI division factor for PLLSAIQ output by 15 */
  861. /**
  862. * @}
  863. */
  864. /** @defgroup RCC_LL_EC_PLLSAIDIVQ PLLSAIDIVQ division factor (PLLSAIDIVQ)
  865. * @{
  866. */
  867. #define LL_RCC_PLLSAIDIVQ_DIV_1 0x00000000U /*!< PLLSAI division factor for PLLSAIDIVQ output by 1 */
  868. #define LL_RCC_PLLSAIDIVQ_DIV_2 RCC_DCKCFGR1_PLLSAIDIVQ_0 /*!< PLLSAI division factor for PLLSAIDIVQ output by 2 */
  869. #define LL_RCC_PLLSAIDIVQ_DIV_3 RCC_DCKCFGR1_PLLSAIDIVQ_1 /*!< PLLSAI division factor for PLLSAIDIVQ output by 3 */
  870. #define LL_RCC_PLLSAIDIVQ_DIV_4 (RCC_DCKCFGR1_PLLSAIDIVQ_1 | RCC_DCKCFGR1_PLLSAIDIVQ_0) /*!< PLLSAI division factor for PLLSAIDIVQ output by 4 */
  871. #define LL_RCC_PLLSAIDIVQ_DIV_5 RCC_DCKCFGR1_PLLSAIDIVQ_2 /*!< PLLSAI division factor for PLLSAIDIVQ output by 5 */
  872. #define LL_RCC_PLLSAIDIVQ_DIV_6 (RCC_DCKCFGR1_PLLSAIDIVQ_2 | RCC_DCKCFGR1_PLLSAIDIVQ_0) /*!< PLLSAI division factor for PLLSAIDIVQ output by 6 */
  873. #define LL_RCC_PLLSAIDIVQ_DIV_7 (RCC_DCKCFGR1_PLLSAIDIVQ_2 | RCC_DCKCFGR1_PLLSAIDIVQ_1) /*!< PLLSAI division factor for PLLSAIDIVQ output by 7 */
  874. #define LL_RCC_PLLSAIDIVQ_DIV_8 (RCC_DCKCFGR1_PLLSAIDIVQ_2 | RCC_DCKCFGR1_PLLSAIDIVQ_1 | RCC_DCKCFGR1_PLLSAIDIVQ_0) /*!< PLLSAI division factor for PLLSAIDIVQ output by 8 */
  875. #define LL_RCC_PLLSAIDIVQ_DIV_9 RCC_DCKCFGR1_PLLSAIDIVQ_3 /*!< PLLSAI division factor for PLLSAIDIVQ output by 9 */
  876. #define LL_RCC_PLLSAIDIVQ_DIV_10 (RCC_DCKCFGR1_PLLSAIDIVQ_3 | RCC_DCKCFGR1_PLLSAIDIVQ_0) /*!< PLLSAI division factor for PLLSAIDIVQ output by 10 */
  877. #define LL_RCC_PLLSAIDIVQ_DIV_11 (RCC_DCKCFGR1_PLLSAIDIVQ_3 | RCC_DCKCFGR1_PLLSAIDIVQ_1) /*!< PLLSAI division factor for PLLSAIDIVQ output by 11 */
  878. #define LL_RCC_PLLSAIDIVQ_DIV_12 (RCC_DCKCFGR1_PLLSAIDIVQ_3 | RCC_DCKCFGR1_PLLSAIDIVQ_1 | RCC_DCKCFGR1_PLLSAIDIVQ_0) /*!< PLLSAI division factor for PLLSAIDIVQ output by 12 */
  879. #define LL_RCC_PLLSAIDIVQ_DIV_13 (RCC_DCKCFGR1_PLLSAIDIVQ_3 | RCC_DCKCFGR1_PLLSAIDIVQ_2) /*!< PLLSAI division factor for PLLSAIDIVQ output by 13 */
  880. #define LL_RCC_PLLSAIDIVQ_DIV_14 (RCC_DCKCFGR1_PLLSAIDIVQ_3 | RCC_DCKCFGR1_PLLSAIDIVQ_2 | RCC_DCKCFGR1_PLLSAIDIVQ_0) /*!< PLLSAI division factor for PLLSAIDIVQ output by 14 */
  881. #define LL_RCC_PLLSAIDIVQ_DIV_15 (RCC_DCKCFGR1_PLLSAIDIVQ_3 | RCC_DCKCFGR1_PLLSAIDIVQ_2 | RCC_DCKCFGR1_PLLSAIDIVQ_1) /*!< PLLSAI division factor for PLLSAIDIVQ output by 15 */
  882. #define LL_RCC_PLLSAIDIVQ_DIV_16 (RCC_DCKCFGR1_PLLSAIDIVQ_3 | RCC_DCKCFGR1_PLLSAIDIVQ_2 | RCC_DCKCFGR1_PLLSAIDIVQ_1 | RCC_DCKCFGR1_PLLSAIDIVQ_0) /*!< PLLSAI division factor for PLLSAIDIVQ output by 16 */
  883. #define LL_RCC_PLLSAIDIVQ_DIV_17 RCC_DCKCFGR1_PLLSAIDIVQ_4 /*!< PLLSAI division factor for PLLSAIDIVQ output by 17 */
  884. #define LL_RCC_PLLSAIDIVQ_DIV_18 (RCC_DCKCFGR1_PLLSAIDIVQ_4 | RCC_DCKCFGR1_PLLSAIDIVQ_0) /*!< PLLSAI division factor for PLLSAIDIVQ output by 18 */
  885. #define LL_RCC_PLLSAIDIVQ_DIV_19 (RCC_DCKCFGR1_PLLSAIDIVQ_4 | RCC_DCKCFGR1_PLLSAIDIVQ_1) /*!< PLLSAI division factor for PLLSAIDIVQ output by 19 */
  886. #define LL_RCC_PLLSAIDIVQ_DIV_20 (RCC_DCKCFGR1_PLLSAIDIVQ_4 | RCC_DCKCFGR1_PLLSAIDIVQ_1 | RCC_DCKCFGR1_PLLSAIDIVQ_0) /*!< PLLSAI division factor for PLLSAIDIVQ output by 20 */
  887. #define LL_RCC_PLLSAIDIVQ_DIV_21 (RCC_DCKCFGR1_PLLSAIDIVQ_4 | RCC_DCKCFGR1_PLLSAIDIVQ_2) /*!< PLLSAI division factor for PLLSAIDIVQ output by 21 */
  888. #define LL_RCC_PLLSAIDIVQ_DIV_22 (RCC_DCKCFGR1_PLLSAIDIVQ_4 | RCC_DCKCFGR1_PLLSAIDIVQ_2 | RCC_DCKCFGR1_PLLSAIDIVQ_0) /*!< PLLSAI division factor for PLLSAIDIVQ output by 22 */
  889. #define LL_RCC_PLLSAIDIVQ_DIV_23 (RCC_DCKCFGR1_PLLSAIDIVQ_4 | RCC_DCKCFGR1_PLLSAIDIVQ_2 | RCC_DCKCFGR1_PLLSAIDIVQ_1) /*!< PLLSAI division factor for PLLSAIDIVQ output by 23 */
  890. #define LL_RCC_PLLSAIDIVQ_DIV_24 (RCC_DCKCFGR1_PLLSAIDIVQ_4 | RCC_DCKCFGR1_PLLSAIDIVQ_2 | RCC_DCKCFGR1_PLLSAIDIVQ_1 | RCC_DCKCFGR1_PLLSAIDIVQ_0) /*!< PLLSAI division factor for PLLSAIDIVQ output by 24 */
  891. #define LL_RCC_PLLSAIDIVQ_DIV_25 (RCC_DCKCFGR1_PLLSAIDIVQ_4 | RCC_DCKCFGR1_PLLSAIDIVQ_3) /*!< PLLSAI division factor for PLLSAIDIVQ output by 25 */
  892. #define LL_RCC_PLLSAIDIVQ_DIV_26 (RCC_DCKCFGR1_PLLSAIDIVQ_4 | RCC_DCKCFGR1_PLLSAIDIVQ_3 | RCC_DCKCFGR1_PLLSAIDIVQ_0) /*!< PLLSAI division factor for PLLSAIDIVQ output by 26 */
  893. #define LL_RCC_PLLSAIDIVQ_DIV_27 (RCC_DCKCFGR1_PLLSAIDIVQ_4 | RCC_DCKCFGR1_PLLSAIDIVQ_3 | RCC_DCKCFGR1_PLLSAIDIVQ_1) /*!< PLLSAI division factor for PLLSAIDIVQ output by 27 */
  894. #define LL_RCC_PLLSAIDIVQ_DIV_28 (RCC_DCKCFGR1_PLLSAIDIVQ_4 | RCC_DCKCFGR1_PLLSAIDIVQ_3 | RCC_DCKCFGR1_PLLSAIDIVQ_1 | RCC_DCKCFGR1_PLLSAIDIVQ_0) /*!< PLLSAI division factor for PLLSAIDIVQ output by 28 */
  895. #define LL_RCC_PLLSAIDIVQ_DIV_29 (RCC_DCKCFGR1_PLLSAIDIVQ_4 | RCC_DCKCFGR1_PLLSAIDIVQ_3 | RCC_DCKCFGR1_PLLSAIDIVQ_2) /*!< PLLSAI division factor for PLLSAIDIVQ output by 29 */
  896. #define LL_RCC_PLLSAIDIVQ_DIV_30 (RCC_DCKCFGR1_PLLSAIDIVQ_4 | RCC_DCKCFGR1_PLLSAIDIVQ_3 | RCC_DCKCFGR1_PLLSAIDIVQ_2 | RCC_DCKCFGR1_PLLSAIDIVQ_0) /*!< PLLSAI division factor for PLLSAIDIVQ output by 30 */
  897. #define LL_RCC_PLLSAIDIVQ_DIV_31 (RCC_DCKCFGR1_PLLSAIDIVQ_4 | RCC_DCKCFGR1_PLLSAIDIVQ_3 | RCC_DCKCFGR1_PLLSAIDIVQ_2 | RCC_DCKCFGR1_PLLSAIDIVQ_1) /*!< PLLSAI division factor for PLLSAIDIVQ output by 31 */
  898. #define LL_RCC_PLLSAIDIVQ_DIV_32 (RCC_DCKCFGR1_PLLSAIDIVQ_4 | RCC_DCKCFGR1_PLLSAIDIVQ_3 | RCC_DCKCFGR1_PLLSAIDIVQ_2 | RCC_DCKCFGR1_PLLSAIDIVQ_1 | RCC_DCKCFGR1_PLLSAIDIVQ_0) /*!< PLLSAI division factor for PLLSAIDIVQ output by 32 */
  899. /**
  900. * @}
  901. */
  902. #if defined(RCC_PLLSAICFGR_PLLSAIR)
  903. /** @defgroup RCC_LL_EC_PLLSAIR PLLSAIR division factor (PLLSAIR)
  904. * @{
  905. */
  906. #define LL_RCC_PLLSAIR_DIV_2 RCC_PLLSAICFGR_PLLSAIR_1 /*!< PLLSAI division factor for PLLSAIR output by 2 */
  907. #define LL_RCC_PLLSAIR_DIV_3 (RCC_PLLSAICFGR_PLLSAIR_1 | RCC_PLLSAICFGR_PLLSAIR_0) /*!< PLLSAI division factor for PLLSAIR output by 3 */
  908. #define LL_RCC_PLLSAIR_DIV_4 RCC_PLLSAICFGR_PLLSAIR_2 /*!< PLLSAI division factor for PLLSAIR output by 4 */
  909. #define LL_RCC_PLLSAIR_DIV_5 (RCC_PLLSAICFGR_PLLSAIR_2 | RCC_PLLSAICFGR_PLLSAIR_0) /*!< PLLSAI division factor for PLLSAIR output by 5 */
  910. #define LL_RCC_PLLSAIR_DIV_6 (RCC_PLLSAICFGR_PLLSAIR_2 | RCC_PLLSAICFGR_PLLSAIR_1) /*!< PLLSAI division factor for PLLSAIR output by 6 */
  911. #define LL_RCC_PLLSAIR_DIV_7 (RCC_PLLSAICFGR_PLLSAIR_2 | RCC_PLLSAICFGR_PLLSAIR_1 | RCC_PLLSAICFGR_PLLSAIR_0) /*!< PLLSAI division factor for PLLSAIR output by 7 */
  912. /**
  913. * @}
  914. */
  915. #endif /* RCC_PLLSAICFGR_PLLSAIR */
  916. #if defined(RCC_DCKCFGR1_PLLSAIDIVR)
  917. /** @defgroup RCC_LL_EC_PLLSAIDIVR PLLSAIDIVR division factor (PLLSAIDIVR)
  918. * @{
  919. */
  920. #define LL_RCC_PLLSAIDIVR_DIV_2 0x00000000U /*!< PLLSAI division factor for PLLSAIDIVR output by 2 */
  921. #define LL_RCC_PLLSAIDIVR_DIV_4 RCC_DCKCFGR1_PLLSAIDIVR_0 /*!< PLLSAI division factor for PLLSAIDIVR output by 4 */
  922. #define LL_RCC_PLLSAIDIVR_DIV_8 RCC_DCKCFGR1_PLLSAIDIVR_1 /*!< PLLSAI division factor for PLLSAIDIVR output by 8 */
  923. #define LL_RCC_PLLSAIDIVR_DIV_16 (RCC_DCKCFGR1_PLLSAIDIVR_1 | RCC_DCKCFGR1_PLLSAIDIVR_0) /*!< PLLSAI division factor for PLLSAIDIVR output by 16 */
  924. /**
  925. * @}
  926. */
  927. #endif /* RCC_DCKCFGR1_PLLSAIDIVR */
  928. /** @defgroup RCC_LL_EC_PLLSAIP PLLSAIP division factor (PLLSAIP)
  929. * @{
  930. */
  931. #define LL_RCC_PLLSAIP_DIV_2 0x00000000U /*!< PLLSAI division factor for PLLSAIP output by 2 */
  932. #define LL_RCC_PLLSAIP_DIV_4 RCC_PLLSAICFGR_PLLSAIP_0 /*!< PLLSAI division factor for PLLSAIP output by 4 */
  933. #define LL_RCC_PLLSAIP_DIV_6 RCC_PLLSAICFGR_PLLSAIP_1 /*!< PLLSAI division factor for PLLSAIP output by 6 */
  934. #define LL_RCC_PLLSAIP_DIV_8 (RCC_PLLSAICFGR_PLLSAIP_1 | RCC_PLLSAICFGR_PLLSAIP_0) /*!< PLLSAI division factor for PLLSAIP output by 8 */
  935. /**
  936. * @}
  937. */
  938. /**
  939. * @}
  940. */
  941. /* Exported macro ------------------------------------------------------------*/
  942. /** @defgroup RCC_LL_Exported_Macros RCC Exported Macros
  943. * @{
  944. */
  945. /** @defgroup RCC_LL_EM_WRITE_READ Common Write and read registers Macros
  946. * @{
  947. */
  948. /**
  949. * @brief Write a value in RCC register
  950. * @param __REG__ Register to be written
  951. * @param __VALUE__ Value to be written in the register
  952. * @retval None
  953. */
  954. #define LL_RCC_WriteReg(__REG__, __VALUE__) WRITE_REG(RCC->__REG__, (__VALUE__))
  955. /**
  956. * @brief Read a value in RCC register
  957. * @param __REG__ Register to be read
  958. * @retval Register value
  959. */
  960. #define LL_RCC_ReadReg(__REG__) READ_REG(RCC->__REG__)
  961. /**
  962. * @}
  963. */
  964. /** @defgroup RCC_LL_EM_CALC_FREQ Calculate frequencies
  965. * @{
  966. */
  967. /**
  968. * @brief Helper macro to calculate the PLLCLK frequency on system domain
  969. * @note ex: @ref __LL_RCC_CALC_PLLCLK_FREQ (HSE_VALUE,@ref LL_RCC_PLL_GetDivider (),
  970. * @ref LL_RCC_PLL_GetN (), @ref LL_RCC_PLL_GetP ());
  971. * @param __INPUTFREQ__ PLL Input frequency (based on HSE/HSI)
  972. * @param __PLLM__ This parameter can be one of the following values:
  973. * @arg @ref LL_RCC_PLLM_DIV_2
  974. * @arg @ref LL_RCC_PLLM_DIV_3
  975. * @arg @ref LL_RCC_PLLM_DIV_4
  976. * @arg @ref LL_RCC_PLLM_DIV_5
  977. * @arg @ref LL_RCC_PLLM_DIV_6
  978. * @arg @ref LL_RCC_PLLM_DIV_7
  979. * @arg @ref LL_RCC_PLLM_DIV_8
  980. * @arg @ref LL_RCC_PLLM_DIV_9
  981. * @arg @ref LL_RCC_PLLM_DIV_10
  982. * @arg @ref LL_RCC_PLLM_DIV_11
  983. * @arg @ref LL_RCC_PLLM_DIV_12
  984. * @arg @ref LL_RCC_PLLM_DIV_13
  985. * @arg @ref LL_RCC_PLLM_DIV_14
  986. * @arg @ref LL_RCC_PLLM_DIV_15
  987. * @arg @ref LL_RCC_PLLM_DIV_16
  988. * @arg @ref LL_RCC_PLLM_DIV_17
  989. * @arg @ref LL_RCC_PLLM_DIV_18
  990. * @arg @ref LL_RCC_PLLM_DIV_19
  991. * @arg @ref LL_RCC_PLLM_DIV_20
  992. * @arg @ref LL_RCC_PLLM_DIV_21
  993. * @arg @ref LL_RCC_PLLM_DIV_22
  994. * @arg @ref LL_RCC_PLLM_DIV_23
  995. * @arg @ref LL_RCC_PLLM_DIV_24
  996. * @arg @ref LL_RCC_PLLM_DIV_25
  997. * @arg @ref LL_RCC_PLLM_DIV_26
  998. * @arg @ref LL_RCC_PLLM_DIV_27
  999. * @arg @ref LL_RCC_PLLM_DIV_28
  1000. * @arg @ref LL_RCC_PLLM_DIV_29
  1001. * @arg @ref LL_RCC_PLLM_DIV_30
  1002. * @arg @ref LL_RCC_PLLM_DIV_31
  1003. * @arg @ref LL_RCC_PLLM_DIV_32
  1004. * @arg @ref LL_RCC_PLLM_DIV_33
  1005. * @arg @ref LL_RCC_PLLM_DIV_34
  1006. * @arg @ref LL_RCC_PLLM_DIV_35
  1007. * @arg @ref LL_RCC_PLLM_DIV_36
  1008. * @arg @ref LL_RCC_PLLM_DIV_37
  1009. * @arg @ref LL_RCC_PLLM_DIV_38
  1010. * @arg @ref LL_RCC_PLLM_DIV_39
  1011. * @arg @ref LL_RCC_PLLM_DIV_40
  1012. * @arg @ref LL_RCC_PLLM_DIV_41
  1013. * @arg @ref LL_RCC_PLLM_DIV_42
  1014. * @arg @ref LL_RCC_PLLM_DIV_43
  1015. * @arg @ref LL_RCC_PLLM_DIV_44
  1016. * @arg @ref LL_RCC_PLLM_DIV_45
  1017. * @arg @ref LL_RCC_PLLM_DIV_46
  1018. * @arg @ref LL_RCC_PLLM_DIV_47
  1019. * @arg @ref LL_RCC_PLLM_DIV_48
  1020. * @arg @ref LL_RCC_PLLM_DIV_49
  1021. * @arg @ref LL_RCC_PLLM_DIV_50
  1022. * @arg @ref LL_RCC_PLLM_DIV_51
  1023. * @arg @ref LL_RCC_PLLM_DIV_52
  1024. * @arg @ref LL_RCC_PLLM_DIV_53
  1025. * @arg @ref LL_RCC_PLLM_DIV_54
  1026. * @arg @ref LL_RCC_PLLM_DIV_55
  1027. * @arg @ref LL_RCC_PLLM_DIV_56
  1028. * @arg @ref LL_RCC_PLLM_DIV_57
  1029. * @arg @ref LL_RCC_PLLM_DIV_58
  1030. * @arg @ref LL_RCC_PLLM_DIV_59
  1031. * @arg @ref LL_RCC_PLLM_DIV_60
  1032. * @arg @ref LL_RCC_PLLM_DIV_61
  1033. * @arg @ref LL_RCC_PLLM_DIV_62
  1034. * @arg @ref LL_RCC_PLLM_DIV_63
  1035. * @param __PLLN__ Between 50 and 432
  1036. * @param __PLLP__ This parameter can be one of the following values:
  1037. * @arg @ref LL_RCC_PLLP_DIV_2
  1038. * @arg @ref LL_RCC_PLLP_DIV_4
  1039. * @arg @ref LL_RCC_PLLP_DIV_6
  1040. * @arg @ref LL_RCC_PLLP_DIV_8
  1041. * @retval PLL clock frequency (in Hz)
  1042. */
  1043. #define __LL_RCC_CALC_PLLCLK_FREQ(__INPUTFREQ__, __PLLM__, __PLLN__, __PLLP__) ((__INPUTFREQ__) / (__PLLM__) * (__PLLN__) / \
  1044. ((((__PLLP__) >> RCC_PLLCFGR_PLLP_Pos ) + 1U) * 2U))
  1045. /**
  1046. * @brief Helper macro to calculate the PLLCLK frequency used on 48M domain
  1047. * @note ex: @ref __LL_RCC_CALC_PLLCLK_48M_FREQ (HSE_VALUE,@ref LL_RCC_PLL_GetDivider (),
  1048. * @ref LL_RCC_PLL_GetN (), @ref LL_RCC_PLL_GetQ ());
  1049. * @param __INPUTFREQ__ PLL Input frequency (based on HSE/HSI)
  1050. * @param __PLLM__ This parameter can be one of the following values:
  1051. * @arg @ref LL_RCC_PLLM_DIV_2
  1052. * @arg @ref LL_RCC_PLLM_DIV_3
  1053. * @arg @ref LL_RCC_PLLM_DIV_4
  1054. * @arg @ref LL_RCC_PLLM_DIV_5
  1055. * @arg @ref LL_RCC_PLLM_DIV_6
  1056. * @arg @ref LL_RCC_PLLM_DIV_7
  1057. * @arg @ref LL_RCC_PLLM_DIV_8
  1058. * @arg @ref LL_RCC_PLLM_DIV_9
  1059. * @arg @ref LL_RCC_PLLM_DIV_10
  1060. * @arg @ref LL_RCC_PLLM_DIV_11
  1061. * @arg @ref LL_RCC_PLLM_DIV_12
  1062. * @arg @ref LL_RCC_PLLM_DIV_13
  1063. * @arg @ref LL_RCC_PLLM_DIV_14
  1064. * @arg @ref LL_RCC_PLLM_DIV_15
  1065. * @arg @ref LL_RCC_PLLM_DIV_16
  1066. * @arg @ref LL_RCC_PLLM_DIV_17
  1067. * @arg @ref LL_RCC_PLLM_DIV_18
  1068. * @arg @ref LL_RCC_PLLM_DIV_19
  1069. * @arg @ref LL_RCC_PLLM_DIV_20
  1070. * @arg @ref LL_RCC_PLLM_DIV_21
  1071. * @arg @ref LL_RCC_PLLM_DIV_22
  1072. * @arg @ref LL_RCC_PLLM_DIV_23
  1073. * @arg @ref LL_RCC_PLLM_DIV_24
  1074. * @arg @ref LL_RCC_PLLM_DIV_25
  1075. * @arg @ref LL_RCC_PLLM_DIV_26
  1076. * @arg @ref LL_RCC_PLLM_DIV_27
  1077. * @arg @ref LL_RCC_PLLM_DIV_28
  1078. * @arg @ref LL_RCC_PLLM_DIV_29
  1079. * @arg @ref LL_RCC_PLLM_DIV_30
  1080. * @arg @ref LL_RCC_PLLM_DIV_31
  1081. * @arg @ref LL_RCC_PLLM_DIV_32
  1082. * @arg @ref LL_RCC_PLLM_DIV_33
  1083. * @arg @ref LL_RCC_PLLM_DIV_34
  1084. * @arg @ref LL_RCC_PLLM_DIV_35
  1085. * @arg @ref LL_RCC_PLLM_DIV_36
  1086. * @arg @ref LL_RCC_PLLM_DIV_37
  1087. * @arg @ref LL_RCC_PLLM_DIV_38
  1088. * @arg @ref LL_RCC_PLLM_DIV_39
  1089. * @arg @ref LL_RCC_PLLM_DIV_40
  1090. * @arg @ref LL_RCC_PLLM_DIV_41
  1091. * @arg @ref LL_RCC_PLLM_DIV_42
  1092. * @arg @ref LL_RCC_PLLM_DIV_43
  1093. * @arg @ref LL_RCC_PLLM_DIV_44
  1094. * @arg @ref LL_RCC_PLLM_DIV_45
  1095. * @arg @ref LL_RCC_PLLM_DIV_46
  1096. * @arg @ref LL_RCC_PLLM_DIV_47
  1097. * @arg @ref LL_RCC_PLLM_DIV_48
  1098. * @arg @ref LL_RCC_PLLM_DIV_49
  1099. * @arg @ref LL_RCC_PLLM_DIV_50
  1100. * @arg @ref LL_RCC_PLLM_DIV_51
  1101. * @arg @ref LL_RCC_PLLM_DIV_52
  1102. * @arg @ref LL_RCC_PLLM_DIV_53
  1103. * @arg @ref LL_RCC_PLLM_DIV_54
  1104. * @arg @ref LL_RCC_PLLM_DIV_55
  1105. * @arg @ref LL_RCC_PLLM_DIV_56
  1106. * @arg @ref LL_RCC_PLLM_DIV_57
  1107. * @arg @ref LL_RCC_PLLM_DIV_58
  1108. * @arg @ref LL_RCC_PLLM_DIV_59
  1109. * @arg @ref LL_RCC_PLLM_DIV_60
  1110. * @arg @ref LL_RCC_PLLM_DIV_61
  1111. * @arg @ref LL_RCC_PLLM_DIV_62
  1112. * @arg @ref LL_RCC_PLLM_DIV_63
  1113. * @param __PLLN__ Between 50 and 432
  1114. * @param __PLLQ__ This parameter can be one of the following values:
  1115. * @arg @ref LL_RCC_PLLQ_DIV_2
  1116. * @arg @ref LL_RCC_PLLQ_DIV_3
  1117. * @arg @ref LL_RCC_PLLQ_DIV_4
  1118. * @arg @ref LL_RCC_PLLQ_DIV_5
  1119. * @arg @ref LL_RCC_PLLQ_DIV_6
  1120. * @arg @ref LL_RCC_PLLQ_DIV_7
  1121. * @arg @ref LL_RCC_PLLQ_DIV_8
  1122. * @arg @ref LL_RCC_PLLQ_DIV_9
  1123. * @arg @ref LL_RCC_PLLQ_DIV_10
  1124. * @arg @ref LL_RCC_PLLQ_DIV_11
  1125. * @arg @ref LL_RCC_PLLQ_DIV_12
  1126. * @arg @ref LL_RCC_PLLQ_DIV_13
  1127. * @arg @ref LL_RCC_PLLQ_DIV_14
  1128. * @arg @ref LL_RCC_PLLQ_DIV_15
  1129. * @retval PLL clock frequency (in Hz)
  1130. */
  1131. #define __LL_RCC_CALC_PLLCLK_48M_FREQ(__INPUTFREQ__, __PLLM__, __PLLN__, __PLLQ__) ((__INPUTFREQ__) / (__PLLM__) * (__PLLN__) / \
  1132. ((__PLLQ__) >> RCC_PLLCFGR_PLLQ_Pos ))
  1133. #if defined(DSI)
  1134. /**
  1135. * @brief Helper macro to calculate the PLLCLK frequency used on DSI
  1136. * @note ex: @ref __LL_RCC_CALC_PLLCLK_DSI_FREQ (HSE_VALUE, @ref LL_RCC_PLL_GetDivider (),
  1137. * @ref LL_RCC_PLL_GetN (), @ref LL_RCC_PLL_GetR ());
  1138. * @param __INPUTFREQ__ PLL Input frequency (based on HSE/HSI)
  1139. * @param __PLLM__ This parameter can be one of the following values:
  1140. * @arg @ref LL_RCC_PLLM_DIV_2
  1141. * @arg @ref LL_RCC_PLLM_DIV_3
  1142. * @arg @ref LL_RCC_PLLM_DIV_4
  1143. * @arg @ref LL_RCC_PLLM_DIV_5
  1144. * @arg @ref LL_RCC_PLLM_DIV_6
  1145. * @arg @ref LL_RCC_PLLM_DIV_7
  1146. * @arg @ref LL_RCC_PLLM_DIV_8
  1147. * @arg @ref LL_RCC_PLLM_DIV_9
  1148. * @arg @ref LL_RCC_PLLM_DIV_10
  1149. * @arg @ref LL_RCC_PLLM_DIV_11
  1150. * @arg @ref LL_RCC_PLLM_DIV_12
  1151. * @arg @ref LL_RCC_PLLM_DIV_13
  1152. * @arg @ref LL_RCC_PLLM_DIV_14
  1153. * @arg @ref LL_RCC_PLLM_DIV_15
  1154. * @arg @ref LL_RCC_PLLM_DIV_16
  1155. * @arg @ref LL_RCC_PLLM_DIV_17
  1156. * @arg @ref LL_RCC_PLLM_DIV_18
  1157. * @arg @ref LL_RCC_PLLM_DIV_19
  1158. * @arg @ref LL_RCC_PLLM_DIV_20
  1159. * @arg @ref LL_RCC_PLLM_DIV_21
  1160. * @arg @ref LL_RCC_PLLM_DIV_22
  1161. * @arg @ref LL_RCC_PLLM_DIV_23
  1162. * @arg @ref LL_RCC_PLLM_DIV_24
  1163. * @arg @ref LL_RCC_PLLM_DIV_25
  1164. * @arg @ref LL_RCC_PLLM_DIV_26
  1165. * @arg @ref LL_RCC_PLLM_DIV_27
  1166. * @arg @ref LL_RCC_PLLM_DIV_28
  1167. * @arg @ref LL_RCC_PLLM_DIV_29
  1168. * @arg @ref LL_RCC_PLLM_DIV_30
  1169. * @arg @ref LL_RCC_PLLM_DIV_31
  1170. * @arg @ref LL_RCC_PLLM_DIV_32
  1171. * @arg @ref LL_RCC_PLLM_DIV_33
  1172. * @arg @ref LL_RCC_PLLM_DIV_34
  1173. * @arg @ref LL_RCC_PLLM_DIV_35
  1174. * @arg @ref LL_RCC_PLLM_DIV_36
  1175. * @arg @ref LL_RCC_PLLM_DIV_37
  1176. * @arg @ref LL_RCC_PLLM_DIV_38
  1177. * @arg @ref LL_RCC_PLLM_DIV_39
  1178. * @arg @ref LL_RCC_PLLM_DIV_40
  1179. * @arg @ref LL_RCC_PLLM_DIV_41
  1180. * @arg @ref LL_RCC_PLLM_DIV_42
  1181. * @arg @ref LL_RCC_PLLM_DIV_43
  1182. * @arg @ref LL_RCC_PLLM_DIV_44
  1183. * @arg @ref LL_RCC_PLLM_DIV_45
  1184. * @arg @ref LL_RCC_PLLM_DIV_46
  1185. * @arg @ref LL_RCC_PLLM_DIV_47
  1186. * @arg @ref LL_RCC_PLLM_DIV_48
  1187. * @arg @ref LL_RCC_PLLM_DIV_49
  1188. * @arg @ref LL_RCC_PLLM_DIV_50
  1189. * @arg @ref LL_RCC_PLLM_DIV_51
  1190. * @arg @ref LL_RCC_PLLM_DIV_52
  1191. * @arg @ref LL_RCC_PLLM_DIV_53
  1192. * @arg @ref LL_RCC_PLLM_DIV_54
  1193. * @arg @ref LL_RCC_PLLM_DIV_55
  1194. * @arg @ref LL_RCC_PLLM_DIV_56
  1195. * @arg @ref LL_RCC_PLLM_DIV_57
  1196. * @arg @ref LL_RCC_PLLM_DIV_58
  1197. * @arg @ref LL_RCC_PLLM_DIV_59
  1198. * @arg @ref LL_RCC_PLLM_DIV_60
  1199. * @arg @ref LL_RCC_PLLM_DIV_61
  1200. * @arg @ref LL_RCC_PLLM_DIV_62
  1201. * @arg @ref LL_RCC_PLLM_DIV_63
  1202. * @param __PLLN__ Between 50 and 432
  1203. * @param __PLLR__ This parameter can be one of the following values:
  1204. * @arg @ref LL_RCC_PLLR_DIV_2
  1205. * @arg @ref LL_RCC_PLLR_DIV_3
  1206. * @arg @ref LL_RCC_PLLR_DIV_4
  1207. * @arg @ref LL_RCC_PLLR_DIV_5
  1208. * @arg @ref LL_RCC_PLLR_DIV_6
  1209. * @arg @ref LL_RCC_PLLR_DIV_7
  1210. * @retval PLL clock frequency (in Hz)
  1211. */
  1212. #define __LL_RCC_CALC_PLLCLK_DSI_FREQ(__INPUTFREQ__, __PLLM__, __PLLN__, __PLLR__) ((__INPUTFREQ__) / (__PLLM__) * (__PLLN__) / \
  1213. ((__PLLR__) >> RCC_PLLCFGR_PLLR_Pos ))
  1214. #endif /* DSI */
  1215. /**
  1216. * @brief Helper macro to calculate the PLLSAI frequency used for SAI1 and SAI2 domains
  1217. * @note ex: @ref __LL_RCC_CALC_PLLSAI_SAI_FREQ (HSE_VALUE,@ref LL_RCC_PLL_GetDivider (),
  1218. * @ref LL_RCC_PLLSAI_GetN (), @ref LL_RCC_PLLSAI_GetQ (), @ref LL_RCC_PLLSAI_GetDIVQ ());
  1219. * @param __INPUTFREQ__ PLL Input frequency (based on HSE/HSI)
  1220. * @param __PLLM__ This parameter can be one of the following values:
  1221. * @arg @ref LL_RCC_PLLM_DIV_2
  1222. * @arg @ref LL_RCC_PLLM_DIV_3
  1223. * @arg @ref LL_RCC_PLLM_DIV_4
  1224. * @arg @ref LL_RCC_PLLM_DIV_5
  1225. * @arg @ref LL_RCC_PLLM_DIV_6
  1226. * @arg @ref LL_RCC_PLLM_DIV_7
  1227. * @arg @ref LL_RCC_PLLM_DIV_8
  1228. * @arg @ref LL_RCC_PLLM_DIV_9
  1229. * @arg @ref LL_RCC_PLLM_DIV_10
  1230. * @arg @ref LL_RCC_PLLM_DIV_11
  1231. * @arg @ref LL_RCC_PLLM_DIV_12
  1232. * @arg @ref LL_RCC_PLLM_DIV_13
  1233. * @arg @ref LL_RCC_PLLM_DIV_14
  1234. * @arg @ref LL_RCC_PLLM_DIV_15
  1235. * @arg @ref LL_RCC_PLLM_DIV_16
  1236. * @arg @ref LL_RCC_PLLM_DIV_17
  1237. * @arg @ref LL_RCC_PLLM_DIV_18
  1238. * @arg @ref LL_RCC_PLLM_DIV_19
  1239. * @arg @ref LL_RCC_PLLM_DIV_20
  1240. * @arg @ref LL_RCC_PLLM_DIV_21
  1241. * @arg @ref LL_RCC_PLLM_DIV_22
  1242. * @arg @ref LL_RCC_PLLM_DIV_23
  1243. * @arg @ref LL_RCC_PLLM_DIV_24
  1244. * @arg @ref LL_RCC_PLLM_DIV_25
  1245. * @arg @ref LL_RCC_PLLM_DIV_26
  1246. * @arg @ref LL_RCC_PLLM_DIV_27
  1247. * @arg @ref LL_RCC_PLLM_DIV_28
  1248. * @arg @ref LL_RCC_PLLM_DIV_29
  1249. * @arg @ref LL_RCC_PLLM_DIV_30
  1250. * @arg @ref LL_RCC_PLLM_DIV_31
  1251. * @arg @ref LL_RCC_PLLM_DIV_32
  1252. * @arg @ref LL_RCC_PLLM_DIV_33
  1253. * @arg @ref LL_RCC_PLLM_DIV_34
  1254. * @arg @ref LL_RCC_PLLM_DIV_35
  1255. * @arg @ref LL_RCC_PLLM_DIV_36
  1256. * @arg @ref LL_RCC_PLLM_DIV_37
  1257. * @arg @ref LL_RCC_PLLM_DIV_38
  1258. * @arg @ref LL_RCC_PLLM_DIV_39
  1259. * @arg @ref LL_RCC_PLLM_DIV_40
  1260. * @arg @ref LL_RCC_PLLM_DIV_41
  1261. * @arg @ref LL_RCC_PLLM_DIV_42
  1262. * @arg @ref LL_RCC_PLLM_DIV_43
  1263. * @arg @ref LL_RCC_PLLM_DIV_44
  1264. * @arg @ref LL_RCC_PLLM_DIV_45
  1265. * @arg @ref LL_RCC_PLLM_DIV_46
  1266. * @arg @ref LL_RCC_PLLM_DIV_47
  1267. * @arg @ref LL_RCC_PLLM_DIV_48
  1268. * @arg @ref LL_RCC_PLLM_DIV_49
  1269. * @arg @ref LL_RCC_PLLM_DIV_50
  1270. * @arg @ref LL_RCC_PLLM_DIV_51
  1271. * @arg @ref LL_RCC_PLLM_DIV_52
  1272. * @arg @ref LL_RCC_PLLM_DIV_53
  1273. * @arg @ref LL_RCC_PLLM_DIV_54
  1274. * @arg @ref LL_RCC_PLLM_DIV_55
  1275. * @arg @ref LL_RCC_PLLM_DIV_56
  1276. * @arg @ref LL_RCC_PLLM_DIV_57
  1277. * @arg @ref LL_RCC_PLLM_DIV_58
  1278. * @arg @ref LL_RCC_PLLM_DIV_59
  1279. * @arg @ref LL_RCC_PLLM_DIV_60
  1280. * @arg @ref LL_RCC_PLLM_DIV_61
  1281. * @arg @ref LL_RCC_PLLM_DIV_62
  1282. * @arg @ref LL_RCC_PLLM_DIV_63
  1283. * @param __PLLSAIN__ Between 50 and 432
  1284. * @param __PLLSAIQ__ This parameter can be one of the following values:
  1285. * @arg @ref LL_RCC_PLLSAIQ_DIV_2
  1286. * @arg @ref LL_RCC_PLLSAIQ_DIV_3
  1287. * @arg @ref LL_RCC_PLLSAIQ_DIV_4
  1288. * @arg @ref LL_RCC_PLLSAIQ_DIV_5
  1289. * @arg @ref LL_RCC_PLLSAIQ_DIV_6
  1290. * @arg @ref LL_RCC_PLLSAIQ_DIV_7
  1291. * @arg @ref LL_RCC_PLLSAIQ_DIV_8
  1292. * @arg @ref LL_RCC_PLLSAIQ_DIV_9
  1293. * @arg @ref LL_RCC_PLLSAIQ_DIV_10
  1294. * @arg @ref LL_RCC_PLLSAIQ_DIV_11
  1295. * @arg @ref LL_RCC_PLLSAIQ_DIV_12
  1296. * @arg @ref LL_RCC_PLLSAIQ_DIV_13
  1297. * @arg @ref LL_RCC_PLLSAIQ_DIV_14
  1298. * @arg @ref LL_RCC_PLLSAIQ_DIV_15
  1299. * @param __PLLSAIDIVQ__ This parameter can be one of the following values:
  1300. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_1
  1301. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_2
  1302. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_3
  1303. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_4
  1304. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_5
  1305. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_6
  1306. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_7
  1307. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_8
  1308. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_9
  1309. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_10
  1310. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_11
  1311. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_12
  1312. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_13
  1313. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_14
  1314. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_15
  1315. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_16
  1316. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_17
  1317. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_18
  1318. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_19
  1319. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_20
  1320. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_21
  1321. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_22
  1322. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_23
  1323. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_24
  1324. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_25
  1325. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_26
  1326. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_27
  1327. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_28
  1328. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_29
  1329. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_30
  1330. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_31
  1331. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_32
  1332. * @retval PLLSAI clock frequency (in Hz)
  1333. */
  1334. #define __LL_RCC_CALC_PLLSAI_SAI_FREQ(__INPUTFREQ__, __PLLM__, __PLLSAIN__, __PLLSAIQ__, __PLLSAIDIVQ__) (((__INPUTFREQ__) / (__PLLM__)) * (__PLLSAIN__) / \
  1335. (((__PLLSAIQ__) >> RCC_PLLSAICFGR_PLLSAIQ_Pos) * (((__PLLSAIDIVQ__) >> RCC_DCKCFGR1_PLLSAIDIVQ_Pos) + 1U)))
  1336. /**
  1337. * @brief Helper macro to calculate the PLLSAI frequency used on 48Mhz domain
  1338. * @note ex: @ref __LL_RCC_CALC_PLLSAI_48M_FREQ (HSE_VALUE,@ref LL_RCC_PLL_GetDivider (),
  1339. * @ref LL_RCC_PLLSAI_GetN (), @ref LL_RCC_PLLSAI_GetP ());
  1340. * @param __INPUTFREQ__ PLL Input frequency (based on HSE/HSI)
  1341. * @param __PLLM__ This parameter can be one of the following values:
  1342. * @arg @ref LL_RCC_PLLM_DIV_2
  1343. * @arg @ref LL_RCC_PLLM_DIV_3
  1344. * @arg @ref LL_RCC_PLLM_DIV_4
  1345. * @arg @ref LL_RCC_PLLM_DIV_5
  1346. * @arg @ref LL_RCC_PLLM_DIV_6
  1347. * @arg @ref LL_RCC_PLLM_DIV_7
  1348. * @arg @ref LL_RCC_PLLM_DIV_8
  1349. * @arg @ref LL_RCC_PLLM_DIV_9
  1350. * @arg @ref LL_RCC_PLLM_DIV_10
  1351. * @arg @ref LL_RCC_PLLM_DIV_11
  1352. * @arg @ref LL_RCC_PLLM_DIV_12
  1353. * @arg @ref LL_RCC_PLLM_DIV_13
  1354. * @arg @ref LL_RCC_PLLM_DIV_14
  1355. * @arg @ref LL_RCC_PLLM_DIV_15
  1356. * @arg @ref LL_RCC_PLLM_DIV_16
  1357. * @arg @ref LL_RCC_PLLM_DIV_17
  1358. * @arg @ref LL_RCC_PLLM_DIV_18
  1359. * @arg @ref LL_RCC_PLLM_DIV_19
  1360. * @arg @ref LL_RCC_PLLM_DIV_20
  1361. * @arg @ref LL_RCC_PLLM_DIV_21
  1362. * @arg @ref LL_RCC_PLLM_DIV_22
  1363. * @arg @ref LL_RCC_PLLM_DIV_23
  1364. * @arg @ref LL_RCC_PLLM_DIV_24
  1365. * @arg @ref LL_RCC_PLLM_DIV_25
  1366. * @arg @ref LL_RCC_PLLM_DIV_26
  1367. * @arg @ref LL_RCC_PLLM_DIV_27
  1368. * @arg @ref LL_RCC_PLLM_DIV_28
  1369. * @arg @ref LL_RCC_PLLM_DIV_29
  1370. * @arg @ref LL_RCC_PLLM_DIV_30
  1371. * @arg @ref LL_RCC_PLLM_DIV_31
  1372. * @arg @ref LL_RCC_PLLM_DIV_32
  1373. * @arg @ref LL_RCC_PLLM_DIV_33
  1374. * @arg @ref LL_RCC_PLLM_DIV_34
  1375. * @arg @ref LL_RCC_PLLM_DIV_35
  1376. * @arg @ref LL_RCC_PLLM_DIV_36
  1377. * @arg @ref LL_RCC_PLLM_DIV_37
  1378. * @arg @ref LL_RCC_PLLM_DIV_38
  1379. * @arg @ref LL_RCC_PLLM_DIV_39
  1380. * @arg @ref LL_RCC_PLLM_DIV_40
  1381. * @arg @ref LL_RCC_PLLM_DIV_41
  1382. * @arg @ref LL_RCC_PLLM_DIV_42
  1383. * @arg @ref LL_RCC_PLLM_DIV_43
  1384. * @arg @ref LL_RCC_PLLM_DIV_44
  1385. * @arg @ref LL_RCC_PLLM_DIV_45
  1386. * @arg @ref LL_RCC_PLLM_DIV_46
  1387. * @arg @ref LL_RCC_PLLM_DIV_47
  1388. * @arg @ref LL_RCC_PLLM_DIV_48
  1389. * @arg @ref LL_RCC_PLLM_DIV_49
  1390. * @arg @ref LL_RCC_PLLM_DIV_50
  1391. * @arg @ref LL_RCC_PLLM_DIV_51
  1392. * @arg @ref LL_RCC_PLLM_DIV_52
  1393. * @arg @ref LL_RCC_PLLM_DIV_53
  1394. * @arg @ref LL_RCC_PLLM_DIV_54
  1395. * @arg @ref LL_RCC_PLLM_DIV_55
  1396. * @arg @ref LL_RCC_PLLM_DIV_56
  1397. * @arg @ref LL_RCC_PLLM_DIV_57
  1398. * @arg @ref LL_RCC_PLLM_DIV_58
  1399. * @arg @ref LL_RCC_PLLM_DIV_59
  1400. * @arg @ref LL_RCC_PLLM_DIV_60
  1401. * @arg @ref LL_RCC_PLLM_DIV_61
  1402. * @arg @ref LL_RCC_PLLM_DIV_62
  1403. * @arg @ref LL_RCC_PLLM_DIV_63
  1404. * @param __PLLSAIN__ Between 50 and 432
  1405. * @param __PLLSAIP__ This parameter can be one of the following values:
  1406. * @arg @ref LL_RCC_PLLSAIP_DIV_2
  1407. * @arg @ref LL_RCC_PLLSAIP_DIV_4
  1408. * @arg @ref LL_RCC_PLLSAIP_DIV_6
  1409. * @arg @ref LL_RCC_PLLSAIP_DIV_8
  1410. * @retval PLLSAI clock frequency (in Hz)
  1411. */
  1412. #define __LL_RCC_CALC_PLLSAI_48M_FREQ(__INPUTFREQ__, __PLLM__, __PLLSAIN__, __PLLSAIP__) (((__INPUTFREQ__) / (__PLLM__)) * (__PLLSAIN__) / \
  1413. ((((__PLLSAIP__) >> RCC_PLLSAICFGR_PLLSAIP_Pos) + 1U ) * 2U))
  1414. #if defined(LTDC)
  1415. /**
  1416. * @brief Helper macro to calculate the PLLSAI frequency used for LTDC domain
  1417. * @note ex: @ref __LL_RCC_CALC_PLLSAI_LTDC_FREQ (HSE_VALUE,@ref LL_RCC_PLL_GetDivider (),
  1418. * @ref LL_RCC_PLLSAI_GetN (), @ref LL_RCC_PLLSAI_GetR (), @ref LL_RCC_PLLSAI_GetDIVR ());
  1419. * @param __INPUTFREQ__ PLL Input frequency (based on HSE/HSI)
  1420. * @param __PLLM__ This parameter can be one of the following values:
  1421. * @arg @ref LL_RCC_PLLM_DIV_2
  1422. * @arg @ref LL_RCC_PLLM_DIV_3
  1423. * @arg @ref LL_RCC_PLLM_DIV_4
  1424. * @arg @ref LL_RCC_PLLM_DIV_5
  1425. * @arg @ref LL_RCC_PLLM_DIV_6
  1426. * @arg @ref LL_RCC_PLLM_DIV_7
  1427. * @arg @ref LL_RCC_PLLM_DIV_8
  1428. * @arg @ref LL_RCC_PLLM_DIV_9
  1429. * @arg @ref LL_RCC_PLLM_DIV_10
  1430. * @arg @ref LL_RCC_PLLM_DIV_11
  1431. * @arg @ref LL_RCC_PLLM_DIV_12
  1432. * @arg @ref LL_RCC_PLLM_DIV_13
  1433. * @arg @ref LL_RCC_PLLM_DIV_14
  1434. * @arg @ref LL_RCC_PLLM_DIV_15
  1435. * @arg @ref LL_RCC_PLLM_DIV_16
  1436. * @arg @ref LL_RCC_PLLM_DIV_17
  1437. * @arg @ref LL_RCC_PLLM_DIV_18
  1438. * @arg @ref LL_RCC_PLLM_DIV_19
  1439. * @arg @ref LL_RCC_PLLM_DIV_20
  1440. * @arg @ref LL_RCC_PLLM_DIV_21
  1441. * @arg @ref LL_RCC_PLLM_DIV_22
  1442. * @arg @ref LL_RCC_PLLM_DIV_23
  1443. * @arg @ref LL_RCC_PLLM_DIV_24
  1444. * @arg @ref LL_RCC_PLLM_DIV_25
  1445. * @arg @ref LL_RCC_PLLM_DIV_26
  1446. * @arg @ref LL_RCC_PLLM_DIV_27
  1447. * @arg @ref LL_RCC_PLLM_DIV_28
  1448. * @arg @ref LL_RCC_PLLM_DIV_29
  1449. * @arg @ref LL_RCC_PLLM_DIV_30
  1450. * @arg @ref LL_RCC_PLLM_DIV_31
  1451. * @arg @ref LL_RCC_PLLM_DIV_32
  1452. * @arg @ref LL_RCC_PLLM_DIV_33
  1453. * @arg @ref LL_RCC_PLLM_DIV_34
  1454. * @arg @ref LL_RCC_PLLM_DIV_35
  1455. * @arg @ref LL_RCC_PLLM_DIV_36
  1456. * @arg @ref LL_RCC_PLLM_DIV_37
  1457. * @arg @ref LL_RCC_PLLM_DIV_38
  1458. * @arg @ref LL_RCC_PLLM_DIV_39
  1459. * @arg @ref LL_RCC_PLLM_DIV_40
  1460. * @arg @ref LL_RCC_PLLM_DIV_41
  1461. * @arg @ref LL_RCC_PLLM_DIV_42
  1462. * @arg @ref LL_RCC_PLLM_DIV_43
  1463. * @arg @ref LL_RCC_PLLM_DIV_44
  1464. * @arg @ref LL_RCC_PLLM_DIV_45
  1465. * @arg @ref LL_RCC_PLLM_DIV_46
  1466. * @arg @ref LL_RCC_PLLM_DIV_47
  1467. * @arg @ref LL_RCC_PLLM_DIV_48
  1468. * @arg @ref LL_RCC_PLLM_DIV_49
  1469. * @arg @ref LL_RCC_PLLM_DIV_50
  1470. * @arg @ref LL_RCC_PLLM_DIV_51
  1471. * @arg @ref LL_RCC_PLLM_DIV_52
  1472. * @arg @ref LL_RCC_PLLM_DIV_53
  1473. * @arg @ref LL_RCC_PLLM_DIV_54
  1474. * @arg @ref LL_RCC_PLLM_DIV_55
  1475. * @arg @ref LL_RCC_PLLM_DIV_56
  1476. * @arg @ref LL_RCC_PLLM_DIV_57
  1477. * @arg @ref LL_RCC_PLLM_DIV_58
  1478. * @arg @ref LL_RCC_PLLM_DIV_59
  1479. * @arg @ref LL_RCC_PLLM_DIV_60
  1480. * @arg @ref LL_RCC_PLLM_DIV_61
  1481. * @arg @ref LL_RCC_PLLM_DIV_62
  1482. * @arg @ref LL_RCC_PLLM_DIV_63
  1483. * @param __PLLSAIN__ Between 50 and 432
  1484. * @param __PLLSAIR__ This parameter can be one of the following values:
  1485. * @arg @ref LL_RCC_PLLSAIR_DIV_2
  1486. * @arg @ref LL_RCC_PLLSAIR_DIV_3
  1487. * @arg @ref LL_RCC_PLLSAIR_DIV_4
  1488. * @arg @ref LL_RCC_PLLSAIR_DIV_5
  1489. * @arg @ref LL_RCC_PLLSAIR_DIV_6
  1490. * @arg @ref LL_RCC_PLLSAIR_DIV_7
  1491. * @param __PLLSAIDIVR__ This parameter can be one of the following values:
  1492. * @arg @ref LL_RCC_PLLSAIDIVR_DIV_2
  1493. * @arg @ref LL_RCC_PLLSAIDIVR_DIV_4
  1494. * @arg @ref LL_RCC_PLLSAIDIVR_DIV_8
  1495. * @arg @ref LL_RCC_PLLSAIDIVR_DIV_16
  1496. * @retval PLLSAI clock frequency (in Hz)
  1497. */
  1498. #define __LL_RCC_CALC_PLLSAI_LTDC_FREQ(__INPUTFREQ__, __PLLM__, __PLLSAIN__, __PLLSAIR__, __PLLSAIDIVR__) (((__INPUTFREQ__) / (__PLLM__)) * (__PLLSAIN__) / \
  1499. (((__PLLSAIR__) >> RCC_PLLSAICFGR_PLLSAIR_Pos) * (aRCC_PLLSAIDIVRPrescTable[(__PLLSAIDIVR__) >> RCC_DCKCFGR1_PLLSAIDIVR_Pos])))
  1500. #endif /* LTDC */
  1501. /**
  1502. * @brief Helper macro to calculate the PLLI2S frequency used for SAI1 and SAI2 domains
  1503. * @note ex: @ref __LL_RCC_CALC_PLLI2S_SAI_FREQ (HSE_VALUE,@ref LL_RCC_PLL_GetDivider (),
  1504. * @ref LL_RCC_PLLI2S_GetN (), @ref LL_RCC_PLLI2S_GetQ (), @ref LL_RCC_PLLI2S_GetDIVQ ());
  1505. * @param __INPUTFREQ__ PLL Input frequency (based on HSE/HSI)
  1506. * @param __PLLM__ This parameter can be one of the following values:
  1507. * @arg @ref LL_RCC_PLLM_DIV_2
  1508. * @arg @ref LL_RCC_PLLM_DIV_3
  1509. * @arg @ref LL_RCC_PLLM_DIV_4
  1510. * @arg @ref LL_RCC_PLLM_DIV_5
  1511. * @arg @ref LL_RCC_PLLM_DIV_6
  1512. * @arg @ref LL_RCC_PLLM_DIV_7
  1513. * @arg @ref LL_RCC_PLLM_DIV_8
  1514. * @arg @ref LL_RCC_PLLM_DIV_9
  1515. * @arg @ref LL_RCC_PLLM_DIV_10
  1516. * @arg @ref LL_RCC_PLLM_DIV_11
  1517. * @arg @ref LL_RCC_PLLM_DIV_12
  1518. * @arg @ref LL_RCC_PLLM_DIV_13
  1519. * @arg @ref LL_RCC_PLLM_DIV_14
  1520. * @arg @ref LL_RCC_PLLM_DIV_15
  1521. * @arg @ref LL_RCC_PLLM_DIV_16
  1522. * @arg @ref LL_RCC_PLLM_DIV_17
  1523. * @arg @ref LL_RCC_PLLM_DIV_18
  1524. * @arg @ref LL_RCC_PLLM_DIV_19
  1525. * @arg @ref LL_RCC_PLLM_DIV_20
  1526. * @arg @ref LL_RCC_PLLM_DIV_21
  1527. * @arg @ref LL_RCC_PLLM_DIV_22
  1528. * @arg @ref LL_RCC_PLLM_DIV_23
  1529. * @arg @ref LL_RCC_PLLM_DIV_24
  1530. * @arg @ref LL_RCC_PLLM_DIV_25
  1531. * @arg @ref LL_RCC_PLLM_DIV_26
  1532. * @arg @ref LL_RCC_PLLM_DIV_27
  1533. * @arg @ref LL_RCC_PLLM_DIV_28
  1534. * @arg @ref LL_RCC_PLLM_DIV_29
  1535. * @arg @ref LL_RCC_PLLM_DIV_30
  1536. * @arg @ref LL_RCC_PLLM_DIV_31
  1537. * @arg @ref LL_RCC_PLLM_DIV_32
  1538. * @arg @ref LL_RCC_PLLM_DIV_33
  1539. * @arg @ref LL_RCC_PLLM_DIV_34
  1540. * @arg @ref LL_RCC_PLLM_DIV_35
  1541. * @arg @ref LL_RCC_PLLM_DIV_36
  1542. * @arg @ref LL_RCC_PLLM_DIV_37
  1543. * @arg @ref LL_RCC_PLLM_DIV_38
  1544. * @arg @ref LL_RCC_PLLM_DIV_39
  1545. * @arg @ref LL_RCC_PLLM_DIV_40
  1546. * @arg @ref LL_RCC_PLLM_DIV_41
  1547. * @arg @ref LL_RCC_PLLM_DIV_42
  1548. * @arg @ref LL_RCC_PLLM_DIV_43
  1549. * @arg @ref LL_RCC_PLLM_DIV_44
  1550. * @arg @ref LL_RCC_PLLM_DIV_45
  1551. * @arg @ref LL_RCC_PLLM_DIV_46
  1552. * @arg @ref LL_RCC_PLLM_DIV_47
  1553. * @arg @ref LL_RCC_PLLM_DIV_48
  1554. * @arg @ref LL_RCC_PLLM_DIV_49
  1555. * @arg @ref LL_RCC_PLLM_DIV_50
  1556. * @arg @ref LL_RCC_PLLM_DIV_51
  1557. * @arg @ref LL_RCC_PLLM_DIV_52
  1558. * @arg @ref LL_RCC_PLLM_DIV_53
  1559. * @arg @ref LL_RCC_PLLM_DIV_54
  1560. * @arg @ref LL_RCC_PLLM_DIV_55
  1561. * @arg @ref LL_RCC_PLLM_DIV_56
  1562. * @arg @ref LL_RCC_PLLM_DIV_57
  1563. * @arg @ref LL_RCC_PLLM_DIV_58
  1564. * @arg @ref LL_RCC_PLLM_DIV_59
  1565. * @arg @ref LL_RCC_PLLM_DIV_60
  1566. * @arg @ref LL_RCC_PLLM_DIV_61
  1567. * @arg @ref LL_RCC_PLLM_DIV_62
  1568. * @arg @ref LL_RCC_PLLM_DIV_63
  1569. * @param __PLLI2SN__ Between 50 and 432
  1570. * @param __PLLI2SQ__ This parameter can be one of the following values:
  1571. * @arg @ref LL_RCC_PLLI2SQ_DIV_2
  1572. * @arg @ref LL_RCC_PLLI2SQ_DIV_3
  1573. * @arg @ref LL_RCC_PLLI2SQ_DIV_4
  1574. * @arg @ref LL_RCC_PLLI2SQ_DIV_5
  1575. * @arg @ref LL_RCC_PLLI2SQ_DIV_6
  1576. * @arg @ref LL_RCC_PLLI2SQ_DIV_7
  1577. * @arg @ref LL_RCC_PLLI2SQ_DIV_8
  1578. * @arg @ref LL_RCC_PLLI2SQ_DIV_9
  1579. * @arg @ref LL_RCC_PLLI2SQ_DIV_10
  1580. * @arg @ref LL_RCC_PLLI2SQ_DIV_11
  1581. * @arg @ref LL_RCC_PLLI2SQ_DIV_12
  1582. * @arg @ref LL_RCC_PLLI2SQ_DIV_13
  1583. * @arg @ref LL_RCC_PLLI2SQ_DIV_14
  1584. * @arg @ref LL_RCC_PLLI2SQ_DIV_15
  1585. * @param __PLLI2SDIVQ__ This parameter can be one of the following values:
  1586. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_1
  1587. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_2
  1588. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_3
  1589. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_4
  1590. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_5
  1591. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_6
  1592. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_7
  1593. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_8
  1594. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_9
  1595. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_10
  1596. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_11
  1597. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_12
  1598. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_13
  1599. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_14
  1600. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_15
  1601. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_16
  1602. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_17
  1603. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_18
  1604. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_19
  1605. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_20
  1606. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_21
  1607. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_22
  1608. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_23
  1609. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_24
  1610. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_25
  1611. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_26
  1612. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_27
  1613. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_28
  1614. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_29
  1615. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_30
  1616. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_31
  1617. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_32
  1618. * @retval PLLI2S clock frequency (in Hz)
  1619. */
  1620. #define __LL_RCC_CALC_PLLI2S_SAI_FREQ(__INPUTFREQ__, __PLLM__, __PLLI2SN__, __PLLI2SQ__, __PLLI2SDIVQ__) (((__INPUTFREQ__) / (__PLLM__)) * (__PLLI2SN__) / \
  1621. (((__PLLI2SQ__) >> RCC_PLLI2SCFGR_PLLI2SQ_Pos) * (((__PLLI2SDIVQ__) >> RCC_DCKCFGR1_PLLI2SDIVQ_Pos) + 1U)))
  1622. #if defined(SPDIFRX)
  1623. /**
  1624. * @brief Helper macro to calculate the PLLI2S frequency used on SPDIFRX domain
  1625. * @note ex: @ref __LL_RCC_CALC_PLLI2S_SPDIFRX_FREQ (HSE_VALUE,@ref LL_RCC_PLL_GetDivider (),
  1626. * @ref LL_RCC_PLLI2S_GetN (), @ref LL_RCC_PLLI2S_GetP ());
  1627. * @param __INPUTFREQ__ PLL Input frequency (based on HSE/HSI)
  1628. * @param __PLLM__ This parameter can be one of the following values:
  1629. * @arg @ref LL_RCC_PLLM_DIV_2
  1630. * @arg @ref LL_RCC_PLLM_DIV_3
  1631. * @arg @ref LL_RCC_PLLM_DIV_4
  1632. * @arg @ref LL_RCC_PLLM_DIV_5
  1633. * @arg @ref LL_RCC_PLLM_DIV_6
  1634. * @arg @ref LL_RCC_PLLM_DIV_7
  1635. * @arg @ref LL_RCC_PLLM_DIV_8
  1636. * @arg @ref LL_RCC_PLLM_DIV_9
  1637. * @arg @ref LL_RCC_PLLM_DIV_10
  1638. * @arg @ref LL_RCC_PLLM_DIV_11
  1639. * @arg @ref LL_RCC_PLLM_DIV_12
  1640. * @arg @ref LL_RCC_PLLM_DIV_13
  1641. * @arg @ref LL_RCC_PLLM_DIV_14
  1642. * @arg @ref LL_RCC_PLLM_DIV_15
  1643. * @arg @ref LL_RCC_PLLM_DIV_16
  1644. * @arg @ref LL_RCC_PLLM_DIV_17
  1645. * @arg @ref LL_RCC_PLLM_DIV_18
  1646. * @arg @ref LL_RCC_PLLM_DIV_19
  1647. * @arg @ref LL_RCC_PLLM_DIV_20
  1648. * @arg @ref LL_RCC_PLLM_DIV_21
  1649. * @arg @ref LL_RCC_PLLM_DIV_22
  1650. * @arg @ref LL_RCC_PLLM_DIV_23
  1651. * @arg @ref LL_RCC_PLLM_DIV_24
  1652. * @arg @ref LL_RCC_PLLM_DIV_25
  1653. * @arg @ref LL_RCC_PLLM_DIV_26
  1654. * @arg @ref LL_RCC_PLLM_DIV_27
  1655. * @arg @ref LL_RCC_PLLM_DIV_28
  1656. * @arg @ref LL_RCC_PLLM_DIV_29
  1657. * @arg @ref LL_RCC_PLLM_DIV_30
  1658. * @arg @ref LL_RCC_PLLM_DIV_31
  1659. * @arg @ref LL_RCC_PLLM_DIV_32
  1660. * @arg @ref LL_RCC_PLLM_DIV_33
  1661. * @arg @ref LL_RCC_PLLM_DIV_34
  1662. * @arg @ref LL_RCC_PLLM_DIV_35
  1663. * @arg @ref LL_RCC_PLLM_DIV_36
  1664. * @arg @ref LL_RCC_PLLM_DIV_37
  1665. * @arg @ref LL_RCC_PLLM_DIV_38
  1666. * @arg @ref LL_RCC_PLLM_DIV_39
  1667. * @arg @ref LL_RCC_PLLM_DIV_40
  1668. * @arg @ref LL_RCC_PLLM_DIV_41
  1669. * @arg @ref LL_RCC_PLLM_DIV_42
  1670. * @arg @ref LL_RCC_PLLM_DIV_43
  1671. * @arg @ref LL_RCC_PLLM_DIV_44
  1672. * @arg @ref LL_RCC_PLLM_DIV_45
  1673. * @arg @ref LL_RCC_PLLM_DIV_46
  1674. * @arg @ref LL_RCC_PLLM_DIV_47
  1675. * @arg @ref LL_RCC_PLLM_DIV_48
  1676. * @arg @ref LL_RCC_PLLM_DIV_49
  1677. * @arg @ref LL_RCC_PLLM_DIV_50
  1678. * @arg @ref LL_RCC_PLLM_DIV_51
  1679. * @arg @ref LL_RCC_PLLM_DIV_52
  1680. * @arg @ref LL_RCC_PLLM_DIV_53
  1681. * @arg @ref LL_RCC_PLLM_DIV_54
  1682. * @arg @ref LL_RCC_PLLM_DIV_55
  1683. * @arg @ref LL_RCC_PLLM_DIV_56
  1684. * @arg @ref LL_RCC_PLLM_DIV_57
  1685. * @arg @ref LL_RCC_PLLM_DIV_58
  1686. * @arg @ref LL_RCC_PLLM_DIV_59
  1687. * @arg @ref LL_RCC_PLLM_DIV_60
  1688. * @arg @ref LL_RCC_PLLM_DIV_61
  1689. * @arg @ref LL_RCC_PLLM_DIV_62
  1690. * @arg @ref LL_RCC_PLLM_DIV_63
  1691. * @param __PLLI2SN__ Between 50 and 432
  1692. * @param __PLLI2SP__ This parameter can be one of the following values:
  1693. * @arg @ref LL_RCC_PLLI2SP_DIV_2
  1694. * @arg @ref LL_RCC_PLLI2SP_DIV_4
  1695. * @arg @ref LL_RCC_PLLI2SP_DIV_6
  1696. * @arg @ref LL_RCC_PLLI2SP_DIV_8
  1697. * @retval PLLI2S clock frequency (in Hz)
  1698. */
  1699. #define __LL_RCC_CALC_PLLI2S_SPDIFRX_FREQ(__INPUTFREQ__, __PLLM__, __PLLI2SN__, __PLLI2SP__) (((__INPUTFREQ__) / (__PLLM__)) * (__PLLI2SN__) / \
  1700. ((((__PLLI2SP__) >> RCC_PLLI2SCFGR_PLLI2SP_Pos) + 1U) * 2U))
  1701. #endif /* SPDIFRX */
  1702. /**
  1703. * @brief Helper macro to calculate the PLLI2S frequency used for I2S domain
  1704. * @note ex: @ref __LL_RCC_CALC_PLLI2S_I2S_FREQ (HSE_VALUE,@ref LL_RCC_PLL_GetDivider (),
  1705. * @ref LL_RCC_PLLI2S_GetN (), @ref LL_RCC_PLLI2S_GetR ());
  1706. * @param __INPUTFREQ__ PLL Input frequency (based on HSE/HSI)
  1707. * @param __PLLM__ This parameter can be one of the following values:
  1708. * @arg @ref LL_RCC_PLLM_DIV_2
  1709. * @arg @ref LL_RCC_PLLM_DIV_3
  1710. * @arg @ref LL_RCC_PLLM_DIV_4
  1711. * @arg @ref LL_RCC_PLLM_DIV_5
  1712. * @arg @ref LL_RCC_PLLM_DIV_6
  1713. * @arg @ref LL_RCC_PLLM_DIV_7
  1714. * @arg @ref LL_RCC_PLLM_DIV_8
  1715. * @arg @ref LL_RCC_PLLM_DIV_9
  1716. * @arg @ref LL_RCC_PLLM_DIV_10
  1717. * @arg @ref LL_RCC_PLLM_DIV_11
  1718. * @arg @ref LL_RCC_PLLM_DIV_12
  1719. * @arg @ref LL_RCC_PLLM_DIV_13
  1720. * @arg @ref LL_RCC_PLLM_DIV_14
  1721. * @arg @ref LL_RCC_PLLM_DIV_15
  1722. * @arg @ref LL_RCC_PLLM_DIV_16
  1723. * @arg @ref LL_RCC_PLLM_DIV_17
  1724. * @arg @ref LL_RCC_PLLM_DIV_18
  1725. * @arg @ref LL_RCC_PLLM_DIV_19
  1726. * @arg @ref LL_RCC_PLLM_DIV_20
  1727. * @arg @ref LL_RCC_PLLM_DIV_21
  1728. * @arg @ref LL_RCC_PLLM_DIV_22
  1729. * @arg @ref LL_RCC_PLLM_DIV_23
  1730. * @arg @ref LL_RCC_PLLM_DIV_24
  1731. * @arg @ref LL_RCC_PLLM_DIV_25
  1732. * @arg @ref LL_RCC_PLLM_DIV_26
  1733. * @arg @ref LL_RCC_PLLM_DIV_27
  1734. * @arg @ref LL_RCC_PLLM_DIV_28
  1735. * @arg @ref LL_RCC_PLLM_DIV_29
  1736. * @arg @ref LL_RCC_PLLM_DIV_30
  1737. * @arg @ref LL_RCC_PLLM_DIV_31
  1738. * @arg @ref LL_RCC_PLLM_DIV_32
  1739. * @arg @ref LL_RCC_PLLM_DIV_33
  1740. * @arg @ref LL_RCC_PLLM_DIV_34
  1741. * @arg @ref LL_RCC_PLLM_DIV_35
  1742. * @arg @ref LL_RCC_PLLM_DIV_36
  1743. * @arg @ref LL_RCC_PLLM_DIV_37
  1744. * @arg @ref LL_RCC_PLLM_DIV_38
  1745. * @arg @ref LL_RCC_PLLM_DIV_39
  1746. * @arg @ref LL_RCC_PLLM_DIV_40
  1747. * @arg @ref LL_RCC_PLLM_DIV_41
  1748. * @arg @ref LL_RCC_PLLM_DIV_42
  1749. * @arg @ref LL_RCC_PLLM_DIV_43
  1750. * @arg @ref LL_RCC_PLLM_DIV_44
  1751. * @arg @ref LL_RCC_PLLM_DIV_45
  1752. * @arg @ref LL_RCC_PLLM_DIV_46
  1753. * @arg @ref LL_RCC_PLLM_DIV_47
  1754. * @arg @ref LL_RCC_PLLM_DIV_48
  1755. * @arg @ref LL_RCC_PLLM_DIV_49
  1756. * @arg @ref LL_RCC_PLLM_DIV_50
  1757. * @arg @ref LL_RCC_PLLM_DIV_51
  1758. * @arg @ref LL_RCC_PLLM_DIV_52
  1759. * @arg @ref LL_RCC_PLLM_DIV_53
  1760. * @arg @ref LL_RCC_PLLM_DIV_54
  1761. * @arg @ref LL_RCC_PLLM_DIV_55
  1762. * @arg @ref LL_RCC_PLLM_DIV_56
  1763. * @arg @ref LL_RCC_PLLM_DIV_57
  1764. * @arg @ref LL_RCC_PLLM_DIV_58
  1765. * @arg @ref LL_RCC_PLLM_DIV_59
  1766. * @arg @ref LL_RCC_PLLM_DIV_60
  1767. * @arg @ref LL_RCC_PLLM_DIV_61
  1768. * @arg @ref LL_RCC_PLLM_DIV_62
  1769. * @arg @ref LL_RCC_PLLM_DIV_63
  1770. * @param __PLLI2SN__ Between 50 and 432
  1771. * @param __PLLI2SR__ This parameter can be one of the following values:
  1772. * @arg @ref LL_RCC_PLLI2SR_DIV_2
  1773. * @arg @ref LL_RCC_PLLI2SR_DIV_3
  1774. * @arg @ref LL_RCC_PLLI2SR_DIV_4
  1775. * @arg @ref LL_RCC_PLLI2SR_DIV_5
  1776. * @arg @ref LL_RCC_PLLI2SR_DIV_6
  1777. * @arg @ref LL_RCC_PLLI2SR_DIV_7
  1778. * @retval PLLI2S clock frequency (in Hz)
  1779. */
  1780. #define __LL_RCC_CALC_PLLI2S_I2S_FREQ(__INPUTFREQ__, __PLLM__, __PLLI2SN__, __PLLI2SR__) (((__INPUTFREQ__) / (__PLLM__)) * (__PLLI2SN__) / \
  1781. ((__PLLI2SR__) >> RCC_PLLI2SCFGR_PLLI2SR_Pos))
  1782. /**
  1783. * @brief Helper macro to calculate the HCLK frequency
  1784. * @param __SYSCLKFREQ__ SYSCLK frequency (based on HSE/HSI/PLLCLK)
  1785. * @param __AHBPRESCALER__ This parameter can be one of the following values:
  1786. * @arg @ref LL_RCC_SYSCLK_DIV_1
  1787. * @arg @ref LL_RCC_SYSCLK_DIV_2
  1788. * @arg @ref LL_RCC_SYSCLK_DIV_4
  1789. * @arg @ref LL_RCC_SYSCLK_DIV_8
  1790. * @arg @ref LL_RCC_SYSCLK_DIV_16
  1791. * @arg @ref LL_RCC_SYSCLK_DIV_64
  1792. * @arg @ref LL_RCC_SYSCLK_DIV_128
  1793. * @arg @ref LL_RCC_SYSCLK_DIV_256
  1794. * @arg @ref LL_RCC_SYSCLK_DIV_512
  1795. * @retval HCLK clock frequency (in Hz)
  1796. */
  1797. #define __LL_RCC_CALC_HCLK_FREQ(__SYSCLKFREQ__, __AHBPRESCALER__) ((__SYSCLKFREQ__) >> AHBPrescTable[((__AHBPRESCALER__) & RCC_CFGR_HPRE) >> RCC_CFGR_HPRE_Pos])
  1798. /**
  1799. * @brief Helper macro to calculate the PCLK1 frequency (ABP1)
  1800. * @param __HCLKFREQ__ HCLK frequency
  1801. * @param __APB1PRESCALER__ This parameter can be one of the following values:
  1802. * @arg @ref LL_RCC_APB1_DIV_1
  1803. * @arg @ref LL_RCC_APB1_DIV_2
  1804. * @arg @ref LL_RCC_APB1_DIV_4
  1805. * @arg @ref LL_RCC_APB1_DIV_8
  1806. * @arg @ref LL_RCC_APB1_DIV_16
  1807. * @retval PCLK1 clock frequency (in Hz)
  1808. */
  1809. #define __LL_RCC_CALC_PCLK1_FREQ(__HCLKFREQ__, __APB1PRESCALER__) ((__HCLKFREQ__) >> APBPrescTable[(__APB1PRESCALER__) >> RCC_CFGR_PPRE1_Pos])
  1810. /**
  1811. * @brief Helper macro to calculate the PCLK2 frequency (ABP2)
  1812. * @param __HCLKFREQ__ HCLK frequency
  1813. * @param __APB2PRESCALER__ This parameter can be one of the following values:
  1814. * @arg @ref LL_RCC_APB2_DIV_1
  1815. * @arg @ref LL_RCC_APB2_DIV_2
  1816. * @arg @ref LL_RCC_APB2_DIV_4
  1817. * @arg @ref LL_RCC_APB2_DIV_8
  1818. * @arg @ref LL_RCC_APB2_DIV_16
  1819. * @retval PCLK2 clock frequency (in Hz)
  1820. */
  1821. #define __LL_RCC_CALC_PCLK2_FREQ(__HCLKFREQ__, __APB2PRESCALER__) ((__HCLKFREQ__) >> APBPrescTable[(__APB2PRESCALER__) >> RCC_CFGR_PPRE2_Pos])
  1822. /**
  1823. * @}
  1824. */
  1825. /**
  1826. * @}
  1827. */
  1828. /* Exported functions --------------------------------------------------------*/
  1829. /** @defgroup RCC_LL_Exported_Functions RCC Exported Functions
  1830. * @{
  1831. */
  1832. /** @defgroup RCC_LL_EF_HSE HSE
  1833. * @{
  1834. */
  1835. /**
  1836. * @brief Enable the Clock Security System.
  1837. * @rmtoll CR CSSON LL_RCC_HSE_EnableCSS
  1838. * @retval None
  1839. */
  1840. __STATIC_INLINE void LL_RCC_HSE_EnableCSS(void)
  1841. {
  1842. SET_BIT(RCC->CR, RCC_CR_CSSON);
  1843. }
  1844. /**
  1845. * @brief Enable HSE external oscillator (HSE Bypass)
  1846. * @rmtoll CR HSEBYP LL_RCC_HSE_EnableBypass
  1847. * @retval None
  1848. */
  1849. __STATIC_INLINE void LL_RCC_HSE_EnableBypass(void)
  1850. {
  1851. SET_BIT(RCC->CR, RCC_CR_HSEBYP);
  1852. }
  1853. /**
  1854. * @brief Disable HSE external oscillator (HSE Bypass)
  1855. * @rmtoll CR HSEBYP LL_RCC_HSE_DisableBypass
  1856. * @retval None
  1857. */
  1858. __STATIC_INLINE void LL_RCC_HSE_DisableBypass(void)
  1859. {
  1860. CLEAR_BIT(RCC->CR, RCC_CR_HSEBYP);
  1861. }
  1862. /**
  1863. * @brief Enable HSE crystal oscillator (HSE ON)
  1864. * @rmtoll CR HSEON LL_RCC_HSE_Enable
  1865. * @retval None
  1866. */
  1867. __STATIC_INLINE void LL_RCC_HSE_Enable(void)
  1868. {
  1869. SET_BIT(RCC->CR, RCC_CR_HSEON);
  1870. }
  1871. /**
  1872. * @brief Disable HSE crystal oscillator (HSE ON)
  1873. * @rmtoll CR HSEON LL_RCC_HSE_Disable
  1874. * @retval None
  1875. */
  1876. __STATIC_INLINE void LL_RCC_HSE_Disable(void)
  1877. {
  1878. CLEAR_BIT(RCC->CR, RCC_CR_HSEON);
  1879. }
  1880. /**
  1881. * @brief Check if HSE oscillator Ready
  1882. * @rmtoll CR HSERDY LL_RCC_HSE_IsReady
  1883. * @retval State of bit (1 or 0).
  1884. */
  1885. __STATIC_INLINE uint32_t LL_RCC_HSE_IsReady(void)
  1886. {
  1887. return (READ_BIT(RCC->CR, RCC_CR_HSERDY) == (RCC_CR_HSERDY));
  1888. }
  1889. /**
  1890. * @}
  1891. */
  1892. /** @defgroup RCC_LL_EF_HSI HSI
  1893. * @{
  1894. */
  1895. /**
  1896. * @brief Enable HSI oscillator
  1897. * @rmtoll CR HSION LL_RCC_HSI_Enable
  1898. * @retval None
  1899. */
  1900. __STATIC_INLINE void LL_RCC_HSI_Enable(void)
  1901. {
  1902. SET_BIT(RCC->CR, RCC_CR_HSION);
  1903. }
  1904. /**
  1905. * @brief Disable HSI oscillator
  1906. * @rmtoll CR HSION LL_RCC_HSI_Disable
  1907. * @retval None
  1908. */
  1909. __STATIC_INLINE void LL_RCC_HSI_Disable(void)
  1910. {
  1911. CLEAR_BIT(RCC->CR, RCC_CR_HSION);
  1912. }
  1913. /**
  1914. * @brief Check if HSI clock is ready
  1915. * @rmtoll CR HSIRDY LL_RCC_HSI_IsReady
  1916. * @retval State of bit (1 or 0).
  1917. */
  1918. __STATIC_INLINE uint32_t LL_RCC_HSI_IsReady(void)
  1919. {
  1920. return (READ_BIT(RCC->CR, RCC_CR_HSIRDY) == (RCC_CR_HSIRDY));
  1921. }
  1922. /**
  1923. * @brief Get HSI Calibration value
  1924. * @note When HSITRIM is written, HSICAL is updated with the sum of
  1925. * HSITRIM and the factory trim value
  1926. * @rmtoll CR HSICAL LL_RCC_HSI_GetCalibration
  1927. * @retval Between Min_Data = 0x00 and Max_Data = 0xFF
  1928. */
  1929. __STATIC_INLINE uint32_t LL_RCC_HSI_GetCalibration(void)
  1930. {
  1931. return (uint32_t)(READ_BIT(RCC->CR, RCC_CR_HSICAL) >> RCC_CR_HSICAL_Pos);
  1932. }
  1933. /**
  1934. * @brief Set HSI Calibration trimming
  1935. * @note user-programmable trimming value that is added to the HSICAL
  1936. * @note Default value is 16, which, when added to the HSICAL value,
  1937. * should trim the HSI to 16 MHz +/- 1 %
  1938. * @rmtoll CR HSITRIM LL_RCC_HSI_SetCalibTrimming
  1939. * @param Value Between Min_Data = 0 and Max_Data = 31
  1940. * @retval None
  1941. */
  1942. __STATIC_INLINE void LL_RCC_HSI_SetCalibTrimming(uint32_t Value)
  1943. {
  1944. MODIFY_REG(RCC->CR, RCC_CR_HSITRIM, Value << RCC_CR_HSITRIM_Pos);
  1945. }
  1946. /**
  1947. * @brief Get HSI Calibration trimming
  1948. * @rmtoll CR HSITRIM LL_RCC_HSI_GetCalibTrimming
  1949. * @retval Between Min_Data = 0 and Max_Data = 31
  1950. */
  1951. __STATIC_INLINE uint32_t LL_RCC_HSI_GetCalibTrimming(void)
  1952. {
  1953. return (uint32_t)(READ_BIT(RCC->CR, RCC_CR_HSITRIM) >> RCC_CR_HSITRIM_Pos);
  1954. }
  1955. /**
  1956. * @}
  1957. */
  1958. /** @defgroup RCC_LL_EF_LSE LSE
  1959. * @{
  1960. */
  1961. /**
  1962. * @brief Enable Low Speed External (LSE) crystal.
  1963. * @rmtoll BDCR LSEON LL_RCC_LSE_Enable
  1964. * @retval None
  1965. */
  1966. __STATIC_INLINE void LL_RCC_LSE_Enable(void)
  1967. {
  1968. SET_BIT(RCC->BDCR, RCC_BDCR_LSEON);
  1969. }
  1970. /**
  1971. * @brief Disable Low Speed External (LSE) crystal.
  1972. * @rmtoll BDCR LSEON LL_RCC_LSE_Disable
  1973. * @retval None
  1974. */
  1975. __STATIC_INLINE void LL_RCC_LSE_Disable(void)
  1976. {
  1977. CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEON);
  1978. }
  1979. /**
  1980. * @brief Enable external clock source (LSE bypass).
  1981. * @rmtoll BDCR LSEBYP LL_RCC_LSE_EnableBypass
  1982. * @retval None
  1983. */
  1984. __STATIC_INLINE void LL_RCC_LSE_EnableBypass(void)
  1985. {
  1986. SET_BIT(RCC->BDCR, RCC_BDCR_LSEBYP);
  1987. }
  1988. /**
  1989. * @brief Disable external clock source (LSE bypass).
  1990. * @rmtoll BDCR LSEBYP LL_RCC_LSE_DisableBypass
  1991. * @retval None
  1992. */
  1993. __STATIC_INLINE void LL_RCC_LSE_DisableBypass(void)
  1994. {
  1995. CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEBYP);
  1996. }
  1997. /**
  1998. * @brief Set LSE oscillator drive capability
  1999. * @note The oscillator is in Xtal mode when it is not in bypass mode.
  2000. * @rmtoll BDCR LSEDRV LL_RCC_LSE_SetDriveCapability
  2001. * @param LSEDrive This parameter can be one of the following values:
  2002. * @arg @ref LL_RCC_LSEDRIVE_LOW
  2003. * @arg @ref LL_RCC_LSEDRIVE_MEDIUMHIGH
  2004. * @arg @ref LL_RCC_LSEDRIVE_MEDIUMLOW
  2005. * @arg @ref LL_RCC_LSEDRIVE_HIGH
  2006. * @retval None
  2007. */
  2008. __STATIC_INLINE void LL_RCC_LSE_SetDriveCapability(uint32_t LSEDrive)
  2009. {
  2010. MODIFY_REG(RCC->BDCR, RCC_BDCR_LSEDRV, LSEDrive);
  2011. }
  2012. /**
  2013. * @brief Get LSE oscillator drive capability
  2014. * @rmtoll BDCR LSEDRV LL_RCC_LSE_GetDriveCapability
  2015. * @retval Returned value can be one of the following values:
  2016. * @arg @ref LL_RCC_LSEDRIVE_LOW
  2017. * @arg @ref LL_RCC_LSEDRIVE_MEDIUMHIGH
  2018. * @arg @ref LL_RCC_LSEDRIVE_MEDIUMLOW
  2019. * @arg @ref LL_RCC_LSEDRIVE_HIGH
  2020. */
  2021. __STATIC_INLINE uint32_t LL_RCC_LSE_GetDriveCapability(void)
  2022. {
  2023. return (uint32_t)(READ_BIT(RCC->BDCR, RCC_BDCR_LSEDRV));
  2024. }
  2025. /**
  2026. * @brief Check if LSE oscillator Ready
  2027. * @rmtoll BDCR LSERDY LL_RCC_LSE_IsReady
  2028. * @retval State of bit (1 or 0).
  2029. */
  2030. __STATIC_INLINE uint32_t LL_RCC_LSE_IsReady(void)
  2031. {
  2032. return (READ_BIT(RCC->BDCR, RCC_BDCR_LSERDY) == (RCC_BDCR_LSERDY));
  2033. }
  2034. /**
  2035. * @}
  2036. */
  2037. /** @defgroup RCC_LL_EF_LSI LSI
  2038. * @{
  2039. */
  2040. /**
  2041. * @brief Enable LSI Oscillator
  2042. * @rmtoll CSR LSION LL_RCC_LSI_Enable
  2043. * @retval None
  2044. */
  2045. __STATIC_INLINE void LL_RCC_LSI_Enable(void)
  2046. {
  2047. SET_BIT(RCC->CSR, RCC_CSR_LSION);
  2048. }
  2049. /**
  2050. * @brief Disable LSI Oscillator
  2051. * @rmtoll CSR LSION LL_RCC_LSI_Disable
  2052. * @retval None
  2053. */
  2054. __STATIC_INLINE void LL_RCC_LSI_Disable(void)
  2055. {
  2056. CLEAR_BIT(RCC->CSR, RCC_CSR_LSION);
  2057. }
  2058. /**
  2059. * @brief Check if LSI is Ready
  2060. * @rmtoll CSR LSIRDY LL_RCC_LSI_IsReady
  2061. * @retval State of bit (1 or 0).
  2062. */
  2063. __STATIC_INLINE uint32_t LL_RCC_LSI_IsReady(void)
  2064. {
  2065. return (READ_BIT(RCC->CSR, RCC_CSR_LSIRDY) == (RCC_CSR_LSIRDY));
  2066. }
  2067. /**
  2068. * @}
  2069. */
  2070. /** @defgroup RCC_LL_EF_System System
  2071. * @{
  2072. */
  2073. /**
  2074. * @brief Configure the system clock source
  2075. * @rmtoll CFGR SW LL_RCC_SetSysClkSource
  2076. * @param Source This parameter can be one of the following values:
  2077. * @arg @ref LL_RCC_SYS_CLKSOURCE_HSI
  2078. * @arg @ref LL_RCC_SYS_CLKSOURCE_HSE
  2079. * @arg @ref LL_RCC_SYS_CLKSOURCE_PLL
  2080. * @retval None
  2081. */
  2082. __STATIC_INLINE void LL_RCC_SetSysClkSource(uint32_t Source)
  2083. {
  2084. MODIFY_REG(RCC->CFGR, RCC_CFGR_SW, Source);
  2085. }
  2086. /**
  2087. * @brief Get the system clock source
  2088. * @rmtoll CFGR SWS LL_RCC_GetSysClkSource
  2089. * @retval Returned value can be one of the following values:
  2090. * @arg @ref LL_RCC_SYS_CLKSOURCE_STATUS_HSI
  2091. * @arg @ref LL_RCC_SYS_CLKSOURCE_STATUS_HSE
  2092. * @arg @ref LL_RCC_SYS_CLKSOURCE_STATUS_PLL
  2093. */
  2094. __STATIC_INLINE uint32_t LL_RCC_GetSysClkSource(void)
  2095. {
  2096. return (uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_SWS));
  2097. }
  2098. /**
  2099. * @brief Set AHB prescaler
  2100. * @rmtoll CFGR HPRE LL_RCC_SetAHBPrescaler
  2101. * @param Prescaler This parameter can be one of the following values:
  2102. * @arg @ref LL_RCC_SYSCLK_DIV_1
  2103. * @arg @ref LL_RCC_SYSCLK_DIV_2
  2104. * @arg @ref LL_RCC_SYSCLK_DIV_4
  2105. * @arg @ref LL_RCC_SYSCLK_DIV_8
  2106. * @arg @ref LL_RCC_SYSCLK_DIV_16
  2107. * @arg @ref LL_RCC_SYSCLK_DIV_64
  2108. * @arg @ref LL_RCC_SYSCLK_DIV_128
  2109. * @arg @ref LL_RCC_SYSCLK_DIV_256
  2110. * @arg @ref LL_RCC_SYSCLK_DIV_512
  2111. * @retval None
  2112. */
  2113. __STATIC_INLINE void LL_RCC_SetAHBPrescaler(uint32_t Prescaler)
  2114. {
  2115. MODIFY_REG(RCC->CFGR, RCC_CFGR_HPRE, Prescaler);
  2116. }
  2117. /**
  2118. * @brief Set APB1 prescaler
  2119. * @rmtoll CFGR PPRE1 LL_RCC_SetAPB1Prescaler
  2120. * @param Prescaler This parameter can be one of the following values:
  2121. * @arg @ref LL_RCC_APB1_DIV_1
  2122. * @arg @ref LL_RCC_APB1_DIV_2
  2123. * @arg @ref LL_RCC_APB1_DIV_4
  2124. * @arg @ref LL_RCC_APB1_DIV_8
  2125. * @arg @ref LL_RCC_APB1_DIV_16
  2126. * @retval None
  2127. */
  2128. __STATIC_INLINE void LL_RCC_SetAPB1Prescaler(uint32_t Prescaler)
  2129. {
  2130. MODIFY_REG(RCC->CFGR, RCC_CFGR_PPRE1, Prescaler);
  2131. }
  2132. /**
  2133. * @brief Set APB2 prescaler
  2134. * @rmtoll CFGR PPRE2 LL_RCC_SetAPB2Prescaler
  2135. * @param Prescaler This parameter can be one of the following values:
  2136. * @arg @ref LL_RCC_APB2_DIV_1
  2137. * @arg @ref LL_RCC_APB2_DIV_2
  2138. * @arg @ref LL_RCC_APB2_DIV_4
  2139. * @arg @ref LL_RCC_APB2_DIV_8
  2140. * @arg @ref LL_RCC_APB2_DIV_16
  2141. * @retval None
  2142. */
  2143. __STATIC_INLINE void LL_RCC_SetAPB2Prescaler(uint32_t Prescaler)
  2144. {
  2145. MODIFY_REG(RCC->CFGR, RCC_CFGR_PPRE2, Prescaler);
  2146. }
  2147. /**
  2148. * @brief Get AHB prescaler
  2149. * @rmtoll CFGR HPRE LL_RCC_GetAHBPrescaler
  2150. * @retval Returned value can be one of the following values:
  2151. * @arg @ref LL_RCC_SYSCLK_DIV_1
  2152. * @arg @ref LL_RCC_SYSCLK_DIV_2
  2153. * @arg @ref LL_RCC_SYSCLK_DIV_4
  2154. * @arg @ref LL_RCC_SYSCLK_DIV_8
  2155. * @arg @ref LL_RCC_SYSCLK_DIV_16
  2156. * @arg @ref LL_RCC_SYSCLK_DIV_64
  2157. * @arg @ref LL_RCC_SYSCLK_DIV_128
  2158. * @arg @ref LL_RCC_SYSCLK_DIV_256
  2159. * @arg @ref LL_RCC_SYSCLK_DIV_512
  2160. */
  2161. __STATIC_INLINE uint32_t LL_RCC_GetAHBPrescaler(void)
  2162. {
  2163. return (uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_HPRE));
  2164. }
  2165. /**
  2166. * @brief Get APB1 prescaler
  2167. * @rmtoll CFGR PPRE1 LL_RCC_GetAPB1Prescaler
  2168. * @retval Returned value can be one of the following values:
  2169. * @arg @ref LL_RCC_APB1_DIV_1
  2170. * @arg @ref LL_RCC_APB1_DIV_2
  2171. * @arg @ref LL_RCC_APB1_DIV_4
  2172. * @arg @ref LL_RCC_APB1_DIV_8
  2173. * @arg @ref LL_RCC_APB1_DIV_16
  2174. */
  2175. __STATIC_INLINE uint32_t LL_RCC_GetAPB1Prescaler(void)
  2176. {
  2177. return (uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_PPRE1));
  2178. }
  2179. /**
  2180. * @brief Get APB2 prescaler
  2181. * @rmtoll CFGR PPRE2 LL_RCC_GetAPB2Prescaler
  2182. * @retval Returned value can be one of the following values:
  2183. * @arg @ref LL_RCC_APB2_DIV_1
  2184. * @arg @ref LL_RCC_APB2_DIV_2
  2185. * @arg @ref LL_RCC_APB2_DIV_4
  2186. * @arg @ref LL_RCC_APB2_DIV_8
  2187. * @arg @ref LL_RCC_APB2_DIV_16
  2188. */
  2189. __STATIC_INLINE uint32_t LL_RCC_GetAPB2Prescaler(void)
  2190. {
  2191. return (uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_PPRE2));
  2192. }
  2193. /**
  2194. * @}
  2195. */
  2196. /** @defgroup RCC_LL_EF_MCO MCO
  2197. * @{
  2198. */
  2199. /**
  2200. * @brief Configure MCOx
  2201. * @rmtoll CFGR MCO1 LL_RCC_ConfigMCO\n
  2202. * CFGR MCO1PRE LL_RCC_ConfigMCO\n
  2203. * CFGR MCO2 LL_RCC_ConfigMCO\n
  2204. * CFGR MCO2PRE LL_RCC_ConfigMCO
  2205. * @param MCOxSource This parameter can be one of the following values:
  2206. * @arg @ref LL_RCC_MCO1SOURCE_HSI
  2207. * @arg @ref LL_RCC_MCO1SOURCE_LSE
  2208. * @arg @ref LL_RCC_MCO1SOURCE_HSE
  2209. * @arg @ref LL_RCC_MCO1SOURCE_PLLCLK
  2210. * @arg @ref LL_RCC_MCO2SOURCE_SYSCLK
  2211. * @arg @ref LL_RCC_MCO2SOURCE_PLLI2S
  2212. * @arg @ref LL_RCC_MCO2SOURCE_HSE
  2213. * @arg @ref LL_RCC_MCO2SOURCE_PLLCLK
  2214. * @param MCOxPrescaler This parameter can be one of the following values:
  2215. * @arg @ref LL_RCC_MCO1_DIV_1
  2216. * @arg @ref LL_RCC_MCO1_DIV_2
  2217. * @arg @ref LL_RCC_MCO1_DIV_3
  2218. * @arg @ref LL_RCC_MCO1_DIV_4
  2219. * @arg @ref LL_RCC_MCO1_DIV_5
  2220. * @arg @ref LL_RCC_MCO2_DIV_1
  2221. * @arg @ref LL_RCC_MCO2_DIV_2
  2222. * @arg @ref LL_RCC_MCO2_DIV_3
  2223. * @arg @ref LL_RCC_MCO2_DIV_4
  2224. * @arg @ref LL_RCC_MCO2_DIV_5
  2225. * @retval None
  2226. */
  2227. __STATIC_INLINE void LL_RCC_ConfigMCO(uint32_t MCOxSource, uint32_t MCOxPrescaler)
  2228. {
  2229. MODIFY_REG(RCC->CFGR, (MCOxSource & 0xFFFF0000U) | (MCOxPrescaler & 0xFFFF0000U), (MCOxSource << 16U) | (MCOxPrescaler << 16U));
  2230. }
  2231. /**
  2232. * @}
  2233. */
  2234. /** @defgroup RCC_LL_EF_Peripheral_Clock_Source Peripheral Clock Source
  2235. * @{
  2236. */
  2237. /**
  2238. * @brief Configure USARTx clock source
  2239. * @rmtoll DCKCFGR2 USART1SEL LL_RCC_SetUSARTClockSource\n
  2240. * DCKCFGR2 USART2SEL LL_RCC_SetUSARTClockSource\n
  2241. * DCKCFGR2 USART3SEL LL_RCC_SetUSARTClockSource\n
  2242. * DCKCFGR2 USART6SEL LL_RCC_SetUSARTClockSource
  2243. * @param USARTxSource This parameter can be one of the following values:
  2244. * @arg @ref LL_RCC_USART1_CLKSOURCE_PCLK2
  2245. * @arg @ref LL_RCC_USART1_CLKSOURCE_SYSCLK
  2246. * @arg @ref LL_RCC_USART1_CLKSOURCE_HSI
  2247. * @arg @ref LL_RCC_USART1_CLKSOURCE_LSE
  2248. * @arg @ref LL_RCC_USART2_CLKSOURCE_PCLK1
  2249. * @arg @ref LL_RCC_USART2_CLKSOURCE_SYSCLK
  2250. * @arg @ref LL_RCC_USART2_CLKSOURCE_HSI
  2251. * @arg @ref LL_RCC_USART2_CLKSOURCE_LSE
  2252. * @arg @ref LL_RCC_USART3_CLKSOURCE_PCLK1
  2253. * @arg @ref LL_RCC_USART3_CLKSOURCE_SYSCLK
  2254. * @arg @ref LL_RCC_USART3_CLKSOURCE_HSI
  2255. * @arg @ref LL_RCC_USART3_CLKSOURCE_LSE
  2256. * @arg @ref LL_RCC_USART6_CLKSOURCE_PCLK2
  2257. * @arg @ref LL_RCC_USART6_CLKSOURCE_SYSCLK
  2258. * @arg @ref LL_RCC_USART6_CLKSOURCE_HSI
  2259. * @arg @ref LL_RCC_USART6_CLKSOURCE_LSE
  2260. * @retval None
  2261. */
  2262. __STATIC_INLINE void LL_RCC_SetUSARTClockSource(uint32_t USARTxSource)
  2263. {
  2264. MODIFY_REG(RCC->DCKCFGR2, (USARTxSource >> 16U), (USARTxSource & 0x0000FFFFU));
  2265. }
  2266. /**
  2267. * @brief Configure UARTx clock source
  2268. * @rmtoll DCKCFGR2 UART4SEL LL_RCC_SetUARTClockSource\n
  2269. * DCKCFGR2 UART5SEL LL_RCC_SetUARTClockSource\n
  2270. * DCKCFGR2 UART7SEL LL_RCC_SetUARTClockSource\n
  2271. * DCKCFGR2 UART8SEL LL_RCC_SetUARTClockSource
  2272. * @param UARTxSource This parameter can be one of the following values:
  2273. * @arg @ref LL_RCC_UART4_CLKSOURCE_PCLK1
  2274. * @arg @ref LL_RCC_UART4_CLKSOURCE_SYSCLK
  2275. * @arg @ref LL_RCC_UART4_CLKSOURCE_HSI
  2276. * @arg @ref LL_RCC_UART4_CLKSOURCE_LSE
  2277. * @arg @ref LL_RCC_UART5_CLKSOURCE_PCLK1
  2278. * @arg @ref LL_RCC_UART5_CLKSOURCE_SYSCLK
  2279. * @arg @ref LL_RCC_UART5_CLKSOURCE_HSI
  2280. * @arg @ref LL_RCC_UART5_CLKSOURCE_LSE
  2281. * @arg @ref LL_RCC_UART7_CLKSOURCE_PCLK1
  2282. * @arg @ref LL_RCC_UART7_CLKSOURCE_SYSCLK
  2283. * @arg @ref LL_RCC_UART7_CLKSOURCE_HSI
  2284. * @arg @ref LL_RCC_UART7_CLKSOURCE_LSE
  2285. * @arg @ref LL_RCC_UART8_CLKSOURCE_PCLK1
  2286. * @arg @ref LL_RCC_UART8_CLKSOURCE_SYSCLK
  2287. * @arg @ref LL_RCC_UART8_CLKSOURCE_HSI
  2288. * @arg @ref LL_RCC_UART8_CLKSOURCE_LSE
  2289. * @retval None
  2290. */
  2291. __STATIC_INLINE void LL_RCC_SetUARTClockSource(uint32_t UARTxSource)
  2292. {
  2293. MODIFY_REG(RCC->DCKCFGR2, (UARTxSource >> 16U), (UARTxSource & 0x0000FFFFU));
  2294. }
  2295. /**
  2296. * @brief Configure I2Cx clock source
  2297. * @rmtoll DCKCFGR2 I2C1SEL LL_RCC_SetI2CClockSource\n
  2298. * DCKCFGR2 I2C2SEL LL_RCC_SetI2CClockSource\n
  2299. * DCKCFGR2 I2C3SEL LL_RCC_SetI2CClockSource\n
  2300. * DCKCFGR2 I2C4SEL LL_RCC_SetI2CClockSource
  2301. * @param I2CxSource This parameter can be one of the following values:
  2302. * @arg @ref LL_RCC_I2C1_CLKSOURCE_PCLK1
  2303. * @arg @ref LL_RCC_I2C1_CLKSOURCE_SYSCLK
  2304. * @arg @ref LL_RCC_I2C1_CLKSOURCE_HSI
  2305. * @arg @ref LL_RCC_I2C2_CLKSOURCE_PCLK1
  2306. * @arg @ref LL_RCC_I2C2_CLKSOURCE_SYSCLK
  2307. * @arg @ref LL_RCC_I2C2_CLKSOURCE_HSI
  2308. * @arg @ref LL_RCC_I2C3_CLKSOURCE_PCLK1
  2309. * @arg @ref LL_RCC_I2C3_CLKSOURCE_SYSCLK
  2310. * @arg @ref LL_RCC_I2C3_CLKSOURCE_HSI
  2311. * @arg @ref LL_RCC_I2C4_CLKSOURCE_PCLK1 (*)
  2312. * @arg @ref LL_RCC_I2C4_CLKSOURCE_SYSCLK (*)
  2313. * @arg @ref LL_RCC_I2C4_CLKSOURCE_HSI (*)
  2314. *
  2315. * (*) value not defined in all devices.
  2316. * @retval None
  2317. */
  2318. __STATIC_INLINE void LL_RCC_SetI2CClockSource(uint32_t I2CxSource)
  2319. {
  2320. MODIFY_REG(RCC->DCKCFGR2, (I2CxSource & 0xFFFF0000U), (I2CxSource << 16U));
  2321. }
  2322. /**
  2323. * @brief Configure LPTIMx clock source
  2324. * @rmtoll DCKCFGR2 LPTIM1SEL LL_RCC_SetLPTIMClockSource
  2325. * @param LPTIMxSource This parameter can be one of the following values:
  2326. * @arg @ref LL_RCC_LPTIM1_CLKSOURCE_PCLK1
  2327. * @arg @ref LL_RCC_LPTIM1_CLKSOURCE_LSI
  2328. * @arg @ref LL_RCC_LPTIM1_CLKSOURCE_HSI
  2329. * @arg @ref LL_RCC_LPTIM1_CLKSOURCE_LSE
  2330. * @retval None
  2331. */
  2332. __STATIC_INLINE void LL_RCC_SetLPTIMClockSource(uint32_t LPTIMxSource)
  2333. {
  2334. MODIFY_REG(RCC->DCKCFGR2, RCC_DCKCFGR2_LPTIM1SEL, LPTIMxSource);
  2335. }
  2336. /**
  2337. * @brief Configure SAIx clock source
  2338. * @rmtoll DCKCFGR1 SAI1SEL LL_RCC_SetSAIClockSource\n
  2339. * DCKCFGR1 SAI2SEL LL_RCC_SetSAIClockSource
  2340. * @param SAIxSource This parameter can be one of the following values:
  2341. * @arg @ref LL_RCC_SAI1_CLKSOURCE_PLLSAI
  2342. * @arg @ref LL_RCC_SAI1_CLKSOURCE_PLLI2S
  2343. * @arg @ref LL_RCC_SAI1_CLKSOURCE_PIN
  2344. * @arg @ref LL_RCC_SAI1_CLKSOURCE_PLLSRC (*)
  2345. * @arg @ref LL_RCC_SAI2_CLKSOURCE_PLLSAI
  2346. * @arg @ref LL_RCC_SAI2_CLKSOURCE_PLLI2S
  2347. * @arg @ref LL_RCC_SAI2_CLKSOURCE_PIN
  2348. * @arg @ref LL_RCC_SAI2_CLKSOURCE_PLLSRC (*)
  2349. *
  2350. * (*) value not defined in all devices.
  2351. * @retval None
  2352. */
  2353. __STATIC_INLINE void LL_RCC_SetSAIClockSource(uint32_t SAIxSource)
  2354. {
  2355. MODIFY_REG(RCC->DCKCFGR1, (SAIxSource & 0xFFFF0000U), (SAIxSource << 16U));
  2356. }
  2357. /**
  2358. * @brief Configure SDMMC clock source
  2359. * @rmtoll DCKCFGR2 SDMMC1SEL LL_RCC_SetSDMMCClockSource\n
  2360. * DCKCFGR2 SDMMC2SEL LL_RCC_SetSDMMCClockSource
  2361. * @param SDMMCxSource This parameter can be one of the following values:
  2362. * @arg @ref LL_RCC_SDMMC1_CLKSOURCE_PLL48CLK
  2363. * @arg @ref LL_RCC_SDMMC1_CLKSOURCE_SYSCLK
  2364. * @arg @ref LL_RCC_SDMMC2_CLKSOURCE_PLL48CLK (*)
  2365. * @arg @ref LL_RCC_SDMMC2_CLKSOURCE_SYSCLK (*)
  2366. *
  2367. * (*) value not defined in all devices.
  2368. * @retval None
  2369. */
  2370. __STATIC_INLINE void LL_RCC_SetSDMMCClockSource(uint32_t SDMMCxSource)
  2371. {
  2372. MODIFY_REG(RCC->DCKCFGR2, (SDMMCxSource & 0xFFFF0000U), (SDMMCxSource << 16U));
  2373. }
  2374. /**
  2375. * @brief Configure 48Mhz domain clock source
  2376. * @rmtoll DCKCFGR2 CK48MSEL LL_RCC_SetCK48MClockSource
  2377. * @param CK48MxSource This parameter can be one of the following values:
  2378. * @arg @ref LL_RCC_CK48M_CLKSOURCE_PLL
  2379. * @arg @ref LL_RCC_CK48M_CLKSOURCE_PLLSAI
  2380. * @retval None
  2381. */
  2382. __STATIC_INLINE void LL_RCC_SetCK48MClockSource(uint32_t CK48MxSource)
  2383. {
  2384. MODIFY_REG(RCC->DCKCFGR2, RCC_DCKCFGR2_CK48MSEL, CK48MxSource);
  2385. }
  2386. /**
  2387. * @brief Configure RNG clock source
  2388. * @rmtoll DCKCFGR2 CK48MSEL LL_RCC_SetRNGClockSource
  2389. * @param RNGxSource This parameter can be one of the following values:
  2390. * @arg @ref LL_RCC_RNG_CLKSOURCE_PLL
  2391. * @arg @ref LL_RCC_RNG_CLKSOURCE_PLLSAI
  2392. * @retval None
  2393. */
  2394. __STATIC_INLINE void LL_RCC_SetRNGClockSource(uint32_t RNGxSource)
  2395. {
  2396. MODIFY_REG(RCC->DCKCFGR2, RCC_DCKCFGR2_CK48MSEL, RNGxSource);
  2397. }
  2398. /**
  2399. * @brief Configure USB clock source
  2400. * @rmtoll DCKCFGR2 CK48MSEL LL_RCC_SetUSBClockSource
  2401. * @param USBxSource This parameter can be one of the following values:
  2402. * @arg @ref LL_RCC_USB_CLKSOURCE_PLL
  2403. * @arg @ref LL_RCC_USB_CLKSOURCE_PLLSAI
  2404. * @retval None
  2405. */
  2406. __STATIC_INLINE void LL_RCC_SetUSBClockSource(uint32_t USBxSource)
  2407. {
  2408. MODIFY_REG(RCC->DCKCFGR2, RCC_DCKCFGR2_CK48MSEL, USBxSource);
  2409. }
  2410. #if defined(CEC)
  2411. /**
  2412. * @brief Configure CEC clock source
  2413. * @rmtoll DCKCFGR2 CECSEL LL_RCC_SetCECClockSource
  2414. * @param Source This parameter can be one of the following values:
  2415. * @arg @ref LL_RCC_CEC_CLKSOURCE_LSE
  2416. * @arg @ref LL_RCC_CEC_CLKSOURCE_HSI_DIV488
  2417. * @retval None
  2418. */
  2419. __STATIC_INLINE void LL_RCC_SetCECClockSource(uint32_t Source)
  2420. {
  2421. MODIFY_REG(RCC->DCKCFGR2, RCC_DCKCFGR2_CECSEL, Source);
  2422. }
  2423. #endif /* CEC */
  2424. /**
  2425. * @brief Configure I2S clock source
  2426. * @rmtoll CFGR I2SSRC LL_RCC_SetI2SClockSource
  2427. * @param Source This parameter can be one of the following values:
  2428. * @arg @ref LL_RCC_I2S1_CLKSOURCE_PLLI2S
  2429. * @arg @ref LL_RCC_I2S1_CLKSOURCE_PIN
  2430. * @retval None
  2431. */
  2432. __STATIC_INLINE void LL_RCC_SetI2SClockSource(uint32_t Source)
  2433. {
  2434. MODIFY_REG(RCC->CFGR, RCC_CFGR_I2SSRC, Source);
  2435. }
  2436. #if defined(DSI)
  2437. /**
  2438. * @brief Configure DSI clock source
  2439. * @rmtoll DCKCFGR2 DSISEL LL_RCC_SetDSIClockSource
  2440. * @param Source This parameter can be one of the following values:
  2441. * @arg @ref LL_RCC_DSI_CLKSOURCE_PHY
  2442. * @arg @ref LL_RCC_DSI_CLKSOURCE_PLL
  2443. * @retval None
  2444. */
  2445. __STATIC_INLINE void LL_RCC_SetDSIClockSource(uint32_t Source)
  2446. {
  2447. MODIFY_REG(RCC->DCKCFGR2, RCC_DCKCFGR2_DSISEL, Source);
  2448. }
  2449. #endif /* DSI */
  2450. #if defined(DFSDM1_Channel0)
  2451. /**
  2452. * @brief Configure DFSDM Audio clock source
  2453. * @rmtoll DCKCFGR1 ADFSDM1SEL LL_RCC_SetDFSDMAudioClockSource
  2454. * @param Source This parameter can be one of the following values:
  2455. * @arg @ref LL_RCC_DFSDM1_AUDIO_CLKSOURCE_SAI1
  2456. * @arg @ref LL_RCC_DFSDM1_AUDIO_CLKSOURCE_SAI2
  2457. * @retval None
  2458. */
  2459. __STATIC_INLINE void LL_RCC_SetDFSDMAudioClockSource(uint32_t Source)
  2460. {
  2461. MODIFY_REG(RCC->DCKCFGR1, RCC_DCKCFGR1_ADFSDM1SEL, Source);
  2462. }
  2463. /**
  2464. * @brief Configure DFSDM Kernel clock source
  2465. * @rmtoll DCKCFGR1 DFSDM1SEL LL_RCC_SetDFSDMClockSource
  2466. * @param Source This parameter can be one of the following values:
  2467. * @arg @ref LL_RCC_DFSDM1_CLKSOURCE_PCLK2
  2468. * @arg @ref LL_RCC_DFSDM1_CLKSOURCE_SYSCLK
  2469. * @retval None
  2470. */
  2471. __STATIC_INLINE void LL_RCC_SetDFSDMClockSource(uint32_t Source)
  2472. {
  2473. MODIFY_REG(RCC->DCKCFGR1, RCC_DCKCFGR1_DFSDM1SEL, Source);
  2474. }
  2475. #endif /* DFSDM1_Channel0 */
  2476. /**
  2477. * @brief Get USARTx clock source
  2478. * @rmtoll DCKCFGR2 USART1SEL LL_RCC_GetUSARTClockSource\n
  2479. * DCKCFGR2 USART2SEL LL_RCC_GetUSARTClockSource\n
  2480. * DCKCFGR2 USART3SEL LL_RCC_GetUSARTClockSource\n
  2481. * DCKCFGR2 USART6SEL LL_RCC_GetUSARTClockSource
  2482. * @param USARTx This parameter can be one of the following values:
  2483. * @arg @ref LL_RCC_USART1_CLKSOURCE
  2484. * @arg @ref LL_RCC_USART2_CLKSOURCE
  2485. * @arg @ref LL_RCC_USART3_CLKSOURCE
  2486. * @arg @ref LL_RCC_USART6_CLKSOURCE
  2487. * @retval Returned value can be one of the following values:
  2488. * @arg @ref LL_RCC_USART1_CLKSOURCE_PCLK2
  2489. * @arg @ref LL_RCC_USART1_CLKSOURCE_SYSCLK
  2490. * @arg @ref LL_RCC_USART1_CLKSOURCE_HSI
  2491. * @arg @ref LL_RCC_USART1_CLKSOURCE_LSE
  2492. * @arg @ref LL_RCC_USART2_CLKSOURCE_PCLK1
  2493. * @arg @ref LL_RCC_USART2_CLKSOURCE_SYSCLK
  2494. * @arg @ref LL_RCC_USART2_CLKSOURCE_HSI
  2495. * @arg @ref LL_RCC_USART2_CLKSOURCE_LSE
  2496. * @arg @ref LL_RCC_USART3_CLKSOURCE_PCLK1
  2497. * @arg @ref LL_RCC_USART3_CLKSOURCE_SYSCLK
  2498. * @arg @ref LL_RCC_USART3_CLKSOURCE_HSI
  2499. * @arg @ref LL_RCC_USART3_CLKSOURCE_LSE
  2500. * @arg @ref LL_RCC_USART6_CLKSOURCE_PCLK2
  2501. * @arg @ref LL_RCC_USART6_CLKSOURCE_SYSCLK
  2502. * @arg @ref LL_RCC_USART6_CLKSOURCE_HSI
  2503. * @arg @ref LL_RCC_USART6_CLKSOURCE_LSE
  2504. */
  2505. __STATIC_INLINE uint32_t LL_RCC_GetUSARTClockSource(uint32_t USARTx)
  2506. {
  2507. return (uint32_t)(READ_BIT(RCC->DCKCFGR2, USARTx) | (USARTx << 16U));
  2508. }
  2509. /**
  2510. * @brief Get UARTx clock source
  2511. * @rmtoll DCKCFGR2 UART4SEL LL_RCC_GetUARTClockSource\n
  2512. * DCKCFGR2 UART5SEL LL_RCC_GetUARTClockSource\n
  2513. * DCKCFGR2 UART7SEL LL_RCC_GetUARTClockSource\n
  2514. * DCKCFGR2 UART8SEL LL_RCC_GetUARTClockSource
  2515. * @param UARTx This parameter can be one of the following values:
  2516. * @arg @ref LL_RCC_UART4_CLKSOURCE
  2517. * @arg @ref LL_RCC_UART5_CLKSOURCE
  2518. * @arg @ref LL_RCC_UART7_CLKSOURCE
  2519. * @arg @ref LL_RCC_UART8_CLKSOURCE
  2520. * @retval Returned value can be one of the following values:
  2521. * @arg @ref LL_RCC_UART4_CLKSOURCE_PCLK1
  2522. * @arg @ref LL_RCC_UART4_CLKSOURCE_SYSCLK
  2523. * @arg @ref LL_RCC_UART4_CLKSOURCE_HSI
  2524. * @arg @ref LL_RCC_UART4_CLKSOURCE_LSE
  2525. * @arg @ref LL_RCC_UART5_CLKSOURCE_PCLK1
  2526. * @arg @ref LL_RCC_UART5_CLKSOURCE_SYSCLK
  2527. * @arg @ref LL_RCC_UART5_CLKSOURCE_HSI
  2528. * @arg @ref LL_RCC_UART5_CLKSOURCE_LSE
  2529. * @arg @ref LL_RCC_UART7_CLKSOURCE_PCLK1
  2530. * @arg @ref LL_RCC_UART7_CLKSOURCE_SYSCLK
  2531. * @arg @ref LL_RCC_UART7_CLKSOURCE_HSI
  2532. * @arg @ref LL_RCC_UART7_CLKSOURCE_LSE
  2533. * @arg @ref LL_RCC_UART8_CLKSOURCE_PCLK1
  2534. * @arg @ref LL_RCC_UART8_CLKSOURCE_SYSCLK
  2535. * @arg @ref LL_RCC_UART8_CLKSOURCE_HSI
  2536. * @arg @ref LL_RCC_UART8_CLKSOURCE_LSE
  2537. */
  2538. __STATIC_INLINE uint32_t LL_RCC_GetUARTClockSource(uint32_t UARTx)
  2539. {
  2540. return (uint32_t)(READ_BIT(RCC->DCKCFGR2, UARTx) | (UARTx << 16U));
  2541. }
  2542. /**
  2543. * @brief Get I2Cx clock source
  2544. * @rmtoll DCKCFGR2 I2C1SEL LL_RCC_GetI2CClockSource\n
  2545. * DCKCFGR2 I2C2SEL LL_RCC_GetI2CClockSource\n
  2546. * DCKCFGR2 I2C3SEL LL_RCC_GetI2CClockSource\n
  2547. * DCKCFGR2 I2C4SEL LL_RCC_GetI2CClockSource
  2548. * @param I2Cx This parameter can be one of the following values:
  2549. * @arg @ref LL_RCC_I2C1_CLKSOURCE
  2550. * @arg @ref LL_RCC_I2C2_CLKSOURCE
  2551. * @arg @ref LL_RCC_I2C3_CLKSOURCE
  2552. * @arg @ref LL_RCC_I2C4_CLKSOURCE (*)
  2553. * @retval Returned value can be one of the following values:
  2554. * @arg @ref LL_RCC_I2C1_CLKSOURCE_PCLK1
  2555. * @arg @ref LL_RCC_I2C1_CLKSOURCE_SYSCLK
  2556. * @arg @ref LL_RCC_I2C1_CLKSOURCE_HSI
  2557. * @arg @ref LL_RCC_I2C2_CLKSOURCE_PCLK1
  2558. * @arg @ref LL_RCC_I2C2_CLKSOURCE_SYSCLK
  2559. * @arg @ref LL_RCC_I2C2_CLKSOURCE_HSI
  2560. * @arg @ref LL_RCC_I2C3_CLKSOURCE_PCLK1
  2561. * @arg @ref LL_RCC_I2C3_CLKSOURCE_SYSCLK
  2562. * @arg @ref LL_RCC_I2C3_CLKSOURCE_HSI
  2563. * @arg @ref LL_RCC_I2C4_CLKSOURCE_PCLK1 (*)
  2564. * @arg @ref LL_RCC_I2C4_CLKSOURCE_SYSCLK (*)
  2565. * @arg @ref LL_RCC_I2C4_CLKSOURCE_HSI (*)
  2566. *
  2567. * (*) value not defined in all devices.
  2568. */
  2569. __STATIC_INLINE uint32_t LL_RCC_GetI2CClockSource(uint32_t I2Cx)
  2570. {
  2571. return (uint32_t)((READ_BIT(RCC->DCKCFGR2, I2Cx) >> 16U) | I2Cx);
  2572. }
  2573. /**
  2574. * @brief Get LPTIMx clock source
  2575. * @rmtoll DCKCFGR2 LPTIM1SEL LL_RCC_GetLPTIMClockSource
  2576. * @param LPTIMx This parameter can be one of the following values:
  2577. * @arg @ref LL_RCC_LPTIM1_CLKSOURCE
  2578. * @retval Returned value can be one of the following values:
  2579. * @arg @ref LL_RCC_LPTIM1_CLKSOURCE_PCLK1
  2580. * @arg @ref LL_RCC_LPTIM1_CLKSOURCE_LSI
  2581. * @arg @ref LL_RCC_LPTIM1_CLKSOURCE_HSI
  2582. * @arg @ref LL_RCC_LPTIM1_CLKSOURCE_LSE
  2583. */
  2584. __STATIC_INLINE uint32_t LL_RCC_GetLPTIMClockSource(uint32_t LPTIMx)
  2585. {
  2586. return (uint32_t)(READ_BIT(RCC->DCKCFGR2, RCC_DCKCFGR2_LPTIM1SEL));
  2587. }
  2588. /**
  2589. * @brief Get SAIx clock source
  2590. * @rmtoll DCKCFGR1 SAI1SEL LL_RCC_GetSAIClockSource\n
  2591. * DCKCFGR1 SAI2SEL LL_RCC_GetSAIClockSource
  2592. * @param SAIx This parameter can be one of the following values:
  2593. * @arg @ref LL_RCC_SAI1_CLKSOURCE
  2594. * @arg @ref LL_RCC_SAI2_CLKSOURCE
  2595. * @retval Returned value can be one of the following values:
  2596. * @arg @ref LL_RCC_SAI1_CLKSOURCE_PLLSAI
  2597. * @arg @ref LL_RCC_SAI1_CLKSOURCE_PLLI2S
  2598. * @arg @ref LL_RCC_SAI1_CLKSOURCE_PIN
  2599. * @arg @ref LL_RCC_SAI1_CLKSOURCE_PLLSRC (*)
  2600. * @arg @ref LL_RCC_SAI2_CLKSOURCE_PLLSAI
  2601. * @arg @ref LL_RCC_SAI2_CLKSOURCE_PLLI2S
  2602. * @arg @ref LL_RCC_SAI2_CLKSOURCE_PIN
  2603. * @arg @ref LL_RCC_SAI2_CLKSOURCE_PLLSRC (*)
  2604. *
  2605. * (*) value not defined in all devices.
  2606. */
  2607. __STATIC_INLINE uint32_t LL_RCC_GetSAIClockSource(uint32_t SAIx)
  2608. {
  2609. return (uint32_t)(READ_BIT(RCC->DCKCFGR1, SAIx) >> 16U | SAIx);
  2610. }
  2611. /**
  2612. * @brief Get SDMMCx clock source
  2613. * @rmtoll DCKCFGR2 SDMMC1SEL LL_RCC_GetSDMMCClockSource\n
  2614. * DCKCFGR2 SDMMC2SEL LL_RCC_GetSDMMCClockSource
  2615. * @param SDMMCx This parameter can be one of the following values:
  2616. * @arg @ref LL_RCC_SDMMC1_CLKSOURCE
  2617. * @arg @ref LL_RCC_SDMMC1_CLKSOURCE (*)
  2618. * @retval Returned value can be one of the following values:
  2619. * @arg @ref LL_RCC_SDMMC1_CLKSOURCE_PLL48CLK
  2620. * @arg @ref LL_RCC_SDMMC1_CLKSOURCE_SYSCLK
  2621. * @arg @ref LL_RCC_SDMMC2_CLKSOURCE_PLL48CLK (*)
  2622. * @arg @ref LL_RCC_SDMMC2_CLKSOURCE_SYSCLK (*)
  2623. *
  2624. * (*) value not defined in all devices.
  2625. */
  2626. __STATIC_INLINE uint32_t LL_RCC_GetSDMMCClockSource(uint32_t SDMMCx)
  2627. {
  2628. return (uint32_t)(READ_BIT(RCC->DCKCFGR2, SDMMCx) >> 16U | SDMMCx);
  2629. }
  2630. /**
  2631. * @brief Get 48Mhz domain clock source
  2632. * @rmtoll DCKCFGR2 CK48MSEL LL_RCC_GetCK48MClockSource
  2633. * @param CK48Mx This parameter can be one of the following values:
  2634. * @arg @ref LL_RCC_CK48M_CLKSOURCE
  2635. * @retval Returned value can be one of the following values:
  2636. * @arg @ref LL_RCC_CK48M_CLKSOURCE_PLL
  2637. * @arg @ref LL_RCC_CK48M_CLKSOURCE_PLLSAI
  2638. */
  2639. __STATIC_INLINE uint32_t LL_RCC_GetCK48MClockSource(uint32_t CK48Mx)
  2640. {
  2641. return (uint32_t)(READ_BIT(RCC->DCKCFGR2, CK48Mx));
  2642. }
  2643. /**
  2644. * @brief Get RNGx clock source
  2645. * @rmtoll DCKCFGR2 CK48MSEL LL_RCC_GetRNGClockSource
  2646. * @param RNGx This parameter can be one of the following values:
  2647. * @arg @ref LL_RCC_RNG_CLKSOURCE
  2648. * @retval Returned value can be one of the following values:
  2649. * @arg @ref LL_RCC_RNG_CLKSOURCE_PLL
  2650. * @arg @ref LL_RCC_RNG_CLKSOURCE_PLLSAI
  2651. */
  2652. __STATIC_INLINE uint32_t LL_RCC_GetRNGClockSource(uint32_t RNGx)
  2653. {
  2654. return (uint32_t)(READ_BIT(RCC->DCKCFGR2, RNGx));
  2655. }
  2656. /**
  2657. * @brief Get USBx clock source
  2658. * @rmtoll DCKCFGR2 CK48MSEL LL_RCC_GetUSBClockSource
  2659. * @param USBx This parameter can be one of the following values:
  2660. * @arg @ref LL_RCC_USB_CLKSOURCE
  2661. * @retval Returned value can be one of the following values:
  2662. * @arg @ref LL_RCC_USB_CLKSOURCE_PLL
  2663. * @arg @ref LL_RCC_USB_CLKSOURCE_PLLSAI
  2664. */
  2665. __STATIC_INLINE uint32_t LL_RCC_GetUSBClockSource(uint32_t USBx)
  2666. {
  2667. return (uint32_t)(READ_BIT(RCC->DCKCFGR2, USBx));
  2668. }
  2669. #if defined(CEC)
  2670. /**
  2671. * @brief Get CEC Clock Source
  2672. * @rmtoll DCKCFGR2 CECSEL LL_RCC_GetCECClockSource
  2673. * @param CECx This parameter can be one of the following values:
  2674. * @arg @ref LL_RCC_CEC_CLKSOURCE
  2675. * @retval Returned value can be one of the following values:
  2676. * @arg @ref LL_RCC_CEC_CLKSOURCE_LSE
  2677. * @arg @ref LL_RCC_CEC_CLKSOURCE_HSI_DIV488
  2678. */
  2679. __STATIC_INLINE uint32_t LL_RCC_GetCECClockSource(uint32_t CECx)
  2680. {
  2681. return (uint32_t)(READ_BIT(RCC->DCKCFGR2, CECx));
  2682. }
  2683. #endif /* CEC */
  2684. /**
  2685. * @brief Get I2S Clock Source
  2686. * @rmtoll CFGR I2SSRC LL_RCC_GetI2SClockSource
  2687. * @param I2Sx This parameter can be one of the following values:
  2688. * @arg @ref LL_RCC_I2S1_CLKSOURCE
  2689. * @retval Returned value can be one of the following values:
  2690. * @arg @ref LL_RCC_I2S1_CLKSOURCE_PLLI2S
  2691. * @arg @ref LL_RCC_I2S1_CLKSOURCE_PIN
  2692. */
  2693. __STATIC_INLINE uint32_t LL_RCC_GetI2SClockSource(uint32_t I2Sx)
  2694. {
  2695. return (uint32_t)(READ_BIT(RCC->CFGR, I2Sx));
  2696. }
  2697. #if defined(DFSDM1_Channel0)
  2698. /**
  2699. * @brief Get DFSDM Audio Clock Source
  2700. * @rmtoll DCKCFGR1 ADFSDM1SEL LL_RCC_GetDFSDMAudioClockSource
  2701. * @param DFSDMx This parameter can be one of the following values:
  2702. * @arg @ref LL_RCC_DFSDM1_AUDIO_CLKSOURCE
  2703. * @retval Returned value can be one of the following values:
  2704. * @arg @ref LL_RCC_DFSDM1_AUDIO_CLKSOURCE_SAI1
  2705. * @arg @ref LL_RCC_DFSDM1_AUDIO_CLKSOURCE_SAI2
  2706. */
  2707. __STATIC_INLINE uint32_t LL_RCC_GetDFSDMAudioClockSource(uint32_t DFSDMx)
  2708. {
  2709. return (uint32_t)(READ_BIT(RCC->DCKCFGR1, DFSDMx));
  2710. }
  2711. /**
  2712. * @brief Get DFSDM Audio Clock Source
  2713. * @rmtoll DCKCFGR1 DFSDM1SEL LL_RCC_GetDFSDMClockSource
  2714. * @param DFSDMx This parameter can be one of the following values:
  2715. * @arg @ref LL_RCC_DFSDM1_CLKSOURCE
  2716. * @retval Returned value can be one of the following values:
  2717. * @arg @ref LL_RCC_DFSDM1_CLKSOURCE_PCLK2
  2718. * @arg @ref LL_RCC_DFSDM1_CLKSOURCE_SYSCLK
  2719. */
  2720. __STATIC_INLINE uint32_t LL_RCC_GetDFSDMClockSource(uint32_t DFSDMx)
  2721. {
  2722. return (uint32_t)(READ_BIT(RCC->DCKCFGR1, DFSDMx));
  2723. }
  2724. #endif /* DFSDM1_Channel0 */
  2725. #if defined(DSI)
  2726. /**
  2727. * @brief Get DSI Clock Source
  2728. * @rmtoll DCKCFGR2 DSISEL LL_RCC_GetDSIClockSource
  2729. * @param DSIx This parameter can be one of the following values:
  2730. * @arg @ref LL_RCC_DSI_CLKSOURCE
  2731. * @retval Returned value can be one of the following values:
  2732. * @arg @ref LL_RCC_DSI_CLKSOURCE_PHY
  2733. * @arg @ref LL_RCC_DSI_CLKSOURCE_PLL
  2734. */
  2735. __STATIC_INLINE uint32_t LL_RCC_GetDSIClockSource(uint32_t DSIx)
  2736. {
  2737. return (uint32_t)(READ_BIT(RCC->DCKCFGR2, DSIx));
  2738. }
  2739. #endif /* DSI */
  2740. /**
  2741. * @}
  2742. */
  2743. /** @defgroup RCC_LL_EF_RTC RTC
  2744. * @{
  2745. */
  2746. /**
  2747. * @brief Set RTC Clock Source
  2748. * @note Once the RTC clock source has been selected, it cannot be changed anymore unless
  2749. * the Backup domain is reset, or unless a failure is detected on LSE (LSECSSD is
  2750. * set). The BDRST bit can be used to reset them.
  2751. * @rmtoll BDCR RTCSEL LL_RCC_SetRTCClockSource
  2752. * @param Source This parameter can be one of the following values:
  2753. * @arg @ref LL_RCC_RTC_CLKSOURCE_NONE
  2754. * @arg @ref LL_RCC_RTC_CLKSOURCE_LSE
  2755. * @arg @ref LL_RCC_RTC_CLKSOURCE_LSI
  2756. * @arg @ref LL_RCC_RTC_CLKSOURCE_HSE
  2757. * @retval None
  2758. */
  2759. __STATIC_INLINE void LL_RCC_SetRTCClockSource(uint32_t Source)
  2760. {
  2761. MODIFY_REG(RCC->BDCR, RCC_BDCR_RTCSEL, Source);
  2762. }
  2763. /**
  2764. * @brief Get RTC Clock Source
  2765. * @rmtoll BDCR RTCSEL LL_RCC_GetRTCClockSource
  2766. * @retval Returned value can be one of the following values:
  2767. * @arg @ref LL_RCC_RTC_CLKSOURCE_NONE
  2768. * @arg @ref LL_RCC_RTC_CLKSOURCE_LSE
  2769. * @arg @ref LL_RCC_RTC_CLKSOURCE_LSI
  2770. * @arg @ref LL_RCC_RTC_CLKSOURCE_HSE
  2771. */
  2772. __STATIC_INLINE uint32_t LL_RCC_GetRTCClockSource(void)
  2773. {
  2774. return (uint32_t)(READ_BIT(RCC->BDCR, RCC_BDCR_RTCSEL));
  2775. }
  2776. /**
  2777. * @brief Enable RTC
  2778. * @rmtoll BDCR RTCEN LL_RCC_EnableRTC
  2779. * @retval None
  2780. */
  2781. __STATIC_INLINE void LL_RCC_EnableRTC(void)
  2782. {
  2783. SET_BIT(RCC->BDCR, RCC_BDCR_RTCEN);
  2784. }
  2785. /**
  2786. * @brief Disable RTC
  2787. * @rmtoll BDCR RTCEN LL_RCC_DisableRTC
  2788. * @retval None
  2789. */
  2790. __STATIC_INLINE void LL_RCC_DisableRTC(void)
  2791. {
  2792. CLEAR_BIT(RCC->BDCR, RCC_BDCR_RTCEN);
  2793. }
  2794. /**
  2795. * @brief Check if RTC has been enabled or not
  2796. * @rmtoll BDCR RTCEN LL_RCC_IsEnabledRTC
  2797. * @retval State of bit (1 or 0).
  2798. */
  2799. __STATIC_INLINE uint32_t LL_RCC_IsEnabledRTC(void)
  2800. {
  2801. return (READ_BIT(RCC->BDCR, RCC_BDCR_RTCEN) == (RCC_BDCR_RTCEN));
  2802. }
  2803. /**
  2804. * @brief Force the Backup domain reset
  2805. * @rmtoll BDCR BDRST LL_RCC_ForceBackupDomainReset
  2806. * @retval None
  2807. */
  2808. __STATIC_INLINE void LL_RCC_ForceBackupDomainReset(void)
  2809. {
  2810. SET_BIT(RCC->BDCR, RCC_BDCR_BDRST);
  2811. }
  2812. /**
  2813. * @brief Release the Backup domain reset
  2814. * @rmtoll BDCR BDRST LL_RCC_ReleaseBackupDomainReset
  2815. * @retval None
  2816. */
  2817. __STATIC_INLINE void LL_RCC_ReleaseBackupDomainReset(void)
  2818. {
  2819. CLEAR_BIT(RCC->BDCR, RCC_BDCR_BDRST);
  2820. }
  2821. /**
  2822. * @brief Set HSE Prescalers for RTC Clock
  2823. * @rmtoll CFGR RTCPRE LL_RCC_SetRTC_HSEPrescaler
  2824. * @param Prescaler This parameter can be one of the following values:
  2825. * @arg @ref LL_RCC_RTC_NOCLOCK
  2826. * @arg @ref LL_RCC_RTC_HSE_DIV_2
  2827. * @arg @ref LL_RCC_RTC_HSE_DIV_3
  2828. * @arg @ref LL_RCC_RTC_HSE_DIV_4
  2829. * @arg @ref LL_RCC_RTC_HSE_DIV_5
  2830. * @arg @ref LL_RCC_RTC_HSE_DIV_6
  2831. * @arg @ref LL_RCC_RTC_HSE_DIV_7
  2832. * @arg @ref LL_RCC_RTC_HSE_DIV_8
  2833. * @arg @ref LL_RCC_RTC_HSE_DIV_9
  2834. * @arg @ref LL_RCC_RTC_HSE_DIV_10
  2835. * @arg @ref LL_RCC_RTC_HSE_DIV_11
  2836. * @arg @ref LL_RCC_RTC_HSE_DIV_12
  2837. * @arg @ref LL_RCC_RTC_HSE_DIV_13
  2838. * @arg @ref LL_RCC_RTC_HSE_DIV_14
  2839. * @arg @ref LL_RCC_RTC_HSE_DIV_15
  2840. * @arg @ref LL_RCC_RTC_HSE_DIV_16
  2841. * @arg @ref LL_RCC_RTC_HSE_DIV_17
  2842. * @arg @ref LL_RCC_RTC_HSE_DIV_18
  2843. * @arg @ref LL_RCC_RTC_HSE_DIV_19
  2844. * @arg @ref LL_RCC_RTC_HSE_DIV_20
  2845. * @arg @ref LL_RCC_RTC_HSE_DIV_21
  2846. * @arg @ref LL_RCC_RTC_HSE_DIV_22
  2847. * @arg @ref LL_RCC_RTC_HSE_DIV_23
  2848. * @arg @ref LL_RCC_RTC_HSE_DIV_24
  2849. * @arg @ref LL_RCC_RTC_HSE_DIV_25
  2850. * @arg @ref LL_RCC_RTC_HSE_DIV_26
  2851. * @arg @ref LL_RCC_RTC_HSE_DIV_27
  2852. * @arg @ref LL_RCC_RTC_HSE_DIV_28
  2853. * @arg @ref LL_RCC_RTC_HSE_DIV_29
  2854. * @arg @ref LL_RCC_RTC_HSE_DIV_30
  2855. * @arg @ref LL_RCC_RTC_HSE_DIV_31
  2856. * @retval None
  2857. */
  2858. __STATIC_INLINE void LL_RCC_SetRTC_HSEPrescaler(uint32_t Prescaler)
  2859. {
  2860. MODIFY_REG(RCC->CFGR, RCC_CFGR_RTCPRE, Prescaler);
  2861. }
  2862. /**
  2863. * @brief Get HSE Prescalers for RTC Clock
  2864. * @rmtoll CFGR RTCPRE LL_RCC_GetRTC_HSEPrescaler
  2865. * @retval Returned value can be one of the following values:
  2866. * @arg @ref LL_RCC_RTC_NOCLOCK
  2867. * @arg @ref LL_RCC_RTC_HSE_DIV_2
  2868. * @arg @ref LL_RCC_RTC_HSE_DIV_3
  2869. * @arg @ref LL_RCC_RTC_HSE_DIV_4
  2870. * @arg @ref LL_RCC_RTC_HSE_DIV_5
  2871. * @arg @ref LL_RCC_RTC_HSE_DIV_6
  2872. * @arg @ref LL_RCC_RTC_HSE_DIV_7
  2873. * @arg @ref LL_RCC_RTC_HSE_DIV_8
  2874. * @arg @ref LL_RCC_RTC_HSE_DIV_9
  2875. * @arg @ref LL_RCC_RTC_HSE_DIV_10
  2876. * @arg @ref LL_RCC_RTC_HSE_DIV_11
  2877. * @arg @ref LL_RCC_RTC_HSE_DIV_12
  2878. * @arg @ref LL_RCC_RTC_HSE_DIV_13
  2879. * @arg @ref LL_RCC_RTC_HSE_DIV_14
  2880. * @arg @ref LL_RCC_RTC_HSE_DIV_15
  2881. * @arg @ref LL_RCC_RTC_HSE_DIV_16
  2882. * @arg @ref LL_RCC_RTC_HSE_DIV_17
  2883. * @arg @ref LL_RCC_RTC_HSE_DIV_18
  2884. * @arg @ref LL_RCC_RTC_HSE_DIV_19
  2885. * @arg @ref LL_RCC_RTC_HSE_DIV_20
  2886. * @arg @ref LL_RCC_RTC_HSE_DIV_21
  2887. * @arg @ref LL_RCC_RTC_HSE_DIV_22
  2888. * @arg @ref LL_RCC_RTC_HSE_DIV_23
  2889. * @arg @ref LL_RCC_RTC_HSE_DIV_24
  2890. * @arg @ref LL_RCC_RTC_HSE_DIV_25
  2891. * @arg @ref LL_RCC_RTC_HSE_DIV_26
  2892. * @arg @ref LL_RCC_RTC_HSE_DIV_27
  2893. * @arg @ref LL_RCC_RTC_HSE_DIV_28
  2894. * @arg @ref LL_RCC_RTC_HSE_DIV_29
  2895. * @arg @ref LL_RCC_RTC_HSE_DIV_30
  2896. * @arg @ref LL_RCC_RTC_HSE_DIV_31
  2897. */
  2898. __STATIC_INLINE uint32_t LL_RCC_GetRTC_HSEPrescaler(void)
  2899. {
  2900. return (uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_RTCPRE));
  2901. }
  2902. /**
  2903. * @}
  2904. */
  2905. /** @defgroup RCC_LL_EF_TIM_CLOCK_PRESCALER TIM
  2906. * @{
  2907. */
  2908. /**
  2909. * @brief Set Timers Clock Prescalers
  2910. * @rmtoll DCKCFGR1 TIMPRE LL_RCC_SetTIMPrescaler
  2911. * @param Prescaler This parameter can be one of the following values:
  2912. * @arg @ref LL_RCC_TIM_PRESCALER_TWICE
  2913. * @arg @ref LL_RCC_TIM_PRESCALER_FOUR_TIMES
  2914. * @retval None
  2915. */
  2916. __STATIC_INLINE void LL_RCC_SetTIMPrescaler(uint32_t Prescaler)
  2917. {
  2918. MODIFY_REG(RCC->DCKCFGR1, RCC_DCKCFGR1_TIMPRE, Prescaler);
  2919. }
  2920. /**
  2921. * @brief Get Timers Clock Prescalers
  2922. * @rmtoll DCKCFGR1 TIMPRE LL_RCC_GetTIMPrescaler
  2923. * @retval Returned value can be one of the following values:
  2924. * @arg @ref LL_RCC_TIM_PRESCALER_TWICE
  2925. * @arg @ref LL_RCC_TIM_PRESCALER_FOUR_TIMES
  2926. */
  2927. __STATIC_INLINE uint32_t LL_RCC_GetTIMPrescaler(void)
  2928. {
  2929. return (uint32_t)(READ_BIT(RCC->DCKCFGR1, RCC_DCKCFGR1_TIMPRE));
  2930. }
  2931. /**
  2932. * @}
  2933. */
  2934. /** @defgroup RCC_LL_EF_PLL PLL
  2935. * @{
  2936. */
  2937. /**
  2938. * @brief Enable PLL
  2939. * @rmtoll CR PLLON LL_RCC_PLL_Enable
  2940. * @retval None
  2941. */
  2942. __STATIC_INLINE void LL_RCC_PLL_Enable(void)
  2943. {
  2944. SET_BIT(RCC->CR, RCC_CR_PLLON);
  2945. }
  2946. /**
  2947. * @brief Disable PLL
  2948. * @note Cannot be disabled if the PLL clock is used as the system clock
  2949. * @rmtoll CR PLLON LL_RCC_PLL_Disable
  2950. * @retval None
  2951. */
  2952. __STATIC_INLINE void LL_RCC_PLL_Disable(void)
  2953. {
  2954. CLEAR_BIT(RCC->CR, RCC_CR_PLLON);
  2955. }
  2956. /**
  2957. * @brief Check if PLL Ready
  2958. * @rmtoll CR PLLRDY LL_RCC_PLL_IsReady
  2959. * @retval State of bit (1 or 0).
  2960. */
  2961. __STATIC_INLINE uint32_t LL_RCC_PLL_IsReady(void)
  2962. {
  2963. return (READ_BIT(RCC->CR, RCC_CR_PLLRDY) == (RCC_CR_PLLRDY));
  2964. }
  2965. /**
  2966. * @brief Configure PLL used for SYSCLK Domain
  2967. * @note PLL Source and PLLM Divider can be written only when PLL,
  2968. * PLLI2S and PLLSAI are disabled
  2969. * @note PLLN/PLLP can be written only when PLL is disabled
  2970. * @rmtoll PLLCFGR PLLSRC LL_RCC_PLL_ConfigDomain_SYS\n
  2971. * PLLCFGR PLLM LL_RCC_PLL_ConfigDomain_SYS\n
  2972. * PLLCFGR PLLN LL_RCC_PLL_ConfigDomain_SYS\n
  2973. * PLLCFGR PLLP LL_RCC_PLL_ConfigDomain_SYS
  2974. * @param Source This parameter can be one of the following values:
  2975. * @arg @ref LL_RCC_PLLSOURCE_HSI
  2976. * @arg @ref LL_RCC_PLLSOURCE_HSE
  2977. * @param PLLM This parameter can be one of the following values:
  2978. * @arg @ref LL_RCC_PLLM_DIV_2
  2979. * @arg @ref LL_RCC_PLLM_DIV_3
  2980. * @arg @ref LL_RCC_PLLM_DIV_4
  2981. * @arg @ref LL_RCC_PLLM_DIV_5
  2982. * @arg @ref LL_RCC_PLLM_DIV_6
  2983. * @arg @ref LL_RCC_PLLM_DIV_7
  2984. * @arg @ref LL_RCC_PLLM_DIV_8
  2985. * @arg @ref LL_RCC_PLLM_DIV_9
  2986. * @arg @ref LL_RCC_PLLM_DIV_10
  2987. * @arg @ref LL_RCC_PLLM_DIV_11
  2988. * @arg @ref LL_RCC_PLLM_DIV_12
  2989. * @arg @ref LL_RCC_PLLM_DIV_13
  2990. * @arg @ref LL_RCC_PLLM_DIV_14
  2991. * @arg @ref LL_RCC_PLLM_DIV_15
  2992. * @arg @ref LL_RCC_PLLM_DIV_16
  2993. * @arg @ref LL_RCC_PLLM_DIV_17
  2994. * @arg @ref LL_RCC_PLLM_DIV_18
  2995. * @arg @ref LL_RCC_PLLM_DIV_19
  2996. * @arg @ref LL_RCC_PLLM_DIV_20
  2997. * @arg @ref LL_RCC_PLLM_DIV_21
  2998. * @arg @ref LL_RCC_PLLM_DIV_22
  2999. * @arg @ref LL_RCC_PLLM_DIV_23
  3000. * @arg @ref LL_RCC_PLLM_DIV_24
  3001. * @arg @ref LL_RCC_PLLM_DIV_25
  3002. * @arg @ref LL_RCC_PLLM_DIV_26
  3003. * @arg @ref LL_RCC_PLLM_DIV_27
  3004. * @arg @ref LL_RCC_PLLM_DIV_28
  3005. * @arg @ref LL_RCC_PLLM_DIV_29
  3006. * @arg @ref LL_RCC_PLLM_DIV_30
  3007. * @arg @ref LL_RCC_PLLM_DIV_31
  3008. * @arg @ref LL_RCC_PLLM_DIV_32
  3009. * @arg @ref LL_RCC_PLLM_DIV_33
  3010. * @arg @ref LL_RCC_PLLM_DIV_34
  3011. * @arg @ref LL_RCC_PLLM_DIV_35
  3012. * @arg @ref LL_RCC_PLLM_DIV_36
  3013. * @arg @ref LL_RCC_PLLM_DIV_37
  3014. * @arg @ref LL_RCC_PLLM_DIV_38
  3015. * @arg @ref LL_RCC_PLLM_DIV_39
  3016. * @arg @ref LL_RCC_PLLM_DIV_40
  3017. * @arg @ref LL_RCC_PLLM_DIV_41
  3018. * @arg @ref LL_RCC_PLLM_DIV_42
  3019. * @arg @ref LL_RCC_PLLM_DIV_43
  3020. * @arg @ref LL_RCC_PLLM_DIV_44
  3021. * @arg @ref LL_RCC_PLLM_DIV_45
  3022. * @arg @ref LL_RCC_PLLM_DIV_46
  3023. * @arg @ref LL_RCC_PLLM_DIV_47
  3024. * @arg @ref LL_RCC_PLLM_DIV_48
  3025. * @arg @ref LL_RCC_PLLM_DIV_49
  3026. * @arg @ref LL_RCC_PLLM_DIV_50
  3027. * @arg @ref LL_RCC_PLLM_DIV_51
  3028. * @arg @ref LL_RCC_PLLM_DIV_52
  3029. * @arg @ref LL_RCC_PLLM_DIV_53
  3030. * @arg @ref LL_RCC_PLLM_DIV_54
  3031. * @arg @ref LL_RCC_PLLM_DIV_55
  3032. * @arg @ref LL_RCC_PLLM_DIV_56
  3033. * @arg @ref LL_RCC_PLLM_DIV_57
  3034. * @arg @ref LL_RCC_PLLM_DIV_58
  3035. * @arg @ref LL_RCC_PLLM_DIV_59
  3036. * @arg @ref LL_RCC_PLLM_DIV_60
  3037. * @arg @ref LL_RCC_PLLM_DIV_61
  3038. * @arg @ref LL_RCC_PLLM_DIV_62
  3039. * @arg @ref LL_RCC_PLLM_DIV_63
  3040. * @param PLLN Between 50 and 432
  3041. * @param PLLP This parameter can be one of the following values:
  3042. * @arg @ref LL_RCC_PLLP_DIV_2
  3043. * @arg @ref LL_RCC_PLLP_DIV_4
  3044. * @arg @ref LL_RCC_PLLP_DIV_6
  3045. * @arg @ref LL_RCC_PLLP_DIV_8
  3046. * @retval None
  3047. */
  3048. __STATIC_INLINE void LL_RCC_PLL_ConfigDomain_SYS(uint32_t Source, uint32_t PLLM, uint32_t PLLN, uint32_t PLLP)
  3049. {
  3050. MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC | RCC_PLLCFGR_PLLM | RCC_PLLCFGR_PLLN | RCC_PLLCFGR_PLLP,
  3051. Source | PLLM | PLLN << RCC_PLLCFGR_PLLN_Pos | PLLP);
  3052. }
  3053. /**
  3054. * @brief Configure PLL used for 48Mhz domain clock
  3055. * @note PLL Source and PLLM Divider can be written only when PLL,
  3056. * PLLI2S and PLLSAI are disabled
  3057. * @note PLLN/PLLQ can be written only when PLL is disabled
  3058. * @note This can be selected for USB, RNG, SDMMC1
  3059. * @rmtoll PLLCFGR PLLSRC LL_RCC_PLL_ConfigDomain_48M\n
  3060. * PLLCFGR PLLM LL_RCC_PLL_ConfigDomain_48M\n
  3061. * PLLCFGR PLLN LL_RCC_PLL_ConfigDomain_48M\n
  3062. * PLLCFGR PLLQ LL_RCC_PLL_ConfigDomain_48M
  3063. * @param Source This parameter can be one of the following values:
  3064. * @arg @ref LL_RCC_PLLSOURCE_HSI
  3065. * @arg @ref LL_RCC_PLLSOURCE_HSE
  3066. * @param PLLM This parameter can be one of the following values:
  3067. * @arg @ref LL_RCC_PLLM_DIV_2
  3068. * @arg @ref LL_RCC_PLLM_DIV_3
  3069. * @arg @ref LL_RCC_PLLM_DIV_4
  3070. * @arg @ref LL_RCC_PLLM_DIV_5
  3071. * @arg @ref LL_RCC_PLLM_DIV_6
  3072. * @arg @ref LL_RCC_PLLM_DIV_7
  3073. * @arg @ref LL_RCC_PLLM_DIV_8
  3074. * @arg @ref LL_RCC_PLLM_DIV_9
  3075. * @arg @ref LL_RCC_PLLM_DIV_10
  3076. * @arg @ref LL_RCC_PLLM_DIV_11
  3077. * @arg @ref LL_RCC_PLLM_DIV_12
  3078. * @arg @ref LL_RCC_PLLM_DIV_13
  3079. * @arg @ref LL_RCC_PLLM_DIV_14
  3080. * @arg @ref LL_RCC_PLLM_DIV_15
  3081. * @arg @ref LL_RCC_PLLM_DIV_16
  3082. * @arg @ref LL_RCC_PLLM_DIV_17
  3083. * @arg @ref LL_RCC_PLLM_DIV_18
  3084. * @arg @ref LL_RCC_PLLM_DIV_19
  3085. * @arg @ref LL_RCC_PLLM_DIV_20
  3086. * @arg @ref LL_RCC_PLLM_DIV_21
  3087. * @arg @ref LL_RCC_PLLM_DIV_22
  3088. * @arg @ref LL_RCC_PLLM_DIV_23
  3089. * @arg @ref LL_RCC_PLLM_DIV_24
  3090. * @arg @ref LL_RCC_PLLM_DIV_25
  3091. * @arg @ref LL_RCC_PLLM_DIV_26
  3092. * @arg @ref LL_RCC_PLLM_DIV_27
  3093. * @arg @ref LL_RCC_PLLM_DIV_28
  3094. * @arg @ref LL_RCC_PLLM_DIV_29
  3095. * @arg @ref LL_RCC_PLLM_DIV_30
  3096. * @arg @ref LL_RCC_PLLM_DIV_31
  3097. * @arg @ref LL_RCC_PLLM_DIV_32
  3098. * @arg @ref LL_RCC_PLLM_DIV_33
  3099. * @arg @ref LL_RCC_PLLM_DIV_34
  3100. * @arg @ref LL_RCC_PLLM_DIV_35
  3101. * @arg @ref LL_RCC_PLLM_DIV_36
  3102. * @arg @ref LL_RCC_PLLM_DIV_37
  3103. * @arg @ref LL_RCC_PLLM_DIV_38
  3104. * @arg @ref LL_RCC_PLLM_DIV_39
  3105. * @arg @ref LL_RCC_PLLM_DIV_40
  3106. * @arg @ref LL_RCC_PLLM_DIV_41
  3107. * @arg @ref LL_RCC_PLLM_DIV_42
  3108. * @arg @ref LL_RCC_PLLM_DIV_43
  3109. * @arg @ref LL_RCC_PLLM_DIV_44
  3110. * @arg @ref LL_RCC_PLLM_DIV_45
  3111. * @arg @ref LL_RCC_PLLM_DIV_46
  3112. * @arg @ref LL_RCC_PLLM_DIV_47
  3113. * @arg @ref LL_RCC_PLLM_DIV_48
  3114. * @arg @ref LL_RCC_PLLM_DIV_49
  3115. * @arg @ref LL_RCC_PLLM_DIV_50
  3116. * @arg @ref LL_RCC_PLLM_DIV_51
  3117. * @arg @ref LL_RCC_PLLM_DIV_52
  3118. * @arg @ref LL_RCC_PLLM_DIV_53
  3119. * @arg @ref LL_RCC_PLLM_DIV_54
  3120. * @arg @ref LL_RCC_PLLM_DIV_55
  3121. * @arg @ref LL_RCC_PLLM_DIV_56
  3122. * @arg @ref LL_RCC_PLLM_DIV_57
  3123. * @arg @ref LL_RCC_PLLM_DIV_58
  3124. * @arg @ref LL_RCC_PLLM_DIV_59
  3125. * @arg @ref LL_RCC_PLLM_DIV_60
  3126. * @arg @ref LL_RCC_PLLM_DIV_61
  3127. * @arg @ref LL_RCC_PLLM_DIV_62
  3128. * @arg @ref LL_RCC_PLLM_DIV_63
  3129. * @param PLLN Between 50 and 432
  3130. * @param PLLQ This parameter can be one of the following values:
  3131. * @arg @ref LL_RCC_PLLQ_DIV_2
  3132. * @arg @ref LL_RCC_PLLQ_DIV_3
  3133. * @arg @ref LL_RCC_PLLQ_DIV_4
  3134. * @arg @ref LL_RCC_PLLQ_DIV_5
  3135. * @arg @ref LL_RCC_PLLQ_DIV_6
  3136. * @arg @ref LL_RCC_PLLQ_DIV_7
  3137. * @arg @ref LL_RCC_PLLQ_DIV_8
  3138. * @arg @ref LL_RCC_PLLQ_DIV_9
  3139. * @arg @ref LL_RCC_PLLQ_DIV_10
  3140. * @arg @ref LL_RCC_PLLQ_DIV_11
  3141. * @arg @ref LL_RCC_PLLQ_DIV_12
  3142. * @arg @ref LL_RCC_PLLQ_DIV_13
  3143. * @arg @ref LL_RCC_PLLQ_DIV_14
  3144. * @arg @ref LL_RCC_PLLQ_DIV_15
  3145. * @retval None
  3146. */
  3147. __STATIC_INLINE void LL_RCC_PLL_ConfigDomain_48M(uint32_t Source, uint32_t PLLM, uint32_t PLLN, uint32_t PLLQ)
  3148. {
  3149. MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC | RCC_PLLCFGR_PLLM | RCC_PLLCFGR_PLLN | RCC_PLLCFGR_PLLQ,
  3150. Source | PLLM | PLLN << RCC_PLLCFGR_PLLN_Pos | PLLQ);
  3151. }
  3152. #if defined(DSI)
  3153. /**
  3154. * @brief Configure PLL used for DSI clock
  3155. * @note PLL Source and PLLM Divider can be written only when PLL,
  3156. * PLLI2S and PLLSAI are disabled
  3157. * @note PLLN/PLLR can be written only when PLL is disabled
  3158. * @note This can be selected for DSI
  3159. * @rmtoll PLLCFGR PLLSRC LL_RCC_PLL_ConfigDomain_DSI\n
  3160. * PLLCFGR PLLM LL_RCC_PLL_ConfigDomain_DSI\n
  3161. * PLLCFGR PLLN LL_RCC_PLL_ConfigDomain_DSI\n
  3162. * PLLCFGR PLLR LL_RCC_PLL_ConfigDomain_DSI
  3163. * @param Source This parameter can be one of the following values:
  3164. * @arg @ref LL_RCC_PLLSOURCE_HSI
  3165. * @arg @ref LL_RCC_PLLSOURCE_HSE
  3166. * @param PLLM This parameter can be one of the following values:
  3167. * @arg @ref LL_RCC_PLLM_DIV_2
  3168. * @arg @ref LL_RCC_PLLM_DIV_3
  3169. * @arg @ref LL_RCC_PLLM_DIV_4
  3170. * @arg @ref LL_RCC_PLLM_DIV_5
  3171. * @arg @ref LL_RCC_PLLM_DIV_6
  3172. * @arg @ref LL_RCC_PLLM_DIV_7
  3173. * @arg @ref LL_RCC_PLLM_DIV_8
  3174. * @arg @ref LL_RCC_PLLM_DIV_9
  3175. * @arg @ref LL_RCC_PLLM_DIV_10
  3176. * @arg @ref LL_RCC_PLLM_DIV_11
  3177. * @arg @ref LL_RCC_PLLM_DIV_12
  3178. * @arg @ref LL_RCC_PLLM_DIV_13
  3179. * @arg @ref LL_RCC_PLLM_DIV_14
  3180. * @arg @ref LL_RCC_PLLM_DIV_15
  3181. * @arg @ref LL_RCC_PLLM_DIV_16
  3182. * @arg @ref LL_RCC_PLLM_DIV_17
  3183. * @arg @ref LL_RCC_PLLM_DIV_18
  3184. * @arg @ref LL_RCC_PLLM_DIV_19
  3185. * @arg @ref LL_RCC_PLLM_DIV_20
  3186. * @arg @ref LL_RCC_PLLM_DIV_21
  3187. * @arg @ref LL_RCC_PLLM_DIV_22
  3188. * @arg @ref LL_RCC_PLLM_DIV_23
  3189. * @arg @ref LL_RCC_PLLM_DIV_24
  3190. * @arg @ref LL_RCC_PLLM_DIV_25
  3191. * @arg @ref LL_RCC_PLLM_DIV_26
  3192. * @arg @ref LL_RCC_PLLM_DIV_27
  3193. * @arg @ref LL_RCC_PLLM_DIV_28
  3194. * @arg @ref LL_RCC_PLLM_DIV_29
  3195. * @arg @ref LL_RCC_PLLM_DIV_30
  3196. * @arg @ref LL_RCC_PLLM_DIV_31
  3197. * @arg @ref LL_RCC_PLLM_DIV_32
  3198. * @arg @ref LL_RCC_PLLM_DIV_33
  3199. * @arg @ref LL_RCC_PLLM_DIV_34
  3200. * @arg @ref LL_RCC_PLLM_DIV_35
  3201. * @arg @ref LL_RCC_PLLM_DIV_36
  3202. * @arg @ref LL_RCC_PLLM_DIV_37
  3203. * @arg @ref LL_RCC_PLLM_DIV_38
  3204. * @arg @ref LL_RCC_PLLM_DIV_39
  3205. * @arg @ref LL_RCC_PLLM_DIV_40
  3206. * @arg @ref LL_RCC_PLLM_DIV_41
  3207. * @arg @ref LL_RCC_PLLM_DIV_42
  3208. * @arg @ref LL_RCC_PLLM_DIV_43
  3209. * @arg @ref LL_RCC_PLLM_DIV_44
  3210. * @arg @ref LL_RCC_PLLM_DIV_45
  3211. * @arg @ref LL_RCC_PLLM_DIV_46
  3212. * @arg @ref LL_RCC_PLLM_DIV_47
  3213. * @arg @ref LL_RCC_PLLM_DIV_48
  3214. * @arg @ref LL_RCC_PLLM_DIV_49
  3215. * @arg @ref LL_RCC_PLLM_DIV_50
  3216. * @arg @ref LL_RCC_PLLM_DIV_51
  3217. * @arg @ref LL_RCC_PLLM_DIV_52
  3218. * @arg @ref LL_RCC_PLLM_DIV_53
  3219. * @arg @ref LL_RCC_PLLM_DIV_54
  3220. * @arg @ref LL_RCC_PLLM_DIV_55
  3221. * @arg @ref LL_RCC_PLLM_DIV_56
  3222. * @arg @ref LL_RCC_PLLM_DIV_57
  3223. * @arg @ref LL_RCC_PLLM_DIV_58
  3224. * @arg @ref LL_RCC_PLLM_DIV_59
  3225. * @arg @ref LL_RCC_PLLM_DIV_60
  3226. * @arg @ref LL_RCC_PLLM_DIV_61
  3227. * @arg @ref LL_RCC_PLLM_DIV_62
  3228. * @arg @ref LL_RCC_PLLM_DIV_63
  3229. * @param PLLN Between 50 and 432
  3230. * @param PLLR This parameter can be one of the following values:
  3231. * @arg @ref LL_RCC_PLLR_DIV_2
  3232. * @arg @ref LL_RCC_PLLR_DIV_3
  3233. * @arg @ref LL_RCC_PLLR_DIV_4
  3234. * @arg @ref LL_RCC_PLLR_DIV_5
  3235. * @arg @ref LL_RCC_PLLR_DIV_6
  3236. * @arg @ref LL_RCC_PLLR_DIV_7
  3237. * @retval None
  3238. */
  3239. __STATIC_INLINE void LL_RCC_PLL_ConfigDomain_DSI(uint32_t Source, uint32_t PLLM, uint32_t PLLN, uint32_t PLLR)
  3240. {
  3241. MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC | RCC_PLLCFGR_PLLM | RCC_PLLCFGR_PLLN | RCC_PLLCFGR_PLLR,
  3242. Source | PLLM | PLLN << RCC_PLLCFGR_PLLN_Pos | PLLR);
  3243. }
  3244. #endif /* DSI */
  3245. /**
  3246. * @brief Configure PLL clock source
  3247. * @rmtoll PLLCFGR PLLSRC LL_RCC_PLL_SetMainSource
  3248. * @param PLLSource This parameter can be one of the following values:
  3249. * @arg @ref LL_RCC_PLLSOURCE_HSI
  3250. * @arg @ref LL_RCC_PLLSOURCE_HSE
  3251. * @retval None
  3252. */
  3253. __STATIC_INLINE void LL_RCC_PLL_SetMainSource(uint32_t PLLSource)
  3254. {
  3255. MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC, PLLSource);
  3256. }
  3257. /**
  3258. * @brief Get the oscillator used as PLL clock source.
  3259. * @rmtoll PLLCFGR PLLSRC LL_RCC_PLL_GetMainSource
  3260. * @retval Returned value can be one of the following values:
  3261. * @arg @ref LL_RCC_PLLSOURCE_HSI
  3262. * @arg @ref LL_RCC_PLLSOURCE_HSE
  3263. */
  3264. __STATIC_INLINE uint32_t LL_RCC_PLL_GetMainSource(void)
  3265. {
  3266. return (uint32_t)(READ_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC));
  3267. }
  3268. /**
  3269. * @brief Get Main PLL multiplication factor for VCO
  3270. * @rmtoll PLLCFGR PLLN LL_RCC_PLL_GetN
  3271. * @retval Between 50 and 432
  3272. */
  3273. __STATIC_INLINE uint32_t LL_RCC_PLL_GetN(void)
  3274. {
  3275. return (uint32_t)(READ_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLN) >> RCC_PLLCFGR_PLLN_Pos);
  3276. }
  3277. /**
  3278. * @brief Get Main PLL division factor for PLLP
  3279. * @rmtoll PLLCFGR PLLP LL_RCC_PLL_GetP
  3280. * @retval Returned value can be one of the following values:
  3281. * @arg @ref LL_RCC_PLLP_DIV_2
  3282. * @arg @ref LL_RCC_PLLP_DIV_4
  3283. * @arg @ref LL_RCC_PLLP_DIV_6
  3284. * @arg @ref LL_RCC_PLLP_DIV_8
  3285. */
  3286. __STATIC_INLINE uint32_t LL_RCC_PLL_GetP(void)
  3287. {
  3288. return (uint32_t)(READ_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLP));
  3289. }
  3290. /**
  3291. * @brief Get Main PLL division factor for PLLQ
  3292. * @note used for PLL48MCLK selected for USB, RNG, SDMMC (48 MHz clock)
  3293. * @rmtoll PLLCFGR PLLQ LL_RCC_PLL_GetQ
  3294. * @retval Returned value can be one of the following values:
  3295. * @arg @ref LL_RCC_PLLQ_DIV_2
  3296. * @arg @ref LL_RCC_PLLQ_DIV_3
  3297. * @arg @ref LL_RCC_PLLQ_DIV_4
  3298. * @arg @ref LL_RCC_PLLQ_DIV_5
  3299. * @arg @ref LL_RCC_PLLQ_DIV_6
  3300. * @arg @ref LL_RCC_PLLQ_DIV_7
  3301. * @arg @ref LL_RCC_PLLQ_DIV_8
  3302. * @arg @ref LL_RCC_PLLQ_DIV_9
  3303. * @arg @ref LL_RCC_PLLQ_DIV_10
  3304. * @arg @ref LL_RCC_PLLQ_DIV_11
  3305. * @arg @ref LL_RCC_PLLQ_DIV_12
  3306. * @arg @ref LL_RCC_PLLQ_DIV_13
  3307. * @arg @ref LL_RCC_PLLQ_DIV_14
  3308. * @arg @ref LL_RCC_PLLQ_DIV_15
  3309. */
  3310. __STATIC_INLINE uint32_t LL_RCC_PLL_GetQ(void)
  3311. {
  3312. return (uint32_t)(READ_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLQ));
  3313. }
  3314. #if defined(RCC_PLLCFGR_PLLR)
  3315. /**
  3316. * @brief Get Main PLL division factor for PLLR
  3317. * @note used for PLLCLK (system clock)
  3318. * @rmtoll PLLCFGR PLLR LL_RCC_PLL_GetR
  3319. * @retval Returned value can be one of the following values:
  3320. * @arg @ref LL_RCC_PLLR_DIV_2
  3321. * @arg @ref LL_RCC_PLLR_DIV_3
  3322. * @arg @ref LL_RCC_PLLR_DIV_4
  3323. * @arg @ref LL_RCC_PLLR_DIV_5
  3324. * @arg @ref LL_RCC_PLLR_DIV_6
  3325. * @arg @ref LL_RCC_PLLR_DIV_7
  3326. */
  3327. __STATIC_INLINE uint32_t LL_RCC_PLL_GetR(void)
  3328. {
  3329. return (uint32_t)(READ_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLR));
  3330. }
  3331. #endif /* RCC_PLLCFGR_PLLR */
  3332. /**
  3333. * @brief Get Division factor for the main PLL and other PLL
  3334. * @rmtoll PLLCFGR PLLM LL_RCC_PLL_GetDivider
  3335. * @retval Returned value can be one of the following values:
  3336. * @arg @ref LL_RCC_PLLM_DIV_2
  3337. * @arg @ref LL_RCC_PLLM_DIV_3
  3338. * @arg @ref LL_RCC_PLLM_DIV_4
  3339. * @arg @ref LL_RCC_PLLM_DIV_5
  3340. * @arg @ref LL_RCC_PLLM_DIV_6
  3341. * @arg @ref LL_RCC_PLLM_DIV_7
  3342. * @arg @ref LL_RCC_PLLM_DIV_8
  3343. * @arg @ref LL_RCC_PLLM_DIV_9
  3344. * @arg @ref LL_RCC_PLLM_DIV_10
  3345. * @arg @ref LL_RCC_PLLM_DIV_11
  3346. * @arg @ref LL_RCC_PLLM_DIV_12
  3347. * @arg @ref LL_RCC_PLLM_DIV_13
  3348. * @arg @ref LL_RCC_PLLM_DIV_14
  3349. * @arg @ref LL_RCC_PLLM_DIV_15
  3350. * @arg @ref LL_RCC_PLLM_DIV_16
  3351. * @arg @ref LL_RCC_PLLM_DIV_17
  3352. * @arg @ref LL_RCC_PLLM_DIV_18
  3353. * @arg @ref LL_RCC_PLLM_DIV_19
  3354. * @arg @ref LL_RCC_PLLM_DIV_20
  3355. * @arg @ref LL_RCC_PLLM_DIV_21
  3356. * @arg @ref LL_RCC_PLLM_DIV_22
  3357. * @arg @ref LL_RCC_PLLM_DIV_23
  3358. * @arg @ref LL_RCC_PLLM_DIV_24
  3359. * @arg @ref LL_RCC_PLLM_DIV_25
  3360. * @arg @ref LL_RCC_PLLM_DIV_26
  3361. * @arg @ref LL_RCC_PLLM_DIV_27
  3362. * @arg @ref LL_RCC_PLLM_DIV_28
  3363. * @arg @ref LL_RCC_PLLM_DIV_29
  3364. * @arg @ref LL_RCC_PLLM_DIV_30
  3365. * @arg @ref LL_RCC_PLLM_DIV_31
  3366. * @arg @ref LL_RCC_PLLM_DIV_32
  3367. * @arg @ref LL_RCC_PLLM_DIV_33
  3368. * @arg @ref LL_RCC_PLLM_DIV_34
  3369. * @arg @ref LL_RCC_PLLM_DIV_35
  3370. * @arg @ref LL_RCC_PLLM_DIV_36
  3371. * @arg @ref LL_RCC_PLLM_DIV_37
  3372. * @arg @ref LL_RCC_PLLM_DIV_38
  3373. * @arg @ref LL_RCC_PLLM_DIV_39
  3374. * @arg @ref LL_RCC_PLLM_DIV_40
  3375. * @arg @ref LL_RCC_PLLM_DIV_41
  3376. * @arg @ref LL_RCC_PLLM_DIV_42
  3377. * @arg @ref LL_RCC_PLLM_DIV_43
  3378. * @arg @ref LL_RCC_PLLM_DIV_44
  3379. * @arg @ref LL_RCC_PLLM_DIV_45
  3380. * @arg @ref LL_RCC_PLLM_DIV_46
  3381. * @arg @ref LL_RCC_PLLM_DIV_47
  3382. * @arg @ref LL_RCC_PLLM_DIV_48
  3383. * @arg @ref LL_RCC_PLLM_DIV_49
  3384. * @arg @ref LL_RCC_PLLM_DIV_50
  3385. * @arg @ref LL_RCC_PLLM_DIV_51
  3386. * @arg @ref LL_RCC_PLLM_DIV_52
  3387. * @arg @ref LL_RCC_PLLM_DIV_53
  3388. * @arg @ref LL_RCC_PLLM_DIV_54
  3389. * @arg @ref LL_RCC_PLLM_DIV_55
  3390. * @arg @ref LL_RCC_PLLM_DIV_56
  3391. * @arg @ref LL_RCC_PLLM_DIV_57
  3392. * @arg @ref LL_RCC_PLLM_DIV_58
  3393. * @arg @ref LL_RCC_PLLM_DIV_59
  3394. * @arg @ref LL_RCC_PLLM_DIV_60
  3395. * @arg @ref LL_RCC_PLLM_DIV_61
  3396. * @arg @ref LL_RCC_PLLM_DIV_62
  3397. * @arg @ref LL_RCC_PLLM_DIV_63
  3398. */
  3399. __STATIC_INLINE uint32_t LL_RCC_PLL_GetDivider(void)
  3400. {
  3401. return (uint32_t)(READ_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLM));
  3402. }
  3403. /**
  3404. * @brief Configure Spread Spectrum used for PLL
  3405. * @note These bits must be written before enabling PLL
  3406. * @rmtoll SSCGR MODPER LL_RCC_PLL_ConfigSpreadSpectrum\n
  3407. * SSCGR INCSTEP LL_RCC_PLL_ConfigSpreadSpectrum\n
  3408. * SSCGR SPREADSEL LL_RCC_PLL_ConfigSpreadSpectrum
  3409. * @param Mod Between Min_Data=0 and Max_Data=8191
  3410. * @param Inc Between Min_Data=0 and Max_Data=32767
  3411. * @param Sel This parameter can be one of the following values:
  3412. * @arg @ref LL_RCC_SPREAD_SELECT_CENTER
  3413. * @arg @ref LL_RCC_SPREAD_SELECT_DOWN
  3414. * @retval None
  3415. */
  3416. __STATIC_INLINE void LL_RCC_PLL_ConfigSpreadSpectrum(uint32_t Mod, uint32_t Inc, uint32_t Sel)
  3417. {
  3418. MODIFY_REG(RCC->SSCGR, RCC_SSCGR_MODPER | RCC_SSCGR_INCSTEP | RCC_SSCGR_SPREADSEL, Mod | (Inc << RCC_SSCGR_INCSTEP_Pos) | Sel);
  3419. }
  3420. /**
  3421. * @brief Get Spread Spectrum Modulation Period for PLL
  3422. * @rmtoll SSCGR MODPER LL_RCC_PLL_GetPeriodModulation
  3423. * @retval Between Min_Data=0 and Max_Data=8191
  3424. */
  3425. __STATIC_INLINE uint32_t LL_RCC_PLL_GetPeriodModulation(void)
  3426. {
  3427. return (uint32_t)(READ_BIT(RCC->SSCGR, RCC_SSCGR_MODPER));
  3428. }
  3429. /**
  3430. * @brief Get Spread Spectrum Incrementation Step for PLL
  3431. * @note Must be written before enabling PLL
  3432. * @rmtoll SSCGR INCSTEP LL_RCC_PLL_GetStepIncrementation
  3433. * @retval Between Min_Data=0 and Max_Data=32767
  3434. */
  3435. __STATIC_INLINE uint32_t LL_RCC_PLL_GetStepIncrementation(void)
  3436. {
  3437. return (uint32_t)(READ_BIT(RCC->SSCGR, RCC_SSCGR_INCSTEP) >> RCC_SSCGR_INCSTEP_Pos);
  3438. }
  3439. /**
  3440. * @brief Get Spread Spectrum Selection for PLL
  3441. * @note Must be written before enabling PLL
  3442. * @rmtoll SSCGR SPREADSEL LL_RCC_PLL_GetSpreadSelection
  3443. * @retval Returned value can be one of the following values:
  3444. * @arg @ref LL_RCC_SPREAD_SELECT_CENTER
  3445. * @arg @ref LL_RCC_SPREAD_SELECT_DOWN
  3446. */
  3447. __STATIC_INLINE uint32_t LL_RCC_PLL_GetSpreadSelection(void)
  3448. {
  3449. return (uint32_t)(READ_BIT(RCC->SSCGR, RCC_SSCGR_SPREADSEL));
  3450. }
  3451. /**
  3452. * @brief Enable Spread Spectrum for PLL.
  3453. * @rmtoll SSCGR SSCGEN LL_RCC_PLL_SpreadSpectrum_Enable
  3454. * @retval None
  3455. */
  3456. __STATIC_INLINE void LL_RCC_PLL_SpreadSpectrum_Enable(void)
  3457. {
  3458. SET_BIT(RCC->SSCGR, RCC_SSCGR_SSCGEN);
  3459. }
  3460. /**
  3461. * @brief Disable Spread Spectrum for PLL.
  3462. * @rmtoll SSCGR SSCGEN LL_RCC_PLL_SpreadSpectrum_Disable
  3463. * @retval None
  3464. */
  3465. __STATIC_INLINE void LL_RCC_PLL_SpreadSpectrum_Disable(void)
  3466. {
  3467. CLEAR_BIT(RCC->SSCGR, RCC_SSCGR_SSCGEN);
  3468. }
  3469. /**
  3470. * @}
  3471. */
  3472. /** @defgroup RCC_LL_EF_PLLI2S PLLI2S
  3473. * @{
  3474. */
  3475. /**
  3476. * @brief Enable PLLI2S
  3477. * @rmtoll CR PLLI2SON LL_RCC_PLLI2S_Enable
  3478. * @retval None
  3479. */
  3480. __STATIC_INLINE void LL_RCC_PLLI2S_Enable(void)
  3481. {
  3482. SET_BIT(RCC->CR, RCC_CR_PLLI2SON);
  3483. }
  3484. /**
  3485. * @brief Disable PLLI2S
  3486. * @rmtoll CR PLLI2SON LL_RCC_PLLI2S_Disable
  3487. * @retval None
  3488. */
  3489. __STATIC_INLINE void LL_RCC_PLLI2S_Disable(void)
  3490. {
  3491. CLEAR_BIT(RCC->CR, RCC_CR_PLLI2SON);
  3492. }
  3493. /**
  3494. * @brief Check if PLLI2S Ready
  3495. * @rmtoll CR PLLI2SRDY LL_RCC_PLLI2S_IsReady
  3496. * @retval State of bit (1 or 0).
  3497. */
  3498. __STATIC_INLINE uint32_t LL_RCC_PLLI2S_IsReady(void)
  3499. {
  3500. return (READ_BIT(RCC->CR, RCC_CR_PLLI2SRDY) == (RCC_CR_PLLI2SRDY));
  3501. }
  3502. /**
  3503. * @brief Configure PLLI2S used for SAI1 and SAI2 domain clock
  3504. * @note PLL Source and PLLM Divider can be written only when PLL,
  3505. * PLLI2S and PLLSAI are disabled
  3506. * @note PLLN/PLLQ can be written only when PLLI2S is disabled
  3507. * @note This can be selected for SAI1 and SAI2
  3508. * @rmtoll PLLCFGR PLLSRC LL_RCC_PLLI2S_ConfigDomain_SAI\n
  3509. * PLLCFGR PLLM LL_RCC_PLLI2S_ConfigDomain_SAI\n
  3510. * PLLI2SCFGR PLLI2SN LL_RCC_PLLI2S_ConfigDomain_SAI\n
  3511. * PLLI2SCFGR PLLI2SQ LL_RCC_PLLI2S_ConfigDomain_SAI\n
  3512. * DCKCFGR1 PLLI2SDIVQ LL_RCC_PLLI2S_ConfigDomain_SAI
  3513. * @param Source This parameter can be one of the following values:
  3514. * @arg @ref LL_RCC_PLLSOURCE_HSI
  3515. * @arg @ref LL_RCC_PLLSOURCE_HSE
  3516. * @param PLLM This parameter can be one of the following values:
  3517. * @arg @ref LL_RCC_PLLM_DIV_2
  3518. * @arg @ref LL_RCC_PLLM_DIV_3
  3519. * @arg @ref LL_RCC_PLLM_DIV_4
  3520. * @arg @ref LL_RCC_PLLM_DIV_5
  3521. * @arg @ref LL_RCC_PLLM_DIV_6
  3522. * @arg @ref LL_RCC_PLLM_DIV_7
  3523. * @arg @ref LL_RCC_PLLM_DIV_8
  3524. * @arg @ref LL_RCC_PLLM_DIV_9
  3525. * @arg @ref LL_RCC_PLLM_DIV_10
  3526. * @arg @ref LL_RCC_PLLM_DIV_11
  3527. * @arg @ref LL_RCC_PLLM_DIV_12
  3528. * @arg @ref LL_RCC_PLLM_DIV_13
  3529. * @arg @ref LL_RCC_PLLM_DIV_14
  3530. * @arg @ref LL_RCC_PLLM_DIV_15
  3531. * @arg @ref LL_RCC_PLLM_DIV_16
  3532. * @arg @ref LL_RCC_PLLM_DIV_17
  3533. * @arg @ref LL_RCC_PLLM_DIV_18
  3534. * @arg @ref LL_RCC_PLLM_DIV_19
  3535. * @arg @ref LL_RCC_PLLM_DIV_20
  3536. * @arg @ref LL_RCC_PLLM_DIV_21
  3537. * @arg @ref LL_RCC_PLLM_DIV_22
  3538. * @arg @ref LL_RCC_PLLM_DIV_23
  3539. * @arg @ref LL_RCC_PLLM_DIV_24
  3540. * @arg @ref LL_RCC_PLLM_DIV_25
  3541. * @arg @ref LL_RCC_PLLM_DIV_26
  3542. * @arg @ref LL_RCC_PLLM_DIV_27
  3543. * @arg @ref LL_RCC_PLLM_DIV_28
  3544. * @arg @ref LL_RCC_PLLM_DIV_29
  3545. * @arg @ref LL_RCC_PLLM_DIV_30
  3546. * @arg @ref LL_RCC_PLLM_DIV_31
  3547. * @arg @ref LL_RCC_PLLM_DIV_32
  3548. * @arg @ref LL_RCC_PLLM_DIV_33
  3549. * @arg @ref LL_RCC_PLLM_DIV_34
  3550. * @arg @ref LL_RCC_PLLM_DIV_35
  3551. * @arg @ref LL_RCC_PLLM_DIV_36
  3552. * @arg @ref LL_RCC_PLLM_DIV_37
  3553. * @arg @ref LL_RCC_PLLM_DIV_38
  3554. * @arg @ref LL_RCC_PLLM_DIV_39
  3555. * @arg @ref LL_RCC_PLLM_DIV_40
  3556. * @arg @ref LL_RCC_PLLM_DIV_41
  3557. * @arg @ref LL_RCC_PLLM_DIV_42
  3558. * @arg @ref LL_RCC_PLLM_DIV_43
  3559. * @arg @ref LL_RCC_PLLM_DIV_44
  3560. * @arg @ref LL_RCC_PLLM_DIV_45
  3561. * @arg @ref LL_RCC_PLLM_DIV_46
  3562. * @arg @ref LL_RCC_PLLM_DIV_47
  3563. * @arg @ref LL_RCC_PLLM_DIV_48
  3564. * @arg @ref LL_RCC_PLLM_DIV_49
  3565. * @arg @ref LL_RCC_PLLM_DIV_50
  3566. * @arg @ref LL_RCC_PLLM_DIV_51
  3567. * @arg @ref LL_RCC_PLLM_DIV_52
  3568. * @arg @ref LL_RCC_PLLM_DIV_53
  3569. * @arg @ref LL_RCC_PLLM_DIV_54
  3570. * @arg @ref LL_RCC_PLLM_DIV_55
  3571. * @arg @ref LL_RCC_PLLM_DIV_56
  3572. * @arg @ref LL_RCC_PLLM_DIV_57
  3573. * @arg @ref LL_RCC_PLLM_DIV_58
  3574. * @arg @ref LL_RCC_PLLM_DIV_59
  3575. * @arg @ref LL_RCC_PLLM_DIV_60
  3576. * @arg @ref LL_RCC_PLLM_DIV_61
  3577. * @arg @ref LL_RCC_PLLM_DIV_62
  3578. * @arg @ref LL_RCC_PLLM_DIV_63
  3579. * @param PLLN Between 50 and 432
  3580. * @param PLLQ This parameter can be one of the following values:
  3581. * @arg @ref LL_RCC_PLLI2SQ_DIV_2
  3582. * @arg @ref LL_RCC_PLLI2SQ_DIV_3
  3583. * @arg @ref LL_RCC_PLLI2SQ_DIV_4
  3584. * @arg @ref LL_RCC_PLLI2SQ_DIV_5
  3585. * @arg @ref LL_RCC_PLLI2SQ_DIV_6
  3586. * @arg @ref LL_RCC_PLLI2SQ_DIV_7
  3587. * @arg @ref LL_RCC_PLLI2SQ_DIV_8
  3588. * @arg @ref LL_RCC_PLLI2SQ_DIV_9
  3589. * @arg @ref LL_RCC_PLLI2SQ_DIV_10
  3590. * @arg @ref LL_RCC_PLLI2SQ_DIV_11
  3591. * @arg @ref LL_RCC_PLLI2SQ_DIV_12
  3592. * @arg @ref LL_RCC_PLLI2SQ_DIV_13
  3593. * @arg @ref LL_RCC_PLLI2SQ_DIV_14
  3594. * @arg @ref LL_RCC_PLLI2SQ_DIV_15
  3595. * @param PLLDIVQ This parameter can be one of the following values:
  3596. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_1
  3597. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_2
  3598. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_3
  3599. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_4
  3600. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_5
  3601. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_6
  3602. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_7
  3603. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_8
  3604. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_9
  3605. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_10
  3606. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_11
  3607. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_12
  3608. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_13
  3609. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_14
  3610. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_15
  3611. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_16
  3612. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_17
  3613. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_18
  3614. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_19
  3615. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_20
  3616. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_21
  3617. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_22
  3618. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_23
  3619. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_24
  3620. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_25
  3621. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_26
  3622. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_27
  3623. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_28
  3624. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_29
  3625. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_30
  3626. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_31
  3627. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_32
  3628. * @retval None
  3629. */
  3630. __STATIC_INLINE void LL_RCC_PLLI2S_ConfigDomain_SAI(uint32_t Source, uint32_t PLLM, uint32_t PLLN, uint32_t PLLQ, uint32_t PLLDIVQ)
  3631. {
  3632. MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC | RCC_PLLCFGR_PLLM, Source | PLLM);
  3633. MODIFY_REG(RCC->PLLI2SCFGR, RCC_PLLI2SCFGR_PLLI2SN | RCC_PLLI2SCFGR_PLLI2SQ, PLLN << RCC_PLLI2SCFGR_PLLI2SN_Pos | PLLQ);
  3634. MODIFY_REG(RCC->DCKCFGR1, RCC_DCKCFGR1_PLLI2SDIVQ, PLLDIVQ);
  3635. }
  3636. #if defined(SPDIFRX)
  3637. /**
  3638. * @brief Configure PLLI2S used for SPDIFRX domain clock
  3639. * @note PLL Source and PLLM Divider can be written only when PLL,
  3640. * PLLI2S and PLLSAI are disabled
  3641. * @note PLLN/PLLP can be written only when PLLI2S is disabled
  3642. * @note This can be selected for SPDIFRX
  3643. * @rmtoll PLLCFGR PLLSRC LL_RCC_PLLI2S_ConfigDomain_SPDIFRX\n
  3644. * PLLCFGR PLLM LL_RCC_PLLI2S_ConfigDomain_SPDIFRX\n
  3645. * PLLI2SCFGR PLLI2SN LL_RCC_PLLI2S_ConfigDomain_SPDIFRX\n
  3646. * PLLI2SCFGR PLLI2SP LL_RCC_PLLI2S_ConfigDomain_SPDIFRX
  3647. * @param Source This parameter can be one of the following values:
  3648. * @arg @ref LL_RCC_PLLSOURCE_HSI
  3649. * @arg @ref LL_RCC_PLLSOURCE_HSE
  3650. * @param PLLM This parameter can be one of the following values:
  3651. * @arg @ref LL_RCC_PLLM_DIV_2
  3652. * @arg @ref LL_RCC_PLLM_DIV_3
  3653. * @arg @ref LL_RCC_PLLM_DIV_4
  3654. * @arg @ref LL_RCC_PLLM_DIV_5
  3655. * @arg @ref LL_RCC_PLLM_DIV_6
  3656. * @arg @ref LL_RCC_PLLM_DIV_7
  3657. * @arg @ref LL_RCC_PLLM_DIV_8
  3658. * @arg @ref LL_RCC_PLLM_DIV_9
  3659. * @arg @ref LL_RCC_PLLM_DIV_10
  3660. * @arg @ref LL_RCC_PLLM_DIV_11
  3661. * @arg @ref LL_RCC_PLLM_DIV_12
  3662. * @arg @ref LL_RCC_PLLM_DIV_13
  3663. * @arg @ref LL_RCC_PLLM_DIV_14
  3664. * @arg @ref LL_RCC_PLLM_DIV_15
  3665. * @arg @ref LL_RCC_PLLM_DIV_16
  3666. * @arg @ref LL_RCC_PLLM_DIV_17
  3667. * @arg @ref LL_RCC_PLLM_DIV_18
  3668. * @arg @ref LL_RCC_PLLM_DIV_19
  3669. * @arg @ref LL_RCC_PLLM_DIV_20
  3670. * @arg @ref LL_RCC_PLLM_DIV_21
  3671. * @arg @ref LL_RCC_PLLM_DIV_22
  3672. * @arg @ref LL_RCC_PLLM_DIV_23
  3673. * @arg @ref LL_RCC_PLLM_DIV_24
  3674. * @arg @ref LL_RCC_PLLM_DIV_25
  3675. * @arg @ref LL_RCC_PLLM_DIV_26
  3676. * @arg @ref LL_RCC_PLLM_DIV_27
  3677. * @arg @ref LL_RCC_PLLM_DIV_28
  3678. * @arg @ref LL_RCC_PLLM_DIV_29
  3679. * @arg @ref LL_RCC_PLLM_DIV_30
  3680. * @arg @ref LL_RCC_PLLM_DIV_31
  3681. * @arg @ref LL_RCC_PLLM_DIV_32
  3682. * @arg @ref LL_RCC_PLLM_DIV_33
  3683. * @arg @ref LL_RCC_PLLM_DIV_34
  3684. * @arg @ref LL_RCC_PLLM_DIV_35
  3685. * @arg @ref LL_RCC_PLLM_DIV_36
  3686. * @arg @ref LL_RCC_PLLM_DIV_37
  3687. * @arg @ref LL_RCC_PLLM_DIV_38
  3688. * @arg @ref LL_RCC_PLLM_DIV_39
  3689. * @arg @ref LL_RCC_PLLM_DIV_40
  3690. * @arg @ref LL_RCC_PLLM_DIV_41
  3691. * @arg @ref LL_RCC_PLLM_DIV_42
  3692. * @arg @ref LL_RCC_PLLM_DIV_43
  3693. * @arg @ref LL_RCC_PLLM_DIV_44
  3694. * @arg @ref LL_RCC_PLLM_DIV_45
  3695. * @arg @ref LL_RCC_PLLM_DIV_46
  3696. * @arg @ref LL_RCC_PLLM_DIV_47
  3697. * @arg @ref LL_RCC_PLLM_DIV_48
  3698. * @arg @ref LL_RCC_PLLM_DIV_49
  3699. * @arg @ref LL_RCC_PLLM_DIV_50
  3700. * @arg @ref LL_RCC_PLLM_DIV_51
  3701. * @arg @ref LL_RCC_PLLM_DIV_52
  3702. * @arg @ref LL_RCC_PLLM_DIV_53
  3703. * @arg @ref LL_RCC_PLLM_DIV_54
  3704. * @arg @ref LL_RCC_PLLM_DIV_55
  3705. * @arg @ref LL_RCC_PLLM_DIV_56
  3706. * @arg @ref LL_RCC_PLLM_DIV_57
  3707. * @arg @ref LL_RCC_PLLM_DIV_58
  3708. * @arg @ref LL_RCC_PLLM_DIV_59
  3709. * @arg @ref LL_RCC_PLLM_DIV_60
  3710. * @arg @ref LL_RCC_PLLM_DIV_61
  3711. * @arg @ref LL_RCC_PLLM_DIV_62
  3712. * @arg @ref LL_RCC_PLLM_DIV_63
  3713. * @param PLLN Between 50 and 432
  3714. * @param PLLP This parameter can be one of the following values:
  3715. * @arg @ref LL_RCC_PLLI2SP_DIV_2
  3716. * @arg @ref LL_RCC_PLLI2SP_DIV_4
  3717. * @arg @ref LL_RCC_PLLI2SP_DIV_6
  3718. * @arg @ref LL_RCC_PLLI2SP_DIV_8
  3719. * @retval None
  3720. */
  3721. __STATIC_INLINE void LL_RCC_PLLI2S_ConfigDomain_SPDIFRX(uint32_t Source, uint32_t PLLM, uint32_t PLLN, uint32_t PLLP)
  3722. {
  3723. MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC | RCC_PLLCFGR_PLLM, Source | PLLM);
  3724. MODIFY_REG(RCC->PLLI2SCFGR, RCC_PLLI2SCFGR_PLLI2SN | RCC_PLLI2SCFGR_PLLI2SP, PLLN << RCC_PLLI2SCFGR_PLLI2SN_Pos | PLLP);
  3725. }
  3726. #endif /* SPDIFRX */
  3727. /**
  3728. * @brief Configure PLLI2S used for I2S1 domain clock
  3729. * @note PLL Source and PLLM Divider can be written only when PLL,
  3730. * PLLI2S and PLLSAI are disabled
  3731. * @note PLLN/PLLR can be written only when PLLI2S is disabled
  3732. * @note This can be selected for I2S
  3733. * @rmtoll PLLCFGR PLLSRC LL_RCC_PLLI2S_ConfigDomain_I2S\n
  3734. * PLLCFGR PLLM LL_RCC_PLLI2S_ConfigDomain_I2S\n
  3735. * PLLI2SCFGR PLLI2SN LL_RCC_PLLI2S_ConfigDomain_I2S\n
  3736. * PLLI2SCFGR PLLI2SR LL_RCC_PLLI2S_ConfigDomain_I2S
  3737. * @param Source This parameter can be one of the following values:
  3738. * @arg @ref LL_RCC_PLLSOURCE_HSI
  3739. * @arg @ref LL_RCC_PLLSOURCE_HSE
  3740. * @param PLLM This parameter can be one of the following values:
  3741. * @arg @ref LL_RCC_PLLM_DIV_2
  3742. * @arg @ref LL_RCC_PLLM_DIV_3
  3743. * @arg @ref LL_RCC_PLLM_DIV_4
  3744. * @arg @ref LL_RCC_PLLM_DIV_5
  3745. * @arg @ref LL_RCC_PLLM_DIV_6
  3746. * @arg @ref LL_RCC_PLLM_DIV_7
  3747. * @arg @ref LL_RCC_PLLM_DIV_8
  3748. * @arg @ref LL_RCC_PLLM_DIV_9
  3749. * @arg @ref LL_RCC_PLLM_DIV_10
  3750. * @arg @ref LL_RCC_PLLM_DIV_11
  3751. * @arg @ref LL_RCC_PLLM_DIV_12
  3752. * @arg @ref LL_RCC_PLLM_DIV_13
  3753. * @arg @ref LL_RCC_PLLM_DIV_14
  3754. * @arg @ref LL_RCC_PLLM_DIV_15
  3755. * @arg @ref LL_RCC_PLLM_DIV_16
  3756. * @arg @ref LL_RCC_PLLM_DIV_17
  3757. * @arg @ref LL_RCC_PLLM_DIV_18
  3758. * @arg @ref LL_RCC_PLLM_DIV_19
  3759. * @arg @ref LL_RCC_PLLM_DIV_20
  3760. * @arg @ref LL_RCC_PLLM_DIV_21
  3761. * @arg @ref LL_RCC_PLLM_DIV_22
  3762. * @arg @ref LL_RCC_PLLM_DIV_23
  3763. * @arg @ref LL_RCC_PLLM_DIV_24
  3764. * @arg @ref LL_RCC_PLLM_DIV_25
  3765. * @arg @ref LL_RCC_PLLM_DIV_26
  3766. * @arg @ref LL_RCC_PLLM_DIV_27
  3767. * @arg @ref LL_RCC_PLLM_DIV_28
  3768. * @arg @ref LL_RCC_PLLM_DIV_29
  3769. * @arg @ref LL_RCC_PLLM_DIV_30
  3770. * @arg @ref LL_RCC_PLLM_DIV_31
  3771. * @arg @ref LL_RCC_PLLM_DIV_32
  3772. * @arg @ref LL_RCC_PLLM_DIV_33
  3773. * @arg @ref LL_RCC_PLLM_DIV_34
  3774. * @arg @ref LL_RCC_PLLM_DIV_35
  3775. * @arg @ref LL_RCC_PLLM_DIV_36
  3776. * @arg @ref LL_RCC_PLLM_DIV_37
  3777. * @arg @ref LL_RCC_PLLM_DIV_38
  3778. * @arg @ref LL_RCC_PLLM_DIV_39
  3779. * @arg @ref LL_RCC_PLLM_DIV_40
  3780. * @arg @ref LL_RCC_PLLM_DIV_41
  3781. * @arg @ref LL_RCC_PLLM_DIV_42
  3782. * @arg @ref LL_RCC_PLLM_DIV_43
  3783. * @arg @ref LL_RCC_PLLM_DIV_44
  3784. * @arg @ref LL_RCC_PLLM_DIV_45
  3785. * @arg @ref LL_RCC_PLLM_DIV_46
  3786. * @arg @ref LL_RCC_PLLM_DIV_47
  3787. * @arg @ref LL_RCC_PLLM_DIV_48
  3788. * @arg @ref LL_RCC_PLLM_DIV_49
  3789. * @arg @ref LL_RCC_PLLM_DIV_50
  3790. * @arg @ref LL_RCC_PLLM_DIV_51
  3791. * @arg @ref LL_RCC_PLLM_DIV_52
  3792. * @arg @ref LL_RCC_PLLM_DIV_53
  3793. * @arg @ref LL_RCC_PLLM_DIV_54
  3794. * @arg @ref LL_RCC_PLLM_DIV_55
  3795. * @arg @ref LL_RCC_PLLM_DIV_56
  3796. * @arg @ref LL_RCC_PLLM_DIV_57
  3797. * @arg @ref LL_RCC_PLLM_DIV_58
  3798. * @arg @ref LL_RCC_PLLM_DIV_59
  3799. * @arg @ref LL_RCC_PLLM_DIV_60
  3800. * @arg @ref LL_RCC_PLLM_DIV_61
  3801. * @arg @ref LL_RCC_PLLM_DIV_62
  3802. * @arg @ref LL_RCC_PLLM_DIV_63
  3803. * @param PLLN Between 50 and 432
  3804. * @param PLLR This parameter can be one of the following values:
  3805. * @arg @ref LL_RCC_PLLI2SR_DIV_2
  3806. * @arg @ref LL_RCC_PLLI2SR_DIV_3
  3807. * @arg @ref LL_RCC_PLLI2SR_DIV_4
  3808. * @arg @ref LL_RCC_PLLI2SR_DIV_5
  3809. * @arg @ref LL_RCC_PLLI2SR_DIV_6
  3810. * @arg @ref LL_RCC_PLLI2SR_DIV_7
  3811. * @retval None
  3812. */
  3813. __STATIC_INLINE void LL_RCC_PLLI2S_ConfigDomain_I2S(uint32_t Source, uint32_t PLLM, uint32_t PLLN, uint32_t PLLR)
  3814. {
  3815. MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC | RCC_PLLCFGR_PLLM, Source | PLLM);
  3816. MODIFY_REG(RCC->PLLI2SCFGR, RCC_PLLI2SCFGR_PLLI2SN | RCC_PLLI2SCFGR_PLLI2SR, PLLN << RCC_PLLI2SCFGR_PLLI2SN_Pos | PLLR);
  3817. }
  3818. /**
  3819. * @brief Get I2SPLL multiplication factor for VCO
  3820. * @rmtoll PLLI2SCFGR PLLI2SN LL_RCC_PLLI2S_GetN
  3821. * @retval Between 50 and 432
  3822. */
  3823. __STATIC_INLINE uint32_t LL_RCC_PLLI2S_GetN(void)
  3824. {
  3825. return (uint32_t)(READ_BIT(RCC->PLLI2SCFGR, RCC_PLLI2SCFGR_PLLI2SN) >> RCC_PLLI2SCFGR_PLLI2SN_Pos);
  3826. }
  3827. /**
  3828. * @brief Get I2SPLL division factor for PLLI2SQ
  3829. * @rmtoll PLLI2SCFGR PLLI2SQ LL_RCC_PLLI2S_GetQ
  3830. * @retval Returned value can be one of the following values:
  3831. * @arg @ref LL_RCC_PLLI2SQ_DIV_2
  3832. * @arg @ref LL_RCC_PLLI2SQ_DIV_3
  3833. * @arg @ref LL_RCC_PLLI2SQ_DIV_4
  3834. * @arg @ref LL_RCC_PLLI2SQ_DIV_5
  3835. * @arg @ref LL_RCC_PLLI2SQ_DIV_6
  3836. * @arg @ref LL_RCC_PLLI2SQ_DIV_7
  3837. * @arg @ref LL_RCC_PLLI2SQ_DIV_8
  3838. * @arg @ref LL_RCC_PLLI2SQ_DIV_9
  3839. * @arg @ref LL_RCC_PLLI2SQ_DIV_10
  3840. * @arg @ref LL_RCC_PLLI2SQ_DIV_11
  3841. * @arg @ref LL_RCC_PLLI2SQ_DIV_12
  3842. * @arg @ref LL_RCC_PLLI2SQ_DIV_13
  3843. * @arg @ref LL_RCC_PLLI2SQ_DIV_14
  3844. * @arg @ref LL_RCC_PLLI2SQ_DIV_15
  3845. */
  3846. __STATIC_INLINE uint32_t LL_RCC_PLLI2S_GetQ(void)
  3847. {
  3848. return (uint32_t)(READ_BIT(RCC->PLLI2SCFGR, RCC_PLLI2SCFGR_PLLI2SQ));
  3849. }
  3850. /**
  3851. * @brief Get I2SPLL division factor for PLLI2SR
  3852. * @note used for PLLI2SCLK (I2S clock)
  3853. * @rmtoll PLLI2SCFGR PLLI2SR LL_RCC_PLLI2S_GetR
  3854. * @retval Returned value can be one of the following values:
  3855. * @arg @ref LL_RCC_PLLI2SR_DIV_2
  3856. * @arg @ref LL_RCC_PLLI2SR_DIV_3
  3857. * @arg @ref LL_RCC_PLLI2SR_DIV_4
  3858. * @arg @ref LL_RCC_PLLI2SR_DIV_5
  3859. * @arg @ref LL_RCC_PLLI2SR_DIV_6
  3860. * @arg @ref LL_RCC_PLLI2SR_DIV_7
  3861. */
  3862. __STATIC_INLINE uint32_t LL_RCC_PLLI2S_GetR(void)
  3863. {
  3864. return (uint32_t)(READ_BIT(RCC->PLLI2SCFGR, RCC_PLLI2SCFGR_PLLI2SR));
  3865. }
  3866. #if defined(RCC_PLLI2SCFGR_PLLI2SP)
  3867. /**
  3868. * @brief Get I2SPLL division factor for PLLI2SP
  3869. * @note used for PLLSPDIFRXCLK (SPDIFRX clock)
  3870. * @rmtoll PLLI2SCFGR PLLI2SP LL_RCC_PLLI2S_GetP
  3871. * @retval Returned value can be one of the following values:
  3872. * @arg @ref LL_RCC_PLLI2SP_DIV_2
  3873. * @arg @ref LL_RCC_PLLI2SP_DIV_4
  3874. * @arg @ref LL_RCC_PLLI2SP_DIV_6
  3875. * @arg @ref LL_RCC_PLLI2SP_DIV_8
  3876. */
  3877. __STATIC_INLINE uint32_t LL_RCC_PLLI2S_GetP(void)
  3878. {
  3879. return (uint32_t)(READ_BIT(RCC->PLLI2SCFGR, RCC_PLLI2SCFGR_PLLI2SP));
  3880. }
  3881. #endif /* RCC_PLLI2SCFGR_PLLI2SP */
  3882. /**
  3883. * @brief Get I2SPLL division factor for PLLI2SDIVQ
  3884. * @note used PLLSAI1CLK, PLLSAI2CLK selected (SAI1 and SAI2 clock)
  3885. * @rmtoll DCKCFGR1 PLLI2SDIVQ LL_RCC_PLLI2S_GetDIVQ
  3886. * @retval Returned value can be one of the following values:
  3887. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_1
  3888. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_2
  3889. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_3
  3890. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_4
  3891. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_5
  3892. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_6
  3893. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_7
  3894. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_8
  3895. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_9
  3896. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_10
  3897. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_11
  3898. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_12
  3899. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_13
  3900. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_14
  3901. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_15
  3902. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_16
  3903. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_17
  3904. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_18
  3905. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_19
  3906. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_20
  3907. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_21
  3908. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_22
  3909. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_23
  3910. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_24
  3911. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_25
  3912. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_26
  3913. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_27
  3914. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_28
  3915. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_29
  3916. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_30
  3917. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_31
  3918. * @arg @ref LL_RCC_PLLI2SDIVQ_DIV_32
  3919. */
  3920. __STATIC_INLINE uint32_t LL_RCC_PLLI2S_GetDIVQ(void)
  3921. {
  3922. return (uint32_t)(READ_BIT(RCC->DCKCFGR1, RCC_DCKCFGR1_PLLI2SDIVQ));
  3923. }
  3924. /**
  3925. * @}
  3926. */
  3927. /** @defgroup RCC_LL_EF_PLLSAI PLLSAI
  3928. * @{
  3929. */
  3930. /**
  3931. * @brief Enable PLLSAI
  3932. * @rmtoll CR PLLSAION LL_RCC_PLLSAI_Enable
  3933. * @retval None
  3934. */
  3935. __STATIC_INLINE void LL_RCC_PLLSAI_Enable(void)
  3936. {
  3937. SET_BIT(RCC->CR, RCC_CR_PLLSAION);
  3938. }
  3939. /**
  3940. * @brief Disable PLLSAI
  3941. * @rmtoll CR PLLSAION LL_RCC_PLLSAI_Disable
  3942. * @retval None
  3943. */
  3944. __STATIC_INLINE void LL_RCC_PLLSAI_Disable(void)
  3945. {
  3946. CLEAR_BIT(RCC->CR, RCC_CR_PLLSAION);
  3947. }
  3948. /**
  3949. * @brief Check if PLLSAI Ready
  3950. * @rmtoll CR PLLSAIRDY LL_RCC_PLLSAI_IsReady
  3951. * @retval State of bit (1 or 0).
  3952. */
  3953. __STATIC_INLINE uint32_t LL_RCC_PLLSAI_IsReady(void)
  3954. {
  3955. return (READ_BIT(RCC->CR, RCC_CR_PLLSAIRDY) == (RCC_CR_PLLSAIRDY));
  3956. }
  3957. /**
  3958. * @brief Configure PLLSAI used for SAI1 and SAI2 domain clock
  3959. * @note PLL Source and PLLM Divider can be written only when PLL,
  3960. * PLLI2S and PLLSAI are disabled
  3961. * @note PLLN/PLLQ can be written only when PLLSAI is disabled
  3962. * @note This can be selected for SAI1 and SAI2
  3963. * @rmtoll PLLCFGR PLLSRC LL_RCC_PLLSAI_ConfigDomain_SAI\n
  3964. * PLLCFGR PLLM LL_RCC_PLLSAI_ConfigDomain_SAI\n
  3965. * PLLSAICFGR PLLSAIN LL_RCC_PLLSAI_ConfigDomain_SAI\n
  3966. * PLLSAICFGR PLLSAIQ LL_RCC_PLLSAI_ConfigDomain_SAI\n
  3967. * DCKCFGR1 PLLSAIDIVQ LL_RCC_PLLSAI_ConfigDomain_SAI
  3968. * @param Source This parameter can be one of the following values:
  3969. * @arg @ref LL_RCC_PLLSOURCE_HSI
  3970. * @arg @ref LL_RCC_PLLSOURCE_HSE
  3971. * @param PLLM This parameter can be one of the following values:
  3972. * @arg @ref LL_RCC_PLLM_DIV_2
  3973. * @arg @ref LL_RCC_PLLM_DIV_3
  3974. * @arg @ref LL_RCC_PLLM_DIV_4
  3975. * @arg @ref LL_RCC_PLLM_DIV_5
  3976. * @arg @ref LL_RCC_PLLM_DIV_6
  3977. * @arg @ref LL_RCC_PLLM_DIV_7
  3978. * @arg @ref LL_RCC_PLLM_DIV_8
  3979. * @arg @ref LL_RCC_PLLM_DIV_9
  3980. * @arg @ref LL_RCC_PLLM_DIV_10
  3981. * @arg @ref LL_RCC_PLLM_DIV_11
  3982. * @arg @ref LL_RCC_PLLM_DIV_12
  3983. * @arg @ref LL_RCC_PLLM_DIV_13
  3984. * @arg @ref LL_RCC_PLLM_DIV_14
  3985. * @arg @ref LL_RCC_PLLM_DIV_15
  3986. * @arg @ref LL_RCC_PLLM_DIV_16
  3987. * @arg @ref LL_RCC_PLLM_DIV_17
  3988. * @arg @ref LL_RCC_PLLM_DIV_18
  3989. * @arg @ref LL_RCC_PLLM_DIV_19
  3990. * @arg @ref LL_RCC_PLLM_DIV_20
  3991. * @arg @ref LL_RCC_PLLM_DIV_21
  3992. * @arg @ref LL_RCC_PLLM_DIV_22
  3993. * @arg @ref LL_RCC_PLLM_DIV_23
  3994. * @arg @ref LL_RCC_PLLM_DIV_24
  3995. * @arg @ref LL_RCC_PLLM_DIV_25
  3996. * @arg @ref LL_RCC_PLLM_DIV_26
  3997. * @arg @ref LL_RCC_PLLM_DIV_27
  3998. * @arg @ref LL_RCC_PLLM_DIV_28
  3999. * @arg @ref LL_RCC_PLLM_DIV_29
  4000. * @arg @ref LL_RCC_PLLM_DIV_30
  4001. * @arg @ref LL_RCC_PLLM_DIV_31
  4002. * @arg @ref LL_RCC_PLLM_DIV_32
  4003. * @arg @ref LL_RCC_PLLM_DIV_33
  4004. * @arg @ref LL_RCC_PLLM_DIV_34
  4005. * @arg @ref LL_RCC_PLLM_DIV_35
  4006. * @arg @ref LL_RCC_PLLM_DIV_36
  4007. * @arg @ref LL_RCC_PLLM_DIV_37
  4008. * @arg @ref LL_RCC_PLLM_DIV_38
  4009. * @arg @ref LL_RCC_PLLM_DIV_39
  4010. * @arg @ref LL_RCC_PLLM_DIV_40
  4011. * @arg @ref LL_RCC_PLLM_DIV_41
  4012. * @arg @ref LL_RCC_PLLM_DIV_42
  4013. * @arg @ref LL_RCC_PLLM_DIV_43
  4014. * @arg @ref LL_RCC_PLLM_DIV_44
  4015. * @arg @ref LL_RCC_PLLM_DIV_45
  4016. * @arg @ref LL_RCC_PLLM_DIV_46
  4017. * @arg @ref LL_RCC_PLLM_DIV_47
  4018. * @arg @ref LL_RCC_PLLM_DIV_48
  4019. * @arg @ref LL_RCC_PLLM_DIV_49
  4020. * @arg @ref LL_RCC_PLLM_DIV_50
  4021. * @arg @ref LL_RCC_PLLM_DIV_51
  4022. * @arg @ref LL_RCC_PLLM_DIV_52
  4023. * @arg @ref LL_RCC_PLLM_DIV_53
  4024. * @arg @ref LL_RCC_PLLM_DIV_54
  4025. * @arg @ref LL_RCC_PLLM_DIV_55
  4026. * @arg @ref LL_RCC_PLLM_DIV_56
  4027. * @arg @ref LL_RCC_PLLM_DIV_57
  4028. * @arg @ref LL_RCC_PLLM_DIV_58
  4029. * @arg @ref LL_RCC_PLLM_DIV_59
  4030. * @arg @ref LL_RCC_PLLM_DIV_60
  4031. * @arg @ref LL_RCC_PLLM_DIV_61
  4032. * @arg @ref LL_RCC_PLLM_DIV_62
  4033. * @arg @ref LL_RCC_PLLM_DIV_63
  4034. * @param PLLN Between 50 and 432
  4035. * @param PLLQ This parameter can be one of the following values:
  4036. * @arg @ref LL_RCC_PLLSAIQ_DIV_2
  4037. * @arg @ref LL_RCC_PLLSAIQ_DIV_3
  4038. * @arg @ref LL_RCC_PLLSAIQ_DIV_4
  4039. * @arg @ref LL_RCC_PLLSAIQ_DIV_5
  4040. * @arg @ref LL_RCC_PLLSAIQ_DIV_6
  4041. * @arg @ref LL_RCC_PLLSAIQ_DIV_7
  4042. * @arg @ref LL_RCC_PLLSAIQ_DIV_8
  4043. * @arg @ref LL_RCC_PLLSAIQ_DIV_9
  4044. * @arg @ref LL_RCC_PLLSAIQ_DIV_10
  4045. * @arg @ref LL_RCC_PLLSAIQ_DIV_11
  4046. * @arg @ref LL_RCC_PLLSAIQ_DIV_12
  4047. * @arg @ref LL_RCC_PLLSAIQ_DIV_13
  4048. * @arg @ref LL_RCC_PLLSAIQ_DIV_14
  4049. * @arg @ref LL_RCC_PLLSAIQ_DIV_15
  4050. * @param PLLDIVQ This parameter can be one of the following values:
  4051. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_1
  4052. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_2
  4053. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_3
  4054. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_4
  4055. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_5
  4056. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_6
  4057. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_7
  4058. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_8
  4059. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_9
  4060. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_10
  4061. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_11
  4062. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_12
  4063. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_13
  4064. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_14
  4065. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_15
  4066. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_16
  4067. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_17
  4068. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_18
  4069. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_19
  4070. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_20
  4071. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_21
  4072. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_22
  4073. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_23
  4074. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_24
  4075. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_25
  4076. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_26
  4077. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_27
  4078. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_28
  4079. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_29
  4080. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_30
  4081. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_31
  4082. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_32
  4083. * @retval None
  4084. */
  4085. __STATIC_INLINE void LL_RCC_PLLSAI_ConfigDomain_SAI(uint32_t Source, uint32_t PLLM, uint32_t PLLN, uint32_t PLLQ, uint32_t PLLDIVQ)
  4086. {
  4087. MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC | RCC_PLLCFGR_PLLM, Source | PLLM);
  4088. MODIFY_REG(RCC->PLLSAICFGR, RCC_PLLSAICFGR_PLLSAIN | RCC_PLLSAICFGR_PLLSAIQ, PLLN << RCC_PLLSAICFGR_PLLSAIN_Pos | PLLQ);
  4089. MODIFY_REG(RCC->DCKCFGR1, RCC_DCKCFGR1_PLLSAIDIVQ, PLLDIVQ);
  4090. }
  4091. /**
  4092. * @brief Configure PLLSAI used for 48Mhz domain clock
  4093. * @note PLL Source and PLLM Divider can be written only when PLL,
  4094. * PLLI2S and PLLSAI are disabled
  4095. * @note PLLN/PLLP can be written only when PLLSAI is disabled
  4096. * @note This can be selected for USB, RNG, SDMMC1
  4097. * @rmtoll PLLCFGR PLLSRC LL_RCC_PLLSAI_ConfigDomain_48M\n
  4098. * PLLCFGR PLLM LL_RCC_PLLSAI_ConfigDomain_48M\n
  4099. * PLLSAICFGR PLLSAIN LL_RCC_PLLSAI_ConfigDomain_48M\n
  4100. * PLLSAICFGR PLLSAIP LL_RCC_PLLSAI_ConfigDomain_48M
  4101. * @param Source This parameter can be one of the following values:
  4102. * @arg @ref LL_RCC_PLLSOURCE_HSI
  4103. * @arg @ref LL_RCC_PLLSOURCE_HSE
  4104. * @param PLLM This parameter can be one of the following values:
  4105. * @arg @ref LL_RCC_PLLM_DIV_2
  4106. * @arg @ref LL_RCC_PLLM_DIV_3
  4107. * @arg @ref LL_RCC_PLLM_DIV_4
  4108. * @arg @ref LL_RCC_PLLM_DIV_5
  4109. * @arg @ref LL_RCC_PLLM_DIV_6
  4110. * @arg @ref LL_RCC_PLLM_DIV_7
  4111. * @arg @ref LL_RCC_PLLM_DIV_8
  4112. * @arg @ref LL_RCC_PLLM_DIV_9
  4113. * @arg @ref LL_RCC_PLLM_DIV_10
  4114. * @arg @ref LL_RCC_PLLM_DIV_11
  4115. * @arg @ref LL_RCC_PLLM_DIV_12
  4116. * @arg @ref LL_RCC_PLLM_DIV_13
  4117. * @arg @ref LL_RCC_PLLM_DIV_14
  4118. * @arg @ref LL_RCC_PLLM_DIV_15
  4119. * @arg @ref LL_RCC_PLLM_DIV_16
  4120. * @arg @ref LL_RCC_PLLM_DIV_17
  4121. * @arg @ref LL_RCC_PLLM_DIV_18
  4122. * @arg @ref LL_RCC_PLLM_DIV_19
  4123. * @arg @ref LL_RCC_PLLM_DIV_20
  4124. * @arg @ref LL_RCC_PLLM_DIV_21
  4125. * @arg @ref LL_RCC_PLLM_DIV_22
  4126. * @arg @ref LL_RCC_PLLM_DIV_23
  4127. * @arg @ref LL_RCC_PLLM_DIV_24
  4128. * @arg @ref LL_RCC_PLLM_DIV_25
  4129. * @arg @ref LL_RCC_PLLM_DIV_26
  4130. * @arg @ref LL_RCC_PLLM_DIV_27
  4131. * @arg @ref LL_RCC_PLLM_DIV_28
  4132. * @arg @ref LL_RCC_PLLM_DIV_29
  4133. * @arg @ref LL_RCC_PLLM_DIV_30
  4134. * @arg @ref LL_RCC_PLLM_DIV_31
  4135. * @arg @ref LL_RCC_PLLM_DIV_32
  4136. * @arg @ref LL_RCC_PLLM_DIV_33
  4137. * @arg @ref LL_RCC_PLLM_DIV_34
  4138. * @arg @ref LL_RCC_PLLM_DIV_35
  4139. * @arg @ref LL_RCC_PLLM_DIV_36
  4140. * @arg @ref LL_RCC_PLLM_DIV_37
  4141. * @arg @ref LL_RCC_PLLM_DIV_38
  4142. * @arg @ref LL_RCC_PLLM_DIV_39
  4143. * @arg @ref LL_RCC_PLLM_DIV_40
  4144. * @arg @ref LL_RCC_PLLM_DIV_41
  4145. * @arg @ref LL_RCC_PLLM_DIV_42
  4146. * @arg @ref LL_RCC_PLLM_DIV_43
  4147. * @arg @ref LL_RCC_PLLM_DIV_44
  4148. * @arg @ref LL_RCC_PLLM_DIV_45
  4149. * @arg @ref LL_RCC_PLLM_DIV_46
  4150. * @arg @ref LL_RCC_PLLM_DIV_47
  4151. * @arg @ref LL_RCC_PLLM_DIV_48
  4152. * @arg @ref LL_RCC_PLLM_DIV_49
  4153. * @arg @ref LL_RCC_PLLM_DIV_50
  4154. * @arg @ref LL_RCC_PLLM_DIV_51
  4155. * @arg @ref LL_RCC_PLLM_DIV_52
  4156. * @arg @ref LL_RCC_PLLM_DIV_53
  4157. * @arg @ref LL_RCC_PLLM_DIV_54
  4158. * @arg @ref LL_RCC_PLLM_DIV_55
  4159. * @arg @ref LL_RCC_PLLM_DIV_56
  4160. * @arg @ref LL_RCC_PLLM_DIV_57
  4161. * @arg @ref LL_RCC_PLLM_DIV_58
  4162. * @arg @ref LL_RCC_PLLM_DIV_59
  4163. * @arg @ref LL_RCC_PLLM_DIV_60
  4164. * @arg @ref LL_RCC_PLLM_DIV_61
  4165. * @arg @ref LL_RCC_PLLM_DIV_62
  4166. * @arg @ref LL_RCC_PLLM_DIV_63
  4167. * @param PLLN Between 50 and 432
  4168. * @param PLLP This parameter can be one of the following values:
  4169. * @arg @ref LL_RCC_PLLSAIP_DIV_2
  4170. * @arg @ref LL_RCC_PLLSAIP_DIV_4
  4171. * @arg @ref LL_RCC_PLLSAIP_DIV_6
  4172. * @arg @ref LL_RCC_PLLSAIP_DIV_8
  4173. * @retval None
  4174. */
  4175. __STATIC_INLINE void LL_RCC_PLLSAI_ConfigDomain_48M(uint32_t Source, uint32_t PLLM, uint32_t PLLN, uint32_t PLLP)
  4176. {
  4177. MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC | RCC_PLLCFGR_PLLM, Source | PLLM);
  4178. MODIFY_REG(RCC->PLLSAICFGR, RCC_PLLSAICFGR_PLLSAIN | RCC_PLLSAICFGR_PLLSAIP, PLLN << RCC_PLLSAICFGR_PLLSAIN_Pos | PLLP);
  4179. }
  4180. #if defined(LTDC)
  4181. /**
  4182. * @brief Configure PLLSAI used for LTDC domain clock
  4183. * @note PLL Source and PLLM Divider can be written only when PLL,
  4184. * PLLI2S and PLLSAI are disabled
  4185. * @note PLLN/PLLR can be written only when PLLSAI is disabled
  4186. * @note This can be selected for LTDC
  4187. * @rmtoll PLLCFGR PLLSRC LL_RCC_PLLSAI_ConfigDomain_LTDC\n
  4188. * PLLCFGR PLLM LL_RCC_PLLSAI_ConfigDomain_LTDC\n
  4189. * PLLSAICFGR PLLSAIN LL_RCC_PLLSAI_ConfigDomain_LTDC\n
  4190. * PLLSAICFGR PLLSAIR LL_RCC_PLLSAI_ConfigDomain_LTDC\n
  4191. * DCKCFGR1 PLLSAIDIVR LL_RCC_PLLSAI_ConfigDomain_LTDC
  4192. * @param Source This parameter can be one of the following values:
  4193. * @arg @ref LL_RCC_PLLSOURCE_HSI
  4194. * @arg @ref LL_RCC_PLLSOURCE_HSE
  4195. * @param PLLM This parameter can be one of the following values:
  4196. * @arg @ref LL_RCC_PLLM_DIV_2
  4197. * @arg @ref LL_RCC_PLLM_DIV_3
  4198. * @arg @ref LL_RCC_PLLM_DIV_4
  4199. * @arg @ref LL_RCC_PLLM_DIV_5
  4200. * @arg @ref LL_RCC_PLLM_DIV_6
  4201. * @arg @ref LL_RCC_PLLM_DIV_7
  4202. * @arg @ref LL_RCC_PLLM_DIV_8
  4203. * @arg @ref LL_RCC_PLLM_DIV_9
  4204. * @arg @ref LL_RCC_PLLM_DIV_10
  4205. * @arg @ref LL_RCC_PLLM_DIV_11
  4206. * @arg @ref LL_RCC_PLLM_DIV_12
  4207. * @arg @ref LL_RCC_PLLM_DIV_13
  4208. * @arg @ref LL_RCC_PLLM_DIV_14
  4209. * @arg @ref LL_RCC_PLLM_DIV_15
  4210. * @arg @ref LL_RCC_PLLM_DIV_16
  4211. * @arg @ref LL_RCC_PLLM_DIV_17
  4212. * @arg @ref LL_RCC_PLLM_DIV_18
  4213. * @arg @ref LL_RCC_PLLM_DIV_19
  4214. * @arg @ref LL_RCC_PLLM_DIV_20
  4215. * @arg @ref LL_RCC_PLLM_DIV_21
  4216. * @arg @ref LL_RCC_PLLM_DIV_22
  4217. * @arg @ref LL_RCC_PLLM_DIV_23
  4218. * @arg @ref LL_RCC_PLLM_DIV_24
  4219. * @arg @ref LL_RCC_PLLM_DIV_25
  4220. * @arg @ref LL_RCC_PLLM_DIV_26
  4221. * @arg @ref LL_RCC_PLLM_DIV_27
  4222. * @arg @ref LL_RCC_PLLM_DIV_28
  4223. * @arg @ref LL_RCC_PLLM_DIV_29
  4224. * @arg @ref LL_RCC_PLLM_DIV_30
  4225. * @arg @ref LL_RCC_PLLM_DIV_31
  4226. * @arg @ref LL_RCC_PLLM_DIV_32
  4227. * @arg @ref LL_RCC_PLLM_DIV_33
  4228. * @arg @ref LL_RCC_PLLM_DIV_34
  4229. * @arg @ref LL_RCC_PLLM_DIV_35
  4230. * @arg @ref LL_RCC_PLLM_DIV_36
  4231. * @arg @ref LL_RCC_PLLM_DIV_37
  4232. * @arg @ref LL_RCC_PLLM_DIV_38
  4233. * @arg @ref LL_RCC_PLLM_DIV_39
  4234. * @arg @ref LL_RCC_PLLM_DIV_40
  4235. * @arg @ref LL_RCC_PLLM_DIV_41
  4236. * @arg @ref LL_RCC_PLLM_DIV_42
  4237. * @arg @ref LL_RCC_PLLM_DIV_43
  4238. * @arg @ref LL_RCC_PLLM_DIV_44
  4239. * @arg @ref LL_RCC_PLLM_DIV_45
  4240. * @arg @ref LL_RCC_PLLM_DIV_46
  4241. * @arg @ref LL_RCC_PLLM_DIV_47
  4242. * @arg @ref LL_RCC_PLLM_DIV_48
  4243. * @arg @ref LL_RCC_PLLM_DIV_49
  4244. * @arg @ref LL_RCC_PLLM_DIV_50
  4245. * @arg @ref LL_RCC_PLLM_DIV_51
  4246. * @arg @ref LL_RCC_PLLM_DIV_52
  4247. * @arg @ref LL_RCC_PLLM_DIV_53
  4248. * @arg @ref LL_RCC_PLLM_DIV_54
  4249. * @arg @ref LL_RCC_PLLM_DIV_55
  4250. * @arg @ref LL_RCC_PLLM_DIV_56
  4251. * @arg @ref LL_RCC_PLLM_DIV_57
  4252. * @arg @ref LL_RCC_PLLM_DIV_58
  4253. * @arg @ref LL_RCC_PLLM_DIV_59
  4254. * @arg @ref LL_RCC_PLLM_DIV_60
  4255. * @arg @ref LL_RCC_PLLM_DIV_61
  4256. * @arg @ref LL_RCC_PLLM_DIV_62
  4257. * @arg @ref LL_RCC_PLLM_DIV_63
  4258. * @param PLLN Between 50 and 432
  4259. * @param PLLR This parameter can be one of the following values:
  4260. * @arg @ref LL_RCC_PLLSAIR_DIV_2
  4261. * @arg @ref LL_RCC_PLLSAIR_DIV_3
  4262. * @arg @ref LL_RCC_PLLSAIR_DIV_4
  4263. * @arg @ref LL_RCC_PLLSAIR_DIV_5
  4264. * @arg @ref LL_RCC_PLLSAIR_DIV_6
  4265. * @arg @ref LL_RCC_PLLSAIR_DIV_7
  4266. * @param PLLDIVR This parameter can be one of the following values:
  4267. * @arg @ref LL_RCC_PLLSAIDIVR_DIV_2
  4268. * @arg @ref LL_RCC_PLLSAIDIVR_DIV_4
  4269. * @arg @ref LL_RCC_PLLSAIDIVR_DIV_8
  4270. * @arg @ref LL_RCC_PLLSAIDIVR_DIV_16
  4271. * @retval None
  4272. */
  4273. __STATIC_INLINE void LL_RCC_PLLSAI_ConfigDomain_LTDC(uint32_t Source, uint32_t PLLM, uint32_t PLLN, uint32_t PLLR, uint32_t PLLDIVR)
  4274. {
  4275. MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC | RCC_PLLCFGR_PLLM, Source | PLLM);
  4276. MODIFY_REG(RCC->PLLSAICFGR, RCC_PLLSAICFGR_PLLSAIN | RCC_PLLSAICFGR_PLLSAIR, PLLN << RCC_PLLSAICFGR_PLLSAIN_Pos | PLLR);
  4277. MODIFY_REG(RCC->DCKCFGR1, RCC_DCKCFGR1_PLLSAIDIVR, PLLDIVR);
  4278. }
  4279. #endif /* LTDC */
  4280. /**
  4281. * @brief Get SAIPLL multiplication factor for VCO
  4282. * @rmtoll PLLSAICFGR PLLSAIN LL_RCC_PLLSAI_GetN
  4283. * @retval Between 50 and 432
  4284. */
  4285. __STATIC_INLINE uint32_t LL_RCC_PLLSAI_GetN(void)
  4286. {
  4287. return (uint32_t)(READ_BIT(RCC->PLLSAICFGR, RCC_PLLSAICFGR_PLLSAIN) >> RCC_PLLSAICFGR_PLLSAIN_Pos);
  4288. }
  4289. /**
  4290. * @brief Get SAIPLL division factor for PLLSAIQ
  4291. * @rmtoll PLLSAICFGR PLLSAIQ LL_RCC_PLLSAI_GetQ
  4292. * @retval Returned value can be one of the following values:
  4293. * @arg @ref LL_RCC_PLLSAIQ_DIV_2
  4294. * @arg @ref LL_RCC_PLLSAIQ_DIV_3
  4295. * @arg @ref LL_RCC_PLLSAIQ_DIV_4
  4296. * @arg @ref LL_RCC_PLLSAIQ_DIV_5
  4297. * @arg @ref LL_RCC_PLLSAIQ_DIV_6
  4298. * @arg @ref LL_RCC_PLLSAIQ_DIV_7
  4299. * @arg @ref LL_RCC_PLLSAIQ_DIV_8
  4300. * @arg @ref LL_RCC_PLLSAIQ_DIV_9
  4301. * @arg @ref LL_RCC_PLLSAIQ_DIV_10
  4302. * @arg @ref LL_RCC_PLLSAIQ_DIV_11
  4303. * @arg @ref LL_RCC_PLLSAIQ_DIV_12
  4304. * @arg @ref LL_RCC_PLLSAIQ_DIV_13
  4305. * @arg @ref LL_RCC_PLLSAIQ_DIV_14
  4306. * @arg @ref LL_RCC_PLLSAIQ_DIV_15
  4307. */
  4308. __STATIC_INLINE uint32_t LL_RCC_PLLSAI_GetQ(void)
  4309. {
  4310. return (uint32_t)(READ_BIT(RCC->PLLSAICFGR, RCC_PLLSAICFGR_PLLSAIQ));
  4311. }
  4312. #if defined(RCC_PLLSAICFGR_PLLSAIR)
  4313. /**
  4314. * @brief Get SAIPLL division factor for PLLSAIR
  4315. * @note used for PLLSAICLK (SAI clock)
  4316. * @rmtoll PLLSAICFGR PLLSAIR LL_RCC_PLLSAI_GetR
  4317. * @retval Returned value can be one of the following values:
  4318. * @arg @ref LL_RCC_PLLSAIR_DIV_2
  4319. * @arg @ref LL_RCC_PLLSAIR_DIV_3
  4320. * @arg @ref LL_RCC_PLLSAIR_DIV_4
  4321. * @arg @ref LL_RCC_PLLSAIR_DIV_5
  4322. * @arg @ref LL_RCC_PLLSAIR_DIV_6
  4323. * @arg @ref LL_RCC_PLLSAIR_DIV_7
  4324. */
  4325. __STATIC_INLINE uint32_t LL_RCC_PLLSAI_GetR(void)
  4326. {
  4327. return (uint32_t)(READ_BIT(RCC->PLLSAICFGR, RCC_PLLSAICFGR_PLLSAIR));
  4328. }
  4329. #endif /* RCC_PLLSAICFGR_PLLSAIR */
  4330. /**
  4331. * @brief Get SAIPLL division factor for PLLSAIP
  4332. * @note used for PLL48MCLK (48M domain clock)
  4333. * @rmtoll PLLSAICFGR PLLSAIP LL_RCC_PLLSAI_GetP
  4334. * @retval Returned value can be one of the following values:
  4335. * @arg @ref LL_RCC_PLLSAIP_DIV_2
  4336. * @arg @ref LL_RCC_PLLSAIP_DIV_4
  4337. * @arg @ref LL_RCC_PLLSAIP_DIV_6
  4338. * @arg @ref LL_RCC_PLLSAIP_DIV_8
  4339. */
  4340. __STATIC_INLINE uint32_t LL_RCC_PLLSAI_GetP(void)
  4341. {
  4342. return (uint32_t)(READ_BIT(RCC->PLLSAICFGR, RCC_PLLSAICFGR_PLLSAIP));
  4343. }
  4344. /**
  4345. * @brief Get SAIPLL division factor for PLLSAIDIVQ
  4346. * @note used PLLSAI1CLK, PLLSAI2CLK selected (SAI1 and SAI2 clock)
  4347. * @rmtoll DCKCFGR1 PLLSAIDIVQ LL_RCC_PLLSAI_GetDIVQ
  4348. * @retval Returned value can be one of the following values:
  4349. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_1
  4350. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_2
  4351. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_3
  4352. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_4
  4353. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_5
  4354. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_6
  4355. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_7
  4356. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_8
  4357. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_9
  4358. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_10
  4359. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_11
  4360. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_12
  4361. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_13
  4362. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_14
  4363. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_15
  4364. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_16
  4365. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_17
  4366. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_18
  4367. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_19
  4368. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_20
  4369. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_21
  4370. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_22
  4371. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_23
  4372. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_24
  4373. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_25
  4374. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_26
  4375. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_27
  4376. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_28
  4377. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_29
  4378. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_30
  4379. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_31
  4380. * @arg @ref LL_RCC_PLLSAIDIVQ_DIV_32
  4381. */
  4382. __STATIC_INLINE uint32_t LL_RCC_PLLSAI_GetDIVQ(void)
  4383. {
  4384. return (uint32_t)(READ_BIT(RCC->DCKCFGR1, RCC_DCKCFGR1_PLLSAIDIVQ));
  4385. }
  4386. #if defined(RCC_DCKCFGR1_PLLSAIDIVR)
  4387. /**
  4388. * @brief Get SAIPLL division factor for PLLSAIDIVR
  4389. * @note used for LTDC domain clock
  4390. * @rmtoll DCKCFGR1 PLLSAIDIVR LL_RCC_PLLSAI_GetDIVR
  4391. * @retval Returned value can be one of the following values:
  4392. * @arg @ref LL_RCC_PLLSAIDIVR_DIV_2
  4393. * @arg @ref LL_RCC_PLLSAIDIVR_DIV_4
  4394. * @arg @ref LL_RCC_PLLSAIDIVR_DIV_8
  4395. * @arg @ref LL_RCC_PLLSAIDIVR_DIV_16
  4396. */
  4397. __STATIC_INLINE uint32_t LL_RCC_PLLSAI_GetDIVR(void)
  4398. {
  4399. return (uint32_t)(READ_BIT(RCC->DCKCFGR1, RCC_DCKCFGR1_PLLSAIDIVR));
  4400. }
  4401. #endif /* RCC_DCKCFGR1_PLLSAIDIVR */
  4402. /**
  4403. * @}
  4404. */
  4405. /** @defgroup RCC_LL_EF_FLAG_Management FLAG Management
  4406. * @{
  4407. */
  4408. /**
  4409. * @brief Clear LSI ready interrupt flag
  4410. * @rmtoll CIR LSIRDYC LL_RCC_ClearFlag_LSIRDY
  4411. * @retval None
  4412. */
  4413. __STATIC_INLINE void LL_RCC_ClearFlag_LSIRDY(void)
  4414. {
  4415. SET_BIT(RCC->CIR, RCC_CIR_LSIRDYC);
  4416. }
  4417. /**
  4418. * @brief Clear LSE ready interrupt flag
  4419. * @rmtoll CIR LSERDYC LL_RCC_ClearFlag_LSERDY
  4420. * @retval None
  4421. */
  4422. __STATIC_INLINE void LL_RCC_ClearFlag_LSERDY(void)
  4423. {
  4424. SET_BIT(RCC->CIR, RCC_CIR_LSERDYC);
  4425. }
  4426. /**
  4427. * @brief Clear HSI ready interrupt flag
  4428. * @rmtoll CIR HSIRDYC LL_RCC_ClearFlag_HSIRDY
  4429. * @retval None
  4430. */
  4431. __STATIC_INLINE void LL_RCC_ClearFlag_HSIRDY(void)
  4432. {
  4433. SET_BIT(RCC->CIR, RCC_CIR_HSIRDYC);
  4434. }
  4435. /**
  4436. * @brief Clear HSE ready interrupt flag
  4437. * @rmtoll CIR HSERDYC LL_RCC_ClearFlag_HSERDY
  4438. * @retval None
  4439. */
  4440. __STATIC_INLINE void LL_RCC_ClearFlag_HSERDY(void)
  4441. {
  4442. SET_BIT(RCC->CIR, RCC_CIR_HSERDYC);
  4443. }
  4444. /**
  4445. * @brief Clear PLL ready interrupt flag
  4446. * @rmtoll CIR PLLRDYC LL_RCC_ClearFlag_PLLRDY
  4447. * @retval None
  4448. */
  4449. __STATIC_INLINE void LL_RCC_ClearFlag_PLLRDY(void)
  4450. {
  4451. SET_BIT(RCC->CIR, RCC_CIR_PLLRDYC);
  4452. }
  4453. /**
  4454. * @brief Clear PLLI2S ready interrupt flag
  4455. * @rmtoll CIR PLLI2SRDYC LL_RCC_ClearFlag_PLLI2SRDY
  4456. * @retval None
  4457. */
  4458. __STATIC_INLINE void LL_RCC_ClearFlag_PLLI2SRDY(void)
  4459. {
  4460. SET_BIT(RCC->CIR, RCC_CIR_PLLI2SRDYC);
  4461. }
  4462. /**
  4463. * @brief Clear PLLSAI ready interrupt flag
  4464. * @rmtoll CIR PLLSAIRDYC LL_RCC_ClearFlag_PLLSAIRDY
  4465. * @retval None
  4466. */
  4467. __STATIC_INLINE void LL_RCC_ClearFlag_PLLSAIRDY(void)
  4468. {
  4469. SET_BIT(RCC->CIR, RCC_CIR_PLLSAIRDYC);
  4470. }
  4471. /**
  4472. * @brief Clear Clock security system interrupt flag
  4473. * @rmtoll CIR CSSC LL_RCC_ClearFlag_HSECSS
  4474. * @retval None
  4475. */
  4476. __STATIC_INLINE void LL_RCC_ClearFlag_HSECSS(void)
  4477. {
  4478. SET_BIT(RCC->CIR, RCC_CIR_CSSC);
  4479. }
  4480. /**
  4481. * @brief Check if LSI ready interrupt occurred or not
  4482. * @rmtoll CIR LSIRDYF LL_RCC_IsActiveFlag_LSIRDY
  4483. * @retval State of bit (1 or 0).
  4484. */
  4485. __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_LSIRDY(void)
  4486. {
  4487. return (READ_BIT(RCC->CIR, RCC_CIR_LSIRDYF) == (RCC_CIR_LSIRDYF));
  4488. }
  4489. /**
  4490. * @brief Check if LSE ready interrupt occurred or not
  4491. * @rmtoll CIR LSERDYF LL_RCC_IsActiveFlag_LSERDY
  4492. * @retval State of bit (1 or 0).
  4493. */
  4494. __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_LSERDY(void)
  4495. {
  4496. return (READ_BIT(RCC->CIR, RCC_CIR_LSERDYF) == (RCC_CIR_LSERDYF));
  4497. }
  4498. /**
  4499. * @brief Check if HSI ready interrupt occurred or not
  4500. * @rmtoll CIR HSIRDYF LL_RCC_IsActiveFlag_HSIRDY
  4501. * @retval State of bit (1 or 0).
  4502. */
  4503. __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_HSIRDY(void)
  4504. {
  4505. return (READ_BIT(RCC->CIR, RCC_CIR_HSIRDYF) == (RCC_CIR_HSIRDYF));
  4506. }
  4507. /**
  4508. * @brief Check if HSE ready interrupt occurred or not
  4509. * @rmtoll CIR HSERDYF LL_RCC_IsActiveFlag_HSERDY
  4510. * @retval State of bit (1 or 0).
  4511. */
  4512. __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_HSERDY(void)
  4513. {
  4514. return (READ_BIT(RCC->CIR, RCC_CIR_HSERDYF) == (RCC_CIR_HSERDYF));
  4515. }
  4516. /**
  4517. * @brief Check if PLL ready interrupt occurred or not
  4518. * @rmtoll CIR PLLRDYF LL_RCC_IsActiveFlag_PLLRDY
  4519. * @retval State of bit (1 or 0).
  4520. */
  4521. __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_PLLRDY(void)
  4522. {
  4523. return (READ_BIT(RCC->CIR, RCC_CIR_PLLRDYF) == (RCC_CIR_PLLRDYF));
  4524. }
  4525. /**
  4526. * @brief Check if PLLI2S ready interrupt occurred or not
  4527. * @rmtoll CIR PLLI2SRDYF LL_RCC_IsActiveFlag_PLLI2SRDY
  4528. * @retval State of bit (1 or 0).
  4529. */
  4530. __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_PLLI2SRDY(void)
  4531. {
  4532. return (READ_BIT(RCC->CIR, RCC_CIR_PLLI2SRDYF) == (RCC_CIR_PLLI2SRDYF));
  4533. }
  4534. /**
  4535. * @brief Check if PLLSAI ready interrupt occurred or not
  4536. * @rmtoll CIR PLLSAIRDYF LL_RCC_IsActiveFlag_PLLSAIRDY
  4537. * @retval State of bit (1 or 0).
  4538. */
  4539. __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_PLLSAIRDY(void)
  4540. {
  4541. return (READ_BIT(RCC->CIR, RCC_CIR_PLLSAIRDYF) == (RCC_CIR_PLLSAIRDYF));
  4542. }
  4543. /**
  4544. * @brief Check if Clock security system interrupt occurred or not
  4545. * @rmtoll CIR CSSF LL_RCC_IsActiveFlag_HSECSS
  4546. * @retval State of bit (1 or 0).
  4547. */
  4548. __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_HSECSS(void)
  4549. {
  4550. return (READ_BIT(RCC->CIR, RCC_CIR_CSSF) == (RCC_CIR_CSSF));
  4551. }
  4552. /**
  4553. * @brief Check if RCC flag Independent Watchdog reset is set or not.
  4554. * @rmtoll CSR IWDGRSTF LL_RCC_IsActiveFlag_IWDGRST
  4555. * @retval State of bit (1 or 0).
  4556. */
  4557. __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_IWDGRST(void)
  4558. {
  4559. return (READ_BIT(RCC->CSR, RCC_CSR_IWDGRSTF) == (RCC_CSR_IWDGRSTF));
  4560. }
  4561. /**
  4562. * @brief Check if RCC flag Low Power reset is set or not.
  4563. * @rmtoll CSR LPWRRSTF LL_RCC_IsActiveFlag_LPWRRST
  4564. * @retval State of bit (1 or 0).
  4565. */
  4566. __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_LPWRRST(void)
  4567. {
  4568. return (READ_BIT(RCC->CSR, RCC_CSR_LPWRRSTF) == (RCC_CSR_LPWRRSTF));
  4569. }
  4570. /**
  4571. * @brief Check if RCC flag Pin reset is set or not.
  4572. * @rmtoll CSR PINRSTF LL_RCC_IsActiveFlag_PINRST
  4573. * @retval State of bit (1 or 0).
  4574. */
  4575. __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_PINRST(void)
  4576. {
  4577. return (READ_BIT(RCC->CSR, RCC_CSR_PINRSTF) == (RCC_CSR_PINRSTF));
  4578. }
  4579. /**
  4580. * @brief Check if RCC flag POR/PDR reset is set or not.
  4581. * @rmtoll CSR PORRSTF LL_RCC_IsActiveFlag_PORRST
  4582. * @retval State of bit (1 or 0).
  4583. */
  4584. __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_PORRST(void)
  4585. {
  4586. return (READ_BIT(RCC->CSR, RCC_CSR_PORRSTF) == (RCC_CSR_PORRSTF));
  4587. }
  4588. /**
  4589. * @brief Check if RCC flag Software reset is set or not.
  4590. * @rmtoll CSR SFTRSTF LL_RCC_IsActiveFlag_SFTRST
  4591. * @retval State of bit (1 or 0).
  4592. */
  4593. __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_SFTRST(void)
  4594. {
  4595. return (READ_BIT(RCC->CSR, RCC_CSR_SFTRSTF) == (RCC_CSR_SFTRSTF));
  4596. }
  4597. /**
  4598. * @brief Check if RCC flag Window Watchdog reset is set or not.
  4599. * @rmtoll CSR WWDGRSTF LL_RCC_IsActiveFlag_WWDGRST
  4600. * @retval State of bit (1 or 0).
  4601. */
  4602. __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_WWDGRST(void)
  4603. {
  4604. return (READ_BIT(RCC->CSR, RCC_CSR_WWDGRSTF) == (RCC_CSR_WWDGRSTF));
  4605. }
  4606. /**
  4607. * @brief Check if RCC flag BOR reset is set or not.
  4608. * @rmtoll CSR BORRSTF LL_RCC_IsActiveFlag_BORRST
  4609. * @retval State of bit (1 or 0).
  4610. */
  4611. __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_BORRST(void)
  4612. {
  4613. return (READ_BIT(RCC->CSR, RCC_CSR_BORRSTF) == (RCC_CSR_BORRSTF));
  4614. }
  4615. /**
  4616. * @brief Set RMVF bit to clear the reset flags.
  4617. * @rmtoll CSR RMVF LL_RCC_ClearResetFlags
  4618. * @retval None
  4619. */
  4620. __STATIC_INLINE void LL_RCC_ClearResetFlags(void)
  4621. {
  4622. SET_BIT(RCC->CSR, RCC_CSR_RMVF);
  4623. }
  4624. /**
  4625. * @}
  4626. */
  4627. /** @defgroup RCC_LL_EF_IT_Management IT Management
  4628. * @{
  4629. */
  4630. /**
  4631. * @brief Enable LSI ready interrupt
  4632. * @rmtoll CIR LSIRDYIE LL_RCC_EnableIT_LSIRDY
  4633. * @retval None
  4634. */
  4635. __STATIC_INLINE void LL_RCC_EnableIT_LSIRDY(void)
  4636. {
  4637. SET_BIT(RCC->CIR, RCC_CIR_LSIRDYIE);
  4638. }
  4639. /**
  4640. * @brief Enable LSE ready interrupt
  4641. * @rmtoll CIR LSERDYIE LL_RCC_EnableIT_LSERDY
  4642. * @retval None
  4643. */
  4644. __STATIC_INLINE void LL_RCC_EnableIT_LSERDY(void)
  4645. {
  4646. SET_BIT(RCC->CIR, RCC_CIR_LSERDYIE);
  4647. }
  4648. /**
  4649. * @brief Enable HSI ready interrupt
  4650. * @rmtoll CIR HSIRDYIE LL_RCC_EnableIT_HSIRDY
  4651. * @retval None
  4652. */
  4653. __STATIC_INLINE void LL_RCC_EnableIT_HSIRDY(void)
  4654. {
  4655. SET_BIT(RCC->CIR, RCC_CIR_HSIRDYIE);
  4656. }
  4657. /**
  4658. * @brief Enable HSE ready interrupt
  4659. * @rmtoll CIR HSERDYIE LL_RCC_EnableIT_HSERDY
  4660. * @retval None
  4661. */
  4662. __STATIC_INLINE void LL_RCC_EnableIT_HSERDY(void)
  4663. {
  4664. SET_BIT(RCC->CIR, RCC_CIR_HSERDYIE);
  4665. }
  4666. /**
  4667. * @brief Enable PLL ready interrupt
  4668. * @rmtoll CIR PLLRDYIE LL_RCC_EnableIT_PLLRDY
  4669. * @retval None
  4670. */
  4671. __STATIC_INLINE void LL_RCC_EnableIT_PLLRDY(void)
  4672. {
  4673. SET_BIT(RCC->CIR, RCC_CIR_PLLRDYIE);
  4674. }
  4675. /**
  4676. * @brief Enable PLLI2S ready interrupt
  4677. * @rmtoll CIR PLLI2SRDYIE LL_RCC_EnableIT_PLLI2SRDY
  4678. * @retval None
  4679. */
  4680. __STATIC_INLINE void LL_RCC_EnableIT_PLLI2SRDY(void)
  4681. {
  4682. SET_BIT(RCC->CIR, RCC_CIR_PLLI2SRDYIE);
  4683. }
  4684. /**
  4685. * @brief Enable PLLSAI ready interrupt
  4686. * @rmtoll CIR PLLSAIRDYIE LL_RCC_EnableIT_PLLSAIRDY
  4687. * @retval None
  4688. */
  4689. __STATIC_INLINE void LL_RCC_EnableIT_PLLSAIRDY(void)
  4690. {
  4691. SET_BIT(RCC->CIR, RCC_CIR_PLLSAIRDYIE);
  4692. }
  4693. /**
  4694. * @brief Disable LSI ready interrupt
  4695. * @rmtoll CIR LSIRDYIE LL_RCC_DisableIT_LSIRDY
  4696. * @retval None
  4697. */
  4698. __STATIC_INLINE void LL_RCC_DisableIT_LSIRDY(void)
  4699. {
  4700. CLEAR_BIT(RCC->CIR, RCC_CIR_LSIRDYIE);
  4701. }
  4702. /**
  4703. * @brief Disable LSE ready interrupt
  4704. * @rmtoll CIR LSERDYIE LL_RCC_DisableIT_LSERDY
  4705. * @retval None
  4706. */
  4707. __STATIC_INLINE void LL_RCC_DisableIT_LSERDY(void)
  4708. {
  4709. CLEAR_BIT(RCC->CIR, RCC_CIR_LSERDYIE);
  4710. }
  4711. /**
  4712. * @brief Disable HSI ready interrupt
  4713. * @rmtoll CIR HSIRDYIE LL_RCC_DisableIT_HSIRDY
  4714. * @retval None
  4715. */
  4716. __STATIC_INLINE void LL_RCC_DisableIT_HSIRDY(void)
  4717. {
  4718. CLEAR_BIT(RCC->CIR, RCC_CIR_HSIRDYIE);
  4719. }
  4720. /**
  4721. * @brief Disable HSE ready interrupt
  4722. * @rmtoll CIR HSERDYIE LL_RCC_DisableIT_HSERDY
  4723. * @retval None
  4724. */
  4725. __STATIC_INLINE void LL_RCC_DisableIT_HSERDY(void)
  4726. {
  4727. CLEAR_BIT(RCC->CIR, RCC_CIR_HSERDYIE);
  4728. }
  4729. /**
  4730. * @brief Disable PLL ready interrupt
  4731. * @rmtoll CIR PLLRDYIE LL_RCC_DisableIT_PLLRDY
  4732. * @retval None
  4733. */
  4734. __STATIC_INLINE void LL_RCC_DisableIT_PLLRDY(void)
  4735. {
  4736. CLEAR_BIT(RCC->CIR, RCC_CIR_PLLRDYIE);
  4737. }
  4738. /**
  4739. * @brief Disable PLLI2S ready interrupt
  4740. * @rmtoll CIR PLLI2SRDYIE LL_RCC_DisableIT_PLLI2SRDY
  4741. * @retval None
  4742. */
  4743. __STATIC_INLINE void LL_RCC_DisableIT_PLLI2SRDY(void)
  4744. {
  4745. CLEAR_BIT(RCC->CIR, RCC_CIR_PLLI2SRDYIE);
  4746. }
  4747. /**
  4748. * @brief Disable PLLSAI ready interrupt
  4749. * @rmtoll CIR PLLSAIRDYIE LL_RCC_DisableIT_PLLSAIRDY
  4750. * @retval None
  4751. */
  4752. __STATIC_INLINE void LL_RCC_DisableIT_PLLSAIRDY(void)
  4753. {
  4754. CLEAR_BIT(RCC->CIR, RCC_CIR_PLLSAIRDYIE);
  4755. }
  4756. /**
  4757. * @brief Checks if LSI ready interrupt source is enabled or disabled.
  4758. * @rmtoll CIR LSIRDYIE LL_RCC_IsEnabledIT_LSIRDY
  4759. * @retval State of bit (1 or 0).
  4760. */
  4761. __STATIC_INLINE uint32_t LL_RCC_IsEnabledIT_LSIRDY(void)
  4762. {
  4763. return (READ_BIT(RCC->CIR, RCC_CIR_LSIRDYIE) == (RCC_CIR_LSIRDYIE));
  4764. }
  4765. /**
  4766. * @brief Checks if LSE ready interrupt source is enabled or disabled.
  4767. * @rmtoll CIR LSERDYIE LL_RCC_IsEnabledIT_LSERDY
  4768. * @retval State of bit (1 or 0).
  4769. */
  4770. __STATIC_INLINE uint32_t LL_RCC_IsEnabledIT_LSERDY(void)
  4771. {
  4772. return (READ_BIT(RCC->CIR, RCC_CIR_LSERDYIE) == (RCC_CIR_LSERDYIE));
  4773. }
  4774. /**
  4775. * @brief Checks if HSI ready interrupt source is enabled or disabled.
  4776. * @rmtoll CIR HSIRDYIE LL_RCC_IsEnabledIT_HSIRDY
  4777. * @retval State of bit (1 or 0).
  4778. */
  4779. __STATIC_INLINE uint32_t LL_RCC_IsEnabledIT_HSIRDY(void)
  4780. {
  4781. return (READ_BIT(RCC->CIR, RCC_CIR_HSIRDYIE) == (RCC_CIR_HSIRDYIE));
  4782. }
  4783. /**
  4784. * @brief Checks if HSE ready interrupt source is enabled or disabled.
  4785. * @rmtoll CIR HSERDYIE LL_RCC_IsEnabledIT_HSERDY
  4786. * @retval State of bit (1 or 0).
  4787. */
  4788. __STATIC_INLINE uint32_t LL_RCC_IsEnabledIT_HSERDY(void)
  4789. {
  4790. return (READ_BIT(RCC->CIR, RCC_CIR_HSERDYIE) == (RCC_CIR_HSERDYIE));
  4791. }
  4792. /**
  4793. * @brief Checks if PLL ready interrupt source is enabled or disabled.
  4794. * @rmtoll CIR PLLRDYIE LL_RCC_IsEnabledIT_PLLRDY
  4795. * @retval State of bit (1 or 0).
  4796. */
  4797. __STATIC_INLINE uint32_t LL_RCC_IsEnabledIT_PLLRDY(void)
  4798. {
  4799. return (READ_BIT(RCC->CIR, RCC_CIR_PLLRDYIE) == (RCC_CIR_PLLRDYIE));
  4800. }
  4801. /**
  4802. * @brief Checks if PLLI2S ready interrupt source is enabled or disabled.
  4803. * @rmtoll CIR PLLI2SRDYIE LL_RCC_IsEnabledIT_PLLI2SRDY
  4804. * @retval State of bit (1 or 0).
  4805. */
  4806. __STATIC_INLINE uint32_t LL_RCC_IsEnabledIT_PLLI2SRDY(void)
  4807. {
  4808. return (READ_BIT(RCC->CIR, RCC_CIR_PLLI2SRDYIE) == (RCC_CIR_PLLI2SRDYIE));
  4809. }
  4810. /**
  4811. * @brief Checks if PLLSAI ready interrupt source is enabled or disabled.
  4812. * @rmtoll CIR PLLSAIRDYIE LL_RCC_IsEnabledIT_PLLSAIRDY
  4813. * @retval State of bit (1 or 0).
  4814. */
  4815. __STATIC_INLINE uint32_t LL_RCC_IsEnabledIT_PLLSAIRDY(void)
  4816. {
  4817. return (READ_BIT(RCC->CIR, RCC_CIR_PLLSAIRDYIE) == (RCC_CIR_PLLSAIRDYIE));
  4818. }
  4819. /**
  4820. * @}
  4821. */
  4822. #if defined(USE_FULL_LL_DRIVER)
  4823. /** @defgroup RCC_LL_EF_Init De-initialization function
  4824. * @{
  4825. */
  4826. ErrorStatus LL_RCC_DeInit(void);
  4827. /**
  4828. * @}
  4829. */
  4830. /** @defgroup RCC_LL_EF_Get_Freq Get system and peripherals clocks frequency functions
  4831. * @{
  4832. */
  4833. void LL_RCC_GetSystemClocksFreq(LL_RCC_ClocksTypeDef *RCC_Clocks);
  4834. uint32_t LL_RCC_GetUSARTClockFreq(uint32_t USARTxSource);
  4835. uint32_t LL_RCC_GetUARTClockFreq(uint32_t UARTxSource);
  4836. uint32_t LL_RCC_GetI2CClockFreq(uint32_t I2CxSource);
  4837. uint32_t LL_RCC_GetLPTIMClockFreq(uint32_t LPTIMxSource);
  4838. uint32_t LL_RCC_GetSAIClockFreq(uint32_t SAIxSource);
  4839. uint32_t LL_RCC_GetSDMMCClockFreq(uint32_t SDMMCxSource);
  4840. uint32_t LL_RCC_GetRNGClockFreq(uint32_t RNGxSource);
  4841. uint32_t LL_RCC_GetUSBClockFreq(uint32_t USBxSource);
  4842. #if defined(DFSDM1_Channel0)
  4843. uint32_t LL_RCC_GetDFSDMClockFreq(uint32_t DFSDMxSource);
  4844. uint32_t LL_RCC_GetDFSDMAudioClockFreq(uint32_t DFSDMxSource);
  4845. #endif /* DFSDM1_Channel0 */
  4846. uint32_t LL_RCC_GetI2SClockFreq(uint32_t I2SxSource);
  4847. #if defined(CEC)
  4848. uint32_t LL_RCC_GetCECClockFreq(uint32_t CECxSource);
  4849. #endif /* CEC */
  4850. #if defined(LTDC)
  4851. uint32_t LL_RCC_GetLTDCClockFreq(uint32_t LTDCxSource);
  4852. #endif /* LTDC */
  4853. #if defined(SPDIFRX)
  4854. uint32_t LL_RCC_GetSPDIFRXClockFreq(uint32_t SPDIFRXxSource);
  4855. #endif /* SPDIFRX */
  4856. #if defined(DSI)
  4857. uint32_t LL_RCC_GetDSIClockFreq(uint32_t DSIxSource);
  4858. #endif /* DSI */
  4859. /**
  4860. * @}
  4861. */
  4862. #endif /* USE_FULL_LL_DRIVER */
  4863. /**
  4864. * @}
  4865. */
  4866. /**
  4867. * @}
  4868. */
  4869. #endif /* defined(RCC) */
  4870. /**
  4871. * @}
  4872. */
  4873. #ifdef __cplusplus
  4874. }
  4875. #endif
  4876. #endif /* __STM32F7xx_LL_RCC_H */