[][src]Struct mpu9250::SpiDevice

pub struct SpiDevice<SPI, GPIO> { /* fields omitted */ }

A SPI device. Use a SPI device when the MPU9250 is connected via SPI

Methods

impl<SPI, NCS, E> SpiDevice<SPI, NCS> where
    SPI: Write<u8, Error = E> + Transfer<u8, Error = E>,
    NCS: OutputPin
[src]

pub fn new(spi: SPI, ncs: NCS) -> Self[src]

Create a new SpiDevice

Trait Implementations

impl<SPI, NCS, E> Device for SpiDevice<SPI, NCS> where
    SPI: Write<u8, Error = E> + Transfer<u8, Error = E>,
    NCS: OutputPin
[src]

type Error = E

The type of error for all results

fn read(&mut self, reg: Register) -> Result<u8, Self::Error>[src]

Read a single value from the register

fn modify<F>(&mut self, reg: Register, f: F) -> Result<(), Self::Error> where
    F: FnOnce(u8) -> u8, 
[src]

Modify the value in the register using the provided closure. The closure accepts the current value of the register, permitting conditional checks before modification. Read more

Auto Trait Implementations

impl<SPI, GPIO> Send for SpiDevice<SPI, GPIO> where
    GPIO: Send,
    SPI: Send

impl<SPI, GPIO> Sync for SpiDevice<SPI, GPIO> where
    GPIO: Sync,
    SPI: Sync

Blanket Implementations

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

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

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

impl<T> Same for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf for SP where
    SS: SubsetOf<SP>,