#ifndef _EXTERN_RTC_H_
|
#define _EXTERN_RTC_H_
|
|
#include "define_all.h"
|
#include "rtc.h"
|
|
// <<< Use Configuration Wizard in Context Menu >>>
|
|
// <h> ÍⲿRTC¼Ä´æÆ÷ÉèÖÃ
|
// <o> ¶¨Ê±Æ÷¼ÆÊýÆ÷0£¨È¡Öµ·¶Î§0~255£©
|
// <i> bit0 = 1 bit1 = 2 bit3 = 4 ......bit7 = 128
|
// <0-255>
|
#define TIMER_COUNTER_0 0
|
|
// <o> ¶¨Ê±Æ÷¼ÆÊýÆ÷1£¨È¡Öµ·¶Î§0£¬256~3840£©
|
// <i> bit0 = 256 bit1 = 512 bit3 = 1024 bit3 = 2048
|
// <0=>0 <1=>256 <2=>512 <3=>768 <4=>1024 <5=>1280 <6=>1536 <7=>1792
|
// <8=>2048 <9=>2304 <10=>2560 <11=>2816 <12=>3072 <13=>3328 <14=>3584 <15=>3840
|
#define TIMER_COUNTER_1 0
|
|
// <h> À©Õ¹¹¦ÄÜ£¨È磺ʱÖÓÔ´ÉèÖúͶ¨Ê±Æ÷¸üÐÂÆô¶¯µÈ£©
|
// <o> ¶¨Ê±Æ÷ÖжÏÖÜÆÚ£¨Ê±ÖÓÔ´£©
|
// <0=>4096Hz <0x01=>64Hz <0x02=>Sec Updata <0x03=>Min Updata
|
#define EXTENSION_TIMER_SELECT 0x02
|
|
// <o> FOUTƵÂÊÉèÖã¨ÎÞÓã©
|
// <0=>32768Hz <0x04=>1024Hz <0x08=>1Hz <0x0C=>32768_1Hz
|
#define FOUT_FRE_SELECT 0x0
|
|
// <o> ¶¨Ê±Æ÷Æô¶¯±ê־λ
|
// <0=>¹Ø±Õ <0x10=>Æô¶¯
|
#define TIMER_EN 0x00
|
|
// <o> ¸üÐÂÖÐ¶ÏÆô¶¯±ê־λ
|
// <0=>Sec¸üÐÂÆô¶¯ <0x20=>Min¸üÐÂÆô¶¯
|
#define UPDATA_INTER_SELECT 0x0
|
|
// <o> ¾¯¸æÆô¶¯±ê־λ
|
// <0=>¹Ø±Õ
|
#define ALARM_BIT_FLAG 0
|
|
// <o> ²âÊÔ±ê־λ£¨Ä¬ÈÏΪ0£©
|
// <0=>0
|
#define TEST_BIT_FLAG 0
|
// </h>
|
// <o> FLAG¹¦ÄÜ£¨ÎÞÓã¬Ä¬ÈÏΪ0£©
|
// <0=>0
|
#define FLAG_REG 0
|
|
// <h> ¿ØÖƹ¦ÄÜ£¨È磺¶¨Ê±Æ÷ÖжÏÉèÖúÍζȲ¹³¥µÈ£©
|
// <o> ¸´Î»¹¦ÄÜ£¨Ä¬ÈÏΪ0£©
|
// <0x0=>0
|
#define RESET_BIT_FLAG 0x0
|
|
// <o> ¾¯¸æÖжϹ¦ÄÜ
|
// <0x0=>¹Ø±Õ
|
#define ALARM_BIT_EN 0x0
|
|
// <o> ¶¨Ê±Æ÷ÖжϹ¦ÄÜ
|
// <0x0=>¹Ø±Õ <0x10=>Æô¶¯
|
#define TIMER_BIT_FLAG 0x00
|
|
// <o> ¸üÐÂÖжϹ¦ÄÜ
|
// <0x0=>¹Ø±Õ <0x20=>Æô¶¯
|
#define UPDATA_BIT_FLAG 0x000000
|
|
// <o> ζȲ¹³¥¹¦ÄÜ
|
// <0x0=>0.5S <0x40=>2.0S <0x80=>10S <0xC0=>30S
|
#define TEMP_BIT_FLAG 0x0000040
|
// </h>
|
|
// </h>
|
// <<< end of configuration section >>>
|
|
|
#define RX8025_WRITE_ADDR 0x64
|
#define RX8025_READ_ADDR 0x65
|
|
|
|
|
|
#pragma pack(1)
|
typedef struct
|
{
|
uint8_t second;
|
uint8_t minute;
|
uint8_t hour;
|
uint8_t week;
|
uint8_t day;
|
uint8_t month;
|
uint16_t year;
|
}CALENDAR_TIME_T;//BCD
|
|
|
|
typedef struct
|
{
|
uint8_t year; //Ä꣬BCD Âë 00~99
|
uint8_t month; //Ô£¬BCD Âë 01~12
|
uint8_t day; //ÈÕ£¬BCD Âë 01~31
|
uint8_t hour; //ʱ£¬BCD Âë 00~23
|
uint8_t min; //·Ö£¬BCD Âë 00~59
|
uint8_t sec; //Ã룬BCD Âë 00~59
|
}sClockBCD;
|
|
|
|
|
#pragma pack()
|
|
|
void Set_Extern_Rtc_Time(uint16_t year,uint8_t month,uint8_t day,uint8_t week,uint8_t hour,uint8_t min,uint8_t sec);
|
ErrorStatus Get_Extern_Rtc_Time(__IO sClockBCD * calendar_p);
|
|
void Set_Rtc_UpdataInterrupt(void);
|
|
//extern __IO CALENDAR_TIME_T calendar_g;
|
//extern __IO CALENDAR_TIME_T calendar_test_g;
|
|
ErrorStatus TimeEffectJudgm(const sClockBCD TimeBCD);
|
|
#endif
|