/****************************************************************************
[ systick.h ] - SysTick Timer Register defines
****************************************************************************/

/*
 *  for MB9BF618T on FRK-FM3
 * 
 *   Copyright (C) by Y.Ishioka.
 */

#include <typedef.h>

#ifndef _SYSTICK_H_
#define _SYSTICK_H_

#define SYSTICK_ENABLE      	0
#define SYSTICK_TICKINT     	1
#define SYSTICK_CLKSOURCE   	2
#define SYSTICK_MAXCOUNT    	((1<<24) -1)

#if 0  /* Y.Ishioka */
#define SYSTICK_RELOAD_VALUE 	56205
#else
#define SYSTICK_RELOAD_VALUE 	144000
#endif

#define SYSTICK_PRIORITY		0x1F

#define SYSTICK_REG_BASE		0xE000E010

typedef struct
	{
	unsigned long STCSR;			/* SysTick Control and Status Register : offset 0x00 */
	unsigned long STRVR;			/* SysTick Reload Value Register       : offset 0x04 */
	unsigned long STCVR;			/* SysTick Current Value Register      : offset 0x08 */
	unsigned long STCALIB;			/* SysTick Calibration Value Register  : offset 0x0c */
	}SysTickRegister_t;

EXPORT void InitSysTickTimer(void);

#endif /* _SYSTICK_H_ */
