FreeCalypso > hg > freecalypso-citrine
comparison L1/audio_cfile/l1audio_drive.c @ 0:75a11d740a02
initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 09 Jun 2016 00:02:41 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:75a11d740a02 |
---|---|
1 /************* Revision Controle System Header ************* | |
2 * GSM Layer 1 software | |
3 * L1AUDIO_DRIVE.C | |
4 * | |
5 * Filename l1audio_drive.c | |
6 * Copyright 2003 (C) Texas Instruments | |
7 * | |
8 ************* Revision Controle System Header *************/ | |
9 | |
10 /************************************/ | |
11 /* Include files... */ | |
12 /************************************/ | |
13 | |
14 #include "config.h" | |
15 #include "l1_confg.h" | |
16 #include "l1_macro.h" | |
17 | |
18 #if 1 //(AUDIO_TASK == 1) | |
19 | |
20 #include "l1_types.h" | |
21 #include "sys_types.h" | |
22 | |
23 #if (CODE_VERSION == SIMULATION) && (AUDIO_SIMULATION) | |
24 | |
25 | |
26 #include <stdlib.h> | |
27 #include <string.h> | |
28 | |
29 #include "iq.h" // Debug / Init hardware ("eva3.lib") | |
30 #include "l1_ver.h" | |
31 #include "l1_const.h" | |
32 #include "l1_signa.h" | |
33 | |
34 #if TESTMODE | |
35 #include "l1tm_defty.h" | |
36 #endif | |
37 | |
38 #include "l1audio_const.h" | |
39 #include "l1audio_cust.h" | |
40 #include "l1audio_defty.h" | |
41 #include "l1audio_msgty.h" | |
42 | |
43 #if (L1_GTT == 1) | |
44 #include "l1gtt_const.h" | |
45 #include "l1gtt_defty.h" | |
46 #endif | |
47 //added here from e-sample for AAC | |
48 #if (L1_DYN_DSP_DWNLD == 1) | |
49 #include "l1_dyn_dwl_const.h" | |
50 #include "l1_dyn_dwl_defty.h" | |
51 #endif | |
52 #if (L1_MP3 == 1) | |
53 #include "l1mp3_defty.h" | |
54 #endif | |
55 | |
56 #if (L1_MIDI == 1) | |
57 #include "l1midi_defty.h" | |
58 #endif | |
59 //added here from e-sample for AAC | |
60 #if (L1_AAC == 1) | |
61 #include "l1aac_defty.h" | |
62 #endif | |
63 | |
64 #include "l1_defty.h" | |
65 #include "cust_os.h" | |
66 #include "l1_msgty.h" | |
67 #include "l1_varex.h" | |
68 | |
69 #include "l1_mftab.h" | |
70 #include "l1_tabs.h" | |
71 #include "l1_ctl.h" | |
72 | |
73 | |
74 #include "l1_time.h" | |
75 #include "l1_scen.h" | |
76 | |
77 #else | |
78 // Layer1 and debug include files. | |
79 | |
80 #include <ctype.h> | |
81 #include <math.h> | |
82 #include "l1_ver.h" | |
83 #include "l1_const.h" | |
84 #include "l1_signa.h" | |
85 | |
86 #if TESTMODE | |
87 #include "l1tm_defty.h" | |
88 #endif | |
89 | |
90 #include "l1audio_const.h" | |
91 #include "l1audio_cust.h" | |
92 #include "l1audio_defty.h" | |
93 #include "l1audio_msgty.h" | |
94 | |
95 #if (L1_GTT == 1) | |
96 #include "l1gtt_const.h" | |
97 #include "l1gtt_defty.h" | |
98 #endif | |
99 //added here from e-sample for AAC | |
100 #if (L1_DYN_DSP_DWNLD == 1) | |
101 #include "l1_dyn_dwl_const.h" | |
102 #include "l1_dyn_dwl_defty.h" | |
103 #endif | |
104 #if (L1_MP3 == 1) | |
105 #include "l1mp3_defty.h" | |
106 #endif | |
107 | |
108 #if (L1_MIDI == 1) | |
109 #include "l1midi_defty.h" | |
110 #endif | |
111 //added here from e-sample for AAC | |
112 #if (L1_AAC == 1) | |
113 #include "l1aac_defty.h" | |
114 #endif | |
115 | |
116 #include "l1_defty.h" | |
117 #include "../../gpf/inc/cust_os.h" | |
118 #include "l1_msgty.h" | |
119 #include "tpudrv.h" // TPU drivers. ("eva3.lib") | |
120 #include "l1_varex.h" | |
121 | |
122 #include "l1_proto.h" | |
123 #include "l1_mftab.h" | |
124 #include "l1_tabs.h" | |
125 #include "../../bsp/mem.h" | |
126 #include "../../bsp/armio.h" | |
127 #include "../../bsp/timer.h" | |
128 #include "../../bsp/timer1.h" | |
129 #include "../../bsp/dma.h" | |
130 #include "../../bsp/inth.h" | |
131 #include "../../bsp/ulpd.h" | |
132 #include "../../bsp/rhea_arm.h" | |
133 #include "../../bsp/clkm.h" // Clockm ("eva3.lib") | |
134 #include "l1_ctl.h" | |
135 | |
136 #include "l1_time.h" | |
137 #if L2_L3_SIMUL | |
138 #include "l1_scen.h" | |
139 #endif | |
140 #endif | |
141 | |
142 #include "l1audio_macro.h" | |
143 | |
144 /**************************************/ | |
145 /* Prototypes for L1 SYNCH manager */ | |
146 /**************************************/ | |
147 void vocoder_mute_dl (BOOL mute); | |
148 void vocoder_mute_ul (BOOL mute); | |
149 #if (AUDIO_DSP_FEATURES == 1) | |
150 void L1_audio_sidetone_write(UWORD16 sidetone_value); | |
151 void L1_audio_CAL_DlVolume_write(UWORD16 vol_value); | |
152 void L1_audio_CAL_UlVolume_write(UWORD16 vol_value); | |
153 void L1_audio_volume_speed_write(UWORD16 volspeed_value); | |
154 #endif | |
155 | |
156 /**************************************/ | |
157 /* External prototypes */ | |
158 /**************************************/ | |
159 | |
160 /*-------------------------------------------------------*/ | |
161 /* vocoder_mute_dl() */ | |
162 /*-------------------------------------------------------*/ | |
163 /* */ | |
164 /* Parameters : */ | |
165 /* */ | |
166 /* Return : */ | |
167 /* */ | |
168 /* Description : Mute the DL vocoder. */ | |
169 /* */ | |
170 /*-------------------------------------------------------*/ | |
171 void vocoder_mute_dl(BOOL mute) | |
172 { | |
173 if (mute) | |
174 { | |
175 // Set the DL vocoder mute bit in the d_tch_mode register | |
176 l1s_dsp_com.dsp_ndb_ptr->d_tch_mode |= (0x01<<14); | |
177 } | |
178 else | |
179 { | |
180 // Reset the DL vocoder mute bit in the d_tch_mode register | |
181 l1s_dsp_com.dsp_ndb_ptr->d_tch_mode &= ~(0x01<<14); | |
182 } | |
183 } | |
184 | |
185 /*-------------------------------------------------------*/ | |
186 /* vocoder_mute_ul() */ | |
187 /*-------------------------------------------------------*/ | |
188 /* */ | |
189 /* Parameters : */ | |
190 /* */ | |
191 /* Return : */ | |
192 /* */ | |
193 /* Description : Mute the UL vocoder. */ | |
194 /* */ | |
195 /*-------------------------------------------------------*/ | |
196 void vocoder_mute_ul(BOOL mute) | |
197 { | |
198 if (mute) | |
199 { | |
200 // Set the UL vocoder mute bit in the d_tch_mode register | |
201 l1s_dsp_com.dsp_ndb_ptr->d_tch_mode |= (0x01<<15); | |
202 } | |
203 else | |
204 { | |
205 // Reset the UL vocoder mute bit in the d_tch_mode register | |
206 l1s_dsp_com.dsp_ndb_ptr->d_tch_mode &= ~(0x01<<15); | |
207 } | |
208 } | |
209 | |
210 #if (AUDIO_DSP_FEATURES == 1) | |
211 /*-------------------------------------------------------*/ | |
212 /* L1_audio_sidetone_write() */ | |
213 /*-------------------------------------------------------*/ | |
214 /* */ | |
215 /* Parameters : */ | |
216 /* */ | |
217 /* Return : */ | |
218 /* */ | |
219 /* Description : write sidetone gain in API for DSP */ | |
220 /* sidetone process */ | |
221 /* */ | |
222 /*-------------------------------------------------------*/ | |
223 void L1_audio_sidetone_write(UWORD16 sidetone_value) | |
224 { | |
225 l1s_dsp_com.dsp_ndb_ptr->d_sidetone_level = (API) sidetone_value; | |
226 } | |
227 | |
228 /*-------------------------------------------------------*/ | |
229 /* L1_audio_CAL_DlVolume_write() */ | |
230 /*-------------------------------------------------------*/ | |
231 /* */ | |
232 /* Parameters : */ | |
233 /* */ | |
234 /* Return : */ | |
235 /* */ | |
236 /* Description : write DL gain in API for DSP vol ctrl */ | |
237 /* process */ | |
238 /* */ | |
239 /*-------------------------------------------------------*/ | |
240 void L1_audio_CAL_DlVolume_write(UWORD16 vol_value) | |
241 { | |
242 l1s_dsp_com.dsp_ndb_ptr->d_vol_dl_level = (API) vol_value; | |
243 } | |
244 | |
245 /*-------------------------------------------------------*/ | |
246 /* L1_audio_CAL_UlVolume_write() */ | |
247 /*-------------------------------------------------------*/ | |
248 /* */ | |
249 /* Parameters : */ | |
250 /* */ | |
251 /* Return : */ | |
252 /* */ | |
253 /* Description : write UL gain in API for DSP vol ctrl */ | |
254 /* process */ | |
255 /* */ | |
256 /*-------------------------------------------------------*/ | |
257 void L1_audio_CAL_UlVolume_write(UWORD16 vol_value) | |
258 { | |
259 l1s_dsp_com.dsp_ndb_ptr->d_vol_ul_level = (API) vol_value; | |
260 } | |
261 | |
262 /*-------------------------------------------------------*/ | |
263 /* L1_audio_volume_speed_write() */ | |
264 /*-------------------------------------------------------*/ | |
265 /* */ | |
266 /* Parameters : */ | |
267 /* */ | |
268 /* Return : */ | |
269 /* */ | |
270 /* Description : write volume speed in API for DSP vol */ | |
271 /* ctrl process */ | |
272 /* */ | |
273 /*-------------------------------------------------------*/ | |
274 void L1_audio_volume_speed_write(UWORD16 volspeed_value) | |
275 { | |
276 l1s_dsp_com.dsp_ndb_ptr->d_vol_speed = (API) volspeed_value; | |
277 } | |
278 | |
279 #endif /* DSP_AUDIO_FEAT */ | |
280 | |
281 #endif // AUDIO_TASK |