TI-RTOS Drivers  tidrivers_full_2_20_00_08
SPIMSP432DMA.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  */
110 #ifndef ti_drivers_spi_SPIMSP432DMA__include
111 #define ti_drivers_spi_SPIMSP432DMA__include
112 
113 #ifdef __cplusplus
114 extern "C" {
115 #endif
116 
117 #include <stdint.h>
118 
119 #include <ti/drivers/ports/HwiP.h>
121 #include <ti/drivers/Power.h>
122 #include <ti/drivers/SPI.h>
124 
135 /* Add SPIMSP432DMA_STATUS_* macros here */
136 
149 /* Add SPIMSP432DMA_CMD_* macros here */
150 
153 /* SPI function table pointer */
155 
204 typedef struct SPIMSP432DMA_HWAttrs {
205  uint32_t baseAddr;
206  uint16_t bitOrder;
207  uint8_t clockSource;
211  uint8_t dmaIntNum;
212  uint32_t intPriority;
213  uint32_t rxDMAChannelIndex;
214  uint32_t txDMAChannelIndex;
216 
222 typedef struct SPIMSP432DMA_Object {
223  SemaphoreP_Handle transferComplete; /* Notify finished SPI transfer */
225 
226  SPI_CallbackFxn transferCallbackFxn; /* Callback fxn in CALLBACK mode */
227  SPI_Transaction *transaction; /* Ptr to the current transaction*/
228 
229  SPI_TransferMode transferMode; /* SPI transfer mode */
230  SPI_Mode spiMode; /* Master or Slave mode */
231  uint8_t scratchBuffer; /* Scratch buffer */
232 
233  bool isOpen;
234 
235  uint32_t bitRate; /* SPI bit rate in Hz */
236  uint16_t clockPhase;
237  uint16_t clockPolarity;
238 
243 
244 #ifdef __cplusplus
245 }
246 #endif
247 
248 #endif /* ti_drivers_spi_SPIMSP432DMA__include */
SPI_TransferMode transferMode
Definition: SPIMSP432DMA.h:229
uint32_t baseAddr
Definition: SPIMSP432DMA.h:205
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
uint16_t clockPhase
Definition: SPIMSP432DMA.h:236
SPI_Mode spiMode
Definition: SPIMSP432DMA.h:230
SPI_TransferMode
SPI transfer mode determines the whether the SPI controller operates synchronously or asynchronously...
Definition: SPI.h:316
Power manager interface.
uint8_t defaultTxBufValue
Definition: SPIMSP432DMA.h:209
struct SPIMSP432DMA_HWAttrs SPIMSP432DMA_HWAttrs
SPIMSP432DMA Hardware attributes These fields, with the exception of intPriority, are used by driverl...
UDMAMSP432_Handle dmaHandle
Definition: SPIMSP432DMA.h:241
HwiP_Handle hwiHandle
Definition: SPIMSP432DMA.h:224
uint32_t txDMAChannelIndex
Definition: SPIMSP432DMA.h:214
void * SemaphoreP_Handle
Opaque client reference to an instance of a SemaphoreP.
Definition: SemaphoreP.h:96
Semaphore module for the RTOS Porting Interface.
uint8_t clockSource
Definition: SPIMSP432DMA.h:207
SPIMSP432DMA Object.
Definition: SPIMSP432DMA.h:222
The definition of a SPI function table that contains the required set of functions to control a speci...
Definition: SPI.h:402
SPI_Transaction * transaction
Definition: SPIMSP432DMA.h:227
uint16_t bitOrder
Definition: SPIMSP432DMA.h:206
struct SPIMSP432DMA_Object SPIMSP432DMA_Object
SPIMSP432DMA Object.
A SPI_Transaction data structure is used with SPI_transfer(). It indicates how many SPI_FrameFormat f...
Definition: SPI.h:262
uDMA driver implementation for MSP432.
SPIMSP432DMA Hardware attributes These fields, with the exception of intPriority, are used by driverl...
Definition: SPIMSP432DMA.h:204
Power notify object structure.
Definition: Power.h:112
SPI_Mode
Definitions for various SPI modes of operation.
Definition: SPI.h:288
uint8_t scratchBuffer
Definition: SPIMSP432DMA.h:231
uint16_t clockPolarity
Definition: SPIMSP432DMA.h:237
UDMAMSP432 Global configuration.
Definition: UDMAMSP432.h:137
uint32_t intPriority
Definition: SPIMSP432DMA.h:212
Power_NotifyObj perfChangeNotify
Definition: SPIMSP432DMA.h:239
uint32_t perfConstraintMask
Definition: SPIMSP432DMA.h:240
uint32_t bitRate
Definition: SPIMSP432DMA.h:235
const SPI_FxnTable SPIMSP432DMA_fxnTable
SPI_CallbackFxn transferCallbackFxn
Definition: SPIMSP432DMA.h:226
SemaphoreP_Handle transferComplete
Definition: SPIMSP432DMA.h:223
uint8_t dmaIntNum
Definition: SPIMSP432DMA.h:211
bool isOpen
Definition: SPIMSP432DMA.h:233
void * HwiP_Handle
Opaque client reference to an instance of a HwiP.
Definition: HwiP.h:66
struct SPIMSP432DMA_Object * SPIMSP432DMA_Handle
Hardware Interrupt module for the RTOS Porting Interface.
uint32_t rxDMAChannelIndex
Definition: SPIMSP432DMA.h:213
Copyright 2016, Texas Instruments Incorporated