Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
QTouch Library for SAM0

This is the QTouch Library for SAM0 devices that consists in one api header file(touch_api_SAMD.h) and one pre-compiled library(libsamd-qt-gcc.a).

All projects using this library must also provide the required header file(touch_config_samd.h) used to configure the library.

For more information on the Qtouch Library, check www.atmel.com/qtouchlib.

Modules

 

Data Structures

struct  tag_sensor_t
 
struct  tag_touch_config_t
 
struct  tag_touch_filter_data_t
 
struct  tag_touch_global_param_t
 
struct  tag_touch_info_t
 
struct  tag_touch_measure_data_t
 
struct  tag_touch_mutlcap_acq_param_t
 Mutual capacitance sensor acquisition parameter type. More...
 
struct  tag_touch_mutlcap_config_t
 
struct  tag_touch_mutlcap_param_t
 
struct  tag_touch_selfcap_acq_param_t
 Self capacitance sensor acquisition parameter type. More...
 
struct  tag_touch_selfcap_config_t
 
struct  tag_touch_selfcap_param_t
 
struct  tag_touch_time_t
 

Variables

touch_acq_status_t tag_touch_measure_data_t::acq_status
 
aks_group_t tag_touch_selfcap_param_t::aks_group
 
aks_group_t tag_touch_mutlcap_param_t::aks_group
 
uint8_t tag_touch_global_param_t::atch_drift_rate
 
uint8_t tag_touch_global_param_t::atch_recal_delay
 
uint16_t tag_touch_selfcap_config_t::buffer_size
 
uint16_t tag_touch_mutlcap_config_t::buffer_size
 
uint8_t tag_touch_global_param_t::cal_seq_1_count
 
uint8_t tag_touch_global_param_t::cal_seq_2_count
 
volatile uint16_t tag_touch_time_t::current_time_ms
 
hysteresis_t tag_touch_selfcap_param_t::detect_hysteresis
 
hysteresis_t tag_touch_mutlcap_param_t::detect_hysteresis
 
threshold_t tag_touch_selfcap_param_t::detect_threshold
 
threshold_t tag_touch_mutlcap_param_t::detect_threshold
 
uint8_t tag_touch_global_param_t::di
 
uint8_t tag_touch_global_param_t::drift_hold_time
 
void(* tag_touch_selfcap_config_t::filter_callback )(touch_filter_data_t *p_filter_data)
 
void(* tag_touch_mutlcap_config_t::filter_callback )(touch_filter_data_t *p_filter_data)
 
uint8_t tag_sensor_t::from_channel
 
uint16_t tag_touch_info_t::fw_version
 
uint8_t tag_sensor_t::general_counter
 
touch_global_param_t tag_touch_selfcap_config_t::global_param
 
touch_global_param_t tag_touch_mutlcap_config_t::global_param
 
uint8_t tag_sensor_t::index
 
uint8_t tag_touch_info_t::max_channels_per_rotor_slider
 
uint8_t tag_touch_global_param_t::max_on_duration
 
volatile uint8_t tag_touch_measure_data_t::measurement_done_touch
 
uint16_t tag_touch_time_t::measurement_period_ms
 
uint8_t tag_touch_mutlcap_config_t::mutl_quick_reburst_enable
 
auto_os_t tag_touch_mutlcap_acq_param_t::mutlcap_auto_os
 auto oversampling More...
 
filter_level_t tag_touch_mutlcap_acq_param_t::mutlcap_filter_level
 filter level More...
 
prsc_div_sel_t tag_touch_mutlcap_acq_param_t::mutlcap_ptc_prsc
 PTC clock prescale value. More...
 
prsc_div_sel_t tag_touch_mutlcap_acq_param_t::mutlcap_ptc_prsc_cc_cal
 PTC clock prescale value during CC cal. More...
 
rsel_val_t tag_touch_mutlcap_acq_param_t::mutlcap_resistor_value
 PTC series resistor value. More...
 
rsel_val_t tag_touch_mutlcap_acq_param_t::mutlcap_resistor_value_cc_cal
 PTC series resistor value during CC cal. More...
 
uint8_t tag_sensor_t::ndil_counter
 
uint16_t tag_touch_measure_data_t::num_channel_references
 
uint16_t tag_touch_filter_data_t::num_channel_signals
 
uint16_t tag_touch_measure_data_t::num_channel_signals
 
uint16_t tag_touch_selfcap_config_t::num_channels
 
uint16_t tag_touch_mutlcap_config_t::num_channels
 
uint16_t tag_touch_info_t::num_channels_in_use
 
uint8_t tag_touch_measure_data_t::num_rotor_slider_values
 
uint8_t tag_touch_selfcap_config_t::num_rotors_and_sliders
 
uint8_t tag_touch_mutlcap_config_t::num_rotors_and_sliders
 
uint8_t tag_touch_info_t::num_rotors_sliders_in_use
 
uint8_t tag_touch_measure_data_t::num_sensor_states
 
uint16_t tag_touch_measure_data_t::num_sensors
 
uint16_t tag_touch_selfcap_config_t::num_sensors
 
uint16_t tag_touch_mutlcap_config_t::num_sensors
 
uint16_t tag_touch_info_t::num_sensors_in_use
 
uint16_t * tag_touch_measure_data_t::p_cc_calibration_vals
 
uint16_t * tag_touch_measure_data_t::p_channel_references
 
uint16_t * tag_touch_filter_data_t::p_channel_signals
 
uint16_t * tag_touch_measure_data_t::p_channel_signals
 
uint8_t * tag_touch_selfcap_config_t::p_data_blk
 
uint8_t * tag_touch_mutlcap_config_t::p_data_blk
 
touch_mutlcap_config_ttag_touch_config_t::p_mutlcap_config
 
gain_ttag_touch_mutlcap_acq_param_t::p_mutlcap_gain_per_node
 pointer to gain per node More...
 
freq_hop_sel_ttag_touch_mutlcap_acq_param_t::p_mutlcap_hop_freqs
 pointer to acquisition frequency settings More...
 
uint16_t * tag_touch_mutlcap_config_t::p_mutlcap_xy_nodes
 
uint8_t * tag_touch_measure_data_t::p_rotor_slider_values
 
touch_selfcap_config_ttag_touch_config_t::p_selfcap_config
 
gain_ttag_touch_selfcap_acq_param_t::p_selfcap_gain_per_node
 pointer to gain per node More...
 
freq_hop_sel_ttag_touch_selfcap_acq_param_t::p_selfcap_hop_freqs
 pointer to hop frequency options More...
 
uint16_t * tag_touch_selfcap_config_t::p_selfcap_y_nodes
 
uint8_t * tag_touch_measure_data_t::p_sensor_states
 
sensor_ttag_touch_measure_data_t::p_sensors
 
uint8_t tag_touch_mutlcap_param_t::position_hysteresis
 
resolution_t tag_touch_selfcap_param_t::position_resolution
 
resolution_t tag_touch_mutlcap_param_t::position_resolution
 
uint8_t tag_touch_config_t::ptc_isr_lvl
 PTC ISR priority level. More...
 
recal_threshold_t tag_touch_global_param_t::recal_threshold
 
uint8_t tag_touch_selfcap_config_t::self_quick_reburst_enable
 
auto_os_t tag_touch_selfcap_acq_param_t::selfcap_auto_os
 auto oversampling More...
 
filter_level_t tag_touch_selfcap_acq_param_t::selfcap_filter_level
 filter level More...
 
prsc_div_sel_t tag_touch_selfcap_acq_param_t::selfcap_ptc_prsc
 PTC clock prescale value. More...
 
prsc_div_sel_t tag_touch_selfcap_acq_param_t::selfcap_ptc_prsc_cc_cal
 PTC clock prescale value during CC cal. More...
 
rsel_val_t tag_touch_selfcap_acq_param_t::selfcap_resistor_value
 PTC sense resistor value. More...
 
rsel_val_t tag_touch_selfcap_acq_param_t::selfcap_resistor_value_cc_cal
 PTC sense resistor value during CC cal. More...
 
uint8_t tag_sensor_t::state
 
uint8_t tag_touch_global_param_t::tch_drift_rate
 
uint8_t tag_sensor_t::threshold
 
volatile uint8_t tag_touch_time_t::time_to_measure_touch
 
touch_lib_state_t tag_touch_info_t::tlib_state
 
uint8_t tag_sensor_t::to_channel
 
touch_mutlcap_acq_param_t tag_touch_mutlcap_config_t::touch_mutlcap_acq_param
 sensor acquisition param info. More...
 
freq_mode_sel_t tag_touch_mutlcap_acq_param_t::touch_mutlcap_freq_mode
 setup acquisition frequency mode More...
 
touch_selfcap_acq_param_t tag_touch_selfcap_config_t::touch_selfcap_acq_param
 sensor acquisition param info. More...
 
