Functions
STM32F4 DISCOVERY AUDIO IN Private Functions
Collaboration diagram for STM32F4 DISCOVERY AUDIO IN Private Functions:

Functions

__weak void BSP_AUDIO_IN_ClockConfig (I2S_HandleTypeDef *hi2s, uint32_t AudioFreq, void *Params)
 Audio In Clock Config. More...
 
__weak void BSP_AUDIO_IN_Error_Callback (void)
 Audio IN Error callback function. More...
 
__weak void BSP_AUDIO_IN_HalfTransfer_CallBack (void)
 Manages the DMA Half Transfer complete event. More...
 
uint8_t BSP_AUDIO_IN_Init (uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
 Initializes wave recording. More...
 
__weak void BSP_AUDIO_IN_MspDeInit (I2S_HandleTypeDef *hi2s, void *Params)
 DeInitializes BSP_AUDIO_IN MSP. More...
 
__weak void BSP_AUDIO_IN_MspInit (I2S_HandleTypeDef *hi2s, void *Params)
 BSP AUDIO IN MSP Init. More...
 
uint8_t BSP_AUDIO_IN_Pause (void)
 Pauses the audio file stream. More...
 
uint8_t BSP_AUDIO_IN_PDMToPCM (uint16_t *PDMBuf, uint16_t *PCMBuf)
 Converts audio format from PDM to PCM. More...
 
uint8_t BSP_AUDIO_IN_Record (uint16_t *pbuf, uint32_t size)
 Starts audio recording. More...
 
uint8_t BSP_AUDIO_IN_Resume (void)
 Resumes the audio file stream.
More...
 
uint8_t BSP_AUDIO_IN_SetVolume (uint8_t Volume)
 Controls the audio in volume level. More...
 
uint8_t BSP_AUDIO_IN_Stop (void)
 Stops audio recording. More...
 
__weak void BSP_AUDIO_IN_TransferComplete_CallBack (void)
 User callback when record buffer is filled. More...
 
void HAL_I2S_RxCpltCallback (I2S_HandleTypeDef *hi2s)
 Rx Transfer completed callbacks. More...
 
void HAL_I2S_RxHalfCpltCallback (I2S_HandleTypeDef *hi2s)
 Rx Half Transfer completed callbacks. More...
 
static uint8_t I2S2_Init (uint32_t AudioFreq)
 Initializes the Audio Codec audio interface (I2S) More...
 
static void PDMDecoder_Init (uint32_t AudioFreq, uint32_t ChnlNbrIn, uint32_t ChnlNbrOut)
 Initializes the PDM library. More...
 

Detailed Description

Function Documentation

◆ BSP_AUDIO_IN_ClockConfig()

__weak void BSP_AUDIO_IN_ClockConfig ( I2S_HandleTypeDef hi2s,
uint32_t  AudioFreq,
void *  Params 
)

Audio In Clock Config.

Parameters
hi2sI2S handle
AudioFreqAudio frequency used to record the audio stream.
Params: pointer on additional configuration parameters, can be NULL.
Note
This API is called by BSP_AUDIO_IN_Init() Being __weak it can be overwritten by the application

Definition at line 869 of file stm32f4_discovery_audio.c.

◆ BSP_AUDIO_IN_Error_Callback()

__weak void BSP_AUDIO_IN_Error_Callback ( void  )

Audio IN Error callback function.

Definition at line 1021 of file stm32f4_discovery_audio.c.

◆ BSP_AUDIO_IN_HalfTransfer_CallBack()

__weak void BSP_AUDIO_IN_HalfTransfer_CallBack ( void  )

Manages the DMA Half Transfer complete event.

Definition at line 1011 of file stm32f4_discovery_audio.c.

◆ BSP_AUDIO_IN_Init()

uint8_t BSP_AUDIO_IN_Init ( uint32_t  AudioFreq,
uint32_t  BitRes,
uint32_t  ChnlNbr 
)

Initializes wave recording.

Parameters
AudioFreqAudio frequency to be configured for the I2S peripheral.
BitResAudio frequency to be configured for the I2S peripheral.
ChnlNbrAudio frequency to be configured for the I2S peripheral.
Return values
AUDIO_OKif correct communication, else wrong communication

Definition at line 705 of file stm32f4_discovery_audio.c.

◆ BSP_AUDIO_IN_MspDeInit()

__weak void BSP_AUDIO_IN_MspDeInit ( I2S_HandleTypeDef hi2s,
void *  Params 
)

DeInitializes BSP_AUDIO_IN MSP.

Parameters
hi2sI2S handle
Params: pointer on additional configuration parameters, can be NULL.

Definition at line 969 of file stm32f4_discovery_audio.c.

◆ BSP_AUDIO_IN_MspInit()

__weak void BSP_AUDIO_IN_MspInit ( I2S_HandleTypeDef hi2s,
void *  Params 
)

BSP AUDIO IN MSP Init.

Parameters
hi2sI2S handle
Params: pointer on additional configuration parameters, can be NULL.

Definition at line 903 of file stm32f4_discovery_audio.c.

◆ BSP_AUDIO_IN_Pause()

uint8_t BSP_AUDIO_IN_Pause ( void  )

Pauses the audio file stream.

Return values
AUDIO_OKif correct communication, else wrong communication

Definition at line 771 of file stm32f4_discovery_audio.c.

◆ BSP_AUDIO_IN_PDMToPCM()

uint8_t BSP_AUDIO_IN_PDMToPCM ( uint16_t *  PDMBuf,
uint16_t *  PCMBuf 
)

Converts audio format from PDM to PCM.

Parameters
PDMBufPointer to data PDM buffer
PCMBufPointer to data PCM buffer
Return values
AUDIO_OKif correct communication, else wrong communication

Definition at line 814 of file stm32f4_discovery_audio.c.

◆ BSP_AUDIO_IN_Record()

uint8_t BSP_AUDIO_IN_Record ( uint16_t *  pbuf,
uint32_t  size 
)

Starts audio recording.

Parameters
pbufMain buffer pointer for the recorded data storing
sizeCurrent size of the recorded buffer
Return values
AUDIO_OKif correct communication, else wrong communication

Definition at line 737 of file stm32f4_discovery_audio.c.

◆ BSP_AUDIO_IN_Resume()

uint8_t BSP_AUDIO_IN_Resume ( void  )

Resumes the audio file stream.

Return values
AUDIO_OKif correct communication, else wrong communication

Definition at line 784 of file stm32f4_discovery_audio.c.

◆ BSP_AUDIO_IN_SetVolume()

uint8_t BSP_AUDIO_IN_SetVolume ( uint8_t  Volume)

Controls the audio in 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 799 of file stm32f4_discovery_audio.c.

◆ BSP_AUDIO_IN_Stop()

uint8_t BSP_AUDIO_IN_Stop ( void  )

Stops audio recording.

Return values
AUDIO_OKif correct communication, else wrong communication

Definition at line 754 of file stm32f4_discovery_audio.c.

◆ BSP_AUDIO_IN_TransferComplete_CallBack()

__weak void BSP_AUDIO_IN_TransferComplete_CallBack ( void  )

User callback when record buffer is filled.

Definition at line 1001 of file stm32f4_discovery_audio.c.

◆ HAL_I2S_RxCpltCallback()

void HAL_I2S_RxCpltCallback ( I2S_HandleTypeDef hi2s)

Rx Transfer completed callbacks.

Parameters
hi2sI2S handle

Definition at line 844 of file stm32f4_discovery_audio.c.

◆ HAL_I2S_RxHalfCpltCallback()

void HAL_I2S_RxHalfCpltCallback ( I2S_HandleTypeDef hi2s)

Rx Half Transfer completed callbacks.

Parameters
hi2sI2S handle

Definition at line 854 of file stm32f4_discovery_audio.c.

◆ I2S2_Init()

static uint8_t I2S2_Init ( uint32_t  AudioFreq)
static

Initializes the Audio Codec audio interface (I2S)

Note
This function assumes that the I2S input clock (through PLL_R in Devices RevA/Z and through dedicated PLLI2S_R in Devices RevB/Y) is already configured and ready to be used.
Parameters
AudioFreqAudio frequency to be configured for the I2S peripheral.

Definition at line 1070 of file stm32f4_discovery_audio.c.

◆ PDMDecoder_Init()

static void PDMDecoder_Init ( uint32_t  AudioFreq,
uint32_t  ChnlNbrIn,
uint32_t  ChnlNbrOut 
)
static

Initializes the PDM library.

Parameters
AudioFreqAudio sampling frequency
ChnlNbrInNumber of input audio channels in the PDM buffer
ChnlNbrOutNumber of desired output audio channels in the resulting PCM buffer Number of audio channels (1: mono; 2: stereo)

Definition at line 1038 of file stm32f4_discovery_audio.c.



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