Skip to content

Commit d92442f

Browse files
committed
Add config for build-time version data + update docs
1 parent c80d2e1 commit d92442f

8 files changed

Lines changed: 122 additions & 62 deletions

File tree

warduino/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ basement_dist
1414
.idea
1515
*.sh
1616
.obsidian
17+
.temp

warduino/.vitepress/config.data.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export default {
2+
load() {
3+
return {
4+
vm: {
5+
version: '0.4.3'
6+
},
7+
plugin: {
8+
version: '0.4.1'
9+
}
10+
}
11+
}
12+
}

warduino/guide/get-started.md

Lines changed: 66 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
---
22
next: 'Examples'
33
---
4+
5+
<script setup>
6+
import { data } from '../.vitepress/config.data.ts'
7+
</script>
8+
49
# Getting Started
510

611
In this guide, you will find instructions on how to start programming software for microcontrollers in AssemblyScript and Rust by using WARDuino.
@@ -24,7 +29,7 @@ You can download them from [GitHub](https://github.com/TOPLLab/WARDuino-libs).
2429
::: code-group
2530

2631
```bash [AS]
27-
npm install as-warduino
32+
npm install 'https://gitpkg.now.sh/TOPLLab/WARDuino-libs/glue/assemblyscript?main'
2833
```
2934

3035
```bash [Rust]
@@ -36,60 +41,38 @@ cargo install warduino
3641
The language library provides access to the [primitives](/reference/primitives) of WARDuino directly from AssemblyScript or Rust.
3742
Once you have written your program and compiled it to WebAssembly, you need to install WARDuino and the toolchains of the platform you are targeting.
3843

39-
```bash
44+
45+
```bash-vue
4046
cd $HOME/Arduino/libraries/
41-
git clone --recurse-submodules --branch v0.4.3 git@github.com:TOPLLab/WARDuino.git
47+
git clone --recurse-submodules --branch v{{ data.vm.version }} git@github.com:TOPLLab/WARDuino.git
4248
```
4349

44-
WARDuino currently supports both the Arduino and ESP-IDF toolchains. To use Arduino, you need to install the [arduino-cli](https://github.com/arduino/arduino-cli). For ESP-IDF you need to install the full toolchain, instructions can be found on the [official website](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html#get-started-step-by-step).
4550

46-
## 🛠️ Arduino Toolchain Setup {#arduino}
47-
48-
In order to setup the Arduino toolchain for WARDuino, you need to first install the [arduino-cli](https://arduino.github.io/arduino-cli/0.21/installation/).
49-
You will also need `python3` with the `pyserial` package.
50-
51-
Second, create the config file:
5251

53-
```bash
54-
arduino-cli config init
55-
```
52+
WARDuino currently supports both the Arduino and ESP-IDF toolchains. To use Arduino, you need to install the [arduino-cli](https://github.com/arduino/arduino-cli). For ESP-IDF you need to install the full toolchain, instructions can be found on the [official website](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html#get-started-step-by-step).
5653

57-
If you need additional boards, such as the esp32 boards, you can add them in the generated config file.
54+
## 🎉 Your First Project
5855

59-
To find the location of your config file you can run:
56+
To get started quickly, you can use the [AssemblyScript template](https://github.com/TOPLLab/as-warduino-template).
6057

6158
```bash
62-
arduino-cli config dump --verbose
59+
git clone git@github.com:TOPLLab/as-warduino-template.git
60+
cd as-warduino-template
61+
npm i
6362
```
6463

65-
Add the ESP32 board manager URL to the config file:
66-
67-
```yaml
68-
board_manager:
69-
additional_urls:
70-
- https://espressif.github.io/arduino-esp32/package_esp32_index.json
71-
```
72-
73-
Then, update the index and install the ESP32 platform.
64+
Now you can compile the example program.
7465

7566
```bash
76-
arduino-cli core update-index
77-
arduino-cli core install esp32:esp32
67+
npm run build
7868
```
7969

80-
::: warning
81-
To use ESP32 boards with WARDuino you need at least version 2.0.2 of the board manager.
82-
:::
83-
84-
Thirdly, make sure you install the `PubSubClient` and `Adafruit NeoPixel` library, which are used by some primitives.
70+
Now you can flash your program.
8571

8672
```bash
87-
arduino-cli lib install "PubSubClient" # for MQTT
88-
arduino-cli lib install "Adafruit NeoPixel"
73+
cd ~/Arduino/libraries/WARDuino/
8974
```
9075

91-
If you haven't done so already, clone (or symlink) the WARDuino repository to `~/Arduino/libraries/WARDuino` to make it available to Arduino. (see [#installation](#installation))
92-
9376
## 📸 Flashing using Arduino
9477

9578
After setting up the Arduino toolchain, you can upload your programs with the Makefile in the `platforms/Arduino` folder of the WARDuino virtual machine.
@@ -140,3 +123,50 @@ make flash
140123

141124
Or simply run `idf.py flash`.
142125

126+
## 🛠️ Arduino Toolchain Setup {#arduino}
127+
128+
In order to setup the Arduino toolchain for WARDuino, you need to first install the [arduino-cli](https://arduino.github.io/arduino-cli/0.21/installation/).
129+
You will also need `python3` with the `pyserial` package.
130+
131+
Second, create the config file:
132+
133+
```bash
134+
arduino-cli config init
135+
```
136+
137+
If you need additional boards, such as the esp32 boards, you can add them in the generated config file.
138+
139+
To find the location of your config file you can run:
140+
141+
```bash
142+
arduino-cli config dump --verbose
143+
```
144+
145+
Add the ESP32 board manager URL to the config file:
146+
147+
```yaml
148+
board_manager:
149+
additional_urls:
150+
- https://espressif.github.io/arduino-esp32/package_esp32_index.json
151+
```
152+
153+
Then, update the index and install the ESP32 platform.
154+
155+
```bash
156+
arduino-cli core update-index
157+
arduino-cli core install esp32:esp32
158+
```
159+
160+
::: warning
161+
To use ESP32 boards with WARDuino you need at least version 2.0.2 of the board manager.
162+
:::
163+
164+
Thirdly, make sure you install the `PubSubClient` and `Adafruit NeoPixel` library, which are used by some primitives.
165+
166+
```bash
167+
arduino-cli lib install "PubSubClient" # for MQTT
168+
arduino-cli lib install "Adafruit NeoPixel"
169+
```
170+
171+
If you haven't done so already, clone (or symlink) the WARDuino repository to `~/Arduino/libraries/WARDuino` to make it available to Arduino. (see [#installation](#installation))
172+

warduino/guide/plugin/get-started.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
<script setup>
2+
import { data } from '../../.vitepress/config.data.ts'
3+
</script>
14
# Getting Started
25

36
## Launch the Plugin {#launch}
@@ -18,9 +21,9 @@ The template contains the correct launch file.
1821
To use the WARDuino plugin to debug your project, you need to create a `launch.json` file in the `.vscode` subfolder of your project root directory [<sup>\[1\]</sup>](https://code.visualstudio.com/docs/editor/debugging).
1922
The file should look like this:
2023

21-
```json
24+
```json-vue
2225
{
23-
"version": "0.4.1",
26+
"version": "{{ data.plugin.version }}",
2427
"configurations": [
2528
{
2629
"type": "WARDuinoDBG",

warduino/guide/plugin/index.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1+
<script setup>
2+
import { data } from '../../.vitepress/config.data.ts'
3+
4+
const vm = "https://github.com/TOPLLab/WARDuino/releases/tag/v" + data.vm.version;
5+
const plugin = "https://github.com/TOPLLab/WARDuino-VSCode/releases/tag/v" + data.plugin.version;
6+
</script>
17
# VS Code Plugin
28

3-
::: tip WARDuino VS Code 0.4.1
9+
::: tip WARDuino VS Code {{ data.plugin.version }}
410

5-
This page describes the VS Code plugin [version 0.4.1](https://github.com/TOPLLab/WARDuino-VSCode/releases/tag/v0.4.1), which works with WARDuino [version 0.4.2](https://github.com/TOPLLab/WARDuino/releases/tag/v0.4.2).
11+
This page describes the VS Code plugin <a :href="plugin" target="_blank">version {{ data.plugin.version }}</a>, which works with WARDuino <a :href="vm" target="_blank">version {{ data.vm.version }}</a>.
612

713
:::
814

warduino/reference/debug-protocol.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
---
22
next: EDWARD
33
---
4+
<script setup>
5+
import { data } from '../.vitepress/config.data.ts'
6+
7+
const url = "https://github.com/TOPLLab/WARDuino/releases/tag/v" + data.vm.version;
8+
</script>
49
# Debug Protocol Reference Sheet
510

6-
::: tip Debug protocol 0.4.3
11+
::: tip Debug protocol {{ data.vm.version }}
712

8-
This page describes the debug protocol of WARDuino [version 0.4.3](https://github.com/TOPLLab/WARDuino/releases/tag/v0.4.3).
13+
This page describes the debug protocol of WARDuino <a :href="url" target="_blank">version {{ data.vm.version }}</a>.
914

1015
:::
1116

warduino/reference/platforms.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,17 @@ This is a major constraint for some microcontrollers, however all other parts of
1313

1414
The following table lists the devices on which the WARDuino VM has been verified to work.
1515

16-
| Device Family / OS | CLI | Arduino | ESP IDF | Callbacks |
17-
|:---------------------------------------------------------------------------------------------------------------------------- |:------------------:|:------------------:|:-----------------------------------------------------------------:|:------------------:|
18-
| Windows | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: |
19-
| Linux | :white_check_mark: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: |
20-
| macOS | :white_check_mark: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: |
21-
| [ESP8266](https://www.espressif.com/en/products/socs/esp8266) | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :heavy_minus_sign: |
22-
| [ESP32 WROOM](https://www.espressif.com/sites/default/files/documentation/esp32-wroom-32e_esp32-wroom-32ue_datasheet_en.pdf) | :heavy_minus_sign: | :white_check_mark: | :exclamation:[\*](https://github.com/TOPLLab/WARDuino/issues/210) | :exclamation: |
23-
| [ESP32 WROVER](https://www.espressif.com/sites/default/files/documentation/esp32-wrover-e_esp32-wrover-ie_datasheet_en.pdf) | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
16+
| Device Family / OS | CLI | Arduino | Zephyr | ESP IDF | Callbacks |
17+
|:---------------------------------------------------------------------------------------------------------------------------- |:------------------:|:------------------:|:------------------:|:-----------------------------------------------------------------:|:------------------:|
18+
| Windows | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: |
19+
| Linux | :white_check_mark: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: |
20+
| macOS | :white_check_mark: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: |
21+
| [ESP8266](https://www.espressif.com/en/products/socs/esp8266) | :heavy_minus_sign: | :white_check_mark: | :heavy_minus_sign: | :white_check_mark: | :heavy_minus_sign: |
22+
| [ESP32 WROOM](https://www.espressif.com/sites/default/files/documentation/esp32-wroom-32e_esp32-wroom-32ue_datasheet_en.pdf) | :heavy_minus_sign: | :white_check_mark: | :heavy_minus_sign: | :exclamation:[\*](https://github.com/TOPLLab/WARDuino/issues/210) | :exclamation: |
23+
| [ESP32 WROVER](https://www.espressif.com/sites/default/files/documentation/esp32-wrover-e_esp32-wrover-ie_datasheet_en.pdf) | :heavy_minus_sign: | :white_check_mark: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: |
24+
| [Openbot Brain](https://github.com/OpenBotBrain) | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :heavy_minus_sign: | :heavy_minus_sign: |
25+
| STM32 Cortex M4 | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :heavy_minus_sign: | :heavy_minus_sign: |
26+
| [Adafruit ESP32 Feather V2](https://www.adafruit.com/product/5400) | :heavy_minus_sign: | :white_check_mark: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: |
2427

2528
:white_check_mark: = supported | :exclamation: = unstable | :heavy_minus_sign: = not supported
2629

warduino/reference/primitives.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ The WARDuino virtual machine includes built-in primitives that provide access to
1010

1111
The built-in primitives are divided conceptually into different modules, according to the functionality they provide. The primitives are hardware dependent and so have to be implemented for each hardware platform separately. The table below list all modules, and on which platforms they are supported.
1212

13-
| Module | Arduino | ESP IDF | Raspberry Pi |
14-
|:------------------- |:---------------------:|:---------------------:|:------------------:|
15-
| analog I/O | :white_check_mark: | :heavy_minus_sign: | :heavy_minus_sign: |
16-
| digital I/O | :white_check_mark: | :white_check_mark: | :heavy_minus_sign: |
17-
| external interrupts | :white_check_mark: | :heavy_minus_sign: | :heavy_minus_sign: |
18-
| http | :construction_worker: | :heavy_minus_sign: | :heavy_minus_sign: |
19-
| mqtt | :construction_worker: | :heavy_minus_sign: | :heavy_minus_sign: |
20-
| neopixel | :construction_worker: | :heavy_minus_sign: | :heavy_minus_sign: |
21-
| serial | :white_check_mark: | :heavy_minus_sign: | :heavy_minus_sign: |
22-
| spi | :white_check_mark: | :heavy_minus_sign: | :heavy_minus_sign: |
23-
| time | :white_check_mark: | :construction_worker: | :heavy_minus_sign: |
24-
| wifi | :white_check_mark: | :heavy_minus_sign: | :heavy_minus_sign: |
13+
| Module | Arduino | ESP IDF | Zephyr |
14+
|:------------------- |:---------------------:|:---------------------:|:---------------------:|
15+
| analog I/O | :white_check_mark: | :heavy_minus_sign: | :construction_worker: |
16+
| digital I/O | :white_check_mark: | :white_check_mark: | :construction_worker: |
17+
| external interrupts | :white_check_mark: | :heavy_minus_sign: | :heavy_minus_sign: |
18+
| http | :construction_worker: | :heavy_minus_sign: | :heavy_minus_sign: |
19+
| mqtt | :construction_worker: | :heavy_minus_sign: | :heavy_minus_sign: |
20+
| neopixel | :construction_worker: | :heavy_minus_sign: | :heavy_minus_sign: |
21+
| serial | :white_check_mark: | :heavy_minus_sign: | :heavy_minus_sign: |
22+
| spi | :white_check_mark: | :heavy_minus_sign: | :heavy_minus_sign: |
23+
| time | :white_check_mark: | :construction_worker: | :heavy_minus_sign: |
24+
| wifi | :white_check_mark: | :heavy_minus_sign: | :heavy_minus_sign: |
2525

2626
:white_check_mark: = implemented | :construction_worker: = partially implemented | :heavy_minus_sign: = not implemented
2727

0 commit comments

Comments
 (0)