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