Skip to content

Commit 4b26d9b

Browse files
authored
Update AW20216S LED type (#22072)
* Update AW20216S LED type * Remove mattgauf keymap
1 parent 3575e27 commit 4b26d9b

File tree

21 files changed

+37
-801
lines changed

21 files changed

+37
-801
lines changed

builddefs/common_features.mk

+10
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,11 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
347347
endif
348348
endif
349349

350+
# Deprecated driver names - do not use
351+
ifeq ($(strip $(LED_MATRIX_DRIVER)), aw20216)
352+
LED_MATRIX_DRIVER := aw20216s
353+
endif
354+
350355
LED_MATRIX_ENABLE ?= no
351356
VALID_LED_MATRIX_TYPES := is31fl3731 is31fl3742a is31fl3743a is31fl3745 is31fl3746a ckled2001 custom
352357
# TODO: is31fl3733 is31fl3737 is31fl3741
@@ -414,6 +419,11 @@ endif
414419

415420
endif
416421

422+
# Deprecated driver names - do not use
423+
ifeq ($(strip $(RGB_MATRIX_DRIVER)), aw20216)
424+
RGB_MATRIX_DRIVER := aw20216s
425+
endif
426+
417427
RGB_MATRIX_ENABLE ?= no
418428

419429
VALID_RGB_MATRIX_TYPES := aw20216s is31fl3218 is31fl3731 is31fl3733 is31fl3736 is31fl3737 is31fl3741 is31fl3742a is31fl3743a is31fl3745 is31fl3746a ckled2001 ws2812 custom

docs/feature_rgb_matrix.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ Here is an example using 2 drivers.
513513
Define these arrays listing all the LEDs in your `<keyboard>.c`:
514514
515515
```c
516-
const aw20216s_led PROGMEM g_aw20216s_leds[RGB_MATRIX_LED_COUNT] = {
516+
const aw20216s_led_t PROGMEM g_aw20216s_leds[RGB_MATRIX_LED_COUNT] = {
517517
/* Each AW20216S channel is controlled by a register at some offset between 0x00
518518
* and 0xD7 inclusive.
519519
* See drivers/led/aw20216s.h for the mapping between register offsets and

drivers/led/aw20216s.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ void aw20216s_init(pin_t cs_pin, pin_t en_pin) {
142142
}
143143

144144
void aw20216s_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
145-
aw20216s_led led;
145+
aw20216s_led_t led;
146146
memcpy_P(&led, (&g_aw20216s_leds[index]), sizeof(led));
147147

148148
if (g_pwm_buffer[led.driver][led.r] == red && g_pwm_buffer[led.driver][led.g] == green && g_pwm_buffer[led.driver][led.b] == blue) {

drivers/led/aw20216s.h

+6-3
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,19 @@
4949
#ifdef DRIVER_2_EN
5050
# define AW20216S_DRIVER_2_EN DRIVER_2_EN
5151
#endif
52+
53+
#define aw_led aw20216s_led_t
54+
#define g_aw_leds g_aw20216s_leds
5255
// ========
5356

54-
typedef struct aw20216s_led {
57+
typedef struct aw20216s_led_t {
5558
uint8_t driver : 2;
5659
uint8_t r;
5760
uint8_t g;
5861
uint8_t b;
59-
} aw20216s_led;
62+
} aw20216s_led_t;
6063

61-
extern const aw20216s_led PROGMEM g_aw20216s_leds[RGB_MATRIX_LED_COUNT];
64+
extern const aw20216s_led_t PROGMEM g_aw20216s_leds[RGB_MATRIX_LED_COUNT];
6265

6366
void aw20216s_init(pin_t cs_pin, pin_t en_pin);
6467
void aw20216s_set_color(int index, uint8_t red, uint8_t green, uint8_t blue);

keyboards/gmmk/gmmk2/p65/ansi/ansi.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
#ifdef RGB_MATRIX_ENABLE
2020

21-
const aw20216s_led g_aw20216s_leds[RGB_MATRIX_LED_COUNT] = {
22-
/* Refer to IS31 manual for these locations
21+
const aw20216s_led_t g_aw20216s_leds[RGB_MATRIX_LED_COUNT] = {
22+
/* Refer to AW20216S manual for these locations
2323
* driver
2424
* | R location
2525
* | | G location

keyboards/gmmk/gmmk2/p65/iso/iso.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
#ifdef RGB_MATRIX_ENABLE
2020

21-
const aw20216s_led g_aw20216s_leds[RGB_MATRIX_LED_COUNT] = {
22-
/* Refer to IS31 manual for these locations
21+
const aw20216s_led_t g_aw20216s_leds[RGB_MATRIX_LED_COUNT] = {
22+
/* Refer to AW20216S manual for these locations
2323
* driver
2424
* | R location
2525
* | | G location

keyboards/gmmk/gmmk2/p96/ansi/ansi.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
#ifdef RGB_MATRIX_ENABLE
2020

21-
const aw20216s_led g_aw20216s_leds[RGB_MATRIX_LED_COUNT] = {
22-
/* Refer to IS31 manual for these locations
21+
const aw20216s_led_t g_aw20216s_leds[RGB_MATRIX_LED_COUNT] = {
22+
/* Refer to AW20216S manual for these locations
2323
* driver
2424
* | R location
2525
* | | G location

keyboards/gmmk/gmmk2/p96/iso/iso.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
#ifdef RGB_MATRIX_ENABLE
2020

21-
const aw20216s_led g_aw20216s_leds[RGB_MATRIX_LED_COUNT] = {
22-
/* Refer to IS31 manual for these locations
21+
const aw20216s_led_t g_aw20216s_leds[RGB_MATRIX_LED_COUNT] = {
22+
/* Refer to AW20216S manual for these locations
2323
* driver
2424
* | R location
2525
* | | G location

keyboards/gmmk/numpad/numpad.c

+5-8
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,13 @@
1919

2020
#ifdef RGB_MATRIX_ENABLE
2121

22-
const aw20216s_led g_aw20216s_leds[RGB_MATRIX_LED_COUNT] = {
23-
/* Each AW20216S channel is controlled by a register at some offset between 0x00
24-
* and 0xD7 inclusive.
25-
* See drivers/led/aw20216s.h for the mapping between register offsets and
26-
* driver pin locations.
22+
const aw20216s_led_t g_aw20216s_leds[RGB_MATRIX_LED_COUNT] = {
23+
/* Refer to AW20216S manual for these locations
2724
* driver
2825
* | R location
29-
* | | G location
30-
* | | | B location
31-
* | | | | */
26+
* | | G location
27+
* | | | B location
28+
* | | | | */
3229
{0, CS4_SW1, CS5_SW1, CS6_SW1 }, // 0 NUM
3330
{0, CS4_SW2, CS5_SW2, CS6_SW2 }, // 1 /
3431
{0, CS7_SW1, CS8_SW1, CS9_SW1 }, // 2 *

keyboards/gmmk/pro/rev1/ansi/ansi.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ led_config_t g_led_config = {{
136136
4, 2, 2, 4, 4, 2, 2, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 4, 4, 4
137137
}};
138138

139-
const aw20216s_led g_aw20216s_leds[RGB_MATRIX_LED_COUNT] = {
139+
const aw20216s_led_t g_aw20216s_leds[RGB_MATRIX_LED_COUNT] = {
140140
{0, CS1_SW1, CS2_SW1, CS3_SW1}, // 0, ESC, k13
141141
{0, CS4_SW1, CS5_SW1, CS6_SW1}, // 1, ~, k16
142142
{0, CS7_SW1, CS8_SW1, CS9_SW1}, // 2, Tab, k11

keyboards/gmmk/pro/rev1/ansi/keymaps/mattgauf/ansi.c

-241
This file was deleted.

0 commit comments

Comments
 (0)