3 This feature allows you to use RGB LED matrices driven by external drivers. It hooks into the RGBLIGHT system so you can use the same keycodes as RGBLIGHT to control it.
5 If you want to use single color LED's you should use the [LED Matrix Subsystem](feature_led_matrix.md) instead.
7 ## Driver configuration
11 There is basic support for addressable RGB matrix lighting with the I2C IS31FL3731 RGB controller. To enable it, add this to your `rules.mk`:
13 RGB_MATRIX_ENABLE = IS31FL3731
15 Configure the hardware via your `config.h`:
17 // This is a 7-bit address, that gets left-shifted and bit 0
18 // set to 0 for write, 1 for read (as per I2C protocol)
19 // The address will vary depending on your wiring:
20 // 0b1110100 AD <-> GND
21 // 0b1110111 AD <-> VCC
22 // 0b1110101 AD <-> SCL
23 // 0b1110110 AD <-> SDA
24 #define DRIVER_ADDR_1 0b1110100
25 #define DRIVER_ADDR_2 0b1110110
27 #define DRIVER_COUNT 2
28 #define DRIVER_1_LED_TOTAL 25
29 #define DRIVER_2_LED_TOTAL 24
30 #define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL
32 Currently only 2 drivers are supported, but it would be trivial to support all 4 combinations.
34 Define these arrays listing all the LEDs in your `<keyboard>.c`:
36 const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
37 /* Refer to IS31 manual for these locations
43 {0, C1_3, C2_3, C3_3},
47 Where `Cx_y` is the location of the LED in the matrix defined by [the datasheet](http://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` or `1` right now).
51 There is basic support for addressable RGB matrix lighting with the I2C IS31FL3733 RGB controller. To enable it, add this to your `rules.mk`:
53 RGB_MATRIX_ENABLE = IS31FL3733
55 Configure the hardware via your `config.h`:
57 // This is a 7-bit address, that gets left-shifted and bit 0
58 // set to 0 for write, 1 for read (as per I2C protocol)
59 // The address will vary depending on your wiring:
64 // ADDR1 represents A1:A0 of the 7-bit address.
65 // ADDR2 represents A3:A2 of the 7-bit address.
66 // The result is: 0b101(ADDR2)(ADDR1)
67 #define DRIVER_ADDR_1 0b1010000
68 #define DRIVER_ADDR_2 0b1010000 // this is here for compliancy reasons.
70 #define DRIVER_COUNT 1
71 #define DRIVER_1_LED_TOTAL 64
72 #define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL
74 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`
76 Define these arrays listing all the LEDs in your `<keyboard>.c`:
78 const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
79 /* Refer to IS31 manual for these locations
89 Where `X_Y` is the location of the LED in the matrix defined by [the datasheet](http://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` (Only `0` right now).
91 From this point forward the configuration is the same for all the drivers.
93 const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
95 * | {x=0..224, y=0..64}
98 {{0|(0<<4)}, {20.36*0, 21.33*0}, 1},
99 {{0|(1<<4)}, {20.36*1, 21.33*0}, 1},
103 The format for the matrix position used in this array is `{row | (col << 4)}`. The `x` is between (inclusive) 0-224, and `y` is between (inclusive) 0-64. The easiest way to calculate these positions is:
105 x = 224 / ( NUMBER_OF_ROWS - 1 ) * ROW_POSITION
106 y = 64 / (NUMBER_OF_COLS - 1 ) * COL_POSITION
108 Where all variables are decimels/floats.
110 `modifier` is a boolean, whether or not a certain key is considered a modifier (used in some effects).
114 All RGB keycodes are currently shared with the RGBLIGHT system:
117 * `RGB_MOD` - cycle through modes
118 * `RGB_HUI` - increase hue
119 * `RGB_HUD` - decrease hue
120 * `RGB_SAI` - increase saturation
121 * `RGB_SAD` - decrease saturation
122 * `RGB_VAI` - increase value
123 * `RGB_VAD` - decrease value
124 * `RGB_SPI` - increase speed effect (no EEPROM support)
125 * `RGB_SPD` - decrease speed effect (no EEPROM support)
128 * `RGB_MODE_*` keycodes will generally work, but are not currently mapped to the correct effects for the RGB Matrix system
130 ## RGB Matrix Effects
132 These are the effects that are currently available:
134 enum rgb_matrix_effects {
135 RGB_MATRIX_SOLID_COLOR = 1,
136 RGB_MATRIX_ALPHAS_MODS,
137 RGB_MATRIX_DUAL_BEACON,
138 RGB_MATRIX_GRADIENT_UP_DOWN,
139 RGB_MATRIX_RAINDROPS,
140 RGB_MATRIX_CYCLE_ALL,
141 RGB_MATRIX_CYCLE_LEFT_RIGHT,
142 RGB_MATRIX_CYCLE_UP_DOWN,
143 RGB_MATRIX_RAINBOW_BEACON,
144 RGB_MATRIX_RAINBOW_PINWHEELS,
145 RGB_MATRIX_RAINBOW_MOVING_CHEVRON,
146 RGB_MATRIX_JELLYBEAN_RAINDROPS,
147 RGB_MATRIX_DIGITAL_RAIN,
148 #ifdef RGB_MATRIX_KEYPRESSES
149 RGB_MATRIX_SOLID_REACTIVE,
151 RGB_MATRIX_MULTISPLASH,
152 RGB_MATRIX_SOLID_SPLASH,
153 RGB_MATRIX_SOLID_MULTISPLASH,
155 RGB_MATRIX_EFFECT_MAX
158 You can disable a single effect by defining `DISABLE_[EFFECT_NAME]` in your `config.h`:
161 |Define |Description |
162 |---------------------------------------------------|--------------------------------------------|
163 |`#define DISABLE_RGB_MATRIX_ALPHAS_MODS` |Disables `RGB_MATRIX_ALPHAS_MODS` |
164 |`#define DISABLE_RGB_MATRIX_DUAL_BEACON` |Disables `RGB_MATRIX_DUAL_BEACON` |
165 |`#define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN` |Disables `RGB_MATRIX_GRADIENT_UP_DOWN` |
166 |`#define DISABLE_RGB_MATRIX_RAINDROPS` |Disables `RGB_MATRIX_RAINDROPS` |
167 |`#define DISABLE_RGB_MATRIX_CYCLE_ALL` |Disables `RGB_MATRIX_CYCLE_ALL` |
168 |`#define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT` |Disables `RGB_MATRIX_CYCLE_LEFT_RIGHT` |
169 |`#define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN` |Disables `RGB_MATRIX_CYCLE_UP_DOWN` |
170 |`#define DISABLE_RGB_MATRIX_RAINBOW_BEACON` |Disables `RGB_MATRIX_RAINBOW_BEACON` |
171 |`#define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS` |Disables `RGB_MATRIX_RAINBOW_PINWHEELS` |
172 |`#define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON`|Disables `RGB_MATRIX_RAINBOW_MOVING_CHEVRON`|
173 |`#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS` |Disables `RGB_MATRIX_JELLYBEAN_RAINDROPS` |
174 |`#define DISABLE_RGB_MATRIX_DIGITAL_RAIN` |Disables `RGB_MATRIX_DIGITAL_RAIN` |
175 |`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE` |Disables `RGB_MATRIX_SOLID_REACTIVE` |
176 |`#define DISABLE_RGB_MATRIX_SPLASH` |Disables `RGB_MATRIX_SPLASH` |
177 |`#define DISABLE_RGB_MATRIX_MULTISPLASH` |Disables `RGB_MATRIX_MULTISPLASH` |
178 |`#define DISABLE_RGB_MATRIX_SOLID_SPLASH` |Disables `RGB_MATRIX_SOLID_SPLASH` |
179 |`#define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH` |Disables `RGB_MATRIX_SOLID_MULTISPLASH` |
182 ## Custom layer effects
184 Custom layer effects can be done by defining this in your `<keyboard>.c`:
186 void rgb_matrix_indicators_kb(void) {
187 rgb_matrix_set_color(index, red, green, blue);
190 A similar function works in the keymap as `rgb_matrix_indicators_user`.
192 ## Additional `config.h` Options
194 #define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot)
195 #define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened)
196 #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
197 #define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended
198 #define RGB_MATRIX_SKIP_FRAMES 1 // number of frames to skip when displaying animations (0 is full effect) if not defined defaults to 1
199 #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
203 The EEPROM for it is currently shared with the RGBLIGHT system (it's generally assumed only one RGB would be used at a time), but could be configured to use its own 32bit address with:
205 #define EECONFIG_RGB_MATRIX (uint32_t *)16
207 Where `16` is an unused index from `eeconfig.h`.
211 To use the suspend feature, add this to your `<keyboard>.c`:
213 void suspend_power_down_kb(void)
215 rgb_matrix_set_suspend_state(true);
218 void suspend_wakeup_init_kb(void)
220 rgb_matrix_set_suspend_state(false);