forked from qmk/qmk_firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LED/RGB Matrix: add header for drivers (qmk#22628)
- Loading branch information
Showing
6 changed files
with
87 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright 2023 QMK | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
#pragma once | ||
|
||
#include <stdint.h> | ||
|
||
#if defined(LED_MATRIX_IS31FL3218) | ||
# include "is31fl3218-simple.h" | ||
#elif defined(LED_MATRIX_IS31FL3731) | ||
# include "is31fl3731-simple.h" | ||
#elif defined(LED_MATRIX_IS31FL3733) | ||
# include "is31fl3733-simple.h" | ||
#elif defined(LED_MATRIX_IS31FL3736) | ||
# include "is31fl3736-simple.h" | ||
#elif defined(LED_MATRIX_IS31FL3737) | ||
# include "is31fl3737-simple.h" | ||
#elif defined(LED_MATRIX_IS31FL3741) | ||
# include "is31fl3741-simple.h" | ||
#elif defined(IS31FLCOMMON) | ||
# include "is31flcommon.h" | ||
#elif defined(LED_MATRIX_SNLED27351) | ||
# include "snled27351-simple.h" | ||
#endif | ||
|
||
typedef struct { | ||
/* Perform any initialisation required for the other driver functions to work. */ | ||
void (*init)(void); | ||
|
||
/* Set the brightness of a single LED in the buffer. */ | ||
void (*set_value)(int index, uint8_t value); | ||
/* Set the brightness of all LEDS on the keyboard in the buffer. */ | ||
void (*set_value_all)(uint8_t value); | ||
/* Flush any buffered changes to the hardware. */ | ||
void (*flush)(void); | ||
} led_matrix_driver_t; | ||
|
||
extern const led_matrix_driver_t led_matrix_driver; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright 2023 QMK | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
#pragma once | ||
|
||
#include <stdint.h> | ||
|
||
#if defined(RGB_MATRIX_AW20216S) | ||
# include "aw20216s.h" | ||
#elif 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_WS2812) | ||
# include "ws2812.h" | ||
#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; | ||
|
||
extern const rgb_matrix_driver_t rgb_matrix_driver; |