diff options
-rw-r--r-- | docs/feature_rgb_matrix.md | 47 | ||||
-rw-r--r-- | drivers/led/issi/is31fl3731-simple.c | 7 | ||||
-rw-r--r-- | drivers/led/issi/is31fl3731.c | 7 | ||||
-rw-r--r-- | drivers/led/issi/is31fl3733.c | 11 | ||||
-rw-r--r-- | drivers/led/issi/is31fl3733.h | 9 | ||||
-rw-r--r-- | drivers/led/issi/is31fl3736.c | 13 | ||||
-rw-r--r-- | drivers/led/issi/is31fl3736.h | 10 | ||||
-rw-r--r-- | drivers/led/issi/is31fl3737.c | 13 | ||||
-rw-r--r-- | drivers/led/issi/is31fl3737.h | 10 | ||||
-rw-r--r-- | drivers/led/issi/is31fl3741.c | 10 | ||||
-rw-r--r-- | drivers/led/issi/is31fl3741.h | 9 |
11 files changed, 136 insertions, 10 deletions
diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index fa06e46e4..cad7c50f1 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md | |||
@@ -21,6 +21,7 @@ You can use between 1 and 4 IS31FL3731 IC's. Do not specify `DRIVER_ADDR_<N>` de | |||
21 | |----------|-------------|---------| | 21 | |----------|-------------|---------| |
22 | | `ISSI_TIMEOUT` | (Optional) How long to wait for i2c messages, in milliseconds | 100 | | 22 | | `ISSI_TIMEOUT` | (Optional) How long to wait for i2c messages, in milliseconds | 100 | |
23 | | `ISSI_PERSISTENCE` | (Optional) Retry failed messages this many times | 0 | | 23 | | `ISSI_PERSISTENCE` | (Optional) Retry failed messages this many times | 0 | |
24 | | `ISSI_3731_DEGHOST` | (Optional) Set this define to enable de-ghosting by halving Vcc during blanking time | | | ||
24 | | `DRIVER_COUNT` | (Required) How many RGB driver IC's are present | | | 25 | | `DRIVER_COUNT` | (Required) How many RGB driver IC's are present | | |
25 | | `DRIVER_LED_TOTAL` | (Required) How many RGB lights are present across all drivers | | | 26 | | `DRIVER_LED_TOTAL` | (Required) How many RGB lights are present across all drivers | | |
26 | | `DRIVER_ADDR_1` | (Required) Address for the first RGB driver | | | 27 | | `DRIVER_ADDR_1` | (Required) Address for the first RGB driver | | |
@@ -85,6 +86,8 @@ You can use between 1 and 4 IS31FL3733 IC's. Do not specify `DRIVER_ADDR_<N>` de | |||
85 | | `ISSI_TIMEOUT` | (Optional) How long to wait for i2c messages, in milliseconds | 100 | | 86 | | `ISSI_TIMEOUT` | (Optional) How long to wait for i2c messages, in milliseconds | 100 | |
86 | | `ISSI_PERSISTENCE` | (Optional) Retry failed messages this many times | 0 | | 87 | | `ISSI_PERSISTENCE` | (Optional) Retry failed messages this many times | 0 | |
87 | | `ISSI_PWM_FREQUENCY` | (Optional) PWM Frequency Setting - IS31FL3733B only | 0 | | 88 | | `ISSI_PWM_FREQUENCY` | (Optional) PWM Frequency Setting - IS31FL3733B only | 0 | |
89 | | `ISSI_SWPULLUP` | (Optional) Set the value of the SWx lines on-chip de-ghosting resistors | PUR_0R (Disabled) | | ||
90 | | `ISSI_CSPULLUP` | (Optional) Set the value of the CSx lines on-chip de-ghosting resistors | PUR_0R (Disabled) | | ||
88 | | `DRIVER_COUNT` | (Required) How many RGB driver IC's are present | | | 91 | | `DRIVER_COUNT` | (Required) How many RGB driver IC's are present | | |
89 | | `DRIVER_LED_TOTAL` | (Required) How many RGB lights are present across all drivers | | | 92 | | `DRIVER_LED_TOTAL` | (Required) How many RGB lights are present across all drivers | | |
90 | | `DRIVER_ADDR_1` | (Required) Address for the first RGB driver | | | 93 | | `DRIVER_ADDR_1` | (Required) Address for the first RGB driver | | |
@@ -96,6 +99,18 @@ You can use between 1 and 4 IS31FL3733 IC's. Do not specify `DRIVER_ADDR_<N>` de | |||
96 | | `DRIVER_SYNC_3` | (Optional) Sync configuration for the third RGB driver | 0 | | 99 | | `DRIVER_SYNC_3` | (Optional) Sync configuration for the third RGB driver | 0 | |
97 | | `DRIVER_SYNC_4` | (Optional) Sync configuration for the fourth RGB driver | 0 | | 100 | | `DRIVER_SYNC_4` | (Optional) Sync configuration for the fourth RGB driver | 0 | |
98 | 101 | ||
102 | The IS31FL3733 IC's have on-chip resistors that can be enabled to allow for de-ghosting of the RGB matrix. By default these resistors are not enabled (`ISSI_SWPULLUP`/`ISSI_CSPULLUP` are given the value of`PUR_0R`), the values that can be set to enable de-ghosting are as follows: | ||
103 | |||
104 | | `ISSI_SWPULLUP/ISSI_CSPULLUP` | Description | | ||
105 | |----------------------|-------------| | ||
106 | | `PUR_0R` | (default) Do not use the on-chip resistors/enable de-ghosting | | ||
107 | | `PUR_05KR` | The 0.5k Ohm resistor used during blanking period (t_NOL) | | ||
108 | | `PUR_3KR` | The 3k Ohm resistor used at all times | | ||
109 | | `PUR_4KR` | The 4k Ohm resistor used at all times | | ||
110 | | `PUR_8KR` | The 8k Ohm resistor used at all times | | ||
111 | | `PUR_16KR` | The 16k Ohm resistor used at all times | | ||
112 | | `PUR_32KR` | The 32k Ohm resistor used during blanking period (t_NOL) | | ||
113 | |||
99 | Here is an example using 2 drivers. | 114 | Here is an example using 2 drivers. |
100 | 115 | ||
101 | ```c | 116 | ```c |
@@ -156,11 +171,25 @@ Configure the hardware via your `config.h`: | |||
156 | |----------|-------------|---------| | 171 | |----------|-------------|---------| |
157 | | `ISSI_TIMEOUT` | (Optional) How long to wait for i2c messages, in milliseconds | 100 | | 172 | | `ISSI_TIMEOUT` | (Optional) How long to wait for i2c messages, in milliseconds | 100 | |
158 | | `ISSI_PERSISTENCE` | (Optional) Retry failed messages this many times | 0 | | 173 | | `ISSI_PERSISTENCE` | (Optional) Retry failed messages this many times | 0 | |
174 | | `ISSI_SWPULLUP` | (Optional) Set the value of the SWx lines on-chip de-ghosting resistors | PUR_0R (Disabled) | | ||
175 | | `ISSI_CSPULLUP` | (Optional) Set the value of the CSx lines on-chip de-ghosting resistors | PUR_0R (Disabled) | | ||
159 | | `DRIVER_COUNT` | (Required) How many RGB driver IC's are present | | | 176 | | `DRIVER_COUNT` | (Required) How many RGB driver IC's are present | | |
160 | | `DRIVER_LED_TOTAL` | (Required) How many RGB lights are present across all drivers | | | 177 | | `DRIVER_LED_TOTAL` | (Required) How many RGB lights are present across all drivers | | |
161 | | `DRIVER_ADDR_1` | (Required) Address for the first RGB driver | | | 178 | | `DRIVER_ADDR_1` | (Required) Address for the first RGB driver | | |
162 | | `DRIVER_ADDR_2` | (Optional) Address for the second RGB driver | | | 179 | | `DRIVER_ADDR_2` | (Optional) Address for the second RGB driver | | |
163 | 180 | ||
181 | The IS31FL3737 IC's have on-chip resistors that can be enabled to allow for de-ghosting of the RGB matrix. By default these resistors are not enabled (`ISSI_SWPULLUP`/`ISSI_CSPULLUP` are given the value of`PUR_0R`), the values that can be set to enable de-ghosting are as follows: | ||
182 | |||
183 | | `ISSI_SWPULLUP/ISSI_CSPULLUP` | Description | | ||
184 | |----------------------|-------------| | ||
185 | | `PUR_0R` | (default) Do not use the on-chip resistors/enable de-ghosting | | ||
186 | | `PUR_05KR` | The 0.5k Ohm resistor used during blanking period (t_NOL) | | ||
187 | | `PUR_1KR` | The 1k Ohm resistor used during blanking period (t_NOL) | | ||
188 | | `PUR_2KR` | The 2k Ohm resistor used during blanking period (t_NOL) | | ||
189 | | `PUR_4KR` | The 4k Ohm resistor used during blanking period (t_NOL) | | ||
190 | | `PUR_8KR` | The 8k Ohm resistor during blanking period (t_NOL) | | ||
191 | | `PUR_16KR` | The 16k Ohm resistor during blanking period (t_NOL) | | ||
192 | | `PUR_32KR` | The 32k Ohm resistor used during blanking period (t_NOL) | | ||
164 | 193 | ||
165 | Here is an example using 2 drivers. | 194 | Here is an example using 2 drivers. |
166 | 195 | ||
@@ -184,7 +213,7 @@ Here is an example using 2 drivers. | |||
184 | ``` | 213 | ``` |
185 | !> Note the parentheses, this is so when `DRIVER_LED_TOTAL` is used in code and expanded, the values are added together before any additional math is applied to them. As an example, `rand() % (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)` will give very different results than `rand() % DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL`. | 214 | !> Note the parentheses, this is so when `DRIVER_LED_TOTAL` is used in code and expanded, the values are added together before any additional math is applied to them. As an example, `rand() % (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)` will give very different results than `rand() % DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL`. |
186 | 215 | ||
187 | Currently only 2 drivers are supported, but it would be trivial to support all 4 combinations. | 216 | Currently only 2 drivers are supported, but it would be trivial to support all 4 combinations. |
188 | 217 | ||
189 | Define these arrays listing all the LEDs in your `<keyboard>.c`: | 218 | Define these arrays listing all the LEDs in your `<keyboard>.c`: |
190 | 219 | ||
@@ -343,7 +372,7 @@ x = 224 / (NUMBER_OF_COLS - 1) * COL_POSITION | |||
343 | y = 64 / (NUMBER_OF_ROWS - 1) * ROW_POSITION | 372 | y = 64 / (NUMBER_OF_ROWS - 1) * ROW_POSITION |
344 | ``` | 373 | ``` |
345 | 374 | ||
346 | Where NUMBER_OF_COLS, NUMBER_OF_ROWS, COL_POSITION, & ROW_POSITION are all based on the physical layout of your keyboard, not the electrical layout. | 375 | Where NUMBER_OF_COLS, NUMBER_OF_ROWS, COL_POSITION, & ROW_POSITION are all based on the physical layout of your keyboard, not the electrical layout. |
347 | 376 | ||
348 | As mentioned earlier, the center of the keyboard by default is expected to be `{ 112, 32 }`, but this can be changed if you want to more accurately calculate the LED's physical `{ x, y }` positions. Keyboard designers can implement `#define RGB_MATRIX_CENTER { 112, 32 }` in their config.h file with the new center point of the keyboard, or where they want it to be allowing more possibilities for the `{ x, y }` values. Do note that the maximum value for x or y is 255, and the recommended maximum is 224 as this gives animations runoff room before they reset. | 377 | As mentioned earlier, the center of the keyboard by default is expected to be `{ 112, 32 }`, but this can be changed if you want to more accurately calculate the LED's physical `{ x, y }` positions. Keyboard designers can implement `#define RGB_MATRIX_CENTER { 112, 32 }` in their config.h file with the new center point of the keyboard, or where they want it to be allowing more possibilities for the `{ x, y }` values. Do note that the maximum value for x or y is 255, and the recommended maximum is 224 as this gives animations runoff room before they reset. |
349 | 378 | ||
@@ -386,7 +415,7 @@ All RGB keycodes are currently shared with the RGBLIGHT system: | |||
386 | 415 | ||
387 | * `RGB_MODE_*` keycodes will generally work, but not all of the modes are currently mapped to the correct effects for the RGB Matrix system. | 416 | * `RGB_MODE_*` keycodes will generally work, but not all of the modes are currently mapped to the correct effects for the RGB Matrix system. |
388 | 417 | ||
389 | `RGB_MODE_PLAIN`, `RGB_MODE_BREATHE`, `RGB_MODE_RAINBOW`, and `RGB_MATRIX_SWIRL` are the only ones that are mapped properly. The rest don't have a direct equivalent, and are not mapped. | 418 | `RGB_MODE_PLAIN`, `RGB_MODE_BREATHE`, `RGB_MODE_RAINBOW`, and `RGB_MATRIX_SWIRL` are the only ones that are mapped properly. The rest don't have a direct equivalent, and are not mapped. |
390 | 419 | ||
391 | !> By default, if you have both the [RGB Light](feature_rgblight.md) and the RGB Matrix feature enabled, these keycodes will work for both features, at the same time. You can disable the keycode functionality by defining the `*_DISABLE_KEYCODES` option for the specific feature. | 420 | !> By default, if you have both the [RGB Light](feature_rgblight.md) and the RGB Matrix feature enabled, these keycodes will work for both features, at the same time. You can disable the keycode functionality by defining the `*_DISABLE_KEYCODES` option for the specific feature. |
392 | 421 | ||
@@ -423,7 +452,7 @@ enum rgb_matrix_effects { | |||
423 | RGB_MATRIX_JELLYBEAN_RAINDROPS, // Randomly changes a single key's hue and saturation | 452 | RGB_MATRIX_JELLYBEAN_RAINDROPS, // Randomly changes a single key's hue and saturation |
424 | RGB_MATRIX_HUE_BREATHING, // Hue shifts up a slight ammount at the same time, then shifts back | 453 | RGB_MATRIX_HUE_BREATHING, // Hue shifts up a slight ammount at the same time, then shifts back |
425 | RGB_MATRIX_HUE_PENDULUM, // Hue shifts up a slight ammount in a wave to the right, then back to the left | 454 | RGB_MATRIX_HUE_PENDULUM, // Hue shifts up a slight ammount in a wave to the right, then back to the left |
426 | RGB_MATRIX_HUE_WAVE, // Hue shifts up a slight ammount and then back down in a wave to the right | 455 | RGB_MATRIX_HUE_WAVE, // Hue shifts up a slight ammount and then back down in a wave to the right |
427 | RGB_MATRIX_FRACTAL, // Single hue fractal filled keys pulsing horizontally out to edges | 456 | RGB_MATRIX_FRACTAL, // Single hue fractal filled keys pulsing horizontally out to edges |
428 | #if define(RGB_MATRIX_FRAMEBUFFER_EFFECTS) | 457 | #if define(RGB_MATRIX_FRAMEBUFFER_EFFECTS) |
429 | RGB_MATRIX_TYPING_HEATMAP, // How hot is your WPM! | 458 | RGB_MATRIX_TYPING_HEATMAP, // How hot is your WPM! |
@@ -698,7 +727,7 @@ Where `28` is an unused index from `eeconfig.h`. | |||
698 | 727 | ||
699 | ### Indicators :id=indicators | 728 | ### Indicators :id=indicators |
700 | 729 | ||
701 | If you want to set custom indicators, such as an LED for Caps Lock, or layer indication, you can use the `rgb_matrix_indicators_kb` or `rgb_matrix_indicators_user` function for that: | 730 | If you want to set custom indicators, such as an LED for Caps Lock, or layer indication, you can use the `rgb_matrix_indicators_kb` or `rgb_matrix_indicators_user` function for that: |
702 | ```c | 731 | ```c |
703 | void rgb_matrix_indicators_kb(void) { | 732 | void rgb_matrix_indicators_kb(void) { |
704 | rgb_matrix_set_color(index, red, green, blue); | 733 | rgb_matrix_set_color(index, red, green, blue); |
@@ -753,18 +782,18 @@ This example sets the modifiers to be a specific color based on the layer state. | |||
753 | ```c | 782 | ```c |
754 | void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { | 783 | void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { |
755 | HSV hsv = {0, 255, 255}; | 784 | HSV hsv = {0, 255, 255}; |
756 | 785 | ||
757 | if (layer_state_is(layer_state, 2)) { | 786 | if (layer_state_is(layer_state, 2)) { |
758 | hsv = {130, 255, 255}; | 787 | hsv = {130, 255, 255}; |
759 | } else { | 788 | } else { |
760 | hsv = {30, 255, 255}; | 789 | hsv = {30, 255, 255}; |
761 | } | 790 | } |
762 | 791 | ||
763 | if (hsv.v > rgb_matrix_get_val()) { | 792 | if (hsv.v > rgb_matrix_get_val()) { |
764 | hsv.v = rgb_matrix_get_val(); | 793 | hsv.v = rgb_matrix_get_val(); |
765 | } | 794 | } |
766 | RGB rgb = hsv_to_rgb(hsv); | 795 | RGB rgb = hsv_to_rgb(hsv); |
767 | 796 | ||
768 | for (uint8_t i = led_min; i <= led_max; i++) { | 797 | for (uint8_t i = led_min; i <= led_max; i++) { |
769 | if (HAS_FLAGS(g_led_config.flags[i], 0x01)) { // 0x01 == LED_FLAG_MODIFIER | 798 | if (HAS_FLAGS(g_led_config.flags[i], 0x01)) { // 0x01 == LED_FLAG_MODIFIER |
770 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); | 799 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); |
@@ -773,7 +802,7 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { | |||
773 | } | 802 | } |
774 | ``` | 803 | ``` |
775 | 804 | ||
776 | If you want to indicate a Host LED status (caps lock, num lock, etc), you can use something like this to light up the caps lock key: | 805 | If you want to indicate a Host LED status (caps lock, num lock, etc), you can use something like this to light up the caps lock key: |
777 | 806 | ||
778 | ```c | 807 | ```c |
779 | void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { | 808 | void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { |
diff --git a/drivers/led/issi/is31fl3731-simple.c b/drivers/led/issi/is31fl3731-simple.c index d295772f5..9d28ea91d 100644 --- a/drivers/led/issi/is31fl3731-simple.c +++ b/drivers/led/issi/is31fl3731-simple.c | |||
@@ -1,6 +1,7 @@ | |||
1 | /* Copyright 2017 Jason Williams | 1 | /* Copyright 2017 Jason Williams |
2 | * Copyright 2018 Jack Humbert | 2 | * Copyright 2018 Jack Humbert |
3 | * Copyright 2019 Clueboard | 3 | * Copyright 2019 Clueboard |
4 | * Copyright 2021 Doni Crosby | ||
4 | * | 5 | * |
5 | * This program is free software: you can redistribute it and/or modify | 6 | * This program is free software: you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
@@ -40,6 +41,9 @@ | |||
40 | 41 | ||
41 | #define ISSI_REG_PICTUREFRAME 0x01 | 42 | #define ISSI_REG_PICTUREFRAME 0x01 |
42 | 43 | ||
44 | // Not defined in the datasheet -- See AN for IC | ||
45 | #define ISSI_REG_GHOST_IMAGE_PREVENTION 0xC2 // Set bit 4 to enable de-ghosting | ||
46 | |||
43 | #define ISSI_REG_SHUTDOWN 0x0A | 47 | #define ISSI_REG_SHUTDOWN 0x0A |
44 | #define ISSI_REG_AUDIOSYNC 0x06 | 48 | #define ISSI_REG_AUDIOSYNC 0x06 |
45 | 49 | ||
@@ -144,6 +148,9 @@ void IS31FL3731_init(uint8_t addr) { | |||
144 | 148 | ||
145 | // enable software shutdown | 149 | // enable software shutdown |
146 | IS31FL3731_write_register(addr, ISSI_REG_SHUTDOWN, 0x00); | 150 | IS31FL3731_write_register(addr, ISSI_REG_SHUTDOWN, 0x00); |
151 | #ifdef ISSI_3731_DEGHOST // set to enable de-ghosting of the array | ||
152 | IS31FL3731_write_register(addr, ISSI_REG_GHOST_IMAGE_PREVENTION, 0x10); | ||
153 | #endif | ||
147 | 154 | ||
148 | // this delay was copied from other drivers, might not be needed | 155 | // this delay was copied from other drivers, might not be needed |
149 | wait_ms(10); | 156 | wait_ms(10); |
diff --git a/drivers/led/issi/is31fl3731.c b/drivers/led/issi/is31fl3731.c index 110bdc1be..fbf24c30f 100644 --- a/drivers/led/issi/is31fl3731.c +++ b/drivers/led/issi/is31fl3731.c | |||
@@ -1,5 +1,6 @@ | |||
1 | /* Copyright 2017 Jason Williams | 1 | /* Copyright 2017 Jason Williams |
2 | * Copyright 2018 Jack Humbert | 2 | * Copyright 2018 Jack Humbert |
3 | * Copyright 2021 Doni Crosby | ||
3 | * | 4 | * |
4 | * This program is free software: you can redistribute it and/or modify | 5 | * This program is free software: you can redistribute it and/or modify |
5 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
@@ -39,6 +40,9 @@ | |||
39 | 40 | ||
40 | #define ISSI_REG_PICTUREFRAME 0x01 | 41 | #define ISSI_REG_PICTUREFRAME 0x01 |
41 | 42 | ||
43 | // Not defined in the datasheet -- See AN for IC | ||
44 | #define ISSI_REG_GHOST_IMAGE_PREVENTION 0xC2 // Set bit 4 to enable de-ghosting | ||
45 | |||
42 | #define ISSI_REG_SHUTDOWN 0x0A | 46 | #define ISSI_REG_SHUTDOWN 0x0A |
43 | #define ISSI_REG_AUDIOSYNC 0x06 | 47 | #define ISSI_REG_AUDIOSYNC 0x06 |
44 | 48 | ||
@@ -132,6 +136,9 @@ void IS31FL3731_init(uint8_t addr) { | |||
132 | 136 | ||
133 | // enable software shutdown | 137 | // enable software shutdown |
134 | IS31FL3731_write_register(addr, ISSI_REG_SHUTDOWN, 0x00); | 138 | IS31FL3731_write_register(addr, ISSI_REG_SHUTDOWN, 0x00); |
139 | #ifdef ISSI_3731_DEGHOST // set to enable de-ghosting of the array | ||
140 | IS31FL3731_write_register(addr, ISSI_REG_GHOST_IMAGE_PREVENTION, 0x10); | ||
141 | #endif | ||
135 | 142 | ||
136 | // this delay was copied from other drivers, might not be needed | 143 | // this delay was copied from other drivers, might not be needed |
137 | wait_ms(10); | 144 | wait_ms(10); |
diff --git a/drivers/led/issi/is31fl3733.c b/drivers/led/issi/is31fl3733.c index 4ddd827ca..c64d03513 100644 --- a/drivers/led/issi/is31fl3733.c +++ b/drivers/led/issi/is31fl3733.c | |||
@@ -1,6 +1,7 @@ | |||
1 | /* Copyright 2017 Jason Williams | 1 | /* Copyright 2017 Jason Williams |
2 | * Copyright 2018 Jack Humbert | 2 | * Copyright 2018 Jack Humbert |
3 | * Copyright 2018 Yiancar | 3 | * Copyright 2018 Yiancar |
4 | * Copyright 2021 Doni Crosby | ||
4 | * | 5 | * |
5 | * This program is free software: you can redistribute it and/or modify | 6 | * This program is free software: you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
@@ -58,6 +59,12 @@ | |||
58 | 59 | ||
59 | #ifndef ISSI_PWM_FREQUENCY | 60 | #ifndef ISSI_PWM_FREQUENCY |
60 | # define ISSI_PWM_FREQUENCY 0b000 // PFS - IS31FL3733B only | 61 | # define ISSI_PWM_FREQUENCY 0b000 // PFS - IS31FL3733B only |
62 | #ifndef ISSI_SWPULLUP | ||
63 | # define ISSI_SWPULLUP PUR_0R | ||
64 | #endif | ||
65 | |||
66 | #ifndef ISSI_CSPULLUP | ||
67 | # define ISSI_CSPULLUP PUR_0R | ||
61 | #endif | 68 | #endif |
62 | 69 | ||
63 | // Transfer buffer for TWITransmitData() | 70 | // Transfer buffer for TWITransmitData() |
@@ -158,6 +165,10 @@ void IS31FL3733_init(uint8_t addr, uint8_t sync) { | |||
158 | 165 | ||
159 | // Select PG3 | 166 | // Select PG3 |
160 | IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_FUNCTION); | 167 | IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_FUNCTION); |
168 | // Set de-ghost pull-up resistors (SWx) | ||
169 | IS31FL3733_write_register(addr, ISSI_REG_SWPULLUP, ISSI_SWPULLUP); | ||
170 | // Set de-ghost pull-down resistors (CSx) | ||
171 | IS31FL3733_write_register(addr, ISSI_REG_CSPULLUP, ISSI_CSPULLUP); | ||
161 | // Set global current to maximum. | 172 | // Set global current to maximum. |
162 | IS31FL3733_write_register(addr, ISSI_REG_GLOBALCURRENT, 0xFF); | 173 | IS31FL3733_write_register(addr, ISSI_REG_GLOBALCURRENT, 0xFF); |
163 | // Disable software shutdown. | 174 | // Disable software shutdown. |
diff --git a/drivers/led/issi/is31fl3733.h b/drivers/led/issi/is31fl3733.h index 64fd38eb1..daa226b41 100644 --- a/drivers/led/issi/is31fl3733.h +++ b/drivers/led/issi/is31fl3733.h | |||
@@ -1,6 +1,7 @@ | |||
1 | /* Copyright 2017 Jason Williams | 1 | /* Copyright 2017 Jason Williams |
2 | * Copyright 2018 Jack Humbert | 2 | * Copyright 2018 Jack Humbert |
3 | * Copyright 2018 Yiancar | 3 | * Copyright 2018 Yiancar |
4 | * Copyright 2021 Doni Crosby | ||
4 | * | 5 | * |
5 | * This program is free software: you can redistribute it and/or modify | 6 | * This program is free software: you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
@@ -47,6 +48,14 @@ void IS31FL3733_set_led_control_register(uint8_t index, bool red, bool green, bo | |||
47 | void IS31FL3733_update_pwm_buffers(uint8_t addr, uint8_t index); | 48 | void IS31FL3733_update_pwm_buffers(uint8_t addr, uint8_t index); |
48 | void IS31FL3733_update_led_control_registers(uint8_t addr, uint8_t index); | 49 | void IS31FL3733_update_led_control_registers(uint8_t addr, uint8_t index); |
49 | 50 | ||
51 | #define PUR_0R 0x00 // No PUR resistor | ||
52 | #define PUR_05KR 0x02 // 0.5k Ohm resistor in t_NOL | ||
53 | #define PUR_3KR 0x03 // 3.0k Ohm resistor on all the time | ||
54 | #define PUR_4KR 0x04 // 4.0k Ohm resistor on all the time | ||
55 | #define PUR_8KR 0x05 // 8.0k Ohm resistor on all the time | ||
56 | #define PUR_16KR 0x06 // 16k Ohm resistor on all the time | ||
57 | #define PUR_32KR 0x07 // 32k Ohm resistor in t_NOL | ||
58 | |||
50 | #define A_1 0x00 | 59 | #define A_1 0x00 |
51 | #define A_2 0x01 | 60 | #define A_2 0x01 |
52 | #define A_3 0x02 | 61 | #define A_3 0x02 |
diff --git a/drivers/led/issi/is31fl3736.c b/drivers/led/issi/is31fl3736.c index 7dece1b1e..dcaabba2e 100644 --- a/drivers/led/issi/is31fl3736.c +++ b/drivers/led/issi/is31fl3736.c | |||
@@ -1,4 +1,5 @@ | |||
1 | /* Copyright 2018 Jason Williams (Wilba) | 1 | /* Copyright 2018 Jason Williams (Wilba) |
2 | * Copyright 2021 Doni Crosby | ||
2 | * | 3 | * |
3 | * This program is free software: you can redistribute it and/or modify | 4 | * This program is free software: you can redistribute it and/or modify |
4 | * it under the terms of the GNU General Public License as published by | 5 | * it under the terms of the GNU General Public License as published by |
@@ -54,6 +55,14 @@ | |||
54 | # define ISSI_PERSISTENCE 0 | 55 | # define ISSI_PERSISTENCE 0 |
55 | #endif | 56 | #endif |
56 | 57 | ||
58 | #ifndef ISSI_SWPULLUP | ||
59 | # define ISSI_SWPULLUP PUR_0R | ||
60 | #endif | ||
61 | |||
62 | #ifndef ISSI_CSPULLUP | ||
63 | # define ISSI_CSPULLUP PUR_0R | ||
64 | #endif | ||
65 | |||
57 | // Transfer buffer for TWITransmitData() | 66 | // Transfer buffer for TWITransmitData() |
58 | uint8_t g_twi_transfer_buffer[20]; | 67 | uint8_t g_twi_transfer_buffer[20]; |
59 | 68 | ||
@@ -140,6 +149,10 @@ void IS31FL3736_init(uint8_t addr) { | |||
140 | 149 | ||
141 | // Select PG3 | 150 | // Select PG3 |
142 | IS31FL3736_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_FUNCTION); | 151 | IS31FL3736_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_FUNCTION); |
152 | // Set de-ghost pull-up resistors (SWx) | ||
153 | IS31FL3736_write_register(addr, ISSI_REG_SWPULLUP, ISSI_SWPULLUP); | ||
154 | // Set de-ghost pull-down resistors (CSx) | ||
155 | IS31FL3736_write_register(addr, ISSI_REG_CSPULLUP, ISSI_CSPULLUP); | ||
143 | // Set global current to maximum. | 156 | // Set global current to maximum. |
144 | IS31FL3736_write_register(addr, ISSI_REG_GLOBALCURRENT, 0xFF); | 157 | IS31FL3736_write_register(addr, ISSI_REG_GLOBALCURRENT, 0xFF); |
145 | // Disable software shutdown. | 158 | // Disable software shutdown. |
diff --git a/drivers/led/issi/is31fl3736.h b/drivers/led/issi/is31fl3736.h index c956c87f7..a30be9055 100644 --- a/drivers/led/issi/is31fl3736.h +++ b/drivers/led/issi/is31fl3736.h | |||
@@ -1,4 +1,5 @@ | |||
1 | /* Copyright 2018 Jason Williams (Wilba) | 1 | /* Copyright 2018 Jason Williams (Wilba) |
2 | * Copyright 2021 Doni Crosby | ||
2 | * | 3 | * |
3 | * This program is free software: you can redistribute it and/or modify | 4 | * This program is free software: you can redistribute it and/or modify |
4 | * it under the terms of the GNU General Public License as published by | 5 | * it under the terms of the GNU General Public License as published by |
@@ -60,6 +61,15 @@ void IS31FL3736_mono_set_led_control_register(uint8_t index, bool enabled); | |||
60 | void IS31FL3736_update_pwm_buffers(uint8_t addr1, uint8_t addr2); | 61 | void IS31FL3736_update_pwm_buffers(uint8_t addr1, uint8_t addr2); |
61 | void IS31FL3736_update_led_control_registers(uint8_t addr1, uint8_t addr2); | 62 | void IS31FL3736_update_led_control_registers(uint8_t addr1, uint8_t addr2); |
62 | 63 | ||
64 | #define PUR_0R 0x00 // No PUR resistor | ||
65 | #define PUR_05KR 0x01 // 0.5k Ohm resistor | ||
66 | #define PUR_1KR 0x02 // 1.0k Ohm resistor | ||
67 | #define PUR_2KR 0x03 // 2.0k Ohm resistor | ||
68 | #define PUR_4KR 0x04 // 4.0k Ohm resistor | ||
69 | #define PUR_8KR 0x05 // 8.0k Ohm resistor | ||
70 | #define PUR_16KR 0x06 // 16k Ohm resistor | ||
71 | #define PUR_32KR 0x07 // 32k Ohm resistor | ||
72 | |||
63 | #define A_1 0x00 | 73 | #define A_1 0x00 |
64 | #define A_2 0x02 | 74 | #define A_2 0x02 |
65 | #define A_3 0x04 | 75 | #define A_3 0x04 |
diff --git a/drivers/led/issi/is31fl3737.c b/drivers/led/issi/is31fl3737.c index 0bb4ddd42..62862e0d4 100644 --- a/drivers/led/issi/is31fl3737.c +++ b/drivers/led/issi/is31fl3737.c | |||
@@ -1,6 +1,7 @@ | |||
1 | /* Copyright 2017 Jason Williams | 1 | /* Copyright 2017 Jason Williams |
2 | * Copyright 2018 Jack Humbert | 2 | * Copyright 2018 Jack Humbert |
3 | * Copyright 2018 Yiancar | 3 | * Copyright 2018 Yiancar |
4 | * Copyright 2021 Doni Crosby | ||
4 | * | 5 | * |
5 | * This program is free software: you can redistribute it and/or modify | 6 | * This program is free software: you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
@@ -56,6 +57,14 @@ | |||
56 | # define ISSI_PERSISTENCE 0 | 57 | # define ISSI_PERSISTENCE 0 |
57 | #endif | 58 | #endif |
58 | 59 | ||
60 | #ifndef ISSI_SWPULLUP | ||
61 | # define ISSI_SWPULLUP PUR_0R | ||
62 | #endif | ||
63 | |||
64 | #ifndef ISSI_CSPULLUP | ||
65 | # define ISSI_CSPULLUP PUR_0R | ||
66 | #endif | ||
67 | |||
59 | // Transfer buffer for TWITransmitData() | 68 | // Transfer buffer for TWITransmitData() |
60 | uint8_t g_twi_transfer_buffer[20]; | 69 | uint8_t g_twi_transfer_buffer[20]; |
61 | 70 | ||
@@ -143,6 +152,10 @@ void IS31FL3737_init(uint8_t addr) { | |||
143 | 152 | ||
144 | // Select PG3 | 153 | // Select PG3 |
145 | IS31FL3737_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_FUNCTION); | 154 | IS31FL3737_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_FUNCTION); |
155 | // Set de-ghost pull-up resistors (SWx) | ||
156 | IS31FL3737_write_register(addr, ISSI_REG_SWPULLUP, ISSI_SWPULLUP); | ||
157 | // Set de-ghost pull-down resistors (CSx) | ||
158 | IS31FL3737_write_register(addr, ISSI_REG_CSPULLUP, ISSI_CSPULLUP); | ||
146 | // Set global current to maximum. | 159 | // Set global current to maximum. |
147 | IS31FL3737_write_register(addr, ISSI_REG_GLOBALCURRENT, 0xFF); | 160 | IS31FL3737_write_register(addr, ISSI_REG_GLOBALCURRENT, 0xFF); |
148 | // Disable software shutdown. | 161 | // Disable software shutdown. |
diff --git a/drivers/led/issi/is31fl3737.h b/drivers/led/issi/is31fl3737.h index 06886e9c9..97917f1d4 100644 --- a/drivers/led/issi/is31fl3737.h +++ b/drivers/led/issi/is31fl3737.h | |||
@@ -1,6 +1,7 @@ | |||
1 | /* Copyright 2017 Jason Williams | 1 | /* Copyright 2017 Jason Williams |
2 | * Copyright 2018 Jack Humbert | 2 | * Copyright 2018 Jack Humbert |
3 | * Copyright 2018 Yiancar | 3 | * Copyright 2018 Yiancar |
4 | * Copyright 2021 Doni Crosby | ||
4 | * | 5 | * |
5 | * This program is free software: you can redistribute it and/or modify | 6 | * This program is free software: you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
@@ -47,6 +48,15 @@ void IS31FL3737_set_led_control_register(uint8_t index, bool red, bool green, bo | |||
47 | void IS31FL3737_update_pwm_buffers(uint8_t addr1, uint8_t addr2); | 48 | void IS31FL3737_update_pwm_buffers(uint8_t addr1, uint8_t addr2); |
48 | void IS31FL3737_update_led_control_registers(uint8_t addr1, uint8_t addr2); | 49 | void IS31FL3737_update_led_control_registers(uint8_t addr1, uint8_t addr2); |
49 | 50 | ||
51 | #define PUR_0R 0x00 // No PUR resistor | ||
52 | #define PUR_05KR 0x01 // 0.5k Ohm resistor in t_NOL | ||
53 | #define PUR_1KR 0x02 // 1.0k Ohm resistor in t_NOL | ||
54 | #define PUR_2KR 0x03 // 2.0k Ohm resistor in t_NOL | ||
55 | #define PUR_4KR 0x04 // 4.0k Ohm resistor in t_NOL | ||
56 | #define PUR_8KR 0x05 // 8.0k Ohm resistor in t_NOL | ||
57 | #define PUR_16KR 0x06 // 16k Ohm resistor in t_NOL | ||
58 | #define PUR_32KR 0x07 // 32k Ohm resistor in t_NOL | ||
59 | |||
50 | #define A_1 0x00 | 60 | #define A_1 0x00 |
51 | #define A_2 0x01 | 61 | #define A_2 0x01 |
52 | #define A_3 0x02 | 62 | #define A_3 0x02 |
diff --git a/drivers/led/issi/is31fl3741.c b/drivers/led/issi/is31fl3741.c index 24a273514..5084f3b9f 100644 --- a/drivers/led/issi/is31fl3741.c +++ b/drivers/led/issi/is31fl3741.c | |||
@@ -61,6 +61,14 @@ | |||
61 | # define ISSI_PERSISTENCE 0 | 61 | # define ISSI_PERSISTENCE 0 |
62 | #endif | 62 | #endif |
63 | 63 | ||
64 | #ifndef ISSI_SWPULLUP | ||
65 | # define ISSI_SWPULLUP PUR_32KR | ||
66 | #endif | ||
67 | |||
68 | #ifndef ISSI_CSPULLUP | ||
69 | # define ISSI_CSPULLUP PUR_32KR | ||
70 | #endif | ||
71 | |||
64 | #define ISSI_MAX_LEDS 351 | 72 | #define ISSI_MAX_LEDS 351 |
65 | 73 | ||
66 | // Transfer buffer for TWITransmitData() | 74 | // Transfer buffer for TWITransmitData() |
@@ -157,7 +165,7 @@ void IS31FL3741_init(uint8_t addr) { | |||
157 | // Set Golbal Current Control Register | 165 | // Set Golbal Current Control Register |
158 | IS31FL3741_write_register(addr, ISSI_REG_GLOBALCURRENT, 0xFF); | 166 | IS31FL3741_write_register(addr, ISSI_REG_GLOBALCURRENT, 0xFF); |
159 | // Set Pull up & Down for SWx CSy | 167 | // Set Pull up & Down for SWx CSy |
160 | IS31FL3741_write_register(addr, ISSI_REG_PULLDOWNUP, 0x77); | 168 | IS31FL3741_write_register(addr, ISSI_REG_PULLDOWNUP, ((ISSI_CSPULLUP << 4) | ISSI_SWPULLUP)); |
161 | 169 | ||
162 | // IS31FL3741_update_led_scaling_registers(addr, 0xFF, 0xFF, 0xFF); | 170 | // IS31FL3741_update_led_scaling_registers(addr, 0xFF, 0xFF, 0xFF); |
163 | 171 | ||
diff --git a/drivers/led/issi/is31fl3741.h b/drivers/led/issi/is31fl3741.h index 163a03523..563022b9b 100644 --- a/drivers/led/issi/is31fl3741.h +++ b/drivers/led/issi/is31fl3741.h | |||
@@ -51,6 +51,15 @@ void IS31FL3741_set_scaling_registers(const is31_led *pled, uint8_t red, uint8_t | |||
51 | 51 | ||
52 | void IS31FL3741_set_pwm_buffer(const is31_led *pled, uint8_t red, uint8_t green, uint8_t blue); | 52 | void IS31FL3741_set_pwm_buffer(const is31_led *pled, uint8_t red, uint8_t green, uint8_t blue); |
53 | 53 | ||
54 | #define PUR_0R 0x00 // No PUR resistor | ||
55 | #define PUR_05KR 0x01 // 0.5k Ohm resistor | ||
56 | #define PUR_1KR 0x02 // 1.0k Ohm resistor | ||
57 | #define PUR_2KR 0x03 // 2.0k Ohm resistor | ||
58 | #define PUR_4KR 0x04 // 4.0k Ohm resistor | ||
59 | #define PUR_8KR 0x05 // 8.0k Ohm resistor | ||
60 | #define PUR_16KR 0x06 // 16k Ohm resistor | ||
61 | #define PUR_32KR 0x07 // 32k Ohm resistor | ||
62 | |||
54 | #define CS1_SW1 0x00 | 63 | #define CS1_SW1 0x00 |
55 | #define CS2_SW1 0x01 | 64 | #define CS2_SW1 0x01 |
56 | #define CS3_SW1 0x02 | 65 | #define CS3_SW1 0x02 |