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