TI-RTOS Drivers  tidrivers_full_2_20_00_08
I2SCC3200DMA.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2016, Texas Instruments Incorporated
3  * All rights reserved.
4  *
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 distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
48 #ifndef ti_drivers_i2s_I2SCC3200DMA__include
49 #define ti_drivers_i2s_I2SCC3200DMA__include
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
55 #include <stdint.h>
56 #include <stdbool.h>
57 #include <ti/drivers/I2S.h>
58 #include <ti/drivers/ports/HwiP.h>
60 #include <ti/drivers/utils/List.h>
62 
73 /* Add I2SCC3200DMA_STATUS_* macros here */
74 
87 #define I2SCC3200DMA_CMD_SET_ZEROBUF_LEN I2S_CMD_RESERVED + 0
88 #define I2SCC3200DMA_CMD_SET_EMPTYBUF_LEN I2S_CMD_RESERVED + 1
89 
92 /* BACKWARDS COMPATIBILITY */
93 #define I2SCC3200DMA_SET_ZEROBUF_LEN I2SCC3200DMA_CMD_SET_ZEROBUF_LEN
94 #define I2SCC3200DMA_SET_EMPTYBUF_LEN I2SCC3200DMA_CMD_SET_EMPTYBUF_LEN
95 /* END BACKWARDS COMPATIBILITY */
96 
97 /* Value for Invalid Index */
98 #define I2SCC3200DMA_INDEX_INVALID 0xFF
99 
100 /*Number of Serial data pins supported*/
101 #define I2SCC3200DMA_NUM_SERIAL_PINS 2
102 
111 typedef enum I2SCC3200DMA_DataSize {
115 
116 
117 /* I2S function table pointer */
119 
120 
153 typedef struct I2SCC3200DMA_HWAttrs {
155  uint32_t baseAddr;
157  uint32_t intNum;
159  uint32_t intPriority;
161  unsigned long rxChannelIndex;
163  unsigned long txChannelIndex;
165 
171  unsigned char pinNumber;
172 
175 
178 
180 
185 
188 
190 
198  /* Pointer to read/write callback */
200  /* Timeout for read/write semaphore */
202 
204 
210 typedef struct I2SCC3200DMA_Object {
211  /* I2S control variables */
212  bool opened; /* Has the obj been opened */
213  uint32_t operationMode; /* Mode of operation of I2S */
214 
215  /* I2S serial pin variables */
217 
218  uint16_t readIndex; /* read channel Index */
219  uint16_t writeIndex; /* write channel Index */
220 
221  I2SCC3200DMA_DataSize dmaSize; /* Config DMA word size */
222 
223  /* I2S OSAL objects */
224  SemaphoreP_Handle writeSem; /* I2S write semaphore*/
225  SemaphoreP_Handle readSem; /* I2S read semaphore */
227 
229  unsigned long zeroWriteBufLength;
230 
233  unsigned long emptyReadBufLength;
234 
235  /* Current Write buffer descriptor pointer */
237 
238  /* Current Read buffer descriptor pointer */
240 
241  /* UDMA */
243 
244  /* Lists for issue-reclaim mode */
250 
265 
266 #ifdef __cplusplus
267 }
268 #endif
269 
270 #endif /* ti_drivers_i2s_I2SCC3200DMA__include */
void I2SCC3200DMA_Params_init(I2SCC3200DMA_SerialPinParams *params)
Function to initialize the I2S_Params struct to its defaults.
Definition: I2SCC3200DMA.h:113
const I2S_FxnTable I2SCC3200DMA_fxnTable
struct I2SCC3200DMA_SerialPinParams I2SCC3200DMA_SerialPinParams
CC3200 specific I2S Parameters.
SemaphoreP_Handle readSem
Definition: I2SCC3200DMA.h:225
The definition of a I2S function table that contains the required set of functions to control a speci...
Definition: I2S.h:431
uint32_t baseAddr
Definition: I2SCC3200DMA.h:155
I2SCC3200DMA_DataSize dmaSize
Definition: I2SCC3200DMA.h:221
UDMACC3200_Handle dmaHandle
Definition: I2SCC3200DMA.h:242
Definition: List.h:131
#define I2SCC3200DMA_NUM_SERIAL_PINS
Definition: I2SCC3200DMA.h:101
unsigned long rxChannelIndex
Definition: I2SCC3200DMA.h:161
struct I2SCC3200DMA_Object * I2SCC3200DMA_Handle
uDMA driver implementation for CC3200.
List_List readActiveQueue
Definition: I2SCC3200DMA.h:245
unsigned long zeroWriteBufLength
Definition: I2SCC3200DMA.h:229
struct I2SCC3200DMA_SerialPinConfig I2SCC3200DMA_SerialPinConfig
CC3200 Serial Pin Configuration.
SemaphoreP_Handle writeSem
Definition: I2SCC3200DMA.h:224
unsigned long txChannelIndex
Definition: I2SCC3200DMA.h:163
unsigned char pinNumber
Definition: I2SCC3200DMA.h:171
CC3200 specific I2S Parameters.
Definition: I2SCC3200DMA.h:184
I2S_Callback readWriteCallback
Definition: I2SCC3200DMA.h:199
struct I2SCC3200DMA_Object I2SCC3200DMA_Object
I2SCC3200DMA Object.
I2S_BufDesc * CurrentWriteBufDesc
Definition: I2SCC3200DMA.h:236
I2SCC3200DMA Hardware attributes.
Definition: I2SCC3200DMA.h:153
List_List writeDoneQueue
Definition: I2SCC3200DMA.h:248
HwiP_Handle hwiHandle
Definition: I2SCC3200DMA.h:226
void * SemaphoreP_Handle
Opaque client reference to an instance of a SemaphoreP.
Definition: SemaphoreP.h:96
Semaphore module for the RTOS Porting Interface.
I2S buffer descriptor for issue/reclaim mode.
Definition: I2S.h:258
uint32_t intPriority
Definition: I2SCC3200DMA.h:159
uint32_t intNum
Definition: I2SCC3200DMA.h:157
struct I2SCC3200DMA_HWAttrs I2SCC3200DMA_HWAttrs
I2SCC3200DMA Hardware attributes.
uint16_t writeIndex
Definition: I2SCC3200DMA.h:219
uint32_t readWriteTimeout
Definition: I2SCC3200DMA.h:201
unsigned long emptyReadBufLength
Definition: I2SCC3200DMA.h:233
uint32_t operationMode
Definition: I2SCC3200DMA.h:213
I2S_DataMode
I2S mode settings.
Definition: I2S.h:291
bool opened
Definition: I2SCC3200DMA.h:212
I2S driver interface.
I2SCC3200DMA_SerialPinVars serialPinVars[I2SCC3200DMA_NUM_SERIAL_PINS]
Definition: I2SCC3200DMA.h:216
List_List readDoneQueue
Definition: I2SCC3200DMA.h:246
I2SCC3200DMA_DataSize
I2SCC3200DMA data size is used to determine how to configure the DMA data transfers. This field is to be only used internally.
Definition: I2SCC3200DMA.h:111
Definition: I2SCC3200DMA.h:112
struct I2SCC3200DMA_SerialPinVars I2SCC3200DMA_SerialPinVars
I2SCC3200DMA Serial pin variables.
UDMACC3200 Global configuration.
Definition: UDMACC3200.h:135
I2S_DataMode readWriteMode
Definition: I2SCC3200DMA.h:197
I2S_SerInActiveConfig
I2S Serializer InActive state settings.
Definition: I2S.h:324
void(* I2S_Callback)(I2S_Handle, I2S_BufDesc *desc)
The definition of a callback function used by the I2S driver when used in I2S_MODE_CALLBACK.
Definition: I2S.h:283
I2S_BufDesc * CurrentReadBufDesc
Definition: I2SCC3200DMA.h:239
I2S_PinMode pinMode
Definition: I2SCC3200DMA.h:174
I2SCC3200DMA_SerialPinConfig serialPinConfig[I2SCC3200DMA_NUM_SERIAL_PINS]
Definition: I2SCC3200DMA.h:187
uint16_t readIndex
Definition: I2SCC3200DMA.h:218
List_List writeActiveQueue
Definition: I2SCC3200DMA.h:247
I2S_SerInActiveConfig inActiveConfig
Definition: I2SCC3200DMA.h:177
void * HwiP_Handle
Opaque client reference to an instance of a HwiP.
Definition: HwiP.h:66
I2S_PinMode
I2S serial pin mode.
Definition: I2S.h:335
I2SCC3200DMA Object.
Definition: I2SCC3200DMA.h:210
Hardware Interrupt module for the RTOS Porting Interface.
CC3200 Serial Pin Configuration.
Definition: I2SCC3200DMA.h:169
Linked List interface for use in drivers.
I2SCC3200DMA Serial pin variables.
Definition: I2SCC3200DMA.h:196
Copyright 2016, Texas Instruments Incorporated