[][src]Trait probe_rs::architecture::arm::swo::SwoAccess

pub trait SwoAccess {
    pub fn enable_swo(&mut self, config: &SwoConfig) -> Result<(), Error>;
pub fn disable_swo(&mut self) -> Result<(), Error>;
pub fn read_swo_timeout(
        &mut self,
        timeout: Duration
    ) -> Result<Vec<u8>, Error>; pub fn read_swo(&mut self) -> Result<Vec<u8>, Error> { ... }
pub fn swo_poll_interval_hint(
        &mut self,
        config: &SwoConfig
    ) -> Option<Duration> { ... }
pub fn swo_buffer_size(&mut self) -> Option<usize> { ... } }

Required methods

pub fn enable_swo(&mut self, config: &SwoConfig) -> Result<(), Error>

Configure a SwoAccess interface for reading SWO data.

pub fn disable_swo(&mut self) -> Result<(), Error>

Disable SWO reading on this SwoAccess interface.

pub fn read_swo_timeout(&mut self, timeout: Duration) -> Result<Vec<u8>, Error>

Read SWO data for up to timeout duration.

If no data is received before the timeout, returns an empty Vec. May return earlier than timeout if the receive buffer fills up.

Loading content...

Provided methods

pub fn read_swo(&mut self) -> Result<Vec<u8>, Error>

Read any available SWO data without waiting.

Returns a Vec of received SWO bytes since the last read_swo() call. If no data was available, returns an empty Vec.

pub fn swo_poll_interval_hint(&mut self, config: &SwoConfig) -> Option<Duration>

Request an estimated best time to wait between polls of read_swo.

A probe can implement this if it can work out a sensible time to wait between polls, for example using the probe's internal buffer size and SWO baud rate, or a 0s duration if reads can block for new data.

The default implementation computes an estimated interval based on the buffer size, mode, and baud rate.

pub fn swo_buffer_size(&mut self) -> Option<usize>

Request the probe SWO buffer size, if known.

Loading content...

Implementors

impl SwoAccess for ArmCommunicationInterface[src]

Loading content...