Struct capsules::tsl2561::TSL2561
[−]
[src]
pub struct TSL2561<'a> {
i2c: &'a I2CDevice,
interrupt_pin: &'a Pin,
callback: Cell<Option<Callback>>,
state: Cell<State>,
buffer: TakeCell<'static, [u8]>,
}Fields
i2c: &'a I2CDevice
interrupt_pin: &'a Pin
callback: Cell<Option<Callback>>
state: Cell<State>
buffer: TakeCell<'static, [u8]>
Methods
impl<'a> TSL2561<'a>[src]
pub fn new(
i2c: &'a I2CDevice,
interrupt_pin: &'a Pin,
buffer: &'static mut [u8]
) -> TSL2561<'a>[src]
i2c: &'a I2CDevice,
interrupt_pin: &'a Pin,
buffer: &'static mut [u8]
) -> TSL2561<'a>
pub fn read_id(&self)[src]
pub fn take_measurement(&self)[src]
fn calculate_lux(&self, chan0: u16, chan1: u16) -> usize[src]
Trait Implementations
impl<'a> I2CClient for TSL2561<'a>[src]
fn command_complete(&self, buffer: &'static mut [u8], _error: Error)[src]
Called when an I2C command completed. The error denotes whether the command completed successfully or if an error occured. Read more
impl<'a> Client for TSL2561<'a>[src]
fn fired(&self, _: usize)[src]
Called when an interrupt occurs. The identifier will be the same value that was passed to enable_interrupt() when the interrupt was configured. Read more
impl<'a> Driver for TSL2561<'a>[src]
fn subscribe(&self, subscribe_num: usize, callback: Callback) -> ReturnCode[src]
subscribe lets an application pass a callback to the driver to be called later. This returns ENOSUPPORT if not used. Read more
fn command(
&self,
command_num: usize,
_: usize,
_: usize,
_: AppId
) -> ReturnCode[src]
&self,
command_num: usize,
_: usize,
_: usize,
_: AppId
) -> ReturnCode
command instructs a driver to perform some action synchronously. This returns ENOSUPPORT if not used. Read more
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