Struct probe_rs_cli_util::common_options::ProbeOptions
source · pub struct ProbeOptions {
pub chip: Option<String>,
pub chip_description_path: Option<PathBuf>,
pub protocol: Option<WireProtocol>,
pub probe_selector: Option<DebugProbeSelector>,
pub speed: Option<u32>,
pub connect_under_reset: bool,
pub dry_run: bool,
pub allow_erase_all: bool,
}Expand description
Common options and logic when interfacing with a Probe.
Fields§
§chip: Option<String>§chip_description_path: Option<PathBuf>§protocol: Option<WireProtocol>Protocol used to connect to chip. Possible options: [swd, jtag]
probe_selector: Option<DebugProbeSelector>Use this flag to select a specific probe in the list.
Use ‘–probe VID:PID’ or ‘–probe VID:PID:Serial’ if you have more than one probe with the same VID:PID.“,
speed: Option<u32>§connect_under_reset: bool§dry_run: bool§allow_erase_all: boolImplementations§
source§impl ProbeOptions
impl ProbeOptions
sourcepub fn maybe_load_chip_desc(&self) -> Result<(), OperationError>
pub fn maybe_load_chip_desc(&self) -> Result<(), OperationError>
Add targets contained in file given by –chip-description-path to probe-rs registery.
Note: should be called before FlashOptions::early_exit and any other functions in ProbeOptions.
sourcepub fn get_target_selector(&self) -> Result<TargetSelector, OperationError>
pub fn get_target_selector(&self) -> Result<TargetSelector, OperationError>
Resolves a resultant target selector from passed ProbeOptions.
sourcepub fn attach_probe(&self) -> Result<Probe, OperationError>
pub fn attach_probe(&self) -> Result<Probe, OperationError>
Attaches to specified probe and configures it.
sourcepub fn attach_session(
&self,
probe: Probe,
target: TargetSelector
) -> Result<Session, OperationError>
pub fn attach_session(
&self,
probe: Probe,
target: TargetSelector
) -> Result<Session, OperationError>
Attaches to target device session. Attaches under reset if specified by ProbeOptions::connect_under_reset.
sourcepub fn simple_attach(&self) -> Result<Session, OperationError>
pub fn simple_attach(&self) -> Result<Session, OperationError>
Convenience method that attaches to the specified probe, target, and target session.
sourcepub fn build_flashloader(
&self,
session: &mut Session,
elf_path: &Path
) -> Result<FlashLoader, OperationError>
pub fn build_flashloader(
&self,
session: &mut Session,
elf_path: &Path
) -> Result<FlashLoader, OperationError>
Builds a new flash loader for the given target and ELF. This will check the ELF for validity and check what pages have to be flashed etc.
Trait Implementations§
source§impl Args for ProbeOptions
impl Args for ProbeOptions
source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
source§impl CommandFactory for ProbeOptions
impl CommandFactory for ProbeOptions
source§impl Debug for ProbeOptions
impl Debug for ProbeOptions
source§impl FromArgMatches for ProbeOptions
impl FromArgMatches for ProbeOptions
source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches
) -> Result<Self, Error>
fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches
) -> Result<Self, Error>
source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches
) -> Result<(), Error>
fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches
) -> Result<(), Error>
ArgMatches to self.source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches
) -> Result<(), Error>
fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches
) -> Result<(), Error>
ArgMatches to self.source§impl Parser for ProbeOptions
impl Parser for ProbeOptions
source§fn try_parse() -> Result<Self, Error<RichFormatter>>
fn try_parse() -> Result<Self, Error<RichFormatter>>
std::env::args_os(), return Err on error.