#include "ikk-timer.h"
#include "../general/ikk-debug.h"
#include "drv_timer.h"

#define TIMER_NUM_MAX					(3)

static  uint8_t  timer_index[TIMER_NUM_MAX] = {0};

void kTimerInit(TIMER_TypeEnum timer)
{
	//default mode 0,system clock as source clock
	drv_hwTmr_init(timer,0);
}

hw_timer_sts_t kTimerStart(TIMER_TypeEnum timer, uint32_t time_us, timerCb_t stop_callback)
{
	timer_index[(uint8_t)timer] = timer;
	return drv_hwTmr_set(timer, time_us,stop_callback,&timer_index[timer]);
}

void kTimerStop(TIMER_TypeEnum timer)
{
	drv_hwTmr_cancel(timer);
}
