<br />

Added: HEAD

## **PROTOCOLS**

## Charger

*Defined in [fuchsia.hardware.power.charger/charger.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.power.charger/charger.fidl;l=317)*

Diagnostic and telemetry interface for charging hardware.

This is a read-only protocol that supports multiple concurrent clients.

<br />

### ConfigureWatch

Configures the fields of interest and wake triggers for this client connection.

The driver filters the requested masks against hardware capabilities and returns the
effective configuration in `effective_options`.

- **Partially supported options** : If some requested fields are supported and others are not (e.g., requesting passive fields like `input_voltage_uv` or `input_current_ua` that do not support active interrupt notifications), the driver enables the supported fields and returns the active subset in `effective_options`. The call succeeds (`Ok`).
- **Fully unsupported options** : If non-empty masks were specified but NONE of the requested fields are supported, the driver returns `NOT_SUPPORTED`.

If `ConfigureWatch` is never called, `Watch` defaults to returning on ANY supported field
change. The driver aggregates constraints across all clients to determine hardware reporting
rates.

Calling `ConfigureWatch` while a `Watch` call is already pending takes effect immediately:
if the current hardware state already differs from the last-delivered snapshot on a newly
enabled field, the pending `Watch` resolves immediately; otherwise it remains pending under
the updated mask.

If `ConfigureWatch` returns an error, the connection's prior watch configuration remains
unchanged.

Parameters:

- `options`: Requested watch options. Both `interest` and `wake_on` are optional.

Returns:

- `effective_options`: The subset of requested options supported and enabled by the driver.

Errors:

- `NOT_SUPPORTED`: Non-empty options were requested, but none of the requested interest/wake fields or periodic sampling are supported by the driver.

#### Request

| Name | Type |
|---|---|
| `options` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#WatchOptions` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Charger_ConfigureWatch_Result` |

### GetSpec

Retrieves the static specification of the charger.

Returns:

- `spec`: Static hardware characteristics and driver capabilities of the charger.

Errors:

- `NOT_SUPPORTED`: Hardware does not supply a static specification.
- `IO`: Communication failure with the charger hardware (e.g. SPMI transfer failure).
- `INTERNAL`: Internal driver error.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Charger_GetSpec_Result` |

### GetStatus

Retrieves an instantaneous snapshot of the charger status.

Returns:

- `status`: Complete current telemetry snapshot of the charging regulator and its inputs.

Errors:

- `IO`: Communication failure with the charger hardware (e.g. SPMI transfer failure).
- `INTERNAL`: Internal driver error.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Charger_GetStatus_Result` |

### Watch

Watches for changes in charger state using a hanging-get pattern.

