STM32F723E-Discovery BSP User Manual: STM32F723E_DISCOVERY_AUDIO_IN Exported Functions

STM32F723E-Discovery BSP

STM32F723E-Discovery BSP User Manual
STM32F723E_DISCOVERY_AUDIO_IN Exported Functions

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 (uint16_t InputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
 Initializes wave recording.
uint8_t BSP_AUDIO_IN_OUT_Init (uint16_t InputDevice, uint16_t OutputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
 Initializes wave recording and playback in parallel.
void BSP_AUDIO_IN_DeInit (void)
 Deinit the audio IN peripherals.
uint8_t BSP_AUDIO_IN_Record (uint16_t *pData, uint32_t Size)
 Starts audio recording.
uint8_t BSP_AUDIO_IN_Stop (uint32_t Option)
 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.
uint8_t BSP_AUDIO_IN_SetVolume (uint8_t Volume)
 Controls the audio in volume level.
void BSP_AUDIO_IN_TransferComplete_CallBack (void)
 User callback when record buffer is filled.
void BSP_AUDIO_IN_HalfTransfer_CallBack (void)
 Manages the DMA Half Transfer complete event.
void BSP_AUDIO_IN_Error_CallBack (void)
 Audio IN Error callback function.
void BSP_AUDIO_IN_ClockConfig (SAI_HandleTypeDef *hsai, uint32_t AudioFreq, void *Params)
 Clock Config.
void BSP_AUDIO_IN_MspInit (SAI_HandleTypeDef *hsai, void *Params)
 Initializes BSP_AUDIO_IN MSP.
void BSP_AUDIO_IN_MspDeInit (SAI_HandleTypeDef *hsai, void *Params)
 DeInitializes BSP_AUDIO_IN MSP.

Function Documentation

void BSP_AUDIO_IN_ClockConfig ( SAI_HandleTypeDef *  hsai,
uint32_t  AudioFreq,
void *  Params 
)

Clock Config.

Parameters:
hsai,:might be required to set audio peripheral predivider if any.
AudioFreq,:Audio frequency used to play the audio stream.
Params
Note:
This API is called by BSP_AUDIO_IN_Init() Being __weak it can be overwritten by the application
Return values:
None

Definition at line 1256 of file stm32f723e_discovery_audio.c.

Referenced by BSP_AUDIO_IN_InitEx().

void BSP_AUDIO_IN_DeInit ( void  )

Deinit the audio IN peripherals.

Return values:
None

Definition at line 1079 of file stm32f723e_discovery_audio.c.

References BSP_AUDIO_IN_MspDeInit(), haudio_in_sai, and SAIx_In_DeInit().

void BSP_AUDIO_IN_Error_CallBack ( void  )

Audio IN Error callback function.

Return values:
None

Definition at line 1135 of file stm32f723e_discovery_audio.c.

Manages the DMA Half Transfer complete event.

Return values:
None

Definition at line 1124 of file stm32f723e_discovery_audio.c.

Referenced by HAL_SAI_RxHalfCpltCallback().

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 SAI peripheral.
BitRes,:Audio frequency to be configured.
ChnlNbr,:Channel number.
Return values:
AUDIO_OKif correct communication, else wrong communication

Definition at line 796 of file stm32f723e_discovery_audio.c.

References BSP_AUDIO_IN_InitEx().

uint8_t BSP_AUDIO_IN_InitEx ( uint16_t  InputDevice,
uint32_t  AudioFreq,
uint32_t  BitRes,
uint32_t  ChnlNbr 
)

Initializes wave recording.

Parameters:
InputDevice,:INPUT_DEVICE_DIGITAL_MICROPHONE_1, INPUT_DEVICE_DIGITAL_MICROPHONE_2 INPUT_DEVICE_INPUT_LINE_1 or INPUT_DEVICE_DIGITAL_MIC1_MIC2
AudioFreq,:Audio frequency to be configured for the SAI peripheral.
BitRes,:Audio frequency to be configured.
ChnlNbr,:Channel number.
Return values:
AUDIO_OKif correct communication, else wrong communication

Definition at line 810 of file stm32f723e_discovery_audio.c.

References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_IN_SAIx, AUDIO_OK, BSP_AUDIO_IN_ClockConfig(), BSP_AUDIO_IN_MspInit(), BSP_AUDIO_OUT_MspInit(), CODEC_AUDIOFRAME_SLOT_0123, CODEC_AUDIOFRAME_SLOT_02, CODEC_AUDIOFRAME_SLOT_13, haudio_in_sai, SAIx_In_DeInit(), and SAIx_In_Init().

Referenced by BSP_AUDIO_IN_Init().

void BSP_AUDIO_IN_MspDeInit ( SAI_HandleTypeDef *  hsai,
void *  Params 
)

DeInitializes BSP_AUDIO_IN MSP.

Parameters:
hsai,:SAI handle
Params
Return values:
None

Definition at line 1220 of file stm32f723e_discovery_audio.c.

References AUDIO_IN_SAIx, AUDIO_IN_SAIx_CLK_DISABLE, AUDIO_IN_SAIx_DMAx_IRQ, AUDIO_IN_SAIx_SD_GPIO_PORT, AUDIO_IN_SAIx_SD_PIN, and haudio_in_sai.

Referenced by BSP_AUDIO_IN_DeInit().

uint8_t BSP_AUDIO_IN_OUT_Init ( uint16_t  InputDevice,
uint16_t  OutputDevice,
uint32_t  AudioFreq,
uint32_t  BitRes,
uint32_t  ChnlNbr 
)

Initializes wave recording and playback in parallel.

Parameters:
InputDevice,:INPUT_DEVICE_DIGITAL_MICROPHONE_1, INPUT_DEVICE_DIGITAL_MICROPHONE_2 or INPUT_DEVICE_DIGITAL_MIC1_MIC2
OutputDevice,:OUTPUT_DEVICE_SPEAKER, OUTPUT_DEVICE_HEADPHONE, or OUTPUT_DEVICE_BOTH.
AudioFreq,:Audio frequency to be configured for the SAI peripheral.
BitRes,:Audio frequency to be configured.
ChnlNbr,:Channel number.
Return values:
AUDIO_OKif correct communication, else wrong communication

Definition at line 896 of file stm32f723e_discovery_audio.c.

References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_IN_SAIx, AUDIO_OK, AUDIO_OUT_SAIx, BSP_AUDIO_IN_MspInit(), BSP_AUDIO_OUT_ClockConfig(), BSP_AUDIO_OUT_MspInit(), CODEC_AUDIOFRAME_SLOT_0123, CODEC_AUDIOFRAME_SLOT_02, CODEC_AUDIOFRAME_SLOT_13, haudio_in_sai, haudio_out_sai, SAIx_In_DeInit(), SAIx_In_Init(), and SAIx_Out_DeInit().

uint8_t BSP_AUDIO_IN_Pause ( void  )

Pauses the audio file stream.

Return values:
AUDIO_OKif correct communication, else wrong communication

Definition at line 1034 of file stm32f723e_discovery_audio.c.

References AUDIO_OK, and haudio_in_sai.

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,:size of the recorded buffer in number of elements (typically number of half-words) Be careful that it is not the same unit than BSP_AUDIO_OUT_Play function
Return values:
AUDIO_OKif correct communication, else wrong communication

Definition at line 985 of file stm32f723e_discovery_audio.c.

References AUDIO_ERROR, AUDIO_OK, and haudio_in_sai.

uint8_t BSP_AUDIO_IN_Resume ( void  )

Resumes the audio file stream.

Return values:
AUDIO_OKif correct communication, else wrong communication

Definition at line 1046 of file stm32f723e_discovery_audio.c.

References AUDIO_OK, and haudio_in_sai.

uint8_t BSP_AUDIO_IN_SetVolume ( uint8_t  Volume)

Controls the audio in volume level.

Parameters:
Volume,:Volume level in range 0(Mute)..80(+0dB)..100(+17.625dB)
Return values:
AUDIO_OKif correct communication, else wrong communication

Definition at line 1059 of file stm32f723e_discovery_audio.c.

References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, and AudioInVolume.

uint8_t BSP_AUDIO_IN_Stop ( uint32_t  Option)

Stops audio recording.

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_OKif correct communication, else wrong communication

Definition at line 1008 of file stm32f723e_discovery_audio.c.

References audio_drv, AUDIO_ERROR, AUDIO_I2C_ADDRESS, AUDIO_OK, and haudio_in_sai.

User callback when record buffer is filled.

Return values:
None

Definition at line 1113 of file stm32f723e_discovery_audio.c.

Referenced by HAL_SAI_RxCpltCallback().

Generated on Tue May 30 2017 13:59:12 for STM32F723E-Discovery BSP User Manual by   doxygen 1.7.6.1