cleanup
This commit is contained in:
@@ -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)>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user