diff options
| author | Ryan <fauxpark@gmail.com> | 2023-09-19 19:31:54 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-19 19:31:54 +1000 |
| commit | 8f221052897754870e5c08a2de92c24d20cd307e (patch) | |
| tree | fe853aa394ae9d07f593446ce87a01b334f3bbea /keyboards/wilba_tech | |
| parent | 74360d0a01d58baf68109f6380144c7f3c69ef91 (diff) | |
Add and use I2C address defines for ISSI LED drivers (#22008)
Diffstat (limited to 'keyboards/wilba_tech')
| -rw-r--r-- | keyboards/wilba_tech/wt_rgb_backlight.c | 51 |
1 files changed, 15 insertions, 36 deletions
diff --git a/keyboards/wilba_tech/wt_rgb_backlight.c b/keyboards/wilba_tech/wt_rgb_backlight.c index 8a0f3b7f91..20932138ed 100644 --- a/keyboards/wilba_tech/wt_rgb_backlight.c +++ b/keyboards/wilba_tech/wt_rgb_backlight.c | |||
| @@ -155,11 +155,7 @@ uint8_t g_key_hit[BACKLIGHT_LED_COUNT]; | |||
| 155 | uint32_t g_any_key_hit = 0; | 155 | uint32_t g_any_key_hit = 0; |
| 156 | 156 | ||
| 157 | #if defined(RGB_BACKLIGHT_HS60) | 157 | #if defined(RGB_BACKLIGHT_HS60) |
| 158 | 158 | #define ISSI_ADDR_1 IS31FL3733_I2C_ADDRESS_GND_GND | |
| 159 | // This is a 7-bit address, that gets left-shifted and bit 0 | ||
| 160 | // set to 0 for write, 1 for read (as per I2C protocol) | ||
| 161 | // ADDR_2 is not needed. it is here as a dummy | ||
| 162 | #define ISSI_ADDR_1 0x50 | ||
| 163 | 159 | ||
| 164 | const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { | 160 | const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { |
| 165 | /* Refer to IS31 manual for these locations | 161 | /* Refer to IS31 manual for these locations |
| @@ -235,12 +231,8 @@ const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { | |||
| 235 | }; | 231 | }; |
| 236 | 232 | ||
| 237 | #elif defined(RGB_BACKLIGHT_NK65) || defined(RGB_BACKLIGHT_NEBULA68) || defined(RGB_BACKLIGHT_NK87) || defined(RGB_BACKLIGHT_KW_MEGA) | 233 | #elif defined(RGB_BACKLIGHT_NK65) || defined(RGB_BACKLIGHT_NEBULA68) || defined(RGB_BACKLIGHT_NK87) || defined(RGB_BACKLIGHT_KW_MEGA) |
| 238 | 234 | #define ISSI_ADDR_1 IS31FL3733_I2C_ADDRESS_GND_GND | |
| 239 | // This is a 7-bit address, that gets left-shifted and bit 0 | 235 | #define ISSI_ADDR_2 IS31FL3733_I2C_ADDRESS_GND_SDA |
| 240 | // set to 0 for write, 1 for read (as per I2C protocol) | ||
| 241 | // ADDR_2 is not needed. it is here as a dummy | ||
| 242 | #define ISSI_ADDR_1 0x50 | ||
| 243 | #define ISSI_ADDR_2 0x52 | ||
| 244 | 236 | ||
| 245 | const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { | 237 | const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { |
| 246 | /* Refer to IS31 manual for these locations | 238 | /* Refer to IS31 manual for these locations |
| @@ -381,9 +373,7 @@ const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { | |||
| 381 | }; | 373 | }; |
| 382 | 374 | ||
| 383 | #elif defined(RGB_BACKLIGHT_NEBULA12) | 375 | #elif defined(RGB_BACKLIGHT_NEBULA12) |
| 384 | // This is a 7-bit address, that gets left-shifted and bit 0 | 376 | #define ISSI_ADDR_1 IS31FL3731_I2C_ADDRESS_GND |
| 385 | // set to 0 for write, 1 for read (as per I2C protocol) | ||
| 386 | #define ISSI_ADDR_1 0x74 | ||
| 387 | 377 | ||
| 388 | const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { | 378 | const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { |
| 389 | /* Refer to IS31 manual for these locations | 379 | /* Refer to IS31 manual for these locations |
| @@ -411,11 +401,10 @@ const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { | |||
| 411 | }; | 401 | }; |
| 412 | 402 | ||
| 413 | #elif defined(RGB_BACKLIGHT_U80_A) | 403 | #elif defined(RGB_BACKLIGHT_U80_A) |
| 414 | |||
| 415 | // U80-A prototype uses 3 ISSI drivers | 404 | // U80-A prototype uses 3 ISSI drivers |
| 416 | #define ISSI_ADDR_1 0x74 // 11101[00] <- GND | 405 | #define ISSI_ADDR_1 IS31FL3731_I2C_ADDRESS_GND |
| 417 | #define ISSI_ADDR_2 0x76 // 11101[10] <- SDA | 406 | #define ISSI_ADDR_2 IS31FL3731_I2C_ADDRESS_SDA |
| 418 | #define ISSI_ADDR_3 0x75 // 11101[01] <- SCL | 407 | #define ISSI_ADDR_3 IS31FL3731_I2C_ADDRESS_SCL |
| 419 | 408 | ||
| 420 | const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { | 409 | const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { |
| 421 | /* Refer to IS31 manual for these locations | 410 | /* Refer to IS31 manual for these locations |
| @@ -539,10 +528,8 @@ const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { | |||
| 539 | {2, C8_16, C7_16, C6_16}, // LF17 | 528 | {2, C8_16, C7_16, C6_16}, // LF17 |
| 540 | }; | 529 | }; |
| 541 | #elif defined(RGB_BACKLIGHT_DAWN60) | 530 | #elif defined(RGB_BACKLIGHT_DAWN60) |
| 542 | // This is a 7-bit address, that gets left-shifted and bit 0 | 531 | #define ISSI_ADDR_1 IS31FL3731_I2C_ADDRESS_GND |
| 543 | // set to 0 for write, 1 for read (as per I2C protocol) | 532 | #define ISSI_ADDR_2 IS31FL3731_I2C_ADDRESS_SDA |
| 544 | #define ISSI_ADDR_1 0x74 | ||
| 545 | #define ISSI_ADDR_2 0x76 | ||
| 546 | 533 | ||
| 547 | const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { | 534 | const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { |
| 548 | /* Refer to IS31 manual for these locations | 535 | /* Refer to IS31 manual for these locations |
| @@ -620,10 +607,8 @@ const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { | |||
| 620 | {1, C9_16, C7_15, C6_15} //D16 | 607 | {1, C9_16, C7_15, C6_15} //D16 |
| 621 | }; | 608 | }; |
| 622 | #elif defined(RGB_BACKLIGHT_PORTICO) | 609 | #elif defined(RGB_BACKLIGHT_PORTICO) |
| 623 | // This is a 7-bit address, that gets left-shifted and bit 0 | 610 | #define ISSI_ADDR_1 IS31FL3731_I2C_ADDRESS_GND |
| 624 | // set to 0 for write, 1 for read (as per I2C protocol) | 611 | #define ISSI_ADDR_2 IS31FL3731_I2C_ADDRESS_VCC |
| 625 | #define ISSI_ADDR_1 0x74 | ||
| 626 | #define ISSI_ADDR_2 0x77 | ||
| 627 | 612 | ||
| 628 | const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { | 613 | const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { |
| 629 | /* Refer to IS31 manual for these locations | 614 | /* Refer to IS31 manual for these locations |
| @@ -706,9 +691,7 @@ const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { | |||
| 706 | }; | 691 | }; |
| 707 | 692 | ||
| 708 | #elif defined(RGB_BACKLIGHT_PORTICO75) | 693 | #elif defined(RGB_BACKLIGHT_PORTICO75) |
| 709 | // This is a 7-bit address, that gets left-shifted and bit 0 | 694 | #define ISSI_ADDR_1 IS31FL3741_I2C_ADDRESS_GND |
| 710 | // set to 0 for write, 1 for read (as per I2C protocol) | ||
| 711 | #define ISSI_ADDR_1 0x30 | ||
| 712 | #define ISSI_ADDR_2 | 695 | #define ISSI_ADDR_2 |
| 713 | 696 | ||
| 714 | const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { | 697 | const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { |
| @@ -843,9 +826,7 @@ const is31fl3218_led_t PROGMEM g_is31fl3218_leds[RGB_MATRIX_LED_COUNT] = { | |||
| 843 | {OUT16, OUT17, OUT18} | 826 | {OUT16, OUT17, OUT18} |
| 844 | }; | 827 | }; |
| 845 | #elif defined(RGB_BACKLIGHT_M10_C) | 828 | #elif defined(RGB_BACKLIGHT_M10_C) |
| 846 | // This is a 7-bit address, that gets left-shifted and bit 0 | 829 | #define ISSI_ADDR_1 IS31FL3731_I2C_ADDRESS_GND |
| 847 | // set to 0 for write, 1 for read (as per I2C protocol) | ||
| 848 | #define ISSI_ADDR_1 0x74 | ||
| 849 | #define ISSI_ADDR_2 | 830 | #define ISSI_ADDR_2 |
| 850 | 831 | ||
| 851 | const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { | 832 | const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { |
| @@ -863,10 +844,8 @@ const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { | |||
| 863 | {0, C9_16, C7_15, C6_15} // LB16 | 844 | {0, C9_16, C7_15, C6_15} // LB16 |
| 864 | }; | 845 | }; |
| 865 | #else | 846 | #else |
| 866 | // This is a 7-bit address, that gets left-shifted and bit 0 | 847 | #define ISSI_ADDR_1 IS31FL3731_I2C_ADDRESS_GND |
| 867 | // set to 0 for write, 1 for read (as per I2C protocol) | 848 | #define ISSI_ADDR_2 IS31FL3731_I2C_ADDRESS_SDA |
| 868 | #define ISSI_ADDR_1 0x74 | ||
| 869 | #define ISSI_ADDR_2 0x76 | ||
| 870 | 849 | ||
| 871 | const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { | 850 | const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { |
| 872 | /* Refer to IS31 manual for these locations | 851 | /* Refer to IS31 manual for these locations |
