RadioLib
Universal wireless communication library for Arduino
|
Public Member Functions | |
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 void | pinMode (uint32_t pin, uint32_t mode)=0 |
GPIO pin mode (input/output/...) configuration method. Must be implemented by the platform-specific hardware abstraction! More... | |
virtual void | digitalWrite (uint32_t pin, uint32_t value)=0 |
Digital write method. Must be implemented by the platform-specific hardware abstraction! More... | |
virtual uint32_t | digitalRead (uint32_t pin)=0 |
Digital read method. Must be implemented by the platform-specific hardware abstraction! More... | |
virtual void | attachInterrupt (uint32_t interruptNum, void(*interruptCb)(void), uint32_t mode)=0 |
Method to attach function to an external interrupt. Must be implemented by the platform-specific hardware abstraction! More... | |
virtual void | detachInterrupt (uint32_t interruptNum)=0 |
Method to detach function from an external interrupt. Must be implemented by the platform-specific hardware abstraction! More... | |
virtual void | delay (unsigned long ms)=0 |
Blocking wait function. Must be implemented by the platform-specific hardware abstraction! More... | |
virtual void | delayMicroseconds (unsigned long us)=0 |
Blocking microsecond wait function. Must be implemented by the platform-specific hardware abstraction! More... | |
virtual unsigned long | millis ()=0 |
Get number of milliseconds since start. Must be implemented by the platform-specific hardware abstraction! More... | |
virtual unsigned long | micros ()=0 |
Get number of microseconds since start. Must be implemented by the platform-specific hardware abstraction! More... | |
virtual long | pulseIn (uint32_t pin, uint32_t state, unsigned long timeout)=0 |
Measure the length of incoming digital pulse in microseconds. Must be implemented by the platform-specific hardware abstraction! More... | |
virtual void | spiBegin ()=0 |
SPI initialization method. | |
virtual void | spiBeginTransaction ()=0 |
Method to start SPI transaction. | |
virtual uint8_t | spiTransfer (uint8_t b)=0 |
Method to transfer one byte over SPI. More... | |
virtual void | spiEndTransaction ()=0 |
Method to end SPI transaction. | |
virtual void | spiEnd ()=0 |
SPI termination method. | |
virtual void | init () |
Module initialization method. This will be called by all radio modules at the beginning of startup. Can be used to e.g., initalize SPI interface. | |
virtual void | term () |
Module termination method. This will be called by all radio modules when the desctructor is called. Can be used to e.g., stop SPI interface. | |
virtual void | tone (uint32_t pin, unsigned int frequency, unsigned long duration=0) |
Method to produce a square-wave with 50% duty cycle ("tone") of a given frequency at some pin. More... | |
virtual void | noTone (uint32_t pin) |
Method to stop producing a tone. More... | |
virtual void | yield () |
Yield method, called from long loops in multi-threaded environment (to prevent blocking other threads). | |
virtual uint32_t | pinToInterrupt (uint32_t pin) |
Function to convert from pin number to interrupt number. More... | |
Public Attributes | |
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. | |
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.
input | Value to be used as the "input" GPIO direction. |
output | Value to be used as the "output" GPIO direction. |
low | Value to be used as the "low" GPIO level. |
high | Value to be used as the "high" GPIO level. |
rising | Value to be used as the "rising" GPIO level change direction. |
falling | Value to be used as the "falling" GPIO level change direction. |
|
pure virtual |
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). |
|
pure virtual |
Blocking wait function. Must be implemented by the platform-specific hardware abstraction!
ms | Number of milliseconds to wait. |
|
pure virtual |
Blocking microsecond wait function. Must be implemented by the platform-specific hardware abstraction!
us | Number of microseconds to wait. |
|
pure virtual |
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). |
|
pure virtual |
Digital read method. Must be implemented by the platform-specific hardware abstraction!
pin | Pin to be changed (platform-specific). |
|
pure virtual |
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). |
|
pure virtual |
Get number of microseconds since start. Must be implemented by the platform-specific hardware abstraction!
|
pure virtual |
Get number of milliseconds since start. Must be implemented by the platform-specific hardware abstraction!
|
virtual |
Method to stop producing a tone.
pin | Pin which is currently producing the tone. |
|
pure virtual |
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). |
|
virtual |
Function to convert from pin number to interrupt number.
pin | Pin to convert from. |
|
pure virtual |
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. |
|
pure virtual |
Method to transfer one byte over SPI.
b | Byte to send. |
|
virtual |
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. |