Skip to content

Commit

Permalink
PicoGraphics: Add Presto.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gadgetoid committed Oct 31, 2024
1 parent 49b496d commit 03a8d51
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions micropython/modules/picographics/picographics.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) },
Expand Down
10 changes: 9 additions & 1 deletion micropython/modules/picographics/picographics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);

Expand Down
3 changes: 2 additions & 1 deletion micropython/modules/picographics/picographics.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ enum PicoGraphicsDisplay {
DISPLAY_UNICORN_PACK,
DISPLAY_SCROLL_PACK,
DISPLAY_PICO_W_EXPLORER,
DISPLAY_EXPLORER
DISPLAY_EXPLORER,
DISPLAY_PRESTO
};

enum PicoGraphicsPenType {
Expand Down

0 comments on commit 03a8d51

Please sign in to comment.