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