diff options
Diffstat (limited to 'quantum/led_matrix.h')
| -rw-r--r-- | quantum/led_matrix.h | 45 |
1 files changed, 27 insertions, 18 deletions
diff --git a/quantum/led_matrix.h b/quantum/led_matrix.h index fd7ef7d29..ba8f0279a 100644 --- a/quantum/led_matrix.h +++ b/quantum/led_matrix.h | |||
| @@ -36,14 +36,36 @@ | |||
| 36 | # define LED_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 | 36 | # define LED_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 |
| 37 | #endif | 37 | #endif |
| 38 | 38 | ||
| 39 | #if defined(LED_MATRIX_LED_PROCESS_LIMIT) && LED_MATRIX_LED_PROCESS_LIMIT > 0 && LED_MATRIX_LED_PROCESS_LIMIT < DRIVER_LED_TOTAL | ||
| 40 | # define LED_MATRIX_USE_LIMITS(min, max) \ | ||
| 41 | uint8_t min = LED_MATRIX_LED_PROCESS_LIMIT * params->iter; \ | ||
| 42 | uint8_t max = min + LED_MATRIX_LED_PROCESS_LIMIT; \ | ||
| 43 | if (max > DRIVER_LED_TOTAL) max = DRIVER_LED_TOTAL; | ||
| 44 | #else | ||
| 45 | # define LED_MATRIX_USE_LIMITS(min, max) \ | ||
| 46 | uint8_t min = 0; \ | ||
| 47 | uint8_t max = DRIVER_LED_TOTAL; | ||
| 48 | #endif | ||
| 49 | |||
| 39 | enum led_matrix_effects { | 50 | enum led_matrix_effects { |
| 40 | LED_MATRIX_UNIFORM_BRIGHTNESS = 1, | 51 | LED_MATRIX_UNIFORM_BRIGHTNESS = 1, |
| 41 | // All new effects go above this line | 52 | // All new effects go above this line |
| 42 | LED_MATRIX_EFFECT_MAX | 53 | LED_MATRIX_EFFECT_MAX |
| 43 | }; | 54 | }; |
| 44 | 55 | ||
| 45 | void led_matrix_set_index_value(int index, uint8_t value); | 56 | void eeconfig_update_led_matrix_default(void); |
| 46 | void led_matrix_set_index_value_all(uint8_t value); | 57 | void eeconfig_update_led_matrix(void); |
| 58 | void eeconfig_debug_led_matrix(void); | ||
| 59 | |||
| 60 | uint8_t led_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i); | ||
| 61 | uint8_t led_matrix_map_row_column_to_led(uint8_t row, uint8_t column, uint8_t *led_i); | ||
| 62 | |||
| 63 | void led_matrix_set_value(int index, uint8_t value); | ||
| 64 | void led_matrix_set_value_all(uint8_t value); | ||
| 65 | |||
| 66 | bool process_led_matrix(uint16_t keycode, keyrecord_t *record); | ||
| 67 | |||
| 68 | void led_matrix_task(void); | ||
| 47 | 69 | ||
| 48 | // This runs after another backlight effect and replaces | 70 | // This runs after another backlight effect and replaces |
| 49 | // values already set | 71 | // values already set |
| @@ -52,23 +74,9 @@ void led_matrix_indicators_kb(void); | |||
| 52 | void led_matrix_indicators_user(void); | 74 | void led_matrix_indicators_user(void); |
| 53 | 75 | ||
| 54 | void led_matrix_init(void); | 76 | void led_matrix_init(void); |
| 55 | void led_matrix_setup_drivers(void); | ||
| 56 | |||
| 57 | void led_matrix_set_suspend_state(bool state); | ||
| 58 | void led_matrix_set_indicator_state(uint8_t state); | ||
| 59 | |||
| 60 | void led_matrix_task(void); | ||
| 61 | |||
| 62 | // This should not be called from an interrupt | ||
| 63 | // (eg. from a timer interrupt). | ||
| 64 | // Call this while idle (in between matrix scans). | ||
| 65 | // If the buffer is dirty, it will update the driver with the buffer. | ||
| 66 | void led_matrix_update_pwm_buffers(void); | ||
| 67 | |||
| 68 | bool process_led_matrix(uint16_t keycode, keyrecord_t *record); | ||
| 69 | |||
| 70 | uint32_t led_matrix_get_tick(void); | ||
| 71 | 77 | ||
| 78 | void led_matrix_set_suspend_state(bool state); | ||
| 79 | bool led_matrix_get_suspend_state(void); | ||
| 72 | void led_matrix_toggle(void); | 80 | void led_matrix_toggle(void); |
| 73 | void led_matrix_toggle_noeeprom(void); | 81 | void led_matrix_toggle_noeeprom(void); |
| 74 | void led_matrix_enable(void); | 82 | void led_matrix_enable(void); |
| @@ -114,4 +122,5 @@ extern const led_matrix_driver_t led_matrix_driver; | |||
| 114 | 122 | ||
| 115 | extern led_eeconfig_t led_matrix_eeconfig; | 123 | extern led_eeconfig_t led_matrix_eeconfig; |
| 116 | 124 | ||
| 125 | extern bool g_suspend_state; | ||
| 117 | extern led_config_t g_led_config; | 126 | extern led_config_t g_led_config; |
