4e06db9f9901c71a9fef111655cbdd5410536098
[processor-sdk/performance-audio-sr.git] / pasdk / test_dsp / framework / itopo / system.c
2 /*
3 Copyright (c) 2016, 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 #include <xdc/std.h>
37 #include <xdc/cfg/global.h>
38 #include <xdc/runtime/Log.h>
39 #include <xdc/runtime/System.h>
41 #include <paftyp.h>
42 #include <pafsys_a.h> 
43 #include "noasp.h"
44 #include "systemStream.h"
46 const struct {
47     PAF_SST_FxnsMain *main;
48     Int count;
49     struct {
50         PAF_SST_FxnsCompute  *compute;
51         PAF_SST_FxnsTransmit *transmit;
52     } sub[5];
53 } systemStreamPrimaryFxns =
54 {
55     &systemStreamMain,
56     5,
57     {
58         { &systemStream1Compute, &systemStream1Transmit, },
59 #ifndef NOBM
60         { &systemStream2Compute, &systemStream2Transmit, },
61 #endif        
62 #ifndef NODEM
63         { &systemStream3Compute, &systemStream3Transmit, },
64 #endif        
65 #ifdef THX
66         { &systemStream4Compute, &systemStream4Transmit, },
67 #else
68         { NULL, NULL, },
69 #endif
70         { &systemStream5Compute, &systemStream5Transmit, },
71     },
72 };
74 const PAF_SST_Params systemStreamParams_PA[1] =
75 {
76     {
77         1, 0, 1, 1,
78         (const PAF_SST_Fxns *)&systemStreamPrimaryFxns,
79     },
80 };
82 #define systemStreamParams systemStreamParams_PA
84 PAF_SystemStatus systemStreamStatus[1] = {
85     {
86         sizeof (PAF_SystemStatus),
87         PAF_SYS_MODE_ALL,
88         0,
89         PAF_SYS_RECREATIONMODE_AUTO,
90         2 + PAF_SYS_SPEAKERSIZE_SMALL,
91         1 + PAF_SYS_SPEAKERSIZE_SMALL,
92         2 + PAF_SYS_SPEAKERSIZE_SMALL,
93         2 + PAF_SYS_SPEAKERSIZE_SMALL,
94         1 + PAF_SYS_SPEAKERSIZE_BASS,
95         PAF_SYS_CCRTYPE_STANDARD,       // channelConfigurationRequestType
96         0, 0, 0,                        // switchImage, imageNum, imageNumMax
97         0,                              // Unused
98         0, 0,                           // cpuLoad, peakCpuLoad
99         0, 0, 0, 0,                     // speakerWide, speakerHead, unused[2]
100         0, 0, 0, 0,                     //unused2[4]
101         PAF_CC_SAT_UNKNOWN, PAF_CC_SUB_ZERO, 0, 0, 0, 0, 0, 0,
102     },
103 };
105 PAF_SST_Config systemStreamConfig[1] =
107     {
108         NULL,
109         &systemStreamStatus[0],
110     },
111 };
114 extern Int gSysInit;
116 /*
117  *  ======== idleAudioStream ========
118  *  IDLE function for audio stream
119  */
120 Void idleAudioStream()
122     Int32 i;
124     //System_printf("Enter idleAudioStream()\n");    
125     //Log_info0("Enter idleAudioStream()");
127     if (gSysInit == 0)
128         return;
129     
130     for (i=0; i < lengthof(systemStreamConfig); i++)
131         systemStreamParams[i].fxns->main
132             (&systemStreamParams[i], &systemStreamConfig[i]);