gpio configuration via web interface
This commit is contained in:
19
Gpio.h
19
Gpio.h
@@ -5,7 +5,7 @@
|
||||
|
||||
enum class PinRole
|
||||
{
|
||||
Undefined,
|
||||
Disabled,
|
||||
InputLock,
|
||||
InputUnlock,
|
||||
InputUnlatch,
|
||||
@@ -16,7 +16,7 @@ enum class PinRole
|
||||
struct PinEntry
|
||||
{
|
||||
uint8_t pin = 0;
|
||||
PinRole role = PinRole::Undefined;
|
||||
PinRole role = PinRole::Disabled;
|
||||
};
|
||||
|
||||
class Gpio
|
||||
@@ -29,9 +29,24 @@ public:
|
||||
void savePinConfiguration(const std::vector<PinEntry>& pinConfiguration);
|
||||
|
||||
const std::vector<uint8_t>& availablePins() const;
|
||||
const std::vector<PinEntry>& pinConfiguration() const;
|
||||
|
||||
String getRoleDescription(PinRole role) const;
|
||||
void getConfigurationText(String& text, const std::vector<PinEntry>& pinConfiguration) const;
|
||||
|
||||
const std::vector<PinRole>& getAllRoles() const;
|
||||
|
||||
private:
|
||||
const std::vector<uint8_t> _availablePins = { 2, 4, 5, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 32, 33 };
|
||||
const std::vector<PinRole> _allRoles =
|
||||
{
|
||||
PinRole::Disabled,
|
||||
PinRole::InputLock,
|
||||
PinRole::InputUnlock,
|
||||
PinRole::InputUnlatch,
|
||||
PinRole::OutputHighLocked,
|
||||
PinRole::OutputHighUnlocked
|
||||
};
|
||||
|
||||
std::vector<PinEntry> _pinConfiguration;
|
||||
static const uint _debounceTime;
|
||||
|
||||
Reference in New Issue
Block a user