Allocating unused Port Pins for User Application

The GPIO pins within a port that are not used for QTouch or QMatrix acquisition methods can be used for user application. The usage of pins for QTouch is based on the channels that are being configured while enabling the sensors (keys/rotors/sliders).

The example below configuring 4 keys, a rotor and a slider shows how the pin configurability is achieved by configuring the sensor channels. The code snippet configures a specific 10 channels of a 16 channel library based on the GPIO port pins available for QTouchâ„¢.

/* Port Configuration: */
#define SNSK1 C
#define SNS1 D
#define SNSK2 A
#define SNS2 B

/* Channel/Pin Configuration: */
/* enable a key on channel 0 */
qt_enable_key( CHANNEL_0, AKS_GROUP_2, 10u, HYST_6_25 );

/* enable a slider on channels 2 to 4 */
qt_enable_slider( CHANNEL_2, CHANNEL_4, AKS_GROUP_1, 16u, HYST_6_25, RES_8_BIT, 0u );

/* enable a key on channel 6 */
qt_enable_key( CHANNEL_6, AKS_GROUP_2, 10u, HYST_6_25 );

/* enable a key on channel 7 */
qt_enable_key( CHANNEL_7, AKS_GROUP_2, 10u, HYST_6_25 )

/* enable a rotor on channels 12 to 14 */
qt_enable_rotor( CHANNEL_12, CHANNEL_14, AKS_GROUP_1, 16u, HYST_6_25, RES_8_BIT, 0u );

/* enable a key on channel 15 */
qt_enable_key( CHANNEL_15, AKS_GROUP_2, 10u, HYST_6_25 );

The channel numbers 0,2,3,4,6,7 are allocated to pins 0,2,3,4,6,7 of (D,C) port pair respectively. Pins 1 and 5 of ports C and D can be used for user application. Similarly the channel numbers 12,13,14,15 are allocated to pins 4,5,6,7 of (B,A) port pair respectively. Pins 1, 2, 3 and 4 of ports B and A are again unused by the QTouch library and can be used for user application.