QMatrix Example for ATMega128RFA1 on STK600 board.
Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries.
#include <avr/io.h>
#include <avr/interrupt.h>
#include "touch_api.h"
#include "QDebug.h"
#include "QDebugTransport.h"
Macros | |
#define | __delay_cycles(n) __builtin_avr_delay_cycles(n) |
#define | __enable_interrupt() sei() |
#define | GET_ROTOR_SLIDER_POSITION(ROTOR_SLIDER_NUMBER) qt_measure_data.qt_touch_status.rotor_slider_values[ROTOR_SLIDER_NUMBER] |
#define | GET_SENSOR_STATE(SENSOR_NUMBER) qt_measure_data.qt_touch_status.sensor_states[(SENSOR_NUMBER/8)] & (1 << (SENSOR_NUMBER % 8)) |
#define | TICKS_PER_MS 8u |
#define | TIMER_COUNTER_H 0 |
#define | TIMER_COUNTER_L TCNT0 |
Functions | |
static void | config_64ch_krs (void) |
static void | config_rotor_sliders (void) |
static void | config_sensors (void) |
static void | init_system (void) |
static void | init_timer_isr (void) |
ISR (TIMER1_COMPA_vect) | |
int | main (void) |
int16_t | qt_get_sensor_delta (uint8_t sensor) |
static void | qt_set_parameters (void) |
void | set_timer_period (uint16_t qt_measurement_period_msec) |
Variables | |
static volatile uint16_t | current_time_ms_touch = 0u |
qt_touch_lib_measure_data_t * | pqt_measure_data = &qt_measure_data |
qt_touch_lib_config_data_t | qt_config_data |
qt_touch_lib_measure_data_t | qt_measure_data |
uint16_t | qt_measurement_period_msec = 25u |
timer period in msec. More... | |
static volatile uint8_t | time_to_measure_touch = 0u |
uint16_t | timestamp1_hword |
uint16_t | timestamp1_lword |
uint16_t | timestamp2_hword |
uint16_t | timestamp2_lword |
uint16_t | timestamp3_hword |
uint16_t | timestamp3_lword |
x_line_info_t | x_line_info [NUM_X_LINES] |
y_line_info_t | ya_line_info [NUM_Y_LINES] |
y_line_info_t | yb_line_info [NUM_Y_LINES] |
#define __delay_cycles | ( | n | ) | __builtin_avr_delay_cycles(n) |
#define __enable_interrupt | ( | ) | sei() |
Referenced by main().
#define GET_ROTOR_SLIDER_POSITION | ( | ROTOR_SLIDER_NUMBER | ) | qt_measure_data.qt_touch_status.rotor_slider_values[ROTOR_SLIDER_NUMBER] |
#define GET_SENSOR_STATE | ( | SENSOR_NUMBER | ) | qt_measure_data.qt_touch_status.sensor_states[(SENSOR_NUMBER/8)] & (1 << (SENSOR_NUMBER % 8)) |
#define TICKS_PER_MS 8u |
Referenced by init_timer_isr(), set_timer_period(), and Transmit_Global_Config().
#define TIMER_COUNTER_H 0 |
Referenced by main().
#define TIMER_COUNTER_L TCNT0 |
Referenced by main().
|
static |
References AKS_GROUP_1, CHANNEL_0, CHANNEL_1, CHANNEL_11, CHANNEL_12, CHANNEL_15, CHANNEL_16, CHANNEL_17, CHANNEL_2, CHANNEL_3, CHANNEL_33, CHANNEL_34, CHANNEL_4, CHANNEL_5, CHANNEL_6, CHANNEL_7, CHANNEL_8, HYST_6_25, NO_AKS_GROUP, qt_enable_key(), qt_enable_rotor(), qt_enable_slider(), and RES_8_BIT.
Referenced by config_rotor_sliders().
|
static |
References config_64ch_krs().
Referenced by config_sensors().
|
static |
References config_rotor_sliders().
Referenced by main().
|
static |
Referenced by main().
|
static |
References qt_measurement_period_msec, and TICKS_PER_MS.
Referenced by main().
ISR | ( | TIMER1_COMPA_vect | ) |
References current_time_ms_touch, qt_measurement_period_msec, and time_to_measure_touch.
int main | ( | void | ) |
References __enable_interrupt, config_sensors(), current_time_ms_touch, init_system(), init_timer_isr(), QDebug_Init(), QDebug_ProcessCommands(), QDebug_SendData(), qt_filter_callback, qt_init_sensing, qt_measure_sensors(), qt_set_parameters(), QTLIB_BURST_AGAIN, time_to_measure_touch, TIMER_COUNTER_H, TIMER_COUNTER_L, timestamp1_hword, timestamp1_lword, timestamp2_hword, timestamp2_lword, timestamp3_hword, and timestamp3_lword.
int16_t qt_get_sensor_delta | ( | uint8_t | sensor | ) |
Referenced by Transmit_Delta().
|
static |
References DEF_QT_DI, DEF_QT_DRIFT_HOLD_TIME, DEF_QT_MAX_ON_DURATION, DEF_QT_NEG_DRIFT_RATE, DEF_QT_POS_DRIFT_RATE, DEF_QT_POS_RECAL_DELAY, DEF_QT_RECAL_THRESHOLD, tag_qt_touch_lib_config_data_t::qt_di, tag_qt_touch_lib_config_data_t::qt_drift_hold_time, tag_qt_touch_lib_config_data_t::qt_max_on_duration, tag_qt_touch_lib_config_data_t::qt_neg_drift_rate, tag_qt_touch_lib_config_data_t::qt_pos_drift_rate, tag_qt_touch_lib_config_data_t::qt_pos_recal_delay, and tag_qt_touch_lib_config_data_t::qt_recal_threshold.
Referenced by main().
void set_timer_period | ( | uint16_t | qt_measurement_period_msec | ) |
References qt_measurement_period_msec, and TICKS_PER_MS.
qt_touch_lib_measure_data_t* pqt_measure_data = &qt_measure_data |
qt_touch_lib_config_data_t qt_config_data |
qt_touch_lib_measure_data_t qt_measure_data |
Referenced by Transmit_Ref(), Transmit_Signals(), and Transmit_State().
uint16_t timestamp1_hword |
Referenced by main(), and Transmit_Time_Stamps().
uint16_t timestamp1_lword |
Referenced by main(), and Transmit_Time_Stamps().
uint16_t timestamp2_hword |
Referenced by main(), and Transmit_Time_Stamps().
uint16_t timestamp2_lword |
Referenced by main(), and Transmit_Time_Stamps().
uint16_t timestamp3_hword |
Referenced by main(), and Transmit_Time_Stamps().
uint16_t timestamp3_lword |
Referenced by main(), and Transmit_Time_Stamps().
x_line_info_t x_line_info |
y_line_info_t ya_line_info |
y_line_info_t yb_line_info |