Hal Drivers for L4

Dependents:   BSP OneHopeOnePrayer FINAL_AUDIO_RECORD AudioDemo

Fork of STM32L4xx_HAL_Driver by Senior Design: Sound Monitor

Embed: (wiki syntax)

« Back to documentation index

Initialization and de-initialization functions

Initialization and de-initialization functions
[UART Exported Functions]

Initialization and Configuration functions. More...

Functions

HAL_StatusTypeDef HAL_UART_Init (UART_HandleTypeDef *huart)
 Initialize the UART mode according to the specified parameters in the UART_InitTypeDef and initialize the associated handle.
HAL_StatusTypeDef HAL_HalfDuplex_Init (UART_HandleTypeDef *huart)
 Initialize the half-duplex mode according to the specified parameters in the UART_InitTypeDef and creates the associated handle.
HAL_StatusTypeDef HAL_LIN_Init (UART_HandleTypeDef *huart, uint32_t BreakDetectLength)
 Initialize the LIN mode according to the specified parameters in the UART_InitTypeDef and creates the associated handle .
HAL_StatusTypeDef HAL_MultiProcessor_Init (UART_HandleTypeDef *huart, uint8_t Address, uint32_t WakeUpMethod)
 Initialize the multiprocessor mode according to the specified parameters in the UART_InitTypeDef and initialize the associated handle.
HAL_StatusTypeDef HAL_UART_DeInit (UART_HandleTypeDef *huart)
 DeInitialize the UART peripheral.
__weak void HAL_UART_MspInit (UART_HandleTypeDef *huart)
 Initialize the UART MSP.
__weak void HAL_UART_MspDeInit (UART_HandleTypeDef *huart)
 DeInitialize the UART MSP.

Detailed Description

Initialization and Configuration functions.

===============================================================================
            ##### Initialization and Configuration functions #####
 ===============================================================================
    [..]
    This subsection provides a set of functions allowing to initialize the USARTx or the UARTy
    in asynchronous mode.
      (+) For the asynchronous mode the parameters below 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.
             Depending on the frame length defined by the  M1 and M0 bits (7-bit,
             8-bit or 9-bit), the possible UART frame formats are as listed in the following table:
            
            (+++)    Table 1. UART frame format.             
            (+++)    +-----------------------------------------------------------------------+
            (+++)    |  M1 bit |  M0 bit |  PCE bit  |             UART 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 |     |
            (+++)    +-----------------------------------------------------------------------+
        (++) Hardware flow control
        (++) Receiver/transmitter modes
        (++) Over Sampling Method
        (++) One-Bit Sampling Method
      (+) For the asynchronous mode, the following advanced features can be configured as well:
        (++) TX and/or RX pin level inversion
        (++) data logical level inversion
        (++) RX and TX pins swap
        (++) RX overrun detection disabling
        (++) DMA disabling on RX error
        (++) MSB first on communication line
        (++) auto Baud rate detection
    [..]
    The HAL_UART_Init(), HAL_HalfDuplex_Init(), HAL_LIN_Init()and HAL_MultiProcessor_Init()API
    follow respectively the UART asynchronous, UART Half duplex, UART LIN mode
    and UART multiprocessor mode configuration procedures (details for the procedures
    are available in reference manual).


Function Documentation

HAL_StatusTypeDef HAL_HalfDuplex_Init ( UART_HandleTypeDef *  huart )

Initialize the half-duplex mode according to the specified parameters in the UART_InitTypeDef and creates the associated handle.

Parameters:
huart,:UART handle.
Return values:
HALstatus

Definition at line 280 of file stm32l4xx_hal_uart.c.

HAL_StatusTypeDef HAL_LIN_Init ( UART_HandleTypeDef *  huart,
uint32_t  BreakDetectLength 
)

Initialize the LIN mode according to the specified parameters in the UART_InitTypeDef and creates the associated handle .

Parameters:
huart,:UART handle.
BreakDetectLength,:specifies the LIN break detection length. This parameter can be one of the following values:

  • UART_LINBREAKDETECTLENGTH_10B: 10-bit break detection
  • UART_LINBREAKDETECTLENGTH_11B: 11-bit break detection
Return values:
HALstatus

Definition at line 343 of file stm32l4xx_hal_uart.c.

HAL_StatusTypeDef HAL_MultiProcessor_Init ( UART_HandleTypeDef *  huart,
uint8_t  Address,
uint32_t  WakeUpMethod 
)

Initialize the multiprocessor mode according to the specified parameters in the UART_InitTypeDef and initialize the associated handle.

Parameters:
huart,:UART handle.
Address,:UART node address (4-, 6-, 7- or 8-bit long).
WakeUpMethod,:specifies the UART wakeup method. This parameter can be one of the following values:

  • UART_WAKEUPMETHOD_IDLELINE: WakeUp by an idle line detection
  • UART_WAKEUPMETHOD_ADDRESSMARK: WakeUp by an address mark
Note:
If the user resorts to idle line detection wake up, the Address parameter is useless and ignored by the initialization function.
If the user resorts to address mark wake up, the address length detection is configured by default to 4 bits only. For the UART to be able to manage 6-, 7- or 8-bit long addresses detection, the API HAL_MultiProcessorEx_AddressLength_Set() must be called after HAL_MultiProcessor_Init().
Return values:
HALstatus

Definition at line 431 of file stm32l4xx_hal_uart.c.

HAL_StatusTypeDef HAL_UART_DeInit ( UART_HandleTypeDef *  huart )

DeInitialize the UART peripheral.

Parameters:
huart,:UART handle.
Return values:
HALstatus

Definition at line 497 of file stm32l4xx_hal_uart.c.

HAL_StatusTypeDef HAL_UART_Init ( UART_HandleTypeDef *  huart )

Initialize the UART mode according to the specified parameters in the UART_InitTypeDef and initialize the associated handle.

Parameters:
huart,:UART handle.
Return values:
HALstatus

Definition at line 217 of file stm32l4xx_hal_uart.c.

__weak void HAL_UART_MspDeInit ( UART_HandleTypeDef *  huart )

DeInitialize the UART MSP.

Parameters:
huart,:UART handle.
Return values:
None

Definition at line 546 of file stm32l4xx_hal_uart.c.

__weak void HAL_UART_MspInit ( UART_HandleTypeDef *  huart )

Initialize the UART MSP.

Parameters:
huart,:UART handle.
Return values:
None

Definition at line 534 of file stm32l4xx_hal_uart.c.