Skip to content

Commit e898ace

Browse files
committed
Added new board esspressif_esp32s3_n16r8_wroom. Board works with espcamera module.
1 parent 656f540 commit e898ace

File tree

5 files changed

+164
-0
lines changed

5 files changed

+164
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// This file is part of the CircuitPython project: https://circuitpython.org
2+
//
3+
// SPDX-FileCopyrightText: Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
4+
//
5+
// SPDX-License-Identifier: MIT
6+
7+
#include "supervisor/board.h"
8+
9+
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// This file is part of the CircuitPython project: https://circuitpython.org
2+
//
3+
// SPDX-FileCopyrightText: Copyright (c) 2019 Scott Shawcroft for Adafruit Industries
4+
//
5+
// SPDX-License-Identifier: MIT
6+
7+
#pragma once
8+
9+
// Micropython setup
10+
11+
// board name printed on the board (sometimes wroom is missing)
12+
#define MICROPY_HW_BOARD_NAME "ESP32-S3-N16R8-Wroom"
13+
#define MICROPY_HW_MCU_NAME "ESP32S3"
14+
15+
// Camera SCCB/I2C
16+
// used SIOD = CAM_SDA and SIOC for CAM_SCL
17+
#define CAM_PIN_SIOD_SDA (&pin_GPIO4) // replace with actual GPIO
18+
#define CAM_PIN_SIOC_SCL (&pin_GPIO5) // replace with actual GPIO
19+
20+
#define CIRCUITPY_BOARD_I2C (1)
21+
#define CIRCUITPY_BOARD_I2C_PIN {{.scl = CAM_PIN_SIOC_SCL, .sda = CAM_PIN_SIOD_SDA}}
22+
23+
#define DEFAULT_I2C_BUS_SDA (&pin_GPIO4) // your CAM_SDA pin
24+
#define DEFAULT_I2C_BUS_SCL (&pin_GPIO5) // your CAM_SCL pin
25+
26+
// WS2812
27+
#define MICROPY_HW_NEOPIXEL (&pin_GPIO48)
28+
29+
// also the pins for the RX and TX LED
30+
#define DEFAULT_UART_BUS_RX (&pin_GPIO44)
31+
#define DEFAULT_UART_BUS_TX (&pin_GPIO43)
32+
33+
// Status LED
34+
#define MICROPY_HW_LED_STATUS (&pin_GPIO2)
35+
36+
#define CIRCUITPY_I2C_ALLOW_INTERNAL_PULL_UP (1)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
USB_VID = 0x303A
2+
USB_PID = 0x7003
3+
USB_PRODUCT = "ESP32-S3-N16R8-Wroom"
4+
USB_MANUFACTURER = "Espressif"
5+
6+
IDF_TARGET = esp32s3
7+
8+
CIRCUITPY_ESP_FLASH_SIZE = 16MB
9+
CIRCUITPY_ESP_FLASH_MODE = qio
10+
CIRCUITPY_ESP_FLASH_FREQ = 80m
11+
12+
CIRCUITPY_ESP_PSRAM_SIZE = 8MB
13+
CIRCUITPY_ESP_PSRAM_MODE = opi
14+
CIRCUITPY_ESP_PSRAM_FREQ = 80m
15+
16+
CIRCUITPY_ESPCAMERA = 1
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
// This file is part of the CircuitPython project: https://circuitpython.org
2+
//
3+
// SPDX-FileCopyrightText: Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
4+
//
5+
// SPDX-License-Identifier: MIT
6+
7+
#include "py/objtuple.h"
8+
#include "shared-bindings/board/__init__.h"
9+
#include "shared-module/displayio/__init__.h"
10+
11+
static const mp_rom_obj_tuple_t camera_data_tuple = {
12+
// The order matters.
13+
// They must be ordered from low to high (Y2, Y3 .. Y9).
14+
15+
// Do not include any of the control pins in here.
16+
{&mp_type_tuple},
17+
8,
18+
{
19+
MP_ROM_PTR(&pin_GPIO11), // Y2
20+
MP_ROM_PTR(&pin_GPIO9), // Y3
21+
MP_ROM_PTR(&pin_GPIO8), // Y4
22+
MP_ROM_PTR(&pin_GPIO10), // Y5
23+
MP_ROM_PTR(&pin_GPIO12), // Y6
24+
MP_ROM_PTR(&pin_GPIO18), // Y7
25+
MP_ROM_PTR(&pin_GPIO17), // Y8
26+
MP_ROM_PTR(&pin_GPIO16) // Y9
27+
}
28+
};
29+
30+
static const mp_rom_map_elem_t board_module_globals_table[] = {
31+
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
32+
33+
{ MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) },
34+
{ MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) },
35+
{ MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) },
36+
{ MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) },
37+
{ MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) },
38+
{ MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) },
39+
{ MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) },
40+
{ MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) },
41+
{ MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) },
42+
{ MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) },
43+
{ MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) },
44+
{ MP_ROM_QSTR(MP_QSTR_IO11), MP_ROM_PTR(&pin_GPIO11) },
45+
{ MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12) },
46+
{ MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) },
47+
{ MP_ROM_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_GPIO14) },
48+
{ MP_ROM_QSTR(MP_QSTR_IO15), MP_ROM_PTR(&pin_GPIO15) },
49+
{ MP_ROM_QSTR(MP_QSTR_IO16), MP_ROM_PTR(&pin_GPIO16) },
50+
{ MP_ROM_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17) },
51+
{ MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) },
52+
{ MP_ROM_QSTR(MP_QSTR_IO19), MP_ROM_PTR(&pin_GPIO19) },
53+
{ MP_ROM_QSTR(MP_QSTR_IO20), MP_ROM_PTR(&pin_GPIO20) },
54+
{ MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) },
55+
{ MP_ROM_QSTR(MP_QSTR_IO35), MP_ROM_PTR(&pin_GPIO35) },
56+
{ MP_ROM_QSTR(MP_QSTR_IO36), MP_ROM_PTR(&pin_GPIO36) },
57+
{ MP_ROM_QSTR(MP_QSTR_IO37), MP_ROM_PTR(&pin_GPIO37) },
58+
{ MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38) },
59+
{ MP_ROM_QSTR(MP_QSTR_IO39), MP_ROM_PTR(&pin_GPIO39) },
60+
{ MP_ROM_QSTR(MP_QSTR_IO40), MP_ROM_PTR(&pin_GPIO40) },
61+
{ MP_ROM_QSTR(MP_QSTR_IO41), MP_ROM_PTR(&pin_GPIO41) },
62+
{ MP_ROM_QSTR(MP_QSTR_IO42), MP_ROM_PTR(&pin_GPIO42) },
63+
{ MP_ROM_QSTR(MP_QSTR_IO43), MP_ROM_PTR(&pin_GPIO43) },
64+
{ MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44) },
65+
{ MP_ROM_QSTR(MP_QSTR_IO45), MP_ROM_PTR(&pin_GPIO45) },
66+
{ MP_ROM_QSTR(MP_QSTR_IO46), MP_ROM_PTR(&pin_GPIO46) },
67+
{ MP_ROM_QSTR(MP_QSTR_IO47), MP_ROM_PTR(&pin_GPIO47) },
68+
{ MP_ROM_QSTR(MP_QSTR_IO48), MP_ROM_PTR(&pin_GPIO48) },
69+
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO48) },
70+
71+
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) },
72+
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) },
73+
74+
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
75+
76+
// Camera data
77+
{ MP_ROM_QSTR(MP_QSTR_CAM_DATA), MP_ROM_PTR(&camera_data_tuple)},
78+
79+
{ MP_ROM_QSTR(MP_QSTR_CAM_VSYNC), MP_ROM_PTR(&pin_GPIO6) },
80+
{ MP_ROM_QSTR(MP_QSTR_CAM_HREF), MP_ROM_PTR(&pin_GPIO7)},
81+
{ MP_ROM_QSTR(MP_QSTR_CAM_PCLK), MP_ROM_PTR(&pin_GPIO13) },
82+
{ MP_ROM_QSTR(MP_QSTR_CAM_XCLK), MP_ROM_PTR(&pin_GPIO15)},
83+
84+
{ MP_ROM_QSTR(MP_QSTR_CAMERA_SIOD), MP_ROM_PTR(&pin_GPIO4) }, // SDA
85+
{ MP_ROM_QSTR(MP_QSTR_CAMERA_SIOC), MP_ROM_PTR(&pin_GPIO5) }, // SCL
86+
};
87+
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#
2+
# Espressif IoT Development Framework Configuration
3+
#
4+
#
5+
# Component config
6+
#
7+
#
8+
# LWIP
9+
#
10+
# end of LWIP
11+
CONFIG_OV2640_SUPPORT=y
12+
CONFIG_OV3660_SUPPORT=y
13+
CONFIG_OV5640_SUPPORT=y
14+
# end of Component config
15+
16+
# end of Espressif IoT Development Framework Configuration

0 commit comments

Comments
 (0)