STM32L4R9I_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_DeInit (void) |
De-Initializes audio codec related peripherals. | |
uint8_t | BSP_AUDIO_OUT_Play (uint16_t *pData, uint32_t Size) |
Starts playing audio stream from a data buffer for a determined size. | |
uint8_t | BSP_AUDIO_OUT_ChangeBuffer (uint16_t *pData, uint16_t Size) |
Sends n-Bytes on the SAI interface. | |
uint8_t | BSP_AUDIO_OUT_Pause (void) |
This function Pauses the audio file stream. | |
uint8_t | BSP_AUDIO_OUT_Resume (void) |
This function 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). | |
uint8_t | BSP_AUDIO_OUT_SetFrequency (uint32_t AudioFreq) |
Update the audio frequency. | |
void | BSP_AUDIO_OUT_ChangeAudioConfig (uint32_t AudioOutOption) |
Changes the Audio Out Configuration. | |
void | BSP_AUDIO_OUT_RegisterCallbacks (Audio_CallbackTypeDef ErrorCallback, Audio_CallbackTypeDef HalfTransferCallback, Audio_CallbackTypeDef TransferCompleteCallback) |
register user callback functions | |
void | HAL_SAI_TxCpltCallback (SAI_HandleTypeDef *hsai) |
Tx Transfer completed callbacks. | |
void | HAL_SAI_TxHalfCpltCallback (SAI_HandleTypeDef *hsai) |
Tx Half Transfer completed callbacks. | |
void | HAL_SAI_ErrorCallback (SAI_HandleTypeDef *hsai) |
SAI error callbacks. | |
uint8_t | BSP_AUDIO_IN_Init (uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr) |
Initializes wave recording. | |
uint8_t | BSP_AUDIO_IN_DeInit (void) |
De-Initializes microphone related peripherals. | |
uint8_t | BSP_AUDIO_IN_Record (uint16_t *pbuf, uint32_t size) |
Starts audio recording. | |
uint8_t | BSP_AUDIO_IN_SetFrequency (uint32_t AudioFreq) |
Updates the audio frequency. | |
void | HAL_DFSDM_FilterRegConvCpltCallback (DFSDM_Filter_HandleTypeDef *hdfsdm_filter) |
Regular conversion complete callback. | |
void | HAL_DFSDM_FilterRegConvHalfCpltCallback (DFSDM_Filter_HandleTypeDef *hdfsdm_filter) |
Half regular conversion complete callback. | |
void | HAL_DFSDM_FilterErrorCallback (DFSDM_Filter_HandleTypeDef *hdfsdm_filter) |
Error callback. | |
uint8_t | BSP_AUDIO_IN_Stop (void) |
Stops audio recording. | |
uint8_t | BSP_AUDIO_IN_Pause (void) |
Pauses the audio file stream. | |
uint8_t | BSP_AUDIO_IN_Resume (void) |
Resumes the audio file stream. | |
void | BSP_AUDIO_IN_RegisterCallbacks (Audio_CallbackTypeDef ErrorCallback, Audio_CallbackTypeDef HalfTransferCallback, Audio_CallbackTypeDef TransferCompleteCallback) |
register user callback functions |
Function Documentation
uint8_t BSP_AUDIO_IN_DeInit | ( | void | ) |
De-Initializes microphone related peripherals.
- Return values:
-
BSP AUDIO status
Definition at line 773 of file stm32l4r9i_eval_audio.c.
References AUDIO_DFSDMx_DeInit(), AUDIO_ERROR, and AUDIO_OK.
uint8_t BSP_AUDIO_IN_Init | ( | uint32_t | AudioFreq, |
uint32_t | BitRes, | ||
uint32_t | ChnlNbr | ||
) |
Initializes wave recording.
- Parameters:
-
AudioFreq,: Audio frequency to be configured. BitRes,: Audio bit resolution to be configured.. ChnlNbr,: Number of channel to be configured.
- Return values:
-
AUDIO_OK if correct communication, else wrong communication
Definition at line 724 of file stm32l4r9i_eval_audio.c.
References AUDIO_DFSDMx_Init(), AUDIO_ERROR, AUDIO_OK, AUDIO_SAIPLLConfig(), AUDIO_IN_TypeDef::BitResolution, AUDIO_IN_TypeDef::CbError, AUDIO_IN_TypeDef::CbHalfTransfer, AUDIO_IN_TypeDef::CbTransferComplete, AUDIO_IN_TypeDef::ChannelNbr, DmaLeftRecBuffCplt, DmaLeftRecHalfBuffCplt, DmaRightRecBuffCplt, DmaRightRecHalfBuffCplt, AUDIO_OUT_TypeDef::Frequency, AUDIO_IN_TypeDef::Frequency, AUDIO_IN_TypeDef::InputDevice, and AUDIO_OUT_TypeDef::OutputDevice.
uint8_t BSP_AUDIO_IN_Pause | ( | void | ) |
Pauses the audio file stream.
- Return values:
-
AUDIO_OK if correct communication, else wrong communication
Definition at line 993 of file stm32l4r9i_eval_audio.c.
References AUDIO_ERROR, AUDIO_OK, BSP_AUDIO_hDfsdmLeftFilter, and BSP_AUDIO_hDfsdmRightFilter.
uint8_t BSP_AUDIO_IN_Record | ( | uint16_t * | pbuf, |
uint32_t | size | ||
) |
Starts audio recording.
- Parameters:
-
pbuf,: Main buffer pointer for the recorded data storing size,: Current size of the recorded buffer
- Note:
- The Right channel is start at first with synchro on start of Left channel
- Return values:
-
AUDIO_OK if correct communication, else wrong communication
Definition at line 794 of file stm32l4r9i_eval_audio.c.
References AUDIO_ERROR, AUDIO_OK, BSP_AUDIO_hDfsdmLeftFilter, BSP_AUDIO_hDfsdmRightFilter, AUDIO_IN_TypeDef::ChannelNbr, AUDIO_IN_TypeDef::LeftRecBuff, AUDIO_IN_TypeDef::pRecBuf, AUDIO_IN_TypeDef::RecSize, and AUDIO_IN_TypeDef::RightRecBuff.
void BSP_AUDIO_IN_RegisterCallbacks | ( | Audio_CallbackTypeDef | ErrorCallback, |
Audio_CallbackTypeDef | HalfTransferCallback, | ||
Audio_CallbackTypeDef | TransferCompleteCallback | ||
) |
register user callback functions
- Parameters:
-
ErrorCallback,: pointer to the error callback function HalfTransferCallback,: pointer to the half transfer callback function TransferCompleteCallback,: pointer to the transfer complete callback function
- Return values:
-
None
Definition at line 1044 of file stm32l4r9i_eval_audio.c.
References AUDIO_IN_TypeDef::CbError, AUDIO_IN_TypeDef::CbHalfTransfer, and AUDIO_IN_TypeDef::CbTransferComplete.
uint8_t BSP_AUDIO_IN_Resume | ( | void | ) |
Resumes the audio file stream.
- Note:
- The Right channel is start a first with synchro on start Left channel
- Return values:
-
AUDIO_OK if correct communication, else wrong communication
Definition at line 1015 of file stm32l4r9i_eval_audio.c.
References AUDIO_ERROR, AUDIO_OK, BSP_AUDIO_hDfsdmLeftFilter, BSP_AUDIO_hDfsdmRightFilter, AUDIO_IN_TypeDef::ChannelNbr, AUDIO_IN_TypeDef::LeftRecBuff, AUDIO_IN_TypeDef::RecSize, and AUDIO_IN_TypeDef::RightRecBuff.
uint8_t BSP_AUDIO_IN_SetFrequency | ( | uint32_t | AudioFreq | ) |
Updates the audio frequency.
- Parameters:
-
AudioFreq,: Audio frequency used to record the audio stream.
- Note:
- This API should be called after the BSP_AUDIO_IN_Init() to adjust the audio frequency.
- Return values:
-
AUDIO_OK if correct communication, else wrong communication
Definition at line 847 of file stm32l4r9i_eval_audio.c.
References AUDIO_DFSDMx_DeInit(), AUDIO_DFSDMx_Init(), AUDIO_ERROR, AUDIO_OK, and AUDIO_SAIPLLConfig().
uint8_t BSP_AUDIO_IN_Stop | ( | void | ) |
Stops audio recording.
- Return values:
-
AUDIO_OK if correct communication, else wrong communication
Definition at line 960 of file stm32l4r9i_eval_audio.c.
References AUDIO_ERROR, AUDIO_OK, BSP_AUDIO_hDfsdmLeftFilter, BSP_AUDIO_hDfsdmRightFilter, AUDIO_IN_TypeDef::LeftRecBuff, and AUDIO_IN_TypeDef::RightRecBuff.
void BSP_AUDIO_OUT_ChangeAudioConfig | ( | uint32_t | AudioOutOption | ) |
Changes the Audio Out Configuration.
- Parameters:
-
AudioOutOption,: specifies the audio out new configuration This parameter can be any value of BSP Audio Out Option
- Note:
- This API should be called after the BSP_AUDIO_OUT_Init() to adjust the audio out configuration.
- Return values:
-
None
Definition at line 598 of file stm32l4r9i_eval_audio.c.
References BSP_AUDIO_hSai, BSP_AUDIO_OUT_CIRCULARMODE, and BSP_AUDIO_OUT_STEREOMODE.
uint8_t BSP_AUDIO_OUT_ChangeBuffer | ( | uint16_t * | pData, |
uint16_t | Size | ||
) |
Sends n-Bytes on the SAI interface.
- Parameters:
-
pData,: pointer on data address Size,: number of data to be written
- Return values:
-
AUDIO_OK if correct communication, else wrong communication
Definition at line 412 of file stm32l4r9i_eval_audio.c.
References AUDIO_ERROR, AUDIO_OK, and BSP_AUDIO_hSai.
uint8_t BSP_AUDIO_OUT_DeInit | ( | void | ) |
De-Initializes audio codec related peripherals.
- Return values:
-
BSP AUDIO status
Definition at line 366 of file stm32l4r9i_eval_audio.c.
References AUDIO_ERROR, AUDIO_OK, AUDIO_SAIx_DeInit(), and AUDIO_OUT_TypeDef::AudioDrv.
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, or OUTPUT_DEVICE_BOTH. Volume,: Initial volume level (from 0 (Mute) to 100 (Max)) AudioFreq,: Audio frequency used to play the audio stream.
- Return values:
-
BSP AUDIO status
- Note:
- The SAI PLL input clock must be configure in the user application. The SAI PLL configuration done within this function assumes that the SAI PLL input clock runs at 4 MHz.
Definition at line 301 of file stm32l4r9i_eval_audio.c.
References AUDIO_CODEC_Reset(), AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, AUDIO_SAIPLLConfig(), AUDIO_SAIx_Init(), AUDIO_OUT_TypeDef::AudioDrv, BSP_AUDIO_OUT_SetVolume(), AUDIO_OUT_TypeDef::CbError, AUDIO_OUT_TypeDef::CbHalfTransfer, AUDIO_OUT_TypeDef::CbTransferComplete, AUDIO_OUT_TypeDef::Frequency, AUDIO_IN_TypeDef::Frequency, AUDIO_IN_TypeDef::InputDevice, and AUDIO_OUT_TypeDef::OutputDevice.
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.
- 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:
-
AUDIO_OK if correct communication, else wrong communication
Definition at line 432 of file stm32l4r9i_eval_audio.c.
References AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, AUDIO_OUT_TypeDef::AudioDrv, and BSP_AUDIO_hSai.
uint8_t BSP_AUDIO_OUT_Play | ( | uint16_t * | pData, |
uint32_t | Size | ||
) |
Starts playing audio stream from a data buffer for a determined size.
- Parameters:
-
pData,: pointer on PCM samples buffer Size,: Number of audio data HALF WORD.
- Return values:
-
AUDIO_OK if correct communication, else wrong communication
Definition at line 389 of file stm32l4r9i_eval_audio.c.
References AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, AUDIO_OUT_TypeDef::AudioDrv, BSP_AUDIO_hSai, and DMA_MAX.
void BSP_AUDIO_OUT_RegisterCallbacks | ( | Audio_CallbackTypeDef | ErrorCallback, |
Audio_CallbackTypeDef | HalfTransferCallback, | ||
Audio_CallbackTypeDef | TransferCompleteCallback | ||
) |
register user callback functions
- Parameters:
-
ErrorCallback,: pointer to the error callback function HalfTransferCallback,: pointer to the half transfer callback function TransferCompleteCallback,: pointer to the transfer complete callback function
- Return values:
-
None
Definition at line 658 of file stm32l4r9i_eval_audio.c.
References AUDIO_OUT_TypeDef::CbError, AUDIO_OUT_TypeDef::CbHalfTransfer, and AUDIO_OUT_TypeDef::CbTransferComplete.
uint8_t BSP_AUDIO_OUT_Resume | ( | void | ) |
This function Resumes the audio file stream.
- 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:
-
AUDIO_OK if correct communication, else wrong communication
Definition at line 457 of file stm32l4r9i_eval_audio.c.
References AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, AUDIO_OUT_TypeDef::AudioDrv, and BSP_AUDIO_hSai.
uint8_t BSP_AUDIO_OUT_SetFrequency | ( | uint32_t | AudioFreq | ) |
Update the audio frequency.
- Parameters:
-
AudioFreq,: Audio frequency used to play the audio stream.
- Note:
- This API should be called after the BSP_AUDIO_OUT_Init() to adjust the audio frequency.
- The SAI PLL configuration done within this function assumes that the SAI PLL input clock runs at 4 MHz.
- Return values:
-
AUDIO_OK if correct communication, else wrong communication
Definition at line 567 of file stm32l4r9i_eval_audio.c.
References AUDIO_ERROR, AUDIO_OK, AUDIO_SAIPLLConfig(), BSP_AUDIO_hSai, AUDIO_OUT_TypeDef::Frequency, and SAIClockDivider.
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 529 of file stm32l4r9i_eval_audio.c.
References AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, and AUDIO_OUT_TypeDef::AudioDrv.
uint8_t BSP_AUDIO_OUT_SetOutputMode | ( | uint8_t | Output | ) |
Switch dynamically (while audio file is played) the output target (speaker or headphone).
- Parameters:
-
Output,: The audio output target: OUTPUT_DEVICE_SPEAKER, OUTPUT_DEVICE_HEADPHONE or OUTPUT_DEVICE_BOTH
- Return values:
-
AUDIO_OK if correct communication, else wrong communication
Definition at line 547 of file stm32l4r9i_eval_audio.c.
References AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, and AUDIO_OUT_TypeDef::AudioDrv.
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 512 of file stm32l4r9i_eval_audio.c.
References AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, and AUDIO_OUT_TypeDef::AudioDrv.
Referenced by BSP_AUDIO_OUT_Init().
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 483 of file stm32l4r9i_eval_audio.c.
References AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, AUDIO_OUT_TypeDef::AudioDrv, and BSP_AUDIO_hSai.
void HAL_DFSDM_FilterErrorCallback | ( | DFSDM_Filter_HandleTypeDef * | hdfsdm_filter | ) |
Error callback.
- Parameters:
-
hdfsdm_filter : DFSDM filter handle.
- Return values:
-
None
Definition at line 947 of file stm32l4r9i_eval_audio.c.
References AUDIO_IN_TypeDef::CbError.
void HAL_DFSDM_FilterRegConvCpltCallback | ( | DFSDM_Filter_HandleTypeDef * | hdfsdm_filter | ) |
Regular conversion complete callback.
- Note:
- In interrupt mode, user has to read conversion value in this function using HAL_DFSDM_FilterGetRegularValue.
- Parameters:
-
hdfsdm_filter : DFSDM filter handle.
- Return values:
-
None
Definition at line 877 of file stm32l4r9i_eval_audio.c.
References BSP_AUDIO_hDfsdmLeftFilter, AUDIO_IN_TypeDef::CbTransferComplete, AUDIO_IN_TypeDef::ChannelNbr, DmaLeftRecBuffCplt, DmaRightRecBuffCplt, AUDIO_IN_TypeDef::LeftRecBuff, AUDIO_IN_TypeDef::pRecBuf, AUDIO_IN_TypeDef::RecSize, AUDIO_IN_TypeDef::RightRecBuff, and SaturaLH.
void HAL_DFSDM_FilterRegConvHalfCpltCallback | ( | DFSDM_Filter_HandleTypeDef * | hdfsdm_filter | ) |
Half regular conversion complete callback.
- Parameters:
-
hdfsdm_filter : DFSDM filter handle.
- Return values:
-
None
Definition at line 912 of file stm32l4r9i_eval_audio.c.
References BSP_AUDIO_hDfsdmLeftFilter, AUDIO_IN_TypeDef::CbHalfTransfer, AUDIO_IN_TypeDef::ChannelNbr, DmaLeftRecHalfBuffCplt, DmaRightRecHalfBuffCplt, AUDIO_IN_TypeDef::LeftRecBuff, AUDIO_IN_TypeDef::pRecBuf, AUDIO_IN_TypeDef::RecSize, AUDIO_IN_TypeDef::RightRecBuff, and SaturaLH.
void HAL_SAI_ErrorCallback | ( | SAI_HandleTypeDef * | hsai | ) |
SAI error callbacks.
- Parameters:
-
hsai,: SAI handle
- Return values:
-
None
Definition at line 700 of file stm32l4r9i_eval_audio.c.
References AUDIO_OUT_TypeDef::CbError.
void HAL_SAI_TxCpltCallback | ( | SAI_HandleTypeDef * | hsai | ) |
Tx Transfer completed callbacks.
- Parameters:
-
hsai,: SAI handle
- Return values:
-
None
Definition at line 672 of file stm32l4r9i_eval_audio.c.
References AUDIO_OUT_TypeDef::CbTransferComplete.
void HAL_SAI_TxHalfCpltCallback | ( | SAI_HandleTypeDef * | hsai | ) |
Tx Half Transfer completed callbacks.
- Parameters:
-
hsai,: SAI handle
- Return values:
-
None
Definition at line 686 of file stm32l4r9i_eval_audio.c.
References AUDIO_OUT_TypeDef::CbHalfTransfer.
Generated on Thu Oct 12 2017 10:54:00 for STM32L4R9I_EVAL BSP User Manual by 1.7.6.1