File tree Expand file tree Collapse file tree
ports/raspberrypi/boards/pimoroni_inky_frame_5_7 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33#include "supervisor/board.h"
44#include "shared-module/displayio/__init__.h"
5+ #include "py/objtuple.h"
6+ #include "py/qstr.h"
7+
58#include "inky-shared.h"
69
10+ // for use with keypad.ShiftRegisterKeys: map keycode (bit-number)
11+ // to logical names board.KEYCODES.SW_A etc.
12+ // N.B.: labels and bit-numbers in the schematic are reversed, i.e.
13+ // SW_A on D0 has bit-number 7
14+
15+ STATIC const qstr board_keycodes_fields [] = {
16+ MP_QSTR_SW_A ,
17+ MP_QSTR_SW_B ,
18+ MP_QSTR_SW_C ,
19+ MP_QSTR_SW_D ,
20+ MP_QSTR_SW_E ,
21+ MP_QSTR_RTC_ALARM ,
22+ MP_QSTR_EXT_TRIGGER ,
23+ MP_QSTR_INKY_BUS
24+ };
25+
26+ STATIC MP_DEFINE_ATTRTUPLE (
27+ board_keycodes_obj ,
28+ board_keycodes_fields ,
29+ 8 ,
30+ MP_ROM_INT (7 ),
31+ MP_ROM_INT (6 ),
32+ MP_ROM_INT (5 ),
33+ MP_ROM_INT (4 ),
34+ MP_ROM_INT (3 ),
35+ MP_ROM_INT (2 ),
36+ MP_ROM_INT (1 ),
37+ MP_ROM_INT (0 )
38+ );
39+
740STATIC const mp_rom_map_elem_t board_module_globals_table [] = {
841 CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
942
@@ -49,5 +82,6 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
4982
5083 { MP_ROM_QSTR (MP_QSTR_DISPLAY ), MP_ROM_PTR (& displays [0 ].epaper_display )},
5184 { MP_ROM_QSTR (MP_QSTR_ENABLE_DIO ), MP_ROM_PTR (& enable_pin_obj )}, // GP2
85+ { MP_ROM_QSTR (MP_QSTR_KEYCODES ), MP_ROM_PTR (& board_keycodes_obj )},
5286};
5387MP_DEFINE_CONST_DICT (board_module_globals , board_module_globals_table );
You can’t perform that action at this time.
0 commit comments