arduino-emulator
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
arduino::HardwareSetupFIRMATA Class Reference

Sets up hardware interfaces (GPIO, I2C, SPI) that talk to a remote board running Firmata, all multiplexed over one FirmataTransport. More...

#include <HardwareSetupFIR.h>

Inheritance diagram for arduino::HardwareSetupFIRMATA:
arduino::I2CSource arduino::SPISource arduino::GPIOSource

Public Member Functions

 HardwareSetupFIRMATA (uint8_t spiDeviceId, int8_t spiCsPin=-1)
 
bool begin (Stream &stream, bool asDefault=true)
 Start the shared Firmata transport and all three backends.
 
void end ()
 Resets hardware pointers to nullptr and stops the transport.
 
HardwareGPIO_FIRMATA * getGPIO ()
 
HardwareI2C_FIRMATA * getI2C ()
 
HardwareSPI_FIRMATA * getSPI ()
 

Protected Attributes

HardwareGPIO_FIRMATA gpio
 
HardwareI2C_FIRMATA i2c
 
bool is_default_objects_active = false
 
HardwareSPI_FIRMATA spi
 
FirmataTransport transport
 

Detailed Description

Sets up hardware interfaces (GPIO, I2C, SPI) that talk to a remote board running Firmata, all multiplexed over one FirmataTransport.

Unlike HardwareSetupRPI/HardwareSetupFTDI, which reach local hardware directly, Firmata needs a Stream connected to the remote device - so begin() takes one, instead of being callable with no arguments.

Note
GPIO and I2C work against plain StandardFirmata. SPI requires the remote device to run ConfigurableFirmata with its Spi feature enabled (see HardwareSPI_FIR.h).

Constructor & Destructor Documentation

◆ HardwareSetupFIRMATA()

arduino::HardwareSetupFIRMATA::HardwareSetupFIRMATA ( uint8_t  spiDeviceId,
int8_t  spiCsPin = -1 
)
inlineexplicit
Parameters
spiDeviceIdDevice identifier used for SPI_DEVICE_CONFIG; low 2 bits must be 0. Only relevant if SPI is used.
spiCsPinRemote-device pin number to use as chip-select, or -1 to toggle CS externally via GPIO.

Member Function Documentation

◆ begin()

bool arduino::HardwareSetupFIRMATA::begin ( Stream &  stream,
bool  asDefault = true 
)
inline

Start the shared Firmata transport and all three backends.

Parameters
streamAlready-opened stream connected to the Firmata device.
asDefaultIf true, sets up global Arduino objects (Wire, SPI, GPIO)
Returns
true if initialization successful, false otherwise

◆ getGPIO()

HardwareGPIO_FIRMATA * arduino::HardwareSetupFIRMATA::getGPIO ( )
inlinevirtual

Implements arduino::GPIOSource.

◆ getI2C()

HardwareI2C_FIRMATA * arduino::HardwareSetupFIRMATA::getI2C ( )
inlinevirtual

Implements arduino::I2CSource.

◆ getSPI()

HardwareSPI_FIRMATA * arduino::HardwareSetupFIRMATA::getSPI ( )
inlinevirtual

Implements arduino::SPISource.


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