Type Alias ServosComponentType

Source
pub type ServosComponentType<const SERVO_COUNT: usize> = Servo<'static, SERVO_COUNT>;

Aliased Type§

struct ServosComponentType<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], ) -> Servo<'a, SERVO_COUNT>

Trait Implementations

Source§

impl<const SERVO_COUNT: usize> SyscallDriver for Servo<'_, 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