pub struct Reading { /* private fields */ }Expand description
One result register word, with the conversion to illuminance.
§Examples
use pamoja_sensors::opt3001::Reading;
// Exponent 0 over mantissa 3200: 0.01 lux per count, 32 lux.
let reading = Reading::new(0x0C80);
assert_eq!(reading.milli_lux(), 32_000);
assert_eq!(u16::from_be_bytes(reading.to_bytes()), 0x0C80, "high byte first");Implementations§
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