Trait kernel::hil::sensors::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§