STM32F439xx HAL User Manual
Defines
IRDA Exported Macros
IRDA

Defines

#define __HAL_IRDA_RESET_HANDLE_STATE(__HANDLE__)
 Reset IRDA handle gstate & RxState.
#define __HAL_IRDA_FLUSH_DRREGISTER(__HANDLE__)   ((__HANDLE__)->Instance->DR)
 Flushs the IRDA DR register.
#define __HAL_IRDA_GET_FLAG(__HANDLE__, __FLAG__)   (((__HANDLE__)->Instance->SR & (__FLAG__)) == (__FLAG__))
 Checks whether the specified IRDA flag is set or not.
#define __HAL_IRDA_CLEAR_FLAG(__HANDLE__, __FLAG__)   ((__HANDLE__)->Instance->SR = ~(__FLAG__))
 Clears the specified IRDA pending flag.
#define __HAL_IRDA_CLEAR_PEFLAG(__HANDLE__)
 Clear the IRDA PE pending flag.
#define __HAL_IRDA_CLEAR_FEFLAG(__HANDLE__)   __HAL_IRDA_CLEAR_PEFLAG(__HANDLE__)
 Clear the IRDA FE pending flag.
#define __HAL_IRDA_CLEAR_NEFLAG(__HANDLE__)   __HAL_IRDA_CLEAR_PEFLAG(__HANDLE__)
 Clear the IRDA NE pending flag.
#define __HAL_IRDA_CLEAR_OREFLAG(__HANDLE__)   __HAL_IRDA_CLEAR_PEFLAG(__HANDLE__)
 Clear the IRDA ORE pending flag.
#define __HAL_IRDA_CLEAR_IDLEFLAG(__HANDLE__)   __HAL_IRDA_CLEAR_PEFLAG(__HANDLE__)
 Clear the IRDA IDLE pending flag.
#define __HAL_IRDA_ENABLE_IT(__HANDLE__, __INTERRUPT__)
 Enables or disables the specified IRDA interrupt.
#define __HAL_IRDA_DISABLE_IT(__HANDLE__, __INTERRUPT__)
#define __HAL_IRDA_GET_IT_SOURCE(__HANDLE__, __IT__)
 Checks whether the specified IRDA interrupt has occurred or not.
#define __HAL_IRDA_ONE_BIT_SAMPLE_ENABLE(__HANDLE__)   ((__HANDLE__)->Instance->CR3|= USART_CR3_ONEBIT)
 Macro to enable the IRDA's one bit sample method.
#define __HAL_IRDA_ONE_BIT_SAMPLE_DISABLE(__HANDLE__)   ((__HANDLE__)->Instance->CR3 &= (uint16_t)~((uint16_t)USART_CR3_ONEBIT))
 Macro to disable the IRDA's one bit sample method.
#define __HAL_IRDA_ENABLE(__HANDLE__)   ((__HANDLE__)->Instance->CR1 |= USART_CR1_UE)
 Enable UART/USART associated to IRDA Handle.
#define __HAL_IRDA_DISABLE(__HANDLE__)   ((__HANDLE__)->Instance->CR1 &= ~USART_CR1_UE)
 Disable UART/USART associated to IRDA Handle.

Define Documentation

#define __HAL_IRDA_CLEAR_FEFLAG (   __HANDLE__)    __HAL_IRDA_CLEAR_PEFLAG(__HANDLE__)

Clear the IRDA FE pending flag.

Parameters:
__HANDLE__specifies the USART Handle. This parameter can be USARTx where x: 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
Return values:
None

Definition at line 371 of file stm32f4xx_hal_irda.h.

#define __HAL_IRDA_CLEAR_FLAG (   __HANDLE__,
  __FLAG__ 
)    ((__HANDLE__)->Instance->SR = ~(__FLAG__))

Clears the specified IRDA pending flag.

Parameters:
__HANDLE__specifies the USART Handle. This parameter can be USARTx where x: 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
__FLAG__specifies the flag to check. This parameter can be any combination of the following values:
  • IRDA_FLAG_TC: Transmission Complete flag.
  • IRDA_FLAG_RXNE: Receive data register not empty flag.
Note:
PE (Parity error), FE (Framing error), NE (Noise error), ORE (OverRun error) and IDLE (Idle line detected) flags are cleared by software sequence: a read operation to USART_SR register followed by a read operation to USART_DR register.
RXNE flag can be also cleared by a read to the USART_DR register.
TC flag can be also cleared by software sequence: a read operation to USART_SR register followed by a write operation to USART_DR register.
TXE flag is cleared only by a write to the USART_DR register.
Return values:
None

