- Removed unnecessary bit fields - Added default values to members - Removed all user-defined constructors to make the structs aggregate, replacing the from-value constructor with a `fromValue()` status member function. - Made use of designated initialisation - Changed unscoped enums to scoped - Other small bits of tidying
25 lines
617 B
C++
25 lines
617 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
|
|
#include "src/DebugToolDrivers/Protocols/RiscVDebugSpec/TriggerModule/TriggerModule.hpp"
|
|
|
|
namespace DebugToolDrivers::Protocols::RiscVDebugSpec::TriggerModule::Registers
|
|
{
|
|
/**
|
|
* TODO: Given the single, full width bit field, is this struct really necessary? Review.
|
|
*/
|
|
struct TriggerSelect
|
|
{
|
|
TriggerIndex index;
|
|
|
|
constexpr explicit TriggerSelect(TriggerIndex index)
|
|
: index(index)
|
|
{}
|
|
|
|
[[nodiscard]] constexpr RegisterValue value() const {
|
|
return static_cast<RegisterValue>(this->index);
|
|
}
|
|
};
|
|
}
|