summaryrefslogtreecommitdiff
path: root/quantum/led_matrix/led_matrix_drivers.c
diff options
context:
space:
mode:
authorMasterSpoon <84671859+MasterSpoon@users.noreply.github.com>2022-02-07 03:04:43 +1000
committerGitHub <noreply@github.com>2022-02-06 09:04:43 -0800
commit0452ad94791c99572c88af3cd5489ef3c0f9970f (patch)
treee00d05e9bbeea15f750514444645348113ac428c /quantum/led_matrix/led_matrix_drivers.c
parente036c19d063c543090d01ea841ac343a48276f6d (diff)
Add RGB matrix & LED Matrix support for IS31FL3742A, IS31FL3743A, IS31FL3745, IS31FL3746A (#14989)
Co-authored-by: Xelus22 <17491233+Xelus22@users.noreply.github.com>
Diffstat (limited to 'quantum/led_matrix/led_matrix_drivers.c')
-rw-r--r--quantum/led_matrix/led_matrix_drivers.c52
1 files changed, 51 insertions, 1 deletions
diff --git a/quantum/led_matrix/led_matrix_drivers.c b/quantum/led_matrix/led_matrix_drivers.c
index 2157619a0b..847ca1c310 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(IS31FL3731) || defined(IS31FL3733)
+#if defined(IS31FL3731) || defined(IS31FL3733) || defined(IS31FLCOMMON)
# include "i2c_master.h"
static void init(void) {
@@ -66,6 +66,18 @@ static void init(void) {
# endif
# endif
# endif
+
+# elif defined(IS31FLCOMMON)
+ IS31FL_common_init(DRIVER_ADDR_1, ISSI_SSR_1);
+# if defined(LED_DRIVER_ADDR_2)
+ IS31FL_common_init(DRIVER_ADDR_2, ISSI_SSR_2);
+# if defined(LED_DRIVER_ADDR_3)
+ IS31FL_common_init(DRIVER_ADDR_3, ISSI_SSR_3);
+# if defined(LED_DRIVER_ADDR_4)
+ IS31FL_common_init(DRIVER_ADDR_4, ISSI_SSR_4);
+# endif
+# endif
+# endif
# endif
for (int index = 0; index < DRIVER_LED_TOTAL; index++) {
@@ -73,6 +85,8 @@ static void init(void) {
IS31FL3731_set_led_control_register(index, true);
# elif defined(IS31FL3733)
IS31FL3733_set_led_control_register(index, true);
+# elif defined(IS31FLCOMMON)
+ IS31FL_simple_set_scaling_buffer(index, true);
# endif
}
@@ -100,6 +114,21 @@ static void init(void) {
# endif
# endif
# endif
+
+# elif defined(IS31FLCOMMON)
+# ifdef ISSI_MANUAL_SCALING
+ IS31FL_set_manual_scaling_buffer();
+# endif
+ IS31FL_common_update_scaling_register(DRIVER_ADDR_1, 0);
+# if defined(LED_DRIVER_ADDR_2)
+ IS31FL_common_update_scaling_register(DRIVER_ADDR_2, 1);
+# if defined(LED_DRIVER_ADDR_3)
+ IS31FL_common_update_scaling_register(DRIVER_ADDR_3, 2);
+# if defined(LED_DRIVER_ADDR_4)
+ IS31FL_common_update_scaling_register(DRIVER_ADDR_4, 3);
+# endif
+# endif
+# endif
# endif
}
@@ -144,5 +173,26 @@ const led_matrix_driver_t led_matrix_driver = {
.set_value = IS31FL3733_set_value,
.set_value_all = IS31FL3733_set_value_all,
};
+
+# elif defined(IS31FLCOMMON)
+static void flush(void) {
+ IS31FL_common_update_pwm_register(DRIVER_ADDR_1, 0);
+# if defined(LED_DRIVER_ADDR_2)
+ IS31FL_common_update_pwm_register(DRIVER_ADDR_2, 1);
+# if defined(LED_DRIVER_ADDR_3)
+ IS31FL_common_update_pwm_register(DRIVER_ADDR_3, 2);
+# if defined(LED_DRIVER_ADDR_4)
+ IS31FL_common_update_pwm_register(DRIVER_ADDR_4, 3);
+# endif
+# endif
+# endif
+}
+
+const led_matrix_driver_t led_matrix_driver = {
+ .init = init,
+ .flush = flush,
+ .set_value = IS31FL_simple_set_brightness,
+ .set_value_all = IS31FL_simple_set_brigntness_all,
+};
# endif
#endif