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