2024-11-26 15:52:49 +08:00
|
|
|
|
#ifndef DRV_RTC_H_
|
|
|
|
|
#define DRV_RTC_H_
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include "kit_macro.h"
|
|
|
|
|
|
|
|
|
|
bool drv_rtc_init(void);
|
|
|
|
|
bool drv_rtc_set_tick(uint32_t tick);
|
|
|
|
|
bool drv_rtc_set_time(uint8_t hour, uint8_t min, uint8_t sec);
|
|
|
|
|
bool drv_rtc_set_date(uint16_t year, uint8_t month, uint8_t day);
|
|
|
|
|
bool drv_rtc_get_date(int32_t *year, int32_t *month, int32_t *day);
|
|
|
|
|
bool drv_rtc_get_time(int32_t *hour, int32_t *min, int32_t *sec);
|
|
|
|
|
bool drv_rtc_set_ms(uint16_t ms);
|
|
|
|
|
|
|
|
|
|
uint16_t drv_rtc_get_ms(void);
|
|
|
|
|
uint32_t drv_rtc_get_tick(void);
|
|
|
|
|
|
2025-05-19 11:40:39 +08:00
|
|
|
|
// <20><>ȡ<EFBFBD><C8A1>ǰʱ<C7B0><CAB1>
|
|
|
|
|
void drv_get_date_time(uint16_t *year, uint8_t *month, uint8_t *date,uint8_t *hour, uint8_t *min, uint8_t *sec);
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>䣺year = 2000~2099
|
|
|
|
|
void drv_set_date_time(uint16_t year, uint8_t month, uint8_t date,uint8_t hour, uint8_t min, uint8_t sec);
|
|
|
|
|
|
2024-11-26 15:52:49 +08:00
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|