A collection of userland SPI drivers for "OOK" radio modules.
More...
|
struct | rfm69 |
| An SPI-attached SX1231 or RFM69 radio module. More...
|
|
struct | sx1278 |
| An SPI-attached SX1278 or RFM96 radio module. More...
|
|
struct | spi_module |
| Hardware abstraction layer for userland SPI drivers. More...
|
|
|
int | rfm69_init (struct rfm69 *radio, struct spi_module *spi) |
| Initialize an SPI-attached RFM69 radio module.
|
|
void | sx1278_init (struct sx1278 *radio, struct spi_module *spi) |
| Initialize an SPI-attached SX1278/RFM96 radio module.
|
|
uint8_t | spi_read (struct spi_module *spi, uint8_t reg) |
| Read a byte from the spi device at the specified register address.
|
|
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.
|
|
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.
|
|
int | spi_module_init_arduino (struct spi_module *spi_module, SPIClass *spi_device) |
| Initialize an spi_module struct using Arduino's SPI interface.
|
|
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.
|
|
int | spi_module_init_linux (struct spi_module *spi_module, const char *device) |
| Initialize an spi_module struct using Linux spidev.
|
|
A collection of userland SPI drivers for "OOK" radio modules.
◆ anonymous enum
Enumerator |
---|
OOKRADIO_ERR_NONE | All good.
|
OOKRADIO_ERR_INVALID_HANDLE | The radio pointer is NULL.
|
OOKRADIO_ERR_INVALID_SPI | The spi_module pointer is NULL.
|
OOKRADIO_ERR_INVALID_MODULE | The attached SPI module could not be identified.
|
OOKRADIO_ERR_SPI_INIT_FAILED | SPI init failed.
|
OOKRADIO_ERR_SPI_TRANSFER_FAILED | SPI transfer failed.
|
◆ rfm69_init()
Initialize an SPI-attached RFM69 radio module.
- Parameters
-
radio | the rfm69 struct to initialize |
spi | the spi_module we are connecting through |
- Returns
- OOKRADIO_ERR_NONE if initialized successfully
◆ sx1278_init()
Initialize an SPI-attached SX1278/RFM96 radio module.
- Parameters
-
radio | the sx1278 struct to initialize |
spi | the spi_module we are connecting through |
- Returns
- OOKRADIO_ERR_NONE if initialized successfully
◆ spi_read()
uint8_t spi_read |
( |
struct spi_module * |
spi, |
|
|
uint8_t |
reg |
|
) |
| |
|
related |
Read a byte from the spi device at the specified register address.
- Parameters
-
spi | the spi_module to read from |
reg | the register address to read from |
- Returns
- the value returned from the device
◆ spi_write()
void spi_write |
( |
struct spi_module * |
spi, |
|
|
uint8_t |
reg, |
|
|
uint8_t |
val |
|
) |
| |
|
related |
Write a byte to the spi device at the specified register address.
- Parameters
-
spi | the spi_module to write to |
reg | the register address to write to |
◆ spi_write_masked()
void spi_write_masked |
( |
struct spi_module * |
spi, |
|
|
uint8_t |
reg, |
|
|
uint8_t |
mask, |
|
|
uint8_t |
val |
|
) |
| |
|
related |
Write some bits of val to the spi device at the specified register address, using a bitmask.
- Parameters
-
spi | the spi_module to write to |
reg | the register address to write to |
◆ spi_module_init_arduino()
int spi_module_init_arduino |
( |
struct spi_module * |
spi_module, |
|
|
SPIClass * |
spi_device |
|
) |
| |
|
related |
Initialize an spi_module struct using Arduino's SPI interface.
- Note
- Only available on Arduino builds
- Parameters
-
spi_module | the spi_module struct to initialize |
spi_device | a pointer to the Arduino SPI device to use, e.g. &SPI |
- Returns
- OOKRADIO_ERR_NONE if successful
- OOKRADIO_ERR_SPI_INIT_FAILED if unsuccessful
◆ spi_module_init_espidf()
int spi_module_init_espidf |
( |
struct spi_module * |
spi_module, |
|
|
spi_host_device_t |
host_device |
|
) |
| |
|
related |
Initialize an spi_module struct using the ESP-IDF SPI interface.
- Note
- Only available on ESP-IDF (ESP32, etc) builds
- Parameters
-
- Returns
- OOKRADIO_ERR_NONE if successful
- OOKRADIO_ERR_SPI_INIT_FAILED if unsuccessful
◆ spi_module_init_linux()
int spi_module_init_linux |
( |
struct spi_module * |
spi_module, |
|
|
const char * |
device |
|
) |
| |
|
related |
Initialize an spi_module struct using Linux spidev.
- Note
- Only available on Linux builds, spidev must be enabled
- Parameters
-
- Returns
- OOKRADIO_ERR_NONE if successful
- OOKRADIO_ERR_SPI_INIT_FAILED if unsuccessful