Cleaned up system stream.
[processor-sdk/performance-audio-sr.git] / pasdk / test_dsp / framework / itopo / system.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 // Contains definitions for System Stream parameters, status, and configuration.
38 //
40 #include <xdc/std.h>
42 #include <paftyp.h>
43 #include <pafsys_a.h> 
44 #include "noasp.h"
45 #include "systemStream.h"
47 #include "pfp/pfp.h"
48 #include "pfp_app.h"        /* contains all PFP ID's */
50 #define PFP_ENABLE_MASK ( (1<<PFP_ID_ASIT_0) | \
51                           (1<<PFP_ID_ASIT_1) | \
52                           (1<<PFP_ID_ASOT_0) | \
53                           (1<<PFP_ID_ASOT_ASP_0) | \
54                           (1<<PFP_ID_ASOT_ASP_1) | \
55                           (1<<PFP_ID_ASOT_ASP_2) | \
56                           (1<<PFP_ID_ASOT_ASP_3) )
57                           
58 // System Stream parameters, primary functions
59 const struct {
60     PAF_SST_FxnsMain *main;
61     Int count;
62     struct {
63         PAF_SST_FxnsCompute  *compute;
64         PAF_SST_FxnsTransmit *transmit;
65     } sub[5];
66 } systemStreamPrimaryFxns =
67 {
68     &systemStreamMain,
69     5,
70     {
71         { &systemStream1Compute, &systemStream1Transmit, },
72 #ifndef NOBM
73         { &systemStream2Compute, &systemStream2Transmit, },
74 #else
75         { NULL, NULL, },
76 #endif        
77 #ifndef NODEM
78         { &systemStream3Compute, &systemStream3Transmit, },
79 #else
80         { NULL, NULL, },
81 #endif        
82 #ifdef THX
83         { &systemStream4Compute, &systemStream4Transmit, },
84 #else
85         { NULL, NULL, },
86 #endif
87         { &systemStream5Compute, &systemStream5Transmit, },
88     },
89 };
91 // System Stream paramters
92 const PAF_SST_Params systemStreamParams_PA[1] =
93 {
94     {
95         1, 0, 1, 1,                                     // streams, stream1, streamN, ss    
96         (const PAF_SST_Fxns *)&systemStreamPrimaryFxns, // fxns
97     },
98 };
100 // System Stream (SYS) status
101 PAF_SystemStatus systemStreamStatus[1] = {
102     {
103         sizeof (PAF_SystemStatus),
104         PAF_SYS_MODE_ALL,               // mode
105         0,                              // listeningMode
106         PAF_SYS_RECREATIONMODE_AUTO,    // recreationMode
107         2 + PAF_SYS_SPEAKERSIZE_SMALL,  // speakerMain
108         1 + PAF_SYS_SPEAKERSIZE_SMALL,  // speakerCntr
109         2 + PAF_SYS_SPEAKERSIZE_SMALL,  // speakerSurr
110         2 + PAF_SYS_SPEAKERSIZE_SMALL,  // speakerBack
111         1 + PAF_SYS_SPEAKERSIZE_BASS,   // speakerSubw
112         PAF_SYS_CCRTYPE_STANDARD,       // channelConfigurationRequestType
113         0, 0, 0,                        // switchImage, imageNum, imageNumMax
114         0,                              // Unused
115         0, 0,                           // cpuLoad, peakCpuLoad
116         0 + PAF_SYS_SPEAKERSIZE_NONE,   // speakerWide
117         0 + PAF_SYS_SPEAKERSIZE_NONE,   // speakerHead
118         0 + PAF_SYS_SPEAKERSIZE_NONE,   // speakerTopfront
119         0 + PAF_SYS_SPEAKERSIZE_NONE,   // speakerToprear
120         0 + PAF_SYS_SPEAKERSIZE_NONE,   // speakerTopmiddle
121         0 + PAF_SYS_SPEAKERSIZE_NONE,   // speakerFrontheight
122         0 + PAF_SYS_SPEAKERSIZE_NONE,   // speakerRearheight
123         0,                              // unused2
124         PAF_CC_SAT_UNKNOWN, PAF_CC_SUB_ZERO, 0, 0, 0, 0, 0, 0,  // channelConfigurationRequest
125 #ifdef FULL_SPEAKER // paftyp.h
126         0 + PAF_SYS_SPEAKERSIZE_NONE,   // speakerScreen
127         0 + PAF_SYS_SPEAKERSIZE_NONE,   // speakerSurr1
128         0 + PAF_SYS_SPEAKERSIZE_NONE,   // speakerSurr2
129         0 + PAF_SYS_SPEAKERSIZE_NONE,   // speakerRearSurr1
130         0 + PAF_SYS_SPEAKERSIZE_NONE,   // speakerRearSurr2
131         0 + PAF_SYS_SPEAKERSIZE_NONE,   // speakerCntrSurr
132         0 + PAF_SYS_SPEAKERSIZE_NONE,   // speakerLRCntr
133         0 + PAF_SYS_SPEAKERSIZE_NONE,   // speakerLRCntrSurr
134 #else
135         0, 0, 0, 0, 0, 0, 0, 0          // unused3
136 #endif
137         0, 0,                           // asitLoad, peakAsitLoad
138         0, 0,                           // asotLoad, peakAsotLoad
139         0, 0,                           // aipLoad,  peakAipLoad
140         0, 0,                           // afpLoad,  peakAfpLoad
141         0, 0,                           // ssLoad,   peakSsLoad   
142         0, 0,                           // unused4
143         0,                              // pfpDisableMask
144         0,                              // pfpEnableMask
145         PFP_ENABLE_MASK,                // pfpEnabledBf
146         0                               // pfpResetStatsMask
147     },
148 };
150 // System Stream configuration
151 PAF_SST_Config systemStreamConfig[1] =
153     {
154         0,                              // firstTimeInit
155         NULL,                           // acp
156         &systemStreamStatus[0],         // pStatus
157     },
158 };