PicoGraphics: Add Pico W Explorer SPI pins.

pull/817/head
Phil Howard 2023-07-27 17:12:09 +01:00
rodzic 51574f839d
commit b368950f02
3 zmienionych plików z 6 dodań i 2 usunięć

Wyświetl plik

@ -155,6 +155,7 @@ STATIC const mp_map_elem_t picographics_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_DISPLAY_STELLAR_UNICORN), MP_ROM_INT(DISPLAY_STELLAR_UNICORN) },
{ MP_ROM_QSTR(MP_QSTR_DISPLAY_UNICORN_PACK), MP_ROM_INT(DISPLAY_UNICORN_PACK) },
{ 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_PEN_1BIT), MP_ROM_INT(PEN_1BIT) },
{ MP_ROM_QSTR(MP_QSTR_PEN_P4), MP_ROM_INT(PEN_P4) },

Wyświetl plik

@ -61,10 +61,10 @@ bool get_display_settings(PicoGraphicsDisplay display, int &width, int &height,
if(pen_type == -1) pen_type = PEN_RGB332;
break;
case DISPLAY_PICO_DISPLAY_2:
case DISPLAY_PICO_W_EXPLORER:
width = 320;
height = 240;
bus_type = BUS_SPI;
// Tufty display is upside-down
if(rotate == -1) rotate = (int)Rotation::ROTATE_0;
if(pen_type == -1) pen_type = PEN_RGB332;
break;
@ -325,6 +325,8 @@ mp_obj_t ModPicoGraphics_make_new(const mp_obj_type_t *type, size_t n_args, size
spi_bus = {PIMORONI_SPI_DEFAULT_INSTANCE, SPI_BG_FRONT_CS, SPI_DEFAULT_SCK, SPI_DEFAULT_MOSI, PIN_UNUSED, 20, PIN_UNUSED};
} else if (display == DISPLAY_GFX_PACK) {
spi_bus = {PIMORONI_SPI_DEFAULT_INSTANCE, 17, SPI_DEFAULT_SCK, SPI_DEFAULT_MOSI, PIN_UNUSED, 20, 9};
} else if (display == DISPLAY_PICO_W_EXPLORER) {
spi_bus = {PIMORONI_SPI_DEFAULT_INSTANCE, 17, SPI_DEFAULT_SCK, SPI_DEFAULT_MOSI, PIN_UNUSED, SPI_DEFAULT_MISO, 9};
}
}
}

Wyświetl plik

@ -28,7 +28,8 @@ enum PicoGraphicsDisplay {
DISPLAY_COSMIC_UNICORN,
DISPLAY_STELLAR_UNICORN,
DISPLAY_UNICORN_PACK,
DISPLAY_SCROLL_PACK
DISPLAY_SCROLL_PACK,
DISPLAY_PICO_W_EXPLORER
};
enum PicoGraphicsPenType {