Skip to content

Commit b4e57f3

Browse files
committed
nrf52840_hic: Add Seeed Studio XIAO BLE and merge with Dongle
1 parent 2a406fc commit b4e57f3

File tree

6 files changed

+83
-115
lines changed

6 files changed

+83
-115
lines changed

projects.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,11 +579,28 @@ projects:
579579
- *module_if
580580
- *module_hic_nrf52820
581581
- records/board/microbitv2_nrf52820.yaml
582+
nrf52840_dongle_bl:
583+
- *module_bl
584+
- records/hic_hal/nrf52840.yaml
585+
- records/board/nrf52840_bl.yaml
586+
- records/board/nrf52840_dongle.yaml
582587
nrf52840_dongle_if:
583588
- *module_if
584589
- *module_hic_nrf52840
590+
- records/board/nrf52840_if.yaml
585591
- records/board/nrf52840_dongle.yaml
586592
- records/family/all_family.yaml
593+
nrf52840_xiao_bl:
594+
- *module_bl
595+
- records/hic_hal/nrf52840.yaml
596+
- records/board/nrf52840_bl.yaml
597+
- records/board/nrf52840_xiao.yaml
598+
nrf52840_xiao_if:
599+
- *module_if
600+
- *module_hic_nrf52840
601+
- records/board/nrf52840_if.yaml
602+
- records/board/nrf52840_xiao.yaml
603+
- records/family/all_family.yaml
587604
sam3u2c_mkit_dk_dongle_nrf5x_if:
588605
- *module_if
589606
- *module_hic_sam3u2c

records/board/nrf52840_dongle.yaml

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

records/board/nrf52840_if.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
common:
2+
sources:
3+
board:
4+
- source/board/nrf52840_dongle.c
5+
family:
6+
- source/family/nordic/nrf52/target.c

records/board/nrf52840_xiao.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
common:
2+
macros:
3+
- USB_PROD_STR="XIAO BLE CMSIS-DAP"
4+
- SEEEDSTUDIO_XIAO_BLE

source/board/override_nrf52840_dongle/IO_Config_Override.h

Lines changed: 0 additions & 74 deletions
This file was deleted.

source/hic_hal/nordic/nrf52840/IO_Config.h

Lines changed: 55 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -39,41 +39,63 @@
3939
// This GPIO configuration is only valid for the nrf52840 HIC
4040
COMPILER_ASSERT(DAPLINK_HIC_ID == DAPLINK_HIC_ID_NRF52840);
4141

42-
#define GPIO_LED_ACTIVE_STATE 1
43-
44-
// SWDCLK (Output)
45-
#define PIN_SWCLK NRF_GPIO_PIN_MAP(0, 1)
46-
47-
// SWDIO (Input/Output)
48-
#define PIN_SWDIO NRF_GPIO_PIN_MAP(0, 0)
49-
50-
// nRESET Pin
51-
#undef PIN_nRESET
52-
53-
// Target Running LED (Output)
54-
#undef LED_RUNNING
55-
56-
// Connected LED (Output)
57-
#undef LED_CONNECTED
58-
59-
// HID LED
60-
#define LED_HID NRF_GPIO_PIN_MAP(0, 15)
61-
62-
// MSC LED
63-
#define LED_MSC NRF_GPIO_PIN_MAP(0, 15)
42+
#if defined(NRF52840_DONGLE)
6443

