Convert Timer for new IO

This commit is contained in:
2024-09-28 15:30:40 +02:00
parent 60c565bfde
commit 14b760dd54
3 changed files with 50 additions and 39 deletions

View File

@@ -0,0 +1,31 @@
#pragma once
#include "../ioport.hpp"
namespace JabyEngine {
namespace Timer_IO_Values {
__declare_io_value(CounterMode, uint32_t) {
static constexpr auto SyncEnable = Bit(0);
static constexpr auto FreeRun = !SyncEnable;
static constexpr auto SyncMode = BitRange::from_to(1, 2);
static constexpr auto ResetAfterTarget = Bit(3);
static constexpr auto IRQAtTarget = Bit(4);
static constexpr auto IRQAtMax = Bit(5);
static constexpr auto IRQEveryTime = Bit(6);
static constexpr auto IRQOneShot = !IRQEveryTime;
static constexpr auto IRQToggle = Bit(7);
static constexpr auto IRQPulse = !IRQToggle;
static constexpr auto ClockSource = BitRange::from_to(8, 9);
static constexpr auto HasIRQRequest = Bit(10);
static constexpr auto IsTargetReached = Bit(11);
static constexpr auto IsMaxReached = Bit(12);
};
__declare_io_value(CounterTarget, uint32_t) {
static constexpr auto CounterTargetValue = BitRange::from_to(0, 15);
};
__declare_io_value(CounterValue, uint32_t) {
static constexpr auto Value = BitRange::from_to(0, 15);
};
}
}