|
Tizen HAL API
1.0
|
The Led provides functions to control the attached led device.
#include <hal-device-led.h>
The Led provides the way to control the attached LED device such as the camera flash and service LED. It supports to turn on the camera flash and set the pattern to the service LED which is located to the front of a device.
The Led functions provide led information including:
For more information on the Led features and the macros, see HAL Led programming guides and tutorials.
Typedefs | |
| typedef struct _hal_backend_device_led_funcs | hal_backend_device_led_funcs |
| Structure for Led functions by led device type. | |
| struct led_funcs |
Structure for Led functions.
Data Fields | |
| int(* | set_state )(hal_device_led_device_type_e type, hal_device_led_state_s *state) |
| int(* | get_number )(void) |
| void(* | set_num )(int number) |
| int(* | get_max_num )(void) |
| int(* | keyled_set_state )(hal_device_led_keyled_state_s *state) |
| int(* | keyled_get_state )(int *keycode, int *brightness) |
| int(* led_funcs::get_max_num)(void) |
Get max led number
| int(* led_funcs::get_number)(void) |
Get led number
| int(* led_funcs::keyled_get_state)(int *keycode, int *brightness) |
Get keyled state
| int(* led_funcs::keyled_set_state)(hal_device_led_keyled_state_s *state) |
Set keyled state
| void(* led_funcs::set_num)(int number) |
Set led number
| int(* led_funcs::set_state)(hal_device_led_device_type_e type, hal_device_led_state_s *state) |
Set led state
| struct _hal_backend_device_led_funcs |
Structure for Led functions by led device type.
Data Fields | |
| struct led_funcs * | camera_front |
| struct led_funcs * | camera_back |
| struct led_funcs * | notification |
| struct led_funcs * | touch_key |
Camera back led
Camera front led
Notification led
Touch key led
| struct hal_device_led_state_s |
Structure for device-led state information.
Data Fields | |
| hal_device_led_type_e | type |
| unsigned int | color |
| int | duty_on |
| int | duty_off |
| unsigned int hal_device_led_state_s::color |
The first byte means opaque and the other 3 bytes are RGB values. You can use opaque byte as a led brightness value. If the first byte is 0x00, led will be turned off. Anything else will be worked as on. The max value is 0xFF. Led color
Turn off time in milliseconds
Turn on time in milliseconds
| struct hal_device_led_keyled_state_s |
Structure for keyled state.
Data Fields | |
| int | keycode |
| int | brightness |
Brightness level
Key code
| typedef struct _hal_backend_device_led_funcs hal_backend_device_led_funcs |
Structure for Led functions by led device type.