Skip to content

Commit

Permalink
Update AW20216S LED type (qmk#22072)
Browse files Browse the repository at this point in the history
* Update AW20216S LED type

* Remove mattgauf keymap
  • Loading branch information
fauxpark authored and Lorenzo Castoldi committed Dec 27, 2023
1 parent a844df2 commit 67992b9
Show file tree
Hide file tree
Showing 21 changed files with 37 additions and 801 deletions.
10 changes: 10 additions & 0 deletions builddefs/common_features.mk
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,11 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
endif
endif

# Deprecated driver names - do not use
ifeq ($(strip $(LED_MATRIX_DRIVER)), aw20216)
LED_MATRIX_DRIVER := aw20216s
endif

LED_MATRIX_ENABLE ?= no
VALID_LED_MATRIX_TYPES := is31fl3731 is31fl3742a is31fl3743a is31fl3745 is31fl3746a ckled2001 custom
# TODO: is31fl3733 is31fl3737 is31fl3741
Expand Down Expand Up @@ -414,6 +419,11 @@ endif

endif

# Deprecated driver names - do not use
ifeq ($(strip $(RGB_MATRIX_DRIVER)), aw20216)
RGB_MATRIX_DRIVER := aw20216s
endif

RGB_MATRIX_ENABLE ?= no

VALID_RGB_MATRIX_TYPES := aw20216s is31fl3218 is31fl3731 is31fl3733 is31fl3736 is31fl3737 is31fl3741 is31fl3742a is31fl3743a is31fl3745 is31fl3746a ckled2001 ws2812 custom
Expand Down
2 changes: 1 addition & 1 deletion docs/feature_rgb_matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ Here is an example using 2 drivers.
Define these arrays listing all the LEDs in your `<keyboard>.c`:
```c
const aw20216s_led PROGMEM g_aw20216s_leds[RGB_MATRIX_LED_COUNT] = {
const aw20216s_led_t PROGMEM g_aw20216s_leds[RGB_MATRIX_LED_COUNT] = {
/* Each AW20216S channel is controlled by a register at some offset between 0x00
* and 0xD7 inclusive.
* See drivers/led/aw20216s.h for the mapping between register offsets and
Expand Down
2 changes: 1 addition & 1 deletion drivers/led/aw20216s.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ void aw20216s_init(pin_t cs_pin, pin_t en_pin) {
}

void aw20216s_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
aw20216s_led led;
aw20216s_led_t led;
memcpy_P(&led, (&g_aw20216s_leds[index]), sizeof(led));

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) {
Expand Down
9 changes: 6 additions & 3 deletions drivers/led/aw20216s.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,19 @@
#ifdef DRIVER_2_EN
# define AW20216S_DRIVER_2_EN DRIVER_2_EN
#endif

#define aw_led aw20216s_led_t
#define g_aw_leds g_aw20216s_leds
// ========

typedef struct aw20216s_led {
typedef struct aw20216s_led_t {
uint8_t driver : 2;
uint8_t r;
uint8_t g;
uint8_t b;
} aw20216s_led;
} aw20216s_led_t;

extern const aw20216s_led PROGMEM g_aw20216s_leds[RGB_MATRIX_LED_COUNT];
extern const aw20216s_led_t PROGMEM g_aw20216s_leds[RGB_MATRIX_LED_COUNT];

void aw20216s_init(pin_t cs_pin, pin_t en_pin);
void aw20216s_set_color(int index, uint8_t red, uint8_t green, uint8_t blue);
Expand Down
4 changes: 2 additions & 2 deletions keyboards/gmmk/gmmk2/p65/ansi/ansi.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

#ifdef RGB_MATRIX_ENABLE

const aw20216s_led g_aw20216s_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
const aw20216s_led_t g_aw20216s_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to AW20216S manual for these locations
* driver
* | R location
* | | G location
Expand Down
4 changes: 2 additions & 2 deletions keyboards/gmmk/gmmk2/p65/iso/iso.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

#ifdef RGB_MATRIX_ENABLE

const aw20216s_led g_aw20216s_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
const aw20216s_led_t g_aw20216s_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to AW20216S manual for these locations
* driver
* | R location
* | | G location
Expand Down
4 changes: 2 additions & 2 deletions keyboards/gmmk/gmmk2/p96/ansi/ansi.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

#ifdef RGB_MATRIX_ENABLE

const aw20216s_led g_aw20216s_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
const aw20216s_led_t g_aw20216s_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to AW20216S manual for these locations
* driver
* | R location
* | | G location
Expand Down
4 changes: 2 additions & 2 deletions keyboards/gmmk/gmmk2/p96/iso/iso.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

#ifdef RGB_MATRIX_ENABLE

const aw20216s_led g_aw20216s_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
const aw20216s_led_t g_aw20216s_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to AW20216S manual for these locations
* driver
* | R location
* | | G location
Expand Down
13 changes: 5 additions & 8 deletions keyboards/gmmk/numpad/numpad.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,13 @@

#ifdef RGB_MATRIX_ENABLE

const aw20216s_led g_aw20216s_leds[RGB_MATRIX_LED_COUNT] = {
/* Each AW20216S channel is controlled by a register at some offset between 0x00
* and 0xD7 inclusive.
* See drivers/led/aw20216s.h for the mapping between register offsets and
* driver pin locations.
const aw20216s_led_t g_aw20216s_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to AW20216S manual for these locations
* driver
* | R location
* | | G location
* | | | B location
* | | | | */
* | | G location
* | | | B location
* | | | | */
{0, CS4_SW1, CS5_SW1, CS6_SW1 }, // 0 NUM
{0, CS4_SW2, CS5_SW2, CS6_SW2 }, // 1 /
{0, CS7_SW1, CS8_SW1, CS9_SW1 }, // 2 *
Expand Down
2 changes: 1 addition & 1 deletion keyboards/gmmk/pro/rev1/ansi/ansi.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ led_config_t g_led_config = {{
4, 2, 2, 4, 4, 2, 2, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 4, 4, 4
}};

const aw20216s_led g_aw20216s_leds[RGB_MATRIX_LED_COUNT] = {
const aw20216s_led_t g_aw20216s_leds[RGB_MATRIX_LED_COUNT] = {
{0, CS1_SW1, CS2_SW1, CS3_SW1}, // 0, ESC, k13
{0, CS4_SW1, CS5_SW1, CS6_SW1}, // 1, ~, k16
{0, CS7_SW1, CS8_SW1, CS9_SW1}, // 2, Tab, k11
Expand Down
241 changes: 0 additions & 241 deletions keyboards/gmmk/pro/rev1/ansi/keymaps/mattgauf/ansi.c

This file was deleted.

Loading

0 comments on commit 67992b9

Please sign in to comment.