stm32_rcc.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791
  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 STM32L0xx/stm32_rcc.h
  15. * @brief RCC helper driver header.
  16. * @note This file requires definitions from the ST header file
  17. * @p stm32l0xx.h.
  18. *
  19. * @addtogroup STM32L1xx_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->APB1SMENR |= (mask); \
  55. else \
  56. RCC->APB1SMENR &= ~(mask); \
  57. (void)RCC->APB1SMENR; \
  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->APB1SMENR &= ~(mask); \
  69. (void)RCC->APB1SMENR; \
  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->APB2SMENR |= (mask); \
  95. else \
  96. RCC->APB2SMENR &= ~(mask); \
  97. (void)RCC->APB2SMENR; \
  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->APB2SMENR &= ~(mask); \
  109. (void)RCC->APB2SMENR; \
  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 AHB bus.
  125. *
  126. * @param[in] mask AHB peripherals mask
  127. * @param[in] lp low power enable flag
  128. *
  129. * @api
  130. */
  131. #define rccEnableAHB(mask, lp) { \
  132. RCC->AHBENR |= (mask); \
  133. if (lp) \
  134. RCC->AHBSMENR |= (mask); \
  135. else \
  136. RCC->AHBSMENR &= ~(mask); \
  137. (void)RCC->AHBSMENR; \
  138. }
  139. /**
  140. * @brief Disables the clock of one or more peripheral on the AHB bus.
  141. *
  142. * @param[in] mask AHB peripherals mask
  143. *
  144. * @api
  145. */
  146. #define rccDisableAHB(mask) { \
  147. RCC->AHBENR &= ~(mask); \
  148. RCC->AHBSMENR &= ~(mask); \
  149. (void)RCC->AHBSMENR; \
  150. }
  151. /**
  152. * @brief Resets one or more peripheral on the AHB bus.
  153. *
  154. * @param[in] mask AHB peripherals mask
  155. *
  156. * @api
  157. */
  158. #define rccResetAHB(mask) { \
  159. RCC->AHBRSTR |= (mask); \
  160. RCC->AHBRSTR &= ~(mask); \
  161. (void)RCC->AHBRSTR; \
  162. }
  163. /**
  164. * @brief Enables the clock of one or more peripheral on the IOP bus.
  165. *
  166. * @param[in] mask IOP peripherals mask
  167. * @param[in] lp low power enable flag
  168. *
  169. * @api
  170. */
  171. #define rccEnableIOP(mask, lp) { \
  172. RCC->IOPENR |= (mask); \
  173. if (lp) \
  174. RCC->IOPSMENR |= (mask); \
  175. else \
  176. RCC->IOPSMENR &= ~(mask); \
  177. (void)RCC->IOPSMENR; \
  178. }
  179. /**
  180. * @brief Disables the clock of one or more peripheral on the IOP bus.
  181. *
  182. * @param[in] mask IOP peripherals mask
  183. *
  184. * @api
  185. */
  186. #define rccDisableIOP(mask) { \
  187. RCC->IOPENR &= ~(mask); \
  188. RCC->IOPSMENR &= ~(mask); \
  189. (void)RCC->IOPSMENR; \
  190. }
  191. /**
  192. * @brief Resets one or more peripheral on the IOP bus.
  193. *
  194. * @param[in] mask IOP peripherals mask
  195. *
  196. * @api
  197. */
  198. #define rccResetIOP(mask) { \
  199. RCC->IOPRSTR |= (mask); \
  200. RCC->IOPRSTR &= ~(mask); \
  201. (void)RCC->IOPRSTR; \
  202. }
  203. /** @} */
  204. /**
  205. * @name ADC peripherals specific RCC operations
  206. * @{
  207. */
  208. /**
  209. * @brief Enables the ADC1 peripheral clock.
  210. *
  211. * @param[in] lp low power enable flag
  212. *
  213. * @api
  214. */
  215. #define rccEnableADC1(lp) rccEnableAPB2(RCC_APB2ENR_ADC1EN, lp)
  216. /**
  217. * @brief Disables the ADC1 peripheral clock.
  218. *
  219. * @api
  220. */
  221. #define rccDisableADC1() rccDisableAPB2(RCC_APB2ENR_ADC1EN)
  222. /**
  223. * @brief Resets the ADC1 peripheral.
  224. *
  225. * @api
  226. */
  227. #define rccResetADC1() rccResetAPB2(RCC_APB2RSTR_ADC1RST)
  228. /** @} */
  229. /**
  230. * @name DAC peripheral specific RCC operations
  231. * @{
  232. */
  233. /**
  234. * @brief Enables the DAC1 peripheral clock.
  235. *
  236. * @param[in] lp low power enable flag
  237. *
  238. * @api
  239. */
  240. #define rccEnableDAC1(lp) rccEnableAPB1(RCC_APB1ENR_DACEN, lp)
  241. /**
  242. * @brief Disables the DAC1 peripheral clock.
  243. *
  244. * @api
  245. */
  246. #define rccDisableDAC1() rccDisableAPB1(RCC_APB1ENR_DACEN)
  247. /**
  248. * @brief Resets the DAC1 peripheral.
  249. *
  250. * @api
  251. */
  252. #define rccResetDAC1() rccResetAPB1(RCC_APB1RSTR_DACRST)
  253. /** @} */
  254. /**
  255. * @name DMA peripheral specific RCC operations
  256. * @{
  257. */
  258. /**
  259. * @brief Enables the DMA1 peripheral clock.
  260. *
  261. * @param[in] lp low power enable flag
  262. *
  263. * @api
  264. */
  265. #define rccEnableDMA1(lp) rccEnableAHB(RCC_AHBENR_DMA1EN, lp)
  266. /**
  267. * @brief Disables the DMA1 peripheral clock.
  268. *
  269. * @api
  270. */
  271. #define rccDisableDMA1() rccDisableAHB(RCC_AHBENR_DMA1EN)
  272. /**
  273. * @brief Resets the DMA1 peripheral.
  274. *
  275. * @api
  276. */
  277. #define rccResetDMA1() rccResetAHB(RCC_AHBRSTR_DMA1RST)
  278. /** @} */
  279. /**
  280. * @name PWR interface specific RCC operations
  281. * @{
  282. */
  283. /**
  284. * @brief Enables the PWR interface clock.
  285. *
  286. * @param[in] lp low power enable flag
  287. *
  288. * @api
  289. */
  290. #define rccEnablePWRInterface(lp) rccEnableAPB1(RCC_APB1ENR_PWREN, lp)
  291. /**
  292. * @brief Disables PWR interface clock.
  293. *
  294. * @api
  295. */
  296. #define rccDisablePWRInterface() rccDisableAPB1(RCC_APB1ENR_PWREN)
  297. /**
  298. * @brief Resets the PWR interface.
  299. *
  300. * @api
  301. */
  302. #define rccResetPWRInterface() rccResetAPB1(RCC_APB1RSTR_PWRRST)
  303. /** @} */
  304. /**
  305. * @name I2C peripherals specific RCC operations
  306. * @{
  307. */
  308. /**
  309. * @brief Enables the I2C1 peripheral clock.
  310. *
  311. * @param[in] lp low power enable flag
  312. *
  313. * @api
  314. */
  315. #define rccEnableI2C1(lp) rccEnableAPB1(RCC_APB1ENR_I2C1EN, lp)
  316. /**
  317. * @brief Disables the I2C1 peripheral clock.
  318. *
  319. * @api
  320. */
  321. #define rccDisableI2C1() rccDisableAPB1(RCC_APB1ENR_I2C1EN)
  322. /**
  323. * @brief Resets the I2C1 peripheral.
  324. *
  325. * @api
  326. */
  327. #define rccResetI2C1() rccResetAPB1(RCC_APB1RSTR_I2C1RST)
  328. /**
  329. * @brief Enables the I2C2 peripheral clock.
  330. *
  331. * @param[in] lp low power enable flag
  332. *
  333. * @api
  334. */
  335. #define rccEnableI2C2(lp) rccEnableAPB1(RCC_APB1ENR_I2C2EN, lp)
  336. /**
  337. * @brief Disables the I2C2 peripheral clock.
  338. *
  339. * @api
  340. */
  341. #define rccDisableI2C2() rccDisableAPB1(RCC_APB1ENR_I2C2EN)
  342. /**
  343. * @brief Resets the I2C2 peripheral.
  344. *
  345. * @api
  346. */
  347. #define rccResetI2C2() rccResetAPB1(RCC_APB1RSTR_I2C2RST)
  348. /**
  349. * @brief Enables the I2C3 peripheral clock.
  350. *
  351. * @param[in] lp low power enable flag
  352. *
  353. * @api
  354. */
  355. #define rccEnableI2C3(lp) rccEnableAPB1(RCC_APB1ENR_I2C3EN, lp)
  356. /**
  357. * @brief Disables the I2C3 peripheral clock.
  358. *
  359. * @api
  360. */
  361. #define rccDisableI2C3() rccDisableAPB1(RCC_APB1ENR_I2C3EN)
  362. /**
  363. * @brief Resets the I2C3 peripheral.
  364. *
  365. * @api
  366. */
  367. #define rccResetI2C3() rccResetAPB1(RCC_APB1RSTR_I2C3RST)
  368. /** @} */
  369. /**
  370. * @name SPI peripherals specific RCC operations
  371. * @{
  372. */
  373. /**
  374. * @brief Enables the SPI1 peripheral clock.
  375. *
  376. * @param[in] lp low power enable flag
  377. *
  378. * @api
  379. */
  380. #define rccEnableSPI1(lp) rccEnableAPB2(RCC_APB2ENR_SPI1EN, lp)
  381. /**
  382. * @brief Disables the SPI1 peripheral clock.
  383. *
  384. * @api
  385. */
  386. #define rccDisableSPI1() rccDisableAPB2(RCC_APB2ENR_SPI1EN)
  387. /**
  388. * @brief Resets the SPI1 peripheral.
  389. *
  390. * @api
  391. */
  392. #define rccResetSPI1() rccResetAPB2(RCC_APB2RSTR_SPI1RST)
  393. /**
  394. * @brief Enables the SPI2 peripheral clock.
  395. *
  396. * @param[in] lp low power enable flag
  397. *
  398. * @api
  399. */
  400. #define rccEnableSPI2(lp) rccEnableAPB1(RCC_APB1ENR_SPI2EN, lp)
  401. /**
  402. * @brief Disables the SPI2 peripheral clock.
  403. *
  404. * @api
  405. */
  406. #define rccDisableSPI2() rccDisableAPB1(RCC_APB1ENR_SPI2EN)
  407. /**
  408. * @brief Resets the SPI2 peripheral.
  409. *
  410. * @api
  411. */
  412. #define rccResetSPI2() rccResetAPB1(RCC_APB1RSTR_SPI2RST)
  413. /** @} */
  414. /**
  415. * @name TIM peripherals specific RCC operations
  416. * @{
  417. */
  418. /**
  419. * @brief Enables the TIM2 peripheral clock.
  420. *
  421. * @param[in] lp low power enable flag
  422. *
  423. * @api
  424. */
  425. #define rccEnableTIM2(lp) rccEnableAPB1(RCC_APB1ENR_TIM2EN, lp)
  426. /**
  427. * @brief Disables the TIM2 peripheral clock.
  428. *
  429. * @api
  430. */
  431. #define rccDisableTIM2() rccDisableAPB1(RCC_APB1ENR_TIM2EN)
  432. /**
  433. * @brief Resets the TIM2 peripheral.
  434. *
  435. * @api
  436. */
  437. #define rccResetTIM2() rccResetAPB1(RCC_APB1RSTR_TIM2RST)
  438. /**
  439. * @brief Enables the TIM3 peripheral clock.
  440. *
  441. * @param[in] lp low power enable flag
  442. *
  443. * @api
  444. */
  445. #define rccEnableTIM3(lp) rccEnableAPB1(RCC_APB1ENR_TIM3EN, lp)
  446. /**
  447. * @brief Disables the TIM3 peripheral clock.
  448. *
  449. * @api
  450. */
  451. #define rccDisableTIM3() rccDisableAPB1(RCC_APB1ENR_TIM3EN)
  452. /**
  453. * @brief Resets the TIM3 peripheral.
  454. *
  455. * @api
  456. */
  457. #define rccResetTIM3() rccResetAPB1(RCC_APB1RSTR_TIM3RST)
  458. /**
  459. * @brief Enables the TIM6 peripheral clock.
  460. *
  461. * @param[in] lp low power enable flag
  462. *
  463. * @api
  464. */
  465. #define rccEnableTIM6(lp) rccEnableAPB1(RCC_APB1ENR_TIM6EN, lp)
  466. /**
  467. * @brief Disables the TIM6 peripheral clock.
  468. *
  469. * @api
  470. */
  471. #define rccDisableTIM6() rccDisableAPB1(RCC_APB1ENR_TIM6EN)
  472. /**
  473. * @brief Resets the TIM6 peripheral.
  474. *
  475. * @api
  476. */
  477. #define rccResetTIM6() rccResetAPB1(RCC_APB1RSTR_TIM6RST)
  478. /**
  479. * @brief Enables the TIM7 peripheral clock.
  480. *
  481. * @param[in] lp low power enable flag
  482. *
  483. * @api
  484. */
  485. #define rccEnableTIM7(lp) rccEnableAPB1(RCC_APB1ENR_TIM7EN, lp)
  486. /**
  487. * @brief Disables the TIM7 peripheral clock.
  488. *
  489. * @api
  490. */
  491. #define rccDisableTIM7() rccDisableAPB1(RCC_APB1ENR_TIM7EN)
  492. /**
  493. * @brief Resets the TIM7 peripheral.
  494. *
  495. * @api
  496. */
  497. #define rccResetTIM7() rccResetAPB1(RCC_APB1RSTR_TIM7RST)
  498. /**
  499. * @brief Enables the TIM21 peripheral clock.
  500. *
  501. * @param[in] lp low power enable flag
  502. *
  503. * @api
  504. */
  505. #define rccEnableTIM21(lp) rccEnableAPB2(RCC_APB2ENR_TIM21EN, lp)
  506. /**
  507. * @brief Disables the TIM21 peripheral clock.
  508. *
  509. * @api
  510. */
  511. #define rccDisableTIM21() rccDisableAPB2(RCC_APB2ENR_TIM21EN)
  512. /**
  513. * @brief Resets the TIM21 peripheral.
  514. *
  515. * @api
  516. */
  517. #define rccResetTIM21() rccResetAPB2(RCC_APB2RSTR_TIM21RST)
  518. /**
  519. * @brief Enables the TIM22 peripheral clock.
  520. *
  521. * @param[in] lp low power enable flag
  522. *
  523. * @api
  524. */
  525. #define rccEnableTIM22(lp) rccEnableAPB2(RCC_APB2ENR_TIM22EN, lp)
  526. /**
  527. * @brief Disables the TIM22 peripheral clock.
  528. *
  529. * @api
  530. */
  531. #define rccDisableTIM22() rccDisableAPB2(RCC_APB2ENR_TIM22EN)
  532. /**
  533. * @brief Resets the TIM22 peripheral.
  534. *
  535. * @api
  536. */
  537. #define rccResetTIM22() rccResetAPB2(RCC_APB2RSTR_TIM22RST)
  538. /** @} */
  539. /**
  540. * @name USART/UART peripherals specific RCC operations
  541. * @{
  542. */
  543. /**
  544. * @brief Enables the USART1 peripheral clock.
  545. *
  546. * @param[in] lp low power enable flag
  547. *
  548. * @api
  549. */
  550. #define rccEnableUSART1(lp) rccEnableAPB2(RCC_APB2ENR_USART1EN, lp)
  551. /**
  552. * @brief Disables the USART1 peripheral clock.
  553. *
  554. * @api
  555. */
  556. #define rccDisableUSART1() rccDisableAPB2(RCC_APB2ENR_USART1EN)
  557. /**
  558. * @brief Resets the USART1 peripheral.
  559. *
  560. * @api
  561. */
  562. #define rccResetUSART1() rccResetAPB2(RCC_APB2RSTR_USART1RST)
  563. /**
  564. * @brief Enables the USART2 peripheral clock.
  565. *
  566. * @param[in] lp low power enable flag
  567. *
  568. * @api
  569. */
  570. #define rccEnableUSART2(lp) rccEnableAPB1(RCC_APB1ENR_USART2EN, lp)
  571. /**
  572. * @brief Disables the USART2 peripheral clock.
  573. *
  574. * @api
  575. */
  576. #define rccDisableUSART2() rccDisableAPB1(RCC_APB1ENR_USART2EN)
  577. /**
  578. * @brief Resets the USART2 peripheral.
  579. *
  580. * @api
  581. */
  582. #define rccResetUSART2() rccResetAPB1(RCC_APB1RSTR_USART2RST)
  583. /**
  584. * @brief Enables the USART3 peripheral clock.
  585. *
  586. * @param[in] lp low power enable flag
  587. *
  588. * @api
  589. */
  590. #define rccEnableUSART3(lp) rccEnableAPB1(RCC_APB1ENR_USART3EN, lp)
  591. /**
  592. * @brief Disables the USART3 peripheral clock.
  593. *
  594. * @api
  595. */
  596. #define rccDisableUSART3() rccDisableAPB1(RCC_APB1ENR_USART3EN)
  597. /**
  598. * @brief Resets the USART3 peripheral.
  599. *
  600. * @api
  601. */
  602. #define rccResetUSART3() rccResetAPB1(RCC_APB1RSTR_USART3RST)
  603. /**
  604. * @brief Enables the UART4 peripheral clock.
  605. *
  606. * @param[in] lp low power enable flag
  607. *
  608. * @api
  609. */
  610. #define rccEnableUART4(lp) rccEnableAPB1(RCC_APB1ENR_USART4EN, lp)
  611. /**
  612. * @brief Disables the UART4 peripheral clock.
  613. *
  614. * @api
  615. */
  616. #define rccDisableUART4() rccDisableAPB1(RCC_APB1ENR_USART4EN)
  617. /**
  618. * @brief Resets the UART4 peripheral.
  619. *
  620. * @api
  621. */
  622. #define rccResetUART4() rccResetAPB1(RCC_APB1ENR_USART4EN)
  623. /**
  624. * @brief Enables the UART5 peripheral clock.
  625. *
  626. * @param[in] lp low power enable flag
  627. *
  628. * @api
  629. */
  630. #define rccEnableUART5(lp) rccEnableAPB1(RCC_APB1ENR_USART5EN, lp)
  631. /**
  632. * @brief Disables the UART5 peripheral clock.
  633. *
  634. * @api
  635. */
  636. #define rccDisableUART5() rccDisableAPB1(RCC_APB1ENR_USART5EN)
  637. /**
  638. * @brief Resets the UART5 peripheral.
  639. *
  640. * @api
  641. */
  642. #define rccResetUART5() rccResetAPB1(RCC_APB1ENR_USART5EN)
  643. /**
  644. * @brief Enables the LPUART1 peripheral clock.
  645. *
  646. * @param[in] lp low power enable flag
  647. *
  648. * @api
  649. */
  650. #define rccEnableLPUART1(lp) rccEnableAPB1(RCC_APB1ENR_LPUART1EN, lp)
  651. /**
  652. * @brief Disables the LPUART1 peripheral clock.
  653. *
  654. * @api
  655. */
  656. #define rccDisableLPUART1() rccDisableAPB1(RCC_APB1ENR_LPUART1EN)
  657. /**
  658. * @brief Resets the USART1 peripheral.
  659. *
  660. * @api
  661. */
  662. #define rccResetLPUART1() rccResetAPB1(RCC_APB1RSTR_LPUART1RST)
  663. /** @} */
  664. /**
  665. * @name USB peripheral specific RCC operations
  666. * @{
  667. */
  668. /**
  669. * @brief Enables the USB peripheral clock.
  670. *
  671. * @param[in] lp low power enable flag
  672. *
  673. * @api
  674. */
  675. #define rccEnableUSB(lp) rccEnableAPB1(RCC_APB1ENR_USBEN, lp)
  676. /**
  677. * @brief Disables the USB peripheral clock.
  678. *
  679. * @api
  680. */
  681. #define rccDisableUSB() rccDisableAPB1(RCC_APB1ENR_USBEN)
  682. /**
  683. * @brief Resets the USB peripheral.
  684. *
  685. * @api
  686. */
  687. #define rccResetUSB() rccResetAPB1(RCC_APB1RSTR_USBRST)
  688. /** @} */
  689. /*===========================================================================*/
  690. /* External declarations. */
  691. /*===========================================================================*/
  692. #ifdef __cplusplus
  693. extern "C" {
  694. #endif
  695. #ifdef __cplusplus
  696. }
  697. #endif
  698. #endif /* STM32_RCC_H */
  699. /** @} */