DWEN & SPIEN fuse bit descriptor extraction from AVR8 TDFs

This commit is contained in:
Nav
2022-03-04 23:43:26 +00:00
parent aa73b431ae
commit 38260dc358
2 changed files with 68 additions and 0 deletions

View File

@@ -9,6 +9,7 @@
#include "src/Targets/Microchip/AVR/TargetSignature.hpp"
#include "src/Targets/Microchip/AVR/IspParameters.hpp"
#include "src/Targets/Microchip/AVR/Fuse.hpp"
#include "src/Targets/Microchip/AVR/AVR8/Family.hpp"
#include "src/Targets/Microchip/AVR/AVR8/PhysicalInterface.hpp"
@@ -82,6 +83,24 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit::TargetDescription
*/
[[nodiscard]] IspParameters getIspParameters() const;
/**
* Constructs a FuseBitDescriptor for the debugWire enable (DWEN) fuse bit, with information extracted from
* the TDF.
*
* @return
* std::nullopt if the DWEN bit field could not be found in the TDF.
*/
[[nodiscard]] std::optional<FuseBitDescriptor> getDwenFuseBitDescriptor() const;
/**
* Constructs a FuseBitDescriptor for the SPI enable (SPIEN) fuse bit, with information extracted from
* the TDF.
*
* @return
* std::nullopt if the SPIEN bit field could not be found in the TDF.
*/
[[nodiscard]] std::optional<FuseBitDescriptor> getSpienFuseBitDescriptor() const;
/**
* Returns a set of all supported physical interfaces for debugging.
*
@@ -169,6 +188,8 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit::TargetDescription
*/
void loadTargetRegisterDescriptors();
[[nodiscard]] std::optional<FuseBitDescriptor> getFuseBitDescriptorByName(const std::string& fuseBitName) const;
[[nodiscard]] std::optional<Targets::TargetDescription::MemorySegment> getFlashMemorySegment() const;
[[nodiscard]] std::optional<Targets::TargetDescription::MemorySegment> getRamMemorySegment() const;
[[nodiscard]] std::optional<Targets::TargetDescription::MemorySegment> getIoMemorySegment() const;