Functions | |
void | BSP_AUDIO_OUT_ChangeBuffer (uint16_t *pData, uint16_t Size) |
Sends n-Bytes on the I2S interface. More... | |
__weak void | BSP_AUDIO_OUT_ClockConfig (I2S_HandleTypeDef *hi2s, uint32_t AudioFreq, void *Params) |
Clock Config. 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 (I2S_HandleTypeDef *hi2s, void *Params) |
De-Initializes BSP_AUDIO_OUT MSP. More... | |
__weak void | BSP_AUDIO_OUT_MspInit (I2S_HandleTypeDef *hi2s, void *Params) |
AUDIO OUT I2S MSP Init. More... | |
uint8_t | BSP_AUDIO_OUT_Pause (void) |
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). 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 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). More... | |
void | BSP_AUDIO_OUT_SetFrequency (uint32_t AudioFreq) |
Update 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_I2S_TxCpltCallback (I2S_HandleTypeDef *hi2s) |
Tx Transfer completed callbacks. More... | |
void | HAL_I2S_TxHalfCpltCallback (I2S_HandleTypeDef *hi2s) |
Tx Half Transfer completed callbacks. More... | |
static uint8_t | I2S3_Init (uint32_t AudioFreq) |
Initializes the Audio Codec audio interface (I2S). More... | |
void BSP_AUDIO_OUT_ChangeBuffer | ( | uint16_t * | pData, |
uint16_t | Size | ||
) |
Sends n-Bytes on the I2S interface.
pData | Pointer to data address |
Size | Number of data to be written |
Definition at line 288 of file stm32f411e_discovery_audio.c.
__weak void BSP_AUDIO_OUT_ClockConfig | ( | I2S_HandleTypeDef * | hi2s, |
uint32_t | AudioFreq, | ||
void * | Params | ||
) |
Clock Config.
hi2s | might be required to set audio peripheral predivider if any. |
AudioFreq | Audio frequency used to play the audio stream. |
Params | : pointer on additional configuration parameters, can be NULL. |
Definition at line 510 of file stm32f411e_discovery_audio.c.
__weak void BSP_AUDIO_OUT_Error_CallBack | ( | void | ) |
Manages the DMA FIFO error event.
Definition at line 676 of file stm32f411e_discovery_audio.c.
__weak void BSP_AUDIO_OUT_HalfTransfer_CallBack | ( | void | ) |
Manages the DMA Half Transfer complete event.
Definition at line 669 of file stm32f411e_discovery_audio.c.
uint8_t BSP_AUDIO_OUT_Init | ( | uint16_t | OutputDevice, |
uint8_t | Volume, | ||
uint32_t | AudioFreq | ||
) |
Configures the audio peripherals.
OutputDevice | OUTPUT_DEVICE_SPEAKER, OUTPUT_DEVICE_HEADPHONE, OUTPUT_DEVICE_BOTH or OUTPUT_DEVICE_AUTO . |
Volume | Initial volume level (from 0 (Mute) to 100 (Max)) |
AudioFreq | Audio frequency used to play the audio stream. |
AUDIO_OK | if correct communication, else wrong communication |
Definition at line 214 of file stm32f411e_discovery_audio.c.
__weak void BSP_AUDIO_OUT_MspDeInit | ( | I2S_HandleTypeDef * | hi2s, |
void * | Params | ||
) |
De-Initializes BSP_AUDIO_OUT MSP.
hi2s | might be required to set audio peripheral predivider if any. |
Params | : pointer on additional configuration parameters, can be NULL. |
Definition at line 624 of file stm32f411e_discovery_audio.c.
__weak void BSP_AUDIO_OUT_MspInit | ( | I2S_HandleTypeDef * | hi2s, |
void * | Params | ||
) |
AUDIO OUT I2S MSP Init.
hi2s | might be required to set audio peripheral predivider if any. |
Params | : pointer on additional configuration parameters, can be NULL. |
Definition at line 554 of file stm32f411e_discovery_audio.c.
uint8_t BSP_AUDIO_OUT_Pause | ( | void | ) |
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).
AUDIO_OK | if correct communication, else wrong communication |
Definition at line 301 of file stm32f411e_discovery_audio.c.
uint8_t BSP_AUDIO_OUT_Play | ( | uint16_t * | pBuffer, |
uint32_t | Size | ||
) |
Starts playing audio stream from a data buffer for a determined size.
pBuffer | Pointer to the buffer |
Size | Number of audio data BYTES. |
AUDIO_OK | if correct communication, else wrong communication |
Definition at line 266 of file stm32f411e_discovery_audio.c.
uint8_t BSP_AUDIO_OUT_Resume | ( | void | ) |
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).
AUDIO_OK | if correct communication, else wrong communication |
Definition at line 325 of file stm32f411e_discovery_audio.c.
void BSP_AUDIO_OUT_SetFrequency | ( | uint32_t | AudioFreq | ) |
Update the audio frequency.
AudioFreq | Audio frequency used to play the audio stream. |
Definition at line 443 of file stm32f411e_discovery_audio.c.
uint8_t BSP_AUDIO_OUT_SetMute | ( | uint32_t | Cmd | ) |
Enables or disables the MUTE mode by software.
Cmd | could be AUDIO_MUTE_ON to mute sound or AUDIO_MUTE_OFF to unmute the codec and restore previous volume level. |
AUDIO_OK | if correct communication, else wrong communication |
Definition at line 401 of file stm32f411e_discovery_audio.c.
uint8_t BSP_AUDIO_OUT_SetOutputMode | ( | uint8_t | Output | ) |
Switch dynamically (while audio file is played) the output target (speaker or headphone).
Output | specifies the audio output target: OUTPUT_DEVICE_SPEAKER, OUTPUT_DEVICE_HEADPHONE, OUTPUT_DEVICE_BOTH or OUTPUT_DEVICE_AUTO |
AUDIO_OK | if correct communication, else wrong communication |
Definition at line 423 of file stm32f411e_discovery_audio.c.
uint8_t BSP_AUDIO_OUT_SetVolume | ( | uint8_t | Volume | ) |
Controls the current audio volume level.
Volume | Volume level to be set in percentage from 0% to 100% (0 for Mute and 100 for Max volume level). |
AUDIO_OK | if correct communication, else wrong communication |
Definition at line 381 of file stm32f411e_discovery_audio.c.
uint8_t BSP_AUDIO_OUT_Stop | ( | uint32_t | Option | ) |
Stops audio playing and Power down the Audio Codec.
Option | could be one of the following parameters
|
AUDIO_OK | if correct communication, else wrong communication |
Definition at line 349 of file stm32f411e_discovery_audio.c.
__weak void BSP_AUDIO_OUT_TransferComplete_CallBack | ( | void | ) |
Manages the DMA full Transfer complete event.
Definition at line 662 of file stm32f411e_discovery_audio.c.
void HAL_I2S_TxCpltCallback | ( | I2S_HandleTypeDef * | hi2s | ) |
Tx Transfer completed callbacks.
hi2s | I2S handle |
Definition at line 479 of file stm32f411e_discovery_audio.c.
void HAL_I2S_TxHalfCpltCallback | ( | I2S_HandleTypeDef * | hi2s | ) |
Tx Half Transfer completed callbacks.
hi2s | I2S handle |
Definition at line 492 of file stm32f411e_discovery_audio.c.
|
static |
Initializes the Audio Codec audio interface (I2S).
AudioFreq | Audio frequency to be configured for the I2S peripheral. |
Definition at line 688 of file stm32f411e_discovery_audio.c.