21#include "HardwareGPIO.h"
22#include "HardwareService.h"
64 service.send((
uint16_t)GpioDigitalWrite);
71 service.send((
uint16_t)GpioDigitalRead);
74 return (PinStatus)service.receive8();
78 service.send((
uint16_t)GpioAnalogRead);
81 return service.receive16();
85 service.send((
uint16_t)GpioAnalogReference);
91 service.send((
uint16_t)GpioAnalogWrite);
101 service.send(frequency);
113 unsigned long timeout = 1000000L) {
114 service.send((
uint16_t)GpioPulseIn);
119 return service.receive64();
123 unsigned long timeout = 1000000L) {
124 service.send((
uint16_t)GpioPulseInLong);
129 return service.receive64();
132 service.send((
uint16_t)GpioAnalogWriteFrequency);
138 service.send((
uint16_t)GpioAnalogWriteResolution);
143 operator bool() {
return service; }
146 HardwareService service;
Abstract base class for GPIO (General Purpose Input/Output) functions.
Definition HardwareGPIO.h:51
Remote GPIO implementation that operates over a communication stream.
Definition RemoteGPIO.h:50
void analogWrite(pin_size_t pinNumber, int value)
Write an analog value (PWM wave) to a pin.
Definition RemoteGPIO.h:90
virtual void analogWriteResolution(uint8_t bits)
Set the resolution of the analogWrite() values.
Definition RemoteGPIO.h:137
void analogReference(uint8_t mode)
Configure the reference voltage used for analog input.
Definition RemoteGPIO.h:84
void digitalWrite(pin_size_t pinNumber, PinStatus status)
Write a HIGH or LOW value to a digital pin.
Definition RemoteGPIO.h:63
virtual void tone(uint8_t pinNumber, unsigned int frequency, unsigned long duration=0)
Generate a square wave of the specified frequency on a pin.
Definition RemoteGPIO.h:97
void pinMode(pin_size_t pinNumber, PinMode pinMode)
Configure the specified pin to behave as an input or output.
Definition RemoteGPIO.h:56
virtual void analogWriteFrequency(pin_size_t pin, uint32_t freq)
Set the PWM frequency for analogWrite() on the specified pin.
Definition RemoteGPIO.h:131
virtual void noTone(uint8_t pinNumber)
Stop the generation of a square wave triggered by tone()
Definition RemoteGPIO.h:106
PinStatus digitalRead(pin_size_t pinNumber)
Read the value from a specified digital pin.
Definition RemoteGPIO.h:70
virtual unsigned long pulseInLong(uint8_t pinNumber, uint8_t state, unsigned long timeout=1000000L)
Alternative to pulseIn() which is better at handling long pulses.
Definition RemoteGPIO.h:122
int analogRead(pin_size_t pinNumber)
Read the value from the specified analog pin.
Definition RemoteGPIO.h:77
virtual unsigned long pulseIn(uint8_t pinNumber, uint8_t state, unsigned long timeout=1000000L)
Read a pulse (HIGH or LOW) on a pin.
Definition RemoteGPIO.h:112
We provide the WiFi class to simulate the Arduino WIFI. In in Linux we can expect that networking is ...
Definition CanMsg.cpp:31