Tizen HAL API  1.0
Led

The Led provides functions to control the attached led device.

Required Header

#include <hal-device-led.h>

Overview

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.

Data Structure Documentation

struct led_funcs

Structure for Led functions.

Since:
HAL_MODULE_DEVICE_LED 1.0

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)

Field Documentation

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

void(* led_funcs::set_num)(int number)

Set led number

struct _hal_backend_device_led_funcs

Structure for Led functions by led device type.

Since:
HAL_MODULE_DEVICE_LED 1.0

Data Fields

struct led_funcscamera_front
struct led_funcscamera_back
struct led_funcsnotification
struct led_funcstouch_key

Field Documentation

struct hal_device_led_state_s

Structure for device-led state information.

Since:
HAL_MODULE_DEVICE_LED 1.0

Data Fields

hal_device_led_type_e type
unsigned int color
int duty_on
int duty_off

Field Documentation

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.

Since:
HAL_MODULE_DEVICE_LED 1.0

Data Fields

int keycode
int brightness

Field Documentation


Typedef Documentation

Structure for Led functions by led device type.

Since:
HAL_MODULE_DEVICE_LED 1.0

Enumeration Type Documentation

Enumeration for the type of led devices.

Since:
HAL_MODULE_DEVICE_LED 1.0
Enumerator:
HAL_DEVICE_LED_CAMERA_FRONT 

Front camera LED device

HAL_DEVICE_LED_CAMERA_BACK 

Rear camera LED device

HAL_DEVICE_LED_NOTIFICATION 

Notification LED device

HAL_DEVICE_LED_TOUCH_KEY 

Touch key LED device

Enumeration for device-led state.

Since:
HAL_MODULE_DEVICE_LED 1.0
Enumerator:
HAL_DEVICE_LED_TYPE_MANUAL 

This indicates LED is in manual control mode

HAL_DEVICE_LED_TYPE_BLINK 

This indicates LED blinking mode