]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - quantum/rgb_matrix.h
RGB Matrix refactoring to open up for new drivers (#3913)
[qmk_firmware.git] / quantum / rgb_matrix.h
index 046d98790f83876446492e57b45bc4fff6acbd4d..45caaac423d2d5236a2436876d4d147b550fe955 100644 (file)
@@ -100,8 +100,6 @@ void rgb_matrix_indicators(void);
 void rgb_matrix_indicators_kb(void);
 void rgb_matrix_indicators_user(void);
 
-void rgb_matrix_single_LED_test(void);
-
 void rgb_matrix_init(void);
 void rgb_matrix_setup_drivers(void);
 
@@ -126,7 +124,6 @@ void rgb_matrix_decrease(void);
 // void backlight_get_key_color( uint8_t led, HSV *hsv );
 // void backlight_set_key_color( uint8_t row, uint8_t column, HSV hsv );
 
-void rgb_matrix_test_led( uint8_t index, bool red, bool green, bool blue );
 uint32_t rgb_matrix_get_tick(void);
 
 void rgblight_toggle(void);
@@ -143,4 +140,18 @@ void rgblight_decrease_speed(void);
 void rgblight_mode(uint8_t mode);
 uint32_t rgblight_get_mode(void);
 
+typedef struct {
+    /* Perform any initialisation required for the other driver functions to work. */
+    void (*init)(void);
+
+    /* Set the colour of a single LED in the buffer. */
+    void (*set_color)(int index, uint8_t r, uint8_t g, uint8_t b);
+    /* Set the colour of all LEDS on the keyboard in the buffer. */
+    void (*set_color_all)(uint8_t r, uint8_t g, uint8_t b);
+    /* Flush any buffered changes to the hardware. */
+    void (*flush)(void);
+} rgb_matrix_driver_t;
+
+extern const rgb_matrix_driver_t rgb_matrix_driver;
+
 #endif