summaryrefslogtreecommitdiff
path: root/quantum/rgb_matrix.c
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2020-05-18 06:05:35 -0700
committerFlorian Didron <fdidron@users.noreply.github.com>2020-06-12 17:00:27 +0900
commitdaa06948bb5a239869c24f442cdee9b3c35cc069 (patch)
treec83fad1e73873cbfab591e25d9b6809fb8b7d7a0 /quantum/rgb_matrix.c
parentc5ec960a11909ba9c27b3facae95cebfe9b6e256 (diff)
Add query functions for RGB Light and RGB Matrix (#8960)
* Add additional query functions for RGBLIGHT * Add additional query functions for RGB Matrix * Change names of enable check functions * Fix macro for rgb matrix takeover of rgblight functions * Add documentation for rgb_matrix_get_hsv() * Add *_get_hsv function to rgblight
Diffstat (limited to 'quantum/rgb_matrix.c')
-rw-r--r--quantum/rgb_matrix.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c
index 1a9cf82e5f..57207ce0b1 100644
--- a/quantum/rgb_matrix.c
+++ b/quantum/rgb_matrix.c
@@ -441,6 +441,8 @@ void rgb_matrix_set_suspend_state(bool state) {
g_suspend_state = state;
}
+bool rgb_matrix_get_suspend_state(void) { return g_suspend_state; }
+
void rgb_matrix_toggle(void) {
rgb_matrix_config.enable ^= 1;
rgb_task_state = STARTING;
@@ -467,6 +469,8 @@ void rgb_matrix_disable_noeeprom(void) {
rgb_matrix_config.enable = 0;
}
+uint8_t rgb_matrix_is_enabled(void) { return rgb_matrix_config.enable; }
+
void rgb_matrix_step(void) {
rgb_matrix_config.mode++;
if (rgb_matrix_config.mode >= RGB_MATRIX_EFFECT_MAX) rgb_matrix_config.mode = 1;
@@ -522,6 +526,8 @@ void rgb_matrix_decrease_speed(void) {
eeconfig_update_rgb_matrix();
}
+uint8_t rgb_matrix_get_speed(void) { return rgb_matrix_config.speed; }
+
led_flags_t rgb_matrix_get_flags(void) { return rgb_effect_params.flags; }
void rgb_matrix_set_flags(led_flags_t flags) { rgb_effect_params.flags = flags; }
@@ -547,3 +553,8 @@ void rgb_matrix_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val) {
rgb_matrix_config.hsv.v = val;
if (rgb_matrix_config.hsv.v > RGB_MATRIX_MAXIMUM_BRIGHTNESS) rgb_matrix_config.hsv.v = RGB_MATRIX_MAXIMUM_BRIGHTNESS;
}
+
+HSV rgb_matrix_get_hsv(void) { return rgb_matrix_config.hsv; }
+uint8_t rgb_matrix_get_hue(void) { return rgb_matrix_config.hsv.h; }
+uint8_t rgb_matrix_get_sat(void) { return rgb_matrix_config.hsv.s; }
+uint8_t rgb_matrix_get_val(void) { return rgb_matrix_config.hsv.v; }