STM324xG_EVAL BSP User Manual
|
Functions | |
uint8_t | BSP_AUDIO_OUT_Init (uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq) |
Configures the audio peripherals. | |
uint8_t | BSP_AUDIO_OUT_Play (uint16_t *pBuffer, uint32_t Size) |
Starts playing audio stream from a data buffer for a determined size. | |
void | BSP_AUDIO_OUT_ChangeBuffer (uint16_t *pData, uint16_t Size) |
Sends n-Bytes on the I2S interface. | |
uint8_t | BSP_AUDIO_OUT_Pause (void) |
Pauses the audio file stream. | |
uint8_t | BSP_AUDIO_OUT_Resume (void) |
Resumes the audio file stream. | |
uint8_t | BSP_AUDIO_OUT_Stop (uint32_t Option) |
Stops audio playing and Power down the Audio Codec. | |
uint8_t | BSP_AUDIO_OUT_SetVolume (uint8_t Volume) |
Controls the current audio volume level. | |
uint8_t | BSP_AUDIO_OUT_SetMute (uint32_t Cmd) |
Enables or disables the MUTE mode by software. | |
uint8_t | BSP_AUDIO_OUT_SetOutputMode (uint8_t Output) |
Switch dynamically (while audio file is played) the output target (speaker or headphone). | |
void | BSP_AUDIO_OUT_SetFrequency (uint32_t AudioFreq) |
Updates the audio frequency. | |
void | HAL_I2S_TxCpltCallback (I2S_HandleTypeDef *hi2s) |
Tx Transfer completed callbacks. | |
void | HAL_I2S_TxHalfCpltCallback (I2S_HandleTypeDef *hi2s) |
Tx Transfer Half completed callbacks. | |
void | HAL_I2S_ErrorCallback (I2S_HandleTypeDef *hi2s) |
I2S error callbacks. | |
__weak void | BSP_AUDIO_OUT_TransferComplete_CallBack (void) |
Manages the DMA full Transfer complete event. | |
__weak void | BSP_AUDIO_OUT_HalfTransfer_CallBack (void) |
Manages the DMA Half Transfer complete event. | |
__weak void | BSP_AUDIO_OUT_Error_CallBack (void) |
Manages the DMA FIFO error event. | |
static void | I2Sx_Init (uint32_t AudioFreq) |
Initializes the Audio Codec audio interface (I2S). | |
static void | CODEC_Reset (void) |
Resets the audio codec. |
Function Documentation
void BSP_AUDIO_OUT_ChangeBuffer | ( | uint16_t * | pData, |
uint16_t | Size | ||
) |
Sends n-Bytes on the I2S interface.
- Parameters:
-
pData,: Pointer to data address Size,: Number of data to be written.
Definition at line 273 of file stm324xg_eval_audio.c.
References haudio_i2s.
__weak void BSP_AUDIO_OUT_Error_CallBack | ( | void | ) |
Manages the DMA FIFO error event.
Definition at line 514 of file stm324xg_eval_audio.c.
Referenced by HAL_I2S_ErrorCallback().
__weak void BSP_AUDIO_OUT_HalfTransfer_CallBack | ( | void | ) |
Manages the DMA Half Transfer complete event.
Definition at line 507 of file stm324xg_eval_audio.c.
Referenced by HAL_I2S_TxHalfCpltCallback().
uint8_t BSP_AUDIO_OUT_Init | ( | uint16_t | OutputDevice, |
uint8_t | Volume, | ||
uint32_t | AudioFreq | ||
) |
Configures the audio peripherals.
- Parameters:
-
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.
- Note:
- This function configure also that the I2S PLL input clock.
- Return values:
-
0 if correct communication, else wrong communication
Definition at line 183 of file stm324xg_eval_audio.c.
References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, CODEC_Reset(), I2SFreq, I2SPLLN, I2SPLLR, and I2Sx_Init().
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 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:
-
AUDIO_OK if correct communication, else wrong communication
Definition at line 286 of file stm324xg_eval_audio.c.
References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, and haudio_i2s.
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:
-
pBuffer,: Pointer to the buffer Size,: Number of audio data BYTES.
- Return values:
-
AUDIO_OK if correct communication, else wrong communication
Definition at line 253 of file stm324xg_eval_audio.c.
References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, AUDIODATA_SIZE, DMA_MAX, and haudio_i2s.
uint8_t BSP_AUDIO_OUT_Resume | ( | void | ) |
Resumes the audio file stream.
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).
- Return values:
-
AUDIO_OK if correct communication, else wrong communication
Definition at line 310 of file stm324xg_eval_audio.c.
References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, and haudio_i2s.
void BSP_AUDIO_OUT_SetFrequency | ( | uint32_t | AudioFreq | ) |
Updates the audio frequency.
- Parameters:
-
AudioFreq,: Audio frequency used to play the audio stream.
- Return values:
-
AUDIO_OK if correct communication, else wrong communication
Definition at line 429 of file stm324xg_eval_audio.c.
References I2SFreq, I2SPLLN, I2SPLLR, and I2Sx_Init().
uint8_t BSP_AUDIO_OUT_SetMute | ( | uint32_t | Cmd | ) |
Enables or disables the MUTE mode by software.
- Parameters:
-
Cmd,: could be AUDIO_MUTE_ON to mute sound or AUDIO_MUTE_OFF to unmute the codec and restore previous volume level.
- Return values:
-
AUDIO_OK if correct communication, else wrong communication
Definition at line 388 of file stm324xg_eval_audio.c.
References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, and AUDIO_OK.
uint8_t BSP_AUDIO_OUT_SetOutputMode | ( | uint8_t | Output | ) |
Switch dynamically (while audio file is played) the output target (speaker or headphone).
- Note:
- This function modifies a global variable of the audio codec driver: OutputDev.
- Parameters:
-
Output,: specifies the audio output target: OUTPUT_DEVICE_SPEAKER, OUTPUT_DEVICE_HEADPHONE, OUTPUT_DEVICE_BOTH or OUTPUT_DEVICE_AUTO
- Return values:
-
AUDIO_OK if correct communication, else wrong communication
Definition at line 410 of file stm324xg_eval_audio.c.
References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, and AUDIO_OK.
uint8_t BSP_AUDIO_OUT_SetVolume | ( | uint8_t | Volume | ) |
Controls the current audio volume level.
- Parameters:
-
Volume,: Volume level to be set in percentage from 0% to 100% (0 for Mute and 100 for Max volume level).
- Return values:
-
AUDIO_OK if correct communication, else wrong communication
Definition at line 368 of file stm324xg_eval_audio.c.
References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, and AUDIO_OK.
uint8_t BSP_AUDIO_OUT_Stop | ( | uint32_t | Option | ) |
Stops audio playing and Power down the Audio Codec.
- Parameters:
-
Option,: could 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_OK if correct communication, else wrong communication
Definition at line 336 of file stm324xg_eval_audio.c.
References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, AUDIO_RESET_PIN, BSP_IO_WritePin(), and haudio_i2s.
__weak void BSP_AUDIO_OUT_TransferComplete_CallBack | ( | void | ) |
Manages the DMA full Transfer complete event.
Definition at line 500 of file stm324xg_eval_audio.c.
Referenced by HAL_I2S_TxCpltCallback().
static void CODEC_Reset | ( | void | ) | [static] |
Resets the audio codec.
It restores the default configuration of the codec (this function shall be called before initializing the codec).
- Note:
- This function calls an external driver function: The IO Expander driver.
Definition at line 626 of file stm324xg_eval_audio.c.
References AUDIO_RESET_PIN, BSP_IO_ConfigPin(), BSP_IO_Init(), BSP_IO_WritePin(), and CODEC_RESET_DELAY.
Referenced by BSP_AUDIO_OUT_Init().
void HAL_I2S_ErrorCallback | ( | I2S_HandleTypeDef * | hi2s | ) |
I2S error callbacks.
- Parameters:
-
hi2s,: I2S handle
Definition at line 492 of file stm324xg_eval_audio.c.
References BSP_AUDIO_OUT_Error_CallBack().
void HAL_I2S_TxCpltCallback | ( | I2S_HandleTypeDef * | hi2s | ) |
Tx Transfer completed callbacks.
- Parameters:
-
hi2s,: I2S handle
Definition at line 470 of file stm324xg_eval_audio.c.
References BSP_AUDIO_OUT_TransferComplete_CallBack().
void HAL_I2S_TxHalfCpltCallback | ( | I2S_HandleTypeDef * | hi2s | ) |
Tx Transfer Half completed callbacks.
- Parameters:
-
hi2s,: I2S handle
Definition at line 481 of file stm324xg_eval_audio.c.
References BSP_AUDIO_OUT_HalfTransfer_CallBack().
static void I2Sx_Init | ( | uint32_t | AudioFreq | ) | [static] |
Initializes the Audio Codec audio interface (I2S).
- Parameters:
-
AudioFreq,: Audio frequency to be configured for the I2S peripheral.
Definition at line 598 of file stm324xg_eval_audio.c.
References AUDIO_I2Sx, haudio_i2s, and I2Sx_MspInit().
Referenced by BSP_AUDIO_OUT_Init(), and BSP_AUDIO_OUT_SetFrequency().
Generated on Fri Jan 15 2016 14:22:30 for STM324xG_EVAL BSP User Manual by
