Go to the documentation of this file.
191 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1U)
199 #if (USE_AUDIO_CODEC_WM8994 == 1)
200 static int32_t WM8994_Probe(
void);
236 #if (USE_AUDIO_CODEC_WM8994 == 1)
256 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1U)
260 if(BSP_AUDIO_OUT_RegisterDefaultMspCallbacks(Instance) !=
BSP_ERROR_NONE)
290 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1U)
292 else if(HAL_SAI_RegisterCallback(&
haudio_out_sai, HAL_SAI_TX_COMPLETE_CB_ID, SAI_TxCpltCallback) !=
HAL_OK)
296 else if(HAL_SAI_RegisterCallback(&
haudio_out_sai, HAL_SAI_TX_HALFCOMPLETE_CB_ID, SAI_TxHalfCpltCallback) !=
HAL_OK)
300 else if(HAL_SAI_RegisterCallback(&
haudio_out_sai, HAL_SAI_ERROR_CB_ID, SAI_ErrorCallback) !=
HAL_OK)
307 #if (USE_AUDIO_CODEC_WM8994 == 1)
353 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 0U)
507 rcc_ex_clk_init_struct.Sai4AClockSelection = RCC_SAI4ACLKSOURCE_PLL2;
524 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1U)
525 int32_t BSP_AUDIO_OUT_RegisterDefaultMspCallbacks (uint32_t Instance)
562 int32_t BSP_AUDIO_OUT_RegisterMspCallbacks (uint32_t Instance, BSP_AUDIO_OUT_Cb_t *CallBacks)
575 if(HAL_SAI_RegisterCallback(&
haudio_out_sai, HAL_SAI_MSPINIT_CB_ID, CallBacks->pMspSaiInitCb) !=
HAL_OK)
579 else if(HAL_SAI_RegisterCallback(&
haudio_out_sai, HAL_SAI_MSPDEINIT_CB_ID,CallBacks->pMspSaiDeInitCb) !=
HAL_OK)
789 else if(Volume == 0U)
1010 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1)
1012 if(HAL_SAI_RegisterCallback(&
haudio_out_sai, HAL_SAI_TX_COMPLETE_CB_ID, SAI_TxCpltCallback) !=
HAL_OK)
1016 if(HAL_SAI_RegisterCallback(&
haudio_out_sai, HAL_SAI_TX_HALFCOMPLETE_CB_ID, SAI_TxHalfCpltCallback) !=
HAL_OK)
1020 if(HAL_SAI_RegisterCallback(&
haudio_out_sai, HAL_SAI_ERROR_CB_ID, SAI_ErrorCallback) !=
HAL_OK)
1105 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1)
1117 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1)
1119 else if (HAL_SAI_RegisterCallback(&
haudio_out_sai, HAL_SAI_TX_COMPLETE_CB_ID, SAI_TxCpltCallback) !=
HAL_OK)
1123 else if (HAL_SAI_RegisterCallback(&
haudio_out_sai, HAL_SAI_TX_HALFCOMPLETE_CB_ID, SAI_TxHalfCpltCallback) !=
HAL_OK)
1129 if (HAL_SAI_RegisterCallback(&
haudio_out_sai, HAL_SAI_ERROR_CB_ID, SAI_ErrorCallback) !=
HAL_OK)
1194 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1)
1196 else if(HAL_SAI_RegisterCallback(&
haudio_out_sai, HAL_SAI_TX_COMPLETE_CB_ID, SAI_TxCpltCallback) !=
HAL_OK)
1200 else if(HAL_SAI_RegisterCallback(&
haudio_out_sai, HAL_SAI_TX_HALFCOMPLETE_CB_ID, SAI_TxHalfCpltCallback) !=
HAL_OK)
1204 else if(HAL_SAI_RegisterCallback(&
haudio_out_sai, HAL_SAI_ERROR_CB_ID, SAI_ErrorCallback) !=
HAL_OK)
1276 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 0U)
1400 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1U)
1404 if(BSP_AUDIO_IN_RegisterDefaultMspCallbacks(Instance) !=
BSP_ERROR_NONE)
1451 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1U)
1453 if(HAL_SAI_RegisterCallback(&
haudio_in_sai, HAL_SAI_RX_COMPLETE_CB_ID, SAI_RxCpltCallback) !=
HAL_OK)
1457 if(HAL_SAI_RegisterCallback(&
haudio_in_sai, HAL_SAI_RX_HALFCOMPLETE_CB_ID, SAI_RxHalfCpltCallback) !=
HAL_OK)
1461 if(HAL_SAI_RegisterCallback(&
haudio_in_sai, HAL_SAI_ERROR_CB_ID, SAI_ErrorCallback) !=
HAL_OK)
1466 #if (USE_AUDIO_CODEC_WM8994 == 1U)
1496 else if(Instance == 1U)
1504 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1U)
1508 if(BSP_AUDIO_IN_RegisterDefaultMspCallbacks(Instance) !=
BSP_ERROR_NONE)
1537 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1U)
1539 if(HAL_SAI_RegisterCallback(&
haudio_in_sai, HAL_SAI_RX_COMPLETE_CB_ID, SAI_RxCpltCallback) !=
HAL_OK)
1543 if(HAL_SAI_RegisterCallback(&
haudio_in_sai, HAL_SAI_RX_HALFCOMPLETE_CB_ID, SAI_RxHalfCpltCallback) !=
HAL_OK)
1547 if(HAL_SAI_RegisterCallback(&
haudio_in_sai, HAL_SAI_ERROR_CB_ID, SAI_ErrorCallback) !=
HAL_OK)
1586 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 0U)
1611 else if (Instance == 1U)
1613 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 0U)
1761 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1U)
1767 int32_t BSP_AUDIO_IN_RegisterDefaultMspCallbacks (uint32_t Instance)
1777 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1U)
1820 int32_t BSP_AUDIO_IN_RegisterMspCallbacks (uint32_t Instance, BSP_AUDIO_IN_Cb_t *CallBacks)
1832 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1U)
1833 if(HAL_SAI_RegisterCallback(&
haudio_in_sai, HAL_SAI_MSPINIT_CB_ID, CallBacks->pMspSaiInitCb) !=
HAL_OK)
1837 else if(HAL_SAI_RegisterCallback(&
haudio_in_sai, HAL_SAI_MSPDEINIT_CB_ID, CallBacks->pMspSaiDeInitCb) !=
HAL_OK)
1879 for(index = 0; index < ChnlNbrIn; index++)
1920 PDM_Filter(&((uint8_t*)(PDMBuf))[index], (uint16_t*)&(PCMBuf[index]), &
PDM_FilterHandler[index]);
2122 audio_init.
Device = Device;
2417 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 0U)
2505 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1U)
2543 #if (USE_AUDIO_CODEC_WM8994 == 1)
2548 static int32_t WM8994_Probe(
void)
2714 gpio_init_structure.
Alternate = GPIO_AF10_SAI4;
2870 #if (USE_HAL_SAI_REGISTER_CALLBACKS == 1U)
#define SAI_FS_STARTFRAME
__weak void BSP_AUDIO_OUT_TransferComplete_CallBack(uint32_t Instance)
Manages the DMA full Transfer complete event.
void HAL_SAI_TxHalfCpltCallback(SAI_HandleTypeDef *hsai)
Tx Half Transfer completed callbacks.
#define __HAL_LINKDMA(__HANDLE__, __PPP_DMA_FIELD__, __DMA_HANDLE__)
HAL_StatusTypeDef
HAL Status structures definition
#define SAI_FREE_PROTOCOL
#define AUDIO_IN_SAIx_DMAx_IRQ
#define AUDIO_FREQUENCY_11K
int32_t WM8994_Reset(WM8994_Object_t *pObj)
Resets wm8994 registers.
#define SAI_FIFOTHRESHOLD_1QF
#define SAI_OUTPUT_RELEASED
int32_t BSP_AUDIO_IN_SetDevice(uint32_t Instance, uint32_t Device)
Set Audio In device.
void HAL_NVIC_EnableIRQ(IRQn_Type IRQn)
#define SAI_OUTPUTDRIVE_DISABLE
HAL_StatusTypeDef HAL_SAI_DMAStop(SAI_HandleTypeDef *hsai)
#define SAI_CLOCKSTROBING_FALLINGEDGE
int32_t BSP_AUDIO_OUT_GetSampleRate(uint32_t Instance, uint32_t *SampleRate)
Get the audio frequency.
int32_t BSP_AUDIO_OUT_Init(uint32_t Instance, BSP_AUDIO_Init_t *AudioInit)
Configures the audio peripherals.
int32_t BSP_AUDIO_OUT_Mute(uint32_t Instance)
Enables the MUTE.
uint32_t ActiveFrameLength
#define AUDIO_IN_STATE_RECORDING
DMA handle Structure definition.
#define GPIO_SPEED_FREQ_HIGH
GPIO Init structure definition
int32_t BSP_AUDIO_IN_SetChannelsNbr(uint32_t Instance, uint32_t ChannelNbr)
Set Audio In Channel number.
DMA_HandleTypeDef * hdmatx
#define DMA_PDATAALIGN_WORD
#define AUDIO_IN_SAI_PDMx_CLK_IN_PORT
HAL_StatusTypeDef HAL_SAI_DMAPause(SAI_HandleTypeDef *hsai)
static void SAI_MspDeInit(SAI_HandleTypeDef *hsai)
Deinitializes SAI MSP.
#define AUDIO_IN_SAIx_CLK_DISABLE()
int32_t BSP_AUDIO_OUT_Play(uint32_t Instance, uint8_t *pData, uint32_t NbrOfBytes)
Default BSP AUDIO OUT Msp Callbacks.
#define AUDIO_OUT_SAIx_CLK_ENABLE()
#define SAI_SLOTSIZE_DATASIZE
int32_t(* SetMute)(void *, uint32_t)
#define BSP_ERROR_COMPONENT_FAILURE
int32_t BSP_AUDIO_OUT_DeInit(uint32_t Instance)
De-initializes the audio out peripheral.
#define DMA_PDATAALIGN_HALFWORD
This file is the header of stm32h747i_discovery_bus.c file.
uint32_t IsMspCallbacksValid
#define AUDIO_RESOLUTION_16B
SAI_HandleTypeDef haudio_out_sai
#define AUDIO_IN_DEVICE_ANALOG_MIC
#define VOLUME_OUT_CONVERT(Volume)
HAL_StatusTypeDef HAL_SAI_DeInit(SAI_HandleTypeDef *hsai)
#define AUDIO_OUT_SAIx_SCK_PIN
#define BSP_AUDIO_OUT_IT_PRIORITY
#define __HAL_RCC_CRC_CLK_ENABLE()
WM8994_ReadReg_Func ReadReg
int32_t BSP_AUDIO_IN_GetVolume(uint32_t Instance, uint32_t *Volume)
Get the current audio in volume level.
void HAL_NVIC_DisableIRQ(IRQn_Type IRQn)
uint32_t PeriphClockSelection
WM8994_GetTick_Func GetTick
__weak HAL_StatusTypeDef MX_SAI1_Block_B_Init(SAI_HandleTypeDef *hsai, MX_SAI_Config_t *MXConfig)
Initializes the Audio Codec audio in instance (SAI).
#define SAI_SYNCEXT_DISABLE
#define AUDIO_IN_INSTANCES_NBR
int32_t BSP_AUDIO_OUT_GetChannelsNbr(uint32_t Instance, uint32_t *ChannelNbr)
Get the audio Channels number.
#define AUDIO_OUT_SAIx_DMAx_REQUEST
#define __HAL_RCC_GPIOE_CLK_ENABLE()
int32_t BSP_AUDIO_IN_Pause(uint32_t Instance)
Pause the audio file stream.
#define SAI_FS_CHANNEL_IDENTIFICATION
#define AUDIO_OUT_SAIx_SD_PIN
#define AUDIO_I2C_ADDRESS
AUDIO I2C Interface pins.
#define AUDIO_OUT_SAIx_SD_GPIO_PORT
#define BSP_ERROR_UNKNOWN_COMPONENT
int32_t BSP_AUDIO_IN_Record(uint32_t Instance, uint8_t *pBuf, uint32_t NbrOfBytes)
Start audio recording.
int32_t BSP_AUDIO_OUT_SetVolume(uint32_t Instance, uint32_t Volume)
Controls the current audio volume level.
#define AUDIO_OUT_SAIx_MCLK_AF
__IO HAL_SAI_StateTypeDef State
#define AUDIO_OUT_STATE_RESET
#define AUDIO_IN_SAI_PDMx_DATA_IN_PORT
int32_t BSP_AUDIO_IN_PDMToPCM_Init(uint32_t Instance, uint32_t AudioFreq, uint32_t ChnlNbrIn, uint32_t ChnlNbrOut)
Initialize the PDM library.
uint32_t PeriphDataAlignment
#define AUDIO_OUT_SAIx_MCLK_ENABLE()
#define AUDIO_IN_SAI_PDMx_DMAx_MEM_DATA_SIZE
__weak void BSP_AUDIO_IN_Error_CallBack(uint32_t Instance)
Audio IN Error callback function.
int32_t BSP_AUDIO_OUT_GetState(uint32_t Instance, uint32_t *State)
Get Audio Out state.
DMA_HandleTypeDef * hdmarx
int32_t BSP_AUDIO_IN_GetBitsPerSample(uint32_t Instance, uint32_t *BitsPerSample)
Get Audio In Resolution.
SAI_Block_TypeDef * Instance
#define AUDIO_IN_SAI_PDMx_CLK_IN_ENABLE()
int32_t BSP_GetTick(void)
Delay function.
#define AUDIO_OUT_STATE_STOP
#define __HAL_SAI_RESET_HANDLE_STATE(__HANDLE__)
Reset SAI handle state.
#define AUDIO_OUT_DEVICE_HEADPHONE
#define DMA_MBURST_SINGLE
void BSP_AUDIO_OUT_IRQHandler(uint32_t Instance)
#define SAI_MODEMASTER_RX
#define AUDIO_IN_SAIx_CLK_ENABLE()
int32_t BSP_AUDIO_IN_GetChannelsNbr(uint32_t Instance, uint32_t *ChannelNbr)
Get Audio In Channel number.
#define AUDIO_IN_SAI_PDMx_FS_SCK_AF
#define DMA_PERIPH_TO_MEMORY
#define RCC_SAI1CLKSOURCE_PLL2
SAI_HandleTypeDef haudio_in_sai
uint32_t IsMspCallbacksValid
void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init)
int32_t BSP_AUDIO_OUT_SetDevice(uint32_t Instance, uint32_t Device)
Switch dynamically (while audio file is played) the output target (speaker or headphone).
int32_t BSP_I2C4_ReadReg16(uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length)
Read a 16bit register of the device through BUS.
#define AUDIO_FREQUENCY_22K
int32_t BSP_AUDIO_IN_RecordPDM(uint32_t Instance, uint8_t *pBuf, uint32_t NbrOfBytes)
Start audio recording.
#define AUDIO_IN_SAI_PDMx_SCK_PIN
#define AUDIO_IN_SAI_PDMx_DATA_IN_PIN
int32_t BSP_AUDIO_IN_Resume(uint32_t Instance)
Resume the audio file stream.
uint32_t ActiveFrameLength
__weak HAL_StatusTypeDef MX_SAI4_Block_A_Init(SAI_HandleTypeDef *hsai, MX_SAI_Config_t *MXConfig)
Initializes the Audio Codec audio in instance (SAI).
#define BSP_ERROR_BUS_FAILURE
static void SAI_MspInit(SAI_HandleTypeDef *hsai)
Initialize BSP_AUDIO_OUT MSP.
int32_t BSP_AUDIO_IN_Stop(uint32_t Instance)
Stop audio recording.
#define AUDIO_OUT_SAIx_FS_ENABLE()
#define GPIO_SPEED_FREQ_MEDIUM
#define BSP_AUDIO_MUTE_ENABLED
#define AUDIO_OUT_SAIx_DMAx_IRQ
#define AUDIO_IN_STATE_PAUSE
__weak HAL_StatusTypeDef MX_SAI1_ClockConfig(SAI_HandleTypeDef *hsai, uint32_t SampleRate)
SAI clock Config.
AUDIO_OUT_Ctx_t Audio_Out_Ctx[AUDIO_OUT_INSTANCES_NBR]
#define AUDIO_FREQUENCY_44K
#define AUDIO_OUT_SAIx_FS_GPIO_PORT
#define DMA_MDATAALIGN_HALFWORD
static PDM_Filter_Handler_t PDM_FilterHandler[2]
#define DMA_PRIORITY_HIGH
int32_t(* Resume)(void *)
DMA_Stream_TypeDef * Instance
#define AUDIO_OUT_STATE_PLAYING
#define AUDIO_OUT_SAIx_FS_AF
HAL_StatusTypeDef HAL_SAI_DMAResume(SAI_HandleTypeDef *hsai)
int32_t BSP_AUDIO_IN_SetVolume(uint32_t Instance, uint32_t Volume)
Set the current audio in volume level.
AUDIO_IN_Ctx_t Audio_In_Ctx[AUDIO_IN_INSTANCES_NBR]
WM8994_WriteReg_Func WriteReg
void HAL_SAI_RxHalfCpltCallback(SAI_HandleTypeDef *hsai)
Half reception complete callback.
#define VOLUME_IN_CONVERT(Volume)
WM8994_DeInit_Func DeInit
uint32_t MemDataAlignment
#define SAI_PDM_CLOCK1_ENABLE
#define GPIO_SPEED_FREQ_VERY_HIGH
int32_t(* SetVolume)(void *, uint32_t, uint8_t)
#define AUDIO_IN_SAI_PDMx_CLK_IN_PIN
void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin)
#define SAI_MASTERDIVIDER_DISABLE
int32_t BSP_AUDIO_OUT_SetSampleRate(uint32_t Instance, uint32_t SampleRate)
Updates the audio frequency.
int32_t BSP_AUDIO_OUT_GetVolume(uint32_t Instance, uint32_t *Volume)
Get the current audio volume level.
int32_t WM8994_ReadID(WM8994_Object_t *pObj, uint32_t *Id)
Get the WM8994 ID.
int32_t BSP_AUDIO_IN_DeInit(uint32_t Instance)
Deinit the audio IN peripherals.
#define AUDIO_OUT_SAIx_DMAx_CLK_ENABLE()
#define AUDIO_VOLUME_OUTPUT
#define SAI_OUTPUTDRIVE_ENABLE
#define BSP_ERROR_CLOCK_FAILURE
#define AUDIO_OUT_SAIx_MCLK_GPIO_PORT
#define AUDIO_OUT_SAIx_SCK_ENABLE()
static PDM_Filter_Config_t PDM_FilterConfig[2]
#define AUDIO_IN_SAIx_DMAx_MEM_DATA_SIZE
int32_t BSP_AUDIO_OUT_SetBitsPerSample(uint32_t Instance, uint32_t BitsPerSample)
Set the audio Resolution.
#define DMA_PBURST_SINGLE
int32_t(* DeInit)(void *)
int32_t BSP_AUDIO_IN_SetSampleRate(uint32_t Instance, uint32_t SampleRate)
Set Audio In frequency.
#define __HAL_SAI_DISABLE(__HANDLE__)
#define SAI_MODEMASTER_TX
#define WM8994_ID
WM8994 ID
#define AUDIO_IN_SAIx_DMAx_STREAM
#define CODEC_AUDIOFRAME_SLOT_13
int32_t BSP_AUDIO_OUT_UnMute(uint32_t Instance)
Disables the MUTE mode.
int32_t BSP_AUDIO_IN_Init(uint32_t Instance, BSP_AUDIO_Init_t *AudioInit)
Initialize wave recording.
int32_t BSP_I2C4_WriteReg16(uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length)
Write a 16bit value in a register of the device through BUS.
#define AUDIO_IN_SAI_PDMx_DMAx_STREAM
int32_t(* Stop)(void *, uint32_t)
#define AUDIO_OUT_SAIx_SD_ENABLE()
#define BSP_AUDIO_IN_IT_PRIORITY
WM8994_Drv_t WM8994_Driver
#define AUDIO_IN_SAIx_DMAx_PERIPH_DATA_SIZE
FunctionalState Activation
int32_t BSP_AUDIO_OUT_GetDevice(uint32_t Instance, uint32_t *Device)
Get the Output Device.
#define __HAL_SAI_ENABLE(__HANDLE__)
void HAL_SAI_TxCpltCallback(SAI_HandleTypeDef *hsai)
Tx Transfer completed callbacks.
__weak void BSP_AUDIO_OUT_HalfTransfer_CallBack(uint32_t Instance)
Manages the DMA Half Transfer complete event.
int32_t BSP_AUDIO_OUT_Resume(uint32_t Instance)
Resumes the audio file stream.
int32_t(* Init)(void *, void *)
HAL_StatusTypeDef HAL_SAI_Receive_DMA(SAI_HandleTypeDef *hsai, uint8_t *pData, uint16_t Size)
int32_t BSP_AUDIO_OUT_SetChannelsNbr(uint32_t Instance, uint32_t ChannelNbr)
Set the audio Channels number.
int32_t BSP_I2C4_DeInit(void)
DeInitializes I2C HAL.
__weak void BSP_AUDIO_IN_TransferComplete_CallBack(uint32_t Instance)
User callback when record buffer is filled.
#define DMA_FIFOMODE_ENABLE
#define AUDIO_OUT_STATE_PAUSE
#define SAI_MASTERDIVIDER_ENABLE
#define RCC_PERIPHCLK_SAI1
#define SAI_MCK_OVERSAMPLING_DISABLE
#define BSP_ERROR_NO_INIT
#define DMA_FIFOMODE_DISABLE
int32_t BSP_AUDIO_OUT_GetBitsPerSample(uint32_t Instance, uint32_t *BitsPerSample)
Get the audio Resolution.
void HAL_SAI_ErrorCallback(SAI_HandleTypeDef *hsai)
SAI error callbacks.
int32_t BSP_AUDIO_OUT_Stop(uint32_t Instance)
Stops audio playing and Power down the Audio Codec.
#define AUDIO_IN_SAI_PDMx_DATA_IN_ENABLE()
#define DMA_MEMORY_TO_PERIPH
HAL_StatusTypeDef HAL_RCCEx_PeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClkInit)
int32_t BSP_I2C4_Init(void)
Initializes I2C HAL.
#define CODEC_AUDIOFRAME_SLOT_02
#define AUDIO_IN_STATE_RESET
HAL_StatusTypeDef HAL_DMA_Init(DMA_HandleTypeDef *hdma)
#define AUDIO_IN_SAIx_SD_PIN
#define AUDIO_VOLUME_INPUT
int32_t BSP_AUDIO_IN_GetState(uint32_t Instance, uint32_t *State)
Get Audio In device.
#define SAI_OUTPUT_NOTRELEASED
#define __HAL_RCC_GPIOG_CLK_ENABLE()
uint32_t Sai1ClockSelection
int32_t BSP_AUDIO_IN_GetSampleRate(uint32_t Instance, uint32_t *SampleRate)
Get Audio In frequency.
int32_t BSP_AUDIO_OUT_Pause(uint32_t Instance)
This function Pauses the audio file stream. In case of using DMA, the DMA Pause feature is used.
#define AUDIO_IN_SAI_PDMx_CLK_ENABLE()
void BSP_AUDIO_IN_IRQHandler(uint32_t Instance, uint32_t InputDevice)
This function handles Audio Out DMA interrupt requests.
HAL_StatusTypeDef HAL_DMA_DeInit(DMA_HandleTypeDef *hdma)
__weak void BSP_AUDIO_OUT_Error_CallBack(uint32_t Instance)
Manages the DMA FIFO error event.
#define AUDIO_OUT_SAIx_SCK_GPIO_PORT
int32_t BSP_AUDIO_IN_SetBitsPerSample(uint32_t Instance, uint32_t BitsPerSample)
Set Audio In Resolution.
int32_t BSP_AUDIO_OUT_IsMute(uint32_t Instance, uint32_t *IsMute)
Check whether the MUTE mode is enabled or not.
#define SAI_MCK_OUTPUT_DISABLE
#define SAI_FS_ACTIVE_LOW
__weak HAL_StatusTypeDef MX_SAI4_ClockConfig(SAI_HandleTypeDef *hsai, uint32_t SampleRate)
SAI clock Config.
#define CODEC_AUDIOFRAME_SLOT_0123
HAL_StatusTypeDef HAL_SAI_Init(SAI_HandleTypeDef *hsai)
#define BSP_AUDIO_MUTE_DISABLED
void HAL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority)
__weak HAL_StatusTypeDef MX_SAI1_Block_A_Init(SAI_HandleTypeDef *hsai, MX_SAI_Config_t *MXConfig)
Initializes the Audio Codec audio out instance (SAI).
#define AUDIO_IN_SAI_PDMx_DMAx_REQUEST
RCC extended clocks structure definition.
void HAL_SAI_RxCpltCallback(SAI_HandleTypeDef *hsai)
Reception complete callback.
static AUDIO_Drv_t * Audio_Drv
#define AUDIO_OUT_SAIx_MCLK_PIN
#define AUDIO_IN_DEVICE_DIGITAL_MIC
int32_t BSP_AUDIO_IN_GetDevice(uint32_t Instance, uint32_t *Device)
Get Audio In device.
#define AUDIO_IN_STATE_STOP
int32_t WM8994_RegisterBusIO(WM8994_Object_t *pObj, WM8994_IO_t *pIO)
Function.
#define AUDIO_IN_SAI_PDMx_FS_PIN
#define AUDIO_IN_SAIx_SD_ENABLE()
#define AUDIO_OUT_SAIx_SCK_AF
#define BSP_ERROR_WRONG_PARAM
#define AUDIO_RESOLUTION_32B
#define AUDIO_OUT_SAIx_CLK_DISABLE()
#define SAI_CLOCKSTROBING_RISINGEDGE
#define AUDIO_OUT_SAIx_SD_AF
__weak void BSP_AUDIO_IN_HalfTransfer_CallBack(uint32_t Instance)
Manages the DMA Half Transfer complete event.
#define DMA_FIFO_THRESHOLD_FULL
#define __HAL_RCC_SAI1_CLK_ENABLE()
#define SAI_FS_ACTIVE_HIGH
SAI_SlotInitTypeDef SlotInit
int32_t BSP_AUDIO_IN_PDMToPCM(uint32_t Instance, uint16_t *PDMBuf, uint16_t *PCMBuf)
Converts audio format from PDM to PCM.
#define AUDIO_IN_SAIx_DMAx_CLK_ENABLE()
SAI_FrameInitTypeDef FrameInit
#define __HAL_RCC_BDMA_CLK_ENABLE()
#define BSP_ERROR_PERIPH_FAILURE
#define AUDIO_OUT_INSTANCES_NBR
#define AUDIO_OUT_SAIx_DMAx_STREAM
#define AUDIO_IN_SAI_PDMx_FS_SCK_ENABLE()
#define AUDIO_IN_SAI_PDMx
#define SAI_FS_BEFOREFIRSTBIT
#define AUDIO_IN_SAI_PDMx_DMAx_PERIPH_DATA_SIZE
#define AUDIO_IN_SAIx_SD_GPIO_PORT
void HAL_RCCEx_GetPeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClkInit)
void HAL_DMA_IRQHandler(DMA_HandleTypeDef *hdma)
HAL_StatusTypeDef HAL_SAI_Transmit_DMA(SAI_HandleTypeDef *hsai, uint8_t *pData, uint16_t Size)
#define AUDIO_IN_SAIx_DMAx_REQUEST
#define AUDIO_IN_SAI_PDMx_FS_SCK_GPIO_PORT
#define DMA_MDATAALIGN_WORD
#define AUDIO_OUT_SAIx_FS_PIN
#define BSP_ERROR_FEATURE_NOT_SUPPORTED
#define AUDIO_IN_SAI_PDMx_DMAx_IRQ
This file contains the common defines and functions prototypes for the stm32h747i_discovery_audio....
SAI_PdmInitTypeDef PdmInit