You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

2275 lines
88 KiB

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