Function rc_spi_transfer#
Defined in File spi.h
Function Documentation#
-
int rc_spi_transfer(int bus, int slave, uint8_t *tx_data, size_t tx_bytes, uint8_t *rx_data)#
Send any sequence of bytes and read the response.
This is a wrapper for the ioctl spi transfer function and is generally what you will use for reading/writing device registers.
- Parameters:
bus – [in] SPI bus to use
slave – [in] slave id
tx_data – [in] pointer to data to send
tx_bytes – [in] number of bytes to send
rx_data – pointer to put response data
- Returns:
number of bytes received or -1 on failure