2 /*
3 Copyright (c) 2018, 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
229 {
230 Int n;
231 const PAF_SIO_Params *x[DEVOUT_N];
232 } patchs_devout[1] =
233 {
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 writeOBSioSelectN(DEVOUT_NULL), \
248 writePA3Await(rb32OBSioSelect,ob32OBSioSelect(DEVOUT_NULL)), \
249 0xcdf0,execPAIOutNone
251 #pragma DATA_SECTION(cus_sigma48_s0, ".none")
252 const ACP_Unit cus_sigma48_s0[] = {
253 0xc900 + 0 - 1,
254 CUS_SIGMA48_S,
255 };
257 const ACP_Unit cus_sigma48_s[] = {
258 0xc900 + sizeof (cus_sigma48_s0) / 2 - 1,
259 CUS_SIGMA48_S,
260 };
262 // .............................................................................
263 // execPAIOutAnalog
264 #define CUS_SIGMA49_S \
265 writeOBSioSelectN(DEVOUT_DAC), \
266 writeENCChannelMapTo16(0,4,1,5,2,6,3,7,-3,-3,-3,-3,-3,-3,-3,-3), \
267 writePA3Await(rb32OBSioSelect,ob32OBSioSelect(DEVOUT_DAC)), \
268 0xcdf0,execPAIOutAnalog
270 #pragma DATA_SECTION(cus_sigma49_s0, ".none")
271 const ACP_Unit cus_sigma49_s0[] = {
272 0xc900 + 0 - 1,
273 CUS_SIGMA49_S,
274 };
276 const ACP_Unit cus_sigma49_s[] = {
277 0xc900 + sizeof (cus_sigma49_s0) / 2 - 1,
278 CUS_SIGMA49_S,
279 };
281 // .............................................................................
282 // execPAIOutAnalogSlave
283 #define CUS_SIGMA50_S \
284 writeOBSioSelectN(DEVOUT_DAC_SLAVE), \
285 writeENCChannelMapTo16(0,4,1,5,2,6,3,7,-3,-3,-3,-3,-3,-3,-3,-3), \
286 writePA3Await(rb32OBSioSelect,ob32OBSioSelect(DEVOUT_DAC_SLAVE)), \
287 0xcdf0,execPAIOutAnalogSlave
289 #pragma DATA_SECTION(cus_sigma50_s0, ".none")
290 const ACP_Unit cus_sigma50_s0[] = {
291 0xc900 + 0 - 1,
292 CUS_SIGMA50_S,
293 };
295 const ACP_Unit cus_sigma50_s[] = {
296 0xc900 + sizeof (cus_sigma50_s0) / 2 - 1,
297 CUS_SIGMA50_S,
298 };
300 // .............................................................................
301 // execPAIOutAnalog12Ch
302 #define CUS_SIGMA51_S \
303 writeOBSioSelectN(DEVOUT_DAC_12CH), \
304 writeENCChannelMapTo16(0,6,1,7,2,8,3,9,4,10,5,11,-3,-3,-3,-3), \
305 writePA3Await(rb32OBSioSelect,ob32OBSioSelect(DEVOUT_DAC_12CH)), \
306 0xcdf0,execPAIOutAnalog12Ch
308 #pragma DATA_SECTION(cus_sigma51_s0, ".none")
309 const ACP_Unit cus_sigma51_s0[] = {
310 0xc900 + 0 - 1,
311 CUS_SIGMA51_S,
312 };
314 const ACP_Unit cus_sigma51_s[] = {
315 0xc900 + sizeof (cus_sigma51_s0) / 2 - 1,
316 CUS_SIGMA51_S,
317 };
319 // .............................................................................
320 // execPAIOutAnalog16Ch
321 #define CUS_SIGMA52_S \
322 writeOBSioSelectN(DEVOUT_DAC_16CH), \
323 writeENCChannelMapTo16(0,8,1,9,2,10,3,11,4,12,5,13,6,14,7,15), \
324 writePA3Await(rb32OBSioSelect,ob32OBSioSelect(DEVOUT_DAC_16CH)), \
325 0xcdf0,execPAIOutAnalog16Ch
327 #pragma DATA_SECTION(cus_sigma52_s0, ".none")
328 const ACP_Unit cus_sigma52_s0[] = {
329 0xc900 + 0 - 1,
330 CUS_SIGMA52_S,
331 };
333 const ACP_Unit cus_sigma52_s[] = {
334 0xc900 + sizeof (cus_sigma52_s0) / 2 - 1,
335 CUS_SIGMA52_S,
336 };
337 // EOF