#[repr(u8)]pub enum DeviceMode {
Working = 0,
Factory = 4,
}Expand description
Device operating mode
The FT6336U can operate in different modes for normal operation or factory testing.
§Examples
use ft6336u_driver::DeviceMode;
let mode = DeviceMode::Working;
assert_eq!(mode.to_register(), 0x00);
let parsed = DeviceMode::from_register(0x00).unwrap();
assert_eq!(parsed, DeviceMode::Working);Variants§
Implementations§
Source§impl DeviceMode
impl DeviceMode
Sourcepub fn from_register(val: u8) -> Option<Self>
pub fn from_register(val: u8) -> Option<Self>
Convert from raw register value
Sourcepub fn to_register(self) -> u8
pub fn to_register(self) -> u8
Convert to register value
Trait Implementations§
Source§impl Clone for DeviceMode
impl Clone for DeviceMode
Source§fn clone(&self) -> DeviceMode
fn clone(&self) -> DeviceMode
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DeviceMode
impl Debug for DeviceMode
Source§impl PartialEq for DeviceMode
impl PartialEq for DeviceMode
impl Copy for DeviceMode
impl Eq for DeviceMode
impl StructuralPartialEq for DeviceMode
Auto Trait Implementations§
impl Freeze for DeviceMode
impl RefUnwindSafe for DeviceMode
impl Send for DeviceMode
impl Sync for DeviceMode
impl Unpin for DeviceMode
impl UnwindSafe for DeviceMode
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