This fork captures the mbed lib v125 for ease of integration into older projects.

Fork of mbed-dev by mbed official

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Driver_Common.h Source File

Driver_Common.h

00001 /*
00002  * Copyright (c) 2006-2016, ARM Limited, All Rights Reserved
00003  * SPDX-License-Identifier: Apache-2.0
00004  *
00005  * Licensed under the Apache License, Version 2.0 (the "License"); you may
00006  * not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  * http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
00013  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 #ifndef __DRIVER_COMMON_H
00019 #define __DRIVER_COMMON_H
00020 
00021 #include <stddef.h>
00022 #include <stdint.h>
00023 #include <stdbool.h>
00024 
00025 #define ARM_DRIVER_VERSION_MAJOR_MINOR(major,minor) (((major) << 8) | (minor))
00026 
00027 /**
00028 \brief Driver Version
00029 */
00030 typedef struct _ARM_DRIVER_VERSION {
00031   uint16_t api;                         ///< API version
00032   uint16_t drv;                         ///< Driver version
00033 } ARM_DRIVER_VERSION;
00034 
00035 /* General return codes */
00036 #define ARM_DRIVER_OK                 0 ///< Operation succeeded
00037 #define ARM_DRIVER_ERROR             -1 ///< Unspecified error
00038 #define ARM_DRIVER_ERROR_BUSY        -2 ///< Driver is busy
00039 #define ARM_DRIVER_ERROR_TIMEOUT     -3 ///< Timeout occurred
00040 #define ARM_DRIVER_ERROR_UNSUPPORTED -4 ///< Operation not supported
00041 #define ARM_DRIVER_ERROR_PARAMETER   -5 ///< Parameter error
00042 #define ARM_DRIVER_ERROR_SPECIFIC    -6 ///< Start of driver specific errors
00043 
00044 /**
00045 \brief General power states
00046 */
00047 typedef enum _ARM_POWER_STATE {
00048   ARM_POWER_OFF,                        ///< Power off: no operation possible
00049   ARM_POWER_LOW,                        ///< Low Power mode: retain state, detect and signal wake-up events
00050   ARM_POWER_FULL                        ///< Power on: full operation at maximum performance
00051 } ARM_POWER_STATE;
00052 
00053 #endif /* __DRIVER_COMMON_H */