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
60 #define led_set_brightness(val) \
61 led_set_brightness_with_noti(val, false)
63 #define led_set_mode(mode, on) \
64 led_set_mode_with_color(mode, on, 0)
68 * This API is used to get the current brightness of the led.\n
69 * It gets the current brightness of the led by calling device_get_property() function.\n
70 * It returns integer value which is the current brightness on success.\n
71 * Or a negative value(-1) is returned on failure.
72 * @return current brightness value on success, -1 if failed
73 * @see led_set_brightness_with_noti()
78 * cur_brt = led_get_brightness();
80 * printf("Fail to get the current brightness of the led.\n");
82 * printf("Current brightness of the led is %d\n", cur_brt);
86 int led_get_brightness(void);
90 * This API is used to get the max brightness of the led.\n
91 * It gets the max brightness of the led by calling device_get_property() function.\n
92 * It returns integer value which is the max brightness on success.\n
93 * Or a negative value(-1) is returned on failure
94 * @return max brightness value on success, -1 if failed
99 * max_brt = led_get_max_brightness();
101 * printf("Fail to get the max brightness of the led.\n");
105 int led_get_max_brightness(void);
109 * This API is used to set the current brightness of the led.\n
110 * It sets the current brightness of the led by calling device_set_property() function.\n
111 * @param[in] val brightness value that you want to set
112 * @param[in] enable noti
113 * @return 0 on success, -1 if failed
114 * @see led_get_brightness()
118 * if( led_set_brightness_with_noti(1, 1) < 0 )
119 * printf("Fail to set the brightness of the led\n");
123 int led_set_brightness_with_noti(int val, bool enable);
127 * This API is used to set command of the irled.\n
128 * It sets the command to control irled by calling device_set_property() function.\n
129 * @param[in] value string that you want to set
130 * @return 0 on success, -1 if failed
131 * @see led_set_brightness_with_noti()
135 * if( led_set_ir_command(("38000,173,171,24,...,1880") < 0 )
136 * printf("Fail to set the command of the irled\n");
140 int led_set_ir_command(char *value);
144 * This API is used to set LED mode with color.\n
145 * It sets the command to set LED mode by calling device_set_property() function.\n
146 * @param[in] mode LED mode
147 * @param[in] on enable/disable LED
148 * @param[in] color LED color
149 * @return 0 on success, -1 if failed
154 * if( led_set_mode_with_color(LED_LOW_BATTERY, 1, 0) < 0 )
155 * printf("Fail to set LED mode with color\n");
158 * @todo describe color
160 int led_set_mode_with_color(int mode, bool on, unsigned int color);
164 * This API is used to set LED mode with all option such as on/off duty and color.\n
165 * It sets the command to set LED mode by calling device_set_property() function.\n
166 * @param[in] mode LED mode
167 * @param[in] val enable/disable LED
168 * @param[in] on duty value (millisecond)
169 * @param[in] off duty value (millisecond)
170 * @param[in] color LED color
171 * @return 0 on success, -1 if failed
176 * if( led_set_mode_with_property(LED_LOW_BATTERY, true, 500, 5000, 0xFFFF0000) < 0 )
177 * printf("Fail to set LED mode with color\n");
180 * @todo describe color
182 int led_set_mode_with_property(int mode, bool val, int on, int off, unsigned int color);
185 * @} // end of CAPI_SYSTEM_DEVICED_LED_MODULE