nrf: dsd6: Add support for DS-D6 fitness tracker

From c4579ff251/micropython/micropython/DS-D6-micropython.diff

[daniel@redfelineninja.org.uk: Split out feature patches, minor clean ups]
pull/1/head
fanoush 2020-01-17 19:34:30 +00:00 committed by Daniel Thompson
parent 8020af26ed
commit 1925b4f9fe
3 changed files with 97 additions and 0 deletions

View File

@ -0,0 +1,60 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2017 Glenn Ruben Bakke
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#define MICROPY_HW_BOARD_NAME "DS-D6"
#define MICROPY_HW_NUS_NAME MICROPY_HW_BOARD_NAME
#define MICROPY_HW_MCU_NAME "NRF52832"
#define MICROPY_PY_SYS_PLATFORM "nrf52"
#define MICROPY_PY_MACHINE_UART (1)
#define MICROPY_PY_MACHINE_HW_PWM (1)
#define MICROPY_PY_MACHINE_HW_SPI (1)
#define MICROPY_PY_MACHINE_TIMER (1)
#define MICROPY_PY_MACHINE_RTCOUNTER (1)
#define MICROPY_PY_MACHINE_I2C (1)
#define MICROPY_PY_MACHINE_ADC (1)
#define MICROPY_PY_MACHINE_TEMP (1)
#define MICROPY_PY_RANDOM_HW_RNG (1)
#define MICROPY_PY_MACHINE_DFU_BOOTLOADER (1)
#define MICROPY_HW_HAS_LED (0)
// UART config
#define MICROPY_HW_UART1_RX (22)
#define MICROPY_HW_UART1_TX (23)
#define MICROPY_HW_UART1_HWFC (0)
// SPI0 config
#define MICROPY_HW_SPI0_NAME "SPI0"
#define MICROPY_HW_SPI0_SCK (5)
#define MICROPY_HW_SPI0_MOSI (6)
#define MICROPY_HW_SPI0_MISO (NRFX_SPI_PIN_NOT_USED)
#define MICROPY_HW_PWM0_NAME "PWM0"
#define MICROPY_HW_PWM1_NAME "PWM1"
#define MICROPY_HW_PWM2_NAME "PWM2"
#define HELP_TEXT_BOARD_LED ""

View File

@ -0,0 +1,8 @@
MCU_SERIES = m4
MCU_VARIANT = nrf52
MCU_SUB_VARIANT = nrf52832
SOFTDEV_VERSION = 6.1.1
LD_FILES += boards/nrf52832_512k_64k_bldr78.ld
CFLAGS += -DBLUETOOTH_LFCLK_RC
NRF_DEFINES += -DNRF52832_XXAA

View File

@ -0,0 +1,29 @@
P2,P2,ADC0_IN0
P3,P3,ADC0_IN1
P4,P4
SPI_SCK,P5
SPI_MOSI,P6
P7,P7
P8,P8
P9,P9
P10,P10
P11,P11
P12,P12
P13,P13
P14,P14
P15,P14
P16,P13
P17,P17
P18,P18
P19,P19
P20,P20
UART_RX,P22
UART_TX,P23
P24,P24
PWM0,P25
P26,P26
P27,P27
P28,P28
P29,P29
P30,P30
P31,P31
1 P2,P2,ADC0_IN0
2 P3,P3,ADC0_IN1
3 P4,P4
4 SPI_SCK,P5
5 SPI_MOSI,P6
6 P7,P7
7 P8,P8
8 P9,P9
9 P10,P10
10 P11,P11
11 P12,P12
12 P13,P13
13 P14,P14
14 P15,P14
15 P16,P13
16 P17,P17
17 P18,P18
18 P19,P19
19 P20,P20
20 UART_RX,P22
21 UART_TX,P23
22 P24,P24
23 PWM0,P25
24 P26,P26
25 P27,P27
26 P28,P28
27 P29,P29
28 P30,P30
29 P31,P31