Which driver variables match the QE CapTouch chart

Which driver variables match the QE CapTouch chart

Which driver variables match the QE CapTouch chart

Background:

Some users have expressed interest in developing their own custom debug monitoring system similar to the QE tool's CapTouch Status Chart View. This article explains which variables in the driver source code correspond to each item displayed in the QE tool's CapTouch Status Chart View.

Answer:

Each item displayed in the Status Chart View of QE for Capacitive Touch (hereafter “QE tool”), and the corresponding variables in the TOUCH middleware source code is explained below.

◆ Button (Self-capacitance) / Keypad (Self-capacitance)

Status Chart View

TOUCH Middleware variable

Remarks

Measurement Value

data[] (local variable)*1

Temporarily stored in the local variable data[] of the RM_TOUCH_DataGet function and discarded after the function ends.

Baseline

g_touch_button_reference[]*1

The address is stored in binfo.p_reference in the control block*3.

Threshold

g_touch_button_threshold[]*1

The address is stored in binfo.p_threshold in the control block*3.

Touch ON/OFF Difference

None

Calculated and displayed by the QE tool as “Measurement Value − Threshold Value”.

 

◆ Slider (Self-capacitance)

Status Chart View

TOUCH Middleware variable

Remarks

Touch Position

g_touch_slider_position[]*1

Stored in sinfo.p_position in the control block*3.

Resolution

None

Always displayed as 100. 

Threshold

g_touch_slider_threshold[]*1

Stored in sinfo.p_threshold in the control block*3.

 

◆ Wheel (Self-capacitance)

Status Chart View

TOUCH Middleware variable

Remarks

Touch Position

g_touch_wheel_position[]*1

Stored in winfo.p_position in the control block*3.

Resolution

None

Always displayed as 360. 

Threshold

g_touch_wheel_threshold[]*1

Stored in winfo.p_threshold in the control block*3.

 

◆ Keypad (Mutual-capacitance)

Status Chart View

TOUCH Middleware variable

Remarks

Measurement Value

sensor_mutual_val (local variable)*2

Temporarily stored in the local variable sensor_mutual_val of the RM_TOUCH_DataGet function and discarded after the function ends. 

Baseline 

g_touch_button_reference[]*1

Stored in binfo.p_reference in the control block*3.

Threshold

g_touch_button_threshold[]*1

Stored in binfo.p_threshold in the control block*3.

Touch ON/OFF Difference

None

Calculated and displayed by the QE tool as “Measurement Value − Threshold Value”. 

 

Note1: The QE tool doesn't monitor this variable directly. Instead, it monitors a global variable g_touch_monitor_buf[] that contains a copy for the data. For more details, refer to the rm_touch.c implemetion. 

Note2: This variable is not copied to g_touch_monitor_buf[]. Instead, a local variable data[], which contains the primary and secondary measurement values, is copied to it. The QE tool then calcurates the measurement value as "secondly measurement value - primary  measurement value".

Note3: The “control block” refers to the global variable g_qe_touch_ctrl_<configuration_name> generated by the QE tool, which is of type touch_instance_ctrl_t.