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<OperatingMode>
pub fn from_primitive_allow_unknown(prim: u32) -> OperatingMode
pub fn unknown() -> OperatingMode
pub const fn into_primitive(self) -> u32
pub fn is_unknown(&self) -> bool
Trait Implementations§
Source§impl Clone for OperatingMode
impl Clone for OperatingMode
Source§fn clone(&self) -> OperatingMode
fn clone(&self) -> OperatingMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for OperatingMode
Source§impl Debug for OperatingMode
impl Debug for OperatingMode
Source§impl<D> Decode<OperatingMode, D> for OperatingModewhere
D: ResourceDialect,
impl<D> Decode<OperatingMode, D> for OperatingModewhere
D: ResourceDialect,
Source§fn new_empty() -> OperatingMode
fn new_empty() -> OperatingMode
Self. The specific value does not matter,
since it will be overwritten by decode.Source§impl<D> Encode<OperatingMode, D> for OperatingModewhere
D: ResourceDialect,
impl<D> Encode<OperatingMode, D> for OperatingModewhere
D: ResourceDialect,
impl Eq for OperatingMode
Source§impl Hash for OperatingMode
impl Hash for OperatingMode
Source§impl Ord for OperatingMode
impl Ord for OperatingMode
Source§fn cmp(&self, other: &OperatingMode) -> Ordering
fn cmp(&self, other: &OperatingMode) -> Ordering
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 moreSource§fn borrow(
value: &<OperatingMode as TypeMarker>::Owned,
) -> <OperatingMode as ValueTypeMarker>::Borrowed<'_>
fn borrow( value: &<OperatingMode as TypeMarker>::Owned, ) -> <OperatingMode as ValueTypeMarker>::Borrowed<'_>
&Self::Owned to Self::Borrowed.