[−][src]Struct AT42QT2120::At42qt2120
Driver for the AT42QT2120
Methods
impl<I2C, E> At42qt2120<I2C> where
I2C: WriteRead<Error = E> + Write<Error = E>,
[src]
I2C: WriteRead<Error = E> + Write<Error = E>,
pub fn new(i2c: I2C) -> Self
[src]
initialize the AT42QT2120 driver. No configuration is made at this point and defaults are in place.
pub fn setup(&mut self) -> Result<(), Error<E>>
[src]
Setup the device, currently just checks the chip ID.
pub fn setup_slider(
&mut self,
slider: bool,
enabled: bool
) -> Result<(), Error<E>>
[src]
&mut self,
slider: bool,
enabled: bool
) -> Result<(), Error<E>>
Setup the slider settings, slider is false for slider, true for wheel.
pub fn setup_key(
&mut self,
key: u8,
threshold: u8,
enabled: bool
) -> Result<(), Error<E>>
[src]
&mut self,
key: u8,
threshold: u8,
enabled: bool
) -> Result<(), Error<E>>
Setup a key. Keys can be enabled or disabled, the lower the threshold, the more sensitive the key. Settings here also count for the slider/wheel.
pub fn keys_pressed(&mut self) -> Result<bool, Error<E>>
[src]
Checks if any keys are pressed.
pub fn slider_pressed(&mut self) -> Result<bool, Error<E>>
[src]
Checks if the slider is pressed.
pub fn read_status(&mut self) -> Result<u8, Error<E>>
[src]
read the raw detection status register
pub fn read_slider(&mut self) -> Result<u8, Error<E>>
[src]
read the slider position. Only valid when the slider is pressed.
pub fn read_key_value(&mut self, key: u8) -> Result<u16, E>
[src]
read the raw 16 bit key signal
pub fn read_keys(&mut self) -> Result<u16, Error<E>>
[src]
read all key values. bit 0 is for key 0, bit 1 for key 1 and so forth
pub fn read_key(&mut self, key: u8) -> Result<bool, Error<E>>
[src]
read if a key is pressed
Auto Trait Implementations
impl<I2C> Unpin for At42qt2120<I2C> where
I2C: Unpin,
I2C: Unpin,
impl<I2C> Send for At42qt2120<I2C> where
I2C: Send,
I2C: Send,
impl<I2C> Sync for At42qt2120<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 = 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> 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,