|
RadioLib
Universal wireless communication library for Arduino
|
Public Types | |
| typedef void(* | RadioLibISR) (void) |
Public Member Functions | |
| PiHal (uint8_t spiChannel, uint32_t spiSpeed=2000000, uint8_t spiDevice=0, uint8_t gpioDevice=0) | |
| 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! | |
| void | digitalWrite (uint32_t pin, uint32_t value) override |
| Digital write method. Must be implemented by the platform-specific hardware abstraction! | |
| uint32_t | digitalRead (uint32_t pin) override |
| Digital read method. Must be implemented by the platform-specific hardware abstraction! | |
| 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! | |
| void | detachInterrupt (uint32_t interruptNum) override |
| Method to detach function from an external interrupt. Must be implemented by the platform-specific hardware abstraction! | |
| void | delay (unsigned long ms) override |
| Blocking wait function. Must be implemented by the platform-specific hardware abstraction! | |
| void | delayMicroseconds (unsigned long us) override |
| Blocking microsecond wait function. Must be implemented by the platform-specific hardware abstraction! | |
| void | yield () override |
| Yield method, called from long loops in multi-threaded environment (to prevent blocking other threads). | |
| unsigned long | millis () override |
| Get number of milliseconds since start. Must be implemented by the platform-specific hardware abstraction! | |
| unsigned long | micros () override |
| Get number of microseconds since start. Must be implemented by the platform-specific hardware abstraction! | |
| 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! | |
| 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. | |
| void | spiEndTransaction () |
| Method to end SPI transaction. | |
| void | spiEnd () |
| SPI termination method. | |
| 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. | |
| void | noTone (uint32_t pin) |
| Method to stop producing a tone. | |
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. | |
| virtual uint32_t | pinToInterrupt (uint32_t pin) |
| Function to convert from pin number to interrupt number. | |
Public Attributes | |
| bool | interruptEnabled [PI_MAX_USER_GPIO+1] |
| uint32_t | interruptModes [PI_MAX_USER_GPIO+1] |
| RadioLibISR | interruptCallbacks [PI_MAX_USER_GPIO+1] |
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 |
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.
Reimplemented from 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.
|
inlinevirtual |
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 |
SPI initialization method.
Implements RadioLibHal.
|
inlinevirtual |
Method to start SPI transaction.
Implements RadioLibHal.
|
inlinevirtual |
SPI termination method.
Implements RadioLibHal.
|
inlinevirtual |
Method to end SPI transaction.
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 |
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.
Reimplemented from RadioLibHal.
|
inlinevirtual |
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.
|
inlineoverridevirtual |
Yield method, called from long loops in multi-threaded environment (to prevent blocking other threads).
Reimplemented from RadioLibHal.