File syn_touch.h¶
FileList > input > syn_touch.h
Go to the source code of this file
Capacitive Touch Sensor Driver (relaxation/ADC charge sensing).
#include "../common/syn_defs.h"#include "../port/syn_port_gpio.h"#include <stdbool.h>#include <stddef.h>#include <stdint.h>
Classes¶
| Type | Name |
|---|---|
| struct | SYN_Touch Capacitive Touch Button Instance Context. |
Public Functions¶
| Type | Name |
|---|---|
| void | syn_touch_calibrate (SYN_Touch * touch, uint16_t baseline) Calibrate baseline value from current environmental noise floor. |
| void | syn_touch_feed_sample (SYN_Touch * touch, uint16_t raw_sample) Feed a raw capacitance charge-time / ADC sample. |
| SYN_Status | syn_touch_init (SYN_Touch * touch, SYN_GPIO_Pin pin, uint16_t threshold) Initialize a Capacitive Touch Sensor instance. |
| bool | syn_touch_is_pressed (const SYN_Touch * touch) Check if touch sensor is pressed. |
Public Functions Documentation¶
function syn_touch_calibrate¶
Calibrate baseline value from current environmental noise floor.
Parameters:
touchTouch context.baselineBaseline raw value.
function syn_touch_feed_sample¶
Feed a raw capacitance charge-time / ADC sample.
Parameters:
touchTouch context.raw_sampleRaw charge time / capacitance sample.
function syn_touch_init¶
Initialize a Capacitive Touch Sensor instance.
Parameters:
touchTouch context.pinGPIO pin identifier.thresholdTouch detection delta threshold.
Returns:
SYN_OK on success.
function syn_touch_is_pressed¶
Check if touch sensor is pressed.
Parameters:
touchTouch context.
Returns:
True if currently touched/pressed.
The documentation for this class was generated from the following file src/syntropic/input/syn_touch.h