|
39 | 39 | // This GPIO configuration is only valid for the nrf52840 HIC |
40 | 40 | COMPILER_ASSERT(DAPLINK_HIC_ID == DAPLINK_HIC_ID_NRF52840); |
41 | 41 |
|
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) |
64 | 43 |
|
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 |
73 | 45 | #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 |
74 | 98 |
|
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 |
78 | 100 |
|
79 | 101 | #endif |
0 commit comments