Struct capsules_extra::servo::Servo

source ·
pub struct Servo<'a, const SERVO_COUNT: usize> { /* private fields */ }

Implementations§

source§

impl<'a, const SERVO_COUNT: usize> Servo<'a, SERVO_COUNT>

source

pub fn new(servo: &'a [&'a dyn Servo<'a>; SERVO_COUNT]) -> Self

Trait Implementations§

source§

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

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 adjust angle 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>

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)>

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 more

Auto 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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.