Struct riot_wrappers::saul::RegistryEntry
source · pub struct RegistryEntry(/* private fields */);
Available on
riot_module_saul
only.Expand description
A discovered SAUL registry entry
Implementations§
source§impl RegistryEntry
impl RegistryEntry
sourcepub fn nth(pos: usize) -> Option<Self>
pub fn nth(pos: usize) -> Option<Self>
Find a registry entry by its index
Wrapper around saul_reg_find_nth
.
sourcepub fn all() -> AllRegistryEntries
pub fn all() -> AllRegistryEntries
All registered entries.
Do not expect more from its return type than being impl Iterator<Item = Self>
; this will
change back to that once type_alias_impl_trait
is stable.
pub fn type_(&self) -> Option<Class>
pub fn name(&self) -> Option<&'static str>
sourcepub fn read(&self) -> Result<Phydat, NumericError>
pub fn read(&self) -> Result<Phydat, NumericError>
Read a value from the SAUL device
sourcepub fn write(&self, value: Phydat) -> Result<(), NumericError>
pub fn write(&self, value: Phydat) -> Result<(), NumericError>
Write a value to the SAUL device
Note that the saul_reg_write call does not really pass on the initialized length of the values to the device, but the device returns the used length. If the lengths do not match, the returned length is expressed as an error.
Auto Trait Implementations§
impl RefUnwindSafe for RegistryEntry
impl !Send for RegistryEntry
impl !Sync for RegistryEntry
impl Unpin for RegistryEntry
impl UnwindSafe for RegistryEntry
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more