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 iteration count for the Haptic Module API.
58 HAPTIC_MODULE_ITERATION_ONCE = 1,
59 HAPTIC_MODULE_ITERATION_INFINITE = 256,
60 } haptic_module_iteration;
63 * @brief Enumerations of effect or device state for the Haptic Module API.
67 HAPTIC_MODULE_STATE_STOP = 0,
68 HAPTIC_MODULE_STATE_PLAYING,
69 } haptic_module_state;
71 /* Error and Return value codes */
72 #define HAPTIC_MODULE_ERROR_NONE 0
73 #define HAPTIC_MODULE_NOT_INITIALIZED -1
74 #define HAPTIC_MODULE_ALREADY_INITIALIZED -2
75 #define HAPTIC_MODULE_INVALID_ARGUMENT -3
76 #define HAPTIC_MODULE_OPERATION_FAILED -4
77 #define HAPTIC_MODULE_NOT_SUPPORTED -5
81 * effect element for haptic module.
84 int haptic_duration; /**< Start time of the effect element in millisecond */
85 int haptic_level; /**< Duration of the effect element in millisecond */
86 } haptic_module_effect_element;
88 #endif /* __HAPTIC_MODULE_H__ */