Microchip® Advanced Software Framework

touch_config.h File Reference

Macros

#define _QMATRIX_
 The following rules need to be followed while configuring the QTouch library for QTouch acquisition method. More...
 
#define _QMATRIX_
 The following rules need to be followed while configuring the QTouch library for QTouch acquisition method. More...
 
#define _ROTOR_SLIDER_
 
#define DEF_QT_DI   4u
 
#define DEF_QT_DRIFT_HOLD_TIME   20 /* 4s */
 
#define DEF_QT_MAX_ON_DURATION   0 /* disabled */
 
#define DEF_QT_NEG_DRIFT_RATE   20 /* 4s per LSB */
 
#define DEF_QT_POS_DRIFT_RATE   5 /* 1s per LSB */
 
#define DEF_QT_POS_RECAL_DELAY   3u
 
#define DEF_QT_RECAL_THRESHOLD   RECAL_50 /* recal threshold = 50% of detect */
 
#define NUM_X_LINES   5
 Define the Number X lines to be used. More...
 
#define NUM_X_PORTS   2
 Specify the number of ports on which X-lines that are distributed. More...
 
#define NUM_Y_LINES   4
 Define the Number Y lines and port for YA, YB to be used. More...
 
#define PORT_NUM_1   1
 
#define PORT_NUM_2   2
 
#define PORT_SMP   D
 Specify the port for SMP. More...
 
#define PORT_SMP   D
 Specify the port for SMP. More...
 
#define PORT_X_1   D
 Specify Which ports have X lines on them. More...
 
#define PORT_X_2   B
 
#define PORT_YA   G
 
#define PORT_YB   F
 
#define QT_DELAY_CYCLES   2
 Example configuration based on option selected in project options. More...
 
#define QT_DELAY_CYCLES   2
 Example configuration based on option selected in project options. More...
 
#define QT_MAX_NUM_ROTORS_SLIDERS   4
 
#define QT_NUM_CHANNELS   32
 Number of Channels(dependent on the library used and application requirement). More...
 
#define SHARED_YAYB   0
 Specify if YA and YB share the same port. More...
 
#define SMP_PIN   5
 
#define SMP_PIN   5
 
#define TICKS_PER_MS   15u /* (16MHz/1024)* (1/1000) */
 Total ticks per msec. More...
 

#define _QMATRIX_

The following rules need to be followed while configuring the QTouch library for QTouch acquisition method.

  1. Always setup the following to have valid values #define QT_NUM_CHANNELS

#define QT_DELAY_CYCLES

The value for QT_NUM_CHANNELS should match the library chosen. For example, when using libavr5g4-64qm-8x-8y-krs-4rs.a library, set QT_NUM_CHANNELS to 64 only.

  1. Define the following for X lines used #define NUM_X_LINES

#define NUM_X_PORTS

#define PORT_NUM_1

#define PORT_NUM_2 <value, if using 2 X ports> #define PORT_NUM_3 <value, if using 3 X ports> #define PORT_X_1

#define PORT_X_2 <value, if using 2 X ports> #define PORT_X_3 <value, if using 3 X ports>

  1. Define the following macros for Y lines used #define NUM_Y_LINES

#define PORT_YA

#define PORT_YB

  1. If ports for YA and YB are the same, define macro #define SHARED_YAYB 1 5 Define these macros for SMP pins used #define PORT_SMP

#define SMP_PIN

  1. If using a library with rotors and sliders, define the macros below: #define ROTOR_SLIDER #define QT_MAX_NUM_ROTOR_SLIDER

The value for QT_MAX_NUM_ROTOR_SLIDER should match the library chosen. For example, when using libavr5g4-64qm-8x-8y-krs-4rs.a library, set QT_MAX_NUM_ROTOR_SLIDER to 4 only.

  1. If using a debug interface, define #define DEBUG_INTERFACE Custom user configuration can be in below section. Define the Number of ROTORS/SLIDERS used. Possible values: 0 ( if ROTOR_SLIDER is not defined) 1, 2, 4 and 8 ( if ROTOR_SLIDER is defined) Depending on the library used.Please refer to the QTouch library user guide.pdf and library selection guide.xls more information on selecting the number of channels.
#define _QMATRIX_

The following rules need to be followed while configuring the QTouch library for QTouch acquisition method.

  1. Always setup the following to have valid values #define QT_NUM_CHANNELS

#define QT_DELAY_CYCLES

The value for QT_NUM_CHANNELS should match the library chosen. For example, when using libavr5g4-64qm-8x-8y-krs-4rs.a library, set QT_NUM_CHANNELS to 64 only.

  1. Define the following for X lines used #define NUM_X_LINES

#define NUM_X_PORTS

#define PORT_NUM_1

#define PORT_NUM_2 <value, if using 2 X ports> #define PORT_NUM_3 <value, if using 3 X ports> #define PORT_X_1

#define PORT_X_2 <value, if using 2 X ports> #define PORT_X_3 <value, if using 3 X ports>

  1. Define the following macros for Y lines used #define NUM_Y_LINES

#define PORT_YA

