Skip to content

Commit e372e2f

Browse files
authored
Merge pull request #9987 from bwshockley/master
Update to Waveshare ESP32-C6 LCD 1.47 to Share SPI
2 parents 04d9c53 + 4422680 commit e372e2f

File tree

1 file changed

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

1 file changed

+3
-12
lines changed

ports/espressif/boards/waveshare_esp32_c6_lcd_1_47/board.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "shared-bindings/fourwire/FourWire.h"
1212
#include "shared-module/displayio/__init__.h"
1313
#include "shared-module/displayio/mipi_constants.h"
14+
#include "shared-bindings/board/__init__.h"
1415

1516
#define DELAY 0x80
1617

@@ -40,18 +41,8 @@ uint8_t display_init_sequence[] = {
4041
};
4142

4243
static void display_init(void) {
44+
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
4345
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-
5546
bus->base.type = &fourwire_fourwire_type;
5647

5748
common_hal_fourwire_fourwire_construct(
@@ -73,7 +64,7 @@ static void display_init(void) {
7364
bus,
7465
172, // width (after rotation)
7566
320, // height (after rotation)
76-
34, // column start
67+
34, // column start
7768
0, // row start
7869
0, // rotation
7970
16, // color depth

0 commit comments

Comments
 (0)