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

📄 rtc_utility.h

📁 ARM入门的好帮手.包含了从简单到相对较复杂的程序.
💻 H
字号:
//*----------------------------------------------------------------------------
//*      ATMEL Microcontroller Software Support  -  ROUSSET  -
//*----------------------------------------------------------------------------
//* The software is delivered "AS IS" without warranty or condition of any
//* kind, either express, implied or statutory. This includes without
//* limitation any warranty or condition with respect to merchantability or
//* fitness for any particular purpose, or against the infringements of
//* intellectual property rights of others.
//*----------------------------------------------------------------------------
//* File Name           : rtc_utility.h
//* Object              : Prototyping File.
//* Associated file	: rtc_utility.c
//* 1.0 08/22/01 SC     : Creation
//*----------------------------------------------------------------------------

#ifndef rtc_utility_h
#define rtc_utility_h

//*-----------------------------------------------------------------------------
//* ------------------------- General constant definition ----------------------
//*-----------------------------------------------------------------------------

/* Logical constant */
#define TRUE	1
#define FALSE	0

#define	MONTH_MASK	0x1f		/* Time in minute which defines the alarm delay time for the application */
#define	WAITING_TIME	10		/* Mask to enable the event according to second event */
#define	RTC_SECOND_ALRM_EN    0x80	/* Mask to enable the event according to minute event */
#define	RTC_MINUTE_ALRM_EN    0x8000	/* Mask to enable the event according to hour event */
#define	RTC_HOUR_ALRM_EN      0x800000	/* Mask to enable the event according to second, minute, hour and ampm events */
#define	RTC_DATE_ALRM_EN      0x80000000 /* Word to configure the Power Mode Register in the APMC peripheral */
#define	APMC_PMR_MODE	      0x91

/* Word to start, in the Power Control Register, the power shutdovn */
#define POWER_SHUTDOWN	      0x1

/* Constant defined in converting calculation */
#define DAY_TO_SECONDES	      24*60*60
#define DAY_TO_MINUTES	      24*60
#define	HOUR_TO_MINUTES	      60
#define HOUR_TO_SECONDES      60*60
#define MINUTES_TO_SECONDES   60

//*-----------------------------------------------------------------------------
//* --------------------- General Function Prototyping -------------------------
//*-----------------------------------------------------------------------------

extern char *strncpy0(char *destination, const char *source, int n);
extern unsigned short date_to_days(const char *date);
extern void days_to_date(unsigned short days, char *date);
extern int is_date_valid(const char *chaine);

extern u_int elapsed_time(void);
extern void set_alarm(u_int temp_var);

//*-----------------------------------------------------------------------------
//* ------------------- End of General Function Prototyping --------------------
//*-----------------------------------------------------------------------------
#endif  /* rtc_utility_h */

⌨️ 快捷键说明

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