- Rust 75.5%
- Makefile 24.5%
This is a collection of example applications written in Rust that use the RIOT Operating System via the riot-wrappers crate.
For examples in the style of Rust libraries that are on their path to becoming RIOT modules, see the riot-module-examples repository.
For general getting-started instructions for using Rust on RIOT see the RIOT documentation; the OS also contains two minimal examples of its own. This repository contains advanced examples, and is used to illustrate more of the riot-wrappers abstractions.
Examples
bottles: A '99 bottles of beer' program that just prints the device's debug output for some time.
This is used as a first example not because it's particularly microcontroller-ish, but because it can be run both on any board that has a debug UART and on the native board under Linux:
$ cd bottles $ make BOARD=native all term [read the text or abort with Ctrl-C]saul_blink: A program that enumerates a device's LEDs at runtime using RIOT's Sensor Actor Über Layer (SAUL), and toggles them.
Both for demo purposes and to ensure some meaningful action even on the native board, it also registers a "software LED" that, rather than actually lighting up, reports its status changes via stdout.
shell_threads: A demo of the shell integration and using multiple therads. Run it with:
$ make BOARD=stk3700 flash termor:
$ make BOARD=native all termand enter
helpto list the available shell commands.
Further documentation
To retrace the examples and to write own applications, see the riot-wrappers
documentation for the safe wrappers, and the riot-sys
documentation for accessing arbitrary RIOT functions. (Or, almost
arbitrary: as outlined in its Extension docs section, headers that are
not exported yet may need to be added to its riot-headers.h
file).
License
This crate is licensed under the same terms as of the LGPL 2.1, following the license terms of the RIOT Operating System.
It is maintained by Christian M. Amsüss <ca@etonomy.org> as part of the etonomy project, see <https://etonomy.org/>.