freq_mode_sel_t tag_touch_selfcap_acq_param_t::touch_selfcap_freq_mode
 enable/disable noise counter-measures More...
 
uint8_t tag_sensor_t::type_aks_pos_hyst
 

Touch Library Acquisition Status bitfields.

enum  tag_gain_t {
  GAIN_1,
  GAIN_2,
  GAIN_4,
  GAIN_8,
  GAIN_16,
  GAIN_32
}
 
enum  tag_filter_level_t {
  FILTER_LEVEL_1,
  FILTER_LEVEL_2,
  FILTER_LEVEL_4,
  FILTER_LEVEL_8,
  FILTER_LEVEL_16,
  FILTER_LEVEL_32,
  FILTER_LEVEL_64
}
 
enum  tag_auto_os_t {
  AUTO_OS_DISABLE,
  AUTO_OS_2,
  AUTO_OS_4,
  AUTO_OS_8,
  AUTO_OS_16,
  AUTO_OS_32,
  AUTO_OS_64,
  AUTO_OS_128
}
 
enum  tag_touch_ret_t {
  TOUCH_SUCCESS,
  TOUCH_ACQ_INCOMPLETE,
  TOUCH_INVALID_INPUT_PARAM,
  TOUCH_INVALID_LIB_STATE,
  TOUCH_INVALID_SELFCAP_CONFIG_PARAM,
  TOUCH_INVALID_MUTLCAP_CONFIG_PARAM,
  TOUCH_INVALID_RECAL_THRESHOLD,
  TOUCH_INVALID_CHANNEL_NUM,
  TOUCH_INVALID_SENSOR_TYPE,
  TOUCH_INVALID_SENSOR_ID,
  TOUCH_INVALID_RS_NUM
}
 
enum  tag_channel_t {
  CHANNEL_0,
  CHANNEL_1,
  CHANNEL_2,
  CHANNEL_3,
  CHANNEL_4,
  CHANNEL_5,
  CHANNEL_6,
  CHANNEL_7,
  CHANNEL_8,
  CHANNEL_9,
  CHANNEL_10,
  CHANNEL_11,
  CHANNEL_12,
  CHANNEL_13,
  CHANNEL_14,
  CHANNEL_15,
  CHANNEL_16,
  CHANNEL_17,
  CHANNEL_18,
  CHANNEL_19,
  CHANNEL_20,
  CHANNEL_21,
  CHANNEL_22,
  CHANNEL_23,
  CHANNEL_24,
  CHANNEL_25,
  CHANNEL_26,
  CHANNEL_27,
  CHANNEL_28,
  CHANNEL_29,
  CHANNEL_30,
  CHANNEL_31,
  CHANNEL_32,
  CHANNEL_33,
  CHANNEL_34,
  CHANNEL_35,
  CHANNEL_36,
  CHANNEL_37,
  CHANNEL_38,
  CHANNEL_39,
  CHANNEL_40,
  CHANNEL_41,
  CHANNEL_42,
  CHANNEL_43,
  CHANNEL_44,
  CHANNEL_45,
  CHANNEL_46,
  CHANNEL_47,
  CHANNEL_48,
  CHANNEL_49,
  CHANNEL_50,
  CHANNEL_51,
  CHANNEL_52,
  CHANNEL_53,
  CHANNEL_54,
  CHANNEL_55,
  CHANNEL_56,
  CHANNEL_57,
  CHANNEL_58,
  CHANNEL_59,
  CHANNEL_60,
  CHANNEL_61,
  CHANNEL_62,
  CHANNEL_63,
  CHANNEL_64,
  CHANNEL_65,
  CHANNEL_66,
  CHANNEL_67,
  CHANNEL_68,
  CHANNEL_69,
  CHANNEL_70,
  CHANNEL_71,
  CHANNEL_72,
  CHANNEL_73,
  CHANNEL_74,
  CHANNEL_75,
  CHANNEL_76,
  CHANNEL_77,
  CHANNEL_78,
  CHANNEL_79,
  CHANNEL_80,
  CHANNEL_81,
  CHANNEL_82,
  CHANNEL_83,
  CHANNEL_84,
  CHANNEL_85,
  CHANNEL_86,
  CHANNEL_87,
  CHANNEL_88,
  CHANNEL_89,
  CHANNEL_90,
  CHANNEL_91,
  CHANNEL_92,
  CHANNEL_93,
  CHANNEL_94,
  CHANNEL_95,
  CHANNEL_96,
  CHANNEL_97,
  CHANNEL_98,
  CHANNEL_99,
  CHANNEL_100,
  CHANNEL_101,
  CHANNEL_102,
  CHANNEL_103,
  CHANNEL_104,
  CHANNEL_105,
  CHANNEL_106,
  CHANNEL_107,
  CHANNEL_108,
  CHANNEL_109,
  CHANNEL_110,
  CHANNEL_111,
  CHANNEL_112,
  CHANNEL_113,
  CHANNEL_114,
  CHANNEL_115,
  CHANNEL_116,
  CHANNEL_117,
  CHANNEL_118,
  CHANNEL_119,
  CHANNEL_120,
  CHANNEL_121,
  CHANNEL_122,
  CHANNEL_123,
  CHANNEL_124,
  CHANNEL_125,
  CHANNEL_126,
  CHANNEL_127,
  CHANNEL_128,
  CHANNEL_129,
  CHANNEL_130,
  CHANNEL_131,
  CHANNEL_132,
  CHANNEL_133,
  CHANNEL_134,
  CHANNEL_135,
  CHANNEL_136,
  CHANNEL_137,
  CHANNEL_138,
  CHANNEL_139,
  CHANNEL_140,
  CHANNEL_141,
  CHANNEL_142,
  CHANNEL_143,
  CHANNEL_144,
  CHANNEL_145,
  CHANNEL_146,
  CHANNEL_147,
  CHANNEL_148,
  CHANNEL_149,
  CHANNEL_150,
  CHANNEL_151,
  CHANNEL_152,
  CHANNEL_153,
  CHANNEL_154,
  CHANNEL_155,
  CHANNEL_156,
  CHANNEL_157,
  CHANNEL_158,
  CHANNEL_159,
  CHANNEL_160,
  CHANNEL_161,
  CHANNEL_162,
  CHANNEL_163,
  CHANNEL_164,
  CHANNEL_165,
  CHANNEL_166,
  CHANNEL_167,
  CHANNEL_168,
  CHANNEL_169,
  CHANNEL_170,
  CHANNEL_171,
  CHANNEL_172,
  CHANNEL_173,
  CHANNEL_174,
  CHANNEL_175,
  CHANNEL_176,
  CHANNEL_177,
  CHANNEL_178,
  CHANNEL_179,
  CHANNEL_180,
  CHANNEL_181,
  CHANNEL_182,
  CHANNEL_183,
  CHANNEL_184,
  CHANNEL_185,
  CHANNEL_186,
  CHANNEL_187,
  CHANNEL_188,
  CHANNEL_189,
  CHANNEL_190,
  CHANNEL_191,
  CHANNEL_192,
  CHANNEL_193,
  CHANNEL_194,
  CHANNEL_195,
  CHANNEL_196,
  CHANNEL_197,
  CHANNEL_198,
  CHANNEL_199,
  CHANNEL_200,
  CHANNEL_201,
  CHANNEL_202,
  CHANNEL_203,
  CHANNEL_204,
  CHANNEL_205,
  CHANNEL_206,
  CHANNEL_207,
  CHANNEL_208,
  CHANNEL_209,
  CHANNEL_210,
  CHANNEL_211,
  CHANNEL_212,
  CHANNEL_213,
  CHANNEL_214,
  CHANNEL_215,
  CHANNEL_216,
  CHANNEL_217,
  CHANNEL_218,
  CHANNEL_219,
  CHANNEL_220,
  CHANNEL_221,
  CHANNEL_222,
  CHANNEL_223,
  CHANNEL_224,
  CHANNEL_225,
  CHANNEL_226,
  CHANNEL_227,
  CHANNEL_228,
  CHANNEL_229,
  CHANNEL_230,
  CHANNEL_231,
  CHANNEL_232,
  CHANNEL_233,
  CHANNEL_234,
  CHANNEL_235,
  CHANNEL_236,
  CHANNEL_237,
  CHANNEL_238,
  CHANNEL_239,
  CHANNEL_240,
  CHANNEL_241,
  CHANNEL_242,
  CHANNEL_243,
  CHANNEL_244,
  CHANNEL_245,
  CHANNEL_246,
  CHANNEL_247,
  CHANNEL_248,
  CHANNEL_249,
  CHANNEL_250,
  CHANNEL_251,
  CHANNEL_252,
  CHANNEL_253,
  CHANNEL_254,
  CHANNEL_255
}
 
enum  tag_touch_lib_state_t {
  TOUCH_STATE_NULL,
  TOUCH_STATE_INIT,
  TOUCH_STATE_READY,
  TOUCH_STATE_CALIBRATE,
  TOUCH_STATE_BUSY
}
 
