Functions
AUDIO_OUT Exported Functions
Collaboration diagram for AUDIO_OUT Exported Functions:

Functions

int32_t BSP_AUDIO_OUT_DeInit (uint32_t Instance)
 De-initializes the audio out peripheral. More...
 
__weak void BSP_AUDIO_OUT_Error_CallBack (uint32_t Instance)
 Manages the DMA FIFO error event. More...
 
int32_t BSP_AUDIO_OUT_GetBitsPerSample (uint32_t Instance, uint32_t *BitsPerSample)
 Get the audio Resolution. More...
 
int32_t BSP_AUDIO_OUT_GetChannelsNbr (uint32_t Instance, uint32_t *ChannelNbr)
 Get the audio Channels number. More...
 
int32_t BSP_AUDIO_OUT_GetDevice (uint32_t Instance, uint32_t *Device)
 Get the Output Device. More...
 
int32_t BSP_AUDIO_OUT_GetSampleRate (uint32_t Instance, uint32_t *SampleRate)
 Get the audio frequency. More...
 
int32_t BSP_AUDIO_OUT_GetState (uint32_t Instance, uint32_t *State)
 Get Audio Out state. More...
 
int32_t BSP_AUDIO_OUT_GetVolume (uint32_t Instance, uint32_t *Volume)
 Get the current audio volume level. More...
 
__weak void BSP_AUDIO_OUT_HalfTransfer_CallBack (uint32_t Instance)
 Manages the DMA Half Transfer complete event. More...
 
int32_t BSP_AUDIO_OUT_Init (uint32_t Instance, BSP_AUDIO_Init_t *AudioInit)
 Configures the audio peripherals. More...
 
void BSP_AUDIO_OUT_IRQHandler (uint32_t Instance)
 
int32_t BSP_AUDIO_OUT_IsMute (uint32_t Instance, uint32_t *IsMute)
 Check whether the MUTE mode is enabled or not. More...
 
int32_t BSP_AUDIO_OUT_Mute (uint32_t Instance)
 Enables the MUTE. More...
 
int32_t BSP_AUDIO_OUT_Pause (uint32_t Instance)
 This function Pauses the audio file stream. In case of using DMA, the DMA Pause feature is used. More...
 
int32_t BSP_AUDIO_OUT_Play (uint32_t Instance, uint8_t *pData, uint32_t NbrOfBytes)
 Default BSP AUDIO OUT Msp Callbacks. More...
 
int32_t BSP_AUDIO_OUT_Resume (uint32_t Instance)
 Resumes the audio file stream. More...
 
int32_t BSP_AUDIO_OUT_SetBitsPerSample (uint32_t Instance, uint32_t BitsPerSample)
 Set the audio Resolution. More...
 
int32_t BSP_AUDIO_OUT_SetChannelsNbr (uint32_t Instance, uint32_t ChannelNbr)
 Set the audio Channels number. More...
 
int32_t BSP_AUDIO_OUT_SetDevice (uint32_t Instance, uint32_t Device)
 Switch dynamically (while audio file is played) the output target (speaker or headphone). More...
 
int32_t BSP_AUDIO_OUT_SetSampleRate (uint32_t Instance, uint32_t SampleRate)
 Updates the audio frequency. More...
 
int32_t BSP_AUDIO_OUT_SetVolume (uint32_t Instance, uint32_t Volume)
 Controls the current audio volume level. More...
 
int32_t BSP_AUDIO_OUT_Stop (uint32_t Instance)
 Stops audio playing and Power down the Audio Codec. More...
 
__weak void BSP_AUDIO_OUT_TransferComplete_CallBack (uint32_t Instance)
 Manages the DMA full Transfer complete event. More...
 
int32_t BSP_AUDIO_OUT_UnMute (uint32_t Instance)
 Disables the MUTE mode. More...
 
void HAL_SAI_ErrorCallback (SAI_HandleTypeDef *hsai)
 SAI error callbacks. More...
 
void HAL_SAI_TxCpltCallback (SAI_HandleTypeDef *hsai)
 Tx Transfer completed callbacks. More...
 
