Skip to content

Commit 3a34acb

Browse files
committed
merge 8.2.x to main
1 parent 3ca9802 commit 3a34acb

File tree

15 files changed

+350
-7
lines changed

15 files changed

+350
-7
lines changed

docs/shared_bindings_matrix.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def get_settings_from_makefile(port_dir, board_name):
191191
settings = {}
192192
for line in contents.stdout.split("\n"):
193193
if line.startswith('CFLAGS ='):
194-
for m in re.findall('-D([A-Z][A-Z0-9_]*)=(\d+)', line):
194+
for m in re.findall(r'-D([A-Z][A-Z0-9_]*)=(\d+)', line):
195195
settings[m[0]] = m[1]
196196
elif m := re.match(r"^([A-Z][A-Z0-9_]*) = (.*)$", line):
197197
settings[m.group(1)] = m.group(2)
@@ -215,12 +215,12 @@ def get_repository_url(directory):
215215
with open(readme, "r") as fp:
216216
for line in fp.readlines():
217217
if m := re.match(
218-
"\s+:target:\s+(http\S+(docs.circuitpython|readthedocs)\S+)\s*",
218+
r"\s+:target:\s+(http\S+(docs.circuitpython|readthedocs)\S+)\s*",
219219
line,
220220
):
221221
path = m.group(1)
222222
break
223-
if m := re.search("<(http[^>]+)>", line):
223+
if m := re.search(r"<(http[^>]+)>", line):
224224
path = m.group(1)
225225
break
226226
if path is None:
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) 2020 Scott Shawcroft for Adafruit Industries
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) 2019 Scott Shawcroft for Adafruit Industries
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+
// Micropython setup
28+
29+
#define MICROPY_HW_BOARD_NAME "BLING!"
30+
#define MICROPY_HW_MCU_NAME "ESP32S3"
31+
32+
#define MICROPY_HW_NEOPIXEL (&pin_GPIO18)
33+
#define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO17)
34+
35+
#define DEFAULT_I2C_BUS_SCL (&pin_GPIO9)
36+
#define DEFAULT_I2C_BUS_SDA (&pin_GPIO8)
37+
38+
#define DEFAULT_SPI_BUS_SCK (&pin_GPIO36)
39+
#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO35)
40+
#define DEFAULT_SPI_BUS_MISO (&pin_GPIO37)
41+
42+
#define DEFAULT_UART_BUS_RX (&pin_GPIO44)
43+
#define DEFAULT_UART_BUS_TX (&pin_GPIO43)
44+
45+
#define DOUBLE_TAP_PIN (&pin_GPIO47)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
USB_VID = 0x303A
2+
USB_PID = 0x8180
3+
USB_PRODUCT = "BLING!"
4+
USB_MANUFACTURER = "UnexpectedMaker"
5+
6+
IDF_TARGET = esp32s3
7+
8+
CIRCUITPY_ESP_FLASH_SIZE = 8MB
9+
CIRCUITPY_ESP_FLASH_MODE = dio
10+
CIRCUITPY_ESP_FLASH_FREQ = 80m
11+
12+
CIRCUITPY_ESP_PSRAM_SIZE = 2MB
13+
CIRCUITPY_ESP_PSRAM_MODE = qio
14+
CIRCUITPY_ESP_PSRAM_FREQ = 80m
15+
16+
# CIRCUITPY_BITBANG_NEOPIXEL = 1
17+
18+
CIRCUITPY_STAGE = 1
19+
20+
# Include these Python libraries in firmware.
21+
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
22+
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SD
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#include "shared-bindings/board/__init__.h"
2+
3+
STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
4+
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
5+
6+
{ MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) },
7+
8+
// Battery voltage sense pin
9+
{ MP_ROM_QSTR(MP_QSTR_VBAT_VOLTAGE), MP_ROM_PTR(&pin_GPIO17) },
10+
11+
// 5V present sense pin
12+
{ MP_ROM_QSTR(MP_QSTR_VBUS_SENSE), MP_ROM_PTR(&pin_GPIO16) },
13+
14+
// SPI
15+
{ MP_ROM_QSTR(MP_QSTR_MO), MP_ROM_PTR(&pin_GPIO35) },
16+
{ MP_ROM_QSTR(MP_QSTR_MI), MP_ROM_PTR(&pin_GPIO37) },
17+
{ MP_ROM_QSTR(MP_QSTR_CLK), MP_ROM_PTR(&pin_GPIO36) },
18+
19+
// I2C
20+
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO8) },
21+
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO9) },
22+
23+
// uSD Card
24+
{ MP_ROM_QSTR(MP_QSTR_SD_DETECT), MP_ROM_PTR(&pin_GPIO38) },
25+
{ MP_ROM_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_GPIO21) },
26+
27+
// User Buttons
28+
{ MP_ROM_QSTR(MP_QSTR_BUTTON_A), MP_ROM_PTR(&pin_GPIO11) },
29+
{ MP_ROM_QSTR(MP_QSTR_BUTTON_B), MP_ROM_PTR(&pin_GPIO10) },
30+
{ MP_ROM_QSTR(MP_QSTR_BUTTON_C), MP_ROM_PTR(&pin_GPIO33) },
31+
{ MP_ROM_QSTR(MP_QSTR_BUTTON_D), MP_ROM_PTR(&pin_GPIO34) },
32+
33+
// I2S Mic ICS-43434
34+
{ MP_ROM_QSTR(MP_QSTR_I2S_MIC_DATA), MP_ROM_PTR(&pin_GPIO41) },
35+
{ MP_ROM_QSTR(MP_QSTR_I2S_MIC_BCLK), MP_ROM_PTR(&pin_GPIO42) },
36+
{ MP_ROM_QSTR(MP_QSTR_I2S_MIC_WS), MP_ROM_PTR(&pin_GPIO40) },
37+
{ MP_ROM_QSTR(MP_QSTR_I2S_MIC_SEL), MP_ROM_PTR(&pin_GPIO39) },
38+
39+
// I2S Amplifier MAX98357A
40+
{ MP_ROM_QSTR(MP_QSTR_I2S_MIC_LRCLK), MP_ROM_PTR(&pin_GPIO1) },
41+
{ MP_ROM_QSTR(MP_QSTR_I2S_MIC_BCLK), MP_ROM_PTR(&pin_GPIO2) },
42+
{ MP_ROM_QSTR(MP_QSTR_I2S_MIC_DATA), MP_ROM_PTR(&pin_GPIO3) },
43+
{ MP_ROM_QSTR(MP_QSTR_I2S_MIC_SD), MP_ROM_PTR(&pin_GPIO4) },
44+
45+
// RTC Interrupt Pin
46+
{ MP_ROM_QSTR(MP_QSTR_RTC_INT), MP_ROM_PTR(&pin_GPIO7) },
47+
48+
// LED Matrix
49+
{ MP_ROM_QSTR(MP_QSTR_MATRIX_POWER), MP_ROM_PTR(&pin_GPIO5) },
50+
{ MP_ROM_QSTR(MP_QSTR_MATRIX_DATA), MP_ROM_PTR(&pin_GPIO18) },
51+
52+
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
53+
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
54+
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
55+
};
56+
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="UMBling"
11+
# end of LWIP
12+
13+
# end of Component config
14+
15+
# end of Espressif IoT Development Framework Configuration
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) 2020 Scott Shawcroft for Adafruit Industries
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: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2019 Scott Shawcroft for Adafruit Industries
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+
// Micropython setup
28+
29+
#define MICROPY_HW_BOARD_NAME "TinyWATCH S3"
30+
#define MICROPY_HW_MCU_NAME "ESP32S3"
31+
32+
#define CIRCUITPY_BOARD_I2C (2)
33+
#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO9, .sda = &pin_GPIO8}, \
34+
{.scl = &pin_GPIO10, .sda = &pin_GPIO5}}
35+
36+
#define DEFAULT_SPI_BUS_SCK (&pin_GPIO36)
37+
#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO35)
38+
#define DEFAULT_SPI_BUS_MISO (&pin_GPIO37)
39+
40+
#define DEFAULT_UART_BUS_RX (&pin_GPIO44)
41+
#define DEFAULT_UART_BUS_TX (&pin_GPIO43)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
USB_VID = 0x303A
2+
USB_PID = 0x81B1
3+
USB_PRODUCT = "TinyWATCH S3"
4+
USB_MANUFACTURER = "UnexpectedMaker"
5+
6+
IDF_TARGET = esp32s3
7+
8+
CIRCUITPY_ESP_FLASH_SIZE = 8MB
9+
CIRCUITPY_ESP_FLASH_MODE = dio
10+
CIRCUITPY_ESP_FLASH_FREQ = 80m
11+
12+
CIRCUITPY_ESP_PSRAM_SIZE = 2MB
13+
CIRCUITPY_ESP_PSRAM_MODE = qio
14+
CIRCUITPY_ESP_PSRAM_FREQ = 80m
15+
16+
# CIRCUITPY_BITBANG_NEOPIXEL = 1
17+
18+
CIRCUITPY_STAGE = 1
19+
20+
# Include these Python libraries in firmware.
21+
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_ST7789
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#include "shared-bindings/board/__init__.h"
2+
3+
CIRCUITPY_BOARD_BUS_SINGLETON(touch_i2c, i2c, 1)
4+
5+
STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
6+
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
7+
8+
{ MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) },
9+
{ MP_ROM_QSTR(MP_QSTR_USER_BUTTON), MP_ROM_PTR(&pin_GPIO0) },
10+
11+
// Buzzer
12+
{ MP_ROM_QSTR(MP_QSTR_BUZZER), MP_ROM_PTR(&pin_GPIO18) },
13+
14+
// SPI
15+
{ MP_ROM_QSTR(MP_QSTR_MO), MP_ROM_PTR(&pin_GPIO35) },
16+
{ MP_ROM_QSTR(MP_QSTR_MI), MP_ROM_PTR(&pin_GPIO37) },
17+
{ MP_ROM_QSTR(MP_QSTR_CLK), MP_ROM_PTR(&pin_GPIO36) },
18+
19+
// TFT Screen IO
20+
{ MP_ROM_QSTR(MP_QSTR_TFT_CS), MP_ROM_PTR(&pin_GPIO16) },
21+
{ MP_ROM_QSTR(MP_QSTR_TFT_DC), MP_ROM_PTR(&pin_GPIO15) },
22+
{ MP_ROM_QSTR(MP_QSTR_TFT_RESET), MP_ROM_PTR(&pin_GPIO17) },
23+
{ MP_ROM_QSTR(MP_QSTR_TFT_BACKLIGHT), MP_ROM_PTR(&pin_GPIO13) },
24+
25+
// I2C - BUS1 - Main Peripherals
26+
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
27+
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO8) },
28+
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO9) },
29+
30+
// I2C - BUS2 - Touch IC
31+
{ MP_ROM_QSTR(MP_QSTR_TOUCH_I2C), MP_ROM_PTR(&board_touch_i2c_obj) },
32+
{ MP_ROM_QSTR(MP_QSTR_SDA2), MP_ROM_PTR(&pin_GPIO5) },
33+
{ MP_ROM_QSTR(MP_QSTR_SCL2), MP_ROM_PTR(&pin_GPIO10) },
34+
{ MP_ROM_QSTR(MP_QSTR_TOUCH_INT), MP_ROM_PTR(&pin_GPIO11) },
35+
{ MP_ROM_QSTR(MP_QSTR_TOUCH_RESET), MP_ROM_PTR(&pin_GPIO12) },
36+
37+
// RTC Interrupt Pin
38+
{ MP_ROM_QSTR(MP_QSTR_RTC_INT), MP_ROM_PTR(&pin_GPIO4) },
39+
40+
// Fuel Gauge Interrupt/Alert Pin
41+
{ MP_ROM_QSTR(MP_QSTR_FG_ALERT), MP_ROM_PTR(&pin_GPIO14) },
42+
43+
// BMI270 Interrupt Pins
44+
{ MP_ROM_QSTR(MP_QSTR_BMI_INT1), MP_ROM_PTR(&pin_GPIO6) },
45+
{ MP_ROM_QSTR(MP_QSTR_BMI_INT2), MP_ROM_PTR(&pin_GPIO7) },
46+
47+
// I2S Mic ICS-43434
48+
{ MP_ROM_QSTR(MP_QSTR_I2S_MIC_DATA), MP_ROM_PTR(&pin_GPIO1) },
49+
{ MP_ROM_QSTR(MP_QSTR_I2S_MIC_BCLK), MP_ROM_PTR(&pin_GPIO2) },
50+
{ MP_ROM_QSTR(MP_QSTR_I2S_MIC_WS), MP_ROM_PTR(&pin_GPIO3) },
51+
52+
// User Power Control
53+
{ MP_ROM_QSTR(MP_QSTR_USER_PWR_SHUTDOWN), MP_ROM_PTR(&pin_GPIO21) },
54+
55+
// External user FLASH CS pin
56+
{ MP_ROM_QSTR(MP_QSTR_EXT_FLASH_CS), MP_ROM_PTR(&pin_GPIO33) },
57+
58+
// VBUS sense IO to detect if USB power is present
59+
{ MP_ROM_QSTR(MP_QSTR_VBUS_SENSE), MP_ROM_PTR(&pin_GPIO34) },
60+
61+
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
62+
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
63+
};
64+
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

0 commit comments

Comments
 (0)