1
0
Fork 0

LED/RGB Matrix: add header for drivers (#22628)

This commit is contained in:
Ryan 2023-12-08 16:54:47 +11:00 committed by GitHub
parent 2d3f2e92d8
commit 24511d31b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 87 additions and 75 deletions

View file

@ -21,31 +21,10 @@
#include <stdint.h>
#include <stdbool.h>
#include "rgb_matrix_types.h"
#include "rgb_matrix_drivers.h"
#include "color.h"
#include "keyboard.h"
#if defined(RGB_MATRIX_IS31FL3218)
# include "is31fl3218.h"
#elif defined(RGB_MATRIX_IS31FL3731)
# include "is31fl3731.h"
#elif defined(RGB_MATRIX_IS31FL3733)
# include "is31fl3733.h"
#elif defined(RGB_MATRIX_IS31FL3736)
# include "is31fl3736.h"
#elif defined(RGB_MATRIX_IS31FL3737)
# include "is31fl3737.h"
#elif defined(RGB_MATRIX_IS31FL3741)
# include "is31fl3741.h"
#elif defined(IS31FLCOMMON)
# include "is31flcommon.h"
#elif defined(RGB_MATRIX_SNLED27351)
# include "snled27351.h"
#elif defined(RGB_MATRIX_AW20216S)
# include "aw20216s.h"
#elif defined(RGB_MATRIX_WS2812)
# include "ws2812.h"
#endif
#ifndef RGB_MATRIX_TIMEOUT
# define RGB_MATRIX_TIMEOUT 0
#endif
@ -272,17 +251,6 @@ void rgb_matrix_set_flags_noeeprom(led_flags_t flags);
# define rgblight_decrease_speed_noeeprom rgb_matrix_decrease_speed_noeeprom
#endif
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;
static inline bool rgb_matrix_check_finished_leds(uint8_t led_idx) {
#if defined(RGB_MATRIX_SPLIT)
if (is_keyboard_left()) {
@ -295,8 +263,6 @@ static inline bool rgb_matrix_check_finished_leds(uint8_t led_idx) {
#endif
}
extern const rgb_matrix_driver_t rgb_matrix_driver;
extern rgb_config_t rgb_matrix_config;
extern uint32_t g_rgb_timer;