Atmel QTouch Library User Guide
Atmel QTouch Library User Guide Atmel QTouch Library User Guide
• This API updates the configuration of autonomous QTouch sensor with a setting that isdifferent from the one configured by calling touch_at_sensor_init API.• The user must populate the structure pointed by p_at_param with required settingsbefore calling this API.touch_at_sensor_get_configtouch_ret_t touch_at_sensor_get_config( touch_at_param_t *p_at_param )Arguments Type Commentp_at_param touch_at_param_t* Pointer to autonomous QTouch sensor configurationstructure.• This API retrieves the current configuration of the autonomous QTouch sensor.touch_at_get_libinfotouch_ret_t touch_at_get_libinfo( touch_info_t *p_touch_info)Arguments Type Commentp_touch_info touch_info_t* User passes the memory address at which the library informationis to be updated.• The touch_info_t structure is filled by the library with information on the number ofautonomous QTouch channels (Fixed value of 1), number of autonomous QTouchsensors (Fixed value of 1), number of autonomous QTouch rotors/slider (Fixed value of0), CAT hardware version and library version.Common APIThis section lists the functions that are common to QMatrix, QTouch Group A/B and AutonomousQTouch acquisition methods.touch_event_dispatchervoid touch_event_dispatcher ( void )Arguments Type CommentVoid -• This API needs to be called by the user application to allow the library to process the rawacquisition data from the sensors.• Once touch_qm_sensors_start_acquisition is called, touch_event_dispatcher API needsto be called as frequently as possible by the Host application.• The signals_callback and measure_complete_callback functions are called from thetouch_event_dispatcher API context.touch_deinitvoid touch_deinit (void)Arguments Type Commentvoid -1668207K-AT42-09/11
• This API can be used to de-initalize the Touch Library and disable the CAT module.• Calling this API de-initializes the Touch Library for Sensors corresponding to all methodsof acquisition (QMatrix, QTouch Group A, QTouch Group B and Autonomous QTouch).Integrating QTouch libraries for AT32UC3L in your applicationThis section illustrates the key steps required in integrating the QTouch library in yourapplication.a. For your design, you would need the following information to select the correct libraryvariant• Device to be used for the design – Current library supports AT32UC3L064,AT32UC3L032, AT32UC3L016 device variants.• Compiler platform you intend to use to integrate the libraries.b. Copy the library variant that was selected in step one to your project’s working directoryor update your project to point to the library selected.c. Include touch_api_at32uc3l.h & touch_config_at32uc3l.h header files of the QTouchlibrary in your application. The header files can be found in the library installation folder.d. Initialize/create and use the Touch APIs in your application• Set the various configuration options using the touch_config_at32uc3l.h file.• Initialize and configure the sensors in the Host application.• The Host application also has to provide the required timing so as to performTouch measurement at regular intervals.e. General application notes• Ensure that there are no conflicts between the resources used by the Touchlibrary and the host application• Ensure that the stack size is adjusted to factor in the stack depth required for theoperation of the touch libraries.MISRA Compliance Report of QTouch Library for UC3LThis section lists the compliance and deviations for MISRA standards of coding practice for theUC3L QTouch libraries.What is coveredThe MISRA compliance covers the QTouch library for AT32UC3L devices. The Example projectsand associated code provided is not guaranteed to be MISRA compliant.Target EnvironmentDevelopment EnvironmentMISRA Checking softwareMISRA Rule set appliedIAR Embedded Workbench for Atmel AVR32The MISRA C Compliance has been performed for the libraryusing MISRA C 2004 Rules in IAR Workbench for Atmel AVR32MISRAC 2004 Rule Set, All including advisoryDeviations from MISRA C StandardsThe QTouch library was subjected to the above mentioned MISRA compliance rules. Thefollowing table lists the exceptions in the AT32UC3L QTouch library source code and alsoprovides explanation for these exceptions.Apart from these, there were many exceptions in the standard header files supplied by the toolchain and those are not captured here.167
- 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
- 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 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
• This API can be used to de-initalize the Touch <strong>Library</strong> and disable the CAT module.• Calling this API de-initializes the Touch <strong>Library</strong> for Sensors corresponding to all methodsof acquisition (QMatrix, <strong>QTouch</strong> Group A, <strong>QTouch</strong> Group B and Autonomous <strong>QTouch</strong>).Integrating <strong>QTouch</strong> libraries for AT32UC3L in your applicationThis section illustrates the key steps required in integrating the <strong>QTouch</strong> library in yourapplication.a. For your design, you would need the following information to select the correct libraryvariant• Device to be used for the design – Current library supports AT32UC3L064,AT32UC3L032, AT32UC3L016 device variants.• Compiler platform you intend to use to integrate the libraries.b. Copy the library variant that was selected in step one to your project’s working directoryor update your project to point to the library selected.c. Include touch_api_at32uc3l.h & touch_config_at32uc3l.h header files of the <strong>QTouch</strong>library in your application. The header files can be found in the library installation folder.d. Initialize/create and use the Touch APIs in your application• Set the various configuration options using the touch_config_at32uc3l.h file.• Initialize and configure the sensors in the Host application.• The Host application also has to provide the required timing so as to performTouch measurement at regular intervals.e. General application notes• Ensure that there are no conflicts between the resources used by the Touchlibrary and the host application• Ensure that the stack size is adjusted to factor in the stack depth required for theoperation of the touch libraries.MISRA Compliance Report of <strong>QTouch</strong> <strong>Library</strong> for UC3LThis section lists the compliance and deviations for MISRA standards of coding practice for theUC3L <strong>QTouch</strong> libraries.What is coveredThe MISRA compliance covers the <strong>QTouch</strong> library for AT32UC3L devices. The Example projectsand associated code provided is not guaranteed to be MISRA compliant.Target EnvironmentDevelopment EnvironmentMISRA Checking softwareMISRA Rule set appliedIAR Embedded Workbench for <strong>Atmel</strong> AVR32The MISRA C Compliance has been performed for the libraryusing MISRA C 2004 Rules in IAR Workbench for <strong>Atmel</strong> AVR32MISRAC 2004 Rule Set, All including advisoryDeviations from MISRA C StandardsThe <strong>QTouch</strong> library was subjected to the above mentioned MISRA compliance rules. Thefollowing table lists the exceptions in the AT32UC3L <strong>QTouch</strong> library source code and alsoprovides explanation for these exceptions.Apart from these, there were many exceptions in the standard header files supplied by the toolchain and those are not captured here.167