Renamed FuseBitDescriptor struct

This commit is contained in:
Nav
2022-03-05 14:08:27 +00:00
parent b50333c170
commit 72a557041a
3 changed files with 15 additions and 13 deletions

View File

@@ -376,12 +376,12 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit::TargetDescription
return output; return output;
} }
std::optional<FuseBitDescriptor> TargetDescriptionFile::getDwenFuseBitDescriptor() const { std::optional<FuseBitsDescriptor> TargetDescriptionFile::getDwenFuseBitsDescriptor() const {
return this->getFuseBitDescriptorByName("dwen"); return this->getFuseBitsDescriptorByName("dwen");
} }
std::optional<FuseBitDescriptor> TargetDescriptionFile::getSpienFuseBitDescriptor() const { std::optional<FuseBitsDescriptor> TargetDescriptionFile::getSpienFuseBitsDescriptor() const {
return this->getFuseBitDescriptorByName("spien"); return this->getFuseBitsDescriptorByName("spien");
} }
void TargetDescriptionFile::loadDebugPhysicalInterfaces() { void TargetDescriptionFile::loadDebugPhysicalInterfaces() {
@@ -627,7 +627,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit::TargetDescription
} }
} }
std::optional<FuseBitDescriptor> TargetDescriptionFile::getFuseBitDescriptorByName( std::optional<FuseBitsDescriptor> TargetDescriptionFile::getFuseBitsDescriptorByName(
const std::string& fuseBitName const std::string& fuseBitName
) const { ) const {
if (!this->modulesMappedByName.contains("fuse")) { if (!this->modulesMappedByName.contains("fuse")) {
@@ -655,7 +655,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit::TargetDescription
} }
if (fuse.bitFieldsMappedByName.contains(fuseBitName)) { if (fuse.bitFieldsMappedByName.contains(fuseBitName)) {
return FuseBitDescriptor( return FuseBitsDescriptor(
fuseTypesByName.at(fuseTypeName), fuseTypesByName.at(fuseTypeName),
fuse.bitFieldsMappedByName.at(fuseBitName).mask fuse.bitFieldsMappedByName.at(fuseBitName).mask
); );

View File

@@ -90,7 +90,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit::TargetDescription
* @return * @return
* std::nullopt if the DWEN bit field could not be found in the TDF. * std::nullopt if the DWEN bit field could not be found in the TDF.
*/ */
[[nodiscard]] std::optional<FuseBitDescriptor> getDwenFuseBitDescriptor() const; [[nodiscard]] std::optional<FuseBitsDescriptor> getDwenFuseBitsDescriptor() const;
/** /**
* Constructs a FuseBitDescriptor for the SPI enable (SPIEN) fuse bit, with information extracted from * Constructs a FuseBitDescriptor for the SPI enable (SPIEN) fuse bit, with information extracted from
@@ -99,7 +99,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit::TargetDescription
* @return * @return
* std::nullopt if the SPIEN bit field could not be found in the TDF. * std::nullopt if the SPIEN bit field could not be found in the TDF.
*/ */
[[nodiscard]] std::optional<FuseBitDescriptor> getSpienFuseBitDescriptor() const; [[nodiscard]] std::optional<FuseBitsDescriptor> getSpienFuseBitsDescriptor() const;
/** /**
* Returns a set of all supported physical interfaces for debugging. * Returns a set of all supported physical interfaces for debugging.
@@ -188,7 +188,9 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit::TargetDescription
*/ */
void loadTargetRegisterDescriptors(); void loadTargetRegisterDescriptors();
[[nodiscard]] std::optional<FuseBitDescriptor> getFuseBitDescriptorByName(const std::string& fuseBitName) const; [[nodiscard]] std::optional<FuseBitsDescriptor> getFuseBitsDescriptorByName(
const std::string& fuseBitName
) const;
[[nodiscard]] std::optional<Targets::TargetDescription::MemorySegment> getFlashMemorySegment() const; [[nodiscard]] std::optional<Targets::TargetDescription::MemorySegment> getFlashMemorySegment() const;
[[nodiscard]] std::optional<Targets::TargetDescription::MemorySegment> getRamMemorySegment() const; [[nodiscard]] std::optional<Targets::TargetDescription::MemorySegment> getRamMemorySegment() const;

View File

@@ -19,18 +19,18 @@ namespace Bloom::Targets::Microchip::Avr
Fuse(FuseType type, std::uint8_t value): type(type), value(value) {} Fuse(FuseType type, std::uint8_t value): type(type), value(value) {}
}; };
struct FuseBitDescriptor struct FuseBitsDescriptor
{ {
/** /**
* The type of the fuse byte in which the fuse bit resides. * The type of the fuse byte in which the fuse bits resides.
*/ */
FuseType fuseType; FuseType fuseType;
/** /**
* Fuse bit mask * Fuse bits mask
*/ */
std::uint8_t bitMask; std::uint8_t bitMask;
FuseBitDescriptor(FuseType fuseType, std::uint8_t bitMask): fuseType(fuseType), bitMask(bitMask) {} FuseBitsDescriptor(FuseType fuseType, std::uint8_t bitMask): fuseType(fuseType), bitMask(bitMask) {}
}; };
} }