/* filter for channel signals */
static uint16_t filter[QT_NUM_CHANNELS][4];
2. Add a filter function prototype to the main module:
/* example signal filtering function */
static void filter_data_mean_4( void );
3. When configuring the ATMEL QTouch library, set the callback function pointer:
/* set callback function */
qt_filter_callback = filter_data_mean_4;
4. Add the filter function:
void filter_data_mean_4( void )
{
uint8_t i;
/*
* Shift previously stored channel signal data.
* Store new channel signal data.
* Set library channel signal data = mean of last 4 values.
*/
for( i = 0u; i < QT_NUM_CHANNELS; i++ )
{
filter[i][0] = filter[i][1];
filter[i][1] = filter[i][2];
filter[i][2] = filter[i][3];
filter[i][3] = qt_measure_data.channel_signals[i];
qt_measure_data.channel_signals[i] = ( (
filter[i][0] +
filter[i][1] +
filter[i][2] +
filter[i][3] ) / 4u );
}
}
The signal values processed by the ATMEL QTouch Library are now the mean of the last four
actual signal values.
5.6.6.4
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
#define SNS1
#define SNSK2
#define SNS2
C
D
A
B
Channel/Pin Configuration:
/* enable a key on channel 0 */
qt_enable_key( CHANNEL_0, AKS_GROUP_2, 10u, HYST_6_25 );
43
相关PDF资料
ATU6-P305T-R CABLE CAT6 FULL-BOX 305M GRAY
ATUP-P305T-R CABLE CAT5E PULL-BOX 305M GRAY
ATUP-V305T-R CABLE CAT5E REEL 305M GRAY
AWG28-05/F-1/300-R CABLE 5 COND MULTI 300' RIBBON
AWG28-05/G-1/300-R CABLE 5 COND GRAY 300' RIBBON
AWG28-09/F-1/300-R CABLE 9 COND MULTI 300' RIBBON
AWG28-09/G-1/300-R CABLE 9 COND GRAY 300' RIBBON
AWG28-25/F-1/300-R CABLE 25 COND MULTI 300' RIBBON
相关代理商/技术参数
ATQT600IB 功能描述:界面开发工具 ATQT600IB Interface Brd RoHS:否 制造商:Bourns 产品:Evaluation Boards 类型:RS-485 工具用于评估:ADM3485E 接口类型:RS-485 工作电源电压:3.3 V
ATQT6-XPRO 功能描述:Xplained Pro - Extension Board 制造商:atmel 系列:- 零件状态:有效 配件类型:扩展板 配套使用产品/相关产品:Xplained Pro 标准包装:1
ATR 1078 功能描述:TOOL INSERTION TWEEZER 20 GA 制造商:astro tool corp 系列:* 零件状态:有效 标准包装:1
ATR 1079 功能描述:TWEEZER INSERTION 20 GA 制造商:astro tool corp 系列:* 零件状态:有效 标准包装:1
ATR 1080 制造商:Astro Tool Corp 功能描述:TOOL INSERTION 20 GA
ATR 1080-135 功能描述:INSERTION TOOL 20 GA ANGLED TIP 制造商:astro tool corp 系列:* 零件状态:有效 标准包装:1
ATR 1080-S 功能描述:INSERTION TOOL STRAIGHT 制造商:astro tool corp 系列:* 零件状态:有效 标准包装:1
ATR 1105 功能描述:TOOL INSERTION TWEEZER 16 GA 制造商:astro tool corp 系列:* 零件状态:有效 标准包装:1