enum  tag_sensor_type_t {
  SENSOR_TYPE_UNASSIGNED,
  SENSOR_TYPE_KEY,
  SENSOR_TYPE_ROTOR,
  SENSOR_TYPE_SLIDER,
  MAX_SENSOR_TYPE
}
 
enum  tag_touch_acq_mode_t {
  RAW_ACQ_MODE,
  NORMAL_ACQ_MODE
}
 
enum  tag_auto_tune_type_t {
  AUTO_TUNE_NONE,
  AUTO_TUNE_PRSC,
  AUTO_TUNE_RSEL
}
 
enum  tag_freq_mode_sel_t {
  FREQ_MODE_NONE,
  FREQ_MODE_HOP,
  FREQ_MODE_SPREAD,
  FREQ_MODE_SPREAD_MEDIAN
}
 PTC frequency mode setting. More...
 
enum  tag_prsc_div_sel_t {
  PRSC_DIV_SEL_1,
  PRSC_DIV_SEL_2,
  PRSC_DIV_SEL_4,
  PRSC_DIV_SEL_8
}
 PTC clock prescale setting. More...
 
enum  tag_rsel_val_t {
  RSEL_VAL_0,
  RSEL_VAL_20,
  RSEL_VAL_50,
  RSEL_VAL_100
}
 PTC series resistor setting. More...
 
enum  tag_freq_hop_sel_t {
  FREQ_HOP_SEL_1,
  FREQ_HOP_SEL_2,
  FREQ_HOP_SEL_3,
  FREQ_HOP_SEL_4,
  FREQ_HOP_SEL_5,
  FREQ_HOP_SEL_6,
  FREQ_HOP_SEL_7,
  FREQ_HOP_SEL_8,
  FREQ_HOP_SEL_9,
  FREQ_HOP_SEL_10,
  FREQ_HOP_SEL_11,
  FREQ_HOP_SEL_12,
  FREQ_HOP_SEL_13,
  FREQ_HOP_SEL_14,
  FREQ_HOP_SEL_15,
  FREQ_HOP_SEL_16
}
 PTC acquisition frequency delay setting. More...
 
enum  tag_aks_group_t {
  NO_AKS_GROUP,
  AKS_GROUP_1,
  AKS_GROUP_2,
  AKS_GROUP_3,
  AKS_GROUP_4,
  AKS_GROUP_5,
  AKS_GROUP_6,
  AKS_GROUP_7,
  MAX_AKS_GROUP
}
 Which AKS group, if any, a sensor is in. More...
 
enum  tag_hysteresis_t {
  HYST_50,
  HYST_25,
  HYST_12_5,
  HYST_6_25,
  MAX_HYST
}
 A sensor detection hysteresis value. More...
 
enum  tag_recal_threshold_t {
  RECAL_100,
  RECAL_50,
  RECAL_25,
  RECAL_12_5,
  RECAL_6_25,
  MAX_RECAL
}
 A sensor recalibration threshold. More...
 
enum  tag_resolution_t {
  RES_1_BIT,
  RES_2_BIT,
  RES_3_BIT,
  RES_4_BIT,
  RES_5_BIT,
  RES_6_BIT,
  RES_7_BIT,
  RES_8_BIT,
  MAX_RES
}
 For rotors and sliders, the resolution of the reported angle or position. More...
 
typedef uint8_t threshold_t
 
typedef uint8_t sensor_id_t
 
typedef uint16_t touch_current_time_t
 
typedef int16_t touch_delta_t
 
typedef uint16_t touch_acq_status_t
 
typedef enum tag_gain_t gain_t
 
typedef enum tag_filter_level_t filter_level_t
 
typedef enum tag_auto_os_t auto_os_t
 
typedef enum tag_touch_ret_t touch_ret_t
 
typedef enum tag_channel_t channel_t
 
typedef enum tag_touch_lib_state_t touch_lib_state_t
 
typedef enum tag_sensor_type_t sensor_type_t
 
typedef enum tag_touch_acq_mode_t touch_acq_mode_t
 
typedef enum tag_auto_tune_type_t auto_tune_type_t
 
typedef enum tag_freq_mode_sel_t freq_mode_sel_t
 PTC frequency mode setting. More...
 
typedef enum tag_prsc_div_sel_t prsc_div_sel_t
 PTC clock prescale setting. More...
 
typedef enum tag_rsel_val_t rsel_val_t
 PTC series resistor setting. More...
 
typedef enum tag_freq_hop_sel_t freq_hop_sel_t
 PTC acquisition frequency delay setting. More...
 
typedef enum tag_aks_group_t aks_group_t
 Which AKS group, if any, a sensor is in. More...
 
typedef enum tag_hysteresis_t hysteresis_t
 A sensor detection hysteresis value. More...
 
typedef enum tag_recal_threshold_t recal_threshold_t
 A sensor recalibration threshold. More...
 
typedef enum tag_resolution_t resolution_t
 For rotors and sliders, the resolution of the reported angle or position. More...
 
typedef struct tag_touch_time_t touch_time_t
 
typedef struct tag_sensor_t sensor_t
 
typedef struct
tag_touch_global_param_t 
touch_global_param_t
 
typedef struct
tag_touch_filter_data_t 
touch_filter_data_t
 
typedef struct
tag_touch_measure_data_t 
touch_measure_data_t
 
typedef struct
tag_touch_selfcap_param_t 
touch_selfcap_param_t
 
typedef struct
tag_touch_mutlcap_param_t 
touch_mutlcap_param_t
 
typedef struct
tag_touch_mutlcap_acq_param_t 
touch_mutlcap_acq_param_t
 Mutual capacitance sensor acquisition parameter type. More...
 
typedef struct
tag_touch_selfcap_acq_param_t 
touch_selfcap_acq_param_t
 Self capacitance sensor acquisition parameter type. More...
 
typedef struct
tag_touch_selfcap_config_t 
touch_selfcap_config_t
 
typedef struct
tag_touch_mutlcap_config_t 
touch_mutlcap_config_t
 
typedef struct tag_touch_config_t touch_config_t
 
typedef struct tag_touch_info_t touch_info_t
 
touch_time_t touch_time
 
touch_measure_data_tp_selfcap_measure_data
 Self Cap sensors measured data pointer. More...
 
touch_measure_data_tp_mutlcap_measure_data
 Mutual Cap sensors measured data pointer. More...
 
#define TOUCH_NO_ACTIVITY   (0x0000u) /* !< No Touch activity. */
 
#define TOUCH_IN_DETECT
 
#define TOUCH_STATUS_CHANGE
 
#define TOUCH_ROTOR_SLIDER_POS_CHANGE
 
#define TOUCH_CHANNEL_REF_CHANGE
 
#define TOUCH_BURST_AGAIN
 
#define TOUCH_RESOLVE_CAL
 
#define TOUCH_RESOLVE_FILTERIN
 
#define TOUCH_RESOLVE_DI
 
#define TOUCH_RESOLVE_POS_RECAL
 
#define GET_SELFCAP_SENSOR_STATE(SENSOR_NUMBER)
 
#define GET_MUTLCAP_SENSOR_STATE(SENSOR_NUMBER)
 
#define GET_SELFCAP_ROTOR_SLIDER_POSITION(ROTOR_SLIDER_NUMBER)
 
#define GET_MUTLCAP_ROTOR_SLIDER_POSITION(ROTOR_SLIDER_NUMBER)
 
#define X(n)   (uint16_t)(1u << n)
 Calculate X line bit position. More...
 
#define Y(n)   (uint16_t)(1u << n)
 Calculate Y line bit position. More...
 
#define TOUCH_MAX_POS_HYST   (7u)
 Max position hysteresis allowed. More...
 

Touch Helper API.

touch_ret_t touch_sensors_init (void)
 This API is used to initialize and configure the Touch Library. More...
 
touch_ret_t touch_sensors_measure (void)
 This API is used to perform a Single Capacitance measurement using the Touch Library. More...
 
void touch_sensors_update_time (void)
 This API is used to update Timing info for Touch Library. Typical usage of this API is inside a periodic timer ISR. More...
 

Touch API.

touch_ret_t touch_mutlcap_sensors_init_with_rs_table (touch_config_t *p_touch_config, void(*rs_table_init)(void))
 This API is used to initialize the Touch Library with Mutual cap method pin, register and sensor configuration provided by the user. More...
 
touch_ret_t touch_selfcap_sensors_init_with_rs_table (touch_config_t *p_touch_config, void(*rs_table_init)(void))
 This API is used to initialize the Touch Library with Self cap method pin, register and sensor configuration provided by the user. More...
 
touch_ret_t touch_mutlcap_sensor_config (sensor_type_t sensor_type, channel_t from_channel, channel_t to_channel, aks_group_t aks_group, threshold_t detect_threshold, hysteresis_t detect_hysteresis, resolution_t position_resolution, uint8_t position_hysteresis, sensor_id_t *p_sensor_id)
 This API can be used to configure a sensor of type key, rotor or slider. More...
 
