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.
 
 
 
 
 
 

29 lines
528 B

/*
Part of BUTTON module
Copyright (C) 2020 by Maxim Prokhorov <prokhorov dot max at outlook dot com>
*/
#pragma once
#include <cstdint>
#include "../config/types.h"
// base interface for generic pin handler.
struct BasePin {
explicit BasePin(unsigned char pin) :
pin(pin)
{}
virtual operator bool() {
return GPIO_NONE != pin;
}
virtual void pinMode(int8_t mode) = 0;
virtual void digitalWrite(int8_t val) = 0;
virtual int digitalRead() = 0;
const unsigned char pin;
};