#ifndef __TIMER_REGISTERS_H__
#define __TIMER_REGISTERS_H__

#include <stdint.h>
#include "platform.h"

namespace TIMERS
{
	static const uint32_t BaseAddress = (KS8695PX_IO_BASE + KS8695PX_TIMER_OFFSET);
	
	enum Registers
	{
		TMCON	= 0x0000,	// 0x00	- Timer Control Register (rw)
		T1TC	= 0x0004,	// 0x04	- Timer 1 Timeout Count Register (rw)
		T0TC	= 0x0008,	// 0x08	- Timer 0 Timeout Count Register (rw)
		T1PD	= 0x000C,	// 0x0c	- Timer 1 Pulse Count Register (rw)
		T0PD	= 0x0010	// 0x10	- Timer 0 Pulse Count Register (rw)
	};
	
	inline volatile uint32_t *regAddress(Registers reg)
	{
	    return reinterpret_cast<volatile uint32_t*>(BaseAddress + reg);
	}
	
	inline uint32_t regRead(Registers reg)
	{
	    return *regAddress(reg);
	}
	
	inline void regWrite(Registers reg, uint32_t value)
	{
	    *regAddress(reg) = value;
	}

}

#endif //
