[−][src]Struct lsm303agr::Lsm303agr
LSM303AGR device driver
Implementations
impl<DI, CommE, PinE> Lsm303agr<DI> where
DI: ReadData<Error = Error<CommE, PinE>> + WriteData<Error = Error<CommE, PinE>>,
[src]
DI: ReadData<Error = Error<CommE, PinE>> + WriteData<Error = Error<CommE, PinE>>,
pub fn set_accel_odr(
&mut self,
odr: AccelOutputDataRate
) -> Result<(), Error<CommE, PinE>>
[src]
&mut self,
odr: AccelOutputDataRate
) -> Result<(), Error<CommE, PinE>>
Set accelerometer output data rate.
This changes the power mode if the current one is not appropriate. When changing from a low-power-only output data rate setting into a high-resolution or normal power mode, it changes into normal mode.
pub fn set_accel_mode(
&mut self,
mode: AccelMode
) -> Result<(), Error<CommE, PinE>>
[src]
&mut self,
mode: AccelMode
) -> Result<(), Error<CommE, PinE>>
Set accelerometer power/resolution mode
Returns Error::InvalidInputData
if the mode is incompatible with the current
accelerometer output data rate.
impl<I2C> Lsm303agr<I2cInterface<I2C>>
[src]
pub fn new_with_i2c(i2c: I2C) -> Self
[src]
Create new instance of the LSM303AGR device communicating through I2C.
pub fn destroy(self) -> I2C
[src]
Destroy driver instance, return I2C bus.
impl<SPI, CSXL, CSMAG> Lsm303agr<SpiInterface<SPI, CSXL, CSMAG>>
[src]
pub fn new_with_spi(
spi: SPI,
chip_select_accel: CSXL,
chip_select_mag: CSMAG
) -> Self
[src]
spi: SPI,
chip_select_accel: CSXL,
chip_select_mag: CSMAG
) -> Self
Create new instance of the LSM303AGR device communicating through SPI.
pub fn destroy(self) -> (SPI, CSXL, CSMAG)
[src]
Destroy driver instance, return SPI bus instance and chip select pin.
impl<DI, CommE, PinE> Lsm303agr<DI> where
DI: ReadData<Error = Error<CommE, PinE>> + WriteData<Error = Error<CommE, PinE>>,
[src]
DI: ReadData<Error = Error<CommE, PinE>> + WriteData<Error = Error<CommE, PinE>>,
pub fn init(&mut self) -> Result<(), Error<CommE, PinE>>
[src]
Initialize registers
pub fn accel_status(&mut self) -> Result<Status, Error<CommE, PinE>>
[src]
Accelerometer status
pub fn accel_data(&mut self) -> Result<UnscaledMeasurement, Error<CommE, PinE>>
[src]
Accelerometer data
pub fn mag_status(&mut self) -> Result<Status, Error<CommE, PinE>>
[src]
Magnetometer status
pub fn accelerometer_id(&mut self) -> Result<u8, Error<CommE, PinE>>
[src]
Get accelerometer device ID
pub fn magnetometer_id(&mut self) -> Result<u8, Error<CommE, PinE>>
[src]
Get magnetometer device ID
Trait Implementations
Auto Trait Implementations
impl<DI> RefUnwindSafe for Lsm303agr<DI> where
DI: RefUnwindSafe,
DI: RefUnwindSafe,
impl<DI> Send for Lsm303agr<DI> where
DI: Send,
DI: Send,
impl<DI> Sync for Lsm303agr<DI> where
DI: Sync,
DI: Sync,
impl<DI> Unpin for Lsm303agr<DI> where
DI: Unpin,
DI: Unpin,
impl<DI> UnwindSafe for Lsm303agr<DI> where
DI: UnwindSafe,
DI: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,