diff --git a/README.rst b/README.rst index 20e6ac8..ff85be7 100644 --- a/README.rst +++ b/README.rst @@ -31,9 +31,6 @@ 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. - If the library is not planned for PyPI, remove the entire 'Installing from PyPI' section. - On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from PyPI `_. To install for current user: @@ -59,7 +56,50 @@ To install in a virtual environment in your current project: 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 + + """Simple test script for 1.54" 200x200 monochrome display. + + Supported products: + * Adafruit 1.54" Monochrome ePaper Display Breakout + * https://www.adafruit.com/product/4196 + """ + + import time + import board + import displayio + import adafruit_ssd1608 + + 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 = board.D6 + + display_bus = displayio.FourWire(spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, + baudrate=1000000) + time.sleep(1) + + display = adafruit_ssd1608.SSD1608(display_bus, width=200, height=200, busy_pin=epd_busy) + + g = displayio.Group() + + f = open("/display-ruler.bmp", "rb") + + pic = displayio.OnDiskBitmap(f) + t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter()) + g.append(t) + + display.show(g) + + display.refresh() + + print("refreshed") + + time.sleep(120) Contributing ============ diff --git a/adafruit_ssd1608.py b/adafruit_ssd1608.py index db26553..040f9ac 100644 --- a/adafruit_ssd1608.py +++ b/adafruit_ssd1608.py @@ -33,8 +33,7 @@ **Hardware:** -.. todo:: Add links to any specific hardware product page(s), or category page(s). Use unordered list & hyperlink rST - inline format: "* `Link Text `_" +* `Adafruit 1.54" Monochrome ePaper Display Breakout `_ **Software and Dependencies:** @@ -55,7 +54,8 @@ b"\x3b\x01\x0b" # Set gate line width b"\x11\x01\x03" # Data entry sequence b"\x2c\x01\x70" # Vcom Voltage - b"\x32\x1e\x02\x02\x01\x11\x12\x12\x22\x22\x66\x69\x69\x59\x58\x99\x99\x88\x00\x00\x00\x00\xf8\xb4\x13\x51\x35\x51\x51\x19\x01\x00" # LUT + b"\x32\x1e\x02\x02\x01\x11\x12\x12\x22\x22\x66\x69\x69\x59\x58\x99\x99\x88\x00\x00\x00\x00\xf8" + b"\xb4\x13\x51\x35\x51\x51\x19\x01\x00" # LUT b"\x22\x01\xc7" # Set DISP ctrl2 ) @@ -67,7 +67,6 @@ class SSD1608(displayio.EPaperDisplay): """SSD1608 driver""" def __init__(self, bus, **kwargs): - color_command = None start_sequence = bytearray(_START_SEQUENCE) width = kwargs["width"] start_sequence[4] = width - 1 diff --git a/docs/conf.py b/docs/conf.py index 80c8015..d43a5af 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -20,7 +20,7 @@ # 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 = {'python': ('https://docs.python.org/3.4', None),'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)} diff --git a/docs/index.rst b/docs/index.rst index 76b6c13..9c2b95e 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -23,14 +23,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 eInk Display Breakouts .. 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 1.54" Monochrome ePaper Display Breakout .. toctree:: :caption: Other Links diff --git a/examples/ssd1608_simpletest.py b/examples/ssd1608_simpletest.py index e69de29..8660e83 100644 --- a/examples/ssd1608_simpletest.py +++ b/examples/ssd1608_simpletest.py @@ -0,0 +1,42 @@ +"""Simple test script for 1.54" 200x200 monochrome display. + +Supported products: + * Adafruit 1.54" Monochrome ePaper Display Breakout + * https://www.adafruit.com/product/4196 + """ + +import time +import board +import displayio +import adafruit_ssd1608 + +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 = board.D6 + +display_bus = displayio.FourWire(spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, + baudrate=1000000) +time.sleep(1) + +display = adafruit_ssd1608.SSD1608(display_bus, width=200, height=200, busy_pin=epd_busy) + +g = displayio.Group() + +f = open("/display-ruler.bmp", "rb") + +pic = displayio.OnDiskBitmap(f) +t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter()) +g.append(t) + +display.show(g) + +display.refresh() + +print("refreshed") + +time.sleep(120)