Skip to main content

Op

Enum Op 

Source
pub enum Op {
    DpRead {
        reg: u8,
    },
    DpWrite {
        reg: u8,
        data: u32,
    },
    ApRead {
        reg: u8,
    },
    ApWrite {
        reg: u8,
        data: u32,
    },
    ApBulkRead {
        reg: u8,
        count: u16,
    },
    ApBulkWrite {
        reg: u8,
        data: Vec<u32>,
    },
    MultiRegWrite {
        count: u16,
        data: Vec<MultiReg>,
    },
    Ping,
    ResetTarget,
    Clock {
        level: LineLevel,
        post_level: LineLevel,
        cycles: u16,
    },
    SetSpeed {
        speed: Speed,
    },
    Disconnect,
}
Expand description

Represents a binary API operation that can be performed over the Airfrog SWD interface. See the Binary API documentation for details.

Variants§

§

DpRead

Fields

§reg: u8
§

DpWrite

Fields

§reg: u8
§data: u32
§

ApRead

Fields

§reg: u8
§

ApWrite

Fields

§reg: u8
§data: u32
§

ApBulkRead

Fields

§reg: u8
§count: u16
§

ApBulkWrite

Fields

§reg: u8
§data: Vec<u32>
§

MultiRegWrite

Fields

§count: u16
§

Ping

§

ResetTarget

§

Clock

Fields

§post_level: LineLevel
§cycles: u16
§

SetSpeed

Fields

§speed: Speed
§

Disconnect

Implementations§

Source§

impl Op

Source

pub async fn recv_cmd<R: AsyncReader>( reader: &mut R, ) -> Result<Command, ParseError<R::Error>>

Source

pub async fn async_recv<R: AsyncReader>( command: Command, reader: &mut R, ) -> Result<Self, ParseError<R::Error>>

Used by an airfrog binary API server to receive a complete command from an API client.

Called once the command byte has been read from the stream.

Arguments:

  • cmd: The command byte received.
  • reader: A mutable reference to a reader that implements the Reader trait

Returns:

  • Ok(Self): If the command was successfully parsed.
  • Err(ParseError<R::Error>): If there was an error parsing the received command.
Source

pub fn sync_send<W: SyncWriter>(&self, _writer: &mut W) -> Result<(), W::Error>

Used by an airfrog binary API client to send a command to an API server.

Arguments:

  • writer: A mutable reference to a writer that implements the Writer trait

Returns:

  • Ok(()): If the command was successfully sent.
  • Err(W::Error): If there was an error sending the command.

Trait Implementations§

Source§

impl Clone for Op

Source§

fn clone(&self) -> Op

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Op

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Display for Op

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Op

Source§

fn eq(&self, other: &Op) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Op

Source§

impl StructuralPartialEq for Op

Auto Trait Implementations§

§

impl Freeze for Op

§

impl RefUnwindSafe for Op

§

impl Send for Op

§

impl Sync for Op

§

impl Unpin for Op

§

impl UnsafeUnpin for Op

§

impl UnwindSafe for Op

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.