[][src]Struct pmw3901_ehal::PMW3901

pub struct PMW3901<SPI, CSN> { /* fields omitted */ }

Implementations

impl<SPI, CSN, CommE, PinE> PMW3901<SPI, CSN> where
    SPI: Write<u8, Error = CommE> + Transfer<u8, Error = CommE>,
    CSN: OutputPin<Error = PinE>, 
[src]

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]

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]

Write a value to a single register

Auto Trait Implementations

impl<SPI, CSN> Send for PMW3901<SPI, CSN> where
    CSN: Send,
    SPI: Send

impl<SPI, CSN> Sync for PMW3901<SPI, CSN> where
    CSN: Sync,
    SPI: Sync

impl<SPI, CSN> Unpin for PMW3901<SPI, CSN> where
    CSN: Unpin,
    SPI: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.