Atmel QTouch Library User Guide
Atmel QTouch Library User Guide
Atmel QTouch Library User Guide
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Once you have selected the right library variant and configuration parameters for the application,follow the steps outlined below to integrate the library variant in your application.4) Fill in the arrays x_line_info_t x_line_info[NUM_X_LINES] y_line_info_tya_line_info[NUM_Y_LINES] and y_line_info_t yb_line_info[NUM_Y_LINES] using thepin configuration wizard provided by the <strong>QTouch</strong> Studio.5) 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.Include the “touch_api.h” header file and assembler source file from the <strong>QTouch</strong> library inyour application. The touch_api.h can be found in the release package at C:\ProgramFiles\<strong>Atmel</strong>\<strong>Atmel</strong>_<strong>QTouch</strong>_Libraries_4.x\ Generic_<strong>QTouch</strong>_Libraries\AVR_Tiny_Mega_XMega\QMatrix\common_files. The assembler files mentioned belowcould be found at the location C:\Program Files\<strong>Atmel</strong>\<strong>Atmel</strong>_<strong>QTouch</strong>_Libraries_4.x\Generic_<strong>QTouch</strong>_Libraries \AVR_Tiny_Mega_XMega\QMatrix\common_ filesa. qm_asm_tiny_mega.S in case of ATtiny and ATmega devices.b. qm_asm_xmega.S in case of ATxmega devices.c. qm_asm_m8535_m16.S in case of ATmega8535 and ATmega16 devices.In case of using YA/YB lines on the same port the following assembler files has to beusedd. qm_asm_tiny_mega_sharedyayb.S in case of ATtiny and ATmega devices while sharingthe same port for YA and YB linese. qm_asm_m8535_m16_sharedyayb.S in case of Atmega8535 and ATmega16 deviceswhile sharing the same port for YA and YB linesf. qm_asm_xmega_sharedyayb.S in case of ATxmega devices while sharing the same portfor YA and YB lines6) Initialize/create and use the touch api’s in your applicationa. In your application, create, initialize and configure the sensors.a. The APIs of interest are qt_enable_key/rotor/slider().see sections 5.6.5.2,5.6.5.3 and 5.6.5.4b. configure the global configuration parameters valid for all the sensors in thelibraryc. Provide timing for the <strong>QTouch</strong> libraries to operate. i,e. the <strong>QTouch</strong> libraries donot use any timer resources of the microcontroller. The Host application has toprovide the required timing and also call the API’s at the appropriate intervals toperform touch sense detect operations7) General application notesa. The clock, host application and other peripherals needed by the host applicationneeds to be initialized.b. The QMatrix acquisition method libraries internally use TIMER1 for theiroperation.c. Ensure that there are no conflicts between the resources used by the touchlibrary and the host applicationd. Ensure that the stack size is adjusted to factor in the stack depth required for theoperation of the touch libraries.ExampleThe example below will explain in detail the steps to follow for library selection.Criteria Selection NotesMicrocontroller ATTiny88 List of supported devices can befound<strong>Library</strong>_Selection_<strong>Guide</strong>.xlsat59