From 39ca7f0d9794291cf04ab2adb117e2c7d2570a64 Mon Sep 17 00:00:00 2001 From: Lovro Jakic Date: Tue, 9 Jul 2024 15:16:52 +0200 Subject: [PATCH] Added I2C support and removed backlight pin --- ports/espressif/boards/vidi_x/board.c | 2 +- ports/espressif/boards/vidi_x/mpconfigboard.h | 3 +++ ports/espressif/boards/vidi_x/pins.c | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ports/espressif/boards/vidi_x/board.c b/ports/espressif/boards/vidi_x/board.c index 141a891d5739..596bb044a0d9 100644 --- a/ports/espressif/boards/vidi_x/board.c +++ b/ports/espressif/boards/vidi_x/board.c @@ -98,7 +98,7 @@ void board_init(void) { MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command display_init_sequence, sizeof(display_init_sequence), - &pin_GPIO14, // backlight pin + NULL, // backlight pin NO_BRIGHTNESS_COMMAND, 1.0f, // brightness false, // single_byte_bounds diff --git a/ports/espressif/boards/vidi_x/mpconfigboard.h b/ports/espressif/boards/vidi_x/mpconfigboard.h index d0e9f8ba1c52..caa0db460e86 100644 --- a/ports/espressif/boards/vidi_x/mpconfigboard.h +++ b/ports/espressif/boards/vidi_x/mpconfigboard.h @@ -34,6 +34,9 @@ #define CIRCUITPY_BOARD_SPI (1) #define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO18, .mosi = &pin_GPIO23, .miso = &pin_GPIO19}} +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO32, .sda = &pin_GPIO33}} + #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) // Explanation of how a user got into safe mode diff --git a/ports/espressif/boards/vidi_x/pins.c b/ports/espressif/boards/vidi_x/pins.c index 0ff2e53fa13b..0ed6852fc14c 100644 --- a/ports/espressif/boards/vidi_x/pins.c +++ b/ports/espressif/boards/vidi_x/pins.c @@ -103,6 +103,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_EXP26), MP_ROM_PTR(&pin_GPIO39) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { 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_DISPLAY), MP_ROM_PTR(&displays[0].display)}, };