2
0

lights.h 831 B

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