Add new IOPort design
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
Reference in New Issue
Block a user