diff options
author | MelGeek <65591833+melgeek001365@users.noreply.github.com> | 2020-06-20 12:49:15 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-20 14:49:15 +1000 |
commit | d9eae3ef033d3adce7da1ba3d57cc9480659deb0 (patch) | |
tree | a3b7effb6d96554a464f7218ebbde9c42995550a /quantum/rgb_matrix_drivers.c | |
parent | 05e6cc265509af3286ab0e695839e311acc58b55 (diff) |
Support IS31FL3741 and IS31FL3741A. (#9201)
Diffstat (limited to 'quantum/rgb_matrix_drivers.c')
-rw-r--r-- | quantum/rgb_matrix_drivers.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/quantum/rgb_matrix_drivers.c b/quantum/rgb_matrix_drivers.c index ea41b0d396..204b6c551f 100644 --- a/quantum/rgb_matrix_drivers.c +++ b/quantum/rgb_matrix_drivers.c @@ -23,7 +23,7 @@ * be here if shared between boards. */ -#if defined(IS31FL3731) || defined(IS31FL3733) || defined(IS31FL3737) +#if defined(IS31FL3731) || defined(IS31FL3733) || defined(IS31FL3737) || defined(IS31FL3741) # include "i2c_master.h" @@ -34,8 +34,10 @@ static void init(void) { IS31FL3731_init(DRIVER_ADDR_2); # elif defined(IS31FL3733) IS31FL3733_init(DRIVER_ADDR_1, 0); -# else +# elif defined(IS31FL3737) IS31FL3737_init(DRIVER_ADDR_1); +# else + IS31FL3741_init(DRIVER_ADDR_1); # endif for (int index = 0; index < DRIVER_LED_TOTAL; index++) { bool enabled = true; @@ -44,8 +46,10 @@ static void init(void) { IS31FL3731_set_led_control_register(index, enabled, enabled, enabled); # elif defined(IS31FL3733) IS31FL3733_set_led_control_register(index, enabled, enabled, enabled); -# else +# elif defined(IS31FL3737) IS31FL3737_set_led_control_register(index, enabled, enabled, enabled); +# else + IS31FL3741_set_led_control_register(index, enabled, enabled, enabled); # endif } // This actually updates the LED drivers @@ -55,8 +59,10 @@ static void init(void) { # elif defined(IS31FL3733) IS31FL3733_update_led_control_registers(DRIVER_ADDR_1, 0); IS31FL3733_update_led_control_registers(DRIVER_ADDR_2, 1); -# else +# elif defined(IS31FL3737) IS31FL3737_update_led_control_registers(DRIVER_ADDR_1, DRIVER_ADDR_2); +# else + IS31FL3741_update_led_control_registers(DRIVER_ADDR_1, 0); # endif } @@ -84,7 +90,7 @@ const rgb_matrix_driver_t rgb_matrix_driver = { .set_color = IS31FL3733_set_color, .set_color_all = IS31FL3733_set_color_all, }; -# else +# elif defined(IS31FL3737) static void flush(void) { IS31FL3737_update_pwm_buffers(DRIVER_ADDR_1, DRIVER_ADDR_2); } const rgb_matrix_driver_t rgb_matrix_driver = { @@ -93,6 +99,17 @@ const rgb_matrix_driver_t rgb_matrix_driver = { .set_color = IS31FL3737_set_color, .set_color_all = IS31FL3737_set_color_all, }; +# else +static void flush(void) { + IS31FL3741_update_pwm_buffers(DRIVER_ADDR_1, DRIVER_ADDR_2); +} + +const rgb_matrix_driver_t rgb_matrix_driver = { + .init = init, + .flush = flush, + .set_color = IS31FL3741_set_color, + .set_color_all = IS31FL3741_set_color_all, +}; # endif #elif defined(WS2812) |