Skip to main content

Crate cst820

Crate cst820 

Source
Expand description

§Hynitron CST820 touch controller driver

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

This driver was built using embedded-hal 1.0 and cst820-registers. Enable the async feature for an equivalent driver on embedded-hal-async in the asynch module.

§Standby

The chip enters standby after registers::AutoSleepTime seconds (default: 2) without touch, and then does not acknowledge on the bus until touched. Read the chip after its interrupt fires, or disable auto-sleep with Cst820::set_auto_sleep right after reset.

§Limitations

The CST820 supports two-point touch, but the register layout of the second point is undocumented. Only the first point is reported.

Re-exports§

pub use cst820_registers as registers;

Modules§

asynchasync
Async driver on embedded-hal-async.

Structs§

Cst820
CST820 driver.
Touch
A snapshot of the touch registers.

Enums§

Gesture
A detected gesture, as reported by GestureId.
TouchEvent
The touch event, as reported in the upper bits of XposH.

Constants§

BOOT_DELAY_MS
How long to wait after releasing RST before talking to the chip, in milliseconds.
CST820_CHIP_ID
The value of the ChipId register for a CST820.
DEFAULT_DEVICE_ADDRESS
The I²C bus address.
RESET_PULSE_US
How long RST is held low during reset, in microseconds.

Functions§

reset
Resets the chip via its active-low RST pin and waits until it has booted.