-
Notifications
You must be signed in to change notification settings - Fork 58
Add support for ST7789 #141
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
Co-authored-by: Richard Hull <rm_hull@yahoo.co.uk>
thijstriemstra
left a comment
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!
luma/lcd/device.py
Outdated
| super(st7789, self).__init__(luma.lcd.const.st7789, serial_interface, **kwargs) | ||
| self.capabilities(240, 240, rotate, mode="RGB") | ||
|
|
||
| self.command(0x36) |
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 think it may be possible to combine:
self.command(0x36)
self.data([0x70])into:
self.command(0x36, 0x70)have a look at the implementation for command for more details
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.
Also it would be quite nice to document each command, eg like: https://github.com/rm-hull/luma.lcd/blob/master/luma/lcd/device.py#L460-L482
Also here you can see the combined command/data
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.
Yeah, I like this combined syntax more, I wonder why author of the original PR went that way.
rm-hull
left a comment
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.
Great effort @matemaciek! it would good to get this in "as-is" (with the PR comments resolved), and then look at another PR with an improved implementation that makes use of the framebuffering for better performance (see https://github.com/rm-hull/luma.lcd/blob/master/luma/lcd/device.py#L501-L508 for example)
|
Glad you like it (-: Let me implement review remarks. |
|
OK, significant speedup is on the way |
|
|
And before? |
|
<1fps |
|
Love this!
|
|
I think there has been no release yet, it should land in 2.9.0 |
|
Hm, can't find a release schedule... |
|
release schedule is in CHANGES.md. It'll be released within a few days I expect. |
|
no problem , I installed it locally. Excited to test it out. Been having this waveshare shield for some time and no easy way to use it. |
|
I developed on waveshare shield to, let me share some commands... |
|
Running examples from Python: |
|
@matemaciek can you add that config to luma.examples/config/ ? |
|
Sure! Also just testing on pi 4, ~21.5fps \o/ |
|
odd.. is there a discord where we can chat? I don't want to pollute this closed issue.. |
|
I install with |
|
@thijstriemstra im trying to upload to pypi, but fails .. any ideas: $ python3 setup.py clean sdist bdist_wheel upload -r pypi
running clean
running sdist
running egg_info
writing luma.lcd.egg-info/PKG-INFO
writing dependency_links to luma.lcd.egg-info/dependency_links.txt
writing namespace_packages to luma.lcd.egg-info/namespace_packages.txt
writing requirements to luma.lcd.egg-info/requires.txt
writing top-level names to luma.lcd.egg-info/top_level.txt
reading manifest file 'luma.lcd.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'doc/_build'
warning: no previously-included files matching '__pycache__' found under directory '*'
warning: no previously-included files matching '*.py[co]' found under directory '*'
warning: no previously-included files matching '*~' found under directory '*'
warning: no previously-included files matching '.coverage' found under directory '*'
warning: no previously-included files matching '.DS_Store' found under directory '*'
warning: no previously-included files matching '.ropeproject' found under directory '*'
writing manifest file 'luma.lcd.egg-info/SOURCES.txt'
running check
creating luma.lcd-2.9.0
creating luma.lcd-2.9.0/doc
creating luma.lcd-2.9.0/doc/fritzing
creating luma.lcd-2.9.0/doc/images
creating luma.lcd-2.9.0/doc/old
creating luma.lcd-2.9.0/doc/tech-spec
creating luma.lcd-2.9.0/luma
creating luma.lcd-2.9.0/luma.lcd.egg-info
creating luma.lcd-2.9.0/luma/lcd
copying files to luma.lcd-2.9.0...
copying .coveragerc -> luma.lcd-2.9.0
copying CHANGES.rst -> luma.lcd-2.9.0
copying CONTRIBUTING.rst -> luma.lcd-2.9.0
copying LICENSE.rst -> luma.lcd-2.9.0
copying MANIFEST.in -> luma.lcd-2.9.0
copying README.rst -> luma.lcd-2.9.0
copying pyproject.toml -> luma.lcd-2.9.0
copying pytest.ini -> luma.lcd-2.9.0
copying setup.cfg -> luma.lcd-2.9.0
copying setup.py -> luma.lcd-2.9.0
copying tox.ini -> luma.lcd-2.9.0
copying doc/HD44780.rst -> luma.lcd-2.9.0/doc
copying doc/Makefile -> luma.lcd-2.9.0/doc
copying doc/api-documentation.rst -> luma.lcd-2.9.0/doc
copying doc/conf.py -> luma.lcd-2.9.0/doc
copying doc/hardware.rst -> luma.lcd-2.9.0/doc
copying doc/index.rst -> luma.lcd-2.9.0/doc
copying doc/install.rst -> luma.lcd-2.9.0/doc
copying doc/intro.rst -> luma.lcd-2.9.0/doc
copying doc/python-usage.rst -> luma.lcd-2.9.0/doc
copying doc/references.rst -> luma.lcd-2.9.0/doc
copying doc/software.rst -> luma.lcd-2.9.0/doc
copying doc/fritzing/PCD8544 LCD.fzpz -> luma.lcd-2.9.0/doc/fritzing
copying doc/fritzing/RPi GPIO Header.fzpz -> luma.lcd-2.9.0/doc/fritzing
copying doc/fritzing/schematic.fzz -> luma.lcd-2.9.0/doc/fritzing
copying doc/images/IMG_2539.JPG -> luma.lcd-2.9.0/doc/images
copying doc/images/IMG_2540.JPG -> luma.lcd-2.9.0/doc/images
copying doc/images/IMG_2541.JPG -> luma.lcd-2.9.0/doc/images
copying doc/images/IMG_2544.JPG -> luma.lcd-2.9.0/doc/images
copying doc/images/IMG_2774.JPG -> luma.lcd-2.9.0/doc/images
copying doc/images/RPi_P5_header.png -> luma.lcd-2.9.0/doc/images
copying doc/images/clock_anim.gif -> luma.lcd-2.9.0/doc/images
copying doc/images/crawl_anim.gif -> luma.lcd-2.9.0/doc/images
copying doc/images/hd44780_20x4.jpg -> luma.lcd-2.9.0/doc/images
copying doc/images/hd44780_clock.jpg -> luma.lcd-2.9.0/doc/images
copying doc/images/hd44780_progress.jpg -> luma.lcd-2.9.0/doc/images
copying doc/images/ht1621.jpg -> luma.lcd-2.9.0/doc/images
copying doc/images/ili9341.jpg -> luma.lcd-2.9.0/doc/images
copying doc/images/invaders_anim.gif -> luma.lcd-2.9.0/doc/images
copying doc/images/pcd8544.jpg -> luma.lcd-2.9.0/doc/images
copying doc/images/pcd8544.png -> luma.lcd-2.9.0/doc/images
copying doc/images/pcd8544.svg -> luma.lcd-2.9.0/doc/images
copying doc/images/pcd8544_schematic_bb.png -> luma.lcd-2.9.0/doc/images
copying doc/images/serial_config.jpg -> luma.lcd-2.9.0/doc/images
copying doc/images/st7567.jpg -> luma.lcd-2.9.0/doc/images
copying doc/images/st7735.jpg -> luma.lcd-2.9.0/doc/images
copying doc/images/st7735_pin_outs.jpg -> luma.lcd-2.9.0/doc/images
copying doc/images/st7735_schematic_bb.png -> luma.lcd-2.9.0/doc/images
copying doc/images/uc1701x.png -> luma.lcd-2.9.0/doc/images
copying doc/images/wiring-diagram.png -> luma.lcd-2.9.0/doc/images
copying doc/images/wiring-diagram.svg -> luma.lcd-2.9.0/doc/images
copying doc/old/veroboard-schematic.diy -> luma.lcd-2.9.0/doc/old
copying doc/tech-spec/HD44780.pdf -> luma.lcd-2.9.0/doc/tech-spec
copying doc/tech-spec/HT1621.pdf -> luma.lcd-2.9.0/doc/tech-spec
copying doc/tech-spec/ILI9341.pdf -> luma.lcd-2.9.0/doc/tech-spec
copying doc/tech-spec/PCD8544.pdf -> luma.lcd-2.9.0/doc/tech-spec
copying doc/tech-spec/ST7735.pdf -> luma.lcd-2.9.0/doc/tech-spec
copying doc/tech-spec/ST7789.pdf -> luma.lcd-2.9.0/doc/tech-spec
copying doc/tech-spec/ST7920.pdf -> luma.lcd-2.9.0/doc/tech-spec
copying doc/tech-spec/UC1701X.pdf -> luma.lcd-2.9.0/doc/tech-spec
copying luma/__init__.py -> luma.lcd-2.9.0/luma
copying luma.lcd.egg-info/PKG-INFO -> luma.lcd-2.9.0/luma.lcd.egg-info
copying luma.lcd.egg-info/SOURCES.txt -> luma.lcd-2.9.0/luma.lcd.egg-info
copying luma.lcd.egg-info/dependency_links.txt -> luma.lcd-2.9.0/luma.lcd.egg-info
copying luma.lcd.egg-info/namespace_packages.txt -> luma.lcd-2.9.0/luma.lcd.egg-info
copying luma.lcd.egg-info/not-zip-safe -> luma.lcd-2.9.0/luma.lcd.egg-info
copying luma.lcd.egg-info/requires.txt -> luma.lcd-2.9.0/luma.lcd.egg-info
copying luma.lcd.egg-info/top_level.txt -> luma.lcd-2.9.0/luma.lcd.egg-info
copying luma/lcd/__init__.py -> luma.lcd-2.9.0/luma/lcd
copying luma/lcd/const.py -> luma.lcd-2.9.0/luma/lcd
copying luma/lcd/device.py -> luma.lcd-2.9.0/luma/lcd
copying luma/lcd/segment_mapper.py -> luma.lcd-2.9.0/luma/lcd
Writing luma.lcd-2.9.0/setup.cfg
Creating tar archive
removing 'luma.lcd-2.9.0' (and everything under it)
running bdist_wheel
running build
running build_py
installing to build/bdist.macosx-11-arm64/wheel
running install
running install_lib
Skipping installation of build/bdist.macosx-11-arm64/wheel/luma/__init__.py (namespace package)
copying luma/lcd/device.py -> build/bdist.macosx-11-arm64/wheel/luma/lcd
copying luma/lcd/__init__.py -> build/bdist.macosx-11-arm64/wheel/luma/lcd
copying luma/lcd/segment_mapper.py -> build/bdist.macosx-11-arm64/wheel/luma/lcd
copying luma/lcd/const.py -> build/bdist.macosx-11-arm64/wheel/luma/lcd
running install_egg_info
Copying luma.lcd.egg-info to build/bdist.macosx-11-arm64/wheel/luma.lcd-2.9.0-py3.9.egg-info
Installing build/bdist.macosx-11-arm64/wheel/luma.lcd-2.9.0-py3.9-nspkg.pth
running install_scripts
adding license file "LICENSE.rst" (matched pattern "LICEN[CS]E*")
creating build/bdist.macosx-11-arm64/wheel/luma.lcd-2.9.0.dist-info/WHEEL
creating 'dist/luma.lcd-2.9.0-py2.py3-none-any.whl' and adding 'build/bdist.macosx-11-arm64/wheel' to it
adding 'luma.lcd-2.9.0-py3.9-nspkg.pth'
adding 'luma/lcd/__init__.py'
adding 'luma/lcd/const.py'
adding 'luma/lcd/device.py'
adding 'luma/lcd/segment_mapper.py'
adding 'luma.lcd-2.9.0.dist-info/LICENSE.rst'
adding 'luma.lcd-2.9.0.dist-info/METADATA'
adding 'luma.lcd-2.9.0.dist-info/WHEEL'
adding 'luma.lcd-2.9.0.dist-info/namespace_packages.txt'
adding 'luma.lcd-2.9.0.dist-info/top_level.txt'
adding 'luma.lcd-2.9.0.dist-info/RECORD'
removing build/bdist.macosx-11-arm64/wheel
running upload
Submitting dist/luma.lcd-2.9.0.tar.gz to https://upload.pypi.org/legacy/
Upload failed (400): Invalid value for blake2_256_digest. Error: Use a valid, hex-encoded, BLAKE2 message digest.
error: Upload failed (400): Invalid value for blake2_256_digest. Error: Use a valid, hex-encoded, BLAKE2 message digest. |
|
@matemaciek the develop install worked!!!! Yesssss!!! |
|
@rm-hull upgrade wheel and setuptools to latest and try again? |
|
also looks like its trying to build for arm: build/bdist.macosx-11-arm64/wheel |
|
would be better to publish using github actions only to prevent these issues @rm-hull |
ah yes ... that will be my shiny new macbook |
|
Publishes ok on linux... |
#109 Rebased over current master.
fixes #104