Browse Source

feat(docs): Update power and lighting config pages

Moved battery configuration to its own page to match the feature page.

Documented that external power is disabled when in sleep mode.

Clarified that the *_START configs apply on first boot, and any changes
after that are persisted.
xmkb
Joel Spadin 2 years ago committed by Julia Luna
parent
commit
8d00dd4582
Signed by: xenua
GPG Key ID: 6A0C04FA9A7D7582
  1. 4
      docs/docs/config/backlight.md
  2. 40
      docs/docs/config/battery.md
  3. 6
      docs/docs/config/behaviors.md
  4. 12
      docs/docs/config/power.md
  5. 4
      docs/docs/config/underglow.md
  6. 2
      docs/docs/features/battery.md
  7. 3
      docs/sidebars.js

4
docs/docs/config/backlight.md

@ -20,6 +20,10 @@ Definition file: [zmk/app/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/ @@ -20,6 +20,10 @@ Definition file: [zmk/app/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/
| `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](../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/latest/build/dts/intro.html#aliases-and-chosen-nodes)

40
docs/docs/config/battery.md

@ -0,0 +1,40 @@ @@ -0,0 +1,40 @@
---
title: Battery Level
sidebar_label: Battery Level
---
See the [battery level feature page](../features/battery.md) for more details on configuring a battery sensor.
See [Configuration Overview](index.md) for instructions on how to change these settings.
### Devicetree
Applies to: [`/chosen` node](https://docs.zephyrproject.org/latest/guides/dts/intro.html#aliases-and-chosen-nodes)
| Property | Type | Description |
| ------------- | ---- | --------------------------------------------- |
| `zmk,battery` | path | The node for the battery sensor driver to use |
## Battery Voltage Divider Sensor
Driver for reading the voltage of a battery using an ADC connected to a voltage divider.
### Devicetree
Applies to: `compatible = "zmk,battery-voltage-divider"`
See [Zephyr's voltage divider documentation](https://docs.zephyrproject.org/latest/build/dts/api/bindings/adc/voltage-divider.html).
## nRF VDDH Battery Sensor
Driver for reading the voltage of a battery using a Nordic nRF52's VDDH pin. This driver has no configuration except for the required `label` property.
### Devicetree
Applies to: `compatible = "zmk,battery-nrf-vddh"`
Definition file: [zmk/app/drivers/zephyr/dts/bindings/sensor/zmk,battery-nrf-vddh.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/drivers/zephyr/dts/bindings/sensor/zmk%2Cbattery-nrf-vddh.yaml)
| Property | Type | Description |
| -------- | ------ | ------------------------- |
| `label` | string | Unique label for the node |

6
docs/docs/config/behaviors.md

@ -158,9 +158,9 @@ See [dt-bindings/zmk/modifiers.h](https://github.com/zmkfirmware/zmk/blob/main/a @@ -158,9 +158,9 @@ See [dt-bindings/zmk/modifiers.h](https://github.com/zmkfirmware/zmk/blob/main/a
You can use the following nodes to tweak the default behaviors:
| Node | Behavior |
| -------- | ------------ |
| `&gresc` | Grave escape |
| Node | Behavior |
| -------- | ----------------------------------------- |
| `&gresc` | [Grave escape](../behaviors/mod-morph.md) |
## Sticky Key

12
docs/docs/config/power.md

@ -12,7 +12,7 @@ Configuration for entering low power modes when the keyboard is idle. @@ -12,7 +12,7 @@ Configuration for entering low power modes when the keyboard is idle.
In the idle state, peripherals such as displays and lighting are disabled, but the keyboard remains connected to Bluetooth so it can immediately respond when you press a key.
In the deep sleep state, the keyboard additionally disconnects from Bluetooth. This state uses very little power, but it may take a few seconds to reconnect after waking.
In the deep sleep state, the keyboard additionally disconnects from Bluetooth and any external power output is disabled. This state uses very little power, but it may take a few seconds to reconnect after waking.
### Kconfig
@ -45,13 +45,3 @@ Applies to: `compatible = "zmk,ext-power-generic"` @@ -45,13 +45,3 @@ Applies to: `compatible = "zmk,ext-power-generic"`
| `label` | string | Unique label for the node |
| `control-gpios` | GPIO array | List of GPIOs which should be active to enable external power |
| `init-delay-ms` | int | number of milliseconds to delay after initializing the driver |
## Battery Voltage Divider
Driver for reading the voltage of a battery using an ADC connected to a voltage divider.
### Devicetree
Applies to: `compatible = "zmk,battery-voltage-divider"`
See [Zephyr's voltage divider documentation](https://docs.zephyrproject.org/latest/build/dts/api/bindings/adc/voltage-divider.html).

4
docs/docs/config/underglow.md

@ -36,6 +36,10 @@ Values for `CONFIG_ZMK_RGB_UNDERGLOW_EFF_START`: @@ -36,6 +36,10 @@ Values for `CONFIG_ZMK_RGB_UNDERGLOW_EFF_START`:
| 2 | Spectrum |
| 3 | Swirl |
:::note
The `*_START` settings only determine the initial underglow state. Any changes you make with the [underglow behavior](../behaviors/underglow.md) are saved to flash after a one minute delay and will be used after that.
:::
## 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).

2
docs/docs/features/battery.md

@ -20,6 +20,8 @@ To enable a battery sensor on a new board, add the driver for the sensor to your @@ -20,6 +20,8 @@ To enable a battery sensor on a new board, add the driver for the sensor to your
- `zmk,battery-voltage-divider`: Reads the voltage on an analog input pin.
- `zmk,battery-nrf-vddh`: Reads the power supply voltage on a Nordic nRF52's VDDH pin.
See the [battery level configuration page](../config/battery.md) for the configuration supported by each driver provided by ZMK.
Zephyr also provides some drivers for fuel gauge ICs such as the TI bq274xx series and Maxim MAX17xxx series. If you use a battery sensor that does not have an existing driver, you will need to write a new driver that supports the `SENSOR_CHAN_GAUGE_STATE_OF_CHARGE` sensor channel and contribute it to Zephyr or ZMK.
Once you have the sensor driver defined, add a `zmk,battery` property to the `chosen` node and set it to reference the sensor node. For example:

3
docs/sidebars.js

@ -55,6 +55,7 @@ module.exports = { @@ -55,6 +55,7 @@ module.exports = {
Configuration: [
"config/index",
"config/backlight",
"config/battery",
"config/behaviors",
"config/combos",
"config/displays",
@ -62,8 +63,8 @@ module.exports = { @@ -62,8 +63,8 @@ module.exports = {
"config/keymap",
"config/kscan",
"config/power",
"config/system",
"config/underglow",
"config/system",
],
Development: [
"development/clean-room",

Loading…
Cancel
Save