Skip to content

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.

void syn_touch_calibrate (
    SYN_Touch * touch,
    uint16_t baseline
) 

Parameters:

  • touch Touch context.
  • baseline Baseline raw value.

function syn_touch_feed_sample

Feed a raw capacitance charge-time / ADC sample.

void syn_touch_feed_sample (
    SYN_Touch * touch,
    uint16_t raw_sample
) 

Parameters:

  • touch Touch context.
  • raw_sample Raw charge time / capacitance sample.

function syn_touch_init

Initialize a Capacitive Touch Sensor instance.

SYN_Status syn_touch_init (
    SYN_Touch * touch,
    SYN_GPIO_Pin pin,
    uint16_t threshold
) 

Parameters:

  • touch Touch context.
  • pin GPIO pin identifier.
  • threshold Touch detection delta threshold.

Returns:

SYN_OK on success.


function syn_touch_is_pressed

Check if touch sensor is pressed.

bool syn_touch_is_pressed (
    const SYN_Touch * touch
) 

Parameters:

  • touch Touch context.

Returns:

True if currently touched/pressed.



The documentation for this class was generated from the following file src/syntropic/input/syn_touch.h