2022-03-02 22:43:53 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
|
2023-05-07 16:49:45 +01:00
|
|
|
#include "src/Targets/TargetMemory.hpp"
|
|
|
|
|
|
2022-03-02 22:43:53 +00:00
|
|
|
namespace Bloom::Targets::Microchip::Avr
|
|
|
|
|
{
|
|
|
|
|
enum class FuseType: std::uint8_t
|
|
|
|
|
{
|
|
|
|
|
LOW,
|
|
|
|
|
HIGH,
|
|
|
|
|
EXTENDED,
|
|
|
|
|
};
|
|
|
|
|
|
2023-05-26 22:36:43 +01:00
|
|
|
enum class FuseEnableStrategy: std::uint8_t
|
|
|
|
|
{
|
|
|
|
|
CLEAR,
|
|
|
|
|
SET,
|
|
|
|
|
};
|
|
|
|
|
|
2022-03-02 22:43:53 +00:00
|
|
|
struct Fuse
|
|
|
|
|
{
|
|
|
|
|
FuseType type;
|
|
|
|
|
std::uint8_t value;
|
|
|
|
|
|
2022-04-15 22:06:38 +01:00
|
|
|
Fuse(FuseType type, std::uint8_t value)
|
|
|
|
|
: type(type)
|
|
|
|
|
, value(value)
|
|
|
|
|
{}
|
2022-03-02 22:43:53 +00:00
|
|
|
};
|
2022-03-03 22:07:24 +00:00
|
|
|
|
2022-03-05 14:08:27 +00:00
|
|
|
struct FuseBitsDescriptor
|
2022-03-03 22:07:24 +00:00
|
|
|
{
|
2023-05-07 16:49:45 +01:00
|
|
|
TargetMemoryAddress byteAddress;
|
|
|
|
|
|
2022-03-03 22:07:24 +00:00
|
|
|
/**
|
2022-03-05 14:08:27 +00:00
|
|
|
* The type of the fuse byte in which the fuse bits resides.
|
2022-03-03 22:07:24 +00:00
|
|
|
*/
|
|
|
|
|
FuseType fuseType;
|
|
|
|
|
|
|
|
|
|
/**
|
2022-03-05 14:08:27 +00:00
|
|
|
* Fuse bits mask
|
2022-03-03 22:07:24 +00:00
|
|
|
*/
|
|
|
|
|
std::uint8_t bitMask;
|
2022-03-04 15:33:31 +00:00
|
|
|
|
2023-05-07 16:49:45 +01:00
|
|
|
FuseBitsDescriptor(TargetMemoryAddress byteAddress, FuseType fuseType, std::uint8_t bitMask)
|
|
|
|
|
: byteAddress(byteAddress)
|
|
|
|
|
, fuseType(fuseType)
|
2022-04-15 22:06:38 +01:00
|
|
|
, bitMask(bitMask)
|
|
|
|
|
{}
|
2022-03-03 22:07:24 +00:00
|
|
|
};
|
2022-03-02 22:43:53 +00:00
|
|
|
}
|