提升您的触控体验,通过无缝集成的触控板和微控制器组合,实现流畅性与智能性的完美结合,为用户带来无与伦比的满意度。
A
A
硬件概览
它是如何工作的?
Touchpad 4 Click 基于IQS7211A,这是一款用于多点触控应用的微型触控板控制器,采用Azoteq的投影电容触控面板。IQS7211A是Azoteq最新的ProxFusion组合传感器的一部分,这是一种多传感器技术,提供单个集成电路上的电容感应、霍尔效应、感应和温度感应组合。它允许用户控制最多32个通道的触控板,并提供高分辨率和快速响应、低功耗和环境跟踪支持的长期激活。它还具有嵌入的手势引擎识别功能,可识别简单手势(点击、滑动、按住)以及内置的噪声检测和过滤功能。Touchpad 4 Click前面板的明确定义
区域表示触控板区域。该区域是PCB上的导电电极矩阵,彼此电气隔离,排列为X和Y的行和列。一个电极由多个菱形元素组成,每个元素通过导电颈连接到下一个元素。控制器在触控板区域使用投影电容电荷转移原理。当导电物体(如人类手指)接近感应板时,检测到的电容会减少。观察触控板区域各感应点的测量结果,使控制器能够在所有通道上确定接近/悬停检测和接触(触摸)检测,并准确确定触摸区域的坐标。Touchpad 4 Click通过标准I2C两线接口与MCU通信,快速模式下时钟频率可达1MHz。额外的就绪信号通过
mikroBUS™插座的INT引脚进行路由,指示通信窗口何时可用。因此,使用INT引脚作为通信触发器可以实现最佳响应率。除了这个引脚外,该Click板™还有一个复位功能,通过mikroBUS™插座上的RST引脚进行路由,低逻辑电平将模块置于复位状态,高逻辑电平则使模块正常工作。此Click板™只能在3.3V逻辑电压水平下操作。在使用具有不同逻辑电平的MCU之前,必须进行适当的逻辑电压电平转换。此外,该Click板™配备了包含易于使用的功能库和示例代码,可作为进一步开发的参考。
功能概述
开发板
Flip&Click PIC32MZ 是一款紧凑型开发板,设计为一套完整的解决方案,它将 Click 板™的灵活性带给您喜爱的微控制器,使其成为实现您想法的完美入门套件。它配备了一款板载 32 位 PIC32MZ 微控制器,Microchip 的 PIC32MZ2048EFH100,四个 mikroBUS™ 插槽用于 Click 板™连接,两个 USB 连接器,LED 指示灯,按钮,调试器/程序员连接器,以及两个与 Arduino-UNO 引脚兼容的头部。得益于创
新的制造技术,它允许您快速构建具有独特功能和特性的小工具。Flip&Click PIC32MZ 开发套件的每个部分都包含了使同一板块运行最高效的必要组件。此外,还可以选择 Flip&Click PIC32MZ 的编程方式,使用 chipKIT 引导程序(Arduino 风格的开发环境)或我们的 USB HID 引导程序,使用 mikroC、mikroBasic 和 mikroPascal for PIC32。该套件包括一个通过 USB 类型-C(USB-C)连接器的干净且调
节过的电源供应模块。所有 mikroBUS™ 本身支持的 通信方法都在这块板上,包括已经建立良好的 mikroBUS™ 插槽、用户可配置的按钮和 LED 指示灯。Flip&Click PIC32MZ 开发套件允许您在几分钟内创建新的应用程序。它由 Mikroe 软件工具原生支持,得益于大量不同的 Click 板™(超过一千块板),其数量每天都在增长,它涵盖了原型制作的许多方面。
微控制器概述
MCU卡片 / MCU

建筑
PIC32
MCU 内存 (KB)
2048
硅供应商
Microchip
引脚数
100
RAM (字节)
524288
使用的MCU引脚
mikroBUS™映射器
“仔细看看!”
Click board™ 原理图

