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 | TIMER_COUNTER_H 0 |
#define | TIMER_COUNTER_L TCNT0 |
Functions | |
static void | config_keys (void) |
static void | config_sensors (void) |
static void | init_system (void) |
static void | init_timer_isr (void) |
ISR (TIMER1_COMPA_vect) | |
int | main (void) |
Main function. More... | |
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 |
#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 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_2, CHANNEL_3, HYST_6_25, and qt_enable_key().
Referenced by config_sensors().
|
static |
References config_keys().
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.
int16_t qt_get_sensor_delta | ( | uint8_t | sensor | ) |
|
static |
void set_timer_period | ( | uint16_t | qt_measurement_period_msec | ) |
References qt_measurement_period_msec, and TICKS_PER_MS.
|
static |
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 timestamp1_hword |
uint16_t timestamp1_lword |
uint16_t timestamp2_hword |
uint16_t timestamp2_lword |
uint16_t timestamp3_hword |
uint16_t timestamp3_lword |