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

📄 rtc.h

📁 arm电子日历arm electricity calendar
💻 H
字号:


#ifndef	__RTC_H__
#define	__RTC_H__

#include	"Include.h"

/*============================================================================*/

#define	RTC_TIME_INIT	2009,02,16,1,00,00,00

/*============================================================================*/

struct	RTC_TIME
{
		int	Year,Month,Day,Week,Hour,Min,Sec;
};


/*============================================================================*/
#define		RTC_Back_Key_Pressed()		(Uart_Key=='a')||(Uart_Key==KEY_ID_LEFT)		//设置上一个对象的按键动作.
#define		RTC_Next_Key_Pressed()		(Uart_Key=='d')||(Uart_Key==KEY_ID_RIGHT)		//设置下一个对象的按键动作.
#define		RTC_Cancel_Key_Pressed()	(Uart_Key==ASC_ESC)||(Uart_Key==KEY_ID_ESC)		//设置取消的按键协作.
#define		RTC_Enter_Key_Pressed()		(Uart_Key==ASC_ENTER)||(Uart_Key==KEY_ID_ENTER)	//设置确认的按键协作.
#define		RTC_Up_Key_Pressed()		(Uart_Key=='w')||(Uart_Key==KEY_ID_UP)				//Up Key.
#define		RTC_Down_Key_Pressed()		(Uart_Key=='s')||(Uart_Key==KEY_ID_DOWN)				//Down Key.
#define		RTC_Key0_Pressed()			(Uart_Key=='0')					//0 Key.
#define		RTC_Key1_Pressed()			(Uart_Key=='1')					//1 Key.
#define		RTC_Key2_Pressed()			(Uart_Key=='2')					//2 Key.
#define		RTC_Key3_Pressed()			(Uart_Key=='3')					//3 Key.
#define		RTC_Key4_Pressed()			(Uart_Key=='4')					//4 Key.
#define		RTC_Key5_Pressed()			(Uart_Key=='5')					//5 Key.
#define		RTC_Key6_Pressed()			(Uart_Key=='6')					//6 Key.
#define		RTC_Key7_Pressed()			(Uart_Key=='7')					//7 Key.
#define		RTC_Key8_Pressed()			(Uart_Key=='8')					//8 Key.
#define		RTC_Key9_Pressed()			(Uart_Key=='9')					//9 Key.
#define		RTC_Num_Key_Pressed()		(Uart_Key>='0')&&(Uart_Key<='9')
#define		RTC_Any_Key_Pressed()		(Uart_Key!=0)||(Key_Value_Buf!=0)
/*============================================================================*/
//函数.

void	RTC_Init(void);
void	Display_SimulateClock(int x,int y,int dx,int dy);
int		Display_RTC(void *pdata);
void	Display_World_Time(void);
void	RTC_TimeZone_Setting(void);		
int		RTC_Date_Time_Setting(void *pdata);

void	RTC_GetTime(struct RTC_TIME *time);
void	RTC_SetTime(struct RTC_TIME *time);

int		RTC_Calendar(void *pdata);

/*============================================================================*/

#define		GMT00_00_ZONE	"都柏林\n爱丁堡\n里斯本\n卡萨布兰卡\n蒙罗维亚" 															
#define		GMT01_00_ZONE	"阿姆斯特丹,柏林\n伯尔尼,罗马\n斯德哥尔摩,维也纳\n贝尔格莱德,马德里\n巴黎,萨拉热窝\n华沙,哥本哈根\n布鲁塞尔,中非西部"																																		
#define		GMT02_00_ZONE	"安曼,雅典\n伊斯坦布尔,贝鲁特\n明斯克,索非亚\n塔林,开罗\n耶路撒冷,哈拉雷\n赫尔辛基,基辅"																				
#define		GMT03_00_ZONE	"科威特\n巴格达\n利雅得\n莫斯科\n圣彼得堡\n伏尔加格勒\n内罗华"
#define		GMT03_30_ZONE	"德黑兰"	
#define		GMT04_00_ZONE	"阿布扎比\n马斯喀特\n巴库\n第比利斯\n埃里温"
#define		GMT04_30_ZONE	"喀布尔"
#define		GMT05_00_ZONE	"伊斯兰堡\n卡拉奇\n塔什干"
#define		GMT05_30_ZONE	"马德拉斯\n加尔各答\n孟买\n新德里"
#define		GMT05_45_ZONE	"加德满都"
#define		GMT06_00_ZONE	"阿拉木图\n新西伯利亚\n阿斯塔纳\n达卡"
#define		GMT06_30_ZONE	"仰光"
#define		GMT07_00_ZONE	"克拉斯诺亚尔斯克\n曼谷\n河内\n雅加达"
#define		GMT08_00_ZONE	"北京,重庆\n香港,乌鲁木齐\n吉隆坡,新加坡\n珀斯,台北\n伊尔库茨克,乌兰巴托"	
#define		GMT09_00_ZONE	"大阪\n札幌\n东京\n首尔\n雅库茨克"
#define		GMT09_30_ZONE	"阿德莱德\n达尔文"
#define		GMT10_00_ZONE	"布里斯班\n符拉迪沃斯托克\n关岛\n莫尔兹比港\n霍巴特\n堪培拉\n墨尔本\n悉尼"
#define		GMT11_00_ZONE	"马加丹\n索罗门群岛\n新喀里多尼亚"
#define		GMT12_00_ZONE	"奥克兰\n惠灵顿\n斐济\n堪察加半岛\n马绍尔群岛"

