Microchip® Advanced Software Framework

touch_interface.c File Reference

Touch screen interface functions for the mxt143e Xplained module.

Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries.

#include <asf.h>
#include "touch_interface.h"

Macros

#define MAXTOUCH_TWI_ADDRESS   0x4a
 Address of the mXT143E on TWI bus. More...
 

Functions

void touch_interface_init (void)
 Initializes the touchscreen, ready to detect user input. More...
 
bool touch_interface_read (struct win_pointer_event *win_touch_event)
 Convert touch events from the touchscreen into window pointer events. More...
 

Variables

static struct mxt_device mxt_dev_inst
 Software maXTouch device instance. More...
 

#define MAXTOUCH_TWI_ADDRESS   0x4a

Address of the mXT143E on TWI bus.

Referenced by touch_interface_init().

bool touch_interface_read ( struct win_pointer_event win_touch_event)

Convert touch events from the touchscreen into window pointer events.

Reads touch events in from the touchscreen and converts them into a Window Manager pointer event, for enqueuing into the window event queue.

Returns
Boolean true if a touch event was read, false if no touch event or a corrupt touch event was received

References win_pointer_event::buttons, gfx_get_height(), gfx_get_width(), win_pointer_event::is_relative, mxt_dev_inst, mxt_is_message_pending(), MXT_MOVE_EVENT, MXT_PRESS_EVENT, mxt_read_touch_event(), MXT_RELEASE_EVENT, win_pointer_event::pos, mxt_touch_event::status, STATUS_OK, win_pointer_event::type, WIN_POINTER_MOVE, WIN_POINTER_PRESS, WIN_POINTER_RELEASE, WIN_TOUCH_BUTTON, mxt_touch_event::x, win_point::x, mxt_touch_event::y, and win_point::y.

Referenced by main().

struct mxt_device mxt_dev_inst
static

Software maXTouch device instance.

Referenced by touch_interface_init(), and touch_interface_read().