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