diff options
Diffstat (limited to 'tb/interval_timer.hpp')
| -rw-r--r-- | tb/interval_timer.hpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tb/interval_timer.hpp b/tb/interval_timer.hpp new file mode 100644 index 0000000..7cce265 --- /dev/null +++ b/tb/interval_timer.hpp @@ -0,0 +1,31 @@ +#ifndef TALLER_INTERVAL_TIMER_HPP +#define TALLER_INTERVAL_TIMER_HPP + +#include <cstdint> + +#include "avalon.hpp" + +namespace taller::avalon +{ + class interval_timer : public slave + { + public: + interval_timer(std::uint32_t base) noexcept; + + void tick() noexcept; + + virtual bool read(std::uint32_t addr, std::uint32_t &data) noexcept final override; + virtual bool write(std::uint32_t addr, std::uint32_t data, unsigned byte_enable) noexcept final override; + + private: + std::uint32_t count; + std::uint32_t period; + std::uint32_t snap; + bool status_to = false; + bool status_run = false; + bool control_ito = false; + bool control_cont = false; + }; +} + +#endif |
