2 ******************************************************************************
\r
3 * @file stm32l4xx_hal_rcc_ex.h
\r
4 * @author MCD Application Team
\r
5 * @brief Header file of RCC HAL Extended module.
\r
6 ******************************************************************************
\r
9 * <h2><center>© Copyright (c) 2017 STMicroelectronics.
\r
10 * All rights reserved.</center></h2>
\r
12 * This software component is licensed by ST under BSD 3-Clause license,
\r
13 * the "License"; You may not use this file except in compliance with the
\r
14 * License. You may obtain a copy of the License at:
\r
15 * opensource.org/licenses/BSD-3-Clause
\r
17 ******************************************************************************
\r
20 /* Define to prevent recursive inclusion -------------------------------------*/
\r
21 #ifndef __STM32L4xx_HAL_RCC_EX_H
\r
22 #define __STM32L4xx_HAL_RCC_EX_H
\r
28 /* Includes ------------------------------------------------------------------*/
\r
29 #include "stm32l4xx_hal_def.h"
\r
31 /** @addtogroup STM32L4xx_HAL_Driver
\r
35 /** @addtogroup RCCEx
\r
39 /* Exported types ------------------------------------------------------------*/
\r
41 /** @defgroup RCCEx_Exported_Types RCCEx Exported Types
\r
45 #if defined(RCC_PLLSAI1_SUPPORT)
\r
47 * @brief PLLSAI1 Clock structure definition
\r
52 uint32_t PLLSAI1Source; /*!< PLLSAI1Source: PLLSAI1 entry clock source.
\r
53 This parameter must be a value of @ref RCC_PLL_Clock_Source */
\r
55 #if defined(RCC_PLLSAI1M_DIV_1_16_SUPPORT)
\r
56 uint32_t PLLSAI1M; /*!< PLLSAI1M: specifies the division factor for PLLSAI1 input clock.
\r
57 This parameter must be a number between Min_Data = 1 and Max_Data = 16 */
\r
59 uint32_t PLLSAI1M; /*!< PLLSAI1M: specifies the division factor for PLLSAI1 input clock.
\r
60 This parameter must be a number between Min_Data = 1 and Max_Data = 8 */
\r
63 uint32_t PLLSAI1N; /*!< PLLSAI1N: specifies the multiplication factor for PLLSAI1 VCO output clock.
\r
64 This parameter must be a number between 8 and 86 or 127 depending on devices. */
\r
66 uint32_t PLLSAI1P; /*!< PLLSAI1P: specifies the division factor for SAI clock.
\r
67 This parameter must be a value of @ref RCC_PLLP_Clock_Divider */
\r
69 uint32_t PLLSAI1Q; /*!< PLLSAI1Q: specifies the division factor for USB/RNG/SDMMC1 clock.
\r
70 This parameter must be a value of @ref RCC_PLLQ_Clock_Divider */
\r
72 uint32_t PLLSAI1R; /*!< PLLSAI1R: specifies the division factor for ADC clock.
\r
73 This parameter must be a value of @ref RCC_PLLR_Clock_Divider */
\r
75 uint32_t PLLSAI1ClockOut; /*!< PLLSAIClockOut: specifies PLLSAI1 output clock to be enabled.
\r
76 This parameter must be a value of @ref RCC_PLLSAI1_Clock_Output */
\r
77 }RCC_PLLSAI1InitTypeDef;
\r
78 #endif /* RCC_PLLSAI1_SUPPORT */
\r
80 #if defined(RCC_PLLSAI2_SUPPORT)
\r
82 * @brief PLLSAI2 Clock structure definition
\r
87 uint32_t PLLSAI2Source; /*!< PLLSAI2Source: PLLSAI2 entry clock source.
\r
88 This parameter must be a value of @ref RCC_PLL_Clock_Source */
\r
90 #if defined(RCC_PLLSAI2M_DIV_1_16_SUPPORT)
\r
91 uint32_t PLLSAI2M; /*!< PLLSAI2M: specifies the division factor for PLLSAI2 input clock.
\r
92 This parameter must be a number between Min_Data = 1 and Max_Data = 16 */
\r
94 uint32_t PLLSAI2M; /*!< PLLSAI2M: specifies the division factor for PLLSAI2 input clock.
\r
95 This parameter must be a number between Min_Data = 1 and Max_Data = 8 */
\r
98 uint32_t PLLSAI2N; /*!< PLLSAI2N: specifies the multiplication factor for PLLSAI2 VCO output clock.
\r
99 This parameter must be a number between 8 and 86 or 127 depending on devices. */
\r
101 uint32_t PLLSAI2P; /*!< PLLSAI2P: specifies the division factor for SAI clock.
\r
102 This parameter must be a value of @ref RCC_PLLP_Clock_Divider */
\r
104 #if defined(RCC_PLLSAI2Q_DIV_SUPPORT)
\r
105 uint32_t PLLSAI2Q; /*!< PLLSAI2Q: specifies the division factor for DSI clock.
\r
106 This parameter must be a value of @ref RCC_PLLQ_Clock_Divider */
\r
109 uint32_t PLLSAI2R; /*!< PLLSAI2R: specifies the division factor for ADC clock.
\r
110 This parameter must be a value of @ref RCC_PLLR_Clock_Divider */
\r
112 uint32_t PLLSAI2ClockOut; /*!< PLLSAIClockOut: specifies PLLSAI2 output clock to be enabled.
\r
113 This parameter must be a value of @ref RCC_PLLSAI2_Clock_Output */
\r
114 }RCC_PLLSAI2InitTypeDef;
\r
116 #endif /* RCC_PLLSAI2_SUPPORT */
\r
119 * @brief RCC extended clocks structure definition
\r
123 uint32_t PeriphClockSelection; /*!< The Extended Clock to be configured.
\r
124 This parameter can be a value of @ref RCCEx_Periph_Clock_Selection */
\r
125 #if defined(RCC_PLLSAI1_SUPPORT)
\r
127 RCC_PLLSAI1InitTypeDef PLLSAI1; /*!< PLLSAI1 structure parameters.
\r
128 This parameter will be used only when PLLSAI1 is selected as Clock Source for SAI1, USB/RNG/SDMMC1 or ADC */
\r
129 #endif /* RCC_PLLSAI1_SUPPORT */
\r
130 #if defined(RCC_PLLSAI2_SUPPORT)
\r
132 RCC_PLLSAI2InitTypeDef PLLSAI2; /*!< PLLSAI2 structure parameters.
\r
133 This parameter will be used only when PLLSAI2 is selected as Clock Source for SAI2 or ADC */
\r
135 #endif /* RCC_PLLSAI2_SUPPORT */
\r
137 uint32_t Usart1ClockSelection; /*!< Specifies USART1 clock source.
\r
138 This parameter can be a value of @ref RCCEx_USART1_Clock_Source */
\r
140 uint32_t Usart2ClockSelection; /*!< Specifies USART2 clock source.
\r
141 This parameter can be a value of @ref RCCEx_USART2_Clock_Source */
\r
143 #if defined(USART3)
\r
145 uint32_t Usart3ClockSelection; /*!< Specifies USART3 clock source.
\r
146 This parameter can be a value of @ref RCCEx_USART3_Clock_Source */
\r
148 #endif /* USART3 */
\r
152 uint32_t Uart4ClockSelection; /*!< Specifies UART4 clock source.
\r
153 This parameter can be a value of @ref RCCEx_UART4_Clock_Source */
\r
159 uint32_t Uart5ClockSelection; /*!< Specifies UART5 clock source.
\r
160 This parameter can be a value of @ref RCCEx_UART5_Clock_Source */
\r
164 uint32_t Lpuart1ClockSelection; /*!< Specifies LPUART1 clock source.
\r
165 This parameter can be a value of @ref RCCEx_LPUART1_Clock_Source */
\r
167 uint32_t I2c1ClockSelection; /*!< Specifies I2C1 clock source.
\r
168 This parameter can be a value of @ref RCCEx_I2C1_Clock_Source */
\r
172 uint32_t I2c2ClockSelection; /*!< Specifies I2C2 clock source.
\r
173 This parameter can be a value of @ref RCCEx_I2C2_Clock_Source */
\r
177 uint32_t I2c3ClockSelection; /*!< Specifies I2C3 clock source.
\r
178 This parameter can be a value of @ref RCCEx_I2C3_Clock_Source */
\r
182 uint32_t I2c4ClockSelection; /*!< Specifies I2C4 clock source.
\r
183 This parameter can be a value of @ref RCCEx_I2C4_Clock_Source */
\r
187 uint32_t Lptim1ClockSelection; /*!< Specifies LPTIM1 clock source.
\r
188 This parameter can be a value of @ref RCCEx_LPTIM1_Clock_Source */
\r
190 uint32_t Lptim2ClockSelection; /*!< Specifies LPTIM2 clock source.
\r
191 This parameter can be a value of @ref RCCEx_LPTIM2_Clock_Source */
\r
194 uint32_t Sai1ClockSelection; /*!< Specifies SAI1 clock source.
\r
195 This parameter can be a value of @ref RCCEx_SAI1_Clock_Source */
\r
200 uint32_t Sai2ClockSelection; /*!< Specifies SAI2 clock source.
\r
201 This parameter can be a value of @ref RCCEx_SAI2_Clock_Source */
\r
205 #if defined(USB_OTG_FS) || defined(USB)
\r
207 uint32_t UsbClockSelection; /*!< Specifies USB clock source (warning: same source for SDMMC1 and RNG).
\r
208 This parameter can be a value of @ref RCCEx_USB_Clock_Source */
\r
210 #endif /* USB_OTG_FS || USB */
\r
212 #if defined(SDMMC1)
\r
214 uint32_t Sdmmc1ClockSelection; /*!< Specifies SDMMC1 clock source (warning: same source for USB and RNG).
\r
215 This parameter can be a value of @ref RCCEx_SDMMC1_Clock_Source */
\r
217 #endif /* SDMMC1 */
\r
219 uint32_t RngClockSelection; /*!< Specifies RNG clock source (warning: same source for USB and SDMMC1).
\r
220 This parameter can be a value of @ref RCCEx_RNG_Clock_Source */
\r
222 #if !defined(STM32L412xx) && !defined(STM32L422xx)
\r
223 uint32_t AdcClockSelection; /*!< Specifies ADC interface clock source.
\r
224 This parameter can be a value of @ref RCCEx_ADC_Clock_Source */
\r
225 #endif /* !STM32L412xx && !STM32L422xx */
\r
227 #if defined(SWPMI1)
\r
229 uint32_t Swpmi1ClockSelection; /*!< Specifies SWPMI1 clock source.
\r
230 This parameter can be a value of @ref RCCEx_SWPMI1_Clock_Source */
\r
232 #endif /* SWPMI1 */
\r
234 #if defined(DFSDM1_Filter0)
\r
236 uint32_t Dfsdm1ClockSelection; /*!< Specifies DFSDM1 clock source.
\r
237 This parameter can be a value of @ref RCCEx_DFSDM1_Clock_Source */
\r
239 #if defined(STM32L4R5xx) || defined(STM32L4R7xx) || defined(STM32L4R9xx) || defined(STM32L4S5xx) || defined(STM32L4S7xx) || defined(STM32L4S9xx)
\r
240 uint32_t Dfsdm1AudioClockSelection; /*!< Specifies DFSDM1 audio clock source.
\r
241 This parameter can be a value of @ref RCCEx_DFSDM1_Audio_Clock_Source */
\r
243 #endif /* STM32L4R5xx || STM32L4R7xx || STM32L4R9xx || STM32L4S5xx || STM32L4S7xx || STM32L4S9xx */
\r
245 #endif /* DFSDM1_Filter0 */
\r
249 uint32_t LtdcClockSelection; /*!< Specifies LTDC clock source.
\r
250 This parameter can be a value of @ref RCCEx_LTDC_Clock_Source */
\r
256 uint32_t DsiClockSelection; /*!< Specifies DSI clock source.
\r
257 This parameter can be a value of @ref RCCEx_DSI_Clock_Source */
\r
261 #if defined(OCTOSPI1) || defined(OCTOSPI2)
\r
263 uint32_t OspiClockSelection; /*!< Specifies OctoSPI clock source.
\r
264 This parameter can be a value of @ref RCCEx_OSPI_Clock_Source */
\r
268 uint32_t RTCClockSelection; /*!< Specifies RTC clock source.
\r
269 This parameter can be a value of @ref RCC_RTC_Clock_Source */
\r
270 }RCC_PeriphCLKInitTypeDef;
\r
275 * @brief RCC_CRS Init structure definition
\r
279 uint32_t Prescaler; /*!< Specifies the division factor of the SYNC signal.
\r
280 This parameter can be a value of @ref RCCEx_CRS_SynchroDivider */
\r
282 uint32_t Source; /*!< Specifies the SYNC signal source.
\r
283 This parameter can be a value of @ref RCCEx_CRS_SynchroSource */
\r
285 uint32_t Polarity; /*!< Specifies the input polarity for the SYNC signal source.
\r
286 This parameter can be a value of @ref RCCEx_CRS_SynchroPolarity */
\r
288 uint32_t ReloadValue; /*!< Specifies the value to be loaded in the frequency error counter with each SYNC event.
\r
289 It can be calculated in using macro __HAL_RCC_CRS_RELOADVALUE_CALCULATE(__FTARGET__, __FSYNC__)
\r
290 This parameter must be a number between 0 and 0xFFFF or a value of @ref RCCEx_CRS_ReloadValueDefault .*/
\r
292 uint32_t ErrorLimitValue; /*!< Specifies the value to be used to evaluate the captured frequency error value.
\r
293 This parameter must be a number between 0 and 0xFF or a value of @ref RCCEx_CRS_ErrorLimitDefault */
\r
295 uint32_t HSI48CalibrationValue; /*!< Specifies a user-programmable trimming value to the HSI48 oscillator.
\r
296 This parameter must be a number between 0 and 0x7F for STM32L412xx/L422xx, between 0 and 0x3F otherwise,
\r
297 or a value of @ref RCCEx_CRS_HSI48CalibrationDefault */
\r
299 }RCC_CRSInitTypeDef;
\r
302 * @brief RCC_CRS Synchronization structure definition
\r
306 uint32_t ReloadValue; /*!< Specifies the value loaded in the Counter reload value.
\r
307 This parameter must be a number between 0 and 0xFFFF */
\r
309 uint32_t HSI48CalibrationValue; /*!< Specifies value loaded in HSI48 oscillator smooth trimming.
\r
310 This parameter must be a number between 0 and 0x7F for STM32L412xx/L422xx, between 0 and 0x3F otherwise */
\r
312 uint32_t FreqErrorCapture; /*!< Specifies the value loaded in the .FECAP, the frequency error counter
\r
313 value latched in the time of the last SYNC event.
\r
314 This parameter must be a number between 0 and 0xFFFF */
\r
316 uint32_t FreqErrorDirection; /*!< Specifies the value loaded in the .FEDIR, the counting direction of the
\r
317 frequency error counter latched in the time of the last SYNC event.
\r
318 It shows whether the actual frequency is below or above the target.
\r
319 This parameter must be a value of @ref RCCEx_CRS_FreqErrorDirection*/
\r
321 }RCC_CRSSynchroInfoTypeDef;
\r
328 /* Exported constants --------------------------------------------------------*/
\r
329 /** @defgroup RCCEx_Exported_Constants RCCEx Exported Constants
\r
333 /** @defgroup RCCEx_LSCO_Clock_Source Low Speed Clock Source
\r
336 #define RCC_LSCOSOURCE_LSI 0x00000000U /*!< LSI selection for low speed clock output */
\r
337 #define RCC_LSCOSOURCE_LSE RCC_BDCR_LSCOSEL /*!< LSE selection for low speed clock output */
\r
342 /** @defgroup RCCEx_Periph_Clock_Selection Periph Clock Selection
\r
345 #define RCC_PERIPHCLK_USART1 0x00000001U
\r
346 #define RCC_PERIPHCLK_USART2 0x00000002U
\r
347 #if defined(USART3)
\r
348 #define RCC_PERIPHCLK_USART3 0x00000004U
\r
351 #define RCC_PERIPHCLK_UART4 0x00000008U
\r
354 #define RCC_PERIPHCLK_UART5 0x00000010U
\r
356 #define RCC_PERIPHCLK_LPUART1 0x00000020U
\r
357 #define RCC_PERIPHCLK_I2C1 0x00000040U
\r
359 #define RCC_PERIPHCLK_I2C2 0x00000080U
\r
361 #define RCC_PERIPHCLK_I2C3 0x00000100U
\r
362 #define RCC_PERIPHCLK_LPTIM1 0x00000200U
\r
363 #define RCC_PERIPHCLK_LPTIM2 0x00000400U
\r
365 #define RCC_PERIPHCLK_SAI1 0x00000800U
\r
368 #define RCC_PERIPHCLK_SAI2 0x00001000U
\r
370 #if defined(USB_OTG_FS) || defined(USB)
\r
371 #define RCC_PERIPHCLK_USB 0x00002000U
\r
373 #define RCC_PERIPHCLK_ADC 0x00004000U
\r
374 #if defined(SWPMI1)
\r
375 #define RCC_PERIPHCLK_SWPMI1 0x00008000U
\r
377 #if defined(DFSDM1_Filter0)
\r
378 #define RCC_PERIPHCLK_DFSDM1 0x00010000U
\r
379 #if defined(STM32L4R5xx) || defined(STM32L4R7xx) || defined(STM32L4R9xx) || defined(STM32L4S5xx) || defined(STM32L4S7xx) || defined(STM32L4S9xx)
\r
380 #define RCC_PERIPHCLK_DFSDM1AUDIO 0x00200000U
\r
381 #endif /* STM32L4R5xx || STM32L4R7xx || STM32L4R9xx || STM32L4S5xx || STM32L4S7xx || STM32L4S9xx */
\r
383 #define RCC_PERIPHCLK_RTC 0x00020000U
\r
384 #define RCC_PERIPHCLK_RNG 0x00040000U
\r
385 #if defined(SDMMC1)
\r
386 #define RCC_PERIPHCLK_SDMMC1 0x00080000U
\r
389 #define RCC_PERIPHCLK_I2C4 0x00100000U
\r
392 #define RCC_PERIPHCLK_LTDC 0x00400000U
\r
395 #define RCC_PERIPHCLK_DSI 0x00800000U
\r
397 #if defined(OCTOSPI1) || defined(OCTOSPI2)
\r
398 #define RCC_PERIPHCLK_OSPI 0x01000000U
\r
405 /** @defgroup RCCEx_USART1_Clock_Source USART1 Clock Source
\r
408 #define RCC_USART1CLKSOURCE_PCLK2 0x00000000U
\r
409 #define RCC_USART1CLKSOURCE_SYSCLK RCC_CCIPR_USART1SEL_0
\r
410 #define RCC_USART1CLKSOURCE_HSI RCC_CCIPR_USART1SEL_1
\r
411 #define RCC_USART1CLKSOURCE_LSE (RCC_CCIPR_USART1SEL_0 | RCC_CCIPR_USART1SEL_1)
\r
416 /** @defgroup RCCEx_USART2_Clock_Source USART2 Clock Source
\r
419 #define RCC_USART2CLKSOURCE_PCLK1 0x00000000U
\r
420 #define RCC_USART2CLKSOURCE_SYSCLK RCC_CCIPR_USART2SEL_0
\r
421 #define RCC_USART2CLKSOURCE_HSI RCC_CCIPR_USART2SEL_1
\r
422 #define RCC_USART2CLKSOURCE_LSE (RCC_CCIPR_USART2SEL_0 | RCC_CCIPR_USART2SEL_1)
\r
427 #if defined(USART3)
\r
428 /** @defgroup RCCEx_USART3_Clock_Source USART3 Clock Source
\r
431 #define RCC_USART3CLKSOURCE_PCLK1 0x00000000U
\r
432 #define RCC_USART3CLKSOURCE_SYSCLK RCC_CCIPR_USART3SEL_0
\r
433 #define RCC_USART3CLKSOURCE_HSI RCC_CCIPR_USART3SEL_1
\r
434 #define RCC_USART3CLKSOURCE_LSE (RCC_CCIPR_USART3SEL_0 | RCC_CCIPR_USART3SEL_1)
\r
438 #endif /* USART3 */
\r
441 /** @defgroup RCCEx_UART4_Clock_Source UART4 Clock Source
\r
444 #define RCC_UART4CLKSOURCE_PCLK1 0x00000000U
\r
445 #define RCC_UART4CLKSOURCE_SYSCLK RCC_CCIPR_UART4SEL_0
\r
446 #define RCC_UART4CLKSOURCE_HSI RCC_CCIPR_UART4SEL_1
\r
447 #define RCC_UART4CLKSOURCE_LSE (RCC_CCIPR_UART4SEL_0 | RCC_CCIPR_UART4SEL_1)
\r
454 /** @defgroup RCCEx_UART5_Clock_Source UART5 Clock Source
\r
457 #define RCC_UART5CLKSOURCE_PCLK1 0x00000000U
\r
458 #define RCC_UART5CLKSOURCE_SYSCLK RCC_CCIPR_UART5SEL_0
\r
459 #define RCC_UART5CLKSOURCE_HSI RCC_CCIPR_UART5SEL_1
\r
460 #define RCC_UART5CLKSOURCE_LSE (RCC_CCIPR_UART5SEL_0 | RCC_CCIPR_UART5SEL_1)
\r
466 /** @defgroup RCCEx_LPUART1_Clock_Source LPUART1 Clock Source
\r
469 #define RCC_LPUART1CLKSOURCE_PCLK1 0x00000000U
\r
470 #define RCC_LPUART1CLKSOURCE_SYSCLK RCC_CCIPR_LPUART1SEL_0
\r
471 #define RCC_LPUART1CLKSOURCE_HSI RCC_CCIPR_LPUART1SEL_1
\r
472 #define RCC_LPUART1CLKSOURCE_LSE (RCC_CCIPR_LPUART1SEL_0 | RCC_CCIPR_LPUART1SEL_1)
\r
477 /** @defgroup RCCEx_I2C1_Clock_Source I2C1 Clock Source
\r
480 #define RCC_I2C1CLKSOURCE_PCLK1 0x00000000U
\r
481 #define RCC_I2C1CLKSOURCE_SYSCLK RCC_CCIPR_I2C1SEL_0
\r
482 #define RCC_I2C1CLKSOURCE_HSI RCC_CCIPR_I2C1SEL_1
\r
488 /** @defgroup RCCEx_I2C2_Clock_Source I2C2 Clock Source
\r
491 #define RCC_I2C2CLKSOURCE_PCLK1 0x00000000U
\r
492 #define RCC_I2C2CLKSOURCE_SYSCLK RCC_CCIPR_I2C2SEL_0
\r
493 #define RCC_I2C2CLKSOURCE_HSI RCC_CCIPR_I2C2SEL_1
\r
499 /** @defgroup RCCEx_I2C3_Clock_Source I2C3 Clock Source
\r
502 #define RCC_I2C3CLKSOURCE_PCLK1 0x00000000U
\r
503 #define RCC_I2C3CLKSOURCE_SYSCLK RCC_CCIPR_I2C3SEL_0
\r
504 #define RCC_I2C3CLKSOURCE_HSI RCC_CCIPR_I2C3SEL_1
\r
510 /** @defgroup RCCEx_I2C4_Clock_Source I2C4 Clock Source
\r
513 #define RCC_I2C4CLKSOURCE_PCLK1 0x00000000U
\r
514 #define RCC_I2C4CLKSOURCE_SYSCLK RCC_CCIPR2_I2C4SEL_0
\r
515 #define RCC_I2C4CLKSOURCE_HSI RCC_CCIPR2_I2C4SEL_1
\r
522 /** @defgroup RCCEx_SAI1_Clock_Source SAI1 Clock Source
\r
525 #define RCC_SAI1CLKSOURCE_PLLSAI1 0x00000000U
\r
526 #if defined(RCC_PLLSAI2_SUPPORT)
\r
527 #if defined(STM32L4R5xx) || defined(STM32L4R7xx) || defined(STM32L4R9xx) || defined(STM32L4S5xx) || defined(STM32L4S7xx) || defined(STM32L4S9xx)
\r
528 #define RCC_SAI1CLKSOURCE_PLLSAI2 RCC_CCIPR2_SAI1SEL_0
\r
530 #define RCC_SAI1CLKSOURCE_PLLSAI2 RCC_CCIPR_SAI1SEL_0
\r
531 #endif /* STM32L4R5xx || STM32L4R7xx || STM32L4R9xx || STM32L4S5xx || STM32L4S7xx || STM32L4S9xx */
\r
532 #endif /* RCC_PLLSAI2_SUPPORT */
\r
533 #if defined(STM32L4R5xx) || defined(STM32L4R7xx) || defined(STM32L4R9xx) || defined(STM32L4S5xx) || defined(STM32L4S7xx) || defined(STM32L4S9xx)
\r
534 #define RCC_SAI1CLKSOURCE_PLL RCC_CCIPR2_SAI1SEL_1
\r
535 #define RCC_SAI1CLKSOURCE_PIN (RCC_CCIPR2_SAI1SEL_1 | RCC_CCIPR2_SAI1SEL_0)
\r
536 #define RCC_SAI1CLKSOURCE_HSI RCC_CCIPR2_SAI1SEL_2
\r
538 #define RCC_SAI1CLKSOURCE_PLL RCC_CCIPR_SAI1SEL_1
\r
539 #define RCC_SAI1CLKSOURCE_PIN RCC_CCIPR_SAI1SEL
\r
540 #endif /* STM32L4R5xx || STM32L4R7xx || STM32L4R9xx || STM32L4S5xx || STM32L4S7xx || STM32L4S9xx */
\r
547 /** @defgroup RCCEx_SAI2_Clock_Source SAI2 Clock Source
\r
550 #define RCC_SAI2CLKSOURCE_PLLSAI1 0x00000000U
\r
551 #if defined(STM32L4R5xx) || defined(STM32L4R7xx) || defined(STM32L4R9xx) || defined(STM32L4S5xx) || defined(STM32L4S7xx) || defined(STM32L4S9xx)
\r
552 #define RCC_SAI2CLKSOURCE_PLLSAI2 RCC_CCIPR2_SAI2SEL_0
\r
553 #define RCC_SAI2CLKSOURCE_PLL RCC_CCIPR2_SAI2SEL_1
\r
554 #define RCC_SAI2CLKSOURCE_PIN (RCC_CCIPR2_SAI2SEL_1 | RCC_CCIPR2_SAI2SEL_0)
\r
555 #define RCC_SAI2CLKSOURCE_HSI RCC_CCIPR2_SAI2SEL_2
\r
557 #define RCC_SAI2CLKSOURCE_PLLSAI2 RCC_CCIPR_SAI2SEL_0
\r
558 #define RCC_SAI2CLKSOURCE_PLL RCC_CCIPR_SAI2SEL_1
\r
559 #define RCC_SAI2CLKSOURCE_PIN RCC_CCIPR_SAI2SEL
\r
560 #endif /* STM32L4R5xx || STM32L4R7xx || STM32L4R9xx || STM32L4S5xx || STM32L4S7xx || STM32L4S9xx */
\r
566 /** @defgroup RCCEx_LPTIM1_Clock_Source LPTIM1 Clock Source
\r
569 #define RCC_LPTIM1CLKSOURCE_PCLK1 0x00000000U
\r
570 #define RCC_LPTIM1CLKSOURCE_LSI RCC_CCIPR_LPTIM1SEL_0
\r
571 #define RCC_LPTIM1CLKSOURCE_HSI RCC_CCIPR_LPTIM1SEL_1
\r
572 #define RCC_LPTIM1CLKSOURCE_LSE RCC_CCIPR_LPTIM1SEL
\r
577 /** @defgroup RCCEx_LPTIM2_Clock_Source LPTIM2 Clock Source
\r
580 #define RCC_LPTIM2CLKSOURCE_PCLK1 0x00000000U
\r
581 #define RCC_LPTIM2CLKSOURCE_LSI RCC_CCIPR_LPTIM2SEL_0
\r
582 #define RCC_LPTIM2CLKSOURCE_HSI RCC_CCIPR_LPTIM2SEL_1
\r
583 #define RCC_LPTIM2CLKSOURCE_LSE RCC_CCIPR_LPTIM2SEL
\r
588 #if defined(SDMMC1)
\r
589 /** @defgroup RCCEx_SDMMC1_Clock_Source SDMMC1 Clock Source
\r
592 #if defined(RCC_HSI48_SUPPORT)
\r
593 #define RCC_SDMMC1CLKSOURCE_HSI48 0x00000000U /*!< HSI48 clock selected as SDMMC1 clock */
\r
595 #define RCC_SDMMC1CLKSOURCE_NONE 0x00000000U /*!< No clock selected as SDMMC1 clock */
\r
596 #endif /* RCC_HSI48_SUPPORT */
\r
597 #define RCC_SDMMC1CLKSOURCE_PLLSAI1 RCC_CCIPR_CLK48SEL_0 /*!< PLLSAI1 "Q" clock selected as SDMMC1 clock */
\r
598 #define RCC_SDMMC1CLKSOURCE_PLL RCC_CCIPR_CLK48SEL_1 /*!< PLL "Q" clock selected as SDMMC1 clock */
\r
599 #define RCC_SDMMC1CLKSOURCE_MSI RCC_CCIPR_CLK48SEL /*!< MSI clock selected as SDMMC1 clock */
\r
600 #if defined(RCC_CCIPR2_SDMMCSEL)
\r
601 #define RCC_SDMMC1CLKSOURCE_PLLP RCC_CCIPR2_SDMMCSEL /*!< PLL "P" clock selected as SDMMC1 kernel clock */
\r
602 #endif /* RCC_CCIPR2_SDMMCSEL */
\r
606 #endif /* SDMMC1 */
\r
608 /** @defgroup RCCEx_RNG_Clock_Source RNG Clock Source
\r
611 #if defined(RCC_HSI48_SUPPORT)
\r
612 #define RCC_RNGCLKSOURCE_HSI48 0x00000000U
\r
614 #define RCC_RNGCLKSOURCE_NONE 0x00000000U
\r
615 #endif /* RCC_HSI48_SUPPORT */
\r
616 #if defined(RCC_PLLSAI1_SUPPORT)
\r
617 #define RCC_RNGCLKSOURCE_PLLSAI1 RCC_CCIPR_CLK48SEL_0
\r
618 #endif /* RCC_PLLSAI1_SUPPORT */
\r
619 #define RCC_RNGCLKSOURCE_PLL RCC_CCIPR_CLK48SEL_1
\r
620 #define RCC_RNGCLKSOURCE_MSI RCC_CCIPR_CLK48SEL
\r
625 #if defined(USB_OTG_FS) || defined(USB)
\r
626 /** @defgroup RCCEx_USB_Clock_Source USB Clock Source
\r
629 #if defined(RCC_HSI48_SUPPORT)
\r
630 #define RCC_USBCLKSOURCE_HSI48 0x00000000U
\r
632 #define RCC_USBCLKSOURCE_NONE 0x00000000U
\r
633 #endif /* RCC_HSI48_SUPPORT */
\r
634 #if defined(RCC_PLLSAI1_SUPPORT)
\r
635 #define RCC_USBCLKSOURCE_PLLSAI1 RCC_CCIPR_CLK48SEL_0
\r
636 #endif /* RCC_PLLSAI1_SUPPORT */
\r
637 #define RCC_USBCLKSOURCE_PLL RCC_CCIPR_CLK48SEL_1
\r
638 #define RCC_USBCLKSOURCE_MSI RCC_CCIPR_CLK48SEL
\r
642 #endif /* USB_OTG_FS || USB */
\r
644 /** @defgroup RCCEx_ADC_Clock_Source ADC Clock Source
\r
647 #define RCC_ADCCLKSOURCE_NONE 0x00000000U
\r
648 #if defined(RCC_PLLSAI1_SUPPORT)
\r
649 #define RCC_ADCCLKSOURCE_PLLSAI1 RCC_CCIPR_ADCSEL_0
\r
650 #endif /* RCC_PLLSAI1_SUPPORT */
\r
651 #if defined(STM32L471xx) || defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx) || defined(STM32L496xx) || defined(STM32L4A6xx)
\r
652 #define RCC_ADCCLKSOURCE_PLLSAI2 RCC_CCIPR_ADCSEL_1
\r
653 #endif /* STM32L471xx || STM32L475xx || STM32L476xx || STM32L485xx || STM32L486xx || STM32L496xx || STM32L4A6xx */
\r
654 #if defined(RCC_CCIPR_ADCSEL)
\r
655 #define RCC_ADCCLKSOURCE_SYSCLK RCC_CCIPR_ADCSEL
\r
657 #define RCC_ADCCLKSOURCE_SYSCLK 0x30000000U
\r
658 #endif /* RCC_CCIPR_ADCSEL */
\r
663 #if defined(SWPMI1)
\r
664 /** @defgroup RCCEx_SWPMI1_Clock_Source SWPMI1 Clock Source
\r
667 #define RCC_SWPMI1CLKSOURCE_PCLK1 0x00000000U
\r
668 #define RCC_SWPMI1CLKSOURCE_HSI RCC_CCIPR_SWPMI1SEL
\r
672 #endif /* SWPMI1 */
\r
674 #if defined(DFSDM1_Filter0)
\r
675 /** @defgroup RCCEx_DFSDM1_Clock_Source DFSDM1 Clock Source
\r
678 #define RCC_DFSDM1CLKSOURCE_PCLK2 0x00000000U
\r
679 #if defined(STM32L4R5xx) || defined(STM32L4R7xx) || defined(STM32L4R9xx) || defined(STM32L4S5xx) || defined(STM32L4S7xx) || defined(STM32L4S9xx)
\r
680 #define RCC_DFSDM1CLKSOURCE_SYSCLK RCC_CCIPR2_DFSDM1SEL
\r
682 #define RCC_DFSDM1CLKSOURCE_SYSCLK RCC_CCIPR_DFSDM1SEL
\r
683 #endif /* STM32L4R5xx || STM32L4R7xx || STM32L4R9xx || STM32L4S5xx || STM32L4S7xx || STM32L4S9xx */
\r
688 #if defined(STM32L4R5xx) || defined(STM32L4R7xx) || defined(STM32L4R9xx) || defined(STM32L4S5xx) || defined(STM32L4S7xx) || defined(STM32L4S9xx)
\r
689 /** @defgroup RCCEx_DFSDM1_Audio_Clock_Source DFSDM1 Audio Clock Source
\r
692 #define RCC_DFSDM1AUDIOCLKSOURCE_SAI1 0x00000000U
\r
693 #define RCC_DFSDM1AUDIOCLKSOURCE_HSI RCC_CCIPR2_ADFSDM1SEL_0
\r
694 #define RCC_DFSDM1AUDIOCLKSOURCE_MSI RCC_CCIPR2_ADFSDM1SEL_1
\r
698 #endif /* STM32L4R5xx || STM32L4R7xx || STM32L4R9xx || STM32L4S5xx || STM32L4S7xx || STM32L4S9xx */
\r
699 #endif /* DFSDM1_Filter0 */
\r
702 /** @defgroup RCCEx_LTDC_Clock_Source LTDC Clock Source
\r
705 #define RCC_LTDCCLKSOURCE_PLLSAI2_DIV2 0x00000000U
\r
706 #define RCC_LTDCCLKSOURCE_PLLSAI2_DIV4 RCC_CCIPR2_PLLSAI2DIVR_0
\r
707 #define RCC_LTDCCLKSOURCE_PLLSAI2_DIV8 RCC_CCIPR2_PLLSAI2DIVR_1
\r
708 #define RCC_LTDCCLKSOURCE_PLLSAI2_DIV16 RCC_CCIPR2_PLLSAI2DIVR
\r
715 /** @defgroup RCCEx_DSI_Clock_Source DSI Clock Source
\r
718 #define RCC_DSICLKSOURCE_DSIPHY 0x00000000U
\r
719 #define RCC_DSICLKSOURCE_PLLSAI2 RCC_CCIPR2_DSISEL
\r
725 #if defined(OCTOSPI1) || defined(OCTOSPI2)
\r
726 /** @defgroup RCCEx_OSPI_Clock_Source OctoSPI Clock Source
\r
729 #define RCC_OSPICLKSOURCE_SYSCLK 0x00000000U
\r
730 #define RCC_OSPICLKSOURCE_MSI RCC_CCIPR2_OSPISEL_0
\r
731 #define RCC_OSPICLKSOURCE_PLL RCC_CCIPR2_OSPISEL_1
\r
735 #endif /* OCTOSPI1 || OCTOSPI2 */
\r
737 /** @defgroup RCCEx_EXTI_LINE_LSECSS RCC LSE CSS external interrupt line
\r
740 #define RCC_EXTI_LINE_LSECSS EXTI_IMR1_IM19 /*!< External interrupt line 19 connected to the LSE CSS EXTI Line */
\r
747 /** @defgroup RCCEx_CRS_Status RCCEx CRS Status
\r
750 #define RCC_CRS_NONE 0x00000000U
\r
751 #define RCC_CRS_TIMEOUT 0x00000001U
\r
752 #define RCC_CRS_SYNCOK 0x00000002U
\r
753 #define RCC_CRS_SYNCWARN 0x00000004U
\r
754 #define RCC_CRS_SYNCERR 0x00000008U
\r
755 #define RCC_CRS_SYNCMISS 0x00000010U
\r
756 #define RCC_CRS_TRIMOVF 0x00000020U
\r
761 /** @defgroup RCCEx_CRS_SynchroSource RCCEx CRS SynchroSource
\r
764 #define RCC_CRS_SYNC_SOURCE_GPIO 0x00000000U /*!< Synchro Signal source GPIO */
\r
765 #define RCC_CRS_SYNC_SOURCE_LSE CRS_CFGR_SYNCSRC_0 /*!< Synchro Signal source LSE */
\r
766 #define RCC_CRS_SYNC_SOURCE_USB CRS_CFGR_SYNCSRC_1 /*!< Synchro Signal source USB SOF (default)*/
\r
771 /** @defgroup RCCEx_CRS_SynchroDivider RCCEx CRS SynchroDivider
\r
774 #define RCC_CRS_SYNC_DIV1 0x00000000U /*!< Synchro Signal not divided (default) */
\r
775 #define RCC_CRS_SYNC_DIV2 CRS_CFGR_SYNCDIV_0 /*!< Synchro Signal divided by 2 */
\r
776 #define RCC_CRS_SYNC_DIV4 CRS_CFGR_SYNCDIV_1 /*!< Synchro Signal divided by 4 */
\r
777 #define RCC_CRS_SYNC_DIV8 (CRS_CFGR_SYNCDIV_1 | CRS_CFGR_SYNCDIV_0) /*!< Synchro Signal divided by 8 */
\r
778 #define RCC_CRS_SYNC_DIV16 CRS_CFGR_SYNCDIV_2 /*!< Synchro Signal divided by 16 */
\r
779 #define RCC_CRS_SYNC_DIV32 (CRS_CFGR_SYNCDIV_2 | CRS_CFGR_SYNCDIV_0) /*!< Synchro Signal divided by 32 */
\r
780 #define RCC_CRS_SYNC_DIV64 (CRS_CFGR_SYNCDIV_2 | CRS_CFGR_SYNCDIV_1) /*!< Synchro Signal divided by 64 */
\r
781 #define RCC_CRS_SYNC_DIV128 CRS_CFGR_SYNCDIV /*!< Synchro Signal divided by 128 */
\r
786 /** @defgroup RCCEx_CRS_SynchroPolarity RCCEx CRS SynchroPolarity
\r
789 #define RCC_CRS_SYNC_POLARITY_RISING 0x00000000U /*!< Synchro Active on rising edge (default) */
\r
790 #define RCC_CRS_SYNC_POLARITY_FALLING CRS_CFGR_SYNCPOL /*!< Synchro Active on falling edge */
\r
795 /** @defgroup RCCEx_CRS_ReloadValueDefault RCCEx CRS ReloadValueDefault
\r
798 #define RCC_CRS_RELOADVALUE_DEFAULT 0x0000BB7FU /*!< The reset value of the RELOAD field corresponds
\r
799 to a target frequency of 48 MHz and a synchronization signal frequency of 1 kHz (SOF signal from USB). */
\r
804 /** @defgroup RCCEx_CRS_ErrorLimitDefault RCCEx CRS ErrorLimitDefault
\r
807 #define RCC_CRS_ERRORLIMIT_DEFAULT 0x00000022U /*!< Default Frequency error limit */
\r
812 /** @defgroup RCCEx_CRS_HSI48CalibrationDefault RCCEx CRS HSI48CalibrationDefault
\r
815 #if defined(STM32L412xx) || defined(STM32L422xx)
\r
816 #define RCC_CRS_HSI48CALIBRATION_DEFAULT 0x00000040U /*!< The default value is 64, which corresponds to the middle of the trimming interval.
\r
817 The trimming step is specified in the product datasheet. A higher TRIM value
\r
818 corresponds to a higher output frequency */
\r
820 #define RCC_CRS_HSI48CALIBRATION_DEFAULT 0x00000020U /*!< The default value is 32, which corresponds to the middle of the trimming interval.
\r
821 The trimming step is specified in the product datasheet. A higher TRIM value
\r
822 corresponds to a higher output frequency */
\r
828 /** @defgroup RCCEx_CRS_FreqErrorDirection RCCEx CRS FreqErrorDirection
\r
831 #define RCC_CRS_FREQERRORDIR_UP 0x00000000U /*!< Upcounting direction, the actual frequency is above the target */
\r
832 #define RCC_CRS_FREQERRORDIR_DOWN CRS_ISR_FEDIR /*!< Downcounting direction, the actual frequency is below the target */
\r
837 /** @defgroup RCCEx_CRS_Interrupt_Sources RCCEx CRS Interrupt Sources
\r
840 #define RCC_CRS_IT_SYNCOK CRS_CR_SYNCOKIE /*!< SYNC event OK */
\r
841 #define RCC_CRS_IT_SYNCWARN CRS_CR_SYNCWARNIE /*!< SYNC warning */
\r
842 #define RCC_CRS_IT_ERR CRS_CR_ERRIE /*!< Error */
\r
843 #define RCC_CRS_IT_ESYNC CRS_CR_ESYNCIE /*!< Expected SYNC */
\r
844 #define RCC_CRS_IT_SYNCERR CRS_CR_ERRIE /*!< SYNC error */
\r
845 #define RCC_CRS_IT_SYNCMISS CRS_CR_ERRIE /*!< SYNC missed */
\r
846 #define RCC_CRS_IT_TRIMOVF CRS_CR_ERRIE /*!< Trimming overflow or underflow */
\r
852 /** @defgroup RCCEx_CRS_Flags RCCEx CRS Flags
\r
855 #define RCC_CRS_FLAG_SYNCOK CRS_ISR_SYNCOKF /*!< SYNC event OK flag */
\r
856 #define RCC_CRS_FLAG_SYNCWARN CRS_ISR_SYNCWARNF /*!< SYNC warning flag */
\r
857 #define RCC_CRS_FLAG_ERR CRS_ISR_ERRF /*!< Error flag */
\r
858 #define RCC_CRS_FLAG_ESYNC CRS_ISR_ESYNCF /*!< Expected SYNC flag */
\r
859 #define RCC_CRS_FLAG_SYNCERR CRS_ISR_SYNCERR /*!< SYNC error */
\r
860 #define RCC_CRS_FLAG_SYNCMISS CRS_ISR_SYNCMISS /*!< SYNC missed*/
\r
861 #define RCC_CRS_FLAG_TRIMOVF CRS_ISR_TRIMOVF /*!< Trimming overflow or underflow */
\r
873 /* Exported macros -----------------------------------------------------------*/
\r
874 /** @defgroup RCCEx_Exported_Macros RCCEx Exported Macros
\r
878 #if defined(RCC_PLLSAI1_SUPPORT)
\r
881 * @brief Macro to configure the PLLSAI1 clock multiplication and division factors.
\r
883 * @note This function must be used only when the PLLSAI1 is disabled.
\r
884 * @note PLLSAI1 clock source is common with the main PLL (configured through
\r
885 * __HAL_RCC_PLL_CONFIG() macro)
\r
888 * @param __PLLSAI1M__ specifies the division factor of PLLSAI1 input clock.
\r
889 * This parameter must be a number between Min_Data = 1 and Max_Data = 16.
\r
892 * @param __PLLSAI1N__ specifies the multiplication factor for PLLSAI1 VCO output clock.
\r
893 * This parameter must be a number between 8 and 86.
\r
894 * @note You have to set the PLLSAI1N parameter correctly to ensure that the VCO
\r
895 * output frequency is between 64 and 344 MHz.
\r
896 * PLLSAI1 clock frequency = f(PLLSAI1) multiplied by PLLSAI1N
\r
898 * @param __PLLSAI1P__ specifies the division factor for SAI clock.
\r
899 * This parameter must be a number in the range (7 or 17) for STM32L47xxx/L48xxx
\r
901 * SAI1 clock frequency = f(PLLSAI1) / PLLSAI1P
\r
903 * @param __PLLSAI1Q__ specifies the division factor for USB/RNG/SDMMC1 clock.
\r
904 * This parameter must be in the range (2, 4, 6 or 8).
\r
905 * USB/RNG/SDMMC1 clock frequency = f(PLLSAI1) / PLLSAI1Q
\r
907 * @param __PLLSAI1R__ specifies the division factor for SAR ADC clock.
\r
908 * This parameter must be in the range (2, 4, 6 or 8).
\r
909 * ADC clock frequency = f(PLLSAI1) / PLLSAI1R
\r
913 #if defined(RCC_PLLSAI1M_DIV_1_16_SUPPORT)
\r
915 #if defined(RCC_PLLSAI1P_DIV_2_31_SUPPORT)
\r
917 #define __HAL_RCC_PLLSAI1_CONFIG(__PLLSAI1M__, __PLLSAI1N__, __PLLSAI1P__, __PLLSAI1Q__, __PLLSAI1R__) \
\r
918 MODIFY_REG(RCC->PLLSAI1CFGR, \
\r
919 (RCC_PLLSAI1CFGR_PLLSAI1M | RCC_PLLSAI1CFGR_PLLSAI1N | RCC_PLLSAI1CFGR_PLLSAI1P | \
\r
920 RCC_PLLSAI1CFGR_PLLSAI1Q | RCC_PLLSAI1CFGR_PLLSAI1R | RCC_PLLSAI1CFGR_PLLSAI1PDIV), \
\r
921 ((((__PLLSAI1M__) - 1U) << RCC_PLLSAI1CFGR_PLLSAI1M_Pos) | \
\r
922 ((__PLLSAI1N__) << RCC_PLLSAI1CFGR_PLLSAI1N_Pos) | \
\r
923 ((((__PLLSAI1Q__) >> 1U) - 1U) << RCC_PLLSAI1CFGR_PLLSAI1Q_Pos) | \
\r
924 ((((__PLLSAI1R__) >> 1U) - 1U) << RCC_PLLSAI1CFGR_PLLSAI1R_Pos) | \
\r
925 ((uint32_t)(__PLLSAI1P__) << RCC_PLLSAI1CFGR_PLLSAI1PDIV_Pos)))
\r
929 #define __HAL_RCC_PLLSAI1_CONFIG(__PLLSAI1M__, __PLLSAI1N__, __PLLSAI1P__, __PLLSAI1Q__, __PLLSAI1R__) \
\r
930 MODIFY_REG(RCC->PLLSAI1CFGR, \
\r
931 (RCC_PLLSAI1CFGR_PLLSAI1M | RCC_PLLSAI1CFGR_PLLSAI1N | RCC_PLLSAI1CFGR_PLLSAI1P | \
\r
932 RCC_PLLSAI1CFGR_PLLSAI1Q | RCC_PLLSAI1CFGR_PLLSAI1R), \
\r
933 ((((__PLLSAI1M__) - 1U) << RCC_PLLSAI1CFGR_PLLSAI1M_Pos) | \
\r
934 ((__PLLSAI1N__) << RCC_PLLSAI1CFGR_PLLSAI1N_Pos) | \
\r
935 ((((__PLLSAI1Q__) >> 1U) - 1U) << RCC_PLLSAI1CFGR_PLLSAI1Q_Pos) | \
\r
936 ((((__PLLSAI1R__) >> 1U) - 1U) << RCC_PLLSAI1CFGR_PLLSAI1R_Pos) | \
\r
937 (((__PLLSAI1P__) >> 4U) << RCC_PLLSAI1CFGR_PLLSAI1P_Pos)))
\r
939 #endif /* RCC_PLLSAI1P_DIV_2_31_SUPPORT */
\r
943 #if defined(RCC_PLLSAI1P_DIV_2_31_SUPPORT)
\r
945 #define __HAL_RCC_PLLSAI1_CONFIG(__PLLSAI1N__, __PLLSAI1P__, __PLLSAI1Q__, __PLLSAI1R__) \
\r
946 MODIFY_REG(RCC->PLLSAI1CFGR, \
\r
947 (RCC_PLLSAI1CFGR_PLLSAI1N | RCC_PLLSAI1CFGR_PLLSAI1P | \
\r
948 RCC_PLLSAI1CFGR_PLLSAI1Q | RCC_PLLSAI1CFGR_PLLSAI1R | RCC_PLLSAI1CFGR_PLLSAI1PDIV), \
\r
949 (((__PLLSAI1N__) << RCC_PLLSAI1CFGR_PLLSAI1N_Pos) | \
\r
950 ((((__PLLSAI1Q__) >> 1U) - 1U) << RCC_PLLSAI1CFGR_PLLSAI1Q_Pos) | \
\r
951 ((((__PLLSAI1R__) >> 1U) - 1U) << RCC_PLLSAI1CFGR_PLLSAI1R_Pos) | \
\r
952 ((uint32_t)(__PLLSAI1P__) << RCC_PLLSAI1CFGR_PLLSAI1PDIV_Pos)))
\r
956 #define __HAL_RCC_PLLSAI1_CONFIG(__PLLSAI1N__, __PLLSAI1P__, __PLLSAI1Q__, __PLLSAI1R__) \
\r
957 MODIFY_REG(RCC->PLLSAI1CFGR, \
\r
958 (RCC_PLLSAI1CFGR_PLLSAI1N | RCC_PLLSAI1CFGR_PLLSAI1P | \
\r
959 RCC_PLLSAI1CFGR_PLLSAI1Q | RCC_PLLSAI1CFGR_PLLSAI1R), \
\r
960 (((__PLLSAI1N__) << RCC_PLLSAI1CFGR_PLLSAI1N_Pos) | \
\r
961 ((((__PLLSAI1Q__) >> 1U) - 1U) << RCC_PLLSAI1CFGR_PLLSAI1Q_Pos) | \
\r
962 ((((__PLLSAI1R__) >> 1U) - 1U) << RCC_PLLSAI1CFGR_PLLSAI1R_Pos) | \
\r
963 (((__PLLSAI1P__) >> 4U) << RCC_PLLSAI1CFGR_PLLSAI1P_Pos)))
\r
965 #endif /* RCC_PLLSAI1P_DIV_2_31_SUPPORT */
\r
967 #endif /* RCC_PLLSAI1M_DIV_1_16_SUPPORT */
\r
970 * @brief Macro to configure the PLLSAI1 clock multiplication factor N.
\r
972 * @note This function must be used only when the PLLSAI1 is disabled.
\r
973 * @note PLLSAI1 clock source is common with the main PLL (configured through
\r
974 * __HAL_RCC_PLL_CONFIG() macro)
\r
976 * @param __PLLSAI1N__ specifies the multiplication factor for PLLSAI1 VCO output clock.
\r
977 * This parameter must be a number between 8 and 86.
\r
978 * @note You have to set the PLLSAI1N parameter correctly to ensure that the VCO
\r
979 * output frequency is between 64 and 344 MHz.
\r
980 * Use to set PLLSAI1 clock frequency = f(PLLSAI1) multiplied by PLLSAI1N
\r
984 #define __HAL_RCC_PLLSAI1_MULN_CONFIG(__PLLSAI1N__) \
\r
985 MODIFY_REG(RCC->PLLSAI1CFGR, RCC_PLLSAI1CFGR_PLLSAI1N, (__PLLSAI1N__) << RCC_PLLSAI1CFGR_PLLSAI1N_Pos)
\r
987 #if defined(RCC_PLLSAI1M_DIV_1_16_SUPPORT)
\r
989 /** @brief Macro to configure the PLLSAI1 input clock division factor M.
\r
991 * @note This function must be used only when the PLLSAI1 is disabled.
\r
992 * @note PLLSAI1 clock source is common with the main PLL (configured through
\r
993 * __HAL_RCC_PLL_CONFIG() macro)
\r
995 * @param __PLLSAI1M__ specifies the division factor for PLLSAI1 clock.
\r
996 * This parameter must be a number between Min_Data = 1 and Max_Data = 16.
\r
1001 #define __HAL_RCC_PLLSAI1_DIVM_CONFIG(__PLLSAI1M__) \
\r
1002 MODIFY_REG(RCC->PLLSAI1CFGR, RCC_PLLSAI1CFGR_PLLSAI1M, ((__PLLSAI1M__) - 1U) << RCC_PLLSAI1CFGR_PLLSAI1M_Pos)
\r
1004 #endif /* RCC_PLLSAI1M_DIV_1_16_SUPPORT */
\r
1006 /** @brief Macro to configure the PLLSAI1 clock division factor P.
\r
1008 * @note This function must be used only when the PLLSAI1 is disabled.
\r
1009 * @note PLLSAI1 clock source is common with the main PLL (configured through
\r
1010 * __HAL_RCC_PLL_CONFIG() macro)
\r
1012 * @param __PLLSAI1P__ specifies the division factor for SAI clock.
\r
1013 * This parameter must be a number in the range (7 or 17) for STM32L47xxx/L48xxx
\r
1015 * Use to set SAI1 clock frequency = f(PLLSAI1) / PLLSAI1P
\r
1019 #if defined(RCC_PLLSAI1P_DIV_2_31_SUPPORT)
\r
1021 #define __HAL_RCC_PLLSAI1_DIVP_CONFIG(__PLLSAI1P__) \
\r
1022 MODIFY_REG(RCC->PLLSAI1CFGR, RCC_PLLSAI1CFGR_PLLSAI1PDIV, (__PLLSAI1P__) << RCC_PLLSAI1CFGR_PLLSAI1PDIV_Pos)
\r
1026 #define __HAL_RCC_PLLSAI1_DIVP_CONFIG(__PLLSAI1P__) \
\r
1027 MODIFY_REG(RCC->PLLSAI1CFGR, RCC_PLLSAI1CFGR_PLLSAI1P, ((__PLLSAI1P__) >> 4U) << RCC_PLLSAI1CFGR_PLLSAI1P_Pos)
\r
1029 #endif /* RCC_PLLSAI1P_DIV_2_31_SUPPORT */
\r
1031 /** @brief Macro to configure the PLLSAI1 clock division factor Q.
\r
1033 * @note This function must be used only when the PLLSAI1 is disabled.
\r
1034 * @note PLLSAI1 clock source is common with the main PLL (configured through
\r
1035 * __HAL_RCC_PLL_CONFIG() macro)
\r
1037 * @param __PLLSAI1Q__ specifies the division factor for USB/RNG/SDMMC1 clock.
\r
1038 * This parameter must be in the range (2, 4, 6 or 8).
\r
1039 * Use to set USB/RNG/SDMMC1 clock frequency = f(PLLSAI1) / PLLSAI1Q
\r
1043 #define __HAL_RCC_PLLSAI1_DIVQ_CONFIG(__PLLSAI1Q__) \
\r
1044 MODIFY_REG(RCC->PLLSAI1CFGR, RCC_PLLSAI1CFGR_PLLSAI1Q, (((__PLLSAI1Q__) >> 1U) - 1U) << RCC_PLLSAI1CFGR_PLLSAI1Q_Pos)
\r
1046 /** @brief Macro to configure the PLLSAI1 clock division factor R.
\r
1048 * @note This function must be used only when the PLLSAI1 is disabled.
\r
1049 * @note PLLSAI1 clock source is common with the main PLL (configured through
\r
1050 * __HAL_RCC_PLL_CONFIG() macro)
\r
1052 * @param __PLLSAI1R__ specifies the division factor for ADC clock.
\r
1053 * This parameter must be in the range (2, 4, 6 or 8)
\r
1054 * Use to set ADC clock frequency = f(PLLSAI1) / PLLSAI1R
\r
1058 #define __HAL_RCC_PLLSAI1_DIVR_CONFIG(__PLLSAI1R__) \
\r
1059 MODIFY_REG(RCC->PLLSAI1CFGR, RCC_PLLSAI1CFGR_PLLSAI1R, (((__PLLSAI1R__) >> 1U) - 1U) << RCC_PLLSAI1CFGR_PLLSAI1R_Pos)
\r
1062 * @brief Macros to enable or disable the PLLSAI1.
\r
1063 * @note The PLLSAI1 is disabled by hardware when entering STOP and STANDBY modes.
\r
1067 #define __HAL_RCC_PLLSAI1_ENABLE() SET_BIT(RCC->CR, RCC_CR_PLLSAI1ON)
\r
1069 #define __HAL_RCC_PLLSAI1_DISABLE() CLEAR_BIT(RCC->CR, RCC_CR_PLLSAI1ON)
\r
1072 * @brief Macros to enable or disable each clock output (PLLSAI1_SAI1, PLLSAI1_USB2 and PLLSAI1_ADC1).
\r
1073 * @note Enabling and disabling those clocks can be done without the need to stop the PLL.
\r
1074 * This is mainly used to save Power.
\r
1075 * @param __PLLSAI1_CLOCKOUT__ specifies the PLLSAI1 clock to be output.
\r
1076 * This parameter can be one or a combination of the following values:
\r
1077 * @arg @ref RCC_PLLSAI1_SAI1CLK This clock is used to generate an accurate clock to achieve
\r
1078 * high-quality audio performance on SAI interface in case.
\r
1079 * @arg @ref RCC_PLLSAI1_48M2CLK This clock is used to generate the clock for the USB OTG FS (48 MHz),
\r
1080 * the random number generator (<=48 MHz) and the SDIO (<= 48 MHz).
\r
1081 * @arg @ref RCC_PLLSAI1_ADC1CLK Clock used to clock ADC peripheral.
\r
1085 #define __HAL_RCC_PLLSAI1CLKOUT_ENABLE(__PLLSAI1_CLOCKOUT__) SET_BIT(RCC->PLLSAI1CFGR, (__PLLSAI1_CLOCKOUT__))
\r
1087 #define __HAL_RCC_PLLSAI1CLKOUT_DISABLE(__PLLSAI1_CLOCKOUT__) CLEAR_BIT(RCC->PLLSAI1CFGR, (__PLLSAI1_CLOCKOUT__))
\r
1090 * @brief Macro to get clock output enable status (PLLSAI1_SAI1, PLLSAI1_USB2 and PLLSAI1_ADC1).
\r
1091 * @param __PLLSAI1_CLOCKOUT__ specifies the PLLSAI1 clock to be output.
\r
1092 * This parameter can be one of the following values:
\r
1093 * @arg @ref RCC_PLLSAI1_SAI1CLK This clock is used to generate an accurate clock to achieve
\r
1094 * high-quality audio performance on SAI interface in case.
\r
1095 * @arg @ref RCC_PLLSAI1_48M2CLK This clock is used to generate the clock for the USB OTG FS (48 MHz),
\r
1096 * the random number generator (<=48 MHz) and the SDIO (<= 48 MHz).
\r
1097 * @arg @ref RCC_PLLSAI1_ADC1CLK Clock used to clock ADC peripheral.
\r
1098 * @retval SET / RESET
\r
1100 #define __HAL_RCC_GET_PLLSAI1CLKOUT_CONFIG(__PLLSAI1_CLOCKOUT__) READ_BIT(RCC->PLLSAI1CFGR, (__PLLSAI1_CLOCKOUT__))
\r
1102 #endif /* RCC_PLLSAI1_SUPPORT */
\r
1104 #if defined(RCC_PLLSAI2_SUPPORT)
\r
1107 * @brief Macro to configure the PLLSAI2 clock multiplication and division factors.
\r
1109 * @note This function must be used only when the PLLSAI2 is disabled.
\r
1110 * @note PLLSAI2 clock source is common with the main PLL (configured through
\r
1111 * __HAL_RCC_PLL_CONFIG() macro)
\r
1114 * @param __PLLSAI2M__ specifies the division factor of PLLSAI2 input clock.
\r
1115 * This parameter must be a number between Min_Data = 1 and Max_Data = 16.
\r
1118 * @param __PLLSAI2N__ specifies the multiplication factor for PLLSAI2 VCO output clock.
\r
1119 * This parameter must be a number between 8 and 86.
\r
1120 * @note You have to set the PLLSAI2N parameter correctly to ensure that the VCO
\r
1121 * output frequency is between 64 and 344 MHz.
\r
1123 * @param __PLLSAI2P__ specifies the division factor for SAI clock.
\r
1124 * This parameter must be a number in the range (7 or 17) for STM32L47xxx/L48xxx
\r
1126 * SAI2 clock frequency = f(PLLSAI2) / PLLSAI2P
\r
1129 * @param __PLLSAI2Q__ specifies the division factor for DSI clock.
\r
1130 * This parameter must be in the range (2, 4, 6 or 8).
\r
1131 * DSI clock frequency = f(PLLSAI2) / PLLSAI2Q
\r
1134 * @param __PLLSAI2R__ specifies the division factor for SAR ADC clock.
\r
1135 * This parameter must be in the range (2, 4, 6 or 8).
\r
1140 #if defined(RCC_PLLSAI2M_DIV_1_16_SUPPORT)
\r
1142 # if defined(RCC_PLLSAI2P_DIV_2_31_SUPPORT) && defined(RCC_PLLSAI2Q_DIV_SUPPORT)
\r
1144 #define __HAL_RCC_PLLSAI2_CONFIG(__PLLSAI2M__, __PLLSAI2N__, __PLLSAI2P__, __PLLSAI2Q__, __PLLSAI2R__) \
\r
1145 MODIFY_REG(RCC->PLLSAI2CFGR, \
\r
1146 (RCC_PLLSAI2CFGR_PLLSAI2M | RCC_PLLSAI2CFGR_PLLSAI2N | RCC_PLLSAI2CFGR_PLLSAI2P | \
\r
1147 RCC_PLLSAI2CFGR_PLLSAI2Q | RCC_PLLSAI2CFGR_PLLSAI2R | RCC_PLLSAI2CFGR_PLLSAI2PDIV), \
\r
1148 ((((__PLLSAI2M__) - 1U) << RCC_PLLSAI2CFGR_PLLSAI2M_Pos) | \
\r
1149 ((__PLLSAI2N__) << RCC_PLLSAI2CFGR_PLLSAI2N_Pos) | \
\r
1150 ((((__PLLSAI2Q__) >> 1U) - 1U) << RCC_PLLSAI2CFGR_PLLSAI2Q_Pos) | \
\r
1151 ((((__PLLSAI2R__) >> 1U) - 1U) << RCC_PLLSAI2CFGR_PLLSAI2R_Pos) | \
\r
1152 ((uint32_t)(__PLLSAI2P__) << RCC_PLLSAI2CFGR_PLLSAI2PDIV_Pos)))
\r
1154 # elif defined(RCC_PLLSAI2P_DIV_2_31_SUPPORT)
\r
1156 #define __HAL_RCC_PLLSAI2_CONFIG(__PLLSAI2M__, __PLLSAI2N__, __PLLSAI2P__, __PLLSAI2R__) \
\r
1157 MODIFY_REG(RCC->PLLSAI2CFGR, \
\r
1158 (RCC_PLLSAI2CFGR_PLLSAI2M | RCC_PLLSAI2CFGR_PLLSAI2N | RCC_PLLSAI2CFGR_PLLSAI2P | \
\r
1159 RCC_PLLSAI2CFGR_PLLSAI2R | RCC_PLLSAI2CFGR_PLLSAI2PDIV), \
\r
1160 ((((__PLLSAI2M__) - 1U) << RCC_PLLSAI2CFGR_PLLSAI2M_Pos) | \
\r
1161 ((__PLLSAI2N__) << RCC_PLLSAI2CFGR_PLLSAI2N_Pos) | \
\r
1162 ((((__PLLSAI2R__) >> 1U) - 1U) << RCC_PLLSAI2CFGR_PLLSAI2R_Pos) | \
\r
1163 ((uint32_t)(__PLLSAI2P__) << RCC_PLLSAI2CFGR_PLLSAI2PDIV_Pos)))
\r
1167 #define __HAL_RCC_PLLSAI2_CONFIG(__PLLSAI2M__, __PLLSAI2N__, __PLLSAI2P__, __PLLSAI2R__) \
\r
1168 MODIFY_REG(RCC->PLLSAI2CFGR, \
\r
1169 (RCC_PLLSAI2CFGR_PLLSAI2M | RCC_PLLSAI2CFGR_PLLSAI2N | RCC_PLLSAI2CFGR_PLLSAI2P | \
\r
1170 RCC_PLLSAI2CFGR_PLLSAI2R), \
\r
1171 ((((__PLLSAI2M__) - 1U) << RCC_PLLSAI2CFGR_PLLSAI2M_Pos) | \
\r
1172 ((__PLLSAI2N__) << RCC_PLLSAI2CFGR_PLLSAI2N_Pos) | \
\r
1173 ((((__PLLSAI2R__) >> 1U) - 1U) << RCC_PLLSAI2CFGR_PLLSAI2R_Pos) | \
\r
1174 (((__PLLSAI2P__) >> 4U) << RCC_PLLSAI2CFGR_PLLSAI2P_Pos)))
\r
1176 # endif /* RCC_PLLSAI2P_DIV_2_31_SUPPORT && RCC_PLLSAI2Q_DIV_SUPPORT */
\r
1180 # if defined(RCC_PLLSAI2P_DIV_2_31_SUPPORT) && defined(RCC_PLLSAI2Q_DIV_SUPPORT)
\r
1182 #define __HAL_RCC_PLLSAI2_CONFIG(__PLLSAI2N__, __PLLSAI2P__, __PLLSAI2Q__, __PLLSAI2R__) \
\r
1183 MODIFY_REG(RCC->PLLSAI2CFGR, \
\r
1184 (RCC_PLLSAI2CFGR_PLLSAI2N | RCC_PLLSAI2CFGR_PLLSAI2P | \
\r
1185 RCC_PLLSAI2CFGR_PLLSAI2Q | RCC_PLLSAI2CFGR_PLLSAI2R | RCC_PLLSAI2CFGR_PLLSAI2PDIV), \
\r
1186 (((__PLLSAI2N__) << RCC_PLLSAI2CFGR_PLLSAI2N_Pos) | \
\r
1187 ((((__PLLSAI2Q__) >> 1U) - 1U) << RCC_PLLSAI2CFGR_PLLSAI2Q_Pos) | \
\r
1188 ((((__PLLSAI2R__) >> 1U) - 1U) << RCC_PLLSAI2CFGR_PLLSAI2R_Pos) | \
\r
1189 ((uint32_t)(__PLLSAI2P__) << RCC_PLLSAI2CFGR_PLLSAI2PDIV_Pos)))
\r
1191 # elif defined(RCC_PLLSAI2P_DIV_2_31_SUPPORT)
\r
1193 #define __HAL_RCC_PLLSAI2_CONFIG(__PLLSAI2N__, __PLLSAI2P__, __PLLSAI2R__) \
\r
1194 MODIFY_REG(RCC->PLLSAI2CFGR, \
\r
1195 (RCC_PLLSAI2CFGR_PLLSAI2N | RCC_PLLSAI2CFGR_PLLSAI2P | \
\r
1196 RCC_PLLSAI2CFGR_PLLSAI2R | RCC_PLLSAI2CFGR_PLLSAI2PDIV), \
\r
1197 (((__PLLSAI2N__) << RCC_PLLSAI2CFGR_PLLSAI2N_Pos) | \
\r
1198 ((((__PLLSAI2R__) >> 1U) - 1U) << RCC_PLLSAI2CFGR_PLLSAI2R_Pos) | \
\r
1199 ((uint32_t)(__PLLSAI2P__) << RCC_PLLSAI2CFGR_PLLSAI2PDIV_Pos)))
\r
1203 #define __HAL_RCC_PLLSAI2_CONFIG(__PLLSAI2N__, __PLLSAI2P__, __PLLSAI2R__) \
\r
1204 MODIFY_REG(RCC->PLLSAI2CFGR, \
\r
1205 (RCC_PLLSAI2CFGR_PLLSAI2N | RCC_PLLSAI2CFGR_PLLSAI2P | \
\r
1206 RCC_PLLSAI2CFGR_PLLSAI2R), \
\r
1207 (((__PLLSAI2N__) << RCC_PLLSAI2CFGR_PLLSAI2N_Pos) | \
\r
1208 ((((__PLLSAI2R__) >> 1U) - 1U) << RCC_PLLSAI2CFGR_PLLSAI2R_Pos) | \
\r
1209 (((__PLLSAI2P__) >> 4U) << RCC_PLLSAI2CFGR_PLLSAI2P_Pos)))
\r
1211 # endif /* RCC_PLLSAI2P_DIV_2_31_SUPPORT && RCC_PLLSAI2Q_DIV_SUPPORT */
\r
1213 #endif /* RCC_PLLSAI2M_DIV_1_16_SUPPORT */
\r
1217 * @brief Macro to configure the PLLSAI2 clock multiplication factor N.
\r
1219 * @note This function must be used only when the PLLSAI2 is disabled.
\r
1220 * @note PLLSAI2 clock source is common with the main PLL (configured through
\r
1221 * __HAL_RCC_PLL_CONFIG() macro)
\r
1223 * @param __PLLSAI2N__ specifies the multiplication factor for PLLSAI2 VCO output clock.
\r
1224 * This parameter must be a number between 8 and 86.
\r
1225 * @note You have to set the PLLSAI2N parameter correctly to ensure that the VCO
\r
1226 * output frequency is between 64 and 344 MHz.
\r
1227 * PLLSAI1 clock frequency = f(PLLSAI1) multiplied by PLLSAI2N
\r
1231 #define __HAL_RCC_PLLSAI2_MULN_CONFIG(__PLLSAI2N__) \
\r
1232 MODIFY_REG(RCC->PLLSAI2CFGR, RCC_PLLSAI2CFGR_PLLSAI2N, (__PLLSAI2N__) << RCC_PLLSAI2CFGR_PLLSAI2N_Pos)
\r
1234 #if defined(RCC_PLLSAI2M_DIV_1_16_SUPPORT)
\r
1236 /** @brief Macro to configure the PLLSAI2 input clock division factor M.
\r
1238 * @note This function must be used only when the PLLSAI2 is disabled.
\r
1239 * @note PLLSAI2 clock source is common with the main PLL (configured through
\r
1240 * __HAL_RCC_PLL_CONFIG() macro)
\r
1242 * @param __PLLSAI2M__ specifies the division factor for PLLSAI2 clock.
\r
1243 * This parameter must be a number between Min_Data = 1 and Max_Data = 16.
\r
1248 #define __HAL_RCC_PLLSAI2_DIVM_CONFIG(__PLLSAI2M__) \
\r
1249 MODIFY_REG(RCC->PLLSAI2CFGR, RCC_PLLSAI2CFGR_PLLSAI2M, ((__PLLSAI2M__) - 1U) << RCC_PLLSAI2CFGR_PLLSAI2M_Pos)
\r
1251 #endif /* RCC_PLLSAI2M_DIV_1_16_SUPPORT */
\r
1253 /** @brief Macro to configure the PLLSAI2 clock division factor P.
\r
1255 * @note This function must be used only when the PLLSAI2 is disabled.
\r
1256 * @note PLLSAI2 clock source is common with the main PLL (configured through
\r
1257 * __HAL_RCC_PLL_CONFIG() macro)
\r
1259 * @param __PLLSAI2P__ specifies the division factor.
\r
1260 * This parameter must be a number in the range (7 or 17).
\r
1261 * Use to set SAI2 clock frequency = f(PLLSAI2) / __PLLSAI2P__
\r
1265 #define __HAL_RCC_PLLSAI2_DIVP_CONFIG(__PLLSAI2P__) \
\r
1266 MODIFY_REG(RCC->PLLSAI2CFGR, RCC_PLLSAI2CFGR_PLLSAI2P, ((__PLLSAI2P__) >> 4U) << RCC_PLLSAI2CFGR_PLLSAI2P_Pos)
\r
1268 #if defined(RCC_PLLSAI2Q_DIV_SUPPORT)
\r
1270 /** @brief Macro to configure the PLLSAI2 clock division factor Q.
\r
1272 * @note This function must be used only when the PLLSAI2 is disabled.
\r
1273 * @note PLLSAI2 clock source is common with the main PLL (configured through
\r
1274 * __HAL_RCC_PLL_CONFIG() macro)
\r
1276 * @param __PLLSAI2Q__ specifies the division factor for USB/RNG/SDMMC1 clock.
\r
1277 * This parameter must be in the range (2, 4, 6 or 8).
\r
1278 * Use to set USB/RNG/SDMMC1 clock frequency = f(PLLSAI2) / PLLSAI2Q
\r
1282 #define __HAL_RCC_PLLSAI2_DIVQ_CONFIG(__PLLSAI2Q__) \
\r
1283 MODIFY_REG(RCC->PLLSAI2CFGR, RCC_PLLSAI2CFGR_PLLSAI2Q, (((__PLLSAI2Q__) >> 1U) - 1U) << RCC_PLLSAI2CFGR_PLLSAI2Q_Pos)
\r
1285 #endif /* RCC_PLLSAI2Q_DIV_SUPPORT */
\r
1287 /** @brief Macro to configure the PLLSAI2 clock division factor R.
\r
1289 * @note This function must be used only when the PLLSAI2 is disabled.
\r
1290 * @note PLLSAI2 clock source is common with the main PLL (configured through
\r
1291 * __HAL_RCC_PLL_CONFIG() macro)
\r
1293 * @param __PLLSAI2R__ specifies the division factor.
\r
1294 * This parameter must be in the range (2, 4, 6 or 8).
\r
1295 * Use to set ADC clock frequency = f(PLLSAI2) / __PLLSAI2R__
\r
1299 #define __HAL_RCC_PLLSAI2_DIVR_CONFIG(__PLLSAI2R__) \
\r
1300 MODIFY_REG(RCC->PLLSAI2CFGR, RCC_PLLSAI2CFGR_PLLSAI2R, (((__PLLSAI2R__) >> 1U) - 1U) << RCC_PLLSAI2CFGR_PLLSAI2R_Pos)
\r
1303 * @brief Macros to enable or disable the PLLSAI2.
\r
1304 * @note The PLLSAI2 is disabled by hardware when entering STOP and STANDBY modes.
\r
1308 #define __HAL_RCC_PLLSAI2_ENABLE() SET_BIT(RCC->CR, RCC_CR_PLLSAI2ON)
\r
1310 #define __HAL_RCC_PLLSAI2_DISABLE() CLEAR_BIT(RCC->CR, RCC_CR_PLLSAI2ON)
\r
1313 * @brief Macros to enable or disable each clock output (PLLSAI2_SAI2, PLLSAI2_ADC2 and RCC_PLLSAI2_DSICLK).
\r
1314 * @note Enabling and disabling those clocks can be done without the need to stop the PLL.
\r
1315 * This is mainly used to save Power.
\r
1316 * @param __PLLSAI2_CLOCKOUT__ specifies the PLLSAI2 clock to be output.
\r
1317 * This parameter can be one or a combination of the following values:
\r
1319 * @arg @ref RCC_PLLSAI2_SAI2CLK This clock is used to generate an accurate clock to achieve
\r
1320 * high-quality audio performance on SAI interface in case.
\r
1321 * @arg @ref RCC_PLLSAI2_ADC2CLK Clock used to clock ADC peripheral.
\r
1324 * @arg @ref RCC_PLLSAI2_SAI2CLK This clock is used to generate an accurate clock to achieve
\r
1325 * high-quality audio performance on SAI interface in case.
\r
1326 * @arg @ref RCC_PLLSAI2_ADC2CLK Clock used to clock ADC peripheral.
\r
1329 * @arg @ref RCC_PLLSAI2_SAI2CLK This clock is used to generate an accurate clock to achieve
\r
1330 * high-quality audio performance on SAI interface in case.
\r
1331 * @arg @ref RCC_PLLSAI2_DSICLK Clock used to clock DSI peripheral.
\r
1336 #define __HAL_RCC_PLLSAI2CLKOUT_ENABLE(__PLLSAI2_CLOCKOUT__) SET_BIT(RCC->PLLSAI2CFGR, (__PLLSAI2_CLOCKOUT__))
\r
1338 #define __HAL_RCC_PLLSAI2CLKOUT_DISABLE(__PLLSAI2_CLOCKOUT__) CLEAR_BIT(RCC->PLLSAI2CFGR, (__PLLSAI2_CLOCKOUT__))
\r
1341 * @brief Macro to get clock output enable status (PLLSAI2_SAI2, PLLSAI2_ADC2 and RCC_PLLSAI2_DSICLK).
\r
1342 * @param __PLLSAI2_CLOCKOUT__ specifies the PLLSAI2 clock to be output.
\r
1343 * This parameter can be one of the following values:
\r
1345 * @arg @ref RCC_PLLSAI2_SAI2CLK This clock is used to generate an accurate clock to achieve
\r
1346 * high-quality audio performance on SAI interface in case.
\r
1347 * @arg @ref RCC_PLLSAI2_ADC2CLK Clock used to clock ADC peripheral.
\r
1350 * @arg @ref RCC_PLLSAI2_SAI2CLK This clock is used to generate an accurate clock to achieve
\r
1351 * high-quality audio performance on SAI interface in case.
\r
1352 * @arg @ref RCC_PLLSAI2_ADC2CLK Clock used to clock ADC peripheral.
\r
1355 * @arg @ref RCC_PLLSAI2_SAI2CLK This clock is used to generate an accurate clock to achieve
\r
1356 * high-quality audio performance on SAI interface in case.
\r
1357 * @arg @ref RCC_PLLSAI2_DSICLK Clock used to clock DSI peripheral.
\r
1359 * @retval SET / RESET
\r
1361 #define __HAL_RCC_GET_PLLSAI2CLKOUT_CONFIG(__PLLSAI2_CLOCKOUT__) READ_BIT(RCC->PLLSAI2CFGR, (__PLLSAI2_CLOCKOUT__))
\r
1363 #endif /* RCC_PLLSAI2_SUPPORT */
\r
1368 * @brief Macro to configure the SAI1 clock source.
\r
1369 * @param __SAI1_CLKSOURCE__ defines the SAI1 clock source. This clock is derived
\r
1370 * from the PLLSAI1, system PLL or external clock (through a dedicated pin).
\r
1371 * This parameter can be one of the following values:
\r
1372 * @arg @ref RCC_SAI1CLKSOURCE_PLLSAI1 SAI1 clock = PLLSAI1 "P" clock (PLLSAI1CLK)
\r
1374 * @arg @ref RCC_SAI1CLKSOURCE_PLLSAI2 SAI1 clock = PLLSAI2 "P" clock (PLLSAI2CLK) for devices with PLLSAI2
\r
1376 * @arg @ref RCC_SAI1CLKSOURCE_PLL SAI1 clock = PLL "P" clock (PLLSAI3CLK if PLLSAI2 exists, else PLLSAI2CLK)
\r
1377 * @arg @ref RCC_SAI1CLKSOURCE_PIN SAI1 clock = External Clock (SAI1_EXTCLK)
\r
1379 * @arg @ref RCC_SAI1CLKSOURCE_HSI SAI1 clock = HSI16
\r
1383 * @note HSI16 is automatically set as SAI1 clock source when PLL are disabled for devices without PLLSAI2.
\r
1388 #if defined(STM32L4R5xx) || defined(STM32L4R7xx) || defined(STM32L4R9xx) || defined(STM32L4S5xx) || defined(STM32L4S7xx) || defined(STM32L4S9xx)
\r
1389 #define __HAL_RCC_SAI1_CONFIG(__SAI1_CLKSOURCE__)\
\r
1390 MODIFY_REG(RCC->CCIPR2, RCC_CCIPR2_SAI1SEL, (__SAI1_CLKSOURCE__))
\r
1392 #define __HAL_RCC_SAI1_CONFIG(__SAI1_CLKSOURCE__)\
\r
1393 MODIFY_REG(RCC->CCIPR, RCC_CCIPR_SAI1SEL, (__SAI1_CLKSOURCE__))
\r
1394 #endif /* STM32L4R5xx || STM32L4R7xx || STM32L4R9xx || STM32L4S5xx || STM32L4S7xx || STM32L4S9xx */
\r
1396 /** @brief Macro to get the SAI1 clock source.
\r
1397 * @retval The clock source can be one of the following values:
\r
1398 * @arg @ref RCC_SAI1CLKSOURCE_PLLSAI1 SAI1 clock = PLLSAI1 "P" clock (PLLSAI1CLK)
\r
1400 * @arg @ref RCC_SAI1CLKSOURCE_PLLSAI2 SAI1 clock = PLLSAI2 "P" clock (PLLSAI2CLK) for devices with PLLSAI2
\r
1402 * @arg @ref RCC_SAI1CLKSOURCE_PLL SAI1 clock = PLL "P" clock (PLLSAI3CLK if PLLSAI2 exists, else PLLSAI2CLK)
\r
1403 * @arg @ref RCC_SAI1CLKSOURCE_PIN SAI1 clock = External Clock (SAI1_EXTCLK)
\r
1405 * @note Despite returned values RCC_SAI1CLKSOURCE_PLLSAI1 or RCC_SAI1CLKSOURCE_PLL, HSI16 is automatically set as SAI1
\r
1406 * clock source when PLLs are disabled for devices without PLLSAI2.
\r
1409 #if defined(STM32L4R5xx) || defined(STM32L4R7xx) || defined(STM32L4R9xx) || defined(STM32L4S5xx) || defined(STM32L4S7xx) || defined(STM32L4S9xx)
\r
1410 #define __HAL_RCC_GET_SAI1_SOURCE() (READ_BIT(RCC->CCIPR2, RCC_CCIPR2_SAI1SEL))
\r
1412 #define __HAL_RCC_GET_SAI1_SOURCE() (READ_BIT(RCC->CCIPR, RCC_CCIPR_SAI1SEL))
\r
1413 #endif /* STM32L4R5xx || STM32L4R7xx || STM32L4R9xx || STM32L4S5xx || STM32L4S7xx || STM32L4S9xx */
\r
1420 * @brief Macro to configure the SAI2 clock source.
\r
1421 * @param __SAI2_CLKSOURCE__ defines the SAI2 clock source. This clock is derived
\r
1422 * from the PLLSAI2, system PLL or external clock (through a dedicated pin).
\r
1423 * This parameter can be one of the following values:
\r
1424 * @arg @ref RCC_SAI2CLKSOURCE_PLLSAI1 SAI2 clock = PLLSAI1 "P" clock (PLLSAI1CLK)
\r
1425 * @arg @ref RCC_SAI2CLKSOURCE_PLLSAI2 SAI2 clock = PLLSAI2 "P" clock (PLLSAI2CLK)
\r
1426 * @arg @ref RCC_SAI2CLKSOURCE_PLL SAI2 clock = PLL "P" clock (PLLSAI3CLK)
\r
1427 * @arg @ref RCC_SAI2CLKSOURCE_PIN SAI2 clock = External Clock (SAI2_EXTCLK)
\r
1429 * @arg @ref RCC_SAI2CLKSOURCE_HSI SAI2 clock = HSI16
\r
1434 #if defined(STM32L4R5xx) || defined(STM32L4R7xx) || defined(STM32L4R9xx) || defined(STM32L4S5xx) || defined(STM32L4S7xx) || defined(STM32L4S9xx)
\r
1435 #define __HAL_RCC_SAI2_CONFIG(__SAI2_CLKSOURCE__ )\
\r
1436 MODIFY_REG(RCC->CCIPR2, RCC_CCIPR2_SAI2SEL, (__SAI2_CLKSOURCE__))
\r
1438 #define __HAL_RCC_SAI2_CONFIG(__SAI2_CLKSOURCE__ )\
\r
1439 MODIFY_REG(RCC->CCIPR, RCC_CCIPR_SAI2SEL, (__SAI2_CLKSOURCE__))
\r
1440 #endif /* STM32L4R5xx || STM32L4R7xx || STM32L4R9xx || STM32L4S5xx || STM32L4S7xx || STM32L4S9xx */
\r
1442 /** @brief Macro to get the SAI2 clock source.
\r
1443 * @retval The clock source can be one of the following values:
\r
1444 * @arg @ref RCC_SAI2CLKSOURCE_PLLSAI1 SAI2 clock = PLLSAI1 "P" clock (PLLSAI1CLK)
\r
1445 * @arg @ref RCC_SAI2CLKSOURCE_PLLSAI2 SAI2 clock = PLLSAI2 "P" clock (PLLSAI2CLK)
\r
1446 * @arg @ref RCC_SAI2CLKSOURCE_PLL SAI2 clock = PLL "P" clock (PLLSAI3CLK)
\r
1447 * @arg @ref RCC_SAI2CLKSOURCE_PIN SAI2 clock = External Clock (SAI2_EXTCLK)
\r
1449 #if defined(STM32L4R5xx) || defined(STM32L4R7xx) || defined(STM32L4R9xx) || defined(STM32L4S5xx) || defined(STM32L4S7xx) || defined(STM32L4S9xx)
\r
1450 #define __HAL_RCC_GET_SAI2_SOURCE() (READ_BIT(RCC->CCIPR2, RCC_CCIPR2_SAI2SEL))
\r
1452 #define __HAL_RCC_GET_SAI2_SOURCE() (READ_BIT(RCC->CCIPR, RCC_CCIPR_SAI2SEL))
\r
1453 #endif /* STM32L4R5xx || STM32L4R7xx || STM32L4R9xx || STM32L4S5xx || STM32L4S7xx || STM32L4S9xx */
\r
1457 /** @brief Macro to configure the I2C1 clock (I2C1CLK).
\r
1459 * @param __I2C1_CLKSOURCE__ specifies the I2C1 clock source.
\r
1460 * This parameter can be one of the following values:
\r
1461 * @arg @ref RCC_I2C1CLKSOURCE_PCLK1 PCLK1 selected as I2C1 clock
\r
1462 * @arg @ref RCC_I2C1CLKSOURCE_HSI HSI selected as I2C1 clock
\r
1463 * @arg @ref RCC_I2C1CLKSOURCE_SYSCLK System Clock selected as I2C1 clock
\r
1466 #define __HAL_RCC_I2C1_CONFIG(__I2C1_CLKSOURCE__) \
\r
1467 MODIFY_REG(RCC->CCIPR, RCC_CCIPR_I2C1SEL, (__I2C1_CLKSOURCE__))
\r
1469 /** @brief Macro to get the I2C1 clock source.
\r
1470 * @retval The clock source can be one of the following values:
\r
1471 * @arg @ref RCC_I2C1CLKSOURCE_PCLK1 PCLK1 selected as I2C1 clock
\r
1472 * @arg @ref RCC_I2C1CLKSOURCE_HSI HSI selected as I2C1 clock
\r
1473 * @arg @ref RCC_I2C1CLKSOURCE_SYSCLK System Clock selected as I2C1 clock
\r
1475 #define __HAL_RCC_GET_I2C1_SOURCE() (READ_BIT(RCC->CCIPR, RCC_CCIPR_I2C1SEL))
\r
1479 /** @brief Macro to configure the I2C2 clock (I2C2CLK).
\r
1481 * @param __I2C2_CLKSOURCE__ specifies the I2C2 clock source.
\r
1482 * This parameter can be one of the following values:
\r
1483 * @arg @ref RCC_I2C2CLKSOURCE_PCLK1 PCLK1 selected as I2C2 clock
\r
1484 * @arg @ref RCC_I2C2CLKSOURCE_HSI HSI selected as I2C2 clock
\r
1485 * @arg @ref RCC_I2C2CLKSOURCE_SYSCLK System Clock selected as I2C2 clock
\r
1488 #define __HAL_RCC_I2C2_CONFIG(__I2C2_CLKSOURCE__) \
\r
1489 MODIFY_REG(RCC->CCIPR, RCC_CCIPR_I2C2SEL, (__I2C2_CLKSOURCE__))
\r
1491 /** @brief Macro to get the I2C2 clock source.
\r
1492 * @retval The clock source can be one of the following values:
\r
1493 * @arg @ref RCC_I2C2CLKSOURCE_PCLK1 PCLK1 selected as I2C2 clock
\r
1494 * @arg @ref RCC_I2C2CLKSOURCE_HSI HSI selected as I2C2 clock
\r
1495 * @arg @ref RCC_I2C2CLKSOURCE_SYSCLK System Clock selected as I2C2 clock
\r
1497 #define __HAL_RCC_GET_I2C2_SOURCE() (READ_BIT(RCC->CCIPR, RCC_CCIPR_I2C2SEL))
\r
1501 /** @brief Macro to configure the I2C3 clock (I2C3CLK).
\r
1503 * @param __I2C3_CLKSOURCE__ specifies the I2C3 clock source.
\r
1504 * This parameter can be one of the following values:
\r
1505 * @arg @ref RCC_I2C3CLKSOURCE_PCLK1 PCLK1 selected as I2C3 clock
\r
1506 * @arg @ref RCC_I2C3CLKSOURCE_HSI HSI selected as I2C3 clock
\r
1507 * @arg @ref RCC_I2C3CLKSOURCE_SYSCLK System Clock selected as I2C3 clock
\r
1510 #define __HAL_RCC_I2C3_CONFIG(__I2C3_CLKSOURCE__) \
\r
1511 MODIFY_REG(RCC->CCIPR, RCC_CCIPR_I2C3SEL, (__I2C3_CLKSOURCE__))
\r
1513 /** @brief Macro to get the I2C3 clock source.
\r
1514 * @retval The clock source can be one of the following values:
\r
1515 * @arg @ref RCC_I2C3CLKSOURCE_PCLK1 PCLK1 selected as I2C3 clock
\r
1516 * @arg @ref RCC_I2C3CLKSOURCE_HSI HSI selected as I2C3 clock
\r
1517 * @arg @ref RCC_I2C3CLKSOURCE_SYSCLK System Clock selected as I2C3 clock
\r
1519 #define __HAL_RCC_GET_I2C3_SOURCE() (READ_BIT(RCC->CCIPR, RCC_CCIPR_I2C3SEL))
\r
1523 /** @brief Macro to configure the I2C4 clock (I2C4CLK).
\r
1525 * @param __I2C4_CLKSOURCE__ specifies the I2C4 clock source.
\r
1526 * This parameter can be one of the following values:
\r
1527 * @arg @ref RCC_I2C4CLKSOURCE_PCLK1 PCLK1 selected as I2C4 clock
\r
1528 * @arg @ref RCC_I2C4CLKSOURCE_HSI HSI selected as I2C4 clock
\r
1529 * @arg @ref RCC_I2C4CLKSOURCE_SYSCLK System Clock selected as I2C4 clock
\r
1532 #define __HAL_RCC_I2C4_CONFIG(__I2C4_CLKSOURCE__) \
\r
1533 MODIFY_REG(RCC->CCIPR2, RCC_CCIPR2_I2C4SEL, (__I2C4_CLKSOURCE__))
\r
1535 /** @brief Macro to get the I2C4 clock source.
\r
1536 * @retval The clock source can be one of the following values:
\r
1537 * @arg @ref RCC_I2C4CLKSOURCE_PCLK1 PCLK1 selected as I2C4 clock
\r
1538 * @arg @ref RCC_I2C4CLKSOURCE_HSI HSI selected as I2C4 clock
\r
1539 * @arg @ref RCC_I2C4CLKSOURCE_SYSCLK System Clock selected as I2C4 clock
\r
1541 #define __HAL_RCC_GET_I2C4_SOURCE() (READ_BIT(RCC->CCIPR2, RCC_CCIPR2_I2C4SEL))
\r
1546 /** @brief Macro to configure the USART1 clock (USART1CLK).
\r
1548 * @param __USART1_CLKSOURCE__ specifies the USART1 clock source.
\r
1549 * This parameter can be one of the following values:
\r
1550 * @arg @ref RCC_USART1CLKSOURCE_PCLK2 PCLK2 selected as USART1 clock
\r
1551 * @arg @ref RCC_USART1CLKSOURCE_HSI HSI selected as USART1 clock
\r
1552 * @arg @ref RCC_USART1CLKSOURCE_SYSCLK System Clock selected as USART1 clock
\r
1553 * @arg @ref RCC_USART1CLKSOURCE_LSE SE selected as USART1 clock
\r
1556 #define __HAL_RCC_USART1_CONFIG(__USART1_CLKSOURCE__) \
\r
1557 MODIFY_REG(RCC->CCIPR, RCC_CCIPR_USART1SEL, (__USART1_CLKSOURCE__))
\r
1559 /** @brief Macro to get the USART1 clock source.
\r
1560 * @retval The clock source can be one of the following values:
\r
1561 * @arg @ref RCC_USART1CLKSOURCE_PCLK2 PCLK2 selected as USART1 clock
\r
1562 * @arg @ref RCC_USART1CLKSOURCE_HSI HSI selected as USART1 clock
\r
1563 * @arg @ref RCC_USART1CLKSOURCE_SYSCLK System Clock selected as USART1 clock
\r
1564 * @arg @ref RCC_USART1CLKSOURCE_LSE LSE selected as USART1 clock
\r
1566 #define __HAL_RCC_GET_USART1_SOURCE() (READ_BIT(RCC->CCIPR, RCC_CCIPR_USART1SEL))
\r
1568 /** @brief Macro to configure the USART2 clock (USART2CLK).
\r
1570 * @param __USART2_CLKSOURCE__ specifies the USART2 clock source.
\r
1571 * This parameter can be one of the following values:
\r
1572 * @arg @ref RCC_USART2CLKSOURCE_PCLK1 PCLK1 selected as USART2 clock
\r
1573 * @arg @ref RCC_USART2CLKSOURCE_HSI HSI selected as USART2 clock
\r
1574 * @arg @ref RCC_USART2CLKSOURCE_SYSCLK System Clock selected as USART2 clock
\r
1575 * @arg @ref RCC_USART2CLKSOURCE_LSE LSE selected as USART2 clock
\r
1578 #define __HAL_RCC_USART2_CONFIG(__USART2_CLKSOURCE__) \
\r
1579 MODIFY_REG(RCC->CCIPR, RCC_CCIPR_USART2SEL, (__USART2_CLKSOURCE__))
\r
1581 /** @brief Macro to get the USART2 clock source.
\r
1582 * @retval The clock source can be one of the following values:
\r
1583 * @arg @ref RCC_USART2CLKSOURCE_PCLK1 PCLK1 selected as USART2 clock
\r
1584 * @arg @ref RCC_USART2CLKSOURCE_HSI HSI selected as USART2 clock
\r
1585 * @arg @ref RCC_USART2CLKSOURCE_SYSCLK System Clock selected as USART2 clock
\r
1586 * @arg @ref RCC_USART2CLKSOURCE_LSE LSE selected as USART2 clock
\r
1588 #define __HAL_RCC_GET_USART2_SOURCE() (READ_BIT(RCC->CCIPR, RCC_CCIPR_USART2SEL))
\r
1590 #if defined(USART3)
\r
1592 /** @brief Macro to configure the USART3 clock (USART3CLK).
\r
1594 * @param __USART3_CLKSOURCE__ specifies the USART3 clock source.
\r
1595 * This parameter can be one of the following values:
\r
1596 * @arg @ref RCC_USART3CLKSOURCE_PCLK1 PCLK1 selected as USART3 clock
\r
1597 * @arg @ref RCC_USART3CLKSOURCE_HSI HSI selected as USART3 clock
\r
1598 * @arg @ref RCC_USART3CLKSOURCE_SYSCLK System Clock selected as USART3 clock
\r
1599 * @arg @ref RCC_USART3CLKSOURCE_LSE LSE selected as USART3 clock
\r
1602 #define __HAL_RCC_USART3_CONFIG(__USART3_CLKSOURCE__) \
\r
1603 MODIFY_REG(RCC->CCIPR, RCC_CCIPR_USART3SEL, (__USART3_CLKSOURCE__))
\r
1605 /** @brief Macro to get the USART3 clock source.
\r
1606 * @retval The clock source can be one of the following values:
\r
1607 * @arg @ref RCC_USART3CLKSOURCE_PCLK1 PCLK1 selected as USART3 clock
\r
1608 * @arg @ref RCC_USART3CLKSOURCE_HSI HSI selected as USART3 clock
\r
1609 * @arg @ref RCC_USART3CLKSOURCE_SYSCLK System Clock selected as USART3 clock
\r
1610 * @arg @ref RCC_USART3CLKSOURCE_LSE LSE selected as USART3 clock
\r
1612 #define __HAL_RCC_GET_USART3_SOURCE() (READ_BIT(RCC->CCIPR, RCC_CCIPR_USART3SEL))
\r
1614 #endif /* USART3 */
\r
1616 #if defined(UART4)
\r
1618 /** @brief Macro to configure the UART4 clock (UART4CLK).
\r
1620 * @param __UART4_CLKSOURCE__ specifies the UART4 clock source.
\r
1621 * This parameter can be one of the following values:
\r
1622 * @arg @ref RCC_UART4CLKSOURCE_PCLK1 PCLK1 selected as UART4 clock
\r
1623 * @arg @ref RCC_UART4CLKSOURCE_HSI HSI selected as UART4 clock
\r
1624 * @arg @ref RCC_UART4CLKSOURCE_SYSCLK System Clock selected as UART4 clock
\r
1625 * @arg @ref RCC_UART4CLKSOURCE_LSE LSE selected as UART4 clock
\r
1628 #define __HAL_RCC_UART4_CONFIG(__UART4_CLKSOURCE__) \
\r
1629 MODIFY_REG(RCC->CCIPR, RCC_CCIPR_UART4SEL, (__UART4_CLKSOURCE__))
\r
1631 /** @brief Macro to get the UART4 clock source.
\r
1632 * @retval The clock source can be one of the following values:
\r
1633 * @arg @ref RCC_UART4CLKSOURCE_PCLK1 PCLK1 selected as UART4 clock
\r
1634 * @arg @ref RCC_UART4CLKSOURCE_HSI HSI selected as UART4 clock
\r
1635 * @arg @ref RCC_UART4CLKSOURCE_SYSCLK System Clock selected as UART4 clock
\r
1636 * @arg @ref RCC_UART4CLKSOURCE_LSE LSE selected as UART4 clock
\r
1638 #define __HAL_RCC_GET_UART4_SOURCE() (READ_BIT(RCC->CCIPR, RCC_CCIPR_UART4SEL))
\r
1640 #endif /* UART4 */
\r
1642 #if defined(UART5)
\r
1644 /** @brief Macro to configure the UART5 clock (UART5CLK).
\r
1646 * @param __UART5_CLKSOURCE__ specifies the UART5 clock source.
\r
1647 * This parameter can be one of the following values:
\r
1648 * @arg @ref RCC_UART5CLKSOURCE_PCLK1 PCLK1 selected as UART5 clock
\r
1649 * @arg @ref RCC_UART5CLKSOURCE_HSI HSI selected as UART5 clock
\r
1650 * @arg @ref RCC_UART5CLKSOURCE_SYSCLK System Clock selected as UART5 clock
\r
1651 * @arg @ref RCC_UART5CLKSOURCE_LSE LSE selected as UART5 clock
\r
1654 #define __HAL_RCC_UART5_CONFIG(__UART5_CLKSOURCE__) \
\r
1655 MODIFY_REG(RCC->CCIPR, RCC_CCIPR_UART5SEL, (__UART5_CLKSOURCE__))
\r
1657 /** @brief Macro to get the UART5 clock source.
\r
1658 * @retval The clock source can be one of the following values:
\r
1659 * @arg @ref RCC_UART5CLKSOURCE_PCLK1 PCLK1 selected as UART5 clock
\r
1660 * @arg @ref RCC_UART5CLKSOURCE_HSI HSI selected as UART5 clock
\r
1661 * @arg @ref RCC_UART5CLKSOURCE_SYSCLK System Clock selected as UART5 clock
\r
1662 * @arg @ref RCC_UART5CLKSOURCE_LSE LSE selected as UART5 clock
\r
1664 #define __HAL_RCC_GET_UART5_SOURCE() (READ_BIT(RCC->CCIPR, RCC_CCIPR_UART5SEL))
\r
1666 #endif /* UART5 */
\r
1668 /** @brief Macro to configure the LPUART1 clock (LPUART1CLK).
\r
1670 * @param __LPUART1_CLKSOURCE__ specifies the LPUART1 clock source.
\r
1671 * This parameter can be one of the following values:
\r
1672 * @arg @ref RCC_LPUART1CLKSOURCE_PCLK1 PCLK1 selected as LPUART1 clock
\r
1673 * @arg @ref RCC_LPUART1CLKSOURCE_HSI HSI selected as LPUART1 clock
\r
1674 * @arg @ref RCC_LPUART1CLKSOURCE_SYSCLK System Clock selected as LPUART1 clock
\r
1675 * @arg @ref RCC_LPUART1CLKSOURCE_LSE LSE selected as LPUART1 clock
\r
1678 #define __HAL_RCC_LPUART1_CONFIG(__LPUART1_CLKSOURCE__) \
\r
1679 MODIFY_REG(RCC->CCIPR, RCC_CCIPR_LPUART1SEL, (__LPUART1_CLKSOURCE__))
\r
1681 /** @brief Macro to get the LPUART1 clock source.
\r
1682 * @retval The clock source can be one of the following values:
\r
1683 * @arg @ref RCC_LPUART1CLKSOURCE_PCLK1 PCLK1 selected as LPUART1 clock
\r
1684 * @arg @ref RCC_LPUART1CLKSOURCE_HSI HSI selected as LPUART1 clock
\r
1685 * @arg @ref RCC_LPUART1CLKSOURCE_SYSCLK System Clock selected as LPUART1 clock
\r
1686 * @arg @ref RCC_LPUART1CLKSOURCE_LSE LSE selected as LPUART1 clock
\r
1688 #define __HAL_RCC_GET_LPUART1_SOURCE() (READ_BIT(RCC->CCIPR, RCC_CCIPR_LPUART1SEL))
\r
1690 /** @brief Macro to configure the LPTIM1 clock (LPTIM1CLK).
\r
1692 * @param __LPTIM1_CLKSOURCE__ specifies the LPTIM1 clock source.
\r
1693 * This parameter can be one of the following values:
\r
1694 * @arg @ref RCC_LPTIM1CLKSOURCE_PCLK1 PCLK1 selected as LPTIM1 clock
\r
1695 * @arg @ref RCC_LPTIM1CLKSOURCE_LSI HSI selected as LPTIM1 clock
\r
1696 * @arg @ref RCC_LPTIM1CLKSOURCE_HSI LSI selected as LPTIM1 clock
\r
1697 * @arg @ref RCC_LPTIM1CLKSOURCE_LSE LSE selected as LPTIM1 clock
\r
1700 #define __HAL_RCC_LPTIM1_CONFIG(__LPTIM1_CLKSOURCE__) \
\r
1701 MODIFY_REG(RCC->CCIPR, RCC_CCIPR_LPTIM1SEL, (__LPTIM1_CLKSOURCE__))
\r
1703 /** @brief Macro to get the LPTIM1 clock source.
\r
1704 * @retval The clock source can be one of the following values:
\r
1705 * @arg @ref RCC_LPTIM1CLKSOURCE_PCLK1 PCLK1 selected as LPUART1 clock
\r
1706 * @arg @ref RCC_LPTIM1CLKSOURCE_LSI HSI selected as LPUART1 clock
\r
1707 * @arg @ref RCC_LPTIM1CLKSOURCE_HSI System Clock selected as LPUART1 clock
\r
1708 * @arg @ref RCC_LPTIM1CLKSOURCE_LSE LSE selected as LPUART1 clock
\r
1710 #define __HAL_RCC_GET_LPTIM1_SOURCE() (READ_BIT(RCC->CCIPR, RCC_CCIPR_LPTIM1SEL))
\r
1712 /** @brief Macro to configure the LPTIM2 clock (LPTIM2CLK).
\r
1714 * @param __LPTIM2_CLKSOURCE__ specifies the LPTIM2 clock source.
\r
1715 * This parameter can be one of the following values:
\r
1716 * @arg @ref RCC_LPTIM2CLKSOURCE_PCLK1 PCLK1 selected as LPTIM2 clock
\r
1717 * @arg @ref RCC_LPTIM2CLKSOURCE_LSI HSI selected as LPTIM2 clock
\r
1718 * @arg @ref RCC_LPTIM2CLKSOURCE_HSI LSI selected as LPTIM2 clock
\r
1719 * @arg @ref RCC_LPTIM2CLKSOURCE_LSE LSE selected as LPTIM2 clock
\r
1722 #define __HAL_RCC_LPTIM2_CONFIG(__LPTIM2_CLKSOURCE__) \
\r
1723 MODIFY_REG(RCC->CCIPR, RCC_CCIPR_LPTIM2SEL, (__LPTIM2_CLKSOURCE__))
\r
1725 /** @brief Macro to get the LPTIM2 clock source.
\r
1726 * @retval The clock source can be one of the following values:
\r
1727 * @arg @ref RCC_LPTIM2CLKSOURCE_PCLK1 PCLK1 selected as LPUART1 clock
\r
1728 * @arg @ref RCC_LPTIM2CLKSOURCE_LSI HSI selected as LPUART1 clock
\r
1729 * @arg @ref RCC_LPTIM2CLKSOURCE_HSI System Clock selected as LPUART1 clock
\r
1730 * @arg @ref RCC_LPTIM2CLKSOURCE_LSE LSE selected as LPUART1 clock
\r
1732 #define __HAL_RCC_GET_LPTIM2_SOURCE() (READ_BIT(RCC->CCIPR, RCC_CCIPR_LPTIM2SEL))
\r
1734 #if defined(SDMMC1)
\r
1736 /** @brief Macro to configure the SDMMC1 clock.
\r
1739 * @note USB, RNG and SDMMC1 peripherals share the same 48MHz clock source.
\r
1743 * @note USB, RNG and SDMMC1 peripherals share the same 48MHz clock source.
\r
1746 * @param __SDMMC1_CLKSOURCE__ specifies the SDMMC1 clock source.
\r
1747 * This parameter can be one of the following values:
\r
1749 * @arg @ref RCC_SDMMC1CLKSOURCE_NONE No clock selected as SDMMC1 clock for devices without HSI48
\r
1750 * @arg @ref RCC_SDMMC1CLKSOURCE_MSI MSI selected as SDMMC1 clock
\r
1751 * @arg @ref RCC_SDMMC1CLKSOURCE_PLLSAI1 PLLSAI1 "Q" Clock selected as SDMMC1 clock
\r
1754 * @arg @ref RCC_SDMMC1CLKSOURCE_HSI48 HSI48 selected as SDMMC1 clock for devices with HSI48
\r
1755 * @arg @ref RCC_SDMMC1CLKSOURCE_MSI MSI selected as SDMMC1 clock
\r
1756 * @arg @ref RCC_SDMMC1CLKSOURCE_PLLSAI1 PLLSAI1 "Q" Clock selected as SDMMC1 clock
\r
1759 * @arg @ref RCC_SDMMC1CLKSOURCE_HSI48 HSI48 selected as SDMMC1 clock for devices with HSI48
\r
1760 * @arg @ref RCC_SDMMC1CLKSOURCE_MSI MSI selected as SDMMC1 clock
\r
1761 * @arg @ref RCC_SDMMC1CLKSOURCE_PLLSAI1 PLLSAI1 "Q" Clock selected as SDMMC1 clock
\r
1762 * @arg @ref RCC_SDMMC1CLKSOURCE_PLLP PLL "P" Clock selected as SDMMC1 clock
\r
1764 * @arg @ref RCC_SDMMC1CLKSOURCE_PLL PLL "Q" Clock selected as SDMMC1 clock
\r
1767 #if defined(RCC_CCIPR2_SDMMCSEL)
\r
1768 #define __HAL_RCC_SDMMC1_CONFIG(__SDMMC1_CLKSOURCE__) \
\r
1771 if((__SDMMC1_CLKSOURCE__) == RCC_SDMMC1CLKSOURCE_PLLP) \
\r
1773 SET_BIT(RCC->CCIPR2, RCC_CCIPR2_SDMMCSEL); \
\r
1777 CLEAR_BIT(RCC->CCIPR2, RCC_CCIPR2_SDMMCSEL); \
\r
1778 MODIFY_REG(RCC->CCIPR, RCC_CCIPR_CLK48SEL, (__SDMMC1_CLKSOURCE__)); \
\r
1782 #define __HAL_RCC_SDMMC1_CONFIG(__SDMMC1_CLKSOURCE__) \
\r
1783 MODIFY_REG(RCC->CCIPR, RCC_CCIPR_CLK48SEL, (__SDMMC1_CLKSOURCE__))
\r
1784 #endif /* RCC_CCIPR2_SDMMCSEL */
\r
1786 /** @brief Macro to get the SDMMC1 clock.
\r
1787 * @retval The clock source can be one of the following values:
\r
1789 * @arg @ref RCC_SDMMC1CLKSOURCE_NONE No clock selected as SDMMC1 clock for devices without HSI48
\r
1790 * @arg @ref RCC_SDMMC1CLKSOURCE_MSI MSI selected as SDMMC1 clock
\r
1791 * @arg @ref RCC_SDMMC1CLKSOURCE_PLLSAI1 PLLSAI1 "Q" clock (PLL48M2CLK) selected as SDMMC1 clock
\r
1794 * @arg @ref RCC_SDMMC1CLKSOURCE_HSI48 HSI48 selected as SDMMC1 clock for devices with HSI48
\r
1795 * @arg @ref RCC_SDMMC1CLKSOURCE_MSI MSI selected as SDMMC1 clock
\r
1796 * @arg @ref RCC_SDMMC1CLKSOURCE_PLLSAI1 PLLSAI1 "Q" clock (PLL48M2CLK) selected as SDMMC1 clock
\r
1799 * @arg @ref RCC_SDMMC1CLKSOURCE_HSI48 HSI48 selected as SDMMC1 clock for devices with HSI48
\r
1800 * @arg @ref RCC_SDMMC1CLKSOURCE_MSI MSI selected as SDMMC1 clock
\r
1801 * @arg @ref RCC_SDMMC1CLKSOURCE_PLLSAI1 PLLSAI1 "Q" clock (PLL48M2CLK) selected as SDMMC1 clock
\r
1802 * @arg @ref RCC_SDMMC1CLKSOURCE_PLLP PLL "P" clock (PLLSAI3CLK) selected as SDMMC1 kernel clock
\r
1804 * @arg @ref RCC_SDMMC1CLKSOURCE_PLL PLL "Q" clock (PLL48M1CLK) selected as SDMMC1 clock
\r
1806 #if defined(RCC_CCIPR2_SDMMCSEL)
\r
1807 #define __HAL_RCC_GET_SDMMC1_SOURCE() \
\r
1808 ((READ_BIT(RCC->CCIPR2, RCC_CCIPR2_SDMMCSEL) != 0U) ? RCC_SDMMC1CLKSOURCE_PLLP : (READ_BIT(RCC->CCIPR, RCC_CCIPR_CLK48SEL)))
\r
1810 #define __HAL_RCC_GET_SDMMC1_SOURCE() \
\r
1811 (READ_BIT(RCC->CCIPR, RCC_CCIPR_CLK48SEL))
\r
1812 #endif /* RCC_CCIPR2_SDMMCSEL */
\r
1814 #endif /* SDMMC1 */
\r
1816 /** @brief Macro to configure the RNG clock.
\r
1818 * @note USB, RNG and SDMMC1 peripherals share the same 48MHz clock source.
\r
1820 * @param __RNG_CLKSOURCE__ specifies the RNG clock source.
\r
1821 * This parameter can be one of the following values:
\r
1823 * @arg @ref RCC_RNGCLKSOURCE_NONE No clock selected as RNG clock for devices without HSI48
\r
1826 * @arg @ref RCC_RNGCLKSOURCE_HSI48 HSI48 selected as RNG clock clock for devices with HSI48
\r
1828 * @arg @ref RCC_RNGCLKSOURCE_MSI MSI selected as RNG clock
\r
1829 * @arg @ref RCC_RNGCLKSOURCE_PLLSAI1 PLLSAI1 Clock selected as RNG clock
\r
1830 * @arg @ref RCC_RNGCLKSOURCE_PLL PLL Clock selected as RNG clock
\r
1833 #define __HAL_RCC_RNG_CONFIG(__RNG_CLKSOURCE__) \
\r
1834 MODIFY_REG(RCC->CCIPR, RCC_CCIPR_CLK48SEL, (__RNG_CLKSOURCE__))
\r
1836 /** @brief Macro to get the RNG clock.
\r
1837 * @retval The clock source can be one of the following values:
\r
1839 * @arg @ref RCC_RNGCLKSOURCE_NONE No clock selected as RNG clock for devices without HSI48
\r
1842 * @arg @ref RCC_RNGCLKSOURCE_HSI48 HSI48 selected as RNG clock clock for devices with HSI48
\r
1844 * @arg @ref RCC_RNGCLKSOURCE_MSI MSI selected as RNG clock
\r
1845 * @arg @ref RCC_RNGCLKSOURCE_PLLSAI1 PLLSAI1 "Q" clock (PLL48M2CLK) selected as RNG clock
\r
1846 * @arg @ref RCC_RNGCLKSOURCE_PLL PLL "Q" clock (PLL48M1CLK) selected as RNG clock
\r
1848 #define __HAL_RCC_GET_RNG_SOURCE() (READ_BIT(RCC->CCIPR, RCC_CCIPR_CLK48SEL))
\r
1850 #if defined(USB_OTG_FS) || defined(USB)
\r
1852 /** @brief Macro to configure the USB clock (USBCLK).
\r
1854 * @note USB, RNG and SDMMC1 peripherals share the same 48MHz clock source.
\r
1856 * @param __USB_CLKSOURCE__ specifies the USB clock source.
\r
1857 * This parameter can be one of the following values:
\r
1859 * @arg @ref RCC_USBCLKSOURCE_NONE No clock selected as 48MHz clock for devices without HSI48
\r
1862 * @arg @ref RCC_USBCLKSOURCE_HSI48 HSI48 selected as 48MHz clock for devices with HSI48
\r
1864 * @arg @ref RCC_USBCLKSOURCE_MSI MSI selected as USB clock
\r
1865 * @arg @ref RCC_USBCLKSOURCE_PLLSAI1 PLLSAI1 "Q" clock (PLL48M2CLK) selected as USB clock
\r
1866 * @arg @ref RCC_USBCLKSOURCE_PLL PLL "Q" clock (PLL48M1CLK) selected as USB clock
\r
1869 #define __HAL_RCC_USB_CONFIG(__USB_CLKSOURCE__) \
\r
1870 MODIFY_REG(RCC->CCIPR, RCC_CCIPR_CLK48SEL, (__USB_CLKSOURCE__))
\r
1872 /** @brief Macro to get the USB clock source.
\r
1873 * @retval The clock source can be one of the following values:
\r
1875 * @arg @ref RCC_USBCLKSOURCE_NONE No clock selected as 48MHz clock for devices without HSI48
\r
1878 * @arg @ref RCC_USBCLKSOURCE_HSI48 HSI48 selected as 48MHz clock for devices with HSI48
\r
1880 * @arg @ref RCC_USBCLKSOURCE_MSI MSI selected as USB clock
\r
1881 * @arg @ref RCC_USBCLKSOURCE_PLLSAI1 PLLSAI1 "Q" clock (PLL48M2CLK) selected as USB clock
\r
1882 * @arg @ref RCC_USBCLKSOURCE_PLL PLL "Q" clock (PLL48M1CLK) selected as USB clock
\r
1884 #define __HAL_RCC_GET_USB_SOURCE() (READ_BIT(RCC->CCIPR, RCC_CCIPR_CLK48SEL))
\r
1886 #endif /* USB_OTG_FS || USB */
\r
1888 #if defined(RCC_CCIPR_ADCSEL)
\r
1890 /** @brief Macro to configure the ADC interface clock.
\r
1891 * @param __ADC_CLKSOURCE__ specifies the ADC digital interface clock source.
\r
1892 * This parameter can be one of the following values:
\r
1893 * @arg @ref RCC_ADCCLKSOURCE_NONE No clock selected as ADC clock
\r
1894 * @arg @ref RCC_ADCCLKSOURCE_PLLSAI1 PLLSAI1 Clock selected as ADC clock
\r
1896 * @arg @ref RCC_ADCCLKSOURCE_PLLSAI2 PLLSAI2 Clock selected as ADC clock for STM32L47x/STM32L48x/STM32L49x/STM32L4Ax devices
\r
1898 * @arg @ref RCC_ADCCLKSOURCE_SYSCLK System Clock selected as ADC clock
\r
1901 #define __HAL_RCC_ADC_CONFIG(__ADC_CLKSOURCE__) \
\r
1902 MODIFY_REG(RCC->CCIPR, RCC_CCIPR_ADCSEL, (__ADC_CLKSOURCE__))
\r
1904 /** @brief Macro to get the ADC clock source.
\r
1905 * @retval The clock source can be one of the following values:
\r
1906 * @arg @ref RCC_ADCCLKSOURCE_NONE No clock selected as ADC clock
\r
1907 * @arg @ref RCC_ADCCLKSOURCE_PLLSAI1 PLLSAI1 Clock selected as ADC clock
\r
1909 * @arg @ref RCC_ADCCLKSOURCE_PLLSAI2 PLLSAI2 Clock selected as ADC clock for STM32L47x/STM32L48x/STM32L49x/STM32L4Ax devices
\r
1911 * @arg @ref RCC_ADCCLKSOURCE_SYSCLK System Clock selected as ADC clock
\r
1913 #define __HAL_RCC_GET_ADC_SOURCE() (READ_BIT(RCC->CCIPR, RCC_CCIPR_ADCSEL))
\r
1916 /** @brief Macro to get the ADC clock source.
\r
1917 * @retval The clock source can be one of the following values:
\r
1918 * @arg @ref RCC_ADCCLKSOURCE_NONE No clock selected as ADC clock
\r
1919 * @arg @ref RCC_ADCCLKSOURCE_SYSCLK System Clock selected as ADC clock
\r
1921 #define __HAL_RCC_GET_ADC_SOURCE() ((__HAL_RCC_ADC_IS_CLK_ENABLED() != 0U) ? RCC_ADCCLKSOURCE_SYSCLK : RCC_ADCCLKSOURCE_NONE)
\r
1923 #endif /* RCC_CCIPR_ADCSEL */
\r
1925 #if defined(SWPMI1)
\r
1927 /** @brief Macro to configure the SWPMI1 clock.
\r
1928 * @param __SWPMI1_CLKSOURCE__ specifies the SWPMI1 clock source.
\r
1929 * This parameter can be one of the following values:
\r
1930 * @arg @ref RCC_SWPMI1CLKSOURCE_PCLK1 PCLK1 Clock selected as SWPMI1 clock
\r
1931 * @arg @ref RCC_SWPMI1CLKSOURCE_HSI HSI Clock selected as SWPMI1 clock
\r
1934 #define __HAL_RCC_SWPMI1_CONFIG(__SWPMI1_CLKSOURCE__) \
\r
1935 MODIFY_REG(RCC->CCIPR, RCC_CCIPR_SWPMI1SEL, (__SWPMI1_CLKSOURCE__))
\r
1937 /** @brief Macro to get the SWPMI1 clock source.
\r
1938 * @retval The clock source can be one of the following values:
\r
1939 * @arg @ref RCC_SWPMI1CLKSOURCE_PCLK1 PCLK1 Clock selected as SWPMI1 clock
\r
1940 * @arg @ref RCC_SWPMI1CLKSOURCE_HSI HSI Clock selected as SWPMI1 clock
\r
1942 #define __HAL_RCC_GET_SWPMI1_SOURCE() (READ_BIT(RCC->CCIPR, RCC_CCIPR_SWPMI1SEL))
\r
1944 #endif /* SWPMI1 */
\r
1946 #if defined(DFSDM1_Filter0)
\r
1947 /** @brief Macro to configure the DFSDM1 clock.
\r
1948 * @param __DFSDM1_CLKSOURCE__ specifies the DFSDM1 clock source.
\r
1949 * This parameter can be one of the following values:
\r
1950 * @arg @ref RCC_DFSDM1CLKSOURCE_PCLK2 PCLK2 Clock selected as DFSDM1 clock
\r
1951 * @arg @ref RCC_DFSDM1CLKSOURCE_SYSCLK System Clock selected as DFSDM1 clock
\r
1954 #if defined(STM32L4R5xx) || defined(STM32L4R7xx) || defined(STM32L4R9xx) || defined(STM32L4S5xx) || defined(STM32L4S7xx) || defined(STM32L4S9xx)
\r
1955 #define __HAL_RCC_DFSDM1_CONFIG(__DFSDM1_CLKSOURCE__) \
\r
1956 MODIFY_REG(RCC->CCIPR2, RCC_CCIPR2_DFSDM1SEL, (__DFSDM1_CLKSOURCE__))
\r
1958 #define __HAL_RCC_DFSDM1_CONFIG(__DFSDM1_CLKSOURCE__) \
\r
1959 MODIFY_REG(RCC->CCIPR, RCC_CCIPR_DFSDM1SEL, (__DFSDM1_CLKSOURCE__))
\r
1960 #endif /* STM32L4R5xx || STM32L4R7xx || STM32L4R9xx || STM32L4S5xx || STM32L4S7xx || STM32L4S9xx */
\r
1962 /** @brief Macro to get the DFSDM1 clock source.
\r
1963 * @retval The clock source can be one of the following values:
\r
1964 * @arg @ref RCC_DFSDM1CLKSOURCE_PCLK2 PCLK2 Clock selected as DFSDM1 clock
\r
1965 * @arg @ref RCC_DFSDM1CLKSOURCE_SYSCLK System Clock selected as DFSDM1 clock
\r
1967 #if defined(STM32L4R5xx) || defined(STM32L4R7xx) || defined(STM32L4R9xx) || defined(STM32L4S5xx) || defined(STM32L4S7xx) || defined(STM32L4S9xx)
\r
1968 #define __HAL_RCC_GET_DFSDM1_SOURCE() (READ_BIT(RCC->CCIPR2, RCC_CCIPR2_DFSDM1SEL))
\r
1970 #define __HAL_RCC_GET_DFSDM1_SOURCE() (READ_BIT(RCC->CCIPR, RCC_CCIPR_DFSDM1SEL))
\r
1971 #endif /* STM32L4R5xx || STM32L4R7xx || STM32L4R9xx || STM32L4S5xx || STM32L4S7xx || STM32L4S9xx */
\r
1973 #if defined(STM32L4R5xx) || defined(STM32L4R7xx) || defined(STM32L4R9xx) || defined(STM32L4S5xx) || defined(STM32L4S7xx) || defined(STM32L4S9xx)
\r
1975 /** @brief Macro to configure the DFSDM1 audio clock.
\r
1976 * @param __DFSDM1AUDIO_CLKSOURCE__ specifies the DFSDM1 audio clock source.
\r
1977 * This parameter can be one of the following values:
\r
1978 * @arg @ref RCC_DFSDM1AUDIOCLKSOURCE_SAI1 SAI1 clock selected as DFSDM1 audio clock
\r
1979 * @arg @ref RCC_DFSDM1AUDIOCLKSOURCE_HSI HSI clock selected as DFSDM1 audio clock
\r
1980 * @arg @ref RCC_DFSDM1AUDIOCLKSOURCE_MSI MSI clock selected as DFSDM1 audio clock
\r
1983 #define __HAL_RCC_DFSDM1AUDIO_CONFIG(__DFSDM1AUDIO_CLKSOURCE__) \
\r
1984 MODIFY_REG(RCC->CCIPR2, RCC_CCIPR2_ADFSDM1SEL, (__DFSDM1AUDIO_CLKSOURCE__))
\r
1986 /** @brief Macro to get the DFSDM1 audio clock source.
\r
1987 * @retval The clock source can be one of the following values:
\r
1988 * @arg @ref RCC_DFSDM1AUDIOCLKSOURCE_SAI1 SAI1 clock selected as DFSDM1 audio clock
\r
1989 * @arg @ref RCC_DFSDM1AUDIOCLKSOURCE_HSI HSI clock selected as DFSDM1 audio clock
\r
1990 * @arg @ref RCC_DFSDM1AUDIOCLKSOURCE_MSI MSI clock selected as DFSDM1 audio clock
\r
1992 #define __HAL_RCC_GET_DFSDM1AUDIO_SOURCE() (READ_BIT(RCC->CCIPR2, RCC_CCIPR2_ADFSDM1SEL))
\r
1994 #endif /* STM32L4R5xx || STM32L4R7xx || STM32L4R9xx || STM32L4S5xx || STM32L4S7xx || STM32L4S9xx */
\r
1996 #endif /* DFSDM1_Filter0 */
\r
2000 /** @brief Macro to configure the LTDC clock.
\r
2001 * @param __LTDC_CLKSOURCE__ specifies the DSI clock source.
\r
2002 * This parameter can be one of the following values:
\r
2003 * @arg @ref RCC_LTDCCLKSOURCE_PLLSAI2_DIV2 PLLSAI2 divider R divided by 2 clock selected as LTDC clock
\r
2004 * @arg @ref RCC_LTDCCLKSOURCE_PLLSAI2_DIV4 PLLSAI2 divider R divided by 4 clock selected as LTDC clock
\r
2005 * @arg @ref RCC_LTDCCLKSOURCE_PLLSAI2_DIV8 PLLSAI2 divider R divided by 8 clock selected as LTDC clock
\r
2006 * @arg @ref RCC_LTDCCLKSOURCE_PLLSAI2_DIV16 PLLSAI2 divider R divided by 16 clock selected as LTDC clock
\r
2009 #define __HAL_RCC_LTDC_CONFIG(__LTDC_CLKSOURCE__) \
\r
2010 MODIFY_REG(RCC->CCIPR2, RCC_CCIPR2_PLLSAI2DIVR, (__LTDC_CLKSOURCE__))
\r
2012 /** @brief Macro to get the LTDC clock source.
\r
2013 * @retval The clock source can be one of the following values:
\r
2014 * @arg @ref RCC_LTDCCLKSOURCE_PLLSAI2_DIV2 PLLSAI2 divider R divided by 2 clock selected as LTDC clock
\r
2015 * @arg @ref RCC_LTDCCLKSOURCE_PLLSAI2_DIV4 PLLSAI2 divider R divided by 4 clock selected as LTDC clock
\r
2016 * @arg @ref RCC_LTDCCLKSOURCE_PLLSAI2_DIV8 PLLSAI2 divider R divided by 8 clock selected as LTDC clock
\r
2017 * @arg @ref RCC_LTDCCLKSOURCE_PLLSAI2_DIV16 PLLSAI2 divider R divided by 16 clock selected as LTDC clock
\r
2019 #define __HAL_RCC_GET_LTDC_SOURCE() (READ_BIT(RCC->CCIPR2, RCC_CCIPR2_PLLSAI2DIVR))
\r
2025 /** @brief Macro to configure the DSI clock.
\r
2026 * @param __DSI_CLKSOURCE__ specifies the DSI clock source.
\r
2027 * This parameter can be one of the following values:
\r
2028 * @arg @ref RCC_DSICLKSOURCE_DSIPHY DSI-PHY clock selected as DSI clock
\r
2029 * @arg @ref RCC_DSICLKSOURCE_PLLSAI2 PLLSAI2 R divider clock selected as DSI clock
\r
2032 #define __HAL_RCC_DSI_CONFIG(__DSI_CLKSOURCE__) \
\r
2033 MODIFY_REG(RCC->CCIPR2, RCC_CCIPR2_DSISEL, (__DSI_CLKSOURCE__))
\r
2035 /** @brief Macro to get the DSI clock source.
\r
2036 * @retval The clock source can be one of the following values:
\r
2037 * @arg @ref RCC_DSICLKSOURCE_DSIPHY DSI-PHY clock selected as DSI clock
\r
2038 * @arg @ref RCC_DSICLKSOURCE_PLLSAI2 PLLSAI2 R divider clock selected as DSI clock
\r
2040 #define __HAL_RCC_GET_DSI_SOURCE() (READ_BIT(RCC->CCIPR2, RCC_CCIPR2_DSISEL))
\r
2044 #if defined(OCTOSPI1) || defined(OCTOSPI2)
\r
2046 /** @brief Macro to configure the OctoSPI clock.
\r
2047 * @param __OSPI_CLKSOURCE__ specifies the OctoSPI clock source.
\r
2048 * This parameter can be one of the following values:
\r
2049 * @arg @ref RCC_OSPICLKSOURCE_SYSCLK System Clock selected as OctoSPI clock
\r
2050 * @arg @ref RCC_OSPICLKSOURCE_MSI MSI clock selected as OctoSPI clock
\r
2051 * @arg @ref RCC_OSPICLKSOURCE_PLL PLL Q divider clock selected as OctoSPI clock
\r
2054 #define __HAL_RCC_OSPI_CONFIG(__OSPI_CLKSOURCE__) \
\r
2055 MODIFY_REG(RCC->CCIPR2, RCC_CCIPR2_OSPISEL, (__OSPI_CLKSOURCE__))
\r
2057 /** @brief Macro to get the OctoSPI clock source.
\r
2058 * @retval The clock source can be one of the following values:
\r
2059 * @arg @ref RCC_OSPICLKSOURCE_SYSCLK System Clock selected as OctoSPI clock
\r
2060 * @arg @ref RCC_OSPICLKSOURCE_MSI MSI clock selected as OctoSPI clock
\r
2061 * @arg @ref RCC_OSPICLKSOURCE_PLL PLL Q divider clock selected as OctoSPI clock
\r
2063 #define __HAL_RCC_GET_OSPI_SOURCE() (READ_BIT(RCC->CCIPR2, RCC_CCIPR2_OSPISEL))
\r
2065 #endif /* OCTOSPI1 || OCTOSPI2 */
\r
2067 /** @defgroup RCCEx_Flags_Interrupts_Management Flags Interrupts Management
\r
2068 * @brief macros to manage the specified RCC Flags and interrupts.
\r
2071 #if defined(RCC_PLLSAI1_SUPPORT)
\r
2073 /** @brief Enable PLLSAI1RDY interrupt.
\r
2076 #define __HAL_RCC_PLLSAI1_ENABLE_IT() SET_BIT(RCC->CIER, RCC_CIER_PLLSAI1RDYIE)
\r
2078 /** @brief Disable PLLSAI1RDY interrupt.
\r
2081 #define __HAL_RCC_PLLSAI1_DISABLE_IT() CLEAR_BIT(RCC->CIER, RCC_CIER_PLLSAI1RDYIE)
\r
2083 /** @brief Clear the PLLSAI1RDY interrupt pending bit.
\r
2086 #define __HAL_RCC_PLLSAI1_CLEAR_IT() WRITE_REG(RCC->CICR, RCC_CICR_PLLSAI1RDYC)
\r
2088 /** @brief Check whether PLLSAI1RDY interrupt has occurred or not.
\r
2089 * @retval TRUE or FALSE.
\r
2091 #define __HAL_RCC_PLLSAI1_GET_IT_SOURCE() (READ_BIT(RCC->CIFR, RCC_CIFR_PLLSAI1RDYF) == RCC_CIFR_PLLSAI1RDYF)
\r
2093 /** @brief Check whether the PLLSAI1RDY flag is set or not.
\r
2094 * @retval TRUE or FALSE.
\r
2096 #define __HAL_RCC_PLLSAI1_GET_FLAG() (READ_BIT(RCC->CR, RCC_CR_PLLSAI1RDY) == (RCC_CR_PLLSAI1RDY))
\r
2098 #endif /* RCC_PLLSAI1_SUPPORT */
\r
2100 #if defined(RCC_PLLSAI2_SUPPORT)
\r
2102 /** @brief Enable PLLSAI2RDY interrupt.
\r
2105 #define __HAL_RCC_PLLSAI2_ENABLE_IT() SET_BIT(RCC->CIER, RCC_CIER_PLLSAI2RDYIE)
\r
2107 /** @brief Disable PLLSAI2RDY interrupt.
\r
2110 #define __HAL_RCC_PLLSAI2_DISABLE_IT() CLEAR_BIT(RCC->CIER, RCC_CIER_PLLSAI2RDYIE)
\r
2112 /** @brief Clear the PLLSAI2RDY interrupt pending bit.
\r
2115 #define __HAL_RCC_PLLSAI2_CLEAR_IT() WRITE_REG(RCC->CICR, RCC_CICR_PLLSAI2RDYC)
\r
2117 /** @brief Check whether the PLLSAI2RDY interrupt has occurred or not.
\r
2118 * @retval TRUE or FALSE.
\r
2120 #define __HAL_RCC_PLLSAI2_GET_IT_SOURCE() (READ_BIT(RCC->CIFR, RCC_CIFR_PLLSAI2RDYF) == RCC_CIFR_PLLSAI2RDYF)
\r
2122 /** @brief Check whether the PLLSAI2RDY flag is set or not.
\r
2123 * @retval TRUE or FALSE.
\r
2125 #define __HAL_RCC_PLLSAI2_GET_FLAG() (READ_BIT(RCC->CR, RCC_CR_PLLSAI2RDY) == (RCC_CR_PLLSAI2RDY))
\r
2127 #endif /* RCC_PLLSAI2_SUPPORT */
\r
2131 * @brief Enable the RCC LSE CSS Extended Interrupt Line.
\r
2134 #define __HAL_RCC_LSECSS_EXTI_ENABLE_IT() SET_BIT(EXTI->IMR1, RCC_EXTI_LINE_LSECSS)
\r
2137 * @brief Disable the RCC LSE CSS Extended Interrupt Line.
\r
2140 #define __HAL_RCC_LSECSS_EXTI_DISABLE_IT() CLEAR_BIT(EXTI->IMR1, RCC_EXTI_LINE_LSECSS)
\r
2143 * @brief Enable the RCC LSE CSS Event Line.
\r
2146 #define __HAL_RCC_LSECSS_EXTI_ENABLE_EVENT() SET_BIT(EXTI->EMR1, RCC_EXTI_LINE_LSECSS)
\r
2149 * @brief Disable the RCC LSE CSS Event Line.
\r
2152 #define __HAL_RCC_LSECSS_EXTI_DISABLE_EVENT() CLEAR_BIT(EXTI->EMR1, RCC_EXTI_LINE_LSECSS)
\r
2156 * @brief Enable the RCC LSE CSS Extended Interrupt Falling Trigger.
\r
2159 #define __HAL_RCC_LSECSS_EXTI_ENABLE_FALLING_EDGE() SET_BIT(EXTI->FTSR1, RCC_EXTI_LINE_LSECSS)
\r
2163 * @brief Disable the RCC LSE CSS Extended Interrupt Falling Trigger.
\r
2166 #define __HAL_RCC_LSECSS_EXTI_DISABLE_FALLING_EDGE() CLEAR_BIT(EXTI->FTSR1, RCC_EXTI_LINE_LSECSS)
\r
2170 * @brief Enable the RCC LSE CSS Extended Interrupt Rising Trigger.
\r
2173 #define __HAL_RCC_LSECSS_EXTI_ENABLE_RISING_EDGE() SET_BIT(EXTI->RTSR1, RCC_EXTI_LINE_LSECSS)
\r
2176 * @brief Disable the RCC LSE CSS Extended Interrupt Rising Trigger.
\r
2179 #define __HAL_RCC_LSECSS_EXTI_DISABLE_RISING_EDGE() CLEAR_BIT(EXTI->RTSR1, RCC_EXTI_LINE_LSECSS)
\r
2182 * @brief Enable the RCC LSE CSS Extended Interrupt Rising & Falling Trigger.
\r
2185 #define __HAL_RCC_LSECSS_EXTI_ENABLE_RISING_FALLING_EDGE() \
\r
2187 __HAL_RCC_LSECSS_EXTI_ENABLE_RISING_EDGE(); \
\r
2188 __HAL_RCC_LSECSS_EXTI_ENABLE_FALLING_EDGE(); \
\r
2192 * @brief Disable the RCC LSE CSS Extended Interrupt Rising & Falling Trigger.
\r
2195 #define __HAL_RCC_LSECSS_EXTI_DISABLE_RISING_FALLING_EDGE() \
\r
2197 __HAL_RCC_LSECSS_EXTI_DISABLE_RISING_EDGE(); \
\r
2198 __HAL_RCC_LSECSS_EXTI_DISABLE_FALLING_EDGE(); \
\r
2202 * @brief Check whether the specified RCC LSE CSS EXTI interrupt flag is set or not.
\r
2203 * @retval EXTI RCC LSE CSS Line Status.
\r
2205 #define __HAL_RCC_LSECSS_EXTI_GET_FLAG() (READ_BIT(EXTI->PR1, RCC_EXTI_LINE_LSECSS) == RCC_EXTI_LINE_LSECSS)
\r
2208 * @brief Clear the RCC LSE CSS EXTI flag.
\r
2211 #define __HAL_RCC_LSECSS_EXTI_CLEAR_FLAG() WRITE_REG(EXTI->PR1, RCC_EXTI_LINE_LSECSS)
\r
2214 * @brief Generate a Software interrupt on the RCC LSE CSS EXTI line.
\r
2217 #define __HAL_RCC_LSECSS_EXTI_GENERATE_SWIT() SET_BIT(EXTI->SWIER1, RCC_EXTI_LINE_LSECSS)
\r
2223 * @brief Enable the specified CRS interrupts.
\r
2224 * @param __INTERRUPT__ specifies the CRS interrupt sources to be enabled.
\r
2225 * This parameter can be any combination of the following values:
\r
2226 * @arg @ref RCC_CRS_IT_SYNCOK SYNC event OK interrupt
\r
2227 * @arg @ref RCC_CRS_IT_SYNCWARN SYNC warning interrupt
\r
2228 * @arg @ref RCC_CRS_IT_ERR Synchronization or trimming error interrupt
\r
2229 * @arg @ref RCC_CRS_IT_ESYNC Expected SYNC interrupt
\r
2232 #define __HAL_RCC_CRS_ENABLE_IT(__INTERRUPT__) SET_BIT(CRS->CR, (__INTERRUPT__))
\r
2235 * @brief Disable the specified CRS interrupts.
\r
2236 * @param __INTERRUPT__ specifies the CRS interrupt sources to be disabled.
\r
2237 * This parameter can be any combination of the following values:
\r
2238 * @arg @ref RCC_CRS_IT_SYNCOK SYNC event OK interrupt
\r
2239 * @arg @ref RCC_CRS_IT_SYNCWARN SYNC warning interrupt
\r
2240 * @arg @ref RCC_CRS_IT_ERR Synchronization or trimming error interrupt
\r
2241 * @arg @ref RCC_CRS_IT_ESYNC Expected SYNC interrupt
\r
2244 #define __HAL_RCC_CRS_DISABLE_IT(__INTERRUPT__) CLEAR_BIT(CRS->CR, (__INTERRUPT__))
\r
2246 /** @brief Check whether the CRS interrupt has occurred or not.
\r
2247 * @param __INTERRUPT__ specifies the CRS interrupt source to check.
\r
2248 * This parameter can be one of the following values:
\r
2249 * @arg @ref RCC_CRS_IT_SYNCOK SYNC event OK interrupt
\r
2250 * @arg @ref RCC_CRS_IT_SYNCWARN SYNC warning interrupt
\r
2251 * @arg @ref RCC_CRS_IT_ERR Synchronization or trimming error interrupt
\r
2252 * @arg @ref RCC_CRS_IT_ESYNC Expected SYNC interrupt
\r
2253 * @retval The new state of __INTERRUPT__ (SET or RESET).
\r
2255 #define __HAL_RCC_CRS_GET_IT_SOURCE(__INTERRUPT__) ((READ_BIT(CRS->CR, (__INTERRUPT__)) != 0U) ? SET : RESET)
\r
2257 /** @brief Clear the CRS interrupt pending bits
\r
2258 * @param __INTERRUPT__ specifies the interrupt pending bit to clear.
\r
2259 * This parameter can be any combination of the following values:
\r
2260 * @arg @ref RCC_CRS_IT_SYNCOK SYNC event OK interrupt
\r
2261 * @arg @ref RCC_CRS_IT_SYNCWARN SYNC warning interrupt
\r
2262 * @arg @ref RCC_CRS_IT_ERR Synchronization or trimming error interrupt
\r
2263 * @arg @ref RCC_CRS_IT_ESYNC Expected SYNC interrupt
\r
2264 * @arg @ref RCC_CRS_IT_TRIMOVF Trimming overflow or underflow interrupt
\r
2265 * @arg @ref RCC_CRS_IT_SYNCERR SYNC error interrupt
\r
2266 * @arg @ref RCC_CRS_IT_SYNCMISS SYNC missed interrupt
\r
2268 /* CRS IT Error Mask */
\r
2269 #define RCC_CRS_IT_ERROR_MASK (RCC_CRS_IT_TRIMOVF | RCC_CRS_IT_SYNCERR | RCC_CRS_IT_SYNCMISS)
\r
2271 #define __HAL_RCC_CRS_CLEAR_IT(__INTERRUPT__) do { \
\r
2272 if(((__INTERRUPT__) & RCC_CRS_IT_ERROR_MASK) != 0U) \
\r
2274 WRITE_REG(CRS->ICR, CRS_ICR_ERRC | ((__INTERRUPT__) & ~RCC_CRS_IT_ERROR_MASK)); \
\r
2278 WRITE_REG(CRS->ICR, (__INTERRUPT__)); \
\r
2283 * @brief Check whether the specified CRS flag is set or not.
\r
2284 * @param __FLAG__ specifies the flag to check.
\r
2285 * This parameter can be one of the following values:
\r
2286 * @arg @ref RCC_CRS_FLAG_SYNCOK SYNC event OK
\r
2287 * @arg @ref RCC_CRS_FLAG_SYNCWARN SYNC warning
\r
2288 * @arg @ref RCC_CRS_FLAG_ERR Error
\r
2289 * @arg @ref RCC_CRS_FLAG_ESYNC Expected SYNC
\r
2290 * @arg @ref RCC_CRS_FLAG_TRIMOVF Trimming overflow or underflow
\r
2291 * @arg @ref RCC_CRS_FLAG_SYNCERR SYNC error
\r
2292 * @arg @ref RCC_CRS_FLAG_SYNCMISS SYNC missed
\r
2293 * @retval The new state of _FLAG_ (TRUE or FALSE).
\r
2295 #define __HAL_RCC_CRS_GET_FLAG(__FLAG__) (READ_BIT(CRS->ISR, (__FLAG__)) == (__FLAG__))
\r
2298 * @brief Clear the CRS specified FLAG.
\r
2299 * @param __FLAG__ specifies the flag to clear.
\r
2300 * This parameter can be one of the following values:
\r
2301 * @arg @ref RCC_CRS_FLAG_SYNCOK SYNC event OK
\r
2302 * @arg @ref RCC_CRS_FLAG_SYNCWARN SYNC warning
\r
2303 * @arg @ref RCC_CRS_FLAG_ERR Error
\r
2304 * @arg @ref RCC_CRS_FLAG_ESYNC Expected SYNC
\r
2305 * @arg @ref RCC_CRS_FLAG_TRIMOVF Trimming overflow or underflow
\r
2306 * @arg @ref RCC_CRS_FLAG_SYNCERR SYNC error
\r
2307 * @arg @ref RCC_CRS_FLAG_SYNCMISS SYNC missed
\r
2308 * @note RCC_CRS_FLAG_ERR clears RCC_CRS_FLAG_TRIMOVF, RCC_CRS_FLAG_SYNCERR, RCC_CRS_FLAG_SYNCMISS and consequently RCC_CRS_FLAG_ERR
\r
2312 /* CRS Flag Error Mask */
\r
2313 #define RCC_CRS_FLAG_ERROR_MASK (RCC_CRS_FLAG_TRIMOVF | RCC_CRS_FLAG_SYNCERR | RCC_CRS_FLAG_SYNCMISS)
\r
2315 #define __HAL_RCC_CRS_CLEAR_FLAG(__FLAG__) do { \
\r
2316 if(((__FLAG__) & RCC_CRS_FLAG_ERROR_MASK) != 0U) \
\r
2318 WRITE_REG(CRS->ICR, CRS_ICR_ERRC | ((__FLAG__) & ~RCC_CRS_FLAG_ERROR_MASK)); \
\r
2322 WRITE_REG(CRS->ICR, (__FLAG__)); \
\r
2334 /** @defgroup RCCEx_CRS_Extended_Features RCCEx CRS Extended Features
\r
2338 * @brief Enable the oscillator clock for frequency error counter.
\r
2339 * @note when the CEN bit is set the CRS_CFGR register becomes write-protected.
\r
2342 #define __HAL_RCC_CRS_FREQ_ERROR_COUNTER_ENABLE() SET_BIT(CRS->CR, CRS_CR_CEN)
\r
2345 * @brief Disable the oscillator clock for frequency error counter.
\r
2348 #define __HAL_RCC_CRS_FREQ_ERROR_COUNTER_DISABLE() CLEAR_BIT(CRS->CR, CRS_CR_CEN)
\r
2351 * @brief Enable the automatic hardware adjustement of TRIM bits.
\r
2352 * @note When the AUTOTRIMEN bit is set the CRS_CFGR register becomes write-protected.
\r
2355 #define __HAL_RCC_CRS_AUTOMATIC_CALIB_ENABLE() SET_BIT(CRS->CR, CRS_CR_AUTOTRIMEN)
\r
2358 * @brief Enable or disable the automatic hardware adjustement of TRIM bits.
\r
2361 #define __HAL_RCC_CRS_AUTOMATIC_CALIB_DISABLE() CLEAR_BIT(CRS->CR, CRS_CR_AUTOTRIMEN)
\r
2364 * @brief Macro to calculate reload value to be set in CRS register according to target and sync frequencies
\r
2365 * @note The RELOAD value should be selected according to the ratio between the target frequency and the frequency
\r
2366 * of the synchronization source after prescaling. It is then decreased by one in order to
\r
2367 * reach the expected synchronization on the zero value. The formula is the following:
\r
2368 * RELOAD = (fTARGET / fSYNC) -1
\r
2369 * @param __FTARGET__ Target frequency (value in Hz)
\r
2370 * @param __FSYNC__ Synchronization signal frequency (value in Hz)
\r
2373 #define __HAL_RCC_CRS_RELOADVALUE_CALCULATE(__FTARGET__, __FSYNC__) (((__FTARGET__) / (__FSYNC__)) - 1U)
\r
2385 /* Exported functions --------------------------------------------------------*/
\r
2386 /** @addtogroup RCCEx_Exported_Functions
\r
2390 /** @addtogroup RCCEx_Exported_Functions_Group1
\r
2394 HAL_StatusTypeDef HAL_RCCEx_PeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClkInit);
\r
2395 void HAL_RCCEx_GetPeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClkInit);
\r
2396 uint32_t HAL_RCCEx_GetPeriphCLKFreq(uint32_t PeriphClk);
\r
2402 /** @addtogroup RCCEx_Exported_Functions_Group2
\r
2405 #if defined(RCC_PLLSAI1_SUPPORT)
\r
2407 HAL_StatusTypeDef HAL_RCCEx_EnablePLLSAI1(RCC_PLLSAI1InitTypeDef *PLLSAI1Init);
\r
2408 HAL_StatusTypeDef HAL_RCCEx_DisablePLLSAI1(void);
\r
2410 #endif /* RCC_PLLSAI1_SUPPORT */
\r
2412 #if defined(RCC_PLLSAI2_SUPPORT)
\r
2414 HAL_StatusTypeDef HAL_RCCEx_EnablePLLSAI2(RCC_PLLSAI2InitTypeDef *PLLSAI2Init);
\r
2415 HAL_StatusTypeDef HAL_RCCEx_DisablePLLSAI2(void);
\r
2417 #endif /* RCC_PLLSAI2_SUPPORT */
\r
2419 void HAL_RCCEx_WakeUpStopCLKConfig(uint32_t WakeUpClk);
\r
2420 void HAL_RCCEx_StandbyMSIRangeConfig(uint32_t MSIRange);
\r
2421 void HAL_RCCEx_EnableLSECSS(void);
\r
2422 void HAL_RCCEx_DisableLSECSS(void);
\r
2423 void HAL_RCCEx_EnableLSECSS_IT(void);
\r
2424 void HAL_RCCEx_LSECSS_IRQHandler(void);
\r
2425 void HAL_RCCEx_LSECSS_Callback(void);
\r
2426 void HAL_RCCEx_EnableLSCO(uint32_t LSCOSource);
\r
2427 void HAL_RCCEx_DisableLSCO(void);
\r
2428 void HAL_RCCEx_EnableMSIPLLMode(void);
\r
2429 void HAL_RCCEx_DisableMSIPLLMode(void);
\r
2437 /** @addtogroup RCCEx_Exported_Functions_Group3
\r
2441 void HAL_RCCEx_CRSConfig(RCC_CRSInitTypeDef *pInit);
\r
2442 void HAL_RCCEx_CRSSoftwareSynchronizationGenerate(void);
\r
2443 void HAL_RCCEx_CRSGetSynchronizationInfo(RCC_CRSSynchroInfoTypeDef *pSynchroInfo);
\r
2444 uint32_t HAL_RCCEx_CRSWaitSynchronization(uint32_t Timeout);
\r
2445 void HAL_RCCEx_CRS_IRQHandler(void);
\r
2446 void HAL_RCCEx_CRS_SyncOkCallback(void);
\r
2447 void HAL_RCCEx_CRS_SyncWarnCallback(void);
\r
2448 void HAL_RCCEx_CRS_ExpectedSyncCallback(void);
\r
2449 void HAL_RCCEx_CRS_ErrorCallback(uint32_t Error);
\r
2461 /* Private macros ------------------------------------------------------------*/
\r
2462 /** @addtogroup RCCEx_Private_Macros
\r
2466 #define IS_RCC_LSCOSOURCE(__SOURCE__) (((__SOURCE__) == RCC_LSCOSOURCE_LSI) || \
\r
2467 ((__SOURCE__) == RCC_LSCOSOURCE_LSE))
\r
2469 #if defined(STM32L412xx) || defined(STM32L422xx)
\r
2471 #define IS_RCC_PERIPHCLOCK(__SELECTION__) \
\r
2472 ((((__SELECTION__) & RCC_PERIPHCLK_USART1) == RCC_PERIPHCLK_USART1) || \
\r
2473 (((__SELECTION__) & RCC_PERIPHCLK_USART2) == RCC_PERIPHCLK_USART2) || \
\r
2474 (((__SELECTION__) & RCC_PERIPHCLK_USART3) == RCC_PERIPHCLK_USART3) || \
\r
2475 (((__SELECTION__) & RCC_PERIPHCLK_LPUART1) == RCC_PERIPHCLK_LPUART1) || \
\r
2476 (((__SELECTION__) & RCC_PERIPHCLK_I2C1) == RCC_PERIPHCLK_I2C1) || \
\r
2477 (((__SELECTION__) & RCC_PERIPHCLK_I2C2) == RCC_PERIPHCLK_I2C2) || \
\r
2478 (((__SELECTION__) & RCC_PERIPHCLK_I2C3) == RCC_PERIPHCLK_I2C3) || \
\r
2479 (((__SELECTION__) & RCC_PERIPHCLK_LPTIM1) == RCC_PERIPHCLK_LPTIM1) || \
\r
2480 (((__SELECTION__) & RCC_PERIPHCLK_LPTIM2) == RCC_PERIPHCLK_LPTIM2) || \
\r
2481 (((__SELECTION__) & RCC_PERIPHCLK_USB) == RCC_PERIPHCLK_USB) || \
\r
2482 (((__SELECTION__) & RCC_PERIPHCLK_ADC) == RCC_PERIPHCLK_ADC) || \
\r
2483 (((__SELECTION__) & RCC_PERIPHCLK_RTC) == RCC_PERIPHCLK_RTC) || \
\r
2484 (((__SELECTION__) & RCC_PERIPHCLK_RNG) == RCC_PERIPHCLK_RNG))
\r
2486 #elif defined(STM32L431xx)
\r
2488 #define IS_RCC_PERIPHCLOCK(__SELECTION__) \
\r
2489 ((((__SELECTION__) & RCC_PERIPHCLK_USART1) == RCC_PERIPHCLK_USART1) || \
\r
2490 (((__SELECTION__) & RCC_PERIPHCLK_USART2) == RCC_PERIPHCLK_USART2) || \
\r
2491 (((__SELECTION__) & RCC_PERIPHCLK_USART3) == RCC_PERIPHCLK_USART3) || \
\r
2492 (((__SELECTION__) & RCC_PERIPHCLK_LPUART1) == RCC_PERIPHCLK_LPUART1) || \
\r
2493 (((__SELECTION__) & RCC_PERIPHCLK_I2C1) == RCC_PERIPHCLK_I2C1) || \
\r
2494 (((__SELECTION__) & RCC_PERIPHCLK_I2C2) == RCC_PERIPHCLK_I2C2) || \
\r
2495 (((__SELECTION__) & RCC_PERIPHCLK_I2C3) == RCC_PERIPHCLK_I2C3) || \
\r
2496 (((__SELECTION__) & RCC_PERIPHCLK_LPTIM1) == RCC_PERIPHCLK_LPTIM1) || \
\r
2497 (((__SELECTION__) & RCC_PERIPHCLK_LPTIM2) == RCC_PERIPHCLK_LPTIM2) || \
\r
2498 (((__SELECTION__) & RCC_PERIPHCLK_SAI1) == RCC_PERIPHCLK_SAI1) || \
\r
2499 (((__SELECTION__) & RCC_PERIPHCLK_ADC) == RCC_PERIPHCLK_ADC) || \
\r
2500 (((__SELECTION__) & RCC_PERIPHCLK_SWPMI1) == RCC_PERIPHCLK_SWPMI1) || \
\r
2501 (((__SELECTION__) & RCC_PERIPHCLK_RTC) == RCC_PERIPHCLK_RTC) || \
\r
2502 (((__SELECTION__) & RCC_PERIPHCLK_RNG) == RCC_PERIPHCLK_RNG) || \
\r
2503 (((__SELECTION__) & RCC_PERIPHCLK_SDMMC1) == RCC_PERIPHCLK_SDMMC1))
\r
2505 #elif defined(STM32L432xx) || defined(STM32L442xx)
\r
2507 #define IS_RCC_PERIPHCLOCK(__SELECTION__) \
\r
2508 ((((__SELECTION__) & RCC_PERIPHCLK_USART1) == RCC_PERIPHCLK_USART1) || \
\r
2509 (((__SELECTION__) & RCC_PERIPHCLK_USART2) == RCC_PERIPHCLK_USART2) || \
\r
2510 (((__SELECTION__) & RCC_PERIPHCLK_LPUART1) == RCC_PERIPHCLK_LPUART1) || \
\r
2511 (((__SELECTION__) & RCC_PERIPHCLK_I2C1) == RCC_PERIPHCLK_I2C1) || \
\r
2512 (((__SELECTION__) & RCC_PERIPHCLK_I2C3) == RCC_PERIPHCLK_I2C3) || \
\r
2513 (((__SELECTION__) & RCC_PERIPHCLK_LPTIM1) == RCC_PERIPHCLK_LPTIM1) || \
\r
2514 (((__SELECTION__) & RCC_PERIPHCLK_LPTIM2) == RCC_PERIPHCLK_LPTIM2) || \
\r
2515 (((__SELECTION__) & RCC_PERIPHCLK_SAI1) == RCC_PERIPHCLK_SAI1) || \
\r
2516 (((__SELECTION__) & RCC_PERIPHCLK_USB) == RCC_PERIPHCLK_USB) || \
\r
2517 (((__SELECTION__) & RCC_PERIPHCLK_ADC) == RCC_PERIPHCLK_ADC) || \
\r
2518 (((__SELECTION__) & RCC_PERIPHCLK_SWPMI1) == RCC_PERIPHCLK_SWPMI1) || \
\r
2519 (((__SELECTION__) & RCC_PERIPHCLK_RTC) == RCC_PERIPHCLK_RTC) || \
\r
2520 (((__SELECTION__) & RCC_PERIPHCLK_RNG) == RCC_PERIPHCLK_RNG))
\r
2522 #elif defined(STM32L433xx) || defined(STM32L443xx)
\r
2524 #define IS_RCC_PERIPHCLOCK(__SELECTION__) \
\r
2525 ((((__SELECTION__) & RCC_PERIPHCLK_USART1) == RCC_PERIPHCLK_USART1) || \
\r
2526 (((__SELECTION__) & RCC_PERIPHCLK_USART2) == RCC_PERIPHCLK_USART2) || \
\r
2527 (((__SELECTION__) & RCC_PERIPHCLK_USART3) == RCC_PERIPHCLK_USART3) || \
\r
2528 (((__SELECTION__) & RCC_PERIPHCLK_LPUART1) == RCC_PERIPHCLK_LPUART1) || \
\r
2529 (((__SELECTION__) & RCC_PERIPHCLK_I2C1) == RCC_PERIPHCLK_I2C1) || \
\r
2530 (((__SELECTION__) & RCC_PERIPHCLK_I2C2) == RCC_PERIPHCLK_I2C2) || \
\r
2531 (((__SELECTION__) & RCC_PERIPHCLK_I2C3) == RCC_PERIPHCLK_I2C3) || \
\r
2532 (((__SELECTION__) & RCC_PERIPHCLK_LPTIM1) == RCC_PERIPHCLK_LPTIM1) || \
\r
2533 (((__SELECTION__) & RCC_PERIPHCLK_LPTIM2) == RCC_PERIPHCLK_LPTIM2) || \
\r
2534 (((__SELECTION__) & RCC_PERIPHCLK_SAI1) == RCC_PERIPHCLK_SAI1) || \
\r
2535 (((__SELECTION__) & RCC_PERIPHCLK_USB) == RCC_PERIPHCLK_USB) || \
\r
2536 (((__SELECTION__) & RCC_PERIPHCLK_ADC) == RCC_PERIPHCLK_ADC) || \
\r
2537 (((__SELECTION__) & RCC_PERIPHCLK_SWPMI1) == RCC_PERIPHCLK_SWPMI1) || \
\r
2538 (((__SELECTION__) & RCC_PERIPHCLK_RTC) == RCC_PERIPHCLK_RTC) || \
\r
2539 (((__SELECTION__) & RCC_PERIPHCLK_RNG) == RCC_PERIPHCLK_RNG) || \
\r
2540 (((__SELECTION__) & RCC_PERIPHCLK_SDMMC1) == RCC_PERIPHCLK_SDMMC1))
\r
2542 #elif defined(STM32L451xx)
\r
2544 #define IS_RCC_PERIPHCLOCK(__SELECTION__) \
\r
2545 ((((__SELECTION__) & RCC_PERIPHCLK_USART1) == RCC_PERIPHCLK_USART1) || \
\r
2546 (((__SELECTION__) & RCC_PERIPHCLK_USART2) == RCC_PERIPHCLK_USART2) || \
\r
2547 (((__SELECTION__) & RCC_PERIPHCLK_USART3) == RCC_PERIPHCLK_USART3) || \
\r
2548 (((__SELECTION__) & RCC_PERIPHCLK_UART4) == RCC_PERIPHCLK_UART4) || \
\r
2549 (((__SELECTION__) & RCC_PERIPHCLK_LPUART1) == RCC_PERIPHCLK_LPUART1) || \
\r
2550 (((__SELECTION__) & RCC_PERIPHCLK_I2C1) == RCC_PERIPHCLK_I2C1) || \
\r
2551 (((__SELECTION__) & RCC_PERIPHCLK_I2C2) == RCC_PERIPHCLK_I2C2) || \
\r
2552 (((__SELECTION__) & RCC_PERIPHCLK_I2C3) == RCC_PERIPHCLK_I2C3) || \
\r
2553 (((__SELECTION__) & RCC_PERIPHCLK_I2C4) == RCC_PERIPHCLK_I2C4) || \
\r
2554 (((__SELECTION__) & RCC_PERIPHCLK_LPTIM1) == RCC_PERIPHCLK_LPTIM1) || \
\r
2555 (((__SELECTION__) & RCC_PERIPHCLK_LPTIM2) == RCC_PERIPHCLK_LPTIM2) || \
\r
2556 (((__SELECTION__) & RCC_PERIPHCLK_SAI1) == RCC_PERIPHCLK_SAI1) || \
\r
2557 (((__SELECTION__) & RCC_PERIPHCLK_ADC) == RCC_PERIPHCLK_ADC) || \
\r
2558 (((__SELECTION__) & RCC_PERIPHCLK_DFSDM1) == RCC_PERIPHCLK_DFSDM1) || \
\r
2559 (((__SELECTION__) & RCC_PERIPHCLK_RTC) == RCC_PERIPHCLK_RTC) || \
\r
2560 (((__SELECTION__) & RCC_PERIPHCLK_RNG) == RCC_PERIPHCLK_RNG) || \
\r
2561 (((__SELECTION__) & RCC_PERIPHCLK_SDMMC1) == RCC_PERIPHCLK_SDMMC1))
\r
2563 #elif defined(STM32L452xx) || defined(STM32L462xx)
\r
2565 #define IS_RCC_PERIPHCLOCK(__SELECTION__) \
\r
2566 ((((__SELECTION__) & RCC_PERIPHCLK_USART1) == RCC_PERIPHCLK_USART1) || \
\r
2567 (((__SELECTION__) & RCC_PERIPHCLK_USART2) == RCC_PERIPHCLK_USART2) || \
\r
2568 (((__SELECTION__) & RCC_PERIPHCLK_USART3) == RCC_PERIPHCLK_USART3) || \
\r
2569 (((__SELECTION__) & RCC_PERIPHCLK_UART4) == RCC_PERIPHCLK_UART4) || \
\r
2570 (((__SELECTION__) & RCC_PERIPHCLK_LPUART1) == RCC_PERIPHCLK_LPUART1) || \
\r
2571 (((__SELECTION__) & RCC_PERIPHCLK_I2C1) == RCC_PERIPHCLK_I2C1) || \
\r
2572 (((__SELECTION__) & RCC_PERIPHCLK_I2C2) == RCC_PERIPHCLK_I2C2) || \
\r
2573 (((__SELECTION__) & RCC_PERIPHCLK_I2C3) == RCC_PERIPHCLK_I2C3) || \
\r
2574 (((__SELECTION__) & RCC_PERIPHCLK_I2C4) == RCC_PERIPHCLK_I2C4) || \
\r
2575 (((__SELECTION__) & RCC_PERIPHCLK_LPTIM1) == RCC_PERIPHCLK_LPTIM1) || \
\r
2576 (((__SELECTION__) & RCC_PERIPHCLK_LPTIM2) == RCC_PERIPHCLK_LPTIM2) || \
\r
2577 (((__SELECTION__) & RCC_PERIPHCLK_SAI1) == RCC_PERIPHCLK_SAI1) || \
\r
2578 (((__SELECTION__) & RCC_PERIPHCLK_USB) == RCC_PERIPHCLK_USB) || \
\r
2579 (((__SELECTION__) & RCC_PERIPHCLK_ADC) == RCC_PERIPHCLK_ADC) || \
\r
2580 (((__SELECTION__) & RCC_PERIPHCLK_DFSDM1) == RCC_PERIPHCLK_DFSDM1) || \
\r
2581 (((__SELECTION__) & RCC_PERIPHCLK_RTC) == RCC_PERIPHCLK_RTC) || \
\r
2582 (((__SELECTION__) & RCC_PERIPHCLK_RNG) == RCC_PERIPHCLK_RNG) || \
\r
2583 (((__SELECTION__) & RCC_PERIPHCLK_SDMMC1) == RCC_PERIPHCLK_SDMMC1))
\r
2585 #elif defined(STM32L471xx)
\r
2587 #define IS_RCC_PERIPHCLOCK(__SELECTION__) \
\r
2588 ((((__SELECTION__) & RCC_PERIPHCLK_USART1) == RCC_PERIPHCLK_USART1) || \
\r
2589 (((__SELECTION__) & RCC_PERIPHCLK_USART2) == RCC_PERIPHCLK_USART2) || \
\r
2590 (((__SELECTION__) & RCC_PERIPHCLK_USART3) == RCC_PERIPHCLK_USART3) || \
\r
2591 (((__SELECTION__) & RCC_PERIPHCLK_UART4) == RCC_PERIPHCLK_UART4) || \
\r
2592 (((__SELECTION__) & RCC_PERIPHCLK_UART5) == RCC_PERIPHCLK_UART5) || \
\r
2593 (((__SELECTION__) & RCC_PERIPHCLK_LPUART1) == RCC_PERIPHCLK_LPUART1) || \
\r
2594 (((__SELECTION__) & RCC_PERIPHCLK_I2C1) == RCC_PERIPHCLK_I2C1) || \
\r
2595 (((__SELECTION__) & RCC_PERIPHCLK_I2C2) == RCC_PERIPHCLK_I2C2) || \
\r
2596 (((__SELECTION__) & RCC_PERIPHCLK_I2C3) == RCC_PERIPHCLK_I2C3) || \
\r
2597 (((__SELECTION__) & RCC_PERIPHCLK_LPTIM1) == RCC_PERIPHCLK_LPTIM1) || \
\r
2598 (((__SELECTION__) & RCC_PERIPHCLK_LPTIM2) == RCC_PERIPHCLK_LPTIM2) || \
\r
2599 (((__SELECTION__) & RCC_PERIPHCLK_SAI1) == RCC_PERIPHCLK_SAI1) || \
\r
2600 (((__SELECTION__) & RCC_PERIPHCLK_SAI2) == RCC_PERIPHCLK_SAI2) || \
\r
2601 (((__SELECTION__) & RCC_PERIPHCLK_ADC) == RCC_PERIPHCLK_ADC) || \
\r
2602 (((__SELECTION__) & RCC_PERIPHCLK_SWPMI1) == RCC_PERIPHCLK_SWPMI1) || \
\r
2603 (((__SELECTION__) & RCC_PERIPHCLK_DFSDM1) == RCC_PERIPHCLK_DFSDM1) || \
\r
2604 (((__SELECTION__) & RCC_PERIPHCLK_RTC) == RCC_PERIPHCLK_RTC) || \
\r
2605 (((__SELECTION__) & RCC_PERIPHCLK_RNG) == RCC_PERIPHCLK_RNG) || \
\r
2606 (((__SELECTION__) & RCC_PERIPHCLK_SDMMC1) == RCC_PERIPHCLK_SDMMC1))
\r
2608 #elif defined(STM32L496xx) || defined(STM32L4A6xx)
\r
2610 #define IS_RCC_PERIPHCLOCK(__SELECTION__) \
\r
2611 ((((__SELECTION__) & RCC_PERIPHCLK_USART1) == RCC_PERIPHCLK_USART1) || \
\r
2612 (((__SELECTION__) & RCC_PERIPHCLK_USART2) == RCC_PERIPHCLK_USART2) || \
\r
2613 (((__SELECTION__) & RCC_PERIPHCLK_USART3) == RCC_PERIPHCLK_USART3) || \
\r
2614 (((__SELECTION__) & RCC_PERIPHCLK_UART4) == RCC_PERIPHCLK_UART4) || \
\r
2615 (((__SELECTION__) & RCC_PERIPHCLK_UART5) == RCC_PERIPHCLK_UART5) || \
\r
2616 (((__SELECTION__) & RCC_PERIPHCLK_LPUART1) == RCC_PERIPHCLK_LPUART1) || \
\r
2617 (((__SELECTION__) & RCC_PERIPHCLK_I2C1) == RCC_PERIPHCLK_I2C1) || \
\r
2618 (((__SELECTION__) & RCC_PERIPHCLK_I2C2) == RCC_PERIPHCLK_I2C2) || \
\r
2619 (((__SELECTION__) & RCC_PERIPHCLK_I2C3) == RCC_PERIPHCLK_I2C3) || \
\r
2620 (((__SELECTION__) & RCC_PERIPHCLK_I2C4) == RCC_PERIPHCLK_I2C4) || \
\r
2621 (((__SELECTION__) & RCC_PERIPHCLK_LPTIM1) == RCC_PERIPHCLK_LPTIM1) || \
\r
2622 (((__SELECTION__) & RCC_PERIPHCLK_LPTIM2) == RCC_PERIPHCLK_LPTIM2) || \
\r
2623 (((__SELECTION__) & RCC_PERIPHCLK_SAI1) == RCC_PERIPHCLK_SAI1) || \
\r
2624 (((__SELECTION__) & RCC_PERIPHCLK_SAI2) == RCC_PERIPHCLK_SAI2) || \
\r
2625 (((__SELECTION__) & RCC_PERIPHCLK_USB) == RCC_PERIPHCLK_USB) || \
\r
2626 (((__SELECTION__) & RCC_PERIPHCLK_ADC) == RCC_PERIPHCLK_ADC) || \
\r
2627 (((__SELECTION__) & RCC_PERIPHCLK_SWPMI1) == RCC_PERIPHCLK_SWPMI1) || \
\r
2628 (((__SELECTION__) & RCC_PERIPHCLK_DFSDM1) == RCC_PERIPHCLK_DFSDM1) || \
\r
2629 (((__SELECTION__) & RCC_PERIPHCLK_RTC) == RCC_PERIPHCLK_RTC) || \
\r
2630 (((__SELECTION__) & RCC_PERIPHCLK_RNG) == RCC_PERIPHCLK_RNG) || \
\r
2631 (((__SELECTION__) & RCC_PERIPHCLK_SDMMC1) == RCC_PERIPHCLK_SDMMC1))
\r
2633 #elif defined(STM32L4R5xx) || defined(STM32L4S5xx)
\r
2635 #define IS_RCC_PERIPHCLOCK(__SELECTION__) \
\r
2636 ((((__SELECTION__) & RCC_PERIPHCLK_USART1) == RCC_PERIPHCLK_USART1) || \
\r
2637 (((__SELECTION__) & RCC_PERIPHCLK_USART2) == RCC_PERIPHCLK_USART2) || \
\r
2638 (((__SELECTION__) & RCC_PERIPHCLK_USART3) == RCC_PERIPHCLK_USART3) || \
\r
2639 (((__SELECTION__) & RCC_PERIPHCLK_UART4) == RCC_PERIPHCLK_UART4) || \
\r
2640 (((__SELECTION__) & RCC_PERIPHCLK_UART5) == RCC_PERIPHCLK_UART5) || \
\r
2641 (((__SELECTION__) & RCC_PERIPHCLK_LPUART1) == RCC_PERIPHCLK_LPUART1) || \
\r
2642 (((__SELECTION__) & RCC_PERIPHCLK_I2C1) == RCC_PERIPHCLK_I2C1) || \
\r
2643 (((__SELECTION__) & RCC_PERIPHCLK_I2C2) == RCC_PERIPHCLK_I2C2) || \
\r
2644 (((__SELECTION__) & RCC_PERIPHCLK_I2C3) == RCC_PERIPHCLK_I2C3) || \
\r
2645 (((__SELECTION__) & RCC_PERIPHCLK_I2C4) == RCC_PERIPHCLK_I2C4) || \
\r
2646 (((__SELECTION__) & RCC_PERIPHCLK_LPTIM1) == RCC_PERIPHCLK_LPTIM1) || \
\r
2647 (((__SELECTION__) & RCC_PERIPHCLK_LPTIM2) == RCC_PERIPHCLK_LPTIM2) || \
\r
2648 (((__SELECTION__) & RCC_PERIPHCLK_SAI1) == RCC_PERIPHCLK_SAI1) || \
\r
2649 (((__SELECTION__) & RCC_PERIPHCLK_SAI2) == RCC_PERIPHCLK_SAI2) || \
\r
2650 (((__SELECTION__) & RCC_PERIPHCLK_USB) == RCC_PERIPHCLK_USB) || \
\r
2651 (((__SELECTION__) & RCC_PERIPHCLK_ADC) == RCC_PERIPHCLK_ADC) || \
\r
2652 (((__SELECTION__) & RCC_PERIPHCLK_DFSDM1) == RCC_PERIPHCLK_DFSDM1) || \
\r
2653 (((__SELECTION__) & RCC_PERIPHCLK_DFSDM1AUDIO) == RCC_PERIPHCLK_DFSDM1AUDIO) || \
\r
2654 (((__SELECTION__) & RCC_PERIPHCLK_RTC) == RCC_PERIPHCLK_RTC) || \
\r
2655 (((__SELECTION__) & RCC_PERIPHCLK_RNG) == RCC_PERIPHCLK_RNG) || \
\r
2656 (((__SELECTION__) & RCC_PERIPHCLK_SDMMC1) == RCC_PERIPHCLK_SDMMC1) || \
\r
2657 (((__SELECTION__) & RCC_PERIPHCLK_OSPI) == RCC_PERIPHCLK_OSPI))
\r
2659 #elif defined(STM32L4R7xx) || defined(STM32L4S7xx)
\r
2661 #define IS_RCC_PERIPHCLOCK(__SELECTION__) \
\r
2662 ((((__SELECTION__) & RCC_PERIPHCLK_USART1) == RCC_PERIPHCLK_USART1) || \
\r
2663 (((__SELECTION__) & RCC_PERIPHCLK_USART2) == RCC_PERIPHCLK_USART2) || \
\r
2664 (((__SELECTION__) & RCC_PERIPHCLK_USART3) == RCC_PERIPHCLK_USART3) || \
\r
2665 (((__SELECTION__) & RCC_PERIPHCLK_UART4) == RCC_PERIPHCLK_UART4) || \
\r
2666 (((__SELECTION__) & RCC_PERIPHCLK_UART5) == RCC_PERIPHCLK_UART5) || \
\r
2667 (((__SELECTION__) & RCC_PERIPHCLK_LPUART1) == RCC_PERIPHCLK_LPUART1) || \
\r
2668 (((__SELECTION__) & RCC_PERIPHCLK_I2C1) == RCC_PERIPHCLK_I2C1) || \
\r
2669 (((__SELECTION__) & RCC_PERIPHCLK_I2C2) == RCC_PERIPHCLK_I2C2) || \
\r
2670 (((__SELECTION__) & RCC_PERIPHCLK_I2C3) == RCC_PERIPHCLK_I2C3) || \
\r
2671 (((__SELECTION__) & RCC_PERIPHCLK_I2C4) == RCC_PERIPHCLK_I2C4) || \
\r
2672 (((__SELECTION__) & RCC_PERIPHCLK_LPTIM1) == RCC_PERIPHCLK_LPTIM1) || \
\r
2673 (((__SELECTION__) & RCC_PERIPHCLK_LPTIM2) == RCC_PERIPHCLK_LPTIM2) || \
\r
2674 (((__SELECTION__) & RCC_PERIPHCLK_SAI1) == RCC_PERIPHCLK_SAI1) || \
\r
2675 (((__SELECTION__) & RCC_PERIPHCLK_SAI2) == RCC_PERIPHCLK_SAI2) || \
\r
2676 (((__SELECTION__) & RCC_PERIPHCLK_USB) == RCC_PERIPHCLK_USB) || \
\r
2677 (((__SELECTION__) & RCC_PERIPHCLK_ADC) == RCC_PERIPHCLK_ADC) || \
\r
2678 (((__SELECTION__) & RCC_PERIPHCLK_DFSDM1) == RCC_PERIPHCLK_DFSDM1) || \
\r
2679 (((__SELECTION__) & RCC_PERIPHCLK_DFSDM1AUDIO) == RCC_PERIPHCLK_DFSDM1AUDIO) || \
\r
2680 (((__SELECTION__) & RCC_PERIPHCLK_RTC) == RCC_PERIPHCLK_RTC) || \
\r
2681 (((__SELECTION__) & RCC_PERIPHCLK_RNG) == RCC_PERIPHCLK_RNG) || \
\r
2682 (((__SELECTION__) & RCC_PERIPHCLK_SDMMC1) == RCC_PERIPHCLK_SDMMC1) || \
\r
2683 (((__SELECTION__) & RCC_PERIPHCLK_OSPI) == RCC_PERIPHCLK_OSPI) || \
\r
2684 (((__SELECTION__) & RCC_PERIPHCLK_LTDC) == RCC_PERIPHCLK_LTDC))
\r
2686 #elif defined(STM32L4R9xx) || defined(STM32L4S9xx)
\r
2688 #define IS_RCC_PERIPHCLOCK(__SELECTION__) \
\r
2689 ((((__SELECTION__) & RCC_PERIPHCLK_USART1) == RCC_PERIPHCLK_USART1) || \
\r
2690 (((__SELECTION__) & RCC_PERIPHCLK_USART2) == RCC_PERIPHCLK_USART2) || \
\r
2691 (((__SELECTION__) & RCC_PERIPHCLK_USART3) == RCC_PERIPHCLK_USART3) || \
\r
2692 (((__SELECTION__) & RCC_PERIPHCLK_UART4) == RCC_PERIPHCLK_UART4) || \
\r
2693 (((__SELECTION__) & RCC_PERIPHCLK_UART5) == RCC_PERIPHCLK_UART5) || \
\r
2694 (((__SELECTION__) & RCC_PERIPHCLK_LPUART1) == RCC_PERIPHCLK_LPUART1) || \
\r
2695 (((__SELECTION__) & RCC_PERIPHCLK_I2C1) == RCC_PERIPHCLK_I2C1) || \
\r
2696 (((__SELECTION__) & RCC_PERIPHCLK_I2C2) == RCC_PERIPHCLK_I2C2) || \
\r
2697 (((__SELECTION__) & RCC_PERIPHCLK_I2C3) == RCC_PERIPHCLK_I2C3) || \
\r
2698 (((__SELECTION__) & RCC_PERIPHCLK_I2C4) == RCC_PERIPHCLK_I2C4) || \
\r
2699 (((__SELECTION__) & RCC_PERIPHCLK_LPTIM1) == RCC_PERIPHCLK_LPTIM1) || \
\r
2700 (((__SELECTION__) & RCC_PERIPHCLK_LPTIM2) == RCC_PERIPHCLK_LPTIM2) || \
\r
2701 (((__SELECTION__) & RCC_PERIPHCLK_SAI1) == RCC_PERIPHCLK_SAI1) || \
\r
2702 (((__SELECTION__) & RCC_PERIPHCLK_SAI2) == RCC_PERIPHCLK_SAI2) || \
\r
2703 (((__SELECTION__) & RCC_PERIPHCLK_USB) == RCC_PERIPHCLK_USB) || \
\r
2704 (((__SELECTION__) & RCC_PERIPHCLK_ADC) == RCC_PERIPHCLK_ADC) || \
\r
2705 (((__SELECTION__) & RCC_PERIPHCLK_DFSDM1) == RCC_PERIPHCLK_DFSDM1) || \
\r
2706 (((__SELECTION__) & RCC_PERIPHCLK_DFSDM1AUDIO) == RCC_PERIPHCLK_DFSDM1AUDIO) || \
\r
2707 (((__SELECTION__) & RCC_PERIPHCLK_RTC) == RCC_PERIPHCLK_RTC) || \
\r
2708 (((__SELECTION__) & RCC_PERIPHCLK_RNG) == RCC_PERIPHCLK_RNG) || \
\r
2709 (((__SELECTION__) & RCC_PERIPHCLK_SDMMC1) == RCC_PERIPHCLK_SDMMC1) || \
\r
2710 (((__SELECTION__) & RCC_PERIPHCLK_OSPI) == RCC_PERIPHCLK_OSPI) || \
\r
2711 (((__SELECTION__) & RCC_PERIPHCLK_LTDC) == RCC_PERIPHCLK_LTDC) || \
\r
2712 (((__SELECTION__) & RCC_PERIPHCLK_DSI) == RCC_PERIPHCLK_DSI))
\r
2716 #define IS_RCC_PERIPHCLOCK(__SELECTION__) \
\r
2717 ((((__SELECTION__) & RCC_PERIPHCLK_USART1) == RCC_PERIPHCLK_USART1) || \
\r
2718 (((__SELECTION__) & RCC_PERIPHCLK_USART2) == RCC_PERIPHCLK_USART2) || \
\r
2719 (((__SELECTION__) & RCC_PERIPHCLK_USART3) == RCC_PERIPHCLK_USART3) || \
\r
2720 (((__SELECTION__) & RCC_PERIPHCLK_UART4) == RCC_PERIPHCLK_UART4) || \
\r
2721 (((__SELECTION__) & RCC_PERIPHCLK_UART5) == RCC_PERIPHCLK_UART5) || \
\r
2722 (((__SELECTION__) & RCC_PERIPHCLK_LPUART1) == RCC_PERIPHCLK_LPUART1) || \
\r
2723 (((__SELECTION__) & RCC_PERIPHCLK_I2C1) == RCC_PERIPHCLK_I2C1) || \
\r
2724 (((__SELECTION__) & RCC_PERIPHCLK_I2C2) == RCC_PERIPHCLK_I2C2) || \
\r
2725 (((__SELECTION__) & RCC_PERIPHCLK_I2C3) == RCC_PERIPHCLK_I2C3) || \
\r
2726 (((__SELECTION__) & RCC_PERIPHCLK_LPTIM1) == RCC_PERIPHCLK_LPTIM1) || \
\r
2727 (((__SELECTION__) & RCC_PERIPHCLK_LPTIM2) == RCC_PERIPHCLK_LPTIM2) || \
\r
2728 (((__SELECTION__) & RCC_PERIPHCLK_SAI1) == RCC_PERIPHCLK_SAI1) || \
\r
2729 (((__SELECTION__) & RCC_PERIPHCLK_SAI2) == RCC_PERIPHCLK_SAI2) || \
\r
2730 (((__SELECTION__) & RCC_PERIPHCLK_USB) == RCC_PERIPHCLK_USB) || \
\r
2731 (((__SELECTION__) & RCC_PERIPHCLK_ADC) == RCC_PERIPHCLK_ADC) || \
\r
2732 (((__SELECTION__) & RCC_PERIPHCLK_SWPMI1) == RCC_PERIPHCLK_SWPMI1) || \
\r
2733 (((__SELECTION__) & RCC_PERIPHCLK_DFSDM1) == RCC_PERIPHCLK_DFSDM1) || \
\r
2734 (((__SELECTION__) & RCC_PERIPHCLK_RTC) == RCC_PERIPHCLK_RTC) || \
\r
2735 (((__SELECTION__) & RCC_PERIPHCLK_RNG) == RCC_PERIPHCLK_RNG) || \
\r
2736 (((__SELECTION__) & RCC_PERIPHCLK_SDMMC1) == RCC_PERIPHCLK_SDMMC1))
\r
2738 #endif /* STM32L412xx || STM32L422xx */
\r
2740 #define IS_RCC_USART1CLKSOURCE(__SOURCE__) \
\r
2741 (((__SOURCE__) == RCC_USART1CLKSOURCE_PCLK2) || \
\r
2742 ((__SOURCE__) == RCC_USART1CLKSOURCE_SYSCLK) || \
\r
2743 ((__SOURCE__) == RCC_USART1CLKSOURCE_LSE) || \
\r
2744 ((__SOURCE__) == RCC_USART1CLKSOURCE_HSI))
\r
2746 #define IS_RCC_USART2CLKSOURCE(__SOURCE__) \
\r
2747 (((__SOURCE__) == RCC_USART2CLKSOURCE_PCLK1) || \
\r
2748 ((__SOURCE__) == RCC_USART2CLKSOURCE_SYSCLK) || \
\r
2749 ((__SOURCE__) == RCC_USART2CLKSOURCE_LSE) || \
\r
2750 ((__SOURCE__) == RCC_USART2CLKSOURCE_HSI))
\r
2752 #if defined(USART3)
\r
2754 #define IS_RCC_USART3CLKSOURCE(__SOURCE__) \
\r
2755 (((__SOURCE__) == RCC_USART3CLKSOURCE_PCLK1) || \
\r
2756 ((__SOURCE__) == RCC_USART3CLKSOURCE_SYSCLK) || \
\r
2757 ((__SOURCE__) == RCC_USART3CLKSOURCE_LSE) || \
\r
2758 ((__SOURCE__) == RCC_USART3CLKSOURCE_HSI))
\r
2760 #endif /* USART3 */
\r
2762 #if defined(UART4)
\r
2764 #define IS_RCC_UART4CLKSOURCE(__SOURCE__) \
\r
2765 (((__SOURCE__) == RCC_UART4CLKSOURCE_PCLK1) || \
\r
2766 ((__SOURCE__) == RCC_UART4CLKSOURCE_SYSCLK) || \
\r
2767 ((__SOURCE__) == RCC_UART4CLKSOURCE_LSE) || \
\r
2768 ((__SOURCE__) == RCC_UART4CLKSOURCE_HSI))
\r
2770 #endif /* UART4 */
\r
2772 #if defined(UART5)
\r
2774 #define IS_RCC_UART5CLKSOURCE(__SOURCE__) \
\r
2775 (((__SOURCE__) == RCC_UART5CLKSOURCE_PCLK1) || \
\r
2776 ((__SOURCE__) == RCC_UART5CLKSOURCE_SYSCLK) || \
\r
2777 ((__SOURCE__) == RCC_UART5CLKSOURCE_LSE) || \
\r
2778 ((__SOURCE__) == RCC_UART5CLKSOURCE_HSI))
\r
2780 #endif /* UART5 */
\r
2782 #define IS_RCC_LPUART1CLKSOURCE(__SOURCE__) \
\r
2783 (((__SOURCE__) == RCC_LPUART1CLKSOURCE_PCLK1) || \
\r
2784 ((__SOURCE__) == RCC_LPUART1CLKSOURCE_SYSCLK) || \
\r
2785 ((__SOURCE__) == RCC_LPUART1CLKSOURCE_LSE) || \
\r
2786 ((__SOURCE__) == RCC_LPUART1CLKSOURCE_HSI))
\r
2788 #define IS_RCC_I2C1CLKSOURCE(__SOURCE__) \
\r
2789 (((__SOURCE__) == RCC_I2C1CLKSOURCE_PCLK1) || \
\r
2790 ((__SOURCE__) == RCC_I2C1CLKSOURCE_SYSCLK)|| \
\r
2791 ((__SOURCE__) == RCC_I2C1CLKSOURCE_HSI))
\r
2795 #define IS_RCC_I2C2CLKSOURCE(__SOURCE__) \
\r
2796 (((__SOURCE__) == RCC_I2C2CLKSOURCE_PCLK1) || \
\r
2797 ((__SOURCE__) == RCC_I2C2CLKSOURCE_SYSCLK)|| \
\r
2798 ((__SOURCE__) == RCC_I2C2CLKSOURCE_HSI))
\r
2802 #define IS_RCC_I2C3CLKSOURCE(__SOURCE__) \
\r
2803 (((__SOURCE__) == RCC_I2C3CLKSOURCE_PCLK1) || \
\r
2804 ((__SOURCE__) == RCC_I2C3CLKSOURCE_SYSCLK)|| \
\r
2805 ((__SOURCE__) == RCC_I2C3CLKSOURCE_HSI))
\r
2809 #define IS_RCC_I2C4CLKSOURCE(__SOURCE__) \
\r
2810 (((__SOURCE__) == RCC_I2C4CLKSOURCE_PCLK1) || \
\r
2811 ((__SOURCE__) == RCC_I2C4CLKSOURCE_SYSCLK)|| \
\r
2812 ((__SOURCE__) == RCC_I2C4CLKSOURCE_HSI))
\r
2816 #if defined(RCC_PLLSAI2_SUPPORT)
\r
2818 #if defined(STM32L4R5xx) || defined(STM32L4R7xx) || defined(STM32L4R9xx) || defined(STM32L4S5xx) || defined(STM32L4S7xx) || defined(STM32L4S9xx)
\r
2819 #define IS_RCC_SAI1CLK(__SOURCE__) \
\r
2820 (((__SOURCE__) == RCC_SAI1CLKSOURCE_PLLSAI1) || \
\r
2821 ((__SOURCE__) == RCC_SAI1CLKSOURCE_PLLSAI2) || \
\r
2822 ((__SOURCE__) == RCC_SAI1CLKSOURCE_PLL) || \
\r
2823 ((__SOURCE__) == RCC_SAI1CLKSOURCE_PIN) || \
\r
2824 ((__SOURCE__) == RCC_SAI1CLKSOURCE_HSI))
\r
2826 #define IS_RCC_SAI1CLK(__SOURCE__) \
\r
2827 (((__SOURCE__) == RCC_SAI1CLKSOURCE_PLLSAI1) || \
\r
2828 ((__SOURCE__) == RCC_SAI1CLKSOURCE_PLLSAI2) || \
\r
2829 ((__SOURCE__) == RCC_SAI1CLKSOURCE_PLL) || \
\r
2830 ((__SOURCE__) == RCC_SAI1CLKSOURCE_PIN))
\r
2831 #endif /* STM32L4R5xx || STM32L4R7xx || STM32L4R9xx || STM32L4S5xx || STM32L4S7xx || STM32L4S9xx */
\r
2833 #elif defined(RCC_PLLSAI1_SUPPORT)
\r
2835 #define IS_RCC_SAI1CLK(__SOURCE__) \
\r
2836 (((__SOURCE__) == RCC_SAI1CLKSOURCE_PLLSAI1) || \
\r
2837 ((__SOURCE__) == RCC_SAI1CLKSOURCE_PLL) || \
\r
2838 ((__SOURCE__) == RCC_SAI1CLKSOURCE_PIN))
\r
2840 #endif /* RCC_PLLSAI2_SUPPORT */
\r
2842 #if defined(RCC_PLLSAI2_SUPPORT)
\r
2844 #if defined(STM32L4R5xx) || defined(STM32L4R7xx) || defined(STM32L4R9xx) || defined(STM32L4S5xx) || defined(STM32L4S7xx) || defined(STM32L4S9xx)
\r
2845 #define IS_RCC_SAI2CLK(__SOURCE__) \
\r
2846 (((__SOURCE__) == RCC_SAI2CLKSOURCE_PLLSAI1) || \
\r
2847 ((__SOURCE__) == RCC_SAI2CLKSOURCE_PLLSAI2) || \
\r
2848 ((__SOURCE__) == RCC_SAI2CLKSOURCE_PLL) || \
\r
2849 ((__SOURCE__) == RCC_SAI2CLKSOURCE_PIN) || \
\r
2850 ((__SOURCE__) == RCC_SAI2CLKSOURCE_HSI))
\r
2852 #define IS_RCC_SAI2CLK(__SOURCE__) \
\r
2853 (((__SOURCE__) == RCC_SAI2CLKSOURCE_PLLSAI1) || \
\r
2854 ((__SOURCE__) == RCC_SAI2CLKSOURCE_PLLSAI2) || \
\r
2855 ((__SOURCE__) == RCC_SAI2CLKSOURCE_PLL) || \
\r
2856 ((__SOURCE__) == RCC_SAI2CLKSOURCE_PIN))
\r
2857 #endif /* STM32L4R5xx || STM32L4R7xx || STM32L4R9xx || STM32L4S5xx || STM32L4S7xx || STM32L4S9xx */
\r
2859 #endif /* RCC_PLLSAI2_SUPPORT */
\r
2861 #define IS_RCC_LPTIM1CLK(__SOURCE__) \
\r
2862 (((__SOURCE__) == RCC_LPTIM1CLKSOURCE_PCLK1) || \
\r
2863 ((__SOURCE__) == RCC_LPTIM1CLKSOURCE_LSI) || \
\r
2864 ((__SOURCE__) == RCC_LPTIM1CLKSOURCE_HSI) || \
\r
2865 ((__SOURCE__) == RCC_LPTIM1CLKSOURCE_LSE))
\r
2867 #define IS_RCC_LPTIM2CLK(__SOURCE__) \
\r
2868 (((__SOURCE__) == RCC_LPTIM2CLKSOURCE_PCLK1) || \
\r
2869 ((__SOURCE__) == RCC_LPTIM2CLKSOURCE_LSI) || \
\r
2870 ((__SOURCE__) == RCC_LPTIM2CLKSOURCE_HSI) || \
\r
2871 ((__SOURCE__) == RCC_LPTIM2CLKSOURCE_LSE))
\r
2873 #if defined(SDMMC1)
\r
2874 #if defined(RCC_HSI48_SUPPORT) && defined(RCC_CCIPR2_SDMMCSEL)
\r
2876 #define IS_RCC_SDMMC1CLKSOURCE(__SOURCE__) \
\r
2877 (((__SOURCE__) == RCC_SDMMC1CLKSOURCE_PLLP) || \
\r
2878 ((__SOURCE__) == RCC_SDMMC1CLKSOURCE_HSI48) || \
\r
2879 ((__SOURCE__) == RCC_SDMMC1CLKSOURCE_PLLSAI1) || \
\r
2880 ((__SOURCE__) == RCC_SDMMC1CLKSOURCE_PLL) || \
\r
2881 ((__SOURCE__) == RCC_SDMMC1CLKSOURCE_MSI))
\r
2883 #elif defined(RCC_HSI48_SUPPORT)
\r
2885 #define IS_RCC_SDMMC1CLKSOURCE(__SOURCE__) \
\r
2886 (((__SOURCE__) == RCC_SDMMC1CLKSOURCE_HSI48) || \
\r
2887 ((__SOURCE__) == RCC_SDMMC1CLKSOURCE_PLLSAI1) || \
\r
2888 ((__SOURCE__) == RCC_SDMMC1CLKSOURCE_PLL) || \
\r
2889 ((__SOURCE__) == RCC_SDMMC1CLKSOURCE_MSI))
\r
2892 #define IS_RCC_SDMMC1CLKSOURCE(__SOURCE__) \
\r
2893 (((__SOURCE__) == RCC_SDMMC1CLKSOURCE_NONE) || \
\r
2894 ((__SOURCE__) == RCC_SDMMC1CLKSOURCE_PLLSAI1) || \
\r
2895 ((__SOURCE__) == RCC_SDMMC1CLKSOURCE_PLL) || \
\r
2896 ((__SOURCE__) == RCC_SDMMC1CLKSOURCE_MSI))
\r
2898 #endif /* RCC_HSI48_SUPPORT */
\r
2899 #endif /* SDMMC1 */
\r
2901 #if defined(RCC_HSI48_SUPPORT)
\r
2903 #if defined(RCC_PLLSAI1_SUPPORT)
\r
2904 #define IS_RCC_RNGCLKSOURCE(__SOURCE__) \
\r
2905 (((__SOURCE__) == RCC_RNGCLKSOURCE_HSI48) || \
\r
2906 ((__SOURCE__) == RCC_RNGCLKSOURCE_PLLSAI1) || \
\r
2907 ((__SOURCE__) == RCC_RNGCLKSOURCE_PLL) || \
\r
2908 ((__SOURCE__) == RCC_RNGCLKSOURCE_MSI))
\r
2910 #define IS_RCC_RNGCLKSOURCE(__SOURCE__) \
\r
2911 (((__SOURCE__) == RCC_RNGCLKSOURCE_HSI48) || \
\r
2912 ((__SOURCE__) == RCC_RNGCLKSOURCE_PLL) || \
\r
2913 ((__SOURCE__) == RCC_RNGCLKSOURCE_MSI))
\r
2914 #endif /* RCC_PLLSAI1_SUPPORT */
\r
2918 #define IS_RCC_RNGCLKSOURCE(__SOURCE__) \
\r
2919 (((__SOURCE__) == RCC_RNGCLKSOURCE_NONE) || \
\r
2920 ((__SOURCE__) == RCC_RNGCLKSOURCE_PLLSAI1) || \
\r
2921 ((__SOURCE__) == RCC_RNGCLKSOURCE_PLL) || \
\r
2922 ((__SOURCE__) == RCC_RNGCLKSOURCE_MSI))
\r
2924 #endif /* RCC_HSI48_SUPPORT */
\r
2926 #if defined(USB_OTG_FS) || defined(USB)
\r
2927 #if defined(RCC_HSI48_SUPPORT)
\r
2929 #if defined(RCC_PLLSAI1_SUPPORT)
\r
2930 #define IS_RCC_USBCLKSOURCE(__SOURCE__) \
\r
2931 (((__SOURCE__) == RCC_USBCLKSOURCE_HSI48) || \
\r
2932 ((__SOURCE__) == RCC_USBCLKSOURCE_PLLSAI1) || \
\r
2933 ((__SOURCE__) == RCC_USBCLKSOURCE_PLL) || \
\r
2934 ((__SOURCE__) == RCC_USBCLKSOURCE_MSI))
\r
2936 #define IS_RCC_USBCLKSOURCE(__SOURCE__) \
\r
2937 (((__SOURCE__) == RCC_USBCLKSOURCE_HSI48) || \
\r
2938 ((__SOURCE__) == RCC_USBCLKSOURCE_PLL) || \
\r
2939 ((__SOURCE__) == RCC_USBCLKSOURCE_MSI))
\r
2940 #endif /* RCC_PLLSAI1_SUPPORT */
\r
2944 #define IS_RCC_USBCLKSOURCE(__SOURCE__) \
\r
2945 (((__SOURCE__) == RCC_USBCLKSOURCE_NONE) || \
\r
2946 ((__SOURCE__) == RCC_USBCLKSOURCE_PLLSAI1) || \
\r
2947 ((__SOURCE__) == RCC_USBCLKSOURCE_PLL) || \
\r
2948 ((__SOURCE__) == RCC_USBCLKSOURCE_MSI))
\r
2950 #endif /* RCC_HSI48_SUPPORT */
\r
2951 #endif /* USB_OTG_FS || USB */
\r
2953 #if defined(STM32L471xx) || defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx) || defined(STM32L496xx) || defined(STM32L4A6xx)
\r
2955 #define IS_RCC_ADCCLKSOURCE(__SOURCE__) \
\r
2956 (((__SOURCE__) == RCC_ADCCLKSOURCE_NONE) || \
\r
2957 ((__SOURCE__) == RCC_ADCCLKSOURCE_PLLSAI1) || \
\r
2958 ((__SOURCE__) == RCC_ADCCLKSOURCE_PLLSAI2) || \
\r
2959 ((__SOURCE__) == RCC_ADCCLKSOURCE_SYSCLK))
\r
2963 #if defined(RCC_PLLSAI1_SUPPORT)
\r
2964 #define IS_RCC_ADCCLKSOURCE(__SOURCE__) \
\r
2965 (((__SOURCE__) == RCC_ADCCLKSOURCE_NONE) || \
\r
2966 ((__SOURCE__) == RCC_ADCCLKSOURCE_PLLSAI1) || \
\r
2967 ((__SOURCE__) == RCC_ADCCLKSOURCE_SYSCLK))
\r
2969 #define IS_RCC_ADCCLKSOURCE(__SOURCE__) \
\r
2970 (((__SOURCE__) == RCC_ADCCLKSOURCE_NONE) || \
\r
2971 ((__SOURCE__) == RCC_ADCCLKSOURCE_SYSCLK))
\r
2972 #endif /* RCC_PLLSAI1_SUPPORT */
\r
2974 #endif /* STM32L471xx || STM32L475xx || STM32L476xx || STM32L485xx || STM32L486xx || STM32L496xx || STM32L4A6xx */
\r
2976 #if defined(SWPMI1)
\r
2978 #define IS_RCC_SWPMI1CLKSOURCE(__SOURCE__) \
\r
2979 (((__SOURCE__) == RCC_SWPMI1CLKSOURCE_PCLK1) || \
\r
2980 ((__SOURCE__) == RCC_SWPMI1CLKSOURCE_HSI))
\r
2982 #endif /* SWPMI1 */
\r
2984 #if defined(DFSDM1_Filter0)
\r
2986 #define IS_RCC_DFSDM1CLKSOURCE(__SOURCE__) \
\r
2987 (((__SOURCE__) == RCC_DFSDM1CLKSOURCE_PCLK2) || \
\r
2988 ((__SOURCE__) == RCC_DFSDM1CLKSOURCE_SYSCLK))
\r
2990 #if defined(STM32L4R5xx) || defined(STM32L4R7xx) || defined(STM32L4R9xx) || defined(STM32L4S5xx) || defined(STM32L4S7xx) || defined(STM32L4S9xx)
\r
2992 #define IS_RCC_DFSDM1AUDIOCLKSOURCE(__SOURCE__) \
\r
2993 (((__SOURCE__) == RCC_DFSDM1AUDIOCLKSOURCE_SAI1) || \
\r
2994 ((__SOURCE__) == RCC_DFSDM1AUDIOCLKSOURCE_HSI) || \
\r
2995 ((__SOURCE__) == RCC_DFSDM1AUDIOCLKSOURCE_MSI))
\r
2997 #endif /* STM32L4R5xx || STM32L4R7xx || STM32L4R9xx || STM32L4S5xx || STM32L4S7xx || STM32L4S9xx */
\r
2999 #endif /* DFSDM1_Filter0 */
\r
3003 #define IS_RCC_LTDCCLKSOURCE(__SOURCE__) \
\r
3004 (((__SOURCE__) == RCC_LTDCCLKSOURCE_PLLSAI2_DIV2) || \
\r
3005 ((__SOURCE__) == RCC_LTDCCLKSOURCE_PLLSAI2_DIV4) || \
\r
3006 ((__SOURCE__) == RCC_LTDCCLKSOURCE_PLLSAI2_DIV8) || \
\r
3007 ((__SOURCE__) == RCC_LTDCCLKSOURCE_PLLSAI2_DIV16))
\r
3013 #define IS_RCC_DSICLKSOURCE(__SOURCE__) \
\r
3014 (((__SOURCE__) == RCC_DSICLKSOURCE_DSIPHY) || \
\r
3015 ((__SOURCE__) == RCC_DSICLKSOURCE_PLLSAI2))
\r
3019 #if defined(OCTOSPI1) || defined(OCTOSPI2)
\r
3021 #define IS_RCC_OSPICLKSOURCE(__SOURCE__) \
\r
3022 (((__SOURCE__) == RCC_OSPICLKSOURCE_SYSCLK) || \
\r
3023 ((__SOURCE__) == RCC_OSPICLKSOURCE_MSI) || \
\r
3024 ((__SOURCE__) == RCC_OSPICLKSOURCE_PLL))
\r
3026 #endif /* OCTOSPI1 || OCTOSPI2 */
\r
3028 #if defined(RCC_PLLSAI1_SUPPORT)
\r
3030 #define IS_RCC_PLLSAI1SOURCE(__VALUE__) IS_RCC_PLLSOURCE(__VALUE__)
\r
3032 #if defined(RCC_PLLSAI1M_DIV_1_16_SUPPORT)
\r
3033 #define IS_RCC_PLLSAI1M_VALUE(__VALUE__) ((1U <= (__VALUE__)) && ((__VALUE__) <= 16U))
\r
3035 #define IS_RCC_PLLSAI1M_VALUE(__VALUE__) ((1U <= (__VALUE__)) && ((__VALUE__) <= 8U))
\r
3036 #endif /* RCC_PLLSAI1M_DIV_1_16_SUPPORT */
\r
3038 #define IS_RCC_PLLSAI1N_VALUE(__VALUE__) ((8U <= (__VALUE__)) && ((__VALUE__) <= 86U))
\r
3040 #if defined(RCC_PLLSAI1P_DIV_2_31_SUPPORT)
\r
3041 #define IS_RCC_PLLSAI1P_VALUE(__VALUE__) (((__VALUE__) >= 2U) && ((__VALUE__) <= 31U))
\r
3043 #define IS_RCC_PLLSAI1P_VALUE(__VALUE__) (((__VALUE__) == 7U) || ((__VALUE__) == 17U))
\r
3044 #endif /* RCC_PLLSAI1P_DIV_2_31_SUPPORT */
\r
3046 #define IS_RCC_PLLSAI1Q_VALUE(__VALUE__) (((__VALUE__) == 2U) || ((__VALUE__) == 4U) || \
\r
3047 ((__VALUE__) == 6U) || ((__VALUE__) == 8U))
\r
3049 #define IS_RCC_PLLSAI1R_VALUE(__VALUE__) (((__VALUE__) == 2U) || ((__VALUE__) == 4U) || \
\r
3050 ((__VALUE__) == 6U) || ((__VALUE__) == 8U))
\r
3052 #endif /* RCC_PLLSAI1_SUPPORT */
\r
3054 #if defined(RCC_PLLSAI2_SUPPORT)
\r
3056 #define IS_RCC_PLLSAI2SOURCE(__VALUE__) IS_RCC_PLLSOURCE(__VALUE__)
\r
3058 #if defined(RCC_PLLSAI2M_DIV_1_16_SUPPORT)
\r
3059 #define IS_RCC_PLLSAI2M_VALUE(__VALUE__) ((1U <= (__VALUE__)) && ((__VALUE__) <= 16U))
\r
3061 #define IS_RCC_PLLSAI2M_VALUE(__VALUE__) ((1U <= (__VALUE__)) && ((__VALUE__) <= 8U))
\r
3062 #endif /* RCC_PLLSAI2M_DIV_1_16_SUPPORT */
\r
3064 #define IS_RCC_PLLSAI2N_VALUE(__VALUE__) ((8U <= (__VALUE__)) && ((__VALUE__) <= 86U))
\r
3066 #if defined(RCC_PLLSAI2P_DIV_2_31_SUPPORT)
\r
3067 #define IS_RCC_PLLSAI2P_VALUE(__VALUE__) (((__VALUE__) >= 2U) && ((__VALUE__) <= 31U))
\r
3069 #define IS_RCC_PLLSAI2P_VALUE(__VALUE__) (((__VALUE__) == 7U) || ((__VALUE__) == 17U))
\r
3070 #endif /* RCC_PLLSAI2P_DIV_2_31_SUPPORT */
\r
3072 #if defined(RCC_PLLSAI2Q_DIV_SUPPORT)
\r
3073 #define IS_RCC_PLLSAI2Q_VALUE(__VALUE__) (((__VALUE__) == 2U) || ((__VALUE__) == 4U) || \
\r
3074 ((__VALUE__) == 6U) || ((__VALUE__) == 8U))
\r
3075 #endif /* RCC_PLLSAI2Q_DIV_SUPPORT */
\r
3077 #define IS_RCC_PLLSAI2R_VALUE(__VALUE__) (((__VALUE__) == 2U) || ((__VALUE__) == 4U) || \
\r
3078 ((__VALUE__) == 6U) || ((__VALUE__) == 8U))
\r
3080 #endif /* RCC_PLLSAI2_SUPPORT */
\r
3084 #define IS_RCC_CRS_SYNC_SOURCE(__SOURCE__) (((__SOURCE__) == RCC_CRS_SYNC_SOURCE_GPIO) || \
\r
3085 ((__SOURCE__) == RCC_CRS_SYNC_SOURCE_LSE) || \
\r
3086 ((__SOURCE__) == RCC_CRS_SYNC_SOURCE_USB))
\r
3088 #define IS_RCC_CRS_SYNC_DIV(__DIV__) (((__DIV__) == RCC_CRS_SYNC_DIV1) || ((__DIV__) == RCC_CRS_SYNC_DIV2) || \
\r
3089 ((__DIV__) == RCC_CRS_SYNC_DIV4) || ((__DIV__) == RCC_CRS_SYNC_DIV8) || \
\r
3090 ((__DIV__) == RCC_CRS_SYNC_DIV16) || ((__DIV__) == RCC_CRS_SYNC_DIV32) || \
\r
3091 ((__DIV__) == RCC_CRS_SYNC_DIV64) || ((__DIV__) == RCC_CRS_SYNC_DIV128))
\r
3093 #define IS_RCC_CRS_SYNC_POLARITY(__POLARITY__) (((__POLARITY__) == RCC_CRS_SYNC_POLARITY_RISING) || \
\r
3094 ((__POLARITY__) == RCC_CRS_SYNC_POLARITY_FALLING))
\r
3096 #define IS_RCC_CRS_RELOADVALUE(__VALUE__) (((__VALUE__) <= 0xFFFFU))
\r
3098 #define IS_RCC_CRS_ERRORLIMIT(__VALUE__) (((__VALUE__) <= 0xFFU))
\r
3100 #define IS_RCC_CRS_HSI48CALIBRATION(__VALUE__) (((__VALUE__) <= 0x3FU))
\r
3102 #define IS_RCC_CRS_FREQERRORDIR(__DIR__) (((__DIR__) == RCC_CRS_FREQERRORDIR_UP) || \
\r
3103 ((__DIR__) == RCC_CRS_FREQERRORDIR_DOWN))
\r
3119 #ifdef __cplusplus
\r
3123 #endif /* __STM32L4xx_HAL_RCC_EX_H */
\r
3125 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
\r