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.
 
 
 

7903 lines
475 KiB

  1. /**
  2. ******************************************************************************
  3. * @file stm32h7xx_hal_rcc.h
  4. * @author MCD Application Team
  5. * @brief Header file of RCC HAL module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics.
  10. * All rights reserved.</center></h2>
  11. *
  12. * This software component is licensed by ST under BSD 3-Clause license,
  13. * the "License"; You may not use this file except in compliance with the
  14. * License. You may obtain a copy of the License at:
  15. * opensource.org/licenses/BSD-3-Clause
  16. *
  17. ******************************************************************************
  18. */
  19. /* Define to prevent recursive inclusion -------------------------------------*/
  20. #ifndef STM32H7xx_HAL_RCC_H
  21. #define STM32H7xx_HAL_RCC_H
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. /* Includes ------------------------------------------------------------------*/
  26. #include "stm32h7xx_hal_def.h"
  27. /** @addtogroup STM32H7xx_HAL_Driver
  28. * @{
  29. */
  30. /** @addtogroup RCC
  31. * @{
  32. */
  33. /* Exported types ------------------------------------------------------------*/
  34. /** @defgroup RCC_Exported_Types RCC Exported Types
  35. * @{
  36. */
  37. /**
  38. * @brief RCC PLL configuration structure definition
  39. */
  40. typedef struct
  41. {
  42. uint32_t PLLState; /*!< The new state of the PLL.
  43. This parameter can be a value of @ref RCC_PLL_Config */
  44. uint32_t PLLSource; /*!< RCC_PLLSource: PLL entry clock source.
  45. This parameter must be a value of @ref RCC_PLL_Clock_Source */
  46. uint32_t PLLM; /*!< PLLM: Division factor for PLL VCO input clock.
  47. This parameter must be a number between Min_Data = 1 and Max_Data = 63 */
  48. uint32_t PLLN; /*!< PLLN: Multiplication factor for PLL VCO output clock.
  49. This parameter must be a number between Min_Data = 4 and Max_Data = 512
  50. or between Min_Data = 8 and Max_Data = 420(*)
  51. (*) : For stm32h7a3xx and stm32h7b3xx family lines. */
  52. uint32_t PLLP; /*!< PLLP: Division factor for system clock.
  53. This parameter must be a number between Min_Data = 2 and Max_Data = 128
  54. odd division factors are not allowed */
  55. uint32_t PLLQ; /*!< PLLQ: Division factor for peripheral clocks.
  56. This parameter must be a number between Min_Data = 1 and Max_Data = 128 */
  57. uint32_t PLLR; /*!< PLLR: Division factor for peripheral clocks.
  58. This parameter must be a number between Min_Data = 1 and Max_Data = 128 */
  59. uint32_t PLLRGE; /*!<PLLRGE: PLL1 clock Input range
  60. This parameter must be a value of @ref RCC_PLL1_VCI_Range */
  61. uint32_t PLLVCOSEL; /*!<PLLVCOSEL: PLL1 clock Output range
  62. This parameter must be a value of @ref RCC_PLL1_VCO_Range */
  63. uint32_t PLLFRACN; /*!<PLLFRACN: Specifies Fractional Part Of The Multiplication Factor for
  64. PLL1 VCO It should be a value between 0 and 8191 */
  65. }RCC_PLLInitTypeDef;
  66. /**
  67. * @brief RCC Internal/External Oscillator (HSE, HSI, CSI, LSE and LSI) configuration structure definition
  68. */
  69. typedef struct
  70. {
  71. uint32_t OscillatorType; /*!< The oscillators to be configured.
  72. This parameter can be a value of @ref RCC_Oscillator_Type */
  73. uint32_t HSEState; /*!< The new state of the HSE.
  74. This parameter can be a value of @ref RCC_HSE_Config */
  75. uint32_t LSEState; /*!< The new state of the LSE.
  76. This parameter can be a value of @ref RCC_LSE_Config */
  77. uint32_t HSIState; /*!< The new state of the HSI.
  78. This parameter can be a value of @ref RCC_HSI_Config */
  79. uint32_t HSICalibrationValue; /*!< The calibration trimming value.
  80. This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x3F for STM32H7 rev.Y
  81. This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x7F for STM32H7 rev.B and above */
  82. uint32_t LSIState; /*!< The new state of the LSI.
  83. This parameter can be a value of @ref RCC_LSI_Config */
  84. uint32_t HSI48State; /*!< The new state of the HSI48.
  85. This parameter can be a value of @ref RCC_HSI48_Config */
  86. uint32_t CSIState; /*!< The new state of the CSI.
  87. This parameter can be a value of @ref RCC_CSI_Config */
  88. uint32_t CSICalibrationValue; /*!< The calibration trimming value.
  89. This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x1F for STM32H7 rev.Y
  90. This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x3F for STM32H7 rev.B and above */
  91. RCC_PLLInitTypeDef PLL; /*!< PLL structure parameters */
  92. }RCC_OscInitTypeDef;
  93. /**
  94. * @brief RCC System, AHB and APB busses clock configuration structure definition
  95. */
  96. typedef struct
  97. {
  98. uint32_t ClockType; /*!< The clock to be configured.
  99. This parameter can be a value of @ref RCC_System_Clock_Type */
  100. uint32_t SYSCLKSource; /*!< The clock source (SYSCLKS) used as system clock.
  101. This parameter can be a value of @ref RCC_System_Clock_Source */
  102. uint32_t SYSCLKDivider; /*!< The system clock divider. This parameter can be
  103. a value of @ref RCC_SYS_Clock_Source */
  104. uint32_t AHBCLKDivider; /*!< The AHB clock (HCLK) divider. This clock is derived from the system clock (SYSCLK).
  105. This parameter can be a value of @ref RCC_HCLK_Clock_Source */
  106. uint32_t APB3CLKDivider; /*!< The APB3 clock (D1PCLK1) divider. This clock is derived from the AHB clock (HCLK).
  107. This parameter can be a value of @ref RCC_APB3_Clock_Source */
  108. uint32_t APB1CLKDivider; /*!< The APB1 clock (PCLK1) divider. This clock is derived from the AHB clock (HCLK).
  109. This parameter can be a value of @ref RCC_APB1_Clock_Source */
  110. uint32_t APB2CLKDivider; /*!< The APB2 clock (PCLK2) divider. This clock is derived from the AHB clock (HCLK).
  111. This parameter can be a value of @ref RCC_APB2_Clock_Source */
  112. uint32_t APB4CLKDivider; /*!< The APB4 clock (D3PCLK1) divider. This clock is derived from the AHB clock (HCLK).
  113. This parameter can be a value of @ref RCC_APB4_Clock_Source */
  114. }RCC_ClkInitTypeDef;
  115. /**
  116. * @}
  117. */
  118. /* Exported constants --------------------------------------------------------*/
  119. /** @defgroup RCC_Exported_Constants RCC Exported Constants
  120. * @{
  121. */
  122. /** @defgroup RCC_Oscillator_Type RCC Oscillator Type
  123. * @{
  124. */
  125. #define RCC_OSCILLATORTYPE_NONE (0x00000000U)
  126. #define RCC_OSCILLATORTYPE_HSE (0x00000001U)
  127. #define RCC_OSCILLATORTYPE_HSI (0x00000002U)
  128. #define RCC_OSCILLATORTYPE_LSE (0x00000004U)
  129. #define RCC_OSCILLATORTYPE_LSI (0x00000008U)
  130. #define RCC_OSCILLATORTYPE_CSI (0x00000010U)
  131. #define RCC_OSCILLATORTYPE_HSI48 (0x00000020U)
  132. /**
  133. * @}
  134. */
  135. /** @defgroup RCC_HSE_Config RCC HSE Config
  136. * @{
  137. */
  138. #define RCC_HSE_OFF (0x00000000U)
  139. #define RCC_HSE_ON RCC_CR_HSEON
  140. #define RCC_HSE_BYPASS ((uint32_t)(RCC_CR_HSEBYP | RCC_CR_HSEON))
  141. #if defined(RCC_CR_HSEEXT)
  142. #define RCC_HSE_BYPASS_DIGITAL ((uint32_t)(RCC_CR_HSEEXT | RCC_CR_HSEBYP | RCC_CR_HSEON))
  143. #endif /* RCC_CR_HSEEXT */
  144. /**
  145. * @}
  146. */
  147. /** @defgroup RCC_LSE_Config RCC LSE Config
  148. * @{
  149. */
  150. #define RCC_LSE_OFF (0x00000000U)
  151. #define RCC_LSE_ON RCC_BDCR_LSEON
  152. #define RCC_LSE_BYPASS ((uint32_t)(RCC_BDCR_LSEBYP | RCC_BDCR_LSEON))
  153. #if defined(RCC_BDCR_LSEEXT)
  154. #define RCC_LSE_BYPASS_DIGITAL ((uint32_t)(RCC_BDCR_LSEEXT | RCC_BDCR_LSEBYP | RCC_BDCR_LSEON))
  155. #endif /* RCC_BDCR_LSEEXT */
  156. /**
  157. * @}
  158. */
  159. /** @defgroup RCC_HSI_Config RCC HSI Config
  160. * @{
  161. */
  162. #define RCC_HSI_OFF (0x00000000U) /*!< HSI clock deactivation */
  163. #define RCC_HSI_ON RCC_CR_HSION /*!< HSI clock activation */
  164. #define RCC_HSI_DIV1 (RCC_CR_HSIDIV_1 | RCC_CR_HSION) /*!< HSI_DIV1 clock activation */
  165. #define RCC_HSI_DIV2 (RCC_CR_HSIDIV_2 | RCC_CR_HSION) /*!< HSI_DIV2 clock activation */
  166. #define RCC_HSI_DIV4 (RCC_CR_HSIDIV_4 | RCC_CR_HSION) /*!< HSI_DIV4 clock activation */
  167. #define RCC_HSI_DIV8 (RCC_CR_HSIDIV | RCC_CR_HSION) /*!< HSI_DIV8 clock activation */
  168. #if defined(RCC_HSICFGR_HSITRIM_6)
  169. #define RCC_HSICALIBRATION_DEFAULT (0x40U) /* Default HSI calibration trimming value, for STM32H7 rev.V and above */
  170. #else
  171. #define RCC_HSICALIBRATION_DEFAULT (0x20U) /* Default HSI calibration trimming value, for STM32H7 rev.Y */
  172. #endif
  173. /**
  174. * @}
  175. */
  176. /** @defgroup RCC_HSI48_Config RCC HSI48 Config
  177. * @{
  178. */
  179. #define RCC_HSI48_OFF ((uint8_t)0x00)
  180. #define RCC_HSI48_ON ((uint8_t)0x01)
  181. /**
  182. * @}
  183. */
  184. /** @defgroup RCC_LSI_Config RCC LSI Config
  185. * @{
  186. */
  187. #define RCC_LSI_OFF (0x00000000U)
  188. #define RCC_LSI_ON RCC_CSR_LSION
  189. /**
  190. * @}
  191. */
  192. /** @defgroup RCC_CSI_Config RCC CSI Config
  193. * @{
  194. */
  195. #define RCC_CSI_OFF (0x00000000U)
  196. #define RCC_CSI_ON RCC_CR_CSION
  197. #if defined(RCC_CSICFGR_CSITRIM_5)
  198. #define RCC_CSICALIBRATION_DEFAULT (0x20U) /* Default CSI calibration trimming value */
  199. #else
  200. #define RCC_CSICALIBRATION_DEFAULT (0x10U) /* Default CSI calibration trimming value */
  201. #endif /* RCC_CSICFGR_CSITRIM_5 */
  202. /**
  203. * @}
  204. */
  205. /** @defgroup RCC_PLL_Config RCC PLL Config
  206. * @{
  207. */
  208. #define RCC_PLL_NONE (0x00000000U)
  209. #define RCC_PLL_OFF (0x00000001U)
  210. #define RCC_PLL_ON (0x00000002U)
  211. /**
  212. * @}
  213. */
  214. /** @defgroup RCC_PLL_Clock_Source RCC PLL Clock Source
  215. * @{
  216. */
  217. #define RCC_PLLSOURCE_HSI (0x00000000U)
  218. #define RCC_PLLSOURCE_CSI (0x00000001U)
  219. #define RCC_PLLSOURCE_HSE (0x00000002U)
  220. #define RCC_PLLSOURCE_NONE (0x00000003U)
  221. /**
  222. * @}
  223. */
  224. /** @defgroup RCC_PLL_Clock_Output RCC PLL Clock Output
  225. * @{
  226. */
  227. #define RCC_PLL1_DIVP RCC_PLLCFGR_DIVP1EN
  228. #define RCC_PLL1_DIVQ RCC_PLLCFGR_DIVQ1EN
  229. #define RCC_PLL1_DIVR RCC_PLLCFGR_DIVR1EN
  230. /**
  231. * @}
  232. */
  233. /** @defgroup RCC_PLL1_VCI_Range RCC PLL1 VCI Range
  234. * @{
  235. */
  236. #define RCC_PLL1VCIRANGE_0 RCC_PLLCFGR_PLL1RGE_0
  237. #define RCC_PLL1VCIRANGE_1 RCC_PLLCFGR_PLL1RGE_1
  238. #define RCC_PLL1VCIRANGE_2 RCC_PLLCFGR_PLL1RGE_2
  239. #define RCC_PLL1VCIRANGE_3 RCC_PLLCFGR_PLL1RGE_3
  240. /**
  241. * @}
  242. */
  243. /** @defgroup RCC_PLL1_VCO_Range RCC PLL1 VCO Range
  244. * @{
  245. */
  246. #define RCC_PLL1VCOWIDE (0x00000000U)
  247. #define RCC_PLL1VCOMEDIUM RCC_PLLCFGR_PLL1VCOSEL
  248. /**
  249. * @}
  250. */
  251. /** @defgroup RCC_System_Clock_Type RCC System Clock Type
  252. * @{
  253. */
  254. #define RCC_CLOCKTYPE_SYSCLK (0x00000001U)
  255. #define RCC_CLOCKTYPE_HCLK (0x00000002U)
  256. #define RCC_CLOCKTYPE_D1PCLK1 (0x00000004U)
  257. #define RCC_CLOCKTYPE_PCLK1 (0x00000008U)
  258. #define RCC_CLOCKTYPE_PCLK2 (0x00000010U)
  259. #define RCC_CLOCKTYPE_D3PCLK1 (0x00000020U)
  260. /**
  261. * @}
  262. */
  263. /** @defgroup RCC_System_Clock_Source RCC System Clock Source
  264. * @{
  265. */
  266. #define RCC_SYSCLKSOURCE_CSI RCC_CFGR_SW_CSI
  267. #define RCC_SYSCLKSOURCE_HSI RCC_CFGR_SW_HSI
  268. #define RCC_SYSCLKSOURCE_HSE RCC_CFGR_SW_HSE
  269. #define RCC_SYSCLKSOURCE_PLLCLK RCC_CFGR_SW_PLL1
  270. /**
  271. * @}
  272. */
  273. /** @defgroup RCC_System_Clock_Source_Status System Clock Source Status
  274. * @{
  275. */
  276. #define RCC_SYSCLKSOURCE_STATUS_CSI RCC_CFGR_SWS_CSI /*!< CSI used as system clock */
  277. #define RCC_SYSCLKSOURCE_STATUS_HSI RCC_CFGR_SWS_HSI /*!< HSI used as system clock */
  278. #define RCC_SYSCLKSOURCE_STATUS_HSE RCC_CFGR_SWS_HSE /*!< HSE used as system clock */
  279. #define RCC_SYSCLKSOURCE_STATUS_PLLCLK RCC_CFGR_SWS_PLL1 /*!< PLL1 used as system clock */
  280. /**
  281. * @}
  282. */
  283. /** @defgroup RCC_SYS_Clock_Source RCC SYS Clock Source
  284. * @{
  285. */
  286. #if defined(RCC_D1CFGR_D1CPRE_DIV1)
  287. #define RCC_SYSCLK_DIV1 RCC_D1CFGR_D1CPRE_DIV1
  288. #define RCC_SYSCLK_DIV2 RCC_D1CFGR_D1CPRE_DIV2
  289. #define RCC_SYSCLK_DIV4 RCC_D1CFGR_D1CPRE_DIV4
  290. #define RCC_SYSCLK_DIV8 RCC_D1CFGR_D1CPRE_DIV8
  291. #define RCC_SYSCLK_DIV16 RCC_D1CFGR_D1CPRE_DIV16
  292. #define RCC_SYSCLK_DIV64 RCC_D1CFGR_D1CPRE_DIV64
  293. #define RCC_SYSCLK_DIV128 RCC_D1CFGR_D1CPRE_DIV128
  294. #define RCC_SYSCLK_DIV256 RCC_D1CFGR_D1CPRE_DIV256
  295. #define RCC_SYSCLK_DIV512 RCC_D1CFGR_D1CPRE_DIV512
  296. #else
  297. #define RCC_SYSCLK_DIV1 RCC_CDCFGR1_CDCPRE_DIV1
  298. #define RCC_SYSCLK_DIV2 RCC_CDCFGR1_CDCPRE_DIV2
  299. #define RCC_SYSCLK_DIV4 RCC_CDCFGR1_CDCPRE_DIV4
  300. #define RCC_SYSCLK_DIV8 RCC_CDCFGR1_CDCPRE_DIV8
  301. #define RCC_SYSCLK_DIV16 RCC_CDCFGR1_CDCPRE_DIV16
  302. #define RCC_SYSCLK_DIV64 RCC_CDCFGR1_CDCPRE_DIV64
  303. #define RCC_SYSCLK_DIV128 RCC_CDCFGR1_CDCPRE_DIV128
  304. #define RCC_SYSCLK_DIV256 RCC_CDCFGR1_CDCPRE_DIV256
  305. #define RCC_SYSCLK_DIV512 RCC_CDCFGR1_CDCPRE_DIV512
  306. #endif
  307. /**
  308. * @}
  309. */
  310. /** @defgroup RCC_HCLK_Clock_Source RCC HCLK Clock Source
  311. * @{
  312. */
  313. #if defined(RCC_D1CFGR_HPRE_DIV1)
  314. #define RCC_HCLK_DIV1 RCC_D1CFGR_HPRE_DIV1
  315. #define RCC_HCLK_DIV2 RCC_D1CFGR_HPRE_DIV2
  316. #define RCC_HCLK_DIV4 RCC_D1CFGR_HPRE_DIV4
  317. #define RCC_HCLK_DIV8 RCC_D1CFGR_HPRE_DIV8
  318. #define RCC_HCLK_DIV16 RCC_D1CFGR_HPRE_DIV16
  319. #define RCC_HCLK_DIV64 RCC_D1CFGR_HPRE_DIV64
  320. #define RCC_HCLK_DIV128 RCC_D1CFGR_HPRE_DIV128
  321. #define RCC_HCLK_DIV256 RCC_D1CFGR_HPRE_DIV256
  322. #define RCC_HCLK_DIV512 RCC_D1CFGR_HPRE_DIV512
  323. #else
  324. #define RCC_HCLK_DIV1 RCC_CDCFGR1_HPRE_DIV1
  325. #define RCC_HCLK_DIV2 RCC_CDCFGR1_HPRE_DIV2
  326. #define RCC_HCLK_DIV4 RCC_CDCFGR1_HPRE_DIV4
  327. #define RCC_HCLK_DIV8 RCC_CDCFGR1_HPRE_DIV8
  328. #define RCC_HCLK_DIV16 RCC_CDCFGR1_HPRE_DIV16
  329. #define RCC_HCLK_DIV64 RCC_CDCFGR1_HPRE_DIV64
  330. #define RCC_HCLK_DIV128 RCC_CDCFGR1_HPRE_DIV128
  331. #define RCC_HCLK_DIV256 RCC_CDCFGR1_HPRE_DIV256
  332. #define RCC_HCLK_DIV512 RCC_CDCFGR1_HPRE_DIV512
  333. #endif
  334. /**
  335. * @}
  336. */
  337. /** @defgroup RCC_APB3_Clock_Source RCC APB3 Clock Source
  338. * @{
  339. */
  340. #if defined (RCC_D1CFGR_D1PPRE_DIV1)
  341. #define RCC_APB3_DIV1 RCC_D1CFGR_D1PPRE_DIV1
  342. #define RCC_APB3_DIV2 RCC_D1CFGR_D1PPRE_DIV2
  343. #define RCC_APB3_DIV4 RCC_D1CFGR_D1PPRE_DIV4
  344. #define RCC_APB3_DIV8 RCC_D1CFGR_D1PPRE_DIV8
  345. #define RCC_APB3_DIV16 RCC_D1CFGR_D1PPRE_DIV16
  346. #else
  347. #define RCC_APB3_DIV1 RCC_CDCFGR1_CDPPRE_DIV1
  348. #define RCC_APB3_DIV2 RCC_CDCFGR1_CDPPRE_DIV2
  349. #define RCC_APB3_DIV4 RCC_CDCFGR1_CDPPRE_DIV4
  350. #define RCC_APB3_DIV8 RCC_CDCFGR1_CDPPRE_DIV8
  351. #define RCC_APB3_DIV16 RCC_CDCFGR1_CDPPRE_DIV16
  352. #endif
  353. /**
  354. * @}
  355. */
  356. /** @defgroup RCC_APB1_Clock_Source RCC APB1 Clock Source
  357. * @{
  358. */
  359. #if defined (RCC_D2CFGR_D2PPRE1_DIV1)
  360. #define RCC_APB1_DIV1 RCC_D2CFGR_D2PPRE1_DIV1
  361. #define RCC_APB1_DIV2 RCC_D2CFGR_D2PPRE1_DIV2
  362. #define RCC_APB1_DIV4 RCC_D2CFGR_D2PPRE1_DIV4
  363. #define RCC_APB1_DIV8 RCC_D2CFGR_D2PPRE1_DIV8
  364. #define RCC_APB1_DIV16 RCC_D2CFGR_D2PPRE1_DIV16
  365. #else
  366. #define RCC_APB1_DIV1 RCC_CDCFGR2_CDPPRE1_DIV1
  367. #define RCC_APB1_DIV2 RCC_CDCFGR2_CDPPRE1_DIV2
  368. #define RCC_APB1_DIV4 RCC_CDCFGR2_CDPPRE1_DIV4
  369. #define RCC_APB1_DIV8 RCC_CDCFGR2_CDPPRE1_DIV8
  370. #define RCC_APB1_DIV16 RCC_CDCFGR2_CDPPRE1_DIV16
  371. #endif
  372. /**
  373. * @}
  374. */
  375. /** @defgroup RCC_APB2_Clock_Source RCC APB2 Clock Source
  376. * @{
  377. */
  378. #if defined (RCC_D2CFGR_D2PPRE2_DIV1)
  379. #define RCC_APB2_DIV1 RCC_D2CFGR_D2PPRE2_DIV1
  380. #define RCC_APB2_DIV2 RCC_D2CFGR_D2PPRE2_DIV2
  381. #define RCC_APB2_DIV4 RCC_D2CFGR_D2PPRE2_DIV4
  382. #define RCC_APB2_DIV8 RCC_D2CFGR_D2PPRE2_DIV8
  383. #define RCC_APB2_DIV16 RCC_D2CFGR_D2PPRE2_DIV16
  384. #else
  385. #define RCC_APB2_DIV1 RCC_CDCFGR2_CDPPRE2_DIV1
  386. #define RCC_APB2_DIV2 RCC_CDCFGR2_CDPPRE2_DIV2
  387. #define RCC_APB2_DIV4 RCC_CDCFGR2_CDPPRE2_DIV4
  388. #define RCC_APB2_DIV8 RCC_CDCFGR2_CDPPRE2_DIV8
  389. #define RCC_APB2_DIV16 RCC_CDCFGR2_CDPPRE2_DIV16
  390. #endif
  391. /**
  392. * @}
  393. */
  394. /** @defgroup RCC_APB4_Clock_Source RCC APB4 Clock Source
  395. * @{
  396. */
  397. #if defined(RCC_D3CFGR_D3PPRE_DIV1)
  398. #define RCC_APB4_DIV1 RCC_D3CFGR_D3PPRE_DIV1
  399. #define RCC_APB4_DIV2 RCC_D3CFGR_D3PPRE_DIV2
  400. #define RCC_APB4_DIV4 RCC_D3CFGR_D3PPRE_DIV4
  401. #define RCC_APB4_DIV8 RCC_D3CFGR_D3PPRE_DIV8
  402. #define RCC_APB4_DIV16 RCC_D3CFGR_D3PPRE_DIV16
  403. #else
  404. #define RCC_APB4_DIV1 RCC_SRDCFGR_SRDPPRE_DIV1
  405. #define RCC_APB4_DIV2 RCC_SRDCFGR_SRDPPRE_DIV2
  406. #define RCC_APB4_DIV4 RCC_SRDCFGR_SRDPPRE_DIV4
  407. #define RCC_APB4_DIV8 RCC_SRDCFGR_SRDPPRE_DIV8
  408. #define RCC_APB4_DIV16 RCC_SRDCFGR_SRDPPRE_DIV16
  409. #endif
  410. /**
  411. * @}
  412. */
  413. /** @defgroup RCC_RTC_Clock_Source RCC RTC Clock Source
  414. * @{
  415. */
  416. #define RCC_RTCCLKSOURCE_NO_CLK (0x00000000U)
  417. #define RCC_RTCCLKSOURCE_LSE (0x00000100U)
  418. #define RCC_RTCCLKSOURCE_LSI (0x00000200U)
  419. #define RCC_RTCCLKSOURCE_HSE_DIV2 (0x00002300U)
  420. #define RCC_RTCCLKSOURCE_HSE_DIV3 (0x00003300U)
  421. #define RCC_RTCCLKSOURCE_HSE_DIV4 (0x00004300U)
  422. #define RCC_RTCCLKSOURCE_HSE_DIV5 (0x00005300U)
  423. #define RCC_RTCCLKSOURCE_HSE_DIV6 (0x00006300U)
  424. #define RCC_RTCCLKSOURCE_HSE_DIV7 (0x00007300U)
  425. #define RCC_RTCCLKSOURCE_HSE_DIV8 (0x00008300U)
  426. #define RCC_RTCCLKSOURCE_HSE_DIV9 (0x00009300U)
  427. #define RCC_RTCCLKSOURCE_HSE_DIV10 (0x0000A300U)
  428. #define RCC_RTCCLKSOURCE_HSE_DIV11 (0x0000B300U)
  429. #define RCC_RTCCLKSOURCE_HSE_DIV12 (0x0000C300U)
  430. #define RCC_RTCCLKSOURCE_HSE_DIV13 (0x0000D300U)
  431. #define RCC_RTCCLKSOURCE_HSE_DIV14 (0x0000E300U)
  432. #define RCC_RTCCLKSOURCE_HSE_DIV15 (0x0000F300U)
  433. #define RCC_RTCCLKSOURCE_HSE_DIV16 (0x00010300U)
  434. #define RCC_RTCCLKSOURCE_HSE_DIV17 (0x00011300U)
  435. #define RCC_RTCCLKSOURCE_HSE_DIV18 (0x00012300U)
  436. #define RCC_RTCCLKSOURCE_HSE_DIV19 (0x00013300U)
  437. #define RCC_RTCCLKSOURCE_HSE_DIV20 (0x00014300U)
  438. #define RCC_RTCCLKSOURCE_HSE_DIV21 (0x00015300U)
  439. #define RCC_RTCCLKSOURCE_HSE_DIV22 (0x00016300U)
  440. #define RCC_RTCCLKSOURCE_HSE_DIV23 (0x00017300U)
  441. #define RCC_RTCCLKSOURCE_HSE_DIV24 (0x00018300U)
  442. #define RCC_RTCCLKSOURCE_HSE_DIV25 (0x00019300U)
  443. #define RCC_RTCCLKSOURCE_HSE_DIV26 (0x0001A300U)
  444. #define RCC_RTCCLKSOURCE_HSE_DIV27 (0x0001B300U)
  445. #define RCC_RTCCLKSOURCE_HSE_DIV28 (0x0001C300U)
  446. #define RCC_RTCCLKSOURCE_HSE_DIV29 (0x0001D300U)
  447. #define RCC_RTCCLKSOURCE_HSE_DIV30 (0x0001E300U)
  448. #define RCC_RTCCLKSOURCE_HSE_DIV31 (0x0001F300U)
  449. #define RCC_RTCCLKSOURCE_HSE_DIV32 (0x00020300U)
  450. #define RCC_RTCCLKSOURCE_HSE_DIV33 (0x00021300U)
  451. #define RCC_RTCCLKSOURCE_HSE_DIV34 (0x00022300U)
  452. #define RCC_RTCCLKSOURCE_HSE_DIV35 (0x00023300U)
  453. #define RCC_RTCCLKSOURCE_HSE_DIV36 (0x00024300U)
  454. #define RCC_RTCCLKSOURCE_HSE_DIV37 (0x00025300U)
  455. #define RCC_RTCCLKSOURCE_HSE_DIV38 (0x00026300U)
  456. #define RCC_RTCCLKSOURCE_HSE_DIV39 (0x00027300U)
  457. #define RCC_RTCCLKSOURCE_HSE_DIV40 (0x00028300U)
  458. #define RCC_RTCCLKSOURCE_HSE_DIV41 (0x00029300U)
  459. #define RCC_RTCCLKSOURCE_HSE_DIV42 (0x0002A300U)
  460. #define RCC_RTCCLKSOURCE_HSE_DIV43 (0x0002B300U)
  461. #define RCC_RTCCLKSOURCE_HSE_DIV44 (0x0002C300U)
  462. #define RCC_RTCCLKSOURCE_HSE_DIV45 (0x0002D300U)
  463. #define RCC_RTCCLKSOURCE_HSE_DIV46 (0x0002E300U)
  464. #define RCC_RTCCLKSOURCE_HSE_DIV47 (0x0002F300U)
  465. #define RCC_RTCCLKSOURCE_HSE_DIV48 (0x00030300U)
  466. #define RCC_RTCCLKSOURCE_HSE_DIV49 (0x00031300U)
  467. #define RCC_RTCCLKSOURCE_HSE_DIV50 (0x00032300U)
  468. #define RCC_RTCCLKSOURCE_HSE_DIV51 (0x00033300U)
  469. #define RCC_RTCCLKSOURCE_HSE_DIV52 (0x00034300U)
  470. #define RCC_RTCCLKSOURCE_HSE_DIV53 (0x00035300U)
  471. #define RCC_RTCCLKSOURCE_HSE_DIV54 (0x00036300U)
  472. #define RCC_RTCCLKSOURCE_HSE_DIV55 (0x00037300U)
  473. #define RCC_RTCCLKSOURCE_HSE_DIV56 (0x00038300U)
  474. #define RCC_RTCCLKSOURCE_HSE_DIV57 (0x00039300U)
  475. #define RCC_RTCCLKSOURCE_HSE_DIV58 (0x0003A300U)
  476. #define RCC_RTCCLKSOURCE_HSE_DIV59 (0x0003B300U)
  477. #define RCC_RTCCLKSOURCE_HSE_DIV60 (0x0003C300U)
  478. #define RCC_RTCCLKSOURCE_HSE_DIV61 (0x0003D300U)
  479. #define RCC_RTCCLKSOURCE_HSE_DIV62 (0x0003E300U)
  480. #define RCC_RTCCLKSOURCE_HSE_DIV63 (0x0003F300U)
  481. /**
  482. * @}
  483. */
  484. /** @defgroup RCC_MCO_Index RCC MCO Index
  485. * @{
  486. */
  487. #define RCC_MCO1 (0x00000000U)
  488. #define RCC_MCO2 (0x00000001U)
  489. /**
  490. * @}
  491. */
  492. /** @defgroup RCC_MCO1_Clock_Source RCC MCO1 Clock Source
  493. * @{
  494. */
  495. #define RCC_MCO1SOURCE_HSI (0x00000000U)
  496. #define RCC_MCO1SOURCE_LSE RCC_CFGR_MCO1_0
  497. #define RCC_MCO1SOURCE_HSE RCC_CFGR_MCO1_1
  498. #define RCC_MCO1SOURCE_PLL1QCLK ((uint32_t)RCC_CFGR_MCO1_0 | RCC_CFGR_MCO1_1)
  499. #define RCC_MCO1SOURCE_HSI48 RCC_CFGR_MCO1_2
  500. /**
  501. * @}
  502. */
  503. /** @defgroup RCC_MCO2_Clock_Source RCC MCO2 Clock Source
  504. * @{
  505. */
  506. #define RCC_MCO2SOURCE_SYSCLK (0x00000000U)
  507. #define RCC_MCO2SOURCE_PLL2PCLK RCC_CFGR_MCO2_0
  508. #define RCC_MCO2SOURCE_HSE RCC_CFGR_MCO2_1
  509. #define RCC_MCO2SOURCE_PLLCLK ((uint32_t)RCC_CFGR_MCO2_0 | RCC_CFGR_MCO2_1)
  510. #define RCC_MCO2SOURCE_CSICLK RCC_CFGR_MCO2_2
  511. #define RCC_MCO2SOURCE_LSICLK ((uint32_t)RCC_CFGR_MCO2_0 | RCC_CFGR_MCO2_2)
  512. /**
  513. * @}
  514. */
  515. /** @defgroup RCC_MCOx_Clock_Prescaler RCC MCOx Clock Prescaler
  516. * @{
  517. */
  518. #define RCC_MCODIV_1 RCC_CFGR_MCO1PRE_0
  519. #define RCC_MCODIV_2 RCC_CFGR_MCO1PRE_1
  520. #define RCC_MCODIV_3 ((uint32_t)RCC_CFGR_MCO1PRE_0 | RCC_CFGR_MCO1PRE_1)
  521. #define RCC_MCODIV_4 RCC_CFGR_MCO1PRE_2
  522. #define RCC_MCODIV_5 ((uint32_t)RCC_CFGR_MCO1PRE_0 | RCC_CFGR_MCO1PRE_2)
  523. #define RCC_MCODIV_6 ((uint32_t)RCC_CFGR_MCO1PRE_1 | RCC_CFGR_MCO1PRE_2)
  524. #define RCC_MCODIV_7 ((uint32_t)RCC_CFGR_MCO1PRE_0 | RCC_CFGR_MCO1PRE_1 | RCC_CFGR_MCO1PRE_2)
  525. #define RCC_MCODIV_8 RCC_CFGR_MCO1PRE_3
  526. #define RCC_MCODIV_9 ((uint32_t)RCC_CFGR_MCO1PRE_0 | RCC_CFGR_MCO1PRE_3)
  527. #define RCC_MCODIV_10 ((uint32_t)RCC_CFGR_MCO1PRE_1 | RCC_CFGR_MCO1PRE_3)
  528. #define RCC_MCODIV_11 ((uint32_t)RCC_CFGR_MCO1PRE_0 | RCC_CFGR_MCO1PRE_1 | RCC_CFGR_MCO1PRE_3)
  529. #define RCC_MCODIV_12 ((uint32_t)RCC_CFGR_MCO1PRE_2 | RCC_CFGR_MCO1PRE_3)
  530. #define RCC_MCODIV_13 ((uint32_t)RCC_CFGR_MCO1PRE_0 | RCC_CFGR_MCO1PRE_2 | RCC_CFGR_MCO1PRE_3)
  531. #define RCC_MCODIV_14 ((uint32_t)RCC_CFGR_MCO1PRE_1 | RCC_CFGR_MCO1PRE_2 | RCC_CFGR_MCO1PRE_3)
  532. #define RCC_MCODIV_15 RCC_CFGR_MCO1PRE
  533. /**
  534. * @}
  535. */
  536. /** @defgroup RCC_Interrupt RCC Interrupt
  537. * @{
  538. */
  539. #define RCC_IT_LSIRDY (0x00000001U)
  540. #define RCC_IT_LSERDY (0x00000002U)
  541. #define RCC_IT_HSIRDY (0x00000004U)
  542. #define RCC_IT_HSERDY (0x00000008U)
  543. #define RCC_IT_CSIRDY (0x00000010U)
  544. #define RCC_IT_HSI48RDY (0x00000020U)
  545. #define RCC_IT_PLLRDY (0x00000040U)
  546. #define RCC_IT_PLL2RDY (0x00000080U)
  547. #define RCC_IT_PLL3RDY (0x00000100U)
  548. #define RCC_IT_LSECSS (0x00000200U)
  549. #define RCC_IT_CSS (0x00000400U)
  550. /**
  551. * @}
  552. */
  553. /** @defgroup RCC_Flag RCC Flag
  554. * Elements values convention: XXXYYYYYb
  555. * - YYYYY : Flag position in the register
  556. * - XXX : Register index
  557. * - 001: CR register
  558. * - 010: BDCR register
  559. * - 011: CSR register
  560. * - 100: RSR register
  561. * @{
  562. */
  563. /* Flags in the CR register */
  564. #define RCC_FLAG_HSIRDY ((uint8_t)0x22)
  565. #define RCC_FLAG_HSIDIV ((uint8_t)0x25)
  566. #define RCC_FLAG_CSIRDY ((uint8_t)0x28)
  567. #define RCC_FLAG_HSI48RDY ((uint8_t)0x2D)
  568. #if defined(RCC_CR_D1CKRDY)
  569. #define RCC_FLAG_D1CKRDY ((uint8_t)0x2E)
  570. #else
  571. #define RCC_FLAG_CPUCKRDY ((uint8_t)0x2E)
  572. #define RCC_FLAG_D1CKRDY RCC_FLAG_CPUCKRDY /* alias */
  573. #endif /* RCC_CR_D1CKRDY */
  574. #if defined(RCC_CR_D2CKRDY)
  575. #define RCC_FLAG_D2CKRDY ((uint8_t)0x2F)
  576. #else
  577. #define RCC_FLAG_CDCKRDY ((uint8_t)0x2F)
  578. #define RCC_FLAG_D2CKRDY RCC_FLAG_CDCKRDY /* alias */
  579. #endif /* RCC_CR_D2CKRDY */
  580. #define RCC_FLAG_HSERDY ((uint8_t)0x31)
  581. #define RCC_FLAG_PLLRDY ((uint8_t)0x39)
  582. #define RCC_FLAG_PLL2RDY ((uint8_t)0x3B)
  583. #define RCC_FLAG_PLL3RDY ((uint8_t)0x3D)
  584. /* Flags in the BDCR register */
  585. #define RCC_FLAG_LSERDY ((uint8_t)0x41)
  586. /* Flags in the CSR register */
  587. #define RCC_FLAG_LSIRDY ((uint8_t)0x61)
  588. /* Flags in the RSR register */
  589. #if defined(RCC_RSR_CPURSTF)
  590. #define RCC_FLAG_CPURST ((uint8_t)0x91)
  591. #endif /* RCC_RSR_CPURSTF */
  592. #if defined(RCC_RSR_D1RSTF)
  593. #define RCC_FLAG_D1RST ((uint8_t)0x93)
  594. #else
  595. #define RCC_FLAG_CDRST ((uint8_t)0x93)
  596. #endif /* RCC_RSR_D1RSTF */
  597. #if defined(RCC_RSR_D2RSTF)
  598. #define RCC_FLAG_D2RST ((uint8_t)0x94)
  599. #endif /* RCC_RSR_D2RSTF */
  600. #define RCC_FLAG_BORRST ((uint8_t)0x95)
  601. #define RCC_FLAG_PINRST ((uint8_t)0x96)
  602. #define RCC_FLAG_PORRST ((uint8_t)0x97)
  603. #define RCC_FLAG_SFTRST ((uint8_t)0x98)
  604. #define RCC_FLAG_IWDG1RST ((uint8_t)0x9A)
  605. #define RCC_FLAG_WWDG1RST ((uint8_t)0x9C)
  606. #define RCC_FLAG_LPWR1RST ((uint8_t)0x9E)
  607. #define RCC_FLAG_LPWR2RST ((uint8_t)0x9F)
  608. #if defined(DUAL_CORE)
  609. #define RCC_FLAG_C1RST (RCC_FLAG_CPURST)
  610. #define RCC_FLAG_C2RST ((uint8_t)0x92)
  611. #define RCC_FLAG_SFTR1ST (RCC_FLAG_SFTRST)
  612. #define RCC_FLAG_SFTR2ST ((uint8_t)0x99)
  613. #define RCC_FLAG_WWDG2RST ((uint8_t)0x9D)
  614. #define RCC_FLAG_IWDG2RST ((uint8_t)0x9B)
  615. #endif /*DUAL_CORE*/
  616. /**
  617. * @}
  618. */
  619. /** @defgroup RCC_LSEDrive_Config LSE Drive Config
  620. * @{
  621. */
  622. #define RCC_LSEDRIVE_LOW (0x00000000U) /*!< LSE low drive capability */
  623. #define RCC_LSEDRIVE_MEDIUMLOW RCC_BDCR_LSEDRV_0 /*!< LSE medium low drive capability */
  624. #define RCC_LSEDRIVE_MEDIUMHIGH RCC_BDCR_LSEDRV_1 /*!< LSE medium high drive capability */
  625. #define RCC_LSEDRIVE_HIGH RCC_BDCR_LSEDRV /*!< LSE high drive capability */
  626. /**
  627. * @}
  628. */
  629. /** @defgroup RCC_Stop_WakeUpClock RCC Stop WakeUpClock
  630. * @{
  631. */
  632. #define RCC_STOP_WAKEUPCLOCK_HSI (0x00000000U)
  633. #define RCC_STOP_WAKEUPCLOCK_CSI RCC_CFGR_STOPWUCK
  634. /**
  635. * @}
  636. */
  637. /** @defgroup RCC_Stop_KernelWakeUpClock RCC Stop KernelWakeUpClock
  638. * @{
  639. */
  640. #define RCC_STOP_KERWAKEUPCLOCK_HSI (0x00000000U)
  641. #define RCC_STOP_KERWAKEUPCLOCK_CSI RCC_CFGR_STOPKERWUCK
  642. /**
  643. * @}
  644. */
  645. #if defined(RCC_VER_X)
  646. #define HAL_RCC_REV_Y_HSITRIM_Pos (12U)
  647. #define HAL_RCC_REV_Y_HSITRIM_Msk (0x3F000U)
  648. #define HAL_RCC_REV_Y_CSITRIM_Pos (26U)
  649. #define HAL_RCC_REV_Y_CSITRIM_Msk (0x7C000000U)
  650. #endif /* RCC_VER_X */
  651. /**
  652. * @}
  653. */
  654. /* Exported macros -----------------------------------------------------------*/
  655. /** @defgroup RCC_Exported_Macros RCC Exported Macros
  656. * @{
  657. */
  658. /** @brief Enable or disable the AHB3 peripheral clock.
  659. * @note After reset, the peripheral clock (used for registers read/write access)
  660. * is disabled and the application software has to enable this clock before
  661. * using it.
  662. */
  663. #define __HAL_RCC_MDMA_CLK_ENABLE() do { \
  664. __IO uint32_t tmpreg; \
  665. SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_MDMAEN);\
  666. /* Delay after an RCC peripheral clock enabling */ \
  667. tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_MDMAEN);\
  668. UNUSED(tmpreg); \
  669. } while(0)
  670. #define __HAL_RCC_DMA2D_CLK_ENABLE() do { \
  671. __IO uint32_t tmpreg; \
  672. SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_DMA2DEN);\
  673. /* Delay after an RCC peripheral clock enabling */ \
  674. tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_DMA2DEN);\
  675. UNUSED(tmpreg); \
  676. } while(0)
  677. #if defined(JPEG)
  678. #define __HAL_RCC_JPGDECEN_CLK_ENABLE() do { \
  679. __IO uint32_t tmpreg; \
  680. SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_JPGDECEN);\
  681. /* Delay after an RCC peripheral clock enabling */ \
  682. tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_JPGDECEN);\
  683. UNUSED(tmpreg); \
  684. } while(0)
  685. #endif /* JPEG */
  686. #define __HAL_RCC_FMC_CLK_ENABLE() do { \
  687. __IO uint32_t tmpreg; \
  688. SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN);\
  689. /* Delay after an RCC peripheral clock enabling */ \
  690. tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN);\
  691. UNUSED(tmpreg); \
  692. } while(0)
  693. #if defined(QUADSPI)
  694. #define __HAL_RCC_QSPI_CLK_ENABLE() do { \
  695. __IO uint32_t tmpreg; \
  696. SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_QSPIEN);\
  697. /* Delay after an RCC peripheral clock enabling */ \
  698. tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_QSPIEN);\
  699. UNUSED(tmpreg); \
  700. } while(0)
  701. #endif /* QUADSPI */
  702. #if defined(OCTOSPI1)
  703. #define __HAL_RCC_OSPI1_CLK_ENABLE() do { \
  704. __IO uint32_t tmpreg; \
  705. SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_OSPI1EN);\
  706. /* Delay after an RCC peripheral clock enabling */ \
  707. tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_OSPI1EN);\
  708. UNUSED(tmpreg); \
  709. } while(0)
  710. #endif /* OCTOSPI1 */
  711. #if defined(OCTOSPI2)
  712. #define __HAL_RCC_OSPI2_CLK_ENABLE() do { \
  713. __IO uint32_t tmpreg; \
  714. SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_OSPI2EN);\
  715. /* Delay after an RCC peripheral clock enabling */ \
  716. tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_OSPI2EN);\
  717. UNUSED(tmpreg); \
  718. } while(0)
  719. #endif /* OCTOSPI2 */
  720. #if defined(OCTOSPIM)
  721. #define __HAL_RCC_OCTOSPIM_CLK_ENABLE() do { \
  722. __IO uint32_t tmpreg; \
  723. SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_IOMNGREN);\
  724. /* Delay after an RCC peripheral clock enabling */ \
  725. tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_IOMNGREN);\
  726. UNUSED(tmpreg); \
  727. } while(0)
  728. #endif /* OCTOSPIM */
  729. #if defined(OTFDEC1)
  730. #define __HAL_RCC_OTFDEC1_CLK_ENABLE() do { \
  731. __IO uint32_t tmpreg; \
  732. SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_OTFDEC1EN);\
  733. /* Delay after an RCC peripheral clock enabling */ \
  734. tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_OTFDEC1EN);\
  735. UNUSED(tmpreg); \
  736. } while(0)
  737. #endif /* OTFDEC1 */
  738. #if defined(OTFDEC2)
  739. #define __HAL_RCC_OTFDEC2_CLK_ENABLE() do { \
  740. __IO uint32_t tmpreg; \
  741. SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_OTFDEC2EN);\
  742. /* Delay after an RCC peripheral clock enabling */ \
  743. tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_OTFDEC2EN);\
  744. UNUSED(tmpreg); \
  745. } while(0)
  746. #endif /* OTFDEC2 */
  747. #if defined(GFXMMU)
  748. #define __HAL_RCC_GFXMMU_CLK_ENABLE() do { \
  749. __IO uint32_t tmpreg; \
  750. SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_GFXMMUEN);\
  751. /* Delay after an RCC peripheral clock enabling */ \
  752. tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_GFXMMUEN);\
  753. UNUSED(tmpreg); \
  754. } while(0)
  755. #endif /* GFXMMU */
  756. #define __HAL_RCC_SDMMC1_CLK_ENABLE() do { \
  757. __IO uint32_t tmpreg; \
  758. SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_SDMMC1EN);\
  759. /* Delay after an RCC peripheral clock enabling */ \
  760. tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_SDMMC1EN);\
  761. UNUSED(tmpreg); \
  762. } while(0)
  763. #define __HAL_RCC_MDMA_CLK_DISABLE() (RCC->AHB3ENR &= ~ (RCC_AHB3ENR_MDMAEN))
  764. #define __HAL_RCC_DMA2D_CLK_DISABLE() (RCC->AHB3ENR &= ~ (RCC_AHB3ENR_DMA2DEN))
  765. #if defined(JPEG)
  766. #define __HAL_RCC_JPGDECEN_CLK_DISABLE() (RCC->AHB3ENR &= ~ (RCC_AHB3ENR_JPGDECEN))
  767. #endif /* JPEG */
  768. #define __HAL_RCC_FMC_CLK_DISABLE() (RCC->AHB3ENR &= ~ (RCC_AHB3ENR_FMCEN))
  769. #if defined(QUADSPI)
  770. #define __HAL_RCC_QSPI_CLK_DISABLE() (RCC->AHB3ENR &= ~ (RCC_AHB3ENR_QSPIEN))
  771. #endif /* QUADSPI */
  772. #if defined(OCTOSPI1)
  773. #define __HAL_RCC_OSPI1_CLK_DISABLE() (RCC->AHB3ENR &= ~ (RCC_AHB3ENR_OSPI1EN))
  774. #endif /* OCTOSPII */
  775. #if defined(OCTOSPI2)
  776. #define __HAL_RCC_OSPI2_CLK_DISABLE() (RCC->AHB3ENR &= ~ (RCC_AHB3ENR_OSPI2EN))
  777. #endif /* OCTOSPI2 */
  778. #define __HAL_RCC_SDMMC1_CLK_DISABLE() (RCC->AHB3ENR &= ~ (RCC_AHB3ENR_SDMMC1EN))
  779. #if defined(OCTOSPIM)
  780. #define __HAL_RCC_OCTOSPIM_CLK_DISABLE() (RCC->AHB3ENR &= ~ (RCC_AHB3ENR_IOMNGREN))
  781. #endif /* OCTOSPIM */
  782. #if defined(OTFDEC1)
  783. #define __HAL_RCC_OTFDEC1_CLK_DISABLE() (RCC->AHB3ENR &= ~ (RCC_AHB3ENR_OTFDEC1EN))
  784. #endif /* OTOFDEC1 */
  785. #if defined(OTFDEC2)
  786. #define __HAL_RCC_OTFDEC2_CLK_DISABLE() (RCC->AHB3ENR &= ~ (RCC_AHB3ENR_OTFDEC2EN))
  787. #endif /* OTOFDEC2 */
  788. #if defined(GFXMMU)
  789. #define __HAL_RCC_GFXMMU_CLK_DISABLE() (RCC->AHB3ENR &= ~ (RCC_AHB3ENR_GFXMMUEN))
  790. #endif /* GFXMMU */
  791. /** @brief Get the enable or disable status of the AHB3 peripheral clock
  792. * @note After reset, the peripheral clock (used for registers read/write access)
  793. * is disabled and the application software has to enable this clock before
  794. * using it.
  795. */
  796. #define __HAL_RCC_MDMA_IS_CLK_ENABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_MDMAEN) != 0U)
  797. #define __HAL_RCC_DMA2D_IS_CLK_ENABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_DMA2DEN) != 0U)
  798. #if defined(JPEG)
  799. #define __HAL_RCC_JPGDECEN_IS_CLK_ENABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_JPGDECEN) != 0U)
  800. #endif /* JPEG */
  801. #define __HAL_RCC_FMC_IS_CLK_ENABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_FMCEN) != 0U)
  802. #if defined (QUADSPI)
  803. #define __HAL_RCC_QSPI_IS_CLK_ENABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_QSPIEN) != 0U)
  804. #endif /* QUADSPI */
  805. #if defined(OCTOSPI1)
  806. #define __HAL_RCC_OSPI1_IS_CLK_ENABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_OSPI1EN) != 0U)
  807. #endif /* OCTOSPII */
  808. #if defined(OCTOSPI2)
  809. #define __HAL_RCC_OSPI2_IS_CLK_ENABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_OSPI2EN) != 0U)
  810. #endif /* OCTOSPI2 */
  811. #define __HAL_RCC_SDMMC1_IS_CLK_ENABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_SDMMC1EN) != 0U)
  812. #if defined(OCTOSPIM)
  813. #define __HAL_RCC_OCTOSPIM_IS_CLK_ENABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_IOMNGREN) != 0U)
  814. #endif /* OCTOSPIM */
  815. #if defined(OTFDEC1)
  816. #define __HAL_RCC_OTFDEC1_IS_CLK_ENABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_OTFDEC1EN) != 0U)
  817. #endif /* OTOFDEC1 */
  818. #if defined(OTFDEC2)
  819. #define __HAL_RCC_OTFDEC2_IS_CLK_ENABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_OTFDEC2EN) != 0U)
  820. #endif /* OTOFDEC2 */
  821. #if defined(GFXMMU)
  822. #define __HAL_RCC_GFXMMU_IS_CLK_ENABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_GFXMMUEN) != 0U)
  823. #endif /* GFXMMU */
  824. #define __HAL_RCC_MDMA_IS_CLK_DISABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_MDMAEN) == 0U)
  825. #define __HAL_RCC_DMA2D_IS_CLK_DISABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_DMA2DEN) == 0U)
  826. #if defined(JPEG)
  827. #define __HAL_RCC_JPGDECEN_IS_CLK_DISABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_JPGDECEN) == 0U)
  828. #endif /* JPEG */
  829. #define __HAL_RCC_FMC_IS_CLK_DISABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_FMCEN) == 0U)
  830. #if defined (QUADSPI)
  831. #define __HAL_RCC_QSPI_IS_CLK_DISABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_QSPIEN) == 0U)
  832. #endif /* QUADSPI */
  833. #define __HAL_RCC_SDMMC1_IS_CLK_DISABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_SDMMC1EN) == 0U)
  834. #if defined(OCTOSPI1)
  835. #define __HAL_RCC_OSPI1_IS_CLK_DISABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_OSPI1EN) == 0U)
  836. #endif
  837. #if defined(OCTOSPI2)
  838. #define __HAL_RCC_OSPI2_IS_CLK_DISABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_OSPI2EN) == 0U)
  839. #endif
  840. #if defined(OCTOSPIM)
  841. #define __HAL_RCC_OCTOSPIM_IS_CLK_DISABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_IOMNGREN) == 0U)
  842. #endif
  843. #if defined(OTFDEC1)
  844. #define __HAL_RCC_OTFDEC1_IS_CLK_DISABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_OTFDEC1EN) == 0U)
  845. #endif
  846. #if defined(OTFDEC2)
  847. #define __HAL_RCC_OTFDEC2_IS_CLK_DISABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_OTFDEC2EN) == 0U)
  848. #endif
  849. #if defined(GFXMMU)
  850. #define __HAL_RCC_GFXMMU_IS_CLK_DISABLED() ((RCC->AHB3ENR & RCC_AHB3ENR_GFXMMUEN) == 0U)
  851. #endif
  852. /** @brief Enable or disable the AHB1 peripheral clock.
  853. * @note After reset, the peripheral clock (used for registers read/write access)
  854. * is disabled and the application software has to enable this clock before
  855. * using it.
  856. */
  857. #define __HAL_RCC_DMA1_CLK_ENABLE() do { \
  858. __IO uint32_t tmpreg; \
  859. SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_DMA1EN);\
  860. /* Delay after an RCC peripheral clock enabling */ \
  861. tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_DMA1EN);\
  862. UNUSED(tmpreg); \
  863. } while(0)
  864. #define __HAL_RCC_DMA2_CLK_ENABLE() do { \
  865. __IO uint32_t tmpreg; \
  866. SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_DMA2EN);\
  867. /* Delay after an RCC peripheral clock enabling */ \
  868. tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_DMA2EN);\
  869. UNUSED(tmpreg); \
  870. } while(0)
  871. #define __HAL_RCC_ADC12_CLK_ENABLE() do { \
  872. __IO uint32_t tmpreg; \
  873. SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ADC12EN);\
  874. /* Delay after an RCC peripheral clock enabling */ \
  875. tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ADC12EN);\
  876. UNUSED(tmpreg); \
  877. } while(0)
  878. #if defined(DUAL_CORE)
  879. #define __HAL_RCC_ART_CLK_ENABLE() do { \
  880. __IO uint32_t tmpreg; \
  881. SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ARTEN);\
  882. /* Delay after an RCC peripheral clock enabling */ \
  883. tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ARTEN);\
  884. UNUSED(tmpreg); \
  885. } while(0)
  886. #endif /*DUAL_CORE*/
  887. #if defined(RCC_AHB1ENR_CRCEN)
  888. #define __HAL_RCC_CRC_CLK_ENABLE() do { \
  889. __IO uint32_t tmpreg; \
  890. SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_CRCEN);\
  891. /* Delay after an RCC peripheral clock enabling */ \
  892. tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_CRCEN);\
  893. UNUSED(tmpreg); \
  894. } while(0)
  895. #endif
  896. #if defined(ETH)
  897. #define __HAL_RCC_ETH1MAC_CLK_ENABLE() do { \
  898. __IO uint32_t tmpreg; \
  899. SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETH1MACEN);\
  900. /* Delay after an RCC peripheral clock enabling */ \
  901. tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETH1MACEN);\
  902. UNUSED(tmpreg); \
  903. } while(0)
  904. #define __HAL_RCC_ETH1TX_CLK_ENABLE() do { \
  905. __IO uint32_t tmpreg; \
  906. SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETH1TXEN);\
  907. /* Delay after an RCC peripheral clock enabling */ \
  908. tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETH1TXEN);\
  909. UNUSED(tmpreg); \
  910. } while(0)
  911. #define __HAL_RCC_ETH1RX_CLK_ENABLE() do { \
  912. __IO uint32_t tmpreg; \
  913. SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETH1RXEN);\
  914. /* Delay after an RCC peripheral clock enabling */ \
  915. tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETH1RXEN);\
  916. UNUSED(tmpreg); \
  917. } while(0)
  918. #endif
  919. #define __HAL_RCC_USB1_OTG_HS_CLK_ENABLE() do { \
  920. __IO uint32_t tmpreg; \
  921. SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_USB1OTGHSEN);\
  922. /* Delay after an RCC peripheral clock enabling */ \
  923. tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_USB1OTGHSEN);\
  924. UNUSED(tmpreg); \
  925. } while(0)
  926. #define __HAL_RCC_USB1_OTG_HS_ULPI_CLK_ENABLE() do { \
  927. __IO uint32_t tmpreg; \
  928. SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_USB1OTGHSULPIEN);\
  929. /* Delay after an RCC peripheral clock enabling */ \
  930. tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_USB1OTGHSULPIEN);\
  931. UNUSED(tmpreg); \
  932. } while(0)
  933. #if defined(USB2_OTG_FS)
  934. #define __HAL_RCC_USB2_OTG_FS_CLK_ENABLE() do { \
  935. __IO uint32_t tmpreg; \
  936. SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_USB2OTGHSEN);\
  937. /* Delay after an RCC peripheral clock enabling */ \
  938. tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_USB2OTGHSEN);\
  939. UNUSED(tmpreg); \
  940. } while(0)
  941. #define __HAL_RCC_USB2_OTG_FS_ULPI_CLK_ENABLE() do { \
  942. __IO uint32_t tmpreg; \
  943. SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_USB2OTGHSULPIEN);\
  944. /* Delay after an RCC peripheral clock enabling */ \
  945. tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_USB2OTGHSULPIEN);\
  946. UNUSED(tmpreg); \
  947. } while(0)
  948. #endif
  949. #define __HAL_RCC_DMA1_CLK_DISABLE() (RCC->AHB1ENR &= ~ (RCC_AHB1ENR_DMA1EN))
  950. #define __HAL_RCC_DMA2_CLK_DISABLE() (RCC->AHB1ENR &= ~ (RCC_AHB1ENR_DMA2EN))
  951. #define __HAL_RCC_ADC12_CLK_DISABLE() (RCC->AHB1ENR &= ~ (RCC_AHB1ENR_ADC12EN))
  952. #if defined(DUAL_CORE)
  953. #define __HAL_RCC_ART_CLK_DISABLE() (RCC->AHB1ENR &= ~ (RCC_AHB1ENR_ARTEN))
  954. #endif /*DUAL_CORE*/
  955. #if defined(RCC_AHB1ENR_CRCEN)
  956. #define __HAL_RCC_CRC_CLK_DISABLE() (RCC->AHB1ENR &= ~ (RCC_AHB1ENR_CRCEN))
  957. #endif
  958. #if defined(ETH)
  959. #define __HAL_RCC_ETH1MAC_CLK_DISABLE() (RCC->AHB1ENR &= ~ (RCC_AHB1ENR_ETH1MACEN))
  960. #define __HAL_RCC_ETH1TX_CLK_DISABLE() (RCC->AHB1ENR &= ~ (RCC_AHB1ENR_ETH1TXEN))
  961. #define __HAL_RCC_ETH1RX_CLK_DISABLE() (RCC->AHB1ENR &= ~ (RCC_AHB1ENR_ETH1RXEN))
  962. #endif
  963. #define __HAL_RCC_USB1_OTG_HS_CLK_DISABLE() (RCC->AHB1ENR &= ~ (RCC_AHB1ENR_USB1OTGHSEN))
  964. #define __HAL_RCC_USB1_OTG_HS_ULPI_CLK_DISABLE() (RCC->AHB1ENR &= ~ (RCC_AHB1ENR_USB1OTGHSULPIEN))
  965. #if defined(USB2_OTG_FS)
  966. #define __HAL_RCC_USB2_OTG_FS_CLK_DISABLE() (RCC->AHB1ENR &= ~ (RCC_AHB1ENR_USB2OTGHSEN))
  967. #define __HAL_RCC_USB2_OTG_FS_ULPI_CLK_DISABLE() (RCC->AHB1ENR &= ~ (RCC_AHB1ENR_USB2OTGHSULPIEN))
  968. #endif /* USB2_OTG_FS */
  969. /** @brief Get the enable or disable status of the AHB1 peripheral clock
  970. * @note After reset, the peripheral clock (used for registers read/write access)
  971. * is disabled and the application software has to enable this clock before
  972. * using it.
  973. */
  974. #define __HAL_RCC_DMA1_IS_CLK_ENABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_DMA1EN) != 0U)
  975. #define __HAL_RCC_DMA2_IS_CLK_ENABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_DMA2EN) != 0U)
  976. #define __HAL_RCC_ADC12_IS_CLK_ENABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_ADC12EN) != 0U)
  977. #if defined(DUAL_CORE)
  978. #define __HAL_RCC_ART_IS_CLK_ENABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_ARTEN) != 0U)
  979. #endif /*DUAL_CORE*/
  980. #if defined(RCC_AHB1ENR_CRCEN)
  981. #define __HAL_RCC_CRC_IS_CLK_ENABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_CRCEN) != 0U)
  982. #endif
  983. #if defined(ETH)
  984. #define __HAL_RCC_ETH1MAC_IS_CLK_ENABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_ETH1MACEN) != 0U)
  985. #define __HAL_RCC_ETH1TX_IS_CLK_ENABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_ETH1TXEN) != 0U)
  986. #define __HAL_RCC_ETH1RX_IS_CLK_ENABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_ETH1RXEN) != 0U)
  987. #endif
  988. #define __HAL_RCC_USB1_OTG_HS_IS_CLK_ENABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_USB1OTGHSEN) != 0U)
  989. #define __HAL_RCC_USB1_OTG_HS_ULPI_IS_CLK_ENABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_USB1OTGHSULPIEN) != 0U)
  990. #if defined(USB2_OTG_FS)
  991. #define __HAL_RCC_USB2_OTG_FS_IS_CLK_ENABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_USB2OTGHSEN) != 0U)
  992. #define __HAL_RCC_USB2_OTG_FS_ULPI_IS_CLK_ENABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_USB2OTGHSULPIEN) != 0U)
  993. #endif /* USB2_OTG_FS */
  994. #define __HAL_RCC_DMA1_IS_CLK_DISABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_DMA1EN) == 0U)
  995. #define __HAL_RCC_DMA2_IS_CLK_DISABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_DMA2EN) == 0U)
  996. #define __HAL_RCC_ADC12_IS_CLK_DISABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_ADC12EN) == 0U)
  997. #if defined(DUAL_CORE)
  998. #define __HAL_RCC_ART_IS_CLK_DISABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_ARTEN) == 0U)
  999. #endif /*DUAL_CORE*/
  1000. #if defined(RCC_AHB1ENR_CRCEN)
  1001. #define __HAL_RCC_CRC_IS_CLK_DISABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_CRCEN) == 0U)
  1002. #endif
  1003. #if defined(ETH)
  1004. #define __HAL_RCC_ETH1MAC_IS_CLK_DISABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_ETH1MACEN) == 0U)
  1005. #define __HAL_RCC_ETH1TX_IS_CLK_DISABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_ETH1TXEN) == 0U)
  1006. #define __HAL_RCC_ETH1RX_IS_CLK_DISABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_ETH1RXEN) == 0U)
  1007. #endif
  1008. #define __HAL_RCC_USB1_OTG_HS_IS_CLK_DISABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_USB1OTGHSEN) == 0U)
  1009. #define __HAL_RCC_USB1_OTG_HS_ULPI_IS_CLK_DISABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_USB1OTGHSULPIEN) == 0U)
  1010. #if defined(USB2_OTG_FS)
  1011. #define __HAL_RCC_USB2_OTG_FS_IS_CLK_DISABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_USB2OTGHSEN) == 0U)
  1012. #define __HAL_RCC_USB2_OTG_FS_ULPI_IS_CLK_DISABLED() ((RCC->AHB1ENR & RCC_AHB1ENR_USB2OTGHSULPIEN) == 0U)
  1013. #endif /* USB2_OTG_FS */
  1014. /** @brief Enable or disable the AHB2 peripheral clock.
  1015. * @note After reset, the peripheral clock (used for registers read/write access)
  1016. * is disabled and the application software has to enable this clock before
  1017. * using it.
  1018. */
  1019. #if defined(DCMI) && defined(PSSI)
  1020. #define __HAL_RCC_DCMI_PSSI_CLK_ENABLE() do { \
  1021. __IO uint32_t tmpreg; \
  1022. SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_DCMI_PSSIEN);\
  1023. /* Delay after an RCC peripheral clock enabling */ \
  1024. tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_DCMI_PSSIEN);\
  1025. UNUSED(tmpreg); \
  1026. } while(0)
  1027. #define __HAL_RCC_DCMI_CLK_ENABLE() __HAL_RCC_DCMI_PSSI_CLK_ENABLE() /* for API backward compatibility*/
  1028. #else
  1029. #define __HAL_RCC_DCMI_CLK_ENABLE() do { \
  1030. __IO uint32_t tmpreg; \
  1031. SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_DCMIEN);\
  1032. /* Delay after an RCC peripheral clock enabling */ \
  1033. tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_DCMIEN);\
  1034. UNUSED(tmpreg); \
  1035. } while(0)
  1036. #endif /* DCMI && PSSI */
  1037. #define __HAL_RCC_CRYP_CLK_ENABLE() do { \
  1038. __IO uint32_t tmpreg; \
  1039. SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_CRYPEN);\
  1040. /* Delay after an RCC peripheral clock enabling */ \
  1041. tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_CRYPEN);\
  1042. UNUSED(tmpreg); \
  1043. } while(0)
  1044. #define __HAL_RCC_HASH_CLK_ENABLE() do { \
  1045. __IO uint32_t tmpreg; \
  1046. SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_HASHEN);\
  1047. /* Delay after an RCC peripheral clock enabling */ \
  1048. tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_HASHEN);\
  1049. UNUSED(tmpreg); \
  1050. } while(0)
  1051. #define __HAL_RCC_RNG_CLK_ENABLE() do { \
  1052. __IO uint32_t tmpreg; \
  1053. SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_RNGEN);\
  1054. /* Delay after an RCC peripheral clock enabling */ \
  1055. tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_RNGEN);\
  1056. UNUSED(tmpreg); \
  1057. } while(0)
  1058. #define __HAL_RCC_SDMMC2_CLK_ENABLE() do { \
  1059. __IO uint32_t tmpreg; \
  1060. SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_SDMMC2EN);\
  1061. /* Delay after an RCC peripheral clock enabling */ \
  1062. tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_SDMMC2EN);\
  1063. UNUSED(tmpreg); \
  1064. } while(0)
  1065. #if defined(RCC_AHB2ENR_D2SRAM1EN)
  1066. #define __HAL_RCC_D2SRAM1_CLK_ENABLE() do { \
  1067. __IO uint32_t tmpreg; \
  1068. SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_D2SRAM1EN);\
  1069. /* Delay after an RCC peripheral clock enabling */ \
  1070. tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_D2SRAM1EN);\
  1071. UNUSED(tmpreg); \
  1072. } while(0)
  1073. #else
  1074. #define __HAL_RCC_AHBSRAM1_CLK_ENABLE() do { \
  1075. __IO uint32_t tmpreg; \
  1076. SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_AHBSRAM1EN);\
  1077. /* Delay after an RCC peripheral clock enabling */ \
  1078. tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_AHBSRAM1EN);\
  1079. UNUSED(tmpreg); \
  1080. } while(0)
  1081. #endif /* RCC_AHB2ENR_D2SRAM1EN */
  1082. #if defined(RCC_AHB2ENR_D2SRAM2EN)
  1083. #define __HAL_RCC_D2SRAM2_CLK_ENABLE() do { \
  1084. __IO uint32_t tmpreg; \
  1085. SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_D2SRAM2EN);\
  1086. /* Delay after an RCC peripheral clock enabling */ \
  1087. tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_D2SRAM2EN);\
  1088. UNUSED(tmpreg); \
  1089. } while(0)
  1090. #else
  1091. #define __HAL_RCC_AHBSRAM2_CLK_ENABLE() do { \
  1092. __IO uint32_t tmpreg; \
  1093. SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_AHBSRAM2EN);\
  1094. /* Delay after an RCC peripheral clock enabling */ \
  1095. tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_AHBSRAM2EN);\
  1096. UNUSED(tmpreg); \
  1097. } while(0)
  1098. #endif /* RCC_AHB2ENR_D2SRAM2EN */
  1099. #if defined(RCC_AHB2ENR_D2SRAM3EN)
  1100. #define __HAL_RCC_D2SRAM3_CLK_ENABLE() do { \
  1101. __IO uint32_t tmpreg; \
  1102. SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_D2SRAM3EN);\
  1103. /* Delay after an RCC peripheral clock enabling */ \
  1104. tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_D2SRAM3EN);\
  1105. UNUSED(tmpreg); \
  1106. } while(0)
  1107. #endif
  1108. #if defined(RCC_AHB2ENR_HSEMEN)
  1109. #define __HAL_RCC_HSEM_CLK_ENABLE() do { \
  1110. __IO uint32_t tmpreg; \
  1111. SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_HSEMEN);\
  1112. /* Delay after an RCC peripheral clock enabling */ \
  1113. tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_HSEMEN);\
  1114. UNUSED(tmpreg); \
  1115. } while(0)
  1116. #endif /* RCC_AHB2ENR_HSEMEN */
  1117. #if defined(BDMA1)
  1118. #define __HAL_RCC_BDMA1_CLK_ENABLE() do { \
  1119. __IO uint32_t tmpreg; \
  1120. SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_BDMA1EN);\
  1121. /* Delay after an RCC peripheral clock enabling */ \
  1122. tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_BDMA1EN);\
  1123. UNUSED(tmpreg); \
  1124. } while(0)
  1125. #endif /* BDMA1 */
  1126. #if defined(DCMI) && defined(PSSI)
  1127. #define __HAL_RCC_DCMI_PSSI_CLK_DISABLE() (RCC->AHB2ENR &= ~ (RCC_AHB2ENR_DCMI_PSSIEN))
  1128. #define __HAL_RCC_DCMI_CLK_DISABLE() __HAL_RCC_DCMI_PSSI_CLK_DISABLE() /* for API backward compatibility*/
  1129. #else
  1130. #define __HAL_RCC_DCMI_CLK_DISABLE() (RCC->AHB2ENR &= ~ (RCC_AHB2ENR_DCMIEN))
  1131. #endif /* DCMI && PSSI */
  1132. #define __HAL_RCC_CRYP_CLK_DISABLE() (RCC->AHB2ENR &= ~ (RCC_AHB2ENR_CRYPEN))
  1133. #define __HAL_RCC_HASH_CLK_DISABLE() (RCC->AHB2ENR &= ~ (RCC_AHB2ENR_HASHEN))
  1134. #define __HAL_RCC_RNG_CLK_DISABLE() (RCC->AHB2ENR &= ~ (RCC_AHB2ENR_RNGEN))
  1135. #define __HAL_RCC_SDMMC2_CLK_DISABLE() (RCC->AHB2ENR &= ~ (RCC_AHB2ENR_SDMMC2EN))
  1136. #if defined(RCC_AHB2ENR_D2SRAM1EN)
  1137. #define __HAL_RCC_D2SRAM1_CLK_DISABLE() (RCC->AHB2ENR &= ~ (RCC_AHB2ENR_D2SRAM1EN))
  1138. #else
  1139. #define __HAL_RCC_AHBSRAM1_CLK_DISABLE() (RCC->AHB2ENR &= ~ (RCC_AHB2ENR_AHBSRAM1EN))
  1140. #endif /* RCC_AHB2ENR_D2SRAM1EN */
  1141. #if defined(RCC_AHB2ENR_D2SRAM2EN)
  1142. #define __HAL_RCC_D2SRAM2_CLK_DISABLE() (RCC->AHB2ENR &= ~ (RCC_AHB2ENR_D2SRAM2EN))
  1143. #else
  1144. #define __HAL_RCC_AHBSRAM2_CLK_DISABLE() (RCC->AHB2ENR &= ~ (RCC_AHB2ENR_AHBSRAM2EN))
  1145. #endif /* RCC_AHB2ENR_D2SRAM2EN */
  1146. #if defined(RCC_AHB2ENR_D2SRAM3EN)
  1147. #define __HAL_RCC_D2SRAM3_CLK_DISABLE() (RCC->AHB2ENR &= ~ (RCC_AHB2ENR_D2SRAM3EN))
  1148. #endif
  1149. #if defined(RCC_AHB2ENR_HSEMEN)
  1150. #define __HAL_RCC_HSEM_CLK_DISABLE() (RCC->AHB2ENR &= ~ (RCC_AHB2ENR_HSEMEN))
  1151. #endif
  1152. #if defined(BDMA1)
  1153. #define __HAL_RCC_BDMA1_CLK_DISABLE() (RCC->AHB2ENR &= ~ (RCC_AHB2ENR_BDMA1EN))
  1154. #endif
  1155. /** @brief Get the enable or disable status of the AHB2 peripheral clock
  1156. * @note After reset, the peripheral clock (used for registers read/write access)
  1157. * is disabled and the application software has to enable this clock before
  1158. * using it.
  1159. */
  1160. #if defined(DCMI) && defined(PSSI)
  1161. #define __HAL_RCC_DCMI_PSSI_IS_CLK_ENABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_DCMI_PSSIEN) != 0U)
  1162. #define __HAL_RCC_DCMI_IS_CLK_ENABLED() __HAL_RCC_DCMI_PSSI_IS_CLK_ENABLED() /* for API backward compatibility*/
  1163. #else
  1164. #define __HAL_RCC_DCMI_IS_CLK_ENABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_DCMIEN) != 0U)
  1165. #endif /* DCMI && PSSI */
  1166. #define __HAL_RCC_CRYP_IS_CLK_ENABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_CRYPEN) != 0U)
  1167. #define __HAL_RCC_HASH_IS_CLK_ENABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_HASHEN) != 0U)
  1168. #define __HAL_RCC_RNG_IS_CLK_ENABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_RNGEN) != 0U)
  1169. #define __HAL_RCC_SDMMC2_IS_CLK_ENABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_SDMMC2EN) != 0U)
  1170. #if defined(RCC_AHB2ENR_D2SRAM1EN)
  1171. #define __HAL_RCC_D2SRAM1_IS_CLK_ENABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_D2SRAM1EN) != 0U)
  1172. #else
  1173. #define __HAL_RCC_AHBSRAM1_IS_CLK_ENABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_AHBSRAM1EN) != 0U)
  1174. #endif /* RCC_AHB2ENR_D2SRAM1EN */
  1175. #if defined(RCC_AHB2ENR_D2SRAM2EN)
  1176. #define __HAL_RCC_D2SRAM2_IS_CLK_ENABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_D2SRAM2EN) != 0U)
  1177. #else
  1178. #define __HAL_RCC_AHBSRAM2_IS_CLK_ENABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_AHBSRAM2EN) != 0U)
  1179. #endif /* RCC_AHB2ENR_D2SRAM2EN */
  1180. #if defined(RCC_AHB2ENR_D2SRAM3EN)
  1181. #define __HAL_RCC_D2SRAM3_IS_CLK_ENABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_D2SRAM3EN) != 0U)
  1182. #endif
  1183. #if defined(RCC_AHB2ENR_HSEMEN)
  1184. #define __HAL_RCC_HSEM_IS_CLK_ENABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_HSEMEN) != 0U)
  1185. #endif
  1186. #if defined(BDMA1)
  1187. #define __HAL_RCC_BDMA1_IS_CLK_ENABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_BDMA1EN) != 0U)
  1188. #endif
  1189. #if defined(DCMI) && defined(PSSI)
  1190. #define __HAL_RCC_DCMI_PSSI_IS_CLK_DISABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_DCMI_PSSIEN) == 0U)
  1191. #define __HAL_RCC_DCMI_IS_CLK_DISABLED() __HAL_RCC_DCMI_PSSI_IS_CLK_DISABLED() /* for API backward compatibility*/
  1192. #else
  1193. #define __HAL_RCC_DCMI_IS_CLK_DISABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_DCMIEN) == 0U)
  1194. #endif /* DCMI && PSSI */
  1195. #define __HAL_RCC_CRYP_IS_CLK_DISABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_CRYPEN) == 0U)
  1196. #define __HAL_RCC_HASH_IS_CLK_DISABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_HASHEN) == 0U)
  1197. #define __HAL_RCC_RNG_IS_CLK_DISABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_RNGEN) == 0U)
  1198. #define __HAL_RCC_SDMMC2_IS_CLK_DISABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_SDMMC2EN) == 0U)
  1199. #if defined(RCC_AHB2ENR_D2SRAM1EN)
  1200. #define __HAL_RCC_D2SRAM1_IS_CLK_DISABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_D2SRAM1EN) == 0U)
  1201. #else
  1202. #define __HAL_RCC_AHBSRAM1_IS_CLK_DISABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_AHBSRAM1EN) == 0U)
  1203. #endif /* RCC_AHB2ENR_D2SRAM1EN */
  1204. #if defined(RCC_AHB2ENR_D2SRAM2EN)
  1205. #define __HAL_RCC_D2SRAM2_IS_CLK_DISABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_D2SRAM2EN) == 0U)
  1206. #else
  1207. #define __HAL_RCC_AHBSRAM2_IS_CLK_DISABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_AHBSRAM2EN) == 0U)
  1208. #endif /* RCC_AHB2ENR_D2SRAM2EN */
  1209. #if defined(RCC_AHB2ENR_D2SRAM3EN)
  1210. #define __HAL_RCC_D2SRAM3_IS_CLK_DISABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_D2SRAM3EN) == 0U)
  1211. #endif
  1212. #if defined(RCC_AHB2ENR_HSEMEN)
  1213. #define __HAL_RCC_HSEM_IS_CLK_DISABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_HSEMEN) == 0U)
  1214. #endif
  1215. #if defined(BDMA1)
  1216. #define __HAL_RCC_BDMA1_IS_CLK_DISABLED() ((RCC->AHB2ENR & RCC_AHB2ENR_BDMA1EN) == 0U)
  1217. #endif
  1218. /** @brief Enable or disable the AHB4 peripheral clock.
  1219. * @note After reset, the peripheral clock (used for registers read/write access)
  1220. * is disabled and the application software has to enable this clock before
  1221. * using it.
  1222. */
  1223. #define __HAL_RCC_GPIOA_CLK_ENABLE() do { \
  1224. __IO uint32_t tmpreg; \
  1225. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOAEN);\
  1226. /* Delay after an RCC peripheral clock enabling */ \
  1227. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOAEN);\
  1228. UNUSED(tmpreg); \
  1229. } while(0)
  1230. #define __HAL_RCC_GPIOB_CLK_ENABLE() do { \
  1231. __IO uint32_t tmpreg; \
  1232. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOBEN);\
  1233. /* Delay after an RCC peripheral clock enabling */ \
  1234. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOBEN);\
  1235. UNUSED(tmpreg); \
  1236. } while(0)
  1237. #define __HAL_RCC_GPIOC_CLK_ENABLE() do { \
  1238. __IO uint32_t tmpreg; \
  1239. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOCEN);\
  1240. /* Delay after an RCC peripheral clock enabling */ \
  1241. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOCEN);\
  1242. UNUSED(tmpreg); \
  1243. } while(0)
  1244. #define __HAL_RCC_GPIOD_CLK_ENABLE() do { \
  1245. __IO uint32_t tmpreg; \
  1246. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIODEN);\
  1247. /* Delay after an RCC peripheral clock enabling */ \
  1248. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIODEN);\
  1249. UNUSED(tmpreg); \
  1250. } while(0)
  1251. #define __HAL_RCC_GPIOE_CLK_ENABLE() do { \
  1252. __IO uint32_t tmpreg; \
  1253. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOEEN);\
  1254. /* Delay after an RCC peripheral clock enabling */ \
  1255. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOEEN);\
  1256. UNUSED(tmpreg); \
  1257. } while(0)
  1258. #define __HAL_RCC_GPIOF_CLK_ENABLE() do { \
  1259. __IO uint32_t tmpreg; \
  1260. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOFEN);\
  1261. /* Delay after an RCC peripheral clock enabling */ \
  1262. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOFEN);\
  1263. UNUSED(tmpreg); \
  1264. } while(0)
  1265. #define __HAL_RCC_GPIOG_CLK_ENABLE() do { \
  1266. __IO uint32_t tmpreg; \
  1267. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOGEN);\
  1268. /* Delay after an RCC peripheral clock enabling */ \
  1269. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOGEN);\
  1270. UNUSED(tmpreg); \
  1271. } while(0)
  1272. #define __HAL_RCC_GPIOH_CLK_ENABLE() do { \
  1273. __IO uint32_t tmpreg; \
  1274. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOHEN);\
  1275. /* Delay after an RCC peripheral clock enabling */ \
  1276. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOHEN);\
  1277. UNUSED(tmpreg); \
  1278. } while(0)
  1279. #define __HAL_RCC_GPIOI_CLK_ENABLE() do { \
  1280. __IO uint32_t tmpreg; \
  1281. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOIEN);\
  1282. /* Delay after an RCC peripheral clock enabling */ \
  1283. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOIEN);\
  1284. UNUSED(tmpreg); \
  1285. } while(0)
  1286. #define __HAL_RCC_GPIOJ_CLK_ENABLE() do { \
  1287. __IO uint32_t tmpreg; \
  1288. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOJEN);\
  1289. /* Delay after an RCC peripheral clock enabling */ \
  1290. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOJEN);\
  1291. UNUSED(tmpreg); \
  1292. } while(0)
  1293. #define __HAL_RCC_GPIOK_CLK_ENABLE() do { \
  1294. __IO uint32_t tmpreg; \
  1295. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOKEN);\
  1296. /* Delay after an RCC peripheral clock enabling */ \
  1297. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_GPIOKEN);\
  1298. UNUSED(tmpreg); \
  1299. } while(0)
  1300. #if defined(RCC_AHB4ENR_CRCEN)
  1301. #define __HAL_RCC_CRC_CLK_ENABLE() do { \
  1302. __IO uint32_t tmpreg; \
  1303. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_CRCEN);\
  1304. /* Delay after an RCC peripheral clock enabling */ \
  1305. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_CRCEN);\
  1306. UNUSED(tmpreg); \
  1307. } while(0)
  1308. #endif
  1309. #if defined(BDMA2)
  1310. #define __HAL_RCC_BDMA2_CLK_ENABLE() do { \
  1311. __IO uint32_t tmpreg; \
  1312. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_BDMA2EN);\
  1313. /* Delay after an RCC peripheral clock enabling */ \
  1314. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_BDMA2EN);\
  1315. UNUSED(tmpreg); \
  1316. } while(0)
  1317. #define __HAL_RCC_BDMA_CLK_ENABLE() __HAL_RCC_BDMA2_CLK_ENABLE() /* for API backward compatibility*/
  1318. #else
  1319. #define __HAL_RCC_BDMA_CLK_ENABLE() do { \
  1320. __IO uint32_t tmpreg; \
  1321. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_BDMAEN);\
  1322. /* Delay after an RCC peripheral clock enabling */ \
  1323. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_BDMAEN);\
  1324. UNUSED(tmpreg); \
  1325. } while(0)
  1326. #endif
  1327. #if defined(ADC3)
  1328. #define __HAL_RCC_ADC3_CLK_ENABLE() do { \
  1329. __IO uint32_t tmpreg; \
  1330. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_ADC3EN);\
  1331. /* Delay after an RCC peripheral clock enabling */ \
  1332. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_ADC3EN);\
  1333. UNUSED(tmpreg); \
  1334. } while(0)
  1335. #endif
  1336. #if defined(RCC_AHB4ENR_HSEMEN)
  1337. #define __HAL_RCC_HSEM_CLK_ENABLE() do { \
  1338. __IO uint32_t tmpreg; \
  1339. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_HSEMEN);\
  1340. /* Delay after an RCC peripheral clock enabling */ \
  1341. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_HSEMEN);\
  1342. UNUSED(tmpreg); \
  1343. } while(0)
  1344. #endif
  1345. #if defined(RCC_AHB4ENR_SRDSRAMEN)
  1346. #define __HAL_RCC_SRDSRAM_CLK_ENABLE() do { \
  1347. __IO uint32_t tmpreg; \
  1348. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_SRDSRAMEN);\
  1349. /* Delay after an RCC peripheral clock enabling */ \
  1350. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_SRDSRAMEN);\
  1351. UNUSED(tmpreg); \
  1352. } while(0)
  1353. #endif
  1354. #define __HAL_RCC_BKPRAM_CLK_ENABLE() do { \
  1355. __IO uint32_t tmpreg; \
  1356. SET_BIT(RCC->AHB4ENR, RCC_AHB4ENR_BKPRAMEN);\
  1357. /* Delay after an RCC peripheral clock enabling */ \
  1358. tmpreg = READ_BIT(RCC->AHB4ENR, RCC_AHB4ENR_BKPRAMEN);\
  1359. UNUSED(tmpreg); \
  1360. } while(0)
  1361. #define __HAL_RCC_GPIOA_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOAEN)
  1362. #define __HAL_RCC_GPIOB_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOBEN)
  1363. #define __HAL_RCC_GPIOC_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOCEN)
  1364. #define __HAL_RCC_GPIOD_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIODEN)
  1365. #define __HAL_RCC_GPIOE_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOEEN)
  1366. #define __HAL_RCC_GPIOF_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOFEN)
  1367. #define __HAL_RCC_GPIOG_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOGEN)
  1368. #define __HAL_RCC_GPIOH_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOHEN)
  1369. #define __HAL_RCC_GPIOI_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOIEN)
  1370. #define __HAL_RCC_GPIOJ_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOJEN)
  1371. #define __HAL_RCC_GPIOK_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOKEN)
  1372. #if defined(RCC_AHB4ENR_CRCEN)
  1373. #define __HAL_RCC_CRC_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_CRCEN)
  1374. #endif
  1375. #if defined(BDMA2)
  1376. #define __HAL_RCC_BDMA2_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_BDMA2EN)
  1377. #define __HAL_RCC_BDMA_CLK_DISABLE() __HAL_RCC_BDMA2_CLK_DISABLE() /* for API backward compatibility*/
  1378. #else
  1379. #define __HAL_RCC_BDMA_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_BDMAEN)
  1380. #endif
  1381. #if defined(ADC3)
  1382. #define __HAL_RCC_ADC3_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_ADC3EN)
  1383. #endif
  1384. #if defined(RCC_AHB4ENR_HSEMEN)
  1385. #define __HAL_RCC_HSEM_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_HSEMEN)
  1386. #endif
  1387. #if defined(RCC_AHB4ENR_SRDSRAMEN)
  1388. #define __HAL_RCC_SRDSRAM_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_SRDSRAMEN)
  1389. #endif
  1390. #define __HAL_RCC_BKPRAM_CLK_DISABLE() (RCC->AHB4ENR) &= ~ (RCC_AHB4ENR_BKPRAMEN)
  1391. /** @brief Get the enable or disable status of the AHB4 peripheral clock
  1392. * @note After reset, the peripheral clock (used for registers read/write access)
  1393. * is disabled and the application software has to enable this clock before
  1394. * using it.
  1395. */
  1396. #define __HAL_RCC_GPIOA_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOAEN) != 0U)
  1397. #define __HAL_RCC_GPIOB_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOBEN) != 0U)
  1398. #define __HAL_RCC_GPIOC_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOCEN) != 0U)
  1399. #define __HAL_RCC_GPIOD_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIODEN) != 0U)
  1400. #define __HAL_RCC_GPIOE_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOEEN) != 0U)
  1401. #define __HAL_RCC_GPIOF_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOFEN) != 0U)
  1402. #define __HAL_RCC_GPIOG_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOGEN) != 0U)
  1403. #define __HAL_RCC_GPIOH_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOHEN) != 0U)
  1404. #define __HAL_RCC_GPIOI_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOIEN) != 0U)
  1405. #define __HAL_RCC_GPIOJ_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOJEN) != 0U)
  1406. #define __HAL_RCC_GPIOK_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOKEN) != 0U)
  1407. #if defined(RCC_AHB4ENR_CRCEN)
  1408. #define __HAL_RCC_CRC_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_CRCEN) != 0U)
  1409. #endif
  1410. #if defined(BDMA2)
  1411. #define __HAL_RCC_BDMA2_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_BDMA2EN) != 0U)
  1412. #define __HAL_RCC_BDMA_IS_CLK_ENABLED() __HAL_RCC_BDMA2_IS_CLK_ENABLED() /* for API backward compatibility*/
  1413. #else
  1414. #define __HAL_RCC_BDMA_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_BDMAEN) != 0U)
  1415. #endif
  1416. #if defined(ADC3)
  1417. #define __HAL_RCC_ADC3_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_ADC3EN) != 0U)
  1418. #endif
  1419. #if defined(RCC_AHB4ENR_HSEMEN)
  1420. #define __HAL_RCC_HSEM_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_HSEMEN) != 0U)
  1421. #endif
  1422. #if defined(RCC_AHB4ENR_SRDSRAMEN)
  1423. #define __HAL_RCC_SRDSRAM_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_SRDSRAMEN) != 0U)
  1424. #endif
  1425. #define __HAL_RCC_BKPRAM_IS_CLK_ENABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_BKPRAMEN) != 0U)
  1426. #define __HAL_RCC_GPIOA_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOAEN) == 0U)
  1427. #define __HAL_RCC_GPIOB_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOBEN) == 0U)
  1428. #define __HAL_RCC_GPIOC_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOCEN) == 0U)
  1429. #define __HAL_RCC_GPIOD_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIODEN) == 0U)
  1430. #define __HAL_RCC_GPIOE_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOEEN) == 0U)
  1431. #define __HAL_RCC_GPIOF_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOFEN) == 0U)
  1432. #define __HAL_RCC_GPIOG_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOGEN) == 0U)
  1433. #define __HAL_RCC_GPIOH_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOHEN) == 0U)
  1434. #define __HAL_RCC_GPIOI_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOIEN) == 0U)
  1435. #define __HAL_RCC_GPIOJ_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOJEN) == 0U)
  1436. #define __HAL_RCC_GPIOK_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_GPIOKEN) == 0U)
  1437. #if defined(RCC_AHB4ENR_CRCEN)
  1438. #define __HAL_RCC_CRC_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_CRCEN) == 0U)
  1439. #endif
  1440. #if defined(BDMA2)
  1441. #define __HAL_RCC_BDMA2_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_BDMA2EN) == 0U)
  1442. #define __HAL_RCC_BDMA_IS_CLK_DISABLED() __HAL_RCC_BDMA2_IS_CLK_DISABLED() /* for API backward compatibility*/
  1443. #else
  1444. #define __HAL_RCC_BDMA_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_BDMAEN) == 0U)
  1445. #endif
  1446. #if defined(ADC3)
  1447. #define __HAL_RCC_ADC3_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_ADC3EN) == 0U)
  1448. #endif
  1449. #if defined(RCC_AHB4ENR_HSEMEN)
  1450. #define __HAL_RCC_HSEM_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_HSEMEN) == 0U)
  1451. #endif
  1452. #if defined(RCC_AHB4ENR_SRDSRAMEN)
  1453. #define __HAL_RCC_SRDSRAM_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_SRDSRAMEN) == 0U)
  1454. #endif
  1455. #define __HAL_RCC_BKPRAM_IS_CLK_DISABLED() ((RCC->AHB4ENR & RCC_AHB4ENR_BKPRAMEN) == 0U)
  1456. /** @brief Enable or disable the APB3 peripheral clock.
  1457. * @note After reset, the peripheral clock (used for registers read/write access)
  1458. * is disabled and the application software has to enable this clock before
  1459. * using it.
  1460. */
  1461. #if defined(LTDC)
  1462. #define __HAL_RCC_LTDC_CLK_ENABLE() do { \
  1463. __IO uint32_t tmpreg; \
  1464. SET_BIT(RCC->APB3ENR, RCC_APB3ENR_LTDCEN);\
  1465. /* Delay after an RCC peripheral clock enabling */ \
  1466. tmpreg = READ_BIT(RCC->APB3ENR, RCC_APB3ENR_LTDCEN);\
  1467. UNUSED(tmpreg); \
  1468. } while(0)
  1469. #endif /* LTDC */
  1470. #if defined(DSI)
  1471. #define __HAL_RCC_DSI_CLK_ENABLE() do { \
  1472. __IO uint32_t tmpreg; \
  1473. SET_BIT(RCC->APB3ENR, RCC_APB3ENR_DSIEN);\
  1474. /* Delay after an RCC peripheral clock enabling */ \
  1475. tmpreg = READ_BIT(RCC->APB3ENR, RCC_APB3ENR_DSIEN);\
  1476. UNUSED(tmpreg); \
  1477. } while(0)
  1478. #endif /*DSI*/
  1479. #define __HAL_RCC_WWDG1_CLK_ENABLE() do { \
  1480. __IO uint32_t tmpreg; \
  1481. SET_BIT(RCC->APB3ENR, RCC_APB3ENR_WWDG1EN);\
  1482. /* Delay after an RCC peripheral clock enabling */ \
  1483. tmpreg = READ_BIT(RCC->APB3ENR, RCC_APB3ENR_WWDG1EN);\
  1484. UNUSED(tmpreg); \
  1485. } while(0)
  1486. #if defined(LTDC)
  1487. #define __HAL_RCC_LTDC_CLK_DISABLE() (RCC->APB3ENR) &= ~ (RCC_APB3ENR_LTDCEN)
  1488. #endif /* LTDC */
  1489. #if defined(DSI)
  1490. #define __HAL_RCC_DSI_CLK_DISABLE() (RCC->APB3ENR) &= ~ (RCC_APB3ENR_DSIEN)
  1491. #endif /*DSI*/
  1492. #define __HAL_RCC_WWDG1_CLK_DISABLE() (RCC->APB3ENR) &= ~ (RCC_APB3ENR_WWDG1EN)
  1493. /** @brief Get the enable or disable status of the APB3 peripheral clock
  1494. * @note After reset, the peripheral clock (used for registers read/write access)
  1495. * is disabled and the application software has to enable this clock before
  1496. * using it.
  1497. */
  1498. #if defined(LTDC)
  1499. #define __HAL_RCC_LTDC_IS_CLK_ENABLED() ((RCC->APB3ENR & RCC_APB3ENR_LTDCEN) != 0U)
  1500. #endif /* LTDC */
  1501. #if defined(DSI)
  1502. #define __HAL_RCC_DSI_IS_CLK_ENABLED() ((RCC->APB3ENR & RCC_APB3ENR_DSIEN) != 0U)
  1503. #endif /*DSI*/
  1504. #define __HAL_RCC_WWDG1_IS_CLK_ENABLED() ((RCC->APB3ENR & RCC_APB3ENR_WWDG1EN) != 0U)
  1505. #if defined(LTDC)
  1506. #define __HAL_RCC_LTDC_IS_CLK_DISABLED() ((RCC->APB3ENR & RCC_APB3ENR_LTDCEN) == 0U)
  1507. #endif /* LTDC */
  1508. #if defined(DSI)
  1509. #define __HAL_RCC_DSI_IS_CLK_DISABLED() ((RCC->APB3ENR & RCC_APB3ENR_DSIEN) == 0U)
  1510. #endif /*DSI*/
  1511. #define __HAL_RCC_WWDG1_IS_CLK_DISABLED() ((RCC->APB3ENR & RCC_APB3ENR_WWDG1EN) == 0U)
  1512. /** @brief Enable or disable the APB1 peripheral clock.
  1513. * @note After reset, the peripheral clock (used for registers read/write access)
  1514. * is disabled and the application software has to enable this clock before
  1515. * using it.
  1516. */
  1517. #define __HAL_RCC_TIM2_CLK_ENABLE() do { \
  1518. __IO uint32_t tmpreg; \
  1519. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM2EN);\
  1520. /* Delay after an RCC peripheral clock enabling */ \
  1521. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM2EN);\
  1522. UNUSED(tmpreg); \
  1523. } while(0)
  1524. #define __HAL_RCC_TIM3_CLK_ENABLE() do { \
  1525. __IO uint32_t tmpreg; \
  1526. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM3EN);\
  1527. /* Delay after an RCC peripheral clock enabling */ \
  1528. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM3EN);\
  1529. UNUSED(tmpreg); \
  1530. } while(0)
  1531. #define __HAL_RCC_TIM4_CLK_ENABLE() do { \
  1532. __IO uint32_t tmpreg; \
  1533. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM4EN);\
  1534. /* Delay after an RCC peripheral clock enabling */ \
  1535. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM4EN);\
  1536. UNUSED(tmpreg); \
  1537. } while(0)
  1538. #define __HAL_RCC_TIM5_CLK_ENABLE() do { \
  1539. __IO uint32_t tmpreg; \
  1540. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM5EN);\
  1541. /* Delay after an RCC peripheral clock enabling */ \
  1542. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM5EN);\
  1543. UNUSED(tmpreg); \
  1544. } while(0)
  1545. #define __HAL_RCC_TIM6_CLK_ENABLE() do { \
  1546. __IO uint32_t tmpreg; \
  1547. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM6EN);\
  1548. /* Delay after an RCC peripheral clock enabling */ \
  1549. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM6EN);\
  1550. UNUSED(tmpreg); \
  1551. } while(0)
  1552. #define __HAL_RCC_TIM7_CLK_ENABLE() do { \
  1553. __IO uint32_t tmpreg; \
  1554. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM7EN);\
  1555. /* Delay after an RCC peripheral clock enabling */ \
  1556. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM7EN);\
  1557. UNUSED(tmpreg); \
  1558. } while(0)
  1559. #define __HAL_RCC_TIM12_CLK_ENABLE() do { \
  1560. __IO uint32_t tmpreg; \
  1561. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM12EN);\
  1562. /* Delay after an RCC peripheral clock enabling */ \
  1563. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM12EN);\
  1564. UNUSED(tmpreg); \
  1565. } while(0)
  1566. #define __HAL_RCC_TIM13_CLK_ENABLE() do { \
  1567. __IO uint32_t tmpreg; \
  1568. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM13EN);\
  1569. /* Delay after an RCC peripheral clock enabling */ \
  1570. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM13EN);\
  1571. UNUSED(tmpreg); \
  1572. } while(0)
  1573. #define __HAL_RCC_TIM14_CLK_ENABLE() do { \
  1574. __IO uint32_t tmpreg; \
  1575. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM14EN);\
  1576. /* Delay after an RCC peripheral clock enabling */ \
  1577. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_TIM14EN);\
  1578. UNUSED(tmpreg); \
  1579. } while(0)
  1580. #define __HAL_RCC_LPTIM1_CLK_ENABLE() do { \
  1581. __IO uint32_t tmpreg; \
  1582. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_LPTIM1EN);\
  1583. /* Delay after an RCC peripheral clock enabling */ \
  1584. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_LPTIM1EN);\
  1585. UNUSED(tmpreg); \
  1586. } while(0)
  1587. #if defined(DUAL_CORE)
  1588. #define __HAL_RCC_WWDG2_CLK_ENABLE() do { \
  1589. __IO uint32_t tmpreg; \
  1590. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_WWDG2EN);\
  1591. /* Delay after an RCC peripheral clock enabling */ \
  1592. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_WWDG2EN);\
  1593. UNUSED(tmpreg); \
  1594. } while(0)
  1595. #endif /*DUAL_CORE*/
  1596. #define __HAL_RCC_SPI2_CLK_ENABLE() do { \
  1597. __IO uint32_t tmpreg; \
  1598. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_SPI2EN);\
  1599. /* Delay after an RCC peripheral clock enabling */ \
  1600. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_SPI2EN);\
  1601. UNUSED(tmpreg); \
  1602. } while(0)
  1603. #define __HAL_RCC_SPI3_CLK_ENABLE() do { \
  1604. __IO uint32_t tmpreg; \
  1605. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_SPI3EN);\
  1606. /* Delay after an RCC peripheral clock enabling */ \
  1607. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_SPI3EN);\
  1608. UNUSED(tmpreg); \
  1609. } while(0)
  1610. #define __HAL_RCC_SPDIFRX_CLK_ENABLE() do { \
  1611. __IO uint32_t tmpreg; \
  1612. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_SPDIFRXEN);\
  1613. /* Delay after an RCC peripheral clock enabling */ \
  1614. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_SPDIFRXEN);\
  1615. UNUSED(tmpreg); \
  1616. } while(0)
  1617. #define __HAL_RCC_USART2_CLK_ENABLE() do { \
  1618. __IO uint32_t tmpreg; \
  1619. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_USART2EN);\
  1620. /* Delay after an RCC peripheral clock enabling */ \
  1621. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_USART2EN);\
  1622. UNUSED(tmpreg); \
  1623. } while(0)
  1624. #define __HAL_RCC_USART3_CLK_ENABLE() do { \
  1625. __IO uint32_t tmpreg; \
  1626. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_USART3EN);\
  1627. /* Delay after an RCC peripheral clock enabling */ \
  1628. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_USART3EN);\
  1629. UNUSED(tmpreg); \
  1630. } while(0)
  1631. #define __HAL_RCC_UART4_CLK_ENABLE() do { \
  1632. __IO uint32_t tmpreg; \
  1633. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_UART4EN);\
  1634. /* Delay after an RCC peripheral clock enabling */ \
  1635. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_UART4EN);\
  1636. UNUSED(tmpreg); \
  1637. } while(0)
  1638. #define __HAL_RCC_UART5_CLK_ENABLE() do { \
  1639. __IO uint32_t tmpreg; \
  1640. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_UART5EN);\
  1641. /* Delay after an RCC peripheral clock enabling */ \
  1642. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_UART5EN);\
  1643. UNUSED(tmpreg); \
  1644. } while(0)
  1645. #define __HAL_RCC_I2C1_CLK_ENABLE() do { \
  1646. __IO uint32_t tmpreg; \
  1647. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_I2C1EN);\
  1648. /* Delay after an RCC peripheral clock enabling */ \
  1649. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_I2C1EN);\
  1650. UNUSED(tmpreg); \
  1651. } while(0)
  1652. #define __HAL_RCC_I2C2_CLK_ENABLE() do { \
  1653. __IO uint32_t tmpreg; \
  1654. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_I2C2EN);\
  1655. /* Delay after an RCC peripheral clock enabling */ \
  1656. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_I2C2EN);\
  1657. UNUSED(tmpreg); \
  1658. } while(0)
  1659. #define __HAL_RCC_I2C3_CLK_ENABLE() do { \
  1660. __IO uint32_t tmpreg; \
  1661. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_I2C3EN);\
  1662. /* Delay after an RCC peripheral clock enabling */ \
  1663. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_I2C3EN);\
  1664. UNUSED(tmpreg); \
  1665. } while(0)
  1666. #define __HAL_RCC_CEC_CLK_ENABLE() do { \
  1667. __IO uint32_t tmpreg; \
  1668. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_CECEN);\
  1669. /* Delay after an RCC peripheral clock enabling */ \
  1670. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_CECEN);\
  1671. UNUSED(tmpreg); \
  1672. } while(0)
  1673. #define __HAL_RCC_DAC12_CLK_ENABLE() do { \
  1674. __IO uint32_t tmpreg; \
  1675. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_DAC12EN);\
  1676. /* Delay after an RCC peripheral clock enabling */ \
  1677. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_DAC12EN);\
  1678. UNUSED(tmpreg); \
  1679. } while(0)
  1680. #define __HAL_RCC_UART7_CLK_ENABLE() do { \
  1681. __IO uint32_t tmpreg; \
  1682. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_UART7EN);\
  1683. /* Delay after an RCC peripheral clock enabling */ \
  1684. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_UART7EN);\
  1685. UNUSED(tmpreg); \
  1686. } while(0)
  1687. #define __HAL_RCC_UART8_CLK_ENABLE() do { \
  1688. __IO uint32_t tmpreg; \
  1689. SET_BIT(RCC->APB1LENR, RCC_APB1LENR_UART8EN);\
  1690. /* Delay after an RCC peripheral clock enabling */ \
  1691. tmpreg = READ_BIT(RCC->APB1LENR, RCC_APB1LENR_UART8EN);\
  1692. UNUSED(tmpreg); \
  1693. } while(0)
  1694. #define __HAL_RCC_CRS_CLK_ENABLE() do { \
  1695. __IO uint32_t tmpreg; \
  1696. SET_BIT(RCC->APB1HENR, RCC_APB1HENR_CRSEN);\
  1697. /* Delay after an RCC peripheral clock enabling */ \
  1698. tmpreg = READ_BIT(RCC->APB1HENR, RCC_APB1HENR_CRSEN);\
  1699. UNUSED(tmpreg); \
  1700. } while(0)
  1701. #define __HAL_RCC_SWPMI1_CLK_ENABLE() do { \
  1702. __IO uint32_t tmpreg; \
  1703. SET_BIT(RCC->APB1HENR, RCC_APB1HENR_SWPMIEN);\
  1704. /* Delay after an RCC peripheral clock enabling */ \
  1705. tmpreg = READ_BIT(RCC->APB1HENR, RCC_APB1HENR_SWPMIEN);\
  1706. UNUSED(tmpreg); \
  1707. } while(0)
  1708. #define __HAL_RCC_OPAMP_CLK_ENABLE() do { \
  1709. __IO uint32_t tmpreg; \
  1710. SET_BIT(RCC->APB1HENR, RCC_APB1HENR_OPAMPEN);\
  1711. /* Delay after an RCC peripheral clock enabling */ \
  1712. tmpreg = READ_BIT(RCC->APB1HENR, RCC_APB1HENR_OPAMPEN);\
  1713. UNUSED(tmpreg); \
  1714. } while(0)
  1715. #define __HAL_RCC_MDIOS_CLK_ENABLE() do { \
  1716. __IO uint32_t tmpreg; \
  1717. SET_BIT(RCC->APB1HENR, RCC_APB1HENR_MDIOSEN);\
  1718. /* Delay after an RCC peripheral clock enabling */ \
  1719. tmpreg = READ_BIT(RCC->APB1HENR, RCC_APB1HENR_MDIOSEN);\
  1720. UNUSED(tmpreg); \
  1721. } while(0)
  1722. #define __HAL_RCC_FDCAN_CLK_ENABLE() do { \
  1723. __IO uint32_t tmpreg; \
  1724. SET_BIT(RCC->APB1HENR, RCC_APB1HENR_FDCANEN);\
  1725. /* Delay after an RCC peripheral clock enabling */ \
  1726. tmpreg = READ_BIT(RCC->APB1HENR, RCC_APB1HENR_FDCANEN);\
  1727. UNUSED(tmpreg); \
  1728. } while(0)
  1729. #define __HAL_RCC_TIM2_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_TIM2EN)
  1730. #define __HAL_RCC_TIM3_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_TIM3EN)
  1731. #define __HAL_RCC_TIM4_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_TIM4EN)
  1732. #define __HAL_RCC_TIM5_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_TIM5EN)
  1733. #define __HAL_RCC_TIM6_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_TIM6EN)
  1734. #define __HAL_RCC_TIM7_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_TIM7EN)
  1735. #define __HAL_RCC_TIM12_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_TIM12EN)
  1736. #define __HAL_RCC_TIM13_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_TIM13EN)
  1737. #define __HAL_RCC_TIM14_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_TIM14EN)
  1738. #define __HAL_RCC_LPTIM1_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_LPTIM1EN)
  1739. #if defined(DUAL_CORE)
  1740. #define __HAL_RCC_WWDG2_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_WWDG2EN)
  1741. #endif /*DUAL_CORE*/
  1742. #define __HAL_RCC_SPI2_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_SPI2EN)
  1743. #define __HAL_RCC_SPI3_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_SPI3EN)
  1744. #define __HAL_RCC_SPDIFRX_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_SPDIFRXEN)
  1745. #define __HAL_RCC_USART2_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_USART2EN)
  1746. #define __HAL_RCC_USART3_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_USART3EN)
  1747. #define __HAL_RCC_UART4_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_UART4EN)
  1748. #define __HAL_RCC_UART5_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_UART5EN)
  1749. #define __HAL_RCC_I2C1_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_I2C1EN)
  1750. #define __HAL_RCC_I2C2_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_I2C2EN)
  1751. #define __HAL_RCC_I2C3_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_I2C3EN)
  1752. #define __HAL_RCC_CEC_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_CECEN)
  1753. #define __HAL_RCC_DAC12_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_DAC12EN)
  1754. #define __HAL_RCC_UART7_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_UART7EN)
  1755. #define __HAL_RCC_UART8_CLK_DISABLE() (RCC->APB1LENR) &= ~ (RCC_APB1LENR_UART8EN)
  1756. #define __HAL_RCC_CRS_CLK_DISABLE() (RCC->APB1HENR) &= ~ (RCC_APB1HENR_CRSEN)
  1757. #define __HAL_RCC_SWPMI1_CLK_DISABLE() (RCC->APB1HENR) &= ~ (RCC_APB1HENR_SWPMIEN)
  1758. #define __HAL_RCC_OPAMP_CLK_DISABLE() (RCC->APB1HENR) &= ~ (RCC_APB1HENR_OPAMPEN)
  1759. #define __HAL_RCC_MDIOS_CLK_DISABLE() (RCC->APB1HENR) &= ~ (RCC_APB1HENR_MDIOSEN)
  1760. #define __HAL_RCC_FDCAN_CLK_DISABLE() (RCC->APB1HENR) &= ~ (RCC_APB1HENR_FDCANEN)
  1761. /** @brief Get the enable or disable status of the APB1 peripheral clock
  1762. * @note After reset, the peripheral clock (used for registers read/write access)
  1763. * is disabled and the application software has to enable this clock before
  1764. * using it.
  1765. */
  1766. #define __HAL_RCC_TIM2_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM2EN) != 0U)
  1767. #define __HAL_RCC_TIM3_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM3EN) != 0U)
  1768. #define __HAL_RCC_TIM4_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM4EN) != 0U)
  1769. #define __HAL_RCC_TIM5_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM5EN) != 0U)
  1770. #define __HAL_RCC_TIM6_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM6EN) != 0U)
  1771. #define __HAL_RCC_TIM7_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM7EN) != 0U)
  1772. #define __HAL_RCC_TIM12_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM12EN) != 0U)
  1773. #define __HAL_RCC_TIM13_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM13EN) != 0U)
  1774. #define __HAL_RCC_TIM14_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM14EN) != 0U)
  1775. #define __HAL_RCC_LPTIM1_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_LPTIM1EN) != 0U)
  1776. #if defined(DUAL_CORE)
  1777. #define __HAL_RCC_WWDG2_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_WWDG2EN) != 0U)
  1778. #endif /*DUAL_CORE*/
  1779. #define __HAL_RCC_SPI2_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_SPI2EN) != 0U)
  1780. #define __HAL_RCC_SPI3_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_SPI3EN) != 0U)
  1781. #define __HAL_RCC_SPDIFRX_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_SPDIFRXEN) != 0U)
  1782. #define __HAL_RCC_USART2_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_USART2EN) != 0U)
  1783. #define __HAL_RCC_USART3_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_USART3EN) != 0U)
  1784. #define __HAL_RCC_UART4_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_UART4EN) != 0U)
  1785. #define __HAL_RCC_UART5_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_UART5EN) != 0U)
  1786. #define __HAL_RCC_I2C1_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_I2C1EN) != 0U)
  1787. #define __HAL_RCC_I2C2_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_I2C2EN) != 0U)
  1788. #define __HAL_RCC_I2C3_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_I2C3EN) != 0U)
  1789. #define __HAL_RCC_CEC_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_CECEN) != 0U)
  1790. #define __HAL_RCC_DAC12_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_DAC12EN) != 0U)
  1791. #define __HAL_RCC_UART7_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_UART7EN) != 0U)
  1792. #define __HAL_RCC_UART8_IS_CLK_ENABLED() ((RCC->APB1LENR & RCC_APB1LENR_UART8EN) != 0U)
  1793. #define __HAL_RCC_CRS_IS_CLK_ENABLED() ((RCC->APB1HENR & RCC_APB1HENR_CRSEN) != 0U)
  1794. #define __HAL_RCC_SWPMI1_IS_CLK_ENABLED() ((RCC->APB1HENR & RCC_APB1HENR_SWPMIEN) != 0U)
  1795. #define __HAL_RCC_OPAMP_IS_CLK_ENABLED() ((RCC->APB1HENR & RCC_APB1HENR_OPAMPEN) != 0U)
  1796. #define __HAL_RCC_MDIOS_IS_CLK_ENABLED() ((RCC->APB1HENR & RCC_APB1HENR_MDIOSEN) != 0U)
  1797. #define __HAL_RCC_FDCAN_IS_CLK_ENABLED() ((RCC->APB1HENR & RCC_APB1HENR_FDCANEN) != 0U)
  1798. #define __HAL_RCC_TIM2_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM2EN) == 0U)
  1799. #define __HAL_RCC_TIM3_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM3EN) == 0U)
  1800. #define __HAL_RCC_TIM4_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM4EN) == 0U)
  1801. #define __HAL_RCC_TIM5_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM5EN) == 0U)
  1802. #define __HAL_RCC_TIM6_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM6EN) == 0U)
  1803. #define __HAL_RCC_TIM7_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM7EN) == 0U)
  1804. #define __HAL_RCC_TIM12_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM12EN) == 0U)
  1805. #define __HAL_RCC_TIM13_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM13EN) == 0U)
  1806. #define __HAL_RCC_TIM14_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_TIM14EN) == 0U)
  1807. #define __HAL_RCC_LPTIM1_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_LPTIM1EN) == 0U)
  1808. #if defined(DUAL_CORE)
  1809. #define __HAL_RCC_WWDG2_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_WWDG2EN) == 0U)
  1810. #endif /*DUAL_CORE*/
  1811. #define __HAL_RCC_SPI2_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_SPI2EN) == 0U)
  1812. #define __HAL_RCC_SPI3_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_SPI3EN) == 0U)
  1813. #define __HAL_RCC_SPDIFRX_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_SPDIFRXEN) == 0U)
  1814. #define __HAL_RCC_USART2_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_USART2EN) == 0U)
  1815. #define __HAL_RCC_USART3_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_USART3EN) == 0U)
  1816. #define __HAL_RCC_UART4_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_UART4EN) == 0U)
  1817. #define __HAL_RCC_UART5_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_UART5EN) == 0U)
  1818. #define __HAL_RCC_I2C1_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_I2C1EN) == 0U)
  1819. #define __HAL_RCC_I2C2_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_I2C2EN) == 0U)
  1820. #define __HAL_RCC_I2C3_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_I2C3EN) == 0U)
  1821. #define __HAL_RCC_CEC_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_CECEN) == 0U)
  1822. #define __HAL_RCC_DAC12_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_DAC12EN) == 0U)
  1823. #define __HAL_RCC_UART7_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_UART7EN) == 0U)
  1824. #define __HAL_RCC_UART8_IS_CLK_DISABLED() ((RCC->APB1LENR & RCC_APB1LENR_UART8EN) == 0U)
  1825. #define __HAL_RCC_CRS_IS_CLK_DISABLED() ((RCC->APB1HENR & RCC_APB1HENR_CRSEN) == 0U)
  1826. #define __HAL_RCC_SWPMI1_IS_CLK_DISABLED() ((RCC->APB1HENR & RCC_APB1HENR_SWPMIEN) == 0U)
  1827. #define __HAL_RCC_OPAMP_IS_CLK_DISABLED() ((RCC->APB1HENR & RCC_APB1HENR_OPAMPEN) == 0U)
  1828. #define __HAL_RCC_MDIOS_IS_CLK_DISABLED() ((RCC->APB1HENR & RCC_APB1HENR_MDIOSEN) == 0U)
  1829. #define __HAL_RCC_FDCAN_IS_CLK_DISABLED() ((RCC->APB1HENR & RCC_APB1HENR_FDCANEN) == 0U)
  1830. /** @brief Enable or disable the APB2 peripheral clock.
  1831. * @note After reset, the peripheral clock (used for registers read/write access)
  1832. * is disabled and the application software has to enable this clock before
  1833. * using it.
  1834. */
  1835. #define __HAL_RCC_TIM1_CLK_ENABLE() do { \
  1836. __IO uint32_t tmpreg; \
  1837. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM1EN);\
  1838. /* Delay after an RCC peripheral clock enabling */ \
  1839. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM1EN);\
  1840. UNUSED(tmpreg); \
  1841. } while(0)
  1842. #define __HAL_RCC_TIM8_CLK_ENABLE() do { \
  1843. __IO uint32_t tmpreg; \
  1844. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM8EN);\
  1845. /* Delay after an RCC peripheral clock enabling */ \
  1846. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM8EN);\
  1847. UNUSED(tmpreg); \
  1848. } while(0)
  1849. #define __HAL_RCC_USART1_CLK_ENABLE() do { \
  1850. __IO uint32_t tmpreg; \
  1851. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_USART1EN);\
  1852. /* Delay after an RCC peripheral clock enabling */ \
  1853. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_USART1EN);\
  1854. UNUSED(tmpreg); \
  1855. } while(0)
  1856. #define __HAL_RCC_USART6_CLK_ENABLE() do { \
  1857. __IO uint32_t tmpreg; \
  1858. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_USART6EN);\
  1859. /* Delay after an RCC peripheral clock enabling */ \
  1860. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_USART6EN);\
  1861. UNUSED(tmpreg); \
  1862. } while(0)
  1863. #if defined(UART9)
  1864. #define __HAL_RCC_UART9_CLK_ENABLE() do { \
  1865. __IO uint32_t tmpreg; \
  1866. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_UART9EN);\
  1867. /* Delay after an RCC peripheral clock enabling */ \
  1868. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_UART9EN);\
  1869. UNUSED(tmpreg); \
  1870. } while(0)
  1871. #endif /*UART9*/
  1872. #if defined(USART10)
  1873. #define __HAL_RCC_USART10_CLK_ENABLE() do { \
  1874. __IO uint32_t tmpreg; \
  1875. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_USART10EN);\
  1876. /* Delay after an RCC peripheral clock enabling */ \
  1877. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_USART10EN);\
  1878. UNUSED(tmpreg); \
  1879. } while(0)
  1880. #endif /*USART10*/
  1881. #define __HAL_RCC_SPI1_CLK_ENABLE() do { \
  1882. __IO uint32_t tmpreg; \
  1883. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI1EN);\
  1884. /* Delay after an RCC peripheral clock enabling */ \
  1885. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI1EN);\
  1886. UNUSED(tmpreg); \
  1887. } while(0)
  1888. #define __HAL_RCC_SPI4_CLK_ENABLE() do { \
  1889. __IO uint32_t tmpreg; \
  1890. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI4EN);\
  1891. /* Delay after an RCC peripheral clock enabling */ \
  1892. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI4EN);\
  1893. UNUSED(tmpreg); \
  1894. } while(0)
  1895. #define __HAL_RCC_TIM15_CLK_ENABLE() do { \
  1896. __IO uint32_t tmpreg; \
  1897. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM15EN);\
  1898. /* Delay after an RCC peripheral clock enabling */ \
  1899. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM15EN);\
  1900. UNUSED(tmpreg); \
  1901. } while(0)
  1902. #define __HAL_RCC_TIM16_CLK_ENABLE() do { \
  1903. __IO uint32_t tmpreg; \
  1904. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM16EN);\
  1905. /* Delay after an RCC peripheral clock enabling */ \
  1906. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM16EN);\
  1907. UNUSED(tmpreg); \
  1908. } while(0)
  1909. #define __HAL_RCC_TIM17_CLK_ENABLE() do { \
  1910. __IO uint32_t tmpreg; \
  1911. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM17EN);\
  1912. /* Delay after an RCC peripheral clock enabling */ \
  1913. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM17EN);\
  1914. UNUSED(tmpreg); \
  1915. } while(0)
  1916. #define __HAL_RCC_SPI5_CLK_ENABLE() do { \
  1917. __IO uint32_t tmpreg; \
  1918. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI5EN);\
  1919. /* Delay after an RCC peripheral clock enabling */ \
  1920. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI5EN);\
  1921. UNUSED(tmpreg); \
  1922. } while(0)
  1923. #define __HAL_RCC_SAI1_CLK_ENABLE() do { \
  1924. __IO uint32_t tmpreg; \
  1925. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI1EN);\
  1926. /* Delay after an RCC peripheral clock enabling */ \
  1927. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI1EN);\
  1928. UNUSED(tmpreg); \
  1929. } while(0)
  1930. #define __HAL_RCC_SAI2_CLK_ENABLE() do { \
  1931. __IO uint32_t tmpreg; \
  1932. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI2EN);\
  1933. /* Delay after an RCC peripheral clock enabling */ \
  1934. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI2EN);\
  1935. UNUSED(tmpreg); \
  1936. } while(0)
  1937. #if defined(SAI3)
  1938. #define __HAL_RCC_SAI3_CLK_ENABLE() do { \
  1939. __IO uint32_t tmpreg; \
  1940. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI3EN);\
  1941. /* Delay after an RCC peripheral clock enabling */ \
  1942. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI3EN);\
  1943. UNUSED(tmpreg); \
  1944. } while(0)
  1945. #endif /*SAI3*/
  1946. #define __HAL_RCC_DFSDM1_CLK_ENABLE() do { \
  1947. __IO uint32_t tmpreg; \
  1948. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_DFSDM1EN);\
  1949. /* Delay after an RCC peripheral clock enabling */ \
  1950. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_DFSDM1EN);\
  1951. UNUSED(tmpreg); \
  1952. } while(0)
  1953. #if defined(HRTIM1)
  1954. #define __HAL_RCC_HRTIM1_CLK_ENABLE() do { \
  1955. __IO uint32_t tmpreg; \
  1956. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_HRTIMEN);\
  1957. /* Delay after an RCC peripheral clock enabling */ \
  1958. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_HRTIMEN);\
  1959. UNUSED(tmpreg); \
  1960. } while(0)
  1961. #endif /*HRTIM1*/
  1962. #define __HAL_RCC_TIM1_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_TIM1EN)
  1963. #define __HAL_RCC_TIM8_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_TIM8EN)
  1964. #define __HAL_RCC_USART1_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_USART1EN)
  1965. #define __HAL_RCC_USART6_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_USART6EN)
  1966. #if defined(UART9)
  1967. #define __HAL_RCC_UART9_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_UART9EN)
  1968. #endif /*UART9*/
  1969. #if defined(USART10)
  1970. #define __HAL_RCC_USART10_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_USART10EN)
  1971. #endif /*USART10*/
  1972. #define __HAL_RCC_SPI1_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_SPI1EN)
  1973. #define __HAL_RCC_SPI4_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_SPI4EN)
  1974. #define __HAL_RCC_TIM15_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_TIM15EN)
  1975. #define __HAL_RCC_TIM16_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_TIM16EN)
  1976. #define __HAL_RCC_TIM17_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_TIM17EN)
  1977. #define __HAL_RCC_SPI5_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_SPI5EN)
  1978. #define __HAL_RCC_SAI1_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_SAI1EN)
  1979. #define __HAL_RCC_SAI2_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_SAI2EN)
  1980. #if defined(SAI3)
  1981. #define __HAL_RCC_SAI3_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_SAI3EN)
  1982. #endif /*SAI3*/
  1983. #define __HAL_RCC_DFSDM1_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_DFSDM1EN)
  1984. #if defined(HRTIM1)
  1985. #define __HAL_RCC_HRTIM1_CLK_DISABLE() (RCC->APB2ENR) &= ~ (RCC_APB2ENR_HRTIMEN)
  1986. #endif /*HRTIM*/
  1987. /** @brief Get the enable or disable status of the APB2 peripheral clock
  1988. * @note After reset, the peripheral clock (used for registers read/write access)
  1989. * is disabled and the application software has to enable this clock before
  1990. * using it.
  1991. */
  1992. #define __HAL_RCC_TIM1_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_TIM1EN) != 0U)
  1993. #define __HAL_RCC_TIM8_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_TIM8EN) != 0U)
  1994. #define __HAL_RCC_USART1_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_USART1EN) != 0U)
  1995. #define __HAL_RCC_USART6_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_USART6EN) != 0U)
  1996. #if defined(UART9)
  1997. #define __HAL_RCC_UART9_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_UART9EN) != 0U)
  1998. #endif /*UART9*/
  1999. #if defined(USART10)
  2000. #define __HAL_RCC_USART10_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_USART10EN) != 0U)
  2001. #endif /*USART10*/
  2002. #define __HAL_RCC_SPI1_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_SPI1EN) != 0U)
  2003. #define __HAL_RCC_SPI4_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_SPI4EN) != 0U)
  2004. #define __HAL_RCC_TIM15_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_TIM15EN) != 0U)
  2005. #define __HAL_RCC_TIM16_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_TIM16EN) != 0U)
  2006. #define __HAL_RCC_TIM17_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_TIM17EN) != 0U)
  2007. #define __HAL_RCC_SPI5_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_SPI5EN) != 0U)
  2008. #define __HAL_RCC_SAI1_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_SAI1EN) != 0U)
  2009. #define __HAL_RCC_SAI2_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_SAI2EN) != 0U)
  2010. #if defined(SAI3)
  2011. #define __HAL_RCC_SAI3_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_SAI3EN) != 0U)
  2012. #endif /* SAI3 */
  2013. #define __HAL_RCC_DFSDM1_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_DFSDM1EN) != 0U)
  2014. #if defined(HRTIM1)
  2015. #define __HAL_RCC_HRTIM1_IS_CLK_ENABLED() ((RCC->APB2ENR & RCC_APB2ENR_HRTIMEN) != 0U)
  2016. #endif /*HRTIM1*/
  2017. #define __HAL_RCC_TIM1_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_TIM1EN) == 0U)
  2018. #define __HAL_RCC_TIM8_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_TIM8EN) == 0U)
  2019. #define __HAL_RCC_USART1_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_USART1EN) == 0U)
  2020. #define __HAL_RCC_USART6_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_USART6EN) == 0U)
  2021. #if defined(UART9)
  2022. #define __HAL_RCC_UART9_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_UART9EN) == 0U)
  2023. #endif /*UART9*/
  2024. #if defined(USART10)
  2025. #define __HAL_RCC_USART10_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_USART10EN) == 0U)
  2026. #endif /*USART10*/
  2027. #define __HAL_RCC_SPI1_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_SPI1EN) == 0U)
  2028. #define __HAL_RCC_SPI4_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_SPI4EN) == 0U)
  2029. #define __HAL_RCC_TIM15_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_TIM15EN) == 0U)
  2030. #define __HAL_RCC_TIM16_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_TIM16EN) == 0U)
  2031. #define __HAL_RCC_TIM17_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_TIM17EN) == 0U)
  2032. #define __HAL_RCC_SPI5_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_SPI5EN) == 0U)
  2033. #define __HAL_RCC_SAI1_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_SAI1EN) == 0U)
  2034. #define __HAL_RCC_SAI2_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_SAI2EN) == 0U)
  2035. #if defined(SAI3)
  2036. #define __HAL_RCC_SAI3_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_SAI3EN) == 0U)
  2037. #endif /*SAI3*/
  2038. #define __HAL_RCC_DFSDM1_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_DFSDM1EN) == 0U)
  2039. #if defined(HRTIM1)
  2040. #define __HAL_RCC_HRTIM1_IS_CLK_DISABLED() ((RCC->APB2ENR & RCC_APB2ENR_HRTIMEN) == 0U)
  2041. #endif /*HRTIM1*/
  2042. /** @brief Enable or disable the APB4 peripheral clock.
  2043. * @note After reset, the peripheral clock (used for registers read/write access)
  2044. * is disabled and the application software has to enable this clock before
  2045. * using it.
  2046. */
  2047. #define __HAL_RCC_SYSCFG_CLK_ENABLE() do { \
  2048. __IO uint32_t tmpreg; \
  2049. SET_BIT(RCC->APB4ENR, RCC_APB4ENR_SYSCFGEN);\
  2050. /* Delay after an RCC peripheral clock enabling */ \
  2051. tmpreg = READ_BIT(RCC->APB4ENR, RCC_APB4ENR_SYSCFGEN);\
  2052. UNUSED(tmpreg); \
  2053. } while(0)
  2054. #define __HAL_RCC_LPUART1_CLK_ENABLE() do { \
  2055. __IO uint32_t tmpreg; \
  2056. SET_BIT(RCC->APB4ENR, RCC_APB4ENR_LPUART1EN);\
  2057. /* Delay after an RCC peripheral clock enabling */ \
  2058. tmpreg = READ_BIT(RCC->APB4ENR, RCC_APB4ENR_LPUART1EN);\
  2059. UNUSED(tmpreg); \
  2060. } while(0)
  2061. #define __HAL_RCC_SPI6_CLK_ENABLE() do { \
  2062. __IO uint32_t tmpreg; \
  2063. SET_BIT(RCC->APB4ENR, RCC_APB4ENR_SPI6EN);\
  2064. /* Delay after an RCC peripheral clock enabling */ \
  2065. tmpreg = READ_BIT(RCC->APB4ENR, RCC_APB4ENR_SPI6EN);\
  2066. UNUSED(tmpreg); \
  2067. } while(0)
  2068. #define __HAL_RCC_I2C4_CLK_ENABLE() do { \
  2069. __IO uint32_t tmpreg; \
  2070. SET_BIT(RCC->APB4ENR, RCC_APB4ENR_I2C4EN);\
  2071. /* Delay after an RCC peripheral clock enabling */ \
  2072. tmpreg = READ_BIT(RCC->APB4ENR, RCC_APB4ENR_I2C4EN);\
  2073. UNUSED(tmpreg); \
  2074. } while(0)
  2075. #define __HAL_RCC_LPTIM2_CLK_ENABLE() do { \
  2076. __IO uint32_t tmpreg; \
  2077. SET_BIT(RCC->APB4ENR, RCC_APB4ENR_LPTIM2EN);\
  2078. /* Delay after an RCC peripheral clock enabling */ \
  2079. tmpreg = READ_BIT(RCC->APB4ENR, RCC_APB4ENR_LPTIM2EN);\
  2080. UNUSED(tmpreg); \
  2081. } while(0)
  2082. #define __HAL_RCC_LPTIM3_CLK_ENABLE() do { \
  2083. __IO uint32_t tmpreg; \
  2084. SET_BIT(RCC->APB4ENR, RCC_APB4ENR_LPTIM3EN);\
  2085. /* Delay after an RCC peripheral clock enabling */ \
  2086. tmpreg = READ_BIT(RCC->APB4ENR, RCC_APB4ENR_LPTIM3EN);\
  2087. UNUSED(tmpreg); \
  2088. } while(0)
  2089. #if defined(LPTIM4)
  2090. #define __HAL_RCC_LPTIM4_CLK_ENABLE() do { \
  2091. __IO uint32_t tmpreg; \
  2092. SET_BIT(RCC->APB4ENR, RCC_APB4ENR_LPTIM4EN);\
  2093. /* Delay after an RCC peripheral clock enabling */ \
  2094. tmpreg = READ_BIT(RCC->APB4ENR, RCC_APB4ENR_LPTIM4EN);\
  2095. UNUSED(tmpreg); \
  2096. } while(0)
  2097. #endif /* LPTIM4 */
  2098. #if defined(LPTIM5)
  2099. #define __HAL_RCC_LPTIM5_CLK_ENABLE() do { \
  2100. __IO uint32_t tmpreg; \
  2101. SET_BIT(RCC->APB4ENR, RCC_APB4ENR_LPTIM5EN);\
  2102. /* Delay after an RCC peripheral clock enabling */ \
  2103. tmpreg = READ_BIT(RCC->APB4ENR, RCC_APB4ENR_LPTIM5EN);\
  2104. UNUSED(tmpreg); \
  2105. } while(0)
  2106. #endif /* LPTIM5 */
  2107. #if defined(DAC2)
  2108. #define __HAL_RCC_DAC2_CLK_ENABLE() do { \
  2109. __IO uint32_t tmpreg; \
  2110. SET_BIT(RCC->APB4ENR, RCC_APB4ENR_DAC2EN);\
  2111. /* Delay after an RCC peripheral clock enabling */ \
  2112. tmpreg = READ_BIT(RCC->APB4ENR, RCC_APB4ENR_DAC2EN);\
  2113. UNUSED(tmpreg); \
  2114. } while(0)
  2115. #endif /* DAC2 */
  2116. #define __HAL_RCC_COMP12_CLK_ENABLE() do { \
  2117. __IO uint32_t tmpreg; \
  2118. SET_BIT(RCC->APB4ENR, RCC_APB4ENR_COMP12EN);\
  2119. /* Delay after an RCC peripheral clock enabling */ \
  2120. tmpreg = READ_BIT(RCC->APB4ENR, RCC_APB4ENR_COMP12EN);\
  2121. UNUSED(tmpreg); \
  2122. } while(0)
  2123. #define __HAL_RCC_VREF_CLK_ENABLE() do { \
  2124. __IO uint32_t tmpreg; \
  2125. SET_BIT(RCC->APB4ENR, RCC_APB4ENR_VREFEN);\
  2126. /* Delay after an RCC peripheral clock enabling */ \
  2127. tmpreg = READ_BIT(RCC->APB4ENR, RCC_APB4ENR_VREFEN);\
  2128. UNUSED(tmpreg); \
  2129. } while(0)
  2130. #if defined(SAI4)
  2131. #define __HAL_RCC_SAI4_CLK_ENABLE() do { \
  2132. __IO uint32_t tmpreg; \
  2133. SET_BIT(RCC->APB4ENR, RCC_APB4ENR_SAI4EN);\
  2134. /* Delay after an RCC peripheral clock enabling */ \
  2135. tmpreg = READ_BIT(RCC->APB4ENR, RCC_APB4ENR_SAI4EN);\
  2136. UNUSED(tmpreg); \
  2137. } while(0)
  2138. #endif /* SAI4 */
  2139. #define __HAL_RCC_RTC_CLK_ENABLE() do { \
  2140. __IO uint32_t tmpreg; \
  2141. SET_BIT(RCC->APB4ENR, RCC_APB4ENR_RTCAPBEN);\
  2142. /* Delay after an RCC peripheral clock enabling */ \
  2143. tmpreg = READ_BIT(RCC->APB4ENR, RCC_APB4ENR_RTCAPBEN);\
  2144. UNUSED(tmpreg); \
  2145. } while(0)
  2146. #if defined(DTS)
  2147. #define __HAL_RCC_DTS_CLK_ENABLE() do { \
  2148. __IO uint32_t tmpreg; \
  2149. SET_BIT(RCC->APB4ENR, RCC_APB4ENR_DTSEN);\
  2150. /* Delay after an RCC peripheral clock enabling */ \
  2151. tmpreg = READ_BIT(RCC->APB4ENR, RCC_APB4ENR_DTSEN);\
  2152. UNUSED(tmpreg); \
  2153. } while(0)
  2154. #endif /*DTS*/
  2155. #if defined(DFSDM2_BASE)
  2156. #define __HAL_RCC_DFSDM2_CLK_ENABLE() do { \
  2157. __IO uint32_t tmpreg; \
  2158. SET_BIT(RCC->APB4ENR, RCC_APB4ENR_DFSDM2EN);\
  2159. /* Delay after an RCC peripheral clock enabling */ \
  2160. tmpreg = READ_BIT(RCC->APB4ENR, RCC_APB4ENR_DFSDM2EN);\
  2161. UNUSED(tmpreg); \
  2162. } while(0)
  2163. #endif /*DFSDM2*/
  2164. #define __HAL_RCC_SYSCFG_CLK_DISABLE() (RCC->APB4ENR) &= ~ (RCC_APB4ENR_SYSCFGEN)
  2165. #define __HAL_RCC_LPUART1_CLK_DISABLE() (RCC->APB4ENR) &= ~ (RCC_APB4ENR_LPUART1EN)
  2166. #define __HAL_RCC_SPI6_CLK_DISABLE() (RCC->APB4ENR) &= ~ (RCC_APB4ENR_SPI6EN)
  2167. #define __HAL_RCC_I2C4_CLK_DISABLE() (RCC->APB4ENR) &= ~ (RCC_APB4ENR_I2C4EN)
  2168. #define __HAL_RCC_LPTIM2_CLK_DISABLE() (RCC->APB4ENR) &= ~ (RCC_APB4ENR_LPTIM2EN)
  2169. #define __HAL_RCC_LPTIM3_CLK_DISABLE() (RCC->APB4ENR) &= ~ (RCC_APB4ENR_LPTIM3EN)
  2170. #if defined(LPTIM4)
  2171. #define __HAL_RCC_LPTIM4_CLK_DISABLE() (RCC->APB4ENR) &= ~ (RCC_APB4ENR_LPTIM4EN)
  2172. #endif /*LPTIM4*/
  2173. #if defined(LPTIM5)
  2174. #define __HAL_RCC_LPTIM5_CLK_DISABLE() (RCC->APB4ENR) &= ~ (RCC_APB4ENR_LPTIM5EN)
  2175. #endif /*LPTIM5*/
  2176. #if defined(DAC2)
  2177. #define __HAL_RCC_DAC2_CLK_DISABLE() (RCC->APB4ENR) &= ~ (RCC_APB4ENR_DAC2EN)
  2178. #endif /*DAC2*/
  2179. #define __HAL_RCC_COMP12_CLK_DISABLE() (RCC->APB4ENR) &= ~ (RCC_APB4ENR_COMP12EN)
  2180. #define __HAL_RCC_VREF_CLK_DISABLE() (RCC->APB4ENR) &= ~ (RCC_APB4ENR_VREFEN)
  2181. #define __HAL_RCC_RTC_CLK_DISABLE() (RCC->APB4ENR) &= ~ (RCC_APB4ENR_RTCAPBEN)
  2182. #if defined(SAI4)
  2183. #define __HAL_RCC_SAI4_CLK_DISABLE() (RCC->APB4ENR) &= ~ (RCC_APB4ENR_SAI4EN)
  2184. #endif /*SAI4*/
  2185. #if defined(DTS)
  2186. #define __HAL_RCC_DTS_CLK_DISABLE() (RCC->APB4ENR) &= ~ (RCC_APB4ENR_DTSEN)
  2187. #endif /*DTS*/
  2188. #if defined(DFSDM2_BASE)
  2189. #define __HAL_RCC_DFSDM2_CLK_DISABLE() (RCC->APB4ENR) &= ~ (RCC_APB4ENR_DFSDM2EN)
  2190. #endif /*DFSDM2*/
  2191. /** @brief Get the enable or disable status of the APB4 peripheral clock
  2192. * @note After reset, the peripheral clock (used for registers read/write access)
  2193. * is disabled and the application software has to enable this clock before
  2194. * using it.
  2195. */
  2196. #define __HAL_RCC_SYSCFG_IS_CLK_ENABLED() ((RCC->APB4ENR & RCC_APB4ENR_SYSCFGEN) != 0U)
  2197. #define __HAL_RCC_LPUART1_IS_CLK_ENABLED() ((RCC->APB4ENR & RCC_APB4ENR_LPUART1EN) != 0U)
  2198. #define __HAL_RCC_SPI6_IS_CLK_ENABLED() ((RCC->APB4ENR & RCC_APB4ENR_SPI6EN) != 0U)
  2199. #define __HAL_RCC_I2C4_IS_CLK_ENABLED() ((RCC->APB4ENR & RCC_APB4ENR_I2C4EN) != 0U)
  2200. #define __HAL_RCC_LPTIM2_IS_CLK_ENABLED() ((RCC->APB4ENR & RCC_APB4ENR_LPTIM2EN) != 0U)
  2201. #define __HAL_RCC_LPTIM3_IS_CLK_ENABLED() ((RCC->APB4ENR & RCC_APB4ENR_LPTIM3EN) != 0U)
  2202. #if defined(LPTIM4)
  2203. #define __HAL_RCC_LPTIM4_IS_CLK_ENABLED() ((RCC->APB4ENR & RCC_APB4ENR_LPTIM4EN) != 0U)
  2204. #endif /*LPTIM4*/
  2205. #if defined(LPTIM5)
  2206. #define __HAL_RCC_LPTIM5_IS_CLK_ENABLED() ((RCC->APB4ENR & RCC_APB4ENR_LPTIM5EN) != 0U)
  2207. #endif /*LPTIM5*/
  2208. #if defined(DAC2)
  2209. #define __HAL_RCC_DAC2_IS_CLK_ENABLED() ((RCC->APB4ENR & RCC_APB4ENR_DAC2EN) != 0U)
  2210. #endif /*DAC2*/
  2211. #define __HAL_RCC_COMP12_IS_CLK_ENABLED() ((RCC->APB4ENR & RCC_APB4ENR_COMP12EN) != 0U)
  2212. #define __HAL_RCC_VREF_IS_CLK_ENABLED() ((RCC->APB4ENR & RCC_APB4ENR_VREFEN) != 0U)
  2213. #define __HAL_RCC_RTC_IS_CLK_ENABLED() ((RCC->APB4ENR & RCC_APB4ENR_RTCAPBEN) != 0U)
  2214. #if defined(SAI4)
  2215. #define __HAL_RCC_SAI4_IS_CLK_ENABLED() ((RCC->APB4ENR & RCC_APB4ENR_SAI4EN) != 0U)
  2216. #endif /*SAI4*/
  2217. #if defined(DTS)
  2218. #define __HAL_RCC_DTS_IS_CLK_ENABLED() ((RCC->APB4ENR & RCC_APB4ENR_DTSEN) != 0U)
  2219. #endif /*DTS*/
  2220. #if defined(DFSDM2_BASE)
  2221. #define __HAL_RCC_DFSDM2_IS_CLK_ENABLED() ((RCC->APB4ENR & RCC_APB4ENR_DFSDM2EN) != 0U)
  2222. #endif /*DFSDM2*/
  2223. #define __HAL_RCC_SYSCFG_IS_CLK_DISABLED() ((RCC->APB4ENR & RCC_APB4ENR_SYSCFGEN) == 0U)
  2224. #define __HAL_RCC_LPUART1_IS_CLK_DISABLED() ((RCC->APB4ENR & RCC_APB4ENR_LPUART1EN) == 0U)
  2225. #define __HAL_RCC_SPI6_IS_CLK_DISABLED() ((RCC->APB4ENR & RCC_APB4ENR_SPI6EN) == 0U)
  2226. #define __HAL_RCC_I2C4_IS_CLK_DISABLED() ((RCC->APB4ENR & RCC_APB4ENR_I2C4EN) == 0U)
  2227. #define __HAL_RCC_LPTIM2_IS_CLK_DISABLED() ((RCC->APB4ENR & RCC_APB4ENR_LPTIM2EN) == 0U)
  2228. #define __HAL_RCC_LPTIM3_IS_CLK_DISABLED() ((RCC->APB4ENR & RCC_APB4ENR_LPTIM3EN) == 0U)
  2229. #if defined(LPTIM4)
  2230. #define __HAL_RCC_LPTIM4_IS_CLK_DISABLED() ((RCC->APB4ENR & RCC_APB4ENR_LPTIM4EN) == 0U)
  2231. #endif /*LPTIM4*/
  2232. #if defined(LPTIM5)
  2233. #define __HAL_RCC_LPTIM5_IS_CLK_DISABLED() ((RCC->APB4ENR & RCC_APB4ENR_LPTIM5EN) == 0U)
  2234. #endif /*LPTIM5*/
  2235. #if defined(DAC2)
  2236. #define __HAL_RCC_DAC2_IS_CLK_DISABLED() ((RCC->APB4ENR & RCC_APB4ENR_DAC2EN) == 0U)
  2237. #endif /*DAC2*/
  2238. #define __HAL_RCC_COMP12_IS_CLK_DISABLED() ((RCC->APB4ENR & RCC_APB4ENR_COMP12EN) == 0U)
  2239. #define __HAL_RCC_VREF_IS_CLK_DISABLED() ((RCC->APB4ENR & RCC_APB4ENR_VREFEN) == 0U)
  2240. #define __HAL_RCC_RTC_IS_CLK_DISABLED() ((RCC->APB4ENR & RCC_APB4ENR_RTCAPBEN) == 0U)
  2241. #if defined(SAI4)
  2242. #define __HAL_RCC_SAI4_IS_CLK_DISABLED() ((RCC->APB4ENR & RCC_APB4ENR_SAI4EN) == 0U)
  2243. #endif /*SAI4*/
  2244. #if defined(DTS)
  2245. #define __HAL_RCC_DTS_IS_CLK_DISABLED() ((RCC->APB4ENR & RCC_APB4ENR_DTSEN) == 0U)
  2246. #endif /*DTS*/
  2247. #if defined(DFSDM2_BASE)
  2248. #define __HAL_RCC_DFSDM2_IS_CLK_DISABLED() ((RCC->APB4ENR & RCC_APB4ENR_DFSDM2EN) == 0U)
  2249. #endif /*DFSDM2*/
  2250. #if defined(DUAL_CORE)
  2251. /* Exported macros for RCC_C1 -------------------------------------------------*/
  2252. /** @brief Enable or disable the AHB3 peripheral clock.
  2253. * @note After reset, the peripheral clock (used for registers read/write access)
  2254. * is disabled and the application software has to enable this clock before
  2255. * using it.
  2256. */
  2257. #define __HAL_RCC_C1_MDMA_CLK_ENABLE() do { \
  2258. __IO uint32_t tmpreg; \
  2259. SET_BIT(RCC_C1->AHB3ENR, RCC_AHB3ENR_MDMAEN);\
  2260. /* Delay after an RCC peripheral clock enabling */ \
  2261. tmpreg = READ_BIT(RCC_C1->AHB3ENR, RCC_AHB3ENR_MDMAEN);\
  2262. UNUSED(tmpreg); \
  2263. } while(0)
  2264. #define __HAL_RCC_C1_DMA2D_CLK_ENABLE() do { \
  2265. __IO uint32_t tmpreg; \
  2266. SET_BIT(RCC_C1->AHB3ENR, RCC_AHB3ENR_DMA2DEN);\
  2267. /* Delay after an RCC peripheral clock enabling */ \
  2268. tmpreg = READ_BIT(RCC_C1->AHB3ENR, RCC_AHB3ENR_DMA2DEN);\
  2269. UNUSED(tmpreg); \
  2270. } while(0)
  2271. #define __HAL_RCC_C1_JPGDECEN_CLK_ENABLE() do { \
  2272. __IO uint32_t tmpreg; \
  2273. SET_BIT(RCC_C1->AHB3ENR, RCC_AHB3ENR_JPGDECEN);\
  2274. /* Delay after an RCC peripheral clock enabling */ \
  2275. tmpreg = READ_BIT(RCC_C1->AHB3ENR, RCC_AHB3ENR_JPGDECEN);\
  2276. UNUSED(tmpreg); \
  2277. } while(0)
  2278. #define __HAL_RCC_C1_FMC_CLK_ENABLE() do { \
  2279. __IO uint32_t tmpreg; \
  2280. SET_BIT(RCC_C1->AHB3ENR, RCC_AHB3ENR_FMCEN);\
  2281. /* Delay after an RCC peripheral clock enabling */ \
  2282. tmpreg = READ_BIT(RCC_C1->AHB3ENR, RCC_AHB3ENR_FMCEN);\
  2283. UNUSED(tmpreg); \
  2284. } while(0)
  2285. #define __HAL_RCC_C1_QSPI_CLK_ENABLE() do { \
  2286. __IO uint32_t tmpreg; \
  2287. SET_BIT(RCC_C1->AHB3ENR, RCC_AHB3ENR_QSPIEN);\
  2288. /* Delay after an RCC peripheral clock enabling */ \
  2289. tmpreg = READ_BIT(RCC_C1->AHB3ENR, RCC_AHB3ENR_QSPIEN);\
  2290. UNUSED(tmpreg); \
  2291. } while(0)
  2292. #define __HAL_RCC_C1_SDMMC1_CLK_ENABLE() do { \
  2293. __IO uint32_t tmpreg; \
  2294. SET_BIT(RCC_C1->AHB3ENR, RCC_AHB3ENR_SDMMC1EN);\
  2295. /* Delay after an RCC peripheral clock enabling */ \
  2296. tmpreg = READ_BIT(RCC_C1->AHB3ENR, RCC_AHB3ENR_SDMMC1EN);\
  2297. UNUSED(tmpreg); \
  2298. } while(0)
  2299. #define __HAL_RCC_C1_MDMA_CLK_DISABLE() (RCC_C1->AHB3ENR &= ~ (RCC_AHB3ENR_MDMAEN))
  2300. #define __HAL_RCC_C1_DMA2D_CLK_DISABLE() (RCC_C1->AHB3ENR &= ~ (RCC_AHB3ENR_DMA2DEN))
  2301. #define __HAL_RCC_C1_JPGDECEN_CLK_DISABLE() (RCC_C1->AHB3ENR &= ~ (RCC_AHB3ENR_JPGDECEN))
  2302. #define __HAL_RCC_C1_FMC_CLK_DISABLE() (RCC_C1->AHB3ENR &= ~ (RCC_AHB3ENR_FMCEN))
  2303. #define __HAL_RCC_C1_QSPI_CLK_DISABLE() (RCC_C1->AHB3ENR &= ~ (RCC_AHB3ENR_QSPIEN))
  2304. #define __HAL_RCC_C1_SDMMC1_CLK_DISABLE() (RCC_C1->AHB3ENR &= ~ (RCC_AHB3ENR_SDMMC1EN))
  2305. /** @brief Enable or disable the AHB1 peripheral clock.
  2306. * @note After reset, the peripheral clock (used for registers read/write access)
  2307. * is disabled and the application software has to enable this clock before
  2308. * using it.
  2309. */
  2310. #define __HAL_RCC_C1_DMA1_CLK_ENABLE() do { \
  2311. __IO uint32_t tmpreg; \
  2312. SET_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_DMA1EN);\
  2313. /* Delay after an RCC peripheral clock enabling */ \
  2314. tmpreg = READ_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_DMA1EN);\
  2315. UNUSED(tmpreg); \
  2316. } while(0)
  2317. #define __HAL_RCC_C1_DMA2_CLK_ENABLE() do { \
  2318. __IO uint32_t tmpreg; \
  2319. SET_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_DMA2EN);\
  2320. /* Delay after an RCC peripheral clock enabling */ \
  2321. tmpreg = READ_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_DMA2EN);\
  2322. UNUSED(tmpreg); \
  2323. } while(0)
  2324. #define __HAL_RCC_C1_ADC12_CLK_ENABLE() do { \
  2325. __IO uint32_t tmpreg; \
  2326. SET_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_ADC12EN);\
  2327. /* Delay after an RCC peripheral clock enabling */ \
  2328. tmpreg = READ_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_ADC12EN);\
  2329. UNUSED(tmpreg); \
  2330. } while(0)
  2331. #define __HAL_RCC_C1_ART_CLK_ENABLE() do { \
  2332. __IO uint32_t tmpreg; \
  2333. SET_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_ARTEN);\
  2334. /* Delay after an RCC peripheral clock enabling */ \
  2335. tmpreg = READ_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_ARTEN);\
  2336. UNUSED(tmpreg); \
  2337. } while(0)
  2338. #define __HAL_RCC_C1_ETH1MAC_CLK_ENABLE() do { \
  2339. __IO uint32_t tmpreg; \
  2340. SET_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_ETH1MACEN);\
  2341. /* Delay after an RCC peripheral clock enabling */ \
  2342. tmpreg = READ_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_ETH1MACEN);\
  2343. UNUSED(tmpreg); \
  2344. } while(0)
  2345. #define __HAL_RCC_C1_ETH1TX_CLK_ENABLE() do { \
  2346. __IO uint32_t tmpreg; \
  2347. SET_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_ETH1TXEN);\
  2348. /* Delay after an RCC peripheral clock enabling */ \
  2349. tmpreg = READ_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_ETH1TXEN);\
  2350. UNUSED(tmpreg); \
  2351. } while(0)
  2352. #define __HAL_RCC_C1_ETH1RX_CLK_ENABLE() do { \
  2353. __IO uint32_t tmpreg; \
  2354. SET_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_ETH1RXEN);\
  2355. /* Delay after an RCC peripheral clock enabling */ \
  2356. tmpreg = READ_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_ETH1RXEN);\
  2357. UNUSED(tmpreg); \
  2358. } while(0)
  2359. #define __HAL_RCC_C1_USB1_OTG_HS_CLK_ENABLE() do { \
  2360. __IO uint32_t tmpreg; \
  2361. SET_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_USB1OTGHSEN);\
  2362. /* Delay after an RCC peripheral clock enabling */ \
  2363. tmpreg = READ_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_USB1OTGHSEN);\
  2364. UNUSED(tmpreg); \
  2365. } while(0)
  2366. #define __HAL_RCC_C1_USB1_OTG_HS_ULPI_CLK_ENABLE() do { \
  2367. __IO uint32_t tmpreg; \
  2368. SET_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_USB1OTGHSULPIEN);\
  2369. /* Delay after an RCC peripheral clock enabling */ \
  2370. tmpreg = READ_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_USB1OTGHSULPIEN);\
  2371. UNUSED(tmpreg); \
  2372. } while(0)
  2373. #define __HAL_RCC_C1_USB2_OTG_FS_CLK_ENABLE() do { \
  2374. __IO uint32_t tmpreg; \
  2375. SET_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_USB2OTGHSEN);\
  2376. /* Delay after an RCC peripheral clock enabling */ \
  2377. tmpreg = READ_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_USB2OTGHSEN);\
  2378. UNUSED(tmpreg); \
  2379. } while(0)
  2380. #define __HAL_RCC_C1_USB2_OTG_FS_ULPI_CLK_ENABLE() do { \
  2381. __IO uint32_t tmpreg; \
  2382. SET_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_USB2OTGHSULPIEN);\
  2383. /* Delay after an RCC peripheral clock enabling */ \
  2384. tmpreg = READ_BIT(RCC_C1->AHB1ENR, RCC_AHB1ENR_USB2OTGHSULPIEN);\
  2385. UNUSED(tmpreg); \
  2386. } while(0)
  2387. #define __HAL_RCC_C1_DMA1_CLK_DISABLE() (RCC_C1->AHB1ENR &= ~ (RCC_AHB1ENR_DMA1EN))
  2388. #define __HAL_RCC_C1_DMA2_CLK_DISABLE() (RCC_C1->AHB1ENR &= ~ (RCC_AHB1ENR_DMA2EN))
  2389. #define __HAL_RCC_C1_ADC12_CLK_DISABLE() (RCC_C1->AHB1ENR &= ~ (RCC_AHB1ENR_ADC12EN))
  2390. #define __HAL_RCC_C1_ART_CLK_DISABLE() (RCC_C1->AHB1ENR &= ~ (RCC_AHB1ENR_ARTEN))
  2391. #define __HAL_RCC_C1_ETH1MAC_CLK_DISABLE() (RCC_C1->AHB1ENR &= ~ (RCC_AHB1ENR_ETH1MACEN))
  2392. #define __HAL_RCC_C1_ETH1TX_CLK_DISABLE() (RCC_C1->AHB1ENR &= ~ (RCC_AHB1ENR_ETH1TXEN))
  2393. #define __HAL_RCC_C1_ETH1RX_CLK_DISABLE() (RCC_C1->AHB1ENR &= ~ (RCC_AHB1ENR_ETH1RXEN))
  2394. #define __HAL_RCC_C1_USB1_OTG_HS_CLK_DISABLE() (RCC_C1->AHB1ENR &= ~ (RCC_AHB1ENR_USB1OTGHSEN))
  2395. #define __HAL_RCC_C1_USB1_OTG_HS_ULPI_CLK_DISABLE() (RCC_C1->AHB1ENR &= ~ (RCC_AHB1ENR_USB1OTGHSULPIEN))
  2396. #define __HAL_RCC_C1_USB2_OTG_FS_CLK_DISABLE() (RCC_C1->AHB1ENR &= ~ (RCC_AHB1ENR_USB2OTGHSEN))
  2397. #define __HAL_RCC_C1_USB2_OTG_FS_ULPI_CLK_DISABLE() (RCC_C1->AHB1ENR &= ~ (RCC_AHB1ENR_USB2OTGHSULPIEN))
  2398. /** @brief Enable or disable the AHB2 peripheral clock.
  2399. * @note After reset, the peripheral clock (used for registers read/write access)
  2400. * is disabled and the application software has to enable this clock before
  2401. * using it.
  2402. */
  2403. #define __HAL_RCC_C1_DCMI_CLK_ENABLE() do { \
  2404. __IO uint32_t tmpreg; \
  2405. SET_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_DCMIEN);\
  2406. /* Delay after an RCC peripheral clock enabling */ \
  2407. tmpreg = READ_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_DCMIEN);\
  2408. UNUSED(tmpreg); \
  2409. } while(0)
  2410. #define __HAL_RCC_C1_CRYP_CLK_ENABLE() do { \
  2411. __IO uint32_t tmpreg; \
  2412. SET_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_CRYPEN);\
  2413. /* Delay after an RCC peripheral clock enabling */ \
  2414. tmpreg = READ_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_CRYPEN);\
  2415. UNUSED(tmpreg); \
  2416. } while(0)
  2417. #define __HAL_RCC_C1_HASH_CLK_ENABLE() do { \
  2418. __IO uint32_t tmpreg; \
  2419. SET_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_HASHEN);\
  2420. /* Delay after an RCC peripheral clock enabling */ \
  2421. tmpreg = READ_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_HASHEN);\
  2422. UNUSED(tmpreg); \
  2423. } while(0)
  2424. #define __HAL_RCC_C1_RNG_CLK_ENABLE() do { \
  2425. __IO uint32_t tmpreg; \
  2426. SET_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_RNGEN);\
  2427. /* Delay after an RCC peripheral clock enabling */ \
  2428. tmpreg = READ_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_RNGEN);\
  2429. UNUSED(tmpreg); \
  2430. } while(0)
  2431. #define __HAL_RCC_C1_SDMMC2_CLK_ENABLE() do { \
  2432. __IO uint32_t tmpreg; \
  2433. SET_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_SDMMC2EN);\
  2434. /* Delay after an RCC peripheral clock enabling */ \
  2435. tmpreg = READ_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_SDMMC2EN);\
  2436. UNUSED(tmpreg); \
  2437. } while(0)
  2438. #define __HAL_RCC_C1_D2SRAM1_CLK_ENABLE() do { \
  2439. __IO uint32_t tmpreg; \
  2440. SET_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_D2SRAM1EN);\
  2441. /* Delay after an RCC peripheral clock enabling */ \
  2442. tmpreg = READ_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_D2SRAM1EN);\
  2443. UNUSED(tmpreg); \
  2444. } while(0)
  2445. #define __HAL_RCC_C1_D2SRAM2_CLK_ENABLE() do { \
  2446. __IO uint32_t tmpreg; \
  2447. SET_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_D2SRAM2EN);\
  2448. /* Delay after an RCC peripheral clock enabling */ \
  2449. tmpreg = READ_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_D2SRAM2EN);\
  2450. UNUSED(tmpreg); \
  2451. } while(0)
  2452. #define __HAL_RCC_C1_D2SRAM3_CLK_ENABLE() do { \
  2453. __IO uint32_t tmpreg; \
  2454. SET_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_D2SRAM3EN);\
  2455. /* Delay after an RCC peripheral clock enabling */ \
  2456. tmpreg = READ_BIT(RCC_C1->AHB2ENR, RCC_AHB2ENR_D2SRAM3EN);\
  2457. UNUSED(tmpreg); \
  2458. } while(0)
  2459. #define __HAL_RCC_C1_DCMI_CLK_DISABLE() (RCC_C1->AHB2ENR &= ~ (RCC_AHB2ENR_DCMIEN))
  2460. #define __HAL_RCC_C1_CRYP_CLK_DISABLE() (RCC_C1->AHB2ENR &= ~ (RCC_AHB2ENR_CRYPEN))
  2461. #define __HAL_RCC_C1_HASH_CLK_DISABLE() (RCC_C1->AHB2ENR &= ~ (RCC_AHB2ENR_HASHEN))
  2462. #define __HAL_RCC_C1_RNG_CLK_DISABLE() (RCC_C1->AHB2ENR &= ~ (RCC_AHB2ENR_RNGEN))
  2463. #define __HAL_RCC_C1_SDMMC2_CLK_DISABLE() (RCC_C1->AHB2ENR &= ~ (RCC_AHB2ENR_SDMMC2EN))
  2464. #define __HAL_RCC_C1_D2SRAM1_CLK_DISABLE() (RCC_C1->AHB2ENR &= ~ (RCC_AHB2ENR_D2SRAM1EN))
  2465. #define __HAL_RCC_C1_D2SRAM2_CLK_DISABLE() (RCC_C1->AHB2ENR &= ~ (RCC_AHB2ENR_D2SRAM2EN))
  2466. #define __HAL_RCC_C1_D2SRAM3_CLK_DISABLE() (RCC_C1->AHB2ENR &= ~ (RCC_AHB2ENR_D2SRAM3EN))
  2467. /** @brief Enable or disable the AHB4 peripheral clock.
  2468. * @note After reset, the peripheral clock (used for registers read/write access)
  2469. * is disabled and the application software has to enable this clock before
  2470. * using it.
  2471. */
  2472. #define __HAL_RCC_C1_GPIOA_CLK_ENABLE() do { \
  2473. __IO uint32_t tmpreg; \
  2474. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOAEN);\
  2475. /* Delay after an RCC peripheral clock enabling */ \
  2476. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOAEN);\
  2477. UNUSED(tmpreg); \
  2478. } while(0)
  2479. #define __HAL_RCC_C1_GPIOB_CLK_ENABLE() do { \
  2480. __IO uint32_t tmpreg; \
  2481. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOBEN);\
  2482. /* Delay after an RCC peripheral clock enabling */ \
  2483. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOBEN);\
  2484. UNUSED(tmpreg); \
  2485. } while(0)
  2486. #define __HAL_RCC_C1_GPIOC_CLK_ENABLE() do { \
  2487. __IO uint32_t tmpreg; \
  2488. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOCEN);\
  2489. /* Delay after an RCC peripheral clock enabling */ \
  2490. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOCEN);\
  2491. UNUSED(tmpreg); \
  2492. } while(0)
  2493. #define __HAL_RCC_C1_GPIOD_CLK_ENABLE() do { \
  2494. __IO uint32_t tmpreg; \
  2495. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIODEN);\
  2496. /* Delay after an RCC peripheral clock enabling */ \
  2497. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIODEN);\
  2498. UNUSED(tmpreg); \
  2499. } while(0)
  2500. #define __HAL_RCC_C1_GPIOE_CLK_ENABLE() do { \
  2501. __IO uint32_t tmpreg; \
  2502. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOEEN);\
  2503. /* Delay after an RCC peripheral clock enabling */ \
  2504. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOEEN);\
  2505. UNUSED(tmpreg); \
  2506. } while(0)
  2507. #define __HAL_RCC_C1_GPIOF_CLK_ENABLE() do { \
  2508. __IO uint32_t tmpreg; \
  2509. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOFEN);\
  2510. /* Delay after an RCC peripheral clock enabling */ \
  2511. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOFEN);\
  2512. UNUSED(tmpreg); \
  2513. } while(0)
  2514. #define __HAL_RCC_C1_GPIOG_CLK_ENABLE() do { \
  2515. __IO uint32_t tmpreg; \
  2516. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOGEN);\
  2517. /* Delay after an RCC peripheral clock enabling */ \
  2518. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOGEN);\
  2519. UNUSED(tmpreg); \
  2520. } while(0)
  2521. #define __HAL_RCC_C1_GPIOH_CLK_ENABLE() do { \
  2522. __IO uint32_t tmpreg; \
  2523. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOHEN);\
  2524. /* Delay after an RCC peripheral clock enabling */ \
  2525. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOHEN);\
  2526. UNUSED(tmpreg); \
  2527. } while(0)
  2528. #define __HAL_RCC_C1_GPIOI_CLK_ENABLE() do { \
  2529. __IO uint32_t tmpreg; \
  2530. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOIEN);\
  2531. /* Delay after an RCC peripheral clock enabling */ \
  2532. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOIEN);\
  2533. UNUSED(tmpreg); \
  2534. } while(0)
  2535. #define __HAL_RCC_C1_GPIOJ_CLK_ENABLE() do { \
  2536. __IO uint32_t tmpreg; \
  2537. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOJEN);\
  2538. /* Delay after an RCC peripheral clock enabling */ \
  2539. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOJEN);\
  2540. UNUSED(tmpreg); \
  2541. } while(0)
  2542. #define __HAL_RCC_C1_GPIOK_CLK_ENABLE() do { \
  2543. __IO uint32_t tmpreg; \
  2544. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOKEN);\
  2545. /* Delay after an RCC peripheral clock enabling */ \
  2546. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_GPIOKEN);\
  2547. UNUSED(tmpreg); \
  2548. } while(0)
  2549. #define __HAL_RCC_C1_CRC_CLK_ENABLE() do { \
  2550. __IO uint32_t tmpreg; \
  2551. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_CRCEN);\
  2552. /* Delay after an RCC peripheral clock enabling */ \
  2553. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_CRCEN);\
  2554. UNUSED(tmpreg); \
  2555. } while(0)
  2556. #define __HAL_RCC_C1_BDMA_CLK_ENABLE() do { \
  2557. __IO uint32_t tmpreg; \
  2558. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_BDMAEN);\
  2559. /* Delay after an RCC peripheral clock enabling */ \
  2560. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_BDMAEN);\
  2561. UNUSED(tmpreg); \
  2562. } while(0)
  2563. #define __HAL_RCC_C1_ADC3_CLK_ENABLE() do { \
  2564. __IO uint32_t tmpreg; \
  2565. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_ADC3EN);\
  2566. /* Delay after an RCC peripheral clock enabling */ \
  2567. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_ADC3EN);\
  2568. UNUSED(tmpreg); \
  2569. } while(0)
  2570. #define __HAL_RCC_C1_HSEM_CLK_ENABLE() do { \
  2571. __IO uint32_t tmpreg; \
  2572. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_HSEMEN);\
  2573. /* Delay after an RCC peripheral clock enabling */ \
  2574. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_HSEMEN);\
  2575. UNUSED(tmpreg); \
  2576. } while(0)
  2577. #define __HAL_RCC_C1_BKPRAM_CLK_ENABLE() do { \
  2578. __IO uint32_t tmpreg; \
  2579. SET_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_BKPRAMEN);\
  2580. /* Delay after an RCC peripheral clock enabling */ \
  2581. tmpreg = READ_BIT(RCC_C1->AHB4ENR, RCC_AHB4ENR_BKPRAMEN);\
  2582. UNUSED(tmpreg); \
  2583. } while(0)
  2584. #define __HAL_RCC_C1_GPIOA_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOAEN)
  2585. #define __HAL_RCC_C1_GPIOB_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOBEN)
  2586. #define __HAL_RCC_C1_GPIOC_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOCEN)
  2587. #define __HAL_RCC_C1_GPIOD_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIODEN)
  2588. #define __HAL_RCC_C1_GPIOE_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOEEN)
  2589. #define __HAL_RCC_C1_GPIOF_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOFEN)
  2590. #define __HAL_RCC_C1_GPIOG_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOGEN)
  2591. #define __HAL_RCC_C1_GPIOH_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOHEN)
  2592. #define __HAL_RCC_C1_GPIOI_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOIEN)
  2593. #define __HAL_RCC_C1_GPIOJ_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOJEN)
  2594. #define __HAL_RCC_C1_GPIOK_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOKEN)
  2595. #define __HAL_RCC_C1_CRC_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_CRCEN)
  2596. #define __HAL_RCC_C1_BDMA_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_BDMAEN)
  2597. #define __HAL_RCC_C1_ADC3_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_ADC3EN)
  2598. #define __HAL_RCC_C1_HSEM_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_HSEMEN)
  2599. #define __HAL_RCC_C1_BKPRAM_CLK_DISABLE() (RCC_C1->AHB4ENR) &= ~ (RCC_AHB4ENR_BKPRAMEN)
  2600. /** @brief Enable or disable the APB3 peripheral clock.
  2601. * @note After reset, the peripheral clock (used for registers read/write access)
  2602. * is disabled and the application software has to enable this clock before
  2603. * using it.
  2604. */
  2605. #define __HAL_RCC_C1_LTDC_CLK_ENABLE() do { \
  2606. __IO uint32_t tmpreg; \
  2607. SET_BIT(RCC_C1->APB3ENR, RCC_APB3ENR_LTDCEN);\
  2608. /* Delay after an RCC peripheral clock enabling */ \
  2609. tmpreg = READ_BIT(RCC_C1->APB3ENR, RCC_APB3ENR_LTDCEN);\
  2610. UNUSED(tmpreg); \
  2611. } while(0)
  2612. #define __HAL_RCC_C1_DSI_CLK_ENABLE() do { \
  2613. __IO uint32_t tmpreg; \
  2614. SET_BIT(RCC_C1->APB3ENR, RCC_APB3ENR_DSIEN);\
  2615. /* Delay after an RCC peripheral clock enabling */ \
  2616. tmpreg = READ_BIT(RCC_C1->APB3ENR, RCC_APB3ENR_DSIEN);\
  2617. UNUSED(tmpreg); \
  2618. } while(0)
  2619. #define __HAL_RCC_C1_WWDG1_CLK_ENABLE() do { \
  2620. __IO uint32_t tmpreg; \
  2621. SET_BIT(RCC_C1->APB3ENR, RCC_APB3ENR_WWDG1EN);\
  2622. /* Delay after an RCC peripheral clock enabling */ \
  2623. tmpreg = READ_BIT(RCC_C1->APB3ENR, RCC_APB3ENR_WWDG1EN);\
  2624. UNUSED(tmpreg); \
  2625. } while(0)
  2626. #define __HAL_RCC_C1_LTDC_CLK_DISABLE() (RCC_C1->APB3ENR) &= ~ (RCC_APB3ENR_LTDCEN)
  2627. #define __HAL_RCC_C1_DSI_CLK_DISABLE() (RCC_C1->APB3ENR) &= ~ (RCC_APB3ENR_DSIEN)
  2628. #define __HAL_RCC_C1_WWDG1_CLK_DISABLE() (RCC_C1->APB3ENR) &= ~ (RCC_APB3ENR_WWDG1EN)
  2629. /** @brief Enable or disable the APB1 peripheral clock.
  2630. * @note After reset, the peripheral clock (used for registers read/write access)
  2631. * is disabled and the application software has to enable this clock before
  2632. * using it.
  2633. */
  2634. #define __HAL_RCC_C1_TIM2_CLK_ENABLE() do { \
  2635. __IO uint32_t tmpreg; \
  2636. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM2EN);\
  2637. /* Delay after an RCC peripheral clock enabling */ \
  2638. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM2EN);\
  2639. UNUSED(tmpreg); \
  2640. } while(0)
  2641. #define __HAL_RCC_C1_TIM3_CLK_ENABLE() do { \
  2642. __IO uint32_t tmpreg; \
  2643. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM3EN);\
  2644. /* Delay after an RCC peripheral clock enabling */ \
  2645. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM3EN);\
  2646. UNUSED(tmpreg); \
  2647. } while(0)
  2648. #define __HAL_RCC_C1_TIM4_CLK_ENABLE() do { \
  2649. __IO uint32_t tmpreg; \
  2650. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM4EN);\
  2651. /* Delay after an RCC peripheral clock enabling */ \
  2652. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM4EN);\
  2653. UNUSED(tmpreg); \
  2654. } while(0)
  2655. #define __HAL_RCC_C1_TIM5_CLK_ENABLE() do { \
  2656. __IO uint32_t tmpreg; \
  2657. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM5EN);\
  2658. /* Delay after an RCC peripheral clock enabling */ \
  2659. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM5EN);\
  2660. UNUSED(tmpreg); \
  2661. } while(0)
  2662. #define __HAL_RCC_C1_TIM6_CLK_ENABLE() do { \
  2663. __IO uint32_t tmpreg; \
  2664. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM6EN);\
  2665. /* Delay after an RCC peripheral clock enabling */ \
  2666. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM6EN);\
  2667. UNUSED(tmpreg); \
  2668. } while(0)
  2669. #define __HAL_RCC_C1_TIM7_CLK_ENABLE() do { \
  2670. __IO uint32_t tmpreg; \
  2671. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM7EN);\
  2672. /* Delay after an RCC peripheral clock enabling */ \
  2673. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM7EN);\
  2674. UNUSED(tmpreg); \
  2675. } while(0)
  2676. #define __HAL_RCC_C1_TIM12_CLK_ENABLE() do { \
  2677. __IO uint32_t tmpreg; \
  2678. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM12EN);\
  2679. /* Delay after an RCC peripheral clock enabling */ \
  2680. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM12EN);\
  2681. UNUSED(tmpreg); \
  2682. } while(0)
  2683. #define __HAL_RCC_C1_TIM13_CLK_ENABLE() do { \
  2684. __IO uint32_t tmpreg; \
  2685. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM13EN);\
  2686. /* Delay after an RCC peripheral clock enabling */ \
  2687. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM13EN);\
  2688. UNUSED(tmpreg); \
  2689. } while(0)
  2690. #define __HAL_RCC_C1_TIM14_CLK_ENABLE() do { \
  2691. __IO uint32_t tmpreg; \
  2692. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM14EN);\
  2693. /* Delay after an RCC peripheral clock enabling */ \
  2694. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_TIM14EN);\
  2695. UNUSED(tmpreg); \
  2696. } while(0)
  2697. #define __HAL_RCC_C1_LPTIM1_CLK_ENABLE() do { \
  2698. __IO uint32_t tmpreg; \
  2699. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_LPTIM1EN);\
  2700. /* Delay after an RCC peripheral clock enabling */ \
  2701. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_LPTIM1EN);\
  2702. UNUSED(tmpreg); \
  2703. } while(0)
  2704. #define __HAL_RCC_C1_WWDG2_CLK_ENABLE() do { \
  2705. __IO uint32_t tmpreg; \
  2706. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_WWDG2EN);\
  2707. /* Delay after an RCC peripheral clock enabling */ \
  2708. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_WWDG2EN);\
  2709. UNUSED(tmpreg); \
  2710. } while(0)
  2711. #define __HAL_RCC_C1_SPI2_CLK_ENABLE() do { \
  2712. __IO uint32_t tmpreg; \
  2713. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_SPI2EN);\
  2714. /* Delay after an RCC peripheral clock enabling */ \
  2715. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_SPI2EN);\
  2716. UNUSED(tmpreg); \
  2717. } while(0)
  2718. #define __HAL_RCC_C1_SPI3_CLK_ENABLE() do { \
  2719. __IO uint32_t tmpreg; \
  2720. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_SPI3EN);\
  2721. /* Delay after an RCC peripheral clock enabling */ \
  2722. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_SPI3EN);\
  2723. UNUSED(tmpreg); \
  2724. } while(0)
  2725. #define __HAL_RCC_C1_SPDIFRX_CLK_ENABLE() do { \
  2726. __IO uint32_t tmpreg; \
  2727. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_SPDIFRXEN);\
  2728. /* Delay after an RCC peripheral clock enabling */ \
  2729. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_SPDIFRXEN);\
  2730. UNUSED(tmpreg); \
  2731. } while(0)
  2732. #define __HAL_RCC_C1_USART2_CLK_ENABLE() do { \
  2733. __IO uint32_t tmpreg; \
  2734. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_USART2EN);\
  2735. /* Delay after an RCC peripheral clock enabling */ \
  2736. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_USART2EN);\
  2737. UNUSED(tmpreg); \
  2738. } while(0)
  2739. #define __HAL_RCC_C1_USART3_CLK_ENABLE() do { \
  2740. __IO uint32_t tmpreg; \
  2741. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_USART3EN);\
  2742. /* Delay after an RCC peripheral clock enabling */ \
  2743. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_USART3EN);\
  2744. UNUSED(tmpreg); \
  2745. } while(0)
  2746. #define __HAL_RCC_C1_UART4_CLK_ENABLE() do { \
  2747. __IO uint32_t tmpreg; \
  2748. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_UART4EN);\
  2749. /* Delay after an RCC peripheral clock enabling */ \
  2750. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_UART4EN);\
  2751. UNUSED(tmpreg); \
  2752. } while(0)
  2753. #define __HAL_RCC_C1_UART5_CLK_ENABLE() do { \
  2754. __IO uint32_t tmpreg; \
  2755. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_UART5EN);\
  2756. /* Delay after an RCC peripheral clock enabling */ \
  2757. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_UART5EN);\
  2758. UNUSED(tmpreg); \
  2759. } while(0)
  2760. #define __HAL_RCC_C1_I2C1_CLK_ENABLE() do { \
  2761. __IO uint32_t tmpreg; \
  2762. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_I2C1EN);\
  2763. /* Delay after an RCC peripheral clock enabling */ \
  2764. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_I2C1EN);\
  2765. UNUSED(tmpreg); \
  2766. } while(0)
  2767. #define __HAL_RCC_C1_I2C2_CLK_ENABLE() do { \
  2768. __IO uint32_t tmpreg; \
  2769. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_I2C2EN);\
  2770. /* Delay after an RCC peripheral clock enabling */ \
  2771. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_I2C2EN);\
  2772. UNUSED(tmpreg); \
  2773. } while(0)
  2774. #define __HAL_RCC_C1_I2C3_CLK_ENABLE() do { \
  2775. __IO uint32_t tmpreg; \
  2776. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_I2C3EN);\
  2777. /* Delay after an RCC peripheral clock enabling */ \
  2778. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_I2C3EN);\
  2779. UNUSED(tmpreg); \
  2780. } while(0)
  2781. #define __HAL_RCC_C1_CEC_CLK_ENABLE() do { \
  2782. __IO uint32_t tmpreg; \
  2783. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_CECEN);\
  2784. /* Delay after an RCC peripheral clock enabling */ \
  2785. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_CECEN);\
  2786. UNUSED(tmpreg); \
  2787. } while(0)
  2788. #define __HAL_RCC_C1_DAC12_CLK_ENABLE() do { \
  2789. __IO uint32_t tmpreg; \
  2790. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_DAC12EN);\
  2791. /* Delay after an RCC peripheral clock enabling */ \
  2792. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_DAC12EN);\
  2793. UNUSED(tmpreg); \
  2794. } while(0)
  2795. #define __HAL_RCC_C1_UART7_CLK_ENABLE() do { \
  2796. __IO uint32_t tmpreg; \
  2797. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_UART7EN);\
  2798. /* Delay after an RCC peripheral clock enabling */ \
  2799. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_UART7EN);\
  2800. UNUSED(tmpreg); \
  2801. } while(0)
  2802. #define __HAL_RCC_C1_UART8_CLK_ENABLE() do { \
  2803. __IO uint32_t tmpreg; \
  2804. SET_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_UART8EN);\
  2805. /* Delay after an RCC peripheral clock enabling */ \
  2806. tmpreg = READ_BIT(RCC_C1->APB1LENR, RCC_APB1LENR_UART8EN);\
  2807. UNUSED(tmpreg); \
  2808. } while(0)
  2809. #define __HAL_RCC_C1_CRS_CLK_ENABLE() do { \
  2810. __IO uint32_t tmpreg; \
  2811. SET_BIT(RCC_C1->APB1HENR, RCC_APB1HENR_CRSEN);\
  2812. /* Delay after an RCC peripheral clock enabling */ \
  2813. tmpreg = READ_BIT(RCC_C1->APB1HENR, RCC_APB1HENR_CRSEN);\
  2814. UNUSED(tmpreg); \
  2815. } while(0)
  2816. #define __HAL_RCC_C1_SWPMI_CLK_ENABLE() do { \
  2817. __IO uint32_t tmpreg; \
  2818. SET_BIT(RCC_C1->APB1HENR, RCC_APB1HENR_SWPMIEN);\
  2819. /* Delay after an RCC peripheral clock enabling */ \
  2820. tmpreg = READ_BIT(RCC_C1->APB1HENR, RCC_APB1HENR_SWPMIEN);\
  2821. UNUSED(tmpreg); \
  2822. } while(0)
  2823. #define __HAL_RCC_C1_OPAMP_CLK_ENABLE() do { \
  2824. __IO uint32_t tmpreg; \
  2825. SET_BIT(RCC_C1->APB1HENR, RCC_APB1HENR_OPAMPEN);\
  2826. /* Delay after an RCC peripheral clock enabling */ \
  2827. tmpreg = READ_BIT(RCC_C1->APB1HENR, RCC_APB1HENR_OPAMPEN);\
  2828. UNUSED(tmpreg); \
  2829. } while(0)
  2830. #define __HAL_RCC_C1_MDIOS_CLK_ENABLE() do { \
  2831. __IO uint32_t tmpreg; \
  2832. SET_BIT(RCC_C1->APB1HENR, RCC_APB1HENR_MDIOSEN);\
  2833. /* Delay after an RCC peripheral clock enabling */ \
  2834. tmpreg = READ_BIT(RCC_C1->APB1HENR, RCC_APB1HENR_MDIOSEN);\
  2835. UNUSED(tmpreg); \
  2836. } while(0)
  2837. #define __HAL_RCC_C1_FDCAN_CLK_ENABLE() do { \
  2838. __IO uint32_t tmpreg; \
  2839. SET_BIT(RCC_C1->APB1HENR, RCC_APB1HENR_FDCANEN);\
  2840. /* Delay after an RCC peripheral clock enabling */ \
  2841. tmpreg = READ_BIT(RCC_C1->APB1HENR, RCC_APB1HENR_FDCANEN);\
  2842. UNUSED(tmpreg); \
  2843. } while(0)
  2844. #define __HAL_RCC_C1_TIM2_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_TIM2EN)
  2845. #define __HAL_RCC_C1_TIM3_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_TIM3EN)
  2846. #define __HAL_RCC_C1_TIM4_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_TIM4EN)
  2847. #define __HAL_RCC_C1_TIM5_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_TIM5EN)
  2848. #define __HAL_RCC_C1_TIM6_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_TIM6EN)
  2849. #define __HAL_RCC_C1_TIM7_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_TIM7EN)
  2850. #define __HAL_RCC_C1_TIM12_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_TIM12EN)
  2851. #define __HAL_RCC_C1_TIM13_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_TIM13EN)
  2852. #define __HAL_RCC_C1_TIM14_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_TIM14EN)
  2853. #define __HAL_RCC_C1_LPTIM1_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_LPTIM1EN)
  2854. #define __HAL_RCC_C1_WWDG2_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_WWDG2EN)
  2855. #define __HAL_RCC_C1_SPI2_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_SPI2EN)
  2856. #define __HAL_RCC_C1_SPI3_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_SPI3EN)
  2857. #define __HAL_RCC_C1_SPDIFRX_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_SPDIFRXEN)
  2858. #define __HAL_RCC_C1_USART2_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_USART2EN)
  2859. #define __HAL_RCC_C1_USART3_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_USART3EN)
  2860. #define __HAL_RCC_C1_UART4_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_UART4EN)
  2861. #define __HAL_RCC_C1_UART5_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_UART5EN)
  2862. #define __HAL_RCC_C1_I2C1_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_I2C1EN)
  2863. #define __HAL_RCC_C1_I2C2_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_I2C2EN)
  2864. #define __HAL_RCC_C1_I2C3_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_I2C3EN)
  2865. #define __HAL_RCC_C1_CEC_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_CECEN)
  2866. #define __HAL_RCC_C1_DAC12_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_DAC12EN)
  2867. #define __HAL_RCC_C1_UART7_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_UART7EN)
  2868. #define __HAL_RCC_C1_UART8_CLK_DISABLE() (RCC_C1->APB1LENR) &= ~ (RCC_APB1LENR_UART8EN)
  2869. #define __HAL_RCC_C1_CRS_CLK_DISABLE() (RCC_C1->APB1HENR) &= ~ (RCC_APB1HENR_CRSEN)
  2870. #define __HAL_RCC_C1_SWPMI_CLK_DISABLE() (RCC_C1->APB1HENR) &= ~ (RCC_APB1HENR_SWPMIEN)
  2871. #define __HAL_RCC_C1_OPAMP_CLK_DISABLE() (RCC_C1->APB1HENR) &= ~ (RCC_APB1HENR_OPAMPEN)
  2872. #define __HAL_RCC_C1_MDIOS_CLK_DISABLE() (RCC_C1->APB1HENR) &= ~ (RCC_APB1HENR_MDIOSEN)
  2873. #define __HAL_RCC_C1_FDCAN_CLK_DISABLE() (RCC_C1->APB1HENR) &= ~ (RCC_APB1HENR_FDCANEN)
  2874. /** @brief Enable or disable the APB2 peripheral clock.
  2875. * @note After reset, the peripheral clock (used for registers read/write access)
  2876. * is disabled and the application software has to enable this clock before
  2877. * using it.
  2878. */
  2879. #define __HAL_RCC_C1_TIM1_CLK_ENABLE() do { \
  2880. __IO uint32_t tmpreg; \
  2881. SET_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_TIM1EN);\
  2882. /* Delay after an RCC peripheral clock enabling */ \
  2883. tmpreg = READ_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_TIM1EN);\
  2884. UNUSED(tmpreg); \
  2885. } while(0)
  2886. #define __HAL_RCC_C1_TIM8_CLK_ENABLE() do { \
  2887. __IO uint32_t tmpreg; \
  2888. SET_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_TIM8EN);\
  2889. /* Delay after an RCC peripheral clock enabling */ \
  2890. tmpreg = READ_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_TIM8EN);\
  2891. UNUSED(tmpreg); \
  2892. } while(0)
  2893. #define __HAL_RCC_C1_USART1_CLK_ENABLE() do { \
  2894. __IO uint32_t tmpreg; \
  2895. SET_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_USART1EN);\
  2896. /* Delay after an RCC peripheral clock enabling */ \
  2897. tmpreg = READ_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_USART1EN);\
  2898. UNUSED(tmpreg); \
  2899. } while(0)
  2900. #define __HAL_RCC_C1_USART6_CLK_ENABLE() do { \
  2901. __IO uint32_t tmpreg; \
  2902. SET_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_USART6EN);\
  2903. /* Delay after an RCC peripheral clock enabling */ \
  2904. tmpreg = READ_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_USART6EN);\
  2905. UNUSED(tmpreg); \
  2906. } while(0)
  2907. #define __HAL_RCC_C1_SPI1_CLK_ENABLE() do { \
  2908. __IO uint32_t tmpreg; \
  2909. SET_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_SPI1EN);\
  2910. /* Delay after an RCC peripheral clock enabling */ \
  2911. tmpreg = READ_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_SPI1EN);\
  2912. UNUSED(tmpreg); \
  2913. } while(0)
  2914. #define __HAL_RCC_C1_SPI4_CLK_ENABLE() do { \
  2915. __IO uint32_t tmpreg; \
  2916. SET_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_SPI4EN);\
  2917. /* Delay after an RCC peripheral clock enabling */ \
  2918. tmpreg = READ_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_SPI4EN);\
  2919. UNUSED(tmpreg); \
  2920. } while(0)
  2921. #define __HAL_RCC_C1_TIM15_CLK_ENABLE() do { \
  2922. __IO uint32_t tmpreg; \
  2923. SET_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_TIM15EN);\
  2924. /* Delay after an RCC peripheral clock enabling */ \
  2925. tmpreg = READ_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_TIM15EN);\
  2926. UNUSED(tmpreg); \
  2927. } while(0)
  2928. #define __HAL_RCC_C1_TIM16_CLK_ENABLE() do { \
  2929. __IO uint32_t tmpreg; \
  2930. SET_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_TIM16EN);\
  2931. /* Delay after an RCC peripheral clock enabling */ \
  2932. tmpreg = READ_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_TIM16EN);\
  2933. UNUSED(tmpreg); \
  2934. } while(0)
  2935. #define __HAL_RCC_C1_TIM17_CLK_ENABLE() do { \
  2936. __IO uint32_t tmpreg; \
  2937. SET_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_TIM17EN);\
  2938. /* Delay after an RCC peripheral clock enabling */ \
  2939. tmpreg = READ_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_TIM17EN);\
  2940. UNUSED(tmpreg); \
  2941. } while(0)
  2942. #define __HAL_RCC_C1_SPI5_CLK_ENABLE() do { \
  2943. __IO uint32_t tmpreg; \
  2944. SET_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_SPI5EN);\
  2945. /* Delay after an RCC peripheral clock enabling */ \
  2946. tmpreg = READ_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_SPI5EN);\
  2947. UNUSED(tmpreg); \
  2948. } while(0)
  2949. #define __HAL_RCC_C1_SAI1_CLK_ENABLE() do { \
  2950. __IO uint32_t tmpreg; \
  2951. SET_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_SAI1EN);\
  2952. /* Delay after an RCC peripheral clock enabling */ \
  2953. tmpreg = READ_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_SAI1EN);\
  2954. UNUSED(tmpreg); \
  2955. } while(0)
  2956. #define __HAL_RCC_C1_SAI2_CLK_ENABLE() do { \
  2957. __IO uint32_t tmpreg; \
  2958. SET_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_SAI2EN);\
  2959. /* Delay after an RCC peripheral clock enabling */ \
  2960. tmpreg = READ_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_SAI2EN);\
  2961. UNUSED(tmpreg); \
  2962. } while(0)
  2963. #define __HAL_RCC_C1_SAI3_CLK_ENABLE() do { \
  2964. __IO uint32_t tmpreg; \
  2965. SET_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_SAI3EN);\
  2966. /* Delay after an RCC peripheral clock enabling */ \
  2967. tmpreg = READ_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_SAI3EN);\
  2968. UNUSED(tmpreg); \
  2969. } while(0)
  2970. #define __HAL_RCC_C1_DFSDM1_CLK_ENABLE() do { \
  2971. __IO uint32_t tmpreg; \
  2972. SET_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_DFSDM1EN);\
  2973. /* Delay after an RCC peripheral clock enabling */ \
  2974. tmpreg = READ_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_DFSDM1EN);\
  2975. UNUSED(tmpreg); \
  2976. } while(0)
  2977. #define __HAL_RCC_C1_HRTIM1_CLK_ENABLE() do { \
  2978. __IO uint32_t tmpreg; \
  2979. SET_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_HRTIMEN);\
  2980. /* Delay after an RCC peripheral clock enabling */ \
  2981. tmpreg = READ_BIT(RCC_C1->APB2ENR, RCC_APB2ENR_HRTIMEN);\
  2982. UNUSED(tmpreg); \
  2983. } while(0)
  2984. #define __HAL_RCC_C1_TIM1_CLK_DISABLE() (RCC_C1->APB2ENR) &= ~ (RCC_APB2ENR_TIM1EN)
  2985. #define __HAL_RCC_C1_TIM8_CLK_DISABLE() (RCC_C1->APB2ENR) &= ~ (RCC_APB2ENR_TIM8EN)
  2986. #define __HAL_RCC_C1_USART1_CLK_DISABLE() (RCC_C1->APB2ENR) &= ~ (RCC_APB2ENR_USART1EN)
  2987. #define __HAL_RCC_C1_USART6_CLK_DISABLE() (RCC_C1->APB2ENR) &= ~ (RCC_APB2ENR_USART6EN)
  2988. #define __HAL_RCC_C1_SPI1_CLK_DISABLE() (RCC_C1->APB2ENR) &= ~ (RCC_APB2ENR_SPI1EN)
  2989. #define __HAL_RCC_C1_SPI4_CLK_DISABLE() (RCC_C1->APB2ENR) &= ~ (RCC_APB2ENR_SPI4EN)
  2990. #define __HAL_RCC_C1_TIM15_CLK_DISABLE() (RCC_C1->APB2ENR) &= ~ (RCC_APB2ENR_TIM15EN)
  2991. #define __HAL_RCC_C1_TIM16_CLK_DISABLE() (RCC_C1->APB2ENR) &= ~ (RCC_APB2ENR_TIM16EN)
  2992. #define __HAL_RCC_C1_TIM17_CLK_DISABLE() (RCC_C1->APB2ENR) &= ~ (RCC_APB2ENR_TIM17EN)
  2993. #define __HAL_RCC_C1_SPI5_CLK_DISABLE() (RCC_C1->APB2ENR) &= ~ (RCC_APB2ENR_SPI5EN)
  2994. #define __HAL_RCC_C1_SAI1_CLK_DISABLE() (RCC_C1->APB2ENR) &= ~ (RCC_APB2ENR_SAI1EN)
  2995. #define __HAL_RCC_C1_SAI2_CLK_DISABLE() (RCC_C1->APB2ENR) &= ~ (RCC_APB2ENR_SAI2EN)
  2996. #define __HAL_RCC_C1_SAI3_CLK_DISABLE() (RCC_C1->APB2ENR) &= ~ (RCC_APB2ENR_SAI3EN)
  2997. #define __HAL_RCC_C1_DFSDM1_CLK_DISABLE() (RCC_C1->APB2ENR) &= ~ (RCC_APB2ENR_DFSDM1EN)
  2998. #define __HAL_RCC_C1_HRTIM1_CLK_DISABLE() (RCC_C1->APB2ENR) &= ~ (RCC_APB2ENR_HRTIMEN)
  2999. /** @brief Enable or disable the APB4 peripheral clock.
  3000. * @note After reset, the peripheral clock (used for registers read/write access)
  3001. * is disabled and the application software has to enable this clock before
  3002. * using it.
  3003. */
  3004. #define __HAL_RCC_C1_SYSCFG_CLK_ENABLE() do { \
  3005. __IO uint32_t tmpreg; \
  3006. SET_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_SYSCFGEN);\
  3007. /* Delay after an RCC peripheral clock enabling */ \
  3008. tmpreg = READ_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_SYSCFGEN);\
  3009. UNUSED(tmpreg); \
  3010. } while(0)
  3011. #define __HAL_RCC_C1_LPUART1_CLK_ENABLE() do { \
  3012. __IO uint32_t tmpreg; \
  3013. SET_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_LPUART1EN);\
  3014. /* Delay after an RCC peripheral clock enabling */ \
  3015. tmpreg = READ_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_LPUART1EN);\
  3016. UNUSED(tmpreg); \
  3017. } while(0)
  3018. #define __HAL_RCC_C1_SPI6_CLK_ENABLE() do { \
  3019. __IO uint32_t tmpreg; \
  3020. SET_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_SPI6EN);\
  3021. /* Delay after an RCC peripheral clock enabling */ \
  3022. tmpreg = READ_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_SPI6EN);\
  3023. UNUSED(tmpreg); \
  3024. } while(0)
  3025. #define __HAL_RCC_C1_I2C4_CLK_ENABLE() do { \
  3026. __IO uint32_t tmpreg; \
  3027. SET_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_I2C4EN);\
  3028. /* Delay after an RCC peripheral clock enabling */ \
  3029. tmpreg = READ_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_I2C4EN);\
  3030. UNUSED(tmpreg); \
  3031. } while(0)
  3032. #define __HAL_RCC_C1_LPTIM2_CLK_ENABLE() do { \
  3033. __IO uint32_t tmpreg; \
  3034. SET_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_LPTIM2EN);\
  3035. /* Delay after an RCC peripheral clock enabling */ \
  3036. tmpreg = READ_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_LPTIM2EN);\
  3037. UNUSED(tmpreg); \
  3038. } while(0)
  3039. #define __HAL_RCC_C1_LPTIM3_CLK_ENABLE() do { \
  3040. __IO uint32_t tmpreg; \
  3041. SET_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_LPTIM3EN);\
  3042. /* Delay after an RCC peripheral clock enabling */ \
  3043. tmpreg = READ_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_LPTIM3EN);\
  3044. UNUSED(tmpreg); \
  3045. } while(0)
  3046. #define __HAL_RCC_C1_LPTIM4_CLK_ENABLE() do { \
  3047. __IO uint32_t tmpreg; \
  3048. SET_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_LPTIM4EN);\
  3049. /* Delay after an RCC peripheral clock enabling */ \
  3050. tmpreg = READ_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_LPTIM4EN);\
  3051. UNUSED(tmpreg); \
  3052. } while(0)
  3053. #define __HAL_RCC_C1_LPTIM5_CLK_ENABLE() do { \
  3054. __IO uint32_t tmpreg; \
  3055. SET_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_LPTIM5EN);\
  3056. /* Delay after an RCC peripheral clock enabling */ \
  3057. tmpreg = READ_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_LPTIM5EN);\
  3058. UNUSED(tmpreg); \
  3059. } while(0)
  3060. #define __HAL_RCC_C1_COMP12_CLK_ENABLE() do { \
  3061. __IO uint32_t tmpreg; \
  3062. SET_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_COMP12EN);\
  3063. /* Delay after an RCC peripheral clock enabling */ \
  3064. tmpreg = READ_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_COMP12EN);\
  3065. UNUSED(tmpreg); \
  3066. } while(0)
  3067. #define __HAL_RCC_C1_VREF_CLK_ENABLE() do { \
  3068. __IO uint32_t tmpreg; \
  3069. SET_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_VREFEN);\
  3070. /* Delay after an RCC peripheral clock enabling */ \
  3071. tmpreg = READ_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_VREFEN);\
  3072. UNUSED(tmpreg); \
  3073. } while(0)
  3074. #define __HAL_RCC_C1_RTC_CLK_ENABLE() do { \
  3075. __IO uint32_t tmpreg; \
  3076. SET_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_RTCAPBEN);\
  3077. /* Delay after an RCC peripheral clock enabling */ \
  3078. tmpreg = READ_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_RTCAPBEN);\
  3079. UNUSED(tmpreg); \
  3080. } while(0)
  3081. #define __HAL_RCC_C1_SAI4_CLK_ENABLE() do { \
  3082. __IO uint32_t tmpreg; \
  3083. SET_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_SAI4EN);\
  3084. /* Delay after an RCC peripheral clock enabling */ \
  3085. tmpreg = READ_BIT(RCC_C1->APB4ENR, RCC_APB4ENR_SAI4EN);\
  3086. UNUSED(tmpreg); \
  3087. } while(0)
  3088. #define __HAL_RCC_C1_SYSCFG_CLK_DISABLE() (RCC_C1->APB4ENR) &= ~ (RCC_APB4ENR_SYSCFGEN)
  3089. #define __HAL_RCC_C1_LPUART1_CLK_DISABLE() (RCC_C1->APB4ENR) &= ~ (RCC_APB4ENR_LPUART1EN)
  3090. #define __HAL_RCC_C1_SPI6_CLK_DISABLE() (RCC_C1->APB4ENR) &= ~ (RCC_APB4ENR_SPI6EN)
  3091. #define __HAL_RCC_C1_I2C4_CLK_DISABLE() (RCC_C1->APB4ENR) &= ~ (RCC_APB4ENR_I2C4EN)
  3092. #define __HAL_RCC_C1_LPTIM2_CLK_DISABLE() (RCC_C1->APB4ENR) &= ~ (RCC_APB4ENR_LPTIM2EN)
  3093. #define __HAL_RCC_C1_LPTIM3_CLK_DISABLE() (RCC_C1->APB4ENR) &= ~ (RCC_APB4ENR_LPTIM3EN)
  3094. #define __HAL_RCC_C1_LPTIM4_CLK_DISABLE() (RCC_C1->APB4ENR) &= ~ (RCC_APB4ENR_LPTIM4EN)
  3095. #define __HAL_RCC_C1_LPTIM5_CLK_DISABLE() (RCC_C1->APB4ENR) &= ~ (RCC_APB4ENR_LPTIM5EN)
  3096. #define __HAL_RCC_C1_COMP12_CLK_DISABLE() (RCC_C1->APB4ENR) &= ~ (RCC_APB4ENR_COMP12EN)
  3097. #define __HAL_RCC_C1_VREF_CLK_DISABLE() (RCC_C1->APB4ENR) &= ~ (RCC_APB4ENR_VREFEN)
  3098. #define __HAL_RCC_C1_RTC_CLK_DISABLE() (RCC_C1->APB4ENR) &= ~ (RCC_APB4ENR_RTCAPBEN)
  3099. #define __HAL_RCC_C1_SAI4_CLK_DISABLE() (RCC_C1->APB4ENR) &= ~ (RCC_APB4ENR_SAI4EN)
  3100. /* Exported macros for RCC_C2 -------------------------------------------------*/
  3101. /** @brief Enable or disable the AHB3 peripheral clock.
  3102. * @note After reset, the peripheral clock (used for registers read/write access)
  3103. * is disabled and the application software has to enable this clock before
  3104. * using it.
  3105. */
  3106. #define __HAL_RCC_C2_MDMA_CLK_ENABLE() do { \
  3107. __IO uint32_t tmpreg; \
  3108. SET_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_MDMAEN);\
  3109. /* Delay after an RCC peripheral clock enabling */ \
  3110. tmpreg = READ_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_MDMAEN);\
  3111. UNUSED(tmpreg); \
  3112. } while(0)
  3113. #define __HAL_RCC_C2_DMA2D_CLK_ENABLE() do { \
  3114. __IO uint32_t tmpreg; \
  3115. SET_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_DMA2DEN);\
  3116. /* Delay after an RCC peripheral clock enabling */ \
  3117. tmpreg = READ_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_DMA2DEN);\
  3118. UNUSED(tmpreg); \
  3119. } while(0)
  3120. #define __HAL_RCC_C2_JPGDECEN_CLK_ENABLE() do { \
  3121. __IO uint32_t tmpreg; \
  3122. SET_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_JPGDECEN);\
  3123. /* Delay after an RCC peripheral clock enabling */ \
  3124. tmpreg = READ_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_JPGDECEN);\
  3125. UNUSED(tmpreg); \
  3126. } while(0)
  3127. #define __HAL_RCC_FLASH_C2_ALLOCATE() do { \
  3128. __IO uint32_t tmpreg; \
  3129. SET_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_FLASHEN);\
  3130. /* Delay after an RCC peripheral clock enabling */ \
  3131. tmpreg = READ_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_FLASHEN);\
  3132. UNUSED(tmpreg); \
  3133. } while(0)
  3134. #define __HAL_RCC_DTCM1_C2_ALLOCATE() do { \
  3135. __IO uint32_t tmpreg; \
  3136. SET_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_DTCM1EN);\
  3137. /* Delay after an RCC peripheral clock enabling */ \
  3138. tmpreg = READ_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_DTCM1EN);\
  3139. UNUSED(tmpreg); \
  3140. } while(0)
  3141. #define __HAL_RCC_DTCM2_C2_ALLOCATE() do { \
  3142. __IO uint32_t tmpreg; \
  3143. SET_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_DTCM2EN);\
  3144. /* Delay after an RCC peripheral clock enabling */ \
  3145. tmpreg = READ_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_DTCM2EN);\
  3146. UNUSED(tmpreg); \
  3147. } while(0)
  3148. #define __HAL_RCC_ITCM_C2_ALLOCATE() do { \
  3149. __IO uint32_t tmpreg; \
  3150. SET_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_ITCMEN);\
  3151. /* Delay after an RCC peripheral clock enabling */ \
  3152. tmpreg = READ_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_ITCMEN);\
  3153. UNUSED(tmpreg); \
  3154. } while(0)
  3155. #define __HAL_RCC_D1SRAM1_C2_ALLOCATE() do { \
  3156. __IO uint32_t tmpreg; \
  3157. SET_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_AXISRAMEN);\
  3158. /* Delay after an RCC peripheral clock enabling */ \
  3159. tmpreg = READ_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_AXISRAMEN);\
  3160. UNUSED(tmpreg); \
  3161. } while(0)
  3162. #define __HAL_RCC_C2_FMC_CLK_ENABLE() do { \
  3163. __IO uint32_t tmpreg; \
  3164. SET_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_FMCEN);\
  3165. /* Delay after an RCC peripheral clock enabling */ \
  3166. tmpreg = READ_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_FMCEN);\
  3167. UNUSED(tmpreg); \
  3168. } while(0)
  3169. #define __HAL_RCC_C2_QSPI_CLK_ENABLE() do { \
  3170. __IO uint32_t tmpreg; \
  3171. SET_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_QSPIEN);\
  3172. /* Delay after an RCC peripheral clock enabling */ \
  3173. tmpreg = READ_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_QSPIEN);\
  3174. UNUSED(tmpreg); \
  3175. } while(0)
  3176. #define __HAL_RCC_C2_SDMMC1_CLK_ENABLE() do { \
  3177. __IO uint32_t tmpreg; \
  3178. SET_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_SDMMC1EN);\
  3179. /* Delay after an RCC peripheral clock enabling */ \
  3180. tmpreg = READ_BIT(RCC_C2->AHB3ENR, RCC_AHB3ENR_SDMMC1EN);\
  3181. UNUSED(tmpreg); \
  3182. } while(0)
  3183. #define __HAL_RCC_C2_MDMA_CLK_DISABLE() (RCC_C2->AHB3ENR &= ~ (RCC_AHB3ENR_MDMAEN))
  3184. #define __HAL_RCC_C2_DMA2D_CLK_DISABLE() (RCC_C2->AHB3ENR &= ~ (RCC_AHB3ENR_DMA2DEN))
  3185. #define __HAL_RCC_C2_JPGDECEN_CLK_DISABLE() (RCC_C2->AHB3ENR &= ~ (RCC_AHB3ENR_JPGDECEN))
  3186. #define __HAL_RCC_C2_FMC_CLK_DISABLE() (RCC_C2->AHB3ENR &= ~ (RCC_AHB3ENR_FMCEN))
  3187. #define __HAL_RCC_C2_QSPI_CLK_DISABLE() (RCC_C2->AHB3ENR &= ~ (RCC_AHB3ENR_QSPIEN))
  3188. #define __HAL_RCC_C2_SDMMC1_CLK_DISABLE() (RCC_C2->AHB3ENR &= ~ (RCC_AHB3ENR_SDMMC1EN))
  3189. #define __HAL_RCC_FLASH_C2_DEALLOCATE() (RCC_C2->AHB3ENR &= ~ (RCC_AHB3ENR_FLASHEN))
  3190. #define __HAL_RCC_DTCM1_C2_DEALLOCATE() (RCC_C2->AHB3ENR &= ~ (RCC_AHB3ENR_DTCM1EN))
  3191. #define __HAL_RCC_DTCM2_C2_DEALLOCATE() (RCC_C2->AHB3ENR &= ~ (RCC_AHB3ENR_DTCM2EN))
  3192. #define __HAL_RCC_ITCM_C2_DEALLOCATE() (RCC_C2->AHB3ENR &= ~ (RCC_AHB3ENR_ITCMEN))
  3193. #define __HAL_RCC_D1SRAM1_C2_DEALLOCATE() (RCC_C2->AHB3ENR &= ~ (RCC_AHB3ENR_AXISRAMEN))
  3194. /** @brief Enable or disable the AHB1 peripheral clock.
  3195. * @note After reset, the peripheral clock (used for registers read/write access)
  3196. * is disabled and the application software has to enable this clock before
  3197. * using it.
  3198. */
  3199. #define __HAL_RCC_C2_DMA1_CLK_ENABLE() do { \
  3200. __IO uint32_t tmpreg; \
  3201. SET_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_DMA1EN);\
  3202. /* Delay after an RCC peripheral clock enabling */ \
  3203. tmpreg = READ_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_DMA1EN);\
  3204. UNUSED(tmpreg); \
  3205. } while(0)
  3206. #define __HAL_RCC_C2_DMA2_CLK_ENABLE() do { \
  3207. __IO uint32_t tmpreg; \
  3208. SET_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_DMA2EN);\
  3209. /* Delay after an RCC peripheral clock enabling */ \
  3210. tmpreg = READ_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_DMA2EN);\
  3211. UNUSED(tmpreg); \
  3212. } while(0)
  3213. #define __HAL_RCC_C2_ADC12_CLK_ENABLE() do { \
  3214. __IO uint32_t tmpreg; \
  3215. SET_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_ADC12EN);\
  3216. /* Delay after an RCC peripheral clock enabling */ \
  3217. tmpreg = READ_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_ADC12EN);\
  3218. UNUSED(tmpreg); \
  3219. } while(0)
  3220. #define __HAL_RCC_C2_ART_CLK_ENABLE() do { \
  3221. __IO uint32_t tmpreg; \
  3222. SET_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_ARTEN);\
  3223. /* Delay after an RCC peripheral clock enabling */ \
  3224. tmpreg = READ_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_ARTEN);\
  3225. UNUSED(tmpreg); \
  3226. } while(0)
  3227. #define __HAL_RCC_C2_ETH1MAC_CLK_ENABLE() do { \
  3228. __IO uint32_t tmpreg; \
  3229. SET_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_ETH1MACEN);\
  3230. /* Delay after an RCC peripheral clock enabling */ \
  3231. tmpreg = READ_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_ETH1MACEN);\
  3232. UNUSED(tmpreg); \
  3233. } while(0)
  3234. #define __HAL_RCC_C2_ETH1TX_CLK_ENABLE() do { \
  3235. __IO uint32_t tmpreg; \
  3236. SET_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_ETH1TXEN);\
  3237. /* Delay after an RCC peripheral clock enabling */ \
  3238. tmpreg = READ_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_ETH1TXEN);\
  3239. UNUSED(tmpreg); \
  3240. } while(0)
  3241. #define __HAL_RCC_C2_ETH1RX_CLK_ENABLE() do { \
  3242. __IO uint32_t tmpreg; \
  3243. SET_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_ETH1RXEN);\
  3244. /* Delay after an RCC peripheral clock enabling */ \
  3245. tmpreg = READ_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_ETH1RXEN);\
  3246. UNUSED(tmpreg); \
  3247. } while(0)
  3248. #define __HAL_RCC_C2_USB1_OTG_HS_CLK_ENABLE() do { \
  3249. __IO uint32_t tmpreg; \
  3250. SET_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_USB1OTGHSEN);\
  3251. /* Delay after an RCC peripheral clock enabling */ \
  3252. tmpreg = READ_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_USB1OTGHSEN);\
  3253. UNUSED(tmpreg); \
  3254. } while(0)
  3255. #define __HAL_RCC_C2_USB1_OTG_HS_ULPI_CLK_ENABLE() do { \
  3256. __IO uint32_t tmpreg; \
  3257. SET_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_USB1OTGHSULPIEN);\
  3258. /* Delay after an RCC peripheral clock enabling */ \
  3259. tmpreg = READ_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_USB1OTGHSULPIEN);\
  3260. UNUSED(tmpreg); \
  3261. } while(0)
  3262. #define __HAL_RCC_C2_USB2_OTG_FS_CLK_ENABLE() do { \
  3263. __IO uint32_t tmpreg; \
  3264. SET_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_USB2OTGHSEN);\
  3265. /* Delay after an RCC peripheral clock enabling */ \
  3266. tmpreg = READ_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_USB2OTGHSEN);\
  3267. UNUSED(tmpreg); \
  3268. } while(0)
  3269. #define __HAL_RCC_C2_USB2_OTG_FS_ULPI_CLK_ENABLE() do { \
  3270. __IO uint32_t tmpreg; \
  3271. SET_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_USB2OTGHSULPIEN);\
  3272. /* Delay after an RCC peripheral clock enabling */ \
  3273. tmpreg = READ_BIT(RCC_C2->AHB1ENR, RCC_AHB1ENR_USB2OTGHSULPIEN);\
  3274. UNUSED(tmpreg); \
  3275. } while(0)
  3276. #define __HAL_RCC_C2_DMA1_CLK_DISABLE() (RCC_C2->AHB1ENR &= ~ (RCC_AHB1ENR_DMA1EN))
  3277. #define __HAL_RCC_C2_DMA2_CLK_DISABLE() (RCC_C2->AHB1ENR &= ~ (RCC_AHB1ENR_DMA2EN))
  3278. #define __HAL_RCC_C2_ADC12_CLK_DISABLE() (RCC_C2->AHB1ENR &= ~ (RCC_AHB1ENR_ADC12EN))
  3279. #define __HAL_RCC_C2_ART_CLK_DISABLE() (RCC_C2->AHB1ENR &= ~ (RCC_AHB1ENR_ARTEN))
  3280. #define __HAL_RCC_C2_ETH1MAC_CLK_DISABLE() (RCC_C2->AHB1ENR &= ~ (RCC_AHB1ENR_ETH1MACEN))
  3281. #define __HAL_RCC_C2_ETH1TX_CLK_DISABLE() (RCC_C2->AHB1ENR &= ~ (RCC_AHB1ENR_ETH1TXEN))
  3282. #define __HAL_RCC_C2_ETH1RX_CLK_DISABLE() (RCC_C2->AHB1ENR &= ~ (RCC_AHB1ENR_ETH1RXEN))
  3283. #define __HAL_RCC_C2_USB1_OTG_HS_CLK_DISABLE() (RCC_C2->AHB1ENR &= ~ (RCC_AHB1ENR_USB1OTGHSEN))
  3284. #define __HAL_RCC_C2_USB1_OTG_HS_ULPI_CLK_DISABLE() (RCC_C2->AHB1ENR &= ~ (RCC_AHB1ENR_USB1OTGHSULPIEN))
  3285. #define __HAL_RCC_C2_USB2_OTG_FS_CLK_DISABLE() (RCC_C2->AHB1ENR &= ~ (RCC_AHB1ENR_USB2OTGHSEN))
  3286. #define __HAL_RCC_C2_USB2_OTG_FS_ULPI_CLK_DISABLE() (RCC_C2->AHB1ENR &= ~ (RCC_AHB1ENR_USB2OTGHSULPIEN))
  3287. /** @brief Enable or disable the AHB2 peripheral clock.
  3288. * @note After reset, the peripheral clock (used for registers read/write access)
  3289. * is disabled and the application software has to enable this clock before
  3290. * using it.
  3291. */
  3292. #define __HAL_RCC_C2_DCMI_CLK_ENABLE() do { \
  3293. __IO uint32_t tmpreg; \
  3294. SET_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_DCMIEN);\
  3295. /* Delay after an RCC peripheral clock enabling */ \
  3296. tmpreg = READ_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_DCMIEN);\
  3297. UNUSED(tmpreg); \
  3298. } while(0)
  3299. #define __HAL_RCC_C2_CRYP_CLK_ENABLE() do { \
  3300. __IO uint32_t tmpreg; \
  3301. SET_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_CRYPEN);\
  3302. /* Delay after an RCC peripheral clock enabling */ \
  3303. tmpreg = READ_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_CRYPEN);\
  3304. UNUSED(tmpreg); \
  3305. } while(0)
  3306. #define __HAL_RCC_C2_HASH_CLK_ENABLE() do { \
  3307. __IO uint32_t tmpreg; \
  3308. SET_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_HASHEN);\
  3309. /* Delay after an RCC peripheral clock enabling */ \
  3310. tmpreg = READ_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_HASHEN);\
  3311. UNUSED(tmpreg); \
  3312. } while(0)
  3313. #define __HAL_RCC_C2_RNG_CLK_ENABLE() do { \
  3314. __IO uint32_t tmpreg; \
  3315. SET_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_RNGEN);\
  3316. /* Delay after an RCC peripheral clock enabling */ \
  3317. tmpreg = READ_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_RNGEN);\
  3318. UNUSED(tmpreg); \
  3319. } while(0)
  3320. #define __HAL_RCC_C2_SDMMC2_CLK_ENABLE() do { \
  3321. __IO uint32_t tmpreg; \
  3322. SET_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_SDMMC2EN);\
  3323. /* Delay after an RCC peripheral clock enabling */ \
  3324. tmpreg = READ_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_SDMMC2EN);\
  3325. UNUSED(tmpreg); \
  3326. } while(0)
  3327. #define __HAL_RCC_C2_D2SRAM1_CLK_ENABLE() do { \
  3328. __IO uint32_t tmpreg; \
  3329. SET_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_D2SRAM1EN);\
  3330. /* Delay after an RCC peripheral clock enabling */ \
  3331. tmpreg = READ_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_D2SRAM1EN);\
  3332. UNUSED(tmpreg); \
  3333. } while(0)
  3334. #define __HAL_RCC_C2_D2SRAM2_CLK_ENABLE() do { \
  3335. __IO uint32_t tmpreg; \
  3336. SET_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_D2SRAM2EN);\
  3337. /* Delay after an RCC peripheral clock enabling */ \
  3338. tmpreg = READ_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_D2SRAM2EN);\
  3339. UNUSED(tmpreg); \
  3340. } while(0)
  3341. #define __HAL_RCC_C2_D2SRAM3_CLK_ENABLE() do { \
  3342. __IO uint32_t tmpreg; \
  3343. SET_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_D2SRAM3EN);\
  3344. /* Delay after an RCC peripheral clock enabling */ \
  3345. tmpreg = READ_BIT(RCC_C2->AHB2ENR, RCC_AHB2ENR_D2SRAM3EN);\
  3346. UNUSED(tmpreg); \
  3347. } while(0)
  3348. #define __HAL_RCC_C2_DCMI_CLK_DISABLE() (RCC_C2->AHB2ENR &= ~ (RCC_AHB2ENR_DCMIEN))
  3349. #define __HAL_RCC_C2_CRYP_CLK_DISABLE() (RCC_C2->AHB2ENR &= ~ (RCC_AHB2ENR_CRYPEN))
  3350. #define __HAL_RCC_C2_HASH_CLK_DISABLE() (RCC_C2->AHB2ENR &= ~ (RCC_AHB2ENR_HASHEN))
  3351. #define __HAL_RCC_C2_RNG_CLK_DISABLE() (RCC_C2->AHB2ENR &= ~ (RCC_AHB2ENR_RNGEN))
  3352. #define __HAL_RCC_C2_SDMMC2_CLK_DISABLE() (RCC_C2->AHB2ENR &= ~ (RCC_AHB2ENR_SDMMC2EN))
  3353. #define __HAL_RCC_C2_D2SRAM1_CLK_DISABLE() (RCC_C2->AHB2ENR &= ~ (RCC_AHB2ENR_D2SRAM1EN))
  3354. #define __HAL_RCC_C2_D2SRAM2_CLK_DISABLE() (RCC_C2->AHB2ENR &= ~ (RCC_AHB2ENR_D2SRAM2EN))
  3355. #define __HAL_RCC_C2_D2SRAM3_CLK_DISABLE() (RCC_C2->AHB2ENR &= ~ (RCC_AHB2ENR_D2SRAM3EN))
  3356. /** @brief Enable or disable the AHB4 peripheral clock.
  3357. * @note After reset, the peripheral clock (used for registers read/write access)
  3358. * is disabled and the application software has to enable this clock before
  3359. * using it.
  3360. */
  3361. #define __HAL_RCC_C2_GPIOA_CLK_ENABLE() do { \
  3362. __IO uint32_t tmpreg; \
  3363. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOAEN);\
  3364. /* Delay after an RCC peripheral clock enabling */ \
  3365. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOAEN);\
  3366. UNUSED(tmpreg); \
  3367. } while(0)
  3368. #define __HAL_RCC_C2_GPIOB_CLK_ENABLE() do { \
  3369. __IO uint32_t tmpreg; \
  3370. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOBEN);\
  3371. /* Delay after an RCC peripheral clock enabling */ \
  3372. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOBEN);\
  3373. UNUSED(tmpreg); \
  3374. } while(0)
  3375. #define __HAL_RCC_C2_GPIOC_CLK_ENABLE() do { \
  3376. __IO uint32_t tmpreg; \
  3377. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOCEN);\
  3378. /* Delay after an RCC peripheral clock enabling */ \
  3379. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOCEN);\
  3380. UNUSED(tmpreg); \
  3381. } while(0)
  3382. #define __HAL_RCC_C2_GPIOD_CLK_ENABLE() do { \
  3383. __IO uint32_t tmpreg; \
  3384. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIODEN);\
  3385. /* Delay after an RCC peripheral clock enabling */ \
  3386. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIODEN);\
  3387. UNUSED(tmpreg); \
  3388. } while(0)
  3389. #define __HAL_RCC_C2_GPIOE_CLK_ENABLE() do { \
  3390. __IO uint32_t tmpreg; \
  3391. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOEEN);\
  3392. /* Delay after an RCC peripheral clock enabling */ \
  3393. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOEEN);\
  3394. UNUSED(tmpreg); \
  3395. } while(0)
  3396. #define __HAL_RCC_C2_GPIOF_CLK_ENABLE() do { \
  3397. __IO uint32_t tmpreg; \
  3398. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOFEN);\
  3399. /* Delay after an RCC peripheral clock enabling */ \
  3400. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOFEN);\
  3401. UNUSED(tmpreg); \
  3402. } while(0)
  3403. #define __HAL_RCC_C2_GPIOG_CLK_ENABLE() do { \
  3404. __IO uint32_t tmpreg; \
  3405. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOGEN);\
  3406. /* Delay after an RCC peripheral clock enabling */ \
  3407. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOGEN);\
  3408. UNUSED(tmpreg); \
  3409. } while(0)
  3410. #define __HAL_RCC_C2_GPIOH_CLK_ENABLE() do { \
  3411. __IO uint32_t tmpreg; \
  3412. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOHEN);\
  3413. /* Delay after an RCC peripheral clock enabling */ \
  3414. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOHEN);\
  3415. UNUSED(tmpreg); \
  3416. } while(0)
  3417. #define __HAL_RCC_C2_GPIOI_CLK_ENABLE() do { \
  3418. __IO uint32_t tmpreg; \
  3419. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOIEN);\
  3420. /* Delay after an RCC peripheral clock enabling */ \
  3421. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOIEN);\
  3422. UNUSED(tmpreg); \
  3423. } while(0)
  3424. #define __HAL_RCC_C2_GPIOJ_CLK_ENABLE() do { \
  3425. __IO uint32_t tmpreg; \
  3426. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOJEN);\
  3427. /* Delay after an RCC peripheral clock enabling */ \
  3428. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOJEN);\
  3429. UNUSED(tmpreg); \
  3430. } while(0)
  3431. #define __HAL_RCC_C2_GPIOK_CLK_ENABLE() do { \
  3432. __IO uint32_t tmpreg; \
  3433. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOKEN);\
  3434. /* Delay after an RCC peripheral clock enabling */ \
  3435. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_GPIOKEN);\
  3436. UNUSED(tmpreg); \
  3437. } while(0)
  3438. #define __HAL_RCC_C2_CRC_CLK_ENABLE() do { \
  3439. __IO uint32_t tmpreg; \
  3440. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_CRCEN);\
  3441. /* Delay after an RCC peripheral clock enabling */ \
  3442. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_CRCEN);\
  3443. UNUSED(tmpreg); \
  3444. } while(0)
  3445. #define __HAL_RCC_C2_BDMA_CLK_ENABLE() do { \
  3446. __IO uint32_t tmpreg; \
  3447. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_BDMAEN);\
  3448. /* Delay after an RCC peripheral clock enabling */ \
  3449. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_BDMAEN);\
  3450. UNUSED(tmpreg); \
  3451. } while(0)
  3452. #define __HAL_RCC_C2_ADC3_CLK_ENABLE() do { \
  3453. __IO uint32_t tmpreg; \
  3454. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_ADC3EN);\
  3455. /* Delay after an RCC peripheral clock enabling */ \
  3456. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_ADC3EN);\
  3457. UNUSED(tmpreg); \
  3458. } while(0)
  3459. #define __HAL_RCC_C2_HSEM_CLK_ENABLE() do { \
  3460. __IO uint32_t tmpreg; \
  3461. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_HSEMEN);\
  3462. /* Delay after an RCC peripheral clock enabling */ \
  3463. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_HSEMEN);\
  3464. UNUSED(tmpreg); \
  3465. } while(0)
  3466. #define __HAL_RCC_C2_BKPRAM_CLK_ENABLE() do { \
  3467. __IO uint32_t tmpreg; \
  3468. SET_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_BKPRAMEN);\
  3469. /* Delay after an RCC peripheral clock enabling */ \
  3470. tmpreg = READ_BIT(RCC_C2->AHB4ENR, RCC_AHB4ENR_BKPRAMEN);\
  3471. UNUSED(tmpreg); \
  3472. } while(0)
  3473. #define __HAL_RCC_C2_GPIOA_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOAEN)
  3474. #define __HAL_RCC_C2_GPIOB_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOBEN)
  3475. #define __HAL_RCC_C2_GPIOC_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOCEN)
  3476. #define __HAL_RCC_C2_GPIOD_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIODEN)
  3477. #define __HAL_RCC_C2_GPIOE_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOEEN)
  3478. #define __HAL_RCC_C2_GPIOF_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOFEN)
  3479. #define __HAL_RCC_C2_GPIOG_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOGEN)
  3480. #define __HAL_RCC_C2_GPIOH_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOHEN)
  3481. #define __HAL_RCC_C2_GPIOI_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOIEN)
  3482. #define __HAL_RCC_C2_GPIOJ_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOJEN)
  3483. #define __HAL_RCC_C2_GPIOK_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_GPIOKEN)
  3484. #define __HAL_RCC_C2_CRC_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_CRCEN)
  3485. #define __HAL_RCC_C2_BDMA_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_BDMAEN)
  3486. #define __HAL_RCC_C2_ADC3_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_ADC3EN)
  3487. #define __HAL_RCC_C2_HSEM_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_HSEMEN)
  3488. #define __HAL_RCC_C2_BKPRAM_CLK_DISABLE() (RCC_C2->AHB4ENR) &= ~ (RCC_AHB4ENR_BKPRAMEN)
  3489. /** @brief Enable or disable the APB3 peripheral clock.
  3490. * @note After reset, the peripheral clock (used for registers read/write access)
  3491. * is disabled and the application software has to enable this clock before
  3492. * using it.
  3493. */
  3494. #define __HAL_RCC_C2_LTDC_CLK_ENABLE() do { \
  3495. __IO uint32_t tmpreg; \
  3496. SET_BIT(RCC_C2->APB3ENR, RCC_APB3ENR_LTDCEN);\
  3497. /* Delay after an RCC peripheral clock enabling */ \
  3498. tmpreg = READ_BIT(RCC_C2->APB3ENR, RCC_APB3ENR_LTDCEN);\
  3499. UNUSED(tmpreg); \
  3500. } while(0)
  3501. #define __HAL_RCC_C2_DSI_CLK_ENABLE() do { \
  3502. __IO uint32_t tmpreg; \
  3503. SET_BIT(RCC_C2->APB3ENR, RCC_APB3ENR_DSIEN);\
  3504. /* Delay after an RCC peripheral clock enabling */ \
  3505. tmpreg = READ_BIT(RCC_C2->APB3ENR, RCC_APB3ENR_DSIEN);\
  3506. UNUSED(tmpreg); \
  3507. } while(0)
  3508. #define __HAL_RCC_C2_WWDG1_CLK_ENABLE() do { \
  3509. __IO uint32_t tmpreg; \
  3510. SET_BIT(RCC_C2->APB3ENR, RCC_APB3ENR_WWDG1EN);\
  3511. /* Delay after an RCC peripheral clock enabling */ \
  3512. tmpreg = READ_BIT(RCC_C2->APB3ENR, RCC_APB3ENR_WWDG1EN);\
  3513. UNUSED(tmpreg); \
  3514. } while(0)
  3515. #define __HAL_RCC_C2_LTDC_CLK_DISABLE() (RCC_C2->APB3ENR) &= ~ (RCC_APB3ENR_LTDCEN)
  3516. #define __HAL_RCC_C2_DSI_CLK_DISABLE() (RCC_C2->APB3ENR) &= ~ (RCC_APB3ENR_DSIEN)
  3517. #define __HAL_RCC_C2_WWDG1_CLK_DISABLE() (RCC_C2->APB3ENR) &= ~ (RCC_APB3ENR_WWDG1EN)
  3518. /** @brief Enable or disable the APB1 peripheral clock.
  3519. * @note After reset, the peripheral clock (used for registers read/write access)
  3520. * is disabled and the application software has to enable this clock before
  3521. * using it.
  3522. */
  3523. #define __HAL_RCC_C2_TIM2_CLK_ENABLE() do { \
  3524. __IO uint32_t tmpreg; \
  3525. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM2EN);\
  3526. /* Delay after an RCC peripheral clock enabling */ \
  3527. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM2EN);\
  3528. UNUSED(tmpreg); \
  3529. } while(0)
  3530. #define __HAL_RCC_C2_TIM3_CLK_ENABLE() do { \
  3531. __IO uint32_t tmpreg; \
  3532. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM3EN);\
  3533. /* Delay after an RCC peripheral clock enabling */ \
  3534. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM3EN);\
  3535. UNUSED(tmpreg); \
  3536. } while(0)
  3537. #define __HAL_RCC_C2_TIM4_CLK_ENABLE() do { \
  3538. __IO uint32_t tmpreg; \
  3539. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM4EN);\
  3540. /* Delay after an RCC peripheral clock enabling */ \
  3541. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM4EN);\
  3542. UNUSED(tmpreg); \
  3543. } while(0)
  3544. #define __HAL_RCC_C2_TIM5_CLK_ENABLE() do { \
  3545. __IO uint32_t tmpreg; \
  3546. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM5EN);\
  3547. /* Delay after an RCC peripheral clock enabling */ \
  3548. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM5EN);\
  3549. UNUSED(tmpreg); \
  3550. } while(0)
  3551. #define __HAL_RCC_C2_TIM6_CLK_ENABLE() do { \
  3552. __IO uint32_t tmpreg; \
  3553. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM6EN);\
  3554. /* Delay after an RCC peripheral clock enabling */ \
  3555. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM6EN);\
  3556. UNUSED(tmpreg); \
  3557. } while(0)
  3558. #define __HAL_RCC_C2_TIM7_CLK_ENABLE() do { \
  3559. __IO uint32_t tmpreg; \
  3560. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM7EN);\
  3561. /* Delay after an RCC peripheral clock enabling */ \
  3562. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM7EN);\
  3563. UNUSED(tmpreg); \
  3564. } while(0)
  3565. #define __HAL_RCC_C2_TIM12_CLK_ENABLE() do { \
  3566. __IO uint32_t tmpreg; \
  3567. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM12EN);\
  3568. /* Delay after an RCC peripheral clock enabling */ \
  3569. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM12EN);\
  3570. UNUSED(tmpreg); \
  3571. } while(0)
  3572. #define __HAL_RCC_C2_TIM13_CLK_ENABLE() do { \
  3573. __IO uint32_t tmpreg; \
  3574. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM13EN);\
  3575. /* Delay after an RCC peripheral clock enabling */ \
  3576. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM13EN);\
  3577. UNUSED(tmpreg); \
  3578. } while(0)
  3579. #define __HAL_RCC_C2_TIM14_CLK_ENABLE() do { \
  3580. __IO uint32_t tmpreg; \
  3581. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM14EN);\
  3582. /* Delay after an RCC peripheral clock enabling */ \
  3583. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_TIM14EN);\
  3584. UNUSED(tmpreg); \
  3585. } while(0)
  3586. #define __HAL_RCC_C2_LPTIM1_CLK_ENABLE() do { \
  3587. __IO uint32_t tmpreg; \
  3588. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_LPTIM1EN);\
  3589. /* Delay after an RCC peripheral clock enabling */ \
  3590. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_LPTIM1EN);\
  3591. UNUSED(tmpreg); \
  3592. } while(0)
  3593. #define __HAL_RCC_C2_WWDG2_CLK_ENABLE() do { \
  3594. __IO uint32_t tmpreg; \
  3595. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_WWDG2EN);\
  3596. /* Delay after an RCC peripheral clock enabling */ \
  3597. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_WWDG2EN);\
  3598. UNUSED(tmpreg); \
  3599. } while(0)
  3600. #define __HAL_RCC_C2_SPI2_CLK_ENABLE() do { \
  3601. __IO uint32_t tmpreg; \
  3602. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_SPI2EN);\
  3603. /* Delay after an RCC peripheral clock enabling */ \
  3604. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_SPI2EN);\
  3605. UNUSED(tmpreg); \
  3606. } while(0)
  3607. #define __HAL_RCC_C2_SPI3_CLK_ENABLE() do { \
  3608. __IO uint32_t tmpreg; \
  3609. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_SPI3EN);\
  3610. /* Delay after an RCC peripheral clock enabling */ \
  3611. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_SPI3EN);\
  3612. UNUSED(tmpreg); \
  3613. } while(0)
  3614. #define __HAL_RCC_C2_SPDIFRX_CLK_ENABLE() do { \
  3615. __IO uint32_t tmpreg; \
  3616. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_SPDIFRXEN);\
  3617. /* Delay after an RCC peripheral clock enabling */ \
  3618. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_SPDIFRXEN);\
  3619. UNUSED(tmpreg); \
  3620. } while(0)
  3621. #define __HAL_RCC_C2_USART2_CLK_ENABLE() do { \
  3622. __IO uint32_t tmpreg; \
  3623. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_USART2EN);\
  3624. /* Delay after an RCC peripheral clock enabling */ \
  3625. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_USART2EN);\
  3626. UNUSED(tmpreg); \
  3627. } while(0)
  3628. #define __HAL_RCC_C2_USART3_CLK_ENABLE() do { \
  3629. __IO uint32_t tmpreg; \
  3630. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_USART3EN);\
  3631. /* Delay after an RCC peripheral clock enabling */ \
  3632. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_USART3EN);\
  3633. UNUSED(tmpreg); \
  3634. } while(0)
  3635. #define __HAL_RCC_C2_UART4_CLK_ENABLE() do { \
  3636. __IO uint32_t tmpreg; \
  3637. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_UART4EN);\
  3638. /* Delay after an RCC peripheral clock enabling */ \
  3639. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_UART4EN);\
  3640. UNUSED(tmpreg); \
  3641. } while(0)
  3642. #define __HAL_RCC_C2_UART5_CLK_ENABLE() do { \
  3643. __IO uint32_t tmpreg; \
  3644. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_UART5EN);\
  3645. /* Delay after an RCC peripheral clock enabling */ \
  3646. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_UART5EN);\
  3647. UNUSED(tmpreg); \
  3648. } while(0)
  3649. #define __HAL_RCC_C2_I2C1_CLK_ENABLE() do { \
  3650. __IO uint32_t tmpreg; \
  3651. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_I2C1EN);\
  3652. /* Delay after an RCC peripheral clock enabling */ \
  3653. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_I2C1EN);\
  3654. UNUSED(tmpreg); \
  3655. } while(0)
  3656. #define __HAL_RCC_C2_I2C2_CLK_ENABLE() do { \
  3657. __IO uint32_t tmpreg; \
  3658. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_I2C2EN);\
  3659. /* Delay after an RCC peripheral clock enabling */ \
  3660. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_I2C2EN);\
  3661. UNUSED(tmpreg); \
  3662. } while(0)
  3663. #define __HAL_RCC_C2_I2C3_CLK_ENABLE() do { \
  3664. __IO uint32_t tmpreg; \
  3665. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_I2C3EN);\
  3666. /* Delay after an RCC peripheral clock enabling */ \
  3667. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_I2C3EN);\
  3668. UNUSED(tmpreg); \
  3669. } while(0)
  3670. #define __HAL_RCC_C2_CEC_CLK_ENABLE() do { \
  3671. __IO uint32_t tmpreg; \
  3672. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_CECEN);\
  3673. /* Delay after an RCC peripheral clock enabling */ \
  3674. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_CECEN);\
  3675. UNUSED(tmpreg); \
  3676. } while(0)
  3677. #define __HAL_RCC_C2_DAC12_CLK_ENABLE() do { \
  3678. __IO uint32_t tmpreg; \
  3679. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_DAC12EN);\
  3680. /* Delay after an RCC peripheral clock enabling */ \
  3681. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_DAC12EN);\
  3682. UNUSED(tmpreg); \
  3683. } while(0)
  3684. #define __HAL_RCC_C2_UART7_CLK_ENABLE() do { \
  3685. __IO uint32_t tmpreg; \
  3686. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_UART7EN);\
  3687. /* Delay after an RCC peripheral clock enabling */ \
  3688. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_UART7EN);\
  3689. UNUSED(tmpreg); \
  3690. } while(0)
  3691. #define __HAL_RCC_C2_UART8_CLK_ENABLE() do { \
  3692. __IO uint32_t tmpreg; \
  3693. SET_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_UART8EN);\
  3694. /* Delay after an RCC peripheral clock enabling */ \
  3695. tmpreg = READ_BIT(RCC_C2->APB1LENR, RCC_APB1LENR_UART8EN);\
  3696. UNUSED(tmpreg); \
  3697. } while(0)
  3698. #define __HAL_RCC_C2_CRS_CLK_ENABLE() do { \
  3699. __IO uint32_t tmpreg; \
  3700. SET_BIT(RCC_C2->APB1HENR, RCC_APB1HENR_CRSEN);\
  3701. /* Delay after an RCC peripheral clock enabling */ \
  3702. tmpreg = READ_BIT(RCC_C2->APB1HENR, RCC_APB1HENR_CRSEN);\
  3703. UNUSED(tmpreg); \
  3704. } while(0)
  3705. #define __HAL_RCC_C2_SWPMI_CLK_ENABLE() do { \
  3706. __IO uint32_t tmpreg; \
  3707. SET_BIT(RCC_C2->APB1HENR, RCC_APB1HENR_SWPMIEN);\
  3708. /* Delay after an RCC peripheral clock enabling */ \
  3709. tmpreg = READ_BIT(RCC_C2->APB1HENR, RCC_APB1HENR_SWPMIEN);\
  3710. UNUSED(tmpreg); \
  3711. } while(0)
  3712. #define __HAL_RCC_C2_OPAMP_CLK_ENABLE() do { \
  3713. __IO uint32_t tmpreg; \
  3714. SET_BIT(RCC_C2->APB1HENR, RCC_APB1HENR_OPAMPEN);\
  3715. /* Delay after an RCC peripheral clock enabling */ \
  3716. tmpreg = READ_BIT(RCC_C2->APB1HENR, RCC_APB1HENR_OPAMPEN);\
  3717. UNUSED(tmpreg); \
  3718. } while(0)
  3719. #define __HAL_RCC_C2_MDIOS_CLK_ENABLE() do { \
  3720. __IO uint32_t tmpreg; \
  3721. SET_BIT(RCC_C2->APB1HENR, RCC_APB1HENR_MDIOSEN);\
  3722. /* Delay after an RCC peripheral clock enabling */ \
  3723. tmpreg = READ_BIT(RCC_C2->APB1HENR, RCC_APB1HENR_MDIOSEN);\
  3724. UNUSED(tmpreg); \
  3725. } while(0)
  3726. #define __HAL_RCC_C2_FDCAN_CLK_ENABLE() do { \
  3727. __IO uint32_t tmpreg; \
  3728. SET_BIT(RCC_C2->APB1HENR, RCC_APB1HENR_FDCANEN);\
  3729. /* Delay after an RCC peripheral clock enabling */ \
  3730. tmpreg = READ_BIT(RCC_C2->APB1HENR, RCC_APB1HENR_FDCANEN);\
  3731. UNUSED(tmpreg); \
  3732. } while(0)
  3733. #define __HAL_RCC_C2_TIM2_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_TIM2EN)
  3734. #define __HAL_RCC_C2_TIM3_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_TIM3EN)
  3735. #define __HAL_RCC_C2_TIM4_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_TIM4EN)
  3736. #define __HAL_RCC_C2_TIM5_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_TIM5EN)
  3737. #define __HAL_RCC_C2_TIM6_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_TIM6EN)
  3738. #define __HAL_RCC_C2_TIM7_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_TIM7EN)
  3739. #define __HAL_RCC_C2_TIM12_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_TIM12EN)
  3740. #define __HAL_RCC_C2_TIM13_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_TIM13EN)
  3741. #define __HAL_RCC_C2_TIM14_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_TIM14EN)
  3742. #define __HAL_RCC_C2_LPTIM1_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_LPTIM1EN)
  3743. #define __HAL_RCC_C2_WWDG2_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_WWDG2EN)
  3744. #define __HAL_RCC_C2_SPI2_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_SPI2EN)
  3745. #define __HAL_RCC_C2_SPI3_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_SPI3EN)
  3746. #define __HAL_RCC_C2_SPDIFRX_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_SPDIFRXEN)
  3747. #define __HAL_RCC_C2_USART2_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_USART2EN)
  3748. #define __HAL_RCC_C2_USART3_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_USART3EN)
  3749. #define __HAL_RCC_C2_UART4_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_UART4EN)
  3750. #define __HAL_RCC_C2_UART5_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_UART5EN)
  3751. #define __HAL_RCC_C2_I2C1_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_I2C1EN)
  3752. #define __HAL_RCC_C2_I2C2_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_I2C2EN)
  3753. #define __HAL_RCC_C2_I2C3_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_I2C3EN)
  3754. #define __HAL_RCC_C2_CEC_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_CECEN)
  3755. #define __HAL_RCC_C2_DAC12_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_DAC12EN)
  3756. #define __HAL_RCC_C2_UART7_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_UART7EN)
  3757. #define __HAL_RCC_C2_UART8_CLK_DISABLE() (RCC_C2->APB1LENR) &= ~ (RCC_APB1LENR_UART8EN)
  3758. #define __HAL_RCC_C2_CRS_CLK_DISABLE() (RCC_C2->APB1HENR) &= ~ (RCC_APB1HENR_CRSEN)
  3759. #define __HAL_RCC_C2_SWPMI_CLK_DISABLE() (RCC_C2->APB1HENR) &= ~ (RCC_APB1HENR_SWPMIEN)
  3760. #define __HAL_RCC_C2_OPAMP_CLK_DISABLE() (RCC_C2->APB1HENR) &= ~ (RCC_APB1HENR_OPAMPEN)
  3761. #define __HAL_RCC_C2_MDIOS_CLK_DISABLE() (RCC_C2->APB1HENR) &= ~ (RCC_APB1HENR_MDIOSEN)
  3762. #define __HAL_RCC_C2_FDCAN_CLK_DISABLE() (RCC_C2->APB1HENR) &= ~ (RCC_APB1HENR_FDCANEN)
  3763. /** @brief Enable or disable the APB2 peripheral clock.
  3764. * @note After reset, the peripheral clock (used for registers read/write access)
  3765. * is disabled and the application software has to enable this clock before
  3766. * using it.
  3767. */
  3768. #define __HAL_RCC_C2_TIM1_CLK_ENABLE() do { \
  3769. __IO uint32_t tmpreg; \
  3770. SET_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_TIM1EN);\
  3771. /* Delay after an RCC peripheral clock enabling */ \
  3772. tmpreg = READ_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_TIM1EN);\
  3773. UNUSED(tmpreg); \
  3774. } while(0)
  3775. #define __HAL_RCC_C2_TIM8_CLK_ENABLE() do { \
  3776. __IO uint32_t tmpreg; \
  3777. SET_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_TIM8EN);\
  3778. /* Delay after an RCC peripheral clock enabling */ \
  3779. tmpreg = READ_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_TIM8EN);\
  3780. UNUSED(tmpreg); \
  3781. } while(0)
  3782. #define __HAL_RCC_C2_USART1_CLK_ENABLE() do { \
  3783. __IO uint32_t tmpreg; \
  3784. SET_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_USART1EN);\
  3785. /* Delay after an RCC peripheral clock enabling */ \
  3786. tmpreg = READ_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_USART1EN);\
  3787. UNUSED(tmpreg); \
  3788. } while(0)
  3789. #define __HAL_RCC_C2_USART6_CLK_ENABLE() do { \
  3790. __IO uint32_t tmpreg; \
  3791. SET_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_USART6EN);\
  3792. /* Delay after an RCC peripheral clock enabling */ \
  3793. tmpreg = READ_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_USART6EN);\
  3794. UNUSED(tmpreg); \
  3795. } while(0)
  3796. #define __HAL_RCC_C2_SPI1_CLK_ENABLE() do { \
  3797. __IO uint32_t tmpreg; \
  3798. SET_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_SPI1EN);\
  3799. /* Delay after an RCC peripheral clock enabling */ \
  3800. tmpreg = READ_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_SPI1EN);\
  3801. UNUSED(tmpreg); \
  3802. } while(0)
  3803. #define __HAL_RCC_C2_SPI4_CLK_ENABLE() do { \
  3804. __IO uint32_t tmpreg; \
  3805. SET_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_SPI4EN);\
  3806. /* Delay after an RCC peripheral clock enabling */ \
  3807. tmpreg = READ_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_SPI4EN);\
  3808. UNUSED(tmpreg); \
  3809. } while(0)
  3810. #define __HAL_RCC_C2_TIM15_CLK_ENABLE() do { \
  3811. __IO uint32_t tmpreg; \
  3812. SET_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_TIM15EN);\
  3813. /* Delay after an RCC peripheral clock enabling */ \
  3814. tmpreg = READ_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_TIM15EN);\
  3815. UNUSED(tmpreg); \
  3816. } while(0)
  3817. #define __HAL_RCC_C2_TIM16_CLK_ENABLE() do { \
  3818. __IO uint32_t tmpreg; \
  3819. SET_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_TIM16EN);\
  3820. /* Delay after an RCC peripheral clock enabling */ \
  3821. tmpreg = READ_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_TIM16EN);\
  3822. UNUSED(tmpreg); \
  3823. } while(0)
  3824. #define __HAL_RCC_C2_TIM17_CLK_ENABLE() do { \
  3825. __IO uint32_t tmpreg; \
  3826. SET_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_TIM17EN);\
  3827. /* Delay after an RCC peripheral clock enabling */ \
  3828. tmpreg = READ_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_TIM17EN);\
  3829. UNUSED(tmpreg); \
  3830. } while(0)
  3831. #define __HAL_RCC_C2_SPI5_CLK_ENABLE() do { \
  3832. __IO uint32_t tmpreg; \
  3833. SET_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_SPI5EN);\
  3834. /* Delay after an RCC peripheral clock enabling */ \
  3835. tmpreg = READ_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_SPI5EN);\
  3836. UNUSED(tmpreg); \
  3837. } while(0)
  3838. #define __HAL_RCC_C2_SAI1_CLK_ENABLE() do { \
  3839. __IO uint32_t tmpreg; \
  3840. SET_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_SAI1EN);\
  3841. /* Delay after an RCC peripheral clock enabling */ \
  3842. tmpreg = READ_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_SAI1EN);\
  3843. UNUSED(tmpreg); \
  3844. } while(0)
  3845. #define __HAL_RCC_C2_SAI2_CLK_ENABLE() do { \
  3846. __IO uint32_t tmpreg; \
  3847. SET_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_SAI2EN);\
  3848. /* Delay after an RCC peripheral clock enabling */ \
  3849. tmpreg = READ_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_SAI2EN);\
  3850. UNUSED(tmpreg); \
  3851. } while(0)
  3852. #define __HAL_RCC_C2_SAI3_CLK_ENABLE() do { \
  3853. __IO uint32_t tmpreg; \
  3854. SET_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_SAI3EN);\
  3855. /* Delay after an RCC peripheral clock enabling */ \
  3856. tmpreg = READ_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_SAI3EN);\
  3857. UNUSED(tmpreg); \
  3858. } while(0)
  3859. #define __HAL_RCC_C2_DFSDM1_CLK_ENABLE() do { \
  3860. __IO uint32_t tmpreg; \
  3861. SET_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_DFSDM1EN);\
  3862. /* Delay after an RCC peripheral clock enabling */ \
  3863. tmpreg = READ_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_DFSDM1EN);\
  3864. UNUSED(tmpreg); \
  3865. } while(0)
  3866. #define __HAL_RCC_C2_HRTIM1_CLK_ENABLE() do { \
  3867. __IO uint32_t tmpreg; \
  3868. SET_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_HRTIMEN);\
  3869. /* Delay after an RCC peripheral clock enabling */ \
  3870. tmpreg = READ_BIT(RCC_C2->APB2ENR, RCC_APB2ENR_HRTIMEN);\
  3871. UNUSED(tmpreg); \
  3872. } while(0)
  3873. #define __HAL_RCC_C2_TIM1_CLK_DISABLE() (RCC_C2->APB2ENR) &= ~ (RCC_APB2ENR_TIM1EN)
  3874. #define __HAL_RCC_C2_TIM8_CLK_DISABLE() (RCC_C2->APB2ENR) &= ~ (RCC_APB2ENR_TIM8EN)
  3875. #define __HAL_RCC_C2_USART1_CLK_DISABLE() (RCC_C2->APB2ENR) &= ~ (RCC_APB2ENR_USART1EN)
  3876. #define __HAL_RCC_C2_USART6_CLK_DISABLE() (RCC_C2->APB2ENR) &= ~ (RCC_APB2ENR_USART6EN)
  3877. #define __HAL_RCC_C2_SPI1_CLK_DISABLE() (RCC_C2->APB2ENR) &= ~ (RCC_APB2ENR_SPI1EN)
  3878. #define __HAL_RCC_C2_SPI4_CLK_DISABLE() (RCC_C2->APB2ENR) &= ~ (RCC_APB2ENR_SPI4EN)
  3879. #define __HAL_RCC_C2_TIM15_CLK_DISABLE() (RCC_C2->APB2ENR) &= ~ (RCC_APB2ENR_TIM15EN)
  3880. #define __HAL_RCC_C2_TIM16_CLK_DISABLE() (RCC_C2->APB2ENR) &= ~ (RCC_APB2ENR_TIM16EN)
  3881. #define __HAL_RCC_C2_TIM17_CLK_DISABLE() (RCC_C2->APB2ENR) &= ~ (RCC_APB2ENR_TIM17EN)
  3882. #define __HAL_RCC_C2_SPI5_CLK_DISABLE() (RCC_C2->APB2ENR) &= ~ (RCC_APB2ENR_SPI5EN)
  3883. #define __HAL_RCC_C2_SAI1_CLK_DISABLE() (RCC_C2->APB2ENR) &= ~ (RCC_APB2ENR_SAI1EN)
  3884. #define __HAL_RCC_C2_SAI2_CLK_DISABLE() (RCC_C2->APB2ENR) &= ~ (RCC_APB2ENR_SAI2EN)
  3885. #define __HAL_RCC_C2_SAI3_CLK_DISABLE() (RCC_C2->APB2ENR) &= ~ (RCC_APB2ENR_SAI3EN)
  3886. #define __HAL_RCC_C2_DFSDM1_CLK_DISABLE() (RCC_C2->APB2ENR) &= ~ (RCC_APB2ENR_DFSDM1EN)
  3887. #define __HAL_RCC_C2_HRTIM1_CLK_DISABLE() (RCC_C2->APB2ENR) &= ~ (RCC_APB2ENR_HRTIMEN)
  3888. /** @brief Enable or disable the APB4 peripheral clock.
  3889. * @note After reset, the peripheral clock (used for registers read/write access)
  3890. * is disabled and the application software has to enable this clock before
  3891. * using it.
  3892. */
  3893. #define __HAL_RCC_C2_SYSCFG_CLK_ENABLE() do { \
  3894. __IO uint32_t tmpreg; \
  3895. SET_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_SYSCFGEN);\
  3896. /* Delay after an RCC peripheral clock enabling */ \
  3897. tmpreg = READ_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_SYSCFGEN);\
  3898. UNUSED(tmpreg); \
  3899. } while(0)
  3900. #define __HAL_RCC_C2_LPUART1_CLK_ENABLE() do { \
  3901. __IO uint32_t tmpreg; \
  3902. SET_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_LPUART1EN);\
  3903. /* Delay after an RCC peripheral clock enabling */ \
  3904. tmpreg = READ_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_LPUART1EN);\
  3905. UNUSED(tmpreg); \
  3906. } while(0)
  3907. #define __HAL_RCC_C2_SPI6_CLK_ENABLE() do { \
  3908. __IO uint32_t tmpreg; \
  3909. SET_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_SPI6EN);\
  3910. /* Delay after an RCC peripheral clock enabling */ \
  3911. tmpreg = READ_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_SPI6EN);\
  3912. UNUSED(tmpreg); \
  3913. } while(0)
  3914. #define __HAL_RCC_C2_I2C4_CLK_ENABLE() do { \
  3915. __IO uint32_t tmpreg; \
  3916. SET_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_I2C4EN);\
  3917. /* Delay after an RCC peripheral clock enabling */ \
  3918. tmpreg = READ_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_I2C4EN);\
  3919. UNUSED(tmpreg); \
  3920. } while(0)
  3921. #define __HAL_RCC_C2_LPTIM2_CLK_ENABLE() do { \
  3922. __IO uint32_t tmpreg; \
  3923. SET_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_LPTIM2EN);\
  3924. /* Delay after an RCC peripheral clock enabling */ \
  3925. tmpreg = READ_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_LPTIM2EN);\
  3926. UNUSED(tmpreg); \
  3927. } while(0)
  3928. #define __HAL_RCC_C2_LPTIM3_CLK_ENABLE() do { \
  3929. __IO uint32_t tmpreg; \
  3930. SET_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_LPTIM3EN);\
  3931. /* Delay after an RCC peripheral clock enabling */ \
  3932. tmpreg = READ_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_LPTIM3EN);\
  3933. UNUSED(tmpreg); \
  3934. } while(0)
  3935. #define __HAL_RCC_C2_LPTIM4_CLK_ENABLE() do { \
  3936. __IO uint32_t tmpreg; \
  3937. SET_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_LPTIM4EN);\
  3938. /* Delay after an RCC peripheral clock enabling */ \
  3939. tmpreg = READ_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_LPTIM4EN);\
  3940. UNUSED(tmpreg); \
  3941. } while(0)
  3942. #define __HAL_RCC_C2_LPTIM5_CLK_ENABLE() do { \
  3943. __IO uint32_t tmpreg; \
  3944. SET_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_LPTIM5EN);\
  3945. /* Delay after an RCC peripheral clock enabling */ \
  3946. tmpreg = READ_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_LPTIM5EN);\
  3947. UNUSED(tmpreg); \
  3948. } while(0)
  3949. #define __HAL_RCC_C2_COMP12_CLK_ENABLE() do { \
  3950. __IO uint32_t tmpreg; \
  3951. SET_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_COMP12EN);\
  3952. /* Delay after an RCC peripheral clock enabling */ \
  3953. tmpreg = READ_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_COMP12EN);\
  3954. UNUSED(tmpreg); \
  3955. } while(0)
  3956. #define __HAL_RCC_C2_VREF_CLK_ENABLE() do { \
  3957. __IO uint32_t tmpreg; \
  3958. SET_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_VREFEN);\
  3959. /* Delay after an RCC peripheral clock enabling */ \
  3960. tmpreg = READ_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_VREFEN);\
  3961. UNUSED(tmpreg); \
  3962. } while(0)
  3963. #define __HAL_RCC_C2_RTC_CLK_ENABLE() do { \
  3964. __IO uint32_t tmpreg; \
  3965. SET_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_RTCAPBEN);\
  3966. /* Delay after an RCC peripheral clock enabling */ \
  3967. tmpreg = READ_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_RTCAPBEN);\
  3968. UNUSED(tmpreg); \
  3969. } while(0)
  3970. #define __HAL_RCC_C2_SAI4_CLK_ENABLE() do { \
  3971. __IO uint32_t tmpreg; \
  3972. SET_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_SAI4EN);\
  3973. /* Delay after an RCC peripheral clock enabling */ \
  3974. tmpreg = READ_BIT(RCC_C2->APB4ENR, RCC_APB4ENR_SAI4EN);\
  3975. UNUSED(tmpreg); \
  3976. } while(0)
  3977. #define __HAL_RCC_C2_SYSCFG_CLK_DISABLE() (RCC_C2->APB4ENR) &= ~ (RCC_APB4ENR_SYSCFGEN)
  3978. #define __HAL_RCC_C2_LPUART1_CLK_DISABLE() (RCC_C2->APB4ENR) &= ~ (RCC_APB4ENR_LPUART1EN)
  3979. #define __HAL_RCC_C2_SPI6_CLK_DISABLE() (RCC_C2->APB4ENR) &= ~ (RCC_APB4ENR_SPI6EN)
  3980. #define __HAL_RCC_C2_I2C4_CLK_DISABLE() (RCC_C2->APB4ENR) &= ~ (RCC_APB4ENR_I2C4EN)
  3981. #define __HAL_RCC_C2_LPTIM2_CLK_DISABLE() (RCC_C2->APB4ENR) &= ~ (RCC_APB4ENR_LPTIM2EN)
  3982. #define __HAL_RCC_C2_LPTIM3_CLK_DISABLE() (RCC_C2->APB4ENR) &= ~ (RCC_APB4ENR_LPTIM3EN)
  3983. #define __HAL_RCC_C2_LPTIM4_CLK_DISABLE() (RCC_C2->APB4ENR) &= ~ (RCC_APB4ENR_LPTIM4EN)
  3984. #define __HAL_RCC_C2_LPTIM5_CLK_DISABLE() (RCC_C2->APB4ENR) &= ~ (RCC_APB4ENR_LPTIM5EN)
  3985. #define __HAL_RCC_C2_COMP12_CLK_DISABLE() (RCC_C2->APB4ENR) &= ~ (RCC_APB4ENR_COMP12EN)
  3986. #define __HAL_RCC_C2_VREF_CLK_DISABLE() (RCC_C2->APB4ENR) &= ~ (RCC_APB4ENR_VREFEN)
  3987. #define __HAL_RCC_C2_RTC_CLK_DISABLE() (RCC_C2->APB4ENR) &= ~ (RCC_APB4ENR_RTCAPBEN)
  3988. #define __HAL_RCC_C2_SAI4_CLK_DISABLE() (RCC_C2->APB4ENR) &= ~ (RCC_APB4ENR_SAI4EN)
  3989. #endif /*DUAL_CORE*/
  3990. /** @brief Enable or disable the AHB3 peripheral reset.
  3991. */
  3992. #define __HAL_RCC_AHB3_FORCE_RESET() (RCC->AHB3RSTR = 0xFFFFFFFFU)
  3993. #define __HAL_RCC_MDMA_FORCE_RESET() (RCC->AHB3RSTR |= (RCC_AHB3RSTR_MDMARST))
  3994. #define __HAL_RCC_DMA2D_FORCE_RESET() (RCC->AHB3RSTR |= (RCC_AHB3RSTR_DMA2DRST))
  3995. #if defined(JPEG)
  3996. #define __HAL_RCC_JPGDECRST_FORCE_RESET() (RCC->AHB3RSTR |= (RCC_AHB3RSTR_JPGDECRST))
  3997. #endif /* JPEG */
  3998. #define __HAL_RCC_FMC_FORCE_RESET() (RCC->AHB3RSTR |= (RCC_AHB3RSTR_FMCRST))
  3999. #if defined(QUADSPI)
  4000. #define __HAL_RCC_QSPI_FORCE_RESET() (RCC->AHB3RSTR |= (RCC_AHB3RSTR_QSPIRST))
  4001. #endif /*QUADSPI*/
  4002. #if defined(OCTOSPI1)
  4003. #define __HAL_RCC_OSPI1_FORCE_RESET() (RCC->AHB3RSTR |= (RCC_AHB3RSTR_OSPI1RST))
  4004. #endif /*OCTOSPI1*/
  4005. #define __HAL_RCC_SDMMC1_FORCE_RESET() (RCC->AHB3RSTR |= (RCC_AHB3RSTR_SDMMC1RST))
  4006. #if defined(OCTOSPI2)
  4007. #define __HAL_RCC_OSPI2_FORCE_RESET() (RCC->AHB3RSTR |= (RCC_AHB3RSTR_OSPI2RST))
  4008. #endif /*OCTOSPI2*/
  4009. #if defined(OCTOSPIM)
  4010. #define __HAL_RCC_IOMNGR_FORCE_RESET() (RCC->AHB3RSTR |= (RCC_AHB3RSTR_IOMNGRRST))
  4011. #endif /*OCTOSPIM*/
  4012. #if defined(OTFDEC1)
  4013. #define __HAL_RCC_OTFDEC1_FORCE_RESET() (RCC->AHB3RSTR |= (RCC_AHB3RSTR_OTFDEC1RST))
  4014. #endif /*OTFDEC1*/
  4015. #if defined(OTFDEC2)
  4016. #define __HAL_RCC_OTFDEC2_FORCE_RESET() (RCC->AHB3RSTR |= (RCC_AHB3RSTR_OTFDEC2RST))
  4017. #endif /*OTFDEC2*/
  4018. #if defined(GFXMMU)
  4019. #define __HAL_RCC_GFXMMU_FORCE_RESET() (RCC->AHB3RSTR |= (RCC_AHB3RSTR_GFXMMURST))
  4020. #endif /*GFXMMU*/
  4021. #define __HAL_RCC_AHB3_RELEASE_RESET() (RCC->AHB3RSTR = 0x00)
  4022. #define __HAL_RCC_MDMA_RELEASE_RESET() (RCC->AHB3RSTR &= ~ (RCC_AHB3RSTR_MDMARST))
  4023. #define __HAL_RCC_DMA2D_RELEASE_RESET() (RCC->AHB3RSTR &= ~ (RCC_AHB3RSTR_DMA2DRST))
  4024. #if defined(JPEG)
  4025. #define __HAL_RCC_JPGDECRST_RELEASE_RESET() (RCC->AHB3RSTR &= ~ (RCC_AHB3RSTR_JPGDECRST))
  4026. #endif /* JPEG */
  4027. #define __HAL_RCC_FMC_RELEASE_RESET() (RCC->AHB3RSTR &= ~ (RCC_AHB3RSTR_FMCRST))
  4028. #if defined(QUADSPI)
  4029. #define __HAL_RCC_QSPI_RELEASE_RESET() (RCC->AHB3RSTR &= ~ (RCC_AHB3RSTR_QSPIRST))
  4030. #endif /*QUADSPI*/
  4031. #if defined(OCTOSPI1)
  4032. #define __HAL_RCC_OSPI1_RELEASE_RESET() (RCC->AHB3RSTR &= ~ (RCC_AHB3RSTR_OSPI1RST))
  4033. #endif /*OCTOSPI1*/
  4034. #define __HAL_RCC_SDMMC1_RELEASE_RESET() (RCC->AHB3RSTR &= ~ (RCC_AHB3RSTR_SDMMC1RST))
  4035. #if defined(OCTOSPI2)
  4036. #define __HAL_RCC_OSPI2_RELEASE_RESET() (RCC->AHB3RSTR &= ~ (RCC_AHB3RSTR_OSPI2RST))
  4037. #endif /*OCTOSPI2*/
  4038. #if defined(OCTOSPIM)
  4039. #define __HAL_RCC_IOMNGR_RELEASE_RESET() (RCC->AHB3RSTR &= ~ (RCC_AHB3RSTR_IOMNGRRST))
  4040. #endif /*OCTOSPIM*/
  4041. #if defined(OTFDEC1)
  4042. #define __HAL_RCC_OTFDEC1_RELEASE_RESET() (RCC->AHB3RSTR &= ~ (RCC_AHB3RSTR_OTFDEC1RST))
  4043. #endif /*OTFDEC1*/
  4044. #if defined(OTFDEC2)
  4045. #define __HAL_RCC_OTFDEC2_RELEASE_RESET() (RCC->AHB3RSTR &= ~ (RCC_AHB3RSTR_OTFDEC2RST))
  4046. #endif /*OTFDEC2*/
  4047. #if defined(GFXMMU)
  4048. #define __HAL_RCC_GFXMMU_RELEASE_RESET() (RCC->AHB3RSTR &= ~ (RCC_AHB3RSTR_GFXMMURST))
  4049. #endif /*GFXMMU*/
  4050. /** @brief Force or release the AHB1 peripheral reset.
  4051. */
  4052. #define __HAL_RCC_AHB1_FORCE_RESET() (RCC->AHB1RSTR = 0xFFFFFFFFU)
  4053. #define __HAL_RCC_DMA1_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_DMA1RST))
  4054. #define __HAL_RCC_DMA2_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_DMA2RST))
  4055. #define __HAL_RCC_ADC12_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_ADC12RST))
  4056. #if defined(DUAL_CORE)
  4057. #define __HAL_RCC_ART_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_ARTRST))
  4058. #endif /*DUAL_CORE*/
  4059. #if defined(RCC_AHB1RSTR_CRCRST)
  4060. #define __HAL_RCC_CRC_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_CRCRST))
  4061. #endif
  4062. #if defined(ETH)
  4063. #define __HAL_RCC_ETH1MAC_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_ETH1MACRST))
  4064. #endif /*ETH*/
  4065. #define __HAL_RCC_USB1_OTG_HS_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_USB1OTGHSRST))
  4066. #if defined(USB2_OTG_FS)
  4067. #define __HAL_RCC_USB2_OTG_FS_FORCE_RESET() (RCC->AHB1RSTR |= (RCC_AHB1RSTR_USB2OTGHSRST))
  4068. #endif /*USB2_OTG_FS*/
  4069. #define __HAL_RCC_AHB1_RELEASE_RESET() (RCC->AHB1RSTR = 0x00U)
  4070. #define __HAL_RCC_DMA1_RELEASE_RESET() (RCC->AHB1RSTR &= ~ (RCC_AHB1RSTR_DMA1RST))
  4071. #define __HAL_RCC_DMA2_RELEASE_RESET() (RCC->AHB1RSTR &= ~ (RCC_AHB1RSTR_DMA2RST))
  4072. #define __HAL_RCC_ADC12_RELEASE_RESET() (RCC->AHB1RSTR &= ~ (RCC_AHB1RSTR_ADC12RST))
  4073. #if defined(DUAL_CORE)
  4074. #define __HAL_RCC_ART_RELEASE_RESET() (RCC->AHB1RSTR &= ~ (RCC_AHB1RSTR_ARTRST))
  4075. #endif /*DUAL_CORE*/
  4076. #if defined(RCC_AHB1RSTR_CRCRST)
  4077. #define __HAL_RCC_CRC_RELEASE_RESET() (RCC->AHB1RSTR &= ~ (RCC_AHB1RSTR_CRCRST))
  4078. #endif
  4079. #if defined(ETH)
  4080. #define __HAL_RCC_ETH1MAC_RELEASE_RESET() (RCC->AHB1RSTR &= ~ (RCC_AHB1RSTR_ETH1MACRST))
  4081. #endif /*ETH*/
  4082. #define __HAL_RCC_USB1_OTG_HS_RELEASE_RESET() (RCC->AHB1RSTR &= ~ (RCC_AHB1RSTR_USB1OTGHSRST))
  4083. #if defined(USB2_OTG_FS)
  4084. #define __HAL_RCC_USB2_OTG_FS_RELEASE_RESET() (RCC->AHB1RSTR &= ~ (RCC_AHB1RSTR_USB2OTGHSRST))
  4085. #endif /*USB2_OTG_FS*/
  4086. /** @brief Force or release the AHB2 peripheral reset.
  4087. */
  4088. #define __HAL_RCC_AHB2_FORCE_RESET() (RCC->AHB2RSTR = 0xFFFFFFFFU)
  4089. #if defined(DCMI) && defined(PSSI)
  4090. #define __HAL_RCC_DCMI_PSSI_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_DCMI_PSSIRST))
  4091. #define __HAL_RCC_DCMI_FORCE_RESET() __HAL_RCC_DCMI_PSSI_FORCE_RESET() /* for API backward compatibility*/
  4092. #else
  4093. #define __HAL_RCC_DCMI_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_DCMIRST))
  4094. #endif /* DCMI && PSSI */
  4095. #define __HAL_RCC_CRYP_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_CRYPRST))
  4096. #define __HAL_RCC_HASH_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_HASHRST))
  4097. #define __HAL_RCC_RNG_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_RNGRST))
  4098. #define __HAL_RCC_SDMMC2_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_SDMMC2RST))
  4099. #if defined(RCC_AHB2RSTR_HSEMRST)
  4100. #define __HAL_RCC_HSEM_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_HSEMRST))
  4101. #endif
  4102. #if defined(BDMA1)
  4103. #define __HAL_RCC_BDMA1_FORCE_RESET() (RCC->AHB2RSTR |= (RCC_AHB2RSTR_BDMA1RST))
  4104. #endif /*BDMA1*/
  4105. #define __HAL_RCC_AHB2_RELEASE_RESET() (RCC->AHB2RSTR = 0x00U)
  4106. #if defined(DCMI) && defined(PSSI)
  4107. #define __HAL_RCC_DCMI_PSSI_RELEASE_RESET() (RCC->AHB2RSTR &= ~ (RCC_AHB2RSTR_DCMI_PSSIRST))
  4108. #define __HAL_RCC_DCMI_RELEASE_RESET() __HAL_RCC_DCMI_PSSI_RELEASE_RESET() /* for API backward compatibility*/
  4109. #else
  4110. #define __HAL_RCC_DCMI_RELEASE_RESET() (RCC->AHB2RSTR &= ~ (RCC_AHB2RSTR_DCMIRST))
  4111. #endif /* DCMI && PSSI */
  4112. #define __HAL_RCC_CRYP_RELEASE_RESET() (RCC->AHB2RSTR &= ~ (RCC_AHB2RSTR_CRYPRST))
  4113. #define __HAL_RCC_HASH_RELEASE_RESET() (RCC->AHB2RSTR &= ~ (RCC_AHB2RSTR_HASHRST))
  4114. #define __HAL_RCC_RNG_RELEASE_RESET() (RCC->AHB2RSTR &= ~ (RCC_AHB2RSTR_RNGRST))
  4115. #define __HAL_RCC_SDMMC2_RELEASE_RESET() (RCC->AHB2RSTR &= ~ (RCC_AHB2RSTR_SDMMC2RST))
  4116. #if defined(RCC_AHB2RSTR_HSEMRST)
  4117. #define __HAL_RCC_HSEM_RELEASE_RESET() (RCC->AHB2RSTR &= ~ (RCC_AHB2RSTR_HSEMRST))
  4118. #endif
  4119. #if defined(BDMA1)
  4120. #define __HAL_RCC_BDMA1_RELEASE_RESET() (RCC->AHB2RSTR &= ~ (RCC_AHB2RSTR_BDMA1RST))
  4121. #endif /*BDMA1*/
  4122. /** @brief Force or release the AHB4 peripheral reset.
  4123. */
  4124. #define __HAL_RCC_AHB4_FORCE_RESET() (RCC->AHB4RSTR = 0xFFFFFFFFU)
  4125. #define __HAL_RCC_GPIOA_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_GPIOARST)
  4126. #define __HAL_RCC_GPIOB_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_GPIOBRST)
  4127. #define __HAL_RCC_GPIOC_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_GPIOCRST)
  4128. #define __HAL_RCC_GPIOD_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_GPIODRST)
  4129. #define __HAL_RCC_GPIOE_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_GPIOERST)
  4130. #define __HAL_RCC_GPIOF_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_GPIOFRST)
  4131. #define __HAL_RCC_GPIOG_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_GPIOGRST)
  4132. #define __HAL_RCC_GPIOH_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_GPIOHRST)
  4133. #define __HAL_RCC_GPIOI_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_GPIOIRST)
  4134. #define __HAL_RCC_GPIOJ_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_GPIOJRST)
  4135. #define __HAL_RCC_GPIOK_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_GPIOKRST)
  4136. #if defined(RCC_AHB4RSTR_CRCRST)
  4137. #define __HAL_RCC_CRC_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_CRCRST)
  4138. #endif
  4139. #if defined(BDMA2)
  4140. #define __HAL_RCC_BDMA2_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_BDMA2RST)
  4141. #define __HAL_RCC_BDMA_FORCE_RESET() __HAL_RCC_BDMA2_FORCE_RESET() /* for API backward compatibility*/
  4142. #else
  4143. #define __HAL_RCC_BDMA_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_BDMARST)
  4144. #endif /*BDMA2*/
  4145. #if defined(ADC3)
  4146. #define __HAL_RCC_ADC3_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_ADC3RST)
  4147. #endif /*ADC3*/
  4148. #if defined(RCC_AHB4RSTR_HSEMRST)
  4149. #define __HAL_RCC_HSEM_FORCE_RESET() (RCC->AHB4RSTR) |= (RCC_AHB4RSTR_HSEMRST)
  4150. #endif
  4151. #define __HAL_RCC_AHB4_RELEASE_RESET() (RCC->AHB4RSTR = 0x00U)
  4152. #define __HAL_RCC_GPIOA_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_GPIOARST)
  4153. #define __HAL_RCC_GPIOB_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_GPIOBRST)
  4154. #define __HAL_RCC_GPIOC_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_GPIOCRST)
  4155. #define __HAL_RCC_GPIOD_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_GPIODRST)
  4156. #define __HAL_RCC_GPIOE_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_GPIOERST)
  4157. #define __HAL_RCC_GPIOF_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_GPIOFRST)
  4158. #define __HAL_RCC_GPIOG_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_GPIOGRST)
  4159. #define __HAL_RCC_GPIOH_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_GPIOHRST)
  4160. #define __HAL_RCC_GPIOI_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_GPIOIRST)
  4161. #define __HAL_RCC_GPIOJ_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_GPIOJRST)
  4162. #define __HAL_RCC_GPIOK_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_GPIOKRST)
  4163. #if defined(RCC_AHB4RSTR_CRCRST)
  4164. #define __HAL_RCC_CRC_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_CRCRST)
  4165. #endif
  4166. #if defined(BDMA2)
  4167. #define __HAL_RCC_BDMA2_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_BDMA2RST)
  4168. #define __HAL_RCC_BDMA_RELEASE_RESET() __HAL_RCC_BDMA2_RELEASE_RESET() /* for API backward compatibility*/
  4169. #else
  4170. #define __HAL_RCC_BDMA_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_BDMARST)
  4171. #endif /*BDMA2*/
  4172. #if defined(ADC3)
  4173. #define __HAL_RCC_ADC3_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_ADC3RST)
  4174. #endif /*ADC3*/
  4175. #if defined(RCC_AHB4RSTR_HSEMRST)
  4176. #define __HAL_RCC_HSEM_RELEASE_RESET() (RCC->AHB4RSTR) &= ~ (RCC_AHB4RSTR_HSEMRST)
  4177. #endif
  4178. /** @brief Force or release the APB3 peripheral reset.
  4179. */
  4180. #define __HAL_RCC_APB3_FORCE_RESET() (RCC->APB3RSTR = 0xFFFFFFFFU)
  4181. #if defined(LTDC)
  4182. #define __HAL_RCC_LTDC_FORCE_RESET() (RCC->APB3RSTR) |= (RCC_APB3RSTR_LTDCRST)
  4183. #endif /* LTDC */
  4184. #if defined(DSI)
  4185. #define __HAL_RCC_DSI_FORCE_RESET() (RCC->APB3RSTR) |= (RCC_APB3RSTR_DSIRST)
  4186. #endif /*DSI*/
  4187. #define __HAL_RCC_APB3_RELEASE_RESET() (RCC->APB3RSTR = 0x00U)
  4188. #if defined(LTDC)
  4189. #define __HAL_RCC_LTDC_RELEASE_RESET() (RCC->APB3RSTR) &= ~ (RCC_APB3RSTR_LTDCRST)
  4190. #endif /* LTDC */
  4191. #if defined(DSI)
  4192. #define __HAL_RCC_DSI_RELEASE_RESET() (RCC->APB3RSTR) &= ~ (RCC_APB3RSTR_DSIRST)
  4193. #endif /*DSI*/
  4194. /** @brief Force or release the APB1 peripheral reset.
  4195. */
  4196. #define __HAL_RCC_APB1L_FORCE_RESET() (RCC->APB1LRSTR = 0xFFFFFFFFU)
  4197. #define __HAL_RCC_APB1H_FORCE_RESET() (RCC->APB1HRSTR = 0xFFFFFFFFU)
  4198. #define __HAL_RCC_TIM2_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_TIM2RST)
  4199. #define __HAL_RCC_TIM3_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_TIM3RST)
  4200. #define __HAL_RCC_TIM4_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_TIM4RST)
  4201. #define __HAL_RCC_TIM5_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_TIM5RST)
  4202. #define __HAL_RCC_TIM6_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_TIM6RST)
  4203. #define __HAL_RCC_TIM7_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_TIM7RST)
  4204. #define __HAL_RCC_TIM12_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_TIM12RST)
  4205. #define __HAL_RCC_TIM13_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_TIM13RST)
  4206. #define __HAL_RCC_TIM14_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_TIM14RST)
  4207. #define __HAL_RCC_LPTIM1_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_LPTIM1RST)
  4208. #define __HAL_RCC_SPI2_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_SPI2RST)
  4209. #define __HAL_RCC_SPI3_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_SPI3RST)
  4210. #define __HAL_RCC_SPDIFRX_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_SPDIFRXRST)
  4211. #define __HAL_RCC_USART2_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_USART2RST)
  4212. #define __HAL_RCC_USART3_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_USART3RST)
  4213. #define __HAL_RCC_UART4_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_UART4RST)
  4214. #define __HAL_RCC_UART5_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_UART5RST)
  4215. #define __HAL_RCC_I2C1_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_I2C1RST)
  4216. #define __HAL_RCC_I2C2_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_I2C2RST)
  4217. #define __HAL_RCC_I2C3_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_I2C3RST)
  4218. #define __HAL_RCC_CEC_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_CECRST)
  4219. #define __HAL_RCC_DAC12_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_DAC12RST)
  4220. #define __HAL_RCC_UART7_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_UART7RST)
  4221. #define __HAL_RCC_UART8_FORCE_RESET() (RCC->APB1LRSTR) |= (RCC_APB1LRSTR_UART8RST)
  4222. #define __HAL_RCC_CRS_FORCE_RESET() (RCC->APB1HRSTR) |= (RCC_APB1HRSTR_CRSRST)
  4223. #define __HAL_RCC_SWPMI1_FORCE_RESET() (RCC->APB1HRSTR) |= (RCC_APB1HRSTR_SWPMIRST)
  4224. #define __HAL_RCC_OPAMP_FORCE_RESET() (RCC->APB1HRSTR) |= (RCC_APB1HRSTR_OPAMPRST)
  4225. #define __HAL_RCC_MDIOS_FORCE_RESET() (RCC->APB1HRSTR) |= (RCC_APB1HRSTR_MDIOSRST)
  4226. #define __HAL_RCC_FDCAN_FORCE_RESET() (RCC->APB1HRSTR) |= (RCC_APB1HRSTR_FDCANRST)
  4227. #define __HAL_RCC_APB1L_RELEASE_RESET() (RCC->APB1LRSTR = 0x00U)
  4228. #define __HAL_RCC_APB1H_RELEASE_RESET() (RCC->APB1HRSTR = 0x00U)
  4229. #define __HAL_RCC_TIM2_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_TIM2RST)
  4230. #define __HAL_RCC_TIM3_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_TIM3RST)
  4231. #define __HAL_RCC_TIM4_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_TIM4RST)
  4232. #define __HAL_RCC_TIM5_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_TIM5RST)
  4233. #define __HAL_RCC_TIM6_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_TIM6RST)
  4234. #define __HAL_RCC_TIM7_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_TIM7RST)
  4235. #define __HAL_RCC_TIM12_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_TIM12RST)
  4236. #define __HAL_RCC_TIM13_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_TIM13RST)
  4237. #define __HAL_RCC_TIM14_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_TIM14RST)
  4238. #define __HAL_RCC_LPTIM1_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_LPTIM1RST)
  4239. #define __HAL_RCC_SPI2_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_SPI2RST)
  4240. #define __HAL_RCC_SPI3_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_SPI3RST)
  4241. #define __HAL_RCC_SPDIFRX_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_SPDIFRXRST)
  4242. #define __HAL_RCC_USART2_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_USART2RST)
  4243. #define __HAL_RCC_USART3_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_USART3RST)
  4244. #define __HAL_RCC_UART4_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_UART4RST)
  4245. #define __HAL_RCC_UART5_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_UART5RST)
  4246. #define __HAL_RCC_I2C1_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_I2C1RST)
  4247. #define __HAL_RCC_I2C2_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_I2C2RST)
  4248. #define __HAL_RCC_I2C3_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_I2C3RST)
  4249. #define __HAL_RCC_CEC_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_CECRST)
  4250. #define __HAL_RCC_DAC12_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_DAC12RST)
  4251. #define __HAL_RCC_UART7_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_UART7RST)
  4252. #define __HAL_RCC_UART8_RELEASE_RESET() (RCC->APB1LRSTR) &= ~ (RCC_APB1LRSTR_UART8RST)
  4253. #define __HAL_RCC_CRS_RELEASE_RESET() (RCC->APB1HRSTR) &= ~ (RCC_APB1HRSTR_CRSRST)
  4254. #define __HAL_RCC_SWPMI1_RELEASE_RESET() (RCC->APB1HRSTR) &= ~ (RCC_APB1HRSTR_SWPMIRST)
  4255. #define __HAL_RCC_OPAMP_RELEASE_RESET() (RCC->APB1HRSTR) &= ~ (RCC_APB1HRSTR_OPAMPRST)
  4256. #define __HAL_RCC_MDIOS_RELEASE_RESET() (RCC->APB1HRSTR) &= ~ (RCC_APB1HRSTR_MDIOSRST)
  4257. #define __HAL_RCC_FDCAN_RELEASE_RESET() (RCC->APB1HRSTR) &= ~ (RCC_APB1HRSTR_FDCANRST)
  4258. /** @brief Force or release the APB2 peripheral reset.
  4259. */
  4260. #define __HAL_RCC_APB2_FORCE_RESET() (RCC->APB2RSTR = 0xFFFFFFFFU)
  4261. #define __HAL_RCC_TIM1_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_TIM1RST)
  4262. #define __HAL_RCC_TIM8_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_TIM8RST)
  4263. #define __HAL_RCC_USART1_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_USART1RST)
  4264. #define __HAL_RCC_USART6_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_USART6RST)
  4265. #if defined(UART9)
  4266. #define __HAL_RCC_UART9_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_UART9RST)
  4267. #endif /*UART9*/
  4268. #if defined(USART10)
  4269. #define __HAL_RCC_USART10_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_USART10RST)
  4270. #endif /*USART10*/
  4271. #define __HAL_RCC_SPI1_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_SPI1RST)
  4272. #define __HAL_RCC_SPI4_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_SPI4RST)
  4273. #define __HAL_RCC_TIM15_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_TIM15RST)
  4274. #define __HAL_RCC_TIM16_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_TIM16RST)
  4275. #define __HAL_RCC_TIM17_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_TIM17RST)
  4276. #define __HAL_RCC_SPI5_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_SPI5RST)
  4277. #define __HAL_RCC_SAI1_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_SAI1RST)
  4278. #define __HAL_RCC_SAI2_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_SAI2RST)
  4279. #if defined(SAI3)
  4280. #define __HAL_RCC_SAI3_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_SAI3RST)
  4281. #endif /*SAI3*/
  4282. #define __HAL_RCC_DFSDM1_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_DFSDM1RST)
  4283. #if defined(HRTIM1)
  4284. #define __HAL_RCC_HRTIM1_FORCE_RESET() (RCC->APB2RSTR) |= (RCC_APB2RSTR_HRTIMRST)
  4285. #endif /*HRTIM1*/
  4286. #define __HAL_RCC_APB2_RELEASE_RESET() (RCC->APB2RSTR = 0x00U)
  4287. #define __HAL_RCC_TIM1_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_TIM1RST)
  4288. #define __HAL_RCC_TIM8_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_TIM8RST)
  4289. #define __HAL_RCC_USART1_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_USART1RST)
  4290. #define __HAL_RCC_USART6_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_USART6RST)
  4291. #if defined(UART9)
  4292. #define __HAL_RCC_UART9_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_UART9RST)
  4293. #endif /*UART9*/
  4294. #if defined(USART10)
  4295. #define __HAL_RCC_USART10_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_USART10RST)
  4296. #endif /*USART10*/
  4297. #define __HAL_RCC_SPI1_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_SPI1RST)
  4298. #define __HAL_RCC_SPI4_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_SPI4RST)
  4299. #define __HAL_RCC_TIM15_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_TIM15RST)
  4300. #define __HAL_RCC_TIM16_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_TIM16RST)
  4301. #define __HAL_RCC_TIM17_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_TIM17RST)
  4302. #define __HAL_RCC_SPI5_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_SPI5RST)
  4303. #define __HAL_RCC_SAI1_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_SAI1RST)
  4304. #define __HAL_RCC_SAI2_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_SAI2RST)
  4305. #if defined(SAI3)
  4306. #define __HAL_RCC_SAI3_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_SAI3RST)
  4307. #endif /*SAI3*/
  4308. #define __HAL_RCC_DFSDM1_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_DFSDM1RST)
  4309. #if defined(HRTIM1)
  4310. #define __HAL_RCC_HRTIM1_RELEASE_RESET() (RCC->APB2RSTR) &= ~ (RCC_APB2RSTR_HRTIMRST)
  4311. #endif /*HRTIM1*/
  4312. /** @brief Force or release the APB4 peripheral reset.
  4313. */
  4314. #define __HAL_RCC_APB4_FORCE_RESET() (RCC->APB4RSTR = 0xFFFFFFFFU)
  4315. #define __HAL_RCC_SYSCFG_FORCE_RESET() (RCC->APB4RSTR) |= (RCC_APB4RSTR_SYSCFGRST)
  4316. #define __HAL_RCC_LPUART1_FORCE_RESET() (RCC->APB4RSTR) |= (RCC_APB4RSTR_LPUART1RST)
  4317. #define __HAL_RCC_SPI6_FORCE_RESET() (RCC->APB4RSTR) |= (RCC_APB4RSTR_SPI6RST)
  4318. #define __HAL_RCC_I2C4_FORCE_RESET() (RCC->APB4RSTR) |= (RCC_APB4RSTR_I2C4RST)
  4319. #define __HAL_RCC_LPTIM2_FORCE_RESET() (RCC->APB4RSTR) |= (RCC_APB4RSTR_LPTIM2RST)
  4320. #define __HAL_RCC_LPTIM3_FORCE_RESET() (RCC->APB4RSTR) |= (RCC_APB4RSTR_LPTIM3RST)
  4321. #if defined(LPTIM4)
  4322. #define __HAL_RCC_LPTIM4_FORCE_RESET() (RCC->APB4RSTR) |= (RCC_APB4RSTR_LPTIM4RST)
  4323. #endif /*LPTIM4*/
  4324. #if defined(LPTIM5)
  4325. #define __HAL_RCC_LPTIM5_FORCE_RESET() (RCC->APB4RSTR) |= (RCC_APB4RSTR_LPTIM5RST)
  4326. #endif /*LPTIM5*/
  4327. #if defined(DAC2)
  4328. #define __HAL_RCC_DAC2_FORCE_RESET() (RCC->APB4RSTR) |= (RCC_APB4RSTR_DAC2RST)
  4329. #endif /*DAC2*/
  4330. #define __HAL_RCC_COMP12_FORCE_RESET() (RCC->APB4RSTR) |= (RCC_APB4RSTR_COMP12RST)
  4331. #define __HAL_RCC_VREF_FORCE_RESET() (RCC->APB4RSTR) |= (RCC_APB4RSTR_VREFRST)
  4332. #if defined(SAI4)
  4333. #define __HAL_RCC_SAI4_FORCE_RESET() (RCC->APB4RSTR) |= (RCC_APB4RSTR_SAI4RST)
  4334. #endif /*SAI4*/
  4335. #if defined(DTS)
  4336. #define __HAL_RCC_DTS_FORCE_RESET() (RCC->APB4RSTR) |= (RCC_APB4RSTR_DTSRST)
  4337. #endif /*DTS*/
  4338. #if defined(DFSDM2_BASE)
  4339. #define __HAL_RCC_DFSDM2_FORCE_RESET() (RCC->APB4RSTR) |= (RCC_APB4RSTR_DFSDM2RST)
  4340. #endif /*DFSDM2*/
  4341. #define __HAL_RCC_APB4_RELEASE_RESET() (RCC->APB4RSTR = 0x00U)
  4342. #define __HAL_RCC_SYSCFG_RELEASE_RESET() (RCC->APB4RSTR) &= ~ (RCC_APB4RSTR_SYSCFGRST)
  4343. #define __HAL_RCC_LPUART1_RELEASE_RESET() (RCC->APB4RSTR) &= ~ (RCC_APB4RSTR_LPUART1RST)
  4344. #define __HAL_RCC_SPI6_RELEASE_RESET() (RCC->APB4RSTR) &= ~ (RCC_APB4RSTR_SPI6RST)
  4345. #define __HAL_RCC_I2C4_RELEASE_RESET() (RCC->APB4RSTR) &= ~ (RCC_APB4RSTR_I2C4RST)
  4346. #define __HAL_RCC_LPTIM2_RELEASE_RESET() (RCC->APB4RSTR) &= ~ (RCC_APB4RSTR_LPTIM2RST)
  4347. #define __HAL_RCC_LPTIM3_RELEASE_RESET() (RCC->APB4RSTR) &= ~ (RCC_APB4RSTR_LPTIM3RST)
  4348. #if defined(LPTIM4)
  4349. #define __HAL_RCC_LPTIM4_RELEASE_RESET() (RCC->APB4RSTR) &= ~ (RCC_APB4RSTR_LPTIM4RST)
  4350. #endif /*LPTIM4*/
  4351. #if defined(LPTIM5)
  4352. #define __HAL_RCC_LPTIM5_RELEASE_RESET() (RCC->APB4RSTR) &= ~ (RCC_APB4RSTR_LPTIM5RST)
  4353. #endif /*LPTIM5*/
  4354. #if defined(RCC_APB4RSTR_DAC2RST)
  4355. #define __HAL_RCC_DAC2_RELEASE_RESET() (RCC->APB4RSTR) &= ~ (RCC_APB4RSTR_DAC2RST)
  4356. #endif
  4357. #define __HAL_RCC_COMP12_RELEASE_RESET() (RCC->APB4RSTR) &= ~ (RCC_APB4RSTR_COMP12RST)
  4358. #define __HAL_RCC_VREF_RELEASE_RESET() (RCC->APB4RSTR) &= ~ (RCC_APB4RSTR_VREFRST)
  4359. #if defined(SAI4)
  4360. #define __HAL_RCC_SAI4_RELEASE_RESET() (RCC->APB4RSTR) &= ~ (RCC_APB4RSTR_SAI4RST)
  4361. #endif /*SAI4*/
  4362. #if defined(DTS)
  4363. #define __HAL_RCC_DTS_RELEASE_RESET() (RCC->APB4RSTR) &= ~ (RCC_APB4RSTR_DTSRST)
  4364. #endif /*DTS*/
  4365. #if defined(DFSDM2_BASE)
  4366. #define __HAL_RCC_DFSDM2_RELEASE_RESET() (RCC->APB4RSTR) &= ~ (RCC_APB4RSTR_DFSDM2RST)
  4367. #endif /*DFSDM2*/
  4368. /** @brief Enable or disable the AHB3 peripheral clock during Low Power (Sleep) mode.
  4369. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  4370. * power consumption.
  4371. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
  4372. * @note By default, all peripheral clocks are enabled during SLEEP mode.
  4373. */
  4374. #define __HAL_RCC_MDMA_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_MDMALPEN))
  4375. #define __HAL_RCC_DMA2D_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_DMA2DLPEN))
  4376. #if defined(JPEG)
  4377. #define __HAL_RCC_JPGDEC_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_JPGDECLPEN))
  4378. #endif /* JPEG */
  4379. #define __HAL_RCC_FLASH_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_FLASHLPEN))
  4380. #define __HAL_RCC_FMC_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_FMCLPEN))
  4381. #if defined(QUADSPI)
  4382. #define __HAL_RCC_QSPI_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_QSPILPEN))
  4383. #endif /*QUADSPI*/
  4384. #define __HAL_RCC_SDMMC1_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_SDMMC1LPEN))
  4385. #if defined(OCTOSPI1)
  4386. #define __HAL_RCC_OSPI1_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_OSPI1LPEN))
  4387. #endif /*OCTOSPI1*/
  4388. #if defined(OCTOSPI2)
  4389. #define __HAL_RCC_OSPI2_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_OSPI2LPEN))
  4390. #endif /*OCTOSPI2*/
  4391. #if defined(OCTOSPIM)
  4392. #define __HAL_RCC_IOMNGR_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_IOMNGRLPEN))
  4393. #endif /*OCTOSPIM*/
  4394. #if defined(OTFDEC1)
  4395. #define __HAL_RCC_OTFDEC1_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_OTFDEC1LPEN))
  4396. #endif /*OTFDEC1*/
  4397. #if defined(OTFDEC2)
  4398. #define __HAL_RCC_OTFDEC2_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_OTFDEC2LPEN))
  4399. #endif /*OTFDEC2*/
  4400. #if defined(GFXMMU)
  4401. #define __HAL_RCC_GFXMMU_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_GFXMMULPEN))
  4402. #endif /*GFXMMU*/
  4403. #if defined(CD_AXISRAM2_BASE)
  4404. #define __HAL_RCC_AXISRAM2_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_AXISRAM2LPEN))
  4405. #endif
  4406. #if defined(CD_AXISRAM3_BASE)
  4407. #define __HAL_RCC_AXISRAM3_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_AXISRAM3LPEN))
  4408. #endif
  4409. #define __HAL_RCC_DTCM1_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_DTCM1LPEN))
  4410. #define __HAL_RCC_DTCM2_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_DTCM2LPEN))
  4411. #define __HAL_RCC_ITCM_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_ITCMLPEN))
  4412. #if defined(RCC_AHB3LPENR_AXISRAMLPEN)
  4413. #define __HAL_RCC_D1SRAM1_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_AXISRAMLPEN))
  4414. #define __HAL_RCC_AXISRAM_CLK_SLEEP_ENABLE __HAL_RCC_D1SRAM1_CLK_SLEEP_ENABLE
  4415. #else
  4416. #define __HAL_RCC_AXISRAM1_CLK_SLEEP_ENABLE() (RCC->AHB3LPENR |= (RCC_AHB3LPENR_AXISRAM1LPEN))
  4417. #define __HAL_RCC_D1SRAM1_CLK_SLEEP_ENABLE __HAL_RCC_AXISRAM1_CLK_SLEEP_ENABLE /* For backward compatibility */
  4418. #endif /* RCC_AHB3LPENR_AXISRAMLPEN */
  4419. #define __HAL_RCC_MDMA_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_MDMALPEN))
  4420. #define __HAL_RCC_DMA2D_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_DMA2DLPEN))
  4421. #if defined(JPEG)
  4422. #define __HAL_RCC_JPGDEC_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_JPGDECLPEN))
  4423. #endif /* JPEG */
  4424. #define __HAL_RCC_FLASH_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_FLASHLPEN))
  4425. #define __HAL_RCC_FMC_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_FMCLPEN))
  4426. #if defined(QUADSPI)
  4427. #define __HAL_RCC_QSPI_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_QSPILPEN))
  4428. #endif /*QUADSPI*/
  4429. #define __HAL_RCC_SDMMC1_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_SDMMC1LPEN))
  4430. #if defined(OCTOSPI1)
  4431. #define __HAL_RCC_OSPI1_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_OSPI1LPEN))
  4432. #endif /*OCTOSPI1*/
  4433. #if defined(OCTOSPI2)
  4434. #define __HAL_RCC_OSPI2_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_OSPI2LPEN))
  4435. #endif /*OCTOSPI2*/
  4436. #if defined(OCTOSPIM)
  4437. #define __HAL_RCC_IOMNGR_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_IOMNGRLPEN))
  4438. #endif /*OCTOSPIM*/
  4439. #if defined(OTFDEC1)
  4440. #define __HAL_RCC_OTFDEC1_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_OTFDEC1LPEN))
  4441. #endif /*OTFDEC1*/
  4442. #if defined(OTFDEC2)
  4443. #define __HAL_RCC_OTFDEC2_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_OTFDEC2LPEN))
  4444. #endif /*OTFDEC2*/
  4445. #if defined(GFXMMU)
  4446. #define __HAL_RCC_GFXMMU_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_GFXMMULPEN))
  4447. #endif /*GFXMMU*/
  4448. #if defined(CD_AXISRAM2_BASE)
  4449. #define __HAL_RCC_AXISRAM2_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_AXISRAM2LPEN))
  4450. #endif
  4451. #if defined(CD_AXISRAM3_BASE)
  4452. #define __HAL_RCC_AXISRAM3_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_AXISRAM3LPEN))
  4453. #endif
  4454. #define __HAL_RCC_DTCM1_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_DTCM1LPEN))
  4455. #define __HAL_RCC_DTCM2_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_DTCM2LPEN))
  4456. #define __HAL_RCC_ITCM_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_ITCMLPEN))
  4457. #if defined(RCC_AHB3LPENR_AXISRAMLPEN)
  4458. #define __HAL_RCC_D1SRAM1_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_AXISRAMLPEN))
  4459. #define __HAL_RCC_AXISRAM_CLK_SLEEP_DISABLE __HAL_RCC_D1SRAM1_CLK_SLEEP_DISABLE
  4460. #else
  4461. #define __HAL_RCC_AXISRAM1_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~ (RCC_AHB3LPENR_AXISRAM1LPEN))
  4462. #define __HAL_RCC_D1SRAM1_CLK_SLEEP_DISABLE __HAL_RCC_AXISRAM1_CLK_SLEEP_DISABLE /* For backward compatibility */
  4463. #endif /* RCC_AHB3LPENR_AXISRAMLPEN */
  4464. /** @brief Get the enable or disable status of the AHB3 peripheral clock during Low Poser (Sleep) mode.
  4465. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  4466. * power consumption.
  4467. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
  4468. * @note By default, all peripheral clocks are enabled during SLEEP mode.
  4469. */
  4470. #define __HAL_RCC_MDMA_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_MDMALPEN) != 0U)
  4471. #define __HAL_RCC_DMA2D_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_DMA2DLPEN) != 0U)
  4472. #if defined(JPEG)
  4473. #define __HAL_RCC_JPGDEC_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_JPGDECLPEN) != 0U)
  4474. #endif /* JPEG */
  4475. #define __HAL_RCC_FLASH_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_FLASHLPEN) != 0U)
  4476. #define __HAL_RCC_FMC_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_FMCLPEN) != 0U)
  4477. #if defined(QUADSPI)
  4478. #define __HAL_RCC_QSPI_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_QSPILPEN) != 0U)
  4479. #endif /*QUADSPI*/
  4480. #define __HAL_RCC_SDMMC1_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_SDMMC1LPEN) != 0U)
  4481. #if defined(OCTOSPI1)
  4482. #define __HAL_RCC_OSPI1_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_OSPI1LPEN) != 0U)
  4483. #endif /*OCTOSPI1*/
  4484. #if defined(OCTOSPI2)
  4485. #define __HAL_RCC_OSPI2_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_OSPI2LPEN) != 0U)
  4486. #endif /*OCTOSPI2*/
  4487. #if defined(OCTOSPIM)
  4488. #define __HAL_RCC_IOMNGR_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_IOMNGRLPEN) != 0U)
  4489. #endif /*OCTOSPIM*/
  4490. #if defined(OTFDEC1)
  4491. #define __HAL_RCC_OTFDEC1_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_OTFDEC1LPEN) != 0U)
  4492. #endif /*OTFDEC1*/
  4493. #if defined(OTFDEC2)
  4494. #define __HAL_RCC_OTFDEC2_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_OTFDEC2LPEN) != 0U)
  4495. #endif /*OTFDEC2*/
  4496. #if defined(GFXMMU)
  4497. #define __HAL_RCC_GFXMMU_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_GFXMMULPEN) != 0U)
  4498. #endif /*GFXMMU*/
  4499. #if defined(CD_AXISRAM2_BASE)
  4500. #define __HAL_RCC_AXISRAM2_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_AXISRAM2LPEN) != 0U)
  4501. #endif
  4502. #if defined(CD_AXISRAM3_BASE)
  4503. #define __HAL_RCC_AXISRAM3_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_AXISRAM3LPEN) != 0U)
  4504. #endif
  4505. #define __HAL_RCC_DTCM1_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_DTCM1LPEN) != 0U)
  4506. #define __HAL_RCC_DTCM2_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_DTCM2LPEN) != 0U)
  4507. #define __HAL_RCC_ITCM_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_ITCMLPEN) != 0U)
  4508. #if defined(RCC_AHB3LPENR_AXISRAMLPEN)
  4509. #define __HAL_RCC_D1SRAM1_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_AXISRAMLPEN) != 0U)
  4510. #else
  4511. #define __HAL_RCC_AXISRAM1_IS_CLK_SLEEP_ENABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_AXISRAM1LPEN) != 0U)
  4512. #endif
  4513. #define __HAL_RCC_MDMA_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_MDMALPEN) == 0U)
  4514. #define __HAL_RCC_DMA2D_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_DMA2DLPEN) == 0U)
  4515. #if defined(JPEG)
  4516. #define __HAL_RCC_JPGDEC_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_JPGDECLPEN) == 0U)
  4517. #endif /* JPEG */
  4518. #define __HAL_RCC_FLASH_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_FLASHLPEN) == 0U)
  4519. #define __HAL_RCC_FMC_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_FMCLPEN) == 0U)
  4520. #if defined(QUADSPI)
  4521. #define __HAL_RCC_QSPI_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_QSPILPEN) == 0U)
  4522. #endif /*QUADSPI*/
  4523. #define __HAL_RCC_SDMMC1_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_SDMMC1LPEN) == 0U)
  4524. #if defined(OCTOSPI1)
  4525. #define __HAL_RCC_OSPI1_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_OSPI1LPEN) == 0U)
  4526. #endif /*OCTOSPI1*/
  4527. #if defined(OCTOSPI2)
  4528. #define __HAL_RCC_OSPI2_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_OSPI2LPEN) == 0U)
  4529. #endif /*OCTOSPI2*/
  4530. #if defined(OCTOSPIM)
  4531. #define __HAL_RCC_IOMNGR_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_IOMNGRLPEN) == 0U)
  4532. #endif /*OCTOSPIM*/
  4533. #if defined(OTFDEC1)
  4534. #define __HAL_RCC_OTFDEC1_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_OTFDEC1LPEN) == 0U)
  4535. #endif /*OTFDEC1*/
  4536. #if defined(OTFDEC2)
  4537. #define __HAL_RCC_OTFDEC2_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_OTFDEC2LPEN) == 0U)
  4538. #endif /*OTFDEC2*/
  4539. #if defined(GFXMMU)
  4540. #define __HAL_RCC_GFXMMU_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_GFXMMULPEN) == 0U)
  4541. #endif /*GFXMMU*/
  4542. #if defined(CD_AXISRAM2_BASE)
  4543. #define __HAL_RCC_AXISRAM2_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_AXISRAM2LPEN) == 0U)
  4544. #endif
  4545. #if defined(CD_AXISRAM3_BASE)
  4546. #define __HAL_RCC_AXISRAM3_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_AXISRAM3LPEN) == 0U)
  4547. #endif
  4548. #define __HAL_RCC_DTCM1_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_DTCM1LPEN) == 0U)
  4549. #define __HAL_RCC_DTCM2_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_DTCM2LPEN) == 0U)
  4550. #define __HAL_RCC_ITCM_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_ITCMLPEN) == 0U)
  4551. #if defined(RCC_AHB3LPENR_AXISRAMLPEN)
  4552. #define __HAL_RCC_D1SRAM1_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_AXISRAMLPEN) == 0U)
  4553. #else
  4554. #define __HAL_RCC_AXISRAM1_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & RCC_AHB3LPENR_AXISRAML1PEN) == 0U)
  4555. #endif /* RCC_AHB3LPENR_AXISRAMLPEN */
  4556. /** @brief ENABLE or disable the AHB1 peripheral clock during Low Power (Sleep) mode.
  4557. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  4558. * power consumption.
  4559. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  4560. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  4561. */
  4562. #define __HAL_RCC_DMA1_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_DMA1LPEN))
  4563. #define __HAL_RCC_DMA2_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_DMA2LPEN))
  4564. #define __HAL_RCC_ADC12_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_ADC12LPEN))
  4565. #if defined(RCC_AHB1LPENR_CRCLPEN)
  4566. #define __HAL_RCC_CRC_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_CRCLPEN))
  4567. #endif
  4568. #if defined(ETH)
  4569. #define __HAL_RCC_ETH1MAC_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_ETH1MACLPEN))
  4570. #endif /*ETH*/
  4571. #if defined(DUAL_CORE)
  4572. #define __HAL_RCC_ART_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_ARTLPEN))
  4573. #endif /*DUAL_CORE*/
  4574. #if defined(ETH)
  4575. #define __HAL_RCC_ETH1TX_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_ETH1TXLPEN))
  4576. #define __HAL_RCC_ETH1RX_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_ETH1RXLPEN))
  4577. #endif /*ETH*/
  4578. #define __HAL_RCC_USB1_OTG_HS_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_USB1OTGHSLPEN))
  4579. #define __HAL_RCC_USB1_OTG_HS_ULPI_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_USB1OTGHSULPILPEN))
  4580. #if defined(USB2_OTG_FS)
  4581. #define __HAL_RCC_USB2_OTG_FS_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_USB2OTGHSLPEN))
  4582. #define __HAL_RCC_USB2_OTG_FS_ULPI_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_USB2OTGHSULPILPEN))
  4583. #endif /* USB2_OTG_FS */
  4584. #define __HAL_RCC_DMA1_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~ (RCC_AHB1LPENR_DMA1LPEN))
  4585. #define __HAL_RCC_DMA2_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~ (RCC_AHB1LPENR_DMA2LPEN))
  4586. #define __HAL_RCC_ADC12_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~ (RCC_AHB1LPENR_ADC12LPEN))
  4587. #if defined(RCC_AHB1LPENR_CRCLPEN)
  4588. #define __HAL_RCC_CRC_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~ (RCC_AHB1LPENR_CRCLPEN))
  4589. #endif
  4590. #if defined(ETH)
  4591. #define __HAL_RCC_ETH1MAC_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~ (RCC_AHB1LPENR_ETH1MACLPEN))
  4592. #endif /*ETH*/
  4593. #if defined(DUAL_CORE)
  4594. #define __HAL_RCC_ART_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~ (RCC_AHB1LPENR_ARTLPEN))
  4595. #endif /*DUAL_CORE*/
  4596. #if defined(ETH)
  4597. #define __HAL_RCC_ETH1TX_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~ (RCC_AHB1LPENR_ETH1TXLPEN))
  4598. #define __HAL_RCC_ETH1RX_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~ (RCC_AHB1LPENR_ETH1RXLPEN))
  4599. #endif /*ETH*/
  4600. #define __HAL_RCC_USB1_OTG_HS_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~ (RCC_AHB1LPENR_USB1OTGHSLPEN))
  4601. #define __HAL_RCC_USB1_OTG_HS_ULPI_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~ (RCC_AHB1LPENR_USB1OTGHSULPILPEN))
  4602. #if defined(USB2_OTG_FS)
  4603. #define __HAL_RCC_USB2_OTG_FS_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~ (RCC_AHB1LPENR_USB2OTGHSLPEN))
  4604. #define __HAL_RCC_USB2_OTG_FS_ULPI_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~ (RCC_AHB1LPENR_USB2OTGHSULPILPEN))
  4605. #endif /* USB2_OTG_FS */
  4606. /** @brief Get the enable or disable status of the AHB1 peripheral clock during Low Poser (Sleep) mode.
  4607. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  4608. * power consumption.
  4609. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
  4610. * @note By default, all peripheral clocks are enabled during SLEEP mode.
  4611. */
  4612. #define __HAL_RCC_DMA1_IS_CLK_SLEEP_ENABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_DMA1LPEN)) != 0U)
  4613. #define __HAL_RCC_DMA2_IS_CLK_SLEEP_ENABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_DMA2LPEN)) != 0U)
  4614. #define __HAL_RCC_ADC12_IS_CLK_SLEEP_ENABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_ADC12LPEN)) != 0U)
  4615. #if defined(RCC_AHB1LPENR_CRCLPEN)
  4616. #define __HAL_RCC_CRC_IS_CLK_SLEEP_ENABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_CRCLPEN)) != 0U)
  4617. #endif
  4618. #if defined(ETH)
  4619. #define __HAL_RCC_ETH1MAC_IS_CLK_SLEEP_ENABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_ETH1MACLPEN)) != 0U)
  4620. #endif /*ETH*/
  4621. #if defined(DUAL_CORE)
  4622. #define __HAL_RCC_ART_IS_CLK_SLEEP_ENABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_ARTLPEN)) != 0U)
  4623. #endif /*DUAL_CORE*/
  4624. #if defined(ETH)
  4625. #define __HAL_RCC_ETH1TX_IS_CLK_SLEEP_ENABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_ETH1TXLPEN)) != 0U)
  4626. #define __HAL_RCC_ETH1RX_IS_CLK_SLEEP_ENABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_ETH1RXLPEN)) != 0U)
  4627. #endif /*ETH*/
  4628. #define __HAL_RCC_USB1_OTG_HS_IS_CLK_SLEEP_ENABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_USB1OTGHSLPEN)) != 0U)
  4629. #define __HAL_RCC_USB1_OTG_HS_ULPI_IS_CLK_SLEEP_ENABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_USB1OTGHSULPILPEN)) != 0U)
  4630. #if defined(USB2_OTG_FS)
  4631. #define __HAL_RCC_USB2_OTG_FS_IS_CLK_SLEEP_ENABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_USB2OTGHSLPEN)) != 0U)
  4632. #define __HAL_RCC_USB2_OTG_FS_ULPI_IS_CLK_SLEEP_ENABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_USB2OTGHSULPILPEN)) != 0U)
  4633. #endif /* USB2_OTG_FS */
  4634. #define __HAL_RCC_DMA1_IS_CLK_SLEEP_DISABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_DMA1LPEN)) == 0U)
  4635. #define __HAL_RCC_DMA2_IS_CLK_SLEEP_DISABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_DMA2LPEN)) == 0U)
  4636. #define __HAL_RCC_ADC12_IS_CLK_SLEEP_DISABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_ADC12LPEN)) == 0U)
  4637. #if defined(RCC_AHB1LPENR_CRCLPEN)
  4638. #define __HAL_RCC_CRC_IS_CLK_SLEEP_DISABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_CRCLPEN)) == 0U)
  4639. #endif
  4640. #if defined(ETH)
  4641. #define __HAL_RCC_ETH1MAC_IS_CLK_SLEEP_DISABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_ETH1MACLPEN)) == 0U)
  4642. #endif /* ETH */
  4643. #if defined(DUAL_CORE)
  4644. #define __HAL_RCC_ART_IS_CLK_SLEEP_DISABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_ARTLPEN)) == 0U)
  4645. #endif /*DUAL_CORE*/
  4646. #if defined(ETH)
  4647. #define __HAL_RCC_ETH1TX_IS_CLK_SLEEP_DISABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_ETH1TXLPEN)) == 0U)
  4648. #define __HAL_RCC_ETH1RX_IS_CLK_SLEEP_DISABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_ETH1RXLPEN)) == 0U)
  4649. #endif /* ETH */
  4650. #define __HAL_RCC_USB1_OTG_HS_IS_CLK_SLEEP_DISABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_USB1OTGHSLPEN)) == 0U)
  4651. #define __HAL_RCC_USB1_OTG_HS_ULPI_IS_CLK_SLEEP_DISABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_USB1OTGHSULPILPEN)) == 0U)
  4652. #if defined(USB2_OTG_FS)
  4653. #define __HAL_RCC_USB2_OTG_FS_IS_CLK_SLEEP_DISABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_USB2OTGHSLPEN)) == 0U)
  4654. #define __HAL_RCC_USB2_OTG_FS_ULPI_IS_CLK_SLEEP_DISABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_USB2OTGHSULPILPEN)) == 0U)
  4655. #endif /* USB2_OTG_FS */
  4656. /** @brief ENABLE or disable the AHB2 peripheral clock during Low Power (Sleep) mode.
  4657. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  4658. * power consumption.
  4659. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  4660. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  4661. */
  4662. #if defined(DCMI) && defined(PSSI)
  4663. #define __HAL_RCC_DCMI_PSSI_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_DCMI_PSSILPEN))
  4664. #define __HAL_RCC_DCMI_CLK_SLEEP_ENABLE() __HAL_RCC_DCMI_PSSI_CLK_SLEEP_ENABLE() /* for API backward compatibility*/
  4665. #else
  4666. #define __HAL_RCC_DCMI_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_DCMILPEN))
  4667. #endif /* DCMI && PSSI */
  4668. #define __HAL_RCC_CRYP_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_CRYPLPEN))
  4669. #define __HAL_RCC_HASH_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_HASHLPEN))
  4670. #define __HAL_RCC_RNG_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_RNGLPEN))
  4671. #define __HAL_RCC_SDMMC2_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_SDMMC2LPEN))
  4672. #if defined(RCC_AHB2LPENR_DFSDMDMALPEN)
  4673. #define __HAL_RCC_DFSDMDMA_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_DFSDMDMALPEN))
  4674. #endif
  4675. #if defined(RCC_AHB2LPENR_D2SRAM1LPEN)
  4676. #define __HAL_RCC_D2SRAM1_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_D2SRAM1LPEN))
  4677. #else
  4678. #define __HAL_RCC_AHBSRAM1_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_AHBSRAM1LPEN))
  4679. #endif /* RCC_AHB2LPENR_D2SRAM1LPEN */
  4680. #if defined(RCC_AHB2LPENR_D2SRAM2LPEN)
  4681. #define __HAL_RCC_D2SRAM2_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_D2SRAM2LPEN))
  4682. #else
  4683. #define __HAL_RCC_AHBSRAM2_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_AHBSRAM2LPEN))
  4684. #endif /* RCC_AHB2LPENR_D2SRAM2LPEN */
  4685. #if defined(RCC_AHB2LPENR_D2SRAM3LPEN)
  4686. #define __HAL_RCC_D2SRAM3_CLK_SLEEP_ENABLE() (RCC->AHB2LPENR |= (RCC_AHB2LPENR_D2SRAM3LPEN))
  4687. #endif
  4688. #if defined(DCMI) && defined(PSSI)
  4689. #define __HAL_RCC_DCMI_PSSI_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~ (RCC_AHB2LPENR_DCMI_PSSILPEN))
  4690. #define __HAL_RCC_DCMI_CLK_SLEEP_DISABLE() __HAL_RCC_DCMI_PSSI_CLK_SLEEP_DISABLE() /* for API backward compatibility*/
  4691. #else
  4692. #define __HAL_RCC_DCMI_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~ (RCC_AHB2LPENR_DCMILPEN))
  4693. #endif /* DCMI && PSSI */
  4694. #define __HAL_RCC_CRYP_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~ (RCC_AHB2LPENR_CRYPLPEN))
  4695. #define __HAL_RCC_HASH_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~ (RCC_AHB2LPENR_HASHLPEN))
  4696. #define __HAL_RCC_RNG_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~ (RCC_AHB2LPENR_RNGLPEN))
  4697. #define __HAL_RCC_SDMMC2_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~ (RCC_AHB2LPENR_SDMMC2LPEN))
  4698. #if defined(RCC_AHB2LPENR_DFSDMDMALPEN)
  4699. #define __HAL_RCC_DFSDMDMA_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~ (RCC_AHB2LPENR_DFSDMDMALPEN))
  4700. #endif
  4701. #if defined(RCC_AHB2LPENR_D2SRAM1LPEN)
  4702. #define __HAL_RCC_D2SRAM1_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~ (RCC_AHB2LPENR_D2SRAM1LPEN))
  4703. #else
  4704. #define __HAL_RCC_AHBSRAM1_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~ (RCC_AHB2LPENR_AHBSRAM1LPEN))
  4705. #endif /* RCC_AHB2LPENR_D2SRAM1LPEN */
  4706. #if defined(RCC_AHB2LPENR_D2SRAM2LPEN)
  4707. #define __HAL_RCC_D2SRAM2_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~ (RCC_AHB2LPENR_D2SRAM2LPEN))
  4708. #else
  4709. #define __HAL_RCC_AHBSRAM2_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~ (RCC_AHB2LPENR_AHBSRAM2LPEN))
  4710. #endif /* RCC_AHB2LPENR_D2SRAM2LPEN */
  4711. #if defined(RCC_AHB2LPENR_D2SRAM3LPEN)
  4712. #define __HAL_RCC_D2SRAM3_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~ (RCC_AHB2LPENR_D2SRAM3LPEN))
  4713. #endif
  4714. /** @brief Get the enable or disable status of the AHB2 peripheral clock during Low Poser (Sleep) mode.
  4715. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  4716. * power consumption.
  4717. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
  4718. * @note By default, all peripheral clocks are enabled during SLEEP mode.
  4719. */
  4720. #if defined(DCMI) && defined(PSSI)
  4721. #define __HAL_RCC_DCMI_PSSI_IS_CLK_SLEEP_ENABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_DCMI_PSSILPEN)) != 0U)
  4722. #define __HAL_RCC_DCMI_IS_CLK_SLEEP_ENABLED() __HAL_RCC_DCMI_PSSI_IS_CLK_SLEEP_ENABLED() /* for API backward compatibility*/
  4723. #else
  4724. #define __HAL_RCC_DCMI_IS_CLK_SLEEP_ENABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_DCMILPEN)) != 0U)
  4725. #endif /* DCMI && PSSI */
  4726. #define __HAL_RCC_CRYP_IS_CLK_SLEEP_ENABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_CRYPLPEN)) != 0U)
  4727. #define __HAL_RCC_HASH_IS_CLK_SLEEP_ENABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_HASHLPEN)) != 0U)
  4728. #define __HAL_RCC_RNG_IS_CLK_SLEEP_ENABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_RNGLPEN)) != 0U)
  4729. #define __HAL_RCC_SDMMC2_IS_CLK_SLEEP_ENABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_SDMMC2LPEN)) != 0U)
  4730. #if defined(RCC_AHB2LPENR_DFSDMDMALPEN)
  4731. #define __HAL_RCC_DFSDMDMA_IS_CLK_SLEEP_ENABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_DFSDMDMALPEN)) != 0U)
  4732. #endif
  4733. #if defined(RCC_AHB2LPENR_D2SRAM1LPEN)
  4734. #define __HAL_RCC_D2SRAM1_IS_CLK_SLEEP_ENABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_D2SRAM1LPEN)) != 0U)
  4735. #else
  4736. #define __HAL_RCC_AHBSRAM1_IS_CLK_SLEEP_ENABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_AHBSRAM1LPEN)) != 0U)
  4737. #endif /* RCC_AHB2LPENR_D2SRAM1LPEN */
  4738. #if defined(RCC_AHB2LPENR_D2SRAM2LPEN)
  4739. #define __HAL_RCC_D2SRAM2_IS_CLK_SLEEP_ENABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_D2SRAM2LPEN)) != 0U)
  4740. #else
  4741. #define __HAL_RCC_AHBSRAM2_IS_CLK_SLEEP_ENABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_AHBSRAM2LPEN)) != 0U)
  4742. #endif /* RCC_AHB2LPENR_D2SRAM2LPEN */
  4743. #if defined(RCC_AHB2LPENR_D2SRAM3LPEN)
  4744. #define __HAL_RCC_D2SRAM3_IS_CLK_SLEEP_ENABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_D2SRAM3LPEN)) != 0U)
  4745. #endif /* RCC_AHB2LPENR_D2SRAM3LPEN */
  4746. #if defined(DCMI) && defined(PSSI)
  4747. #define __HAL_RCC_DCMI_PSSI_IS_CLK_SLEEP_DISABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_DCMI_PSSILPEN)) == 0U)
  4748. #define __HAL_RCC_DCMI_IS_CLK_SLEEP_DISABLED() __HAL_RCC_DCMI_PSSI_IS_CLK_SLEEP_DISABLED() /* for API backward compatibility*/
  4749. #else
  4750. #define __HAL_RCC_DCMI_IS_CLK_SLEEP_DISABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_DCMILPEN)) == 0U)
  4751. #endif /* DCMI && PSSI */
  4752. #define __HAL_RCC_CRYP_IS_CLK_SLEEP_DISABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_CRYPLPEN)) == 0U)
  4753. #define __HAL_RCC_HASH_IS_CLK_SLEEP_DISABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_HASHLPEN)) == 0U)
  4754. #define __HAL_RCC_RNG_IS_CLK_SLEEP_DISABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_RNGLPEN)) == 0U)
  4755. #if defined(RCC_AHB2LPENR_DFSDMDMALPEN)
  4756. #define __HAL_RCC_DFSDMDMA_IS_CLK_SLEEP_DISABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_DFSDMDMALPEN)) == 0U)
  4757. #endif
  4758. #define __HAL_RCC_SDMMC2_IS_CLK_SLEEP_DISABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_SDMMC2LPEN)) == 0U)
  4759. #if defined(RCC_AHB2LPENR_D2SRAM1LPEN)
  4760. #define __HAL_RCC_D2SRAM1_IS_CLK_SLEEP_DISABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_D2SRAM1LPEN)) == 0U)
  4761. #else
  4762. #define __HAL_RCC_AHBSRAM1_IS_CLK_SLEEP_DISABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_AHBSRAM1LPEN)) == 0U)
  4763. #endif /* RCC_AHB2LPENR_D2SRAM1LPEN */
  4764. #if defined(RCC_AHB2LPENR_D2SRAM2LPEN)
  4765. #define __HAL_RCC_D2SRAM2_IS_CLK_SLEEP_DISABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_D2SRAM2LPEN)) == 0U)
  4766. #else
  4767. #define __HAL_RCC_AHBSRAM2_IS_CLK_SLEEP_DISABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_AHBSRAM2LPEN)) == 0U)
  4768. #endif /* RCC_AHB2LPENR_D2SRAM2LPEN */
  4769. #if defined(RCC_AHB2LPENR_D2SRAM3LPEN)
  4770. #define __HAL_RCC_D2SRAM3_IS_CLK_SLEEP_DISABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_D2SRAM3LPEN)) == 0U)
  4771. #endif /* RCC_AHB2LPENR_D2SRAM1LPEN*/
  4772. /** @brief ENABLE or disable the AHB4 peripheral clock during Low Power (Sleep) mode.
  4773. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  4774. * power consumption.
  4775. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  4776. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  4777. */
  4778. #define __HAL_RCC_GPIOA_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOALPEN)
  4779. #define __HAL_RCC_GPIOB_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOBLPEN)
  4780. #define __HAL_RCC_GPIOC_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOCLPEN)
  4781. #define __HAL_RCC_GPIOD_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_GPIODLPEN)
  4782. #define __HAL_RCC_GPIOE_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOELPEN)
  4783. #define __HAL_RCC_GPIOF_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOFLPEN)
  4784. #define __HAL_RCC_GPIOG_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOGLPEN)
  4785. #define __HAL_RCC_GPIOH_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOHLPEN)
  4786. #define __HAL_RCC_GPIOI_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOILPEN)
  4787. #define __HAL_RCC_GPIOJ_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOJLPEN)
  4788. #define __HAL_RCC_GPIOK_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOKLPEN)
  4789. #if defined(RCC_AHB4LPENR_CRCLPEN)
  4790. #define __HAL_RCC_CRC_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_CRCLPEN)
  4791. #endif
  4792. #if defined(BDMA2)
  4793. #define __HAL_RCC_BDMA2_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_BDMA2LPEN)
  4794. #define __HAL_RCC_BDMA_CLK_SLEEP_ENABLE __HAL_RCC_BDMA2_CLK_SLEEP_ENABLE /* for API backward compatibility*/
  4795. #else
  4796. #define __HAL_RCC_BDMA_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_BDMALPEN)
  4797. #endif /* BDMA2 */
  4798. #if defined(ADC3)
  4799. #define __HAL_RCC_ADC3_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_ADC3LPEN)
  4800. #endif /* ADC3 */
  4801. #define __HAL_RCC_BKPRAM_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR) |= (RCC_AHB4LPENR_BKPRAMLPEN)
  4802. #if defined(RCC_AHB4LPENR_SRDSRAMLPEN)
  4803. #define __HAL_RCC_SRDSRAM_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR |= (RCC_AHB4LPENR_SRDSRAMLPEN))
  4804. #define __HAL_RCC_D3SRAM1_CLK_SLEEP_ENABLE __HAL_RCC_SRDSRAM_CLK_SLEEP_ENABLE /* for API backward compatibility*/
  4805. #else
  4806. #define __HAL_RCC_D3SRAM1_CLK_SLEEP_ENABLE() (RCC->AHB4LPENR |= (RCC_AHB4LPENR_D3SRAM1LPEN))
  4807. #endif /* RCC_AHB4LPENR_SRDSRAMLPEN */
  4808. #define __HAL_RCC_GPIOA_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOALPEN)
  4809. #define __HAL_RCC_GPIOB_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOBLPEN)
  4810. #define __HAL_RCC_GPIOC_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOCLPEN)
  4811. #define __HAL_RCC_GPIOD_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIODLPEN)
  4812. #define __HAL_RCC_GPIOE_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOELPEN)
  4813. #define __HAL_RCC_GPIOF_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOFLPEN)
  4814. #define __HAL_RCC_GPIOG_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOGLPEN)
  4815. #define __HAL_RCC_GPIOH_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOHLPEN)
  4816. #define __HAL_RCC_GPIOI_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOILPEN)
  4817. #define __HAL_RCC_GPIOJ_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOJLPEN)
  4818. #define __HAL_RCC_GPIOK_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOKLPEN)
  4819. #if defined(RCC_AHB4LPENR_CRCLPEN)
  4820. #define __HAL_RCC_CRC_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_CRCLPEN)
  4821. #endif
  4822. #if defined(BDMA2)
  4823. #define __HAL_RCC_BDMA2_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_BDMA2LPEN)
  4824. #define __HAL_RCC_BDMA_CLK_SLEEP_DISABLE __HAL_RCC_BDMA2_CLK_SLEEP_DISABLE /* For API backward compatibility*/
  4825. #else
  4826. #define __HAL_RCC_BDMA_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_BDMALPEN)
  4827. #endif /*BDMA2*/
  4828. #if defined(ADC3)
  4829. #define __HAL_RCC_ADC3_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_ADC3LPEN)
  4830. #endif /*ADC3*/
  4831. #define __HAL_RCC_BKPRAM_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR) &= ~ (RCC_AHB4LPENR_BKPRAMLPEN)
  4832. #if defined(RCC_AHB4LPENR_SRDSRAMLPEN)
  4833. #define __HAL_RCC_SRDSRAM_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR &= ~ (RCC_AHB4LPENR_SRDSRAMLPEN))
  4834. #define __HAL_RCC_D3SRAM1_CLK_SLEEP_DISABLE __HAL_RCC_SRDSRAM_CLK_SLEEP_DISABLE
  4835. #else
  4836. #define __HAL_RCC_D3SRAM1_CLK_SLEEP_DISABLE() (RCC->AHB4LPENR &= ~ (RCC_AHB4LPENR_D3SRAM1LPEN))
  4837. #endif
  4838. /** @brief Get the enable or disable status of the AHB4 peripheral clock during Low Poser (Sleep) mode.
  4839. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  4840. * power consumption.
  4841. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
  4842. * @note By default, all peripheral clocks are enabled during SLEEP mode.
  4843. */
  4844. #define __HAL_RCC_GPIOA_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOALPEN)) != 0U)
  4845. #define __HAL_RCC_GPIOB_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOBLPEN)) != 0U)
  4846. #define __HAL_RCC_GPIOC_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOCLPEN)) != 0U)
  4847. #define __HAL_RCC_GPIOD_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIODLPEN)) != 0U)
  4848. #define __HAL_RCC_GPIOE_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOELPEN)) != 0U)
  4849. #define __HAL_RCC_GPIOF_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOFLPEN)) != 0U)
  4850. #define __HAL_RCC_GPIOG_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOGLPEN)) != 0U)
  4851. #define __HAL_RCC_GPIOH_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOHLPEN)) != 0U)
  4852. #define __HAL_RCC_GPIOI_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOILPEN)) != 0U)
  4853. #define __HAL_RCC_GPIOJ_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOJLPEN)) != 0U)
  4854. #define __HAL_RCC_GPIOK_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOKLPEN)) != 0U)
  4855. #if defined(RCC_AHB4LPENR_CRCLPEN)
  4856. #define __HAL_RCC_CRC_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_CRCLPEN)) != 0U)
  4857. #endif
  4858. #if defined(BDMA2)
  4859. #define __HAL_RCC_BDMA2_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_BDMA2LPEN)) != 0U)
  4860. #define __HAL_RCC_BDMA_IS_CLK_SLEEP_ENABLED __HAL_RCC_BDMA2_IS_CLK_SLEEP_ENABLED /* For API backward compatibility*/
  4861. #else
  4862. #define __HAL_RCC_BDMA_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_BDMALPEN)) != 0U)
  4863. #endif /*BDMA2*/
  4864. #if defined(ADC3)
  4865. #define __HAL_RCC_ADC3_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_ADC3LPEN)) != 0U)
  4866. #endif /*ADC3*/
  4867. #define __HAL_RCC_BKPRAM_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_BKPRAMLPEN)) != 0U)
  4868. #if defined(RCC_AHB4LPENR_SRDSRAMLPEN)
  4869. #define __HAL_RCC_SRDSRAM_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_SRDSRAMLPEN)) != 0U)
  4870. #define __HAL_RCC_D3SRAM1_IS_CLK_SLEEP_ENABLED __HAL_RCC_SRDSRAM_IS_CLK_SLEEP_ENABLED /* For API backward compatibility*/
  4871. #else
  4872. #define __HAL_RCC_D3SRAM1_IS_CLK_SLEEP_ENABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_D3SRAM1LPEN)) != 0U)
  4873. #endif
  4874. #define __HAL_RCC_GPIOA_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOALPEN)) == 0U)
  4875. #define __HAL_RCC_GPIOB_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOBLPEN)) == 0U)
  4876. #define __HAL_RCC_GPIOC_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOCLPEN)) == 0U)
  4877. #define __HAL_RCC_GPIOD_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIODLPEN)) == 0U)
  4878. #define __HAL_RCC_GPIOE_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOELPEN)) == 0U)
  4879. #define __HAL_RCC_GPIOF_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOFLPEN)) == 0U)
  4880. #define __HAL_RCC_GPIOG_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOGLPEN)) == 0U)
  4881. #define __HAL_RCC_GPIOH_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOHLPEN)) == 0U)
  4882. #define __HAL_RCC_GPIOI_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOILPEN)) == 0U)
  4883. #define __HAL_RCC_GPIOJ_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOJLPEN)) == 0U)
  4884. #define __HAL_RCC_GPIOK_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_GPIOKLPEN)) == 0U)
  4885. #if defined(RCC_AHB4LPENR_CRCLPEN)
  4886. #define __HAL_RCC_CRC_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_CRCLPEN)) == 0U)
  4887. #endif
  4888. #if defined(BDMA2)
  4889. #define __HAL_RCC_BDMA2_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_BDMA2LPEN)) == 0U)
  4890. #define __HAL_RCC_BDMA_IS_CLK_SLEEP_DISABLED __HAL_RCC_BDMA2_IS_CLK_SLEEP_DISABLED /* For API backward compatibility*/
  4891. #else
  4892. #define __HAL_RCC_BDMA_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_BDMALPEN)) == 0U)
  4893. #endif /*BDMA2*/
  4894. #if defined(ADC3)
  4895. #define __HAL_RCC_ADC3_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_ADC3LPEN)) == 0U)
  4896. #endif /*ADC3*/
  4897. #define __HAL_RCC_BKPRAM_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_BKPRAMLPEN)) == 0U)
  4898. #if defined(RCC_AHB4LPENR_SRDSRAMLPEN)
  4899. #define __HAL_RCC_SRDSRAM_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_SRDSRAMLPEN)) == 0U)
  4900. #define __HAL_RCC_D3SRAM1_IS_CLK_SLEEP_DISABLED __HAL_RCC_SRDSRAM_IS_CLK_SLEEP_DISABLED /* For API backward compatibility*/
  4901. #else
  4902. #define __HAL_RCC_D3SRAM1_IS_CLK_SLEEP_DISABLED() ((RCC->AHB4LPENR & (RCC_AHB4LPENR_D3SRAM1LPEN)) == 0U)
  4903. #endif
  4904. /** @brief ENABLE or disable the APB3 peripheral clock during Low Power (Sleep) mode.
  4905. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  4906. * power consumption.
  4907. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  4908. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  4909. */
  4910. #if defined(LTDC)
  4911. #define __HAL_RCC_LTDC_CLK_SLEEP_ENABLE() (RCC->APB3LPENR) |= (RCC_APB3LPENR_LTDCLPEN)
  4912. #endif /* LTDC */
  4913. #if defined(DSI)
  4914. #define __HAL_RCC_DSI_CLK_SLEEP_ENABLE() (RCC->APB3LPENR) |= (RCC_APB3LPENR_DSILPEN)
  4915. #endif /*DSI*/
  4916. #define __HAL_RCC_WWDG1_CLK_SLEEP_ENABLE() (RCC->APB3LPENR) |= (RCC_APB3LPENR_WWDG1LPEN)
  4917. #if defined(LTDC)
  4918. #define __HAL_RCC_LTDC_CLK_SLEEP_DISABLE() (RCC->APB3LPENR) &= ~ (RCC_APB3LPENR_LTDCLPEN)
  4919. #endif /* LTDC */
  4920. #if defined(DSI)
  4921. #define __HAL_RCC_DSI_CLK_SLEEP_DISABLE() (RCC->APB3LPENR) &= ~ (RCC_APB3LPENR_DSILPEN)
  4922. #endif /*DSI*/
  4923. #define __HAL_RCC_WWDG1_CLK_SLEEP_DISABLE() (RCC->APB3LPENR) &= ~ (RCC_APB3LPENR_WWDG1LPEN)
  4924. /** @brief Get the enable or disable status of the APB3 peripheral clock during Low Poser (Sleep) mode.
  4925. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  4926. * power consumption.
  4927. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
  4928. * @note By default, all peripheral clocks are enabled during SLEEP mode.
  4929. */
  4930. #if defined(LTDC)
  4931. #define __HAL_RCC_LTDC_IS_CLK_SLEEP_ENABLED() ((RCC->APB3LPENR & (RCC_APB3LPENR_LTDCLPEN)) != 0U)
  4932. #endif /* LTDC */
  4933. #if defined(DSI)
  4934. #define __HAL_RCC_DSI_IS_CLK_SLEEP_ENABLED() ((RCC->APB3LPENR & (RCC_APB3LPENR_DSILPEN)) != 0U)
  4935. #endif /*DSI*/
  4936. #define __HAL_RCC_WWDG1_IS_CLK_SLEEP_ENABLED() ((RCC->APB3LPENR & (RCC_APB3LPENR_WWDG1LPEN)) != 0U)
  4937. #if defined(LTDC)
  4938. #define __HAL_RCC_LTDC_IS_CLK_SLEEP_DISABLED() ((RCC->APB3LPENR & (RCC_APB3LPENR_LTDCLPEN)) == 0U)
  4939. #endif /* LTDC */
  4940. #if defined(DSI)
  4941. #define __HAL_RCC_DSI_IS_CLK_SLEEP_DISABLED() ((RCC->APB3LPENR & (RCC_APB3LPENR_DSILPEN)) == 0U)
  4942. #endif /*DSI*/
  4943. #define __HAL_RCC_WWDG1_IS_CLK_SLEEP_DISABLED() ((RCC->APB3LPENR & (RCC_APB3LPENR_WWDG1LPEN)) == 0U)
  4944. /** @brief ENABLE or disable the APB1 peripheral clock during Low Power (Sleep) mode.
  4945. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  4946. * power consumption.
  4947. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  4948. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  4949. */
  4950. #define __HAL_RCC_TIM2_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_TIM2LPEN)
  4951. #define __HAL_RCC_TIM3_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_TIM3LPEN)
  4952. #define __HAL_RCC_TIM4_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_TIM4LPEN)
  4953. #define __HAL_RCC_TIM5_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_TIM5LPEN)
  4954. #define __HAL_RCC_TIM6_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_TIM6LPEN)
  4955. #define __HAL_RCC_TIM7_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_TIM7LPEN)
  4956. #define __HAL_RCC_TIM12_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_TIM12LPEN)
  4957. #define __HAL_RCC_TIM13_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_TIM13LPEN)
  4958. #define __HAL_RCC_TIM14_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_TIM14LPEN)
  4959. #define __HAL_RCC_LPTIM1_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_LPTIM1LPEN)
  4960. #if defined(DUAL_CORE)
  4961. #define __HAL_RCC_WWDG2_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_WWDG2LPEN)
  4962. #endif /*DUAL_CORE*/
  4963. #define __HAL_RCC_SPI2_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_SPI2LPEN)
  4964. #define __HAL_RCC_SPI3_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_SPI3LPEN)
  4965. #define __HAL_RCC_SPDIFRX_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_SPDIFRXLPEN)
  4966. #define __HAL_RCC_USART2_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_USART2LPEN)
  4967. #define __HAL_RCC_USART3_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_USART3LPEN)
  4968. #define __HAL_RCC_UART4_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_UART4LPEN)
  4969. #define __HAL_RCC_UART5_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_UART5LPEN)
  4970. #define __HAL_RCC_I2C1_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_I2C1LPEN)
  4971. #define __HAL_RCC_I2C2_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_I2C2LPEN)
  4972. #define __HAL_RCC_I2C3_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_I2C3LPEN)
  4973. #define __HAL_RCC_CEC_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_CECLPEN)
  4974. #define __HAL_RCC_DAC12_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_DAC12LPEN)
  4975. #define __HAL_RCC_UART7_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_UART7LPEN)
  4976. #define __HAL_RCC_UART8_CLK_SLEEP_ENABLE() (RCC->APB1LLPENR) |= (RCC_APB1LLPENR_UART8LPEN)
  4977. #define __HAL_RCC_CRS_CLK_SLEEP_ENABLE() (RCC->APB1HLPENR) |= (RCC_APB1HLPENR_CRSLPEN)
  4978. #define __HAL_RCC_SWPMI1_CLK_SLEEP_ENABLE() (RCC->APB1HLPENR) |= (RCC_APB1HLPENR_SWPMILPEN)
  4979. #define __HAL_RCC_OPAMP_CLK_SLEEP_ENABLE() (RCC->APB1HLPENR) |= (RCC_APB1HLPENR_OPAMPLPEN)
  4980. #define __HAL_RCC_MDIOS_CLK_SLEEP_ENABLE() (RCC->APB1HLPENR) |= (RCC_APB1HLPENR_MDIOSLPEN)
  4981. #define __HAL_RCC_FDCAN_CLK_SLEEP_ENABLE() (RCC->APB1HLPENR) |= (RCC_APB1HLPENR_FDCANLPEN)
  4982. #define __HAL_RCC_TIM2_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM2LPEN)
  4983. #define __HAL_RCC_TIM3_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM3LPEN)
  4984. #define __HAL_RCC_TIM4_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM4LPEN)
  4985. #define __HAL_RCC_TIM5_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM5LPEN)
  4986. #define __HAL_RCC_TIM6_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM6LPEN)
  4987. #define __HAL_RCC_TIM7_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM7LPEN)
  4988. #define __HAL_RCC_TIM12_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM12LPEN)
  4989. #define __HAL_RCC_TIM13_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM13LPEN)
  4990. #define __HAL_RCC_TIM14_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM14LPEN)
  4991. #define __HAL_RCC_LPTIM1_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_LPTIM1LPEN)
  4992. #if defined(DUAL_CORE)
  4993. #define __HAL_RCC_WWDG2_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_WWDG2LPEN)
  4994. #endif /*DUAL_CORE*/
  4995. #define __HAL_RCC_SPI2_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_SPI2LPEN)
  4996. #define __HAL_RCC_SPI3_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_SPI3LPEN)
  4997. #define __HAL_RCC_SPDIFRX_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_SPDIFRXLPEN)
  4998. #define __HAL_RCC_USART2_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_USART2LPEN)
  4999. #define __HAL_RCC_USART3_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_USART3LPEN)
  5000. #define __HAL_RCC_UART4_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_UART4LPEN)
  5001. #define __HAL_RCC_UART5_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_UART5LPEN)
  5002. #define __HAL_RCC_I2C1_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_I2C1LPEN)
  5003. #define __HAL_RCC_I2C2_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_I2C2LPEN)
  5004. #define __HAL_RCC_I2C3_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_I2C3LPEN)
  5005. #define __HAL_RCC_CEC_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_CECLPEN)
  5006. #define __HAL_RCC_DAC12_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_DAC12LPEN)
  5007. #define __HAL_RCC_UART7_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_UART7LPEN)
  5008. #define __HAL_RCC_UART8_CLK_SLEEP_DISABLE() (RCC->APB1LLPENR) &= ~ (RCC_APB1LLPENR_UART8LPEN)
  5009. #define __HAL_RCC_CRS_CLK_SLEEP_DISABLE() (RCC->APB1HLPENR) &= ~ (RCC_APB1HLPENR_CRSLPEN)
  5010. #define __HAL_RCC_SWPMI1_CLK_SLEEP_DISABLE() (RCC->APB1HLPENR) &= ~ (RCC_APB1HLPENR_SWPMILPEN)
  5011. #define __HAL_RCC_OPAMP_CLK_SLEEP_DISABLE() (RCC->APB1HLPENR) &= ~ (RCC_APB1HLPENR_OPAMPLPEN)
  5012. #define __HAL_RCC_MDIOS_CLK_SLEEP_DISABLE() (RCC->APB1HLPENR) &= ~ (RCC_APB1HLPENR_MDIOSLPEN)
  5013. #define __HAL_RCC_FDCAN_CLK_SLEEP_DISABLE() (RCC->APB1HLPENR) &= ~ (RCC_APB1HLPENR_FDCANLPEN)
  5014. /** @brief Get the enable or disable status of the APB1 peripheral clock during Low Poser (Sleep) mode.
  5015. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5016. * power consumption.
  5017. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
  5018. * @note By default, all peripheral clocks are enabled during SLEEP mode.
  5019. */
  5020. #define __HAL_RCC_TIM2_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM2LPEN)) != 0U)
  5021. #define __HAL_RCC_TIM3_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM3LPEN)) != 0U)
  5022. #define __HAL_RCC_TIM4_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM4LPEN)) != 0U)
  5023. #define __HAL_RCC_TIM5_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM5LPEN)) != 0U)
  5024. #define __HAL_RCC_TIM6_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM6LPEN)) != 0U)
  5025. #define __HAL_RCC_TIM7_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM7LPEN)) != 0U)
  5026. #define __HAL_RCC_TIM12_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM12LPEN)) != 0U)
  5027. #define __HAL_RCC_TIM13_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM13LPEN)) != 0U)
  5028. #define __HAL_RCC_TIM14_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM14LPEN)) != 0U)
  5029. #define __HAL_RCC_LPTIM1_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_LPTIM1LPEN)) != 0U)
  5030. #if defined(DUAL_CORE)
  5031. #define __HAL_RCC_WWDG2_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_WWDG2LPEN)) != 0U)
  5032. #endif /*DUAL_CORE*/
  5033. #define __HAL_RCC_SPI2_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_SPI2LPEN)) != 0U)
  5034. #define __HAL_RCC_SPI3_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_SPI3LPEN)) != 0U)
  5035. #define __HAL_RCC_SPDIFRX_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_SPDIFRXLPEN)) != 0U)
  5036. #define __HAL_RCC_USART2_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_USART2LPEN)) != 0U)
  5037. #define __HAL_RCC_USART3_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_USART3LPEN)) != 0U)
  5038. #define __HAL_RCC_UART4_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_UART4LPEN)) != 0U)
  5039. #define __HAL_RCC_UART5_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_UART5LPEN)) != 0U)
  5040. #define __HAL_RCC_I2C1_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_I2C1LPEN)) != 0U)
  5041. #define __HAL_RCC_I2C2_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_I2C2LPEN)) != 0U)
  5042. #define __HAL_RCC_I2C3_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_I2C3LPEN)) != 0U)
  5043. #define __HAL_RCC_CEC_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_CECLPEN)) != 0U)
  5044. #define __HAL_RCC_DAC12_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_DAC12LPEN)) != 0U)
  5045. #define __HAL_RCC_UART7_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_UART7LPEN)) != 0U)
  5046. #define __HAL_RCC_UART8_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_UART8LPEN)) != 0U)
  5047. #define __HAL_RCC_CRS_IS_CLK_SLEEP_ENABLED() ((RCC->APB1HLPENR & (RCC_APB1HLPENR_CRSLPEN)) != 0U)
  5048. #define __HAL_RCC_SWPMI1_IS_CLK_SLEEP_ENABLED() ((RCC->APB1HLPENR & (RCC_APB1HLPENR_SWPMILPEN)) != 0U)
  5049. #define __HAL_RCC_OPAMP_IS_CLK_SLEEP_ENABLED() ((RCC->APB1HLPENR & (RCC_APB1HLPENR_OPAMPLPEN)) != 0U)
  5050. #define __HAL_RCC_MDIOS_IS_CLK_SLEEP_ENABLED() ((RCC->APB1HLPENR & (RCC_APB1HLPENR_MDIOSLPEN)) != 0U)
  5051. #define __HAL_RCC_FDCAN_IS_CLK_SLEEP_ENABLED() ((RCC->APB1HLPENR & (RCC_APB1HLPENR_FDCANLPEN)) != 0U)
  5052. #define __HAL_RCC_TIM2_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM2LPEN)) == 0U)
  5053. #define __HAL_RCC_TIM3_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM3LPEN)) == 0U)
  5054. #define __HAL_RCC_TIM4_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM4LPEN)) == 0U)
  5055. #define __HAL_RCC_TIM5_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM5LPEN)) == 0U)
  5056. #define __HAL_RCC_TIM6_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM6LPEN)) == 0U)
  5057. #define __HAL_RCC_TIM7_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM7LPEN)) == 0U)
  5058. #define __HAL_RCC_TIM12_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM12LPEN)) == 0U)
  5059. #define __HAL_RCC_TIM13_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM13LPEN)) == 0U)
  5060. #define __HAL_RCC_TIM14_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_TIM14LPEN)) == 0U)
  5061. #define __HAL_RCC_LPTIM1_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_LPTIM1LPEN)) == 0U)
  5062. #if defined(DUAL_CORE)
  5063. #define __HAL_RCC_WWDG2_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_WWDG2LPEN)) == 0U)
  5064. #endif /*DUAL_CORE*/
  5065. #define __HAL_RCC_SPI2_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_SPI2LPEN)) == 0U)
  5066. #define __HAL_RCC_SPI3_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_SPI3LPEN)) == 0U)
  5067. #define __HAL_RCC_SPDIFRX_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_SPDIFRXLPEN)) == 0U)
  5068. #define __HAL_RCC_USART2_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_USART2LPEN)) == 0U)
  5069. #define __HAL_RCC_USART3_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_USART3LPEN)) == 0U)
  5070. #define __HAL_RCC_UART4_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_UART4LPEN)) == 0U)
  5071. #define __HAL_RCC_UART5_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_UART5LPEN)) == 0U)
  5072. #define __HAL_RCC_I2C1_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_I2C1LPEN)) == 0U)
  5073. #define __HAL_RCC_I2C2_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_I2C2LPEN)) == 0U)
  5074. #define __HAL_RCC_I2C3_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_I2C3LPEN)) == 0U)
  5075. #define __HAL_RCC_CEC_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_CECLPEN)) == 0U)
  5076. #define __HAL_RCC_DAC12_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_DAC12LPEN)) == 0U)
  5077. #define __HAL_RCC_UART7_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_UART7LPEN)) == 0U)
  5078. #define __HAL_RCC_UART8_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LLPENR & (RCC_APB1LLPENR_UART8LPEN)) == 0U)
  5079. #define __HAL_RCC_CRS_IS_CLK_SLEEP_DISABLED() ((RCC->APB1HLPENR & (RCC_APB1HLPENR_CRSLPEN)) == 0U)
  5080. #define __HAL_RCC_SWPMI1_IS_CLK_SLEEP_DISABLED() ((RCC->APB1HLPENR & (RCC_APB1HLPENR_SWPMILPEN)) == 0U)
  5081. #define __HAL_RCC_OPAMP_IS_CLK_SLEEP_DISABLED() ((RCC->APB1HLPENR & (RCC_APB1HLPENR_OPAMPLPEN)) == 0U)
  5082. #define __HAL_RCC_MDIOS_IS_CLK_SLEEP_DISABLED() ((RCC->APB1HLPENR & (RCC_APB1HLPENR_MDIOSLPEN)) == 0U)
  5083. #define __HAL_RCC_FDCAN_IS_CLK_SLEEP_DISABLED() ((RCC->APB1HLPENR & (RCC_APB1HLPENR_FDCANLPEN)) == 0U)
  5084. /** @brief ENABLE or disable the APB2 peripheral clock during Low Power (Sleep) mode.
  5085. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5086. * power consumption.
  5087. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  5088. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  5089. */
  5090. #define __HAL_RCC_TIM1_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_TIM1LPEN)
  5091. #define __HAL_RCC_TIM8_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_TIM8LPEN)
  5092. #define __HAL_RCC_USART1_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_USART1LPEN)
  5093. #define __HAL_RCC_USART6_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_USART6LPEN)
  5094. #if defined(UART9)
  5095. #define __HAL_RCC_UART9_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_UART9LPEN)
  5096. #endif /*UART9*/
  5097. #if defined(USART10)
  5098. #define __HAL_RCC_USART10_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_USART10LPEN)
  5099. #endif /*USART10*/
  5100. #define __HAL_RCC_SPI1_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_SPI1LPEN)
  5101. #define __HAL_RCC_SPI4_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_SPI4LPEN)
  5102. #define __HAL_RCC_TIM15_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_TIM15LPEN)
  5103. #define __HAL_RCC_TIM16_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_TIM16LPEN)
  5104. #define __HAL_RCC_TIM17_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_TIM17LPEN)
  5105. #define __HAL_RCC_SPI5_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_SPI5LPEN)
  5106. #define __HAL_RCC_SAI1_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_SAI1LPEN)
  5107. #define __HAL_RCC_SAI2_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_SAI2LPEN)
  5108. #if defined(SAI3)
  5109. #define __HAL_RCC_SAI3_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_SAI3LPEN)
  5110. #endif /*SAI3*/
  5111. #define __HAL_RCC_DFSDM1_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_DFSDM1LPEN)
  5112. #if defined(HRTIM1)
  5113. #define __HAL_RCC_HRTIM1_CLK_SLEEP_ENABLE() (RCC->APB2LPENR) |= (RCC_APB2LPENR_HRTIMLPEN)
  5114. #endif /*HRTIM1*/
  5115. #define __HAL_RCC_TIM1_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_TIM1LPEN)
  5116. #define __HAL_RCC_TIM8_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_TIM8LPEN)
  5117. #define __HAL_RCC_USART1_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_USART1LPEN)
  5118. #define __HAL_RCC_USART6_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_USART6LPEN)
  5119. #if defined(UART9)
  5120. #define __HAL_RCC_UART9_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_UART9LPEN)
  5121. #endif /*UART9*/
  5122. #if defined(USART10)
  5123. #define __HAL_RCC_USART10_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_USART10LPEN)
  5124. #endif /*USART10*/
  5125. #define __HAL_RCC_SPI1_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_SPI1LPEN)
  5126. #define __HAL_RCC_SPI4_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_SPI4LPEN)
  5127. #define __HAL_RCC_TIM15_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_TIM15LPEN)
  5128. #define __HAL_RCC_TIM16_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_TIM16LPEN)
  5129. #define __HAL_RCC_TIM17_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_TIM17LPEN)
  5130. #define __HAL_RCC_SPI5_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_SPI5LPEN)
  5131. #define __HAL_RCC_SAI1_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_SAI1LPEN)
  5132. #define __HAL_RCC_SAI2_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_SAI2LPEN)
  5133. #if defined(SAI3)
  5134. #define __HAL_RCC_SAI3_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_SAI3LPEN)
  5135. #endif /*SAI3*/
  5136. #define __HAL_RCC_DFSDM1_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_DFSDM1LPEN)
  5137. #if defined(HRTIM1)
  5138. #define __HAL_RCC_HRTIM1_CLK_SLEEP_DISABLE() (RCC->APB2LPENR) &= ~ (RCC_APB2LPENR_HRTIMLPEN)
  5139. #endif /*HRTIM1*/
  5140. /** @brief Get the enable or disable status of the APB2 peripheral clock during Low Poser (Sleep) mode.
  5141. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5142. * power consumption.
  5143. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
  5144. * @note By default, all peripheral clocks are enabled during SLEEP mode.
  5145. */
  5146. #define __HAL_RCC_TIM1_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_TIM1LPEN)) != 0U)
  5147. #define __HAL_RCC_TIM8_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_TIM8LPEN)) != 0U)
  5148. #define __HAL_RCC_USART1_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_USART1LPEN)) != 0U)
  5149. #define __HAL_RCC_USART6_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_USART6LPEN)) != 0U)
  5150. #if defined(UART9)
  5151. #define __HAL_RCC_UART9_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_UART9LPEN)) != 0U)
  5152. #endif /*UART9*/
  5153. #if defined(USART10)
  5154. #define __HAL_RCC_USART10_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_USART10LPEN)) != 0U)
  5155. #endif /*USART10*/
  5156. #define __HAL_RCC_SPI1_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_SPI1LPEN)) != 0U)
  5157. #define __HAL_RCC_SPI4_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_SPI4LPEN)) != 0U)
  5158. #define __HAL_RCC_TIM15_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_TIM15LPEN)) != 0U)
  5159. #define __HAL_RCC_TIM16_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_TIM16LPEN)) != 0U)
  5160. #define __HAL_RCC_TIM17_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_TIM17LPEN)) != 0U)
  5161. #define __HAL_RCC_SPI5_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_SPI5LPEN)) != 0U)
  5162. #define __HAL_RCC_SAI1_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_SAI1LPEN)) != 0U)
  5163. #define __HAL_RCC_SAI2_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_SAI2LPEN)) != 0U)
  5164. #if defined(SAI3)
  5165. #define __HAL_RCC_SAI3_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_SAI3LPEN)) != 0U)
  5166. #endif /*SAI3*/
  5167. #define __HAL_RCC_DFSDM1_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_DFSDM1LPEN)) != 0U)
  5168. #if defined(HRTIM1)
  5169. #define __HAL_RCC_HRTIM1_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_HRTIMLPEN)) != 0U)
  5170. #endif /*HRTIM1*/
  5171. #define __HAL_RCC_TIM1_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_TIM1LPEN)) == 0U)
  5172. #define __HAL_RCC_TIM8_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_TIM8LPEN)) == 0U)
  5173. #define __HAL_RCC_USART1_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_USART1LPEN)) == 0U)
  5174. #define __HAL_RCC_USART6_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_USART6LPEN)) == 0U)
  5175. #if defined(UART9)
  5176. #define __HAL_RCC_USART9_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_USART9LPEN)) == 0U)
  5177. #endif /*UART9*/
  5178. #if defined(USART10)
  5179. #define __HAL_RCC_USART10_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_USART10LPEN)) == 0U)
  5180. #endif /*USART10*/
  5181. #define __HAL_RCC_SPI1_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_SPI1LPEN)) == 0U)
  5182. #define __HAL_RCC_SPI4_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_SPI4LPEN)) == 0U)
  5183. #define __HAL_RCC_TIM15_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_TIM15LPEN)) == 0U)
  5184. #define __HAL_RCC_TIM16_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_TIM16LPEN)) == 0U)
  5185. #define __HAL_RCC_TIM17_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_TIM17LPEN)) == 0U)
  5186. #define __HAL_RCC_SPI5_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_SPI5LPEN)) == 0U)
  5187. #define __HAL_RCC_SAI1_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_SAI1LPEN)) == 0U)
  5188. #define __HAL_RCC_SAI2_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_SAI2LPEN)) == 0U)
  5189. #if defined(SAI3)
  5190. #define __HAL_RCC_SAI3_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_SAI3LPEN)) == 0U)
  5191. #endif /*SAI3*/
  5192. #define __HAL_RCC_DFSDM1_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_DFSDM1LPEN)) == 0U)
  5193. #if defined(HRTIM1)
  5194. #define __HAL_RCC_HRTIM1_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_HRTIMLPEN)) == 0U)
  5195. #endif /*HRTIM1*/
  5196. /** @brief ENABLE or disable the APB4 peripheral clock during Low Power (Sleep) mode.
  5197. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5198. * power consumption.
  5199. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  5200. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  5201. */
  5202. #define __HAL_RCC_SYSCFG_CLK_SLEEP_ENABLE() (RCC->APB4LPENR) |= (RCC_APB4LPENR_SYSCFGLPEN)
  5203. #define __HAL_RCC_LPUART1_CLK_SLEEP_ENABLE() (RCC->APB4LPENR) |= (RCC_APB4LPENR_LPUART1LPEN)
  5204. #define __HAL_RCC_SPI6_CLK_SLEEP_ENABLE() (RCC->APB4LPENR) |= (RCC_APB4LPENR_SPI6LPEN)
  5205. #define __HAL_RCC_I2C4_CLK_SLEEP_ENABLE() (RCC->APB4LPENR) |= (RCC_APB4LPENR_I2C4LPEN)
  5206. #define __HAL_RCC_LPTIM2_CLK_SLEEP_ENABLE() (RCC->APB4LPENR) |= (RCC_APB4LPENR_LPTIM2LPEN)
  5207. #define __HAL_RCC_LPTIM3_CLK_SLEEP_ENABLE() (RCC->APB4LPENR) |= (RCC_APB4LPENR_LPTIM3LPEN)
  5208. #if defined(LPTIM4)
  5209. #define __HAL_RCC_LPTIM4_CLK_SLEEP_ENABLE() (RCC->APB4LPENR) |= (RCC_APB4LPENR_LPTIM4LPEN)
  5210. #endif /*LPTIM4*/
  5211. #if defined(LPTIM5)
  5212. #define __HAL_RCC_LPTIM5_CLK_SLEEP_ENABLE() (RCC->APB4LPENR) |= (RCC_APB4LPENR_LPTIM5LPEN)
  5213. #endif /*LPTIM5*/
  5214. #if defined(DAC2)
  5215. #define __HAL_RCC_DAC2_CLK_SLEEP_ENABLE() (RCC->APB4LPENR) |= (RCC_APB4LPENR_DAC2LPEN)
  5216. #endif /*DAC2*/
  5217. #define __HAL_RCC_COMP12_CLK_SLEEP_ENABLE() (RCC->APB4LPENR) |= (RCC_APB4LPENR_COMP12LPEN)
  5218. #define __HAL_RCC_VREF_CLK_SLEEP_ENABLE() (RCC->APB4LPENR) |= (RCC_APB4LPENR_VREFLPEN)
  5219. #define __HAL_RCC_RTC_CLK_SLEEP_ENABLE() (RCC->APB4LPENR) |= (RCC_APB4LPENR_RTCAPBLPEN)
  5220. #if defined(SAI4)
  5221. #define __HAL_RCC_SAI4_CLK_SLEEP_ENABLE() (RCC->APB4LPENR) |= (RCC_APB4LPENR_SAI4LPEN)
  5222. #endif /*SAI4*/
  5223. #if defined(DTS)
  5224. #define __HAL_RCC_DTS_CLK_SLEEP_ENABLE() (RCC->APB4LPENR) |= (RCC_APB4LPENR_DTSLPEN)
  5225. #endif /*DTS*/
  5226. #if defined(DFSDM2_BASE)
  5227. #define __HAL_RCC_DFSDM2_CLK_SLEEP_ENABLE() (RCC->APB4LPENR) |= (RCC_APB4LPENR_DFSDM2LPEN)
  5228. #endif /*DFSDM2*/
  5229. #define __HAL_RCC_SYSCFG_CLK_SLEEP_DISABLE() (RCC->APB4LPENR) &= ~ (RCC_APB4LPENR_SYSCFGLPEN)
  5230. #define __HAL_RCC_LPUART1_CLK_SLEEP_DISABLE() (RCC->APB4LPENR) &= ~ (RCC_APB4LPENR_LPUART1LPEN)
  5231. #define __HAL_RCC_SPI6_CLK_SLEEP_DISABLE() (RCC->APB4LPENR) &= ~ (RCC_APB4LPENR_SPI6LPEN)
  5232. #define __HAL_RCC_I2C4_CLK_SLEEP_DISABLE() (RCC->APB4LPENR) &= ~ (RCC_APB4LPENR_I2C4LPEN)
  5233. #define __HAL_RCC_LPTIM2_CLK_SLEEP_DISABLE() (RCC->APB4LPENR) &= ~ (RCC_APB4LPENR_LPTIM2LPEN)
  5234. #define __HAL_RCC_LPTIM3_CLK_SLEEP_DISABLE() (RCC->APB4LPENR) &= ~ (RCC_APB4LPENR_LPTIM3LPEN)
  5235. #if defined(LPTIM4)
  5236. #define __HAL_RCC_LPTIM4_CLK_SLEEP_DISABLE() (RCC->APB4LPENR) &= ~ (RCC_APB4LPENR_LPTIM4LPEN)
  5237. #endif /*LPTIM4*/
  5238. #if defined(LPTIM5)
  5239. #define __HAL_RCC_LPTIM5_CLK_SLEEP_DISABLE() (RCC->APB4LPENR) &= ~ (RCC_APB4LPENR_LPTIM5LPEN)
  5240. #endif /*LPTIM5*/
  5241. #if defined(DAC2)
  5242. #define __HAL_RCC_DAC2_CLK_SLEEP_DISABLE() (RCC->APB4LPENR) &= ~ (RCC_APB4LPENR_DAC2LPEN)
  5243. #endif /*DAC2*/
  5244. #define __HAL_RCC_COMP12_CLK_SLEEP_DISABLE() (RCC->APB4LPENR) &= ~ (RCC_APB4LPENR_COMP12LPEN)
  5245. #define __HAL_RCC_VREF_CLK_SLEEP_DISABLE() (RCC->APB4LPENR) &= ~ (RCC_APB4LPENR_VREFLPEN)
  5246. #define __HAL_RCC_RTC_CLK_SLEEP_DISABLE() (RCC->APB4LPENR) &= ~ (RCC_APB4LPENR_RTCAPBLPEN)
  5247. #if defined(SAI4)
  5248. #define __HAL_RCC_SAI4_CLK_SLEEP_DISABLE() (RCC->APB4LPENR) &= ~ (RCC_APB4LPENR_SAI4LPEN)
  5249. #endif /*SAI4*/
  5250. #if defined(DTS)
  5251. #define __HAL_RCC_DTS_CLK_SLEEP_DISABLE() (RCC->APB4LPENR) &= ~ (RCC_APB4LPENR_DTSLPEN)
  5252. #endif /*DTS*/
  5253. #if defined(DFSDM2_BASE)
  5254. #define __HAL_RCC_DFSDM2_CLK_SLEEP_DISABLE() (RCC->APB4LPENR) &= ~ (RCC_APB4LPENR_DFSDM2LPEN)
  5255. #endif /*DFSDM2*/
  5256. /** @brief Get the enable or disable status of the APB4 peripheral clock during Low Poser (Sleep) mode.
  5257. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5258. * power consumption.
  5259. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
  5260. * @note By default, all peripheral clocks are enabled during SLEEP mode.
  5261. */
  5262. #define __HAL_RCC_SYSCFG_IS_CLK_SLEEP_ENABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_SYSCFGLPEN)) != 0U)
  5263. #define __HAL_RCC_LPUART1_IS_CLK_SLEEP_ENABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_LPUART1LPEN)) != 0U)
  5264. #define __HAL_RCC_SPI6_IS_CLK_SLEEP_ENABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_SPI6LPEN)) != 0U)
  5265. #define __HAL_RCC_I2C4_IS_CLK_SLEEP_ENABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_I2C4LPEN)) != 0U)
  5266. #define __HAL_RCC_LPTIM2_IS_CLK_SLEEP_ENABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_LPTIM2LPEN)) != 0U)
  5267. #define __HAL_RCC_LPTIM3_IS_CLK_SLEEP_ENABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_LPTIM3LPEN)) != 0U)
  5268. #if defined(LPTIM4)
  5269. #define __HAL_RCC_LPTIM4_IS_CLK_SLEEP_ENABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_LPTIM4LPEN)) != 0U)
  5270. #endif /*LPTIM4*/
  5271. #if defined(LPTIM5)
  5272. #define __HAL_RCC_LPTIM5_IS_CLK_SLEEP_ENABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_LPTIM5LPEN)) != 0U)
  5273. #endif /*LPTIM5*/
  5274. #if defined(DAC2)
  5275. #define __HAL_RCC_DAC2_IS_CLK_SLEEP_ENABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_DAC2LPEN)) != 0U)
  5276. #endif /*DAC2*/
  5277. #define __HAL_RCC_COMP12_IS_CLK_SLEEP_ENABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_COMP12LPEN)) != 0U)
  5278. #define __HAL_RCC_VREF_IS_CLK_SLEEP_ENABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_VREFLPEN)) != 0U)
  5279. #define __HAL_RCC_RTC_IS_CLK_SLEEP_ENABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_RTCAPBLPEN)) != 0U)
  5280. #if defined(SAI4)
  5281. #define __HAL_RCC_SAI4_IS_CLK_SLEEP_ENABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_SAI4LPEN)) != 0U)
  5282. #endif /*SAI4*/
  5283. #if defined(DTS)
  5284. #define __HAL_RCC_DTS_IS_CLK_SLEEP_ENABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_DTSLPEN)) != 0U)
  5285. #endif /*DTS*/
  5286. #if defined(DFSDM2_BASE)
  5287. #define __HAL_RCC_DFSDM2_IS_CLK_SLEEP_ENABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_DFSDM2LPEN)) != 0U)
  5288. #endif /*DFSDM2*/
  5289. #define __HAL_RCC_SYSCFG_IS_CLK_SLEEP_DISABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_SYSCFGLPEN)) == 0U)
  5290. #define __HAL_RCC_LPUART1_IS_CLK_SLEEP_DISABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_LPUART1LPEN)) == 0U)
  5291. #define __HAL_RCC_SPI6_IS_CLK_SLEEP_DISABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_SPI6LPEN)) == 0U)
  5292. #define __HAL_RCC_I2C4_IS_CLK_SLEEP_DISABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_I2C4LPEN)) == 0U)
  5293. #define __HAL_RCC_LPTIM2_IS_CLK_SLEEP_DISABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_LPTIM2LPEN)) == 0U)
  5294. #define __HAL_RCC_LPTIM3_IS_CLK_SLEEP_DISABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_LPTIM3LPEN)) == 0U)
  5295. #if defined(LPTIM4)
  5296. #define __HAL_RCC_LPTIM4_IS_CLK_SLEEP_DISABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_LPTIM4LPEN)) == 0U)
  5297. #endif /*LPTIM4*/
  5298. #if defined(LPTIM5)
  5299. #define __HAL_RCC_LPTIM5_IS_CLK_SLEEP_DISABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_LPTIM5LPEN)) == 0U)
  5300. #endif /*LPTIM5*/
  5301. #if defined(DAC2)
  5302. #define __HAL_RCC_DAC2_IS_CLK_SLEEP_DISABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_DAC2LPEN)) == 0U)
  5303. #endif /*DAC2*/
  5304. #define __HAL_RCC_COMP12_IS_CLK_SLEEP_DISABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_COMP12LPEN)) == 0U)
  5305. #define __HAL_RCC_VREF_IS_CLK_SLEEP_DISABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_VREFLPEN)) == 0U)
  5306. #define __HAL_RCC_RTC_IS_CLK_SLEEP_DISABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_RTCAPBLPEN)) == 0U)
  5307. #if defined(SAI4)
  5308. #define __HAL_RCC_SAI4_IS_CLK_SLEEP_DISABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_SAI4LPEN)) == 0U)
  5309. #endif /*SAI4*/
  5310. #if defined(DTS)
  5311. #define __HAL_RCC_DTS_IS_CLK_SLEEP_DISABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_DTSLPEN)) == 0U)
  5312. #endif /*DTS*/
  5313. #if defined(DFSDM2_BASE)
  5314. #define __HAL_RCC_DFSDM2_IS_CLK_SLEEP_DISABLED() ((RCC->APB4LPENR & (RCC_APB4LPENR_DFSDM2LPEN)) == 0U)
  5315. #endif /*DFSDM2*/
  5316. #if defined(DUAL_CORE)
  5317. /** @brief Enable or disable the RCC_C1 AHB3 peripheral clock during Low Power (Sleep) mode.
  5318. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5319. * power consumption.
  5320. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
  5321. * @note By default, all peripheral clocks are enabled during SLEEP mode.
  5322. */
  5323. #define __HAL_RCC_C1_MDMA_CLK_SLEEP_ENABLE() (RCC_C1->AHB3LPENR |= (RCC_AHB3LPENR_MDMALPEN))
  5324. #define __HAL_RCC_C1_DMA2D_CLK_SLEEP_ENABLE() (RCC_C1->AHB3LPENR |= (RCC_AHB3LPENR_DMA2DLPEN))
  5325. #define __HAL_RCC_C1_JPGDEC_CLK_SLEEP_ENABLE() (RCC_C1->AHB3LPENR |= (RCC_AHB3LPENR_JPGDECLPEN))
  5326. #define __HAL_RCC_C1_FLASH_CLK_SLEEP_ENABLE() (RCC_C1->AHB3LPENR |= (RCC_AHB3LPENR_FLASHLPEN))
  5327. #define __HAL_RCC_C1_FMC_CLK_SLEEP_ENABLE() (RCC_C1->AHB3LPENR |= (RCC_AHB3LPENR_FMCLPEN))
  5328. #define __HAL_RCC_C1_QSPI_CLK_SLEEP_ENABLE() (RCC_C1->AHB3LPENR |= (RCC_AHB3LPENR_QSPILPEN))
  5329. #define __HAL_RCC_C1_SDMMC1_CLK_SLEEP_ENABLE() (RCC_C1->AHB3LPENR |= (RCC_AHB3LPENR_SDMMC1LPEN))
  5330. #define __HAL_RCC_C1_DTCM1_CLK_SLEEP_ENABLE() (RCC_C1->AHB3LPENR |= (RCC_AHB3LPENR_DTCM1LPEN))
  5331. #define __HAL_RCC_C1_DTCM2_CLK_SLEEP_ENABLE() (RCC_C1->AHB3LPENR |= (RCC_AHB3LPENR_DTCM2LPEN))
  5332. #define __HAL_RCC_C1_ITCM_CLK_SLEEP_ENABLE() (RCC_C1->AHB3LPENR |= (RCC_AHB3LPENR_ITCMLPEN))
  5333. #define __HAL_RCC_C1_D1SRAM1_CLK_SLEEP_ENABLE() (RCC_C1->AHB3LPENR |= (RCC_AHB3LPENR_AXISRAMLPEN))
  5334. #define __HAL_RCC_C1_MDMA_CLK_SLEEP_DISABLE() (RCC_C1->AHB3LPENR &= ~ (RCC_AHB3LPENR_MDMALPEN))
  5335. #define __HAL_RCC_C1_DMA2D_CLK_SLEEP_DISABLE() (RCC_C1->AHB3LPENR &= ~ (RCC_AHB3LPENR_DMA2DLPEN))
  5336. #define __HAL_RCC_C1_JPGDEC_CLK_SLEEP_DISABLE() (RCC_C1->AHB3LPENR &= ~ (RCC_AHB3LPENR_JPGDECLPEN))
  5337. #define __HAL_RCC_C1_FLASH_CLK_SLEEP_DISABLE() (RCC_C1->AHB3LPENR &= ~ (RCC_AHB3LPENR_FLASHLPEN))
  5338. #define __HAL_RCC_C1_FMC_CLK_SLEEP_DISABLE() (RCC_C1->AHB3LPENR &= ~ (RCC_AHB3LPENR_FMCLPEN))
  5339. #define __HAL_RCC_C1_QSPI_CLK_SLEEP_DISABLE() (RCC_C1->AHB3LPENR &= ~ (RCC_AHB3LPENR_QSPILPEN))
  5340. #define __HAL_RCC_C1_SDMMC1_CLK_SLEEP_DISABLE() (RCC_C1->AHB3LPENR &= ~ (RCC_AHB3LPENR_SDMMC1LPEN))
  5341. #define __HAL_RCC_C1_DTCM1_CLK_SLEEP_DISABLE() (RCC_C1->AHB3LPENR &= ~ (RCC_AHB3LPENR_DTCM1LPEN))
  5342. #define __HAL_RCC_C1_DTCM2_CLK_SLEEP_DISABLE() (RCC_C1->AHB3LPENR &= ~ (RCC_AHB3LPENR_DTCM2LPEN))
  5343. #define __HAL_RCC_C1_ITCM_CLK_SLEEP_DISABLE() (RCC_C1->AHB3LPENR &= ~ (RCC_AHB3LPENR_ITCMLPEN))
  5344. #define __HAL_RCC_C1_D1SRAM1_CLK_SLEEP_DISABLE() (RCC_C1->AHB3LPENR &= ~ (RCC_AHB3LPENR_AXISRAMLPEN))
  5345. /** @brief ENABLE or disable the AHB1 peripheral clock during Low Power (Sleep) mode.
  5346. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5347. * power consumption.
  5348. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  5349. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  5350. */
  5351. #define __HAL_RCC_C1_DMA1_CLK_SLEEP_ENABLE() (RCC_C1->AHB1LPENR |= (RCC_AHB1LPENR_DMA1LPEN))
  5352. #define __HAL_RCC_C1_DMA2_CLK_SLEEP_ENABLE() (RCC_C1->AHB1LPENR |= (RCC_AHB1LPENR_DMA2LPEN))
  5353. #define __HAL_RCC_C1_ADC12_CLK_SLEEP_ENABLE() (RCC_C1->AHB1LPENR |= (RCC_AHB1LPENR_ADC12LPEN))
  5354. #define __HAL_RCC_C1_ETH1MAC_CLK_SLEEP_ENABLE() (RCC_C1->AHB1LPENR |= (RCC_AHB1LPENR_ETH1MACLPEN))
  5355. #define __HAL_RCC_C1_ETH1TX_CLK_SLEEP_ENABLE() (RCC_C1->AHB1LPENR |= (RCC_AHB1LPENR_ETH1TXLPEN))
  5356. #define __HAL_RCC_C1_ETH1RX_CLK_SLEEP_ENABLE() (RCC_C1->AHB1LPENR |= (RCC_AHB1LPENR_ETH1RXLPEN))
  5357. #define __HAL_RCC_C1_USB1_OTG_HS_CLK_SLEEP_ENABLE() (RCC_C1->AHB1LPENR |= (RCC_AHB1LPENR_USB1OTGHSLPEN))
  5358. #define __HAL_RCC_C1_USB1_OTG_HS_ULPI_CLK_SLEEP_ENABLE() (RCC_C1->AHB1LPENR |= (RCC_AHB1LPENR_USB1OTGHSULPILPEN))
  5359. #define __HAL_RCC_C1_USB2_OTG_FS_CLK_SLEEP_ENABLE() (RCC_C1->AHB1LPENR |= (RCC_AHB1LPENR_USB2OTGHSLPEN))
  5360. #define __HAL_RCC_C1_USB2_OTG_FS_ULPI_CLK_SLEEP_ENABLE() (RCC_C1->AHB1LPENR |= (RCC_AHB1LPENR_USB2OTGHSULPILPEN))
  5361. #define __HAL_RCC_C1_DMA1_CLK_SLEEP_DISABLE() (RCC_C1->AHB1LPENR &= ~ (RCC_AHB1LPENR_DMA1LPEN))
  5362. #define __HAL_RCC_C1_DMA2_CLK_SLEEP_DISABLE() (RCC_C1->AHB1LPENR &= ~ (RCC_AHB1LPENR_DMA2LPEN))
  5363. #define __HAL_RCC_C1_ADC12_CLK_SLEEP_DISABLE() (RCC_C1->AHB1LPENR &= ~ (RCC_AHB1LPENR_ADC12LPEN))
  5364. #define __HAL_RCC_C1_ETH1MAC_CLK_SLEEP_DISABLE() (RCC_C1->AHB1LPENR &= ~ (RCC_AHB1LPENR_ETH1MACLPEN))
  5365. #define __HAL_RCC_C1_ETH1TX_CLK_SLEEP_DISABLE() (RCC_C1->AHB1LPENR &= ~ (RCC_AHB1LPENR_ETH1TXLPEN))
  5366. #define __HAL_RCC_C1_ETH1RX_CLK_SLEEP_DISABLE() (RCC_C1->AHB1LPENR &= ~ (RCC_AHB1LPENR_ETH1RXLPEN))
  5367. #define __HAL_RCC_C1_USB1_OTG_HS_CLK_SLEEP_DISABLE() (RCC_C1->AHB1LPENR &= ~ (RCC_AHB1LPENR_USB1OTGHSLPEN))
  5368. #define __HAL_RCC_C1_USB1_OTG_HS_ULPI_CLK_SLEEP_DISABLE() (RCC_C1->AHB1LPENR &= ~ (RCC_AHB1LPENR_USB1OTGHSULPILPEN))
  5369. #define __HAL_RCC_C1_USB2_OTG_FS_CLK_SLEEP_DISABLE() (RCC_C1->AHB1LPENR &= ~ (RCC_AHB1LPENR_USB2OTGHSLPEN))
  5370. #define __HAL_RCC_C1_USB2_OTG_FS_ULPI_CLK_SLEEP_DISABLE() (RCC_C1->AHB1LPENR &= ~ (RCC_AHB1LPENR_USB2OTGHSULPILPEN))
  5371. /** @brief ENABLE or disable the AHB2 peripheral clock during Low Power (Sleep) mode.
  5372. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5373. * power consumption.
  5374. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  5375. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  5376. */
  5377. #define __HAL_RCC_C1_DCMI_CLK_SLEEP_ENABLE() (RCC_C1->AHB2LPENR |= (RCC_AHB2LPENR_DCMILPEN))
  5378. #define __HAL_RCC_C1_CRYP_CLK_SLEEP_ENABLE() (RCC_C1->AHB2LPENR |= (RCC_AHB2LPENR_CRYPLPEN))
  5379. #define __HAL_RCC_C1_HASH_CLK_SLEEP_ENABLE() (RCC_C1->AHB2LPENR |= (RCC_AHB2LPENR_HASHLPEN))
  5380. #define __HAL_RCC_C1_RNG_CLK_SLEEP_ENABLE() (RCC_C1->AHB2LPENR |= (RCC_AHB2LPENR_RNGLPEN))
  5381. #define __HAL_RCC_C1_SDMMC2_CLK_SLEEP_ENABLE() (RCC_C1->AHB2LPENR |= (RCC_AHB2LPENR_SDMMC2LPEN))
  5382. #define __HAL_RCC_C1_D2SRAM1_CLK_SLEEP_ENABLE() (RCC_C1->AHB2LPENR |= (RCC_AHB2LPENR_D2SRAM1LPEN))
  5383. #define __HAL_RCC_C1_D2SRAM2_CLK_SLEEP_ENABLE() (RCC_C1->AHB2LPENR |= (RCC_AHB2LPENR_D2SRAM2LPEN))
  5384. #define __HAL_RCC_C1_D2SRAM3_CLK_SLEEP_ENABLE() (RCC_C1->AHB2LPENR |= (RCC_AHB2LPENR_D2SRAM3LPEN))
  5385. #define __HAL_RCC_C1_DCMI_CLK_SLEEP_DISABLE() (RCC_C1->AHB2LPENR &= ~ (RCC_AHB2LPENR_DCMILPEN))
  5386. #define __HAL_RCC_C1_CRYP_CLK_SLEEP_DISABLE() (RCC_C1->AHB2LPENR &= ~ (RCC_AHB2LPENR_CRYPLPEN))
  5387. #define __HAL_RCC_C1_HASH_CLK_SLEEP_DISABLE() (RCC_C1->AHB2LPENR &= ~ (RCC_AHB2LPENR_HASHLPEN))
  5388. #define __HAL_RCC_C1_RNG_CLK_SLEEP_DISABLE() (RCC_C1->AHB2LPENR &= ~ (RCC_AHB2LPENR_RNGLPEN))
  5389. #define __HAL_RCC_C1_SDMMC2_CLK_SLEEP_DISABLE() (RCC_C1->AHB2LPENR &= ~ (RCC_AHB2LPENR_SDMMC2LPEN))
  5390. #define __HAL_RCC_C1_D2SRAM1_CLK_SLEEP_DISABLE() (RCC_C1->AHB2LPENR &= ~ (RCC_AHB2LPENR_D2SRAM1LPEN))
  5391. #define __HAL_RCC_C1_D2SRAM2_CLK_SLEEP_DISABLE() (RCC_C1->AHB2LPENR &= ~ (RCC_AHB2LPENR_D2SRAM2LPEN))
  5392. #define __HAL_RCC_C1_D2SRAM3_CLK_SLEEP_DISABLE() (RCC_C1->AHB2LPENR &= ~ (RCC_AHB2LPENR_D2SRAM3LPEN))
  5393. /** @brief ENABLE or disable the AHB4 peripheral clock during Low Power (Sleep) mode.
  5394. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5395. * power consumption.
  5396. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  5397. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  5398. */
  5399. #define __HAL_RCC_C1_GPIOA_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOALPEN)
  5400. #define __HAL_RCC_C1_GPIOB_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOBLPEN)
  5401. #define __HAL_RCC_C1_GPIOC_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOCLPEN)
  5402. #define __HAL_RCC_C1_GPIOD_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR) |= (RCC_AHB4LPENR_GPIODLPEN)
  5403. #define __HAL_RCC_C1_GPIOE_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOELPEN)
  5404. #define __HAL_RCC_C1_GPIOF_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOFLPEN)
  5405. #define __HAL_RCC_C1_GPIOG_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOGLPEN)
  5406. #define __HAL_RCC_C1_GPIOH_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOHLPEN)
  5407. #define __HAL_RCC_C1_GPIOI_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOILPEN)
  5408. #define __HAL_RCC_C1_GPIOJ_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOJLPEN)
  5409. #define __HAL_RCC_C1_GPIOK_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOKLPEN)
  5410. #define __HAL_RCC_C1_CRC_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR) |= (RCC_AHB4LPENR_CRCLPEN)
  5411. #define __HAL_RCC_C1_BDMA_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR) |= (RCC_AHB4LPENR_BDMALPEN)
  5412. #define __HAL_RCC_C1_ADC3_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR) |= (RCC_AHB4LPENR_ADC3LPEN)
  5413. #define __HAL_RCC_C1_BKPRAM_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR) |= (RCC_AHB4LPENR_BKPRAMLPEN)
  5414. #define __HAL_RCC_C1_D3SRAM1_CLK_SLEEP_ENABLE() (RCC_C1->AHB4LPENR |= (RCC_AHB4LPENR_D3SRAM1LPEN))
  5415. #define __HAL_RCC_C1_GPIOA_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOALPEN)
  5416. #define __HAL_RCC_C1_GPIOB_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOBLPEN)
  5417. #define __HAL_RCC_C1_GPIOC_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOCLPEN)
  5418. #define __HAL_RCC_C1_GPIOD_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIODLPEN)
  5419. #define __HAL_RCC_C1_GPIOE_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOELPEN)
  5420. #define __HAL_RCC_C1_GPIOF_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOFLPEN)
  5421. #define __HAL_RCC_C1_GPIOG_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOGLPEN)
  5422. #define __HAL_RCC_C1_GPIOH_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOHLPEN)
  5423. #define __HAL_RCC_C1_GPIOI_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOILPEN)
  5424. #define __HAL_RCC_C1_GPIOJ_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOJLPEN)
  5425. #define __HAL_RCC_C1_GPIOK_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOKLPEN)
  5426. #define __HAL_RCC_C1_CRC_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR) &= ~ (RCC_AHB4LPENR_CRCLPEN)
  5427. #define __HAL_RCC_C1_BDMA_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR) &= ~ (RCC_AHB4LPENR_BDMALPEN)
  5428. #define __HAL_RCC_C1_ADC3_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR) &= ~ (RCC_AHB4LPENR_ADC3LPEN)
  5429. #define __HAL_RCC_C1_BKPRAM_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR) &= ~ (RCC_AHB4LPENR_BKPRAMLPEN)
  5430. #define __HAL_RCC_C1_D3SRAM1_CLK_SLEEP_DISABLE() (RCC_C1->AHB4LPENR &= ~ (RCC_AHB4LPENR_D3SRAM1LPEN))
  5431. /** @brief ENABLE or disable the APB3 peripheral clock during Low Power (Sleep) mode.
  5432. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5433. * power consumption.
  5434. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  5435. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  5436. */
  5437. #define __HAL_RCC_C1_LTDC_CLK_SLEEP_ENABLE() (RCC_C1->APB3LPENR) |= (RCC_APB3LPENR_LTDCLPEN)
  5438. #define __HAL_RCC_C1_DSI_CLK_SLEEP_ENABLE() (RCC_C1->APB3LPENR) |= (RCC_APB3LPENR_DSILPEN)
  5439. #define __HAL_RCC_C1_WWDG1_CLK_SLEEP_ENABLE() (RCC_C1->APB3LPENR) |= (RCC_APB3LPENR_WWDG1LPEN)
  5440. #define __HAL_RCC_C1_LTDC_CLK_SLEEP_DISABLE() (RCC_C1->APB3LPENR) &= ~ (RCC_APB3LPENR_LTDCLPEN)
  5441. #define __HAL_RCC_C1_DSI_CLK_SLEEP_DISABLE() (RCC_C1->APB3LPENR) &= ~ (RCC_APB3LPENR_DSILPEN)
  5442. #define __HAL_RCC_C1_WWDG1_CLK_SLEEP_DISABLE() (RCC_C1->APB3LPENR) &= ~ (RCC_APB3LPENR_WWDG1LPEN)
  5443. /** @brief ENABLE or disable the APB1 peripheral clock during Low Power (Sleep) mode.
  5444. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5445. * power consumption.
  5446. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  5447. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  5448. */
  5449. #define __HAL_RCC_C1_TIM2_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_TIM2LPEN)
  5450. #define __HAL_RCC_C1_TIM3_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_TIM3LPEN)
  5451. #define __HAL_RCC_C1_TIM4_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_TIM4LPEN)
  5452. #define __HAL_RCC_C1_TIM5_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_TIM5LPEN)
  5453. #define __HAL_RCC_C1_TIM6_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_TIM6LPEN)
  5454. #define __HAL_RCC_C1_TIM7_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_TIM7LPEN)
  5455. #define __HAL_RCC_C1_TIM12_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_TIM12LPEN)
  5456. #define __HAL_RCC_C1_TIM13_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_TIM13LPEN)
  5457. #define __HAL_RCC_C1_TIM14_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_TIM14LPEN)
  5458. #define __HAL_RCC_C1_LPTIM1_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_LPTIM1LPEN)
  5459. #define __HAL_RCC_C1_WWDG2_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_WWDG2LPEN)
  5460. #define __HAL_RCC_C1_SPI2_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_SPI2LPEN)
  5461. #define __HAL_RCC_C1_SPI3_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_SPI3LPEN)
  5462. #define __HAL_RCC_C1_SPDIFRX_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_SPDIFRXLPEN)
  5463. #define __HAL_RCC_C1_USART2_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_USART2LPEN)
  5464. #define __HAL_RCC_C1_USART3_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_USART3LPEN)
  5465. #define __HAL_RCC_C1_UART4_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_UART4LPEN)
  5466. #define __HAL_RCC_C1_UART5_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_UART5LPEN)
  5467. #define __HAL_RCC_C1_I2C1_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_I2C1LPEN)
  5468. #define __HAL_RCC_C1_I2C2_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_I2C2LPEN)
  5469. #define __HAL_RCC_C1_I2C3_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_I2C3LPEN)
  5470. #define __HAL_RCC_C1_CEC_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_CECLPEN)
  5471. #define __HAL_RCC_C1_DAC12_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_DAC12LPEN)
  5472. #define __HAL_RCC_C1_UART7_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_UART7LPEN)
  5473. #define __HAL_RCC_C1_UART8_CLK_SLEEP_ENABLE() (RCC_C1->APB1LLPENR) |= (RCC_APB1LLPENR_UART8LPEN)
  5474. #define __HAL_RCC_C1_CRS_CLK_SLEEP_ENABLE() (RCC_C1->APB1HLPENR) |= (RCC_APB1HLPENR_CRSLPEN)
  5475. #define __HAL_RCC_C1_SWPMI_CLK_SLEEP_ENABLE() (RCC_C1->APB1HLPENR) |= (RCC_APB1HLPENR_SWPMILPEN)
  5476. #define __HAL_RCC_C1_OPAMP_CLK_SLEEP_ENABLE() (RCC_C1->APB1HLPENR) |= (RCC_APB1HLPENR_OPAMPLPEN)
  5477. #define __HAL_RCC_C1_MDIOS_CLK_SLEEP_ENABLE() (RCC_C1->APB1HLPENR) |= (RCC_APB1HLPENR_MDIOSLPEN)
  5478. #define __HAL_RCC_C1_FDCAN_CLK_SLEEP_ENABLE() (RCC_C1->APB1HLPENR) |= (RCC_APB1HLPENR_FDCANLPEN)
  5479. #define __HAL_RCC_C1_TIM2_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM2LPEN)
  5480. #define __HAL_RCC_C1_TIM3_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM3LPEN)
  5481. #define __HAL_RCC_C1_TIM4_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM4LPEN)
  5482. #define __HAL_RCC_C1_TIM5_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM5LPEN)
  5483. #define __HAL_RCC_C1_TIM6_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM6LPEN)
  5484. #define __HAL_RCC_C1_TIM7_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM7LPEN)
  5485. #define __HAL_RCC_C1_TIM12_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM12LPEN)
  5486. #define __HAL_RCC_C1_TIM13_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM13LPEN)
  5487. #define __HAL_RCC_C1_TIM14_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM14LPEN)
  5488. #define __HAL_RCC_C1_LPTIM1_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_LPTIM1LPEN)
  5489. #define __HAL_RCC_C1_WWDG2_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_WWDG2LPEN)
  5490. #define __HAL_RCC_C1_SPI2_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_SPI2LPEN)
  5491. #define __HAL_RCC_C1_SPI3_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_SPI3LPEN)
  5492. #define __HAL_RCC_C1_SPDIFRX_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_SPDIFRXLPEN)
  5493. #define __HAL_RCC_C1_USART2_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_USART2LPEN)
  5494. #define __HAL_RCC_C1_USART3_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_USART3LPEN)
  5495. #define __HAL_RCC_C1_UART4_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_UART4LPEN)
  5496. #define __HAL_RCC_C1_UART5_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_UART5LPEN)
  5497. #define __HAL_RCC_C1_I2C1_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_I2C1LPEN)
  5498. #define __HAL_RCC_C1_I2C2_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_I2C2LPEN)
  5499. #define __HAL_RCC_C1_I2C3_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_I2C3LPEN)
  5500. #define __HAL_RCC_C1_CEC_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_CECLPEN)
  5501. #define __HAL_RCC_C1_DAC12_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_DAC12LPEN)
  5502. #define __HAL_RCC_C1_UART7_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_UART7LPEN)
  5503. #define __HAL_RCC_C1_UART8_CLK_SLEEP_DISABLE() (RCC_C1->APB1LLPENR) &= ~ (RCC_APB1LLPENR_UART8LPEN)
  5504. #define __HAL_RCC_C1_CRS_CLK_SLEEP_DISABLE() (RCC_C1->APB1HLPENR) &= ~ (RCC_APB1HLPENR_CRSLPEN)
  5505. #define __HAL_RCC_C1_SWPMI_CLK_SLEEP_DISABLE() (RCC_C1->APB1HLPENR) &= ~ (RCC_APB1HLPENR_SWPMILPEN)
  5506. #define __HAL_RCC_C1_OPAMP_CLK_SLEEP_DISABLE() (RCC_C1->APB1HLPENR) &= ~ (RCC_APB1HLPENR_OPAMPLPEN)
  5507. #define __HAL_RCC_C1_MDIOS_CLK_SLEEP_DISABLE() (RCC_C1->APB1HLPENR) &= ~ (RCC_APB1HLPENR_MDIOSLPEN)
  5508. #define __HAL_RCC_C1_FDCAN_CLK_SLEEP_DISABLE() (RCC_C1->APB1HLPENR) &= ~ (RCC_APB1HLPENR_FDCANLPEN)
  5509. /** @brief ENABLE or disable the APB2 peripheral clock during Low Power (Sleep) mode.
  5510. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5511. * power consumption.
  5512. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  5513. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  5514. */
  5515. #define __HAL_RCC_C1_TIM1_CLK_SLEEP_ENABLE() (RCC_C1->APB2LPENR) |= (RCC_APB2LPENR_TIM1LPEN)
  5516. #define __HAL_RCC_C1_TIM8_CLK_SLEEP_ENABLE() (RCC_C1->APB2LPENR) |= (RCC_APB2LPENR_TIM8LPEN)
  5517. #define __HAL_RCC_C1_USART1_CLK_SLEEP_ENABLE() (RCC_C1->APB2LPENR) |= (RCC_APB2LPENR_USART1LPEN)
  5518. #define __HAL_RCC_C1_USART6_CLK_SLEEP_ENABLE() (RCC_C1->APB2LPENR) |= (RCC_APB2LPENR_USART6LPEN)
  5519. #define __HAL_RCC_C1_SPI1_CLK_SLEEP_ENABLE() (RCC_C1->APB2LPENR) |= (RCC_APB2LPENR_SPI1LPEN)
  5520. #define __HAL_RCC_C1_SPI4_CLK_SLEEP_ENABLE() (RCC_C1->APB2LPENR) |= (RCC_APB2LPENR_SPI4LPEN)
  5521. #define __HAL_RCC_C1_TIM15_CLK_SLEEP_ENABLE() (RCC_C1->APB2LPENR) |= (RCC_APB2LPENR_TIM15LPEN)
  5522. #define __HAL_RCC_C1_TIM16_CLK_SLEEP_ENABLE() (RCC_C1->APB2LPENR) |= (RCC_APB2LPENR_TIM16LPEN)
  5523. #define __HAL_RCC_C1_TIM17_CLK_SLEEP_ENABLE() (RCC_C1->APB2LPENR) |= (RCC_APB2LPENR_TIM17LPEN)
  5524. #define __HAL_RCC_C1_SPI5_CLK_SLEEP_ENABLE() (RCC_C1->APB2LPENR) |= (RCC_APB2LPENR_SPI5LPEN)
  5525. #define __HAL_RCC_C1_SAI1_CLK_SLEEP_ENABLE() (RCC_C1->APB2LPENR) |= (RCC_APB2LPENR_SAI1LPEN)
  5526. #define __HAL_RCC_C1_SAI2_CLK_SLEEP_ENABLE() (RCC_C1->APB2LPENR) |= (RCC_APB2LPENR_SAI2LPEN)
  5527. #define __HAL_RCC_C1_SAI3_CLK_SLEEP_ENABLE() (RCC_C1->APB2LPENR) |= (RCC_APB2LPENR_SAI3LPEN)
  5528. #define __HAL_RCC_C1_DFSDM1_CLK_SLEEP_ENABLE() (RCC_C1->APB2LPENR) |= (RCC_APB2LPENR_DFSDM1LPEN)
  5529. #define __HAL_RCC_C1_HRTIM1_CLK_SLEEP_ENABLE() (RCC_C1->APB2LPENR) |= (RCC_APB2LPENR_HRTIMLPEN)
  5530. #define __HAL_RCC_C1_TIM1_CLK_SLEEP_DISABLE() (RCC_C1->APB2LPENR) &= ~ (RCC_APB2LPENR_TIM1LPEN)
  5531. #define __HAL_RCC_C1_TIM8_CLK_SLEEP_DISABLE() (RCC_C1->APB2LPENR) &= ~ (RCC_APB2LPENR_TIM8LPEN)
  5532. #define __HAL_RCC_C1_USART1_CLK_SLEEP_DISABLE() (RCC_C1->APB2LPENR) &= ~ (RCC_APB2LPENR_USART1LPEN)
  5533. #define __HAL_RCC_C1_USART6_CLK_SLEEP_DISABLE() (RCC_C1->APB2LPENR) &= ~ (RCC_APB2LPENR_USART6LPEN)
  5534. #define __HAL_RCC_C1_SPI1_CLK_SLEEP_DISABLE() (RCC_C1->APB2LPENR) &= ~ (RCC_APB2LPENR_SPI1LPEN)
  5535. #define __HAL_RCC_C1_SPI4_CLK_SLEEP_DISABLE() (RCC_C1->APB2LPENR) &= ~ (RCC_APB2LPENR_SPI4LPEN)
  5536. #define __HAL_RCC_C1_TIM15_CLK_SLEEP_DISABLE() (RCC_C1->APB2LPENR) &= ~ (RCC_APB2LPENR_TIM15LPEN)
  5537. #define __HAL_RCC_C1_TIM16_CLK_SLEEP_DISABLE() (RCC_C1->APB2LPENR) &= ~ (RCC_APB2LPENR_TIM16LPEN)
  5538. #define __HAL_RCC_C1_TIM17_CLK_SLEEP_DISABLE() (RCC_C1->APB2LPENR) &= ~ (RCC_APB2LPENR_TIM17LPEN)
  5539. #define __HAL_RCC_C1_SPI5_CLK_SLEEP_DISABLE() (RCC_C1->APB2LPENR) &= ~ (RCC_APB2LPENR_SPI5LPEN)
  5540. #define __HAL_RCC_C1_SAI1_CLK_SLEEP_DISABLE() (RCC_C1->APB2LPENR) &= ~ (RCC_APB2LPENR_SAI1LPEN)
  5541. #define __HAL_RCC_C1_SAI2_CLK_SLEEP_DISABLE() (RCC_C1->APB2LPENR) &= ~ (RCC_APB2LPENR_SAI2LPEN)
  5542. #define __HAL_RCC_C1_SAI3_CLK_SLEEP_DISABLE() (RCC_C1->APB2LPENR) &= ~ (RCC_APB2LPENR_SAI3LPEN)
  5543. #define __HAL_RCC_C1_DFSDM1_CLK_SLEEP_DISABLE() (RCC_C1->APB2LPENR) &= ~ (RCC_APB2LPENR_DFSDM1LPEN)
  5544. #define __HAL_RCC_C1_HRTIM1_CLK_SLEEP_DISABLE() (RCC_C1->APB2LPENR) &= ~ (RCC_APB2LPENR_HRTIMLPEN)
  5545. /** @brief ENABLE or disable the APB4 peripheral clock during Low Power (Sleep) mode.
  5546. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5547. * power consumption.
  5548. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  5549. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  5550. */
  5551. #define __HAL_RCC_C1_SYSCFG_CLK_SLEEP_ENABLE() (RCC_C1->APB4LPENR) |= (RCC_APB4LPENR_SYSCFGLPEN)
  5552. #define __HAL_RCC_C1_LPUART1_CLK_SLEEP_ENABLE() (RCC_C1->APB4LPENR) |= (RCC_APB4LPENR_LPUART1LPEN)
  5553. #define __HAL_RCC_C1_SPI6_CLK_SLEEP_ENABLE() (RCC_C1->APB4LPENR) |= (RCC_APB4LPENR_SPI6LPEN)
  5554. #define __HAL_RCC_C1_I2C4_CLK_SLEEP_ENABLE() (RCC_C1->APB4LPENR) |= (RCC_APB4LPENR_I2C4LPEN)
  5555. #define __HAL_RCC_C1_LPTIM2_CLK_SLEEP_ENABLE() (RCC_C1->APB4LPENR) |= (RCC_APB4LPENR_LPTIM2LPEN)
  5556. #define __HAL_RCC_C1_LPTIM3_CLK_SLEEP_ENABLE() (RCC_C1->APB4LPENR) |= (RCC_APB4LPENR_LPTIM3LPEN)
  5557. #define __HAL_RCC_C1_LPTIM4_CLK_SLEEP_ENABLE() (RCC_C1->APB4LPENR) |= (RCC_APB4LPENR_LPTIM4LPEN)
  5558. #define __HAL_RCC_C1_LPTIM5_CLK_SLEEP_ENABLE() (RCC_C1->APB4LPENR) |= (RCC_APB4LPENR_LPTIM5LPEN)
  5559. #define __HAL_RCC_C1_COMP12_CLK_SLEEP_ENABLE() (RCC_C1->APB4LPENR) |= (RCC_APB4LPENR_COMP12LPEN)
  5560. #define __HAL_RCC_C1_VREF_CLK_SLEEP_ENABLE() (RCC_C1->APB4LPENR) |= (RCC_APB4LPENR_VREFLPEN)
  5561. #define __HAL_RCC_C1_SAI4_CLK_SLEEP_ENABLE() (RCC_C1->APB4LPENR) |= (RCC_APB4LPENR_SAI4LPEN)
  5562. #define __HAL_RCC_C1_RTC_CLK_SLEEP_ENABLE() (RCC_C1->APB4LPENR) |= (RCC_APB4LPENR_RTCAPBLPEN)
  5563. #define __HAL_RCC_C1_SYSCFG_CLK_SLEEP_DISABLE() (RCC_C1->APB4LPENR) &= ~ (RCC_APB4LPENR_SYSCFGLPEN)
  5564. #define __HAL_RCC_C1_LPUART1_CLK_SLEEP_DISABLE() (RCC_C1->APB4LPENR) &= ~ (RCC_APB4LPENR_LPUART1LPEN)
  5565. #define __HAL_RCC_C1_SPI6_CLK_SLEEP_DISABLE() (RCC_C1->APB4LPENR) &= ~ (RCC_APB4LPENR_SPI6LPEN)
  5566. #define __HAL_RCC_C1_I2C4_CLK_SLEEP_DISABLE() (RCC_C1->APB4LPENR) &= ~ (RCC_APB4LPENR_I2C4LPEN)
  5567. #define __HAL_RCC_C1_LPTIM2_CLK_SLEEP_DISABLE() (RCC_C1->APB4LPENR) &= ~ (RCC_APB4LPENR_LPTIM2LPEN)
  5568. #define __HAL_RCC_C1_LPTIM3_CLK_SLEEP_DISABLE() (RCC_C1->APB4LPENR) &= ~ (RCC_APB4LPENR_LPTIM3LPEN)
  5569. #define __HAL_RCC_C1_LPTIM4_CLK_SLEEP_DISABLE() (RCC_C1->APB4LPENR) &= ~ (RCC_APB4LPENR_LPTIM4LPEN)
  5570. #define __HAL_RCC_C1_LPTIM5_CLK_SLEEP_DISABLE() (RCC_C1->APB4LPENR) &= ~ (RCC_APB4LPENR_LPTIM5LPEN)
  5571. #define __HAL_RCC_C1_COMP12_CLK_SLEEP_DISABLE() (RCC_C1->APB4LPENR) &= ~ (RCC_APB4LPENR_COMP12LPEN)
  5572. #define __HAL_RCC_C1_VREF_CLK_SLEEP_DISABLE() (RCC_C1->APB4LPENR) &= ~ (RCC_APB4LPENR_VREFLPEN)
  5573. #define __HAL_RCC_C1_SAI4_CLK_SLEEP_DISABLE() (RCC_C1->APB4LPENR) &= ~ (RCC_APB4LPENR_SAI4LPEN)
  5574. #define __HAL_RCC_C1_RTC_CLK_SLEEP_DISABLE() (RCC_C1->APB4LPENR) &= ~ (RCC_APB4LPENR_RTCAPBLPEN)
  5575. /** @brief Enable or disable the RCC_C2 AHB3 peripheral clock during Low Power (Sleep) mode.
  5576. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5577. * power consumption.
  5578. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
  5579. * @note By default, all peripheral clocks are enabled during SLEEP mode.
  5580. */
  5581. #define __HAL_RCC_C2_MDMA_CLK_SLEEP_ENABLE() (RCC_C2->AHB3LPENR |= (RCC_AHB3LPENR_MDMALPEN))
  5582. #define __HAL_RCC_C2_DMA2D_CLK_SLEEP_ENABLE() (RCC_C2->AHB3LPENR |= (RCC_AHB3LPENR_DMA2DLPEN))
  5583. #define __HAL_RCC_C2_JPGDEC_CLK_SLEEP_ENABLE() (RCC_C2->AHB3LPENR |= (RCC_AHB3LPENR_JPGDECLPEN))
  5584. #define __HAL_RCC_C2_FLASH_CLK_SLEEP_ENABLE() (RCC_C2->AHB3LPENR |= (RCC_AHB3LPENR_FLASHLPEN))
  5585. #define __HAL_RCC_C2_FMC_CLK_SLEEP_ENABLE() (RCC_C2->AHB3LPENR |= (RCC_AHB3LPENR_FMCLPEN))
  5586. #define __HAL_RCC_C2_QSPI_CLK_SLEEP_ENABLE() (RCC_C2->AHB3LPENR |= (RCC_AHB3LPENR_QSPILPEN))
  5587. #define __HAL_RCC_C2_SDMMC1_CLK_SLEEP_ENABLE() (RCC_C2->AHB3LPENR |= (RCC_AHB3LPENR_SDMMC1LPEN))
  5588. #define __HAL_RCC_C2_DTCM1_CLK_SLEEP_ENABLE() (RCC_C2->AHB3LPENR |= (RCC_AHB3LPENR_DTCM1LPEN))
  5589. #define __HAL_RCC_C2_DTCM2_CLK_SLEEP_ENABLE() (RCC_C2->AHB3LPENR |= (RCC_AHB3LPENR_DTCM2LPEN))
  5590. #define __HAL_RCC_C2_ITCM_CLK_SLEEP_ENABLE() (RCC_C2->AHB3LPENR |= (RCC_AHB3LPENR_ITCMLPEN))
  5591. #define __HAL_RCC_C2_D1SRAM1_CLK_SLEEP_ENABLE() (RCC_C2->AHB3LPENR |= (RCC_AHB3LPENR_AXISRAMLPEN))
  5592. #define __HAL_RCC_C2_MDMA_CLK_SLEEP_DISABLE() (RCC_C2->AHB3LPENR &= ~ (RCC_AHB3LPENR_MDMALPEN))
  5593. #define __HAL_RCC_C2_DMA2D_CLK_SLEEP_DISABLE() (RCC_C2->AHB3LPENR &= ~ (RCC_AHB3LPENR_DMA2DLPEN))
  5594. #define __HAL_RCC_C2_JPGDEC_CLK_SLEEP_DISABLE() (RCC_C2->AHB3LPENR &= ~ (RCC_AHB3LPENR_JPGDECLPEN))
  5595. #define __HAL_RCC_C2_FLASH_CLK_SLEEP_DISABLE() (RCC_C2->AHB3LPENR &= ~ (RCC_AHB3LPENR_FLASHLPEN))
  5596. #define __HAL_RCC_C2_FMC_CLK_SLEEP_DISABLE() (RCC_C2->AHB3LPENR &= ~ (RCC_AHB3LPENR_FMCLPEN))
  5597. #define __HAL_RCC_C2_QSPI_CLK_SLEEP_DISABLE() (RCC_C2->AHB3LPENR &= ~ (RCC_AHB3LPENR_QSPILPEN))
  5598. #define __HAL_RCC_C2_SDMMC1_CLK_SLEEP_DISABLE() (RCC_C2->AHB3LPENR &= ~ (RCC_AHB3LPENR_SDMMC1LPEN))
  5599. #define __HAL_RCC_C2_DTCM1_CLK_SLEEP_DISABLE() (RCC_C2->AHB3LPENR &= ~ (RCC_AHB3LPENR_DTCM1LPEN))
  5600. #define __HAL_RCC_C2_DTCM2_CLK_SLEEP_DISABLE() (RCC_C2->AHB3LPENR &= ~ (RCC_AHB3LPENR_DTCM2LPEN))
  5601. #define __HAL_RCC_C2_ITCM_CLK_SLEEP_DISABLE() (RCC_C2->AHB3LPENR &= ~ (RCC_AHB3LPENR_ITCMLPEN))
  5602. #define __HAL_RCC_C2_D1SRAM1_CLK_SLEEP_DISABLE() (RCC_C2->AHB3LPENR &= ~ (RCC_AHB3LPENR_AXISRAMLPEN))
  5603. /** @brief ENABLE or disable the AHB1 peripheral clock during Low Power (Sleep) mode.
  5604. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5605. * power consumption.
  5606. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  5607. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  5608. */
  5609. #define __HAL_RCC_C2_DMA1_CLK_SLEEP_ENABLE() (RCC_C2->AHB1LPENR |= (RCC_AHB1LPENR_DMA1LPEN))
  5610. #define __HAL_RCC_C2_DMA2_CLK_SLEEP_ENABLE() (RCC_C2->AHB1LPENR |= (RCC_AHB1LPENR_DMA2LPEN))
  5611. #define __HAL_RCC_C2_ADC12_CLK_SLEEP_ENABLE() (RCC_C2->AHB1LPENR |= (RCC_AHB1LPENR_ADC12LPEN))
  5612. #define __HAL_RCC_C2_ETH1MAC_CLK_SLEEP_ENABLE() (RCC_C2->AHB1LPENR |= (RCC_AHB1LPENR_ETH1MACLPEN))
  5613. #define __HAL_RCC_C2_ETH1TX_CLK_SLEEP_ENABLE() (RCC_C2->AHB1LPENR |= (RCC_AHB1LPENR_ETH1TXLPEN))
  5614. #define __HAL_RCC_C2_ETH1RX_CLK_SLEEP_ENABLE() (RCC_C2->AHB1LPENR |= (RCC_AHB1LPENR_ETH1RXLPEN))
  5615. #define __HAL_RCC_C2_USB1_OTG_HS_CLK_SLEEP_ENABLE() (RCC_C2->AHB1LPENR |= (RCC_AHB1LPENR_USB1OTGHSLPEN))
  5616. #define __HAL_RCC_C2_USB1_OTG_HS_ULPI_CLK_SLEEP_ENABLE() (RCC_C2->AHB1LPENR |= (RCC_AHB1LPENR_USB1OTGHSULPILPEN))
  5617. #define __HAL_RCC_C2_USB2_OTG_FS_CLK_SLEEP_ENABLE() (RCC_C2->AHB1LPENR |= (RCC_AHB1LPENR_USB2OTGHSLPEN))
  5618. #define __HAL_RCC_C2_USB2_OTG_FS_ULPI_CLK_SLEEP_ENABLE() (RCC_C2->AHB1LPENR |= (RCC_AHB1LPENR_USB2OTGHSULPILPEN))
  5619. #define __HAL_RCC_C2_DMA1_CLK_SLEEP_DISABLE() (RCC_C2->AHB1LPENR &= ~ (RCC_AHB1LPENR_DMA1LPEN))
  5620. #define __HAL_RCC_C2_DMA2_CLK_SLEEP_DISABLE() (RCC_C2->AHB1LPENR &= ~ (RCC_AHB1LPENR_DMA2LPEN))
  5621. #define __HAL_RCC_C2_ADC12_CLK_SLEEP_DISABLE() (RCC_C2->AHB1LPENR &= ~ (RCC_AHB1LPENR_ADC12LPEN))
  5622. #define __HAL_RCC_C2_ETH1MAC_CLK_SLEEP_DISABLE() (RCC_C2->AHB1LPENR &= ~ (RCC_AHB1LPENR_ETH1MACLPEN))
  5623. #define __HAL_RCC_C2_ETH1TX_CLK_SLEEP_DISABLE() (RCC_C2->AHB1LPENR &= ~ (RCC_AHB1LPENR_ETH1TXLPEN))
  5624. #define __HAL_RCC_C2_ETH1RX_CLK_SLEEP_DISABLE() (RCC_C2->AHB1LPENR &= ~ (RCC_AHB1LPENR_ETH1RXLPEN))
  5625. #define __HAL_RCC_C2_USB1_OTG_HS_CLK_SLEEP_DISABLE() (RCC_C2->AHB1LPENR &= ~ (RCC_AHB1LPENR_USB1OTGHSLPEN))
  5626. #define __HAL_RCC_C2_USB1_OTG_HS_ULPI_CLK_SLEEP_DISABLE() (RCC_C2->AHB1LPENR &= ~ (RCC_AHB1LPENR_USB1OTGHSULPILPEN))
  5627. #define __HAL_RCC_C2_USB2_OTG_FS_CLK_SLEEP_DISABLE() (RCC_C2->AHB1LPENR &= ~ (RCC_AHB1LPENR_USB2OTGHSLPEN))
  5628. #define __HAL_RCC_C2_USB2_OTG_FS_ULPI_CLK_SLEEP_DISABLE() (RCC_C2->AHB1LPENR &= ~ (RCC_AHB1LPENR_USB2OTGHSULPILPEN))
  5629. /** @brief ENABLE or disable the AHB2 peripheral clock during Low Power (Sleep) mode.
  5630. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5631. * power consumption.
  5632. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  5633. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  5634. */
  5635. #define __HAL_RCC_C2_DCMI_CLK_SLEEP_ENABLE() (RCC_C2->AHB2LPENR |= (RCC_AHB2LPENR_DCMILPEN))
  5636. #define __HAL_RCC_C2_CRYP_CLK_SLEEP_ENABLE() (RCC_C2->AHB2LPENR |= (RCC_AHB2LPENR_CRYPLPEN))
  5637. #define __HAL_RCC_C2_HASH_CLK_SLEEP_ENABLE() (RCC_C2->AHB2LPENR |= (RCC_AHB2LPENR_HASHLPEN))
  5638. #define __HAL_RCC_C2_RNG_CLK_SLEEP_ENABLE() (RCC_C2->AHB2LPENR |= (RCC_AHB2LPENR_RNGLPEN))
  5639. #define __HAL_RCC_C2_SDMMC2_CLK_SLEEP_ENABLE() (RCC_C2->AHB2LPENR |= (RCC_AHB2LPENR_SDMMC2LPEN))
  5640. #define __HAL_RCC_C2_D2SRAM1_CLK_SLEEP_ENABLE() (RCC_C2->AHB2LPENR |= (RCC_AHB2LPENR_D2SRAM1LPEN))
  5641. #define __HAL_RCC_C2_D2SRAM2_CLK_SLEEP_ENABLE() (RCC_C2->AHB2LPENR |= (RCC_AHB2LPENR_D2SRAM2LPEN))
  5642. #define __HAL_RCC_C2_D2SRAM3_CLK_SLEEP_ENABLE() (RCC_C2->AHB2LPENR |= (RCC_AHB2LPENR_D2SRAM3LPEN))
  5643. #define __HAL_RCC_C2_DCMI_CLK_SLEEP_DISABLE() (RCC_C2->AHB2LPENR &= ~ (RCC_AHB2LPENR_DCMILPEN))
  5644. #define __HAL_RCC_C2_CRYP_CLK_SLEEP_DISABLE() (RCC_C2->AHB2LPENR &= ~ (RCC_AHB2LPENR_CRYPLPEN))
  5645. #define __HAL_RCC_C2_HASH_CLK_SLEEP_DISABLE() (RCC_C2->AHB2LPENR &= ~ (RCC_AHB2LPENR_HASHLPEN))
  5646. #define __HAL_RCC_C2_RNG_CLK_SLEEP_DISABLE() (RCC_C2->AHB2LPENR &= ~ (RCC_AHB2LPENR_RNGLPEN))
  5647. #define __HAL_RCC_C2_SDMMC2_CLK_SLEEP_DISABLE() (RCC_C2->AHB2LPENR &= ~ (RCC_AHB2LPENR_SDMMC2LPEN))
  5648. #define __HAL_RCC_C2_D2SRAM1_CLK_SLEEP_DISABLE() (RCC_C2->AHB2LPENR &= ~ (RCC_AHB2LPENR_D2SRAM1LPEN))
  5649. #define __HAL_RCC_C2_D2SRAM2_CLK_SLEEP_DISABLE() (RCC_C2->AHB2LPENR &= ~ (RCC_AHB2LPENR_D2SRAM2LPEN))
  5650. #define __HAL_RCC_C2_D2SRAM3_CLK_SLEEP_DISABLE() (RCC_C2->AHB2LPENR &= ~ (RCC_AHB2LPENR_D2SRAM3LPEN))
  5651. /** @brief ENABLE or disable the AHB4 peripheral clock during Low Power (Sleep) mode.
  5652. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5653. * power consumption.
  5654. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  5655. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  5656. */
  5657. #define __HAL_RCC_C2_GPIOA_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOALPEN)
  5658. #define __HAL_RCC_C2_GPIOB_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOBLPEN)
  5659. #define __HAL_RCC_C2_GPIOC_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOCLPEN)
  5660. #define __HAL_RCC_C2_GPIOD_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR) |= (RCC_AHB4LPENR_GPIODLPEN)
  5661. #define __HAL_RCC_C2_GPIOE_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOELPEN)
  5662. #define __HAL_RCC_C2_GPIOF_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOFLPEN)
  5663. #define __HAL_RCC_C2_GPIOG_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOGLPEN)
  5664. #define __HAL_RCC_C2_GPIOH_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOHLPEN)
  5665. #define __HAL_RCC_C2_GPIOI_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOILPEN)
  5666. #define __HAL_RCC_C2_GPIOJ_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOJLPEN)
  5667. #define __HAL_RCC_C2_GPIOK_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR) |= (RCC_AHB4LPENR_GPIOKLPEN)
  5668. #define __HAL_RCC_C2_CRC_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR) |= (RCC_AHB4LPENR_CRCLPEN)
  5669. #define __HAL_RCC_C2_BDMA_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR) |= (RCC_AHB4LPENR_BDMALPEN)
  5670. #define __HAL_RCC_C2_ADC3_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR) |= (RCC_AHB4LPENR_ADC3LPEN)
  5671. #define __HAL_RCC_C2_BKPRAM_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR) |= (RCC_AHB4LPENR_BKPRAMLPEN)
  5672. #define __HAL_RCC_C2_D3SRAM1_CLK_SLEEP_ENABLE() (RCC_C2->AHB4LPENR |= (RCC_AHB4LPENR_D3SRAM1LPEN))
  5673. #define __HAL_RCC_C2_GPIOA_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOALPEN)
  5674. #define __HAL_RCC_C2_GPIOB_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOBLPEN)
  5675. #define __HAL_RCC_C2_GPIOC_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOCLPEN)
  5676. #define __HAL_RCC_C2_GPIOD_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIODLPEN)
  5677. #define __HAL_RCC_C2_GPIOE_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOELPEN)
  5678. #define __HAL_RCC_C2_GPIOF_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOFLPEN)
  5679. #define __HAL_RCC_C2_GPIOG_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOGLPEN)
  5680. #define __HAL_RCC_C2_GPIOH_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOHLPEN)
  5681. #define __HAL_RCC_C2_GPIOI_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOILPEN)
  5682. #define __HAL_RCC_C2_GPIOJ_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOJLPEN)
  5683. #define __HAL_RCC_C2_GPIOK_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR) &= ~ (RCC_AHB4LPENR_GPIOKLPEN)
  5684. #define __HAL_RCC_C2_CRC_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR) &= ~ (RCC_AHB4LPENR_CRCLPEN)
  5685. #define __HAL_RCC_C2_BDMA_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR) &= ~ (RCC_AHB4LPENR_BDMALPEN)
  5686. #define __HAL_RCC_C2_ADC3_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR) &= ~ (RCC_AHB4LPENR_ADC3LPEN)
  5687. #define __HAL_RCC_C2_BKPRAM_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR) &= ~ (RCC_AHB4LPENR_BKPRAMLPEN)
  5688. #define __HAL_RCC_C2_D3SRAM1_CLK_SLEEP_DISABLE() (RCC_C2->AHB4LPENR &= ~ (RCC_AHB4LPENR_D3SRAM1LPEN))
  5689. /** @brief ENABLE or disable the APB3 peripheral clock during Low Power (Sleep) mode.
  5690. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5691. * power consumption.
  5692. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  5693. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  5694. */
  5695. #define __HAL_RCC_C2_LTDC_CLK_SLEEP_ENABLE() (RCC_C2->APB3LPENR) |= (RCC_APB3LPENR_LTDCLPEN)
  5696. #define __HAL_RCC_C2_DSI_CLK_SLEEP_ENABLE() (RCC_C2->APB3LPENR) |= (RCC_APB3LPENR_DSILPEN)
  5697. #define __HAL_RCC_C2_WWDG1_CLK_SLEEP_ENABLE() (RCC_C2->APB3LPENR) |= (RCC_APB3LPENR_WWDG1LPEN)
  5698. #define __HAL_RCC_C2_LTDC_CLK_SLEEP_DISABLE() (RCC_C2->APB3LPENR) &= ~ (RCC_APB3LPENR_LTDCLPEN)
  5699. #define __HAL_RCC_C2_DSI_CLK_SLEEP_DISABLE() (RCC_C2->APB3LPENR) &= ~ (RCC_APB3LPENR_DSILPEN)
  5700. #define __HAL_RCC_C2_WWDG1_CLK_SLEEP_DISABLE() (RCC_C2->APB3LPENR) &= ~ (RCC_APB3LPENR_WWDG1LPEN)
  5701. /** @brief ENABLE or disable the APB1 peripheral clock during Low Power (Sleep) mode.
  5702. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5703. * power consumption.
  5704. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  5705. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  5706. */
  5707. #define __HAL_RCC_C2_TIM2_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_TIM2LPEN)
  5708. #define __HAL_RCC_C2_TIM3_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_TIM3LPEN)
  5709. #define __HAL_RCC_C2_TIM4_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_TIM4LPEN)
  5710. #define __HAL_RCC_C2_TIM5_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_TIM5LPEN)
  5711. #define __HAL_RCC_C2_TIM6_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_TIM6LPEN)
  5712. #define __HAL_RCC_C2_TIM7_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_TIM7LPEN)
  5713. #define __HAL_RCC_C2_TIM12_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_TIM12LPEN)
  5714. #define __HAL_RCC_C2_TIM13_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_TIM13LPEN)
  5715. #define __HAL_RCC_C2_TIM14_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_TIM14LPEN)
  5716. #define __HAL_RCC_C2_LPTIM1_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_LPTIM1LPEN)
  5717. #define __HAL_RCC_C2_WWDG2_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_WWDG2LPEN)
  5718. #define __HAL_RCC_C2_SPI2_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_SPI2LPEN)
  5719. #define __HAL_RCC_C2_SPI3_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_SPI3LPEN)
  5720. #define __HAL_RCC_C2_SPDIFRX_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_SPDIFRXLPEN)
  5721. #define __HAL_RCC_C2_USART2_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_USART2LPEN)
  5722. #define __HAL_RCC_C2_USART3_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_USART3LPEN)
  5723. #define __HAL_RCC_C2_UART4_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_UART4LPEN)
  5724. #define __HAL_RCC_C2_UART5_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_UART5LPEN)
  5725. #define __HAL_RCC_C2_I2C1_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_I2C1LPEN)
  5726. #define __HAL_RCC_C2_I2C2_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_I2C2LPEN)
  5727. #define __HAL_RCC_C2_I2C3_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_I2C3LPEN)
  5728. #define __HAL_RCC_C2_CEC_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_CECLPEN)
  5729. #define __HAL_RCC_C2_DAC12_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_DAC12LPEN)
  5730. #define __HAL_RCC_C2_UART7_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_UART7LPEN)
  5731. #define __HAL_RCC_C2_UART8_CLK_SLEEP_ENABLE() (RCC_C2->APB1LLPENR) |= (RCC_APB1LLPENR_UART8LPEN)
  5732. #define __HAL_RCC_C2_CRS_CLK_SLEEP_ENABLE() (RCC_C2->APB1HLPENR) |= (RCC_APB1HLPENR_CRSLPEN)
  5733. #define __HAL_RCC_C2_SWPMI_CLK_SLEEP_ENABLE() (RCC_C2->APB1HLPENR) |= (RCC_APB1HLPENR_SWPMILPEN)
  5734. #define __HAL_RCC_C2_OPAMP_CLK_SLEEP_ENABLE() (RCC_C2->APB1HLPENR) |= (RCC_APB1HLPENR_OPAMPLPEN)
  5735. #define __HAL_RCC_C2_MDIOS_CLK_SLEEP_ENABLE() (RCC_C2->APB1HLPENR) |= (RCC_APB1HLPENR_MDIOSLPEN)
  5736. #define __HAL_RCC_C2_FDCAN_CLK_SLEEP_ENABLE() (RCC_C2->APB1HLPENR) |= (RCC_APB1HLPENR_FDCANLPEN)
  5737. #define __HAL_RCC_C2_TIM2_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM2LPEN)
  5738. #define __HAL_RCC_C2_TIM3_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM3LPEN)
  5739. #define __HAL_RCC_C2_TIM4_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM4LPEN)
  5740. #define __HAL_RCC_C2_TIM5_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM5LPEN)
  5741. #define __HAL_RCC_C2_TIM6_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM6LPEN)
  5742. #define __HAL_RCC_C2_TIM7_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM7LPEN)
  5743. #define __HAL_RCC_C2_TIM12_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM12LPEN)
  5744. #define __HAL_RCC_C2_TIM13_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM13LPEN)
  5745. #define __HAL_RCC_C2_TIM14_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_TIM14LPEN)
  5746. #define __HAL_RCC_C2_LPTIM1_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_LPTIM1LPEN)
  5747. #define __HAL_RCC_C2_WWDG2_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_WWDG2LPEN)
  5748. #define __HAL_RCC_C2_SPI2_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_SPI2LPEN)
  5749. #define __HAL_RCC_C2_SPI3_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_SPI3LPEN)
  5750. #define __HAL_RCC_C2_SPDIFRX_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_SPDIFRXLPEN)
  5751. #define __HAL_RCC_C2_USART2_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_USART2LPEN)
  5752. #define __HAL_RCC_C2_USART3_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_USART3LPEN)
  5753. #define __HAL_RCC_C2_UART4_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_UART4LPEN)
  5754. #define __HAL_RCC_C2_UART5_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_UART5LPEN)
  5755. #define __HAL_RCC_C2_I2C1_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_I2C1LPEN)
  5756. #define __HAL_RCC_C2_I2C2_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_I2C2LPEN)
  5757. #define __HAL_RCC_C2_I2C3_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_I2C3LPEN)
  5758. #define __HAL_RCC_C2_CEC_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_CECLPEN)
  5759. #define __HAL_RCC_C2_DAC12_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_DAC12LPEN)
  5760. #define __HAL_RCC_C2_UART7_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_UART7LPEN)
  5761. #define __HAL_RCC_C2_UART8_CLK_SLEEP_DISABLE() (RCC_C2->APB1LLPENR) &= ~ (RCC_APB1LLPENR_UART8LPEN)
  5762. #define __HAL_RCC_C2_CRS_CLK_SLEEP_DISABLE() (RCC_C2->APB1HLPENR) &= ~ (RCC_APB1HLPENR_CRSLPEN)
  5763. #define __HAL_RCC_C2_SWPMI_CLK_SLEEP_DISABLE() (RCC_C2->APB1HLPENR) &= ~ (RCC_APB1HLPENR_SWPMILPEN)
  5764. #define __HAL_RCC_C2_OPAMP_CLK_SLEEP_DISABLE() (RCC_C2->APB1HLPENR) &= ~ (RCC_APB1HLPENR_OPAMPLPEN)
  5765. #define __HAL_RCC_C2_MDIOS_CLK_SLEEP_DISABLE() (RCC_C2->APB1HLPENR) &= ~ (RCC_APB1HLPENR_MDIOSLPEN)
  5766. #define __HAL_RCC_C2_FDCAN_CLK_SLEEP_DISABLE() (RCC_C2->APB1HLPENR) &= ~ (RCC_APB1HLPENR_FDCANLPEN)
  5767. /** @brief ENABLE or disable the APB2 peripheral clock during Low Power (Sleep) mode.
  5768. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5769. * power consumption.
  5770. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  5771. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  5772. */
  5773. #define __HAL_RCC_C2_TIM1_CLK_SLEEP_ENABLE() (RCC_C2->APB2LPENR) |= (RCC_APB2LPENR_TIM1LPEN)
  5774. #define __HAL_RCC_C2_TIM8_CLK_SLEEP_ENABLE() (RCC_C2->APB2LPENR) |= (RCC_APB2LPENR_TIM8LPEN)
  5775. #define __HAL_RCC_C2_USART1_CLK_SLEEP_ENABLE() (RCC_C2->APB2LPENR) |= (RCC_APB2LPENR_USART1LPEN)
  5776. #define __HAL_RCC_C2_USART6_CLK_SLEEP_ENABLE() (RCC_C2->APB2LPENR) |= (RCC_APB2LPENR_USART6LPEN)
  5777. #define __HAL_RCC_C2_SPI1_CLK_SLEEP_ENABLE() (RCC_C2->APB2LPENR) |= (RCC_APB2LPENR_SPI1LPEN)
  5778. #define __HAL_RCC_C2_SPI4_CLK_SLEEP_ENABLE() (RCC_C2->APB2LPENR) |= (RCC_APB2LPENR_SPI4LPEN)
  5779. #define __HAL_RCC_C2_TIM15_CLK_SLEEP_ENABLE() (RCC_C2->APB2LPENR) |= (RCC_APB2LPENR_TIM15LPEN)
  5780. #define __HAL_RCC_C2_TIM16_CLK_SLEEP_ENABLE() (RCC_C2->APB2LPENR) |= (RCC_APB2LPENR_TIM16LPEN)
  5781. #define __HAL_RCC_C2_TIM17_CLK_SLEEP_ENABLE() (RCC_C2->APB2LPENR) |= (RCC_APB2LPENR_TIM17LPEN)
  5782. #define __HAL_RCC_C2_SPI5_CLK_SLEEP_ENABLE() (RCC_C2->APB2LPENR) |= (RCC_APB2LPENR_SPI5LPEN)
  5783. #define __HAL_RCC_C2_SAI1_CLK_SLEEP_ENABLE() (RCC_C2->APB2LPENR) |= (RCC_APB2LPENR_SAI1LPEN)
  5784. #define __HAL_RCC_C2_SAI2_CLK_SLEEP_ENABLE() (RCC_C2->APB2LPENR) |= (RCC_APB2LPENR_SAI2LPEN)
  5785. #define __HAL_RCC_C2_SAI3_CLK_SLEEP_ENABLE() (RCC_C2->APB2LPENR) |= (RCC_APB2LPENR_SAI3LPEN)
  5786. #define __HAL_RCC_C2_DFSDM1_CLK_SLEEP_ENABLE() (RCC_C2->APB2LPENR) |= (RCC_APB2LPENR_DFSDM1LPEN)
  5787. #define __HAL_RCC_C2_HRTIM1_CLK_SLEEP_ENABLE() (RCC_C2->APB2LPENR) |= (RCC_APB2LPENR_HRTIMLPEN)
  5788. #define __HAL_RCC_C2_TIM1_CLK_SLEEP_DISABLE() (RCC_C2->APB2LPENR) &= ~ (RCC_APB2LPENR_TIM1LPEN)
  5789. #define __HAL_RCC_C2_TIM8_CLK_SLEEP_DISABLE() (RCC_C2->APB2LPENR) &= ~ (RCC_APB2LPENR_TIM8LPEN)
  5790. #define __HAL_RCC_C2_USART1_CLK_SLEEP_DISABLE() (RCC_C2->APB2LPENR) &= ~ (RCC_APB2LPENR_USART1LPEN)
  5791. #define __HAL_RCC_C2_USART6_CLK_SLEEP_DISABLE() (RCC_C2->APB2LPENR) &= ~ (RCC_APB2LPENR_USART6LPEN)
  5792. #define __HAL_RCC_C2_SPI1_CLK_SLEEP_DISABLE() (RCC_C2->APB2LPENR) &= ~ (RCC_APB2LPENR_SPI1LPEN)
  5793. #define __HAL_RCC_C2_SPI4_CLK_SLEEP_DISABLE() (RCC_C2->APB2LPENR) &= ~ (RCC_APB2LPENR_SPI4LPEN)
  5794. #define __HAL_RCC_C2_TIM15_CLK_SLEEP_DISABLE() (RCC_C2->APB2LPENR) &= ~ (RCC_APB2LPENR_TIM15LPEN)
  5795. #define __HAL_RCC_C2_TIM16_CLK_SLEEP_DISABLE() (RCC_C2->APB2LPENR) &= ~ (RCC_APB2LPENR_TIM16LPEN)
  5796. #define __HAL_RCC_C2_TIM17_CLK_SLEEP_DISABLE() (RCC_C2->APB2LPENR) &= ~ (RCC_APB2LPENR_TIM17LPEN)
  5797. #define __HAL_RCC_C2_SPI5_CLK_SLEEP_DISABLE() (RCC_C2->APB2LPENR) &= ~ (RCC_APB2LPENR_SPI5LPEN)
  5798. #define __HAL_RCC_C2_SAI1_CLK_SLEEP_DISABLE() (RCC_C2->APB2LPENR) &= ~ (RCC_APB2LPENR_SAI1LPEN)
  5799. #define __HAL_RCC_C2_SAI2_CLK_SLEEP_DISABLE() (RCC_C2->APB2LPENR) &= ~ (RCC_APB2LPENR_SAI2LPEN)
  5800. #define __HAL_RCC_C2_SAI3_CLK_SLEEP_DISABLE() (RCC_C2->APB2LPENR) &= ~ (RCC_APB2LPENR_SAI3LPEN)
  5801. #define __HAL_RCC_C2_DFSDM1_CLK_SLEEP_DISABLE() (RCC_C2->APB2LPENR) &= ~ (RCC_APB2LPENR_DFSDM1LPEN)
  5802. #define __HAL_RCC_C2_HRTIM1_CLK_SLEEP_DISABLE() (RCC_C2->APB2LPENR) &= ~ (RCC_APB2LPENR_HRTIMLPEN)
  5803. /** @brief ENABLE or disable the APB4 peripheral clock during Low Power (Sleep) mode.
  5804. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  5805. * power consumption.
  5806. * @note After wakeup from SLEEP mode, the peripheral clock is ENABLEd again.
  5807. * @note By default, all peripheral clocks are ENABLEd during SLEEP mode.
  5808. */
  5809. #define __HAL_RCC_C2_SYSCFG_CLK_SLEEP_ENABLE() (RCC_C2->APB4LPENR) |= (RCC_APB4LPENR_SYSCFGLPEN)
  5810. #define __HAL_RCC_C2_LPUART1_CLK_SLEEP_ENABLE() (RCC_C2->APB4LPENR) |= (RCC_APB4LPENR_LPUART1LPEN)
  5811. #define __HAL_RCC_C2_SPI6_CLK_SLEEP_ENABLE() (RCC_C2->APB4LPENR) |= (RCC_APB4LPENR_SPI6LPEN)
  5812. #define __HAL_RCC_C2_I2C4_CLK_SLEEP_ENABLE() (RCC_C2->APB4LPENR) |= (RCC_APB4LPENR_I2C4LPEN)
  5813. #define __HAL_RCC_C2_LPTIM2_CLK_SLEEP_ENABLE() (RCC_C2->APB4LPENR) |= (RCC_APB4LPENR_LPTIM2LPEN)
  5814. #define __HAL_RCC_C2_LPTIM3_CLK_SLEEP_ENABLE() (RCC_C2->APB4LPENR) |= (RCC_APB4LPENR_LPTIM3LPEN)
  5815. #define __HAL_RCC_C2_LPTIM4_CLK_SLEEP_ENABLE() (RCC_C2->APB4LPENR) |= (RCC_APB4LPENR_LPTIM4LPEN)
  5816. #define __HAL_RCC_C2_LPTIM5_CLK_SLEEP_ENABLE() (RCC_C2->APB4LPENR) |= (RCC_APB4LPENR_LPTIM5LPEN)
  5817. #define __HAL_RCC_C2_COMP12_CLK_SLEEP_ENABLE() (RCC_C2->APB4LPENR) |= (RCC_APB4LPENR_COMP12LPEN)
  5818. #define __HAL_RCC_C2_VREF_CLK_SLEEP_ENABLE() (RCC_C2->APB4LPENR) |= (RCC_APB4LPENR_VREFLPEN)
  5819. #define __HAL_RCC_C2_SAI4_CLK_SLEEP_ENABLE() (RCC_C2->APB4LPENR) |= (RCC_APB4LPENR_SAI4LPEN)
  5820. #define __HAL_RCC_C2_RTC_CLK_SLEEP_ENABLE() (RCC_C2->APB4LPENR) |= (RCC_APB4LPENR_RTCAPBLPEN)
  5821. #define __HAL_RCC_C2_SYSCFG_CLK_SLEEP_DISABLE() (RCC_C2->APB4LPENR) &= ~ (RCC_APB4LPENR_SYSCFGLPEN)
  5822. #define __HAL_RCC_C2_LPUART1_CLK_SLEEP_DISABLE() (RCC_C2->APB4LPENR) &= ~ (RCC_APB4LPENR_LPUART1LPEN)
  5823. #define __HAL_RCC_C2_SPI6_CLK_SLEEP_DISABLE() (RCC_C2->APB4LPENR) &= ~ (RCC_APB4LPENR_SPI6LPEN)
  5824. #define __HAL_RCC_C2_I2C4_CLK_SLEEP_DISABLE() (RCC_C2->APB4LPENR) &= ~ (RCC_APB4LPENR_I2C4LPEN)
  5825. #define __HAL_RCC_C2_LPTIM2_CLK_SLEEP_DISABLE() (RCC_C2->APB4LPENR) &= ~ (RCC_APB4LPENR_LPTIM2LPEN)
  5826. #define __HAL_RCC_C2_LPTIM3_CLK_SLEEP_DISABLE() (RCC_C2->APB4LPENR) &= ~ (RCC_APB4LPENR_LPTIM3LPEN)
  5827. #define __HAL_RCC_C2_LPTIM4_CLK_SLEEP_DISABLE() (RCC_C2->APB4LPENR) &= ~ (RCC_APB4LPENR_LPTIM4LPEN)
  5828. #define __HAL_RCC_C2_LPTIM5_CLK_SLEEP_DISABLE() (RCC_C2->APB4LPENR) &= ~ (RCC_APB4LPENR_LPTIM5LPEN)
  5829. #define __HAL_RCC_C2_COMP12_CLK_SLEEP_DISABLE() (RCC_C2->APB4LPENR) &= ~ (RCC_APB4LPENR_COMP12LPEN)
  5830. #define __HAL_RCC_C2_VREF_CLK_SLEEP_DISABLE() (RCC_C2->APB4LPENR) &= ~ (RCC_APB4LPENR_VREFLPEN)
  5831. #define __HAL_RCC_C2_SAI4_CLK_SLEEP_DISABLE() (RCC_C2->APB4LPENR) &= ~ (RCC_APB4LPENR_SAI4LPEN)
  5832. #define __HAL_RCC_C2_RTC_CLK_SLEEP_DISABLE() (RCC_C2->APB4LPENR) &= ~ (RCC_APB4LPENR_RTCAPBLPEN)
  5833. #endif /*DUAL_CORE*/
  5834. #if defined(DUAL_CORE)
  5835. /** @brief Enable or disable peripheral bus clock when D3 domain is in DRUN
  5836. * @note After reset (default config), peripheral clock is disabled when both CPUs are in CSTOP
  5837. */
  5838. #else
  5839. /** @brief Enable or disable peripheral bus clock when D3 domain is in DRUN
  5840. * @note After reset (default config), peripheral clock is disabled when CPU is in CSTOP
  5841. */
  5842. #endif /*DUAL_CORE*/
  5843. #if defined(RCC_D3AMR_BDMAAMEN)
  5844. #define __HAL_RCC_BDMA_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_BDMAAMEN)
  5845. #endif
  5846. #if defined(RCC_D3AMR_LPUART1AMEN)
  5847. #define __HAL_RCC_LPUART1_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_LPUART1AMEN)
  5848. #endif
  5849. #if defined(RCC_D3AMR_SPI6AMEN)
  5850. #define __HAL_RCC_SPI6_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_SPI6AMEN)
  5851. #endif
  5852. #if defined(RCC_D3AMR_I2C4AMEN)
  5853. #define __HAL_RCC_I2C4_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_I2C4AMEN)
  5854. #endif
  5855. #if defined(RCC_D3AMR_LPTIM2AMEN)
  5856. #define __HAL_RCC_LPTIM2_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_LPTIM2AMEN)
  5857. #endif
  5858. #if defined(RCC_D3AMR_LPTIM3AMEN)
  5859. #define __HAL_RCC_LPTIM3_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_LPTIM3AMEN)
  5860. #endif
  5861. #if defined(LPTIM4)
  5862. #define __HAL_RCC_LPTIM4_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_LPTIM4AMEN)
  5863. #endif
  5864. #if defined(LPTIM5)
  5865. #define __HAL_RCC_LPTIM5_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_LPTIM5AMEN)
  5866. #endif
  5867. #if defined(RCC_D3AMR_COMP12AMEN)
  5868. #define __HAL_RCC_COMP12_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_COMP12AMEN)
  5869. #endif
  5870. #if defined(RCC_D3AMR_VREFAMEN)
  5871. #define __HAL_RCC_VREF_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_VREFAMEN)
  5872. #endif
  5873. #if defined(RCC_D3AMR_RTCAMEN)
  5874. #define __HAL_RCC_RTC_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_RTCAMEN)
  5875. #endif
  5876. #if defined(RCC_D3AMR_CRCAMEN)
  5877. #define __HAL_RCC_CRC_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_CRCAMEN)
  5878. #endif
  5879. #if defined(SAI4)
  5880. #define __HAL_RCC_SAI4_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_SAI4AMEN)
  5881. #endif
  5882. #if defined(ADC3)
  5883. #define __HAL_RCC_ADC3_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_ADC3AMEN)
  5884. #endif
  5885. #if defined(RCC_D3AMR_BKPRAMAMEN)
  5886. #define __HAL_RCC_BKPRAM_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_BKPRAMAMEN)
  5887. #endif
  5888. #if defined(RCC_D3AMR_SRAM4AMEN)
  5889. #define __HAL_RCC_D3SRAM1_CLKAM_ENABLE() (RCC->D3AMR) |= (RCC_D3AMR_SRAM4AMEN)
  5890. #endif
  5891. #if defined(BDMA2)
  5892. #define __HAL_RCC_BDMA2_CLKAM_ENABLE() (RCC->SRDAMR) |= (RCC_SRDAMR_BDMA2AMEN)
  5893. #endif
  5894. #if defined(RCC_SRDAMR_GPIOAMEN)
  5895. #define __HAL_RCC_GPIO_CLKAM_ENABLE() (RCC->SRDAMR) |= (RCC_SRDAMR_GPIOAMEN)
  5896. #endif
  5897. #if defined(RCC_SRDAMR_LPUART1AMEN)
  5898. #define __HAL_RCC_LPUART1_CLKAM_ENABLE() (RCC->SRDAMR) |= (RCC_SRDAMR_LPUART1AMEN)
  5899. #endif
  5900. #if defined(RCC_SRDAMR_SPI6AMEN)
  5901. #define __HAL_RCC_SPI6_CLKAM_ENABLE() (RCC->SRDAMR) |= (RCC_SRDAMR_SPI6AMEN)
  5902. #endif
  5903. #if defined(RCC_SRDAMR_I2C4AMEN)
  5904. #define __HAL_RCC_I2C4_CLKAM_ENABLE() (RCC->SRDAMR) |= (RCC_SRDAMR_I2C4AMEN)
  5905. #endif
  5906. #if defined(RCC_SRDAMR_LPTIM2AMEN)
  5907. #define __HAL_RCC_LPTIM2_CLKAM_ENABLE() (RCC->SRDAMR) |= (RCC_SRDAMR_LPTIM2AMEN)
  5908. #endif
  5909. #if defined(RCC_SRDAMR_LPTIM3AMEN)
  5910. #define __HAL_RCC_LPTIM3_CLKAM_ENABLE() (RCC->SRDAMR) |= (RCC_SRDAMR_LPTIM3AMEN)
  5911. #endif
  5912. #if defined(DAC2)
  5913. #define __HAL_RCC_DAC2_CLKAM_ENABLE() (RCC->SRDAMR) |= (RCC_SRDAMR_DAC2AMEN)
  5914. #endif
  5915. #if defined(RCC_SRDAMR_COMP12AMEN)
  5916. #define __HAL_RCC_COMP12_CLKAM_ENABLE() (RCC->SRDAMR) |= (RCC_SRDAMR_COMP12AMEN)
  5917. #endif
  5918. #if defined(RCC_SRDAMR_VREFAMEN)
  5919. #define __HAL_RCC_VREF_CLKAM_ENABLE() (RCC->SRDAMR) |= (RCC_SRDAMR_VREFAMEN)
  5920. #endif
  5921. #if defined(RCC_SRDAMR_RTCAMEN)
  5922. #define __HAL_RCC_RTC_CLKAM_ENABLE() (RCC->SRDAMR) |= (RCC_SRDAMR_RTCAMEN)
  5923. #endif
  5924. #if defined(RCC_SRDAMR_DTSAMEN)
  5925. #define __HAL_RCC_DTS_CLKAM_ENABLE() (RCC->SRDAMR) |= (RCC_SRDAMR_DTSAMEN)
  5926. #endif
  5927. #if defined(DFSDM2_BASE)
  5928. #define __HAL_RCC_DFSDM2_CLKAM_ENABLE() (RCC->SRDAMR) |= (RCC_SRDAMR_DFSDM2AMEN)
  5929. #endif
  5930. #if defined(RCC_SRDAMR_BKPRAMAMEN)
  5931. #define __HAL_RCC_BKPRAM_CLKAM_ENABLE() (RCC->SRDAMR) |= (RCC_SRDAMR_BKPRAMAMEN)
  5932. #endif
  5933. #if defined(RCC_SRDAMR_SRDSRAMAMEN)
  5934. #define __HAL_RCC_SRDSRAM_CLKAM_ENABLE() (RCC->SRDAMR) |= (RCC_SRDAMR_SRDSRAMAMEN)
  5935. #endif
  5936. #if defined(RCC_D3AMR_BDMAAMEN)
  5937. #define __HAL_RCC_BDMA_CLKAM_DISABLE() (RCC->D3AMR) &= ~ (RCC_D3AMR_BDMAAMEN)
  5938. #endif
  5939. #if defined(RCC_D3AMR_LPUART1AMEN)
  5940. #define __HAL_RCC_LPUART1_CLKAM_DISABLE() (RCC->D3AMR) &= ~ (RCC_D3AMR_LPUART1AMEN)
  5941. #endif
  5942. #if defined(RCC_D3AMR_SPI6AMEN)
  5943. #define __HAL_RCC_SPI6_CLKAM_DISABLE() (RCC->D3AMR) &= ~ (RCC_D3AMR_SPI6AMEN)
  5944. #endif
  5945. #if defined(RCC_D3AMR_I2C4AMEN)
  5946. #define __HAL_RCC_I2C4_CLKAM_DISABLE() (RCC->D3AMR) &= ~ (RCC_D3AMR_I2C4AMEN)
  5947. #endif
  5948. #if defined(RCC_D3AMR_LPTIM2AMEN)
  5949. #define __HAL_RCC_LPTIM2_CLKAM_DISABLE() (RCC->D3AMR) &= ~ (RCC_D3AMR_LPTIM2AMEN)
  5950. #endif
  5951. #if defined(RCC_D3AMR_LPTIM3AMEN)
  5952. #define __HAL_RCC_LPTIM3_CLKAM_DISABLE() (RCC->D3AMR) &= ~ (RCC_D3AMR_LPTIM3AMEN)
  5953. #endif
  5954. #if defined(LPTIM4)
  5955. #define __HAL_RCC_LPTIM4_CLKAM_DISABLE() (RCC->D3AMR) &= ~ (RCC_D3AMR_LPTIM4AMEN)
  5956. #endif
  5957. #if defined(LPTIM5)
  5958. #define __HAL_RCC_LPTIM5_CLKAM_DISABLE() (RCC->D3AMR) &= ~ (RCC_D3AMR_LPTIM5AMEN)
  5959. #endif
  5960. #if defined(RCC_D3AMR_COMP12AMEN)
  5961. #define __HAL_RCC_COMP12_CLKAM_DISABLE() (RCC->D3AMR) &= ~ (RCC_D3AMR_COMP12AMEN)
  5962. #endif
  5963. #if defined(RCC_D3AMR_VREFAMEN)
  5964. #define __HAL_RCC_VREF_CLKAM_DISABLE() (RCC->D3AMR) &= ~ (RCC_D3AMR_VREFAMEN)
  5965. #endif
  5966. #if defined(RCC_D3AMR_RTCAMEN)
  5967. #define __HAL_RCC_RTC_CLKAM_DISABLE() (RCC->D3AMR) &= ~ (RCC_D3AMR_RTCAMEN)
  5968. #endif
  5969. #if defined(RCC_D3AMR_CRCAMEN)
  5970. #define __HAL_RCC_CRC_CLKAM_DISABLE() (RCC->D3AMR) &= ~ (RCC_D3AMR_CRCAMEN)
  5971. #endif
  5972. #if defined(SAI4)
  5973. #define __HAL_RCC_SAI4_CLKAM_DISABLE() (RCC->D3AMR) &= ~ (RCC_D3AMR_SAI4AMEN)
  5974. #endif
  5975. #if defined(ADC3)
  5976. #define __HAL_RCC_ADC3_CLKAM_DISABLE() (RCC->D3AMR) &= ~ (RCC_D3AMR_ADC3AMEN)
  5977. #endif
  5978. #if defined(RCC_D3AMR_BKPRAMAMEN)
  5979. #define __HAL_RCC_BKPRAM_CLKAM_DISABLE() (RCC->D3AMR) &= ~ (RCC_D3AMR_BKPRAMAMEN)
  5980. #endif
  5981. #if defined(RCC_D3AMR_SRAM4AMEN)
  5982. #define __HAL_RCC_D3SRAM1_CLKAM_DISABLE() (RCC->D3AMR)&= ~ (RCC_D3AMR_SRAM4AMEN)
  5983. #endif
  5984. #if defined(BDMA2)
  5985. #define __HAL_RCC_BDMA2_CLKAM_DISABLE() (RCC->SRDAMR) &= ~ (RCC_SRDAMR_BDMA2AMEN)
  5986. #endif
  5987. #if defined(RCC_SRDAMR_GPIOAMEN)
  5988. #define __HAL_RCC_GPIO_CLKAM_DISABLE() (RCC->SRDAMR) &= ~ (RCC_SRDAMR_GPIOAMEN)
  5989. #endif
  5990. #if defined(RCC_SRDAMR_LPUART1AMEN)
  5991. #define __HAL_RCC_LPUART1_CLKAM_DISABLE() (RCC->SRDAMR) &= ~ (RCC_SRDAMR_LPUART1AMEN)
  5992. #endif
  5993. #if defined(RCC_SRDAMR_SPI6AMEN)
  5994. #define __HAL_RCC_SPI6_CLKAM_DISABLE() (RCC->SRDAMR) &= ~ (RCC_SRDAMR_SPI6AMEN)
  5995. #endif
  5996. #if defined(RCC_SRDAMR_I2C4AMEN)
  5997. #define __HAL_RCC_I2C4_CLKAM_DISABLE() (RCC->SRDAMR) &= ~ (RCC_SRDAMR_I2C4AMEN)
  5998. #endif
  5999. #if defined(RCC_SRDAMR_LPTIM2AMEN)
  6000. #define __HAL_RCC_LPTIM2_CLKAM_DISABLE() (RCC->SRDAMR) &= ~ (RCC_SRDAMR_LPTIM2AMEN)
  6001. #endif
  6002. #if defined(RCC_SRDAMR_LPTIM3AMEN)
  6003. #define __HAL_RCC_LPTIM3_CLKAM_DISABLE() (RCC->SRDAMR) &= ~ (RCC_SRDAMR_LPTIM3AMEN)
  6004. #endif
  6005. #if defined(RCC_SRDAMR_DAC2AMEN)
  6006. #define __HAL_RCC_DAC2_CLKAM_DISABLE() (RCC->SRDAMR) &= ~ (RCC_SRDAMR_DAC2AMEN)
  6007. #endif
  6008. #if defined(RCC_SRDAMR_COMP12AMEN)
  6009. #define __HAL_RCC_COMP12_CLKAM_DISABLE() (RCC->SRDAMR) &= ~ (RCC_SRDAMR_COMP12AMEN)
  6010. #endif
  6011. #if defined(RCC_SRDAMR_VREFAMEN)
  6012. #define __HAL_RCC_VREF_CLKAM_DISABLE() (RCC->SRDAMR) &= ~ (RCC_SRDAMR_VREFAMEN)
  6013. #endif
  6014. #if defined(RCC_SRDAMR_RTCAMEN)
  6015. #define __HAL_RCC_RTC_CLKAM_DISABLE() (RCC->SRDAMR) &= ~(RCC_SRDAMR_RTCAMEN)
  6016. #endif
  6017. #if defined(RCC_SRDAMR_DTSAMEN)
  6018. #define __HAL_RCC_DTS_CLKAM_DISABLE() (RCC->SRDAMR) &= ~(RCC_SRDAMR_DTSAMEN)
  6019. #endif
  6020. #if defined(DFSDM2_BASE)
  6021. #define __HAL_RCC_DFSDM2_CLKAM_DISABLE() (RCC->SRDAMR) &= ~(RCC_SRDAMR_DFSDM2AMEN)
  6022. #endif
  6023. #if defined(RCC_SRDAMR_BKPRAMAMEN)
  6024. #define __HAL_RCC_BKPRAM_CLKAM_DISABLE() (RCC->SRDAMR) &= ~ (RCC_SRDAMR_BKPRAMAMEN)
  6025. #endif
  6026. #if defined(RCC_SRDAMR_SRDSRAMAMEN)
  6027. #define __HAL_RCC_SRDSRAM_CLKAM_DISABLE() (RCC->SRDAMR) &= ~ (RCC_SRDAMR_SRDSRAMAMEN)
  6028. #endif
  6029. #if defined(RCC_CKGAENR_AXICKG)
  6030. /** @brief Macro to enable or disable the RCC_CKGAENR bits (AXI clocks gating enable register).
  6031. * @note
  6032. * @note
  6033. * @note
  6034. * @param
  6035. * @note
  6036. */
  6037. #define __HAL_RCC_AXI_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_AXICKG)
  6038. #define __HAL_RCC_AHB_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_AHBCKG)
  6039. #define __HAL_RCC_CPU_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_CPUCKG)
  6040. #define __HAL_RCC_SDMMC_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_SDMMCCKG)
  6041. #define __HAL_RCC_MDMA_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_MDMACKG)
  6042. #define __HAL_RCC_DMA2D_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_DMA2DCKG)
  6043. #define __HAL_RCC_LTDC_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_LTDCCKG)
  6044. #define __HAL_RCC_GFXMMUM_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_GFXMMUMCKG)
  6045. #define __HAL_RCC_AHB12_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_AHB12CKG)
  6046. #define __HAL_RCC_AHB34_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_AHB34CKG)
  6047. #define __HAL_RCC_FLIFT_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_FLIFTCKG)
  6048. #define __HAL_RCC_OCTOSPI2_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_OCTOSPI2CKG)
  6049. #define __HAL_RCC_FMC_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_FMCCKG)
  6050. #define __HAL_RCC_OCTOSPI1_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_OCTOSPI1CKG)
  6051. #define __HAL_RCC_AXIRAM1_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_AXIRAM1CKG)
  6052. #define __HAL_RCC_AXIRAM2_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_AXIRAM2CKG)
  6053. #define __HAL_RCC_AXIRAM3_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_AXIRAM3CKG)
  6054. #define __HAL_RCC_GFXMMUS_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_GFXMMUSCKG)
  6055. #define __HAL_RCC_ECCRAM_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_ECCRAMCKG)
  6056. #define __HAL_RCC_EXTI_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_EXTICKG)
  6057. #define __HAL_RCC_JTAG_CLKGA_ENABLE() (RCC->CKGAENR) |= (RCC_CKGAENR_JTAGCKG)
  6058. #define __HAL_RCC_AXI_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_AXICKG)
  6059. #define __HAL_RCC_AHB_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_AHBCKG)
  6060. #define __HAL_RCC_CPU_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_CPUCKG)
  6061. #define __HAL_RCC_SDMMC_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_SDMMCCKG)
  6062. #define __HAL_RCC_MDMA_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_MDMACKG)
  6063. #define __HAL_RCC_DMA2D_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_DMA2DCKG)
  6064. #define __HAL_RCC_LTDC_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_LTDCCKG)
  6065. #define __HAL_RCC_GFXMMUM_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_GFXMMUMCKG)
  6066. #define __HAL_RCC_AHB12_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_AHB12CKG)
  6067. #define __HAL_RCC_AHB34_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_AHB34CKG)
  6068. #define __HAL_RCC_FLIFT_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_FLIFTCKG)
  6069. #define __HAL_RCC_OCTOSPI2_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_OCTOSPI2CKG)
  6070. #define __HAL_RCC_FMC_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_FMCCKG)
  6071. #define __HAL_RCC_OCTOSPI1_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_OCTOSPI1CKG)
  6072. #define __HAL_RCC_AXIRAM1_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_AXIRAM1CKG)
  6073. #define __HAL_RCC_AXIRAM2_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_AXIRAM2CKG)
  6074. #define __HAL_RCC_AXIRAM3_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_AXIRAM3CKG)
  6075. #define __HAL_RCC_GFXMMUS_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_GFXMMUSCKG)
  6076. #define __HAL_RCC_ECCRAM_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_ECCRAMCKG)
  6077. #define __HAL_RCC_EXTI_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_EXTICKG)
  6078. #define __HAL_RCC_JTAG_CLKGA_DISABLE() (RCC->CKGAENR) &= ~ (RCC_CKGAENR_JTAGCKG)
  6079. #endif /* RCC_CKGAENR_AXICKG */
  6080. /** @brief Macro to enable or disable the Internal High Speed oscillator (HSI).
  6081. * @note After enabling the HSI, the application software should wait on
  6082. * HSIRDY flag to be set indicating that HSI clock is stable and can
  6083. * be used to clock the PLL and/or system clock.
  6084. * @note HSI can not be stopped if it is used directly or through the PLL
  6085. * as system clock. In this case, you have to select another source
  6086. * of the system clock then stop the HSI.
  6087. * @note The HSI is stopped by hardware when entering STOP and STANDBY modes.
  6088. * @param __STATE__ specifies the new state of the HSI.
  6089. * This parameter can be one of the following values:
  6090. * @arg RCC_HSI_OFF turn OFF the HSI oscillator
  6091. * @arg RCC_HSI_ON turn ON the HSI oscillator
  6092. * @arg RCC_HSI_DIV1 turn ON the HSI oscillator and divide it by 1 (default after reset)
  6093. * @arg RCC_HSI_DIV2 turn ON the HSI oscillator and divide it by 2
  6094. * @arg RCC_HSI_DIV4 turn ON the HSI oscillator and divide it by 4
  6095. * @arg RCC_HSI_DIV8 turn ON the HSI oscillator and divide it by 8
  6096. * @note When the HSI is stopped, HSIRDY flag goes low after 6 HSI oscillator
  6097. * clock cycles.
  6098. */
  6099. #define __HAL_RCC_HSI_CONFIG(__STATE__) \
  6100. MODIFY_REG(RCC->CR, RCC_CR_HSION | RCC_CR_HSIDIV , (uint32_t)(__STATE__))
  6101. /** @brief Macro to get the HSI divider.
  6102. * @retval The HSI divider. The returned value can be one
  6103. * of the following:
  6104. * - RCC_CR_HSIDIV_1 HSI oscillator divided by 1 (default after reset)
  6105. * - RCC_CR_HSIDIV_2 HSI oscillator divided by 2
  6106. * - RCC_CR_HSIDIV_4 HSI oscillator divided by 4
  6107. * - RCC_CR_HSIDIV_8 HSI oscillator divided by 8
  6108. */
  6109. #define __HAL_RCC_GET_HSI_DIVIDER() ((uint32_t)(READ_BIT(RCC->CR, RCC_CR_HSIDIV)))
  6110. /** @brief Macros to enable or disable the Internal High Speed oscillator (HSI).
  6111. * @note The HSI is stopped by hardware when entering STOP and STANDBY modes.
  6112. * It is used (enabled by hardware) as system clock source after start-up
  6113. * from Reset, wakeup from STOP and STANDBY mode, or in case of failure
  6114. * of the HSE used directly or indirectly as system clock (if the Clock
  6115. * Security System CSS is enabled).
  6116. * @note HSI can not be stopped if it is used as system clock source. In this case,
  6117. * you have to select another source of the system clock then stop the HSI.
  6118. * @note After enabling the HSI, the application software should wait on HSIRDY
  6119. * flag to be set indicating that HSI clock is stable and can be used as
  6120. * system clock source.
  6121. * This parameter can be: ENABLE or DISABLE.
  6122. * @note When the HSI is stopped, HSIRDY flag goes low after 6 HSI oscillator
  6123. * clock cycles.
  6124. */
  6125. #define __HAL_RCC_HSI_ENABLE() SET_BIT(RCC->CR, RCC_CR_HSION)
  6126. #define __HAL_RCC_HSI_DISABLE() CLEAR_BIT(RCC->CR, RCC_CR_HSION)
  6127. /** @brief Macro to adjust the Internal High Speed oscillator (HSI) calibration value.
  6128. * @note The calibration is used to compensate for the variations in voltage
  6129. * and temperature that influence the frequency of the internal HSI RC.
  6130. * @param __HSICalibrationValue__: specifies the calibration trimming value.
  6131. * This parameter must be a number between 0 and 0x7F (3F for Rev Y device).
  6132. */
  6133. #if defined(RCC_VER_X)
  6134. #define __HAL_RCC_HSI_CALIBRATIONVALUE_ADJUST(__HSICalibrationValue__) \
  6135. do { \
  6136. if(HAL_GetREVID() <= REV_ID_Y) \
  6137. { \
  6138. MODIFY_REG(RCC->HSICFGR, HAL_RCC_REV_Y_HSITRIM_Msk, (uint32_t)(__HSICalibrationValue__) << HAL_RCC_REV_Y_HSITRIM_Pos); \
  6139. } \
  6140. else \
  6141. { \
  6142. MODIFY_REG(RCC->HSICFGR, RCC_HSICFGR_HSITRIM, (uint32_t)(__HSICalibrationValue__) << RCC_HSICFGR_HSITRIM_Pos); \
  6143. } \
  6144. } while(0)
  6145. #else
  6146. #define __HAL_RCC_HSI_CALIBRATIONVALUE_ADJUST(__HSICalibrationValue__) \
  6147. MODIFY_REG(RCC->HSICFGR, RCC_HSICFGR_HSITRIM, (uint32_t)(__HSICalibrationValue__) << RCC_HSICFGR_HSITRIM_Pos);
  6148. #endif /*RCC_VER_X*/
  6149. /**
  6150. * @brief Macros to enable or disable the force of the Internal High Speed oscillator (HSI)
  6151. * in STOP mode to be quickly available as kernel clock for some peripherals.
  6152. * @note Keeping the HSI ON in STOP mode allows to avoid slowing down the communication
  6153. * speed because of the HSI start-up time.
  6154. * @note The enable of this function has not effect on the HSION bit.
  6155. * This parameter can be: ENABLE or DISABLE.
  6156. * @retval None
  6157. */
  6158. #define __HAL_RCC_HSISTOP_ENABLE() SET_BIT(RCC->CR, RCC_CR_HSIKERON)
  6159. #define __HAL_RCC_HSISTOP_DISABLE() CLEAR_BIT(RCC->CR, RCC_CR_HSIKERON)
  6160. /**
  6161. * @brief Macro to enable or disable the Internal High Speed oscillator for USB (HSI48).
  6162. * @note After enabling the HSI48, the application software should wait on
  6163. * HSI48RDY flag to be set indicating that HSI48 clock is stable and can
  6164. * be used to clock the USB.
  6165. * @note The HSI48 is stopped by hardware when entering STOP and STANDBY modes.
  6166. */
  6167. #define __HAL_RCC_HSI48_ENABLE() SET_BIT(RCC->CR, RCC_CR_HSI48ON);
  6168. #define __HAL_RCC_HSI48_DISABLE() CLEAR_BIT(RCC->CR, RCC_CR_HSI48ON);
  6169. /**
  6170. * @brief Macros to enable or disable the Internal oscillator (CSI).
  6171. * @note The CSI is stopped by hardware when entering STOP and STANDBY modes.
  6172. * It is used (enabled by hardware) as system clock source after
  6173. * start-up from Reset, wakeup from STOP and STANDBY mode, or in case
  6174. * of failure of the HSE used directly or indirectly as system clock
  6175. * (if the Clock Security System CSS is enabled).
  6176. * @note CSI can not be stopped if it is used as system clock source.
  6177. * In this case, you have to select another source of the system
  6178. * clock then stop the CSI.
  6179. * @note After enabling the CSI, the application software should wait on
  6180. * CSIRDY flag to be set indicating that CSI clock is stable and can
  6181. * be used as system clock source.
  6182. * @note When the CSI is stopped, CSIRDY flag goes low after 6 CSI oscillator
  6183. * clock cycles.
  6184. */
  6185. #define __HAL_RCC_CSI_ENABLE() SET_BIT(RCC->CR, RCC_CR_CSION)
  6186. #define __HAL_RCC_CSI_DISABLE() CLEAR_BIT(RCC->CR, RCC_CR_CSION)
  6187. /** @brief Macro Adjusts the Internal oscillator (CSI) calibration value.
  6188. * @note The calibration is used to compensate for the variations in voltage
  6189. * and temperature that influence the frequency of the internal CSI RC.
  6190. * @param __CSICalibrationValue__: specifies the calibration trimming value.
  6191. * This parameter must be a number between 0 and 0x1F.
  6192. */
  6193. #if defined(RCC_VER_X)
  6194. #define __HAL_RCC_CSI_CALIBRATIONVALUE_ADJUST(__CSICalibrationValue__) \
  6195. do { \
  6196. if(HAL_GetREVID() <= REV_ID_Y) \
  6197. { \
  6198. MODIFY_REG(RCC->HSICFGR, HAL_RCC_REV_Y_CSITRIM_Msk, (uint32_t)(__CSICalibrationValue__) << HAL_RCC_REV_Y_CSITRIM_Pos); \
  6199. } \
  6200. else \
  6201. { \
  6202. MODIFY_REG(RCC->CSICFGR, RCC_CSICFGR_CSITRIM, (uint32_t)(__CSICalibrationValue__) << RCC_CSICFGR_CSITRIM_Pos); \
  6203. } \
  6204. } while(0)
  6205. #else
  6206. #define __HAL_RCC_CSI_CALIBRATIONVALUE_ADJUST(__CSICalibrationValue__) \
  6207. do { \
  6208. MODIFY_REG(RCC->CSICFGR, RCC_CSICFGR_CSITRIM, (uint32_t)(__CSICalibrationValue__) << RCC_CSICFGR_CSITRIM_Pos); \
  6209. } while(0)
  6210. #endif /*RCC_VER_X*/
  6211. /**
  6212. * @brief Macros to enable or disable the force of the Low-power Internal oscillator (CSI)
  6213. * in STOP mode to be quickly available as kernel clock for USARTs and I2Cs.
  6214. * @note Keeping the CSI ON in STOP mode allows to avoid slowing down the communication
  6215. * speed because of the CSI start-up time.
  6216. * @note The enable of this function has not effect on the CSION bit.
  6217. * This parameter can be: ENABLE or DISABLE.
  6218. * @retval None
  6219. */
  6220. #define __HAL_RCC_CSISTOP_ENABLE() SET_BIT(RCC->CR, RCC_CR_CSIKERON)
  6221. #define __HAL_RCC_CSISTOP_DISABLE() CLEAR_BIT(RCC->CR, RCC_CR_CSIKERON)
  6222. /** @brief Macros to enable or disable the Internal Low Speed oscillator (LSI).
  6223. * @note After enabling the LSI, the application software should wait on
  6224. * LSIRDY flag to be set indicating that LSI clock is stable and can
  6225. * be used to clock the IWDG and/or the RTC.
  6226. * @note LSI can not be disabled if the IWDG is running.
  6227. * @note When the LSI is stopped, LSIRDY flag goes low after 6 LSI oscillator
  6228. * clock cycles.
  6229. */
  6230. #define __HAL_RCC_LSI_ENABLE() SET_BIT(RCC->CSR, RCC_CSR_LSION)
  6231. #define __HAL_RCC_LSI_DISABLE() CLEAR_BIT(RCC->CSR, RCC_CSR_LSION)
  6232. /**
  6233. * @brief Macro to configure the External High Speed oscillator (__HSE__).
  6234. * @note After enabling the HSE (RCC_HSE_ON or RCC_HSE_Bypass), the application
  6235. * software should wait on HSERDY flag to be set indicating that HSE clock
  6236. * is stable and can be used to clock the PLL and/or system clock.
  6237. * @note HSE state can not be changed if it is used directly or through the
  6238. * PLL as system clock. In this case, you have to select another source
  6239. * of the system clock then change the HSE state (ex. disable it).
  6240. * @note The HSE is stopped by hardware when entering STOP and STANDBY modes.
  6241. * @note This function reset the CSSON bit, so if the clock security system(CSS)
  6242. * was previously enabled you have to enable it again after calling this
  6243. * function.
  6244. * @param __STATE__: specifies the new state of the HSE.
  6245. * This parameter can be one of the following values:
  6246. * @arg RCC_HSE_OFF: turn OFF the HSE oscillator, HSERDY flag goes low after
  6247. * 6 HSE oscillator clock cycles.
  6248. * @arg RCC_HSE_ON: turn ON the HSE oscillator.
  6249. * @arg RCC_HSE_BYPASS: HSE oscillator bypassed with external clock.
  6250. */
  6251. #if defined(RCC_CR_HSEEXT)
  6252. #define __HAL_RCC_HSE_CONFIG(__STATE__) \
  6253. do { \
  6254. if ((__STATE__) == RCC_HSE_ON) \
  6255. { \
  6256. SET_BIT(RCC->CR, RCC_CR_HSEON); \
  6257. } \
  6258. else if ((__STATE__) == RCC_HSE_OFF) \
  6259. { \
  6260. CLEAR_BIT(RCC->CR, RCC_CR_HSEON); \
  6261. CLEAR_BIT(RCC->CR, RCC_CR_HSEEXT); \
  6262. CLEAR_BIT(RCC->CR, RCC_CR_HSEBYP); \
  6263. } \
  6264. else if ((__STATE__) == RCC_HSE_BYPASS) \
  6265. { \
  6266. SET_BIT(RCC->CR, RCC_CR_HSEBYP); \
  6267. CLEAR_BIT(RCC->CR, RCC_CR_HSEEXT); \
  6268. SET_BIT(RCC->CR, RCC_CR_HSEON); \
  6269. } \
  6270. else if((__STATE__) == RCC_HSE_BYPASS_DIGITAL) \
  6271. { \
  6272. SET_BIT(RCC->CR, RCC_CR_HSEBYP); \
  6273. SET_BIT(RCC->CR, RCC_CR_HSEEXT); \
  6274. SET_BIT(RCC->CR, RCC_CR_HSEON); \
  6275. } \
  6276. else \
  6277. { \
  6278. CLEAR_BIT(RCC->CR, RCC_CR_HSEON); \
  6279. CLEAR_BIT(RCC->CR, RCC_CR_HSEBYP); \
  6280. CLEAR_BIT(RCC->CR, RCC_CR_HSEEXT); \
  6281. } \
  6282. } while(0)
  6283. #else
  6284. #define __HAL_RCC_HSE_CONFIG(__STATE__) \
  6285. do { \
  6286. if ((__STATE__) == RCC_HSE_ON) \
  6287. { \
  6288. SET_BIT(RCC->CR, RCC_CR_HSEON); \
  6289. } \
  6290. else if ((__STATE__) == RCC_HSE_OFF) \
  6291. { \
  6292. CLEAR_BIT(RCC->CR, RCC_CR_HSEON); \
  6293. CLEAR_BIT(RCC->CR, RCC_CR_HSEBYP); \
  6294. } \
  6295. else if ((__STATE__) == RCC_HSE_BYPASS) \
  6296. { \
  6297. SET_BIT(RCC->CR, RCC_CR_HSEBYP); \
  6298. SET_BIT(RCC->CR, RCC_CR_HSEON); \
  6299. } \
  6300. else \
  6301. { \
  6302. CLEAR_BIT(RCC->CR, RCC_CR_HSEON); \
  6303. CLEAR_BIT(RCC->CR, RCC_CR_HSEBYP); \
  6304. } \
  6305. } while(0)
  6306. #endif /* RCC_CR_HSEEXT */
  6307. /** @defgroup RCC_LSE_Configuration LSE Configuration
  6308. * @{
  6309. */
  6310. /**
  6311. * @brief Macro to configure the External Low Speed oscillator (LSE).
  6312. * @note Transition LSE Bypass to LSE On and LSE On to LSE Bypass are not supported by this macro.
  6313. * User should request a transition to LSE Off first and then LSE On or LSE Bypass.
  6314. * @note The external input clock can have a frequency up to 1 MHz and be low swing (analog) or digital(*).
  6315. A duty cycle close to 50% is recommended.
  6316. * @note As the LSE is in the Backup domain and write access is denied to
  6317. * this domain after reset, you have to enable write access using
  6318. * HAL_PWR_EnableBkUpAccess() function before to configure the LSE
  6319. * (to be done once after reset).
  6320. * @note After enabling the LSE (RCC_LSE_ON, RCC_LSE_BYPASS or RCC_LSE_BYPASS_DIGITAL*), the application
  6321. * software should wait on LSERDY flag to be set indicating that LSE clock
  6322. * is stable and can be used to clock the RTC.
  6323. * @note If the RTC is used, the LSE bypass must not be configured in digital mode but in low swing analog mode (*)
  6324. * @param __STATE__: specifies the new state of the LSE.
  6325. * This parameter can be one of the following values:
  6326. * @arg RCC_LSE_OFF: turn OFF the LSE oscillator, LSERDY flag goes low after
  6327. * 6 LSE oscillator clock cycles.
  6328. * @arg RCC_LSE_ON: turn ON the LSE oscillator.
  6329. * @arg RCC_LSE_BYPASS: LSE oscillator bypassed with external clock.
  6330. * @arg RCC_LSE_BYPASS_DIGITAL: LSE oscillator bypassed with external digital clock. (*)
  6331. *
  6332. * (*) Available on some STM32H7 lines only.
  6333. */
  6334. #if defined(RCC_BDCR_LSEEXT)
  6335. #define __HAL_RCC_LSE_CONFIG(__STATE__) \
  6336. do { \
  6337. if((__STATE__) == RCC_LSE_ON) \
  6338. { \
  6339. SET_BIT(RCC->BDCR, RCC_BDCR_LSEON); \
  6340. } \
  6341. else if((__STATE__) == RCC_LSE_OFF) \
  6342. { \
  6343. CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEON); \
  6344. CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEEXT); \
  6345. CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEBYP); \
  6346. } \
  6347. else if((__STATE__) == RCC_LSE_BYPASS) \
  6348. { \
  6349. SET_BIT(RCC->BDCR, RCC_BDCR_LSEBYP); \
  6350. CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEEXT); \
  6351. SET_BIT(RCC->BDCR, RCC_BDCR_LSEON); \
  6352. } \
  6353. else if((__STATE__) == RCC_LSE_BYPASS_DIGITAL) \
  6354. { \
  6355. SET_BIT(RCC->BDCR, RCC_BDCR_LSEBYP); \
  6356. SET_BIT(RCC->BDCR, RCC_BDCR_LSEEXT); \
  6357. SET_BIT(RCC->BDCR, RCC_BDCR_LSEON); \
  6358. } \
  6359. else \
  6360. { \
  6361. CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEON); \
  6362. CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEBYP); \
  6363. CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEEXT); \
  6364. } \
  6365. } while(0)
  6366. #else
  6367. #define __HAL_RCC_LSE_CONFIG(__STATE__) \
  6368. do { \
  6369. if((__STATE__) == RCC_LSE_ON) \
  6370. { \
  6371. SET_BIT(RCC->BDCR, RCC_BDCR_LSEON); \
  6372. } \
  6373. else if((__STATE__) == RCC_LSE_OFF) \
  6374. { \
  6375. CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEON); \
  6376. CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEBYP); \
  6377. } \
  6378. else if((__STATE__) == RCC_LSE_BYPASS) \
  6379. { \
  6380. SET_BIT(RCC->BDCR, RCC_BDCR_LSEBYP); \
  6381. SET_BIT(RCC->BDCR, RCC_BDCR_LSEON); \
  6382. } \
  6383. else \
  6384. { \
  6385. CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEON); \
  6386. CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEBYP); \
  6387. } \
  6388. } while(0)
  6389. #endif /* RCC_BDCR_LSEEXT */
  6390. /**
  6391. * @}
  6392. */
  6393. /** @brief Macros to enable or disable the the RTC clock.
  6394. * @note These macros must be used only after the RTC clock source was selected.
  6395. */
  6396. #define __HAL_RCC_RTC_ENABLE() SET_BIT(RCC->BDCR, RCC_BDCR_RTCEN)
  6397. #define __HAL_RCC_RTC_DISABLE() CLEAR_BIT(RCC->BDCR, RCC_BDCR_RTCEN)
  6398. /** @brief Macros to configure the RTC clock (RTCCLK).
  6399. * @note As the RTC clock configuration bits are in the Backup domain and write
  6400. * access is denied to this domain after reset, you have to enable write
  6401. * access using the Power Backup Access macro before to configure
  6402. * the RTC clock source (to be done once after reset).
  6403. * @note Once the RTC clock is configured it can't be changed unless the
  6404. * Backup domain is reset using __HAL_RCC_BackupReset_RELEASE() macro, or by
  6405. * a Power On Reset (POR).
  6406. * @param __RTCCLKSource__: specifies the RTC clock source.
  6407. * This parameter can be one of the following values:
  6408. * @arg RCC_RTCCLKSOURCE_LSE: LSE selected as RTC clock.
  6409. * @arg RCC_RTCCLKSOURCE_LSI: LSI selected as RTC clock.
  6410. * @arg RCC_RTCCLKSOURCE_HSE_DIVx: HSE clock divided by x selected
  6411. * as RTC clock, where x:[2,31]
  6412. * @note If the LSE or LSI is used as RTC clock source, the RTC continues to
  6413. * work in STOP and STANDBY modes, and can be used as wakeup source.
  6414. * However, when the HSE clock is used as RTC clock source, the RTC
  6415. * cannot be used in STOP and STANDBY modes.
  6416. * @note The maximum input clock frequency for RTC is 1MHz (when using HSE as
  6417. * RTC clock source).
  6418. */
  6419. #define __HAL_RCC_RTC_CLKPRESCALER(__RTCCLKSource__) (((__RTCCLKSource__) & RCC_BDCR_RTCSEL) == RCC_BDCR_RTCSEL) ? \
  6420. MODIFY_REG(RCC->CFGR, RCC_CFGR_RTCPRE, (((__RTCCLKSource__) & 0xFFFFCFFU) >> 4)) : CLEAR_BIT(RCC->CFGR, RCC_CFGR_RTCPRE)
  6421. #define __HAL_RCC_RTC_CONFIG(__RTCCLKSource__) do { __HAL_RCC_RTC_CLKPRESCALER(__RTCCLKSource__); \
  6422. RCC->BDCR |= ((__RTCCLKSource__) & 0x00000FFFU); \
  6423. } while (0)
  6424. #define __HAL_RCC_GET_RTC_SOURCE() ((uint32_t)(READ_BIT(RCC->BDCR, RCC_BDCR_RTCSEL)))
  6425. /** @brief Macros to force or release the Backup domain reset.
  6426. * @note This function resets the RTC peripheral (including the backup registers)
  6427. * and the RTC clock source selection in RCC_BDCR register.
  6428. * @note The BKPSRAM is not affected by this reset.
  6429. */
  6430. #define __HAL_RCC_BACKUPRESET_FORCE() SET_BIT(RCC->BDCR, RCC_BDCR_BDRST)
  6431. #define __HAL_RCC_BACKUPRESET_RELEASE() CLEAR_BIT(RCC->BDCR, RCC_BDCR_BDRST)
  6432. /** @brief Macros to enable or disable the main PLL.
  6433. * @note After enabling the main PLL, the application software should wait on
  6434. * PLLRDY flag to be set indicating that PLL clock is stable and can
  6435. * be used as system clock source.
  6436. * @note The main PLL can not be disabled if it is used as system clock source
  6437. * @note The main PLL is disabled by hardware when entering STOP and STANDBY modes.
  6438. */
  6439. #define __HAL_RCC_PLL_ENABLE() SET_BIT(RCC->CR, RCC_CR_PLL1ON)
  6440. #define __HAL_RCC_PLL_DISABLE() CLEAR_BIT(RCC->CR, RCC_CR_PLL1ON)
  6441. /**
  6442. * @brief Enables or disables each clock output (PLL_P_CLK, PLL_Q_CLK, PLL_R_CLK)
  6443. * @note Enabling/disabling those Clocks can be done only when the PLL is disabled.
  6444. * This is mainly used to save Power.
  6445. * (The ck_pll_p of the System PLL cannot be stopped if used as System Clock).
  6446. * @param __RCC_PLL1ClockOut__: specifies the PLL clock to be outputted
  6447. * This parameter can be one of the following values:
  6448. * @arg RCC_PLL1_DIVP: This clock is used to generate system clock up to 400MHZ or 280MHZ(*)
  6449. * @arg RCC_PLL1_DIVQ: This clock is used to generate peripherals clock up to 400MHZ or 280MHZ(*)
  6450. * @arg RCC_PLL1_DIVR: This clock is used to generate peripherals clock up to 400MHZ or 280MHZ(*)
  6451. *
  6452. * (*) : For stm32h7a3xx and stm32h7b3xx family lines.
  6453. *
  6454. * @retval None
  6455. */
  6456. #define __HAL_RCC_PLLCLKOUT_ENABLE(__RCC_PLL1ClockOut__) SET_BIT(RCC->PLLCFGR, (__RCC_PLL1ClockOut__))
  6457. #define __HAL_RCC_PLLCLKOUT_DISABLE(__RCC_PLL1ClockOut__) CLEAR_BIT(RCC->PLLCFGR, (__RCC_PLL1ClockOut__))
  6458. /**
  6459. * @brief Enables or disables Fractional Part Of The Multiplication Factor of PLL1 VCO
  6460. * @note Enabling/disabling Fractional Part can be any time without the need to stop the PLL1
  6461. * @retval None
  6462. */
  6463. #define __HAL_RCC_PLLFRACN_ENABLE() SET_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLL1FRACEN)
  6464. #define __HAL_RCC_PLLFRACN_DISABLE() CLEAR_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLL1FRACEN)
  6465. /**
  6466. * @brief Macro to configures the main PLL clock source, multiplication and division factors.
  6467. * @note This function must be used only when the main PLL is disabled.
  6468. *
  6469. * @param __RCC_PLLSOURCE__: specifies the PLL entry clock source.
  6470. * This parameter can be one of the following values:
  6471. * @arg RCC_PLLSOURCE_CSI: CSI oscillator clock selected as PLL clock entry
  6472. * @arg RCC_PLLSOURCE_HSI: HSI oscillator clock selected as PLL clock entry
  6473. * @arg RCC_PLLSOURCE_HSE: HSE oscillator clock selected as PLL clock entry
  6474. * @note This clock source (__RCC_PLLSource__) is common for the main PLL1 (main PLL) and PLL2 & PLL3 .
  6475. *
  6476. * @param __PLLM1__: specifies the division factor for PLL VCO input clock
  6477. * This parameter must be a number between 1 and 63.
  6478. * @note You have to set the PLLM parameter correctly to ensure that the VCO input
  6479. * frequency ranges from 1 to 16 MHz.
  6480. *
  6481. * @param __PLLN1__: specifies the multiplication factor for PLL VCO output clock
  6482. * This parameter must be a number between 4 and 512 or between 8 and 420(*).
  6483. * @note You have to set the PLLN parameter correctly to ensure that the VCO
  6484. * output frequency is between 150 and 420 MHz (when in medium VCO range) or
  6485. * between 192 and 836 MHZ or between 128 and 560 MHZ(*) (when in wide VCO range)
  6486. *
  6487. * @param __PLLP1__: specifies the division factor for system clock.
  6488. * This parameter must be a number between 2 and 128 (where odd numbers are not allowed)
  6489. *
  6490. * @param __PLLQ1__: specifies the division factor for peripheral kernel clocks
  6491. * This parameter must be a number between 1 and 128
  6492. *
  6493. * @param __PLLR1__: specifies the division factor for peripheral kernel clocks
  6494. * This parameter must be a number between 1 and 128
  6495. *
  6496. * @note To insure an optimal behavior of the PLL when one of the post-divider (DIVP, DIVQ or DIVR)
  6497. * is not used, application shall clear the enable bit (DIVyEN) and assign lowest possible
  6498. * value to __PLL1P__, __PLL1Q__ or __PLL1R__ parameters.
  6499. * @retval None
  6500. *
  6501. * (*) : For stm32h7a3xx and stm32h7b3xx family lines.
  6502. */
  6503. #define __HAL_RCC_PLL_CONFIG(__RCC_PLLSOURCE__, __PLLM1__, __PLLN1__, __PLLP1__, __PLLQ1__,__PLLR1__ ) \
  6504. do{ MODIFY_REG(RCC->PLLCKSELR, (RCC_PLLCKSELR_PLLSRC | RCC_PLLCKSELR_DIVM1) , ((__RCC_PLLSOURCE__) | ( (__PLLM1__) <<4U))); \
  6505. WRITE_REG (RCC->PLL1DIVR , ( (((__PLLN1__) - 1U )& RCC_PLL1DIVR_N1) | ((((__PLLP1__) -1U ) << 9U) & RCC_PLL1DIVR_P1) | \
  6506. ((((__PLLQ1__) -1U) << 16U)& RCC_PLL1DIVR_Q1) | ((((__PLLR1__) - 1U) << 24U)& RCC_PLL1DIVR_R1))); \
  6507. } while(0)
  6508. /** @brief Macro to configure the PLLs clock source.
  6509. * @note This function must be used only when all PLLs are disabled.
  6510. * @param __PLLSOURCE__: specifies the PLLs entry clock source.
  6511. * This parameter can be one of the following values:
  6512. * @arg RCC_PLLSOURCE_CSI: CSI oscillator clock selected as PLL clock entry
  6513. * @arg RCC_PLLSOURCE_HSI: HSI oscillator clock selected as PLL clock entry
  6514. * @arg RCC_PLLSOURCE_HSE: HSE oscillator clock selected as PLL clock entry
  6515. *
  6516. */
  6517. #define __HAL_RCC_PLL_PLLSOURCE_CONFIG(__PLLSOURCE__) MODIFY_REG(RCC->PLLCKSELR, RCC_PLLCKSELR_PLLSRC, (__PLLSOURCE__))
  6518. /**
  6519. * @brief Macro to configures the main PLL clock Fractional Part Of The Multiplication Factor
  6520. *
  6521. * @note These bits can be written at any time, allowing dynamic fine-tuning of the PLL1 VCO
  6522. *
  6523. * @param __RCC_PLL1FRACN__: specifies Fractional Part Of The Multiplication Factor for PLL1 VCO
  6524. * It should be a value between 0 and 8191
  6525. * @note Warning: The software has to set correctly these bits to insure that the VCO
  6526. * output frequency is between its valid frequency range, which is:
  6527. * 192 to 836 MHz or 128 to 560 MHz(*) if PLL1VCOSEL = 0
  6528. * 150 to 420 MHz if PLL1VCOSEL = 1.
  6529. *
  6530. * (*) : For stm32h7a3xx and stm32h7b3xx family lines.
  6531. *
  6532. * @retval None
  6533. */
  6534. #define __HAL_RCC_PLLFRACN_CONFIG(__RCC_PLL1FRACN__) MODIFY_REG(RCC->PLL1FRACR, RCC_PLL1FRACR_FRACN1, (uint32_t)(__RCC_PLL1FRACN__) << RCC_PLL1FRACR_FRACN1_Pos)
  6535. /** @brief Macro to select the PLL1 reference frequency range.
  6536. * @param __RCC_PLL1VCIRange__: specifies the PLL1 input frequency range
  6537. * This parameter can be one of the following values:
  6538. * @arg RCC_PLL1VCIRANGE_0: Range frequency is between 1 and 2 MHz
  6539. * @arg RCC_PLL1VCIRANGE_1: Range frequency is between 2 and 4 MHz
  6540. * @arg RCC_PLL1VCIRANGE_2: Range frequency is between 4 and 8 MHz
  6541. * @arg RCC_PLL1VCIRANGE_3: Range frequency is between 8 and 16 MHz
  6542. * @retval None
  6543. */
  6544. #define __HAL_RCC_PLL_VCIRANGE(__RCC_PLL1VCIRange__) \
  6545. MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLL1RGE, (__RCC_PLL1VCIRange__))
  6546. /** @brief Macro to select the PLL1 reference frequency range.
  6547. * @param __RCC_PLL1VCORange__: specifies the PLL1 input frequency range
  6548. * This parameter can be one of the following values:
  6549. * @arg RCC_PLL1VCOWIDE: Range frequency is between 192 and 836 MHz or between 128 to 560 MHz(*)
  6550. * @arg RCC_PLL1VCOMEDIUM: Range frequency is between 150 and 420 MHz
  6551. *
  6552. * (*) : For stm32h7a3xx and stm32h7b3xx family lines.
  6553. *
  6554. * @retval None
  6555. */
  6556. #define __HAL_RCC_PLL_VCORANGE(__RCC_PLL1VCORange__) \
  6557. MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLL1VCOSEL, (__RCC_PLL1VCORange__))
  6558. /** @brief Macro to get the clock source used as system clock.
  6559. * @retval The clock source used as system clock. The returned value can be one
  6560. * of the following:
  6561. * - RCC_CFGR_SWS_CSI: CSI used as system clock.
  6562. * - RCC_CFGR_SWS_HSI: HSI used as system clock.
  6563. * - RCC_CFGR_SWS_HSE: HSE used as system clock.
  6564. * - RCC_CFGR_SWS_PLL: PLL used as system clock.
  6565. */
  6566. #define __HAL_RCC_GET_SYSCLK_SOURCE() ((uint32_t)(RCC->CFGR & RCC_CFGR_SWS))
  6567. /**
  6568. * @brief Macro to configure the system clock source.
  6569. * @param __RCC_SYSCLKSOURCE__: specifies the system clock source.
  6570. * This parameter can be one of the following values:
  6571. * - RCC_SYSCLKSOURCE_HSI: HSI oscillator is used as system clock source.
  6572. * - RCC_SYSCLKSOURCE_CSI: CSI oscillator is used as system clock source.
  6573. * - RCC_SYSCLKSOURCE_HSE: HSE oscillator is used as system clock source.
  6574. * - RCC_SYSCLKSOURCE_PLLCLK: PLL output is used as system clock source.
  6575. */
  6576. #define __HAL_RCC_SYSCLK_CONFIG(__RCC_SYSCLKSOURCE__) MODIFY_REG(RCC->CFGR, RCC_CFGR_SW, (__RCC_SYSCLKSOURCE__))
  6577. /** @brief Macro to get the oscillator used as PLL clock source.
  6578. * @retval The oscillator used as PLL clock source. The returned value can be one
  6579. * of the following:
  6580. * - RCC_PLLSOURCE_NONE: No oscillator is used as PLL clock source.
  6581. * - RCC_PLLSOURCE_CSI: CSI oscillator is used as PLL clock source.
  6582. * - RCC_PLLSOURCE_HSI: HSI oscillator is used as PLL clock source.
  6583. * - RCC_PLLSOURCE_HSE: HSE oscillator is used as PLL clock source.
  6584. */
  6585. #define __HAL_RCC_GET_PLL_OSCSOURCE() ((uint32_t)(RCC->PLLCKSELR & RCC_PLLCKSELR_PLLSRC))
  6586. /** @defgroup RCCEx_MCOx_Clock_Config RCC Extended MCOx Clock Config
  6587. * @{
  6588. */
  6589. /** @brief Macro to configure the MCO1 clock.
  6590. * @param __MCOCLKSOURCE__ specifies the MCO clock source.
  6591. * This parameter can be one of the following values:
  6592. * @arg RCC_MCO1SOURCE_HSI: HSI clock selected as MCO1 source
  6593. * @arg RCC_MCO1SOURCE_LSE: LSE clock selected as MCO1 source
  6594. * @arg RCC_MCO1SOURCE_HSE: HSE clock selected as MCO1 source
  6595. * @arg RCC_MCO1SOURCE_PLL1QCLK: PLL1Q clock selected as MCO1 source
  6596. * @arg RCC_MCO1SOURCE_HSI48: HSI48 (48MHZ) selected as MCO1 source
  6597. * @param __MCODIV__ specifies the MCO clock prescaler.
  6598. * This parameter can be one of the following values:
  6599. * @arg RCC_MCODIV_1 up to RCC_MCODIV_15 : divider applied to MCO1 clock
  6600. */
  6601. #define __HAL_RCC_MCO1_CONFIG(__MCOCLKSOURCE__, __MCODIV__) \
  6602. MODIFY_REG(RCC->CFGR, (RCC_CFGR_MCO1 | RCC_CFGR_MCO1PRE), ((__MCOCLKSOURCE__) | (__MCODIV__)))
  6603. /** @brief Macro to configure the MCO2 clock.
  6604. * @param __MCOCLKSOURCE__ specifies the MCO clock source.
  6605. * This parameter can be one of the following values:
  6606. * @arg RCC_MCO2SOURCE_SYSCLK: System clock (SYSCLK) selected as MCO2 source
  6607. * @arg RCC_MCO2SOURCE_PLL2PCLK: PLL2P clock selected as MCO2 source
  6608. * @arg RCC_MCO2SOURCE_HSE: HSE clock selected as MCO2 source
  6609. * @arg RCC_MCO2SOURCE_PLLCLK: PLL1P clock selected as MCO2 source
  6610. * @arg RCC_MCO2SOURCE_CSICLK: CSI clock selected as MCO2 source
  6611. * @arg RCC_MCO2SOURCE_LSICLK: LSI clock selected as MCO2 source
  6612. * @param __MCODIV__ specifies the MCO clock prescaler.
  6613. * This parameter can be one of the following values:
  6614. * @arg RCC_MCODIV_1 up to RCC_MCODIV_15 : divider applied to MCO2 clock
  6615. */
  6616. #define __HAL_RCC_MCO2_CONFIG(__MCOCLKSOURCE__, __MCODIV__) \
  6617. MODIFY_REG(RCC->CFGR, (RCC_CFGR_MCO2 | RCC_CFGR_MCO2PRE), ((__MCOCLKSOURCE__) | ((__MCODIV__) << 7)));
  6618. /**
  6619. * @}
  6620. */
  6621. /**
  6622. * @brief Macro to configure the External Low Speed oscillator (LSE) drive capability.
  6623. * @note As the LSE is in the Backup domain and write access is denied to
  6624. * this domain after reset, you have to enable write access using
  6625. * HAL_PWR_EnableBkUpAccess() function before to configure the LSE
  6626. * (to be done once after reset).
  6627. * @note On STM32H7 Rev.B and above devices this can't be updated while LSE is ON.
  6628. * @param __LSEDRIVE__: specifies the new state of the LSE drive capability.
  6629. * This parameter can be one of the following values:
  6630. * @arg RCC_LSEDRIVE_LOW: LSE oscillator low drive capability.
  6631. * @arg RCC_LSEDRIVE_MEDIUMLOW: LSE oscillator medium low drive capability.
  6632. * @arg RCC_LSEDRIVE_MEDIUMHIGH: LSE oscillator medium high drive capability.
  6633. * @arg RCC_LSEDRIVE_HIGH: LSE oscillator high drive capability.
  6634. * @retval None
  6635. */
  6636. #if defined(RCC_VER_X)
  6637. #define __HAL_RCC_LSEDRIVE_CONFIG(__LSEDRIVE__) \
  6638. do{ \
  6639. if((HAL_GetREVID() <= REV_ID_Y) && (((__LSEDRIVE__) == RCC_LSEDRIVE_MEDIUMLOW) || ((__LSEDRIVE__) == RCC_LSEDRIVE_MEDIUMHIGH))) \
  6640. { \
  6641. MODIFY_REG(RCC->BDCR, RCC_BDCR_LSEDRV, (~(uint32_t)(__LSEDRIVE__)) & RCC_BDCR_LSEDRV_Msk); \
  6642. } \
  6643. else \
  6644. { \
  6645. MODIFY_REG(RCC->BDCR, RCC_BDCR_LSEDRV, (uint32_t)(__LSEDRIVE__)); \
  6646. } \
  6647. } while(0)
  6648. #else
  6649. #define __HAL_RCC_LSEDRIVE_CONFIG(__LSEDRIVE__) \
  6650. MODIFY_REG(RCC->BDCR, RCC_BDCR_LSEDRV, (uint32_t)(__LSEDRIVE__));
  6651. #endif /*RCC_VER_X*/
  6652. /**
  6653. * @brief Macro to configure the wake up from stop clock.
  6654. * @param __RCC_STOPWUCLK__: specifies the clock source used after wake up from stop
  6655. * This parameter can be one of the following values:
  6656. * @arg RCC_STOP_WAKEUPCLOCK_CSI: CSI selected as system clock source
  6657. * @arg RCC_STOP_WAKEUPCLOCK_HSI: HSI selected as system clock source
  6658. * @retval None
  6659. */
  6660. #define __HAL_RCC_WAKEUPSTOP_CLK_CONFIG(__RCC_STOPWUCLK__) \
  6661. MODIFY_REG(RCC->CFGR, RCC_CFGR_STOPWUCK, (__RCC_STOPWUCLK__))
  6662. /**
  6663. * @brief Macro to configure the Kernel wake up from stop clock.
  6664. * @param __RCC_STOPKERWUCLK__: specifies the Kernel clock source used after wake up from stop
  6665. * This parameter can be one of the following values:
  6666. * @arg RCC_STOP_KERWAKEUPCLOCK_CSI: CSI selected as Kernel clock source
  6667. * @arg RCC_STOP_KERWAKEUPCLOCK_HSI: HSI selected as Kernel clock source
  6668. * @retval None
  6669. */
  6670. #define __HAL_RCC_KERWAKEUPSTOP_CLK_CONFIG(__RCC_STOPKERWUCLK__) \
  6671. MODIFY_REG(RCC->CFGR, RCC_CFGR_STOPKERWUCK, (__RCC_STOPKERWUCLK__))
  6672. /** @defgroup RCC_Flags_Interrupts_Management Flags Interrupts Management
  6673. * @brief macros to manage the specified RCC Flags and interrupts.
  6674. * @{
  6675. */
  6676. /** @brief Enable RCC interrupt.
  6677. * @param __INTERRUPT__: specifies the RCC interrupt sources to be enabled.
  6678. * This parameter can be any combination of the following values:
  6679. * @arg RCC_IT_LSIRDY: LSI ready interrupt
  6680. * @arg RCC_IT_LSERDY: LSE ready interrupt
  6681. * @arg RCC_IT_CSIRDY: HSI ready interrupt
  6682. * @arg RCC_IT_HSIRDY: HSI ready interrupt
  6683. * @arg RCC_IT_HSERDY: HSE ready interrupt
  6684. * @arg RCC_IT_HSI48RDY: HSI48 ready interrupt
  6685. * @arg RCC_IT_PLLRDY: main PLL ready interrupt
  6686. * @arg RCC_IT_PLL2RDY: PLL2 ready interrupt
  6687. * @arg RCC_IT_PLL3RDY: PLL3 ready interrupt
  6688. * @arg RCC_IT_LSECSS: Clock security system interrupt
  6689. */
  6690. #define __HAL_RCC_ENABLE_IT(__INTERRUPT__) SET_BIT(RCC->CIER, (__INTERRUPT__))
  6691. /** @brief Disable RCC interrupt
  6692. * @param __INTERRUPT__: specifies the RCC interrupt sources to be disabled.
  6693. * This parameter can be any combination of the following values:
  6694. * @arg RCC_IT_LSIRDY: LSI ready interrupt
  6695. * @arg RCC_IT_LSERDY: LSE ready interrupt
  6696. * @arg RCC_IT_CSIRDY: HSI ready interrupt
  6697. * @arg RCC_IT_HSIRDY: HSI ready interrupt
  6698. * @arg RCC_IT_HSERDY: HSE ready interrupt
  6699. * @arg RCC_IT_HSI48RDY: HSI48 ready interrupt
  6700. * @arg RCC_IT_PLLRDY: main PLL ready interrupt
  6701. * @arg RCC_IT_PLL2RDY: PLL2 ready interrupt
  6702. * @arg RCC_IT_PLL3RDY: PLL3 ready interrupt
  6703. * @arg RCC_IT_LSECSS: Clock security system interrupt
  6704. */
  6705. #define __HAL_RCC_DISABLE_IT(__INTERRUPT__) CLEAR_BIT(RCC->CIER, (__INTERRUPT__))
  6706. /** @brief Clear the RCC's interrupt pending bits
  6707. * @param __INTERRUPT__: specifies the interrupt pending bit to clear.
  6708. * This parameter can be any combination of the following values:
  6709. * @arg RCC_IT_LSIRDY: LSI ready interrupt
  6710. * @arg RCC_IT_LSERDY: LSE ready interrupt
  6711. * @arg RCC_IT_CSIRDY: CSI ready interrupt
  6712. * @arg RCC_IT_HSIRDY: HSI ready interrupt
  6713. * @arg RCC_IT_HSERDY: HSE ready interrupt
  6714. * @arg RCC_IT_HSI48RDY: HSI48 ready interrupt
  6715. * @arg RCC_IT_PLLRDY: main PLL ready interrupt
  6716. * @arg RCC_IT_PLL2RDY: PLL2 ready interrupt
  6717. * @arg RCC_IT_PLL3RDY: PLL3 ready interrupt
  6718. * @arg RCC_IT_HSECSS: HSE Clock Security interrupt
  6719. * @arg RCC_IT_LSECSS: Clock security system interrupt
  6720. */
  6721. #define __HAL_RCC_CLEAR_IT(__INTERRUPT__) (RCC->CICR = (__INTERRUPT__))
  6722. /** @brief Check the RCC's interrupt has occurred or not.
  6723. * @param __INTERRUPT__: specifies the RCC interrupt source to check.
  6724. * This parameter can be any combination of the following values:
  6725. * @arg RCC_IT_LSIRDY: LSI ready interrupt
  6726. * @arg RCC_IT_LSERDY: LSE ready interrupt
  6727. * @arg RCC_IT_CSIRDY: CSI ready interrupt
  6728. * @arg RCC_IT_HSIRDY: HSI ready interrupt
  6729. * @arg RCC_IT_HSERDY: HSE ready interrupt
  6730. * @arg RCC_IT_HSI48RDY: HSI48 ready interrupt
  6731. * @arg RCC_IT_PLLRDY: main PLL ready interrupt
  6732. * @arg RCC_IT_PLL2RDY: PLL2 ready interrupt
  6733. * @arg RCC_IT_PLL3RDY: PLL3 ready interrupt
  6734. * @arg RCC_IT_HSECSS: HSE Clock Security interrupt
  6735. * @arg RCC_IT_LSECSS: Clock security system interrupt
  6736. * @retval The new state of __INTERRUPT__ (TRUE or FALSE).
  6737. */
  6738. #define __HAL_RCC_GET_IT(__INTERRUPT__) ((RCC->CIFR & (__INTERRUPT__)) == (__INTERRUPT__))
  6739. /** @brief Set RMVF bit to clear the reset flags.
  6740. */
  6741. #define __HAL_RCC_CLEAR_RESET_FLAGS() (RCC->RSR |= RCC_RSR_RMVF)
  6742. #if defined(DUAL_CORE)
  6743. #define __HAL_RCC_C1_CLEAR_RESET_FLAGS() (RCC_C1->RSR |= RCC_RSR_RMVF)
  6744. #define __HAL_RCC_C2_CLEAR_RESET_FLAGS() (RCC_C2->RSR |= RCC_RSR_RMVF)
  6745. #endif /*DUAL_CORE*/
  6746. #if defined(DUAL_CORE)
  6747. /** @brief Check RCC flag is set or not.
  6748. * @param __FLAG__: specifies the flag to check.
  6749. * This parameter can be one of the following values:
  6750. * @arg RCC_FLAG_HSIRDY: HSI oscillator clock ready
  6751. * @arg RCC_FLAG_HSIDIV: HSI divider flag
  6752. * @arg RCC_FLAG_CSIRDY: CSI oscillator clock ready
  6753. * @arg RCC_FLAG_HSI48RDY: HSI48 oscillator clock ready
  6754. * @arg RCC_FLAG_HSERDY: HSE oscillator clock ready
  6755. * @arg RCC_FLAG_D1CKRDY: Domain1 clock ready
  6756. * @arg RCC_FLAG_D2CKRDY: Domain2 clock ready
  6757. * @arg RCC_FLAG_PLLRDY: PLL1 clock ready
  6758. * @arg RCC_FLAG_PLL2RDY: PLL2 clock ready
  6759. * @arg RCC_FLAG_PLL3RDY: PLL3 clock ready
  6760. * @arg RCC_FLAG_LSERDY: LSE oscillator clock ready
  6761. * @arg RCC_FLAG_LSIRDY: LSI oscillator clock ready
  6762. * @arg RCC_FLAG_C1RST: CPU reset flag
  6763. * @arg RCC_FLAG_C2RST: CPU2 reset flag
  6764. * @arg RCC_FLAG_D1RST: D1 domain power switch reset flag
  6765. * @arg RCC_FLAG_D2RST: D2 domain power switch reset flag
  6766. * @arg RCC_FLAG_BORRST: BOR reset flag
  6767. * @arg RCC_FLAG_PINRST: Pin reset
  6768. * @arg RCC_FLAG_PORRST: POR/PDR reset
  6769. * @arg RCC_FLAG_SFTR1ST: System reset from CPU reset flag
  6770. * @arg RCC_FLAG_SFTR2ST: System reset from CPU2 reset flag
  6771. * @arg RCC_FLAG_BORRST: D2 domain power switch reset flag
  6772. * @arg RCC_FLAG_IWDG1RST: CPU Independent Watchdog reset
  6773. * @arg RCC_FLAG_IWDG2RST: CPU2 Independent Watchdog reset
  6774. * @arg RCC_FLAG_WWDG2RST: Window Watchdog2 reset
  6775. * @arg RCC_FLAG_WWDG1RST: Window Watchdog1 reset
  6776. * @arg RCC_FLAG_LPWR1RST: Reset due to illegal D1 DSTANDBY or CPU CSTOP flag
  6777. * @arg RCC_FLAG_LPWR2RST: Reset due to illegal D2 DSTANDBY or CPU2 CSTOP flag
  6778. * @retval The new state of __FLAG__ (TRUE or FALSE).
  6779. */
  6780. #define RCC_FLAG_MASK ((uint8_t)0x1F)
  6781. #define __HAL_RCC_GET_FLAG(__FLAG__) (((((((__FLAG__) >> 5U) == 1U)? RCC->CR :((((__FLAG__) >> 5U) == 2U) ? RCC->BDCR : \
  6782. ((((__FLAG__) >> 5U) == 3U)? RCC->CSR : ((((__FLAG__) >> 5U) == 4U)? RCC->RSR :RCC->CIFR)))) & (1U << ((__FLAG__) & RCC_FLAG_MASK)))!= 0U)? 1U : 0U)
  6783. #define __HAL_RCC_C1_GET_FLAG(__FLAG__) (((((((__FLAG__) >> 5U) == 1U)? RCC->CR :((((__FLAG__) >> 5U) == 2U) ? RCC->BDCR : \
  6784. ((((__FLAG__) >> 5U) == 3U)? RCC->CSR : ((((__FLAG__) >> 5U) == 4U)? RCC_C1->RSR :RCC->CIFR)))) & (1U << ((__FLAG__) & RCC_FLAG_MASK)))!= 0U)? 1U : 0U)
  6785. #define __HAL_RCC_C2_GET_FLAG(__FLAG__) (((((((__FLAG__) >> 5U) == 1U)? RCC->CR :((((__FLAG__) >> 5U) == 2U) ? RCC->BDCR : \
  6786. ((((__FLAG__) >> 5U) == 3U)? RCC->CSR : ((((__FLAG__) >> 5U) == 4U)? RCC_C2->RSR :RCC->CIFR)))) & (1U << ((__FLAG__) & RCC_FLAG_MASK)))!= 0U)? 1U : 0U)
  6787. #else
  6788. /** @brief Check RCC flag is set or not.
  6789. * @param __FLAG__: specifies the flag to check.
  6790. * This parameter can be one of the following values:
  6791. * @arg RCC_FLAG_HSIRDY: HSI oscillator clock ready
  6792. * @arg RCC_FLAG_HSIDIV: HSI divider flag
  6793. * @arg RCC_FLAG_CSIRDY: CSI oscillator clock ready
  6794. * @arg RCC_FLAG_HSI48RDY: HSI48 oscillator clock ready
  6795. * @arg RCC_FLAG_HSERDY: HSE oscillator clock ready
  6796. * @arg RCC_FLAG_D1CKRDY: Domain1 clock ready (*)
  6797. * @arg RCC_FLAG_D2CKRDY: Domain2 clock ready (*)
  6798. * @arg RCC_FLAG_CPUCKRDY: CPU Domain clock ready (CPU, APB3, bus matrix1 and related memories) (*)
  6799. * @arg RCC_FLAG_CDCKRDY: CPU Domain clock ready (*)
  6800. * @arg RCC_FLAG_PLLRDY: PLL1 clock ready
  6801. * @arg RCC_FLAG_PLL2RDY: PLL2 clock ready
  6802. * @arg RCC_FLAG_PLL3RDY: PLL3 clock ready
  6803. * @arg RCC_FLAG_LSERDY: LSE oscillator clock ready
  6804. * @arg RCC_FLAG_LSIRDY: LSI oscillator clock ready
  6805. * @arg RCC_FLAG_CPURST: CPU reset flag
  6806. * @arg RCC_FLAG_D1RST: D1 domain power switch reset flag (*)
  6807. * @arg RCC_FLAG_D2RST: D2 domain power switch reset flag (*)
  6808. * @arg RCC_FLAG_CDRST: CD domain power switch reset flag (*)
  6809. * @arg RCC_FLAG_BORRST: BOR reset flag
  6810. * @arg RCC_FLAG_PINRST: Pin reset
  6811. * @arg RCC_FLAG_PORRST: POR/PDR reset
  6812. * @arg RCC_FLAG_SFTRST: System reset from CPU reset flag
  6813. * @arg RCC_FLAG_BORRST: D2 domain power switch reset flag
  6814. * @arg RCC_FLAG_IWDG1RST: CPU Independent Watchdog reset
  6815. * @arg RCC_FLAG_WWDG1RST: Window Watchdog1 reset
  6816. * @arg RCC_FLAG_LPWR1RST: Reset due to illegal D1 DSTANDBY or CPU CSTOP flag
  6817. * @arg RCC_FLAG_LPWR2RST: Reset due to illegal D2 DSTANDBY flag
  6818. * @retval The new state of __FLAG__ (TRUE or FALSE).
  6819. *
  6820. * (*) Available on some STM32H7 lines only.
  6821. */
  6822. #define RCC_FLAG_MASK ((uint8_t)0x1F)
  6823. #define __HAL_RCC_GET_FLAG(__FLAG__) (((((((__FLAG__) >> 5U) == 1U)? RCC->CR :((((__FLAG__) >> 5U) == 2U) ? RCC->BDCR : \
  6824. ((((__FLAG__) >> 5U) == 3U)? RCC->CSR : ((((__FLAG__) >> 5U) == 4U)? RCC->RSR :RCC->CIFR)))) & (1UL << ((__FLAG__) & RCC_FLAG_MASK)))!= 0U)? 1U : 0U)
  6825. #endif /*DUAL_CORE*/
  6826. /**
  6827. * @}
  6828. */
  6829. #define RCC_GET_PLL_OSCSOURCE() ((RCC->PLLCKSELR & RCC_PLLCKSELR_PLLSRC) >> RCC_PLLCKSELR_PLLSRC_Pos)
  6830. /**
  6831. * @}
  6832. */
  6833. /* Include RCC HAL Extension module */
  6834. #include "stm32h7xx_hal_rcc_ex.h"
  6835. /* Exported functions --------------------------------------------------------*/
  6836. /** @addtogroup RCC_Exported_Functions
  6837. * @{
  6838. */
  6839. /** @addtogroup RCC_Exported_Functions_Group1
  6840. * @{
  6841. */
  6842. /* Initialization and de-initialization functions ******************************/
  6843. HAL_StatusTypeDef HAL_RCC_DeInit(void);
  6844. HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct);
  6845. HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t FLatency);
  6846. /**
  6847. * @}
  6848. */
  6849. /** @addtogroup RCC_Exported_Functions_Group2
  6850. * @{
  6851. */
  6852. /* Peripheral Control functions ************************************************/
  6853. void HAL_RCC_MCOConfig(uint32_t RCC_MCOx, uint32_t RCC_MCOSource, uint32_t RCC_MCODiv);
  6854. void HAL_RCC_EnableCSS(void);
  6855. void HAL_RCC_DisableCSS(void);
  6856. uint32_t HAL_RCC_GetSysClockFreq(void);
  6857. uint32_t HAL_RCC_GetHCLKFreq(void);
  6858. uint32_t HAL_RCC_GetPCLK1Freq(void);
  6859. uint32_t HAL_RCC_GetPCLK2Freq(void);
  6860. void HAL_RCC_GetOscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct);
  6861. void HAL_RCC_GetClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t *pFLatency);
  6862. /* CSS NMI IRQ handler */
  6863. void HAL_RCC_NMI_IRQHandler(void);
  6864. /* User Callbacks in non blocking mode (IT mode) */
  6865. void HAL_RCC_CCSCallback(void);
  6866. /**
  6867. * @}
  6868. */
  6869. /**
  6870. * @}
  6871. */
  6872. /* Private types -------------------------------------------------------------*/
  6873. /* Private variables ---------------------------------------------------------*/
  6874. /* Private constants ---------------------------------------------------------*/
  6875. /** @defgroup RCC_Private_Constants RCC Private Constants
  6876. * @{
  6877. */
  6878. #define HSE_TIMEOUT_VALUE HSE_STARTUP_TIMEOUT
  6879. #define HSI_TIMEOUT_VALUE (2U) /* 2 ms */
  6880. #define HSI48_TIMEOUT_VALUE (2U) /* 2 ms */
  6881. #define CSI_TIMEOUT_VALUE (2U) /* 2 ms */
  6882. #define LSI_TIMEOUT_VALUE (2U) /* 2 ms */
  6883. #define PLL_TIMEOUT_VALUE (2U) /* 2 ms */
  6884. #define CLOCKSWITCH_TIMEOUT_VALUE (5000U) /* 5 s */
  6885. #define RCC_DBP_TIMEOUT_VALUE (100U)
  6886. #define RCC_LSE_TIMEOUT_VALUE LSE_STARTUP_TIMEOUT
  6887. /**
  6888. * @}
  6889. */
  6890. /* Private macros ------------------------------------------------------------*/
  6891. /** @addtogroup RCC_Private_Macros RCC Private Macros
  6892. * @{
  6893. */
  6894. /** @defgroup RCC_IS_RCC_Definitions RCC Private macros to check input parameters
  6895. * @{
  6896. */
  6897. #define IS_RCC_OSCILLATORTYPE(OSCILLATOR) (((OSCILLATOR) == RCC_OSCILLATORTYPE_NONE) || \
  6898. (((OSCILLATOR) & RCC_OSCILLATORTYPE_HSE) == RCC_OSCILLATORTYPE_HSE) || \
  6899. (((OSCILLATOR) & RCC_OSCILLATORTYPE_HSI) == RCC_OSCILLATORTYPE_HSI) || \
  6900. (((OSCILLATOR) & RCC_OSCILLATORTYPE_CSI) == RCC_OSCILLATORTYPE_CSI) || \
  6901. (((OSCILLATOR) & RCC_OSCILLATORTYPE_LSI) == RCC_OSCILLATORTYPE_LSI) || \
  6902. (((OSCILLATOR) & RCC_OSCILLATORTYPE_LSE) == RCC_OSCILLATORTYPE_LSE) || \
  6903. (((OSCILLATOR) & RCC_OSCILLATORTYPE_HSI48) == RCC_OSCILLATORTYPE_HSI48))
  6904. #if defined(RCC_CR_HSEEXT)
  6905. #define IS_RCC_HSE(HSE) (((HSE) == RCC_HSE_OFF) || ((HSE) == RCC_HSE_ON) || \
  6906. ((HSE) == RCC_HSE_BYPASS) || ((HSE) == RCC_HSE_BYPASS_DIGITAL))
  6907. #else
  6908. #define IS_RCC_HSE(HSE) (((HSE) == RCC_HSE_OFF) || ((HSE) == RCC_HSE_ON) || \
  6909. ((HSE) == RCC_HSE_BYPASS))
  6910. #endif /* RCC_CR_HSEEXT */
  6911. #if defined(RCC_BDCR_LSEEXT)
  6912. #define IS_RCC_LSE(LSE) (((LSE) == RCC_LSE_OFF) || ((LSE) == RCC_LSE_ON) || \
  6913. ((LSE) == RCC_LSE_BYPASS) || ((LSE) == RCC_LSE_BYPASS_DIGITAL))
  6914. #else
  6915. #define IS_RCC_LSE(LSE) (((LSE) == RCC_LSE_OFF) || ((LSE) == RCC_LSE_ON) || \
  6916. ((LSE) == RCC_LSE_BYPASS))
  6917. #endif /* RCC_BDCR_LSEEXT */
  6918. #define IS_RCC_HSI(HSI) (((HSI) == RCC_HSI_OFF) || ((HSI) == RCC_HSI_ON) || \
  6919. ((HSI) == RCC_HSI_DIV1) || ((HSI) == RCC_HSI_DIV2) || \
  6920. ((HSI) == RCC_HSI_DIV4) || ((HSI) == RCC_HSI_DIV8))
  6921. #define IS_RCC_HSI48(HSI48) (((HSI48) == RCC_HSI48_OFF) || ((HSI48) == RCC_HSI48_ON))
  6922. #define IS_RCC_LSI(LSI) (((LSI) == RCC_LSI_OFF) || ((LSI) == RCC_LSI_ON))
  6923. #define IS_RCC_CSI(CSI) (((CSI) == RCC_CSI_OFF) || ((CSI) == RCC_CSI_ON))
  6924. #define IS_RCC_PLL(PLL) (((PLL) == RCC_PLL_NONE) ||((PLL) == RCC_PLL_OFF) || \
  6925. ((PLL) == RCC_PLL_ON))
  6926. #define IS_RCC_PLLSOURCE(SOURCE) (((SOURCE) == RCC_PLLSOURCE_CSI) || \
  6927. ((SOURCE) == RCC_PLLSOURCE_HSI) || \
  6928. ((SOURCE) == RCC_PLLSOURCE_NONE) || \
  6929. ((SOURCE) == RCC_PLLSOURCE_HSE))
  6930. #define IS_RCC_PLLM_VALUE(VALUE) ((1U <= (VALUE)) && ((VALUE) <= 63U))
  6931. #if !defined(RCC_VER_2_0)
  6932. #define IS_RCC_PLLN_VALUE(VALUE) ((4U <= (VALUE)) && ((VALUE) <= 512U))
  6933. #else
  6934. #define IS_RCC_PLLN_VALUE(VALUE) ((8U <= (VALUE)) && ((VALUE) <= 420U))
  6935. #endif /* !RCC_VER_2_0 */
  6936. #define IS_RCC_PLLP_VALUE(VALUE) ((1U <= (VALUE)) && ((VALUE) <= 128U))
  6937. #define IS_RCC_PLLQ_VALUE(VALUE) ((1U <= (VALUE)) && ((VALUE) <= 128U))
  6938. #define IS_RCC_PLLR_VALUE(VALUE) ((1U <= (VALUE)) && ((VALUE) <= 128U))
  6939. #define IS_RCC_PLLCLOCKOUT_VALUE(VALUE) (((VALUE) == RCC_PLL1_DIVP) || \
  6940. ((VALUE) == RCC_PLL1_DIVQ) || \
  6941. ((VALUE) == RCC_PLL1_DIVR))
  6942. #define IS_RCC_CLOCKTYPE(CLK) ((1U <= (CLK)) && ((CLK) <= 0x3FU))
  6943. #define IS_RCC_SYSCLKSOURCE(SOURCE) (((SOURCE) == RCC_SYSCLKSOURCE_CSI) || \
  6944. ((SOURCE) == RCC_SYSCLKSOURCE_HSI) || \
  6945. ((SOURCE) == RCC_SYSCLKSOURCE_HSE) || \
  6946. ((SOURCE) == RCC_SYSCLKSOURCE_PLLCLK))
  6947. #define IS_RCC_SYSCLK(SYSCLK) (((SYSCLK) == RCC_SYSCLK_DIV1) || ((SYSCLK) == RCC_SYSCLK_DIV2) || \
  6948. ((SYSCLK) == RCC_SYSCLK_DIV4) || ((SYSCLK) == RCC_SYSCLK_DIV8) || \
  6949. ((SYSCLK) == RCC_SYSCLK_DIV16) || ((SYSCLK) == RCC_SYSCLK_DIV64) || \
  6950. ((SYSCLK) == RCC_SYSCLK_DIV128) || ((SYSCLK) == RCC_SYSCLK_DIV256) || \
  6951. ((SYSCLK) == RCC_SYSCLK_DIV512))
  6952. #define IS_RCC_HCLK(HCLK) (((HCLK) == RCC_HCLK_DIV1) || ((HCLK) == RCC_HCLK_DIV2) || \
  6953. ((HCLK) == RCC_HCLK_DIV4) || ((HCLK) == RCC_HCLK_DIV8) || \
  6954. ((HCLK) == RCC_HCLK_DIV16) || ((HCLK) == RCC_HCLK_DIV64) || \
  6955. ((HCLK) == RCC_HCLK_DIV128) || ((HCLK) == RCC_HCLK_DIV256) || \
  6956. ((HCLK) == RCC_HCLK_DIV512))
  6957. #define IS_RCC_CDPCLK1(CDPCLK1) (((CDPCLK1) == RCC_APB3_DIV1) || ((CDPCLK1) == RCC_APB3_DIV2) || \
  6958. ((CDPCLK1) == RCC_APB3_DIV4) || ((CDPCLK1) == RCC_APB3_DIV8) || \
  6959. ((CDPCLK1) == RCC_APB3_DIV16))
  6960. #define IS_RCC_D1PCLK1 IS_RCC_CDPCLK1 /* for legacy compatibility between H7 lines */
  6961. #define IS_RCC_PCLK1(PCLK1) (((PCLK1) == RCC_APB1_DIV1) || ((PCLK1) == RCC_APB1_DIV2) || \
  6962. ((PCLK1) == RCC_APB1_DIV4) || ((PCLK1) == RCC_APB1_DIV8) || \
  6963. ((PCLK1) == RCC_APB1_DIV16))
  6964. #define IS_RCC_PCLK2(PCLK2) (((PCLK2) == RCC_APB2_DIV1) || ((PCLK2) == RCC_APB2_DIV2) || \
  6965. ((PCLK2) == RCC_APB2_DIV4) || ((PCLK2) == RCC_APB2_DIV8) || \
  6966. ((PCLK2) == RCC_APB2_DIV16))
  6967. #define IS_RCC_SRDPCLK1(SRDPCLK1) (((SRDPCLK1) == RCC_APB4_DIV1) || ((SRDPCLK1) == RCC_APB4_DIV2) || \
  6968. ((SRDPCLK1) == RCC_APB4_DIV4) || ((SRDPCLK1) == RCC_APB4_DIV8) || \
  6969. ((SRDPCLK1) == RCC_APB4_DIV16))
  6970. #define IS_RCC_D3PCLK1 IS_RCC_SRDPCLK1 /* for legacy compatibility between H7 lines*/
  6971. #define IS_RCC_RTCCLKSOURCE(SOURCE) (((SOURCE) == RCC_RTCCLKSOURCE_LSE) || ((SOURCE) == RCC_RTCCLKSOURCE_LSI) || \
  6972. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV2) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV3) || \
  6973. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV4) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV5) || \
  6974. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV6) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV7) || \
  6975. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV8) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV9) || \
  6976. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV10) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV11) || \
  6977. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV12) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV13) || \
  6978. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV14) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV15) || \
  6979. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV16) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV17) || \
  6980. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV18) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV19) || \
  6981. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV20) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV21) || \
  6982. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV22) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV23) || \
  6983. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV24) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV25) || \
  6984. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV26) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV27) || \
  6985. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV28) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV29) || \
  6986. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV30) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV31) || \
  6987. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV32) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV33) || \
  6988. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV34) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV35) || \
  6989. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV36) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV37) || \
  6990. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV38) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV39) || \
  6991. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV40) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV41) || \
  6992. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV42) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV43) || \
  6993. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV44) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV45) || \
  6994. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV46) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV47) || \
  6995. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV48) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV49) || \
  6996. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV50) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV51) || \
  6997. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV52) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV53) || \
  6998. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV54) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV55) || \
  6999. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV56) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV57) || \
  7000. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV58) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV59) || \
  7001. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV60) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV61) || \
  7002. ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV62) || ((SOURCE) == RCC_RTCCLKSOURCE_HSE_DIV63))
  7003. #define IS_RCC_MCO(MCOx) (((MCOx) == RCC_MCO1) || ((MCOx) == RCC_MCO2))
  7004. #define IS_RCC_MCO1SOURCE(SOURCE) (((SOURCE) == RCC_MCO1SOURCE_HSI) || ((SOURCE) == RCC_MCO1SOURCE_LSE) || \
  7005. ((SOURCE) == RCC_MCO1SOURCE_HSE) || ((SOURCE) == RCC_MCO1SOURCE_PLL1QCLK) || \
  7006. ((SOURCE) == RCC_MCO1SOURCE_HSI48))
  7007. #define IS_RCC_MCO2SOURCE(SOURCE) (((SOURCE) == RCC_MCO2SOURCE_SYSCLK) || ((SOURCE) == RCC_MCO2SOURCE_PLL2PCLK) || \
  7008. ((SOURCE) == RCC_MCO2SOURCE_HSE) || ((SOURCE) == RCC_MCO2SOURCE_PLLCLK) || \
  7009. ((SOURCE) == RCC_MCO2SOURCE_CSICLK) || ((SOURCE) == RCC_MCO2SOURCE_LSICLK))
  7010. #define IS_RCC_MCODIV(DIV) (((DIV) == RCC_MCODIV_1) || ((DIV) == RCC_MCODIV_2) || \
  7011. ((DIV) == RCC_MCODIV_3) || ((DIV) == RCC_MCODIV_4) || \
  7012. ((DIV) == RCC_MCODIV_5) || ((DIV) == RCC_MCODIV_6) || \
  7013. ((DIV) == RCC_MCODIV_7) || ((DIV) == RCC_MCODIV_8) || \
  7014. ((DIV) == RCC_MCODIV_9) || ((DIV) == RCC_MCODIV_10) || \
  7015. ((DIV) == RCC_MCODIV_11) || ((DIV) == RCC_MCODIV_12) || \
  7016. ((DIV) == RCC_MCODIV_13) || ((DIV) == RCC_MCODIV_14) || \
  7017. ((DIV) == RCC_MCODIV_15))
  7018. #if defined(DUAL_CORE)
  7019. #define IS_RCC_FLAG(FLAG) (((FLAG) == RCC_FLAG_HSIRDY) || ((FLAG) == RCC_FLAG_CSIRDY) || \
  7020. ((FLAG) == RCC_FLAG_HSI48RDY) || ((FLAG) == RCC_FLAG_HSERDY) || \
  7021. ((FLAG) == RCC_FLAG_D1CKRDY) || ((FLAG) == RCC_FLAG_D2CKRDY) || \
  7022. ((FLAG) == RCC_FLAG_PLLRDY) || ((FLAG) == RCC_FLAG_PLL2RDY) || \
  7023. ((FLAG) == RCC_FLAG_PLL3RDY) || ((FLAG) == RCC_FLAG_LSERDY) || \
  7024. ((FLAG) == RCC_FLAG_LSIRDY) || \
  7025. ((FLAG) == RCC_FLAG_C1RST) || ((FLAG) == RCC_FLAG_C2RST) || \
  7026. ((FLAG) == RCC_FLAG_SFTR2ST) || ((FLAG) == RCC_FLAG_WWDG2RST)|| \
  7027. ((FLAG) == RCC_FLAG_IWDG2RST) || ((FLAG) == RCC_FLAG_D1RST) || \
  7028. ((FLAG) == RCC_FLAG_D2RST) || ((FLAG) == RCC_FLAG_BORRST) || \
  7029. ((FLAG) == RCC_FLAG_PINRST) || ((FLAG) == RCC_FLAG_PORRST) || \
  7030. ((FLAG) == RCC_FLAG_SFTR1ST) || ((FLAG) == RCC_FLAG_IWDG1RST)|| \
  7031. ((FLAG) == RCC_FLAG_WWDG1RST) || ((FLAG) == RCC_FLAG_LPWR1RST)|| \
  7032. ((FLAG) == RCC_FLAG_LPWR2RST) || ((FLAG) == RCC_FLAG_HSIDIV))
  7033. #else
  7034. #if defined(RCC_CR_D2CKRDY)
  7035. #define IS_RCC_FLAG(FLAG) (((FLAG) == RCC_FLAG_HSIRDY) || ((FLAG) == RCC_FLAG_CSIRDY) || \
  7036. ((FLAG) == RCC_FLAG_HSI48RDY) || ((FLAG) == RCC_FLAG_HSERDY) || \
  7037. ((FLAG) == RCC_FLAG_D1CKRDY) || ((FLAG) == RCC_FLAG_D2CKRDY) || \
  7038. ((FLAG) == RCC_FLAG_PLLRDY) || ((FLAG) == RCC_FLAG_PLL2RDY) || \
  7039. ((FLAG) == RCC_FLAG_PLL3RDY) || ((FLAG) == RCC_FLAG_LSERDY) || \
  7040. ((FLAG) == RCC_FLAG_LSIRDY) || \
  7041. ((FLAG) == RCC_FLAG_CPURST) || ((FLAG) == RCC_FLAG_D1RST) || \
  7042. ((FLAG) == RCC_FLAG_D2RST) || ((FLAG) == RCC_FLAG_BORRST) || \
  7043. ((FLAG) == RCC_FLAG_PINRST) || ((FLAG) == RCC_FLAG_PORRST) || \
  7044. ((FLAG) == RCC_FLAG_SFTRST) || ((FLAG) == RCC_FLAG_IWDG1RST)|| \
  7045. ((FLAG) == RCC_FLAG_WWDG1RST) || ((FLAG) == RCC_FLAG_LPWR1RST)|| \
  7046. ((FLAG) == RCC_FLAG_LPWR2RST) || ((FLAG) == RCC_FLAG_HSIDIV ))
  7047. #else
  7048. #define IS_RCC_FLAG(FLAG) (((FLAG) == RCC_FLAG_HSIRDY) || ((FLAG) == RCC_FLAG_CSIRDY) || \
  7049. ((FLAG) == RCC_FLAG_HSI48RDY) || ((FLAG) == RCC_FLAG_HSERDY) || \
  7050. ((FLAG) == RCC_FLAG_CPUCKRDY) || ((FLAG) == RCC_FLAG_CDCKRDY) || \
  7051. ((FLAG) == RCC_FLAG_PLLRDY) || ((FLAG) == RCC_FLAG_PLL2RDY) || \
  7052. ((FLAG) == RCC_FLAG_PLL3RDY) || ((FLAG) == RCC_FLAG_LSERDY) || \
  7053. ((FLAG) == RCC_FLAG_LSIRDY) || \
  7054. ((FLAG) == RCC_FLAG_CDRST) || ((FLAG) == RCC_FLAG_BORRST) || \
  7055. ((FLAG) == RCC_FLAG_PINRST) || ((FLAG) == RCC_FLAG_PORRST) || \
  7056. ((FLAG) == RCC_FLAG_SFTRST) || ((FLAG) == RCC_FLAG_IWDG1RST)|| \
  7057. ((FLAG) == RCC_FLAG_WWDG1RST) || ((FLAG) == RCC_FLAG_LPWR1RST)|| \
  7058. ((FLAG) == RCC_FLAG_LPWR2RST) || ((FLAG) == RCC_FLAG_HSIDIV ))
  7059. #endif /* RCC_CR_D2CKRDY */
  7060. #endif /*DUAL_CORE*/
  7061. #define IS_RCC_HSICALIBRATION_VALUE(VALUE) ((VALUE) <= 0x7FU)
  7062. #define IS_RCC_CSICALIBRATION_VALUE(VALUE) ((VALUE) <= 0x3FU)
  7063. #define IS_RCC_STOP_WAKEUPCLOCK(SOURCE) (((SOURCE) == RCC_STOP_WAKEUPCLOCK_CSI) || \
  7064. ((SOURCE) == RCC_STOP_WAKEUPCLOCK_HSI))
  7065. #define IS_RCC_STOP_KERWAKEUPCLOCK(SOURCE) (((SOURCE) == RCC_STOP_KERWAKEUPCLOCK_CSI) || \
  7066. ((SOURCE) == RCC_STOP_KERWAKEUPCLOCK_HSI))
  7067. /**
  7068. * @}
  7069. */
  7070. /**
  7071. * @}
  7072. */
  7073. /**
  7074. * @}
  7075. */
  7076. /**
  7077. * @}
  7078. */
  7079. #ifdef __cplusplus
  7080. }
  7081. #endif
  7082. #endif /* STM32H7xx_HAL_RCC_H */
  7083. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/