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.
 
 
 

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