IRDA Transmit and Receive functions.
More...
|
HAL_StatusTypeDef | HAL_IRDA_Transmit (IRDA_HandleTypeDef *hirda, const uint8_t *pData, uint16_t Size, uint32_t Timeout) |
| Sends an amount of data in blocking mode. More...
|
|
HAL_StatusTypeDef | HAL_IRDA_Receive (IRDA_HandleTypeDef *hirda, uint8_t *pData, uint16_t Size, uint32_t Timeout) |
| Receive an amount of data in blocking mode. More...
|
|
HAL_StatusTypeDef | HAL_IRDA_Transmit_IT (IRDA_HandleTypeDef *hirda, const uint8_t *pData, uint16_t Size) |
| Send an amount of data in non blocking mode. More...
|
|
HAL_StatusTypeDef | HAL_IRDA_Receive_IT (IRDA_HandleTypeDef *hirda, uint8_t *pData, uint16_t Size) |
| Receive an amount of data in non blocking mode. More...
|
|
HAL_StatusTypeDef | HAL_IRDA_Transmit_DMA (IRDA_HandleTypeDef *hirda, const uint8_t *pData, uint16_t Size) |
| Send an amount of data in DMA mode. More...
|
|
HAL_StatusTypeDef | HAL_IRDA_Receive_DMA (IRDA_HandleTypeDef *hirda, uint8_t *pData, uint16_t Size) |
| Receives an amount of data in DMA mode. More...
|
|
HAL_StatusTypeDef | HAL_IRDA_DMAPause (IRDA_HandleTypeDef *hirda) |
| Pauses the DMA Transfer. More...
|
|
HAL_StatusTypeDef | HAL_IRDA_DMAResume (IRDA_HandleTypeDef *hirda) |
| Resumes the DMA Transfer. More...
|
|
HAL_StatusTypeDef | HAL_IRDA_DMAStop (IRDA_HandleTypeDef *hirda) |
| Stops the DMA Transfer. More...
|
|
HAL_StatusTypeDef | HAL_IRDA_Abort (IRDA_HandleTypeDef *hirda) |
| Abort ongoing transfers (blocking mode). More...
|
|
HAL_StatusTypeDef | HAL_IRDA_AbortTransmit (IRDA_HandleTypeDef *hirda) |
| Abort ongoing Transmit transfer (blocking mode). More...
|
|
HAL_StatusTypeDef | HAL_IRDA_AbortReceive (IRDA_HandleTypeDef *hirda) |
| Abort ongoing Receive transfer (blocking mode). More...
|
|
HAL_StatusTypeDef | HAL_IRDA_Abort_IT (IRDA_HandleTypeDef *hirda) |
| Abort ongoing transfers (Interrupt mode). More...
|
|
HAL_StatusTypeDef | HAL_IRDA_AbortTransmit_IT (IRDA_HandleTypeDef *hirda) |
| Abort ongoing Transmit transfer (Interrupt mode). More...
|
|
HAL_StatusTypeDef | HAL_IRDA_AbortReceive_IT (IRDA_HandleTypeDef *hirda) |
| Abort ongoing Receive transfer (Interrupt mode). More...
|
|
void | HAL_IRDA_IRQHandler (IRDA_HandleTypeDef *hirda) |
| This function handles IRDA interrupt request. More...
|
|
void | HAL_IRDA_TxCpltCallback (IRDA_HandleTypeDef *hirda) |
| Tx Transfer complete callback. More...
|
|
void | HAL_IRDA_RxCpltCallback (IRDA_HandleTypeDef *hirda) |
| Rx Transfer complete callback. More...
|
|
void | HAL_IRDA_TxHalfCpltCallback (IRDA_HandleTypeDef *hirda) |
| Tx Half Transfer completed callback. More...
|
|
void | HAL_IRDA_RxHalfCpltCallback (IRDA_HandleTypeDef *hirda) |
| Rx Half Transfer complete callback. More...
|
|
void | HAL_IRDA_ErrorCallback (IRDA_HandleTypeDef *hirda) |
| IRDA error callback. More...
|
|
void | HAL_IRDA_AbortCpltCallback (IRDA_HandleTypeDef *hirda) |
| IRDA Abort Complete callback. More...
|
|
void | HAL_IRDA_AbortTransmitCpltCallback (IRDA_HandleTypeDef *hirda) |
| IRDA Abort Transmit Complete callback. More...
|
|
void | HAL_IRDA_AbortReceiveCpltCallback (IRDA_HandleTypeDef *hirda) |
| IRDA Abort Receive Complete callback. More...
|
|
IRDA Transmit and Receive functions.
==============================================================================
##### IO operation functions #####
==============================================================================
[..]
This subsection provides a set of functions allowing to manage the IRDA data transfers.
IrDA is a half duplex communication protocol. If the Transmitter is busy, any data
on the IrDA receive line will be ignored by the IrDA decoder and if the Receiver
is busy, data on the TX from the USART to IrDA will not be encoded by IrDA.
While receiving data, transmission should be avoided as the data to be transmitted
could be corrupted.
(#) There are two modes of transfer:
(++) Blocking mode: The communication is performed in polling mode.
The HAL status of all data processing is returned by the same function
after finishing transfer.
(++) Non-Blocking mode: The communication is performed using Interrupts
or DMA, these API's return the HAL status.
The end of the data processing will be indicated through the
dedicated IRDA IRQ when using Interrupt mode or the DMA IRQ when
using DMA mode.
The HAL_IRDA_TxCpltCallback(), HAL_IRDA_RxCpltCallback() user callbacks
will be executed respectively at the end of the Transmit or Receive process
The HAL_IRDA_ErrorCallback() user callback will be executed when a communication error is detected
(#) Blocking mode APIs are :
(++) HAL_IRDA_Transmit()
(++) HAL_IRDA_Receive()
(#) Non Blocking mode APIs with Interrupt are :
(++) HAL_IRDA_Transmit_IT()
(++) HAL_IRDA_Receive_IT()
(++) HAL_IRDA_IRQHandler()
(#) Non Blocking mode functions with DMA are :
(++) HAL_IRDA_Transmit_DMA()
(++) HAL_IRDA_Receive_DMA()
(++) HAL_IRDA_DMAPause()
(++) HAL_IRDA_DMAResume()
(++) HAL_IRDA_DMAStop()
(#) A set of Transfer Complete Callbacks are provided in Non Blocking mode:
(++) HAL_IRDA_TxHalfCpltCallback()
(++) HAL_IRDA_TxCpltCallback()
(++) HAL_IRDA_RxHalfCpltCallback()
(++) HAL_IRDA_RxCpltCallback()
(++) HAL_IRDA_ErrorCallback()
(#) Non-Blocking mode transfers could be aborted using Abort API's :
(+) HAL_IRDA_Abort()
(+) HAL_IRDA_AbortTransmit()
(+) HAL_IRDA_AbortReceive()
(+) HAL_IRDA_Abort_IT()
(+) HAL_IRDA_AbortTransmit_IT()
(+) HAL_IRDA_AbortReceive_IT()
(#) For Abort services based on interrupts (HAL_IRDA_Abortxxx_IT), a set of Abort Complete Callbacks are provided:
(+) HAL_IRDA_AbortCpltCallback()
(+) HAL_IRDA_AbortTransmitCpltCallback()
(+) HAL_IRDA_AbortReceiveCpltCallback()
(#) In Non-Blocking mode transfers, possible errors are split into 2 categories.
Errors are handled as follows :
(+) Error is considered as Recoverable and non blocking : Transfer could go till end, but error severity is
to be evaluated by user : this concerns Frame Error, Parity Error or Noise Error in Interrupt mode reception .
Received character is then retrieved and stored in Rx buffer, Error code is set to allow user to identify error type,
and HAL_IRDA_ErrorCallback() user callback is executed. Transfer is kept ongoing on IRDA side.
If user wants to abort it, Abort services should be called by user.
(+) Error is considered as Blocking : Transfer could not be completed properly and is aborted.
This concerns Overrun Error In Interrupt mode reception and all errors in DMA mode.
Error code is set to allow user to identify error type, and HAL_IRDA_ErrorCallback() user callback is executed.
◆ HAL_IRDA_Abort()
Abort ongoing transfers (blocking mode).
- Parameters
-
- Note
- This procedure could be used for aborting any ongoing transfer started in Interrupt or DMA mode. This procedure performs following operations :
- Disable PPP Interrupts
- Disable the DMA transfer in the peripheral register (if enabled)
- Abort DMA transfer by calling HAL_DMA_Abort (in case of transfer in DMA mode)
- Set handle State to READY
-
This procedure is executed in blocking mode : when exiting function, Abort is considered as completed.
- Return values
-
Definition at line 1306 of file stm32f4xx_hal_irda.c.
◆ HAL_IRDA_Abort_IT()
Abort ongoing transfers (Interrupt mode).
- Parameters
-
- Note
- This procedure could be used for aborting any ongoing transfer started in Interrupt or DMA mode. This procedure performs following operations :
- Disable PPP Interrupts
- Disable the DMA transfer in the peripheral register (if enabled)
- Abort DMA transfer by calling HAL_DMA_Abort_IT (in case of transfer in DMA mode)
- Set handle State to READY
- At abort completion, call user abort complete callback
-
This procedure is executed in Interrupt mode, meaning that abort procedure could be considered as completed only when user abort complete callback is executed (not when exiting function).
- Return values
-
Definition at line 1457 of file stm32f4xx_hal_irda.c.
◆ HAL_IRDA_AbortCpltCallback()
IRDA Abort Complete callback.
- Parameters
-
hirda | Pointer to a IRDA_HandleTypeDef structure that contains the configuration information for the specified IRDA module. |
- Return values
-
Definition at line 1957 of file stm32f4xx_hal_irda.c.
◆ HAL_IRDA_AbortReceive()
Abort ongoing Receive transfer (blocking mode).
- Parameters
-
- Note
- This procedure could be used for aborting any ongoing transfer started in Interrupt or DMA mode. This procedure performs following operations :
- Disable PPP Interrupts
- Disable the DMA transfer in the peripheral register (if enabled)
- Abort DMA transfer by calling HAL_DMA_Abort (in case of transfer in DMA mode)
- Set handle State to READY
-
This procedure is executed in blocking mode : when exiting function, Abort is considered as completed.
- Return values
-
Definition at line 1412 of file stm32f4xx_hal_irda.c.
◆ HAL_IRDA_AbortReceive_IT()
Abort ongoing Receive transfer (Interrupt mode).
- Parameters
-
- Note
- This procedure could be used for aborting any ongoing transfer started in Interrupt or DMA mode. This procedure performs following operations :
- Disable PPP Interrupts
- Disable the DMA transfer in the peripheral register (if enabled)
- Abort DMA transfer by calling HAL_DMA_Abort_IT (in case of transfer in DMA mode)
- Set handle State to READY
- At abort completion, call user abort complete callback
-
This procedure is executed in Interrupt mode, meaning that abort procedure could be considered as completed only when user abort complete callback is executed (not when exiting function).
- Return values
-
Definition at line 1662 of file stm32f4xx_hal_irda.c.
◆ HAL_IRDA_AbortReceiveCpltCallback()
IRDA Abort Receive Complete callback.
- Parameters
-
hirda | Pointer to a IRDA_HandleTypeDef structure that contains the configuration information for the specified IRDA module. |
- Return values
-
Definition at line 1989 of file stm32f4xx_hal_irda.c.
◆ HAL_IRDA_AbortTransmit()
Abort ongoing Transmit transfer (blocking mode).
- Parameters
-
- Note
- This procedure could be used for aborting any ongoing transfer started in Interrupt or DMA mode. This procedure performs following operations :
- Disable PPP Interrupts
- Disable the DMA transfer in the peripheral register (if enabled)
- Abort DMA transfer by calling HAL_DMA_Abort (in case of transfer in DMA mode)
- Set handle State to READY
-
This procedure is executed in blocking mode : when exiting function, Abort is considered as completed.
- Return values
-
Definition at line 1370 of file stm32f4xx_hal_irda.c.
◆ HAL_IRDA_AbortTransmit_IT()
Abort ongoing Transmit transfer (Interrupt mode).
- Parameters
-
- Note
- This procedure could be used for aborting any ongoing transfer started in Interrupt or DMA mode. This procedure performs following operations :
- Disable IRDA Interrupts (Tx)
- Disable the DMA transfer in the peripheral register (if enabled)
- Abort DMA transfer by calling HAL_DMA_Abort_IT (in case of transfer in DMA mode)
- Set handle State to READY
- At abort completion, call user abort complete callback
-
This procedure is executed in Interrupt mode, meaning that abort procedure could be considered as completed only when user abort complete callback is executed (not when exiting function).
- Return values
-
Definition at line 1585 of file stm32f4xx_hal_irda.c.
◆ HAL_IRDA_AbortTransmitCpltCallback()
IRDA Abort Transmit Complete callback.
- Parameters
-
hirda | Pointer to a IRDA_HandleTypeDef structure that contains the configuration information for the specified IRDA module. |
- Return values
-
Definition at line 1973 of file stm32f4xx_hal_irda.c.
◆ HAL_IRDA_DMAPause()
Pauses the DMA Transfer.
- Parameters
-
hirda | Pointer to a IRDA_HandleTypeDef structure that contains the configuration information for the specified IRDA module. |
- Return values
-
Definition at line 1178 of file stm32f4xx_hal_irda.c.
◆ HAL_IRDA_DMAResume()
Resumes the DMA Transfer.
- Parameters
-
hirda | Pointer to a IRDA_HandleTypeDef structure that contains the configuration information for the specified IRDA module. |
- Return values
-
Definition at line 1215 of file stm32f4xx_hal_irda.c.
◆ HAL_IRDA_DMAStop()
Stops the DMA Transfer.
- Parameters
-
hirda | Pointer to a IRDA_HandleTypeDef structure that contains the configuration information for the specified IRDA module. |
- Return values
-
Definition at line 1254 of file stm32f4xx_hal_irda.c.
◆ HAL_IRDA_ErrorCallback()
IRDA error callback.
- Parameters
-
hirda | Pointer to a IRDA_HandleTypeDef structure that contains the configuration information for the specified IRDA module. |
- Return values
-
Definition at line 1941 of file stm32f4xx_hal_irda.c.
◆ HAL_IRDA_IRQHandler()
This function handles IRDA interrupt request.
- Parameters
-
hirda | Pointer to a IRDA_HandleTypeDef structure that contains the configuration information for the specified IRDA module. |
- Return values
-
Definition at line 1732 of file stm32f4xx_hal_irda.c.
◆ HAL_IRDA_Receive()
HAL_StatusTypeDef HAL_IRDA_Receive |
( |
IRDA_HandleTypeDef * |
hirda, |
|
|
uint8_t * |
pData, |
|
|
uint16_t |
Size, |
|
|
uint32_t |
Timeout |
|
) |
| |
Receive an amount of data in blocking mode.
- Note
- When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01), the received data is handled as a set of u16. In this case, Size must reflect the number of u16 available through pData.
- Parameters
-
hirda | Pointer to a IRDA_HandleTypeDef structure that contains the configuration information for the specified IRDA module. |
pData | Pointer to data buffer (u8 or u16 data elements). |
Size | Amount of data elements (u8 or u16) to be received. |
Timeout | Specify timeout value |
- Return values
-
Definition at line 849 of file stm32f4xx_hal_irda.c.
◆ HAL_IRDA_Receive_DMA()
HAL_StatusTypeDef HAL_IRDA_Receive_DMA |
( |
IRDA_HandleTypeDef * |
hirda, |
|
|
uint8_t * |
pData, |
|
|
uint16_t |
Size |
|
) |
| |
Receives an amount of data in DMA mode.
- Note
- When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01), the received data is handled as a set of u16. In this case, Size must reflect the number of u16 available through pData.
- Parameters
-
hirda | Pointer to a IRDA_HandleTypeDef structure that contains the configuration information for the specified IRDA module. |
pData | Pointer to data buffer (u8 or u16 data elements). |
Size | Amount of data elements (u8 or u16) to be received. |
- Note
- When the IRDA parity is enabled (PCE = 1) the data received contain the parity bit.
- Return values
-
Definition at line 1108 of file stm32f4xx_hal_irda.c.
◆ HAL_IRDA_Receive_IT()
HAL_StatusTypeDef HAL_IRDA_Receive_IT |
( |
IRDA_HandleTypeDef * |
hirda, |
|
|
uint8_t * |
pData, |
|
|
uint16_t |
Size |
|
) |
| |
Receive an amount of data in non blocking mode.
- Note
- When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01), the received data is handled as a set of u16. In this case, Size must reflect the number of u16 available through pData.
- Parameters
-
hirda | Pointer to a IRDA_HandleTypeDef structure that contains the configuration information for the specified IRDA module. |
pData | Pointer to data buffer (u8 or u16 data elements). |
Size | Amount of data elements (u8 or u16) to be received. |
- Return values
-
Definition at line 984 of file stm32f4xx_hal_irda.c.
◆ HAL_IRDA_RxCpltCallback()
Rx Transfer complete callback.
- Parameters
-
hirda | Pointer to a IRDA_HandleTypeDef structure that contains the configuration information for the specified IRDA module. |
- Return values
-
Definition at line 1909 of file stm32f4xx_hal_irda.c.
◆ HAL_IRDA_RxHalfCpltCallback()
Rx Half Transfer complete callback.
- Parameters
-
hirda | Pointer to a IRDA_HandleTypeDef structure that contains the configuration information for the specified IRDA module. |
- Return values
-
Definition at line 1925 of file stm32f4xx_hal_irda.c.
◆ HAL_IRDA_Transmit()
HAL_StatusTypeDef HAL_IRDA_Transmit |
( |
IRDA_HandleTypeDef * |
hirda, |
|
|
const uint8_t * |
pData, |
|
|
uint16_t |
Size, |
|
|
uint32_t |
Timeout |
|
) |
| |
Sends an amount of data in blocking mode.
- Note
- When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01), the sent data is handled as a set of u16. In this case, Size must reflect the number of u16 available through pData.
- Parameters
-
hirda | Pointer to a IRDA_HandleTypeDef structure that contains the configuration information for the specified IRDA module. |
pData | Pointer to data buffer (u8 or u16 data elements). |
Size | Amount of data elements (u8 or u16) to be sent. |
Timeout | Specify timeout value. |
- Return values
-
Definition at line 764 of file stm32f4xx_hal_irda.c.
◆ HAL_IRDA_Transmit_DMA()
HAL_StatusTypeDef HAL_IRDA_Transmit_DMA |
( |
IRDA_HandleTypeDef * |
hirda, |
|
|
const uint8_t * |
pData, |
|
|
uint16_t |
Size |
|
) |
| |
Send an amount of data in DMA mode.
- Note
- When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01), the sent data is handled as a set of u16. In this case, Size must reflect the number of u16 available through pData.
- Parameters
-
hirda | Pointer to a IRDA_HandleTypeDef structure that contains the configuration information for the specified IRDA module. |
pData | Pointer to data buffer (u8 or u16 data elements). |
Size | Amount of data elements (u8 or u16) to be sent. |
- Return values
-
Definition at line 1040 of file stm32f4xx_hal_irda.c.
◆ HAL_IRDA_Transmit_IT()
HAL_StatusTypeDef HAL_IRDA_Transmit_IT |
( |
IRDA_HandleTypeDef * |
hirda, |
|
|
const uint8_t * |
pData, |
|
|
uint16_t |
Size |
|
) |
| |
Send an amount of data in non blocking mode.
- Note
- When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01), the sent data is handled as a set of u16. In this case, Size must reflect the number of u16 available through pData.
- Parameters
-
hirda | Pointer to a IRDA_HandleTypeDef structure that contains the configuration information for the specified IRDA module. |
pData | Pointer to data buffer (u8 or u16 data elements). |
Size | Amount of data elements (u8 or u16) to be sent. |
- Return values
-
Definition at line 939 of file stm32f4xx_hal_irda.c.
◆ HAL_IRDA_TxCpltCallback()
Tx Transfer complete callback.
- Parameters
-
hirda | Pointer to a IRDA_HandleTypeDef structure that contains the configuration information for the specified IRDA module. |
- Return values
-
Definition at line 1877 of file stm32f4xx_hal_irda.c.
◆ HAL_IRDA_TxHalfCpltCallback()
Tx Half Transfer completed callback.
- Parameters
-
hirda | Pointer to a IRDA_HandleTypeDef structure that contains the configuration information for the specified USART module. |
- Return values
-
Definition at line 1893 of file stm32f4xx_hal_irda.c.