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