Moved AVR8 physicalInterface config extraction out of EDBG driver

This commit is contained in:
Nav
2022-03-01 22:40:00 +00:00
parent 3893187aed
commit 52533e2878
6 changed files with 68 additions and 54 deletions

View File

@@ -122,13 +122,30 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
DebugToolDrivers::TargetInterfaces::Microchip::Avr::Avr8::Avr8DebugInterface* avr8DebugInterface = nullptr;
std::string name;
std::optional<Family> family;
std::optional<PhysicalInterface> physicalInterface;
std::optional<TargetDescription::TargetDescriptionFile> targetDescriptionFile;
std::optional<TargetParameters> targetParameters;
std::map<std::string, PadDescriptor> padDescriptorsByName;
std::map<int, TargetVariant> targetVariantsById;
std::map<TargetRegisterType, TargetRegisterDescriptors> targetRegisterDescriptorsByType;
std::map<TargetMemoryType, TargetMemoryDescriptor> targetMemoryDescriptorsByType;
/**
* Users are required to set their desired physical interface in their Bloom configuration. This would take
* the form of a string, so we map the available options to the appropriate enums.
*/
static inline auto getPhysicalInterfacesByName() {
using Targets::Microchip::Avr::Avr8Bit::PhysicalInterface;
return std::map<std::string, PhysicalInterface>({
{"debugwire", PhysicalInterface::DEBUG_WIRE},
{"debug-wire", PhysicalInterface::DEBUG_WIRE},
{"pdi", PhysicalInterface::PDI},
{"jtag", PhysicalInterface::JTAG},
{"updi", PhysicalInterface::UPDI},
});
};
/**
* Resolves the appropriate TDF for the AVR8 target and populates this->targetDescriptionFile.
*/