TI-RTOS Drivers  tidrivers_full_2_20_00_08
SPIEUSCIBDMA.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  */
129 #ifndef ti_drivers_spi_SPIEUSCIBDMA__include
130 #define ti_drivers_spi_SPIEUSCIBDMA__include
131 
132 #ifdef __cplusplus
133 extern "C" {
134 #endif
135 
136 #include <stdint.h>
137 #include <ti/drivers/SPI.h>
138 
139 #include <ti/sysbios/knl/Semaphore.h>
140 
151 /* Add SPIUSCIBDMA_STATUS_* macros here */
152 
165 /* Add SPIEUSCIBDMA_CMD_* macros here */
166 
169 /* SPI function table pointer */
171 
204 typedef struct SPIEUSCIBDMA_HWAttrs {
206  uint32_t baseAddr;
208  uint8_t clockSource;
210  uint16_t bitOrder;
212  uint8_t *scratchBufPtr;
215 
217  uint32_t dmaBaseAddr;
227 
233 typedef struct SPIEUSCIBDMA_Object {
234  bool isOpen; /* Variable to determine if the SPI is open */
235 
236  Semaphore_Struct transferComplete; /* Notify finished SPI transfer */
237 
238  SPI_TransferMode transferMode; /* SPI transfer mode */
239  SPI_CallbackFxn transferCallbackFxn;/* Callback fxn in CALLBACK mode */
240 
241  SPI_Transaction *transaction; /* Ptr to the current transaction*/
242 
244 
245 #ifdef __cplusplus
246 }
247 #endif
248 
249 #endif /* ti_drivers_spi_SPIEUSCIBDMA__include */
SPIEUSCIBDMA Object.
Definition: SPIEUSCIBDMA.h:233
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
SPI_Transaction * transaction
Definition: SPIEUSCIBDMA.h:241
bool isOpen
Definition: SPIEUSCIBDMA.h:234
SPI_TransferMode
SPI transfer mode determines the whether the SPI controller operates synchronously or asynchronously...
Definition: SPI.h:316
struct SPIEUSCIBDMA_HWAttrs SPIEUSCIBDMA_HWAttrs
SPIEUSCIBDMA Hardware attributes.
SPIEUSCIBDMA Hardware attributes.
Definition: SPIEUSCIBDMA.h:204
uint32_t baseAddr
Definition: SPIEUSCIBDMA.h:206
uint8_t rxDMASourceTrigger
Definition: SPIEUSCIBDMA.h:221
uint16_t bitOrder
Definition: SPIEUSCIBDMA.h:210
uint8_t txDMASourceTrigger
Definition: SPIEUSCIBDMA.h:225
The definition of a SPI function table that contains the required set of functions to control a speci...
Definition: SPI.h:402
uint8_t txDMAChannelIndex
Definition: SPIEUSCIBDMA.h:223
uint8_t defaultTxBufValue
Definition: SPIEUSCIBDMA.h:214
struct SPIEUSCIBDMA_Object * SPIEUSCIBDMA_Handle
Semaphore_Struct transferComplete
Definition: SPIEUSCIBDMA.h:236
A SPI_Transaction data structure is used with SPI_transfer(). It indicates how many SPI_FrameFormat f...
Definition: SPI.h:262
const SPI_FxnTable SPIEUSCIBDMA_fxnTable
uint32_t dmaBaseAddr
Definition: SPIEUSCIBDMA.h:217
uint8_t clockSource
Definition: SPIEUSCIBDMA.h:208
SPI_CallbackFxn transferCallbackFxn
Definition: SPIEUSCIBDMA.h:239
uint8_t rxDMAChannelIndex
Definition: SPIEUSCIBDMA.h:219
SPI_TransferMode transferMode
Definition: SPIEUSCIBDMA.h:238
uint8_t * scratchBufPtr
Definition: SPIEUSCIBDMA.h:212
struct SPIEUSCIBDMA_Object SPIEUSCIBDMA_Object
SPIEUSCIBDMA Object.
Copyright 2016, Texas Instruments Incorporated