]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/blob - processor_audio_sdk_1_00_00_00/pasdk/test_dsp/application/itopo/evmk2g/dcs7_params.c
Update test_arm and test_dsp projects for new locations of IPC and PDK eng
[processor-sdk/performance-audio-sr.git] / processor_audio_sdk_1_00_00_00 / pasdk / test_dsp / application / itopo / evmk2g / dcs7_params.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 //
37 //
38 // DA10x SPI, I2C and UART slave control status (DCS7) implementation
39 //
40 //
41 //
43 #include <dcs7.h>
44 #include <dcs7_params.h>
46 #include "dcs7_medialayer.h"
48 #ifdef UARTCALLBACK
49 extern void UART_transferCallback(UART_Handle handle,
50                                     void *buffer, size_t count);
51 #endif
54 const DCS7_Params_Dev_Spi DCS7_PARAMS_DEV_SPI =
55 {
56     sizeof(DCS7_Params_Dev_Spi)
57 };
59 const DCS7_Params_Dev_I2c DCS7_PARAMS_DEV_I2C =
60 {
61     sizeof(DCS7_Params_Dev_I2c),
62 };
64 const DCS7_Params_Dev_Uart DCS7_PARAMS_DEV_UART =
65 {
66     sizeof(DCS7_Params_Dev_Uart),
67     0,     // xrxSize
68     0,     // xrxHwm
69     0,     // xrxLwm
70     0,     // xtxSize
71     0,     // emask
72     NULL,  // hUart
73 #ifdef UARTCALLBACK
74     &UART_transferCallback,  // transferCallbackFxn
75 #endif
76     0,     // isEMDAConfigured
77     SRECORD_RES_MAX_S1_CNT * 72 /*ASCII_SRECORD_S1_MAX_SIZE*/, // scratchBufSize
78     NULL   // scratchBuf
79 };
81 const DCS7_Params_Dev DCS7_PARAMS_DEV =
82 {
83     /* Select the appropriate device from the following choices:
84            DCS7_PARAMS_DEV_SPI - Select SPI device
85            DCS7_PARAMS_DEV_I2C - Select I2C device
86            DCS7_PARAMS_DEV_UART - Select UART device */
87 //    (Uint32)&DCS7_PARAMS_DEV_SPI,
88 //    (Uint32)&DCS7_PARAMS_DEV_I2C,
89     (Uint32)&DCS7_PARAMS_DEV_UART,
90 };
92 Uint32 DCS7Trace = Diags_USER2;
94 const DCS7_Params DCS7_PARAMS =
95 {
96     sizeof(DCS7_Params),
97     /* DCS7 supports following values for device (dev):
98        DCS7_PARAMS_DEV_SPI0 - SPI0 device
99        DCS7_PARAMS_DEV_SPI1 - SPI1 device
100        DCS7_PARAMS_DEV_I2C0 - I2C0 device
101        DCS7_PARAMS_DEV_I2C1 - I2C1 device
102        DCS7_PARAMS_DEV_UART0 - UART0 device */
103     DCS7_PARAMS_DEV_UART0,
104     /* DCS7 supports following values for (psfil):
105        DCS7_PARAMS_PSFIL_ENA - enable processing zero fill
106        DCS7_PARAMS_PSFIL_DIS - disable processing zero fill */
107     DCS7_PARAMS_PSFIL_DIS,
108     /* DCS7 supports following values for processing slc (pslc):
109        DCS7_PARAMS_PSLC_DIS - disable processing slc
110        DCS7_PARAMS_PSLC_ENA - enable processing slc */
111     DCS7_PARAMS_PSLC_ENA,
112     /* DCS7 supports following values for error detection and report (edr):
113        DCS7_PARAMS_EDR_DIS - disable error detection and report
114        DCS7_PARAMS_EDR_ENA - enable error detection and report */
115     DCS7_PARAMS_EDR_ENA,
116     /* Reserved fields */
117     0,0,
118     /* The receive buffer size, watermarks values and the transmit buffer size
119        values should be chosen depending upon the data rate, latency 
120        requirements, application memory requirements, etc. */
121     512,
122     256,
123     512,
124     512,
125     /* DCS7 device parameters */
126     (DCS7_Params_Dev*)&DCS7_PARAMS_DEV,
127     /* DCS7 log param */
128     (Void*) &DCS7Trace,
129 };
131 void DCS7_errorInit()
133     /* Initialize the physical interface that will be used for reporting 
134        error occurence to the master */
137 void DCS7_errorAssert()
139     /* Configure the physical interface to indicate occurence of an error
140        to the master */ 
142 void DCS7_errorDeassert()
144     /* Configure the physical interface to indicate error recovery is 
145        completed and the slave is ready to accept new data */