stm32h7xx_ll_system.h 97 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442
  1. /**
  2. ******************************************************************************
  3. * @file stm32h7xx_ll_system.h
  4. * @author MCD Application Team
  5. * @brief Header file of SYSTEM LL module.
  6. *
  7. ******************************************************************************
  8. * @attention
  9. *
  10. * Copyright (c) 2017 STMicroelectronics.
  11. * All rights reserved.
  12. *
  13. * This software is licensed under terms that can be found in the LICENSE file
  14. * in the root directory of this software component.
  15. * If no LICENSE file comes with this software, it is provided AS-IS.
  16. *
  17. ******************************************************************************
  18. @verbatim
  19. ==============================================================================
  20. ##### How to use this driver #####
  21. ==============================================================================
  22. [..]
  23. The LL SYSTEM driver contains a set of generic APIs that can be
  24. used by user:
  25. (+) Some of the FLASH features need to be handled in the SYSTEM file.
  26. (+) Access to DBGCMU registers
  27. (+) Access to SYSCFG registers
  28. @endverbatim
  29. ******************************************************************************
  30. */
  31. /* Define to prevent recursive inclusion -------------------------------------*/
  32. #ifndef __STM32H7xx_LL_SYSTEM_H
  33. #define __STM32H7xx_LL_SYSTEM_H
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37. /* Includes ------------------------------------------------------------------*/
  38. #include "stm32h7xx.h"
  39. /** @addtogroup STM32H7xx_LL_Driver
  40. * @{
  41. */
  42. #if defined (FLASH) || defined (SYSCFG) || defined (DBGMCU)
  43. /** @defgroup SYSTEM_LL SYSTEM
  44. * @{
  45. */
  46. /* Private types -------------------------------------------------------------*/
  47. /* Private variables ---------------------------------------------------------*/
  48. /* Private constants ---------------------------------------------------------*/
  49. /** @defgroup SYSTEM_LL_Private_Constants SYSTEM Private Constants
  50. * @{
  51. */
  52. /** @defgroup SYSTEM_LL_EC_FLASH_BANK1_SECTORS SYSCFG Flash Bank1 sectors bits status
  53. * @{
  54. */
  55. #define LL_SYSCFG_FLASH_B1_SECTOR0_STATUS_BIT 0x10000U
  56. #define LL_SYSCFG_FLASH_B1_SECTOR1_STATUS_BIT 0x20000U
  57. #define LL_SYSCFG_FLASH_B1_SECTOR2_STATUS_BIT 0x40000U
  58. #define LL_SYSCFG_FLASH_B1_SECTOR3_STATUS_BIT 0x80000U
  59. #define LL_SYSCFG_FLASH_B1_SECTOR4_STATUS_BIT 0x100000U
  60. #define LL_SYSCFG_FLASH_B1_SECTOR5_STATUS_BIT 0x200000U
  61. #define LL_SYSCFG_FLASH_B1_SECTOR6_STATUS_BIT 0x400000U
  62. #define LL_SYSCFG_FLASH_B1_SECTOR7_STATUS_BIT 0x800000U
  63. /**
  64. * @}
  65. */
  66. /** @defgroup SYSTEM_LL_EC_FLASH_BANK2_SECTORS SYSCFG Flash Bank2 sectors bits status
  67. * @{
  68. */
  69. #define LL_SYSCFG_FLASH_B2_SECTOR0_STATUS_BIT 0x10000U
  70. #define LL_SYSCFG_FLASH_B2_SECTOR1_STATUS_BIT 0x20000U
  71. #define LL_SYSCFG_FLASH_B2_SECTOR2_STATUS_BIT 0x40000U
  72. #define LL_SYSCFG_FLASH_B2_SECTOR3_STATUS_BIT 0x80000U
  73. #define LL_SYSCFG_FLASH_B2_SECTOR4_STATUS_BIT 0x100000U
  74. #define LL_SYSCFG_FLASH_B2_SECTOR5_STATUS_BIT 0x200000U
  75. #define LL_SYSCFG_FLASH_B2_SECTOR6_STATUS_BIT 0x400000U
  76. #define LL_SYSCFG_FLASH_B2_SECTOR7_STATUS_BIT 0x800000U
  77. /**
  78. * @}
  79. */
  80. /**
  81. * @}
  82. */
  83. /* Private macros ------------------------------------------------------------*/
  84. /* Exported types ------------------------------------------------------------*/
  85. /* Exported constants --------------------------------------------------------*/
  86. /** @defgroup SYSTEM_LL_Exported_Constants SYSTEM Exported Constants
  87. * @{
  88. */
  89. /** @defgroup SYSTEM_LL_EC_I2C_FASTMODEPLUS SYSCFG I2C FASTMODEPLUS
  90. * @{
  91. */
  92. #define LL_SYSCFG_I2C_FASTMODEPLUS_I2C1 SYSCFG_PMCR_I2C1_FMP /*!< Enable Fast Mode Plus for I2C1 */
  93. #define LL_SYSCFG_I2C_FASTMODEPLUS_I2C2 SYSCFG_PMCR_I2C2_FMP /*!< Enable Fast Mode Plus for I2C2 */
  94. #define LL_SYSCFG_I2C_FASTMODEPLUS_I2C3 SYSCFG_PMCR_I2C3_FMP /*!< Enable Fast Mode Plus for I2C3 */
  95. #define LL_SYSCFG_I2C_FASTMODEPLUS_I2C4 SYSCFG_PMCR_I2C4_FMP /*!< Enable Fast Mode Plus for I2C4 */
  96. #if defined(I2C5)
  97. #define LL_SYSCFG_I2C_FASTMODEPLUS_I2C5 SYSCFG_PMCR_I2C5_FMP /*!< Enable Fast Mode Plus for I2C5 */
  98. #endif /*I2C5*/
  99. #define LL_SYSCFG_I2C_FASTMODEPLUS_PB6 SYSCFG_PMCR_I2C_PB6_FMP /*!< Enable Fast Mode Plus on PB6 */
  100. #define LL_SYSCFG_I2C_FASTMODEPLUS_PB7 SYSCFG_PMCR_I2C_PB7_FMP /*!< Enable Fast Mode Plus on PB7 */
  101. #define LL_SYSCFG_I2C_FASTMODEPLUS_PB8 SYSCFG_PMCR_I2C_PB8_FMP /*!< Enable Fast Mode Plus on PB8 */
  102. #define LL_SYSCFG_I2C_FASTMODEPLUS_PB9 SYSCFG_PMCR_I2C_PB9_FMP /*!< Enable Fast Mode Plus on PB9 */
  103. /**
  104. * @}
  105. */
  106. /** @defgroup SYSTEM_LL_EC_ANALOG_SWITCH Analog Switch control
  107. * @{
  108. */
  109. #if defined(SYSCFG_PMCR_BOOSTEN)
  110. #define LL_SYSCFG_ANALOG_SWITCH_BOOSTEN SYSCFG_PMCR_BOOSTEN /*!< I/O analog switch voltage booster enable */
  111. #endif /*SYSCFG_PMCR_BOOSTEN*/
  112. #define LL_SYSCFG_ANALOG_SWITCH_PA0 SYSCFG_PMCR_PA0SO /*!< PA0 Switch Open */
  113. #define LL_SYSCFG_ANALOG_SWITCH_PA1 SYSCFG_PMCR_PA1SO /*!< PA1 Switch Open */
  114. #define LL_SYSCFG_ANALOG_SWITCH_PC2 SYSCFG_PMCR_PC2SO /*!< PC2 Switch Open */
  115. #define LL_SYSCFG_ANALOG_SWITCH_PC3 SYSCFG_PMCR_PC3SO /*!< PC3 Switch Open */
  116. /**
  117. * @}
  118. */
  119. #if defined(SYSCFG_PMCR_EPIS_SEL)
  120. /** @defgroup SYSTEM_LL_EC_EPIS Ethernet PHY Interface Selection
  121. * @{
  122. */
  123. #define LL_SYSCFG_ETH_MII 0x00000000U /*!< ETH Media MII interface */
  124. #define LL_SYSCFG_ETH_RMII SYSCFG_PMCR_EPIS_SEL_2 /*!< ETH Media RMII interface */
  125. /**
  126. * @}
  127. */
  128. #endif /* SYSCFG_PMCR_EPIS_SEL */
  129. /** @defgroup SYSTEM_LL_EC_EXTI_PORT SYSCFG EXTI PORT
  130. * @{
  131. */
  132. #define LL_SYSCFG_EXTI_PORTA 0U /*!< EXTI PORT A */
  133. #define LL_SYSCFG_EXTI_PORTB 1U /*!< EXTI PORT B */
  134. #define LL_SYSCFG_EXTI_PORTC 2U /*!< EXTI PORT C */
  135. #define LL_SYSCFG_EXTI_PORTD 3U /*!< EXTI PORT D */
  136. #define LL_SYSCFG_EXTI_PORTE 4U /*!< EXTI PORT E */
  137. #define LL_SYSCFG_EXTI_PORTF 5U /*!< EXTI PORT F */
  138. #define LL_SYSCFG_EXTI_PORTG 6U /*!< EXTI PORT G */
  139. #define LL_SYSCFG_EXTI_PORTH 7U /*!< EXTI PORT H */
  140. #if defined(GPIOI)
  141. #define LL_SYSCFG_EXTI_PORTI 8U /*!< EXTI PORT I */
  142. #endif /*GPIOI*/
  143. #define LL_SYSCFG_EXTI_PORTJ 9U /*!< EXTI PORT J */
  144. #define LL_SYSCFG_EXTI_PORTK 10U /*!< EXTI PORT k */
  145. /**
  146. * @}
  147. */
  148. /** @defgroup SYSTEM_LL_EC_EXTI_LINE SYSCFG EXTI LINE
  149. * @{
  150. */
  151. #define LL_SYSCFG_EXTI_LINE0 ((0x000FUL << 16U) | 0U) /*!< EXTI_POSITION_0 | EXTICR[0] */
  152. #define LL_SYSCFG_EXTI_LINE1 ((0x00F0UL << 16U) | 0U) /*!< EXTI_POSITION_4 | EXTICR[0] */
  153. #define LL_SYSCFG_EXTI_LINE2 ((0x0F00UL << 16U) | 0U) /*!< EXTI_POSITION_8 | EXTICR[0] */
  154. #define LL_SYSCFG_EXTI_LINE3 ((0xF000UL << 16U) | 0U) /*!< EXTI_POSITION_12 | EXTICR[0] */
  155. #define LL_SYSCFG_EXTI_LINE4 ((0x000FUL << 16U) | 1U) /*!< EXTI_POSITION_0 | EXTICR[1] */
  156. #define LL_SYSCFG_EXTI_LINE5 ((0x00F0UL << 16U) | 1U) /*!< EXTI_POSITION_4 | EXTICR[1] */
  157. #define LL_SYSCFG_EXTI_LINE6 ((0x0F00UL << 16U) | 1U) /*!< EXTI_POSITION_8 | EXTICR[1] */
  158. #define LL_SYSCFG_EXTI_LINE7 ((0xF000UL << 16U) | 1U) /*!< EXTI_POSITION_12 | EXTICR[1] */
  159. #define LL_SYSCFG_EXTI_LINE8 ((0x000FUL << 16U) | 2U) /*!< EXTI_POSITION_0 | EXTICR[2] */
  160. #define LL_SYSCFG_EXTI_LINE9 ((0x00F0UL << 16U) | 2U) /*!< EXTI_POSITION_4 | EXTICR[2] */
  161. #define LL_SYSCFG_EXTI_LINE10 ((0x0F00UL << 16U) | 2U) /*!< EXTI_POSITION_8 | EXTICR[2] */
  162. #define LL_SYSCFG_EXTI_LINE11 ((0xF000UL << 16U) | 2U) /*!< EXTI_POSITION_12 | EXTICR[2] */
  163. #define LL_SYSCFG_EXTI_LINE12 ((0x000FUL << 16U) | 3U) /*!< EXTI_POSITION_0 | EXTICR[3] */
  164. #define LL_SYSCFG_EXTI_LINE13 ((0x00F0UL << 16U) | 3U) /*!< EXTI_POSITION_4 | EXTICR[3] */
  165. #define LL_SYSCFG_EXTI_LINE14 ((0x0F00UL << 16U) | 3U) /*!< EXTI_POSITION_8 | EXTICR[3] */
  166. #define LL_SYSCFG_EXTI_LINE15 ((0xF000UL << 16U) | 3U) /*!< EXTI_POSITION_12 | EXTICR[3] */
  167. /**
  168. * @}
  169. */
  170. /** @defgroup SYSTEM_LL_EC_TIMBREAK SYSCFG TIMER BREAK
  171. * @{
  172. */
  173. #define LL_SYSCFG_TIMBREAK_AXISRAM_DBL_ECC SYSCFG_CFGR_AXISRAML /*!< Enables and locks the AXIRAM double ECC error signal
  174. with Break Input of TIM1/8/15/16/17 and HRTIM */
  175. #define LL_SYSCFG_TIMBREAK_ITCM_DBL_ECC SYSCFG_CFGR_ITCML /*!< Enables and locks the ITCM double ECC error signal
  176. with Break Input of TIM1/8/15/16/17 and HRTIM */
  177. #define LL_SYSCFG_TIMBREAK_DTCM_DBL_ECC SYSCFG_CFGR_DTCML /*!< Enables and locks the DTCM double ECC error signal
  178. with Break Input of TIM1/8/15/16/17 and HRTIM */
  179. #define LL_SYSCFG_TIMBREAK_SRAM1_DBL_ECC SYSCFG_CFGR_SRAM1L /*!< Enables and locks the SRAM1 double ECC error signal
  180. with Break Input of TIM1/8/15/16/17 and HRTIM */
  181. #define LL_SYSCFG_TIMBREAK_SRAM2_DBL_ECC SYSCFG_CFGR_SRAM2L /*!< Enables and locks the SRAM2 double ECC error signal
  182. with Break Input of TIM1/8/15/16/17 and HRTIM */
  183. #if defined(SYSCFG_CFGR_SRAM3L)
  184. #define LL_SYSCFG_TIMBREAK_SRAM3_DBL_ECC SYSCFG_CFGR_SRAM3L /*!< Enables and locks the SRAM3 double ECC error signal
  185. with Break Input of TIM1/8/15/16/17 and HRTIM */
  186. #endif /*SYSCFG_CFGR_SRAM3L*/
  187. #define LL_SYSCFG_TIMBREAK_SRAM4_DBL_ECC SYSCFG_CFGR_SRAM4L /*!< Enables and locks the SRAM4 double ECC error signal
  188. with Break Input of TIM1/8/15/16/17 and HRTIM */
  189. #define LL_SYSCFG_TIMBREAK_BKRAM_DBL_ECC SYSCFG_CFGR_BKRAML /*!< Enables and locks the BKRAM double ECC error signal
  190. with Break Input of TIM1/8/15/16/17 and HRTIM */
  191. #define LL_SYSCFG_TIMBREAK_CM7_LOCKUP SYSCFG_CFGR_CM7L /*!< Enables and locks the Cortex-M7 LOCKUP signal
  192. with Break Input of TIM1/8/15/16/17 and HRTIM */
  193. #define LL_SYSCFG_TIMBREAK_FLASH_DBL_ECC SYSCFG_CFGR_FLASHL /*!< Enables and locks the FLASH double ECC error signal
  194. with Break Input of TIM1/8/15/16/17 and HRTIM */
  195. #define LL_SYSCFG_TIMBREAK_PVD SYSCFG_CFGR_PVDL /*!< Enables and locks the PVD connection
  196. with TIM1/8/15/16/17 and HRTIM Break Input
  197. and also the PVDE and PLS bits of the Power Control Interface */
  198. #if defined(DUAL_CORE)
  199. #define LL_SYSCFG_TIMBREAK_CM4_LOCKUP SYSCFG_CFGR_CM4L /*!< Enables and locks the Cortex-M4 LOCKUP signal
  200. with Break Input of TIM1/8/15/16/17 and HRTIM */
  201. #endif /* DUAL_CORE */
  202. /**
  203. * @}
  204. */
  205. /** @defgroup SYSTEM_LL_EC_CS SYSCFG I/O compensation cell Code selection
  206. * @{
  207. */
  208. #define LL_SYSCFG_CELL_CODE 0U
  209. #define LL_SYSCFG_REGISTER_CODE SYSCFG_CCCSR_CS
  210. /**
  211. * @}
  212. */
  213. /** @defgroup SYSTEM_LL_IWDG1_CONTROL_MODES SYSCFG IWDG1 control modes
  214. * @{
  215. */
  216. #define LL_SYSCFG_IWDG1_SW_CONTROL_MODE 0U
  217. #define LL_SYSCFG_IWDG1_HW_CONTROL_MODE SYSCFG_UR11_IWDG1M
  218. /**
  219. * @}
  220. */
  221. #if defined (DUAL_CORE)
  222. /** @defgroup SYSTEM_LL_IWDG2_CONTROL_MODES SYSCFG IWDG2 control modes
  223. * @{
  224. */
  225. #define LL_SYSCFG_IWDG2_SW_CONTROL_MODE 0U
  226. #define LL_SYSCFG_IWDG2_HW_CONTROL_MODE SYSCFG_UR12_IWDG2M
  227. /**
  228. * @}
  229. */
  230. #endif /* DUAL_CORE */
  231. /** @defgroup SYSTEM_LL_DTCM_RAM_SIZE SYSCFG DTCM RAM size configuration
  232. * @{
  233. */
  234. #define LL_SYSCFG_DTCM_RAM_SIZE_2KB 0U
  235. #define LL_SYSCFG_DTCM_RAM_SIZE_4KB 1U
  236. #define LL_SYSCFG_DTCM_RAM_SIZE_8KB 2U
  237. #define LL_SYSCFG_DTCM_RAM_SIZE_16KB 3U
  238. /**
  239. * @}
  240. */
  241. #ifdef SYSCFG_UR17_TCM_AXI_CFG
  242. /** @defgroup SYSTEM_LL_PACKAGE SYSCFG device package
  243. * @{
  244. */
  245. #define LL_SYSCFG_ITCM_AXI_64KB_320KB 0U
  246. #define LL_SYSCFG_ITCM_AXI_128KB_256KB 1U
  247. #define LL_SYSCFG_ITCM_AXI_192KB_192KB 2U
  248. #define LL_SYSCFG_ITCM_AXI_256KB_128KB 3U
  249. /**
  250. * @}
  251. */
  252. #endif /* #ifdef SYSCFG_UR17_TCM_AXI_CFG */
  253. #if defined(SYSCFG_PKGR_PKG)
  254. /** @defgroup SYSTEM_LL_PACKAGE SYSCFG device package
  255. * @{
  256. */
  257. #if (STM32H7_DEV_ID == 0x450UL)
  258. #define LL_SYSCFG_LQFP100_PACKAGE 0U
  259. #define LL_SYSCFG_TQFP144_PACKAGE 2U
  260. #define LL_SYSCFG_TQFP176_UFBGA176_PACKAGE 5U
  261. #define LL_SYSCFG_LQFP208_TFBGA240_PACKAGE 8U
  262. #elif (STM32H7_DEV_ID == 0x483UL)
  263. #define LL_SYSCFG_VFQFPN68_INDUS_PACKAGE 0U
  264. #define LL_SYSCFG_TFBGA100_LQFP100_PACKAGE 1U
  265. #define LL_SYSCFG_LQFP100_INDUS_PACKAGE 2U
  266. #define LL_SYSCFG_TFBGA100_INDUS_PACKAGE 3U
  267. #define LL_SYSCFG_WLCSP115_INDUS_PACKAGE 4U
  268. #define LL_SYSCFG_LQFP144_PACKAGE 5U
  269. #define LL_SYSCFG_UFBGA144_PACKAGE 6U
  270. #define LL_SYSCFG_LQFP144_INDUS_PACKAGE 7U
  271. #define LL_SYSCFG_UFBGA169_INDUS_PACKAGE 8U
  272. #define LL_SYSCFG_UFBGA176PLUS25_INDUS_PACKAGE 9U
  273. #define LL_SYSCFG_LQFP176_INDUS_PACKAGE 10U
  274. #endif /* STM32H7_DEV_ID == 0x450UL */
  275. /**
  276. * @}
  277. */
  278. #endif /* SYSCFG_PKGR_PKG */
  279. /** @defgroup SYSTEM_LL_SYSCFG_BOR SYSCFG Brownout Reset Threshold Level
  280. * @{
  281. */
  282. #define LL_SYSCFG_BOR_OFF_RESET_LEVEL 0x00000000U
  283. #define LL_SYSCFG_BOR_LOW_RESET_LEVEL SYSCFG_UR2_BORH_0
  284. #define LL_SYSCFG_BOR_MEDIUM_RESET_LEVEL SYSCFG_UR2_BORH_1
  285. #define LL_SYSCFG_BOR_HIGH_RESET_LEVEL SYSCFG_UR2_BORH
  286. /**
  287. * @}
  288. */
  289. /** @defgroup SYSTEM_LL_EC_TRACE DBGMCU TRACE Pin Assignment
  290. * @{
  291. */
  292. #define LL_DBGMCU_TRACE_NONE 0x00000000U /*!< TRACE pins not assigned (default state) */
  293. #define LL_DBGMCU_TRACE_ASYNCH DBGMCU_CR_TRACE_IOEN /*!< TRACE pin assignment for Asynchronous Mode */
  294. #define LL_DBGMCU_TRACE_SYNCH_SIZE1 (DBGMCU_CR_TRACE_IOEN | DBGMCU_CR_TRACE_MODE_0) /*!< TRACE pin assignment for Synchronous Mode with a TRACEDATA size of 1 */
  295. #define LL_DBGMCU_TRACE_SYNCH_SIZE2 (DBGMCU_CR_TRACE_IOEN | DBGMCU_CR_TRACE_MODE_1) /*!< TRACE pin assignment for Synchronous Mode with a TRACEDATA size of 2 */
  296. #define LL_DBGMCU_TRACE_SYNCH_SIZE4 (DBGMCU_CR_TRACE_IOEN | DBGMCU_CR_TRACE_MODE) /*!< TRACE pin assignment for Synchronous Mode with a TRACEDATA size of 4 */
  297. /**
  298. * @}
  299. */
  300. /** @defgroup SYSTEM_LL_EC_APB1_GRP1_STOP_IP DBGMCU APB1 GRP1 STOP IP
  301. * @{
  302. */
  303. #define LL_DBGMCU_APB1_GRP1_TIM2_STOP DBGMCU_APB1LFZ1_DBG_TIM2 /*!< TIM2 counter stopped when core is halted */
  304. #define LL_DBGMCU_APB1_GRP1_TIM3_STOP DBGMCU_APB1LFZ1_DBG_TIM3 /*!< TIM3 counter stopped when core is halted */
  305. #define LL_DBGMCU_APB1_GRP1_TIM4_STOP DBGMCU_APB1LFZ1_DBG_TIM4 /*!< TIM4 counter stopped when core is halted */
  306. #define LL_DBGMCU_APB1_GRP1_TIM5_STOP DBGMCU_APB1LFZ1_DBG_TIM5 /*!< TIM5 counter stopped when core is halted */
  307. #define LL_DBGMCU_APB1_GRP1_TIM6_STOP DBGMCU_APB1LFZ1_DBG_TIM6 /*!< TIM6 counter stopped when core is halted */
  308. #define LL_DBGMCU_APB1_GRP1_TIM7_STOP DBGMCU_APB1LFZ1_DBG_TIM7 /*!< TIM7 counter stopped when core is halted */
  309. #define LL_DBGMCU_APB1_GRP1_TIM12_STOP DBGMCU_APB1LFZ1_DBG_TIM12 /*!< TIM12 counter stopped when core is halted */
  310. #define LL_DBGMCU_APB1_GRP1_TIM13_STOP DBGMCU_APB1LFZ1_DBG_TIM13 /*!< TIM13 counter stopped when core is halted */
  311. #define LL_DBGMCU_APB1_GRP1_TIM14_STOP DBGMCU_APB1LFZ1_DBG_TIM14 /*!< TIM14 counter stopped when core is halted */
  312. #define LL_DBGMCU_APB1_GRP1_LPTIM1_STOP DBGMCU_APB1LFZ1_DBG_LPTIM1 /*!< LPTIM1 counter stopped when core is halted */
  313. #define LL_DBGMCU_APB1_GRP1_I2C1_STOP DBGMCU_APB1LFZ1_DBG_I2C1 /*!< I2C1 SMBUS timeout mode stopped when Core is halted */
  314. #define LL_DBGMCU_APB1_GRP1_I2C2_STOP DBGMCU_APB1LFZ1_DBG_I2C2 /*!< I2C2 SMBUS timeout mode stopped when Core is halted */
  315. #define LL_DBGMCU_APB1_GRP1_I2C3_STOP DBGMCU_APB1LFZ1_DBG_I2C3 /*!< I2C3 SMBUS timeout mode stopped when Core is halted */
  316. #if defined(I2C5)
  317. #define LL_DBGMCU_APB1_GRP1_I2C5_STOP DBGMCU_APB1LFZ1_DBG_I2C5 /*!< I2C5 SMBUS timeout mode stopped when Core is halted */
  318. #endif /*I2C5*/
  319. /**
  320. * @}
  321. */
  322. /** @defgroup SYSTEM_LL_EC_APB1_GRP2_STOP_IP DBGMCU APB1 GRP2 STOP IP
  323. * @{
  324. */
  325. #if defined(DBGMCU_APB1HFZ1_DBG_FDCAN)
  326. #define LL_DBGMCU_APB1_GRP2_FDCAN_STOP DBGMCU_APB1HFZ1_DBG_FDCAN /*!< FDCAN is frozen while the core is in debug mode */
  327. #endif /*DBGMCU_APB1HFZ1_DBG_FDCAN*/
  328. #if defined(TIM23)
  329. #define LL_DBGMCU_APB1_GRP2_TIM23_STOP DBGMCU_APB1HFZ1_DBG_TIM23 /*!< TIM23 is frozen while the core is in debug mode */
  330. #endif /*TIM23*/
  331. #if defined(TIM24)
  332. #define LL_DBGMCU_APB1_GRP2_TIM24_STOP DBGMCU_APB1HFZ1_DBG_TIM24 /*!< TIM24 is frozen while the core is in debug mode */
  333. #endif /*TIM24*/
  334. /**
  335. * @}
  336. */
  337. /** @defgroup SYSTEM_LL_EC_APB2_GRP1_STOP_IP DBGMCU APB2 GRP1 STOP IP
  338. * @{
  339. */
  340. #define LL_DBGMCU_APB2_GRP1_TIM1_STOP DBGMCU_APB2FZ1_DBG_TIM1 /*!< TIM1 counter stopped when core is halted */
  341. #define LL_DBGMCU_APB2_GRP1_TIM8_STOP DBGMCU_APB2FZ1_DBG_TIM8 /*!< TIM8 counter stopped when core is halted */
  342. #define LL_DBGMCU_APB2_GRP1_TIM15_STOP DBGMCU_APB2FZ1_DBG_TIM15 /*!< TIM15 counter stopped when core is halted */
  343. #define LL_DBGMCU_APB2_GRP1_TIM16_STOP DBGMCU_APB2FZ1_DBG_TIM16 /*!< TIM16 counter stopped when core is halted */
  344. #define LL_DBGMCU_APB2_GRP1_TIM17_STOP DBGMCU_APB2FZ1_DBG_TIM17 /*!< TIM17 counter stopped when core is halted */
  345. #if defined(HRTIM1)
  346. #define LL_DBGMCU_APB2_GRP1_HRTIM_STOP DBGMCU_APB2FZ1_DBG_HRTIM /*!< HRTIM counter stopped when core is halted */
  347. #endif /*HRTIM1*/
  348. /**
  349. * @}
  350. */
  351. /** @defgroup SYSTEM_LL_EC_APB3_GRP1_STOP_IP DBGMCU APB3 GRP1 STOP IP
  352. * @{
  353. */
  354. #define LL_DBGMCU_APB3_GRP1_WWDG1_STOP DBGMCU_APB3FZ1_DBG_WWDG1 /*!< WWDG1 is frozen while the core is in debug mode */
  355. /**
  356. * @}
  357. */
  358. /** @defgroup SYSTEM_LL_EC_APB4_GRP1_STOP_IP DBGMCU APB4 GRP1 STOP IP
  359. * @{
  360. */
  361. #define LL_DBGMCU_APB4_GRP1_I2C4_STOP DBGMCU_APB4FZ1_DBG_I2C4 /*!< I2C4 is frozen while the core is in debug mode */
  362. #define LL_DBGMCU_APB4_GRP1_LPTIM2_STOP DBGMCU_APB4FZ1_DBG_LPTIM2 /*!< LPTIM2 is frozen while the core is in debug mode */
  363. #define LL_DBGMCU_APB4_GRP1_LPTIM3_STOP DBGMCU_APB4FZ1_DBG_LPTIM3 /*!< LPTIM3 is frozen while the core is in debug mode */
  364. #define LL_DBGMCU_APB4_GRP1_LPTIM4_STOP DBGMCU_APB4FZ1_DBG_LPTIM4 /*!< LPTIM4 is frozen while the core is in debug mode */
  365. #define LL_DBGMCU_APB4_GRP1_LPTIM5_STOP DBGMCU_APB4FZ1_DBG_LPTIM5 /*!< LPTIM5 is frozen while the core is in debug mode */
  366. #define LL_DBGMCU_APB4_GRP1_RTC_STOP DBGMCU_APB4FZ1_DBG_RTC /*!< RTC is frozen while the core is in debug mode */
  367. #define LL_DBGMCU_APB4_GRP1_IWDG1_STOP DBGMCU_APB4FZ1_DBG_IWDG1 /*!< IWDG1 is frozen while the core is in debug mode */
  368. /**
  369. * @}
  370. */
  371. /** @defgroup SYSTEM_LL_EC_LATENCY FLASH LATENCY
  372. * @{
  373. */
  374. #define LL_FLASH_LATENCY_0 FLASH_ACR_LATENCY_0WS /*!< FLASH Zero wait state */
  375. #define LL_FLASH_LATENCY_1 FLASH_ACR_LATENCY_1WS /*!< FLASH One wait state */
  376. #define LL_FLASH_LATENCY_2 FLASH_ACR_LATENCY_2WS /*!< FLASH Two wait states */
  377. #define LL_FLASH_LATENCY_3 FLASH_ACR_LATENCY_3WS /*!< FLASH Three wait states */
  378. #define LL_FLASH_LATENCY_4 FLASH_ACR_LATENCY_4WS /*!< FLASH Four wait states */
  379. #define LL_FLASH_LATENCY_5 FLASH_ACR_LATENCY_5WS /*!< FLASH five wait state */
  380. #define LL_FLASH_LATENCY_6 FLASH_ACR_LATENCY_6WS /*!< FLASH six wait state */
  381. #define LL_FLASH_LATENCY_7 FLASH_ACR_LATENCY_7WS /*!< FLASH seven wait states */
  382. /**
  383. * @}
  384. */
  385. /**
  386. * @}
  387. */
  388. /* Exported macro ------------------------------------------------------------*/
  389. /* Exported functions --------------------------------------------------------*/
  390. /** @defgroup SYSTEM_LL_Exported_Functions SYSTEM Exported Functions
  391. * @{
  392. */
  393. /** @defgroup SYSTEM_LL_EF_SYSCFG SYSCFG
  394. * @{
  395. */
  396. #if defined(SYSCFG_PMCR_EPIS_SEL)
  397. /**
  398. * @brief Select Ethernet PHY interface
  399. * @rmtoll PMCR EPIS_SEL LL_SYSCFG_SetPHYInterface
  400. * @param Interface This parameter can be one of the following values:
  401. * @arg @ref LL_SYSCFG_ETH_MII
  402. * @arg @ref LL_SYSCFG_ETH_RMII
  403. * @retval None
  404. */
  405. __STATIC_INLINE void LL_SYSCFG_SetPHYInterface(uint32_t Interface)
  406. {
  407. MODIFY_REG(SYSCFG->PMCR, SYSCFG_PMCR_EPIS_SEL, Interface);
  408. }
  409. /**
  410. * @brief Get Ethernet PHY interface
  411. * @rmtoll PMCR EPIS_SEL LL_SYSCFG_GetPHYInterface
  412. * @retval Returned value can be one of the following values:
  413. * @arg @ref LL_SYSCFG_ETH_MII
  414. * @arg @ref LL_SYSCFG_ETH_RMII
  415. */
  416. __STATIC_INLINE uint32_t LL_SYSCFG_GetPHYInterface(void)
  417. {
  418. return (uint32_t)(READ_BIT(SYSCFG->PMCR, SYSCFG_PMCR_EPIS_SEL));
  419. }
  420. #endif /* SYSCFG_PMCR_EPIS_SEL */
  421. /**
  422. * @brief Open an Analog Switch
  423. * @rmtoll PMCR PA0SO LL_SYSCFG_OpenAnalogSwitch
  424. * @rmtoll PMCR PA1SO LL_SYSCFG_OpenAnalogSwitch
  425. * @rmtoll PMCR PC2SO LL_SYSCFG_OpenAnalogSwitch
  426. * @rmtoll PMCR PC3SO LL_SYSCFG_OpenAnalogSwitch
  427. * @param AnalogSwitch This parameter can be one of the following values:
  428. * @arg LL_SYSCFG_ANALOG_SWITCH_PA0 : PA0 analog switch
  429. * @arg LL_SYSCFG_ANALOG_SWITCH_PA1: PA1 analog switch
  430. * @arg LL_SYSCFG_ANALOG_SWITCH_PC2 : PC2 analog switch
  431. * @arg LL_SYSCFG_ANALOG_SWITCH_PC3: PC3 analog switch
  432. * @retval None
  433. */
  434. __STATIC_INLINE void LL_SYSCFG_OpenAnalogSwitch(uint32_t AnalogSwitch)
  435. {
  436. SET_BIT(SYSCFG->PMCR, AnalogSwitch);
  437. }
  438. /**
  439. * @brief Close an Analog Switch
  440. * @rmtoll PMCR PA0SO LL_SYSCFG_CloseAnalogSwitch
  441. * @rmtoll PMCR PA1SO LL_SYSCFG_CloseAnalogSwitch
  442. * @rmtoll PMCR PC2SO LL_SYSCFG_CloseAnalogSwitch
  443. * @rmtoll PMCR PC3SO LL_SYSCFG_CloseAnalogSwitch
  444. * @param AnalogSwitch This parameter can be one of the following values:
  445. * @arg LL_SYSCFG_ANALOG_SWITCH_PA0 : PA0 analog switch
  446. * @arg LL_SYSCFG_ANALOG_SWITCH_PA1: PA1 analog switch
  447. * @arg LL_SYSCFG_ANALOG_SWITCH_PC2 : PC2 analog switch
  448. * @arg LL_SYSCFG_ANALOG_SWITCH_PC3: PC3 analog switch
  449. * @retval None
  450. */
  451. __STATIC_INLINE void LL_SYSCFG_CloseAnalogSwitch(uint32_t AnalogSwitch)
  452. {
  453. CLEAR_BIT(SYSCFG->PMCR, AnalogSwitch);
  454. }
  455. #ifdef SYSCFG_PMCR_BOOSTEN
  456. /**
  457. * @brief Enable the Analog booster to reduce the total harmonic distortion
  458. * of the analog switch when the supply voltage is lower than 2.7 V
  459. * @rmtoll PMCR BOOSTEN LL_SYSCFG_EnableAnalogBooster
  460. * @note Activating the booster allows to guaranty the analog switch AC performance
  461. * when the supply voltage is below 2.7 V: in this case, the analog switch
  462. * performance is the same on the full voltage range
  463. * @retval None
  464. */
  465. __STATIC_INLINE void LL_SYSCFG_EnableAnalogBooster(void)
  466. {
  467. SET_BIT(SYSCFG->PMCR, SYSCFG_PMCR_BOOSTEN) ;
  468. }
  469. /**
  470. * @brief Disable the Analog booster
  471. * @rmtoll PMCR BOOSTEN LL_SYSCFG_DisableAnalogBooster
  472. * @note Activating the booster allows to guaranty the analog switch AC performance
  473. * when the supply voltage is below 2.7 V: in this case, the analog switch
  474. * performance is the same on the full voltage range
  475. * @retval None
  476. */
  477. __STATIC_INLINE void LL_SYSCFG_DisableAnalogBooster(void)
  478. {
  479. CLEAR_BIT(SYSCFG->PMCR, SYSCFG_PMCR_BOOSTEN) ;
  480. }
  481. #endif /*SYSCFG_PMCR_BOOSTEN*/
  482. /**
  483. * @brief Enable the I2C fast mode plus driving capability.
  484. * @rmtoll SYSCFG_PMCR I2C_PBx_FMP LL_SYSCFG_EnableFastModePlus\n
  485. * SYSCFG_PMCR I2Cx_FMP LL_SYSCFG_EnableFastModePlus
  486. * @param ConfigFastModePlus This parameter can be a combination of the following values:
  487. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB6
  488. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB7
  489. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB8 (*)
  490. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB9 (*)
  491. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C1
  492. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C2 (*)
  493. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C3
  494. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C4(*)
  495. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C5(*)
  496. *
  497. * (*) value not defined in all devices
  498. * @retval None
  499. */
  500. __STATIC_INLINE void LL_SYSCFG_EnableFastModePlus(uint32_t ConfigFastModePlus)
  501. {
  502. SET_BIT(SYSCFG->PMCR, ConfigFastModePlus);
  503. }
  504. /**
  505. * @brief Disable the I2C fast mode plus driving capability.
  506. * @rmtoll SYSCFG_PMCR I2C_PBx_FMP LL_SYSCFG_DisableFastModePlus\n
  507. * SYSCFG_PMCR I2Cx_FMP LL_SYSCFG_DisableFastModePlus
  508. * @param ConfigFastModePlus This parameter can be a combination of the following values:
  509. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB6
  510. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB7
  511. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB8 (*)
  512. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB9 (*)
  513. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C1
  514. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C2 (*)
  515. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C3
  516. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C4
  517. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C5 (*)
  518. *
  519. * (*) value not defined in all devices
  520. * @retval None
  521. */
  522. __STATIC_INLINE void LL_SYSCFG_DisableFastModePlus(uint32_t ConfigFastModePlus)
  523. {
  524. CLEAR_BIT(SYSCFG->PMCR, ConfigFastModePlus);
  525. }
  526. /**
  527. * @brief Configure source input for the EXTI external interrupt.
  528. * @rmtoll SYSCFG_EXTICR1 EXTIx LL_SYSCFG_SetEXTISource\n
  529. * SYSCFG_EXTICR2 EXTIx LL_SYSCFG_SetEXTISource\n
  530. * SYSCFG_EXTICR3 EXTIx LL_SYSCFG_SetEXTISource\n
  531. * SYSCFG_EXTICR4 EXTIx LL_SYSCFG_SetEXTISource
  532. * @param Port This parameter can be one of the following values:
  533. * @arg @ref LL_SYSCFG_EXTI_PORTA
  534. * @arg @ref LL_SYSCFG_EXTI_PORTB
  535. * @arg @ref LL_SYSCFG_EXTI_PORTC
  536. * @arg @ref LL_SYSCFG_EXTI_PORTD
  537. * @arg @ref LL_SYSCFG_EXTI_PORTE
  538. * @arg @ref LL_SYSCFG_EXTI_PORTF
  539. * @arg @ref LL_SYSCFG_EXTI_PORTG
  540. * @arg @ref LL_SYSCFG_EXTI_PORTH
  541. * @arg @ref LL_SYSCFG_EXTI_PORTI (*)
  542. * @arg @ref LL_SYSCFG_EXTI_PORTJ
  543. * @arg @ref LL_SYSCFG_EXTI_PORTK
  544. *
  545. * (*) value not defined in all devices
  546. * @param Line This parameter can be one of the following values:
  547. * @arg @ref LL_SYSCFG_EXTI_LINE0
  548. * @arg @ref LL_SYSCFG_EXTI_LINE1
  549. * @arg @ref LL_SYSCFG_EXTI_LINE2
  550. * @arg @ref LL_SYSCFG_EXTI_LINE3
  551. * @arg @ref LL_SYSCFG_EXTI_LINE4
  552. * @arg @ref LL_SYSCFG_EXTI_LINE5
  553. * @arg @ref LL_SYSCFG_EXTI_LINE6
  554. * @arg @ref LL_SYSCFG_EXTI_LINE7
  555. * @arg @ref LL_SYSCFG_EXTI_LINE8
  556. * @arg @ref LL_SYSCFG_EXTI_LINE9
  557. * @arg @ref LL_SYSCFG_EXTI_LINE10
  558. * @arg @ref LL_SYSCFG_EXTI_LINE11
  559. * @arg @ref LL_SYSCFG_EXTI_LINE12
  560. * @arg @ref LL_SYSCFG_EXTI_LINE13
  561. * @arg @ref LL_SYSCFG_EXTI_LINE14
  562. * @arg @ref LL_SYSCFG_EXTI_LINE15
  563. * @retval None
  564. */
  565. __STATIC_INLINE void LL_SYSCFG_SetEXTISource(uint32_t Port, uint32_t Line)
  566. {
  567. MODIFY_REG(SYSCFG->EXTICR[Line & 0x3U], (Line >> 16U), Port << ((POSITION_VAL(Line >> 16U)) & 31U));
  568. }
  569. /**
  570. * @brief Get the configured defined for specific EXTI Line
  571. * @rmtoll SYSCFG_EXTICR1 EXTIx LL_SYSCFG_GetEXTISource\n
  572. * SYSCFG_EXTICR2 EXTIx LL_SYSCFG_GetEXTISource\n
  573. * SYSCFG_EXTICR3 EXTIx LL_SYSCFG_GetEXTISource\n
  574. * SYSCFG_EXTICR4 EXTIx LL_SYSCFG_GetEXTISource
  575. * @param Line This parameter can be one of the following values:
  576. * @arg @ref LL_SYSCFG_EXTI_LINE0
  577. * @arg @ref LL_SYSCFG_EXTI_LINE1
  578. * @arg @ref LL_SYSCFG_EXTI_LINE2
  579. * @arg @ref LL_SYSCFG_EXTI_LINE3
  580. * @arg @ref LL_SYSCFG_EXTI_LINE4
  581. * @arg @ref LL_SYSCFG_EXTI_LINE5
  582. * @arg @ref LL_SYSCFG_EXTI_LINE6
  583. * @arg @ref LL_SYSCFG_EXTI_LINE7
  584. * @arg @ref LL_SYSCFG_EXTI_LINE8
  585. * @arg @ref LL_SYSCFG_EXTI_LINE9
  586. * @arg @ref LL_SYSCFG_EXTI_LINE10
  587. * @arg @ref LL_SYSCFG_EXTI_LINE11
  588. * @arg @ref LL_SYSCFG_EXTI_LINE12
  589. * @arg @ref LL_SYSCFG_EXTI_LINE13
  590. * @arg @ref LL_SYSCFG_EXTI_LINE14
  591. * @arg @ref LL_SYSCFG_EXTI_LINE15
  592. * @retval Returned value can be one of the following values:
  593. * @arg @ref LL_SYSCFG_EXTI_PORTA
  594. * @arg @ref LL_SYSCFG_EXTI_PORTB
  595. * @arg @ref LL_SYSCFG_EXTI_PORTC
  596. * @arg @ref LL_SYSCFG_EXTI_PORTD
  597. * @arg @ref LL_SYSCFG_EXTI_PORTE
  598. * @arg @ref LL_SYSCFG_EXTI_PORTF
  599. * @arg @ref LL_SYSCFG_EXTI_PORTG
  600. * @arg @ref LL_SYSCFG_EXTI_PORTH
  601. * @arg @ref LL_SYSCFG_EXTI_PORTI (*)
  602. * @arg @ref LL_SYSCFG_EXTI_PORTJ
  603. * @arg @ref LL_SYSCFG_EXTI_PORTK
  604. * (*) value not defined in all devices
  605. */
  606. __STATIC_INLINE uint32_t LL_SYSCFG_GetEXTISource(uint32_t Line)
  607. {
  608. return (uint32_t)(READ_BIT(SYSCFG->EXTICR[Line & 0x3U], (Line >> 16U)) >> (POSITION_VAL(Line >> 16U) & 31U));
  609. }
  610. /**
  611. * @brief Set connections to TIM1/8/15/16/17 and HRTIM Break inputs
  612. * @note this feature is available on STM32H7 rev.B and above
  613. * @rmtoll SYSCFG_CFGR AXISRAML LL_SYSCFG_SetTIMBreakInputs\n
  614. * SYSCFG_CFGR ITCML LL_SYSCFG_SetTIMBreakInputs\n
  615. * SYSCFG_CFGR DTCML LL_SYSCFG_SetTIMBreakInputs\n
  616. * SYSCFG_CFGR SRAM1L LL_SYSCFG_SetTIMBreakInputs\n
  617. * SYSCFG_CFGR SRAM2L LL_SYSCFG_SetTIMBreakInputs\n
  618. * SYSCFG_CFGR SRAM3L LL_SYSCFG_SetTIMBreakInputs\n
  619. * SYSCFG_CFGR SRAM4L LL_SYSCFG_SetTIMBreakInputs\n
  620. * SYSCFG_CFGR BKRAML LL_SYSCFG_SetTIMBreakInputs\n
  621. * SYSCFG_CFGR CM7L LL_SYSCFG_SetTIMBreakInputs\n
  622. * SYSCFG_CFGR FLASHL LL_SYSCFG_SetTIMBreakInputs\n
  623. * SYSCFG_CFGR PVDL LL_SYSCFG_SetTIMBreakInputs\n
  624. * SYSCFG_CFGR_CM4L LL_SYSCFG_SetTIMBreakInputs
  625. * @param Break This parameter can be a combination of the following values:
  626. * @arg @ref LL_SYSCFG_TIMBREAK_AXISRAM_DBL_ECC
  627. * @arg @ref LL_SYSCFG_TIMBREAK_ITCM_DBL_ECC
  628. * @arg @ref LL_SYSCFG_TIMBREAK_DTCM_DBL_ECC
  629. * @arg @ref LL_SYSCFG_TIMBREAK_SRAM1_DBL_ECC
  630. * @arg @ref LL_SYSCFG_TIMBREAK_SRAM2_DBL_ECC
  631. * @arg @ref LL_SYSCFG_TIMBREAK_SRAM3_DBL_ECC (*)
  632. * @arg @ref LL_SYSCFG_TIMBREAK_SRAM4_DBL_ECC
  633. * @arg @ref LL_SYSCFG_TIMBREAK_BKRAM_DBL_ECC
  634. * @arg @ref LL_SYSCFG_TIMBREAK_CM7_LOCKUP
  635. * @arg @ref LL_SYSCFG_TIMBREAK_FLASH_DBL_ECC
  636. * @arg @ref LL_SYSCFG_TIMBREAK_PVD
  637. * @arg @ref LL_SYSCFG_TIMBREAK_CM4_LOCKUP (available for dual core lines only)
  638. * @retval None
  639. * (*) value not defined in all devices
  640. */
  641. __STATIC_INLINE void LL_SYSCFG_SetTIMBreakInputs(uint32_t Break)
  642. {
  643. #if defined(DUAL_CORE)
  644. MODIFY_REG(SYSCFG->CFGR, SYSCFG_CFGR_AXISRAML | SYSCFG_CFGR_ITCML | SYSCFG_CFGR_DTCML | SYSCFG_CFGR_SRAM1L | SYSCFG_CFGR_SRAM2L | \
  645. SYSCFG_CFGR_SRAM3L | SYSCFG_CFGR_SRAM4L | SYSCFG_CFGR_BKRAML | SYSCFG_CFGR_CM7L | SYSCFG_CFGR_FLASHL | \
  646. SYSCFG_CFGR_PVDL | SYSCFG_CFGR_CM4L, Break);
  647. #elif defined(SYSCFG_CFGR_AXISRAML) && defined(SYSCFG_CFGR_SRAM3L)
  648. MODIFY_REG(SYSCFG->CFGR, SYSCFG_CFGR_AXISRAML | SYSCFG_CFGR_ITCML | SYSCFG_CFGR_DTCML | SYSCFG_CFGR_SRAM1L | SYSCFG_CFGR_SRAM2L | \
  649. SYSCFG_CFGR_SRAM3L | SYSCFG_CFGR_SRAM4L | SYSCFG_CFGR_BKRAML | SYSCFG_CFGR_CM7L | SYSCFG_CFGR_FLASHL | \
  650. SYSCFG_CFGR_PVDL, Break);
  651. #elif defined(SYSCFG_CFGR_AXISRAML)
  652. MODIFY_REG(SYSCFG->CFGR, SYSCFG_CFGR_AXISRAML | SYSCFG_CFGR_ITCML | SYSCFG_CFGR_DTCML | SYSCFG_CFGR_SRAM1L | SYSCFG_CFGR_SRAM2L | \
  653. SYSCFG_CFGR_SRAM4L | SYSCFG_CFGR_BKRAML | SYSCFG_CFGR_CM7L | SYSCFG_CFGR_FLASHL | SYSCFG_CFGR_PVDL,\
  654. Break);
  655. #else
  656. MODIFY_REG(SYSCFG->CFGR, SYSCFG_CFGR_ITCML | SYSCFG_CFGR_DTCML |\
  657. SYSCFG_CFGR_CM7L | SYSCFG_CFGR_FLASHL | \
  658. SYSCFG_CFGR_PVDL, Break);
  659. #endif /* DUAL_CORE */
  660. }
  661. /**
  662. * @brief Get connections to TIM1/8/15/16/17 and HRTIM Break inputs
  663. * @note this feature is available on STM32H7 rev.B and above
  664. * @rmtoll SYSCFG_CFGR AXISRAML LL_SYSCFG_GetTIMBreakInputs\n
  665. * SYSCFG_CFGR ITCML LL_SYSCFG_GetTIMBreakInputs\n
  666. * SYSCFG_CFGR DTCML LL_SYSCFG_GetTIMBreakInputs\n
  667. * SYSCFG_CFGR SRAM1L LL_SYSCFG_GetTIMBreakInputs\n
  668. * SYSCFG_CFGR SRAM2L LL_SYSCFG_GetTIMBreakInputs\n
  669. * SYSCFG_CFGR SRAM3L LL_SYSCFG_GetTIMBreakInputs\n
  670. * SYSCFG_CFGR SRAM4L LL_SYSCFG_GetTIMBreakInputs\n
  671. * SYSCFG_CFGR BKRAML LL_SYSCFG_GetTIMBreakInputs\n
  672. * SYSCFG_CFGR CM7L LL_SYSCFG_GetTIMBreakInputs\n
  673. * SYSCFG_CFGR FLASHL LL_SYSCFG_GetTIMBreakInputs\n
  674. * SYSCFG_CFGR PVDL LL_SYSCFG_GetTIMBreakInputs\n
  675. * SYSCFG_CFGR_CM4L LL_SYSCFG_GetTIMBreakInputs
  676. * @retval Returned value can be can be a combination of the following values:
  677. * @arg @ref LL_SYSCFG_TIMBREAK_AXISRAM_DBL_ECC
  678. * @arg @ref LL_SYSCFG_TIMBREAK_ITCM_DBL_ECC
  679. * @arg @ref LL_SYSCFG_TIMBREAK_DTCM_DBL_ECC
  680. * @arg @ref LL_SYSCFG_TIMBREAK_SRAM1_DBL_ECC
  681. * @arg @ref LL_SYSCFG_TIMBREAK_SRAM2_DBL_ECC
  682. * @arg @ref LL_SYSCFG_TIMBREAK_SRAM3_DBL_ECC (*)
  683. * @arg @ref LL_SYSCFG_TIMBREAK_SRAM4_DBL_ECC
  684. * @arg @ref LL_SYSCFG_TIMBREAK_BKRAM_DBL_ECC
  685. * @arg @ref LL_SYSCFG_TIMBREAK_CM7_LOCKUP
  686. * @arg @ref LL_SYSCFG_TIMBREAK_FLASH_DBL_ECC
  687. * @arg @ref LL_SYSCFG_TIMBREAK_PVD
  688. * @arg @ref LL_SYSCFG_TIMBREAK_CM4_LOCKUP (available for dual core lines only)
  689. * (*) value not defined in all devices
  690. */
  691. __STATIC_INLINE uint32_t LL_SYSCFG_GetTIMBreakInputs(void)
  692. {
  693. #if defined(DUAL_CORE)
  694. return (uint32_t)(READ_BIT(SYSCFG->CFGR, SYSCFG_CFGR_AXISRAML | SYSCFG_CFGR_ITCML | SYSCFG_CFGR_DTCML | \
  695. SYSCFG_CFGR_SRAM1L | SYSCFG_CFGR_SRAM2L | SYSCFG_CFGR_SRAM3L | \
  696. SYSCFG_CFGR_SRAM4L | SYSCFG_CFGR_BKRAML | SYSCFG_CFGR_CM7L | \
  697. SYSCFG_CFGR_FLASHL | SYSCFG_CFGR_PVDL | SYSCFG_CFGR_CM4L));
  698. #elif defined (SYSCFG_CFGR_AXISRAML) && defined(SYSCFG_CFGR_SRAM3L)
  699. return (uint32_t)(READ_BIT(SYSCFG->CFGR, SYSCFG_CFGR_AXISRAML | SYSCFG_CFGR_ITCML | SYSCFG_CFGR_DTCML | \
  700. SYSCFG_CFGR_SRAM1L | SYSCFG_CFGR_SRAM2L | SYSCFG_CFGR_SRAM3L | \
  701. SYSCFG_CFGR_SRAM4L | SYSCFG_CFGR_BKRAML | SYSCFG_CFGR_CM7L | \
  702. SYSCFG_CFGR_FLASHL | SYSCFG_CFGR_PVDL ));
  703. #elif defined (SYSCFG_CFGR_AXISRAML)
  704. return (uint32_t)(READ_BIT(SYSCFG->CFGR, SYSCFG_CFGR_AXISRAML | SYSCFG_CFGR_ITCML | SYSCFG_CFGR_DTCML | \
  705. SYSCFG_CFGR_SRAM1L | SYSCFG_CFGR_SRAM2L | \
  706. SYSCFG_CFGR_SRAM4L | SYSCFG_CFGR_BKRAML | SYSCFG_CFGR_CM7L | \
  707. SYSCFG_CFGR_FLASHL | SYSCFG_CFGR_PVDL ));
  708. #else
  709. return (uint32_t)(READ_BIT(SYSCFG->CFGR, SYSCFG_CFGR_ITCML | SYSCFG_CFGR_DTCML | SYSCFG_CFGR_CM7L | \
  710. SYSCFG_CFGR_FLASHL | SYSCFG_CFGR_PVDL ));
  711. #endif /* DUAL_CORE */
  712. }
  713. /**
  714. * @brief Enable the Compensation Cell
  715. * @rmtoll CCCSR EN LL_SYSCFG_EnableCompensationCell
  716. * @note The I/O compensation cell can be used only when the device supply
  717. * voltage ranges from 1.62 to 2.0 V and from 2.7 to 3.6 V.
  718. * @retval None
  719. */
  720. __STATIC_INLINE void LL_SYSCFG_EnableCompensationCell(void)
  721. {
  722. SET_BIT(SYSCFG->CCCSR, SYSCFG_CCCSR_EN);
  723. }
  724. /**
  725. * @brief Disable the Compensation Cell
  726. * @rmtoll CCCSR EN LL_SYSCFG_DisableCompensationCell
  727. * @note The I/O compensation cell can be used only when the device supply
  728. * voltage ranges from 1.62 to 2.0 V and from 2.7 to 3.6 V.
  729. * @retval None
  730. */
  731. __STATIC_INLINE void LL_SYSCFG_DisableCompensationCell(void)
  732. {
  733. CLEAR_BIT(SYSCFG->CCCSR, SYSCFG_CCCSR_EN);
  734. }
  735. /**
  736. * @brief Check if the Compensation Cell is enabled
  737. * @rmtoll CCCSR EN LL_SYSCFG_IsEnabledCompensationCell
  738. * @retval State of bit (1 or 0).
  739. */
  740. __STATIC_INLINE uint32_t LL_SYSCFG_IsEnabledCompensationCell(void)
  741. {
  742. return ((READ_BIT(SYSCFG->CCCSR, SYSCFG_CCCSR_EN) == SYSCFG_CCCSR_EN) ? 1UL : 0UL);
  743. }
  744. /**
  745. * @brief Get Compensation Cell ready Flag
  746. * @rmtoll CCCSR READY LL_SYSCFG_IsActiveFlag_CMPCR
  747. * @retval State of bit (1 or 0).
  748. */
  749. __STATIC_INLINE uint32_t LL_SYSCFG_IsActiveFlag_CMPCR(void)
  750. {
  751. return ((READ_BIT(SYSCFG->CCCSR, SYSCFG_CCCSR_READY) == (SYSCFG_CCCSR_READY)) ? 1UL : 0UL);
  752. }
  753. /**
  754. * @brief Enable the I/O speed optimization when the product voltage is low.
  755. * @rmtoll CCCSR HSLV LL_SYSCFG_EnableIOSpeedOptimize
  756. * @note This bit is active only if IO_HSLV user option bit is set. It must be used only if the
  757. * product supply voltage is below 2.7 V. Setting this bit when VDD is higher than 2.7 V
  758. * might be destructive.
  759. * @retval None
  760. */
  761. __STATIC_INLINE void LL_SYSCFG_EnableIOSpeedOptimization(void)
  762. {
  763. #if defined(SYSCFG_CCCSR_HSLV)
  764. SET_BIT(SYSCFG->CCCSR, SYSCFG_CCCSR_HSLV);
  765. #else
  766. SET_BIT(SYSCFG->CCCSR, SYSCFG_CCCSR_HSLV0);
  767. #endif /* SYSCFG_CCCSR_HSLV */
  768. }
  769. #if defined(SYSCFG_CCCSR_HSLV1)
  770. /**
  771. * @brief Enable the I/O speed optimization when the product voltage is low.
  772. * @rmtoll CCCSR HSLV1 LL_SYSCFG_EnableIOSpeedOptimize
  773. * @note This bit is active only if IO_HSLV user option bit is set. It must be used only if the
  774. * product supply voltage is below 2.7 V. Setting this bit when VDD is higher than 2.7 V
  775. * might be destructive.
  776. * @retval None
  777. */
  778. __STATIC_INLINE void LL_SYSCFG_EnableIOSpeedOptimization1(void)
  779. {
  780. SET_BIT(SYSCFG->CCCSR, SYSCFG_CCCSR_HSLV1);
  781. }
  782. /**
  783. * @brief Enable the I/O speed optimization when the product voltage is low.
  784. * @rmtoll CCCSR HSLV2 LL_SYSCFG_EnableIOSpeedOptimize
  785. * @note This bit is active only if IO_HSLV user option bit is set. It must be used only if the
  786. * product supply voltage is below 2.7 V. Setting this bit when VDD is higher than 2.7 V
  787. * might be destructive.
  788. * @retval None
  789. */
  790. __STATIC_INLINE void LL_SYSCFG_EnableIOSpeedOptimization2(void)
  791. {
  792. SET_BIT(SYSCFG->CCCSR, SYSCFG_CCCSR_HSLV2);
  793. }
  794. /**
  795. * @brief Enable the I/O speed optimization when the product voltage is low.
  796. * @rmtoll CCCSR HSLV3 LL_SYSCFG_EnableIOSpeedOptimize
  797. * @note This bit is active only if IO_HSLV user option bit is set. It must be used only if the
  798. * product supply voltage is below 2.7 V. Setting this bit when VDD is higher than 2.7 V
  799. * might be destructive.
  800. * @retval None
  801. */
  802. __STATIC_INLINE void LL_SYSCFG_EnableIOSpeedOptimization3(void)
  803. {
  804. SET_BIT(SYSCFG->CCCSR, SYSCFG_CCCSR_HSLV3);
  805. }
  806. #endif /*SYSCFG_CCCSR_HSLV1*/
  807. /**
  808. * @brief To Disable optimize the I/O speed when the product voltage is low.
  809. * @rmtoll CCCSR HSLV LL_SYSCFG_DisableIOSpeedOptimize
  810. * @note This bit is active only if IO_HSLV user option bit is set. It must be used only if the
  811. * product supply voltage is below 2.7 V. Setting this bit when VDD is higher than 2.7 V
  812. * might be destructive.
  813. * @retval None
  814. */
  815. __STATIC_INLINE void LL_SYSCFG_DisableIOSpeedOptimization(void)
  816. {
  817. #if defined(SYSCFG_CCCSR_HSLV)
  818. CLEAR_BIT(SYSCFG->CCCSR, SYSCFG_CCCSR_HSLV);
  819. #else
  820. CLEAR_BIT(SYSCFG->CCCSR, SYSCFG_CCCSR_HSLV0);
  821. #endif /* SYSCFG_CCCSR_HSLV */
  822. }
  823. #if defined(SYSCFG_CCCSR_HSLV1)
  824. /**
  825. * @brief To Disable optimize the I/O speed when the product voltage is low.
  826. * @rmtoll CCCSR HSLV1 LL_SYSCFG_DisableIOSpeedOptimize
  827. * @note This bit is active only if IO_HSLV user option bit is set. It must be used only if the
  828. * product supply voltage is below 2.7 V. Setting this bit when VDD is higher than 2.7 V
  829. * might be destructive.
  830. * @retval None
  831. */
  832. __STATIC_INLINE void LL_SYSCFG_DisableIOSpeedOptimization1(void)
  833. {
  834. CLEAR_BIT(SYSCFG->CCCSR, SYSCFG_CCCSR_HSLV1);
  835. }
  836. /**
  837. * @brief To Disable optimize the I/O speed when the product voltage is low.
  838. * @rmtoll CCCSR HSLV2 LL_SYSCFG_DisableIOSpeedOptimize
  839. * @note This bit is active only if IO_HSLV user option bit is set. It must be used only if the
  840. * product supply voltage is below 2.7 V. Setting this bit when VDD is higher than 2.7 V
  841. * might be destructive.
  842. * @retval None
  843. */
  844. __STATIC_INLINE void LL_SYSCFG_DisableIOSpeedOptimization2(void)
  845. {
  846. CLEAR_BIT(SYSCFG->CCCSR, SYSCFG_CCCSR_HSLV2);
  847. }
  848. /**
  849. * @brief To Disable optimize the I/O speed when the product voltage is low.
  850. * @rmtoll CCCSR HSLV3 LL_SYSCFG_DisableIOSpeedOptimize
  851. * @note This bit is active only if IO_HSLV user option bit is set. It must be used only if the
  852. * product supply voltage is below 2.7 V. Setting this bit when VDD is higher than 2.7 V
  853. * might be destructive.
  854. * @retval None
  855. */
  856. __STATIC_INLINE void LL_SYSCFG_DisableIOSpeedOptimization3(void)
  857. {
  858. CLEAR_BIT(SYSCFG->CCCSR, SYSCFG_CCCSR_HSLV3);
  859. }
  860. #endif /*SYSCFG_CCCSR_HSLV1*/
  861. /**
  862. * @brief Check if the I/O speed optimization is enabled
  863. * @rmtoll CCCSR HSLV LL_SYSCFG_IsEnabledIOSpeedOptimization
  864. * @retval State of bit (1 or 0).
  865. */
  866. __STATIC_INLINE uint32_t LL_SYSCFG_IsEnabledIOSpeedOptimization(void)
  867. {
  868. #if defined(SYSCFG_CCCSR_HSLV)
  869. return ((READ_BIT(SYSCFG->CCCSR, SYSCFG_CCCSR_HSLV) == SYSCFG_CCCSR_HSLV) ? 1UL : 0UL);
  870. #else
  871. return ((READ_BIT(SYSCFG->CCCSR, SYSCFG_CCCSR_HSLV0) == SYSCFG_CCCSR_HSLV0) ? 1UL : 0UL);
  872. #endif /*SYSCFG_CCCSR_HSLV*/
  873. }
  874. #if defined(SYSCFG_CCCSR_HSLV1)
  875. /**
  876. * @brief Check if the I/O speed optimization is enabled
  877. * @rmtoll CCCSR HSLV1 LL_SYSCFG_IsEnabledIOSpeedOptimization
  878. * @retval State of bit (1 or 0).
  879. */
  880. __STATIC_INLINE uint32_t LL_SYSCFG_IsEnabledIOSpeedOptimization1(void)
  881. {
  882. return ((READ_BIT(SYSCFG->CCCSR, SYSCFG_CCCSR_HSLV1) == SYSCFG_CCCSR_HSLV1) ? 1UL : 0UL);
  883. }
  884. /**
  885. * @brief Check if the I/O speed optimization is enabled
  886. * @rmtoll CCCSR HSLV2 LL_SYSCFG_IsEnabledIOSpeedOptimization
  887. * @retval State of bit (1 or 0).
  888. */
  889. __STATIC_INLINE uint32_t LL_SYSCFG_IsEnabledIOSpeedOptimization2(void)
  890. {
  891. return ((READ_BIT(SYSCFG->CCCSR, SYSCFG_CCCSR_HSLV2) == SYSCFG_CCCSR_HSLV2) ? 1UL : 0UL);
  892. }
  893. /**
  894. * @brief Check if the I/O speed optimization is enabled
  895. * @rmtoll CCCSR HSLV3 LL_SYSCFG_IsEnabledIOSpeedOptimization
  896. * @retval State of bit (1 or 0).
  897. */
  898. __STATIC_INLINE uint32_t LL_SYSCFG_IsEnabledIOSpeedOptimization3(void)
  899. {
  900. return ((READ_BIT(SYSCFG->CCCSR, SYSCFG_CCCSR_HSLV3) == SYSCFG_CCCSR_HSLV3) ? 1UL : 0UL);
  901. }
  902. #endif /*SYSCFG_CCCSR_HSLV1*/
  903. /**
  904. * @brief Set the code selection for the I/O Compensation cell
  905. * @rmtoll CCCSR CS LL_SYSCFG_SetCellCompensationCode
  906. * @param CompCode: Selects the code to be applied for the I/O compensation cell
  907. * This parameter can be one of the following values:
  908. * @arg LL_SYSCFG_CELL_CODE : Select Code from the cell (available in the SYSCFG_CCVR)
  909. * @arg LL_SYSCFG_REGISTER_CODE: Select Code from the SYSCFG compensation cell code register (SYSCFG_CCCR)
  910. * @retval None
  911. */
  912. __STATIC_INLINE void LL_SYSCFG_SetCellCompensationCode(uint32_t CompCode)
  913. {
  914. SET_BIT(SYSCFG->CCCSR, CompCode);
  915. }
  916. /**
  917. * @brief Get the code selected for the I/O Compensation cell
  918. * @rmtoll CCCSR CS LL_SYSCFG_GetCellCompensationCode
  919. * @retval Returned value can be one of the following values:
  920. * @arg LL_SYSCFG_CELL_CODE : Selected Code is from the cell (available in the SYSCFG_CCVR)
  921. * @arg LL_SYSCFG_REGISTER_CODE: Selected Code is from the SYSCFG compensation cell code register (SYSCFG_CCCR)
  922. */
  923. __STATIC_INLINE uint32_t LL_SYSCFG_GetCellCompensationCode(void)
  924. {
  925. return (uint32_t)(READ_BIT(SYSCFG->CCCSR, SYSCFG_CCCSR_CS));
  926. }
  927. #ifdef SYSCFG_CCCSR_CS_MMC
  928. /**
  929. * @brief Get the code selected for the I/O Compensation cell on the VDDMMC power rail
  930. * @rmtoll CCCSR CS LL_SYSCFG_GetCellCompensationCode
  931. * @retval Returned value can be one of the following values:
  932. * @arg LL_SYSCFG_CELL_CODE : Selected Code is from the cell (available in the SYSCFG_CCVR)
  933. * @arg LL_SYSCFG_REGISTER_CODE: Selected Code is from the SYSCFG compensation cell code register (SYSCFG_CCCR)
  934. */
  935. __STATIC_INLINE uint32_t LL_SYSCFG_MMCGetCellCompensationCode(void)
  936. {
  937. return (uint32_t)(READ_BIT(SYSCFG->CCCSR, SYSCFG_CCCSR_CS_MMC));
  938. }
  939. #endif /*SYSCFG_CCCSR_CS_MMC*/
  940. /**
  941. * @brief Get I/O compensation cell value for PMOS transistors
  942. * @rmtoll CCVR PCV LL_SYSCFG_GetPMOSCompensationValue
  943. * @retval Returned value is the I/O compensation cell value for PMOS transistors
  944. */
  945. __STATIC_INLINE uint32_t LL_SYSCFG_GetPMOSCompensationValue(void)
  946. {
  947. return (uint32_t)(READ_BIT(SYSCFG->CCVR, SYSCFG_CCVR_PCV));
  948. }
  949. /**
  950. * @brief Get I/O compensation cell value for NMOS transistors
  951. * @rmtoll CCVR NCV LL_SYSCFG_GetNMOSCompensationValue
  952. * @retval Returned value is the I/O compensation cell value for NMOS transistors
  953. */
  954. __STATIC_INLINE uint32_t LL_SYSCFG_GetNMOSCompensationValue(void)
  955. {
  956. return (uint32_t)(READ_BIT(SYSCFG->CCVR, SYSCFG_CCVR_NCV));
  957. }
  958. /**
  959. * @brief Set I/O compensation cell code for PMOS transistors
  960. * @rmtoll CCCR PCC LL_SYSCFG_SetPMOSCompensationCode
  961. * @param PMOSCode PMOS compensation code
  962. * This code is applied to the I/O compensation cell when the CS bit of the
  963. * SYSCFG_CMPCR is set
  964. * @retval None
  965. */
  966. __STATIC_INLINE void LL_SYSCFG_SetPMOSCompensationCode(uint32_t PMOSCode)
  967. {
  968. MODIFY_REG(SYSCFG->CCCR, SYSCFG_CCCR_PCC, PMOSCode);
  969. }
  970. /**
  971. * @brief Get I/O compensation cell code for PMOS transistors
  972. * @rmtoll CCCR PCC LL_SYSCFG_GetPMOSCompensationCode
  973. * @retval Returned value is the I/O compensation cell code for PMOS transistors
  974. */
  975. __STATIC_INLINE uint32_t LL_SYSCFG_GetPMOSCompensationCode(void)
  976. {
  977. return (uint32_t)(READ_BIT(SYSCFG->CCCR, SYSCFG_CCCR_PCC));
  978. }
  979. #ifdef SYSCFG_CCCR_PCC_MMC
  980. /**
  981. * @brief Set I/O compensation cell code for PMOS transistors corresponding to the VDDMMC power rail
  982. * @rmtoll CCCR PCC LL_SYSCFG_SetPMOSCompensationCode
  983. * @param PMOSCode PMOS compensation code
  984. * This code is applied to the I/O compensation cell when the CS bit of the
  985. * SYSCFG_CMPCR is set
  986. * @retval None
  987. */
  988. __STATIC_INLINE void LL_SYSCFG_MMCSetPMOSCompensationCode(uint32_t PMOSCode)
  989. {
  990. MODIFY_REG(SYSCFG->CCCR, SYSCFG_CCCR_PCC_MMC, PMOSCode);
  991. }
  992. /**
  993. * @brief Get I/O compensation cell code for PMOS transistors corresponding to the VDDMMC power rail
  994. * @rmtoll CCCR PCC LL_SYSCFG_GetPMOSCompensationCode
  995. * @retval Returned value is the I/O compensation cell code for PMOS transistors
  996. */
  997. __STATIC_INLINE uint32_t LL_SYSCFG_MMCGetPMOSCompensationCode(void)
  998. {
  999. return (uint32_t)(READ_BIT(SYSCFG->CCCR, SYSCFG_CCCR_PCC_MMC));
  1000. }
  1001. #endif /* SYSCFG_CCCR_PCC_MMC */
  1002. /**
  1003. * @brief Set I/O compensation cell code for NMOS transistors
  1004. * @rmtoll CCCR NCC LL_SYSCFG_SetNMOSCompensationCode
  1005. * @param NMOSCode NMOS compensation code
  1006. * This code is applied to the I/O compensation cell when the CS bit of the
  1007. * SYSCFG_CMPCR is set
  1008. * @retval None
  1009. */
  1010. __STATIC_INLINE void LL_SYSCFG_SetNMOSCompensationCode(uint32_t NMOSCode)
  1011. {
  1012. MODIFY_REG(SYSCFG->CCCR, SYSCFG_CCCR_NCC, NMOSCode);
  1013. }
  1014. /**
  1015. * @brief Get I/O compensation cell code for NMOS transistors
  1016. * @rmtoll CCCR NCC LL_SYSCFG_GetNMOSCompensationCode
  1017. * @retval Returned value is the I/O compensation cell code for NMOS transistors
  1018. */
  1019. __STATIC_INLINE uint32_t LL_SYSCFG_GetNMOSCompensationCode(void)
  1020. {
  1021. return (uint32_t)(READ_BIT(SYSCFG->CCCR, SYSCFG_CCCR_NCC));
  1022. }
  1023. #ifdef SYSCFG_CCCR_NCC_MMC
  1024. /**
  1025. * @brief Set I/O compensation cell code for NMOS transistors on the VDDMMC power rail.
  1026. * @rmtoll CCCR NCC LL_SYSCFG_SetNMOSCompensationCode
  1027. * @param NMOSCode: NMOS compensation code
  1028. * This code is applied to the I/O compensation cell when the CS bit of the
  1029. * SYSCFG_CMPCR is set
  1030. * @retval None
  1031. */
  1032. __STATIC_INLINE void LL_SYSCFG_VDMMCSetNMOSCompensationCode(uint32_t NMOSCode)
  1033. {
  1034. MODIFY_REG(SYSCFG->CCCR, SYSCFG_CCCR_NCC_MMC, NMOSCode);
  1035. }
  1036. /**
  1037. * @brief Get I/O compensation cell code for NMOS transistors on the VDDMMC power rail.
  1038. * @rmtoll CCCR NCC LL_SYSCFG_GetNMOSCompensationCode
  1039. * @retval Returned value is the I/O compensation cell code for NMOS transistors
  1040. */
  1041. __STATIC_INLINE uint32_t LL_SYSCFG_VDMMCGetNMOSCompensationCode(void)
  1042. {
  1043. return (uint32_t)(READ_BIT(SYSCFG->CCCR, SYSCFG_CCCR_NCC_MMC));
  1044. }
  1045. #endif /*SYSCFG_CCCR_NCC_MMC*/
  1046. #ifdef SYSCFG_PKGR_PKG
  1047. /**
  1048. * @brief Get the device package
  1049. * @rmtoll PKGR PKG LL_SYSCFG_GetPackage
  1050. * @retval Returned value can be one of the following values:
  1051. * @arg @ref LL_SYSCFG_LQFP100_PACKAGE (*)
  1052. * @arg @ref LL_SYSCFG_TQFP144_PACKAGE (*)
  1053. * @arg @ref LL_SYSCFG_TQFP176_UFBGA176_PACKAGE (*)
  1054. * @arg @ref LL_SYSCFG_LQFP208_TFBGA240_PACKAGE (*)
  1055. * @arg @ref LL_SYSCFG_VFQFPN68_INDUS_PACKAGE (*)
  1056. * @arg @ref LL_SYSCFG_TFBGA100_LQFP100_PACKAGE (*)
  1057. * @arg @ref LL_SYSCFG_LQFP100_INDUS_PACKAGE (**)
  1058. * @arg @ref LL_SYSCFG_TFBGA100_INDUS_PACKAGE (**)
  1059. * @arg @ref LL_SYSCFG_WLCSP115_INDUS_PACKAGE (**)
  1060. * @arg @ref LL_SYSCFG_LQFP144_PACKAGE (**)
  1061. * @arg @ref LL_SYSCFG_UFBGA144_PACKAGE (**)
  1062. * @arg @ref LL_SYSCFG_LQFP144_INDUS_PACKAGE (**)
  1063. * @arg @ref LL_SYSCFG_UFBGA169_INDUS_PACKAGE (**)
  1064. * @arg @ref LL_SYSCFG_UFBGA176PLUS25_INDUS_PACKAGE (**)
  1065. * @arg @ref LL_SYSCFG_LQFP176_INDUS_PACKAGE (**)
  1066. *
  1067. * (*) : For stm32h74xxx and stm32h75xxx family lines.
  1068. * (**): For stm32h72xxx and stm32h73xxx family lines.
  1069. */
  1070. __STATIC_INLINE uint32_t LL_SYSCFG_GetPackage(void)
  1071. {
  1072. return (uint32_t)(READ_BIT(SYSCFG->PKGR, SYSCFG_PKGR_PKG));
  1073. }
  1074. #endif /*SYSCFG_PKGR_PKG*/
  1075. #ifdef SYSCFG_UR0_RDP
  1076. /**
  1077. * @brief Get the Flash memory protection level
  1078. * @rmtoll UR0 RDP LL_SYSCFG_GetFLashProtectionLevel
  1079. * @retval Returned value can be one of the following values:
  1080. * 0xAA : RDP level 0
  1081. * 0xCC : RDP level 2
  1082. * Any other value : RDP level 1
  1083. */
  1084. __STATIC_INLINE uint32_t LL_SYSCFG_GetFLashProtectionLevel(void)
  1085. {
  1086. return (uint32_t)(READ_BIT(SYSCFG->UR0, SYSCFG_UR0_RDP));
  1087. }
  1088. #ifdef SYSCFG_UR0_BKS
  1089. /**
  1090. * @brief Indicate if the Flash memory bank addresses are inverted or not
  1091. * @rmtoll UR0 BKS LL_SYSCFG_IsFLashBankAddressesSwaped
  1092. * @retval State of bit (1 or 0).
  1093. */
  1094. __STATIC_INLINE uint32_t LL_SYSCFG_IsFLashBankAddressesSwaped(void)
  1095. {
  1096. return ((READ_BIT(SYSCFG->UR0, SYSCFG_UR0_BKS) == 0U) ? 1UL : 0UL);
  1097. }
  1098. #endif /*SYSCFG_UR0_BKS*/
  1099. /**
  1100. * @brief Get the BOR Threshold Reset Level
  1101. * @rmtoll UR2 BORH LL_SYSCFG_GetBrownoutResetLevel
  1102. * @retval Returned value can be one of the following values:
  1103. * @arg @ref LL_SYSCFG_BOR_HIGH_RESET_LEVEL
  1104. * @arg @ref LL_SYSCFG_BOR_MEDIUM_RESET_LEVEL
  1105. * @arg @ref LL_SYSCFG_BOR_LOW_RESET_LEVEL
  1106. * @arg @ref LL_SYSCFG_BOR_OFF_RESET_LEVEL
  1107. */
  1108. __STATIC_INLINE uint32_t LL_SYSCFG_GetBrownoutResetLevel(void)
  1109. {
  1110. return (uint32_t)(READ_BIT(SYSCFG->UR2, SYSCFG_UR2_BORH));
  1111. }
  1112. /**
  1113. * @brief BootCM7 address 0 configuration
  1114. * @rmtoll UR2 BOOT_ADD0 LL_SYSCFG_SetCM7BootAddress0
  1115. * @param BootAddress :Specifies the CM7 Boot Address to be loaded in Address0
  1116. * @retval None
  1117. */
  1118. __STATIC_INLINE void LL_SYSCFG_SetCM7BootAddress0(uint16_t BootAddress)
  1119. {
  1120. /* Configure CM7 BOOT ADD0 */
  1121. #if defined(DUAL_CORE)
  1122. MODIFY_REG(SYSCFG->UR2, SYSCFG_UR2_BCM7_ADD0, ((uint32_t)BootAddress << SYSCFG_UR2_BCM7_ADD0_Pos));
  1123. #else
  1124. MODIFY_REG(SYSCFG->UR2, SYSCFG_UR2_BOOT_ADD0, ((uint32_t)BootAddress << SYSCFG_UR2_BOOT_ADD0_Pos));
  1125. #endif /*DUAL_CORE*/
  1126. }
  1127. /**
  1128. * @brief Get BootCM7 address 0
  1129. * @rmtoll UR2 BOOT_ADD0 LL_SYSCFG_GetCM7BootAddress0
  1130. * @retval Returned the CM7 Boot Address0
  1131. */
  1132. __STATIC_INLINE uint16_t LL_SYSCFG_GetCM7BootAddress0(void)
  1133. {
  1134. /* Get CM7 BOOT ADD0 */
  1135. #if defined(DUAL_CORE)
  1136. return (uint16_t)((uint32_t)READ_BIT(SYSCFG->UR2, SYSCFG_UR2_BCM7_ADD0) >> SYSCFG_UR2_BCM7_ADD0_Pos);
  1137. #else
  1138. return (uint16_t)((uint32_t)READ_BIT(SYSCFG->UR2, SYSCFG_UR2_BOOT_ADD0) >> SYSCFG_UR2_BOOT_ADD0_Pos);
  1139. #endif /*DUAL_CORE*/
  1140. }
  1141. /**
  1142. * @brief BootCM7 address 1 configuration
  1143. * @rmtoll UR3 BOOT_ADD1 LL_SYSCFG_SetCM7BootAddress1
  1144. * @param BootAddress :Specifies the CM7 Boot Address to be loaded in Address1
  1145. * @retval None
  1146. */
  1147. __STATIC_INLINE void LL_SYSCFG_SetCM7BootAddress1(uint16_t BootAddress)
  1148. {
  1149. /* Configure CM7 BOOT ADD1 */
  1150. #if defined(DUAL_CORE)
  1151. MODIFY_REG(SYSCFG->UR3, SYSCFG_UR3_BCM7_ADD1, BootAddress);
  1152. #else
  1153. MODIFY_REG(SYSCFG->UR3, SYSCFG_UR3_BOOT_ADD1, BootAddress);
  1154. #endif /*DUAL_CORE*/
  1155. }
  1156. /**
  1157. * @brief Get BootCM7 address 1
  1158. * @rmtoll UR3 BOOT_ADD1 LL_SYSCFG_GetCM7BootAddress1
  1159. * @retval Returned the CM7 Boot Address0
  1160. */
  1161. __STATIC_INLINE uint16_t LL_SYSCFG_GetCM7BootAddress1(void)
  1162. {
  1163. /* Get CM7 BOOT ADD0 */
  1164. #if defined(DUAL_CORE)
  1165. return (uint16_t)(READ_BIT(SYSCFG->UR3, SYSCFG_UR3_BCM7_ADD1));
  1166. #else
  1167. return (uint16_t)(READ_BIT(SYSCFG->UR3, SYSCFG_UR3_BOOT_ADD1));
  1168. #endif /* DUAL_CORE */
  1169. }
  1170. #if defined(DUAL_CORE)
  1171. /**
  1172. * @brief BootCM4 address 0 configuration
  1173. * @rmtoll UR3 BCM4_ADD0 LL_SYSCFG_SetCM4BootAddress0
  1174. * @param BootAddress :Specifies the CM4 Boot Address to be loaded in Address0
  1175. * @retval None
  1176. */
  1177. __STATIC_INLINE void LL_SYSCFG_SetCM4BootAddress0(uint16_t BootAddress)
  1178. {
  1179. /* Configure CM4 BOOT ADD0 */
  1180. MODIFY_REG(SYSCFG->UR3, SYSCFG_UR3_BCM4_ADD0, ((uint32_t)BootAddress << SYSCFG_UR3_BCM4_ADD0_Pos));
  1181. }
  1182. /**
  1183. * @brief Get BootCM4 address 0
  1184. * @rmtoll UR3 BCM4_ADD0 LL_SYSCFG_GetCM4BootAddress0
  1185. * @retval Returned the CM4 Boot Address0
  1186. */
  1187. __STATIC_INLINE uint16_t LL_SYSCFG_GetCM4BootAddress0(void)
  1188. {
  1189. /* Get CM4 BOOT ADD0 */
  1190. return (uint16_t)((uint32_t)READ_BIT(SYSCFG->UR3, SYSCFG_UR3_BCM4_ADD0) >> SYSCFG_UR3_BCM4_ADD0_Pos);
  1191. }
  1192. /**
  1193. * @brief BootCM4 address 1 configuration
  1194. * @rmtoll UR4 BCM4_ADD1 LL_SYSCFG_SetCM4BootAddress1
  1195. * @param BootAddress :Specifies the CM4 Boot Address to be loaded in Address1
  1196. * @retval None
  1197. */
  1198. __STATIC_INLINE void LL_SYSCFG_SetCM4BootAddress1(uint16_t BootAddress)
  1199. {
  1200. /* Configure CM4 BOOT ADD1 */
  1201. MODIFY_REG(SYSCFG->UR4, SYSCFG_UR4_BCM4_ADD1, BootAddress);
  1202. }
  1203. /**
  1204. * @brief Get BootCM4 address 1
  1205. * @rmtoll UR4 BCM4_ADD1 LL_SYSCFG_GetCM4BootAddress1
  1206. * @retval Returned the CM4 Boot Address0
  1207. */
  1208. __STATIC_INLINE uint16_t LL_SYSCFG_GetCM4BootAddress1(void)
  1209. {
  1210. /* Get CM4 BOOT ADD0 */
  1211. return (uint16_t)(READ_BIT(SYSCFG->UR4, SYSCFG_UR4_BCM4_ADD1));
  1212. }
  1213. #endif /*DUAL_CORE*/
  1214. /**
  1215. * @brief Indicates if the flash protected area (Bank 1) is erased by a mass erase
  1216. * @rmtoll UR4 MEPAD_BANK1 LL_SYSCFG_IsFlashB1ProtectedAreaErasable
  1217. * @retval State of bit (1 or 0).
  1218. */
  1219. __STATIC_INLINE uint32_t LL_SYSCFG_IsFlashB1ProtectedAreaErasable(void)
  1220. {
  1221. return ((READ_BIT(SYSCFG->UR4, SYSCFG_UR4_MEPAD_BANK1) == SYSCFG_UR4_MEPAD_BANK1) ? 1UL : 0UL);
  1222. }
  1223. /**
  1224. * @brief Indicates if the flash secured area (Bank 1) is erased by a mass erase
  1225. * @rmtoll UR5 MESAD_BANK1 LL_SYSCFG_IsFlashB1SecuredAreaErasable
  1226. * @retval State of bit (1 or 0).
  1227. */
  1228. __STATIC_INLINE uint32_t LL_SYSCFG_IsFlashB1SecuredAreaErasable(void)
  1229. {
  1230. return ((READ_BIT(SYSCFG->UR5, SYSCFG_UR5_MESAD_BANK1) == SYSCFG_UR5_MESAD_BANK1) ? 1UL : 0UL);
  1231. }
  1232. /**
  1233. * @brief Indicates if the sector 0 of the Flash memory bank 1 is write protected
  1234. * @rmtoll UR5 WRPN_BANK1 LL_SYSCFG_IsFlashB1Sector0WriteProtected
  1235. * @retval State of bit (1 or 0).
  1236. */
  1237. __STATIC_INLINE uint32_t LL_SYSCFG_IsFlashB1Sector0WriteProtected(void)
  1238. {
  1239. return ((READ_BIT(SYSCFG->UR5, SYSCFG_UR5_WRPN_BANK1) == (SYSCFG_UR5_WRPN_BANK1 & LL_SYSCFG_FLASH_B1_SECTOR0_STATUS_BIT)) ? 1UL : 0UL);
  1240. }
  1241. /**
  1242. * @brief Indicates if the sector 1 of the Flash memory bank 1 is write protected
  1243. * @rmtoll UR5 WRPN_BANK1 LL_SYSCFG_IsFlashB1Sector1WriteProtected
  1244. * @retval State of bit (1 or 0).
  1245. */
  1246. __STATIC_INLINE uint32_t LL_SYSCFG_IsFlashB1Sector1WriteProtected(void)
  1247. {
  1248. return ((READ_BIT(SYSCFG->UR5, SYSCFG_UR5_WRPN_BANK1) == (SYSCFG_UR5_WRPN_BANK1 & LL_SYSCFG_FLASH_B1_SECTOR1_STATUS_BIT)) ? 1UL : 0UL);
  1249. }
  1250. /**
  1251. * @brief Indicates if the sector 2 of the Flash memory bank 1 is write protected
  1252. * @rmtoll UR5 WRPN_BANK1 LL_SYSCFG_IsFlashB1Sector2WriteProtected
  1253. * @retval State of bit (1 or 0).
  1254. */
  1255. __STATIC_INLINE uint32_t LL_SYSCFG_IsFlashB1Sector2WriteProtected(void)
  1256. {
  1257. return ((READ_BIT(SYSCFG->UR5, SYSCFG_UR5_WRPN_BANK1) == (SYSCFG_UR5_WRPN_BANK1 & LL_SYSCFG_FLASH_B1_SECTOR2_STATUS_BIT)) ? 1UL : 0UL);
  1258. }
  1259. /**
  1260. * @brief Indicates if the sector 3 of the Flash memory bank 1 is write protected
  1261. * @rmtoll UR5 WRPN_BANK1 LL_SYSCFG_IsFlashB1Sector3WriteProtected
  1262. * @retval State of bit (1 or 0).
  1263. */
  1264. __STATIC_INLINE uint32_t LL_SYSCFG_IsFlashB1Sector3WriteProtected(void)
  1265. {
  1266. return ((READ_BIT(SYSCFG->UR5, SYSCFG_UR5_WRPN_BANK1) == (SYSCFG_UR5_WRPN_BANK1 & LL_SYSCFG_FLASH_B1_SECTOR3_STATUS_BIT)) ? 1UL : 0UL);
  1267. }
  1268. /**
  1269. * @brief Indicates if the sector 4 of the Flash memory bank 1 is write protected
  1270. * @rmtoll UR5 WRPN_BANK1 LL_SYSCFG_IsFlashB1Sector4WriteProtected
  1271. * @retval State of bit (1 or 0).
  1272. */
  1273. __STATIC_INLINE uint32_t LL_SYSCFG_IsFlashB1Sector4WriteProtected(void)
  1274. {
  1275. return ((READ_BIT(SYSCFG->UR5, SYSCFG_UR5_WRPN_BANK1) == (SYSCFG_UR5_WRPN_BANK1 & LL_SYSCFG_FLASH_B1_SECTOR4_STATUS_BIT)) ? 1UL : 0UL);
  1276. }
  1277. /**
  1278. * @brief Indicates if the sector 5 of the Flash memory bank 1 is write protected
  1279. * @rmtoll UR5 WRPN_BANK1 LL_SYSCFG_IsFlashB1Sector5WriteProtected
  1280. * @retval State of bit (1 or 0).
  1281. */
  1282. __STATIC_INLINE uint32_t LL_SYSCFG_IsFlashB1Sector5WriteProtected(void)
  1283. {
  1284. return ((READ_BIT(SYSCFG->UR5, SYSCFG_UR5_WRPN_BANK1) == (SYSCFG_UR5_WRPN_BANK1 & LL_SYSCFG_FLASH_B1_SECTOR5_STATUS_BIT)) ? 1UL : 0UL);
  1285. }
  1286. /**
  1287. * @brief Indicates if the sector 6 of the Flash memory bank 1 is write protected
  1288. * @rmtoll UR5 WRPN_BANK1 LL_SYSCFG_IsFlashB1Sector6WriteProtected
  1289. * @retval State of bit (1 or 0).
  1290. */
  1291. __STATIC_INLINE uint32_t LL_SYSCFG_IsFlashB1Sector6WriteProtected(void)
  1292. {
  1293. return ((READ_BIT(SYSCFG->UR5, SYSCFG_UR5_WRPN_BANK1) == (SYSCFG_UR5_WRPN_BANK1 & LL_SYSCFG_FLASH_B1_SECTOR6_STATUS_BIT)) ? 1UL : 0UL);
  1294. }
  1295. /**
  1296. * @brief Indicates if the sector 7 of the Flash memory bank 1 is write protected
  1297. * @rmtoll UR5 WRPN_BANK1 LL_SYSCFG_IsFlashB1Sector7WriteProtected
  1298. * @retval State of bit (1 or 0).
  1299. */
  1300. __STATIC_INLINE uint32_t LL_SYSCFG_IsFlashB1Sector7WriteProtected(void)
  1301. {
  1302. return ((READ_BIT(SYSCFG->UR5, SYSCFG_UR5_WRPN_BANK1) == (SYSCFG_UR5_WRPN_BANK1 & LL_SYSCFG_FLASH_B1_SECTOR7_STATUS_BIT)) ? 1UL : 0UL);
  1303. }
  1304. /**
  1305. * @brief Get the protected area start address for Flash bank 1
  1306. * @rmtoll UR6 PABEG_BANK1 LL_SYSCFG_GetFlashB1ProtectedAreaStartAddress
  1307. * @retval Returned the protected area start address for Flash bank 1
  1308. */
  1309. __STATIC_INLINE uint32_t LL_SYSCFG_GetFlashB1ProtectedAreaStartAddress(void)
  1310. {
  1311. return (uint32_t)(READ_BIT(SYSCFG->UR6, SYSCFG_UR6_PABEG_BANK1));
  1312. }
  1313. /**
  1314. * @brief Get the protected area end address for Flash bank 1
  1315. * @rmtoll UR6 PAEND_BANK1 LL_SYSCFG_GetFlashB1ProtectedAreaEndAddress
  1316. * @retval Returned the protected area end address for Flash bank 1
  1317. */
  1318. __STATIC_INLINE uint32_t LL_SYSCFG_GetFlashB1ProtectedAreaEndAddress(void)
  1319. {
  1320. return (uint32_t)(READ_BIT(SYSCFG->UR6, SYSCFG_UR6_PAEND_BANK1));
  1321. }
  1322. /**
  1323. * @brief Get the secured area start address for Flash bank 1
  1324. * @rmtoll UR7 SABEG_BANK1 LL_SYSCFG_GetFlashB1SecuredAreaStartAddress
  1325. * @retval Returned the secured area start address for Flash bank 1
  1326. */
  1327. __STATIC_INLINE uint32_t LL_SYSCFG_GetFlashB1SecuredAreaStartAddress(void)
  1328. {
  1329. return (uint32_t)(READ_BIT(SYSCFG->UR7, SYSCFG_UR7_SABEG_BANK1));
  1330. }
  1331. /**
  1332. * @brief Get the secured area end address for Flash bank 1
  1333. * @rmtoll UR7 SAEND_BANK1 LL_SYSCFG_GetFlashB1SecuredAreaEndAddress
  1334. * @retval Returned the secured area end address for Flash bank 1
  1335. */
  1336. __STATIC_INLINE uint32_t LL_SYSCFG_GetFlashB1SecuredAreaEndAddress(void)
  1337. {
  1338. return (uint32_t)(READ_BIT(SYSCFG->UR7, SYSCFG_UR7_SAEND_BANK1));
  1339. }
  1340. #ifdef SYSCFG_UR8_MEPAD_BANK2
  1341. /**
  1342. * @brief Indicates if the flash protected area (Bank 2) is erased by a mass erase
  1343. * @rmtoll UR8 MEPAD_BANK2 LL_SYSCFG_IsFlashB2ProtectedAreaErasable
  1344. * @retval State of bit (1 or 0).
  1345. */
  1346. __STATIC_INLINE uint32_t LL_SYSCFG_IsFlashB2ProtectedAreaErasable(void)
  1347. {
  1348. return ((READ_BIT(SYSCFG->UR8, SYSCFG_UR8_MEPAD_BANK2) == SYSCFG_UR8_MEPAD_BANK2) ? 1UL : 0UL);
  1349. }
  1350. /**
  1351. * @brief Indicates if the flash secured area (Bank 2) is erased by a mass erase
  1352. * @rmtoll UR8 MESAD_BANK2 LL_SYSCFG_IsFlashB2SecuredAreaErasable
  1353. * @retval State of bit (1 or 0).
  1354. */
  1355. __STATIC_INLINE uint32_t LL_SYSCFG_IsFlashB2SecuredAreaErasable(void)
  1356. {
  1357. return ((READ_BIT(SYSCFG->UR8, SYSCFG_UR8_MESAD_BANK2) == SYSCFG_UR8_MESAD_BANK2) ? 1UL : 0UL);
  1358. }
  1359. #endif /*SYSCFG_UR8_MEPAD_BANK2*/
  1360. #ifdef SYSCFG_UR9_WRPN_BANK2
  1361. /**
  1362. * @brief Indicates if the sector 0 of the Flash memory bank 2 is write protected
  1363. * @rmtoll UR9 WRPN_BANK2 LL_SYSCFG_IsFlashB2Sector0WriteProtected
  1364. * @retval State of bit (1 or 0).
  1365. */
  1366. __STATIC_INLINE uint32_t LL_SYSCFG_IsFlashB2Sector0WriteProtected(void)
  1367. {
  1368. return ((READ_BIT(SYSCFG->UR9, SYSCFG_UR9_WRPN_BANK2) == (SYSCFG_UR9_WRPN_BANK2 & LL_SYSCFG_FLASH_B2_SECTOR0_STATUS_BIT)) ? 1UL : 0UL);
  1369. }
  1370. /**
  1371. * @brief Indicates if the sector 1 of the Flash memory bank 2 is write protected
  1372. * @rmtoll UR9 WRPN_BANK2 LL_SYSCFG_IsFlashB2Sector1WriteProtected
  1373. * @retval State of bit (1 or 0).
  1374. */
  1375. __STATIC_INLINE uint32_t LL_SYSCFG_IsFlashB2Sector1WriteProtected(void)
  1376. {
  1377. return ((READ_BIT(SYSCFG->UR9, SYSCFG_UR9_WRPN_BANK2) == (SYSCFG_UR9_WRPN_BANK2 & LL_SYSCFG_FLASH_B2_SECTOR1_STATUS_BIT)) ? 1UL : 0UL);
  1378. }
  1379. /**
  1380. * @brief Indicates if the sector 2 of the Flash memory bank 2 is write protected
  1381. * @rmtoll UR9 WRPN_BANK2 LL_SYSCFG_IsFlashB2Sector2WriteProtected
  1382. * @retval State of bit (1 or 0).
  1383. */
  1384. __STATIC_INLINE uint32_t LL_SYSCFG_IsFlashB2Sector2WriteProtected(void)
  1385. {
  1386. return ((READ_BIT(SYSCFG->UR9, SYSCFG_UR9_WRPN_BANK2) == (SYSCFG_UR9_WRPN_BANK2 & LL_SYSCFG_FLASH_B2_SECTOR2_STATUS_BIT)) ? 1UL : 0UL);
  1387. }
  1388. /**
  1389. * @brief Indicates if the sector 3 of the Flash memory bank 2 is write protected
  1390. * @rmtoll UR9 WRPN_BANK2 LL_SYSCFG_IsFlashB2Sector3WriteProtected
  1391. * @retval State of bit (1 or 0).
  1392. */
  1393. __STATIC_INLINE uint32_t LL_SYSCFG_IsFlashB2Sector3WriteProtected(void)
  1394. {
  1395. return ((READ_BIT(SYSCFG->UR9, SYSCFG_UR9_WRPN_BANK2) == (SYSCFG_UR9_WRPN_BANK2 & LL_SYSCFG_FLASH_B2_SECTOR3_STATUS_BIT)) ? 1UL : 0UL);
  1396. }
  1397. /**
  1398. * @brief Indicates if the sector 4 of the Flash memory bank 2 is write protected
  1399. * @rmtoll UR9 WRPN_BANK2 LL_SYSCFG_IsFlashB2Sector4WriteProtected
  1400. * @retval State of bit (1 or 0).
  1401. */
  1402. __STATIC_INLINE uint32_t LL_SYSCFG_IsFlashB2Sector4WriteProtected(void)
  1403. {
  1404. return ((READ_BIT(SYSCFG->UR9, SYSCFG_UR9_WRPN_BANK2) == (SYSCFG_UR9_WRPN_BANK2 & LL_SYSCFG_FLASH_B2_SECTOR4_STATUS_BIT)) ? 1UL : 0UL);
  1405. }
  1406. /**
  1407. * @brief Indicates if the sector 5 of the Flash memory bank 2 is write protected
  1408. * @rmtoll UR9 WRPN_BANK2 LL_SYSCFG_IsFlashB2Sector5WriteProtected
  1409. * @retval State of bit (1 or 0).
  1410. */
  1411. __STATIC_INLINE uint32_t LL_SYSCFG_IsFlashB2Sector5WriteProtected(void)
  1412. {
  1413. return ((READ_BIT(SYSCFG->UR9, SYSCFG_UR9_WRPN_BANK2) == (SYSCFG_UR9_WRPN_BANK2 & LL_SYSCFG_FLASH_B2_SECTOR5_STATUS_BIT)) ? 1UL : 0UL);
  1414. }
  1415. /**
  1416. * @brief Indicates if the sector 6 of the Flash memory bank 2 is write protected
  1417. * @rmtoll UR9 WRPN_BANK2 LL_SYSCFG_IsFlashB2Sector6WriteProtected
  1418. * @retval State of bit (1 or 0).
  1419. */
  1420. __STATIC_INLINE uint32_t LL_SYSCFG_IsFlashB2Sector6WriteProtected(void)
  1421. {
  1422. return ((READ_BIT(SYSCFG->UR9, SYSCFG_UR9_WRPN_BANK2) == (SYSCFG_UR9_WRPN_BANK2 & LL_SYSCFG_FLASH_B2_SECTOR6_STATUS_BIT)) ? 1UL : 0UL);
  1423. }
  1424. /**
  1425. * @brief Indicates if the sector 7 of the Flash memory bank 2 is write protected
  1426. * @rmtoll UR9 WRPN_BANK2 LL_SYSCFG_IsFlashB2Sector7WriteProtected
  1427. * @retval State of bit (1 or 0).
  1428. */
  1429. __STATIC_INLINE uint32_t LL_SYSCFG_IsFlashB2Sector7WriteProtected(void)
  1430. {
  1431. return ((READ_BIT(SYSCFG->UR9, SYSCFG_UR9_WRPN_BANK2) == (SYSCFG_UR9_WRPN_BANK2 & LL_SYSCFG_FLASH_B2_SECTOR7_STATUS_BIT)) ? 1UL : 0UL);
  1432. }
  1433. /**
  1434. * @brief Get the protected area start address for Flash bank 2
  1435. * @rmtoll UR9 PABEG_BANK2 LL_SYSCFG_GetFlashB2ProtectedAreaStartAddress
  1436. * @retval Returned the protected area start address for Flash bank 2
  1437. */
  1438. __STATIC_INLINE uint32_t LL_SYSCFG_GetFlashB2ProtectedAreaStartAddress(void)
  1439. {
  1440. return (uint32_t)(READ_BIT(SYSCFG->UR9, SYSCFG_UR9_PABEG_BANK2));
  1441. }
  1442. #endif /*SYSCFG_UR9_WRPN_BANK2*/
  1443. #ifdef SYSCFG_UR10_PAEND_BANK2
  1444. /**
  1445. * @brief Get the protected area end address for Flash bank 2
  1446. * @rmtoll UR10 PAEND_BANK2 LL_SYSCFG_GetFlashB2ProtectedAreaEndAddress
  1447. * @retval Returned the protected area end address for Flash bank 2
  1448. */
  1449. __STATIC_INLINE uint32_t LL_SYSCFG_GetFlashB2ProtectedAreaEndAddress(void)
  1450. {
  1451. return (uint32_t)(READ_BIT(SYSCFG->UR10, SYSCFG_UR10_PAEND_BANK2));
  1452. }
  1453. /**
  1454. * @brief Get the secured area start address for Flash bank 2
  1455. * @rmtoll UR10 SABEG_BANK2 LL_SYSCFG_GetFlashB2SecuredAreaStartAddress
  1456. * @retval Returned the secured area start address for Flash bank 2
  1457. */
  1458. __STATIC_INLINE uint32_t LL_SYSCFG_GetFlashB2SecuredAreaStartAddress(void)
  1459. {
  1460. return (uint32_t)(READ_BIT(SYSCFG->UR10, SYSCFG_UR10_SABEG_BANK2));
  1461. }
  1462. #endif /*SYSCFG_UR10_PAEND_BANK2*/
  1463. #ifdef SYSCFG_UR11_SAEND_BANK2
  1464. /**
  1465. * @brief Get the secured area end address for Flash bank 2
  1466. * @rmtoll UR11 SAEND_BANK2 LL_SYSCFG_GetFlashB2SecuredAreaEndAddress
  1467. * @retval Returned the secured area end address for Flash bank 2
  1468. */
  1469. __STATIC_INLINE uint32_t LL_SYSCFG_GetFlashB2SecuredAreaEndAddress(void)
  1470. {
  1471. return (uint32_t)(READ_BIT(SYSCFG->UR11, SYSCFG_UR11_SAEND_BANK2));
  1472. }
  1473. #endif /*SYSCFG_UR11_SAEND_BANK2*/
  1474. /**
  1475. * @brief Get the Independent Watchdog 1 control mode (Software or Hardware)
  1476. * @rmtoll UR11 IWDG1M LL_SYSCFG_GetIWDG1ControlMode
  1477. * @retval Returned value can be one of the following values:
  1478. * @arg @ref LL_SYSCFG_IWDG1_SW_CONTROL_MODE
  1479. * @arg @ref LL_SYSCFG_IWDG1_HW_CONTROL_MODE
  1480. */
  1481. __STATIC_INLINE uint32_t LL_SYSCFG_GetIWDG1ControlMode(void)
  1482. {
  1483. return (uint32_t)(READ_BIT(SYSCFG->UR11, SYSCFG_UR11_IWDG1M));
  1484. }
  1485. #if defined (DUAL_CORE)
  1486. /**
  1487. * @brief Get the Independent Watchdog 2 control mode (Software or Hardware)
  1488. * @rmtoll UR12 IWDG2M LL_SYSCFG_GetIWDG2ControlMode
  1489. * @retval Returned value can be one of the following values:
  1490. * @arg @ref LL_SYSCFG_IWDG2_SW_CONTROL_MODE
  1491. * @arg @ref LL_SYSCFG_IWDG2_HW_CONTROL_MODE
  1492. */
  1493. __STATIC_INLINE uint32_t LL_SYSCFG_GetIWDG2ControlMode(void)
  1494. {
  1495. return (uint32_t)(READ_BIT(SYSCFG->UR12, SYSCFG_UR12_IWDG2M));
  1496. }
  1497. #endif /* DUAL_CORE */
  1498. /**
  1499. * @brief Indicates the Secure mode status
  1500. * @rmtoll UR12 SECURE LL_SYSCFG_IsSecureModeEnabled
  1501. * @retval State of bit (1 or 0).
  1502. */
  1503. __STATIC_INLINE uint32_t LL_SYSCFG_IsSecureModeEnabled(void)
  1504. {
  1505. return ((READ_BIT(SYSCFG->UR12, SYSCFG_UR12_SECURE) == SYSCFG_UR12_SECURE) ? 1UL : 0UL);
  1506. }
  1507. /**
  1508. * @brief Indicates if a reset is generated when D1 domain enters DStandby mode
  1509. * @rmtoll UR13 D1SBRST LL_SYSCFG_IsD1StandbyGenerateReset
  1510. * @retval State of bit (1 or 0).
  1511. */
  1512. __STATIC_INLINE uint32_t LL_SYSCFG_IsD1StandbyGenerateReset(void)
  1513. {
  1514. return ((READ_BIT(SYSCFG->UR13, SYSCFG_UR13_D1SBRST) == 0U) ? 1UL : 0UL);
  1515. }
  1516. /**
  1517. * @brief Get the secured DTCM RAM size
  1518. * @rmtoll UR13 SDRS LL_SYSCFG_GetSecuredDTCMSize
  1519. * @retval Returned value can be one of the following values:
  1520. * @arg @ref LL_SYSCFG_DTCM_RAM_SIZE_2KB
  1521. * @arg @ref LL_SYSCFG_DTCM_RAM_SIZE_4KB
  1522. * @arg @ref LL_SYSCFG_DTCM_RAM_SIZE_8KB
  1523. * @arg @ref LL_SYSCFG_DTCM_RAM_SIZE_16KB
  1524. */
  1525. __STATIC_INLINE uint32_t LL_SYSCFG_GetSecuredDTCMSize(void)
  1526. {
  1527. return (uint32_t)(READ_BIT(SYSCFG->UR13, SYSCFG_UR13_SDRS));
  1528. }
  1529. /**
  1530. * @brief Indicates if a reset is generated when D1 domain enters DStop mode
  1531. * @rmtoll UR14 D1STPRST LL_SYSCFG_IsD1StopGenerateReset
  1532. * @retval State of bit (1 or 0).
  1533. */
  1534. __STATIC_INLINE uint32_t LL_SYSCFG_IsD1StopGenerateReset(void)
  1535. {
  1536. return ((READ_BIT(SYSCFG->UR14, SYSCFG_UR14_D1STPRST) == 0U) ? 1UL : 0UL);
  1537. }
  1538. #if defined (DUAL_CORE)
  1539. /**
  1540. * @brief Indicates if a reset is generated when D2 domain enters DStandby mode
  1541. * @rmtoll UR14 D2SBRST LL_SYSCFG_IsD2StandbyGenerateReset
  1542. * @retval State of bit (1 or 0).
  1543. */
  1544. __STATIC_INLINE uint32_t LL_SYSCFG_IsD2StandbyGenerateReset(void)
  1545. {
  1546. return ((READ_BIT(SYSCFG->UR14, SYSCFG_UR14_D2SBRST) == 0U) ? 1UL : 0UL);
  1547. }
  1548. /**
  1549. * @brief Indicates if a reset is generated when D2 domain enters DStop mode
  1550. * @rmtoll UR15 D2STPRST LL_SYSCFG_IsD2StopGenerateReset
  1551. * @retval State of bit (1 or 0).
  1552. */
  1553. __STATIC_INLINE uint32_t LL_SYSCFG_IsD2StopGenerateReset(void)
  1554. {
  1555. return ((READ_BIT(SYSCFG->UR15, SYSCFG_UR15_D2STPRST) == 0U) ? 1UL : 0UL);
  1556. }
  1557. #endif /* DUAL_CORE */
  1558. /**
  1559. * @brief Indicates if the independent watchdog is frozen in Standby mode
  1560. * @rmtoll UR15 FZIWDGSTB LL_SYSCFG_IsIWDGFrozenInStandbyMode
  1561. * @retval State of bit (1 or 0).
  1562. */
  1563. __STATIC_INLINE uint32_t LL_SYSCFG_IsIWDGFrozenInStandbyMode(void)
  1564. {
  1565. return ((READ_BIT(SYSCFG->UR15, SYSCFG_UR15_FZIWDGSTB) == 0U) ? 1UL : 0UL);
  1566. }
  1567. /**
  1568. * @brief Indicates if the independent watchdog is frozen in Stop mode
  1569. * @rmtoll UR16 FZIWDGSTP LL_SYSCFG_IsIWDGFrozenInStopMode
  1570. * @retval State of bit (1 or 0).
  1571. */
  1572. __STATIC_INLINE uint32_t LL_SYSCFG_IsIWDGFrozenInStopMode(void)
  1573. {
  1574. return ((READ_BIT(SYSCFG->UR16, SYSCFG_UR16_FZIWDGSTP) == 0U) ? 1UL : 0UL);
  1575. }
  1576. /**
  1577. * @brief Indicates if the device private key is programmed
  1578. * @rmtoll UR16 PKP LL_SYSCFG_IsPrivateKeyProgrammed
  1579. * @retval State of bit (1 or 0).
  1580. */
  1581. __STATIC_INLINE uint32_t LL_SYSCFG_IsPrivateKeyProgrammed(void)
  1582. {
  1583. return ((READ_BIT(SYSCFG->UR16, SYSCFG_UR16_PKP) == SYSCFG_UR16_PKP) ? 1UL : 0UL);
  1584. }
  1585. /**
  1586. * @brief Indicates if the Product is working on the full voltage range or not
  1587. * @rmtoll UR17 IOHSLV LL_SYSCFG_IsActiveFlag_IOHSLV
  1588. * @note When the IOHSLV option bit is set the Product is working below 2.7 V.
  1589. * When the IOHSLV option bit is reset the Product is working on the
  1590. * full voltage range.
  1591. * @retval State of bit (1 or 0).
  1592. */
  1593. __STATIC_INLINE uint32_t LL_SYSCFG_IsActiveFlag_IOHSLV(void)
  1594. {
  1595. return ((READ_BIT(SYSCFG->UR17, SYSCFG_UR17_IOHSLV) == SYSCFG_UR17_IOHSLV) ? 1UL : 0UL);
  1596. }
  1597. #ifdef SYSCFG_UR17_TCM_AXI_CFG
  1598. /**
  1599. * @brief Get the size of ITCM-RAM and AXI-SRAM
  1600. * @rmtoll UR17 TCM_AXI_CFG LL_SYSCFG_Get_ITCM_AXI_RAM_Size
  1601. * @retval Returned value can be one of the following values:
  1602. * @arg @ref LL_SYSCFG_ITCM_AXI_64KB_320KB
  1603. * @arg @ref LL_SYSCFG_ITCM_AXI_128KB_256KB
  1604. * @arg @ref LL_SYSCFG_ITCM_AXI_192KB_192KB
  1605. * @arg @ref LL_SYSCFG_ITCM_AXI_256KB_128KB
  1606. */
  1607. __STATIC_INLINE uint32_t LL_SYSCFG_Get_ITCM_AXI_RAM_Size(void)
  1608. {
  1609. return (uint32_t)(READ_BIT(SYSCFG->UR17, SYSCFG_UR17_TCM_AXI_CFG));
  1610. }
  1611. #endif /*SYSCFG_UR17_TCM_AXI_CFG*/
  1612. #ifdef SYSCFG_UR18_CPU_FREQ_BOOST
  1613. /**
  1614. * @brief Indicates if the CPU maximum frequency boost is enabled
  1615. * @rmtoll UR18 CPU_FREQ_BOOST LL_SYSCFG_IsCpuFreqBoostEnabled
  1616. * @retval State of bit (1 or 0).
  1617. */
  1618. __STATIC_INLINE uint32_t LL_SYSCFG_IsCpuFreqBoostEnabled(void)
  1619. {
  1620. return ((READ_BIT(SYSCFG->UR18, SYSCFG_UR18_CPU_FREQ_BOOST) == SYSCFG_UR18_CPU_FREQ_BOOST) ? 1UL : 0UL);
  1621. }
  1622. #endif /*SYSCFG_UR18_CPU_FREQ_BOOST*/
  1623. #endif /*SYSCFG_UR0_RDP*/
  1624. /**
  1625. * @}
  1626. */
  1627. /** @defgroup SYSTEM_LL_EF_DBGMCU DBGMCU
  1628. * @{
  1629. */
  1630. /**
  1631. * @brief Return the device identifier
  1632. * @rmtoll DBGMCU_IDCODE DEV_ID LL_DBGMCU_GetDeviceID
  1633. * @retval Values between Min_Data=0x00 and Max_Data=0xFFF
  1634. */
  1635. __STATIC_INLINE uint32_t LL_DBGMCU_GetDeviceID(void)
  1636. {
  1637. return (uint32_t)(READ_BIT(DBGMCU->IDCODE, DBGMCU_IDCODE_DEV_ID));
  1638. }
  1639. /**
  1640. * @brief Return the device revision identifier
  1641. * @note This field indicates the revision of the device.
  1642. For example, it is read as RevA -> 0x1000, Cat 2 revZ -> 0x1001
  1643. * @rmtoll DBGMCU_IDCODE REV_ID LL_DBGMCU_GetRevisionID
  1644. * @retval Values between Min_Data=0x00 and Max_Data=0xFFFF
  1645. */
  1646. __STATIC_INLINE uint32_t LL_DBGMCU_GetRevisionID(void)
  1647. {
  1648. return (uint32_t)(READ_BIT(DBGMCU->IDCODE, DBGMCU_IDCODE_REV_ID) >> DBGMCU_IDCODE_REV_ID_Pos);
  1649. }
  1650. /**
  1651. * @brief Enable D1 Domain/CDomain debug during SLEEP mode
  1652. * @rmtoll DBGMCU_CR DBGSLEEP_D1/DBGSLEEP_CD LL_DBGMCU_EnableD1DebugInSleepMode
  1653. * @retval None
  1654. */
  1655. __STATIC_INLINE void LL_DBGMCU_EnableD1DebugInSleepMode(void)
  1656. {
  1657. SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_SLEEPD1);
  1658. }
  1659. /**
  1660. * @brief Disable D1 Domain/CDomain debug during SLEEP mode
  1661. * @rmtoll DBGMCU_CR DBGSLEEP_D1/DBGSLEEP_CD LL_DBGMCU_DisableD1DebugInSleepMode
  1662. * @retval None
  1663. */
  1664. __STATIC_INLINE void LL_DBGMCU_DisableD1DebugInSleepMode(void)
  1665. {
  1666. CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_SLEEPD1);
  1667. }
  1668. /**
  1669. * @brief Enable D1 Domain/CDomain debug during STOP mode
  1670. * @rmtoll DBGMCU_CR DBGSTOP_D1/DBGSLEEP_CD LL_DBGMCU_EnableD1DebugInStopMode
  1671. * @retval None
  1672. */
  1673. __STATIC_INLINE void LL_DBGMCU_EnableD1DebugInStopMode(void)
  1674. {
  1675. SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOPD1);
  1676. }
  1677. /**
  1678. * @brief Disable D1 Domain/CDomain debug during STOP mode
  1679. * @rmtoll DBGMCU_CR DBGSTOP_D1/DBGSLEEP_CD LL_DBGMCU_DisableD1DebugInStopMode
  1680. * @retval None
  1681. */
  1682. __STATIC_INLINE void LL_DBGMCU_DisableD1DebugInStopMode(void)
  1683. {
  1684. CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOPD1);
  1685. }
  1686. /**
  1687. * @brief Enable D1 Domain/CDomain debug during STANDBY mode
  1688. * @rmtoll DBGMCU_CR DBGSTBY_D1/DBGSLEEP_CD LL_DBGMCU_EnableD1DebugInStandbyMode
  1689. * @retval None
  1690. */
  1691. __STATIC_INLINE void LL_DBGMCU_EnableD1DebugInStandbyMode(void)
  1692. {
  1693. SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBYD1);
  1694. }
  1695. /**
  1696. * @brief Disable D1 Domain/CDomain debug during STANDBY mode
  1697. * @rmtoll DBGMCU_CR DBGSTBY_D1/DBGSLEEP_CD LL_DBGMCU_DisableD1DebugInStandbyMode
  1698. * @retval None
  1699. */
  1700. __STATIC_INLINE void LL_DBGMCU_DisableD1DebugInStandbyMode(void)
  1701. {
  1702. CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBYD1);
  1703. }
  1704. #if defined (DUAL_CORE)
  1705. /**
  1706. * @brief Enable D2 Domain debug during SLEEP mode
  1707. * @rmtoll DBGMCU_CR DBGSLEEP_D2 LL_DBGMCU_EnableD2DebugInSleepMode
  1708. * @retval None
  1709. */
  1710. __STATIC_INLINE void LL_DBGMCU_EnableD2DebugInSleepMode(void)
  1711. {
  1712. SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_SLEEPD2);
  1713. }
  1714. /**
  1715. * @brief Disable D2 Domain debug during SLEEP mode
  1716. * @rmtoll DBGMCU_CR DBGSLEEP_D2 LL_DBGMCU_DisableD2DebugInSleepMode
  1717. * @retval None
  1718. */
  1719. __STATIC_INLINE void LL_DBGMCU_DisableD2DebugInSleepMode(void)
  1720. {
  1721. CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_SLEEPD2);
  1722. }
  1723. /**
  1724. * @brief Enable D2 Domain debug during STOP mode
  1725. * @rmtoll DBGMCU_CR DBGSTOP_D2 LL_DBGMCU_EnableD2DebugInStopMode
  1726. * @retval None
  1727. */
  1728. __STATIC_INLINE void LL_DBGMCU_EnableD2DebugInStopMode(void)
  1729. {
  1730. SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOPD2);
  1731. }
  1732. /**
  1733. * @brief Disable D2 Domain debug during STOP mode
  1734. * @rmtoll DBGMCU_CR DBGSTOP_D2 LL_DBGMCU_DisableD2DebugInStopMode
  1735. * @retval None
  1736. */
  1737. __STATIC_INLINE void LL_DBGMCU_DisableD2DebugInStopMode(void)
  1738. {
  1739. CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOPD2);
  1740. }
  1741. /**
  1742. * @brief Enable D2 Domain debug during STANDBY mode
  1743. * @rmtoll DBGMCU_CR DBGSTBY_D2 LL_DBGMCU_EnableD2DebugInStandbyMode
  1744. * @retval None
  1745. */
  1746. __STATIC_INLINE void LL_DBGMCU_EnableD2DebugInStandbyMode(void)
  1747. {
  1748. SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBYD2);
  1749. }
  1750. /**
  1751. * @brief Disable D2 Domain debug during STANDBY mode
  1752. * @rmtoll DBGMCU_CR DBGSTBY_D2 LL_DBGMCU_DisableD2DebugInStandbyMode
  1753. * @retval None
  1754. */
  1755. __STATIC_INLINE void LL_DBGMCU_DisableD2DebugInStandbyMode(void)
  1756. {
  1757. CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBYD2);
  1758. }
  1759. #endif /* DUAL_CORE */
  1760. #if defined(DBGMCU_CR_DBG_STOPD3)
  1761. /**
  1762. * @brief Enable D3 Domain/SRDomain debug during STOP mode
  1763. * @rmtoll DBGMCU_CR DBGSTOP_D3/DBGSTOP_SRD LL_DBGMCU_EnableD3DebugInStopMode
  1764. * @retval None
  1765. */
  1766. __STATIC_INLINE void LL_DBGMCU_EnableD3DebugInStopMode(void)
  1767. {
  1768. SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOPD3);
  1769. }
  1770. /**
  1771. * @brief Disable D3 Domain/SRDomain debug during STOP mode
  1772. * @rmtoll DBGMCU_CR DBGSTOP_D3/DBGSTOP_SRD LL_DBGMCU_DisableD3DebugInStopMode
  1773. * @retval None
  1774. */
  1775. __STATIC_INLINE void LL_DBGMCU_DisableD3DebugInStopMode(void)
  1776. {
  1777. CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOPD3);
  1778. }
  1779. #endif /*DBGMCU_CR_DBG_STOPD3*/
  1780. #if defined(DBGMCU_CR_DBG_STANDBYD3)
  1781. /**
  1782. * @brief Enable D3 Domain/SRDomain debug during STANDBY mode
  1783. * @rmtoll DBGMCU_CR DBGSTBY_D3/DBGSTBY_SRD LL_DBGMCU_EnableD3DebugInStandbyMode
  1784. * @retval None
  1785. */
  1786. __STATIC_INLINE void LL_DBGMCU_EnableD3DebugInStandbyMode(void)
  1787. {
  1788. SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBYD3);
  1789. }
  1790. /**
  1791. * @brief Disable D3 Domain/SRDomain debug during STANDBY mode
  1792. * @rmtoll DBGMCU_CR DBGSTBY_D3/DBGSTBY_SRD LL_DBGMCU_DisableD3DebugInStandbyMode
  1793. * @retval None
  1794. */
  1795. __STATIC_INLINE void LL_DBGMCU_DisableD3DebugInStandbyMode(void)
  1796. {
  1797. CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBYD3);
  1798. }
  1799. #endif /*DBGMCU_CR_DBG_STANDBYD3*/
  1800. /**
  1801. * @brief Enable the trace port clock
  1802. * @rmtoll DBGMCU_CR TRACECKEN LL_DBGMCU_EnableTracePortClock
  1803. * @retval None
  1804. */
  1805. __STATIC_INLINE void LL_DBGMCU_EnableTracePortClock(void)
  1806. {
  1807. SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TRACECKEN);
  1808. }
  1809. /**
  1810. * @brief Disable the trace port clock
  1811. * @rmtoll DBGMCU_CR TRACECKEN LL_DBGMCU_DisableTracePortClock
  1812. * @retval None
  1813. */
  1814. __STATIC_INLINE void LL_DBGMCU_DisableTracePortClock(void)
  1815. {
  1816. CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TRACECKEN);
  1817. }
  1818. /**
  1819. * @brief Enable the Domain1/CDomain debug clock enable
  1820. * @rmtoll DBGMCU_CR CKD1EN/CKCDEN LL_DBGMCU_EnableD1DebugClock
  1821. * @retval None
  1822. */
  1823. __STATIC_INLINE void LL_DBGMCU_EnableD1DebugClock(void)
  1824. {
  1825. SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_CKD1EN);
  1826. }
  1827. /**
  1828. * @brief Disable the Domain1/CDomain debug clock enable
  1829. * @rmtoll DBGMCU_CR CKD1EN/CKCDEN LL_DBGMCU_DisableD1DebugClock
  1830. * @retval None
  1831. */
  1832. __STATIC_INLINE void LL_DBGMCU_DisableD1DebugClock(void)
  1833. {
  1834. CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_CKD1EN);
  1835. }
  1836. /**
  1837. * @brief Enable the Domain3/SRDomain debug clock enable
  1838. * @rmtoll DBGMCU_CR CKD3EN/CKSRDEN LL_DBGMCU_EnableD3DebugClock
  1839. * @retval None
  1840. */
  1841. __STATIC_INLINE void LL_DBGMCU_EnableD3DebugClock(void)
  1842. {
  1843. SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_CKD3EN);
  1844. }
  1845. /**
  1846. * @brief Disable the Domain3/SRDomain debug clock enable
  1847. * @rmtoll DBGMCU_CR CKD3EN/CKSRDEN LL_DBGMCU_DisableD3DebugClock
  1848. * @retval None
  1849. */
  1850. __STATIC_INLINE void LL_DBGMCU_DisableD3DebugClock(void)
  1851. {
  1852. CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_CKD3EN);
  1853. }
  1854. #define LL_DBGMCU_TRGIO_INPUT_DIRECTION 0U
  1855. #define LL_DBGMCU_TRGIO_OUTPUT_DIRECTION DBGMCU_CR_DBG_TRGOEN
  1856. /**
  1857. * @brief Set the direction of the bi-directional trigger pin TRGIO
  1858. * @rmtoll DBGMCU_CR TRGOEN LL_DBGMCU_SetExternalTriggerPinDirection\n
  1859. * @param PinDirection This parameter can be one of the following values:
  1860. * @arg @ref LL_DBGMCU_TRGIO_INPUT_DIRECTION
  1861. * @arg @ref LL_DBGMCU_TRGIO_OUTPUT_DIRECTION
  1862. * @retval None
  1863. */
  1864. __STATIC_INLINE void LL_DBGMCU_SetExternalTriggerPinDirection(uint32_t PinDirection)
  1865. {
  1866. MODIFY_REG(DBGMCU->CR, DBGMCU_CR_DBG_TRGOEN, PinDirection);
  1867. }
  1868. /**
  1869. * @brief Get the direction of the bi-directional trigger pin TRGIO
  1870. * @rmtoll DBGMCU_CR TRGOEN LL_DBGMCU_GetExternalTriggerPinDirection\n
  1871. * @retval Returned value can be one of the following values:
  1872. * @arg @ref LL_DBGMCU_TRGIO_INPUT_DIRECTION
  1873. * @arg @ref LL_DBGMCU_TRGIO_OUTPUT_DIRECTION
  1874. */
  1875. __STATIC_INLINE uint32_t LL_DBGMCU_GetExternalTriggerPinDirection(void)
  1876. {
  1877. return (uint32_t)(READ_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TRGOEN));
  1878. }
  1879. /**
  1880. * @brief Freeze APB1 group1 peripherals
  1881. * @rmtoll DBGMCU_APB1LFZ1 TIM2 LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1882. * DBGMCU_APB1LFZ1 TIM3 LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1883. * DBGMCU_APB1LFZ1 TIM4 LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1884. * DBGMCU_APB1LFZ1 TIM5 LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1885. * DBGMCU_APB1LFZ1 TIM6 LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1886. * DBGMCU_APB1LFZ1 TIM7 LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1887. * DBGMCU_APB1LFZ1 TIM12 LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1888. * DBGMCU_APB1LFZ1 TIM13 LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1889. * DBGMCU_APB1LFZ1 TIM14 LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1890. * DBGMCU_APB1LFZ1 LPTIM1 LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1891. * DBGMCU_APB1LFZ1 I2C1 LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1892. * DBGMCU_APB1LFZ1 I2C2 LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1893. * DBGMCU_APB1LFZ1 I2C3 LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1894. * DBGMCU_APB1LFZ1 I2C5 LL_DBGMCU_APB1_GRP1_FreezePeriph\n (*)
  1895. * @param Periphs This parameter can be a combination of the following values:
  1896. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM2_STOP
  1897. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM3_STOP
  1898. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM4_STOP
  1899. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM5_STOP
  1900. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM6_STOP
  1901. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM7_STOP
  1902. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM12_STOP
  1903. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM13_STOP
  1904. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM14_STOP
  1905. * @arg @ref LL_DBGMCU_APB1_GRP1_LPTIM1_STOP
  1906. * @arg @ref LL_DBGMCU_APB1_GRP1_I2C1_STOP
  1907. * @arg @ref LL_DBGMCU_APB1_GRP1_I2C2_STOP
  1908. * @arg @ref LL_DBGMCU_APB1_GRP1_I2C3_STOP
  1909. * @arg @ref LL_DBGMCU_APB1_GRP1_I2C5_STOP (*)
  1910. *
  1911. * (*) value not defined in all devices
  1912. * @retval None
  1913. */
  1914. __STATIC_INLINE void LL_DBGMCU_APB1_GRP1_FreezePeriph(uint32_t Periphs)
  1915. {
  1916. SET_BIT(DBGMCU->APB1LFZ1, Periphs);
  1917. }
  1918. /**
  1919. * @brief Unfreeze APB1 peripherals (group1 peripherals)
  1920. * @rmtoll DBGMCU_APB1LFZ1 TIM2 LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1921. * DBGMCU_APB1LFZ1 TIM3 LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1922. * DBGMCU_APB1LFZ1 TIM4 LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1923. * DBGMCU_APB1LFZ1 TIM5 LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1924. * DBGMCU_APB1LFZ1 TIM6 LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1925. * DBGMCU_APB1LFZ1 TIM7 LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1926. * DBGMCU_APB1LFZ1 TIM12 LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1927. * DBGMCU_APB1LFZ1 TIM13 LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1928. * DBGMCU_APB1LFZ1 TIM14 LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1929. * DBGMCU_APB1LFZ1 LPTIM1 LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1930. * DBGMCU_APB1LFZ1 I2C1 LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1931. * DBGMCU_APB1LFZ1 I2C2 LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1932. * DBGMCU_APB1LFZ1 I2C3 LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1933. * DBGMCU_APB1LFZ1 I2C5 LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1934. * @param Periphs This parameter can be a combination of the following values:
  1935. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM2_STOP
  1936. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM3_STOP
  1937. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM4_STOP
  1938. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM5_STOP
  1939. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM6_STOP
  1940. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM7_STOP
  1941. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM12_STOP
  1942. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM13_STOP
  1943. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM14_STOP
  1944. * @arg @ref LL_DBGMCU_APB1_GRP1_LPTIM1_STOP
  1945. * @arg @ref LL_DBGMCU_APB1_GRP1_I2C1_STOP
  1946. * @arg @ref LL_DBGMCU_APB1_GRP1_I2C2_STOP
  1947. * @arg @ref LL_DBGMCU_APB1_GRP1_I2C3_STOP
  1948. * @arg @ref LL_DBGMCU_APB1_GRP1_I2C5_STOP (*)
  1949. *
  1950. * (*) value not defined in all devices
  1951. * @retval None
  1952. */
  1953. __STATIC_INLINE void LL_DBGMCU_APB1_GRP1_UnFreezePeriph(uint32_t Periphs)
  1954. {
  1955. CLEAR_BIT(DBGMCU->APB1LFZ1, Periphs);
  1956. }
  1957. #ifdef DBGMCU_APB1HFZ1_DBG_FDCAN
  1958. /**
  1959. * @brief Freeze APB1 group2 peripherals
  1960. * @rmtoll DBGMCU_APB1HFZ1 FDCAN LL_DBGMCU_APB1_GRP2_FreezePeriph\n
  1961. * @param Periphs This parameter can be a combination of the following values:
  1962. * @arg @ref LL_DBGMCU_APB1_GRP2_FDCAN_STOP
  1963. * @retval None
  1964. */
  1965. __STATIC_INLINE void LL_DBGMCU_APB1_GRP2_FreezePeriph(uint32_t Periphs)
  1966. {
  1967. SET_BIT(DBGMCU->APB1HFZ1, Periphs);
  1968. }
  1969. /**
  1970. * @brief Unfreeze APB1 group2 peripherals
  1971. * @rmtoll DBGMCU_APB1HFZ1 FDCAN LL_DBGMCU_APB1_GRP2_UnFreezePeriph\n
  1972. * @param Periphs This parameter can be a combination of the following values:
  1973. * @arg @ref LL_DBGMCU_APB1_GRP2_FDCAN_STOP
  1974. * @retval None
  1975. */
  1976. __STATIC_INLINE void LL_DBGMCU_APB1_GRP2_UnFreezePeriph(uint32_t Periphs)
  1977. {
  1978. CLEAR_BIT(DBGMCU->APB1HFZ1, Periphs);
  1979. }
  1980. #endif /*DBGMCU_APB1HFZ1_DBG_FDCAN*/
  1981. #if defined(TIM23) || defined(TIM24)
  1982. /**
  1983. * @brief Freeze APB1 group2 peripherals
  1984. * @rmtoll DBGMCU_APB1HFZ1 TIM23 LL_DBGMCU_APB1_GRP2_FreezePeriph\n
  1985. * DBGMCU_APB1HFZ1 TIM24 LL_DBGMCU_APB1_GRP2_FreezePeriph\n
  1986. * @param Periphs This parameter can be a combination of the following values:
  1987. * @arg @ref LL_DBGMCU_APB1_GRP2_TIM23_STOP
  1988. * @arg @ref LL_DBGMCU_APB1_GRP2_TIM24_STOP
  1989. * @retval None
  1990. */
  1991. __STATIC_INLINE void LL_DBGMCU_APB1_GRP2_FreezePeriph(uint32_t Periphs)
  1992. {
  1993. SET_BIT(DBGMCU->APB1HFZ1, Periphs);
  1994. }
  1995. /**
  1996. * @brief Unfreeze APB1 group2 peripherals
  1997. * @rmtoll DBGMCU_APB1HFZ1 TIM23 LL_DBGMCU_APB1_GRP2_UnFreezePeriph\n
  1998. DBGMCU_APB1HFZ1 TIM24 LL_DBGMCU_APB1_GRP2_UnFreezePeriph\n
  1999. * @param Periphs This parameter can be a combination of the following values:
  2000. * @arg @ref LL_DBGMCU_APB1_GRP2_TIM23_STOP
  2001. * @arg @ref LL_DBGMCU_APB1_GRP2_TIM24_STOP
  2002. * @retval None
  2003. */
  2004. __STATIC_INLINE void LL_DBGMCU_APB1_GRP2_UnFreezePeriph(uint32_t Periphs)
  2005. {
  2006. CLEAR_BIT(DBGMCU->APB1HFZ1, Periphs);
  2007. }
  2008. #endif /* TIM23 || TIM24 */
  2009. /**
  2010. * @brief Freeze APB2 peripherals
  2011. * @rmtoll DBGMCU_APB2FZ1 TIM1 LL_DBGMCU_APB2_GRP1_FreezePeriph\n
  2012. * DBGMCU_APB2FZ1 TIM8 LL_DBGMCU_APB2_GRP1_FreezePeriph\n
  2013. * DBGMCU_APB2FZ1 TIM15 LL_DBGMCU_APB2_GRP1_FreezePeriph\n
  2014. * DBGMCU_APB2FZ1 TIM16 LL_DBGMCU_APB2_GRP1_FreezePeriph\n
  2015. * DBGMCU_APB2FZ1 TIM17 LL_DBGMCU_APB2_GRP1_FreezePeriph
  2016. * DBGMCU_APB2FZ1 HRTIM LL_DBGMCU_APB2_GRP1_FreezePeriph
  2017. * @param Periphs This parameter can be a combination of the following values:
  2018. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM1_STOP
  2019. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM8_STOP
  2020. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM15_STOP
  2021. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM16_STOP
  2022. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM17_STOP
  2023. * @arg @ref LL_DBGMCU_APB2_GRP1_HRTIM_STOP (*)
  2024. *
  2025. * (*) value not defined in all devices
  2026. * @retval None
  2027. */
  2028. __STATIC_INLINE void LL_DBGMCU_APB2_GRP1_FreezePeriph(uint32_t Periphs)
  2029. {
  2030. SET_BIT(DBGMCU->APB2FZ1, Periphs);
  2031. }
  2032. /**
  2033. * @brief Unfreeze APB2 peripherals
  2034. * @rmtoll DBGMCU_APB2FZ1 TIM1 LL_DBGMCU_APB2_GRP1_FreezePeriph\n
  2035. * DBGMCU_APB2FZ1 TIM8 LL_DBGMCU_APB2_GRP1_FreezePeriph\n
  2036. * DBGMCU_APB2FZ1 TIM15 LL_DBGMCU_APB2_GRP1_FreezePeriph\n
  2037. * DBGMCU_APB2FZ1 TIM16 LL_DBGMCU_APB2_GRP1_FreezePeriph\n
  2038. * DBGMCU_APB2FZ1 TIM17 LL_DBGMCU_APB2_GRP1_FreezePeriph
  2039. * DBGMCU_APB2FZ1 HRTIM LL_DBGMCU_APB2_GRP1_FreezePeriph
  2040. * @param Periphs This parameter can be a combination of the following values:
  2041. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM1_STOP
  2042. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM8_STOP
  2043. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM15_STOP
  2044. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM16_STOP
  2045. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM17_STOP
  2046. * @arg @ref LL_DBGMCU_APB2_GRP1_HRTIM_STOP (*)
  2047. *
  2048. * (*) value not defined in all devices
  2049. * @retval None
  2050. */
  2051. __STATIC_INLINE void LL_DBGMCU_APB2_GRP1_UnFreezePeriph(uint32_t Periphs)
  2052. {
  2053. CLEAR_BIT(DBGMCU->APB2FZ1, Periphs);
  2054. }
  2055. /**
  2056. * @brief Freeze APB3 peripherals
  2057. * @rmtoll DBGMCU_APB3FZ1 WWDG1 LL_DBGMCU_APB3_GRP1_FreezePeriph\n
  2058. * @param Periphs This parameter can be a combination of the following values:
  2059. * @arg @ref LL_DBGMCU_APB3_GRP1_WWDG1_STOP
  2060. * @retval None
  2061. */
  2062. __STATIC_INLINE void LL_DBGMCU_APB3_GRP1_FreezePeriph(uint32_t Periphs)
  2063. {
  2064. SET_BIT(DBGMCU->APB3FZ1, Periphs);
  2065. }
  2066. /**
  2067. * @brief Unfreeze APB3 peripherals
  2068. * @rmtoll DBGMCU_APB3FZ1 WWDG1 LL_DBGMCU_APB3_GRP1_UnFreezePeriph\n
  2069. * @param Periphs This parameter can be a combination of the following values:
  2070. * @arg @ref LL_DBGMCU_APB3_GRP1_WWDG1_STOP
  2071. * @retval None
  2072. */
  2073. __STATIC_INLINE void LL_DBGMCU_APB3_GRP1_UnFreezePeriph(uint32_t Periphs)
  2074. {
  2075. CLEAR_BIT(DBGMCU->APB3FZ1, Periphs);
  2076. }
  2077. /**
  2078. * @brief Freeze APB4 peripherals
  2079. * @rmtoll DBGMCU_APB4FZ1 I2C4 LL_DBGMCU_APB4_GRP1_FreezePeriph\n
  2080. * @rmtoll DBGMCU_APB4FZ1 LPTIM2 LL_DBGMCU_APB4_GRP1_FreezePeriph\n
  2081. * @rmtoll DBGMCU_APB4FZ1 LPTIM3 LL_DBGMCU_APB4_GRP1_FreezePeriph\n
  2082. * @rmtoll DBGMCU_APB4FZ1 LPTIM4 LL_DBGMCU_APB4_GRP1_FreezePeriph\n
  2083. * @rmtoll DBGMCU_APB4FZ1 LPTIM5 LL_DBGMCU_APB4_GRP1_FreezePeriph\n
  2084. * @rmtoll DBGMCU_APB4FZ1 RTC LL_DBGMCU_APB4_GRP1_FreezePeriph\n
  2085. * @rmtoll DBGMCU_APB4FZ1 WDGLSD1 LL_DBGMCU_APB4_GRP1_FreezePeriph\n
  2086. * @param Periphs This parameter can be a combination of the following values:
  2087. * @arg @ref LL_DBGMCU_APB4_GRP1_I2C4_STOP
  2088. * @arg @ref LL_DBGMCU_APB4_GRP1_LPTIM2_STOP
  2089. * @arg @ref LL_DBGMCU_APB4_GRP1_LPTIM3_STOP
  2090. * @arg @ref LL_DBGMCU_APB4_GRP1_LPTIM4_STOP (*)
  2091. * @arg @ref LL_DBGMCU_APB4_GRP1_LPTIM5_STOP (*)
  2092. * @arg @ref LL_DBGMCU_APB4_GRP1_RTC_STOP
  2093. * @arg @ref LL_DBGMCU_APB4_GRP1_IWDG1_STOP
  2094. *
  2095. * (*) value not defined in all devices
  2096. * @retval None
  2097. */
  2098. __STATIC_INLINE void LL_DBGMCU_APB4_GRP1_FreezePeriph(uint32_t Periphs)
  2099. {
  2100. SET_BIT(DBGMCU->APB4FZ1, Periphs);
  2101. }
  2102. /**
  2103. * @brief Unfreeze APB4 peripherals
  2104. * @rmtoll DBGMCU_APB4FZ1 I2C4 LL_DBGMCU_APB4_GRP1_FreezePeriph\n
  2105. * @rmtoll DBGMCU_APB4FZ1 LPTIM2 LL_DBGMCU_APB4_GRP1_FreezePeriph\n
  2106. * @rmtoll DBGMCU_APB4FZ1 LPTIM3 LL_DBGMCU_APB4_GRP1_FreezePeriph\n
  2107. * @rmtoll DBGMCU_APB4FZ1 LPTIM4 LL_DBGMCU_APB4_GRP1_FreezePeriph\n
  2108. * @rmtoll DBGMCU_APB4FZ1 LPTIM5 LL_DBGMCU_APB4_GRP1_FreezePeriph\n
  2109. * @rmtoll DBGMCU_APB4FZ1 RTC LL_DBGMCU_APB4_GRP1_FreezePeriph\n
  2110. * @rmtoll DBGMCU_APB4FZ1 WDGLSD1 LL_DBGMCU_APB4_GRP1_FreezePeriph\n
  2111. * @param Periphs This parameter can be a combination of the following values:
  2112. * @arg @ref LL_DBGMCU_APB4_GRP1_I2C4_STOP
  2113. * @arg @ref LL_DBGMCU_APB4_GRP1_LPTIM2_STOP
  2114. * @arg @ref LL_DBGMCU_APB4_GRP1_LPTIM3_STOP
  2115. * @arg @ref LL_DBGMCU_APB4_GRP1_LPTIM4_STOP (*)
  2116. * @arg @ref LL_DBGMCU_APB4_GRP1_LPTIM5_STOP (*)
  2117. * @arg @ref LL_DBGMCU_APB4_GRP1_RTC_STOP
  2118. * @arg @ref LL_DBGMCU_APB4_GRP1_IWDG1_STOP
  2119. *
  2120. * (*) value not defined in all devices
  2121. * @retval None
  2122. */
  2123. __STATIC_INLINE void LL_DBGMCU_APB4_GRP1_UnFreezePeriph(uint32_t Periphs)
  2124. {
  2125. CLEAR_BIT(DBGMCU->APB4FZ1, Periphs);
  2126. }
  2127. /**
  2128. * @}
  2129. */
  2130. /** @defgroup SYSTEM_LL_EF_FLASH FLASH
  2131. * @{
  2132. */
  2133. /**
  2134. * @brief Set FLASH Latency
  2135. * @rmtoll FLASH_ACR LATENCY LL_FLASH_SetLatency
  2136. * @param Latency This parameter can be one of the following values:
  2137. * @arg @ref LL_FLASH_LATENCY_0
  2138. * @arg @ref LL_FLASH_LATENCY_1
  2139. * @arg @ref LL_FLASH_LATENCY_2
  2140. * @arg @ref LL_FLASH_LATENCY_3
  2141. * @arg @ref LL_FLASH_LATENCY_4
  2142. * @arg @ref LL_FLASH_LATENCY_5
  2143. * @arg @ref LL_FLASH_LATENCY_6
  2144. * @arg @ref LL_FLASH_LATENCY_7
  2145. * @retval None
  2146. */
  2147. __STATIC_INLINE void LL_FLASH_SetLatency(uint32_t Latency)
  2148. {
  2149. MODIFY_REG(FLASH->ACR, FLASH_ACR_LATENCY, Latency);
  2150. }
  2151. /**
  2152. * @brief Get FLASH Latency
  2153. * @rmtoll FLASH_ACR LATENCY LL_FLASH_GetLatency
  2154. * @retval Returned value can be one of the following values:
  2155. * @arg @ref LL_FLASH_LATENCY_0
  2156. * @arg @ref LL_FLASH_LATENCY_1
  2157. * @arg @ref LL_FLASH_LATENCY_2
  2158. * @arg @ref LL_FLASH_LATENCY_3
  2159. * @arg @ref LL_FLASH_LATENCY_4
  2160. * @arg @ref LL_FLASH_LATENCY_5
  2161. * @arg @ref LL_FLASH_LATENCY_6
  2162. * @arg @ref LL_FLASH_LATENCY_7
  2163. */
  2164. __STATIC_INLINE uint32_t LL_FLASH_GetLatency(void)
  2165. {
  2166. return (uint32_t)(READ_BIT(FLASH->ACR, FLASH_ACR_LATENCY));
  2167. }
  2168. /**
  2169. * @}
  2170. */
  2171. #if defined(DUAL_CORE)
  2172. /** @defgroup SYSTEM_LL_EF_ART ART
  2173. * @{
  2174. */
  2175. /**
  2176. * @brief Enable the Cortex-M4 ART cache.
  2177. * @rmtoll ART_CTR EN LL_ART_Enable
  2178. * @retval None
  2179. */
  2180. __STATIC_INLINE void LL_ART_Enable(void)
  2181. {
  2182. SET_BIT(ART->CTR, ART_CTR_EN);
  2183. }
  2184. /**
  2185. * @brief Disable the Cortex-M4 ART cache.
  2186. * @rmtoll ART_CTR EN LL_ART_Disable
  2187. * @retval None
  2188. */
  2189. __STATIC_INLINE void LL_ART_Disable(void)
  2190. {
  2191. CLEAR_BIT(ART->CTR, ART_CTR_EN);
  2192. }
  2193. /**
  2194. * @brief Check if the Cortex-M4 ART cache is enabled
  2195. * @rmtoll ART_CTR EN LL_ART_IsEnabled
  2196. * @retval State of bit (1 or 0).
  2197. */
  2198. __STATIC_INLINE uint32_t LL_ART_IsEnabled(void)
  2199. {
  2200. return ((READ_BIT(ART->CTR, ART_CTR_EN) == ART_CTR_EN) ? 1UL : 0UL);
  2201. }
  2202. /**
  2203. * @brief Set the Cortex-M4 ART cache Base Address.
  2204. * @rmtoll ART_CTR PCACHEADDR LL_ART_SetBaseAddress
  2205. * @param BaseAddress Specifies the Base address of 1 Mbyte address page (cacheable page)
  2206. from which the ART accelerator loads code to the cache.
  2207. * @retval None
  2208. */
  2209. __STATIC_INLINE void LL_ART_SetBaseAddress(uint32_t BaseAddress)
  2210. {
  2211. MODIFY_REG(ART->CTR, ART_CTR_PCACHEADDR, (((BaseAddress) >> 12U) & 0x000FFF00UL));
  2212. }
  2213. /**
  2214. * @brief Get the Cortex-M4 ART cache Base Address.
  2215. * @rmtoll ART_CTR PCACHEADDR LL_ART_GetBaseAddress
  2216. * @retval the Base address of 1 Mbyte address page (cacheable page)
  2217. from which the ART accelerator loads code to the cache
  2218. */
  2219. __STATIC_INLINE uint32_t LL_ART_GetBaseAddress(void)
  2220. {
  2221. return (uint32_t)(READ_BIT(ART->CTR, ART_CTR_PCACHEADDR) << 12U);
  2222. }
  2223. #endif /* DUAL_CORE */
  2224. /**
  2225. * @}
  2226. */
  2227. /**
  2228. * @}
  2229. */
  2230. /**
  2231. * @}
  2232. */
  2233. #endif /* defined (FLASH) || defined (SYSCFG) || defined (DBGMCU) */
  2234. /**
  2235. * @}
  2236. */
  2237. #ifdef __cplusplus
  2238. }
  2239. #endif
  2240. #endif /* __STM32H7xx_LL_SYSTEM_H */