#include "gfatimer.h"
#include "timer.h"

static CGfaTimer g_gfaTimer;

int GfaTimerInit(int nTimerCount, GfaTimerResolution res)
{
	return g_gfaTimer.Initialize(nTimerCount, res);
}

void GfaTimerRelease(void)
{
	g_gfaTimer.Release();
}

void GfaRegisterTimerCallback(int tnum, pfnTIMERCALLBACK pfnCallback, void *pContext)
{
	g_gfaTimer.RegisterTimerCallback(tnum, pfnCallback, pContext);
}

void GfaRegisterClockPulseCallback(GfaTimerClockPulse cp, pfnPULSECALLBACK pfnCallback, void *pContext)
{
	g_gfaTimer.RegisterClockPulseCallback(cp, pfnCallback, pContext);
}

void GfaUnregisterTimerCallback(int tnum)
{
	g_gfaTimer.RegisterTimerCallback(tnum, NULL, NULL);
}

void GfaUnregisterClockPulseCallback(GfaTimerClockPulse cp)
{
	g_gfaTimer.RegisterClockPulseCallback(cp, NULL, NULL);
}

int tf_test(int tnum)
{
	return g_gfaTimer.tf_test(tnum);
}

void tf_set(int tnum)
{
	g_gfaTimer.tf_set(tnum);
}

void tf_clear(int tnum)
{
	g_gfaTimer.tf_clear(tnum);
}

void tf_store(int tnum, int fset)
{
	g_gfaTimer.tf_store(tnum, fset);
}

unsigned long tw_read(int tnum)
{
	return g_gfaTimer.tw_read(tnum);
}

void tw_set(int tnum, unsigned long val)
{
	g_gfaTimer.tw_set(tnum, val);
}

int cp_test(GfaTimerClockPulse cp)
{
	return g_gfaTimer.cp_test(cp);
}