void HAL_SAI_TxHalfCpltCallback (SAI_HandleTypeDef *hsai)
 Tx Half Transfer completed callbacks. More...
 
__weak HAL_StatusTypeDef MX_SAI1_Block_A_Init (SAI_HandleTypeDef *hsai, MX_SAI_Config_t *MXConfig)
 Initializes the Audio Codec audio out instance (SAI). More...
 
__weak HAL_StatusTypeDef MX_SAI1_ClockConfig (SAI_HandleTypeDef *hsai, uint32_t SampleRate)
 SAI clock Config. More...
 
__weak HAL_StatusTypeDef MX_SAI4_ClockConfig (SAI_HandleTypeDef *hsai, uint32_t SampleRate)
 SAI clock Config. More...
 

Detailed Description

Function Documentation

◆ BSP_AUDIO_OUT_DeInit()

int32_t BSP_AUDIO_OUT_DeInit ( uint32_t  Instance)

De-initializes the audio out peripheral.

Parameters
Instance: AUDIO OUT Instance. It can only be 0 (SAI)
Return values
None

Definition at line 343 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_OUT_Error_CallBack()

void BSP_AUDIO_OUT_Error_CallBack ( uint32_t  Instance)

Manages the DMA FIFO error event.

Parameters
Instance: AUDIO OUT Instance. It can only be 0 (SAI)
Return values
None

Definition at line 1353 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_OUT_GetBitsPerSample()

int32_t BSP_AUDIO_OUT_GetBitsPerSample ( uint32_t  Instance,
uint32_t *  BitsPerSample 
)

Get the audio Resolution.

Parameters
Instance: AUDIO OUT Instance. It can only be 0 (SAI)
BitsPerSampleAudio Resolution used to play the audio stream.
Return values
BSPstatus

Definition at line 1146 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_OUT_GetChannelsNbr()

int32_t BSP_AUDIO_OUT_GetChannelsNbr ( uint32_t  Instance,
uint32_t *  ChannelNbr 
)

Get the audio Channels number.

Parameters
Instance: AUDIO OUT Instance. It can only be 0 (SAI)
ChannelNbrAudio Channels number used to play the audio stream.
Return values
BSPstatus

Definition at line 1226 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_OUT_GetDevice()

int32_t BSP_AUDIO_OUT_GetDevice ( uint32_t  Instance,
uint32_t *  Device 
)

Get the Output Device.

Parameters
Instance: AUDIO OUT Instance. It can only be 0 (SAI)
DeviceThe audio output device
Return values
BSPstatus

Definition at line 947 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_OUT_GetSampleRate()

int32_t BSP_AUDIO_OUT_GetSampleRate ( uint32_t  Instance,
uint32_t *  SampleRate 
)

Get the audio frequency.

Parameters
Instance: AUDIO OUT Instance. It can only be 0 (SAI)
SampleRateAudio frequency used to play the audio stream.
Return values
BSPstatus

Definition at line 1041 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_OUT_GetState()

int32_t BSP_AUDIO_OUT_GetState ( uint32_t  Instance,
uint32_t *  State 
)

Get Audio Out state.

Parameters
Instance: AUDIO OUT Instance. It can only be 0 (SAI)
StateAudio Out state
Return values
BSPstatus

Definition at line 1250 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_OUT_GetVolume()

int32_t BSP_AUDIO_OUT_GetVolume ( uint32_t  Instance,
uint32_t *  Volume 
)

Get the current audio volume level.

Parameters
Instance: AUDIO OUT Instance. It can only be 0 (SAI)
Volumepointer to volume to be returned
Return values
BSPstatus

Definition at line 812 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_OUT_HalfTransfer_CallBack()

void BSP_AUDIO_OUT_HalfTransfer_CallBack ( uint32_t  Instance)

Manages the DMA Half Transfer complete event.

Parameters
Instance: AUDIO OUT Instance. It can only be 0 (SAI)
Return values
None

Definition at line 1342 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_OUT_Init()

int32_t BSP_AUDIO_OUT_Init ( uint32_t  Instance,
BSP_AUDIO_Init_t AudioInit 
)

Configures the audio peripherals.

