72 lines
2.1 KiB
C
72 lines
2.1 KiB
C
/*================================================================
|
|
Copyright (c) 2021, Quectel Wireless Solutions Co., Ltd. All rights reserved.
|
|
Quectel Wireless Solutions Proprietary and Confidential.
|
|
=================================================================*/
|
|
|
|
/*=================================================================
|
|
|
|
EDIT HISTORY FOR MODULE
|
|
|
|
This section contains comments describing changes made to the module.
|
|
Notice that changes are listed in reverse chronological order.
|
|
|
|
WHEN WHO WHAT, WHERE, WHY
|
|
------------ ------- -------------------------------------------------------------------------------
|
|
12/04/2022 Fias Init version:This file contains the rtc functions's definitions
|
|
=================================================================*/
|
|
|
|
|
|
#ifndef _QUEC_RTC_H
|
|
#define _QUEC_RTC_H
|
|
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef enum {
|
|
QUEC_SYS_OFFSET,
|
|
QUEC_APP_OFFSET
|
|
}QUEC_RTC_OFFSET_TYPE;
|
|
|
|
typedef struct quec_rtc_time_struct {
|
|
int quec_tm_sec; //seconds [0,59]
|
|
int quec_tm_min; //minutes [0,59]
|
|
int quec_tm_hour; //hour [0,23]
|
|
int quec_tm_mday; //day of month [1,31]
|
|
int quec_tm_mon; //month of year [1,12]
|
|
int quec_tm_year; // since 1970
|
|
int quec_tm_wday; // sunday = 0
|
|
}quec_rtc_time_t;
|
|
|
|
typedef enum{
|
|
COME_FORM_NITZ,
|
|
COME_FORM_NTP,
|
|
COME_FORM_APP,
|
|
COME_FORM_UNKNOWN
|
|
}time_source_t;
|
|
|
|
typedef void (*quec_rtc_cb)(void);
|
|
|
|
void quec_rtc_get_time(quec_rtc_time_t *tm);
|
|
void quec_rtc_set_time(quec_rtc_time_t *tm);
|
|
void quec_set_rtc_source(time_source_t source);
|
|
int quectel_ntp_SetRealTimeClock(int year, int month, int day, int hour, int min, int sec, int timezone);
|
|
time_source_t quec_get_rtc_source(void);
|
|
extern int GetTimeZone(void);
|
|
|
|
unsigned int QUEC_RTC_Get_Ticks(void);
|
|
unsigned long long QUEC_RTC_Get_Ticks_uint64(void);
|
|
|
|
void QUEC_RTC_Set_Alarm(quec_rtc_time_t *tm);
|
|
void QUEC_RTC_Get_Alarm(quec_rtc_time_t *tm);
|
|
void QUEC_RTC_Enable_Alarm(unsigned char on_off);
|
|
void QUEC_RTC_Register_cb(quec_rtc_cb cb);
|
|
|
|
#ifdef __cplusplus
|
|
} /*"C" */
|
|
#endif
|
|
|
|
#endif
|
|
|