2021-04-04 21:04:12 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
#include <vector>
|
2021-08-07 17:15:48 +01:00
|
|
|
#include <map>
|
2023-05-21 21:08:25 +01:00
|
|
|
#include <algorithm>
|
2022-03-25 00:09:53 +00:00
|
|
|
#include <QMetaType>
|
2021-04-04 21:04:12 +01:00
|
|
|
|
2023-12-12 18:11:17 +00:00
|
|
|
#include "TargetFamily.hpp"
|
2021-10-09 19:17:58 +01:00
|
|
|
#include "TargetMemory.hpp"
|
2024-03-21 15:03:06 +00:00
|
|
|
#include "TargetAddressSpaceDescriptor.hpp"
|
|
|
|
|
#include "TargetPeripheralDescriptor.hpp"
|
2024-07-23 21:14:22 +01:00
|
|
|
#include "TargetPinoutDescriptor.hpp"
|
|
|
|
|
#include "TargetVariantDescriptor.hpp"
|
2023-09-20 23:37:54 +01:00
|
|
|
#include "TargetBreakpoint.hpp"
|
2021-04-04 21:04:12 +01:00
|
|
|
|
2023-08-13 15:47:51 +01:00
|
|
|
namespace Targets
|
2021-04-04 21:04:12 +01:00
|
|
|
{
|
|
|
|
|
struct TargetDescriptor
|
|
|
|
|
{
|
2023-11-22 00:37:29 +00:00
|
|
|
std::string name;
|
2024-03-21 15:03:06 +00:00
|
|
|
TargetFamily family;
|
|
|
|
|
std::string marketId;
|
2022-08-30 02:51:10 +01:00
|
|
|
std::string vendorName;
|
2024-03-21 15:03:06 +00:00
|
|
|
std::map<std::string, TargetAddressSpaceDescriptor> addressSpaceDescriptorsByKey;
|
|
|
|
|
std::map<std::string, TargetPeripheralDescriptor> peripheralDescriptorsByKey;
|
2024-07-23 21:14:22 +01:00
|
|
|
std::map<std::string, TargetPinoutDescriptor> pinoutDescriptorsByKey;
|
|
|
|
|
std::vector<TargetVariantDescriptor> variantDescriptors;
|
2024-03-21 15:03:06 +00:00
|
|
|
BreakpointResources breakpointResources;
|
2023-05-21 21:08:25 +01:00
|
|
|
|
|
|
|
|
TargetDescriptor(
|
2023-09-20 18:56:44 +01:00
|
|
|
const std::string& name,
|
2024-03-21 15:03:06 +00:00
|
|
|
TargetFamily family,
|
2024-07-23 21:14:22 +01:00
|
|
|
const std::string& marketId,
|
2023-09-20 18:56:44 +01:00
|
|
|
const std::string& vendorName,
|
2024-07-23 21:14:22 +01:00
|
|
|
std::map<std::string, TargetAddressSpaceDescriptor>&& addressSpaceDescriptorsByKey,
|
|
|
|
|
std::map<std::string, TargetPeripheralDescriptor>&& peripheralDescriptorsByKey,
|
|
|
|
|
std::map<std::string, TargetPinoutDescriptor>&& pinoutDescriptorsByKey,
|
|
|
|
|
std::vector<TargetVariantDescriptor>&& variantDescriptors,
|
2024-03-21 15:03:06 +00:00
|
|
|
const BreakpointResources& breakpointResources
|
|
|
|
|
);
|
2023-05-21 21:08:25 +01:00
|
|
|
|
2024-07-23 21:14:22 +01:00
|
|
|
TargetDescriptor(const TargetDescriptor& other) = delete;
|
|
|
|
|
TargetDescriptor& operator = (const TargetDescriptor& other) = delete;
|
|
|
|
|
|
|
|
|
|
TargetDescriptor(TargetDescriptor&& other) noexcept = default;
|
|
|
|
|
TargetDescriptor& operator = (TargetDescriptor&& other) = default;
|
|
|
|
|
|
2024-03-21 15:03:06 +00:00
|
|
|
std::optional<std::reference_wrapper<const TargetAddressSpaceDescriptor>> tryGetAddressSpaceDescriptor(
|
|
|
|
|
const std::string& key
|
|
|
|
|
) const;
|
2023-05-21 21:08:25 +01:00
|
|
|
|
2024-03-21 15:03:06 +00:00
|
|
|
const TargetAddressSpaceDescriptor& getAddressSpaceDescriptor(const std::string& key) const;
|
2024-07-23 21:14:22 +01:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the descriptor for the first address space that contains the given memory segment.
|
|
|
|
|
*
|
|
|
|
|
* @param memorySegmentKey
|
|
|
|
|
* Key of the memory segment that should be contained within the address space.
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
const TargetAddressSpaceDescriptor& getFirstAddressSpaceDescriptorContainingMemorySegment(
|
|
|
|
|
const std::string& memorySegmentKey
|
|
|
|
|
) const;
|
|
|
|
|
|
|
|
|
|
std::optional<std::reference_wrapper<const TargetPeripheralDescriptor>> tryGetPeripheralDescriptor(
|
|
|
|
|
const std::string& key
|
|
|
|
|
) const;
|
|
|
|
|
|
|
|
|
|
const TargetPeripheralDescriptor& getPeripheralDescriptor(const std::string& key) const;
|
|
|
|
|
|
|
|
|
|
std::optional<std::reference_wrapper<const TargetPinoutDescriptor>> tryGetPinoutDescriptor(
|
|
|
|
|
const std::string& key
|
|
|
|
|
) const;
|
|
|
|
|
|
|
|
|
|
const TargetPinoutDescriptor& getPinoutDescriptor(const std::string& key) const;
|
2021-04-04 21:04:12 +01:00
|
|
|
};
|
|
|
|
|
}
|