22 uint8_t flags = ActiveHigh;
27 explicit IoPin(
int pin,
Base *io =
nullptr) : io(io) {
32 return (flags & IsSet) != 0;
34 void setIsSet(
bool value) {
43 return isSet() ?
static_cast<int>(pin) : -1;
45 void setPin(
int value) {
50 pin =
static_cast<uint8_t
>(value);
55 bool isPullUp()
const {
56 return (flags & PullUp) != 0;
58 void setPullUp(
bool value) {
66 bool isActiveHigh()
const {
67 return (flags & ActiveHigh) != 0;
69 void setActiveHigh(
bool value) {
77 void setMode(uint8_t value) {
80 uint8_t getMode()
const {
84 bool operator==(
const IoPin &other)
const {
85 return io == other.io && getPin() == other.getPin();
87 bool operator!=(
const IoPin &other)
const {
88 return !(*
this == other);
91 void setPwmResolutionBits(uint8_t resolutionBits);
92 void setPwmFrequency(uint32_t frequencyHz);
93 void configureAnalogOutput(
int channelNumber = -1)
const;
94 void pinMode(
int channelNumber = -1)
const;
95 int digitalRead(
int channelNumber = -1)
const;
96 void digitalWrite(uint8_t value,
int channelNumber = -1)
const;
97 void analogWrite(
int value,
int channelNumber = -1)
const;
98 uint8_t pwmResolutionBits()
const;
99 uint32_t pwmMaxValue()
const;
100 void writeActive(
int channelNumber = -1)
const;
101 void writeInactive(
int channelNumber = -1)
const;
102 bool readActive(
int channelNumber = -1)
const;