Update TFT experiment for rev b

This commit is contained in:
Jeff Epler 2023-08-09 09:33:20 -05:00
parent 5f12e0f9b8
commit 84aadf3a64
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE
2 changed files with 20 additions and 26 deletions

View File

@ -29,20 +29,16 @@
#define MICROPY_HW_BOARD_NAME "Adafruit-ESP32-S3-RGB-TFT-Experiment"
#define MICROPY_HW_MCU_NAME "ESP32S3"
#define DEFAULT_I2C_BUS_SDA (&pin_GPIO3)
#define DEFAULT_I2C_BUS_SCL (&pin_GPIO6)
#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO7)
#define DEFAULT_SPI_BUS_SCK (&pin_GPIO6)
#define DEFAULT_SPI_BUS_MISO (&pin_GPIO16)
#define DEFAULT_I2C_BUS_SDA (&pin_GPIO8)
#define DEFAULT_I2C_BUS_SCL (&pin_GPIO18)
// UART pins attached to the USB-serial converter chip
#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO43)
#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO44)
#define MICROPY_HW_NEOPIXEL (&pin_GPIO4)
#define MICROPY_HW_NEOPIXEL (&pin_GPIO4) // also DBLTAP
#define DOUBLE_TAP_PIN (&pin_GPIO5)
#define DOUBLE_TAP_PIN (&pin_GPIO4) // also NEOPIXEL
// a 1024x768 16BPP framebuffer + some breathing room
#define DEFAULT_RESERVED_PSRAM (1024 * 1024 * 2)

View File

@ -5,11 +5,11 @@ STATIC const mp_rom_obj_tuple_t tft_r_pins = {
{&mp_type_tuple},
5,
{
MP_ROM_PTR(&pin_GPIO13),
MP_ROM_PTR(&pin_GPIO12),
MP_ROM_PTR(&pin_GPIO11),
MP_ROM_PTR(&pin_GPIO10),
MP_ROM_PTR(&pin_GPIO9),
MP_ROM_PTR(&pin_GPIO46),
MP_ROM_PTR(&pin_GPIO3),
}
};
@ -17,12 +17,12 @@ STATIC const mp_rom_obj_tuple_t tft_g_pins = {
{&mp_type_tuple},
6,
{
MP_ROM_PTR(&pin_GPIO5), // XXX fixed in rev b
MP_ROM_PTR(&pin_GPIO45),
MP_ROM_PTR(&pin_GPIO48),
MP_ROM_PTR(&pin_GPIO47),
MP_ROM_PTR(&pin_GPIO21),
MP_ROM_PTR(&pin_GPIO14),
MP_ROM_PTR(&pin_GPIO13),
MP_ROM_PTR(&pin_GPIO12),
}
};
@ -30,11 +30,11 @@ STATIC const mp_rom_obj_tuple_t tft_b_pins = {
{&mp_type_tuple},
5,
{
MP_ROM_PTR(&pin_GPIO5), // XXX fixed in rev b
MP_ROM_PTR(&pin_GPIO5), // XXX fixed in rev b
MP_ROM_PTR(&pin_GPIO40),
MP_ROM_PTR(&pin_GPIO39),
MP_ROM_PTR(&pin_GPIO38),
MP_ROM_PTR(&pin_GPIO0),
MP_ROM_PTR(&pin_GPIO45),
}
};
@ -59,22 +59,20 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) },
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) },
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(DEFAULT_I2C_BUS_SDA) },
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(DEFAULT_I2C_BUS_SDA) },
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(DEFAULT_I2C_BUS_SCL) },
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(DEFAULT_SPI_BUS_MOSI) },
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(DEFAULT_SPI_BUS_MISO) },
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(DEFAULT_SPI_BUS_SCK) },
{ MP_ROM_QSTR(MP_QSTR_LCD_CS), MP_ROM_PTR(&pin_GPIO16) },
// boot mode button can be used in SW as well
{ MP_ROM_QSTR(MP_QSTR_BUTTON_UP), MP_ROM_PTR(&pin_GPIO0) },
{ MP_ROM_QSTR(MP_QSTR_BUTTON_DOWN), MP_ROM_PTR(&pin_GPIO5) },
{ MP_ROM_QSTR(MP_QSTR_TP_IRQ), MP_ROM_PTR(&pin_GPIO9) },
// I/O expander pin numbers
{ MP_ROM_QSTR(MP_QSTR_TFT_SCK), MP_ROM_INT(0) },
{ MP_ROM_QSTR(MP_QSTR_TFT_CS), MP_ROM_INT(1) },
{ MP_ROM_QSTR(MP_QSTR_TFT_RESET), MP_ROM_INT(2) },
{ MP_ROM_QSTR(MP_QSTR_TP_IRQ), MP_ROM_INT(3) },
{ MP_ROM_QSTR(MP_QSTR_BACKLIGHT), MP_ROM_INT(4) },
{ MP_ROM_QSTR(MP_QSTR_BTN_UP), MP_ROM_INT(5) },
{ MP_ROM_QSTR(MP_QSTR_BTN_DN), MP_ROM_INT(6) },
{ MP_ROM_QSTR(MP_QSTR_TFT_MOSI), MP_ROM_INT(7) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
{ MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) },
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);