Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

39 lines
687 B

/*
Part of the GPIO MODULE
Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
*/
#pragma once
#include "gpio.h"
#include <cstdint>
class GpioPin final : public BasePin {
public:
explicit GpioPin(unsigned char pin_) :
BasePin(pin_)
{}
void pinMode(int8_t mode) override {
::pinMode(this->pin, mode);
}
void digitalWrite(int8_t val) override {
::digitalWrite(this->pin, val);
}
String description() const override {
static String desc(String(F("GpioPin @ GPIO")) + static_cast<int>(pin));
return desc;
}
int digitalRead() {
return ::digitalRead(this->pin);
}
};