touch_ret_t touch_selfcap_sensor_config (sensor_type_t sensor_type, channel_t from_channel, channel_t to_channel, aks_group_t aks_group, threshold_t detect_threshold, hysteresis_t detect_hysteresis, resolution_t position_resolution, sensor_id_t *p_sensor_id)
 
touch_ret_t touch_mutlcap_sensors_calibrate (auto_tune_type_t)
 This API is used to calibrate the sensors for the first time before starting a Touch measurement. This API can also be used to force calibration of sensors when any of the Touch sensor parameters are changed during runtime. More...
 
touch_ret_t touch_selfcap_sensors_calibrate (auto_tune_type_t)
 
touch_ret_t touch_selfcap_sensors_measure (touch_current_time_t current_time_ms, touch_acq_mode_t selfcap_acq_mode, void(*measure_complete_callback)(void))
 This API can be used to start a Touch measurement. More...
 
touch_ret_t touch_mutlcap_sensors_measure (touch_current_time_t current_time_ms, touch_acq_mode_t mutlcap_acq_mode, void(*measure_complete_callback)(void))
 
touch_ret_t touch_mutlcap_sensor_get_delta (sensor_id_t sensor_id, touch_delta_t *p_delta)
 This API can be used retrieve the delta value corresponding to a given sensor. More...
 
touch_ret_t touch_selfcap_sensor_get_delta (sensor_id_t sensor_id, touch_delta_t *p_delta)
 
touch_ret_t touch_mutlcap_sensor_update_config (sensor_id_t sensor_id, touch_mutlcap_param_t *p_touch_sensor_param)
 This API can be used to set the sensor configuration parameters. More...
 
touch_ret_t touch_selfcap_sensor_update_config (sensor_id_t sensor_id, touch_selfcap_param_t *p_touch_sensor_param)
 
touch_ret_t touch_mutlcap_sensor_get_config (sensor_id_t sensor_id, touch_mutlcap_param_t *p_touch_sensor_param)
 This API can be used to read back the sensor configuration parameters. More...
 
touch_ret_t touch_selfcap_sensor_get_config (sensor_id_t sensor_id, touch_selfcap_param_t *p_touch_sensor_param)
 
touch_ret_t touch_mutlcap_sensor_update_acq_config (touch_mutlcap_acq_param_t *p_touch_mutlcap_acq_param)
 This API can be used to set the sensor configuration parameters. More...
 
touch_ret_t touch_selfcap_sensor_update_acq_config (touch_selfcap_acq_param_t *p_touch_selfcap_acq_param)
 
touch_ret_t touch_mutlcap_sensor_get_acq_config (touch_mutlcap_acq_param_t *p_touch_mutlcap_acq_param)
 This API can be used to read back the sensor configuration parameters. More...
 
touch_ret_t touch_selfcap_sensor_get_acq_config (touch_selfcap_acq_param_t *p_touch_selfcap_acq_param)
 
touch_ret_t touch_mutlcap_update_global_param (touch_global_param_t *p_global_param)
 This API can be used to update the global parameter. More...
 
touch_ret_t touch_selfcap_update_global_param (touch_global_param_t *p_global_param)
 
touch_ret_t touch_mutlcap_get_global_param (touch_global_param_t *p_global_param)
 This API can be used to read back the global parameter. More...
 
touch_ret_t touch_selfcap_get_global_param (touch_global_param_t *p_global_param)
 
touch_ret_t touch_mutlcap_sensor_disable (sensor_id_t sensor_id)
 This API can be used to disable any sensor. More...
 
touch_ret_t touch_selfcap_sensor_disable (sensor_id_t sensor_id)
 
touch_ret_t touch_mutlcap_sensor_reenable (sensor_id_t sensor_id)
 This API can be used to reenable a disabled sensor. More...
 
touch_ret_t touch_selfcap_sensor_reenable (sensor_id_t sensor_id)
 
touch_ret_t touch_mutlcap_get_libinfo (touch_info_t *p_touch_info)
 This API can be used to get the Touch Library configuration. More...
 
touch_ret_t touch_selfcap_get_libinfo (touch_info_t *p_touch_info)
 
#define touch_mutlcap_sensors_init(y)
 touch_ret_t touch_mutlcap_sensors_init( touch_config_t *p_touch_config); More...
 
#define touch_selfcap_sensors_init(y)
 touch_ret_t touch_selfcap_sensors_init( touch_config_t *p_touch_config); More...
 

Touch Library internal use functions.

void touch_mutlcap_rs_table_init (void)
 This is an extern function of the Touch Library. This function is NOT to be used by the user. More...
 
void touch_selfcap_rs_table_init (void)
 

#define GET_MUTLCAP_ROTOR_SLIDER_POSITION (   ROTOR_SLIDER_NUMBER)
Value:
ROTOR_SLIDER_NUMBER]
touch_measure_data_t * p_mutlcap_measure_data
Mutual Cap sensors measured data pointer.
Definition: thirdparty/qtouch/devspecific/sam0/samd/examples/example_selfcap/qtouch/touch.c:93
uint8_t * p_rotor_slider_values
Definition: touch_api_SAMD.h:764
#define GET_MUTLCAP_SENSOR_STATE (   SENSOR_NUMBER)
Value:
p_sensor_states[(SENSOR_NUMBER / \
8)] & (1 << (SENSOR_NUMBER % 8))
touch_measure_data_t * p_mutlcap_measure_data
Mutual Cap sensors measured data pointer.
Definition: thirdparty/qtouch/devspecific/sam0/samd/examples/example_selfcap/qtouch/touch.c:93
#define GET_SELFCAP_ROTOR_SLIDER_POSITION (   ROTOR_SLIDER_NUMBER)
Value:
ROTOR_SLIDER_NUMBER]
touch_measure_data_t * p_selfcap_measure_data
Self Cap sensors measured data pointer.
Definition: thirdparty/qtouch/devspecific/sam0/samd/examples/example_selfcap/qtouch/touch.c:99
uint8_t * p_rotor_slider_values
Definition: touch_api_SAMD.h:764
#define GET_SELFCAP_SENSOR_STATE (   SENSOR_NUMBER)
Value:
p_sensor_states[(SENSOR_NUMBER / \
8)] & (1 << (SENSOR_NUMBER % 8))
touch_measure_data_t * p_selfcap_measure_data
Self Cap sensors measured data pointer.
Definition: thirdparty/qtouch/devspecific/sam0/samd/examples/example_selfcap/qtouch/touch.c:99
#define TOUCH_BURST_AGAIN
Value:
(0x0100u) /* !< Indicates that reburst is
* required to resolve Filtering
* or Calibration state. */

Referenced by touch_mutlcap_measure_complete_callback(), and touch_selfcap_measure_complete_callback().

#define TOUCH_CHANNEL_REF_CHANGE
Value:
(0x0008u) /* !< Change in Reference value
* of atleast one Touch channel. */

Referenced by touch_mutlcap_measure_complete_callback(), and touch_selfcap_measure_complete_callback().

#define TOUCH_IN_DETECT
Value:
(0x0001u) /* !< Atleast one Touch channel
* is in detect. */
#define TOUCH_MAX_POS_HYST   (7u)

Max position hysteresis allowed.

#define touch_mutlcap_sensors_init (   y)
Value:
PRIV_MUTLCAP_RS_TABLE_INIT );
touch_ret_t touch_mutlcap_sensors_init_with_rs_table(touch_config_t *p_touch_config, void(*rs_table_init)(void))
This API is used to initialize the Touch Library with Mutual cap method pin, register and sensor conf...

touch_ret_t touch_mutlcap_sensors_init( touch_config_t *p_touch_config);

Referenced by touch_sensors_init().

#define TOUCH_NO_ACTIVITY   (0x0000u) /* !< No Touch activity. */
#define TOUCH_RESOLVE_CAL
Value:
(0x0200u) /* !< Indicates that reburst is
* needed to resolve
* Calibration. */
#define TOUCH_RESOLVE_DI
Value:
(0x0800u) /* !< Indicates that reburst is
* needed to resolve Detect
* Integration. */
#define TOUCH_RESOLVE_FILTERIN
Value:
(0x0400u) /* !< Indicates that reburst is
* needed to resolve Filtering. */
#define TOUCH_RESOLVE_POS_RECAL
Value:
(0x1000u) /* !< Indicates that reburst is
* needed to resolve
* Recalibration. */
#define TOUCH_ROTOR_SLIDER_POS_CHANGE
Value:
(0x0004u) /* !< Change in Rotor or Slider
* position of atleast one rotor
* or slider. */

Referenced by touch_mutlcap_measure_complete_callback(), and touch_selfcap_measure_complete_callback().

