[][src]Trait probe_rs::DebugProbe

pub trait DebugProbe: Send + Sync + Debug {
    fn new_from_selector(
        selector: impl Into<DebugProbeSelector>
    ) -> Result<Box<Self>, DebugProbeError>
    where
        Self: Sized
;
fn get_name(&self) -> &str;
fn speed(&self) -> u32;
fn set_speed(&mut self, speed_khz: u32) -> Result<u32, DebugProbeError>;
fn attach(&mut self) -> Result<(), DebugProbeError>;
fn detach(&mut self) -> Result<(), DebugProbeError>;
fn target_reset(&mut self) -> Result<(), DebugProbeError>;
fn target_reset_assert(&mut self) -> Result<(), DebugProbeError>;
fn target_reset_deassert(&mut self) -> Result<(), DebugProbeError>;
fn select_protocol(
        &mut self,
        protocol: WireProtocol
    ) -> Result<(), DebugProbeError>;
fn dedicated_memory_interface(&self) -> Option<Memory<'_>>;
fn get_interface_dap(&self) -> Option<&dyn DAPAccess>;
fn get_interface_dap_mut(&mut self) -> Option<&mut dyn DAPAccess>;
fn get_interface_jtag(&self) -> Option<&dyn JTAGAccess>;
fn get_interface_jtag_mut(&mut self) -> Option<&mut dyn JTAGAccess>;
fn get_interface_swo(&self) -> Option<&dyn SwoAccess>;
fn get_interface_swo_mut(&mut self) -> Option<&mut dyn SwoAccess>; }

Required methods

fn new_from_selector(
    selector: impl Into<DebugProbeSelector>
) -> Result<Box<Self>, DebugProbeError> where
    Self: Sized

fn get_name(&self) -> &str

Get human readable name for the probe

fn speed(&self) -> u32

Get the currently used maximum speed for the debug protocol in kHz.

Not all probes report which speed is used, meaning this value is not always the actual speed used. However, the speed should not be any higher than this value.

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

Set the speed in kHz used for communication with the target device.

The desired speed might not be supported by the probe. If the desired speed is not directly supported, a lower speed will be selected if possible.

If possible, the actual speed used is returned by the function. Some probes cannot report this, so the value may be inaccurate.

If the requested speed is not supported, DebugProbeError::UnsupportedSpeed will be returned.

fn attach(&mut self) -> Result<(), DebugProbeError>

Attach to the chip.

This should run all the necessary protocol init routines.

fn detach(&mut self) -> Result<(), DebugProbeError>

Detach from the chip.

This should run all the necessary protocol deinit routines.

fn target_reset(&mut self) -> Result<(), DebugProbeError>

This should hard reset the target device.

fn target_reset_assert(&mut self) -> Result<(), DebugProbeError>

This should assert the reset pin of the target via debug probe.

fn target_reset_deassert(&mut self) -> Result<(), DebugProbeError>

This should deassert the reset pin of the target via debug probe.

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

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

fn dedicated_memory_interface(&self) -> Option<Memory<'_>>

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

fn get_interface_dap(&self) -> Option<&dyn DAPAccess>

fn get_interface_dap_mut(&mut self) -> Option<&mut dyn DAPAccess>

fn get_interface_jtag(&self) -> Option<&dyn JTAGAccess>

fn get_interface_jtag_mut(&mut self) -> Option<&mut dyn JTAGAccess>

fn get_interface_swo(&self) -> Option<&dyn SwoAccess>

fn get_interface_swo_mut(&mut self) -> Option<&mut dyn SwoAccess>

Loading content...

Implementors

Loading content...