10000 Merge pull request #2576 from oshwabadge2020/ohs2020-badge-new · pdp7/circuitpython@97de075 · GitHub
[go: up one dir, main page]

Skip to content

Commit 97de075

Browse files
authored
Merge pull request adafruit#2576 from oshwabadge2020/ohs2020-badge-new
Ohs2020 badge updates
2 parents 3aed0a1 + 64cafe8 commit 97de075

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed

ports/nrf/boards/ohs2020_badge/board.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ displayio_fourwire_obj_t board_display_obj;
4040
uint8_t display_init_sequence[] = {
4141
0x01, 0 | DELAY, 150, // SWRESET
4242
0x11, 0 | DELAY, 255, // SLPOUT
43-
0x36, 1, 0x00, // _MADCTL bottom to top refresh in vsync aligned order.
43+
0x36, 1, 0b10100000, // _MADCTL bottom to top refresh in vsync aligned order.
4444
0x3a, 1, 0x55, // COLMOD - 16bit color
4545
0x21, 0 | DELAY, 10, // _INVON
4646
0x13, 0 | DELAY, 10, // _NORON
@@ -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;
@@ -67,9 +67,9 @@ void board_init(void) {
6767
bus,
6868
240, // Width (after rotation)
6969
240, // Height (after rotation)
70-
0, // column start
70+
80, // column start
7171
0, // row start
72-
270, // rotation
72+
0, // rotation
7373
16, // Color depth
7474
false, // Grayscale
7575
false, // Pixels in a byte share a row. Only used for depth < 8
@@ -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/mpconfigboard.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
#define MICROPY_HW_MCU_NAME "nRF52840"
3333

3434
#if QSPI_FLASH_FILESYSTEM
35-
#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(0, 22)
36-
#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(1, 0)
35+
#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(1, 0)
36+
#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 22)
3737
#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(0, 20)
3838
#define MICROPY_QSPI_DATA3 NRF_GPIO_PIN_MAP(1, 2)
3939
#define MICROPY_QSPI_SCK NRF_GPIO_PIN_MAP(1, 1)

ports/nrf/boards/ohs2020_badge/mpconfigboard.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ MCU_CHIP = nrf52840
77

88
QSPI_FLASH_FILESYSTEM = 1
99
EXTERNAL_FLASH_DEVICE_COUNT = 1
10-
EXTERNAL_FLASH_DEVICES = "W25Q32JV_IQ"
10+
EXTERNAL_FLASH_DEVICES = "W25Q128JV_SQ"

ports/nrf/boards/ohs2020_badge/pins.c

Lines changed: 6 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) },
@@ -11,8 +12,13 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
1112
{ MP_ROM_QSTR(MP_QSTR_TFT_SCK), MP_ROM_PTR(&pin_P0_11) },
1213
{ MP_ROM_QSTR(MP_QSTR_TFT_MOSI), MP_ROM_PTR(&pin_P0_12) },
1314

15+
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P1_14) },
16+
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P1_15) },
17+
1418
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
1519
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
20+
21+
{ MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display) },
1622
};
1723

1824
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

0 commit comments

Comments
 (0)
0