1use probe_rs_target::ChipFamily;
9
10use crate::{flashing::ImageFormat, probe::ProbeFactory, vendor::Vendor};
11
12#[derive(Clone, Default)]
14pub struct Plugin<'p> {
15 pub vendors: &'p [&'static dyn Vendor],
17
18 pub image_formats: &'p [&'static dyn ImageFormat],
20
21 pub targets: &'p [ChipFamily],
23
24 pub probe_drivers: &'p [&'static dyn ProbeFactory],
26}
27
28pub fn register_plugin(plugin: Plugin<'_>) {
30 for vendor in plugin.vendors {
32 crate::vendor::register_vendor(*vendor);
33 }
34 for image_format in plugin.image_formats {
35 crate::flashing::register_image_format(*image_format);
36 }
37 for target in plugin.targets {
38 crate::config::registry::add_builtin_target(target.clone());
39 }
40 for probe_driver in plugin.probe_drivers {
41 crate::probe::register_probe_factory(*probe_driver);
42 }
43}