Struct capsules::ambient_light::AmbientLight [] [src]

pub struct AmbientLight<'a> {
    sensor: &'a AmbientLight,
    command_pending: Cell<bool>,
    apps: Grant<App>,
}

Fields

Methods

impl<'a> AmbientLight<'a>
[src]

[src]

[src]

Trait Implementations

impl<'a> Driver for AmbientLight<'a>
[src]

[src]

Subscribe to light intensity readings

subscribe

  • 0: Subscribe to light intensity readings. The callback signature is fn(lux: usize), where lux is the light intensity in lux (lx).

[src]

Initiate light intensity readings

Sensor readings are coalesced if processes request them concurrently. If multiple processes request have outstanding requests for a sensor reading, only one command will be issued and the result is returned to all subscribed processes.

command_num

  • 0: Check driver presence
  • 1: Start a light sensor reading

[src]

allow lets an application give the driver access to a buffer in the application's memory. This returns ENOSUPPORT if not used. Read more

impl<'a> AmbientLightClient for AmbientLight<'a>
[src]

[src]

Called when an ambient light reading has completed. Read more