20#if defined(USE_RPI) && !defined(SKIP_HARDWARE_SETUP)
21#include "FileStream.h"
22#include "HardwareGPIO_RPI.h"
23#include "HardwareI2C_RPI.h"
24#include "HardwareSPI_RPI.h"
47 bool begin(
bool asDefault =
true) {
48 Logger.info(
"Using Raspberry Pi hardware interfaces");
49 is_default_objects_active = asDefault;
54 Logger.warning(
"GPIO, I2C, SPI set up for Raspberry Pi");
60 return gpio && i2c && spi;
67 if (is_default_objects_active) {
68 GPIO.setGPIO(
nullptr);
75 HardwareI2C_RPI* getI2C() {
return &i2c; }
76 HardwareSPI_RPI* getSPI() {
return &spi; }
79 HardwareGPIO_RPI gpio;
82 bool is_default_objects_active =
false;
We use the FileStream class to be able to provide Serial, Serial1 and Serial2 outside of the Arduino ...
Definition FileStream.h:31
Abstract interface for providing GPIO hardware implementations.
Definition Sources.h:66
GPIO hardware abstraction for Raspberry Pi in the Arduino emulator.
Definition HardwareGPIO_RPI.h:41
Sets up hardware interfaces for Raspberry Pi (GPIO, I2C, SPI).
Definition HardwareSetupRPI.h:32
~HardwareSetupRPI()
Destructor. Cleans up hardware interfaces.
Definition HardwareSetupRPI.h:42
bool begin(bool asDefault=true)
Initializes hardware pointers to Raspberry Pi interfaces.
Definition HardwareSetupRPI.h:47
HardwareSetupRPI()=default
Constructor. Initializes hardware interfaces.
void end()
Resets hardware pointers to nullptr.
Definition HardwareSetupRPI.h:66
Abstract interface for providing I2C hardware implementations.
Definition Sources.h:36
Abstract interface for providing SPI hardware implementations.
Definition Sources.h:51
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 HardwareSetupRPI RPI
Global instance for Raspberry Pi hardware setup.
Definition HardwareSetupRPI.h:91