#define touch_selfcap_sensors_init (   y)
Value:
PRIV_SELFCAP_RS_TABLE_INIT );
touch_ret_t touch_selfcap_sensors_init_with_rs_table(touch_config_t *p_touch_config, void(*rs_table_init)(void))
This API is used to initialize the Touch Library with Self cap method pin, register and sensor config...

touch_ret_t touch_selfcap_sensors_init( touch_config_t *p_touch_config);

Referenced by touch_sensors_init().

#define TOUCH_STATUS_CHANGE
Value:
(0x0002u) /* !< Change in Touch status of
* atleast one Touch channel. */

Referenced by touch_mutlcap_measure_complete_callback(), and touch_selfcap_measure_complete_callback().

#define X (   n)    (uint16_t)(1u << n)

Calculate X line bit position.

Referenced by MD4ProcessBlock(), and MD5ProcessBlock().

#define Y (   n)    (uint16_t)(1u << n)

Calculate Y line bit position.

Which AKS group, if any, a sensor is in.

NO_AKS_GROUP = sensor is not in an AKS group, and cannot be suppressed. AKS_GROUP_x = sensor is in AKS group x.

typedef enum tag_auto_os_t auto_os_t
typedef enum tag_channel_t channel_t

PTC acquisition frequency delay setting.

The PTC acquisition frequency is dependent on the Generic clock input to PTC and PTC clock prescaler setting. This delay setting inserts "n" PTC clock cycles between consecutive measurements on a given sensor, thereby changing the PTC acquisition frequency. FREQ_HOP_SEL_1 setting inserts 1 PTC clock cycle between consecutive measurements. FREQ_HOP_SEL_14 setting inserts 14 PTC clock cycles. Hence, higher delay setting will increase the total time taken for capacitance measurement on a given sensor as compared to a lower delay setting.

A desired setting can be used to avoid noise around the same frequency as the acquisition frequency.

PTC frequency mode setting.

Example: if Generic clock input to PTC = 4MHz, then: FREQ_MODE_NONE No Frequency hopping FREQ_MODE_HOP Frequency hopping is enabled. FREQ_MODE_SPREAD pread spectrum mode with median filter disabled. FREQ_MODE_SPREAD_MEDIAN Spread spectrum mode with median filter enabled.

typedef enum tag_gain_t gain_t

A sensor detection hysteresis value.

This is expressed as a percentage of the sensor detection threshold. HYST_x = hysteresis value is x% of detection threshold value (rounded down). NB: a minimum value of 2 is used.

Example: if detection threshold = 20, then: HYST_50 = 10 (50% of 20) HYST_25 = 5 (25% of 20) HYST_12_5 = 2 (12.5% of 20) HYST_6_25 = 2 (6.25% of 20 = 1, but value is hardlimited to 2)

PTC clock prescale setting.

Refer touch_configure_ptc_clock() API in touch.c Example: if Generic clock input to PTC = 4MHz, then: PRSC_DIV_SEL_1 sets PTC Clock to 4MHz PRSC_DIV_SEL_2 sets PTC Clock to 2MHz PRSC_DIV_SEL_4 sets PTC Clock to 1MHz PRSC_DIV_SEL_8 sets PTC Clock to 500KHz

A sensor recalibration threshold.

This is expressed as a percentage of the sensor detection threshold. RECAL_x = recalibration threshold is x% of detection threshold value (rounded down). NB: a minimum value of 4 is used.

Example: if detection threshold = 40, then: RECAL_100 = 40 (100% of 40) RECAL_50 = 20 (50% of 40) RECAL_25 = 10 (25% of 40) RECAL_12_5 = 5 (12.5% of 40) RECAL_6_25 = 4 (6.25% of 40 = 2, but value is hardlimited to 4)

For rotors and sliders, the resolution of the reported angle or position.

RES_x_BIT = rotor/slider reports x-bit values.

Example: if slider resolution is RES_7_BIT, then reported positions are in the range 0..127.

typedef enum tag_rsel_val_t rsel_val_t

PTC series resistor setting.

For Mutual cap mode, this series resistor is switched internally on the Y-pin. For Self cap mode, thes series resistor is switched internally on the Sensor pin.

Example: RSEL_VAL_0 sets internal series resistor to 0ohms. RSEL_VAL_20 sets internal series resistor to 20Kohms. RSEL_VAL_50 sets internal series resistor to 50Kohms. RSEL_VAL_100 sets internal series resistor to 100Kohms.

typedef uint8_t sensor_id_t
typedef struct tag_sensor_t sensor_t
typedef uint8_t threshold_t
typedef uint16_t touch_acq_status_t
typedef uint16_t touch_current_time_t
typedef int16_t touch_delta_t

Mutual capacitance sensor acquisition parameter type.

Self capacitance sensor acquisition parameter type.

Which AKS group, if any, a sensor is in.

NO_AKS_GROUP = sensor is not in an AKS group, and cannot be suppressed. AKS_GROUP_x = sensor is in AKS group x.

Enumerator
NO_AKS_GROUP 
AKS_GROUP_1 
AKS_GROUP_2 
AKS_GROUP_3 
AKS_GROUP_4 
AKS_GROUP_5 
AKS_GROUP_6 
AKS_GROUP_7 
MAX_AKS_GROUP 
Enumerator
AUTO_OS_DISABLE 
AUTO_OS_2 
AUTO_OS_4 
AUTO_OS_8 
AUTO_OS_16 
AUTO_OS_32 
AUTO_OS_64 
AUTO_OS_128 
Enumerator
AUTO_TUNE_NONE 

Auto tuning disabled.

AUTO_TUNE_PRSC 
AUTO_TUNE_RSEL 
Enumerator
CHANNEL_0 
CHANNEL_1 
CHANNEL_2 
CHANNEL_3 
CHANNEL_4 
CHANNEL_5 
CHANNEL_6 
CHANNEL_7 
CHANNEL_8 
CHANNEL_9 
CHANNEL_10 
CHANNEL_11 
CHANNEL_12 
CHANNEL_13 
CHANNEL_14 
CHANNEL_15 
CHANNEL_16 
CHANNEL_17 
CHANNEL_18 
CHANNEL_19 
CHANNEL_20 
CHANNEL_21 
CHANNEL_22 
CHANNEL_23 
CHANNEL_24 
CHANNEL_25 
CHANNEL_26 
CHANNEL_27 
CHANNEL_28 
CHANNEL_29 
CHANNEL_30 
CHANNEL_31 
CHANNEL_32 
CHANNEL_33 
CHANNEL_34 
CHANNEL_35 
CHANNEL_36 
CHANNEL_37 
CHANNEL_38 
CHANNEL_39 
CHANNEL_40 
CHANNEL_41 
CHANNEL_42 
CHANNEL_43 
CHANNEL_44 
CHANNEL_45 
CHANNEL_46 
CHANNEL_47 
CHANNEL_48 
CHANNEL_49 
CHANNEL_50 
CHANNEL_51 
CHANNEL_52 
CHANNEL_53 
CHANNEL_54 
CHANNEL_55 
CHANNEL_56 
CHANNEL_57 
CHANNEL_58 
CHANNEL_59 
CHANNEL_60 
CHANNEL_61 
CHANNEL_62 
CHANNEL_63 
CHANNEL_64 
CHANNEL_65 
CHANNEL_66 
CHANNEL_67 
CHANNEL_68 
CHANNEL_69 
CHANNEL_70 
CHANNEL_71 
CHANNEL_72 
CHANNEL_73 
CHANNEL_74 
CHANNEL_75 
CHANNEL_76 
CHANNEL_77 
CHANNEL_78 
CHANNEL_79 
CHANNEL_80 
CHANNEL_81 
CHANNEL_82 
CHANNEL_83 
CHANNEL_84 
CHANNEL_85 
CHANNEL_86 
CHANNEL_87 
CHANNEL_88 
CHANNEL_89 
CHANNEL_90 
CHANNEL_91 
CHANNEL_92 
CHANNEL_93 
CHANNEL_94 
CHANNEL_95 
CHANNEL_96 
CHANNEL_97 
CHANNEL_98 
CHANNEL_99 
CHANNEL_100 
CHANNEL_101 
CHANNEL_102 
CHANNEL_103 
CHANNEL_104 
CHANNEL_105 
CHANNEL_106 
CHANNEL_107 
CHANNEL_108 
CHANNEL_109 
CHANNEL_110 
CHANNEL_111 
CHANNEL_112 
CHANNEL_113 
CHANNEL_114 
CHANNEL_115 
CHANNEL_116 
CHANNEL_117 
CHANNEL_118 
CHANNEL_119 
CHANNEL_120 
CHANNEL_121 
CHANNEL_122 
CHANNEL_123 
CHANNEL_124 
CHANNEL_125 
CHANNEL_126 
CHANNEL_127 
CHANNEL_128 
CHANNEL_129 
CHANNEL_130 
CHANNEL_131 
CHANNEL_132 
CHANNEL_133 
CHANNEL_134 
CHANNEL_135 
CHANNEL_136 
CHANNEL_137 
CHANNEL_138 
CHANNEL_139 
CHANNEL_140 
CHANNEL_141 
CHANNEL_142 
CHANNEL_143 
CHANNEL_144 
CHANNEL_145 
CHANNEL_146 
CHANNEL_147 
CHANNEL_148 
CHANNEL_149 
CHANNEL_150 
CHANNEL_151 
CHANNEL_152 
CHANNEL_153 
CHANNEL_154 
CHANNEL_155 
CHANNEL_156 
CHANNEL_157 
CHANNEL_158 
CHANNEL_159 
CHANNEL_160 
CHANNEL_161 
CHANNEL_162 
CHANNEL_163 
CHANNEL_164 
CHANNEL_165 
CHANNEL_166 
CHANNEL_167 
CHANNEL_168 
CHANNEL_169 
CHANNEL_170 
CHANNEL_171 
CHANNEL_172 
CHANNEL_173 
CHANNEL_174 
CHANNEL_175 
CHANNEL_176 
CHANNEL_177 
CHANNEL_178 
CHANNEL_179 
CHANNEL_180 
CHANNEL_181 
CHANNEL_182 
CHANNEL_183 
CHANNEL_184 
CHANNEL_185 
CHANNEL_186 
CHANNEL_187 
CHANNEL_188 
CHANNEL_189 
CHANNEL_190 
CHANNEL_191 
CHANNEL_192 
CHANNEL_193 
CHANNEL_194 
CHANNEL_195 
CHANNEL_196 
CHANNEL_197 
CHANNEL_198 
CHANNEL_199 
CHANNEL_200 
CHANNEL_201 
CHANNEL_202 
CHANNEL_203 
CHANNEL_204 
CHANNEL_205 
CHANNEL_206 
CHANNEL_207 
CHANNEL_208 
CHANNEL_209 
CHANNEL_210 
CHANNEL_211 
CHANNEL_212 
CHANNEL_213 
CHANNEL_214 
CHANNEL_215 
CHANNEL_216 
CHANNEL_217 
CHANNEL_218 
CHANNEL_219 
CHANNEL_220 
CHANNEL_221 
CHANNEL_222 
CHANNEL_223 
CHANNEL_224 
CHANNEL_225 
CHANNEL_226 
CHANNEL_227 
CHANNEL_228 
CHANNEL_229 
CHANNEL_230 
CHANNEL_231 
CHANNEL_232 
CHANNEL_233 
CHANNEL_234 
CHANNEL_235 
CHANNEL_236 
CHANNEL_237 
CHANNEL_238 
CHANNEL_239 
CHANNEL_240 
CHANNEL_241 
CHANNEL_242 
CHANNEL_243 
CHANNEL_244 
CHANNEL_245 
CHANNEL_246 
CHANNEL_247 
CHANNEL_248 
CHANNEL_249 
CHANNEL_250 
CHANNEL_251 
CHANNEL_252 
CHANNEL_253 
CHANNEL_254 
CHANNEL_255 
Enumerator
FILTER_LEVEL_1 
FILTER_LEVEL_2 
FILTER_LEVEL_4 
FILTER_LEVEL_8 
FILTER_LEVEL_16 
FILTER_LEVEL_32 
FILTER_LEVEL_64 

