Functions
STM32F769I_DISCOVERY_AUDIO_Out Private Functions
Collaboration diagram for STM32F769I_DISCOVERY_AUDIO_Out Private Functions:

Functions

void BSP_AUDIO_OUT_ChangeBuffer (uint16_t *pData, uint16_t Size)
 Sends n-Bytes on the SAI interface. More...
 
__weak void BSP_AUDIO_OUT_ClockConfig (SAI_HandleTypeDef *hsai, uint32_t AudioFreq, void *Params)
 Clock Config. More...
 
void BSP_AUDIO_OUT_DeInit (void)
 De-initializes the audio out peripheral. More...
 
__weak void BSP_AUDIO_OUT_Error_CallBack (void)
 Manages the DMA FIFO error event. More...
 
__weak void BSP_AUDIO_OUT_HalfTransfer_CallBack (void)
 Manages the DMA Half Transfer complete event. More...
 
uint8_t BSP_AUDIO_OUT_Init (uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq)
 Configures the audio peripherals. More...
 
__weak void BSP_AUDIO_OUT_MspDeInit (SAI_HandleTypeDef *hsai, void *Params)
 Deinitializes SAI MSP. More...
 
__weak void BSP_AUDIO_OUT_MspInit (SAI_HandleTypeDef *hsai, void *Params)
 Initializes BSP_AUDIO_OUT MSP. More...
 
uint8_t BSP_AUDIO_OUT_Pause (void)
 This function Pauses the audio file stream. In case of using DMA, the DMA Pause feature is used. More...
 
uint8_t BSP_AUDIO_OUT_Play (uint16_t *pBuffer, uint32_t Size)
 Starts playing audio stream from a data buffer for a determined size. More...
 
uint8_t BSP_AUDIO_OUT_Resume (void)
 Resumes the audio file stream.
More...
 
void BSP_AUDIO_OUT_SetAudioFrameSlot (uint32_t AudioFrameSlot)
 Updates the Audio frame slot configuration. More...
 
void BSP_AUDIO_OUT_SetFrequency (uint32_t AudioFreq)
 Updates the audio frequency. More...
 
uint8_t BSP_AUDIO_OUT_SetMute (uint32_t Cmd)
 Enables or disables the MUTE mode by software. More...
 
uint8_t BSP_AUDIO_OUT_SetOutputMode (uint8_t Output)
 Switch dynamically (while audio file is played) the output target (speaker or headphone). More...
 
uint8_t BSP_AUDIO_OUT_SetVolume (uint8_t Volume)
 Controls the current audio volume level. More...
 
uint8_t BSP_AUDIO_OUT_Stop (uint32_t Option)
 Stops audio playing and Power down the Audio Codec. More...
 
__weak void BSP_AUDIO_OUT_TransferComplete_CallBack (void)
 Manages the DMA full Transfer complete event. 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...
 
static void SAI_AUDIO_IN_MspDeInit (SAI_HandleTypeDef *hsai, void *Params)
 De-Initializes SAI Audio IN MSP. More...
 
static void SAI_AUDIO_IN_MspInit (SAI_HandleTypeDef *hsai, void *Params)
 Initializes SAI Audio IN MSP. More...
 
static void SAIx_In_DeInit (void)
 Deinitializes the output Audio Codec audio interface (SAI). More...
 
static void SAIx_In_Init (uint32_t AudioFreq)
 Initializes the Audio Codec audio interface (SAI). More...
 
static void SAIx_Out_DeInit (void)
 Deinitializes the Audio Codec audio interface (SAI). More...
 
static void SAIx_Out_Init (uint32_t AudioFreq)
 Initializes the Audio Codec audio interface (SAI). More...
 

Detailed Description

Function Documentation

◆ BSP_AUDIO_OUT_ChangeBuffer()

void BSP_AUDIO_OUT_ChangeBuffer ( uint16_t *  pData,
uint16_t  Size 
)

Sends n-Bytes on the SAI interface.

Sends n-Bytes on the I2S interface.

Parameters
pDatapointer on data address
Sizenumber of data to be written
Return values
None

Definition at line 379 of file stm32f769i_discovery_audio.c.

◆ BSP_AUDIO_OUT_ClockConfig()

__weak void BSP_AUDIO_OUT_ClockConfig ( SAI_HandleTypeDef hsai,
uint32_t  AudioFreq,
void *  Params 
)

Clock Config.

Parameters
hsaimight be required to set audio peripheral predivider if any.
AudioFreqAudio frequency used to play the audio stream.
Params
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
None

