Struct capsules_extra::servo::Servo
source · pub struct Servo<'a, const SERVO_COUNT: usize> { /* private fields */ }
Implementations§
Trait Implementations§
source§impl<'a, const SERVO_COUNT: usize> SyscallDriver for Servo<'a, SERVO_COUNT>
impl<'a, const SERVO_COUNT: usize> SyscallDriver for Servo<'a, SERVO_COUNT>
Provide an interface for userland.
source§fn command(
&self,
command_num: usize,
servo_index: usize,
angle: usize,
_processid: ProcessId,
) -> CommandReturn
fn command( &self, command_num: usize, servo_index: usize, angle: usize, _processid: ProcessId, ) -> CommandReturn
Command interface.
§command_num
0
: Return Ok(()) if this driver is included on the platform.1
: Returns an u32 representing the number of available servomotors.2
: Changing the angle immediatelly.servo_index
receives the index corresponding to the servo whose angle we want to adjustangle
is used to receive a value between 0 and 180.3
: Returning the current angle for a specific index.
source§fn allocate_grant(&self, _process_id: ProcessId) -> Result<(), Error>
fn allocate_grant(&self, _process_id: 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, const SERVO_COUNT: usize> Freeze for Servo<'a, SERVO_COUNT>
impl<'a, const SERVO_COUNT: usize> !RefUnwindSafe for Servo<'a, SERVO_COUNT>
impl<'a, const SERVO_COUNT: usize> !Send for Servo<'a, SERVO_COUNT>
impl<'a, const SERVO_COUNT: usize> !Sync for Servo<'a, SERVO_COUNT>
impl<'a, const SERVO_COUNT: usize> Unpin for Servo<'a, SERVO_COUNT>
impl<'a, const SERVO_COUNT: usize> !UnwindSafe for Servo<'a, SERVO_COUNT>
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