HAL SAI functions ΒΆ
Initialization and DeInitialization functions ΒΆ
- group SAI_Exported_Functions_Group1
-
This section provides a set of functions allowing to initialize and deinitialize the SAI peripheral:
-
Call the function HAL_SAI_Init() to initialize the selected SAI handle and associate a SAI block.
-
Call the function HAL_SAI_DeInit() to deinitialize the SAI.
Functions
-
hal_status_t
HAL_SAI_Init
(
hal_sai_handle_t
*
hsai
,
hal_sai_block_t
block
)
ΒΆ
-
Initialize the SAI according to the associated handle.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
block β SAI block.
-
- Return values :
-
-
HAL_INVALID_PARAM β When the handle is NULL.
-
HAL_OK β SAI driver correctly initialized for the given SAI block.
-
HAL_ERROR β SAI semaphore creation is failed (USE_HAL_MUTEX is set to 1).
-
-
void
HAL_SAI_DeInit
(
hal_sai_handle_t
*
hsai
)
ΒΆ
-
DeInitialize the SAI.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
-
- group SAI_Exported_Functions_Group1
-
This section provides a set of functions allowing to initialize and deinitialize the SAI peripheral:
-
Call the function HAL_SAI_Init() to initialize the selected SAI handle and associate a SAI block.
-
Call the function HAL_SAI_DeInit() to deinitialize the SAI.
Functions
-
hal_status_t
HAL_SAI_Init
(
hal_sai_handle_t
*
hsai
,
hal_sai_block_t
block
)
-
Initialize the SAI according to the associated handle.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
block β SAI block.
-
- Return values :
-
-
HAL_INVALID_PARAM β When the handle is NULL.
-
HAL_OK β SAI driver correctly initialized for the given SAI block.
-
HAL_ERROR β SAI semaphore creation is failed (USE_HAL_MUTEX is set to 1).
-
-
void
HAL_SAI_DeInit
(
hal_sai_handle_t
*
hsai
)
-
DeInitialize the SAI.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
-
- group SAI_Exported_Functions_Group1
-
This section provides a set of functions allowing to initialize and deinitialize the SAI peripheral:
-
Call the function HAL_SAI_Init() to initialize the selected SAI handle and associate a SAI block.
-
Call the function HAL_SAI_DeInit() to deinitialize the SAI.
Functions
-
hal_status_t
HAL_SAI_Init
(
hal_sai_handle_t
*
hsai
,
hal_sai_block_t
block
)
-
Initialize the SAI according to the associated handle.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
block β SAI block.
-
- Return values :
-
-
HAL_INVALID_PARAM β When the handle is NULL.
-
HAL_OK β SAI driver correctly initialized for the given SAI block.
-
HAL_ERROR β SAI semaphore creation is failed (USE_HAL_MUTEX is set to 1).
-
-
void
HAL_SAI_DeInit
(
hal_sai_handle_t
*
hsai
)
-
DeInitialize the SAI.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
-
Configuration functions ΒΆ
- group SAI_Exported_Functions_Group2
-
This section provides a set of functions allowing to configure the SAI driver:
-
Call the function HAL_SAI_SetConfig() to set the different fields needed before starting the SAI driver.
-
Call the function HAL_SAI_GetConfig() to retrieve the configuration.
-
Call the function HAL_SAI_SetSync() to set the synchronization.
-
Call the function HAL_SAI_GetSync() to retrieve the synchronization.
-
Call the function HAL_SAI_SetSyncOutput() to set the synchronization output.
-
Call the function HAL_SAI_GetSyncOutput() to retrieve the synchronization output.
-
Call the function HAL_SAI_SetFifoThreshold() to set the FIFO threshold.
-
Call the function HAL_SAI_GetFifoThreshold() to retrieve the FIFO threshold.
-
Call the function HAL_SAI_SetCompanding() to set the companding.
-
Call the function HAL_SAI_GetCompanding() to retrieve the companding.
-
Call the function HAL_SAI_SetPdmMicDelay() to set the PDM micro delay.
-
Call the function HAL_SAI_GetPdmMicDelay() to retrieve the PDM micro delay.
-
Call the function HAL_SAI_SetTxDMA() to set the DMA channel for transmission.
-
Call the function HAL_SAI_SetRxDMA() to set the DMA channel for reception.
-
Call the function HAL_SAI_SetAudioFrequency() to set the audio frequency.
-
Call the function HAL_SAI_GetAudioFrequency() to retrieve the audio frequency.
-
Call the function HAL_SAI_GetRealAudioFrequency() to retrieve the real audio frequency.
-
Call the function HAL_SAI_SetDataSize() to set the data size.
-
Call the function HAL_SAI_GetDataSize() to retrieve the data size.
-
Call the function HAL_SAI_SetSlotActive() to set the slot active.
-
Call the function HAL_SAI_GetSlotActive() to retrieve the slot active.
Functions
-
hal_status_t
HAL_SAI_SetConfig
(
hal_sai_handle_t
*
hsai
,
const
hal_sai_config_t
*
p_config
)
ΒΆ
-
Configure the SAI driver.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_config β Pointer on hal_sai_config_t structure.
-
- Return values :
-
-
HAL_OK β SAI block has been correctly configured.
-
HAL_INVALID_PARAM β When the p_config pointer is NULL.
-
-
void
HAL_SAI_GetConfig
(
const
hal_sai_handle_t
*
hsai
,
hal_sai_config_t
*
p_config
)
ΒΆ
-
Get the configuration.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_config β Pointer on hal_sai_config_t structure.
-
-
hal_status_t
HAL_SAI_SetSync
(
hal_sai_handle_t
*
hsai
,
hal_sai_sync_t
sync
)
ΒΆ
-
Set the synchronization.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
sync β Synchronization.
-
- Return values :
-
HAL_OK β SAI synchronization has been correctly configured.
-
hal_sai_sync_t
HAL_SAI_GetSync
(
const
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Get the synchronization.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_sync_t β SAI synchronization.
-
hal_status_t
HAL_SAI_SetSyncOutput
(
hal_sai_handle_t
*
hsai
,
hal_sai_sync_output_t
sync_output
)
ΒΆ
-
Set the synchronization output.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
sync_output β Synchronization output.
-
- Return values :
-
HAL_OK β SAI synchronization output has been correctly configured.
-
hal_sai_sync_output_t
HAL_SAI_GetSyncOutput
(
const
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Get the synchronization output.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_sync_output_t β SAI synchronization output.
-
hal_status_t
HAL_SAI_SetFifoThreshold
(
hal_sai_handle_t
*
hsai
,
hal_sai_fifo_threshold_t
fifo_threshold
)
ΒΆ
-
Set the FIFO threshold.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
fifo_threshold β FIFO threshold.
-
- Return values :
-
HAL_OK β SAI FIFO threshold has been correctly configured.
-
hal_sai_fifo_threshold_t
HAL_SAI_GetFifoThreshold
(
const
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Get the FIFO threshold.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_fifo_threshold_t β SAI FIFO threshold.
-
hal_status_t
HAL_SAI_SetCompanding
(
hal_sai_handle_t
*
hsai
,
hal_sai_companding_t
companding
)
ΒΆ
-
Set the companding.
Warning
Companding mode is applicable only when free protocol mode is selected.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
companding β Companding mode.
-
- Return values :
-
HAL_OK β SAI companding mode has been correctly configured.
-
hal_sai_companding_t
HAL_SAI_GetCompanding
(
const
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Get the companding.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_companding_t β SAI companding mode.
-
hal_status_t
HAL_SAI_SetPdmMicDelay
(
const
hal_sai_handle_t
*
hsai
,
const
hal_sai_pdm_mic_delay_t
*
p_pdm_mic_delay
)
ΒΆ
-
Configure the PDM micro delay.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_pdm_mic_delay β Pointer on hal_sai_pdm_mic_delay_t structure.
-
- Return values :
-
-
HAL_OK β SAI PDM micro delay has been correctly configured.
-
HAL_ERROR β SAI PDM micro delay cannot be configured.
-
HAL_INVALID_PARAM β When the p_pdm_mic_delay pointer is NULL.
-
-
void
HAL_SAI_GetPdmMicDelay
(
const
hal_sai_handle_t
*
hsai
,
hal_sai_pdm_mic_delay_t
*
p_pdm_mic_delay
)
ΒΆ
-
Get the PDM micro delay.
Note
pdm_mic_pairs_nbr must be filled before calling this function.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_pdm_mic_delay β Pointer on hal_sai_pdm_mic_delay_t structure.
-
-
hal_status_t
HAL_SAI_SetTxDMA
(
hal_sai_handle_t
*
hsai
,
hal_dma_handle_t
*
hdma_tx
)
ΒΆ
-
Set DMA channel for transmission.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
hdma_tx β Pointer to a hal_dma_handle_t structure which contains the DMA instance.
-
- Return values :
-
-
HAL_OK β The channel has been correctly set.
-
HAL_INVALID_PARAM β hdma_tx is NULL.
-
-
hal_status_t
HAL_SAI_SetRxDMA
(
hal_sai_handle_t
*
hsai
,
hal_dma_handle_t
*
hdma_rx
)
ΒΆ
-
Set DMA channel for reception.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
hdma_rx β Pointer to a hal_dma_handle_t structure which contains the DMA instance.
-
- Return values :
-
-
HAL_OK β The channel has been correctly set.
-
HAL_INVALID_PARAM β hdma_rx is NULL.
-
-
hal_status_t
HAL_SAI_SetAudioFrequency
(
hal_sai_handle_t
*
hsai
,
hal_sai_audio_frequency_t
audio_frequency
)
ΒΆ
-
Set the audio frequency.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
audio_frequency β Audio frequency.
-
- Return values :
-
HAL_OK β SAI audio frequency has been correctly configured.
-
hal_sai_audio_frequency_t
HAL_SAI_GetAudioFrequency
(
const
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Get the audio frequency.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_audio_frequency_t β SAI audio frequency.
-
uint32_t
HAL_SAI_GetRealAudioFrequency
(
const
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Get the real audio frequency.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
uint32_t β SAI real audio frequency in hertz.
-
hal_status_t
HAL_SAI_SetDataSize
(
hal_sai_handle_t
*
hsai
,
hal_sai_data_size_t
data_size
)
ΒΆ
-
Set the data size.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
data_size β Data size.
-
- Return values :
-
HAL_OK β SAI data size has been correctly configured.
-
hal_sai_data_size_t
HAL_SAI_GetDataSize
(
const
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Get the data size.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_data_size_t β SAI data size.
-
hal_status_t
HAL_SAI_SetSlotActive
(
hal_sai_handle_t
*
hsai
,
uint32_t
slot_active
)
ΒΆ
-
Set the slot active.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
slot_active β Slot active.
-
- Return values :
-
HAL_OK β SAI slot active has been correctly configured.
-
uint32_t
HAL_SAI_GetSlotActive
(
const
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Get the slot active.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
uint32_t β SAI slot active. This parameter can be a combination of SAI Block Slot Active .
-
- group SAI_Exported_Functions_Group2
-
This section provides a set of functions allowing to configure the SAI driver:
-
Call the function HAL_SAI_SetConfig() to set the different fields needed before starting the SAI driver.
-
Call the function HAL_SAI_GetConfig() to retrieve the configuration.
-
Call the function HAL_SAI_SetSync() to set the synchronization.
-
Call the function HAL_SAI_GetSync() to retrieve the synchronization.
-
Call the function HAL_SAI_SetSyncOutput() to set the synchronization output.
-
Call the function HAL_SAI_GetSyncOutput() to retrieve the synchronization output.
-
Call the function HAL_SAI_SetFifoThreshold() to set the FIFO threshold.
-
Call the function HAL_SAI_GetFifoThreshold() to retrieve the FIFO threshold.
-
Call the function HAL_SAI_SetCompanding() to set the companding.
-
Call the function HAL_SAI_GetCompanding() to retrieve the companding.
-
Call the function HAL_SAI_SetPdmMicDelay() to set the PDM micro delay.
-
Call the function HAL_SAI_GetPdmMicDelay() to retrieve the PDM micro delay.
-
Call the function HAL_SAI_SetTxDMA() to set the DMA channel for transmission.
-
Call the function HAL_SAI_SetRxDMA() to set the DMA channel for reception.
-
Call the function HAL_SAI_SetAudioFrequency() to set the audio frequency.
-
Call the function HAL_SAI_GetAudioFrequency() to retrieve the audio frequency.
-
Call the function HAL_SAI_GetRealAudioFrequency() to retrieve the real audio frequency.
-
Call the function HAL_SAI_SetDataSize() to set the data size.
-
Call the function HAL_SAI_GetDataSize() to retrieve the data size.
-
Call the function HAL_SAI_SetSlotActive() to set the slot active.
-
Call the function HAL_SAI_GetSlotActive() to retrieve the slot active.
Functions
-
hal_status_t
HAL_SAI_SetConfig
(
hal_sai_handle_t
*
hsai
,
const
hal_sai_config_t
*
p_config
)
-
Configure the SAI driver.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_config β Pointer on hal_sai_config_t structure.
-
- Return values :
-
-
HAL_OK β SAI block has been correctly configured.
-
HAL_INVALID_PARAM β When the p_config pointer is NULL.
-
-
void
HAL_SAI_GetConfig
(
const
hal_sai_handle_t
*
hsai
,
hal_sai_config_t
*
p_config
)
-
Get the configuration.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_config β Pointer on hal_sai_config_t structure.
-
-
hal_status_t
HAL_SAI_SetSync
(
hal_sai_handle_t
*
hsai
,
hal_sai_sync_t
sync
)
-
Set the synchronization.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
sync β Synchronization.
-
- Return values :
-
HAL_OK β SAI synchronization has been correctly configured.
-
hal_sai_sync_t
HAL_SAI_GetSync
(
const
hal_sai_handle_t
*
hsai
)
-
Get the synchronization.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_sync_t β SAI synchronization.
-
hal_status_t
HAL_SAI_SetSyncOutput
(
hal_sai_handle_t
*
hsai
,
hal_sai_sync_output_t
sync_output
)
-
Set the synchronization output.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
sync_output β Synchronization output.
-
- Return values :
-
HAL_OK β SAI synchronization output has been correctly configured.
-
hal_sai_sync_output_t
HAL_SAI_GetSyncOutput
(
const
hal_sai_handle_t
*
hsai
)
-
Get the synchronization output.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_sync_output_t β SAI synchronization output.
-
hal_status_t
HAL_SAI_SetFifoThreshold
(
hal_sai_handle_t
*
hsai
,
hal_sai_fifo_threshold_t
fifo_threshold
)
-
Set the FIFO threshold.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
fifo_threshold β FIFO threshold.
-
- Return values :
-
HAL_OK β SAI FIFO threshold has been correctly configured.
-
hal_sai_fifo_threshold_t
HAL_SAI_GetFifoThreshold
(
const
hal_sai_handle_t
*
hsai
)
-
Get the FIFO threshold.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_fifo_threshold_t β SAI FIFO threshold.
-
hal_status_t
HAL_SAI_SetCompanding
(
hal_sai_handle_t
*
hsai
,
hal_sai_companding_t
companding
)
-
Set the companding.
Warning
Companding mode is applicable only when free protocol mode is selected.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
companding β Companding mode.
-
- Return values :
-
HAL_OK β SAI companding mode has been correctly configured.
-
hal_sai_companding_t
HAL_SAI_GetCompanding
(
const
hal_sai_handle_t
*
hsai
)
-
Get the companding.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_companding_t β SAI companding mode.
-
hal_status_t
HAL_SAI_SetPdmMicDelay
(
const
hal_sai_handle_t
*
hsai
,
const
hal_sai_pdm_mic_delay_t
*
p_pdm_mic_delay
)
-
Configure the PDM micro delay.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_pdm_mic_delay β Pointer on hal_sai_pdm_mic_delay_t structure.
-
- Return values :
-
-
HAL_OK β SAI PDM micro delay has been correctly configured.
-
HAL_ERROR β SAI PDM micro delay cannot be configured.
-
HAL_INVALID_PARAM β When the p_pdm_mic_delay pointer is NULL.
-
-
void
HAL_SAI_GetPdmMicDelay
(
const
hal_sai_handle_t
*
hsai
,
hal_sai_pdm_mic_delay_t
*
p_pdm_mic_delay
)
-
Get the PDM micro delay.
Note
pdm_mic_pairs_nbr must be filled before calling this function.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_pdm_mic_delay β Pointer on hal_sai_pdm_mic_delay_t structure.
-
-
hal_status_t
HAL_SAI_SetTxDMA
(
hal_sai_handle_t
*
hsai
,
hal_dma_handle_t
*
hdma_tx
)
-
Set DMA channel for transmission.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
hdma_tx β Pointer to a hal_dma_handle_t structure which contains the DMA instance.
-
- Return values :
-
-
HAL_OK β The channel has been correctly set.
-
HAL_INVALID_PARAM β hdma_tx is NULL.
-
-
hal_status_t
HAL_SAI_SetRxDMA
(
hal_sai_handle_t
*
hsai
,
hal_dma_handle_t
*
hdma_rx
)
-
Set DMA channel for reception.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
hdma_rx β Pointer to a hal_dma_handle_t structure which contains the DMA instance.
-
- Return values :
-
-
HAL_OK β The channel has been correctly set.
-
HAL_INVALID_PARAM β hdma_rx is NULL.
-
-
hal_status_t
HAL_SAI_SetAudioFrequency
(
hal_sai_handle_t
*
hsai
,
hal_sai_audio_frequency_t
audio_frequency
)
-
Set the audio frequency.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
audio_frequency β Audio frequency.
-
- Return values :
-
HAL_OK β SAI audio frequency has been correctly configured.
-
hal_sai_audio_frequency_t
HAL_SAI_GetAudioFrequency
(
const
hal_sai_handle_t
*
hsai
)
-
Get the audio frequency.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_audio_frequency_t β SAI audio frequency.
-
uint32_t
HAL_SAI_GetRealAudioFrequency
(
const
hal_sai_handle_t
*
hsai
)
-
Get the real audio frequency.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
uint32_t β SAI real audio frequency in hertz.
-
hal_status_t
HAL_SAI_SetDataSize
(
hal_sai_handle_t
*
hsai
,
hal_sai_data_size_t
data_size
)
-
Set the data size.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
data_size β Data size.
-
- Return values :
-
HAL_OK β SAI data size has been correctly configured.
-
hal_sai_data_size_t
HAL_SAI_GetDataSize
(
const
hal_sai_handle_t
*
hsai
)
-
Get the data size.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_data_size_t β SAI data size.
-
hal_status_t
HAL_SAI_SetSlotActive
(
hal_sai_handle_t
*
hsai
,
uint32_t
slot_active
)
-
Set the slot active.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
slot_active β Slot active.
-
- Return values :
-
HAL_OK β SAI slot active has been correctly configured.
-
uint32_t
HAL_SAI_GetSlotActive
(
const
hal_sai_handle_t
*
hsai
)
-
Get the slot active.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
uint32_t β SAI slot active. This parameter can be a combination of SAI Block Slot Active .
-
- group SAI_Exported_Functions_Group2
-
This section provides a set of functions allowing to configure the SAI driver:
-
Call the function HAL_SAI_SetConfig() to set the different fields needed before starting the SAI driver.
-
Call the function HAL_SAI_GetConfig() to retrieve the configuration.
-
Call the function HAL_SAI_SetSync() to set the synchronization.
-
Call the function HAL_SAI_GetSync() to retrieve the synchronization.
-
Call the function HAL_SAI_SetSyncOutput() to set the synchronization output.
-
Call the function HAL_SAI_GetSyncOutput() to retrieve the synchronization output.
-
Call the function HAL_SAI_SetFifoThreshold() to set the FIFO threshold.
-
Call the function HAL_SAI_GetFifoThreshold() to retrieve the FIFO threshold.
-
Call the function HAL_SAI_SetCompanding() to set the companding.
-
Call the function HAL_SAI_GetCompanding() to retrieve the companding.
-
Call the function HAL_SAI_SetPdmMicDelay() to set the PDM micro delay.
-
Call the function HAL_SAI_GetPdmMicDelay() to retrieve the PDM micro delay.
-
Call the function HAL_SAI_SetTxDMA() to set the DMA channel for transmission.
-
Call the function HAL_SAI_SetRxDMA() to set the DMA channel for reception.
-
Call the function HAL_SAI_SetAudioFrequency() to set the audio frequency.
-
Call the function HAL_SAI_GetAudioFrequency() to retrieve the audio frequency.
-
Call the function HAL_SAI_GetRealAudioFrequency() to retrieve the real audio frequency.
-
Call the function HAL_SAI_SetDataSize() to set the data size.
-
Call the function HAL_SAI_GetDataSize() to retrieve the data size.
-
Call the function HAL_SAI_SetSlotActive() to set the slot active.
-
Call the function HAL_SAI_GetSlotActive() to retrieve the slot active.
Functions
-
hal_status_t
HAL_SAI_SetConfig
(
hal_sai_handle_t
*
hsai
,
const
hal_sai_config_t
*
p_config
)
-
Configure the SAI driver.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_config β Pointer on hal_sai_config_t structure.
-
- Return values :
-
-
HAL_OK β SAI block has been correctly configured.
-
HAL_INVALID_PARAM β When the p_config pointer is NULL.
-
-
void
HAL_SAI_GetConfig
(
const
hal_sai_handle_t
*
hsai
,
hal_sai_config_t
*
p_config
)
-
Get the configuration.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_config β Pointer on hal_sai_config_t structure.
-
-
hal_status_t
HAL_SAI_SetSync
(
hal_sai_handle_t
*
hsai
,
hal_sai_sync_t
sync
)
-
Set the synchronization.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
sync β Synchronization.
-
- Return values :
-
HAL_OK β SAI synchronization has been correctly configured.
-
hal_sai_sync_t
HAL_SAI_GetSync
(
const
hal_sai_handle_t
*
hsai
)
-
Get the synchronization.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_sync_t β SAI synchronization.
-
hal_status_t
HAL_SAI_SetFifoThreshold
(
hal_sai_handle_t
*
hsai
,
hal_sai_fifo_threshold_t
fifo_threshold
)
-
Set the FIFO threshold.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
fifo_threshold β FIFO threshold.
-
- Return values :
-
HAL_OK β SAI FIFO threshold has been correctly configured.
-
hal_sai_fifo_threshold_t
HAL_SAI_GetFifoThreshold
(
const
hal_sai_handle_t
*
hsai
)
-
Get the FIFO threshold.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_fifo_threshold_t β SAI FIFO threshold.
-
hal_status_t
HAL_SAI_SetCompanding
(
hal_sai_handle_t
*
hsai
,
hal_sai_companding_t
companding
)
-
Set the companding.
Warning
Companding mode is applicable only when free protocol mode is selected.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
companding β Companding mode.
-
- Return values :
-
HAL_OK β SAI companding mode has been correctly configured.
-
hal_sai_companding_t
HAL_SAI_GetCompanding
(
const
hal_sai_handle_t
*
hsai
)
-
Get the companding.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_companding_t β SAI companding mode.
-
hal_status_t
HAL_SAI_SetPdmMicDelay
(
const
hal_sai_handle_t
*
hsai
,
const
hal_sai_pdm_mic_delay_t
*
p_pdm_mic_delay
)
-
Configure the PDM micro delay.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_pdm_mic_delay β Pointer on hal_sai_pdm_mic_delay_t structure.
-
- Return values :
-
-
HAL_OK β SAI PDM micro delay has been correctly configured.
-
HAL_ERROR β SAI PDM micro delay cannot be configured.
-
HAL_INVALID_PARAM β When the p_pdm_mic_delay pointer is NULL.
-
-
void
HAL_SAI_GetPdmMicDelay
(
const
hal_sai_handle_t
*
hsai
,
hal_sai_pdm_mic_delay_t
*
p_pdm_mic_delay
)
-
Get the PDM micro delay.
Note
pdm_mic_pairs_nbr must be filled before calling this function.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_pdm_mic_delay β Pointer on hal_sai_pdm_mic_delay_t structure.
-
-
hal_status_t
HAL_SAI_SetTxDMA
(
hal_sai_handle_t
*
hsai
,
hal_dma_handle_t
*
hdma_tx
)
-
Set DMA channel for transmission.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
hdma_tx β Pointer to a hal_dma_handle_t structure which contains the DMA instance.
-
- Return values :
-
-
HAL_OK β The channel has been correctly set.
-
HAL_INVALID_PARAM β hdma_tx is NULL.
-
-
hal_status_t
HAL_SAI_SetRxDMA
(
hal_sai_handle_t
*
hsai
,
hal_dma_handle_t
*
hdma_rx
)
-
Set DMA channel for reception.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
hdma_rx β Pointer to a hal_dma_handle_t structure which contains the DMA instance.
-
- Return values :
-
-
HAL_OK β The channel has been correctly set.
-
HAL_INVALID_PARAM β hdma_rx is NULL.
-
-
hal_status_t
HAL_SAI_SetAudioFrequency
(
hal_sai_handle_t
*
hsai
,
hal_sai_audio_frequency_t
audio_frequency
)
-
Set the audio frequency.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
audio_frequency β Audio frequency.
-
- Return values :
-
HAL_OK β SAI audio frequency has been correctly configured.
-
hal_sai_audio_frequency_t
HAL_SAI_GetAudioFrequency
(
const
hal_sai_handle_t
*
hsai
)
-
Get the audio frequency.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_audio_frequency_t β SAI audio frequency.
-
uint32_t
HAL_SAI_GetRealAudioFrequency
(
const
hal_sai_handle_t
*
hsai
)
-
Get the real audio frequency.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
uint32_t β SAI real audio frequency in hertz.
-
hal_status_t
HAL_SAI_SetDataSize
(
hal_sai_handle_t
*
hsai
,
hal_sai_data_size_t
data_size
)
-
Set the data size.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
data_size β Data size.
-
- Return values :
-
HAL_OK β SAI data size has been correctly configured.
-
hal_sai_data_size_t
HAL_SAI_GetDataSize
(
const
hal_sai_handle_t
*
hsai
)
-
Get the data size.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_data_size_t β SAI data size.
-
hal_status_t
HAL_SAI_SetSlotActive
(
hal_sai_handle_t
*
hsai
,
uint32_t
slot_active
)
-
Set the slot active.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
slot_active β Slot active.
-
- Return values :
-
HAL_OK β SAI slot active has been correctly configured.
-
uint32_t
HAL_SAI_GetSlotActive
(
const
hal_sai_handle_t
*
hsai
)
-
Get the slot active.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
uint32_t β SAI slot active. This parameter can be a combination of SAI Block Slot Active .
-
Control functions ΒΆ
- group SAI_Exported_Functions_Group3
-
This section provides a set of functions allowing to enable/disable SAI features:
-
Call the functions HAL_SAI_EnableMclkOutput() , HAL_SAI_DisableMclkOutput() and HAL_SAI_IsEnabledMclkOutput() to enable, disable the master clock output and check if it is enabled or not.
-
Call the functions HAL_SAI_EnableOutputDrive() , HAL_SAI_DisableOutputDrive() and HAL_SAI_IsEnabledOutputDrive() to enable, disable the output drive and check if it is enabled or not.
-
Call the functions HAL_SAI_EnableTristateSDOutput() , HAL_SAI_DisableTristateSDOutput() and HAL_SAI_IsEnabledTristateSDOutput() to enable, disable the tristate SD output and check if it is enabled or not.
-
Call the functions HAL_SAI_EnableMonoMode() , HAL_SAI_DisableMonoMode() and HAL_SAI_IsEnabledMonoMode() to enable, disable the mono mode and check if it is enabled or not.
-
Call the functions HAL_SAI_EnablePdm() , HAL_SAI_DisablePdm() and HAL_SAI_IsEnabledPdm() to enable, disable the PDM and check if it is enabled or not.
Functions
-
hal_status_t
HAL_SAI_EnableMclkOutput
(
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Enable the master clock output.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β SAI master clock output has been correctly enabled.
-
hal_status_t
HAL_SAI_DisableMclkOutput
(
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Disable the master clock output.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β SAI master clock output has been correctly disabled.
-
hal_sai_mclk_output_status_t
HAL_SAI_IsEnabledMclkOutput
(
const
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Get the master clock output status.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_mclk_output_status_t β SAI master clock output status.
-
hal_status_t
HAL_SAI_EnableOutputDrive
(
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Enable the output drive.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β SAI output drive has been correctly enabled.
-
hal_status_t
HAL_SAI_DisableOutputDrive
(
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Disable the output drive.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β SAI output drive has been correctly disabled.
-
hal_sai_output_drive_status_t
HAL_SAI_IsEnabledOutputDrive
(
const
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Get the output drive status.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_output_drive_status_t β SAI output drive status.
-
hal_status_t
HAL_SAI_EnableTristateSDOutput
(
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Enable the tristate SD output.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β SAI tristate SD output has been correctly enabled.
-
hal_status_t
HAL_SAI_DisableTristateSDOutput
(
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Disable the tristate SD output.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β SAI tristate SD output has been correctly disabled.
-
hal_sai_tristate_sd_output_status_t
HAL_SAI_IsEnabledTristateSDOutput
(
const
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Get the tristate SD output status.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_tristate_sd_output_status_t β SAI tristate SD output status.
-
hal_status_t
HAL_SAI_EnableMonoMode
(
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Enable the mono mode.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β SAI mono mode has been correctly enabled.
-
hal_status_t
HAL_SAI_DisableMonoMode
(
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Disable the mono mode.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β SAI mono mode has been correctly disabled.
-
hal_sai_mono_mode_status_t
HAL_SAI_IsEnabledMonoMode
(
const
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Get the mono mode status.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_mono_mode_status_t β SAI mono mode status.
-
hal_status_t
HAL_SAI_EnablePdm
(
const
hal_sai_handle_t
*
hsai
,
uint32_t
pdm_mic_pairs_nbr
,
hal_sai_pdm_clock_t
clock
)
ΒΆ
-
Enable the PDM.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
pdm_mic_pairs_nbr β Number of micros pairs.
-
clock β PDM clock.
-
- Return values :
-
-
HAL_OK β SAI PDM has been correctly enabled.
-
HAL_ERROR β SAI PDM cannot be enabled.
-
-
hal_status_t
HAL_SAI_DisablePdm
(
const
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Disable the PDM.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
-
HAL_OK β SAI PDM has been correctly disabled.
-
HAL_ERROR β SAI PDM cannot be enabled.
-
-
hal_sai_pdm_status_t
HAL_SAI_IsEnabledPdm
(
const
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Get the PDM status.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_pdm_status_t β SAI PDM status.
-
- group SAI_Exported_Functions_Group3
-
This section provides a set of functions allowing to enable/disable SAI features:
-
Call the functions HAL_SAI_EnableMclkOutput() , HAL_SAI_DisableMclkOutput() and HAL_SAI_IsEnabledMclkOutput() to enable, disable the master clock output and check if it is enabled or not.
-
Call the functions HAL_SAI_EnableOutputDrive() , HAL_SAI_DisableOutputDrive() and HAL_SAI_IsEnabledOutputDrive() to enable, disable the output drive and check if it is enabled or not.
-
Call the functions HAL_SAI_EnableTristateSDOutput() , HAL_SAI_DisableTristateSDOutput() and HAL_SAI_IsEnabledTristateSDOutput() to enable, disable the tristate SD output and check if it is enabled or not.
-
Call the functions HAL_SAI_EnableMonoMode() , HAL_SAI_DisableMonoMode() and HAL_SAI_IsEnabledMonoMode() to enable, disable the mono mode and check if it is enabled or not.
-
Call the functions HAL_SAI_EnablePdm() , HAL_SAI_DisablePdm() and HAL_SAI_IsEnabledPdm() to enable, disable the PDM and check if it is enabled or not.
Functions
-
hal_status_t
HAL_SAI_EnableMclkOutput
(
hal_sai_handle_t
*
hsai
)
-
Enable the master clock output.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β SAI master clock output has been correctly enabled.
-
hal_status_t
HAL_SAI_DisableMclkOutput
(
hal_sai_handle_t
*
hsai
)
-
Disable the master clock output.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β SAI master clock output has been correctly disabled.
-
hal_sai_mclk_output_status_t
HAL_SAI_IsEnabledMclkOutput
(
const
hal_sai_handle_t
*
hsai
)
-
Get the master clock output status.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_mclk_output_status_t β SAI master clock output status.
-
hal_status_t
HAL_SAI_EnableOutputDrive
(
hal_sai_handle_t
*
hsai
)
-
Enable the output drive.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β SAI output drive has been correctly enabled.
-
hal_status_t
HAL_SAI_DisableOutputDrive
(
hal_sai_handle_t
*
hsai
)
-
Disable the output drive.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β SAI output drive has been correctly disabled.
-
hal_sai_output_drive_status_t
HAL_SAI_IsEnabledOutputDrive
(
const
hal_sai_handle_t
*
hsai
)
-
Get the output drive status.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_output_drive_status_t β SAI output drive status.
-
hal_status_t
HAL_SAI_EnableTristateSDOutput
(
hal_sai_handle_t
*
hsai
)
-
Enable the tristate SD output.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β SAI tristate SD output has been correctly enabled.
-
hal_status_t
HAL_SAI_DisableTristateSDOutput
(
hal_sai_handle_t
*
hsai
)
-
Disable the tristate SD output.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β SAI tristate SD output has been correctly disabled.
-
hal_sai_tristate_sd_output_status_t
HAL_SAI_IsEnabledTristateSDOutput
(
const
hal_sai_handle_t
*
hsai
)
-
Get the tristate SD output status.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_tristate_sd_output_status_t β SAI tristate SD output status.
-
hal_status_t
HAL_SAI_EnableMonoMode
(
hal_sai_handle_t
*
hsai
)
-
Enable the mono mode.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β SAI mono mode has been correctly enabled.
-
hal_status_t
HAL_SAI_DisableMonoMode
(
hal_sai_handle_t
*
hsai
)
-
Disable the mono mode.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β SAI mono mode has been correctly disabled.
-
hal_sai_mono_mode_status_t
HAL_SAI_IsEnabledMonoMode
(
const
hal_sai_handle_t
*
hsai
)
-
Get the mono mode status.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_mono_mode_status_t β SAI mono mode status.
-
hal_status_t
HAL_SAI_EnablePdm
(
const
hal_sai_handle_t
*
hsai
,
uint32_t
pdm_mic_pairs_nbr
,
hal_sai_pdm_clock_t
clock
)
-
Enable the PDM.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
pdm_mic_pairs_nbr β Number of micros pairs.
-
clock β PDM clock.
-
- Return values :
-
-
HAL_OK β SAI PDM has been correctly enabled.
-
HAL_ERROR β SAI PDM cannot be enabled.
-
-
hal_status_t
HAL_SAI_DisablePdm
(
const
hal_sai_handle_t
*
hsai
)
-
Disable the PDM.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
-
HAL_OK β SAI PDM has been correctly disabled.
-
HAL_ERROR β SAI PDM cannot be enabled.
-
-
hal_sai_pdm_status_t
HAL_SAI_IsEnabledPdm
(
const
hal_sai_handle_t
*
hsai
)
-
Get the PDM status.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_pdm_status_t β SAI PDM status.
-
- group SAI_Exported_Functions_Group3
-
This section provides a set of functions allowing to enable/disable SAI features:
-
Call the functions HAL_SAI_EnableMclkOutput() , HAL_SAI_DisableMclkOutput() and HAL_SAI_IsEnabledMclkOutput() to enable, disable the master clock output and check if it is enabled or not.
-
Call the functions HAL_SAI_EnableOutputDrive() , HAL_SAI_DisableOutputDrive() and HAL_SAI_IsEnabledOutputDrive() to enable, disable the output drive and check if it is enabled or not.
-
Call the functions HAL_SAI_EnableTristateSDOutput() , HAL_SAI_DisableTristateSDOutput() and HAL_SAI_IsEnabledTristateSDOutput() to enable, disable the tristate SD output and check if it is enabled or not.
-
Call the functions HAL_SAI_EnableMonoMode() , HAL_SAI_DisableMonoMode() and HAL_SAI_IsEnabledMonoMode() to enable, disable the mono mode and check if it is enabled or not.
-
Call the functions HAL_SAI_EnablePdm() , HAL_SAI_DisablePdm() and HAL_SAI_IsEnabledPdm() to enable, disable the PDM and check if it is enabled or not.
Functions
-
hal_status_t
HAL_SAI_EnableMclkOutput
(
hal_sai_handle_t
*
hsai
)
-
Enable the master clock output.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β SAI master clock output has been correctly enabled.
-
hal_status_t
HAL_SAI_DisableMclkOutput
(
hal_sai_handle_t
*
hsai
)
-
Disable the master clock output.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β SAI master clock output has been correctly disabled.
-
hal_sai_mclk_output_status_t
HAL_SAI_IsEnabledMclkOutput
(
const
hal_sai_handle_t
*
hsai
)
-
Get the master clock output status.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_mclk_output_status_t β SAI master clock output status.
-
hal_status_t
HAL_SAI_EnableOutputDrive
(
hal_sai_handle_t
*
hsai
)
-
Enable the output drive.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β SAI output drive has been correctly enabled.
-
hal_status_t
HAL_SAI_DisableOutputDrive
(
hal_sai_handle_t
*
hsai
)
-
Disable the output drive.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β SAI output drive has been correctly disabled.
-
hal_sai_output_drive_status_t
HAL_SAI_IsEnabledOutputDrive
(
const
hal_sai_handle_t
*
hsai
)
-
Get the output drive status.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_output_drive_status_t β SAI output drive status.
-
hal_status_t
HAL_SAI_EnableTristateSDOutput
(
hal_sai_handle_t
*
hsai
)
-
Enable the tristate SD output.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β SAI tristate SD output has been correctly enabled.
-
hal_status_t
HAL_SAI_DisableTristateSDOutput
(
hal_sai_handle_t
*
hsai
)
-
Disable the tristate SD output.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β SAI tristate SD output has been correctly disabled.
-
hal_sai_tristate_sd_output_status_t
HAL_SAI_IsEnabledTristateSDOutput
(
const
hal_sai_handle_t
*
hsai
)
-
Get the tristate SD output status.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_tristate_sd_output_status_t β SAI tristate SD output status.
-
hal_status_t
HAL_SAI_EnableMonoMode
(
hal_sai_handle_t
*
hsai
)
-
Enable the mono mode.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β SAI mono mode has been correctly enabled.
-
hal_status_t
HAL_SAI_DisableMonoMode
(
hal_sai_handle_t
*
hsai
)
-
Disable the mono mode.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β SAI mono mode has been correctly disabled.
-
hal_sai_mono_mode_status_t
HAL_SAI_IsEnabledMonoMode
(
const
hal_sai_handle_t
*
hsai
)
-
Get the mono mode status.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_mono_mode_status_t β SAI mono mode status.
-
hal_status_t
HAL_SAI_EnablePdm
(
const
hal_sai_handle_t
*
hsai
,
uint32_t
pdm_mic_pairs_nbr
,
hal_sai_pdm_clock_t
clock
)
-
Enable the PDM.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
pdm_mic_pairs_nbr β Number of micros pairs.
-
clock β PDM clock.
-
- Return values :
-
-
HAL_OK β SAI PDM has been correctly enabled.
-
HAL_ERROR β SAI PDM cannot be enabled.
-
-
hal_status_t
HAL_SAI_DisablePdm
(
const
hal_sai_handle_t
*
hsai
)
-
Disable the PDM.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
-
HAL_OK β SAI PDM has been correctly disabled.
-
HAL_ERROR β SAI PDM cannot be enabled.
-
-
hal_sai_pdm_status_t
HAL_SAI_IsEnabledPdm
(
const
hal_sai_handle_t
*
hsai
)
-
Get the PDM status.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_pdm_status_t β SAI PDM status.
-
Process functions ΒΆ
- group SAI_Exported_Functions_Group4
-
This section provides a set of functions allowing to manage the SAI data transfers.
There are two modes of transfer:
-
Blocking mode: The communication is performed in the polling mode. The status of all data processing is returned by the same function after finishing transfer.
-
Blocking mode functions are:
-
-
Non-blocking mode: The communication is performed using interrupts or DMA. These functions return the status of the transfer startup. The end of the data processing is indicated through the dedicated SAI IRQ when using Interrupt mode or the DMA IRQ when using DMA mode.
-
Non-blocking mode functions with interrupts are:
-
Non-blocking mode functions with DMA are:
-
The SAI has also the mute management:
Functions
-
hal_status_t
HAL_SAI_Transmit
(
hal_sai_handle_t
*
hsai
,
void
*
p_data
,
uint32_t
size_sample
,
uint32_t
timeout_ms
)
ΒΆ
-
Transmit an amount of samples in blocking mode.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_data β Pointer to data buffer.
-
size_sample β Amount of samples to be sent.
-
timeout_ms β Timeout duration (in ms).
-
- Return values :
-
-
HAL_OK β Operation completed successfully.
-
HAL_INVALID_PARAM β Invalid parameter.
-
HAL_TIMEOUT β Operation exceeds user timeout.
-
HAL_BUSY β The global_state is not HAL_SAI_STATE_IDLE (USE_HAL_CHECK_PROCESS_STATE is set to 1).
-
-
hal_status_t
HAL_SAI_Receive
(
hal_sai_handle_t
*
hsai
,
void
*
p_data
,
uint32_t
size_sample
,
uint32_t
timeout_ms
)
ΒΆ
-
Receive an amount of samples in blocking mode.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_data β Pointer to data buffer.
-
size_sample β Amount of samples to be received.
-
timeout_ms β Timeout duration (in ms).
-
- Return values :
-
-
HAL_OK β Operation completed successfully.
-
HAL_INVALID_PARAM β Invalid parameter.
-
HAL_TIMEOUT β Operation exceeds user timeout.
-
HAL_BUSY β The global_state is not HAL_SAI_STATE_IDLE (USE_HAL_CHECK_PROCESS_STATE is set to 1).
-
-
hal_status_t
HAL_SAI_Transmit_IT
(
hal_sai_handle_t
*
hsai
,
void
*
p_data
,
uint32_t
size_sample
)
ΒΆ
-
Transmit an amount of samples in non-blocking mode with Interrupt.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_data β Pointer to data buffer.
-
size_sample β Amount of samples to be sent.
-
- Return values :
-
-
HAL_OK β Operation completed successfully.
-
HAL_INVALID_PARAM β Invalid parameter.
-
HAL_BUSY β The global_state is not HAL_SAI_STATE_IDLE (USE_HAL_CHECK_PROCESS_STATE is set to 1).
-
-
hal_status_t
HAL_SAI_Receive_IT
(
hal_sai_handle_t
*
hsai
,
void
*
p_data
,
uint32_t
size_sample
)
ΒΆ
-
Receive an amount of samples in non-blocking mode with Interrupt.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_data β Pointer to data buffer.
-
size_sample β Amount of samples to be received.
-
- Return values :
-
-
HAL_OK β Operation completed successfully.
-
HAL_INVALID_PARAM β Invalid parameter.
-
HAL_BUSY β The global_state is not HAL_SAI_STATE_IDLE (USE_HAL_CHECK_PROCESS_STATE is set to 1).
-
-
hal_status_t
HAL_SAI_Transmit_DMA
(
hal_sai_handle_t
*
hsai
,
void
*
p_data
,
uint32_t
size_sample
)
ΒΆ
-
Transmit an amount of samples in non-blocking mode with DMA.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_data β Pointer to data buffer.
-
size_sample β Amount of samples to be sent.
-
- Return values :
-
-
HAL_OK β Operation completed successfully.
-
HAL_INVALID_PARAM β Invalid parameter.
-
HAL_ERROR β Operation error.
-
HAL_BUSY β The global_state is not HAL_SAI_STATE_IDLE (USE_HAL_CHECK_PROCESS_STATE is set to 1).
-
-
hal_status_t
HAL_SAI_Receive_DMA
(
hal_sai_handle_t
*
hsai
,
void
*
p_data
,
uint32_t
size_sample
)
ΒΆ
-
Receive an amount of samples in non-blocking mode with DMA.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_data β Pointer to data buffer.
-
size_sample β Amount of samples to be received.
-
- Return values :
-
-
HAL_OK β Operation completed successfully.
-
HAL_INVALID_PARAM β Invalid parameter.
-
HAL_ERROR β Operation error.
-
HAL_BUSY β The global_state is not HAL_SAI_STATE_IDLE (USE_HAL_CHECK_PROCESS_STATE is set to 1).
-
-
hal_status_t
HAL_SAI_Pause_DMA
(
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Pause the audio stream playing from the Media.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β Operation completed successfully.
-
hal_status_t
HAL_SAI_Resume_DMA
(
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Resume the audio stream playing from the Media.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β Operation completed successfully.
-
hal_status_t
HAL_SAI_Abort
(
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Abort a SAI IT or DMA process communication in blocking mode.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
-
HAL_OK β Operation completed successfully.
-
HAL_ERROR β Operation error.
-
-
hal_status_t
HAL_SAI_Abort_IT
(
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Abort a SAI IT or DMA process communication in non-blocking mode with Interrupt.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
-
HAL_OK β Operation completed successfully.
-
HAL_ERROR β Operation error.
-
-
hal_status_t
HAL_SAI_MuteTx
(
hal_sai_handle_t
*
hsai
,
hal_sai_mute_mode_t
mode
)
ΒΆ
-
Enable the mute Tx mode.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
mode β Mode selected.
-
- Return values :
-
HAL_OK β Operation completed successfully.
-
hal_status_t
HAL_SAI_UnmuteTx
(
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Disable the mute Tx mode.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β Operation completed successfully.
-
hal_status_t
HAL_SAI_EnableMuteRxDetection
(
hal_sai_handle_t
*
hsai
,
uint16_t
counter
)
ΒΆ
-
Enable the mute Rx detection.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
counter β Number a data before mute detection (max 63).
-
- Return values :
-
HAL_OK β Operation completed successfully.
-
hal_status_t
HAL_SAI_DisableMuteRxDetection
(
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Disable the mute Rx detection.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β Operation completed successfully.
-
hal_sai_mute_rx_detection_status_t
HAL_SAI_IsEnabledMuteRxDetection
(
const
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Get the mute Rx detection status.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_mute_rx_detection_status_t β SAI mute Rx detection status.
-
- group SAI_Exported_Functions_Group4
-
This section provides a set of functions allowing to manage the SAI data transfers.
There are two modes of transfer:
-
Blocking mode: The communication is performed in the polling mode. The status of all data processing is returned by the same function after finishing transfer.
-
Blocking mode functions are:
-
-
Non-blocking mode: The communication is performed using interrupts or DMA. These functions return the status of the transfer startup. The end of the data processing is indicated through the dedicated SAI IRQ when using Interrupt mode or the DMA IRQ when using DMA mode.
-
Non-blocking mode functions with interrupts are:
-
Non-blocking mode functions with DMA are:
-
The SAI has also the mute management:
Functions
-
hal_status_t
HAL_SAI_Transmit
(
hal_sai_handle_t
*
hsai
,
void
*
p_data
,
uint32_t
size_sample
,
uint32_t
timeout_ms
)
-
Transmit an amount of samples in blocking mode.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_data β Pointer to data buffer.
-
size_sample β Amount of samples to be sent.
-
timeout_ms β Timeout duration (in ms).
-
- Return values :
-
-
HAL_OK β Operation completed successfully.
-
HAL_INVALID_PARAM β Invalid parameter.
-
HAL_TIMEOUT β Operation exceeds user timeout.
-
HAL_BUSY β The global_state is not HAL_SAI_STATE_IDLE (USE_HAL_CHECK_PROCESS_STATE is set to 1).
-
-
hal_status_t
HAL_SAI_Receive
(
hal_sai_handle_t
*
hsai
,
void
*
p_data
,
uint32_t
size_sample
,
uint32_t
timeout_ms
)
-
Receive an amount of samples in blocking mode.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_data β Pointer to data buffer.
-
size_sample β Amount of samples to be received.
-
timeout_ms β Timeout duration (in ms).
-
- Return values :
-
-
HAL_OK β Operation completed successfully.
-
HAL_INVALID_PARAM β Invalid parameter.
-
HAL_TIMEOUT β Operation exceeds user timeout.
-
HAL_BUSY β The global_state is not HAL_SAI_STATE_IDLE (USE_HAL_CHECK_PROCESS_STATE is set to 1).
-
-
hal_status_t
HAL_SAI_Transmit_IT
(
hal_sai_handle_t
*
hsai
,
void
*
p_data
,
uint32_t
size_sample
)
-
Transmit an amount of samples in non-blocking mode with Interrupt.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_data β Pointer to data buffer.
-
size_sample β Amount of samples to be sent.
-
- Return values :
-
-
HAL_OK β Operation completed successfully.
-
HAL_INVALID_PARAM β Invalid parameter.
-
HAL_BUSY β The global_state is not HAL_SAI_STATE_IDLE (USE_HAL_CHECK_PROCESS_STATE is set to 1).
-
-
hal_status_t
HAL_SAI_Receive_IT
(
hal_sai_handle_t
*
hsai
,
void
*
p_data
,
uint32_t
size_sample
)
-
Receive an amount of samples in non-blocking mode with Interrupt.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_data β Pointer to data buffer.
-
size_sample β Amount of samples to be received.
-
- Return values :
-
-
HAL_OK β Operation completed successfully.
-
HAL_INVALID_PARAM β Invalid parameter.
-
HAL_BUSY β The global_state is not HAL_SAI_STATE_IDLE (USE_HAL_CHECK_PROCESS_STATE is set to 1).
-
-
hal_status_t
HAL_SAI_Transmit_DMA
(
hal_sai_handle_t
*
hsai
,
void
*
p_data
,
uint32_t
size_sample
)
-
Transmit an amount of samples in non-blocking mode with DMA.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_data β Pointer to data buffer.
-
size_sample β Amount of samples to be sent.
-
- Return values :
-
-
HAL_OK β Operation completed successfully.
-
HAL_INVALID_PARAM β Invalid parameter.
-
HAL_ERROR β Operation error.
-
HAL_BUSY β The global_state is not HAL_SAI_STATE_IDLE (USE_HAL_CHECK_PROCESS_STATE is set to 1).
-
-
hal_status_t
HAL_SAI_Receive_DMA
(
hal_sai_handle_t
*
hsai
,
void
*
p_data
,
uint32_t
size_sample
)
-
Receive an amount of samples in non-blocking mode with DMA.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_data β Pointer to data buffer.
-
size_sample β Amount of samples to be received.
-
- Return values :
-
-
HAL_OK β Operation completed successfully.
-
HAL_INVALID_PARAM β Invalid parameter.
-
HAL_ERROR β Operation error.
-
HAL_BUSY β The global_state is not HAL_SAI_STATE_IDLE (USE_HAL_CHECK_PROCESS_STATE is set to 1).
-
-
hal_status_t
HAL_SAI_Pause_DMA
(
hal_sai_handle_t
*
hsai
)
-
Pause the audio stream playing from the Media.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β Operation completed successfully.
-
hal_status_t
HAL_SAI_Resume_DMA
(
hal_sai_handle_t
*
hsai
)
-
Resume the audio stream playing from the Media.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β Operation completed successfully.
-
hal_status_t
HAL_SAI_Abort
(
hal_sai_handle_t
*
hsai
)
-
Abort a SAI IT or DMA process communication in blocking mode.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
-
HAL_OK β Operation completed successfully.
-
HAL_ERROR β Operation error.
-
-
hal_status_t
HAL_SAI_Abort_IT
(
hal_sai_handle_t
*
hsai
)
-
Abort a SAI IT or DMA process communication in non-blocking mode with Interrupt.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
-
HAL_OK β Operation completed successfully.
-
HAL_ERROR β Operation error.
-
-
hal_status_t
HAL_SAI_MuteTx
(
hal_sai_handle_t
*
hsai
,
hal_sai_mute_mode_t
mode
)
-
Enable the mute Tx mode.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
mode β Mode selected.
-
- Return values :
-
HAL_OK β Operation completed successfully.
-
hal_status_t
HAL_SAI_UnmuteTx
(
hal_sai_handle_t
*
hsai
)
-
Disable the mute Tx mode.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β Operation completed successfully.
-
hal_status_t
HAL_SAI_EnableMuteRxDetection
(
hal_sai_handle_t
*
hsai
,
uint16_t
counter
)
-
Enable the mute Rx detection.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
counter β Number a data before mute detection (max 63).
-
- Return values :
-
HAL_OK β Operation completed successfully.
-
hal_status_t
HAL_SAI_DisableMuteRxDetection
(
hal_sai_handle_t
*
hsai
)
-
Disable the mute Rx detection.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β Operation completed successfully.
-
hal_sai_mute_rx_detection_status_t
HAL_SAI_IsEnabledMuteRxDetection
(
const
hal_sai_handle_t
*
hsai
)
-
Get the mute Rx detection status.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_mute_rx_detection_status_t β SAI mute Rx detection status.
-
- group SAI_Exported_Functions_Group4
-
This section provides a set of functions allowing to manage the SAI data transfers.
There are two modes of transfer:
-
Blocking mode: The communication is performed in the polling mode. The status of all data processing is returned by the same function after finishing transfer.
-
Blocking mode functions are:
-
-
Non-blocking mode: The communication is performed using interrupts or DMA. These functions return the status of the transfer startup. The end of the data processing is indicated through the dedicated SAI IRQ when using Interrupt mode or the DMA IRQ when using DMA mode.
-
Non-blocking mode functions with interrupts are:
-
Non-blocking mode functions with DMA are:
-
The SAI has also the mute management:
Functions
-
hal_status_t
HAL_SAI_Transmit
(
hal_sai_handle_t
*
hsai
,
void
*
p_data
,
uint32_t
size_sample
,
uint32_t
timeout_ms
)
-
Transmit an amount of samples in blocking mode.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_data β Pointer to data buffer.
-
size_sample β Amount of samples to be sent.
-
timeout_ms β Timeout duration (in ms).
-
- Return values :
-
-
HAL_OK β Operation completed successfully.
-
HAL_INVALID_PARAM β Invalid parameter.
-
HAL_TIMEOUT β Operation exceeds user timeout.
-
HAL_BUSY β The global_state is not HAL_SAI_STATE_IDLE (USE_HAL_CHECK_PROCESS_STATE is set to 1).
-
-
hal_status_t
HAL_SAI_Receive
(
hal_sai_handle_t
*
hsai
,
void
*
p_data
,
uint32_t
size_sample
,
uint32_t
timeout_ms
)
-
Receive an amount of samples in blocking mode.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_data β Pointer to data buffer.
-
size_sample β Amount of samples to be received.
-
timeout_ms β Timeout duration (in ms).
-
- Return values :
-
-
HAL_OK β Operation completed successfully.
-
HAL_INVALID_PARAM β Invalid parameter.
-
HAL_TIMEOUT β Operation exceeds user timeout.
-
HAL_BUSY β The global_state is not HAL_SAI_STATE_IDLE (USE_HAL_CHECK_PROCESS_STATE is set to 1).
-
-
hal_status_t
HAL_SAI_Transmit_IT
(
hal_sai_handle_t
*
hsai
,
void
*
p_data
,
uint32_t
size_sample
)
-
Transmit an amount of samples in non-blocking mode with Interrupt.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_data β Pointer to data buffer.
-
size_sample β Amount of samples to be sent.
-
- Return values :
-
-
HAL_OK β Operation completed successfully.
-
HAL_INVALID_PARAM β Invalid parameter.
-
HAL_BUSY β The global_state is not HAL_SAI_STATE_IDLE (USE_HAL_CHECK_PROCESS_STATE is set to 1).
-
-
hal_status_t
HAL_SAI_Receive_IT
(
hal_sai_handle_t
*
hsai
,
void
*
p_data
,
uint32_t
size_sample
)
-
Receive an amount of samples in non-blocking mode with Interrupt.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_data β Pointer to data buffer.
-
size_sample β Amount of samples to be received.
-
- Return values :
-
-
HAL_OK β Operation completed successfully.
-
HAL_INVALID_PARAM β Invalid parameter.
-
HAL_BUSY β The global_state is not HAL_SAI_STATE_IDLE (USE_HAL_CHECK_PROCESS_STATE is set to 1).
-
-
hal_status_t
HAL_SAI_Transmit_DMA
(
hal_sai_handle_t
*
hsai
,
void
*
p_data
,
uint32_t
size_sample
)
-
Transmit an amount of samples in non-blocking mode with DMA.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_data β Pointer to data buffer.
-
size_sample β Amount of samples to be sent.
-
- Return values :
-
-
HAL_OK β Operation completed successfully.
-
HAL_INVALID_PARAM β Invalid parameter.
-
HAL_ERROR β Operation error.
-
HAL_BUSY β The global_state is not HAL_SAI_STATE_IDLE (USE_HAL_CHECK_PROCESS_STATE is set to 1).
-
-
hal_status_t
HAL_SAI_Receive_DMA
(
hal_sai_handle_t
*
hsai
,
void
*
p_data
,
uint32_t
size_sample
)
-
Receive an amount of samples in non-blocking mode with DMA.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_data β Pointer to data buffer.
-
size_sample β Amount of samples to be received.
-
- Return values :
-
-
HAL_OK β Operation completed successfully.
-
HAL_INVALID_PARAM β Invalid parameter.
-
HAL_ERROR β Operation error.
-
HAL_BUSY β The global_state is not HAL_SAI_STATE_IDLE (USE_HAL_CHECK_PROCESS_STATE is set to 1).
-
-
hal_status_t
HAL_SAI_Pause_DMA
(
hal_sai_handle_t
*
hsai
)
-
Pause the audio stream playing from the Media.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β Operation completed successfully.
-
hal_status_t
HAL_SAI_Resume_DMA
(
hal_sai_handle_t
*
hsai
)
-
Resume the audio stream playing from the Media.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β Operation completed successfully.
-
hal_status_t
HAL_SAI_Abort
(
hal_sai_handle_t
*
hsai
)
-
Abort a SAI IT or DMA process communication in blocking mode.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
-
HAL_OK β Operation completed successfully.
-
HAL_ERROR β Operation error.
-
-
hal_status_t
HAL_SAI_Abort_IT
(
hal_sai_handle_t
*
hsai
)
-
Abort a SAI IT or DMA process communication in non-blocking mode with Interrupt.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
-
HAL_OK β Operation completed successfully.
-
HAL_ERROR β Operation error.
-
-
hal_status_t
HAL_SAI_MuteTx
(
hal_sai_handle_t
*
hsai
,
hal_sai_mute_mode_t
mode
)
-
Enable the mute Tx mode.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
mode β Mode selected.
-
- Return values :
-
HAL_OK β Operation completed successfully.
-
hal_status_t
HAL_SAI_UnmuteTx
(
hal_sai_handle_t
*
hsai
)
-
Disable the mute Tx mode.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β Operation completed successfully.
-
hal_status_t
HAL_SAI_EnableMuteRxDetection
(
hal_sai_handle_t
*
hsai
,
uint16_t
counter
)
-
Enable the mute Rx detection.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
counter β Number a data before mute detection (max 63).
-
- Return values :
-
HAL_OK β Operation completed successfully.
-
hal_status_t
HAL_SAI_DisableMuteRxDetection
(
hal_sai_handle_t
*
hsai
)
-
Disable the mute Rx detection.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
HAL_OK β Operation completed successfully.
-
hal_sai_mute_rx_detection_status_t
HAL_SAI_IsEnabledMuteRxDetection
(
const
hal_sai_handle_t
*
hsai
)
-
Get the mute Rx detection status.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_mute_rx_detection_status_t β SAI mute Rx detection status.
-
IRQHandler and Callbacks functions ΒΆ
- group SAI_Exported_Functions_Group5
-
This section provides functions allowing to:
-
Handle the SAI interrupt request with HAL_SAI_IRQHandler() . There are two ways to use callbacks: override weak callback functions or register user callback functions. They are used to indicate:
-
When the Rx transfer is complete ( HAL_SAI_RxCpltCallback() or callback function registered with HAL_SAI_RegisterRxCpltCallback() ).
-
When the Rx half transfer is complete ( HAL_SAI_RxHalfCpltCallback() or callback function registered with HAL_SAI_RegisterRxHalfCpltCallback() ).
-
When the Tx transfer is complete ( HAL_SAI_TxCpltCallback() or callback function registered with HAL_SAI_RegisterTxCpltCallback() ).
-
When the Tx half transfer is complete ( HAL_SAI_TxHalfCpltCallback() or callback function registered with HAL_SAI_RegisterTxHalfCpltCallback() ).
-
When the mute is detected ( HAL_SAI_MuteCallback() or callback function registered with HAL_SAI_RegisterMuteCallback() ).
-
When the abort is complete ( HAL_SAI_AbortCpltCallback() or callback function registered with HAL_SAI_RegisterAbortCpltCallback() ).
-
When the SAI driver encounters an error ( HAL_SAI_ErrorCallback() or callback function registered with HAL_SAI_RegisterErrorCallback() ).
-
Functions
-
void
HAL_SAI_IRQHandler
(
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Handle SAI interrupt request.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
-
void
HAL_SAI_RxCpltCallback
(
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Rx transfer completed callback.
Warning
This weak function must not be modified. When the callback is needed, it is overridden in the user file.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
-
void
HAL_SAI_RxHalfCpltCallback
(
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Rx transfer half completed callback.
Warning
This weak function must not be modified. When the callback is needed, it is overridden in the user file.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
-
void
HAL_SAI_TxCpltCallback
(
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Tx transfer completed callback.
Warning
This weak function must not be modified. When the callback is needed, it is overridden in the user file.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
-
void
HAL_SAI_TxHalfCpltCallback
(
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Tx transfer Half completed callback.
Warning
This weak function must not be modified. When the callback is needed, it is overridden in the user file.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
-
void
HAL_SAI_MuteCallback
(
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Mute detected callback.
Warning
This weak function must not be modified. When the callback is needed, it is overridden in the user file.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
-
void
HAL_SAI_AbortCpltCallback
(
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Abort completed callback.
Warning
This weak function must not be modified. When the callback is needed, it is overridden in the user file.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
-
void
HAL_SAI_ErrorCallback
(
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Error callback.
Warning
This weak function must not be modified. When the callback is needed, it is overridden in the user file.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
-
hal_status_t
HAL_SAI_RegisterRxCpltCallback
(
hal_sai_handle_t
*
hsai
,
hal_sai_cb_t
p_callback
)
ΒΆ
-
Register a User SAI callback for Rx complete.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_callback β Pointer to the callback function.
-
- Return values :
-
-
HAL_OK β Register completed successfully.
-
HAL_INVALID_PARAM β p_callback pointer is NULL.
-
-
hal_status_t
HAL_SAI_RegisterRxHalfCpltCallback
(
hal_sai_handle_t
*
hsai
,
hal_sai_cb_t
p_callback
)
ΒΆ
-
Register a User SAI callback for Rx half complete.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_callback β Pointer to the callback function.
-
- Return values :
-
-
HAL_OK β Register completed successfully.
-
HAL_INVALID_PARAM β p_callback pointer is NULL.
-
-
hal_status_t
HAL_SAI_RegisterTxCpltCallback
(
hal_sai_handle_t
*
hsai
,
hal_sai_cb_t
p_callback
)
ΒΆ
-
Register a User SAI callback for Tx complete.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_callback β Pointer to the callback function.
-
- Return values :
-
-
HAL_OK β Register completed successfully.
-
HAL_INVALID_PARAM β p_callback pointer is NULL.
-
-
hal_status_t
HAL_SAI_RegisterTxHalfCpltCallback
(
hal_sai_handle_t
*
hsai
,
hal_sai_cb_t
p_callback
)
ΒΆ
-
Register a User SAI callback for Tx half complete.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_callback β Pointer to the callback function.
-
- Return values :
-
-
HAL_OK β Register completed successfully.
-
HAL_INVALID_PARAM β p_callback pointer is NULL.
-
-
hal_status_t
HAL_SAI_RegisterMuteCallback
(
hal_sai_handle_t
*
hsai
,
hal_sai_cb_t
p_callback
)
ΒΆ
-
Register a User SAI callback for Mute.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_callback β Pointer to the callback function.
-
- Return values :
-
-
HAL_OK β Register completed successfully.
-
HAL_INVALID_PARAM β p_callback pointer is NULL.
-
-
hal_status_t
HAL_SAI_RegisterAbortCpltCallback
(
hal_sai_handle_t
*
hsai
,
hal_sai_cb_t
p_callback
)
ΒΆ
-
Register a User SAI callback for Abort complete.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_callback β Pointer to the callback function.
-
- Return values :
-
-
HAL_OK β Register completed successfully.
-
HAL_INVALID_PARAM β p_callback pointer is NULL.
-
-
hal_status_t
HAL_SAI_RegisterErrorCallback
(
hal_sai_handle_t
*
hsai
,
hal_sai_cb_t
p_callback
)
ΒΆ
-
Register a User SAI callback for Error.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_callback β Pointer to the callback function.
-
- Return values :
-
-
HAL_OK β Register completed successfully.
-
HAL_INVALID_PARAM β p_callback pointer is NULL.
-
-
- group SAI_Exported_Functions_Group5
-
This section provides functions allowing to:
-
Handle the SAI interrupt request with HAL_SAI_IRQHandler() . There are two ways to use callbacks: override weak callback functions or register user callback functions. They are used to indicate:
-
When the Rx transfer is complete ( HAL_SAI_RxCpltCallback() or callback function registered with HAL_SAI_RegisterRxCpltCallback() ).
-
When the Rx half transfer is complete ( HAL_SAI_RxHalfCpltCallback() or callback function registered with HAL_SAI_RegisterRxHalfCpltCallback() ).
-
When the Tx transfer is complete ( HAL_SAI_TxCpltCallback() or callback function registered with HAL_SAI_RegisterTxCpltCallback() ).
-
When the Tx half transfer is complete ( HAL_SAI_TxHalfCpltCallback() or callback function registered with HAL_SAI_RegisterTxHalfCpltCallback() ).
-
When the mute is detected ( HAL_SAI_MuteCallback() or callback function registered with HAL_SAI_RegisterMuteCallback() ).
-
When the abort is complete ( HAL_SAI_AbortCpltCallback() or callback function registered with HAL_SAI_RegisterAbortCpltCallback() ).
-
When the SAI driver encounters an error ( HAL_SAI_ErrorCallback() or callback function registered with HAL_SAI_RegisterErrorCallback() ).
-
Functions
-
void
HAL_SAI_IRQHandler
(
hal_sai_handle_t
*
hsai
)
-
Handle SAI interrupt request.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
-
void
HAL_SAI_RxCpltCallback
(
hal_sai_handle_t
*
hsai
)
-
Rx transfer completed callback.
Warning
This weak function must not be modified. When the callback is needed, it is overridden in the user file.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
-
void
HAL_SAI_RxHalfCpltCallback
(
hal_sai_handle_t
*
hsai
)
-
Rx transfer half completed callback.
Warning
This weak function must not be modified. When the callback is needed, it is overridden in the user file.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
-
void
HAL_SAI_TxCpltCallback
(
hal_sai_handle_t
*
hsai
)
-
Tx transfer completed callback.
Warning
This weak function must not be modified. When the callback is needed, it is overridden in the user file.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
-
void
HAL_SAI_TxHalfCpltCallback
(
hal_sai_handle_t
*
hsai
)
-
Tx transfer Half completed callback.
Warning
This weak function must not be modified. When the callback is needed, it is overridden in the user file.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
-
void
HAL_SAI_MuteCallback
(
hal_sai_handle_t
*
hsai
)
-
Mute detected callback.
Warning
This weak function must not be modified. When the callback is needed, it is overridden in the user file.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
-
void
HAL_SAI_AbortCpltCallback
(
hal_sai_handle_t
*
hsai
)
-
Abort completed callback.
Warning
This weak function must not be modified. When the callback is needed, it is overridden in the user file.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
-
void
HAL_SAI_ErrorCallback
(
hal_sai_handle_t
*
hsai
)
-
Error callback.
Warning
This weak function must not be modified. When the callback is needed, it is overridden in the user file.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
-
hal_status_t
HAL_SAI_RegisterRxCpltCallback
(
hal_sai_handle_t
*
hsai
,
hal_sai_cb_t
p_callback
)
-
Register a User SAI callback for Rx complete.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_callback β Pointer to the callback function.
-
- Return values :
-
-
HAL_OK β Register completed successfully.
-
HAL_INVALID_PARAM β p_callback pointer is NULL.
-
-
hal_status_t
HAL_SAI_RegisterRxHalfCpltCallback
(
hal_sai_handle_t
*
hsai
,
hal_sai_cb_t
p_callback
)
-
Register a User SAI callback for Rx half complete.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_callback β Pointer to the callback function.
-
- Return values :
-
-
HAL_OK β Register completed successfully.
-
HAL_INVALID_PARAM β p_callback pointer is NULL.
-
-
hal_status_t
HAL_SAI_RegisterTxCpltCallback
(
hal_sai_handle_t
*
hsai
,
hal_sai_cb_t
p_callback
)
-
Register a User SAI callback for Tx complete.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_callback β Pointer to the callback function.
-
- Return values :
-
-
HAL_OK β Register completed successfully.
-
HAL_INVALID_PARAM β p_callback pointer is NULL.
-
-
hal_status_t
HAL_SAI_RegisterTxHalfCpltCallback
(
hal_sai_handle_t
*
hsai
,
hal_sai_cb_t
p_callback
)
-
Register a User SAI callback for Tx half complete.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_callback β Pointer to the callback function.
-
- Return values :
-
-
HAL_OK β Register completed successfully.
-
HAL_INVALID_PARAM β p_callback pointer is NULL.
-
-
hal_status_t
HAL_SAI_RegisterMuteCallback
(
hal_sai_handle_t
*
hsai
,
hal_sai_cb_t
p_callback
)
-
Register a User SAI callback for Mute.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_callback β Pointer to the callback function.
-
- Return values :
-
-
HAL_OK β Register completed successfully.
-
HAL_INVALID_PARAM β p_callback pointer is NULL.
-
-
hal_status_t
HAL_SAI_RegisterAbortCpltCallback
(
hal_sai_handle_t
*
hsai
,
hal_sai_cb_t
p_callback
)
-
Register a User SAI callback for Abort complete.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_callback β Pointer to the callback function.
-
- Return values :
-
-
HAL_OK β Register completed successfully.
-
HAL_INVALID_PARAM β p_callback pointer is NULL.
-
-
hal_status_t
HAL_SAI_RegisterErrorCallback
(
hal_sai_handle_t
*
hsai
,
hal_sai_cb_t
p_callback
)
-
Register a User SAI callback for Error.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_callback β Pointer to the callback function.
-
- Return values :
-
-
HAL_OK β Register completed successfully.
-
HAL_INVALID_PARAM β p_callback pointer is NULL.
-
-
- group SAI_Exported_Functions_Group5
-
This section provides functions allowing to:
-
Handle the SAI interrupt request with HAL_SAI_IRQHandler() . There are two ways to use callbacks: override weak callback functions or register user callback functions. They are used to indicate:
-
When the Rx transfer is complete ( HAL_SAI_RxCpltCallback() or callback function registered with HAL_SAI_RegisterRxCpltCallback() ).
-
When the Rx half transfer is complete ( HAL_SAI_RxHalfCpltCallback() or callback function registered with HAL_SAI_RegisterRxHalfCpltCallback() ).
-
When the Tx transfer is complete ( HAL_SAI_TxCpltCallback() or callback function registered with HAL_SAI_RegisterTxCpltCallback() ).
-
When the Tx half transfer is complete ( HAL_SAI_TxHalfCpltCallback() or callback function registered with HAL_SAI_RegisterTxHalfCpltCallback() ).
-
When the mute is detected ( HAL_SAI_MuteCallback() or callback function registered with HAL_SAI_RegisterMuteCallback() ).
-
When the abort is complete ( HAL_SAI_AbortCpltCallback() or callback function registered with HAL_SAI_RegisterAbortCpltCallback() ).
-
When the SAI driver encounters an error ( HAL_SAI_ErrorCallback() or callback function registered with HAL_SAI_RegisterErrorCallback() ).
-
Functions
-
void
HAL_SAI_IRQHandler
(
hal_sai_handle_t
*
hsai
)
-
Handle SAI interrupt request.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
-
void
HAL_SAI_RxCpltCallback
(
hal_sai_handle_t
*
hsai
)
-
Rx transfer completed callback.
Warning
This weak function must not be modified. When the callback is needed, it is overridden in the user file.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
-
void
HAL_SAI_RxHalfCpltCallback
(
hal_sai_handle_t
*
hsai
)
-
Rx transfer half completed callback.
Warning
This weak function must not be modified. When the callback is needed, it is overridden in the user file.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
-
void
HAL_SAI_TxCpltCallback
(
hal_sai_handle_t
*
hsai
)
-
Tx transfer completed callback.
Warning
This weak function must not be modified. When the callback is needed, it is overridden in the user file.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
-
void
HAL_SAI_TxHalfCpltCallback
(
hal_sai_handle_t
*
hsai
)
-
Tx transfer Half completed callback.
Warning
This weak function must not be modified. When the callback is needed, it is overridden in the user file.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
-
void
HAL_SAI_MuteCallback
(
hal_sai_handle_t
*
hsai
)
-
Mute detected callback.
Warning
This weak function must not be modified. When the callback is needed, it is overridden in the user file.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
-
void
HAL_SAI_AbortCpltCallback
(
hal_sai_handle_t
*
hsai
)
-
Abort completed callback.
Warning
This weak function must not be modified. When the callback is needed, it is overridden in the user file.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
-
void
HAL_SAI_ErrorCallback
(
hal_sai_handle_t
*
hsai
)
-
Error callback.
Warning
This weak function must not be modified. When the callback is needed, it is overridden in the user file.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
-
hal_status_t
HAL_SAI_RegisterRxCpltCallback
(
hal_sai_handle_t
*
hsai
,
hal_sai_cb_t
p_callback
)
-
Register a User SAI callback for Rx complete.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_callback β Pointer to the callback function.
-
- Return values :
-
-
HAL_OK β Register completed successfully.
-
HAL_INVALID_PARAM β p_callback pointer is NULL.
-
-
hal_status_t
HAL_SAI_RegisterRxHalfCpltCallback
(
hal_sai_handle_t
*
hsai
,
hal_sai_cb_t
p_callback
)
-
Register a User SAI callback for Rx half complete.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_callback β Pointer to the callback function.
-
- Return values :
-
-
HAL_OK β Register completed successfully.
-
HAL_INVALID_PARAM β p_callback pointer is NULL.
-
-
hal_status_t
HAL_SAI_RegisterTxCpltCallback
(
hal_sai_handle_t
*
hsai
,
hal_sai_cb_t
p_callback
)
-
Register a User SAI callback for Tx complete.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_callback β Pointer to the callback function.
-
- Return values :
-
-
HAL_OK β Register completed successfully.
-
HAL_INVALID_PARAM β p_callback pointer is NULL.
-
-
hal_status_t
HAL_SAI_RegisterTxHalfCpltCallback
(
hal_sai_handle_t
*
hsai
,
hal_sai_cb_t
p_callback
)
-
Register a User SAI callback for Tx half complete.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_callback β Pointer to the callback function.
-
- Return values :
-
-
HAL_OK β Register completed successfully.
-
HAL_INVALID_PARAM β p_callback pointer is NULL.
-
-
hal_status_t
HAL_SAI_RegisterMuteCallback
(
hal_sai_handle_t
*
hsai
,
hal_sai_cb_t
p_callback
)
-
Register a User SAI callback for Mute.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_callback β Pointer to the callback function.
-
- Return values :
-
-
HAL_OK β Register completed successfully.
-
HAL_INVALID_PARAM β p_callback pointer is NULL.
-
-
hal_status_t
HAL_SAI_RegisterAbortCpltCallback
(
hal_sai_handle_t
*
hsai
,
hal_sai_cb_t
p_callback
)
-
Register a User SAI callback for Abort complete.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_callback β Pointer to the callback function.
-
- Return values :
-
-
HAL_OK β Register completed successfully.
-
HAL_INVALID_PARAM β p_callback pointer is NULL.
-
-
hal_status_t
HAL_SAI_RegisterErrorCallback
(
hal_sai_handle_t
*
hsai
,
hal_sai_cb_t
p_callback
)
-
Register a User SAI callback for Error.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_callback β Pointer to the callback function.
-
- Return values :
-
-
HAL_OK β Register completed successfully.
-
HAL_INVALID_PARAM β p_callback pointer is NULL.
-
-
Bus Operation functions ΒΆ
- group SAI_Exported_Functions_Group6
-
This section provides functions allowing to control the bus of the SAIx instance:
-
HAL_SAI_AcquireBus() : Acquire the bus
-
HAL_SAI_ReleaseBus() : Release the bus.
For multi task application, it is strongly recommended to use the bus operation functions to avoid race concurrency.
Functions
-
hal_status_t
HAL_SAI_AcquireBus
(
hal_sai_handle_t
*
hsai
,
uint32_t
timeout_ms
)
ΒΆ
-
Acquire the current instance bus.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
timeout_ms β Timeout in milliseconds for the Acquire to expire.
-
- Return values :
-
-
HAL_OK β Operation completed successfully.
-
HAL_TIMEOUT β Operation exceeds user timeout.
-
-
hal_status_t
HAL_SAI_ReleaseBus
(
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Release the current instance bus.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
-
HAL_OK β Operation completed successfully.
-
HAL_ERROR β Operation completed with error.
-
-
- group SAI_Exported_Functions_Group6
-
This section provides functions allowing to control the bus of the SAIx instance:
-
HAL_SAI_AcquireBus() : Acquire the bus
-
HAL_SAI_ReleaseBus() : Release the bus.
For multi task application, it is strongly recommended to use the bus operation functions to avoid race concurrency.
Functions
-
hal_status_t
HAL_SAI_AcquireBus
(
hal_sai_handle_t
*
hsai
,
uint32_t
timeout_ms
)
-
Acquire the current instance bus.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
timeout_ms β Timeout in milliseconds for the Acquire to expire.
-
- Return values :
-
-
HAL_OK β Operation completed successfully.
-
HAL_TIMEOUT β Operation exceeds user timeout.
-
-
hal_status_t
HAL_SAI_ReleaseBus
(
hal_sai_handle_t
*
hsai
)
-
Release the current instance bus.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
-
HAL_OK β Operation completed successfully.
-
HAL_ERROR β Operation completed with error.
-
-
- group SAI_Exported_Functions_Group6
-
This section provides functions allowing to control the bus of the SAIx instance:
-
HAL_SAI_AcquireBus() : Acquire the bus
-
HAL_SAI_ReleaseBus() : Release the bus.
For multi task application, it is strongly recommended to use the bus operation functions to avoid race concurrency.
Functions
-
hal_status_t
HAL_SAI_AcquireBus
(
hal_sai_handle_t
*
hsai
,
uint32_t
timeout_ms
)
-
Acquire the current instance bus.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
timeout_ms β Timeout in milliseconds for the Acquire to expire.
-
- Return values :
-
-
HAL_OK β Operation completed successfully.
-
HAL_TIMEOUT β Operation exceeds user timeout.
-
-
hal_status_t
HAL_SAI_ReleaseBus
(
hal_sai_handle_t
*
hsai
)
-
Release the current instance bus.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
-
HAL_OK β Operation completed successfully.
-
HAL_ERROR β Operation completed with error.
-
-
User Data functions ΒΆ
- group SAI_Exported_Functions_Group7
-
This section provides functions allowing to set user specific data to a SAIx instance:
-
HAL_SAI_SetUserData() : Set user data in handler.
-
HAL_SAI_GetUserData() : Get user data from handler.
Functions
-
void
HAL_SAI_SetUserData
(
hal_sai_handle_t
*
hsai
,
const
void
*
p_user_data
)
ΒΆ
-
Store user data pointer into the handle.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_user_data β Pointer to the user data.
-
-
const
void
*
HAL_SAI_GetUserData
(
const
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Retrieve user data pointer from the handle.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
void β Pointer to the user data.
-
- group SAI_Exported_Functions_Group7
-
This section provides functions allowing to set user specific data to a SAIx instance:
-
HAL_SAI_SetUserData() : Set user data in handler.
-
HAL_SAI_GetUserData() : Get user data from handler.
Functions
-
void
HAL_SAI_SetUserData
(
hal_sai_handle_t
*
hsai
,
const
void
*
p_user_data
)
-
Store user data pointer into the handle.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_user_data β Pointer to the user data.
-
-
const
void
*
HAL_SAI_GetUserData
(
const
hal_sai_handle_t
*
hsai
)
-
Retrieve user data pointer from the handle.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
void β Pointer to the user data.
-
- group SAI_Exported_Functions_Group7
-
This section provides functions allowing to set user specific data to a SAIx instance:
-
HAL_SAI_SetUserData() : Set user data in handler.
-
HAL_SAI_GetUserData() : Get user data from handler.
Functions
-
void
HAL_SAI_SetUserData
(
hal_sai_handle_t
*
hsai
,
const
void
*
p_user_data
)
-
Store user data pointer into the handle.
- Parameters :
-
-
hsai β Pointer to a hal_sai_handle_t .
-
p_user_data β Pointer to the user data.
-
-
const
void
*
HAL_SAI_GetUserData
(
const
hal_sai_handle_t
*
hsai
)
-
Retrieve user data pointer from the handle.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
void β Pointer to the user data.
-
State functions ΒΆ
- group SAI_Exported_Functions_Group8
-
This section permits to get in runtime the state of the SAI block with HAL_SAI_GetState() .
Functions
-
hal_sai_state_t
HAL_SAI_GetState
(
const
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Return the SAI handle state.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_state_t β SAI state.
-
hal_sai_state_t
HAL_SAI_GetState
(
const
hal_sai_handle_t
*
hsai
)
ΒΆ
- group SAI_Exported_Functions_Group8
-
This section permits to get in runtime the state of the SAI block with HAL_SAI_GetState() .
Functions
-
hal_sai_state_t
HAL_SAI_GetState
(
const
hal_sai_handle_t
*
hsai
)
-
Return the SAI handle state.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_state_t β SAI state.
-
hal_sai_state_t
HAL_SAI_GetState
(
const
hal_sai_handle_t
*
hsai
)
- group SAI_Exported_Functions_Group8
-
This section permits to get in runtime the state of the SAI block with HAL_SAI_GetState() .
Functions
-
hal_sai_state_t
HAL_SAI_GetState
(
const
hal_sai_handle_t
*
hsai
)
-
Return the SAI handle state.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
hal_sai_state_t β SAI state.
-
hal_sai_state_t
HAL_SAI_GetState
(
const
hal_sai_handle_t
*
hsai
)
Error functions ΒΆ
- group SAI_Exported_Functions_Group9
-
This section permits to get in runtime the last error codes of the peripheral SAI with HAL_SAI_GetLastErrorCodes() .
Functions
-
uint32_t
HAL_SAI_GetLastErrorCodes
(
const
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Get the SAI last error codes.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
uint32_t β This return value can be a combination of the following values:
-
uint32_t
HAL_SAI_GetLastErrorCodes
(
const
hal_sai_handle_t
*
hsai
)
ΒΆ
- group SAI_Exported_Functions_Group9
-
This section permits to get in runtime the last error codes of the peripheral SAI with HAL_SAI_GetLastErrorCodes() .
Functions
-
uint32_t
HAL_SAI_GetLastErrorCodes
(
const
hal_sai_handle_t
*
hsai
)
-
Get the SAI last error codes.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
uint32_t β This return value can be a combination of the following values:
-
uint32_t
HAL_SAI_GetLastErrorCodes
(
const
hal_sai_handle_t
*
hsai
)
- group SAI_Exported_Functions_Group9
-
This section permits to get in runtime the last error codes of the peripheral SAI with HAL_SAI_GetLastErrorCodes() .
Functions
-
uint32_t
HAL_SAI_GetLastErrorCodes
(
const
hal_sai_handle_t
*
hsai
)
-
Get the SAI last error codes.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
uint32_t β This return value can be a combination of the following values:
-
uint32_t
HAL_SAI_GetLastErrorCodes
(
const
hal_sai_handle_t
*
hsai
)
Clock frequency functions ΒΆ
- group SAI_Exported_Functions_Group10
-
This section permits to get in runtime the kernel clock frequency of the peripheral SAI with HAL_SAI_GetClockFreq() .
Functions
-
uint32_t
HAL_SAI_GetClockFreq
(
const
hal_sai_handle_t
*
hsai
)
ΒΆ
-
Get the SAI kernel clock frequency.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
-
uint32_t β Frequency in Hz.
-
0 β Source clock of the hsai not configured or not ready.
-
-
uint32_t
HAL_SAI_GetClockFreq
(
const
hal_sai_handle_t
*
hsai
)
ΒΆ
- group SAI_Exported_Functions_Group10
-
This section permits to get in runtime the kernel clock frequency of the peripheral SAI with HAL_SAI_GetClockFreq() .
Functions
-
uint32_t
HAL_SAI_GetClockFreq
(
const
hal_sai_handle_t
*
hsai
)
-
Get the SAI kernel clock frequency.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
-
uint32_t β Frequency in Hz.
-
0 β Source clock of the hsai not configured or not ready.
-
-
uint32_t
HAL_SAI_GetClockFreq
(
const
hal_sai_handle_t
*
hsai
)
- group SAI_Exported_Functions_Group10
-
This section permits to get in runtime the kernel clock frequency of the peripheral SAI with HAL_SAI_GetClockFreq() .
Functions
-
uint32_t
HAL_SAI_GetClockFreq
(
const
hal_sai_handle_t
*
hsai
)
-
Get the SAI kernel clock frequency.
- Parameters :
-
hsai β Pointer to a hal_sai_handle_t .
- Return values :
-
-
uint32_t β Frequency in Hz.
-
0 β Source clock of the hsai not configured or not ready.
-
-
uint32_t
HAL_SAI_GetClockFreq
(
const
hal_sai_handle_t
*
hsai
)