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§

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

Enums§

ThresholdMode
Touchpad threshold type.

Traits§

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