STM32L486xx HAL User Manual
Defines
SAI Exported Macros
SAI

macros to handle interrupts and specific configurations More...

Defines

#define __HAL_SAI_RESET_HANDLE_STATE(__HANDLE__)
 Reset SAI handle state.
#define __HAL_SAI_ENABLE_IT(__HANDLE__, __INTERRUPT__)   ((__HANDLE__)->Instance->IMR |= (__INTERRUPT__))
 Enable the specified SAI interrupts.
#define __HAL_SAI_DISABLE_IT(__HANDLE__, __INTERRUPT__)   ((__HANDLE__)->Instance->IMR &= (~(__INTERRUPT__)))
 Disable the specified SAI interrupts.
#define __HAL_SAI_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__)   ((((__HANDLE__)->Instance->IMR & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
 Check whether the specified SAI interrupt source is enabled or not.
#define __HAL_SAI_GET_FLAG(__HANDLE__, __FLAG__)   ((((__HANDLE__)->Instance->SR) & (__FLAG__)) == (__FLAG__))
 Check whether the specified SAI flag is set or not.
#define __HAL_SAI_CLEAR_FLAG(__HANDLE__, __FLAG__)   ((__HANDLE__)->Instance->CLRFR = (__FLAG__))
 Clear the specified SAI pending flag.
#define __HAL_SAI_ENABLE(__HANDLE__)   ((__HANDLE__)->Instance->CR1 |= SAI_xCR1_SAIEN)
 Enable SAI.
#define __HAL_SAI_DISABLE(__HANDLE__)   ((__HANDLE__)->Instance->CR1 &= ~SAI_xCR1_SAIEN)
 Disable SAI.

Detailed Description

macros to handle interrupts and specific configurations


Define Documentation

#define __HAL_SAI_CLEAR_FLAG (   __HANDLE__,
  __FLAG__ 
)    ((__HANDLE__)->Instance->CLRFR = (__FLAG__))

Clear the specified SAI pending flag.

Parameters:
__HANDLE__specifies the SAI Handle.
__FLAG__specifies the flag to check. This parameter can be any combination of the following values:
  • SAI_FLAG_OVRUDR: Clear Overrun underrun
  • SAI_FLAG_MUTEDET: Clear Mute detection
  • SAI_FLAG_WCKCFG: Clear Wrong Clock Configuration
  • SAI_FLAG_FREQ: Clear FIFO request
  • SAI_FLAG_CNRDY: Clear Codec not ready
  • SAI_FLAG_AFSDET: Clear Anticipated frame synchronization detection
  • SAI_FLAG_LFSDET: Clear Late frame synchronization detection
Return values:
None

Definition at line 741 of file stm32l4xx_hal_sai.h.

Referenced by HAL_SAI_IRQHandler(), SAI_Receive_IT16Bit(), SAI_Receive_IT32Bit(), and SAI_Receive_IT8Bit().

#define __HAL_SAI_DISABLE (   __HANDLE__)    ((__HANDLE__)->Instance->CR1 &= ~SAI_xCR1_SAIEN)

Disable SAI.

Parameters:
__HANDLE__specifies the SAI Handle.
Return values:
None

Definition at line 753 of file stm32l4xx_hal_sai.h.

Referenced by SAI_Disable().

#define __HAL_SAI_DISABLE_IT (   __HANDLE__,
  __INTERRUPT__ 
)    ((__HANDLE__)->Instance->IMR &= (~(__INTERRUPT__)))

Disable the specified SAI interrupts.

Parameters:
__HANDLE__specifies the SAI Handle.
__INTERRUPT__specifies the interrupt source to enable or disable. This parameter can be one of the following values:
  • SAI_IT_OVRUDR: Overrun underrun interrupt enable
  • SAI_IT_MUTEDET: Mute detection interrupt enable
  • SAI_IT_WCKCFG: Wrong Clock Configuration interrupt enable
  • SAI_IT_FREQ: FIFO request interrupt enable
  • SAI_IT_CNRDY: Codec not ready interrupt enable
  • SAI_IT_AFSDET: Anticipated frame synchronization detection interrupt enable
  • SAI_IT_LFSDET: Late frame synchronization detection interrupt enable
Return values:
None

Definition at line 695 of file stm32l4xx_hal_sai.h.

Referenced by HAL_SAI_DisableRxMuteMode(), SAI_DMARxCplt(), SAI_DMATxCplt(), SAI_Receive_IT16Bit(), SAI_Receive_IT32Bit(), SAI_Receive_IT8Bit(), SAI_Transmit_IT16Bit(), SAI_Transmit_IT32Bit(), and SAI_Transmit_IT8Bit().