Parameters
Instance: AUDIO_OUT Instance. It can only be 0 (SAI)
AudioInit: AUDIO_OUT init Structure
Return values
BSPstatus

Definition at line 217 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_OUT_IRQHandler()

void BSP_AUDIO_OUT_IRQHandler ( uint32_t  Instance)

Definition at line 1268 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_OUT_IsMute()

int32_t BSP_AUDIO_OUT_IsMute ( uint32_t  Instance,
uint32_t *  IsMute 
)

Check whether the MUTE mode is enabled or not.

Parameters
Instance: AUDIO OUT Instance. It can only be 0 (SAI)
IsMutepointer to mute state
Return values
Mutestatus

Definition at line 894 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_OUT_Mute()

int32_t BSP_AUDIO_OUT_Mute ( uint32_t  Instance)

Enables the MUTE.

Parameters
Instance: AUDIO OUT Instance. It can only be 0 (SAI)
Return values
BSPstatus

Definition at line 833 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_OUT_Pause()

int32_t BSP_AUDIO_OUT_Pause ( uint32_t  Instance)

This function Pauses the audio file stream. In case of using DMA, the DMA Pause feature is used.

Parameters
Instance: AUDIO OUT Instance. It can only be 0 (SAI)
Note
When calling BSP_AUDIO_OUT_Pause() function for pause, only BSP_AUDIO_OUT_Resume() function should be called for resume (use of BSP_AUDIO_OUT_Play() function for resume could lead to unexpected behavior).
Return values
BSPstatus

Definition at line 647 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_OUT_Play()

int32_t BSP_AUDIO_OUT_Play ( uint32_t  Instance,
uint8_t *  pData,
uint32_t  NbrOfBytes 
)

Default BSP AUDIO OUT Msp Callbacks.

Parameters
Instance: AUDIO OUT Instance. It can only be 0 (SAI)
Return values
BSPstatus

Starts playing audio stream from a data buffer for a determined size.

Parameters
Instance: AUDIO OUT Instance. It can only be 0 (SAI)
pDatapointer on data address
NbrOfBytesSize of total samples in bytes BitsPerSample: 16 or 32
Return values
BSPstatus

Definition at line 602 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_OUT_Resume()

int32_t BSP_AUDIO_OUT_Resume ( uint32_t  Instance)

Resumes the audio file stream.

Parameters
Instance: AUDIO OUT Instance. It can only be 0 (SAI)
Note
When calling BSP_AUDIO_OUT_Pause() function for pause, only BSP_AUDIO_OUT_Resume() function should be called for resume (use of BSP_AUDIO_OUT_Play() function for resume could lead to unexpected behavior).
Return values
BSPstatus

Definition at line 690 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_OUT_SetBitsPerSample()

int32_t BSP_AUDIO_OUT_SetBitsPerSample ( uint32_t  Instance,
uint32_t  BitsPerSample 
)

Set the audio Resolution.

Parameters
Instance: AUDIO OUT Instance. It can only be 0 (SAI)
BitsPerSampleAudio Resolution used to play the audio stream.
Return values
BSPstatus

Definition at line 1064 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_OUT_SetChannelsNbr()

int32_t BSP_AUDIO_OUT_SetChannelsNbr ( uint32_t  Instance,
uint32_t  ChannelNbr 
)

Set the audio Channels number.

Parameters
Instance: AUDIO OUT Instance. It can only be 0 (SAI)
ChannelNbrAudio Channels number used to play the audio stream.
Return values
BSPstatus

Definition at line 1170 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_OUT_SetDevice()

int32_t BSP_AUDIO_OUT_SetDevice ( uint32_t  Instance,
uint32_t  Device 
)

Switch dynamically (while audio file is played) the output target (speaker or headphone).

Parameters
InstanceAUDIO OUT Instance. It can only be 0 (SAI) or 1 (I2S)
DeviceThe audio output device
Return values
BSPstatus

Definition at line 917 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_OUT_SetSampleRate()

int32_t BSP_AUDIO_OUT_SetSampleRate ( uint32_t  Instance,
uint32_t  SampleRate 
)

Updates the audio frequency.

