summaryrefslogtreecommitdiff
path: root/wasp/drivers
diff options
context:
space:
mode:
authorDaniel Thompson <daniel@redfelineninja.org.uk>2020-03-09 00:00:13 (GMT)
committerDaniel Thompson <daniel@redfelineninja.org.uk>2020-03-09 00:00:13 (GMT)
commit031d139b7c31f83791c8c35cc78624aa1eda6da2 (patch)
tree0322cf93239101571d3e8b1c29a9e0980313abe0 /wasp/drivers
parent5413d826d7ffe825b759cd013f9f68e9311aee01 (diff)
wasp: draw565: Refactor to allow apps to focus on the drawable.
Diffstat (limited to 'wasp/drivers')
-rw-r--r--wasp/drivers/st7789.py35
1 files changed, 0 insertions, 35 deletions
diff --git a/wasp/drivers/st7789.py b/wasp/drivers/st7789.py
index 5cc3946..b7edf2e 100644
--- a/wasp/drivers/st7789.py
+++ b/wasp/drivers/st7789.py
@@ -25,16 +25,6 @@ _RAMWR = const(0x2c)
_COLMOD = const(0x3a)
_MADCTL = const(0x36)
-@micropython.viper
-def fastfill(mv, color: int, count: int, offset: int):
- p = ptr8(mv)
- colorhi = color >> 8
- colorlo = color & 0xff
-
- for x in range(count):
- p[2*(x+offset) ] = colorhi
- p[2*(x+offset) + 1] = colorlo
-
class ST7789(object):
def __init__(self, width, height):
self.width = width
@@ -126,31 +116,6 @@ class ST7789(object):
for yi in range(h):
self.write_data(buf)
- @micropython.native
- def rleblit(self, image, pos=(0, 0), fg=0xffff, bg=0):
- (sx, sy, rle) = image
- self.set_window(pos[0], pos[1], sx, sy)
-
- buf = memoryview(self.linebuffer)[0:2*sx]
- bp = 0
- color = bg
-
- for rl in rle:
- while rl:
- count = min(sx - bp, rl)
- fastfill(buf, color, count, bp)
- bp += count
- rl -= count
-
- if bp >= sx:
- self.write_data(buf)
- bp = 0
-
- if color == bg:
- color = fg
- else:
- color = bg
-
class ST7789_SPI(ST7789):
def __init__(self, width, height, spi, cs, dc, res=None, rate=8000000):
self.spi = spi