Definition at line 861 of file stm32f769i_discovery_audio.c.

◆ BSP_AUDIO_OUT_DeInit()

void BSP_AUDIO_OUT_DeInit ( void  )

De-initializes the audio out peripheral.

Deinit the audio peripherals.

Return values
None

Definition at line 572 of file stm32f769i_discovery_audio.c.

◆ BSP_AUDIO_OUT_Error_CallBack()

__weak void BSP_AUDIO_OUT_Error_CallBack ( void  )

Manages the DMA FIFO error event.

Return values
None

Definition at line 640 of file stm32f769i_discovery_audio.c.

◆ BSP_AUDIO_OUT_HalfTransfer_CallBack()

__weak void BSP_AUDIO_OUT_HalfTransfer_CallBack ( void  )

Manages the DMA Half Transfer complete event.

Return values
None

Definition at line 632 of file stm32f769i_discovery_audio.c.

◆ BSP_AUDIO_OUT_Init()

uint8_t BSP_AUDIO_OUT_Init ( uint16_t  OutputDevice,
uint8_t  Volume,
uint32_t  AudioFreq 
)

Configures the audio peripherals.

Parameters
OutputDeviceOUTPUT_DEVICE_SPEAKER, OUTPUT_DEVICE_HEADPHONE, or OUTPUT_DEVICE_BOTH.
VolumeInitial volume level (from 0 (Mute) to 100 (Max))
AudioFreqAudio frequency used to play the audio stream.
Return values
AUDIO_OKif correct communication, else wrong communication

Definition at line 305 of file stm32f769i_discovery_audio.c.

◆ BSP_AUDIO_OUT_MspDeInit()

__weak void BSP_AUDIO_OUT_MspDeInit ( SAI_HandleTypeDef hsai,
void *  Params 
)

Deinitializes SAI MSP.

Deinitializes BSP_AUDIO_OUT MSP.

Parameters
hsaiSAI handle
Params
Return values
None

Definition at line 822 of file stm32f769i_discovery_audio.c.

◆ BSP_AUDIO_OUT_MspInit()

__weak void BSP_AUDIO_OUT_MspInit ( SAI_HandleTypeDef hsai,
void *  Params 
)

Initializes BSP_AUDIO_OUT MSP.

Parameters
hsaiSAI handle
Params
Return values
None

Definition at line 650 of file stm32f769i_discovery_audio.c.

◆ BSP_AUDIO_OUT_Pause()

uint8_t BSP_AUDIO_OUT_Pause ( void  )

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

Pauses the audio file stream. In case of using DMA, the DMA Pause feature is used. WARNING: When calling BSP_AUDIO_OUT_Pause() function for pause, only the BSP_AUDIO_OUT_Resume() function should be called for resume (use of BSP_AUDIO_OUT_Play() function for resume could lead to unexpected behavior).

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 behaviour).
Return values
AUDIO_OKif correct communication, else wrong communication

Definition at line 392 of file stm32f769i_discovery_audio.c.

◆ BSP_AUDIO_OUT_Play()

uint8_t BSP_AUDIO_OUT_Play ( uint16_t *  pBuffer,
uint32_t  Size 
)

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

Parameters
pBufferPointer to the buffer
SizeNumber of audio data BYTES.
Return values
AUDIO_OKif correct communication, else wrong communication

Definition at line 357 of file stm32f769i_discovery_audio.c.

◆ BSP_AUDIO_OUT_Resume()

uint8_t BSP_AUDIO_OUT_Resume ( void  )

Resumes the audio file stream.

Resumes the audio file streaming.
WARNING: 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).

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 behaviour).
Return values
AUDIO_OKif correct communication, else wrong communication

Definition at line 416 of file stm32f769i_discovery_audio.c.

◆ BSP_AUDIO_OUT_SetAudioFrameSlot()

void BSP_AUDIO_OUT_SetAudioFrameSlot ( uint32_t  AudioFrameSlot)

Updates the Audio frame slot configuration.

Parameters
AudioFrameSlotspecifies the audio Frame slot
Note
This API should be called after the BSP_AUDIO_OUT_Init() to adjust the audio frame slot.
Return values
None

Definition at line 555 of file stm32f769i_discovery_audio.c.

◆ BSP_AUDIO_OUT_SetFrequency()

void BSP_AUDIO_OUT_SetFrequency ( uint32_t  AudioFreq)

Updates the audio frequency.

Update the audio frequency.

Parameters
AudioFreqAudio 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
None

