zmk/docs/docs/config/battery.md
Pete Johanson 147c340c6e
Feature: Full-Duplex Wired Split (#2766)
refactor(split): Refactor split code for extension

Extract central/peripheral code to allow for plugging in alternate
transports, instead of tying all split logic to BT.

feat(split): Add full-duplex wired split support

* Depends on full-duplex hardware UART for communication.
* Supports all existing central commands/peripheral events, including
  sensors/inputs from peripherals.
* Only one wired split peripheral supported (for now)
* Relies on chosen `zmk,split-uart` referencing the UART device.

docs: Add wired split config docs.

Migrate split to its own dedicated config file, and add details
on wired split config.

Co-authored-by: Nicolas Munnich <98408764+Nick-Munnich@users.noreply.github.com>

fix: Properly override stack size on RP2040

Move the system work queue stack size override on RP2040 ouf of
a `ZMK_BLE` conditional so it is properly applied generally for that
SoC.

---------

Co-authored-by: Nicolas Munnich <98408764+Nick-Munnich@users.noreply.github.com>
2025-03-18 02:48:32 -04:00

3.2 KiB

title sidebar_label
Battery Level Battery Level

See the battery level feature page for more details on configuring a battery sensor.

See Configuration Overview for instructions on how to change these settings.

Kconfig

Definition file: zmk/app/Kconfig

Config Type Description Default
CONFIG_ZMK_BATTERY_REPORTING bool Enables/disables all battery level detection/reporting n
CONFIG_ZMK_BATTERY_REPORT_INTERVAL int Battery level report interval in seconds 60

:::note[Default setting]

While CONFIG_ZMK_BATTERY_REPORTING is disabled by default it is implied by CONFIG_ZMK_BLE, thus any board with BLE enabled will have this automatically enabled unless explicitly overridden.

:::

:::note[BLE reporting on MacOS]

On macOS the BLE battery reporting packets can cause the computer to wakeup from sleep. To prevent this, the battery reporting service can be disabled by setting CONFIG_BT_BAS=n. This setting is independent of battery monitoring, for instance the battery level can still be indicated on a display.

:::

Peripheral Battery Monitoring

You can configure ZMK to allow support for peripheral battery monitoring over BLE (e.g. when having a split keyboard with two independent and wirelessly connected sides). If you want to report the battery levels of both sides of a split keyboard, you should have both CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_PROXY and CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_FETCHING set to y.

:::note[Displaying both battery levels on your host]

Host support for multiple battery levels is undefined. It appears that in most of the cases only the main battery is being reported. In order to correctly display all the battery values, you probably need a special application or script.

:::

Devicetree

Applies to: /chosen node

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.

nRF VDDH Battery Sensor

Driver for reading the voltage of a battery using a Nordic nRF52's VDDH pin.

Devicetree

Applies to: compatible = "zmk,battery-nrf-vddh"

Definition file: zmk/app/module/dts/bindings/sensor/zmk,battery-nrf-vddh.yaml

This driver has no configuration.