Example of usage of the maXTouch component with USART.
This example shows how to receive touch data from a maXTouch device using the maXTouch component, and display them in a terminal window by using the USART driver.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
#include <asf.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "conf_board.h"
#include "conf_example.h"
#include "conf_usart_serial.h"
Macros | |
#define | MAX_ENTRIES 3 |
#define | STRING_LENGTH 40 |
#define | USART_TX_MAX_LENGTH 0xff |
Functions | |
int | main (void) |
void | mxt_handler (struct mxt_device *device) |
static void | mxt_init (struct mxt_device *device) |
Set maXTouch configuration. More... | |
#define MAX_ENTRIES 3 |
Referenced by mxt_handler().
#define STRING_LENGTH 40 |
Referenced by mxt_handler().
#define USART_TX_MAX_LENGTH 0xff |
int main | ( | void | ) |
void mxt_handler | ( | struct mxt_device * | device | ) |
References mxt_touch_event::id, MAX_ENTRIES, mxt_is_message_pending(), mxt_read_touch_event(), mxt_touch_event::status, STATUS_OK, STRING_LENGTH, usart_serial_write_packet(), mxt_touch_event::x, and mxt_touch_event::y.
Referenced by main().
|
static |
Set maXTouch configuration.
This function writes a set of predefined, optimal maXTouch configuration data to the mXT143E Xplained.
device | Pointer to mxt_device struct |
References Assert, delay_ms, MXT_GEN_ACQUISITIONCONFIG_T8, MXT_GEN_COMMANDPROCESSOR_CALIBRATE, MXT_GEN_COMMANDPROCESSOR_RESET, MXT_GEN_COMMANDPROCESSOR_T6, MXT_GEN_POWERCONFIG_T7, mxt_get_object_address(), mxt_init_device(), MXT_PROCG_TOUCHSUPPRESSION_T48, MXT_RESET_TIME, MXT_TOUCH_MULTITOUCHSCREEN_T9, mxt_write_config_object(), mxt_write_config_reg(), status, and STATUS_OK.
Referenced by main().