Merge pull request #2256 from brentru/master

Switch PyPortal Titano to 8-bit Mode
This commit is contained in:
Brent Rubell 2019-10-31 15:22:47 -04:00 committed by GitHub
commit 08d1019f2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 24 deletions

View File

@ -74,24 +74,21 @@ uint8_t display_init_sequence[] = {
0x11, 0x1d, 0x23, 0x35, 0x41, 0x4b, 0x4b, 0x42, 0x3A,
0x27, 0x1B, 0x08, 0x09, 0x03, 0x00, 0x01,
0x3a, 1, 0x55,
0x36, 1, 0x00,
0x36, 1, 0x60,
0x11, DELAY, 150/5, // Exit Sleep, then delay 150 ms
0x29, DELAY, 50/5
};
void board_init(void) {
busio_spi_obj_t* spi = &displays[0].fourwire_bus.inline_bus;
common_hal_busio_spi_construct(spi, &pin_PA13, &pin_PA12, &pin_PA14);
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t* bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(bus,
spi,
&pin_PB05, // TFT_DC Command or data
&pin_PB06, // TFT_CS Chip select
&pin_PA00, // TFT_RST Reset
24000000);
displayio_parallelbus_obj_t* bus = &displays[0].parallel_bus;
bus->base.type = &displayio_parallelbus_type;
common_hal_displayio_parallelbus_construct(bus,
&pin_PA16, // Data0
&pin_PB05, // Command or data
&pin_PB06, // Chip select
&pin_PB09, // Write
&pin_PB04, // Read
&pin_PA00); // Reset
displayio_display_obj_t* display = &displays[0].display;
display->base.type = &displayio_display_type;
@ -101,7 +98,7 @@ void board_init(void) {
320, // Height
0, // column start
0, // row start
270, // rotation
0, // rotation
16, // Color depth
false, // grayscale
false, // pixels_in_byte_share_row (unused for depths > 8)

View File

@ -3,7 +3,6 @@
#define CIRCUITPY_MCU_FAMILY samd51
#define MICROPY_HW_LED_STATUS (&pin_PA27)
#define MICROPY_HW_NEOPIXEL (&pin_PB22)

View File

@ -80,15 +80,6 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
// TFT control pins
{MP_OBJ_NEW_QSTR(MP_QSTR_TFT_LITE), MP_ROM_PTR(&pin_PB31)},
{MP_OBJ_NEW_QSTR(MP_QSTR_TFT_MOSI), MP_ROM_PTR(&pin_PA12)},
{MP_OBJ_NEW_QSTR(MP_QSTR_TFT_SCK), MP_ROM_PTR(&pin_PA13)},
{MP_OBJ_NEW_QSTR(MP_QSTR_TFT_MISO), MP_ROM_PTR(&pin_PA14)},
{MP_OBJ_NEW_QSTR(MP_QSTR_TFT_RST), MP_ROM_PTR(&pin_PA00)},
{MP_ROM_QSTR(MP_QSTR_TFT_CS), MP_ROM_PTR(&pin_PB06)},
{MP_ROM_QSTR(MP_QSTR_TFT_DC), MP_ROM_PTR(&pin_PB05)},
{ MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table);