This commit is contained in:
Amar Mahmutbegovic
2025-03-01 15:48:48 +01:00
parent 391ac1c1d9
commit 4231df1fa1

View File

@@ -59,16 +59,6 @@ struct timer3_traits {
constexpr static std::uint32_t arr_bit_mask = 0xFFFF;
};
template <typename TimerTraits>
struct timer {
constexpr static std::uintptr_t base_address = TimerTraits::base_address;
using cr1 = reg<base_address + 0x00>;
using dier = reg<base_address + 0x0C>;
using sr = reg<base_address + 0x10>;
using psc = reg<base_address + 0x28>;
using arr = reg<base_address + 0x2C>;
template<auto Bits, typename Reg, uint32_t Mask, uint32_t Pos = 0>
struct reg_bits {
using reg = Reg;
@@ -100,6 +90,16 @@ struct timer {
};
};
template <typename TimerTraits>
struct timer {
constexpr static std::uintptr_t base_address = TimerTraits::base_address;
using cr1 = reg<base_address + 0x00>;
using dier = reg<base_address + 0x0C>;
using sr = reg<base_address + 0x10>;
using psc = reg<base_address + 0x28>;
using arr = reg<base_address + 0x2C>;
template<auto Bits>
using psc_bits = reg_bits<Bits, psc, static_cast<uint32_t>(0xFFFF)>;