gossamer 0.0.1
a very lightweight app framework for SAMD and SAML chips
Loading...
Searching...
No Matches
Peripheral Touch Controller

Functions for configuring and using the Peripheral Touch Controller. More...

Typedefs

typedef enum tag_oversample_level_t ptc_oversample_t
 
typedef enum tag_series_resistor_t ptc_series_resistor_t
 
typedef enum tag_freq_mode_t ptc_freq_mode_t
 
typedef enum tag_freq_hop_t ptc_freq_hop_t
 

Enumerations

enum  tag_oversample_level_t {
  OVERSAMPLE_1 , OVERSAMPLE_2 , OVERSAMPLE_4 , OVERSAMPLE_8 ,
  OVERSAMPLE_16 , OVERSAMPLE_32 , OVERSAMPLE_64
}
 
enum  tag_series_resistor_t { RESISTOR_0 , RESISTOR_20K , RESISTOR_50K , RESISTOR_100K }
 
enum  tag_freq_mode_t { FREQ_MODE_NONE , FREQ_MODE_HOP , FREQ_MODE_SPREAD , FREQ_MODE_SPREAD_MEDIAN }
 
enum  tag_freq_hop_t {
  FREQ_HOP_1 , FREQ_HOP_2 , FREQ_HOP_3 , FREQ_HOP_4 ,
  FREQ_HOP_5 , FREQ_HOP_6 , FREQ_HOP_7 , FREQ_HOP_8 ,
  FREQ_HOP_9 , FREQ_HOP_10 , FREQ_HOP_11 , FREQ_HOP_12 ,
  FREQ_HOP_13 , FREQ_HOP_14 , FREQ_HOP_15 , FREQ_HOP_16
}
 

Functions

void ptc_init (void)
 Initialize the peripheral touch controller.
 
void ptc_enable (uint8_t channel)
 Enable the given PTC channel.
 
uint16_t ptc_get_value (uint8_t channel)
 Get a value from the given channel.
 

Detailed Description

Functions for configuring and using the Peripheral Touch Controller.

Based on Adafruit's FreeTouch library.

Function Documentation

◆ ptc_enable()

void ptc_enable ( uint8_t  channel)

Enable the given PTC channel.

Parameters
channelThe PTC channel (NOT pin number) to enable.
Note
You are still responsible for configuring the pin mux. Also we don't yet have a way to disable a channel.

◆ ptc_get_value()

uint16_t ptc_get_value ( uint8_t  channel)

Get a value from the given channel.

Parameters
channelThe PTC channel (NOT pin number) to read.
Returns
The touch value read from the channel.