File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
ports/raspberrypi/boards/pimoroni_inky_frame_5_7 Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
#include "supervisor/board.h"
4
4
#include "shared-module/displayio/__init__.h"
5
+ #include "py/objtuple.h"
6
+ #include "py/qstr.h"
7
+
5
8
#include "inky-shared.h"
6
9
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
+
7
40
STATIC const mp_rom_map_elem_t board_module_globals_table [] = {
8
41
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
9
42
@@ -49,5 +82,6 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
49
82
50
83
{ MP_ROM_QSTR (MP_QSTR_DISPLAY ), MP_ROM_PTR (& displays [0 ].epaper_display )},
51
84
{ 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 )},
52
86
};
53
87
MP_DEFINE_CONST_DICT (board_module_globals , board_module_globals_table );
You can’t perform that action at this time.
0 commit comments