mirror of https://github.com/meshcore-dev/MeshCore
7 changed files with 186 additions and 240 deletions
@ -0,0 +1,78 @@ |
|||||
|
{ |
||||
|
"build": { |
||||
|
"arduino":{ |
||||
|
"ldscript": "nrf52840_s140_v6.ld" |
||||
|
}, |
||||
|
"core": "nRF5", |
||||
|
"cpu": "cortex-m4", |
||||
|
"extra_flags": "-DARDUINO_NRF52840_FEATHER -DNRF52840_XXAA", |
||||
|
"f_cpu": "64000000L", |
||||
|
"hwids": [ |
||||
|
[ |
||||
|
"0x239A", |
||||
|
"0x00B3" |
||||
|
], |
||||
|
[ |
||||
|
"0x239A", |
||||
|
"0x8029" |
||||
|
], |
||||
|
[ |
||||
|
"0x239A", |
||||
|
"0x0029" |
||||
|
], |
||||
|
[ |
||||
|
"0x239A", |
||||
|
"0x002A" |
||||
|
], |
||||
|
[ |
||||
|
"0x239A", |
||||
|
"0x802A" |
||||
|
] |
||||
|
], |
||||
|
"usb_product": "ProMicro NRF52840", |
||||
|
"mcu": "nrf52840", |
||||
|
"variant": "promicro_nrf52840", |
||||
|
"variants_dir": "variants", |
||||
|
"bsp": { |
||||
|
"name": "adafruit" |
||||
|
}, |
||||
|
"softdevice": { |
||||
|
"sd_flags": "-DS140", |
||||
|
"sd_name": "s140", |
||||
|
"sd_version": "6.1.1", |
||||
|
"sd_fwid": "0x00B6" |
||||
|
}, |
||||
|
"bootloader": { |
||||
|
"settings_addr": "0xFF000" |
||||
|
} |
||||
|
}, |
||||
|
"connectivity": [ |
||||
|
"bluetooth" |
||||
|
], |
||||
|
"debug": { |
||||
|
"jlink_device": "nRF52840_xxAA", |
||||
|
"svd_path": "nrf52840.svd" |
||||
|
}, |
||||
|
"frameworks": [ |
||||
|
"arduino", |
||||
|
"zephyr" |
||||
|
], |
||||
|
"name": "ProMicro NRF52840", |
||||
|
"upload": { |
||||
|
"maximum_ram_size": 248832, |
||||
|
"maximum_size": 815104, |
||||
|
"speed": 115200, |
||||
|
"protocol": "nrfutil", |
||||
|
"protocols": [ |
||||
|
"jlink", |
||||
|
"nrfjprog", |
||||
|
"nrfutil", |
||||
|
"stlink" |
||||
|
], |
||||
|
"use_1200bps_touch": true, |
||||
|
"require_upload_port": true, |
||||
|
"wait_for_upload_port": true |
||||
|
}, |
||||
|
"url": "https://www.nologo.tech/en/product/otherboard/NRF52840.html", |
||||
|
"vendor": "Nologo" |
||||
|
} |
||||
@ -0,0 +1,15 @@ |
|||||
|
#include "variant.h" |
||||
|
#include "wiring_constants.h" |
||||
|
#include "wiring_digital.h" |
||||
|
|
||||
|
const uint32_t g_ADigitalPinMap[] = { |
||||
|
8, 6, 17, 20, 22, 24, 32, 11, 36, 38, |
||||
|
9, 10, 43, 45, 47, 2, 29, 31, |
||||
|
33, 34, 37, |
||||
|
13, 15 |
||||
|
}; |
||||
|
|
||||
|
void initVariant() |
||||
|
{ |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,82 @@ |
|||||
|
/*
|
||||
|
* variant.h |
||||
|
* Copyright (C) 2023 Seeed K.K. |
||||
|
* MIT License |
||||
|
*/ |
||||
|
|
||||
|
#pragma once |
||||
|
|
||||
|
#include "WVariant.h" |
||||
|
|
||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||
|
// Low frequency clock source
|
||||
|
|
||||
|
#define VARIANT_MCK (64000000ul) |
||||
|
|
||||
|
//#define USE_LFXO // 32.768 kHz crystal oscillator
|
||||
|
#define USE_LFRC // 32.768 kHz RC oscillator
|
||||
|
|
||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||
|
// Power
|
||||
|
|
||||
|
#define PIN_EXT_VCC (21) |
||||
|
#define EXT_VCC (PIN_EXT_VCC) |
||||
|
|
||||
|
#define BATTERY_PIN (17) |
||||
|
#define ADC_RESOLUTION 12 |
||||
|
|
||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||
|
// Number of pins
|
||||
|
|
||||
|
#define PINS_COUNT (23) |
||||
|
#define NUM_DIGITAL_PINS (23) |
||||
|
#define NUM_ANALOG_INPUTS (3) |
||||
|
#define NUM_ANALOG_OUTPUTS (0) |
||||
|
|
||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||
|
// UART pin definition
|
||||
|
|
||||
|
#define PIN_SERIAL1_TX (1) |
||||
|
#define PIN_SERIAL1_RX (0) |
||||
|
|
||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||
|
// I2C pin definition
|
||||
|
|
||||
|
#define WIRE_INTERFACES_COUNT 2 |
||||
|
|
||||
|
#define PIN_WIRE_SDA (6) |
||||
|
#define PIN_WIRE_SCL (7) |
||||
|
#define PIN_WIRE1_SDA (13) |
||||
|
#define PIN_WIRE1_SCL (14) |
||||
|
|
||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||
|
// SPI pin definition
|
||||
|
|
||||
|
#define SPI_INTERFACES_COUNT 2 |
||||
|
|
||||
|
#define PIN_SPI_SCK (2) |
||||
|
#define PIN_SPI_MISO (3) |
||||
|
#define PIN_SPI_MOSI (4) |
||||
|
|
||||
|
#define PIN_SPI_NSS (5) |
||||
|
|
||||
|
#define PIN_SPI1_SCK (18) |
||||
|
#define PIN_SPI1_MISO (19) |
||||
|
#define PIN_SPI1_MOSI (20) |
||||
|
|
||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||
|
// Builtin LEDs
|
||||
|
|
||||
|
#define PIN_LED (22) |
||||
|
#define LED_PIN PIN_LED |
||||
|
#define LED_BLUE PIN_LED |
||||
|
#define LED_BUILTIN PIN_LED |
||||
|
#define LED_STATE_ON 1 |
||||
|
|
||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||
|
// Builtin buttons
|
||||
|
|
||||
|
#define PIN_BUTTON1 (6) |
||||
|
#define BUTTON_PIN PIN_BUTTON1 |
||||
|
|
||||
|
|
||||
@ -1,52 +0,0 @@ |
|||||
#include "variant.h" |
|
||||
#include "wiring_constants.h" |
|
||||
#include "wiring_digital.h" |
|
||||
#include "nrf.h" |
|
||||
|
|
||||
const uint32_t g_ADigitalPinMap[] = |
|
||||
{ |
|
||||
// D0 - D9 (left side, top to bottom)
|
|
||||
6, // D0 is P0.06 (D0, TX)
|
|
||||
8, // D1 is P0.08 (D1, RX)
|
|
||||
17, // D2 is P0.17 (D2, SCK)
|
|
||||
20, // D3 is P0.20 (D3, MISO)
|
|
||||
22, // D4 is P0.22 (D4, MOSI)
|
|
||||
24, // D5 is P0.24 (D5, CS)
|
|
||||
32, // D6 is P1.00 (D6, SDA)
|
|
||||
11, // D7 is P0.11 (D7, SCL)
|
|
||||
36, // D8 is P1.04 (D8)
|
|
||||
38, // D9 is P1.06 (D9)
|
|
||||
|
|
||||
// D10 - D17 (right side, bottom to top)
|
|
||||
9, // D10 is P0.09 (D10, NFC1)
|
|
||||
10, // D11 is P0.10 (D11, NFC2)
|
|
||||
43, // D12 is P1.11 (D12)
|
|
||||
45, // D13 is P1.13 (D13, SDA1)
|
|
||||
47, // D14 is P1.15 (D14, SCL1)
|
|
||||
2, // D15 is P0.02 (D15, A0)
|
|
||||
29, // D16 is P0.29 (D16, A1)
|
|
||||
31, // D17 is P0.31 (D17, A2)
|
|
||||
|
|
||||
// D18 - D20 (extra center pins, left to right)
|
|
||||
33, // D18 is P1.01 (D18, SCK1)
|
|
||||
34, // D19 is P1.02 (D19, MISO1)
|
|
||||
39, // D20 is P1.07 (D20, MOSI1)
|
|
||||
|
|
||||
// EXT_VCC
|
|
||||
13, // 'D21' is P0.13 (EXT_VCC) [active high]
|
|
||||
|
|
||||
// LED
|
|
||||
15, // 'D22' is P0.15 (LED)
|
|
||||
}; |
|
||||
|
|
||||
void initVariant() |
|
||||
{ |
|
||||
// enable EXT_VCC by default
|
|
||||
pinMode(EXT_VCC, OUTPUT); |
|
||||
digitalWrite(EXT_VCC, HIGH); |
|
||||
|
|
||||
// enable LED by default
|
|
||||
pinMode(LED_BUILTIN, OUTPUT); |
|
||||
digitalWrite(LED_BUILTIN, HIGH); |
|
||||
} |
|
||||
|
|
||||
@ -1,176 +0,0 @@ |
|||||
#ifndef _SUPERMINI_NRF52840_H_ |
|
||||
#define _SUPERMINI_NRF52840_H_ |
|
||||
|
|
||||
#define TARGET_SUPERMINI_NRF52840 |
|
||||
|
|
||||
/** Master clock frequency */ |
|
||||
#define VARIANT_MCK (64000000ul) |
|
||||
|
|
||||
//#define USE_LFXO // Board uses 32khz crystal for LF
|
|
||||
#define USE_LFRC // Board uses RC for LF
|
|
||||
|
|
||||
/*----------------------------------------------------------------------------
|
|
||||
* Headers |
|
||||
*----------------------------------------------------------------------------*/ |
|
||||
|
|
||||
#include "WVariant.h" |
|
||||
|
|
||||
#ifdef __cplusplus |
|
||||
extern "C" |
|
||||
{ |
|
||||
#endif // __cplusplus
|
|
||||
|
|
||||
#define PINS_COUNT (23) |
|
||||
#define NUM_DIGITAL_PINS (23) |
|
||||
#define NUM_ANALOG_INPUTS (3) |
|
||||
#define NUM_ANALOG_OUTPUTS (0) |
|
||||
|
|
||||
// NOTE:
|
|
||||
//
|
|
||||
// BATTERY VOLTAGE IS READ VIA VDDH/5 BY CALLING
|
|
||||
//
|
|
||||
// analogReadVDDHDIV5() // returns uint32_t
|
|
||||
|
|
||||
// 3V3 Regulator Disable
|
|
||||
#define PIN_EXT_VCC (21) // EXT_VCC is P0.13 (set low to disable 3v3)
|
|
||||
#define EXT_VCC (PIN_EXT_VCC) |
|
||||
|
|
||||
// LEDs
|
|
||||
#define PIN_LED (22) // USR LED is P0.15
|
|
||||
#define LED_PWR (PINS_COUNT) // no LED_PWR
|
|
||||
#define PIN_NEOPIXEL (PINS_COUNT) // no neopixel
|
|
||||
#define NEOPIXEL_NUM 0 |
|
||||
#define LED_BLUE PIN_LED // required by bluefruit library
|
|
||||
|
|
||||
#define LED_BUILTIN PIN_LED |
|
||||
|
|
||||
#define LED_STATE_ON 1 // State when LED is on
|
|
||||
|
|
||||
/*
|
|
||||
* Buttons |
|
||||
*/ |
|
||||
#define PIN_BUTTON1 (PINS_COUNT) // no button
|
|
||||
|
|
||||
// Digital PINs
|
|
||||
// NOTE: THIS IS A RENUMBERING OF THE PINS
|
|
||||
// AND DOES NOT CORRESPOND TO THE NICENANO DIAGRAM
|
|
||||
|
|
||||
// left side (top to bottom)
|
|
||||
#define D0 (0ul) // P0.06 (TX)
|
|
||||
#define D1 (1ul) // P0.08 (RX)
|
|
||||
#define D2 (2ul) // P0.17 (SCK)
|
|
||||
#define D3 (3ul) // P0.20 (MISO)
|
|
||||
#define D4 (4ul) // P0.22 (MOSI)
|
|
||||
#define D5 (5ul) // P0.24 (CS)
|
|
||||
#define D6 (6ul) // P1.00 (SDA)
|
|
||||
#define D7 (7ul) // P0.11 (SCL)
|
|
||||
#define D8 (8ul) // P1.04
|
|
||||
#define D9 (9ul) // P1.06
|
|
||||
|
|
||||
// right side (bottom to top)
|
|
||||
#define D10 (10ul) // P0.09 (NFC1)
|
|
||||
#define D11 (11ul) // P0.10 (NFC2)
|
|
||||
#define D12 (12ul) // P1.11
|
|
||||
#define D13 (13ul) // P1.13 (SDA1)
|
|
||||
#define D14 (14ul) // P1.15 (SCL1)
|
|
||||
#define D15 (15ul) // P0.02/AIN0 (A0)
|
|
||||
#define D16 (16ul) // P0.29/AIN6 (A1)
|
|
||||
#define D17 (17ul) // P0.31/AIN7 (A2)
|
|
||||
|
|
||||
// extra center pins (left to right)
|
|
||||
#define D18 (18ul) // P1.01 (SCK1)
|
|
||||
#define D19 (19ul) // P1.02 (MISO1)
|
|
||||
#define D20 (20ul) // P1.07 (MOSI1)
|
|
||||
|
|
||||
/*
|
|
||||
* Macros for nRF pin numbers for compatibility |
|
||||
*/ |
|
||||
#define P0_06 (D0) |
|
||||
#define P0_08 (D1) |
|
||||
#define P0_17 (D2) |
|
||||
#define P0_20 (D3) |
|
||||
#define P0_22 (D4) |
|
||||
#define P0_24 (D5) |
|
||||
#define P1_00 (D6) |
|
||||
#define P0_11 (D7) |
|
||||
#define P1_04 (D8) |
|
||||
#define P1_06 (D9) |
|
||||
#define P0_09 (D10) |
|
||||
#define P0_10 (D11) |
|
||||
#define P1_11 (D12) |
|
||||
#define P1_13 (D13) |
|
||||
#define P1_15 (D14) |
|
||||
#define P0_02 (D15) |
|
||||
#define P0_29 (D16) |
|
||||
#define P0_31 (D17) |
|
||||
#define P1_01 (D18) |
|
||||
#define P1_02 (D19) |
|
||||
#define P1_07 (D20) |
|
||||
#define P0_13 (EXT_VCC) |
|
||||
#define P0_15 (PIN_LED) |
|
||||
|
|
||||
/*
|
|
||||
* Analog pins |
|
||||
*/ |
|
||||
#define PIN_A0 (15) // P0.02 (D15)
|
|
||||
#define PIN_A1 (16) // P0.29 (D16)
|
|
||||
#define PIN_A2 (17) // P0.31 (D17)
|
|
||||
|
|
||||
static const uint8_t A0 = PIN_A0 ; |
|
||||
static const uint8_t A1 = PIN_A1 ; |
|
||||
static const uint8_t A2 = PIN_A2 ; |
|
||||
#define ADC_RESOLUTION 12 |
|
||||
|
|
||||
/*
|
|
||||
* Other pins |
|
||||
*/ |
|
||||
#define PIN_NFC1 (10) // P0.09 - also D10
|
|
||||
#define PIN_NFC2 (11) // P0.10 - also D11
|
|
||||
|
|
||||
/*
|
|
||||
* Serial interfaces |
|
||||
*/ |
|
||||
#define PIN_SERIAL1_TX (0) // P0.06 - also D0
|
|
||||
#define PIN_SERIAL1_RX (1) // P0.08 - also D1
|
|
||||
|
|
||||
/*
|
|
||||
* SPI Interfaces |
|
||||
*/ |
|
||||
#define SPI_INTERFACES_COUNT 2 |
|
||||
|
|
||||
#define PIN_SPI_SCK (2) // P0.17 - D2
|
|
||||
#define PIN_SPI_MISO (3) // P0.20 - D3
|
|
||||
#define PIN_SPI_MOSI (4) // P0.22 - D4
|
|
||||
|
|
||||
static const uint8_t SS = (5); // P0.24 - D5
|
|
||||
static const uint8_t MOSI = PIN_SPI_MOSI ; |
|
||||
static const uint8_t MISO = PIN_SPI_MISO ; |
|
||||
static const uint8_t SCK = PIN_SPI_SCK ; |
|
||||
|
|
||||
#define PIN_SPI1_SCK (18) // P1.01 - D18
|
|
||||
#define PIN_SPI1_MISO (19) // P1.02 - D19
|
|
||||
#define PIN_SPI1_MOSI (20) // P1.07 - D20
|
|
||||
|
|
||||
/*
|
|
||||
* Wire Interfaces |
|
||||
*/ |
|
||||
#define WIRE_INTERFACES_COUNT 2 |
|
||||
|
|
||||
#define PIN_WIRE_SDA (6) // P1.00 - D6
|
|
||||
#define PIN_WIRE_SCL (7) // P0.11 - D7
|
|
||||
|
|
||||
static const uint8_t SDA = PIN_WIRE_SDA; |
|
||||
static const uint8_t SCL = PIN_WIRE_SCL; |
|
||||
|
|
||||
#define PIN_WIRE1_SDA (13) // P1.13 - D13
|
|
||||
#define PIN_WIRE1_SCL (14) // P1.15 - D14
|
|
||||
|
|
||||
#ifdef __cplusplus |
|
||||
} |
|
||||
#endif |
|
||||
|
|
||||
/*----------------------------------------------------------------------------
|
|
||||
* Arduino objects - C++ only |
|
||||
*----------------------------------------------------------------------------*/ |
|
||||
|
|
||||
#endif |
|
||||
Loading…
Reference in new issue