#define __HAL_SAI_ENABLE (   __HANDLE__)    ((__HANDLE__)->Instance->CR1 |= SAI_xCR1_SAIEN)

Enable SAI.

Parameters:
__HANDLE__specifies the SAI Handle.
Return values:
None

Definition at line 747 of file stm32l4xx_hal_sai.h.

Referenced by HAL_SAI_DMAResume(), HAL_SAI_Receive(), HAL_SAI_Receive_DMA(), HAL_SAI_Receive_IT(), HAL_SAI_Transmit(), HAL_SAI_Transmit_DMA(), and HAL_SAI_Transmit_IT().

#define __HAL_SAI_ENABLE_IT (   __HANDLE__,
  __INTERRUPT__ 
)    ((__HANDLE__)->Instance->IMR |= (__INTERRUPT__))

Enable the specified SAI interrupts.

Parameters:
__HANDLE__specifies the SAI Handle.
__INTERRUPT__specifies the interrupt source to enable or disable. This parameter can be one of the following values:
  • SAI_IT_OVRUDR: Overrun underrun interrupt enable
  • SAI_IT_MUTEDET: Mute detection interrupt enable
  • SAI_IT_WCKCFG: Wrong Clock Configuration interrupt enable
  • SAI_IT_FREQ: FIFO request interrupt enable
  • SAI_IT_CNRDY: Codec not ready interrupt enable
  • SAI_IT_AFSDET: Anticipated frame synchronization detection interrupt enable
  • SAI_IT_LFSDET: Late frame synchronization detection interrupt enable
Return values:
None

Definition at line 680 of file stm32l4xx_hal_sai.h.

Referenced by HAL_SAI_EnableRxMuteMode(), HAL_SAI_Receive_DMA(), HAL_SAI_Receive_IT(), HAL_SAI_Transmit_DMA(), and HAL_SAI_Transmit_IT().

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

Check whether the specified SAI flag is set or not.

Parameters:
__HANDLE__specifies the SAI Handle.
__FLAG__specifies the flag to check. This parameter can be one of the following values:
  • SAI_FLAG_OVRUDR: Overrun underrun flag.
  • SAI_FLAG_MUTEDET: Mute detection flag.
  • SAI_FLAG_WCKCFG: Wrong Clock Configuration flag.
  • SAI_FLAG_FREQ: FIFO request flag.
  • SAI_FLAG_CNRDY: Codec not ready flag.
  • SAI_FLAG_AFSDET: Anticipated frame synchronization detection flag.
  • SAI_FLAG_LFSDET: Late frame synchronization detection flag.
Return values:
Thenew state of __FLAG__ (TRUE or FALSE).

Definition at line 725 of file stm32l4xx_hal_sai.h.

#define __HAL_SAI_GET_IT_SOURCE (   __HANDLE__,
  __INTERRUPT__ 
)    ((((__HANDLE__)->Instance->IMR & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)

Check whether the specified SAI interrupt source is enabled or not.

Parameters:
__HANDLE__specifies the SAI Handle.
__INTERRUPT__specifies the SAI interrupt source to check. This parameter can be one of the following values:
  • SAI_IT_OVRUDR: Overrun underrun interrupt enable
  • SAI_IT_MUTEDET: Mute detection interrupt enable
  • SAI_IT_WCKCFG: Wrong Clock Configuration interrupt enable
  • SAI_IT_FREQ: FIFO request interrupt enable
  • SAI_IT_CNRDY: Codec not ready interrupt enable
  • SAI_IT_AFSDET: Anticipated frame synchronization detection interrupt enable
  • SAI_IT_LFSDET: Late frame synchronization detection interrupt enable
Return values:
Thenew state of __INTERRUPT__ (TRUE or FALSE).

Definition at line 710 of file stm32l4xx_hal_sai.h.

#define __HAL_SAI_RESET_HANDLE_STATE (   __HANDLE__)
Value:
do{                                            \
                                                     (__HANDLE__)->State = HAL_SAI_STATE_RESET; \
                                                     (__HANDLE__)->MspInitCallback = NULL;      \
                                                     (__HANDLE__)->MspDeInitCallback = NULL;    \
                                                   } while(0)

Reset SAI handle state.

Parameters:
__HANDLE__specifies the SAI Handle.
Return values:
None

Definition at line 658 of file stm32l4xx_hal_sai.h.