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