STM32H743I_EVAL BSP User Manual
|
stm32h743i_eval_audio.h
Go to the documentation of this file.
00001 /** 00002 ****************************************************************************** 00003 * @file stm32h743i_eval_audio.h 00004 * @author MCD Application Team 00005 * @version V1.0.0 00006 * @date 21-April-2017 00007 * @brief This file contains the common defines and functions prototypes for 00008 * the stm32h743i_eval_audio.c driver. 00009 ****************************************************************************** 00010 * @attention 00011 * 00012 * <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2> 00013 * 00014 * Redistribution and use in source and binary forms, with or without modification, 00015 * are permitted provided that the following conditions are met: 00016 * 1. Redistributions of source code must retain the above copyright notice, 00017 * this list of conditions and the following disclaimer. 00018 * 2. Redistributions in binary form must reproduce the above copyright notice, 00019 * this list of conditions and the following disclaimer in the documentation 00020 * and/or other materials provided with the distribution. 00021 * 3. Neither the name of STMicroelectronics nor the names of its contributors 00022 * may be used to endorse or promote products derived from this software 00023 * without specific prior written permission. 00024 * 00025 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00026 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00027 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00028 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 00029 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00030 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00031 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00032 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00033 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00034 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00035 * 00036 ****************************************************************************** 00037 */ 00038 00039 /* Define to prevent recursive inclusion -------------------------------------*/ 00040 #ifndef __STM32H743I_EVAL_AUDIO_H 00041 #define __STM32H743I_EVAL_AUDIO_H 00042 00043 #ifdef __cplusplus 00044 extern "C" { 00045 #endif 00046 00047 /* Includes ------------------------------------------------------------------*/ 00048 /* Include audio component Driver */ 00049 #include "../Components/wm8994/wm8994.h" 00050 #include "stm32h743i_eval.h" 00051 #include <stdlib.h> 00052 /* Include PDM to PCM lib header file */ 00053 #include "pdm2pcm_glo.h" 00054 00055 /** @addtogroup BSP 00056 * @{ 00057 */ 00058 00059 /** @defgroup STM32H743I_EVAL STM32H743I EVAL board 00060 * @{ 00061 */ 00062 00063 /** @defgroup STM32H743I_EVAL_AUDIO STM32H743I EVAL board BSP AUDIO 00064 * @{ 00065 */ 00066 00067 /** @defgroup STM32H743I_EVAL_AUDIO_Exported_Types AUDIO Exported Types 00068 * @{ 00069 */ 00070 typedef struct 00071 { 00072 uint32_t Frequency; /* Record Frequency */ 00073 uint32_t BitResolution; /* Record bit resolution */ 00074 uint32_t ChannelNbr; /* Record Channel Number */ 00075 uint16_t *pRecBuf; /* Pointer to record user buffer */ 00076 uint32_t RecSize; /* Size to record in mono, double size to record in stereo */ 00077 uint32_t InputDevice; /* Audio Input Device */ 00078 uint32_t Interface; /* Audio Input Interface */ 00079 uint32_t MultiBuffMode; /* Multi buffer mode selection */ 00080 }AUDIOIN_ContextTypeDef; 00081 /** 00082 * @} 00083 */ 00084 00085 /** @defgroup STM32H743I_EVAL_AUDIO_Exported_Constants AUDIO Exported Constants 00086 * @{ 00087 */ 00088 00089 /** @defgroup BSP_Audio_Sample_Rate BSP Audio Sample Rate 00090 * @{ 00091 */ 00092 #define BSP_AUDIO_FREQUENCY_96K SAI_AUDIO_FREQUENCY_96K 00093 #define BSP_AUDIO_FREQUENCY_48K SAI_AUDIO_FREQUENCY_48K 00094 #define BSP_AUDIO_FREQUENCY_44K SAI_AUDIO_FREQUENCY_44K 00095 #define BSP_AUDIO_FREQUENCY_32K SAI_AUDIO_FREQUENCY_32K 00096 #define BSP_AUDIO_FREQUENCY_22K SAI_AUDIO_FREQUENCY_22K 00097 #define BSP_AUDIO_FREQUENCY_16K SAI_AUDIO_FREQUENCY_16K 00098 #define BSP_AUDIO_FREQUENCY_11K SAI_AUDIO_FREQUENCY_11K 00099 #define BSP_AUDIO_FREQUENCY_8K SAI_AUDIO_FREQUENCY_8K 00100 /** 00101 * @} 00102 */ 00103 00104 /*------------------------------------------------------------------------------ 00105 USER SAI defines parameters 00106 -----------------------------------------------------------------------------*/ 00107 /** @defgroup CODEC_AUDIO_FRAME_SLOT_TDM Code audio frame slot in TDM mode. 00108 * @{ 00109 */ 00110 /** In W8994 codec the Audio frame contains 4 slots : TDM Mode 00111 * TDM format : 00112 * +------------------|------------------|--------------------|-------------------+ 00113 * | CODEC_SLOT0 Left | CODEC_SLOT1 Left | CODEC_SLOT0 Right | CODEC_SLOT1 Right | 00114 * +------------------------------------------------------------------------------+ 00115 */ 00116 /* To have 2 separate audio stream in Both headphone and speaker the 4 slot must be activated */ 00117 #define CODEC_AUDIOFRAME_SLOT_0123 SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_2 | SAI_SLOTACTIVE_3 00118 00119 /* To have an audio stream in headphone only SAI Slot 0 and Slot 2 must be activated */ 00120 #define CODEC_AUDIOFRAME_SLOT_02 SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_2 00121 /* To have an audio stream in speaker only SAI Slot 1 and Slot 3 must be activated */ 00122 #define CODEC_AUDIOFRAME_SLOT_13 SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_3 00123 /* To have an audio stream in SAI PDM input Slot 0 must be activated */ 00124 #define CODEC_AUDIOFRAME_SLOT_0 SAI_SLOTACTIVE_0 00125 /** 00126 * @} 00127 */ 00128 /*------------------------------------------------------------------------------ 00129 AUDIO OUT CONFIGURATION 00130 ------------------------------------------------------------------------------*/ 00131 /* SAI peripheral configuration defines */ 00132 #define AUDIO_OUT_SAIx SAI1_Block_A 00133 #define AUDIO_OUT_SAIx_CLK_ENABLE() __HAL_RCC_SAI1_CLK_ENABLE() 00134 #define AUDIO_OUT_SAIx_CLK_DISABLE() __HAL_RCC_SAI1_CLK_DISABLE() 00135 #define AUDIO_OUT_SAIx_AF GPIO_AF6_SAI1 00136 00137 #define AUDIO_OUT_SAIx_MCLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE() 00138 #define AUDIO_OUT_SAIx_MCLK_GPIO_PORT GPIOE 00139 #define AUDIO_OUT_SAIx_MCLK_PIN GPIO_PIN_2 00140 #define AUDIO_OUT_SAIx_SD_FS_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE() 00141 #define AUDIO_OUT_SAIx_SD_FS_SCK_GPIO_PORT GPIOE 00142 #define AUDIO_OUT_SAIx_FS_PIN GPIO_PIN_4 00143 #define AUDIO_OUT_SAIx_SCK_PIN GPIO_PIN_5 00144 #define AUDIO_OUT_SAIx_SD_PIN GPIO_PIN_6 00145 00146 /* SAI DMA Stream definitions */ 00147 #define AUDIO_OUT_SAIx_DMAx_CLK_ENABLE() __HAL_RCC_DMA2_CLK_ENABLE() 00148 #define AUDIO_OUT_SAIx_DMAx_STREAM DMA2_Stream1 00149 #define AUDIO_OUT_SAIx_DMAx_REQUEST DMA_REQUEST_SAI1_A 00150 #define AUDIO_OUT_SAIx_DMAx_IRQ DMA2_Stream1_IRQn 00151 #define AUDIO_OUT_SAIx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_HALFWORD 00152 #define AUDIO_OUT_SAIx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_HALFWORD 00153 #define AUDIO_OUT_SAIx_DMAx_IRQHandler DMA2_Stream1_IRQHandler 00154 00155 /* Select the interrupt preemption priority and subpriority for the DMA interrupt */ 00156 #define AUDIO_OUT_IRQ_PREPRIO ((uint32_t)0x0E) 00157 00158 /*------------------------------------------------------------------------------ 00159 AUDIO IN CONFIGURATION 00160 ------------------------------------------------------------------------------*/ 00161 /* SAI peripheral configuration defines */ 00162 #define AUDIO_IN_SAIx SAI1_Block_B 00163 #define AUDIO_IN_SAIx_CLK_ENABLE() __HAL_RCC_SAI1_CLK_ENABLE() 00164 #define AUDIO_IN_SAIx_CLK_DISABLE() __HAL_RCC_SAI1_CLK_DISABLE() 00165 #define AUDIO_IN_SAIx_AF GPIO_AF6_SAI1 00166 #define AUDIO_IN_SAIx_SD_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE() 00167 #define AUDIO_IN_SAIx_SD_GPIO_PORT GPIOE 00168 #define AUDIO_IN_SAIx_SD_PIN GPIO_PIN_3 00169 00170 /* SAI DMA Stream definitions */ 00171 #define AUDIO_IN_SAIx_DMAx_CLK_ENABLE() __HAL_RCC_DMA2_CLK_ENABLE() 00172 #define AUDIO_IN_SAIx_DMAx_STREAM DMA2_Stream4 00173 #define AUDIO_IN_SAIx_DMAx_REQUEST DMA_REQUEST_SAI1_B 00174 #define AUDIO_IN_SAIx_DMAx_IRQ DMA2_Stream4_IRQn 00175 #define AUDIO_IN_SAIx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_HALFWORD 00176 #define AUDIO_IN_SAIx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_HALFWORD 00177 00178 #define AUDIO_IN_SAIx_DMAx_IRQHandler DMA2_Stream4_IRQHandler 00179 00180 #define AUDIO_IN_INT_GPIO_ENABLE() __HAL_RCC_GPIOJ_CLK_ENABLE() 00181 #define AUDIO_IN_INT_GPIO_PORT GPIOJ 00182 #define AUDIO_IN_INT_GPIO_PIN GPIO_PIN_12 00183 #define AUDIO_IN_INT_IRQ EXTI15_10_IRQn 00184 00185 /* DFSDM Configuration defines */ 00186 #define AUDIO_DFSDMx_MIC1_CHANNEL DFSDM1_Channel1 /* MP34DT01TR microphone on PCB top side */ 00187 #define AUDIO_DFSDMx_MIC2_CHANNEL DFSDM1_Channel0 /* MP34DT01TR microphone on PCB top side */ 00188 #define AUDIO_DFSDMx_MIC1_CHANNEL_FOR_FILTER DFSDM_CHANNEL_1 00189 #define AUDIO_DFSDMx_MIC2_CHANNEL_FOR_FILTER DFSDM_CHANNEL_0 00190 #define AUDIO_DFSDMx_MIC1_FILTER DFSDM1_Filter0 /* Common filter for MP34DT01TR microphone input */ 00191 #define AUDIO_DFSDMx_MIC2_FILTER DFSDM1_Filter1 /* Common filter for MP34DT01TR microphone input */ 00192 #define AUDIO_DFSDMx_CLK_ENABLE() __HAL_RCC_DFSDM1_CLK_ENABLE() 00193 #define AUDIO_DFSDMx_CKOUT_PIN GPIO_PIN_2 00194 #define AUDIO_DFSDMx_CKOUT_DMIC_GPIO_PORT GPIOC 00195 #define AUDIO_DFSDMx_CKOUT_DMIC_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE() 00196 #define AUDIO_DFSDMx_CKOUT_DMIC_AF GPIO_AF6_DFSDM1 00197 #define AUDIO_DFSDMx_DMIC_PIN GPIO_PIN_3 00198 #define AUDIO_DFSDMx_DMIC_GPIO_PORT GPIOC 00199 #define AUDIO_DFSDMx_DMIC_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE() 00200 #define AUDIO_DFSDMx_DMIC_AF GPIO_AF3_DFSDM1 00201 00202 /* DFSDM DMA MIC1 and MIC2 channels definitions */ 00203 #define AUDIO_DFSDMx_DMAx_CLK_ENABLE() __HAL_RCC_DMA2_CLK_ENABLE() 00204 #define AUDIO_DFSDMx_DMAx_MIC1_STREAM DMA2_Stream0 00205 #define AUDIO_DFSDMx_DMAx_MIC1_REQUEST DMA_REQUEST_DFSDM1_FLT0 00206 #define AUDIO_DFSDMx_DMAx_MIC2_STREAM DMA2_Stream5 00207 #define AUDIO_DFSDMx_DMAx_MIC2_REQUEST DMA_REQUEST_DFSDM1_FLT1 00208 #define AUDIO_DFSDMx_DMAx_MIC1_IRQ DMA2_Stream0_IRQn 00209 #define AUDIO_DFSDMx_DMAx_MIC2_IRQ DMA2_Stream5_IRQn 00210 #define AUDIO_DFSDMx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_WORD 00211 #define AUDIO_DFSDMx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_WORD 00212 00213 #define AUDIO_DFSDM_DMAx_MIC1_IRQHandler DMA2_Stream0_IRQHandler 00214 #define AUDIO_DFSDM_DMAx_MIC2_IRQHandler DMA2_Stream5_IRQHandler 00215 00216 /* Select the interrupt preemption priority and subpriority for the DMA interrupt */ 00217 #define AUDIO_IN_IRQ_PREPRIO ((uint32_t)0x0F) 00218 00219 /* SAI PDM input definitions */ 00220 #define AUDIO_IN_SAI_PDMx SAI4_Block_A 00221 #define AUDIO_IN_SAI_PDMx_CLK_ENABLE() __HAL_RCC_SAI4_CLK_ENABLE() 00222 #define AUDIO_IN_SAI_PDMx_CLK_DISABLE() __HAL_RCC_SAI4_CLK_DISABLE() 00223 #define AUDIO_IN_SAI_PDMx_FS_SCK_AF GPIO_AF8_SAI4 00224 #define AUDIO_IN_SAI_PDMx_FS_SCK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE() 00225 #define AUDIO_IN_SAI_PDMx_FS_SCK_GPIO_PORT GPIOE 00226 #define AUDIO_IN_SAI_PDMx_FS_PIN GPIO_PIN_4 00227 #define AUDIO_IN_SAI_PDMx_SCK_PIN GPIO_PIN_5 00228 00229 #define AUDIO_IN_SAI_PDMx_CLK_IN_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE() 00230 #define AUDIO_IN_SAI_PDMx_CLK_IN_PIN GPIO_PIN_2 00231 #define AUDIO_IN_SAI_PDMx_CLK_IN_PORT GPIOE 00232 #define AUDIO_IN_SAI_PDMx_DATA_IN_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE() 00233 #define AUDIO_IN_SAI_PDMx_DATA_IN_PIN GPIO_PIN_1 00234 #define AUDIO_IN_SAI_PDMx_DATA_IN_PORT GPIOC 00235 #define AUDIO_IN_SAI_PDMx_DATA_CLK_AF GPIO_AF10_SAI4 00236 #define AUDIO_IN_SAI_PDMx_IRQHandler SAI4_IRQHandler 00237 #define AUDIO_IN_SAI_PDMx_IRQ SAI4_IRQn 00238 00239 /* SAI PDM DMA Stream definitions */ 00240 #define AUDIO_IN_SAI_PDMx_DMAx_CLK_ENABLE() __HAL_RCC_BDMA_CLK_ENABLE() 00241 #define AUDIO_IN_SAI_PDMx_DMAx_STREAM BDMA_Channel1 00242 #define AUDIO_IN_SAI_PDMx_DMAx_REQUEST BDMA_REQUEST_SAI4_A 00243 #define AUDIO_IN_SAI_PDMx_DMAx_IRQ BDMA_Channel1_IRQn 00244 #define AUDIO_IN_SAI_PDMx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_HALFWORD 00245 #define AUDIO_IN_SAI_PDMx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_HALFWORD 00246 #define AUDIO_IN_SAI_PDMx_DMAx_IRQHandler BDMA_Channel1_IRQHandler 00247 /*------------------------------------------------------------------------------ 00248 CONFIGURATION: Audio Driver Configuration parameters 00249 ------------------------------------------------------------------------------*/ 00250 00251 #define AUDIODATA_SIZE ((uint32_t)2) /* 16-bits audio data size */ 00252 00253 /* Audio status definition */ 00254 #define AUDIO_OK ((uint8_t)0) 00255 #define AUDIO_ERROR ((uint8_t)1) 00256 #define AUDIO_TIMEOUT ((uint8_t)2) 00257 00258 /* Audio In default settings */ 00259 #define DEFAULT_AUDIO_IN_FREQ BSP_AUDIO_FREQUENCY_16K 00260 #define DEFAULT_AUDIO_IN_BIT_RESOLUTION ((uint8_t)16) 00261 #define DEFAULT_AUDIO_IN_CHANNEL_NBR ((uint8_t)2) 00262 #define DEFAULT_AUDIO_IN_VOLUME ((uint16_t)64) 00263 00264 /*------------------------------------------------------------------------------ 00265 OUTPUT DEVICES definition 00266 ------------------------------------------------------------------------------*/ 00267 /* Alias on existing output devices to adapt for 2 headphones output */ 00268 #define OUTPUT_DEVICE_HEADPHONE1 OUTPUT_DEVICE_HEADPHONE 00269 #define OUTPUT_DEVICE_HEADPHONE2 OUTPUT_DEVICE_SPEAKER /* Headphone2 is connected to Speaker output of the wm8994 */ 00270 00271 /*------------------------------------------------------------------------------ 00272 INPUT DEVICES definition 00273 ------------------------------------------------------------------------------*/ 00274 /* Analog microphone input from 3.5 audio jack connector */ 00275 #define INPUT_DEVICE_ANALOG_MIC ((uint32_t)0x00000001) 00276 /* MP34DT01TR digital microphone on PCB top side */ 00277 #define INPUT_DEVICE_DIGITAL_MIC1 ((uint32_t)0x00000010) 00278 #define INPUT_DEVICE_DIGITAL_MIC2 ((uint32_t)0x00000020) 00279 #define INPUT_DEVICE_DIGITAL_MIC ((uint32_t)(INPUT_DEVICE_DIGITAL_MIC1 | INPUT_DEVICE_DIGITAL_MIC2)) 00280 #define DFSDM_MIC_NUMBER ((uint32_t)2) 00281 00282 /* Audio In interface for Digital mic */ 00283 #define AUDIO_IN_INTERFACE_SAI ((uint16_t)0) 00284 #define AUDIO_IN_INTERFACE_PDM ((uint16_t)1) 00285 #define AUDIO_IN_INTERFACE_DFSDM ((uint16_t)2) 00286 00287 /** 00288 * @} 00289 */ 00290 00291 /** @defgroup STM32H743I_EVAL_AUDIO_Exported_Macros AUDIO Exported Macros 00292 * @{ 00293 */ 00294 #define DMA_MAX_SIZE 0xFFFF 00295 #define DMA_MAX(x) (((x) <= DMA_MAX_SIZE)? (x):DMA_MAX_SIZE) 00296 #define POS_VAL(VAL) (POSITION_VAL(VAL) - 4) 00297 /** 00298 * @} 00299 */ 00300 00301 /** @defgroup STM32H743I_EVAL_AUDIO_OUT_Exported_Functions AUDIO OUT Exported Functions 00302 * @{ 00303 */ 00304 uint8_t BSP_AUDIO_OUT_Init(uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq); 00305 void BSP_AUDIO_OUT_DeInit(void); 00306 uint8_t BSP_AUDIO_OUT_Play(uint16_t* pBuffer, uint32_t Size); 00307 void BSP_AUDIO_OUT_ChangeBuffer(uint16_t *pData, uint16_t Size); 00308 uint8_t BSP_AUDIO_OUT_Pause(void); 00309 uint8_t BSP_AUDIO_OUT_Resume(void); 00310 uint8_t BSP_AUDIO_OUT_Stop(uint32_t Option); 00311 uint8_t BSP_AUDIO_OUT_SetVolume(uint8_t Volume); 00312 void BSP_AUDIO_OUT_SetFrequency(uint32_t AudioFreq); 00313 void BSP_AUDIO_OUT_SetAudioFrameSlot(uint32_t AudioFrameSlot); 00314 uint8_t BSP_AUDIO_OUT_SetMute(uint32_t Cmd); 00315 uint8_t BSP_AUDIO_OUT_SetOutputMode(uint8_t Output); 00316 00317 /* User Callbacks: user has to implement these functions in his code if they are needed. */ 00318 /* This function is called when the requested data has been completely transferred.*/ 00319 void BSP_AUDIO_OUT_TransferComplete_CallBack(void); 00320 00321 /* This function is called when half of the requested buffer has been transferred. */ 00322 void BSP_AUDIO_OUT_HalfTransfer_CallBack(void); 00323 00324 /* This function is called when an Interrupt due to transfer error on or peripheral 00325 error occurs. */ 00326 void BSP_AUDIO_OUT_Error_CallBack(void); 00327 00328 /* These function can be modified in case the current settings (e.g. DMA stream) 00329 need to be changed for specific application needs */ 00330 void BSP_AUDIO_OUT_ClockConfig(SAI_HandleTypeDef *hsai, uint32_t AudioFreq, void *Params); 00331 void BSP_AUDIO_OUT_MspInit(SAI_HandleTypeDef *hsai, void *Params); 00332 void BSP_AUDIO_OUT_MspDeInit(SAI_HandleTypeDef *hsai, void *Params); 00333 00334 /** 00335 * @} 00336 */ 00337 00338 /** @defgroup STM32H743I_EVAL_AUDIO_IN_Exported_Functions AUDIO IN Exported Functions 00339 * @{ 00340 */ 00341 uint8_t BSP_AUDIO_IN_Init(uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr); 00342 uint8_t BSP_AUDIO_IN_InitEx(uint16_t InputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr); 00343 uint8_t BSP_AUDIO_IN_ConfigMicDefault(uint32_t InputDevice); 00344 uint8_t BSP_AUDIO_IN_ConfigDigitalMic(uint32_t InputDevice, void *Params); 00345 uint8_t BSP_AUDIO_IN_AllocScratch (int32_t *pScratch, uint32_t size); 00346 uint8_t BSP_AUDIO_IN_Record(uint16_t *pBuf, uint32_t Size); 00347 uint8_t BSP_AUDIO_IN_RecordEx(uint32_t *pBuf, uint32_t Size); 00348 uint8_t BSP_AUDIO_IN_SetFrequency(uint32_t AudioFreq); 00349 uint8_t BSP_AUDIO_IN_Stop(void); 00350 uint8_t BSP_AUDIO_IN_StopEx(uint32_t InputDevice); 00351 uint8_t BSP_AUDIO_IN_Pause(void); 00352 uint8_t BSP_AUDIO_IN_PauseEx(uint32_t InputDevice); 00353 uint8_t BSP_AUDIO_IN_Resume(void); 00354 uint8_t BSP_AUDIO_IN_ResumeEx(uint32_t *pBuf, uint32_t InputDevice); 00355 uint8_t BSP_AUDIO_IN_SetVolume(uint8_t Volume); 00356 void BSP_AUDIO_IN_DeInit(void); 00357 uint8_t BSP_AUDIO_IN_PDMToPCM(uint16_t *PDMBuf, uint16_t *PCMBuf); 00358 uint8_t BSP_AUDIO_IN_PDMToPCM_Init(uint32_t AudioFreq, uint32_t ChnlNbrIn, uint32_t ChnlNbrOut); 00359 void BSP_AUDIO_IN_SelectInterface(uint32_t Interface); 00360 uint32_t BSP_AUDIO_IN_GetInterface(void); 00361 uint8_t BSP_AUDIO_IN_OUT_Init(uint32_t InputDevice, uint32_t OutputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr); 00362 00363 /* User Callbacks: user has to implement these functions in his code if they are needed. */ 00364 /* This function should be implemented by the user application. 00365 It is called into this driver when the current buffer is filled to prepare the next 00366 buffer pointer and its size. */ 00367 void BSP_AUDIO_IN_TransferComplete_CallBack(void); 00368 void BSP_AUDIO_IN_HalfTransfer_CallBack(void); 00369 void BSP_AUDIO_IN_TransferComplete_CallBackEx(uint32_t InputDevice); 00370 void BSP_AUDIO_IN_HalfTransfer_CallBackEx(uint32_t InputDevice); 00371 00372 /* This function is called when an Interrupt due to transfer error on or peripheral 00373 error occurs. */ 00374 void BSP_AUDIO_IN_Error_CallBack(void); 00375 00376 /* These function can be modified in case the current settings (e.g. DMA stream) 00377 need to be changed for specific application needs */ 00378 void BSP_AUDIO_IN_ClockConfig(uint32_t AudioFreq, void *Params); 00379 void BSP_AUDIO_IN_MspInit(void); 00380 void BSP_AUDIO_IN_MspDeInit(void); 00381 00382 /** 00383 * @} 00384 */ 00385 00386 /** 00387 * @} 00388 */ 00389 00390 /** 00391 * @} 00392 */ 00393 /** 00394 * @} 00395 */ 00396 00397 #ifdef __cplusplus 00398 } 00399 #endif 00400 00401 #endif /* __STM32H743I_EVAL_AUDIO_H */ 00402 00403 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Generated on Wed Aug 23 2017 17:45:13 for STM32H743I_EVAL BSP User Manual by 1.7.6.1