2 * Copyright (c) 2013-2016 ARM Limited. All rights reserved.
\r
4 * SPDX-License-Identifier: Apache-2.0
\r
6 * Licensed under the Apache License, Version 2.0 (the License); you may
\r
7 * not use this file except in compliance with the License.
\r
8 * You may obtain a copy of the License at
\r
10 * http://www.apache.org/licenses/LICENSE-2.0
\r
12 * Unless required by applicable law or agreed to in writing, software
\r
13 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
\r
14 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
15 * See the License for the specific language governing permissions and
\r
16 * limitations under the License.
\r
18 * $Date: 2. Jan 2014
\r
21 * Project: Common Driver definitions
\r
26 * Changed prefix ARM_DRV -> ARM_DRIVER
\r
27 * Added General return codes definitions
\r
29 * Namespace prefix ARM_ added
\r
34 #ifndef __DRIVER_COMMON_H
\r
35 #define __DRIVER_COMMON_H
\r
39 #include <stdbool.h>
\r
41 #define ARM_DRIVER_VERSION_MAJOR_MINOR(major,minor) (((major) << 8) | (minor))
\r
44 \brief Driver Version
\r
46 typedef struct _ARM_DRIVER_VERSION {
\r
47 uint16_t api; ///< API version
\r
48 uint16_t drv; ///< Driver version
\r
49 } ARM_DRIVER_VERSION;
\r
51 /* General return codes */
\r
52 #define ARM_DRIVER_OK 0 ///< Operation succeeded
\r
53 #define ARM_DRIVER_ERROR -1 ///< Unspecified error
\r
54 #define ARM_DRIVER_ERROR_BUSY -2 ///< Driver is busy
\r
55 #define ARM_DRIVER_ERROR_TIMEOUT -3 ///< Timeout occurred
\r
56 #define ARM_DRIVER_ERROR_UNSUPPORTED -4 ///< Operation not supported
\r
57 #define ARM_DRIVER_ERROR_PARAMETER -5 ///< Parameter error
\r
58 #define ARM_DRIVER_ERROR_SPECIFIC -6 ///< Start of driver specific errors
\r
61 \brief General power states
\r
63 typedef enum _ARM_POWER_STATE {
\r
64 ARM_POWER_OFF, ///< Power off: no operation possible
\r
65 ARM_POWER_LOW, ///< Low Power mode: retain state, detect and signal wake-up events
\r
66 ARM_POWER_FULL ///< Power on: full operation at maximum performance
\r
69 #endif /* __DRIVER_COMMON_H */
\r