This is the initial version of a driver for the STMPE 610 Resistive Touch Screen Controller.
It supports both SPI and I2C.
For SPI - I have not yet addressed the issue reported by @ladyada where on some occasions, the wrong clock edge gets used. I have only seen this very rarely and I'm still thinking about how to handle it. Usually, just retrying fixes it.
as suggested, this is patterned "loosely" after the FocalTouch driver.
For the "touches" method, I arbitrarily allow it to return up to 4 touches at at time. The controller buffer can hold 128, but it is easy to run out of memory. I the paint demo, it never needs to buffer more than 1 anyway. Not sure if the buffering is useful or not, put it in as an example.
I have tested it on a 2.4inch TFT featherwing (SPI) and on a feather_m0_express with an stmpe610 breakout and touchscreen (PID 333) with SPI and I2C.
The paint demo has been tested on a 2.4 inch TFT Featherwing via a feather52 but the code in the repo is set up for feather_m0_express pins.
This is the initial version of a driver for the STMPE 610 Resistive Touch Screen Controller.
It supports both SPI and I2C.
For SPI - I have not yet addressed the issue reported by @ladyada where on some occasions, the wrong clock edge gets used. I have only seen this very rarely and I'm still thinking about how to handle it. Usually, just retrying fixes it.
as suggested, this is patterned "loosely" after the FocalTouch driver.
For the "touches" method, I arbitrarily allow it to return up to 4 touches at at time. The controller buffer can hold 128, but it is easy to run out of memory. I the paint demo, it never needs to buffer more than 1 anyway. Not sure if the buffering is useful or not, put it in as an example.
I have tested it on a 2.4inch TFT featherwing (SPI) and on a feather_m0_express with an stmpe610 breakout and touchscreen (PID 333) with SPI and I2C.
The paint demo has been tested on a 2.4 inch TFT Featherwing via a feather52 but the code in the repo is set up for feather_m0_express pins.
Comments welcome.