This file contains the SAMD QTouch library initialization, sensor configuration and measurement routines.
Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
Macros | |
#define | DEF_MUTLCAP_CAL_SEQ1_COUNT 8 |
Includes for Touch Library. More... | |
#define | DEF_MUTLCAP_CAL_SEQ2_COUNT 4 |
#define | DEF_MUTLCAP_CC_CAL_CLK_PRESCALE PRSC_DIV_SEL_8 |
#define | DEF_MUTLCAP_CC_CAL_SENSE_RESISTOR RSEL_VAL_100 |
#define | DEF_MUTLCAP_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_mutlcap_measure_complete_callback (void) |
Mutual 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 | |
static touch_mutlcap_config_t | mutlcap_config |
Mutual Cap Configuration structure provided as input to Touch Library. More... | |
static uint8_t | mutlcap_data_blk [PRIV_MUTLCAP_DATA_BLK_SIZE] |
Mutual Cap Data block provided as input to Touch library. More... | |
freq_hop_sel_t | mutlcap_freq_hops [3u] = {DEF_MUTLCAP_HOP_FREQS} |
gain_t | mutlcap_gain_per_node [DEF_MUTLCAP_NUM_CHANNELS] = {DEF_MUTLCAP_GAIN_PER_NODE} |
uint16_t | mutlcap_xy_nodes [DEF_MUTLCAP_NUM_CHANNELS *2] = {DEF_MUTLCAP_NODES} |
Mutual Cap Sensor Pins Info. More... | |
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... | |
touch_config_t | touch_config |
Touch Library input configuration structure. More... | |
touch_time_t | touch_time |
#define DEF_MUTLCAP_CAL_SEQ1_COUNT 8 |
Includes for Touch Library.
#define DEF_MUTLCAP_CAL_SEQ2_COUNT 4 |
#define DEF_MUTLCAP_CC_CAL_CLK_PRESCALE PRSC_DIV_SEL_8 |
#define DEF_MUTLCAP_CC_CAL_SENSE_RESISTOR RSEL_VAL_100 |
#define DEF_MUTLCAP_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_mutlcap_measure_complete_callback | ( | void | ) |
Mutual Cap measure complete callback function example prototype.
Mutual Cap measure complete callback function.
This function is called by the library when the touch measurement process for Mutual 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_5, CHANNEL_6, CHANNEL_9, HYST_6_25, NO_AKS_GROUP, RES_8_BIT, SENSOR_TYPE_KEY, SENSOR_TYPE_ROTOR, SENSOR_TYPE_SLIDER, touch_mutlcap_sensor_config(), and TOUCH_SUCCESS.
Referenced by touch_sensors_init().
|
static |
Mutual 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 |
Mutual Cap Data block provided as input to Touch library.
freq_hop_sel_t mutlcap_freq_hops[3u] = {DEF_MUTLCAP_HOP_FREQS} |
gain_t mutlcap_gain_per_node[DEF_MUTLCAP_NUM_CHANNELS] = {DEF_MUTLCAP_GAIN_PER_NODE} |
uint16_t mutlcap_xy_nodes[DEF_MUTLCAP_NUM_CHANNELS *2] = {DEF_MUTLCAP_NODES} |
Mutual Cap Sensor Pins Info.
touch_config_t touch_config |
Touch Library input configuration structure.