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.

33 lines
583 B

  1. /*
  2. GPIO MODULE
  3. Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
  4. */
  5. #pragma once
  6. #include <cstdint>
  7. #include "espurna.h"
  8. #include "libs/BasePin.h"
  9. constexpr const size_t GpioPins = 17;
  10. // real hardware pin
  11. class GpioPin final : virtual public BasePin {
  12. public:
  13. explicit GpioPin(unsigned char pin);
  14. void pinMode(int8_t mode);
  15. void digitalWrite(int8_t val);
  16. int digitalRead();
  17. };
  18. bool gpioValid(unsigned char gpio);
  19. bool gpioGetLock(unsigned char gpio);
  20. bool gpioReleaseLock(unsigned char gpio);
  21. void gpioSetup();