|
|
| GPIOWrapper (GPIOSource &source) |
| |
|
| GPIOWrapper (HardwareGPIO &gpio) |
| |
| int | analogRead (pin_size_t pinNumber) |
| | Read an analog value from a pin.
|
| |
| void | analogReference (uint8_t mode) |
| | Set the analog reference voltage for ADC measurements.
|
| |
| void | analogWrite (pin_size_t pinNumber, int value) |
| | Write an analog value (PWM) to a pin.
|
| |
| void | analogWriteFrequency (pin_size_t pin, uint32_t freq) |
| | Set the PWM frequency for a pin (legacy 8-bit interface)
|
| |
| void | analogWriteResolution (uint8_t bits) |
| | Set the resolution for analog write operations.
|
| |
| PinStatus | digitalRead (pin_size_t pinNumber) |
| | Read the digital value from a pin.
|
| |
| void | digitalWrite (pin_size_t pinNumber, PinStatus status) |
| | Write a digital value to a pin.
|
| |
| void | noTone (uint8_t _pin) |
| | Stop tone generation on a pin.
|
| |
| void | pinMode (pin_size_t pinNumber, PinMode pinMode) |
| | Configure the digital pin mode for input/output operations.
|
| |
| unsigned long | pulseIn (uint8_t pin, uint8_t state, unsigned long timeout=1000000L) |
| | Measure the duration of a pulse on a pin (microseconds precision)
|
| |
| unsigned long | pulseInLong (uint8_t pin, uint8_t state, unsigned long timeout=1000000L) |
| | Measure long pulse duration on a pin (microseconds precision)
|
| |
| void | setGPIO (HardwareGPIO *gpio) |
| | Set the GPIO implementation directly.
|
| |
| void | setSource (GPIOSource *source) |
| | Set a GPIO source that provides the GPIO implementation.
|
| |
| void | tone (uint8_t _pin, unsigned int frequency, unsigned long duration=0) |
| | Generate a square wave tone on a pin.
|
| |
GPIO wrapper class that provides flexible hardware abstraction.
GPIOWrapper is a concrete implementation of the HardwareGPIO interface that supports multiple delegation patterns for GPIO operations. It can delegate operations to:
- An injected HardwareGPIO implementation
- A GPIOSource provider that supplies the GPIO implementation
- A default fallback implementation
This class implements the complete GPIO interface including:
- Digital I/O operations (pinMode, digitalWrite, digitalRead)
- Analog I/O operations (analogRead, analogWrite, analogReference)
- PWM and tone generation (analogWrite, tone, noTone)
- Pulse measurement and timing functions (pulseIn, pulseInLong)
- Pin mode configuration for input, output, and special modes
The wrapper automatically handles null safety and provides appropriate default return values when no underlying GPIO implementation is available. It supports all standard Arduino GPIO operations with hardware abstraction.
A global GPIO instance is automatically provided for system-wide GPIO access.
- See also
- HardwareGPIO
-
GPIOSource