4G_module/include/cmiot/cm_rtc.h

102 lines
2.2 KiB
C
Raw Normal View History

2024-09-02 17:54:29 +08:00
/**
* @file cm_rtc.h
* @brief RTC管理
* @copyright Copyright © 2021 China Mobile IOT. All rights reserved.
* @author By ljw
* @date 2021/05/28
*
* @defgroup rtc rtc
* @ingroup SYS
* @{
*/
#ifndef __CM_RTC_H__
#define __CM_RTC_H__
/****************************************************************************
* Included Files
****************************************************************************/
#include <stdint.h>
#include <time.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Public Types
****************************************************************************/
/****************************************************************************
* Public Data
****************************************************************************/
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/**
* @brief
*
* @param [in] second ()
*
* @return
* = 0 - \n
* < 0 - ,
*
* @details UTC时间
*/
int32_t cm_rtc_set_current_time(uint64_t second);
/**
* @brief
*
* @return
*
* @details UTC时间
*/
uint64_t cm_rtc_get_current_time(void);
/**
* @brief
*
* @param [in] timezone
*
* @return
* = 0 - \n
* < 0 - ,
*
* @details timezone设置范围为-12~12-12西012
*/
int32_t cm_rtc_set_timezone(int32_t timezone);
/**
* @brief
*
* @return
*
* @details timezone范围为-12~12-12西012
*/
int32_t cm_rtc_get_timezone(void);
#undef EXTERN
#ifdef __cplusplus
}
#endif
#endif /* __CM_RTC_H__ */
/** @}*/