Skip to content

Commit d18bf87

Browse files
aykevlglennrub
authored andcommitted
ports/nrf: Add WT51822-S4AT board.
1 parent a414199 commit d18bf87

6 files changed

Lines changed: 99 additions & 0 deletions

File tree

ports/nrf/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ This is a port of MicroPython to the Nordic Semiconductor nRF series of chips.
2828
* PCA10001
2929
* PCA10028
3030
* PCA10031 (dongle)
31+
* [WT51822-S4AT](http://www.wireless-tag.com/wireless_module/BLE/WT51822-S4AT.html)
3132
* nRF52832
3233
* [PCA10040](http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52%2Fdita%2Fnrf52%2Fdevelopment%2Fnrf52_dev_kit.html)
3334
* [Adafruit Feather nRF52](https://www.adafruit.com/product/3406)
@@ -80,6 +81,7 @@ pca10000 | s110 | Peripheral | [Segge
8081
pca10001 | s110 | Peripheral | [Segger](#segger-targets)
8182
pca10028 | s110 | Peripheral | [Segger](#segger-targets)
8283
pca10031 | s110 | Peripheral | [Segger](#segger-targets)
84+
wt51822_s4at | s110 | Peripheral | Manual, see [datasheet](https://4tronix.co.uk/picobot2/WT51822-S4AT.pdf) for pinout
8385
pca10040 | s132 | Peripheral and Central | [Segger](#segger-targets)
8486
feather52 | s132 | Peripheral and Central | [UART DFU](#dfu-targets)
8587
arduino_primo | s132 | Peripheral and Central | [PyOCD](#pyocdopenocd-targets)
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2017 Ayke van Laethem
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+
#define WT51822_S4AT
28+
29+
// Datasheet for board:
30+
// https://4tronix.co.uk/picobot2/WT51822-S4AT.pdf
31+
#define MICROPY_HW_BOARD_NAME "WT51822-S4AT"
32+
#define MICROPY_HW_MCU_NAME "NRF51822"
33+
#define MICROPY_PY_SYS_PLATFORM "nrf51"
34+
35+
#define MICROPY_PY_MACHINE_HW_SPI (1)
36+
#define MICROPY_PY_MACHINE_TIMER (1)
37+
#define MICROPY_PY_MACHINE_RTC (1)
38+
#define MICROPY_PY_MACHINE_I2C (1)
39+
#define MICROPY_PY_MACHINE_ADC (1)
40+
#define MICROPY_PY_MACHINE_TEMP (1)
41+
42+
#define MICROPY_HW_HAS_LED (0)
43+
#define MICROPY_HW_HAS_SWITCH (0)
44+
#define MICROPY_HW_HAS_FLASH (0)
45+
#define MICROPY_HW_HAS_SDCARD (0)
46+
#define MICROPY_HW_HAS_MMA7660 (0)
47+
#define MICROPY_HW_HAS_LIS3DSH (0)
48+
#define MICROPY_HW_HAS_LCD (0)
49+
#define MICROPY_HW_ENABLE_RNG (0)
50+
#define MICROPY_HW_ENABLE_RTC (0)
51+
#define MICROPY_HW_ENABLE_TIMER (0)
52+
#define MICROPY_HW_ENABLE_SERVO (0)
53+
#define MICROPY_HW_ENABLE_DAC (0)
54+
#define MICROPY_HW_ENABLE_CAN (0)
55+
56+
// UART config
57+
#define MICROPY_HW_UART1_RX (pin_A1)
58+
#define MICROPY_HW_UART1_TX (pin_A2)
59+
#define MICROPY_HW_UART1_HWFC (0)
60+
61+
// SPI0 config
62+
#define MICROPY_HW_SPI0_NAME "SPI0"
63+
#define MICROPY_HW_SPI0_SCK (pin_A9)
64+
#define MICROPY_HW_SPI0_MOSI (pin_A10)
65+
#define MICROPY_HW_SPI0_MISO (pin_A13)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
MCU_SERIES = m0
2+
MCU_VARIANT = nrf51
3+
MCU_SUB_VARIANT = nrf51822
4+
LD_FILE = boards/nrf51x22_256k_16k.ld
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
MCU_SERIES = m0
2+
MCU_VARIANT = nrf51
3+
MCU_SUB_VARIANT = nrf51822
4+
SOFTDEV_VERSION = 8.0.0
5+
LD_FILE = boards/nrf51x22_256k_16k_s110_$(SOFTDEV_VERSION).ld
6+
7+
CFLAGS += -DBLUETOOTH_LFCLK_RC
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#ifndef NRF51_HAL_CONF_H__
2+
#define NRF51_HAL_CONF_H__
3+
4+
#define HAL_UART_MODULE_ENABLED
5+
#define HAL_SPI_MODULE_ENABLED
6+
#define HAL_TIME_MODULE_ENABLED
7+
#define HAL_RTC_MODULE_ENABLED
8+
#define HAL_TIMER_MODULE_ENABLED
9+
#define HAL_TWI_MODULE_ENABLED
10+
#define HAL_ADC_MODULE_ENABLED
11+
#define HAL_TEMP_MODULE_ENABLED
12+
#define HAL_RNG_MODULE_ENABLED
13+
14+
#endif // NRF51_HAL_CONF_H__
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
PA1,PA1
2+
PA2,PA2
3+
PA3,PA3
4+
PA4,PA4
5+
PA9,PA9
6+
PA10,PA10
7+
PA13,PA13

0 commit comments

Comments
 (0)