Skip to content

Commit f1dd459

Browse files
authored
Merge pull request #2654 from TsungtaWu/master
DELTA_DFBM_NQ620 platform porting
2 parents 3cbfbbf + a7248c3 commit f1dd459

File tree

3 files changed

+268
-0
lines changed

3 files changed

+268
-0
lines changed

hal/targets.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2033,6 +2033,34 @@
20332033
"device_has": ["ANALOGIN", "ERROR_PATTERN", "I2C", "I2C_ASYNCH", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPI_ASYNCH", "SPISLAVE"],
20342034
"release_versions": ["2", "5"]
20352035
},
2036+
"DELTA_DFBM_NQ620": {
2037+
"supported_form_factors": ["ARDUINO"],
2038+
"inherits": ["MCU_NRF52"],
2039+
"progen": {"target": "dfbm-nq620"},
2040+
"macros_add": [
2041+
"BOARD_PCA10040",
2042+
"NRF52_PAN_12",
2043+
"NRF52_PAN_15",
2044+
"NRF52_PAN_58",
2045+
"NRF52_PAN_55",
2046+
"NRF52_PAN_54",
2047+
"NRF52_PAN_31",
2048+
"NRF52_PAN_30",
2049+
"NRF52_PAN_51",
2050+
"NRF52_PAN_36",
2051+
"NRF52_PAN_53",
2052+
"S132",
2053+
"CONFIG_GPIO_AS_PINRESET",
2054+
"BLE_STACK_SUPPORT_REQD",
2055+
"SWI_DISABLE0",
2056+
"NRF52_PAN_20",
2057+
"NRF52_PAN_64",
2058+
"NRF52_PAN_62",
2059+
"NRF52_PAN_63"
2060+
],
2061+
"device_has": ["ANALOGIN", "ERROR_PATTERN", "I2C", "I2C_ASYNCH", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPI_ASYNCH", "SPISLAVE"],
2062+
"release_versions": ["2", "5"]
2063+
},
20362064
"BLUEPILL_F103C8": {
20372065
"core": "Cortex-M3",
20382066
"default_toolchain": "GCC_ARM",
Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
/*
2+
* Copyright (c) 2016 Nordic Semiconductor ASA
3+
* All rights reserved.
4+
*
5+
* Redistribution and use in source and binary forms, with or without modification,
6+
* are permitted provided that the following conditions are met:
7+
*
8+
* 1. Redistributions of source code must retain the above copyright notice, this list
9+
* of conditions and the following disclaimer.
10+
*
11+
* 2. Redistributions in binary form, except as embedded into a Nordic Semiconductor ASA
12+
* integrated circuit in a product or a software update for such product, must reproduce
13+
* the above copyright notice, this list of conditions and the following disclaimer in
14+
* the documentation and/or other materials provided with the distribution.
15+
*
16+
* 3. Neither the name of Nordic Semiconductor ASA nor the names of its contributors may be
17+
* used to endorse or promote products derived from this software without specific prior
18+
* written permission.
19+
*
20+
* 4. This software, with or without modification, must only be used with a
21+
* Nordic Semiconductor ASA integrated circuit.
22+
*
23+
* 5. Any software provided in binary or object form under this license must not be reverse
24+
* engineered, decompiled, modified and/or disassembled.
25+
*
26+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
27+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
30+
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
32+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
33+
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36+
*
37+
*/
38+
39+
#ifndef MBED_PINNAMES_H
40+
#define MBED_PINNAMES_H
41+
42+
#include "cmsis.h"
43+
44+
#ifdef __cplusplus
45+
extern "C" {
46+
#endif
47+
48+
typedef enum {
49+
PIN_INPUT,
50+
PIN_OUTPUT
51+
} PinDirection;
52+
53+
#define PORT_SHIFT 3
54+
55+
typedef enum {
56+
p0 = 0,
57+
p1 = 1,
58+
p2 = 2,
59+
p3 = 3,
60+
p4 = 4,
61+
p5 = 5,
62+
p6 = 6,
63+
p7 = 7,
64+
p8 = 8,
65+
p9 = 9,
66+
p10 = 10,
67+
p11 = 11,
68+
p12 = 12,
69+
p13 = 13,
70+
p14 = 14,
71+
p15 = 15,
72+
p16 = 16,
73+
p17 = 17,
74+
p18 = 18,
75+
p19 = 19,
76+
p20 = 20,
77+
p21 = 21,
78+
p22 = 22,
79+
p23 = 23,
80+
p24 = 24,
81+
p25 = 25,
82+
p26 = 26,
83+
p27 = 27,
84+
p28 = 28,
85+
p29 = 29,
86+
p30 = 30,
87+
p31 = 31,
88+
89+
P0_0 = p0,
90+
P0_1 = p1,
91+
P0_2 = p2,
92+
P0_3 = p3,
93+
P0_4 = p4,
94+
P0_5 = p5,
95+
P0_6 = p6,
96+
P0_7 = p7,
97+
98+
P0_8 = p8,
99+
P0_9 = p9,
100+
P0_10 = p10,
101+
P0_11 = p11,
102+
P0_12 = p12,
103+
P0_13 = p13,
104+
P0_14 = p14,
105+
P0_15 = p15,
106+
107+
P0_16 = p16,
108+
P0_17 = p17,
109+
P0_18 = p18,
110+
P0_19 = p19,
111+
P0_20 = p20,
112+
P0_21 = p21,
113+
P0_22 = p22,
114+
P0_23 = p23,
115+
116+
P0_24 = p24,
117+
P0_25 = p25,
118+
P0_26 = p26,
119+
P0_27 = p27,
120+
P0_28 = p28,
121+
P0_29 = p29,
122+
P0_30 = p30,
123+
124+
LED1 = p17,
125+
LED2 = p18,
126+
LED3 = p19,
127+
LED4 = p20,
128+
129+
BUTTON1 = p13,
130+
BUTTON2 = p14,
131+
BUTTON3 = p15,
132+
BUTTON4 = p16,
133+
134+
RX_PIN_NUMBER = p11,
135+
TX_PIN_NUMBER = p12,
136+
CTS_PIN_NUMBER = p13,
137+
RTS_PIN_NUMBER = p14,
138+
139+
// mBed interface Pins
140+
USBTX = TX_PIN_NUMBER,
141+
USBRX = RX_PIN_NUMBER,
142+
143+
SPI_PSELMOSI0 = p23,
144+
SPI_PSELMISO0 = p24,
145+
SPI_PSELSS0 = p22,
146+
SPI_PSELSCK0 = p25,
147+
148+
SPI_PSELMOSI1 = p12,
149+
SPI_PSELMISO1 = p13,
150+
SPI_PSELSS1 = p11,
151+
SPI_PSELSCK1 = p14,
152+
153+
SPIS_PSELMOSI = p12,
154+
SPIS_PSELMISO = p13,
155+
SPIS_PSELSS = p11,
156+
SPIS_PSELSCK = p14,
157+
158+
I2C_SDA0 = p26,
159+
I2C_SCL0 = p27,
160+
161+
D0 = p11,
162+
D1 = p12,
163+
D2 = p13,
164+
D3 = p14,
165+
D4 = p15,
166+
D5 = p16,
167+
D6 = p17,
168+
D7 = p18,
169+
170+
D8 = p19,
171+
D9 = p20,
172+
D10 = p22,
173+
D11 = p23,
174+
D12 = p24,
175+
D13 = p25,
176+
177+
D14 = p26,
178+
D15 = p27,
179+
180+
A0 = p3,
181+
A1 = p4,
182+
A2 = p28,
183+
A3 = p29,
184+
A4 = p30,
185+
A5 = p31,
186+
187+
// Not connected
188+
NC = (int)0xFFFFFFFF
189+
} PinName;
190+
191+
typedef enum {
192+
PullNone = 0,
193+
PullDown = 1,
194+
PullUp = 3,
195+
PullDefault = PullUp
196+
} PinMode;
197+
198+
#ifdef __cplusplus
199+
}
200+
#endif
201+
202+
#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)