Skip to content

Commit 9f80c90

Browse files
committed
Merge pull request #866 from Marcomissyou/master
Add a new target DELTA_DFCM_NNN40
2 parents 0c8d800 + f2a04da commit 9f80c90

File tree

14 files changed

+956
-5
lines changed

14 files changed

+956
-5
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* mbed Microcontroller Library
22
3-
* Copyright (c) 2013 Nordic Semiconductor.
3+
* Copyright (c) 2015 Nordic Semiconductor.
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -21,8 +21,12 @@
2121
#include "nrf51822.h"
2222
#include "system_nrf51822.h"
2323

24+
#ifdef TARGET_DELTA_DFCM_NNN40
2425

25-
#define __SYSTEM_CLOCK (16000000UL) /*!< nRF51 devices use a fixed System Clock Frequency of 16MHz */
26+
#define __SYSTEM_CLOCK (32000000UL) /*!< nRF51 devices use a fixed System Clock Frequency of 32MHz */
27+
#else
28+
#define __SYSTEM_CLOCK (16000000UL) /*!< nRF51 devices use a fixed System Clock Frequency of 16MHz */
29+
#endif
2630

2731
static bool is_manual_peripheral_setup_needed(void);
2832
static bool is_disabled_in_debug_needed(void);
@@ -67,7 +71,7 @@ void SystemInit(void)
6771

6872
// Start the external 32khz crystal oscillator.
6973

70-
#ifdef TARGET_HRM1017
74+
#ifdef TARGET_DELTA_DFCM_NNN40 || TARGET_HRM1017
7175
NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_RC << CLOCK_LFCLKSRC_SRC_Pos);
7276
#else
7377
NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos);
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2015 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+
NC = (int)0xFFFFFFFF,
34+
p0 = 0,
35+
p1 = 1,
36+
p2 = 2,
37+
p3 = 3,
38+
p4 = 4,
39+
p5 = 5,
40+
p6 = 6,
41+
p7 = 7,
42+
p8 = NC,
43+
p9 = NC,
44+
p10 = NC,
45+
p11 = NC,
46+
p12 = NC,
47+
p13 = 13,
48+
p14 = NC,
49+
p15 = NC,
50+
p16 = 16,
51+
p17 = 17,
52+
p18 = NC,
53+
p19 = 19,
54+
p20 = 20,
55+
p21 = 21,
56+
p22 = 22,
57+
p23 = 23,
58+
p24 = 24,
59+
p25 = 25,
60+
p26 = 26,
61+
p27 = 27,
62+
p28 = NC,
63+
p29 = 29,
64+
p30 = 30,
65+
p31 = 31,
66+
67+
LED1 = p7,
68+
LED2 = p13,
69+
70+
BUTTON0 = p16,
71+
BUTTON1 = p17,
72+
73+
RX_PIN_NUMBER = p23,
74+
TX_PIN_NUMBER = p25,
75+
76+
// mBed interface Pins
77+
USBTX = TX_PIN_NUMBER,
78+
USBRX = RX_PIN_NUMBER,
79+
80+
SPI_PSELMOSI0 = p24,
81+
SPI_PSELMISO0 = p29,
82+
SPI_PSELSS0 = p6,
83+
SPI_PSELSCK0 = p21,
84+
85+
SPIS_PSELMOSI = p24,
86+
SPIS_PSELMISO = p29,
87+
SPIS_PSELSS = p6,
88+
SPIS_PSELSCK = p21,
89+
90+
I2C_SDA0 = p22,
91+
I2C_SCL0 = p20,
92+
93+
A0 = p0,
94+
A1 = p1,
95+
A2 = p2,
96+
A3 = p3,
97+
A4 = p4,
98+
A5 = p5,
99+
100+
SWIO = p19,
101+
VERF0 = p0,
102+
// Not connected
103+
104+
CTS_PIN_NUMBER = NC,
105+
RTS_PIN_NUMBER = NC,
106+
SPI_PSELMOSI1 = NC,
107+
SPI_PSELMISO1 = NC,
108+
SPI_PSELSS1 = NC,
109+
SPI_PSELSCK1 = NC,
110+
LED3 = NC,
111+
LED4 = NC
112+
} PinName;
113+
114+
typedef enum {
115+
PullNone = 0,
116+
PullDown = 1,
117+
PullUp = 3,
118+
PullDefault = PullUp
119+
} PinMode;
120+
121+
#ifdef __cplusplus
122+
}
123+
#endif
124+
125+
#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-2015 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 1
50+
51+
#define DEVICE_STDIO_MESSAGES 0
52+
53+
#define DEVICE_ERROR_PATTERN 1
54+
55+
#include "objects.h"
56+
57+
#endif
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2015, Cyntec
3+
*/
4+
#include "cmsis.h"
5+
6+
// This function is called after RAM initialization and before main.
7+
void mbed_sdk_init()
8+
{
9+
// Default SWIO setting, pull SWIO(p19) to low for turning antenna switch to BLE radiated path.
10+
#ifdef TARGET_DELTA_DFCM_NNN40
11+
NRF_GPIO->PIN_CNF[19] = (GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos)
12+
| (GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos)
13+
| (GPIO_PIN_CNF_PULL_Disabled << GPIO_PIN_CNF_PULL_Pos)
14+
| (GPIO_PIN_CNF_INPUT_Disconnect << GPIO_PIN_CNF_INPUT_Pos)
15+
| (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos);
16+
17+
NRF_GPIO->OUTCLR = (GPIO_OUTCLR_PIN19_Clear << GPIO_OUTCLR_PIN19_Pos);
18+
19+
#endif
20+
}

libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/i2c_api.c

100755100644
File mode changed.

