touchpad4 2.0.0.0
main.c File Reference

Touchpad4 Click example. More...

#include "board.h"
#include "log.h"
#include "touchpad4.h"

Macros

#define TOUCHPAD4_EXAMPLE_TOUCH   1
 
#define TOUCHPAD4_EXAMPLE_CHANNEL   2
 
#define TOUCHPAD4_EXAMPLE_GESTURE   3
 

Functions

void touchpad4_touch_reading (void)
 Touchpad 4 touch info example.
 
void touchpad4_channel_reading (void)
 Touchpad 4 channel example.
 
void touchpad4_gesture_reading (void)
 Touchpad 4 gesture info example.
 
void application_init (void)
 
void application_task (void)
 
int main (void)
 

Detailed Description

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

Macro Definition Documentation

◆ TOUCHPAD4_EXAMPLE_CHANNEL

#define TOUCHPAD4_EXAMPLE_CHANNEL   2

◆ TOUCHPAD4_EXAMPLE_GESTURE

#define TOUCHPAD4_EXAMPLE_GESTURE   3

◆ TOUCHPAD4_EXAMPLE_TOUCH

#define TOUCHPAD4_EXAMPLE_TOUCH   1

Function Documentation

◆ application_init()

void application_init ( void )

< Logger config object.

< 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 LOG_MAP_USB_UART macro definition for detailed explanation.

◆ application_task()

void application_task ( void )

◆ main()

int main ( void )

◆ touchpad4_channel_reading()

void touchpad4_channel_reading ( void )

Touchpad 4 channel example.

This function reads channel informations and logs them.

Returns
Nothing

◆ touchpad4_gesture_reading()

void touchpad4_gesture_reading ( void )

Touchpad 4 gesture info example.

This function reads gesture informations and logs them.

Returns
Nothing

◆ touchpad4_touch_reading()

void touchpad4_touch_reading ( void )

Touchpad 4 touch info example.

This function reads touch informations and logs them.

Returns
Nothing