This is the SPI Subsystem.
◆ spi_mode
SPI Mode
Enumerator |
---|
SPI_3WIRE | SPI is in 3 Wire mode, MISO, MOSI and CLK
|
SPI_3WIRE_CS | SPI is in 3 Wire mode and multiply CS, MISO, MOSI, CLK and CS
|
SPI_3WIRE_CS_PCS | SPI is in 3 Wire mode, multiply CS and PCS, MISO, MOSI, CLK and CS
|
SPI_SLAVE | SPI is in Slave Mode TODO Slave mode
|
◆ spi_deinit()
int32_t spi_deinit |
( |
struct spi * |
spi | ) |
|
Deinit SPI instance
- Warning
- SPI Slave are not deinit automatically
- Parameters
-
- Returns
- -1 on error 0 on ok
◆ spi_init()
struct spi* spi_init |
( |
uint32_t |
index, |
|
|
enum spi_mode |
mode, |
|
|
struct spi_opt * |
opt |
|
) |
| |
Init SPI
- Parameters
-
index | Index of SPI |
mode | Mode of Driver |
opt | in slave mode |
- Returns
- instance of driver or NULL on error
◆ spi_setCallback()
int32_t spi_setCallback |
( |
struct spi * |
spi, |
|
|
bool(*)(struct spi_slave *slave, void *data) |
callback, |
|
|
void * |
data |
|
) |
| |
Set Callback for Slave Mode
- Parameters
-
spi | SPI instance |
callback | Callback |
data | Data parsed to Callback |
- Returns
- -1 on error 0 on ok