diff options
Diffstat (limited to 'docs/feature_led_matrix.md')
| -rw-r--r-- | docs/feature_led_matrix.md | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/docs/feature_led_matrix.md b/docs/feature_led_matrix.md index 7834b940d..e56caabfe 100644 --- a/docs/feature_led_matrix.md +++ b/docs/feature_led_matrix.md | |||
| @@ -15,7 +15,20 @@ LED_MATRIX_ENABLE = yes | |||
| 15 | LED_MATRIX_DRIVER = IS31FL3731 | 15 | LED_MATRIX_DRIVER = IS31FL3731 |
| 16 | ``` | 16 | ``` |
| 17 | 17 | ||
| 18 | Configure the hardware via your `config.h`: | 18 | You can use between 1 and 4 IS31FL3731 IC's. Do not specify `LED_DRIVER_ADDR_<N>` defines for IC's that are not present on your keyboard. You can define the following items in `config.h`: |
| 19 | |||
| 20 | | Variable | Description | Default | | ||
| 21 | |----------|-------------|---------| | ||
| 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 | | ||
| 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 | | | ||
| 26 | | `LED_DRIVER_ADDR_1` | (Required) Address for the first 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 | | | ||
| 29 | | `LED_DRIVER_ADDR_4` | (Optional) Address for the fourth LED driver | | | ||
| 30 | |||
| 31 | Here is an example using 2 drivers. | ||
| 19 | 32 | ||
| 20 | ```c | 33 | ```c |
| 21 | // This is a 7-bit address, that gets left-shifted and bit 0 | 34 | // This is a 7-bit address, that gets left-shifted and bit 0 |
| @@ -25,18 +38,16 @@ Configure the hardware via your `config.h`: | |||
| 25 | // 0b1110111 AD <-> VCC | 38 | // 0b1110111 AD <-> VCC |
| 26 | // 0b1110101 AD <-> SCL | 39 | // 0b1110101 AD <-> SCL |
| 27 | // 0b1110110 AD <-> SDA | 40 | // 0b1110110 AD <-> SDA |
| 28 | #define DRIVER_ADDR_1 0b1110100 | 41 | #define LED_DRIVER_ADDR_1 0b1110100 |
| 29 | #define DRIVER_ADDR_2 0b1110110 | 42 | #define LED_DRIVER_ADDR_2 0b1110110 |
| 30 | 43 | ||
| 31 | #define DRIVER_COUNT 2 | 44 | #define LED_DRIVER_COUNT 2 |
| 32 | #define DRIVER_1_LED_TOTAL 25 | 45 | #define LED_DRIVER_1_LED_TOTAL 25 |
| 33 | #define DRIVER_2_LED_TOTAL 24 | 46 | #define LED_DRIVER_2_LED_TOTAL 24 |
| 34 | #define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) | 47 | #define DRIVER_LED_TOTAL (LED_DRIVER_1_LED_TOTAL + LED_DRIVER_2_LED_TOTAL) |
| 35 | ``` | 48 | ``` |
| 36 | 49 | ||
| 37 | !> 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`. | 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`. |
| 38 | |||
| 39 | Currently only 2 drivers are supported, but it would be trivial to support all 4 combinations. | ||
| 40 | 51 | ||
| 41 | Define these arrays listing all the LEDs in your `<keyboard>.c`: | 52 | Define these arrays listing all the LEDs in your `<keyboard>.c`: |
| 42 | 53 | ||
