Struct capsules_extra::ambient_light::AmbientLight
source · pub struct AmbientLight<'a> { /* private fields */ }
Implementations§
source§impl<'a> AmbientLight<'a>
impl<'a> AmbientLight<'a>
pub fn new( sensor: &'a dyn AmbientLight<'a>, grant: Grant<App, UpcallCount<{ upcall::COUNT }>, AllowRoCount<0>, AllowRwCount<0>>, ) -> AmbientLight<'_>
Trait Implementations§
source§impl AmbientLightClient for AmbientLight<'_>
impl AmbientLightClient for AmbientLight<'_>
source§impl SyscallDriver for AmbientLight<'_>
impl SyscallDriver for AmbientLight<'_>
source§fn command(
&self,
command_num: usize,
_: usize,
_: usize,
processid: ProcessId,
) -> CommandReturn
fn command( &self, command_num: usize, _: usize, _: usize, processid: ProcessId, ) -> CommandReturn
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
source§fn allocate_grant(&self, processid: ProcessId) -> Result<(), Error>
fn allocate_grant(&self, processid: ProcessId) -> Result<(), Error>
Request to allocate a capsule’s grant for a specific process. Read more
source§fn allow_userspace_readable(
&self,
app: ProcessId,
which: usize,
slice: ReadWriteProcessBuffer,
) -> Result<ReadWriteProcessBuffer, (ReadWriteProcessBuffer, ErrorCode)>
fn allow_userspace_readable( &self, app: ProcessId, which: usize, slice: ReadWriteProcessBuffer, ) -> Result<ReadWriteProcessBuffer, (ReadWriteProcessBuffer, ErrorCode)>
System call for a process to pass a buffer (a
UserspaceReadableProcessBuffer
) to the kernel that the kernel can
either read or write. The kernel calls this method only after it checks
that the entire buffer is within memory the process can both read and
write. Read moreAuto Trait Implementations§
impl<'a> !Freeze for AmbientLight<'a>
impl<'a> !RefUnwindSafe for AmbientLight<'a>
impl<'a> !Send for AmbientLight<'a>
impl<'a> !Sync for AmbientLight<'a>
impl<'a> Unpin for AmbientLight<'a>
impl<'a> !UnwindSafe for AmbientLight<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more