Skip to content

Commit ddae34c

Browse files
author
dongie
committed
Add support for Waveshare nRF52840 Eval Kit.
The board is basically a breakout for all pins on 52840 plus a couple nice extras like USB>Serial dongle, leds, button(s) and 2.54mm headers for all I/O.
1 parent 6c2867b commit ddae34c

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
/*
2+
* The MIT License (MIT)
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in
12+
* all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20+
* THE SOFTWARE.
21+
*/
22+
23+
#ifndef _WAVESHARE_NRF52840_H
24+
#define _WAVESHARE_NRF52840_H
25+
26+
#define _PINNUM(port, pin) ((port)*32 + (pin))
27+
28+
/*------------------------------------------------------------------*/
29+
/* LED
30+
*------------------------------------------------------------------*/
31+
#define LEDS_NUMBER 2
32+
/* This is led marked LED1 on the board */
33+
#define LED_PRIMARY_PIN _PINNUM(0, 13)
34+
/* This is led marked LED2 on the board */
35+
#define LED_SECONDARY_PIN _PINNUM(0, 14)
36+
/* There are two more LEDs, but for the purposes of bootloader that
37+
* doesn't matter. */
38+
#define LED_STATE_ON 0
39+
40+
/*------------------------------------------------------------------*/
41+
/* BUTTON
42+
*------------------------------------------------------------------*/
43+
#define BUTTONS_NUMBER 2
44+
/* This is the 'KEY1' in top left of the board under RESET key.
45+
* It is used to remain in bootloader mode after reset. */
46+
#define BUTTON_1 _PINNUM(0, 11)
47+
/* Pin below is in the bottom left of PCB, and can be shorted to GND
48+
* with a regular 2.54mm jumper or tweezers. This pin is used to
49+
* clear user firmware and remain in bootloader mode. */
50+
#define BUTTON_2 _PINNUM(0, 29)
51+
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
52+
53+
/*------------------------------------------------------------------*/
54+
/* UART (only used by nRF52832)
55+
*------------------------------------------------------------------*/
56+
#define RX_PIN_NUMBER 8
57+
#define TX_PIN_NUMBER 6
58+
#define CTS_PIN_NUMBER 0
59+
#define RTS_PIN_NUMBER 0
60+
#define HWFC false
61+
62+
//--------------------------------------------------------------------+
63+
// BLE OTA
64+
//--------------------------------------------------------------------+
65+
#define BLEDIS_MANUFACTURER "Waveshare"
66+
#define BLEDIS_MODEL "nRF52840 Eval"
67+
68+
//--------------------------------------------------------------------+
69+
// USB
70+
//--------------------------------------------------------------------+
71+
#define USB_DESC_VID 0x239A
72+
#define USB_DESC_UF2_PID 0x0029
73+
#define USB_DESC_CDC_ONLY_PID 0x002A
74+
75+
//------------- UF2 -------------//
76+
#define UF2_PRODUCT_NAME "Waveshare nRF52840 Eval"
77+
#define UF2_VOLUME_LABEL "WS52840EVK"
78+
#define UF2_BOARD_ID "WS-nRF52840-EVK"
79+
#define UF2_INDEX_URL "https://www.waveshare.com/wiki/NRF52840_Eval_Kit"
80+
81+
#endif // _WAVESHARE_NRF52840_H
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
MCU_SUB_VARIANT = nrf52840

0 commit comments

Comments
 (0)