RadioLib
Universal wireless communication library for Arduino
|
#include <STM32WLx_Module.h>
Additional Inherited Members | |
![]() | |
enum | OpMode_t { MODE_END_OF_TABLE = 0 , MODE_IDLE , MODE_RX , MODE_TX } |
typedef int16_t(* | SPIparseStatusCb_t) (uint8_t in) |
SPI status parsing callback typedef. | |
![]() | |
Module (RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE gpio=RADIOLIB_NC) | |
Default constructor. More... | |
Module (const Module &mod) | |
Copy constructor. More... | |
Module & | operator= (const Module &mod) |
Overload for assignment operator. More... | |
void | init () |
Initialize low-level module control. | |
void | term () |
Terminate low-level module control. | |
int16_t | SPIgetRegValue (uint16_t reg, uint8_t msb=7, uint8_t lsb=0) |
SPI read method that automatically masks unused bits. This method is the preferred SPI read mechanism. More... | |
int16_t | SPIsetRegValue (uint16_t reg, uint8_t value, uint8_t msb=7, uint8_t lsb=0, uint8_t checkInterval=2, uint8_t checkMask=0xFF) |
Overwrite-safe SPI write method with verification. This method is the preferred SPI write mechanism. More... | |
void | SPIreadRegisterBurst (uint16_t reg, uint8_t numBytes, uint8_t *inBytes) |
SPI burst read method. More... | |
uint8_t | SPIreadRegister (uint16_t reg) |
SPI basic read method. Use of this method is reserved for special cases, SPIgetRegValue should be used instead. More... | |
void | SPIwriteRegisterBurst (uint16_t reg, uint8_t *data, uint8_t numBytes) |
SPI burst write method. More... | |
void | SPIwriteRegister (uint16_t reg, uint8_t data) |
SPI basic write method. Use of this method is reserved for special cases, SPIsetRegValue should be used instead. More... | |
void | SPItransfer (uint8_t cmd, uint16_t reg, uint8_t *dataOut, uint8_t *dataIn, uint8_t numBytes) |
SPI single transfer method. More... | |
int16_t | SPIcheckStream () |
Method to check the result of last SPI stream transfer. More... | |
int16_t | SPIreadStream (uint8_t cmd, uint8_t *data, uint8_t numBytes, bool waitForGpio=true, bool verify=true) |
Method to perform a read transaction with SPI stream. More... | |
int16_t | SPIreadStream (uint8_t *cmd, uint8_t cmdLen, uint8_t *data, uint8_t numBytes, bool waitForGpio=true, bool verify=true) |
Method to perform a read transaction with SPI stream. More... | |
int16_t | SPIwriteStream (uint8_t cmd, uint8_t *data, uint8_t numBytes, bool waitForGpio=true, bool verify=true) |
Method to perform a write transaction with SPI stream. More... | |
int16_t | SPIwriteStream (uint8_t *cmd, uint8_t cmdLen, uint8_t *data, uint8_t numBytes, bool waitForGpio=true, bool verify=true) |
Method to perform a write transaction with SPI stream. More... | |
int16_t | SPItransferStream (uint8_t *cmd, uint8_t cmdLen, bool write, uint8_t *dataOut, uint8_t *dataIn, uint8_t numBytes, bool waitForGpio, uint32_t timeout) |
SPI single transfer method for modules with stream-type SPI interface (SX126x, SX128x etc.). More... | |
RADIOLIB_PIN_TYPE | getCs () const |
Access method to get the pin number of SPI chip select. More... | |
RADIOLIB_PIN_TYPE | getIrq () const |
Access method to get the pin number of interrupt/GPIO. More... | |
RADIOLIB_PIN_TYPE | getRst () const |
Access method to get the pin number of hardware reset pin. More... | |
RADIOLIB_PIN_TYPE | getGpio () const |
Access method to get the pin number of second interrupt/GPIO. More... | |
void | setRfSwitchPins (RADIOLIB_PIN_TYPE rxEn, RADIOLIB_PIN_TYPE txEn) |
Some modules contain external RF switch controlled by pins. This function gives RadioLib control over those pins to automatically switch between various modes: When idle both pins will be LOW, during TX the txEn pin will be HIGH, during RX the rxPin will be HIGH. More... | |
void | setRfSwitchTable (const RADIOLIB_PIN_TYPE(&pins)[RFSWITCH_MAX_PINS], const RfSwitchMode_t table[]) |
Some modules contain external RF switch controlled by pins. This function gives RadioLib control over those pins to automatically switch between various modes. More... | |
const RfSwitchMode_t * | findRfSwitchMode (uint8_t mode) const |
Find a mode in the RfSwitchTable. More... | |
void | setRfSwitchState (uint8_t mode) |
Set RF switch state. More... | |
void | waitForMicroseconds (uint32_t start, uint32_t len) |
Wait for time to elapse, either using the microsecond timer, or the TimerFlag. Note that in interrupt timing mode, it is up to the user to set up the timing interrupt! More... | |
void | pinMode (RADIOLIB_PIN_TYPE pin, RADIOLIB_PIN_MODE mode) |
Arduino core pinMode override that checks RADIOLIB_NC as alias for unused pin. More... | |
void | digitalWrite (RADIOLIB_PIN_TYPE pin, RADIOLIB_PIN_STATUS value) |
Arduino core digitalWrite override that checks RADIOLIB_NC as alias for unused pin. More... | |
RADIOLIB_PIN_STATUS | digitalRead (RADIOLIB_PIN_TYPE pin) |
Arduino core digitalWrite override that checks RADIOLIB_NC as alias for unused pin. More... | |
void | tone (RADIOLIB_PIN_TYPE pin, uint16_t value, uint32_t duration=0) |
Arduino core tone override that checks RADIOLIB_NC as alias for unused pin and RADIOLIB_TONE_UNSUPPORTED to make sure the platform does support tone. More... | |
void | noTone (RADIOLIB_PIN_TYPE pin) |
Arduino core noTone override that checks RADIOLIB_NC as alias for unused pin and RADIOLIB_TONE_UNSUPPORTED to make sure the platform does support tone. More... | |
void | attachInterrupt (RADIOLIB_PIN_TYPE interruptNum, void(*userFunc)(void), RADIOLIB_INTERRUPT_STATUS mode) |
Arduino core attachInterrupt override. More... | |
void | detachInterrupt (RADIOLIB_PIN_TYPE interruptNum) |
Arduino core detachInterrupt override. More... | |
void | yield () |
Arduino core yield override. | |
void | delay (uint32_t ms) |
Arduino core delay override. More... | |
void | delayMicroseconds (uint32_t us) |
Arduino core delayMicroseconds override. More... | |
uint32_t | millis () |
Arduino core millis override. | |
uint32_t | micros () |
Arduino core micros override. | |
uint32_t | pulseIn (RADIOLIB_PIN_TYPE pin, RADIOLIB_PIN_STATUS state, uint32_t timeout) |
Arduino core pulseIn override. | |
void | begin () |
Arduino core SPI begin override. | |
void | beginTransaction () |
Arduino core SPI beginTransaction override. | |
uint8_t | transfer (uint8_t b) |
Arduino core SPI transfer override. | |
void | endTransaction () |
Arduino core SPI endTransaction override. | |
void | end () |
Arduino core SPI end override. | |
virtual void | SPIbeginTransaction () |
virtual uint8_t | SPItransfer (uint8_t b) |
virtual void | SPIendTransaction () |
void | regdump (uint8_t start, uint8_t len) |
Function to dump device registers as hex into the debug port. More... | |
![]() | |
static uint8_t | flipBits (uint8_t b) |
Function to reflect bits within a byte. | |
static uint16_t | flipBits16 (uint16_t i) |
Function to reflect bits within an integer. | |
static void | hexdump (uint8_t *data, size_t len) |
Function to dump data as hex into the debug port. More... | |
![]() | |
uint8_t | SPIreadCommand = 0b00000000 |
Basic SPI read command. Defaults to 0x00. | |
uint8_t | SPIwriteCommand = 0b10000000 |
Basic SPI write command. Defaults to 0x80. | |
uint8_t | SPInopCommand = 0x00 |
Basic SPI no-operation command. Defaults to 0x00. | |
uint8_t | SPIstatusCommand = 0x00 |
Basic SPI status read command. Defaults to 0x00. | |
uint8_t | SPIaddrWidth = 8 |
SPI address width. Defaults to 8, currently only supports 8 and 16-bit addresses. | |
bool | SPIstreamType = false |
Whether the SPI interface is stream-type (e.g. SX126x) or register-type (e.g. SX127x). Defaults to register-type SPI interfaces. | |
int16_t | SPIstreamError = RADIOLIB_ERR_UNKNOWN |
The last recorded SPI stream error. | |
SPIparseStatusCb_t | SPIparseStatusCb = nullptr |
Callback to function that will parse the module-specific status codes to RadioLib status codes. Typically used for modules with SPI stream-type interface (e.g. SX126x/SX128x). | |
![]() | |
static const size_t | RFSWITCH_MAX_PINS = 3 |
The maximum number of pins supported by the RF switch code. More... | |
static const RfSwitchMode_t | END_OF_MODE_TABLE |
This is a subclass of Module to be used with the STM32WLx driver.
It is used to override some callbacks, allowing access to some of the radio control signals that are wired to internal registers instead of actual GPIO pins.