pub struct PowerConfig {
pub voltage_cv: u16,
pub current_ca: u16,
pub frequency_hz: u8,
pub low_voltage_transfer_cv: u16,
pub high_voltage_transfer_cv: u16,
pub delay_before_shutdown_s: u16,
pub temperature_k: u16,
}Expand description
Configuration values (feature report 4).
Fields§
§voltage_cv: u16Nominal output voltage in centivolts.
current_ca: u16Nominal output current in centiamps.
frequency_hz: u8Nominal line frequency in hertz.
low_voltage_transfer_cv: u16Voltage below which the device transfers to battery power, in centivolts.
high_voltage_transfer_cv: u16Voltage above which the device transfers back to line power, in centivolts.
delay_before_shutdown_s: u16Grace period between a shutdown request and power removal, in seconds.
temperature_k: u16Nominal temperature in kelvin.
Implementations§
Source§impl PowerConfig
impl PowerConfig
Sourcepub fn from_bytes(bytes: &[u8]) -> Option<Self>
pub fn from_bytes(bytes: &[u8]) -> Option<Self>
Unpack a configuration report written by the host.
Returns None if the report is shorter than PowerConfig::SIZE;
bytes past the report are ignored.
Trait Implementations§
Source§impl Clone for PowerConfig
impl Clone for PowerConfig
impl Copy for PowerConfig
Source§impl Debug for PowerConfig
impl Debug for PowerConfig
Source§impl Default for PowerConfig
impl Default for PowerConfig
impl Eq for PowerConfig
Source§impl Format for PowerConfig
impl Format for PowerConfig
Source§impl PartialEq for PowerConfig
impl PartialEq for PowerConfig
impl StructuralPartialEq for PowerConfig
Auto Trait Implementations§
impl Forget for PowerConfig
impl Freeze for PowerConfig
impl Move for PowerConfig
impl RefUnwindSafe for PowerConfig
impl Send for PowerConfig
impl Sync for PowerConfig
impl Unpin for PowerConfig
impl UnsafeUnpin for PowerConfig
impl UnwindSafe for PowerConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more