STM32F4xx HAL Documentation
Hardware Abstraction Layer for STM32F4 familiy
Loading...
Searching...
No Matches
SAI Private Functions

Private functions. More...

Collaboration diagram for SAI Private Functions:

Functions

static void SAI_FillFifo (SAI_HandleTypeDef *hsai)
 Fill the fifo.
 
static uint32_t SAI_InterruptFlag (const SAI_HandleTypeDef *hsai, uint32_t mode)
 Return the interrupt flag to set according the SAI setup.
 
static HAL_StatusTypeDef SAI_InitI2S (SAI_HandleTypeDef *hsai, uint32_t protocol, uint32_t datasize, uint32_t nbslot)
 Initialize the SAI I2S protocol according to the specified parameters in the SAI_InitTypeDef and create the associated handle.
 
static HAL_StatusTypeDef SAI_InitPCM (SAI_HandleTypeDef *hsai, uint32_t protocol, uint32_t datasize, uint32_t nbslot)
 Initialize the SAI PCM protocol according to the specified parameters in the SAI_InitTypeDef and create the associated handle.
 
static HAL_StatusTypeDef SAI_Disable (SAI_HandleTypeDef *hsai)
 Disable the SAI and wait for the disabling.
 
static void SAI_Transmit_IT8Bit (SAI_HandleTypeDef *hsai)
 Tx Handler for Transmit in Interrupt mode 8-Bit transfer.
 
static void SAI_Transmit_IT16Bit (SAI_HandleTypeDef *hsai)
 Tx Handler for Transmit in Interrupt mode for 16-Bit transfer.
 
static void SAI_Transmit_IT32Bit (SAI_HandleTypeDef *hsai)
 Tx Handler for Transmit in Interrupt mode for 32-Bit transfer.
 
static void SAI_Receive_IT8Bit (SAI_HandleTypeDef *hsai)
 Rx Handler for Receive in Interrupt mode 8-Bit transfer.
 
static void SAI_Receive_IT16Bit (SAI_HandleTypeDef *hsai)
 Rx Handler for Receive in Interrupt mode for 16-Bit transfer.
 
static void SAI_Receive_IT32Bit (SAI_HandleTypeDef *hsai)
 Rx Handler for Receive in Interrupt mode for 32-Bit transfer.
 
static void SAI_DMATxCplt (DMA_HandleTypeDef *hdma)
 DMA SAI transmit process complete callback.
 
static void SAI_DMATxHalfCplt (DMA_HandleTypeDef *hdma)
 DMA SAI transmit process half complete callback.
 
static void SAI_DMARxCplt (DMA_HandleTypeDef *hdma)
 DMA SAI receive process complete callback.
 
static void SAI_DMARxHalfCplt (DMA_HandleTypeDef *hdma)
 DMA SAI receive process half complete callback.
 
static void SAI_DMAError (DMA_HandleTypeDef *hdma)
 DMA SAI communication error callback.
 
static void SAI_DMAAbort (DMA_HandleTypeDef *hdma)
 DMA SAI Abort callback.
 

Detailed Description

Private functions.

Function Documentation

◆ SAI_FillFifo()

static void SAI_FillFifo ( SAI_HandleTypeDef * hsai)
static

#include <stm32f4xx_hal_sai.c>

Fill the fifo.

Parameters
hsaipointer to a SAI_HandleTypeDef structure that contains the configuration information for SAI module.
Return values
None

Definition at line 2111 of file stm32f4xx_hal_sai.c.

References SAI_InitTypeDef::CompandingMode, SAI_InitTypeDef::DataSize, __SAI_HandleTypeDef::Init, __SAI_HandleTypeDef::Instance, __SAI_HandleTypeDef::pBuffPtr, SAI_DATASIZE_16, SAI_DATASIZE_8, SAI_FIFOSTATUS_FULL, SAI_NOCOMPANDING, and __SAI_HandleTypeDef::XferCount.

Referenced by HAL_SAI_Transmit(), and HAL_SAI_Transmit_IT().

◆ SAI_InterruptFlag()

static uint32_t SAI_InterruptFlag ( const SAI_HandleTypeDef * hsai,
uint32_t mode )
static

#include <stm32f4xx_hal_sai.c>

Return the interrupt flag to set according the SAI setup.

Parameters
hsaipointer to a SAI_HandleTypeDef structure that contains the configuration information for SAI module.
modeSAI_MODE_DMA or SAI_MODE_IT
Return values
thelist of the IT flag to enable

