Initialization and Configuration functions.
More...
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.
Depending on the frame length defined by the M bit (8-bits or 9-bits),
please refer to Reference manual for possible USART frame formats.
(++) USART polarity
(++) USART phase
(++) USART LastBit
(++) Receiver/transmitter modes
[..]
The HAL_USART_Init() function follows the USART synchronous 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)).
◆ HAL_USART_DeInit()
DeInitializes the USART peripheral.
- Parameters
-
husart | Pointer to a USART_HandleTypeDef structure that contains the configuration information for the specified USART module. |
- Return values
-
Definition at line 359 of file stm32f4xx_hal_usart.c.
◆ HAL_USART_Init()
Initialize the USART mode according to the specified parameters in the USART_InitTypeDef and initialize the associated handle.
- Parameters
-
husart | Pointer to a USART_HandleTypeDef structure that contains the configuration information for the specified USART module. |
- Return values
-
Definition at line 300 of file stm32f4xx_hal_usart.c.
◆ HAL_USART_MspDeInit()
USART MSP DeInit.
- Parameters
-
husart | Pointer to a USART_HandleTypeDef structure that contains the configuration information for the specified USART module. |
- Return values
-
Definition at line 417 of file stm32f4xx_hal_usart.c.
◆ HAL_USART_MspInit()
USART MSP Init.
- Parameters
-
husart | Pointer to a USART_HandleTypeDef structure that contains the configuration information for the specified USART module. |
- Return values
-
Definition at line 402 of file stm32f4xx_hal_usart.c.
◆ HAL_USART_RegisterCallback()
@brief Register a User USART Callback
To be used instead of the weak predefined callback
@note The HAL_USART_RegisterCallback() may be called before HAL_USART_Init() in HAL_USART_STATE_RESET
to register callbacks for HAL_USART_MSPINIT_CB_ID and HAL_USART_MSPDEINIT_CB_ID
@param husart usart handle
@param CallbackID ID of the callback to be registered
This parameter can be one of the following values:
@arg @ref HAL_USART_TX_HALFCOMPLETE_CB_ID Tx Half Complete Callback ID
@arg @ref HAL_USART_TX_COMPLETE_CB_ID Tx Complete Callback ID
@arg @ref HAL_USART_RX_HALFCOMPLETE_CB_ID Rx Half Complete Callback ID
@arg @ref HAL_USART_RX_COMPLETE_CB_ID Rx Complete Callback ID
@arg @ref HAL_USART_TX_RX_COMPLETE_CB_ID Rx Complete Callback ID
@arg @ref HAL_USART_ERROR_CB_ID Error Callback ID
@arg @ref HAL_USART_ABORT_COMPLETE_CB_ID Abort Complete Callback ID
@arg @ref HAL_USART_MSPINIT_CB_ID MspInit Callback ID
@arg @ref HAL_USART_MSPDEINIT_CB_ID MspDeInit Callback ID
@param pCallback pointer to the Callback function
@retval HAL status
Definition at line 447 of file stm32f4xx_hal_usart.c.
◆ HAL_USART_UnRegisterCallback()
Unregister an USART Callback USART callaback is redirected to the weak predefined callback.
- Note
- The HAL_USART_UnRegisterCallback() may be called before HAL_USART_Init() in HAL_USART_STATE_RESET to un-register callbacks for HAL_USART_MSPINIT_CB_ID and HAL_USART_MSPDEINIT_CB_ID
- Parameters
-
husart | usart handle |
CallbackID | ID of the callback to be unregistered This parameter can be one of the following values:
|
- Return values
-
Definition at line 561 of file stm32f4xx_hal_usart.c.