[][src]Struct probe_rs::Probe

pub struct Probe { /* fields omitted */ }

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

Examples

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]);

Implementations

impl Probe[src]

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

pub fn from_specific_probe(probe: Box<dyn DebugProbe>) -> 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>
[src]

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

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(
    self,
    target: impl Into<TargetSelector>
) -> Result<Session, Error>
[src]

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>
[src]

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 has_arm_interface(&self) -> bool[src]

Check if the probe has an interface to debug ARM chips.

pub fn into_arm_interface<'probe>(
    self
) -> Result<Option<Box<dyn ArmProbeInterface + 'probe>>, DebugProbeError>
[src]

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

Check if the probe has an interface to debug RISCV chips.

pub fn into_riscv_interface(
    self
) -> Result<Option<RiscvCommunicationInterface>, DebugProbeError>
[src]

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

pub fn get_swo_interface_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
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.