Atmel QTouch Library User Guide
Atmel QTouch Library User Guide Atmel QTouch Library User Guide
The code can be copied using the “copy code” and pasted in the main.c andtouch_qm_config file,a. In touch_qm_config.h,Copy the following header definitions as part of the preprocessor directives inthe project space or in the beginning of the file#define NUM_X_PORTS 2#define PORT_X_1#define PORT_X_2#define PORT_YA#define PORT_YB#define SMP_PORTBDDCD#define SMP_PIN 7b. In main.c ,Copy the code as belowx_line_info_t x_line_info[NUM_X_LINES]= {FILL_OUT_X_LINE_INFO(1,1);FILL_OUT_X_LINE_INFO(2,2);FILL_OUT_X_LINE_INFO(1,3);FILL_OUT_X_LINE_INFO(2,0);};y_line_info_t ya_line_info[NUM_Y_LINES]= {FILL_OUT_YA_LINE_INFO(1);FILL_OUT_YA_LINE_INFO(3);};y_line_info_t yb_line_info[NUM_Y_LINES]= {FILL_OUT_YB_LINE_INFO(1);FILL_OUT_YB_LINE_INFO(3);};MISRA Compliance ReportThis section lists the compliance and deviations for MISRA standards of coding practice for theQTouch and QMatrix acquisition method libraries.What is coveredThe QTouch and QMatrix acquisition method libraries adhere to the MISRA standards. Theadditional reference code provided in the form of sample applications is not guaranteed to beMISRA compliant.1108207K-AT42-09/11
Target EnvironmentDevelopment EnvironmentMISRA Checking softwareMISRA Rule set appliedIAR Embedded WorkbenchThe MISRA C Compliance has been performed for the libraryusing MISRA C 2004 Rules in IAR Workbench developmentenvironment.MISRAC 2004 Rule SetDeviations from MISRA C StandardsQTouch acquisition method librariesThe QTouch acquisition method libraries were subject to the above mentioned MISRAcompliance rules. The following exceptions have not been fixed as they are required for theimplementation of the library.ApplicableReleaseQTouch libraries version4.4Rule No Rule Description Exception noted / How it is addressed1.1 Rule states that all codeshall conform to ISO 9899standard C, with noextensions permitted.This Rule is not supported as the libraryimplementation requires IAR extensions like__interrupt. These intrinsic functions relate todevice hardware functionality, and cannot10.1 Rule states that implicitconversion from Underlyinglong to unsigned long10.6 This Rule says that a 'U'suffix shall be applied to allconstants of 'unsigned' type14.4 Rule states that go-tostatement should not beused.Rule states that In thedefinition of a function-like19.10 macro, each instance of aparameter shall be enclosedin parenthesis19.12 Rule states that there shallbe at most one occurrenceof the # or ## preprocessoroperator in a single macrodefinitionQMatrix acquisition method librariespractically be avoided.The library uses macros to combine symboldefinitions to form a unique expanded symbolname and in this, the usage of unsigned qualifiersfor numeric constants (e.g. 98u) causes namemangling. This is the only occurrence of this errorin the library.The library uses macros to combine symboldefinitions to form a unique expanded symbolname and in this, the usage of unsigned qualifiersfor numeric constants (e.g. 98u) causes namemangling. This is the only occurrence of this errorin the library.The library uses conditional jump instructions toreduce the code footprint at a few locations andthis is localized to small snippets of code. Hencethis rule is not supported.There is one instance where the library breaks thisrule where two macro definitions are combined toform a different symbol name. Usage ofparenthesis cannot be used in this scenario.There is one instance in the library where this ruleis violated where the library concatenates twomacro definitions to arrive at a different definition.The QMatrix acquisition method software was subject to the above mentioned MISRA compliancerules. The following exceptions have not been fixed as they are required for the implementation ofthe library.111
- Page 60 and 61: Number ofchannels requiredfor the a
- Page 62 and 63: 2. The above definitions should be
- Page 64 and 65: NUM_Y_LINES_ROTOR_SLIDER_QT_MAX_NUM
- Page 66 and 67: has Four Comparators (AC0A , AC1A ,
- Page 68 and 69: Note: When using the IAR IDE / comp
- Page 70 and 71: Figure 5-11: Selecting the right co
- Page 72 and 73: SNS1 - SNSK1 & SNS2 -SNSK2QT_NUM_CH
- Page 74 and 75: Selecting the right configurationTh
- Page 76 and 77: Figure 5-20 : Specifying QMatrix ac
- Page 78 and 79: Debug Support in Example applicatio
- Page 80 and 81: Support for different compiler tool
- Page 82 and 83: Maximum number of rotor / sliders s
- Page 84 and 85: Tips on pin assignments for the sen
- Page 86 and 87: ATtiny88)v1g1s2(ATtiny461,ATmega16a
- Page 88 and 89: X0,X1,X2,X3 are on PB0,PB1,PB2,PB3N
- Page 90 and 91: 1. The channel numbers are allocate
- Page 92 and 93: SNSK_array[1][1]=0x00; (SNSK odd ma
- Page 94 and 95: SNSK_array[1][0]=0x14; (SNSK even m
- Page 96 and 97: Figure 5-28: New Design Sensors in
- Page 98 and 99: Figure 5-31: Selecting the MCU for
- Page 100 and 101: Figure 5-34: Selecting the SNS and
- Page 102 and 103: 2. QTOUCH_STUDIO_MASKS needs to be
- Page 104 and 105: Figure 5-38: Selecting New Design3.
- Page 106 and 107: Figure 5-42: Start window of the co
- Page 108 and 109: Figure 5-45: Selecting the X,YA,YB,
- Page 112 and 113: ApplicablereleaseQTouch libraries v
- Page 114 and 115: Device Specific LibrariesIntroducti
- Page 116 and 117: Table 8 Compiler tool chains suppor
- Page 118 and 119: maintains the States of QMatrix, QT
- Page 120 and 121: equired as shown in the case A of F
- Page 122 and 123: Figure 37 QMatrix method schematicQ
- Page 124 and 125: Figure 39 QMatrix API Flow diagram
- Page 126 and 127: CAT Module Pin NameCSA0CSB0CSA1CSB1
- Page 128 and 129: The QTouch method acquisition using
- Page 130 and 131: Host Application codeUsing the init
- Page 132 and 133: Frozen Stop Stop Run Run Run Run On
- Page 134 and 135: Figure 45 Raw acquisition mode API
- Page 136 and 137: Figure 46 GNU Example project usage
- Page 138 and 139: the QTouch Library as QMatrix data
- Page 140 and 141: TOUCH_STATUS_CHANGE 0x0002u Status
- Page 142 and 143: sensor_type_tEnumerationUsesensor_t
- Page 144 and 145: OUT_OF_TOUCHIN_TOUCHCurrently the a
- Page 146 and 147: num_channel_signals uint8_t Length
- Page 148 and 149: touch_at_statusstructureInput / Out
- Page 150 and 151: UseData structure which holds the R
- Page 152 and 153: variable to the Touch library. The
- Page 154 and 155: structure.p_qta_config touch_qt_con
- Page 156 and 157: p_touch_sensor_param touch_qm_param
- Page 158 and 159: current_time_ms touch_time_t Curren
Target EnvironmentDevelopment EnvironmentMISRA Checking softwareMISRA Rule set appliedIAR Embedded WorkbenchThe MISRA C Compliance has been performed for the libraryusing MISRA C 2004 Rules in IAR Workbench developmentenvironment.MISRAC 2004 Rule SetDeviations from MISRA C Standards<strong>QTouch</strong> acquisition method librariesThe <strong>QTouch</strong> acquisition method libraries were subject to the above mentioned MISRAcompliance rules. The following exceptions have not been fixed as they are required for theimplementation of the library.ApplicableRelease<strong>QTouch</strong> libraries version4.4Rule No Rule Description Exception noted / How it is addressed1.1 Rule states that all codeshall conform to ISO 9899standard C, with noextensions permitted.This Rule is not supported as the libraryimplementation requires IAR extensions like__interrupt. These intrinsic functions relate todevice hardware functionality, and cannot10.1 Rule states that implicitconversion from Underlyinglong to unsigned long10.6 This Rule says that a 'U'suffix shall be applied to allconstants of 'unsigned' type14.4 Rule states that go-tostatement should not beused.Rule states that In thedefinition of a function-like19.10 macro, each instance of aparameter shall be enclosedin parenthesis19.12 Rule states that there shallbe at most one occurrenceof the # or ## preprocessoroperator in a single macrodefinitionQMatrix acquisition method librariespractically be avoided.The library uses macros to combine symboldefinitions to form a unique expanded symbolname and in this, the usage of unsigned qualifiersfor numeric constants (e.g. 98u) causes namemangling. This is the only occurrence of this errorin the library.The library uses macros to combine symboldefinitions to form a unique expanded symbolname and in this, the usage of unsigned qualifiersfor numeric constants (e.g. 98u) causes namemangling. This is the only occurrence of this errorin the library.The library uses conditional jump instructions toreduce the code footprint at a few locations andthis is localized to small snippets of code. Hencethis rule is not supported.There is one instance where the library breaks thisrule where two macro definitions are combined toform a different symbol name. Usage ofparenthesis cannot be used in this scenario.There is one instance in the library where this ruleis violated where the library concatenates twomacro definitions to arrive at a different definition.The QMatrix acquisition method software was subject to the above mentioned MISRA compliancerules. The following exceptions have not been fixed as they are required for the implementation ofthe library.111