一步一步来
项目组装
软件支持
库描述
该库包含 Touchpad 4 Click 驱动程序的 API。
关键功能:
touchpad4_reset- 重置功能touchpad4_get_touch- 读取触摸信息touchpad4_get_channels- 读取通道信息
开源
代码示例
完整的应用程序代码和一个现成的项目可以通过NECTO Studio包管理器直接安装到NECTO Studio。 应用程序代码也可以在MIKROE的GitHub账户中找到。
/*!
* @file main.c
* @brief Touchpad4 Click 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;
*
* ## 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;
*
* ### Additional Functions
* - void touchpad4_touch_reading ( void );
* - void touchpad4_channel_reading ( void );
* - void touchpad4_gesture_reading ( void );
*
* @author Luka Filipovic
*
*/
#include "board.h"
#include "log.h"
#include "touchpad4.h"
#define TOUCHPAD4_EXAMPLE_TOUCH 1
#define TOUCHPAD4_EXAMPLE_CHANNEL 2
#define TOUCHPAD4_EXAMPLE_GESTURE 3
static touchpad4_t touchpad4;
static log_t logger;
static uint8_t example_selector = 0;
/**
* @brief Touchpad 4 touch info example.
* @details This function reads touch informations and logs them.
* @return Nothing
*/
void touchpad4_touch_reading ( void );
/**
* @brief Touchpad 4 channel example.
* @details This function reads channel informations and logs them.
* @return Nothing
*/
void touchpad4_channel_reading ( void );
/**
* @brief Touchpad 4 gesture info example.
* @details This function reads gesture informations and logs them.
* @return Nothing
*/
void touchpad4_gesture_reading ( void );
void application_init ( void )
{
log_cfg_t log_cfg; /**< Logger config object. */
touchpad4_cfg_t touchpad4_cfg; /**< Click config object. */
/**
* Logger initialization.
* Default baud rate: 115200
* Default log level: LOG_LEVEL_DEBUG
* @note If USB_UART_RX and USB_UART_TX
* are defined as HAL_PIN_NC, you will
* need to define them manually for log to work.
* See @b LOG_MAP_USB_UART macro definition for detailed explanation.
*/
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
touchpad4_cfg_setup( &touchpad4_cfg );
TOUCHPAD4_MAP_MIKROBUS( touchpad4_cfg, MIKROBUS_1 );
err_t init_flag = touchpad4_init( &touchpad4, &touchpad4_cfg );
if ( I2C_MASTER_ERROR == init_flag )
{
log_error( &logger, " Application Init Error. " );
log_info( &logger, " Please, run program again... " );
for ( ; ; );
}
touchpad4_reset( &touchpad4 );
init_flag = touchpad4_default_cfg ( &touchpad4 );
if ( TOUCHPAD4_ERROR == init_flag )
{
log_error( &logger, " Configuration. " );
log_info( &logger, " Please, run program again... " );
for ( ; ; );
}
example_selector = TOUCHPAD4_EXAMPLE_TOUCH;
log_info( &logger, " Application Task " );
}
void application_task ( void )
{
if ( !touchpad4_get_ready( &touchpad4 ) )
{
switch ( example_selector )
{
case TOUCHPAD4_EXAMPLE_TOUCH:
{
touchpad4_touch_reading( );
break;
}
case TOUCHPAD4_EXAMPLE_CHANNEL:
{
touchpad4_channel_reading( );
break;
}
case TOUCHPAD4_EXAMPLE_GESTURE:
{
touchpad4_gesture_reading( );
break;
}
default:
{
log_error( &logger, " Select Example" );
break;
}
}
}
}
int main ( void )
{
/* Do not remove this line or clock might not be set correctly. */
#ifdef PREINIT_SUPPORTED
preinit();
#endif
application_init( );
for ( ; ; )
{
application_task( );
}
return 0;
}
void touchpad4_touch_reading ( void )
{
touchpad4_info_t ti;
touchpad4_get_touch ( &touchpad4, &ti );
if ( ( ti.number_of_touches > 0 ) && ( ti.number_of_touches <= 2 ) )
{
log_printf( &logger, "> X->%d\r\n> Y->%d\r\n> Strength->%u\r\n> Area->%u\r\n",
ti.touches[ 0 ].x, ti.touches[ 0 ].y, ti.touches[ 0 ].strength, ti.touches[ 0 ].area );
log_printf( &logger, "**************\r\n" );
}
}
void touchpad4_channel_reading ( void )
{
uint32_t ch_status = 0;
touchpad_get_channels( &touchpad4, &ch_status );
uint8_t shift = 19;
uint8_t row[ 10 ] = { 0 };
for ( uint8_t r = 0; r < 5; r++ )
{
uint8_t row_char_cnt = 6;
for ( uint8_t y = 0; y < 4; y++ )
{
if ( y )
{
row[ row_char_cnt-- ] = '|';
}
if ( ( ch_status >> shift ) & 1 )
{
row[ row_char_cnt-- ] = 'x';
}
else
{
row[ row_char_cnt-- ] = 'o';
}
shift--;
}
log_printf( &logger, "%s\r\n", row );
}
log_printf( &logger, "\r\n" );
}
void touchpad4_gesture_reading ( void )
{
uint16_t gesture_data = 0;
touchpad4_generic_read( &touchpad4, TOUCHPAD4_REG_GESTURES, &gesture_data );
gesture_data &= 0x003F;
if ( gesture_data & 0x0001 )
{
log_printf( &logger, " > Single Tap <\r\n" );
}
if ( gesture_data & 0x0002 )
{
log_printf( &logger, " > Press And Hold <\r\n" );
}
if ( gesture_data & 0x0004 )
{
log_printf( &logger, " > Swipe X - <\r\n" );
}
if ( gesture_data & 0x0008 )
{
log_printf( &logger, " > Swipe X + <\r\n" );
}
if ( gesture_data & 0x0010 )
{
log_printf( &logger, " > Swipe Y + <\r\n" );
}
if ( gesture_data & 0x0020 )
{
log_printf( &logger, " > Swipe Y - <\r\n" );
}
if ( gesture_data )
{
log_printf( &logger, "**************\r\n" );
}
}
// ------------------------------------------------------------------------ END
额外支持
资源
类别:电容
































