Skip to content

Commit fd926ee

Browse files
committed
Wrap LUT init
1 parent 5f6ba46 commit fd926ee

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

adafruit_il91874.py

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,9 @@
3737
3838
**Software and Dependencies:**
3939
40-
* Adafruit CircuitPython firmware for the supported boards:
40+
* Adafruit CircuitPython firmware (version 5+) for the supported boards:
4141
https://github.com/adafruit/circuitpython/releases
4242
43-
.. todo:: Uncomment or remove the Bus Device and/or the Register library dependencies based on the library's use of either.
44-
4543
# * Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
4644
# * Adafruit's Register library: https://github.com/adafruit/Adafruit_CircuitPython_Register
4745
"""
@@ -66,11 +64,21 @@
6664
b"\x50\x01\x87" # CDI setting
6765

6866
# Look Up Tables
69-
b"\x20\x2c\x00\x00\x00\x1a\x1a\x00\x00\x01\x00\x0a\x0a\x00\x00\x08\x00\x0e\x01\x0e\x01\x10\x00\x0a\x0a\x00\x00\x08\x00\x04\x10\x00\x00\x05\x00\x03\x0e\x00\x00\x0a\x00\x23\x00\x00\x00\x01" # LUT1
70-
b"\x21\x2a\x90\x1a\x1a\x00\x00\x01\x40\x0a\x0a\x00\x00\x08\x84\x0e\x01\x0e\x01\x10\x80\x0a\x0a\x00\x00\x08\x00\x04\x10\x00\x00\x05\x00\x03\x0e\x00\x00\x0a\x00\x23\x00\x00\x00\x01" # LUTWW
71-
b"\x22\x2a\xa0\x1a\x1a\x00\x00\x01\x00\x0a\x0a\x00\x00\x08\x84\x0e\x01\x0e\x01\x10\x90\x0a\x0a\x00\x00\x08\xb0\x04\x10\x00\x00\x05\xb0\x03\x0e\x00\x00\x0a\xc0\x23\x00\x00\x00\x01" # LUTBW
72-
b"\x23\x2a\x90\x1a\x1a\x00\x00\x01\x40\x0a\x0a\x00\x00\x08\x84\x0e\x01\x0e\x01\x10\x80\x0a\x0a\x00\x00\x08\x00\x04\x10\x00\x00\x05\x00\x03\x0e\x00\x00\x0a\x00\x23\x00\x00\x00\x01" # LUTWB
73-
b"\x24\x2a\x90\x1a\x1a\x00\x00\x01\x20\x0a\x0a\x00\x00\x08\x84\x0e\x01\x0e\x01\x10\x10\x0a\x0a\x00\x00\x08\x00\x04\x10\x00\x00\x05\x00\x03\x0e\x00\x00\x0a\x00\x23\x00\x00\x00\x01" # LUTBB
67+
# LUT1
68+
b"\x20\x2c\x00\x00\x00\x1a\x1a\x00\x00\x01\x00\x0a\x0a\x00\x00\x08\x00\x0e\x01\x0e\x01\x10\x00"
69+
b"\x0a\x0a\x00\x00\x08\x00\x04\x10\x00\x00\x05\x00\x03\x0e\x00\x00\x0a\x00\x23\x00\x00\x00\x01"
70+
# LUTWW
71+
b"\x21\x2a\x90\x1a\x1a\x00\x00\x01\x40\x0a\x0a\x00\x00\x08\x84\x0e\x01\x0e\x01\x10\x80\x0a\x0a"
72+
b"\x00\x00\x08\x00\x04\x10\x00\x00\x05\x00\x03\x0e\x00\x00\x0a\x00\x23\x00\x00\x00\x01"
73+
# LUTBW
74+
b"\x22\x2a\xa0\x1a\x1a\x00\x00\x01\x00\x0a\x0a\x00\x00\x08\x84\x0e\x01\x0e\x01\x10\x90\x0a\x0a"
75+
b"\x00\x00\x08\xb0\x04\x10\x00\x00\x05\xb0\x03\x0e\x00\x00\x0a\xc0\x23\x00\x00\x00\x01"
76+
# LUTWB
77+
b"\x23\x2a\x90\x1a\x1a\x00\x00\x01\x40\x0a\x0a\x00\x00\x08\x84\x0e\x01\x0e\x01\x10\x80\x0a\x0a"
78+
b"\x00\x00\x08\x00\x04\x10\x00\x00\x05\x00\x03\x0e\x00\x00\x0a\x00\x23\x00\x00\x00\x01"
79+
# LUTBB
80+
b"\x24\x2a\x90\x1a\x1a\x00\x00\x01\x20\x0a\x0a\x00\x00\x08\x84\x0e\x01\x0e\x01\x10\x10\x0a\x0a"
81+
b"\x00\x00\x08\x00\x04\x10\x00\x00\x05\x00\x03\x0e\x00\x00\x0a\x00\x23\x00\x00\x00\x01"
7482

7583
b"\x61\x04\x00\x00\x00\x00" # Resolution
7684
b"\x16\x80\x00" # PDRF
@@ -100,5 +108,6 @@ def __init__(self, bus, **kwargs):
100108
super().__init__(bus, start_sequence, _STOP_SEQUENCE, **kwargs,
101109
ram_width=320, ram_height=300,
102110
busy_state=False,
103-
write_black_ram_command=0x10, black_bits_inverted=True, write_color_ram_command=0x13,
111+
write_black_ram_command=0x10, black_bits_inverted=True,
112+
write_color_ram_command=0x13,
104113
refresh_display_command=0x12, always_toggle_chip_select=True)

examples/il91874_simpletest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import time
99
import board
10-
import busio
1110
import displayio
1211
import adafruit_il91874
1312

@@ -20,7 +19,8 @@
2019
display_bus = displayio.FourWire(spi, command=epd_dc, chip_select=epd_cs, baudrate=1000000)
2120
time.sleep(1)
2221

23-
display = adafruit_il91874.IL91874(display_bus, width=264, height=176, highlight_color=0xff0000, rotation=90)
22+
display = adafruit_il91874.IL91874(display_bus, width=264, height=176, highlight_color=0xff0000,
23+
rotation=90)
2424

2525
g = displayio.Group()
2626

0 commit comments

Comments
 (0)