From 52665308380c7f741863ed3f3fff42d253d876ba Mon Sep 17 00:00:00 2001 From: Oskar Sommer Date: Fri, 11 Oct 2024 18:50:41 +0200 Subject: [PATCH 1/4] add board: esp32c3-supermini --- GNUmakefile | 2 + src/machine/board_esp32c3-supermini.go | 56 ++++++++++++++++++++++++++ targets/esp32c3-supermini.json | 4 ++ 3 files changed, 62 insertions(+) create mode 100644 src/machine/board_esp32c3-supermini.go create mode 100644 targets/esp32c3-supermini.json diff --git a/GNUmakefile b/GNUmakefile index efc70b0ae8..9f2ed1fe9d 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -826,6 +826,8 @@ endif ifneq ($(XTENSA), 0) $(TINYGO) build -size short -o test.bin -target=esp32-mini32 examples/blinky1 @$(MD5SUM) test.bin + $(TINYGO) build -size short -o test.bin -target=esp32-supermini examples/blinky1 + @$(MD5SUM) test.bin $(TINYGO) build -size short -o test.bin -target=nodemcu examples/blinky1 @$(MD5SUM) test.bin $(TINYGO) build -size short -o test.bin -target m5stack-core2 examples/machinetest diff --git a/src/machine/board_esp32c3-supermini.go b/src/machine/board_esp32c3-supermini.go new file mode 100644 index 0000000000..3e1aad1a95 --- /dev/null +++ b/src/machine/board_esp32c3-supermini.go @@ -0,0 +1,56 @@ +//go:build esp32c3_supermini + +// This file contains the pin mappings for the ESP32 supermini boards. +// +// - https://forum.arduino.cc/t/esp32-c3-supermini-pinout/1189850/7 + +package machine + +// Digital Pins +const ( + IO0 = GPIO0 + IO1 = GPIO1 + IO2 = GPIO2 + IO3 = GPIO3 + IO4 = GPIO4 + IO5 = GPIO5 + IO6 = GPIO6 + IO7 = GPIO7 + IO8 = GPIO8 + IO9 = GPIO9 + IO10 = GPIO10 + IO20 = GPIO20 + IO21 = GPIO21 +) + +// Built-in LED +const LED = GPIO8 + +// Analog pins +const ( + A0 = GPIO0 + A1 = GPIO1 + A2 = GPIO2 + A3 = GPIO3 + A4 = GPIO4 + A5 = GPIO5 +) + +// UART pins +const ( + UART_RX_PIN = GPIO20 + UART_TX_PIN = GPIO21 +) + +// I2C pins +const ( + SDA_PIN = GPIO8 + SCL_PIN = GPIO9 +) + +// SPI pins +const ( + SPI_MISO_PIN = GPIO5 + SPI_MOSI_PIN = GPIO6 + SPI_SS_PIN = GPIO7 +) diff --git a/targets/esp32c3-supermini.json b/targets/esp32c3-supermini.json new file mode 100644 index 0000000000..3e4e40895e --- /dev/null +++ b/targets/esp32c3-supermini.json @@ -0,0 +1,4 @@ +{ + "inherits": ["esp32c3"], + "build-tags": ["esp32c3_supermini"] +} From d5cb808e79ea707be24668f7e3ff55af6159c687 Mon Sep 17 00:00:00 2001 From: Oskar Sommer Date: Fri, 3 Jan 2025 17:49:38 +0100 Subject: [PATCH 2/4] fix: typo in GNUmakefile test --- GNUmakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GNUmakefile b/GNUmakefile index 9f2ed1fe9d..0261312262 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -826,7 +826,7 @@ endif ifneq ($(XTENSA), 0) $(TINYGO) build -size short -o test.bin -target=esp32-mini32 examples/blinky1 @$(MD5SUM) test.bin - $(TINYGO) build -size short -o test.bin -target=esp32-supermini examples/blinky1 + $(TINYGO) build -size short -o test.bin -target=esp32c3-supermini examples/blinky1 @$(MD5SUM) test.bin $(TINYGO) build -size short -o test.bin -target=nodemcu examples/blinky1 @$(MD5SUM) test.bin From 4bbe2441bf929fd0607b433213ca915bf6d6b24a Mon Sep 17 00:00:00 2001 From: Oskar Sommer Date: Fri, 3 Jan 2025 17:49:47 +0100 Subject: [PATCH 3/4] add SCK pin --- src/machine/board_esp32c3-supermini.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/machine/board_esp32c3-supermini.go b/src/machine/board_esp32c3-supermini.go index 3e1aad1a95..63e1e7bf0b 100644 --- a/src/machine/board_esp32c3-supermini.go +++ b/src/machine/board_esp32c3-supermini.go @@ -53,4 +53,5 @@ const ( SPI_MISO_PIN = GPIO5 SPI_MOSI_PIN = GPIO6 SPI_SS_PIN = GPIO7 + SPI_SCK_PIN = GPIO4 ) From 42de0ca8b7004d38e5682f83fe5764a92963578e Mon Sep 17 00:00:00 2001 From: Oskar Sommer Date: Sun, 19 Jan 2025 17:59:46 +0100 Subject: [PATCH 4/4] docs(esp32c3-supermini): update source reference url --- src/machine/board_esp32c3-supermini.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/machine/board_esp32c3-supermini.go b/src/machine/board_esp32c3-supermini.go index 63e1e7bf0b..c180ff0e3e 100644 --- a/src/machine/board_esp32c3-supermini.go +++ b/src/machine/board_esp32c3-supermini.go @@ -2,7 +2,7 @@ // This file contains the pin mappings for the ESP32 supermini boards. // -// - https://forum.arduino.cc/t/esp32-c3-supermini-pinout/1189850/7 +// - https://web.archive.org/web/20240805232453/https://dl.artronshop.co.th/ESP32-C3%20SuperMini%20datasheet.pdf package machine