Available on riot_module_saul only.
Expand description

Tools for registering a Rust device in SAUL

A SAUL sensor or actuator is expressed as an implementation of Drivable. Once built, that drivable is registered at SAUL, either through register_and_then, or through building a Registration for a 'static place and calling Registration::register_static.

As SAUL decouples the per-type parts of a sensor from the per-instance parts, there is a Driver struct that manages the per-type aspects. This driver also manages the dynamic dispatch by being generic over the Drivable and exposing untyped function pointers. (In a sense, SAUL ships its own version of Rust’s dyn, and Driver manages that).

Structs§

  • A typed saul_driver_t, created from a Drivable’s build_driver() static method, and used as statically lived references registrations.
  • The single error read and write operations may produce; corresponds to an -ECANCELED. (-ENOTSUP is expressed by not having support for the operation in the first place, indicated by the HAS_{READ,WRITE} consts).

Traits§

  • API through which SAUL operations are done

Functions§