|
ForestHub SDK 0.1.0
C++14 LLM SDK for PC and embedded platforms
|
Abstract interface for general-purpose pin I/O. More...
#include <gpio.hpp>
Public Member Functions | |
| virtual void | SetPinMode (PinId pin, PinMode mode)=0 |
| Configure a pin's direction and pull mode. | |
| virtual void | DigitalWrite (PinId pin, int value)=0 |
| Set a digital output pin to the given logic level. | |
| virtual int | DigitalRead (PinId pin) const =0 |
| Read the current logic level of a digital input pin. | |
| virtual int | AnalogRead (PinId pin) const =0 |
| Read the raw ADC value from an analog input pin. | |
| virtual std::string | ConfigurePwm (PinId pin, const PwmConfig &config)=0 |
| Attach and configure a PWM peripheral on the given pin. | |
| virtual void | PwmWrite (PinId pin, int duty)=0 |
| Set the duty cycle on a previously configured PWM pin. | |
Abstract interface for general-purpose pin I/O.
Covers digital input/output, analog-to-digital conversion, and pulse-width modulation. Platform implementations translate calls to the underlying peripheral hardware.
|
pure virtual |
Read the raw ADC value from an analog input pin.
| pin | Target pin identifier (must support analog input). |
|
pure virtual |
Attach and configure a PWM peripheral on the given pin.
| pin | Target pin identifier (must support PWM output). |
| config | Frequency and resolution settings. |
|
pure virtual |
Read the current logic level of a digital input pin.
| pin | Target pin identifier. |
|
pure virtual |
Set a digital output pin to the given logic level.
| pin | Target pin identifier (must be configured as output). |
| value | Logic level to drive (0 = low, 1 = high). |
|
pure virtual |
Set the duty cycle on a previously configured PWM pin.
| pin | Target pin identifier (must have been configured via ConfigurePwm). |
| duty | Duty-cycle value in the range [0, 2^resolution_bits - 1]. |
|
pure virtual |
Configure a pin's direction and pull mode.
| pin | Target pin identifier. |
| mode | Desired direction and pull configuration. |