STM32F4xx_HAL_Driver  1.8.3
Initialization and de-initialization functions

Initialization and Configuration functions. More...

+ Collaboration diagram for Initialization and de-initialization functions:

Functions

HAL_StatusTypeDef HAL_UART_Init (UART_HandleTypeDef *huart)
 Initializes the UART mode according to the specified parameters in the UART_InitTypeDef and create the associated handle. More...
 
HAL_StatusTypeDef HAL_HalfDuplex_Init (UART_HandleTypeDef *huart)
 Initializes the half-duplex mode according to the specified parameters in the UART_InitTypeDef and create the associated handle. More...
 
HAL_StatusTypeDef HAL_LIN_Init (UART_HandleTypeDef *huart, uint32_t BreakDetectLength)
 Initializes the LIN mode according to the specified parameters in the UART_InitTypeDef and create the associated handle. More...
 
HAL_StatusTypeDef HAL_MultiProcessor_Init (UART_HandleTypeDef *huart, uint8_t Address, uint32_t WakeUpMethod)
 Initializes the Multi-Processor mode according to the specified parameters in the UART_InitTypeDef and create the associated handle. More...
 
HAL_StatusTypeDef HAL_UART_DeInit (UART_HandleTypeDef *huart)
 DeInitializes the UART peripheral. More...
 
void HAL_UART_MspInit (UART_HandleTypeDef *huart)
 UART MSP Init. More...
 
void HAL_UART_MspDeInit (UART_HandleTypeDef *huart)
 UART MSP DeInit. More...
 
HAL_StatusTypeDef HAL_UART_RegisterCallback (UART_HandleTypeDef *huart, HAL_UART_CallbackIDTypeDef CallbackID, pUART_CallbackTypeDef pCallback)
 Register a User UART Callback To be used instead of the weak predefined callback. More...
 
HAL_StatusTypeDef HAL_UART_UnRegisterCallback (UART_HandleTypeDef *huart, HAL_UART_CallbackIDTypeDef CallbackID)
 Unregister an UART Callback UART callaback is redirected to the weak predefined callback. More...
 
HAL_StatusTypeDef HAL_UART_RegisterRxEventCallback (UART_HandleTypeDef *huart, pUART_RxEventCallbackTypeDef pCallback)
 Register a User UART Rx Event Callback To be used instead of the weak predefined callback. More...
 
HAL_StatusTypeDef HAL_UART_UnRegisterRxEventCallback (UART_HandleTypeDef *huart)
 UnRegister the UART Rx Event Callback UART Rx Event Callback is redirected to the weak HAL_UARTEx_RxEventCallback() predefined callback. More...
 

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 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.
             Depending on the frame length defined by the M bit (8-bits or 9-bits),
             please refer to Reference manual for possible UART frame formats.
        (++) Hardware flow control
        (++) Receiver/transmitter modes
        (++) Over Sampling Method
    [..]
    The HAL_UART_Init(), HAL_HalfDuplex_Init(), HAL_LIN_Init() and HAL_MultiProcessor_Init() APIs
    follow respectively the UART asynchronous, UART Half duplex, LIN and Multi-Processor configuration
    procedures (details for the procedures are available in reference manual
    (RM0430 for STM32F4X3xx MCUs and RM0402 for STM32F412xx MCUs
     RM0383 for STM32F411xC/E MCUs and RM0401 for STM32F410xx MCUs
     RM0090 for STM32F4X5xx/STM32F4X7xx/STM32F429xx/STM32F439xx MCUs
     RM0390 for STM32F446xx MCUs and RM0386 for STM32F469xx/STM32F479xx MCUs)).

Function Documentation

◆ HAL_HalfDuplex_Init()

HAL_StatusTypeDef HAL_HalfDuplex_Init ( UART_HandleTypeDef huart)

Initializes the half-duplex mode according to the specified parameters in the UART_InitTypeDef and create the associated handle.

Parameters
huartPointer to a UART_HandleTypeDef structure that contains the configuration information for the specified UART module.
Return values
HALstatus

Definition at line 435 of file stm32f4xx_hal_uart.c.

◆ HAL_LIN_Init()

HAL_StatusTypeDef HAL_LIN_Init ( UART_HandleTypeDef huart,
uint32_t  BreakDetectLength 
)

Initializes the LIN mode according to the specified parameters in the UART_InitTypeDef and create the associated handle.

Parameters
huartPointer to a UART_HandleTypeDef structure that contains the configuration information for the specified UART module.
BreakDetectLengthSpecifies 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 509 of file stm32f4xx_hal_uart.c.

◆ HAL_MultiProcessor_Init()

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

Initializes the Multi-Processor mode according to the specified parameters in the UART_InitTypeDef and create the associated handle.

