diff options
author | Ryan <fauxpark@gmail.com> | 2023-10-03 01:09:20 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-03 01:09:20 +1100 |
commit | bd5860de4ed50ee306cee2ef54c7ff4f751a6168 (patch) | |
tree | b64ac52a33a54fe8e1e60541d4d2fe4255d2ec84 /quantum/led_matrix | |
parent | 6e3f770d0d26230381a57b43843c074508a850e8 (diff) |
is31fl3737/3741: add LED Matrix support (#22163)
Diffstat (limited to 'quantum/led_matrix')
-rw-r--r-- | quantum/led_matrix/led_matrix.h | 6 | ||||
-rw-r--r-- | quantum/led_matrix/led_matrix_drivers.c | 96 |
2 files changed, 101 insertions, 1 deletions
diff --git a/quantum/led_matrix/led_matrix.h b/quantum/led_matrix/led_matrix.h index 316585b1fe..47803d2423 100644 --- a/quantum/led_matrix/led_matrix.h +++ b/quantum/led_matrix/led_matrix.h @@ -36,6 +36,12 @@ #ifdef LED_MATRIX_IS31FL3736 # include "is31fl3736-simple.h" #endif +#ifdef LED_MATRIX_IS31FL3737 +# include "is31fl3737-simple.h" +#endif +#ifdef LED_MATRIX_IS31FL3741 +# include "is31fl3741-simple.h" +#endif #if defined(IS31FLCOMMON) # include "is31flcommon.h" #endif diff --git a/quantum/led_matrix/led_matrix_drivers.c b/quantum/led_matrix/led_matrix_drivers.c index 27c53a223a..771ce820af 100644 --- a/quantum/led_matrix/led_matrix_drivers.c +++ b/quantum/led_matrix/led_matrix_drivers.c @@ -25,7 +25,7 @@ * in their own files. */ -#if defined(LED_MATRIX_IS31FL3218) || defined(LED_MATRIX_IS31FL3731) || defined(LED_MATRIX_IS31FL3733) || defined(LED_MATRIX_IS31FL3736) || defined(IS31FLCOMMON) || defined(LED_MATRIX_CKLED2001) +#if defined(LED_MATRIX_IS31FL3218) || defined(LED_MATRIX_IS31FL3731) || defined(LED_MATRIX_IS31FL3733) || defined(LED_MATRIX_IS31FL3736) || defined(LED_MATRIX_IS31FL3737) || defined(LED_MATRIX_IS31FL3741) || defined(IS31FLCOMMON) || defined(LED_MATRIX_CKLED2001) # include "i2c_master.h" static void init(void) { @@ -82,6 +82,30 @@ static void init(void) { # endif # endif +# elif defined(LED_MATRIX_IS31FL3737) + is31fl3737_init(LED_DRIVER_ADDR_1); +# if defined(LED_DRIVER_ADDR_2) + is31fl3737_init(LED_DRIVER_ADDR_2); +# if defined(LED_DRIVER_ADDR_3) + is31fl3737_init(LED_DRIVER_ADDR_3); +# if defined(LED_DRIVER_ADDR_4) + is31fl3737_init(LED_DRIVER_ADDR_4); +# endif +# endif +# endif + +# elif defined(LED_MATRIX_IS31FL3741) + is31fl3741_init(LED_DRIVER_ADDR_1); +# if defined(LED_DRIVER_ADDR_2) + is31fl3741_init(LED_DRIVER_ADDR_2); +# if defined(LED_DRIVER_ADDR_3) + is31fl3741_init(LED_DRIVER_ADDR_3); +# if defined(LED_DRIVER_ADDR_4) + is31fl3741_init(LED_DRIVER_ADDR_4); +# endif +# endif +# endif + # elif defined(IS31FLCOMMON) IS31FL_common_init(DRIVER_ADDR_1, ISSI_SSR_1); # if defined(LED_DRIVER_ADDR_2) @@ -120,6 +144,10 @@ static void init(void) { is31fl3733_set_led_control_register(index, true); # elif defined(LED_MATRIX_IS31FL3736) is31fl3736_set_led_control_register(index, true); +# elif defined(LED_MATRIX_IS31FL3737) + is31fl3737_set_led_control_register(index, true); +# elif defined(LED_MATRIX_IS31FL3741) + is31fl3741_set_led_control_register(index, true); # elif defined(IS31FLCOMMON) IS31FL_simple_set_scaling_buffer(index, true); # elif defined(LED_MATRIX_CKLED2001) @@ -167,6 +195,30 @@ static void init(void) { # endif # endif +# elif defined(LED_MATRIX_IS31FL3737) + is31fl3737_update_led_control_registers(LED_DRIVER_ADDR_1, 0); +# if defined(LED_DRIVER_ADDR_2) + is31fl3737_update_led_control_registers(LED_DRIVER_ADDR_2, 1); +# if defined(LED_DRIVER_ADDR_3) + is31fl3737_update_led_control_registers(LED_DRIVER_ADDR_3, 2); +# if defined(LED_DRIVER_ADDR_4) + is31fl3737_update_led_control_registers(LED_DRIVER_ADDR_4, 3); +# endif +# endif +# endif + +# elif defined(LED_MATRIX_IS31FL3741) + is31fl3741_update_led_control_registers(LED_DRIVER_ADDR_1, 0); +# if defined(LED_DRIVER_ADDR_2) + is31fl3741_update_led_control_registers(LED_DRIVER_ADDR_2, 1); +# if defined(LED_DRIVER_ADDR_3) + is31fl3741_update_led_control_registers(LED_DRIVER_ADDR_3, 2); +# if defined(LED_DRIVER_ADDR_4) + is31fl3741_update_led_control_registers(LED_DRIVER_ADDR_4, 3); +# endif +# endif +# endif + # elif defined(IS31FLCOMMON) # ifdef ISSI_MANUAL_SCALING IS31FL_set_manual_scaling_buffer(); @@ -270,6 +322,48 @@ const led_matrix_driver_t led_matrix_driver = { .set_value_all = is31fl3736_set_value_all, }; +# elif defined(LED_MATRIX_IS31FL3737) +static void flush(void) { + is31fl3737_update_pwm_buffers(LED_DRIVER_ADDR_1, 0); +# if defined(LED_DRIVER_ADDR_2) + is31fl3737_update_pwm_buffers(LED_DRIVER_ADDR_2, 1); +# if defined(LED_DRIVER_ADDR_3) + is31fl3737_update_pwm_buffers(LED_DRIVER_ADDR_3, 2); +# if defined(LED_DRIVER_ADDR_4) + is31fl3737_update_pwm_buffers(LED_DRIVER_ADDR_4, 3); +# endif +# endif +# endif +} + +const led_matrix_driver_t led_matrix_driver = { + .init = init, + .flush = flush, + .set_value = is31fl3737_set_value, + .set_value_all = is31fl3737_set_value_all, +}; + +# elif defined(LED_MATRIX_IS31FL3741) +static void flush(void) { + is31fl3741_update_pwm_buffers(LED_DRIVER_ADDR_1, 0); +# if defined(LED_DRIVER_ADDR_2) + is31fl3741_update_pwm_buffers(LED_DRIVER_ADDR_2, 1); +# if defined(LED_DRIVER_ADDR_3) + is31fl3741_update_pwm_buffers(LED_DRIVER_ADDR_3, 2); +# if defined(LED_DRIVER_ADDR_4) + is31fl3741_update_pwm_buffers(LED_DRIVER_ADDR_4, 3); +# endif +# endif +# endif +} + +const led_matrix_driver_t led_matrix_driver = { + .init = init, + .flush = flush, + .set_value = is31fl3741_set_value, + .set_value_all = is31fl3741_set_value_all, +}; + # elif defined(IS31FLCOMMON) static void flush(void) { IS31FL_common_update_pwm_register(DRIVER_ADDR_1, 0); |