Skip to content

Commit 07722e7

Browse files
author
Rohit Grover
committed
adding pinmap definition for the smart-beacon-kit
1 parent 342790b commit 07722e7

File tree

2 files changed

+163
-0
lines changed
  • libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/TARGET_NRF51822_SBKIT

2 files changed

+163
-0
lines changed
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
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
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2006-2013 ARM Limited
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_DEVICE_H
17+
#define MBED_DEVICE_H
18+
19+
#define DEVICE_PORTIN 1
20+
#define DEVICE_PORTOUT 1
21+
#define DEVICE_PORTINOUT 1
22+
23+
#define DEVICE_INTERRUPTIN 1
24+
25+
#define DEVICE_ANALOGIN 1
26+
#define DEVICE_ANALOGOUT 0
27+
28+
#define DEVICE_SERIAL 1
29+
30+
#define DEVICE_I2C 1
31+
#define DEVICE_I2CSLAVE 0
32+
33+
#define DEVICE_SPI 1
34+
#define DEVICE_SPISLAVE 1
35+
36+
#define DEVICE_CAN 0
37+
38+
#define DEVICE_RTC 0
39+
40+
#define DEVICE_ETHERNET 0
41+
42+
#define DEVICE_PWMOUT 1
43+
44+
#define DEVICE_SEMIHOST 0
45+
#define DEVICE_LOCALFILESYSTEM 0
46+
47+
#define DEVICE_SLEEP 1
48+
49+
#define DEVICE_DEBUG_AWARENESS 0
50+
51+
#define DEVICE_STDIO_MESSAGES 0
52+
53+
#define DEVICE_ERROR_PATTERN 1
54+
55+
#include "objects.h"
56+
57+
#endif

0 commit comments

Comments
 (0)