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 towait_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 thebutton_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§
- Press
Duration - Duration of a button press (short or long).
- Pressed
To - Describes if the button connects to voltage or ground when pressed.