diff options
author | Chris Cullin <chris@miplace.com> | 2021-07-16 07:52:05 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-15 22:52:05 +0100 |
commit | 70267b35c357f2744262300db03eafe642159734 (patch) | |
tree | 954f0ed828294d30c4beed4c02a00cb7ad507c60 /docs/feature_rgb_matrix.md | |
parent | e07401bb5ac4f0e23aac8c943d9f03fa257834a3 (diff) | |
download | qmk_firmware-70267b35c357f2744262300db03eafe642159734.tar.gz qmk_firmware-70267b35c357f2744262300db03eafe642159734.zip |
Dual RGB Matrix IS31FL3737 driver support to address #13442 (#13457)
* initial commit
* removed changes to write_pwm_buffer
* backward compatbility added
* fixed issue with backward compatibility
* documentation update
* removed unneccessary comment. branched from master
* updated per comments #13457
* removed blank line
* cformat on diff files
Diffstat (limited to 'docs/feature_rgb_matrix.md')
-rw-r--r-- | docs/feature_rgb_matrix.md | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index be763ee02..f3e25f2f1 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md | |||
@@ -145,9 +145,22 @@ There is basic support for addressable RGB matrix lighting with the I2C IS31FL37 | |||
145 | RGB_MATRIX_ENABLE = yes | 145 | RGB_MATRIX_ENABLE = yes |
146 | RGB_MATRIX_DRIVER = IS31FL3737 | 146 | RGB_MATRIX_DRIVER = IS31FL3737 |
147 | ``` | 147 | ``` |
148 | You can use between 1 and 2 IS31FL3737 IC's. Do not specify `DRIVER_ADDR_2` define for second IC if not present on your keyboard. | ||
148 | 149 | ||
149 | Configure the hardware via your `config.h`: | 150 | Configure the hardware via your `config.h`: |
150 | 151 | ||
152 | | Variable | Description | Default | | ||
153 | |----------|-------------|---------| | ||
154 | | `ISSI_TIMEOUT` | (Optional) How long to wait for i2c messages, in milliseconds | 100 | | ||
155 | | `ISSI_PERSISTENCE` | (Optional) Retry failed messages this many times | 0 | | ||
156 | | `DRIVER_COUNT` | (Required) How many RGB driver IC's are present | | | ||
157 | | `DRIVER_LED_TOTAL` | (Required) How many RGB lights are present across all drivers | | | ||
158 | | `DRIVER_ADDR_1` | (Required) Address for the first RGB driver | | | ||
159 | | `DRIVER_ADDR_2` | (Optional) Address for the second RGB driver | | | ||
160 | |||
161 | |||
162 | Here is an example using 2 drivers. | ||
163 | |||
151 | ```c | 164 | ```c |
152 | // This is a 7-bit address, that gets left-shifted and bit 0 | 165 | // This is a 7-bit address, that gets left-shifted and bit 0 |
153 | // set to 0 for write, 1 for read (as per I2C protocol) | 166 | // set to 0 for write, 1 for read (as per I2C protocol) |
@@ -159,14 +172,16 @@ Configure the hardware via your `config.h`: | |||
159 | // ADDR represents A3:A0 of the 7-bit address. | 172 | // ADDR represents A3:A0 of the 7-bit address. |
160 | // The result is: 0b101(ADDR) | 173 | // The result is: 0b101(ADDR) |
161 | #define DRIVER_ADDR_1 0b1010000 | 174 | #define DRIVER_ADDR_1 0b1010000 |
162 | #define DRIVER_ADDR_2 0b1010000 // this is here for compliancy reasons. | 175 | #define DRIVER_ADDR_2 0b1010001 |
163 | 176 | ||
164 | #define DRIVER_COUNT 2 | 177 | #define DRIVER_COUNT 2 |
165 | #define DRIVER_1_LED_TOTAL 64 | 178 | #define DRIVER_1_LED_TOTAL 30 |
166 | #define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL | 179 | #define DRIVER_2_LED_TOTAL 36 |
180 | #define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) | ||
167 | ``` | 181 | ``` |
182 | !> 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`. | ||
168 | 183 | ||
169 | Currently only a single drivers is supported, but it would be trivial to support all 4 combinations. For now define `DRIVER_ADDR_2` as `DRIVER_ADDR_1` | 184 | Currently only 2 drivers are supported, but it would be trivial to support all 4 combinations. |
170 | 185 | ||
171 | Define these arrays listing all the LEDs in your `<keyboard>.c`: | 186 | Define these arrays listing all the LEDs in your `<keyboard>.c`: |
172 | 187 | ||
@@ -183,7 +198,7 @@ const is31_led PROGMEM g_is31_leds[DRIVER_LED_TOTAL] = { | |||
183 | } | 198 | } |
184 | ``` | 199 | ``` |
185 | 200 | ||
186 | Where `X_Y` is the location of the LED in the matrix defined by [the datasheet](https://www.issi.com/WW/pdf/31FL3737.pdf) and the header file `drivers/issi/is31fl3737.h`. The `driver` is the index of the driver you defined in your `config.h` (Only `0` right now). | 201 | Where `X_Y` is the location of the LED in the matrix defined by [the datasheet](https://www.issi.com/WW/pdf/31FL3737.pdf) and the header file `drivers/issi/is31fl3737.h`. The `driver` is the index of the driver you defined in your `config.h` (Only `0`, `1` for now). |
187 | 202 | ||
188 | --- | 203 | --- |
189 | 204 | ||