Struct lis2dh12::Int

source ·
pub struct Int<'a, REG, I2C> { /* private fields */ }
Expand description

Interrupt setting and status

Implementations§

source§

impl<'a, REG, I2C, E> Int<'a, REG, I2C>
where REG: IntRegs, I2C: WriteRead<Error = E> + Write<Error = E>, E: Debug,

source

pub fn disable(&mut self) -> Result<(), Error<E>>

Disable interrupt, INTx_CFG clean all bits

source

pub fn set_mode(&mut self, mode: Aoi6d) -> Result<(), Error<E>>

AOI-6D Interrupt mode, INTx_CFG: AOI, 6D

source

pub fn enable_high( &mut self, (x, y, z): (bool, bool, bool) ) -> Result<(), Error<E>>

X,Y,Z high event enable, INTx_CFG: XHIE, YHIE, ZHIE

source

pub fn enable_low( &mut self, (x, y, z): (bool, bool, bool) ) -> Result<(), Error<E>>

X,Y,Z low event enable, INTx_CFG: XLIE, YLIE, ZLIE

source

pub fn get_src( &mut self ) -> Result<Option<((bool, bool), (bool, bool), (bool, bool))>, Error<E>>

Source, INTx_SRC decoded as ((XH, XL), (YH, YL), (ZH, ZL))

source

pub fn set_ths(&mut self, ths: u8) -> Result<(), Error<E>>

Threshold, INTx_THS: THS

source

pub fn set_thsf(&mut self, ths: f32) -> Result<(), Error<E>>

Threshold as f32, INTx_THS: THS

source

pub fn set_duration(&mut self, d: u8) -> Result<(), Error<E>>

Duration, INTx_DURATION: D

Auto Trait Implementations§

§

impl<'a, REG, I2C> RefUnwindSafe for Int<'a, REG, I2C>
where I2C: RefUnwindSafe, REG: RefUnwindSafe,

§

impl<'a, REG, I2C> Send for Int<'a, REG, I2C>
where I2C: Send, REG: Send,

§

impl<'a, REG, I2C> Sync for Int<'a, REG, I2C>
where I2C: Sync, REG: Sync,

§

impl<'a, REG, I2C> Unpin for Int<'a, REG, I2C>
where REG: Unpin,

§

impl<'a, REG, I2C> !UnwindSafe for Int<'a, REG, I2C>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.