examples/leds_rust: Add Rust App for blinking the LED #2462
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
examples/leds_rust
to call NuttX POSIX APIs likeopen()
andioctl()
, so that it blinks an LEDleds_rust
app is also used for testing the GPIO and LED Drivers for Ox64 BL808 SBC and QEMU RISC-V Emulator in Google Summer of Codeleds_rust
be executed locally on Linux / macOS / Windows, by commenting out the first 2 lines of codeexamples/leds
in C, andexamples/hello_rust
in RustNew Files in
examples/leds_rust
Kconfig
: Configuration file forleds_rust
that definesEXAMPLES_LEDS_RUST
Make.defs
: Build the app ifEXAMPLES_LEDS_RUST
is enabledMakefile
: Makefile forleds_rust
leds_rust_main.rs
: Call NuttX POSIX APIs and LED driver to blink the LEDnuttx.rs
: NuttX Module for Rust to access the NuttX POSIX APIs in a safer wayImpact
examples
directory.Testing
We tested on QEMU RISC-V Emulator with
rv-virt:leds
(32-bit) andrv-virt:leds64
(64-bit):