[−][src]Struct pmw3901_ehal::PMW3901
Implementations
impl<SPI, CSN, CommE, PinE> PMW3901<SPI, CSN> where
SPI: Write<u8, Error = CommE> + Transfer<u8, Error = CommE>,
CSN: OutputPin<Error = PinE>,
[src]
SPI: Write<u8, Error = CommE> + Transfer<u8, Error = CommE>,
CSN: OutputPin<Error = PinE>,
pub fn new(spi: SPI, csn: CSN) -> Self
[src]
pub fn init(
&mut self,
delay_source: &mut impl DelayMs<u32>
) -> Result<(), Error<CommE, PinE>>
[src]
&mut self,
delay_source: &mut impl DelayMs<u32>
) -> Result<(), Error<CommE, PinE>>
Initialize this device
pub fn get_motion(&mut self) -> Result<(i16, i16), Error<CommE, PinE>>
[src]
Main method for obtaining the (dx, dy) flow
pub fn register_read(&mut self, reg: Register) -> Result<u8, Error<CommE, PinE>>
[src]
Read a single register's value
pub fn register_write(
&mut self,
reg: u8,
val: u8
) -> Result<(), Error<CommE, PinE>>
[src]
&mut self,
reg: u8,
val: u8
) -> Result<(), Error<CommE, PinE>>
Write a value to a single register
Auto Trait Implementations
impl<SPI, CSN> Send for PMW3901<SPI, CSN> where
CSN: Send,
SPI: Send,
CSN: Send,
SPI: Send,
impl<SPI, CSN> Sync for PMW3901<SPI, CSN> where
CSN: Sync,
SPI: Sync,
CSN: Sync,
SPI: Sync,
impl<SPI, CSN> Unpin for PMW3901<SPI, CSN> where
CSN: Unpin,
SPI: Unpin,
CSN: Unpin,
SPI: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,