realview22.rar

源代码在线查看: clock.c

软件大小: 182693 K
上传用户: mmj
关键词: realview 22
下载地址: 免注册下载 普通下载 VIP

相关代码

				/*
				** Copyright (C) ARM Limited, 2002. All rights reserved.
				*/
				
				/* clock.c */
				
				/*
				** This implements a simple clocking mechanism on the Integrator platform
				**
				** It reads from the Real Time Clock that is present on the
				** Integrator AP Motherboard.
				**
				** The reference counter ticks at 1Hz.
				** this is very poor resolution, but is very simple to implement.
				*/
				
				/* 
				** Define SCATTER_PERIP if the Core Module clock register locations are
				** defined in a scatter file
				*/
				
				#ifdef SCATTER_PERIP
				
				#include "intgrt_struct.h"
				extern struct cm cm0;
				extern struct rtc rtc0;
				#define CM_REFCT  cm0.refct
				#define RTC_DR    rtc0.DR
				
				#else
				#include "intgrt.h"
				#endif
				
				
				/* Return the current value from the Integrator reference clock */
				
				unsigned ref_clock(void)
				{
				    return RTC_DR;
				}
				
				void init_clock(void)
				{
				    RTC_DR=0;        // Zero the Real Time Clock
				}
				
							

相关资源