Re: Generic Touch Driver as a starting point for a XPT2046 driver?
☄ Helpfulby jiggoly 2018/03/08 13:01:03
Attached is an example of how to hack an existing Harmony driver. It modifies a MTCH6303 touch driver in Harmony to support a Focal Tech FT5x06 driver. While the Focal Tech uses an I2C command interface, instead of a SPI, it at least provides an example of where within Harmony to provide the touch (x,y) information so that the graphics stack can react correctly to a touch event.
The FT5x06, like most capacitive touch drivers, drives an interrupt pin low to alert the host that is a touch event. The host responds by using the I2C command interface to read memory on the controller to retrieve the coordinates of the touch event. Thus there is an interrupt service routine (ISR) in the code example that launches the query. I'm not sure how your touch driver reports events.
Michael W. Mann
Principal Applications Engineer
MCU32 Applications, Microchip