Fix board inits

This commit is contained in:
Scott Shawcroft 2023-04-21 13:23:01 -07:00
parent 7089ea4d65
commit d5b747b305
No known key found for this signature in database
GPG Key ID: 0DFD512649C052DA
56 changed files with 136 additions and 138 deletions

View File

@ -69,7 +69,7 @@ uint8_t display_init_sequence[] = {
};
void board_init(void) {
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
bus->base.type = &displayio_fourwire_type;
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
common_hal_busio_spi_never_reset(spi);
@ -82,7 +82,7 @@ void board_init(void) {
0, // Polarity
0); // Phase
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(display,
bus,

View File

@ -47,11 +47,11 @@ uint8_t display_init_sequence[] = {
};
void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
busio_spi_obj_t *spi = &bus->inline_bus;
common_hal_busio_spi_construct(spi, &pin_PA01, &pin_PA00, NULL, false);
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(bus,
spi,
@ -62,7 +62,7 @@ void board_init(void) {
0, // Polarity
0); // Phase
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(display,
bus,

View File

@ -48,11 +48,11 @@ uint8_t display_init_sequence[] = {
};
void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
busio_spi_obj_t *spi = &bus->inline_bus;
common_hal_busio_spi_construct(spi, &pin_PA13, &pin_PA12, NULL, false);
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(bus,
spi,
@ -63,7 +63,7 @@ void board_init(void) {
0, // Polarity
0); // Phase
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(display,
bus,

View File

@ -57,11 +57,11 @@ uint8_t refresh_sequence[] = {
};
void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
busio_spi_obj_t *spi = &bus->inline_bus;
common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB15, NULL, false);
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(bus,
spi,
@ -72,7 +72,7 @@ void board_init(void) {
0, // Polarity
0); // Phase
displayio_epaperdisplay_obj_t *display = &displays[0].epaper_display;
displayio_epaperdisplay_obj_t *display = &allocate_display()->epaper_display;
display->base.type = &displayio_epaperdisplay_type;
common_hal_displayio_epaperdisplay_construct(display,
bus,

View File

@ -46,11 +46,11 @@ uint8_t display_init_sequence[] = {
};
void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
busio_spi_obj_t *spi = &bus->inline_bus;
common_hal_busio_spi_construct(spi, &pin_PA23, &pin_PA22, NULL, false);
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(bus,
spi,
@ -61,7 +61,7 @@ void board_init(void) {
0, // Polarity
0); // Phase
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(display,
bus,

View File

@ -97,11 +97,11 @@ uint8_t display_init_sequence[] = {
};
void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
busio_spi_obj_t *spi = &bus->inline_bus;
common_hal_busio_spi_construct(spi, &pin_PA13, &pin_PA15, NULL, false);
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(bus,
spi,
@ -115,7 +115,7 @@ void board_init(void) {
uint32_t cfg0 = lookupCfg(CFG_DISPLAY_CFG0, 0x000000);
uint32_t offX = (cfg0 >> 8) & 0xff;
uint32_t offY = (cfg0 >> 16) & 0xff;
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(display,
bus,

View File

@ -68,11 +68,11 @@ uint8_t display_init_sequence[] = {
};
void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
busio_spi_obj_t *spi = &bus->inline_bus;
common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB15, NULL, false);
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(bus,
spi,
@ -83,7 +83,7 @@ void board_init(void) {
0, // Polarity
0); // Phase
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(display,
bus,

View File

@ -70,11 +70,11 @@ uint8_t display_init_sequence[] = {
};
void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
busio_spi_obj_t *spi = &bus->inline_bus;
common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB15, NULL, false);
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(bus,
spi,
@ -85,7 +85,7 @@ void board_init(void) {
0, // Polarity
0); // Phase
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(display,
bus,

View File

@ -61,7 +61,7 @@ uint8_t display_init_sequence[] = {
};
void board_init(void) {
paralleldisplay_parallelbus_obj_t *bus = &displays[0].parallel_bus;
paralleldisplay_parallelbus_obj_t *bus = &allocate_display_bus()->parallel_bus;
bus->base.type = &paralleldisplay_parallelbus_type;
common_hal_paralleldisplay_parallelbus_construct(bus,
&pin_PA16, // Data0
@ -72,7 +72,7 @@ void board_init(void) {
&pin_PA00, // Reset
0); // Frequency
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(display,
bus,

View File

@ -78,7 +78,7 @@ uint8_t display_init_sequence[] = {
};
void board_init(void) {
paralleldisplay_parallelbus_obj_t *bus = &displays[0].parallel_bus;
paralleldisplay_parallelbus_obj_t *bus = &allocate_display_bus()->parallel_bus;
bus->base.type = &paralleldisplay_parallelbus_type;
common_hal_paralleldisplay_parallelbus_construct(bus,
&pin_PA16, // Data0
@ -89,7 +89,7 @@ void board_init(void) {
&pin_PA00, // Reset
0); // Frequency
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(display,
bus,

View File

@ -65,11 +65,11 @@ uint8_t display_init_sequence[] = {
};
void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
busio_spi_obj_t *spi = &bus->inline_bus;
common_hal_busio_spi_construct(spi, &pin_PB20, &pin_PB19, NULL, false);
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(bus,
spi,
@ -80,7 +80,7 @@ void board_init(void) {
0, // Polarity
0); // Phase
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(display,
bus,

View File

@ -70,7 +70,7 @@ uint8_t display_init_sequence[] = {
};
void board_init(void) {
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
bus->base.type = &displayio_fourwire_type;
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
common_hal_displayio_fourwire_construct(bus,
@ -82,7 +82,7 @@ void board_init(void) {
0, // Polarity
0); // Phase
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(display,
bus,

View File

@ -36,7 +36,7 @@ void board_init(void) {
fb->base.type = &videocore_framebuffer_type;
common_hal_videocore_framebuffer_construct(fb, 640, 480);
framebufferio_framebufferdisplay_obj_t *display = &displays[0].framebuffer_display;
framebufferio_framebufferdisplay_obj_t *display = &allocate_display()->framebuffer_display;
display->base.type = &framebufferio_framebufferdisplay_type;
common_hal_framebufferio_framebufferdisplay_construct(
display,

View File

@ -36,7 +36,7 @@ void board_init(void) {
fb->base.type = &videocore_framebuffer_type;
common_hal_videocore_framebuffer_construct(fb, 640, 480);
framebufferio_framebufferdisplay_obj_t *display = &displays[0].framebuffer_display;
framebufferio_framebufferdisplay_obj_t *display = &allocate_display()->framebuffer_display;
display->base.type = &framebufferio_framebufferdisplay_type;
common_hal_framebufferio_framebufferdisplay_construct(
display,

View File

@ -36,7 +36,7 @@ void board_init(void) {
fb->base.type = &videocore_framebuffer_type;
common_hal_videocore_framebuffer_construct(fb, 640, 480);
framebufferio_framebufferdisplay_obj_t *display = &displays[0].framebuffer_display;
framebufferio_framebufferdisplay_obj_t *display = &allocate_display()->framebuffer_display;
display->base.type = &framebufferio_framebufferdisplay_type;
common_hal_framebufferio_framebufferdisplay_construct(
display,

View File

@ -36,7 +36,7 @@ void board_init(void) {
fb->base.type = &videocore_framebuffer_type;
common_hal_videocore_framebuffer_construct(fb, 640, 480);
framebufferio_framebufferdisplay_obj_t *display = &displays[0].framebuffer_display;
framebufferio_framebufferdisplay_obj_t *display = &allocate_display()->framebuffer_display;
display->base.type = &framebufferio_framebufferdisplay_type;
common_hal_framebufferio_framebufferdisplay_construct(
display,

View File

@ -36,7 +36,7 @@ void board_init(void) {
fb->base.type = &videocore_framebuffer_type;
common_hal_videocore_framebuffer_construct(fb, 640, 480);
framebufferio_framebufferdisplay_obj_t *display = &displays[0].framebuffer_display;
framebufferio_framebufferdisplay_obj_t *display = &allocate_display()->framebuffer_display;
display->base.type = &framebufferio_framebufferdisplay_type;
common_hal_framebufferio_framebufferdisplay_construct(
display,

View File

@ -36,7 +36,7 @@ void board_init(void) {
fb->base.type = &videocore_framebuffer_type;
common_hal_videocore_framebuffer_construct(fb, 640, 480);
framebufferio_framebufferdisplay_obj_t *display = &displays[0].framebuffer_display;
framebufferio_framebufferdisplay_obj_t *display = &allocate_display()->framebuffer_display;
display->base.type = &framebufferio_framebufferdisplay_type;
common_hal_framebufferio_framebufferdisplay_construct(
display,

View File

@ -36,7 +36,7 @@ void board_init(void) {
fb->base.type = &videocore_framebuffer_type;
common_hal_videocore_framebuffer_construct(fb, 640, 480);
framebufferio_framebufferdisplay_obj_t *display = &displays[0].framebuffer_display;
framebufferio_framebufferdisplay_obj_t *display = &allocate_display()->framebuffer_display;
display->base.type = &framebufferio_framebufferdisplay_type;
common_hal_framebufferio_framebufferdisplay_construct(
display,

View File

@ -55,11 +55,11 @@ void board_init(void) {
busio_i2c_obj_t *i2c = common_hal_board_create_i2c(0);
// What we would do if it wasn't the shared board I2C: (for reference)
// busio_i2c_obj_t *i2c = &displays[0].i2cdisplay_bus.inline_bus;
// busio_i2c_obj_t *i2c = &allocate_display_bus()->i2cdisplay_bus.inline_bus;
// common_hal_busio_i2c_construct(i2c, &pin_GPIO23, &pin_GPIO22, 100000, 0);
// common_hal_busio_i2c_never_reset(i2c);
displayio_i2cdisplay_obj_t *bus = &displays[0].i2cdisplay_bus;
displayio_i2cdisplay_obj_t *bus = &allocate_display_bus()->i2cdisplay_bus;
bus->base.type = &displayio_i2cdisplay_type;
common_hal_displayio_i2cdisplay_construct(bus,
i2c,
@ -67,7 +67,7 @@ void board_init(void) {
NULL
);
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(display,
bus,

View File

@ -52,7 +52,7 @@ uint8_t display_init_sequence[] = {
void board_init(void) {
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(bus,
spi,
@ -63,7 +63,7 @@ void board_init(void) {
0, // Polarity
0); // Phase
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(
display,

View File

@ -72,7 +72,7 @@ uint8_t display_init_sequence[] = {
void board_init(void) {
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(
@ -85,7 +85,7 @@ void board_init(void) {
0, // polarity
0 // phase
);
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(

View File

@ -72,7 +72,7 @@ uint8_t display_init_sequence[] = {
void board_init(void) {
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(
@ -85,7 +85,7 @@ void board_init(void) {
0, // polarity
0 // phase
);
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(

View File

@ -72,7 +72,7 @@ uint8_t display_init_sequence[] = {
void board_init(void) {
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(
@ -85,7 +85,7 @@ void board_init(void) {
0, // polarity
0 // phase
);
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(

View File

@ -72,7 +72,7 @@ uint8_t display_init_sequence[] = {
void board_init(void) {
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(
@ -85,7 +85,7 @@ void board_init(void) {
0, // polarity
0 // phase
);
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(

View File

@ -56,11 +56,11 @@ void board_init(void) {
common_hal_never_reset_pin(&pin_GPIO38);
#endif /* DEBUG */
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
busio_spi_obj_t *spi = &bus->inline_bus;
common_hal_busio_spi_construct(spi, &pin_GPIO36, &pin_GPIO35, NULL, false);
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(bus,
spi,
@ -71,7 +71,7 @@ void board_init(void) {
0, // Polarity
0); // Phase
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(
display,

View File

@ -120,11 +120,11 @@ void board_init(void) {
common_hal_never_reset_pin(&pin_GPIO44);
#endif /* DEBUG */
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
busio_spi_obj_t *spi = &bus->inline_bus;
common_hal_busio_spi_construct(spi, &pin_GPIO36, &pin_GPIO35, NULL, false);
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(bus,
spi,
@ -135,7 +135,7 @@ void board_init(void) {
0, // Polarity
0); // Phase
displayio_epaperdisplay_obj_t *display = &displays[0].epaper_display;
displayio_epaperdisplay_obj_t *display = &allocate_display()->epaper_display;
display->base.type = &displayio_epaperdisplay_type;
common_hal_displayio_epaperdisplay_construct(
display,

View File

@ -43,11 +43,11 @@ uint8_t display_init_sequence[] = {
};
void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_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, &pin_GPIO6, NULL, false);
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(bus,
spi,
@ -58,7 +58,7 @@ void board_init(void) {
0, // Polarity
0); // Phase
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(display,
bus,

View File

@ -44,11 +44,11 @@ uint8_t display_init_sequence[] = {
};
void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_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, &pin_GPIO6, NULL, false);
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(bus,
spi,
@ -59,7 +59,7 @@ void board_init(void) {
0, // Polarity
0); // Phase
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(display,
bus,

View File

@ -71,7 +71,7 @@ uint8_t display_init_sequence[] = {
void board_init(void) {
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(
@ -84,7 +84,7 @@ void board_init(void) {
0, // polarity
0 // phase
);
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(

View File

@ -71,11 +71,11 @@ uint8_t display_init_sequence[] = {
};
void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
busio_spi_obj_t *spi = &bus->inline_bus;
common_hal_busio_spi_construct(spi, &pin_GPIO6, &pin_GPIO7, NULL, false);
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(bus,
spi,
@ -86,7 +86,7 @@ void board_init(void) {
0, // Polarity
0); // Phase
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(display,
bus,

View File

@ -63,11 +63,11 @@ uint8_t display_init_sequence[] = {
};
void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
busio_spi_obj_t *spi = &bus->inline_bus;
common_hal_busio_spi_construct(spi, &pin_GPIO18, &pin_GPIO23, NULL, false);
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(bus,
spi,
@ -78,7 +78,7 @@ void board_init(void) {
0, // Polarity
0); // Phase
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(display,
bus,

View File

@ -72,7 +72,7 @@ uint8_t display_init_sequence[] = {
void board_init(void) {
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(
@ -85,7 +85,7 @@ void board_init(void) {
0, // polarity
0 // phase
);
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(

View File

@ -65,7 +65,8 @@ uint8_t display_init_sequence[] = {
};
static void display_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
busio_spi_obj_t *spi = &bus->inline_bus;
common_hal_busio_spi_construct(
spi,
@ -76,7 +77,6 @@ static void display_init(void) {
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(
@ -90,7 +90,7 @@ static void display_init(void) {
0 // phase
);
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(

View File

@ -43,11 +43,11 @@ uint8_t display_init_sequence[] = {
};
void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
busio_spi_obj_t *spi = &bus->inline_bus;
common_hal_busio_spi_construct(spi, &pin_GPIO12, &pin_GPIO11, NULL, false);
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(bus,
spi,
@ -58,7 +58,7 @@ void board_init(void) {
0, // Polarity
0); // Phase
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(display,
bus,

View File

@ -65,7 +65,8 @@ uint8_t display_init_sequence[] = {
};
static void display_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
busio_spi_obj_t *spi = &bus->inline_bus;
common_hal_busio_spi_construct(
spi,
@ -76,7 +77,6 @@ static void display_init(void) {
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(
@ -90,7 +90,7 @@ static void display_init(void) {
0 // phase
);
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(

View File

@ -45,7 +45,8 @@ uint8_t display_init_sequence[] = {
};
static void display_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
busio_spi_obj_t *spi = &bus->inline_bus;
common_hal_busio_spi_construct(
spi,
@ -56,7 +57,6 @@ static void display_init(void) {
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(
@ -71,7 +71,7 @@ static void display_init(void) {
0 // phase
);
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(

View File

@ -48,7 +48,8 @@ uint8_t display_init_sequence[] = {
};
static void display_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
busio_spi_obj_t *spi = &bus->inline_bus;
common_hal_busio_spi_construct(
spi,
@ -60,7 +61,6 @@ static void display_init(void) {
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(
@ -74,7 +74,7 @@ static void display_init(void) {
0 // phase
);
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(

View File

@ -54,7 +54,7 @@ uint8_t display_init_sequence[] = { // SSD1306
static void display_init(void) {
busio_i2c_obj_t *i2c = common_hal_board_create_i2c(0);
displayio_i2cdisplay_obj_t *bus = &displays[0].i2cdisplay_bus;
displayio_i2cdisplay_obj_t *bus = &allocate_display_bus()->i2cdisplay_bus;
bus->base.type = &displayio_i2cdisplay_type;
common_hal_displayio_i2cdisplay_construct(bus,
i2c,
@ -62,7 +62,7 @@ static void display_init(void) {
&pin_GPIO18 // reset
);
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(display,
bus,

View File

@ -333,7 +333,7 @@ static bool pmic_init(busio_i2c_obj_t *i2c) {
static bool display_init(void) {
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(
@ -347,7 +347,7 @@ static bool display_init(void) {
0 // phase
);
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(

View File

@ -57,7 +57,7 @@ uint8_t display_init_sequence[] = {
void board_init(void) {
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(
@ -71,7 +71,7 @@ void board_init(void) {
0 // phase
);
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(

View File

@ -57,7 +57,7 @@ uint8_t display_init_sequence[] = {
void board_init(void) {
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(
@ -71,7 +71,7 @@ void board_init(void) {
0 // phase
);
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(

View File

@ -165,11 +165,11 @@ static bool pmic_init(busio_i2c_obj_t *i2c) {
}
static bool display_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
busio_spi_obj_t *spi = &bus->inline_bus;
common_hal_busio_spi_construct(spi, &pin_GPIO13, &pin_GPIO15, NULL, false);
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(
@ -183,7 +183,7 @@ static bool display_init(void) {
0 // phase
);
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(

View File

@ -147,7 +147,8 @@ void board_init(void) {
// Display
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
busio_spi_obj_t *spi = &bus->inline_bus;
common_hal_busio_spi_construct(
spi,
@ -158,7 +159,6 @@ void board_init(void) {
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(
@ -172,7 +172,7 @@ void board_init(void) {
0 // phase
);
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(
display,

View File

@ -64,7 +64,8 @@ uint8_t display_init_sequence[] = {
};
static void display_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
busio_spi_obj_t *spi = &bus->inline_bus;
common_hal_busio_spi_construct(
spi,
@ -75,7 +76,6 @@ static void display_init(void) {
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(
@ -89,7 +89,7 @@ static void display_init(void) {
0 // phase
);
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(

View File

@ -47,11 +47,11 @@ uint8_t display_init_sequence[] = {
};
void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
busio_spi_obj_t *spi = &bus->inline_bus;
common_hal_busio_spi_construct(spi, &pin_P0_14, &pin_P0_15, NULL, false);
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(bus,
spi,
@ -62,7 +62,7 @@ void board_init(void) {
0, // Polarity
0); // Phase
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(display,
bus,

View File

@ -47,11 +47,11 @@ uint8_t display_init_sequence[] = {
};
void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
busio_spi_obj_t *spi = &bus->inline_bus;
common_hal_busio_spi_construct(spi, &pin_P0_07, &pin_P1_08, NULL, false); // SCK, MOSI, MISO, not half-duplex
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(bus,
spi,
@ -63,7 +63,7 @@ void board_init(void) {
0, // Polarity
0); // Phase
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(display,
bus,

View File

@ -48,11 +48,11 @@ uint8_t display_init_sequence[] = {
};
void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
busio_spi_obj_t *spi = &bus->inline_bus;
common_hal_busio_spi_construct(spi, &pin_P0_11, &pin_P0_12, NULL, false);
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(bus,
spi,
@ -63,7 +63,7 @@ void board_init(void) {
0, // Polarity
0); // Phase
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(display,
bus,

View File

@ -47,11 +47,11 @@ uint8_t display_init_sequence[] = {
};
void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
busio_spi_obj_t *spi = &bus->inline_bus;
common_hal_busio_spi_construct(spi, &pin_P0_11, &pin_P0_12, NULL, false);
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(bus,
spi,
@ -62,7 +62,7 @@ void board_init(void) {
0, // Polarity
0); // Phase
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(display,
bus,

View File

@ -40,7 +40,7 @@ void board_init(void) {
&pin_GPIO23, &pin_GPIO22,
8);
framebufferio_framebufferdisplay_obj_t *display = &displays[0].framebuffer_display;
framebufferio_framebufferdisplay_obj_t *display = &allocate_display()->framebuffer_display;
display->base.type = &framebufferio_framebufferdisplay_type;
common_hal_framebufferio_framebufferdisplay_construct(
display,

View File

@ -59,11 +59,11 @@ uint8_t display_init_sequence[] = {
};
void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
busio_spi_obj_t *spi = &bus->inline_bus;
common_hal_busio_spi_construct(spi, &pin_GPIO26, &pin_GPIO27, NULL, false);
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(bus,
spi,
@ -74,7 +74,7 @@ void board_init(void) {
0, // Polarity
0); // Phase
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(display,
bus,

View File

@ -78,11 +78,11 @@ uint8_t display_init_sequence[] = {
void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
busio_spi_obj_t *spi = &bus->inline_bus;
common_hal_busio_spi_construct(spi, &pin_GPIO18, &pin_GPIO19, &pin_GPIO16, false);
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(bus,
spi,
@ -93,7 +93,7 @@ void board_init(void) {
0,
0);
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(display,
bus,

View File

@ -274,12 +274,12 @@ void board_init(void) {
common_hal_digitalio_digitalinout_never_reset(&enable_pin_obj);
// Set up the SPI object used to control the display
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
busio_spi_obj_t *spi = &bus->inline_bus;
common_hal_busio_spi_construct(spi, &pin_GPIO18, &pin_GPIO19, &pin_GPIO16, false);
common_hal_busio_spi_never_reset(spi);
// Set up the DisplayIO pin object
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(bus,
spi,
@ -291,7 +291,7 @@ void board_init(void) {
0); // Phase
// Set up the DisplayIO epaper object
displayio_epaperdisplay_obj_t *display = &displays[0].epaper_display;
displayio_epaperdisplay_obj_t *display = &allocate_display()->epaper_display;
display->base.type = &displayio_epaperdisplay_type;
common_hal_displayio_epaperdisplay_construct(
display,
@ -329,10 +329,8 @@ void board_init(void) {
void board_deinit(void) {
displayio_epaperdisplay_obj_t *display = &displays[0].epaper_display;
if (display->base.type == &displayio_epaperdisplay_type) {
size_t i = 0;
while (common_hal_displayio_epaperdisplay_get_busy(display)) {
RUN_BACKGROUND_TASKS;
i++;
}
}
common_hal_displayio_release_displays();

View File

@ -64,11 +64,11 @@ uint8_t display_init_sequence[] = {
};
void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
busio_spi_obj_t *spi = &bus->inline_bus;
common_hal_busio_spi_construct(spi, &pin_GPIO6, &pin_GPIO7, NULL, false);
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(bus,
spi,
@ -79,7 +79,7 @@ void board_init(void) {
0, // Polarity
0); // Phase
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(display,
bus,

View File

@ -63,7 +63,8 @@ uint8_t display_init_sequence[] = {
};
static void display_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
busio_spi_obj_t *spi = &bus->inline_bus;
common_hal_busio_spi_construct(
spi,
&pin_GPIO10, // CLK
@ -74,7 +75,6 @@ static void display_init(void) {
common_hal_busio_spi_never_reset(spi);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;
common_hal_displayio_fourwire_construct(
@ -88,7 +88,7 @@ static void display_init(void) {
0 // phase
);
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(
display,

View File

@ -70,7 +70,7 @@ uint8_t display_init_sequence[] = {
};
void board_init(void) {
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
bus->base.type = &displayio_fourwire_type;
busio_spi_obj_t *internal_spi = &supervisor_flash_spi_bus;
common_hal_displayio_fourwire_construct(bus,
@ -82,7 +82,7 @@ void board_init(void) {
0, // Polarity
0); // Phase
displayio_display_obj_t *display = &displays[0].display;
displayio_display_obj_t *display = &allocate_display()->display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(display,
bus,