• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef IVIBRATOR_TYPE_VDI_H
17 #define IVIBRATOR_TYPE_VDI_H
18 
19 #include <stdint.h>
20 
21 #ifdef __cplusplus
22 #if __cplusplus
23 extern "C" {
24 #endif
25 #endif /* __cplusplus */
26 
27 enum HdfVibratorStatusVdi {
28     VDI_VIBRATOR_SUCCESS            = 0,
29     VDI_VIBRATOR_NOT_PERIOD         = -1,
30     VDI_VIBRATOR_NOT_INTENSITY      = -2,
31     VDI_VIBRATOR_NOT_FREQUENCY      = -3,
32 };
33 
34 enum HdfVibratorModeVdi {
35     VDI_VIBRATOR_MODE_ONCE   = 0,
36     VDI_VIBRATOR_MODE_PRESET = 1,
37     VDI_VIBRATOR_MODE_BUTT
38 };
39 
40 enum HdfEffectTypeVdi {
41     VDI_EFFECT_TYPE_TIME,
42     VDI_EFFECT_TYPE_PRIMITIVE,
43     VDI_EFFECT_TYPE_BUTT,
44 };
45 
46 struct HdfVibratorInfoVdi {
47     bool isSupportIntensity;
48     bool isSupportFrequency;
49     uint16_t intensityMaxValue;
50     uint16_t intensityMinValue;
51     int16_t frequencyMaxValue;
52     int16_t frequencyMinValue;
53 };
54 
55 struct HdfTimeEffectVdi {
56     int32_t delay;
57     int32_t time;
58     uint16_t intensity;
59     int16_t frequency;
60 };
61 
62 struct HdfPrimitiveEffectVdi {
63     int32_t delay;
64     int32_t effectId;
65     uint16_t intensity;
66 };
67 
68 union HdfEffectVdi {
69     struct HdfTimeEffectVdi timeEffect;
70     struct HdfPrimitiveEffectVdi primitiveEffect;
71 };
72 
73 struct HdfCompositeEffectVdi {
74     int32_t type;
75     std::vector<HdfEffectVdi> effects;
76 };
77 
78 struct HdfEffectInfoVdi {
79     int32_t duration;
80     bool isSupportEffect;
81 };
82 
83 #ifdef __cplusplus
84 #if __cplusplus
85 }
86 #endif
87 #endif /* __cplusplus */
88 
89 #endif /* IVIBRATOR_TYPE_VDI_H */
90 /** @} */
91