Skip to content

Commit 1aac66d

Browse files
authored
Update pins.c
Added tuple with Camera Datalines as indicated in Adafruit espcamera tutorial: https://learn.adafruit.com/capturing-camera-images-with-circuitpython
1 parent 6e020ea commit 1aac66d

File tree

1 file changed

+31
-15
lines changed
  • ports/espressif/boards/seeed_xiao_esp32_s3_sense

1 file changed

+31
-15
lines changed

ports/espressif/boards/seeed_xiao_esp32_s3_sense/pins.c

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
#include "shared-bindings/board/__init__.h"
22

3+
static const mp_rom_obj_tuple_t camera_data_tuple = {
4+
// The order matters.
5+
// They must be ordered from low to high (CAM_D0, CAM_D1...CAM_D7).
6+
7+
// Do not include any of the control pins in here.
8+
{&mp_type_tuple},
9+
8,
10+
{
11+
MP_ROM_PTR(&pin_GPIO15), //CAM_D0
12+
MP_ROM_PTR(&pin_GPIO17), //CAM_D1
13+
MP_ROM_PTR(&pin_GPIO18), //CAM_D2
14+
MP_ROM_PTR(&pin_GPIO16), //CAM_D3
15+
MP_ROM_PTR(&pin_GPIO14), //CAM_D4
16+
MP_ROM_PTR(&pin_GPIO12), //CAM_D5
17+
MP_ROM_PTR(&pin_GPIO11), //CAM_D6
18+
MP_ROM_PTR(&pin_GPIO48), //CAM_D7
19+
}
20+
};
21+
322
STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
423
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
524
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO1) },
@@ -26,27 +45,24 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
2645
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO8) },
2746
{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO9) },
2847
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO9) },
48+
{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO21) },
49+
{ MP_ROM_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_GPIO21) },
2950
{ MP_ROM_QSTR(MP_QSTR_CAM_XCLK), MP_ROM_PTR(&pin_GPIO10) },
30-
{ MP_ROM_QSTR(MP_QSTR_CAM_D7), MP_ROM_PTR(&pin_GPIO48) },
31-
{ MP_ROM_QSTR(MP_QSTR_CAM_HREF), MP_ROM_PTR(&pin_GPIO37) },
32-
{ MP_ROM_QSTR(MP_QSTR_CAM_D6), MP_ROM_PTR(&pin_GPIO11) },
33-
{ MP_ROM_QSTR(MP_QSTR_CAM_D5), MP_ROM_PTR(&pin_GPIO12) },
51+
{ MP_ROM_QSTR(MP_QSTR_CAM_HREF), MP_ROM_PTR(&pin_GPIO37) },
3452
{ MP_ROM_QSTR(MP_QSTR_CAM_PCLK), MP_ROM_PTR(&pin_GPIO13) },
35-
{ MP_ROM_QSTR(MP_QSTR_CAM_D4), MP_ROM_PTR(&pin_GPIO14) },
53+
{ MP_ROM_QSTR(MP_QSTR_CAM_DATA), MP_ROM_PTR(&camera_data_tuple) },
3654
{ MP_ROM_QSTR(MP_QSTR_CAM_D0), MP_ROM_PTR(&pin_GPIO15) },
37-
{ MP_ROM_QSTR(MP_QSTR_CAM_D3), MP_ROM_PTR(&pin_GPIO16) },
38-
{ MP_ROM_QSTR(MP_QSTR_CAM_D1), MP_ROM_PTR(&pin_GPIO17) },
55+
{ MP_ROM_QSTR(MP_QSTR_CAM_D1), MP_ROM_PTR(&pin_GPIO17) },
3956
{ MP_ROM_QSTR(MP_QSTR_CAM_D2), MP_ROM_PTR(&pin_GPIO18) },
40-
{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO21) },
41-
{ MP_ROM_QSTR(MP_QSTR_SDCS), MP_ROM_PTR(&pin_GPIO21) },
57+
{ MP_ROM_QSTR(MP_QSTR_CAM_D3), MP_ROM_PTR(&pin_GPIO16) },
58+
{ MP_ROM_QSTR(MP_QSTR_CAM_D4), MP_ROM_PTR(&pin_GPIO14) },
59+
{ MP_ROM_QSTR(MP_QSTR_CAM_D5), MP_ROM_PTR(&pin_GPIO12) },
60+
{ MP_ROM_QSTR(MP_QSTR_CAM_D6), MP_ROM_PTR(&pin_GPIO11) },
61+
{ MP_ROM_QSTR(MP_QSTR_CAM_D7), MP_ROM_PTR(&pin_GPIO48) },
4262
{ MP_ROM_QSTR(MP_QSTR_CAM_VSYNC), MP_ROM_PTR(&pin_GPIO38) },
43-
{ MP_ROM_QSTR(MP_QSTR_MTCK), MP_ROM_PTR(&pin_GPIO39) },
44-
{ MP_ROM_QSTR(MP_QSTR_CAM_SCL), MP_ROM_PTR(&pin_GPIO39) },
45-
{ MP_ROM_QSTR(MP_QSTR_MTDO), MP_ROM_PTR(&pin_GPIO40) },
46-
{ MP_ROM_QSTR(MP_QSTR_CAM_SDA), MP_ROM_PTR(&pin_GPIO40) },
63+
{ MP_ROM_QSTR(MP_QSTR_CAM_SCL), MP_ROM_PTR(&pin_GPIO39) },
64+
{ MP_ROM_QSTR(MP_QSTR_CAM_SDA), MP_ROM_PTR(&pin_GPIO40) },
4765
{ MP_ROM_QSTR(MP_QSTR_MIC_DATA), MP_ROM_PTR(&pin_GPIO41) },
48-
{ MP_ROM_QSTR(MP_QSTR_MTDI), MP_ROM_PTR(&pin_GPIO41) },
49-
{ MP_ROM_QSTR(MP_QSTR_MTMS), MP_ROM_PTR(&pin_GPIO42) },
5066
{ MP_ROM_QSTR(MP_QSTR_MIC_CLK), MP_ROM_PTR(&pin_GPIO42) },
5167
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
5268
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },

0 commit comments

Comments
 (0)