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
DpWrite
ApRead
ApWrite
ApBulkRead
ApBulkWrite
MultiRegWrite
Ping
ResetTarget
Clock
SetSpeed
Disconnect
Implementations§
Source§impl Op
impl Op
pub async fn recv_cmd<R: AsyncReader>( reader: &mut R, ) -> Result<Command, ParseError<R::Error>>
Sourcepub async fn async_recv<R: AsyncReader>(
command: Command,
reader: &mut R,
) -> Result<Self, ParseError<R::Error>>
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 theReadertrait
Returns:
Ok(Self): If the command was successfully parsed.Err(ParseError<R::Error>): If there was an error parsing the received command.
Sourcepub fn sync_send<W: SyncWriter>(&self, _writer: &mut W) -> Result<(), W::Error>
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 theWritertrait
Returns:
Ok(()): If the command was successfully sent.Err(W::Error): If there was an error sending the command.
Trait Implementations§
impl Eq for Op
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> 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