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.
20 #ifndef __HAPTIC_MODULE_H__
21 #define __HAPTIC_MODULE_H__
24 * @brief Enumerations of device id for the Haptic Module API.
25 * @details We support two motors now.
28 HAPTIC_MODULE_DEVICE_0 = 0x0, /**< 1st motor */
29 HAPTIC_MODULE_DEVICE_1 = 0x1, /**< 2nd motor */
30 HAPTIC_MODULE_DEVICE_ALL = 0x4, /**< both of them */
31 } haptic_module_device;
34 * @brief Enumerations of priority level for the Haptic Module API.
38 HAPTIC_MODULE_PRIORITY_MIN = 0, /**< Minimum effect priority for developers (default) */
39 HAPTIC_MODULE_PRIORITY_MIDDLE, /**< Maximum effect priority for developers */
40 HAPTIC_MODULE_PRIORITY_HIGH, /**< Maximum effect priority for OEMs */
41 } haptic_module_priority;
44 * @brief Enumerations of feedback level for the Haptic Module API.
45 * @details Haptic level means vibration power (intensity).
49 HAPTIC_MODULE_FEEDBACK_MIN = 0,
50 HAPTIC_MODULE_FEEDBACK_MAX = 100,
51 } haptic_module_feedback;
54 * @brief Enumerations of unlimited duration for the Haptic Module API.
57 HAPTIC_MODULE_DURATION_UNLIMITED = 0x7FFFFFFF,
58 } haptic_module_duration;
61 * @brief Enumerations of iteration count for the Haptic Module API.
65 HAPTIC_MODULE_ITERATION_ONCE = 1,
66 HAPTIC_MODULE_ITERATION_INFINITE = 256,
67 } haptic_module_iteration;
70 * @brief Enumerations of effect or device state for the Haptic Module API.
74 HAPTIC_MODULE_STATE_STOP = 0,
75 HAPTIC_MODULE_STATE_PLAYING,
76 } haptic_module_state;
78 /* Error and Return value codes */
79 #define HAPTIC_MODULE_ERROR_NONE 0
80 #define HAPTIC_MODULE_NOT_INITIALIZED -1
81 #define HAPTIC_MODULE_ALREADY_INITIALIZED -2
82 #define HAPTIC_MODULE_INVALID_ARGUMENT -3
83 #define HAPTIC_MODULE_OPERATION_FAILED -4
84 #define HAPTIC_MODULE_NOT_SUPPORTED -5
88 * effect element for haptic module.
91 int haptic_duration; /**< Start time of the effect element in millisecond */
92 int haptic_level; /**< Duration of the effect element in millisecond */
93 } haptic_module_effect_element;
95 #endif /* __HAPTIC_MODULE_H__ */