Definition at line 2141 of file stm32f4xx_hal_sai.c.

References SAI_InitTypeDef::AudioMode, __SAI_HandleTypeDef::Init, SAI_InitTypeDef::Protocol, SAI_AC97_PROTOCOL, SAI_IT_AFSDET, SAI_IT_CNRDY, SAI_IT_FREQ, SAI_IT_LFSDET, SAI_IT_OVRUDR, SAI_IT_WCKCFG, SAI_MODE_IT, SAI_MODEMASTER_RX, SAI_MODESLAVE_RX, and SAI_MODESLAVE_TX.

Referenced by HAL_SAI_Receive_DMA(), HAL_SAI_Receive_IT(), HAL_SAI_Transmit_DMA(), HAL_SAI_Transmit_IT(), SAI_DMARxCplt(), SAI_DMATxCplt(), SAI_Receive_IT16Bit(), SAI_Receive_IT32Bit(), SAI_Receive_IT8Bit(), SAI_Transmit_IT16Bit(), SAI_Transmit_IT32Bit(), and SAI_Transmit_IT8Bit().

◆ SAI_InitI2S()

static HAL_StatusTypeDef SAI_InitI2S ( SAI_HandleTypeDef * hsai,
uint32_t protocol,
uint32_t datasize,
uint32_t nbslot )
static

#include <stm32f4xx_hal_sai.c>

Initialize the SAI I2S protocol according to the specified parameters in the SAI_InitTypeDef and create the associated handle.

Parameters
hsaipointer to a SAI_HandleTypeDef structure that contains the configuration information for SAI module.
protocolone of the supported protocol.
datasizeone of the supported datasize SAI protocol data size the configuration information for SAI module.
nbslotnumber of slot minimum value is 2 and max is 16. the value must be a multiple of 2.
Return values
HALstatus

Definition at line 1952 of file stm32f4xx_hal_sai.c.

References SAI_FrameInitTypeDef::ActiveFrameLength, SAI_InitTypeDef::AudioMode, SAI_InitTypeDef::ClockStrobing, SAI_InitTypeDef::DataSize, SAI_InitTypeDef::FirstBit, SAI_SlotInitTypeDef::FirstBitOffset, __SAI_HandleTypeDef::FrameInit, SAI_FrameInitTypeDef::FrameLength, SAI_FrameInitTypeDef::FSDefinition, SAI_FrameInitTypeDef::FSOffset, SAI_FrameInitTypeDef::FSPolarity, HAL_ERROR, HAL_OK, __SAI_HandleTypeDef::Init, SAI_InitTypeDef::Protocol, SAI_CLOCKSTROBING_FALLINGEDGE, SAI_CLOCKSTROBING_RISINGEDGE, SAI_DATASIZE_16, SAI_DATASIZE_24, SAI_DATASIZE_32, SAI_FIRSTBIT_MSB, SAI_FREE_PROTOCOL, SAI_FS_ACTIVE_HIGH, SAI_FS_ACTIVE_LOW, SAI_FS_BEFOREFIRSTBIT, SAI_FS_CHANNEL_IDENTIFICATION, SAI_FS_FIRSTBIT, SAI_I2S_LSBJUSTIFIED, SAI_I2S_STANDARD, SAI_MODEMASTER_TX, SAI_MODESLAVE_TX, SAI_PROTOCOL_DATASIZE_16BIT, SAI_PROTOCOL_DATASIZE_16BITEXTENDED, SAI_PROTOCOL_DATASIZE_24BIT, SAI_PROTOCOL_DATASIZE_32BIT, SAI_SLOTACTIVE_ALL, SAI_SLOTSIZE_16B, SAI_SLOTSIZE_32B, SAI_SlotInitTypeDef::SlotActive, __SAI_HandleTypeDef::SlotInit, SAI_SlotInitTypeDef::SlotNumber, and SAI_SlotInitTypeDef::SlotSize.

Referenced by HAL_SAI_InitProtocol().

◆ SAI_InitPCM()

static HAL_StatusTypeDef SAI_InitPCM ( SAI_HandleTypeDef * hsai,
uint32_t protocol,
uint32_t datasize,
uint32_t nbslot )
static

#include <stm32f4xx_hal_sai.c>

Initialize the SAI PCM protocol according to the specified parameters in the SAI_InitTypeDef and create the associated handle.

