summaryrefslogtreecommitdiff
path: root/quantum
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2023-10-21 21:41:59 +1000
committerGitHub <noreply@github.com>2023-10-21 21:41:59 +1000
commitd56ee70c524b4fc4d1638e5e8c4bdeb89e752993 (patch)
tree68f890de77cbf2750462def33a3ac5d3de11a8c2 /quantum
parent3f1b3a512532b8e6ebd2f73df5222ae146b1f490 (diff)
Rename `DRIVER_ADDR_n` defines (#22200)
Co-authored-by: Nick Brassel <nick@tzarc.org>
Diffstat (limited to 'quantum')
-rw-r--r--quantum/led_matrix/led_matrix_drivers.c269
-rw-r--r--quantum/rgb_matrix/rgb_matrix_drivers.c287
2 files changed, 275 insertions, 281 deletions
diff --git a/quantum/led_matrix/led_matrix_drivers.c b/quantum/led_matrix/led_matrix_drivers.c
index f52870aea5..42594d2e16 100644
--- a/quantum/led_matrix/led_matrix_drivers.c
+++ b/quantum/led_matrix/led_matrix_drivers.c
@@ -35,73 +35,73 @@ static void init(void) {
is31fl3218_init();
# elif defined(LED_MATRIX_IS31FL3731)
- is31fl3731_init(LED_DRIVER_ADDR_1);
-# if defined(LED_DRIVER_ADDR_2)
- is31fl3731_init(LED_DRIVER_ADDR_2);
-# if defined(LED_DRIVER_ADDR_3)
- is31fl3731_init(LED_DRIVER_ADDR_3);
-# if defined(LED_DRIVER_ADDR_4)
- is31fl3731_init(LED_DRIVER_ADDR_4);
+ is31fl3731_init(IS31FL3731_I2C_ADDRESS_1);
+# if defined(IS31FL3731_I2C_ADDRESS_2)
+ is31fl3731_init(IS31FL3731_I2C_ADDRESS_2);
+# if defined(IS31FL3731_I2C_ADDRESS_3)
+ is31fl3731_init(IS31FL3731_I2C_ADDRESS_3);
+# if defined(IS31FL3731_I2C_ADDRESS_4)
+ is31fl3731_init(IS31FL3731_I2C_ADDRESS_4);
# endif
# endif
# endif
# elif defined(LED_MATRIX_IS31FL3733)
-# if !defined(LED_DRIVER_SYNC_1)
-# define LED_DRIVER_SYNC_1 0
+# if !defined(IS31FL3733_SYNC_1)
+# define IS31FL3733_SYNC_1 0
# endif
- is31fl3733_init(LED_DRIVER_ADDR_1, LED_DRIVER_SYNC_1);
-# if defined(LED_DRIVER_ADDR_2)
-# if !defined(LED_DRIVER_SYNC_2)
-# define LED_DRIVER_SYNC_2 0
+ is31fl3733_init(IS31FL3733_I2C_ADDRESS_1, IS31FL3733_SYNC_1);
+# if defined(IS31FL3733_I2C_ADDRESS_2)
+# if !defined(IS31FL3733_SYNC_2)
+# define IS31FL3733_SYNC_2 0
# endif
- is31fl3733_init(LED_DRIVER_ADDR_2, LED_DRIVER_SYNC_2);
-# if defined(LED_DRIVER_ADDR_3)
-# if !defined(LED_DRIVER_SYNC_3)
-# define LED_DRIVER_SYNC_3 0
+ is31fl3733_init(IS31FL3733_I2C_ADDRESS_2, IS31FL3733_SYNC_2);
+# if defined(IS31FL3733_I2C_ADDRESS_3)
+# if !defined(IS31FL3733_SYNC_3)
+# define IS31FL3733_SYNC_3 0
# endif
- is31fl3733_init(LED_DRIVER_ADDR_3, LED_DRIVER_SYNC_3);
-# if defined(LED_DRIVER_ADDR_4)
-# if !defined(LED_DRIVER_SYNC_4)
-# define LED_DRIVER_SYNC_4 0
+ is31fl3733_init(IS31FL3733_I2C_ADDRESS_3, IS31FL3733_SYNC_3);
+# if defined(IS31FL3733_I2C_ADDRESS_4)
+# if !defined(IS31FL3733_SYNC_4)
+# define IS31FL3733_SYNC_4 0
# endif
- is31fl3733_init(LED_DRIVER_ADDR_4, LED_DRIVER_SYNC_4);
+ is31fl3733_init(IS31FL3733_I2C_ADDRESS_4, IS31FL3733_SYNC_4);
# endif
# endif
# endif
# elif defined(LED_MATRIX_IS31FL3736)
- is31fl3736_init(LED_DRIVER_ADDR_1);
-# if defined(LED_DRIVER_ADDR_2)
- is31fl3736_init(LED_DRIVER_ADDR_2);
-# if defined(LED_DRIVER_ADDR_3)
- is31fl3736_init(LED_DRIVER_ADDR_3);
-# if defined(LED_DRIVER_ADDR_4)
- is31fl3736_init(LED_DRIVER_ADDR_4);
+ is31fl3736_init(IS31FL3736_I2C_ADDRESS_1);
+# if defined(IS31FL3736_I2C_ADDRESS_2)
+ is31fl3736_init(IS31FL3736_I2C_ADDRESS_2);
+# if defined(IS31FL3736_I2C_ADDRESS_3)
+ is31fl3736_init(IS31FL3736_I2C_ADDRESS_3);
+# if defined(IS31FL3736_I2C_ADDRESS_4)
+ is31fl3736_init(IS31FL3736_I2C_ADDRESS_4);
# endif
# 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);
+ is31fl3737_init(IS31FL3737_I2C_ADDRESS_1);
+# if defined(IS31FL3737_I2C_ADDRESS_2)
+ is31fl3737_init(IS31FL3737_I2C_ADDRESS_2);
+# if defined(IS31FL3737_I2C_ADDRESS_3)
+ is31fl3737_init(IS31FL3737_I2C_ADDRESS_3);
+# if defined(IS31FL3737_I2C_ADDRESS_4)
+ is31fl3737_init(IS31FL3737_I2C_ADDRESS_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);
+ is31fl3741_init(IS31FL3741_I2C_ADDRESS_1);
+# if defined(IS31FL3741_I2C_ADDRESS_2)
+ is31fl3741_init(IS31FL3741_I2C_ADDRESS_2);
+# if defined(IS31FL3741_I2C_ADDRESS_3)
+ is31fl3741_init(IS31FL3741_I2C_ADDRESS_3);
+# if defined(IS31FL3741_I2C_ADDRESS_4)
+ is31fl3741_init(IS31FL3741_I2C_ADDRESS_4);
# endif
# endif
# endif
@@ -123,13 +123,13 @@ static void init(void) {
writePinHigh(LED_DRIVER_SHUTDOWN_PIN);
# endif
- snled27351_init(DRIVER_ADDR_1);
-# if defined(DRIVER_ADDR_2)
- snled27351_init(DRIVER_ADDR_2);
-# if defined(DRIVER_ADDR_3)
- snled27351_init(DRIVER_ADDR_3);
-# if defined(DRIVER_ADDR_4)
- snled27351_init(DRIVER_ADDR_4);
+ snled27351_init(SNLED27351_I2C_ADDRESS_1);
+# if defined(SNLED27351_I2C_ADDRESS_2)
+ snled27351_init(SNLED27351_I2C_ADDRESS_2);
+# if defined(SNLED27351_I2C_ADDRESS_3)
+ snled27351_init(SNLED27351_I2C_ADDRESS_3);
+# if defined(SNLED27351_I2C_ADDRESS_4)
+ snled27351_init(SNLED27351_I2C_ADDRESS_4);
# endif
# endif
# endif
@@ -160,61 +160,61 @@ static void init(void) {
is31fl3218_update_led_control_registers();
# elif defined(LED_MATRIX_IS31FL3731)
- is31fl3731_update_led_control_registers(LED_DRIVER_ADDR_1, 0);
-# if defined(LED_DRIVER_ADDR_2)
- is31fl3731_update_led_control_registers(LED_DRIVER_ADDR_2, 1);
-# if defined(LED_DRIVER_ADDR_3)
- is31fl3731_update_led_control_registers(LED_DRIVER_ADDR_3, 2);
-# if defined(LED_DRIVER_ADDR_4)
- is31fl3731_update_led_control_registers(LED_DRIVER_ADDR_4, 3);
+ is31fl3731_update_led_control_registers(IS31FL3731_I2C_ADDRESS_1, 0);
+# if defined(IS31FL3731_I2C_ADDRESS_2)
+ is31fl3731_update_led_control_registers(IS31FL3731_I2C_ADDRESS_2, 1);
+# if defined(IS31FL3731_I2C_ADDRESS_3)
+ is31fl3731_update_led_control_registers(IS31FL3731_I2C_ADDRESS_3, 2);
+# if defined(IS31FL3731_I2C_ADDRESS_4)
+ is31fl3731_update_led_control_registers(IS31FL3731_I2C_ADDRESS_4, 3);
# endif
# endif
# endif
# elif defined(LED_MATRIX_IS31FL3733)
- is31fl3733_update_led_control_registers(LED_DRIVER_ADDR_1, 0);
-# if defined(LED_DRIVER_ADDR_2)
- is31fl3733_update_led_control_registers(LED_DRIVER_ADDR_2, 1);
-# if defined(LED_DRIVER_ADDR_3)
- is31fl3733_update_led_control_registers(LED_DRIVER_ADDR_3, 2);
-# if defined(LED_DRIVER_ADDR_4)
- is31fl3733_update_led_control_registers(LED_DRIVER_ADDR_4, 3);
+ is31fl3733_update_led_control_registers(IS31FL3733_I2C_ADDRESS_1, 0);
+# if defined(IS31FL3733_I2C_ADDRESS_2)
+ is31fl3733_update_led_control_registers(IS31FL3733_I2C_ADDRESS_2, 1);
+# if defined(IS31FL3733_I2C_ADDRESS_3)
+ is31fl3733_update_led_control_registers(IS31FL3733_I2C_ADDRESS_3, 2);
+# if defined(IS31FL3733_I2C_ADDRESS_4)
+ is31fl3733_update_led_control_registers(IS31FL3733_I2C_ADDRESS_4, 3);
# endif
# endif
# endif
# elif defined(LED_MATRIX_IS31FL3736)
- is31fl3736_update_led_control_registers(LED_DRIVER_ADDR_1, 0);
-# if defined(LED_DRIVER_ADDR_2)
- is31fl3736_update_led_control_registers(LED_DRIVER_ADDR_2, 1);
-# if defined(LED_DRIVER_ADDR_3)
- is31fl3736_update_led_control_registers(LED_DRIVER_ADDR_3, 2);
-# if defined(LED_DRIVER_ADDR_4)
- is31fl3736_update_led_control_registers(LED_DRIVER_ADDR_4, 3);
+ is31fl3736_update_led_control_registers(IS31FL3736_I2C_ADDRESS_1, 0);
+# if defined(IS31FL3736_I2C_ADDRESS_2)
+ is31fl3736_update_led_control_registers(IS31FL3736_I2C_ADDRESS_2, 1);
+# if defined(IS31FL3736_I2C_ADDRESS_3)
+ is31fl3736_update_led_control_registers(IS31FL3736_I2C_ADDRESS_3, 2);
+# if defined(IS31FL3736_I2C_ADDRESS_4)
+ is31fl3736_update_led_control_registers(IS31FL3736_I2C_ADDRESS_4, 3);
# endif
# 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);
+ is31fl3737_update_led_control_registers(IS31FL3737_I2C_ADDRESS_1, 0);
+# if defined(IS31FL3737_I2C_ADDRESS_2)
+ is31fl3737_update_led_control_registers(IS31FL3737_I2C_ADDRESS_2, 1);
+# if defined(IS31FL3737_I2C_ADDRESS_3)
+ is31fl3737_update_led_control_registers(IS31FL3737_I2C_ADDRESS_3, 2);
+# if defined(IS31FL3737_I2C_ADDRESS_4)
+ is31fl3737_update_led_control_registers(IS31FL3737_I2C_ADDRESS_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);
+ is31fl3741_update_led_control_registers(IS31FL3741_I2C_ADDRESS_1, 0);
+# if defined(IS31FL3741_I2C_ADDRESS_2)
+ is31fl3741_update_led_control_registers(IS31FL3741_I2C_ADDRESS_2, 1);
+# if defined(IS31FL3741_I2C_ADDRESS_3)
+ is31fl3741_update_led_control_registers(IS31FL3741_I2C_ADDRESS_3, 2);
+# if defined(IS31FL3741_I2C_ADDRESS_4)
+ is31fl3741_update_led_control_registers(IS31FL3741_I2C_ADDRESS_4, 3);
# endif
# endif
# endif
@@ -233,14 +233,15 @@ static void init(void) {
# endif
# endif
# endif
+
# elif defined(LED_MATRIX_SNLED27351)
- snled27351_update_led_control_registers(DRIVER_ADDR_1, 0);
-# if defined(DRIVER_ADDR_2)
- snled27351_update_led_control_registers(DRIVER_ADDR_2, 1);
-# if defined(DRIVER_ADDR_3)
- snled27351_update_led_control_registers(DRIVER_ADDR_3, 2);
-# if defined(DRIVER_ADDR_4)
- snled27351_update_led_control_registers(DRIVER_ADDR_4, 3);
+ snled27351_update_led_control_registers(SNLED27351_I2C_ADDRESS_1, 0);
+# if defined(SNLED27351_I2C_ADDRESS_2)
+ snled27351_update_led_control_registers(SNLED27351_I2C_ADDRESS_2, 1);
+# if defined(SNLED27351_I2C_ADDRESS_3)
+ snled27351_update_led_control_registers(SNLED27351_I2C_ADDRESS_3, 2);
+# if defined(SNLED27351_I2C_ADDRESS_4)
+ snled27351_update_led_control_registers(SNLED27351_I2C_ADDRESS_4, 3);
# endif
# endif
# endif
@@ -261,13 +262,13 @@ const led_matrix_driver_t led_matrix_driver = {
# elif defined(LED_MATRIX_IS31FL3731)
static void flush(void) {
- is31fl3731_update_pwm_buffers(LED_DRIVER_ADDR_1, 0);
-# if defined(LED_DRIVER_ADDR_2)
- is31fl3731_update_pwm_buffers(LED_DRIVER_ADDR_2, 1);
-# if defined(LED_DRIVER_ADDR_3)
- is31fl3731_update_pwm_buffers(LED_DRIVER_ADDR_3, 2);
-# if defined(LED_DRIVER_ADDR_4)
- is31fl3731_update_pwm_buffers(LED_DRIVER_ADDR_4, 3);
+ is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_1, 0);
+# if defined(IS31FL3731_I2C_ADDRESS_2)
+ is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_2, 1);
+# if defined(IS31FL3731_I2C_ADDRESS_3)
+ is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_3, 2);
+# if defined(IS31FL3731_I2C_ADDRESS_4)
+ is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_4, 3);
# endif
# endif
# endif
@@ -282,13 +283,13 @@ const led_matrix_driver_t led_matrix_driver = {
# elif defined(LED_MATRIX_IS31FL3733)
static void flush(void) {
- is31fl3733_update_pwm_buffers(LED_DRIVER_ADDR_1, 0);
-# if defined(LED_DRIVER_ADDR_2)
- is31fl3733_update_pwm_buffers(LED_DRIVER_ADDR_2, 1);
-# if defined(LED_DRIVER_ADDR_3)
- is31fl3733_update_pwm_buffers(LED_DRIVER_ADDR_3, 2);
-# if defined(LED_DRIVER_ADDR_4)
- is31fl3733_update_pwm_buffers(LED_DRIVER_ADDR_4, 3);
+ is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_1, 0);
+# if defined(IS31FL3733_I2C_ADDRESS_2)
+ is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_2, 1);
+# if defined(IS31FL3733_I2C_ADDRESS_3)
+ is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_3, 2);
+# if defined(IS31FL3733_I2C_ADDRESS_4)
+ is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_4, 3);
# endif
# endif
# endif
@@ -303,13 +304,13 @@ const led_matrix_driver_t led_matrix_driver = {
# elif defined(LED_MATRIX_IS31FL3736)
static void flush(void) {
- is31fl3736_update_pwm_buffers(LED_DRIVER_ADDR_1, 0);
-# if defined(LED_DRIVER_ADDR_2)
- is31fl3736_update_pwm_buffers(LED_DRIVER_ADDR_2, 1);
-# if defined(LED_DRIVER_ADDR_3)
- is31fl3736_update_pwm_buffers(LED_DRIVER_ADDR_3, 2);
-# if defined(LED_DRIVER_ADDR_4)
- is31fl3736_update_pwm_buffers(LED_DRIVER_ADDR_4, 3);
+ is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_1, 0);
+# if defined(IS31FL3736_I2C_ADDRESS_2)
+ is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_2, 1);
+# if defined(IS31FL3736_I2C_ADDRESS_3)
+ is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_3, 2);
+# if defined(IS31FL3736_I2C_ADDRESS_4)
+ is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_4, 3);
# endif
# endif
# endif
@@ -324,13 +325,13 @@ const led_matrix_driver_t led_matrix_driver = {
# 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);
+ is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_1, 0);
+# if defined(IS31FL3737_I2C_ADDRESS_2)
+ is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_2, 1);
+# if defined(IS31FL3737_I2C_ADDRESS_3)
+ is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_3, 2);
+# if defined(IS31FL3737_I2C_ADDRESS_4)
+ is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_4, 3);
# endif
# endif
# endif
@@ -345,13 +346,13 @@ const led_matrix_driver_t led_matrix_driver = {
# 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);
+ is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_1, 0);
+# if defined(IS31FL3741_I2C_ADDRESS_2)
+ is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_2, 1);
+# if defined(IS31FL3741_I2C_ADDRESS_3)
+ is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_3, 2);
+# if defined(IS31FL3741_I2C_ADDRESS_4)
+ is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_4, 3);
# endif
# endif
# endif
@@ -386,13 +387,13 @@ const led_matrix_driver_t led_matrix_driver = {
};
# elif defined(LED_MATRIX_SNLED27351)
static void flush(void) {
- snled27351_update_pwm_buffers(DRIVER_ADDR_1, 0);
-# if defined(DRIVER_ADDR_2)
- snled27351_update_pwm_buffers(DRIVER_ADDR_2, 1);
-# if defined(DRIVER_ADDR_3)
- snled27351_update_pwm_buffers(DRIVER_ADDR_3, 2);
-# if defined(DRIVER_ADDR_4)
- snled27351_update_pwm_buffers(DRIVER_ADDR_4, 3);
+ snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_1, 0);
+# if defined(SNLED27351_I2C_ADDRESS_2)
+ snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_2, 1);
+# if defined(SNLED27351_I2C_ADDRESS_3)
+ snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_3, 2);
+# if defined(SNLED27351_I2C_ADDRESS_4)
+ snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_4, 3);
# endif
# endif
# endif
diff --git a/quantum/rgb_matrix/rgb_matrix_drivers.c b/quantum/rgb_matrix/rgb_matrix_drivers.c
index 06d82b9c69..555e750e50 100644
--- a/quantum/rgb_matrix/rgb_matrix_drivers.c
+++ b/quantum/rgb_matrix/rgb_matrix_drivers.c
@@ -27,13 +27,6 @@
#if defined(RGB_MATRIX_IS31FL3218) || defined(RGB_MATRIX_IS31FL3731) || defined(RGB_MATRIX_IS31FL3733) || defined(RGB_MATRIX_IS31FL3736) || defined(RGB_MATRIX_IS31FL3737) || defined(RGB_MATRIX_IS31FL3741) || defined(IS31FLCOMMON) || defined(RGB_MATRIX_SNLED27351)
# include "i2c_master.h"
-// TODO: Remove this at some later date
-# if defined(DRIVER_ADDR_1) && defined(DRIVER_ADDR_2)
-# if DRIVER_ADDR_1 == DRIVER_ADDR_2
-# error "Setting DRIVER_ADDR_2 == DRIVER_ADDR_1 is obsolete. If you are only using one ISSI driver, set DRIVER_COUNT to 1 and remove DRIVER_ADDR_2"
-# endif
-# endif
-
static void init(void) {
i2c_init();
@@ -41,73 +34,73 @@ static void init(void) {
is31fl3218_init();
# elif defined(RGB_MATRIX_IS31FL3731)
- is31fl3731_init(DRIVER_ADDR_1);
-# if defined(DRIVER_ADDR_2)
- is31fl3731_init(DRIVER_ADDR_2);
-# if defined(DRIVER_ADDR_3)
- is31fl3731_init(DRIVER_ADDR_3);
-# if defined(DRIVER_ADDR_4)
- is31fl3731_init(DRIVER_ADDR_4);
+ is31fl3731_init(IS31FL3731_I2C_ADDRESS_1);
+# if defined(IS31FL3731_I2C_ADDRESS_2)
+ is31fl3731_init(IS31FL3731_I2C_ADDRESS_2);
+# if defined(IS31FL3731_I2C_ADDRESS_3)
+ is31fl3731_init(IS31FL3731_I2C_ADDRESS_3);
+# if defined(IS31FL3731_I2C_ADDRESS_4)
+ is31fl3731_init(IS31FL3731_I2C_ADDRESS_4);
# endif
# endif
# endif
# elif defined(RGB_MATRIX_IS31FL3733)
-# if !defined(DRIVER_SYNC_1)
-# define DRIVER_SYNC_1 0
+# if !defined(IS31FL3733_SYNC_1)
+# define IS31FL3733_SYNC_1 0
# endif
- is31fl3733_init(DRIVER_ADDR_1, DRIVER_SYNC_1);
-# if defined(DRIVER_ADDR_2)
-# if !defined(DRIVER_SYNC_2)
-# define DRIVER_SYNC_2 0
+ is31fl3733_init(IS31FL3733_I2C_ADDRESS_1, IS31FL3733_SYNC_1);
+# if defined(IS31FL3733_I2C_ADDRESS_2)
+# if !defined(IS31FL3733_SYNC_2)
+# define IS31FL3733_SYNC_2 0
# endif
- is31fl3733_init(DRIVER_ADDR_2, DRIVER_SYNC_2);
-# if defined(DRIVER_ADDR_3)
-# if !defined(DRIVER_SYNC_3)
-# define DRIVER_SYNC_3 0
+ is31fl3733_init(IS31FL3733_I2C_ADDRESS_2, IS31FL3733_SYNC_2);
+# if defined(IS31FL3733_I2C_ADDRESS_3)
+# if !defined(IS31FL3733_SYNC_3)
+# define IS31FL3733_SYNC_3 0
# endif
- is31fl3733_init(DRIVER_ADDR_3, DRIVER_SYNC_3);
-# if defined(DRIVER_ADDR_4)
-# if !defined(DRIVER_SYNC_4)
-# define DRIVER_SYNC_4 0
+ is31fl3733_init(IS31FL3733_I2C_ADDRESS_3, IS31FL3733_SYNC_3);
+# if defined(IS31FL3733_I2C_ADDRESS_4)
+# if !defined(IS31FL3733_SYNC_4)
+# define IS31FL3733_SYNC_4 0
# endif
- is31fl3733_init(DRIVER_ADDR_4, DRIVER_SYNC_4);
+ is31fl3733_init(IS31FL3733_I2C_ADDRESS_4, IS31FL3733_SYNC_4);
# endif
# endif
# endif
# elif defined(RGB_MATRIX_IS31FL3736)
- is31fl3736_init(DRIVER_ADDR_1);
-# if defined(DRIVER_ADDR_2)
- is31fl3736_init(DRIVER_ADDR_2);
-# if defined(DRIVER_ADDR_3)
- is31fl3736_init(DRIVER_ADDR_3);
-# if defined(DRIVER_ADDR_4)
- is31fl3736_init(DRIVER_ADDR_4);
+ is31fl3736_init(IS31FL3736_I2C_ADDRESS_1);
+# if defined(IS31FL3736_I2C_ADDRESS_2)
+ is31fl3736_init(IS31FL3736_I2C_ADDRESS_2);
+# if defined(IS31FL3736_I2C_ADDRESS_3)
+ is31fl3736_init(IS31FL3736_I2C_ADDRESS_3);
+# if defined(IS31FL3736_I2C_ADDRESS_4)
+ is31fl3736_init(IS31FL3736_I2C_ADDRESS_4);
# endif
# endif
# endif
# elif defined(RGB_MATRIX_IS31FL3737)
- is31fl3737_init(DRIVER_ADDR_1);
-# if defined(DRIVER_ADDR_2)
- is31fl3737_init(DRIVER_ADDR_2);
-# if defined(DRIVER_ADDR_3)
- is31fl3737_init(DRIVER_ADDR_3);
-# if defined(DRIVER_ADDR_4)
- is31fl3737_init(DRIVER_ADDR_4);
+ is31fl3737_init(IS31FL3737_I2C_ADDRESS_1);
+# if defined(IS31FL3737_I2C_ADDRESS_2)
+ is31fl3737_init(IS31FL3737_I2C_ADDRESS_2);
+# if defined(IS31FL3737_I2C_ADDRESS_3)
+ is31fl3737_init(IS31FL3737_I2C_ADDRESS_3);
+# if defined(IS31FL3737_I2C_ADDRESS_4)
+ is31fl3737_init(IS31FL3737_I2C_ADDRESS_4);
# endif
# endif
# endif
# elif defined(RGB_MATRIX_IS31FL3741)
- is31fl3741_init(DRIVER_ADDR_1);
-# if defined(DRIVER_ADDR_2)
- is31fl3741_init(DRIVER_ADDR_2);
-# if defined(DRIVER_ADDR_3)
- is31fl3741_init(DRIVER_ADDR_3);
-# if defined(DRIVER_ADDR_4)
- is31fl3741_init(DRIVER_ADDR_4);
+ is31fl3741_init(IS31FL3741_I2C_ADDRESS_1);
+# if defined(IS31FL3741_I2C_ADDRESS_2)
+ is31fl3741_init(IS31FL3741_I2C_ADDRESS_2);
+# if defined(IS31FL3741_I2C_ADDRESS_3)
+ is31fl3741_init(IS31FL3741_I2C_ADDRESS_3);
+# if defined(IS31FL3741_I2C_ADDRESS_4)
+ is31fl3741_init(IS31FL3741_I2C_ADDRESS_4);
# endif
# endif
# endif
@@ -125,13 +118,13 @@ static void init(void) {
# endif
# elif defined(RGB_MATRIX_SNLED27351)
- snled27351_init(DRIVER_ADDR_1);
-# if defined(DRIVER_ADDR_2)
- snled27351_init(DRIVER_ADDR_2);
-# if defined(DRIVER_ADDR_3)
- snled27351_init(DRIVER_ADDR_3);
-# if defined(DRIVER_ADDR_4)
- snled27351_init(DRIVER_ADDR_4);
+ snled27351_init(SNLED27351_I2C_ADDRESS_1);
+# if defined(SNLED27351_I2C_ADDRESS_2)
+ snled27351_init(SNLED27351_I2C_ADDRESS_2);
+# if defined(SNLED27351_I2C_ADDRESS_3)
+ snled27351_init(SNLED27351_I2C_ADDRESS_3);
+# if defined(SNLED27351_I2C_ADDRESS_4)
+ snled27351_init(SNLED27351_I2C_ADDRESS_4);
# endif
# endif
# endif
@@ -165,61 +158,61 @@ static void init(void) {
is31fl3218_update_led_control_registers();
# elif defined(RGB_MATRIX_IS31FL3731)
- is31fl3731_update_led_control_registers(DRIVER_ADDR_1, 0);
-# if defined(DRIVER_ADDR_2)
- is31fl3731_update_led_control_registers(DRIVER_ADDR_2, 1);
-# if defined(DRIVER_ADDR_3)
- is31fl3731_update_led_control_registers(DRIVER_ADDR_3, 2);
-# if defined(DRIVER_ADDR_4)
- is31fl3731_update_led_control_registers(DRIVER_ADDR_4, 3);
+ is31fl3731_update_led_control_registers(IS31FL3731_I2C_ADDRESS_1, 0);
+# if defined(IS31FL3731_I2C_ADDRESS_2)
+ is31fl3731_update_led_control_registers(IS31FL3731_I2C_ADDRESS_2, 1);
+# if defined(IS31FL3731_I2C_ADDRESS_3)
+ is31fl3731_update_led_control_registers(IS31FL3731_I2C_ADDRESS_3, 2);
+# if defined(IS31FL3731_I2C_ADDRESS_4)
+ is31fl3731_update_led_control_registers(IS31FL3731_I2C_ADDRESS_4, 3);
# endif
# endif
# endif
# elif defined(RGB_MATRIX_IS31FL3733)
- is31fl3733_update_led_control_registers(DRIVER_ADDR_1, 0);
-# if defined(DRIVER_ADDR_2)
- is31fl3733_update_led_control_registers(DRIVER_ADDR_2, 1);
-# if defined(DRIVER_ADDR_3)
- is31fl3733_update_led_control_registers(DRIVER_ADDR_3, 2);
-# if defined(DRIVER_ADDR_4)
- is31fl3733_update_led_control_registers(DRIVER_ADDR_4, 3);
+ is31fl3733_update_led_control_registers(IS31FL3733_I2C_ADDRESS_1, 0);
+# if defined(IS31FL3733_I2C_ADDRESS_2)
+ is31fl3733_update_led_control_registers(IS31FL3733_I2C_ADDRESS_2, 1);
+# if defined(IS31FL3733_I2C_ADDRESS_3)
+ is31fl3733_update_led_control_registers(IS31FL3733_I2C_ADDRESS_3, 2);
+# if defined(IS31FL3733_I2C_ADDRESS_4)
+ is31fl3733_update_led_control_registers(IS31FL3733_I2C_ADDRESS_4, 3);
# endif
# endif
# endif
# elif defined(RGB_MATRIX_IS31FL3736)
- is31fl3736_update_led_control_registers(DRIVER_ADDR_1, 0);
-# if defined(DRIVER_ADDR_2)
- is31fl3736_update_led_control_registers(DRIVER_ADDR_2, 1);
-# if defined(DRIVER_ADDR_3)
- is31fl3736_update_led_control_registers(DRIVER_ADDR_3, 2);
-# if defined(DRIVER_ADDR_4)
- is31fl3736_update_led_control_registers(DRIVER_ADDR_4, 3);
+ is31fl3736_update_led_control_registers(IS31FL3736_I2C_ADDRESS_1, 0);
+# if defined(IS31FL3736_I2C_ADDRESS_2)
+ is31fl3736_update_led_control_registers(IS31FL3736_I2C_ADDRESS_2, 1);
+# if defined(IS31FL3736_I2C_ADDRESS_3)
+ is31fl3736_update_led_control_registers(IS31FL3736_I2C_ADDRESS_3, 2);
+# if defined(IS31FL3736_I2C_ADDRESS_4)
+ is31fl3736_update_led_control_registers(IS31FL3736_I2C_ADDRESS_4, 3);
# endif
# endif
# endif
# elif defined(RGB_MATRIX_IS31FL3737)
- is31fl3737_update_led_control_registers(DRIVER_ADDR_1, 0);
-# if defined(DRIVER_ADDR_2)
- is31fl3737_update_led_control_registers(DRIVER_ADDR_2, 1);
-# if defined(DRIVER_ADDR_3)
- is31fl3737_update_led_control_registers(DRIVER_ADDR_3, 2);
-# if defined(DRIVER_ADDR_4)
- is31fl3737_update_led_control_registers(DRIVER_ADDR_4, 3);
+ is31fl3737_update_led_control_registers(IS31FL3737_I2C_ADDRESS_1, 0);
+# if defined(IS31FL3737_I2C_ADDRESS_2)
+ is31fl3737_update_led_control_registers(IS31FL3737_I2C_ADDRESS_2, 1);
+# if defined(IS31FL3737_I2C_ADDRESS_3)
+ is31fl3737_update_led_control_registers(IS31FL3737_I2C_ADDRESS_3, 2);
+# if defined(IS31FL3737_I2C_ADDRESS_4)
+ is31fl3737_update_led_control_registers(IS31FL3737_I2C_ADDRESS_4, 3);
# endif
# endif
# endif
# elif defined(RGB_MATRIX_IS31FL3741)
- is31fl3741_update_led_control_registers(DRIVER_ADDR_1, 0);
-# if defined(DRIVER_ADDR_2)
- is31fl3741_update_led_control_registers(DRIVER_ADDR_2, 1);
-# if defined(DRIVER_ADDR_3)
- is31fl3741_update_led_control_registers(DRIVER_ADDR_3, 2);
-# if defined(DRIVER_ADDR_4)
- is31fl3741_update_led_control_registers(DRIVER_ADDR_4, 3);
+ is31fl3741_update_led_control_registers(IS31FL3741_I2C_ADDRESS_1, 0);
+# if defined(IS31FL3741_I2C_ADDRESS_2)
+ is31fl3741_update_led_control_registers(IS31FL3741_I2C_ADDRESS_2, 1);
+# if defined(IS31FL3741_I2C_ADDRESS_3)
+ is31fl3741_update_led_control_registers(IS31FL3741_I2C_ADDRESS_3, 2);
+# if defined(IS31FL3741_I2C_ADDRESS_4)
+ is31fl3741_update_led_control_registers(IS31FL3741_I2C_ADDRESS_4, 3);
# endif
# endif
# endif
@@ -240,13 +233,13 @@ static void init(void) {
# endif
# elif defined(RGB_MATRIX_SNLED27351)
- snled27351_update_led_control_registers(DRIVER_ADDR_1, 0);
-# if defined(DRIVER_ADDR_2)
- snled27351_update_led_control_registers(DRIVER_ADDR_2, 1);
-# if defined(DRIVER_ADDR_3)
- snled27351_update_led_control_registers(DRIVER_ADDR_3, 2);
-# if defined(DRIVER_ADDR_4)
- snled27351_update_led_control_registers(DRIVER_ADDR_4, 3);
+ snled27351_update_led_control_registers(SNLED27351_I2C_ADDRESS_1, 0);
+# if defined(SNLED27351_I2C_ADDRESS_2)
+ snled27351_update_led_control_registers(SNLED27351_I2C_ADDRESS_2, 1);
+# if defined(SNLED27351_I2C_ADDRESS_3)
+ snled27351_update_led_control_registers(SNLED27351_I2C_ADDRESS_3, 2);
+# if defined(SNLED27351_I2C_ADDRESS_4)
+ snled27351_update_led_control_registers(SNLED27351_I2C_ADDRESS_4, 3);
# endif
# endif
# endif
@@ -267,13 +260,13 @@ const rgb_matrix_driver_t rgb_matrix_driver = {
# elif defined(RGB_MATRIX_IS31FL3731)
static void flush(void) {
- is31fl3731_update_pwm_buffers(DRIVER_ADDR_1, 0);
-# if defined(DRIVER_ADDR_2)
- is31fl3731_update_pwm_buffers(DRIVER_ADDR_2, 1);
-# if defined(DRIVER_ADDR_3)
- is31fl3731_update_pwm_buffers(DRIVER_ADDR_3, 2);
-# if defined(DRIVER_ADDR_4)
- is31fl3731_update_pwm_buffers(DRIVER_ADDR_4, 3);
+ is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_1, 0);
+# if defined(IS31FL3731_I2C_ADDRESS_2)
+ is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_2, 1);
+# if defined(IS31FL3731_I2C_ADDRESS_3)
+ is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_3, 2);
+# if defined(IS31FL3731_I2C_ADDRESS_4)
+ is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_4, 3);
# endif
# endif
# endif
@@ -288,13 +281,13 @@ const rgb_matrix_driver_t rgb_matrix_driver = {
# elif defined(RGB_MATRIX_IS31FL3733)
static void flush(void) {
- is31fl3733_update_pwm_buffers(DRIVER_ADDR_1, 0);
-# if defined(DRIVER_ADDR_2)
- is31fl3733_update_pwm_buffers(DRIVER_ADDR_2, 1);
-# if defined(DRIVER_ADDR_3)
- is31fl3733_update_pwm_buffers(DRIVER_ADDR_3, 2);
-# if defined(DRIVER_ADDR_4)
- is31fl3733_update_pwm_buffers(DRIVER_ADDR_4, 3);
+ is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_1, 0);
+# if defined(IS31FL3733_I2C_ADDRESS_2)
+ is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_2, 1);
+# if defined(IS31FL3733_I2C_ADDRESS_3)
+ is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_3, 2);
+# if defined(IS31FL3733_I2C_ADDRESS_4)
+ is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_4, 3);
# endif
# endif
# endif
@@ -309,13 +302,13 @@ const rgb_matrix_driver_t rgb_matrix_driver = {
# elif defined(RGB_MATRIX_IS31FL3736)
static void flush(void) {
- is31fl3736_update_pwm_buffers(DRIVER_ADDR_1, 0);
-# if defined(DRIVER_ADDR_2)
- is31fl3736_update_pwm_buffers(DRIVER_ADDR_2, 1);
-# if defined(DRIVER_ADDR_3)
- is31fl3736_update_pwm_buffers(DRIVER_ADDR_3, 2);
-# if defined(DRIVER_ADDR_4)
- is31fl3736_update_pwm_buffers(DRIVER_ADDR_4, 3);
+ is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_1, 0);
+# if defined(IS31FL3736_I2C_ADDRESS_2)
+ is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_2, 1);
+# if defined(IS31FL3736_I2C_ADDRESS_3)
+ is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_3, 2);
+# if defined(IS31FL3736_I2C_ADDRESS_4)
+ is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_4, 3);
# endif
# endif
# endif
@@ -330,13 +323,13 @@ const rgb_matrix_driver_t rgb_matrix_driver = {
# elif defined(RGB_MATRIX_IS31FL3737)
static void flush(void) {
- is31fl3737_update_pwm_buffers(DRIVER_ADDR_1, 0);
-# if defined(DRIVER_ADDR_2)
- is31fl3737_update_pwm_buffers(DRIVER_ADDR_2, 1);
-# if defined(DRIVER_ADDR_3)
- is31fl3737_update_pwm_buffers(DRIVER_ADDR_3, 2);
-# if defined(DRIVER_ADDR_4)
- is31fl3737_update_pwm_buffers(DRIVER_ADDR_4, 3);
+ is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_1, 0);
+# if defined(IS31FL3737_I2C_ADDRESS_2)
+ is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_2, 1);
+# if defined(IS31FL3737_I2C_ADDRESS_3)
+ is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_3, 2);
+# if defined(IS31FL3737_I2C_ADDRESS_4)
+ is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_4, 3);
# endif
# endif
# endif
@@ -351,13 +344,13 @@ const rgb_matrix_driver_t rgb_matrix_driver = {
# elif defined(RGB_MATRIX_IS31FL3741)
static void flush(void) {
- is31fl3741_update_pwm_buffers(DRIVER_ADDR_1, 0);
-# if defined(DRIVER_ADDR_2)
- is31fl3741_update_pwm_buffers(DRIVER_ADDR_2, 1);
-# if defined(DRIVER_ADDR_3)
- is31fl3741_update_pwm_buffers(DRIVER_ADDR_3, 2);
-# if defined(DRIVER_ADDR_4)
- is31fl3741_update_pwm_buffers(DRIVER_ADDR_4, 3);
+ is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_1, 0);
+# if defined(IS31FL3741_I2C_ADDRESS_2)
+ is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_2, 1);
+# if defined(IS31FL3741_I2C_ADDRESS_3)
+ is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_3, 2);
+# if defined(IS31FL3741_I2C_ADDRESS_4)
+ is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_4, 3);
# endif
# endif
# endif
@@ -393,13 +386,13 @@ const rgb_matrix_driver_t rgb_matrix_driver = {
# elif defined(RGB_MATRIX_SNLED27351)
static void flush(void) {
- snled27351_update_pwm_buffers(DRIVER_ADDR_1, 0);
-# if defined(DRIVER_ADDR_2)
- snled27351_update_pwm_buffers(DRIVER_ADDR_2, 1);
-# if defined(DRIVER_ADDR_3)
- snled27351_update_pwm_buffers(DRIVER_ADDR_3, 2);
-# if defined(DRIVER_ADDR_4)
- snled27351_update_pwm_buffers(DRIVER_ADDR_4, 3);
+ snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_1, 0);
+# if defined(SNLED27351_I2C_ADDRESS_2)
+ snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_2, 1);
+# if defined(SNLED27351_I2C_ADDRESS_3)
+ snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_3, 2);
+# if defined(SNLED27351_I2C_ADDRESS_4)
+ snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_4, 3);
# endif
# endif
# endif
@@ -419,16 +412,16 @@ const rgb_matrix_driver_t rgb_matrix_driver = {
static void init(void) {
spi_init();
- aw20216s_init(AW20216S_DRIVER_1_CS, AW20216S_DRIVER_1_EN);
-# if defined(AW20216S_DRIVER_2_CS)
- aw20216s_init(AW20216S_DRIVER_2_CS, AW20216S_DRIVER_2_EN);
+ aw20216s_init(AW20216S_CS_PIN_1, AW20216S_EN_PIN_1);
+# if defined(AW20216S_CS_PIN_2)
+ aw20216s_init(AW20216S_CS_PIN_2, AW20216S_EN_PIN_2);
# endif
}
static void flush(void) {
- aw20216s_update_pwm_buffers(AW20216S_DRIVER_1_CS, 0);
-# if defined(AW20216S_DRIVER_2_CS)
- aw20216s_update_pwm_buffers(AW20216S_DRIVER_2_CS, 1);
+ aw20216s_update_pwm_buffers(AW20216S_CS_PIN_1, 0);
+# if defined(AW20216S_CS_PIN_2)
+ aw20216s_update_pwm_buffers(AW20216S_CS_PIN_2, 1);
# endif
}