Definition at line 350 of file stm32f4xx_hal_irda.h.

Referenced by HAL_IRDA_Transmit_DMA().

#define __HAL_IRDA_CLEAR_IDLEFLAG (   __HANDLE__)    __HAL_IRDA_CLEAR_PEFLAG(__HANDLE__)

Clear the IRDA IDLE pending flag.

Parameters:
__HANDLE__specifies the USART Handle. This parameter can be USARTx where x: 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
Return values:
None

Definition at line 395 of file stm32f4xx_hal_irda.h.

#define __HAL_IRDA_CLEAR_NEFLAG (   __HANDLE__)    __HAL_IRDA_CLEAR_PEFLAG(__HANDLE__)

Clear the IRDA NE pending flag.

Parameters:
__HANDLE__specifies the USART Handle. This parameter can be USARTx where x: 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
Return values:
None

Definition at line 379 of file stm32f4xx_hal_irda.h.

#define __HAL_IRDA_CLEAR_OREFLAG (   __HANDLE__)    __HAL_IRDA_CLEAR_PEFLAG(__HANDLE__)

Clear the IRDA ORE pending flag.

Parameters:
__HANDLE__specifies the USART Handle. This parameter can be USARTx where x: 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
Return values:
None

Definition at line 387 of file stm32f4xx_hal_irda.h.

Referenced by HAL_IRDA_DMAResume(), and HAL_IRDA_Receive_DMA().

#define __HAL_IRDA_CLEAR_PEFLAG (   __HANDLE__)
Value:
do{                                           \
    __IO uint32_t tmpreg = 0x00U;               \
    tmpreg = (__HANDLE__)->Instance->SR;        \
    UNUSED(tmpreg);                             \
  } while(0U)

Clear the IRDA PE pending flag.

Parameters:
__HANDLE__specifies the USART Handle. This parameter can be USARTx where x: 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
Return values:
None

Definition at line 358 of file stm32f4xx_hal_irda.h.

#define __HAL_IRDA_DISABLE (   __HANDLE__)    ((__HANDLE__)->Instance->CR1 &= ~USART_CR1_UE)

Disable UART/USART associated to IRDA Handle.

Parameters:
__HANDLE__specifies the IRDA Handle. IRDA Handle selects the USARTx or UARTy peripheral (USART,UART availability and x,y values depending on device).
Return values:
None

Definition at line 461 of file stm32f4xx_hal_irda.h.

Referenced by HAL_IRDA_DeInit(), and HAL_IRDA_Init().

#define __HAL_IRDA_DISABLE_IT (   __HANDLE__,
  __INTERRUPT__ 
)
Value:
((((__INTERRUPT__) >> 28U) == 1U)? ((__HANDLE__)->Instance->CR1 &= ~((__INTERRUPT__) & IRDA_IT_MASK)): \
                                                           (((__INTERRUPT__) >> 28U) == 2U)? ((__HANDLE__)->Instance->CR2 &= ~((__INTERRUPT__) & IRDA_IT_MASK)): \
                                                           ((__HANDLE__)->Instance->CR3 &= ~ ((__INTERRUPT__) & IRDA_IT_MASK)))

Definition at line 414 of file stm32f4xx_hal_irda.h.

#define __HAL_IRDA_ENABLE (   __HANDLE__)    ((__HANDLE__)->Instance->CR1 |= USART_CR1_UE)

Enable UART/USART associated to IRDA Handle.

Parameters:
__HANDLE__specifies the IRDA Handle. IRDA Handle selects the USARTx or UARTy peripheral (USART,UART availability and x,y values depending on device).
Return values:
None

Definition at line 453 of file stm32f4xx_hal_irda.h.

Referenced by HAL_IRDA_Init().

#define __HAL_IRDA_ENABLE_IT (   __HANDLE__,
  __INTERRUPT__ 
)
Value:
((((__INTERRUPT__) >> 28U) == 1U)? ((__HANDLE__)->Instance->CR1 |= ((__INTERRUPT__) & IRDA_IT_MASK)): \
                                                           (((__INTERRUPT__) >> 28U) == 2U)? ((__HANDLE__)->Instance->CR2 |=  ((__INTERRUPT__) & IRDA_IT_MASK)): \
                                                        ((__HANDLE__)->Instance->CR3 |= ((__INTERRUPT__) & IRDA_IT_MASK)))

Enables or disables the specified IRDA interrupt.

