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