Skip to content

Commit 33dcdd7

Browse files
author
Michael Welling
committed
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 <[email protected]>
1 parent d99c2ff commit 33dcdd7

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

ports/nrf/boards/ohs2020_badge/board.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ uint8_t display_init_sequence[] = {
4949

5050
void board_init(void) {
5151
busio_spi_obj_t* spi = &displays[0].fourwire_bus.inline_bus;
52-
common_hal_busio_spi_construct(spi, &pin_P0_14, &pin_P0_15, mp_const_none);
52+
common_hal_busio_spi_construct(spi, &pin_P0_11, &pin_P0_12, mp_const_none);
5353
common_hal_busio_spi_never_reset(spi);
5454

5555
displayio_fourwire_obj_t* bus = &displays[0].fourwire_bus;
@@ -81,7 +81,7 @@ void board_init(void) {
8181
0x37, // set vertical scroll command
8282
display_init_sequence,
8383
sizeof(display_init_sequence),
84-
&pin_P0_02, // backlight pin
84+
NULL, // backlight pin
8585
NO_BRIGHTNESS_COMMAND,
8686
1.0f, // brightness (ignored)
8787
true, // auto_brightness

ports/nrf/boards/ohs2020_badge/pins.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "shared-bindings/board/__init__.h"
2+
#include "shared-module/displayio/__init__.h"
23

34
STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
45
{ 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[] = {
1314

1415
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
1516
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
17+
18+
{ MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display) },
1619
};
1720

1821
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

0 commit comments

Comments
 (0)