/************************** Copyright (c) **********************************
|
** FUZHOU FUGUANG ELECTRONICS Co.,LTD.
|
** ¸£Öݸ£¹âµç×ÓÓÐÏÞ¹«Ë¾
|
** http://www.fuguang.com
|
**
|
**-------------- File Info -------------------------------------------------
|
** File name: DS1302_Driver.h
|
** Last modified Date: 2008-11-16
|
** Last Version: 1.0
|
** Descriptions: DS1302 Drivers lib
|
**
|
**--------------------------------------------------------------------------
|
** Created by: mxpopstar
|
** Created date: 2008-11-16
|
** Version: 1.0
|
** Descriptions: The original version
|
**
|
**--------------------------------------------------------------------------
|
** Modified by: mxpopstar
|
** Modified date: 2008-11-20
|
** Version:
|
** Descriptions: DS1302 Drivers lib
|
**
|
***************************************************************************/
|
//
|
|
#ifndef DS1302_Dri_H
|
#define DS1302_Dri_H
|
|
#define RST_DS1302_1 PORTB |= 0x10
|
#define RST_DS1302_0 PORTB &= (~0x10) //PINB4
|
|
#define IO_DS1302_1 PORTB |= 0x20
|
#define IO_DS1302_0 PORTB &= (~0x20) //PINB5
|
|
#define IO_Direction_OUT DDRB |= 0x20 //ÉèÖÃIOÒý½ÅΪÊä³ö
|
#define IO_Direction_IN DDRB &= (~0x20) //ÉèÖÃIOÒý½ÅΪÊäÈë
|
|
#define Data_DS1302_1 PINB & 0x20 //¶ÁÈ¡DS1302Êä³öµÄÊý¾Ý
|
|
#define SCLK_DS1302_1 PORTB |= 0x40
|
#define SCLK_DS1302_0 PORTB &= (~0x40) //PINB6
|
|
|
|
#include <avr/io.h>
|
#include <util/delay.h>
|
#include "Define.h"
|
|
void InitIO_DS1302(void);
|
void Config_DS1302(void);
|
void GetDateTime(Date_Time *datetime);
|
void SetDateTime(const Date_Time *datetime);
|
void Ds1302_Write_Byte(const unsigned char command, const unsigned char data);
|
unsigned char Ds1302_Read_Byte(const unsigned char command);
|
|
#endif
|
//
|