#ifndef MSTRG_HH #define MSTRG_HH #include "vme_mem.hh" #include namespace ttcvi { const vme_addr_t mstrg_reg = 0x68; class mstrg { public: mstrg(vme_mem &vme, unsigned int base) : m_vme(vme), base_addr(base) {}; inline uint32_t get_counter(); inline uint16_t get_reg(); inline void set_reg(const uint16_t x); protected: vme_mem &m_vme; unsigned int base_addr; }; } inline uint32_t ttcvi::mstrg::get_counter() { uint32_t result; result = m_vme.read(mstrg_reg + base_addr); result <<= 16; result |= m_vme.read(mstrg_reg + base_addr); return result; } inline uint16_t ttcvi::mstrg::get_reg() { return m_vme.read(mstrg_reg + base_addr); } inline void ttcvi::mstrg::set_reg(const uint16_t x) { m_vme.write(mstrg_reg + base_addr, x); } #endif