📄 ex_rtc.h
字号:
#ifndef EX_RTC_H
#define EX_RTC_H
#include "stdio.h"
#include "def.h"
#include "NUCLEUS.H"
#include "MotoType.h"
void EX_creat_time_HISR_ENTRY(UNSIGNED argc, VOID *argv);
#define RTC_CE_SEL {*(RP)PORTA_SEL |=(1<<1);}
#define RTC_CE_OUT {*(RP)PORTA_DIR &= ~(1<<1);}
#define RTC_CE(x) {if(x == 1) *(RP)PORTA_DATA |= (1<<1); \
else *(RP)PORTA_DATA &= ~(1<<1);}
#define RTC_IO_SEL {*(RP)PORTH_SEL |= (1<<7);}
#define RTC_IO_IN {*(RP)PORTH_DIR |= (1<<7);}
#define RTC_IO_OUT {*(RP)PORTH_DIR &= ~(1<<7);}
#define RTC_IO *(RP)PORTH_DATA
#define RTC_SCLK_SEL {*(RP)PORTH_SEL |=(1<<6);}
#define RTC_SCLK_OUT {*(RP)PORTH_DIR &= ~(1<<6);}
#define RTC_SCLK(x) {if(x == 1) *(RP)PORTH_DATA |= (1<<6); \
else *(RP)PORTH_DATA &= ~(1<<6);}
#define WRITE_SEC_COM 0x80
#define READ_SEC_COM 0x81
#define WRITE_MIN_COM 0x82
#define READ_MIN_COM 0x83
#define WRITE_HOUR_COM 0x84
#define READ_HOUR_COM 0x85
#define WRITE_DATE_COM 0x86
#define READ_DATE_COM 0x87
#define WRITE_MONTH_COM 0x88
#define READ_MONTH_COM 0x89
#define WRITE_DAY_COM 0x8A
#define READ_DAY_COM 0x8B
#define WRITE_YEAR_COM 0x8C
#define READ_YEAR_COM 0x8D
#define WRITE_WP 0x8E
#define READ_WP 0x8F
#define WP_ENABLE 0x80
#define WP_DISABLE 0x00
typedef struct{
U8 second;
U8 minute;
U8 hour;
U8 date;
U8 month;
U8 day; //week
U8 year;
}_RTC_TIME;
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -