65#if defined(__linux__) || defined(DOXYGEN)
128#ifdef MODULE_PERIPH_SPIDEV_LINUX
129#error "MODULE periph_spidev_linux is only available on Linux"
Native CPU peripheral configuration.
#define SPI_MAXCS
Maximum amount of chip select lines per bus.
int spidev_linux_setup(spi_t bus, unsigned cs_id, const char *name)
register /dev/spidev* device to be used for SPI
struct spidev_linux_state spidev_linux_state_t
Dynamic runtime state for SPI port + CS line.
struct spidev_linux_conf spidev_linux_conf_t
Static runtime configuration for SPI port + CS line.
void spidev_linux_teardown(void)
Close open SPI file descriptors.
@ SPI_SETUP_INVALID
invalid params or duplicate definition
@ SPI_SETUP_OK
parameters are sound
Mutex for thread synchronization.
Low-level SPI peripheral driver interface definition.
Static runtime configuration for SPI port + CS line.
char * device_filename[SPI_MAXCS]
Filename for a specific SPI device + CS line (like /dev/spidev0.0)
Dynamic runtime state for SPI port + CS line.
int fd[SPI_MAXCS]
File descriptors for each CS line on the bus.
mutex_t lock
Mutex for the whole bus (all CS lines)