Skip to content

Commit 64d06e2

Browse files
committed
nrf52840_hic: Add map for nRF52840-DK + fix for default pinmap
1 parent 055e511 commit 64d06e2

File tree

2 files changed

+29
-9
lines changed

2 files changed

+29
-9
lines changed

records/hic_hal/nrf52840.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ common:
99
- DAPLINK_HIC_ID=0x6E052840 # DAPLINK_HIC_ID_NRF52840
1010
- OS_CLOCK=64000000
1111
- __DAPLINK
12-
## Uncomment one of the following defines to use alternate pinmap
13-
# - SSCI_ISP1807
12+
## Uncomment one of the following defines to use alternate pinmap:
13+
# - NRF52840_DK
1414
# - SEEEDSTUDIO_XIAO_BLE
15+
# - SSCI_ISP1807
1516
includes:
1617
- source/hic_hal/nordic/nrf52840
1718
- source/hic_hal/nordic/nrfx

source/hic_hal/nordic/nrf52840/IO_Config.h

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,23 +77,42 @@ COMPILER_ASSERT(DAPLINK_HIC_ID == DAPLINK_HIC_ID_NRF52840);
7777
#define I2C_SCL_PIN NRF_GPIO_PIN_MAP(0, 15) // I2C SCL
7878
#define I2C_SDA_PIN NRF_GPIO_PIN_MAP(0, 8) // I2C SDA
7979

80+
#elif defined(NRF52840_DK)
81+
82+
#define GPIO_LED_ACTIVE_STATE 0
83+
#define RESET_BUTTON_PULL NRF_GPIO_PIN_PULLUP
84+
#define PIN_SWCLK NRF_GPIO_PIN_MAP(0, 17) // SWDCLK (Output)
85+
#define PIN_SWDIO NRF_GPIO_PIN_MAP(0, 19) // SWDIO (Input/Output)
86+
#define PIN_nRESET NRF_GPIO_PIN_MAP(1, 9) // 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, 13) // HID LED (LED1)
90+
#define LED_MSC NRF_GPIO_PIN_MAP(0, 14) // MSC LED (LED2)
91+
#define LED_CDC NRF_GPIO_PIN_MAP(0, 15) // CDC LED (LED3)
92+
#define LED_PWR NRF_GPIO_PIN_MAP(0, 16) // POWER LED (LED4)
93+
#define RESET_BUTTON NRF_GPIO_PIN_MAP(0, 11) // Reset button (Button 1)
94+
#define UART_TX_PIN NRF_GPIO_PIN_MAP(0, 21) // UART TX
95+
#define UART_RX_PIN NRF_GPIO_PIN_MAP(0, 23) // UART RX
96+
#define I2C_SCL_PIN NRF_GPIO_PIN_MAP(0, 20) // I2C
97+
#define I2C_SDA_PIN NRF_GPIO_PIN_MAP(0, 22) // I2C
98+
8099
#else
81100

82101
#define GPIO_LED_ACTIVE_STATE 0
83102
#define RESET_BUTTON_PULL NRF_GPIO_PIN_PULLUP
84103
#define PIN_SWCLK NRF_GPIO_PIN_MAP(0, 13) // SWDCLK (Output)
85104
#define PIN_SWDIO NRF_GPIO_PIN_MAP(0, 17) // SWDIO (Input/Output)
86105
#define PIN_nRESET NRF_GPIO_PIN_MAP(0, 9) // 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, 6) // HID LED
90-
#define LED_MSC NRF_GPIO_PIN_MAP(0, 8) // MSC LED
91-
#define LED_CDC NRF_GPIO_PIN_MAP(0, 12) // CDC LED
106+
#undef LED_RUNNING // Target Running LED
107+
#undef LED_CONNECTED // Connected LED
108+
#define LED_HID NRF_GPIO_PIN_MAP(0, 6) // HID LED (LED1 Green)
109+
#define LED_MSC NRF_GPIO_PIN_MAP(0, 8) // MSC LED (LED2 Red)
110+
#define LED_CDC NRF_GPIO_PIN_MAP(0, 12) // CDC LED (LED2 Blue)
92111
#undef LED_PWR // POWER LED
93-
#define RESET_BUTTON NRF_GPIO_PIN_MAP(1, 6) // Reset button (SW_RESET)
112+
#define RESET_BUTTON NRF_GPIO_PIN_MAP(1, 6) // Reset button (SW1)
94113
#define UART_TX_PIN NRF_GPIO_PIN_MAP(0, 24) // UART TX
95114
#define UART_RX_PIN NRF_GPIO_PIN_MAP(1, 0) // UART RX
96-
#define I2C_SCL_PIN NRF_GPIO_PIN_MAP(1, 25) // I2C
115+
#define I2C_SCL_PIN NRF_GPIO_PIN_MAP(1, 15) // I2C
97116
#define I2C_SDA_PIN NRF_GPIO_PIN_MAP(0, 2) // I2C
98117

99118
#endif

0 commit comments

Comments
 (0)