Implement a secure ICS protocol targeting LoRa Node151 microcontroller for controlling irrigation.
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.
 
 
 
 
 
 

1031 lines
54 KiB

  1. /**
  2. ******************************************************************************
  3. * @file stm32l1xx_hal_rcc_ex.h
  4. * @author MCD Application Team
  5. * @brief Header file of RCC HAL Extension 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 __STM32L1xx_HAL_RCC_EX_H
  21. #define __STM32L1xx_HAL_RCC_EX_H
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. /* Includes ------------------------------------------------------------------*/
  26. #include "stm32l1xx_hal_def.h"
  27. /** @addtogroup STM32L1xx_HAL_Driver
  28. * @{
  29. */
  30. /** @addtogroup RCCEx
  31. * @{
  32. */
  33. /** @addtogroup RCCEx_Private_Constants
  34. * @{
  35. */
  36. #if defined(STM32L100xBA) || defined(STM32L151xBA) || defined(STM32L152xBA)\
  37. || defined(STM32L100xC) || defined(STM32L151xC) || defined(STM32L152xC)\
  38. || defined(STM32L162xC) || defined(STM32L151xCA) || defined(STM32L151xD)\
  39. || defined(STM32L152xCA) || defined(STM32L152xD) || defined(STM32L162xCA)\
  40. || defined(STM32L162xD) || defined(STM32L151xE) || defined(STM32L151xDX)\
  41. || defined(STM32L152xE) || defined(STM32L152xDX) || defined(STM32L162xE) || defined(STM32L162xDX)
  42. /* Alias word address of LSECSSON bit */
  43. #define LSECSSON_BITNUMBER RCC_CSR_LSECSSON_Pos
  44. #define CSR_LSECSSON_BB ((uint32_t)(PERIPH_BB_BASE + (RCC_CSR_OFFSET_BB * 32U) + (LSECSSON_BITNUMBER * 4U)))
  45. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX*/
  46. /**
  47. * @}
  48. */
  49. /** @addtogroup RCCEx_Private_Macros
  50. * @{
  51. */
  52. #if defined(LCD)
  53. #define IS_RCC_PERIPHCLOCK(__CLK__) ((RCC_PERIPHCLK_RTC <= (__CLK__)) && ((__CLK__) <= RCC_PERIPHCLK_LCD))
  54. #else /* Not LCD LINE */
  55. #define IS_RCC_PERIPHCLOCK(__CLK__) ((__CLK__) == RCC_PERIPHCLK_RTC)
  56. #endif /* LCD */
  57. /**
  58. * @}
  59. */
  60. /* Exported types ------------------------------------------------------------*/
  61. /** @defgroup RCCEx_Exported_Types RCCEx Exported Types
  62. * @{
  63. */
  64. /**
  65. * @brief RCC extended clocks structure definition
  66. */
  67. typedef struct
  68. {
  69. uint32_t PeriphClockSelection; /*!< The Extended Clock to be configured.
  70. This parameter can be a value of @ref RCCEx_Periph_Clock_Selection */
  71. uint32_t RTCClockSelection; /*!< specifies the RTC clock source.
  72. This parameter can be a value of @ref RCC_RTC_LCD_Clock_Source */
  73. #if defined(LCD)
  74. uint32_t LCDClockSelection; /*!< specifies the LCD clock source.
  75. This parameter can be a value of @ref RCC_RTC_LCD_Clock_Source */
  76. #endif /* LCD */
  77. } RCC_PeriphCLKInitTypeDef;
  78. /**
  79. * @}
  80. */
  81. /* Exported constants --------------------------------------------------------*/
  82. /** @defgroup RCCEx_Exported_Constants RCCEx Exported Constants
  83. * @{
  84. */
  85. /** @defgroup RCCEx_Periph_Clock_Selection RCCEx Periph Clock Selection
  86. * @{
  87. */
  88. #define RCC_PERIPHCLK_RTC (0x00000001U)
  89. #if defined(LCD)
  90. #define RCC_PERIPHCLK_LCD (0x00000002U)
  91. #endif /* LCD */
  92. /**
  93. * @}
  94. */
  95. #if defined(RCC_LSECSS_SUPPORT)
  96. /** @defgroup RCCEx_EXTI_LINE_LSECSS RCC LSE CSS external interrupt line
  97. * @{
  98. */
  99. #define RCC_EXTI_LINE_LSECSS (EXTI_IMR_IM19) /*!< External interrupt line 19 connected to the LSE CSS EXTI Line */
  100. /**
  101. * @}
  102. */
  103. #endif /* RCC_LSECSS_SUPPORT */
  104. /**
  105. * @}
  106. */
  107. /* Exported macro ------------------------------------------------------------*/
  108. /** @defgroup RCCEx_Exported_Macros RCCEx Exported Macros
  109. * @{
  110. */
  111. /** @defgroup RCCEx_Peripheral_Clock_Enable_Disable RCCEx_Peripheral_Clock_Enable_Disable
  112. * @brief Enables or disables the AHB1 peripheral clock.
  113. * @note After reset, the peripheral clock (used for registers read/write access)
  114. * is disabled and the application software has to enable this clock before
  115. * using it.
  116. * @{
  117. */
  118. #if defined(STM32L151xB) || defined(STM32L152xB) || defined(STM32L151xBA)\
  119. || defined(STM32L152xBA) || defined(STM32L151xC) || defined(STM32L152xC)\
  120. || defined(STM32L162xC) || defined(STM32L151xCA) || defined(STM32L151xD)\
  121. || defined(STM32L152xCA) || defined(STM32L152xD) || defined(STM32L162xCA)\
  122. || defined(STM32L162xD) || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX)\
  123. || defined(STM32L162xE) || defined(STM32L162xDX)
  124. #define __HAL_RCC_GPIOE_CLK_ENABLE() do { \
  125. __IO uint32_t tmpreg; \
  126. SET_BIT(RCC->AHBENR, RCC_AHBENR_GPIOEEN);\
  127. /* Delay after an RCC peripheral clock enabling */ \
  128. tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_GPIOEEN);\
  129. UNUSED(tmpreg); \
  130. } while(0U)
  131. #define __HAL_RCC_GPIOE_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_GPIOEEN))
  132. #endif /* STM32L151xB || STM32L152xB || ... || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  133. #if defined(STM32L151xCA) || defined(STM32L151xD) || defined(STM32L152xCA)\
  134. || defined(STM32L152xD) || defined(STM32L162xCA) || defined(STM32L162xD)\
  135. || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX) || defined(STM32L162xE) || defined(STM32L162xDX)
  136. #define __HAL_RCC_GPIOF_CLK_ENABLE() do { \
  137. __IO uint32_t tmpreg; \
  138. SET_BIT(RCC->AHBENR, RCC_AHBENR_GPIOFEN);\
  139. /* Delay after an RCC peripheral clock enabling */ \
  140. tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_GPIOFEN);\
  141. UNUSED(tmpreg); \
  142. } while(0U)
  143. #define __HAL_RCC_GPIOG_CLK_ENABLE() do { \
  144. __IO uint32_t tmpreg; \
  145. SET_BIT(RCC->AHBENR, RCC_AHBENR_GPIOGEN);\
  146. /* Delay after an RCC peripheral clock enabling */ \
  147. tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_GPIOGEN);\
  148. UNUSED(tmpreg); \
  149. } while(0U)
  150. #define __HAL_RCC_GPIOF_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_GPIOFEN))
  151. #define __HAL_RCC_GPIOG_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_GPIOGEN))
  152. #endif /* STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  153. #if defined(STM32L100xC) || defined(STM32L151xC) || defined(STM32L152xC)\
  154. || defined(STM32L162xC) || defined(STM32L151xCA) || defined(STM32L151xD)\
  155. || defined(STM32L152xCA) || defined(STM32L152xD) || defined(STM32L162xCA)\
  156. || defined(STM32L162xD) || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX)\
  157. || defined(STM32L162xE) || defined(STM32L162xDX)
  158. #define __HAL_RCC_DMA2_CLK_ENABLE() do { \
  159. __IO uint32_t tmpreg; \
  160. SET_BIT(RCC->AHBENR, RCC_AHBENR_DMA2EN);\
  161. /* Delay after an RCC peripheral clock enabling */ \
  162. tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_DMA2EN);\
  163. UNUSED(tmpreg); \
  164. } while(0U)
  165. #define __HAL_RCC_DMA2_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_DMA2EN))
  166. #endif /* STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  167. #if defined(STM32L162xC) || defined(STM32L162xCA) || defined(STM32L162xD)\
  168. || defined(STM32L162xE) || defined(STM32L162xDX)
  169. #define __HAL_RCC_AES_CLK_ENABLE() do { \
  170. __IO uint32_t tmpreg; \
  171. SET_BIT(RCC->AHBENR, RCC_AHBENR_AESEN);\
  172. /* Delay after an RCC peripheral clock enabling */ \
  173. tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_AESEN);\
  174. UNUSED(tmpreg); \
  175. } while(0U)
  176. #define __HAL_RCC_AES_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_AESEN))
  177. #endif /* STM32L162xC || STM32L162xCA || STM32L162xD || STM32L162xE || STM32L162xDX */
  178. #if defined(STM32L151xD) || defined(STM32L152xD) || defined(STM32L162xD)
  179. #define __HAL_RCC_FSMC_CLK_ENABLE() do { \
  180. __IO uint32_t tmpreg; \
  181. SET_BIT(RCC->AHBENR, RCC_AHBENR_FSMCEN);\
  182. /* Delay after an RCC peripheral clock enabling */ \
  183. tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_FSMCEN);\
  184. UNUSED(tmpreg); \
  185. } while(0U)
  186. #define __HAL_RCC_FSMC_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_FSMCEN))
  187. #endif /* STM32L151xD || STM32L152xD || STM32L162xD */
  188. #if defined(STM32L100xB) || defined(STM32L100xBA) || defined(STM32L100xC)\
  189. || defined(STM32L152xB) || defined(STM32L152xBA) || defined(STM32L152xC)\
  190. || defined(STM32L162xC) || defined(STM32L152xCA) || defined(STM32L152xD)\
  191. || defined(STM32L162xCA) || defined(STM32L162xD) || defined(STM32L152xE) || defined(STM32L152xDX)\
  192. || defined(STM32L162xE) || defined(STM32L162xDX)
  193. #define __HAL_RCC_LCD_CLK_ENABLE() do { \
  194. __IO uint32_t tmpreg; \
  195. SET_BIT(RCC->APB1ENR, RCC_APB1ENR_LCDEN);\
  196. /* Delay after an RCC peripheral clock enabling */ \
  197. tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_LCDEN);\
  198. UNUSED(tmpreg); \
  199. } while(0U)
  200. #define __HAL_RCC_LCD_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_LCDEN))
  201. #endif /* STM32L100xB || STM32L152xBA || ... || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  202. /** @brief Enables or disables the Low Speed APB (APB1) peripheral clock.
  203. * @note After reset, the peripheral clock (used for registers read/write access)
  204. * is disabled and the application software has to enable this clock before
  205. * using it.
  206. */
  207. #if defined(STM32L151xC) || defined(STM32L152xC) || defined(STM32L162xC)\
  208. || defined(STM32L151xCA) || defined(STM32L151xD) || defined(STM32L152xCA)\
  209. || defined(STM32L152xD) || defined(STM32L162xCA) || defined(STM32L162xD)\
  210. || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX) || defined(STM32L162xE) || defined(STM32L162xDX)
  211. #define __HAL_RCC_TIM5_CLK_ENABLE() do { \
  212. __IO uint32_t tmpreg; \
  213. SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM5EN);\
  214. /* Delay after an RCC peripheral clock enabling */ \
  215. tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM5EN);\
  216. UNUSED(tmpreg); \
  217. } while(0U)
  218. #define __HAL_RCC_TIM5_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM5EN))
  219. #endif /* STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  220. #if defined(STM32L100xC) || defined(STM32L151xC) || defined(STM32L152xC)\
  221. || defined(STM32L162xC) || defined(STM32L151xCA) || defined(STM32L151xD)\
  222. || defined(STM32L152xCA) || defined(STM32L152xD) || defined(STM32L162xCA)\
  223. || defined(STM32L162xD) || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX)\
  224. || defined(STM32L162xE) || defined(STM32L162xDX)
  225. #define __HAL_RCC_SPI3_CLK_ENABLE() do { \
  226. __IO uint32_t tmpreg; \
  227. SET_BIT(RCC->APB1ENR, RCC_APB1ENR_SPI3EN);\
  228. /* Delay after an RCC peripheral clock enabling */ \
  229. tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_SPI3EN);\
  230. UNUSED(tmpreg); \
  231. } while(0U)
  232. #define __HAL_RCC_SPI3_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_SPI3EN))
  233. #endif /* STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  234. #if defined(STM32L151xD) || defined(STM32L152xD) || defined(STM32L162xD)\
  235. || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX) || defined(STM32L162xE) || defined(STM32L162xDX)
  236. #define __HAL_RCC_UART4_CLK_ENABLE() do { \
  237. __IO uint32_t tmpreg; \
  238. SET_BIT(RCC->APB1ENR, RCC_APB1ENR_UART4EN);\
  239. /* Delay after an RCC peripheral clock enabling */ \
  240. tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_UART4EN);\
  241. UNUSED(tmpreg); \
  242. } while(0U)
  243. #define __HAL_RCC_UART5_CLK_ENABLE() do { \
  244. __IO uint32_t tmpreg; \
  245. SET_BIT(RCC->APB1ENR, RCC_APB1ENR_UART5EN);\
  246. /* Delay after an RCC peripheral clock enabling */ \
  247. tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_UART5EN);\
  248. UNUSED(tmpreg); \
  249. } while(0U)
  250. #define __HAL_RCC_UART4_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_UART4EN))
  251. #define __HAL_RCC_UART5_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_UART5EN))
  252. #endif /* STM32L151xD || STM32L152xD || STM32L162xD || (...) || STM32L152xDX || STM32L162xE || STM32L162xDX */
  253. #if defined(STM32L151xCA) || defined(STM32L151xD) || defined(STM32L152xCA)\
  254. || defined(STM32L152xD) || defined(STM32L162xCA) || defined(STM32L162xD)\
  255. || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE)\
  256. || defined(STM32L152xDX) || defined(STM32L162xE) || defined(STM32L162xDX)\
  257. || defined(STM32L162xC) || defined(STM32L152xC) || defined(STM32L151xC)
  258. #define __HAL_RCC_OPAMP_CLK_ENABLE() __HAL_RCC_COMP_CLK_ENABLE() /* Peripherals COMP and OPAMP share the same clock domain */
  259. #define __HAL_RCC_OPAMP_CLK_DISABLE() __HAL_RCC_COMP_CLK_DISABLE() /* Peripherals COMP and OPAMP share the same clock domain */
  260. #endif /* STM32L151xCA || STM32L151xD || STM32L152xCA || (...) || STM32L162xC || STM32L152xC || STM32L151xC */
  261. /** @brief Enables or disables the High Speed APB (APB2) peripheral clock.
  262. * @note After reset, the peripheral clock (used for registers read/write access)
  263. * is disabled and the application software has to enable this clock before
  264. * using it.
  265. */
  266. #if defined(STM32L151xD) || defined(STM32L152xD) || defined(STM32L162xD)
  267. #define __HAL_RCC_SDIO_CLK_ENABLE() do { \
  268. __IO uint32_t tmpreg; \
  269. SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SDIOEN);\
  270. /* Delay after an RCC peripheral clock enabling */ \
  271. tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SDIOEN);\
  272. UNUSED(tmpreg); \
  273. } while(0U)
  274. #define __HAL_RCC_SDIO_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_SDIOEN))
  275. #endif /* STM32L151xD || STM32L152xD || STM32L162xD */
  276. /**
  277. * @}
  278. */
  279. /** @defgroup RCCEx_Force_Release_Peripheral_Reset RCCEx Force Release Peripheral Reset
  280. * @brief Forces or releases AHB peripheral reset.
  281. * @{
  282. */
  283. #if defined(STM32L151xB) || defined(STM32L152xB) || defined(STM32L151xBA)\
  284. || defined(STM32L152xBA) || defined(STM32L151xC) || defined(STM32L152xC)\
  285. || defined(STM32L162xC) || defined(STM32L151xCA) || defined(STM32L151xD)\
  286. || defined(STM32L152xCA) || defined(STM32L152xD) || defined(STM32L162xCA)\
  287. || defined(STM32L162xD) || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX)\
  288. || defined(STM32L162xE) || defined(STM32L162xDX)
  289. #define __HAL_RCC_GPIOE_FORCE_RESET() (RCC->AHBRSTR |= (RCC_AHBRSTR_GPIOERST))
  290. #define __HAL_RCC_GPIOE_RELEASE_RESET() (RCC->AHBRSTR &= ~(RCC_AHBRSTR_GPIOERST))
  291. #endif /* STM32L151xB || STM32L152xB || ... || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  292. #if defined(STM32L151xCA) || defined(STM32L151xD) || defined(STM32L152xCA)\
  293. || defined(STM32L152xD) || defined(STM32L162xCA) || defined(STM32L162xD)\
  294. || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX) || defined(STM32L162xE) || defined(STM32L162xDX)
  295. #define __HAL_RCC_GPIOF_FORCE_RESET() (RCC->AHBRSTR |= (RCC_AHBRSTR_GPIOFRST))
  296. #define __HAL_RCC_GPIOG_FORCE_RESET() (RCC->AHBRSTR |= (RCC_AHBRSTR_GPIOGRST))
  297. #define __HAL_RCC_GPIOF_RELEASE_RESET() (RCC->AHBRSTR &= ~(RCC_AHBRSTR_GPIOFRST))
  298. #define __HAL_RCC_GPIOG_RELEASE_RESET() (RCC->AHBRSTR &= ~(RCC_AHBRSTR_GPIOGRST))
  299. #endif /* STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  300. #if defined(STM32L100xC) || defined(STM32L151xC) || defined(STM32L152xC)\
  301. || defined(STM32L162xC) || defined(STM32L151xCA) || defined(STM32L151xD)\
  302. || defined(STM32L152xCA) || defined(STM32L152xD) || defined(STM32L162xCA)\
  303. || defined(STM32L162xD) || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX)\
  304. || defined(STM32L162xE) || defined(STM32L162xDX)
  305. #define __HAL_RCC_DMA2_FORCE_RESET() (RCC->AHBRSTR |= (RCC_AHBRSTR_DMA2RST))
  306. #define __HAL_RCC_DMA2_RELEASE_RESET() (RCC->AHBRSTR &= ~(RCC_AHBRSTR_DMA2RST))
  307. #endif /* STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  308. #if defined(STM32L162xC) || defined(STM32L162xCA) || defined(STM32L162xD)\
  309. || defined(STM32L162xE) || defined(STM32L162xDX)
  310. #define __HAL_RCC_AES_FORCE_RESET() (RCC->AHBRSTR |= (RCC_AHBRSTR_AESRST))
  311. #define __HAL_RCC_AES_RELEASE_RESET() (RCC->AHBRSTR &= ~(RCC_AHBRSTR_AESRST))
  312. #endif /* STM32L162xC || STM32L162xCA || STM32L162xD || STM32L162xE || STM32L162xDX */
  313. #if defined(STM32L151xD) || defined(STM32L152xD) || defined(STM32L162xD)
  314. #define __HAL_RCC_FSMC_FORCE_RESET() (RCC->AHBRSTR |= (RCC_AHBRSTR_FSMCRST))
  315. #define __HAL_RCC_FSMC_RELEASE_RESET() (RCC->AHBRSTR &= ~(RCC_AHBRSTR_FSMCRST))
  316. #endif /* STM32L151xD || STM32L152xD || STM32L162xD */
  317. #if defined(STM32L100xB) || defined(STM32L100xBA) || defined(STM32L100xC)\
  318. || defined(STM32L152xB) || defined(STM32L152xBA) || defined(STM32L152xC)\
  319. || defined(STM32L162xC) || defined(STM32L152xCA) || defined(STM32L152xD)\
  320. || defined(STM32L162xCA) || defined(STM32L162xD) || defined(STM32L152xE) || defined(STM32L152xDX)\
  321. || defined(STM32L162xE) || defined(STM32L162xDX)
  322. #define __HAL_RCC_LCD_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_LCDRST))
  323. #define __HAL_RCC_LCD_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_LCDRST))
  324. #endif /* STM32L100xB || STM32L152xBA || ... || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  325. /** @brief Forces or releases APB1 peripheral reset.
  326. */
  327. #if defined(STM32L151xC) || defined(STM32L152xC) || defined(STM32L162xC)\
  328. || defined(STM32L151xCA) || defined(STM32L151xD) || defined(STM32L152xCA)\
  329. || defined(STM32L152xD) || defined(STM32L162xCA) || defined(STM32L162xD)\
  330. || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX) || defined(STM32L162xE) || defined(STM32L162xDX)
  331. #define __HAL_RCC_TIM5_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM5RST))
  332. #define __HAL_RCC_TIM5_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM5RST))
  333. #endif /* STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  334. #if defined(STM32L100xC) || defined(STM32L151xC) || defined(STM32L152xC)\
  335. || defined(STM32L162xC) || defined(STM32L151xCA) || defined(STM32L151xD)\
  336. || defined(STM32L152xCA) || defined(STM32L152xD) || defined(STM32L162xCA)\
  337. || defined(STM32L162xD) || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX)\
  338. || defined(STM32L162xE) || defined(STM32L162xDX)
  339. #define __HAL_RCC_SPI3_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_SPI3RST))
  340. #define __HAL_RCC_SPI3_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_SPI3RST))
  341. #endif /* STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  342. #if defined(STM32L151xD) || defined(STM32L152xD) || defined(STM32L162xD)\
  343. || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX) || defined(STM32L162xE) || defined(STM32L162xDX)
  344. #define __HAL_RCC_UART4_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_UART4RST))
  345. #define __HAL_RCC_UART5_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_UART5RST))
  346. #define __HAL_RCC_UART4_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_UART4RST))
  347. #define __HAL_RCC_UART5_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_UART5RST))
  348. #endif /* STM32L151xD || STM32L152xD || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  349. #if defined(STM32L151xCA) || defined(STM32L151xD) || defined(STM32L152xCA)\
  350. || defined(STM32L152xD) || defined(STM32L162xCA) || defined(STM32L162xD)\
  351. || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX) || defined(STM32L162xE) || defined(STM32L162xDX)\
  352. || defined(STM32L162xC) || defined(STM32L152xC) || defined(STM32L151xC)
  353. #define __HAL_RCC_OPAMP_FORCE_RESET() __HAL_RCC_COMP_FORCE_RESET() /* Peripherals COMP and OPAMP share the same clock domain */
  354. #define __HAL_RCC_OPAMP_RELEASE_RESET() __HAL_RCC_COMP_RELEASE_RESET() /* Peripherals COMP and OPAMP share the same clock domain */
  355. #endif /* STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xC || STM32L152xC || STM32L151xC */
  356. /** @brief Forces or releases APB2 peripheral reset.
  357. */
  358. #if defined(STM32L151xD) || defined(STM32L152xD) || defined(STM32L162xD)
  359. #define __HAL_RCC_SDIO_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_SDIORST))
  360. #define __HAL_RCC_SDIO_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SDIORST))
  361. #endif /* STM32L151xD || STM32L152xD || STM32L162xD */
  362. /**
  363. * @}
  364. */
  365. /** @defgroup RCCEx_Peripheral_Clock_Sleep_Enable_Disable RCCEx Peripheral Clock Sleep Enable Disable
  366. * @brief Enables or disables the AHB1 peripheral clock during Low Power (Sleep) mode.
  367. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  368. * power consumption.
  369. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
  370. * @note By default, all peripheral clocks are enabled during SLEEP mode.
  371. * @{
  372. */
  373. #if defined(STM32L151xB) || defined(STM32L152xB) || defined(STM32L151xBA)\
  374. || defined(STM32L152xBA) || defined(STM32L151xC) || defined(STM32L152xC)\
  375. || defined(STM32L162xC) || defined(STM32L151xCA) || defined(STM32L151xD)\
  376. || defined(STM32L152xCA) || defined(STM32L152xD) || defined(STM32L162xCA)\
  377. || defined(STM32L162xD) || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX)\
  378. || defined(STM32L162xE) || defined(STM32L162xDX)
  379. #define __HAL_RCC_GPIOE_CLK_SLEEP_ENABLE() (RCC->AHBLPENR |= (RCC_AHBLPENR_GPIOELPEN))
  380. #define __HAL_RCC_GPIOE_CLK_SLEEP_DISABLE() (RCC->AHBLPENR &= ~(RCC_AHBLPENR_GPIOELPEN))
  381. #endif /* STM32L151xB || STM32L152xB || ... || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  382. #if defined(STM32L151xCA) || defined(STM32L151xD) || defined(STM32L152xCA)\
  383. || defined(STM32L152xD) || defined(STM32L162xCA) || defined(STM32L162xD)\
  384. || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX) || defined(STM32L162xE) || defined(STM32L162xDX)
  385. #define __HAL_RCC_GPIOF_CLK_SLEEP_ENABLE() (RCC->AHBLPENR |= (RCC_AHBLPENR_GPIOFLPEN))
  386. #define __HAL_RCC_GPIOG_CLK_SLEEP_ENABLE() (RCC->AHBLPENR |= (RCC_AHBLPENR_GPIOGLPEN))
  387. #define __HAL_RCC_GPIOF_CLK_SLEEP_DISABLE() (RCC->AHBLPENR &= ~(RCC_AHBLPENR_GPIOFLPEN))
  388. #define __HAL_RCC_GPIOG_CLK_SLEEP_DISABLE() (RCC->AHBLPENR &= ~(RCC_AHBLPENR_GPIOGLPEN))
  389. #endif /* STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  390. #if defined(STM32L100xC) || defined(STM32L151xC) || defined(STM32L152xC)\
  391. || defined(STM32L162xC) || defined(STM32L151xCA) || defined(STM32L151xD)\
  392. || defined(STM32L152xCA) || defined(STM32L152xD) || defined(STM32L162xCA)\
  393. || defined(STM32L162xD) || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX)\
  394. || defined(STM32L162xE) || defined(STM32L162xDX)
  395. #define __HAL_RCC_DMA2_CLK_SLEEP_ENABLE() (RCC->AHBLPENR |= (RCC_AHBLPENR_DMA2LPEN))
  396. #define __HAL_RCC_DMA2_CLK_SLEEP_DISABLE() (RCC->AHBLPENR &= ~(RCC_AHBLPENR_DMA2LPEN))
  397. #endif /* STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  398. #if defined(STM32L162xC) || defined(STM32L162xCA) || defined(STM32L162xD) || defined(STM32L162xE) || defined(STM32L162xDX)
  399. #define __HAL_RCC_AES_CLK_SLEEP_ENABLE() (RCC->AHBLPENR |= (RCC_AHBLPENR_AESLPEN))
  400. #define __HAL_RCC_AES_CLK_SLEEP_DISABLE() (RCC->AHBLPENR &= ~(RCC_AHBLPENR_AESLPEN))
  401. #endif /* STM32L162xC || STM32L162xCA || STM32L162xD || STM32L162xE || STM32L162xDX */
  402. #if defined(STM32L151xD) || defined(STM32L152xD) || defined(STM32L162xD)
  403. #define __HAL_RCC_FSMC_CLK_SLEEP_ENABLE() (RCC->AHBLPENR |= (RCC_AHBLPENR_FSMCLPEN))
  404. #define __HAL_RCC_FSMC_CLK_SLEEP_DISABLE() (RCC->AHBLPENR &= ~(RCC_AHBLPENR_FSMCLPEN))
  405. #endif /* STM32L151xD || STM32L152xD || STM32L162xD */
  406. #if defined(STM32L100xB) || defined(STM32L100xBA) || defined(STM32L100xC)\
  407. || defined(STM32L152xB) || defined(STM32L152xBA) || defined(STM32L152xC)\
  408. || defined(STM32L162xC) || defined(STM32L152xCA) || defined(STM32L152xD)\
  409. || defined(STM32L162xCA) || defined(STM32L162xD) || defined(STM32L152xE) || defined(STM32L152xDX)\
  410. || defined(STM32L162xE) || defined(STM32L162xDX)
  411. #define __HAL_RCC_LCD_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_LCDLPEN))
  412. #define __HAL_RCC_LCD_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_LCDLPEN))
  413. #endif /* STM32L100xB || STM32L152xBA || ... || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  414. /** @brief Enables or disables the APB1 peripheral clock during Low Power (Sleep) mode.
  415. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  416. * power consumption.
  417. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
  418. * @note By default, all peripheral clocks are enabled during SLEEP mode.
  419. */
  420. #if defined(STM32L151xC) || defined(STM32L152xC) || defined(STM32L162xC)\
  421. || defined(STM32L151xCA) || defined(STM32L151xD) || defined(STM32L152xCA)\
  422. || defined(STM32L152xD) || defined(STM32L162xCA) || defined(STM32L162xD)\
  423. || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX) || defined(STM32L162xE) || defined(STM32L162xDX)
  424. #define __HAL_RCC_TIM5_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM5LPEN))
  425. #define __HAL_RCC_TIM5_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM5LPEN))
  426. #endif /* STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  427. #if defined(STM32L100xC) || defined(STM32L151xC) || defined(STM32L152xC)\
  428. || defined(STM32L162xC) || defined(STM32L151xCA) || defined(STM32L151xD)\
  429. || defined(STM32L152xCA) || defined(STM32L152xD) || defined(STM32L162xCA)\
  430. || defined(STM32L162xD) || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX)\
  431. || defined(STM32L162xE) || defined(STM32L162xDX)
  432. #define __HAL_RCC_SPI3_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_SPI3LPEN))
  433. #define __HAL_RCC_SPI3_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_SPI3LPEN))
  434. #endif /* STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  435. #if defined(STM32L151xD) || defined(STM32L152xD) || defined(STM32L162xD)\
  436. || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX) || defined(STM32L162xE) || defined(STM32L162xDX)
  437. #define __HAL_RCC_UART4_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_UART4LPEN))
  438. #define __HAL_RCC_UART5_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_UART5LPEN))
  439. #define __HAL_RCC_UART4_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_UART4LPEN))
  440. #define __HAL_RCC_UART5_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_UART5LPEN))
  441. #endif /* STM32L151xD || STM32L152xD || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  442. #if defined(STM32L151xCA) || defined(STM32L151xD) || defined(STM32L152xCA)\
  443. || defined(STM32L152xD) || defined(STM32L162xCA) || defined(STM32L162xD)\
  444. || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX) || defined(STM32L162xE) || defined(STM32L162xDX)\
  445. || defined(STM32L162xC) || defined(STM32L152xC) || defined(STM32L151xC)
  446. #define __HAL_RCC_OPAMP_CLK_SLEEP_ENABLE() __HAL_RCC_COMP_CLK_SLEEP_ENABLE() /* Peripherals COMP and OPAMP share the same clock domain */
  447. #define __HAL_RCC_OPAMP_CLK_SLEEP_DISABLE() __HAL_RCC_COMP_CLK_SLEEP_DISABLE() /* Peripherals COMP and OPAMP share the same clock domain */
  448. #endif /* STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xC || STM32L152xC || STM32L151xC */
  449. /** @brief Enables or disables the APB2 peripheral clock during Low Power (Sleep) mode.
  450. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  451. * power consumption.
  452. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
  453. * @note By default, all peripheral clocks are enabled during SLEEP mode.
  454. */
  455. #if defined(STM32L151xD) || defined(STM32L152xD) || defined(STM32L162xD)
  456. #define __HAL_RCC_SDIO_CLK_SLEEP_ENABLE() (RCC->APB2LPENR |= (RCC_APB2LPENR_SDIOLPEN))
  457. #define __HAL_RCC_SDIO_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_SDIOLPEN))
  458. #endif /* STM32L151xD || STM32L152xD || STM32L162xD */
  459. /**
  460. * @}
  461. */
  462. /** @defgroup RCCEx_Peripheral_Clock_Enable_Disable_Status Peripheral Clock Enable Disable Status
  463. * @brief Get the enable or disable status of peripheral clock.
  464. * @note After reset, the peripheral clock (used for registers read/write access)
  465. * is disabled and the application software has to enable this clock before
  466. * using it.
  467. * @{
  468. */
  469. #if defined(STM32L151xB) || defined(STM32L152xB) || defined(STM32L151xBA)\
  470. || defined(STM32L152xBA) || defined(STM32L151xC) || defined(STM32L152xC)\
  471. || defined(STM32L162xC) || defined(STM32L151xCA) || defined(STM32L151xD)\
  472. || defined(STM32L152xCA) || defined(STM32L152xD) || defined(STM32L162xCA)\
  473. || defined(STM32L162xD) || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX)\
  474. || defined(STM32L162xE) || defined(STM32L162xDX)
  475. #define __HAL_RCC_GPIOE_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_GPIOEEN)) != 0U)
  476. #define __HAL_RCC_GPIOE_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_GPIOEEN)) == 0U)
  477. #endif /* STM32L151xB || STM32L152xB || ... || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  478. #if defined(STM32L151xCA) || defined(STM32L151xD) || defined(STM32L152xCA)\
  479. || defined(STM32L152xD) || defined(STM32L162xCA) || defined(STM32L162xD)\
  480. || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX) || defined(STM32L162xE) || defined(STM32L162xDX)
  481. #define __HAL_RCC_GPIOF_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_GPIOFEN)) != 0U)
  482. #define __HAL_RCC_GPIOG_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_GPIOGEN)) != 0U)
  483. #define __HAL_RCC_GPIOF_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_GPIOFEN)) == 0U)
  484. #define __HAL_RCC_GPIOG_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_GPIOGEN)) == 0U)
  485. #endif /* STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  486. #if defined(STM32L100xC) || defined(STM32L151xC) || defined(STM32L152xC)\
  487. || defined(STM32L162xC) || defined(STM32L151xCA) || defined(STM32L151xD)\
  488. || defined(STM32L152xCA) || defined(STM32L152xD) || defined(STM32L162xCA)\
  489. || defined(STM32L162xD) || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX)\
  490. || defined(STM32L162xE) || defined(STM32L162xDX)
  491. #define __HAL_RCC_DMA2_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_DMA2EN)) != 0U)
  492. #define __HAL_RCC_DMA2_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_DMA2EN)) == 0U)
  493. #endif /* STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  494. #if defined(STM32L162xC) || defined(STM32L162xCA) || defined(STM32L162xD)\
  495. || defined(STM32L162xE) || defined(STM32L162xDX)
  496. #define __HAL_RCC_AES_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_AESEN)) != 0U)
  497. #define __HAL_RCC_AES_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_AESEN)) == 0U)
  498. #endif /* STM32L162xC || STM32L162xCA || STM32L162xD || STM32L162xE || STM32L162xDX */
  499. #if defined(STM32L151xD) || defined(STM32L152xD) || defined(STM32L162xD)
  500. #define __HAL_RCC_FSMC_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_FSMCEN)) != 0U)
  501. #define __HAL_RCC_FSMC_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_FSMCEN)) == 0U)
  502. #endif /* STM32L151xD || STM32L152xD || STM32L162xD */
  503. #if defined(STM32L100xB) || defined(STM32L100xBA) || defined(STM32L100xC)\
  504. || defined(STM32L152xB) || defined(STM32L152xBA) || defined(STM32L152xC)\
  505. || defined(STM32L162xC) || defined(STM32L152xCA) || defined(STM32L152xD)\
  506. || defined(STM32L162xCA) || defined(STM32L162xD) || defined(STM32L152xE) || defined(STM32L152xDX)\
  507. || defined(STM32L162xE) || defined(STM32L162xDX)
  508. #define __HAL_RCC_LCD_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_LCDEN)) != 0U)
  509. #define __HAL_RCC_LCD_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_LCDEN)) == 0U)
  510. #endif /* STM32L100xB || STM32L152xBA || ... || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  511. #if defined(STM32L151xC) || defined(STM32L152xC) || defined(STM32L162xC)\
  512. || defined(STM32L151xCA) || defined(STM32L151xD) || defined(STM32L152xCA)\
  513. || defined(STM32L152xD) || defined(STM32L162xCA) || defined(STM32L162xD)\
  514. || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX) || defined(STM32L162xE) || defined(STM32L162xDX)
  515. #define __HAL_RCC_TIM5_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM5EN)) != 0U)
  516. #define __HAL_RCC_TIM5_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM5EN)) == 0U)
  517. #endif /* STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  518. #if defined(STM32L100xC) || defined(STM32L151xC) || defined(STM32L152xC)\
  519. || defined(STM32L162xC) || defined(STM32L151xCA) || defined(STM32L151xD)\
  520. || defined(STM32L152xCA) || defined(STM32L152xD) || defined(STM32L162xCA)\
  521. || defined(STM32L162xD) || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX)\
  522. || defined(STM32L162xE) || defined(STM32L162xDX)
  523. #define __HAL_RCC_SPI3_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_SPI3EN)) != 0U)
  524. #define __HAL_RCC_SPI3_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_SPI3EN)) == 0U)
  525. #endif /* STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  526. #if defined(STM32L151xD) || defined(STM32L152xD) || defined(STM32L162xD)\
  527. || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX) || defined(STM32L162xE) || defined(STM32L162xDX)
  528. #define __HAL_RCC_UART4_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_UART4EN)) != 0U)
  529. #define __HAL_RCC_UART5_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_UART5EN)) != 0U)
  530. #define __HAL_RCC_UART4_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_UART4EN)) == 0U)
  531. #define __HAL_RCC_UART5_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_UART5EN)) == 0U)
  532. #endif /* STM32L151xD || STM32L152xD || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  533. #if defined(STM32L151xCA) || defined(STM32L151xD) || defined(STM32L152xCA)\
  534. || defined(STM32L152xD) || defined(STM32L162xCA) || defined(STM32L162xD)\
  535. || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX) || defined(STM32L162xE) || defined(STM32L162xDX)\
  536. || defined(STM32L162xC) || defined(STM32L152xC) || defined(STM32L151xC)
  537. #define __HAL_RCC_OPAMP_IS_CLK_ENABLED() __HAL_RCC_COMP_IS_CLK_ENABLED()
  538. #define __HAL_RCC_OPAMP_IS_CLK_DISABLED() __HAL_RCC_COMP_IS_CLK_DISABLED()
  539. #endif /* STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xC || STM32L152xC || STM32L151xC */
  540. #if defined(STM32L151xD) || defined(STM32L152xD) || defined(STM32L162xD)
  541. #define __HAL_RCC_SDIO_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_SDIOEN)) != 0U)
  542. #define __HAL_RCC_SDIO_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_SDIOEN)) == 0U)
  543. #endif /* STM32L151xD || STM32L152xD || STM32L162xD */
  544. /**
  545. * @}
  546. */
  547. /** @defgroup RCCEx_Peripheral_Clock_Sleep_Enable_Disable_Status Peripheral Clock Sleep Enable Disable Status
  548. * @brief Get the enable or disable status of peripheral clock during Low Power (Sleep) mode.
  549. * @note Peripheral clock gating in SLEEP mode can be used to further reduce
  550. * power consumption.
  551. * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
  552. * @note By default, all peripheral clocks are enabled during SLEEP mode.
  553. * @{
  554. */
  555. #if defined(STM32L151xB) || defined(STM32L152xB) || defined(STM32L151xBA)\
  556. || defined(STM32L152xBA) || defined(STM32L151xC) || defined(STM32L152xC)\
  557. || defined(STM32L162xC) || defined(STM32L151xCA) || defined(STM32L151xD)\
  558. || defined(STM32L152xCA) || defined(STM32L152xD) || defined(STM32L162xCA)\
  559. || defined(STM32L162xD) || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX)\
  560. || defined(STM32L162xE) || defined(STM32L162xDX)
  561. #define __HAL_RCC_GPIOE_IS_CLK_SLEEP_ENABLED() ((RCC->AHBLPENR & (RCC_AHBLPENR_GPIOELPEN)) != 0U)
  562. #define __HAL_RCC_GPIOE_IS_CLK_SLEEP_DISABLED() ((RCC->AHBLPENR & (RCC_AHBLPENR_GPIOELPEN)) == 0U)
  563. #endif /* STM32L151xB || STM32L152xB || ... || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  564. #if defined(STM32L151xCA) || defined(STM32L151xD) || defined(STM32L152xCA)\
  565. || defined(STM32L152xD) || defined(STM32L162xCA) || defined(STM32L162xD)\
  566. || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX) || defined(STM32L162xE) || defined(STM32L162xDX)
  567. #define __HAL_RCC_GPIOF_IS_CLK_SLEEP_ENABLED() ((RCC->AHBLPENR & (RCC_AHBLPENR_GPIOFLPEN)) != 0U)
  568. #define __HAL_RCC_GPIOG_IS_CLK_SLEEP_ENABLED() ((RCC->AHBLPENR & (RCC_AHBLPENR_GPIOGLPEN)) != 0U)
  569. #define __HAL_RCC_GPIOF_IS_CLK_SLEEP_DISABLED() ((RCC->AHBLPENR & (RCC_AHBLPENR_GPIOFLPEN)) == 0U)
  570. #define __HAL_RCC_GPIOG_IS_CLK_SLEEP_DISABLED() ((RCC->AHBLPENR & (RCC_AHBLPENR_GPIOGLPEN)) == 0U)
  571. #endif /* STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  572. #if defined(STM32L100xC) || defined(STM32L151xC) || defined(STM32L152xC)\
  573. || defined(STM32L162xC) || defined(STM32L151xCA) || defined(STM32L151xD)\
  574. || defined(STM32L152xCA) || defined(STM32L152xD) || defined(STM32L162xCA)\
  575. || defined(STM32L162xD) || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX)\
  576. || defined(STM32L162xE) || defined(STM32L162xDX)
  577. #define __HAL_RCC_DMA2_IS_CLK_SLEEP_ENABLED() ((RCC->AHBLPENR & (RCC_AHBLPENR_DMA2LPEN)) != 0U)
  578. #define __HAL_RCC_DMA2_IS_CLK_SLEEP_DISABLED() ((RCC->AHBLPENR & (RCC_AHBLPENR_DMA2LPEN)) == 0U)
  579. #endif /* STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  580. #if defined(STM32L162xC) || defined(STM32L162xCA) || defined(STM32L162xD)\
  581. || defined(STM32L162xE) || defined(STM32L162xDX)
  582. #define __HAL_RCC_AES_IS_CLK_SLEEP_ENABLED() ((RCC->AHBLPENR & (RCC_AHBLPENR_AESLPEN)) != 0U)
  583. #define __HAL_RCC_AES_IS_CLK_SLEEP_DISABLED() ((RCC->AHBLPENR & (RCC_AHBLPENR_AESLPEN)) == 0U)
  584. #endif /* STM32L162xC || STM32L162xCA || STM32L162xD || STM32L162xE || STM32L162xDX */
  585. #if defined(STM32L151xD) || defined(STM32L152xD) || defined(STM32L162xD)
  586. #define __HAL_RCC_FSMC_IS_CLK_SLEEP_ENABLED() ((RCC->AHBLPENR & (RCC_AHBLPENR_FSMCLPEN)) != 0U)
  587. #define __HAL_RCC_FSMC_IS_CLK_SLEEP_DISABLED() ((RCC->AHBLPENR & (RCC_AHBLPENR_FSMCLPEN)) == 0U)
  588. #endif /* STM32L151xD || STM32L152xD || STM32L162xD */
  589. #if defined(STM32L100xB) || defined(STM32L100xBA) || defined(STM32L100xC)\
  590. || defined(STM32L152xB) || defined(STM32L152xBA) || defined(STM32L152xC)\
  591. || defined(STM32L162xC) || defined(STM32L152xCA) || defined(STM32L152xD)\
  592. || defined(STM32L162xCA) || defined(STM32L162xD) || defined(STM32L152xE) || defined(STM32L152xDX)\
  593. || defined(STM32L162xE) || defined(STM32L162xDX)
  594. #define __HAL_RCC_LCD_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LPENR & (RCC_APB1LPENR_LCDLPEN)) != 0U)
  595. #define __HAL_RCC_LCD_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LPENR & (RCC_APB1LPENR_LCDLPEN)) == 0U)
  596. #endif /* STM32L100xB || STM32L152xBA || ... || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  597. #if defined(STM32L151xC) || defined(STM32L152xC) || defined(STM32L162xC)\
  598. || defined(STM32L151xCA) || defined(STM32L151xD) || defined(STM32L152xCA)\
  599. || defined(STM32L152xD) || defined(STM32L162xCA) || defined(STM32L162xD)\
  600. || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX) || defined(STM32L162xE) || defined(STM32L162xDX)
  601. #define __HAL_RCC_TIM5_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LPENR & (RCC_APB1LPENR_TIM5LPEN)) != 0U)
  602. #define __HAL_RCC_TIM5_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LPENR & (RCC_APB1LPENR_TIM5LPEN)) == 0U)
  603. #endif /* STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  604. #if defined(STM32L100xC) || defined(STM32L151xC) || defined(STM32L152xC)\
  605. || defined(STM32L162xC) || defined(STM32L151xCA) || defined(STM32L151xD)\
  606. || defined(STM32L152xCA) || defined(STM32L152xD) || defined(STM32L162xCA)\
  607. || defined(STM32L162xD) || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX)\
  608. || defined(STM32L162xE) || defined(STM32L162xDX)
  609. #define __HAL_RCC_SPI3_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LPENR & (RCC_APB1LPENR_SPI3LPEN)) != 0U)
  610. #define __HAL_RCC_SPI3_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LPENR & (RCC_APB1LPENR_SPI3LPEN)) == 0U)
  611. #endif /* STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  612. #if defined(STM32L151xD) || defined(STM32L152xD) || defined(STM32L162xD)\
  613. || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX) || defined(STM32L162xE) || defined(STM32L162xDX)
  614. #define __HAL_RCC_UART4_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LPENR & (RCC_APB1LPENR_UART4LPEN)) != 0U)
  615. #define __HAL_RCC_UART5_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LPENR & (RCC_APB1LPENR_UART5LPEN)) != 0U)
  616. #define __HAL_RCC_UART4_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LPENR & (RCC_APB1LPENR_UART4LPEN)) == 0U)
  617. #define __HAL_RCC_UART5_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LPENR & (RCC_APB1LPENR_UART5LPEN)) == 0U)
  618. #endif /* STM32L151xD || STM32L152xD || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  619. #if defined(STM32L151xCA) || defined(STM32L151xD) || defined(STM32L152xCA)\
  620. || defined(STM32L152xD) || defined(STM32L162xCA) || defined(STM32L162xD)\
  621. || defined(STM32L151xE) || defined(STM32L151xDX) || defined(STM32L152xE) || defined(STM32L152xDX) || defined(STM32L162xE) || defined(STM32L162xDX)\
  622. || defined(STM32L162xC) || defined(STM32L152xC) || defined(STM32L151xC)
  623. #define __HAL_RCC_OPAMP_IS_CLK_SLEEP_ENABLED() __HAL_RCC_COMP_IS_CLK_SLEEP_ENABLED()
  624. #define __HAL_RCC_OPAMP_IS_CLK_SLEEP_DISABLED() __HAL_RCC_COMP_IS_CLK_SLEEP_DISABLED()
  625. #endif /* STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xC || STM32L152xC || STM32L151xC */
  626. #if defined(STM32L151xD) || defined(STM32L152xD) || defined(STM32L162xD)
  627. #define __HAL_RCC_SDIO_IS_CLK_SLEEP_ENABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_SDIOLPEN)) != 0U)
  628. #define __HAL_RCC_SDIO_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_SDIOLPEN)) == 0U)
  629. #endif /* STM32L151xD || STM32L152xD || STM32L162xD */
  630. /**
  631. * @}
  632. */
  633. #if defined(RCC_LSECSS_SUPPORT)
  634. /**
  635. * @brief Enable interrupt on RCC LSE CSS EXTI Line 19.
  636. * @retval None
  637. */
  638. #define __HAL_RCC_LSECSS_EXTI_ENABLE_IT() SET_BIT(EXTI->IMR, RCC_EXTI_LINE_LSECSS)
  639. /**
  640. * @brief Disable interrupt on RCC LSE CSS EXTI Line 19.
  641. * @retval None
  642. */
  643. #define __HAL_RCC_LSECSS_EXTI_DISABLE_IT() CLEAR_BIT(EXTI->IMR, RCC_EXTI_LINE_LSECSS)
  644. /**
  645. * @brief Enable event on RCC LSE CSS EXTI Line 19.
  646. * @retval None.
  647. */
  648. #define __HAL_RCC_LSECSS_EXTI_ENABLE_EVENT() SET_BIT(EXTI->EMR, RCC_EXTI_LINE_LSECSS)
  649. /**
  650. * @brief Disable event on RCC LSE CSS EXTI Line 19.
  651. * @retval None.
  652. */
  653. #define __HAL_RCC_LSECSS_EXTI_DISABLE_EVENT() CLEAR_BIT(EXTI->EMR, RCC_EXTI_LINE_LSECSS)
  654. /**
  655. * @brief RCC LSE CSS EXTI line configuration: set falling edge trigger.
  656. * @retval None.
  657. */
  658. #define __HAL_RCC_LSECSS_EXTI_ENABLE_FALLING_EDGE() SET_BIT(EXTI->FTSR, RCC_EXTI_LINE_LSECSS)
  659. /**
  660. * @brief Disable the RCC LSE CSS Extended Interrupt Falling Trigger.
  661. * @retval None.
  662. */
  663. #define __HAL_RCC_LSECSS_EXTI_DISABLE_FALLING_EDGE() CLEAR_BIT(EXTI->FTSR, RCC_EXTI_LINE_LSECSS)
  664. /**
  665. * @brief RCC LSE CSS EXTI line configuration: set rising edge trigger.
  666. * @retval None.
  667. */
  668. #define __HAL_RCC_LSECSS_EXTI_ENABLE_RISING_EDGE() SET_BIT(EXTI->RTSR, RCC_EXTI_LINE_LSECSS)
  669. /**
  670. * @brief Disable the RCC LSE CSS Extended Interrupt Rising Trigger.
  671. * @retval None.
  672. */
  673. #define __HAL_RCC_LSECSS_EXTI_DISABLE_RISING_EDGE() CLEAR_BIT(EXTI->RTSR, RCC_EXTI_LINE_LSECSS)
  674. /**
  675. * @brief RCC LSE CSS EXTI line configuration: set rising & falling edge trigger.
  676. * @retval None.
  677. */
  678. #define __HAL_RCC_LSECSS_EXTI_ENABLE_RISING_FALLING_EDGE() \
  679. do { \
  680. __HAL_RCC_LSECSS_EXTI_ENABLE_RISING_EDGE(); \
  681. __HAL_RCC_LSECSS_EXTI_ENABLE_FALLING_EDGE(); \
  682. } while(0U)
  683. /**
  684. * @brief Disable the RCC LSE CSS Extended Interrupt Rising & Falling Trigger.
  685. * @retval None.
  686. */
  687. #define __HAL_RCC_LSECSS_EXTI_DISABLE_RISING_FALLING_EDGE() \
  688. do { \
  689. __HAL_RCC_LSECSS_EXTI_DISABLE_RISING_EDGE(); \
  690. __HAL_RCC_LSECSS_EXTI_DISABLE_FALLING_EDGE(); \
  691. } while(0U)
  692. /**
  693. * @brief Check whether the specified RCC LSE CSS EXTI interrupt flag is set or not.
  694. * @retval EXTI RCC LSE CSS Line Status.
  695. */
  696. #define __HAL_RCC_LSECSS_EXTI_GET_FLAG() (EXTI->PR & (RCC_EXTI_LINE_LSECSS))
  697. /**
  698. * @brief Clear the RCC LSE CSS EXTI flag.
  699. * @retval None.
  700. */
  701. #define __HAL_RCC_LSECSS_EXTI_CLEAR_FLAG() (EXTI->PR = (RCC_EXTI_LINE_LSECSS))
  702. /**
  703. * @brief Generate a Software interrupt on selected EXTI line.
  704. * @retval None.
  705. */
  706. #define __HAL_RCC_LSECSS_EXTI_GENERATE_SWIT() SET_BIT(EXTI->SWIER, RCC_EXTI_LINE_LSECSS)
  707. #endif /* RCC_LSECSS_SUPPORT */
  708. #if defined(LCD)
  709. /** @defgroup RCCEx_LCD_Configuration LCD Configuration
  710. * @brief Macros to configure clock source of LCD peripherals.
  711. * @{
  712. */
  713. /** @brief Macro to configures LCD clock (LCDCLK).
  714. * @note LCD and RTC use the same configuration
  715. * @note LCD can however be used in the Stop low power mode if the LSE or LSI is used as the
  716. * LCD clock source.
  717. *
  718. * @param __LCD_CLKSOURCE__ specifies the LCD clock source.
  719. * This parameter can be one of the following values:
  720. * @arg @ref RCC_RTCCLKSOURCE_LSE LSE selected as LCD clock
  721. * @arg @ref RCC_RTCCLKSOURCE_LSI LSI selected as LCD clock
  722. * @arg @ref RCC_RTCCLKSOURCE_HSE_DIV2 HSE divided by 2 selected as LCD clock
  723. * @arg @ref RCC_RTCCLKSOURCE_HSE_DIV4 HSE divided by 4 selected as LCD clock
  724. * @arg @ref RCC_RTCCLKSOURCE_HSE_DIV8 HSE divided by 8 selected as LCD clock
  725. * @arg @ref RCC_RTCCLKSOURCE_HSE_DIV16 HSE divided by 16 selected as LCD clock
  726. */
  727. #define __HAL_RCC_LCD_CONFIG(__LCD_CLKSOURCE__) __HAL_RCC_RTC_CONFIG(__LCD_CLKSOURCE__)
  728. /** @brief Macro to get the LCD clock source.
  729. */
  730. #define __HAL_RCC_GET_LCD_SOURCE() __HAL_RCC_GET_RTC_SOURCE()
  731. /** @brief Macro to get the LCD clock pre-scaler.
  732. */
  733. #define __HAL_RCC_GET_LCD_HSE_PRESCALER() __HAL_RCC_GET_RTC_HSE_PRESCALER()
  734. /**
  735. * @}
  736. */
  737. #endif /* LCD */
  738. /**
  739. * @}
  740. */
  741. /* Exported functions --------------------------------------------------------*/
  742. /** @addtogroup RCCEx_Exported_Functions
  743. * @{
  744. */
  745. /** @addtogroup RCCEx_Exported_Functions_Group1
  746. * @{
  747. */
  748. HAL_StatusTypeDef HAL_RCCEx_PeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClkInit);
  749. void HAL_RCCEx_GetPeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClkInit);
  750. uint32_t HAL_RCCEx_GetPeriphCLKFreq(uint32_t PeriphClk);
  751. #if defined(RCC_LSECSS_SUPPORT)
  752. void HAL_RCCEx_EnableLSECSS(void);
  753. void HAL_RCCEx_DisableLSECSS(void);
  754. void HAL_RCCEx_EnableLSECSS_IT(void);
  755. void HAL_RCCEx_LSECSS_IRQHandler(void);
  756. void HAL_RCCEx_LSECSS_Callback(void);
  757. #endif /* RCC_LSECSS_SUPPORT */
  758. /**
  759. * @}
  760. */
  761. /**
  762. * @}
  763. */
  764. /**
  765. * @}
  766. */
  767. /**
  768. * @}
  769. */
  770. #ifdef __cplusplus
  771. }
  772. #endif
  773. #endif /* __STM32L1xx_HAL_RCC_EX_H */
  774. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/