Skip to content

Commit f0c6a8c

Browse files
committed
Odroid pin defs
1 parent 9661d32 commit f0c6a8c

File tree

3 files changed

+71
-24
lines changed

3 files changed

+71
-24
lines changed

ports/espressif/boards/hardkernel_odroid_go/board.c

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -35,31 +35,31 @@
3535

3636
#define DELAY 0x80
3737

38+
// ILI9341 init sequence from:
39+
// https://github.com/hardkernel/ODROID-GO-MicroPython/blob/loboris/odroid_go/utils/lcd/lcd.py#L55
3840
uint8_t display_init_sequence[] = {
3941
0x0f, 3, 0x03, 0x80, 0x02, // RDDSDR
4042
0xcf, 3, 0x00, 0xcf, 0x30, // PWCRTLB
41-
0xed, 4, 0x64, 0x03, 0x12, 0x81, // PWRONCTRL, b"\x64\x03\x12\x81"),
42-
0xe8, 3, 0x85, 0x00, 0x78, // (_DTCTRLA, b"\x85\x00\x78"),
43-
0xcb, 5, 0x39, 0x2c, 0x00, 0x34, 0x02, // (_PWCTRLA, b"\x39\x2c\x00\x34\x02"),
44-
0xf7, 1, 0x20, // (_PRCTRL, b"\x20"),
45-
0xea, 2, 0x00, 0x00, // (_DTCTRLB, b"\x00\x00"),
46-
0xc0, 1, 0x1b, // (_PWCTRL1, b"\x1b"),
47-
0xc1, 1, 0x12, // (_PWCTRL2, b"\x12"),
48-
0xc5, 2, 0x3e, 0x3c, // (_VMCTRL1, b"\x3e\x3c"),
49-
0xc7, 1, 0x91, // (_VMCTRL2, b"\x91"),
50-
0x36, 1, 0xa8, // (_MADCTL, b"\xa8"),
51-
0x3a, 1, 0x55, // (_PIXSET, b"\x55"),
52-
0xb1, 2, 0x00, 0x1b, // (_FRMCTR1, b"\x00\x1b"),
53-
0xb6, 3, 0x0a, 0xa2, 0x27, // (_DISCTRL, b"\x0a\xa2\x27"),
54-
0xf6, 2, 0x01, 0x30, // (_INTFACE, b"\x01\x30"),
55-
0xf2, 1, 0x00, // (_ENA3G, b"\x00"),
56-
0x26, 1, 0x01, // (_GAMSET, b"\x01"),
57-
0xe0, 15, 0x0f, 0x31, 0x2b, 0x0c, 0x0e, 0x08, 0x4e, 0xf1, 0x37, 0x07, 0x10, 0x03, 0x0e, 0x09, 0x00,
58-
// (_PGAMCTRL, b"\x0f\x31\x2b\x0c\x0e\x08\x4e\xf1\x37\x07\x10\x03\x0e\x09\x00"),
59-
0xe1, 15, 0x00, 0x0e, 0x14, 0x03, 0x11, 0x07, 0x31, 0xc1, 0x48, 0x08, 0x0f, 0x0c, 0x31, 0x36, 0x0f,
60-
// (_NGAMCTRL, b"\x00\x0e\x14\x03\x11\x07\x31\xc1\x48\x08\x0f\x0c\x31\x36\x0f")):
61-
0x11, 0 | DELAY, 10, // _SLPOUT
62-
0x29, 0 | DELAY, 100, // _DISPON
43+
0xed, 4, 0x64, 0x03, 0x12, 0x81, // PWRONCTRL
44+
0xe8, 3, 0x85, 0x00, 0x78, // DTCTRLA
45+
0xcb, 5, 0x39, 0x2c, 0x00, 0x34, 0x02, // PWCTRLA
46+
0xf7, 1, 0x20, // PRCTRL
47+
0xea, 2, 0x00, 0x00, // DTCTRLB
48+
0xc0, 1, 0x1b, // PWCTRL1
49+
0xc1, 1, 0x12, // PWCTRL2
50+
0xc5, 2, 0x3e, 0x3c, // VMCTRL1
51+
0xc7, 1, 0x91, // VMCTRL2
52+
0x36, 1, 0xa8, // MADCTL
53+
0x3a, 1, 0x55, // PIXSET
54+
0xb1, 2, 0x00, 0x1b, // FRMCTR1
55+
0xb6, 3, 0x0a, 0xa2, 0x27, // DISCTRL
56+
0xf6, 2, 0x01, 0x30, // INTFACE
57+
0xf2, 1, 0x00, // ENA3G
58+
0x26, 1, 0x01, // GAMSET
59+
0xe0, 15, 0x0f, 0x31, 0x2b, 0x0c, 0x0e, 0x08, 0x4e, 0xf1, 0x37, 0x07, 0x10, 0x03, 0x0e, 0x09, 0x00, // PGAMCTRL
60+
0xe1, 15, 0x00, 0x0e, 0x14, 0x03, 0x11, 0x07, 0x31, 0xc1, 0x48, 0x08, 0x0f, 0x0c, 0x31, 0x36, 0x0f, // NGAMCTRL
61+
0x11, 0 | DELAY, 10, // SLPOUT
62+
0x29, 0 | DELAY, 100, // DISPON
6363
};
6464

