Patched for Audio example - Add status check when DFSDM's filter and channel de-init.
Dependents: DISCO_F413ZH-AUDIO-demo
STM32F413H DISCOVERY AUDIO IN Private functions
[STM32F413H_DISCOVERY AUDIO]
Functions | |
uint8_t | BSP_AUDIO_IN_Init (uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr) |
Initializes wave recording. | |
uint8_t | BSP_AUDIO_IN_InitEx (uint32_t InputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr) |
Initializes wave recording. | |
void | BSP_AUDIO_IN_DeInit (void) |
DeInitializes the audio peripheral. | |
uint8_t | BSP_AUDIO_IN_ConfigMicDefault (uint32_t InputDevice) |
Initializes default configuration of the Digital Filter for Sigma-Delta Modulators interface (DFSDM). | |
__weak uint8_t | BSP_AUDIO_IN_ConfigDigitalMic (uint32_t InputDevice, void *Params) |
Initializes the Digital Filter for Sigma-Delta Modulators interface (DFSDM). | |
uint8_t | BSP_AUDIO_IN_AllocScratch (int32_t *pScratch, uint32_t size) |
Allocate channel buffer scratch. | |
uint8_t | BSP_AUDIO_IN_Record (uint16_t *pBuf, uint32_t size) |
Starts audio recording. | |
uint8_t | BSP_AUDIO_IN_RecordEx (uint32_t *pBuf, uint32_t size) |
Starts audio recording. | |
__weak void | BSP_AUDIO_IN_MspInit (void *Params) |
Initializes BSP_AUDIO_IN MSP. | |
__weak void | BSP_AUDIO_IN_MspDeInit (void *Params) |
De-Initializes BSP_AUDIO_IN MSP. | |
__weak uint8_t | BSP_AUDIO_IN_ClockConfig (uint32_t AudioFreq, void *Params) |
Clock Config. | |
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_I2S_RxHalfCpltCallback (I2S_HandleTypeDef *hi2s) |
Half reception complete callback. | |
void | HAL_I2S_RxCpltCallback (I2S_HandleTypeDef *hi2s) |
Reception complete callback. | |
uint8_t | BSP_AUDIO_IN_Stop (void) |
Stops audio recording. | |
uint8_t | BSP_AUDIO_IN_StopEx (uint32_t InputDevice) |
Stops audio recording. | |
uint8_t | BSP_AUDIO_IN_Pause (void) |
Pauses the audio file stream. | |
uint8_t | BSP_AUDIO_IN_PauseEx (uint32_t InputDevice) |
Pauses the audio file stream. | |
uint8_t | BSP_AUDIO_IN_Resume (void) |
Resumes the audio file stream. | |
uint8_t | BSP_AUDIO_IN_ResumeEx (uint32_t *pBuf, uint32_t InputDevice) |
Resumes the audio file stream. | |
uint8_t | BSP_AUDIO_IN_SetVolume (uint8_t Volume) |
Controls the audio in volume level. | |
__weak void | BSP_AUDIO_IN_TransferComplete_CallBack (void) |
User callback when record buffer is filled. | |
__weak void | BSP_AUDIO_IN_HalfTransfer_CallBack (void) |
Manages the DMA Half Transfer complete event. | |
__weak void | BSP_AUDIO_IN_TransferComplete_CallBackEx (uint32_t InputDevice) |
User callback when record buffer is filled. | |
__weak void | BSP_AUDIO_IN_HalfTransfer_CallBackEx (uint32_t InputDevice) |
User callback when record buffer is filled. | |
__weak void | BSP_AUDIO_IN_Error_Callback (void) |
Audio IN Error callback function. |
Function Documentation
uint8_t BSP_AUDIO_IN_AllocScratch | ( | int32_t * | pScratch, |
uint32_t | size | ||
) |
Allocate channel buffer scratch.
- Parameters:
-
pScratch : pointer to scratch tables. size,: size of scratch buffer
Definition at line 1052 of file stm32f413h_discovery_audio.c.
__weak uint8_t BSP_AUDIO_IN_ClockConfig | ( | uint32_t | AudioFreq, |
void * | Params | ||
) |
Clock Config.
- Parameters:
-
AudioFreq,: Audio frequency used to play the audio stream. Params : pointer on additional configuration parameters, can be NULL.
- 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:
-
AUDIO_OK if correct communication, else wrong communication
Definition at line 1333 of file stm32f413h_discovery_audio.c.
__weak uint8_t BSP_AUDIO_IN_ConfigDigitalMic | ( | uint32_t | InputDevice, |
void * | Params | ||
) |
Initializes the Digital Filter for Sigma-Delta Modulators interface (DFSDM).
- Parameters:
-
InputDevice,: The microphone to be configured. Can be INPUT_DEVICE_DIGITAL_MIC1..INPUT_DEVICE_DIGITAL_MIC5 Params : pointer on additional configuration parameters, can be NULL.
- Return values:
-
AUDIO_OK if correct communication, else wrong communication
Definition at line 1036 of file stm32f413h_discovery_audio.c.
uint8_t BSP_AUDIO_IN_ConfigMicDefault | ( | uint32_t | InputDevice ) |
Initializes default configuration of the Digital Filter for Sigma-Delta Modulators interface (DFSDM).
- Parameters:
-
InputDevice,: The microphone to be configured. Can be INPUT_DEVICE_DIGITAL_MIC1..INPUT_DEVICE_DIGITAL_MIC5
- Note:
- Channel output Clock Divider and Filter Oversampling are calculated as follow:
- Clock_Divider = CLK(input DFSDM)/CLK(micro) with 1MHZ < CLK(micro) < 3.2MHZ (TYP 2.4MHZ for MP34DT01TR)
- Oversampling = CLK(input DFSDM)/(Clock_Divider * AudioFreq)
- Return values:
-
AUDIO_OK if correct communication, else wrong communication
Definition at line 920 of file stm32f413h_discovery_audio.c.
void BSP_AUDIO_IN_DeInit | ( | void | ) |
DeInitializes the audio peripheral.
Definition at line 896 of file stm32f413h_discovery_audio.c.
__weak void BSP_AUDIO_IN_Error_Callback | ( | void | ) |
Audio IN Error callback function.
Definition at line 1797 of file stm32f413h_discovery_audio.c.
__weak void BSP_AUDIO_IN_HalfTransfer_CallBack | ( | void | ) |
Manages the DMA Half Transfer complete event.
Definition at line 1765 of file stm32f413h_discovery_audio.c.
__weak void BSP_AUDIO_IN_HalfTransfer_CallBackEx | ( | uint32_t | InputDevice ) |
User callback when record buffer is filled.
- Parameters:
-
InputDevice,: INPUT_DEVICE_DIGITAL_MIC1 .. INPUT_DEVICE_DIGITAL_MIC5.
Definition at line 1787 of file stm32f413h_discovery_audio.c.
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 for the audio in peripheral. BitRes,: Audio bit resolution. ChnlNbr,: Audio channel number.
- Return values:
-
AUDIO_OK if correct communication, else wrong communication
Definition at line 783 of file stm32f413h_discovery_audio.c.
uint8_t BSP_AUDIO_IN_InitEx | ( | uint32_t | InputDevice, |
uint32_t | AudioFreq, | ||
uint32_t | BitRes, | ||
uint32_t | ChnlNbr | ||
) |
Initializes wave recording.
- Parameters:
-
InputDevice,: INPUT_DEVICE_DIGITAL_MICx or INPUT_DEVICE_ANALOG_MIC. AudioFreq,: Audio frequency to be configured for the audio in peripheral. BitRes,: Audio bit resolution. ChnlNbr,: Audio channel number.
- Return values:
-
AUDIO_OK if correct communication, else wrong communication
Definition at line 796 of file stm32f413h_discovery_audio.c.
__weak void BSP_AUDIO_IN_MspDeInit | ( | void * | Params ) |
De-Initializes BSP_AUDIO_IN MSP.
- Parameters:
-
Params : pointer on additional configuration parameters, can be NULL.
Definition at line 1306 of file stm32f413h_discovery_audio.c.
__weak void BSP_AUDIO_IN_MspInit | ( | void * | Params ) |
Initializes BSP_AUDIO_IN MSP.
- Parameters:
-
Params : pointer on additional configuration parameters, can be NULL.
Definition at line 1283 of file stm32f413h_discovery_audio.c.
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 1638 of file stm32f413h_discovery_audio.c.
uint8_t BSP_AUDIO_IN_PauseEx | ( | uint32_t | InputDevice ) |
Pauses the audio file stream.
- Parameters:
-
InputDevice,: Microphone to be paused. Can be INPUT_DEVICE_DIGITAL_MIC1 .. INPUT_DEVICE_DIGITAL_MIC5.
- Return values:
-
AUDIO_OK if correct communication, else wrong communication
Definition at line 1667 of file stm32f413h_discovery_audio.c.
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
- Return values:
-
AUDIO_OK if correct communication, else wrong communication
Definition at line 1073 of file stm32f413h_discovery_audio.c.
uint8_t BSP_AUDIO_IN_RecordEx | ( | uint32_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
- Return values:
-
AUDIO_OK if correct communication, else wrong communication
Definition at line 1113 of file stm32f413h_discovery_audio.c.
uint8_t BSP_AUDIO_IN_Resume | ( | void | ) |
Resumes the audio file stream.
- Return values:
-
AUDIO_OK if correct communication, else wrong communication
Definition at line 1689 of file stm32f413h_discovery_audio.c.
uint8_t BSP_AUDIO_IN_ResumeEx | ( | uint32_t * | pBuf, |
uint32_t | InputDevice | ||
) |
Resumes the audio file stream.
- Parameters:
-
pBuf,: Main buffer pointer for the recorded data storing InputDevice,: Microphone to be paused. Can be INPUT_DEVICE_DIGITAL_MIC1 .. INPUT_DEVICE_DIGITAL_MIC5.
- Return values:
-
AUDIO_OK if correct communication, else wrong communication
Definition at line 1719 of file stm32f413h_discovery_audio.c.
uint8_t BSP_AUDIO_IN_SetVolume | ( | uint8_t | Volume ) |
Controls the audio in 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 1743 of file stm32f413h_discovery_audio.c.
uint8_t BSP_AUDIO_IN_Stop | ( | void | ) |
Stops audio recording.
- Return values:
-
AUDIO_OK if correct communication, else wrong communication
Definition at line 1575 of file stm32f413h_discovery_audio.c.
uint8_t BSP_AUDIO_IN_StopEx | ( | uint32_t | InputDevice ) |
Stops audio recording.
- Parameters:
-
InputDevice,: Microphone to be stopped. Can be INPUT_DEVICE_DIGITAL_MIC1 .. INPUT_DEVICE_DIGITAL_MIC5.
- Return values:
-
AUDIO_OK if correct communication, else wrong communication
Definition at line 1619 of file stm32f413h_discovery_audio.c.
__weak void BSP_AUDIO_IN_TransferComplete_CallBack | ( | void | ) |
User callback when record buffer is filled.
Definition at line 1755 of file stm32f413h_discovery_audio.c.
__weak void BSP_AUDIO_IN_TransferComplete_CallBackEx | ( | uint32_t | InputDevice ) |
User callback when record buffer is filled.
- Parameters:
-
InputDevice,: INPUT_DEVICE_DIGITAL_MIC1 .. INPUT_DEVICE_DIGITAL_MIC5.
Definition at line 1776 of file stm32f413h_discovery_audio.c.
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.
Definition at line 1405 of file stm32f413h_discovery_audio.c.
void HAL_DFSDM_FilterRegConvHalfCpltCallback | ( | DFSDM_Filter_HandleTypeDef * | hdfsdm_filter ) |
Half regular conversion complete callback.
- Parameters:
-
hdfsdm_filter : DFSDM filter handle.
Definition at line 1479 of file stm32f413h_discovery_audio.c.
void HAL_I2S_RxCpltCallback | ( | I2S_HandleTypeDef * | hi2s ) |
Reception complete callback.
- Parameters:
-
hi2s : I2S handle.
Definition at line 1565 of file stm32f413h_discovery_audio.c.
void HAL_I2S_RxHalfCpltCallback | ( | I2S_HandleTypeDef * | hi2s ) |
Half reception complete callback.
- Parameters:
-
hi2s : I2S handle.
Definition at line 1554 of file stm32f413h_discovery_audio.c.
Generated on Thu Jul 14 2022 12:00:03 by 1.7.2