|
RadioLib
Universal wireless communication library for Arduino
|
Hardware abstraction library base interface. More...
#include <Hal.h>
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. | |
| 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! | |
| virtual void | digitalWrite (uint32_t pin, uint32_t value)=0 |
| Digital write method. Must be implemented by the platform-specific hardware abstraction! | |
| virtual uint32_t | digitalRead (uint32_t pin)=0 |
| Digital read method. Must be implemented by the platform-specific hardware abstraction! | |
| 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! | |
| virtual void | detachInterrupt (uint32_t interruptNum)=0 |
| Method to detach function from an external interrupt. Must be implemented by the platform-specific hardware abstraction! | |
| virtual void | delay (RadioLibTime_t ms)=0 |
| Blocking wait function. Must be implemented by the platform-specific hardware abstraction! | |
| virtual void | delayMicroseconds (RadioLibTime_t us)=0 |
| Blocking microsecond wait function. Must be implemented by the platform-specific hardware abstraction! | |
| virtual RadioLibTime_t | millis ()=0 |
| Get number of milliseconds since start. Must be implemented by the platform-specific hardware abstraction! | |
| virtual RadioLibTime_t | micros ()=0 |
| Get number of microseconds since start. Must be implemented by the platform-specific hardware abstraction! | |
| virtual long | pulseIn (uint32_t pin, uint32_t state, RadioLibTime_t timeout)=0 |
| Measure the length of incoming digital pulse in microseconds. Must be implemented by the platform-specific hardware abstraction! | |
| virtual void | spiBegin ()=0 |
| SPI initialization method. | |
| virtual void | spiBeginTransaction ()=0 |
| Method to start SPI transaction. | |
| virtual void | spiTransfer (uint8_t *out, size_t len, uint8_t *in)=0 |
| Method to transfer buffer over SPI. | |
| 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., initialize SPI interface. | |
| virtual void | term () |
| 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. | |
| virtual void | tone (uint32_t pin, unsigned int frequency, RadioLibTime_t duration=0) |
| Method to produce a square-wave with 50% duty cycle ("tone") of a given frequency at some pin. | |
| virtual void | noTone (uint32_t pin) |
| Method to stop producing a tone. | |
| 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. | |
Hardware abstraction library base interface.
| 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). |
Implemented in PiHal.
|
pure virtual |
Blocking wait function. Must be implemented by the platform-specific hardware abstraction!
| ms | Number of milliseconds to wait. |
Implemented in PiHal.
|
pure virtual |
Blocking microsecond wait function. Must be implemented by the platform-specific hardware abstraction!
| us | Number of microseconds to wait. |
Implemented in PiHal.
|
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). |
Implemented in PiHal.
|
pure virtual |
Digital read method. Must be implemented by the platform-specific hardware abstraction!
| pin | Pin to be changed (platform-specific). |
Implemented in PiHal.
|
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). |
Implemented in PiHal.
|
virtual |
|
pure virtual |
Get number of microseconds since start. Must be implemented by the platform-specific hardware abstraction!
Implemented in PiHal.
|
pure virtual |
Get number of milliseconds since start. Must be implemented by the platform-specific hardware abstraction!
Implemented in PiHal.
|
virtual |
Method to stop producing a tone.
| pin | Pin which is currently producing the tone. |
Reimplemented in PiHal.
|
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). |
Implemented in PiHal.
|
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. |
Implemented in PiHal.
|
pure virtual |
SPI initialization method.
Implemented in PiHal.
|
pure virtual |
Method to start SPI transaction.
Implemented in PiHal.
|
pure virtual |
SPI termination method.
Implemented in PiHal.
|
pure virtual |
Method to end SPI transaction.
Implemented in PiHal.
|
pure virtual |
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. |
Implemented in PiHal.
|
virtual |
|
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. |
Reimplemented in PiHal.
|
virtual |
Yield method, called from long loops in multi-threaded environment (to prevent blocking other threads).
Reimplemented in PiHal.