|
arduino-emulator
|
Remote GPIO implementation that operates over a communication stream. More...
#include <RemoteGPIO.h>
Public Member Functions | |
| RemoteGPIO (Stream *stream) | |
| int | analogRead (pin_size_t pinNumber) |
| Read the value from the specified analog pin. | |
| void | analogReference (uint8_t mode) |
| Configure the reference voltage used for analog input. | |
| void | analogWrite (pin_size_t pinNumber, int value) |
| Write an analog value (PWM wave) to a pin. | |
| virtual void | analogWriteFrequency (pin_size_t pin, uint32_t freq) |
| Set the PWM frequency for analogWrite() on the specified pin. | |
| virtual void | analogWriteResolution (uint8_t bits) |
| Set the resolution of the analogWrite() values. | |
| PinStatus | digitalRead (pin_size_t pinNumber) |
| Read the value from a specified digital pin. | |
| void | digitalWrite (pin_size_t pinNumber, PinStatus status) |
| Write a HIGH or LOW value to a digital pin. | |
| virtual void | noTone (uint8_t pinNumber) |
| Stop the generation of a square wave triggered by tone() | |
| operator bool () | |
| void | pinMode (pin_size_t pinNumber, PinMode pinMode) |
| Configure the specified pin to behave as an input or output. | |
| virtual unsigned long | pulseIn (uint8_t pinNumber, uint8_t state, unsigned long timeout=1000000L) |
| Read a pulse (HIGH or LOW) on a pin. | |
| virtual unsigned long | pulseInLong (uint8_t pinNumber, uint8_t state, unsigned long timeout=1000000L) |
| Alternative to pulseIn() which is better at handling long pulses. | |
| void | setStream (Stream *stream) |
| virtual void | tone (uint8_t pinNumber, unsigned int frequency, unsigned long duration=0) |
| Generate a square wave of the specified frequency on a pin. | |
Protected Attributes | |
| HardwareService | service |
Remote GPIO implementation that operates over a communication stream.
RemoteGPIO provides GPIO functionality by forwarding all operations to a remote GPIO controller via a communication stream (serial, network, etc.). This enables GPIO operations to be performed on remote hardware while maintaining the standard HardwareGPIO interface.
Key features:
The class uses HardwareService for protocol handling and can work with any Stream implementation (Serial, TCP, etc.) for remote connectivity.
|
inlinevirtual |
Read the value from the specified analog pin.
| pinNumber | The analog pin to read from (A0, A1, etc.) |
Implements arduino::HardwareGPIO.
Configure the reference voltage used for analog input.
| mode | The reference type (DEFAULT, INTERNAL, EXTERNAL, etc.) |
Implements arduino::HardwareGPIO.
Write an analog value (PWM wave) to a pin.
| pinNumber | The pin to write to |
| value | The duty cycle (0-255 for 8-bit PWM) |
Implements arduino::HardwareGPIO.
|
inlinevirtual |
Set the PWM frequency for analogWrite() on the specified pin.
| pin | The pin number to configure PWM frequency for |
| freq | The desired PWM frequency in Hz |
Implements arduino::HardwareGPIO.
Set the resolution of the analogWrite() values.
| bits | The resolution in bits (e.g., 8 for 0-255, 10 for 0-1023) |
Implements arduino::HardwareGPIO.
|
inlinevirtual |
Read the value from a specified digital pin.
| pinNumber | The pin number to read from |
Implements arduino::HardwareGPIO.
|
inlinevirtual |
Write a HIGH or LOW value to a digital pin.
| pinNumber | The pin number to write to |
| status | The value to write (HIGH or LOW) |
Implements arduino::HardwareGPIO.
Stop the generation of a square wave triggered by tone()
| _pin | The pin on which to stop generating the tone |
Implements arduino::HardwareGPIO.
|
inlinevirtual |
Configure the specified pin to behave as an input or output.
| pinNumber | The pin number to configure |
| pinMode | The mode to set (INPUT, OUTPUT, INPUT_PULLUP, etc.) |
Implements arduino::HardwareGPIO.
|
inlinevirtual |
Read a pulse (HIGH or LOW) on a pin.
| pin | The pin on which you want to read the pulse |
| state | Type of pulse to read (HIGH or LOW) |
| timeout | Timeout in microseconds (default 1 second) |
Implements arduino::HardwareGPIO.
|
inlinevirtual |
Alternative to pulseIn() which is better at handling long pulses.
| pin | The pin on which you want to read the pulse |
| state | Type of pulse to read (HIGH or LOW) |
| timeout | Timeout in microseconds (default 1 second) |
Implements arduino::HardwareGPIO.
|
inlinevirtual |
Generate a square wave of the specified frequency on a pin.
| _pin | The pin on which to generate the tone |
| frequency | The frequency of the tone in hertz |
| duration | The duration of the tone in milliseconds (0 = continuous) |
Implements arduino::HardwareGPIO.