kernel::hil::sensors

Trait MoistureDriver

Source
pub trait MoistureDriver<'a> {
    // Required methods
    fn set_client(&self, client: &'a dyn MoistureClient);
    fn read_moisture(&self) -> Result<(), ErrorCode>;
}
Expand description

A basic interface for a moisture sensor

Required Methods§

Source

fn set_client(&self, client: &'a dyn MoistureClient)

Source

fn read_moisture(&self) -> Result<(), ErrorCode>

Read the moisture value from a sensor. The value is returned via the MoistureClient callback.

This function might return the following errors:

  • BUSY: Indicates that the hardware is busy with an existing operation or initialisation/calibration.
  • NOSUPPORT: Indicates that this data type isn’t supported.

Implementors§