Parameters:
__HANDLE__specifies the USART Handle. This parameter can be USARTx where x: 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
__INTERRUPT__specifies the IRDA interrupt source to check. This parameter can be one of the following values:
  • IRDA_IT_TXE: Transmit Data Register empty interrupt
  • IRDA_IT_TC: Transmission complete interrupt
  • IRDA_IT_RXNE: Receive Data register not empty interrupt
  • IRDA_IT_IDLE: Idle line detection interrupt
  • IRDA_IT_PE: Parity Error interrupt
  • IRDA_IT_ERR: Error interrupt(Frame error, noise error, overrun error)
Return values:
None

Definition at line 411 of file stm32f4xx_hal_irda.h.

#define __HAL_IRDA_FLUSH_DRREGISTER (   __HANDLE__)    ((__HANDLE__)->Instance->DR)

Flushs the IRDA DR register.

Parameters:
__HANDLE__specifies the USART Handle. This parameter can be USARTx where x: 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.

Definition at line 310 of file stm32f4xx_hal_irda.h.

#define __HAL_IRDA_GET_FLAG (   __HANDLE__,
  __FLAG__ 
)    (((__HANDLE__)->Instance->SR & (__FLAG__)) == (__FLAG__))

Checks whether the specified IRDA flag is set or not.

Parameters:
__HANDLE__specifies the USART Handle. This parameter can be USARTx where x: 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
__FLAG__specifies the flag to check. This parameter can be one of the following values:
  • IRDA_FLAG_TXE: Transmit data register empty flag
  • IRDA_FLAG_TC: Transmission Complete flag
  • IRDA_FLAG_RXNE: Receive data register not empty flag
  • IRDA_FLAG_IDLE: Idle Line detection flag
  • IRDA_FLAG_ORE: OverRun Error flag
  • IRDA_FLAG_NE: Noise Error flag
  • IRDA_FLAG_FE: Framing Error flag
  • IRDA_FLAG_PE: Parity Error flag
Return values:
Thenew state of __FLAG__ (TRUE or FALSE).

Definition at line 328 of file stm32f4xx_hal_irda.h.

Referenced by IRDA_WaitOnFlagUntilTimeout().

#define __HAL_IRDA_GET_IT_SOURCE (   __HANDLE__,
  __IT__ 
)
Value:
(((((__IT__) >> 28U) == 1U)? (__HANDLE__)->Instance->CR1:(((((uint32_t)(__IT__)) >> 28U) == 2U)? \
                                                      (__HANDLE__)->Instance->CR2 : (__HANDLE__)->Instance->CR3)) & (((uint32_t)(__IT__)) & IRDA_IT_MASK))

Checks whether the specified IRDA interrupt has occurred or not.

Parameters:
__HANDLE__specifies the USART Handle. This parameter can be USARTx where x: 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
__IT__specifies the IRDA interrupt source to check. This parameter can be one of the following values:
  • IRDA_IT_TXE: Transmit Data Register empty interrupt
  • IRDA_IT_TC: Transmission complete interrupt
  • IRDA_IT_RXNE: Receive Data register not empty interrupt
  • IRDA_IT_IDLE: Idle line detection interrupt
  • USART_IT_ERR: Error interrupt
  • IRDA_IT_PE: Parity Error interrupt
Return values:
Thenew state of __IT__ (TRUE or FALSE).

Definition at line 432 of file stm32f4xx_hal_irda.h.

#define __HAL_IRDA_ONE_BIT_SAMPLE_DISABLE (   __HANDLE__)    ((__HANDLE__)->Instance->CR3 &= (uint16_t)~((uint16_t)USART_CR3_ONEBIT))

Macro to disable the IRDA's one bit sample method.

Parameters:
__HANDLE__specifies the IRDA Handle.
Return values:
None

Definition at line 445 of file stm32f4xx_hal_irda.h.

#define __HAL_IRDA_ONE_BIT_SAMPLE_ENABLE (   __HANDLE__)    ((__HANDLE__)->Instance->CR3|= USART_CR3_ONEBIT)

Macro to enable the IRDA's one bit sample method.

Parameters:
__HANDLE__specifies the IRDA Handle.
Return values:
None

Definition at line 439 of file stm32f4xx_hal_irda.h.

#define __HAL_IRDA_RESET_HANDLE_STATE (   __HANDLE__)
Value:
do{                                                   \
                                                       (__HANDLE__)->gState = HAL_IRDA_STATE_RESET;      \
                                                       (__HANDLE__)->RxState = HAL_IRDA_STATE_RESET;     \
                                                     } while(0U)

Reset IRDA handle gstate & RxState.

Parameters:
__HANDLE__specifies the USART Handle. This parameter can be USARTx where x: 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
Return values:
None

Definition at line 300 of file stm32f4xx_hal_irda.h.