]> git.donarmstrong.com Git - qmk_firmware.git/blob - tmk_core/tool/mbed/mbed-sdk/libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/TARGET_NRF51822_SBKIT/PinNames.h
Merge commit '1fe4406f374291ab2e86e95a97341fd9c475fcb8'
[qmk_firmware.git] / tmk_core / tool / mbed / mbed-sdk / libraries / mbed / targets / hal / TARGET_NORDIC / TARGET_MCU_NRF51822 / TARGET_NRF51822_SBKIT / 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     p5  = 5,
38     p8  = 8,
39     p9  = 9,
40     p11 = 11,
41     p12 = 12,
42     p15 = 15,
43     p16 = 16,
44     p18 = 18,
45     p20 = 20,
46     p21 = 21,
47     p24 = 24,
48
49     P0_0  = p0,
50     P0_1  = p1,
51     P0_2  = p2,
52     P0_3  = p3,
53     P0_5  = p5,
54
55     P0_8  = p8,
56     P0_9  = p9,
57     P0_11 = p11,
58     P0_12 = p12,
59     P0_15 = p15,
60
61     P0_16 = p16,
62     P0_18 = p18,
63     P0_20 = p20,
64     P0_21 = p21,
65
66     P0_24 = p24,
67
68     LED1    = p16,
69     LED2    = p12,
70     LED3    = p15,
71     LEDR    = LED1,
72     LEDG    = LED2,
73     LEDB    = LED3,
74
75     BUTTON1 = p8,
76     BUTTON2 = p18,
77
78     RX_PIN_NUMBER  = p21,
79     TX_PIN_NUMBER  = p24,
80     CTS_PIN_NUMBER = p0,
81     RTS_PIN_NUMBER = p20,
82
83     SPI_PSELMOSI0 = p2,
84     SPI_PSELMISO0 = p5,
85     SPI_PSELSS0   = p1,
86     SPI_PSELSCK0  = p3,
87
88     I2C_SDA0 = p9,
89     I2C_SCL0 = p11,
90
91     // Not connected
92     NC = (int)0xFFFFFFFF
93 } PinName;
94
95 typedef enum {
96     PullNone = 0,
97     PullDown = 1,
98     PullUp = 3,
99     PullDefault = PullUp
100 } PinMode;
101
102 #ifdef __cplusplus
103 }
104 #endif
105
106 #endif