Functions
AUDIO_IN Exported Functions
Collaboration diagram for AUDIO_IN Exported Functions:

Functions

int32_t BSP_AUDIO_IN_DeInit (uint32_t Instance)
 Deinit the audio IN peripherals. More...
 
__weak void BSP_AUDIO_IN_Error_CallBack (uint32_t Instance)
 Audio IN Error callback function. More...
 
int32_t BSP_AUDIO_IN_GetBitsPerSample (uint32_t Instance, uint32_t *BitsPerSample)
 Get Audio In Resolution. More...
 
int32_t BSP_AUDIO_IN_GetChannelsNbr (uint32_t Instance, uint32_t *ChannelNbr)
 Get Audio In Channel number. More...
 
int32_t BSP_AUDIO_IN_GetDevice (uint32_t Instance, uint32_t *Device)
 Get Audio In device. More...
 
int32_t BSP_AUDIO_IN_GetSampleRate (uint32_t Instance, uint32_t *SampleRate)
 Get Audio In frequency. More...
 
int32_t BSP_AUDIO_IN_GetState (uint32_t Instance, uint32_t *State)
 Get Audio In device. More...
 
int32_t BSP_AUDIO_IN_GetVolume (uint32_t Instance, uint32_t *Volume)
 Get the current audio in volume level. More...
 
__weak void BSP_AUDIO_IN_HalfTransfer_CallBack (uint32_t Instance)
 Manages the DMA Half Transfer complete event. More...
 
int32_t BSP_AUDIO_IN_Init (uint32_t Instance, BSP_AUDIO_Init_t *AudioInit)
 Initialize wave recording. More...
 
void BSP_AUDIO_IN_IRQHandler (uint32_t Instance, uint32_t InputDevice)
 This function handles Audio Out DMA interrupt requests. More...
 
int32_t BSP_AUDIO_IN_Pause (uint32_t Instance)
 Pause the audio file stream. More...
 
int32_t BSP_AUDIO_IN_PDMToPCM (uint32_t Instance, uint16_t *PDMBuf, uint16_t *PCMBuf)
 Converts audio format from PDM to PCM. More...
 
int32_t BSP_AUDIO_IN_PDMToPCM_Init (uint32_t Instance, uint32_t AudioFreq, uint32_t ChnlNbrIn, uint32_t ChnlNbrOut)
 Initialize the PDM library. More...
 
int32_t BSP_AUDIO_IN_Record (uint32_t Instance, uint8_t *pBuf, uint32_t NbrOfBytes)
 Start audio recording. More...
 
int32_t BSP_AUDIO_IN_RecordPDM (uint32_t Instance, uint8_t *pBuf, uint32_t NbrOfBytes)
 Start audio recording. More...
 
int32_t BSP_AUDIO_IN_Resume (uint32_t Instance)
 Resume the audio file stream. More...
 
int32_t BSP_AUDIO_IN_SetBitsPerSample (uint32_t Instance, uint32_t BitsPerSample)
 Set Audio In Resolution. More...
 
int32_t BSP_AUDIO_IN_SetChannelsNbr (uint32_t Instance, uint32_t ChannelNbr)
 Set Audio In Channel number. More...
 
int32_t BSP_AUDIO_IN_SetDevice (uint32_t Instance, uint32_t Device)
 Set Audio In device. More...
 
int32_t BSP_AUDIO_IN_SetSampleRate (uint32_t Instance, uint32_t SampleRate)
 Set Audio In frequency. More...
 
int32_t BSP_AUDIO_IN_SetVolume (uint32_t Instance, uint32_t Volume)
 Set the current audio in volume level. More...
 
int32_t BSP_AUDIO_IN_Stop (uint32_t Instance)
 Stop audio recording. More...
 
__weak void BSP_AUDIO_IN_TransferComplete_CallBack (uint32_t Instance)
 User callback when record buffer is filled. More...
 
void HAL_SAI_RxCpltCallback (SAI_HandleTypeDef *hsai)
 Reception complete callback. More...
 
void HAL_SAI_RxHalfCpltCallback (SAI_HandleTypeDef *hsai)
 Half reception complete callback. More...
 
__weak HAL_StatusTypeDef MX_SAI1_Block_B_Init (SAI_HandleTypeDef *hsai, MX_SAI_Config_t *MXConfig)
 Initializes the Audio Codec audio in instance (SAI). More...
 
__weak HAL_StatusTypeDef MX_SAI4_Block_A_Init (SAI_HandleTypeDef *hsai, MX_SAI_Config_t *MXConfig)
 Initializes the Audio Codec audio in instance (SAI). More...
 

Detailed Description

Function Documentation

◆ BSP_AUDIO_IN_DeInit()

int32_t BSP_AUDIO_IN_DeInit ( uint32_t  Instance)

Deinit the audio IN peripherals.

Parameters
InstanceAUDIO IN Instance. It can be 0 when SAI is used or 1 if PDM is used
Return values
BSPstatus

