⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clock.c

📁 ADS1.2 samples
💻 C
字号:
/*
** 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
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -