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