]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/blob - pasdk/test_dsp/application/itopo/evmk2g/io.c
PASDK-258:Update copyright for files modified since Alpha-2 release.
[processor-sdk/performance-audio-sr.git] / pasdk / test_dsp / application / itopo / evmk2g / io.c
2 /*
3 Copyright (c) 2017, Texas Instruments Incorporated - http://www.ti.com/
4 All rights reserved.
6 * Redistribution and use in source and binary forms, with or without 
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 *
13 * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the
16 * distribution.
17 *
18 * Neither the name of Texas Instruments Incorporated nor the names of
19 * its contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 *
34 */
36 //
37 // Input / output device configuration definitions
38 //
40 //#include <ti/procsdk_audio/procsdk_audio_typ.h>
41 #include <procsdk_audio_typ.h>
43 #include <acptype.h>
44 #include <acpbeta.h>
45 #include <pafstd_a.h>
46 #include <pafdec_a.h>
47 #include <pafenc_a.h>
48 #include <pafsio.h>
50 #include <alpha/pcm_a.h>
52 #include <inpbuf_a.h>
53 #include <outbuf_a.h>
55 #include <pa_i13_evmk2g_io_a.h> //<pa_i13_evmda830_io_a.h>
56 #include <sap_d10.h>
58 #define  rb32DECSourceDecode 0xc024,0x0b81
59 #define  ob32DECSourceDecodeNone 0x0001,0x0000
61 #define  rb32IBSioSelect 0xc022,0x0581
62 #define  ob32IBSioSelect(X) (X)|0x0080,0x0000
64 #define  ob32OBSioSelect(X) (X)|0x0080,0x0000
65 #define  rb32DECSourceSelect_3 0xc024,0x09b1
66 #define  wb32DECSourceSelect_3 0xc024,0x09f1
68 #define writePA3Await(RB32,WB32) 0xcd0b,5+2,0x0204,200,10,WB32,RB32
70 // -----------------------------------------------------------------------------
71 //
72 // Input device configurations & shortcut definitions
73 //
75 const struct
76 {
77     Int n;
78     const PAF_SIO_Params *x[DEVINP_N];
79 } patchs_devinp[1] =
80 {
81     DEVINP_N,
82         // These values reflect the definitions DEVINP_* in pa*io_a.h:
83         NULL,                                               // InNone
84                 (const PAF_SIO_Params *) &SAP_D10_RX_HDMI_STEREO,    // InHDMIStereo
85                 (const PAF_SIO_Params *) &SAP_D10_RX_HDMI,          // InHDMI
86                 (const PAF_SIO_Params *) &SAP_D10_RX_DIR,           // InDigital
87                 (const PAF_SIO_Params *) &SAP_D10_RX_ADC_44100HZ,   // InAnalog
88 };
91 // .............................................................................
92 // execPAIInNone
93 #define CUS_SIGMA32_S \
94         writeDECSourceSelectNone, \
95         writePA3Await(rb32DECSourceDecode,ob32DECSourceDecodeNone), \
96         wroteDECSourceProgramUnknown, \
97     writeIBSampleRateOverrideUnknown, \
98     writeIBSioSelectN(DEVINP_NULL), \
99     0xcdf0,execPAIInNone
101 #pragma DATA_SECTION(cus_sigma32_s0, ".none")
102 const ACP_Unit cus_sigma32_s0[] = {
103     0xc900 + 0 - 1,
104     CUS_SIGMA32_S,
105 };
107 const ACP_Unit cus_sigma32_s[] = {
108     0xc900 + sizeof (cus_sigma32_s0) / 2 - 1,
109     CUS_SIGMA32_S,
110 };
112 // execPAIInHDMIStereo
113 #define CUS_SIGMA33_S \
114     writeDECSourceSelectNone, \
115     writePA3Await(rb32DECSourceDecode,ob32DECSourceDecodeNone), \
116         writePCMChannelConfigurationProgramStereoUnknown, \
117     writePCMScaleVolumeN(0), \
118     writeDECChannelMapFrom2(0,1), \
119     writeIBUnknownTimeoutN(8*1024), \
120     writeIBScanAtHighSampleRateModeEnable, \
121     writeIBEmphasisOverrideNo, \
122     writeIBPrecisionOverride24, \
123         writeIBSampleRateOverrideStandard, \
124     writeIBSioSelectN(DEVINP_HDMI_STEREO), \
125     wroteDECSourceProgramUnknown, \
126     writeDECSourceSelectAuto, \
127     0xcdf0,execPAIInHDMIStereo
129 #pragma DATA_SECTION(cus_sigma33_s0, ".none")
130 const ACP_Unit cus_sigma33_s0[] = {
131     0xc900 + 0 - 1,
132     CUS_SIGMA33_S,
133 };
135 const ACP_Unit cus_sigma33_s[] = {
136     0xc900 + sizeof (cus_sigma33_s0) / 2 - 1,
137     CUS_SIGMA33_S,
138 };
140 // execPAIInHDMI
141 #define CUS_SIGMA34_S \
142     writeDECSourceSelectNone, \
143     writePA3Await(rb32DECSourceDecode,ob32DECSourceDecodeNone), \
144     writePCMChannelConfigurationProgramSurround4_1, \
145     writePCMScaleVolumeN(0), \
146     writeDECChannelMapFrom16(0,4,1,5,2,6,3,7,-3,-3,-3,-3,-3,-3,-3,-3), \
147     writeIBUnknownTimeoutN(15*1024), \
148     writeIBScanAtHighSampleRateModeEnable, \
149     writeIBEmphasisOverrideNo, \
150     writeIBPrecisionOverride24, \
151     writeIBSampleRateOverrideStandard, \
152     writeIBSioSelectN(DEVINP_HDMI), \
153     wroteDECSourceProgramUnknown, \
154     writeDECSourceSelectAuto, \
155     0xcdf0,execPAIInHDMI
157 // writeDECChannelMapFrom16(0,4,1,5,2,6,3,7,-3,-3,-3,-3,-3,-3,-3,-3), \
158 #pragma DATA_SECTION(cus_sigma34_s0, ".none")
159 const ACP_Unit cus_sigma34_s0[] = {
160     0xc900 + 0 - 1,
161     CUS_SIGMA34_S,
162 };
164 const ACP_Unit cus_sigma34_s[] = {
165     0xc900 + sizeof (cus_sigma34_s0) / 2 - 1,
166     CUS_SIGMA34_S,
167 };
169 // execPAIInDigital
170 #define CUS_SIGMA35_S \
171   writeDECSourceSelectNone, \
172     writePA3Await(rb32DECSourceDecode,ob32DECSourceDecodeNone), \
173     writeIBUnknownTimeoutN(2*2048), \
174     writeIBScanAtHighSampleRateModeDisable, \
175     writePCMChannelConfigurationProgramStereoUnknown, \
176     writePCMScaleVolumeN(0), \
177     writeDECChannelMapFrom16(0,1,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3), \
178     writeIBEmphasisOverrideDisable, \
179     writeIBPrecisionDefaultOriginal, \
180     writeIBPrecisionOverrideDetect, \
181     writeIBSampleRateOverrideStandard, \
182     writeIBSioSelectN(DEVINP_DIR), \
183     wroteDECSourceProgramUnknown, \
184     writeDECSourceSelectAuto, \
185     0xcdf0,execPAIInDigital
187 #pragma DATA_SECTION(cus_sigma35_s0, ".none")
188 const ACP_Unit cus_sigma35_s0[] = {
189     0xc900 + 0 - 1,
190     CUS_SIGMA35_S,
191 };
193 const ACP_Unit cus_sigma35_s[] = {
194     0xc900 + sizeof (cus_sigma35_s0) / 2 - 1,
195     CUS_SIGMA35_S,
196 };
198 // execPAIInAnalog
199 #define CUS_SIGMA36_S \
200     writeDECSourceSelectNone, \
201     writePA3Await(rb32DECSourceDecode,ob32DECSourceDecodeNone), \
202     writePCMChannelConfigurationProgramSurround4_1, \
203     writePCMScaleVolumeN(2*6), \
204     writeDECChannelMapFrom16(0,4,1,5,2,6,3,7,-3,-3,-3,-3,-3,-3,-3,-3), \
205     writeIBEmphasisOverrideNo, \
206     writeIBPrecisionOverride24, \
207     writeIBSampleRateOverride44100Hz, \
208     writeIBSioSelectN(DEVINP_ADC), \
209     writeDECSourceSelectPCM,        \
210     0xcdf0,execPAIInAnalog
212 #pragma DATA_SECTION(cus_sigma36_s0, ".none")
213 const ACP_Unit cus_sigma36_s0[] = {
214     0xc900 + 0 - 1,
215     CUS_SIGMA36_S,
216 };
218 const ACP_Unit cus_sigma36_s[] = {
219     0xc900 + sizeof (cus_sigma36_s0) / 2 - 1,
220     CUS_SIGMA36_S,
221 };
223 // -----------------------------------------------------------------------------
224 //
225 // Output device configurations & shortcut definitions
226 //
228 const struct
230     Int n;
231     const PAF_SIO_Params *x[DEVOUT_N];
232 } patchs_devout[1] =
234     DEVOUT_N,
235         // These values reflect the definitions DEVOUT_* in pa*io_a.h:
236         NULL,                                               // OutNone
237         (const PAF_SIO_Params *) &SAP_D10_TX_DAC,           // OutAnalog
238                 (const PAF_SIO_Params *) &SAP_D10_TX_DAC_SLAVE,           // OutAnalogSlave
239                 (const PAF_SIO_Params *) &SAP_D10_TX_DAC_12CH,           // OutAnalog_12ch
240                 (const PAF_SIO_Params *) &SAP_D10_TX_DAC_16CH,           // OutAnalog_16ch
241 };
244 // .............................................................................
245 // execPAIOutNone
246 #define CUS_SIGMA48_S \
247         rb32DECSourceSelect_3, \
248         writeDECSourceSelectNone, \
249         writePA3Await(rb32DECSourceDecode,ob32DECSourceDecodeNone), \
250     writeOBSioSelectN(DEVOUT_NULL), \
251     writePA3Await(rb32OBSioSelect,ob32OBSioSelect(DEVOUT_NULL)), \
252     0xcdf0,execPAIOutNone
253     
254 #pragma DATA_SECTION(cus_sigma48_s0, ".none")
255 const ACP_Unit cus_sigma48_s0[] = {
256     0xc900 + 0 - 1,
257     CUS_SIGMA48_S,
258 };
260 const ACP_Unit cus_sigma48_s[] = {
261     0xc900 + sizeof (cus_sigma48_s0) / 2 - 1,
262     CUS_SIGMA48_S,
263 };
265 // .............................................................................
266 // execPAIOutAnalog
267 #define CUS_SIGMA49_S \
268         rb32DECSourceSelect_3, \
269         writeDECSourceSelectNone, \
270         writePA3Await(rb32DECSourceDecode,ob32DECSourceDecodeNone), \
271         writeOBSioSelectN(DEVOUT_DAC), \
272         writeENCChannelMapTo16(0,4,1,5,2,6,3,7,-3,-3,-3,-3,-3,-3,-3,-3), \
273         wb32DECSourceSelect_3, \
274         0xcdf0,execPAIOutAnalog
276 #pragma DATA_SECTION(cus_sigma49_s0, ".none")
277 const ACP_Unit cus_sigma49_s0[] = {
278     0xc900 + 0 - 1,
279     CUS_SIGMA49_S,
280 };
282 const ACP_Unit cus_sigma49_s[] = {
283     0xc900 + sizeof (cus_sigma49_s0) / 2 - 1,
284     CUS_SIGMA49_S,
285 };
287 // .............................................................................
288 // execPAIOutAnalogSlave
289 #define CUS_SIGMA50_S \
290     rb32DECSourceSelect_3, \
291         writeDECSourceSelectNone, \
292         writePA3Await(rb32DECSourceDecode,ob32DECSourceDecodeNone), \
293     writeOBSioSelectN(DEVOUT_DAC_SLAVE), \
294         writeENCChannelMapTo16(0,4,1,5,2,6,3,7,-3,-3,-3,-3,-3,-3,-3,-3), \
295     wb32DECSourceSelect_3, \
296     0xcdf0,execPAIOutAnalogSlave
298 #pragma DATA_SECTION(cus_sigma50_s0, ".none")
299 const ACP_Unit cus_sigma50_s0[] = {
300     0xc900 + 0 - 1,
301     CUS_SIGMA50_S,
302 };
304 const ACP_Unit cus_sigma50_s[] = {
305     0xc900 + sizeof (cus_sigma50_s0) / 2 - 1,
306     CUS_SIGMA50_S,
307 };
309 // .............................................................................
310 // execPAIOutAnalog12Ch
311 #define CUS_SIGMA51_S \
312         rb32DECSourceSelect_3, \
313         writeDECSourceSelectNone, \
314         writePA3Await(rb32DECSourceDecode,ob32DECSourceDecodeNone), \
315     writeOBSioSelectN(DEVOUT_DAC_12CH), \
316         writeENCChannelMapTo16(0,6,1,7,2,8,3,9,4,10,5,11,-3,-3,-3,-3), \
317     wb32DECSourceSelect_3, \
318     0xcdf0,execPAIOutAnalog12Ch
320 #pragma DATA_SECTION(cus_sigma51_s0, ".none")
321 const ACP_Unit cus_sigma51_s0[] = {
322     0xc900 + 0 - 1,
323     CUS_SIGMA51_S,
324 };
326 const ACP_Unit cus_sigma51_s[] = {
327     0xc900 + sizeof (cus_sigma51_s0) / 2 - 1,
328     CUS_SIGMA51_S,
329 };
331 // .............................................................................
332 // execPAIOutAnalog16Ch
333 #define CUS_SIGMA52_S \
334         rb32DECSourceSelect_3, \
335         writeDECSourceSelectNone, \
336         writePA3Await(rb32DECSourceDecode,ob32DECSourceDecodeNone), \
337     writeOBSioSelectN(DEVOUT_DAC_16CH), \
338         writeENCChannelMapTo16(0,8,1,9,2,10,3,11,4,12,5,13,6,14,7,15), \
339     wb32DECSourceSelect_3, \
340     0xcdf0,execPAIOutAnalog16Ch
342 #pragma DATA_SECTION(cus_sigma52_s0, ".none")
343 const ACP_Unit cus_sigma52_s0[] = {
344     0xc900 + 0 - 1,
345     CUS_SIGMA52_S,
346 };
348 const ACP_Unit cus_sigma52_s[] = {
349     0xc900 + sizeof (cus_sigma52_s0) / 2 - 1,
350     CUS_SIGMA52_S,
351 };
352 // EOF