Merge branch 'develop' of https://github.com/MaJerle/lwbtn into develop

This commit is contained in:
Tilen M
2024-08-23 01:40:38 +02:00
3 changed files with 18 additions and 0 deletions
+2
View File
@@ -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
+2
View File
@@ -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
+14
View File
@@ -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
^^^^^^^^^^^^