[][src]Trait probe_rs::DebugProbe

pub trait DebugProbe: Send + Sync + Debug {
    pub fn new_from_selector(
        selector: impl Into<DebugProbeSelector>
    ) -> Result<Box<Self>, DebugProbeError>
    where
        Self: Sized
;
pub fn get_name(&self) -> &str;
pub fn speed(&self) -> u32;
pub fn set_speed(&mut self, speed_khz: u32) -> Result<u32, DebugProbeError>;
pub fn attach(&mut self) -> Result<(), DebugProbeError>;
pub fn detach(&mut self) -> Result<(), DebugProbeError>;
pub fn target_reset(&mut self) -> Result<(), DebugProbeError>;
pub fn target_reset_assert(&mut self) -> Result<(), DebugProbeError>;
pub fn target_reset_deassert(&mut self) -> Result<(), DebugProbeError>;
pub fn select_protocol(
        &mut self,
        protocol: WireProtocol
    ) -> Result<(), DebugProbeError>; pub fn has_arm_interface(&self) -> bool { ... }
pub fn get_arm_interface<'probe>(
        self: Box<Self>
    ) -> Result<Option<Box<dyn ArmProbeInterface + 'probe>>, DebugProbeError> { ... }
pub fn get_riscv_interface(
        self: Box<Self>
    ) -> Result<Option<RiscvCommunicationInterface>, DebugProbeError> { ... }
pub fn has_riscv_interface(&self) -> bool { ... }
pub fn get_swo_interface(&self) -> Option<&dyn SwoAccess> { ... }
pub fn get_swo_interface_mut(&mut self) -> Option<&mut dyn SwoAccess> { ... } }

Required methods

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

pub fn get_name(&self) -> &str

Get human readable name for the probe

pub 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.

pub 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.

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

Attach to the chip.

This should run all the necessary protocol init routines.

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

Detach from the chip.

This should run all the necessary protocol deinit routines.

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

This should hard reset the target device.

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

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

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

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

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

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

Loading content...

Provided methods

pub fn has_arm_interface(&self) -> bool

Check if the proble offers an interface to debug ARM chips.

pub fn get_arm_interface<'probe>(
    self: Box<Self>
) -> Result<Option<Box<dyn ArmProbeInterface + 'probe>>, DebugProbeError>

Get the dedicated interface to debug ARM chips. Ensure that the probe actually supports this by calling has_arm_interface first.

pub fn get_riscv_interface(
    self: Box<Self>
) -> Result<Option<RiscvCommunicationInterface>, DebugProbeError>

Get the dedicated interface to debug RISCV chips. Ensure that the probe actually supports this by calling get_riscv_interface first.

pub fn has_riscv_interface(&self) -> bool

Check if the proble offers an interface to debug RISCV chips.

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

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

Loading content...

Trait Implementations

impl<'a> AsMut<dyn DebugProbe + 'a> for ArmCommunicationInterface[src]

impl<'a> AsMut<dyn DebugProbe + 'a> for RiscvCommunicationInterface[src]

impl<'a> AsRef<dyn DebugProbe + 'a> for ArmCommunicationInterface[src]

impl<'a> AsRef<dyn DebugProbe + 'a> for RiscvCommunicationInterface[src]

Implementors

Loading content...