sr_time.h
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:3k
- /**********************************************************************************
- File Name : sr_time.h
- Description : Time / Date Manager
- COPYRIGHT (C) STMicroelectronics 2004
- Date Modification Name
- ---- ------------ ----
- 8/18/2004 Created Louie
- <$ModMark> (do not move/delete)
- ***********************************************************************************/
- #ifndef __SR_TIME_H__ /* Prevent multiple inclusion of the file */
- #define __SR_TIME_H__
- /* C++ support */
- #ifdef __cplusplus
- extern "C" {
- #endif
- #define INVALID_LINK -1
- /* Includes ----------------------------------------------------------------- */
- #include "stddefs.h"
- /* Private Types ------------------------------------------------------------ */
- /* Private Constants -------------------------------------------------------- */
- /* Private Variables (static) ------------------------------------------------ */
- /* Global Variables --------------------------------------------------------- */
- #define TIMEZONE_CORRECTION_FACTOR 8 /* for GMT+800: Singapore, China, Taiwan */
- /* Private Macros ----------------------------------------------------------- */
- /* Private Function prototypes ---------------------------------------------- */
- /* Functions ---------------------------------------------------------------- */
- ST_ErrorCode_t SRTIM_Init(void);
- void ConvertTimeStampToTimeString(U32 timeStamp, char* out);
- int ConvertTimeStampToDateString(U32 timeStamp, char* out);
- void ConvertTimeStampToHHMMSS(U32 timeStamp, char* out);
- //*****************************************************************************
- //名称:ConvertTimeStampToTime
- //
- //功能:将32位时间转换成时分秒输出
- //
- //输入:32位时间
- //
- //输出:时分秒
- //
- //返回:无
- //*****************************************************************************
- void ConvertTimeStampToTime(U32 timeStamp, U32 *hour, U32 *min, U32 *sec);
- //*****************************************************************************
- //名称:ConvertTimeStampToDate
- //
- //功能:将32位时间转换成年月日输出
- //
- //输入:32位时间
- //
- //输出:年月日
- //
- //返回:0--周日, 1--周一; ..., 6
- //*****************************************************************************
- int ConvertTimeStampToDate(U32 timeStamp, U32 *year, U32 *month, U32 *day);
- U32 GetU32CurrentTimeDate(void);
- void SetU32UTC(U32 newUTC);
- U32 GetU32UTC(void* dummy);
- U32 MJDtoUNIX(const U8* pMjdData);
- U32 PackedBcd24ToSeconds(const U8* pBcd24BitTime);
- int GetTimeDateUserOffset(void);
- void SetTimeDateUserOffset(int newOffset);
- /* end C++ support */
- #ifdef __cplusplus
- }
- #endif
- #endif /* #ifndef __SR_TIME_H__ */
- /* ----------------------------- End of file (sr_time.h) ------------------------- */