22#include "shared-bindings/board/__init__.h"
33#include "shared-module/displayio/__init__.h"
44
5- CIRCUITPY_BOARD_BUS_SINGLETON (bm8563_i2c , i2c , 1 )
5+ CIRCUITPY_BOARD_BUS_SINGLETON (bm8563_i2c , i2c , 1 ) // RTC
6+ CIRCUITPY_BOARD_BUS_SINGLETON (sscb_i2c , i2c , 2 ) // Camera sensor
67
78STATIC const mp_rom_obj_tuple_t camera_data_tuple = {
9+ // The order matters.
10+ // They must be ordered from low to high (Y2, Y3 .. Y9).
11+
12+ // Do not include any of the control pins in here.
813 {& mp_type_tuple },
914 8 ,
1015 {
11- MP_ROM_PTR (& pin_GPIO19 ),
12- MP_ROM_PTR (& pin_GPIO36 ),
13- MP_ROM_PTR (& pin_GPIO18 ),
14- MP_ROM_PTR (& pin_GPIO39 ),
15- MP_ROM_PTR (& pin_GPIO5 ),
16- MP_ROM_PTR (& pin_GPIO34 ),
17- MP_ROM_PTR (& pin_GPIO35 ),
18- MP_ROM_PTR (& pin_GPIO32 )
16+ MP_ROM_PTR (& pin_GPIO32 ), // Y2
17+ MP_ROM_PTR (& pin_GPIO35 ), // Y3
18+ MP_ROM_PTR (& pin_GPIO34 ), // Y4
19+ MP_ROM_PTR (& pin_GPIO5 ), // Y5
20+ MP_ROM_PTR (& pin_GPIO39 ), // Y6
21+ MP_ROM_PTR (& pin_GPIO18 ), // Y7
22+ MP_ROM_PTR (& pin_GPIO36 ), // Y8
23+ MP_ROM_PTR (& pin_GPIO19 ) // Y9
1924 }
2025};
2126
@@ -24,41 +29,59 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
2429
2530 { MP_ROM_QSTR (MP_QSTR_LED ), MP_ROM_PTR (& pin_GPIO2 ) },
2631
27- // Connector , the label says G V SDA/G4 SCL/G13
32+ // "Ext. Port" , the label says [G, V, SDA/G4, SCL/G13]
2833 { MP_ROM_QSTR (MP_QSTR_G4 ), MP_ROM_PTR (& pin_GPIO4 ) },
2934 { MP_ROM_QSTR (MP_QSTR_G13 ), MP_ROM_PTR (& pin_GPIO13 ) },
3035 { MP_ROM_QSTR (MP_QSTR_SDA ), MP_ROM_PTR (& pin_GPIO4 ) },
3136 { MP_ROM_QSTR (MP_QSTR_SCL ), MP_ROM_PTR (& pin_GPIO13 ) },
3237 { MP_ROM_QSTR (MP_QSTR_I2C ), MP_ROM_PTR (& board_i2c_obj ) },
3338
34- // Battery pins, no alternative names as they cannot be used for anything else.
39+ /* Battery
40+ *
41+ * No alternative names as they are not broken out
42+ * and cannot be used for anything else.
43+ */
3544 { MP_ROM_QSTR (MP_QSTR_BAT_HOLD ), MP_ROM_PTR (& pin_GPIO33 ) },
3645 { MP_ROM_QSTR (MP_QSTR_BAT_ADC ), MP_ROM_PTR (& pin_GPIO38 ) },
3746
38- // BM8563 I2C bus, no alternative names as they cannot be used for anything else.
47+ /* BM8563 I2C bus
48+ *
49+ * No alternative names as they are not broken out
50+ * and cannot be used for anything else.
51+ */
3952 { MP_ROM_QSTR (MP_QSTR_BM8563_SCL ), MP_ROM_PTR (& pin_GPIO14 ) },
4053 { MP_ROM_QSTR (MP_QSTR_BM8563_SDA ), MP_ROM_PTR (& pin_GPIO12 ) },
4154 { MP_ROM_QSTR (MP_QSTR_BM8563_I2C ), MP_ROM_PTR (& board_bm8563_i2c_obj ) },
4255
43- // Camera pins
44- { MP_ROM_QSTR (MP_QSTR_CAMERA_VSYNC ), MP_ROM_PTR (& pin_GPIO22 ) },
45- { MP_ROM_QSTR (MP_QSTR_CAMERA_HREF ), MP_ROM_PTR (& pin_GPIO26 ) },
46- { MP_ROM_QSTR (MP_QSTR_CAMERA_PCLK ), MP_ROM_PTR (& pin_GPIO21 ) },
47- { MP_ROM_QSTR (MP_QSTR_CAMERA_XCLK ), MP_ROM_PTR (& pin_GPIO27 ) }, // xclk_freq_hz = 20000000
48- { MP_ROM_QSTR (MP_QSTR_CAMERA_RESET ), MP_ROM_PTR (& pin_GPIO15 ) },
56+ // Camera control
57+ { MP_ROM_QSTR (MP_QSTR_VSYNC ), MP_ROM_PTR (& pin_GPIO22 ) },
58+ { MP_ROM_QSTR (MP_QSTR_HREF ), MP_ROM_PTR (& pin_GPIO26 ) },
59+ { MP_ROM_QSTR (MP_QSTR_PCLK ), MP_ROM_PTR (& pin_GPIO21 ) },
60+ { MP_ROM_QSTR (MP_QSTR_XCLK ), MP_ROM_PTR (& pin_GPIO27 ) }, // xclk_freq_hz = 20000000
61+ { MP_ROM_QSTR (MP_QSTR_RESET ), MP_ROM_PTR (& pin_GPIO15 ) },
4962
50- { MP_ROM_QSTR (MP_QSTR_CAMERA_SSCB_SDA ), MP_ROM_PTR (& pin_GPIO25 ) },
51- { MP_ROM_QSTR (MP_QSTR_CAMERA_SSCB_SCL ), MP_ROM_PTR (& pin_GPIO23 ) },
63+ // Camera sensor I2C bus
64+ { MP_ROM_QSTR (MP_QSTR_SSCB_SDA ), MP_ROM_PTR (& pin_GPIO25 ) },
65+ { MP_ROM_QSTR (MP_QSTR_SSCB_SCL ), MP_ROM_PTR (& pin_GPIO23 ) },
66+ { MP_ROM_QSTR (MP_QSTR_SSCB_I2C ), MP_ROM_PTR (& board_sscb_i2c_obj ) },
5267
53- { MP_ROM_QSTR (MP_QSTR_CAMERA_DATA ), MP_ROM_PTR (& camera_data_tuple ) },
68+ /*
69+ * Camera data
70+ *
71+ * We don't really need to individually name each one,
72+ * but they look cool in the tuple listing if we do.
73+ *
74+ * These are also not broken out.
75+ */
76+ { MP_ROM_QSTR (MP_QSTR_D ), MP_ROM_PTR (& camera_data_tuple ) },
5477
55- { MP_ROM_QSTR (MP_QSTR_CAMERA_DATA7 ), MP_ROM_PTR (& pin_GPIO19 ) },
56- { MP_ROM_QSTR (MP_QSTR_CAMERA_DATA6 ), MP_ROM_PTR (& pin_GPIO36 ) },
57- { MP_ROM_QSTR (MP_QSTR_CAMERA_DATA5 ), MP_ROM_PTR (& pin_GPIO18 ) },
58- { MP_ROM_QSTR (MP_QSTR_CAMERA_DATA4 ), MP_ROM_PTR (& pin_GPIO39 ) },
59- { MP_ROM_QSTR (MP_QSTR_CAMERA_DATA3 ), MP_ROM_PTR (& pin_GPIO5 ) },
60- { MP_ROM_QSTR (MP_QSTR_CAMERA_DATA2 ), MP_ROM_PTR (& pin_GPIO34 ) },
61- { MP_ROM_QSTR (MP_QSTR_CAMERA_DATA1 ), MP_ROM_PTR (& pin_GPIO35 ) },
62- { MP_ROM_QSTR (MP_QSTR_CAMERA_DATA0 ), MP_ROM_PTR (& pin_GPIO32 ) }
78+ { MP_ROM_QSTR (MP_QSTR_D9 ), MP_ROM_PTR (& pin_GPIO19 ) },
79+ { MP_ROM_QSTR (MP_QSTR_D8 ), MP_ROM_PTR (& pin_GPIO36 ) },
80+ { MP_ROM_QSTR (MP_QSTR_D7 ), MP_ROM_PTR (& pin_GPIO18 ) },
81+ { MP_ROM_QSTR (MP_QSTR_D6 ), MP_ROM_PTR (& pin_GPIO39 ) },
82+ { MP_ROM_QSTR (MP_QSTR_D5 ), MP_ROM_PTR (& pin_GPIO5 ) },
83+ { MP_ROM_QSTR (MP_QSTR_D4 ), MP_ROM_PTR (& pin_GPIO34 ) },
84+ { MP_ROM_QSTR (MP_QSTR_D3 ), MP_ROM_PTR (& pin_GPIO35 ) },
85+ { MP_ROM_QSTR (MP_QSTR_D2 ), MP_ROM_PTR (& pin_GPIO32 ) }
6386};
6487MP_DEFINE_CONST_DICT (board_module_globals , board_module_globals_table );
0 commit comments