pub struct OcPreg(pub u8);
Tuple Fields§
§0: u8
Implementations§
source§impl OcPreg
impl OcPreg
sourcepub fn ocp_range(&self) -> bool
pub fn ocp_range(&self) -> bool
true
: OCP range between 100−800 mA (max_range = 800 mA)false
: OCP range between 10−80 mA (max_range = 80 mA)
sourcepub fn with_ocp_range(self, value: bool) -> Self
pub fn with_ocp_range(self, value: bool) -> Self
true
: OCP range between 100−800 mA (max_range = 800 mA)false
: OCP range between 10−80 mA (max_range = 80 mA)
sourcepub fn set_ocp_range(&mut self, value: bool)
pub fn set_ocp_range(&mut self, value: bool)
true
: OCP range between 100−800 mA (max_range = 800 mA)false
: OCP range between 10−80 mA (max_range = 80 mA)
sourcepub fn ocp_cur(&self) -> u8
pub fn ocp_cur(&self) -> u8
111
: max_range (see bit definition above for OCP_RANGE)110
: 7 * max_range / 8101
: 6 * max_range / 8100
: 5 * max_range / 8011
: 4 * max_range / 8010
: 3 * max_range / 8001
: 2 * max_range / 8000
: max_range / 8
sourcepub fn with_ocp_cur(self, value: u8) -> Self
pub fn with_ocp_cur(self, value: u8) -> Self
111
: max_range (see bit definition above for OCP_RANGE)110
: 7 * max_range / 8101
: 6 * max_range / 8100
: 5 * max_range / 8011
: 4 * max_range / 8010
: 3 * max_range / 8001
: 2 * max_range / 8000
: max_range / 8
sourcepub fn set_ocp_cur(&mut self, value: u8)
pub fn set_ocp_cur(&mut self, value: u8)
111
: max_range (see bit definition above for OCP_RANGE)110
: 7 * max_range / 8101
: 6 * max_range / 8100
: 5 * max_range / 8011
: 4 * max_range / 8010
: 3 * max_range / 8001
: 2 * max_range / 8000
: max_range / 8
Trait Implementations§
source§impl PartialEq for OcPreg
impl PartialEq for OcPreg
impl Copy for OcPreg
impl Eq for OcPreg
impl StructuralPartialEq for OcPreg
Auto Trait Implementations§
impl Freeze for OcPreg
impl RefUnwindSafe for OcPreg
impl Send for OcPreg
impl Sync for OcPreg
impl Unpin for OcPreg
impl UnwindSafe for OcPreg
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
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.