Skip to main content

mp.targets — 10 functions

FunctionReturnsDescription
get_vendors(prog?)tableArray of vendor names (optionally filter by programmer type)
get_families(vendor, prog?)tableArray of family names
get_targets(family)tableArray of target names in family
get_programmers(family)tableArray of programmer strings supported by family
search(query, max?)tableFuzzy search; array of {match_type, vendor, programmer, family, target} (default max=20)
is_configurable(family)boolWhether family supports the pinout editor
get_target_info(target)tableFull target description with family/programmer/vendor filled in. Ambiguous: {error, matches=[...]}
get_target_info(family, target)tableFull target description in the given family or {error}
get_family_details(family)tableArray 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")