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/** 17 * @addtogroup Motion 18 * @{ 19 * 20 * @brief Provides common APIs for hardware services to access the motion driver module. 21 * 22 * A service can obtain a motion driver object or agent and then call APIs provided by this object or agent to 23 * enable or disable motion and subscribe to or unsubscribe from motion data. 24 * 25 * @since 4.0 26 */ 27 28/** 29 * @file MotionTypes.idl 30 * 31 * @brief Defines the data structures used by the motion module, including the motion types and reported motion data structure. 32 * 33 * @since 4.0 34 * @version 1.1 35 */ 36 37/** 38 * @brief Defines the package path of the motion driver module APIs. 39 * 40 * @since 4.0 41 */ 42package ohos.hdi.motion.v1_1; 43 44/** 45 * @brief Defines the motion wave config param. 46 * 47 * The motion wave config param includes the wave frequency, wave amplitude, wave is use gyroscope. 48 * 49 * @since 4.0 50 */ 51struct WaveParam { 52 /** wave frequency */ 53 int waveFrequency; 54 /** wave amplitude */ 55 int waveAmplitude; 56 /** wave is use gyroscope */ 57 boolean isUseGyroscope; 58}; 59 60/** 61 * @brief Enumerates motion types. 62 * 63 * @since 4.0 64 */ 65enum HdfMotionTypeTag { 66 /** Pickup */ 67 HDF_MOTION_TYPE_PICKUP = 0, 68 /** Flip */ 69 HDF_MOTION_TYPE_FLIP, 70 /** Closing to the ear */ 71 HDF_MOTION_CLOSE_TO_EAR, 72 /** Shaking */ 73 HDF_MOTION_TYPE_SHAKE, 74 /** Screen rotation */ 75 HDF_MOTION_TYPE_ROTATION, 76 /** Pocket mode */ 77 HDF_MOTION_TYPE_POCKET_MODE, 78 /** Taking away from the ear */ 79 HDF_MOTION_TYPE_LEAVE_EAR, 80 /** Wrist-up */ 81 HDF_MOTION_TYPE_WRIST_UP, 82 /** Wrist-down */ 83 HDF_MOTION_TYPE_WRIST_DOWN, 84 /** Wave */ 85 HDF_MOTION_TYPE_WAVE, 86 /** Step counter */ 87 HDF_MOTION_TYPE_STEP_COUNTER, 88 /** Reserved */ 89 HDF_MOTION_TYPE_RESERVED, 90 /** Maximum motion type */ 91 HDF_MOTION_TYPE_MAX, 92}; 93/** @} */