Skip to content

Commit 63fc550

Browse files
committed
FireBeetle 2 ESP32-S3
1 parent 64f6db1 commit 63fc550

File tree

5 files changed

+237
-0
lines changed

5 files changed

+237
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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+
// bool espressif_board_reset_pin_number(gpio_num_t pin_number) {
30+
// if (pin_number == 47) {
31+
// /*
32+
// * Turn on PWR by default,
33+
// * so that the board does not power off
34+
// * when usb is disconnected or
35+
// * the power button is released.
36+
// */
37+
// gpio_set_direction(pin_number, GPIO_MODE_DEF_OUTPUT);
38+
// gpio_set_level(pin_number, true);
39+
// return true;
40+
// }
41+
// return false;
42+
// }
43+
44+
// 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: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
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+
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
49+
50+
{ MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) },
51+
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO0) },
52+
{ MP_ROM_QSTR(MP_QSTR_BOOT), MP_ROM_PTR(&pin_GPIO0) },
53+
54+
{ MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) },
55+
{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO9) },
56+
57+
{ MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18)},
58+
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO18)},
59+
60+
{ MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) },
61+
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO7) },
62+
63+
{ MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38)},
64+
{ MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO38)},
65+
66+
{ MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) },
67+
{ MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO3) },
68+
69+
{ MP_ROM_QSTR(MP_QSTR_IO43), MP_ROM_PTR(&pin_GPIO43)},
70+
{ MP_ROM_QSTR(MP_QSTR_TXD), MP_ROM_PTR(&pin_GPIO43)},
71+
72+
{ MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44)},
73+
{ MP_ROM_QSTR(MP_QSTR_RXD), MP_ROM_PTR(&pin_GPIO44)},
74+
75+
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj)},
76+
77+
// Right header, module facing down.
78+
{ MP_ROM_QSTR(MP_QSTR_IO47), MP_ROM_PTR(&pin_GPIO47)},
79+
{ MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO47)},
80+
{ MP_ROM_QSTR(MP_QSTR_PWR), MP_ROM_PTR(&pin_GPIO12)},
81+
82+
{ MP_ROM_QSTR(MP_QSTR_IO11), MP_ROM_PTR(&pin_GPIO11)},
83+
{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11)},
84+
85+
{ MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10)},
86+
{ MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO10)},
87+
88+
{ MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8)},
89+
{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO8)},
90+
91+
{ MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6)},
92+
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO6)},
93+
94+
{ MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5)},
95+
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO5)},
96+
97+
{ MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21)},
98+
{ MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO21)},
99+
{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO21)},
100+
101+
{ MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12)},
102+
{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12)},
103+
104+
{ MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13)},
105+
{ MP_ROM_QSTR(MP_QSTR_IO11), MP_ROM_PTR(&pin_GPIO13)},
106+
107+
{ MP_ROM_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_GPIO14)},
108+
{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO14)},
109+
110+
// Camera data
111+
{ MP_ROM_QSTR(MP_QSTR_CAM_DATA), MP_ROM_PTR(&camera_data_tuple)},
112+
113+
{ MP_ROM_QSTR(MP_QSTR_CAM_VSYNC), MP_ROM_PTR(&pin_GPIO6)},
114+
{ MP_ROM_QSTR(MP_QSTR_CAM_HREF), MP_ROM_PTR(&pin_GPIO42)},
115+
{ MP_ROM_QSTR(MP_QSTR_CAM_PCLK), MP_ROM_PTR(&pin_GPIO5)},
116+
117+
{ MP_ROM_QSTR(MP_QSTR_CAM_I2C), MP_ROM_PTR(&board_cam_i2c_obj)},
118+
};
119+
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
# end of LWIP
12+
13+
# end of Component config
14+
15+
# end of Espressif IoT Development Framework Configuration

0 commit comments

Comments
 (0)