Mouse code for the MacroRat

Dependencies:   ITG3200 QEI

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Driver_Common.h Source File

Driver_Common.h

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