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