esp_hal

Module touch

Source
Available on crate feature unstable only.
Expand description

§Capacitive Touch Sensor

§Overview

The touch sensor peripheral allows for cheap and robust user interfaces by e.g., dedicating a part of the pcb as touch button.

§Examples

let touch_pin0 = peripherals.GPIO2;
let touch = Touch::continuous_mode(peripherals.TOUCH, None);
let mut touchpad = TouchPad::new(touch_pin0, &touch);
// ... give the peripheral some time for the measurement
let touch_val = touchpad.read();

§Implementation State:

Mostly feature complete, missing:

  • Touch sensor slope control
  • Deep Sleep support (wakeup from Deep Sleep)

Structs§

  • Marker struct for the touch peripherals continuous reading mode. In the technical reference manual, this is referred to as “start FSM via timer”.
  • Marker struct for the touch peripherals manual trigger mode. In the technical reference manual, this is referred to as “start FSM via software”.
  • This struct marks a successfully initialized touch peripheral
  • Configurations for the touch pad driver
  • A pin that is configured as a TouchPad.

Enums§

Traits§

  • A marker trait describing the mode the touch pad is set to.