reg_rcc.h 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654
  1. ////////////////////////////////////////////////////////////////////////////////
  2. /// @file reg_rcc.h
  3. /// @author AE TEAM
  4. /// @brief THIS FILE CONTAINS ALL THE FUNCTIONS PROTOTYPES FOR THE SERIES OF
  5. /// MM32 FIRMWARE LIBRARY.
  6. ////////////////////////////////////////////////////////////////////////////////
  7. /// @attention
  8. ///
  9. /// THE EXISTING FIRMWARE IS ONLY FOR REFERENCE, WHICH IS DESIGNED TO PROVIDE
  10. /// CUSTOMERS WITH CODING INFORMATION ABOUT THEIR PRODUCTS SO THEY CAN SAVE
  11. /// TIME. THEREFORE, MINDMOTION SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT OR
  12. /// CONSEQUENTIAL DAMAGES ABOUT ANY CLAIMS ARISING OUT OF THE CONTENT OF SUCH
  13. /// HARDWARE AND/OR THE USE OF THE CODING INFORMATION CONTAINED HEREIN IN
  14. /// CONNECTION WITH PRODUCTS MADE BY CUSTOMERS.
  15. ///
  16. /// <H2><CENTER>&COPY; COPYRIGHT MINDMOTION </CENTER></H2>
  17. ////////////////////////////////////////////////////////////////////////////////
  18. // Define to prevent recursive inclusion
  19. #ifndef __REG_RCC_H
  20. #define __REG_RCC_H
  21. // Files includes
  22. #include <stdint.h>
  23. #include <stdbool.h>
  24. #include "types.h"
  25. #if defined ( __CC_ARM )
  26. #pragma anon_unions
  27. #endif
  28. ////////////////////////////////////////////////////////////////////////////////
  29. /// @brief RCC Base Address Definition
  30. ////////////////////////////////////////////////////////////////////////////////
  31. #define RCC_BASE (AHBPERIPH_BASE + 0x1000) ///< Base Address: 0x40021000
  32. ////////////////////////////////////////////////////////////////////////////////
  33. /// @brief RCC Register Structure Definition
  34. ////////////////////////////////////////////////////////////////////////////////
  35. typedef struct {
  36. __IO u32 CR; ///< Control Register offset: 0x00
  37. __IO u32 CFGR; ///< Configuration Register offset: 0x04
  38. __IO u32 CIR; ///< Clock Interrupt Register offset: 0x08
  39. __IO u32 AHB3RSTR; ///< Advanced High Performance Bus 3 Reset Register offset: 0x0C
  40. __IO u32 AHB2RSTR; ///< Advanced High Performance Bus 2 Reset Register offset: 0x10
  41. __IO u32 AHBRSTR; ///< Advanced High Performance Bus 1 Reset Register offset: 0x14
  42. __IO u32 APB2RSTR; ///< Advanced Peripheral Bus 2 Reset Register offset: 0x18
  43. __IO u32 APB1RSTR; ///< Advanced Peripheral Bus 1 Reset Register offset: 0x1C
  44. __IO u32 AHB3ENR; ///< Advanced High Performance Bus 3 Enable Register offset: 0x20
  45. __IO u32 AHB2ENR; ///< Advanced High Performance Bus 2 Enable Register offset: 0x24
  46. union {
  47. __IO u32 AHBENR; ///< Advanced High Performance Bus 1 Enable Register offset: 0x28
  48. __IO u32 AHB1ENR;
  49. };
  50. __IO u32 APB2ENR; ///< Advanced Peripheral Bus 2 Enable Register offset: 0x2C
  51. __IO u32 APB1ENR; ///< Advanced Peripheral Bus 1 Enable Register offset: 0x30
  52. __IO u32 BDCR; ///< Backup Domain Control Register offset: 0x34
  53. __IO u32 CSR; ///< Control Status Register offset: 0x38
  54. __IO u32 SYSCFGR; ///< System Configuration Register offset: 0x3C
  55. __IO u32 CFGR2; ///< System Configuration Register offset: 0x40
  56. __IO u32 ICSCR; ///< Internal clock source calibration register offset: 0x44
  57. __IO u32 PLLCFGR; ///< PLL configures registers offset: 0x48
  58. u32 Reserved1[13]; ///< Reserved space
  59. __IO u32 HSIDLY; ///< HSI delay register offset: 0x80
  60. __IO u32 HSEDLY; ///< HSE delay register offset: 0x84
  61. __IO u32 PLLDLY; ///< PLL delay register offset: 0x88
  62. } RCC_TypeDef;
  63. ////////////////////////////////////////////////////////////////////////////////
  64. /// @brief RCC type pointer Definition
  65. ////////////////////////////////////////////////////////////////////////////////
  66. #define RCC ((RCC_TypeDef*) RCC_BASE)
  67. ////////////////////////////////////////////////////////////////////////////////
  68. /// @brief RCC_CR Register Bit Definition
  69. ////////////////////////////////////////////////////////////////////////////////
  70. #define RCC_CR_HSION_Pos (0)
  71. #define RCC_CR_HSION (0x01U << RCC_CR_HSION_Pos) ///< Internal High Speed clock enable
  72. #define RCC_CR_HSIRDY_Pos (1)
  73. #define RCC_CR_HSIRDY (0x01U << RCC_CR_HSIRDY_Pos) ///< Internal High Speed clock ready flag
  74. #define RCC_CR_HSIDIV_Pos (11)
  75. #define RCC_CR_HSIDIV_0 (0x00U << RCC_CR_HSIDIV_Pos) ///< HSI regardless of frequency
  76. #define RCC_CR_HSIDIV_2 (0x01U << RCC_CR_HSIDIV_Pos) ///< HSI 2 frequency division
  77. #define RCC_CR_HSIDIV_4 (0x02U << RCC_CR_HSIDIV_Pos) ///< HSI 4 frequency division
  78. #define RCC_CR_HSIDIV_8 (0x03U << RCC_CR_HSIDIV_Pos) ///< HSI eight points and frequency
  79. #define RCC_CR_HSIDIV_16 (0x04U << RCC_CR_HSIDIV_Pos) ///< HSI 16 points and frequency
  80. #define RCC_CR_HSIDIV_32 (0x05U << RCC_CR_HSIDIV_Pos) ///< HSI 32 points and frequency
  81. #define RCC_CR_HSIDIV_64 (0x06U << RCC_CR_HSIDIV_Pos) ///< HSI 64 frequency division
  82. #define RCC_CR_HSIDIV_128 (0x07U << RCC_CR_HSIDIV_Pos) ///< HSI 128 frequency division
  83. #define RCC_CR_HSEON_Pos (16)
  84. #define RCC_CR_HSEON (0x01U << RCC_CR_HSEON_Pos) ///< External High Speed clock enable
  85. #define RCC_CR_HSERDY_Pos (17)
  86. #define RCC_CR_HSERDY (0x01U << RCC_CR_HSERDY_Pos) ///< External High Speed clock ready flag
  87. #define RCC_CR_HSEBYP_Pos (18)
  88. #define RCC_CR_HSEBYP (0x01U << RCC_CR_HSEBYP_Pos) ///< External High Speed clock Bypass
  89. #define RCC_CR_CSSON_Pos (19)
  90. #define RCC_CR_CSSON (0x01U << RCC_CR_CSSON_Pos) ///< Clock Security System enable
  91. #define RCC_CR_PLLON_Pos (24)
  92. #define RCC_CR_PLLON (0x01U << RCC_CR_PLLON_Pos) ///< PLL enable
  93. #define RCC_CR_PLLRDY_Pos (25)
  94. #define RCC_CR_PLLRDY (0x01U << RCC_CR_PLLRDY_Pos) ///< PLL clock ready flag
  95. ////////////////////////////////////////////////////////////////////////////////
  96. /// @brief RCC_CFGR Register Bit Definition
  97. ////////////////////////////////////////////////////////////////////////////////
  98. #define RCC_CFGR_SW_Pos (0)
  99. #define RCC_CFGR_SW (0x03U << RCC_CFGR_SW_Pos) ///< SW[1:0] bits (System clock Switch)
  100. #define RCC_CFGR_SW_HSI_DIV6 (0x00U << RCC_CFGR_SW_Pos) ///< HSI/6 selected as system clock
  101. #define RCC_CFGR_SW_HSE (0x01U << RCC_CFGR_SW_Pos) ///< HSE selected as system clock
  102. #define RCC_CFGR_SW_PLL (0x02U << RCC_CFGR_SW_Pos) ///< PLL selected as system clock
  103. #define RCC_CFGR_SW_LSI (0x03U << RCC_CFGR_SW_Pos) ///< LSI selected as system clock
  104. #define RCC_CFGR_SWS_Pos (2)
  105. #define RCC_CFGR_SWS (0x03U << RCC_CFGR_SWS_Pos) ///< SWS[1:0] bits (System Clock Switch Status)
  106. #define RCC_CFGR_SWS_HSI_DIV6 (0x00U << RCC_CFGR_SWS_Pos) ///< HSI/6 oscillator used as system clock
  107. #define RCC_CFGR_SWS_HSE (0x01U << RCC_CFGR_SWS_Pos) ///< HSE oscillator used as system clock
  108. #define RCC_CFGR_SWS_PLL (0x02U << RCC_CFGR_SWS_Pos) ///< PLL used as system clock
  109. #define RCC_CFGR_SWS_LSI (0x03U << RCC_CFGR_SWS_Pos) ///< LSI used as system clock
  110. #define RCC_CFGR_HPRE_Pos (4)
  111. #define RCC_CFGR_HPRE (0x0FU << RCC_CFGR_HPRE_Pos) ///< HPRE[3:0] bits (AHB prescaler)
  112. #define RCC_CFGR_PPRE_0 (0x01U << RCC_CFGR_HPRE_Pos) ///< Bit 0
  113. #define RCC_CFGR_PPRE_1 (0x02U << RCC_CFGR_HPRE_Pos) ///< Bit 1
  114. #define RCC_CFGR_PPRE_2 (0x04U << RCC_CFGR_HPRE_Pos) ///< Bit 2
  115. #define RCC_CFGR_PPRE_3 (0x08U << RCC_CFGR_HPRE_Pos) ///< Bit 3
  116. #define RCC_CFGR_HPRE_DIV1 (0x00U << RCC_CFGR_HPRE_Pos) ///< AHB = FCLK = SYSCLK not divided
  117. #define RCC_CFGR_HPRE_DIV2 (0x08U << RCC_CFGR_HPRE_Pos) ///< AHB = FCLK = SYSCLK divided by 2
  118. #define RCC_CFGR_HPRE_DIV4 (0x09U << RCC_CFGR_HPRE_Pos) ///< AHB = FCLK = SYSCLK divided by 4
  119. #define RCC_CFGR_HPRE_DIV8 (0x0AU << RCC_CFGR_HPRE_Pos) ///< AHB = FCLK = SYSCLK divided by 8
  120. #define RCC_CFGR_HPRE_DIV16 (0x0BU << RCC_CFGR_HPRE_Pos) ///< AHB = FCLK = SYSCLK divided by 16
  121. #define RCC_CFGR_HPRE_DIV64 (0x0CU << RCC_CFGR_HPRE_Pos) ///< AHB = FCLK = SYSCLK divided by 64
  122. #define RCC_CFGR_HPRE_DIV128 (0x0DU << RCC_CFGR_HPRE_Pos) ///< AHB = FCLK = SYSCLK divided by 128
  123. #define RCC_CFGR_HPRE_DIV256 (0x0EU << RCC_CFGR_HPRE_Pos) ///< AHB = FCLK = SYSCLK divided by 256
  124. #define RCC_CFGR_HPRE_DIV512 (0x0FU << RCC_CFGR_HPRE_Pos) ///< AHB = FCLK = SYSCLK divided by 512
  125. #define RCC_CFGR_PPRE1_Pos (8)
  126. #define RCC_CFGR_PPRE1 (0x07U << RCC_CFGR_PPRE1_Pos) ///< PRE1[2:0] bits (APB1 prescaler)
  127. #define RCC_CFGR_PPRE1_0 (0x01U << RCC_CFGR_PPRE1_Pos) ///< Bit 0
  128. #define RCC_CFGR_PPRE1_1 (0x02U << RCC_CFGR_PPRE1_Pos) ///< Bit 1
  129. #define RCC_CFGR_PPRE1_2 (0x04U << RCC_CFGR_PPRE1_Pos) ///< Bit 2
  130. #define RCC_CFGR_PPRE1_DIV1 (0x00U << RCC_CFGR_PPRE1_Pos) ///< APB1 = HCLK not divided
  131. #define RCC_CFGR_PPRE1_DIV2 (0x04U << RCC_CFGR_PPRE1_Pos) ///< APB1 = HCLK divided by 2
  132. #define RCC_CFGR_PPRE1_DIV4 (0x05U << RCC_CFGR_PPRE1_Pos) ///< APB1 = HCLK divided by 4
  133. #define RCC_CFGR_PPRE1_DIV8 (0x06U << RCC_CFGR_PPRE1_Pos) ///< APB1 = HCLK divided by 8
  134. #define RCC_CFGR_PPRE1_DIV16 (0x07U << RCC_CFGR_PPRE1_Pos) ///< APB1 = HCLK divided by 16
  135. #define RCC_CFGR_PPRE2_Pos (11)
  136. #define RCC_CFGR_PPRE2 (0x07U << RCC_CFGR_PPRE2_Pos) ///< PRE2[2:0] bits (APB2 prescaler)
  137. #define RCC_CFGR_PPRE2_0 (0x01U << RCC_CFGR_PPRE2_Pos) ///< Bit 0
  138. #define RCC_CFGR_PPRE2_1 (0x02U << RCC_CFGR_PPRE2_Pos) ///< Bit 1
  139. #define RCC_CFGR_PPRE2_2 (0x04U << RCC_CFGR_PPRE2_Pos) ///< Bit 2
  140. #define RCC_CFGR_PPRE2_DIV1 (0x00U << RCC_CFGR_PPRE2_Pos) ///< APB2 = HCLK not divided
  141. #define RCC_CFGR_PPRE2_DIV2 (0x04U << RCC_CFGR_PPRE2_Pos) ///< APB2 = HCLK divided by 2
  142. #define RCC_CFGR_PPRE2_DIV4 (0x05U << RCC_CFGR_PPRE2_Pos) ///< APB2 = HCLK divided by 4
  143. #define RCC_CFGR_PPRE2_DIV8 (0x06U << RCC_CFGR_PPRE2_Pos) ///< APB2 = HCLK divided by 8
  144. #define RCC_CFGR_PPRE2_DIV16 (0x07U << RCC_CFGR_PPRE2_Pos) ///< APB2 = HCLK divided by 16
  145. #define RCC_CFGR_USBPRE_Pos (22)
  146. #define RCC_CFGR_USBPRE (0x03U << RCC_CFGR_USBPRE_Pos) ///< USB prescaler BIT[1:0]
  147. #define RCC_CFGR_MCO_Pos (24)
  148. #define RCC_CFGR_MCO (0x07U << RCC_CFGR_MCO_Pos) ///< MCO[2:0] bits (Microcontroller Clock Output)
  149. #define RCC_CFGR_MCO_NOCLOCK (0x00U << RCC_CFGR_MCO_Pos) ///< No clock
  150. #define RCC_CFGR_MCO_LSI (0x02U << RCC_CFGR_MCO_Pos) ///< LSI clock
  151. #define RCC_CFGR_MCO_LSE (0x03U << RCC_CFGR_MCO_Pos) ///< LSE clock
  152. #define RCC_CFGR_MCO_SYSCLK (0x04U << RCC_CFGR_MCO_Pos) ///< System clock selected
  153. #define RCC_CFGR_MCO_HSI (0x05U << RCC_CFGR_MCO_Pos) ///< Internal 48 MHz RC oscillator clock selected
  154. #define RCC_CFGR_MCO_HSE (0x06U << RCC_CFGR_MCO_Pos) ///< External 1-25 MHz oscillator clock selected
  155. #define RCC_CFGR_MCO_PLL (0x07U << RCC_CFGR_MCO_Pos) ///< PLL clock divided by 2 selected
  156. ////////////////////////////////////////////////////////////////////////////////
  157. /// @brief RCC_CIR Register Bit Definition
  158. ////////////////////////////////////////////////////////////////////////////////
  159. #define RCC_CIR_LSIRDYF_Pos (0)
  160. #define RCC_CIR_LSIRDYF (0x01U << RCC_CIR_LSIRDYF_Pos) ///< LSI Ready Interrupt flag
  161. #define RCC_CIR_LSERDYF_Pos (1)
  162. #define RCC_CIR_LSERDYF (0x01U << RCC_CIR_LSERDYF_Pos) ///< LSE Ready Interrupt flag
  163. #define RCC_CIR_HSIRDYF_Pos (2)
  164. #define RCC_CIR_HSIRDYF (0x01U << RCC_CIR_HSIRDYF_Pos) ///< HSI Ready Interrupt flag
  165. #define RCC_CIR_HSERDYF_Pos (3)
  166. #define RCC_CIR_HSERDYF (0x01U << RCC_CIR_HSERDYF_Pos) ///< HSE Ready Interrupt flag
  167. #define RCC_CIR_PLLRDYF_Pos (4)
  168. #define RCC_CIR_PLLRDYF (0x01U << RCC_CIR_PLLRDYF_Pos) ///< PLL Ready Interrupt flag
  169. #define RCC_CIR_CSSF_Pos (7)
  170. #define RCC_CIR_CSSF (0x01U << RCC_CIR_CSSF_Pos) ///< Clock Security System Interrupt flag
  171. #define RCC_CIR_LSIRDYIE_Pos (8)
  172. #define RCC_CIR_LSIRDYIE (0x01U << RCC_CIR_LSIRDYIE_Pos) ///< LSI Ready Interrupt Enable
  173. #define RCC_CIR_LSERDYIE_Pos (9)
  174. #define RCC_CIR_LSERDYIE (0x01U << RCC_CIR_LSERDYIE_Pos) ///< LSE Ready Interrupt Enable
  175. #define RCC_CIR_HSIRDYIE_Pos (10)
  176. #define RCC_CIR_HSIRDYIE (0x01U << RCC_CIR_HSIRDYIE_Pos) ///< HSI Ready Interrupt Enable
  177. #define RCC_CIR_HSERDYIE_Pos (11)
  178. #define RCC_CIR_HSERDYIE (0x01U << RCC_CIR_HSIRDYIE_Pos) ///< HSE Ready Interrupt Enable
  179. #define RCC_CIR_PLLRDYIE_Pos (12)
  180. #define RCC_CIR_PLLRDYIE (0x01U << RCC_CIR_PLLRDYIE_Pos) ///< PLL Ready Interrupt Enable
  181. #define RCC_CIR_LSIRDYC_Pos (16)
  182. #define RCC_CIR_LSIRDYC (0x01U << RCC_CIR_LSIRDYC_Pos) ///< LSI Ready Interrupt Clear
  183. #define RCC_CIR_LSERDYC_Pos (17)
  184. #define RCC_CIR_LSERDYC (0x01U << RCC_CIR_LSERDYC_Pos) ///< LSE Ready Interrupt Clear
  185. #define RCC_CIR_HSIRDYC_Pos (18)
  186. #define RCC_CIR_HSIRDYC (0x01U << RCC_CIR_HSIRDYC_Pos) ///< HSI Ready Interrupt Clear
  187. #define RCC_CIR_HSERDYC_Pos (19)
  188. #define RCC_CIR_HSERDYC (0x01U << RCC_CIR_HSERDYC_Pos) ///< HSE Ready Interrupt Clear
  189. #define RCC_CIR_PLLRDYC_Pos (20)
  190. #define RCC_CIR_PLLRDYC (0x01U << RCC_CIR_PLLRDYC_Pos) ///< PLL Ready Interrupt Clear
  191. #define RCC_CIR_CSSC_Pos (23)
  192. #define RCC_CIR_CSSC (0x01U << RCC_CIR_CSSC_Pos) ///< Clock Security System Interrupt Clear
  193. ////////////////////////////////////////////////////////////////////////////////
  194. /// @brief RCC_APB2RSTR Register Bit Definition
  195. ////////////////////////////////////////////////////////////////////////////////
  196. #define RCC_APB2RSTR_TIM1_Pos (0)
  197. #define RCC_APB2RSTR_TIM1 (0x01U << RCC_APB2RSTR_TIM1_Pos) ///< TIM1 reset
  198. #define RCC_APB2RSTR_TIM8_Pos (1)
  199. #define RCC_APB2RSTR_TIM8 (0x01U << RCC_APB2RSTR_TIM8_Pos) ///< TIM8 reset
  200. #define RCC_APB2RSTR_UART1_Pos (4)
  201. #define RCC_APB2RSTR_UART1 (0x01U << RCC_APB2RSTR_UART1_Pos) ///< UART1 reset
  202. #define RCC_APB2RSTR_UART6_Pos (5)
  203. #define RCC_APB2RSTR_UART6 (0x01U << RCC_APB2RSTR_UART6_Pos) ///< UART6 reset
  204. #define RCC_APB2RSTR_ADC1_Pos (8)
  205. #define RCC_APB2RSTR_ADC1 (0x01U << RCC_APB2RSTR_ADC1_Pos) ///< ADC1 reset
  206. #define RCC_APB2RSTR_ADC2_Pos (9)
  207. #define RCC_APB2RSTR_ADC2 (0x01U << RCC_APB2RSTR_ADC2_Pos) ///< ADC2 reset
  208. #define RCC_APB2RSTR_ADC3_Pos (10)
  209. #define RCC_APB2RSTR_ADC3 (0x01U << RCC_APB2RSTR_ADC3_Pos) ///< ADC3 reset
  210. #define RCC_APB2RSTR_SPI1_Pos (12)
  211. #define RCC_APB2RSTR_SPI1 (0x01U << RCC_APB2RSTR_SPI1_Pos) ///< SPI1 reset
  212. #define RCC_APB2RSTR_SYSCFG_Pos (14)
  213. #define RCC_APB2RSTR_SYSCFG (0x01U << RCC_APB2RSTR_SYSCFG_Pos) ///< SYSCFG reset
  214. #define RCC_APB2RSTR_COMP_Pos (15)
  215. #define RCC_APB2RSTR_COMP (0x01U << RCC_APB2RSTR_COMP_Pos) ///< COMP reset
  216. ////////////////////////////////////////////////////////////////////////////////
  217. /// @brief RCC_AHB3RSTR Register Bit Definition
  218. ////////////////////////////////////////////////////////////////////////////////
  219. #define RCC_AHB3RSTR_FSMC_Pos (0)
  220. #define RCC_AHB3RSTR_FSMC (0x01U << RCC_AHB3RSTR_FSMC_Pos) ///< FSMC reset
  221. ////////////////////////////////////////////////////////////////////////////////
  222. /// @brief RCC_APB1RSTR Register Bit Definition
  223. ////////////////////////////////////////////////////////////////////////////////
  224. #define RCC_APB1RSTR_TIM2_Pos (0)
  225. #define RCC_APB1RSTR_TIM2 (0x01U << RCC_APB1RSTR_TIM2_Pos) ///< Timer 2 reset
  226. #define RCC_APB1RSTR_TIM3_Pos (1)
  227. #define RCC_APB1RSTR_TIM3 (0x01U << RCC_APB1RSTR_TIM3_Pos) ///< Timer 3 reset
  228. #define RCC_APB1RSTR_TIM4_Pos (2)
  229. #define RCC_APB1RSTR_TIM4 (0x01U << RCC_APB1RSTR_TIM4_Pos) ///< Timer 4 reset
  230. #define RCC_APB1RSTR_TIM5_Pos (3)
  231. #define RCC_APB1RSTR_TIM5 (0x01U << RCC_APB1RSTR_TIM5_Pos) ///< Timer 5 reset
  232. #define RCC_APB1RSTR_TIM6_Pos (4)
  233. #define RCC_APB1RSTR_TIM6 (0x01U << RCC_APB1RSTR_TIM6_Pos) ///< Timer 6 reset
  234. #define RCC_APB1RSTR_TIM7_Pos (5)
  235. #define RCC_APB1RSTR_TIM7 (0x01U << RCC_APB1RSTR_TIM7_Pos) ///< Timer 7 reset
  236. #define RCC_APB1RSTR_WWDG_Pos (11)
  237. #define RCC_APB1RSTR_WWDG (0x01U << RCC_APB1RSTR_WWDG_Pos) ///< Window Watchdog reset
  238. #define RCC_APB1RSTR_SPI2_Pos (14)
  239. #define RCC_APB1RSTR_SPI2 (0x01U << RCC_APB1RSTR_SPI2_Pos) ///< SPI 2 reset
  240. #define RCC_APB1RSTR_SPI3_Pos (15)
  241. #define RCC_APB1RSTR_SPI3 (0x01U << RCC_APB1RSTR_SPI3_Pos) ///< SPI 3 reset
  242. #define RCC_APB1RSTR_UART2_Pos (17)
  243. #define RCC_APB1RSTR_UART2 (0x01U << RCC_APB1RSTR_UART2_Pos) ///< UART 2 reset
  244. #define RCC_APB1RSTR_UART3_Pos (18)
  245. #define RCC_APB1RSTR_UART3 (0x01U << RCC_APB1RSTR_UART3_Pos) ///< UART 3 reset
  246. #define RCC_APB1RSTR_UART4_Pos (19)
  247. #define RCC_APB1RSTR_UART4 (0x01U << RCC_APB1RSTR_UART4_Pos) ///< UART 4 reset
  248. #define RCC_APB1RSTR_UART5_Pos (20)
  249. #define RCC_APB1RSTR_UART5 (0x01U << RCC_APB1RSTR_UART5_Pos) ///< UART 5 reset
  250. #define RCC_APB1RSTR_I2C1_Pos (21)
  251. #define RCC_APB1RSTR_I2C1 (0x01U << RCC_APB1RSTR_I2C1_Pos) ///< I2C 1 reset
  252. #define RCC_APB1RSTR_I2C2_Pos (22)
  253. #define RCC_APB1RSTR_I2C2 (0x01U << RCC_APB1RSTR_I2C2_Pos) ///< I2C 2 reset
  254. #define RCC_APB1RSTR_CRS_Pos (24)
  255. #define RCC_APB1RSTR_CRS (0x01U << RCC_APB1RSTR_CRS_Pos) ///< CRS reset
  256. #define RCC_APB1RSTR_CAN_Pos (25)
  257. #define RCC_APB1RSTR_CAN (0x01U << RCC_APB1RSTR_CAN_Pos) ///< CAN reset
  258. #define RCC_APB1RSTR_BKP_Pos (27)
  259. #define RCC_APB1RSTR_BKP (0x01U << RCC_APB1RSTR_BKP_Pos) ///< Backup interface reset
  260. #define RCC_APB1RSTR_PWR_Pos (28)
  261. #define RCC_APB1RSTR_PWR (0x01U << RCC_APB1RSTR_PWR_Pos) ///< Power interface reset
  262. #define RCC_APB1RSTR_DAC_Pos (29)
  263. #define RCC_APB1RSTR_DAC (0x01U << RCC_APB1RSTR_DAC_Pos) ///< DAC interface reset
  264. #define RCC_APB1RSTR_UART7_Pos (30)
  265. #define RCC_APB1RSTR_UART7 (0x01U << RCC_APB1RSTR_UART7_Pos) ///< UART7 reset
  266. #define RCC_APB1RSTR_UART8_Pos (31)
  267. #define RCC_APB1RSTR_UART8 (0x01U << RCC_APB1RSTR_UART8_Pos) ///< UART8 reset
  268. ////////////////////////////////////////////////////////////////////////////////
  269. /// @brief RCC_AHB2RSTR Register Bit Definition
  270. ////////////////////////////////////////////////////////////////////////////////
  271. #define RCC_AHB2RSTR_USBFS_Pos (7)
  272. #define RCC_AHB2RSTR_USBFS (0x01U << RCC_AHB2RSTR_USBFS_Pos) ///< USBFS reset
  273. ////////////////////////////////////////////////////////////////////////////////
  274. /// @brief RCC_AHB3ENR Register Bit Definition
  275. ////////////////////////////////////////////////////////////////////////////////
  276. #define RCC_AHB3ENR_FSMC_Pos (0)
  277. #define RCC_AHB3ENR_FSMC (0x01U << RCC_AHB3ENR_FSMC_Pos) ///< FSMC reset
  278. ////////////////////////////////////////////////////////////////////////////////
  279. /// @brief RCC_AHB2ENR Register Bit Definition
  280. ////////////////////////////////////////////////////////////////////////////////
  281. #define RCC_AHB2ENR_USBFS_Pos (7)
  282. #define RCC_AHB2ENR_USBFS (0x01U << RCC_AHB2ENR_USBFS_Pos) ///< USBFS reset
  283. ////////////////////////////////////////////////////////////////////////////////
  284. /// @brief RCC_AHBENR Register Bit Definition
  285. ////////////////////////////////////////////////////////////////////////////////
  286. #define RCC_AHBENR_GPIOA_Pos (0)
  287. #define RCC_AHBENR_GPIOA (0x01U << RCC_AHBENR_GPIOA_Pos) ///< GPIOA clock enable
  288. #define RCC_AHBENR_GPIOB_Pos (1)
  289. #define RCC_AHBENR_GPIOB (0x01U << RCC_AHBENR_GPIOB_Pos) ///< GPIOB clock enable
  290. #define RCC_AHBENR_GPIOC_Pos (2)
  291. #define RCC_AHBENR_GPIOC (0x01U << RCC_AHBENR_GPIOC_Pos) ///< GPIOC clock enable
  292. #define RCC_AHBENR_GPIOD_Pos (3)
  293. #define RCC_AHBENR_GPIOD (0x01U << RCC_AHBENR_GPIOD_Pos) ///< GPIOD clock enable
  294. #define RCC_AHBENR_GPIOE_Pos (4)
  295. #define RCC_AHBENR_GPIOE (0x01U << RCC_AHBENR_GPIOE_Pos) ///< GPIOE clock enable
  296. #define RCC_AHBENR_GPIOF_Pos (5)
  297. #define RCC_AHBENR_GPIOF (0x01U << RCC_AHBENR_GPIOF_Pos) ///< GPIOF clock enable
  298. #define RCC_AHBENR_GPIOG_Pos (6)
  299. #define RCC_AHBENR_GPIOG (0x01U << RCC_AHBENR_GPIOG_Pos) ///< GPIOG clock enable
  300. #define RCC_AHBENR_GPIOH_Pos (7)
  301. #define RCC_AHBENR_GPIOH (0x01U << RCC_AHBENR_GPIOH_Pos) ///< GPIOH clock enable
  302. #define RCC_AHBENR_SDIO_Pos (10)
  303. #define RCC_AHBENR_SDIO (0x01U << RCC_AHBENR_SDIO_Pos) ///< SDIO clock enable
  304. #define RCC_AHBENR_CRC_Pos (12)
  305. #define RCC_AHBENR_CRC (0x01U << RCC_AHBENR_CRC_Pos) ///< CRC clock enable
  306. #define RCC_AHBENR_FLASH_Pos (13)
  307. #define RCC_AHBENR_FLASH (0x01U << RCC_AHBENR_FLASH_Pos) ///< FLASH clock enable
  308. #define RCC_AHBENR_SRAM_Pos (14)
  309. #define RCC_AHBENR_SRAM (0x01U << RCC_AHBENR_SRAM_Pos) ///< SRAM clock enable
  310. #define RCC_AHBENR_DMA1_Pos (21)
  311. #define RCC_AHBENR_DMA1 (0x01U << RCC_AHBENR_DMA1_Pos) ///< DMA1 clock enable
  312. #define RCC_AHBENR_DMA2_Pos (22)
  313. #define RCC_AHBENR_DMA2 (0x01U << RCC_AHBENR_DMA2_Pos) ///< DMA2 clock enable
  314. #define RCC_AHBENR_ETHMAC_Pos (25)
  315. #define RCC_AHBENR_ETHMAC (0x01U << RCC_AHBENR_ETHMAC_Pos) ///< ETHMAC clock enable
  316. ////////////////////////////////////////////////////////////////////////////////
  317. /// @brief RCC_APB2ENR Register Bit Definition
  318. ////////////////////////////////////////////////////////////////////////////////
  319. #define RCC_APB2ENR_TIM1_Pos (0)
  320. #define RCC_APB2ENR_TIM1 (0x01U << RCC_APB2ENR_TIM1_Pos) ///< TIM1 enable
  321. #define RCC_APB2ENR_TIM8_Pos (1)
  322. #define RCC_APB2ENR_TIM8 (0x01U << RCC_APB2ENR_TIM8_Pos) ///< TIM8 enable
  323. #define RCC_APB2ENR_UART1_Pos (4)
  324. #define RCC_APB2ENR_UART1 (0x01U << RCC_APB2ENR_UART1_Pos) ///< UART1 enable
  325. #define RCC_APB2ENR_UART6_Pos (5)
  326. #define RCC_APB2ENR_UART6 (0x01U << RCC_APB2ENR_UART6_Pos) ///< UART6 enable
  327. #define RCC_APB2ENR_ADC1_Pos (8)
  328. #define RCC_APB2ENR_ADC1 (0x01U << RCC_APB2ENR_ADC1_Pos) ///< ADC1 enable
  329. #define RCC_APB2ENR_ADC2_Pos (9)
  330. #define RCC_APB2ENR_ADC2 (0x01U << RCC_APB2ENR_ADC2_Pos) ///< ADC2 enable
  331. #define RCC_APB2ENR_ADC3_Pos (10)
  332. #define RCC_APB2ENR_ADC3 (0x01U << RCC_APB2ENR_ADC3_Pos) ///< ADC3 enable
  333. #define RCC_APB2ENR_SPI1_Pos (12)
  334. #define RCC_APB2ENR_SPI1 (0x01U << RCC_APB2ENR_SPI1_Pos) ///< SPI1 enable
  335. #define RCC_APB2ENR_EXTI_Pos (14)
  336. #define RCC_APB2ENR_EXTI (0x01U << RCC_APB2ENR_EXTI_Pos) ///< EXTI Block enable
  337. #define RCC_APB2ENR_SYSCFG_Pos (14)
  338. #define RCC_APB2ENR_SYSCFG (0x01U << RCC_APB2ENR_SYSCFG_Pos) ///< SYSCFG enable
  339. #define RCC_APB2ENR_COMP_Pos (15)
  340. #define RCC_APB2ENR_COMP (0x01U << RCC_APB2ENR_COMP_Pos) ///< COMP enable
  341. ////////////////////////////////////////////////////////////////////////////////
  342. /// @brief RCC_APB1ENR Register Bit Definition
  343. ////////////////////////////////////////////////////////////////////////////////
  344. #define RCC_APB1ENR_TIM2_Pos (0)
  345. #define RCC_APB1ENR_TIM2 (0x01U << RCC_APB1ENR_TIM2_Pos) ///< Timer 2 clock enable
  346. #define RCC_APB1ENR_TIM3_Pos (1)
  347. #define RCC_APB1ENR_TIM3 (0x01U << RCC_APB1ENR_TIM3_Pos) ///< Timer 3 clock enabled
  348. #define RCC_APB1ENR_TIM4_Pos (2)
  349. #define RCC_APB1ENR_TIM4 (0x01U << RCC_APB1ENR_TIM4_Pos) ///< Timer 4 clock enable
  350. #define RCC_APB1ENR_TIM5_Pos (3)
  351. #define RCC_APB1ENR_TIM5 (0x01U << RCC_APB1ENR_TIM5_Pos) ///< TIM5 Timer clock enable
  352. #define RCC_APB1ENR_TIM6_Pos (4)
  353. #define RCC_APB1ENR_TIM6 (0x01U << RCC_APB1ENR_TIM6_Pos) ///< TIM6 Timer clock enable
  354. #define RCC_APB1ENR_TIM7_Pos (5)
  355. #define RCC_APB1ENR_TIM7 (0x01U << RCC_APB1ENR_TIM7_Pos) ///< TIM7 Timer clock enable
  356. #define RCC_APB1ENR_WWDG_Pos (11)
  357. #define RCC_APB1ENR_WWDG (0x01U << RCC_APB1ENR_WWDG_Pos) ///< Window Watchdog clock enable
  358. #define RCC_APB1ENR_SPI2_Pos (14)
  359. #define RCC_APB1ENR_SPI2 (0x01U << RCC_APB1ENR_SPI2_Pos) ///< SPI 2 clock enable
  360. #define RCC_APB1ENR_SPI3_Pos (15)
  361. #define RCC_APB1ENR_SPI3 (0x01U << RCC_APB1ENR_SPI3_Pos) ///< SPI 3 clock enable
  362. #define RCC_APB1ENR_UART2_Pos (17)
  363. #define RCC_APB1ENR_UART2 (0x01U << RCC_APB1ENR_UART2_Pos) ///< UART 2 clock enable
  364. #define RCC_APB1ENR_UART3_Pos (18)
  365. #define RCC_APB1ENR_UART3 (0x01U << RCC_APB1ENR_UART3_Pos) ///< UART 3 clock enable
  366. #define RCC_APB1ENR_UART4_Pos (19)
  367. #define RCC_APB1ENR_UART4 (0x01U << RCC_APB1ENR_UART4_Pos) ///< UART 4 clock enable
  368. #define RCC_APB1ENR_UART5_Pos (20)
  369. #define RCC_APB1ENR_UART5 (0x01U << RCC_APB1ENR_UART5_Pos) ///< UART 5 clock enable
  370. #define RCC_APB1ENR_I2C1_Pos (21)
  371. #define RCC_APB1ENR_I2C1 (0x01U << RCC_APB1ENR_I2C1_Pos) ///< I2C 1 clock enable
  372. #define RCC_APB1ENR_I2C2_Pos (22)
  373. #define RCC_APB1ENR_I2C2 (0x01U << RCC_APB1ENR_I2C2_Pos) ///< I2C 2 clock enable
  374. #define RCC_APB1ENR_CRS_Pos (24)
  375. #define RCC_APB1ENR_CRS (0x01U << RCC_APB1ENR_CRS_Pos) ///< CRS 4 clock enable
  376. #define RCC_APB1ENR_CAN_Pos (25)
  377. #define RCC_APB1ENR_CAN (0x01U << RCC_APB1ENR_CAN_Pos) ///< CAN 5 clock enable
  378. #define RCC_APB1ENR_BKP_Pos (27)
  379. #define RCC_APB1ENR_BKP (0x01U << RCC_APB1ENR_BKP_Pos) ///< Backup interface clock enable
  380. #define RCC_APB1ENR_PWR_Pos (28)
  381. #define RCC_APB1ENR_PWR (0x01U << RCC_APB1ENR_PWR_Pos) ///< Power interface clock enable
  382. #define RCC_APB1ENR_DBGMCU_Pos (28)
  383. #define RCC_APB1ENR_DBGMCU (0x01U << RCC_APB1ENR_DBGMCU_Pos) ///< DBGMCU clock enable
  384. #define RCC_APB1ENR_DAC_Pos (29)
  385. #define RCC_APB1ENR_DAC (0x01U << RCC_APB1ENR_DAC_Pos) ///< DAC interface clock enable
  386. #define RCC_APB1ENR_UART7_Pos (30)
  387. #define RCC_APB1ENR_UART7 (0x01U << RCC_APB1ENR_UART7_Pos) ///< UART7 interface clock enable
  388. #define RCC_APB1ENR_UART8_Pos (31)
  389. #define RCC_APB1ENR_UART8 (0x01U << RCC_APB1ENR_UART8_Pos) ///< UART8 interface clock enable
  390. ////////////////////////////////////////////////////////////////////////////////
  391. /// @brief RCC_BDCR Register Bit Definition
  392. ////////////////////////////////////////////////////////////////////////////////
  393. #define RCC_BDCR_LSEON_Pos (0)
  394. #define RCC_BDCR_LSEON (0x01U << RCC_BDCR_LSEON_Pos) ///< External Low Speed oscillator enable
  395. #define RCC_BDCR_LSERDY_Pos (1)
  396. #define RCC_BDCR_LSERDY (0x01U << RCC_BDCR_LSERDY_Pos) ///< External Low Speed oscillator Ready
  397. #define RCC_BDCR_LSEBYP_Pos (2)
  398. #define RCC_BDCR_LSEBYP (0x01U << RCC_BDCR_LSEBYP_Pos) ///< External Low Speed oscillator Bypass
  399. #define RCC_BDCR_RTCSEL_Pos (8)
  400. #define RCC_BDCR_RTCSEL (0x03U << RCC_BDCR_RTCSEL_Pos) ///< RTCSEL[1:0] bits (RTC clock source selection)
  401. #define RCC_BDCR_RTCSEL_LSE (0x01U << RCC_BDCR_RTCSEL_Pos) ///< LSE oscillator clock used as RTC clock
  402. #define RCC_BDCR_RTCSEL_LSI (0x02U << RCC_BDCR_RTCSEL_Pos) ///< LSI oscillator clock used as RTC clock
  403. #define RCC_BDCR_RTCSEL_HSE (0x03U << RCC_BDCR_RTCSEL_Pos) ///< HSE oscillator clock divided by 128 used as RTC clock
  404. #define RCC_BDCR_RTCEN_Pos (15)
  405. #define RCC_BDCR_RTCEN (0x01U << RCC_BDCR_RTCEN_Pos) ///< RTC clock enable
  406. #define RCC_BDCR_BDRST_Pos (16)
  407. #define RCC_BDCR_BDRST (0x01U << RCC_BDCR_BDRST_Pos) ///< Backup domain software reset
  408. #define RCC_BDCR_DBP_Pos (24)
  409. #define RCC_BDCR_DBP (0x01U << RCC_BDCR_DBP_Pos) ///< DBP clock enable
  410. ////////////////////////////////////////////////////////////////////////////////
  411. /// @brief RCC_CSR Register Bit Definition
  412. ////////////////////////////////////////////////////////////////////////////////
  413. #define RCC_CSR_LSION_Pos (0)
  414. #define RCC_CSR_LSION (0x01U << RCC_CSR_LSION_Pos) ///< Internal Low Speed oscillator enable
  415. #define RCC_CSR_LSIRDY_Pos (1)
  416. #define RCC_CSR_LSIRDY (0x01U << RCC_CSR_LSIRDY_Pos) ///< Internal Low Speed oscillator Ready
  417. #define RCC_CSR_LSIOENLV_Pos (5)
  418. #define RCC_CSR_LSIOENLV (0x01U << RCC_CSR_LSIOENLV_Pos) ///< LSI output enable lower voltage
  419. #define RCC_CSR_PVDRSTEN_Pos (6)
  420. #define RCC_CSR_PVDRSTEN (0x01U << RCC_CSR_PVDRSTEN_Pos) ///< PVD reset enable
  421. #define RCC_CSR_LOCKUPEN_Pos (7)
  422. #define RCC_CSR_LOCKUPEN (0x01U << RCC_CSR_LOCKUPEN_Pos) ///< CPU lockup reset enable
  423. #define RCC_CSR_VDTRSTNEN_Pos (8)
  424. #define RCC_CSR_VDTRSTNEN (0x01U << RCC_CSR_VDTRSTNEN_Pos) ///< Voltage detect reset enable
  425. #define RCC_CSR_VDTRSTF_Pos (21)
  426. #define RCC_CSR_VDTRSTF (0x01U << RCC_CSR_VDTRSTF_Pos) ///< Voltage detect reset flag
  427. #define RCC_CSR_PVDRSTF_Pos (22)
  428. #define RCC_CSR_PVDRSTF (0x01U << RCC_CSR_PVDRSTF_Pos) ///< PVD reset flag
  429. #define RCC_CSR_LOCKUPF_Pos (23)
  430. #define RCC_CSR_LOCKUPF (0x01U << RCC_CSR_LOCKUPF_Pos) ///< CPU lockup reset flag
  431. #define RCC_CSR_RMVF_Pos (24)
  432. #define RCC_CSR_RMVF (0x01U << RCC_CSR_RMVF_Pos) ///< Remove reset flag
  433. #define RCC_CSR_PINRSTF_Pos (26)
  434. #define RCC_CSR_PINRSTF (0x01U << RCC_CSR_PINRSTF_Pos) ///< PIN reset flag
  435. #define RCC_CSR_PORRSTF_Pos (27)
  436. #define RCC_CSR_PORRSTF (0x01U << RCC_CSR_PORRSTF_Pos) ///< POR/PDR reset flag
  437. #define RCC_CSR_SFTRSTF_Pos (28)
  438. #define RCC_CSR_SFTRSTF (0x01U << RCC_CSR_SFTRSTF_Pos) ///< Software Reset flag
  439. #define RCC_CSR_IWDGRSTF_Pos (29)
  440. #define RCC_CSR_IWDGRSTF (0x01U << RCC_CSR_IWDGRSTF_Pos) ///< Independent Watchdog reset flag
  441. #define RCC_CSR_WWDGRSTF_Pos (30)
  442. #define RCC_CSR_WWDGRSTF (0x01U << RCC_CSR_WWDGRSTF_Pos) ///< Window watchdog reset flag
  443. ////////////////////////////////////////////////////////////////////////////////
  444. /// @brief RCC_AHBRSTR Register Bit Definition
  445. ////////////////////////////////////////////////////////////////////////////////
  446. #define RCC_AHBRSTR_GPIOA_Pos (0)
  447. #define RCC_AHBRSTR_GPIOA (0x01U << RCC_AHBRSTR_GPIOA_Pos) ///< GPIOA clock reset
  448. #define RCC_AHBRSTR_GPIOB_Pos (1)
  449. #define RCC_AHBRSTR_GPIOB (0x01U << RCC_AHBRSTR_GPIOB_Pos) ///< GPIOB clock reset
  450. #define RCC_AHBRSTR_GPIOC_Pos (2)
  451. #define RCC_AHBRSTR_GPIOC (0x01U << RCC_AHBRSTR_GPIOC_Pos) ///< GPIOC clock reset
  452. #define RCC_AHBRSTR_GPIOD_Pos (3)
  453. #define RCC_AHBRSTR_GPIOD (0x01U << RCC_AHBRSTR_GPIOD_Pos) ///< GPIOD clock reset
  454. #define RCC_AHBRSTR_GPIOE_Pos (4)
  455. #define RCC_AHBRSTR_GPIOE (0x01U << RCC_AHBRSTR_GPIOE_Pos) ///< GPIOE clock reset
  456. #define RCC_AHBRSTR_GPIOF_Pos (5)
  457. #define RCC_AHBRSTR_GPIOF (0x01U << RCC_AHBRSTR_GPIOF_Pos) ///< GPIOF clock reset
  458. #define RCC_AHBRSTR_GPIOG_Pos (6)
  459. #define RCC_AHBRSTR_GPIOG (0x01U << RCC_AHBRSTR_GPIOG_Pos) ///< GPIOG clock reset
  460. #define RCC_AHBRSTR_GPIOH_Pos (7)
  461. #define RCC_AHBRSTR_GPIOH (0x01U << RCC_AHBRSTR_GPIOH_Pos) ///< GPIOH clock reset
  462. #define RCC_AHBRSTR_SDIO_Pos (10)
  463. #define RCC_AHBRSTR_SDIO (0x01U << RCC_AHBRSTR_SDIO_Pos) ///< SDIO clock reset
  464. #define RCC_AHBRSTR_CRC_Pos (12)
  465. #define RCC_AHBRSTR_CRC (0x01U << RCC_AHBRSTR_CRC_Pos) ///< CRC clock reset
  466. #define RCC_AHBRSTR_DMA1_Pos (21)
  467. #define RCC_AHBRSTR_DMA1 (0x01U << RCC_AHBRSTR_DMA1_Pos) ///< DMA1 clock reset
  468. #define RCC_AHBRSTR_DMA2_Pos (22)
  469. #define RCC_AHBRSTR_DMA2 (0x01U << RCC_AHBRSTR_DMA2_Pos) ///< DMA2 clock reset
  470. #define RCC_AHBRSTR_ETHMAC_Pos (25)
  471. #define RCC_AHBRSTR_ETHMAC (0x01U << RCC_AHBRSTR_ETHMAC_Pos) ///< ETHMAC clock reset
  472. ////////////////////////////////////////////////////////////////////////////////
  473. /// @brief RCC_SYSCFG Register Bit Definition
  474. ////////////////////////////////////////////////////////////////////////////////
  475. #define RCC_SYSCFG_PROGCHECKEN_Pos (0)
  476. #define RCC_SYSCFG_PROGCHECKEN (0x01U << RCC_SYSCFG_PROGCHECKEN_Pos) ///< Whether to check the number in Flash when writing to Flash
  477. #define RCC_SYSCFG_SECTOR1KCFG_Pos (1)
  478. #define RCC_SYSCFG_SECTOR1KCFG (0x01U << RCC_SYSCFG_SECTOR1KCFG_Pos) ///< The size of the Flash page when erased.
  479. #define RCC_SYSCFG_DATAPREFETCH_Pos (2)
  480. #define RCC_SYSCFG_DATAPREFETCH (0x01U << RCC_SYSCFG_DATAPREFETCH_Pos) ///< DATA prefetch module enable bit
  481. #define RCC_SYSCFG_PAD_OSC_TRIM_Pos (8)
  482. #define RCC_SYSCFG_PAD_OSC_TRIM (0x1FU << RCC_SYSCFG_PAD_OSC_TRIM_Pos) ///< Calibration value of external crystal vibration
  483. #define RCC_SYSCFG_OSC_LPFEN_Pos (14)
  484. #define RCC_SYSCFG_OSC_LPFEN (0x01U << RCC_SYSCFG_OSC_LPFEN_Pos) ///< External crystal oscillator low pass filtering enables
  485. ////////////////////////////////////////////////////////////////////////////////
  486. /// @brief RCC_CFGR2 Register Bit Definition
  487. ////////////////////////////////////////////////////////////////////////////////
  488. #define RCC_CFGR2_TIMADVCKSEL_Pos (1)
  489. #define RCC_CFGR2_TIMADVCKSEL (0x01U << RCC_CFGR2_TIMADVCKSEL_Pos) ///< TIMADV_CKSEL
  490. #define RCC_CFGR2_TIMADV_PRE_Pos (1) ///<
  491. #define RCC_CFGR2_TIMADV_PRE (0x07U << RCC_CFGR2_TIMADV_PRE_Pos) ///< SYSCLK's advance points are controlled by the software Frequency coefficient
  492. #define RCC_CFGR2_FSMC_PRE_Pos (8)
  493. #define RCC_CFGR2_FSMC_PRE (0x1FU << RCC_CFGR2_FSMC_PRE_Pos) ///< FSMC Output clock frequency division factor
  494. #define RCC_CFGR2_APB1_CLK_HV_PRE_Pos (16)
  495. #define RCC_CFGR2_APB1_CLK_HV_PRE (0x0FU << RCC_CFGR2_APB1_CLK_HV_PRE_Pos) ///< APB1 Output clock frequency division factor
  496. ////////////////////////////////////////////////////////////////////////////////
  497. /// @brief RCC_ICSCR Register Bit Definition
  498. ////////////////////////////////////////////////////////////////////////////////
  499. #define RCC_ICSCR_TIME_CRS_SEL_Pos (0)
  500. #define RCC_ICSCR_TIME_CRS_SEL (0x01U << RCC_ICSCR_TIME_CRS_SEL_Pos) ///< Whether to use the CRS module as source
  501. #define RCC_ICSCR_HSI_CAL_SEL_Pos (11) ///<
  502. #define RCC_ICSCR_HSI_CAL_SEL (0x1FU << RCC_ICSCR_HSI_CAL_SEL_Pos) ///< Select the internal high speed clock calibration value
  503. #define RCC_ICSCR_HSI_CAL_SFT_Pos (16)
  504. #define RCC_ICSCR_HSI_CAL_SFT (0x3FU << RCC_ICSCR_HSI_CAL_SFT_Pos) ///< Internal high-speed clock calibration
  505. ////////////////////////////////////////////////////////////////////////////////
  506. /// @brief RCC_PLLCFGR Register Bit Definition
  507. ////////////////////////////////////////////////////////////////////////////////
  508. #define RCC_PLLCFGR_PLLSRC_Pos (0)
  509. #define RCC_PLLCFGR_PLLSRC (0x01U << RCC_PLLCFGR_PLLSRC_Pos) ///< PLL entry clock source
  510. #define RCC_PLLCFGR_PLLXTPRE_Pos (1) ///<
  511. #define RCC_PLLCFGR_PLLXTPRE (0x01U << RCC_PLLCFGR_PLLXTPRE_Pos) ///< HSE divider for PLL entry
  512. #define RCC_PLLCFGR_PLL_ICTRL_Pos (2)
  513. #define RCC_PLLCFGR_PLL_ICTRL (0x03U << RCC_PLLCFGR_PLL_ICTRL_Pos) ///< PLL CP current control signals
  514. #define RCC_PLLCFGR_PLL_LDS_Pos (4)
  515. #define RCC_PLLCFGR_PLL_LDS (0x03U << RCC_PLLCFGR_PLL_LDS_Pos) ///< PLL lock detector accuracy select
  516. #define RCC_PLLCFGR_PLL_DP_Pos (8) ///<
  517. #define RCC_PLLCFGR_PLL_DP (0x07U << RCC_PLLCFGR_PLL_DP_Pos) ///< PLL divider factor DP
  518. #define RCC_PLLCFGR_PLL_DN_Pos (16)
  519. #define RCC_PLLCFGR_PLL_DN (0x7FU << RCC_PLLCFGR_PLL_DN_Pos) ///< PLL divider factor DN
  520. ////////////////////////////////////////////////////////////////////////////////
  521. /// @brief RCC_HSIDLY Register Bit Definition
  522. ////////////////////////////////////////////////////////////////////////////////
  523. #define RCC_HSIDLY_HSI_EQU_CNT (0xFFU) ///< HSI delay time
  524. ////////////////////////////////////////////////////////////////////////////////
  525. /// @brief RCC_HSEDLY Register Bit Definition
  526. ////////////////////////////////////////////////////////////////////////////////
  527. #define RCC_HSEDLY_HSI_EQU_CNT (0xFFFFU) ///< HSE delay time
  528. ////////////////////////////////////////////////////////////////////////////////
  529. /// @brief RCC_PLLDLY Register Bit Definition
  530. ////////////////////////////////////////////////////////////////////////////////
  531. #define RCC_PLLDLY_HSI_EQU_CNT (0xFFU) ///< PLL delay time
  532. /// @}
  533. /// @}
  534. /// @}
  535. ////////////////////////////////////////////////////////////////////////////////
  536. #endif
  537. ////////////////////////////////////////////////////////////////////////////////