Skip to content

Commit

Permalink
docs: Consolidate lighting config pages
Browse files Browse the repository at this point in the history
  • Loading branch information
caksoylar committed Jan 13, 2025
1 parent 741fa26 commit e21ab9d
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 52 deletions.
2 changes: 1 addition & 1 deletion docs/blog/2023-10-05-zmk-sotf-6.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ This refactor paved way to implementing a long-awaited feature, encoder support

#### Underglow auto-off options

[ReFil] added two [new RGB auto off options](/docs/config/underglow), one using an idle timeout and the other USB status in [#1010](https://github.com/zmkfirmware/zmk/pull/1010).
[ReFil] added two [new RGB auto off options](/docs/config/lighting#rgb-underglow), one using an idle timeout and the other USB status in [#1010](https://github.com/zmkfirmware/zmk/pull/1010).

#### nice!view support

Expand Down
40 changes: 0 additions & 40 deletions docs/docs/config/backlight.md

This file was deleted.

52 changes: 47 additions & 5 deletions docs/docs/config/underglow.md → docs/docs/config/lighting.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
---
title: RGB Underglow Configuration
sidebar_label: RGB Underglow
title: Lighting Configuration
sidebar_label: Lighting
---

See the [RGB Underglow feature page](../features/lighting.md#rgb-underglow) for more details, and [hardware integration page](../development/hardware-integration/lighting/underglow.md) for adding underglow support to a board.
See the [Lighting feature page](../features/lighting.md) for an overview of the available lighting systems in ZMK.

## RGB Underglow

See the [RGB underglow section](../features/lighting.md#rgb-underglow) in the Lighting feature page for more details, and [hardware integration page](../development/hardware-integration/lighting/underglow.md) for adding underglow support to a board.

See [Configuration Overview](index.md) for instructions on how to change these settings.

## Kconfig
### Kconfig

RGB underglow depends on [Zephyr's LED strip driver](https://github.com/zephyrproject-rtos/zephyr/tree/main/drivers/led_strip), which provides additional Kconfig options.

Expand Down Expand Up @@ -44,8 +48,46 @@ Values for `CONFIG_ZMK_RGB_UNDERGLOW_EFF_START`:
The `*_START` settings only determine the initial underglow state. Any changes you make with the [underglow behavior](../keymaps/behaviors/underglow.md) are saved to flash after a one minute delay and will be used after that.
:::

## Devicetree
### Devicetree

ZMK does not have any Devicetree properties of its own. See the Devicetree bindings for [Zephyr's LED strip drivers](https://github.com/zephyrproject-rtos/zephyr/tree/main/dts/bindings/led_strip).

See the [RGB underglow hardware integration page](../development/hardware-integration/lighting/underglow.md) for examples of the properties that must be set to enable underglow.

## Backlight

See the [backlight section](../features/lighting.md#backlight) in Lighting feature page for more details, and [hardware integration page](../development/hardware-integration/lighting/backlight.mdx) for adding backlight support to a board.

See [Configuration Overview](index.md) for instructions on how to change these settings.

### Kconfig

Definition file: [zmk/app/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/app/Kconfig)

| Option | Type | Description | Default |
| ------------------------------------ | ---- | ----------------------------------------------------- | ------- |
| `CONFIG_ZMK_BACKLIGHT` | bool | Enables LED backlight | n |
| `CONFIG_ZMK_BACKLIGHT_BRT_STEP` | int | Brightness step in percent | 20 |
| `CONFIG_ZMK_BACKLIGHT_BRT_START` | int | Default brightness in percent | 40 |
| `CONFIG_ZMK_BACKLIGHT_ON_START` | bool | Default backlight state | y |
| `CONFIG_ZMK_BACKLIGHT_AUTO_OFF_IDLE` | bool | Turn off backlight when keyboard goes into idle state | n |
| `CONFIG_ZMK_BACKLIGHT_AUTO_OFF_USB` | bool | Turn off backlight when USB is disconnected | n |

:::note
The `*_START` settings only determine the initial backlight state. Any changes you make with the [backlight behavior](../keymaps/behaviors/backlight.md) are saved to flash after a one minute delay and will be used after that.
:::

### Devicetree

Applies to: [`/chosen` node](https://docs.zephyrproject.org/3.5.0/build/dts/intro-syntax-structure.html#aliases-and-chosen-nodes)

| Property | Type | Description |
| --------------- | ---- | -------------------------------------------- |
| `zmk,backlight` | path | The node for the backlight LED driver to use |

See the Zephyr devicetree bindings for LED drivers:

- [gpio-leds](https://docs.zephyrproject.org/3.5.0/build/dts/api/bindings/led/gpio-leds.html)
- [pwm-leds](https://docs.zephyrproject.org/3.5.0/build/dts/api/bindings/led/pwm-leds.html)

See the [backlight hardware integration page](../development/hardware-integration/lighting/backlight.mdx) for examples of the properties that must be set to enable backlighting.
4 changes: 2 additions & 2 deletions docs/docs/features/lighting.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ For split keyboards, set `chain-length` to the number of LEDs installed on each

### Configuring RGB Underglow

See [RGB underglow configuration](../config/underglow.md).
See [RGB underglow configuration](../config/lighting.md#rgb-underglow).

### Adding RGB Underglow Support to a Keyboard

Expand All @@ -98,7 +98,7 @@ If your board or shield does not have backlight configured, refer to [Adding Bac
### Configuring Backlight

There are various Kconfig options used to configure the backlight feature.
See [backlight configuration](../config/backlight.md) for details.
See [backlight configuration](../config/lighting.md#backlight) for details.

### Adding Backlight to a Board or a Shield

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/keymaps/behaviors/backlight.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Here is a table describing the action for each define:

:::note[Backlight settings persistence]
The backlight settings that are changed via the `&bl` behavior will be saved to flash storage and hence persist across restarts and firmware flashes.
They will also override the start values set by [`CONFIG_ZMK_BACKLIGHT_*_START` settings](../../config/backlight.md#kconfig).
They will also override the start values set by [`CONFIG_ZMK_BACKLIGHT_*_START` settings](../../config/lighting.md#kconfig-1).
However the settings will only be saved after [`CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE`](../../config/system.md#general) milliseconds in order to reduce potential wear on the flash memory.
:::

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/keymaps/behaviors/underglow.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Value Limits:

:::note[RGB settings persistence]
The RGB settings that are changed via the `&rgb_ug` behavior will be saved to flash storage and hence persist across restarts and firmware flashes.
They will also override the start values set by [`CONFIG_ZMK_RGB_*_START` settings](../../config/underglow.md#kconfig).
They will also override the start values set by [`CONFIG_ZMK_RGB_*_START` settings](../../config/lighting.md#kconfig).
However the settings will only be saved after [`CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE`](../../config/system.md#general) milliseconds in order to reduce potential wear on the flash memory.
:::

Expand Down
3 changes: 1 addition & 2 deletions docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,18 @@ module.exports = {
},
collapsed: true,
items: [
"config/backlight",
"config/battery",
"config/behaviors",
"config/bluetooth",
"config/combos",
"config/displays",
"config/encoders",
"config/lighting",
"config/pointing",
"config/keymap",
"config/layout",
"config/kscan",
"config/power",
"config/underglow",
"config/system",
"config/studio",
],
Expand Down
2 changes: 2 additions & 0 deletions docs/static/_redirects
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
/docs/features/backlight /docs/features/lighting#backlight 301
/docs/codes/modifiers /docs/keymaps/modifiers 301
/docs/codes/* /docs/keymaps/list-of-keycodes 301
/docs/config/backlight /docs/config/lighting#backlight 301
/docs/config/underglow /docs/config/lighting#rgb-underglow 301
/docs/features/beta-testing /docs/features/modules#beta-testing 301
/docs/development/setup /docs/development/local-toolchain/setup 301
/docs/development/boards-shields-keymaps /docs/development/hardware-integration/boards-shields-keymaps 301
Expand Down

0 comments on commit e21ab9d

Please sign in to comment.