Skip to content

Commit 9b701f6

Browse files
No Ports reduced to 1
Licensing headers replaced with mbed Apache. SPI/SPIS pin configuration is done via PIN_CNF
1 parent 5038233 commit 9b701f6

File tree

10 files changed

+207
-181
lines changed

10 files changed

+207
-181
lines changed

libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_NRF51822/TOOLCHAIN_ARM_STD/startup_nRF51822.s

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
; Copyright (c) 2009 Nordic Semiconductor. All Rights Reserved.
2-
;
3-
; The information contained herein is property of Nordic Semiconductor ASA.
4-
; Terms and conditions of usage are described in detail in NORDIC
5-
; SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
6-
;
7-
; Licensees are granted free, non-transferable use of the information. NO
8-
; WARRANTY of ANY KIND is provided. This heading must NOT be removed from
9-
; the file.
10-
11-
; NOTE: Template files (including this one) are application specific and therefore
12-
; expected to be copied into the application project folder prior to its use!
1+
; mbed Microcontroller Library
2+
; Copyright (c) 2006-2013 ARM Limited
3+
;Licensed under the Apache License, Version 2.0 (the "License");
4+
;you may not use this file except in compliance with the License.
5+
;You may obtain a copy of the License at
6+
;http://www.apache.org/licenses/LICENSE-2.0
7+
;Unless required by applicable law or agreed to in writing, software
8+
;distributed under the License is distributed on an "AS IS" BASIS,
9+
;WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
;See the License for the specific language governing permissions and
11+
;limitations under the License.
1312

1413
; Description message
1514

libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_NRF51822/nrf51.h

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,19 @@
1+
/* mbed Microcontroller Library
12
2-
/****************************************************************************************************//**
3-
* @file nRF51.h
3+
* Copyright (c) 2006-2013 ARM Limited
44
*
5-
* @brief CMSIS Cortex-M0 Peripheral Access Layer Header File for
6-
* nRF51 from Nordic Semiconductor.
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
78
*
8-
* @version V2.4C
9-
* @date 31. October 2013
9+
* http://www.apache.org/licenses/LICENSE-2.0
1010
*
11-
* @note Generated with SVDConv V2.77p
12-
* from CMSIS SVD File 'nRF51.xml' Version 2.4C,
13-
*
14-
* @par Copyright (c) 2009 Nordic Semiconductor. All Rights Reserved.
15-
*
16-
* The information contained herein is property of Nordic Semiconductor ASA.
17-
* Terms and conditions of usage are described in detail in NORDIC
18-
* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
19-
*
20-
* Licensees are granted free, non-transferable use of the information. NO
21-
* WARRANTY of ANY KIND is provided. This heading must NOT be removed from
22-
* the file.
23-
*
24-
*
25-
*******************************************************************************************************/
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
2617

2718

2819

libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_NRF51822/nrf51822.h

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
/* Copyright (c) 2009 Nordic Semiconductor. All Rights Reserved.
1+
/* mbed Microcontroller Library
2+
3+
* Copyright (c) 2006-2013 ARM Limited
24
*
3-
* The information contained herein is property of Nordic Semiconductor ASA.
4-
* Terms and conditions of usage are described in detail in NORDIC
5-
* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
68
*
7-
* Licensees are granted free, non-transferable use of the information. NO
8-
* WARRANTY of ANY KIND is provided. This heading must NOT be removed from
9-
* the file.
9+
* http://www.apache.org/licenses/LICENSE-2.0
1010
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
1116
*/
1217

1318

libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_NRF51822/system_nrf51822.c

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
/* Copyright (c) 2009 Nordic Semiconductor. All Rights Reserved.
1+
/* mbed Microcontroller Library
2+
3+
* Copyright (c) 2006-2013 ARM Limited
24
*
3-
* The information contained herein is property of Nordic Semiconductor ASA.
4-
* Terms and conditions of usage are described in detail in NORDIC
5-
* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
68
*
7-
* Licensees are granted free, non-transferable use of the information. NO
8-
* WARRANTY of ANY KIND is provided. This heading must NOT be removed from
9-
* the file.
9+
* http://www.apache.org/licenses/LICENSE-2.0
1010
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
1116
*/
1217

1318

@@ -88,8 +93,7 @@ void SystemInit(void)
8893
NRF_CLOCK->TASKS_HFCLKSTART = 1;
8994

9095
// Wait for the external oscillator to start up.
91-
while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0)
92-
{
96+
while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0) {
9397
// Do nothing.
9498
}
9599
}

libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_NRF51822/system_nrf51822.h

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
/* Copyright (c) 2009 Nordic Semiconductor. All Rights Reserved.
1+
/* mbed Microcontroller Library
2+
3+
* Copyright (c) 2006-2013 ARM Limited
24
*
3-
* The information contained herein is property of Nordic Semiconductor ASA.
4-
* Terms and conditions of usage are described in detail in NORDIC
5-
* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
68
*
7-
* Licensees are granted free, non-transferable use of the information. NO
8-
* WARRANTY of ANY KIND is provided. This heading must NOT be removed from
9-
* the file.
9+
* http://www.apache.org/licenses/LICENSE-2.0
1010
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
1116
*/
1217

1318

@@ -34,16 +39,6 @@ extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
3439
*/
3540
extern void SystemInit (void);
3641

37-
/**
38-
* Enable Soft Device
39-
*
40-
* @param none
41-
* @return none
42-
*
43-
* @brief Initializes softdevice with NRF_CLOCK_LFCLKSRC_XTAL_20_PPM
44-
*/
45-
extern void EnableSoftDevice (void);
46-
4742

4843
/**
4944
* Update SystemCoreClock variable

libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_NRF51822/PinNames.h

Lines changed: 78 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -30,92 +30,88 @@ typedef enum {
3030
#define PORT_SHIFT 3
3131

3232
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,
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,
6464
// p31=31,
6565

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,
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,
7474

75-
P1_0 = p8,
76-
P1_1 = p9,
77-
P1_2 = p10,
78-
P1_3 = p11,
79-
P1_4 = p12,
80-
P1_5 = p13,
81-
P1_6 = p14,
82-
P1_7 = p15,
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,
8383

84-
P2_0 = p16,
85-
P2_1 = p17,
86-
P2_2 = p18,
87-
P2_3 = p19,
88-
P2_4 = p20,
89-
P2_5 = p21,
90-
P2_6 = p22,
91-
P2_7 = p23,
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,
9292

93-
P3_0 = p24,
94-
P3_1 = p25,
95-
P3_2 = p26,
96-
P3_3 = p27,
97-
P3_4 = p28,
98-
P3_5 = p29,
99-
P3_6 = p30,
100-
//P3_7 = p31,
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,
101100

102-
LED_START = p18,
103-
LED_STOP = p19,
104-
LED1 = LED_START,
105-
LED2 = LED_STOP,
106-
LED3 = LED_START,
107-
LED4 = LED_STOP,
101+
LED1 = p18,
102+
LED2 = p19,
103+
LED3 = p18,
104+
LED4 = p19,
108105

109-
BUTTON_START = p16,
110-
BUTTON_STOP = p17,
111-
BUTTON0 = BUTTON_START,
112-
BUTTON1 = BUTTON_STOP,
113-
// USB Pins
106+
BUTTON0 = p16,
107+
BUTTON1 = p17,
108+
114109
RX_PIN_NUMBER = p11,
115110
TX_PIN_NUMBER = p9,
116111
CTS_PIN_NUMBER = p10,
117112
RTS_PIN_NUMBER = p8,
118-
113+
114+
// mBed interface Pins
119115
USBTX = TX_PIN_NUMBER,
120116
USBRX = RX_PIN_NUMBER,
121117

@@ -133,15 +129,20 @@ typedef enum {
133129
SPIS_PSELMISO = p13,
134130
SPIS_PSELSS = p14,
135131
SPIS_PSELSCK = p15,
136-
132+
133+
I2C_SDA0 = p22,
134+
I2C_SCL0 = p20,
135+
136+
I2C_SDA1 = p13,
137+
I2C_SCL1 = p15,
137138
// Not connected
138139
NC = (int)0xFFFFFFFF
139140
} PinName;
140141

141142
typedef enum {
142143
PullNone = 0,
143144
PullDown = 1,
144-
PullUp = 3,
145+
PullUp = 3
145146
} PinMode;
146147

147148
#ifdef __cplusplus

libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_NRF51822/PortNames.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@ extern "C" {
2121
#endif
2222

2323
typedef enum {
24-
Port0 = 0, //GPIO pins 0-7
25-
Port1 = 1, //GPIO pins 8-15
26-
Port2 = 2, //GPIO pins 16-22
27-
Port3 = 3, //GPIO pins 24-31
24+
Port0 = 0 //GPIO pins 0-31
2825
} PortName;
2926

3027
#ifdef __cplusplus

libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_NRF51822/gpio_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ void gpio_init(gpio_t *obj, PinName pin, PinDirection direction) {
2020
if(pin == NC) return;
2121

2222
obj->pin = pin;
23-
obj->mask = (1<<pin);
23+
obj->mask = (1ul<<pin);
2424

2525
obj->reg_set = &NRF_GPIO->OUTSET;
2626
obj->reg_clr = &NRF_GPIO->OUTCLR;

0 commit comments

Comments
 (0)