Skip to content

Commit 806a7f5

Browse files
fauxparkmechlovin
authored andcommitted
aw20216: driver naming cleanups (qmk#21891)
1 parent 53c1c65 commit 806a7f5

34 files changed

+292
-262
lines changed

builddefs/common_features.mk

+4-4
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ endif
416416

417417
RGB_MATRIX_ENABLE ?= no
418418

419-
VALID_RGB_MATRIX_TYPES := aw20216 is31fl3731 is31fl3733 is31fl3736 is31fl3737 is31fl3741 is31fl3742a is31fl3743a is31fl3745 is31fl3746a ckled2001 ws2812 custom
419+
VALID_RGB_MATRIX_TYPES := aw20216s is31fl3731 is31fl3733 is31fl3736 is31fl3737 is31fl3741 is31fl3742a is31fl3743a is31fl3745 is31fl3746a ckled2001 ws2812 custom
420420
ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes)
421421
ifeq ($(filter $(RGB_MATRIX_DRIVER),$(VALID_RGB_MATRIX_TYPES)),)
422422
$(call CATASTROPHIC_ERROR,Invalid RGB_MATRIX_DRIVER,RGB_MATRIX_DRIVER="$(RGB_MATRIX_DRIVER)" is not a valid matrix type)
@@ -437,10 +437,10 @@ endif
437437
CIE1931_CURVE := yes
438438
RGB_KEYCODES_ENABLE := yes
439439

440-
ifeq ($(strip $(RGB_MATRIX_DRIVER)), aw20216)
441-
OPT_DEFS += -DAW20216 -DSTM32_SPI -DHAL_USE_SPI=TRUE
440+
ifeq ($(strip $(RGB_MATRIX_DRIVER)), aw20216s)
441+
OPT_DEFS += -DAW20216S -DSTM32_SPI -DHAL_USE_SPI=TRUE
442442
COMMON_VPATH += $(DRIVER_PATH)/led
443-
SRC += aw20216.c
443+
SRC += aw20216s.c
444444
QUANTUM_LIB_SRC += spi_master.c
445445
endif
446446

docs/feature_rgb_matrix.md

