From 6acd9acf2d72f3125ee0e397a9e33efa7ad48f4a Mon Sep 17 00:00:00 2001 From: Tilen Majerle Date: Wed, 3 Jul 2024 15:06:02 +0200 Subject: [PATCH 1/2] add features list --- README.md | 2 ++ docs/index.rst | 2 ++ 2 files changed, 4 insertions(+) diff --git a/README.md b/README.md index b04f203..7a580b1 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ * Platform independent, requires user to provide millisecond timing source * No dynamic memory allocation * Callback driven event management +* Support for click, multi click and long press events +* Support for software debounce for press and release events * Easy to use and maintain * User friendly MIT license diff --git a/docs/index.rst b/docs/index.rst index d649723..21b995f 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -18,6 +18,8 @@ Features * Platform independent, requires user to provide millisecond timing source * No dynamic memory allocation * Callback driven event management +* Support for click, multi click and long press events +* Support for software debounce for press and release events * Easy to use and maintain * User friendly MIT license From 2c191911e3592ff5f1bab8995e4a6c653c66042c Mon Sep 17 00:00:00 2001 From: Tilen Majerle Date: Wed, 3 Jul 2024 15:15:39 +0200 Subject: [PATCH 2/2] add docs for input reading --- docs/user-manual/index.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/user-manual/index.rst b/docs/user-manual/index.rst index bd0e54e..3ed2331 100644 --- a/docs/user-manual/index.rst +++ b/docs/user-manual/index.rst @@ -26,6 +26,20 @@ A simple example for win32 is below: :linenos: :caption: Win32 example code +Input pin state reading +^^^^^^^^^^^^^^^^^^^^^^^ + +User must implement a callback function that is periodically called from the **LwBTN** library, every time user calls one of the processing functions, such as :c:func:`lwbtn_process` or :c:func:`lwbtn_process_ex` functions. + +The input reading function is required to provide the actual state of the input and must return a state: + +* ``1`` when input is considered active (pressed) +* ``0`` when input is considered released (not-pressed) or in idle state + +.. tip:: + This is the place where you check peripheral GPIO registers in your embedded device and report the status to the library. + Depending on the physical wiring, you should check if peripheral bit is set or clear, to determine if input is active or inactive. + Input events ^^^^^^^^^^^^