Definition at line 1574 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_IN_Error_CallBack()

void BSP_AUDIO_IN_Error_CallBack ( uint32_t  Instance)

Audio IN Error callback function.

Return values
None

Definition at line 2487 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_IN_GetBitsPerSample()

int32_t BSP_AUDIO_IN_GetBitsPerSample ( uint32_t  Instance,
uint32_t *  BitsPerSample 
)

Get Audio In Resolution.

Parameters
InstanceAUDIO IN Instance. It can be 0 when SAI is used
BitsPerSampleInput resolution to be returned
Return values
BSPstatus

Definition at line 2269 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_IN_GetChannelsNbr()

int32_t BSP_AUDIO_IN_GetChannelsNbr ( uint32_t  Instance,
uint32_t *  ChannelNbr 
)

Get Audio In Channel number.

Parameters
InstanceAUDIO IN Instance. It can be 0 when SAI is used
ChannelNbrChannel number to be used
Return values
BSPstatus

Definition at line 2314 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_IN_GetDevice()

int32_t BSP_AUDIO_IN_GetDevice ( uint32_t  Instance,
uint32_t *  Device 
)

Get Audio In device.

Parameters
InstanceAUDIO IN Instance. It can be 0 when SAI is used or 1
DeviceThe audio input device used
Return values
BSPstatus

Definition at line 2148 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_IN_GetSampleRate()

int32_t BSP_AUDIO_IN_GetSampleRate ( uint32_t  Instance,
uint32_t *  SampleRate 
)

Get Audio In frequency.

Parameters
InstanceAUDIO IN Instance. It can be 0 when SAI is used
SampleRateAudio Input frequency to be returned
Return values
BSPstatus

Definition at line 2207 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_IN_GetState()

int32_t BSP_AUDIO_IN_GetState ( uint32_t  Instance,
uint32_t *  State 
)

Get Audio In device.

Parameters
InstanceAUDIO IN Instance. It can be 0 when SAI is used
StateAudio Out state
Return values
BSPstatus

Definition at line 2385 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_IN_GetVolume()

int32_t BSP_AUDIO_IN_GetVolume ( uint32_t  Instance,
uint32_t *  Volume 
)

Get the current audio in volume level.

Parameters
InstanceAUDIO IN Instance. It can be 0 when SAI is used
VolumeVolume level to be returnd
Return values
BSPstatus

Definition at line 2363 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_IN_HalfTransfer_CallBack()

void BSP_AUDIO_IN_HalfTransfer_CallBack ( uint32_t  Instance)

Manages the DMA Half Transfer complete event.

Return values
None

Definition at line 2473 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_IN_Init()

int32_t BSP_AUDIO_IN_Init ( uint32_t  Instance,
BSP_AUDIO_Init_t AudioInit 
)

Initialize wave recording.

Parameters
InstanceAUDIO IN Instance. It can be:
  • 0 when SAI is used
  • 1 if SAI PDM is used
AudioInitInit structure
Return values
BSPstatus

Definition at line 1374 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_IN_IRQHandler()

void BSP_AUDIO_IN_IRQHandler ( uint32_t  Instance,
uint32_t  InputDevice 
)

This function handles Audio Out DMA interrupt requests.

Parameters
InstanceAudio IN instance: 0 for SAI, 1 for SAI PDM
InputDeviceCan be:
  • AUDIO_IN_DEVICE_ANALOG_MIC
  • AUDIO_IN_DEVICE_DIGITAL_MIC
Return values
None

Definition at line 2409 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_IN_Pause()

int32_t BSP_AUDIO_IN_Pause ( uint32_t  Instance)

Pause the audio file stream.

Parameters
InstanceAUDIO IN Instance. It can be 0 when SAI is used
Return values
BSPstatus

Definition at line 2001 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_IN_PDMToPCM()

int32_t BSP_AUDIO_IN_PDMToPCM ( uint32_t  Instance,
uint16_t *  PDMBuf,
uint16_t *  PCMBuf 
)

Converts audio format from PDM to PCM.

Parameters
InstanceAUDIO IN Instance
PDMBufPointer to PDM buffer data
PCMBufPointer to PCM buffer data
Return values
BSPstatus

Definition at line 1908 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_IN_PDMToPCM_Init()

int32_t BSP_AUDIO_IN_PDMToPCM_Init ( uint32_t  Instance,
uint32_t  AudioFreq,
uint32_t  ChnlNbrIn,
uint32_t  ChnlNbrOut 
)

Initialize the PDM library.

Parameters
InstanceAUDIO IN Instance
AudioFreqAudio sampling frequency
ChnlNbrInNumber of input audio channels in the PDM buffer
ChnlNbrOutNumber of desired output audio channels in the resulting PCM buffer
Return values
BSPstatus

Definition at line 1866 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_IN_Record()

int32_t BSP_AUDIO_IN_Record ( uint32_t  Instance,
uint8_t *  pBuf,
uint32_t  NbrOfBytes 
)

