需要的,仔细看看资料,一般包括以下几个方面
//硬件地址p2.7接12887的cs(注意:非反恐精英的cs)
#define p12887_sec xbyte[0x7f00]
#define p12887_asec xbyte[0x7f01]
#define p12887_min xbyte[0x7f02]
#define p12887_amin xbyte[0x7f03]
#define p12887_hour xbyte[0x7f04]
#define p12887_ahour xbyte[0x7f05]
#define p12887_week xbyte[0x7f06]
#define p12887_day xbyte[0x7f07]
#define p12887_month xbyte[0x7f08]
#define p12887_year xbyte[0x7f09]
#define p12887_cona xbyte[0x7f0a]
#define p12887_conb xbyte[0x7f0b]
#define p12887_irqf xbyte[0x7f0c]
#define p12887_vf xbyte[0x7f0d]
//初始化操作
void start12887(void) //启动时钟
{
u_char i;
i=p12887_vf;
p12887_cona=0x70; // 挂起时钟
p12887_conb=0x86; // noupdate,all int disable, bin,24,normal time
p12887_conb=0x06; // update
p12887_cona=0x20; // start
i=p12887_irqf;
}
发表时间:2003年7月5日9:33:22