TOP Contributors

  1. MIKROE (2762 codes)
  2. Alcides Ramos (374 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (139245 times)
  2. FAT32 Library (71743 times)
  3. Network Ethernet Library (57115 times)
  4. USB Device Library (47428 times)
  5. Network WiFi Library (43082 times)
  6. FT800 Library (42403 times)
  7. GSM click (29835 times)
  8. mikroSDK (28073 times)
  9. PID Library (26885 times)
  10. microSD click (26198 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

Touchpad 3 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.15

mikroSDK Library: 2.0.0.0

Category: Capacitive

Downloaded: 169 times

Not followed.

License: MIT license  

Touchpad 3 Click is a compact add-on board that allows users to easily integrate projected capacitive touch into their applications. This board features the MTCH6301, a turnkey capacitive touch controller that makes it easy for users to use popular multitouch and gesture interfaces from Microchip. This controller’s sophisticated combination of Self and Mutual capacitive scanning for XY touchscreens and touchpads enables several features, including single and dual-touch drawing, the reporting of 11 single-finger gestures, and the detection of up to 10 touches. This Click board™ is suitable for human-machine interfaces, keypad or scrolling functions, single-finger gesture-based interfaces, and more.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Touchpad 3 Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Touchpad 3 Click" changes.

Do you want to report abuse regarding "Touchpad 3 Click".

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


Touchpad 3 Click

Touchpad 3 Click is a compact add-on board that allows users to easily integrate projected capacitive touch into their applications. This board features the MTCH6301, a turnkey capacitive touch controller that makes it easy for users to use popular multitouch and gesture interfaces from Microchip. This controller’s sophisticated combination of Self and Mutual capacitive scanning for XY touchscreens and touchpads enables several features, including single and dual-touch drawing, the reporting of 11 single-finger gestures, and the detection of up to 10 touches. This Click board™ is suitable for human-machine interfaces, keypad or scrolling functions, single-finger gesture-based interfaces, and more.

touchpad3_click.png

Click Product page


Click library

  • Author : Jelena Milosavljevic
  • Date : Jul 2021.
  • Type : I2C type

Software Support

We provide a library for the Touchpad3 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 Touchpad3 Click driver.

Standard key functions :

  • touchpad3_cfg_setup Config Object Initialization function.

    void touchpad3_cfg_setup ( touchpad3_cfg_t *cfg );
  • touchpad3_init Initialization function.

    err_t touchpad3_init ( touchpad3_t *ctx, touchpad3_cfg_t *cfg );
  • touchpad3_default_cfg Click Default Configuration function.

    void touchpad3_default_cfg ( touchpad3_t *ctx );

Example key functions :

  • touchpad3_general_configuration The function performs the general configuration of the MTCH6301 Projected Capacitive Touch Controller on the TouchPad 3 Click board.

    void touchpad3_general_configuration ( touchpad3_t *ctx );
  • touchpad3_decoding_configuration The function performs the decoding configuration of the MTCH6301 Projected Capacitive Touch Controller on the TouchPad 3 Click board.

    void touchpad3_decoding_configuration ( touchpad3_t *ctx );
  • touchpad3_sensor_mapping_configuration The function configures the sensor mapping of the MTCH6301 Projected Capacitive Touch Controller on the TouchPad 3 Click board.

    void touchpad3_sensor_mapping_configuration ( touchpad3_t *ctx );

Example Description

This example prints the coordinate points of the position we touch on a Click. We use RST and INT pins. The whole project is done through i2c communication.

The demo application is composed of two sections :

Application Init

Initialization driver enables - Initializes I2C, set RST pin as an output, set INT pin as input and start to write log. I2C, perform a hardware reset, configuration (general, decoding, sensor mapping), get device ID and enable the touch, also write log.


void application_init ( void ) {
    log_cfg_t log_cfg;                 /**< Logger config object. */
    touchpad3_cfg_t touchpad3_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.
    touchpad3_cfg_setup( &touchpad3_cfg );
    TOUCHPAD3_MAP_MIKROBUS( touchpad3_cfg, MIKROBUS_1 );
    err_t init_flag = touchpad3_init( &touchpad3, &touchpad3_cfg );
    if ( I2C_MASTER_ERROR == init_flag ) { 
        log_error( &logger, " Application Init Error. " );
        log_info( &logger, " Please, run program again... " );

        for ( ; ; );
    }

    touchpad3_default_cfg ( &touchpad3 );

    touch_id_state = 0;
    log_printf( &logger, "------------------------------\r\n" );
    device_id = touchpad3_get_device_id( &touchpad3 );
    Delay_ms ( 100 );
    log_printf( &logger, "     Get Device ID : %d \r\n      ", device_id );
    log_printf( &logger, "------------------------------\r\n" );
    Delay_ms ( 100 );
    log_info( &logger, " Application Task " );
    Delay_ms ( 100 );

    status_data = touchpad3_config_touch( &touchpad3, TOUCHPAD3_TOUCH_GESTURE_ENABLE );

    log_printf( &logger, "     Touch Enable Status:     \r\n");
    display_status( );
    log_printf( &logger, "------------------------------\r\n" );
    Delay_ms ( 100 );
}

Application Task

This is an example that demonstrates the use of the TouchPad 3 Click board. TouchPad 3 Click board uses USB UART log to display X and Y coordinates of the touch, depending on the selected Touch ID.


void application_task ( void ) {
    if ( touchpad3_get_int( &touchpad3 ) == TOUCHPAD3_INT_STATUS_HIGH ) {

       touchpad3_get_touch( &touchpad3, &touch_data, &x_axis, &y_axis );
       Delay_ms ( 100 );

        if ( ( touch_data.tch_state == TOUCHPAD3_STATE_TCH ) && ( touch_data.touch_id == touch_id_state ) ) {   
            log_printf( &logger, "  X Coordinate : %d   \r\n" , x_axis );
            log_printf( &logger, "  Y Coordinate : %d   \r\n" , y_axis );
            log_printf( &logger, "------------------------------\r\n" );
            Delay_ms ( 100 );
        }
    }
}

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.Touchpad3

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.


ALSO FROM THIS AUTHOR

TouchKey 2 click

1

TouchKey 2 click has four capacitive pads powered by ATtiny817 which has an integrated touch QTouch® controller. The click is designed to run on a 3.3V power supply. The four LEDs onboard the click indicate the Key (Pad) is pressed. TouchKey 2 click communicates with the target microcontroller over UART and SPI interface.

[Learn More]

Pressure 14 Click

0

Pressure 14 Click is a compact add-on board that contains a board-mount pressure sensor. This board features the ABP2LANT060PG2A3XX, a piezoresistive silicon pressure sensor offering a digital output for reading pressure over the specified full-scale pressure span and a temperature range from Honeywell Sensing and Productivity Solutions. This I2C configurable sensor is calibrated and temperature compensated for sensor offset, sensitivity, temperature effects, and accuracy errors, including non-linearity, repeatability, and hysteresis, using an on-board ASIC. This Click board™ is suitable for pressure measurements in automotive applications, industrial and consumer applications.

[Learn More]

Mikromedia 4 for STM32F4 Capacitive

0

This project contains example for testing modules on Mikromedia 4 for STM32F4 Capacitive.

[Learn More]