Start audio recording.

Parameters
InstanceAUDIO IN Instance. It can be 0 when SAI is used
pBufMain buffer pointer for the recorded data storing
NbrOfBytesSize of the record buffer
Return values
BSPstatus

Definition at line 1934 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_IN_RecordPDM()

int32_t BSP_AUDIO_IN_RecordPDM ( uint32_t  Instance,
uint8_t *  pBuf,
uint32_t  NbrOfBytes 
)

Start audio recording.

Parameters
InstanceAUDIO IN SAI PDM Instance. It can be only 2
pBufMain buffer pointer for the recorded data storing
NbrOfBytesSize of the record buffer
Return values
BSPstatus

Definition at line 2082 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_IN_Resume()

int32_t BSP_AUDIO_IN_Resume ( uint32_t  Instance)

Resume the audio file stream.

Parameters
InstanceAUDIO IN Instance. It can be 0 when SAI is used
Return values
BSPstatus

Definition at line 2040 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_IN_SetBitsPerSample()

int32_t BSP_AUDIO_IN_SetBitsPerSample ( uint32_t  Instance,
uint32_t  BitsPerSample 
)

Set Audio In Resolution.

Parameters
InstanceAUDIO IN Instance. It can be 0 when SAI is used
BitsPerSampleInput resolution to be set
Return values
BSPstatus

Definition at line 2231 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_IN_SetChannelsNbr()

int32_t BSP_AUDIO_IN_SetChannelsNbr ( uint32_t  Instance,
uint32_t  ChannelNbr 
)

Set Audio In Channel number.

Parameters
InstanceAUDIO IN Instance. It can be 0 when SAI is used
ChannelNbrChannel number to be used
Return values
BSPstatus

Definition at line 2291 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_IN_SetDevice()

int32_t BSP_AUDIO_IN_SetDevice ( uint32_t  Instance,
uint32_t  Device 
)

Set Audio In device.

Parameters
InstanceAUDIO IN Instance. It can be 0 when SAI is used
DeviceThe audio input device to be used
Return values
BSPstatus

Definition at line 2110 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_IN_SetSampleRate()

int32_t BSP_AUDIO_IN_SetSampleRate ( uint32_t  Instance,
uint32_t  SampleRate 
)

Set Audio In frequency.

Parameters
InstanceAudio IN instance
SampleRateInput frequency to be set
Return values
BSPstatus

Definition at line 2170 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_IN_SetVolume()

int32_t BSP_AUDIO_IN_SetVolume ( uint32_t  Instance,
uint32_t  Volume 
)

Set the current audio in volume level.

Parameters
InstanceAUDIO IN Instance. It can be 0 when SAI is used
VolumeVolume level to be returnd
Return values
BSPstatus

Definition at line 2336 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_IN_Stop()

int32_t BSP_AUDIO_IN_Stop ( uint32_t  Instance)

Stop audio recording.

Parameters
InstanceAUDIO IN Instance. It can be 0 when SAI is used
Return values
BSPstatus

Definition at line 1959 of file stm32h747i_discovery_audio.c.

◆ BSP_AUDIO_IN_TransferComplete_CallBack()

void BSP_AUDIO_IN_TransferComplete_CallBack ( uint32_t  Instance)

User callback when record buffer is filled.

Return values
None

Definition at line 2459 of file stm32h747i_discovery_audio.c.

◆ HAL_SAI_RxCpltCallback()

void HAL_SAI_RxCpltCallback ( SAI_HandleTypeDef hsai)

Reception complete callback.

Parameters
hsaiSAI handle.
Return values
None

Definition at line 2441 of file stm32h747i_discovery_audio.c.

◆ HAL_SAI_RxHalfCpltCallback()

void HAL_SAI_RxHalfCpltCallback ( SAI_HandleTypeDef hsai)

Half reception complete callback.

Parameters
hsaiSAI handle.
Return values
None

Definition at line 2423 of file stm32h747i_discovery_audio.c.

◆ MX_SAI1_Block_B_Init()

HAL_StatusTypeDef MX_SAI1_Block_B_Init ( SAI_HandleTypeDef hsai,
MX_SAI_Config_t MXConfig 
)

Initializes the Audio Codec audio in instance (SAI).

Parameters
hsaiSAI handle
MXConfigSAI configuration structure
Note
Being __weak it can be overwritten by the application
Return values
HALstatus

Definition at line 1652 of file stm32h747i_discovery_audio.c.

◆ MX_SAI4_Block_A_Init()

HAL_StatusTypeDef MX_SAI4_Block_A_Init ( SAI_HandleTypeDef hsai,
MX_SAI_Config_t MXConfig 
)

Initializes the Audio Codec audio in instance (SAI).

Parameters
hsaiSAI handle
MXConfigSAI configuration structure
Note
Being __weak it can be overwritten by the application
Return values
HALstatus

Definition at line 1708 of file stm32h747i_discovery_audio.c.



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