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.

45 lines
745 B

  1. /*
  2. LED MODULE
  3. Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
  4. */
  5. #pragma once
  6. struct led_t {
  7. led_t();
  8. led_t(unsigned char id);
  9. bool status();
  10. bool status(bool new_status);
  11. bool toggle();
  12. unsigned char pin;
  13. bool inverse;
  14. unsigned char mode;
  15. unsigned char relayID;
  16. };
  17. struct led_delay_t {
  18. led_delay_t(unsigned long on_ms, unsigned long off_ms);
  19. const unsigned long on;
  20. const unsigned long off;
  21. };
  22. enum class LedMode {
  23. NetworkAutoconfig,
  24. NetworkConnected,
  25. NetworkConnectedInverse,
  26. NetworkConfig,
  27. NetworkConfigInverse,
  28. NetworkIdle,
  29. None
  30. };
  31. const led_delay_t& _ledGetDelay(LedMode mode);
  32. void ledUpdate(bool do_update);
  33. void ledSetup();