pre-commit & fix docs build

This commit is contained in:
foamyguy 2025-07-31 13:01:38 -05:00
parent 2696ca50e3
commit 3f37a788ea
3 changed files with 65 additions and 23 deletions

View file

@ -36,19 +36,10 @@ This is easily achieved by downloading
or individual libraries can be installed using or individual libraries can be installed using
`circup <https://github.com/adafruit/circup>`_. `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.
`Purchase one from the Adafruit shop <http://www.adafruit.com/products/6373>`_ `Purchase one from the Adafruit shop <http://www.adafruit.com/products/6373>`_
Installing from PyPI 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 On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
PyPI <https://pypi.org/project/adafruit-circuitpython-jd79661/>`_. PyPI <https://pypi.org/project/adafruit-circuitpython-jd79661/>`_.
@ -99,8 +90,64 @@ Or the following command to update an existing version:
Usage Example Usage Example
============= =============
.. todo:: Add a quick, simple example. It and other examples should live in the .. code-block:: python
examples folder and be included in docs/examples.rst.
import time
import board
import busio
import displayio
from fourwire import FourWire
import adafruit_jd79661
displayio.release_displays()
# This pinout works on a MagTag with the newer screen and may need to be altered for other boards.
spi = busio.SPI(board.EPD_SCK, board.EPD_MOSI) # Uses SCK and MOSI
epd_cs = board.EPD_CS
epd_dc = board.EPD_DC
epd_reset = board.EPD_RESET
epd_busy = board.EPD_BUSY
display_bus = FourWire(spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000)
time.sleep(1)
display = adafruit_jd79661.JD79661(
display_bus,
width=250,
height=122,
busy_pin=epd_busy,
rotation=270,
colstart=0,
highlight_color=0x00FF00,
highlight_color2=0xFF0000,
)
g = displayio.Group()
pic = displayio.OnDiskBitmap("/display-ruler-640x360.bmp")
t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
g.append(t)
display.root_group = g
display.refresh()
print("refreshed")
time.sleep(display.time_to_refresh + 5)
# Always refresh a little longer. It's not a problem to refresh
# a few seconds more, but it's terrible to refresh too early
# (the display will throw an exception when if the refresh
# is too soon)
print("waited correct time")
# Keep the display the same
while True:
time.sleep(10)
Documentation Documentation
============= =============

View file

@ -56,7 +56,7 @@ _START_SEQUENCE = (
b"\x00\x02\x8f\x29" # Panel setting (128x250 resolution) b"\x00\x02\x8f\x29" # Panel setting (128x250 resolution)
b"\x01\x02\x07\x00" # Power setting b"\x01\x02\x07\x00" # Power setting
b"\x03\x03\x10\x54\x44" # Power offset b"\x03\x03\x10\x54\x44" # Power offset
b"\x06\x07\x05\x00\x3F\x0A\x25\x12\x1A" # Booster soft start b"\x06\x07\x05\x00\x3f\x0a\x25\x12\x1a" # Booster soft start
b"\x50\x01\x37" # CDI b"\x50\x01\x37" # CDI
b"\x60\x02\x02\x02" # TCON b"\x60\x02\x02\x02" # TCON
b"\x61\x04\x00\x80\x00\xfa" # Resolution (0, 128, 0, 250) b"\x61\x04\x00\x80\x00\xfa" # Resolution (0, 128, 0, 250)
@ -74,9 +74,8 @@ _STOP_SEQUENCE = (
b"\x07\x01\xa5" # Deep sleep b"\x07\x01\xa5" # Deep sleep
) )
_REFRESH_SEQUENCE = ( _REFRESH_SEQUENCE = b"\x12\x01\x00" # Display refresh
b"\x12\x01\x00" # Display refresh
)
# pylint: disable=too-few-public-methods # pylint: disable=too-few-public-methods
class JD79661(EPaperDisplay): class JD79661(EPaperDisplay):
@ -112,7 +111,7 @@ class JD79661(EPaperDisplay):
# Update resolution in start sequence (bytes at position for resolution command) # Update resolution in start sequence (bytes at position for resolution command)
# Find the resolution command in the sequence and update it # Find the resolution command in the sequence and update it
res_pos = start_sequence.find(b'\x61\x04') res_pos = start_sequence.find(b"\x61\x04")
if res_pos != -1: if res_pos != -1:
if height % 4 != 0: if height % 4 != 0:
height += 4 - height % 4 height += 4 - height % 4
@ -135,5 +134,5 @@ class JD79661(EPaperDisplay):
write_color_ram_command=None, # JD79661 uses single RAM with 2-bit pixels write_color_ram_command=None, # JD79661 uses single RAM with 2-bit pixels
refresh_display_command=_REFRESH_SEQUENCE, refresh_display_command=_REFRESH_SEQUENCE,
always_toggle_chip_select=True, always_toggle_chip_select=True,
address_little_endian=False address_little_endian=False,
) )

View file

@ -24,14 +24,10 @@ Table of Contents
.. toctree:: .. toctree::
:caption: Tutorials :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.
.. toctree:: .. toctree::
:caption: Related Products :caption: Related Products
.. todo:: Add any product links here. If there are none, then simply delete this todo and leave 2.13" 250x122 Quad-Color eInk / ePaper <http://www.adafruit.com/products/6373>
the toctree above for use later.
.. toctree:: .. toctree::
:caption: Other Links :caption: Other Links