Mouse code for the MacroRat

Dependencies:   ITG3200 QEI

Committer:
sahilmgandhi
Date:
Sun May 14 23:18:57 2017 +0000
Revision:
18:6a4db94011d3
Publishing again

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sahilmgandhi 18:6a4db94011d3 1 /* mbed Microcontroller Library
sahilmgandhi 18:6a4db94011d3 2 * Copyright (c) 2006-2013 ARM Limited
sahilmgandhi 18:6a4db94011d3 3 *
sahilmgandhi 18:6a4db94011d3 4 * Licensed under the Apache License, Version 2.0 (the "License");
sahilmgandhi 18:6a4db94011d3 5 * you may not use this file except in compliance with the License.
sahilmgandhi 18:6a4db94011d3 6 * You may obtain a copy of the License at
sahilmgandhi 18:6a4db94011d3 7 *
sahilmgandhi 18:6a4db94011d3 8 * http://www.apache.org/licenses/LICENSE-2.0
sahilmgandhi 18:6a4db94011d3 9 *
sahilmgandhi 18:6a4db94011d3 10 * Unless required by applicable law or agreed to in writing, software
sahilmgandhi 18:6a4db94011d3 11 * distributed under the License is distributed on an "AS IS" BASIS,
sahilmgandhi 18:6a4db94011d3 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
sahilmgandhi 18:6a4db94011d3 13 * See the License for the specific language governing permissions and
sahilmgandhi 18:6a4db94011d3 14 * limitations under the License.
sahilmgandhi 18:6a4db94011d3 15 */
sahilmgandhi 18:6a4db94011d3 16 #ifndef MBED_PINNAMES_H
sahilmgandhi 18:6a4db94011d3 17 #define MBED_PINNAMES_H
sahilmgandhi 18:6a4db94011d3 18
sahilmgandhi 18:6a4db94011d3 19 #include "cmsis.h"
sahilmgandhi 18:6a4db94011d3 20
sahilmgandhi 18:6a4db94011d3 21 #ifdef __cplusplus
sahilmgandhi 18:6a4db94011d3 22 extern "C" {
sahilmgandhi 18:6a4db94011d3 23 #endif
sahilmgandhi 18:6a4db94011d3 24
sahilmgandhi 18:6a4db94011d3 25 typedef enum {
sahilmgandhi 18:6a4db94011d3 26 PIN_INPUT,
sahilmgandhi 18:6a4db94011d3 27 PIN_OUTPUT
sahilmgandhi 18:6a4db94011d3 28 } PinDirection;
sahilmgandhi 18:6a4db94011d3 29
sahilmgandhi 18:6a4db94011d3 30 #define PORT_SHIFT 4
sahilmgandhi 18:6a4db94011d3 31
sahilmgandhi 18:6a4db94011d3 32 typedef enum {
sahilmgandhi 18:6a4db94011d3 33 P0_0 = 0, P0_1, P0_2, P0_3, P0_4, P0_5,
sahilmgandhi 18:6a4db94011d3 34 P1_0 = 16, P1_1, P1_2, P1_3, P1_4, P1_5, P1_6, P1_7, P1_8, P1_9, P1_10, P1_11, P1_12, P1_13, P1_14, P1_15,
sahilmgandhi 18:6a4db94011d3 35 P2_0, P2_1, P2_2, P2_3, P2_4, P2_5, P2_6, P2_7, P2_8, P2_9, P2_10, P2_11, P2_12, P2_13, P2_14, P2_15,
sahilmgandhi 18:6a4db94011d3 36 P3_0, P3_1, P3_2, P3_3, P3_4, P3_5, P3_6, P3_7, P3_8, P3_9, P3_10, P3_11, P3_12, P3_13, P3_14, P3_15,
sahilmgandhi 18:6a4db94011d3 37 P4_0, P4_1, P4_2, P4_3, P4_4, P4_5, P4_6, P4_7, P4_8, P4_9, P4_10, P4_11, P4_12, P4_13, P4_14, P4_15,
sahilmgandhi 18:6a4db94011d3 38 P5_0, P5_1, P5_2, P5_3, P5_4, P5_5, P5_6, P5_7, P5_8, P5_9, P5_10,
sahilmgandhi 18:6a4db94011d3 39 P6_0 = 96, P6_1, P6_2, P6_3, P6_4, P6_5, P6_6, P6_7, P6_8, P6_9, P6_10, P6_11, P6_12, P6_13, P6_14, P6_15,
sahilmgandhi 18:6a4db94011d3 40 P7_0, P7_1, P7_2, P7_3, P7_4, P7_5, P7_6, P7_7, P7_8, P7_9, P7_10, P7_11, P7_12, P7_13, P7_14, P7_15,
sahilmgandhi 18:6a4db94011d3 41 P8_0, P8_1, P8_2, P8_3, P8_4, P8_5, P8_6, P8_7, P8_8, P8_9, P8_10, P8_11, P8_12, P8_13, P8_14, P8_15,
sahilmgandhi 18:6a4db94011d3 42 P9_0, P9_1, P9_2, P9_3, P9_4, P9_5, P9_6, P9_7,
sahilmgandhi 18:6a4db94011d3 43
sahilmgandhi 18:6a4db94011d3 44 // mbed Pin Names
sahilmgandhi 18:6a4db94011d3 45 LED1 = P7_1,
sahilmgandhi 18:6a4db94011d3 46 LED_RED = LED1,
sahilmgandhi 18:6a4db94011d3 47 // mbed led alias to keep some test happy, becasue physically they are no LED2,LED3 & LED4 on the board
sahilmgandhi 18:6a4db94011d3 48 LED2 = LED1,
sahilmgandhi 18:6a4db94011d3 49 LED3 = LED2,
sahilmgandhi 18:6a4db94011d3 50 LED4 = LED3,
sahilmgandhi 18:6a4db94011d3 51
sahilmgandhi 18:6a4db94011d3 52 I2C_SCL = P1_0,
sahilmgandhi 18:6a4db94011d3 53 I2C_SDA = P1_1,
sahilmgandhi 18:6a4db94011d3 54
sahilmgandhi 18:6a4db94011d3 55 USBTX = P8_8,
sahilmgandhi 18:6a4db94011d3 56 USBRX = P8_9,
sahilmgandhi 18:6a4db94011d3 57
sahilmgandhi 18:6a4db94011d3 58 //USER_BUTTON0 = P6_0,
sahilmgandhi 18:6a4db94011d3 59
sahilmgandhi 18:6a4db94011d3 60 // Not connected
sahilmgandhi 18:6a4db94011d3 61 NC = (int)0xFFFFFFFF
sahilmgandhi 18:6a4db94011d3 62 } PinName;
sahilmgandhi 18:6a4db94011d3 63
sahilmgandhi 18:6a4db94011d3 64 typedef enum {
sahilmgandhi 18:6a4db94011d3 65 PullUp = 0,
sahilmgandhi 18:6a4db94011d3 66 PullDown = 3,
sahilmgandhi 18:6a4db94011d3 67 PullNone = 2,
sahilmgandhi 18:6a4db94011d3 68 OpenDrain = 4,
sahilmgandhi 18:6a4db94011d3 69 PullDefault = PullDown
sahilmgandhi 18:6a4db94011d3 70 } PinMode;
sahilmgandhi 18:6a4db94011d3 71
sahilmgandhi 18:6a4db94011d3 72 #define PINGROUP(pin) (((pin)>>PORT_SHIFT)&0x0f)
sahilmgandhi 18:6a4db94011d3 73 #define PINNO(pin) ((pin)&0x0f)
sahilmgandhi 18:6a4db94011d3 74
sahilmgandhi 18:6a4db94011d3 75 #ifdef __cplusplus
sahilmgandhi 18:6a4db94011d3 76 }
sahilmgandhi 18:6a4db94011d3 77 #endif
sahilmgandhi 18:6a4db94011d3 78
sahilmgandhi 18:6a4db94011d3 79 #endif