Skip to content

Commit 2dd41c2

Browse files
committed
Remove SPI bus definition from pins.c and board python module for CoreS3 SE and also add a missing file from the previous commit
1 parent affff48 commit 2dd41c2

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

  • ports/espressif/boards

ports/espressif/boards/m5stack_cores3/pins.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@ static const mp_rom_map_elem_t board_module_globals_table[] = {
2929
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
3030

3131
// M5 Bus (except I2S)
32-
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO37) },
33-
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO35) },
34-
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) },
35-
32+
// The SPI bus MISO is also used for the TFT D/C signal, so it is not available for general use
33+
// therefore the SPI bus is not listed on the M5 Bus
3634
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) },
3735
{ MP_ROM_QSTR(MP_QSTR_D44), MP_ROM_PTR(&pin_GPIO44) },
3836

@@ -99,6 +97,8 @@ static const mp_rom_map_elem_t board_module_globals_table[] = {
9997
{ MP_ROM_QSTR(MP_QSTR_CAMERA_XCLK), MP_ROM_PTR(&pin_GPIO2) },
10098

10199
// Display
100+
{ MP_ROM_QSTR(MP_QSTR_TFT_MOSI), MP_ROM_PTR(&pin_GPIO37) },
101+
{ MP_ROM_QSTR(MP_QSTR_TFT_SCK), MP_ROM_PTR(&pin_GPIO36) },
102102
{ MP_ROM_QSTR(MP_QSTR_TFT_CS), MP_ROM_PTR(&pin_GPIO3) },
103103
{ MP_ROM_QSTR(MP_QSTR_TFT_DC), MP_ROM_PTR(&pin_GPIO35) },
104104

@@ -109,7 +109,6 @@ static const mp_rom_map_elem_t board_module_globals_table[] = {
109109

110110
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
111111
{ MP_ROM_QSTR(MP_QSTR_PORTA_I2C), MP_ROM_PTR(&board_porta_i2c_obj) },
112-
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
113112
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
114113

115114
{ MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display)}

ports/espressif/boards/m5stack_cores3_se/board.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ uint8_t display_init_sequence[] = {
3939
};
4040

4141
static bool display_init(void) {
42-
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
4342
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
43+
busio_spi_obj_t *spi = &bus->inline_bus;
44+
common_hal_busio_spi_construct(spi, &pin_GPIO36, &pin_GPIO37, NULL, false);
45+
common_hal_busio_spi_never_reset(spi);
4446
bus->base.type = &fourwire_fourwire_type;
4547

4648
common_hal_fourwire_fourwire_construct(

0 commit comments

Comments
 (0)