RadioLib
Universal wireless communication library for Arduino
|
Public Member Functions | |
PicoHal (spi_inst_t *spiChannel, uint32_t misoPin, uint32_t mosiPin, uint32_t sckPin, uint32_t spiSpeed=500 *1000) | |
void | init () override |
Module initialization method. This will be called by all radio modules at the beginning of startup. Can be used to e.g., initialize SPI interface. | |
void | term () override |
Module termination method. This will be called by all radio modules when the destructor is called. Can be used to e.g., stop SPI interface. | |
void | pinMode (uint32_t pin, uint32_t mode) override |
GPIO pin mode (input/output/...) configuration method. Must be implemented by the platform-specific hardware abstraction! More... | |
void | digitalWrite (uint32_t pin, uint32_t value) override |
Digital write method. Must be implemented by the platform-specific hardware abstraction! More... | |
uint32_t | digitalRead (uint32_t pin) override |
Digital read method. Must be implemented by the platform-specific hardware abstraction! More... | |
void | attachInterrupt (uint32_t interruptNum, void(*interruptCb)(void), uint32_t mode) override |
Method to attach function to an external interrupt. Must be implemented by the platform-specific hardware abstraction! More... | |
void | detachInterrupt (uint32_t interruptNum) override |
Method to detach function from an external interrupt. Must be implemented by the platform-specific hardware abstraction! More... | |
void | delay (unsigned long ms) override |
Blocking wait function. Must be implemented by the platform-specific hardware abstraction! More... | |
void | delayMicroseconds (unsigned long us) override |
Blocking microsecond wait function. Must be implemented by the platform-specific hardware abstraction! More... | |
unsigned long | millis () override |
Get number of milliseconds since start. Must be implemented by the platform-specific hardware abstraction! More... | |
unsigned long | micros () override |
Get number of microseconds since start. Must be implemented by the platform-specific hardware abstraction! More... | |
long | pulseIn (uint32_t pin, uint32_t state, unsigned long timeout) override |
Measure the length of incoming digital pulse in microseconds. Must be implemented by the platform-specific hardware abstraction! More... | |
void | tone (uint32_t pin, unsigned int frequency, unsigned long duration=0) override |
Method to produce a square-wave with 50% duty cycle ("tone") of a given frequency at some pin. More... | |
void | noTone (uint32_t pin) override |
Method to stop producing a tone. More... | |
void | spiBegin () |
SPI initialization method. | |
void | spiBeginTransaction () |
Method to start SPI transaction. | |
void | spiTransfer (uint8_t *out, size_t len, uint8_t *in) |
Method to transfer buffer over SPI. More... | |
void | yield () override |
Yield method, called from long loops in multi-threaded environment (to prevent blocking other threads). | |
void | spiEndTransaction () |
Method to end SPI transaction. | |
void | spiEnd () |
SPI termination method. | |
Public Member Functions inherited from RadioLibHal | |
RadioLibHal (const uint32_t input, const uint32_t output, const uint32_t low, const uint32_t high, const uint32_t rising, const uint32_t falling) | |
Default constructor. More... | |
virtual uint32_t | pinToInterrupt (uint32_t pin) |
Function to convert from pin number to interrupt number. More... | |
Additional Inherited Members | |
Public Attributes inherited from RadioLibHal | |
const uint32_t | GpioModeInput |
Value to be used as the "input" GPIO direction. | |
const uint32_t | GpioModeOutput |
Value to be used as the "output" GPIO direction. | |
const uint32_t | GpioLevelLow |
Value to be used as the "low" GPIO level. | |
const uint32_t | GpioLevelHigh |
Value to be used as the "high" GPIO level. | |
const uint32_t | GpioInterruptRising |
Value to be used as the "rising" GPIO level change direction. | |
const uint32_t | GpioInterruptFalling |
Value to be used as the "falling" GPIO level change direction. | |
|
inlineoverridevirtual |
Method to attach function to an external interrupt. Must be implemented by the platform-specific hardware abstraction!
interruptNum | Interrupt number to attach to (platform-specific). |
interruptCb | Interrupt service routine to execute. |
mode | Rising/falling mode (platform-specific). |
Implements RadioLibHal.
|
inlineoverridevirtual |
Blocking wait function. Must be implemented by the platform-specific hardware abstraction!
ms | Number of milliseconds to wait. |
Implements RadioLibHal.
|
inlineoverridevirtual |
Blocking microsecond wait function. Must be implemented by the platform-specific hardware abstraction!
us | Number of microseconds to wait. |
Implements RadioLibHal.
|
inlineoverridevirtual |
Method to detach function from an external interrupt. Must be implemented by the platform-specific hardware abstraction!
interruptNum | Interrupt number to detach from (platform-specific). |
Implements RadioLibHal.
|
inlineoverridevirtual |
Digital read method. Must be implemented by the platform-specific hardware abstraction!
pin | Pin to be changed (platform-specific). |
Implements RadioLibHal.
|
inlineoverridevirtual |
Digital write method. Must be implemented by the platform-specific hardware abstraction!
pin | Pin to be changed (platform-specific). |
value | Value to set (platform-specific). |
Implements RadioLibHal.
|
inlineoverridevirtual |
Get number of microseconds since start. Must be implemented by the platform-specific hardware abstraction!
Implements RadioLibHal.
|
inlineoverridevirtual |
Get number of milliseconds since start. Must be implemented by the platform-specific hardware abstraction!
Implements RadioLibHal.
|
inlineoverridevirtual |
Method to stop producing a tone.
pin | Pin which is currently producing the tone. |
Reimplemented from RadioLibHal.
|
inlineoverridevirtual |
GPIO pin mode (input/output/...) configuration method. Must be implemented by the platform-specific hardware abstraction!
pin | Pin to be changed (platform-specific). |
mode | Mode to be set (platform-specific). |
Implements RadioLibHal.
|
inlineoverridevirtual |
Measure the length of incoming digital pulse in microseconds. Must be implemented by the platform-specific hardware abstraction!
pin | Pin to measure on (platform-specific). |
state | Pin level to monitor (platform-specific). |
timeout | Timeout in microseconds. |
Implements RadioLibHal.
|
inlinevirtual |
Method to transfer buffer over SPI.
out | Buffer to send. |
len | Number of data to send or receive. |
in | Buffer to save received data into. |
Implements RadioLibHal.
|
inlineoverridevirtual |
Method to produce a square-wave with 50% duty cycle ("tone") of a given frequency at some pin.
pin | Pin to be used as the output. |
frequency | Frequency of the square wave. |
duration | Duration of the tone in ms. When set to 0, the tone will be infinite. |
Reimplemented from RadioLibHal.