Touch screen interface functions for the mxt143e Xplained module.
Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries.
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().
void touch_interface_init | ( | void | ) |
Initializes the touchscreen, ready to detect user input.
Performs and initialization and calibration of the touchscreen, so that it is ready for use.
References Assert, delay_ms, MAXTOUCH_TWI_ADDRESS, MXT143E_XPLAINED_CHG, mxt_dev_inst, 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_TWI_SPEED, mxt_write_config_object(), mxt_write_config_reg(), twi_options_t::speed, status, STATUS_OK, TWI_INTERFACE, and twi_master_setup().
Referenced by main().
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.
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().
|
static |
Software maXTouch device instance.
Referenced by touch_interface_init(), and touch_interface_read().