Update board.c
Updated initialization of SPI to display in order to support using it for the SD Card as well.
This commit is contained in:
parent
25ef6653ef
commit
f93d9d3d86
1 changed files with 2 additions and 12 deletions
|
|
@ -40,18 +40,8 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
static void display_init(void) {
|
||||
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
|
||||
common_hal_busio_spi_construct(
|
||||
spi,
|
||||
&pin_GPIO7, // CLK
|
||||
&pin_GPIO6, // MOSI
|
||||
NULL, // MISO not connected
|
||||
false); // Not half-duplex
|
||||
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
|
||||
common_hal_fourwire_fourwire_construct(
|
||||
|
|
@ -73,7 +63,7 @@ static void display_init(void) {
|
|||
bus,
|
||||
172, // width (after rotation)
|
||||
320, // height (after rotation)
|
||||
34, // column start
|
||||
34, // column start
|
||||
0, // row start
|
||||
0, // rotation
|
||||
16, // color depth
|
||||
|
|
|
|||
Loading…
Reference in a new issue