Mouse code for the MacroRat

Dependencies:   ITG3200 QEI

Committer:
sahilmgandhi
Date:
Sat Jun 03 00:22:44 2017 +0000
Revision:
46:b156ef445742
Parent:
18:6a4db94011d3
Final code for internal battlebot competition.

Who changed what in which revision?

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