112 lines
2.2 KiB
C
112 lines
2.2 KiB
C
|
|
#ifndef UI_IO_H__
|
|||
|
|
#define UI_IO_H__
|
|||
|
|
|
|||
|
|
|
|||
|
|
#include "base.h"
|
|||
|
|
#include "time.h"
|
|||
|
|
|
|||
|
|
//获取屏幕亮度
|
|||
|
|
u8 ui_getScreenBrightness (void);
|
|||
|
|
|
|||
|
|
//设置屏幕亮度
|
|||
|
|
void ui_setScreenBrightness (u8 t);
|
|||
|
|
|
|||
|
|
//屏幕背光
|
|||
|
|
void ui_setScreenBackLightPower (int power);
|
|||
|
|
|
|||
|
|
//获取自动亮度控制状态,关闭
|
|||
|
|
int ui_getScreenAutoLight (void);
|
|||
|
|
int ui_setScreenAutoLight (int k);
|
|||
|
|
|
|||
|
|
//获取自动熄屏时间
|
|||
|
|
int ui_getScreenOffTime (void);
|
|||
|
|
|
|||
|
|
int ui_setScreenOffTime (int time);
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
u8 ui_getNfcMode (void);
|
|||
|
|
|
|||
|
|
|
|||
|
|
void ui_setNfcMode (u8 t);
|
|||
|
|
|
|||
|
|
u8 ui_getNfcPower (void);
|
|||
|
|
|
|||
|
|
void ui_setNfcPower (u8 t);
|
|||
|
|
|
|||
|
|
//获取在卡模式的数据内容
|
|||
|
|
char *ui_getNfcCardModeData (void);
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
/*---------------------------与RTC无关的函数------------------------*/
|
|||
|
|
|
|||
|
|
//输入:年份
|
|||
|
|
//输出:该年份是不是闰年.1,是.0,不是
|
|||
|
|
u8 date_is_leap_year(u16 year);
|
|||
|
|
|
|||
|
|
//获取月份的天数
|
|||
|
|
int date_get_month_day_max (int year, int month);
|
|||
|
|
|
|||
|
|
//获得现在是星期几
|
|||
|
|
//功能描述:输入公历日期得到星期(只允许1901-2099年)
|
|||
|
|
//输入参数:公历年月日
|
|||
|
|
//返回值:星期号 (取值1~7)
|
|||
|
|
u8 date_get_week_by_day(u16 year,u8 month,u8 day);
|
|||
|
|
|
|||
|
|
//以1970年1月1日为基准
|
|||
|
|
//1970~2069年为合法年份
|
|||
|
|
int date_get_year_max (void);
|
|||
|
|
|
|||
|
|
int date_get_year_min (void);
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
//取得下一天
|
|||
|
|
void date_get_next_day (int *year,int *month,int *day);
|
|||
|
|
|
|||
|
|
//取得上一天
|
|||
|
|
void date_get_last_day (int *year,int *month,int *day);
|
|||
|
|
|
|||
|
|
//取得下n天
|
|||
|
|
void date_get_next_n_day (int *year,int *month,int *day,int n);
|
|||
|
|
|
|||
|
|
//取得上n天
|
|||
|
|
void date_get_last_n_day (int *year,int *month,int *day,int n);
|
|||
|
|
|
|||
|
|
// 日历转换为秒钟,返回自纪元 Epoch(1970-01-01 00:00:00 UTC)起经过的时间,以秒为单位
|
|||
|
|
time_t calendar_to_sec(int syear,int smon,int sday,int hour,int min,int sec);
|
|||
|
|
|
|||
|
|
|
|||
|
|
/*---------------------------与RTC无关的函数End------------------------*/
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
/*---------------------------与RTC有关的函数------------------------*/
|
|||
|
|
|
|||
|
|
//获取日期
|
|||
|
|
int date_rtc_get_date (int *year,int *month,int *day);
|
|||
|
|
|
|||
|
|
//获取时间
|
|||
|
|
int date_rtc_get_time (int *hour,int *min,int *sec);
|
|||
|
|
|
|||
|
|
//设置日期
|
|||
|
|
int date_rtc_set_date (int year,int month,int day);
|
|||
|
|
|
|||
|
|
//设置时间
|
|||
|
|
int date_rtc_set_time (int hour,int min,int sec);
|
|||
|
|
|
|||
|
|
/*---------------------------与RTC有关的函数End------------------------*/
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
#endif
|
|||
|
|
|