Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split LED_MATRIX_ENABLE into _ENABLE and _DRIVER #10840

Merged
merged 4 commits into from
Nov 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions common_features.mk
Original file line number Diff line number Diff line change
Expand Up @@ -168,32 +168,35 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
endif
endif

VALID_MATRIX_TYPES := yes IS31FL3731 IS31FL3733 IS31FL3737 IS31FL3741 WS2812 custom

LED_MATRIX_ENABLE ?= no
ifneq ($(strip $(LED_MATRIX_ENABLE)), no)
ifeq ($(filter $(LED_MATRIX_ENABLE),$(VALID_MATRIX_TYPES)),)
$(error LED_MATRIX_ENABLE="$(LED_MATRIX_ENABLE)" is not a valid matrix type)
VALID_LED_MATRIX_TYPES := IS31FL3731 custom
# TODO: IS31FL3733 IS31FL3737 IS31FL3741

ifeq ($(strip $(LED_MATRIX_ENABLE)), yes)
ifeq ($(filter $(LED_MATRIX_DRIVER),$(VALID_LED_MATRIX_TYPES)),)
$(error LED_MATRIX_DRIVER="$(LED_MATRIX_DRIVER)" is not a valid matrix type)
else
BACKLIGHT_ENABLE = yes
BACKLIGHT_DRIVER = custom
OPT_DEFS += -DLED_MATRIX_ENABLE
SRC += $(QUANTUM_DIR)/led_matrix.c
SRC += $(QUANTUM_DIR)/led_matrix_drivers.c
endif
endif

ifeq ($(strip $(LED_MATRIX_ENABLE)), IS31FL3731)
OPT_DEFS += -DIS31FL3731
COMMON_VPATH += $(DRIVER_PATH)/issi
SRC += is31fl3731-simple.c
QUANTUM_LIB_SRC += i2c_master.c
ifeq ($(strip $(LED_MATRIX_DRIVER)), IS31FL3731)
OPT_DEFS += -DIS31FL3731 -DSTM32_I2C -DHAL_USE_I2C=TRUE
COMMON_VPATH += $(DRIVER_PATH)/issi
SRC += is31fl3731-simple.c
QUANTUM_LIB_SRC += i2c_master.c
endif
endif

RGB_MATRIX_ENABLE ?= no
VALID_RGB_MATRIX_TYPES := IS31FL3731 IS31FL3733 IS31FL3737 IS31FL3741 WS2812 custom

ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes)
ifeq ($(filter $(RGB_MATRIX_DRIVER),$(VALID_MATRIX_TYPES)),)
ifeq ($(filter $(RGB_MATRIX_DRIVER),$(VALID_RGB_MATRIX_TYPES)),)
$(error "$(RGB_MATRIX_DRIVER)" is not a valid matrix type)
endif
OPT_DEFS += -DRGB_MATRIX_ENABLE
Expand Down
3 changes: 2 additions & 1 deletion docs/feature_led_matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ If you want to use RGB LED's you should use the [RGB Matrix Subsystem](feature_r

There is basic support for addressable LED matrix lighting with the I2C IS31FL3731 RGB controller. To enable it, add this to your `rules.mk`:

LED_MATRIX_ENABLE = IS31FL3731
LED_MATRIX_ENABLE = yes
LED_MATRIX_DRIVER = IS31FL3731

You can use between 1 and 4 IS31FL3731 IC's. Do not specify `LED_DRIVER_ADDR_<N>` defines for IC's that are not present on your keyboard. You can define the following items in `config.h`:

Expand Down
3 changes: 2 additions & 1 deletion docs/ja/feature_led_matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ RGB LED を使いたい場合は、代わりに [RGB マトリックスサブシ

I2C IS31FL3731 RGB コントローラを使ったアドレス指定可能な LED マトリックスライトのための基本的なサポートがあります:有効にするには、`rules.mk` に以下を追加します:

LED_MATRIX_ENABLE = IS31FL3731
LED_MATRIX_ENABLE = yes
LED_MATRIX_DRIVER = IS31FL3731

1から4個の IS31FL3731 IC を使うことができます。キーボード上に存在しない IC の `LED_DRIVER_ADDR_<N>` 定義を指定しないでください。`config.h` に以下の項目を定義することができます:

Expand Down
3 changes: 2 additions & 1 deletion keyboards/clueboard/66_hotswap/gen1/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
MCU = STM32F303

# LED Configuration
LED_MATRIX_ENABLE = IS31FL3731
LED_MATRIX_ENABLE = yes
LED_MATRIX_DRIVER = IS31FL3731

# Build Options
# comment out to disable the options.
Expand Down
3 changes: 2 additions & 1 deletion keyboards/terrazzo/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: htt
AUDIO_ENABLE = no
RGBLIGHT_ENABLE = no
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
LED_MATRIX_ENABLE = IS31FL3731
LED_MATRIX_ENABLE = yes
LED_MATRIX_DRIVER = IS31FL3731
ENCODER_ENABLE = yes
WPM_ENABLE = yes

Expand Down