
// -----------------------------------------------------------------------
// Timer.h
// Definitions and declarations for the Timer module
// -----------------------------------------------------------------------
#ifndef	Timer_h
#define	Timer_h

#include "platform.h"

// -----------------------------------------------------------------------
// Public functions
// The resolution in TimerInit is used to define the counter rate in
// counts/second.
// -----------------------------------------------------------------------
extern void     TimerInit       ( uint16_t aResolution );
extern uint16_t TimerGetCounter ( void );
extern void     TimerPutCounter ( uint16_t aValue );
extern void     TimerWait       ( uint16_t aValue );

// -----------------------------------------------------------------------
// Interfacing functions that are NOT in the library. These must be
// supplied by the calling program because these are highly hardware
// dependent.
// ApplicationTimerCallback - Called once for every value decrement
//                            when in TimerWait loop.
// ApplicationCpuSpeed      - Returns the clock frequency in Hz
// -----------------------------------------------------------------------
extern  void     ApplicationTimerCallback ( void );
extern	uint32_t ApplicationCpuSpeed      ( void );

#endif
// -----------------------------------------------------------------------
// EOF: Timer.h
// -----------------------------------------------------------------------
