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

4 Driver support for IS31FL3737 #18750

Merged
merged 2 commits into from
Oct 17, 2022
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
6 changes: 4 additions & 2 deletions docs/feature_rgb_matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ There is basic support for addressable RGB matrix lighting with the I2C IS31FL37
RGB_MATRIX_ENABLE = yes
RGB_MATRIX_DRIVER = IS31FL3737
```
You can use between 1 and 2 IS31FL3737 IC's. Do not specify `DRIVER_ADDR_2` define for second IC if not present on your keyboard.
You can use between 1 and 4 IS31FL3737 IC's. Do not specify `DRIVER_ADDR_<N>` defines for IC's that are not present on your keyboard.

Configure the hardware via your `config.h`:

Expand All @@ -180,6 +180,8 @@ Configure the hardware via your `config.h`:
| `RGB_MATRIX_LED_COUNT` | (Required) How many RGB lights are present across all drivers | |
| `DRIVER_ADDR_1` | (Required) Address for the first RGB driver | |
| `DRIVER_ADDR_2` | (Optional) Address for the second RGB driver | |
| `DRIVER_ADDR_3` | (Optional) Address for the third RGB driver | |
| `DRIVER_ADDR_4` | (Optional) Address for the fourth RGB driver | |

The IS31FL3737 IC's have on-chip resistors that can be enabled to allow for de-ghosting of the RGB matrix. By default these resistors are not enabled (`ISSI_SWPULLUP`/`ISSI_CSPULLUP` are given the value of`PUR_0R`), the values that can be set to enable de-ghosting are as follows:

Expand Down Expand Up @@ -233,7 +235,7 @@ const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
}
```

Where `X_Y` is the location of the LED in the matrix defined by [the datasheet](https://www.issi.com/WW/pdf/31FL3737.pdf) and the header file `drivers/led/issi/is31fl3737.h`. The `driver` is the index of the driver you defined in your `config.h` (Only `0`, `1` for now).
Where `X_Y` is the location of the LED in the matrix defined by [the datasheet](https://www.issi.com/WW/pdf/31FL3737.pdf) and the header file `drivers/led/issi/is31fl3737.h`. The `driver` is the index of the driver you defined in your `config.h` (Only `0`, `1`, `2`, or `3` for now).

---
### IS31FLCOMMON :id=is31flcommon
Expand Down
18 changes: 18 additions & 0 deletions quantum/rgb_matrix/rgb_matrix_drivers.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ static void init(void) {
IS31FL3737_init(DRIVER_ADDR_1);
# if defined(DRIVER_ADDR_2)
IS31FL3737_init(DRIVER_ADDR_2);
# if defined(DRIVER_ADDR_3)
IS31FL3737_init(DRIVER_ADDR_3);
# if defined(DRIVER_ADDR_4)
IS31FL3737_init(DRIVER_ADDR_4);
# endif
# endif
# endif

# elif defined(IS31FL3741)
Expand Down Expand Up @@ -154,6 +160,12 @@ static void init(void) {
IS31FL3737_update_led_control_registers(DRIVER_ADDR_1, 0);
# if defined(DRIVER_ADDR_2)
IS31FL3737_update_led_control_registers(DRIVER_ADDR_2, 1);
# if defined(DRIVER_ADDR_3)
IS31FL3737_update_led_control_registers(DRIVER_ADDR_3, 2);
# if defined(DRIVER_ADDR_4)
IS31FL3737_update_led_control_registers(DRIVER_ADDR_4, 3);
# endif
# endif
# endif

# elif defined(IS31FL3741)
Expand Down Expand Up @@ -235,6 +247,12 @@ static void flush(void) {
IS31FL3737_update_pwm_buffers(DRIVER_ADDR_1, 0);
# if defined(DRIVER_ADDR_2)
IS31FL3737_update_pwm_buffers(DRIVER_ADDR_2, 1);
# if defined(DRIVER_ADDR_3)
IS31FL3737_update_pwm_buffers(DRIVER_ADDR_3, 2);
# if defined(DRIVER_ADDR_4)
IS31FL3737_update_pwm_buffers(DRIVER_ADDR_4, 3);
# endif
# endif
# endif
}

Expand Down