Trait AmbientLight

Source
pub trait AmbientLight<'a> {
    // Required method
    fn set_client(&self, client: &'a dyn AmbientLightClient);

    // Provided method
    fn read_light_intensity(&self) -> Result<(), ErrorCode> { ... }
}
Expand description

A basic interface for an ambient light sensor.

Required Methods§

Source

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

Set the client to be notified when the capsule has data ready or has finished some command. This is likely called in a board’s main.rs.

Provided Methods§

Source

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

Get a single instantaneous reading of the ambient light intensity.

Implementors§

impl<'a, A: Adc<'a>> AmbientLight<'a> for AnalogLightSensor<'a, A>

impl<'a, A: Alarm<'a>> AmbientLight<'a> for Isl29035<'a, A>