[][src]Struct l3gd20::L3gd20

pub struct L3gd20<SPI, CS> { /* fields omitted */ }

L3GD20 driver

Implementations

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

pub fn new(spi: SPI, cs: CS) -> Result<Self, E>[src]

Creates a new driver from a SPI peripheral and a NCS pin

pub fn all(&mut self) -> Result<Measurements, E>[src]

Temperature measurement + gyroscope measurements

pub fn gyro(&mut self) -> Result<I16x3, E>[src]

Gyroscope measurements

pub fn temp(&mut self) -> Result<i8, E>[src]

Temperature sensor measurement

pub fn who_am_i(&mut self) -> Result<u8, E>[src]

Reads the WHO_AM_I register; should return 0xD4

pub fn status(&mut self) -> Result<Status, E>[src]

Read STATUS_REG of sensor

pub fn odr(&mut self) -> Result<Odr, E>[src]

Get the current Output Data Rate

pub fn set_odr(&mut self, odr: Odr) -> Result<&mut Self, E>[src]

Set the Output Data Rate

pub fn bandwidth(&mut self) -> Result<Bandwidth, E>[src]

Get current Bandwidth

pub fn set_bandwidth(&mut self, bw: Bandwidth) -> Result<&mut Self, E>[src]

Set low-pass cut-off frequency (i.e. bandwidth)

See Bandwidth for further explanation

pub fn scale(&mut self) -> Result<Scale, E>[src]

Get the current Full Scale Selection

This is the sensitivity of the sensor, see Scale for more information

pub fn set_scale(&mut self, scale: Scale) -> Result<&mut Self, E>[src]

Set the Full Scale Selection

This sets the sensitivity of the sensor, see Scale for more information

Auto Trait Implementations

impl<SPI, CS> Send for L3gd20<SPI, CS> where
    CS: Send,
    SPI: Send

impl<SPI, CS> Sync for L3gd20<SPI, CS> where
    CS: Sync,
    SPI: Sync

impl<SPI, CS> Unpin for L3gd20<SPI, CS> where
    CS: 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.