Merge pull request #1 from makermelissa/main

Adding the UC8151D driver for eInk Displays
This commit is contained in:
Melissa LeBlanc-Williams 2021-09-20 17:09:55 -07:00 committed by GitHub
commit dd6ea57b69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 51 additions and 21 deletions

View file

@ -36,18 +36,13 @@ This is easily achieved by downloading
or individual libraries can be installed using
`circup <https://github.com/adafruit/circup>`_.
.. todo:: Describe the Adafruit product this library works with. For PCBs, you can also add the
image from the assets folder in the PCB's GitHub repo.
Adafruit 2.9" Flexible 296x128 Monochrome eInk / ePaper Display
`Purchase one from the Adafruit shop <http://www.adafruit.com/products/4262>`_
Installing from PyPI
=====================
.. note:: This library is not available on PyPI yet. Install documentation is included
as a standard element. Stay tuned for PyPI availability!
.. todo:: Remove the above note if PyPI version is/will be available at time of release.
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
PyPI <https://pypi.org/project/adafruit-circuitpython-uc8151d/>`_.
@ -100,8 +95,44 @@ Or the following command to update an existing version:
Usage Example
=============
.. todo:: Add a quick, simple example. It and other examples should live in the
examples folder and be included in docs/examples.rst.
.. code-block:: python
import time
import board
import displayio
import adafruit_uc8151d
displayio.release_displays()
# This pinout works on a Feather M4 and may need to be altered for other boards.
spi = board.SPI() # Uses SCK and MOSI
epd_cs = board.D9
epd_dc = board.D10
epd_reset = board.D5
epd_busy = None
display_bus = displayio.FourWire(
spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
)
time.sleep(1)
display = adafruit_uc8151d.UC8151D(
display_bus, width=296, height=128, rotation=90, busy_pin=epd_busy
)
g = displayio.Group()
with open("/display-ruler.bmp", "rb") as f:
pic = displayio.OnDiskBitmap(f)
t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
g.append(t)
display.show(g)
display.refresh()
time.sleep(120)
Contributing
============

View file

@ -31,18 +31,14 @@ __version__ = "0.0.0-auto.0"
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_UC8151D.git"
_START_SEQUENCE = (
#b"\x01\x05\x03\x00\x2b\x2b\x09" # power setting
#b"\x06\x03\x17\x17\x17" # booster soft start
# b"\x01\x05\x03\x00\x2b\x2b\x09" # power setting
# b"\x06\x03\x17\x17\x17" # booster soft start
b"\x04\x80\xc8" # power on and wait 10 ms
b"\x00\x01\x1f" # panel setting. Further filled in below.
b"\x50\x01\x97" # CDI setting
)
_STOP_SEQUENCE = (
b"\x50\x01\xf7" # CDI setting
b"\x07\x01\xA5" # Deep Sleep
)
_STOP_SEQUENCE = b"\x50\x01\xf7" b"\x07\x01\xA5" # CDI setting # Deep Sleep
# pylint: disable=too-few-public-methods
class UC8151D(displayio.EPaperDisplay):
r"""UC8151D driver

View file

@ -25,7 +25,7 @@ extensions = [
# Uncomment the below if you use native CircuitPython modules such as
# digitalio, micropython and busio. List the modules you use. Without it, the
# autodoc module docs will fail to generate with a warning.
# autodoc_mock_imports = ["digitalio", "busio"]
autodoc_mock_imports = ["displayio"]
intersphinx_mapping = {

View file

@ -24,14 +24,12 @@ Table of Contents
.. toctree::
:caption: Tutorials
.. todo:: Add any Learn guide links here. If there are none, then simply delete this todo and leave
the toctree above for use later.
Adafruit 2.9" eInk Display Breakouts and FeatherWings <https://learn.adafruit.com/adafruit-2-9-eink-display-breakouts-and-featherwings>
.. toctree::
:caption: Related Products
.. todo:: Add any product links here. If there are none, then simply delete this todo and leave
the toctree above for use later.
Adafruit 2.9" Flexible 296x128 Monochrome eInk / ePaper Display <https://www.adafruit.com/product/4262>
.. toctree::
:caption: Other Links

BIN
examples/display-ruler.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 KiB

View file

@ -0,0 +1,2 @@
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT

View file

@ -9,6 +9,7 @@ Supported products:
* Adafruit Flexible 2.9" Monochrome
* https://www.adafruit.com/product/4262
"""
# pylint: disable=no-member
import time
import board

View file

@ -4,3 +4,4 @@
# SPDX-License-Identifier: MIT
Adafruit-Blinka
adafruit-blinka-displayio

View file

@ -37,6 +37,7 @@ setup(
author_email="circuitpython@adafruit.com",
install_requires=[
"Adafruit-Blinka",
"adafruit-blinka-displayio",
],
# Choose your license
license="MIT",
@ -53,7 +54,7 @@ setup(
],
# What does your project relate to?
keywords="adafruit blinka circuitpython micropython uc8151d uc8151 us8151d displayio epd "
"epaper flexible",
"epaper flexible",
# You can just specify the packages manually here if your project is
# simple. Or you can use find_packages().
# TODO: IF LIBRARY FILES ARE A PACKAGE FOLDER,