TouchPad 2 click
Touchpad 2 Click is a compact add-on board that easily integrates projected capacitive touch into their applications. This board features the IQS525, a projected capacitive touch and proximity trackpad/touchscreen controller from Azoteq. It features best in class sensitivity, signal-to-noise ratio, and automatic tuning of electrodes, in addition to the multi-touch and multi-hover feature. This Click boardâ„¢ is characterized by embedded gesture engine recognition for simple gestures (tap, swipes, hold), as well as built-in noise detection and filtering.
click Product page
Click library
- Author : Nenad Filipovic
- Date : Feb 2021.
- Type : I2C type
Software Support
We provide a library for the TouchPad2 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on mikroE github account.
Library Description
This library contains API for TouchPad2 Click driver.
Standard key functions :
touchpad2_cfg_setup
Config Object Initialization function.
void touchpad2_cfg_setup(touchpad2_cfg_t *cfg)
TouchPad 2 configuration object setup function.
TouchPad 2 Click configuration object.
Definition touchpad2.h:373
touchpad2_init
Initialization function.
err_t touchpad2_init(touchpad2_t *ctx, touchpad2_cfg_t *cfg)
TouchPad 2 initialization function.
TouchPad 2 Click context object.
Definition touchpad2.h:353
touchpad2_default_cfg
Click Default Configuration function.
err_t touchpad2_default_cfg(touchpad2_t *ctx)
TouchPad 2 default configuration function.
Example key functions :
touchpad2_check_version
TouchPad 2 check version function.
err_t touchpad2_check_version(touchpad2_t *ctx, touchpad2_ver_info_t *ver_info)
TouchPad 2 check version function.
touchpad2_ver_info_t ver_info
Definition main.c:31
TouchPad 2 device version information object.
Definition touchpad2.h:389
touchpad2_get_touch
TouchPad 2 get touch function.
err_t touchpad2_get_touch(touchpad2_t *ctx, touchpad2_touch_t *touch_data)
TouchPad 2 get touch function.
touchpad2_touch_t touch_data
Definition main.c:32
TouchPad 2 XY data object.
Definition touchpad2.h:403
Example Description
This library contains API for the TouchPad 2 Click driver. The library contains drivers to get touch details, the number of touches, X and Y coordinates and touch strength.
The demo application is composed of two sections :
Application Init
Initializes I2C driver, check communication and reads device version information.
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
if ( init_flag == I2C_MASTER_ERROR ) {
log_error( &logger, " Application Init Error. " );
log_info( &logger, " Please, run program again... " );
for ( ; ; );
}
log_info( &logger, " Application Task " );
Delay_ms ( 1000 );
Delay_ms ( 100 );
log_error( &logger, " Communication Error. " );
log_info( &logger, " Please, run program again... " );
for ( ; ; );
}
log_printf( &logger, "------------------------\r\n" );
log_printf( &logger, "------------------------\r\n" );
Delay_ms ( 1000 );
log_printf( &logger, " Waiting for a new touch\r\n" );
log_printf( &logger, "------------------------\r\n" );
Delay_ms ( 100 );
}
#define TOUCHPAD2_IQS525_PRODUCT_NUMBER
TouchPad 2 Product Number selection.
Definition touchpad2.h:321
#define TOUCHPAD2_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition touchpad2.h:340
void application_init(void)
Definition main.c:34
uint16_t product_num
Definition touchpad2.h:390
uint16_t hw_revision
Definition touchpad2.h:394
float version
Definition touchpad2.h:392
uint16_t projec_num
Definition touchpad2.h:391
uint16_t hw_id
Definition touchpad2.h:393
Application Task
This is an example that demonstrates the use of the TouchPad 2 Click board. Read XY data consisting of a status byte, the number of touches, X and Y coordinates and touch strength data. Results are being sent to the Usart Terminal where you can track their changes.
Delay_ms ( 100 );
log_printf( &logger, "- - - - - - - - - - - - -\r\n" );
log_printf( &logger, "- - - - - - - - - - - - -\r\n" );
log_printf( &logger, "------------------------ \r\n" );
Delay_ms ( 500 );
}
}
#define TOUCHPAD2_ID_TAG_TOUCH_4
Definition touchpad2.h:301
#define TOUCHPAD2_ID_TAG_TOUCH_3
Definition touchpad2.h:300
#define TOUCHPAD2_ID_TAG_TOUCH_5
Definition touchpad2.h:302
#define TOUCHPAD2_ID_TAG_TOUCH_2
Definition touchpad2.h:299
#define TOUCHPAD2_ID_TAG_TOUCH_1
TouchPad 2 ID tag selection.
Definition touchpad2.h:298
void touchpad2_wait_ready(touchpad2_t *ctx)
TouchPad 2 wait ready function.
void application_task(void)
Definition main.c:91
uint16_t y_pos
Definition touchpad2.h:408
uint16_t touch_str
Definition touchpad2.h:409
uint16_t x_pos
Definition touchpad2.h:407
uint8_t no_of_fingers
Definition touchpad2.h:405
uint8_t id_tag
Definition touchpad2.h:406
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on mikroE github account.
Other mikroE Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.TouchPad2
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. UART terminal is available in all Mikroelektronika compilers.