FreeCalypso > hg > fc-magnetite
comparison src/cs/services/Audio/audio_const_i.h @ 0:945cf7f506b2
src/cs: chipsetsw import from tcs211-fcmodem
binary blobs and LCD demo files have been excluded,
all line endings are LF only
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 25 Sep 2016 22:50:11 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:945cf7f506b2 |
---|---|
1 /****************************************************************************/ | |
2 /* */ | |
3 /* File Name: audio_const_i.h */ | |
4 /* */ | |
5 /* Purpose: Internal constants used by AUDIO instance */ | |
6 /* */ | |
7 /* */ | |
8 /* Version 0.1 */ | |
9 /* */ | |
10 /* Date Modification */ | |
11 /* ------------------------------------ */ | |
12 /* 18 May 2001 Create */ | |
13 /* */ | |
14 /* Author Francois Mazard - Stephanie Gerthoux */ | |
15 /* */ | |
16 /* */ | |
17 /* (C) Copyright 2001 by Texas Instruments Incorporated, All Rights Reserved*/ | |
18 /****************************************************************************/ | |
19 | |
20 #include "rv/rv_defined_swe.h" | |
21 #include "l1_confg.h" | |
22 #ifdef RVM_AUDIO_MAIN_SWE | |
23 | |
24 #ifndef __AUDIO_CONST_I_H_ | |
25 #define __AUDIO_CONST_I_H_ | |
26 | |
27 #ifdef __cplusplus | |
28 extern "C" | |
29 { | |
30 #endif | |
31 | |
32 /* Dummy definition */ | |
33 #define MMI_QUEUE (0) | |
34 | |
35 /* Define a mask used to identify the events */ | |
36 #define AUDIO_EVENT_EXTERN (0x0C00) | |
37 #define AUDIO_EVENT_INTERN (0x0300) | |
38 | |
39 /* The FFS isn't activated: the audio task run without any time out */ | |
40 #define AUDIO_NOT_TIME_OUT (0) | |
41 | |
42 /* The FFS downloader is waked up by a timer */ | |
43 #define AUDIO_FFS_TIMER (RVF_TIMER_0) | |
44 | |
45 /* The audio entity process only the message send to the following mail box */ | |
46 #define AUDIO_MBOX (RVF_TASK_MBOX_0) | |
47 | |
48 /* The FFS manager start only with a message */ | |
49 #define AUDIO_FFS_MBOX (RVF_TASK_MBOX_0) | |
50 | |
51 /* The audio entity takes into account only the following events: */ | |
52 #define AUDIO_TASK_MBOX_EVT_MASK (RVF_TASK_MBOX_0_EVT_MASK) | |
53 #define AUDIO_FFS_TIMER_EVT_MASK (RVF_TIMER_0_EVT_MASK) | |
54 | |
55 // simulator's events | |
56 #define AUDIO_MIDI_L1_SIMUL_TIMER (RVF_TIMER_1) | |
57 #define AUDIO_MIDI_L1_SIMUL_TIMER_EVT_MASK (RVF_TIMER_1_EVT_MASK) | |
58 #define AUDIO_MIDI_L1_SIMUL_ONE_SHOT_TIMER (FALSE) | |
59 | |
60 /* The audio entity wait all event type */ | |
61 #define AUDIO_ALL_EVENT_FLAGS (0xFFFF) | |
62 | |
63 #if (KEYBEEP) | |
64 /* Define all the state of the Audio Keepbeep State Machine */ | |
65 #define AUDIO_KEYBEEP_IDLE (1) | |
66 #define AUDIO_KEYBEEP_WAIT_START_CON (2) | |
67 #define AUDIO_KEYBEEP_WAIT_STOP_COMMAND (3) | |
68 #define AUDIO_KEYBEEP_WAIT_START_CON_TO_STOP (4) | |
69 #define AUDIO_KEYBEEP_WAIT_STOP_CON (5) | |
70 #endif | |
71 | |
72 #if (TONE) | |
73 /* Define all the state of the Audio Tones State Machine */ | |
74 #define AUDIO_TONES_IDLE (1) | |
75 #define AUDIO_TONES_WAIT_START_CON (2) | |
76 #define AUDIO_TONES_WAIT_STOP_COMMAND (3) | |
77 #define AUDIO_TONES_WAIT_START_CON_TO_STOP (4) | |
78 #define AUDIO_TONES_WAIT_STOP_CON (5) | |
79 #endif | |
80 | |
81 #if (KEYBEEP) || (TONE) || (VOICE_MEMO) | |
82 /* Definition of the minimum and maximum of each parameter */ | |
83 #define FREQUENCY_BEEP_MIN (0) /* Hz */ | |
84 #define FREQUENCY_BEEP_MAX (2000) /* Hz */ | |
85 #define AMPLITUDE_BEEP_MIN (-48) /* dB */ | |
86 #define AMPLITUDE_BEEP_MAX (0) /* dB */ | |
87 #define DURATION_BEEP_MIN (20) | |
88 #endif | |
89 | |
90 #if (MELODY_E1) | |
91 /* Define all the state of the Audio Melody_E1 number 0 State Machine */ | |
92 #define AUDIO_MELODY_E1_IDLE (1) | |
93 #define AUDIO_MELODY_E1_WAIT_INIT_FFS (2) | |
94 #define AUDIO_MELODY_E1_WAIT_START_CON (3) | |
95 #define AUDIO_MELODY_E1_WAIT_STOP_COMMAND (4) | |
96 #define AUDIO_MELODY_E1_WAIT_START_CON_TO_STOP (5) | |
97 #define AUDIO_MELODY_E1_WAIT_STOP_CON (6) | |
98 #define AUDIO_MELODY_E1_WAIT_STOP_FFS (7) | |
99 #define AUDIO_MELODY_E1_WAIT_INIT_DONE (8) | |
100 | |
101 /* Melody E1 number ID */ | |
102 #define AUDIO_MELODY_E1_0 (0) | |
103 #define AUDIO_MELODY_E1_1 (1) | |
104 #define AUDIO_MELODY_E1_NONE (0xFF) | |
105 #endif | |
106 | |
107 #if (MELODY_E2) | |
108 /* Define all the state of the Audio Melody_E2 number 0 State Machine */ | |
109 #define AUDIO_MELODY_E2_IDLE (1) | |
110 #define AUDIO_MELODY_E2_WAIT_INIT_FFS (2) | |
111 #define AUDIO_MELODY_E2_WAIT_START_CON (3) | |
112 #define AUDIO_MELODY_E2_WAIT_STOP_COMMAND (4) | |
113 #define AUDIO_MELODY_E2_WAIT_START_CON_TO_STOP (5) | |
114 #define AUDIO_MELODY_E2_WAIT_STOP_CON (6) | |
115 #define AUDIO_MELODY_E2_WAIT_STOP_FFS (7) | |
116 #define AUDIO_MELODY_E2_WAIT_INIT_DONE (8) | |
117 | |
118 /* Melody E2 number ID */ | |
119 #define AUDIO_MELODY_E2_0 (0) | |
120 #define AUDIO_MELODY_E2_1 (1) | |
121 #define AUDIO_MELODY_E2_NONE (0xFF) | |
122 #endif | |
123 | |
124 #if (VOICE_MEMO) | |
125 /* Define all the state of the Audio Voice Memorization Play State Machine */ | |
126 #define AUDIO_VM_PLAY_IDLE (1) | |
127 #define AUDIO_VM_PLAY_WAIT_INIT_FFS (2) | |
128 #define AUDIO_VM_PLAY_WAIT_START_CON (3) | |
129 #define AUDIO_VM_PLAY_WAIT_STOP_COMMAND (4) | |
130 #define AUDIO_VM_PLAY_WAIT_START_CON_TO_STOP (5) | |
131 #define AUDIO_VM_PLAY_WAIT_STOP_CON (6) | |
132 #define AUDIO_VM_PLAY_WAIT_STOP_FFS (7) | |
133 #define AUDIO_VM_PLAY_WAIT_INIT_DONE (8) | |
134 | |
135 /* Define all the state of the Audio Voice Memorization Record State Machine */ | |
136 #define AUDIO_VM_RECORD_IDLE (1) | |
137 #define AUDIO_VM_RECORD_WAIT_INIT_FFS (2) | |
138 #define AUDIO_VM_RECORD_WAIT_START_CON (3) | |
139 #define AUDIO_VM_RECORD_WAIT_STOP_COMMAND (4) | |
140 #define AUDIO_VM_RECORD_WAIT_START_CON_TO_STOP (5) | |
141 #define AUDIO_VM_RECORD_WAIT_STOP_CON (6) | |
142 #define AUDIO_VM_RECORD_WAIT_STOP_FFS (7) | |
143 #define AUDIO_VM_RECORD_WAIT_INIT_DONE (8) | |
144 | |
145 /* Voice Memo number ID */ | |
146 #define AUDIO_VM_PLAY (2) | |
147 #define AUDIO_VM_RECORD (3) | |
148 #define AUDIO_VM_NONE (0xFF) | |
149 | |
150 #endif | |
151 | |
152 #if (L1_VOICE_MEMO_AMR) | |
153 /* Voice Memo number ID */ | |
154 #define AUDIO_VM_AMR_PLAY (0) | |
155 #define AUDIO_VM_AMR_RECORD (1) | |
156 #define AUDIO_VM_AMR_NONE (0xFF) | |
157 | |
158 // RX_TYPE or TX_TYPE (See 06.93) | |
159 #define AUDIO_VM_AMR_RXTX_SPEECH_GOOD (0<<3) | |
160 #define AUDIO_VM_AMR_RXTX_SPEECH_DEGRADED (1<<3) | |
161 #define AUDIO_VM_AMR_RXTX_ONSET (2<<3) | |
162 #define AUDIO_VM_AMR_RXTX_SPEECH_BAD (3<<3) | |
163 #define AUDIO_VM_AMR_RXTX_SID_FIRST (4<<3) | |
164 #define AUDIO_VM_AMR_RXTX_SID_UPDATE (5<<3) | |
165 #define AUDIO_VM_AMR_RXTX_SID_BAD (6<<3) | |
166 #define AUDIO_VM_AMR_RXTX_NO_DATA (7<<3) | |
167 | |
168 // Speech channel type | |
169 #define AUDIO_VM_AMR_SPEECH_475 0 | |
170 #define AUDIO_VM_AMR_SPEECH_515 1 | |
171 #define AUDIO_VM_AMR_SPEECH_59 2 | |
172 #define AUDIO_VM_AMR_SPEECH_67 3 | |
173 #define AUDIO_VM_AMR_SPEECH_74 4 | |
174 #define AUDIO_VM_AMR_SPEECH_795 5 | |
175 #define AUDIO_VM_AMR_SPEECH_102 6 | |
176 #define AUDIO_VM_AMR_SPEECH_122 7 | |
177 | |
178 // FT mapping for MMS storage | |
179 #define AUDIO_MMS_SID_FRAME_TYPE (8) | |
180 #define AUDIO_MMS_NO_DATA_FRAME_TYPE (15) | |
181 | |
182 #define AUDIO_MMS_FRAME_TYPE_SHIFT (3) | |
183 #define AUDIO_MMS_FRAME_TYPE_MASK (0x78) | |
184 | |
185 // quality mapping for MMS storage | |
186 #define AUDIO_MMS_GOOD_QUALITY (1) | |
187 #define AUDIO_MMS_BAD_QUALITY (0) | |
188 | |
189 #define AUDIO_MMS_QUALITY_SHIFT (2) | |
190 #define AUDIO_MMS_QUALITY_MASK (0x04) | |
191 | |
192 #define AUDIO_MMS_STI_BIT (0x10) | |
193 #define AUDIO_MMS_MODE_INDICATION (0xC) | |
194 | |
195 #define AUDIO_VM_AMR_SPEECH_475_DATA_SIZE 12 | |
196 #define AUDIO_VM_AMR_SPEECH_515_DATA_SIZE 13 | |
197 #define AUDIO_VM_AMR_SPEECH_590_DATA_SIZE 15 | |
198 #define AUDIO_VM_AMR_SPEECH_670_DATA_SIZE 17 | |
199 #define AUDIO_VM_AMR_SPEECH_740_DATA_SIZE 19 | |
200 #define AUDIO_VM_AMR_SPEECH_795_DATA_SIZE 20 | |
201 #define AUDIO_VM_AMR_SPEECH_102_DATA_SIZE 26 | |
202 #define AUDIO_VM_AMR_SPEECH_122_DATA_SIZE 31 | |
203 | |
204 #define AUDIO_VM_AMR_SID_DATA_SIZE 5 | |
205 | |
206 #define AUDIO_VM_AMR_NO_DATA_DATA_SIZE 0 | |
207 | |
208 #define AUDIO_VM_AMR_ONSET_DATA_SIZE 0 | |
209 | |
210 #define AUDIO_VM_AMR_MAX_SAMPLE_SIZE_16BIT ((1+31) >> 1) | |
211 #endif | |
212 | |
213 #if (L1_MIDI==1) | |
214 #define AUDIO_MIDI 0 | |
215 #define AUDIO_MIDI_NONE 0xFF | |
216 #endif | |
217 | |
218 // driver | |
219 #define AUDIO_PLAY_API_STATE_GET_BUF (1) | |
220 #define AUDIO_PLAY_API_STATE_PLAY_BUF (2) | |
221 | |
222 /* Define all the state of a session */ | |
223 #define AUDIO_IDLE (0) | |
224 #define AUDIO_WAIT_CHANNEL_ID (1) | |
225 #define AUDIO_WAIT_CHANNEL_ID_TO_STOP (2) | |
226 #define AUDIO_WAIT_STOP (3) | |
227 #define AUDIO_WAIT_STOP_CON (4) | |
228 #define AUDIO_WAIT_DRIVER_STOP_CON (5) | |
229 | |
230 /* Define all the state of channel handling in audio driver */ | |
231 #define AUDIO_DRIVER_CHANNEL_WAIT_INIT (1) | |
232 #define AUDIO_DRIVER_CHANNEL_WAIT_START (2) | |
233 #define AUDIO_DRIVER_CHANNEL_WAIT_START_CON (3) | |
234 #define AUDIO_DRIVER_CHANNEL_WAIT_STOP (4) | |
235 #define AUDIO_DRIVER_CHANNEL_WAIT_STOP_CON (5) | |
236 #define AUDIO_DRIVER_CHANNEL_WAIT_START_CON_TO_STOP (6) | |
237 #define AUDIO_DRIVER_CHANNEL_WAIT_FREE (7) | |
238 | |
239 // FFS manager | |
240 /* Define all the state of FFS manager */ | |
241 #define AUDIO_MEM_IDLE (0) | |
242 #define AUDIO_MEM_WAIT_NOTIFICATION_OR_STOP (1) | |
243 | |
244 #define AUDIO_DRIVER_SWITCH (0) | |
245 #define AUDIO_DRIVER_VM_AMR_RECORD_SESSION_SWITCH (1) | |
246 #define AUDIO_DRIVER_VM_AMR_PLAY_SESSION_SWITCH (2) | |
247 #define AUDIO_DRIVER_MIDI_SESSION_SWITCH (3) | |
248 #define AUDIO_DRIVER_NONE (0xFF) | |
249 | |
250 #define AUDIO_DRIVER_MAX_BUFFER_PER_SESSION (10) | |
251 #define AUDIO_DRIVER_MAX_CHANNEL (1) | |
252 | |
253 #if (MELODY_E1) || (VOICE_MEMO) || (MELODY_E2) | |
254 /* id for the session of Flash to Ram download */ | |
255 #define AUDIO_FFS_FLASH_2_RAM_SESSION (0) | |
256 /* id for the session of Ram to Flashdownload */ | |
257 #define AUDIO_FFS_RAM_2_FLASH_SESSION (1) | |
258 #endif | |
259 | |
260 #if (SPEECH_RECO) | |
261 /* Define the lengh of the speech recognition sample flash file name */ | |
262 #define AUDIO_SR_PATH_NAME_MAX_SIZE (AUDIO_PATH_NAME_MAX_SIZE + 4) | |
263 | |
264 /* define the threshold constant to switch between update and update-check */ | |
265 #define AUDIO_SR_UPDATE_UPDATECHECK_THRESHOLD (1) | |
266 | |
267 /* Define all the state of the Audio speech reco enroll state machine */ | |
268 #define AUDIO_SR_ENROLL_IDLE (1) | |
269 #define AUDIO_SR_ENROLL_WAIT_START_CON (2) | |
270 #define AUDIO_SR_ENROLL_WAIT_STOP_COMMAND (3) | |
271 #define AUDIO_SR_ENROLL_WAIT_START_CON_TO_STOP (4) | |
272 #define AUDIO_SR_ENROLL_WAIT_STOP_CON (5) | |
273 | |
274 /* Define all the state of the Audio speech reco update state machine */ | |
275 #define AUDIO_SR_UPDATE_IDLE (1) | |
276 #define AUDIO_SR_UPDATE_WAIT_START_CON (2) | |
277 #define AUDIO_SR_UPDATE_WAIT_STOP_COMMAND (3) | |
278 #define AUDIO_SR_UPDATE_WAIT_START_CON_TO_STOP (4) | |
279 #define AUDIO_SR_UPDATE_WAIT_STOP_CON (5) | |
280 | |
281 /* Define all the state of the Audio speech reco state machine */ | |
282 #define AUDIO_SR_RECO_IDLE (1) | |
283 #define AUDIO_SR_RECO_WAIT_START_CON (2) | |
284 #define AUDIO_SR_RECO_WAIT_STOP_COMMAND (3) | |
285 #define AUDIO_SR_RECO_WAIT_START_CON_TO_STOP (4) | |
286 #define AUDIO_SR_RECO_WAIT_STOP_CON (5) | |
287 | |
288 #endif | |
289 | |
290 /* Define all the state of the Audio mode full write state machine */ | |
291 #define AUDIO_MODE_FULL_WRITE_IDLE (1) | |
292 #define AUDIO_MODE_FULL_WRITE_WAIT_MESSAGE_CONF (2) | |
293 | |
294 /* Define all the state of the Audio mode load state machine */ | |
295 #define AUDIO_MODE_LOAD_IDLE (1) | |
296 #define AUDIO_MODE_LOAD_WAIT_MESSAGE_CONF (2) | |
297 | |
298 /* Audio mode number ID */ | |
299 #define AUDIO_FULL_ACCESS_WRITE (0) | |
300 #define AUDIO_MODE_SAVE (1) | |
301 #define AUDIO_MODE_LOAD (2) | |
302 #define AUDIO_MODE_NONE (3) | |
303 #define AUDIO_SPEAKER_VOLUME (4) | |
304 | |
305 #ifdef __cplusplus | |
306 } | |
307 #endif | |
308 #endif /* __AUDIO_CONST_I_H_ */ | |
309 #endif /* #ifdef RVM_AUDIO_MAIN_SWE */ |