diff --git a/adafruit_uc8179.py b/adafruit_uc8179.py index f547488..5306380 100644 --- a/adafruit_uc8179.py +++ b/adafruit_uc8179.py @@ -39,7 +39,7 @@ __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_UC8179.git" _START_SEQUENCE = ( b"\x01\x04\x07\x07\x3f\x3f" # POWERSETTING: VGH=20V, VGL=-20V, VDH=15V, VDL=-15V 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"\x15\x01\x00" # DUALSPI: single SPI b"\x50\x02\x10\x07" # WRITE_VCOM @@ -68,9 +68,13 @@ class UC8179(EPaperDisplay): if "highlight_color" in kwargs: color_ram_command = 0x13 black_ram_command = 0x10 + panel_setting = 0x03 else: color_ram_command = None black_ram_command = 0x13 + panel_setting = 0x13 + + start_sequence[10] = panel_setting super().__init__( bus, diff --git a/examples/uc8179_ThinkInk_583_Tricolor_AABMFGNR.py b/examples/uc8179_ThinkInk_583_Tricolor_AABMFGNR.py new file mode 100644 index 0000000..bdcefca --- /dev/null +++ b/examples/uc8179_ThinkInk_583_Tricolor_AABMFGNR.py @@ -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) diff --git a/examples/uc8179_ThinkInk_750_Tricolor_AABMFGNR.py b/examples/uc8179_ThinkInk_750_Tricolor_AABMFGNR.py new file mode 100644 index 0000000..f2f5ba6 --- /dev/null +++ b/examples/uc8179_ThinkInk_750_Tricolor_AABMFGNR.py @@ -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) diff --git a/examples/uc8179_simpletest.py b/examples/uc8179_simpletest.py index c7ab64a..6806ccf 100644 --- a/examples/uc8179_simpletest.py +++ b/examples/uc8179_simpletest.py @@ -3,7 +3,7 @@ # # 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