pub struct Measure(pub u8);
Tuple Fields§
§0: u8
Implementations§
source§impl Measure
impl Measure
sourcepub fn meas_vbus(&self) -> bool
pub fn meas_vbus(&self) -> bool
false: MDAC/comparator measurement is controlled by MEAS_CC* bits true: Measure VBUS with the MDAC/comparator. This requires MEAS_CC* bits to be 0
sourcepub fn with_meas_vbus(self, value: bool) -> Self
pub fn with_meas_vbus(self, value: bool) -> Self
false: MDAC/comparator measurement is controlled by MEAS_CC* bits true: Measure VBUS with the MDAC/comparator. This requires MEAS_CC* bits to be 0
sourcepub fn set_meas_vbus(&mut self, value: bool)
pub fn set_meas_vbus(&mut self, value: bool)
false: MDAC/comparator measurement is controlled by MEAS_CC* bits true: Measure VBUS with the MDAC/comparator. This requires MEAS_CC* bits to be 0
sourcepub fn mdac(&self) -> u8
pub fn mdac(&self) -> u8
Measure Block DAC data input. LSB is equivalent to 42 mV of voltage which is compared to the measured CC voltage. The measured CC is selected by MEAS_CC2, or MEAS_CC1 bits:
MDAC[5:0] | MEAS_VBUS = 0 | MEAS_VBUS = 1 | Unit |
---|---|---|---|
00_0000 | 0.042 | 0.420 | V |
00_0001 | 0.084 | 0.840 | V |
11_0000 | 2.058 | 20.58 | V |
11_0011 | 2.184 | 21.84 | V |
11_1110 | 2.646 | 26.46 | V |
11_1111 | >2.688 | 26.88 | V |
11_1111 | >2.688 | 26.88 | V |
sourcepub fn with_mdac(self, value: u8) -> Self
pub fn with_mdac(self, value: u8) -> Self
Measure Block DAC data input. LSB is equivalent to 42 mV of voltage which is compared to the measured CC voltage. The measured CC is selected by MEAS_CC2, or MEAS_CC1 bits:
MDAC[5:0] | MEAS_VBUS = 0 | MEAS_VBUS = 1 | Unit |
---|---|---|---|
00_0000 | 0.042 | 0.420 | V |
00_0001 | 0.084 | 0.840 | V |
11_0000 | 2.058 | 20.58 | V |
11_0011 | 2.184 | 21.84 | V |
11_1110 | 2.646 | 26.46 | V |
11_1111 | >2.688 | 26.88 | V |
11_1111 | >2.688 | 26.88 | V |
sourcepub fn set_mdac(&mut self, value: u8)
pub fn set_mdac(&mut self, value: u8)
Measure Block DAC data input. LSB is equivalent to 42 mV of voltage which is compared to the measured CC voltage. The measured CC is selected by MEAS_CC2, or MEAS_CC1 bits:
MDAC[5:0] | MEAS_VBUS = 0 | MEAS_VBUS = 1 | Unit |
---|---|---|---|
00_0000 | 0.042 | 0.420 | V |
00_0001 | 0.084 | 0.840 | V |
11_0000 | 2.058 | 20.58 | V |
11_0011 | 2.184 | 21.84 | V |
11_1110 | 2.646 | 26.46 | V |
11_1111 | >2.688 | 26.88 | V |
11_1111 | >2.688 | 26.88 | V |
Trait Implementations§
source§impl PartialEq for Measure
impl PartialEq for Measure
impl Copy for Measure
impl Eq for Measure
impl StructuralPartialEq for Measure
Auto Trait Implementations§
impl Freeze for Measure
impl RefUnwindSafe for Measure
impl Send for Measure
impl Sync for Measure
impl Unpin for Measure
impl UnwindSafe for Measure
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
source§impl<T, U> UnsafeFrom<U> for Twhere
U: Into<T>,
impl<T, U> UnsafeFrom<U> for Twhere
U: Into<T>,
source§unsafe fn unsafe_from(other: U) -> T
unsafe fn unsafe_from(other: U) -> T
Calls U::into(other)
.
That is, this conversion is whatever the implementation of Into
<T> for U
chooses to
do.
source§impl<T, U> UnsafeInto<U> for Twhere
U: UnsafeFrom<T>,
impl<T, U> UnsafeInto<U> for Twhere
U: UnsafeFrom<T>,
source§unsafe fn unsafe_into(self) -> U
unsafe fn unsafe_into(self) -> U
Calls U::unsafe_from(self)
.
That is, this conversion is whatever the implementation of UnsafeFrom
<T> for U
chooses to do.