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.
 
 
 

2278 lines
95 KiB

  1. /**
  2. ******************************************************************************
  3. * @file stm32wbxx_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. (+) Access to VREFBUF registers
  17. @endverbatim
  18. ******************************************************************************
  19. * @attention
  20. *
  21. * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
  22. * All rights reserved.</center></h2>
  23. *
  24. * This software component is licensed by ST under BSD 3-Clause license,
  25. * the "License"; You may not use this file except in compliance with the
  26. * License. You may obtain a copy of the License at:
  27. * opensource.org/licenses/BSD-3-Clause
  28. *
  29. ******************************************************************************
  30. */
  31. /* Define to prevent recursive inclusion -------------------------------------*/
  32. #ifndef STM32WBxx_LL_SYSTEM_H
  33. #define STM32WBxx_LL_SYSTEM_H
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37. /* Includes ------------------------------------------------------------------*/
  38. #include "stm32wbxx.h"
  39. /** @addtogroup STM32WBxx_LL_Driver
  40. * @{
  41. */
  42. #if defined (FLASH) || defined (SYSCFG) || defined (DBGMCU) || defined (VREFBUF)
  43. /** @defgroup SYSTEM_LL SYSTEM
  44. * @{
  45. */
  46. /* Private types -------------------------------------------------------------*/
  47. /* Private variables ---------------------------------------------------------*/
  48. /* Private constants ---------------------------------------------------------*/
  49. /** @defgroup SYSTEM_LL_Private_Constants SYSTEM Private Constants
  50. * @{
  51. */
  52. /**
  53. * @brief VREFBUF VREF_SC0 & VREF_SC1 calibration values
  54. */
  55. #define VREFBUF_SC0_CAL_ADDR ((uint8_t*) (0x1FFF75F0UL)) /*!< Address of VREFBUF trimming value for VRS=0,
  56. VREF_SC0 in STM32WB datasheet */
  57. #define VREFBUF_SC1_CAL_ADDR ((uint8_t*) (0x1FFF7530UL)) /*!< Address of VREFBUF trimming value for VRS=1,
  58. VREF_SC1 in STM32WB datasheet */
  59. /**
  60. * @}
  61. */
  62. /* Private macros ------------------------------------------------------------*/
  63. /* Exported types ------------------------------------------------------------*/
  64. /* Exported constants --------------------------------------------------------*/
  65. /** @defgroup SYSTEM_LL_Exported_Constants SYSTEM Exported Constants
  66. * @{
  67. */
  68. /** @defgroup SYSTEM_LL_EC_REMAP SYSCFG REMAP
  69. * @{
  70. */
  71. #define LL_SYSCFG_REMAP_FLASH 0x00000000U /*!< Main Flash memory mapped at 0x00000000 */
  72. #define LL_SYSCFG_REMAP_SYSTEMFLASH SYSCFG_MEMRMP_MEM_MODE_0 /*!< System Flash memory mapped at 0x00000000 */
  73. #define LL_SYSCFG_REMAP_SRAM (SYSCFG_MEMRMP_MEM_MODE_1 | SYSCFG_MEMRMP_MEM_MODE_0) /*!< SRAM1 mapped at 0x00000000 */
  74. #if defined(QUADSPI)
  75. #define LL_SYSCFG_REMAP_QUADSPI (SYSCFG_MEMRMP_MEM_MODE_2 | SYSCFG_MEMRMP_MEM_MODE_1) /*!< QUADSPI memory mapped at 0x00000000 */
  76. #endif
  77. /**
  78. * @}
  79. */
  80. /** @defgroup SYSTEM_LL_EC_I2C_FASTMODEPLUS SYSCFG I2C FASTMODEPLUS
  81. * @{
  82. */
  83. #define LL_SYSCFG_I2C_FASTMODEPLUS_PB6 SYSCFG_CFGR1_I2C_PB6_FMP /*!< Enable Fast Mode Plus on PB6 */
  84. #define LL_SYSCFG_I2C_FASTMODEPLUS_PB7 SYSCFG_CFGR1_I2C_PB7_FMP /*!< Enable Fast Mode Plus on PB7 */
  85. #define LL_SYSCFG_I2C_FASTMODEPLUS_PB8 SYSCFG_CFGR1_I2C_PB8_FMP /*!< Enable Fast Mode Plus on PB8 */
  86. #define LL_SYSCFG_I2C_FASTMODEPLUS_PB9 SYSCFG_CFGR1_I2C_PB9_FMP /*!< Enable Fast Mode Plus on PB9 */
  87. #define LL_SYSCFG_I2C_FASTMODEPLUS_I2C1 SYSCFG_CFGR1_I2C1_FMP /*!< Enable Fast Mode Plus on I2C1 pins */
  88. #if defined(I2C3)
  89. #define LL_SYSCFG_I2C_FASTMODEPLUS_I2C3 SYSCFG_CFGR1_I2C3_FMP /*!< Enable Fast Mode Plus on I2C3 pins */
  90. #endif
  91. /**
  92. * @}
  93. */
  94. /** @defgroup SYSTEM_LL_EC_EXTI_PORT SYSCFG EXTI PORT
  95. * @{
  96. */
  97. #define LL_SYSCFG_EXTI_PORTA 0U /*!< EXTI PORT A */
  98. #define LL_SYSCFG_EXTI_PORTB 1U /*!< EXTI PORT B */
  99. #define LL_SYSCFG_EXTI_PORTC 2U /*!< EXTI PORT C */
  100. #define LL_SYSCFG_EXTI_PORTD 3U /*!< EXTI PORT D */
  101. #define LL_SYSCFG_EXTI_PORTE 4U /*!< EXTI PORT E */
  102. #define LL_SYSCFG_EXTI_PORTH 7U /*!< EXTI PORT H */
  103. /**
  104. * @}
  105. */
  106. /** @defgroup SYSTEM_LL_EC_EXTI_LINE SYSCFG EXTI LINE
  107. * @{
  108. */
  109. #define LL_SYSCFG_EXTI_LINE0 (uint32_t)((0x000FU << 16U) | 0U) /*!< EXTI_POSITION_0 | EXTICR[0] */
  110. #define LL_SYSCFG_EXTI_LINE1 (uint32_t)((0x00F0U << 16U) | 0U) /*!< EXTI_POSITION_4 | EXTICR[0] */
  111. #define LL_SYSCFG_EXTI_LINE2 (uint32_t)((0x0F00U << 16U) | 0U) /*!< EXTI_POSITION_8 | EXTICR[0] */
  112. #define LL_SYSCFG_EXTI_LINE3 (uint32_t)((0xF000U << 16U) | 0U) /*!< EXTI_POSITION_12 | EXTICR[0] */
  113. #define LL_SYSCFG_EXTI_LINE4 (uint32_t)((0x000FU << 16U) | 1U) /*!< EXTI_POSITION_0 | EXTICR[1] */
  114. #define LL_SYSCFG_EXTI_LINE5 (uint32_t)((0x00F0U << 16U) | 1U) /*!< EXTI_POSITION_4 | EXTICR[1] */
  115. #define LL_SYSCFG_EXTI_LINE6 (uint32_t)((0x0F00U << 16U) | 1U) /*!< EXTI_POSITION_8 | EXTICR[1] */
  116. #define LL_SYSCFG_EXTI_LINE7 (uint32_t)((0xF000U << 16U) | 1U) /*!< EXTI_POSITION_12 | EXTICR[1] */
  117. #define LL_SYSCFG_EXTI_LINE8 (uint32_t)((0x000FU << 16U) | 2U) /*!< EXTI_POSITION_0 | EXTICR[2] */
  118. #define LL_SYSCFG_EXTI_LINE9 (uint32_t)((0x00F0U << 16U) | 2U) /*!< EXTI_POSITION_4 | EXTICR[2] */
  119. #define LL_SYSCFG_EXTI_LINE10 (uint32_t)((0x0F00U << 16U) | 2U) /*!< EXTI_POSITION_8 | EXTICR[2] */
  120. #define LL_SYSCFG_EXTI_LINE11 (uint32_t)((0xF000U << 16U) | 2U) /*!< EXTI_POSITION_12 | EXTICR[2] */
  121. #define LL_SYSCFG_EXTI_LINE12 (uint32_t)((0x000FU << 16U) | 3U) /*!< EXTI_POSITION_0 | EXTICR[3] */
  122. #define LL_SYSCFG_EXTI_LINE13 (uint32_t)((0x00F0U << 16U) | 3U) /*!< EXTI_POSITION_4 | EXTICR[3] */
  123. #define LL_SYSCFG_EXTI_LINE14 (uint32_t)((0x0F00U << 16U) | 3U) /*!< EXTI_POSITION_8 | EXTICR[3] */
  124. #define LL_SYSCFG_EXTI_LINE15 (uint32_t)((0xF000U << 16U) | 3U) /*!< EXTI_POSITION_12 | EXTICR[3] */
  125. /**
  126. * @}
  127. */
  128. /** @defgroup SYSTEM_LL_EC_TIMBREAK SYSCFG TIMER BREAK
  129. * @{
  130. */
  131. #define LL_SYSCFG_TIMBREAK_ECC SYSCFG_CFGR2_ECCL /*!< Enables and locks the ECC error signal
  132. with Break Input of TIM1/16/17 */
  133. #define LL_SYSCFG_TIMBREAK_PVD SYSCFG_CFGR2_PVDL /*!< Enables and locks the PVD connection
  134. with TIM1/16/17 Break Input
  135. and also the PVDE and PLS bits of the Power Control Interface */
  136. #define LL_SYSCFG_TIMBREAK_SRAM2_PARITY SYSCFG_CFGR2_SPL /*!< Enables and locks the SRAM2_PARITY error signal
  137. with Break Input of TIM1/16/17 */
  138. #define LL_SYSCFG_TIMBREAK_LOCKUP SYSCFG_CFGR2_CLL /*!< Enables and locks the LOCKUP output of CortexM4
  139. with Break Input of TIM1/16/17 */
  140. /**
  141. * @}
  142. */
  143. /** @defgroup SYSTEM_LL_EC_SRAM2WRP SYSCFG SRAM2 WRITE PROTECTION
  144. * @{
  145. */
  146. #define LL_SYSCFG_SRAM2WRP_PAGE0 SYSCFG_SWPR1_PAGE0 /*!< SRAM2A Write protection page 0 */
  147. #define LL_SYSCFG_SRAM2WRP_PAGE1 SYSCFG_SWPR1_PAGE1 /*!< SRAM2A Write protection page 1 */
  148. #define LL_SYSCFG_SRAM2WRP_PAGE2 SYSCFG_SWPR1_PAGE2 /*!< SRAM2A Write protection page 2 */
  149. #define LL_SYSCFG_SRAM2WRP_PAGE3 SYSCFG_SWPR1_PAGE3 /*!< SRAM2A Write protection page 3 */
  150. #define LL_SYSCFG_SRAM2WRP_PAGE4 SYSCFG_SWPR1_PAGE4 /*!< SRAM2A Write protection page 4 */
  151. #define LL_SYSCFG_SRAM2WRP_PAGE5 SYSCFG_SWPR1_PAGE5 /*!< SRAM2A Write protection page 5 */
  152. #define LL_SYSCFG_SRAM2WRP_PAGE6 SYSCFG_SWPR1_PAGE6 /*!< SRAM2A Write protection page 6 */
  153. #define LL_SYSCFG_SRAM2WRP_PAGE7 SYSCFG_SWPR1_PAGE7 /*!< SRAM2A Write protection page 7 */
  154. #define LL_SYSCFG_SRAM2WRP_PAGE8 SYSCFG_SWPR1_PAGE8 /*!< SRAM2A Write protection page 8 */
  155. #define LL_SYSCFG_SRAM2WRP_PAGE9 SYSCFG_SWPR1_PAGE9 /*!< SRAM2A Write protection page 9 */
  156. #define LL_SYSCFG_SRAM2WRP_PAGE10 SYSCFG_SWPR1_PAGE10 /*!< SRAM2A Write protection page 10 */
  157. #define LL_SYSCFG_SRAM2WRP_PAGE11 SYSCFG_SWPR1_PAGE11 /*!< SRAM2A Write protection page 11 */
  158. #define LL_SYSCFG_SRAM2WRP_PAGE12 SYSCFG_SWPR1_PAGE12 /*!< SRAM2A Write protection page 12 */
  159. #define LL_SYSCFG_SRAM2WRP_PAGE13 SYSCFG_SWPR1_PAGE13 /*!< SRAM2A Write protection page 13 */
  160. #define LL_SYSCFG_SRAM2WRP_PAGE14 SYSCFG_SWPR1_PAGE14 /*!< SRAM2A Write protection page 14 */
  161. #define LL_SYSCFG_SRAM2WRP_PAGE15 SYSCFG_SWPR1_PAGE15 /*!< SRAM2A Write protection page 15 */
  162. #define LL_SYSCFG_SRAM2WRP_PAGE16 SYSCFG_SWPR1_PAGE16 /*!< SRAM2A Write protection page 16 */
  163. #define LL_SYSCFG_SRAM2WRP_PAGE17 SYSCFG_SWPR1_PAGE17 /*!< SRAM2A Write protection page 17 */
  164. #define LL_SYSCFG_SRAM2WRP_PAGE18 SYSCFG_SWPR1_PAGE18 /*!< SRAM2A Write protection page 18 */
  165. #define LL_SYSCFG_SRAM2WRP_PAGE19 SYSCFG_SWPR1_PAGE19 /*!< SRAM2A Write protection page 19 */
  166. #define LL_SYSCFG_SRAM2WRP_PAGE20 SYSCFG_SWPR1_PAGE20 /*!< SRAM2A Write protection page 20 */
  167. #define LL_SYSCFG_SRAM2WRP_PAGE21 SYSCFG_SWPR1_PAGE21 /*!< SRAM2A Write protection page 21 */
  168. #define LL_SYSCFG_SRAM2WRP_PAGE22 SYSCFG_SWPR1_PAGE22 /*!< SRAM2A Write protection page 22 */
  169. #define LL_SYSCFG_SRAM2WRP_PAGE23 SYSCFG_SWPR1_PAGE23 /*!< SRAM2A Write protection page 23 */
  170. #define LL_SYSCFG_SRAM2WRP_PAGE24 SYSCFG_SWPR1_PAGE24 /*!< SRAM2A Write protection page 24 */
  171. #define LL_SYSCFG_SRAM2WRP_PAGE25 SYSCFG_SWPR1_PAGE25 /*!< SRAM2A Write protection page 25 */
  172. #define LL_SYSCFG_SRAM2WRP_PAGE26 SYSCFG_SWPR1_PAGE26 /*!< SRAM2A Write protection page 26 */
  173. #define LL_SYSCFG_SRAM2WRP_PAGE27 SYSCFG_SWPR1_PAGE27 /*!< SRAM2A Write protection page 27 */
  174. #define LL_SYSCFG_SRAM2WRP_PAGE28 SYSCFG_SWPR1_PAGE28 /*!< SRAM2A Write protection page 28 */
  175. #define LL_SYSCFG_SRAM2WRP_PAGE29 SYSCFG_SWPR1_PAGE29 /*!< SRAM2A Write protection page 29 */
  176. #define LL_SYSCFG_SRAM2WRP_PAGE30 SYSCFG_SWPR1_PAGE30 /*!< SRAM2A Write protection page 30 */
  177. #define LL_SYSCFG_SRAM2WRP_PAGE31 SYSCFG_SWPR1_PAGE31 /*!< SRAM2A Write protection page 31 */
  178. #define LL_SYSCFG_SRAM2WRP_PAGE32 SYSCFG_SWPR2_PAGE32 /*!< SRAM2B Write protection page 32 */
  179. #define LL_SYSCFG_SRAM2WRP_PAGE33 SYSCFG_SWPR2_PAGE33 /*!< SRAM2B Write protection page 33 */
  180. #define LL_SYSCFG_SRAM2WRP_PAGE34 SYSCFG_SWPR2_PAGE34 /*!< SRAM2B Write protection page 34 */
  181. #define LL_SYSCFG_SRAM2WRP_PAGE35 SYSCFG_SWPR2_PAGE35 /*!< SRAM2B Write protection page 35 */
  182. #if defined(SYSCFG_SWPR2_PAGE36)
  183. #define LL_SYSCFG_SRAM2WRP_PAGE36 SYSCFG_SWPR2_PAGE36 /*!< SRAM2B Write protection page 36 */
  184. #define LL_SYSCFG_SRAM2WRP_PAGE37 SYSCFG_SWPR2_PAGE37 /*!< SRAM2B Write protection page 37 */
  185. #define LL_SYSCFG_SRAM2WRP_PAGE38 SYSCFG_SWPR2_PAGE38 /*!< SRAM2B Write protection page 38 */
  186. #define LL_SYSCFG_SRAM2WRP_PAGE39 SYSCFG_SWPR2_PAGE39 /*!< SRAM2B Write protection page 39 */
  187. #define LL_SYSCFG_SRAM2WRP_PAGE40 SYSCFG_SWPR2_PAGE40 /*!< SRAM2B Write protection page 40 */
  188. #define LL_SYSCFG_SRAM2WRP_PAGE41 SYSCFG_SWPR2_PAGE41 /*!< SRAM2B Write protection page 41 */
  189. #define LL_SYSCFG_SRAM2WRP_PAGE42 SYSCFG_SWPR2_PAGE42 /*!< SRAM2B Write protection page 42 */
  190. #define LL_SYSCFG_SRAM2WRP_PAGE43 SYSCFG_SWPR2_PAGE43 /*!< SRAM2B Write protection page 43 */
  191. #define LL_SYSCFG_SRAM2WRP_PAGE44 SYSCFG_SWPR2_PAGE44 /*!< SRAM2B Write protection page 44 */
  192. #define LL_SYSCFG_SRAM2WRP_PAGE45 SYSCFG_SWPR2_PAGE45 /*!< SRAM2B Write protection page 45 */
  193. #define LL_SYSCFG_SRAM2WRP_PAGE46 SYSCFG_SWPR2_PAGE46 /*!< SRAM2B Write protection page 46 */
  194. #define LL_SYSCFG_SRAM2WRP_PAGE47 SYSCFG_SWPR2_PAGE47 /*!< SRAM2B Write protection page 47 */
  195. #define LL_SYSCFG_SRAM2WRP_PAGE48 SYSCFG_SWPR2_PAGE48 /*!< SRAM2B Write protection page 48 */
  196. #define LL_SYSCFG_SRAM2WRP_PAGE49 SYSCFG_SWPR2_PAGE49 /*!< SRAM2B Write protection page 49 */
  197. #define LL_SYSCFG_SRAM2WRP_PAGE50 SYSCFG_SWPR2_PAGE50 /*!< SRAM2B Write protection page 50 */
  198. #define LL_SYSCFG_SRAM2WRP_PAGE51 SYSCFG_SWPR2_PAGE51 /*!< SRAM2B Write protection page 51 */
  199. #define LL_SYSCFG_SRAM2WRP_PAGE52 SYSCFG_SWPR2_PAGE52 /*!< SRAM2B Write protection page 52 */
  200. #define LL_SYSCFG_SRAM2WRP_PAGE53 SYSCFG_SWPR2_PAGE53 /*!< SRAM2B Write protection page 53 */
  201. #define LL_SYSCFG_SRAM2WRP_PAGE54 SYSCFG_SWPR2_PAGE54 /*!< SRAM2B Write protection page 54 */
  202. #define LL_SYSCFG_SRAM2WRP_PAGE55 SYSCFG_SWPR2_PAGE55 /*!< SRAM2B Write protection page 55 */
  203. #define LL_SYSCFG_SRAM2WRP_PAGE56 SYSCFG_SWPR2_PAGE56 /*!< SRAM2B Write protection page 56 */
  204. #define LL_SYSCFG_SRAM2WRP_PAGE57 SYSCFG_SWPR2_PAGE57 /*!< SRAM2B Write protection page 57 */
  205. #define LL_SYSCFG_SRAM2WRP_PAGE58 SYSCFG_SWPR2_PAGE58 /*!< SRAM2B Write protection page 58 */
  206. #define LL_SYSCFG_SRAM2WRP_PAGE59 SYSCFG_SWPR2_PAGE59 /*!< SRAM2B Write protection page 59 */
  207. #define LL_SYSCFG_SRAM2WRP_PAGE60 SYSCFG_SWPR2_PAGE60 /*!< SRAM2B Write protection page 60 */
  208. #define LL_SYSCFG_SRAM2WRP_PAGE61 SYSCFG_SWPR2_PAGE61 /*!< SRAM2B Write protection page 61 */
  209. #define LL_SYSCFG_SRAM2WRP_PAGE62 SYSCFG_SWPR2_PAGE62 /*!< SRAM2B Write protection page 62 */
  210. #define LL_SYSCFG_SRAM2WRP_PAGE63 SYSCFG_SWPR2_PAGE63 /*!< SRAM2B Write protection page 63 */
  211. #endif
  212. /**
  213. * @}
  214. */
  215. /** @defgroup SYSTEM_LL_EC_IM SYSCFG CPU1 INTERRUPT MASK
  216. * @{
  217. */
  218. #define LL_SYSCFG_GRP1_TIM1 SYSCFG_IMR1_TIM1IM /*!< Enabling of interrupt from Timer 1 to CPU1 */
  219. #if defined(TIM16)
  220. #define LL_SYSCFG_GRP1_TIM16 SYSCFG_IMR1_TIM16IM /*!< Enabling of interrupt from Timer 16 to CPU1 */
  221. #endif
  222. #if defined(TIM17)
  223. #define LL_SYSCFG_GRP1_TIM17 SYSCFG_IMR1_TIM17IM /*!< Enabling of interrupt from Timer 17 to CPU1 */
  224. #endif
  225. #define LL_SYSCFG_GRP1_EXTI5 SYSCFG_IMR1_EXTI5IM /*!< Enabling of interrupt from External Interrupt Line 5 to CPU1 */
  226. #define LL_SYSCFG_GRP1_EXTI6 SYSCFG_IMR1_EXTI6IM /*!< Enabling of interrupt from External Interrupt Line 6 to CPU1 */
  227. #define LL_SYSCFG_GRP1_EXTI7 SYSCFG_IMR1_EXTI7IM /*!< Enabling of interrupt from External Interrupt Line 7 to CPU1 */
  228. #define LL_SYSCFG_GRP1_EXTI8 SYSCFG_IMR1_EXTI8IM /*!< Enabling of interrupt from External Interrupt Line 8 to CPU1 */
  229. #define LL_SYSCFG_GRP1_EXTI9 SYSCFG_IMR1_EXTI9IM /*!< Enabling of interrupt from External Interrupt Line 9 to CPU1 */
  230. #define LL_SYSCFG_GRP1_EXTI10 SYSCFG_IMR1_EXTI10IM /*!< Enabling of interrupt from External Interrupt Line 10 to CPU1 */
  231. #define LL_SYSCFG_GRP1_EXTI11 SYSCFG_IMR1_EXTI11IM /*!< Enabling of interrupt from External Interrupt Line 11 to CPU1 */
  232. #define LL_SYSCFG_GRP1_EXTI12 SYSCFG_IMR1_EXTI12IM /*!< Enabling of interrupt from External Interrupt Line 12 to CPU1 */
  233. #define LL_SYSCFG_GRP1_EXTI13 SYSCFG_IMR1_EXTI13IM /*!< Enabling of interrupt from External Interrupt Line 13 to CPU1 */
  234. #define LL_SYSCFG_GRP1_EXTI14 SYSCFG_IMR1_EXTI14IM /*!< Enabling of interrupt from External Interrupt Line 14 to CPU1 */
  235. #define LL_SYSCFG_GRP1_EXTI15 SYSCFG_IMR1_EXTI15IM /*!< Enabling of interrupt from External Interrupt Line 15 to CPU1 */
  236. #if defined(SYSCFG_IMR2_PVM1IM)
  237. #define LL_SYSCFG_GRP2_PVM1 SYSCFG_IMR2_PVM1IM /*!< Enabling of interrupt from Power Voltage Monitoring 1 to CPU1 */
  238. #endif
  239. #define LL_SYSCFG_GRP2_PVM3 SYSCFG_IMR2_PVM3IM /*!< Enabling of interrupt from Power Voltage Monitoring 3 to CPU1 */
  240. #define LL_SYSCFG_GRP2_PVD SYSCFG_IMR2_PVDIM /*!< Enabling of interrupt from Power Voltage Detector to CPU1 */
  241. /**
  242. * @}
  243. */
  244. /** @defgroup SYSTEM_LL_EC_C2_IM SYSCFG CPU2 INTERRUPT MASK
  245. * @{
  246. */
  247. #define LL_C2_SYSCFG_GRP1_RTCSTAMP_RTCTAMP_LSECSS SYSCFG_C2IMR1_RTCSTAMPTAMPLSECSSIM /*!< Enabling of interrupt from RTC TimeStamp, RTC Tampers
  248. and LSE Clock Security System to CPU2 */
  249. #define LL_C2_SYSCFG_GRP1_RTCWKUP SYSCFG_C2IMR1_RTCWKUPIM /*!< Enabling of interrupt from RTC Wakeup to CPU2 */
  250. #define LL_C2_SYSCFG_GRP1_RTCALARM SYSCFG_C2IMR1_RTCALARMIM /*!< Enabling of interrupt from RTC Alarms to CPU2 */
  251. #define LL_C2_SYSCFG_GRP1_RCC SYSCFG_C2IMR1_RCCIM /*!< Enabling of interrupt from RCC to CPU2 */
  252. #define LL_C2_SYSCFG_GRP1_FLASH SYSCFG_C2IMR1_FLASHIM /*!< Enabling of interrupt from FLASH to CPU2 */
  253. #define LL_C2_SYSCFG_GRP1_PKA SYSCFG_C2IMR1_PKAIM /*!< Enabling of interrupt from Public Key Accelerator to CPU2 */
  254. #define LL_C2_SYSCFG_GRP1_RNG SYSCFG_C2IMR1_RNGIM /*!< Enabling of interrupt from Random Number Generator to CPU2 */
  255. #if defined(AES1)
  256. #define LL_C2_SYSCFG_GRP1_AES1 SYSCFG_C2IMR1_AES1IM /*!< Enabling of interrupt from Advanced Encryption Standard 1 to CPU2 */
  257. #endif
  258. #if defined(COMP1)
  259. #define LL_C2_SYSCFG_GRP1_COMP SYSCFG_C2IMR1_COMPIM /*!< Enabling of interrupt from Comparator to CPU2 */
  260. #endif
  261. #define LL_C2_SYSCFG_GRP1_ADC SYSCFG_C2IMR1_ADCIM /*!< Enabling of interrupt from Analog Digital Converter to CPU2 */
  262. #define LL_C2_SYSCFG_GRP1_EXTI0 SYSCFG_C2IMR1_EXTI0IM /*!< Enabling of interrupt from External Interrupt Line 0 to CPU2 */
  263. #define LL_C2_SYSCFG_GRP1_EXTI1 SYSCFG_C2IMR1_EXTI1IM /*!< Enabling of interrupt from External Interrupt Line 1 to CPU2 */
  264. #define LL_C2_SYSCFG_GRP1_EXTI2 SYSCFG_C2IMR1_EXTI2IM /*!< Enabling of interrupt from External Interrupt Line 2 to CPU2 */
  265. #define LL_C2_SYSCFG_GRP1_EXTI3 SYSCFG_C2IMR1_EXTI3IM /*!< Enabling of interrupt from External Interrupt Line 3 to CPU2 */
  266. #define LL_C2_SYSCFG_GRP1_EXTI4 SYSCFG_C2IMR1_EXTI4IM /*!< Enabling of interrupt from External Interrupt Line 4 to CPU2 */
  267. #define LL_C2_SYSCFG_GRP1_EXTI5 SYSCFG_C2IMR1_EXTI5IM /*!< Enabling of interrupt from External Interrupt Line 5 to CPU2 */
  268. #define LL_C2_SYSCFG_GRP1_EXTI6 SYSCFG_C2IMR1_EXTI6IM /*!< Enabling of interrupt from External Interrupt Line 6 to CPU2 */
  269. #define LL_C2_SYSCFG_GRP1_EXTI7 SYSCFG_C2IMR1_EXTI7IM /*!< Enabling of interrupt from External Interrupt Line 7 to CPU2 */
  270. #define LL_C2_SYSCFG_GRP1_EXTI8 SYSCFG_C2IMR1_EXTI8IM /*!< Enabling of interrupt from External Interrupt Line 8 to CPU2 */
  271. #define LL_C2_SYSCFG_GRP1_EXTI9 SYSCFG_C2IMR1_EXTI9IM /*!< Enabling of interrupt from External Interrupt Line 9 to CPU2 */
  272. #define LL_C2_SYSCFG_GRP1_EXTI10 SYSCFG_C2IMR1_EXTI10IM /*!< Enabling of interrupt from External Interrupt Line 10 to CPU2 */
  273. #define LL_C2_SYSCFG_GRP1_EXTI11 SYSCFG_C2IMR1_EXTI11IM /*!< Enabling of interrupt from External Interrupt Line 11 to CPU2 */
  274. #define LL_C2_SYSCFG_GRP1_EXTI12 SYSCFG_C2IMR1_EXTI12IM /*!< Enabling of interrupt from External Interrupt Line 12 to CPU2 */
  275. #define LL_C2_SYSCFG_GRP1_EXTI13 SYSCFG_C2IMR1_EXTI13IM /*!< Enabling of interrupt from External Interrupt Line 13 to CPU2 */
  276. #define LL_C2_SYSCFG_GRP1_EXTI14 SYSCFG_C2IMR1_EXTI14IM /*!< Enabling of interrupt from External Interrupt Line 14 to CPU2 */
  277. #define LL_C2_SYSCFG_GRP1_EXTI15 SYSCFG_C2IMR1_EXTI15IM /*!< Enabling of interrupt from External Interrupt Line 15 to CPU2 */
  278. #define LL_C2_SYSCFG_GRP2_DMA1CH1 SYSCFG_C2IMR2_DMA1CH1IM /*!< Enabling of interrupt from DMA1 Channel 1 to CPU2 */
  279. #define LL_C2_SYSCFG_GRP2_DMA1CH2 SYSCFG_C2IMR2_DMA1CH2IM /*!< Enabling of interrupt from DMA1 Channel 2 to CPU2 */
  280. #define LL_C2_SYSCFG_GRP2_DMA1CH3 SYSCFG_C2IMR2_DMA1CH3IM /*!< Enabling of interrupt from DMA1 Channel 3 to CPU2 */
  281. #define LL_C2_SYSCFG_GRP2_DMA1CH4 SYSCFG_C2IMR2_DMA1CH4IM /*!< Enabling of interrupt from DMA1 Channel 4 to CPU2 */
  282. #define LL_C2_SYSCFG_GRP2_DMA1CH5 SYSCFG_C2IMR2_DMA1CH5IM /*!< Enabling of interrupt from DMA1 Channel 5 to CPU2 */
  283. #define LL_C2_SYSCFG_GRP2_DMA1CH6 SYSCFG_C2IMR2_DMA1CH6IM /*!< Enabling of interrupt from DMA1 Channel 6 to CPU2 */
  284. #define LL_C2_SYSCFG_GRP2_DMA1CH7 SYSCFG_C2IMR2_DMA1CH7IM /*!< Enabling of interrupt from DMA1 Channel 7 to CPU2 */
  285. #if defined(DMA2)
  286. #define LL_C2_SYSCFG_GRP2_DMA2CH1 SYSCFG_C2IMR2_DMA2CH1IM /*!< Enabling of interrupt from DMA2 Channel 1 to CPU2 */
  287. #define LL_C2_SYSCFG_GRP2_DMA2CH2 SYSCFG_C2IMR2_DMA2CH2IM /*!< Enabling of interrupt from DMA2 Channel 2 to CPU2 */
  288. #define LL_C2_SYSCFG_GRP2_DMA2CH3 SYSCFG_C2IMR2_DMA2CH3IM /*!< Enabling of interrupt from DMA2 Channel 3 to CPU2 */
  289. #define LL_C2_SYSCFG_GRP2_DMA2CH4 SYSCFG_C2IMR2_DMA2CH4IM /*!< Enabling of interrupt from DMA2 Channel 4 to CPU2 */
  290. #define LL_C2_SYSCFG_GRP2_DMA2CH5 SYSCFG_C2IMR2_DMA2CH5IM /*!< Enabling of interrupt from DMA2 Channel 5 to CPU2 */
  291. #define LL_C2_SYSCFG_GRP2_DMA2CH6 SYSCFG_C2IMR2_DMA2CH6IM /*!< Enabling of interrupt from DMA2 Channel 6 to CPU2 */
  292. #define LL_C2_SYSCFG_GRP2_DMA2CH7 SYSCFG_C2IMR2_DMA2CH7IM /*!< Enabling of interrupt from DMA2 Channel 7 to CPU2 */
  293. #endif
  294. #define LL_C2_SYSCFG_GRP2_DMAMUX1 SYSCFG_C2IMR2_DMAMUX1IM /*!< Enabling of interrupt from DMAMUX1 to CPU2 */
  295. #if defined(SYSCFG_C2IMR2_PVM1IM)
  296. #define LL_C2_SYSCFG_GRP2_PVM1 SYSCFG_C2IMR2_PVM1IM /*!< Enabling of interrupt from Power Voltage Monitoring 1 to CPU2 */
  297. #endif
  298. #define LL_C2_SYSCFG_GRP2_PVM3 SYSCFG_C2IMR2_PVM3IM /*!< Enabling of interrupt from Power Voltage Monitoring 3 to CPU2 */
  299. #define LL_C2_SYSCFG_GRP2_PVD SYSCFG_C2IMR2_PVDIM /*!< Enabling of interrupt from Power Voltage Detector to CPU2 */
  300. #define LL_C2_SYSCFG_GRP2_TSC SYSCFG_C2IMR2_TSCIM /*!< Enabling of interrupt from Touch Sensing Controller to CPU2 */
  301. #if defined(LCD)
  302. #define LL_C2_SYSCFG_GRP2_LCD SYSCFG_C2IMR2_LCDIM /*!< Enabling of interrupt from Liquid Crystal Display to CPU2 */
  303. #endif
  304. /**
  305. * @}
  306. */
  307. /** @defgroup SYSTEM_LL_EC_SECURE_IP_ACCESS SYSCFG SECURE IP ACCESS
  308. * @{
  309. */
  310. #if defined(AES1)
  311. #define LL_SYSCFG_SECURE_ACCESS_AES1 SYSCFG_SIPCR_SAES1 /*!< Enabling the security access of Advanced Encryption Standard 1 KEY[7:0] */
  312. #endif
  313. #define LL_SYSCFG_SECURE_ACCESS_AES2 SYSCFG_SIPCR_SAES2 /*!< Enabling the security access of Advanced Encryption Standard 2 */
  314. #define LL_SYSCFG_SECURE_ACCESS_PKA SYSCFG_SIPCR_SPKA /*!< Enabling the security access of Public Key Accelerator */
  315. #define LL_SYSCFG_SECURE_ACCESS_RNG SYSCFG_SIPCR_SRNG /*!< Enabling the security access of Random Number Generator */
  316. /**
  317. * @}
  318. */
  319. /** @defgroup SYSTEM_LL_EC_APB1_GRP1_STOP_IP DBGMCU CPU1 APB1 GRP1 STOP IP
  320. * @{
  321. */
  322. #define LL_DBGMCU_APB1_GRP1_TIM2_STOP DBGMCU_APB1FZR1_DBG_TIM2_STOP /*!< The counter clock of TIM2 is stopped when the core is halted */
  323. #define LL_DBGMCU_APB1_GRP1_RTC_STOP DBGMCU_APB1FZR1_DBG_RTC_STOP /*!< The clock of the RTC counter is stopped when the core is halted */
  324. #define LL_DBGMCU_APB1_GRP1_WWDG_STOP DBGMCU_APB1FZR1_DBG_WWDG_STOP /*!< The window watchdog counter clock is stopped when the core is halted */
  325. #define LL_DBGMCU_APB1_GRP1_IWDG_STOP DBGMCU_APB1FZR1_DBG_IWDG_STOP /*!< The independent watchdog counter clock is stopped when the core is halted */
  326. #define LL_DBGMCU_APB1_GRP1_I2C1_STOP DBGMCU_APB1FZR1_DBG_I2C1_STOP /*!< The I2C1 SMBus timeout is frozen */
  327. #if defined(I2C3)
  328. #define LL_DBGMCU_APB1_GRP1_I2C3_STOP DBGMCU_APB1FZR1_DBG_I2C3_STOP /*!< The I2C3 SMBus timeout is frozen */
  329. #endif
  330. #define LL_DBGMCU_APB1_GRP1_LPTIM1_STOP DBGMCU_APB1FZR1_DBG_LPTIM1_STOP /*!< The counter clock of LPTIM1 is stopped when the core is halted */
  331. /**
  332. * @}
  333. */
  334. /** @defgroup SYSTEM_LL_EC_C2_APB1_GRP1_STOP_IP DBGMCU CPU2 APB1 GRP1 STOP IP
  335. * @{
  336. */
  337. #define LL_C2_DBGMCU_APB1_GRP1_TIM2_STOP DBGMCU_C2APB1FZR1_DBG_TIM2_STOP /*!< The counter clock of TIM2 is stopped when the core is halted */
  338. #define LL_C2_DBGMCU_APB1_GRP1_RTC_STOP DBGMCU_C2APB1FZR1_DBG_RTC_STOP /*!< The clock of the RTC counter is stopped when the core is halted */
  339. #define LL_C2_DBGMCU_APB1_GRP1_IWDG_STOP DBGMCU_C2APB1FZR1_DBG_IWDG_STOP /*!< The independent watchdog counter clock is stopped when the core is halted */
  340. #define LL_C2_DBGMCU_APB1_GRP1_I2C1_STOP DBGMCU_C2APB1FZR1_DBG_I2C1_STOP /*!< The I2C1 SMBus timeout is frozen */
  341. #if defined(I2C3)
  342. #define LL_C2_DBGMCU_APB1_GRP1_I2C3_STOP DBGMCU_C2APB1FZR1_DBG_I2C3_STOP /*!< The I2C3 SMBus timeout is frozen */
  343. #endif
  344. #define LL_C2_DBGMCU_APB1_GRP1_LPTIM1_STOP DBGMCU_C2APB1FZR1_DBG_LPTIM1_STOP /*!< The counter clock of LPTIM1 is stopped when the core is halted */
  345. /**
  346. * @}
  347. */
  348. /** @defgroup SYSTEM_LL_EC_APB1_GRP2_STOP_IP DBGMCU CPU1 APB1 GRP2 STOP IP
  349. * @{
  350. */
  351. #define LL_DBGMCU_APB1_GRP2_LPTIM2_STOP DBGMCU_APB1FZR2_DBG_LPTIM2_STOP /*!< The counter clock of LPTIM2 is stopped when the core is halted */
  352. /**
  353. * @}
  354. */
  355. /** @defgroup SYSTEM_LL_EC_C2_APB1_GRP2_STOP_IP DBGMCU CPU2 APB1 GRP2 STOP IP
  356. * @{
  357. */
  358. #define LL_C2_DBGMCU_APB1_GRP2_LPTIM2_STOP DBGMCU_C2APB1FZR2_DBG_LPTIM2_STOP /*!< The counter clock of LPTIM2 is stopped when the core is halted */
  359. /**
  360. * @}
  361. */
  362. /** @defgroup SYSTEM_LL_EC_APB2_GRP1_STOP_IP DBGMCU CPU1 APB2 GRP1 STOP IP
  363. * @{
  364. */
  365. #define LL_DBGMCU_APB2_GRP1_TIM1_STOP DBGMCU_APB2FZR_DBG_TIM1_STOP /*!< The counter clock of TIM1 is stopped when the core is halted */
  366. #if defined(TIM16)
  367. #define LL_DBGMCU_APB2_GRP1_TIM16_STOP DBGMCU_APB2FZR_DBG_TIM16_STOP /*!< The counter clock of TIM16 is stopped when the core is halted */
  368. #endif
  369. #if defined(TIM17)
  370. #define LL_DBGMCU_APB2_GRP1_TIM17_STOP DBGMCU_APB2FZR_DBG_TIM17_STOP /*!< The counter clock of TIM17 is stopped when the core is halted */
  371. #endif
  372. /**
  373. * @}
  374. */
  375. /** @defgroup SYSTEM_LL_EC_C2_APB2_GRP1_STOP_IP DBGMCU CPU2 APB2 GRP1 STOP IP
  376. * @{
  377. */
  378. #define LL_C2_DBGMCU_APB2_GRP1_TIM1_STOP DBGMCU_C2APB2FZR_DBG_TIM1_STOP /*!< The counter clock of TIM1 is stopped when the core is halted */
  379. #if defined(TIM16)
  380. #define LL_C2_DBGMCU_APB2_GRP1_TIM16_STOP DBGMCU_C2APB2FZR_DBG_TIM16_STOP /*!< The counter clock of TIM16 is stopped when the core is halted */
  381. #endif
  382. #if defined(TIM17)
  383. #define LL_C2_DBGMCU_APB2_GRP1_TIM17_STOP DBGMCU_C2APB2FZR_DBG_TIM17_STOP /*!< The counter clock of TIM17 is stopped when the core is halted */
  384. #endif
  385. /**
  386. * @}
  387. */
  388. #if defined(VREFBUF)
  389. /** @defgroup SYSTEM_LL_EC_VOLTAGE VREFBUF VOLTAGE
  390. * @{
  391. */
  392. #define LL_VREFBUF_VOLTAGE_SCALE0 0x00000000U /*!< Voltage reference scale 0 (VREF_OUT1) */
  393. #define LL_VREFBUF_VOLTAGE_SCALE1 VREFBUF_CSR_VRS /*!< Voltage reference scale 1 (VREF_OUT2) */
  394. /**
  395. * @}
  396. */
  397. #endif /* VREFBUF */
  398. /** @defgroup SYSTEM_LL_EC_LATENCY FLASH LATENCY
  399. * @{
  400. */
  401. #define LL_FLASH_LATENCY_0 FLASH_ACR_LATENCY_0WS /*!< FLASH Zero wait state */
  402. #define LL_FLASH_LATENCY_1 FLASH_ACR_LATENCY_1WS /*!< FLASH One wait state */
  403. #define LL_FLASH_LATENCY_2 FLASH_ACR_LATENCY_2WS /*!< FLASH Two wait states */
  404. #define LL_FLASH_LATENCY_3 FLASH_ACR_LATENCY_3WS /*!< FLASH Three wait states */
  405. /**
  406. * @}
  407. */
  408. /**
  409. * @}
  410. */
  411. /* Exported macro ------------------------------------------------------------*/
  412. /* Exported functions --------------------------------------------------------*/
  413. /** @defgroup SYSTEM_LL_Exported_Functions SYSTEM Exported Functions
  414. * @{
  415. */
  416. /** @defgroup SYSTEM_LL_EF_SYSCFG SYSCFG
  417. * @{
  418. */
  419. /**
  420. * @brief Set memory mapping at address 0x00000000
  421. * @rmtoll SYSCFG_MEMRMP MEM_MODE LL_SYSCFG_SetRemapMemory
  422. * @param Memory This parameter can be one of the following values:
  423. * @arg @ref LL_SYSCFG_REMAP_FLASH
  424. * @arg @ref LL_SYSCFG_REMAP_SYSTEMFLASH
  425. * @arg @ref LL_SYSCFG_REMAP_SRAM
  426. * @arg @ref LL_SYSCFG_REMAP_QUADSPI
  427. * @retval None
  428. */
  429. __STATIC_INLINE void LL_SYSCFG_SetRemapMemory(uint32_t Memory)
  430. {
  431. MODIFY_REG(SYSCFG->MEMRMP, SYSCFG_MEMRMP_MEM_MODE, Memory);
  432. }
  433. /**
  434. * @brief Get memory mapping at address 0x00000000
  435. * @rmtoll SYSCFG_MEMRMP MEM_MODE LL_SYSCFG_GetRemapMemory
  436. * @retval Returned value can be one of the following values:
  437. * @arg @ref LL_SYSCFG_REMAP_FLASH
  438. * @arg @ref LL_SYSCFG_REMAP_SYSTEMFLASH
  439. * @arg @ref LL_SYSCFG_REMAP_SRAM
  440. * @arg @ref LL_SYSCFG_REMAP_QUADSPI
  441. */
  442. __STATIC_INLINE uint32_t LL_SYSCFG_GetRemapMemory(void)
  443. {
  444. return (uint32_t)(READ_BIT(SYSCFG->MEMRMP, SYSCFG_MEMRMP_MEM_MODE));
  445. }
  446. /**
  447. * @brief Enable I/O analog switch voltage booster.
  448. * @note When voltage booster is enabled, I/O analog switches are supplied
  449. * by a dedicated voltage booster, from VDD power domain. This is
  450. * the recommended configuration with low VDDA voltage operation.
  451. * @note The I/O analog switch voltage booster is relevant for peripherals
  452. * using I/O in analog input: ADC and COMP.
  453. * However, COMP inputs have a high impedance and
  454. * voltage booster do not impact performance significantly.
  455. * Therefore, the voltage booster is mainly intended for
  456. * usage with ADC.
  457. * @rmtoll SYSCFG_CFGR1 BOOSTEN LL_SYSCFG_EnableAnalogBooster
  458. * @retval None
  459. */
  460. __STATIC_INLINE void LL_SYSCFG_EnableAnalogBooster(void)
  461. {
  462. SET_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_BOOSTEN);
  463. }
  464. /**
  465. * @brief Disable I/O analog switch voltage booster.
  466. * @note When voltage booster is enabled, I/O analog switches are supplied
  467. * by a dedicated voltage booster, from VDD power domain. This is
  468. * the recommended configuration with low VDDA voltage operation.
  469. * @note The I/O analog switch voltage booster is relevant for peripherals
  470. * using I/O in analog input: ADC and COMP.
  471. * However, COMP inputs have a high impedance and
  472. * voltage booster do not impact performance significantly.
  473. * Therefore, the voltage booster is mainly intended for
  474. * usage with ADC.
  475. * @rmtoll SYSCFG_CFGR1 BOOSTEN LL_SYSCFG_DisableAnalogBooster
  476. * @retval None
  477. */
  478. __STATIC_INLINE void LL_SYSCFG_DisableAnalogBooster(void)
  479. {
  480. CLEAR_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_BOOSTEN);
  481. }
  482. #if defined(SYSCFG_CFGR1_ANASWVDD)
  483. /**
  484. * @brief Enable the Analog GPIO switch to control voltage selection
  485. * when the supply voltage is supplied by VDDA
  486. * @rmtoll SYSCFG_CFGR1 ANASWVDD LL_SYSCFG_EnableAnalogGpioSwitch
  487. * @note Activating the gpio switch enable IOs analog switches supplied by VDDA
  488. * @retval None
  489. */
  490. __STATIC_INLINE void LL_SYSCFG_EnableAnalogGpioSwitch(void)
  491. {
  492. SET_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_ANASWVDD);
  493. }
  494. /**
  495. * @brief Disable the Analog GPIO switch to control voltage selection
  496. * when the supply voltage is supplied by VDDA
  497. * @rmtoll SYSCFG_CFGR1 ANASWVDD LL_SYSCFG_DisableAnalogGpioSwitch
  498. * @note Activating the gpio switch enable IOs analog switches supplied by VDDA
  499. * @retval None
  500. */
  501. __STATIC_INLINE void LL_SYSCFG_DisableAnalogGpioSwitch(void)
  502. {
  503. CLEAR_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_ANASWVDD);
  504. }
  505. #endif
  506. /**
  507. * @brief Enable the I2C fast mode plus driving capability.
  508. * @rmtoll SYSCFG_CFGR1 I2C_PBx_FMP LL_SYSCFG_EnableFastModePlus\n
  509. * SYSCFG_CFGR1 I2Cx_FMP LL_SYSCFG_EnableFastModePlus
  510. * @param ConfigFastModePlus This parameter can be a combination of the following values:
  511. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB6
  512. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB7
  513. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB8
  514. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB9
  515. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C1
  516. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C3
  517. * @retval None
  518. */
  519. __STATIC_INLINE void LL_SYSCFG_EnableFastModePlus(uint32_t ConfigFastModePlus)
  520. {
  521. SET_BIT(SYSCFG->CFGR1, ConfigFastModePlus);
  522. }
  523. /**
  524. * @brief Disable the I2C fast mode plus driving capability.
  525. * @rmtoll SYSCFG_CFGR1 I2C_PBx_FMP LL_SYSCFG_DisableFastModePlus\n
  526. * SYSCFG_CFGR1 I2Cx_FMP LL_SYSCFG_DisableFastModePlus
  527. * @param ConfigFastModePlus This parameter can be a combination of the following values:
  528. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB6
  529. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB7
  530. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB8
  531. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB9
  532. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C1
  533. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C3
  534. * @retval None
  535. */
  536. __STATIC_INLINE void LL_SYSCFG_DisableFastModePlus(uint32_t ConfigFastModePlus)
  537. {
  538. CLEAR_BIT(SYSCFG->CFGR1, ConfigFastModePlus);
  539. }
  540. /**
  541. * @brief Enable Floating Point Unit Invalid operation Interrupt
  542. * @rmtoll SYSCFG_CFGR1 FPU_IE_0 LL_SYSCFG_EnableIT_FPU_IOC
  543. * @retval None
  544. */
  545. __STATIC_INLINE void LL_SYSCFG_EnableIT_FPU_IOC(void)
  546. {
  547. SET_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_0);
  548. }
  549. /**
  550. * @brief Enable Floating Point Unit Divide-by-zero Interrupt
  551. * @rmtoll SYSCFG_CFGR1 FPU_IE_1 LL_SYSCFG_EnableIT_FPU_DZC
  552. * @retval None
  553. */
  554. __STATIC_INLINE void LL_SYSCFG_EnableIT_FPU_DZC(void)
  555. {
  556. SET_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_1);
  557. }
  558. /**
  559. * @brief Enable Floating Point Unit Underflow Interrupt
  560. * @rmtoll SYSCFG_CFGR1 FPU_IE_2 LL_SYSCFG_EnableIT_FPU_UFC
  561. * @retval None
  562. */
  563. __STATIC_INLINE void LL_SYSCFG_EnableIT_FPU_UFC(void)
  564. {
  565. SET_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_2);
  566. }
  567. /**
  568. * @brief Enable Floating Point Unit Overflow Interrupt
  569. * @rmtoll SYSCFG_CFGR1 FPU_IE_3 LL_SYSCFG_EnableIT_FPU_OFC
  570. * @retval None
  571. */
  572. __STATIC_INLINE void LL_SYSCFG_EnableIT_FPU_OFC(void)
  573. {
  574. SET_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_3);
  575. }
  576. /**
  577. * @brief Enable Floating Point Unit Input denormal Interrupt
  578. * @rmtoll SYSCFG_CFGR1 FPU_IE_4 LL_SYSCFG_EnableIT_FPU_IDC
  579. * @retval None
  580. */
  581. __STATIC_INLINE void LL_SYSCFG_EnableIT_FPU_IDC(void)
  582. {
  583. SET_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_4);
  584. }
  585. /**
  586. * @brief Enable Floating Point Unit Inexact Interrupt
  587. * @rmtoll SYSCFG_CFGR1 FPU_IE_5 LL_SYSCFG_EnableIT_FPU_IXC
  588. * @retval None
  589. */
  590. __STATIC_INLINE void LL_SYSCFG_EnableIT_FPU_IXC(void)
  591. {
  592. SET_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_5);
  593. }
  594. /**
  595. * @brief Disable Floating Point Unit Invalid operation Interrupt
  596. * @rmtoll SYSCFG_CFGR1 FPU_IE_0 LL_SYSCFG_DisableIT_FPU_IOC
  597. * @retval None
  598. */
  599. __STATIC_INLINE void LL_SYSCFG_DisableIT_FPU_IOC(void)
  600. {
  601. CLEAR_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_0);
  602. }
  603. /**
  604. * @brief Disable Floating Point Unit Divide-by-zero Interrupt
  605. * @rmtoll SYSCFG_CFGR1 FPU_IE_1 LL_SYSCFG_DisableIT_FPU_DZC
  606. * @retval None
  607. */
  608. __STATIC_INLINE void LL_SYSCFG_DisableIT_FPU_DZC(void)
  609. {
  610. CLEAR_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_1);
  611. }
  612. /**
  613. * @brief Disable Floating Point Unit Underflow Interrupt
  614. * @rmtoll SYSCFG_CFGR1 FPU_IE_2 LL_SYSCFG_DisableIT_FPU_UFC
  615. * @retval None
  616. */
  617. __STATIC_INLINE void LL_SYSCFG_DisableIT_FPU_UFC(void)
  618. {
  619. CLEAR_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_2);
  620. }
  621. /**
  622. * @brief Disable Floating Point Unit Overflow Interrupt
  623. * @rmtoll SYSCFG_CFGR1 FPU_IE_3 LL_SYSCFG_DisableIT_FPU_OFC
  624. * @retval None
  625. */
  626. __STATIC_INLINE void LL_SYSCFG_DisableIT_FPU_OFC(void)
  627. {
  628. CLEAR_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_3);
  629. }
  630. /**
  631. * @brief Disable Floating Point Unit Input denormal Interrupt
  632. * @rmtoll SYSCFG_CFGR1 FPU_IE_4 LL_SYSCFG_DisableIT_FPU_IDC
  633. * @retval None
  634. */
  635. __STATIC_INLINE void LL_SYSCFG_DisableIT_FPU_IDC(void)
  636. {
  637. CLEAR_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_4);
  638. }
  639. /**
  640. * @brief Disable Floating Point Unit Inexact Interrupt
  641. * @rmtoll SYSCFG_CFGR1 FPU_IE_5 LL_SYSCFG_DisableIT_FPU_IXC
  642. * @retval None
  643. */
  644. __STATIC_INLINE void LL_SYSCFG_DisableIT_FPU_IXC(void)
  645. {
  646. CLEAR_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_5);
  647. }
  648. /**
  649. * @brief Check if Floating Point Unit Invalid operation Interrupt source is enabled or disabled.
  650. * @rmtoll SYSCFG_CFGR1 FPU_IE_0 LL_SYSCFG_IsEnabledIT_FPU_IOC
  651. * @retval State of bit (1 or 0).
  652. */
  653. __STATIC_INLINE uint32_t LL_SYSCFG_IsEnabledIT_FPU_IOC(void)
  654. {
  655. return ((READ_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_0) == (SYSCFG_CFGR1_FPU_IE_0)) ? 1UL : 0UL);
  656. }
  657. /**
  658. * @brief Check if Floating Point Unit Divide-by-zero Interrupt source is enabled or disabled.
  659. * @rmtoll SYSCFG_CFGR1 FPU_IE_1 LL_SYSCFG_IsEnabledIT_FPU_DZC
  660. * @retval State of bit (1 or 0).
  661. */
  662. __STATIC_INLINE uint32_t LL_SYSCFG_IsEnabledIT_FPU_DZC(void)
  663. {
  664. return ((READ_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_1) == (SYSCFG_CFGR1_FPU_IE_1)) ? 1UL : 0UL);
  665. }
  666. /**
  667. * @brief Check if Floating Point Unit Underflow Interrupt source is enabled or disabled.
  668. * @rmtoll SYSCFG_CFGR1 FPU_IE_2 LL_SYSCFG_IsEnabledIT_FPU_UFC
  669. * @retval State of bit (1 or 0).
  670. */
  671. __STATIC_INLINE uint32_t LL_SYSCFG_IsEnabledIT_FPU_UFC(void)
  672. {
  673. return ((READ_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_2) == (SYSCFG_CFGR1_FPU_IE_2)) ? 1UL : 0UL);
  674. }
  675. /**
  676. * @brief Check if Floating Point Unit Overflow Interrupt source is enabled or disabled.
  677. * @rmtoll SYSCFG_CFGR1 FPU_IE_3 LL_SYSCFG_IsEnabledIT_FPU_OFC
  678. * @retval State of bit (1 or 0).
  679. */
  680. __STATIC_INLINE uint32_t LL_SYSCFG_IsEnabledIT_FPU_OFC(void)
  681. {
  682. return ((READ_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_3) == (SYSCFG_CFGR1_FPU_IE_3)) ? 1UL : 0UL);
  683. }
  684. /**
  685. * @brief Check if Floating Point Unit Input denormal Interrupt source is enabled or disabled.
  686. * @rmtoll SYSCFG_CFGR1 FPU_IE_4 LL_SYSCFG_IsEnabledIT_FPU_IDC
  687. * @retval State of bit (1 or 0).
  688. */
  689. __STATIC_INLINE uint32_t LL_SYSCFG_IsEnabledIT_FPU_IDC(void)
  690. {
  691. return ((READ_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_4) == (SYSCFG_CFGR1_FPU_IE_4)) ? 1UL : 0UL);
  692. }
  693. /**
  694. * @brief Check if Floating Point Unit Inexact Interrupt source is enabled or disabled.
  695. * @rmtoll SYSCFG_CFGR1 FPU_IE_5 LL_SYSCFG_IsEnabledIT_FPU_IXC
  696. * @retval State of bit (1 or 0).
  697. */
  698. __STATIC_INLINE uint32_t LL_SYSCFG_IsEnabledIT_FPU_IXC(void)
  699. {
  700. return ((READ_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_5) == (SYSCFG_CFGR1_FPU_IE_5)) ? 1UL : 0UL);
  701. }
  702. /**
  703. * @brief Configure source input for the EXTI external interrupt.
  704. * @rmtoll SYSCFG_EXTICR1 EXTIx LL_SYSCFG_SetEXTISource\n
  705. * SYSCFG_EXTICR2 EXTIx LL_SYSCFG_SetEXTISource\n
  706. * SYSCFG_EXTICR3 EXTIx LL_SYSCFG_SetEXTISource\n
  707. * SYSCFG_EXTICR4 EXTIx LL_SYSCFG_SetEXTISource
  708. * @param Port This parameter can be one of the following values:
  709. * @arg @ref LL_SYSCFG_EXTI_PORTA
  710. * @arg @ref LL_SYSCFG_EXTI_PORTB
  711. * @arg @ref LL_SYSCFG_EXTI_PORTC
  712. * @arg @ref LL_SYSCFG_EXTI_PORTD
  713. * @arg @ref LL_SYSCFG_EXTI_PORTE
  714. * @arg @ref LL_SYSCFG_EXTI_PORTH
  715. *
  716. * @param Line This parameter can be one of the following values:
  717. * @arg @ref LL_SYSCFG_EXTI_LINE0
  718. * @arg @ref LL_SYSCFG_EXTI_LINE1
  719. * @arg @ref LL_SYSCFG_EXTI_LINE2
  720. * @arg @ref LL_SYSCFG_EXTI_LINE3
  721. * @arg @ref LL_SYSCFG_EXTI_LINE4
  722. * @arg @ref LL_SYSCFG_EXTI_LINE5
  723. * @arg @ref LL_SYSCFG_EXTI_LINE6
  724. * @arg @ref LL_SYSCFG_EXTI_LINE7
  725. * @arg @ref LL_SYSCFG_EXTI_LINE8
  726. * @arg @ref LL_SYSCFG_EXTI_LINE9
  727. * @arg @ref LL_SYSCFG_EXTI_LINE10
  728. * @arg @ref LL_SYSCFG_EXTI_LINE11
  729. * @arg @ref LL_SYSCFG_EXTI_LINE12
  730. * @arg @ref LL_SYSCFG_EXTI_LINE13
  731. * @arg @ref LL_SYSCFG_EXTI_LINE14
  732. * @arg @ref LL_SYSCFG_EXTI_LINE15
  733. * @retval None
  734. */
  735. __STATIC_INLINE void LL_SYSCFG_SetEXTISource(uint32_t Port, uint32_t Line)
  736. {
  737. MODIFY_REG(SYSCFG->EXTICR[Line & 0x03U], (Line >> 16U), (Port << ((POSITION_VAL((Line >> 16U))) & 0x0000000FUL)));
  738. }
  739. /**
  740. * @brief Get the configured defined for specific EXTI Line
  741. * @rmtoll SYSCFG_EXTICR1 EXTIx LL_SYSCFG_GetEXTISource\n
  742. * SYSCFG_EXTICR2 EXTIx LL_SYSCFG_GetEXTISource\n
  743. * SYSCFG_EXTICR3 EXTIx LL_SYSCFG_GetEXTISource\n
  744. * SYSCFG_EXTICR4 EXTIx LL_SYSCFG_GetEXTISource
  745. * @param Line This parameter can be one of the following values:
  746. * @arg @ref LL_SYSCFG_EXTI_LINE0
  747. * @arg @ref LL_SYSCFG_EXTI_LINE1
  748. * @arg @ref LL_SYSCFG_EXTI_LINE2
  749. * @arg @ref LL_SYSCFG_EXTI_LINE3
  750. * @arg @ref LL_SYSCFG_EXTI_LINE4
  751. * @arg @ref LL_SYSCFG_EXTI_LINE5
  752. * @arg @ref LL_SYSCFG_EXTI_LINE6
  753. * @arg @ref LL_SYSCFG_EXTI_LINE7
  754. * @arg @ref LL_SYSCFG_EXTI_LINE8
  755. * @arg @ref LL_SYSCFG_EXTI_LINE9
  756. * @arg @ref LL_SYSCFG_EXTI_LINE10
  757. * @arg @ref LL_SYSCFG_EXTI_LINE11
  758. * @arg @ref LL_SYSCFG_EXTI_LINE12
  759. * @arg @ref LL_SYSCFG_EXTI_LINE13
  760. * @arg @ref LL_SYSCFG_EXTI_LINE14
  761. * @arg @ref LL_SYSCFG_EXTI_LINE15
  762. * @retval Returned value can be one of the following values:
  763. * @arg @ref LL_SYSCFG_EXTI_PORTA
  764. * @arg @ref LL_SYSCFG_EXTI_PORTB
  765. * @arg @ref LL_SYSCFG_EXTI_PORTC
  766. * @arg @ref LL_SYSCFG_EXTI_PORTD
  767. * @arg @ref LL_SYSCFG_EXTI_PORTE
  768. * @arg @ref LL_SYSCFG_EXTI_PORTH
  769. */
  770. __STATIC_INLINE uint32_t LL_SYSCFG_GetEXTISource(uint32_t Line)
  771. {
  772. return (uint32_t)(READ_BIT(SYSCFG->EXTICR[Line & 0x03U], (Line >> 16U)) >> (POSITION_VAL(Line >> 16U) & 0x0000000FUL) );
  773. }
  774. /**
  775. * @brief Enable SRAM2 Erase (starts a hardware SRAM2 erase operation. This bit is
  776. * automatically cleared at the end of the SRAM2 erase operation.)
  777. * @note This bit is write-protected: setting this bit is possible only after the
  778. * correct key sequence is written in the SYSCFG_SKR register.
  779. * @rmtoll SYSCFG_SCSR SRAM2ER LL_SYSCFG_EnableSRAM2Erase
  780. * @retval None
  781. */
  782. __STATIC_INLINE void LL_SYSCFG_EnableSRAM2Erase(void)
  783. {
  784. SET_BIT(SYSCFG->SCSR, SYSCFG_SCSR_SRAM2ER);
  785. }
  786. /**
  787. * @brief Check if SRAM2 erase operation is on going
  788. * @rmtoll SYSCFG_SCSR SRAM2BSY LL_SYSCFG_IsSRAM2EraseOngoing
  789. * @retval State of bit (1 or 0).
  790. */
  791. __STATIC_INLINE uint32_t LL_SYSCFG_IsSRAM2EraseOngoing(void)
  792. {
  793. return ((READ_BIT(SYSCFG->SCSR, SYSCFG_SCSR_SRAM2BSY) == (SYSCFG_SCSR_SRAM2BSY)) ? 1UL : 0UL);
  794. }
  795. /**
  796. * @brief Disable CPU2 SRAM fetch (execution) (This bit can be set by Firmware
  797. * and will only be reset by a Hardware reset, including a reset after Standby.)
  798. * @note Firmware writing 0 has no effect.
  799. * @rmtoll SYSCFG_SCSR C2RFD LL_SYSCFG_DisableSRAMFetch
  800. * @retval None
  801. */
  802. __STATIC_INLINE void LL_SYSCFG_DisableSRAMFetch(void)
  803. {
  804. SET_BIT(SYSCFG->SCSR, SYSCFG_SCSR_C2RFD);
  805. }
  806. /**
  807. * @brief Check if CPU2 SRAM fetch is enabled
  808. * @rmtoll SYSCFG_SCSR C2RFD LL_SYSCFG_IsEnabledSRAMFetch
  809. * @retval State of bit (1 or 0).
  810. */
  811. __STATIC_INLINE uint32_t LL_SYSCFG_IsEnabledSRAMFetch(void)
  812. {
  813. return ((READ_BIT(SYSCFG->SCSR, SYSCFG_SCSR_C2RFD) != (SYSCFG_SCSR_C2RFD)) ? 1UL : 0UL);
  814. }
  815. /**
  816. * @brief Set connections to TIM1/16/17 Break inputs
  817. * @rmtoll SYSCFG_CFGR2 CLL LL_SYSCFG_SetTIMBreakInputs\n
  818. * SYSCFG_CFGR2 SPL LL_SYSCFG_SetTIMBreakInputs\n
  819. * SYSCFG_CFGR2 PVDL LL_SYSCFG_SetTIMBreakInputs\n
  820. * SYSCFG_CFGR2 ECCL LL_SYSCFG_SetTIMBreakInputs
  821. * @param Break This parameter can be a combination of the following values:
  822. * @arg @ref LL_SYSCFG_TIMBREAK_ECC
  823. * @arg @ref LL_SYSCFG_TIMBREAK_PVD
  824. * @arg @ref LL_SYSCFG_TIMBREAK_SRAM2_PARITY
  825. * @arg @ref LL_SYSCFG_TIMBREAK_LOCKUP
  826. * @retval None
  827. */
  828. __STATIC_INLINE void LL_SYSCFG_SetTIMBreakInputs(uint32_t Break)
  829. {
  830. MODIFY_REG(SYSCFG->CFGR2, SYSCFG_CFGR2_CLL | SYSCFG_CFGR2_SPL | SYSCFG_CFGR2_PVDL | SYSCFG_CFGR2_ECCL, Break);
  831. }
  832. /**
  833. * @brief Get connections to TIM1/16/17 Break inputs
  834. * @rmtoll SYSCFG_CFGR2 CLL LL_SYSCFG_GetTIMBreakInputs\n
  835. * SYSCFG_CFGR2 SPL LL_SYSCFG_GetTIMBreakInputs\n
  836. * SYSCFG_CFGR2 PVDL LL_SYSCFG_GetTIMBreakInputs\n
  837. * SYSCFG_CFGR2 ECCL LL_SYSCFG_GetTIMBreakInputs
  838. * @retval Returned value can be can be a combination of the following values:
  839. * @arg @ref LL_SYSCFG_TIMBREAK_ECC
  840. * @arg @ref LL_SYSCFG_TIMBREAK_PVD
  841. * @arg @ref LL_SYSCFG_TIMBREAK_SRAM2_PARITY
  842. * @arg @ref LL_SYSCFG_TIMBREAK_LOCKUP
  843. */
  844. __STATIC_INLINE uint32_t LL_SYSCFG_GetTIMBreakInputs(void)
  845. {
  846. return (uint32_t)(READ_BIT(SYSCFG->CFGR2, SYSCFG_CFGR2_CLL | SYSCFG_CFGR2_SPL | SYSCFG_CFGR2_PVDL | SYSCFG_CFGR2_ECCL));
  847. }
  848. /**
  849. * @brief Check if SRAM2 parity error detected
  850. * @rmtoll SYSCFG_CFGR2 SPF LL_SYSCFG_IsActiveFlag_SP
  851. * @retval State of bit (1 or 0).
  852. */
  853. __STATIC_INLINE uint32_t LL_SYSCFG_IsActiveFlag_SP(void)
  854. {
  855. return ((READ_BIT(SYSCFG->CFGR2, SYSCFG_CFGR2_SPF) == (SYSCFG_CFGR2_SPF)) ? 1UL : 0UL);
  856. }
  857. /**
  858. * @brief Clear SRAM2 parity error flag
  859. * @rmtoll SYSCFG_CFGR2 SPF LL_SYSCFG_ClearFlag_SP
  860. * @retval None
  861. */
  862. __STATIC_INLINE void LL_SYSCFG_ClearFlag_SP(void)
  863. {
  864. SET_BIT(SYSCFG->CFGR2, SYSCFG_CFGR2_SPF);
  865. }
  866. /**
  867. * @brief Enable SRAM2 page write protection for Pages in range 0 to 31
  868. * @note Write protection is cleared only by a system reset
  869. * @rmtoll SYSCFG_SWPR1 PxWP LL_SYSCFG_EnableSRAM2PageWRP_0_31
  870. * @param SRAM2WRP This parameter can be a combination of the following values:
  871. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE0
  872. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE1
  873. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE2
  874. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE3
  875. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE4
  876. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE5
  877. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE6
  878. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE7
  879. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE8
  880. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE9
  881. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE10
  882. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE11
  883. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE12
  884. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE13
  885. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE14
  886. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE15
  887. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE16
  888. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE17
  889. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE18
  890. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE19
  891. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE20
  892. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE21
  893. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE22
  894. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE23
  895. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE24
  896. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE25
  897. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE26
  898. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE27
  899. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE28
  900. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE29
  901. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE30
  902. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE31
  903. * @retval None
  904. */
  905. /* Legacy define */
  906. #define LL_SYSCFG_EnableSRAM2PageWRP LL_SYSCFG_EnableSRAM2PageWRP_0_31
  907. __STATIC_INLINE void LL_SYSCFG_EnableSRAM2PageWRP_0_31(uint32_t SRAM2WRP)
  908. {
  909. SET_BIT(SYSCFG->SWPR1, SRAM2WRP);
  910. }
  911. /**
  912. * @brief Enable SRAM2 page write protection for Pages in range 32 to 63
  913. * @note Write protection is cleared only by a system reset
  914. * @rmtoll SYSCFG_SWPR2 PxWP LL_SYSCFG_EnableSRAM2PageWRP_32_63
  915. * @param SRAM2WRP This parameter can be a combination of the following values:
  916. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE32
  917. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE33
  918. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE34
  919. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE35
  920. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE36
  921. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE37
  922. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE38
  923. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE39
  924. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE40
  925. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE41
  926. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE42
  927. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE43
  928. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE44
  929. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE45
  930. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE46
  931. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE47
  932. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE48
  933. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE49
  934. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE50
  935. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE51
  936. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE52
  937. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE53
  938. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE54
  939. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE55
  940. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE56
  941. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE57
  942. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE58
  943. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE59
  944. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE60
  945. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE61
  946. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE62
  947. * @arg @ref LL_SYSCFG_SRAM2WRP_PAGE63
  948. * @retval None
  949. */
  950. __STATIC_INLINE void LL_SYSCFG_EnableSRAM2PageWRP_32_63(uint32_t SRAM2WRP)
  951. {
  952. SET_BIT(SYSCFG->SWPR2, SRAM2WRP);
  953. }
  954. /**
  955. * @brief SRAM2 page write protection lock prior to erase
  956. * @rmtoll SYSCFG_SKR KEY LL_SYSCFG_LockSRAM2WRP
  957. * @retval None
  958. */
  959. __STATIC_INLINE void LL_SYSCFG_LockSRAM2WRP(void)
  960. {
  961. /* Writing a wrong key reactivates the write protection */
  962. WRITE_REG(SYSCFG->SKR, 0x00U);
  963. }
  964. /**
  965. * @brief SRAM2 page write protection unlock prior to erase
  966. * @rmtoll SYSCFG_SKR KEY LL_SYSCFG_UnlockSRAM2WRP
  967. * @retval None
  968. */
  969. __STATIC_INLINE void LL_SYSCFG_UnlockSRAM2WRP(void)
  970. {
  971. /* unlock the write protection of the SRAM2ER bit */
  972. WRITE_REG(SYSCFG->SKR, 0xCAU);
  973. WRITE_REG(SYSCFG->SKR, 0x53U);
  974. }
  975. /**
  976. * @brief Enable CPU1 Interrupt Mask
  977. * @rmtoll SYSCFG_IMR1 TIM1IM LL_SYSCFG_GRP1_EnableIT\n
  978. * SYSCFG_IMR1 TIM16IM LL_SYSCFG_GRP1_EnableIT\n
  979. * SYSCFG_IMR1 TIM17IM LL_SYSCFG_GRP1_EnableIT\n
  980. * SYSCFG_IMR1 EXTIxIM LL_SYSCFG_GRP1_EnableIT
  981. * @param Interrupt This parameter can be a combination of the following values:
  982. * @arg @ref LL_SYSCFG_GRP1_TIM1
  983. * @arg @ref LL_SYSCFG_GRP1_TIM16
  984. * @arg @ref LL_SYSCFG_GRP1_TIM17
  985. * @arg @ref LL_SYSCFG_GRP1_EXTI5
  986. * @arg @ref LL_SYSCFG_GRP1_EXTI6
  987. * @arg @ref LL_SYSCFG_GRP1_EXTI7
  988. * @arg @ref LL_SYSCFG_GRP1_EXTI8
  989. * @arg @ref LL_SYSCFG_GRP1_EXTI9
  990. * @arg @ref LL_SYSCFG_GRP1_EXTI10
  991. * @arg @ref LL_SYSCFG_GRP1_EXTI11
  992. * @arg @ref LL_SYSCFG_GRP1_EXTI12
  993. * @arg @ref LL_SYSCFG_GRP1_EXTI13
  994. * @arg @ref LL_SYSCFG_GRP1_EXTI14
  995. * @arg @ref LL_SYSCFG_GRP1_EXTI15
  996. * @retval None
  997. */
  998. __STATIC_INLINE void LL_SYSCFG_GRP1_EnableIT(uint32_t Interrupt)
  999. {
  1000. CLEAR_BIT(SYSCFG->IMR1, Interrupt);
  1001. }
  1002. /**
  1003. * @brief Enable CPU1 Interrupt Mask
  1004. * @rmtoll SYSCFG_IMR1 PVM1IM LL_SYSCFG_GRP2_EnableIT\n
  1005. * SYSCFG_IMR1 PVM3IM LL_SYSCFG_GRP2_EnableIT\n
  1006. * SYSCFG_IMR1 PVDIM LL_SYSCFG_GRP2_EnableIT
  1007. * @param Interrupt This parameter can be a combination of the following values:
  1008. * @arg @ref LL_SYSCFG_GRP2_PVM1
  1009. * @arg @ref LL_SYSCFG_GRP2_PVM3
  1010. * @arg @ref LL_SYSCFG_GRP2_PVD
  1011. * @retval None
  1012. */
  1013. __STATIC_INLINE void LL_SYSCFG_GRP2_EnableIT(uint32_t Interrupt)
  1014. {
  1015. CLEAR_BIT(SYSCFG->IMR2, Interrupt);
  1016. }
  1017. /**
  1018. * @brief Disable CPU1 Interrupt Mask
  1019. * @rmtoll SYSCFG_IMR1 TIM1IM LL_SYSCFG_GRP1_DisableIT\n
  1020. * SYSCFG_IMR1 TIM16IM LL_SYSCFG_GRP1_DisableIT\n
  1021. * SYSCFG_IMR1 TIM17IM LL_SYSCFG_GRP1_DisableIT\n
  1022. * SYSCFG_IMR1 EXTIxIM LL_SYSCFG_GRP1_DisableIT
  1023. * @param Interrupt This parameter can be a combination of the following values:
  1024. * @arg @ref LL_SYSCFG_GRP1_TIM1
  1025. * @arg @ref LL_SYSCFG_GRP1_TIM16
  1026. * @arg @ref LL_SYSCFG_GRP1_TIM17
  1027. * @arg @ref LL_SYSCFG_GRP1_EXTI5
  1028. * @arg @ref LL_SYSCFG_GRP1_EXTI6
  1029. * @arg @ref LL_SYSCFG_GRP1_EXTI7
  1030. * @arg @ref LL_SYSCFG_GRP1_EXTI8
  1031. * @arg @ref LL_SYSCFG_GRP1_EXTI9
  1032. * @arg @ref LL_SYSCFG_GRP1_EXTI10
  1033. * @arg @ref LL_SYSCFG_GRP1_EXTI11
  1034. * @arg @ref LL_SYSCFG_GRP1_EXTI12
  1035. * @arg @ref LL_SYSCFG_GRP1_EXTI13
  1036. * @arg @ref LL_SYSCFG_GRP1_EXTI14
  1037. * @arg @ref LL_SYSCFG_GRP1_EXTI15
  1038. * @retval None
  1039. */
  1040. __STATIC_INLINE void LL_SYSCFG_GRP1_DisableIT(uint32_t Interrupt)
  1041. {
  1042. SET_BIT(SYSCFG->IMR1, Interrupt);
  1043. }
  1044. /**
  1045. * @brief Disable CPU1 Interrupt Mask
  1046. * @rmtoll SYSCFG_IMR2 PVM1IM LL_SYSCFG_GRP2_DisableIT\n
  1047. * SYSCFG_IMR2 PVM3IM LL_SYSCFG_GRP2_DisableIT\n
  1048. * SYSCFG_IMR2 PVDIM LL_SYSCFG_GRP2_DisableIT
  1049. * @param Interrupt This parameter can be a combination of the following values:
  1050. * @arg @ref LL_SYSCFG_GRP2_PVM1
  1051. * @arg @ref LL_SYSCFG_GRP2_PVM3
  1052. * @arg @ref LL_SYSCFG_GRP2_PVD
  1053. * @retval None
  1054. */
  1055. __STATIC_INLINE void LL_SYSCFG_GRP2_DisableIT(uint32_t Interrupt)
  1056. {
  1057. SET_BIT(SYSCFG->IMR2, Interrupt);
  1058. }
  1059. /**
  1060. * @brief Indicate if CPU1 Interrupt Mask is enabled
  1061. * @rmtoll SYSCFG_IMR1 TIM1IM LL_SYSCFG_GRP1_IsEnabledIT\n
  1062. * SYSCFG_IMR1 TIM16IM LL_SYSCFG_GRP1_IsEnabledIT\n
  1063. * SYSCFG_IMR1 TIM17IM LL_SYSCFG_GRP1_IsEnabledIT\n
  1064. * SYSCFG_IMR1 EXTIxIM LL_SYSCFG_GRP1_IsEnabledIT
  1065. * @param Interrupt This parameter can be one of the following values:
  1066. * @arg @ref LL_SYSCFG_GRP1_TIM1
  1067. * @arg @ref LL_SYSCFG_GRP1_TIM16
  1068. * @arg @ref LL_SYSCFG_GRP1_TIM17
  1069. * @arg @ref LL_SYSCFG_GRP1_EXTI5
  1070. * @arg @ref LL_SYSCFG_GRP1_EXTI6
  1071. * @arg @ref LL_SYSCFG_GRP1_EXTI7
  1072. * @arg @ref LL_SYSCFG_GRP1_EXTI8
  1073. * @arg @ref LL_SYSCFG_GRP1_EXTI9
  1074. * @arg @ref LL_SYSCFG_GRP1_EXTI10
  1075. * @arg @ref LL_SYSCFG_GRP1_EXTI11
  1076. * @arg @ref LL_SYSCFG_GRP1_EXTI12
  1077. * @arg @ref LL_SYSCFG_GRP1_EXTI13
  1078. * @arg @ref LL_SYSCFG_GRP1_EXTI14
  1079. * @arg @ref LL_SYSCFG_GRP1_EXTI15
  1080. * @retval State of bit (1 or 0).
  1081. */
  1082. __STATIC_INLINE uint32_t LL_SYSCFG_GRP1_IsEnabledIT(uint32_t Interrupt)
  1083. {
  1084. return ((READ_BIT(SYSCFG->IMR1, Interrupt) != (Interrupt)) ? 1UL : 0UL);
  1085. }
  1086. /**
  1087. * @brief Indicate if CPU1 Interrupt Mask is enabled
  1088. * @rmtoll SYSCFG_IMR2 PVM1IM LL_SYSCFG_GRP2_IsEnabledIT\n
  1089. * SYSCFG_IMR2 PVM3IM LL_SYSCFG_GRP2_IsEnabledIT\n
  1090. * SYSCFG_IMR2 PVDIM LL_SYSCFG_GRP2_IsEnabledIT
  1091. * @param Interrupt This parameter can be one of the following values:
  1092. * @arg @ref LL_SYSCFG_GRP2_PVM1
  1093. * @arg @ref LL_SYSCFG_GRP2_PVM3
  1094. * @arg @ref LL_SYSCFG_GRP2_PVD
  1095. * @retval State of bit (1 or 0).
  1096. */
  1097. __STATIC_INLINE uint32_t LL_SYSCFG_GRP2_IsEnabledIT(uint32_t Interrupt)
  1098. {
  1099. return ((READ_BIT(SYSCFG->IMR2, Interrupt) != (Interrupt)) ? 1UL : 0UL);
  1100. }
  1101. /**
  1102. * @brief Enable CPU2 Interrupt Mask
  1103. * @rmtoll SYSCFG_C2IMR1 RTCSTAMPTAMPLSECSSIM LL_C2_SYSCFG_GRP1_EnableIT\n
  1104. * SYSCFG_C2IMR1 RTCWKUPIM LL_C2_SYSCFG_GRP1_EnableIT\n
  1105. * SYSCFG_C2IMR1 RTCALARMIM LL_C2_SYSCFG_GRP1_EnableIT\n
  1106. * SYSCFG_C2IMR1 RCCIM LL_C2_SYSCFG_GRP1_EnableIT\n
  1107. * SYSCFG_C2IMR1 FLASHIM LL_C2_SYSCFG_GRP1_EnableIT\n
  1108. * SYSCFG_C2IMR1 PKAIM LL_C2_SYSCFG_GRP1_EnableIT\n
  1109. * SYSCFG_C2IMR1 RNGIM LL_C2_SYSCFG_GRP1_EnableIT\n
  1110. * SYSCFG_C2IMR1 AES1IM LL_C2_SYSCFG_GRP1_EnableIT\n
  1111. * SYSCFG_C2IMR1 COMPIM LL_C2_SYSCFG_GRP1_EnableIT\n
  1112. * SYSCFG_C2IMR1 ADCIM LL_C2_SYSCFG_GRP1_EnableIT\n
  1113. * SYSCFG_C2IMR1 EXTIxIM LL_C2_SYSCFG_GRP1_EnableIT
  1114. * @param Interrupt This parameter can be a combination of the following values:
  1115. * @arg @ref LL_C2_SYSCFG_GRP1_RTCSTAMP_RTCTAMP_LSECSS
  1116. * @arg @ref LL_C2_SYSCFG_GRP1_RTCWKUP
  1117. * @arg @ref LL_C2_SYSCFG_GRP1_RTCALARM
  1118. * @arg @ref LL_C2_SYSCFG_GRP1_RCC
  1119. * @arg @ref LL_C2_SYSCFG_GRP1_FLASH
  1120. * @arg @ref LL_C2_SYSCFG_GRP1_PKA
  1121. * @arg @ref LL_C2_SYSCFG_GRP1_RNG
  1122. * @arg @ref LL_C2_SYSCFG_GRP1_AES1
  1123. * @arg @ref LL_C2_SYSCFG_GRP1_COMP
  1124. * @arg @ref LL_C2_SYSCFG_GRP1_ADC
  1125. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI0
  1126. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI1
  1127. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI2
  1128. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI3
  1129. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI4
  1130. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI5
  1131. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI6
  1132. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI7
  1133. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI8
  1134. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI9
  1135. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI10
  1136. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI11
  1137. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI12
  1138. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI13
  1139. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI14
  1140. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI15
  1141. * @retval None
  1142. */
  1143. __STATIC_INLINE void LL_C2_SYSCFG_GRP1_EnableIT(uint32_t Interrupt)
  1144. {
  1145. CLEAR_BIT(SYSCFG->C2IMR1, Interrupt);
  1146. }
  1147. /**
  1148. * @brief Enable CPU2 Interrupt Mask
  1149. * @rmtoll SYSCFG_C2IMR2 DMA1CHxIM LL_C2_SYSCFG_GRP2_EnableIT\n
  1150. * SYSCFG_C2IMR2 DMA2CHxIM LL_C2_SYSCFG_GRP2_EnableIT\n
  1151. * SYSCFG_C2IMR2 PVM1IM LL_C2_SYSCFG_GRP2_EnableIT\n
  1152. * SYSCFG_C2IMR2 PVM3IM LL_C2_SYSCFG_GRP2_EnableIT\n
  1153. * SYSCFG_C2IMR2 PVDIM LL_C2_SYSCFG_GRP2_EnableIT\n
  1154. * SYSCFG_C2IMR2 TSCIM LL_C2_SYSCFG_GRP2_EnableIT\n
  1155. * SYSCFG_C2IMR2 LCDIM LL_C2_SYSCFG_GRP2_EnableIT
  1156. * @param Interrupt This parameter can be a combination of the following values:
  1157. * @arg @ref LL_C2_SYSCFG_GRP2_DMA1CH1
  1158. * @arg @ref LL_C2_SYSCFG_GRP2_DMA1CH2
  1159. * @arg @ref LL_C2_SYSCFG_GRP2_DMA1CH3
  1160. * @arg @ref LL_C2_SYSCFG_GRP2_DMA1CH4
  1161. * @arg @ref LL_C2_SYSCFG_GRP2_DMA1CH5
  1162. * @arg @ref LL_C2_SYSCFG_GRP2_DMA1CH6
  1163. * @arg @ref LL_C2_SYSCFG_GRP2_DMA1CH7
  1164. * @arg @ref LL_C2_SYSCFG_GRP2_DMA2CH1
  1165. * @arg @ref LL_C2_SYSCFG_GRP2_DMA2CH2
  1166. * @arg @ref LL_C2_SYSCFG_GRP2_DMA2CH3
  1167. * @arg @ref LL_C2_SYSCFG_GRP2_DMA2CH4
  1168. * @arg @ref LL_C2_SYSCFG_GRP2_DMA2CH5
  1169. * @arg @ref LL_C2_SYSCFG_GRP2_DMA2CH6
  1170. * @arg @ref LL_C2_SYSCFG_GRP2_DMA2CH7
  1171. * @arg @ref LL_C2_SYSCFG_GRP2_DMAMUX1
  1172. * @arg @ref LL_C2_SYSCFG_GRP2_PVM1
  1173. * @arg @ref LL_C2_SYSCFG_GRP2_PVM3
  1174. * @arg @ref LL_C2_SYSCFG_GRP2_PVD
  1175. * @arg @ref LL_C2_SYSCFG_GRP2_TSC
  1176. * @arg @ref LL_C2_SYSCFG_GRP2_LCD
  1177. * @retval None
  1178. */
  1179. __STATIC_INLINE void LL_C2_SYSCFG_GRP2_EnableIT(uint32_t Interrupt)
  1180. {
  1181. CLEAR_BIT(SYSCFG->C2IMR2, Interrupt);
  1182. }
  1183. /**
  1184. * @brief Disable CPU2 Interrupt Mask
  1185. * @rmtoll SYSCFG_C2IMR1 RTCSTAMPTAMPLSECSSIM LL_C2_SYSCFG_GRP1_DisableIT\n
  1186. * SYSCFG_C2IMR1 RTCWKUPIM LL_C2_SYSCFG_GRP1_DisableIT\n
  1187. * SYSCFG_C2IMR1 RTCALARMIM LL_C2_SYSCFG_GRP1_DisableIT\n
  1188. * SYSCFG_C2IMR1 RCCIM LL_C2_SYSCFG_GRP1_DisableIT\n
  1189. * SYSCFG_C2IMR1 FLASHIM LL_C2_SYSCFG_GRP1_DisableIT\n
  1190. * SYSCFG_C2IMR1 PKAIM LL_C2_SYSCFG_GRP1_DisableIT\n
  1191. * SYSCFG_C2IMR1 RNGIM LL_C2_SYSCFG_GRP1_DisableIT\n
  1192. * SYSCFG_C2IMR1 AES1IM LL_C2_SYSCFG_GRP1_DisableIT\n
  1193. * SYSCFG_C2IMR1 COMPIM LL_C2_SYSCFG_GRP1_DisableIT\n
  1194. * SYSCFG_C2IMR1 ADCIM LL_C2_SYSCFG_GRP1_DisableIT\n
  1195. * SYSCFG_C2IMR1 EXTIxIM LL_C2_SYSCFG_GRP1_DisableIT
  1196. * @param Interrupt This parameter can be a combination of the following values:
  1197. * @arg @ref LL_C2_SYSCFG_GRP1_RTCSTAMP_RTCTAMP_LSECSS
  1198. * @arg @ref LL_C2_SYSCFG_GRP1_RTCWKUP
  1199. * @arg @ref LL_C2_SYSCFG_GRP1_RTCALARM
  1200. * @arg @ref LL_C2_SYSCFG_GRP1_RCC
  1201. * @arg @ref LL_C2_SYSCFG_GRP1_FLASH
  1202. * @arg @ref LL_C2_SYSCFG_GRP1_PKA
  1203. * @arg @ref LL_C2_SYSCFG_GRP1_RNG
  1204. * @arg @ref LL_C2_SYSCFG_GRP1_AES1
  1205. * @arg @ref LL_C2_SYSCFG_GRP1_COMP
  1206. * @arg @ref LL_C2_SYSCFG_GRP1_ADC
  1207. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI0
  1208. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI1
  1209. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI2
  1210. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI3
  1211. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI4
  1212. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI5
  1213. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI6
  1214. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI7
  1215. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI8
  1216. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI9
  1217. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI10
  1218. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI11
  1219. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI12
  1220. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI13
  1221. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI14
  1222. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI15
  1223. * @retval None
  1224. */
  1225. __STATIC_INLINE void LL_C2_SYSCFG_GRP1_DisableIT(uint32_t Interrupt)
  1226. {
  1227. SET_BIT(SYSCFG->C2IMR1, Interrupt);
  1228. }
  1229. /**
  1230. * @brief Disable CPU2 Interrupt Mask
  1231. * @rmtoll SYSCFG_C2IMR2 DMA1CHxIM LL_C2_SYSCFG_GRP2_DisableIT\n
  1232. * SYSCFG_C2IMR2 DMA2CHxIM LL_C2_SYSCFG_GRP2_DisableIT\n
  1233. * SYSCFG_C2IMR2 PVM1IM LL_C2_SYSCFG_GRP2_DisableIT\n
  1234. * SYSCFG_C2IMR2 PVM3IM LL_C2_SYSCFG_GRP2_DisableIT\n
  1235. * SYSCFG_C2IMR2 PVDIM LL_C2_SYSCFG_GRP2_DisableIT\n
  1236. * SYSCFG_C2IMR2 TSCIM LL_C2_SYSCFG_GRP2_DisableIT\n
  1237. * SYSCFG_C2IMR2 LCDIM LL_C2_SYSCFG_GRP2_DisableIT
  1238. * @param Interrupt This parameter can be a combination of the following values:
  1239. * @arg @ref LL_C2_SYSCFG_GRP2_DMA1CH1
  1240. * @arg @ref LL_C2_SYSCFG_GRP2_DMA1CH2
  1241. * @arg @ref LL_C2_SYSCFG_GRP2_DMA1CH3
  1242. * @arg @ref LL_C2_SYSCFG_GRP2_DMA1CH4
  1243. * @arg @ref LL_C2_SYSCFG_GRP2_DMA1CH5
  1244. * @arg @ref LL_C2_SYSCFG_GRP2_DMA1CH6
  1245. * @arg @ref LL_C2_SYSCFG_GRP2_DMA1CH7
  1246. * @arg @ref LL_C2_SYSCFG_GRP2_DMA2CH1
  1247. * @arg @ref LL_C2_SYSCFG_GRP2_DMA2CH2
  1248. * @arg @ref LL_C2_SYSCFG_GRP2_DMA2CH3
  1249. * @arg @ref LL_C2_SYSCFG_GRP2_DMA2CH4
  1250. * @arg @ref LL_C2_SYSCFG_GRP2_DMA2CH5
  1251. * @arg @ref LL_C2_SYSCFG_GRP2_DMA2CH6
  1252. * @arg @ref LL_C2_SYSCFG_GRP2_DMA2CH7
  1253. * @arg @ref LL_C2_SYSCFG_GRP2_DMAMUX1
  1254. * @arg @ref LL_C2_SYSCFG_GRP2_PVM1
  1255. * @arg @ref LL_C2_SYSCFG_GRP2_PVM3
  1256. * @arg @ref LL_C2_SYSCFG_GRP2_PVD
  1257. * @arg @ref LL_C2_SYSCFG_GRP2_TSC
  1258. * @arg @ref LL_C2_SYSCFG_GRP2_LCD
  1259. * @retval None
  1260. */
  1261. __STATIC_INLINE void LL_C2_SYSCFG_GRP2_DisableIT(uint32_t Interrupt)
  1262. {
  1263. SET_BIT(SYSCFG->C2IMR2, Interrupt);
  1264. }
  1265. /**
  1266. * @brief Indicate if CPU2 Interrupt Mask is enabled
  1267. * @rmtoll SYSCFG_C2IMR1 RTCSTAMPTAMPLSECSSIM LL_C2_SYSCFG_GRP1_EnableIT\n
  1268. * SYSCFG_C2IMR1 RTCWKUPIM LL_C2_SYSCFG_GRP1_IsEnabledIT\n
  1269. * SYSCFG_C2IMR1 RTCALARMIM LL_C2_SYSCFG_GRP1_IsEnabledIT\n
  1270. * SYSCFG_C2IMR1 RCCIM LL_C2_SYSCFG_GRP1_IsEnabledIT\n
  1271. * SYSCFG_C2IMR1 FLASHIM LL_C2_SYSCFG_GRP1_IsEnabledIT\n
  1272. * SYSCFG_C2IMR1 PKAIM LL_C2_SYSCFG_GRP1_IsEnabledIT\n
  1273. * SYSCFG_C2IMR1 RNGIM LL_C2_SYSCFG_GRP1_IsEnabledIT\n
  1274. * SYSCFG_C2IMR1 AES1IM LL_C2_SYSCFG_GRP1_IsEnabledIT\n
  1275. * SYSCFG_C2IMR1 COMPIM LL_C2_SYSCFG_GRP1_IsEnabledIT\n
  1276. * SYSCFG_C2IMR1 ADCIM LL_C2_SYSCFG_GRP1_IsEnabledIT\n
  1277. * SYSCFG_C2IMR1 EXTIxIM LL_C2_SYSCFG_GRP1_IsEnabledIT
  1278. * @param Interrupt This parameter can be one of the following values:
  1279. * @arg @ref LL_C2_SYSCFG_GRP1_RTCSTAMP_RTCTAMP_LSECSS
  1280. * @arg @ref LL_C2_SYSCFG_GRP1_RTCWKUP
  1281. * @arg @ref LL_C2_SYSCFG_GRP1_RTCALARM
  1282. * @arg @ref LL_C2_SYSCFG_GRP1_RCC
  1283. * @arg @ref LL_C2_SYSCFG_GRP1_FLASH
  1284. * @arg @ref LL_C2_SYSCFG_GRP1_PKA
  1285. * @arg @ref LL_C2_SYSCFG_GRP1_RNG
  1286. * @arg @ref LL_C2_SYSCFG_GRP1_AES1
  1287. * @arg @ref LL_C2_SYSCFG_GRP1_COMP
  1288. * @arg @ref LL_C2_SYSCFG_GRP1_ADC
  1289. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI0
  1290. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI1
  1291. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI2
  1292. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI3
  1293. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI4
  1294. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI5
  1295. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI6
  1296. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI7
  1297. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI8
  1298. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI9
  1299. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI10
  1300. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI11
  1301. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI12
  1302. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI13
  1303. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI14
  1304. * @arg @ref LL_C2_SYSCFG_GRP1_EXTI15
  1305. * @retval State of bit (1 or 0).
  1306. */
  1307. __STATIC_INLINE uint32_t LL_C2_SYSCFG_GRP1_IsEnabledIT(uint32_t Interrupt)
  1308. {
  1309. return ((READ_BIT(SYSCFG->C2IMR1, Interrupt) != (Interrupt)) ? 1UL : 0UL);
  1310. }
  1311. /**
  1312. * @brief Indicate if CPU2 Interrupt Mask is enabled
  1313. * @rmtoll SYSCFG_C2IMR2 DMA1CHxIM LL_C2_SYSCFG_GRP2_IsEnabledIT\n
  1314. * SYSCFG_C2IMR2 DMA2CHxIM LL_C2_SYSCFG_GRP2_IsEnabledIT\n
  1315. * SYSCFG_C2IMR2 PVM1IM LL_C2_SYSCFG_GRP2_IsEnabledIT\n
  1316. * SYSCFG_C2IMR2 PVM3IM LL_C2_SYSCFG_GRP2_IsEnabledIT\n
  1317. * SYSCFG_C2IMR2 PVDIM LL_C2_SYSCFG_GRP2_IsEnabledIT\n
  1318. * SYSCFG_C2IMR2 TSCIM LL_C2_SYSCFG_GRP2_IsEnabledIT\n
  1319. * SYSCFG_C2IMR2 LCDIM LL_C2_SYSCFG_GRP2_IsEnabledIT
  1320. * @param Interrupt This parameter can be one of the following values:
  1321. * @arg @ref LL_C2_SYSCFG_GRP2_DMA1CH1
  1322. * @arg @ref LL_C2_SYSCFG_GRP2_DMA1CH2
  1323. * @arg @ref LL_C2_SYSCFG_GRP2_DMA1CH3
  1324. * @arg @ref LL_C2_SYSCFG_GRP2_DMA1CH4
  1325. * @arg @ref LL_C2_SYSCFG_GRP2_DMA1CH5
  1326. * @arg @ref LL_C2_SYSCFG_GRP2_DMA1CH6
  1327. * @arg @ref LL_C2_SYSCFG_GRP2_DMA1CH7
  1328. * @arg @ref LL_C2_SYSCFG_GRP2_DMA2CH1
  1329. * @arg @ref LL_C2_SYSCFG_GRP2_DMA2CH2
  1330. * @arg @ref LL_C2_SYSCFG_GRP2_DMA2CH3
  1331. * @arg @ref LL_C2_SYSCFG_GRP2_DMA2CH4
  1332. * @arg @ref LL_C2_SYSCFG_GRP2_DMA2CH5
  1333. * @arg @ref LL_C2_SYSCFG_GRP2_DMA2CH6
  1334. * @arg @ref LL_C2_SYSCFG_GRP2_DMA2CH7
  1335. * @arg @ref LL_C2_SYSCFG_GRP2_DMAMUX1
  1336. * @arg @ref LL_C2_SYSCFG_GRP2_PVM1
  1337. * @arg @ref LL_C2_SYSCFG_GRP2_PVM3
  1338. * @arg @ref LL_C2_SYSCFG_GRP2_PVD
  1339. * @arg @ref LL_C2_SYSCFG_GRP2_TSC
  1340. * @arg @ref LL_C2_SYSCFG_GRP2_LCD
  1341. * @retval State of bit (1 or 0).
  1342. */
  1343. __STATIC_INLINE uint32_t LL_C2_SYSCFG_GRP2_IsEnabledIT(uint32_t Interrupt)
  1344. {
  1345. return ((READ_BIT(SYSCFG->C2IMR2, Interrupt) != (Interrupt)) ? 1UL : 0UL);
  1346. }
  1347. /**
  1348. * @brief Enable the access for security IP
  1349. * @rmtoll SYSCFG_SIPCR SAES1 LL_SYSCFG_EnableSecurityAccess\n
  1350. * SYSCFG_CFGR1 SAES2 LL_SYSCFG_EnableSecurityAccess\n
  1351. * SYSCFG_CFGR1 SPKA LL_SYSCFG_EnableSecurityAccess\n
  1352. * SYSCFG_CFGR1 SRNG LL_SYSCFG_EnableSecurityAccess
  1353. * @param SecurityAccess This parameter can be a combination of the following values:
  1354. * @arg @ref LL_SYSCFG_SECURE_ACCESS_AES1
  1355. * @arg @ref LL_SYSCFG_SECURE_ACCESS_AES2
  1356. * @arg @ref LL_SYSCFG_SECURE_ACCESS_PKA
  1357. * @arg @ref LL_SYSCFG_SECURE_ACCESS_RNG
  1358. * @retval None
  1359. */
  1360. __STATIC_INLINE void LL_SYSCFG_EnableSecurityAccess(uint32_t SecurityAccess)
  1361. {
  1362. SET_BIT(SYSCFG->SIPCR, SecurityAccess);
  1363. }
  1364. /**
  1365. * @brief Disable the access for security IP
  1366. * @rmtoll SYSCFG_SIPCR SAES1 LL_SYSCFG_DisableSecurityAccess\n
  1367. * SYSCFG_CFGR1 SAES2 LL_SYSCFG_DisableSecurityAccess\n
  1368. * SYSCFG_CFGR1 SPKA LL_SYSCFG_DisableSecurityAccess\n
  1369. * SYSCFG_CFGR1 SRNG LL_SYSCFG_DisableSecurityAccess
  1370. * @param SecurityAccess This parameter can be a combination of the following values:
  1371. * @arg @ref LL_SYSCFG_SECURE_ACCESS_AES1
  1372. * @arg @ref LL_SYSCFG_SECURE_ACCESS_AES2
  1373. * @arg @ref LL_SYSCFG_SECURE_ACCESS_PKA
  1374. * @arg @ref LL_SYSCFG_SECURE_ACCESS_RNG
  1375. * @retval None
  1376. */
  1377. __STATIC_INLINE void LL_SYSCFG_DisableSecurityAccess(uint32_t SecurityAccess)
  1378. {
  1379. CLEAR_BIT(SYSCFG->SIPCR, SecurityAccess);
  1380. }
  1381. /**
  1382. * @brief Indicate if access for security IP is enabled
  1383. * @rmtoll SYSCFG_SIPCR SAES1 LL_SYSCFG_IsEnabledSecurityAccess\n
  1384. * SYSCFG_CFGR1 SAES2 LL_SYSCFG_IsEnabledSecurityAccess\n
  1385. * SYSCFG_CFGR1 SPKA LL_SYSCFG_IsEnabledSecurityAccess\n
  1386. * SYSCFG_CFGR1 SRNG LL_SYSCFG_IsEnabledSecurityAccess
  1387. * @param SecurityAccess This parameter can be one of the following values:
  1388. * @arg @ref LL_SYSCFG_SECURE_ACCESS_AES1
  1389. * @arg @ref LL_SYSCFG_SECURE_ACCESS_AES2
  1390. * @arg @ref LL_SYSCFG_SECURE_ACCESS_PKA
  1391. * @arg @ref LL_SYSCFG_SECURE_ACCESS_RNG
  1392. * @retval State of bit (1 or 0).
  1393. */
  1394. __STATIC_INLINE uint32_t LL_SYSCFG_IsEnabledSecurityAccess(uint32_t SecurityAccess)
  1395. {
  1396. return ((READ_BIT(SYSCFG->SIPCR, SecurityAccess) == (SecurityAccess)) ? 1UL : 0UL);
  1397. }
  1398. /**
  1399. * @}
  1400. */
  1401. /** @defgroup SYSTEM_LL_EF_DBGMCU DBGMCU
  1402. * @note DBGMCU is only accessible by Cortex M4
  1403. * To access on DBGMCU, Cortex M0+ need to request to the Cortex M4
  1404. * the action.
  1405. * @{
  1406. */
  1407. /**
  1408. * @brief Return the device identifier
  1409. * @note For STM32WBxxxx devices, the device ID is 0x495
  1410. * @rmtoll DBGMCU_IDCODE DEV_ID LL_DBGMCU_GetDeviceID
  1411. * @retval Values between Min_Data=0x00 and Max_Data=0xFFF (ex: device ID is 0x495)
  1412. */
  1413. __STATIC_INLINE uint32_t LL_DBGMCU_GetDeviceID(void)
  1414. {
  1415. return (uint32_t)(READ_BIT(DBGMCU->IDCODE, DBGMCU_IDCODE_DEV_ID));
  1416. }
  1417. /**
  1418. * @brief Return the device revision identifier
  1419. * @note This field indicates the revision of the device.
  1420. * @rmtoll DBGMCU_IDCODE REV_ID LL_DBGMCU_GetRevisionID
  1421. * @retval Values between Min_Data=0x00 and Max_Data=0xFFFF
  1422. */
  1423. __STATIC_INLINE uint32_t LL_DBGMCU_GetRevisionID(void)
  1424. {
  1425. return (uint32_t)(READ_BIT(DBGMCU->IDCODE, DBGMCU_IDCODE_REV_ID) >> DBGMCU_IDCODE_REV_ID_Pos);
  1426. }
  1427. /**
  1428. * @brief Enable the Debug Module during SLEEP mode
  1429. * @rmtoll DBGMCU_CR DBG_SLEEP LL_DBGMCU_EnableDBGSleepMode
  1430. * @retval None
  1431. */
  1432. __STATIC_INLINE void LL_DBGMCU_EnableDBGSleepMode(void)
  1433. {
  1434. SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_SLEEP);
  1435. }
  1436. /**
  1437. * @brief Disable the Debug Module during SLEEP mode
  1438. * @rmtoll DBGMCU_CR DBG_SLEEP LL_DBGMCU_DisableDBGSleepMode
  1439. * @retval None
  1440. */
  1441. __STATIC_INLINE void LL_DBGMCU_DisableDBGSleepMode(void)
  1442. {
  1443. CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_SLEEP);
  1444. }
  1445. /**
  1446. * @brief Enable the Debug Module during STOP mode
  1447. * @rmtoll DBGMCU_CR DBG_STOP LL_DBGMCU_EnableDBGStopMode
  1448. * @retval None
  1449. */
  1450. __STATIC_INLINE void LL_DBGMCU_EnableDBGStopMode(void)
  1451. {
  1452. SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOP);
  1453. }
  1454. /**
  1455. * @brief Disable the Debug Module during STOP mode
  1456. * @rmtoll DBGMCU_CR DBG_STOP LL_DBGMCU_DisableDBGStopMode
  1457. * @retval None
  1458. */
  1459. __STATIC_INLINE void LL_DBGMCU_DisableDBGStopMode(void)
  1460. {
  1461. CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOP);
  1462. }
  1463. /**
  1464. * @brief Enable the Debug Module during STANDBY mode
  1465. * @rmtoll DBGMCU_CR DBG_STANDBY LL_DBGMCU_EnableDBGStandbyMode
  1466. * @retval None
  1467. */
  1468. __STATIC_INLINE void LL_DBGMCU_EnableDBGStandbyMode(void)
  1469. {
  1470. SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBY);
  1471. }
  1472. /**
  1473. * @brief Disable the Debug Module during STANDBY mode
  1474. * @rmtoll DBGMCU_CR DBG_STANDBY LL_DBGMCU_DisableDBGStandbyMode
  1475. * @retval None
  1476. */
  1477. __STATIC_INLINE void LL_DBGMCU_DisableDBGStandbyMode(void)
  1478. {
  1479. CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBY);
  1480. }
  1481. /**
  1482. * @brief Enable the clock for Trace port
  1483. * @rmtoll DBGMCU_CR TRACE_CLKEN LL_DBGMCU_EnableTraceClock\n
  1484. */
  1485. __STATIC_INLINE void LL_DBGMCU_EnableTraceClock(void)
  1486. {
  1487. SET_BIT(DBGMCU->CR, DBGMCU_CR_TRACE_IOEN);
  1488. }
  1489. /**
  1490. * @brief Disable the clock for Trace port
  1491. * @rmtoll DBGMCU_CR TRACE_CLKEN LL_DBGMCU_DisableTraceClock\n
  1492. * @retval None
  1493. */
  1494. __STATIC_INLINE void LL_DBGMCU_DisableTraceClock(void)
  1495. {
  1496. CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_TRACE_IOEN);
  1497. }
  1498. /**
  1499. * @brief Indicate if the clock for Trace port is enabled
  1500. * @rmtoll DBGMCU_CR TRACE_CLKEN LL_DBGMCU_IsEnabledTraceClock\n
  1501. * @retval State of bit (1 or 0).
  1502. */
  1503. __STATIC_INLINE uint32_t LL_DBGMCU_IsEnabledTraceClock(void)
  1504. {
  1505. return ((READ_BIT(DBGMCU->CR, DBGMCU_CR_TRACE_IOEN) == (DBGMCU_CR_TRACE_IOEN)) ? 1UL : 0UL);
  1506. }
  1507. /**
  1508. * @brief Enable the external trigger ouput
  1509. * @note When enable the external trigger is output (state of bit 1),
  1510. * TRGIO pin is connected to TRGOUT.
  1511. * @rmtoll DBGMCU_CR TRGOEN LL_DBGMCU_EnableTriggerOutput\n
  1512. */
  1513. __STATIC_INLINE void LL_DBGMCU_EnableTriggerOutput(void)
  1514. {
  1515. SET_BIT(DBGMCU->CR, DBGMCU_CR_TRGOEN);
  1516. }
  1517. /**
  1518. * @brief Disable the external trigger ouput
  1519. * @note When disable external trigger is input (state of bit 0),
  1520. * TRGIO pin is connected to TRGIN.
  1521. * @rmtoll DBGMCU_CR TRGOEN LL_DBGMCU_DisableTriggerOutput\n
  1522. * @retval None
  1523. */
  1524. __STATIC_INLINE void LL_DBGMCU_DisableTriggerOutput(void)
  1525. {
  1526. CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_TRGOEN);
  1527. }
  1528. /**
  1529. * @brief Indicate if the external trigger is output or input direction
  1530. * @note When the external trigger is output (state of bit 1),
  1531. * TRGIO pin is connected to TRGOUT.
  1532. * When the external trigger is input (state of bit 0),
  1533. * TRGIO pin is connected to TRGIN.
  1534. * @rmtoll DBGMCU_CR TRGOEN LL_DBGMCU_EnableTriggerOutput\n
  1535. * @retval State of bit (1 or 0).
  1536. */
  1537. __STATIC_INLINE uint32_t LL_DBGMCU_IsEnabledTriggerOutput(void)
  1538. {
  1539. return ((READ_BIT(DBGMCU->CR, DBGMCU_CR_TRGOEN) == (DBGMCU_CR_TRGOEN)) ? 1UL : 0UL);
  1540. }
  1541. /**
  1542. * @brief Freeze CPU1 APB1 peripherals (group1 peripherals)
  1543. * @rmtoll DBGMCU_APB1FZR1 DBG_xxxx_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph
  1544. * @param Periphs This parameter can be a combination of the following values:
  1545. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM2_STOP
  1546. * @arg @ref LL_DBGMCU_APB1_GRP1_RTC_STOP
  1547. * @arg @ref LL_DBGMCU_APB1_GRP1_WWDG_STOP
  1548. * @arg @ref LL_DBGMCU_APB1_GRP1_IWDG_STOP
  1549. * @arg @ref LL_DBGMCU_APB1_GRP1_I2C1_STOP
  1550. * @arg @ref LL_DBGMCU_APB1_GRP1_I2C3_STOP
  1551. * @arg @ref LL_DBGMCU_APB1_GRP1_LPTIM1_STOP
  1552. * @retval None
  1553. */
  1554. __STATIC_INLINE void LL_DBGMCU_APB1_GRP1_FreezePeriph(uint32_t Periphs)
  1555. {
  1556. SET_BIT(DBGMCU->APB1FZR1, Periphs);
  1557. }
  1558. /**
  1559. * @brief Freeze CPU2 APB1 peripherals (group1 peripherals)
  1560. * @rmtoll DBGMCU_C2APB1FZR1 DBG_xxxx_STOP LL_C2_DBGMCU_APB1_GRP1_FreezePeriph
  1561. * @param Periphs This parameter can be a combination of the following values:
  1562. * @arg @ref LL_C2_DBGMCU_APB1_GRP1_TIM2_STOP
  1563. * @arg @ref LL_C2_DBGMCU_APB1_GRP1_RTC_STOP
  1564. * @arg @ref LL_C2_DBGMCU_APB1_GRP1_IWDG_STOP
  1565. * @arg @ref LL_C2_DBGMCU_APB1_GRP1_I2C1_STOP
  1566. * @arg @ref LL_C2_DBGMCU_APB1_GRP1_I2C3_STOP
  1567. * @arg @ref LL_C2_DBGMCU_APB1_GRP1_LPTIM1_STOP
  1568. * @retval None
  1569. */
  1570. __STATIC_INLINE void LL_C2_DBGMCU_APB1_GRP1_FreezePeriph(uint32_t Periphs)
  1571. {
  1572. SET_BIT(DBGMCU->C2APB1FZR1, Periphs);
  1573. }
  1574. /**
  1575. * @brief Freeze CPU1 APB1 peripherals (group2 peripherals)
  1576. * @rmtoll DBGMCU_APB1FZR2 DBG_xxxx_STOP LL_DBGMCU_APB1_GRP2_FreezePeriph
  1577. * @param Periphs This parameter can be a combination of the following values:
  1578. * @arg @ref LL_DBGMCU_APB1_GRP2_LPTIM2_STOP
  1579. * @retval None
  1580. */
  1581. __STATIC_INLINE void LL_DBGMCU_APB1_GRP2_FreezePeriph(uint32_t Periphs)
  1582. {
  1583. SET_BIT(DBGMCU->APB1FZR2, Periphs);
  1584. }
  1585. /**
  1586. * @brief Freeze CPU2 APB1 peripherals (group2 peripherals)
  1587. * @rmtoll DBGMCU_C2APB1FZR2 DBG_xxxx_STOP LL_C2_DBGMCU_APB1_GRP2_FreezePeriph
  1588. * @param Periphs This parameter can be a combination of the following values:
  1589. * @arg @ref LL_C2_DBGMCU_APB1_GRP2_LPTIM2_STOP
  1590. * @retval None
  1591. */
  1592. __STATIC_INLINE void LL_C2_DBGMCU_APB1_GRP2_FreezePeriph(uint32_t Periphs)
  1593. {
  1594. SET_BIT(DBGMCU->C2APB1FZR2, Periphs);
  1595. }
  1596. /**
  1597. * @brief Unfreeze CPU1 APB1 peripherals (group1 peripherals)
  1598. * @rmtoll DBGMCU_APB1FZR1 DBG_xxxx_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph
  1599. * @param Periphs This parameter can be a combination of the following values:
  1600. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM2_STOP
  1601. * @arg @ref LL_DBGMCU_APB1_GRP1_RTC_STOP
  1602. * @arg @ref LL_DBGMCU_APB1_GRP1_WWDG_STOP
  1603. * @arg @ref LL_DBGMCU_APB1_GRP1_IWDG_STOP
  1604. * @arg @ref LL_DBGMCU_APB1_GRP1_I2C1_STOP
  1605. * @arg @ref LL_DBGMCU_APB1_GRP1_I2C3_STOP
  1606. * @arg @ref LL_DBGMCU_APB1_GRP1_LPTIM1_STOP
  1607. * @retval None
  1608. */
  1609. __STATIC_INLINE void LL_DBGMCU_APB1_GRP1_UnFreezePeriph(uint32_t Periphs)
  1610. {
  1611. CLEAR_BIT(DBGMCU->APB1FZR1, Periphs);
  1612. }
  1613. /**
  1614. * @brief Unfreeze CPU2 APB1 peripherals (group1 peripherals)
  1615. * @rmtoll DBGMCU_C2APB1FZR1 DBG_xxxx_STOP LL_C2_DBGMCU_APB1_GRP1_UnFreezePeriph
  1616. * @param Periphs This parameter can be a combination of the following values:
  1617. * @arg @ref LL_C2_DBGMCU_APB1_GRP1_TIM2_STOP
  1618. * @arg @ref LL_C2_DBGMCU_APB1_GRP1_RTC_STOP
  1619. * @arg @ref LL_C2_DBGMCU_APB1_GRP1_IWDG_STOP
  1620. * @arg @ref LL_C2_DBGMCU_APB1_GRP1_I2C1_STOP
  1621. * @arg @ref LL_C2_DBGMCU_APB1_GRP1_I2C3_STOP
  1622. * @arg @ref LL_C2_DBGMCU_APB1_GRP1_LPTIM1_STOP
  1623. * @retval None
  1624. */
  1625. __STATIC_INLINE void LL_C2_DBGMCU_APB1_GRP1_UnFreezePeriph(uint32_t Periphs)
  1626. {
  1627. CLEAR_BIT(DBGMCU->C2APB1FZR1, Periphs);
  1628. }
  1629. /**
  1630. * @brief Unfreeze CPU1 APB1 peripherals (group2 peripherals)
  1631. * @rmtoll DBGMCU_APB1FZR2 DBG_xxxx_STOP LL_DBGMCU_APB1_GRP2_UnFreezePeriph
  1632. * @param Periphs This parameter can be a combination of the following values:
  1633. * @arg @ref LL_DBGMCU_APB1_GRP2_LPTIM2_STOP
  1634. * @retval None
  1635. */
  1636. __STATIC_INLINE void LL_DBGMCU_APB1_GRP2_UnFreezePeriph(uint32_t Periphs)
  1637. {
  1638. CLEAR_BIT(DBGMCU->APB1FZR2, Periphs);
  1639. }
  1640. /**
  1641. * @brief Unfreeze CPU2 APB1 peripherals (group2 peripherals)
  1642. * @rmtoll DBGMCU_C2APB1FZR2 DBG_xxxx_STOP LL_C2_DBGMCU_APB1_GRP2_UnFreezePeriph
  1643. * @param Periphs This parameter can be a combination of the following values:
  1644. * @arg @ref LL_C2_DBGMCU_APB1_GRP2_LPTIM2_STOP
  1645. * @retval None
  1646. */
  1647. __STATIC_INLINE void LL_C2_DBGMCU_APB1_GRP2_UnFreezePeriph(uint32_t Periphs)
  1648. {
  1649. CLEAR_BIT(DBGMCU->C2APB1FZR2, Periphs);
  1650. }
  1651. /**
  1652. * @brief Freeze CPU1 APB2 peripherals
  1653. * @rmtoll DBGMCU_APB2FZR DBG_TIMx_STOP LL_DBGMCU_APB2_GRP1_FreezePeriph
  1654. * @param Periphs This parameter can be a combination of the following values:
  1655. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM1_STOP
  1656. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM16_STOP
  1657. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM17_STOP
  1658. * @retval None
  1659. */
  1660. __STATIC_INLINE void LL_DBGMCU_APB2_GRP1_FreezePeriph(uint32_t Periphs)
  1661. {
  1662. SET_BIT(DBGMCU->APB2FZR, Periphs);
  1663. }
  1664. /**
  1665. * @brief Freeze CPU2 APB2 peripherals
  1666. * @rmtoll DBGMCU_C2APB2FZR DBG_TIMx_STOP LL_C2_DBGMCU_APB2_GRP1_FreezePeriph
  1667. * @param Periphs This parameter can be a combination of the following values:
  1668. * @arg @ref LL_C2_DBGMCU_APB2_GRP1_TIM1_STOP
  1669. * @arg @ref LL_C2_DBGMCU_APB2_GRP1_TIM16_STOP
  1670. * @arg @ref LL_C2_DBGMCU_APB2_GRP1_TIM17_STOP
  1671. * @retval None
  1672. */
  1673. __STATIC_INLINE void LL_C2_DBGMCU_APB2_GRP1_FreezePeriph(uint32_t Periphs)
  1674. {
  1675. SET_BIT(DBGMCU->C2APB2FZR, Periphs);
  1676. }
  1677. /**
  1678. * @brief Unfreeze CPU1 APB2 peripherals
  1679. * @rmtoll DBGMCU_APB2FZR DBG_TIMx_STOP LL_DBGMCU_APB2_GRP1_UnFreezePeriph
  1680. * @param Periphs This parameter can be a combination of the following values:
  1681. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM1_STOP
  1682. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM16_STOP
  1683. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM17_STOP
  1684. * @retval None
  1685. */
  1686. __STATIC_INLINE void LL_DBGMCU_APB2_GRP1_UnFreezePeriph(uint32_t Periphs)
  1687. {
  1688. CLEAR_BIT(DBGMCU->APB2FZR, Periphs);
  1689. }
  1690. /**
  1691. * @brief Unfreeze CPU2 APB2 peripherals
  1692. * @rmtoll DBGMCU_C2APB2FZR DBG_TIMx_STOP LL_C2_DBGMCU_APB2_GRP1_UnFreezePeriph
  1693. * @param Periphs This parameter can be a combination of the following values:
  1694. * @arg @ref LL_C2_DBGMCU_APB2_GRP1_TIM1_STOP
  1695. * @arg @ref LL_C2_DBGMCU_APB2_GRP1_TIM16_STOP
  1696. * @arg @ref LL_C2_DBGMCU_APB2_GRP1_TIM17_STOP
  1697. * @retval None
  1698. */
  1699. __STATIC_INLINE void LL_C2_DBGMCU_APB2_GRP1_UnFreezePeriph(uint32_t Periphs)
  1700. {
  1701. CLEAR_BIT(DBGMCU->C2APB2FZR, Periphs);
  1702. }
  1703. /**
  1704. * @}
  1705. */
  1706. #if defined(VREFBUF)
  1707. /** @defgroup SYSTEM_LL_EF_VREFBUF VREFBUF
  1708. * @{
  1709. */
  1710. /**
  1711. * @brief Enable Internal voltage reference
  1712. * @rmtoll VREFBUF_CSR ENVR LL_VREFBUF_Enable
  1713. * @retval None
  1714. */
  1715. __STATIC_INLINE void LL_VREFBUF_Enable(void)
  1716. {
  1717. SET_BIT(VREFBUF->CSR, VREFBUF_CSR_ENVR);
  1718. }
  1719. /**
  1720. * @brief Disable Internal voltage reference
  1721. * @rmtoll VREFBUF_CSR ENVR LL_VREFBUF_Disable
  1722. * @retval None
  1723. */
  1724. __STATIC_INLINE void LL_VREFBUF_Disable(void)
  1725. {
  1726. CLEAR_BIT(VREFBUF->CSR, VREFBUF_CSR_ENVR);
  1727. }
  1728. /**
  1729. * @brief Enable high impedance (VREF+pin is high impedance)
  1730. * @rmtoll VREFBUF_CSR HIZ LL_VREFBUF_EnableHIZ
  1731. * @retval None
  1732. */
  1733. __STATIC_INLINE void LL_VREFBUF_EnableHIZ(void)
  1734. {
  1735. SET_BIT(VREFBUF->CSR, VREFBUF_CSR_HIZ);
  1736. }
  1737. /**
  1738. * @brief Disable high impedance (VREF+pin is internally connected to the voltage reference buffer output)
  1739. * @rmtoll VREFBUF_CSR HIZ LL_VREFBUF_DisableHIZ
  1740. * @retval None
  1741. */
  1742. __STATIC_INLINE void LL_VREFBUF_DisableHIZ(void)
  1743. {
  1744. CLEAR_BIT(VREFBUF->CSR, VREFBUF_CSR_HIZ);
  1745. }
  1746. /**
  1747. * @brief Set the Voltage reference scale
  1748. * @rmtoll VREFBUF_CSR VRS LL_VREFBUF_SetVoltageScaling
  1749. * @param Scale This parameter can be one of the following values:
  1750. * @arg @ref LL_VREFBUF_VOLTAGE_SCALE0
  1751. * @arg @ref LL_VREFBUF_VOLTAGE_SCALE1
  1752. * @retval None
  1753. */
  1754. __STATIC_INLINE void LL_VREFBUF_SetVoltageScaling(uint32_t Scale)
  1755. {
  1756. MODIFY_REG(VREFBUF->CSR, VREFBUF_CSR_VRS, Scale);
  1757. }
  1758. /**
  1759. * @brief Get the Voltage reference scale
  1760. * @rmtoll VREFBUF_CSR VRS LL_VREFBUF_GetVoltageScaling
  1761. * @retval Returned value can be one of the following values:
  1762. * @arg @ref LL_VREFBUF_VOLTAGE_SCALE0
  1763. * @arg @ref LL_VREFBUF_VOLTAGE_SCALE1
  1764. */
  1765. __STATIC_INLINE uint32_t LL_VREFBUF_GetVoltageScaling(void)
  1766. {
  1767. return (uint32_t)(READ_BIT(VREFBUF->CSR, VREFBUF_CSR_VRS));
  1768. }
  1769. /**
  1770. * @brief Get the VREFBUF trimming value for VRS=0 (VREF_SC0)
  1771. * @retval Between 0 and 0x3F
  1772. */
  1773. __STATIC_INLINE uint32_t LL_VREFBUF_SC0_GetCalibration(void)
  1774. {
  1775. return (uint32_t)(*VREFBUF_SC0_CAL_ADDR);
  1776. }
  1777. /**
  1778. * @brief Get the VREFBUF trimming value for VRS=1 (VREF_SC1)
  1779. * @retval Between 0 and 0x3F
  1780. */
  1781. __STATIC_INLINE uint32_t LL_VREFBUF_SC1_GetCalibration(void)
  1782. {
  1783. return (uint32_t)(*VREFBUF_SC1_CAL_ADDR);
  1784. }
  1785. /**
  1786. * @brief Check if Voltage reference buffer is ready
  1787. * @rmtoll VREFBUF_CSR VRR LL_VREFBUF_IsVREFReady
  1788. * @retval State of bit (1 or 0).
  1789. */
  1790. __STATIC_INLINE uint32_t LL_VREFBUF_IsVREFReady(void)
  1791. {
  1792. return ((READ_BIT(VREFBUF->CSR, VREFBUF_CSR_VRR) == (VREFBUF_CSR_VRR)) ? 1UL : 0UL);
  1793. }
  1794. /**
  1795. * @brief Get the trimming code for VREFBUF calibration
  1796. * @rmtoll VREFBUF_CCR TRIM LL_VREFBUF_GetTrimming
  1797. * @retval Between 0 and 0x3F
  1798. */
  1799. __STATIC_INLINE uint32_t LL_VREFBUF_GetTrimming(void)
  1800. {
  1801. return (uint32_t)(READ_BIT(VREFBUF->CCR, VREFBUF_CCR_TRIM));
  1802. }
  1803. /**
  1804. * @brief Set the trimming code for VREFBUF calibration (Tune the internal reference buffer voltage)
  1805. * @note Each VrefBuf voltage scale is calibrated in production for each device,
  1806. * data stored in flash memory.
  1807. * Functions @ref LL_VREFBUF_SC0_GetCalibration and
  1808. * @ref LL_VREFBUF_SC0_GetCalibration can be used to retrieve
  1809. * these calibration data.
  1810. * @rmtoll VREFBUF_CCR TRIM LL_VREFBUF_SetTrimming
  1811. * @param Value Between 0 and 0x3F
  1812. * @retval None
  1813. */
  1814. __STATIC_INLINE void LL_VREFBUF_SetTrimming(uint32_t Value)
  1815. {
  1816. WRITE_REG(VREFBUF->CCR, Value);
  1817. }
  1818. /**
  1819. * @}
  1820. */
  1821. #endif /* VREFBUF */
  1822. /** @defgroup SYSTEM_LL_EF_FLASH FLASH
  1823. * @{
  1824. */
  1825. /**
  1826. * @brief Set FLASH Latency
  1827. * @rmtoll FLASH_ACR LATENCY LL_FLASH_SetLatency
  1828. * @param Latency This parameter can be one of the following values:
  1829. * @arg @ref LL_FLASH_LATENCY_0
  1830. * @arg @ref LL_FLASH_LATENCY_1
  1831. * @arg @ref LL_FLASH_LATENCY_2
  1832. * @arg @ref LL_FLASH_LATENCY_3
  1833. * @retval None
  1834. */
  1835. __STATIC_INLINE void LL_FLASH_SetLatency(uint32_t Latency)
  1836. {
  1837. MODIFY_REG(FLASH->ACR, FLASH_ACR_LATENCY, Latency);
  1838. }
  1839. /**
  1840. * @brief Get FLASH Latency
  1841. * @rmtoll FLASH_ACR LATENCY LL_FLASH_GetLatency
  1842. * @retval Returned value can be one of the following values:
  1843. * @arg @ref LL_FLASH_LATENCY_0
  1844. * @arg @ref LL_FLASH_LATENCY_1
  1845. * @arg @ref LL_FLASH_LATENCY_2
  1846. * @arg @ref LL_FLASH_LATENCY_3
  1847. */
  1848. __STATIC_INLINE uint32_t LL_FLASH_GetLatency(void)
  1849. {
  1850. return (uint32_t)(READ_BIT(FLASH->ACR, FLASH_ACR_LATENCY));
  1851. }
  1852. /**
  1853. * @brief Enable Prefetch
  1854. * @rmtoll FLASH_ACR PRFTEN LL_FLASH_EnablePrefetch
  1855. * @retval None
  1856. */
  1857. __STATIC_INLINE void LL_FLASH_EnablePrefetch(void)
  1858. {
  1859. SET_BIT(FLASH->ACR, FLASH_ACR_PRFTEN);
  1860. }
  1861. /**
  1862. * @brief Disable Prefetch
  1863. * @rmtoll FLASH_ACR PRFTEN LL_FLASH_DisablePrefetch
  1864. * @rmtoll FLASH_C2ACR PRFTEN LL_FLASH_DisablePrefetch
  1865. * @retval None
  1866. */
  1867. __STATIC_INLINE void LL_FLASH_DisablePrefetch(void)
  1868. {
  1869. CLEAR_BIT(FLASH->ACR, FLASH_ACR_PRFTEN);
  1870. }
  1871. /**
  1872. * @brief Check if Prefetch buffer is enabled
  1873. * @rmtoll FLASH_ACR PRFTEN LL_FLASH_IsPrefetchEnabled
  1874. * @rmtoll FLASH_C2ACR C2PRFTEN LL_FLASH_IsPrefetchEnabled
  1875. * @retval State of bit (1 or 0).
  1876. */
  1877. __STATIC_INLINE uint32_t LL_FLASH_IsPrefetchEnabled(void)
  1878. {
  1879. return ((READ_BIT(FLASH->ACR, FLASH_ACR_PRFTEN) == (FLASH_ACR_PRFTEN)) ? 1UL : 0UL);
  1880. }
  1881. /**
  1882. * @brief Enable Instruction cache
  1883. * @rmtoll FLASH_ACR ICEN LL_FLASH_EnableInstCache
  1884. * @rmtoll FLASH_C2ACR ICEN LL_FLASH_EnableInstCache
  1885. * @retval None
  1886. */
  1887. __STATIC_INLINE void LL_FLASH_EnableInstCache(void)
  1888. {
  1889. SET_BIT(FLASH->ACR, FLASH_ACR_ICEN);
  1890. }
  1891. /**
  1892. * @brief Disable Instruction cache
  1893. * @rmtoll FLASH_ACR ICEN LL_FLASH_DisableInstCache
  1894. * @rmtoll FLASH_C2ACR ICEN LL_FLASH_DisableInstCache
  1895. * @retval None
  1896. */
  1897. __STATIC_INLINE void LL_FLASH_DisableInstCache(void)
  1898. {
  1899. CLEAR_BIT(FLASH->ACR, FLASH_ACR_ICEN);
  1900. }
  1901. /**
  1902. * @brief Enable Data cache
  1903. * @rmtoll FLASH_ACR DCEN LL_FLASH_EnableDataCache
  1904. * @retval None
  1905. */
  1906. __STATIC_INLINE void LL_FLASH_EnableDataCache(void)
  1907. {
  1908. SET_BIT(FLASH->ACR, FLASH_ACR_DCEN);
  1909. }
  1910. /**
  1911. * @brief Disable Data cache
  1912. * @rmtoll FLASH_ACR DCEN LL_FLASH_DisableDataCache
  1913. * @retval None
  1914. */
  1915. __STATIC_INLINE void LL_FLASH_DisableDataCache(void)
  1916. {
  1917. CLEAR_BIT(FLASH->ACR, FLASH_ACR_DCEN);
  1918. }
  1919. /**
  1920. * @brief Enable Instruction cache reset
  1921. * @note bit can be written only when the instruction cache is disabled
  1922. * @rmtoll FLASH_ACR ICRST LL_FLASH_EnableInstCacheReset
  1923. * @rmtoll FLASH_C2ACR ICRST LL_FLASH_EnableInstCacheReset
  1924. * @retval None
  1925. */
  1926. __STATIC_INLINE void LL_FLASH_EnableInstCacheReset(void)
  1927. {
  1928. SET_BIT(FLASH->ACR, FLASH_ACR_ICRST);
  1929. }
  1930. /**
  1931. * @brief Disable Instruction cache reset
  1932. * @rmtoll FLASH_ACR ICRST LL_FLASH_DisableInstCacheReset
  1933. * @rmtoll FLASH_C2ACR ICRST LL_FLASH_DisableInstCacheReset
  1934. * @retval None
  1935. */
  1936. __STATIC_INLINE void LL_FLASH_DisableInstCacheReset(void)
  1937. {
  1938. CLEAR_BIT(FLASH->ACR, FLASH_ACR_ICRST);
  1939. }
  1940. /**
  1941. * @brief Enable Data cache reset
  1942. * @note bit can be written only when the data cache is disabled
  1943. * @rmtoll FLASH_ACR DCRST LL_FLASH_EnableDataCacheReset
  1944. * @retval None
  1945. */
  1946. __STATIC_INLINE void LL_FLASH_EnableDataCacheReset(void)
  1947. {
  1948. SET_BIT(FLASH->ACR, FLASH_ACR_DCRST);
  1949. }
  1950. /**
  1951. * @brief Disable Data cache reset
  1952. * @rmtoll FLASH_ACR DCRST LL_FLASH_DisableDataCacheReset
  1953. * @retval None
  1954. */
  1955. __STATIC_INLINE void LL_FLASH_DisableDataCacheReset(void)
  1956. {
  1957. CLEAR_BIT(FLASH->ACR, FLASH_ACR_DCRST);
  1958. }
  1959. /**
  1960. * @brief Suspend new program or erase operation request
  1961. * @note Any new Flash program and erase operation on both CPU side will be suspended
  1962. * until this bit and the same bit in Flash CPU2 access control register (FLASH_C2ACR) are
  1963. * cleared. The PESD bit in both the Flash status register (FLASH_SR) and Flash
  1964. * CPU2 status register (FLASH_C2SR) register will be set when at least one PES
  1965. * bit in FLASH_ACR or FLASH_C2ACR is set.
  1966. * @rmtoll FLASH_ACR PES LL_FLASH_SuspendOperation
  1967. * @rmtoll FLASH_C2ACR PES LL_FLASH_SuspendOperation
  1968. * @retval None
  1969. */
  1970. __STATIC_INLINE void LL_FLASH_SuspendOperation(void)
  1971. {
  1972. SET_BIT(FLASH->ACR, FLASH_ACR_PES);
  1973. }
  1974. /**
  1975. * @brief Allow new program or erase operation request
  1976. * @note Any new Flash program and erase operation on both CPU side will be allowed
  1977. * until one of this bit or the same bit in Flash CPU2 access control register (FLASH_C2ACR) is
  1978. * set. The PESD bit in both the Flash status register (FLASH_SR) and Flash
  1979. * CPU2 status register (FLASH_C2SR) register will be clear when both PES
  1980. * bit in FLASH_ACR or FLASH_C2ACR is cleared.
  1981. * @rmtoll FLASH_ACR PES LL_FLASH_AllowOperation
  1982. * @rmtoll FLASH_C2ACR PES LL_FLASH_AllowOperation
  1983. * @retval None
  1984. */
  1985. __STATIC_INLINE void LL_FLASH_AllowOperation(void)
  1986. {
  1987. CLEAR_BIT(FLASH->ACR, FLASH_ACR_PES);
  1988. }
  1989. /**
  1990. * @brief Check if new program or erase operation request from CPU2 is suspended
  1991. * @rmtoll FLASH_ACR PES LL_FLASH_IsOperationSuspended
  1992. * @rmtoll FLASH_C2ACR PES LL_FLASH_IsOperationSuspended
  1993. * @retval State of bit (1 or 0).
  1994. */
  1995. __STATIC_INLINE uint32_t LL_FLASH_IsOperationSuspended(void)
  1996. {
  1997. return ((READ_BIT(FLASH->ACR, FLASH_ACR_PES) == (FLASH_ACR_PES)) ? 1UL : 0UL);
  1998. }
  1999. /**
  2000. * @brief Check if new program or erase operation request from CPU1 or CPU2 is suspended
  2001. * @rmtoll FLASH_SR PESD LL_FLASH_IsActiveFlag_OperationSuspended
  2002. * @rmtoll FLASH_C2SR PESD LL_FLASH_IsActiveFlag_OperationSuspended
  2003. * @retval State of bit (1 or 0).
  2004. */
  2005. __STATIC_INLINE uint32_t LL_FLASH_IsActiveFlag_OperationSuspended(void)
  2006. {
  2007. return ((READ_BIT(FLASH->SR, FLASH_SR_PESD) == (FLASH_SR_PESD)) ? 1UL : 0UL);
  2008. }
  2009. /**
  2010. * @brief Set EMPTY flag information as Flash User area empty
  2011. * @rmtoll FLASH_ACR EMPTY LL_FLASH_SetEmptyFlag
  2012. * @retval None
  2013. */
  2014. __STATIC_INLINE void LL_FLASH_SetEmptyFlag(void)
  2015. {
  2016. SET_BIT(FLASH->ACR, FLASH_ACR_EMPTY);
  2017. }
  2018. /**
  2019. * @brief Clear EMPTY flag information as Flash User area programmed
  2020. * @rmtoll FLASH_ACR EMPTY LL_FLASH_ClearEmptyFlag
  2021. * @retval None
  2022. */
  2023. __STATIC_INLINE void LL_FLASH_ClearEmptyFlag(void)
  2024. {
  2025. CLEAR_BIT(FLASH->ACR, FLASH_ACR_EMPTY);
  2026. }
  2027. /**
  2028. * @brief Check if the EMPTY flag is set or reset
  2029. * @rmtoll FLASH_ACR EMPTY LL_FLASH_IsEmptyFlag
  2030. * @retval State of bit (1 or 0).
  2031. */
  2032. __STATIC_INLINE uint32_t LL_FLASH_IsEmptyFlag(void)
  2033. {
  2034. return ((READ_BIT(FLASH->ACR, FLASH_ACR_EMPTY) == FLASH_ACR_EMPTY) ? 1UL : 0UL);
  2035. }
  2036. /**
  2037. * @brief Get IPCC buffer base address
  2038. * @rmtoll FLASH_IPCCBR IPCCDBA LL_FLASH_GetIPCCBufferAddr
  2039. * @retval IPCC data buffer base address offset
  2040. */
  2041. __STATIC_INLINE uint32_t LL_FLASH_GetIPCCBufferAddr(void)
  2042. {
  2043. return (uint32_t)(READ_BIT(FLASH->IPCCBR, FLASH_IPCCBR_IPCCDBA));
  2044. }
  2045. /**
  2046. * @brief Get CPU2 boot reset vector
  2047. * @rmtoll FLASH_SRRVR SBRV LL_FLASH_GetC2BootResetVect
  2048. * @retval CPU2 boot reset vector
  2049. */
  2050. __STATIC_INLINE uint32_t LL_FLASH_GetC2BootResetVect(void)
  2051. {
  2052. return (uint32_t)(READ_BIT(FLASH->SRRVR, FLASH_SRRVR_SBRV));
  2053. }
  2054. /**
  2055. * @brief Return the Unique Device Number
  2056. * @note The 64-bit UID64 may be used by Firmware to derive BLE 48-bit Device Address EUI-48 or
  2057. * 802.15.4 64-bit Device Address EUI-64.
  2058. * @retval Values between Min_Data=0x00 and Max_Data=0xFFFF
  2059. */
  2060. __STATIC_INLINE uint32_t LL_FLASH_GetUDN(void)
  2061. {
  2062. return (uint32_t)(READ_REG(*((uint32_t *)UID64_BASE)));
  2063. }
  2064. /**
  2065. * @brief Return the Device ID
  2066. * @note The 64-bit UID64 may be used by Firmware to derive BLE 48-bit Device Address EUI-48 or
  2067. * 802.15.4 64-bit Device Address EUI-64.
  2068. * For STM32WBxxxx devices, the device ID is 0x26
  2069. * @retval Values between Min_Data=0x00 and Max_Data=0xFF (ex: Device ID is 0x26 fo STM32WB55x)
  2070. */
  2071. __STATIC_INLINE uint32_t LL_FLASH_GetDeviceID(void)
  2072. {
  2073. return (uint32_t)((READ_REG(*((uint32_t *)UID64_BASE + 1U))) & 0x000000FFU);
  2074. }
  2075. /**
  2076. * @brief Return the ST Company ID
  2077. * @note The 64-bit UID64 may be used by Firmware to derive BLE 48-bit Device Address EUI-48 or
  2078. * 802.15.4 64-bit Device Address EUI-64.
  2079. * For STM32WBxxxx devices, the ST Compagny ID is 0x0080E1
  2080. * @retval Values between Min_Data=0x00 and Max_Data=0xFFFFFF (ex: ST Compagny ID is 0x0080E1)
  2081. */
  2082. __STATIC_INLINE uint32_t LL_FLASH_GetSTCompanyID(void)
  2083. {
  2084. return (uint32_t)(((READ_REG(*((uint32_t *)UID64_BASE + 1U))) >> 8U ) & 0x00FFFFFFU);
  2085. }
  2086. /**
  2087. * @}
  2088. */
  2089. /**
  2090. * @}
  2091. */
  2092. /**
  2093. * @}
  2094. */
  2095. /**
  2096. * @}
  2097. */
  2098. #endif /* defined (FLASH) || defined (SYSCFG) || defined (DBGMCU) || defined (VREFBUF) */
  2099. /**
  2100. * @}
  2101. */
  2102. #ifdef __cplusplus
  2103. }
  2104. #endif
  2105. #endif /* STM32WBxx_LL_SYSTEM_H */
  2106. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/