diff options
Diffstat (limited to 'docs/feature_rgb_matrix.md')
| -rw-r--r-- | docs/feature_rgb_matrix.md | 277 |
1 files changed, 187 insertions, 90 deletions
diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index 08d5c9c4c..42a57aec1 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md | |||
| @@ -52,7 +52,7 @@ Here is an example using 2 drivers. | |||
| 52 | Define these arrays listing all the LEDs in your `<keyboard>.c`: | 52 | Define these arrays listing all the LEDs in your `<keyboard>.c`: |
| 53 | 53 | ||
| 54 | ```c | 54 | ```c |
| 55 | const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { | 55 | const is31_led __flash g_is31_leds[DRIVER_LED_TOTAL] = { |
| 56 | /* Refer to IS31 manual for these locations | 56 | /* Refer to IS31 manual for these locations |
| 57 | * driver | 57 | * driver |
| 58 | * | R location | 58 | * | R location |
| @@ -64,7 +64,7 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { | |||
| 64 | } | 64 | } |
| 65 | ``` | 65 | ``` |
| 66 | 66 | ||
| 67 | Where `Cx_y` is the location of the LED in the matrix defined by [the datasheet](https://www.issi.com/WW/pdf/31FL3731.pdf) and the header file `drivers/issi/is31fl3731.h`. The `driver` is the index of the driver you defined in your `config.h` (`0`, `1`, `2`, or `3`). | 67 | Where `Cx_y` is the location of the LED in the matrix defined by [the datasheet](https://www.issi.com/WW/pdf/31FL3731.pdf) and the header file `drivers/led/issi/is31fl3731.h`. The `driver` is the index of the driver you defined in your `config.h` (`0`, `1`, `2`, or `3`). |
| 68 | 68 | ||
| 69 | --- | 69 | --- |
| 70 | ### IS31FL3733 :id=is31fl3733 | 70 | ### IS31FL3733 :id=is31fl3733 |
| @@ -122,7 +122,7 @@ Currently only 4 drivers are supported, but it would be trivial to support all 8 | |||
| 122 | Define these arrays listing all the LEDs in your `<keyboard>.c`: | 122 | Define these arrays listing all the LEDs in your `<keyboard>.c`: |
| 123 | 123 | ||
| 124 | ```c | 124 | ```c |
| 125 | const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { | 125 | const is31_led __flash g_is31_leds[DRIVER_LED_TOTAL] = { |
| 126 | /* Refer to IS31 manual for these locations | 126 | /* Refer to IS31 manual for these locations |
| 127 | * driver | 127 | * driver |
| 128 | * | R location | 128 | * | R location |
| @@ -134,7 +134,7 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { | |||
| 134 | } | 134 | } |
| 135 | ``` | 135 | ``` |
| 136 | 136 | ||
| 137 | Where `X_Y` is the location of the LED in the matrix defined by [the datasheet](https://www.issi.com/WW/pdf/31FL3733.pdf) and the header file `drivers/issi/is31fl3733.h`. The `driver` is the index of the driver you defined in your `config.h` (`0`, `1`, `2`, or `3` for now). | 137 | Where `X_Y` is the location of the LED in the matrix defined by [the datasheet](https://www.issi.com/WW/pdf/31FL3733.pdf) and the header file `drivers/led/issi/is31fl3733.h`. The `driver` is the index of the driver you defined in your `config.h` (`0`, `1`, `2`, or `3` for now). |
| 138 | 138 | ||
| 139 | --- | 139 | --- |
| 140 | ### IS31FL3737 :id=is31fl3737 | 140 | ### IS31FL3737 :id=is31fl3737 |
| @@ -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,19 +172,21 @@ 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 | ||
| 173 | ```c | 188 | ```c |
| 174 | const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { | 189 | const is31_led __flash g_is31_leds[DRIVER_LED_TOTAL] = { |
| 175 | /* Refer to IS31 manual for these locations | 190 | /* Refer to IS31 manual for these locations |
| 176 | * driver | 191 | * driver |
| 177 | * | R location | 192 | * | R location |
| @@ -183,7 +198,7 @@ const is31_led 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/led/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 | ||
| @@ -228,6 +243,75 @@ Configure the hardware via your `config.h`: | |||
| 228 | ``` | 243 | ``` |
| 229 | 244 | ||
| 230 | --- | 245 | --- |
| 246 | ### AW20216 :id=aw20216 | ||
| 247 | There is basic support for addressable RGB matrix lighting with the SPI AW20216 RGB controller. To enable it, add this to your `rules.mk`: | ||
| 248 | |||
| 249 | ```makefile | ||
| 250 | RGB_MATRIX_ENABLE = yes | ||
| 251 | RGB_MATRIX_DRIVER = AW20216 | ||
| 252 | ``` | ||
| 253 | |||
| 254 | You can use up to 2 AW20216 IC's. Do not specify `DRIVER_<N>_xxx` defines for IC's that are not present on your keyboard. You can define the following items in `config.h`: | ||
| 255 | |||
| 256 | | Variable | Description | Default | | ||
| 257 | |----------|-------------|---------| | ||
| 258 | | `DRIVER_1_CS` | (Required) MCU pin connected to first RGB driver chip select line | B13 | | ||
| 259 | | `DRIVER_2_CS` | (Optional) MCU pin connected to second RGB driver chip select line | | | ||
| 260 | | `DRIVER_1_EN` | (Required) MCU pin connected to first RGB driver hardware enable line | C13 | | ||
| 261 | | `DRIVER_2_EN` | (Optional) MCU pin connected to second RGB driver hardware enable line | | | ||
| 262 | | `DRIVER_1_LED_TOTAL` | (Required) How many RGB lights are connected to first RGB driver | | | ||
| 263 | | `DRIVER_2_LED_TOTAL` | (Optional) How many RGB lights are connected to second RGB driver | | | ||
| 264 | | `DRIVER_COUNT` | (Required) How many RGB driver IC's are present | | | ||
| 265 | | `DRIVER_LED_TOTAL` | (Required) How many RGB lights are present across all drivers | | | ||
| 266 | | `AW_SCALING_MAX` | (Optional) LED current scaling value (0-255, higher values mean LED is brighter at full PWM) | 150 | | ||
| 267 | | `AW_GLOBAL_CURRENT_MAX` | (Optional) Driver global current limit (0-255, higher values means the driver may consume more power) | 150 | | ||
| 268 | | `AW_SPI_DIVISOR` | (Optional) Clock divisor for SPI communication (powers of 2, smaller numbers means faster communication, should not be less than 4) | 4 | | ||
| 269 | |||
| 270 | Here is an example using 2 drivers. | ||
| 271 | |||
| 272 | ```c | ||
| 273 | #define DRIVER_1_CS B13 | ||
| 274 | #define DRIVER_2_CS B14 | ||
| 275 | // Hardware enable lines may be connected to the same pin | ||
| 276 | #define DRIVER_1_EN C13 | ||
| 277 | #define DRIVER_2_EN C13 | ||
| 278 | |||
| 279 | #define DRIVER_COUNT 2 | ||
| 280 | #define DRIVER_1_LED_TOTAL 66 | ||
| 281 | #define DRIVER_2_LED_TOTAL 32 | ||
| 282 | #define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) | ||
| 283 | ``` | ||
| 284 | |||
| 285 | !> 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`. | ||
| 286 | |||
| 287 | Define these arrays listing all the LEDs in your `<keyboard>.c`: | ||
| 288 | |||
| 289 | ```c | ||
| 290 | const aw_led __flash g_aw_leds[DRIVER_LED_TOTAL] = { | ||
| 291 | /* Each AW20216 channel is controlled by a register at some offset between 0x00 | ||
| 292 | * and 0xD7 inclusive. | ||
| 293 | * See drivers/awinic/aw20216.h for the mapping between register offsets and | ||
| 294 | * driver pin locations. | ||
| 295 | * driver | ||
| 296 | * | R location | ||
| 297 | * | | G location | ||
| 298 | * | | | B location | ||
| 299 | * | | | | */ | ||
| 300 | { 0, CS1_SW1, CS2_SW1, CS3_SW1 }, | ||
| 301 | { 0, CS4_SW1, CS5_SW1, CS6_SW1 }, | ||
| 302 | { 0, CS7_SW1, CS8_SW1, CS9_SW1 }, | ||
| 303 | { 0, CS10_SW1, CS11_SW1, CS12_SW1 }, | ||
| 304 | { 0, CS13_SW1, CS14_SW1, CS15_SW1 }, | ||
| 305 | ... | ||
| 306 | { 1, CS1_SW1, CS2_SW1, CS3_SW1 }, | ||
| 307 | { 1, CS13_SW1, CS14_SW1, CS15_SW1 }, | ||
| 308 | { 1, CS16_SW1, CS17_SW1, CS18_SW1 }, | ||
| 309 | { 1, CS4_SW2, CS5_SW2, CS6_SW2 }, | ||
| 310 | ... | ||
| 311 | }; | ||
| 312 | ``` | ||
| 313 | |||
| 314 | --- | ||
| 231 | 315 | ||
| 232 | ## Common Configuration :id=common-configuration | 316 | ## Common Configuration :id=common-configuration |
| 233 | 317 | ||
| @@ -364,46 +448,46 @@ You can disable a single effect by defining `DISABLE_[EFFECT_NAME]` in your `con | |||
| 364 | 448 | ||
| 365 | |Define |Description | | 449 | |Define |Description | |
| 366 | |-------------------------------------------------------|-----------------------------------------------| | 450 | |-------------------------------------------------------|-----------------------------------------------| |
| 367 | |`#define DISABLE_RGB_MATRIX_ALPHAS_MODS` |Disables `RGB_MATRIX_ALPHAS_MODS` | | 451 | |`#define ENABLE_RGB_MATRIX_ALPHAS_MODS` |Enables `RGB_MATRIX_ALPHAS_MODS` | |
| 368 | |`#define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN` |Disables `RGB_MATRIX_GRADIENT_UP_DOWN` | | 452 | |`#define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN` |Enables `RGB_MATRIX_GRADIENT_UP_DOWN` | |
| 369 | |`#define DISABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT` |Disables `MATRIX_GRADIENT_LEFT_RIGHT` | | 453 | |`#define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT` |Enables `MATRIX_GRADIENT_LEFT_RIGHT` | |
| 370 | |`#define DISABLE_RGB_MATRIX_BREATHING` |Disables `RGB_MATRIX_BREATHING` | | 454 | |`#define ENABLE_RGB_MATRIX_BREATHING` |Enables `RGB_MATRIX_BREATHING` | |
| 371 | |`#define DISABLE_RGB_MATRIX_BAND_SAT` |Disables `RGB_MATRIX_BAND_SAT` | | 455 | |`#define ENABLE_RGB_MATRIX_BAND_SAT` |Enables `RGB_MATRIX_BAND_SAT` | |
| 372 | |`#define DISABLE_RGB_MATRIX_BAND_VAL` |Disables `RGB_MATRIX_BAND_VAL` | | 456 | |`#define ENABLE_RGB_MATRIX_BAND_VAL` |Enables `RGB_MATRIX_BAND_VAL` | |
| 373 | |`#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT` |Disables `RGB_MATRIX_BAND_PINWHEEL_SAT` | | 457 | |`#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT` |Enables `RGB_MATRIX_BAND_PINWHEEL_SAT` | |
| 374 | |`#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL` |Disables `RGB_MATRIX_BAND_PINWHEEL_VAL` | | 458 | |`#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL` |Enables `RGB_MATRIX_BAND_PINWHEEL_VAL` | |
| 375 | |`#define DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT` |Disables `RGB_MATRIX_BAND_SPIRAL_SAT` | | 459 | |`#define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT` |Enables `RGB_MATRIX_BAND_SPIRAL_SAT` | |
| 376 | |`#define DISABLE_RGB_MATRIX_BAND_SPIRAL_VAL` |Disables `RGB_MATRIX_BAND_SPIRAL_VAL` | | 460 | |`#define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL` |Enables `RGB_MATRIX_BAND_SPIRAL_VAL` | |
| 377 | |`#define DISABLE_RGB_MATRIX_CYCLE_ALL` |Disables `RGB_MATRIX_CYCLE_ALL` | | 461 | |`#define ENABLE_RGB_MATRIX_CYCLE_ALL` |Enables `RGB_MATRIX_CYCLE_ALL` | |
| 378 | |`#define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT` |Disables `RGB_MATRIX_CYCLE_LEFT_RIGHT` | | 462 | |`#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT` |Enables `RGB_MATRIX_CYCLE_LEFT_RIGHT` | |
| 379 | |`#define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN` |Disables `RGB_MATRIX_CYCLE_UP_DOWN` | | 463 | |`#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN` |Enables `RGB_MATRIX_CYCLE_UP_DOWN` | |
| 380 | |`#define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON` |Disables `RGB_MATRIX_RAINBOW_MOVING_CHEVRON` | | 464 | |`#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON` |Enables `RGB_MATRIX_RAINBOW_MOVING_CHEVRON` | |
| 381 | |`#define DISABLE_RGB_MATRIX_CYCLE_OUT_IN` |Disables `RGB_MATRIX_CYCLE_OUT_IN` | | 465 | |`#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN` |Enables `RGB_MATRIX_CYCLE_OUT_IN` | |
| 382 | |`#define DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL` |Disables `RGB_MATRIX_CYCLE_OUT_IN_DUAL` | | 466 | |`#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL` |Enables `RGB_MATRIX_CYCLE_OUT_IN_DUAL` | |
| 383 | |`#define DISABLE_RGB_MATRIX_CYCLE_PINWHEEL` |Disables `RGB_MATRIX_CYCLE_PINWHEEL` | | 467 | |`#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL` |Enables `RGB_MATRIX_CYCLE_PINWHEEL` | |
| 384 | |`#define DISABLE_RGB_MATRIX_CYCLE_SPIRAL` |Disables `RGB_MATRIX_CYCLE_SPIRAL` | | 468 | |`#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL` |Enables `RGB_MATRIX_CYCLE_SPIRAL` | |
| 385 | |`#define DISABLE_RGB_MATRIX_DUAL_BEACON` |Disables `RGB_MATRIX_DUAL_BEACON` | | 469 | |`#define ENABLE_RGB_MATRIX_DUAL_BEACON` |Enables `RGB_MATRIX_DUAL_BEACON` | |
| 386 | |`#define DISABLE_RGB_MATRIX_RAINBOW_BEACON` |Disables `RGB_MATRIX_RAINBOW_BEACON` | | 470 | |`#define ENABLE_RGB_MATRIX_RAINBOW_BEACON` |Enables `RGB_MATRIX_RAINBOW_BEACON` | |
| 387 | |`#define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS` |Disables `RGB_MATRIX_RAINBOW_PINWHEELS` | | 471 | |`#define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS` |Enables `RGB_MATRIX_RAINBOW_PINWHEELS` | |
| 388 | |`#define DISABLE_RGB_MATRIX_RAINDROPS` |Disables `RGB_MATRIX_RAINDROPS` | | 472 | |`#define ENABLE_RGB_MATRIX_RAINDROPS` |Enables `RGB_MATRIX_RAINDROPS` | |
| 389 | |`#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS` |Disables `RGB_MATRIX_JELLYBEAN_RAINDROPS` | | 473 | |`#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS` |Enables `RGB_MATRIX_JELLYBEAN_RAINDROPS` | |
| 390 | |`#define DISABLE_RGB_MATRIX_HUE_BREATHING` |Disables `RGB_MATRIX_HUE_BREATHING` | | 474 | |`#define ENABLE_RGB_MATRIX_HUE_BREATHING` |Enables `RGB_MATRIX_HUE_BREATHING` | |
| 391 | |`#define DISABLE_RGB_MATRIX_HUE_PENDULUM` |Disables `RGB_MATRIX_HUE_PENDULUM` | | 475 | |`#define ENABLE_RGB_MATRIX_HUE_PENDULUM` |Enables `RGB_MATRIX_HUE_PENDULUM` | |
| 392 | |`#define DISABLE_RGB_MATRIX_HUE_WAVE ` |Disables `RGB_MATRIX_HUE_WAVE ` | | 476 | |`#define ENABLE_RGB_MATRIX_HUE_WAVE ` |Enables `RGB_MATRIX_HUE_WAVE ` | |
| 393 | |`#define DISABLE_RGB_MATRIX_TYPING_HEATMAP` |Disables `RGB_MATRIX_TYPING_HEATMAP` | | 477 | |`#define ENABLE_RGB_MATRIX_TYPING_HEATMAP` |Enables `RGB_MATRIX_TYPING_HEATMAP` | |
| 394 | |`#define DISABLE_RGB_MATRIX_DIGITAL_RAIN` |Disables `RGB_MATRIX_DIGITAL_RAIN` | | 478 | |`#define ENABLE_RGB_MATRIX_DIGITAL_RAIN` |Enables `RGB_MATRIX_DIGITAL_RAIN` | |
| 395 | |`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE` |Disables `RGB_MATRIX_SOLID_REACTIVE_SIMPLE` | | 479 | |`#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE` |Enables `RGB_MATRIX_SOLID_REACTIVE_SIMPLE` | |
| 396 | |`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE` |Disables `RGB_MATRIX_SOLID_REACTIVE` | | 480 | |`#define ENABLE_RGB_MATRIX_SOLID_REACTIVE` |Enables `RGB_MATRIX_SOLID_REACTIVE` | |
| 397 | |`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE` |Disables `RGB_MATRIX_SOLID_REACTIVE_WIDE` | | 481 | |`#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE` |Enables `RGB_MATRIX_SOLID_REACTIVE_WIDE` | |
| 398 | |`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE` |Disables `RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE` | | 482 | |`#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE` |Enables `RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE` | |
| 399 | |`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS` |Disables `RGB_MATRIX_SOLID_REACTIVE_CROSS` | | 483 | |`#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS` |Enables `RGB_MATRIX_SOLID_REACTIVE_CROSS` | |
| 400 | |`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS` |Disables `RGB_MATRIX_SOLID_REACTIVE_MULTICROSS`| | 484 | |`#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS` |Enables `RGB_MATRIX_SOLID_REACTIVE_MULTICROSS`| |
| 401 | |`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS` |Disables `RGB_MATRIX_SOLID_REACTIVE_NEXUS` | | 485 | |`#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS` |Enables `RGB_MATRIX_SOLID_REACTIVE_NEXUS` | |
| 402 | |`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS` |Disables `RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS`| | 486 | |`#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS` |Enables `RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS`| |
| 403 | |`#define DISABLE_RGB_MATRIX_SPLASH` |Disables `RGB_MATRIX_SPLASH` | | 487 | |`#define ENABLE_RGB_MATRIX_SPLASH` |Enables `RGB_MATRIX_SPLASH` | |
| 404 | |`#define DISABLE_RGB_MATRIX_MULTISPLASH` |Disables `RGB_MATRIX_MULTISPLASH` | | 488 | |`#define ENABLE_RGB_MATRIX_MULTISPLASH` |Enables `RGB_MATRIX_MULTISPLASH` | |
| 405 | |`#define DISABLE_RGB_MATRIX_SOLID_SPLASH` |Disables `RGB_MATRIX_SOLID_SPLASH` | | 489 | |`#define ENABLE_RGB_MATRIX_SOLID_SPLASH` |Enables `RGB_MATRIX_SOLID_SPLASH` | |
| 406 | |`#define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH` |Disables `RGB_MATRIX_SOLID_MULTISPLASH` | | 490 | |`#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH` |Enables `RGB_MATRIX_SOLID_MULTISPLASH` | |
| 407 | 491 | ||
| 408 | ### RGB Matrix Effect Typing Heatmap :id=rgb-matrix-effect-typing-heatmap | 492 | ### RGB Matrix Effect Typing Heatmap :id=rgb-matrix-effect-typing-heatmap |
| 409 | 493 | ||
| @@ -485,28 +569,29 @@ For inspiration and examples, check out the built-in effects under `quantum/rgb_ | |||
| 485 | 569 | ||
| 486 | These are shorthands to popular colors. The `RGB` ones can be passed to the `setrgb` functions, while the `HSV` ones to the `sethsv` functions. | 570 | These are shorthands to popular colors. The `RGB` ones can be passed to the `setrgb` functions, while the `HSV` ones to the `sethsv` functions. |
| 487 | 571 | ||
| 488 | |RGB |HSV | | 572 | |RGB |HSV | |
| 489 | |-------------------|-------------------| | 573 | |---------------------|---------------------| |
| 490 | |`RGB_WHITE` |`HSV_WHITE` | | 574 | |`RGB_AZURE` |`HSV_AZURE` | |
| 491 | |`RGB_RED` |`HSV_RED` | | 575 | |`RGB_BLACK`/`RGB_OFF`|`HSV_BLACK`/`HSV_OFF`| |
| 492 | |`RGB_CORAL` |`HSV_CORAL` | | 576 | |`RGB_BLUE` |`HSV_BLUE` | |
| 493 | |`RGB_ORANGE` |`HSV_ORANGE` | | 577 | |`RGB_CHARTREUSE` |`HSV_CHARTREUSE` | |
| 494 | |`RGB_GOLDENROD` |`HSV_GOLDENROD` | | 578 | |`RGB_CORAL` |`HSV_CORAL` | |
| 495 | |`RGB_GOLD` |`HSV_GOLD` | | 579 | |`RGB_CYAN` |`HSV_CYAN` | |
| 496 | |`RGB_YELLOW` |`HSV_YELLOW` | | 580 | |`RGB_GOLD` |`HSV_GOLD` | |
| 497 | |`RGB_CHARTREUSE` |`HSV_CHARTREUSE` | | 581 | |`RGB_GOLDENROD` |`HSV_GOLDENROD` | |
| 498 | |`RGB_GREEN` |`HSV_GREEN` | | 582 | |`RGB_GREEN` |`HSV_GREEN` | |
| 499 | |`RGB_SPRINGGREEN` |`HSV_SPRINGGREEN` | | 583 | |`RGB_MAGENTA` |`HSV_MAGENTA` | |
| 500 | |`RGB_TURQUOISE` |`HSV_TURQUOISE` | | 584 | |`RGB_ORANGE` |`HSV_ORANGE` | |
| 501 | |`RGB_TEAL` |`HSV_TEAL` | | 585 | |`RGB_PINK` |`HSV_PINK` | |
| 502 | |`RGB_CYAN` |`HSV_CYAN` | | 586 | |`RGB_PURPLE` |`HSV_PURPLE` | |
| 503 | |`RGB_AZURE` |`HSV_AZURE` | | 587 | |`RGB_RED` |`HSV_RED` | |
| 504 | |`RGB_BLUE` |`HSV_BLUE` | | 588 | |`RGB_SPRINGGREEN` |`HSV_SPRINGGREEN` | |
| 505 | |`RGB_PURPLE` |`HSV_PURPLE` | | 589 | |`RGB_TEAL` |`HSV_TEAL` | |
| 506 | |`RGB_MAGENTA` |`HSV_MAGENTA` | | 590 | |`RGB_TURQUOISE` |`HSV_TURQUOISE` | |
| 507 | |`RGB_PINK` |`HSV_PINK` | | 591 | |`RGB_WHITE` |`HSV_WHITE` | |
| 508 | 592 | |`RGB_YELLOW` |`HSV_YELLOW` | | |
| 509 | These are defined in [`rgblight_list.h`](https://github.com/qmk/qmk_firmware/blob/master/quantum/rgblight_list.h). Feel free to add to this list! | 593 | |
| 594 | These are defined in [`color.h`](https://github.com/qmk/qmk_firmware/blob/master/quantum/color.h). Feel free to add to this list! | ||
| 510 | 595 | ||
| 511 | 596 | ||
| 512 | ## Additional `config.h` Options :id=additional-configh-options | 597 | ## Additional `config.h` Options :id=additional-configh-options |
| @@ -657,29 +742,41 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { | |||
| 657 | } | 742 | } |
| 658 | ``` | 743 | ``` |
| 659 | 744 | ||
| 660 | ### Suspended state :id=suspended-state | 745 | #### Examples :id=indicator-examples |
| 661 | To use the suspend feature, make sure that `#define RGB_DISABLE_WHEN_USB_SUSPENDED true` is added to the `config.h` file. | ||
| 662 | 746 | ||
| 663 | Additionally add this to your `<keyboard>.c`: | 747 | This example sets the modifiers to be a specific color based on the layer state. You can use a switch case here, instead, if you would like. This uses HSV and then converts to RGB, because this allows the brightness to be limited (important when using the WS2812 driver). |
| 664 | 748 | ||
| 665 | ```c | 749 | ```c |
| 666 | void suspend_power_down_kb(void) { | 750 | void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { |
| 667 | rgb_matrix_set_suspend_state(true); | 751 | HSV hsv = {0, 255, 255}; |
| 668 | suspend_power_down_user(); | 752 | |
| 669 | } | 753 | if (layer_state_is(layer_state, 2)) { |
| 670 | 754 | hsv = {130, 255, 255}; | |
| 671 | void suspend_wakeup_init_kb(void) { | 755 | } else { |
| 672 | rgb_matrix_set_suspend_state(false); | 756 | hsv = {30, 255, 255}; |
| 673 | suspend_wakeup_init_user(); | 757 | } |
| 758 | |||
| 759 | if (hsv.v > rgb_matrix_get_val()) { | ||
| 760 | hsv.v = rgb_matrix_get_val(); | ||
| 761 | } | ||
| 762 | RGB rgb = hsv_to_rgb(hsv); | ||
| 763 | |||
| 764 | for (uint8_t i = led_min; i <= led_max; i++) { | ||
| 765 | if (HAS_FLAGS(g_led_config.flags[i], 0x01)) { // 0x01 == LED_FLAG_MODIFIER | ||
| 766 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); | ||
| 767 | } | ||
| 768 | } | ||
| 674 | } | 769 | } |
| 675 | ``` | 770 | ``` |
| 676 | or add this to your `keymap.c`: | ||
| 677 | ```c | ||
| 678 | void suspend_power_down_user(void) { | ||
| 679 | rgb_matrix_set_suspend_state(true); | ||
| 680 | } | ||
| 681 | 771 | ||
| 682 | void suspend_wakeup_init_user(void) { | 772 | 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: |
| 683 | rgb_matrix_set_suspend_state(false); | 773 | |
| 774 | ```c | ||
| 775 | void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { | ||
| 776 | if (host_keyboard_led_state().caps_lock) { | ||
| 777 | RGB_MATRIX_INDICATOR_SET_COLOR(5, 255, 255, 255); // assuming caps lock is at led #5 | ||
| 778 | } else { | ||
| 779 | RGB_MATRIX_INDICATOR_SET_COLOR(5, 0, 0, 0); | ||
| 780 | } | ||
| 684 | } | 781 | } |
| 685 | ``` | 782 | ``` |
