Microchip® Advanced Software Framework

main_m128rfa1.c File Reference

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_tpqt_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 void config_keys ( void  )
static
static void config_sensors ( void  )
static

References config_keys().

Referenced by main().

static void init_system ( void  )
static

Referenced by main().

static void init_timer_isr ( void  )
static

References qt_measurement_period_msec, and TICKS_PER_MS.

Referenced by main().

ISR ( TIMER1_COMPA_vect  )
int16_t qt_get_sensor_delta ( uint8_t  sensor)
static void qt_set_parameters ( void  )
static
void set_timer_period ( uint16_t  qt_measurement_period_msec)

volatile uint16_t current_time_ms_touch = 0u
static
qt_touch_lib_measure_data_t qt_measure_data
volatile uint8_t time_to_measure_touch = 0u
static

Referenced by ISR(), and main().

uint16_t timestamp1_hword
uint16_t timestamp1_lword
uint16_t timestamp2_hword
uint16_t timestamp2_lword
uint16_t timestamp3_hword
uint16_t timestamp3_lword