stm32g0xx_ll_usart.c 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  1. /**
  2. ******************************************************************************
  3. * @file stm32g0xx_ll_usart.c
  4. * @author MCD Application Team
  5. * @brief USART LL module driver.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * Copyright (c) 2018 STMicroelectronics.
  10. * All rights reserved.
  11. *
  12. * This software is licensed under terms that can be found in the LICENSE file
  13. * in the root directory of this software component.
  14. * If no LICENSE file comes with this software, it is provided AS-IS.
  15. *
  16. ******************************************************************************
  17. */
  18. #if defined(USE_FULL_LL_DRIVER)
  19. /* Includes ------------------------------------------------------------------*/
  20. #include "stm32g0xx_ll_usart.h"
  21. #include "stm32g0xx_ll_rcc.h"
  22. #include "stm32g0xx_ll_bus.h"
  23. #ifdef USE_FULL_ASSERT
  24. #include "stm32_assert.h"
  25. #else
  26. #define assert_param(expr) ((void)0U)
  27. #endif /* USE_FULL_ASSERT */
  28. /** @addtogroup STM32G0xx_LL_Driver
  29. * @{
  30. */
  31. #if defined(USART1) || defined(USART2) || defined(USART3) || defined(USART4) || defined(USART5) || defined(USART6)
  32. /** @addtogroup USART_LL
  33. * @{
  34. */
  35. /* Private types -------------------------------------------------------------*/
  36. /* Private variables ---------------------------------------------------------*/
  37. /* Private constants ---------------------------------------------------------*/
  38. /** @addtogroup USART_LL_Private_Constants
  39. * @{
  40. */
  41. /* Definition of default baudrate value used for USART initialisation */
  42. #define USART_DEFAULT_BAUDRATE (9600U)
  43. /**
  44. * @}
  45. */
  46. /* Private macros ------------------------------------------------------------*/
  47. /** @addtogroup USART_LL_Private_Macros
  48. * @{
  49. */
  50. #define IS_LL_USART_PRESCALER(__VALUE__) (((__VALUE__) == LL_USART_PRESCALER_DIV1) \
  51. || ((__VALUE__) == LL_USART_PRESCALER_DIV2) \
  52. || ((__VALUE__) == LL_USART_PRESCALER_DIV4) \
  53. || ((__VALUE__) == LL_USART_PRESCALER_DIV6) \
  54. || ((__VALUE__) == LL_USART_PRESCALER_DIV8) \
  55. || ((__VALUE__) == LL_USART_PRESCALER_DIV10) \
  56. || ((__VALUE__) == LL_USART_PRESCALER_DIV12) \
  57. || ((__VALUE__) == LL_USART_PRESCALER_DIV16) \
  58. || ((__VALUE__) == LL_USART_PRESCALER_DIV32) \
  59. || ((__VALUE__) == LL_USART_PRESCALER_DIV64) \
  60. || ((__VALUE__) == LL_USART_PRESCALER_DIV128) \
  61. || ((__VALUE__) == LL_USART_PRESCALER_DIV256))
  62. /* __BAUDRATE__ The maximum Baud Rate is derived from the maximum clock available
  63. * divided by the smallest oversampling used on the USART (i.e. 8) */
  64. #define IS_LL_USART_BAUDRATE(__BAUDRATE__) ((__BAUDRATE__) <= 8000000U)
  65. /* __VALUE__ In case of oversampling by 16 and 8, BRR content must be greater than or equal to 16d. */
  66. #define IS_LL_USART_BRR_MIN(__VALUE__) ((__VALUE__) >= 16U)
  67. #define IS_LL_USART_DIRECTION(__VALUE__) (((__VALUE__) == LL_USART_DIRECTION_NONE) \
  68. || ((__VALUE__) == LL_USART_DIRECTION_RX) \
  69. || ((__VALUE__) == LL_USART_DIRECTION_TX) \
  70. || ((__VALUE__) == LL_USART_DIRECTION_TX_RX))
  71. #define IS_LL_USART_PARITY(__VALUE__) (((__VALUE__) == LL_USART_PARITY_NONE) \
  72. || ((__VALUE__) == LL_USART_PARITY_EVEN) \
  73. || ((__VALUE__) == LL_USART_PARITY_ODD))
  74. #define IS_LL_USART_DATAWIDTH(__VALUE__) (((__VALUE__) == LL_USART_DATAWIDTH_7B) \
  75. || ((__VALUE__) == LL_USART_DATAWIDTH_8B) \
  76. || ((__VALUE__) == LL_USART_DATAWIDTH_9B))
  77. #define IS_LL_USART_OVERSAMPLING(__VALUE__) (((__VALUE__) == LL_USART_OVERSAMPLING_16) \
  78. || ((__VALUE__) == LL_USART_OVERSAMPLING_8))
  79. #define IS_LL_USART_LASTBITCLKOUTPUT(__VALUE__) (((__VALUE__) == LL_USART_LASTCLKPULSE_NO_OUTPUT) \
  80. || ((__VALUE__) == LL_USART_LASTCLKPULSE_OUTPUT))
  81. #define IS_LL_USART_CLOCKPHASE(__VALUE__) (((__VALUE__) == LL_USART_PHASE_1EDGE) \
  82. || ((__VALUE__) == LL_USART_PHASE_2EDGE))
  83. #define IS_LL_USART_CLOCKPOLARITY(__VALUE__) (((__VALUE__) == LL_USART_POLARITY_LOW) \
  84. || ((__VALUE__) == LL_USART_POLARITY_HIGH))
  85. #define IS_LL_USART_CLOCKOUTPUT(__VALUE__) (((__VALUE__) == LL_USART_CLOCK_DISABLE) \
  86. || ((__VALUE__) == LL_USART_CLOCK_ENABLE))
  87. #define IS_LL_USART_STOPBITS(__VALUE__) (((__VALUE__) == LL_USART_STOPBITS_0_5) \
  88. || ((__VALUE__) == LL_USART_STOPBITS_1) \
  89. || ((__VALUE__) == LL_USART_STOPBITS_1_5) \
  90. || ((__VALUE__) == LL_USART_STOPBITS_2))
  91. #define IS_LL_USART_HWCONTROL(__VALUE__) (((__VALUE__) == LL_USART_HWCONTROL_NONE) \
  92. || ((__VALUE__) == LL_USART_HWCONTROL_RTS) \
  93. || ((__VALUE__) == LL_USART_HWCONTROL_CTS) \
  94. || ((__VALUE__) == LL_USART_HWCONTROL_RTS_CTS))
  95. /**
  96. * @}
  97. */
  98. /* Private function prototypes -----------------------------------------------*/
  99. /* Exported functions --------------------------------------------------------*/
  100. /** @addtogroup USART_LL_Exported_Functions
  101. * @{
  102. */
  103. /** @addtogroup USART_LL_EF_Init
  104. * @{
  105. */
  106. /**
  107. * @brief De-initialize USART registers (Registers restored to their default values).
  108. * @param USARTx USART Instance
  109. * @retval An ErrorStatus enumeration value:
  110. * - SUCCESS: USART registers are de-initialized
  111. * - ERROR: USART registers are not de-initialized
  112. */
  113. ErrorStatus LL_USART_DeInit(const USART_TypeDef *USARTx)
  114. {
  115. ErrorStatus status = SUCCESS;
  116. /* Check the parameters */
  117. assert_param(IS_UART_INSTANCE(USARTx));
  118. if (USARTx == USART1)
  119. {
  120. /* Force reset of USART clock */
  121. LL_APB2_GRP1_ForceReset(LL_APB2_GRP1_PERIPH_USART1);
  122. /* Release reset of USART clock */
  123. LL_APB2_GRP1_ReleaseReset(LL_APB2_GRP1_PERIPH_USART1);
  124. }
  125. else if (USARTx == USART2)
  126. {
  127. /* Force reset of USART clock */
  128. LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_USART2);
  129. /* Release reset of USART clock */
  130. LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_USART2);
  131. }
  132. #if defined(USART3)
  133. else if (USARTx == USART3)
  134. {
  135. /* Force reset of USART clock */
  136. LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_USART3);
  137. /* Release reset of USART clock */
  138. LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_USART3);
  139. }
  140. #endif /* USART3 */
  141. #if defined(USART4)
  142. else if (USARTx == USART4)
  143. {
  144. /* Force reset of USART clock */
  145. LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_USART4);
  146. /* Release reset of USART clock */
  147. LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_USART4);
  148. }
  149. #endif /* USART4 */
  150. #if defined(USART5)
  151. else if (USARTx == USART5)
  152. {
  153. /* Force reset of USART clock */
  154. LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_USART5);
  155. /* Release reset of USART clock */
  156. LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_USART5);
  157. }
  158. #endif /* USART5 */
  159. #if defined(USART6)
  160. else if (USARTx == USART6)
  161. {
  162. /* Force reset of USART clock */
  163. LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_USART6);
  164. /* Release reset of USART clock */
  165. LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_USART6);
  166. }
  167. #endif /* USART6 */
  168. else
  169. {
  170. status = ERROR;
  171. }
  172. return (status);
  173. }
  174. /**
  175. * @brief Initialize USART registers according to the specified
  176. * parameters in USART_InitStruct.
  177. * @note As some bits in USART configuration registers can only be written when
  178. * the USART is disabled (USART_CR1_UE bit =0), USART Peripheral should be in disabled state prior calling
  179. * this function. Otherwise, ERROR result will be returned.
  180. * @note Baud rate value stored in USART_InitStruct BaudRate field, should be valid (different from 0).
  181. * @param USARTx USART Instance
  182. * @param USART_InitStruct pointer to a LL_USART_InitTypeDef structure
  183. * that contains the configuration information for the specified USART peripheral.
  184. * @retval An ErrorStatus enumeration value:
  185. * - SUCCESS: USART registers are initialized according to USART_InitStruct content
  186. * - ERROR: Problem occurred during USART Registers initialization
  187. */
  188. ErrorStatus LL_USART_Init(USART_TypeDef *USARTx, const LL_USART_InitTypeDef *USART_InitStruct)
  189. {
  190. ErrorStatus status = ERROR;
  191. uint32_t periphclk = LL_RCC_PERIPH_FREQUENCY_NO;
  192. #if !defined(RCC_CCIPR_USART3SEL)&&!defined(RCC_CCIPR_USART4SEL)||(!defined(RCC_CCIPR_USART2SEL))||!defined(RCC_CCIPR_USART5SEL)||!defined(RCC_CCIPR_USART6SEL)
  193. LL_RCC_ClocksTypeDef RCC_Clocks;
  194. #endif /* USART clock selection flags */
  195. /* Check the parameters */
  196. assert_param(IS_UART_INSTANCE(USARTx));
  197. assert_param(IS_LL_USART_PRESCALER(USART_InitStruct->PrescalerValue));
  198. assert_param(IS_LL_USART_BAUDRATE(USART_InitStruct->BaudRate));
  199. assert_param(IS_LL_USART_DATAWIDTH(USART_InitStruct->DataWidth));
  200. assert_param(IS_LL_USART_STOPBITS(USART_InitStruct->StopBits));
  201. assert_param(IS_LL_USART_PARITY(USART_InitStruct->Parity));
  202. assert_param(IS_LL_USART_DIRECTION(USART_InitStruct->TransferDirection));
  203. assert_param(IS_LL_USART_HWCONTROL(USART_InitStruct->HardwareFlowControl));
  204. assert_param(IS_LL_USART_OVERSAMPLING(USART_InitStruct->OverSampling));
  205. /* USART needs to be in disabled state, in order to be able to configure some bits in
  206. CRx registers */
  207. if (LL_USART_IsEnabled(USARTx) == 0U)
  208. {
  209. /*---------------------------- USART CR1 Configuration ---------------------
  210. * Configure USARTx CR1 (USART Word Length, Parity, Mode and Oversampling bits) with parameters:
  211. * - DataWidth: USART_CR1_M bits according to USART_InitStruct->DataWidth value
  212. * - Parity: USART_CR1_PCE, USART_CR1_PS bits according to USART_InitStruct->Parity value
  213. * - TransferDirection: USART_CR1_TE, USART_CR1_RE bits according to USART_InitStruct->TransferDirection value
  214. * - Oversampling: USART_CR1_OVER8 bit according to USART_InitStruct->OverSampling value.
  215. */
  216. MODIFY_REG(USARTx->CR1,
  217. (USART_CR1_M | USART_CR1_PCE | USART_CR1_PS |
  218. USART_CR1_TE | USART_CR1_RE | USART_CR1_OVER8),
  219. (USART_InitStruct->DataWidth | USART_InitStruct->Parity |
  220. USART_InitStruct->TransferDirection | USART_InitStruct->OverSampling));
  221. /*---------------------------- USART CR2 Configuration ---------------------
  222. * Configure USARTx CR2 (Stop bits) with parameters:
  223. * - Stop Bits: USART_CR2_STOP bits according to USART_InitStruct->StopBits value.
  224. * - CLKEN, CPOL, CPHA and LBCL bits are to be configured using LL_USART_ClockInit().
  225. */
  226. LL_USART_SetStopBitsLength(USARTx, USART_InitStruct->StopBits);
  227. /*---------------------------- USART CR3 Configuration ---------------------
  228. * Configure USARTx CR3 (Hardware Flow Control) with parameters:
  229. * - HardwareFlowControl: USART_CR3_RTSE, USART_CR3_CTSE bits according to
  230. * USART_InitStruct->HardwareFlowControl value.
  231. */
  232. LL_USART_SetHWFlowCtrl(USARTx, USART_InitStruct->HardwareFlowControl);
  233. /*---------------------------- USART BRR Configuration ---------------------
  234. * Retrieve Clock frequency used for USART Peripheral
  235. */
  236. if (USARTx == USART1)
  237. {
  238. periphclk = LL_RCC_GetUSARTClockFreq(LL_RCC_USART1_CLKSOURCE);
  239. }
  240. else if (USARTx == USART2)
  241. {
  242. #if defined(RCC_CCIPR_USART2SEL)
  243. periphclk = LL_RCC_GetUSARTClockFreq(LL_RCC_USART2_CLKSOURCE);
  244. #else
  245. /* USART2 clock is PCLK */
  246. LL_RCC_GetSystemClocksFreq(&RCC_Clocks);
  247. periphclk = RCC_Clocks.PCLK1_Frequency;
  248. #endif /* USART2 Clock selector flag */
  249. }
  250. #if defined(USART3)
  251. else if (USARTx == USART3)
  252. {
  253. #if defined(RCC_CCIPR_USART3SEL)
  254. periphclk = LL_RCC_GetUSARTClockFreq(LL_RCC_USART3_CLKSOURCE);
  255. #else
  256. /* USART3 clock is PCLK */
  257. LL_RCC_GetSystemClocksFreq(&RCC_Clocks);
  258. periphclk = RCC_Clocks.PCLK1_Frequency;
  259. #endif /* USART3 Clock selector flag */
  260. }
  261. #endif /* USART3 */
  262. #if defined(USART4)
  263. else if (USARTx == USART4)
  264. {
  265. #if defined(RCC_CCIPR_USART4SEL)
  266. periphclk = LL_RCC_GetUSARTClockFreq(LL_RCC_USART4_CLKSOURCE);
  267. #else
  268. /* USART4 clock is PCLK1 */
  269. LL_RCC_GetSystemClocksFreq(&RCC_Clocks);
  270. periphclk = RCC_Clocks.PCLK1_Frequency;
  271. #endif /* RCC_CCIPR_USART4SEL */
  272. }
  273. #endif /* USART4 */
  274. #if defined(USART5)
  275. else if (USARTx == USART5)
  276. {
  277. /* USART5 clock is PCLK1 */
  278. LL_RCC_GetSystemClocksFreq(&RCC_Clocks);
  279. periphclk = RCC_Clocks.PCLK1_Frequency;
  280. }
  281. #endif /* USART5 */
  282. #if defined(USART6)
  283. else if (USARTx == USART6)
  284. {
  285. /* USART6 clock is PCLK1 */
  286. LL_RCC_GetSystemClocksFreq(&RCC_Clocks);
  287. periphclk = RCC_Clocks.PCLK1_Frequency;
  288. }
  289. #endif /* USART6 */
  290. else
  291. {
  292. /* Nothing to do, as error code is already assigned to ERROR value */
  293. }
  294. /* Configure the USART Baud Rate :
  295. - prescaler value is required
  296. - valid baud rate value (different from 0) is required
  297. - Peripheral clock as returned by RCC service, should be valid (different from 0).
  298. */
  299. if ((periphclk != LL_RCC_PERIPH_FREQUENCY_NO)
  300. && (USART_InitStruct->BaudRate != 0U))
  301. {
  302. status = SUCCESS;
  303. LL_USART_SetBaudRate(USARTx,
  304. periphclk,
  305. USART_InitStruct->PrescalerValue,
  306. USART_InitStruct->OverSampling,
  307. USART_InitStruct->BaudRate);
  308. /* Check BRR is greater than or equal to 16d */
  309. assert_param(IS_LL_USART_BRR_MIN(USARTx->BRR));
  310. }
  311. /*---------------------------- USART PRESC Configuration -----------------------
  312. * Configure USARTx PRESC (Prescaler) with parameters:
  313. * - PrescalerValue: USART_PRESC_PRESCALER bits according to USART_InitStruct->PrescalerValue value.
  314. */
  315. LL_USART_SetPrescaler(USARTx, USART_InitStruct->PrescalerValue);
  316. }
  317. /* Endif (=> USART not in Disabled state => return ERROR) */
  318. return (status);
  319. }
  320. /**
  321. * @brief Set each @ref LL_USART_InitTypeDef field to default value.
  322. * @param USART_InitStruct pointer to a @ref LL_USART_InitTypeDef structure
  323. * whose fields will be set to default values.
  324. * @retval None
  325. */
  326. void LL_USART_StructInit(LL_USART_InitTypeDef *USART_InitStruct)
  327. {
  328. /* Set USART_InitStruct fields to default values */
  329. USART_InitStruct->PrescalerValue = LL_USART_PRESCALER_DIV1;
  330. USART_InitStruct->BaudRate = USART_DEFAULT_BAUDRATE;
  331. USART_InitStruct->DataWidth = LL_USART_DATAWIDTH_8B;
  332. USART_InitStruct->StopBits = LL_USART_STOPBITS_1;
  333. USART_InitStruct->Parity = LL_USART_PARITY_NONE ;
  334. USART_InitStruct->TransferDirection = LL_USART_DIRECTION_TX_RX;
  335. USART_InitStruct->HardwareFlowControl = LL_USART_HWCONTROL_NONE;
  336. USART_InitStruct->OverSampling = LL_USART_OVERSAMPLING_16;
  337. }
  338. /**
  339. * @brief Initialize USART Clock related settings according to the
  340. * specified parameters in the USART_ClockInitStruct.
  341. * @note As some bits in USART configuration registers can only be written when
  342. * the USART is disabled (USART_CR1_UE bit =0), USART Peripheral should be in disabled state prior calling
  343. * this function. Otherwise, ERROR result will be returned.
  344. * @param USARTx USART Instance
  345. * @param USART_ClockInitStruct pointer to a @ref LL_USART_ClockInitTypeDef structure
  346. * that contains the Clock configuration information for the specified USART peripheral.
  347. * @retval An ErrorStatus enumeration value:
  348. * - SUCCESS: USART registers related to Clock settings are initialized according
  349. * to USART_ClockInitStruct content
  350. * - ERROR: Problem occurred during USART Registers initialization
  351. */
  352. ErrorStatus LL_USART_ClockInit(USART_TypeDef *USARTx, const LL_USART_ClockInitTypeDef *USART_ClockInitStruct)
  353. {
  354. ErrorStatus status = SUCCESS;
  355. /* Check USART Instance and Clock signal output parameters */
  356. assert_param(IS_UART_INSTANCE(USARTx));
  357. assert_param(IS_LL_USART_CLOCKOUTPUT(USART_ClockInitStruct->ClockOutput));
  358. /* USART needs to be in disabled state, in order to be able to configure some bits in
  359. CRx registers */
  360. if (LL_USART_IsEnabled(USARTx) == 0U)
  361. {
  362. /* Ensure USART instance is USART capable */
  363. assert_param(IS_USART_INSTANCE(USARTx));
  364. /* Check clock related parameters */
  365. assert_param(IS_LL_USART_CLOCKPOLARITY(USART_ClockInitStruct->ClockPolarity));
  366. assert_param(IS_LL_USART_CLOCKPHASE(USART_ClockInitStruct->ClockPhase));
  367. assert_param(IS_LL_USART_LASTBITCLKOUTPUT(USART_ClockInitStruct->LastBitClockPulse));
  368. /*---------------------------- USART CR2 Configuration -----------------------
  369. * Configure USARTx CR2 (Clock signal related bits) with parameters:
  370. * - Clock Output: USART_CR2_CLKEN bit according to USART_ClockInitStruct->ClockOutput value
  371. * - Clock Polarity: USART_CR2_CPOL bit according to USART_ClockInitStruct->ClockPolarity value
  372. * - Clock Phase: USART_CR2_CPHA bit according to USART_ClockInitStruct->ClockPhase value
  373. * - Last Bit Clock Pulse Output: USART_CR2_LBCL bit according to USART_ClockInitStruct->LastBitClockPulse value.
  374. */
  375. MODIFY_REG(USARTx->CR2,
  376. USART_CR2_CLKEN | USART_CR2_CPHA | USART_CR2_CPOL | USART_CR2_LBCL,
  377. USART_ClockInitStruct->ClockOutput | USART_ClockInitStruct->ClockPolarity |
  378. USART_ClockInitStruct->ClockPhase | USART_ClockInitStruct->LastBitClockPulse);
  379. }
  380. /* Else (USART not in Disabled state => return ERROR */
  381. else
  382. {
  383. status = ERROR;
  384. }
  385. return (status);
  386. }
  387. /**
  388. * @brief Set each field of a @ref LL_USART_ClockInitTypeDef type structure to default value.
  389. * @param USART_ClockInitStruct pointer to a @ref LL_USART_ClockInitTypeDef structure
  390. * whose fields will be set to default values.
  391. * @retval None
  392. */
  393. void LL_USART_ClockStructInit(LL_USART_ClockInitTypeDef *USART_ClockInitStruct)
  394. {
  395. /* Set LL_USART_ClockInitStruct fields with default values */
  396. USART_ClockInitStruct->ClockOutput = LL_USART_CLOCK_DISABLE;
  397. USART_ClockInitStruct->ClockPolarity = LL_USART_POLARITY_LOW; /* Not relevant when ClockOutput =
  398. LL_USART_CLOCK_DISABLE */
  399. USART_ClockInitStruct->ClockPhase = LL_USART_PHASE_1EDGE; /* Not relevant when ClockOutput =
  400. LL_USART_CLOCK_DISABLE */
  401. USART_ClockInitStruct->LastBitClockPulse = LL_USART_LASTCLKPULSE_NO_OUTPUT; /* Not relevant when ClockOutput =
  402. LL_USART_CLOCK_DISABLE */
  403. }
  404. /**
  405. * @}
  406. */
  407. /**
  408. * @}
  409. */
  410. /**
  411. * @}
  412. */
  413. #endif /* USART1 || USART2 || USART3 || USART4 || USART5 || USART6 */
  414. /**
  415. * @}
  416. */
  417. #endif /* USE_FULL_LL_DRIVER */