PTC acquisition frequency delay setting.

The PTC acquisition frequency is dependent on the Generic clock input to PTC and PTC clock prescaler setting. This delay setting inserts "n" PTC clock cycles between consecutive measurements on a given sensor, thereby changing the PTC acquisition frequency. FREQ_HOP_SEL_1 setting inserts 1 PTC clock cycle between consecutive measurements. FREQ_HOP_SEL_14 setting inserts 14 PTC clock cycles. Hence, higher delay setting will increase the total time taken for capacitance measurement on a given sensor as compared to a lower delay setting.

A desired setting can be used to avoid noise around the same frequency as the acquisition frequency.

Enumerator
FREQ_HOP_SEL_1 
FREQ_HOP_SEL_2 
FREQ_HOP_SEL_3 
FREQ_HOP_SEL_4 
FREQ_HOP_SEL_5 
FREQ_HOP_SEL_6 
FREQ_HOP_SEL_7 
FREQ_HOP_SEL_8 
FREQ_HOP_SEL_9 
FREQ_HOP_SEL_10 
FREQ_HOP_SEL_11 
FREQ_HOP_SEL_12 
FREQ_HOP_SEL_13 
FREQ_HOP_SEL_14 
FREQ_HOP_SEL_15 
FREQ_HOP_SEL_16 

PTC frequency mode setting.

Example: if Generic clock input to PTC = 4MHz, then: FREQ_MODE_NONE No Frequency hopping FREQ_MODE_HOP Frequency hopping is enabled. FREQ_MODE_SPREAD pread spectrum mode with median filter disabled. FREQ_MODE_SPREAD_MEDIAN Spread spectrum mode with median filter enabled.

Enumerator
FREQ_MODE_NONE 
FREQ_MODE_HOP 
FREQ_MODE_SPREAD 
FREQ_MODE_SPREAD_MEDIAN 
enum tag_gain_t
Enumerator
GAIN_1 
GAIN_2 
GAIN_4 
GAIN_8 
GAIN_16 
GAIN_32 

A sensor detection hysteresis value.

This is expressed as a percentage of the sensor detection threshold. HYST_x = hysteresis value is x% of detection threshold value (rounded down). NB: a minimum value of 2 is used.

Example: if detection threshold = 20, then: HYST_50 = 10 (50% of 20) HYST_25 = 5 (25% of 20) HYST_12_5 = 2 (12.5% of 20) HYST_6_25 = 2 (6.25% of 20 = 1, but value is hardlimited to 2)

Enumerator
HYST_50 
HYST_25 
HYST_12_5 
HYST_6_25 
MAX_HYST 

PTC clock prescale setting.

Refer touch_configure_ptc_clock() API in touch.c Example: if Generic clock input to PTC = 4MHz, then: PRSC_DIV_SEL_1 sets PTC Clock to 4MHz PRSC_DIV_SEL_2 sets PTC Clock to 2MHz PRSC_DIV_SEL_4 sets PTC Clock to 1MHz PRSC_DIV_SEL_8 sets PTC Clock to 500KHz

Enumerator
PRSC_DIV_SEL_1 
PRSC_DIV_SEL_2 
PRSC_DIV_SEL_4 
PRSC_DIV_SEL_8 

A sensor recalibration threshold.

This is expressed as a percentage of the sensor detection threshold. RECAL_x = recalibration threshold is x% of detection threshold value (rounded down). NB: a minimum value of 4 is used.

Example: if detection threshold = 40, then: RECAL_100 = 40 (100% of 40) RECAL_50 = 20 (50% of 40) RECAL_25 = 10 (25% of 40) RECAL_12_5 = 5 (12.5% of 40) RECAL_6_25 = 4 (6.25% of 40 = 2, but value is hardlimited to 4)

Enumerator
RECAL_100 
RECAL_50 
RECAL_25 
RECAL_12_5 
RECAL_6_25 
MAX_RECAL 

For rotors and sliders, the resolution of the reported angle or position.

RES_x_BIT = rotor/slider reports x-bit values.

Example: if slider resolution is RES_7_BIT, then reported positions are in the range 0..127.

Enumerator
RES_1_BIT 
RES_2_BIT 
RES_3_BIT 
RES_4_BIT 
RES_5_BIT 
RES_6_BIT 
RES_7_BIT 
RES_8_BIT 
MAX_RES 

PTC series resistor setting.

For Mutual cap mode, this series resistor is switched internally on the Y-pin. For Self cap mode, thes series resistor is switched internally on the Sensor pin.

Example: RSEL_VAL_0 sets internal series resistor to 0ohms. RSEL_VAL_20 sets internal series resistor to 20Kohms. RSEL_VAL_50 sets internal series resistor to 50Kohms. RSEL_VAL_100 sets internal series resistor to 100Kohms.

Enumerator
RSEL_VAL_0 
RSEL_VAL_20 
RSEL_VAL_50 
RSEL_VAL_100 
Enumerator
SENSOR_TYPE_UNASSIGNED 
SENSOR_TYPE_KEY 
SENSOR_TYPE_ROTOR 
SENSOR_TYPE_SLIDER 
MAX_SENSOR_TYPE 
Enumerator
RAW_ACQ_MODE 
NORMAL_ACQ_MODE 
Enumerator
TOUCH_STATE_NULL 
TOUCH_STATE_INIT 
TOUCH_STATE_READY 
TOUCH_STATE_CALIBRATE 
TOUCH_STATE_BUSY 
Enumerator
TOUCH_SUCCESS 
TOUCH_ACQ_INCOMPLETE 
TOUCH_INVALID_INPUT_PARAM 
TOUCH_INVALID_LIB_STATE 
TOUCH_INVALID_SELFCAP_CONFIG_PARAM 
TOUCH_INVALID_MUTLCAP_CONFIG_PARAM 
TOUCH_INVALID_RECAL_THRESHOLD 
TOUCH_INVALID_CHANNEL_NUM 
TOUCH_INVALID_SENSOR_TYPE 
TOUCH_INVALID_SENSOR_ID 
TOUCH_INVALID_RS_NUM 

