mirror of
https://github.com/MaJerle/lwbtn.git
synced 2026-09-25 06:33:36 +08:00
improve the docs
This commit is contained in:
@@ -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
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user