![]() |
![]() |
TI-RTOS Drivers
tidrivers_full_2_20_01_10
|
SPI driver implementation for a USCIA peripheral using the micro DMA controller.
============================================================================
The SPI header file should be included in an application as follows:
Refer to SPI.h for a complete description of APIs & example of use.
This SPI driver implementation is designed to operate on a UCSI controller in SPI mode. It uses the APIs for a USCIA controller.
The SPIEUSCIADMA operates the controller in 3-pin mode; therefore it is not safe to use in a multi-master SPI bus environment. It is the application's responsibility to assert and de-assert a GPIO pin for chip select purposes.
Chip select type | SPI_MASTER mode | SPI_SLAVE mode |
---|---|---|
Hardware chip select | Not available on this peripheral. | |
Software chip select | The application is responsible to ensure that correct SPI slave is selected before performing a SPI_transfer(). | Up to the application's implementation. |
The MSP430 DMA controller uses a single interrupt vector to handle all DMA related IRQ. Because of the "shared" nature, of the DMA's ISR, this driver implementation provides a simple ISR function SPIEUSCIADMA_hwiIntFxn() which needs to be called from within the DMA's ISR. SPIEUSCIADMA_hwiIntFxn() will only service DMA channel interrupts that are associated with the SPI_Handle. Each SPIEUSCIADMA instance will require a call from within the DMA's ISR.
The USCI controller only supports 8-bit data frames.
dataSize | buffer element size |
---|---|
8 bits | uint8_t |
The MSP430 DMA controller supports 2^16 data frames per transfer. Each SPI driver instance requires 2 DMA channels (Tx and Rx) to operate.
Ensure that the txBuf and rxBuf (in SPI_Transaction) point to memory that is accessible by the DMA.
Go to the source code of this file.
Data Structures | |
struct | SPIEUSCIADMA_HWAttrs |
SPIEUSCIADMA Hardware attributes. More... | |
struct | SPIEUSCIADMA_Object |
SPIEUSCIADMA Object. More... | |
Typedefs | |
typedef struct SPIEUSCIADMA_HWAttrs | SPIEUSCIADMA_HWAttrs |
SPIEUSCIADMA Hardware attributes. More... | |
typedef struct SPIEUSCIADMA_Object | SPIEUSCIADMA_Object |
SPIEUSCIADMA Object. More... | |
typedef struct SPIEUSCIADMA_Object * | SPIEUSCIADMA_Handle |
Variables | |
const SPI_FxnTable | SPIEUSCIADMA_fxnTable |
typedef struct SPIEUSCIADMA_HWAttrs SPIEUSCIADMA_HWAttrs |
SPIEUSCIADMA Hardware attributes.
These fields are used by driverlib APIs and therefore must be populated by driverlib macro definitions. For MSP430Ware these definitions are found in:
A sample structure is shown below:
typedef struct SPIEUSCIADMA_Object SPIEUSCIADMA_Object |
SPIEUSCIADMA Object.
The application must not access any member variables of this structure!
typedef struct SPIEUSCIADMA_Object * SPIEUSCIADMA_Handle |
const SPI_FxnTable SPIEUSCIADMA_fxnTable |