Skip to content

Commit 69e6b62

Browse files
authored
Merge pull request micropython#8142 from makerdiary/main
Added Makerdiary nRF52840 Connect Kit
2 parents fad86bf + 5fedf02 commit 69e6b62

File tree

5 files changed

+189
-0
lines changed

5 files changed

+189
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Makerdiary nRF52840 Connect Kit
2+
3+
## Introduction
4+
5+
[nRF52840 Connect Kit](https://makerdiary.com/products/nrf52840-connectkit) is an open-source prototyping
6+
kit designed for connected projects. It is built using the nRF52840 SoC, which has protocol support for
7+
Bluetooth LE, Bluetooth mesh, Thread, Zigbee, 802.15.4, ANT and 2.4 GHz proprietary stacks. It provides
8+
Arm TrustZone® CryptoCell cryptographic unit as well as numerous peripherals such as USB 2.0, NFC-A, GPIO,
9+
UART, SPI, TWI, PDM, I2S, QSPI, PWM, ADC, QDEC to support a wide range of applications.
10+
11+
The design is available in an easy-to-use form factor with USB-C and 40 pin DIP/SMT type, including up to
12+
32 multi-function GPIO pins (7 can be used as ADC inputs) and Serial Wire Debug (SWD) port. It features
13+
RGB LED, Buttons, external 64 Mbit QSPI flash and flexible power management with various options for easily
14+
powering the unit from USB-C, external supplies or batteries, and also has Chip antenna and U.FL receptacle
15+
options to support various wireless scenarios.
16+
17+
Refer to [nRF52840 Connect Kit wiki page](https://wiki.makerdiary.com/nrf52840-connectkit) for more details.
18+
19+
![](https://wiki.makerdiary.com/nrf52840-connectkit/assets/images/nrf52840_connectkit_hero.png)
20+
21+
## Hardware diagram
22+
23+
The following figure illustrates the nRF52840 Connect Kit hardware diagram. The design is available in
24+
Chip antenna and U.FL receptacle options, both have most of the same components except the antenna
25+
interface.
26+
27+
[![](https://wiki.makerdiary.com/nrf52840-connectkit/assets/images/pinout.png)](https://wiki.makerdiary.com/nrf52840-connectkit/assets/attachments/nrf52840-connectkit-quick-start-guide.pdf)
28+
29+
## Get Involved
30+
31+
We think the best way to learn is by doing. And to help you run CircuitPython on nRF52840 Connect Kit,
32+
we have provided an extensive set of documentation. Find the details [here](https://wiki.makerdiary.com/nrf52840-connectkit/guides/python/).
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
27+
#include "supervisor/board.h"
28+
29+
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#include "nrfx/hal/nrf_gpio.h"
2+
3+
#define MICROPY_HW_BOARD_NAME "Makerdiary nRF52840 Connect Kit"
4+
#define MICROPY_HW_MCU_NAME "nRF52840"
5+
6+
#if QSPI_FLASH_FILESYSTEM
7+
#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(0, 20)
8+
#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 21)
9+
#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(0, 22)
10+
#define MICROPY_QSPI_DATA3 NRF_GPIO_PIN_MAP(0, 23)
11+
#define MICROPY_QSPI_SCK NRF_GPIO_PIN_MAP(0, 19)
12+
#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(0, 17)
13+
#endif
14+
15+
#define BOARD_HAS_CRYSTAL 1
16+
17+
#define DEFAULT_I2C_BUS_SCL (&pin_P0_24)
18+
#define DEFAULT_I2C_BUS_SDA (&pin_P0_25)
19+
20+
#define DEFAULT_SPI_BUS_SCK (&pin_P0_14)
21+
#define DEFAULT_SPI_BUS_MOSI (&pin_P0_15)
22+
#define DEFAULT_SPI_BUS_MISO (&pin_P0_16)
23+
24+
#define DEFAULT_UART_BUS_RX (&pin_P0_12)
25+
#define DEFAULT_UART_BUS_TX (&pin_P0_13)
26+
27+
#define CIRCUITPY_RGB_STATUS_INVERTED_PWM
28+
#define CIRCUITPY_RGB_STATUS_R (&pin_P1_10)
29+
#define CIRCUITPY_RGB_STATUS_G (&pin_P1_11)
30+
#define CIRCUITPY_RGB_STATUS_B (&pin_P1_12)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
USB_VID = 0x2886
2+
USB_PID = 0xF003
3+
USB_PRODUCT = "Makerdiary nRF52840 Connect Kit"
4+
USB_MANUFACTURER = "Makerdiary"
5+
SOFTDEV_VERSION=7.0.1
6+
7+
MCU_CHIP = nrf52840
8+
9+
QSPI_FLASH_FILESYSTEM = 1
10+
EXTERNAL_FLASH_DEVICES = "MX25R6435F"
11+
12+
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BLE
13+
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID
14+
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
#include "shared-bindings/board/__init__.h"
2+
3+
STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
4+
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
5+
6+
{ MP_ROM_QSTR(MP_QSTR_P3), MP_ROM_PTR(&pin_P0_03) },
7+
{ MP_ROM_QSTR(MP_QSTR_P4), MP_ROM_PTR(&pin_P0_04) },
8+
{ MP_ROM_QSTR(MP_QSTR_P5), MP_ROM_PTR(&pin_P0_05) },
9+
{ MP_ROM_QSTR(MP_QSTR_P6), MP_ROM_PTR(&pin_P0_06) },
10+
{ MP_ROM_QSTR(MP_QSTR_P7), MP_ROM_PTR(&pin_P0_07) },
11+
{ MP_ROM_QSTR(MP_QSTR_P8), MP_ROM_PTR(&pin_P0_08) },
12+
{ MP_ROM_QSTR(MP_QSTR_P9), MP_ROM_PTR(&pin_P0_09) },
13+
{ MP_ROM_QSTR(MP_QSTR_P10), MP_ROM_PTR(&pin_P0_10) },
14+
{ MP_ROM_QSTR(MP_QSTR_P11), MP_ROM_PTR(&pin_P0_11) },
15+
{ MP_ROM_QSTR(MP_QSTR_P12), MP_ROM_PTR(&pin_P0_12) },
16+
{ MP_ROM_QSTR(MP_QSTR_P13), MP_ROM_PTR(&pin_P0_13) },
17+
{ MP_ROM_QSTR(MP_QSTR_P14), MP_ROM_PTR(&pin_P0_14) },
18+
{ MP_ROM_QSTR(MP_QSTR_P15), MP_ROM_PTR(&pin_P0_15) },
19+
{ MP_ROM_QSTR(MP_QSTR_P16), MP_ROM_PTR(&pin_P0_16) },
20+
{ MP_ROM_QSTR(MP_QSTR_P18), MP_ROM_PTR(&pin_P0_18) },
21+
{ MP_ROM_QSTR(MP_QSTR_P24), MP_ROM_PTR(&pin_P0_24) },
22+
{ MP_ROM_QSTR(MP_QSTR_P25), MP_ROM_PTR(&pin_P0_25) },
23+
{ MP_ROM_QSTR(MP_QSTR_P26), MP_ROM_PTR(&pin_P0_26) },
24+
{ MP_ROM_QSTR(MP_QSTR_P27), MP_ROM_PTR(&pin_P0_27) },
25+
{ MP_ROM_QSTR(MP_QSTR_P28), MP_ROM_PTR(&pin_P0_28) },
26+
{ MP_ROM_QSTR(MP_QSTR_P29), MP_ROM_PTR(&pin_P0_29) },
27+
{ MP_ROM_QSTR(MP_QSTR_P30), MP_ROM_PTR(&pin_P0_30) },
28+
{ MP_ROM_QSTR(MP_QSTR_P31), MP_ROM_PTR(&pin_P0_31) },
29+
{ MP_ROM_QSTR(MP_QSTR_P32), MP_ROM_PTR(&pin_P1_00) },
30+
{ MP_ROM_QSTR(MP_QSTR_P33), MP_ROM_PTR(&pin_P1_01) },
31+
{ MP_ROM_QSTR(MP_QSTR_P34), MP_ROM_PTR(&pin_P1_02) },
32+
{ MP_ROM_QSTR(MP_QSTR_P35), MP_ROM_PTR(&pin_P1_03) },
33+
{ MP_ROM_QSTR(MP_QSTR_P36), MP_ROM_PTR(&pin_P1_04) },
34+
{ MP_ROM_QSTR(MP_QSTR_P37), MP_ROM_PTR(&pin_P1_05) },
35+
{ MP_ROM_QSTR(MP_QSTR_P38), MP_ROM_PTR(&pin_P1_06) },
36+
{ MP_ROM_QSTR(MP_QSTR_P39), MP_ROM_PTR(&pin_P1_07) },
37+
{ MP_ROM_QSTR(MP_QSTR_P40), MP_ROM_PTR(&pin_P1_08) },
38+
{ MP_ROM_QSTR(MP_QSTR_P41), MP_ROM_PTR(&pin_P1_09) },
39+
{ MP_ROM_QSTR(MP_QSTR_P42), MP_ROM_PTR(&pin_P1_10) },
40+
{ MP_ROM_QSTR(MP_QSTR_P43), MP_ROM_PTR(&pin_P1_11) },
41+
{ MP_ROM_QSTR(MP_QSTR_P44), MP_ROM_PTR(&pin_P1_12) },
42+
{ MP_ROM_QSTR(MP_QSTR_P45), MP_ROM_PTR(&pin_P1_13) },
43+
{ MP_ROM_QSTR(MP_QSTR_P46), MP_ROM_PTR(&pin_P1_14) },
44+
{ MP_ROM_QSTR(MP_QSTR_P47), MP_ROM_PTR(&pin_P1_15) },
45+
46+
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_P0_02) },
47+
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_03) },
48+
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_P0_04) },
49+
{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_P0_05) },
50+
{ MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_P0_28) },
51+
{ MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_P0_29) },
52+
{ MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_P0_30) },
53+
{ MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_P0_31) },
54+
55+
{ MP_ROM_QSTR(MP_QSTR_MEAS_EN), MP_ROM_PTR(&pin_P1_14) },
56+
{ MP_ROM_QSTR(MP_QSTR_MODE), MP_ROM_PTR(&pin_P1_13) },
57+
58+
{ MP_ROM_QSTR(MP_QSTR_USER), MP_ROM_PTR(&pin_P1_00) },
59+
{ MP_ROM_QSTR(MP_QSTR_RESET), MP_ROM_PTR(&pin_P0_18) },
60+
61+
{ MP_ROM_QSTR(MP_QSTR_LED0), MP_ROM_PTR(&pin_P1_15) },
62+
{ MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_P1_10) },
63+
{ MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_P1_11) },
64+
{ MP_ROM_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_P1_12) },
65+
{ MP_ROM_QSTR(MP_QSTR_RED_LED), MP_ROM_PTR(&pin_P1_10) },
66+
{ MP_ROM_QSTR(MP_QSTR_GREEN_LED), MP_ROM_PTR(&pin_P1_11) },
67+
{ MP_ROM_QSTR(MP_QSTR_BLUE_LED), MP_ROM_PTR(&pin_P1_12) },
68+
69+
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_P0_13) },
70+
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_P0_12) },
71+
72+
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_24) },
73+
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_25) },
74+
75+
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P0_14) },
76+
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P0_15) },
77+
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P0_16) },
78+
79+
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
80+
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
81+
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
82+
};
83+
84+
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

0 commit comments

Comments
 (0)