diff options
Diffstat (limited to 'quantum/led_matrix.h')
| -rw-r--r-- | quantum/led_matrix.h | 42 |
1 files changed, 6 insertions, 36 deletions
diff --git a/quantum/led_matrix.h b/quantum/led_matrix.h index 7dcdf1d48..85bae43c1 100644 --- a/quantum/led_matrix.h +++ b/quantum/led_matrix.h | |||
| @@ -19,46 +19,12 @@ | |||
| 19 | 19 | ||
| 20 | #pragma once | 20 | #pragma once |
| 21 | 21 | ||
| 22 | #include "led_matrix_types.h" | ||
| 23 | |||
| 22 | #ifndef BACKLIGHT_ENABLE | 24 | #ifndef BACKLIGHT_ENABLE |
| 23 | # error You must define BACKLIGHT_ENABLE with LED_MATRIX_ENABLE | 25 | # error You must define BACKLIGHT_ENABLE with LED_MATRIX_ENABLE |
| 24 | #endif | 26 | #endif |
| 25 | 27 | ||
| 26 | typedef struct Point { | ||
| 27 | uint8_t x; | ||
| 28 | uint8_t y; | ||
| 29 | } __attribute__((packed)) Point; | ||
| 30 | |||
| 31 | typedef struct led_matrix { | ||
| 32 | union { | ||
| 33 | uint8_t raw; | ||
| 34 | struct { | ||
| 35 | uint8_t row : 4; // 16 max | ||
| 36 | uint8_t col : 4; // 16 max | ||
| 37 | }; | ||
| 38 | } matrix_co; | ||
| 39 | Point point; | ||
| 40 | uint8_t modifier : 1; | ||
| 41 | } __attribute__((packed)) led_matrix; | ||
| 42 | |||
| 43 | extern const led_matrix g_leds[LED_DRIVER_LED_COUNT]; | ||
| 44 | |||
| 45 | typedef struct { | ||
| 46 | uint8_t index; | ||
| 47 | uint8_t value; | ||
| 48 | } led_indicator; | ||
| 49 | |||
| 50 | typedef union { | ||
| 51 | uint32_t raw; | ||
| 52 | struct { | ||
| 53 | bool enable : 1; | ||
| 54 | uint8_t mode : 6; | ||
| 55 | uint8_t hue : 8; // Unused by led_matrix | ||
| 56 | uint8_t sat : 8; // Unused by led_matrix | ||
| 57 | uint8_t val : 8; | ||
| 58 | uint8_t speed : 8; // EECONFIG needs to be increased to support this | ||
| 59 | }; | ||
| 60 | } led_config_t; | ||
| 61 | |||
| 62 | enum led_matrix_effects { | 28 | enum led_matrix_effects { |
| 63 | LED_MATRIX_UNIFORM_BRIGHTNESS = 1, | 29 | LED_MATRIX_UNIFORM_BRIGHTNESS = 1, |
| 64 | // All new effects go above this line | 30 | // All new effects go above this line |
| @@ -122,3 +88,7 @@ typedef struct { | |||
| 122 | } led_matrix_driver_t; | 88 | } led_matrix_driver_t; |
| 123 | 89 | ||
| 124 | extern const led_matrix_driver_t led_matrix_driver; | 90 | extern const led_matrix_driver_t led_matrix_driver; |
| 91 | |||
| 92 | extern led_eeconfig_t led_matrix_eeconfig; | ||
| 93 | |||
| 94 | extern led_config_t g_led_config; | ||
