STM32L443xx HAL User Manual
|
Initialization and Configuration functions. More...
Functions | |
HAL_StatusTypeDef | HAL_IRDA_Init (IRDA_HandleTypeDef *hirda) |
Initialize the IRDA mode according to the specified parameters in the IRDA_InitTypeDef and initialize the associated handle. | |
HAL_StatusTypeDef | HAL_IRDA_DeInit (IRDA_HandleTypeDef *hirda) |
DeInitialize the IRDA peripheral. | |
__weak void | HAL_IRDA_MspInit (IRDA_HandleTypeDef *hirda) |
Initialize the IRDA MSP. | |
__weak void | HAL_IRDA_MspDeInit (IRDA_HandleTypeDef *hirda) |
DeInitialize the IRDA MSP. | |
HAL_StatusTypeDef | HAL_IRDA_RegisterCallback (IRDA_HandleTypeDef *hirda, HAL_IRDA_CallbackIDTypeDef CallbackID, pIRDA_CallbackTypeDef pCallback) |
Register a User IRDA Callback To be used instead of the weak predefined callback. | |
HAL_StatusTypeDef | HAL_IRDA_UnRegisterCallback (IRDA_HandleTypeDef *hirda, HAL_IRDA_CallbackIDTypeDef CallbackID) |
Unregister an IRDA callback IRDA callback is redirected to the weak predefined callback. |
Initialization and Configuration functions.
============================================================================== ##### Initialization and Configuration functions ##### ============================================================================== [..] This subsection provides a set of functions allowing to initialize the USARTx in asynchronous IRDA mode. (+) For the asynchronous mode only these parameters can be configured: (++) Baud Rate (++) Word Length (++) 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. (++) Power mode (++) Prescaler setting (++) Receiver/transmitter modes [..] The HAL_IRDA_Init() API follows the USART asynchronous configuration procedures (details for the procedures 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 IRDA frame formats are listed in the following table.
Table 1. IRDA frame format. +-----------------------------------------------------------------------+ | M1 bit | M0 bit | PCE bit | IRDA 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 | | +-----------------------------------------------------------------------+
HAL_StatusTypeDef HAL_IRDA_DeInit | ( | IRDA_HandleTypeDef * | hirda | ) |
DeInitialize the IRDA peripheral.
hirda | Pointer to a IRDA_HandleTypeDef structure that contains the configuration information for the specified IRDA module. |
HAL | status |
Definition at line 402 of file stm32l4xx_hal_irda.c.
References __HAL_IRDA_DISABLE, assert_param, __IRDA_HandleTypeDef::ErrorCode, __IRDA_HandleTypeDef::gState, HAL_IRDA_ERROR_NONE, HAL_IRDA_MspDeInit(), HAL_IRDA_STATE_BUSY, HAL_IRDA_STATE_RESET, __IRDA_HandleTypeDef::Instance, __IRDA_HandleTypeDef::MspDeInitCallback, and __IRDA_HandleTypeDef::RxState.
HAL_StatusTypeDef HAL_IRDA_Init | ( | IRDA_HandleTypeDef * | hirda | ) |
Initialize the IRDA mode according to the specified parameters in the IRDA_InitTypeDef and initialize the associated handle.
hirda | Pointer to a IRDA_HandleTypeDef structure that contains the configuration information for the specified IRDA module. |
HAL | status |
Definition at line 337 of file stm32l4xx_hal_irda.c.
References __HAL_IRDA_DISABLE, __HAL_IRDA_ENABLE, assert_param, __IRDA_HandleTypeDef::gState, HAL_IRDA_MspInit(), HAL_IRDA_STATE_BUSY, HAL_IRDA_STATE_RESET, __IRDA_HandleTypeDef::Instance, IRDA_CheckIdleState(), IRDA_InitCallbacksToDefault(), IRDA_SetConfig(), __IRDA_HandleTypeDef::Lock, and __IRDA_HandleTypeDef::MspInitCallback.
void HAL_IRDA_MspDeInit | ( | IRDA_HandleTypeDef * | hirda | ) |
DeInitialize the IRDA MSP.
hirda | Pointer to a IRDA_HandleTypeDef structure that contains the configuration information for the specified IRDA module. |
None |
Definition at line 461 of file stm32l4xx_hal_irda.c.
Referenced by HAL_IRDA_DeInit(), and HAL_IRDA_UnRegisterCallback().
void HAL_IRDA_MspInit | ( | IRDA_HandleTypeDef * | hirda | ) |
Initialize the IRDA MSP.
hirda | Pointer to a IRDA_HandleTypeDef structure that contains the configuration information for the specified IRDA module. |
None |
Definition at line 445 of file stm32l4xx_hal_irda.c.
Referenced by HAL_IRDA_Init(), and HAL_IRDA_UnRegisterCallback().
HAL_StatusTypeDef HAL_IRDA_RegisterCallback | ( | IRDA_HandleTypeDef * | hirda, |
HAL_IRDA_CallbackIDTypeDef | CallbackID, | ||
pIRDA_CallbackTypeDef | pCallback | ||
) |
Register a User IRDA Callback To be used instead of the weak predefined callback.
hirda | irda handle |
CallbackID | ID of the callback to be registered This parameter can be one of the following values:
|
pCallback | pointer to the Callback function |
HAL | status |
Definition at line 491 of file stm32l4xx_hal_irda.c.
References __IRDA_HandleTypeDef::AbortCpltCallback, __IRDA_HandleTypeDef::AbortReceiveCpltCallback, __IRDA_HandleTypeDef::AbortTransmitCpltCallback, __IRDA_HandleTypeDef::ErrorCallback, __IRDA_HandleTypeDef::ErrorCode, __IRDA_HandleTypeDef::gState, HAL_IRDA_ABORT_COMPLETE_CB_ID, HAL_IRDA_ABORT_RECEIVE_COMPLETE_CB_ID, HAL_IRDA_ABORT_TRANSMIT_COMPLETE_CB_ID, HAL_IRDA_ERROR_CB_ID, HAL_IRDA_ERROR_INVALID_CALLBACK, HAL_IRDA_MSPDEINIT_CB_ID, HAL_IRDA_MSPINIT_CB_ID, HAL_IRDA_RX_COMPLETE_CB_ID, HAL_IRDA_RX_HALFCOMPLETE_CB_ID, HAL_IRDA_STATE_READY, HAL_IRDA_STATE_RESET, HAL_IRDA_TX_COMPLETE_CB_ID, HAL_IRDA_TX_HALFCOMPLETE_CB_ID, __IRDA_HandleTypeDef::MspDeInitCallback, __IRDA_HandleTypeDef::MspInitCallback, __IRDA_HandleTypeDef::RxCpltCallback, __IRDA_HandleTypeDef::RxHalfCpltCallback, __IRDA_HandleTypeDef::TxCpltCallback, and __IRDA_HandleTypeDef::TxHalfCpltCallback.
HAL_StatusTypeDef HAL_IRDA_UnRegisterCallback | ( | IRDA_HandleTypeDef * | hirda, |
HAL_IRDA_CallbackIDTypeDef | CallbackID | ||
) |
Unregister an IRDA callback IRDA callback is redirected to the weak predefined callback.
hirda | irda handle |
CallbackID | ID of the callback to be unregistered This parameter can be one of the following values:
|
HAL | status |
Definition at line 613 of file stm32l4xx_hal_irda.c.
References __IRDA_HandleTypeDef::AbortCpltCallback, __IRDA_HandleTypeDef::AbortReceiveCpltCallback, __IRDA_HandleTypeDef::AbortTransmitCpltCallback, __IRDA_HandleTypeDef::ErrorCallback, __IRDA_HandleTypeDef::ErrorCode, __IRDA_HandleTypeDef::gState, HAL_IRDA_ABORT_COMPLETE_CB_ID, HAL_IRDA_ABORT_RECEIVE_COMPLETE_CB_ID, HAL_IRDA_ABORT_TRANSMIT_COMPLETE_CB_ID, HAL_IRDA_AbortCpltCallback(), HAL_IRDA_AbortReceiveCpltCallback(), HAL_IRDA_AbortTransmitCpltCallback(), HAL_IRDA_ERROR_CB_ID, HAL_IRDA_ERROR_INVALID_CALLBACK, HAL_IRDA_ErrorCallback(), HAL_IRDA_MspDeInit(), HAL_IRDA_MSPDEINIT_CB_ID, HAL_IRDA_MspInit(), HAL_IRDA_MSPINIT_CB_ID, HAL_IRDA_RX_COMPLETE_CB_ID, HAL_IRDA_RX_HALFCOMPLETE_CB_ID, HAL_IRDA_RxCpltCallback(), HAL_IRDA_RxHalfCpltCallback(), HAL_IRDA_STATE_READY, HAL_IRDA_STATE_RESET, HAL_IRDA_TX_COMPLETE_CB_ID, HAL_IRDA_TX_HALFCOMPLETE_CB_ID, HAL_IRDA_TxCpltCallback(), HAL_IRDA_TxHalfCpltCallback(), __IRDA_HandleTypeDef::MspDeInitCallback, __IRDA_HandleTypeDef::MspInitCallback, __IRDA_HandleTypeDef::RxCpltCallback, __IRDA_HandleTypeDef::RxHalfCpltCallback, __IRDA_HandleTypeDef::TxCpltCallback, and __IRDA_HandleTypeDef::TxHalfCpltCallback.