Parameters
hsaipointer to a SAI_HandleTypeDef structure that contains the configuration information for SAI module.
protocolone of the supported protocol
datasizeone of the supported datasize SAI protocol data size
nbslotnumber of slot minimum value is 1 and the max is 16.
Return values
HALstatus

Definition at line 2044 of file stm32f4xx_hal_sai.c.

References SAI_FrameInitTypeDef::ActiveFrameLength, SAI_InitTypeDef::AudioMode, SAI_InitTypeDef::ClockStrobing, SAI_InitTypeDef::DataSize, SAI_InitTypeDef::FirstBit, SAI_SlotInitTypeDef::FirstBitOffset, __SAI_HandleTypeDef::FrameInit, SAI_FrameInitTypeDef::FrameLength, SAI_FrameInitTypeDef::FSDefinition, SAI_FrameInitTypeDef::FSOffset, SAI_FrameInitTypeDef::FSPolarity, HAL_ERROR, HAL_OK, __SAI_HandleTypeDef::Init, SAI_InitTypeDef::Protocol, SAI_CLOCKSTROBING_FALLINGEDGE, SAI_CLOCKSTROBING_RISINGEDGE, SAI_DATASIZE_16, SAI_DATASIZE_24, SAI_DATASIZE_32, SAI_FIRSTBIT_MSB, SAI_FREE_PROTOCOL, SAI_FS_ACTIVE_HIGH, SAI_FS_BEFOREFIRSTBIT, SAI_FS_STARTFRAME, SAI_MODEMASTER_TX, SAI_MODESLAVE_TX, SAI_PCM_SHORT, SAI_PROTOCOL_DATASIZE_16BIT, SAI_PROTOCOL_DATASIZE_16BITEXTENDED, SAI_PROTOCOL_DATASIZE_24BIT, SAI_PROTOCOL_DATASIZE_32BIT, SAI_SLOTACTIVE_ALL, SAI_SLOTSIZE_16B, SAI_SLOTSIZE_32B, SAI_SlotInitTypeDef::SlotActive, __SAI_HandleTypeDef::SlotInit, SAI_SlotInitTypeDef::SlotNumber, and SAI_SlotInitTypeDef::SlotSize.

Referenced by HAL_SAI_InitProtocol().

◆ SAI_Disable()

static HAL_StatusTypeDef SAI_Disable ( SAI_HandleTypeDef * hsai)
static

#include <stm32f4xx_hal_sai.c>

Disable the SAI and wait for the disabling.

Parameters
hsaipointer to a SAI_HandleTypeDef structure that contains the configuration information for SAI module.
Return values
None

Definition at line 2174 of file stm32f4xx_hal_sai.c.

References __HAL_SAI_DISABLE, __SAI_HandleTypeDef::ErrorCode, HAL_OK, HAL_SAI_ERROR_TIMEOUT, HAL_TIMEOUT, __SAI_HandleTypeDef::Instance, and SAI_DEFAULT_TIMEOUT.

Referenced by HAL_SAI_Abort(), HAL_SAI_DeInit(), HAL_SAI_DMAStop(), HAL_SAI_Init(), HAL_SAI_Receive(), HAL_SAI_Transmit(), SAI_DMAAbort(), and SAI_DMAError().

◆ SAI_Transmit_IT8Bit()

static void SAI_Transmit_IT8Bit ( SAI_HandleTypeDef * hsai)
static

#include <stm32f4xx_hal_sai.c>

Tx Handler for Transmit in Interrupt mode 8-Bit transfer.

Parameters
hsaipointer to a SAI_HandleTypeDef structure that contains the configuration information for SAI module.
Return values
None

Definition at line 2204 of file stm32f4xx_hal_sai.c.

References __HAL_SAI_DISABLE_IT, HAL_SAI_STATE_READY, HAL_SAI_TxCpltCallback(), __SAI_HandleTypeDef::Instance, __SAI_HandleTypeDef::pBuffPtr, SAI_InterruptFlag(), SAI_MODE_IT, __SAI_HandleTypeDef::State, and __SAI_HandleTypeDef::XferCount.

Referenced by HAL_SAI_Transmit_IT().

◆ SAI_Transmit_IT16Bit()

static void SAI_Transmit_IT16Bit ( SAI_HandleTypeDef * hsai)
static

#include <stm32f4xx_hal_sai.c>

Tx Handler for Transmit in Interrupt mode for 16-Bit transfer.

