stm32_rcc.h 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672
  1. /*
  2. ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. /**
  14. * @file STM32F7xx/stm32_rcc.h
  15. * @brief RCC helper driver header.
  16. * @note This file requires definitions from the ST header file
  17. * @p stm32f7xx.h.
  18. *
  19. * @addtogroup STM32F7xx_RCC
  20. * @{
  21. */
  22. #ifndef STM32_RCC_H
  23. #define STM32_RCC_H
  24. /*===========================================================================*/
  25. /* Driver constants. */
  26. /*===========================================================================*/
  27. /*===========================================================================*/
  28. /* Driver pre-compile time settings. */
  29. /*===========================================================================*/
  30. /*===========================================================================*/
  31. /* Derived constants and error checks. */
  32. /*===========================================================================*/
  33. /*===========================================================================*/
  34. /* Driver data structures and types. */
  35. /*===========================================================================*/
  36. /*===========================================================================*/
  37. /* Driver macros. */
  38. /*===========================================================================*/
  39. /**
  40. * @name Generic RCC operations
  41. * @{
  42. */
  43. /**
  44. * @brief Enables the clock of one or more peripheral on the APB1 bus.
  45. *
  46. * @param[in] mask APB1 peripherals mask
  47. * @param[in] lp low power enable flag
  48. *
  49. * @api
  50. */
  51. #define rccEnableAPB1(mask, lp) { \
  52. RCC->APB1ENR |= (mask); \
  53. if (lp) \
  54. RCC->APB1LPENR |= (mask); \
  55. else \
  56. RCC->APB1LPENR &= ~(mask); \
  57. (void)RCC->APB1LPENR; \
  58. }
  59. /**
  60. * @brief Disables the clock of one or more peripheral on the APB1 bus.
  61. *
  62. * @param[in] mask APB1 peripherals mask
  63. *
  64. * @api
  65. */
  66. #define rccDisableAPB1(mask) { \
  67. RCC->APB1ENR &= ~(mask); \
  68. RCC->APB1LPENR &= ~(mask); \
  69. (void)RCC->APB1LPENR; \
  70. }
  71. /**
  72. * @brief Resets one or more peripheral on the APB1 bus.
  73. *
  74. * @param[in] mask APB1 peripherals mask
  75. *
  76. * @api
  77. */
  78. #define rccResetAPB1(mask) { \
  79. RCC->APB1RSTR |= (mask); \
  80. RCC->APB1RSTR &= ~(mask); \
  81. (void)RCC->APB1RSTR; \
  82. }
  83. /**
  84. * @brief Enables the clock of one or more peripheral on the APB2 bus.
  85. *
  86. * @param[in] mask APB2 peripherals mask
  87. * @param[in] lp low power enable flag
  88. *
  89. * @api
  90. */
  91. #define rccEnableAPB2(mask, lp) { \
  92. RCC->APB2ENR |= (mask); \
  93. if (lp) \
  94. RCC->APB2LPENR |= (mask); \
  95. else \
  96. RCC->APB2LPENR &= ~(mask); \
  97. (void)RCC->APB2LPENR; \
  98. }
  99. /**
  100. * @brief Disables the clock of one or more peripheral on the APB2 bus.
  101. *
  102. * @param[in] mask APB2 peripherals mask
  103. *
  104. * @api
  105. */
  106. #define rccDisableAPB2(mask) { \
  107. RCC->APB2ENR &= ~(mask); \
  108. RCC->APB2LPENR &= ~(mask); \
  109. (void)RCC->APB2LPENR; \
  110. }
  111. /**
  112. * @brief Resets one or more peripheral on the APB2 bus.
  113. *
  114. * @param[in] mask APB2 peripherals mask
  115. *
  116. * @api
  117. */
  118. #define rccResetAPB2(mask) { \
  119. RCC->APB2RSTR |= (mask); \
  120. RCC->APB2RSTR &= ~(mask); \
  121. (void)RCC->APB2RSTR; \
  122. }
  123. /**
  124. * @brief Enables the clock of one or more peripheral on the AHB1 bus.
  125. *
  126. * @param[in] mask AHB1 peripherals mask
  127. * @param[in] lp low power enable flag
  128. *
  129. * @api
  130. */
  131. #define rccEnableAHB1(mask, lp) { \
  132. RCC->AHB1ENR |= (mask); \
  133. if (lp) \
  134. RCC->AHB1LPENR |= (mask); \
  135. else \
  136. RCC->AHB1LPENR &= ~(mask); \
  137. (void)RCC->AHB1LPENR; \
  138. }
  139. /**
  140. * @brief Disables the clock of one or more peripheral on the AHB1 bus.
  141. *
  142. * @param[in] mask AHB1 peripherals mask
  143. *
  144. * @api
  145. */
  146. #define rccDisableAHB1(mask) { \
  147. RCC->AHB1ENR &= ~(mask); \
  148. RCC->AHB1LPENR &= ~(mask); \
  149. (void)RCC->AHB1LPENR; \
  150. }
  151. /**
  152. * @brief Resets one or more peripheral on the AHB1 bus.
  153. *
  154. * @param[in] mask AHB1 peripherals mask
  155. *
  156. * @api
  157. */
  158. #define rccResetAHB1(mask) { \
  159. RCC->AHB1RSTR |= (mask); \
  160. RCC->AHB1RSTR &= ~(mask); \
  161. (void)RCC->AHB1RSTR; \
  162. }
  163. /**
  164. * @brief Enables the clock of one or more peripheral on the AHB2 bus.
  165. *
  166. * @param[in] mask AHB2 peripherals mask
  167. * @param[in] lp low power enable flag
  168. *
  169. * @api
  170. */
  171. #define rccEnableAHB2(mask, lp) { \
  172. RCC->AHB2ENR |= (mask); \
  173. if (lp) \
  174. RCC->AHB2LPENR |= (mask); \
  175. else \
  176. RCC->AHB2LPENR &= ~(mask); \
  177. (void)RCC->AHB2LPENR; \
  178. }
  179. /**
  180. * @brief Disables the clock of one or more peripheral on the AHB2 bus.
  181. *
  182. * @param[in] mask AHB2 peripherals mask
  183. *
  184. * @api
  185. */
  186. #define rccDisableAHB2(mask) { \
  187. RCC->AHB2ENR &= ~(mask); \
  188. RCC->AHB2LPENR &= ~(mask); \
  189. (void)RCC->AHB2LPENR; \
  190. }
  191. /**
  192. * @brief Resets one or more peripheral on the AHB2 bus.
  193. *
  194. * @param[in] mask AHB2 peripherals mask
  195. *
  196. * @api
  197. */
  198. #define rccResetAHB2(mask) { \
  199. RCC->AHB2RSTR |= (mask); \
  200. RCC->AHB2RSTR &= ~(mask); \
  201. (void)RCC->AHB2RSTR; \
  202. }
  203. /**
  204. * @brief Enables the clock of one or more peripheral on the AHB3 (FSMC) bus.
  205. *
  206. * @param[in] mask AHB3 peripherals mask
  207. * @param[in] lp low power enable flag
  208. *
  209. * @api
  210. */
  211. #define rccEnableAHB3(mask, lp) { \
  212. RCC->AHB3ENR |= (mask); \
  213. if (lp) \
  214. RCC->AHB3LPENR |= (mask); \
  215. else \
  216. RCC->AHB3LPENR &= ~(mask); \
  217. (void)RCC->AHB3LPENR; \
  218. }
  219. /**
  220. * @brief Disables the clock of one or more peripheral on the AHB3 (FSMC) bus.
  221. *
  222. * @param[in] mask AHB3 peripherals mask
  223. *
  224. * @api
  225. */
  226. #define rccDisableAHB3(mask) { \
  227. RCC->AHB3ENR &= ~(mask); \
  228. RCC->AHB3LPENR &= ~(mask); \
  229. (void)RCC->AHB3LPENR; \
  230. }
  231. /**
  232. * @brief Resets one or more peripheral on the AHB3 (FSMC) bus.
  233. *
  234. * @param[in] mask AHB3 peripherals mask
  235. *
  236. * @api
  237. */
  238. #define rccResetAHB3(mask) { \
  239. RCC->AHB3RSTR |= (mask); \
  240. RCC->AHB3RSTR &= ~(mask); \
  241. (void)RCC->AHB3RSTR; \
  242. }
  243. /** @} */
  244. /**
  245. * @name ADC peripherals specific RCC operations
  246. * @{
  247. */
  248. /**
  249. * @brief Enables the ADC1 peripheral clock.
  250. *
  251. * @param[in] lp low power enable flag
  252. *
  253. * @api
  254. */
  255. #define rccEnableADC1(lp) rccEnableAPB2(RCC_APB2ENR_ADC1EN, lp)
  256. /**
  257. * @brief Disables the ADC1 peripheral clock.
  258. *
  259. * @api
  260. */
  261. #define rccDisableADC1() rccDisableAPB2(RCC_APB2ENR_ADC1EN)
  262. /**
  263. * @brief Resets the ADC1 peripheral.
  264. *
  265. * @api
  266. */
  267. #define rccResetADC1() rccResetAPB2(RCC_APB2RSTR_ADC1RST)
  268. /**
  269. * @brief Enables the ADC2 peripheral clock.
  270. *
  271. * @param[in] lp low power enable flag
  272. *
  273. * @api
  274. */
  275. #define rccEnableADC2(lp) rccEnableAPB2(RCC_APB2ENR_ADC2EN, lp)
  276. /**
  277. * @brief Disables the ADC2 peripheral clock.
  278. *
  279. * @api
  280. */
  281. #define rccDisableADC2() rccDisableAPB2(RCC_APB2ENR_ADC2EN)
  282. /**
  283. * @brief Resets the ADC2 peripheral.
  284. *
  285. * @api
  286. */
  287. #define rccResetADC2() rccResetAPB2(RCC_APB2RSTR_ADC2RST)
  288. /**
  289. * @brief Enables the ADC3 peripheral clock.
  290. *
  291. * @param[in] lp low power enable flag
  292. *
  293. * @api
  294. */
  295. #define rccEnableADC3(lp) rccEnableAPB2(RCC_APB2ENR_ADC3EN, lp)
  296. /**
  297. * @brief Disables the ADC3 peripheral clock.
  298. *
  299. * @api
  300. */
  301. #define rccDisableADC3() rccDisableAPB2(RCC_APB2ENR_ADC3EN)
  302. /**
  303. * @brief Resets the ADC3 peripheral.
  304. *
  305. * @api
  306. */
  307. #define rccResetADC3() rccResetAPB2(RCC_APB2RSTR_ADC3RST)
  308. /** @} */
  309. /**
  310. * @name DAC peripheral specific RCC operations
  311. * @{
  312. */
  313. /**
  314. * @brief Enables the DAC1 peripheral clock.
  315. *
  316. * @param[in] lp low power enable flag
  317. *
  318. * @api
  319. */
  320. #define rccEnableDAC1(lp) rccEnableAPB1(RCC_APB1ENR_DACEN, lp)
  321. /**
  322. * @brief Disables the DAC1 peripheral clock.
  323. *
  324. * @api
  325. */
  326. #define rccDisableDAC1() rccDisableAPB1(RCC_APB1ENR_DACEN)
  327. /**
  328. * @brief Resets the DAC1 peripheral.
  329. *
  330. * @api
  331. */
  332. #define rccResetDAC1() rccResetAPB1(RCC_APB1RSTR_DACRST)
  333. /** @} */
  334. /**
  335. * @name DMA peripheral specific RCC operations
  336. * @{
  337. */
  338. /**
  339. * @brief Enables the DMA1 peripheral clock.
  340. *
  341. * @param[in] lp low power enable flag
  342. *
  343. * @api
  344. */
  345. #define rccEnableDMA1(lp) rccEnableAHB1(RCC_AHB1ENR_DMA1EN, lp)
  346. /**
  347. * @brief Disables the DMA1 peripheral clock.
  348. *
  349. * @api
  350. */
  351. #define rccDisableDMA1() rccDisableAHB1(RCC_AHB1ENR_DMA1EN)
  352. /**
  353. * @brief Resets the DMA1 peripheral.
  354. *
  355. * @api
  356. */
  357. #define rccResetDMA1() rccResetAHB1(RCC_AHB1RSTR_DMA1RST)
  358. /**
  359. * @brief Enables the DMA2 peripheral clock.
  360. *
  361. * @param[in] lp low power enable flag
  362. *
  363. * @api
  364. */
  365. #define rccEnableDMA2(lp) rccEnableAHB1(RCC_AHB1ENR_DMA2EN, lp)
  366. /**
  367. * @brief Disables the DMA2 peripheral clock.
  368. *
  369. * @api
  370. */
  371. #define rccDisableDMA2() rccDisableAHB1(RCC_AHB1ENR_DMA2EN)
  372. /**
  373. * @brief Resets the DMA2 peripheral.
  374. *
  375. * @api
  376. */
  377. #define rccResetDMA2() rccResetAHB1(RCC_AHB1RSTR_DMA2RST)
  378. /** @} */
  379. /**
  380. * @name BKPSRAM specific RCC operations
  381. * @{
  382. */
  383. /**
  384. * @brief Enables the BKPSRAM peripheral clock.
  385. *
  386. * @param[in] lp low power enable flag
  387. *
  388. * @api
  389. */
  390. #define rccEnableBKPSRAM(lp) rccEnableAHB1(RCC_AHB1ENR_BKPSRAMEN, lp)
  391. /**
  392. * @brief Disables the BKPSRAM peripheral clock.
  393. *
  394. * @api
  395. */
  396. #define rccDisableBKPSRAM() rccDisableAHB1(RCC_AHB1ENR_BKPSRAMEN)
  397. /** @} */
  398. /**
  399. * @name PWR interface specific RCC operations
  400. * @{
  401. */
  402. /**
  403. * @brief Enables the PWR interface clock.
  404. *
  405. * @param[in] lp low power enable flag
  406. *
  407. * @api
  408. */
  409. #define rccEnablePWRInterface(lp) rccEnableAPB1(RCC_APB1ENR_PWREN, lp)
  410. /**
  411. * @brief Disables PWR interface clock.
  412. *
  413. * @api
  414. */
  415. #define rccDisablePWRInterface() rccDisableAPB1(RCC_APB1ENR_PWREN)
  416. /**
  417. * @brief Resets the PWR interface.
  418. *
  419. * @api
  420. */
  421. #define rccResetPWRInterface() rccResetAPB1(RCC_APB1RSTR_PWRRST)
  422. /** @} */
  423. /**
  424. * @name CAN peripherals specific RCC operations
  425. * @{
  426. */
  427. /**
  428. * @brief Enables the CAN1 peripheral clock.
  429. *
  430. * @param[in] lp low power enable flag
  431. *
  432. * @api
  433. */
  434. #define rccEnableCAN1(lp) rccEnableAPB1(RCC_APB1ENR_CAN1EN, lp)
  435. /**
  436. * @brief Disables the CAN1 peripheral clock.
  437. *
  438. * @api
  439. */
  440. #define rccDisableCAN1() rccDisableAPB1(RCC_APB1ENR_CAN1EN)
  441. /**
  442. * @brief Resets the CAN1 peripheral.
  443. *
  444. * @api
  445. */
  446. #define rccResetCAN1() rccResetAPB1(RCC_APB1RSTR_CAN1RST)
  447. /**
  448. * @brief Enables the CAN2 peripheral clock.
  449. *
  450. * @param[in] lp low power enable flag
  451. *
  452. * @api
  453. */
  454. #define rccEnableCAN2(lp) rccEnableAPB1(RCC_APB1ENR_CAN2EN, lp)
  455. /**
  456. * @brief Disables the CAN2 peripheral clock.
  457. *
  458. * @api
  459. */
  460. #define rccDisableCAN2() rccDisableAPB1(RCC_APB1ENR_CAN2EN)
  461. /**
  462. * @brief Resets the CAN2 peripheral.
  463. *
  464. * @api
  465. */
  466. #define rccResetCAN2() rccResetAPB1(RCC_APB1RSTR_CAN2RST)
  467. /**
  468. * @brief Resets the CAN3 peripheral.
  469. *
  470. * @api
  471. */
  472. #define rccResetCAN3() rccResetAPB1(RCC_APB1RSTR_CAN3RST)
  473. /**
  474. * @brief Enables the CAN3 peripheral clock.
  475. *
  476. * @param[in] lp low power enable flag
  477. *
  478. * @api
  479. */
  480. #define rccEnableCAN3(lp) rccEnableAPB1(RCC_APB1ENR_CAN3EN, lp)
  481. /**
  482. * @brief Disables the CAN3 peripheral clock.
  483. *
  484. * @api
  485. */
  486. #define rccDisableCAN3() rccDisableAPB1(RCC_APB1ENR_CAN3EN)
  487. /** @} */
  488. /**
  489. * @name ETH peripheral specific RCC operations
  490. * @{
  491. */
  492. /**
  493. * @brief Enables the ETH peripheral clock.
  494. *
  495. * @api
  496. */
  497. #define rccEnableETH(lp) rccEnableAHB1(RCC_AHB1ENR_ETHMACEN | \
  498. RCC_AHB1ENR_ETHMACTXEN | \
  499. RCC_AHB1ENR_ETHMACRXEN, lp)
  500. /**
  501. * @brief Disables the ETH peripheral clock.
  502. *
  503. * @param[in] lp low power enable flag
  504. *
  505. * @api
  506. */
  507. #define rccDisableETH() rccDisableAHB1(RCC_AHB1ENR_ETHMACEN | \
  508. RCC_AHB1ENR_ETHMACTXEN | \
  509. RCC_AHB1ENR_ETHMACRXEN)
  510. /**
  511. * @brief Resets the ETH peripheral.
  512. *
  513. * @api
  514. */
  515. #define rccResetETH() rccResetAHB1(RCC_AHB1RSTR_ETHMACRST)
  516. /** @} */
  517. /**
  518. * @name I2C peripherals specific RCC operations
  519. * @{
  520. */
  521. /**
  522. * @brief Enables the I2C1 peripheral clock.
  523. *
  524. * @param[in] lp low power enable flag
  525. *
  526. * @api
  527. */
  528. #define rccEnableI2C1(lp) rccEnableAPB1(RCC_APB1ENR_I2C1EN, lp)
  529. /**
  530. * @brief Disables the I2C1 peripheral clock.
  531. *
  532. * @api
  533. */
  534. #define rccDisableI2C1() rccDisableAPB1(RCC_APB1ENR_I2C1EN)
  535. /**
  536. * @brief Resets the I2C1 peripheral.
  537. *
  538. * @api
  539. */
  540. #define rccResetI2C1() rccResetAPB1(RCC_APB1RSTR_I2C1RST)
  541. /**
  542. * @brief Enables the I2C2 peripheral clock.
  543. *
  544. * @param[in] lp low power enable flag
  545. *
  546. * @api
  547. */
  548. #define rccEnableI2C2(lp) rccEnableAPB1(RCC_APB1ENR_I2C2EN, lp)
  549. /**
  550. * @brief Disables the I2C2 peripheral clock.
  551. *
  552. * @api
  553. */
  554. #define rccDisableI2C2() rccDisableAPB1(RCC_APB1ENR_I2C2EN)
  555. /**
  556. * @brief Resets the I2C2 peripheral.
  557. *
  558. * @api
  559. */
  560. #define rccResetI2C2() rccResetAPB1(RCC_APB1RSTR_I2C2RST)
  561. /**
  562. * @brief Enables the I2C3 peripheral clock.
  563. *
  564. * @param[in] lp low power enable flag
  565. *
  566. * @api
  567. */
  568. #define rccEnableI2C3(lp) rccEnableAPB1(RCC_APB1ENR_I2C3EN, lp)
  569. /**
  570. * @brief Disables the I2C3 peripheral clock.
  571. *
  572. * @api
  573. */
  574. #define rccDisableI2C3() rccDisableAPB1(RCC_APB1ENR_I2C3EN)
  575. /**
  576. * @brief Resets the I2C3 peripheral.
  577. *
  578. * @api
  579. */
  580. #define rccResetI2C3() rccResetAPB1(RCC_APB1RSTR_I2C3RST)
  581. /**
  582. * @brief Enables the I2C4 peripheral clock.
  583. *
  584. * @param[in] lp low power enable flag
  585. *
  586. * @api
  587. */
  588. #define rccEnableI2C4(lp) rccEnableAPB1(RCC_APB1ENR_I2C4EN, lp)
  589. /**
  590. * @brief Disables the I2C4 peripheral clock.
  591. *
  592. * @api
  593. */
  594. #define rccDisableI2C4() rccDisableAPB1(RCC_APB1ENR_I2C4EN)
  595. /**
  596. * @brief Resets the I2C4 peripheral.
  597. *
  598. * @api
  599. */
  600. #define rccResetI2C4() rccResetAPB1(RCC_APB1RSTR_I2C4RST)
  601. /** @} */
  602. /**
  603. * @name OTG peripherals specific RCC operations
  604. * @{
  605. */
  606. /**
  607. * @brief Enables the OTG_FS peripheral clock.
  608. *
  609. * @param[in] lp low power enable flag
  610. *
  611. * @api
  612. */
  613. #define rccEnableOTG_FS(lp) rccEnableAHB2(RCC_AHB2ENR_OTGFSEN, lp)
  614. /**
  615. * @brief Disables the OTG_FS peripheral clock.
  616. *
  617. * @api
  618. */
  619. #define rccDisableOTG_FS() rccDisableAHB2(RCC_AHB2ENR_OTGFSEN)
  620. /**
  621. * @brief Resets the OTG_FS peripheral.
  622. *
  623. * @api
  624. */
  625. #define rccResetOTG_FS() rccResetAHB2(RCC_AHB2RSTR_OTGFSRST)
  626. /**
  627. * @brief Enables the OTG_HS peripheral clock.
  628. *
  629. * @param[in] lp low power enable flag
  630. *
  631. * @api
  632. */
  633. #define rccEnableOTG_HS(lp) rccEnableAHB1(RCC_AHB1ENR_OTGHSEN, lp)
  634. /**
  635. * @brief Disables the OTG_HS peripheral clock.
  636. *
  637. * @api
  638. */
  639. #define rccDisableOTG_HS() rccDisableAHB1(RCC_AHB1ENR_OTGHSEN)
  640. /**
  641. * @brief Resets the OTG_HS peripheral.
  642. *
  643. * @api
  644. */
  645. #define rccResetOTG_HS() rccResetAHB1(RCC_AHB1RSTR_OTGHRST)
  646. /**
  647. * @brief Enables the OTG_HS peripheral clock.
  648. *
  649. * @param[in] lp low power enable flag
  650. *
  651. * @api
  652. */
  653. #define rccEnableOTG_HSULPI(lp) rccEnableAHB1(RCC_AHB1ENR_OTGHSULPIEN, lp)
  654. /**
  655. * @brief Disables the OTG_HS peripheral clock.
  656. *
  657. * @api
  658. */
  659. #define rccDisableOTG_HSULPI() rccDisableAHB1(RCC_AHB1ENR_OTGHSULPIEN)
  660. /** @} */
  661. /**
  662. * @name QUADSPI peripherals specific RCC operations
  663. * @{
  664. */
  665. /**
  666. * @brief Enables the QUADSPI1 peripheral clock.
  667. *
  668. * @param[in] lp low power enable flag
  669. *
  670. * @api
  671. */
  672. #define rccEnableQUADSPI1(lp) rccEnableAHB3(RCC_AHB3ENR_QSPIEN, lp)
  673. /**
  674. * @brief Disables the QUADSPI1 peripheral clock.
  675. *
  676. * @api
  677. */
  678. #define rccDisableQUADSPI1() rccDisableAHB3(RCC_AHB3ENR_QSPIEN)
  679. /**
  680. * @brief Resets the QUADSPI1 peripheral.
  681. *
  682. * @api
  683. */
  684. #define rccResetQUADSPI1() rccResetAHB3(RCC_AHB3RSTR_QSPIRST)
  685. /** @} */
  686. /**
  687. * @name SDMMC peripheral specific RCC operations
  688. * @{
  689. */
  690. /**
  691. * @brief Enables the SDMMC1 peripheral clock.
  692. *
  693. * @param[in] lp low power enable flag
  694. *
  695. * @api
  696. */
  697. #define rccEnableSDMMC1(lp) rccEnableAPB2(RCC_APB2ENR_SDMMC1EN, lp)
  698. /**
  699. * @brief Disables the SDMMC1 peripheral clock.
  700. *
  701. * @api
  702. */
  703. #define rccDisableSDMMC1() rccDisableAPB2(RCC_APB2ENR_SDMMC1EN)
  704. /**
  705. * @brief Resets the SDMMC1 peripheral.
  706. *
  707. * @api
  708. */
  709. #define rccResetSDMMC1() rccResetAPB2(RCC_APB2RSTR_SDMMC1RST)
  710. /**
  711. * @brief Enables the SDMMC2 peripheral clock.
  712. *
  713. * @param[in] lp low power enable flag
  714. *
  715. * @api
  716. */
  717. #define rccEnableSDMMC2(lp) rccEnableAPB2(RCC_APB2ENR_SDMMC2EN, lp)
  718. /**
  719. * @brief Disables the SDMMC2 peripheral clock.
  720. *
  721. * @api
  722. */
  723. #define rccDisableSDMMC2() rccDisableAPB2(RCC_APB2ENR_SDMMC2EN)
  724. /**
  725. * @brief Resets the SDMMC2 peripheral.
  726. *
  727. * @api
  728. */
  729. #define rccResetSDMMC2() rccResetAPB2(RCC_APB2RSTR_SDMMC2RST)
  730. /** @} */
  731. /**
  732. * @name SPI peripherals specific RCC operations
  733. * @{
  734. */
  735. /**
  736. * @brief Enables the SPI1 peripheral clock.
  737. *
  738. * @param[in] lp low power enable flag
  739. *
  740. * @api
  741. */
  742. #define rccEnableSPI1(lp) rccEnableAPB2(RCC_APB2ENR_SPI1EN, lp)
  743. /**
  744. * @brief Disables the SPI1 peripheral clock.
  745. *
  746. * @api
  747. */
  748. #define rccDisableSPI1() rccDisableAPB2(RCC_APB2ENR_SPI1EN)
  749. /**
  750. * @brief Resets the SPI1 peripheral.
  751. *
  752. * @api
  753. */
  754. #define rccResetSPI1() rccResetAPB2(RCC_APB2RSTR_SPI1RST)
  755. /**
  756. * @brief Enables the SPI2 peripheral clock.
  757. *
  758. * @param[in] lp low power enable flag
  759. *
  760. * @api
  761. */
  762. #define rccEnableSPI2(lp) rccEnableAPB1(RCC_APB1ENR_SPI2EN, lp)
  763. /**
  764. * @brief Disables the SPI2 peripheral clock.
  765. *
  766. * @api
  767. */
  768. #define rccDisableSPI2() rccDisableAPB1(RCC_APB1ENR_SPI2EN)
  769. /**
  770. * @brief Resets the SPI2 peripheral.
  771. *
  772. * @api
  773. */
  774. #define rccResetSPI2() rccResetAPB1(RCC_APB1RSTR_SPI2RST)
  775. /**
  776. * @brief Enables the SPI3 peripheral clock.
  777. *
  778. * @param[in] lp low power enable flag
  779. *
  780. * @api
  781. */
  782. #define rccEnableSPI3(lp) rccEnableAPB1(RCC_APB1ENR_SPI3EN, lp)
  783. /**
  784. * @brief Disables the SPI3 peripheral clock.
  785. *
  786. * @api
  787. */
  788. #define rccDisableSPI3() rccDisableAPB1(RCC_APB1ENR_SPI3EN)
  789. /**
  790. * @brief Resets the SPI3 peripheral.
  791. *
  792. * @api
  793. */
  794. #define rccResetSPI3() rccResetAPB1(RCC_APB1RSTR_SPI3RST)
  795. /**
  796. * @brief Enables the SPI4 peripheral clock.
  797. *
  798. * @param[in] lp low power enable flag
  799. *
  800. * @api
  801. */
  802. #define rccEnableSPI4(lp) rccEnableAPB2(RCC_APB2ENR_SPI4EN, lp)
  803. /**
  804. * @brief Disables the SPI4 peripheral clock.
  805. *
  806. * @api
  807. */
  808. #define rccDisableSPI4() rccDisableAPB2(RCC_APB2ENR_SPI4EN)
  809. /**
  810. * @brief Resets the SPI4 peripheral.
  811. *
  812. * @api
  813. */
  814. #define rccResetSPI4() rccResetAPB2(RCC_APB2RSTR_SPI4RST)
  815. /**
  816. * @brief Enables the SPI5 peripheral clock.
  817. *
  818. * @param[in] lp low power enable flag
  819. *
  820. * @api
  821. */
  822. #define rccEnableSPI5(lp) rccEnableAPB2(RCC_APB2ENR_SPI5EN, lp)
  823. /**
  824. * @brief Disables the SPI5 peripheral clock.
  825. *
  826. * @api
  827. */
  828. #define rccDisableSPI5() rccDisableAPB2(RCC_APB2ENR_SPI5EN)
  829. /**
  830. * @brief Resets the SPI5 peripheral.
  831. *
  832. * @api
  833. */
  834. #define rccResetSPI5() rccResetAPB2(RCC_APB2RSTR_SPI5RST)
  835. /**
  836. * @brief Enables the SPI6 peripheral clock.
  837. *
  838. * @param[in] lp low power enable flag
  839. *
  840. * @api
  841. */
  842. #define rccEnableSPI6(lp) rccEnableAPB2(RCC_APB2ENR_SPI6EN, lp)
  843. /**
  844. * @brief Disables the SPI6 peripheral clock.
  845. *
  846. * @api
  847. */
  848. #define rccDisableSPI6() rccDisableAPB2(RCC_APB2ENR_SPI6EN)
  849. /**
  850. * @brief Resets the SPI6 peripheral.
  851. *
  852. * @api
  853. */
  854. #define rccResetSPI6() rccResetAPB2(RCC_APB2RSTR_SPI6RST)
  855. /** @} */
  856. /**
  857. * @name TIM peripherals specific RCC operations
  858. * @{
  859. */
  860. /**
  861. * @brief Enables the TIM1 peripheral clock.
  862. *
  863. * @param[in] lp low power enable flag
  864. *
  865. * @api
  866. */
  867. #define rccEnableTIM1(lp) rccEnableAPB2(RCC_APB2ENR_TIM1EN, lp)
  868. /**
  869. * @brief Disables the TIM1 peripheral clock.
  870. *
  871. * @api
  872. */
  873. #define rccDisableTIM1() rccDisableAPB2(RCC_APB2ENR_TIM1EN)
  874. /**
  875. * @brief Resets the TIM1 peripheral.
  876. *
  877. * @api
  878. */
  879. #define rccResetTIM1() rccResetAPB2(RCC_APB2RSTR_TIM1RST)
  880. /**
  881. * @brief Enables the TIM2 peripheral clock.
  882. *
  883. * @param[in] lp low power enable flag
  884. *
  885. * @api
  886. */
  887. #define rccEnableTIM2(lp) rccEnableAPB1(RCC_APB1ENR_TIM2EN, lp)
  888. /**
  889. * @brief Disables the TIM2 peripheral clock.
  890. *
  891. * @api
  892. */
  893. #define rccDisableTIM2() rccDisableAPB1(RCC_APB1ENR_TIM2EN)
  894. /**
  895. * @brief Resets the TIM2 peripheral.
  896. *
  897. * @api
  898. */
  899. #define rccResetTIM2() rccResetAPB1(RCC_APB1RSTR_TIM2RST)
  900. /**
  901. * @brief Enables the TIM3 peripheral clock.
  902. *
  903. * @param[in] lp low power enable flag
  904. *
  905. * @api
  906. */
  907. #define rccEnableTIM3(lp) rccEnableAPB1(RCC_APB1ENR_TIM3EN, lp)
  908. /**
  909. * @brief Disables the TIM3 peripheral clock.
  910. *
  911. * @api
  912. */
  913. #define rccDisableTIM3() rccDisableAPB1(RCC_APB1ENR_TIM3EN)
  914. /**
  915. * @brief Resets the TIM3 peripheral.
  916. *
  917. * @api
  918. */
  919. #define rccResetTIM3() rccResetAPB1(RCC_APB1RSTR_TIM3RST)
  920. /**
  921. * @brief Enables the TIM4 peripheral clock.
  922. *
  923. * @param[in] lp low power enable flag
  924. *
  925. * @api
  926. */
  927. #define rccEnableTIM4(lp) rccEnableAPB1(RCC_APB1ENR_TIM4EN, lp)
  928. /**
  929. * @brief Disables the TIM4 peripheral clock.
  930. *
  931. * @api
  932. */
  933. #define rccDisableTIM4() rccDisableAPB1(RCC_APB1ENR_TIM4EN)
  934. /**
  935. * @brief Resets the TIM4 peripheral.
  936. *
  937. * @api
  938. */
  939. #define rccResetTIM4() rccResetAPB1(RCC_APB1RSTR_TIM4RST)
  940. /**
  941. * @brief Enables the TIM5 peripheral clock.
  942. *
  943. * @param[in] lp low power enable flag
  944. *
  945. * @api
  946. */
  947. #define rccEnableTIM5(lp) rccEnableAPB1(RCC_APB1ENR_TIM5EN, lp)
  948. /**
  949. * @brief Disables the TIM5 peripheral clock.
  950. *
  951. * @api
  952. */
  953. #define rccDisableTIM5() rccDisableAPB1(RCC_APB1ENR_TIM5EN)
  954. /**
  955. * @brief Resets the TIM5 peripheral.
  956. *
  957. * @api
  958. */
  959. #define rccResetTIM5() rccResetAPB1(RCC_APB1RSTR_TIM5RST)
  960. /**
  961. * @brief Enables the TIM6 peripheral clock.
  962. *
  963. * @param[in] lp low power enable flag
  964. *
  965. * @api
  966. */
  967. #define rccEnableTIM6(lp) rccEnableAPB1(RCC_APB1ENR_TIM6EN, lp)
  968. /**
  969. * @brief Disables the TIM6 peripheral clock.
  970. *
  971. * @api
  972. */
  973. #define rccDisableTIM6() rccDisableAPB1(RCC_APB1ENR_TIM6EN)
  974. /**
  975. * @brief Resets the TIM6 peripheral.
  976. *
  977. * @api
  978. */
  979. #define rccResetTIM6() rccResetAPB1(RCC_APB1RSTR_TIM6RST)
  980. /**
  981. * @brief Enables the TIM7 peripheral clock.
  982. *
  983. * @param[in] lp low power enable flag
  984. *
  985. * @api
  986. */
  987. #define rccEnableTIM7(lp) rccEnableAPB1(RCC_APB1ENR_TIM7EN, lp)
  988. /**
  989. * @brief Disables the TIM7 peripheral clock.
  990. *
  991. * @api
  992. */
  993. #define rccDisableTIM7() rccDisableAPB1(RCC_APB1ENR_TIM7EN)
  994. /**
  995. * @brief Resets the TIM7 peripheral.
  996. *
  997. * @api
  998. */
  999. #define rccResetTIM7() rccResetAPB1(RCC_APB1RSTR_TIM7RST)
  1000. /**
  1001. * @brief Enables the TIM8 peripheral clock.
  1002. *
  1003. * @param[in] lp low power enable flag
  1004. *
  1005. * @api
  1006. */
  1007. #define rccEnableTIM8(lp) rccEnableAPB2(RCC_APB2ENR_TIM8EN, lp)
  1008. /**
  1009. * @brief Disables the TIM8 peripheral clock.
  1010. *
  1011. * @api
  1012. */
  1013. #define rccDisableTIM8() rccDisableAPB2(RCC_APB2ENR_TIM8EN)
  1014. /**
  1015. * @brief Resets the TIM8 peripheral.
  1016. *
  1017. * @api
  1018. */
  1019. #define rccResetTIM8() rccResetAPB2(RCC_APB2RSTR_TIM8RST)
  1020. /**
  1021. * @brief Enables the TIM9 peripheral clock.
  1022. *
  1023. * @param[in] lp low power enable flag
  1024. *
  1025. * @api
  1026. */
  1027. #define rccEnableTIM9(lp) rccEnableAPB2(RCC_APB2ENR_TIM9EN, lp)
  1028. /**
  1029. * @brief Disables the TIM9 peripheral clock.
  1030. *
  1031. * @api
  1032. */
  1033. #define rccDisableTIM9() rccDisableAPB2(RCC_APB2ENR_TIM9EN)
  1034. /**
  1035. * @brief Resets the TIM9 peripheral.
  1036. *
  1037. * @api
  1038. */
  1039. #define rccResetTIM9() rccResetAPB2(RCC_APB2RSTR_TIM9RST)
  1040. /**
  1041. * @brief Enables the TIM10 peripheral clock.
  1042. *
  1043. * @param[in] lp low power enable flag
  1044. *
  1045. * @api
  1046. */
  1047. #define rccEnableTIM10(lp) rccEnableAPB2(RCC_APB2ENR_TIM10EN, lp)
  1048. /**
  1049. * @brief Disables the TIM10 peripheral clock.
  1050. *
  1051. * @api
  1052. */
  1053. #define rccDisableTIM10() rccDisableAPB2(RCC_APB2ENR_TIM10EN)
  1054. /**
  1055. * @brief Resets the TIM10 peripheral.
  1056. *
  1057. * @api
  1058. */
  1059. #define rccResetTIM10() rccResetAPB2(RCC_APB2RSTR_TIM10RST)
  1060. /**
  1061. * @brief Enables the TIM11 peripheral clock.
  1062. *
  1063. * @param[in] lp low power enable flag
  1064. *
  1065. * @api
  1066. */
  1067. #define rccEnableTIM11(lp) rccEnableAPB2(RCC_APB2ENR_TIM11EN, lp)
  1068. /**
  1069. * @brief Disables the TIM11 peripheral clock.
  1070. *
  1071. * @api
  1072. */
  1073. #define rccDisableTIM11() rccDisableAPB2(RCC_APB2ENR_TIM11EN)
  1074. /**
  1075. * @brief Resets the TIM11 peripheral.
  1076. *
  1077. * @api
  1078. */
  1079. #define rccResetTIM11() rccResetAPB2(RCC_APB2RSTR_TIM11RST)
  1080. /**
  1081. * @brief Enables the TIM12 peripheral clock.
  1082. *
  1083. * @param[in] lp low power enable flag
  1084. *
  1085. * @api
  1086. */
  1087. #define rccEnableTIM12(lp) rccEnableAPB1(RCC_APB1ENR_TIM12EN, lp)
  1088. /**
  1089. * @brief Disables the TIM12 peripheral clock.
  1090. *
  1091. * @api
  1092. */
  1093. #define rccDisableTIM12() rccDisableAPB1(RCC_APB1ENR_TIM12EN)
  1094. /**
  1095. * @brief Resets the TIM12 peripheral.
  1096. *
  1097. * @api
  1098. */
  1099. #define rccResetTIM12() rccResetAPB1(RCC_APB1RSTR_TIM12RST)
  1100. /**
  1101. * @brief Enables the TIM13 peripheral clock.
  1102. *
  1103. * @param[in] lp low power enable flag
  1104. *
  1105. * @api
  1106. */
  1107. #define rccEnableTIM13(lp) rccEnableAPB1(RCC_APB1ENR_TIM13EN, lp)
  1108. /**
  1109. * @brief Disables the TIM13 peripheral clock.
  1110. *
  1111. * @api
  1112. */
  1113. #define rccDisableTIM13() rccDisableAPB1(RCC_APB1ENR_TIM13EN)
  1114. /**
  1115. * @brief Resets the TIM13 peripheral.
  1116. *
  1117. * @api
  1118. */
  1119. #define rccResetTIM13() rccResetAPB1(RCC_APB1RSTR_TIM13RST)
  1120. /**
  1121. * @brief Enables the TIM14 peripheral clock.
  1122. *
  1123. * @param[in] lp low power enable flag
  1124. *
  1125. * @api
  1126. */
  1127. #define rccEnableTIM14(lp) rccEnableAPB1(RCC_APB1ENR_TIM14EN, lp)
  1128. /**
  1129. * @brief Disables the TIM14 peripheral clock.
  1130. *
  1131. * @api
  1132. */
  1133. #define rccDisableTIM14() rccDisableAPB1(RCC_APB1ENR_TIM14EN)
  1134. /**
  1135. * @brief Resets the TIM14 peripheral.
  1136. *
  1137. * @api
  1138. */
  1139. #define rccResetTIM14() rccResetAPB1(RCC_APB1RSTR_TIM14RST)
  1140. /** @} */
  1141. /**
  1142. * @name USART/UART peripherals specific RCC operations
  1143. * @{
  1144. */
  1145. /**
  1146. * @brief Enables the USART1 peripheral clock.
  1147. *
  1148. * @param[in] lp low power enable flag
  1149. *
  1150. * @api
  1151. */
  1152. #define rccEnableUSART1(lp) rccEnableAPB2(RCC_APB2ENR_USART1EN, lp)
  1153. /**
  1154. * @brief Disables the USART1 peripheral clock.
  1155. *
  1156. * @api
  1157. */
  1158. #define rccDisableUSART1() rccDisableAPB2(RCC_APB2ENR_USART1EN)
  1159. /**
  1160. * @brief Resets the USART1 peripheral.
  1161. *
  1162. * @api
  1163. */
  1164. #define rccResetUSART1() rccResetAPB2(RCC_APB2RSTR_USART1RST)
  1165. /**
  1166. * @brief Enables the USART2 peripheral clock.
  1167. *
  1168. * @param[in] lp low power enable flag
  1169. *
  1170. * @api
  1171. */
  1172. #define rccEnableUSART2(lp) rccEnableAPB1(RCC_APB1ENR_USART2EN, lp)
  1173. /**
  1174. * @brief Disables the USART2 peripheral clock.
  1175. *
  1176. * @api
  1177. */
  1178. #define rccDisableUSART2() rccDisableAPB1(RCC_APB1ENR_USART2EN)
  1179. /**
  1180. * @brief Resets the USART2 peripheral.
  1181. *
  1182. * @api
  1183. */
  1184. #define rccResetUSART2() rccResetAPB1(RCC_APB1RSTR_USART2RST)
  1185. /**
  1186. * @brief Enables the USART3 peripheral clock.
  1187. *
  1188. * @param[in] lp low power enable flag
  1189. *
  1190. * @api
  1191. */
  1192. #define rccEnableUSART3(lp) rccEnableAPB1(RCC_APB1ENR_USART3EN, lp)
  1193. /**
  1194. * @brief Disables the USART3 peripheral clock.
  1195. *
  1196. * @api
  1197. */
  1198. #define rccDisableUSART3() rccDisableAPB1(RCC_APB1ENR_USART3EN)
  1199. /**
  1200. * @brief Resets the USART3 peripheral.
  1201. *
  1202. * @api
  1203. */
  1204. #define rccResetUSART3() rccResetAPB1(RCC_APB1RSTR_USART3RST)
  1205. /**
  1206. * @brief Enables the UART4 peripheral clock.
  1207. *
  1208. * @param[in] lp low power enable flag
  1209. *
  1210. * @api
  1211. */
  1212. #define rccEnableUART4(lp) rccEnableAPB1(RCC_APB1ENR_UART4EN, lp)
  1213. /**
  1214. * @brief Disables the UART4 peripheral clock.
  1215. *
  1216. * @api
  1217. */
  1218. #define rccDisableUART4() rccDisableAPB1(RCC_APB1ENR_UART4EN)
  1219. /**
  1220. * @brief Resets the UART4 peripheral.
  1221. *
  1222. * @api
  1223. */
  1224. #define rccResetUART4() rccResetAPB1(RCC_APB1RSTR_UART4RST)
  1225. /**
  1226. * @brief Enables the UART5 peripheral clock.
  1227. *
  1228. * @param[in] lp low power enable flag
  1229. *
  1230. * @api
  1231. */
  1232. #define rccEnableUART5(lp) rccEnableAPB1(RCC_APB1ENR_UART5EN, lp)
  1233. /**
  1234. * @brief Disables the UART5 peripheral clock.
  1235. *
  1236. * @api
  1237. */
  1238. #define rccDisableUART5() rccDisableAPB1(RCC_APB1ENR_UART5EN)
  1239. /**
  1240. * @brief Resets the UART5 peripheral.
  1241. *
  1242. * @api
  1243. */
  1244. #define rccResetUART5() rccResetAPB1(RCC_APB1RSTR_UART5RST)
  1245. /**
  1246. * @brief Enables the USART6 peripheral clock.
  1247. *
  1248. * @param[in] lp low power enable flag
  1249. *
  1250. * @api
  1251. */
  1252. #define rccEnableUSART6(lp) rccEnableAPB2(RCC_APB2ENR_USART6EN, lp)
  1253. /**
  1254. * @brief Disables the USART6 peripheral clock.
  1255. *
  1256. * @api
  1257. */
  1258. #define rccDisableUSART6() rccDisableAPB2(RCC_APB2ENR_USART6EN)
  1259. /**
  1260. * @brief Resets the USART6 peripheral.
  1261. *
  1262. * @api
  1263. */
  1264. #define rccResetUSART6() rccResetAPB2(RCC_APB2RSTR_USART6RST)
  1265. /**
  1266. * @brief Enables the UART7 peripheral clock.
  1267. *
  1268. * @param[in] lp low power enable flag
  1269. *
  1270. * @api
  1271. */
  1272. #define rccEnableUART7(lp) rccEnableAPB1(RCC_APB1ENR_UART7EN, lp)
  1273. /**
  1274. * @brief Disables the UART7 peripheral clock.
  1275. *
  1276. * @api
  1277. */
  1278. #define rccDisableUART7() rccDisableAPB1(RCC_APB1ENR_UART7EN)
  1279. /**
  1280. * @brief Resets the UART7 peripheral.
  1281. *
  1282. * @api
  1283. */
  1284. #define rccResetUART7() rccResetAPB1(RCC_APB1RSTR_UART7RST)
  1285. /**
  1286. * @brief Enables the UART8 peripheral clock.
  1287. *
  1288. * @param[in] lp low power enable flag
  1289. *
  1290. * @api
  1291. */
  1292. #define rccEnableUART8(lp) rccEnableAPB1(RCC_APB1ENR_UART8EN, lp)
  1293. /**
  1294. * @brief Disables the UART8 peripheral clock.
  1295. *
  1296. * @api
  1297. */
  1298. #define rccDisableUART8() rccDisableAPB1(RCC_APB1ENR_UART8EN)
  1299. /**
  1300. * @brief Resets the UART8 peripheral.
  1301. *
  1302. * @api
  1303. */
  1304. #define rccResetUART8() rccResetAPB1(RCC_APB1RSTR_UART8RST)
  1305. /** @} */
  1306. /**
  1307. * @name LTDC peripheral specific RCC operations
  1308. * @{
  1309. */
  1310. /**
  1311. * @brief Enables the LTDC peripheral clock.
  1312. *
  1313. * @param[in] lp low power enable flag
  1314. *
  1315. * @api
  1316. */
  1317. #define rccEnableLTDC(lp) rccEnableAPB2(RCC_APB2ENR_LTDCEN, lp)
  1318. /**
  1319. * @brief Disables the LTDC peripheral clock.
  1320. *
  1321. * @api
  1322. */
  1323. #define rccDisableLTDC() rccDisableAPB2(RCC_APB2ENR_LTDCEN)
  1324. /**
  1325. * @brief Resets the LTDC peripheral.
  1326. *
  1327. * @api
  1328. */
  1329. #define rccResetLTDC() rccResetAPB2(RCC_APB2RSTR_LTDCRST)
  1330. /** @} */
  1331. /**
  1332. * @name DMA2D peripheral specific RCC operations
  1333. * @{
  1334. */
  1335. /**
  1336. * @brief Enables the DMA2D peripheral clock.
  1337. *
  1338. * @param[in] lp low power enable flag
  1339. *
  1340. * @api
  1341. */
  1342. #define rccEnableDMA2D(lp) rccEnableAHB1(RCC_AHB1ENR_DMA2DEN, lp)
  1343. /**
  1344. * @brief Disables the DMA2D peripheral clock.
  1345. *
  1346. * @api
  1347. */
  1348. #define rccDisableDMA2D() rccDisableAHB1(RCC_AHB1ENR_DMA2DEN)
  1349. /**
  1350. * @brief Resets the DMA2D peripheral.
  1351. *
  1352. * @api
  1353. */
  1354. #define rccResetDMA2D() rccResetAHB1(RCC_AHB1RSTR_DMA2DRST)
  1355. /** @} */
  1356. /**
  1357. * @name CRC peripheral specific RCC operations
  1358. * @{
  1359. */
  1360. /**
  1361. * @brief Enables the CRC peripheral clock.
  1362. *
  1363. * @param[in] lp low power enable flag
  1364. *
  1365. * @api
  1366. */
  1367. #define rccEnableCRC(lp) rccEnableAHB1(RCC_AHB1ENR_CRCEN, lp)
  1368. /**
  1369. * @brief Disables the CRC peripheral clock.
  1370. *
  1371. * @api
  1372. */
  1373. #define rccDisableCRC() rccDisableAHB1(RCC_AHB1ENR_CRCEN)
  1374. /**
  1375. * @brief Resets the CRC peripheral.
  1376. *
  1377. * @api
  1378. */
  1379. #define rccResetCRC() rccResetAHB1(RCC_AHB1RSTR_CRCRST)
  1380. /** @} */
  1381. /**
  1382. * @name HASH peripheral specific RCC operations
  1383. * @{
  1384. */
  1385. /**
  1386. * @brief Enables the CRYP peripheral clock.
  1387. *
  1388. * @param[in] lp low power enable flag
  1389. *
  1390. * @api
  1391. */
  1392. #define rccEnableCRYP(lp) rccEnableAHB2(RCC_AHB2ENR_CRYPEN, lp)
  1393. /**
  1394. * @brief Disables the CRYP peripheral clock.
  1395. *
  1396. * @api
  1397. */
  1398. #define rccDisableCRYP() rccDisableAHB2(RCC_AHB2ENR_CRYPEN)
  1399. /**
  1400. * @brief Resets the CRYP peripheral.
  1401. *
  1402. * @api
  1403. */
  1404. #define rccResetCRYP() rccResetAHB2(RCC_AHB2RSTR_CRYPRST)
  1405. /** @} */
  1406. /**
  1407. * @name HASH peripheral specific RCC operations
  1408. * @{
  1409. */
  1410. /**
  1411. * @brief Enables the HASH peripheral clock.
  1412. *
  1413. * @param[in] lp low power enable flag
  1414. *
  1415. * @api
  1416. */
  1417. #define rccEnableHASH(lp) rccEnableAHB2(RCC_AHB2ENR_HASHEN, lp)
  1418. /**
  1419. * @brief Disables the HASH peripheral clock.
  1420. *
  1421. * @api
  1422. */
  1423. #define rccDisableHASH() rccDisableAHB2(RCC_AHB2ENR_HASHEN)
  1424. /**
  1425. * @brief Resets the HASH peripheral.
  1426. *
  1427. * @api
  1428. */
  1429. #define rccResetHASH() rccResetAHB2(RCC_AHB2RSTR_HASHRST)
  1430. /** @} */
  1431. /**
  1432. * @name FSMC peripherals specific RCC operations
  1433. * @{
  1434. */
  1435. /**
  1436. * @brief Enables the FSMC peripheral clock.
  1437. *
  1438. * @param[in] lp low power enable flag
  1439. *
  1440. * @api
  1441. */
  1442. #if defined(STM32_FSMC_IS_FMC)
  1443. #define rccEnableFSMC(lp) rccEnableAHB3(RCC_AHB3ENR_FMCEN, lp)
  1444. #else
  1445. #define rccEnableFSMC(lp) rccEnableAHB3(RCC_AHB3ENR_FSMCEN, lp)
  1446. #endif
  1447. /**
  1448. * @brief Disables the FSMC peripheral clock.
  1449. *
  1450. * @api
  1451. */
  1452. #if defined(STM32_FSMC_IS_FMC)
  1453. #define rccDisableFSMC() rccDisableAHB3(RCC_AHB3ENR_FMCEN)
  1454. #else
  1455. #define rccDisableFSMC() rccDisableAHB3(RCC_AHB3ENR_FSMCEN)
  1456. #endif
  1457. /**
  1458. * @brief Resets the FSMC peripheral.
  1459. *
  1460. * @api
  1461. */
  1462. #if defined(STM32_FSMC_IS_FMC)
  1463. #define rccResetFSMC() rccResetAHB3(RCC_AHB3RSTR_FMCRST)
  1464. #else
  1465. #define rccResetFSMC() rccResetAHB3(RCC_AHB3RSTR_FSMCRST)
  1466. #endif
  1467. /** @} */
  1468. /*===========================================================================*/
  1469. /* External declarations. */
  1470. /*===========================================================================*/
  1471. #ifdef __cplusplus
  1472. extern "C" {
  1473. #endif
  1474. #ifdef __cplusplus
  1475. }
  1476. #endif
  1477. #endif /* STM32_RCC_H */
  1478. /** @} */