Updates to enable working SPI TFT
The backlight enable is active low on our board so the driver doesn't like it. Toggling to GPIO manually for now. As fixed the improper SPI bus pins definitions and it works! Signed-off-by: Michael Welling <mwelling@ieee.org>
This commit is contained in:
parent
d99c2ffe4f
commit
33dcdd7c03
|
@ -49,7 +49,7 @@ uint8_t display_init_sequence[] = {
|
|||
|
||||
void board_init(void) {
|
||||
busio_spi_obj_t* spi = &displays[0].fourwire_bus.inline_bus;
|
||||
common_hal_busio_spi_construct(spi, &pin_P0_14, &pin_P0_15, mp_const_none);
|
||||
common_hal_busio_spi_construct(spi, &pin_P0_11, &pin_P0_12, mp_const_none);
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
displayio_fourwire_obj_t* bus = &displays[0].fourwire_bus;
|
||||
|
@ -81,7 +81,7 @@ void board_init(void) {
|
|||
0x37, // set vertical scroll command
|
||||
display_init_sequence,
|
||||
sizeof(display_init_sequence),
|
||||
&pin_P0_02, // backlight pin
|
||||
NULL, // backlight pin
|
||||
NO_BRIGHTNESS_COMMAND,
|
||||
1.0f, // brightness (ignored)
|
||||
true, // auto_brightness
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "shared-bindings/board/__init__.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
|
||||
STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
|
||||
{ MP_ROM_QSTR(MP_QSTR_MICROPHONE_CLOCK), MP_ROM_PTR(&pin_P0_25) },
|
||||
|
@ -13,6 +14,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
|
|||
|
||||
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
|
||||
|
||||
{ MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display) },
|
||||
};
|
||||
|
||||
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);
|
||||
|
|
Loading…
Reference in New Issue