pub struct AdcVirtualized<'a> { /* private fields */ }
Expand description
Multiplexed ADC syscall driver, used by applications and capsules.
Virtualized, and can be use by multiple applications at the same time; requests are queued. Does not support continuous or high-speed sampling.
Implementations§
Source§impl<'a> AdcVirtualized<'a>
impl<'a> AdcVirtualized<'a>
Functions to create, initialize, and interact with the virtualized ADC
Sourcepub fn new(
drivers: &'a [&'a dyn AdcChannel<'a>],
grant: Grant<AppSys, UpcallCount<1>, AllowRoCount<0>, AllowRwCount<0>>,
) -> AdcVirtualized<'a>
pub fn new( drivers: &'a [&'a dyn AdcChannel<'a>], grant: Grant<AppSys, UpcallCount<1>, AllowRoCount<0>, AllowRwCount<0>>, ) -> AdcVirtualized<'a>
Create a new Adc
application interface.
drivers
- Virtual ADC drivers to provide application access to
Trait Implementations§
Source§impl Client for AdcVirtualized<'_>
impl Client for AdcVirtualized<'_>
Source§fn sample_ready(&self, sample: u16)
fn sample_ready(&self, sample: u16)
Called when a sample is ready.
Source§impl SyscallDriver for AdcVirtualized<'_>
impl SyscallDriver for AdcVirtualized<'_>
Implementation of the syscalls for the virtualized ADC.
Source§fn command(
&self,
command_num: usize,
channel: usize,
_: usize,
processid: ProcessId,
) -> CommandReturn
fn command( &self, command_num: usize, channel: usize, _: usize, processid: ProcessId, ) -> CommandReturn
Method for the application to command or query this driver.
command_num
- which command call this ischannel
- requested channel value_
- value sent by the application, unusedprocessid
- application identifier
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 AdcVirtualized<'a>
impl<'a> !RefUnwindSafe for AdcVirtualized<'a>
impl<'a> !Send for AdcVirtualized<'a>
impl<'a> !Sync for AdcVirtualized<'a>
impl<'a> Unpin for AdcVirtualized<'a>
impl<'a> !UnwindSafe for AdcVirtualized<'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