11.07.2015 Views

Atmel QTouch Library User Guide

Atmel QTouch Library User Guide

Atmel QTouch Library User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

SNS1 and SNSK1 pins usethe same port._SNS1_SNSK1_SAME_PORT_The _SNS1_SNSK1_SAME_PORT_ symbolneeds to be defined as port A is used for bothSNS1 and SNSK1 pins.Given the above requirements for the applications, the first step is to select the right libraryvariant required.Step 1: Selecting the right library variantReferring to the library selection guide, we see that there are a few variants of libraries supportedfor ATmega1280. Since the application requires 12 channels and rotor slider support, one has toselect a library variant which supports at least 12 channels or more along with 3 Rotors/Sliders.Hence we select the 12 channel library variant for GCC complier which supports the requirednumber of sensors/channels. This works out to be libavr51g1_12qt_k_3rs.aStep 2: Defining the constants / symbols in the project spaceIn the host application file (say main.c), define the following constants and symbols#define QTOUCH_#define QT_NUM_CHANNELS 12#define SNSK1A#define SNS1A#define SNSK2B#define SNS2C#define QT_DELAY_CYCLES 1#define _POWER_OPTIMIZATION_ 1#define _SNS1_SNSK1_SAME_PORT_NOTE: The above definitions are available in touch_qt_config.h file. Alternatively, youcan define these in your IDE’s project options or have them defined in a separate headerfile. For IAR IDE, all these symbols have to defined for both compiler and assemblerpreprocessor defines separately.Step 3: Usage of library API’sNow, you can use the touch API’s to create, initialize and perform touch sensing. Please refer tothe sample applications in section 5.6.11.2 for reference. These sample applications illustrate theusage of the API’s and the sequence of operation.Step 4: Adding necessary source files for compilationThe source files needed for compiling your application along with the touch library aretouch_api.h, touch_qt_config.h and qt_asm_tiny_mega.S.Example for ATSAMThe example below will explain in detail the steps to follow for library selection.Criteria Selection NotesMicrocontrollerAT91SAM3SIDE and compiler tool chain used IAR Workbench and GNU compiler The GCC compiledvariant of the libraries forthe device selected needsto be used.Number of Keys required for the 3 Each key requires 1application<strong>QTouch</strong> acquisitionchannelRotors and sliders requiredYesNumber of Rotors and Sliders required 3 Each rotor / slider willrequire 3 channels.Number of Channels required for the 12 3 Keys + ( 3 rotors x 3548207K-AT42-09/11

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!