2 * -------------------------------------------
3 * CC3220 SDK - v0.10.00.00
4 * -------------------------------------------
6 * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
12 * Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
15 * Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the
20 * Neither the name of Texas Instruments Incorporated nor the names of
21 * its contributors may be used to endorse or promote products derived
22 * from this software without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
28 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
30 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 //*****************************************************************************
41 // Defines and Macros for the I2S.
43 //*****************************************************************************
48 //*****************************************************************************
50 // If building with a C++ compiler, make all of the definitions in this header
53 //*****************************************************************************
59 //*****************************************************************************
63 //*****************************************************************************
64 #define I2S_TX_DMA_PORT 0x4401E200
65 #define I2S_RX_DMA_PORT 0x4401E280
67 //*****************************************************************************
69 // Values that can be passed to I2SConfigSetExpClk() as the ulConfig parameter.
71 //*****************************************************************************
72 #define I2S_SLOT_SIZE_8 0x00300032
73 #define I2S_SLOT_SIZE_16 0x00700074
74 #define I2S_SLOT_SIZE_24 0x00B000B6
77 #define I2S_PORT_CPU 0x00080008
78 #define I2S_PORT_DMA 0x00000000
80 #define I2S_MODE_MASTER 0x00000000
81 #define I2S_MODE_SLAVE 0x00008000
83 //*****************************************************************************
85 // Values that can be passed as ulDataLine parameter.
87 //*****************************************************************************
88 #define I2S_DATA_LINE_0 0x00000001
89 #define I2S_DATA_LINE_1 0x00000002
91 //*****************************************************************************
93 // Values that can be passed to I2SSerializerConfig() as the ulSerMode
96 //*****************************************************************************
97 #define I2S_SER_MODE_TX 0x00000001
98 #define I2S_SER_MODE_RX 0x00000002
99 #define I2S_SER_MODE_DISABLE 0x00000000
101 //*****************************************************************************
103 // Values that can be passed to I2SSerializerConfig() as the ulInActState
106 //*****************************************************************************
107 #define I2S_INACT_TRI_STATE 0x00000000
108 #define I2S_INACT_LOW_LEVEL 0x00000008
109 #define I2S_INACT_HIGH_LEVEL 0x0000000C
111 //*****************************************************************************
113 // Values that can be passed to I2SIntEnable() and I2SIntDisable() as the
114 // ulIntFlags parameter.
116 //*****************************************************************************
117 #define I2S_INT_XUNDRN 0x00000001
118 #define I2S_INT_XSYNCERR 0x00000002
119 #define I2S_INT_XLAST 0x00000010
120 #define I2S_INT_XDATA 0x00000020
121 #define I2S_INT_XSTAFRM 0x00000080
122 #define I2S_INT_XDMA 0x80000000
123 #define I2S_INT_ROVRN 0x00010000
124 #define I2S_INT_RSYNCERR 0x00020000
125 #define I2S_INT_RLAST 0x00100000
126 #define I2S_INT_RDATA 0x00200000
127 #define I2S_INT_RSTAFRM 0x00800000
128 #define I2S_INT_RDMA 0x40000000
131 //*****************************************************************************
133 // Values that can be passed to I2SRxActiveSlotSet() and I2STxActiveSlotSet
135 //*****************************************************************************
136 #define I2S_ACT_SLOT_EVEN 0x00000001
137 #define I2S_ACT_SLOT_ODD 0x00000002
139 //*****************************************************************************
141 // Values that can be passed to I2SIntClear() as the
142 // ulIntFlags parameter and returned from I2SIntStatus().
144 //*****************************************************************************
145 #define I2S_STS_XERR 0x00000100
146 #define I2S_STS_XDMAERR 0x00000080
147 #define I2S_STS_XSTAFRM 0x00000040
148 #define I2S_STS_XDATA 0x00000020
149 #define I2S_STS_XLAST 0x00000010
150 #define I2S_STS_XSYNCERR 0x00000002
151 #define I2S_STS_XUNDRN 0x00000001
152 #define I2S_STS_XDMA 0x80000000
153 #define I2S_STS_RERR 0x01000000
154 #define I2S_STS_RDMAERR 0x00800000
155 #define I2S_STS_RSTAFRM 0x00400000
156 #define I2S_STS_RDATA 0x00200000
157 #define I2S_STS_RLAST 0x00100000
158 #define I2S_STS_RSYNCERR 0x00020000
159 #define I2S_STS_ROVERN 0x00010000
160 #define I2S_STS_RDMA 0x40000000
162 //*****************************************************************************
164 // Values that can be passed to I2SEnable() as the ulMode parameter.
166 //*****************************************************************************
167 #define I2S_MODE_TX_ONLY 0x00000001
168 #define I2S_MODE_TX_RX_SYNC 0x00000003
171 //*****************************************************************************
173 // API Function prototypes
175 //*****************************************************************************
176 extern void I2SEnable(unsigned long ulBase, unsigned long ulMode);
177 extern void I2SDisable(unsigned long ulBase);
179 extern void I2SDataPut(unsigned long ulBase, unsigned long ulDataLine,
180 unsigned long ulData);
181 extern long I2SDataPutNonBlocking(unsigned long ulBase,
182 unsigned long ulDataLine, unsigned long ulData);
184 extern void I2SDataGet(unsigned long ulBase, unsigned long ulDataLine,
185 unsigned long *pulData);
186 extern long I2SDataGetNonBlocking(unsigned long ulBase,
187 unsigned long ulDataLine, unsigned long *pulData);
189 extern void I2SConfigSetExpClk(unsigned long ulBase, unsigned long ulI2SClk,
190 unsigned long ulBitClk, unsigned long ulConfig);
192 extern void I2STxFIFOEnable(unsigned long ulBase, unsigned long ulTxLevel,
193 unsigned long ulWordsPerTransfer);
194 extern void I2STxFIFODisable(unsigned long ulBase);
195 extern void I2SRxFIFOEnable(unsigned long ulBase, unsigned long ulRxLevel,
196 unsigned long ulWordsPerTransfer);
197 extern void I2SRxFIFODisable(unsigned long ulBase);
198 extern unsigned long I2STxFIFOStatusGet(unsigned long ulBase);
199 extern unsigned long I2SRxFIFOStatusGet(unsigned long ulBase);
201 extern void I2SSerializerConfig(unsigned long ulBase, unsigned long ulDataLine,
202 unsigned long ulSerMode, unsigned long ulInActState);
204 extern void I2SIntEnable(unsigned long ulBase, unsigned long ulIntFlags);
205 extern void I2SIntDisable(unsigned long ulBase, unsigned long ulIntFlags);
206 extern unsigned long I2SIntStatus(unsigned long ulBase);
207 extern void I2SIntClear(unsigned long ulBase, unsigned long ulIntFlags);
208 extern void I2SIntRegister(unsigned long ulBase, void (*pfnHandler)(void));
209 extern void I2SIntUnregister(unsigned long ulBase);
210 extern void I2STxActiveSlotSet(unsigned long ulBase, unsigned long ulActSlot);
211 extern void I2SRxActiveSlotSet(unsigned long ulBase, unsigned long ulActSlot);
213 //*****************************************************************************
215 // Mark the end of the C bindings section for C++ compilers.
217 //*****************************************************************************