Skip to content

Commit 49898a6

Browse files
committed
DM: remove soft framebuf stuff
1 parent 59bfc3f commit 49898a6

File tree

3 files changed

+14
-62
lines changed

3 files changed

+14
-62
lines changed

adafruit_epd/epd.py

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -72,59 +72,3 @@ def data(self, dat):
7272
self.spi_device.write(dat)
7373
self._cs.value = True
7474
self.spi_device.unlock()
75-
76-
def draw_pixel(self, x, y, color):
77-
pass
78-
79-
#framebuf methods
80-
def fill(self, color):
81-
self.fill_rect(self, 0, 0, self.width, self.height, color)
82-
83-
def fill_rect(self, x, y, width, height, color):
84-
if width < 1 or height < 1 or (x+width) <= 0:
85-
return
86-
if (y+height) <= 0 or y >= self.height or x >= self.width:
87-
return
88-
xend = min(self.width, x+width)
89-
yend = min(self.height, y+height)
90-
x = max(x, 0)
91-
y = max(y, 0)
92-
for _x in range(xend - x):
93-
for _y in range(yend - y):
94-
self.draw_pixel(x + _x, y + _y, color)
95-
return
96-
97-
def pixel(self, x, y, color=None):
98-
if x < 0 or x >= self.width or y < 0 or y >= self.height:
99-
return None
100-
#TODO: figure this out when we know what framebuffer we
101-
# will actually use
102-
#if color is None:
103-
# return self.get_pixel(self, x, y)
104-
105-
self.draw_pixel(self, x, y, color)
106-
return None
107-
108-
def hline(self, x, y, width, color):
109-
self.fill_rect(x, y, width, 1, color)
110-
111-
def vline(self, x, y, height, color):
112-
self.fill_rect(x, y, 1, height, color)
113-
114-
def rect(self, x, y, width, height, color):
115-
self.fill_rect(x, y, width, 1, color)
116-
self.fill_rect(x, y+height, width, 1, color)
117-
self.fill_rect(self, x, y, 1, height, color)
118-
self.fill_rect(self, x+width, y, 1, height, color)
119-
120-
def line(self):
121-
raise NotImplementedError()
122-
123-
def blit(self):
124-
raise NotImplementedError()
125-
126-
def scroll(self):
127-
raise NotImplementedError()
128-
129-
def text(self):
130-
raise NotImplementedError()

adafruit_epd/il0373.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030

3131
class Adafruit_IL0373(Adafruit_EPD):
3232
def __init__(self, width, height, rst_pin, dc_pin, busy_pin, srcs_pin, cs_pin, spi):
33-
super(Adafruit_IL0373, self).__init__(width, height, rst_pin, dc_pin, busy_pin, \
34-
srcs_pin, cs_pin, spi)
33+
super(Adafruit_IL0373, self).__init__(width, height, rst_pin, dc_pin, busy_pin,
34+
srcs_pin, cs_pin, spi)
3535

3636
self.bw_bufsize = int(width * height / 8)
3737
self.red_bufsize = int(width * height / 8)

examples/epd_simpletest.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,17 @@
1818
# clear the buffer
1919
display.clear_buffer()
2020

21-
# draw some arbitrary lines and shapes!!
22-
display.fill_rect(30, 20, 50, 60, Adafruit_EPD.RED)
23-
display.hline(120, 30, 60, Adafruit_EPD.BLACK)
24-
display.vline(120, 30, 60, Adafruit_EPD.BLACK)
21+
#draw some lines!!
22+
for i in range(152):
23+
display.draw_pixel(i, i, Adafruit_EPD.RED)
24+
display.draw_pixel(152-i, i, Adafruit_EPD.RED)
25+
display.draw_pixel(10, i, Adafruit_EPD.BLACK)
26+
display.draw_pixel(20, i, Adafruit_EPD.BLACK)
27+
display.draw_pixel(30, i, Adafruit_EPD.BLACK)
28+
display.draw_pixel(40, i, Adafruit_EPD.BLACK)
29+
display.draw_pixel(50, i, Adafruit_EPD.BLACK)
30+
display.draw_pixel(60, i, Adafruit_EPD.BLACK)
31+
display.draw_pixel(70, i, Adafruit_EPD.BLACK)
32+
display.draw_pixel(80, i, Adafruit_EPD.BLACK)
2533

2634
display.display()

0 commit comments

Comments
 (0)