Contiki-NG

Header file for the cc2538 SPI driver, including macros for the implementation of the low-level SPI primitives such as waiting for the TX FIFO to be ready, inserting into the TX FIFO, etc. More...

#include "contiki.h"
#include "dev/ssi.h"

Go to the source code of this file.

Functions

Arch-specific SPI functions
void spix_init (uint8_t spi)
 Initialize the SPI bus for the instance given. More...
 
void spix_enable (uint8_t spi)
 Enables the SPI peripheral for the instance given.
 
void spix_disable (uint8_t spi)
 Disables the SPI peripheral for the instance given. More...
 
void spix_set_mode (uint8_t spi, uint32_t frame_format, uint32_t clock_polarity, uint32_t clock_phase, uint32_t data_size)
 Configure the SPI data and clock polarity and the data size for the instance given. More...
 
void spix_set_clock_freq (uint8_t spi, uint32_t freq)
 Sets the SPI clock frequency of the given SSI instance. More...
 
void spix_cs_init (uint8_t port, uint8_t pin)
 Configure a GPIO to be the chip select pin. More...
 

Detailed Description

Header file for the cc2538 SPI driver, including macros for the implementation of the low-level SPI primitives such as waiting for the TX FIFO to be ready, inserting into the TX FIFO, etc.

It supports the usage of SSI_NUM_INSTANCES instances by providing new functions calls like

and new macros like

Some of the old functions and macros are still supported. When using these deprecated functions, the SSI module to use has to be be selected by means of the macro SPI_CONF_DEFAULT_INSTANCE.

This SPI driver depends on the following defines:

For the SSI0 module:

For the SSI1 module:

Definition in file spi-arch-legacy.h.