Mouse code for the MacroRat
mbed-dev/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822_UNIFIED/TARGET_DELTA_DFCM_NNN50/PinNames.h@46:b156ef445742, 2017-06-03 (annotated)
- 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?
User | Revision | Line number | New contents of line |
---|---|---|---|
sahilmgandhi | 18:6a4db94011d3 | 1 | /* mbed Microcontroller Library |
sahilmgandhi | 18:6a4db94011d3 | 2 | * Copyright (c) 2017 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 | p0 = 0, |
sahilmgandhi | 18:6a4db94011d3 | 34 | p1 = 1, |
sahilmgandhi | 18:6a4db94011d3 | 35 | p2 = 2, |
sahilmgandhi | 18:6a4db94011d3 | 36 | p3 = 3, |
sahilmgandhi | 18:6a4db94011d3 | 37 | p4 = 4, |
sahilmgandhi | 18:6a4db94011d3 | 38 | p5 = 5, |
sahilmgandhi | 18:6a4db94011d3 | 39 | p6 = 6, |
sahilmgandhi | 18:6a4db94011d3 | 40 | p7 = 7, |
sahilmgandhi | 18:6a4db94011d3 | 41 | p8 = 8, |
sahilmgandhi | 18:6a4db94011d3 | 42 | p9 = 9, |
sahilmgandhi | 18:6a4db94011d3 | 43 | p10 = 10, |
sahilmgandhi | 18:6a4db94011d3 | 44 | p11 = 11, |
sahilmgandhi | 18:6a4db94011d3 | 45 | p12 = 12, |
sahilmgandhi | 18:6a4db94011d3 | 46 | p13 = 13, |
sahilmgandhi | 18:6a4db94011d3 | 47 | p14 = 14, |
sahilmgandhi | 18:6a4db94011d3 | 48 | p15 = 15, |
sahilmgandhi | 18:6a4db94011d3 | 49 | p16 = 16, |
sahilmgandhi | 18:6a4db94011d3 | 50 | p17 = 17, |
sahilmgandhi | 18:6a4db94011d3 | 51 | p18 = 18, |
sahilmgandhi | 18:6a4db94011d3 | 52 | p19 = 19, |
sahilmgandhi | 18:6a4db94011d3 | 53 | p20 = 20, |
sahilmgandhi | 18:6a4db94011d3 | 54 | p21 = 21, |
sahilmgandhi | 18:6a4db94011d3 | 55 | p22 = 22, |
sahilmgandhi | 18:6a4db94011d3 | 56 | p23 = 23, |
sahilmgandhi | 18:6a4db94011d3 | 57 | p24 = 24, |
sahilmgandhi | 18:6a4db94011d3 | 58 | p25 = 25, |
sahilmgandhi | 18:6a4db94011d3 | 59 | p26 = 26, |
sahilmgandhi | 18:6a4db94011d3 | 60 | p27 = 27, |
sahilmgandhi | 18:6a4db94011d3 | 61 | p28 = 28, |
sahilmgandhi | 18:6a4db94011d3 | 62 | p29 = 29, |
sahilmgandhi | 18:6a4db94011d3 | 63 | p30 = 30, |
sahilmgandhi | 18:6a4db94011d3 | 64 | p31 = 31, |
sahilmgandhi | 18:6a4db94011d3 | 65 | |
sahilmgandhi | 18:6a4db94011d3 | 66 | //NORMAL PINS... |
sahilmgandhi | 18:6a4db94011d3 | 67 | P0_0 = p0, |
sahilmgandhi | 18:6a4db94011d3 | 68 | P0_1 = p1, |
sahilmgandhi | 18:6a4db94011d3 | 69 | P0_2 = p2, |
sahilmgandhi | 18:6a4db94011d3 | 70 | P0_3 = p3, |
sahilmgandhi | 18:6a4db94011d3 | 71 | P0_4 = p4, |
sahilmgandhi | 18:6a4db94011d3 | 72 | P0_5 = p5, |
sahilmgandhi | 18:6a4db94011d3 | 73 | P0_6 = p6, |
sahilmgandhi | 18:6a4db94011d3 | 74 | P0_7 = p7, |
sahilmgandhi | 18:6a4db94011d3 | 75 | |
sahilmgandhi | 18:6a4db94011d3 | 76 | P0_8 = p8, |
sahilmgandhi | 18:6a4db94011d3 | 77 | P0_9 = p9, |
sahilmgandhi | 18:6a4db94011d3 | 78 | P0_10 = p10, |
sahilmgandhi | 18:6a4db94011d3 | 79 | P0_11 = p11, |
sahilmgandhi | 18:6a4db94011d3 | 80 | P0_12 = p12, |
sahilmgandhi | 18:6a4db94011d3 | 81 | P0_13 = p13, |
sahilmgandhi | 18:6a4db94011d3 | 82 | P0_14 = p14, |
sahilmgandhi | 18:6a4db94011d3 | 83 | P0_15 = p15, |
sahilmgandhi | 18:6a4db94011d3 | 84 | |
sahilmgandhi | 18:6a4db94011d3 | 85 | P0_16 = p16, |
sahilmgandhi | 18:6a4db94011d3 | 86 | P0_17 = p17, |
sahilmgandhi | 18:6a4db94011d3 | 87 | P0_18 = p18, |
sahilmgandhi | 18:6a4db94011d3 | 88 | P0_19 = p19, |
sahilmgandhi | 18:6a4db94011d3 | 89 | P0_20 = p20, |
sahilmgandhi | 18:6a4db94011d3 | 90 | P0_21 = p21, |
sahilmgandhi | 18:6a4db94011d3 | 91 | P0_22 = p22, |
sahilmgandhi | 18:6a4db94011d3 | 92 | P0_23 = p23, |
sahilmgandhi | 18:6a4db94011d3 | 93 | |
sahilmgandhi | 18:6a4db94011d3 | 94 | P0_24 = p24, |
sahilmgandhi | 18:6a4db94011d3 | 95 | P0_25 = p25, |
sahilmgandhi | 18:6a4db94011d3 | 96 | P0_26 = p26, |
sahilmgandhi | 18:6a4db94011d3 | 97 | P0_27 = p27, |
sahilmgandhi | 18:6a4db94011d3 | 98 | P0_28 = p28, |
sahilmgandhi | 18:6a4db94011d3 | 99 | P0_29 = p29, |
sahilmgandhi | 18:6a4db94011d3 | 100 | P0_30 = p30, |
sahilmgandhi | 18:6a4db94011d3 | 101 | P0_31 = p31, |
sahilmgandhi | 18:6a4db94011d3 | 102 | |
sahilmgandhi | 18:6a4db94011d3 | 103 | LED1 = p13, |
sahilmgandhi | 18:6a4db94011d3 | 104 | LED2 = p23, |
sahilmgandhi | 18:6a4db94011d3 | 105 | LED3 = p24, |
sahilmgandhi | 18:6a4db94011d3 | 106 | LED4 = p25, |
sahilmgandhi | 18:6a4db94011d3 | 107 | |
sahilmgandhi | 18:6a4db94011d3 | 108 | BUTTON1 = p20, |
sahilmgandhi | 18:6a4db94011d3 | 109 | BUTTON2 = p21, |
sahilmgandhi | 18:6a4db94011d3 | 110 | BUTTON3 = p22, |
sahilmgandhi | 18:6a4db94011d3 | 111 | BUTTON4 = p0, |
sahilmgandhi | 18:6a4db94011d3 | 112 | |
sahilmgandhi | 18:6a4db94011d3 | 113 | RX_PIN_NUMBER = p16, |
sahilmgandhi | 18:6a4db94011d3 | 114 | TX_PIN_NUMBER = p17, |
sahilmgandhi | 18:6a4db94011d3 | 115 | CTS_PIN_NUMBER = p20, |
sahilmgandhi | 18:6a4db94011d3 | 116 | RTS_PIN_NUMBER = p21, |
sahilmgandhi | 18:6a4db94011d3 | 117 | |
sahilmgandhi | 18:6a4db94011d3 | 118 | // mBed interface Pins |
sahilmgandhi | 18:6a4db94011d3 | 119 | USBTX = TX_PIN_NUMBER, |
sahilmgandhi | 18:6a4db94011d3 | 120 | USBRX = RX_PIN_NUMBER, |
sahilmgandhi | 18:6a4db94011d3 | 121 | |
sahilmgandhi | 18:6a4db94011d3 | 122 | SPI_PSELMOSI0 = p15, |
sahilmgandhi | 18:6a4db94011d3 | 123 | SPI_PSELMISO0 = p9, |
sahilmgandhi | 18:6a4db94011d3 | 124 | SPI_PSELSS0 = p29, |
sahilmgandhi | 18:6a4db94011d3 | 125 | SPI_PSELSCK0 = p11, |
sahilmgandhi | 18:6a4db94011d3 | 126 | |
sahilmgandhi | 18:6a4db94011d3 | 127 | SPI_PSELMOSI1 = p17, |
sahilmgandhi | 18:6a4db94011d3 | 128 | SPI_PSELMISO1 = p20, |
sahilmgandhi | 18:6a4db94011d3 | 129 | SPI_PSELSS1 = p16, |
sahilmgandhi | 18:6a4db94011d3 | 130 | SPI_PSELSCK1 = p21, |
sahilmgandhi | 18:6a4db94011d3 | 131 | |
sahilmgandhi | 18:6a4db94011d3 | 132 | SPIS_PSELMOSI = p17, |
sahilmgandhi | 18:6a4db94011d3 | 133 | SPIS_PSELMISO = p20, |
sahilmgandhi | 18:6a4db94011d3 | 134 | SPIS_PSELSS = p16, |
sahilmgandhi | 18:6a4db94011d3 | 135 | SPIS_PSELSCK = p21, |
sahilmgandhi | 18:6a4db94011d3 | 136 | |
sahilmgandhi | 18:6a4db94011d3 | 137 | I2C_SDA0 = p31, |
sahilmgandhi | 18:6a4db94011d3 | 138 | I2C_SCL0 = p30, |
sahilmgandhi | 18:6a4db94011d3 | 139 | |
sahilmgandhi | 18:6a4db94011d3 | 140 | D0 = p16, |
sahilmgandhi | 18:6a4db94011d3 | 141 | D1 = p17, |
sahilmgandhi | 18:6a4db94011d3 | 142 | D2 = p20, |
sahilmgandhi | 18:6a4db94011d3 | 143 | D3 = p21, |
sahilmgandhi | 18:6a4db94011d3 | 144 | D4 = p22, |
sahilmgandhi | 18:6a4db94011d3 | 145 | D5 = p0, |
sahilmgandhi | 18:6a4db94011d3 | 146 | D6 = p13, |
sahilmgandhi | 18:6a4db94011d3 | 147 | D7 = p23, |
sahilmgandhi | 18:6a4db94011d3 | 148 | |
sahilmgandhi | 18:6a4db94011d3 | 149 | D8 = p24, |
sahilmgandhi | 18:6a4db94011d3 | 150 | D9 = p25, |
sahilmgandhi | 18:6a4db94011d3 | 151 | D10 = p29, |
sahilmgandhi | 18:6a4db94011d3 | 152 | D11 = p15, |
sahilmgandhi | 18:6a4db94011d3 | 153 | D12 = p9, |
sahilmgandhi | 18:6a4db94011d3 | 154 | D13 = p11, |
sahilmgandhi | 18:6a4db94011d3 | 155 | |
sahilmgandhi | 18:6a4db94011d3 | 156 | D14 = p30, |
sahilmgandhi | 18:6a4db94011d3 | 157 | D15 = p31, |
sahilmgandhi | 18:6a4db94011d3 | 158 | |
sahilmgandhi | 18:6a4db94011d3 | 159 | A0 = p3, |
sahilmgandhi | 18:6a4db94011d3 | 160 | A1 = p4, |
sahilmgandhi | 18:6a4db94011d3 | 161 | A2 = p5, |
sahilmgandhi | 18:6a4db94011d3 | 162 | A3 = p6, |
sahilmgandhi | 18:6a4db94011d3 | 163 | A4 = p26, |
sahilmgandhi | 18:6a4db94011d3 | 164 | A5 = p27, |
sahilmgandhi | 18:6a4db94011d3 | 165 | |
sahilmgandhi | 18:6a4db94011d3 | 166 | // Not connected |
sahilmgandhi | 18:6a4db94011d3 | 167 | NC = (int)0xFFFFFFFF |
sahilmgandhi | 18:6a4db94011d3 | 168 | } PinName; |
sahilmgandhi | 18:6a4db94011d3 | 169 | |
sahilmgandhi | 18:6a4db94011d3 | 170 | typedef enum { |
sahilmgandhi | 18:6a4db94011d3 | 171 | PullNone = 0, |
sahilmgandhi | 18:6a4db94011d3 | 172 | PullDown = 1, |
sahilmgandhi | 18:6a4db94011d3 | 173 | PullUp = 3, |
sahilmgandhi | 18:6a4db94011d3 | 174 | PullDefault = PullUp |
sahilmgandhi | 18:6a4db94011d3 | 175 | } PinMode; |
sahilmgandhi | 18:6a4db94011d3 | 176 | |
sahilmgandhi | 18:6a4db94011d3 | 177 | #ifdef __cplusplus |
sahilmgandhi | 18:6a4db94011d3 | 178 | } |
sahilmgandhi | 18:6a4db94011d3 | 179 | #endif |
sahilmgandhi | 18:6a4db94011d3 | 180 | |
sahilmgandhi | 18:6a4db94011d3 | 181 | #endif |