touchpad3 2.0.0.0
main.c File Reference

Touchpad3 Click example. More...

#include "board.h"
#include "log.h"
#include "touchpad3.h"

Functions

void display_status (void)
 
void application_init (void)
 
void application_task (void)
 
int main (void)
 

Variables

uint8_t touch_id_state
 
uint8_t status_data
 
uint16_t x_axis
 
uint16_t y_axis
 
uint32_t device_id
 
touch_data_t touch_data
 

Detailed Description

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

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.

Author
Jelena Milosavljevic

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 )

◆ display_status()

void display_status ( void )

◆ main()

int main ( void )

Variable Documentation

◆ device_id

uint32_t device_id

◆ status_data

uint8_t status_data

◆ touch_data

touch_data_t touch_data

◆ touch_id_state

uint8_t touch_id_state

◆ x_axis

uint16_t x_axis

◆ y_axis

uint16_t y_axis