-
Notifications
You must be signed in to change notification settings - Fork 3k
Add a new target DELTA_DFCM_NNN40 #866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
ab92dec
Marco add for new target DFCM_NNN40
Marcomissyou 66a5f71
modify i2c_api, analog_api, system_brf51822.c, targets/py and add dev…
Marcomissyou 4a52c80
solve conflict targets.py and i2c_api.c
Marcomissyou 7b4f177
remove older target
Marcomissyou f578ea3
delet rtc_api.c
Marcomissyou 48aed8e
remove DFCM_NNN40 PinMap_ADC
Marcomissyou e7c32af
modify main.cpp of analog and analog_in
Marcomissyou 04937dc
remove json, delete toolchain list in target.py because NNN40 is inh…
Marcomissyou 232821b
add SWIO setting in mbed_overrides.c to substitute SWIO setting in s…
Marcomissyou ee9d3cf
gcc_arm_delta_dfcm_nnn40.tmpl uvision4_deta_dfcm_nnn40.uvopt.tmpl uvi…
Marcomissyou 64465b6
extend year and add toolchain system_nrf51822.c, PinNames.h,device.h,…
Marcomissyou 1b4c6f8
add target NNN40 in uvision4.py and gccarm.py
Marcomissyou 69a98d7
correct filename uvision4_delta_dfcm_nnn40.uvproj.tmpl and uvision4_d…
Marcomissyou f2a04da
remove self.supported_toolchains description
Marcomissyou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* mbed Microcontroller Library | ||
|
||
* Copyright (c) 2013 Nordic Semiconductor. | ||
* Copyright (c) 2015 Nordic Semiconductor. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
|
@@ -21,8 +21,12 @@ | |
#include "nrf51822.h" | ||
#include "system_nrf51822.h" | ||
|
||
#ifdef TARGET_DELTA_DFCM_NNN40 | ||
|
||
#define __SYSTEM_CLOCK (16000000UL) /*!< nRF51 devices use a fixed System Clock Frequency of 16MHz */ | ||
#define __SYSTEM_CLOCK (32000000UL) /*!< nRF51 devices use a fixed System Clock Frequency of 32MHz */ | ||
#else | ||
#define __SYSTEM_CLOCK (16000000UL) /*!< nRF51 devices use a fixed System Clock Frequency of 16MHz */ | ||
#endif | ||
|
||
static bool is_manual_peripheral_setup_needed(void); | ||
static bool is_disabled_in_debug_needed(void); | ||
|
@@ -67,7 +71,7 @@ void SystemInit(void) | |
|
||
// Start the external 32khz crystal oscillator. | ||
|
||
#ifdef TARGET_HRM1017 | ||
#ifdef TARGET_DELTA_DFCM_NNN40 || TARGET_HRM1017 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be
|
||
NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_RC << CLOCK_LFCLKSRC_SRC_Pos); | ||
#else | ||
NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Setting LFCLKSRC to 32KHz internal crystal oscillator. |
||
|
125 changes: 125 additions & 0 deletions
125
...ies/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/TARGET_DELTA_DFCM_NNN40/PinNames.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
/* mbed Microcontroller Library | ||
* Copyright (c) 2015 Nordic Semiconductor | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
#ifndef MBED_PINNAMES_H | ||
#define MBED_PINNAMES_H | ||
|
||
#include "cmsis.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
typedef enum { | ||
PIN_INPUT, | ||
PIN_OUTPUT | ||
} PinDirection; | ||
|
||
#define PORT_SHIFT 3 | ||
|
||
typedef enum { | ||
NC = (int)0xFFFFFFFF, | ||
p0 = 0, | ||
p1 = 1, | ||
p2 = 2, | ||
p3 = 3, | ||
p4 = 4, | ||
p5 = 5, | ||
p6 = 6, | ||
p7 = 7, | ||
p8 = NC, | ||
p9 = NC, | ||
p10 = NC, | ||
p11 = NC, | ||
p12 = NC, | ||
p13 = 13, | ||
p14 = NC, | ||
p15 = NC, | ||
p16 = 16, | ||
p17 = 17, | ||
p18 = NC, | ||
p19 = 19, | ||
p20 = 20, | ||
p21 = 21, | ||
p22 = 22, | ||
p23 = 23, | ||
p24 = 24, | ||
p25 = 25, | ||
p26 = 26, | ||
p27 = 27, | ||
p28 = NC, | ||
p29 = 29, | ||
p30 = 30, | ||
p31 = 31, | ||
|
||
LED1 = p7, | ||
LED2 = p13, | ||
|
||
BUTTON0 = p16, | ||
BUTTON1 = p17, | ||
|
||
RX_PIN_NUMBER = p23, | ||
TX_PIN_NUMBER = p25, | ||
|
||
// mBed interface Pins | ||
USBTX = TX_PIN_NUMBER, | ||
USBRX = RX_PIN_NUMBER, | ||
|
||
SPI_PSELMOSI0 = p24, | ||
SPI_PSELMISO0 = p29, | ||
SPI_PSELSS0 = p6, | ||
SPI_PSELSCK0 = p21, | ||
|
||
SPIS_PSELMOSI = p24, | ||
SPIS_PSELMISO = p29, | ||
SPIS_PSELSS = p6, | ||
SPIS_PSELSCK = p21, | ||
|
||
I2C_SDA0 = p22, | ||
I2C_SCL0 = p20, | ||
|
||
A0 = p0, | ||
A1 = p1, | ||
A2 = p2, | ||
A3 = p3, | ||
A4 = p4, | ||
A5 = p5, | ||
|
||
SWIO = p19, | ||
VERF0 = p0, | ||
// Not connected | ||
|
||
CTS_PIN_NUMBER = NC, | ||
RTS_PIN_NUMBER = NC, | ||
SPI_PSELMOSI1 = NC, | ||
SPI_PSELMISO1 = NC, | ||
SPI_PSELSS1 = NC, | ||
SPI_PSELSCK1 = NC, | ||
LED3 = NC, | ||
LED4 = NC | ||
} PinName; | ||
|
||
typedef enum { | ||
PullNone = 0, | ||
PullDown = 1, | ||
PullUp = 3, | ||
PullDefault = PullUp | ||
} PinMode; | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
57 changes: 57 additions & 0 deletions
57
...aries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/TARGET_DELTA_DFCM_NNN40/device.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* mbed Microcontroller Library | ||
* Copyright (c) 2006-2015 ARM Limited | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
#ifndef MBED_DEVICE_H | ||
#define MBED_DEVICE_H | ||
|
||
#define DEVICE_PORTIN 1 | ||
#define DEVICE_PORTOUT 1 | ||
#define DEVICE_PORTINOUT 1 | ||
|
||
#define DEVICE_INTERRUPTIN 1 | ||
|
||
#define DEVICE_ANALOGIN 1 | ||
#define DEVICE_ANALOGOUT 0 | ||
|
||
#define DEVICE_SERIAL 1 | ||
|
||
#define DEVICE_I2C 1 | ||
#define DEVICE_I2CSLAVE 0 | ||
|
||
#define DEVICE_SPI 1 | ||
#define DEVICE_SPISLAVE 1 | ||
|
||
#define DEVICE_CAN 0 | ||
|
||
#define DEVICE_RTC 0 | ||
|
||
#define DEVICE_ETHERNET 0 | ||
|
||
#define DEVICE_PWMOUT 1 | ||
|
||
#define DEVICE_SEMIHOST 0 | ||
#define DEVICE_LOCALFILESYSTEM 0 | ||
|
||
#define DEVICE_SLEEP 1 | ||
|
||
#define DEVICE_DEBUG_AWARENESS 1 | ||
|
||
#define DEVICE_STDIO_MESSAGES 0 | ||
|
||
#define DEVICE_ERROR_PATTERN 1 | ||
|
||
#include "objects.h" | ||
|
||
#endif |
20 changes: 20 additions & 0 deletions
20
...ed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/TARGET_DELTA_DFCM_NNN40/mbed_overrides.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* mbed Microcontroller Library | ||
* Copyright (c) 2015, Cyntec | ||
*/ | ||
#include "cmsis.h" | ||
|
||
// This function is called after RAM initialization and before main. | ||
void mbed_sdk_init() | ||
{ | ||
// Default SWIO setting, pull SWIO(p19) to low for turning antenna switch to BLE radiated path. | ||
#ifdef TARGET_DELTA_DFCM_NNN40 | ||
NRF_GPIO->PIN_CNF[19] = (GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) | ||
| (GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos) | ||
| (GPIO_PIN_CNF_PULL_Disabled << GPIO_PIN_CNF_PULL_Pos) | ||
| (GPIO_PIN_CNF_INPUT_Disconnect << GPIO_PIN_CNF_INPUT_Pos) | ||
| (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos); | ||
|
||
NRF_GPIO->OUTCLR = (GPIO_OUTCLR_PIN19_Clear << GPIO_OUTCLR_PIN19_Pos); | ||
|
||
#endif | ||
} |
Empty file modified
0
libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/i2c_api.c
100755 → 100644
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,4 +62,4 @@ int main() { | |
} | ||
|
||
notify_completion(check); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# This file was automagically generated by mbed.org. For more information, | ||
# see http://mbed.org/handbook/Exporting-to-GCC-ARM-Embedded | ||
|
||
GCC_BIN = | ||
PROJECT = {{name}} | ||
OBJECTS = {% for f in to_be_compiled %}{{f}} {% endfor %} | ||
SYS_OBJECTS = {% for f in object_files %}{{f}} {% endfor %} | ||
INCLUDE_PATHS = {% for p in include_paths %}-I{{p}} {% endfor %} | ||
LIBRARY_PATHS = {% for p in library_paths %}-L{{p}} {% endfor %} | ||
LIBRARIES = {% for lib in libraries %}-l{{lib}} {% endfor %} | ||
LINKER_SCRIPT = {{linker_script}} | ||
SOFTDEVICE = mbed/TARGET_NRF51822/TARGET_NORDIC/TARGET_MCU_NRF51822/Lib/s110_nrf51822_7_0_0/s110_nrf51822_7.0.0_softdevice.hex | ||
|
||
############################################################################### | ||
AS = $(GCC_BIN)arm-none-eabi-as | ||
CC = $(GCC_BIN)arm-none-eabi-gcc | ||
CPP = $(GCC_BIN)arm-none-eabi-g++ | ||
LD = $(GCC_BIN)arm-none-eabi-gcc | ||
OBJCOPY = $(GCC_BIN)arm-none-eabi-objcopy | ||
OBJDUMP = $(GCC_BIN)arm-none-eabi-objdump | ||
SIZE = $(GCC_BIN)arm-none-eabi-size | ||
SREC_CAT = srec_cat | ||
|
||
CPU = -mcpu=cortex-m0 -mthumb | ||
CC_FLAGS = $(CPU) -c -g -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections -fomit-frame-pointer | ||
CC_FLAGS += -MMD -MP | ||
CC_SYMBOLS = {% for s in symbols %}-D{{s}} {% endfor %} | ||
|
||
LD_FLAGS = $(CPU) -Wl,--gc-sections -Wl,--wrap=main --specs=nano.specs -u _printf_float -u _scanf_float | ||
LD_FLAGS += -Wl,-Map=$(PROJECT).map,--cref | ||
LD_SYS_LIBS = -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys | ||
|
||
ifeq ($(DEBUG), 1) | ||
CC_FLAGS += -DDEBUG -O0 | ||
else | ||
CC_FLAGS += -DNDEBUG -Os | ||
endif | ||
|
||
all: $(PROJECT).bin $(PROJECT).hex | ||
|
||
clean: | ||
rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS) $(DEPS) | ||
|
||
.s.o: | ||
$(AS) $(CPU) -o $@ $< | ||
|
||
.c.o: | ||
$(CC) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu99 $(INCLUDE_PATHS) -o $@ $< | ||
|
||
.cpp.o: | ||
$(CPP) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu++98 -fno-rtti $(INCLUDE_PATHS) -o $@ $< | ||
|
||
|
||
$(PROJECT).elf: $(OBJECTS) $(SYS_OBJECTS) | ||
$(LD) $(LD_FLAGS) -T$(LINKER_SCRIPT) $(LIBRARY_PATHS) -o $@ $^ $(LIBRARIES) $(LD_SYS_LIBS) $(LIBRARIES) $(LD_SYS_LIBS) | ||
$(SIZE) $@ | ||
|
||
$(PROJECT).bin: $(PROJECT).elf | ||
@$(OBJCOPY) -O binary $< $@ | ||
|
||
$(PROJECT).hex: $(PROJECT).elf | ||
@$(OBJCOPY) -O ihex $< $@ | ||
|
||
$(PROJECT).lst: $(PROJECT).elf | ||
@$(OBJDUMP) -Sdh $< > $@ | ||
|
||
lst: $(PROJECT).lst | ||
|
||
size: | ||
$(SIZE) $(PROJECT).elf | ||
|
||
DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d) | ||
-include $(DEPS) | ||
|
||
merge: | ||
$(SREC_CAT) $(SOFTDEVICE) -intel $(PROJECT).hex -intel -o combined.hex -intel --line-length=44 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use 32MHz x'tal as SYSTEM CLOCK.