|
1 | 1 | # Built-in Actions
|
2 | 2 |
|
3 |
| -::: tip Programming in high-level languages |
| 3 | +The WARDuino virtual machine includes built-in actions (sometimes we refer to these as primitives) that provide access to hardware and IoT specific functionality in WebAssembly programs. |
4 | 4 |
|
5 |
| -Language specific libraries for AssemblyScript and Rust, give access to the built-in primitives. [This guide](/guide/get-started) has more information on how to get started with them. |
| 5 | +## WebAssembly Actions |
6 | 6 |
|
7 |
| -::: |
| 7 | +The built-in actions are implemented seperately for each hardware platform. |
| 8 | +We group the built-in actions into modules, which are listed in the table below. |
8 | 9 |
|
9 |
| -The WARDuino virtual machine includes built-in primitives that provide access to hardware and IoT specific functionality to WebAssembly programs. |
| 10 | +| Module | Emulator | Arduino | ESP IDF | Zephyr | Open Bot Brain | |
| 11 | +|:------------------- |:--------:|:---------------------:|:---------------------:|:---------------------:|:---------------------:| |
| 12 | +| analog I/O | ➖ | :white_check_mark: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | |
| 13 | +| digital I/O | ⏪ | :white_check_mark: | :white_check_mark: | ⏪ | ⏪ | |
| 14 | +| external interrupts | ✅ | :white_check_mark: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | |
| 15 | +| http | ➖ | :construction_worker: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | |
| 16 | +| mqtt | ➖ | :construction_worker: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | |
| 17 | +| neopixel | ➖ | :construction_worker: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | |
| 18 | +| servo motors | ➖ | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | ⏪ | |
| 19 | +| serial | ✅ | :white_check_mark: | :heavy_minus_sign: | :construction_worker: | :construction_worker: | |
| 20 | +| spi | ➖ | :white_check_mark: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | |
| 21 | +| time | ✅ | :white_check_mark: | :construction_worker: | :heavy_minus_sign: | :heavy_minus_sign: | |
| 22 | +| wifi | ➖ | :white_check_mark: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | |
10 | 23 |
|
11 |
| -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. |
12 |
| - |
13 |
| -| Module | Arduino | ESP IDF | Zephyr | |
14 |
| -|:------------------- |:---------------------:|:---------------------:|:---------------------:| |
15 |
| -| analog I/O | :white_check_mark: | :heavy_minus_sign: | :heavy_minus_sign: | |
16 |
| -| digital I/O | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
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: | :construction_worker: | |
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: | |
| 24 | +⏪ = implemented and reversible | ✅ = implemented | 👷 = partially implemented | ➖ = not implemented |
25 | 25 |
|
26 |
| -:white_check_mark: = implemented | :construction_worker: = partially implemented | :heavy_minus_sign: = not implemented |
| 26 | +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. |
27 | 27 |
|
28 |
| -## Using Primitives |
| 28 | +### Using Actions |
29 | 29 |
|
30 |
| -The primitives can be imported in WebAssembly from the `env` module. |
| 30 | +The actions can be imported in WebAssembly from the `env` module. |
31 | 31 |
|
32 | 32 | ```wasm
|
33 | 33 | (import "env" "chip_delay" (func $delay (type $int->void)))
|
34 | 34 | ```
|
35 | 35 |
|
36 |
| -## Custom Primitives |
| 36 | +## Custom Actions |
37 | 37 |
|
38 | 38 | The WARDuino virtual machine is open-source, and developers are encouraged to extend the existing primitives with their own functionality.
|
39 | 39 |
|
0 commit comments