+21-21
Original file line numberDiff line numberDiff line change
@@ -465,41 +465,41 @@ Configure the hardware via your `config.h`:
465465
```
466466
467467
---
468-
### AW20216 :id=aw20216
469-
There is basic support for addressable RGB matrix lighting with the SPI AW20216 RGB controller. To enable it, add this to your `rules.mk`:
468+
### AW20216S :id=aw20216s
469+
There is basic support for addressable RGB matrix lighting with the SPI AW20216S RGB controller. To enable it, add this to your `rules.mk`:
470470
471471
```make
472472
RGB_MATRIX_ENABLE = yes
473-
RGB_MATRIX_DRIVER = aw20216
473+
RGB_MATRIX_DRIVER = aw20216s
474474
```
475475

476-
You can use up to 2 AW20216 IC's. Do not specify `DRIVER_<N>_xxx` defines for IC's that are not present on your keyboard. You can define the following items in `config.h`:
476+
You can use up to 2 AW20216S IC's. Do not specify `DRIVER_<N>_xxx` defines for IC's that are not present on your keyboard. You can define the following items in `config.h`:
477477

478478
| Variable | Description | Default |
479479
|----------|-------------|---------|
480-
| `DRIVER_1_CS` | (Required) MCU pin connected to first RGB driver chip select line | B13 |
481-
| `DRIVER_2_CS` | (Optional) MCU pin connected to second RGB driver chip select line | |
482-
| `DRIVER_1_EN` | (Required) MCU pin connected to first RGB driver hardware enable line | C13 |
483-
| `DRIVER_2_EN` | (Optional) MCU pin connected to second RGB driver hardware enable line | |
480+
| `AW20216S_DRIVER_1_CS` | (Required) MCU pin connected to first RGB driver chip select line | B13 |
481+
| `AW20216S_DRIVER_2_CS` | (Optional) MCU pin connected to second RGB driver chip select line | |
482+
| `AW20216S_DRIVER_1_EN` | (Required) MCU pin connected to first RGB driver hardware enable line | C13 |
483+
| `AW20216S_DRIVER_2_EN` | (Optional) MCU pin connected to second RGB driver hardware enable line | |
484484
| `DRIVER_1_LED_TOTAL` | (Required) How many RGB lights are connected to first RGB driver | |
485485
| `DRIVER_2_LED_TOTAL` | (Optional) How many RGB lights are connected to second RGB driver | |
486-
| `DRIVER_COUNT` | (Required) How many RGB driver IC's are present | |
486+
| `AW20216S_DRIVER_COUNT` | (Required) How many RGB driver IC's are present | |
487487
| `RGB_MATRIX_LED_COUNT` | (Required) How many RGB lights are present across all drivers | |
488-
| `AW_SCALING_MAX` | (Optional) LED current scaling value (0-255, higher values mean LED is brighter at full PWM) | 150 |
489-
| `AW_GLOBAL_CURRENT_MAX` | (Optional) Driver global current limit (0-255, higher values means the driver may consume more power) | 150 |
490-
| `AW_SPI_MODE` | (Optional) Mode for SPI communication (0-3, defines polarity and phase of the clock) | 3 |
491-
| `AW_SPI_DIVISOR` | (Optional) Clock divisor for SPI communication (powers of 2, smaller numbers means faster communication, should not be less than 4) | 4 |
488+
| `AW20216S_SCALING_MAX` | (Optional) LED current scaling value (0-255, higher values mean LED is brighter at full PWM) | 150 |
489+
| `AW20216S_GLOBAL_CURRENT_MAX` | (Optional) Driver global current limit (0-255, higher values means the driver may consume more power) | 150 |
490+
| `AW20216S_SPI_MODE` | (Optional) Mode for SPI communication (0-3, defines polarity and phase of the clock) | 3 |
491+
| `AW20216S_SPI_DIVISOR` | (Optional) Clock divisor for SPI communication (powers of 2, smaller numbers means faster communication, should not be less than 4) | 4 |
492492
493493
Here is an example using 2 drivers.
494494
495495
```c
496-
#define DRIVER_1_CS B13
497-
#define DRIVER_2_CS B14
496+
#define AW20216S_DRIVER_1_CS B13
497+
#define AW20216S_DRIVER_2_CS B14
498498
// Hardware enable lines may be connected to the same pin
499-
#define DRIVER_1_EN C13
500-
#define DRIVER_2_EN C13
499+
#define AW20216S_DRIVER_1_EN C13
500+
#define AW20216S_DRIVER_2_EN C13
501501
502-
#define DRIVER_COUNT 2
502+
#define AW20216S_DRIVER_COUNT 2
503503
#define DRIVER_1_LED_TOTAL 66
504504
#define DRIVER_2_LED_TOTAL 32
505505
#define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)
@@ -510,10 +510,10 @@ Here is an example using 2 drivers.
510510
Define these arrays listing all the LEDs in your `<keyboard>.c`:
511511
512512
```c
513-
const aw_led PROGMEM g_aw_leds[RGB_MATRIX_LED_COUNT] = {
514-
/* Each AW20216 channel is controlled by a register at some offset between 0x00
513+
const aw20216s_led PROGMEM g_aw20216s_leds[RGB_MATRIX_LED_COUNT] = {
514+
/* Each AW20216S channel is controlled by a register at some offset between 0x00
515515
* and 0xD7 inclusive.
516-
* See drivers/awinic/aw20216.h for the mapping between register offsets and
516+
* See drivers/led/aw20216s.h for the mapping between register offsets and
517517
* driver pin locations.
518518
* driver
519519
* | R location

docs/reference_info_json.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ Configures the [RGB Matrix](feature_rgb_matrix.md) feature.
530530
* The centroid (geometric center) of the LEDs. Used for certain effects.
531531
* Default: `[112, 32]`
532532
* `driver` (Required)
533-
* The driver to use. Must be one of `aw20216`, `ckled2001`, `custom`, `is31fl3731`, `is31fl3733`, `is31fl3736`, `is31fl3737`, `is31fl3741`, `is31fl3742a`, `is31fl3743a`, `is31fl3745`, `is31fl3746a`, `ws2812`.
533+
* The driver to use. Must be one of `aw20216s`, `ckled2001`, `custom`, `is31fl3731`, `is31fl3733`, `is31fl3736`, `is31fl3737`, `is31fl3741`, `is31fl3742a`, `is31fl3743a`, `is31fl3745`, `is31fl3746a`, `ws2812`.
534534
* `hue_steps`
535535
* The number of hue adjustment steps.
536536
* Default: `8`

drivers/led/aw20216.c

-168
This file was deleted.

0 commit comments

Comments
 (0)