touch_ret_t touch_mutlcap_get_global_param ( touch_global_param_t p_global_param)

This API can be used to read back the global parameter.

Parameters
p_global_param,:The pointer to global sensor configuration.
Returns
touch_ret_t: Touch Library Error status.
touch_ret_t touch_mutlcap_get_libinfo ( touch_info_t p_touch_info)

This API can be used to get the Touch Library configuration.

Parameters
p_touch_info,:Pointer to the Touch info data structure that will be updated by the Touch Library.
Returns
touch_ret_t: Touch Library Error status.
void touch_mutlcap_rs_table_init ( void  )

This is an extern function of the Touch Library. This function is NOT to be used by the user.

touch_ret_t touch_mutlcap_sensor_config ( sensor_type_t  sensor_type,
channel_t  from_channel,
channel_t  to_channel,
aks_group_t  aks_group,
threshold_t  detect_threshold,
hysteresis_t  detect_hysteresis,
resolution_t  position_resolution,
uint8_t  position_hysteresis,
sensor_id_t p_sensor_id 
)

This API can be used to configure a sensor of type key, rotor or slider.

Parameters
sensor_type,:can be of type key, rotor or slider.
from_channel,:the first channel in the slider sensor.
to_channel,:the last channel in the slider sensor.
aks_group,:which AKS group (if any) the sensor is in.
detect_threshold,:the sensor detection threshold.
detect_hysteresis,:the sensor detection hysteresis value.
position_resolution,:the resolution of the reported position value.
p_sensor_id,:The sensor id value of the configured sensor is updated by the Touch Library.
Note
Range of position_hysteresis value is from 0 to 7.
Returns
touch_ret_t: Touch Library Error status.

Referenced by touch_sensors_config().

touch_ret_t touch_mutlcap_sensor_disable ( sensor_id_t  sensor_id)

This API can be used to disable any sensor.

Parameters
p_global_param,:Sensor number which needs to be disabled
Returns
touch_ret_t: Touch Library Error status.
touch_ret_t touch_mutlcap_sensor_get_acq_config ( touch_mutlcap_acq_param_t p_touch_mutlcap_acq_param)

This API can be used to read back the sensor configuration parameters.

Parameters
p_sensor_id,:The sensor id for which configuration parameter information is being set.
p_touch_sensor_param,:The touch sensor parameter structure that will be updated by the Touch Library.
Returns
touch_ret_t: Touch Library Error status.
touch_ret_t touch_mutlcap_sensor_get_config ( sensor_id_t  sensor_id,
touch_mutlcap_param_t p_touch_sensor_param 
)

This API can be used to read back the sensor configuration parameters.

Parameters
p_sensor_id,:The sensor id for which configuration parameter information is being set.
p_touch_sensor_param,:The touch sensor parameter structure that will be updated by the Touch Library.
Returns
touch_ret_t: Touch Library Error status.
touch_ret_t touch_mutlcap_sensor_get_delta ( sensor_id_t  sensor_id,
touch_delta_t p_delta 
)

This API can be used retrieve the delta value corresponding to a given sensor.

Parameters
sensor_id,:The sensor id for which delta value is being seeked.
p_delta,:Pointer to the delta variable to be updated by the Touch Library.
Returns
touch_ret_t: Touch Library Error status.
touch_ret_t touch_mutlcap_sensor_reenable ( sensor_id_t  sensor_id)

This API can be used to reenable a disabled sensor.

Parameters
p_global_param,:Sensor number which needs to be reenabled
Returns
touch_ret_t: Touch Library Error status.
touch_ret_t touch_mutlcap_sensor_update_acq_config ( touch_mutlcap_acq_param_t p_touch_mutlcap_acq_param)

This API can be used to set the sensor configuration parameters.

Parameters
p_sensor_id,:The sensor id for which configuration parameter information is being set.
p_touch_sensor_param,:The touch sensor parameter structure that will be used by the Touch Library to update.
Returns
touch_ret_t: Touch Library Error status.
touch_ret_t touch_mutlcap_sensor_update_config ( sensor_id_t  sensor_id,
touch_mutlcap_param_t p_touch_sensor_param 
)

This API can be used to set the sensor configuration parameters.

Parameters
p_sensor_id,:The sensor id for which configuration parameter information is being set.
p_touch_sensor_param,:The touch sensor parameter structure that will be used by the Touch Library to update.
Returns
touch_ret_t: Touch Library Error status.
touch_ret_t touch_mutlcap_sensors_calibrate ( auto_tune_type_t  )

This API is used to calibrate the sensors for the first time before starting a Touch measurement. This API can also be used to force calibration of sensors when any of the Touch sensor parameters are changed during runtime.

Returns
touch_ret_t: Touch Library Error status.

Referenced by touch_sensors_init().

touch_ret_t touch_mutlcap_sensors_init_with_rs_table ( touch_config_t p_touch_config,
void(*)(void)  rs_table_init 
)

This API is used to initialize the Touch Library with Mutual cap method pin, register and sensor configuration provided by the user.

Parameters
p_touch_config,:Pointer to Touch configuration structure.
Returns
touch_ret_t: Touch Library Error status.
touch_ret_t touch_mutlcap_sensors_measure ( touch_current_time_t  current_time_ms,
touch_acq_mode_t  mutlcap_acq_mode,
void(*)(void)  measure_complete_callback 
)

Referenced by touch_sensors_measure().

touch_ret_t touch_mutlcap_update_global_param ( touch_global_param_t p_global_param)

This API can be used to update the global parameter.

Parameters
p_global_param,:The pointer to global sensor configuration.
Returns
touch_ret_t: Touch Library Error status.
touch_ret_t touch_selfcap_get_global_param ( touch_global_param_t p_global_param)
touch_ret_t touch_selfcap_get_libinfo ( touch_info_t p_touch_info)
void touch_selfcap_rs_table_init ( void  )
touch_ret_t touch_selfcap_sensor_config ( sensor_type_t  sensor_type,
channel_t  from_channel,
channel_t  to_channel,
aks_group_t  aks_group,
threshold_t  detect_threshold,
hysteresis_t  detect_hysteresis,
resolution_t  position_resolution,
sensor_id_t p_sensor_id 
)

Referenced by touch_sensors_config().

touch_ret_t touch_selfcap_sensor_disable ( sensor_id_t  sensor_id)
touch_ret_t touch_selfcap_sensor_get_acq_config ( touch_selfcap_acq_param_t p_touch_selfcap_acq_param)
touch_ret_t touch_selfcap_sensor_get_config ( sensor_id_t  sensor_id,
touch_selfcap_param_t p_touch_sensor_param 
)
touch_ret_t touch_selfcap_sensor_get_delta ( sensor_id_t  sensor_id,
touch_delta_t p_delta 
)
touch_ret_t touch_selfcap_sensor_reenable ( sensor_id_t  sensor_id)
touch_ret_t touch_selfcap_sensor_update_acq_config ( touch_selfcap_acq_param_t p_touch_selfcap_acq_param)
touch_ret_t touch_selfcap_sensor_update_config ( sensor_id_t  sensor_id,
touch_selfcap_param_t p_touch_sensor_param 
)
touch_ret_t touch_selfcap_sensors_calibrate ( auto_tune_type_t  )

Referenced by touch_sensors_init().

touch_ret_t touch_selfcap_sensors_init_with_rs_table ( touch_config_t p_touch_config,
void(*)(void)  rs_table_init 
)

This API is used to initialize the Touch Library with Self cap method pin, register and sensor configuration provided by the user.

Parameters
p_touch_config,:Pointer to Touch configuration structure.
Returns
touch_ret_t: Touch Library Error status.
touch_ret_t touch_selfcap_sensors_measure ( touch_current_time_t  current_time_ms,
touch_acq_mode_t  selfcap_acq_mode,
void(*)(void)  measure_complete_callback 
)

This API can be used to start a Touch measurement.

Parameters
current_time_ms,:Current time in millisecond.
Returns
touch_ret_t: Touch Library Error status.

Referenced by touch_sensors_measure().

touch_ret_t touch_selfcap_update_global_param ( touch_global_param_t p_global_param)
touch_ret_t touch_sensors_init ( void  )

This API is used to initialize and configure the Touch Library.

Returns
touch_ret_t: Touch Library Error status.

This API is used to initialize and configure the Touch Library.

