1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
/*
* power-manager
* Copyright (c) 2012 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* @file pm_setting.h
* @version 0.1
* @brief Power manager setting module header
*/
#ifndef __PM_SETTING_H__
#define __PM_SETTING_H__
#include <vconf.h>
/*
* @addtogroup POWER_MANAGER
* @{
*/
enum {
SETTING_BEGIN = 0,
SETTING_TO_NORMAL = SETTING_BEGIN,
SETTING_LOW_BATT,
SETTING_CHARGING,
SETTING_BRT_LEVEL,
SETTING_LOCK_SCREEN,
SETTING_POWER_SAVING,
SETTING_POWER_SAVING_DISPLAY,
SETTING_GET_END,
SETTING_PM_STATE = SETTING_GET_END,
SETTING_END
};
extern int get_setting_brightness();
/*
* @brief setting initialization function
*
* get the variables if it exists. otherwise, set the default.
* and register some callback functions.
*
* @internal
* @param[in] func configuration change callback function
* @return 0 : success, -1 : error
*/
extern int init_setting(int (*func) (int key_idx, int val));
extern int exit_setting();
/*
* get normal state timeout from SLP-setting SLP_SETTING_LCD_TIMEOUT_NORMAL
*
* @internal
* @param[out] timeout timeout variable pointer
* @return 0 : success, -1 : error
*/
extern int get_run_timeout(int *timeout);
/*
* get LCD dim state timeout from environment variable.
*
* @internal
* @param[out] timeout timeout variable pointer
* @return 0 : success, -1 : error
*/
extern int get_dim_timeout(int *timeout);
/*
* get LCD off state timeout from environment variable.
*
* @internal
* @param[out] timeout timeout variable pointer
* @return 0 : success, -1 : error
*/
extern int get_off_timeout(int *timeout);
/*
* get USB connection status from SLP-setting SLP_SETTING_USB_STATUS
*
* @internal
* @param[out] val usb connection status variable pointer, 0 is disconnected, others is connected.
* @return 0 : success, -1 : error
*/
extern int get_usb_status(int *val);
/*
* set Current power manager state at SLP-setting "memory/pwrmgr/state"
*
* @internal
* @param[in] val current power manager state.
* @return 0 : success, -1 : error
*/
extern int set_setting_pmstate(int val);
/*
* get charging status at SLP-setting "memory/Battery/Charger"
*
* @internal
* @param[in] val charging or not (1 or 0 respectively).
* @return 0 : success, -1 : error
*/
extern int get_charging_status(int *val);
/*
* get current battery low status at SLP-setting "memory/Battery/Status/Low"
*
* @internal
* @param[in] val current low battery status
* @return 0 : success, -1 : error
*/
extern int get_lowbatt_status(int *val);
/*
* @}
*/
#endif
|