Skip to main content

Module button

Module button 

Source
Available on target_os=none only.
Expand description

A device abstraction for buttons with debouncing and press duration detection.

This module provides two ways to monitor button presses:

  • Button — Simple button monitoring. Each call to wait_for_press(), etc. starts fresh button monitoring.
  • button_watch! — Monitors a button in a background task so that it works even in a fast loop/select.

Modules§

button_watch_generated
Module containing ButtonWatchGenerated, the sample struct type generated by the button_watch! macro.

Macros§

button_watch
Creates a button monitoring device abstraction with a background task.

Structs§

Button
A device abstraction for a button with debouncing and press duration detection.

Enums§

PressDuration
Duration of a button press (short or long).
PressedTo
Describes if the button connects to voltage or ground when pressed.