21#include "api/HardwareSPI.h"
22#include "FirmataTransport.h"
23#include <condition_variable>
62 void begin()
override;
67 void transfer(
void *
buf,
size_t count)
override;
72 void endTransaction(
void)
override {}
74 void attachInterrupt()
override {}
75 void detachInterrupt()
override {}
78 void setTimeout(
unsigned long timeout_ms) { timeout_ms_ = timeout_ms; }
80 operator bool() {
return is_open; }
83 FirmataTransport *transport_ =
nullptr;
84 std::unique_ptr<FirmataTransport> owned_transport_;
86 bool configured_ =
false;
87 unsigned long timeout_ms_ = 1000;
91 SPISettings settings_;
93 std::mutex reply_mutex_;
94 std::condition_variable reply_cv_;
95 std::vector<uint8_t> reply_buffer_;
96 bool reply_pending_ =
false;
98 void sendDeviceConfig();
99 void doTransfer(uint8_t *buf,
size_t count);
100 void handleSysex(
const FirmataSysexMessage &msg);
Single reader thread + byte-stream parser shared by every Firmata-based hardware backend (GPIO,...
Definition FirmataTransport.h:66
SPI master implementation that speaks the SysEx SPI protocol implemented by ConfigurableFirmata's Spi...
Definition HardwareSPI_FIR.h:45
bool begin(Stream &stream)
Start talking Firmata over the given stream (owns a private transport).
Definition HardwareSPI_FIR.cpp:41
void setTimeout(unsigned long timeout_ms)
Maximum time transfer() waits for the SPI_REPLY, in milliseconds.
Definition HardwareSPI_FIR.h:78
Definition HardwareSPI.h:120
Definition HardwareSPI.h:46
We provide the WiFi class to simulate the Arduino WIFI. In in Linux we can expect that networking is ...
Definition CanMsg.cpp:31