Definition at line 532 of file stm32f769i_discovery_audio.c.

◆ BSP_AUDIO_OUT_SetMute()

uint8_t BSP_AUDIO_OUT_SetMute ( uint32_t  Cmd)

Enables or disables the MUTE mode by software.

Parameters
CmdCould be AUDIO_MUTE_ON to mute sound or AUDIO_MUTE_OFF to unmute the codec and restore previous volume level.
Return values
AUDIO_OKif correct communication, else wrong communication

Definition at line 490 of file stm32f769i_discovery_audio.c.

◆ BSP_AUDIO_OUT_SetOutputMode()

uint8_t BSP_AUDIO_OUT_SetOutputMode ( uint8_t  Output)

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

Parameters
OutputThe audio output target: OUTPUT_DEVICE_SPEAKER, OUTPUT_DEVICE_HEADPHONE or OUTPUT_DEVICE_BOTH
Return values
AUDIO_OKif correct communication, else wrong communication

Definition at line 511 of file stm32f769i_discovery_audio.c.

◆ BSP_AUDIO_OUT_SetVolume()

uint8_t BSP_AUDIO_OUT_SetVolume ( uint8_t  Volume)

Controls the current audio volume level.

Parameters
VolumeVolume level to be set in percentage from 0% to 100% (0 for Mute and 100 for Max volume level).
Return values
AUDIO_OKif correct communication, else wrong communication

Definition at line 470 of file stm32f769i_discovery_audio.c.

◆ BSP_AUDIO_OUT_Stop()

uint8_t BSP_AUDIO_OUT_Stop ( uint32_t  Option)

Stops audio playing and Power down the Audio Codec.

Parameters
Optioncould be one of the following parameters
  • CODEC_PDWN_SW: for software power off (by writing registers). Then no need to reconfigure the Codec after power on.
  • CODEC_PDWN_HW: completely shut down the codec (physically). Then need to reconfigure the Codec after power on.
Return values
AUDIO_OKif correct communication, else wrong communication

Definition at line 442 of file stm32f769i_discovery_audio.c.

◆ BSP_AUDIO_OUT_TransferComplete_CallBack()

__weak void BSP_AUDIO_OUT_TransferComplete_CallBack ( void  )

Manages the DMA full Transfer complete event.

Return values
None

Definition at line 624 of file stm32f769i_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 608 of file stm32f769i_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 584 of file stm32f769i_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 596 of file stm32f769i_discovery_audio.c.

◆ SAI_AUDIO_IN_MspDeInit()

static void SAI_AUDIO_IN_MspDeInit ( SAI_HandleTypeDef hsai,
void *  Params 
)
static

De-Initializes SAI Audio IN MSP.

Parameters
hsaiSAI handle
Params
Return values
None

Definition at line 789 of file stm32f769i_discovery_audio.c.

◆ SAI_AUDIO_IN_MspInit()

static void SAI_AUDIO_IN_MspInit ( SAI_HandleTypeDef hsai,
void *  Params 
)
static

Initializes SAI Audio IN MSP.

Parameters
hsaiSAI handle
Params
Return values
None

Definition at line 716 of file stm32f769i_discovery_audio.c.

◆ SAIx_In_DeInit()

static void SAIx_In_DeInit ( void  )
static

Deinitializes the output Audio Codec audio interface (SAI).

Return values
None

Definition at line 1100 of file stm32f769i_discovery_audio.c.

◆ SAIx_In_Init()

static void SAIx_In_Init ( uint32_t  AudioFreq)
static

Initializes the Audio Codec audio interface (SAI).

Parameters
AudioFreqAudio frequency to be configured for the SAI peripheral.
Note
The default SlotActive configuration is set to CODEC_AUDIOFRAME_SLOT_0123 and user can update this configuration using
Return values
None

Definition at line 987 of file stm32f769i_discovery_audio.c.

◆ SAIx_Out_DeInit()

static void SAIx_Out_DeInit ( void  )
static

Deinitializes the Audio Codec audio interface (SAI).

Return values
None

Definition at line 969 of file stm32f769i_discovery_audio.c.

◆ SAIx_Out_Init()

static void SAIx_Out_Init ( uint32_t  AudioFreq)
static

Initializes the Audio Codec audio interface (SAI).

Parameters
AudioFreqAudio frequency to be configured for the SAI peripheral.
Note
The default SlotActive configuration is set to CODEC_AUDIOFRAME_SLOT_0123 and user can update this configuration using
Return values
None

Definition at line 910 of file stm32f769i_discovery_audio.c.



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