65-
// CDC LED
66-
#define LED_CDC NRF_GPIO_PIN_MAP(0, 15)
67-
68-
// POWER LED
69-
#define LED_PWR NRF_GPIO_PIN_MAP(0, 17)
70-
71-
// Reset button (SW_RESET)
72-
#define RESET_BUTTON NRF_GPIO_PIN_MAP(1, 9)
44+
#define GPIO_LED_ACTIVE_STATE 0
7345
#define RESET_BUTTON_PULL NRF_GPIO_PIN_PULLUP
46+
#define PIN_SWCLK NRF_GPIO_PIN_MAP(0, 9) // SWDCLK (Output)
47+
#define PIN_SWDIO NRF_GPIO_PIN_MAP(0, 10) // SWDIO (Input/Output)
48+
#undef LED_RUNNING // Target Running LED (Output)
49+
#undef LED_CONNECTED // Connected LED (Output)
50+
#define LED_HID NRF_GPIO_PIN_MAP(0, 6) // HID LED
51+
#define LED_MSC NRF_GPIO_PIN_MAP(0, 8) // MSC LED
52+
#define LED_CDC NRF_GPIO_PIN_MAP(0, 12) // CDC LED
53+
#undef LED_PWR // POWER LED
54+
#define RESET_BUTTON NRF_GPIO_PIN_MAP(1, 6) // Reset button (SW_RESET)
55+
#define UART_TX_PIN NRF_GPIO_PIN_MAP(1, 10) // UART
56+
#define UART_RX_PIN NRF_GPIO_PIN_MAP(1, 13) // UART
57+
#define I2C_SCL_PIN NRF_GPIO_PIN_MAP(1, 25) // I2C
58+
#define I2C_SDA_PIN NRF_GPIO_PIN_MAP(0, 2) // I2C
59+
60+
#elif defined(SEEEDSTUDIO_XIAO_BLE)
61+
62+
#define GPIO_LED_ACTIVE_STATE 0
63+
#define RESET_BUTTON_PULL NRF_GPIO_PIN_PULLUP
64+
#define PIN_SWCLK NRF_GPIO_PIN_MAP(1, 13) // SWDCLK (Output)
65+
#define PIN_SWDIO NRF_GPIO_PIN_MAP(1, 14) // SWDIO (Input/Output)
66+
#undef LED_RUNNING // Target Running LED (Output)
67+
#undef LED_CONNECTED // Connected LED (Output)
68+
#define LED_HID NRF_GPIO_PIN_MAP(0, 26) // HID LED
69+
#define LED_MSC NRF_GPIO_PIN_MAP(0, 30) // MSC LED
70+
#define LED_CDC NRF_GPIO_PIN_MAP(0, 6) // CDC LED
71+
#undef LED_PWR // POWER LED
72+
#define RESET_BUTTON NRF_GPIO_PIN_MAP(0, 3) // Reset button (SW_RESET)
73+
#define UART_TX_PIN NRF_GPIO_PIN_MAP(1, 11) // UART TX (From IMCU to target)
74+
#define UART_RX_PIN NRF_GPIO_PIN_MAP(1, 12) // UART RX (From target to IMCU)
75+
#define I2C_SCL_PIN NRF_GPIO_PIN_MAP(0, 5) // I2C SCL
76+
#define I2C_SDA_PIN NRF_GPIO_PIN_MAP(0, 4) // I2C SDA
77+
78+
#else
79+
80+
// Default PIN assignment (not finalized based on nRF52833)
81+
#define GPIO_LED_ACTIVE_STATE 1
82+
#define RESET_BUTTON_PULL NRF_GPIO_PIN_PULLUP
83+
84+
#define PIN_SWCLK NRF_GPIO_PIN_MAP(0, 1) // SWDCLK (Output)
85+
#define PIN_SWDIO NRF_GPIO_PIN_MAP(0, 0) // SWDIO (Input/Output)
86+
#undef PIN_nRESET // nRESET Pin
87+
#undef LED_RUNNING // Target Running LED (Output)
88+
#undef LED_CONNECTED // Connected LED (Output)
89+
#define LED_HID NRF_GPIO_PIN_MAP(0, 15) // HID LED
90+
#define LED_MSC NRF_GPIO_PIN_MAP(0, 15) // MSC LED
91+
#define LED_CDC NRF_GPIO_PIN_MAP(0, 15) // CDC LED
92+
#define LED_PWR NRF_GPIO_PIN_MAP(0, 17) // POWER LED
93+
#define RESET_BUTTON NRF_GPIO_PIN_MAP(1, 9) // Reset button (SW_RESET)
94+
#define UART_TX_PIN NRF_GPIO_PIN_MAP(0, 2) // UART From IMCU to target
95+
#define UART_RX_PIN NRF_GPIO_PIN_MAP(0, 3) // UART From target to IMCU
96+
#define I2C_SCL_PIN NRF_GPIO_PIN_MAP(0, 29) // I2C SCL
97+
#define I2C_SDA_PIN NRF_GPIO_PIN_MAP(0, 28) // I2C SDA
7498

75-
// UART
76-
#define UART_TX_PIN NRF_GPIO_PIN_MAP(0, 2) // From IMCU to target
77-
#define UART_RX_PIN NRF_GPIO_PIN_MAP(0, 3) // From target to IMCU
99+
#endif
78100

79101
#endif

0 commit comments

Comments
 (0)