Renamed part description files to target description files.

Introduced a generic target description file class with an AVR8 derivation.
Moved AVR8 target description files
This commit is contained in:
Nav
2021-05-31 01:01:14 +01:00
parent 08914372b9
commit 571211b337
270 changed files with 877 additions and 820 deletions

View File

@@ -84,10 +84,11 @@ add_executable(Bloom
src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp
src/Targets/Target.cpp
src/Targets/TargetDescription/TargetDescriptionFile.cpp
src/Targets/Microchip/AVR/AVR8/Avr8.cpp
src/Targets/Microchip/AVR/AVR8/Mega/Mega.cpp
src/Targets/Microchip/AVR/AVR8/PartDescription/PartDescriptionFile.cpp
build/resources/TargetPartDescriptions/AVR/Mapping.json
src/Targets/Microchip/AVR/AVR8/TargetDescription/TargetDescriptionFile.cpp
build/resources/TargetDescriptionFiles/AVR/Mapping.json
src/DebugServers/GdbRsp/GdbRspDebugServer.cpp
src/DebugServers/GdbRsp/Connection.cpp
@@ -122,10 +123,10 @@ add_executable(Bloom
set_target_properties(Bloom PROPERTIES OUTPUT_NAME bloom)
target_include_directories(Bloom PUBLIC ./)
# Construct JSON mapping of part description files.
# Construct JSON mapping of target description files.
add_custom_command(
OUTPUT
${CMAKE_CURRENT_SOURCE_DIR}/build/resources/TargetPartDescriptions/AVR/Mapping.json
${CMAKE_CURRENT_SOURCE_DIR}/build/resources/TargetDescriptionFiles/AVR/Mapping.json
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/build/scripts/CopyAvrPartFilesAndCreateMapping.php
COMMAND echo 'Processing AVR target description files.'

View File

@@ -1,6 +1,6 @@
<?php
/*
* Parses Microchip AVR Part Description (.atdf/.xml) files and creates a JSON mapping of target IDs to file paths.
* Parses Microchip AVR target description (.atdf/.xml) files and creates a JSON mapping of target IDs to file paths.
* Also copies the files over to the Distribution directory.
*
* The JSON mapping is compiled as a Qt resource and used for looking-up target description file paths, by target ID.
@@ -8,9 +8,9 @@
* This script should be run as part of the build process.
*/
CONST AVR_PD_FILE_PATH = __DIR__ . "/../../src/Targets/Microchip/AVR/PartDescriptionFiles";
CONST TARGET_PD_DEST_FILE_PATH = __DIR__ . "/../resources/TargetPartDescriptions/AVR";
CONST TARGET_PD_DEST_RELATIVE_FILE_PATH = "../resources/TargetPartDescriptions/AVR";
CONST AVR_PD_FILE_PATH = __DIR__ . "/../../src/Targets/TargetDescriptionFiles";
CONST TARGET_PD_DEST_FILE_PATH = __DIR__ . "/../resources/TargetDescriptionFiles/AVR";
CONST TARGET_PD_DEST_RELATIVE_FILE_PATH = "../resources/TargetDescriptionFiles/AVR";
CONST TARGET_PD_MAPPING_FILE_PATH = TARGET_PD_DEST_FILE_PATH . "/Mapping.json";
CONST PD_COMMENT = "\n<!-- This is an automatically generated file. Any changes made to it will likely be lost. -->\n";
@@ -153,7 +153,7 @@ function processAvrPartFiles($path) : array {
}
$output[$partDescriptionXml->targetId][] = $partDescriptionXml;
echo "Target Part Description File Processed: \"" . substr($partDescriptionXml->originalFilePath, strlen(AVR_PD_FILE_PATH)) . "\"\n"
echo "Target description File Processed: \"" . substr($partDescriptionXml->originalFilePath, strlen(AVR_PD_FILE_PATH)) . "\"\n"
. "Target Name: \"" . $partDescriptionXml->targetName . "\" Target ID: \"" . $partDescriptionXml->targetId
. "\" Destination: \"" . substr($partDescriptionXml->destinationFilePath, strlen(TARGET_PD_DEST_FILE_PATH))
. "\"\n\n"

View File

@@ -116,9 +116,9 @@ namespace Bloom
},
};
// Include all targets from AVR8 part description files
// Include all targets from AVR8 target description files
auto avr8PdMapping =
Targets::Microchip::Avr::Avr8Bit::PartDescription::PartDescriptionFile::getPartDescriptionMapping();
Targets::Microchip::Avr::Avr8Bit::TargetDescription::TargetDescriptionFile::getTargetDescriptionMapping();
for (auto mapIt = avr8PdMapping.begin(); mapIt != avr8PdMapping.end(); mapIt++) {
// Each target signature maps to an array of targets, as numerous targets can possess the same signature.

View File

@@ -10,7 +10,7 @@
#include "src/Logger/Logger.hpp"
#include "src/Exceptions/InvalidConfig.hpp"
#include "src/Targets/TargetRegister.hpp"
#include "src/Targets/Microchip/AVR/AVR8/PartDescription/PartDescriptionFile.hpp"
#include "src/Targets/Microchip/AVR/AVR8/TargetDescription/TargetDescriptionFile.hpp"
// Derived AVR8 targets
#include "XMega/XMega.hpp"
@@ -42,9 +42,9 @@ void Avr8::postActivationConfigure() {
}
/*
* The signature obtained from the device should match what is in the part description file
* The signature obtained from the device should match what is in the target description file
*
* We don't use this->getId() here as that could return the ID that was extracted from the part description file
* We don't use this->getId() here as that could return the ID that was extracted from the target description file
* (which it would, if the user specified the exact target name in their project config - see Avr8::getId() and
* TargetController::getSupportedTargets() for more).
*/
@@ -53,7 +53,7 @@ void Avr8::postActivationConfigure() {
if (targetSignature != pdSignature) {
throw Exception("Failed to validate connected target - target signature mismatch.\nThe target signature"
"(\"" + targetSignature.toHex() + "\") does not match the AVR8 part description signature (\""
"(\"" + targetSignature.toHex() + "\") does not match the AVR8 target description signature (\""
+ pdSignature.toHex() + "\"). This will likely be due to an incorrect target name in the configuration file"
+ " (bloom.json)."
);
@@ -68,7 +68,7 @@ void Avr8::postPromotionConfigure() {
void Avr8::loadPartDescription() {
auto targetSignature = this->getId();
auto partDescription = PartDescription::PartDescriptionFile(
auto partDescription = TargetDescription::TargetDescriptionFile(
targetSignature.toHex(),
(!this->name.empty()) ? std::optional(this->name) : std::nullopt
);
@@ -82,7 +82,7 @@ void Avr8::loadPadDescriptors() {
auto& targetParameters = this->getTargetParameters();
/*
* Every port address we extract from the part description will be stored in portAddresses, so that
* Every port address we extract from the target description will be stored in portAddresses, so that
* we can extract the start (min) and end (max) for the target's IO port address
* range (TargetParameters::ioPortAddressRangeStart & TargetParameters::ioPortAddressRangeEnd)
*/
@@ -493,7 +493,7 @@ std::vector<TargetVariant> Avr8::generateVariantsFromPartDescription() {
}
if (!pdPinoutsByName.contains(pdVariant.pinoutName)) {
// Missing pinouts in the part description file
// Missing pinouts in the target description file
continue;
}
@@ -883,4 +883,3 @@ bool Avr8::memoryAddressRangeClashesWithIoPortRegisters(TargetMemoryType memoryT
return false;
}

View File

@@ -14,8 +14,8 @@
#include "Family.hpp"
#include "PadDescriptor.hpp"
// Part Description
#include "PartDescription/PartDescriptionFile.hpp"
// target description
#include "TargetDescription/TargetDescriptionFile.hpp"
namespace Bloom::Targets::Microchip::Avr::Avr8Bit
{
@@ -25,7 +25,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
DebugToolDrivers::TargetInterfaces::Microchip::Avr::Avr8::Avr8Interface* avr8Interface;
std::string name = "";
std::optional<Family> family;
std::optional<PartDescription::PartDescriptionFile> partDescription;
std::optional<TargetDescription::TargetDescriptionFile> partDescription;
std::optional<TargetParameters> targetParameters;
std::map<std::string, PadDescriptor> padDescriptorsByName;
std::map<int, TargetVariant> targetVariantsById;
@@ -40,20 +40,20 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
TargetSignature getId() override;
/**
* Extracts the AVR8 target parameters from the loaded part description file.
* Extracts the AVR8 target parameters from the loaded target description file.
*
* @return
*/
virtual TargetParameters& getTargetParameters();
/**
* Generates a collection of PadDescriptor object from data in the loaded part description file and
* Generates a collection of PadDescriptor object from data in the loaded target description file and
* populates this->padDescriptorsByName.
*/
virtual void loadPadDescriptors();
/**
* Extracts target variant information from the loaded part description file and generates a collection
* Extracts target variant information from the loaded target description file and generates a collection
* of TargetVariant objects.
*
* @return

View File

@@ -13,7 +13,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
* pin 4 is mapped to a GND pad.
*
* PadDescriptor describes a single pad on an AVR8 target. On target configuration, PadDescriptors are
* generated from the AVR8 part description file. These descriptors are mapped to pad names.
* generated from the AVR8 target description file. These descriptors are mapped to pad names.
* See Avr8::loadPadDescriptors() for more.
*/
struct PadDescriptor

View File

@@ -0,0 +1,148 @@
#include <QJsonDocument>
#include <QJsonArray>
#include "TargetDescriptionFile.hpp"
#include "src/Exceptions/Exception.hpp"
#include "src/Targets/TargetDescription/Exceptions/TargetDescriptionParsingFailureException.hpp"
#include "src/Logger/Logger.hpp"
#include "src/Helpers/Paths.hpp"
using namespace Bloom::Targets::Microchip::Avr::Avr8Bit::TargetDescription;
using namespace Bloom::Targets::Microchip::Avr::Avr8Bit;
using namespace Bloom::Targets::Microchip::Avr;
using namespace Bloom::Exceptions;
TargetDescriptionFile::TargetDescriptionFile(
const std::string& targetSignatureHex,
std::optional<std::string> targetName
) {
auto mapping = this->getTargetDescriptionMapping();
auto qTargetSignatureHex = QString::fromStdString(targetSignatureHex);
if (mapping.contains(qTargetSignatureHex)) {
// We have a match for the target signature.
auto descriptionFilesJsonArray = mapping.find(qTargetSignatureHex).value().toArray();
auto matchingDescriptionFiles = std::vector<QJsonValue>();
std::copy_if(
descriptionFilesJsonArray.begin(),
descriptionFilesJsonArray.end(),
std::back_inserter(matchingDescriptionFiles),
[&targetName] (const QJsonValue& value) {
auto pdTargetName = value.toObject().find("targetName")->toString().toLower().toStdString();
return !targetName.has_value() || (targetName.has_value() && targetName.value() == pdTargetName);
}
);
if (targetName.has_value() && matchingDescriptionFiles.empty()) {
throw Exception("Failed to resolve target description file for target \"" + targetName.value()
+ "\" - target signature \"" + targetSignatureHex + "\" does not belong to target with name \"" +
targetName.value() + "\". Please review your bloom.json configuration.");
}
if (matchingDescriptionFiles.size() == 1) {
// Attempt to load the XML target description file
auto descriptionFilePath = QString::fromStdString(Paths::applicationDirPath()) + "/"
+ matchingDescriptionFiles.front().toObject().find("targetDescriptionFilePath")->toString();
Logger::debug("Loading AVR8 target description file: " + descriptionFilePath.toStdString());
this->init(descriptionFilePath);
} else if (matchingDescriptionFiles.size() > 1) {
/*
* There are numerous target description files mapped to this target signature. There's really not
* much we can do at this point, so we'll just instruct the user to use a more specific target name.
*/
QStringList targetNames;
std::transform(
matchingDescriptionFiles.begin(),
matchingDescriptionFiles.end(),
std::back_inserter(targetNames),
[](const QJsonValue& descriptionFile) {
return QString("\"" + descriptionFile.toObject().find("targetName")->toString().toLower() + "\"");
}
);
throw Exception("Failed to resolve target description file for target \""
+ targetSignatureHex + "\" - ambiguous signature.\nThe signature is mapped to numerous targets: "
+ targetNames.join(", ").toStdString() + ".\n\nPlease update the target name in your Bloom " +
"configuration to one of the above."
);
} else {
throw Exception("Failed to resolve target description file for target \""
+ targetSignatureHex + "\" - invalid AVR8 target description mapping."
);
}
} else {
throw Exception("Failed to resolve target description file for target \""
+ targetSignatureHex + "\" - unknown target signature.");
}
}
QJsonObject TargetDescriptionFile::getTargetDescriptionMapping() {
auto mappingFile = QFile(
QString::fromStdString(Paths::resourcesDirPath() + "/TargetDescriptionFiles/AVR/Mapping.json")
);
if (!mappingFile.exists()) {
throw Exception("Failed to load AVR target description mapping - mapping file not found");
}
mappingFile.open(QIODevice::ReadOnly);
return QJsonDocument::fromJson(mappingFile.readAll()).object();
}
TargetSignature TargetDescriptionFile::getTargetSignature() const {
auto propertyGroups = this->getPropertyGroupsMappedByName();
auto signaturePropertyGroupIt = propertyGroups.find("signatures");
if (signaturePropertyGroupIt == propertyGroups.end()) {
throw TargetDescriptionParsingFailureException("Signature property group not found");
}
auto signaturePropertyGroup = signaturePropertyGroupIt->second;
auto& signatureProperties = signaturePropertyGroup.propertiesMappedByName;
std::optional<unsigned char> signatureByteZero;
std::optional<unsigned char> signatureByteOne;
std::optional<unsigned char> signatureByteTwo;
if (signatureProperties.find("signature0") != signatureProperties.end()) {
signatureByteZero = static_cast<unsigned char>(
signatureProperties.find("signature0")->second.value.toShort(nullptr, 16)
);
}
if (signatureProperties.find("signature1") != signatureProperties.end()) {
signatureByteOne = static_cast<unsigned char>(
signatureProperties.find("signature1")->second.value.toShort(nullptr, 16)
);
}
if (signatureProperties.find("signature2") != signatureProperties.end()) {
signatureByteTwo = static_cast<unsigned char>(
signatureProperties.find("signature2")->second.value.toShort(nullptr, 16)
);
}
if (signatureByteZero.has_value() && signatureByteOne.has_value() && signatureByteTwo.has_value()) {
return TargetSignature(signatureByteZero.value(), signatureByteOne.value(), signatureByteTwo.value());
}
throw TargetDescriptionParsingFailureException("Failed to extract target signature from AVR8 target description.");
}
Family TargetDescriptionFile::getFamily() const {
static auto familyNameToEnums = this->getFamilyNameToEnumMapping();
auto familyName = this->deviceElement.attributes().namedItem("family").nodeValue().toLower().toStdString();
if (familyName.empty()) {
throw Exception("Could not find target family name in target description file.");
}
if (familyNameToEnums.find(familyName) == familyNameToEnums.end()) {
throw Exception("Unknown family name in target description file.");
}
return familyNameToEnums.find(familyName)->second;
}

View File

@@ -0,0 +1,72 @@
#pragma once
#include "src/Targets/TargetDescription/TargetDescriptionFile.hpp"
#include "src/Targets/Microchip/AVR/TargetSignature.hpp"
#include "src/Targets/Microchip/AVR/AVR8/Family.hpp"
namespace Bloom::Targets::Microchip::Avr::Avr8Bit::TargetDescription
{
/**
* Represents an AVR8 TDF. See the Targets::TargetDescription::TargetDescriptionFile close for more on TDFs.
*
* During the build process, we generate a JSON file containing a mapping of AVR8 target signatures to target
* description file paths. Bloom uses this mapping to find a particular target description file, for AVR8 targets,
* given a target signature. See directory "build/resources/TargetPartDescriptions".
* The generation of the JSON mapping, is done by a PHP script:
* "build/scripts/CopyAvrPartFilesAndCreateMapping.php". This script is invoked via a custom command, at build time.
*/
class TargetDescriptionFile: public Targets::TargetDescription::TargetDescriptionFile
{
private:
/**`
* AVR8 target description files include the target family name. This method returns a mapping of part
* description family name strings to Family enum values.
*
* TODO: the difference in AVR8 family variations, like "tinyAVR" and "tinyAVR 2" may require attention.
*
* @return
*/
static inline auto getFamilyNameToEnumMapping() {
// All keys should be lower case.
return std::map<std::string, Family> {
{"megaavr", Family::MEGA},
{"avr mega", Family::MEGA},
{"avr xmega", Family::XMEGA},
{"avr tiny", Family::TINY},
{"tinyavr", Family::TINY},
{"tinyavr 2", Family::TINY},
};
};
public:
/**
* Will resolve the target description file using the target description JSON mapping and a given target signature.
*
* @param targetSignatureHex
* @param targetName
*/
TargetDescriptionFile(const std::string& targetSignatureHex, std::optional<std::string> targetName);
/**
* Loads the AVR8 target description JSON mapping file.
*
* @return
*/
static QJsonObject getTargetDescriptionMapping();
/**
* Extracts the AVR8 target signature from the target description XML.
*
* @return
*/
TargetSignature getTargetSignature() const;
/**
* Extracts the AVR8 target family from the target description XML.
*
* @return
*/
Family getFamily() const;
};
}

View File

@@ -3,7 +3,6 @@
#include <cstdint>
#include <optional>
#include "src/Targets/Microchip/AVR/AVR8/PartDescription/AddressSpace.hpp"
#include "../TargetSignature.hpp"
#include "Family.hpp"

View File

@@ -1,20 +0,0 @@
#pragma once
#include "src/Exceptions/TargetControllerStartupFailure.hpp"
namespace Bloom::Exceptions
{
class PartDescriptionParsingFailureException: public Exception
{
public:
explicit PartDescriptionParsingFailureException(const std::string& message)
: Exception(message) {
this->message = "Failed to parse AVR part description file - " + message;
}
explicit PartDescriptionParsingFailureException(const char* message)
: Exception(message) {
this->message = "Failed to parse AVR part description file - " + std::string(message);
}
};
}

View File

@@ -17,7 +17,7 @@ namespace Bloom::Targets::Microchip::Avr
* Some AVR targets have been found to carry identical signatures. For example, the AT90PWM1, AT90PWM2B
* and the AT90PWM3B all carry a signature of 0x1E9383. Although these devices may not differ in
* significant ways, Bloom does still take duplicate signatures into account, to ensure that the correct
* part description file is used.
* target description file is used.
*
* This class represents an AVR target signature.
*/

View File

@@ -59,7 +59,7 @@ namespace Bloom::Targets
* postActivationConfigure() - The second stage is right after target activation (successful invocation of
* Target::activate()). At this point, we will have established a connection with the target and so interaction
* with the target is permitted here. We use this method in the Avr8 target class to extract the target signature
* from the target's memory, which we then use to find & load the correct part description file.
* from the target's memory, which we then use to find & load the correct target description file.
*
* postPromotionConfigure() - The final stage of configuration occurs just after the target instance has been
* promoted to a different class. See the Target::promote() method for more in this.
@@ -138,7 +138,7 @@ namespace Bloom::Targets
* know about the target is that it's part of the AVR8 family. Nothing else. But this is ok, because, when we
* begin the target configuration and activation process, we are able to learn a lot more about the target.
* For AVR8 targets, we extract the target signature shortly after activation, and with that signature we find
* the appropriate part description file, which has all of the information regarding the target that we could
* the appropriate target description file, which has all of the information regarding the target that we could
* possibly need. So, by the time we have activated the target, we will know a lot more about it, and it is at
* this point, where we may want to promote it to a more specific target class (from the generic Avr8 target
* class). The generic AVR8 target class will attempt to promote the target to one that is more specific to

View File

@@ -1,11 +1,13 @@
#pragma once
#include <cstdint>
#include "MemorySegment.hpp"
namespace Bloom::Targets::Microchip::Avr::Avr8Bit::PartDescription
namespace Bloom::Targets::TargetDescription
{
struct AddressSpace {
struct AddressSpace
{
std::string id;
std::string name;
std::uint16_t startAddress;

View File

@@ -0,0 +1,20 @@
#pragma once
#include "src/Exceptions/Exception.hpp"
namespace Bloom::Exceptions
{
class TargetDescriptionParsingFailureException: public Exception
{
public:
explicit TargetDescriptionParsingFailureException(const std::string& message)
: Exception(message) {
this->message = "Failed to parse target description file - " + message;
}
explicit TargetDescriptionParsingFailureException(const char* message)
: Exception(message) {
this->message = "Failed to parse target description file - " + std::string(message);
}
};
}

View File

@@ -5,7 +5,7 @@
#include "src/Helpers/BiMap.hpp"
namespace Bloom::Targets::Microchip::Avr::Avr8Bit::PartDescription
namespace Bloom::Targets::TargetDescription
{
enum MemorySegmentType {
REGISTERS,
@@ -19,7 +19,8 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit::PartDescription
OSCCAL,
};
struct MemorySegment {
struct MemorySegment
{
std::string name;
MemorySegmentType type;
std::uint32_t startAddress;

View File

@@ -3,9 +3,10 @@
#include "ModuleInstance.hpp"
#include "RegisterGroup.hpp"
namespace Bloom::Targets::Microchip::Avr::Avr8Bit::PartDescription
namespace Bloom::Targets::TargetDescription
{
struct Module {
struct Module
{
std::string name;
std::map<std::string, ModuleInstance> instancesMappedByName;
std::map<std::string, RegisterGroup> registerGroupsMappedByName;

View File

@@ -2,13 +2,15 @@
#include <map>
#include <vector>
#include <string>
#include "RegisterGroup.hpp"
#include "Signal.hpp"
namespace Bloom::Targets::Microchip::Avr::Avr8Bit::PartDescription
namespace Bloom::Targets::TargetDescription
{
struct ModuleInstance {
struct ModuleInstance
{
std::string name;
std::map<std::string, RegisterGroup> registerGroupsMappedByName;
std::vector<Signal> instanceSignals;

View File

@@ -3,14 +3,16 @@
#include <string>
#include <vector>
namespace Bloom::Targets::Microchip::Avr::Avr8Bit::PartDescription
namespace Bloom::Targets::TargetDescription
{
struct Pin {
struct Pin
{
std::string pad;
int position;
};
struct Pinout {
struct Pinout
{
std::string name;
std::vector<Pin> pins;
};

View File

@@ -1,8 +1,13 @@
#pragma once
namespace Bloom::Targets::Microchip::Avr::Avr8Bit::PartDescription
#include <string>
#include <QString>
#include <map>
namespace Bloom::Targets::TargetDescription
{
struct Property {
struct Property
{
std::string name;
/*
@@ -12,7 +17,8 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit::PartDescription
QString value;
};
struct PropertyGroup {
struct PropertyGroup
{
std::string name;
std::map<std::string, Property> propertiesMappedByName;
};

View File

@@ -1,18 +1,21 @@
#pragma once
#include <cstdint>
#include <string>
#include <map>
#include <optional>
namespace Bloom::Targets::Microchip::Avr::Avr8Bit::PartDescription
namespace Bloom::Targets::TargetDescription
{
struct Register {
struct Register
{
std::string name;
std::uint16_t offset;
std::uint16_t size;
};
struct RegisterGroup {
struct RegisterGroup
{
std::string name;
std::optional<std::uint16_t> offset;
std::map<std::string, Register> registersMappedByName;

View File

@@ -3,9 +3,10 @@
#include <string>
#include <optional>
namespace Bloom::Targets::Microchip::Avr::Avr8Bit::PartDescription
namespace Bloom::Targets::TargetDescription
{
struct Signal {
struct Signal
{
std::string padName;
std::string function;
std::optional<int> index;

View File

@@ -1,87 +1,18 @@
#include <QJsonDocument>
#include <QJsonArray>
#include "PartDescriptionFile.hpp"
#include "src/Targets/Microchip/AVR/Exceptions/PartDescriptionParsingFailureException.hpp"
#include "TargetDescriptionFile.hpp"
#include "Exceptions/TargetDescriptionParsingFailureException.hpp"
#include "src/Logger/Logger.hpp"
#include "src/Helpers/Paths.hpp"
using namespace Bloom::Targets::Microchip::Avr::Avr8Bit::PartDescription;
using namespace Bloom::Targets::Microchip::Avr::Avr8Bit;
using namespace Bloom::Targets::Microchip::Avr;
using namespace Bloom::Targets::TargetDescription;
using namespace Bloom::Exceptions;
// TODO: Move this into a resolvePartDescriptionFile() method.
PartDescriptionFile::PartDescriptionFile(const std::string& targetSignatureHex, std::optional<std::string> targetName) {
auto mapping = this->getPartDescriptionMapping();
auto qTargetSignatureHex = QString::fromStdString(targetSignatureHex);
if (mapping.contains(qTargetSignatureHex)) {
// We have a match for the target signature.
auto descriptionFilesJsonArray = mapping.find(qTargetSignatureHex).value().toArray();
auto matchingDescriptionFiles = std::vector<QJsonValue>();
std::copy_if(
descriptionFilesJsonArray.begin(),
descriptionFilesJsonArray.end(),
std::back_inserter(matchingDescriptionFiles),
[&targetName] (const QJsonValue& value) {
auto pdTargetName = value.toObject().find("targetName")->toString().toLower().toStdString();
return !targetName.has_value() || (targetName.has_value() && targetName.value() == pdTargetName);
}
);
if (targetName.has_value() && matchingDescriptionFiles.empty()) {
throw Exception("Failed to resolve target description file for target \"" + targetName.value()
+ "\" - target signature \"" + targetSignatureHex + "\" does not belong to target with name \"" +
targetName.value() + "\". Please review your bloom.json configuration.");
}
if (matchingDescriptionFiles.size() == 1) {
// Attempt to load the XML part description file
auto descriptionFilePath = QString::fromStdString(Paths::applicationDirPath()) + "/"
+ matchingDescriptionFiles.front().toObject().find("targetDescriptionFilePath")->toString();
Logger::debug("Loading AVR8 part description file: " + descriptionFilePath.toStdString());
this->init(descriptionFilePath);
} else if (matchingDescriptionFiles.size() > 1) {
/*
* There are numerous part description files mapped to this target signature. There's really not
* much we can do at this point, so we'll just instruct the user to use a more specific target name.
*/
QStringList targetNames;
std::transform(
matchingDescriptionFiles.begin(),
matchingDescriptionFiles.end(),
std::back_inserter(targetNames),
[](const QJsonValue& descriptionFile) {
return QString("\"" + descriptionFile.toObject().find("targetName")->toString().toLower() + "\"");
}
);
throw Exception("Failed to resolve part description file for target \""
+ targetSignatureHex + "\" - ambiguous signature.\nThe signature is mapped to numerous targets: "
+ targetNames.join(", ").toStdString() + ".\n\nPlease update the target name in your Bloom " +
"configuration to one of the above."
);
} else {
throw Exception("Failed to resolve part description file for target \""
+ targetSignatureHex + "\" - invalid AVR8 target description mapping."
);
}
} else {
throw Exception("Failed to resolve part description file for target \""
+ targetSignatureHex + "\" - unknown target signature.");
}
}
void PartDescriptionFile::init(const QString& xmlFilePath) {
void TargetDescriptionFile::init(const QString& xmlFilePath) {
auto file = QFile(xmlFilePath);
if (!file.exists()) {
// This can happen if someone has been messing with the Resources directory.
throw Exception("Failed to load part description file - file not found");
throw Exception("Failed to load target description file - file not found");
}
file.open(QIODevice::ReadOnly);
@@ -90,76 +21,24 @@ void PartDescriptionFile::init(const QString& xmlFilePath) {
this->init(xml);
}
void PartDescriptionFile::init(const QDomDocument& xml) {
void TargetDescriptionFile::init(const QDomDocument& xml) {
this->xml = xml;
auto device = xml.elementsByTagName("devices").item(0)
.toElement().elementsByTagName("device").item(0).toElement();
if (!device.isElement()) {
throw PartDescriptionParsingFailureException("Device element not found.");
throw TargetDescriptionParsingFailureException("Device element not found.");
}
this->deviceElement = device;
}
QJsonObject PartDescriptionFile::getPartDescriptionMapping() {
auto mappingFile = QFile(
QString::fromStdString(Paths::resourcesDirPath() + "/TargetPartDescriptions/AVR/Mapping.json")
);
if (!mappingFile.exists()) {
throw TargetControllerStartupFailure("Failed to load AVR part description mapping - mapping file not found");
}
mappingFile.open(QIODevice::ReadOnly);
return QJsonDocument::fromJson(mappingFile.readAll()).object();
}
std::string PartDescriptionFile::getTargetName() const {
std::string TargetDescriptionFile::getTargetName() const {
return this->deviceElement.attributes().namedItem("name").nodeValue().toStdString();
}
TargetSignature PartDescriptionFile::getTargetSignature() const {
auto propertyGroups = this->getPropertyGroupsMappedByName();
auto signaturePropertyGroupIt = propertyGroups.find("signatures");
if (signaturePropertyGroupIt == propertyGroups.end()) {
throw PartDescriptionParsingFailureException("Signature property group not found");
}
auto signaturePropertyGroup = signaturePropertyGroupIt->second;
auto& signatureProperties = signaturePropertyGroup.propertiesMappedByName;
std::optional<unsigned char> signatureByteZero;
std::optional<unsigned char> signatureByteOne;
std::optional<unsigned char> signatureByteTwo;
if (signatureProperties.find("signature0") != signatureProperties.end()) {
signatureByteZero = static_cast<unsigned char>(
signatureProperties.find("signature0")->second.value.toShort(nullptr, 16)
);
}
if (signatureProperties.find("signature1") != signatureProperties.end()) {
signatureByteOne = static_cast<unsigned char>(
signatureProperties.find("signature1")->second.value.toShort(nullptr, 16)
);
}
if (signatureProperties.find("signature2") != signatureProperties.end()) {
signatureByteTwo = static_cast<unsigned char>(
signatureProperties.find("signature2")->second.value.toShort(nullptr, 16)
);
}
if (signatureByteZero.has_value() && signatureByteOne.has_value() && signatureByteTwo.has_value()) {
return TargetSignature(signatureByteZero.value(), signatureByteOne.value(), signatureByteTwo.value());
}
throw PartDescriptionParsingFailureException("Failed to extract target signature from AVR8 part description.");
}
AddressSpace PartDescriptionFile::generateAddressSpaceFromXml(const QDomElement& xmlElement) const {
AddressSpace TargetDescriptionFile::generateAddressSpaceFromXml(const QDomElement& xmlElement) const {
if (
!xmlElement.hasAttribute("id")
|| !xmlElement.hasAttribute("name")
@@ -208,7 +87,7 @@ AddressSpace PartDescriptionFile::generateAddressSpaceFromXml(const QDomElement&
memorySegments.find(segment.type)->second.insert(std::pair(segment.name, segment));
} catch (const Exception& exception) {
Logger::debug("Failed to extract memory segment from part description element - "
Logger::debug("Failed to extract memory segment from target description element - "
+ exception.getMessage());
}
}
@@ -216,7 +95,7 @@ AddressSpace PartDescriptionFile::generateAddressSpaceFromXml(const QDomElement&
return addressSpace;
}
MemorySegment PartDescriptionFile::generateMemorySegmentFromXml(const QDomElement& xmlElement) const {
MemorySegment TargetDescriptionFile::generateMemorySegmentFromXml(const QDomElement& xmlElement) const {
if (
!xmlElement.hasAttribute("type")
|| !xmlElement.hasAttribute("name")
@@ -266,7 +145,7 @@ MemorySegment PartDescriptionFile::generateMemorySegmentFromXml(const QDomElemen
return segment;
}
RegisterGroup PartDescriptionFile::generateRegisterGroupFromXml(const QDomElement& xmlElement) const {
RegisterGroup TargetDescriptionFile::generateRegisterGroupFromXml(const QDomElement& xmlElement) const {
if (!xmlElement.hasAttribute("name")) {
throw Exception("Missing register group name attribute");
}
@@ -290,15 +169,15 @@ RegisterGroup PartDescriptionFile::generateRegisterGroupFromXml(const QDomElemen
registers.insert(std::pair(reg.name, reg));
} catch (const Exception& exception) {
Logger::debug("Failed to extract register from register group part description element - "
+ exception.getMessage());
Logger::debug("Failed to extract register from register group target description element - "
+ exception.getMessage());
}
}
return registerGroup;
}
Register PartDescriptionFile::generateRegisterFromXml(const QDomElement& xmlElement) const {
Register TargetDescriptionFile::generateRegisterFromXml(const QDomElement& xmlElement) const {
if (
!xmlElement.hasAttribute("name")
|| !xmlElement.hasAttribute("offset")
@@ -326,25 +205,10 @@ Register PartDescriptionFile::generateRegisterFromXml(const QDomElement& xmlElem
return reg;
}
Family PartDescriptionFile::getFamily() const {
static auto familyNameToEnums = this->getFamilyNameToEnumMapping();
auto familyName = this->deviceElement.attributes().namedItem("family").nodeValue().toLower().toStdString();
if (familyName.empty()) {
throw Exception("Could not find target family name in part description file.");
}
if (familyNameToEnums.find(familyName) == familyNameToEnums.end()) {
throw Exception("Unknown family name in part description file.");
}
return familyNameToEnums.find(familyName)->second;
}
const std::map<std::string, PropertyGroup>& PartDescriptionFile::getPropertyGroupsMappedByName() const {
const std::map<std::string, PropertyGroup>& TargetDescriptionFile::getPropertyGroupsMappedByName() const {
if (!this->cachedPropertyGroupMapping.has_value()) {
if (!this->deviceElement.isElement()) {
throw PartDescriptionParsingFailureException("Device element not found.");
throw TargetDescriptionParsingFailureException("Device element not found.");
}
std::map<std::string, PropertyGroup> output;
@@ -378,7 +242,7 @@ const std::map<std::string, PropertyGroup>& PartDescriptionFile::getPropertyGrou
return this->cachedPropertyGroupMapping.value();
}
const std::map<std::string, Module>& PartDescriptionFile::getModulesMappedByName() const {
const std::map<std::string, Module>& TargetDescriptionFile::getModulesMappedByName() const {
if (!this->cachedModuleByNameMapping.has_value()) {
std::map<std::string, Module> output;
auto moduleNodes = this->xml.elementsByTagName("modules").item(0).toElement()
@@ -406,7 +270,7 @@ const std::map<std::string, Module>& PartDescriptionFile::getModulesMappedByName
return this->cachedModuleByNameMapping.value();
}
const std::map<std::string, Module>& PartDescriptionFile::getPeripheralModulesMappedByName() const {
const std::map<std::string, Module>& TargetDescriptionFile::getPeripheralModulesMappedByName() const {
if (!this->cachedPeripheralModuleByNameMapping.has_value()) {
std::map<std::string, Module> output;
auto moduleNodes = this->deviceElement.elementsByTagName("peripherals").item(0).toElement()
@@ -474,7 +338,7 @@ const std::map<std::string, Module>& PartDescriptionFile::getPeripheralModulesMa
return this->cachedPeripheralModuleByNameMapping.value();
}
std::map<std::string, AddressSpace> PartDescriptionFile::getAddressSpacesMappedById() const {
std::map<std::string, AddressSpace> TargetDescriptionFile::getAddressSpacesMappedById() const {
std::map<std::string, AddressSpace> output;
auto addressSpaceNodes = this->deviceElement.elementsByTagName("address-spaces").item(0).toElement()
@@ -486,14 +350,14 @@ std::map<std::string, AddressSpace> PartDescriptionFile::getAddressSpacesMappedB
output.insert(std::pair(addressSpace.id, addressSpace));
} catch (const Exception& exception) {
Logger::debug("Failed to extract address space from part description element - " + exception.getMessage());
Logger::debug("Failed to extract address space from target description element - " + exception.getMessage());
}
}
return output;
}
std::optional<MemorySegment> PartDescriptionFile::getFlashMemorySegment() const {
std::optional<MemorySegment> TargetDescriptionFile::getFlashMemorySegment() const {
auto addressMapping = this->getAddressSpacesMappedById();
auto programAddressSpaceIt = addressMapping.find("prog");
@@ -506,7 +370,7 @@ std::optional<MemorySegment> PartDescriptionFile::getFlashMemorySegment() const
auto& flashMemorySegments = programMemorySegments.find(MemorySegmentType::FLASH)->second;
/*
* Some part descriptions describe the flash memory segments in the "APP_SECTION" segment, whereas
* Some target descriptions describe the flash memory segments in the "APP_SECTION" segment, whereas
* others use the "FLASH" segment.
*/
auto flashSegmentIt = flashMemorySegments.find("app_section") != flashMemorySegments.end() ?
@@ -521,7 +385,7 @@ std::optional<MemorySegment> PartDescriptionFile::getFlashMemorySegment() const
return std::nullopt;
}
std::optional<MemorySegment> PartDescriptionFile::getRamMemorySegment() const {
std::optional<MemorySegment> TargetDescriptionFile::getRamMemorySegment() const {
auto addressMapping = this->getAddressSpacesMappedById();
// Internal RAM &register attributes are usually found in the data address space
@@ -544,7 +408,7 @@ std::optional<MemorySegment> PartDescriptionFile::getRamMemorySegment() const {
return std::nullopt;
}
std::optional<MemorySegment> PartDescriptionFile::getRegisterMemorySegment() const {
std::optional<MemorySegment> TargetDescriptionFile::getRegisterMemorySegment() const {
auto addressMapping = this->getAddressSpacesMappedById();
// Internal RAM &register attributes are usually found in the data address space
@@ -567,7 +431,7 @@ std::optional<MemorySegment> PartDescriptionFile::getRegisterMemorySegment() con
return std::nullopt;
}
std::optional<MemorySegment> PartDescriptionFile::getEepromMemorySegment() const {
std::optional<MemorySegment> TargetDescriptionFile::getEepromMemorySegment() const {
auto addressMapping = this->getAddressSpacesMappedById();
// EEPROM attributes are usually found in the data address space
@@ -590,7 +454,7 @@ std::optional<MemorySegment> PartDescriptionFile::getEepromMemorySegment() const
return std::nullopt;
}
std::optional<MemorySegment> PartDescriptionFile::getFirstBootSectionMemorySegment() const {
std::optional<MemorySegment> TargetDescriptionFile::getFirstBootSectionMemorySegment() const {
auto addressMapping = this->getAddressSpacesMappedById();
auto programAddressSpaceIt = addressMapping.find("prog");
@@ -614,7 +478,7 @@ std::optional<MemorySegment> PartDescriptionFile::getFirstBootSectionMemorySegme
return std::nullopt;
}
std::optional<RegisterGroup> PartDescriptionFile::getCpuRegisterGroup() const {
std::optional<RegisterGroup> TargetDescriptionFile::getCpuRegisterGroup() const {
auto& modulesByName = this->getModulesMappedByName();
if (modulesByName.find("cpu") != modulesByName.end()) {
@@ -629,7 +493,7 @@ std::optional<RegisterGroup> PartDescriptionFile::getCpuRegisterGroup() const {
return std::nullopt;
}
std::optional<RegisterGroup> PartDescriptionFile::getBootLoadRegisterGroup() const {
std::optional<RegisterGroup> TargetDescriptionFile::getBootLoadRegisterGroup() const {
auto& modulesByName = this->getModulesMappedByName();
if (modulesByName.contains("boot_load")) {
@@ -644,7 +508,7 @@ std::optional<RegisterGroup> PartDescriptionFile::getBootLoadRegisterGroup() con
return std::nullopt;
}
std::optional<RegisterGroup> PartDescriptionFile::getEepromRegisterGroup() const {
std::optional<RegisterGroup> TargetDescriptionFile::getEepromRegisterGroup() const {
auto& modulesByName = this->getModulesMappedByName();
if (modulesByName.find("eeprom") != modulesByName.end()) {
@@ -659,7 +523,7 @@ std::optional<RegisterGroup> PartDescriptionFile::getEepromRegisterGroup() const
return std::nullopt;
}
std::optional<Register> PartDescriptionFile::getStatusRegister() const {
std::optional<Register> TargetDescriptionFile::getStatusRegister() const {
auto cpuRegisterGroup = this->getCpuRegisterGroup();
if (cpuRegisterGroup.has_value()) {
@@ -673,7 +537,7 @@ std::optional<Register> PartDescriptionFile::getStatusRegister() const {
return std::nullopt;
}
std::optional<Register> PartDescriptionFile::getStackPointerRegister() const {
std::optional<Register> TargetDescriptionFile::getStackPointerRegister() const {
auto cpuRegisterGroup = this->getCpuRegisterGroup();
if (cpuRegisterGroup.has_value()) {
@@ -687,7 +551,7 @@ std::optional<Register> PartDescriptionFile::getStackPointerRegister() const {
return std::nullopt;
}
std::optional<Register> PartDescriptionFile::getStackPointerHighRegister() const {
std::optional<Register> TargetDescriptionFile::getStackPointerHighRegister() const {
auto cpuRegisterGroup = this->getCpuRegisterGroup();
if (cpuRegisterGroup.has_value()) {
@@ -701,7 +565,7 @@ std::optional<Register> PartDescriptionFile::getStackPointerHighRegister() const
return std::nullopt;
}
std::optional<Register> PartDescriptionFile::getStackPointerLowRegister() const {
std::optional<Register> TargetDescriptionFile::getStackPointerLowRegister() const {
auto cpuRegisterGroup = this->getCpuRegisterGroup();
if (cpuRegisterGroup.has_value()) {
@@ -715,7 +579,7 @@ std::optional<Register> PartDescriptionFile::getStackPointerLowRegister() const
return std::nullopt;
}
std::optional<Register> PartDescriptionFile::getOscillatorCalibrationRegister() const {
std::optional<Register> TargetDescriptionFile::getOscillatorCalibrationRegister() const {
auto cpuRegisterGroup = this->getCpuRegisterGroup();
if (cpuRegisterGroup.has_value()) {
@@ -729,7 +593,7 @@ std::optional<Register> PartDescriptionFile::getOscillatorCalibrationRegister()
return std::nullopt;
}
std::optional<Register> PartDescriptionFile::getSpmcsRegister() const {
std::optional<Register> TargetDescriptionFile::getSpmcsRegister() const {
auto cpuRegisterGroup = this->getCpuRegisterGroup();
if (cpuRegisterGroup.has_value()) {
@@ -743,7 +607,7 @@ std::optional<Register> PartDescriptionFile::getSpmcsRegister() const {
return std::nullopt;
}
std::optional<Register> PartDescriptionFile::getSpmcRegister() const {
std::optional<Register> TargetDescriptionFile::getSpmcRegister() const {
auto bootLoadRegisterGroup = this->getBootLoadRegisterGroup();
if (bootLoadRegisterGroup.has_value()) {
@@ -757,7 +621,7 @@ std::optional<Register> PartDescriptionFile::getSpmcRegister() const {
return std::nullopt;
}
std::optional<Register> PartDescriptionFile::getEepromAddressRegister() const {
std::optional<Register> TargetDescriptionFile::getEepromAddressRegister() const {
auto eepromRegisterGroup = this->getEepromRegisterGroup();
if (eepromRegisterGroup.has_value()) {
@@ -771,7 +635,7 @@ std::optional<Register> PartDescriptionFile::getEepromAddressRegister() const {
return std::nullopt;
}
std::optional<Register> PartDescriptionFile::getEepromDataRegister() const {
std::optional<Register> TargetDescriptionFile::getEepromDataRegister() const {
auto eepromRegisterGroup = this->getEepromRegisterGroup();
if (eepromRegisterGroup.has_value()) {
@@ -785,7 +649,7 @@ std::optional<Register> PartDescriptionFile::getEepromDataRegister() const {
return std::nullopt;
}
std::optional<Register> PartDescriptionFile::getEepromControlRegister() const {
std::optional<Register> TargetDescriptionFile::getEepromControlRegister() const {
auto eepromRegisterGroup = this->getEepromRegisterGroup();
if (eepromRegisterGroup.has_value()) {
@@ -799,7 +663,7 @@ std::optional<Register> PartDescriptionFile::getEepromControlRegister() const {
return std::nullopt;
}
std::vector<Variant> PartDescriptionFile::getVariants() const {
std::vector<Variant> TargetDescriptionFile::getVariants() const {
std::vector<Variant> output;
auto variantNodes = this->xml.elementsByTagName("variants").item(0).toElement()
@@ -833,14 +697,14 @@ std::vector<Variant> PartDescriptionFile::getVariants() const {
output.push_back(variant);
} catch (const Exception& exception) {
Logger::debug("Failed to extract variant from part description element - " + exception.getMessage());
Logger::debug("Failed to extract variant from target description element - " + exception.getMessage());
}
}
return output;
}
const std::map<std::string, Pinout>& PartDescriptionFile::getPinoutsMappedByName() const {
const std::map<std::string, Pinout>& TargetDescriptionFile::getPinoutsMappedByName() const {
if (!this->cachedPinoutByNameMapping.has_value()) {
this->cachedPinoutByNameMapping = std::map<std::string, Pinout>();
@@ -878,7 +742,7 @@ const std::map<std::string, Pinout>& PartDescriptionFile::getPinoutsMappedByName
if (!positionConversionSucceeded) {
throw Exception("Failed to convert position attribute value to integer on pin element "
+ std::to_string(pinIndex));
+ std::to_string(pinIndex));
}
pinout.pins.push_back(pin);
@@ -887,7 +751,7 @@ const std::map<std::string, Pinout>& PartDescriptionFile::getPinoutsMappedByName
this->cachedPinoutByNameMapping->insert(std::pair(pinout.name, pinout));
} catch (const Exception& exception) {
Logger::debug("Failed to extract pinout from part description element - " + exception.getMessage());
Logger::debug("Failed to extract pinout from target description element - " + exception.getMessage());
}
}
}

View File

@@ -13,60 +13,43 @@
#include "src/Targets/Microchip/AVR/TargetSignature.hpp"
#include "src/Targets/Microchip/AVR/AVR8/Family.hpp"
namespace Bloom::Targets::Microchip::Avr::Avr8Bit::PartDescription
namespace Bloom::Targets::TargetDescription
{
/**
* An AVR8 part description file is an XML file that describes a particular AVR8 target.
* All supported AVR8 targets come with a part description file.
* A target description file (TDF) is an XML file that describes a particular target. All supported targets come
* with a target description file.
*
* Part description files are part of the Bloom codebase.
* For AVR8 part description files, see directory "src/Targets/Microchip/AVR/PartDescriptionFiles/AVR8".
* Target description files are part of the Bloom codebase.
* For target description files, see the directory "src/Targets/TargetDescriptionFiles/".
*
* During the build process, all part description files are copied to the distribution directory, ready
* to be shipped with the Bloom binary. Alongside these files is a JSON file, containing a mapping of AVR8 target
* signatures to part description file paths. Bloom uses this mapping to find a particular part description
* file, given a target signature. See directory "build/resources/TargetPartDescriptions".
* The copying of the part description files, and the generation of the JSON mapping, is done by a PHP script:
* "build/scripts/CopyAvrPartFilesAndCreateMapping.php". This script is invoked via a custom command, at build time.
* During the build process, all target description files are copied to the distribution directory, ready
* to be shipped with the Bloom binary.
*
* All processing of AVR8 part description files is done in this class.
* Processing of target description files is done in this class.
*
* This class may be extended to further reflect a TDF that is specific to a particular target, target architecture
* or target family. For example, the Targets::Microchip::Avr::Avr8Bit::TargetDescription::TargetDescriptionFile
* class inherits from this class, to represent TDFs for AVR8 targets. The derived class provides access to
* additional data that is only found in AVR8 TDFs (such as AVR target signature, AVR Family, etc).
*/
class PartDescriptionFile
class TargetDescriptionFile
{
private:
protected:
QDomDocument xml;
QDomElement deviceElement;
void init(const QDomDocument& xml);
void init(const QString& xmlFilePath);
private:
mutable std::optional<std::map<std::string, PropertyGroup>> cachedPropertyGroupMapping;
mutable std::optional<std::map<std::string, Module>> cachedModuleByNameMapping;
mutable std::optional<std::map<std::string, Module>> cachedPeripheralModuleByNameMapping;
mutable std::optional<std::map<std::string, Pinout>> cachedPinoutByNameMapping;
/**`
* AVR8 part description files include the target family name. This method returns a mapping of part
* description family name strings to Family enum values.
*
* TODO: the difference in AVR8 family variations, like "tinyAVR" and "tinyAVR 2" may require attention.
*
* @return
*/
static inline auto getFamilyNameToEnumMapping() {
// All keys should be lower case.
return std::map<std::string, Family> {
{"megaavr", Family::MEGA},
{"avr mega", Family::MEGA},
{"avr xmega", Family::XMEGA},
{"avr tiny", Family::TINY},
{"tinyavr", Family::TINY},
{"tinyavr 2", Family::TINY},
};
};
void init(const QDomDocument& xml);
void init(const QString& xmlFilePath);
/**
* Constructs an AddressSpace object from an XML element (in the form of a QDomElement), taken from
* an AVR part description file.
* Constructs an AddressSpace object from an XML element (in the form of a QDomElement), taken from a target
* description file.
*
* @param xmlElement
* @return
@@ -74,8 +57,8 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit::PartDescription
AddressSpace generateAddressSpaceFromXml(const QDomElement& xmlElement) const;
/**
* Constructs a MemorySegment from an XML element (in the form of a QDomElement) taken from
* an AVR part description file.
* Constructs a MemorySegment from an XML element (in the form of a QDomElement) taken from a target
* description file.
*
* @param xmlElement
* @return
@@ -86,52 +69,31 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit::PartDescription
Register generateRegisterFromXml(const QDomElement& xmlElement) const;
public:
TargetDescriptionFile() = default;
/**
* Will construct a PartDescription instance from the XML of a part description file, the path to which
* Will construct a TargetDescriptionFile instance from the XML of a target description file, the path to which
* is given via xmlFilePath.
*
* @param xmlFilePath
*/
PartDescriptionFile(const QString& xmlFilePath) {
TargetDescriptionFile(const QString& xmlFilePath) {
this->init(xmlFilePath);
}
/**
* Will construct a PartDescription instance from pre-loaded XML.
* Will construct a TargetDescriptionFile instance from pre-loaded XML.
*
* @param xml
*/
PartDescriptionFile(const QDomDocument& xml) {
TargetDescriptionFile(const QDomDocument& xml) {
this->init(xml);
}
/**
* Will resolve the part description file using the part description JSON mapping and a given target signature.
*
* @param targetSignatureHex
* @param targetName
*/
PartDescriptionFile(const std::string& targetSignatureHex, std::optional<std::string> targetName);
/**
* Loads the AVR8 target description JSON mapping file.
*
* @return
*/
static QJsonObject getPartDescriptionMapping();
std::string getTargetName() const;
/**
* Extracts the AVR8 target signature from the part description XML.
*
* @return
*/
TargetSignature getTargetSignature() const;
/**
* Extracts all address spaces for the AVR8 target, from the part description XML.
* Extracts all address spaces for the AVR8 target, from the target description XML.
*
* Will return a mapping of the extracted address spaces, mapped by id.
*
@@ -139,13 +101,6 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit::PartDescription
*/
std::map<std::string, AddressSpace> getAddressSpacesMappedById() const;
/**
* Extracts the AVR8 target family from the part description XML.
*
* @return
*/
Family getFamily() const;
const std::map<std::string, PropertyGroup>& getPropertyGroupsMappedByName() const;
const std::map<std::string, Module>& getModulesMappedByName() const;
const std::map<std::string, Module>& getPeripheralModulesMappedByName() const;

View File

@@ -2,9 +2,10 @@
#include <string>
namespace Bloom::Targets::Microchip::Avr::Avr8Bit::PartDescription
namespace Bloom::Targets::TargetDescription
{
struct Variant {
struct Variant
{
std::string orderCode;
std::string pinoutName;
std::string package;

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="AT90CAN128-16AI" tempmin="-40" tempmax="85" speedmax="16000000" pinout="TQFP64"
package="TQFP64" vccmin="2.7" vccmax="5.5"/>
@@ -1651,4 +1651,4 @@
<pin position="64" pad="AVCC"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="AT90CAN32-16AI" tempmin="-40" tempmax="85" speedmax="16000000" pinout="TQFP64"
package="TQFP64" vccmin="2.7" vccmax="5.5"/>
@@ -1627,4 +1627,4 @@
<pin position="64" pad="AVCC"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="AT90CAN64-16AI" tempmin="-40" tempmax="85" speedmax="16000000" pinout="TQFP64"
package="TQFP64" vccmin="2.7" vccmax="5.5"/>
@@ -1629,4 +1629,4 @@
<pin position="64" pad="AVCC"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="2.7" vccmax="5.5"/>
</variants>
@@ -1130,4 +1130,4 @@
</value-group>
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="2.7" vccmax="5.5"/>
</variants>
@@ -1059,4 +1059,4 @@
</register-group>
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="2.7" vccmax="5.5"/>
</variants>
@@ -1213,4 +1213,4 @@
</register-group>
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="2.7" vccmax="5.5"/>
</variants>
@@ -1242,4 +1242,4 @@
</register-group>
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="2.7" vccmax="5.5"/>
</variants>
@@ -1306,4 +1306,4 @@
</register-group>
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="2.7" vccmax="5.5"/>
</variants>
@@ -1326,4 +1326,4 @@
</register-group>
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="2.7" vccmax="5.5"/>
</variants>
@@ -1083,4 +1083,4 @@
</register-group>
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="2.2" vccmax="5.5"/>
</variants>
@@ -1352,4 +1352,4 @@
</register-group>
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="2.2" vccmax="5.5"/>
</variants>
@@ -1477,4 +1477,4 @@
</value-group>
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="2.7" vccmax="5.5"/>
</variants>
@@ -1013,4 +1013,4 @@
</value-group>
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="2.7" vccmax="5.5"/>
</variants>
@@ -1477,4 +1477,4 @@
</value-group>
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="2.7" vccmax="5.5"/>
</variants>
@@ -1477,4 +1477,4 @@
</value-group>
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="2.7" vccmax="5.5"/>
</variants>
@@ -1013,4 +1013,4 @@
</value-group>
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega128L-8AU" tempmin="-40" tempmax="85" speedmax="8000000" pinout="TQFPQFN64"
package="TQFP64" vccmin="2.7" vccmax="5.5"/>
@@ -1430,4 +1430,4 @@
<pin position="64" pad="AVCC"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega1280V-8AU" speedmax="8000000" tempmin="-40" tempmax="85" vccmin="1.8" vccmax="5.5"
package="TQFP100" pinout="TQFP"/>
@@ -2066,4 +2066,4 @@
<pin pad="PG0" position="K10"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega1281V-8AU" tempmin="-40" tempmax="85" speedmax="8000000" pinout="TQFP64"
package="TQFP64" vccmin="1.8" vccmax="5.5"/>
@@ -1808,4 +1808,4 @@
<pin position="64" pad="AVCC"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega1284-AU" tempmin="-40" tempmax="85" speedmax="20000000" pinout="TQFP_QFN_44"
package="TQFP44" vccmin="1.8" vccmax="5.5"/>
@@ -1491,4 +1491,4 @@
<pin position="44" pad="PB4"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega1284P-AU" tempmin="-40" tempmax="85" speedmax="20000000" pinout="TQFP_QFN_44"
package="TQFP44" vccmin="1.8" vccmax="5.5"/>
@@ -1547,4 +1547,4 @@
<pin position="44" pad="PB4"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega1284RFR2-ZU" package="VQFN48" speedmax="16000000" tempmax="85" tempmin="-40"
vccmax="3.6" vccmin="1.8"/>
@@ -2795,4 +2795,4 @@
</value-group>
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega128A-AU" tempmin="-40" tempmax="85" speedmax="16000000" pinout="TQFPQFN64"
package="TQFP64" vccmin="2.7" vccmax="5.5"/>
@@ -1406,4 +1406,4 @@
<pin position="64" pad="AVCC"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="1.8" vccmax="3.6"/>
</variants>
@@ -2482,4 +2482,4 @@
</value-group>
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega128RFR2-ZU" package="QFN64" speedmax="16000000" tempmax="85" tempmin="-40"
vccmax="3.6" vccmin="1.8"/>
@@ -2765,4 +2765,4 @@
</value-group>
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega16L-8AU" tempmin="-40" tempmax="85" speedmax="8000000" pinout="TQFPQFN44"
package="TQFP44" vccmin="2.7" vccmax="5.5"/>
@@ -1206,4 +1206,4 @@
<pin position="40" pad="PA0"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega1608-AFR" package="TQFP32" pinout="QFP32" speedmax="20000000" tempmax="105"
tempmin="-40" vccmax="5.0" vccmin="1.8"/>
@@ -2529,4 +2529,4 @@
<pin pad="PA6" position="28"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega1609-AFR" package="TQFP48" pinout="QFP48" speedmax="20000000" tempmax="105"
tempmin="-40" vccmax="5.0" vccmin="1.8"/>
@@ -2621,4 +2621,4 @@
<pin pad="PA4" position="48"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="1.8" vccmax="5.5"/>
</variants>
@@ -1070,4 +1070,4 @@
</value-group>
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega164A-AU" tempmin="-40" tempmax="85" speedmax="20000000" pinout="TQFP_QFN_44"
package="TQFP44" vccmin="1.8" vccmax="5.5"/>
@@ -1538,4 +1538,4 @@
<pin position="G7" pad="GND"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega164PV-10AU" tempmin="-40" tempmax="85" speedmax="10000000" pinout="TQFP_VQFN_44"
package="TQFP44" vccmin="1.8" vccmax="5.5"/>
@@ -1453,4 +1453,4 @@
<pin position="44" pad="PB4"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega164PA-AU" tempmin="-40" tempmax="85" speedmax="20000000" pinout="TQFP_QFN_44"
package="TQFP44" vccmin="1.8" vccmax="5.5"/>
@@ -1546,4 +1546,4 @@
<pin position="G7" pad="GND"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="1.8" vccmax="5.5"/>
</variants>
@@ -1010,4 +1010,4 @@
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="1.8" vccmax="5.5"/>
</variants>
@@ -1010,4 +1010,4 @@
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="1.8" vccmax="5.5"/>
</variants>
@@ -1012,4 +1012,4 @@
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega168V-10AU" tempmin="-40" tempmax="85" speedmax="10000000" pinout="TQFP32"
package="TQFP32" vccmin="1.8" vccmax="5.5"/>
@@ -1281,4 +1281,4 @@
<pin position="28" pad="PC5"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega168A-AU" tempmin="-40" tempmax="85" speedmax="20000000" pinout="TQFP32"
package="TQFP32" vccmin="1.8" vccmax="5.5"/>
@@ -1343,4 +1343,4 @@
<pin position="A1" pad="PD2"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega168PV-10AU" tempmin="-40" tempmax="85" speedmax="10000000" pinout="TQFP32"
package="TQFP32" vccmin="1.8" vccmax="5.5"/>
@@ -1314,4 +1314,4 @@
<pin position="28" pad="PC5"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega168PA-AU" tempmin="-40" tempmax="85" speedmax="20000000" pinout="TQFP32"
package="TQFP32" vccmin="1.8" vccmax="5.5"/>
@@ -1351,4 +1351,4 @@
<pin position="A1" pad="PD2"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega168PB-AU" tempmin="-40" tempmax="85" speedmax="20000000" pinout="TQFP32"
package="TQFP32" vccmin="1.8" vccmax="5.5"/>
@@ -1280,4 +1280,4 @@
<pin position="32" pad="PD2"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega169A-AU" tempmin="-40" tempmax="85" speedmax="16000000" pinout="TQFP64"
package="TQFP64" vccmin="1.8" vccmax="5.5"/>
@@ -1502,4 +1502,4 @@
<pin position="B30" pad="AVCC"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega169PV-8AU" tempmin="-40" tempmax="85" speedmax="8000000" pinout="TQFP64"
package="TQFP64" vccmin="1.8" vccmax="5.5"/>
@@ -1504,4 +1504,4 @@
<pin position="B30" pad="AVCC"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega169PA-AU" tempmin="-40" tempmax="85" speedmax="16000000" pinout="TQFP64"
package="TQFP64" vccmin="1.8" vccmax="5.5"/>
@@ -1540,4 +1540,4 @@
<pin position="B30" pad="AVCC"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega16A-AU" tempmin="-40" tempmax="85" speedmax="16000000" pinout="TQFPQFN44"
package="TQFP44" vccmin="2.7" vccmax="5.5"/>
@@ -1233,4 +1233,4 @@
<pin position="40" pad="PA0"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="1.8" vccmax="4.5"/>
</variants>
@@ -682,4 +682,4 @@
</register-group>
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="3.0" vccmax="4.5"/>
</variants>
@@ -979,4 +979,4 @@
</register-group>
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="3.0" vccmax="4.5"/>
</variants>
@@ -979,4 +979,4 @@
</register-group>
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega16M1-AU" tempmin="-40" tempmax="85" speedmax="16000000" pinout="TQFPQFN32"
package="TQFP32" vccmin="2.7" vccmax="5.5"/>
@@ -1534,4 +1534,4 @@
<pin position="32" pad="PD1"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega16U2-AU" speedmax="16000000" tempmin="-40" tempmax="85" vccmin="2.7" vccmax="5.5"
package="TQFP32" pinout="QUAD"/>
@@ -1181,4 +1181,4 @@
<pin pad="AVCC" position="32"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega16U4-AU" tempmin="-40" tempmax="85" speedmax="16000000" pinout="TQFP44"
package="TQFP44" vccmin="2.7" vccmax="5.5"/>
@@ -1631,4 +1631,4 @@
<pin position="44" pad="AVCC"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega2560V-8AU" tempmin="-40" tempmax="85" speedmax="8000000" pinout="TQFP100"
package="TQFP100" vccmin="1.8" vccmax="5.5"/>
@@ -2066,4 +2066,4 @@
<pin position="J10" pad="PG0"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega2561V-8AU" tempmin="-40" tempmax="85" speedmax="8000000" pinout="TQFP64"
package="TQFP64" vccmin="1.8" vccmax="5.5"/>
@@ -1799,4 +1799,4 @@
<pin position="64" pad="AVCC"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega2564RFR2-ZU" package="VQFN48" speedmax="16000000" tempmax="85" tempmin="-40"
vccmax="3.6" vccmin="1.8"/>
@@ -2774,4 +2774,4 @@
</value-group>
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega256RFR2-ZU" package="QFN64" speedmax="16000000" tempmax="85" tempmin="-40"
vccmax="3.6" vccmin="1.8"/>
@@ -2772,4 +2772,4 @@
</value-group>
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega32L-8AU" tempmin="-40" tempmax="85" speedmax="8000000" pinout="TQFPQFN44"
package="TQFP44" vccmin="2.7" vccmax="5.5"/>
@@ -1193,4 +1193,4 @@
<pin position="40" pad="PA0"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega3208-AFR" package="TQFP32" pinout="QFP32" speedmax="20000000" tempmax="105"
tempmin="-40" vccmax="5.0" vccmin="1.8"/>
@@ -2527,4 +2527,4 @@
<pin pad="PA6" position="28"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega3209-AFR" package="TQFP48" pinout="QFP48" speedmax="20000000" tempmax="105"
tempmin="-40" vccmax="5.0" vccmin="1.8"/>
@@ -2617,4 +2617,4 @@
<pin pad="PA4" position="48"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega324A-AU" tempmin="-40" tempmax="85" speedmax="20000000" pinout="TQFP_QFN_44"
package="TQFP44" vccmin="1.8" vccmax="5.5"/>
@@ -1536,4 +1536,4 @@
<pin position="G7" pad="GND"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega324PV-10AU" tempmin="-40" tempmax="85" speedmax="10000000" pinout="TQFP_VQFN_44"
package="TQFP44" vccmin="1.8" vccmax="5.5"/>
@@ -1455,4 +1455,4 @@
<pin position="44" pad="PB4"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega324PA-AU" package="TQFP44" pinout="QFN_QFP_44" speedmax="20000000" tempmax="85"
tempmin="-40" vccmax="5.5" vccmin="1.8"/>
@@ -1576,4 +1576,4 @@
<pin pad="GND" position="G7"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega324PB-AU" tempmin="-40" tempmax="85" speedmax="20000000" pinout="TQFP44"
package="TQFP44" vccmin="1.8" vccmax="5.5"/>
@@ -1759,4 +1759,4 @@
<pin position="44" pad="PB4"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="1.8" vccmax="5.5"/>
</variants>
@@ -1010,4 +1010,4 @@
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="1.8" vccmax="5.5"/>
</variants>
@@ -1037,4 +1037,4 @@
</value-group>
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="1.8" vccmax="5.5"/>
</variants>
@@ -1037,4 +1037,4 @@
</value-group>
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="1.8" vccmax="5.5"/>
</variants>
@@ -1039,4 +1039,4 @@
</value-group>
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="1.8" vccmax="5.5"/>
</variants>
@@ -1033,4 +1033,4 @@
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="1.8" vccmax="5.5"/>
</variants>
@@ -1012,4 +1012,4 @@
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="1.8" vccmax="5.5"/>
</variants>
@@ -1014,4 +1014,4 @@
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="1.8" vccmax="5.5"/>
</variants>
@@ -1010,4 +1010,4 @@
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega328-AU" tempmin="-40" tempmax="85" speedmax="20000000" pinout="TQFP32"
package="TQFP32" vccmin="1.8" vccmax="5.5"/>
@@ -1346,4 +1346,4 @@
<pin position="28" pad="PC5"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega328P-AU" tempmin="-40" tempmax="85" speedmax="20000000" pinout="TQFP32"
package="TQFP32" vccmin="1.8" vccmax="5.5"/>
@@ -1312,4 +1312,4 @@
<pin position="28" pad="PC5"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega328PB-AU" tempmin="-40" tempmax="85" speedmax="20000000" pinout="TQFP32"
package="TQFP32" vccmin="1.8" vccmax="5.5"/>
@@ -1551,4 +1551,4 @@
<pin position="32" pad="PD2"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant ordercode="ATmega329V-8AU" tempmin="-40" tempmax="85" speedmax="8000000" pinout="TQFP64"
package="TQFP64" vccmin="1.8" vccmax="5.5"/>
@@ -1410,4 +1410,4 @@
<pin position="64" pad="AVCC"/>
</pinout>
</pinouts>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="1.8" vccmax="5.5"/>
</variants>
@@ -1127,4 +1127,4 @@
</value-group>
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="1.8" vccmax="5.5"/>
</variants>
@@ -1127,4 +1127,4 @@
</value-group>
</module>
</modules>
</part-description-file>
</target-description-file>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<part-description-file>
<target-description-file>
<variants>
<variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="1.8" vccmax="5.5"/>
</variants>
@@ -1162,4 +1162,4 @@
</value-group>
</module>
</modules>
</part-description-file>
</target-description-file>

Some files were not shown because too many files have changed in this diff Show More