Google is committed to advancing racial equity for Black communities. See how.

fuchsia.hardware.power

PROTOCOLS

Power

Defined in fuchsia.hardware.power/power.fidl

GetCurrentVoltage

Get current voltage in uV.

Request

NameType
index uint32

Response

NameType
s zx/status
current_voltage uint32

GetPowerDomainStatus

Get power domain status

Request

<EMPTY>

Response

NameType
s zx/status
status PowerDomainStatus

GetSupportedVoltageRange

Get Supported Voltage Range. min and max are in micorVolts(uV)

Request

<EMPTY>

Response

NameType
s zx/status
min uint32
max uint32

ReadPmicCtrlReg

Read ctrl register of PMIC

Request

NameType
reg_addr uint32

Response

NameType
s zx/status
value uint32

RegisterPowerDomain

Register the callee for this power domain. The callee will be registered until UnregisterPowerDomain is called. Any voltage changes to the power domain will be made considering the min_needed_voltage(in uV) and max_supported_voltage(in uV) published here. If voltages mentioned are out of supported voltage range of domain(obtained by calling GetSupportedVoltageRange), the callee will be registered with the supported voltage range.

Request

NameType
min_needed_voltage uint32
max_supported_voltage uint32

Response

NameType
s zx/status

RequestVoltage

Request a particular voltage. The actual_voltage is the voltage that the power domain is transitioned to after considering supported voltage ranges of all the registered dependents. "voltage" should be in uV.

Request

NameType
voltage uint32

Response

NameType
s zx/status
actual_voltage uint32

UnregisterPowerDomain

Unregister the callee for this power domain. The callee will no longer be considered as a dependent of this power domain.

Request

<EMPTY>

Response

NameType
s zx/status

WritePmicCtrlReg

Write to ctrl register of PMIC

Request

NameType
reg_addr uint32
value uint32

Response

NameType
s zx/status

Source

Defined in fuchsia.hardware.power/power.fidl

GetBatteryInfo

Get battery info. Only supported if type == PowerType::BATTERY.

Request

<EMPTY>

Response

NameType
status zx/status
info BatteryInfo

GetPowerInfo

Get device info.

Request

<EMPTY>

Response

NameType
status zx/status
info SourceInfo

GetStateChangeEvent

Get an event to receive state change notifications on. ZX_USER_SIGNAL_0 is asserted when power_info_t.state is changed. It is deasserted when the state is read via GetPowerInfo.

Request

<EMPTY>

Response

NameType
status zx/status
handle handle<event>

STRUCTS

BatteryInfo

Defined in fuchsia.hardware.power/power.fidl

FieldTypeDescriptionDefault
unit BatteryUnit

capacity unit. all voltage fields are in millivolts

No default
design_capacity uint32

nominal capacity of a new battery

No default
last_full_capacity uint32

predicted battery capacity when fully charged

No default
design_voltage uint32

nominal voltage of a new battery

No default
capacity_warning uint32

capacity when the device will generate a warning notification

No default
capacity_low uint32

capacity when the device will generate a low battery notification

No default
capacity_granularity_low_warning uint32

the smallest increment the battery is capable of measuring between the low and warning capacities

No default
capacity_granularity_warning_full uint32

the smallest increment the battery is capable of measuring between the low and warning capacities

No default
present_rate int32

below fields are in units specified the unit field. charging/discharging rate in the capacity unit. positive is charging, negative is discharging

No default
remaining_capacity uint32 No default
present_voltage uint32 No default

SourceInfo

Defined in fuchsia.hardware.power/power.fidl

FieldTypeDescriptionDefault
type PowerType No default
state uint8 No default

ENUMS

BatteryUnit strict

Type: uint32

Defined in fuchsia.hardware.power/power.fidl

NameValueDescription
MW 0

Milliwatts

MA 1

Milliamps

PowerDomainStatus strict

Type: uint8

Defined in fuchsia.hardware.power/power.fidl

NameValueDescription
DISABLED 1
ENABLED 2

PowerType strict

Type: uint8

Defined in fuchsia.hardware.power/power.fidl

NameValueDescription
AC 0
BATTERY 1

CONSTANTS

NameValueTypeDescription
POWER_STATE_CHARGING 4 uint8
POWER_STATE_CRITICAL 8 uint8
POWER_STATE_DISCHARGING 2 uint8
POWER_STATE_ONLINE 1 uint8