TI-RTOS for SimpleLink Wireless MCUs  2.14.03.28
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  */
108 #ifndef ti_drivers_spi_SPIMSP432DMA__include
109 #define ti_drivers_spi_SPIMSP432DMA__include
110 
111 #ifdef __cplusplus
112 extern "C" {
113 #endif
114 
115 #include <stdint.h>
116 
117 #include <ti/drivers/ports/HwiP.h>
119 #include <ti/drivers/Power.h>
120 #include <ti/drivers/SPI.h>
121 
122 /* SPI function table pointer */
124 
173 typedef struct SPIMSP432DMA_HWAttrs {
174  uint32_t baseAddr;
175  uint16_t bitOrder;
176  uint8_t clockSource;
180  uint8_t dmaIntNum;
181  uint32_t intPriority;
182  uint32_t rxDMAChannelIndex;
183  uint32_t txDMAChannelIndex;
185 
191 typedef struct SPIMSP432DMA_Object {
192  SemaphoreP_Handle transferComplete; /* Notify finished SPI transfer */
194 
195  SPI_CallbackFxn transferCallbackFxn; /* Callback fxn in CALLBACK mode */
196  SPI_Transaction *transaction; /* Ptr to the current transaction*/
197 
198  SPI_TransferMode transferMode; /* SPI transfer mode */
199  SPI_Mode spiMode; /* Master or Slave mode */
200  uint8_t scratchBuffer; /* Scratch buffer */
201 
202  bool isOpen;
203 
204  uint32_t bitRate; /* SPI bit rate in Hz */
205  uint16_t clockPhase;
206  uint16_t clockPolarity;
207 
210 
212 
213 #ifdef __cplusplus
214 }
215 #endif
216 
217 #endif /* ti_drivers_spi_SPIMSP432DMA__include */
SPI_TransferMode transferMode
Definition: SPIMSP432DMA.h:198
uint32_t baseAddr
Definition: SPIMSP432DMA.h:174
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
uint16_t clockPhase
Definition: SPIMSP432DMA.h:205
SPI_Mode spiMode
Definition: SPIMSP432DMA.h:199
SPI_TransferMode
SPI transfer mode determines the whether the SPI controller operates synchronously or asynchronously...
Definition: SPI.h:298
Power manager interface.
uint8_t defaultTxBufValue
Definition: SPIMSP432DMA.h:178
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:193
uint32_t txDMAChannelIndex
Definition: SPIMSP432DMA.h:183
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:176
SPIMSP432DMA Object.
Definition: SPIMSP432DMA.h:191
The definition of a SPI function table that contains the required set of functions to control a speci...
Definition: SPI.h:384
SPI_Transaction * transaction
Definition: SPIMSP432DMA.h:196
uint16_t bitOrder
Definition: SPIMSP432DMA.h:175
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:244
SPIMSP432DMA Hardware attributes These fields, with the exception of intPriority, are used by driverl...
Definition: SPIMSP432DMA.h:173
Power notify object structure.
Definition: Power.h:112
SPI_Mode
Definitions for various SPI modes of operation.
Definition: SPI.h:270
uint8_t scratchBuffer
Definition: SPIMSP432DMA.h:200
uint16_t clockPolarity
Definition: SPIMSP432DMA.h:206
uint32_t intPriority
Definition: SPIMSP432DMA.h:181
Power_NotifyObj perfChangeNotify
Definition: SPIMSP432DMA.h:208
uint32_t perfConstraintMask
Definition: SPIMSP432DMA.h:209
uint32_t bitRate
Definition: SPIMSP432DMA.h:204
const SPI_FxnTable SPIMSP432DMA_fxnTable
SPI_CallbackFxn transferCallbackFxn
Definition: SPIMSP432DMA.h:195
SemaphoreP_Handle transferComplete
Definition: SPIMSP432DMA.h:192
uint8_t dmaIntNum
Definition: SPIMSP432DMA.h:180
bool isOpen
Definition: SPIMSP432DMA.h:202
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:182
Copyright 2015, Texas Instruments Incorporated