px-fwlib 0.10.0
Cross-platform embedded library and documentation for 8/16/32-bit microcontrollers generated with Doxygen 1.9.2
px_btn_cfg_template.h
1#ifndef __PX_BTN_CFG_H__
2#define __PX_BTN_CFG_H__
3/* =============================================================================
4 ____ ___ ____ ___ _ _ ___ __ __ ___ __ __ TM
5 | _ \ |_ _| / ___| / _ \ | \ | | / _ \ | \/ | |_ _| \ \/ /
6 | |_) | | | | | | | | | | \| | | | | | | |\/| | | | \ /
7 | __/ | | | |___ | |_| | | |\ | | |_| | | | | | | | / \
8 |_| |___| \____| \___/ |_| \_| \___/ |_| |_| |___| /_/\_\
9
10 Copyright (c) 2021 Pieter Conradie <https://piconomix.com>
11
12 License: MIT
13 https://github.com/piconomix/px-fwlib/blob/master/LICENSE.md
14
15 Title: px_btn.h : Digital button input configuration
16 Author(s): Pieter Conradie
17 Creation Date: 2021-11-22
18
19============================================================================= */
20
21/**
22 * @addtogroup PX_BTN
23 *
24 * @{
25 */
26
27/* _____STANDARD INCLUDES____________________________________________________ */
28
29/* _____PROJECT INCLUDES_____________________________________________________ */
30#include "px_defs.h"
31
32/* _____DEFINITIONS__________________________________________________________ */
33/// Max HI counter value (counter starts at 0)
34#define PX_BTN_CFG_COUNT_MAX 9
35
36/// Low threshold for valid LO
37#define PX_BTN_CFG_THRESHOLD_LO 2
38
39/// High threshold for valid HI
40#define PX_BTN_CFG_THRESHOLD_HI 7
41
42/// Count threshold for long LO/ HI; Set to 0 to disable option
43#define PX_BTN_CFG_LONG_COUNT 300
44
45/// Maximum number of button clicks to detect; Minimum value is 1
46#define PX_BTN_CFG_CLICKS_MAX 2
47
48/// A button press count longer than this value is considered a click
49#define PX_BTN_CFG_CLICK_PRESS_MIN 3
50
51/// A button release count shorter than this value is considered part of the same click sequence
52#define PX_BTN_CFG_CLICK_RELEASE_MAX 20
53
54/// @}
55#endif