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

📄 rtc.h.svn-base

📁 Spearhead2000 的 USB驱动程序
💻 SVN-BASE
字号:
/*****************************************************************************//*                                                                           *//* -- File:                  rtc.h                                           *//* -- Author:                Stefano Romano                                  *//* -- Description:           Header Real Time Clock                          *//*                                                                           *//* -- Modification History: - 1.0                                            *//*****************************************************************************/#ifndef __RCT_H#define __RCT_H#ifdef __cplusplusextern  "C" {           /* C declarations in C++ */#endif#define RTC_BASE 0x12005000typedef struct RTCController{  unsigned int TIME_REG;       //30000C00  unsigned int DATE_REG;       //30000C04  unsigned int ALARM_TIME_REG; //30000C08  unsigned int ALARM_DATE_REG; //30000C0C  unsigned int CONTROL_REG;    //30000C10  unsigned int STATUS_REG;     //30000C14} RTCController;#define RTCCntl ((volatile struct RTCController*) (RTC_BASE))/* Fields position *//* TIME_REG & ALARM_TIME_REG*/#define SECONDS_UNITS 0x0000000f //seconds units position #define SECONDS_TENS  0x00000070 //seconds tens position#define MINUTES_UNITS 0x00000f00 //minutes units position  #define MINUTES_TENS  0x00007000 //minutes tens position     #define HOURS_UNITS   0x000f0000 //hours units position  #define HOURS_TENS    0x00300000 //hours tens position     /* DATE_REG & ALARM_DATE_REG */#define DAYS_UNITS       0x0000000f //days units position #define DAYS_TENS        0x00000030 //days tens position#define MONTHS_UNITS     0x00000100 //months units position  #define MONTHS_TENS      0x00007000 //months tens position     #define YEARS_UNITS      0x000f0000 //years units position  #define YEARS_TENS       0x00f00000 //years tens position     #define YEARS_HUNDREDS   0x0f000000 //years hundereds position     #define YEARS_MILLENIUMS 0xf0000000 //years milleniums position     /* Control values *//* CONTROL_REG */#define NO_MASK       0x00000000 //mask bits are 0x0000000f#define MASK_SEC      0x00000001 //mask bit 0 #define MASK_MIN      0x00000002 //mask bit 1#define MASK_HOUR     0x00000004 //mask bit 2#define MASK_DAY      0x00000008 //mask bit 3#define MASK_MONTH    0x00000010 //mask bit 4#define MASK_YEAR     0x00000020 //mask bit 5#define PRESCALER_BYP 0x00000100 //bypass the prescaler: for debug only#define TIME_BYP      0x00000200 //date reg equal to time reg: for debug only#define INT_ENA       0x80000000 //interrupt enable/* STATUS_REG */#define CLK_UNCONNECTED 0x00000001 //timer isolated, time and date can be write#define PEND_WR_TIME    0x00000004 //a write on time_reg is pending#define PEND_WR_DATE    0x00000008 //a write on date_reg is pending#define LOST_WR_TIME    0x00000010 //a write on time_reg is lost#define LOST_WR_DATE    0x00000020 //a write on date_reg is lost#define RTC_INT_CLR     0x80000000 //clear: int clear; read: int statusextern void rtc_test(void);extern void rtc_init(void);#ifdef __cplusplus} /* C declarations in C++ */#endif#endif // __RTC_H

⌨️ 快捷键说明

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