20#if defined(USE_FIRMATA) && !defined(SKIP_HARDWARE_SETUP)
21#include "FirmataTransport.h"
22#include "HardwareGPIO_FIR.h"
23#include "HardwareI2C_FIR.h"
24#include "HardwareSPI_FIR.h"
63 Logger.info(
"Using Firmata hardware interfaces");
73 Logger.warning(
"GPIO, I2C, SPI set up for Firmata");
86 if (is_default_objects_active) {
98 HardwareI2C_FIRMATA *getI2C() {
return &i2c; }
99 HardwareSPI_FIRMATA *getSPI() {
return &spi; }
102 FirmataTransport transport;
103 HardwareGPIO_FIRMATA gpio;
104 HardwareI2C_FIRMATA i2c;
105 HardwareSPI_FIRMATA spi;
106 bool is_default_objects_active =
false;
bool begin(Stream &stream)
Start the background reader thread on the given stream.
Definition FirmataTransport.cpp:32
void end()
Stop the reader thread and detach from the stream.
Definition FirmataTransport.cpp:41
Abstract interface for providing GPIO hardware implementations.
Definition Sources.h:66
void setGPIO(HardwareGPIO *gpio)
Set the GPIO implementation directly.
Definition GPIOWrapper.h:153
GPIO hardware abstraction that speaks the Firmata protocol over an arbitrary Stream (e....
Definition HardwareGPIO_FIR.h:49
void end()
Stop the reader thread (if owned) and detach.
Definition HardwareGPIO_FIR.cpp:74
bool begin(Stream &stream)
Start talking Firmata over the given stream. Owns a private FirmataTransport for this connection alon...
Definition HardwareGPIO_FIR.cpp:53
bool begin(Stream &stream)
Start talking Firmata over the given stream (owns a private transport).
Definition HardwareI2C_FIR.cpp:35
bool begin(Stream &stream)
Start talking Firmata over the given stream (owns a private transport).
Definition HardwareSPI_FIR.cpp:41
Sets up hardware interfaces (GPIO, I2C, SPI) that talk to a remote board running Firmata,...
Definition HardwareSetupFIR.h:41
HardwareSetupFIRMATA(uint8_t spiDeviceId, int8_t spiCsPin=-1)
Definition HardwareSetupFIR.h:51
void end()
Resets hardware pointers to nullptr and stops the transport.
Definition HardwareSetupFIR.h:85
bool begin(Stream &stream, bool asDefault=true)
Start the shared Firmata transport and all three backends.
Definition HardwareSetupFIR.h:62
Abstract interface for providing I2C hardware implementations.
Definition Sources.h:36
void setI2C(HardwareI2C *i2c)
defines the i2c implementation: use nullptr to reset.
Definition I2CWrapper.h:75
Abstract interface for providing SPI hardware implementations.
Definition Sources.h:51
void setSPI(HardwareSPI *spi)
defines the spi implementation: use nullptr to reset.
Definition SPIWrapper.h:72
We provide the WiFi class to simulate the Arduino WIFI. In in Linux we can expect that networking is ...
Definition CanMsg.cpp:31
I2CWrapper Wire
Global Wire instance used by Arduino API functions and direct access.
Definition I2CWrapper.cpp:24
SPIWrapper SPI
Global SPI instance used by Arduino API and direct access.
Definition SPIWrapper.cpp:27
GPIOWrapper GPIO
Global GPIO instance used by Arduino API functions and direct access.
Definition GPIOWrapper.cpp:35
static HardwareSetupFIRMATA FIRMATA
Global instance for Firmata hardware setup.
Definition HardwareSetupFIR.h:118