You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

4474 lines
168 KiB

  1. /**
  2. ******************************************************************************
  3. * @file stm32wbxx_ll_rcc.h
  4. * @author MCD Application Team
  5. * @brief Header file of RCC LL module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
  10. * All rights reserved.</center></h2>
  11. *
  12. * This software component is licensed by ST under BSD 3-Clause license,
  13. * the "License"; You may not use this file except in compliance with the
  14. * License. You may obtain a copy of the License at:
  15. * opensource.org/licenses/BSD-3-Clause
  16. *
  17. ******************************************************************************
  18. */
  19. /* Define to prevent recursive inclusion -------------------------------------*/
  20. #ifndef STM32WBxx_LL_RCC_H
  21. #define STM32WBxx_LL_RCC_H
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. /* Includes ------------------------------------------------------------------*/
  26. #include "stm32wbxx.h"
  27. /** @addtogroup STM32WBxx_LL_Driver
  28. * @{
  29. */
  30. #if defined(RCC)
  31. /** @defgroup RCC_LL RCC
  32. * @{
  33. */
  34. /* Private types -------------------------------------------------------------*/
  35. /* Private variables ---------------------------------------------------------*/
  36. /** @defgroup RCC_LL_Private_Variables RCC Private Variables
  37. * @{
  38. */
  39. #define HSE_CONTROL_UNLOCK_KEY 0xCAFECAFEU
  40. /**
  41. * @}
  42. */
  43. /* Private constants ---------------------------------------------------------*/
  44. /* Private macros ------------------------------------------------------------*/
  45. #if defined(USE_FULL_LL_DRIVER)
  46. /** @defgroup RCC_LL_Private_Macros RCC Private Macros
  47. * @{
  48. */
  49. /**
  50. * @}
  51. */
  52. #endif /*USE_FULL_LL_DRIVER*/
  53. /* Exported types ------------------------------------------------------------*/
  54. #if defined(USE_FULL_LL_DRIVER)
  55. /** @defgroup RCC_LL_Exported_Types RCC Exported Types
  56. * @{
  57. */
  58. /** @defgroup LL_ES_CLOCK_FREQ Clocks Frequency Structure
  59. * @{
  60. */
  61. /**
  62. * @brief RCC Clocks Frequency Structure
  63. */
  64. typedef struct
  65. {
  66. uint32_t SYSCLK_Frequency; /*!< SYSCLK clock frequency */
  67. uint32_t HCLK1_Frequency; /*!< HCLK1 clock frequency */
  68. uint32_t HCLK2_Frequency; /*!< HCLK2 clock frequency */
  69. uint32_t HCLK4_Frequency; /*!< HCLK4 clock frequency */
  70. uint32_t HCLK5_Frequency; /*!< HCLK5 clock frequency */
  71. uint32_t PCLK1_Frequency; /*!< PCLK1 clock frequency */
  72. uint32_t PCLK2_Frequency; /*!< PCLK2 clock frequency */
  73. } LL_RCC_ClocksTypeDef;
  74. /**
  75. * @}
  76. */
  77. /**
  78. * @}
  79. */
  80. #endif /* USE_FULL_LL_DRIVER */
  81. /* Exported constants --------------------------------------------------------*/
  82. /** @defgroup RCC_LL_Exported_Constants RCC Exported Constants
  83. * @{
  84. */
  85. /** @defgroup RCC_LL_EC_OSC_VALUES Oscillator Values adaptation
  86. * @brief Defines used to adapt values of different oscillators
  87. * @note These values could be modified in the user environment according to
  88. * HW set-up.
  89. * @{
  90. */
  91. #if !defined (HSE_VALUE)
  92. #define HSE_VALUE 32000000U /*!< Value of the HSE oscillator in Hz */
  93. #endif /* HSE_VALUE */
  94. #if !defined (HSI_VALUE)
  95. #define HSI_VALUE 16000000U /*!< Value of the HSI oscillator in Hz */
  96. #endif /* HSI_VALUE */
  97. #if !defined (LSE_VALUE)
  98. #define LSE_VALUE 32768U /*!< Value of the LSE oscillator in Hz */
  99. #endif /* LSE_VALUE */
  100. #if !defined (LSI_VALUE)
  101. #define LSI_VALUE 32000U /*!< Value of the LSI oscillator in Hz */
  102. #endif /* LSI_VALUE */
  103. #if defined(RCC_HSI48_SUPPORT)
  104. #if !defined (HSI48_VALUE)
  105. #define HSI48_VALUE 48000000U /*!< Value of the HSI48 oscillator in Hz */
  106. #endif /* HSI48_VALUE */
  107. #endif
  108. /**
  109. * @}
  110. */
  111. /** @defgroup RCC_LL_EC_CLEAR_FLAG Clear Flags Defines
  112. * @brief Flags defines which can be used with LL_RCC_WriteReg function
  113. * @{
  114. */
  115. #define LL_RCC_CICR_LSI1RDYC RCC_CICR_LSI1RDYC /*!< LSI1 Ready Interrupt Clear */
  116. #define LL_RCC_CICR_LSI2RDYC RCC_CICR_LSI2RDYC /*!< LSI1 Ready Interrupt Clear */
  117. #define LL_RCC_CICR_LSERDYC RCC_CICR_LSERDYC /*!< LSE Ready Interrupt Clear */
  118. #define LL_RCC_CICR_MSIRDYC RCC_CICR_MSIRDYC /*!< MSI Ready Interrupt Clear */
  119. #define LL_RCC_CICR_HSIRDYC RCC_CICR_HSIRDYC /*!< HSI Ready Interrupt Clear */
  120. #define LL_RCC_CICR_HSERDYC RCC_CICR_HSERDYC /*!< HSE Ready Interrupt Clear */
  121. #define LL_RCC_CICR_PLLRDYC RCC_CICR_PLLRDYC /*!< PLL Ready Interrupt Clear */
  122. #if defined(RCC_HSI48_SUPPORT)
  123. #define LL_RCC_CICR_HSI48RDYC RCC_CICR_HSI48RDYC /*!< HSI48 Ready Interrupt Clear */
  124. #endif
  125. #if defined(SAI1)
  126. #define LL_RCC_CICR_PLLSAI1RDYC RCC_CICR_PLLSAI1RDYC /*!< PLLSAI1 Ready Interrupt Clear */
  127. #endif
  128. #define LL_RCC_CICR_LSECSSC RCC_CICR_LSECSSC /*!< LSE Clock Security System Interrupt Clear */
  129. #define LL_RCC_CICR_CSSC RCC_CICR_CSSC /*!< Clock Security System Interrupt Clear */
  130. /**
  131. * @}
  132. */
  133. /** @defgroup RCC_LL_EC_GET_FLAG Get Flags Defines
  134. * @brief Flags defines which can be used with LL_RCC_ReadReg function
  135. * @{
  136. */
  137. #define LL_RCC_CIFR_LSI1RDYF RCC_CIFR_LSI1RDYF /*!< LSI1 Ready Interrupt flag */
  138. #define LL_RCC_CIFR_LSI2RDYF RCC_CIFR_LSI2RDYF /*!< LSI2 Ready Interrupt flag */
  139. #define LL_RCC_CIFR_LSERDYF RCC_CIFR_LSERDYF /*!< LSE Ready Interrupt flag */
  140. #define LL_RCC_CIFR_MSIRDYF RCC_CIFR_MSIRDYF /*!< MSI Ready Interrupt flag */
  141. #define LL_RCC_CIFR_HSIRDYF RCC_CIFR_HSIRDYF /*!< HSI Ready Interrupt flag */
  142. #define LL_RCC_CIFR_HSERDYF RCC_CIFR_HSERDYF /*!< HSE Ready Interrupt flag */
  143. #define LL_RCC_CIFR_PLLRDYF RCC_CIFR_PLLRDYF /*!< PLL Ready Interrupt flag */
  144. #if defined(RCC_HSI48_SUPPORT)
  145. #define LL_RCC_CIFR_HSI48RDYF RCC_CIFR_HSI48RDYF /*!< HSI48 Ready Interrupt flag */
  146. #endif
  147. #if defined(SAI1)
  148. #define LL_RCC_CIFR_PLLSAI1RDYF RCC_CIFR_PLLSAI1RDYF /*!< PLLSAI1 Ready Interrupt flag */
  149. #endif
  150. #define LL_RCC_CIFR_LSECSSF RCC_CIFR_LSECSSF /*!< LSE Clock Security System Interrupt flag */
  151. #define LL_RCC_CIFR_CSSF RCC_CIFR_CSSF /*!< Clock Security System Interrupt flag */
  152. #define LL_RCC_CSR_LPWRRSTF RCC_CSR_LPWRRSTF /*!< Low-Power reset flag */
  153. #define LL_RCC_CSR_OBLRSTF RCC_CSR_OBLRSTF /*!< OBL reset flag */
  154. #define LL_RCC_CSR_PINRSTF RCC_CSR_PINRSTF /*!< PIN reset flag */
  155. #define LL_RCC_CSR_SFTRSTF RCC_CSR_SFTRSTF /*!< Software Reset flag */