This file contains the SAMD QTouch library initialization, sensor configuration and measurement routines.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
Macros | |
#define | DEF_SELFCAP_CAL_SEQ1_COUNT 8 |
Includes for Touch Library. More... | |
#define | DEF_SELFCAP_CAL_SEQ2_COUNT 4 |
#define | DEF_SELFCAP_CC_CAL_CLK_PRESCALE PRSC_DIV_SEL_8 |
#define | DEF_SELFCAP_CC_CAL_SENSE_RESISTOR RSEL_VAL_100 |
#define | DEF_SELFCAP_QUICK_REBURST_ENABLE 1u |
#define | PTC_APBC_BITMASK (1u << 19u) |
Functions | |
void | touch_configure_ptc_clock (void) |
Initialize and enable PTC clock. More... | |
void | touch_selfcap_measure_complete_callback (void) |
Self Cap measure complete callback function example prototype. More... | |
static touch_ret_t | touch_sensors_config (void) |
configure keys, rotors and sliders. More... | |
touch_ret_t | touch_sensors_init (void) |
Example application entry function. More... | |
touch_ret_t | touch_sensors_measure (void) |
This API is used to perform a Single Capacitance measurement using the Touch Library. More... | |
Variables | |
touch_measure_data_t * | p_mutlcap_measure_data = NULL |
Mutual Cap sensors measured data pointer. More... | |
touch_measure_data_t * | p_selfcap_measure_data = NULL |
Self Cap sensors measured data pointer. More... | |
static touch_selfcap_config_t | selfcap_config |
Self Cap Configuration structure provided as input to Touch Library. More... | |
static uint8_t | selfcap_data_blk [PRIV_SELFCAP_DATA_BLK_SIZE] |
Self Cap sensors data block provided as input to Touch library. More... | |
freq_hop_sel_t | selfcap_freq_hops [3u] = {DEF_SELFCAP_HOP_FREQS} |
gain_t | selfcap_gain_per_node [DEF_SELFCAP_NUM_CHANNELS] = {DEF_SELFCAP_GAIN_PER_NODE} |
uint16_t | selfcap_y_nodes [DEF_SELFCAP_NUM_CHANNELS] = {DEF_SELFCAP_LINES} |
Self Cap sensors Pins Info. More... | |
touch_config_t | touch_config |
Touch Library input configuration structure. More... | |
touch_time_t | touch_time |
#define DEF_SELFCAP_CAL_SEQ1_COUNT 8 |
Includes for Touch Library.
#define DEF_SELFCAP_CAL_SEQ2_COUNT 4 |
#define DEF_SELFCAP_CC_CAL_CLK_PRESCALE PRSC_DIV_SEL_8 |
#define DEF_SELFCAP_CC_CAL_SENSE_RESISTOR RSEL_VAL_100 |
#define DEF_SELFCAP_QUICK_REBURST_ENABLE 1u |
#define PTC_APBC_BITMASK (1u << 19u) |
Referenced by touch_configure_ptc_clock().
void touch_configure_ptc_clock | ( | void | ) |
Initialize and enable PTC clock.
References GCLK_GENERATOR_1, PTC_APBC_BITMASK, system_gclk_chan_config::source_generator, system_apb_clock_set_mask(), SYSTEM_CLOCK_APB_APBC, system_gclk_chan_enable(), system_gclk_chan_get_config_defaults(), and system_gclk_chan_set_config().
Referenced by touch_sensors_init().
void touch_selfcap_measure_complete_callback | ( | void | ) |
Self Cap measure complete callback function example prototype.
Self Cap measure complete callback function.
This function is called by the library when the touch measurement process for Self Cap sensors is completed.
p_measure_data | Base address of touch_measure_data_t instance. |
References tag_touch_measure_data_t::acq_status, tag_touch_measure_data_t::measurement_done_touch, TOUCH_BURST_AGAIN, TOUCH_CHANNEL_REF_CHANGE, TOUCH_ROTOR_SLIDER_POS_CHANGE, and TOUCH_STATUS_CHANGE.
Referenced by touch_sensors_measure().
|
static |
configure keys, rotors and sliders.
Example configuration for touch keys, rotors and sliders.
TOUCH_SUCCESS | Configuration setting successful. |
TOUCH_INVALID_xx | Invalid input configuration setting. |
References CHANNEL_0, CHANNEL_1, CHANNEL_2, CHANNEL_4, CHANNEL_5, CHANNEL_7, HYST_6_25, NO_AKS_GROUP, RES_8_BIT, SENSOR_TYPE_KEY, SENSOR_TYPE_ROTOR, SENSOR_TYPE_SLIDER, touch_selfcap_sensor_config(), and TOUCH_SUCCESS.
Referenced by touch_sensors_init().
|
static |
Self Cap Configuration structure provided as input to Touch Library.
Note: Use the touch.h configuration header file to fill in the elements of this structure. DO NOT modify any of the input values directly in this structure.
|
static |
Self Cap sensors data block provided as input to Touch library.
freq_hop_sel_t selfcap_freq_hops[3u] = {DEF_SELFCAP_HOP_FREQS} |
gain_t selfcap_gain_per_node[DEF_SELFCAP_NUM_CHANNELS] = {DEF_SELFCAP_GAIN_PER_NODE} |
uint16_t selfcap_y_nodes[DEF_SELFCAP_NUM_CHANNELS] = {DEF_SELFCAP_LINES} |
Self Cap sensors Pins Info.
touch_config_t touch_config |
Touch Library input configuration structure.