ds1307.h

来自「ds1307 driver by c clock chip」· C头文件 代码 · 共 40 行

H
40
字号
#ifndef DS1307_HEAD
#define DS1307_HEAD
	#ifndef uchar 
		#define uchar unsigned char 
		#define uint  unsigned int
        #define ulong unsigned long
	#endif

	#ifndef ID_OK
		#define ID_OK 	0
		#define ID_ERR 	1
	#endif

	
	#define DS1307_DEVICEADDR  0xd0

	

	//读写任意位置ram
	extern uchar Ds1307ReadRam(uchar addr,uchar *Buffer,uchar Length);
	extern uchar Ds1307WriteRam(uchar addr,uchar *Buffer,uchar Length);	

	//初始化时钟芯片
	extern uchar Ds1307Init(void);

	//声音及模式
	extern uchar ReadSpeakMode(uchar *mode);
	extern uchar SetSpeakMode(uchar mode);
	extern uchar open_speak();
	extern uchar close_speak();

	//读写时间信息
	//time[]={century year month day hour minute seconds week}
	extern uchar read_alltime(uchar *time);
	//time[]={century year month day hour minute seconds week}
	extern uchar  write_alltime(uchar *time);



#endif

⌨️ 快捷键说明

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