cst820 0.2.2

A platform-agnostic embedded-hal driver for the Hynitron CST820 touch controller
Documentation

Hynitron CST820 Touch Controller Driver

Crates.io Docs Build Status Safety Dance MSRV EUPL 1.2 licensed Apache 2.0 licensed MIT licensed

A platform-agnostic driver to interface with the Hynitron CST820 touch controller.

Built on embedded-hal 1.0 and the cst820-registers map. Enable the async feature for a driver on embedded-hal-async.

use cst820::{Cst820, reset};

reset(&mut rst_pin, &mut delay)?;
let mut touch = Cst820::new(i2c);
assert!(touch.identify()?);

// Wait for the INT pin to go low, then:
let t = touch.read_touch()?;
if t.pressed() {
    println!("{} {} {:?}", t.x, t.y, t.event);
}

Implemented so far

  • Touch readout (coordinates, finger count, event, gesture) in a single burst read
  • Chip identification
  • Interrupt, auto-sleep and deep sleep configuration
  • Hardware reset with datasheet timing
  • Direct access to registers via cst820-registers structs and hardware-registers traits

The chip enters standby after 2 s without touch and then does not acknowledge on the bus. Disable auto-sleep via set_auto_sleep(None) right after reset if you need to poll.

License

Copyright © 2026 Markus Mayer

Triple licensed under your choice of either of: