Skip to content

Initial version #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Apr 27, 2018
Merged

Initial version #1

merged 17 commits into from
Apr 27, 2018

Conversation

jerryneedell
Copy link
Contributor

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.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jerryneedell ! I added a few comments.

raise NotImplementedError


# pylint: disable=unused-variable
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is unused?

STMPE_TSC_CFG_SETTLE_5MS = const(0x04)
STMPE_TSC_CFG_SETTLE_10MS = const(0x05)
STMPE_TSC_CFG_SETTLE_50MS = const(0x06)
STMPE_TSC_CFG_SETTLE_100MS = const(0x07)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do all of these need to be public? If you prefix them with _ they'll be omitted from the mpy and save memory when loaded.

spi=busio.SPI(board.SCK,board.MOSI,board.MISO)
cs = digitalio.DigitalInOut(board.D6)
st=Adafruit_STMPE610_SPI(spi,cs)
print("Go Ahead - Touch the Screen - Make My Day!")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:-)



__version__ = "0.0.0-auto.0"
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_stmpe610.git"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe STMPE should be capitalized to match the github repo name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - will change

README.rst Outdated
Usage Example
=============

see examples in githup repository: https://github.com/adafruit/Adafruit_CIrcuitPython_STMPE610/exmaples
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mis-capitalization in CIrcuitPython

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

argh. Thanks.

@tannewt
Copy link
Member

tannewt commented Apr 27, 2018

Thank you @jerryneedell !

@tannewt tannewt merged commit 8f06d6e into adafruit:master Apr 27, 2018
@jerryneedell jerryneedell deleted the jerryn_stmpe610 branch July 13, 2018 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants