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.
This commit is contained in:
Joel Spadin 2022-05-21 17:48:27 -05:00 committed by Dom H
parent 1646cd7f30
commit ae78aa247a
7 changed files with 56 additions and 15 deletions

View File

@ -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)

View File

@ -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 |

View File

@ -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

View File

@ -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"`
| `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).

View File

@ -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).

View File

@ -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:

View File

@ -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 = {
"config/keymap",
"config/kscan",
"config/power",
"config/system",
"config/underglow",
"config/system",
],
Development: [
"development/clean-room",