Skip to content

Commit 1003c12

Browse files
committed
PicoGraphics: Add Presto.
1 parent 27f5309 commit 1003c12

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

micropython/modules/picographics/picographics.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ static const mp_map_elem_t picographics_globals_table[] = {
165165
{ MP_ROM_QSTR(MP_QSTR_DISPLAY_SCROLL_PACK), MP_ROM_INT(DISPLAY_SCROLL_PACK) },
166166
{ MP_ROM_QSTR(MP_QSTR_DISPLAY_PICO_W_EXPLORER), MP_ROM_INT(DISPLAY_PICO_W_EXPLORER) },
167167
{ MP_ROM_QSTR(MP_QSTR_DISPLAY_EXPLORER), MP_ROM_INT(DISPLAY_EXPLORER) },
168+
{ MP_ROM_QSTR(MP_QSTR_DISPLAY_PRESTO), MP_ROM_INT(DISPLAY_PRESTO) },
168169

169170
{ MP_ROM_QSTR(MP_QSTR_PEN_1BIT), MP_ROM_INT(PEN_1BIT) },
170171
{ MP_ROM_QSTR(MP_QSTR_PEN_P4), MP_ROM_INT(PEN_P4) },

micropython/modules/picographics/picographics.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,13 @@ bool get_display_settings(PicoGraphicsDisplay display, int &width, int &height,
248248
if(rotate == -1) rotate = (int)Rotation::ROTATE_0;
249249
if(pen_type == -1) pen_type = PEN_RGB888;
250250
break;
251+
case DISPLAY_PRESTO:
252+
width = 240;
253+
height = 240;
254+
bus_type = BUS_PIO;
255+
rotate = (int)Rotation::ROTATE_0;
256+
pen_type = PEN_RGB565;
257+
break;
251258
default:
252259
return false;
253260
}
@@ -388,7 +395,8 @@ mp_obj_t ModPicoGraphics_make_new(const mp_obj_type_t *type, size_t n_args, size
388395
|| display == DISPLAY_COSMIC_UNICORN
389396
|| display == DISPLAY_STELLAR_UNICORN
390397
|| display == DISPLAY_UNICORN_PACK
391-
|| display == DISPLAY_SCROLL_PACK) {
398+
|| display == DISPLAY_SCROLL_PACK
399+
|| display == DISPLAY_PRESTO) {
392400
// Create a dummy display driver
393401
self->display = m_new_class(DisplayDriver, width, height, (Rotation)rotate);
394402

micropython/modules/picographics/picographics.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ enum PicoGraphicsDisplay {
3131
DISPLAY_UNICORN_PACK,
3232
DISPLAY_SCROLL_PACK,
3333
DISPLAY_PICO_W_EXPLORER,
34-
DISPLAY_EXPLORER
34+
DISPLAY_EXPLORER,
35+
DISPLAY_PRESTO
3536
};
3637

3738
enum PicoGraphicsPenType {

0 commit comments

Comments
 (0)