Skip to content
niwciu edited this page Feb 13, 2025 · 11 revisions

PUSHBUTTON_SWITCH_LIB - simple C cross-platform library

keypad_lib

GitHub License GitHub top language GitHub Release CI PiPeline

Library GCOVR Report
Library Code Complexity Report

The PUSHBUTTON_SWITCH_LIB is a simple cross-platform C library providing interfaces for pushbuttons and two-state switches (two-state input signals).

Features

Push Buttons:

  • 3 trigger modes:
    • TRIGGER_ON_PUSH
    • TRIGGER_ON_RELEASE
    • TRIGGER_ON_SHORT_PUSH_AND_LONG_PUSH
  • Option to enable repetition
  • Fully configurable time slots for:
    • debounce time
    • time to the first repetition
    • time between continuous repetitions
    • time defining the difference between short and long push
  • Option to dynamically register callbacks for each trigger source
  • Driver interface that is fully separated from the driver layer

Switches:

  • Debounce functionality based on a repeat count of the same state (no timer needed)
  • Fully configurable debounce counter
  • Dynamically register callbacks for switch ON and OFF states
  • Driver interface that is fully separated from the driver layer