stm32f4xx_rcc.h 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066
  1. /**
  2. ******************************************************************************
  3. * @file stm32f4xx_rcc.h
  4. * @author MCD Application Team
  5. * @version V1.8.0
  6. * @date 04-November-2016
  7. * @brief This file contains all the functions prototypes for the RCC firmware library.
  8. ******************************************************************************
  9. * @attention
  10. *
  11. * <h2><center>&copy; COPYRIGHT 2016 STMicroelectronics</center></h2>
  12. *
  13. * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
  14. * You may not use this file except in compliance with the License.
  15. * You may obtain a copy of the License at:
  16. *
  17. * http://www.st.com/software_license_agreement_liberty_v2
  18. *
  19. * Unless required by applicable law or agreed to in writing, software
  20. * distributed under the License is distributed on an "AS IS" BASIS,
  21. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  22. * See the License for the specific language governing permissions and
  23. * limitations under the License.
  24. *
  25. ******************************************************************************
  26. */
  27. /* Define to prevent recursive inclusion -------------------------------------*/
  28. #ifndef __STM32F4xx_RCC_H
  29. #define __STM32F4xx_RCC_H
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33. /* Includes ------------------------------------------------------------------*/
  34. #include "stm32f4xx.h"
  35. /** @addtogroup STM32F4xx_StdPeriph_Driver
  36. * @{
  37. */
  38. /** @addtogroup RCC
  39. * @{
  40. */
  41. /* Exported types ------------------------------------------------------------*/
  42. typedef struct
  43. {
  44. uint32_t SYSCLK_Frequency; /*!< SYSCLK clock frequency expressed in Hz */
  45. uint32_t HCLK_Frequency; /*!< HCLK clock frequency expressed in Hz */
  46. uint32_t PCLK1_Frequency; /*!< PCLK1 clock frequency expressed in Hz */
  47. uint32_t PCLK2_Frequency; /*!< PCLK2 clock frequency expressed in Hz */
  48. }RCC_ClocksTypeDef;
  49. /* Exported constants --------------------------------------------------------*/
  50. /** @defgroup RCC_Exported_Constants
  51. * @{
  52. */
  53. /** @defgroup RCC_HSE_configuration
  54. * @{
  55. */
  56. #define RCC_HSE_OFF ((uint8_t)0x00)
  57. #define RCC_HSE_ON ((uint8_t)0x01)
  58. #define RCC_HSE_Bypass ((uint8_t)0x05)
  59. #define IS_RCC_HSE(HSE) (((HSE) == RCC_HSE_OFF) || ((HSE) == RCC_HSE_ON) || \
  60. ((HSE) == RCC_HSE_Bypass))
  61. /**
  62. * @}
  63. */
  64. /** @defgroup RCC_LSE_Dual_Mode_Selection
  65. * @{
  66. */
  67. #define RCC_LSE_LOWPOWER_MODE ((uint8_t)0x00)
  68. #define RCC_LSE_HIGHDRIVE_MODE ((uint8_t)0x01)
  69. #define IS_RCC_LSE_MODE(MODE) (((MODE) == RCC_LSE_LOWPOWER_MODE) || \
  70. ((MODE) == RCC_LSE_HIGHDRIVE_MODE))
  71. /**
  72. * @}
  73. */
  74. /** @defgroup RCC_PLLSAIDivR_Factor
  75. * @{
  76. */
  77. #define RCC_PLLSAIDivR_Div2 ((uint32_t)0x00000000)
  78. #define RCC_PLLSAIDivR_Div4 ((uint32_t)0x00010000)
  79. #define RCC_PLLSAIDivR_Div8 ((uint32_t)0x00020000)
  80. #define RCC_PLLSAIDivR_Div16 ((uint32_t)0x00030000)
  81. #define IS_RCC_PLLSAI_DIVR_VALUE(VALUE) (((VALUE) == RCC_PLLSAIDivR_Div2) ||\
  82. ((VALUE) == RCC_PLLSAIDivR_Div4) ||\
  83. ((VALUE) == RCC_PLLSAIDivR_Div8) ||\
  84. ((VALUE) == RCC_PLLSAIDivR_Div16))
  85. /**
  86. * @}
  87. */
  88. /** @defgroup RCC_PLL_Clock_Source
  89. * @{
  90. */
  91. #define RCC_PLLSource_HSI ((uint32_t)0x00000000)
  92. #define RCC_PLLSource_HSE ((uint32_t)0x00400000)
  93. #define IS_RCC_PLL_SOURCE(SOURCE) (((SOURCE) == RCC_PLLSource_HSI) || \
  94. ((SOURCE) == RCC_PLLSource_HSE))
  95. #define IS_RCC_PLLM_VALUE(VALUE) ((VALUE) <= 63)
  96. #define IS_RCC_PLLN_VALUE(VALUE) ((50 <= (VALUE)) && ((VALUE) <= 432))
  97. #define IS_RCC_PLLP_VALUE(VALUE) (((VALUE) == 2) || ((VALUE) == 4) || ((VALUE) == 6) || ((VALUE) == 8))
  98. #define IS_RCC_PLLQ_VALUE(VALUE) ((4 <= (VALUE)) && ((VALUE) <= 15))
  99. #if defined(STM32F410xx) || defined(STM32F412xG) || defined(STM32F413_423xx) || defined(STM32F446xx) || defined(STM32F469_479xx)
  100. #define IS_RCC_PLLR_VALUE(VALUE) ((2 <= (VALUE)) && ((VALUE) <= 7))
  101. #endif /* STM32F410xx || STM32F412xG || STM32F413_423xx || STM32F446xx || STM32F469_479xx */
  102. #define IS_RCC_PLLI2SN_VALUE(VALUE) ((50 <= (VALUE)) && ((VALUE) <= 432))
  103. #define IS_RCC_PLLI2SR_VALUE(VALUE) ((2 <= (VALUE)) && ((VALUE) <= 7))
  104. #define IS_RCC_PLLI2SM_VALUE(VALUE) ((2 <= (VALUE)) && ((VALUE) <= 63))
  105. #define IS_RCC_PLLI2SQ_VALUE(VALUE) ((2 <= (VALUE)) && ((VALUE) <= 15))
  106. #if defined(STM32F446xx)
  107. #define IS_RCC_PLLI2SP_VALUE(VALUE) (((VALUE) == 2) || ((VALUE) == 4) || ((VALUE) == 6) || ((VALUE) == 8))
  108. #define IS_RCC_PLLSAIM_VALUE(VALUE) ((VALUE) <= 63)
  109. #elif defined(STM32F412xG) || defined(STM32F413_423xx)
  110. #define IS_RCC_PLLI2SP_VALUE(VALUE) (((VALUE) == 2) || ((VALUE) == 4) || ((VALUE) == 6) || ((VALUE) == 8))
  111. #else
  112. #endif /* STM32F446xx */
  113. #define IS_RCC_PLLSAIN_VALUE(VALUE) ((50 <= (VALUE)) && ((VALUE) <= 432))
  114. #if defined(STM32F446xx) || defined(STM32F469_479xx)
  115. #define IS_RCC_PLLSAIP_VALUE(VALUE) (((VALUE) == 2) || ((VALUE) == 4) || ((VALUE) == 6) || ((VALUE) == 8))
  116. #endif /* STM32F446xx || STM32F469_479xx */
  117. #define IS_RCC_PLLSAIQ_VALUE(VALUE) ((2 <= (VALUE)) && ((VALUE) <= 15))
  118. #define IS_RCC_PLLSAIR_VALUE(VALUE) ((2 <= (VALUE)) && ((VALUE) <= 7))
  119. #define IS_RCC_PLLSAI_DIVQ_VALUE(VALUE) ((1 <= (VALUE)) && ((VALUE) <= 32))
  120. #define IS_RCC_PLLI2S_DIVQ_VALUE(VALUE) ((1 <= (VALUE)) && ((VALUE) <= 32))
  121. #if defined(STM32F413_423xx)
  122. #define IS_RCC_PLLI2S_DIVR_VALUE(VALUE) ((1 <= (VALUE)) && ((VALUE) <= 32))
  123. #define IS_RCC_PLL_DIVR_VALUE(VALUE) ((1 <= (VALUE)) && ((VALUE) <= 32))
  124. #endif /* STM32F413_423xx */
  125. /**
  126. * @}
  127. */
  128. /** @defgroup RCC_System_Clock_Source
  129. * @{
  130. */
  131. #if defined(STM32F412xG) || defined(STM32F413_423xx) || defined(STM32F446xx)
  132. #define RCC_SYSCLKSource_HSI ((uint32_t)0x00000000)
  133. #define RCC_SYSCLKSource_HSE ((uint32_t)0x00000001)
  134. #define RCC_SYSCLKSource_PLLPCLK ((uint32_t)0x00000002)
  135. #define RCC_SYSCLKSource_PLLRCLK ((uint32_t)0x00000003)
  136. #define IS_RCC_SYSCLK_SOURCE(SOURCE) (((SOURCE) == RCC_SYSCLKSource_HSI) || \
  137. ((SOURCE) == RCC_SYSCLKSource_HSE) || \
  138. ((SOURCE) == RCC_SYSCLKSource_PLLPCLK) || \
  139. ((SOURCE) == RCC_SYSCLKSource_PLLRCLK))
  140. /* Add legacy definition */
  141. #define RCC_SYSCLKSource_PLLCLK RCC_SYSCLKSource_PLLPCLK
  142. #endif /* STM32F446xx */
  143. #if defined(STM32F40_41xxx) || defined(STM32F427_437xx) || defined(STM32F429_439xx) || defined(STM32F401xx) || defined(STM32F410xx) || defined(STM32F411xE) || defined(STM32F469_479xx)
  144. #define RCC_SYSCLKSource_HSI ((uint32_t)0x00000000)
  145. #define RCC_SYSCLKSource_HSE ((uint32_t)0x00000001)
  146. #define RCC_SYSCLKSource_PLLCLK ((uint32_t)0x00000002)
  147. #define IS_RCC_SYSCLK_SOURCE(SOURCE) (((SOURCE) == RCC_SYSCLKSource_HSI) || \
  148. ((SOURCE) == RCC_SYSCLKSource_HSE) || \
  149. ((SOURCE) == RCC_SYSCLKSource_PLLCLK))
  150. #endif /* STM32F40_41xxx || STM32F427_437xx || STM32F429_439xx || STM32F401xx || STM32F410xx || STM32F411xE || STM32F469_479xx */
  151. /**
  152. * @}
  153. */
  154. /** @defgroup RCC_AHB_Clock_Source
  155. * @{
  156. */
  157. #define RCC_SYSCLK_Div1 ((uint32_t)0x00000000)
  158. #define RCC_SYSCLK_Div2 ((uint32_t)0x00000080)
  159. #define RCC_SYSCLK_Div4 ((uint32_t)0x00000090)
  160. #define RCC_SYSCLK_Div8 ((uint32_t)0x000000A0)
  161. #define RCC_SYSCLK_Div16 ((uint32_t)0x000000B0)
  162. #define RCC_SYSCLK_Div64 ((uint32_t)0x000000C0)
  163. #define RCC_SYSCLK_Div128 ((uint32_t)0x000000D0)
  164. #define RCC_SYSCLK_Div256 ((uint32_t)0x000000E0)
  165. #define RCC_SYSCLK_Div512 ((uint32_t)0x000000F0)
  166. #define IS_RCC_HCLK(HCLK) (((HCLK) == RCC_SYSCLK_Div1) || ((HCLK) == RCC_SYSCLK_Div2) || \
  167. ((HCLK) == RCC_SYSCLK_Div4) || ((HCLK) == RCC_SYSCLK_Div8) || \
  168. ((HCLK) == RCC_SYSCLK_Div16) || ((HCLK) == RCC_SYSCLK_Div64) || \
  169. ((HCLK) == RCC_SYSCLK_Div128) || ((HCLK) == RCC_SYSCLK_Div256) || \
  170. ((HCLK) == RCC_SYSCLK_Div512))
  171. /**
  172. * @}
  173. */
  174. /** @defgroup RCC_APB1_APB2_Clock_Source
  175. * @{
  176. */
  177. #define RCC_HCLK_Div1 ((uint32_t)0x00000000)
  178. #define RCC_HCLK_Div2 ((uint32_t)0x00001000)
  179. #define RCC_HCLK_Div4 ((uint32_t)0x00001400)
  180. #define RCC_HCLK_Div8 ((uint32_t)0x00001800)
  181. #define RCC_HCLK_Div16 ((uint32_t)0x00001C00)
  182. #define IS_RCC_PCLK(PCLK) (((PCLK) == RCC_HCLK_Div1) || ((PCLK) == RCC_HCLK_Div2) || \
  183. ((PCLK) == RCC_HCLK_Div4) || ((PCLK) == RCC_HCLK_Div8) || \
  184. ((PCLK) == RCC_HCLK_Div16))
  185. /**
  186. * @}
  187. */
  188. /** @defgroup RCC_Interrupt_Source
  189. * @{
  190. */
  191. #define RCC_IT_LSIRDY ((uint8_t)0x01)
  192. #define RCC_IT_LSERDY ((uint8_t)0x02)
  193. #define RCC_IT_HSIRDY ((uint8_t)0x04)
  194. #define RCC_IT_HSERDY ((uint8_t)0x08)
  195. #define RCC_IT_PLLRDY ((uint8_t)0x10)
  196. #define RCC_IT_PLLI2SRDY ((uint8_t)0x20)
  197. #define RCC_IT_PLLSAIRDY ((uint8_t)0x40)
  198. #define RCC_IT_CSS ((uint8_t)0x80)
  199. #define IS_RCC_IT(IT) ((((IT) & (uint8_t)0x80) == 0x00) && ((IT) != 0x00))
  200. #define IS_RCC_GET_IT(IT) (((IT) == RCC_IT_LSIRDY) || ((IT) == RCC_IT_LSERDY) || \
  201. ((IT) == RCC_IT_HSIRDY) || ((IT) == RCC_IT_HSERDY) || \
  202. ((IT) == RCC_IT_PLLRDY) || ((IT) == RCC_IT_CSS) || \
  203. ((IT) == RCC_IT_PLLSAIRDY) || ((IT) == RCC_IT_PLLI2SRDY))
  204. #define IS_RCC_CLEAR_IT(IT)((IT) != 0x00)
  205. /**
  206. * @}
  207. */
  208. /** @defgroup RCC_LSE_Configuration
  209. * @{
  210. */
  211. #define RCC_LSE_OFF ((uint8_t)0x00)
  212. #define RCC_LSE_ON ((uint8_t)0x01)
  213. #define RCC_LSE_Bypass ((uint8_t)0x04)
  214. #define IS_RCC_LSE(LSE) (((LSE) == RCC_LSE_OFF) || ((LSE) == RCC_LSE_ON) || \
  215. ((LSE) == RCC_LSE_Bypass))
  216. /**
  217. * @}
  218. */
  219. /** @defgroup RCC_RTC_Clock_Source
  220. * @{
  221. */
  222. #define RCC_RTCCLKSource_LSE ((uint32_t)0x00000100)
  223. #define RCC_RTCCLKSource_LSI ((uint32_t)0x00000200)
  224. #define RCC_RTCCLKSource_HSE_Div2 ((uint32_t)0x00020300)
  225. #define RCC_RTCCLKSource_HSE_Div3 ((uint32_t)0x00030300)
  226. #define RCC_RTCCLKSource_HSE_Div4 ((uint32_t)0x00040300)
  227. #define RCC_RTCCLKSource_HSE_Div5 ((uint32_t)0x00050300)
  228. #define RCC_RTCCLKSource_HSE_Div6 ((uint32_t)0x00060300)
  229. #define RCC_RTCCLKSource_HSE_Div7 ((uint32_t)0x00070300)
  230. #define RCC_RTCCLKSource_HSE_Div8 ((uint32_t)0x00080300)
  231. #define RCC_RTCCLKSource_HSE_Div9 ((uint32_t)0x00090300)
  232. #define RCC_RTCCLKSource_HSE_Div10 ((uint32_t)0x000A0300)
  233. #define RCC_RTCCLKSource_HSE_Div11 ((uint32_t)0x000B0300)
  234. #define RCC_RTCCLKSource_HSE_Div12 ((uint32_t)0x000C0300)
  235. #define RCC_RTCCLKSource_HSE_Div13 ((uint32_t)0x000D0300)
  236. #define RCC_RTCCLKSource_HSE_Div14 ((uint32_t)0x000E0300)
  237. #define RCC_RTCCLKSource_HSE_Div15 ((uint32_t)0x000F0300)
  238. #define RCC_RTCCLKSource_HSE_Div16 ((uint32_t)0x00100300)
  239. #define RCC_RTCCLKSource_HSE_Div17 ((uint32_t)0x00110300)
  240. #define RCC_RTCCLKSource_HSE_Div18 ((uint32_t)0x00120300)
  241. #define RCC_RTCCLKSource_HSE_Div19 ((uint32_t)0x00130300)
  242. #define RCC_RTCCLKSource_HSE_Div20 ((uint32_t)0x00140300)
  243. #define RCC_RTCCLKSource_HSE_Div21 ((uint32_t)0x00150300)
  244. #define RCC_RTCCLKSource_HSE_Div22 ((uint32_t)0x00160300)
  245. #define RCC_RTCCLKSource_HSE_Div23 ((uint32_t)0x00170300)
  246. #define RCC_RTCCLKSource_HSE_Div24 ((uint32_t)0x00180300)
  247. #define RCC_RTCCLKSource_HSE_Div25 ((uint32_t)0x00190300)
  248. #define RCC_RTCCLKSource_HSE_Div26 ((uint32_t)0x001A0300)
  249. #define RCC_RTCCLKSource_HSE_Div27 ((uint32_t)0x001B0300)
  250. #define RCC_RTCCLKSource_HSE_Div28 ((uint32_t)0x001C0300)
  251. #define RCC_RTCCLKSource_HSE_Div29 ((uint32_t)0x001D0300)
  252. #define RCC_RTCCLKSource_HSE_Div30 ((uint32_t)0x001E0300)
  253. #define RCC_RTCCLKSource_HSE_Div31 ((uint32_t)0x001F0300)
  254. #define IS_RCC_RTCCLK_SOURCE(SOURCE) (((SOURCE) == RCC_RTCCLKSource_LSE) || \
  255. ((SOURCE) == RCC_RTCCLKSource_LSI) || \
  256. ((SOURCE) == RCC_RTCCLKSource_HSE_Div2) || \
  257. ((SOURCE) == RCC_RTCCLKSource_HSE_Div3) || \
  258. ((SOURCE) == RCC_RTCCLKSource_HSE_Div4) || \
  259. ((SOURCE) == RCC_RTCCLKSource_HSE_Div5) || \
  260. ((SOURCE) == RCC_RTCCLKSource_HSE_Div6) || \
  261. ((SOURCE) == RCC_RTCCLKSource_HSE_Div7) || \
  262. ((SOURCE) == RCC_RTCCLKSource_HSE_Div8) || \
  263. ((SOURCE) == RCC_RTCCLKSource_HSE_Div9) || \
  264. ((SOURCE) == RCC_RTCCLKSource_HSE_Div10) || \
  265. ((SOURCE) == RCC_RTCCLKSource_HSE_Div11) || \
  266. ((SOURCE) == RCC_RTCCLKSource_HSE_Div12) || \
  267. ((SOURCE) == RCC_RTCCLKSource_HSE_Div13) || \
  268. ((SOURCE) == RCC_RTCCLKSource_HSE_Div14) || \
  269. ((SOURCE) == RCC_RTCCLKSource_HSE_Div15) || \
  270. ((SOURCE) == RCC_RTCCLKSource_HSE_Div16) || \
  271. ((SOURCE) == RCC_RTCCLKSource_HSE_Div17) || \
  272. ((SOURCE) == RCC_RTCCLKSource_HSE_Div18) || \
  273. ((SOURCE) == RCC_RTCCLKSource_HSE_Div19) || \
  274. ((SOURCE) == RCC_RTCCLKSource_HSE_Div20) || \
  275. ((SOURCE) == RCC_RTCCLKSource_HSE_Div21) || \
  276. ((SOURCE) == RCC_RTCCLKSource_HSE_Div22) || \
  277. ((SOURCE) == RCC_RTCCLKSource_HSE_Div23) || \
  278. ((SOURCE) == RCC_RTCCLKSource_HSE_Div24) || \
  279. ((SOURCE) == RCC_RTCCLKSource_HSE_Div25) || \
  280. ((SOURCE) == RCC_RTCCLKSource_HSE_Div26) || \
  281. ((SOURCE) == RCC_RTCCLKSource_HSE_Div27) || \
  282. ((SOURCE) == RCC_RTCCLKSource_HSE_Div28) || \
  283. ((SOURCE) == RCC_RTCCLKSource_HSE_Div29) || \
  284. ((SOURCE) == RCC_RTCCLKSource_HSE_Div30) || \
  285. ((SOURCE) == RCC_RTCCLKSource_HSE_Div31))
  286. /**
  287. * @}
  288. */
  289. #if defined(STM32F410xx) || defined(STM32F413_423xx)
  290. /** @defgroup RCCEx_LPTIM1_Clock_Source RCC LPTIM1 Clock Source
  291. * @{
  292. */
  293. #define RCC_LPTIM1CLKSOURCE_PCLK ((uint32_t)0x00000000)
  294. #define RCC_LPTIM1CLKSOURCE_HSI ((uint32_t)RCC_DCKCFGR2_LPTIM1SEL_0)
  295. #define RCC_LPTIM1CLKSOURCE_LSI ((uint32_t)RCC_DCKCFGR2_LPTIM1SEL_1)
  296. #define RCC_LPTIM1CLKSOURCE_LSE ((uint32_t)RCC_DCKCFGR2_LPTIM1SEL_0 | RCC_DCKCFGR2_LPTIM1SEL_1)
  297. #define IS_RCC_LPTIM1_CLOCKSOURCE(SOURCE) (((SOURCE) == RCC_LPTIM1CLKSOURCE_PCLK) || ((SOURCE) == RCC_LPTIM1CLKSOURCE_HSI) || \
  298. ((SOURCE) == RCC_LPTIM1CLKSOURCE_LSI) || ((SOURCE) == RCC_LPTIM1CLKSOURCE_LSE))
  299. /* Legacy Defines */
  300. #define IS_RCC_LPTIM1_SOURCE IS_RCC_LPTIM1_CLOCKSOURCE
  301. #if defined(STM32F410xx)
  302. /**
  303. * @}
  304. */
  305. /** @defgroup RCCEx_I2S_APB_Clock_Source RCC I2S APB Clock Source
  306. * @{
  307. */
  308. #define RCC_I2SAPBCLKSOURCE_PLLR ((uint32_t)0x00000000)
  309. #define RCC_I2SAPBCLKSOURCE_EXT ((uint32_t)RCC_DCKCFGR_I2SSRC_0)
  310. #define RCC_I2SAPBCLKSOURCE_PLLSRC ((uint32_t)RCC_DCKCFGR_I2SSRC_1)
  311. #define IS_RCC_I2SCLK_SOURCE(SOURCE) (((SOURCE) == RCC_I2SAPBCLKSOURCE_PLLR) || ((SOURCE) == RCC_I2SAPBCLKSOURCE_EXT) || \
  312. ((SOURCE) == RCC_I2SAPBCLKSOURCE_PLLSRC))
  313. /**
  314. * @}
  315. */
  316. #endif /* STM32F413_423xx */
  317. #endif /* STM32F410xx || STM32F413_423xx */
  318. #if defined(STM32F412xG) || defined(STM32F413_423xx) || defined(STM32F446xx)
  319. /** @defgroup RCC_I2S_Clock_Source
  320. * @{
  321. */
  322. #define RCC_I2SCLKSource_PLLI2S ((uint32_t)0x00)
  323. #define RCC_I2SCLKSource_Ext ((uint32_t)RCC_DCKCFGR_I2S1SRC_0)
  324. #define RCC_I2SCLKSource_PLL ((uint32_t)RCC_DCKCFGR_I2S1SRC_1)
  325. #define RCC_I2SCLKSource_HSI_HSE ((uint32_t)RCC_DCKCFGR_I2S1SRC_0 | RCC_DCKCFGR_I2S1SRC_1)
  326. #define IS_RCC_I2SCLK_SOURCE(SOURCE) (((SOURCE) == RCC_I2SCLKSource_PLLI2S) || ((SOURCE) == RCC_I2SCLKSource_Ext) || \
  327. ((SOURCE) == RCC_I2SCLKSource_PLL) || ((SOURCE) == RCC_I2SCLKSource_HSI_HSE))
  328. /**
  329. * @}
  330. */
  331. /** @defgroup RCC_I2S_APBBus
  332. * @{
  333. */
  334. #define RCC_I2SBus_APB1 ((uint8_t)0x00)
  335. #define RCC_I2SBus_APB2 ((uint8_t)0x01)
  336. #define IS_RCC_I2S_APBx(BUS) (((BUS) == RCC_I2SBus_APB1) || ((BUS) == RCC_I2SBus_APB2))
  337. /**
  338. * @}
  339. */
  340. #if defined(STM32F446xx)
  341. /** @defgroup RCC_SAI_Clock_Source
  342. * @{
  343. */
  344. #define RCC_SAICLKSource_PLLSAI ((uint32_t)0x00)
  345. #define RCC_SAICLKSource_PLLI2S ((uint32_t)RCC_DCKCFGR_SAI1SRC_0)
  346. #define RCC_SAICLKSource_PLL ((uint32_t)RCC_DCKCFGR_SAI1SRC_1)
  347. #define RCC_SAICLKSource_HSI_HSE ((uint32_t)RCC_DCKCFGR_SAI1SRC_0 | RCC_DCKCFGR_SAI1SRC_1)
  348. #define IS_RCC_SAICLK_SOURCE(SOURCE) (((SOURCE) == RCC_SAICLKSource_PLLSAI) || ((SOURCE) == RCC_SAICLKSource_PLLI2S) || \
  349. ((SOURCE) == RCC_SAICLKSource_PLL) || ((SOURCE) == RCC_SAICLKSource_HSI_HSE))
  350. /**
  351. * @}
  352. */
  353. /** @defgroup RCC_SAI_Instance
  354. * @{
  355. */
  356. #define RCC_SAIInstance_SAI1 ((uint8_t)0x00)
  357. #define RCC_SAIInstance_SAI2 ((uint8_t)0x01)
  358. #define IS_RCC_SAI_INSTANCE(BUS) (((BUS) == RCC_SAIInstance_SAI1) || ((BUS) == RCC_SAIInstance_SAI2))
  359. /**
  360. * @}
  361. */
  362. #endif /* STM32F446xx */
  363. #if defined(STM32F413_423xx)
  364. /** @defgroup RCC_SAI_BlockA_Clock_Source
  365. * @{
  366. */
  367. #define RCC_SAIACLKSource_PLLI2S_R ((uint32_t)0x00000000)
  368. #define RCC_SAIACLKSource_I2SCKIN ((uint32_t)RCC_DCKCFGR_SAI1ASRC_0)
  369. #define RCC_SAIACLKSource_PLLR ((uint32_t)RCC_DCKCFGR_SAI1ASRC_1)
  370. #define RCC_SAIACLKSource_HSI_HSE ((uint32_t)RCC_DCKCFGR_SAI1ASRC_0 | RCC_DCKCFGR_SAI1ASRC_1)
  371. #define IS_RCC_SAIACLK_SOURCE(SOURCE) (((SOURCE) == RCC_SAIACLKSource_PLLI2S_R) || ((SOURCE) == RCC_SAIACLKSource_I2SCKIN) || \
  372. ((SOURCE) == RCC_SAIACLKSource_PLLR) || ((SOURCE) == RCC_SAIACLKSource_HSI_HSE))
  373. /**
  374. * @}
  375. */
  376. /** @defgroup RCC_SAI_BlockB_Clock_Source
  377. * @{
  378. */
  379. #define RCC_SAIBCLKSource_PLLI2S_R ((uint32_t)0x00000000)
  380. #define RCC_SAIBCLKSource_I2SCKIN ((uint32_t)RCC_DCKCFGR_SAI1BSRC_0)
  381. #define RCC_SAIBCLKSource_PLLR ((uint32_t)RCC_DCKCFGR_SAI1BSRC_1)
  382. #define RCC_SAIBCLKSource_HSI_HSE ((uint32_t)RCC_DCKCFGR_SAI1BSRC_0 | RCC_DCKCFGR_SAI1BSRC_1)
  383. #define IS_RCC_SAIBCLK_SOURCE(SOURCE) (((SOURCE) == RCC_SAIBCLKSource_PLLI2S_R) || ((SOURCE) == RCC_SAIBCLKSource_I2SCKIN) || \
  384. ((SOURCE) == RCC_SAIBCLKSource_PLLR) || ((SOURCE) == RCC_SAIBCLKSource_HSI_HSE))
  385. /**
  386. * @}
  387. */
  388. #endif /* STM32F413_423xx */
  389. #endif /* STM32F412xG || STM32F413_423xx || STM32F446xx */
  390. #if defined(STM32F40_41xxx) || defined(STM32F427_437xx) || defined(STM32F429_439xx) || defined(STM32F401xx) || defined(STM32F411xE) || defined(STM32F469_479xx)
  391. /** @defgroup RCC_I2S_Clock_Source
  392. * @{
  393. */
  394. #define RCC_I2S2CLKSource_PLLI2S ((uint8_t)0x00)
  395. #define RCC_I2S2CLKSource_Ext ((uint8_t)0x01)
  396. #define IS_RCC_I2SCLK_SOURCE(SOURCE) (((SOURCE) == RCC_I2S2CLKSource_PLLI2S) || ((SOURCE) == RCC_I2S2CLKSource_Ext))
  397. /**
  398. * @}
  399. */
  400. /** @defgroup RCC_SAI_BlockA_Clock_Source
  401. * @{
  402. */
  403. #define RCC_SAIACLKSource_PLLSAI ((uint32_t)0x00000000)
  404. #define RCC_SAIACLKSource_PLLI2S ((uint32_t)0x00100000)
  405. #define RCC_SAIACLKSource_Ext ((uint32_t)0x00200000)
  406. #define IS_RCC_SAIACLK_SOURCE(SOURCE) (((SOURCE) == RCC_SAIACLKSource_PLLI2S) ||\
  407. ((SOURCE) == RCC_SAIACLKSource_PLLSAI) ||\
  408. ((SOURCE) == RCC_SAIACLKSource_Ext))
  409. /**
  410. * @}
  411. */
  412. /** @defgroup RCC_SAI_BlockB_Clock_Source
  413. * @{
  414. */
  415. #define RCC_SAIBCLKSource_PLLSAI ((uint32_t)0x00000000)
  416. #define RCC_SAIBCLKSource_PLLI2S ((uint32_t)0x00400000)
  417. #define RCC_SAIBCLKSource_Ext ((uint32_t)0x00800000)
  418. #define IS_RCC_SAIBCLK_SOURCE(SOURCE) (((SOURCE) == RCC_SAIBCLKSource_PLLI2S) ||\
  419. ((SOURCE) == RCC_SAIBCLKSource_PLLSAI) ||\
  420. ((SOURCE) == RCC_SAIBCLKSource_Ext))
  421. /**
  422. * @}
  423. */
  424. #endif /* STM32F40_41xxx || STM32F427_437xx || STM32F429_439xx || STM32F401xx || STM32F411xE || STM32F469_479xx */
  425. /** @defgroup RCC_TIM_PRescaler_Selection
  426. * @{
  427. */
  428. #define RCC_TIMPrescDesactivated ((uint8_t)0x00)
  429. #define RCC_TIMPrescActivated ((uint8_t)0x01)
  430. #define IS_RCC_TIMCLK_PRESCALER(VALUE) (((VALUE) == RCC_TIMPrescDesactivated) || ((VALUE) == RCC_TIMPrescActivated))
  431. /**
  432. * @}
  433. */
  434. #if defined(STM32F469_479xx)
  435. /** @defgroup RCC_DSI_Clock_Source_Selection
  436. * @{
  437. */
  438. #define RCC_DSICLKSource_PHY ((uint8_t)0x00)
  439. #define RCC_DSICLKSource_PLLR ((uint8_t)0x01)
  440. #define IS_RCC_DSI_CLOCKSOURCE(CLKSOURCE) (((CLKSOURCE) == RCC_DSICLKSource_PHY) || \
  441. ((CLKSOURCE) == RCC_DSICLKSource_PLLR))
  442. /**
  443. * @}
  444. */
  445. #endif /* STM32F469_479xx */
  446. #if defined(STM32F412xG) || defined(STM32F413_423xx) || defined(STM32F446xx) || defined(STM32F469_479xx)
  447. /** @defgroup RCC_SDIO_Clock_Source_Selection
  448. * @{
  449. */
  450. #define RCC_SDIOCLKSource_48MHZ ((uint8_t)0x00)
  451. #define RCC_SDIOCLKSource_SYSCLK ((uint8_t)0x01)
  452. #define IS_RCC_SDIO_CLOCKSOURCE(CLKSOURCE) (((CLKSOURCE) == RCC_SDIOCLKSource_48MHZ) || \
  453. ((CLKSOURCE) == RCC_SDIOCLKSource_SYSCLK))
  454. /**
  455. * @}
  456. */
  457. /** @defgroup RCC_48MHZ_Clock_Source_Selection
  458. * @{
  459. */
  460. #if defined(STM32F446xx) || defined(STM32F469_479xx)
  461. #define RCC_48MHZCLKSource_PLL ((uint8_t)0x00)
  462. #define RCC_48MHZCLKSource_PLLSAI ((uint8_t)0x01)
  463. #define IS_RCC_48MHZ_CLOCKSOURCE(CLKSOURCE) (((CLKSOURCE) == RCC_48MHZCLKSource_PLL) || \
  464. ((CLKSOURCE) == RCC_48MHZCLKSource_PLLSAI))
  465. #endif /* STM32F446xx || STM32F469_479xx */
  466. #if defined(STM32F412xG) || defined(STM32F413_423xx)
  467. #define RCC_CK48CLKSOURCE_PLLQ ((uint8_t)0x00)
  468. #define RCC_CK48CLKSOURCE_PLLI2SQ ((uint8_t)0x01) /* Only for STM32F412xG and STM32F413_423xx Devices */
  469. #define IS_RCC_48MHZ_CLOCKSOURCE(CLKSOURCE) (((CLKSOURCE) == RCC_CK48CLKSOURCE_PLLQ) || \
  470. ((CLKSOURCE) == RCC_CK48CLKSOURCE_PLLI2SQ))
  471. #endif /* STM32F412xG || STM32F413_423xx */
  472. /**
  473. * @}
  474. */
  475. #endif /* STM32F412xG || STM32F413_423xx || STM32F446xx || STM32F469_479xx */
  476. #if defined(STM32F446xx)
  477. /** @defgroup RCC_SPDIFRX_Clock_Source_Selection
  478. * @{
  479. */
  480. #define RCC_SPDIFRXCLKSource_PLLR ((uint8_t)0x00)
  481. #define RCC_SPDIFRXCLKSource_PLLI2SP ((uint8_t)0x01)
  482. #define IS_RCC_SPDIFRX_CLOCKSOURCE(CLKSOURCE) (((CLKSOURCE) == RCC_SPDIFRXCLKSource_PLLR) || \
  483. ((CLKSOURCE) == RCC_SPDIFRXCLKSource_PLLI2SP))
  484. /**
  485. * @}
  486. */
  487. /** @defgroup RCC_CEC_Clock_Source_Selection
  488. * @{
  489. */
  490. #define RCC_CECCLKSource_HSIDiv488 ((uint8_t)0x00)
  491. #define RCC_CECCLKSource_LSE ((uint8_t)0x01)
  492. #define IS_RCC_CEC_CLOCKSOURCE(CLKSOURCE) (((CLKSOURCE) == RCC_CECCLKSource_HSIDiv488) || \
  493. ((CLKSOURCE) == RCC_CECCLKSource_LSE))
  494. /**
  495. * @}
  496. */
  497. /** @defgroup RCC_AHB1_ClockGating
  498. * @{
  499. */
  500. #define RCC_AHB1ClockGating_APB1Bridge ((uint32_t)0x00000001)
  501. #define RCC_AHB1ClockGating_APB2Bridge ((uint32_t)0x00000002)
  502. #define RCC_AHB1ClockGating_CM4DBG ((uint32_t)0x00000004)
  503. #define RCC_AHB1ClockGating_SPARE ((uint32_t)0x00000008)
  504. #define RCC_AHB1ClockGating_SRAM ((uint32_t)0x00000010)
  505. #define RCC_AHB1ClockGating_FLITF ((uint32_t)0x00000020)
  506. #define RCC_AHB1ClockGating_RCC ((uint32_t)0x00000040)
  507. #define IS_RCC_AHB1_CLOCKGATING(PERIPH) ((((PERIPH) & 0xFFFFFF80) == 0x00) && ((PERIPH) != 0x00))
  508. /**
  509. * @}
  510. */
  511. #endif /* STM32F446xx */
  512. #if defined(STM32F410xx) || defined(STM32F412xG) || defined(STM32F413_423xx) || defined(STM32F446xx)
  513. /** @defgroup RCC_FMPI2C1_Clock_Source
  514. * @{
  515. */
  516. #define RCC_FMPI2C1CLKSource_APB1 ((uint32_t)0x00)
  517. #define RCC_FMPI2C1CLKSource_SYSCLK ((uint32_t)RCC_DCKCFGR2_FMPI2C1SEL_0)
  518. #define RCC_FMPI2C1CLKSource_HSI ((uint32_t)RCC_DCKCFGR2_FMPI2C1SEL_1)
  519. #define IS_RCC_FMPI2C1_CLOCKSOURCE(SOURCE) (((SOURCE) == RCC_FMPI2C1CLKSource_APB1) || ((SOURCE) == RCC_FMPI2C1CLKSource_SYSCLK) || \
  520. ((SOURCE) == RCC_FMPI2C1CLKSource_HSI))
  521. /**
  522. * @}
  523. */
  524. #endif /* STM32F410xx || STM32F412xG || STM32F413_423xx || STM32F446xx */
  525. #if defined(STM32F412xG) || defined(STM32F413_423xx)
  526. /** @defgroup RCC_DFSDM_Clock_Source
  527. * @{
  528. */
  529. #define RCC_DFSDMCLKSource_APB ((uint8_t)0x00)
  530. #define RCC_DFSDMCLKSource_SYS ((uint8_t)0x01)
  531. #define IS_RCC_DFSDMCLK_SOURCE(SOURCE) (((SOURCE) == RCC_DFSDMCLKSource_APB) || ((SOURCE) == RCC_DFSDMCLKSource_SYS))
  532. /* Legacy Defines */
  533. #define RCC_DFSDM1CLKSource_APB RCC_DFSDMCLKSource_APB
  534. #define RCC_DFSDM1CLKSource_SYS RCC_DFSDMCLKSource_SYS
  535. #define IS_RCC_DFSDM1CLK_SOURCE IS_RCC_DFSDMCLK_SOURCE
  536. /**
  537. * @}
  538. */
  539. /** @defgroup RCC_DFSDM_Audio_Clock_Source RCC DFSDM Audio Clock Source
  540. * @{
  541. */
  542. #define RCC_DFSDM1AUDIOCLKSOURCE_I2SAPB1 ((uint32_t)0x00000000)
  543. #define RCC_DFSDM1AUDIOCLKSOURCE_I2SAPB2 ((uint32_t)RCC_DCKCFGR_CKDFSDM1ASEL)
  544. #define IS_RCC_DFSDM1ACLK_SOURCE(SOURCE) (((SOURCE) == RCC_DFSDM1AUDIOCLKSOURCE_I2SAPB1) || ((SOURCE) == RCC_DFSDM1AUDIOCLKSOURCE_I2SAPB2))
  545. /* Legacy Defines */
  546. #define IS_RCC_DFSDMACLK_SOURCE IS_RCC_DFSDM1ACLK_SOURCE
  547. /**
  548. * @}
  549. */
  550. #if defined(STM32F413_423xx)
  551. /** @defgroup RCC_DFSDM_Audio_Clock_Source RCC DFSDM Audio Clock Source
  552. * @{
  553. */
  554. #define RCC_DFSDM2AUDIOCLKSOURCE_I2SAPB1 ((uint32_t)0x00000000)
  555. #define RCC_DFSDM2AUDIOCLKSOURCE_I2SAPB2 ((uint32_t)RCC_DCKCFGR_CKDFSDM2ASEL)
  556. #define IS_RCC_DFSDM2ACLK_SOURCE(SOURCE) (((SOURCE) == RCC_DFSDM2AUDIOCLKSOURCE_I2SAPB1) || ((SOURCE) == RCC_DFSDM2AUDIOCLKSOURCE_I2SAPB2))
  557. /**
  558. * @}
  559. */
  560. #endif /* STM32F413_423xx */
  561. #endif /* STM32F412xG || STM32F413_423xx */
  562. /** @defgroup RCC_AHB1_Peripherals
  563. * @{
  564. */
  565. #define RCC_AHB1Periph_GPIOA ((uint32_t)0x00000001)
  566. #define RCC_AHB1Periph_GPIOB ((uint32_t)0x00000002)
  567. #define RCC_AHB1Periph_GPIOC ((uint32_t)0x00000004)
  568. #define RCC_AHB1Periph_GPIOD ((uint32_t)0x00000008)
  569. #define RCC_AHB1Periph_GPIOE ((uint32_t)0x00000010)
  570. #define RCC_AHB1Periph_GPIOF ((uint32_t)0x00000020)
  571. #define RCC_AHB1Periph_GPIOG ((uint32_t)0x00000040)
  572. #define RCC_AHB1Periph_GPIOH ((uint32_t)0x00000080)
  573. #define RCC_AHB1Periph_GPIOI ((uint32_t)0x00000100)
  574. #define RCC_AHB1Periph_GPIOJ ((uint32_t)0x00000200)
  575. #define RCC_AHB1Periph_GPIOK ((uint32_t)0x00000400)
  576. #define RCC_AHB1Periph_CRC ((uint32_t)0x00001000)
  577. #define RCC_AHB1Periph_FLITF ((uint32_t)0x00008000)
  578. #define RCC_AHB1Periph_SRAM1 ((uint32_t)0x00010000)
  579. #define RCC_AHB1Periph_SRAM2 ((uint32_t)0x00020000)
  580. #define RCC_AHB1Periph_BKPSRAM ((uint32_t)0x00040000)
  581. #define RCC_AHB1Periph_SRAM3 ((uint32_t)0x00080000)
  582. #define RCC_AHB1Periph_CCMDATARAMEN ((uint32_t)0x00100000)
  583. #define RCC_AHB1Periph_DMA1 ((uint32_t)0x00200000)
  584. #define RCC_AHB1Periph_DMA2 ((uint32_t)0x00400000)
  585. #define RCC_AHB1Periph_DMA2D ((uint32_t)0x00800000)
  586. #define RCC_AHB1Periph_ETH_MAC ((uint32_t)0x02000000)
  587. #define RCC_AHB1Periph_ETH_MAC_Tx ((uint32_t)0x04000000)
  588. #define RCC_AHB1Periph_ETH_MAC_Rx ((uint32_t)0x08000000)
  589. #define RCC_AHB1Periph_ETH_MAC_PTP ((uint32_t)0x10000000)
  590. #define RCC_AHB1Periph_OTG_HS ((uint32_t)0x20000000)
  591. #define RCC_AHB1Periph_OTG_HS_ULPI ((uint32_t)0x40000000)
  592. #if defined(STM32F410xx)
  593. #define RCC_AHB1Periph_RNG ((uint32_t)0x80000000)
  594. #endif /* STM32F410xx */
  595. #define IS_RCC_AHB1_CLOCK_PERIPH(PERIPH) ((((PERIPH) & 0x010BE800) == 0x00) && ((PERIPH) != 0x00))
  596. #define IS_RCC_AHB1_RESET_PERIPH(PERIPH) ((((PERIPH) & 0x51FE800) == 0x00) && ((PERIPH) != 0x00))
  597. #define IS_RCC_AHB1_LPMODE_PERIPH(PERIPH) ((((PERIPH) & 0x01106800) == 0x00) && ((PERIPH) != 0x00))
  598. /**
  599. * @}
  600. */
  601. /** @defgroup RCC_AHB2_Peripherals
  602. * @{
  603. */
  604. #define RCC_AHB2Periph_DCMI ((uint32_t)0x00000001)
  605. #define RCC_AHB2Periph_CRYP ((uint32_t)0x00000010)
  606. #define RCC_AHB2Periph_HASH ((uint32_t)0x00000020)
  607. #if defined(STM32F40_41xxx) || defined(STM32F412xG) || defined(STM32F413_423xx) || defined(STM32F427_437xx) || defined(STM32F429_439xx) || defined(STM32F469_479xx)
  608. #define RCC_AHB2Periph_RNG ((uint32_t)0x00000040)
  609. #endif /* STM32F40_41xxx || STM32F427_437xx || STM32F429_439xx || STM32F469_479xx */
  610. #define RCC_AHB2Periph_OTG_FS ((uint32_t)0x00000080)
  611. #define IS_RCC_AHB2_PERIPH(PERIPH) ((((PERIPH) & 0xFFFFFF0E) == 0x00) && ((PERIPH) != 0x00))
  612. /**
  613. * @}
  614. */
  615. /** @defgroup RCC_AHB3_Peripherals
  616. * @{
  617. */
  618. #if defined(STM32F40_41xxx)
  619. #define RCC_AHB3Periph_FSMC ((uint32_t)0x00000001)
  620. #define IS_RCC_AHB3_PERIPH(PERIPH) ((((PERIPH) & 0xFFFFFFFE) == 0x00) && ((PERIPH) != 0x00))
  621. #endif /* STM32F40_41xxx */
  622. #if defined(STM32F427_437xx) || defined(STM32F429_439xx)
  623. #define RCC_AHB3Periph_FMC ((uint32_t)0x00000001)
  624. #define IS_RCC_AHB3_PERIPH(PERIPH) ((((PERIPH) & 0xFFFFFFFE) == 0x00) && ((PERIPH) != 0x00))
  625. #endif /* STM32F427_437xx || STM32F429_439xx */
  626. #if defined(STM32F446xx) || defined(STM32F469_479xx)
  627. #define RCC_AHB3Periph_FMC ((uint32_t)0x00000001)
  628. #define RCC_AHB3Periph_QSPI ((uint32_t)0x00000002)
  629. #define IS_RCC_AHB3_PERIPH(PERIPH) ((((PERIPH) & 0xFFFFFFFC) == 0x00) && ((PERIPH) != 0x00))
  630. #endif /* STM32F446xx || STM32F469_479xx */
  631. #if defined(STM32F412xG) || defined(STM32F413_423xx)
  632. #define RCC_AHB3Periph_FSMC ((uint32_t)0x00000001)
  633. #define RCC_AHB3Periph_QSPI ((uint32_t)0x00000002)
  634. #define IS_RCC_AHB3_PERIPH(PERIPH) ((((PERIPH) & 0xFFFFFFFC) == 0x00) && ((PERIPH) != 0x00))
  635. #endif /* STM32F412xG || STM32F413_423xx */
  636. /**
  637. * @}
  638. */
  639. /** @defgroup RCC_APB1_Peripherals
  640. * @{
  641. */
  642. #define RCC_APB1Periph_TIM2 ((uint32_t)0x00000001)
  643. #define RCC_APB1Periph_TIM3 ((uint32_t)0x00000002)
  644. #define RCC_APB1Periph_TIM4 ((uint32_t)0x00000004)
  645. #define RCC_APB1Periph_TIM5 ((uint32_t)0x00000008)
  646. #define RCC_APB1Periph_TIM6 ((uint32_t)0x00000010)
  647. #define RCC_APB1Periph_TIM7 ((uint32_t)0x00000020)
  648. #define RCC_APB1Periph_TIM12 ((uint32_t)0x00000040)
  649. #define RCC_APB1Periph_TIM13 ((uint32_t)0x00000080)
  650. #define RCC_APB1Periph_TIM14 ((uint32_t)0x00000100)
  651. #if defined(STM32F410xx) || defined(STM32F413_423xx)
  652. #define RCC_APB1Periph_LPTIM1 ((uint32_t)0x00000200)
  653. #endif /* STM32F410xx || STM32F413_423xx */
  654. #define RCC_APB1Periph_WWDG ((uint32_t)0x00000800)
  655. #define RCC_APB1Periph_SPI2 ((uint32_t)0x00004000)
  656. #define RCC_APB1Periph_SPI3 ((uint32_t)0x00008000)
  657. #if defined(STM32F446xx)
  658. #define RCC_APB1Periph_SPDIFRX ((uint32_t)0x00010000)
  659. #endif /* STM32F446xx */
  660. #define RCC_APB1Periph_USART2 ((uint32_t)0x00020000)
  661. #define RCC_APB1Periph_USART3 ((uint32_t)0x00040000)
  662. #define RCC_APB1Periph_UART4 ((uint32_t)0x00080000)
  663. #define RCC_APB1Periph_UART5 ((uint32_t)0x00100000)
  664. #define RCC_APB1Periph_I2C1 ((uint32_t)0x00200000)
  665. #define RCC_APB1Periph_I2C2 ((uint32_t)0x00400000)
  666. #define RCC_APB1Periph_I2C3 ((uint32_t)0x00800000)
  667. #if defined(STM32F410xx) || defined(STM32F412xG) || defined(STM32F413_423xx) || defined(STM32F446xx)
  668. #define RCC_APB1Periph_FMPI2C1 ((uint32_t)0x01000000)
  669. #endif /* STM32F410xx || STM32F446xx || STM32F413_423xx*/
  670. #define RCC_APB1Periph_CAN1 ((uint32_t)0x02000000)
  671. #define RCC_APB1Periph_CAN2 ((uint32_t)0x04000000)
  672. #if defined(STM32F413_423xx)
  673. #define RCC_APB1Periph_CAN3 ((uint32_t)0x08000000)
  674. #endif /* STM32F413_423xx */
  675. #if defined(STM32F446xx)
  676. #define RCC_APB1Periph_CEC ((uint32_t)0x08000000)
  677. #endif /* STM32F446xx */
  678. #define RCC_APB1Periph_PWR ((uint32_t)0x10000000)
  679. #define RCC_APB1Periph_DAC ((uint32_t)0x20000000)
  680. #define RCC_APB1Periph_UART7 ((uint32_t)0x40000000)
  681. #define RCC_APB1Periph_UART8 ((uint32_t)0x80000000)
  682. #define IS_RCC_APB1_PERIPH(PERIPH) ((((PERIPH) & 0x00003600) == 0x00) && ((PERIPH) != 0x00))
  683. /**
  684. * @}
  685. */
  686. /** @defgroup RCC_APB2_Peripherals
  687. * @{
  688. */
  689. #define RCC_APB2Periph_TIM1 ((uint32_t)0x00000001)
  690. #define RCC_APB2Periph_TIM8 ((uint32_t)0x00000002)
  691. #define RCC_APB2Periph_USART1 ((uint32_t)0x00000010)
  692. #define RCC_APB2Periph_USART6 ((uint32_t)0x00000020)
  693. #define RCC_APB2Periph_ADC ((uint32_t)0x00000100)
  694. #define RCC_APB2Periph_ADC1 ((uint32_t)0x00000100)
  695. #define RCC_APB2Periph_ADC2 ((uint32_t)0x00000200)
  696. #define RCC_APB2Periph_ADC3 ((uint32_t)0x00000400)
  697. #define RCC_APB2Periph_SDIO ((uint32_t)0x00000800)
  698. #define RCC_APB2Periph_SPI1 ((uint32_t)0x00001000)
  699. #define RCC_APB2Periph_SPI4 ((uint32_t)0x00002000)
  700. #define RCC_APB2Periph_SYSCFG ((uint32_t)0x00004000)
  701. #define RCC_APB2Periph_EXTIT ((uint32_t)0x00008000)
  702. #define RCC_APB2Periph_TIM9 ((uint32_t)0x00010000)
  703. #define RCC_APB2Periph_TIM10 ((uint32_t)0x00020000)
  704. #define RCC_APB2Periph_TIM11 ((uint32_t)0x00040000)
  705. #define RCC_APB2Periph_SPI5 ((uint32_t)0x00100000)
  706. #define RCC_APB2Periph_SPI6 ((uint32_t)0x00200000)
  707. #define RCC_APB2Periph_SAI1 ((uint32_t)0x00400000)
  708. #if defined(STM32F446xx) || defined(STM32F469_479xx)
  709. #define RCC_APB2Periph_SAI2 ((uint32_t)0x00800000)
  710. #endif /* STM32F446xx || STM32F469_479xx */
  711. #define RCC_APB2Periph_LTDC ((uint32_t)0x04000000)
  712. #if defined(STM32F469_479xx)
  713. #define RCC_APB2Periph_DSI ((uint32_t)0x08000000)
  714. #endif /* STM32F469_479xx */
  715. #if defined(STM32F412xG) || defined(STM32F413_423xx)
  716. #define RCC_APB2Periph_DFSDM1 ((uint32_t)0x01000000)
  717. #endif /* STM32F412xG || STM32F413_423xx */
  718. #if defined(STM32F413_423xx)
  719. #define RCC_APB2Periph_DFSDM2 ((uint32_t)0x02000000)
  720. #define RCC_APB2Periph_UART9 ((uint32_t)0x02000040)
  721. #define RCC_APB2Periph_UART10 ((uint32_t)0x00000080)
  722. #endif /* STM32F413_423xx */
  723. /* Legacy Defines */
  724. #define RCC_APB2Periph_DFSDM RCC_APB2Periph_DFSDM1
  725. #define IS_RCC_APB2_PERIPH(PERIPH) ((((PERIPH) & 0xF008000C) == 0x00) && ((PERIPH) != 0x00))
  726. #define IS_RCC_APB2_RESET_PERIPH(PERIPH) ((((PERIPH) & 0xF208860C) == 0x00) && ((PERIPH) != 0x00))
  727. /**
  728. * @}
  729. */
  730. /** @defgroup RCC_MCO1_Clock_Source_Prescaler
  731. * @{
  732. */
  733. #define RCC_MCO1Source_HSI ((uint32_t)0x00000000)
  734. #define RCC_MCO1Source_LSE ((uint32_t)0x00200000)
  735. #define RCC_MCO1Source_HSE ((uint32_t)0x00400000)
  736. #define RCC_MCO1Source_PLLCLK ((uint32_t)0x00600000)
  737. #define RCC_MCO1Div_1 ((uint32_t)0x00000000)
  738. #define RCC_MCO1Div_2 ((uint32_t)0x04000000)
  739. #define RCC_MCO1Div_3 ((uint32_t)0x05000000)
  740. #define RCC_MCO1Div_4 ((uint32_t)0x06000000)
  741. #define RCC_MCO1Div_5 ((uint32_t)0x07000000)
  742. #define IS_RCC_MCO1SOURCE(SOURCE) (((SOURCE) == RCC_MCO1Source_HSI) || ((SOURCE) == RCC_MCO1Source_LSE) || \
  743. ((SOURCE) == RCC_MCO1Source_HSE) || ((SOURCE) == RCC_MCO1Source_PLLCLK))
  744. #define IS_RCC_MCO1DIV(DIV) (((DIV) == RCC_MCO1Div_1) || ((DIV) == RCC_MCO1Div_2) || \
  745. ((DIV) == RCC_MCO1Div_3) || ((DIV) == RCC_MCO1Div_4) || \
  746. ((DIV) == RCC_MCO1Div_5))
  747. /**
  748. * @}
  749. */
  750. /** @defgroup RCC_MCO2_Clock_Source_Prescaler
  751. * @{
  752. */
  753. #define RCC_MCO2Source_SYSCLK ((uint32_t)0x00000000)
  754. #define RCC_MCO2Source_PLLI2SCLK ((uint32_t)0x40000000)
  755. #define RCC_MCO2Source_HSE ((uint32_t)0x80000000)
  756. #define RCC_MCO2Source_PLLCLK ((uint32_t)0xC0000000)
  757. #define RCC_MCO2Div_1 ((uint32_t)0x00000000)
  758. #define RCC_MCO2Div_2 ((uint32_t)0x20000000)
  759. #define RCC_MCO2Div_3 ((uint32_t)0x28000000)
  760. #define RCC_MCO2Div_4 ((uint32_t)0x30000000)
  761. #define RCC_MCO2Div_5 ((uint32_t)0x38000000)
  762. #define IS_RCC_MCO2SOURCE(SOURCE) (((SOURCE) == RCC_MCO2Source_SYSCLK) || ((SOURCE) == RCC_MCO2Source_PLLI2SCLK)|| \
  763. ((SOURCE) == RCC_MCO2Source_HSE) || ((SOURCE) == RCC_MCO2Source_PLLCLK))
  764. #define IS_RCC_MCO2DIV(DIV) (((DIV) == RCC_MCO2Div_1) || ((DIV) == RCC_MCO2Div_2) || \
  765. ((DIV) == RCC_MCO2Div_3) || ((DIV) == RCC_MCO2Div_4) || \
  766. ((DIV) == RCC_MCO2Div_5))
  767. /**
  768. * @}
  769. */
  770. /** @defgroup RCC_Flag
  771. * @{
  772. */
  773. #define RCC_FLAG_HSIRDY ((uint8_t)0x21)
  774. #define RCC_FLAG_HSERDY ((uint8_t)0x31)
  775. #define RCC_FLAG_PLLRDY ((uint8_t)0x39)
  776. #define RCC_FLAG_PLLI2SRDY ((uint8_t)0x3B)
  777. #define RCC_FLAG_PLLSAIRDY ((uint8_t)0x3D)
  778. #define RCC_FLAG_LSERDY ((uint8_t)0x41)
  779. #define RCC_FLAG_LSIRDY ((uint8_t)0x61)
  780. #define RCC_FLAG_BORRST ((uint8_t)0x79)
  781. #define RCC_FLAG_PINRST ((uint8_t)0x7A)
  782. #define RCC_FLAG_PORRST ((uint8_t)0x7B)
  783. #define RCC_FLAG_SFTRST ((uint8_t)0x7C)
  784. #define RCC_FLAG_IWDGRST ((uint8_t)0x7D)
  785. #define RCC_FLAG_WWDGRST ((uint8_t)0x7E)
  786. #define RCC_FLAG_LPWRRST ((uint8_t)0x7F)
  787. #define IS_RCC_FLAG(FLAG) (((FLAG) == RCC_FLAG_HSIRDY) || ((FLAG) == RCC_FLAG_HSERDY) || \
  788. ((FLAG) == RCC_FLAG_PLLRDY) || ((FLAG) == RCC_FLAG_LSERDY) || \
  789. ((FLAG) == RCC_FLAG_LSIRDY) || ((FLAG) == RCC_FLAG_BORRST) || \
  790. ((FLAG) == RCC_FLAG_PINRST) || ((FLAG) == RCC_FLAG_PORRST) || \
  791. ((FLAG) == RCC_FLAG_SFTRST) || ((FLAG) == RCC_FLAG_IWDGRST)|| \
  792. ((FLAG) == RCC_FLAG_WWDGRST) || ((FLAG) == RCC_FLAG_LPWRRST)|| \
  793. ((FLAG) == RCC_FLAG_PLLI2SRDY)|| ((FLAG) == RCC_FLAG_PLLSAIRDY))
  794. #define IS_RCC_CALIBRATION_VALUE(VALUE) ((VALUE) <= 0x1F)
  795. /**
  796. * @}
  797. */
  798. /**
  799. * @}
  800. */
  801. /* Exported macro ------------------------------------------------------------*/
  802. /* Exported functions --------------------------------------------------------*/
  803. /* Function used to set the RCC clock configuration to the default reset state */
  804. void RCC_DeInit(void);
  805. /* Internal/external clocks, PLL, CSS and MCO configuration functions *********/
  806. void RCC_HSEConfig(uint8_t RCC_HSE);
  807. ErrorStatus RCC_WaitForHSEStartUp(void);
  808. void RCC_AdjustHSICalibrationValue(uint8_t HSICalibrationValue);
  809. void RCC_HSICmd(FunctionalState NewState);
  810. void RCC_LSEConfig(uint8_t RCC_LSE);
  811. void RCC_LSICmd(FunctionalState NewState);
  812. void RCC_PLLCmd(FunctionalState NewState);
  813. #if defined(STM32F410xx) || defined(STM32F412xG) || defined(STM32F413_423xx) || defined(STM32F446xx) || defined(STM32F469_479xx)
  814. void RCC_PLLConfig(uint32_t RCC_PLLSource, uint32_t PLLM, uint32_t PLLN, uint32_t PLLP, uint32_t PLLQ, uint32_t PLLR);
  815. #endif /* STM32F410xx || STM32F412xG || STM32F413_423xx || STM32F446xx || STM32F469_479xx */
  816. #if defined(STM32F40_41xxx) || defined(STM32F427_437xx) || defined(STM32F429_439xx) || defined(STM32F401xx) || defined(STM32F411xE)
  817. void RCC_PLLConfig(uint32_t RCC_PLLSource, uint32_t PLLM, uint32_t PLLN, uint32_t PLLP, uint32_t PLLQ);
  818. #endif /* STM32F40_41xxx || STM32F427_437xx || STM32F429_439xx || STM32F401xx || STM32F411xE */
  819. void RCC_PLLI2SCmd(FunctionalState NewState);
  820. #if defined(STM32F40_41xxx) || defined(STM32F401xx)
  821. void RCC_PLLI2SConfig(uint32_t PLLI2SN, uint32_t PLLI2SR);
  822. #endif /* STM32F40_41xxx || STM32F401xx */
  823. #if defined(STM32F411xE)
  824. void RCC_PLLI2SConfig(uint32_t PLLI2SN, uint32_t PLLI2SR, uint32_t PLLI2SM);
  825. #endif /* STM32F411xE */
  826. #if defined(STM32F427_437xx) || defined(STM32F429_439xx) || defined(STM32F469_479xx)
  827. void RCC_PLLI2SConfig(uint32_t PLLI2SN, uint32_t PLLI2SQ, uint32_t PLLI2SR);
  828. #endif /* STM32F427_437xx || STM32F429_439xx || STM32F469_479xx */
  829. #if defined(STM32F412xG) || defined(STM32F413_423xx) || defined(STM32F446xx)
  830. void RCC_PLLI2SConfig(uint32_t PLLI2SM, uint32_t PLLI2SN, uint32_t PLLI2SP, uint32_t PLLI2SQ, uint32_t PLLI2SR);
  831. #endif /* STM32F412xG || STM32F413_423xx || STM32F446xx */
  832. void RCC_PLLSAICmd(FunctionalState NewState);
  833. #if defined(STM32F469_479xx)
  834. void RCC_PLLSAIConfig(uint32_t PLLSAIN, uint32_t PLLSAIP, uint32_t PLLSAIQ, uint32_t PLLSAIR);
  835. #endif /* STM32F469_479xx */
  836. #if defined(STM32F446xx)
  837. void RCC_PLLSAIConfig(uint32_t PLLSAIM, uint32_t PLLSAIN, uint32_t PLLSAIP, uint32_t PLLSAIQ);
  838. #endif /* STM32F446xx */
  839. #if defined(STM32F40_41xxx) || defined(STM32F427_437xx) || defined(STM32F429_439xx) || defined(STM32F401xx) || defined(STM32F411xE)
  840. void RCC_PLLSAIConfig(uint32_t PLLSAIN, uint32_t PLLSAIQ, uint32_t PLLSAIR);
  841. #endif /* STM32F40_41xxx || STM32F427_437xx || STM32F429_439xx || STM32F401xx || STM32F411xE */
  842. void RCC_ClockSecuritySystemCmd(FunctionalState NewState);
  843. void RCC_MCO1Config(uint32_t RCC_MCO1Source, uint32_t RCC_MCO1Div);
  844. void RCC_MCO2Config(uint32_t RCC_MCO2Source, uint32_t RCC_MCO2Div);
  845. /* System, AHB and APB busses clocks configuration functions ******************/
  846. void RCC_SYSCLKConfig(uint32_t RCC_SYSCLKSource);
  847. uint8_t RCC_GetSYSCLKSource(void);
  848. void RCC_HCLKConfig(uint32_t RCC_SYSCLK);
  849. void RCC_PCLK1Config(uint32_t RCC_HCLK);
  850. void RCC_PCLK2Config(uint32_t RCC_HCLK);
  851. void RCC_GetClocksFreq(RCC_ClocksTypeDef* RCC_Clocks);
  852. /* Peripheral clocks configuration functions **********************************/
  853. void RCC_RTCCLKConfig(uint32_t RCC_RTCCLKSource);
  854. void RCC_RTCCLKCmd(FunctionalState NewState);
  855. void RCC_BackupResetCmd(FunctionalState NewState);
  856. #if defined(STM32F412xG) || defined(STM32F413_423xx) || defined(STM32F446xx)
  857. void RCC_I2SCLKConfig(uint32_t RCC_I2SAPBx, uint32_t RCC_I2SCLKSource);
  858. #if defined(STM32F446xx)
  859. void RCC_SAICLKConfig(uint32_t RCC_SAIInstance, uint32_t RCC_SAICLKSource);
  860. #endif /* STM32F446xx */
  861. #if defined(STM32F413_423xx)
  862. void RCC_SAIBlockACLKConfig(uint32_t RCC_SAIBlockACLKSource);
  863. void RCC_SAIBlockBCLKConfig(uint32_t RCC_SAIBlockBCLKSource);
  864. #endif /* STM32F413_423xx */
  865. #endif /* STM32F412xG || STM32F413_423xx || STM32F446xx */
  866. #if defined(STM32F40_41xxx) || defined(STM32F427_437xx) || defined(STM32F429_439xx) || defined(STM32F401xx) || defined(STM32F410xx) || defined(STM32F411xE) || defined(STM32F469_479xx)
  867. void RCC_I2SCLKConfig(uint32_t RCC_I2SCLKSource);
  868. #endif /* STM32F40_41xxx || STM32F427_437xx || STM32F429_439xx || STM32F401xx || STM32F410xx || STM32F411xE || STM32F469_479xx */
  869. #if defined(STM32F40_41xxx) || defined(STM32F427_437xx) || defined(STM32F429_439xx) || defined(STM32F469_479xx)
  870. void RCC_SAIBlockACLKConfig(uint32_t RCC_SAIBlockACLKSource);
  871. void RCC_SAIBlockBCLKConfig(uint32_t RCC_SAIBlockBCLKSource);
  872. #endif /* STM32F40_41xxx || STM32F427_437xx || STM32F429_439xx || STM32F469_479xx */
  873. void RCC_SAIPLLI2SClkDivConfig(uint32_t RCC_PLLI2SDivQ);
  874. void RCC_SAIPLLSAIClkDivConfig(uint32_t RCC_PLLSAIDivQ);
  875. #if defined(STM32F413_423xx)
  876. void RCC_SAIPLLI2SRClkDivConfig(uint32_t RCC_PLLI2SDivR);
  877. void RCC_SAIPLLRClkDivConfig(uint32_t RCC_PLLDivR);
  878. #endif /* STM32F413_423xx */
  879. void RCC_LTDCCLKDivConfig(uint32_t RCC_PLLSAIDivR);
  880. void RCC_TIMCLKPresConfig(uint32_t RCC_TIMCLKPrescaler);
  881. void RCC_AHB1PeriphClockCmd(uint32_t RCC_AHB1Periph, FunctionalState NewState);
  882. void RCC_AHB2PeriphClockCmd(uint32_t RCC_AHB2Periph, FunctionalState NewState);
  883. void RCC_AHB3PeriphClockCmd(uint32_t RCC_AHB3Periph, FunctionalState NewState);
  884. void RCC_APB1PeriphClockCmd(uint32_t RCC_APB1Periph, FunctionalState NewState);
  885. void RCC_APB2PeriphClockCmd(uint32_t RCC_APB2Periph, FunctionalState NewState);
  886. void RCC_AHB1PeriphResetCmd(uint32_t RCC_AHB1Periph, FunctionalState NewState);
  887. void RCC_AHB2PeriphResetCmd(uint32_t RCC_AHB2Periph, FunctionalState NewState);
  888. void RCC_AHB3PeriphResetCmd(uint32_t RCC_AHB3Periph, FunctionalState NewState);
  889. void RCC_APB1PeriphResetCmd(uint32_t RCC_APB1Periph, FunctionalState NewState);
  890. void RCC_APB2PeriphResetCmd(uint32_t RCC_APB2Periph, FunctionalState NewState);
  891. void RCC_AHB1PeriphClockLPModeCmd(uint32_t RCC_AHB1Periph, FunctionalState NewState);
  892. void RCC_AHB2PeriphClockLPModeCmd(uint32_t RCC_AHB2Periph, FunctionalState NewState);
  893. void RCC_AHB3PeriphClockLPModeCmd(uint32_t RCC_AHB3Periph, FunctionalState NewState);
  894. void RCC_APB1PeriphClockLPModeCmd(uint32_t RCC_APB1Periph, FunctionalState NewState);
  895. void RCC_APB2PeriphClockLPModeCmd(uint32_t RCC_APB2Periph, FunctionalState NewState);
  896. /* Features available only for STM32F410xx/STM32F411xx/STM32F446xx/STM32F469_479xx devices */
  897. void RCC_LSEModeConfig(uint8_t RCC_Mode);
  898. /* Features available only for STM32F469_479xx devices */
  899. #if defined(STM32F469_479xx)
  900. void RCC_DSIClockSourceConfig(uint8_t RCC_ClockSource);
  901. #endif /* STM32F469_479xx */
  902. /* Features available only for STM32F412xG/STM32F413_423xx/STM32F446xx/STM32F469_479xx devices */
  903. #if defined(STM32F412xG) || defined(STM32F413_423xx) || defined(STM32F446xx) || defined(STM32F469_479xx)
  904. void RCC_48MHzClockSourceConfig(uint8_t RCC_ClockSource);
  905. void RCC_SDIOClockSourceConfig(uint8_t RCC_ClockSource);
  906. #endif /* STM32F412xG || STM32F413_423xx || STM32F446xx || STM32F469_479xx */
  907. /* Features available only for STM32F446xx devices */
  908. #if defined(STM32F446xx)
  909. void RCC_AHB1ClockGatingCmd(uint32_t RCC_AHB1ClockGating, FunctionalState NewState);
  910. void RCC_SPDIFRXClockSourceConfig(uint8_t RCC_ClockSource);
  911. void RCC_CECClockSourceConfig(uint8_t RCC_ClockSource);
  912. #endif /* STM32F446xx */
  913. /* Features available only for STM32F410xx/STM32F412xG/STM32F446xx devices */
  914. #if defined(STM32F410xx) || defined(STM32F412xG) || defined(STM32F413_423xx) || defined(STM32F446xx)
  915. void RCC_FMPI2C1ClockSourceConfig(uint32_t RCC_ClockSource);
  916. #endif /* STM32F410xx || STM32F412xG || STM32F413_423xx || STM32F446xx */
  917. /* Features available only for STM32F410xx devices */
  918. #if defined(STM32F410xx) || defined(STM32F413_423xx)
  919. void RCC_LPTIM1ClockSourceConfig(uint32_t RCC_ClockSource);
  920. #if defined(STM32F410xx)
  921. void RCC_MCO1Cmd(FunctionalState NewState);
  922. void RCC_MCO2Cmd(FunctionalState NewState);
  923. #endif /* STM32F410xx */
  924. #endif /* STM32F410xx || STM32F413_423xx */
  925. #if defined(STM32F412xG) || defined(STM32F413_423xx)
  926. void RCC_DFSDMCLKConfig(uint32_t RCC_DFSDMCLKSource);
  927. void RCC_DFSDM1ACLKConfig(uint32_t RCC_DFSDM1ACLKSource);
  928. #if defined(STM32F413_423xx)
  929. void RCC_DFSDM2ACLKConfig(uint32_t RCC_DFSDMACLKSource);
  930. #endif /* STM32F413_423xx */
  931. /* Legacy Defines */
  932. #define RCC_DFSDM1CLKConfig RCC_DFSDMCLKConfig
  933. #endif /* STM32F412xG || STM32F413_423xx */
  934. /* Interrupts and flags management functions **********************************/
  935. void RCC_ITConfig(uint8_t RCC_IT, FunctionalState NewState);
  936. FlagStatus RCC_GetFlagStatus(uint8_t RCC_FLAG);
  937. void RCC_ClearFlag(void);
  938. ITStatus RCC_GetITStatus(uint8_t RCC_IT);
  939. void RCC_ClearITPendingBit(uint8_t RCC_IT);
  940. #ifdef __cplusplus
  941. }
  942. #endif
  943. #endif /* __STM32F4xx_RCC_H */
  944. /**
  945. * @}
  946. */
  947. /**
  948. * @}
  949. */
  950. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/