Crate wasefire_applet_api
source ·Expand description
Applet-side of the applet API.
This api
crate provides Rust bindings for the Wasm-side of the applet API.
Users should not directly use those bindings but instead use the prelude
crate
that provides higher-level and more convenient access.
The bindings in this crate are automatically generated from a proc-macro based
on a procedural description of the applet API defined in the api-desc
crate.
As such, they follow a precise convention:
- The module hierarchy in the applet API is mapped to the module hierarchy in this crate.
- Type definitions (like enums) are mapped to their definition. If an enum is
used as an error, it provides a
Error::to_result(isize) -> Result<usize, Error>
method to convert signed integer results into RustResult
. - Functions are mapped to their definition but also to a module of the same
name. This module defines 2 structs:
Params
for the parameters of the function andResults
for the results of the function. If a struct is empty, then it is not used. - All parameters and results are 32-bits integers mapping to the
i32
Wasm type, but their Rust type reflect their role. For example:usize
for unsigned integersisize
for signed integers (which may represent someResult<u31, u31>
where the error type may be converted to some enum)*const u8
and*mut u8
for opaque/polymorphic pointers*const T
and*mut T
for transparent pointers whereT
is recursively definedextern "C" fn(data: *const u8, ...)
for closures over some opaque data and possibly additional parameters
Modules§
- Button and touch operations.
- Cryptographic operations.
- Debugging operations.
- Low-level GPIO operations.
- LED operations.
- Platform operations.
- Radio operations.
- Random number generators.
- Persistent storage operations.
- Module of
syscall
. - Timer operations.
- USB operations.
Functions§
- syscall⚠Non-
native
Board-specific syscalls.