stm32g0xx_ll_usart.c 20 KB

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