-
Notifications
You must be signed in to change notification settings - Fork 9
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
Conversation
There was a problem hiding this 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.
adafruit_stmpe610.py
Outdated
raise NotImplementedError | ||
|
||
|
||
# pylint: disable=unused-variable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is unused?
adafruit_stmpe610.py
Outdated
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) |
There was a problem hiding this comment.
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!") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:-)
adafruit_stmpe610.py
Outdated
|
||
|
||
__version__ = "0.0.0-auto.0" | ||
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_stmpe610.git" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mis-capitalization in CIrcuitPython
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
argh. Thanks.
Thank you @jerryneedell ! |
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.