SET(INC_DIR include)
INCLUDE_DIRECTORIES(${INC_DIR})
-INCLUDE_DIRECTORIES(${INC_DIR}/backend)
SET(PKG_MODULES
dlog
FILES_MATCHING
PATTERN "${INC_DIR}/hal-*.h"
)
-INSTALL(
- DIRECTORY ${INC_DIR}/backend/ DESTINATION include/hal/device
- FILES_MATCHING
- PATTERN "${INC_DIR}/backend/hal-*.h"
-)
SET(PC_NAME ${fw_name})
SET(PC_REQUIRED ${pc_dependents})
+++ /dev/null
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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.
- */
-
-
-#ifndef __HAL_BATTERY_INTERFACE_H__
-#define __HAL_BATTERY_INTERFACE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * The id of this device
- */
-#define BATTERY_HARDWARE_DEVICE_ID "battery"
-
-#define POWER_SOURCE_NONE "none"
-#define POWER_SOURCE_AC "ac"
-#define POWER_SOURCE_USB "usb"
-#define POWER_SOURCE_WIRELESS "wireless"
-
-struct battery_info {
- char *name;
- char *status;
- char *health;
- char *power_source;
-
- int online;
- int present;
- int capacity;
-
- int current_now;
- int current_average;
- int voltage_now;
- int voltage_average;
- int temperature;
-};
-
-typedef void (*BatteryUpdated)(struct battery_info *info, void *data);
-
-typedef struct _hal_backend_battery_funcs {
- /* Register battery event */
- int (*register_changed_event)(BatteryUpdated updated_cb, void *data);
- void (*unregister_changed_event)(BatteryUpdated updated_cb);
-
- /* Get current states */
- int (*get_current_state)(BatteryUpdated updated_cb, void *data);
-} hal_backend_battery_funcs;
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __HAL_BATTERY_INTERFACE_H__ */
+++ /dev/null
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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.
- */
-
-
-#ifndef __HAL_BEZEL_INTERFACE_H__
-#define __HAL_BEZEL_INTERFACE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-enum bezel_state {
- BEZEL_TURNOFF = 0,
- BEZEL_TURNON,
-};
-
-enum bezel_vib_state {
- BEZEL_VIB_NONE = 0,
- BEZEL_VIB_LIGHT,
- BEZEL_VIB_MEDIUM,
- BEZEL_VIB_STRONG,
-};
-
-typedef struct _hal_backend_bezel_funcs {
- /* Control hardware bezel state */
- int (*get_state)(enum bezel_state *state);
- int (*set_state)(enum bezel_state state);
- /* Control software bezel state */
- int (*get_sw_state)(enum bezel_state *state);
- int (*set_sw_state)(enum bezel_state state);
-
- /* Control bezel vibration state */
- int (*get_vib_state)(enum bezel_vib_state *state);
- int (*set_vib_state)(enum bezel_vib_state state);
-} hal_backend_bezel_funcs;
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __HAL_BEZEL_INTERFACE_H__ */
+++ /dev/null
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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.
- */
-
-
-#ifndef __HAL_BOARD_INTERFACE_H__
-#define __HAL_BOARD_INTERFACE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct _hal_backend_board_funcs {
- /* Serial number of this device */
- int (*get_device_serial_number)(char *buffer, const int max_len);
- int (*get_device_revision)(int *revision);
-
- int (*set_boot_success)(void);
- int (*clear_boot_mode)(void);
- int (*get_boot_mode)(char *buffer, const int max_len);
- int (*get_boot_reason)(char *buffer, const int max_len);
-
- int (*get_current_partition)(char *partition_ab);
- int (*switch_partition)(char partition_ab);
- int (*set_partition_ab_cloned)(void);
- int (*clear_partition_ab_cloned)(void);
- int (*get_partition_ab_cloned)(int *cloned);
- int (*set_partition_status)(char partition_ab, const char *status);
- int (*get_partition_status)(char partition_ab, char *buffer, const int max_len);
-
- int (*set_upgrade_status)(int status);
- int (*get_upgrade_status)(int *status);
-
-} hal_backend_board_funcs;
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __HAL_BOARD_INTERFACE_H__ */
+++ /dev/null
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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.
- */
-
-#ifndef __HAL_DEVICE_INPUT_INTERFACE_H__
-#define __HAL_DEVICE_INPUT_INTERFACE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef enum {
- HAL_DEVICE_INPUT_TYPE_UNKNOWN = 0, /**< Input device type which is not defined. */
- HAL_DEVICE_INPUT_TYPE_ALL, /**< Input device type which is all kinds of input devices */
- HAL_DEVICE_INPUT_TYPE_MOUSE, /**< Input device type which is mouse-type */
- HAL_DEVICE_INPUT_TYPE_KEYBOARD, /**< Input device type which is keyboard-type */
- HAL_DEVICE_INPUT_TYPE_TOUCHSCREEN, /**< Input device type which is touchscreen-type */
-
- HAL_DEVICE_INPUT_TYPE_CUSTOM_KNOB = 1000, /**< Input device type which is customed knob-type */
-} hal_device_input_type;
-
-typedef struct _hal_backend_device_input_funcs {
- /* Control input device event */
- int (*set_event_state)(int input_device_id, int on);
- int (*get_event_state)(int input_device_id, int* on);
-} hal_backend_device_input_funcs;
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __HAL_DEVICE_INPUT_INTERFACE_H__ */
+++ /dev/null
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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.
- */
-
-#ifndef __HAL_DEVICE_POWER_INTERFACE_H__
-#define __HAL_DEVICE_POWER_INTERFACE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-enum hal_device_power_transition_reason {
- HAL_DEVICE_POWER_TRANSITION_REASON_UNKNOWN,
- HAL_DEVICE_POWER_TRANSITION_REASON_POWER_KEY,
- HAL_DEVICE_POWER_TRANSITION_REASON_VOLUME_UP_KEY,
- HAL_DEVICE_POWER_TRANSITION_REASON_VOLUME_DOWN_KEY,
- HAL_DEVICE_POWER_TRANSITION_REASON_BATTERY_NORMAL_LEVEL,
- HAL_DEVICE_POWER_TRANSITION_REASON_BATTERY_WARNING_LEVEL,
- HAL_DEVICE_POWER_TRANSITION_REASON_BATTERY_CRITICAL_LEVEL,
- HAL_DEVICE_POWER_TRANSITION_REASON_BATTERY_POWEROFF_LEVEL,
- HAL_DEVICE_POWER_TRANSITION_REASON_DISPLAY_OFF,
- HAL_DEVICE_POWER_TRANSITION_REASON_DISPLAY_OFF_TIMEOUT,
- HAL_DEVICE_POWER_TRANSITION_REASON_TOUCH_KEY,
- HAL_DEVICE_POWER_TRANSITION_REASON_TOUCH_SCREEN,
- HAL_DEVICE_POWER_TRANSITION_REASON_USB,
- HAL_DEVICE_POWER_TRANSITION_REASON_CHARGER,
- HAL_DEVICE_POWER_TRANSITION_REASON_HDMI,
- HAL_DEVICE_POWER_TRANSITION_REASON_DISPLAY_PORT,
- HAL_DEVICE_POWER_TRANSITION_REASON_EMBEDDED_DISPLAY_PORT,
- HAL_DEVICE_POWER_TRANSITION_REASON_WIFI,
- HAL_DEVICE_POWER_TRANSITION_REASON_BLUETOOTH,
- HAL_DEVICE_POWER_TRANSITION_REASON_NFC,
- HAL_DEVICE_POWER_TRANSITION_REASON_TELEPHONY,
- HAL_DEVICE_POWER_TRANSITION_REASON_ZIGBEE,
- HAL_DEVICE_POWER_TRANSITION_REASON_ETHERNET,
- HAL_DEVICE_POWER_TRANSITION_REASON_AUDIO,
- HAL_DEVICE_POWER_TRANSITION_REASON_ALARM,
- HAL_DEVICE_POWER_TRANSITION_REASON_SENSOR,
- HAL_DEVICE_POWER_TRANSITION_REASON_RTC,
- HAL_DEVICE_POWER_TRANSITION_REASON_HEADSET,
- HAL_DEVICE_POWER_TRANSITION_REASON_EXTERNAL_MEMORY,
-
- HAL_DEVICE_POWER_TRANSITION_REASON_CUSTOM = 1000, /**< Define custom reason from here */
-};
-
-typedef struct _hal_backend_device_power_funcs {
- int (*get_wakeup_reason)(enum hal_device_power_transition_reason *reason);
-} hal_backend_device_power_funcs;
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __HAL_DEVICE_POWER_INTERFACE_H__ */
+++ /dev/null
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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.
- */
-
-
-#ifndef __HAL_DISPLAY_INTERFACE_H__
-#define __HAL_DISPLAY_INTERFACE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-enum display_state {
- DISPLAY_ON, /* In use */
- DISPLAY_STANDBY, /* Blanked, low power */
- DISPLAY_SUSPEND, /* Blanked, lower power */
- DISPLAY_OFF, /* Shut off, awaiting activity */
- DISPLAY_DETACH, /* Detached display at runtime */
-};
-
-enum display_image_effect {
- DISPLAY_IMAGE_EFFECT_STANDARD, /* No effect */
- DISPLAY_IMAGE_EFFECT_NEGATIVE, /* Negative effect */
- DISPLAY_IMAGE_EFFECT_GREY, /* Grey effect */
- DISPLAY_IMAGE_EFFECT_GREY_NEGATIVE, /* Grey Negative effect */
- DISPLAY_IMAGE_EFFECT_MAX,
-};
-
-enum display_panel_mode {
- DISPLAY_PANEL_MODE_STANDARD, /* Standard mode */
- DISPLAY_PANEL_MODE_OUTDOOR, /* Outdoor mode */
- DISPLAY_PANEL_MODE_CONTENTS, /* Contents adaptive brightness control mode */
- DISPLAY_PANEL_MODE_LOWPOWER, /* Low power mode */
-};
-
-enum display_aod_mode {
- DISPLAY_AOD_MODE_OFF,
- DISPLAY_AOD_MODE_ON,
-};
-
-enum hal_display_white_balance {
- HAL_DISPLAY_WHITE_BALANCE_R_GAIN,
- HAL_DISPLAY_WHITE_BALANCE_G_GAIN,
- HAL_DISPLAY_WHITE_BALANCE_B_GAIN,
- HAL_DISPLAY_WHITE_BALANCE_R_OFFSET,
- HAL_DISPLAY_WHITE_BALANCE_G_OFFSET,
- HAL_DISPLAY_WHITE_BALANCE_B_OFFSET,
-};
-
-enum hal_device_display_rotation_angle {
- HAL_DEVICE_DISPLAY_ROTATION_ANGLE_UNKNOWN = -1,
- HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_0 = 0,
- HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_90 = 90,
- HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_180 = 180,
- HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_270 = 270,
-};
-
-enum hal_device_display_rotation_direction {
- HAL_DEVICE_DISPLAY_ROTATION_DIRECTION_CLOCKWISE,
- HAL_DEVICE_DISPLAY_ROTATION_DIRECTION_COUNTER_CLOCKWISE,
-};
-
-typedef struct _hal_backend_display_funcs {
- /* Control display brightness */
- int (*get_max_brightness)(int *brightness);
- int (*get_brightness)(int *brightness);
- int (*set_brightness)(int brightness);
- int (*set_multi_brightness)(int brightness, int step, int delay);
-
- /* Control display brightness by sensor */
- int (*get_auto_brightness)(float lmax, float lmin, float light, int *brightness);
-
- /* Control display state */
- int (*get_state)(enum display_state *state);
- int (*set_state)(enum display_state state);
-
- /* Control image effect */
- int (*get_image_effect)(enum display_image_effect *effect);
- int (*set_image_effect)(enum display_image_effect effect);
-
- /* Control panel mode */
- int (*get_panel_mode)(enum display_panel_mode *mode);
- int (*set_panel_mode)(enum display_panel_mode mode);
-
- /* Control AOD mode */
- int (*get_aod_mode)(enum display_aod_mode *mode);
-
- /* Control AOD brightness */
- int (*get_aod_brightness)(int *max, int *normal, int *min, int *charging);
-
- /* Control display frame rate */
- int (*get_max_frame_rate)(int *rate);
- int (*get_min_frame_rate)(int *rate);
- int (*get_frame_rate)(int *rate);
- int (*set_frame_rate)(int rate);
-
- /* Control display white balance */
- int (*set_white_balance)(enum hal_display_white_balance, int value);
- int (*get_white_balance)(enum hal_display_white_balance, int *value);
-
- /* Control display rotation angle */
- int (*get_rotation_angle)(int display_index, enum hal_device_display_rotation_angle *angle);
- int (*set_rotation_angle)(int display_index, enum hal_device_display_rotation_angle angle, enum hal_device_display_rotation_direction direction);
-} hal_backend_display_funcs;
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __HAL_DISPLAY_INTERFACE_H__ */
+++ /dev/null
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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.
- */
-
-
-#ifndef __HAL_EXTERNAL_CONNECTION_INTERFACE_H__
-#define __HAL_EXTERNAL_CONNECTION_INTERFACE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define EXTERNAL_CONNECTION_USB "USB"
-#define EXTERNAL_CONNECTION_USB_HOST "USB-HOST"
-#define EXTERNAL_CONNECTION_TA "TA"
-#define EXTERNAL_CONNECTION_HDMI "HDMI"
-#define EXTERNAL_CONNECTION_DOCK "Dock"
-#define EXTERNAL_CONNECTION_MIC "Microphone"
-#define EXTERNAL_CONNECTION_HEADPHONE "Headphone"
-
-struct connection_info {
- char *name;
- char *state;
- int flags;
-};
-
-typedef void (*ConnectionUpdated)(struct connection_info *info, void *data);
-
-typedef struct _hal_backend_external_connection_funcs {
- /* Register external_connection event */
- int (*register_changed_event)(ConnectionUpdated updated_cb, void *data);
- void (*unregister_changed_event)(ConnectionUpdated updated_cb);
-
- /* Get current states */
- int (*get_current_state)(ConnectionUpdated updated_cb, void *data);
-} hal_backend_external_connection_funcs;
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __HAL_EXTERNAL_CONNECTION_INTERFACE_H__ */
+++ /dev/null
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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.
- */
-
-
-#ifndef __HAL_HAPTIC_INTERFACE_H__
-#define __HAL_HAPTIC_INTERFACE_H__
-
-#include <hal/hal-common-interface.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @brief Enumerations of unlimited duration for the Haptic Module API.
- */
-typedef enum {
- HAPTIC_MODULE_DURATION_UNLIMITED = 0x7FFFFFFF,
-} haptic_module_duration;
-
-typedef struct _hal_backend_haptic_funcs {
- int (*get_device_count)(int *count);
- int (*open_device)(int *dev_handle);
- int (*close_device)(int dev_handle);
- bool (*is_valid)(void);
- int (*vibrate_monotone)(int device_handle, int duration, int frequency, int overdrive, int level, int intensity, int priority);
- int (*stop_device)(int dev_handle);
-} hal_backend_haptic_funcs;
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __HAL_HAPTIC_INTERFACE_H__ */
+++ /dev/null
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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.
- */
-
-
-#ifndef __HAL_IR_INTERFACE_H__
-#define __HAL_IR_INTERFACE_H__
-
-#include "hal-ir.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct _hal_backend_ir_funcs {
- /* Control ir state */
- int (*is_available)(bool *available);
- int (*transmit)(int *frequency_pattern, int size);
-} hal_backend_ir_funcs;
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __HAL_IR_INTERFACE_H__ */
+++ /dev/null
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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.
- */
-
-#ifndef __HAL_LED_INTERFACE_H__
-#define __HAL_LED_INTERFACE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-enum led_type {
- LED_TYPE_MANUAL,
- LED_TYPE_BLINK,
-};
-
-enum led_device_type {
- CAMERA_FRONT,
- CAMERA_BACK,
- NOTIFICATION,
- TOUCH_KEY,
-};
-
-struct led_state {
- /* Led type */
- enum led_type type;
- /**
- * 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.
- */
- unsigned int color;
- /* Turn on time in milliseconds */
- int duty_on;
- /* Turn off time in milliseconds */
- int duty_off;
-};
-
-struct keyled_state {
- int keycode;
- int brightness;
-};
-
-struct led_funcs {
- /* Set led state */
- int (*set_state)(enum led_device_type type, struct led_state *state);
-
- /* Get led state */
- int (*get_state)(enum led_device_type type, struct led_state **state);
-
- /* Get led number */
- int (*get_number)(void);
-
- /* Set led number */
- void (*set_num)(int number);
-
- /* Get max led number */
- int (*get_max_num)(void);
-
- /* Set keyled state */
- int (*keyled_set_state)(struct keyled_state *state);
-
- /* Get keyled state */
- int (*keyled_get_state)(int *keycode, int *brightness);
-};
-
-typedef struct _hal_backend_led_funcs {
- struct led_funcs *camera_front;
- struct led_funcs *camera_back;
- struct led_funcs *notification;
- struct led_funcs *touch_key;
-} hal_backend_led_funcs;
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __HAL_LED_INTERFACE_H__ */
+++ /dev/null
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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.
- */
-
-
-#ifndef __HAL_MEMORY_INTERFACE_H__
-#define __HAL_MEMORY_INTERFACE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct gpu_info {
- int used_pages;
-};
-
-struct gem_info {
- int rss;
- int pss;
-};
-
-typedef struct __hal_backend_memory_funcs {
- int (*get_gpu_info)(const int pid, struct gpu_info *info);
- int (*get_gem_info)(const int pid, struct gem_info *info);
-} hal_backend_memory_funcs;
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __HAL_MEMORY_INTERFACE_H__ */
+++ /dev/null
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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.
- */
-
-
-#ifndef __HAL_TEMPERATURE_INTERFACE_H__
-#define __HAL_TEMPERATURE_INTERFACE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef enum
-{
- HAL_DEVICE_THERMAL_AP, /* AP temperature */
- HAL_DEVICE_THERMAL_CP, /* CP temperature */
- HAL_DEVICE_THERMAL_BATTERY, /* Battery temperature */
-} hal_device_thermal_e;
-
-struct thermal_info {
- int temp;
- int adc;
-};
-
-typedef void (*ThermalUpdated)(struct thermal_info *info, void *data);
-
-typedef struct _hal_backend_thermal_funcs {
- /* Get thermal state */
- int (*get_info)(hal_device_thermal_e type, struct thermal_info *info);
-
- /* Register thermal event */
- int (*register_changed_event)(ThermalUpdated updated_cb, void *data);
- int (*unregister_changed_event)(ThermalUpdated updated_cb);
-} hal_backend_thermal_funcs;
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __HAL_TEMPERATURE_INTERFACE_H__ */
+++ /dev/null
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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.
- */
-
-
-#ifndef __HAL_TOUCHSCREEN_INTERFACE_H__
-#define __HAL_TOUCHSCREEN_INTERFACE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define TOUCHSENSITIVITY_GLOVE_MODE_OFF 0 /* Disable glove mode */
-#define TOUCHSENSITIVITY_GLOVE_MODE_ON 1 /* Enable glove mode */
-
-enum touchscreen_state {
- TOUCHSCREEN_OFF, /* Disable touchscreen */
- TOUCHSCREEN_ON, /* Enable touchscreen */
-};
-
-enum touchscreen_sensitivity_state {
- GLOVE_MODE_OFF, /* Disable glove mode */
- GLOVE_MODE_ON, /* Enable glove mode */
-};
-
-typedef struct _hal_backend_touchscreen_funcs {
- /* Control touchscreen state */
- int (*get_state)(enum touchscreen_state *state);
- int (*set_state)(enum touchscreen_state state);
- int (*get_powersaving)(int *state);
- int (*set_powersaving)(int state);
-
- /* Control touch sensitivity state */
- int (*glove_mode_get_state)(int *state);
- int (*glove_mode_set_state)(int state);
-} hal_backend_touchscreen_funcs;
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __HAL_TOUCHSCREEN_INTERFACE_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+
+#ifndef __HAL_BATTERY_INTERFACE_H__
+#define __HAL_BATTERY_INTERFACE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * The id of this device
+ */
+#define BATTERY_HARDWARE_DEVICE_ID "battery"
+
+#define POWER_SOURCE_NONE "none"
+#define POWER_SOURCE_AC "ac"
+#define POWER_SOURCE_USB "usb"
+#define POWER_SOURCE_WIRELESS "wireless"
+
+struct battery_info {
+ char *name;
+ char *status;
+ char *health;
+ char *power_source;
+
+ int online;
+ int present;
+ int capacity;
+
+ int current_now;
+ int current_average;
+ int voltage_now;
+ int voltage_average;
+ int temperature;
+};
+
+typedef void (*BatteryUpdated)(struct battery_info *info, void *data);
+
+typedef struct _hal_backend_battery_funcs {
+ /* Register battery event */
+ int (*register_changed_event)(BatteryUpdated updated_cb, void *data);
+ void (*unregister_changed_event)(BatteryUpdated updated_cb);
+
+ /* Get current states */
+ int (*get_current_state)(BatteryUpdated updated_cb, void *data);
+} hal_backend_battery_funcs;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_BATTERY_INTERFACE_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+
+#ifndef __HAL_BEZEL_INTERFACE_H__
+#define __HAL_BEZEL_INTERFACE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum bezel_state {
+ BEZEL_TURNOFF = 0,
+ BEZEL_TURNON,
+};
+
+enum bezel_vib_state {
+ BEZEL_VIB_NONE = 0,
+ BEZEL_VIB_LIGHT,
+ BEZEL_VIB_MEDIUM,
+ BEZEL_VIB_STRONG,
+};
+
+typedef struct _hal_backend_bezel_funcs {
+ /* Control hardware bezel state */
+ int (*get_state)(enum bezel_state *state);
+ int (*set_state)(enum bezel_state state);
+ /* Control software bezel state */
+ int (*get_sw_state)(enum bezel_state *state);
+ int (*set_sw_state)(enum bezel_state state);
+
+ /* Control bezel vibration state */
+ int (*get_vib_state)(enum bezel_vib_state *state);
+ int (*set_vib_state)(enum bezel_vib_state state);
+} hal_backend_bezel_funcs;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_BEZEL_INTERFACE_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+
+#ifndef __HAL_BOARD_INTERFACE_H__
+#define __HAL_BOARD_INTERFACE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct _hal_backend_board_funcs {
+ /* Serial number of this device */
+ int (*get_device_serial_number)(char *buffer, const int max_len);
+ int (*get_device_revision)(int *revision);
+
+ int (*set_boot_success)(void);
+ int (*clear_boot_mode)(void);
+ int (*get_boot_mode)(char *buffer, const int max_len);
+ int (*get_boot_reason)(char *buffer, const int max_len);
+
+ int (*get_current_partition)(char *partition_ab);
+ int (*switch_partition)(char partition_ab);
+ int (*set_partition_ab_cloned)(void);
+ int (*clear_partition_ab_cloned)(void);
+ int (*get_partition_ab_cloned)(int *cloned);
+ int (*set_partition_status)(char partition_ab, const char *status);
+ int (*get_partition_status)(char partition_ab, char *buffer, const int max_len);
+
+ int (*set_upgrade_status)(int status);
+ int (*get_upgrade_status)(int *status);
+
+} hal_backend_board_funcs;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_BOARD_INTERFACE_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#ifndef __HAL_DEVICE_INPUT_INTERFACE_H__
+#define __HAL_DEVICE_INPUT_INTERFACE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum {
+ HAL_DEVICE_INPUT_TYPE_UNKNOWN = 0, /**< Input device type which is not defined. */
+ HAL_DEVICE_INPUT_TYPE_ALL, /**< Input device type which is all kinds of input devices */
+ HAL_DEVICE_INPUT_TYPE_MOUSE, /**< Input device type which is mouse-type */
+ HAL_DEVICE_INPUT_TYPE_KEYBOARD, /**< Input device type which is keyboard-type */
+ HAL_DEVICE_INPUT_TYPE_TOUCHSCREEN, /**< Input device type which is touchscreen-type */
+
+ HAL_DEVICE_INPUT_TYPE_CUSTOM_KNOB = 1000, /**< Input device type which is customed knob-type */
+} hal_device_input_type;
+
+typedef struct _hal_backend_device_input_funcs {
+ /* Control input device event */
+ int (*set_event_state)(int input_device_id, int on);
+ int (*get_event_state)(int input_device_id, int* on);
+} hal_backend_device_input_funcs;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_DEVICE_INPUT_INTERFACE_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#ifndef __HAL_DEVICE_POWER_INTERFACE_H__
+#define __HAL_DEVICE_POWER_INTERFACE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum hal_device_power_transition_reason {
+ HAL_DEVICE_POWER_TRANSITION_REASON_UNKNOWN,
+ HAL_DEVICE_POWER_TRANSITION_REASON_POWER_KEY,
+ HAL_DEVICE_POWER_TRANSITION_REASON_VOLUME_UP_KEY,
+ HAL_DEVICE_POWER_TRANSITION_REASON_VOLUME_DOWN_KEY,
+ HAL_DEVICE_POWER_TRANSITION_REASON_BATTERY_NORMAL_LEVEL,
+ HAL_DEVICE_POWER_TRANSITION_REASON_BATTERY_WARNING_LEVEL,
+ HAL_DEVICE_POWER_TRANSITION_REASON_BATTERY_CRITICAL_LEVEL,
+ HAL_DEVICE_POWER_TRANSITION_REASON_BATTERY_POWEROFF_LEVEL,
+ HAL_DEVICE_POWER_TRANSITION_REASON_DISPLAY_OFF,
+ HAL_DEVICE_POWER_TRANSITION_REASON_DISPLAY_OFF_TIMEOUT,
+ HAL_DEVICE_POWER_TRANSITION_REASON_TOUCH_KEY,
+ HAL_DEVICE_POWER_TRANSITION_REASON_TOUCH_SCREEN,
+ HAL_DEVICE_POWER_TRANSITION_REASON_USB,
+ HAL_DEVICE_POWER_TRANSITION_REASON_CHARGER,
+ HAL_DEVICE_POWER_TRANSITION_REASON_HDMI,
+ HAL_DEVICE_POWER_TRANSITION_REASON_DISPLAY_PORT,
+ HAL_DEVICE_POWER_TRANSITION_REASON_EMBEDDED_DISPLAY_PORT,
+ HAL_DEVICE_POWER_TRANSITION_REASON_WIFI,
+ HAL_DEVICE_POWER_TRANSITION_REASON_BLUETOOTH,
+ HAL_DEVICE_POWER_TRANSITION_REASON_NFC,
+ HAL_DEVICE_POWER_TRANSITION_REASON_TELEPHONY,
+ HAL_DEVICE_POWER_TRANSITION_REASON_ZIGBEE,
+ HAL_DEVICE_POWER_TRANSITION_REASON_ETHERNET,
+ HAL_DEVICE_POWER_TRANSITION_REASON_AUDIO,
+ HAL_DEVICE_POWER_TRANSITION_REASON_ALARM,
+ HAL_DEVICE_POWER_TRANSITION_REASON_SENSOR,
+ HAL_DEVICE_POWER_TRANSITION_REASON_RTC,
+ HAL_DEVICE_POWER_TRANSITION_REASON_HEADSET,
+ HAL_DEVICE_POWER_TRANSITION_REASON_EXTERNAL_MEMORY,
+
+ HAL_DEVICE_POWER_TRANSITION_REASON_CUSTOM = 1000, /**< Define custom reason from here */
+};
+
+typedef struct _hal_backend_device_power_funcs {
+ int (*get_wakeup_reason)(enum hal_device_power_transition_reason *reason);
+} hal_backend_device_power_funcs;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_DEVICE_POWER_INTERFACE_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+
+#ifndef __HAL_DISPLAY_INTERFACE_H__
+#define __HAL_DISPLAY_INTERFACE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum display_state {
+ DISPLAY_ON, /* In use */
+ DISPLAY_STANDBY, /* Blanked, low power */
+ DISPLAY_SUSPEND, /* Blanked, lower power */
+ DISPLAY_OFF, /* Shut off, awaiting activity */
+ DISPLAY_DETACH, /* Detached display at runtime */
+};
+
+enum display_image_effect {
+ DISPLAY_IMAGE_EFFECT_STANDARD, /* No effect */
+ DISPLAY_IMAGE_EFFECT_NEGATIVE, /* Negative effect */
+ DISPLAY_IMAGE_EFFECT_GREY, /* Grey effect */
+ DISPLAY_IMAGE_EFFECT_GREY_NEGATIVE, /* Grey Negative effect */
+ DISPLAY_IMAGE_EFFECT_MAX,
+};
+
+enum display_panel_mode {
+ DISPLAY_PANEL_MODE_STANDARD, /* Standard mode */
+ DISPLAY_PANEL_MODE_OUTDOOR, /* Outdoor mode */
+ DISPLAY_PANEL_MODE_CONTENTS, /* Contents adaptive brightness control mode */
+ DISPLAY_PANEL_MODE_LOWPOWER, /* Low power mode */
+};
+
+enum display_aod_mode {
+ DISPLAY_AOD_MODE_OFF,
+ DISPLAY_AOD_MODE_ON,
+};
+
+enum hal_display_white_balance {
+ HAL_DISPLAY_WHITE_BALANCE_R_GAIN,
+ HAL_DISPLAY_WHITE_BALANCE_G_GAIN,
+ HAL_DISPLAY_WHITE_BALANCE_B_GAIN,
+ HAL_DISPLAY_WHITE_BALANCE_R_OFFSET,
+ HAL_DISPLAY_WHITE_BALANCE_G_OFFSET,
+ HAL_DISPLAY_WHITE_BALANCE_B_OFFSET,
+};
+
+enum hal_device_display_rotation_angle {
+ HAL_DEVICE_DISPLAY_ROTATION_ANGLE_UNKNOWN = -1,
+ HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_0 = 0,
+ HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_90 = 90,
+ HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_180 = 180,
+ HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_270 = 270,
+};
+
+enum hal_device_display_rotation_direction {
+ HAL_DEVICE_DISPLAY_ROTATION_DIRECTION_CLOCKWISE,
+ HAL_DEVICE_DISPLAY_ROTATION_DIRECTION_COUNTER_CLOCKWISE,
+};
+
+typedef struct _hal_backend_display_funcs {
+ /* Control display brightness */
+ int (*get_max_brightness)(int *brightness);
+ int (*get_brightness)(int *brightness);
+ int (*set_brightness)(int brightness);
+ int (*set_multi_brightness)(int brightness, int step, int delay);
+
+ /* Control display brightness by sensor */
+ int (*get_auto_brightness)(float lmax, float lmin, float light, int *brightness);
+
+ /* Control display state */
+ int (*get_state)(enum display_state *state);
+ int (*set_state)(enum display_state state);
+
+ /* Control image effect */
+ int (*get_image_effect)(enum display_image_effect *effect);
+ int (*set_image_effect)(enum display_image_effect effect);
+
+ /* Control panel mode */
+ int (*get_panel_mode)(enum display_panel_mode *mode);
+ int (*set_panel_mode)(enum display_panel_mode mode);
+
+ /* Control AOD mode */
+ int (*get_aod_mode)(enum display_aod_mode *mode);
+
+ /* Control AOD brightness */
+ int (*get_aod_brightness)(int *max, int *normal, int *min, int *charging);
+
+ /* Control display frame rate */
+ int (*get_max_frame_rate)(int *rate);
+ int (*get_min_frame_rate)(int *rate);
+ int (*get_frame_rate)(int *rate);
+ int (*set_frame_rate)(int rate);
+
+ /* Control display white balance */
+ int (*set_white_balance)(enum hal_display_white_balance, int value);
+ int (*get_white_balance)(enum hal_display_white_balance, int *value);
+
+ /* Control display rotation angle */
+ int (*get_rotation_angle)(int display_index, enum hal_device_display_rotation_angle *angle);
+ int (*set_rotation_angle)(int display_index, enum hal_device_display_rotation_angle angle, enum hal_device_display_rotation_direction direction);
+} hal_backend_display_funcs;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_DISPLAY_INTERFACE_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+
+#ifndef __HAL_EXTERNAL_CONNECTION_INTERFACE_H__
+#define __HAL_EXTERNAL_CONNECTION_INTERFACE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define EXTERNAL_CONNECTION_USB "USB"
+#define EXTERNAL_CONNECTION_USB_HOST "USB-HOST"
+#define EXTERNAL_CONNECTION_TA "TA"
+#define EXTERNAL_CONNECTION_HDMI "HDMI"
+#define EXTERNAL_CONNECTION_DOCK "Dock"
+#define EXTERNAL_CONNECTION_MIC "Microphone"
+#define EXTERNAL_CONNECTION_HEADPHONE "Headphone"
+
+struct connection_info {
+ char *name;
+ char *state;
+ int flags;
+};
+
+typedef void (*ConnectionUpdated)(struct connection_info *info, void *data);
+
+typedef struct _hal_backend_external_connection_funcs {
+ /* Register external_connection event */
+ int (*register_changed_event)(ConnectionUpdated updated_cb, void *data);
+ void (*unregister_changed_event)(ConnectionUpdated updated_cb);
+
+ /* Get current states */
+ int (*get_current_state)(ConnectionUpdated updated_cb, void *data);
+} hal_backend_external_connection_funcs;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_EXTERNAL_CONNECTION_INTERFACE_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+
+#ifndef __HAL_HAPTIC_INTERFACE_H__
+#define __HAL_HAPTIC_INTERFACE_H__
+
+#include <hal/hal-common-interface.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Enumerations of unlimited duration for the Haptic Module API.
+ */
+typedef enum {
+ HAPTIC_MODULE_DURATION_UNLIMITED = 0x7FFFFFFF,
+} haptic_module_duration;
+
+typedef struct _hal_backend_haptic_funcs {
+ int (*get_device_count)(int *count);
+ int (*open_device)(int *dev_handle);
+ int (*close_device)(int dev_handle);
+ bool (*is_valid)(void);
+ int (*vibrate_monotone)(int device_handle, int duration, int frequency, int overdrive, int level, int intensity, int priority);
+ int (*stop_device)(int dev_handle);
+} hal_backend_haptic_funcs;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_HAPTIC_INTERFACE_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+
+#ifndef __HAL_IR_INTERFACE_H__
+#define __HAL_IR_INTERFACE_H__
+
+#include "hal-ir.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct _hal_backend_ir_funcs {
+ /* Control ir state */
+ int (*is_available)(bool *available);
+ int (*transmit)(int *frequency_pattern, int size);
+} hal_backend_ir_funcs;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_IR_INTERFACE_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#ifndef __HAL_LED_INTERFACE_H__
+#define __HAL_LED_INTERFACE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum led_type {
+ LED_TYPE_MANUAL,
+ LED_TYPE_BLINK,
+};
+
+enum led_device_type {
+ CAMERA_FRONT,
+ CAMERA_BACK,
+ NOTIFICATION,
+ TOUCH_KEY,
+};
+
+struct led_state {
+ /* Led type */
+ enum led_type type;
+ /**
+ * 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.
+ */
+ unsigned int color;
+ /* Turn on time in milliseconds */
+ int duty_on;
+ /* Turn off time in milliseconds */
+ int duty_off;
+};
+
+struct keyled_state {
+ int keycode;
+ int brightness;
+};
+
+struct led_funcs {
+ /* Set led state */
+ int (*set_state)(enum led_device_type type, struct led_state *state);
+
+ /* Get led state */
+ int (*get_state)(enum led_device_type type, struct led_state **state);
+
+ /* Get led number */
+ int (*get_number)(void);
+
+ /* Set led number */
+ void (*set_num)(int number);
+
+ /* Get max led number */
+ int (*get_max_num)(void);
+
+ /* Set keyled state */
+ int (*keyled_set_state)(struct keyled_state *state);
+
+ /* Get keyled state */
+ int (*keyled_get_state)(int *keycode, int *brightness);
+};
+
+typedef struct _hal_backend_led_funcs {
+ struct led_funcs *camera_front;
+ struct led_funcs *camera_back;
+ struct led_funcs *notification;
+ struct led_funcs *touch_key;
+} hal_backend_led_funcs;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_LED_INTERFACE_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+
+#ifndef __HAL_MEMORY_INTERFACE_H__
+#define __HAL_MEMORY_INTERFACE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct gpu_info {
+ int used_pages;
+};
+
+struct gem_info {
+ int rss;
+ int pss;
+};
+
+typedef struct __hal_backend_memory_funcs {
+ int (*get_gpu_info)(const int pid, struct gpu_info *info);
+ int (*get_gem_info)(const int pid, struct gem_info *info);
+} hal_backend_memory_funcs;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_MEMORY_INTERFACE_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+
+#ifndef __HAL_TEMPERATURE_INTERFACE_H__
+#define __HAL_TEMPERATURE_INTERFACE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum
+{
+ HAL_DEVICE_THERMAL_AP, /* AP temperature */
+ HAL_DEVICE_THERMAL_CP, /* CP temperature */
+ HAL_DEVICE_THERMAL_BATTERY, /* Battery temperature */
+} hal_device_thermal_e;
+
+struct thermal_info {
+ int temp;
+ int adc;
+};
+
+typedef void (*ThermalUpdated)(struct thermal_info *info, void *data);
+
+typedef struct _hal_backend_thermal_funcs {
+ /* Get thermal state */
+ int (*get_info)(hal_device_thermal_e type, struct thermal_info *info);
+
+ /* Register thermal event */
+ int (*register_changed_event)(ThermalUpdated updated_cb, void *data);
+ int (*unregister_changed_event)(ThermalUpdated updated_cb);
+} hal_backend_thermal_funcs;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_TEMPERATURE_INTERFACE_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+
+#ifndef __HAL_TOUCHSCREEN_INTERFACE_H__
+#define __HAL_TOUCHSCREEN_INTERFACE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define TOUCHSENSITIVITY_GLOVE_MODE_OFF 0 /* Disable glove mode */
+#define TOUCHSENSITIVITY_GLOVE_MODE_ON 1 /* Enable glove mode */
+
+enum touchscreen_state {
+ TOUCHSCREEN_OFF, /* Disable touchscreen */
+ TOUCHSCREEN_ON, /* Enable touchscreen */
+};
+
+enum touchscreen_sensitivity_state {
+ GLOVE_MODE_OFF, /* Disable glove mode */
+ GLOVE_MODE_ON, /* Enable glove mode */
+};
+
+typedef struct _hal_backend_touchscreen_funcs {
+ /* Control touchscreen state */
+ int (*get_state)(enum touchscreen_state *state);
+ int (*set_state)(enum touchscreen_state state);
+ int (*get_powersaving)(int *state);
+ int (*set_powersaving)(int state);
+
+ /* Control touch sensitivity state */
+ int (*glove_mode_get_state)(int *state);
+ int (*glove_mode_set_state)(int state);
+} hal_backend_touchscreen_funcs;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_TOUCHSCREEN_INTERFACE_H__ */