The first call returns the full current hardware state immediately. Subsequent calls block
until a state change matches the masks in [ConfigureWatch](https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#ConfigureWatch) or the interval in
`max_interval` has elapsed. Each return contains a complete telemetry snapshot of all
current charger fields, not a sparse delta.

At most one `Watch` call may be outstanding per connection; concurrent calls fail with
`ALREADY_WATCHING`.

Parameters:

- `lease`: An optional power lease token that keeps the system awake while the server processes the call. If the call is answered immediately, as the first call always is, the server hands it back as `wake_lease` unless it returns a wake lease of its own. If the call is parked, the server drops it.

Returns:

- `status`: Complete current telemetry snapshot of the charger.
- `wake_lease`: An optional lease token that the client should hold while it handles `status`: the client's `lease` handed back on an immediate reply, or a wake lease provided if the change triggered a `wake_on` condition or a `max_interval` sample woke the system for a client that set `wake_on_max_interval`. Omitted otherwise.

Errors:

- `ALREADY_WATCHING`: A `Watch` call is already pending on this connection.
- `IO`: Communication failure with the charger hardware (e.g. SPMI transfer failure).
- `INTERNAL`: Internal driver error.

#### Request

| Name | Type |
|---|---|
| `lease` | `https://fuchsia.dev/reference/fuchsia.power.system//https://fuchsia.dev/reference/fuchsia.power.system#LeaseToken` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Charger_Watch_Result` |

## Controller

*Defined in [fuchsia.hardware.power.charger/charger.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.power.charger/charger.fidl;l=476)*

Control interface for mutating charger hardware state.

# Single-Client Exclusivity (Hardware Driver) vs. Policy Arbitrator

On a hardware charger driver, this protocol mutates shared hardware state and admits a single
active client: while one client is connected, a second connection attempt is closed immediately
with a `ZX_ERR_ALREADY_BOUND` epitaph before any request is served. When served by a userspace
policy arbitrator (such as `battery-manager`), multiple policy clients may connect concurrently;
each connection owns an independent vote, and for every field the most conservative vote (the
one that charges least) wins.

# Connection-Scoped Lifetime (Revert on Close)

The `Controller` channel encodes the lifetime of the constraints applied through it. When the
client closes the channel (or disconnects unexpectedly), all constraints set during that
session are withdrawn (equivalent to calling `ClearControl` with an empty `ControlOptions`).

# Debug Overrides

Fields overridden through [Debug](https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Debug) take precedence over this protocol. A request that sets an
overridden field is validated and accepted as usual, but the new constraint (like `ClearControl`
or revert on close) reaches the hardware only once the override is cleared. See [Debug](https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Debug).

<br />

### ClearControl

Withdraws constraints applied through this connection for the fields present in `options`.

`options` acts as a field mask: only field presence (set vs. unset) is inspected, and the
field values themselves are ignored.

- If `options` is empty (no fields set), **all** constraints applied through this connection are withdrawn.
- If one or more fields are set in `options`, only the constraints corresponding to those fields are withdrawn, leaving any other fields untouched.

Each cleared field reverts to the next active constraint, if any, or otherwise to the
autonomous hardware / board-configured default that [Controller](https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Controller) restores on close.
Succeeds without effect for any targeted field that is not currently constrained.

Parameters:

- `options`: Mask of `ControlOptions` fields whose constraints should be withdrawn, or an empty table to withdraw all constraints on this connection.

Errors:

- `IO`: Communication failure with the charger hardware. Fields that could not be reverted retain their constraint, so the call can be retried.
- `INTERNAL`: Internal driver error.

#### Request

| Name | Type |
|---|---|
| `options` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#ControlOptions` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Controller_ClearControl_Result` |

### SetControl

Applies operational and electrical constraints to the charger converter.

Validation is atomic: a request rejected with `NOT_SUPPORTED` or `INVALID_ARGS` leaves
hardware and session state untouched. The response is returned only after all corresponding
hardware register writes have completed and been acknowledged by the charger IC.

Parameters:

- `options`: The constraints to apply. Present fields overwrite the constraints previously set on this connection for those fields; omitted fields leave this connection's prior constraints for those fields unchanged.

Errors:

- `NOT_SUPPORTED`: One or more requested constraints are not adjustable on this hardware/arbiter, or the requested `operating_mode` is absent from `Spec.supported_modes`.
- `INVALID_ARGS`: A requested value cannot be applied (for example, a limit below the hardware's lowest programmable step), or the requested `operating_mode` conflicts with the active power path state (for example, requesting `OperatingMode::OTG` while external input power is online on the same port).
- `IO`: Communication failure with the charger hardware (e.g. SPMI transfer failure).
- `INTERNAL`: Internal driver error.

#### Request

| Name | Type |
|---|---|
| `options` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#ControlOptions` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Controller_SetControl_Result` |

## Debug

*Defined in [fuchsia.hardware.power.charger/charger.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.power.charger/charger.fidl;l=552)*

Debug control interface for hardware battery chargers.

Composes [Controller](https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Controller) without its single-client exclusivity or revert-on-close lifetime, so
command-line diagnostic utilities (such as `batteryutil`) and integration tests can apply sticky
charger overrides while the production policy client stays connected to [Controller](https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Controller). Only
reachable through [DebugService](https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#DebugService).

# Override Precedence

Each field set through `SetControl` becomes an override that takes precedence over
[Controller](https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Controller) regardless of request order: a [Controller](https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Controller) request that sets an overridden
field is validated and accepted, but takes effect only once the override is cleared, and a
[Controller](https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Controller) revert on close leaves overridden fields untouched. Fields that are not
overridden stay under [Controller](https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Controller) control.

# Sticky Lifetime (No Revert on Close)

Overrides are not tied to the connection that applied them: closing the channel leaves them in
effect, so a utility can apply an override and exit. They remain in effect until
`ClearControl` is called on a `Debug` connection.

# Multiple Connections

Any number of `Debug` connections may be open concurrently; connections are never rejected with
`ZX_ERR_ALREADY_BOUND`. All `Debug` connections share one set of `Debug` overrides: for each
field, the most recent `SetControl` wins, and `ClearControl` withdraws the targeted `Debug`
overrides.

<br />

### ClearControl

Withdraws constraints applied through this connection for the fields present in `options`.

`options` acts as a field mask: only field presence (set vs. unset) is inspected, and the
field values themselves are ignored.

- If `options` is empty (no fields set), **all** constraints applied through this connection are withdrawn.
- If one or more fields are set in `options`, only the constraints corresponding to those fields are withdrawn, leaving any other fields untouched.

Each cleared field reverts to the next active constraint, if any, or otherwise to the
autonomous hardware / board-configured default that [Controller](https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Controller) restores on close.
Succeeds without effect for any targeted field that is not currently constrained.

Parameters:

- `options`: Mask of `ControlOptions` fields whose constraints should be withdrawn, or an empty table to withdraw all constraints on this connection.

Errors:

- `IO`: Communication failure with the charger hardware. Fields that could not be reverted retain their constraint, so the call can be retried.
- `INTERNAL`: Internal driver error.

#### Request

| Name | Type |
|---|---|
| `options` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#ControlOptions` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Controller_ClearControl_Result` |

### SetControl

Applies operational and electrical constraints to the charger converter.

Validation is atomic: a request rejected with `NOT_SUPPORTED` or `INVALID_ARGS` leaves
hardware and session state untouched. The response is returned only after all corresponding
hardware register writes have completed and been acknowledged by the charger IC.

Parameters:

- `options`: The constraints to apply. Present fields overwrite the constraints previously set on this connection for those fields; omitted fields leave this connection's prior constraints for those fields unchanged.

Errors:

- `NOT_SUPPORTED`: One or more requested constraints are not adjustable on this hardware/arbiter, or the requested `operating_mode` is absent from `Spec.supported_modes`.
- `INVALID_ARGS`: A requested value cannot be applied (for example, a limit below the hardware's lowest programmable step), or the requested `operating_mode` conflicts with the active power path state (for example, requesting `OperatingMode::OTG` while external input power is online on the same port).
- `IO`: Communication failure with the charger hardware (e.g. SPMI transfer failure).
- `INTERNAL`: Internal driver error.

#### Request

| Name | Type |
|---|---|
| `options` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#ControlOptions` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Controller_SetControl_Result` |

## **STRUCTS**

### Charger_ConfigureWatch_Response

*Defined in [fuchsia.hardware.power.charger/charger.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.power.charger/charger.fidl;l=378)*

| Field | Type | Description | Default |
|---|---|---|---|
| `effective_options` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#WatchOptions` |   | No default |

### Charger_GetSpec_Response

*Defined in [fuchsia.hardware.power.charger/charger.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.power.charger/charger.fidl;l=327)*

| Field | Type | Description | Default |
|---|---|---|---|
| `spec` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Spec` |   | No default |

### Charger_GetStatus_Response

*Defined in [fuchsia.hardware.power.charger/charger.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.power.charger/charger.fidl;l=339)*

| Field | Type | Description | Default |
|---|---|---|---|
| `status` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Status` |   | No default |

### Charger_Watch_Response [resource](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#value-vs-resource)

*Defined in [fuchsia.hardware.power.charger/charger.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.power.charger/charger.fidl;l=411)*

| Field | Type | Description | Default |
|---|---|---|---|
| `status` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Status` |   | No default |
| `wake_lease` | `https://fuchsia.dev/reference/fuchsia.power.system//https://fuchsia.dev/reference/fuchsia.power.system#LeaseToken` |   | No default |

### Controller_ClearControl_Response

*Defined in [fuchsia.hardware.power.charger/charger.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.power.charger/charger.fidl;l=525)*

\<EMPTY\>

### Controller_SetControl_Response

*Defined in [fuchsia.hardware.power.charger/charger.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.power.charger/charger.fidl;l=499)*

\<EMPTY\>

## **ENUMS**

### ChargePhase [flexible](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint32`

*Defined in [fuchsia.hardware.power.charger/charger.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.power.charger/charger.fidl;l=34)*

Describes the active charging phase of the charger hardware.

Lithium-ion battery charging typically transitions across distinct stages:
Pre-conditioning/Trickle -\> Constant Current (Fast) -\> Constant Voltage (Taper) -\> Top-off -\>
Done.

<br />

| Name | Value | Description |
|---|---|---|
| ### NONE | `1` | The charger is idle, off, or not supplying charging power to the battery (including during passthrough, bypass, or charge-inhibit mode). |
| ### TRICKLE | `2` | Pre-qualification / trickle charging phase. Used when the battery is deeply depleted below the pre-charge voltage threshold; current is limited to a small, safe level to restore cell voltage before fast charge. |
| ### FAST | `3` | Constant Current (CC) fast charging phase. The charger acts as a regulated current source supplying maximum programmed fast charge current. |
| ### TAPER | `4` | Constant Voltage (CV) taper phase. The battery voltage has reached the regulation target limit; current naturally tapers down as the cell saturates. |
| ### TOP_OFF | `5` | Top-off charging phase. Low-current charging stage right after the CV termination threshold is reached, providing a timed saturation before stopping. |
| ### DONE | `6` | Charge termination complete. The charger has completed its charging cycle (e.g. top-off timer or termination-current threshold reached) and has cut off charge current to the battery while continuing to supply system load. The charger may automatically re-enter `FAST` if battery voltage decays below the recharge threshold. |

### Error [flexible](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint32`

*Defined in [fuchsia.hardware.power.charger/charger.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.power.charger/charger.fidl;l=11)*

Errors returned by the charger protocols.

<br />

| Name | Value | Description |
|---|---|---|
| ### INTERNAL | `1` | An unexpected error occurred within the driver. |
| ### NOT_SUPPORTED | `2` | The requested operation, field, or mode is not supported by this hardware. |
| ### INVALID_ARGS | `3` | One or more arguments provided to the method were invalid, or a requested value lies outside the range the hardware can program. |
| ### IO | `4` | Communication with the charger hardware failed (e.g. a bus transfer error). |
| ### ALREADY_WATCHING | `5` | A `Watch` call is already pending on this connection. |

### Health [flexible](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint32`

*Defined in [fuchsia.hardware.power.charger/charger.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.power.charger/charger.fidl;l=108)*

Hardware health and fault conditions of the charging converter.

<br />

| Name | Value | Description |
|---|---|---|
| ### GOOD | `1` | Normal operation; no faults or converter thermal throttling detected. |
| ### INPUT_OVER_VOLTAGE | `2` | Input voltage on the charger supply rail exceeds the over-voltage lockout (OVLO) limit. |
| ### INPUT_UNDER_VOLTAGE | `3` | Input voltage on the charger supply rail fell below the under-voltage lockout (UVLO) operational floor. |
| ### THERMAL_WARNING | `4` | Internal charger die temperature reached the thermal regulation (TREG) threshold; the converter is still operating but actively folding back current to limit die heating. |
| ### THERMAL_SHUTDOWN | `5` | Internal charger die or input connector temperature exceeded thermal shutdown (TSHDN) protection limits and the converter has suspended operation. |
| ### SAFETY_TIMER_EXPIRED | `6` | Hardware charge safety timer expired before reaching the target charge state. |
| ### BATTERY_OVER_VOLTAGE | `7` | Voltage sensed at the charger output rail exceeded the converter's over-voltage threshold. |
| ### WATCHDOG_TIMER_EXPIRED | `8` | Hardware watchdog timer expired (`WDT`), suspending converter operation. |
| ### UNSPECIFIED_FAILURE | `9` | Unspecified charger hardware fault. |

### OperatingMode [flexible](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint32`

*Defined in [fuchsia.hardware.power.charger/charger.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.power.charger/charger.fidl;l=74)*

Describes the primary power converter operating state across the power path and battery
interface.

Reported as state in `Status` and requested as a target in `ControlOptions`. A requested mode
selects the converter configuration; the state subsequently reported also accounts for whether
external power is actually present, so a charger left in `CHARGING` reports `DISCHARGING` once
the input goes away.

<br />

| Name | Value | Description |
|---|---|---|
| ### CHARGING | `1` | Normal operation: External power supplies system rails and charges the battery. Requesting this mode resumes normal charging after `PASSTHROUGH` or `DISCHARGING`. |
| ### PASSTHROUGH | `2` | Inhibit charge / passthrough: External power supplies system rails, but battery charging is disabled (cell rests at current state of charge). |
| ### DISCHARGING | `3` | As a request: force discharge. External power draw is suspended; the system runs exclusively on battery while external communication (e.g. USB data) remains active. As reported state: the battery is supplying the system, either because discharge was requested or because no external power is present. Use `Status.online` to tell these apart. A configured `PASSTHROUGH` is not separately observable while offline. |
| ### OTG | `4` | OTG / Reverse Boost: Power is sourced outward from the battery to the external port. |

### SourceType [flexible](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint32`

*Defined in [fuchsia.hardware.power.charger/charger.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.power.charger/charger.fidl;l=96)*

Describes the external power source type feeding the charger.

<br />

| Name | Value | Description |
|---|---|---|
| ### AC | `1` | Standard wall-plug adapter or dedicated charger (e.g. BC1.2 DCP). |
| ### USB | `2` | Standard USB host or charging downstream port (e.g. BC1.2 SDP / CDP). |
| ### WIRELESS | `3` | Inductive or magnetic resonance wireless charging pad (e.g. WCIN / Qi). |

## **TABLES**

### ControlOptions

*Defined in [fuchsia.hardware.power.charger/charger.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.power.charger/charger.fidl;l=428)*

Operational and electrical constraints applicable to the charger converter.

This is a partial update: only the fields present are applied, and any omitted field leaves the
corresponding hardware setting unchanged. While the `Controller` connection remains open, to
relax or withdraw a previously applied limit, set the field again to the desired value, call
[Controller.ClearControl](https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Controller.ClearControl) with a mask of fields to withdraw, or close the `Controller`
channel to withdraw all constraints and restore driver defaults.

When a value falls between discrete hardware steps, or when votes from several clients conflict,
less charging is preferred. Lower values charge less, except for `charge_term_current_ua` and
`input_voltage_limit_uv`, where higher values do.

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `operating_mode` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#OperatingMode` | Desired operational mode of the power converter. |
| ### 2 | `input_current_limit_ua` | `uint32` | Input current limit (ICL), in microamps. |
| ### 3 | `charge_current_limit_ua` | `uint32` | Fast charge current (FCC) limit for the battery, in microamps. |
| ### 4 | `float_voltage_uv` | `uint32` | Float (CV) regulation voltage for the battery, in microvolts (bounded by `Spec.max_charge_voltage_uv`). Note that writing a float voltage target may cause the hardware charge state machine to exit `ChargePhase::TOP_OFF` and re-evaluate CV regulation. |
| ### 5 | `charge_term_current_ua` | `uint32` | Charge termination (top-off / taper cutoff) current threshold, in microamps: when the charge current falls to it, the charger ends constant-voltage charging. |
| ### 6 | `input_voltage_limit_uv` | `uint32` | Input voltage regulation floor (VINDPM), in microvolts, below which the converter throttles input current draw to prevent source collapse. |
| ### 7 | `top_off_duration` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/zx#Duration` | How long the charger stays in `ChargePhase::TOP_OFF`, after the charge current falls below the termination threshold, before it enters `ChargePhase::DONE`. |

### Spec

*Defined in [fuchsia.hardware.power.charger/charger.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.power.charger/charger.fidl;l=183)*

Static hardware characteristics and driver capabilities.

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `max_charge_current_ua` | `uint32` | Optional. Maximum current the charger hardware can supply to the battery, in microamps. Omitted if unsupported by hardware. |
| ### 2 | `max_charge_voltage_uv` | `uint32` | Optional. Maximum voltage the charger hardware can regulate across the battery, in microvolts. Omitted if unsupported by hardware. |
| ### 3 | `max_input_current_ua` | `uint32` | Optional. Maximum input current the charger input power path can draw, in microamps. Omitted if unsupported by hardware. |
| ### 4 | `model` | `string:128` | Optional. Informational charger model string or manufacturer part number. Omitted if unknown or unprogrammed in hardware. |
| ### 5 | `supported_modes` | `vector<https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#OperatingMode>:16` | Optional. List of operating modes supported by this charger hardware implementation. Omitted if unsupported or unconfigurable by hardware. |
| ### 6 | `supported_options` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#WatchOptions` | Required. The interest and wake options supported by this driver/hardware. Drivers must populate this table so clients know which fields support active change notifications. If omitted by the driver, clients should assume no active interrupt watching is supported. - `supported_options.interest`: Telemetry fields that can actively trigger hanging-get watch notifications on change. Fields omitted are passive measurements that do not generate hardware interrupts; their freshest values are returned during active state changes or via [Charger.GetStatus](https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Charger.GetStatus). - `supported_options.wake_on`: Telemetry fields capable of actively waking the system from suspend via hardware interrupt lines etc. - `supported_options.max_interval`: Present if the server supports periodic sampling; its value is the shortest interval the server will honor. - `supported_options.wake_on_max_interval`: True if the server can wake the system from suspend to take a `max_interval` sample. |
| ### 7 | `precharge_current_ua` | `uint32` | Optional. Trickle/precharge current supplied when battery voltage is below the fast-charge threshold, in microamps. Omitted if unsupported by hardware. |
| ### 8 | `charge_term_current_ua` | `uint32` | Optional. Default or minimum charge termination (top-off / taper cutoff) current threshold, in microamps. Omitted if unsupported by hardware. |
| ### 9 | `recharge_voltage_uv` | `uint32` | Optional. Battery voltage threshold (or drop below float voltage) at which the charger automatically initiates a recharge cycle after reaching `ChargePhase::DONE`, in microvolts. Omitted if unsupported by hardware. |
| ### 10 | `min_input_voltage_uv` | `uint32` | Optional. Minimum programmable input voltage regulation floor (VINDPM), in microvolts. Omitted if unsupported by hardware. |
| ### 11 | `max_input_voltage_uv` | `uint32` | Optional. Maximum programmable input voltage regulation floor (VINDPM), in microvolts. Omitted if unsupported by hardware. |

### Status

*Defined in [fuchsia.hardware.power.charger/charger.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.power.charger/charger.fidl;l=248)*

Primary telemetry snapshot of the charging regulator and its power inputs.

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `online` | `bool` | Whether an external power supply or adapter (e.g. VBUS / USB-C / wireless) is physically attached and supplying valid power. If false, no external source is detected. Omitted if attachment status is indeterminate. |
| ### 2 | `input_voltage_uv` | `uint32` | The measured input voltage from the external power source in microvolts. Omitted if unsupported by hardware or unavailable. |
| ### 3 | `input_current_ua` | `int32` | The measured input current drawn from the external power source in microamps. Positive (+) indicates current drawn into the charger from the external power source; negative (-) indicates current sourced outward to the external port (e.g. during `OperatingMode::OTG` reverse boost, if the hardware senses reverse port current). Omitted if unsupported by hardware or unavailable. |
| ### 4 | `operating_mode` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#OperatingMode` | Active operational mode of the power converter and battery interface. Omitted if indeterminate or unsupported by hardware. |
| ### 5 | `charge_phase` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#ChargePhase` | Current charging phase. Omitted if indeterminate or unsupported by hardware. |
| ### 6 | `input_current_limit_ua` | `uint32` | Active Input Current Limit (ICL) programmed into the input power path, in microamps. Represents the maximum current the charger is permitted to draw from the external input. Omitted if indeterminate or unsupported by hardware. |
| ### 7 | `charge_current_limit_ua` | `uint32` | Active Fast Charge Current (FCC) regulation limit programmed for the battery, in microamps. Represents the target constant-current delivered to the battery terminals during fast charge. Omitted if indeterminate or unsupported by hardware. |
| ### 8 | `float_voltage_uv` | `uint32` | Active float (constant voltage / CV) regulation target programmed for the battery, in microvolts. Represents the maximum terminal voltage across the battery pack (as distinct from the static hardware ceiling `Spec.max_charge_voltage_uv`). Omitted if indeterminate or unsupported by hardware. |
| ### 9 | `source_type` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#SourceType` | The detected external power supply type feeding the charger. Omitted if indeterminate or disconnected. |
| ### 10 | `health` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Health` | Hardware health and fault condition of the charging converter. Omitted if indeterminate or unsupported by hardware. |
| ### 11 | `charge_term_current_ua` | `uint32` | Active charge termination (top-off / taper cutoff) current threshold programmed into the charger, in microamps. Omitted if indeterminate or unsupported by hardware. |
| ### 12 | `input_voltage_limit_uv` | `uint32` | Active minimum input voltage regulation floor (VINDPM) programmed into the input power path, in microvolts. Omitted if indeterminate or unsupported by hardware. |
| ### 13 | `top_off_duration` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/zx#Duration` | Active top-off duration programmed into the charger: how long it stays in `ChargePhase::TOP_OFF` before entering `ChargePhase::DONE`. Omitted if indeterminate or unsupported by hardware. |

### WatchOptions

*Defined in [fuchsia.hardware.power.charger/charger.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.power.charger/charger.fidl;l=149)*

Configuration options for charger state watching.

`interest` and `wake_on` are optional masks: the actual field values within the `Status` table
are ignored; only field presence (set vs. unset) determines the mask.

An absent mask means "use this field's default"; a present but empty mask means "no fields".
The two defaults differ because the safe choice differs: `interest` defaults to everything the
driver supports watching, so a client that never configures anything still makes progress,
while `wake_on` defaults to nothing, since waking the system is a cost a client must opt into.

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `interest` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Status` | Fields the client wants to receive change notifications for. Defaults to every field the driver supports watching, as reported by `Spec.supported_options`. Pass an explicitly empty table to be notified only for the fields named in `wake_on`. |
| ### 2 | `wake_on` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Status` | Fields that should actively wake the system from suspend. Any field present in `wake_on` is implicitly included in `interest`. Defaults to no fields: changes occurring during suspend are deferred until the next system wakeup and do not wake the device. |
| ### 3 | `max_interval` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/zx#Duration` | Maximum time between `Watch` responses. When set, the server completes a pending `Watch` with a freshly sampled `Status` once this much time has passed since the previous response, even if no field in `interest` changed. The time is measured on the boot timeline, so time spent suspended counts towards it. Defaults to absent: `Watch` only completes on changes. Servers that do not support periodic sampling omit this field from the effective options returned by `ConfigureWatch` and from `Spec.supported_options`. Servers may clamp the value, and report the interval they will honor in the effective options. Samples do not wake the system from suspend unless `wake_on_max_interval` is set: a sample that falls due while the system is suspended is taken once the system resumes. |
| ### 4 | `wake_on_max_interval` | `bool` | Whether a `max_interval` sample that falls due while the system is suspended wakes the system. Defaults to false; like `wake_on`, waking the system is a cost the client opts into. Ignored if `max_interval` is absent. Servers that cannot wake the system omit this field from the effective options returned by `ConfigureWatch` and from `Spec.supported_options`. |

## **UNIONS**

### Charger_ConfigureWatch_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.hardware.power.charger/charger.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.power.charger/charger.fidl;l=378)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Charger_ConfigureWatch_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Error` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### Charger_GetSpec_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.hardware.power.charger/charger.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.power.charger/charger.fidl;l=327)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Charger_GetSpec_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Error` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### Charger_GetStatus_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.hardware.power.charger/charger.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.power.charger/charger.fidl;l=339)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Charger_GetStatus_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Error` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### Charger_Watch_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible) [resource](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#value-vs-resource)

*Defined in [fuchsia.hardware.power.charger/charger.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.power.charger/charger.fidl;l=411)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Charger_Watch_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Error` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### Controller_ClearControl_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.hardware.power.charger/charger.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.power.charger/charger.fidl;l=525)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Controller_ClearControl_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Error` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### Controller_SetControl_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.hardware.power.charger/charger.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.power.charger/charger.fidl;l=499)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Controller_SetControl_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.power.charger#Error` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

## **SERVICES**

### DebugService

*Defined in [fuchsia.hardware.power.charger/charger.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.power.charger/charger.fidl;l=565)*

| Name | Type | Transport |
|---|---|---|
| [debug](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.power.charger/charger.fidl;l=566) | `fuchsia.hardware.power.charger/Debug` | Channel |

<br />

### Service

*Defined in [fuchsia.hardware.power.charger/charger.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.power.charger/charger.fidl;l=556)*

| Name | Type | Transport |
|---|---|---|
| [charger](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.power.charger/charger.fidl;l=557) | `fuchsia.hardware.power.charger/Charger` | Channel |
| [controller](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.power.charger/charger.fidl;l=558) | `fuchsia.hardware.power.charger/Controller` | Channel |

<br />