TI-RTOS Drivers  tidrivers_msp43x_2_16_00_08
SPIMSP432DMA.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  */
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>
123 
134 /* Add SPIMSP432DMA_STATUS_* macros here */
135 
148 /* Add SPIMSP432DMA_CMD_* macros here */
149 
152 /* SPI function table pointer */
154 
203 typedef struct SPIMSP432DMA_HWAttrs {
204  uint32_t baseAddr;
205  uint16_t bitOrder;
206  uint8_t clockSource;
210  uint8_t dmaIntNum;
211  uint32_t intPriority;
212  uint32_t rxDMAChannelIndex;
213  uint32_t txDMAChannelIndex;
215 
221 typedef struct SPIMSP432DMA_Object {
222  SemaphoreP_Handle transferComplete; /* Notify finished SPI transfer */
224 
225  SPI_CallbackFxn transferCallbackFxn; /* Callback fxn in CALLBACK mode */
226  SPI_Transaction *transaction; /* Ptr to the current transaction*/
227 
228  SPI_TransferMode transferMode; /* SPI transfer mode */
229  SPI_Mode spiMode; /* Master or Slave mode */
230  uint8_t scratchBuffer; /* Scratch buffer */
231 
232  bool isOpen;
233 
234  uint32_t bitRate; /* SPI bit rate in Hz */
235  uint16_t clockPhase;
236  uint16_t clockPolarity;
237 
240 
242 
243 #ifdef __cplusplus
244 }
245 #endif
246 
247 #endif /* ti_drivers_spi_SPIMSP432DMA__include */
SPI_TransferMode transferMode
Definition: SPIMSP432DMA.h:228
uint32_t baseAddr
Definition: SPIMSP432DMA.h:204
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:235
SPI_Mode spiMode
Definition: SPIMSP432DMA.h:229
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:208
struct SPIMSP432DMA_HWAttrs SPIMSP432DMA_HWAttrs
SPIMSP432DMA Hardware attributes These fields, with the exception of intPriority, are used by driverl...
HwiP_Handle hwiHandle
Definition: SPIMSP432DMA.h:223
uint32_t txDMAChannelIndex
Definition: SPIMSP432DMA.h:213
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:206
SPIMSP432DMA Object.
Definition: SPIMSP432DMA.h:221
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:226
uint16_t bitOrder
Definition: SPIMSP432DMA.h:205
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
SPIMSP432DMA Hardware attributes These fields, with the exception of intPriority, are used by driverl...
Definition: SPIMSP432DMA.h:203
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:230
uint16_t clockPolarity
Definition: SPIMSP432DMA.h:236
uint32_t intPriority
Definition: SPIMSP432DMA.h:211
Power_NotifyObj perfChangeNotify
Definition: SPIMSP432DMA.h:238
uint32_t perfConstraintMask
Definition: SPIMSP432DMA.h:239
uint32_t bitRate
Definition: SPIMSP432DMA.h:234
const SPI_FxnTable SPIMSP432DMA_fxnTable
SPI_CallbackFxn transferCallbackFxn
Definition: SPIMSP432DMA.h:225
SemaphoreP_Handle transferComplete
Definition: SPIMSP432DMA.h:222
uint8_t dmaIntNum
Definition: SPIMSP432DMA.h:210
bool isOpen
Definition: SPIMSP432DMA.h:232
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:212
Copyright 2016, Texas Instruments Incorporated