Skip to content

Commit f93d9d3

Browse files
authored
Update board.c
Updated initialization of SPI to display in order to support using it for the SD Card as well.
1 parent 25ef665 commit f93d9d3

File tree

1 file changed

+2
-12
lines changed
  • ports/espressif/boards/waveshare_esp32_c6_lcd_1_47

1 file changed

+2
-12
lines changed

ports/espressif/boards/waveshare_esp32_c6_lcd_1_47/board.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,8 @@ uint8_t display_init_sequence[] = {
4040
};
4141

4242
static void display_init(void) {
43+
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
4344
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
44-
busio_spi_obj_t *spi = &bus->inline_bus;
45-
46-
common_hal_busio_spi_construct(
47-
spi,
48-
&pin_GPIO7, // CLK
49-
&pin_GPIO6, // MOSI
50-
NULL, // MISO not connected
51-
false); // Not half-duplex
52-
53-
common_hal_busio_spi_never_reset(spi);
54-
5545
bus->base.type = &fourwire_fourwire_type;
5646

5747
common_hal_fourwire_fourwire_construct(
@@ -73,7 +63,7 @@ static void display_init(void) {
7363
bus,
7464
172, // width (after rotation)
7565
320, // height (after rotation)
76-
34, // column start
66+
34, // column start
7767
0, // row start
7868
0, // rotation
7969
16, // color depth

0 commit comments

Comments
 (0)