RadioLib
Universal wireless communication library for Arduino
EspHal Class Reference
Inheritance diagram for EspHal:
RadioLibHal

Public Member Functions

 EspHal (int8_t sck, int8_t miso, int8_t mosi)
 
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 spiBegin ()
 SPI initialization method.
 
void spiBeginTransaction ()
 Method to start SPI transaction.
 
uint8_t spiTransferByte (uint8_t b)
 
void spiTransfer (uint8_t *out, size_t len, uint8_t *in)
 Method to transfer buffer over SPI. More...
 
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 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. 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...
 

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.
 

Member Function Documentation

◆ attachInterrupt()

void EspHal::attachInterrupt ( uint32_t  interruptNum,
void(*)(void)  interruptCb,
uint32_t  mode 
)
inlineoverridevirtual

Method to attach function to an external interrupt. Must be implemented by the platform-specific hardware abstraction!

Parameters
interruptNumInterrupt number to attach to (platform-specific).
interruptCbInterrupt service routine to execute.
modeRising/falling mode (platform-specific).

Implements RadioLibHal.

◆ delay()

void EspHal::delay ( unsigned long  ms)
inlineoverridevirtual

Blocking wait function. Must be implemented by the platform-specific hardware abstraction!

Parameters
msNumber of milliseconds to wait.

Implements RadioLibHal.

◆ delayMicroseconds()

void EspHal::delayMicroseconds ( unsigned long  us)
inlineoverridevirtual

Blocking microsecond wait function. Must be implemented by the platform-specific hardware abstraction!

Parameters
usNumber of microseconds to wait.

Implements RadioLibHal.

◆ detachInterrupt()

void EspHal::detachInterrupt ( uint32_t  interruptNum)
inlineoverridevirtual

Method to detach function from an external interrupt. Must be implemented by the platform-specific hardware abstraction!

Parameters
interruptNumInterrupt number to detach from (platform-specific).

Implements RadioLibHal.

◆ digitalRead()

uint32_t EspHal::digitalRead ( uint32_t  pin)
inlineoverridevirtual

Digital read method. Must be implemented by the platform-specific hardware abstraction!

Parameters
pinPin to be changed (platform-specific).
Returns
Value read on the pin (platform-specific).

Implements RadioLibHal.

◆ digitalWrite()

void EspHal::digitalWrite ( uint32_t  pin,
uint32_t  value 
)
inlineoverridevirtual

Digital write method. Must be implemented by the platform-specific hardware abstraction!

Parameters
pinPin to be changed (platform-specific).
valueValue to set (platform-specific).

Implements RadioLibHal.

◆ micros()

unsigned long EspHal::micros ( )
inlineoverridevirtual

Get number of microseconds since start. Must be implemented by the platform-specific hardware abstraction!

Returns
Number of microseconds since start.

Implements RadioLibHal.

◆ millis()

unsigned long EspHal::millis ( )
inlineoverridevirtual

Get number of milliseconds since start. Must be implemented by the platform-specific hardware abstraction!

Returns
Number of milliseconds since start.

Implements RadioLibHal.

◆ pinMode()

void EspHal::pinMode ( uint32_t  pin,
uint32_t  mode 
)
inlineoverridevirtual

GPIO pin mode (input/output/...) configuration method. Must be implemented by the platform-specific hardware abstraction!

Parameters
pinPin to be changed (platform-specific).
modeMode to be set (platform-specific).

Implements RadioLibHal.

◆ pulseIn()

long EspHal::pulseIn ( uint32_t  pin,
uint32_t  state,
unsigned long  timeout 
)
inlineoverridevirtual

Measure the length of incoming digital pulse in microseconds. Must be implemented by the platform-specific hardware abstraction!

Parameters
pinPin to measure on (platform-specific).
statePin level to monitor (platform-specific).
timeoutTimeout in microseconds.
Returns
Pulse length in microseconds, or 0 if the pulse did not start before timeout.

Implements RadioLibHal.

◆ spiTransfer()

void EspHal::spiTransfer ( uint8_t *  out,
size_t  len,
uint8_t *  in 
)
inlinevirtual

Method to transfer buffer over SPI.

Parameters
outBuffer to send.
lenNumber of data to send or receive.
inBuffer to save received data into.

Implements RadioLibHal.


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