#ifndef VIRTUAL_COUNTER_H_
#define VIRTUAL_COUNTER_H_

/**** Includes ****/
#include <stdint.h>

namespace util {

/**** Public definitions ****/
class VCounter
{	
	public:
	VCounter(void);
	~VCounter(void);
	
	void init(uint16_t top, uint16_t step_us);
	
	uint8_t disabled;
	
	void reset(void);
	void increment(void);
	uint16_t read(void);
	uint32_t read_ms(void);
	uint16_t read_top(void);
	uint32_t convert_ms(uint16_t raw);
	
	#ifndef TESTING
	protected:
	#endif
	uint16_t step_us;
	uint16_t counter;
	uint16_t top;
};

/**** Public function declarations ****/

#ifdef TESTING
#endif

} //namespace

#endif /* VIRTUAL_COUNTER_H_ */