Skip to content

Commit bd0875c

Browse files
committed
Inky73: Add support for PEN_P4.
1 parent a58ccd2 commit bd0875c

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

drivers/inky73/inky73.cpp

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,20 @@ namespace pimoroni {
160160

161161
uint totalLength = 0;
162162
gpio_put(CS, 1);
163-
graphics->frame_convert(PicoGraphics::PEN_INKY7, [this, &totalLength](void *buf, size_t length) {
164-
if (length > 0) {
165-
gpio_put(CS, 0);
166-
spi_write_blocking(spi, (const uint8_t*)buf, length);
167-
totalLength += length;
168-
gpio_put(CS, 1);
169-
}
170-
});
163+
if(graphics->pen_type == PicoGraphics::PEN_P4) {
164+
gpio_put(CS, 0);
165+
spi_write_blocking(spi, (const uint8_t*)graphics->frame_buffer, graphics->bounds.w * graphics->bounds.h / 2);
166+
gpio_put(CS, 1);
167+
} else {
168+
graphics->frame_convert(PicoGraphics::PEN_INKY7, [this, &totalLength](void *buf, size_t length) {
169+
if (length > 0) {
170+
gpio_put(CS, 0);
171+
spi_write_blocking(spi, (const uint8_t*)buf, length);
172+
totalLength += length;
173+
gpio_put(CS, 1);
174+
}
175+
});
176+
}
171177

172178
gpio_put(DC, 0); // data mode
173179

0 commit comments

Comments
 (0)