mp.targets — 10 functions
| Function | Returns | Description |
|---|---|---|
get_vendors(prog?) | table | Array of vendor names (optionally filter by programmer type) |
get_families(vendor, prog?) | table | Array of family names |
get_targets(family) | table | Array of target names in family |
get_programmers(family) | table | Array of programmer strings supported by family |
search(query, max?) | table | Fuzzy search; array of {match_type, vendor, programmer, family, target} (default max=20) |
is_configurable(family) | bool | Whether family supports the pinout editor |
get_target_info(target) | table | Full target description with family/programmer/vendor filled in. Ambiguous: {error, matches=[...]} |
get_target_info(family, target) | table | Full target description in the given family or {error} |
get_family_details(family) | table | Array of full target descriptions for the whole family |
compare(f1, t1, f2, t2) | table | {target1, target2, diffs[], region_diffs[], diff_count, identical} or {error} |
get_family_info(family) | table | {vendor, family, programmer, target_count, baud_default} |
Examples
-- Fuzzy search
for _, hit in ipairs(mp.targets.search("STM32F1")) do
mp.log.info(hit.family .. " / " .. hit.target)
end
-- Auto-resolve family
local info = mp.targets.get_target_info("STM32F103C8")
-- Explicit family for ambiguous names
local info = mp.targets.get_target_info("STM32F1", "STM32F103C8")
-- Compare two targets
local diff = mp.targets.compare("STM32F1", "STM32F103C8",
"STM32F1", "STM32F103RB")