pub enum OperatingMode {
Charging,
Passthrough,
Discharging,
Otg,
// some variants omitted
}Expand description
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.
Variants§
Charging
Normal operation: External power supplies system rails and charges the battery.
Requesting this mode resumes normal charging after PASSTHROUGH or DISCHARGING.
Passthrough
Inhibit charge / passthrough: External power supplies system rails, but battery charging is disabled (cell rests at current state of charge).
Discharging
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
OTG / Reverse Boost: Power is sourced outward from the battery to the external port.
Implementations§
Source§impl OperatingMode
impl OperatingMode
pub fn from_primitive(prim: u32) -> Option<Self>
pub fn from_primitive_allow_unknown(prim: u32) -> Self
pub fn unknown() -> Self
pub const fn into_primitive(self) -> u32
pub fn is_unknown(&self) -> bool
Trait Implementations§
Source§impl Clone for OperatingMode
impl Clone for OperatingMode
impl Copy for OperatingMode
Source§impl Debug for OperatingMode
impl Debug for OperatingMode
Source§impl<D: ResourceDialect> Decode<OperatingMode, D> for OperatingMode
impl<D: ResourceDialect> Decode<OperatingMode, D> for OperatingMode
Source§impl<D: ResourceDialect> Encode<OperatingMode, D> for OperatingMode
impl<D: ResourceDialect> Encode<OperatingMode, D> for OperatingMode
impl Eq for OperatingMode
Source§impl Hash for OperatingMode
impl Hash for OperatingMode
Source§impl Ord for OperatingMode
impl Ord for OperatingMode
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for OperatingMode
impl PartialEq for OperatingMode
Source§impl PartialOrd for OperatingMode
impl PartialOrd for OperatingMode
impl StructuralPartialEq for OperatingMode
Source§impl TypeMarker for OperatingMode
impl TypeMarker for OperatingMode
Source§type Owned = OperatingMode
type Owned = OperatingMode
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align.Source§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned to a single memcpy. Read moreSource§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned to a single memcpy.Source§impl ValueTypeMarker for OperatingMode
impl ValueTypeMarker for OperatingMode
Source§type Borrowed<'a> = OperatingMode
type Borrowed<'a> = OperatingMode
Encode<Self>
type cheaply obtainable from &Self::Owned. There are three cases: Read more