Expand description

Registration and use of SAUL, the Sensor Actuator Uber Layer

This modules falls largely into two parts:

  • For creating and registering SAUL devices, see the registration submodule.

  • RegistryEntry with its various constructors finds sensors or actuators in SAUL, and allows interacting with them.

In mapping SAUL semantics to Rust, some parts are not aligned in full:

  • The Phydat type used here always has a length – as opposed to phydat_t which contains up to PHYDAT_DIM values, and transports the number of used items on the side – but not always.

    This affects sensor data writing, and is documented with the respective calls.

Note that there is a Drivable, Registration type in this module as well; these are deprecated. They are largely identical to the types in registration, but encode choices made that do not allow building the Driver in a const way, and also include unsound Pin-based APIs that were deprecated previously already (along with some lifetimes that are not needed any more since the Pin-based API went away). In a sense, riot_wrappers::saul::registration is the “v2” of the registration interface (just that splitting it up avoided catching such a name).


Tools for registering a Rust device in SAUL



A typed saul_driver_t, created from a Drivable’s build_driver() static method, and used in pinned form in registrations.

A wrapper around phydat_t that keeps the values and the number of valid values in one place.


A discovered SAUL registry entry


Classes of actuators; typically used as details on a Class

Device class

Classes of sensors; typically used as details on a Class

Unit of measurement required to interpret numeric values in a Phydat exchanged with a SAUL device