libraries/tests/mbed/analog/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ int main() {
6262
}
6363

6464
notify_completion(check);
65-
}
65+
}

libraries/tests/mbed/i2c_eeprom/main.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ I2C i2c(P0_23, P0_22);
4545
#elif defined(TARGET_LPC11U68)
4646
I2C i2c(SDA, SCL);
4747

48+
#elif defined(TARGET_DELTA_DFCM_NNN40)
49+
I2C i2c(I2C_SDA0, I2C_SCL0);
50+
4851
#elif defined(TARGET_NUCLEO_F030R8) || \
4952
defined(TARGET_NUCLEO_F070RB) || \
5053
defined(TARGET_NUCLEO_F072RB) || \

libraries/tests/mbed/i2c_eeprom_line/main.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ I2C i2c(P0_23, P0_22);
5555
#elif defined(TARGET_LPC11U68)
5656
I2C i2c(SDA, SCL);
5757

58+
#elif defined(TARGET_DELTA_DFCM_NNN40)
59+
I2C i2c(I2C_SDA0, I2C_SCL0);
60+
5861
#elif defined(TARGET_NUCLEO_F030R8) || \
5962
defined(TARGET_NUCLEO_F070RB) || \
6063
defined(TARGET_NUCLEO_F072RB) || \
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# This file was automagically generated by mbed.org. For more information,
2+
# see http://mbed.org/handbook/Exporting-to-GCC-ARM-Embedded
3+
4+
GCC_BIN =
5+
PROJECT = {{name}}
6+
OBJECTS = {% for f in to_be_compiled %}{{f}} {% endfor %}
7+
SYS_OBJECTS = {% for f in object_files %}{{f}} {% endfor %}
8+
INCLUDE_PATHS = {% for p in include_paths %}-I{{p}} {% endfor %}
9+
LIBRARY_PATHS = {% for p in library_paths %}-L{{p}} {% endfor %}
10+
LIBRARIES = {% for lib in libraries %}-l{{lib}} {% endfor %}
11+
LINKER_SCRIPT = {{linker_script}}
12+
SOFTDEVICE = mbed/TARGET_NRF51822/TARGET_NORDIC/TARGET_MCU_NRF51822/Lib/s110_nrf51822_7_0_0/s110_nrf51822_7.0.0_softdevice.hex
13+
14+
###############################################################################
15+
AS = $(GCC_BIN)arm-none-eabi-as
16+
CC = $(GCC_BIN)arm-none-eabi-gcc
17+
CPP = $(GCC_BIN)arm-none-eabi-g++
18+
LD = $(GCC_BIN)arm-none-eabi-gcc
19+
OBJCOPY = $(GCC_BIN)arm-none-eabi-objcopy
20+
OBJDUMP = $(GCC_BIN)arm-none-eabi-objdump
21+
SIZE = $(GCC_BIN)arm-none-eabi-size
22+
SREC_CAT = srec_cat
23+
24+
CPU = -mcpu=cortex-m0 -mthumb
25+
CC_FLAGS = $(CPU) -c -g -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections -fomit-frame-pointer
26+
CC_FLAGS += -MMD -MP
27+
CC_SYMBOLS = {% for s in symbols %}-D{{s}} {% endfor %}
28+
29+
LD_FLAGS = $(CPU) -Wl,--gc-sections -Wl,--wrap=main --specs=nano.specs -u _printf_float -u _scanf_float
30+
LD_FLAGS += -Wl,-Map=$(PROJECT).map,--cref
31+
LD_SYS_LIBS = -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
32+
33+
ifeq ($(DEBUG), 1)
34+
CC_FLAGS += -DDEBUG -O0
35+
else
36+
CC_FLAGS += -DNDEBUG -Os
37+
endif
38+
39+
all: $(PROJECT).bin $(PROJECT).hex
40+
41+
clean:
42+
rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS) $(DEPS)
43+
44+
.s.o:
45+
$(AS) $(CPU) -o $@ $<
46+
47+
.c.o:
48+
$(CC) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu99 $(INCLUDE_PATHS) -o $@ $<
49+
50+
.cpp.o:
51+
$(CPP) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu++98 -fno-rtti $(INCLUDE_PATHS) -o $@ $<
52+
53+
54+
$(PROJECT).elf: $(OBJECTS) $(SYS_OBJECTS)
55+
$(LD) $(LD_FLAGS) -T$(LINKER_SCRIPT) $(LIBRARY_PATHS) -o $@ $^ $(LIBRARIES) $(LD_SYS_LIBS) $(LIBRARIES) $(LD_SYS_LIBS)
56+
$(SIZE) $@
57+
58+
$(PROJECT).bin: $(PROJECT).elf
59+
@$(OBJCOPY) -O binary $< $@
60+
61+
$(PROJECT).hex: $(PROJECT).elf
62+
@$(OBJCOPY) -O ihex $< $@
63+
64+
$(PROJECT).lst: $(PROJECT).elf
65+
@$(OBJDUMP) -Sdh $< > $@
66+
67+
lst: $(PROJECT).lst
68+
69+
size:
70+
$(SIZE) $(PROJECT).elf
71+
72+
DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d)
73+
-include $(DEPS)
74+
75+
merge:
76+
$(SREC_CAT) $(SOFTDEVICE) -intel $(PROJECT).hex -intel -o combined.hex -intel --line-length=44

workspace_tools/export/gccarm.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class GccArm(Exporter):
7474
'NRF51_DONGLE',
7575
'BLE_SMURFS',
7676
'DISCO_F401VC',
77+
'DELTA_DFCM_NNN40',
7778
]
7879

7980
DOT_IN_RELATIVE_PATH = True

0 commit comments

Comments
 (0)