Task 4: Configure The Global Options And Enable/Set The Sensors; Setting Up The Code - Atmel AVR8015 Application Note

32-bit
Table of Contents

Advertisement

4.4 Task 4: Configure the global options and enable/set the sensors

4.4.1 Setting up the code

Atmel AVR8015
22
The macros for the pin configurability are defined in the
touch_config_at32uc3l.h
Now build the project, and if everything has been done as per the guidelines given,
you should be able to build successfully with no errors.
Initialize the library.
After this initial configuration, we need to initialize the
done by calling
touch_qm_sensors_calibrate ();
the label: /* Initialize touch sensing. */ to initialize Touch Library.
touch_ret = touch_qm_sensors_calibrate ();
if (touch_ret != TOUCH_SUCCESS)
{
while (1u);
}
Adding more Touch Library configuration.
Next, we need to set up some runtime global QMatrix parameters. For this add the
following macros under the label: /* QMATRIX GLOBAL SENSOR CONFIGURATION
INFO. */ in the structure static
QM_DI,
QM_NEG_DRIFT_RATE,
QM_POS_DRIFT_RATE,
QM_MAX_ON_DURATION,
QM_DRIFT_HOLD_TIME,
QM_POS_RECAL_DELAY,
QM_RECAL_THRESHOLD,
These macros are defined in the file
shift the value specified to the corresponding register offset of the CAT Module.
Adding the timer ISR.
Call
to configure timer ISR to fire regularly. Add this under the label
init_timer();
/* Configure timer to fire ISR regularly. */
Find this function and add the following code to it:
volatile avr32_tc_t *tc = EXAMPLE_TC;
/* options for waveform generation. */
static const tc_waveform_opt_t WAVEFORM_OPT = {
.channel = EXAMPLE_TC_CHANNEL,
.bswtrg = TC_EVT_EFFECT_NOOP,
TIOB. */
.beevt = TC_EVT_EFFECT_NOOP,
TIOB. */
.
Add the code given below under
touch_qm_config_t qm_config.
touch_config_at32uc3l.h
/* Channel selection. */
/* Software trigger effect on
/* External event effect on
Atmel QTouch
Library. This is
. Touch Library will
32185A-AVR-01/12

Advertisement

Table of Contents
loading

This manual is also suitable for:

Qt600At32uc3l qmatrix

Table of Contents