Open RTS
Full implementation of the Somfy RTS protocol
spi_module Struct Reference

Hardware abstraction layer for userland SPI drivers. More...

#include <spi_module.h>

Inherited by SPIModule.

Data Fields

uint8_t cs_pin
 The chip select pin for the target SPI device.
 
uint32_t clock
 The SPI clock speed (in Hz) to use for transfers.
 
uint8_t mode
 The SPI mode to use for transfers.
 
uint8_t read_mask
 Bitmask to apply to the register address when we are reading.
 
uint8_t write_mask
 Bitmask to apply to the register address when we are writing.
 

Related Functions

(Note that these are not member functions.)

uint8_t spi_read (struct spi_module *spi, uint8_t reg)
 Read a byte from the spi device at the specified register address. More...
 
void spi_write (struct spi_module *spi, uint8_t reg, uint8_t val)
 Write a byte to the spi device at the specified register address. More...
 
void spi_write_masked (struct spi_module *spi, uint8_t reg, uint8_t mask, uint8_t val)
 Write some bits of val to the spi device at the specified register address, using a bitmask. More...
 
int spi_module_init_arduino (struct spi_module *spi_module, SPIClass *spi_device)
 Initialize an spi_module struct using Arduino's SPI interface. More...
 
int spi_module_init_espidf (struct spi_module *spi_module, spi_host_device_t host_device)
 Initialize an spi_module struct using the ESP-IDF SPI interface. More...
 
int spi_module_init_linux (struct spi_module *spi_module, const char *device)
 Initialize an spi_module struct using Linux spidev. More...
 

Detailed Description

Hardware abstraction layer for userland SPI drivers.


The documentation for this struct was generated from the following files: