TI-RTOS Drivers  tidrivers_cc32xx_2_16_00_08
SPICC3200DMA.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015, 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>
116 
127 /* Add SPICC3200DMA_STATUS_* macros here */
128 
141 /* Add SPICC3200DMA_CMD_* macros here */
142 
145 typedef unsigned long SPIBaseAddrType;
146 typedef unsigned long SPIDataType;
147 
148 /* SPI function table pointer */
150 
165 
219 typedef struct SPICC3200DMA_HWAttrs {
221  SPIBaseAddrType baseAddr;
222 
224  uint32_t intNum;
225 
227  uint32_t intPriority;
228 
230  uint32_t spiPRCM;
231 
233  uint32_t csControl;
234 
235  uint32_t csPolarity;
236 
238  uint32_t pinMode;
239 
241  uint32_t turboMode;
242 
244  uint32_t *scratchBufPtr;
245 
247  unsigned long defaultTxBufValue;
248 
250  uint32_t rxChannelIndex;
251 
253  uint32_t txChannelIndex;
254 
258 
264 typedef struct SPICC3200DMA_Object {
267 
269  unsigned int powerMgrId;
270 
271  uint32_t bitRate;
272  uint32_t dataSize;
275 
276  void (*spiPollingFxn) (uint32_t baseAddr, void *rx,
277  void *tx, uint8_t rxInc, uint8_t txInc,
278  size_t count);
279 
280  uint8_t rxFifoTrigger;
281  uint8_t txFifoTrigger;
286 
287  bool isOpen;
289 
290 #ifdef __cplusplus
291 }
292 #endif
293 
294 #endif /* ti_drivers_spi_SPICC3200DMA__include */
const SPI_FxnTable SPICC3200DMA_fxnTable
uint32_t pinMode
Definition: SPICC3200DMA.h:238
uint32_t intNum
Definition: SPICC3200DMA.h:224
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:160
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:287
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:244
Definition: SPICC3200DMA.h:163
SPICC3200DMA Hardware attributes.
Definition: SPICC3200DMA.h:219
uint32_t minDmaTransferSize
Definition: SPICC3200DMA.h:256
uint8_t rxFifoTrigger
Definition: SPICC3200DMA.h:280
Power manager interface.
uint8_t txFifoTrigger
Definition: SPICC3200DMA.h:281
SPI_Transaction * transaction
Definition: SPICC3200DMA.h:274
uint32_t dataSize
Definition: SPICC3200DMA.h:272
SPI_FrameFormat frameFormat
Definition: SPICC3200DMA.h:284
Definition: SPICC3200DMA.h:161
HwiP_Handle hwiHandle
Definition: SPICC3200DMA.h:265
unsigned int powerMgrId
Definition: SPICC3200DMA.h:269
void(* spiPollingFxn)(uint32_t baseAddr, void *rx, void *tx, uint8_t rxInc, uint8_t txInc, size_t count)
Definition: SPICC3200DMA.h:276
uint32_t txChannelIndex
Definition: SPICC3200DMA.h:253
uint32_t bitRate
Definition: SPICC3200DMA.h:271
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:273
struct SPICC3200DMA_Object * SPICC3200DMA_Handle
uint32_t csPolarity
Definition: SPICC3200DMA.h:235
unsigned long SPIBaseAddrType
Definition: SPICC3200DMA.h:145
unsigned long SPIDataType
Definition: SPICC3200DMA.h:146
SemaphoreP_Handle transferComplete
Definition: SPICC3200DMA.h:266
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:221
SPICC3200DMA_FrameSize frameSize
Definition: SPICC3200DMA.h:285
Definition: SPICC3200DMA.h:162
SPI_TransferMode transferMode
Definition: SPICC3200DMA.h:283
struct SPICC3200DMA_HWAttrs SPICC3200DMA_HWAttrs
SPICC3200DMA Hardware attributes.
uint32_t csControl
Definition: SPICC3200DMA.h:233
uint32_t turboMode
Definition: SPICC3200DMA.h:241
void * HwiP_Handle
Opaque client reference to an instance of a HwiP.
Definition: HwiP.h:66
uint32_t rxChannelIndex
Definition: SPICC3200DMA.h:250
Hardware Interrupt module for the RTOS Porting Interface.
Power_NotifyObj notifyObj
Definition: SPICC3200DMA.h:268
uint32_t spiPRCM
Definition: SPICC3200DMA.h:230
uint32_t intPriority
Definition: SPICC3200DMA.h:227
SPI_Mode spiMode
Definition: SPICC3200DMA.h:282
SPICC3200DMA Object.
Definition: SPICC3200DMA.h:264
SPI_FrameFormat
Definitions for various SPI data frame formats.
Definition: SPI.h:297
unsigned long defaultTxBufValue
Definition: SPICC3200DMA.h:247
Copyright 2016, Texas Instruments Incorporated