Struct capsules::ambient_light::AmbientLight
[−]
[src]
pub struct AmbientLight<'a> {
sensor: &'a AmbientLight,
command_pending: Cell<bool>,
apps: Grant<App>,
}Fields
sensor: &'a AmbientLight
command_pending: Cell<bool>
apps: Grant<App>
Methods
impl<'a> AmbientLight<'a>[src]
pub fn new(sensor: &'a AmbientLight, grant: Grant<App>) -> AmbientLight[src]
fn enqueue_sensor_reading(&self, appid: AppId) -> ReturnCode[src]
Trait Implementations
impl<'a> Driver for AmbientLight<'a>[src]
fn subscribe(&self, subscribe_num: usize, callback: Callback) -> ReturnCode[src]
Subscribe to light intensity readings
subscribe
0: Subscribe to light intensity readings. The callback signature isfn(lux: usize), whereluxis the light intensity in lux (lx).
fn command(
&self,
command_num: usize,
_arg1: usize,
_: usize,
appid: AppId
) -> ReturnCode[src]
&self,
command_num: usize,
_arg1: usize,
_: usize,
appid: AppId
) -> ReturnCode
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 presence1: Start a light sensor reading
fn allow(
&self,
app: AppId,
minor_num: usize,
slice: AppSlice<Shared, u8>
) -> ReturnCode[src]
&self,
app: AppId,
minor_num: usize,
slice: AppSlice<Shared, u8>
) -> ReturnCode
allow lets an application give the driver access to a buffer in the application's memory. This returns ENOSUPPORT if not used. Read more