Keyboard firmwares for Atmel AVR and Cortex-M
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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #ifndef RGBLIGHT_H
  2. #define RGBLIGHT_H
  3. #ifndef RGBLIGHT_MODES
  4. #define RGBLIGHT_MODES 23
  5. #endif
  6. #ifndef RGBLIGHT_EFFECT_SNAKE_LENGTH
  7. #define RGBLIGHT_EFFECT_SNAKE_LENGTH 7
  8. #endif
  9. #ifndef RGBLIGHT_EFFECT_KNIGHT_LENGTH
  10. #define RGBLIGHT_EFFECT_KNIGHT_LENGTH 7
  11. #endif
  12. #ifndef RGBLIGHT_EFFECT_KNIGHT_OFFSET
  13. #define RGBLIGHT_EFFECT_KNIGHT_OFFSET 11
  14. #endif
  15. #ifndef RGBLIGHT_EFFECT_DUALKNIGHT_LENGTH
  16. #define RGBLIGHT_EFFECT_DUALKNIGHT_LENGTH 4
  17. #endif
  18. #ifndef RGBLIGHT_HUE_STEP
  19. #define RGBLIGHT_HUE_STEP 10
  20. #endif
  21. #ifndef RGBLIGHT_SAT_STEP
  22. #define RGBLIGHT_SAT_STEP 17
  23. #endif
  24. #ifndef RGBLIGHT_VAL_STEP
  25. #define RGBLIGHT_VAL_STEP 17
  26. #endif
  27. #define RGBLED_TIMER_TOP F_CPU/(256*64)
  28. #include <stdint.h>
  29. #include <stdbool.h>
  30. #include "eeconfig.h"
  31. #include "light_ws2812.h"
  32. typedef union {
  33. uint32_t raw;
  34. struct {
  35. bool enable :1;
  36. uint8_t mode :6;
  37. uint16_t hue :9;
  38. uint8_t sat :8;
  39. uint8_t val :8;
  40. };
  41. } rgblight_config_t;
  42. void rgblight_init(void);
  43. void rgblight_increase(void);
  44. void rgblight_decrease(void);
  45. void rgblight_toggle(void);
  46. void rgblight_step(void);
  47. void rgblight_mode(uint8_t mode);
  48. void rgblight_set(void);
  49. void rgblight_increase_hue(void);
  50. void rgblight_decrease_hue(void);
  51. void rgblight_increase_sat(void);
  52. void rgblight_decrease_sat(void);
  53. void rgblight_increase_val(void);
  54. void rgblight_decrease_val(void);
  55. void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val);
  56. void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b);
  57. #define EECONFIG_RGBLIGHT (uint8_t *)7
  58. uint32_t eeconfig_read_rgblight(void);
  59. void eeconfig_write_rgblight(uint32_t val);
  60. void eeconfig_write_rgblight_default(void);
  61. void eeconfig_debug_rgblight(void);
  62. void sethsv(uint16_t hue, uint8_t sat, uint8_t val, struct cRGB *led1);
  63. void setrgb(uint8_t r, uint8_t g, uint8_t b, struct cRGB *led1);
  64. void rgblight_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val);
  65. void rgblight_timer_init(void);
  66. void rgblight_timer_enable(void);
  67. void rgblight_timer_disable(void);
  68. void rgblight_timer_toggle(void);
  69. void rgblight_effect_breathing(uint8_t interval);
  70. void rgblight_effect_rainbow_mood(uint8_t interval);
  71. void rgblight_effect_rainbow_swirl(uint8_t interval);
  72. void rgblight_effect_snake(uint8_t interval);
  73. void rgblight_effect_knight(uint8_t interval);
  74. #endif