Add new IOPort design

This commit is contained in:
2023-01-15 16:49:38 +01:00
parent 509c25dfec
commit 3da34d0686
15 changed files with 143 additions and 240 deletions

View File

@@ -4,9 +4,7 @@
namespace JabyEngine {
namespace Timer_IO {
struct __no_align CounterMode : public ComplexBitMap<uint32_t> {
__io_port_inherit_complex_bit_map(CounterMode);
struct CounterMode : public ComplexBitMap<uint32_t> {
static constexpr auto SyncEnable = Bit<uint32_t>(0);
static constexpr auto FreeRun = !SyncEnable;
static constexpr auto SyncMode = BitRange<uint32_t>::from_to(1, 2);
@@ -23,22 +21,18 @@ namespace JabyEngine {
static constexpr auto IsMaxReached = Bit<uint32_t>(12);
};
struct __no_align CounterTarget : public ComplexBitMap<uint32_t> {
__io_port_inherit_complex_bit_map(CounterTarget);
struct CounterTarget : public ComplexBitMap<uint32_t> {
static constexpr auto CounterTargetValue = BitRange<uint32_t>::from_to(0, 15);
};
struct __no_align CounterValue : public ComplexBitMap<uint32_t> {
__io_port_inherit_complex_bit_map(CounterValue);
struct CounterValue : public ComplexBitMap<uint32_t> {
static constexpr auto Value = BitRange<uint32_t>::from_to(0, 15);
};
struct __no_align Counter {
IOPort<CounterValue> value;
IOPort<CounterMode> mode;
IOPort<CounterTarget> target;
IOPort<CounterValue::UnderlyingType, CounterValue> value;
IOPort<CounterMode::UnderlyingType, CounterMode> mode;
IOPort<CounterTarget::UnderlyingType, CounterTarget> target;
private:
uint32_t _unused;
};