pub struct Reading {
pub shunt: i16,
pub bus: u16,
pub current: i16,
pub power: u16,
pub current_lsb_microamps: u32,
}Expand description
One set of results, with the current resolution they were taken at.
The four data registers are kept as read; the methods apply the datasheet’s
scaling. A Reading whose current and power are zero means the calibration
register was never programmed.
Fields§
§shunt: i16The Shunt Voltage register.
bus: u16The Bus Voltage register, flags included.
current: i16The Current register.
power: u16The Power register.
current_lsb_microamps: u32The programmed current resolution, in microamps per count.
Implementations§
Source§impl Reading
impl Reading
Sourcepub fn shunt_microvolts(&self) -> i32
pub fn shunt_microvolts(&self) -> i32
Returns the shunt voltage in microvolts.
Sourcepub fn bus_millivolts(&self) -> u32
pub fn bus_millivolts(&self) -> u32
Returns the bus voltage in millivolts.
Sourcepub fn current_microamps(&self) -> i32
pub fn current_microamps(&self) -> i32
Returns the current in microamps.
Sourcepub fn power_microwatts(&self) -> u32
pub fn power_microwatts(&self) -> u32
Returns the power in microwatts.
Sourcepub fn math_overflow(&self) -> bool
pub fn math_overflow(&self) -> bool
Reports the math overflow flag: the current and power may be meaningless.
Trait Implementations§
impl Copy for Reading
impl Eq for Reading
impl StructuralPartialEq for Reading
Auto Trait Implementations§
impl Freeze for Reading
impl RefUnwindSafe for Reading
impl Send for Reading
impl Sync for Reading
impl Unpin for Reading
impl UnsafeUnpin for Reading
impl UnwindSafe for Reading
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