1 /*
2 Copyright (c) 2016, Texas Instruments Incorporated - http://www.ti.com/
3 All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
12 * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the
15 * distribution.
16 *
17 * Neither the name of Texas Instruments Incorporated nor the names of
18 * its contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 */
35 /*
36 * IPCE default instance creation parameters
37 */
38 #include <xdc/std.h> //<std.h>
39 #include <ipce.h>
41 /*
42 * ======== IPCE_PARAMS_NODELAY ========
43 * This static initialization defines the default parameters used to
44 * create instances of PCE objects.
45 */
47 #if IPCE_PHASES != 6
48 #error internal error
49 #endif
51 // Start of customizable code -------------------------------------------------
53 #define IPCE_OUTPUT_NUMCHAN 32 // Number of output channels
54 //#define IPCE_OUTPUT_ESIZE 3 // Element size for output: 24 or 32 bits
55 #define IPCE_OUTPUT_ESIZE 4 // Element size for output: 24 or 32 bits
57 #define IPCE_FSIZE 256 // Size of Audio Frame
59 #define IPCE_OUTPUT_NUMCHAN_SECONDARY 2 // Number of output channels in secondary
61 // End of customizable code ---------------------------------------------------
63 #define IPCE_DELAY_ESIZE 4 // Element size for delay: packed 24 bits
65 /*
66 * ======== IPCE_PARAMS_STATUS_DELAY_NODELAY ========
67 */
69 const IPCE_Status IPCE_PARAMS_STATUS_NODELAY = {
70 sizeof (IPCE_Status),
71 1, /* mode: enabled */
72 0, /* type: unused */
73 1, 0, /* phase 0 mode,type: enabled,unused */
74 0, 0, /* phase 1 mode,type: enabled,unused */
75 1, 0, /* phase 2 mode,type: enabled,unused */
76 1, 0, /* phase 3 mode,type: enabled,unused */
77 1, 0, /* phase 4 mode,type: enabled,unused */
78 1, 0, /* phase 5 mode,type: enabled,unused */
79 /* Delay Status */
80 0, /* unused */
81 1, /* unit */
82 PAF_MAXNUMCHAN, /* numc */
83 0, /* nums */
84 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // delay
85 0, // masterDelay
86 0, // pceExceptionDetect
87 0, // pceExceptionFlag
88 0, // pceExceptionMute
89 0, // pceClipDetect
90 0, // bsMetadata_type
91 0, // mdInsert
92 32 // maxNumChMd
93 };
95 /*
96 * ======== IPCE_PARAMS_CONFIG_DELAY_NODELAY ========
97 * This static initialization defines the parameters used to create
98 * instances of DEL objects
99 */
101 const IPCE_ConfigPhaseVolume IPCE_PARAMS_CONFIG_PHASE_VOLUME_NODELAY = {
102 sizeof (IPCE_ConfigPhaseVolume),
103 -2 * 40, /* volumeRamp */
104 };
106 const IPCE_ConfigPhaseDelay IPCE_PARAMS_CONFIG_PHASE_DELAY_NODELAY = {
107 sizeof (IPCE_ConfigPhaseDelay),
108 0,
109 IPCE_DELAY_ESIZE,
110 NULL,
111 };
113 const IPCE_Config IPCE_PARAMS_CONFIG_NODELAY = {
114 sizeof (IPCE_Config),
115 0, /* frameLength */
116 0, /* unused */
117 (IPCE_ConfigPhase *) & IPCE_PARAMS_CONFIG_PHASE_VOLUME_NODELAY, /* phase 0 config: volume */
118 (IPCE_ConfigPhase *) & IPCE_PARAMS_CONFIG_PHASE_DELAY_NODELAY, /* phase 1 config: delay */
119 0, /* phase 2 config: output */
120 0, /* phase 3 config: unused */
121 0, /* phase 4 config: unused */
122 0, /* phase 5 config: unused */
123 0, /* phase 0 common: volume */
124 0, /* phase 1 common: delay */
125 0, /* phase 2 common: output */
126 0, /* phase 3 common: unused */
127 0, /* phase 4 common: unused */
128 0, /* phase 5 common: unused */
129 /* scale -- uninitialized */
130 };
132 /*
133 * ======== IPCE_PARAMS_ACTIVE ========
134 */
136 const PAF_ActivePhaseVolume IPCE_PARAMS_ACTIVE_PHASE_VOLUME_NODELAY = {
137 sizeof (PAF_ActivePhaseVolume),
138 /* pVolumeStatus: uninitialized */
139 };
141 const PAF_ActivePhaseOutput IPCE_PARAMS_ACTIVE_PHASE_OUTPUT_NODELAY = {
142 sizeof (PAF_ActivePhaseOutput),
143 /* pEncodeStatus: uninitialized */
144 /* pOutBufConfig: uninitialized */
145 };
147 const IPCE_Active IPCE_PARAMS_ACTIVE_NODELAY = {
148 0,
149 0,
150 (PAF_ActivePhase *) & IPCE_PARAMS_ACTIVE_PHASE_VOLUME_NODELAY, /* phase 0 active: volume */
151 0, /* phase 1 active: delay */
152 (PAF_ActivePhase *) & IPCE_PARAMS_ACTIVE_PHASE_OUTPUT_NODELAY, /* phase 2 active: output */
153 0, /* phase 3 active: unused */
154 0, /* phase 4 active: unused */
155 0, /* phase 5 active: unused */
156 /* bitstreamMask uninitialized */
157 };
159 /*
160 * ======== IPCE_PARAMS_SCRACH ========
161 */
162 const PAF_ScrachPhaseOutput IPCE_PARAMS_SCRACH_PHASE_OUTPUT_NODELAY = {
163 sizeof (PAF_ScrachPhaseDelay) + IPCE_OUTPUT_NUMCHAN * IPCE_OUTPUT_ESIZE * IPCE_FSIZE,
164 };
166 const IPCE_Scrach IPCE_PARAMS_SCRACH_NODELAY = {
167 sizeof (IPCE_Scrach),
168 0, /* phase 0 scrach: volume */
169 0, /* phase 1 scrach: delay */
170 0, //(PAF_ScrachPhase *) & IPCE_PARAMS_SCRACH_PHASE_OUTPUT_NODELAY, /* phase 2 scrach: output */
171 0, /* phase 3 scrach: unused */
172 0, /* phase 4 scrach: unused */
173 0, /* phase 5 scrach: unused */
174 };
176 const IPCE_Params IPCE_PARAMS_NODELAY = {
177 sizeof (IPCE_Params),
178 &IPCE_PARAMS_STATUS_NODELAY,
179 &IPCE_PARAMS_CONFIG_NODELAY,
180 &IPCE_PARAMS_ACTIVE_NODELAY,
181 &IPCE_PARAMS_SCRACH_NODELAY,
182 };
184 const PAF_ScrachPhaseDelay IPCE_PARAMS_SCRACH_PHASE_OUTPUT_CUS_SEC = {
185 sizeof(PAF_ScrachPhaseDelay)+IPCE_OUTPUT_NUMCHAN_SECONDARY*IPCE_OUTPUT_ESIZE*IPCE_FSIZE, // 2*256*4 = no of output channels for rec out * block size * output sample size
186 };
188 const IPCE_Scrach IPCE_PARAMS_SCRACH_CUS_SEC = {
189 sizeof(IPCE_Scrach),
190 0, /* phase 0 scrach: volume */
191 0, /* phase 1 scrach: delay */
192 0, //(PAF_ScrachPhase *)&IPCE_PARAMS_SCRACH_PHASE_OUTPUT_CUS_SEC, /* phase 2 scrach: output */
193 0, /* phase 3 scrach: unused */
194 0, /* phase 4 scrach: unused */
195 0, /* phase 5 scrach: unused */
196 };
198 const IPCE_Params IPCE_PARAMS_CUS_SEC = {
199 sizeof(IPCE_Params),
200 &IPCE_PARAMS_STATUS_NODELAY,
201 &IPCE_PARAMS_CONFIG_NODELAY,
202 &IPCE_PARAMS_ACTIVE_NODELAY,
203 &IPCE_PARAMS_SCRACH_CUS_SEC,
204 };
206 #ifndef __TI_EABI__
207 asm (" .global _IPCE_PARAMS");
208 asm ("_IPCE_PARAMS .set _IPCE_PARAMS_NODELAY");
209 #else
210 asm (" .global IPCE_PARAMS");
211 asm ("IPCE_PARAMS .set IPCE_PARAMS_NODELAY");
212 #endif