Skip to content

Commit 8f79b6d

Browse files
pan-sg-
authored andcommitted
NORDIC - Update NRF51_DONGLE target to takes advantage of the NRF5 implementation
of BLE and device drivers.
1 parent 9dd0c67 commit 8f79b6d

File tree

3 files changed

+190
-1
lines changed

3 files changed

+190
-1
lines changed

hal/targets.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1531,7 +1531,7 @@
15311531
"extra_labels_add": ["NRF51_DK"],
15321532
"macros_add": ["TARGET_NRF51_DK"]
15331533
},
1534-
"NRF51_DONGLE": {
1534+
"NRF51_DONGLE_LEGACY": {
15351535
"inherits": ["MCU_NRF51_32K"],
15361536
"progen": {"target": "nrf51-dongle"},
15371537
"release_versions": ["2"]
@@ -1979,6 +1979,12 @@
19791979
"device_has": ["ANALOGIN", "ERROR_PATTERN", "I2C", "I2C_ASYNCH", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPI_ASYNCH", "SPISLAVE"],
19801980
"release_versions": ["2", "5"]
19811981
},
1982+
"NRF51_DONGLE": {
1983+
"inherits": ["MCU_NRF51_32K_UNIFIED"],
1984+
"progen": {"target": "nrf51-dongle"},
1985+
"device_has": ["ANALOGIN", "ERROR_PATTERN", "I2C", "I2C_ASYNCH", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPI_ASYNCH", "SPISLAVE"],
1986+
"release_versions": ["2", "5"]
1987+
},
19821988
"MCU_NRF52": {
19831989
"inherits": ["Target"],
19841990
"core": "Cortex-M4F",
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
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+
p28 = 28,
60+
p29 = 29,
61+
p30 = 30,
62+
63+
P0_0 = p0,
64+
P0_1 = p1,
65+
P0_2 = p2,
66+
P0_3 = p3,
67+
P0_4 = p4,
68+
P0_5 = p5,
69+
P0_6 = p6,
70+
P0_7 = p7,
71+
72+
P0_8 = p8,
73+
P0_9 = p9,
74+
P0_10 = p10,
75+
P0_11 = p11,
76+
P0_12 = p12,
77+
P0_13 = p13,
78+
P0_14 = p14,
79+
P0_15 = p15,
80+
81+
P0_16 = p16,
82+
P0_17 = p17,
83+
P0_18 = p18,
84+
P0_19 = p19,
85+
P0_20 = p20,
86+
P0_21 = p21,
87+
P0_22 = p22,
88+
P0_23 = p23,
89+
90+
P0_24 = p24,
91+
P0_25 = p25,
92+
P0_28 = p28,
93+
P0_29 = p29,
94+
95+
LED1 = p21,
96+
LED2 = p22,
97+
LED3 = p23,
98+
LED4 = p23,
99+
LEDR = LED1,
100+
LEDG = LED2,
101+
LEDB = LED3,
102+
103+
RX_PIN_NUMBER = p11,
104+
TX_PIN_NUMBER = p9,
105+
CTS_PIN_NUMBER = p10,
106+
RTS_PIN_NUMBER = p8,
107+
108+
// mBed interface Pins
109+
USBTX = TX_PIN_NUMBER,
110+
USBRX = RX_PIN_NUMBER,
111+
112+
SPI_PSELMOSI0 = p15,
113+
SPI_PSELMISO0 = p16,
114+
SPI_PSELSS0 = p17,
115+
SPI_PSELSCK0 = p18,
116+
117+
SPI_PSELMOSI1 = p15,
118+
SPI_PSELMISO1 = p16,
119+
SPI_PSELSS1 = p17,
120+
SPI_PSELSCK1 = p18,
121+
122+
SPIS_PSELMOSI = p15,
123+
SPIS_PSELMISO = p16,
124+
SPIS_PSELSS = p17,
125+
SPIS_PSELSCK = p18,
126+
127+
I2C_SDA0 = p19,
128+
I2C_SCL0 = p20,
129+
130+
// Not connected
131+
NC = (int)0xFFFFFFFF
132+
} PinName;
133+
134+
typedef enum {
135+
PullNone = 0,
136+
PullDown = 1,
137+
PullUp = 3,
138+
PullDefault = PullUp
139+
} PinMode;
140+
141+
#ifdef __cplusplus
142+
}
143+
#endif
144+
145+
#endif
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// The 'features' section in 'target.json' is now used to create the device's hardware preprocessor switches.
2+
// Check the 'features' section of the target description in 'targets.json' for more details.
3+
/* mbed Microcontroller Library
4+
* Copyright (c) 2006-2013 ARM Limited
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
#ifndef MBED_DEVICE_H
19+
#define MBED_DEVICE_H
20+
21+
22+
23+
24+
25+
26+
27+
28+
29+
30+
31+
32+
33+
34+
35+
36+
#include "objects.h"
37+
38+
#endif

0 commit comments

Comments
 (0)