#define		_GMT01_00_ZONE	"亚速尔群岛\n佛得角群岛"
#define		_GMT02_00_ZONE	"中大西洋"
#define		_GMT03_00_ZONE	"格陵兰\n布宜诺斯艾利斯\n乔治敦\n巴西利亚"
#define		_GMT03_30_ZONE	"纽芬兰"
#define		_GMT04_00_ZONE	"加拉加斯\n拉巴斯\n大西洋时间(加拿大)\n圣地亚哥"
#define		_GMT05_00_ZONE	"印第安那州(东部)\n东部时间(美国和加拿大)\n波哥大\n利马\n基多"
#define		_GMT06_00_ZONE	"瓜达拉哈拉\n墨西哥城\n蒙特雷\n中美洲\n中部时间(美国和加拿大)\n萨斯喀彻温"
#define		_GMT07_00_ZONE	"亚利桑那\n山地时间(美国和加拿大)"
#define		_GMT08_00_ZONE	"太平洋时间(美国和加拿大)\n蒂华纳"
#define		_GMT09_00_ZONE	"阿拉斯加"
#define		_GMT10_00_ZONE	"夏威夷"
#define		_GMT11_00_ZONE	"中途岛\n萨摩亚群岛"
#define		_GMT12_00_ZONE	"日界线西"

/*
#define		GMT00_00_ZONE	"Dublin\nEdinburgh\nLisbon\nCasablanca\nMonrovia" 															
#define		GMT01_00_ZONE	"Amsterdam,Berlin\nBern,Rome\nStockholm,Vienna\nBelgrade,Madrid\nParis,Sarajevo\nWarsaw,Copenhagen\nBrussels,West Central Africa"																																		
#define		GMT02_00_ZONE	"Amman,Athens\nIstanbul,Beirut\nMinsk,Sofia\nTallinn,Cairo\nJerusalem,Harare\nHelsinki,Kyiv"																				
#define		GMT03_00_ZONE	"Koweit\nBagdad\nRiyadh\nMoscow\nSt.Petersburg\nVolgograd\nNairobi"
#define		GMT03_30_ZONE	"Teheran"	
#define		GMT04_00_ZONE	"Abu Dhabi\nMuscat\nBaku\nTbilisi\nYerevan"
#define		GMT04_30_ZONE	"Kabul"
#define		GMT05_00_ZONE	"Ekaterinburg\nKarachi\nTashkent"
#define		GMT05_30_ZONE	"Sri Jayawardenepura\nCalcutta\nBombay\nNew Delhi"
#define		GMT05_45_ZONE	"Katmandu"
#define		GMT06_00_ZONE	"Almaty\nNovosibirsk\nAstana\nDacca"
#define		GMT06_30_ZONE	"Rangoon"
#define		GMT07_00_ZONE	"Krasnoyarsk\nBangkok\nHanoi\nDjakarta"
#define		GMT08_00_ZONE	"Beijing,Chongqing\nHongkong,Urumchi\nKuala Lumpur,Singapore\nPerth,Taipei\nIrkutsk,Ulan Bator"	
#define		GMT09_00_ZONE	"Osaka\nSapporo\nTokyo\nSeoul\nYakutsk"
#define		GMT09_30_ZONE	"Adelaide\nDarwin"
#define		GMT10_00_ZONE	"Brisbane\nVladivostok\nGuam\nPort Moresby\nHobart\nCanberra\nMelbourne\nSydney"
#define		GMT11_00_ZONE	"Magadan\nSolomon Is.\nNew Caledonia"
#define		GMT12_00_ZONE	"Auckland\nWellingdon\nfiji\nKamchatka\nMarshall Is."

#define		_GMT01_00_ZONE	"Azores\nCape Verde Islands"
#define		_GMT02_00_ZONE	"Mid-Atlantic"
#define		_GMT03_00_ZONE	"Greenland\nBuenos Aires\nGeorgetown\nBrasilia"
#define		_GMT03_30_ZONE	"Newfoundland"
#define		_GMT04_00_ZONE	"Caracas\nLa Paz\nAtlantic Time(Canada)\nSantiago"
#define		_GMT05_00_ZONE	"Indiana(East)\nEastern Time(US & Canada)\nBogota\nLima\nQuito"
#define		_GMT06_00_ZONE	"Guadalajara\nMexico\nMonterrey\nCentral America\nCentral Time(US & Canada)\nSaskatchewan"
#define		_GMT07_00_ZONE	"Arizona\nMountain Time(US & Canada)"
#define		_GMT08_00_ZONE	"Pacific Time(US & Canada)\nTijuana"
#define		_GMT09_00_ZONE	"Alaska"
#define		_GMT10_00_ZONE	"Hawaii"
#define		_GMT11_00_ZONE	"Midway Island\nSamoa"
#define		_GMT12_00_ZONE	"International Data Line West"

*/							
												
/*============================================================================*/
/*============================================================================*/
/*============================================================================*/
/*============================================================================*/
/*============================================================================*/
/*============================================================================*/

#endif

⌨️ 快捷键说明

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