TI-RTOS Drivers
tidrivers_msp43x_2_20_00_08
|
SPI driver implementation for a USCIB 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 USCIB controller.
The SPIUSCIBDMA 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 SPIUSCIBDMA_hwiIntFxn() which needs to be called from within the DMA's ISR. SPIUSCIBDMA_hwiIntFxn() will only service DMA channel interrupts that are associated with the SPI_Handle. Each SPIUSCIBDMA 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 | SPIUSCIBDMA_HWAttrs |
SPIUSCIBDMA Hardware attributes. More... | |
struct | SPIUSCIBDMA_Object |
SPIUSCIBDMA Object. More... | |
Typedefs | |
typedef struct SPIUSCIBDMA_HWAttrs | SPIUSCIBDMA_HWAttrs |
SPIUSCIBDMA Hardware attributes. More... | |
typedef struct SPIUSCIBDMA_Object | SPIUSCIBDMA_Object |
SPIUSCIBDMA Object. More... | |
typedef struct SPIUSCIBDMA_Object * | SPIUSCIBDMA_Handle |
Variables | |
const SPI_FxnTable | SPIUSCIBDMA_fxnTable |
typedef struct SPIUSCIBDMA_HWAttrs SPIUSCIBDMA_HWAttrs |
SPIUSCIBDMA 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 SPIUSCIBDMA_Object SPIUSCIBDMA_Object |
SPIUSCIBDMA Object.
The application must not access any member variables of this structure!
typedef struct SPIUSCIBDMA_Object * SPIUSCIBDMA_Handle |
const SPI_FxnTable SPIUSCIBDMA_fxnTable |