improve the docs

This commit is contained in:
Tilen Majerle
2023-12-08 07:39:24 +01:00
parent 8bb5070538
commit 18104391d7
2 changed files with 21 additions and 3 deletions
+5
View File
@@ -42,6 +42,7 @@ On-Press event
Onpress event is the first in a row when input is detected active.
With nature of embedded systems and various buttons connected to devices, it is necessary to filter out potential noise to ignore unintential multiple presses.
This is done by checking line to be at stable level for at least some minimum time, normally called *debounce time*, usually it takes around ``20ms``.
See :c:macro:`LWBTN_CFG_TIME_DEBOUNCE_PRESS` configuration option to set debounce time.
.. figure:: ../static/images/btn-events-press.svg
:align: center
@@ -60,6 +61,10 @@ Onrelease event is triggered immediately when input goes from active to inactive
On-Release event trigger
Optionally, user can also enable debounce for release event.
In this case, **onrelease** is triggered after line is in steady inactive mode for at least minimum defined time.
See :c:macro:`LWBTN_CFG_TIME_DEBOUNCE_RELEASE` configuration option to set debounce time.
On-Click event
^^^^^^^^^^^^^^
+16 -3
View File
@@ -230,9 +230,9 @@ extern "C" {
* This can be executed immediately after last click has been detected,
* or after standard timeout (unless next on-press has already been detected,
* then it is send to application just before valid next press event).
* Configuration can be changed \ref LWBTN_CFG_CLICK_MAX_CONSECUTIVE_SEND_IMMEDIATELY
* Configuration can be changed with \ref LWBTN_CFG_CLICK_MAX_CONSECUTIVE_SEND_IMMEDIATELY macro
*
* \sa LWBTN_CFG_CLICK_MAX_CONSECUTIVE_DYNAMIC
* \sa LWBTN_CFG_CLICK_MAX_CONSECUTIVE_DYNAMIC, LWBTN_CFG_CLICK_MAX_CONSECUTIVE_SEND_IMMEDIATELY
*/
#ifndef LWBTN_CFG_CLICK_MAX_CONSECUTIVE
#define LWBTN_CFG_CLICK_MAX_CONSECUTIVE 3
@@ -286,10 +286,23 @@ extern "C" {
#define LWBTN_CFG_CLICK_MAX_CONSECUTIVE_SEND_IMMEDIATELY 1
#endif
/**
* \brief Get button state options
* \name LWBTN_CFG_GET_STATE_MODE_GROUP
* \anchor LWBTN_CFG_GET_STATE_MODE_GROUP
* \{
*
* Configuration option for \ref LWBTN_CFG_GET_STATE_MODE configuration
*/
#define LWBTN_GET_STATE_MODE_CALLBACK 0 /*!< Callback-only state mode */
#define LWBTN_GET_STATE_MODE_MANUAL 1 /*!< Manual-only state mode */
#define LWBTN_GET_STATE_MODE_CALLBACK_OR_MANUAL 2 /*!< Callback or manual state mode */
/**
* \}
*/
/**
* \brief Sets the mode how new button state is acquired.
*
@@ -302,7 +315,7 @@ extern "C" {
* It enables API to manually set the state with approapriate function call.
* Button state is checked with the callback at least until manual state API function is called.
*
* This allows multiple build configurations for various button types
* This allows multiple build configurations for various button types
*/
#ifndef LWBTN_CFG_GET_STATE_MODE
#define LWBTN_CFG_GET_STATE_MODE LWBTN_GET_STATE_MODE_CALLBACK