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