From f97420e59a0e030a4a5c1225b130c9ccca2c1cb1 Mon Sep 17 00:00:00 2001 From: donicrosby Date: Thu, 2 Sep 2021 17:58:45 -0400 Subject: [PATCH 1/4] Initial work for de-ghost enable --- docs/feature_rgb_matrix.md | 2 ++ drivers/led/issi/is31fl3733.c | 12 ++++++++++++ drivers/led/issi/is31fl3733.h | 9 +++++++++ 3 files changed, 23 insertions(+) diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index 42a57aec19c4..04dfbd03b8c5 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md @@ -21,6 +21,8 @@ You can use between 1 and 4 IS31FL3731 IC's. Do not specify `DRIVER_ADDR_` de |----------|-------------|---------| | `ISSI_TIMEOUT` | (Optional) How long to wait for i2c messages, in milliseconds | 100 | | `ISSI_PERSISTENCE` | (Optional) Retry failed messages this many times | 0 | +| `ISSI_SWPULLUP` | (Optional) Set the value of the SWx lines built-in de-ghosting resistors | PUR_0R (Disabled) | +| `ISSI_CSPULLUP` | (Optional) Set the value of the CSx lines built-in de-ghosting resistors | PUR_0R (Disabled) | | `DRIVER_COUNT` | (Required) How many RGB driver IC's are present | | | `DRIVER_LED_TOTAL` | (Required) How many RGB lights are present across all drivers | | | `DRIVER_ADDR_1` | (Required) Address for the first RGB driver | | diff --git a/drivers/led/issi/is31fl3733.c b/drivers/led/issi/is31fl3733.c index d99e5339c912..4e06d3bbe6d1 100644 --- a/drivers/led/issi/is31fl3733.c +++ b/drivers/led/issi/is31fl3733.c @@ -56,6 +56,14 @@ # define ISSI_PERSISTENCE 0 #endif +#ifndef ISSI_SWPULLUP +# define ISSI_SWPULLUP PUR_0R +#endif + +#ifndef ISSI_CSPULLUP +# define ISSI_CSPULLUP PUR_0R +#endif + // Transfer buffer for TWITransmitData() uint8_t g_twi_transfer_buffer[20]; @@ -154,6 +162,10 @@ void IS31FL3733_init(uint8_t addr, uint8_t sync) { // Select PG3 IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_FUNCTION); + // Set de-ghost pull-up resistors (SWx) + IS31FL3733_write_register(addr, ISSI_REG_SWPULLUP, ISSI_SWPULLUP); + // Set de-ghost pull-down resistors (CSx) + IS31FL3733_write_register(addr, ISSI_REG_CSPULLUP, ISSI_CSPULLUP); // Set global current to maximum. IS31FL3733_write_register(addr, ISSI_REG_GLOBALCURRENT, 0xFF); // Disable software shutdown. diff --git a/drivers/led/issi/is31fl3733.h b/drivers/led/issi/is31fl3733.h index 64fd38eb191f..ea4c243838b0 100644 --- a/drivers/led/issi/is31fl3733.h +++ b/drivers/led/issi/is31fl3733.h @@ -47,6 +47,15 @@ void IS31FL3733_set_led_control_register(uint8_t index, bool red, bool green, bo void IS31FL3733_update_pwm_buffers(uint8_t addr, uint8_t index); void IS31FL3733_update_led_control_registers(uint8_t addr, uint8_t index); +#define PUR_0R 0x00 // No PUR resistor +#define PUR_05KR 0x01 // 0.5k Ohm resistor in t_NOL +#define PUR_05KR 0x02 // 0.5k Ohm resistor in t_NOL +#define PUR_3KR 0x03 // 3.0k Ohm resistor on all the time +#define PUR_4KR 0x04 // 4.0k Ohm resistor on all the time +#define PUR_8KR 0x05 // 8.0k Ohm resistor on all the time +#define PUR_16KR 0x06 // 16k Ohm resistor on all the time +#define PUR_32KR 0x07 // 32k Ohm resistor in t_NOL + #define A_1 0x00 #define A_2 0x01 #define A_3 0x02 From c0531dcf5e4d6ade3a1fbf263b024d0261c42ea1 Mon Sep 17 00:00:00 2001 From: donicrosby Date: Thu, 2 Sep 2021 18:04:03 -0400 Subject: [PATCH 2/4] Dumb mistake with the redefine --- drivers/led/issi/is31fl3733.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/led/issi/is31fl3733.h b/drivers/led/issi/is31fl3733.h index ea4c243838b0..f1e27bb08b39 100644 --- a/drivers/led/issi/is31fl3733.h +++ b/drivers/led/issi/is31fl3733.h @@ -48,7 +48,6 @@ void IS31FL3733_update_pwm_buffers(uint8_t addr, uint8_t index); void IS31FL3733_update_led_control_registers(uint8_t addr, uint8_t index); #define PUR_0R 0x00 // No PUR resistor -#define PUR_05KR 0x01 // 0.5k Ohm resistor in t_NOL #define PUR_05KR 0x02 // 0.5k Ohm resistor in t_NOL #define PUR_3KR 0x03 // 3.0k Ohm resistor on all the time #define PUR_4KR 0x04 // 4.0k Ohm resistor on all the time From 4f40eca358a10718e2d8a02fcca7b1d52537ac66 Mon Sep 17 00:00:00 2001 From: donicrosby Date: Thu, 2 Sep 2021 18:45:13 -0400 Subject: [PATCH 3/4] Added Copywrite stuff on source files --- drivers/led/issi/is31fl3733.c | 1 + drivers/led/issi/is31fl3733.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/led/issi/is31fl3733.c b/drivers/led/issi/is31fl3733.c index 4e06d3bbe6d1..025266761ed0 100644 --- a/drivers/led/issi/is31fl3733.c +++ b/drivers/led/issi/is31fl3733.c @@ -1,6 +1,7 @@ /* Copyright 2017 Jason Williams * Copyright 2018 Jack Humbert * Copyright 2018 Yiancar + * Copyright 2021 Doni Crosby * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/drivers/led/issi/is31fl3733.h b/drivers/led/issi/is31fl3733.h index f1e27bb08b39..0a2b57626c72 100644 --- a/drivers/led/issi/is31fl3733.h +++ b/drivers/led/issi/is31fl3733.h @@ -1,6 +1,7 @@ /* Copyright 2017 Jason Williams * Copyright 2018 Jack Humbert * Copyright 2018 Yiancar + * Copyright 2021 Doni Crosby * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From 0e9e0e056799b4cfbcf820ed0e76989bfd9cbc34 Mon Sep 17 00:00:00 2001 From: donicrosby Date: Thu, 2 Sep 2021 19:16:20 -0400 Subject: [PATCH 4/4] Fixed whitespace errors --- drivers/led/issi/is31fl3733.c | 6 +++--- drivers/led/issi/is31fl3733.h | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/led/issi/is31fl3733.c b/drivers/led/issi/is31fl3733.c index 025266761ed0..d129c3d83b53 100644 --- a/drivers/led/issi/is31fl3733.c +++ b/drivers/led/issi/is31fl3733.c @@ -58,11 +58,11 @@ #endif #ifndef ISSI_SWPULLUP -# define ISSI_SWPULLUP PUR_0R +# define ISSI_SWPULLUP PUR_0R #endif #ifndef ISSI_CSPULLUP -# define ISSI_CSPULLUP PUR_0R +# define ISSI_CSPULLUP PUR_0R #endif // Transfer buffer for TWITransmitData() @@ -166,7 +166,7 @@ void IS31FL3733_init(uint8_t addr, uint8_t sync) { // Set de-ghost pull-up resistors (SWx) IS31FL3733_write_register(addr, ISSI_REG_SWPULLUP, ISSI_SWPULLUP); // Set de-ghost pull-down resistors (CSx) - IS31FL3733_write_register(addr, ISSI_REG_CSPULLUP, ISSI_CSPULLUP); + IS31FL3733_write_register(addr, ISSI_REG_CSPULLUP, ISSI_CSPULLUP); // Set global current to maximum. IS31FL3733_write_register(addr, ISSI_REG_GLOBALCURRENT, 0xFF); // Disable software shutdown. diff --git a/drivers/led/issi/is31fl3733.h b/drivers/led/issi/is31fl3733.h index 0a2b57626c72..daa226b41a11 100644 --- a/drivers/led/issi/is31fl3733.h +++ b/drivers/led/issi/is31fl3733.h @@ -48,13 +48,13 @@ void IS31FL3733_set_led_control_register(uint8_t index, bool red, bool green, bo void IS31FL3733_update_pwm_buffers(uint8_t addr, uint8_t index); void IS31FL3733_update_led_control_registers(uint8_t addr, uint8_t index); -#define PUR_0R 0x00 // No PUR resistor -#define PUR_05KR 0x02 // 0.5k Ohm resistor in t_NOL -#define PUR_3KR 0x03 // 3.0k Ohm resistor on all the time -#define PUR_4KR 0x04 // 4.0k Ohm resistor on all the time -#define PUR_8KR 0x05 // 8.0k Ohm resistor on all the time -#define PUR_16KR 0x06 // 16k Ohm resistor on all the time -#define PUR_32KR 0x07 // 32k Ohm resistor in t_NOL +#define PUR_0R 0x00 // No PUR resistor +#define PUR_05KR 0x02 // 0.5k Ohm resistor in t_NOL +#define PUR_3KR 0x03 // 3.0k Ohm resistor on all the time +#define PUR_4KR 0x04 // 4.0k Ohm resistor on all the time +#define PUR_8KR 0x05 // 8.0k Ohm resistor on all the time +#define PUR_16KR 0x06 // 16k Ohm resistor on all the time +#define PUR_32KR 0x07 // 32k Ohm resistor in t_NOL #define A_1 0x00 #define A_2 0x01