t
Fork of mbed-dev by
targets/TARGET_NORDIC/TARGET_MCU_NRF51822/TARGET_NRF51_DK/PinNames.h@178:c26431f84b0d, 2017-11-09 (annotated)
- Committer:
- amithy
- Date:
- Thu Nov 09 22:14:37 2017 +0000
- Revision:
- 178:c26431f84b0d
- Parent:
- 149:156823d33999
test export
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
<> | 144:ef7eb2e8f9f7 | 1 | /* mbed Microcontroller Library |
<> | 144:ef7eb2e8f9f7 | 2 | * Copyright (c) 2013 Nordic Semiconductor |
<> | 144:ef7eb2e8f9f7 | 3 | * |
<> | 144:ef7eb2e8f9f7 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
<> | 144:ef7eb2e8f9f7 | 5 | * you may not use this file except in compliance with the License. |
<> | 144:ef7eb2e8f9f7 | 6 | * You may obtain a copy of the License at |
<> | 144:ef7eb2e8f9f7 | 7 | * |
<> | 144:ef7eb2e8f9f7 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
<> | 144:ef7eb2e8f9f7 | 9 | * |
<> | 144:ef7eb2e8f9f7 | 10 | * Unless required by applicable law or agreed to in writing, software |
<> | 144:ef7eb2e8f9f7 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
<> | 144:ef7eb2e8f9f7 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
<> | 144:ef7eb2e8f9f7 | 13 | * See the License for the specific language governing permissions and |
<> | 144:ef7eb2e8f9f7 | 14 | * limitations under the License. |
<> | 144:ef7eb2e8f9f7 | 15 | */ |
<> | 144:ef7eb2e8f9f7 | 16 | #ifndef MBED_PINNAMES_H |
<> | 144:ef7eb2e8f9f7 | 17 | #define MBED_PINNAMES_H |
<> | 144:ef7eb2e8f9f7 | 18 | |
<> | 144:ef7eb2e8f9f7 | 19 | #include "cmsis.h" |
<> | 144:ef7eb2e8f9f7 | 20 | |
<> | 144:ef7eb2e8f9f7 | 21 | #ifdef __cplusplus |
<> | 144:ef7eb2e8f9f7 | 22 | extern "C" { |
<> | 144:ef7eb2e8f9f7 | 23 | #endif |
<> | 144:ef7eb2e8f9f7 | 24 | |
<> | 144:ef7eb2e8f9f7 | 25 | typedef enum { |
<> | 144:ef7eb2e8f9f7 | 26 | PIN_INPUT, |
<> | 144:ef7eb2e8f9f7 | 27 | PIN_OUTPUT |
<> | 144:ef7eb2e8f9f7 | 28 | } PinDirection; |
<> | 144:ef7eb2e8f9f7 | 29 | |
<> | 144:ef7eb2e8f9f7 | 30 | #define PORT_SHIFT 3 |
<> | 144:ef7eb2e8f9f7 | 31 | |
<> | 144:ef7eb2e8f9f7 | 32 | typedef enum { |
<> | 144:ef7eb2e8f9f7 | 33 | p0 = 0, |
<> | 144:ef7eb2e8f9f7 | 34 | p1 = 1, |
<> | 144:ef7eb2e8f9f7 | 35 | p2 = 2, |
<> | 144:ef7eb2e8f9f7 | 36 | p3 = 3, |
<> | 144:ef7eb2e8f9f7 | 37 | p4 = 4, |
<> | 144:ef7eb2e8f9f7 | 38 | p5 = 5, |
<> | 144:ef7eb2e8f9f7 | 39 | p6 = 6, |
<> | 144:ef7eb2e8f9f7 | 40 | p7 = 7, |
<> | 144:ef7eb2e8f9f7 | 41 | p8 = 8, |
<> | 144:ef7eb2e8f9f7 | 42 | p9 = 9, |
<> | 144:ef7eb2e8f9f7 | 43 | p10 = 10, |
<> | 144:ef7eb2e8f9f7 | 44 | p11 = 11, |
<> | 144:ef7eb2e8f9f7 | 45 | p12 = 12, |
<> | 144:ef7eb2e8f9f7 | 46 | p13 = 13, |
<> | 144:ef7eb2e8f9f7 | 47 | p14 = 14, |
<> | 144:ef7eb2e8f9f7 | 48 | p15 = 15, |
<> | 144:ef7eb2e8f9f7 | 49 | p16 = 16, |
<> | 144:ef7eb2e8f9f7 | 50 | p17 = 17, |
<> | 144:ef7eb2e8f9f7 | 51 | p18 = 18, |
<> | 144:ef7eb2e8f9f7 | 52 | p19 = 19, |
<> | 144:ef7eb2e8f9f7 | 53 | p20 = 20, |
<> | 144:ef7eb2e8f9f7 | 54 | p21 = 21, |
<> | 144:ef7eb2e8f9f7 | 55 | p22 = 22, |
<> | 144:ef7eb2e8f9f7 | 56 | p23 = 23, |
<> | 144:ef7eb2e8f9f7 | 57 | p24 = 24, |
<> | 144:ef7eb2e8f9f7 | 58 | p25 = 25, |
<> | 144:ef7eb2e8f9f7 | 59 | p26 = 26, |
<> | 144:ef7eb2e8f9f7 | 60 | p27 = 27, |
<> | 144:ef7eb2e8f9f7 | 61 | p28 = 28, |
<> | 144:ef7eb2e8f9f7 | 62 | p29 = 29, |
<> | 144:ef7eb2e8f9f7 | 63 | p30 = 30, |
<> | 144:ef7eb2e8f9f7 | 64 | |
<> | 144:ef7eb2e8f9f7 | 65 | P0_0 = p0, |
<> | 144:ef7eb2e8f9f7 | 66 | P0_1 = p1, |
<> | 144:ef7eb2e8f9f7 | 67 | P0_2 = p2, |
<> | 144:ef7eb2e8f9f7 | 68 | P0_3 = p3, |
<> | 144:ef7eb2e8f9f7 | 69 | P0_4 = p4, |
<> | 144:ef7eb2e8f9f7 | 70 | P0_5 = p5, |
<> | 144:ef7eb2e8f9f7 | 71 | P0_6 = p6, |
<> | 144:ef7eb2e8f9f7 | 72 | P0_7 = p7, |
<> | 144:ef7eb2e8f9f7 | 73 | |
<> | 144:ef7eb2e8f9f7 | 74 | P0_8 = p8, |
<> | 144:ef7eb2e8f9f7 | 75 | P0_9 = p9, |
<> | 144:ef7eb2e8f9f7 | 76 | P0_10 = p10, |
<> | 144:ef7eb2e8f9f7 | 77 | P0_11 = p11, |
<> | 144:ef7eb2e8f9f7 | 78 | P0_12 = p12, |
<> | 144:ef7eb2e8f9f7 | 79 | P0_13 = p13, |
<> | 144:ef7eb2e8f9f7 | 80 | P0_14 = p14, |
<> | 144:ef7eb2e8f9f7 | 81 | P0_15 = p15, |
<> | 144:ef7eb2e8f9f7 | 82 | |
<> | 144:ef7eb2e8f9f7 | 83 | P0_16 = p16, |
<> | 144:ef7eb2e8f9f7 | 84 | P0_17 = p17, |
<> | 144:ef7eb2e8f9f7 | 85 | P0_18 = p18, |
<> | 144:ef7eb2e8f9f7 | 86 | P0_19 = p19, |
<> | 144:ef7eb2e8f9f7 | 87 | P0_20 = p20, |
<> | 144:ef7eb2e8f9f7 | 88 | P0_21 = p21, |
<> | 144:ef7eb2e8f9f7 | 89 | P0_22 = p22, |
<> | 144:ef7eb2e8f9f7 | 90 | P0_23 = p23, |
<> | 144:ef7eb2e8f9f7 | 91 | |
<> | 144:ef7eb2e8f9f7 | 92 | P0_24 = p24, |
<> | 144:ef7eb2e8f9f7 | 93 | P0_25 = p25, |
<> | 144:ef7eb2e8f9f7 | 94 | P0_26 = p26, |
<> | 144:ef7eb2e8f9f7 | 95 | P0_27 = p27, |
<> | 144:ef7eb2e8f9f7 | 96 | P0_28 = p28, |
<> | 144:ef7eb2e8f9f7 | 97 | P0_29 = p29, |
<> | 144:ef7eb2e8f9f7 | 98 | P0_30 = p30, |
<> | 144:ef7eb2e8f9f7 | 99 | |
<> | 144:ef7eb2e8f9f7 | 100 | LED1 = p21, |
<> | 144:ef7eb2e8f9f7 | 101 | LED2 = p22, |
<> | 144:ef7eb2e8f9f7 | 102 | LED3 = p23, |
<> | 144:ef7eb2e8f9f7 | 103 | LED4 = p24, |
<> | 144:ef7eb2e8f9f7 | 104 | |
<> | 144:ef7eb2e8f9f7 | 105 | BUTTON1 = p17, |
<> | 144:ef7eb2e8f9f7 | 106 | BUTTON2 = p18, |
<> | 144:ef7eb2e8f9f7 | 107 | BUTTON3 = p19, |
<> | 144:ef7eb2e8f9f7 | 108 | BUTTON4 = p20, |
<> | 144:ef7eb2e8f9f7 | 109 | |
<> | 144:ef7eb2e8f9f7 | 110 | RX_PIN_NUMBER = p11, |
<> | 144:ef7eb2e8f9f7 | 111 | TX_PIN_NUMBER = p9, |
<> | 144:ef7eb2e8f9f7 | 112 | CTS_PIN_NUMBER = p10, |
<> | 144:ef7eb2e8f9f7 | 113 | RTS_PIN_NUMBER = p8, |
<> | 144:ef7eb2e8f9f7 | 114 | |
<> | 144:ef7eb2e8f9f7 | 115 | // mBed interface Pins |
<> | 144:ef7eb2e8f9f7 | 116 | USBTX = TX_PIN_NUMBER, |
<> | 144:ef7eb2e8f9f7 | 117 | USBRX = RX_PIN_NUMBER, |
<> | 144:ef7eb2e8f9f7 | 118 | |
<> | 144:ef7eb2e8f9f7 | 119 | SPI_PSELMOSI0 = p25, |
<> | 144:ef7eb2e8f9f7 | 120 | SPI_PSELMISO0 = p28, |
<> | 144:ef7eb2e8f9f7 | 121 | SPI_PSELSS0 = p24, |
<> | 144:ef7eb2e8f9f7 | 122 | SPI_PSELSCK0 = p29, |
<> | 144:ef7eb2e8f9f7 | 123 | |
<> | 144:ef7eb2e8f9f7 | 124 | SPI_PSELMOSI1 = p13, |
<> | 144:ef7eb2e8f9f7 | 125 | SPI_PSELMISO1 = p14, |
<> | 144:ef7eb2e8f9f7 | 126 | SPI_PSELSS1 = p12, |
<> | 144:ef7eb2e8f9f7 | 127 | SPI_PSELSCK1 = p15, |
<> | 144:ef7eb2e8f9f7 | 128 | |
<> | 144:ef7eb2e8f9f7 | 129 | SPIS_PSELMOSI = p13, |
<> | 144:ef7eb2e8f9f7 | 130 | SPIS_PSELMISO = p14, |
<> | 144:ef7eb2e8f9f7 | 131 | SPIS_PSELSS = p12, |
<> | 144:ef7eb2e8f9f7 | 132 | SPIS_PSELSCK = p15, |
<> | 144:ef7eb2e8f9f7 | 133 | |
<> | 144:ef7eb2e8f9f7 | 134 | I2C_SDA0 = p30, |
<> | 144:ef7eb2e8f9f7 | 135 | I2C_SCL0 = p7, |
<> | 144:ef7eb2e8f9f7 | 136 | |
<> | 144:ef7eb2e8f9f7 | 137 | D0 = p12, |
<> | 144:ef7eb2e8f9f7 | 138 | D1 = p13, |
<> | 144:ef7eb2e8f9f7 | 139 | D2 = p14, |
<> | 144:ef7eb2e8f9f7 | 140 | D3 = p15, |
<> | 144:ef7eb2e8f9f7 | 141 | D4 = p16, |
<> | 144:ef7eb2e8f9f7 | 142 | D5 = p17, |
<> | 144:ef7eb2e8f9f7 | 143 | D6 = p18, |
<> | 144:ef7eb2e8f9f7 | 144 | D7 = p19, |
<> | 144:ef7eb2e8f9f7 | 145 | |
<> | 144:ef7eb2e8f9f7 | 146 | D8 = p20, |
<> | 144:ef7eb2e8f9f7 | 147 | D9 = p23, |
<> | 144:ef7eb2e8f9f7 | 148 | D10 = p24, |
<> | 144:ef7eb2e8f9f7 | 149 | D11 = p25, |
<> | 144:ef7eb2e8f9f7 | 150 | D12 = p28, |
<> | 144:ef7eb2e8f9f7 | 151 | D13 = p29, |
<> | 144:ef7eb2e8f9f7 | 152 | |
<> | 144:ef7eb2e8f9f7 | 153 | D14 = p30, |
<> | 144:ef7eb2e8f9f7 | 154 | D15 = p7, |
<> | 144:ef7eb2e8f9f7 | 155 | |
<> | 144:ef7eb2e8f9f7 | 156 | A0 = p1, |
<> | 144:ef7eb2e8f9f7 | 157 | A1 = p2, |
<> | 144:ef7eb2e8f9f7 | 158 | A2 = p3, |
<> | 144:ef7eb2e8f9f7 | 159 | A3 = p4, |
<> | 144:ef7eb2e8f9f7 | 160 | A4 = p5, |
<> | 144:ef7eb2e8f9f7 | 161 | A5 = p6, |
<> | 144:ef7eb2e8f9f7 | 162 | |
<> | 144:ef7eb2e8f9f7 | 163 | // Not connected |
<> | 144:ef7eb2e8f9f7 | 164 | NC = (int)0xFFFFFFFF |
<> | 144:ef7eb2e8f9f7 | 165 | } PinName; |
<> | 144:ef7eb2e8f9f7 | 166 | |
<> | 144:ef7eb2e8f9f7 | 167 | typedef enum { |
<> | 144:ef7eb2e8f9f7 | 168 | PullNone = 0, |
<> | 144:ef7eb2e8f9f7 | 169 | PullDown = 1, |
<> | 144:ef7eb2e8f9f7 | 170 | PullUp = 3, |
<> | 144:ef7eb2e8f9f7 | 171 | PullDefault = PullUp |
<> | 144:ef7eb2e8f9f7 | 172 | } PinMode; |
<> | 144:ef7eb2e8f9f7 | 173 | |
<> | 144:ef7eb2e8f9f7 | 174 | #ifdef __cplusplus |
<> | 144:ef7eb2e8f9f7 | 175 | } |
<> | 144:ef7eb2e8f9f7 | 176 | #endif |
<> | 144:ef7eb2e8f9f7 | 177 | |
<> | 144:ef7eb2e8f9f7 | 178 | #endif |