TI-RTOS Drivers  tidrivers_full_2_20_00_08
SPICC3200DMA.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  */
105 #ifndef ti_drivers_spi_SPICC3200DMA__include
106 #define ti_drivers_spi_SPICC3200DMA__include
107 
108 #ifdef __cplusplus
109 extern "C" {
110 #endif
111 
112 #include <ti/drivers/ports/HwiP.h>
114 #include <ti/drivers/Power.h>
115 #include <ti/drivers/SPI.h>
117 
128 /* Add SPICC3200DMA_STATUS_* macros here */
129 
142 /* Add SPICC3200DMA_CMD_* macros here */
143 
146 typedef unsigned long SPIBaseAddrType;
147 typedef unsigned long SPIDataType;
148 
149 /* SPI function table pointer */
151 
166 
220 typedef struct SPICC3200DMA_HWAttrs {
222  SPIBaseAddrType baseAddr;
223 
225  uint32_t intNum;
226 
228  uint32_t intPriority;
229 
231  uint32_t spiPRCM;
232 
234  uint32_t csControl;
235 
236  uint32_t csPolarity;
237 
239  uint32_t pinMode;
240 
242  uint32_t turboMode;
243 
245  uint32_t *scratchBufPtr;
246 
248  unsigned long defaultTxBufValue;
249 
251  uint32_t rxChannelIndex;
252 
254  uint32_t txChannelIndex;
255 
259 
265 typedef struct SPICC3200DMA_Object {
268 
270  unsigned int powerMgrId;
271 
272  uint32_t bitRate;
273  uint32_t dataSize;
276 
277  void (*spiPollingFxn) (uint32_t baseAddr, void *rx,
278  void *tx, uint8_t rxInc, uint8_t txInc,
279  size_t count);
280 
281  uint8_t rxFifoTrigger;
282  uint8_t txFifoTrigger;
287 
288  bool isOpen;
289 
290  /* UDMA */
293 
294 #ifdef __cplusplus
295 }
296 #endif
297 
298 #endif /* ti_drivers_spi_SPICC3200DMA__include */
const SPI_FxnTable SPICC3200DMA_fxnTable
UDMACC3200_Handle dmaHandle
Definition: SPICC3200DMA.h:291
uint32_t pinMode
Definition: SPICC3200DMA.h:239
uint32_t intNum
Definition: SPICC3200DMA.h:225
SPICC3200DMA_FrameSize
SPICC3200DMA data frame size is used to determine how to configure the DMA data transfers. This field is to be only used internally.
Definition: SPICC3200DMA.h:161
SPI driver interface.
void(* SPI_CallbackFxn)(SPI_Handle handle, SPI_Transaction *transaction)
The definition of a callback function used by the SPI driver when used in SPI_MODE_CALLBACK.
Definition: SPI.h:282
bool isOpen
Definition: SPICC3200DMA.h:288
uDMA driver implementation for CC3200.
SPI_TransferMode
SPI transfer mode determines the whether the SPI controller operates synchronously or asynchronously...
Definition: SPI.h:316
uint32_t * scratchBufPtr
Definition: SPICC3200DMA.h:245
Definition: SPICC3200DMA.h:164
SPICC3200DMA Hardware attributes.
Definition: SPICC3200DMA.h:220
uint32_t minDmaTransferSize
Definition: SPICC3200DMA.h:257
uint8_t rxFifoTrigger
Definition: SPICC3200DMA.h:281
Power manager interface.
uint8_t txFifoTrigger
Definition: SPICC3200DMA.h:282
SPI_Transaction * transaction
Definition: SPICC3200DMA.h:275
uint32_t dataSize
Definition: SPICC3200DMA.h:273
SPI_FrameFormat frameFormat
Definition: SPICC3200DMA.h:285
Definition: SPICC3200DMA.h:162
HwiP_Handle hwiHandle
Definition: SPICC3200DMA.h:266
unsigned int powerMgrId
Definition: SPICC3200DMA.h:270
void(* spiPollingFxn)(uint32_t baseAddr, void *rx, void *tx, uint8_t rxInc, uint8_t txInc, size_t count)
Definition: SPICC3200DMA.h:277
uint32_t txChannelIndex
Definition: SPICC3200DMA.h:254
uint32_t bitRate
Definition: SPICC3200DMA.h:272
void * SemaphoreP_Handle
Opaque client reference to an instance of a SemaphoreP.
Definition: SemaphoreP.h:96
struct SPICC3200DMA_Object SPICC3200DMA_Object
SPICC3200DMA Object.
Semaphore module for the RTOS Porting Interface.
The definition of a SPI function table that contains the required set of functions to control a speci...
Definition: SPI.h:402
SPI_CallbackFxn transferCallbackFxn
Definition: SPICC3200DMA.h:274
struct SPICC3200DMA_Object * SPICC3200DMA_Handle
uint32_t csPolarity
Definition: SPICC3200DMA.h:236
unsigned long SPIBaseAddrType
Definition: SPICC3200DMA.h:146
unsigned long SPIDataType
Definition: SPICC3200DMA.h:147
SemaphoreP_Handle transferComplete
Definition: SPICC3200DMA.h:267
A SPI_Transaction data structure is used with SPI_transfer(). It indicates how many SPI_FrameFormat f...
Definition: SPI.h:262
Power notify object structure.
Definition: Power.h:112
SPI_Mode
Definitions for various SPI modes of operation.
Definition: SPI.h:288
SPIBaseAddrType baseAddr
Definition: SPICC3200DMA.h:222
SPICC3200DMA_FrameSize frameSize
Definition: SPICC3200DMA.h:286
Definition: SPICC3200DMA.h:163
SPI_TransferMode transferMode
Definition: SPICC3200DMA.h:284
UDMACC3200 Global configuration.
Definition: UDMACC3200.h:135
struct SPICC3200DMA_HWAttrs SPICC3200DMA_HWAttrs
SPICC3200DMA Hardware attributes.
uint32_t csControl
Definition: SPICC3200DMA.h:234
uint32_t turboMode
Definition: SPICC3200DMA.h:242
void * HwiP_Handle
Opaque client reference to an instance of a HwiP.
Definition: HwiP.h:66
uint32_t rxChannelIndex
Definition: SPICC3200DMA.h:251
Hardware Interrupt module for the RTOS Porting Interface.
Power_NotifyObj notifyObj
Definition: SPICC3200DMA.h:269
uint32_t spiPRCM
Definition: SPICC3200DMA.h:231
uint32_t intPriority
Definition: SPICC3200DMA.h:228
SPI_Mode spiMode
Definition: SPICC3200DMA.h:283
SPICC3200DMA Object.
Definition: SPICC3200DMA.h:265
SPI_FrameFormat
Definitions for various SPI data frame formats.
Definition: SPI.h:297
unsigned long defaultTxBufValue
Definition: SPICC3200DMA.h:248
Copyright 2016, Texas Instruments Incorporated