删除 RTC.h
This commit is contained in:
101
RTC.h
101
RTC.h
@@ -1,101 +0,0 @@
|
|||||||
#ifndef _RTC_H_
|
|
||||||
#define _RTC_H_
|
|
||||||
|
|
||||||
//#define _nop_() udelay(1);
|
|
||||||
#define somenop {_nop_();_nop_();_nop_();_nop_();_nop_();}
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
STATE_INIT = 0, // <20><>ʼ<EFBFBD><CABC>״̬<D7B4><CCAC><EFBFBD>״<EFBFBD><D7B4><EFBFBD><EFBFBD>У<EFBFBD>
|
|
||||||
STATE_ON, // ON״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD>ģʽ<C4A3><CABD>
|
|
||||||
STATE_OFF, // OFF״̬<D7B4><CCAC><EFBFBD><D7BC><EFBFBD><EFBFBD><EFBFBD>ߣ<EFBFBD>
|
|
||||||
STATE_OFF2, // OFF2״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DFBC>أ<EFBFBD>
|
|
||||||
STATE_ON2 // ON2״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ<C4A3><CABD>
|
|
||||||
} SystemState;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
ubyte year; // <20>꣨<EFBFBD><EAA3A8><EFBFBD><EFBFBD><EFBFBD>洢<EFBFBD><E6B4A2><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>2025<32><35>25<32><35>
|
|
||||||
ubyte month; // <20>£<EFBFBD>1-12<31><32>
|
|
||||||
ubyte day; // <20>գ<EFBFBD>1-31<33><31>
|
|
||||||
ubyte hour; // Сʱ<D0A1><CAB1>0-23<32><33>
|
|
||||||
ubyte week; // <20><> <20><>0-6<><36>
|
|
||||||
ubyte minute; // <20><><EFBFBD>ӣ<EFBFBD>0-59<35><39>
|
|
||||||
ubyte second; // <20><> <20><>0-59<35><39>
|
|
||||||
ubyte resver;
|
|
||||||
} DateTimeInfo; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ô<EFBFBD><C3B4>շ巨<D5B7><E5B7A8><EFBFBD><EFBFBD>˹<EFBFBD><CBB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
||||||
|
|
||||||
typedef union _UnTimeOutput
|
|
||||||
{
|
|
||||||
DateTimeInfo bit_data; // ʹ<>ö<EFBFBD><C3B6><EFBFBD><EFBFBD>Ľṹ<C4BD><E1B9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
||||||
ubyte arr[sizeof(DateTimeInfo)]; // ͨ<><CDA8><EFBFBD>ṹ<EFBFBD><E1B9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD>С
|
|
||||||
} UnTimeOutput;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
extern unsigned char bySta;
|
|
||||||
extern UnTimeOutput currenttime;
|
|
||||||
extern UnTimeOutput un_time_output1;//<2F><><EFBFBD><EFBFBD><EFBFBD>趨ʱ<E8B6A8><CAB1>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// <20><><EFBFBD><EFBFBD> BM8563 <20><> I2C <20><>ַ
|
|
||||||
#define BM8563_ADDR 0xA2
|
|
||||||
|
|
||||||
// <20><><EFBFBD><EFBFBD> BM8563 <20>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>ַ
|
|
||||||
#define BM8563_CSR2 0x01
|
|
||||||
#define BM8563_SEC 0x02
|
|
||||||
#define BM8563_MIN 0x03
|
|
||||||
#define BM8563_HOUR 0x04
|
|
||||||
#define BM8563_DAY 0x05
|
|
||||||
#define BM8563_WEEK 0x06
|
|
||||||
#define BM8563_MONTH 0x07
|
|
||||||
#define BM8563_YEAR 0x08
|
|
||||||
#define BM8563_ALARM_MIN 0x09
|
|
||||||
#define BM8563_ALARM_HOUR 0x0A
|
|
||||||
#define BM8563_ALARM_DAY 0x0B
|
|
||||||
#define BM8563_ALARM_WEEK 0x0C
|
|
||||||
#define BM8563_CONTROL 0x0E // <20><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>ƼĴ<C6BC><C4B4><EFBFBD>
|
|
||||||
#define BM8563_STATUS 0x01
|
|
||||||
#define BM8563_TIMER_VALUE 0x0F // <20><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD>
|
|
||||||
|
|
||||||
#define BM8563_AF_BIT 0x08 // AF<41><46>־λ<D6BE><CEBB>Bit3<74><33>
|
|
||||||
|
|
||||||
|
|
||||||
ubyte leapYear(uword year);
|
|
||||||
void BM8563_InitTime();
|
|
||||||
void BM8563_Set4HourCountdown();
|
|
||||||
unsigned char BM8563_ReadReg(unsigned char reg);
|
|
||||||
void BM8563_WriteReg(unsigned char reg, unsigned char rdata);
|
|
||||||
void BM8563_Set4HourAlarm();
|
|
||||||
void bm8563GetTime(UnTimeOutput *pTime);
|
|
||||||
ubyte bm8563SetAlarm(UnTimeOutput *pTime);
|
|
||||||
void bm8563SetTime(UnTimeOutput *pTime);
|
|
||||||
bool bm8563CheckAlarmFlag(void);
|
|
||||||
void bm8563ClearAlarmFlag(void);
|
|
||||||
|
|
||||||
void iic_start(void);
|
|
||||||
void iic_stop(void);
|
|
||||||
void iic_ack(bit ackbit);
|
|
||||||
void iic_sendbyte(unsigned char byt);
|
|
||||||
void wrbyte_24c02(unsigned int add,unsigned char dat);
|
|
||||||
|
|
||||||
bit iic_waitack(void);
|
|
||||||
unsigned char i2c_recbyte(void);
|
|
||||||
unsigned char rdbyte_24c02(unsigned int add);
|
|
||||||
unsigned char wrEE_CRC_Bak(unsigned char add,unsigned char *eeData,unsigned char len,unsigned char addbak);
|
|
||||||
unsigned char rdEE_CRC_Bak(unsigned char add,unsigned char *eeData,unsigned char len,unsigned char addbak);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
Reference in New Issue
Block a user