Mouse code for the MacroRat
mbed-dev/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/TARGET_NRF51_MICROBIT/PinNames.h@18:6a4db94011d3, 2017-05-14 (annotated)
- Committer:
- sahilmgandhi
- Date:
- Sun May 14 23:18:57 2017 +0000
- Revision:
- 18:6a4db94011d3
Publishing again
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sahilmgandhi | 18:6a4db94011d3 | 1 | /* mbed Microcontroller Library |
sahilmgandhi | 18:6a4db94011d3 | 2 | * Copyright (c) 2013 Nordic Semiconductor |
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 3 |
sahilmgandhi | 18:6a4db94011d3 | 31 | |
sahilmgandhi | 18:6a4db94011d3 | 32 | typedef enum { |
sahilmgandhi | 18:6a4db94011d3 | 33 | //MCU PINS |
sahilmgandhi | 18:6a4db94011d3 | 34 | P0_0 = 0, |
sahilmgandhi | 18:6a4db94011d3 | 35 | P0_1 = 1, |
sahilmgandhi | 18:6a4db94011d3 | 36 | P0_2 = 2, |
sahilmgandhi | 18:6a4db94011d3 | 37 | P0_3 = 3, |
sahilmgandhi | 18:6a4db94011d3 | 38 | P0_4 = 4, |
sahilmgandhi | 18:6a4db94011d3 | 39 | P0_5 = 5, |
sahilmgandhi | 18:6a4db94011d3 | 40 | P0_6 = 6, |
sahilmgandhi | 18:6a4db94011d3 | 41 | P0_7 = 7, |
sahilmgandhi | 18:6a4db94011d3 | 42 | P0_8 = 8, |
sahilmgandhi | 18:6a4db94011d3 | 43 | P0_9 = 9, |
sahilmgandhi | 18:6a4db94011d3 | 44 | P0_10 = 10, |
sahilmgandhi | 18:6a4db94011d3 | 45 | P0_11 = 11, |
sahilmgandhi | 18:6a4db94011d3 | 46 | P0_12 = 12, |
sahilmgandhi | 18:6a4db94011d3 | 47 | P0_13 = 13, |
sahilmgandhi | 18:6a4db94011d3 | 48 | P0_14 = 14, |
sahilmgandhi | 18:6a4db94011d3 | 49 | P0_15 = 15, |
sahilmgandhi | 18:6a4db94011d3 | 50 | P0_16 = 16, |
sahilmgandhi | 18:6a4db94011d3 | 51 | P0_17 = 17, |
sahilmgandhi | 18:6a4db94011d3 | 52 | P0_18 = 18, |
sahilmgandhi | 18:6a4db94011d3 | 53 | P0_19 = 19, |
sahilmgandhi | 18:6a4db94011d3 | 54 | P0_20 = 20, |
sahilmgandhi | 18:6a4db94011d3 | 55 | P0_21 = 21, |
sahilmgandhi | 18:6a4db94011d3 | 56 | P0_22 = 22, |
sahilmgandhi | 18:6a4db94011d3 | 57 | P0_23 = 23, |
sahilmgandhi | 18:6a4db94011d3 | 58 | P0_24 = 24, |
sahilmgandhi | 18:6a4db94011d3 | 59 | P0_25 = 25, |
sahilmgandhi | 18:6a4db94011d3 | 60 | P0_26 = 26, |
sahilmgandhi | 18:6a4db94011d3 | 61 | P0_27 = 27, |
sahilmgandhi | 18:6a4db94011d3 | 62 | P0_28 = 28, |
sahilmgandhi | 18:6a4db94011d3 | 63 | P0_29 = 29, |
sahilmgandhi | 18:6a4db94011d3 | 64 | P0_30 = 30, |
sahilmgandhi | 18:6a4db94011d3 | 65 | |
sahilmgandhi | 18:6a4db94011d3 | 66 | //MICROBIT EDGE CONNECTOR PINS |
sahilmgandhi | 18:6a4db94011d3 | 67 | P0 = P0_3, |
sahilmgandhi | 18:6a4db94011d3 | 68 | P1 = P0_2, |
sahilmgandhi | 18:6a4db94011d3 | 69 | P2 = P0_1, |
sahilmgandhi | 18:6a4db94011d3 | 70 | P3 = P0_4, |
sahilmgandhi | 18:6a4db94011d3 | 71 | P4 = P0_5, |
sahilmgandhi | 18:6a4db94011d3 | 72 | P5 = P0_17, |
sahilmgandhi | 18:6a4db94011d3 | 73 | P6 = P0_12, |
sahilmgandhi | 18:6a4db94011d3 | 74 | P7 = P0_11, |
sahilmgandhi | 18:6a4db94011d3 | 75 | P8 = P0_18, |
sahilmgandhi | 18:6a4db94011d3 | 76 | P9 = P0_10, |
sahilmgandhi | 18:6a4db94011d3 | 77 | P10 = P0_6, |
sahilmgandhi | 18:6a4db94011d3 | 78 | P11 = P0_26, |
sahilmgandhi | 18:6a4db94011d3 | 79 | P12 = P0_20, |
sahilmgandhi | 18:6a4db94011d3 | 80 | P13 = P0_23, |
sahilmgandhi | 18:6a4db94011d3 | 81 | P14 = P0_22, |
sahilmgandhi | 18:6a4db94011d3 | 82 | P15 = P0_21, |
sahilmgandhi | 18:6a4db94011d3 | 83 | P16 = P0_16, |
sahilmgandhi | 18:6a4db94011d3 | 84 | P19 = P0_0, |
sahilmgandhi | 18:6a4db94011d3 | 85 | P20 = P0_30, |
sahilmgandhi | 18:6a4db94011d3 | 86 | |
sahilmgandhi | 18:6a4db94011d3 | 87 | //PADS |
sahilmgandhi | 18:6a4db94011d3 | 88 | PAD3 = P0_1, |
sahilmgandhi | 18:6a4db94011d3 | 89 | PAD2 = P0_2, |
sahilmgandhi | 18:6a4db94011d3 | 90 | PAD1 = P0_3, |
sahilmgandhi | 18:6a4db94011d3 | 91 | |
sahilmgandhi | 18:6a4db94011d3 | 92 | |
sahilmgandhi | 18:6a4db94011d3 | 93 | //LED MATRIX COLS |
sahilmgandhi | 18:6a4db94011d3 | 94 | COL1 = P0_4, |
sahilmgandhi | 18:6a4db94011d3 | 95 | COL2 = P0_5, |
sahilmgandhi | 18:6a4db94011d3 | 96 | COL3 = P0_6, |
sahilmgandhi | 18:6a4db94011d3 | 97 | COL4 = P0_7, |
sahilmgandhi | 18:6a4db94011d3 | 98 | COL5 = P0_8, |
sahilmgandhi | 18:6a4db94011d3 | 99 | COL6 = P0_9, |
sahilmgandhi | 18:6a4db94011d3 | 100 | COL7 = P0_10, |
sahilmgandhi | 18:6a4db94011d3 | 101 | COL8 = P0_11, |
sahilmgandhi | 18:6a4db94011d3 | 102 | COL9 = P0_12, |
sahilmgandhi | 18:6a4db94011d3 | 103 | |
sahilmgandhi | 18:6a4db94011d3 | 104 | //LED MATRIX ROWS |
sahilmgandhi | 18:6a4db94011d3 | 105 | ROW1 = P0_13, |
sahilmgandhi | 18:6a4db94011d3 | 106 | ROW2 = P0_14, |
sahilmgandhi | 18:6a4db94011d3 | 107 | ROW3 = P0_15, |
sahilmgandhi | 18:6a4db94011d3 | 108 | |
sahilmgandhi | 18:6a4db94011d3 | 109 | //NORMAL PIN (NO SPECIFIED FUNCTIONALITY) |
sahilmgandhi | 18:6a4db94011d3 | 110 | //PIN_16 |
sahilmgandhi | 18:6a4db94011d3 | 111 | |
sahilmgandhi | 18:6a4db94011d3 | 112 | // BUTTON A |
sahilmgandhi | 18:6a4db94011d3 | 113 | BUTTON_A = P0_17, |
sahilmgandhi | 18:6a4db94011d3 | 114 | |
sahilmgandhi | 18:6a4db94011d3 | 115 | |
sahilmgandhi | 18:6a4db94011d3 | 116 | //NORMAL PIN (NO SPECIFIED FUNCTIONALITY) |
sahilmgandhi | 18:6a4db94011d3 | 117 | //PIN_18 |
sahilmgandhi | 18:6a4db94011d3 | 118 | |
sahilmgandhi | 18:6a4db94011d3 | 119 | //TARGET RESET |
sahilmgandhi | 18:6a4db94011d3 | 120 | TGT_NRESET = P0_19, |
sahilmgandhi | 18:6a4db94011d3 | 121 | |
sahilmgandhi | 18:6a4db94011d3 | 122 | //NORMAL PIN (NO SPECIFIED FUNCTIONALITY) |
sahilmgandhi | 18:6a4db94011d3 | 123 | //PIN_20 |
sahilmgandhi | 18:6a4db94011d3 | 124 | |
sahilmgandhi | 18:6a4db94011d3 | 125 | //MASTER OUT SLAVE IN |
sahilmgandhi | 18:6a4db94011d3 | 126 | MOSI = P0_21, |
sahilmgandhi | 18:6a4db94011d3 | 127 | |
sahilmgandhi | 18:6a4db94011d3 | 128 | //MASTER IN SLAVE OUT |
sahilmgandhi | 18:6a4db94011d3 | 129 | MISO = P0_22, |
sahilmgandhi | 18:6a4db94011d3 | 130 | |
sahilmgandhi | 18:6a4db94011d3 | 131 | //SERIAL CLOCK |
sahilmgandhi | 18:6a4db94011d3 | 132 | SCK = P0_23, |
sahilmgandhi | 18:6a4db94011d3 | 133 | |
sahilmgandhi | 18:6a4db94011d3 | 134 | // RX AND TX PINS |
sahilmgandhi | 18:6a4db94011d3 | 135 | TGT_TX = P0_24, |
sahilmgandhi | 18:6a4db94011d3 | 136 | TGT_RX = P0_25, |
sahilmgandhi | 18:6a4db94011d3 | 137 | |
sahilmgandhi | 18:6a4db94011d3 | 138 | //BUTTON B |
sahilmgandhi | 18:6a4db94011d3 | 139 | BUTTON_B = P0_26, |
sahilmgandhi | 18:6a4db94011d3 | 140 | |
sahilmgandhi | 18:6a4db94011d3 | 141 | //ACCEL INTERRUPT PINS (MMA8653FC) |
sahilmgandhi | 18:6a4db94011d3 | 142 | ACCEL_INT2 = P0_27, |
sahilmgandhi | 18:6a4db94011d3 | 143 | ACCEL_INT1 = P0_28, |
sahilmgandhi | 18:6a4db94011d3 | 144 | |
sahilmgandhi | 18:6a4db94011d3 | 145 | //MAGENETOMETER INTERRUPT PIN (MAG3110) |
sahilmgandhi | 18:6a4db94011d3 | 146 | MAG_INT1 = P0_29, |
sahilmgandhi | 18:6a4db94011d3 | 147 | |
sahilmgandhi | 18:6a4db94011d3 | 148 | // Not connected |
sahilmgandhi | 18:6a4db94011d3 | 149 | NC = (int)0xFFFFFFFF, |
sahilmgandhi | 18:6a4db94011d3 | 150 | |
sahilmgandhi | 18:6a4db94011d3 | 151 | RX_PIN_NUMBER = TGT_RX, |
sahilmgandhi | 18:6a4db94011d3 | 152 | TX_PIN_NUMBER = TGT_TX, |
sahilmgandhi | 18:6a4db94011d3 | 153 | CTS_PIN_NUMBER = 31, //unused ** REQUIRES A PROPER FIX ** |
sahilmgandhi | 18:6a4db94011d3 | 154 | RTS_PIN_NUMBER = 31, //unused |
sahilmgandhi | 18:6a4db94011d3 | 155 | |
sahilmgandhi | 18:6a4db94011d3 | 156 | // mBed interface Pins |
sahilmgandhi | 18:6a4db94011d3 | 157 | USBTX = TX_PIN_NUMBER, |
sahilmgandhi | 18:6a4db94011d3 | 158 | USBRX = RX_PIN_NUMBER, |
sahilmgandhi | 18:6a4db94011d3 | 159 | |
sahilmgandhi | 18:6a4db94011d3 | 160 | LED1 = PAD1, |
sahilmgandhi | 18:6a4db94011d3 | 161 | LED2 = PAD2, |
sahilmgandhi | 18:6a4db94011d3 | 162 | LED3 = PAD3, |
sahilmgandhi | 18:6a4db94011d3 | 163 | LED4 = P0_16, |
sahilmgandhi | 18:6a4db94011d3 | 164 | |
sahilmgandhi | 18:6a4db94011d3 | 165 | //SDA (SERIAL DATA LINE) |
sahilmgandhi | 18:6a4db94011d3 | 166 | I2C_SDA0 = P0_30, |
sahilmgandhi | 18:6a4db94011d3 | 167 | |
sahilmgandhi | 18:6a4db94011d3 | 168 | //SCL (SERIAL CLOCK LINE) |
sahilmgandhi | 18:6a4db94011d3 | 169 | I2C_SCL0 = P0_0 |
sahilmgandhi | 18:6a4db94011d3 | 170 | |
sahilmgandhi | 18:6a4db94011d3 | 171 | } PinName; |
sahilmgandhi | 18:6a4db94011d3 | 172 | |
sahilmgandhi | 18:6a4db94011d3 | 173 | typedef enum { |
sahilmgandhi | 18:6a4db94011d3 | 174 | PullNone = 0, |
sahilmgandhi | 18:6a4db94011d3 | 175 | PullDown = 1, |
sahilmgandhi | 18:6a4db94011d3 | 176 | PullUp = 3, |
sahilmgandhi | 18:6a4db94011d3 | 177 | PullDefault = PullUp |
sahilmgandhi | 18:6a4db94011d3 | 178 | } PinMode; |
sahilmgandhi | 18:6a4db94011d3 | 179 | |
sahilmgandhi | 18:6a4db94011d3 | 180 | #ifdef __cplusplus |
sahilmgandhi | 18:6a4db94011d3 | 181 | } |
sahilmgandhi | 18:6a4db94011d3 | 182 | #endif |
sahilmgandhi | 18:6a4db94011d3 | 183 | |
sahilmgandhi | 18:6a4db94011d3 | 184 | #endif |