Skip to content

Commit ed10c7f

Browse files
maxd-nordicmbrossard
authored andcommitted
nrf52840_hic: Add nrf52840_dongle_if board
1 parent ab1747d commit ed10c7f

File tree

4 files changed

+126
-0
lines changed

4 files changed

+126
-0
lines changed

projects.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,11 @@ projects:
579579
- *module_if
580580
- *module_hic_nrf52820
581581
- records/board/microbitv2_nrf52820.yaml
582+
nrf52840_dongle_if:
583+
- *module_if
584+
- *module_hic_nrf52840
585+
- records/board/nrf52840_dongle.yaml
586+
- records/family/all_family.yaml
582587
sam3u2c_mkit_dk_dongle_nrf5x_if:
583588
- *module_if
584589
- *module_hic_sam3u2c

records/board/nrf52840_dongle.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
common:
2+
sources:
3+
board:
4+
- source/board/nrf52840_dongle.c
5+
family:
6+
- source/family/nordic/nrf52/target.c
7+
macros:
8+
- USB_PROD_STR="nRF52840 Dongle CMSIS-DAP"
9+
- IO_CONFIG_OVERRIDE
10+
includes:
11+
- source/board/override_nrf52840_dongle

source/board/nrf52840_dongle.c

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* @file nrf52820_bl.c
3+
* @brief board ID, meta-data, and additional configuration for micro:bit
4+
* nRF52820 HIC
5+
*
6+
* DAPLink Interface Firmware
7+
* Copyright (c) 2009-2021, ARM Limited, All Rights Reserved
8+
* Copyright (c) 2021 Micro:bit Educational Foundation
9+
* SPDX-License-Identifier: Apache-2.0
10+
*
11+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
12+
* not use this file except in compliance with the License.
13+
* You may obtain a copy of the License at
14+
*
15+
* http://www.apache.org/licenses/LICENSE-2.0
16+
*
17+
* Unless required by applicable law or agreed to in writing, software
18+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
19+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20+
* See the License for the specific language governing permissions and
21+
* limitations under the License.
22+
*/
23+
24+
#include "target_board.h"
25+
#include "target_family.h"
26+
27+
extern target_cfg_t target_device_nrf52_64;
28+
29+
const board_info_t g_board_info = {
30+
.info_version = kBoardInfoVersion,
31+
.board_id = "521f",
32+
.family_id = kNordic_Nrf52_FamilyID,
33+
.target_cfg = &target_device_nrf52_64,
34+
.board_vendor = "Nordic Semiconductor",
35+
.board_name = "nRF52840 Dongle",
36+
};
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/**
2+
* @file IO_Config_Override.c
3+
* @brief Alternative IO for nRF52840 based Hardware Interface Circuit
4+
*
5+
* DAPLink Interface Firmware
6+
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
7+
* SPDX-License-Identifier: Apache-2.0
8+
*
9+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
10+
* not use this file except in compliance with the License.
11+
* You may obtain a copy of the License at
12+
*
13+
* http://www.apache.org/licenses/LICENSE-2.0
14+
*
15+
* Unless required by applicable law or agreed to in writing, software
16+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
* See the License for the specific language governing permissions and
19+
* limitations under the License.
20+
*/
21+
22+
#ifndef __IO_CONFIG_H__
23+
#define __IO_CONFIG_H__
24+
25+
#include "device.h"
26+
#include "compiler.h"
27+
#include "daplink.h"
28+
29+
#include "dl_nrf_gpio.h"
30+
31+
// This GPIO configuration is only valid for the nrf52840 HIC
32+
COMPILER_ASSERT(DAPLINK_HIC_ID == DAPLINK_HIC_ID_NRF52840);
33+
34+
#define GPIO_LED_ACTIVE_STATE 0
35+
36+
// SWDCLK (Output)
37+
#define PIN_SWCLK NRF_GPIO_PIN_MAP(0, 9)
38+
39+
// SWDIO (Input/Output)
40+
#define PIN_SWDIO NRF_GPIO_PIN_MAP(0, 10)
41+
42+
// nRESET Pin
43+
#undef PIN_nRESET
44+
45+
// Target Running LED (Output)
46+
#undef LED_RUNNING
47+
48+
// Connected LED (Output)
49+
#undef LED_CONNECTED
50+
51+
// HID LED
52+
#define LED_HID NRF_GPIO_PIN_MAP(0, 6)
53+
54+
// MSC LED
55+
#define LED_MSC LED_HID
56+
57+
// CDC LED
58+
#define LED_CDC LED_HID
59+
60+
// POWER LED
61+
#define LED_PWR NRF_GPIO_PIN_MAP(0, 8)
62+
63+
// Reset button (SW_RESET)
64+
#define RESET_BUTTON NRF_GPIO_PIN_MAP(1, 6)
65+
#define RESET_BUTTON_PULL NRF_GPIO_PIN_PULLUP
66+
67+
// UART
68+
#define UART_TX_PIN NRF_GPIO_PIN_MAP(1, 10)
69+
#define UART_RX_PIN NRF_GPIO_PIN_MAP(1, 13)
70+
71+
// I2C
72+
#define I2C_SCL_PIN NRF_GPIO_PIN_MAP(1, 25)
73+
#define I2C_SDA_PIN NRF_GPIO_PIN_MAP(0, 2)
74+
#endif

0 commit comments

Comments
 (0)