6565
void board_init(void) {

ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
CIRCUITPY_CREATOR_ID = 0x0000239A
2-
CIRCUITPY_CREATION_ID = 0x00320002
1+
CIRCUITPY_CREATOR_ID = 0x0D10D000
2+
CIRCUITPY_CREATION_ID = 0x00320060
33

44
IDF_TARGET = esp32
55

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,57 @@
11
#include "shared-bindings/board/__init__.h"
22

3+
// Pin names from: https://wiki.odroid.com/odroid_go/odroid_go
4+
35
STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
46
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
57

8+
// Left side
9+
{ MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_GPIO36) },
10+
11+
{ MP_ROM_QSTR(MP_QSTR_BTN_START), MP_ROM_PTR(&pin_GPIO39) },
12+
13+
{ MP_ROM_QSTR(MP_QSTR_BTN_AXIS_X), MP_ROM_PTR(&pin_GPIO34) },
14+
15+
{ MP_ROM_QSTR(MP_QSTR_BTN_AXIS_Y), MP_ROM_PTR(&pin_GPIO35) },
16+
17+
{ MP_ROM_QSTR(MP_QSTR_BTN_A), MP_ROM_PTR(&pin_GPIO32) },
18+
19+
{ MP_ROM_QSTR(MP_QSTR_BTN_B), MP_ROM_PTR(&pin_GPIO33) },
20+
21+
{ MP_ROM_QSTR(MP_QSTR_SPEAKER_IN_M), MP_ROM_PTR(&pin_GPIO25) },
22+
23+
{ MP_ROM_QSTR(MP_QSTR_SPEAKER_IN_P), MP_ROM_PTR(&pin_GPIO26) },
24+
25+
{ MP_ROM_QSTR(MP_QSTR_BTN_SELECT), MP_ROM_PTR(&pin_GPIO27) },
26+
27+
{ MP_ROM_QSTR(MP_QSTR_BACKLIGHT_PWM), MP_ROM_PTR(&pin_GPIO14) },
28+
29+
{ MP_ROM_QSTR(MP_QSTR_EXT3), MP_ROM_PTR(&pin_GPIO12) },
30+
31+
{ MP_ROM_QSTR(MP_QSTR_BTN_MENU), MP_ROM_PTR(&pin_GPIO13) },
32+
33+
// Right side.
34+
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO23) },
35+
{ MP_ROM_QSTR(MP_QSTR_EXT8), MP_ROM_PTR(&pin_GPIO23) },
36+
37+
{ MP_ROM_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_GPIO22) },
38+
39+
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO19) },
40+
{ MP_ROM_QSTR(MP_QSTR_EXT7), MP_ROM_PTR(&pin_GPIO19) },
41+
42+
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO18) },
43+
{ MP_ROM_QSTR(MP_QSTR_EXT2), MP_ROM_PTR(&pin_GPIO18) },
44+
45+
{ MP_ROM_QSTR(MP_QSTR_LCD_CS), MP_ROM_PTR(&pin_GPIO5) },
46+
47+
{ MP_ROM_QSTR(MP_QSTR_EXT5), MP_ROM_PTR(&pin_GPIO4) },
48+
649
{ MP_ROM_QSTR(MP_QSTR_BTN_VOLUME), MP_ROM_PTR(&pin_GPIO0) },
750

51+
{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO2) },
52+
53+
{ MP_ROM_QSTR(MP_QSTR_EXT4), MP_ROM_PTR(&pin_GPIO15) },
54+
855
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
956
};
1057
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

0 commit comments

Comments
 (0)