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