summaryrefslogtreecommitdiff
path: root/keyboards/input_club
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2023-09-19 19:31:54 +1000
committerGitHub <noreply@github.com>2023-09-19 19:31:54 +1000
commit8f221052897754870e5c08a2de92c24d20cd307e (patch)
treefe853aa394ae9d07f593446ce87a01b334f3bbea /keyboards/input_club
parent74360d0a01d58baf68109f6380144c7f3c69ef91 (diff)
Add and use I2C address defines for ISSI LED drivers (#22008)
Diffstat (limited to 'keyboards/input_club')
-rw-r--r--keyboards/input_club/ergodox_infinity/config.h2
-rw-r--r--keyboards/input_club/k_type/config.h4
-rw-r--r--keyboards/input_club/k_type/is31fl3733-dual.c12
-rw-r--r--keyboards/input_club/k_type/is31fl3733-dual.h17
-rw-r--r--keyboards/input_club/whitefox/config.h2
5 files changed, 21 insertions, 16 deletions
diff --git a/keyboards/input_club/ergodox_infinity/config.h b/keyboards/input_club/ergodox_infinity/config.h
index 17baf0013e..7c35ccc784 100644
--- a/keyboards/input_club/ergodox_infinity/config.h
+++ b/keyboards/input_club/ergodox_infinity/config.h
@@ -43,7 +43,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define LED_BRIGHTNESS_HI 255
/* LED matrix driver */
-#define LED_DRIVER_ADDR_1 0x74
+#define LED_DRIVER_ADDR_1 IS31FL3731_I2C_ADDRESS_GND
#define IS31FL3731_DRIVER_COUNT 1
#define LED_MATRIX_LED_COUNT 76
#define LED_MATRIX_SPLIT { 38, 38 }
diff --git a/keyboards/input_club/k_type/config.h b/keyboards/input_club/k_type/config.h
index 5d4d515d77..b3365bd0af 100644
--- a/keyboards/input_club/k_type/config.h
+++ b/keyboards/input_club/k_type/config.h
@@ -103,8 +103,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# define I2C2_SCL_PAL_MODE PAL_MODE_ALTERNATIVE_2
# define I2C2_SDA_PAL_MODE PAL_MODE_ALTERNATIVE_2
-# define DRIVER_ADDR_1 0b1010000
-# define DRIVER_ADDR_2 0b1010000
+# define DRIVER_ADDR_1 IS31FL3733_I2C_ADDRESS_GND_GND
+# define DRIVER_ADDR_2 IS31FL3733_I2C_ADDRESS_GND_GND
# define IS31FL3733_DRIVER_COUNT 2
# define DRIVER_1_LED_TOTAL 64
# define DRIVER_2_LED_TOTAL 55
diff --git a/keyboards/input_club/k_type/is31fl3733-dual.c b/keyboards/input_club/k_type/is31fl3733-dual.c
index 2976f5aed4..851b56a37d 100644
--- a/keyboards/input_club/k_type/is31fl3733-dual.c
+++ b/keyboards/input_club/k_type/is31fl3733-dual.c
@@ -20,18 +20,6 @@
#include "i2c_master.h"
#include "wait.h"
-// This is a 7-bit address, that gets left-shifted and bit 0
-// set to 0 for write, 1 for read (as per I2C protocol)
-// The address will vary depending on your wiring:
-// 00 <-> GND
-// 01 <-> SCL
-// 10 <-> SDA
-// 11 <-> VCC
-// ADDR1 represents A1:A0 of the 7-bit address.
-// ADDR2 represents A3:A2 of the 7-bit address.
-// The result is: 0b101(ADDR2)(ADDR1)
-#define IS31FL3733_I2C_ADDRESS_DEFAULT 0x50
-
#define IS31FL3733_COMMANDREGISTER 0xFD
#define IS31FL3733_COMMANDREGISTER_WRITELOCK 0xFE
#define IS31FL3733_INTERRUPTMASKREGISTER 0xF0
diff --git a/keyboards/input_club/k_type/is31fl3733-dual.h b/keyboards/input_club/k_type/is31fl3733-dual.h
index a5ef3ff008..796708f507 100644
--- a/keyboards/input_club/k_type/is31fl3733-dual.h
+++ b/keyboards/input_club/k_type/is31fl3733-dual.h
@@ -22,6 +22,23 @@
#include <stdbool.h>
#include "progmem.h"
+#define IS31FL3733_I2C_ADDRESS_GND_GND 0x50
+#define IS31FL3733_I2C_ADDRESS_GND_SCL 0x51
+#define IS31FL3733_I2C_ADDRESS_GND_SDA 0x52
+#define IS31FL3733_I2C_ADDRESS_GND_VCC 0x53
+#define IS31FL3733_I2C_ADDRESS_SCL_GND 0x54
+#define IS31FL3733_I2C_ADDRESS_SCL_SCL 0x55
+#define IS31FL3733_I2C_ADDRESS_SCL_SDA 0x56
+#define IS31FL3733_I2C_ADDRESS_SCL_VCC 0x57
+#define IS31FL3733_I2C_ADDRESS_SDA_GND 0x58
+#define IS31FL3733_I2C_ADDRESS_SDA_SCL 0x59
+#define IS31FL3733_I2C_ADDRESS_SDA_SDA 0x5A
+#define IS31FL3733_I2C_ADDRESS_SDA_VCC 0x5B
+#define IS31FL3733_I2C_ADDRESS_VCC_GND 0x5C
+#define IS31FL3733_I2C_ADDRESS_VCC_SCL 0x5D
+#define IS31FL3733_I2C_ADDRESS_VCC_SDA 0x5E
+#define IS31FL3733_I2C_ADDRESS_VCC_VCC 0x5F
+
typedef struct is31_led {
uint8_t driver : 2;
uint8_t r;
diff --git a/keyboards/input_club/whitefox/config.h b/keyboards/input_club/whitefox/config.h
index bf8d3d6c9c..aa8277d4ca 100644
--- a/keyboards/input_club/whitefox/config.h
+++ b/keyboards/input_club/whitefox/config.h
@@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define LED_BRIGHTNESS_HI 255
/* LED matrix driver */
-#define LED_DRIVER_ADDR_1 0x74
+#define LED_DRIVER_ADDR_1 IS31FL3731_I2C_ADDRESS_GND
#define IS31FL3731_DRIVER_COUNT 1
#define LED_MATRIX_LED_COUNT 71
#define LED_DISABLE_WHEN_USB_SUSPENDED