Parameters
hsaipointer to a SAI_HandleTypeDef structure that contains the configuration information for SAI module.
Return values
None

Definition at line 2232 of file stm32f4xx_hal_sai.c.

References __HAL_SAI_DISABLE_IT, HAL_SAI_STATE_READY, HAL_SAI_TxCpltCallback(), __SAI_HandleTypeDef::Instance, __SAI_HandleTypeDef::pBuffPtr, SAI_InterruptFlag(), SAI_MODE_IT, __SAI_HandleTypeDef::State, and __SAI_HandleTypeDef::XferCount.

Referenced by HAL_SAI_Transmit_IT().

◆ SAI_Transmit_IT32Bit()

static void SAI_Transmit_IT32Bit ( SAI_HandleTypeDef * hsai)
static

#include <stm32f4xx_hal_sai.c>

Tx Handler for Transmit in Interrupt mode for 32-Bit transfer.

Parameters
hsaipointer to a SAI_HandleTypeDef structure that contains the configuration information for SAI module.
Return values
None

Definition at line 2261 of file stm32f4xx_hal_sai.c.

References __HAL_SAI_DISABLE_IT, HAL_SAI_STATE_READY, HAL_SAI_TxCpltCallback(), __SAI_HandleTypeDef::Instance, __SAI_HandleTypeDef::pBuffPtr, SAI_InterruptFlag(), SAI_MODE_IT, __SAI_HandleTypeDef::State, and __SAI_HandleTypeDef::XferCount.

Referenced by HAL_SAI_Transmit_IT().

◆ SAI_Receive_IT8Bit()

static void SAI_Receive_IT8Bit ( SAI_HandleTypeDef * hsai)
static

#include <stm32f4xx_hal_sai.c>

Rx Handler for Receive in Interrupt mode 8-Bit transfer.

Parameters
hsaipointer to a SAI_HandleTypeDef structure that contains the configuration information for SAI module.
Return values
None

Definition at line 2290 of file stm32f4xx_hal_sai.c.

References __HAL_SAI_CLEAR_FLAG, __HAL_SAI_DISABLE_IT, HAL_SAI_RxCpltCallback(), HAL_SAI_STATE_READY, __SAI_HandleTypeDef::Instance, __SAI_HandleTypeDef::pBuffPtr, SAI_FLAG_OVRUDR, SAI_InterruptFlag(), SAI_MODE_IT, __SAI_HandleTypeDef::State, and __SAI_HandleTypeDef::XferCount.

Referenced by HAL_SAI_Receive_IT().

◆ SAI_Receive_IT16Bit()

static void SAI_Receive_IT16Bit ( SAI_HandleTypeDef * hsai)
static

#include <stm32f4xx_hal_sai.c>

Rx Handler for Receive in Interrupt mode for 16-Bit transfer.

Parameters
hsaipointer to a SAI_HandleTypeDef structure that contains the configuration information for SAI module.
Return values
None

Definition at line 2320 of file stm32f4xx_hal_sai.c.

References __HAL_SAI_CLEAR_FLAG, __HAL_SAI_DISABLE_IT, HAL_SAI_RxCpltCallback(), HAL_SAI_STATE_READY, __SAI_HandleTypeDef::Instance, __SAI_HandleTypeDef::pBuffPtr, SAI_FLAG_OVRUDR, SAI_InterruptFlag(), SAI_MODE_IT, __SAI_HandleTypeDef::State, and __SAI_HandleTypeDef::XferCount.

Referenced by HAL_SAI_Receive_IT().

◆ SAI_Receive_IT32Bit()

static void SAI_Receive_IT32Bit ( SAI_HandleTypeDef * hsai)
static

#include <stm32f4xx_hal_sai.c>

Rx Handler for Receive in Interrupt mode for 32-Bit transfer.

Parameters
hsaipointer to a SAI_HandleTypeDef structure that contains the configuration information for SAI module.
Return values
None

Definition at line 2351 of file stm32f4xx_hal_sai.c.

References __HAL_SAI_CLEAR_FLAG, __HAL_SAI_DISABLE_IT, HAL_SAI_RxCpltCallback(), HAL_SAI_STATE_READY, __SAI_HandleTypeDef::Instance, __SAI_HandleTypeDef::pBuffPtr, SAI_FLAG_OVRUDR, SAI_InterruptFlag(), SAI_MODE_IT, __SAI_HandleTypeDef::State, and __SAI_HandleTypeDef::XferCount.

