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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

rgb.h 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. Copyright 2015 Kai Ryu <[email protected]>
  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. #ifndef RGB_H
  15. #define RGB_H
  16. #include <stdint.h>
  17. #include <stdbool.h>
  18. typedef union {
  19. uint8_t raw;
  20. struct {
  21. uint8_t level :7;
  22. bool enable :1;
  23. };
  24. } rgb_config_t;
  25. enum {
  26. RGB_OFF = 0,
  27. RGB_RED,
  28. RGB_ORANGE,
  29. RGB_YELLOW,
  30. RGB_GREEN,
  31. RGB_CYAN,
  32. RGB_BLUE,
  33. RGB_VIOLET,
  34. RGB_WHITE,
  35. RGB_LEVELS
  36. };
  37. #define EECONFIG_RGB (uint8_t *)7
  38. #define RGB_UNCONFIGURED 0xFF
  39. void rgb_init(void);
  40. void rgb_toggle(void);
  41. void rgb_on(void);
  42. void rgb_off(void);
  43. void rgb_decrease(void);
  44. void rgb_increase(void);
  45. void rgb_step(void);
  46. #endif