diff options
| author | Ryan <fauxpark@gmail.com> | 2022-09-23 22:46:23 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-23 22:46:23 +1000 |
| commit | 36c410592dbd35da33ccc5fd6d2a5cbf4b25a708 (patch) | |
| tree | 4e75c5fc5cd31d9fdc904876906c0b409ee45d90 /docs/feature_led_matrix.md | |
| parent | d967de0df749f3be63403e07feda416ea09351d0 (diff) | |
Change `DRIVER_LED_COUNT` to `{LED,RGB}_MATRIX_LED_COUNT` (#18399)
Diffstat (limited to 'docs/feature_led_matrix.md')
| -rw-r--r-- | docs/feature_led_matrix.md | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/docs/feature_led_matrix.md b/docs/feature_led_matrix.md index 563fa149a2..cc036eb80f 100644 --- a/docs/feature_led_matrix.md +++ b/docs/feature_led_matrix.md | |||
| @@ -22,7 +22,7 @@ You can use between 1 and 4 IS31FL3731 IC's. Do not specify `LED_DRIVER_ADDR_<N> | |||
| 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 | | `LED_DRIVER_COUNT` | (Required) How many LED driver IC's are present | | | 24 | | `LED_DRIVER_COUNT` | (Required) How many LED driver IC's are present | | |
| 25 | | `DRIVER_LED_TOTAL` | (Required) How many LED lights are present across all drivers | | | 25 | | `LED_MATRIX_LED_COUNT` | (Required) How many LED lights are present across all drivers | | |
| 26 | | `LED_DRIVER_ADDR_1` | (Required) Address for the first LED driver | | | 26 | | `LED_DRIVER_ADDR_1` | (Required) Address for the first LED driver | | |
| 27 | | `LED_DRIVER_ADDR_2` | (Optional) Address for the second LED driver | | | 27 | | `LED_DRIVER_ADDR_2` | (Optional) Address for the second LED driver | | |
| 28 | | `LED_DRIVER_ADDR_3` | (Optional) Address for the third LED driver | | | 28 | | `LED_DRIVER_ADDR_3` | (Optional) Address for the third LED driver | | |
| @@ -44,17 +44,17 @@ Here is an example using 2 drivers. | |||
| 44 | #define LED_DRIVER_COUNT 2 | 44 | #define LED_DRIVER_COUNT 2 |
| 45 | #define LED_DRIVER_1_LED_TOTAL 25 | 45 | #define LED_DRIVER_1_LED_TOTAL 25 |
| 46 | #define LED_DRIVER_2_LED_TOTAL 24 | 46 | #define LED_DRIVER_2_LED_TOTAL 24 |
| 47 | #define DRIVER_LED_TOTAL (LED_DRIVER_1_LED_TOTAL + LED_DRIVER_2_LED_TOTAL) | 47 | #define LED_MATRIX_LED_COUNT (LED_DRIVER_1_LED_TOTAL + LED_DRIVER_2_LED_TOTAL) |
| 48 | ``` | 48 | ``` |
| 49 | 49 | ||
| 50 | !> Note the parentheses, this is so when `LED_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() % (LED_DRIVER_1_LED_TOTAL + LED_DRIVER_2_LED_TOTAL)` will give very different results than `rand() % LED_DRIVER_1_LED_TOTAL + LED_DRIVER_2_LED_TOTAL`. | 50 | !> Note the parentheses, this is so when `LED_MATRIX_LED_COUNT` is used in code and expanded, the values are added together before any additional math is applied to them. As an example, `rand() % (LED_DRIVER_1_LED_TOTAL + LED_DRIVER_2_LED_TOTAL)` will give very different results than `rand() % LED_DRIVER_1_LED_TOTAL + LED_DRIVER_2_LED_TOTAL`. |
| 51 | 51 | ||
| 52 | For split keyboards using `LED_MATRIX_SPLIT` with an LED driver, you can either have the same driver address or different driver addresses. If using different addresses, use `DRIVER_ADDR_1` for one and `DRIVER_ADDR_2` for the other one. Then, in `g_is31_leds`, fill out the correct driver index (0 or 1). If using one address, use `DRIVER_ADDR_1` for both, and use index 0 for `g_is31_leds`. | 52 | For split keyboards using `LED_MATRIX_SPLIT` with an LED driver, you can either have the same driver address or different driver addresses. If using different addresses, use `DRIVER_ADDR_1` for one and `DRIVER_ADDR_2` for the other one. Then, in `g_is31_leds`, fill out the correct driver index (0 or 1). If using one address, use `DRIVER_ADDR_1` for both, and use index 0 for `g_is31_leds`. |
| 53 | 53 | ||
| 54 | Define these arrays listing all the LEDs in your `<keyboard>.c`: | 54 | Define these arrays listing all the LEDs in your `<keyboard>.c`: |
| 55 | 55 | ||
| 56 | ```c | 56 | ```c |
| 57 | const is31_led PROGMEM g_is31_leds[DRIVER_LED_TOTAL] = { | 57 | const is31_led PROGMEM g_is31_leds[LED_MATRIX_LED_COUNT] = { |
| 58 | /* Refer to IS31 manual for these locations | 58 | /* Refer to IS31 manual for these locations |
| 59 | * driver | 59 | * driver |
| 60 | * | LED address | 60 | * | LED address |
| @@ -95,7 +95,7 @@ Configure the hardware via your `config.h`: | |||
| 95 | | `ISSI_TIMEOUT` | (Optional) How long to wait for i2c messages, in milliseconds | 100 | | 95 | | `ISSI_TIMEOUT` | (Optional) How long to wait for i2c messages, in milliseconds | 100 | |
| 96 | | `ISSI_PERSISTENCE` | (Optional) Retry failed messages this many times | 0 | | 96 | | `ISSI_PERSISTENCE` | (Optional) Retry failed messages this many times | 0 | |
| 97 | | `DRIVER_COUNT` | (Required) How many LED driver IC's are present | | | 97 | | `DRIVER_COUNT` | (Required) How many LED driver IC's are present | | |
| 98 | | `DRIVER_LED_TOTAL` | (Required) How many LED lights are present across all drivers | | | 98 | | `LED_MATRIX_LED_COUNT` | (Required) How many LED lights are present across all drivers | | |
| 99 | | `DRIVER_ADDR_1` | (Optional) Address for the first LED driver | | | 99 | | `DRIVER_ADDR_1` | (Optional) Address for the first LED driver | | |
| 100 | | `DRIVER_ADDR_<N>` | (Required) Address for the additional LED drivers | | | 100 | | `DRIVER_ADDR_<N>` | (Required) Address for the additional LED drivers | | |
| 101 | | `ISSI_SSR_<N>` | (Optional) Configuration for the Spread Spectrum Register | | | 101 | | `ISSI_SSR_<N>` | (Optional) Configuration for the Spread Spectrum Register | | |
| @@ -130,16 +130,16 @@ Here is an example using 2 drivers. | |||
| 130 | #define DRIVER_COUNT 2 | 130 | #define DRIVER_COUNT 2 |
| 131 | #define DRIVER_1_LED_TOTAL 66 | 131 | #define DRIVER_1_LED_TOTAL 66 |
| 132 | #define DRIVER_2_LED_TOTAL 42 | 132 | #define DRIVER_2_LED_TOTAL 42 |
| 133 | #define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) | 133 | #define LED_MATRIX_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) |
| 134 | ``` | 134 | ``` |
| 135 | !> 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`. | 135 | !> Note the parentheses, this is so when `LED_MATRIX_LED_COUNT` 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`. |
| 136 | 136 | ||
| 137 | Currently only 4 drivers are supported, but it would be trivial to support for more. Note that using a combination of different drivers is not supported. All drivers must be of the same model. | 137 | Currently only 4 drivers are supported, but it would be trivial to support for more. Note that using a combination of different drivers is not supported. All drivers must be of the same model. |
| 138 | 138 | ||
| 139 | Define these arrays listing all the LEDs in your `<keyboard>.c`: | 139 | Define these arrays listing all the LEDs in your `<keyboard>.c`: |
| 140 | 140 | ||
| 141 | ```c | 141 | ```c |
| 142 | const is31_led __flash g_is31_leds[DRIVER_LED_TOTAL] = { | 142 | const is31_led __flash g_is31_leds[LED_MATRIX_LED_COUNT] = { |
| 143 | /* Refer to IS31 manual for these locations | 143 | /* Refer to IS31 manual for these locations |
| 144 | * driver | 144 | * driver |
| 145 | * | LED address | 145 | * | LED address |
| @@ -367,7 +367,7 @@ For inspiration and examples, check out the built-in effects under `quantum/led_ | |||
| 367 | #define LED_DISABLE_TIMEOUT 0 // number of milliseconds to wait until led automatically turns off | 367 | #define LED_DISABLE_TIMEOUT 0 // number of milliseconds to wait until led automatically turns off |
| 368 | #define LED_DISABLE_AFTER_TIMEOUT 0 // OBSOLETE: number of ticks to wait until disabling effects | 368 | #define LED_DISABLE_AFTER_TIMEOUT 0 // OBSOLETE: number of ticks to wait until disabling effects |
| 369 | #define LED_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended | 369 | #define LED_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended |
| 370 | #define LED_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness) | 370 | #define LED_MATRIX_LED_PROCESS_LIMIT (LED_MATRIX_LED_COUNT + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness) |
| 371 | #define LED_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness) | 371 | #define LED_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness) |
| 372 | #define LED_MATRIX_MAXIMUM_BRIGHTNESS 255 // limits maximum brightness of LEDs | 372 | #define LED_MATRIX_MAXIMUM_BRIGHTNESS 255 // limits maximum brightness of LEDs |
| 373 | #define LED_MATRIX_STARTUP_MODE LED_MATRIX_SOLID // Sets the default mode, if none has been set | 373 | #define LED_MATRIX_STARTUP_MODE LED_MATRIX_SOLID // Sets the default mode, if none has been set |
| @@ -391,7 +391,7 @@ Where `28` is an unused index from `eeconfig.h`. | |||
| 391 | |Function |Description | | 391 | |Function |Description | |
| 392 | |--------------------------------------------|-------------| | 392 | |--------------------------------------------|-------------| |
| 393 | |`led_matrix_set_value_all(v)` |Set all of the LEDs to the given value, where `v` is between 0 and 255 (not written to EEPROM) | | 393 | |`led_matrix_set_value_all(v)` |Set all of the LEDs to the given value, where `v` is between 0 and 255 (not written to EEPROM) | |
| 394 | |`led_matrix_set_value(index, v)` |Set a single LED to the given value, where `v` is between 0 and 255, and `index` is between 0 and `DRIVER_LED_TOTAL` (not written to EEPROM) | | 394 | |`led_matrix_set_value(index, v)` |Set a single LED to the given value, where `v` is between 0 and 255, and `index` is between 0 and `LED_MATRIX_LED_COUNT` (not written to EEPROM) | |
| 395 | 395 | ||
| 396 | ### Disable/Enable Effects :id=disable-enable-effects | 396 | ### Disable/Enable Effects :id=disable-enable-effects |
| 397 | |Function |Description | | 397 | |Function |Description | |
