Atmel QTouch Library User Guide
Atmel QTouch Library User Guide Atmel QTouch Library User Guide
the QTouch Library as QMatrix data block. The size of this Data memory block depends on theNumber of Sensors and the Number of Wheel or Slider configured. ThePRIV_QM_DATA_BLK_SIZE macro in touch_api_at32uc3l.h calculates the size of this datamemory block. For example, for the UC3L Evaluation kit Rev2 that has 6 Sensors including 1Wheel and 5 Buttons, the QMatrix data block memory size is 236 bytes.LibraryTypical Codewith Keys OnlyTypical Code whenone or moreWheel/Sliders isusedTypicalDataMemorylibuc3l-qtouch-iar.r82 5882 7296 278libuc3l-qtouch-gnu.a 6228 8080 278Table 14 Typical Code and Data memory for Standalone QMatrix operationNote: This Typical Code memory usage is achieved when only QMatrix Regular API is used inthe application. Usage of QMatrix Helper API would consume additional Code memory. Also,the Code and Data memory indicated in the Table do not account for Example QMatrixapplication.QTouch Group A/B method memory requirementThe Table below captures the Typical Code & Data Memory requirement for the QTouch Librarywhen QTouch Group A or QTouch Group B Sensor is used standalone. (Additional Data memorywill be required when both Group A and Group B are used at the same time.)In addition to the Data memory captured in the Table, the QTouch Group A/B method requiresadditional Data Memory that must be provided to the Touch Library for storing the Signals,References, Sensor information and Touch status. This data memory is provided by the HostApplication to the QTouch Library as QTouch data block. The size of this Data memory blockdepends on the Number of Sensors and the Number of Wheel or Slider configured. ReferPRIV_QTx_DATA_BLK_SIZE macro in touch_api_at32uc3l.h. For example, when 6 Sensors areused that include 1 Wheel, 1 Slider and 2 Button, the QTouch GroupA/B data block memory sizeis 184 bytes.LibraryTypical Codewith Keys OnlyTypical Code whenone or moreWheel/Sliders isusedTypicalDataMemorylibuc3l-qtouch-iar.r82 5198 6450 358libuc3l-qtouch-gnu.a 5290 6774 358Table 15 Typical Code and Data memory for Standalone QTouch Group A/BoperationNote: This Typical Code memory usage is achieved when only the QTouch Group A/B RegularAPI is used in the application. Usage of QTouch Group A/B Helper API would consumeadditional Code memory. Also, the Code and Data memory indicated in the Table do not accountfor Example QTouch application.Autonomous QTouch memory requirementThe Table below captures the Typical Code & Data Memory requirement for the QTouch Librarywhen Autonomous Touch Sensor is used standalone.Library Typical Code with Typical Data1388207K-AT42-09/11
Keys OnlyMemorylibuc3l-qtouch-iar.r82 1184 22libuc3l-qtouch-gnu.a 966 16Table 16 Minimum Code and Data for Standalone Autonomous QTouchsensorNote: This Typical Code memory usage is achieved when only the Autonomous QTouch RegularAPI is used in the application. Usage of Autonomous QTouch Helper API would consumeadditional Code memory. Also, the Code and Data memory indicated in the Table do not accountfor Example Autonomous QTouch application.Public header files of QTouch Library for UC3LFollowing are the public header files which need to be included in user’s application and thesehave the type definitions and function prototypes of the APIs listed in the following sections1. touch_api_at32uc3l.h - QTouch Library API and Data structures file.2. touch_config_at32uc3l.h - QTouch Library configuration file.Type Definitions and enumerations used in the libraryTypedefsThis section lists the type definitions used in the library.TypedefNotesuint8_tunsigned 8-bit integer.int8_tsigned 8 bit integer.uint16_tunsigned 16-bit integer.int16_tsigned 16-bit integer.uint32_tunsigned 32 bit integer.int32_tsigned 32 bit integer.channel_t unsigned 8 bit integer that represents the channel number, starts from 0.threshold_t unsigned 8 bit integer to set sensor detection threshold.sensor_id_t unsigned 8 bit integer that represents the sensor ID, starts from 0.touch_time_t unsigned 16 bit integer that represents current time maintained by thelibrary.touch_bl_tunsigned 8 bit integer that represents the burst length of a QMatrixchannel.touch_delta_t signed 16 bit integer that represents the delta value of a channel.touch_acq_status_t unsigned 16 bit Status of Touch measurement.touch_qt_grp_t unsigned 8 bit QTouch Group type.touch_qt_dma_t unsigned 8 bit QTouch Group A/ Group B DMA channel type..touch_acq_status_tuint16_tUsetouch_acq_status_tIndicates the result of the last acquisition & processing for a specific touchacquisition method.Values Bitmask CommentTOUCH_NO_ACTIVITY 0x0000u No Touch activity.TOUCH_IN_DETECT 0x0001u At least one Touch channel is in detect.139
- 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 110 and 111: The code can be copied using the
- 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 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
- Page 160 and 161: touch_ret_t touch_qt_sensor_config(
- Page 162 and 163: touch_qt_sensors_calibratetouch_ret
- Page 164 and 165: touch_qt_get_libinfotouch_ret_t tou
- Page 166 and 167: • This API updates the configurat
- Page 168 and 169: Rule Rule Description Advisory/Requ
- Page 170 and 171: VCCPA0No ConnectionPA1PA2ATtiny20PA
- Page 172 and 173: QTouch Library configuration parame
- Page 174 and 175: Recommended setting.Table 19 QTouch
- Page 176 and 177: Figure 51 Schematic overview of QTo
- Page 178 and 179: QTouch Library configuration parame
- Page 180 and 181: Devices supportedThe list of differ
- Page 182 and 183: • The channel number is derived f
- Page 184 and 185: MISRA Compliance ReportThis section
- Page 186 and 187: May 2010Ver 4.2July 2010Ver 4.3Jan
the <strong>QTouch</strong> <strong>Library</strong> as QMatrix data block. The size of this Data memory block depends on theNumber of Sensors and the Number of Wheel or Slider configured. ThePRIV_QM_DATA_BLK_SIZE macro in touch_api_at32uc3l.h calculates the size of this datamemory block. For example, for the UC3L Evaluation kit Rev2 that has 6 Sensors including 1Wheel and 5 Buttons, the QMatrix data block memory size is 236 bytes.<strong>Library</strong>Typical Codewith Keys OnlyTypical Code whenone or moreWheel/Sliders isusedTypicalDataMemorylibuc3l-qtouch-iar.r82 5882 7296 278libuc3l-qtouch-gnu.a 6228 8080 278Table 14 Typical Code and Data memory for Standalone QMatrix operationNote: This Typical Code memory usage is achieved when only QMatrix Regular API is used inthe application. Usage of QMatrix Helper API would consume additional Code memory. Also,the Code and Data memory indicated in the Table do not account for Example QMatrixapplication.<strong>QTouch</strong> Group A/B method memory requirementThe Table below captures the Typical Code & Data Memory requirement for the <strong>QTouch</strong> <strong>Library</strong>when <strong>QTouch</strong> Group A or <strong>QTouch</strong> Group B Sensor is used standalone. (Additional Data memorywill be required when both Group A and Group B are used at the same time.)In addition to the Data memory captured in the Table, the <strong>QTouch</strong> Group A/B method requiresadditional Data Memory that must be provided to the Touch <strong>Library</strong> for storing the Signals,References, Sensor information and Touch status. This data memory is provided by the HostApplication to the <strong>QTouch</strong> <strong>Library</strong> as <strong>QTouch</strong> data block. The size of this Data memory blockdepends on the Number of Sensors and the Number of Wheel or Slider configured. ReferPRIV_QTx_DATA_BLK_SIZE macro in touch_api_at32uc3l.h. For example, when 6 Sensors areused that include 1 Wheel, 1 Slider and 2 Button, the <strong>QTouch</strong> GroupA/B data block memory sizeis 184 bytes.<strong>Library</strong>Typical Codewith Keys OnlyTypical Code whenone or moreWheel/Sliders isusedTypicalDataMemorylibuc3l-qtouch-iar.r82 5198 6450 358libuc3l-qtouch-gnu.a 5290 6774 358Table 15 Typical Code and Data memory for Standalone <strong>QTouch</strong> Group A/BoperationNote: This Typical Code memory usage is achieved when only the <strong>QTouch</strong> Group A/B RegularAPI is used in the application. Usage of <strong>QTouch</strong> Group A/B Helper API would consumeadditional Code memory. Also, the Code and Data memory indicated in the Table do not accountfor Example <strong>QTouch</strong> application.Autonomous <strong>QTouch</strong> memory requirementThe Table below captures the Typical Code & Data Memory requirement for the <strong>QTouch</strong> <strong>Library</strong>when Autonomous Touch Sensor is used standalone.<strong>Library</strong> Typical Code with Typical Data1388207K-AT42-09/11