backlight.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. Copyright 2013 Mathias Andersson <wraul@dbox.se>
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #pragma once
  15. #include <stdint.h>
  16. #include <stdbool.h>
  17. typedef union {
  18. uint8_t raw;
  19. struct {
  20. bool enable :1;
  21. uint8_t level :7;
  22. };
  23. } backlight_config_t;
  24. void backlight_init(void);
  25. void backlight_increase(void);
  26. void backlight_decrease(void);
  27. void backlight_toggle(void);
  28. void backlight_enable(void);
  29. void backlight_disable(void);
  30. bool is_backlight_enabled(void);
  31. void backlight_step(void);
  32. void backlight_set(uint8_t level);
  33. void backlight_level(uint8_t level);
  34. uint8_t get_backlight_level(void);