4 * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the License);
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
31 * @defgroup CAPI_SYSTEM_DEVICED_LED_MODULE Led
32 * @ingroup CAPI_SYSTEM_DEVICED
33 * @brief This file provides the API for control of led
34 * @section CAPI_SYSTEM_DEVICED_LED_MODULE_HEADER Required Header
35 * \#include <dd-led.h>
39 * @addtogroup CAPI_SYSTEM_DEVICED_LED_MODULE
55 LED_REMOTE_CONTROLLER,
62 #define led_set_brightness(val) \
63 led_set_brightness_with_noti(val, false)
65 #define led_set_mode(mode, on) \
66 led_set_mode_with_color(mode, on, 0)
70 * This API is used to get the current brightness of the led.\n
71 * It gets the current brightness of the led by calling device_get_property() function.\n
72 * It returns integer value which is the current brightness on success.\n
73 * Or a negative value(-1) is returned on failure.
74 * @return current brightness value on success, -1 if failed
75 * @see led_set_brightness_with_noti()
80 * cur_brt = led_get_brightness();
82 * printf("Fail to get the current brightness of the led.\n");
84 * printf("Current brightness of the led is %d\n", cur_brt);
88 int led_get_brightness(void);
92 * This API is used to get the max brightness of the led.\n
93 * It gets the max brightness of the led by calling device_get_property() function.\n
94 * It returns integer value which is the max brightness on success.\n
95 * Or a negative value(-1) is returned on failure
96 * @return max brightness value on success, -1 if failed
101 * max_brt = led_get_max_brightness();
103 * printf("Fail to get the max brightness of the led.\n");
107 int led_get_max_brightness(void);
111 * This API is used to set the current brightness of the led.\n
112 * It sets the current brightness of the led by calling device_set_property() function.\n
113 * @param[in] val brightness value that you want to set
114 * @param[in] enable noti
115 * @return 0 on success, -1 if failed
116 * @see led_get_brightness()
120 * if( led_set_brightness_with_noti(1, 1) < 0 )
121 * printf("Fail to set the brightness of the led\n");
125 int led_set_brightness_with_noti(int val, bool enable);
129 * This API is used to set command of the irled.\n
130 * It sets the command to control irled by calling device_set_property() function.\n
131 * @param[in] value string that you want to set
132 * @return 0 on success, negative value if failed
133 * @see led_set_brightness_with_noti()
137 * if( led_set_ir_command(("38000,173,171,24,...,1880") < 0 )
138 * printf("Fail to set the command of the irled\n");
142 int led_set_ir_command(char *value);
146 * This API is used to set LED mode with color.\n
147 * It sets the command to set LED mode by calling device_set_property() function.\n
148 * @param[in] mode LED mode
149 * @param[in] on enable/disable LED
150 * @param[in] color LED color
151 * @return 0 on success, -1 if failed
156 * if( led_set_mode_with_color(LED_LOW_BATTERY, 1, 0) < 0 )
157 * printf("Fail to set LED mode with color\n");
160 * @todo describe color
162 int led_set_mode_with_color(int mode, bool on, unsigned int color);
166 * This API is used to set LED mode with all option such as on/off duty and color.\n
167 * It sets the command to set LED mode by calling device_set_property() function.\n
168 * @param[in] mode LED mode
169 * @param[in] val enable/disable LED
170 * @param[in] on duty value (millisecond)
171 * @param[in] off duty value (millisecond)
172 * @param[in] color LED color
173 * @return 0 on success, -1 if failed
178 * if( led_set_mode_with_property(LED_LOW_BATTERY, true, 500, 5000, 0xFFFF0000) < 0 )
179 * printf("Fail to set LED mode with color\n");
182 * @todo describe color
184 int led_set_mode_with_property(int mode, bool val, int on, int off, unsigned int color);
187 * @} // end of CAPI_SYSTEM_DEVICED_LED_MODULE