embedded-touch

Crates.ioembedded-touch
lib.rsembedded-touch
version0.3.0
created_at2025-08-17 17:25:20.677278+00
updated_at2025-09-14 18:42:03.800234+00
descriptionProvides common interfaces for touchscreen devices
homepage
repositoryhttps://github.com/riley-williams/embedded-touch
max_upload_size
id1799591
size30,004
Riley Williams (riley-williams)

documentation

README

embedded-touch

The primary goal of this crate is to provide a common interface for UI libraries like buoyant to interact with touchscreen input device drivers (e.g. FT6113).

Features

  • Blocking and async interfaces
  • Stylus support, including pressure, tilt, and azimuth
  • Fixed-point arithmetic by default
  • No heap allocation

Usage

Implement the TouchInputDevice trait for blocking operation:

use embedded_touch::{TouchInputDevice, Touch, Error};

struct MyTouchDriver { /* ... */ }

impl TouchInputDevice for MyTouchDriver {
    type Error = MyError;

    fn touches(&mut self) -> Result<impl IntoIterator<Item = Touch>, Error<Self::Error>> {
        // Read touch data from hardware
    }
}

Or implement AsyncTouchInputDevice for event-driven operation:

use embedded_touch::{AsyncTouchInputDevice, Touch, Error};

impl AsyncTouchInputDevice for MyTouchDriver {
    type Error = MyError;

    async fn touches(&mut self) -> Result<impl IntoIterator<Item = Touch>, Error<Self::Error>> {
        // Asynchronously wait for touch events
    }
}

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Commit count: 7

cargo fmt