cst328 1.0.0

Pure Rust CST328 touch driver (blocking + async support)
docs.rs failed to build cst328-1.0.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: cst328-1.0.4

cst328

A pure Rust driver for the CST328 touch controller device (datasheet). This driver supports the following:

  • Various hardware via embedded-hal
  • A no_std environment
  • both sync and async API's

This library supports either (but not both) synchronous (blocking) or asynchronous (non-blocking) API's. One and only one of the following features must be defined: use_sync or use_async.

A Rust no_std driver for the CST328 capacitive touch controller.

Installation

Add this to your Cargo.toml:

[dependencies]
cst328 = { version = "0.1", features = ["use_sync"] }   # or "use_async"

## Example

```rs
use cst328::{Cst328, Mode};
use log::{info, error};

let i2c = // Create I2C device.
let mut dev = Cst328::new(i2c);
match dev.read_finger(0).await {
    Ok(finger) => info!("Touch Data: {finger:?}"),
    Err(e) => error!("Failed to read finger data: {e:?}"),
}

See the full working examples in the project ///examples directory. These were written for the ESP32 chip family and depend on the esp-hal, but only these samples have a specific platform dependency. They should be easily ported to any platform supported by embedded-hal or embedded-hal-async.