Merge pull request #5846 from jepler/feather-esp32s2-tft-spi

feather esp32s2 tft: fix sharing of main display bus
This commit is contained in:
Dan Halbert 2022-01-12 23:05:42 -05:00 committed by GitHub
commit 59275c7225
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,6 +31,7 @@
#include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/Pin.h"
#include "shared-module/displayio/__init__.h" #include "shared-module/displayio/__init__.h"
#include "shared-module/displayio/mipi_constants.h" #include "shared-module/displayio/mipi_constants.h"
#include "shared-bindings/board/__init__.h"
displayio_fourwire_obj_t board_display_obj; displayio_fourwire_obj_t board_display_obj;
@ -81,17 +82,7 @@ void board_init(void) {
gpio_set_direction(21, GPIO_MODE_DEF_OUTPUT); gpio_set_direction(21, GPIO_MODE_DEF_OUTPUT);
gpio_set_level(21, true); gpio_set_level(21, true);
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus; busio_spi_obj_t *spi = common_hal_board_create_spi();
common_hal_busio_spi_construct(
spi,
&pin_GPIO36, // CLK
&pin_GPIO35, // MOSI
NULL // MISO not connected
);
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus; displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type; bus->base.type = &displayio_fourwire_type;