TUKS MCU Introductory course / TUKS-COURSE-THERMOMETER

Fork of TUKS-COURSE-TIMER by TUKS MCU Introductory course

Embed: (wiki syntax)

« Back to documentation index

Initialization and de-initialization functions

Initialization and de-initialization functions
[USART Exported Functions]

Initialization and Configuration functions. More...

Functions

HAL_StatusTypeDef HAL_USART_Init (USART_HandleTypeDef *husart)
 Initializes the USART mode according to the specified parameters in the USART_InitTypeDef and initialize the associated handle.
HAL_StatusTypeDef HAL_USART_DeInit (USART_HandleTypeDef *husart)
 DeInitialize the USART peripheral.
__weak void HAL_USART_MspInit (USART_HandleTypeDef *husart)
 Initialize the USART MSP.
__weak void HAL_USART_MspDeInit (USART_HandleTypeDef *husart)
 DeInitialize the USART MSP.

Detailed Description

Initialization and Configuration functions.

 ===============================================================================
            ##### Initialization and Configuration functions #####
 ===============================================================================
    [..]
    This subsection provides a set of functions allowing to initialize the USART
    in asynchronous and in synchronous modes.
      (+) For the asynchronous mode only these parameters can be configured:
        (++) Baud Rate
        (++) Word Length
        (++) Stop Bit
        (++) Parity: If the parity is enabled, then the MSB bit of the data written
             in the data register is transmitted but is changed by the parity bit.
        (++) USART polarity
        (++) USART phase
        (++) USART LastBit
        (++) Receiver/transmitter modes

    [..]
    The HAL_USART_Init() function follows the USART  synchronous configuration
    procedure (details for the procedure are available in reference manual).

Depending on the frame length defined by the M1 and M0 bits (7-bit, 8-bit or 9-bit), the possible USART formats are listed in the following table.

Table 1. USART frame format. +-----------------------------------------------------------------------+ | M1 bit | M0 bit | PCE bit | USART frame | |---------|---------|-----------|---------------------------------------| | 0 | 0 | 0 | | SB | 8 bit data | STB | | |---------|---------|-----------|---------------------------------------| | 0 | 0 | 1 | | SB | 7 bit data | PB | STB | | |---------|---------|-----------|---------------------------------------| | 0 | 1 | 0 | | SB | 9 bit data | STB | | |---------|---------|-----------|---------------------------------------| | 0 | 1 | 1 | | SB | 8 bit data | PB | STB | | |---------|---------|-----------|---------------------------------------| | 1 | 0 | 0 | | SB | 7 bit data | STB | | |---------|---------|-----------|---------------------------------------| | 1 | 0 | 1 | | SB | 6 bit data | PB | STB | | +-----------------------------------------------------------------------+


Function Documentation

HAL_StatusTypeDef HAL_USART_DeInit ( USART_HandleTypeDef *  husart )

DeInitialize the USART peripheral.

Parameters:
husart,:USART handle.
Return values:
HALstatus

Definition at line 254 of file stm32l4xx_hal_usart.c.

HAL_StatusTypeDef HAL_USART_Init ( USART_HandleTypeDef *  husart )

Initializes the USART mode according to the specified parameters in the USART_InitTypeDef and initialize the associated handle.

Parameters:
husart,:USART handle.
Return values:
HALstatus

Definition at line 205 of file stm32l4xx_hal_usart.c.

__weak void HAL_USART_MspDeInit ( USART_HandleTypeDef *  husart )

DeInitialize the USART MSP.

Parameters:
husart,:USART handle.
Return values:
None

Definition at line 303 of file stm32l4xx_hal_usart.c.

__weak void HAL_USART_MspInit ( USART_HandleTypeDef *  husart )

Initialize the USART MSP.

Parameters:
husart,:USART handle.
Return values:
None

Definition at line 288 of file stm32l4xx_hal_usart.c.