[][src]Struct adxl343::Adxl343

pub struct Adxl343<I2C> { /* fields omitted */ }

ADXL343 driver

Methods

impl<I2C, E> Adxl343<I2C> where
    I2C: WriteRead<Error = E> + Write<Error = E>,
    E: Debug
[src]

pub fn new(i2c: I2C) -> Result<Self, Error<E>>[src]

Create a new ADXL343 driver from the given I2C peripheral

Default tap detection level: 2G, 31.25ms duration, single tap only

pub fn new_with_data_format<F>(
    i2c: I2C,
    data_format: F
) -> Result<Self, Error<E>> where
    F: Into<DataFormatFlags>, 
[src]

Create a new ADXL343 driver configured with the given data format

pub fn data_format<F>(&mut self, data_format: F) -> Result<(), Error<E>> where
    F: Into<DataFormatFlags>, 
[src]

Set the device data format

pub fn write_register(
    &mut self,
    register: Register,
    value: u8
) -> Result<(), Error<E>>
[src]

Write to the given register

pub fn write_read_register(
    &mut self,
    register: Register,
    buffer: &mut [u8]
) -> Result<(), E>
[src]

Write to a given register, then read the result

Trait Implementations

impl<I2C, E> Accelerometer<I16x3> for Adxl343<I2C> where
    I2C: WriteRead<Error = E> + Write<Error = E>,
    E: Debug
[src]

type Error = Error<E>

Error type

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

Get acceleration reading from the accelerometer

Auto Trait Implementations

impl<I2C> Unpin for Adxl343<I2C> where
    I2C: Unpin

impl<I2C> Send for Adxl343<I2C> where
    I2C: Send

impl<I2C> Sync for Adxl343<I2C> where
    I2C: Sync

Blanket Implementations

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

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

type Error = !

The type returned in the event of a conversion error.

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

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.

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self