#define PORT_YB

  1. If ports for YA and YB are the same, define macro #define SHARED_YAYB 1 5 Define these macros for SMP pins used #define PORT_SMP

#define SMP_PIN

  1. If using a library with rotors and sliders, define the macros below: #define ROTOR_SLIDER #define QT_MAX_NUM_ROTOR_SLIDER

The value for QT_MAX_NUM_ROTOR_SLIDER should match the library chosen. For example, when using libavr5g4-64qm-8x-8y-krs-4rs.a library, set QT_MAX_NUM_ROTOR_SLIDER to 4 only.

  1. If using a debug interface, define #define DEBUG_INTERFACE Custom user configuration can be in below section. Define the Number of ROTORS/SLIDERS used. Possible values: 0 ( if ROTOR_SLIDER is not defined) 1, 2, 4 and 8 ( if ROTOR_SLIDER is defined) Depending on the library used.Please refer to the QTouch library user guide.pdf and library selection guide.xls more information on selecting the number of channels.
#define _ROTOR_SLIDER_
#define DEF_QT_DI   4u

Referenced by qt_set_parameters().

#define DEF_QT_DRIFT_HOLD_TIME   20 /* 4s */

Referenced by qt_set_parameters().

#define DEF_QT_MAX_ON_DURATION   0 /* disabled */

Referenced by qt_set_parameters().

#define DEF_QT_NEG_DRIFT_RATE   20 /* 4s per LSB */

Referenced by qt_set_parameters().

#define DEF_QT_POS_DRIFT_RATE   5 /* 1s per LSB */

Referenced by qt_set_parameters().

#define DEF_QT_POS_RECAL_DELAY   3u
#define DEF_QT_RECAL_THRESHOLD   RECAL_50 /* recal threshold = 50% of detect */
#define NUM_X_LINES   5

Define the Number X lines to be used.

Possible values: 4 and 8 Depending on the library used.Please refer to the QTouch library user guide.pdf and library selection guide.xls more information on selecting the number of channels.

#define NUM_X_PORTS   2

Specify the number of ports on which X-lines that are distributed.

Note: Support is provided only for a maximum of 3 ports for X. ( Maximum possible value for NUM_X_PORTS is 3) Possible values: 1,2,3 Also, note that code memory increases with the number of ports used for X lines.

#define NUM_Y_LINES   4

Define the Number Y lines and port for YA, YB to be used.

Possible values: NUM_Y_LINES is 1, 2, 4 and 8 Depending on the library used. Please refer to the QTouch library user guide.pdf and library selection guide.xls for more information on selecting the number of channels, YA and YB ports.

#define PORT_NUM_1   1
#define PORT_NUM_2   2
#define PORT_SMP   D

Specify the port for SMP.

And Specify the pin for SMP on selected SMP port. Any GPIO pin not conflicting with the other touch pins used for the application

#define PORT_SMP   D

Specify the port for SMP.

And Specify the pin for SMP on selected SMP port. Any GPIO pin not conflicting with the other touch pins used for the application

#define PORT_X_1   D

Specify Which ports have X lines on them.

These macros are used to conditionally compile in support for ports driving X lines.

#define PORT_X_2   B
#define PORT_YA   G
#define PORT_YB   F
#define QT_DELAY_CYCLES   2

Example configuration based on option selected in project options.

For user configuration make changes to the custom user configuration section above. Info on the below configuration macros refer above notes. Delay cycles that determine the capacitance charge pulse width. Value of 0 will enable charge pulse width of 1 clock cycle, 1 will enable a width of 2 clock cycles and so on...

Possible values: 1,2,3,4,5,10,25

#define QT_DELAY_CYCLES   2

Example configuration based on option selected in project options.

For user configuration make changes to the custom user configuration section above. Info on the below configuration macros refer above notes. Delay cycles that determine the capacitance charge pulse width. Value of 0 will enable charge pulse width of 1 clock cycle, 1 will enable a width of 2 clock cycles and so on...

Possible values: 1,2,3,4,5,10,25

#define QT_MAX_NUM_ROTORS_SLIDERS   4

Referenced by Transmit_State().

#define QT_NUM_CHANNELS   32

Number of Channels(dependent on the library used and application requirement).

The least possible number more that the application needs. Please refer to the QTouch library user guide.pdf and library selection guide.xls more information on selecting the number of channels.

Possible values: 4, 8, 16, 32, 56, 64. in case of QMatrix.

Referenced by qt_avr477_filter_cb(), Set_QM_Burst_Lengths(), Transmit_Burst_Lengths(), Transmit_Ref(), Transmit_Sensor_Config(), Transmit_Sign_On(), Transmit_Signals(), and Transmit_State().

#define SHARED_YAYB   0

Specify if YA and YB share the same port.

Set the value of the below macro to '1' if the YA and YB pins are share in same port.

#define SMP_PIN   5
#define SMP_PIN   5
#define TICKS_PER_MS   15u /* (16MHz/1024)* (1/1000) */

Total ticks per msec.

TICKS_PER_MS = (CLK_FREQ/TIMER_PRESCALER)*(1/1000)

Referenced by init_timer_isr(), and Transmit_Global_Config().