RadioLib
Universal wireless communication library for Arduino
STM32WLx_Module Class Reference

#include <STM32WLx_Module.h>

Inheritance diagram for STM32WLx_Module:
Module

Additional Inherited Members

- Public Types inherited from Module
enum  OpMode_t { MODE_END_OF_TABLE = 0 , MODE_IDLE , MODE_RX , MODE_TX }
 Constants to use in a mode table set be setRfSwitchTable. These constants work for most radios, but some radios define their own constants to be used instead. More...
 
enum  BitWidth_t { BITS_0 = 0 , BITS_8 = 8 , BITS_16 = 16 , BITS_32 = 32 }
 
typedef int16_t(* SPIparseStatusCb_t) (uint8_t in)
 Callback for parsing SPI status.
 
typedef int16_t(* SPIcheckStatusCb_t) (Module *mod)
 Callback for validation SPI status.
 
- Public Member Functions inherited from Module
 Module (RadioLibHal *hal, uint32_t cs, uint32_t irq, uint32_t rst, uint32_t gpio=RADIOLIB_NC)
 Module constructor. More...
 
 Module (const Module &mod)
 Copy constructor. More...
 
Moduleoperator= (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 (uint32_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 (uint32_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 (uint32_t reg, size_t numBytes, uint8_t *inBytes)
 SPI burst read method. More...
 
uint8_t SPIreadRegister (uint32_t reg)
 SPI basic read method. Use of this method is reserved for special cases, SPIgetRegValue should be used instead. More...
 
void SPIwriteRegisterBurst (uint32_t reg, uint8_t *data, size_t numBytes)
 SPI burst write method. More...
 
void SPIwriteRegister (uint32_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 (uint16_t cmd, uint32_t reg, uint8_t *dataOut, uint8_t *dataIn, size_t numBytes)
 SPI single transfer method. More...
 
int16_t SPIcheckStream ()
 Method to check the result of last SPI stream transfer. More...
 
int16_t SPIreadStream (uint16_t cmd, uint8_t *data, size_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, size_t numBytes, bool waitForGpio=true, bool verify=true)
 Method to perform a read transaction with SPI stream. More...
 
int16_t SPIwriteStream (uint16_t cmd, uint8_t *data, size_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, size_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, size_t numBytes, bool waitForGpio, uint32_t timeout)
 SPI single transfer method for modules with stream-type SPI interface (SX126x, SX128x etc.). More...
 
uint32_t getCs () const
 Access method to get the pin number of SPI chip select. More...
 
uint32_t getIrq () const
 Access method to get the pin number of interrupt/GPIO. More...
 
uint32_t getRst () const
 Access method to get the pin number of hardware reset pin. More...
 
uint32_t getGpio () const
 Access method to get the pin number of second interrupt/GPIO. More...
 
void setRfSwitchPins (uint32_t rxEn, uint32_t 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 uint32_t(&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_tfindRfSwitchMode (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...
 
- Static Public Member Functions inherited from Module
static uint32_t reflect (uint32_t in, uint8_t bits)
 Function to reflect bits within a byte. More...
 
- Public Attributes inherited from Module
RadioLibHalhal = NULL
 Hardware abstraction layer to be used.
 
SPIConfig_t spiConfig
 SPI configuration structure. The default configuration corresponds to register-access modules, such as SX127x. More...
 
- Static Public Attributes inherited from Module
static const size_t RFSWITCH_MAX_PINS = 3
 The maximum number of pins supported by the RF switch code. Note: It is not recommended to use this constant in your sketch when defining a rfswitch pins array, to prevent issues when this value is ever increased and such an array gets extra zero elements (that will be interpreted as pin 0).
 

Detailed Description

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.


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