Atmel QTouch Library User Guide
Atmel QTouch Library User Guide Atmel QTouch Library User Guide
Recommended setting.Table 19 QTouch Library for ATtiny20 Memory requirementsData memory for ATtiny20 QTouch Library include the following.10. QTouch Library data memory – 19 bytes, allocated inside the Library.11. channel_signals – 2 bytes per Sensor, allocated in main.c12. channel_references – 2 bytes per Sensor, allocated in main.c13. sensor_delta – 2 bytes per Sensor, allocated in main.c14. sensor_general_counter – 2 bytes per Sensor, allocated in main.c15. sensor_state – 1 byte per Sensor, allocated in main.c16. sensor_ndil_counter – 1 byte per Sensor, allocated in main.c17. sensor_states – 1 byte, allocated in main.cConst Data memory for ATtiny20 QTouch Library include the following.1. sensor_threshold, 1 byte per Sensor, allocated in main.c2. sensor_hyst_threshold, 1 byte per Sensor, allocated in main.c3. sensor_recal_threshold, 1 byte per Sensor, allocated in main.cQTouch Library for ATtiny40 deviceATMEL QTouch Library for ATtiny40 can be used for embedding capacitive touch buttonsfunctionality into ATtiny40 device application.This Section describes the QTouch Library Application Programming API and Configurationinterface for QTouch method acquisition using the ATtiny40 devices.Salient Features of QTouch Library for ATtiny40QTouch method sensor• One Physical pin per Touch Button.• 1 to 12 Touch Buttons can be configured.• Individual Sensor Threshold, Sensor Hysteresis and Sensor Global acquisitionparameters can be configured.• Signal resolution can be configured.• Charge Share Delay can be configured.• Adjacent Key Supression (AKS) support.• QTouch Studio support for Touch data analysis.• ‘C’ Programming interface for easy inclusion of User application.1748207K-AT42-09/11
Compiler tool chain support for ATtiny40The QTouch libraries for ATtiny40 devices are supported for the following compiler tool chains.ToolIAR Embedded Workbench for Atmel AVR.IAR Compiler.Version5.51Table 20 Compiler tool chains support for ATtiny40 QTouch LibraryOverview of QTouch Library for ATtiny40For an overview of QTouch method based capacitive touch acquisition, refer Section 5.2.1QTouch Acquistion method.The QTouch Library for ATtiny40 device allows for Sensor configuration and Sensor Acquisitionparameter setting. Based on the input Sensor configuration, the QTouch Library takes care of thecapacitive touch acquisition data capture operations on the external capacitive touch sensors.The captured Touch Data and Touch Button ON/OFF Status information is then available for userapplication.The diagram below indicates a Typical Sensor arrangement using the Tiny40 device. For onechannel configuration, two ADC pins are used for acquisition. For number of touch buttonsgreater than one, no extra ADC pins are used. Port pins PA0 to PA7 and PB0 to PB3 can beused to support upto 12 Touch Buttons. The Touch Buttons may be connected anywhere on thesaid port pins.The Sensor numbering is always in the increasing order of Port pin.VCCGNDATtiny40PA0PA1PA2PA3PA4PA5PA6PA7PB0PB1PB2PB31Kohm1Kohm1Kohm1Kohm1Kohm1Kohm1Kohm1Kohm1Kohm1Kohm1Kohm1KohmTouch Button 0Touch Button 1Touch Button 2Touch Button 3Touch Button 4Touch Button 5Touch Button 6Touch Button 7Touch Button 8Touch Button 9Touch Button 10Touch Button 11175
- 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
- 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 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
Recommended setting.Table 19 <strong>QTouch</strong> <strong>Library</strong> for ATtiny20 Memory requirementsData memory for ATtiny20 <strong>QTouch</strong> <strong>Library</strong> include the following.10. <strong>QTouch</strong> <strong>Library</strong> data memory – 19 bytes, allocated inside the <strong>Library</strong>.11. channel_signals – 2 bytes per Sensor, allocated in main.c12. channel_references – 2 bytes per Sensor, allocated in main.c13. sensor_delta – 2 bytes per Sensor, allocated in main.c14. sensor_general_counter – 2 bytes per Sensor, allocated in main.c15. sensor_state – 1 byte per Sensor, allocated in main.c16. sensor_ndil_counter – 1 byte per Sensor, allocated in main.c17. sensor_states – 1 byte, allocated in main.cConst Data memory for ATtiny20 <strong>QTouch</strong> <strong>Library</strong> include the following.1. sensor_threshold, 1 byte per Sensor, allocated in main.c2. sensor_hyst_threshold, 1 byte per Sensor, allocated in main.c3. sensor_recal_threshold, 1 byte per Sensor, allocated in main.c<strong>QTouch</strong> <strong>Library</strong> for ATtiny40 deviceATMEL <strong>QTouch</strong> <strong>Library</strong> for ATtiny40 can be used for embedding capacitive touch buttonsfunctionality into ATtiny40 device application.This Section describes the <strong>QTouch</strong> <strong>Library</strong> Application Programming API and Configurationinterface for <strong>QTouch</strong> method acquisition using the ATtiny40 devices.Salient Features of <strong>QTouch</strong> <strong>Library</strong> for ATtiny40<strong>QTouch</strong> method sensor• One Physical pin per Touch Button.• 1 to 12 Touch Buttons can be configured.• Individual Sensor Threshold, Sensor Hysteresis and Sensor Global acquisitionparameters can be configured.• Signal resolution can be configured.• Charge Share Delay can be configured.• Adjacent Key Supression (AKS) support.• <strong>QTouch</strong> Studio support for Touch data analysis.• ‘C’ Programming interface for easy inclusion of <strong>User</strong> application.1748207K-AT42-09/11