#ifndef __DEV_TIMER_H
#define __DEV_TIMER_H

#include <dev/Device.h>

namespace OS {
namespace Dev {

class Timer;

typedef enum handlerReturn (*timerCallback)(Timer *timer, time_t now);

class Timer : public Device {
public:
	Timer(const char *name);
	virtual ~Timer();

	/* a reasonable default implementation of the int handler */
	virtual handlerReturn IntHandler();

	/* must override with hardware specific implementation, and set the mCallback variable */
	virtual status_t SetPeriodic(timerCallback callback, time_t interval) = 0;

protected:
	timerCallback mCallback;
};

}} // namespace OS::Dev

#endif
