Skip to content

Commit 706c7b3

Browse files
committed
feat(ssd1327): Remove SSD1327Display wrapper
1 parent abee6c6 commit 706c7b3

2 files changed

Lines changed: 0 additions & 45 deletions

File tree

lib/ssd1327/ssd1327/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
SSD1327_I2C,
55
WS_OLED_128X128_I2C,
66
WS_OLED_128X128_SPI,
7-
SSD1327Display,
87
)
98

109
__all__ = [
@@ -14,5 +13,4 @@
1413
"SSD1327_I2C",
1514
"WS_OLED_128X128_I2C",
1615
"WS_OLED_128X128_SPI",
17-
"SSD1327Display",
1816
]

lib/ssd1327/ssd1327/device.py

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from time import sleep_us
22

33
import framebuf
4-
from steami_screen import rgb_to_gray4
54

65
from ssd1327.const import (
76
REG_CMD,
@@ -227,45 +226,3 @@ def __init__(self, spi, dc, res, cs):
227226
class WS_OLED_128X128_I2C(SSD1327_I2C):
228227
def __init__(self, i2c, address=0x3C):
229228
super().__init__(128, 128, i2c, address)
230-
231-
"""
232-
SSD1327 display wrapper — converts RGB colors to 4-bit grayscale.
233-
234-
Wraps the raw SSD1327 driver so that steami_screen can pass RGB tuples
235-
while the hardware receives grayscale values (0-15).
236-
237-
Usage on the STeaMi board:
238-
import ssd1327
239-
from steami_ssd1327 import SSD1327Display
240-
raw = ssd1327.WS_OLED_128X128_SPI(spi, dc, res, cs)
241-
display = SSD1327Display(raw)
242-
"""
243-
244-
class SSD1327Display:
245-
"""Thin wrapper around an SSD1327 driver that accepts RGB colors."""
246-
247-
def __init__(self, raw):
248-
self._raw = raw
249-
self.width = getattr(raw, 'width', 128)
250-
self.height = getattr(raw, 'height', 128)
251-
252-
def fill(self, color):
253-
self._raw.fill(rgb_to_gray4(color))
254-
255-
def pixel(self, x, y, color):
256-
self._raw.pixel(x, y, rgb_to_gray4(color))
257-
258-
def text(self, string, x, y, color):
259-
self._raw.text(string, x, y, rgb_to_gray4(color))
260-
261-
def line(self, x1, y1, x2, y2, color):
262-
self._raw.line(x1, y1, x2, y2, rgb_to_gray4(color))
263-
264-
def fill_rect(self, x, y, w, h, color):
265-
self._raw.fill_rect(x, y, w, h, rgb_to_gray4(color))
266-
267-
def rect(self, x, y, w, h, color):
268-
self._raw.rect(x, y, w, h, rgb_to_gray4(color))
269-
270-
def show(self):
271-
self._raw.show()

0 commit comments

Comments
 (0)