|
arduino-emulator
|
Provides a virtualized hardware communication service for SPI, I2C, I2S, and GPIO over a stream. More...
#include <HardwareService.h>
Public Member Functions | |
| void | flush () |
| operator bool () | |
| uint16_t | receive (void *data, int len) |
| uint16_t | receive16 () |
| uint32_t | receive32 () |
| uint64_t | receive64 () |
| uint8_t | receive8 () |
| void | send (bool data) |
| void | send (HWCalls call) |
| void | send (int32_t dataIn) |
| void | send (int64_t dataIn) |
| void | send (uint16_t dataIn) |
| void | send (uint32_t dataIn) |
| void | send (uint64_t dataIn) |
| void | send (uint8_t data) |
| void | send (void *data, size_t len) |
| void | setStream (Stream *str) |
Protected Attributes | |
| Stream * | io = nullptr |
| bool | isLittleEndian = !is_big_endian() |
| int | timeout_ms = 1000 |
Provides a virtualized hardware communication service for SPI, I2C, I2S, and GPIO over a stream.
This class encapsulates the logic to tunnel hardware protocol messages (SPI, I2C, I2S, GPIO, Serial, etc.) over a generic stream interface. It handles serialization and deserialization of protocol calls and data, ensuring correct endianness (little endian by default for embedded devices). The class provides methods to send and receive various data types, manage the underlying stream, and perform byte-swapping as needed.
Key features:
Usage: