[][src]Struct probe_rs::Probe

pub struct Probe { /* fields omitted */ }

The Probe struct is a generic wrapper over the different probes supported.


Open the first probe found

The list_all and from_probe_info functions can be used to create a new Probe:

use probe_rs::Probe;

let probe_list = Probe::list_all();
let probe = Probe::open(&probe_list[0]);


impl Probe[src]

pub fn new(probe: impl DebugProbe + 'static) -> Self[src]

pub fn list_all() -> Vec<DebugProbeInfo>[src]

Get a list of all debug probes found. This can be used to select the debug probe which should be used.

pub fn open(
    selector: impl Into<DebugProbeSelector> + Clone
) -> Result<Self, DebugProbeError>

Create a Probe from DebugProbeInfo. Use the Probe::list_all() function to get the information about all probes available.

pub fn from_specific_probe(probe: Box<dyn DebugProbe>) -> Self[src]

pub fn get_name(&self) -> String[src]

Get human readable name for the probe

pub fn attach(self, target: impl Into<TargetSelector>) -> Result<Session, Error>[src]

Attach to the chip.

This runs all the necessary protocol init routines.

If this doesn't work, you might want to try attach_under_reset

pub fn attach_to_unspecified(&mut self) -> Result<(), Error>[src]

pub fn attach_under_reset(
    target: impl Into<TargetSelector>
) -> Result<Session, Error>

Attach to the chip under hard-reset.

This asserts the reset pin via the probe, plays the protocol init routines and deasserts the pin. This is necessary if the chip is not responding to the SWD reset sequence. For example this can happen if the chip has the SWDIO pin remapped.

pub fn select_protocol(
    &mut self,
    protocol: WireProtocol
) -> Result<(), DebugProbeError>

Selects the transport protocol to be used by the debug probe.

pub fn detach(&mut self) -> Result<(), DebugProbeError>[src]

Leave debug mode

pub fn target_reset(&mut self) -> Result<(), DebugProbeError>[src]

Resets the target device.

pub fn target_reset_deassert(&mut self) -> Result<(), DebugProbeError>[src]

pub fn set_speed(&mut self, speed_khz: u32) -> Result<u32, DebugProbeError>[src]

Configure protocol speed to use in kHz

pub fn speed_khz(&self) -> u32[src]

Configured protocol speed in kHz

pub fn dedicated_memory_interface(
) -> Result<Option<Memory<'_>>, DebugProbeError>

Returns a probe specific memory interface if any is present for given probe.

pub fn has_dap_interface(&self) -> bool[src]

pub fn get_interface_dap(
) -> Result<Option<&dyn DAPAccess>, DebugProbeError>

pub fn get_interface_dap_mut(
    &mut self
) -> Result<Option<&mut dyn DAPAccess>, DebugProbeError>

pub fn has_jtag_interface(&self) -> bool[src]

pub fn get_interface_jtag(
) -> Result<Option<&dyn JTAGAccess>, DebugProbeError>

pub fn get_interface_jtag_mut(
    &mut self
) -> Result<Option<&mut dyn JTAGAccess>, DebugProbeError>

pub fn get_interface_swo(&self) -> Option<&dyn SwoAccess>[src]

pub fn get_interface_swo_mut(&mut self) -> Option<&mut dyn SwoAccess>[src]

Trait Implementations

impl Debug for Probe[src]

Auto Trait Implementations

impl !RefUnwindSafe for Probe

impl Send for Probe

impl Sync for Probe

impl Unpin for Probe

impl !UnwindSafe for Probe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.