lights.h 858 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef LIGHTS_H
  2. #define LIGHTS_H
  3. #include "eeprom.h"
  4. #include "tap_dance.h"
  5. #include "zer09.h"
  6. /* Will hold the RGB brightness level */
  7. #define EECONFIG_LED_DIM_LVL (uint8_t *)15
  8. #define SET_LED_RGB(r, g, b, led_dim, pos) \
  9. setrgb(r >> led_dim, g >> led_dim, b >> led_dim, (LED_TYPE *)&led[pos])
  10. typedef enum {
  11. DEFAULT,
  12. ENABLED,
  13. DISABLED,
  14. } led_status;
  15. typedef struct {
  16. led_status status;
  17. uint8_t pos;
  18. bool forced;
  19. } led_key;
  20. enum rbw_keys {
  21. RBW_LCTL,
  22. RBW_LCAP,
  23. RBW_LSPR,
  24. RBW_RCTL,
  25. RBW_RCAP,
  26. RBW_RALT,
  27. RBW_SCRL,
  28. RBW
  29. };
  30. extern volatile led_key rbw_led_keys[RBW];
  31. void set_key_led(keyrecord_t *record, uint8_t lyr);
  32. bool set_layer_led(uint8_t lyr);
  33. bool rainbow_loop(uint8_t lyr);
  34. bool led_brightness(uint16_t keycode, keyrecord_t *record);
  35. void eeprom_read_led_dim_lvl(void);
  36. #endif