Struct Laser

Source
pub struct Laser<R, D, M, I, S, F> { /* private fields */ }

Implementations§

Source§

impl<R, D, M, I, S> Laser<R, D, M, I, S, fn(u32) -> AfterRequest>
where R: OutputPin, D: OutputPin, M: OutputPin, I: InputPin, S: Read<u8> + Write<u8>,

Source

pub fn new( n_reset: R, n_disable: D, n_ms: M, srq: I, serial: S, ) -> Result<Self, Error<S, I, R, M>>

Source§

impl<R, D, M, I, S, F> Laser<R, D, M, I, S, F>
where R: OutputPin, D: OutputPin, M: OutputPin, I: InputPin, S: Read<u8> + Write<u8>, F: FnMut(u32) -> AfterRequest,

Source

pub fn new_with_handler_between_retries( n_reset: R, n_disable: D, n_ms: M, srq: I, serial: S, between_retries: Option<F>, ) -> Result<Self, Error<S, I, R, M>>

Source

pub fn release(self) -> (R, D, M, I, S)

Source

pub fn serial(&mut self) -> &mut S

Source

pub fn current_command(&self) -> Option<Request>

Source

pub fn step(&mut self) -> Result<Response, Error<S, I, R, M>>

Source

pub fn srq(&self) -> Result<bool, <I as InputPin>::Error>

Source

pub fn disable(&mut self) -> Result<(), <D as OutputPin>::Error>

Source

pub fn enable(&mut self) -> Result<(), <D as OutputPin>::Error>

Source

pub fn reset(&mut self) -> Result<(), <R as OutputPin>::Error>

Source

pub fn reset_comms(&mut self) -> Result<(), <M as OutputPin>::Error>

Source

pub fn send(&mut self, command: Request)

Source

pub fn wait_for_clear(&mut self) -> Result<(), Error<S, I, R, M>>

Trait Implementations§

Source§

impl<R: Debug, D: Debug, M: Debug, I: Debug, S: Debug, F: Debug> Debug for Laser<R, D, M, I, S, F>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<R, D, M, I, S, F> Freeze for Laser<R, D, M, I, S, F>
where R: Freeze, D: Freeze, M: Freeze, I: Freeze, S: Freeze, F: Freeze,

§

impl<R, D, M, I, S, F> RefUnwindSafe for Laser<R, D, M, I, S, F>

§

impl<R, D, M, I, S, F> Send for Laser<R, D, M, I, S, F>
where R: Send, D: Send, M: Send, I: Send, S: Send, F: Send,

§

impl<R, D, M, I, S, F> Sync for Laser<R, D, M, I, S, F>
where R: Sync, D: Sync, M: Sync, I: Sync, S: Sync, F: Sync,

§

impl<R, D, M, I, S, F> Unpin for Laser<R, D, M, I, S, F>
where R: Unpin, D: Unpin, M: Unpin, I: Unpin, S: Unpin, F: Unpin,

§

impl<R, D, M, I, S, F> UnwindSafe for Laser<R, D, M, I, S, F>

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

Source§

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

Source§

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.