Microchip® Advanced Software Framework

touch_config.h File Reference

Macros

#define _DEBUG_INTERFACE_
 Enable/Disable QDebug for touch debug information communication with QTouch Studio PC Software. More...
 
#define _QMATRIX_
 
#define _ROTOR_SLIDER_
 If ATxmega device is used. More...
 
#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 DEF_QTOUCH_INTERFACE_TYPE   (2)
 Select the type of interface to use for the debug protocol. More...
 
#define MISO_BB   6
 
#define MOSI_BB   5
 
#define NUM_X_LINES   8
 Define the Number X lines to be used. More...
 
#define NUM_X_PORTS   1
 Specify the number of ports on which X-lines that are distributed. More...
 
#define NUM_Y_LINES   8
 Define the Number Y lines and port for YA, YB to be used. More...
 
#define PORT_NUM_1   1
 
#define PORT_SMP   G
 Specify the port for SMP. More...
 
#define PORT_X_1   D
 Specify Which ports have X lines on them. More...
 
#define PORT_YA   B
 
#define PORT_YB   F
 
#define PROJECT_ID   0x33
 
#define QT_DELAY_CYCLES   4
 Example configuration based on option selected in project options. More...
 
#define QT_MAX_NUM_ROTORS_SLIDERS   4
 
#define QT_NUM_CHANNELS   64
 Number of Channels(dependent on the library used and application requirement). More...
 
#define SCK_BB   7
 
#define SHARED_YAYB   0
 Specify if YA and YB share the same port. More...
 
#define SMP_PIN   4
 
#define SPI_BB_MISO   E
 
#define SPI_BB_MOSI   E
 
#define SPI_BB_SCK   E
 
#define SPI_BB_SS   E
 
#define SS_BB   4
 Bit bang SPI port and pin configuration. More...
 
#define TICKS_PER_MS   500u
 Total ticks per msec. More...
 

#define _DEBUG_INTERFACE_

Enable/Disable QDebug for touch debug information communication with QTouch Studio PC Software.

QDebug is enabled by defining the below macro.

#define _QMATRIX_
#define _ROTOR_SLIDER_

If ATxmega device is used.

Possible values: comment/uncomment the lines 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 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

Referenced by qt_set_parameters().

#define DEF_QT_RECAL_THRESHOLD   RECAL_50 /* recal threshold = 50% of detect */

Referenced by qt_set_parameters().

#define DEF_QTOUCH_INTERFACE_TYPE   (2)

Select the type of interface to use for the debug protocol.

When 0, QDebug interface type is on-chip SPI peripheral When 1, QDebug interface type is on-chip TWI peripheral When 2, QDebug interface type is Bit bang SPI

#define MISO_BB   6
#define MOSI_BB   5
#define NUM_X_LINES   8

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   1

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   8

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_SMP   G

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_YA   B
#define PORT_YB   F
#define PROJECT_ID   0x33

Referenced by Transmit_Sign_On().

#define QT_DELAY_CYCLES   4

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   64

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 read_settings_from_eeprom(), Set_QM_Burst_Lengths(), Transmit_Burst_Lengths(), Transmit_Ref(), Transmit_Sensor_Config(), Transmit_Sign_On(), Transmit_Signals(), Transmit_State(), and write_burst_lenghts_to_eeprom().

#define SCK_BB   7
#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   4
#define SPI_BB_MISO   E
#define SPI_BB_MOSI   E
#define SPI_BB_SCK   E
#define SPI_BB_SS   E

Referenced by BitBangSPI_Master_Init().

#define SS_BB   4

Bit bang SPI port and pin configuration.

Note: Ensure that the port pins mentioned below are not used for SNS/SNSK

Referenced by BitBangSPI_Master_Init().

#define TICKS_PER_MS   500u

Total ticks per msec.

TICKS_PER_MS = (CLK_FREQ/TIMER_PRESCALER)*(1/1000) Current Clock frequency is 4Mhz, and Timer Prescaler is 8