ISVP-SDK  3.12.0
Ingenic Smart Video Platform SDK
su_base.h
Go to the documentation of this file.
1 /*
2  * System utils header file.
3  *
4  * Copyright (C) 2014 Ingenic Semiconductor Co.,Ltd
5  */
6 
7 #ifndef __SU_BASE_H__
8 #define __SU_BASE_H__
9 
10 #include <stdint.h>
11 
12 #ifdef __cplusplus
13 #if __cplusplus
14 extern "C"
15 {
16 #endif
17 #endif /* __cplusplus */
18 
38 #define DEVICE_ID_MAGIC "53ef"
39 
43 #define DEVICE_ID_MAGIC_LEN 4
44 
48 #define DEVICE_ID_LEN 32
49 
53 #define MAX_INFO_LEN 64
54 
58 typedef struct {
59  char chr[MAX_INFO_LEN];
60 } SUModelNum;
61 
65 typedef struct {
66  char chr[MAX_INFO_LEN];
67 } SUVersion;
68 
72 typedef union {
73  char chr[MAX_INFO_LEN];
74  uint8_t hex[MAX_INFO_LEN];
75 } SUDevID;
76 
80 typedef struct {
81  int sec;
82  int min;
83  int hour;
84  int mday;
85  int mon;
86  int year;
87 } SUTime;
88 
103 int SU_Base_GetModelNumber(SUModelNum *modelNum);
104 
119 int SU_Base_GetVersion(SUVersion *version);
120 
135 int SU_Base_GetDevID(SUDevID *devID);
136 
151 int SU_Base_GetTime(SUTime *time);
152 
167 int SU_Base_SetTime(SUTime *time);
168 
184 int SU_Base_SUTime2Raw(SUTime *suTime, uint32_t *rawTime);
185 
201 int SU_Base_Raw2SUTime(uint32_t *rawTime, SUTime *suTime);
202 
217 int SU_Base_SetAlarm(SUTime *time);
218 
233 int SU_Base_GetAlarm(SUTime *time);
234 
249 int SU_Base_EnableAlarm(void);
250 
265 int SU_Base_DisableAlarm(void);
266 
281 int SU_Base_PollingAlarm(uint32_t timeoutMsec);
282 
297 int SU_Base_Shutdown(void);
298 
313 int SU_Base_Reboot(void);
314 
329 int SU_Base_Suspend();
330 
335 #ifdef __cplusplus
336 #if __cplusplus
337 }
338 #endif
339 #endif /* __cplusplus */
340 
341 #endif /* __SU_BASE_H__ */
#define MAX_INFO_LEN
Maxnum length of Device model,Device ID and Firmware version.
Definition: su_base.h:53
System time structure.
Definition: su_base.h:80
int SU_Base_DisableAlarm(void)
Disable Alarm.
Device Model.
Definition: su_base.h:58
int SU_Base_Suspend()
Suspend device.
Device software version.
Definition: su_base.h:65
int SU_Base_PollingAlarm(uint32_t timeoutMsec)
Wait Alarm.
int SU_Base_SetTime(SUTime *time)
Set system time.
Device ID.
Definition: su_base.h:72
int mday
Day,Range:1~31.
Definition: su_base.h:84
int SU_Base_EnableAlarm(void)
Enable Alarm.
int hour
Hour,Range:0~23.
Definition: su_base.h:83
int SU_Base_Shutdown(void)
Shutdown device.
int SU_Base_SetAlarm(SUTime *time)
Set Alarm time.
int SU_Base_GetAlarm(SUTime *time)
Get the current Alarm time.
int min
Minute,Range:0~59.
Definition: su_base.h:82
int SU_Base_SUTime2Raw(SUTime *suTime, uint32_t *rawTime)
Converts the time of the SUTime type to Raw time in seconds.
int SU_Base_Raw2SUTime(uint32_t *rawTime, SUTime *suTime)
Converts the time of the Raw time in seconds to SUTime type.
int year
Year,Range:>1900.
Definition: su_base.h:86
int SU_Base_GetVersion(SUVersion *version)
Get device version.
int sec
Second,Range:0~59.
Definition: su_base.h:81
int SU_Base_GetModelNumber(SUModelNum *modelNum)
Get device model.
int SU_Base_Reboot(void)
Reboot device.
int mon
Month,Range:1~12.
Definition: su_base.h:85
int SU_Base_GetTime(SUTime *time)
Get system time.
int SU_Base_GetDevID(SUDevID *devID)
Get device ID.