diff --git a/Makefile b/Makefile index 787b210d..60a5a574 100644 --- a/Makefile +++ b/Makefile @@ -460,6 +460,8 @@ ifneq ($(WASM), 0) @$(MD5SUM) test.wasm $(TINYGO) build -size short -o test.wasm -tags=circuitplay_bluefruit examples/blinky1 @$(MD5SUM) test.wasm + $(TINYGO) build -size short -o test.wasm -tags=mch2022 examples/serial + @$(MD5SUM) test.wasm endif # test all targets/boards $(TINYGO) build -size short -o test.hex -target=pca10040-s132v6 examples/blinky1 @@ -663,6 +665,8 @@ ifneq ($(XTENSA), 0) @$(MD5SUM) test.bin $(TINYGO) build -size short -o test.bin -target m5stack examples/serial @$(MD5SUM) test.bin + $(TINYGO) build -size short -o test.bin -target mch2022 examples/serial + @$(MD5SUM) test.bin endif $(TINYGO) build -size short -o test.bin -target=esp32c3 examples/serial @$(MD5SUM) test.bin diff --git a/README.md b/README.md index 3fa607b9..eb00f7f8 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,7 @@ The following 88 microcontroller boards are currently supported: * [M5Stamp C3](https://docs.m5stack.com/en/core/stamp_c3) * [Makerdiary nRF52840-MDK](https://wiki.makerdiary.com/nrf52840-mdk/) * [Makerdiary nRF52840-MDK USB Dongle](https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/) +* [MCH2022 badge](https://badge.team/docs/badges/mch2022/) * [Microchip SAM E54 Xplained Pro](https://www.microchip.com/developmenttools/productdetails/atsame54-xpro) * [nice!nano](https://docs.nicekeyboards.com/#/nice!nano/) * [Nintendo Switch](https://www.nintendo.com/switch/) diff --git a/src/machine/board_mch2022.go b/src/machine/board_mch2022.go new file mode 100644 index 00000000..1d11e49f --- /dev/null +++ b/src/machine/board_mch2022.go @@ -0,0 +1,29 @@ +//go:build mch2022 +// +build mch2022 + +package machine + +// See: https://badge.team/docs/badges/mch2022/pinout/ + +const ( + UART_TX_PIN Pin = 1 + UART_RX_PIN Pin = 3 + + WS2812 Pin = 5 + + PowerOn Pin = 19 // Set high to enable power to LEDs and SD card + + // I2C pins + SDA_PIN Pin = 22 + SCL_PIN Pin = 21 + + // SPI and related pins (ICE40 and LCD). + LCD_RESET Pin = 25 + LCD_MODE Pin = 26 + LCD_DC Pin = 33 + SPI0_SCK_PIN Pin = 18 + SPI0_SDO_PIN Pin = 23 + SPI0_SDI_PIN Pin = 35 // connected to ICE40 + SPI0_CS_ICE40_PIN Pin = 27 + SPI0_CS_LCD_PIN Pin = 32 +) diff --git a/targets/mch2022.json b/targets/mch2022.json new file mode 100644 index 00000000..5ac58aac --- /dev/null +++ b/targets/mch2022.json @@ -0,0 +1,4 @@ +{ + "inherits": ["esp32"], + "build-tags": ["mch2022"] +}