diff options
| author | Joel Challis <git@zvecr.com> | 2025-09-29 20:27:07 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-29 20:27:07 +0100 |
| commit | 6f93a86e6e12ddc999da3cf940f5c327d5f9b91a (patch) | |
| tree | 10e6aae34451cc511f3d8ea0ae2056e2e7941a6a /docs | |
| parent | 0a4c1caf204bd9750ef8af8296b2e225682b6029 (diff) | |
Add LED/RGB Matrix flags API docs (#25673)
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/features/led_matrix.md | 59 | ||||
| -rw-r--r-- | docs/features/rgb_matrix.md | 59 | ||||
| -rw-r--r-- | docs/keycodes.md | 4 |
3 files changed, 122 insertions, 0 deletions
diff --git a/docs/features/led_matrix.md b/docs/features/led_matrix.md index 28d24bc400..f14fb47d62 100644 --- a/docs/features/led_matrix.md +++ b/docs/features/led_matrix.md | |||
| @@ -88,6 +88,8 @@ As mentioned earlier, the center of the keyboard by default is expected to be `{ | |||
| 88 | |`QK_LED_MATRIX_BRIGHTNESS_DOWN`|`LM_BRID`|Decrease the brightness level | | 88 | |`QK_LED_MATRIX_BRIGHTNESS_DOWN`|`LM_BRID`|Decrease the brightness level | |
| 89 | |`QK_LED_MATRIX_SPEED_UP` |`LM_SPDU`|Increase the animation speed | | 89 | |`QK_LED_MATRIX_SPEED_UP` |`LM_SPDU`|Increase the animation speed | |
| 90 | |`QK_LED_MATRIX_SPEED_DOWN` |`LM_SPDD`|Decrease the animation speed | | 90 | |`QK_LED_MATRIX_SPEED_DOWN` |`LM_SPDD`|Decrease the animation speed | |
| 91 | |`QK_LED_MATRIX_FLAG_NEXT` |`LM_FLGN`|Cycle through flags | | ||
| 92 | |`QK_LED_MATRIX_FLAG_PREVIOUS` |`LM_FLGP`|Cycle through flags in reverse | | ||
| 91 | 93 | ||
| 92 | ## LED Matrix Effects {#led-matrix-effects} | 94 | ## LED Matrix Effects {#led-matrix-effects} |
| 93 | 95 | ||
| @@ -253,6 +255,7 @@ const char* effect_name = led_matrix_get_mode_name(led_matrix_get_mode()); | |||
| 253 | #define LED_MATRIX_DEFAULT_FLAGS LED_FLAG_ALL // Sets the default LED flags, if none has been set | 255 | #define LED_MATRIX_DEFAULT_FLAGS LED_FLAG_ALL // Sets the default LED flags, if none has been set |
| 254 | #define LED_MATRIX_SPLIT { X, Y } // (Optional) For split keyboards, the number of LEDs connected on each half. X = left, Y = Right. | 256 | #define LED_MATRIX_SPLIT { X, Y } // (Optional) For split keyboards, the number of LEDs connected on each half. X = left, Y = Right. |
| 255 | // If reactive effects are enabled, you also will want to enable SPLIT_TRANSPORT_MIRROR | 257 | // If reactive effects are enabled, you also will want to enable SPLIT_TRANSPORT_MIRROR |
| 258 | #define LED_MATRIX_FLAG_STEPS { LED_FLAG_ALL, LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER, LED_FLAG_NONE } // Sets the flags which can be cycled through. | ||
| 256 | ``` | 259 | ``` |
| 257 | 260 | ||
| 258 | ## EEPROM storage {#eeprom-storage} | 261 | ## EEPROM storage {#eeprom-storage} |
| @@ -505,6 +508,62 @@ The current effect speed, from 0 to 255. | |||
| 505 | 508 | ||
| 506 | --- | 509 | --- |
| 507 | 510 | ||
| 511 | ### `void led_matrix_set_flags(led_flags_t flags)` {#api-led-matrix-set-flags} | ||
| 512 | |||
| 513 | Set the global effect flags. | ||
| 514 | |||
| 515 | #### Arguments {#api-led-matrix-set-flags-arguments} | ||
| 516 | |||
| 517 | - `led_flags_t flags` | ||
| 518 | The [flags](#flags) value to set. | ||
| 519 | |||
| 520 | --- | ||
| 521 | |||
| 522 | ### `void led_matrix_set_flags_noeeprom(led_flags_t flags)` {#api-led-matrix-set-flags-noeeprom} | ||
| 523 | |||
| 524 | Set the global effect flags. New state is not written to EEPROM. | ||
| 525 | |||
| 526 | #### Arguments {#api-led-matrix-set-flags-noeeprom-arguments} | ||
| 527 | |||
| 528 | - `led_flags_t flags` | ||
| 529 | The [flags](#flags) value to set. | ||
| 530 | |||
| 531 | --- | ||
| 532 | |||
| 533 | ### `void led_matrix_flags_step(void)` {#api-led-matrix-flags-step} | ||
| 534 | |||
| 535 | Move to the next flag combination. | ||
| 536 | |||
| 537 | --- | ||
| 538 | |||
| 539 | ### `void led_matrix_flags_step_noeeprom(void)` {#api-led-matrix-flags-step-noeeprom} | ||
| 540 | |||
| 541 | Move to the next flag combination. New state is not written to EEPROM. | ||
| 542 | |||
| 543 | --- | ||
| 544 | |||
| 545 | ### `void led_matrix_flags_step_reverse(void)` {#api-led-matrix-flags-step-reverse} | ||
| 546 | |||
| 547 | Move to the previous flag combination. | ||
| 548 | |||
| 549 | --- | ||
| 550 | |||
| 551 | ### `void led_matrix_flags_step_reverse_noeeprom(void)` {#api-led-matrix-flags-step-reverse-noeeprom} | ||
| 552 | |||
| 553 | Move to the previous flag combination. New state is not written to EEPROM. | ||
| 554 | |||
| 555 | --- | ||
| 556 | |||
| 557 | ### `uint8_t led_matrix_get_flags(void)` {#api-led-matrix-get-flags} | ||
| 558 | |||
| 559 | Get the current global effect flags. | ||
| 560 | |||
| 561 | #### Return Value {#api-led-matrix-get-flags-return} | ||
| 562 | |||
| 563 | The current effect [flags](#flags). | ||
| 564 | |||
| 565 | --- | ||
| 566 | |||
| 508 | ### `void led_matrix_reload_from_eeprom(void)` {#api-led-matrix-reload-from-eeprom} | 567 | ### `void led_matrix_reload_from_eeprom(void)` {#api-led-matrix-reload-from-eeprom} |
| 509 | 568 | ||
| 510 | Reload the effect configuration (enabled, mode and brightness) from EEPROM. | 569 | Reload the effect configuration (enabled, mode and brightness) from EEPROM. |
diff --git a/docs/features/rgb_matrix.md b/docs/features/rgb_matrix.md index 95ee4c4896..36680f24a2 100644 --- a/docs/features/rgb_matrix.md +++ b/docs/features/rgb_matrix.md | |||
| @@ -96,6 +96,8 @@ As mentioned earlier, the center of the keyboard by default is expected to be `{ | |||
| 96 | |`QK_RGB_MATRIX_VALUE_DOWN` |`RM_VALD`|Decrease the brightness level | | 96 | |`QK_RGB_MATRIX_VALUE_DOWN` |`RM_VALD`|Decrease the brightness level | |
| 97 | |`QK_RGB_MATRIX_SPEED_UP` |`RM_SPDU`|Increase the animation speed | | 97 | |`QK_RGB_MATRIX_SPEED_UP` |`RM_SPDU`|Increase the animation speed | |
| 98 | |`QK_RGB_MATRIX_SPEED_DOWN` |`RM_SPDD`|Decrease the animation speed | | 98 | |`QK_RGB_MATRIX_SPEED_DOWN` |`RM_SPDD`|Decrease the animation speed | |
| 99 | |`QK_RGB_MATRIX_FLAG_NEXT` |`RM_FLGN`|Cycle through flags | | ||
| 100 | |`QK_RGB_MATRIX_FLAG_PREVIOUS` |`RM_FLGP`|Cycle through flags in reverse | | ||
| 99 | 101 | ||
| 100 | ## RGB Matrix Effects {#rgb-matrix-effects} | 102 | ## RGB Matrix Effects {#rgb-matrix-effects} |
| 101 | 103 | ||
| @@ -409,6 +411,7 @@ const char* effect_name = rgb_matrix_get_mode_name(rgb_matrix_get_mode()); | |||
| 409 | #define RGB_MATRIX_SPLIT { X, Y } // (Optional) For split keyboards, the number of LEDs connected on each half. X = left, Y = Right. | 411 | #define RGB_MATRIX_SPLIT { X, Y } // (Optional) For split keyboards, the number of LEDs connected on each half. X = left, Y = Right. |
| 410 | // If reactive effects are enabled, you also will want to enable SPLIT_TRANSPORT_MIRROR | 412 | // If reactive effects are enabled, you also will want to enable SPLIT_TRANSPORT_MIRROR |
| 411 | #define RGB_TRIGGER_ON_KEYDOWN // Triggers RGB keypress events on key down. This makes RGB control feel more responsive. This may cause RGB to not function properly on some boards | 413 | #define RGB_TRIGGER_ON_KEYDOWN // Triggers RGB keypress events on key down. This makes RGB control feel more responsive. This may cause RGB to not function properly on some boards |
| 414 | #define RGB_MATRIX_FLAG_STEPS { LED_FLAG_ALL, LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER, LED_FLAG_UNDERGLOW, LED_FLAG_NONE } // Sets the flags which can be cycled through. | ||
| 412 | ``` | 415 | ``` |
| 413 | 416 | ||
| 414 | ## EEPROM storage {#eeprom-storage} | 417 | ## EEPROM storage {#eeprom-storage} |
| @@ -852,6 +855,62 @@ The current effect speed, from 0 to 255. | |||
| 852 | 855 | ||
| 853 | --- | 856 | --- |
| 854 | 857 | ||
| 858 | ### `void rgb_matrix_set_flags(led_flags_t flags)` {#api-rgb-matrix-set-flags} | ||
| 859 | |||
| 860 | Set the global effect flags. | ||
| 861 | |||
| 862 | #### Arguments {#api-rgb-matrix-set-flags-arguments} | ||
| 863 | |||
| 864 | - `led_flags_t flags` | ||
| 865 | The [flags](#flags) value to set. | ||
| 866 | |||
| 867 | --- | ||
| 868 | |||
| 869 | ### `void rgb_matrix_set_flags_noeeprom(led_flags_t flags)` {#api-rgb-matrix-set-flags-noeeprom} | ||
| 870 | |||
| 871 | Set the global effect flags. New state is not written to EEPROM. | ||
| 872 | |||
| 873 | #### Arguments {#api-rgb-matrix-set-flags-noeeprom-arguments} | ||
| 874 | |||
| 875 | - `led_flags_t flags` | ||
| 876 | The [flags](#flags) value to set. | ||
| 877 | |||
| 878 | --- | ||
| 879 | |||
| 880 | ### `void rgb_matrix_flags_step(void)` {#api-rgb-matrix-flags-step} | ||
| 881 | |||
| 882 | Move to the next flag combination. | ||
| 883 | |||
| 884 | --- | ||
| 885 | |||
| 886 | ### `void rgb_matrix_flags_step_noeeprom(void)` {#api-rgb-matrix-flags-step-noeeprom} | ||
| 887 | |||
| 888 | Move to the next flag combination. New state is not written to EEPROM. | ||
| 889 | |||
| 890 | --- | ||
| 891 | |||
| 892 | ### `void rgb_matrix_flags_step_reverse(void)` {#api-rgb-matrix-flags-step-reverse} | ||
| 893 | |||
| 894 | Move to the previous flag combination. | ||
| 895 | |||
| 896 | --- | ||
| 897 | |||
| 898 | ### `void rgb_matrix_flags_step_reverse_noeeprom(void)` {#api-rgb-matrix-flags-step-reverse-noeeprom} | ||
| 899 | |||
| 900 | Move to the previous flag combination. New state is not written to EEPROM. | ||
| 901 | |||
| 902 | --- | ||
| 903 | |||
| 904 | ### `uint8_t rgb_matrix_get_flags(void)` {#api-rgb-matrix-get-flags} | ||
| 905 | |||
| 906 | Get the current global effect flags. | ||
| 907 | |||
| 908 | #### Return Value {#api-rgb-matrix-get-flags-return} | ||
| 909 | |||
| 910 | The current effect [flags](#flags). | ||
| 911 | |||
| 912 | --- | ||
| 913 | |||
| 855 | ### `void rgb_matrix_sethsv(uint8_t h, uint8_t s, uint8_t v)` {#api-rgb-matrix-sethsv} | 914 | ### `void rgb_matrix_sethsv(uint8_t h, uint8_t s, uint8_t v)` {#api-rgb-matrix-sethsv} |
| 856 | 915 | ||
| 857 | Set the global effect hue, saturation, and value (brightness). | 916 | Set the global effect hue, saturation, and value (brightness). |
diff --git a/docs/keycodes.md b/docs/keycodes.md index e569e87431..9a4ca7ea0c 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md | |||
| @@ -433,6 +433,8 @@ See also: [LED Matrix](features/led_matrix) | |||
| 433 | |`QK_LED_MATRIX_BRIGHTNESS_DOWN`|`LM_BRID`|Decrease the brightness level | | 433 | |`QK_LED_MATRIX_BRIGHTNESS_DOWN`|`LM_BRID`|Decrease the brightness level | |
| 434 | |`QK_LED_MATRIX_SPEED_UP` |`LM_SPDU`|Increase the animation speed | | 434 | |`QK_LED_MATRIX_SPEED_UP` |`LM_SPDU`|Increase the animation speed | |
| 435 | |`QK_LED_MATRIX_SPEED_DOWN` |`LM_SPDD`|Decrease the animation speed | | 435 | |`QK_LED_MATRIX_SPEED_DOWN` |`LM_SPDD`|Decrease the animation speed | |
| 436 | |`QK_LED_MATRIX_FLAG_NEXT` |`LM_FLGN`|Cycle through flags | | ||
| 437 | |`QK_LED_MATRIX_FLAG_PREVIOUS` |`LM_FLGP`|Cycle through flags in reverse | | ||
| 436 | 438 | ||
| 437 | ## Magic Keycodes {#magic-keycodes} | 439 | ## Magic Keycodes {#magic-keycodes} |
| 438 | 440 | ||
| @@ -783,6 +785,8 @@ See also: [RGB Matrix](features/rgb_matrix) | |||
| 783 | |`QK_RGB_MATRIX_VALUE_DOWN` |`RM_VALD`|Decrease the brightness level | | 785 | |`QK_RGB_MATRIX_VALUE_DOWN` |`RM_VALD`|Decrease the brightness level | |
| 784 | |`QK_RGB_MATRIX_SPEED_UP` |`RM_SPDU`|Increase the animation speed | | 786 | |`QK_RGB_MATRIX_SPEED_UP` |`RM_SPDU`|Increase the animation speed | |
| 785 | |`QK_RGB_MATRIX_SPEED_DOWN` |`RM_SPDD`|Decrease the animation speed | | 787 | |`QK_RGB_MATRIX_SPEED_DOWN` |`RM_SPDD`|Decrease the animation speed | |
| 788 | |`QK_RGB_MATRIX_FLAG_NEXT` |`RM_FLGN`|Cycle through flags | | ||
| 789 | |`QK_RGB_MATRIX_FLAG_PREVIOUS` |`RM_FLGP`|Cycle through flags in reverse | | ||
| 786 | 790 | ||
| 787 | ## US ANSI Shifted Symbols {#us-ansi-shifted-symbols} | 791 | ## US ANSI Shifted Symbols {#us-ansi-shifted-symbols} |
| 788 | 792 | ||
