Team Riedel - display

Dependencies:   LCD_fonts SPI_TFT_ILI9341 CMSIS_DSP_401_without_cm4 mbed-src SDFileSystem wavfile

Committer:
linx0576
Date:
Mon Dec 14 22:13:11 2015 +0000
Revision:
13:ab0285338951
Parent:
9:5a860b9c8a6a
update

Who changed what in which revision?

UserRevisionLine numberNew contents of line
EricLew 9:5a860b9c8a6a 1 /**
EricLew 9:5a860b9c8a6a 2 ******************************************************************************
EricLew 9:5a860b9c8a6a 3 * @file stm32l476g_discovery_audio.h
EricLew 9:5a860b9c8a6a 4 * @author MCD Application Team
EricLew 9:5a860b9c8a6a 5 * @version V1.0.1
EricLew 9:5a860b9c8a6a 6 * @date 16-September-2015
EricLew 9:5a860b9c8a6a 7 * @brief This file contains the common defines and functions prototypes for
EricLew 9:5a860b9c8a6a 8 * the stm32l476g_discovery_audio.c driver.
EricLew 9:5a860b9c8a6a 9 ******************************************************************************
EricLew 9:5a860b9c8a6a 10 * @attention
EricLew 9:5a860b9c8a6a 11 *
EricLew 9:5a860b9c8a6a 12 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
EricLew 9:5a860b9c8a6a 13 *
EricLew 9:5a860b9c8a6a 14 * Redistribution and use in source and binary forms, with or without modification,
EricLew 9:5a860b9c8a6a 15 * are permitted provided that the following conditions are met:
EricLew 9:5a860b9c8a6a 16 * 1. Redistributions of source code must retain the above copyright notice,
EricLew 9:5a860b9c8a6a 17 * this list of conditions and the following disclaimer.
EricLew 9:5a860b9c8a6a 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
EricLew 9:5a860b9c8a6a 19 * this list of conditions and the following disclaimer in the documentation
EricLew 9:5a860b9c8a6a 20 * and/or other materials provided with the distribution.
EricLew 9:5a860b9c8a6a 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
EricLew 9:5a860b9c8a6a 22 * may be used to endorse or promote products derived from this software
EricLew 9:5a860b9c8a6a 23 * without specific prior written permission.
EricLew 9:5a860b9c8a6a 24 *
EricLew 9:5a860b9c8a6a 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
EricLew 9:5a860b9c8a6a 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
EricLew 9:5a860b9c8a6a 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
EricLew 9:5a860b9c8a6a 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
EricLew 9:5a860b9c8a6a 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
EricLew 9:5a860b9c8a6a 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
EricLew 9:5a860b9c8a6a 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
EricLew 9:5a860b9c8a6a 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
EricLew 9:5a860b9c8a6a 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
EricLew 9:5a860b9c8a6a 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
EricLew 9:5a860b9c8a6a 35 *
EricLew 9:5a860b9c8a6a 36 ******************************************************************************
EricLew 9:5a860b9c8a6a 37 */
EricLew 9:5a860b9c8a6a 38
EricLew 9:5a860b9c8a6a 39 /* Define to prevent recursive inclusion -------------------------------------*/
EricLew 9:5a860b9c8a6a 40 #ifndef __STM32L476G_DISCOVERY_AUDIO_H
EricLew 9:5a860b9c8a6a 41 #define __STM32L476G_DISCOVERY_AUDIO_H
EricLew 9:5a860b9c8a6a 42
EricLew 9:5a860b9c8a6a 43
EricLew 9:5a860b9c8a6a 44 /* Includes ------------------------------------------------------------------*/
EricLew 9:5a860b9c8a6a 45
EricLew 9:5a860b9c8a6a 46 #include <string.h>
EricLew 9:5a860b9c8a6a 47 #include <stdlib.h>
EricLew 9:5a860b9c8a6a 48 #include "mbed.h"
EricLew 9:5a860b9c8a6a 49 #include "main.h"
EricLew 9:5a860b9c8a6a 50 /* Include audio component Driver */
EricLew 9:5a860b9c8a6a 51
EricLew 9:5a860b9c8a6a 52 //#include "stm32l476g_discovery.h"
EricLew 9:5a860b9c8a6a 53
EricLew 9:5a860b9c8a6a 54 /** @addtogroup BSP
EricLew 9:5a860b9c8a6a 55 * @{
EricLew 9:5a860b9c8a6a 56 */
EricLew 9:5a860b9c8a6a 57
EricLew 9:5a860b9c8a6a 58 /** @addtogroup STM32L476G_DISCOVERY
EricLew 9:5a860b9c8a6a 59 * @{
EricLew 9:5a860b9c8a6a 60 */
EricLew 9:5a860b9c8a6a 61
EricLew 9:5a860b9c8a6a 62 /** @addtogroup STM32L476G_DISCOVERY_AUDIO
EricLew 9:5a860b9c8a6a 63 * @{
EricLew 9:5a860b9c8a6a 64 */
EricLew 9:5a860b9c8a6a 65
EricLew 9:5a860b9c8a6a 66 /** @defgroup STM32L476G_DISCOVERY_AUDIO_Exported_Types Exported Types
EricLew 9:5a860b9c8a6a 67 * @{
EricLew 9:5a860b9c8a6a 68 */
EricLew 9:5a860b9c8a6a 69 typedef void (*Audio_CallbackTypeDef)(void);
EricLew 9:5a860b9c8a6a 70
EricLew 9:5a860b9c8a6a 71 /**
EricLew 9:5a860b9c8a6a 72 * @}
EricLew 9:5a860b9c8a6a 73 */
EricLew 9:5a860b9c8a6a 74
EricLew 9:5a860b9c8a6a 75 /** @defgroup STM32L476G_DISCOVERY_AUDIO_Exported_Constants Exported Constants
EricLew 9:5a860b9c8a6a 76 * @{
EricLew 9:5a860b9c8a6a 77 */
EricLew 9:5a860b9c8a6a 78 /** @defgroup BSP_Audio_Out_Option BSP Audio Out Option
EricLew 9:5a860b9c8a6a 79 * @{
EricLew 9:5a860b9c8a6a 80 */
EricLew 9:5a860b9c8a6a 81 #define BSP_AUDIO_OUT_CIRCULARMODE ((uint32_t)0x00000001) /* BUFFER CIRCULAR MODE */
EricLew 9:5a860b9c8a6a 82 #define BSP_AUDIO_OUT_NORMALMODE ((uint32_t)0x00000002) /* BUFFER NORMAL MODE */
EricLew 9:5a860b9c8a6a 83 #define BSP_AUDIO_OUT_STEREOMODE ((uint32_t)0x00000004) /* STEREO MODE */
EricLew 9:5a860b9c8a6a 84 #define BSP_AUDIO_OUT_MONOMODE ((uint32_t)0x00000008) /* MONO MODE */
EricLew 9:5a860b9c8a6a 85 /**
EricLew 9:5a860b9c8a6a 86 * @}
EricLew 9:5a860b9c8a6a 87 */
EricLew 9:5a860b9c8a6a 88
EricLew 9:5a860b9c8a6a 89 /** @defgroup BSP_Audio_Sample_Rate BSP Audio Sample Rate
EricLew 9:5a860b9c8a6a 90 * @{
EricLew 9:5a860b9c8a6a 91 */
EricLew 9:5a860b9c8a6a 92 #define BSP_AUDIO_FREQUENCY_96K SAI_AUDIO_FREQUENCY_96K
EricLew 9:5a860b9c8a6a 93 #define BSP_AUDIO_FREQUENCY_48K SAI_AUDIO_FREQUENCY_48K
EricLew 9:5a860b9c8a6a 94 #define BSP_AUDIO_FREQUENCY_44K SAI_AUDIO_FREQUENCY_44K
EricLew 9:5a860b9c8a6a 95 #define BSP_AUDIO_FREQUENCY_32K SAI_AUDIO_FREQUENCY_32K
EricLew 9:5a860b9c8a6a 96 #define BSP_AUDIO_FREQUENCY_22K SAI_AUDIO_FREQUENCY_22K
EricLew 9:5a860b9c8a6a 97 #define BSP_AUDIO_FREQUENCY_16K SAI_AUDIO_FREQUENCY_16K
EricLew 9:5a860b9c8a6a 98 #define BSP_AUDIO_FREQUENCY_11K SAI_AUDIO_FREQUENCY_11K
EricLew 9:5a860b9c8a6a 99 #define BSP_AUDIO_FREQUENCY_8K SAI_AUDIO_FREQUENCY_8K
EricLew 9:5a860b9c8a6a 100 /**
EricLew 9:5a860b9c8a6a 101 * @}
EricLew 9:5a860b9c8a6a 102 */
EricLew 9:5a860b9c8a6a 103
EricLew 9:5a860b9c8a6a 104 /* AUDIO FREQUENCY */
EricLew 9:5a860b9c8a6a 105 #define AUDIO_FREQUENCY_192K ((uint32_t)192000)
EricLew 9:5a860b9c8a6a 106 #define AUDIO_FREQUENCY_96K ((uint32_t)96000)
EricLew 9:5a860b9c8a6a 107 #define AUDIO_FREQUENCY_48K ((uint32_t)48000)
EricLew 9:5a860b9c8a6a 108 #define AUDIO_FREQUENCY_44K ((uint32_t)44100)
EricLew 9:5a860b9c8a6a 109 #define AUDIO_FREQUENCY_32K ((uint32_t)32000)
EricLew 9:5a860b9c8a6a 110 #define AUDIO_FREQUENCY_22K ((uint32_t)22050)
EricLew 9:5a860b9c8a6a 111 #define AUDIO_FREQUENCY_16K ((uint32_t)16000)
EricLew 9:5a860b9c8a6a 112 #define AUDIO_FREQUENCY_11K ((uint32_t)11025)
EricLew 9:5a860b9c8a6a 113 #define AUDIO_FREQUENCY_8K ((uint32_t)8000)
EricLew 9:5a860b9c8a6a 114
EricLew 9:5a860b9c8a6a 115 /*------------------------------------------------------------------------------
EricLew 9:5a860b9c8a6a 116 USER SAI defines parameters
EricLew 9:5a860b9c8a6a 117 -----------------------------------------------------------------------------*/
EricLew 9:5a860b9c8a6a 118 /* SAI peripheral configuration defines */
EricLew 9:5a860b9c8a6a 119 #define AUDIO_SAIx SAI1_Block_A
EricLew 9:5a860b9c8a6a 120 #define AUDIO_SAIx_CLK_ENABLE() __HAL_RCC_SAI1_CLK_ENABLE()
EricLew 9:5a860b9c8a6a 121 #define AUDIO_SAIx_CLK_DISABLE() __HAL_RCC_SAI1_CLK_DISABLE()
EricLew 9:5a860b9c8a6a 122 #define AUDIO_SAIx_MCK_SCK_SD_FS_AF GPIO_AF13_SAI1
EricLew 9:5a860b9c8a6a 123
EricLew 9:5a860b9c8a6a 124 #define AUDIO_SAIx_MCK_SCK_SD_FS_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
EricLew 9:5a860b9c8a6a 125 #define AUDIO_SAIx_MCK_SCK_SD_FS_DISABLE() __HAL_RCC_GPIOE_CLK_DISABLE()
EricLew 9:5a860b9c8a6a 126 #define AUDIO_SAIx_FS_PIN GPIO_PIN_4
EricLew 9:5a860b9c8a6a 127 #define AUDIO_SAIx_SCK_PIN GPIO_PIN_5
EricLew 9:5a860b9c8a6a 128 #define AUDIO_SAIx_SD_PIN GPIO_PIN_6
EricLew 9:5a860b9c8a6a 129 #define AUDIO_SAIx_MCK_PIN GPIO_PIN_2
EricLew 9:5a860b9c8a6a 130 #define AUDIO_SAIx_MCK_SCK_SD_FS_GPIO_PORT GPIOE
EricLew 9:5a860b9c8a6a 131
EricLew 9:5a860b9c8a6a 132 /* SAI DMA Channel definitions */
EricLew 9:5a860b9c8a6a 133 #define AUDIO_SAIx_DMAx_CLK_ENABLE() __HAL_RCC_DMA2_CLK_ENABLE()
EricLew 9:5a860b9c8a6a 134 #define AUDIO_SAIx_DMAx_CLK_DISABLE() __HAL_RCC_DMA2_CLK_DISABLE()
EricLew 9:5a860b9c8a6a 135 #define AUDIO_SAIx_DMAx_CHANNEL DMA2_Channel1
EricLew 9:5a860b9c8a6a 136 #define AUDIO_SAIx_DMAx_IRQ DMA2_Channel1_IRQn
EricLew 9:5a860b9c8a6a 137 #define AUDIO_SAIx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_HALFWORD
EricLew 9:5a860b9c8a6a 138 #define AUDIO_SAIx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_HALFWORD
EricLew 9:5a860b9c8a6a 139 #define DMA_MAX_SZE (uint32_t)0xFFFF
EricLew 9:5a860b9c8a6a 140
EricLew 9:5a860b9c8a6a 141 #define AUDIO_SAIx_DMAx_IRQHandler DMA2_Channel1_IRQHandler
EricLew 9:5a860b9c8a6a 142
EricLew 9:5a860b9c8a6a 143 /* Select the interrupt preemption priority for the DMA interrupt */
EricLew 9:5a860b9c8a6a 144 #define AUDIO_OUT_IRQ_PREPRIO 5 /* Select the preemption priority level(0 is the highest) */
EricLew 9:5a860b9c8a6a 145
EricLew 9:5a860b9c8a6a 146 /* Disable SAIx PLL */
EricLew 9:5a860b9c8a6a 147 #define AUDIO_SAIx_PLL_DISABLE() HAL_RCCEx_DisablePLLSAI1()
EricLew 9:5a860b9c8a6a 148
EricLew 9:5a860b9c8a6a 149 /*------------------------------------------------------------------------------
EricLew 9:5a860b9c8a6a 150 AUDIO IN CONFIGURATION
EricLew 9:5a860b9c8a6a 151 ------------------------------------------------------------------------------*/
EricLew 9:5a860b9c8a6a 152 /* DFSDM Configuration defines */
EricLew 9:5a860b9c8a6a 153 #define AUDIO_DFSDMx_LEFT_CHANNEL DFSDM_Channel2
EricLew 9:5a860b9c8a6a 154 #define AUDIO_DFSDMx_LEFT_FILTER DFSDM_Filter0
EricLew 9:5a860b9c8a6a 155 #define AUDIO_DFSDMx_CLK_ENABLE() __HAL_RCC_DFSDM_CLK_ENABLE()
EricLew 9:5a860b9c8a6a 156 #define AUDIO_DFSDMx_CLK_DISABLE() __HAL_RCC_DFSDM_CLK_DISABLE()
EricLew 9:5a860b9c8a6a 157 #define AUDIO_DFSDMx_CKOUT_PIN GPIO_PIN_9
EricLew 9:5a860b9c8a6a 158 #define AUDIO_DFSDMx_DMIC_DATIN_PIN GPIO_PIN_7
EricLew 9:5a860b9c8a6a 159 #define AUDIO_DFSDMx_CKOUT_DMIC_DATIN_GPIO_PORT GPIOE
EricLew 9:5a860b9c8a6a 160 #define AUDIO_DFSDMx_CKOUT_DMIC_DATIN_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
EricLew 9:5a860b9c8a6a 161 #define AUDIO_DFSDMx_CKOUT_DMIC_DATIN_GPIO_CLK_DISABLE() __HAL_RCC_GPIOE_CLK_DISABLE()
EricLew 9:5a860b9c8a6a 162 #define AUDIO_DFSDMx_CKOUT_DMIC_DATIN_AF GPIO_AF6_DFSDM
EricLew 9:5a860b9c8a6a 163
EricLew 9:5a860b9c8a6a 164 /* DFSDM DMA Right and Left channels definitions */
EricLew 9:5a860b9c8a6a 165 #define AUDIO_DFSDMx_DMAx_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE()
EricLew 9:5a860b9c8a6a 166 #define AUDIO_DFSDMx_DMAx_CLK_DISABLE() __HAL_RCC_DMA1_CLK_DISABLE()
EricLew 9:5a860b9c8a6a 167 #define AUDIO_DFSDMx_DMAx_LEFT_CHANNEL DMA1_Channel4
EricLew 9:5a860b9c8a6a 168 #define AUDIO_DFSDMx_DMAx_LEFT_IRQ DMA1_Channel4_IRQn
EricLew 9:5a860b9c8a6a 169 #define AUDIO_DFSDMx_DMAx_PERIPH_DATA_SIZE DMA_PDATAALIGN_WORD
EricLew 9:5a860b9c8a6a 170 #define AUDIO_DFSDMx_DMAx_MEM_DATA_SIZE DMA_MDATAALIGN_WORD
EricLew 9:5a860b9c8a6a 171
EricLew 9:5a860b9c8a6a 172 #define AUDIO_DFSDM_DMAx_LEFT_IRQHandler DMA1_Channel4_IRQHandler
EricLew 9:5a860b9c8a6a 173
EricLew 9:5a860b9c8a6a 174 /* Select the interrupt preemption priority and subpriority for the IT/DMA interrupt */
EricLew 9:5a860b9c8a6a 175 #define AUDIO_IN_IRQ_PREPRIO 6 /* Select the preemption priority level(0 is the highest) */
EricLew 9:5a860b9c8a6a 176
EricLew 9:5a860b9c8a6a 177 /*------------------------------------------------------------------------------
EricLew 9:5a860b9c8a6a 178 CONFIGURATION: Audio Driver Configuration parameters
EricLew 9:5a860b9c8a6a 179 ------------------------------------------------------------------------------*/
EricLew 9:5a860b9c8a6a 180
EricLew 9:5a860b9c8a6a 181 #define AUDIODATA_SIZE 2 /* 16-bits audio data size */
EricLew 9:5a860b9c8a6a 182
EricLew 9:5a860b9c8a6a 183 /* Audio status definition */
EricLew 9:5a860b9c8a6a 184 #define AUDIO_OK 0
EricLew 9:5a860b9c8a6a 185 #define AUDIO_ERROR 1
EricLew 9:5a860b9c8a6a 186 #define AUDIO_TIMEOUT 2
EricLew 9:5a860b9c8a6a 187
EricLew 9:5a860b9c8a6a 188 /* AudioFreq * DataSize (2 bytes) * NumChannels (Stereo: 2) */
EricLew 9:5a860b9c8a6a 189 #define DEFAULT_AUDIO_IN_FREQ BSP_AUDIO_FREQUENCY_16K
EricLew 9:5a860b9c8a6a 190 #define DEFAULT_AUDIO_IN_BIT_RESOLUTION 16
EricLew 9:5a860b9c8a6a 191 #define DEFAULT_AUDIO_IN_CHANNEL_NBR 1 /* Mono = 1, Stereo = 2 */
EricLew 9:5a860b9c8a6a 192 #define DEFAULT_AUDIO_IN_VOLUME 64
EricLew 9:5a860b9c8a6a 193
EricLew 9:5a860b9c8a6a 194 /*------------------------------------------------------------------------------
EricLew 9:5a860b9c8a6a 195 OPTIONAL Configuration defines parameters
EricLew 9:5a860b9c8a6a 196 ------------------------------------------------------------------------------*/
EricLew 9:5a860b9c8a6a 197
EricLew 9:5a860b9c8a6a 198 /* Delay for the Codec to be correctly reset */
EricLew 9:5a860b9c8a6a 199 #define CODEC_RESET_DELAY 5
EricLew 9:5a860b9c8a6a 200
EricLew 9:5a860b9c8a6a 201 typedef enum
EricLew 9:5a860b9c8a6a 202 {
EricLew 9:5a860b9c8a6a 203 BUFFER_OFFSET_NONE = 0,
EricLew 9:5a860b9c8a6a 204 BUFFER_OFFSET_HALF,
EricLew 9:5a860b9c8a6a 205 BUFFER_OFFSET_FULL,
EricLew 9:5a860b9c8a6a 206 } RecordBufferOffset_Typedef;
EricLew 9:5a860b9c8a6a 207
EricLew 9:5a860b9c8a6a 208
EricLew 9:5a860b9c8a6a 209 /**
EricLew 9:5a860b9c8a6a 210 * @}
EricLew 9:5a860b9c8a6a 211 */
EricLew 9:5a860b9c8a6a 212
EricLew 9:5a860b9c8a6a 213 /** @defgroup STM32L476G_DISCOVERY_AUDIO_Exported_Variables Exported Variables
EricLew 9:5a860b9c8a6a 214 * @{
EricLew 9:5a860b9c8a6a 215 */
EricLew 9:5a860b9c8a6a 216 extern SAI_HandleTypeDef BSP_AUDIO_hSai;
EricLew 9:5a860b9c8a6a 217 extern DFSDM_Filter_HandleTypeDef BSP_AUDIO_hDfsdmLeftFilter;
EricLew 9:5a860b9c8a6a 218
EricLew 9:5a860b9c8a6a 219
EricLew 9:5a860b9c8a6a 220 extern RecordBufferOffset_Typedef RecordBufferOffset;
EricLew 9:5a860b9c8a6a 221
EricLew 9:5a860b9c8a6a 222 /**
EricLew 9:5a860b9c8a6a 223 * @}
EricLew 9:5a860b9c8a6a 224 */
EricLew 9:5a860b9c8a6a 225
EricLew 9:5a860b9c8a6a 226 /** @defgroup STM32L476G_DISCOVERY_AUDIO_Exported_Macros Exported Macros
EricLew 9:5a860b9c8a6a 227 * @{
EricLew 9:5a860b9c8a6a 228 */
EricLew 9:5a860b9c8a6a 229 #define DMA_MAX(_X_) (((_X_) <= DMA_MAX_SZE)? (_X_):DMA_MAX_SZE)
EricLew 9:5a860b9c8a6a 230
EricLew 9:5a860b9c8a6a 231 /**
EricLew 9:5a860b9c8a6a 232 * @}
EricLew 9:5a860b9c8a6a 233 */
EricLew 9:5a860b9c8a6a 234
EricLew 9:5a860b9c8a6a 235 /* Exported functions --------------------------------------------------------*/
EricLew 9:5a860b9c8a6a 236 /** @defgroup STM32L476G_DISCOVERY_AUDIO_Exported_Functions Exported Functions
EricLew 9:5a860b9c8a6a 237 * @{
EricLew 9:5a860b9c8a6a 238 */
EricLew 9:5a860b9c8a6a 239 uint8_t BSP_AUDIO_OUT_Init(uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq);
EricLew 9:5a860b9c8a6a 240 uint8_t BSP_AUDIO_OUT_DeInit(void);
EricLew 9:5a860b9c8a6a 241 uint8_t BSP_AUDIO_OUT_Play(uint16_t* pData, uint32_t Size);
EricLew 9:5a860b9c8a6a 242 uint8_t BSP_AUDIO_OUT_ChangeBuffer(uint16_t *pData, uint16_t Size);
EricLew 9:5a860b9c8a6a 243 uint8_t BSP_AUDIO_OUT_Pause(void);
EricLew 9:5a860b9c8a6a 244 uint8_t BSP_AUDIO_OUT_Resume(void);
EricLew 9:5a860b9c8a6a 245 uint8_t BSP_AUDIO_OUT_Stop(uint32_t Option);
EricLew 9:5a860b9c8a6a 246 uint8_t BSP_AUDIO_OUT_SetVolume(uint8_t Volume);
EricLew 9:5a860b9c8a6a 247 uint8_t BSP_AUDIO_OUT_SetFrequency(uint32_t AudioFreq);
EricLew 9:5a860b9c8a6a 248 void BSP_AUDIO_OUT_ChangeAudioConfig(uint32_t AudioOutOption);
EricLew 9:5a860b9c8a6a 249 uint8_t BSP_AUDIO_OUT_SetMute(uint32_t Cmd);
EricLew 9:5a860b9c8a6a 250 uint8_t BSP_AUDIO_OUT_SetOutputMode(uint8_t Output);
EricLew 9:5a860b9c8a6a 251 void BSP_AUDIO_OUT_RegisterCallbacks(Audio_CallbackTypeDef ErrorCallback,
EricLew 9:5a860b9c8a6a 252 Audio_CallbackTypeDef HalfTransferCallback,
EricLew 9:5a860b9c8a6a 253 Audio_CallbackTypeDef TransferCompleteCallback);
EricLew 9:5a860b9c8a6a 254
EricLew 9:5a860b9c8a6a 255 uint8_t BSP_AUDIO_IN_Init(uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr);
EricLew 9:5a860b9c8a6a 256 uint8_t BSP_AUDIO_IN_DeInit(void);
EricLew 9:5a860b9c8a6a 257 uint8_t BSP_AUDIO_IN_Record(uint16_t *pData, uint32_t Size);
EricLew 9:5a860b9c8a6a 258 uint8_t BSP_AUDIO_IN_SetFrequency(uint32_t AudioFreq);
EricLew 9:5a860b9c8a6a 259 uint8_t BSP_AUDIO_IN_Stop(void);
EricLew 9:5a860b9c8a6a 260 uint8_t BSP_AUDIO_IN_Pause(void);
EricLew 9:5a860b9c8a6a 261 uint8_t BSP_AUDIO_IN_Resume(void);
EricLew 9:5a860b9c8a6a 262 void BSP_AUDIO_IN_RegisterCallbacks(Audio_CallbackTypeDef ErrorCallback,
EricLew 9:5a860b9c8a6a 263 Audio_CallbackTypeDef HalfTransferCallback,
EricLew 9:5a860b9c8a6a 264 Audio_CallbackTypeDef TransferCompleteCallback);
EricLew 9:5a860b9c8a6a 265
EricLew 9:5a860b9c8a6a 266
EricLew 9:5a860b9c8a6a 267 /* Audio recorder callback functions */
EricLew 9:5a860b9c8a6a 268 static void AudioRecord_TransferComplete_CallBack(void);
EricLew 9:5a860b9c8a6a 269 static void AudioRecord_HalfTransfer_CallBack(void);
EricLew 9:5a860b9c8a6a 270 static void AudioRecord_Error_CallBack(void);
EricLew 9:5a860b9c8a6a 271
EricLew 9:5a860b9c8a6a 272 // uint16_t getDMAState(void);
EricLew 9:5a860b9c8a6a 273 // uint16_t getSPIState(void);
EricLew 9:5a860b9c8a6a 274 // bool getSPIFlagStatus(uint16_t flag);
EricLew 9:5a860b9c8a6a 275
EricLew 9:5a860b9c8a6a 276 /**
EricLew 9:5a860b9c8a6a 277 * @}
EricLew 9:5a860b9c8a6a 278 */
EricLew 9:5a860b9c8a6a 279
EricLew 9:5a860b9c8a6a 280 /**
EricLew 9:5a860b9c8a6a 281 * @}
EricLew 9:5a860b9c8a6a 282 */
EricLew 9:5a860b9c8a6a 283
EricLew 9:5a860b9c8a6a 284 /**
EricLew 9:5a860b9c8a6a 285 * @}
EricLew 9:5a860b9c8a6a 286 */
EricLew 9:5a860b9c8a6a 287
EricLew 9:5a860b9c8a6a 288 /**
EricLew 9:5a860b9c8a6a 289 * @}
EricLew 9:5a860b9c8a6a 290 */
EricLew 9:5a860b9c8a6a 291
EricLew 9:5a860b9c8a6a 292
EricLew 9:5a860b9c8a6a 293 #endif /* __STM32L476G_DISCOVERY_AUDIO_H */
EricLew 9:5a860b9c8a6a 294
EricLew 9:5a860b9c8a6a 295 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
EricLew 9:5a860b9c8a6a 296
EricLew 9:5a860b9c8a6a 297