Button Parameters
This page provides a comprehensive overview of the essential button structures, enums, and typedefs used in the Capacitive Voltage Divider (CVD) technique for touch sensing.
For APIs, refer to the Button Application Programming Interfaces (APIs) page.
Button Typedefs
mtouch_button_statecounter_t
Description: Defines the button state counter minimum and maximum
Range:
#define MTOUCH_BUTTON_STATECOUNTER_MAX (UINT16_MAX)
mtouch_button_baselinecounter_t
Description: Defines the button baseline counter minimum and maximum
Range:
#define MTOUCH_BUTTON_BASECOUNTER_MAX (UINT16_MAX)
mtouch_button_reading_t
Description: Defines the button reading minimum and maximum
Range:
#define MTOUCH_BUTTON_READING_MAX (UINT16_MAX)
mtouch_button_baseline_t
Description: Defines the button baseline reading minimum and maximum
Range:
#define MTOUCH_BUTTON_BASELINE_MAX (UINT32_MAX)
mtouch_button_deviation_t
Description: Defines the button deviation reading minimum and maximum
Range:
#define MTOUCH_BUTTON_DEVIATION_MAX (INT8_MAX)
mtouch_button_threshold_t
Description: Defines the button theshold minimum and maximum
Range:
#define MTOUCH_BUTTON_THRESHOLD_MAX ((mtouch_button_threshold_t)(127))
mtouch_button_scaling_t
Description: Defines the button scaling minimum and maximum
Range:
#define MTOUCH_BUTTON_SCALING_MAX ((mtouch_button_scaling_t)(8))
Button Enums and Structures
mtouch_button_state
{
MTOUCH_BUTTON_STATE_initializing = 0,
MTOUCH_BUTTON_STATE_notPressed,
MTOUCH_BUTTON_STATE_pressed
};
Description: Available states for button in the statemachine
mtouch_button_hysteresis_thresholds
{
HYST_50_PERCENT = 1,
HYST_25_PERCENT = 2,
HYST_12_5_PERCENT = 3,
HYST_6_25_PERCENT = 4,
HYST_MAX = 5
};
Description: Available hystersis thresholds for buttons
mtouch_button_t
{
const enum mtouch_button_names name;
const enum mtouch_sensor_names sensor;
enum mtouch_button_state state;
mtouch_button_reading_t reading;
mtouch_button_baseline_t baseline;
mtouch_button_deviation_t deviation;
mtouch_button_statecounter_t counter;
mtouch_button_baselinecounter_t baseline_count;
mtouch_button_threshold_t threshold;
mtouch_button_scaling_t scaling;
} mtouch_button_t;
Description: This structure lists down all the elements corresponding to buttons configured in the project