[−][src]Struct adxl343::Adxl343
ADXL343 driver
Methods
impl<I2C, E> Adxl343<I2C> where
I2C: WriteRead<Error = E> + Write<Error = E>,
E: Debug,
[src]
I2C: WriteRead<Error = E> + Write<Error = E>,
E: Debug,
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]
i2c: I2C,
data_format: F
) -> Result<Self, Error<E>> where
F: Into<DataFormatFlags>,
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]
F: Into<DataFormatFlags>,
Set the device data format
pub fn write_register(
&mut self,
register: Register,
value: u8
) -> Result<(), Error<E>>
[src]
&mut self,
register: Register,
value: u8
) -> Result<(), Error<E>>
Write to the given register
pub fn write_read_register(
&mut self,
register: Register,
buffer: &mut [u8]
) -> Result<(), E>
[src]
&mut self,
register: Register,
buffer: &mut [u8]
) -> Result<(), E>
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]
I2C: WriteRead<Error = E> + Write<Error = E>,
E: Debug,
Auto Trait Implementations
impl<I2C> Unpin for Adxl343<I2C> where
I2C: Unpin,
I2C: Unpin,
impl<I2C> Send for Adxl343<I2C> where
I2C: Send,
I2C: Send,
impl<I2C> Sync for Adxl343<I2C> where
I2C: Sync,
I2C: Sync,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
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> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self