The prosthetic control(MIT)

Committer:
ganlikun
Date:
Thu Jun 23 05:23:34 2022 +0000
Revision:
0:20e0c61e0684
01

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ganlikun 0:20e0c61e0684 1
ganlikun 0:20e0c61e0684 2 /** \addtogroup hal */
ganlikun 0:20e0c61e0684 3 /** @{*/
ganlikun 0:20e0c61e0684 4 /*
ganlikun 0:20e0c61e0684 5 * Copyright (c) 2006-2016, ARM Limited, All Rights Reserved
ganlikun 0:20e0c61e0684 6 * SPDX-License-Identifier: Apache-2.0
ganlikun 0:20e0c61e0684 7 *
ganlikun 0:20e0c61e0684 8 * Licensed under the Apache License, Version 2.0 (the "License"); you may
ganlikun 0:20e0c61e0684 9 * not use this file except in compliance with the License.
ganlikun 0:20e0c61e0684 10 * You may obtain a copy of the License at
ganlikun 0:20e0c61e0684 11 *
ganlikun 0:20e0c61e0684 12 * http://www.apache.org/licenses/LICENSE-2.0
ganlikun 0:20e0c61e0684 13 *
ganlikun 0:20e0c61e0684 14 * Unless required by applicable law or agreed to in writing, software
ganlikun 0:20e0c61e0684 15 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
ganlikun 0:20e0c61e0684 16 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
ganlikun 0:20e0c61e0684 17 * See the License for the specific language governing permissions and
ganlikun 0:20e0c61e0684 18 * limitations under the License.
ganlikun 0:20e0c61e0684 19 */
ganlikun 0:20e0c61e0684 20
ganlikun 0:20e0c61e0684 21 #ifndef __DRIVER_COMMON_H
ganlikun 0:20e0c61e0684 22 #define __DRIVER_COMMON_H
ganlikun 0:20e0c61e0684 23
ganlikun 0:20e0c61e0684 24 #include <stddef.h>
ganlikun 0:20e0c61e0684 25 #include <stdint.h>
ganlikun 0:20e0c61e0684 26 #include <stdbool.h>
ganlikun 0:20e0c61e0684 27
ganlikun 0:20e0c61e0684 28 /****** This file has been deprecated since mbed-os-5.5 *****/
ganlikun 0:20e0c61e0684 29
ganlikun 0:20e0c61e0684 30 #define ARM_DRIVER_VERSION_MAJOR_MINOR(major,minor) (((major) << 8) | (minor))
ganlikun 0:20e0c61e0684 31
ganlikun 0:20e0c61e0684 32 /**
ganlikun 0:20e0c61e0684 33 \brief Driver Version
ganlikun 0:20e0c61e0684 34 */
ganlikun 0:20e0c61e0684 35 typedef struct _ARM_DRIVER_VERSION {
ganlikun 0:20e0c61e0684 36 uint16_t api; ///< API version
ganlikun 0:20e0c61e0684 37 uint16_t drv; ///< Driver version
ganlikun 0:20e0c61e0684 38 } ARM_DRIVER_VERSION;
ganlikun 0:20e0c61e0684 39
ganlikun 0:20e0c61e0684 40 /* General return codes */
ganlikun 0:20e0c61e0684 41 #define ARM_DRIVER_OK 0 ///< Operation succeeded
ganlikun 0:20e0c61e0684 42 #define ARM_DRIVER_ERROR -1 ///< Unspecified error
ganlikun 0:20e0c61e0684 43 #define ARM_DRIVER_ERROR_BUSY -2 ///< Driver is busy
ganlikun 0:20e0c61e0684 44 #define ARM_DRIVER_ERROR_TIMEOUT -3 ///< Timeout occurred
ganlikun 0:20e0c61e0684 45 #define ARM_DRIVER_ERROR_UNSUPPORTED -4 ///< Operation not supported
ganlikun 0:20e0c61e0684 46 #define ARM_DRIVER_ERROR_PARAMETER -5 ///< Parameter error
ganlikun 0:20e0c61e0684 47 #define ARM_DRIVER_ERROR_SPECIFIC -6 ///< Start of driver specific errors
ganlikun 0:20e0c61e0684 48
ganlikun 0:20e0c61e0684 49 /**
ganlikun 0:20e0c61e0684 50 \brief General power states
ganlikun 0:20e0c61e0684 51 */
ganlikun 0:20e0c61e0684 52 typedef enum _ARM_POWER_STATE {
ganlikun 0:20e0c61e0684 53 ARM_POWER_OFF, ///< Power off: no operation possible
ganlikun 0:20e0c61e0684 54 ARM_POWER_LOW, ///< Low Power mode: retain state, detect and signal wake-up events
ganlikun 0:20e0c61e0684 55 ARM_POWER_FULL ///< Power on: full operation at maximum performance
ganlikun 0:20e0c61e0684 56 } ARM_POWER_STATE;
ganlikun 0:20e0c61e0684 57
ganlikun 0:20e0c61e0684 58 #endif /* __DRIVER_COMMON_H */
ganlikun 0:20e0c61e0684 59
ganlikun 0:20e0c61e0684 60 /** @}*/
ganlikun 0:20e0c61e0684 61