Skip to content

Commit 8c1a365

Browse files
authored
Merge pull request #8623 from bill88t/main
FireBeetle 2 ESP32-S3
2 parents f3920c4 + 71f953e commit 8c1a365

File tree

7 files changed

+232
-0
lines changed

7 files changed

+232
-0
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,3 +354,6 @@
354354
[submodule "lib/tlsf"]
355355
path = lib/tlsf
356356
url = https://github.com/espressif/tlsf.git
357+
[submodule "frozen/CircuitPython_AXP313A"]
358+
path = frozen/CircuitPython_AXP313A
359+
url = https://github.com/bill88t/CircuitPython_AXP313A

frozen/CircuitPython_AXP313A

Submodule CircuitPython_AXP313A added at 702d313
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2023 Bill Sideris, independently providing these changes.
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
27+
#include "supervisor/board.h"
28+
29+
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2023 Bill Sideris, independently providing these changes.
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
27+
#define MICROPY_HW_BOARD_NAME "DFRobot FireBeetle 2 ESP32-S3"
28+
#define MICROPY_HW_MCU_NAME "ESP32S3"
29+
30+
#define CIRCUITPY_BOARD_I2C (2)
31+
#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO2, .sda = &pin_GPIO3}, \
32+
{.scl = &pin_GPIO2, .sda = &pin_GPIO1}}
33+
34+
#define DEFAULT_SPI_BUS_SCK (&pin_GPIO17)
35+
#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO15)
36+
#define DEFAULT_SPI_BUS_MISO (&pin_GPIO16)
37+
38+
#define MICROPY_HW_LED_STATUS (&pin_GPIO21)
39+
40+
#define DEFAULT_UART_BUS_RX (&pin_GPIO44)
41+
#define DEFAULT_UART_BUS_TX (&pin_GPIO43)
42+
43+
#define DOUBLE_TAP_PIN (&pin_GPIO0)
44+
45+
#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 = 0x3343
2+
USB_PID = 0x83CF
3+
USB_PRODUCT = "Firebeetle 2 ESP32-S3"
4+
USB_MANUFACTURER = "DFRobot"
5+
6+
IDF_TARGET = esp32s3
7+
8+
CIRCUITPY_ESP_FLASH_MODE = qio
9+
CIRCUITPY_ESP_FLASH_FREQ = 80m
10+
CIRCUITPY_ESP_FLASH_SIZE = 16MB
11+
12+
CIRCUITPY_ESP_PSRAM_SIZE = 8MB
13+
CIRCUITPY_ESP_PSRAM_MODE = opi
14+
CIRCUITPY_ESP_PSRAM_FREQ = 120m
15+
16+
FROZEN_MPY_DIRS += $(TOP)/frozen/CircuitPython_AXP313A
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
#include "py/objtuple.h"
2+
#include "shared-bindings/board/__init__.h"
3+
#include "shared-module/displayio/__init__.h"
4+
5+
CIRCUITPY_BOARD_BUS_SINGLETON(cam_i2c, i2c, 1) // Camera sensor
6+
7+
STATIC const mp_rom_obj_tuple_t camera_data_tuple = {
8+
// The order matters.
9+
// They must be ordered from low to high (Y2, Y3 .. Y9).
10+
11+
// Do not include any of the control pins in here.
12+
{&mp_type_tuple},
13+
8,
14+
{
15+
MP_ROM_PTR(&pin_GPIO39), // Y2
16+
MP_ROM_PTR(&pin_GPIO40), // Y3
17+
MP_ROM_PTR(&pin_GPIO41), // Y4
18+
MP_ROM_PTR(&pin_GPIO4), // Y5
19+
MP_ROM_PTR(&pin_GPIO7), // Y6
20+
MP_ROM_PTR(&pin_GPIO8), // Y7
21+
MP_ROM_PTR(&pin_GPIO46), // Y8
22+
MP_ROM_PTR(&pin_GPIO48) // Y9
23+
}
24+
};
25+
26+
27+
STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
28+
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
29+
30+
// Left header, module facing down.
31+
{ MP_ROM_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17)},
32+
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO17)},
33+
34+
{ MP_ROM_QSTR(MP_QSTR_IO15), MP_ROM_PTR(&pin_GPIO15)},
35+
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO15)},
36+
37+
{ MP_ROM_QSTR(MP_QSTR_IO16), MP_ROM_PTR(&pin_GPIO16)},
38+
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO16)},
39+
40+
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
41+
42+
{ MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) },
43+
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO2) },
44+
45+
{ MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) },
46+
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO3) },
47+
48+
// I2C cannot be used when CAM_I2C is in use.
49+
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
50+
51+
{ MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) },
52+
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO0) },
53+
{ MP_ROM_QSTR(MP_QSTR_BOOT), MP_ROM_PTR(&pin_GPIO0) },
54+
55+
{ MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) },
56+
{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO9) },
57+
58+
{ MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18)},
59+
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO18)},
60+
61+
{ MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) },
62+
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO7) },
63+
64+
{ MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38)},
65+
{ MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO38)},
66+
67+
{ MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) },
68+
{ MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO3) },
69+
70+
{ MP_ROM_QSTR(MP_QSTR_IO43), MP_ROM_PTR(&pin_GPIO43)},
71+
{ MP_ROM_QSTR(MP_QSTR_TXD), MP_ROM_PTR(&pin_GPIO43)},
72+
73+
{ MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44)},
74+
{ MP_ROM_QSTR(MP_QSTR_RXD), MP_ROM_PTR(&pin_GPIO44)},
75+
76+
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj)},
77+
78+
// Right header, module facing down.
79+
{ MP_ROM_QSTR(MP_QSTR_IO47), MP_ROM_PTR(&pin_GPIO47)},
80+
{ MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO47)},
81+
{ MP_ROM_QSTR(MP_QSTR_PWR), MP_ROM_PTR(&pin_GPIO47)},
82+
83+
{ MP_ROM_QSTR(MP_QSTR_IO11), MP_ROM_PTR(&pin_GPIO11)},
84+
{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11)},
85+
86+
{ MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10)},
87+
{ MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO10)},
88+
89+
{ MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) },
90+
{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO8) },
91+
92+
{ MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) },
93+
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO6) },
94+
95+
{ MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) },
96+
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO5) },
97+
98+
{ MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21)},
99+
{ MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO21)},
100+
{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO21)},
101+
102+
{ MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12)},
103+
{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12)},
104+
105+
{ MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13)},
106+
{ MP_ROM_QSTR(MP_QSTR_IO11), MP_ROM_PTR(&pin_GPIO13)},
107+
108+
{ MP_ROM_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_GPIO14)},
109+
{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO14)},
110+
111+
// Camera data
112+
{ MP_ROM_QSTR(MP_QSTR_CAM_DATA), MP_ROM_PTR(&camera_data_tuple)},
113+
114+
{ MP_ROM_QSTR(MP_QSTR_CAM_VSYNC), MP_ROM_PTR(&pin_GPIO6) },
115+
{ MP_ROM_QSTR(MP_QSTR_CAM_HREF), MP_ROM_PTR(&pin_GPIO42)},
116+
{ MP_ROM_QSTR(MP_QSTR_CAM_PCLK), MP_ROM_PTR(&pin_GPIO5) },
117+
{ MP_ROM_QSTR(MP_QSTR_CAM_XCLK), MP_ROM_PTR(&pin_GPIO45)},
118+
119+
{ MP_ROM_QSTR(MP_QSTR_CAM_I2C), MP_ROM_PTR(&board_cam_i2c_obj)},
120+
};
121+
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#
2+
# Espressif IoT Development Framework Configuration
3+
#
4+
#
5+
# Component config
6+
#
7+
#
8+
# LWIP
9+
#
10+
CONFIG_LWIP_LOCAL_HOSTNAME="espressif-esp32s3"
11+
CONFIG_OV2640_SUPPORT=y
12+
CONFIG_OV7725_SUPPORT=y
13+
# end of LWIP
14+
15+
# end of Component config
16+
17+
# end of Espressif IoT Development Framework Configuration

0 commit comments

Comments
 (0)