Contiki-Inga 3.x
|
Macros | |
#define | MAX_SPI_DEVICES 7 |
Functions | |
void | mspi_mgr_add (uint8_t cs, uint8_t mode, uint16_t baud) |
This function add a device to the SPI device table and calculates the specific checksum. More... | |
void | mspi_mgr_change_mode (spi_dev new_config) |
This function changes the SPI configuration. More... | |
The various SPI devices are all connected to the SPI Bus (SCK, MOSI/SDA, MISO/SDI) and only separated by the Chip Select. With a high probability, not every SPI Device will use the same SPI Bus configuration (SPI Mode), so you would have to change (or to check) the SPI mode whenever accessing another SPI device. But in higher software layers you are not interested in such details like SPI Mode. Therefore the SPI Bus Manager was implemented, to separate the low level hardware and register level from higher software layers. The SPI Bus Manager holds all devices, which are connected to the SPI Bus. With a checksum he can decide, if the SPI configuration has to change. So in some cases these reconfiguration can be avoid.
#define MAX_SPI_DEVICES 7 |
Defines the maximum number of SPI devices
Definition at line 70 of file mspi-mgr.h.
void mspi_mgr_add | ( | uint8_t | cs, |
uint8_t | mode, | ||
uint16_t | baud | ||
) |
This function add a device to the SPI device table and calculates the specific checksum.
cs | Chip Select: Device ID |
mode | Select the (M)SPI mode (MSPI_MODE_0 ... MSPI_MODE_3) |
baud | The MSPI BAUD rate. Sometimes it is necessary to reduce the SCK. Use MSPI_BAUD_MAX in common case. |
Definition at line 187 of file mspi.c.
Referenced by mspi_init().
void mspi_mgr_change_mode | ( | spi_dev | new_config | ) |
This function changes the SPI configuration.
spi_dev | The specified entry of the SPI Device Table |
Definition at line 195 of file mspi.c.
Referenced by mspi_chip_select().