|
struct spi_slave * | spiSlave_init (struct spi *spi, struct spi_opt *options) |
|
int32_t | spiSlave_deinit (struct spi_slave *slave) |
|
int32_t | spiSlave_transfer (struct spi_slave *slave, uint16_t *sendData, uint16_t *recvData, uint32_t len, TickType_t waittime) |
|
int32_t | spiSlave_send (struct spi_slave *slave, uint16_t *data, uint32_t len, TickType_t waittime) |
|
int32_t | spiSlave_recv (struct spi_slave *slave, uint16_t *data, uint32_t len, TickType_t waittime) |
|
int32_t | spiSlave_transferISR (struct spi_slave *slave, uint16_t *sendData, uint16_t *recvData, uint32_t len) |
|
int32_t | spiSlave_sendISR (struct spi_slave *slave, uint16_t *data, uint32_t len) |
|
int32_t | spiSlave_recvISR (struct spi_slave *slave, uint16_t *data, uint32_t len) |
|
This is the SPI Slave Subsystem.
◆ SPI_OPT_CS_DIS
#define SPI_OPT_CS_DIS 0x7 |
Disable CS Control over Controller
◆ SPI_OPT_GPIO_DIS
#define SPI_OPT_GPIO_DIS 0xFF |
Disable CS Control over GPIO
◆ spiSlave_deinit()
int32_t spiSlave_deinit |
( |
struct spi_slave * |
slave | ) |
|
Deinit Slave
- Parameters
-
- Returns
- -1 on error 0 on ok
◆ spiSlave_init()
struct spi_slave* spiSlave_init |
( |
struct spi * |
spi, |
|
|
struct spi_opt * |
options |
|
) |
| |
Slave init Init one Slave on a SPI Bus
- Warning
- This Function did not check collision between instances
- Parameters
-
spi | Spi Instance |
options | Option to acces the slave |
- Returns
- SPI Slave Instance or Null on error
◆ spiSlave_recv()
int32_t spiSlave_recv |
( |
struct spi_slave * |
slave, |
|
|
uint16_t * |
data, |
|
|
uint32_t |
len, |
|
|
TickType_t |
waittime |
|
) |
| |
Recv Data from Slave
- Parameters
-
slave | Slave instance |
data | Data |
len | Length of Data |
waittime | max waittime in mutex or isr lock see xSemaphoreTake() |
- Returns
- -1 on error 0 on ok
◆ spiSlave_recvISR()
int32_t spiSlave_recvISR |
( |
struct spi_slave * |
slave, |
|
|
uint16_t * |
data, |
|
|
uint32_t |
len |
|
) |
| |
Recv Data from Slave in ISR
- Parameters
-
slave | Slave instance |
data | Data |
len | Length of Data |
- Returns
- -1 on error 0 on ok
◆ spiSlave_send()
int32_t spiSlave_send |
( |
struct spi_slave * |
slave, |
|
|
uint16_t * |
data, |
|
|
uint32_t |
len, |
|
|
TickType_t |
waittime |
|
) |
| |
Send Data to Slave
- Parameters
-
slave | Slave instance |
data | Data |
len | Length of Data |
waittime | max waittime in mutex or isr lock see xSemaphoreTake() |
- Returns
- -1 on error 0 on ok
◆ spiSlave_sendISR()
int32_t spiSlave_sendISR |
( |
struct spi_slave * |
slave, |
|
|
uint16_t * |
data, |
|
|
uint32_t |
len |
|
) |
| |
Send Data to Slave in ISR
- Parameters
-
slave | Slave instance |
data | Data |
len | Length of Data |
- Returns
- -1 on error 0 on ok
◆ spiSlave_transfer()
int32_t spiSlave_transfer |
( |
struct spi_slave * |
slave, |
|
|
uint16_t * |
sendData, |
|
|
uint16_t * |
recvData, |
|
|
uint32_t |
len, |
|
|
TickType_t |
waittime |
|
) |
| |
Transfer Data to slave and recv Data from Slave
- Warning
- sendData and recvData shall have the same length!
- Parameters
-
slave | Slave instance |
sendData | Data |
recvData | Data |
len | Length of Data |
waittime | max waittime in mutex or isr lock see xSemaphoreTake() |
- Returns
- -1 on error 0 on ok
◆ spiSlave_transferISR()
int32_t spiSlave_transferISR |
( |
struct spi_slave * |
slave, |
|
|
uint16_t * |
sendData, |
|
|
uint16_t * |
recvData, |
|
|
uint32_t |
len |
|
) |
| |
Transfer Data to slave and recv Data from Slave in ISR
- Warning
- sendData and recvData shall have the same length!
- Parameters
-
slave | Slave instance |
sendData | Data |
recvData | Data |
len | Length of Data |
- Returns
- -1 on error 0 on ok