TI-RTOS Drivers
tidrivers_msp43x_2_16_01_13
|
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 SPIEUSCIBDMA 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 SPIEUSCIBDMA_hwiIntFxn() which needs to be called from within the DMA's ISR. SPIEUSCIBDMA_hwiIntFxn() will only service DMA channel interrupts that are associated with the SPI_Handle. Each SPIEUSCIBDMA instance will require a call from within the DMA's ISR.
The EUSCI 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 | SPIEUSCIBDMA_HWAttrs |
SPIEUSCIBDMA Hardware attributes. More... | |
struct | SPIEUSCIBDMA_Object |
SPIEUSCIBDMA Object. More... | |
Typedefs | |
typedef struct SPIEUSCIBDMA_HWAttrs | SPIEUSCIBDMA_HWAttrs |
SPIEUSCIBDMA Hardware attributes. More... | |
typedef struct SPIEUSCIBDMA_Object | SPIEUSCIBDMA_Object |
SPIEUSCIBDMA Object. More... | |
typedef struct SPIEUSCIBDMA_Object * | SPIEUSCIBDMA_Handle |
Variables | |
const SPI_FxnTable | SPIEUSCIBDMA_fxnTable |
typedef struct SPIEUSCIBDMA_HWAttrs SPIEUSCIBDMA_HWAttrs |
SPIEUSCIBDMA 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 SPIEUSCIBDMA_Object SPIEUSCIBDMA_Object |
SPIEUSCIBDMA Object.
The application must not access any member variables of this structure!
typedef struct SPIEUSCIBDMA_Object * SPIEUSCIBDMA_Handle |
const SPI_FxnTable SPIEUSCIBDMA_fxnTable |