Select one of the symbols to view example projects that use it.
 
Outline
#define __AUDIO_IF_H
#include "main.h"
Exported constants
#define AUDIO_OUT_BUFFER_SIZE
#define AUDIO_IN_BUFFER_SIZE
#define AUDIO_IN_PDM_BUFFER_SIZE
Exported types
IN_StateTypdef
BUFFER_StateTypeDef
OUT_StateTypdef
OUT_Process_t
WR_BUFFER_StateTypeDef
IN_Process_t
AUDIO_ProcessTypdef
WAV_InfoTypedef
AUDIO_IFTypeDef
pFunc
haudio;
AUDIO_IF_RegisterCallbacks(pFunc, pFunc, pFunc);
Files
loading...
CodeScopeSTM32 Libraries and SamplesSTemWinModules/Common/audio_if.h
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/** ****************************************************************************** * @file audioplayer_app.h * @author MCD Application Team * @brief header of audio player application file ****************************************************************************** * @attention * * Copyright (c) 2017 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** *//* ... */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __AUDIO_IF_H #define __AUDIO_IF_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "main.h" /* Exported constants --------------------------------------------------------*/ #define AUDIO_OUT_BUFFER_SIZE (24 * 1024) #define AUDIO_IN_BUFFER_SIZE (10 * 2304) /* buffer size in half-word */ #define AUDIO_IN_PDM_BUFFER_SIZE (INTERNAL_BUFF_SIZE) Exported constants/* Exported types ------------------------------------------------------------*/ /* Audio buffer control struct */ typedef enum { AUDIO_RECORDER_IDLE = 0, AUDIO_RECORDER_SUSPENDED = 1, AUDIO_RECORDER_RECORDING = 2, AUDIO_RECORDER_PLAYING = 3, AUDIO_RECORDER_RECORD_PAUSE = 4, AUDIO_RECORDER_PLAY_PAUSE = 5, AUDIO_RECORDER_RECORD_EOF = 6, AUDIO_RECORDER_PLAY_EOF = 7, AUDIO_RECORDER_ERROR = 0xFF, ...}IN_StateTypdef; typedef enum { BUFFER_OFFSET_NONE = 0, REC_BUFFER_OFFSET_HALF, REC_BUFFER_OFFSET_FULL, PLAY_BUFFER_OFFSET_HALF, PLAY_BUFFER_OFFSET_FULL, ...} BUFFER_StateTypeDef; typedef enum { AUDIOPLAYER_STOP = 0, AUDIOPLAYER_START, AUDIOPLAYER_PLAY, AUDIOPLAYER_PAUSE, AUDIOPLAYER_EOF, AUDIOPLAYER_ERROR, ...}OUT_StateTypdef; typedef struct { uint32_t volume; uint32_t mute; OUT_StateTypdef state; ...}OUT_Process_t; typedef enum { BUFFER_EMPTY = 0, BUFFER_FULL, ...}WR_BUFFER_StateTypeDef; typedef struct { uint32_t volume; uint32_t fptr; IN_StateTypdef state; ...}IN_Process_t; typedef struct { uint8_t buff[AUDIO_OUT_BUFFER_SIZE]; uint16_t pdm[AUDIO_IN_PDM_BUFFER_SIZE]; uint32_t ppcm; OUT_Process_t out; IN_Process_t in; ...}AUDIO_ProcessTypdef ; typedef struct { uint32_t ChunkID; /* 0 */ uint32_t FileSize; /* 4 */ uint32_t FileFormat; /* 8 */ uint32_t SubChunk1ID; /* 12 */ uint32_t SubChunk1Size; /* 16*/ uint16_t AudioFormat; /* 20 */ uint16_t NbrChannels; /* 22 */ uint32_t SampleRate; /* 24 */ uint32_t ByteRate; /* 28 */ uint16_t BlockAlign; /* 32 */ uint16_t BitPerSample; /* 34 */ uint32_t SubChunk2ID; /* 36 */ uint32_t SubChunk2Size; /* 40 */ ...}WAV_InfoTypedef ; typedef struct { void (*TransferComplete_CallBack)(void); void (*HalfTransfer_CallBack)(void); void (*Error_CallBack)(void); ...}AUDIO_IFTypeDef; typedef void (*pFunc)(void); Exported types /* Exported macros -----------------------------------------------------------*/ extern AUDIO_ProcessTypdef haudio; /* Exported functions ------------------------------------------------------- */ void AUDIO_IF_RegisterCallbacks(pFunc tc_cb, pFunc ht_cb, pFunc err_cb); #ifdef __cplusplus }extern "C" { ... } #endif /* ... */ #endif /*__AUDIO_IF_H */