Parameters
Instance: AUDIO OUT Instance. It can only be 0 (SAI)
SampleRateAudio frequency used to play the audio stream.
Note
This API should be called after the BSP_AUDIO_OUT_Init() to adjust the audio frequency.
Return values
BSPstatus

Definition at line 972 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_OUT_SetVolume()

int32_t BSP_AUDIO_OUT_SetVolume ( uint32_t  Instance,
uint32_t  Volume 
)

Controls the current audio volume level.

Parameters
Instance: AUDIO OUT Instance. It can only be 0 (SAI)
VolumeVolume level to be set in percentage from 0% to 100% (0 for Mute and 100 for Max volume level).
Return values
BSPstatus

Definition at line 774 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_OUT_Stop()

int32_t BSP_AUDIO_OUT_Stop ( uint32_t  Instance)

Stops audio playing and Power down the Audio Codec.

Parameters
Instance: AUDIO OUT Instance. It can only be 0 (SAI)
Return values
BSPstatus

Definition at line 729 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_OUT_TransferComplete_CallBack()

void BSP_AUDIO_OUT_TransferComplete_CallBack ( uint32_t  Instance)

Manages the DMA full Transfer complete event.

Parameters
Instance: AUDIO OUT Instance. It can only be 0 (SAI)
Return values
None

Definition at line 1331 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_OUT_UnMute()

int32_t BSP_AUDIO_OUT_UnMute ( uint32_t  Instance)

Disables the MUTE mode.

Parameters
Instance: AUDIO OUT Instance. It can only be 0 (SAI)
Return values
BSPstatus

Definition at line 863 of file stm32h747i_discovery_audio.c.

◆ HAL_SAI_ErrorCallback()

void HAL_SAI_ErrorCallback ( SAI_HandleTypeDef hsai)

SAI error callbacks.

Parameters
hsaiSAI handle
Return values
None

Definition at line 1312 of file stm32h747i_discovery_audio.c.

◆ HAL_SAI_TxCpltCallback()

void HAL_SAI_TxCpltCallback ( SAI_HandleTypeDef hsai)

Tx Transfer completed callbacks.

Parameters
hsaiSAI handle
Return values
None

Definition at line 1282 of file stm32h747i_discovery_audio.c.

◆ HAL_SAI_TxHalfCpltCallback()

void HAL_SAI_TxHalfCpltCallback ( SAI_HandleTypeDef hsai)

Tx Half Transfer completed callbacks.

Parameters
hsaiSAI handle
Return values
None

Definition at line 1297 of file stm32h747i_discovery_audio.c.

◆ MX_SAI1_Block_A_Init()

HAL_StatusTypeDef MX_SAI1_Block_A_Init ( SAI_HandleTypeDef hsai,
MX_SAI_Config_t MXConfig 
)

Initializes the Audio Codec audio out instance (SAI).

Parameters
hsaiSAI handle
MXConfigSAI configuration structure
Note
Being __weak it can be overwritten by the application
Return values
HALstatus

Definition at line 384 of file stm32h747i_discovery_audio.c.

◆ MX_SAI1_ClockConfig()

HAL_StatusTypeDef MX_SAI1_ClockConfig ( SAI_HandleTypeDef hsai,
uint32_t  SampleRate 
)

SAI clock Config.

Parameters
hsaiSAI handle
SampleRateAudio frequency used to play the audio stream.
Note
This API is called by BSP_AUDIO_OUT_Init() and BSP_AUDIO_OUT_SetFrequency() Being __weak it can be overwritten by the application
Return values
HALstatus

Definition at line 444 of file stm32h747i_discovery_audio.c.

◆ MX_SAI4_ClockConfig()

HAL_StatusTypeDef MX_SAI4_ClockConfig ( SAI_HandleTypeDef hsai,
uint32_t  SampleRate 
)

SAI clock Config.

Parameters
hsaiSAI handle
SampleRateAudio frequency used to play the audio stream.
Note
This API is called by BSP_AUDIO_OUT_Init() and BSP_AUDIO_OUT_SetFrequency() Being __weak it can be overwritten by the application
Return values
HALstatus

Definition at line 485 of file stm32h747i_discovery_audio.c.



picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:15:09