Skip to content

Commit

Permalink
Document charging indication functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
ReFil committed Oct 20, 2023
1 parent f6a5cd6 commit 8661d1b
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions docs/docs/config/battery.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,25 @@ Applies to: [`/chosen` node](https://docs.zephyrproject.org/latest/guides/dts/in

## Battery Voltage Divider Sensor

Driver for reading the voltage of a battery using an ADC connected to a voltage divider.
Driver for reading the voltage of a battery using an ADC connected to a voltage divider. This driver can also read a GPIO pin to detect whether the battery is charging or not if the hardware implementation includes a battery charging IC with an output to indicate charging status. This functionality is optional, the `chg-gpios` devicetree configuration does not have to be set.

### 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).
Definition file: [zmk/app/module/dts/bindings/sensor/zmk,battery-voltage-divider.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/module/dts/bindings/sensor/zmk,battery-voltage-divider.yaml)

The ZMK battery voltage divider includes the [Zephyr voltage divider](https://docs.zephyrproject.org/latest/build/dts/api/bindings/adc/voltage-divider.html) and adds on additional functionality.

| Property | Type | Description | Default |
| ----------- | ---------- | ------------------------------------------------ | ------- |
| `chg-gpios` | GPIO array | GPIO connected to the charging IC's charging pin | |

:::note Charging indication

The battery charging status is not currently consumed by any indicators and cannot be conveyed to the host over BLE. The battery charging status is updated every `CONFIG_ZMK_BATTERY_REPORT_INTERVAL`

:::

## nRF VDDH Battery Sensor

Expand Down

0 comments on commit 8661d1b

Please sign in to comment.