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