From 2ef6d8d8fbfad1552aa8bd6b83454467e336c34a Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Thu, 17 Apr 2025 13:34:39 +0100 Subject: [PATCH] Inky73: Add support for PEN_P4. --- drivers/inky73/inky73.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/inky73/inky73.cpp b/drivers/inky73/inky73.cpp index 72387ff3..aca9048d 100644 --- a/drivers/inky73/inky73.cpp +++ b/drivers/inky73/inky73.cpp @@ -160,14 +160,20 @@ namespace pimoroni { uint totalLength = 0; gpio_put(CS, 1); - graphics->frame_convert(PicoGraphics::PEN_INKY7, [this, &totalLength](void *buf, size_t length) { - if (length > 0) { - gpio_put(CS, 0); - spi_write_blocking(spi, (const uint8_t*)buf, length); - totalLength += length; - gpio_put(CS, 1); - } - }); + if(graphics->pen_type == PicoGraphics::PEN_P4) { + gpio_put(CS, 0); + spi_write_blocking(spi, (const uint8_t*)graphics->frame_buffer, graphics->bounds.w * graphics->bounds.h / 2); + gpio_put(CS, 1); + } else { + graphics->frame_convert(PicoGraphics::PEN_INKY7, [this, &totalLength](void *buf, size_t length) { + if (length > 0) { + gpio_put(CS, 0); + spi_write_blocking(spi, (const uint8_t*)buf, length); + totalLength += length; + gpio_put(CS, 1); + } + }); + } gpio_put(DC, 0); // data mode