56 #include <linux/spi/spidev.h> 59 #define RC_SPI_MAX_SPEED 24000000 60 #define RC_SPI_MIN_SPEED 1000
61 #define RC_SPI_BITS_PER_WORD 8
64 #define RC_BB_SPI1_SS1 1,0 65 #define RC_BB_SPI1_SS2 1,1
67 #define RC_CAPE_SS1_GPIO 3,17 68 #define RC_CAPE_SS2_GPIO 1,17
70 #define RC_BLUE_SS1_GPIO 0,29 71 #define RC_BLUE_SS2_GPIO 0,7
171 int rc_spi_transfer(
int bus,
int slave, uint8_t* tx_data,
size_t tx_bytes, uint8_t* rx_data);
184 int rc_spi_write(
int bus,
int slave, uint8_t* data,
size_t bytes);
197 int rc_spi_read(
int bus,
int slave, uint8_t* data,
size_t bytes);
int rc_spi_get_fd(int bus, int slave)
fetches the file descriptor for a specified slave so the user can do more advanced IO operations than...
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.
int rc_spi_init_auto_slave(int bus, int slave, int bus_mode, int speed_hz)
Initializes an SPI bus.
int rc_spi_close(int bus)
Closes and cleans up the bus for specified slave.
int rc_spi_init_manual_slave(int bus, int slave, int bus_mode, int speed_hz, int chip, int pin)
Initializes an SPI bus and GPIO pin for use as a manual SPI slave select pin.
int rc_spi_write(int bus, int slave, uint8_t *data, size_t bytes)
Writes data to specified slave.
int rc_spi_manual_select(int bus, int slave, int select)
Manually selects or deselects a slave.
int rc_spi_read(int bus, int slave, uint8_t *data, size_t bytes)
Reads data from a specified slave.