Microchip® Advanced Software Framework

xmega/applications/xmega_a3bu_xplained_demo/qtouch/touch.c File Reference

QTouch Sensor interface.

Copyright (c) 2010-2018 Microchip Technology Inc. and its subsidiaries.

#include <asf.h>
#include "touch_api.h"
#include "QDebug.h"
#include "QDebugTransport.h"

Macros

#define GET_SENSOR_STATE(SENSOR_NUMBER)
 

Functions

bool check_touch_key_pressed (void)
 Checks whether the QTouch key is pressed. More...
 
static void config_sensor (void)
 
static void init_timer_isr (void)
 
int16_t qt_get_sensor_delta (uint8_t sensor)
 Get sensor delta values. More...
 
static void qt_set_parameters (void)
 Passes default parameters from config file to touch library. More...
 
void touch_init (void)
 Configures touch library and measurement setup. More...
 
static void touch_timer_callback ()
 

Variables

static volatile uint16_t current_time_ms_touch = 0
 Current time, set by timer ISR. More...
 
qt_touch_lib_measure_data_tpqt_measure_data = &qt_measure_data
 Output can be observed in the watch window using this pointer. More...
 
qt_touch_lib_config_data_t qt_config_data
 This configuration data structure parameters if needs to be changed will be changed in the qt_set_parameters function. More...
 
qt_touch_lib_measure_data_t qt_measure_data
 Touch output - measurement data. More...
 
uint16_t qt_measurement_period_msec = 25
 Timer period in msec. More...
 
TOUCH_DATA_T SNS_array [2][2]
 
TOUCH_DATA_T SNSK_array [2][2]
 
static volatile bool time_to_measure_touch = false
 Flag set by timer ISR when it's time to measure touch. More...
 

#define GET_SENSOR_STATE (   SENSOR_NUMBER)
Value:
sensor_states[(SENSOR_NUMBER / 8)] & (1 << (SENSOR_NUMBER % 8))
qt_touch_status_t qt_touch_status
state of sensors.
Definition: xmega/applications/xmega_a3bu_xplained_demo/qtouch/touch_api.h:798
qt_touch_lib_measure_data_t qt_measure_data
Touch output - measurement data.

Referenced by check_touch_key_pressed().

bool check_touch_key_pressed ( void  )

Checks whether the QTouch key is pressed.

Referenced by keyboard_get_key_state().

static void config_sensor ( void  )
static

References CHANNEL_0, HYST_6_25, NO_AKS_GROUP, and qt_enable_key().

Referenced by touch_init().

int16_t qt_get_sensor_delta ( uint8_t  sensor)

Get sensor delta values.

Referenced by Transmit_Delta().

void touch_init ( void  )

Configures touch library and measurement setup.

Precondition
Interrupts must be enabled in order to trigger regular measurements The touch configuration requires a fixed CPU speed to work properly in this case we need 2 MHz.

Referenced by main().

static void touch_timer_callback ( )
static

volatile uint16_t current_time_ms_touch = 0
static

Current time, set by timer ISR.

Referenced by check_touch_key_pressed(), and touch_timer_callback().

Output can be observed in the watch window using this pointer.

This configuration data structure parameters if needs to be changed will be changed in the qt_set_parameters function.

Referenced by read_settings_from_eeprom(), Set_Global_Config(), Transmit_Global_Config(), and write_global_settings_to_eeprom().

qt_touch_lib_measure_data_t qt_measure_data

Touch output - measurement data.

Referenced by Transmit_Ref(), Transmit_Signals(), and Transmit_State().

TOUCH_DATA_T SNS_array[2][2]

Referenced by touch_init().

TOUCH_DATA_T SNSK_array[2][2]

Referenced by touch_init().

volatile bool time_to_measure_touch = false
static

Flag set by timer ISR when it's time to measure touch.

Referenced by check_touch_key_pressed(), and touch_timer_callback().