```html STM32G474xx HAL用户手册:stm32g4xx_ll_usart.h源文件
STM32G474xx HAL用户手册
stm32g4xx_ll_usart.h
查看此文件的文档
00001 /**
00002   ******************************************************************************
00003   * @file    stm32g4xx_ll_usart.h
00004   * @author  MCD Application Team
00005   * @brief   Header file of USART LL module.
00006   ******************************************************************************
00007   * @attention
00008   *
00009   * Copyright (c) 2019 STMicroelectronics.
00010   * All rights reserved.
00011   *
00012   * This software is licensed under terms that can be found in the LICENSE file
00013   * in the root directory of this software component.
00014   * If no LICENSE file comes with this software, it is provided AS-IS.
00015   *
00016   ******************************************************************************
00017   */
00018 
00019 /* Define to prevent recursive inclusion -------------------------------------*/
00020 #ifndef STM32G4xx_LL_USART_H
00021 #define STM32G4xx_LL_USART_H
00022 
00023 #ifdef __cplusplus
00024 extern "C" {
00025 #endif
00026 
00027 /* Includes ------------------------------------------------------------------*/
00028 #include "stm32g4xx.h"
00029 
00030 /** @addtogroup STM32G4xx_LL_Driver
00031   * @{
00032   */
00033 
00034 #if defined(USART1) || defined(USART2) || defined(USART3) || defined(UART4) || defined(UART5)
00035 
00036 /** @defgroup USART_LL USART
00037   * @{
00038   */
00039 
00040 /* Private types -------------------------------------------------------------*/
00041 /* Private variables ---------------------------------------------------------*/
00042 /** @defgroup USART_LL_Private_Variables USART Private Variables
00043   * @{
00044   */
00045 /* Array used to get the USART prescaler division decimal values versus @ref USART_LL_EC_PRESCALER values */
00046 static const uint32_t USART_PRESCALER_TAB[] =
00047 {
00048   1UL,
00049   2UL,
00050   4UL,
00051   6UL,
00052   8UL,
00053   10UL,
00054   12UL,
00055   16UL,
00056   32UL,
00057   64UL,
00058   128UL,
00059   256UL,
00060   256UL,
00061   256UL,
00062   256UL,
00063   256UL
00064   256UL
00065 };
00066 /**
00067   * @}
00068   */
00069 
00070 /* Private constants ---------------------------------------------------------*/
00071 /** @defgroup USART_LL_Private_Constants USART Private Constants
00072   * @{
00073   */
00074 /**
00075   * @}
00076   */
00077 /* Private macros ------------------------------------------------------------*/
00078 #if defined(USE_FULL_LL_DRIVER)
00079 /** @defgroup USART_LL_Private_Macros USART Private Macros
00080   * @{
00081   */
00082 /**
00083   * @}
00084   */
00085 #endif /*USE_FULL_LL_DRIVER*/
00086 
00087 /* Exported types ------------------------------------------------------------*/
00088 #if defined(USE_FULL_LL_DRIVER)
00089 /** @defgroup USART_LL_ES_INIT USART Exported Init structures
00090   * @{
00091   */
00092 /**
00093   * @brief LL USART Init Structure definition
00094   */
00095 typedef struct
00096 {
00097   uint32_t PrescalerValue;            /*!< Specifies the Prescaler to compute the communication baud rate.
00098                                            This parameter can be a value of @ref USART_LL_EC_PRESCALER.
00099 
00100                                            This feature can be modified afterwards using unitary
00101                                            function @ref LL_USART_SetPrescaler().*/
00102 
00103   uint32_t BaudRate;                  /*!< This field defines expected Usart communication baud rate.
00104 
00105                                            This feature can be modified afterwards using unitary
00106                                            function @ref LL_USART_SetBaudRate().*/
00107 
00108   uint32_t DataWidth;                 /*!< Specifies the number of data bits transmitted or received in a frame.
00109                                            This parameter can be a value of @ref USART_LL_EC_DATAWIDTH.
00110 
00111                                            This feature can be modified afterwards using unitary
00112                                            function @ref LL_USART_SetDataWidth().*/
00113 
00114   uint32_t StopBits;                  /*!< Specifies the number of stop bits transmitted.
00115                                            This parameter can be a value of @ref USART_LL_EC_STOPBITS.
00116 
00117                                            This feature can be modified afterwards using unitary
00118                                            function @ref LL_USART_SetStopBitsLength().*/
00119 
00120   uint32_t Parity;                    /*!< Specifies the parity mode.
00121                                            This parameter can be a value of @ref USART_LL_EC_PARITY.
00122 
```