Parameters
huartPointer to a UART_HandleTypeDef structure that contains the configuration information for the specified UART module.
AddressUSART address
WakeUpMethodspecifies the USART wake-up method. This parameter can be one of the following values:
  • UART_WAKEUPMETHOD_IDLELINE: Wake-up by an idle line detection
  • UART_WAKEUPMETHOD_ADDRESSMARK: Wake-up by an address mark
Return values
HALstatus

Definition at line 591 of file stm32f4xx_hal_uart.c.

◆ HAL_UART_DeInit()

HAL_StatusTypeDef HAL_UART_DeInit ( UART_HandleTypeDef huart)

DeInitializes the UART peripheral.

Parameters
huartPointer to a UART_HandleTypeDef structure that contains the configuration information for the specified UART module.
Return values
HALstatus

Definition at line 669 of file stm32f4xx_hal_uart.c.

◆ HAL_UART_Init()

HAL_StatusTypeDef HAL_UART_Init ( UART_HandleTypeDef huart)

Initializes the UART mode according to the specified parameters in the UART_InitTypeDef and create the associated handle.

Parameters
huartPointer to a UART_HandleTypeDef structure that contains the configuration information for the specified UART module.
Return values
HALstatus

Definition at line 357 of file stm32f4xx_hal_uart.c.

◆ HAL_UART_MspDeInit()

__weak void HAL_UART_MspDeInit ( UART_HandleTypeDef huart)

UART MSP DeInit.

Parameters
huartPointer to a UART_HandleTypeDef structure that contains the configuration information for the specified UART module.
Return values
None

Definition at line 730 of file stm32f4xx_hal_uart.c.

◆ HAL_UART_MspInit()

__weak void HAL_UART_MspInit ( UART_HandleTypeDef huart)

UART MSP Init.

Parameters
huartPointer to a UART_HandleTypeDef structure that contains the configuration information for the specified UART module.
Return values
None

Definition at line 715 of file stm32f4xx_hal_uart.c.

◆ HAL_UART_RegisterCallback()

HAL_StatusTypeDef HAL_UART_RegisterCallback ( UART_HandleTypeDef huart,
HAL_UART_CallbackIDTypeDef  CallbackID,
pUART_CallbackTypeDef  pCallback 
)

Register a User UART Callback To be used instead of the weak predefined callback.

Note
The HAL_UART_RegisterCallback() may be called before HAL_UART_Init(), HAL_HalfDuplex_Init(), HAL_LIN_Init(), HAL_MultiProcessor_Init() to register callbacks for HAL_UART_MSPINIT_CB_ID and HAL_UART_MSPDEINIT_CB_ID
Parameters
huartuart handle
CallbackIDID of the callback to be registered This parameter can be one of the following values:
pCallbackpointer to the Callback function
Return values
HALstatus

Definition at line 761 of file stm32f4xx_hal_uart.c.

◆ HAL_UART_RegisterRxEventCallback()

HAL_StatusTypeDef HAL_UART_RegisterRxEventCallback ( UART_HandleTypeDef huart,
pUART_RxEventCallbackTypeDef  pCallback 
)

Register a User UART Rx Event Callback To be used instead of the weak predefined callback.

Parameters
huartUart handle
pCallbackPointer to the Rx Event Callback function
Return values
HALstatus

Definition at line 978 of file stm32f4xx_hal_uart.c.

◆ HAL_UART_UnRegisterCallback()

HAL_StatusTypeDef HAL_UART_UnRegisterCallback ( UART_HandleTypeDef huart,
HAL_UART_CallbackIDTypeDef  CallbackID 
)

Unregister an UART Callback UART callaback is redirected to the weak predefined callback.

Note
The HAL_UART_UnRegisterCallback() may be called before HAL_UART_Init(), HAL_HalfDuplex_Init(), HAL_LIN_Init(), HAL_MultiProcessor_Init() to un-register callbacks for HAL_UART_MSPINIT_CB_ID and HAL_UART_MSPDEINIT_CB_ID
Parameters
huartuart handle
CallbackIDID of the callback to be unregistered This parameter can be one of the following values:
Return values
HALstatus

Definition at line 881 of file stm32f4xx_hal_uart.c.

◆ HAL_UART_UnRegisterRxEventCallback()

HAL_StatusTypeDef HAL_UART_UnRegisterRxEventCallback ( UART_HandleTypeDef huart)

UnRegister the UART Rx Event Callback UART Rx Event Callback is redirected to the weak HAL_UARTEx_RxEventCallback() predefined callback.

Parameters
huartUart handle
Return values
HALstatus

Definition at line 1015 of file stm32f4xx_hal_uart.c.