Team Riedel - display
Dependencies: LCD_fonts SPI_TFT_ILI9341 CMSIS_DSP_401_without_cm4 mbed-src SDFileSystem wavfile
audio_if.h@9:5a860b9c8a6a, 2015-12-13 (annotated)
- Committer:
- EricLew
- Date:
- Sun Dec 13 16:46:14 2015 +0000
- Revision:
- 9:5a860b9c8a6a
Added DFSDM core functionality
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
EricLew | 9:5a860b9c8a6a | 1 | /** |
EricLew | 9:5a860b9c8a6a | 2 | ****************************************************************************** |
EricLew | 9:5a860b9c8a6a | 3 | * @file /Inc/audio_if.h |
EricLew | 9:5a860b9c8a6a | 4 | * @author Central Labs |
EricLew | 9:5a860b9c8a6a | 5 | * @version V1.0.0 |
EricLew | 9:5a860b9c8a6a | 6 | * @date 7-May-2015 |
EricLew | 9:5a860b9c8a6a | 7 | * @brief Header for audio_if.c file. |
EricLew | 9:5a860b9c8a6a | 8 | ****************************************************************************** |
EricLew | 9:5a860b9c8a6a | 9 | @attention |
EricLew | 9:5a860b9c8a6a | 10 | * |
EricLew | 9:5a860b9c8a6a | 11 | * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> |
EricLew | 9:5a860b9c8a6a | 12 | * |
EricLew | 9:5a860b9c8a6a | 13 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); |
EricLew | 9:5a860b9c8a6a | 14 | * You may not use this file except in compliance with the License. |
EricLew | 9:5a860b9c8a6a | 15 | * You may obtain a copy of the License at: |
EricLew | 9:5a860b9c8a6a | 16 | * |
EricLew | 9:5a860b9c8a6a | 17 | * http://www.st.com/software_license_agreement_liberty_v2 |
EricLew | 9:5a860b9c8a6a | 18 | * |
EricLew | 9:5a860b9c8a6a | 19 | * Redistribution and use in source and binary forms, with or without modification, |
EricLew | 9:5a860b9c8a6a | 20 | * are permitted provided that the following conditions are met: |
EricLew | 9:5a860b9c8a6a | 21 | * 1. Redistributions of source code must retain the above copyright notice, |
EricLew | 9:5a860b9c8a6a | 22 | * this list of conditions and the following disclaimer. |
EricLew | 9:5a860b9c8a6a | 23 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
EricLew | 9:5a860b9c8a6a | 24 | * this list of conditions and the following disclaimer in the documentation |
EricLew | 9:5a860b9c8a6a | 25 | * and/or other materials provided with the distribution. |
EricLew | 9:5a860b9c8a6a | 26 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
EricLew | 9:5a860b9c8a6a | 27 | * may be used to endorse or promote products derived from this software |
EricLew | 9:5a860b9c8a6a | 28 | * without specific prior written permission. |
EricLew | 9:5a860b9c8a6a | 29 | * |
EricLew | 9:5a860b9c8a6a | 30 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
EricLew | 9:5a860b9c8a6a | 31 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
EricLew | 9:5a860b9c8a6a | 32 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
EricLew | 9:5a860b9c8a6a | 33 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
EricLew | 9:5a860b9c8a6a | 34 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
EricLew | 9:5a860b9c8a6a | 35 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
EricLew | 9:5a860b9c8a6a | 36 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
EricLew | 9:5a860b9c8a6a | 37 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
EricLew | 9:5a860b9c8a6a | 38 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
EricLew | 9:5a860b9c8a6a | 39 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
EricLew | 9:5a860b9c8a6a | 40 | * |
EricLew | 9:5a860b9c8a6a | 41 | ****************************************************************************** |
EricLew | 9:5a860b9c8a6a | 42 | */ |
EricLew | 9:5a860b9c8a6a | 43 | |
EricLew | 9:5a860b9c8a6a | 44 | /* Define to prevent recursive inclusion -------------------------------------*/ |
EricLew | 9:5a860b9c8a6a | 45 | #ifndef __AUDIO_IF_H |
EricLew | 9:5a860b9c8a6a | 46 | #define __AUDIO_IF_H |
EricLew | 9:5a860b9c8a6a | 47 | |
EricLew | 9:5a860b9c8a6a | 48 | /* Includes ------------------------------------------------------------------*/ |
EricLew | 9:5a860b9c8a6a | 49 | #include "mbed.h" |
EricLew | 9:5a860b9c8a6a | 50 | #include "main.h" |
EricLew | 9:5a860b9c8a6a | 51 | //#include "x_nucleo_cca02m1_audio_l4.h" |
EricLew | 9:5a860b9c8a6a | 52 | #include "stm32l476g_discovery_audio.h" |
EricLew | 9:5a860b9c8a6a | 53 | #include <cstdint> |
EricLew | 9:5a860b9c8a6a | 54 | |
EricLew | 9:5a860b9c8a6a | 55 | |
EricLew | 9:5a860b9c8a6a | 56 | /* Exported types ------------------------------------------------------------*/ |
EricLew | 9:5a860b9c8a6a | 57 | /* Exported constants --------------------------------------------------------*/ |
EricLew | 9:5a860b9c8a6a | 58 | /* Exported macro ------------------------------------------------------------*/ |
EricLew | 9:5a860b9c8a6a | 59 | /* Exported functions ------------------------------------------------------- */ |
EricLew | 9:5a860b9c8a6a | 60 | |
EricLew | 9:5a860b9c8a6a | 61 | |
EricLew | 9:5a860b9c8a6a | 62 | extern int8_t Audio_Init(void); |
EricLew | 9:5a860b9c8a6a | 63 | extern int8_t Audio_Record(uint16_t * recbuff); |
EricLew | 9:5a860b9c8a6a | 64 | //extern int8_t Audio_VolumeCtl(int16_t Volume); |
EricLew | 9:5a860b9c8a6a | 65 | //extern int8_t Audio_MuteCtl(uint8_t cmd); |
EricLew | 9:5a860b9c8a6a | 66 | extern int8_t Audio_Stop(void); |
EricLew | 9:5a860b9c8a6a | 67 | //extern int8_t Audio_Pause(void); |
EricLew | 9:5a860b9c8a6a | 68 | //extern int8_t Audio_Resume(void); |
EricLew | 9:5a860b9c8a6a | 69 | //extern int8_t Audio_CommandMgr(uint8_t cmd); |
EricLew | 9:5a860b9c8a6a | 70 | //extern void AudioProcess(uint16_t * pbuf, uint16_t * recbuff); |
EricLew | 9:5a860b9c8a6a | 71 | extern void PrintData(uint16_t * recbuff); |
EricLew | 9:5a860b9c8a6a | 72 | extern void WriteData(uint16_t * recbuff); |
EricLew | 9:5a860b9c8a6a | 73 | //void BSP_AUDIO_IN_HalfTransfer_CallBack(void); |
EricLew | 9:5a860b9c8a6a | 74 | |
EricLew | 9:5a860b9c8a6a | 75 | int rec(const char *filename, uint16_t * recbuff, uint16_t size); |
EricLew | 9:5a860b9c8a6a | 76 | |
EricLew | 9:5a860b9c8a6a | 77 | /** |
EricLew | 9:5a860b9c8a6a | 78 | * @brief Sampling Frequency enumerator |
EricLew | 9:5a860b9c8a6a | 79 | */ |
EricLew | 9:5a860b9c8a6a | 80 | typedef enum |
EricLew | 9:5a860b9c8a6a | 81 | { |
EricLew | 9:5a860b9c8a6a | 82 | SAMPLING_FREQ_16000 = 16000, |
EricLew | 9:5a860b9c8a6a | 83 | SAMPLING_FREQ_32000 = 32000, |
EricLew | 9:5a860b9c8a6a | 84 | SAMPLING_FREQ_48000 = 48000 |
EricLew | 9:5a860b9c8a6a | 85 | |
EricLew | 9:5a860b9c8a6a | 86 | }OUTPUT_FREQ_TypeDef; |
EricLew | 9:5a860b9c8a6a | 87 | |
EricLew | 9:5a860b9c8a6a | 88 | |
EricLew | 9:5a860b9c8a6a | 89 | #define RAM_TOTAL 0x1000 |
EricLew | 9:5a860b9c8a6a | 90 | |
EricLew | 9:5a860b9c8a6a | 91 | #define AUDIO_CHANNELS 1 |
EricLew | 9:5a860b9c8a6a | 92 | #define AUDIO_SAMPLING_FREQUENCY 48000 |
EricLew | 9:5a860b9c8a6a | 93 | |
EricLew | 9:5a860b9c8a6a | 94 | #define PCM_TEMP_BUFF_SIZE AUDIO_SAMPLING_FREQUENCY/1000*1 |
EricLew | 9:5a860b9c8a6a | 95 | |
EricLew | 9:5a860b9c8a6a | 96 | |
EricLew | 9:5a860b9c8a6a | 97 | #if defined(STM32L053xx) || defined(STM32F072xB) |
EricLew | 9:5a860b9c8a6a | 98 | #if (AUDIO_CHANNELS > 2) |
EricLew | 9:5a860b9c8a6a | 99 | #error "Acquisition of more than 2 microphone is not yet supported for STM32L0 and STM32F0" |
EricLew | 9:5a860b9c8a6a | 100 | #elif (AUDIO_SAMPLING_FREQUENCY > 32000) |
EricLew | 9:5a860b9c8a6a | 101 | #error "Acquisition of sampling frequencies above 32 KHz is not yet supported for STM32L0 and STM32F0" |
EricLew | 9:5a860b9c8a6a | 102 | #elif (AUDIO_SAMPLING_FREQUENCY == 32000 && AUDIO_CHANNELS == 2) |
EricLew | 9:5a860b9c8a6a | 103 | #error "These settings are not yet supported for STM32L0 and STM32F0" |
EricLew | 9:5a860b9c8a6a | 104 | #endif |
EricLew | 9:5a860b9c8a6a | 105 | #endif |
EricLew | 9:5a860b9c8a6a | 106 | |
EricLew | 9:5a860b9c8a6a | 107 | #endif |
EricLew | 9:5a860b9c8a6a | 108 | /* __AUDIO_IF_H */ |
EricLew | 9:5a860b9c8a6a | 109 | |
EricLew | 9:5a860b9c8a6a | 110 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
EricLew | 9:5a860b9c8a6a | 111 |