TI-RTOS for SimpleLink Wireless MCUs  2.14.03.28
SPIUSCIBDMA.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  */
127 #ifndef ti_drivers_spi_SPIUSCIBDMA__include
128 #define ti_drivers_spi_SPIUSCIBDMA__include
129 
130 #ifdef __cplusplus
131 extern "C" {
132 #endif
133 
134 #include <stdint.h>
135 #include <ti/drivers/SPI.h>
136 
137 #include <ti/sysbios/knl/Semaphore.h>
138 
139 /* SPI function table pointer */
141 
174 typedef struct SPIUSCIBDMA_HWAttrs {
176  uint32_t baseAddr;
178  uint8_t clockSource;
180  uint8_t bitOrder;
182  uint8_t *scratchBufPtr;
185 
187  uint32_t dmaBaseAddr;
197 
203 typedef struct SPIUSCIBDMA_Object {
204  bool isOpen; /* Variable to determine if the SPI is open */
205 
206  Semaphore_Struct transferComplete; /* Notify finished SPI transfer */
207 
208  SPI_TransferMode transferMode; /* SPI transfer mode */
209  SPI_CallbackFxn transferCallbackFxn;/* Callback fxn in CALLBACK mode */
210 
211  SPI_Transaction *transaction; /* Pointer to the current transaction*/
212 
214 
215 #ifdef __cplusplus
216 }
217 #endif
218 
219 #endif /* ti_drivers_spi_SPIUSCIBDMA__include */
Semaphore_Struct transferComplete
Definition: SPIUSCIBDMA.h:206
SPI_Transaction * transaction
Definition: SPIUSCIBDMA.h:211
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:264
SPI_TransferMode
SPI transfer mode determines the whether the SPI controller operates synchronously or asynchronously...
Definition: SPI.h:298
SPIUSCIBDMA Object.
Definition: SPIUSCIBDMA.h:203
uint8_t rxDMASourceTrigger
Definition: SPIUSCIBDMA.h:191
uint8_t * scratchBufPtr
Definition: SPIUSCIBDMA.h:182
The definition of a SPI function table that contains the required set of functions to control a speci...
Definition: SPI.h:384
SPI_TransferMode transferMode
Definition: SPIUSCIBDMA.h:208
struct SPIUSCIBDMA_Object SPIUSCIBDMA_Object
SPIUSCIBDMA Object.
struct SPIUSCIBDMA_Object * SPIUSCIBDMA_Handle
uint8_t rxDMAChannelIndex
Definition: SPIUSCIBDMA.h:189
A SPI_Transaction data structure is used with SPI_transfer(). It indicates how many SPI_FrameFormat f...
Definition: SPI.h:244
uint32_t baseAddr
Definition: SPIUSCIBDMA.h:176
uint8_t defaultTxBufValue
Definition: SPIUSCIBDMA.h:184
const SPI_FxnTable SPIUSCIBDMA_fxnTable
SPI_CallbackFxn transferCallbackFxn
Definition: SPIUSCIBDMA.h:209
uint8_t bitOrder
Definition: SPIUSCIBDMA.h:180
uint32_t dmaBaseAddr
Definition: SPIUSCIBDMA.h:187
uint8_t txDMAChannelIndex
Definition: SPIUSCIBDMA.h:193
bool isOpen
Definition: SPIUSCIBDMA.h:204
uint8_t clockSource
Definition: SPIUSCIBDMA.h:178
struct SPIUSCIBDMA_HWAttrs SPIUSCIBDMA_HWAttrs
SPIUSCIBDMA Hardware attributes.
uint8_t txDMASourceTrigger
Definition: SPIUSCIBDMA.h:195
SPIUSCIBDMA Hardware attributes.
Definition: SPIUSCIBDMA.h:174
Copyright 2015, Texas Instruments Incorporated