From 1003c12a84a8bcdb58866f4e92337ff7dbcdd36c Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Wed, 14 Aug 2024 14:20:18 +0100 Subject: [PATCH] PicoGraphics: Add Presto. --- micropython/modules/picographics/picographics.c | 1 + micropython/modules/picographics/picographics.cpp | 10 +++++++++- micropython/modules/picographics/picographics.h | 3 ++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/micropython/modules/picographics/picographics.c b/micropython/modules/picographics/picographics.c index 1a504c1ea..b90071ff9 100644 --- a/micropython/modules/picographics/picographics.c +++ b/micropython/modules/picographics/picographics.c @@ -165,6 +165,7 @@ static const mp_map_elem_t picographics_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_DISPLAY_SCROLL_PACK), MP_ROM_INT(DISPLAY_SCROLL_PACK) }, { MP_ROM_QSTR(MP_QSTR_DISPLAY_PICO_W_EXPLORER), MP_ROM_INT(DISPLAY_PICO_W_EXPLORER) }, { MP_ROM_QSTR(MP_QSTR_DISPLAY_EXPLORER), MP_ROM_INT(DISPLAY_EXPLORER) }, + { MP_ROM_QSTR(MP_QSTR_DISPLAY_PRESTO), MP_ROM_INT(DISPLAY_PRESTO) }, { MP_ROM_QSTR(MP_QSTR_PEN_1BIT), MP_ROM_INT(PEN_1BIT) }, { MP_ROM_QSTR(MP_QSTR_PEN_P4), MP_ROM_INT(PEN_P4) }, diff --git a/micropython/modules/picographics/picographics.cpp b/micropython/modules/picographics/picographics.cpp index 218c95788..0253e075e 100644 --- a/micropython/modules/picographics/picographics.cpp +++ b/micropython/modules/picographics/picographics.cpp @@ -248,6 +248,13 @@ bool get_display_settings(PicoGraphicsDisplay display, int &width, int &height, if(rotate == -1) rotate = (int)Rotation::ROTATE_0; if(pen_type == -1) pen_type = PEN_RGB888; break; + case DISPLAY_PRESTO: + width = 240; + height = 240; + bus_type = BUS_PIO; + rotate = (int)Rotation::ROTATE_0; + pen_type = PEN_RGB565; + break; default: return false; } @@ -388,7 +395,8 @@ mp_obj_t ModPicoGraphics_make_new(const mp_obj_type_t *type, size_t n_args, size || display == DISPLAY_COSMIC_UNICORN || display == DISPLAY_STELLAR_UNICORN || display == DISPLAY_UNICORN_PACK - || display == DISPLAY_SCROLL_PACK) { + || display == DISPLAY_SCROLL_PACK + || display == DISPLAY_PRESTO) { // Create a dummy display driver self->display = m_new_class(DisplayDriver, width, height, (Rotation)rotate); diff --git a/micropython/modules/picographics/picographics.h b/micropython/modules/picographics/picographics.h index 6457599ab..87225716d 100644 --- a/micropython/modules/picographics/picographics.h +++ b/micropython/modules/picographics/picographics.h @@ -31,7 +31,8 @@ enum PicoGraphicsDisplay { DISPLAY_UNICORN_PACK, DISPLAY_SCROLL_PACK, DISPLAY_PICO_W_EXPLORER, - DISPLAY_EXPLORER + DISPLAY_EXPLORER, + DISPLAY_PRESTO }; enum PicoGraphicsPenType {