1.. zephyr:code-sample:: charger
2   :name: Charger
3   :relevant-api: charger_interface
4
5   Charge a battery using the charger driver API.
6
7Overview
8********
9
10This sample demonstrates how to use the :ref:`charger_api` API.
11
12The sample application performs a simple charging task loop.
13
14- The application will first poll for external power provided to the charger device.
15- If power is provided to the charger, then the sample application will attempt to enable the charge
16  cycle.
17- After the charge cycle is initiated, the sample application will check the status property of the
18  charger device and report any relevant information to the log.
19- Once the charger device reports that the charge cycle has completed, the application returns.
20
21Note that this sample terminates once the charge cycle completes and does not attempt to "top-off"
22the battery pack. Additionally, the sample intentionally does not respond to the reported charger
23health state and the implications the environment may have on the charge cycle execution. The
24responsibility of responding to these events falls on the user or the charger device implementation.
25