Touchpad 4 click
Touchpad 4 Click is a compact add-on board that easily integrates projected capacitive touch into user's applications. This board features the IQS7211A, a tiny capacitive touch controller from Azoteq.
click Product page
Click library
- Author : Luka Filipovic
- Date : Jun 2021.
- Type : I2C type
Software Support
We provide a library for the Touchpad4 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 Touchpad4 Click driver.
Standard key functions :
touchpad4_cfg_setup
Config Object Initialization function.
void touchpad4_cfg_setup(touchpad4_cfg_t *cfg)
Touchpad 4 configuration object setup function.
Touchpad 4 Click configuration object.
Definition touchpad4.h:498
touchpad4_init
Initialization function.
err_t touchpad4_init(touchpad4_t *ctx, touchpad4_cfg_t *cfg)
Touchpad 4 initialization function.
Touchpad 4 Click context object.
Definition touchpad4.h:477
touchpad4_default_cfg
Click Default Configuration function.
err_t touchpad4_default_cfg(touchpad4_t *ctx)
Touchpad 4 default configuration function.
Example key functions :
touchpad4_reset
Reset function.
void touchpad4_reset(touchpad4_t *ctx)
Reset function.
touchpad4_get_touch
Read touch informations.
err_t touchpad4_get_touch(touchpad4_t *ctx, touchpad4_info_t *touch_info)
Read touch informations.
Touchpad 4 Click touchpad information object.
Definition touchpad4.h:528
touchpad_get_channels
Read channel information.
err_t touchpad_get_channels(touchpad4_t *ctx, uint32_t *channels)
Read channel information.
Example Description
This example showcases ability of the device to read touch coordinates,
active/inactive channels, and gesture informations.
The demo application is composed of two sections :
Application Init
Initialize host communication modules(UART and I2C) and additional pins,
for device control. Then resets device and set default configuration where Channels and pins are mapped and configured, and set communication with device only on touch/event. In the end one of 3 examples is set;
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
if ( I2C_MASTER_ERROR == init_flag )
{
log_error( &logger, " Application Init Error. " );
log_info( &logger, " Please, run program again... " );
for ( ; ; );
}
{
log_error( &logger, " Configuration. " );
log_info( &logger, " Please, run program again... " );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
#define TOUCHPAD4_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition touchpad4.h:463
void application_init(void)
Definition main.c:67
#define TOUCHPAD4_EXAMPLE_TOUCH
Definition main.c:37
@ TOUCHPAD4_ERROR
Definition touchpad4.h:541
Application Task
There are 3 examples that shocaes ability of the device:
- Reading touch coorinates and addinal informations of touch strength, and touch area and logging them,
- Reading channel statuses and show them by logging them,
- Reading gesture events and logging them;
{
{
switch ( example_selector )
{
{
break;
}
{
break;
}
{
break;
}
default:
{
log_error( &logger, " Select Example" );
break;
}
}
}
}
uint8_t touchpad4_get_ready(touchpad4_t *ctx)
Get ready pin state.
void application_task(void)
Definition main.c:113
void touchpad4_gesture_reading(void)
Touchpad 4 gesture info example.
Definition main.c:210
#define TOUCHPAD4_EXAMPLE_CHANNEL
Definition main.c:38
void touchpad4_touch_reading(void)
Touchpad 4 touch info example.
Definition main.c:161
#define TOUCHPAD4_EXAMPLE_GESTURE
Definition main.c:39
void touchpad4_channel_reading(void)
Touchpad 4 channel example.
Definition main.c:176
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.Touchpad4
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.