Further Explanation - Atmel AVR8015 Application Note

32-bit
Table of Contents

Advertisement

4.4.2 Further explanation

Atmel AVR8015
26
We are using
current_time_ms_touch
is a pointer to the dma channels used for Touch measurement.
p_qm_dma
specifies whether raw acquisition mode or normal acquisition mode is
qm_acq_mode
being used.
measure_complete_callback
once the QMatrix Touch measurement is complete. It provides pointers related to the
measured touch data and touch status.
measured data pointer.
Filter functions.
This function is called after the library has made capacitive measurements, but before
it has processed them. The user can use this hook to apply filter functions to the
measured signal values (possibly to fix sensor layout faults).
Add this macro,
QM_FILTER_CALLBACK
after the label /* Filter callback function pointer */.
qm_config
We are now ready to perform a touch measurement.
Inside the main loop, under the label /* Start a touch sensors measurement process.
*/, add the following piece of code:
touch_ret =
touch_qm_sensors_start_acquisition (current_time_ms_touch,
touch_qm_measure_complete_callback);
if ((touch_ret != TOUCH_SUCCESS)
&& (touch_ret != TOUCH_ACQ_INCOMPLETE))
{
while (1u);
/* Reaching this point can be due to -
1. The api has retured an error due to a invalid input parameter.
2. The api has been called during a invalid Touch Library state. */
}
Build the code.
It should build successfully with no errors or warnings.
Most of the function calls used in this task are quite simple and self explanatory. The
most complex line is the
this:
touch_ret_t touch_qm_sensor_config (sensor_type_t sensor_type,
as a simple counter to keep track of time.
function is called by the Touch Library
measure_data
shows QTouch Library Error status.
touch_ret_t
, in the structure static
touch_qm_sensor_config()
channel_t from_channel,
channel_t to_channel,
aks_group_t aks_group,
threshold_t detect_threshold,
hysteresis_t detect_hysteresis,
resolution_t position_resolution,
uint8_t position_hysteresis,
sensor_id_t * p_sensor_id);
is QMatrix sensor status and
touch_qm_config_t
&qm_dma, NORMAL_ACQ_MODE,
function, so let's look closer at
32185A-AVR-01/12

Advertisement

Table of Contents
loading

This manual is also suitable for:

Qt600At32uc3l qmatrix

Table of Contents