Refactor code structure for improved readability and maintainability
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"default": true,
|
||||
"MD013": false,
|
||||
"MD028": false,
|
||||
"MD031": false,
|
||||
"MD033": {
|
||||
"allowed_elements": ["table", "tr", "td", "th", "img", "br", "b", "a", "p", "div"]
|
||||
},
|
||||
"MD040": false,
|
||||
"MD051": false,
|
||||
"MD058": false,
|
||||
"MD060": false
|
||||
}
|
||||
22
README.md
|
|
@ -68,21 +68,21 @@ Component Picker showing 48 available components with visual previews, search, a
|
|||
|
||||
<table>
|
||||
<tr>
|
||||
<td align="center"><img src="frontend/public/boards/pi-pico.svg" width="130" alt="Raspberry Pi Pico"/><br/><b>Raspberry Pi Pico</b></td>
|
||||
<td align="center"><img src="frontend/public/boards/pi-pico-w.svg" width="130" alt="Raspberry Pi Pico W"/><br/><b>Raspberry Pi Pico W</b></td>
|
||||
<td align="center"><img src="frontend/public/boards/esp32-devkit-c-v4.svg" width="130" alt="ESP32 DevKit C"/><br/><b>ESP32 DevKit C</b></td>
|
||||
<td align="center"><img src="frontend/public/boards/esp32-s3.svg" width="130" alt="ESP32-S3"/><br/><b>ESP32-S3</b></td>
|
||||
<td align="center"><img src="docs/img/boards/pi-pico.png" width="140" alt="Raspberry Pi Pico"/><br/><b>Raspberry Pi Pico</b></td>
|
||||
<td align="center"><img src="docs/img/boards/pi-pico-w.png" width="140" alt="Raspberry Pi Pico W"/><br/><b>Raspberry Pi Pico W</b></td>
|
||||
<td align="center"><img src="docs/img/boards/esp32-devkit-c-v4.png" width="140" alt="ESP32 DevKit C"/><br/><b>ESP32 DevKit C</b></td>
|
||||
<td align="center"><img src="docs/img/boards/esp32-s3.png" width="140" alt="ESP32-S3"/><br/><b>ESP32-S3</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><img src="frontend/public/boards/esp32-c3.svg" width="130" alt="ESP32-C3"/><br/><b>ESP32-C3</b></td>
|
||||
<td align="center"><img src="frontend/public/boards/xiao-esp32-c3.svg" width="130" alt="Seeed XIAO ESP32-C3"/><br/><b>Seeed XIAO ESP32-C3</b></td>
|
||||
<td align="center"><img src="frontend/public/boards/esp32c3-supermini.svg" width="130" alt="ESP32-C3 SuperMini"/><br/><b>ESP32-C3 SuperMini</b></td>
|
||||
<td align="center"><img src="frontend/public/boards/esp32-cam.svg" width="130" alt="ESP32-CAM"/><br/><b>ESP32-CAM</b></td>
|
||||
<td align="center"><img src="docs/img/boards/esp32-c3.png" width="140" alt="ESP32-C3"/><br/><b>ESP32-C3</b></td>
|
||||
<td align="center"><img src="docs/img/boards/xiao-esp32-c3.png" width="140" alt="Seeed XIAO ESP32-C3"/><br/><b>Seeed XIAO ESP32-C3</b></td>
|
||||
<td align="center"><img src="docs/img/boards/esp32c3-supermini.png" width="140" alt="ESP32-C3 SuperMini"/><br/><b>ESP32-C3 SuperMini</b></td>
|
||||
<td align="center"><img src="docs/img/boards/esp32-cam.png" width="140" alt="ESP32-CAM"/><br/><b>ESP32-CAM</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><img src="frontend/public/boards/xiao-esp32-s3.svg" width="130" alt="Seeed XIAO ESP32-S3"/><br/><b>Seeed XIAO ESP32-S3</b></td>
|
||||
<td align="center"><img src="frontend/public/boards/arduino-nano-esp32.svg" width="130" alt="Arduino Nano ESP32"/><br/><b>Arduino Nano ESP32</b></td>
|
||||
<td align="center"><img src="frontend/public/boards/Raspberry_Pi_3.svg" width="130" alt="Raspberry Pi 3B"/><br/><b>Raspberry Pi 3B</b></td>
|
||||
<td align="center"><img src="docs/img/boards/xiao-esp32-s3.png" width="140" alt="Seeed XIAO ESP32-S3"/><br/><b>Seeed XIAO ESP32-S3</b></td>
|
||||
<td align="center"><img src="docs/img/boards/arduino-nano-esp32.png" width="140" alt="Arduino Nano ESP32"/><br/><b>Arduino Nano ESP32</b></td>
|
||||
<td align="center"><img src="docs/img/boards/Raspberry_Pi_3.png" width="140" alt="Raspberry Pi 3B"/><br/><b>Raspberry Pi 3B</b></td>
|
||||
<td align="center">Arduino Uno / Nano / Mega<br/>(ATmega328p / 2560)</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -7,6 +7,18 @@
|
|||
|
||||
> **Note on ESP32-C3:** The ESP32-C3, XIAO ESP32-C3, and ESP32-C3 SuperMini boards use the **RISC-V RV32IMC** architecture and have their own in-browser emulator. See → [RISCV_EMULATION.md](./RISCV_EMULATION.md)
|
||||
|
||||
## Supported Boards
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td align="center"><img src="img/boards/esp32-devkit-c-v4.png" width="160" alt="ESP32 DevKit C V4"/><br/><b>ESP32 DevKit C V4</b></td>
|
||||
<td align="center"><img src="img/boards/esp32-s3.png" width="160" alt="ESP32-S3"/><br/><b>ESP32-S3</b></td>
|
||||
<td align="center"><img src="img/boards/esp32-cam.png" width="160" alt="ESP32-CAM"/><br/><b>ESP32-CAM</b></td>
|
||||
<td align="center"><img src="img/boards/xiao-esp32-s3.png" width="160" alt="Seeed XIAO ESP32-S3"/><br/><b>Seeed XIAO ESP32-S3</b></td>
|
||||
<td align="center"><img src="img/boards/arduino-nano-esp32.png" width="160" alt="Arduino Nano ESP32"/><br/><b>Arduino Nano ESP32</b></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
---
|
||||
|
||||
## Table of Contents
|
||||
|
|
|
|||
|
|
@ -57,6 +57,12 @@ There is **no compilation step** for the Raspberry Pi: you write a Python script
|
|||
|
||||
## 2. Supported Boards
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td align="center"><img src="img/boards/Raspberry_Pi_3.png" width="180" alt="Raspberry Pi 3B"/><br/><b>Raspberry Pi 3B</b></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
| Board | QEMU Machine | CPU | Notes |
|
||||
| ----- | ------------ | --- | ----- |
|
||||
| Raspberry Pi 3B | `raspi3b` | BCM2837, 4× Cortex-A53 | Full Raspberry Pi OS support |
|
||||
|
|
@ -172,7 +178,7 @@ Both ports are allocated dynamically at startup to avoid conflicts on the host m
|
|||
|
||||
The `gpio_shim.py` module is injected into the Raspberry Pi OS at the standard `RPi.GPIO` installation path:
|
||||
|
||||
```
|
||||
```text
|
||||
/usr/local/lib/python3.11/dist-packages/RPi/GPIO.py
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -48,6 +48,14 @@ Boards based on **ESP32-C3** use Espressif's **ESP32-C3** processor, which imple
|
|||
|
||||
## 2. Supported Boards
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td align="center"><img src="img/boards/esp32-c3.png" width="180" alt="ESP32-C3 DevKit"/><br/><b>ESP32-C3 DevKit</b></td>
|
||||
<td align="center"><img src="img/boards/xiao-esp32-c3.png" width="180" alt="Seeed XIAO ESP32-C3"/><br/><b>Seeed XIAO ESP32-C3</b></td>
|
||||
<td align="center"><img src="img/boards/esp32c3-supermini.png" width="180" alt="ESP32-C3 SuperMini"/><br/><b>ESP32-C3 SuperMini</b></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
| Board | arduino-cli FQBN | Built-in LED |
|
||||
| ----- | ---------------- | ------------ |
|
||||
| ESP32-C3 DevKit | `esp32:esp32:esp32c3` | GPIO 8 |
|
||||
|
|
@ -58,7 +66,7 @@ Boards based on **ESP32-C3** use Espressif's **ESP32-C3** processor, which imple
|
|||
|
||||
## 3. Emulator Architecture
|
||||
|
||||
```
|
||||
```text
|
||||
Arduino Sketch (.ino)
|
||||
│
|
||||
▼ arduino-cli (backend)
|
||||
|
|
@ -225,7 +233,7 @@ See full script: `frontend/src/__tests__/fixtures/esp32c3-blink/build.sh`
|
|||
|
||||
The backend produces a merged **4 MB** image:
|
||||
|
||||
```
|
||||
```text
|
||||
Offset 0x00000: 0xFF (empty)
|
||||
Offset 0x01000: bootloader (ESP32 format image, magic 0xE9)
|
||||
Offset 0x08000: partition table
|
||||
|
|
@ -234,7 +242,7 @@ Offset 0x10000: app binary (ESP32 format image, magic 0xE9) ← parsed here
|
|||
|
||||
### ESP32 Image Header (24 bytes)
|
||||
|
||||
```
|
||||
```text
|
||||
+0x00 magic (0xE9)
|
||||
+0x01 segment_count
|
||||
+0x02 spi_mode
|
||||
|
|
@ -245,7 +253,7 @@ Offset 0x10000: app binary (ESP32 format image, magic 0xE9) ← parsed here
|
|||
|
||||
### Segment Header (8 bytes)
|
||||
|
||||
```
|
||||
```text
|
||||
+0x00 load_addr ← destination virtual address (e.g. 0x42000000)
|
||||
+0x04 data_len
|
||||
+0x08 data[data_len]
|
||||
|
|
@ -401,14 +409,15 @@ Compiles `blink.c` with `riscv32-esp-elf-gcc` (the arduino-cli toolchain) and ve
|
|||
| `reset() clears GPIO state` | Functional reset |
|
||||
|
||||
**Expected result:**
|
||||
```
|
||||
|
||||
```text
|
||||
✓ esp32c3-simulation.test.ts (30 tests) ~500ms
|
||||
✓ esp32c3-blink.test.ts (8 tests) ~300ms
|
||||
```
|
||||
|
||||
### Bare-Metal Test Binary
|
||||
|
||||
```
|
||||
```text
|
||||
frontend/src/__tests__/fixtures/esp32c3-blink/
|
||||
├── blink.c ← bare-metal source code
|
||||
├── link.ld ← linker script (IROM @ 0x42000000, DRAM @ 0x3FC80000)
|
||||
|
|
|
|||
|
|
@ -56,6 +56,13 @@ The **Raspberry Pi Pico** and **Pico W** boards use the **RP2040** microcontroll
|
|||
|
||||
## 2. Supported Boards
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td align="center"><img src="img/boards/pi-pico.png" width="180" alt="Raspberry Pi Pico"/><br/><b>Raspberry Pi Pico</b></td>
|
||||
<td align="center"><img src="img/boards/pi-pico-w.png" width="180" alt="Raspberry Pi Pico W"/><br/><b>Raspberry Pi Pico W</b></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
| Board | arduino-cli FQBN | Built-in LED | Notes |
|
||||
| ----- | ---------------- | ------------ | ----- |
|
||||
| Raspberry Pi Pico | `rp2040:rp2040:rpipico` | GPIO 25 | Standard Pico |
|
||||
|
|
|
|||
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 7.2 MiB |