PDStatus

Struct PDStatus 

Source
pub struct PDStatus {
Show 13 fields pub status: u8, pub op_mode: u8, pub voltage_mv: u16, pub current_ma: u16, pub temperature: i8, pub requested_voltage_mv: u16, pub requested_current_ma: u16, pub is_attached: bool, pub is_busy: bool, pub has_fault: bool, pub fault_type: PDFault, pub cc_status: u8, pub pdp_limit_w: u8,
}
Expand description

Current status of the PD controller

Fields§

§status: u8

Raw status register value

§op_mode: u8

Raw operation mode register value

§voltage_mv: u16

Current output voltage in millivolts

§current_ma: u16

Current output current in milliamps

§temperature: i8

Temperature in degrees Celsius

§requested_voltage_mv: u16

Requested voltage in millivolts

§requested_current_ma: u16

Requested current in milliamps

§is_attached: bool

True if USB-PD source is attached and ready

§is_busy: bool

True if controller is busy processing a request

§has_fault: bool

True if any protection fault is active

§fault_type: PDFault

Type of fault if any

§cc_status: u8

CC line status

§pdp_limit_w: u8

Power delivery limit in watts

Trait Implementations§

Source§

impl Clone for PDStatus

Source§

fn clone(&self) -> PDStatus

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PDStatus

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PDStatus

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Copy for PDStatus

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.