1 /** 2 ****************************************************************************** 3 * @file audio.h 4 * @author MCD Application Team 5 * @version V4.0.1 6 * @date 21-July-2015 7 * @brief This header file contains the common defines and functions prototypes 8 * for the Audio driver. 9 ****************************************************************************** 10 * @attention 11 * 12 * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> 13 * 14 * Redistribution and use in source and binary forms, with or without modification, 15 * are permitted provided that the following conditions are met: 16 * 1. Redistributions of source code must retain the above copyright notice, 17 * this list of conditions and the following disclaimer. 18 * 2. Redistributions in binary form must reproduce the above copyright notice, 19 * this list of conditions and the following disclaimer in the documentation 20 * and/or other materials provided with the distribution. 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors 22 * may be used to endorse or promote products derived from this software 23 * without specific prior written permission. 24 * 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 * 36 ****************************************************************************** 37 */ 38 39 /* Define to prevent recursive inclusion -------------------------------------*/ 40 #ifndef __AUDIO_H 41 #define __AUDIO_H 42 43 #ifdef __cplusplus 44 extern "C" { 45 #endif 46 47 /* Includes ------------------------------------------------------------------*/ 48 #include <stdint.h> 49 50 /** @addtogroup BSP 51 * @{ 52 */ 53 54 /** @addtogroup Components 55 * @{ 56 */ 57 58 /** @addtogroup AUDIO 59 * @{ 60 */ 61 62 /** @defgroup AUDIO_Exported_Constants 63 * @{ 64 */ 65 66 /* Codec audio Standards */ 67 #define CODEC_STANDARD 0x04 68 #define I2S_STANDARD I2S_STANDARD_PHILIPS 69 70 /** 71 * @} 72 */ 73 74 /** @defgroup AUDIO_Exported_Types 75 * @{ 76 */ 77 78 /** @defgroup AUDIO_Driver_structure Audio Driver structure 79 * @{ 80 */ 81 typedef struct 82 { 83 uint32_t (*Init)(uint16_t, uint16_t, uint8_t, uint32_t); 84 void (*DeInit)(void); 85 uint32_t (*ReadID)(uint16_t); 86 uint32_t (*Play)(uint16_t, uint16_t*, uint16_t); 87 uint32_t (*Pause)(uint16_t); 88 uint32_t (*Resume)(uint16_t); 89 uint32_t (*Stop)(uint16_t, uint32_t); 90 uint32_t (*SetFrequency)(uint16_t, uint32_t); 91 uint32_t (*SetVolume)(uint16_t, uint8_t); 92 uint32_t (*SetMute)(uint16_t, uint32_t); 93 uint32_t (*SetOutputMode)(uint16_t, uint8_t); 94 uint32_t (*Reset)(uint16_t); 95 }AUDIO_DrvTypeDef; 96 /** 97 * @} 98 */ 99 100 /** 101 * @} 102 */ 103 104 /** 105 * @} 106 */ 107 108 /** 109 * @} 110 */ 111 112 /** 113 * @} 114 */ 115 116 #ifdef __cplusplus 117 } 118 #endif 119 120 #endif /* __AUDIO_H */ 121 122 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 123