arduino-emulator
|
SPI wrapper class that provides flexible hardware abstraction. More...
#include <SPIWrapper.h>
Public Member Functions | |
SPIWrapper (HardwareSPI &spi) | |
SPIWrapper (SPISource &source) | |
void | attachInterrupt () |
void | begin () |
void | beginTransaction (SPISettings settings) |
void | detachInterrupt () |
void | end () |
void | endTransaction (void) |
void | notUsingInterrupt (int interruptNumber) |
void | setSource (SPISource *source) |
alternatively defines a class that provides the SPI implementation | |
void | setSPI (HardwareSPI *spi) |
defines the spi implementation: use nullptr to reset. | |
uint8_t | transfer (uint8_t data) |
void | transfer (void *data, size_t count) |
uint16_t | transfer16 (uint16_t data) |
void | usingInterrupt (int interruptNumber) |
Protected Member Functions | |
HardwareSPI * | getSPI () |
Protected Attributes | |
SPISource * | p_source = nullptr |
HardwareSPI * | p_spi = nullptr |
SPI wrapper class that provides flexible hardware abstraction.
SPIWrapper is a concrete implementation of the HardwareSPI interface that supports multiple delegation patterns for SPI communication. It can delegate operations to:
This class implements the complete SPI interface including:
The wrapper automatically handles null safety and provides appropriate default return values when no underlying SPI implementation is available. It supports both polling and interrupt-driven SPI operations.
A global SPI
instance is automatically provided for Arduino compatibility.
|
virtual |
Implements arduino::HardwareSPI.
|
virtual |
Implements arduino::HardwareSPI.
|
virtual |
Implements arduino::HardwareSPI.
|
virtual |
Implements arduino::HardwareSPI.
|
virtual |
Implements arduino::HardwareSPI.
Implements arduino::HardwareSPI.
Implements arduino::HardwareSPI.
Implements arduino::HardwareSPI.
Implements arduino::HardwareSPI.
Implements arduino::HardwareSPI.
Implements arduino::HardwareSPI.