Add tricolor support for both 5.83" and 7.5"
Some checks failed
Build CI / test (push) Has been cancelled

This commit is contained in:
Scott Shawcroft 2025-07-31 10:13:03 -07:00
parent 13f10e5002
commit f750e0fb45
No known key found for this signature in database
4 changed files with 130 additions and 2 deletions

View file

@ -39,7 +39,7 @@ __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_UC8179.git"
_START_SEQUENCE = ( _START_SEQUENCE = (
b"\x01\x04\x07\x07\x3f\x3f" # POWERSETTING: VGH=20V, VGL=-20V, VDH=15V, VDL=-15V b"\x01\x04\x07\x07\x3f\x3f" # POWERSETTING: VGH=20V, VGL=-20V, VDH=15V, VDL=-15V
b"\x04\x00" # POWERON b"\x04\x00" # POWERON
b"\x00\x01\x13" # PANELSETTING: 0x13 b"\x00\x01\x03" # PANELSETTING
b"\x61\x04\x00\x00\x00\x00" # TRES: resolution b"\x61\x04\x00\x00\x00\x00" # TRES: resolution
b"\x15\x01\x00" # DUALSPI: single SPI b"\x15\x01\x00" # DUALSPI: single SPI
b"\x50\x02\x10\x07" # WRITE_VCOM b"\x50\x02\x10\x07" # WRITE_VCOM
@ -68,9 +68,13 @@ class UC8179(EPaperDisplay):
if "highlight_color" in kwargs: if "highlight_color" in kwargs:
color_ram_command = 0x13 color_ram_command = 0x13
black_ram_command = 0x10 black_ram_command = 0x10
panel_setting = 0x03
else: else:
color_ram_command = None color_ram_command = None
black_ram_command = 0x13 black_ram_command = 0x13
panel_setting = 0x13
start_sequence[10] = panel_setting
super().__init__( super().__init__(
bus, bus,

View file

@ -0,0 +1,62 @@
# SPDX-FileCopyrightText: 2025 Scott Shawcroft, written for Adafruit Industries
# SPDX-FileCopyrightText: Copyright (c) 2021 Melissa LeBlanc-Williams for Adafruit Industries
#
# SPDX-License-Identifier: Unlicense
"""Simple test script for 5.83" 648x480 tricolor display (ThinkInk_583_Tricolor_AABMFGNR)."""
import time
import board
import busio
import displayio
from fourwire import FourWire
import adafruit_uc8179
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_uc8179.UC8179(
display_bus,
width=648,
height=480,
busy_pin=epd_busy,
rotation=180,
black_bits_inverted=True,
highlight_color=0xff0000,
colstart=0
)
g = displayio.Group()
pic = displayio.OnDiskBitmap("/display-ruler-1280x720.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)

View file

@ -0,0 +1,62 @@
# SPDX-FileCopyrightText: 2025 Scott Shawcroft, written for Adafruit Industries
# SPDX-FileCopyrightText: Copyright (c) 2021 Melissa LeBlanc-Williams for Adafruit Industries
#
# SPDX-License-Identifier: Unlicense
"""Simple test script for 7.5" 800x480 tricolor display (ThinkInk_750_Tricolor_AABMFGNR)."""
import time
import board
import busio
import displayio
from fourwire import FourWire
import adafruit_uc8179
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_uc8179.UC8179(
display_bus,
width=800,
height=480,
busy_pin=epd_busy,
rotation=180,
black_bits_inverted=True,
highlight_color=0xff0000,
colstart=0
)
g = displayio.Group()
pic = displayio.OnDiskBitmap("/display-ruler-1280x720.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)

View file

@ -3,7 +3,7 @@
# #
# SPDX-License-Identifier: Unlicense # SPDX-License-Identifier: Unlicense
"""Simple test script for 5.83" 648x480 monochrome display.""" """Simple test script for 5.83" 648x480 monochrome display (ThinkInk_583_Mono_AAAMFGN)."""
import time import time