References AUTO_TUNE_RSEL, tag_touch_time_t::measurement_period_ms, touch_configure_ptc_clock(), touch_mutlcap_sensors_calibrate(), touch_mutlcap_sensors_init, touch_selfcap_sensors_calibrate(), touch_selfcap_sensors_init, touch_sensors_config(), and TOUCH_SUCCESS.

Referenced by demo_start(), and main().

touch_ret_t touch_sensors_measure ( void  )

This API is used to perform a Single Capacitance measurement using the Touch Library.

Returns
touch_ret_t: Touch Library Error status.

References tag_touch_time_t::current_time_ms, NORMAL_ACQ_MODE, tag_touch_time_t::time_to_measure_touch, TOUCH_ACQ_INCOMPLETE, touch_mutlcap_measure_complete_callback(), touch_mutlcap_sensors_measure(), touch_selfcap_measure_complete_callback(), touch_selfcap_sensors_measure(), and TOUCH_SUCCESS.

Referenced by demo_start(), and main().

void touch_sensors_update_time ( void  )

This API is used to update Timing info for Touch Library. Typical usage of this API is inside a periodic timer ISR.

Returns
touch_ret_t: Touch Library Error status.

aks_group_t tag_touch_selfcap_param_t::aks_group
aks_group_t tag_touch_mutlcap_param_t::aks_group
uint8_t tag_touch_global_param_t::atch_drift_rate
uint8_t tag_touch_global_param_t::atch_recal_delay
uint16_t tag_touch_selfcap_config_t::buffer_size
uint16_t tag_touch_mutlcap_config_t::buffer_size
uint8_t tag_touch_global_param_t::cal_seq_1_count
uint8_t tag_touch_global_param_t::cal_seq_2_count
volatile uint16_t tag_touch_time_t::current_time_ms
hysteresis_t tag_touch_selfcap_param_t::detect_hysteresis
hysteresis_t tag_touch_mutlcap_param_t::detect_hysteresis
threshold_t tag_touch_selfcap_param_t::detect_threshold
threshold_t tag_touch_mutlcap_param_t::detect_threshold
uint8_t tag_touch_global_param_t::di
uint8_t tag_touch_global_param_t::drift_hold_time
void(* tag_touch_selfcap_config_t::filter_callback)(touch_filter_data_t *p_filter_data)
void(* tag_touch_mutlcap_config_t::filter_callback)(touch_filter_data_t *p_filter_data)
uint8_t tag_sensor_t::from_channel
uint16_t tag_touch_info_t::fw_version
uint8_t tag_sensor_t::general_counter
touch_global_param_t tag_touch_selfcap_config_t::global_param
touch_global_param_t tag_touch_mutlcap_config_t::global_param
uint8_t tag_sensor_t::index
uint8_t tag_touch_info_t::max_channels_per_rotor_slider
uint8_t tag_touch_global_param_t::max_on_duration
volatile uint8_t tag_touch_measure_data_t::measurement_done_touch
uint16_t tag_touch_time_t::measurement_period_ms
uint8_t tag_touch_mutlcap_config_t::mutl_quick_reburst_enable
auto_os_t tag_touch_mutlcap_acq_param_t::mutlcap_auto_os

auto oversampling

filter_level_t tag_touch_mutlcap_acq_param_t::mutlcap_filter_level

filter level

prsc_div_sel_t tag_touch_mutlcap_acq_param_t::mutlcap_ptc_prsc

PTC clock prescale value.

prsc_div_sel_t tag_touch_mutlcap_acq_param_t::mutlcap_ptc_prsc_cc_cal

PTC clock prescale value during CC cal.

rsel_val_t tag_touch_mutlcap_acq_param_t::mutlcap_resistor_value

PTC series resistor value.

rsel_val_t tag_touch_mutlcap_acq_param_t::mutlcap_resistor_value_cc_cal

PTC series resistor value during CC cal.

uint8_t tag_sensor_t::ndil_counter
uint16_t tag_touch_measure_data_t::num_channel_references
uint16_t tag_touch_filter_data_t::num_channel_signals
uint16_t tag_touch_measure_data_t::num_channel_signals
uint16_t tag_touch_selfcap_config_t::num_channels
uint16_t tag_touch_mutlcap_config_t::num_channels
uint16_t tag_touch_info_t::num_channels_in_use
uint8_t tag_touch_measure_data_t::num_rotor_slider_values
uint8_t tag_touch_selfcap_config_t::num_rotors_and_sliders
uint8_t tag_touch_mutlcap_config_t::num_rotors_and_sliders
uint8_t tag_touch_info_t::num_rotors_sliders_in_use
uint8_t tag_touch_measure_data_t::num_sensor_states
uint16_t tag_touch_measure_data_t::num_sensors
uint16_t tag_touch_selfcap_config_t::num_sensors
uint16_t tag_touch_mutlcap_config_t::num_sensors
uint16_t tag_touch_info_t::num_sensors_in_use
uint16_t* tag_touch_measure_data_t::p_cc_calibration_vals
uint16_t* tag_touch_measure_data_t::p_channel_references
uint16_t* tag_touch_filter_data_t::p_channel_signals
uint16_t* tag_touch_measure_data_t::p_channel_signals
uint8_t* tag_touch_selfcap_config_t::p_data_blk
uint8_t* tag_touch_mutlcap_config_t::p_data_blk
touch_mutlcap_config_t* tag_touch_config_t::p_mutlcap_config
gain_t* tag_touch_mutlcap_acq_param_t::p_mutlcap_gain_per_node

pointer to gain per node

freq_hop_sel_t* tag_touch_mutlcap_acq_param_t::p_mutlcap_hop_freqs

pointer to acquisition frequency settings

touch_measure_data_t* p_mutlcap_measure_data

Mutual Cap sensors measured data pointer.

Note: This pointer is initialized by the QTouch library once the touch_mutlcap_sensors_init API is called.

Referenced by demo_start(), and main().

uint16_t* tag_touch_mutlcap_config_t::p_mutlcap_xy_nodes
uint8_t* tag_touch_measure_data_t::p_rotor_slider_values
touch_selfcap_config_t* tag_touch_config_t::p_selfcap_config
gain_t* tag_touch_selfcap_acq_param_t::p_selfcap_gain_per_node

pointer to gain per node

freq_hop_sel_t* tag_touch_selfcap_acq_param_t::p_selfcap_hop_freqs

pointer to hop frequency options

touch_measure_data_t* p_selfcap_measure_data

Self Cap sensors measured data pointer.

Note: This pointer is initialized by the QTouch library once the touch_selfcap_sensors_init API is called.

Referenced by main().

uint16_t* tag_touch_selfcap_config_t::p_selfcap_y_nodes
uint8_t* tag_touch_measure_data_t::p_sensor_states
sensor_t* tag_touch_measure_data_t::p_sensors
uint8_t tag_touch_mutlcap_param_t::position_hysteresis
resolution_t tag_touch_selfcap_param_t::position_resolution
resolution_t tag_touch_mutlcap_param_t::position_resolution
uint8_t tag_touch_config_t::ptc_isr_lvl

PTC ISR priority level.

recal_threshold_t tag_touch_global_param_t::recal_threshold
uint8_t tag_touch_selfcap_config_t::self_quick_reburst_enable
auto_os_t tag_touch_selfcap_acq_param_t::selfcap_auto_os

auto oversampling

filter_level_t tag_touch_selfcap_acq_param_t::selfcap_filter_level

filter level

prsc_div_sel_t tag_touch_selfcap_acq_param_t::selfcap_ptc_prsc

PTC clock prescale value.

prsc_div_sel_t tag_touch_selfcap_acq_param_t::selfcap_ptc_prsc_cc_cal

PTC clock prescale value during CC cal.

rsel_val_t tag_touch_selfcap_acq_param_t::selfcap_resistor_value

PTC sense resistor value.

rsel_val_t tag_touch_selfcap_acq_param_t::selfcap_resistor_value_cc_cal

PTC sense resistor value during CC cal.

uint8_t tag_sensor_t::state
uint8_t tag_touch_global_param_t::tch_drift_rate
uint8_t tag_sensor_t::threshold
volatile uint8_t tag_touch_time_t::time_to_measure_touch
touch_lib_state_t tag_touch_info_t::tlib_state
uint8_t tag_sensor_t::to_channel
touch_mutlcap_acq_param_t tag_touch_mutlcap_config_t::touch_mutlcap_acq_param

sensor acquisition param info.

freq_mode_sel_t tag_touch_mutlcap_acq_param_t::touch_mutlcap_freq_mode

setup acquisition frequency mode

touch_selfcap_acq_param_t tag_touch_selfcap_config_t::touch_selfcap_acq_param

sensor acquisition param info.

freq_mode_sel_t tag_touch_selfcap_acq_param_t::touch_selfcap_freq_mode

enable/disable noise counter-measures

touch_time_t touch_time

Referenced by rtc_overflow_callback().

uint8_t tag_sensor_t::type_aks_pos_hyst