Referenced by HAL_SAI_Receive_IT().

◆ SAI_DMATxCplt()

static void SAI_DMATxCplt ( DMA_HandleTypeDef * hdma)
static

#include <stm32f4xx_hal_sai.c>

DMA SAI transmit process complete callback.

Parameters
hdmapointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA module.
Return values
None

Definition at line 2382 of file stm32f4xx_hal_sai.c.

References __HAL_SAI_DISABLE_IT, DMA_CIRCULAR, HAL_SAI_STATE_READY, HAL_SAI_TxCpltCallback(), __DMA_HandleTypeDef::Init, __SAI_HandleTypeDef::Instance, DMA_InitTypeDef::Mode, SAI_InterruptFlag(), SAI_MODE_DMA, __SAI_HandleTypeDef::State, and __SAI_HandleTypeDef::XferCount.

Referenced by HAL_SAI_Transmit_DMA().

◆ SAI_DMATxHalfCplt()

static void SAI_DMATxHalfCplt ( DMA_HandleTypeDef * hdma)
static

#include <stm32f4xx_hal_sai.c>

DMA SAI transmit process half complete callback.

Parameters
hdmapointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA module.
Return values
None

Definition at line 2411 of file stm32f4xx_hal_sai.c.

References HAL_SAI_TxHalfCpltCallback().

Referenced by HAL_SAI_Transmit_DMA().

◆ SAI_DMARxCplt()

static void SAI_DMARxCplt ( DMA_HandleTypeDef * hdma)
static

#include <stm32f4xx_hal_sai.c>

DMA SAI receive process complete callback.

Parameters
hdmapointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA module.
Return values
None

Definition at line 2428 of file stm32f4xx_hal_sai.c.

References __HAL_SAI_DISABLE_IT, DMA_CIRCULAR, HAL_SAI_RxCpltCallback(), HAL_SAI_STATE_READY, __DMA_HandleTypeDef::Init, __SAI_HandleTypeDef::Instance, DMA_InitTypeDef::Mode, SAI_InterruptFlag(), SAI_MODE_DMA, __SAI_HandleTypeDef::State, and __SAI_HandleTypeDef::XferCount.

Referenced by HAL_SAI_Receive_DMA().

◆ SAI_DMARxHalfCplt()

static void SAI_DMARxHalfCplt ( DMA_HandleTypeDef * hdma)
static

#include <stm32f4xx_hal_sai.c>

DMA SAI receive process half complete callback.

Parameters
hdmapointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA module.
Return values
None

Definition at line 2456 of file stm32f4xx_hal_sai.c.

References HAL_SAI_RxHalfCpltCallback().

Referenced by HAL_SAI_Receive_DMA().

◆ SAI_DMAError()

static void SAI_DMAError ( DMA_HandleTypeDef * hdma)
static

#include <stm32f4xx_hal_sai.c>

DMA SAI communication error callback.

Parameters
hdmapointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA module.
Return values
None

Definition at line 2473 of file stm32f4xx_hal_sai.c.

References __DMA_HandleTypeDef::ErrorCode, __SAI_HandleTypeDef::ErrorCode, HAL_DMA_ERROR_TE, HAL_SAI_ERROR_DMA, HAL_SAI_ErrorCallback(), HAL_SAI_STATE_READY, __SAI_HandleTypeDef::hdmarx, __SAI_HandleTypeDef::hdmatx, __SAI_HandleTypeDef::Instance, SAI_Disable(), __SAI_HandleTypeDef::State, and __SAI_HandleTypeDef::XferCount.

Referenced by HAL_SAI_Receive_DMA(), and HAL_SAI_Transmit_DMA().

◆ SAI_DMAAbort()

static void SAI_DMAAbort ( DMA_HandleTypeDef * hdma)
static

#include <stm32f4xx_hal_sai.c>

DMA SAI Abort callback.

Parameters
hdmapointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA module.
Return values
None

Definition at line 2508 of file stm32f4xx_hal_sai.c.

References __SAI_HandleTypeDef::ErrorCode, HAL_SAI_ERROR_WCKCFG, HAL_SAI_ErrorCallback(), HAL_SAI_STATE_READY, __SAI_HandleTypeDef::Instance, SAI_Disable(), __SAI_HandleTypeDef::State, and __SAI_HandleTypeDef::XferCount.

Referenced by HAL_SAI_IRQHandler().