mirror of https://github.com/meshcore-dev/MeshCore
7 changed files with 388 additions and 29 deletions
@ -0,0 +1,38 @@ |
|||||
|
/* Linker script to configure memory regions. */ |
||||
|
|
||||
|
SEARCH_DIR(.) |
||||
|
GROUP(-lgcc -lc -lnosys) |
||||
|
|
||||
|
MEMORY |
||||
|
{ |
||||
|
FLASH (rx) : ORIGIN = 0x27000, LENGTH = 0xED000 - 0x27000 |
||||
|
|
||||
|
/* SRAM required by Softdevice depend on |
||||
|
* - Attribute Table Size (Number of Services and Characteristics) |
||||
|
* - Vendor UUID count |
||||
|
* - Max ATT MTU |
||||
|
* - Concurrent connection peripheral + central + secure links |
||||
|
* - Event Len, HVN queue, Write CMD queue |
||||
|
*/ |
||||
|
RAM (rwx) : ORIGIN = 0x20006000, LENGTH = 0x20040000 - 0x20006000 |
||||
|
} |
||||
|
|
||||
|
SECTIONS |
||||
|
{ |
||||
|
. = ALIGN(4); |
||||
|
.svc_data : |
||||
|
{ |
||||
|
PROVIDE(__start_svc_data = .); |
||||
|
KEEP(*(.svc_data)) |
||||
|
PROVIDE(__stop_svc_data = .); |
||||
|
} > RAM |
||||
|
|
||||
|
.fs_data : |
||||
|
{ |
||||
|
PROVIDE(__start_fs_data = .); |
||||
|
KEEP(*(.fs_data)) |
||||
|
PROVIDE(__stop_fs_data = .); |
||||
|
} > RAM |
||||
|
} INSERT AFTER .data; |
||||
|
|
||||
|
INCLUDE "nrf52_common.ld" |
||||
@ -0,0 +1,58 @@ |
|||||
|
{ |
||||
|
"build": { |
||||
|
"arduino": { |
||||
|
"ldscript": "nrf52840_s140_v7.ld" |
||||
|
}, |
||||
|
"core": "nRF5", |
||||
|
"cpu": "cortex-m4", |
||||
|
"extra_flags": "-DARDUINO_WIO_WM1110 -DNRF52840_XXAA", |
||||
|
"f_cpu": "64000000L", |
||||
|
"hwids": [ |
||||
|
["0x239A", "0x8029"], |
||||
|
["0x239A", "0x0029"], |
||||
|
["0x239A", "0x002A"], |
||||
|
["0x239A", "0x802A"] |
||||
|
], |
||||
|
"usb_product": "T1000-E-BOOT", |
||||
|
"mcu": "nrf52840", |
||||
|
"variant": "Seeed_T1000-E", |
||||
|
"bsp": { |
||||
|
"name": "adafruit" |
||||
|
}, |
||||
|
"softdevice": { |
||||
|
"sd_flags": "-DS140", |
||||
|
"sd_name": "s140", |
||||
|
"sd_version": "7.3.0", |
||||
|
"sd_fwid": "0x0123" |
||||
|
}, |
||||
|
"bootloader": { |
||||
|
"settings_addr": "0xFF000" |
||||
|
} |
||||
|
}, |
||||
|
"connectivity": ["bluetooth"], |
||||
|
"debug": { |
||||
|
"jlink_device": "nRF52840_xxAA", |
||||
|
"svd_path": "nrf52840.svd" |
||||
|
}, |
||||
|
"frameworks": ["arduino"], |
||||
|
"name": "Seeed T1000-E", |
||||
|
"upload": { |
||||
|
"maximum_ram_size": 248832, |
||||
|
"maximum_size": 815104, |
||||
|
"speed": 115200, |
||||
|
"protocol": "nrfutil", |
||||
|
"protocols": [ |
||||
|
"jlink", |
||||
|
"nrfjprog", |
||||
|
"nrfutil", |
||||
|
"stlink", |
||||
|
"cmsis-dap", |
||||
|
"blackmagic" |
||||
|
], |
||||
|
"use_1200bps_touch": true, |
||||
|
"require_upload_port": true, |
||||
|
"wait_for_upload_port": true |
||||
|
}, |
||||
|
"url": "https://www.seeedstudio.com/SenseCAP-Card-Tracker-T1000-E-for-Meshtastic-p-5913.html", |
||||
|
"vendor": "Seeed Studio" |
||||
|
} |
||||
@ -0,0 +1,96 @@ |
|||||
|
/*
|
||||
|
* variant.cpp |
||||
|
* Copyright (C) 2023 Seeed K.K. |
||||
|
* MIT License |
||||
|
*/ |
||||
|
|
||||
|
#include "variant.h" |
||||
|
#include "wiring_constants.h" |
||||
|
#include "wiring_digital.h" |
||||
|
|
||||
|
const uint32_t g_ADigitalPinMap[PINS_COUNT + 1] = |
||||
|
{ |
||||
|
0, // P0.00
|
||||
|
1, // P0.01
|
||||
|
2, // P0.02, AIN0 BATTERY_PIN
|
||||
|
3, // P0.03
|
||||
|
4, // P0.04, SENSOR_EN
|
||||
|
5, // P0.05, EXT_PWR_DETEC
|
||||
|
6, // P0.06, PIN_BUTTON1
|
||||
|
7, // P0.07, LORA_BUSY
|
||||
|
8, // P0.08, GPS_VRTC_EN
|
||||
|
9, // P0.09
|
||||
|
10, // P0.10
|
||||
|
11, // P0.11, PIN_SPI_SCK
|
||||
|
12, // P0.12, PIN_SPI_NSS
|
||||
|
13, // P0.13, PIN_SERIAL1_TX
|
||||
|
14, // P0.14, PIN_SERIAL1_RX
|
||||
|
15, // P0.15, GPS_RTC_INT
|
||||
|
16, // P0.16, PIN_SERIAL2_TX
|
||||
|
17, // P0.17, PIN_SERIAL2_RX
|
||||
|
18, // P0.18
|
||||
|
19, // P0.19
|
||||
|
20, // P0.20
|
||||
|
21, // P0.21
|
||||
|
22, // P0.22
|
||||
|
23, // P0.23
|
||||
|
24, // P0.24, LED_GREEN
|
||||
|
25, // P0.25, BUZZER_PIN
|
||||
|
26, // P0.26, PIN_WIRE_SDA
|
||||
|
27, // P0.27, PIN_WIRE_SCL
|
||||
|
28, // P0.28
|
||||
|
29, // P0.29, AIN5, LUX_SENSOR
|
||||
|
30, // P0.30
|
||||
|
31, // P0.31, AIN7, TEMP_SENSOR
|
||||
|
32, // P1.00
|
||||
|
33, // P1.01, LORA_DIO_1
|
||||
|
34, // P1.02
|
||||
|
35, // P1.03, EXT_CHRG_DETECT
|
||||
|
36, // P1.04
|
||||
|
37, // P1.05, LR1110_EN
|
||||
|
38, // P1.06, 3V3_EN PWR TO SENSORS
|
||||
|
39, // P1.07, PIN_3V3_ACC_EN
|
||||
|
40, // P1.08, PIN_SPI_MISO
|
||||
|
41, // P1.09, PIN_SPI_MOSI
|
||||
|
42, // P1.10, LORA_RESET
|
||||
|
43, // P1.11, GPS_EN
|
||||
|
44, // P1.12, GPS_SLEEP_INT
|
||||
|
45, // P1.13
|
||||
|
46, // P1.14, GPS_RESETB
|
||||
|
47, // P1.15, PIN_GPS_RESET
|
||||
|
255, // NRFX_SPIM_PIN_NOT_USED
|
||||
|
}; |
||||
|
|
||||
|
void initVariant() |
||||
|
{ |
||||
|
// All pins output HIGH by default.
|
||||
|
// https://github.com/Seeed-Studio/Adafruit_nRF52_Arduino/blob/fab7d30a997a1dfeef9d1d59bfb549adda73815a/cores/nRF5/wiring.c#L65-L69
|
||||
|
|
||||
|
pinMode(BATTERY_PIN, INPUT); |
||||
|
pinMode(EXT_CHRG_DETECT, INPUT); |
||||
|
pinMode(EXT_PWR_DETECT, INPUT); |
||||
|
pinMode(GPS_RESETB, INPUT); |
||||
|
pinMode(PIN_BUTTON1, INPUT); |
||||
|
|
||||
|
pinMode(PIN_3V3_EN, OUTPUT); |
||||
|
pinMode(PIN_3V3_ACC_EN, OUTPUT); |
||||
|
pinMode(BUZZER_EN, OUTPUT); |
||||
|
pinMode(SENSOR_EN, OUTPUT); |
||||
|
pinMode(GPS_EN, OUTPUT); |
||||
|
pinMode(GPS_RESET, OUTPUT); |
||||
|
pinMode(GPS_VRTC_EN, OUTPUT); |
||||
|
pinMode(GPS_SLEEP_INT, OUTPUT); |
||||
|
pinMode(GPS_RTC_INT, OUTPUT); |
||||
|
pinMode(LED_PIN, OUTPUT); |
||||
|
|
||||
|
digitalWrite(PIN_3V3_EN, HIGH); |
||||
|
digitalWrite(PIN_3V3_ACC_EN, LOW); |
||||
|
digitalWrite(BUZZER_EN, LOW); |
||||
|
digitalWrite(SENSOR_EN, LOW); |
||||
|
digitalWrite(GPS_EN, LOW); |
||||
|
digitalWrite(GPS_RESET, LOW); |
||||
|
digitalWrite(GPS_VRTC_EN, HIGH); |
||||
|
digitalWrite(GPS_SLEEP_INT, HIGH); |
||||
|
digitalWrite(GPS_RTC_INT, LOW); |
||||
|
digitalWrite(LED_PIN, LOW); |
||||
|
} |
||||
@ -0,0 +1,136 @@ |
|||||
|
/*
|
||||
|
* variant.h |
||||
|
* Copyright (C) 2023 Seeed K.K. |
||||
|
* MIT License |
||||
|
*/ |
||||
|
|
||||
|
#pragma once |
||||
|
|
||||
|
#include "WVariant.h" |
||||
|
|
||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||
|
// Low frequency clock source
|
||||
|
|
||||
|
#define USE_LFXO // 32.768 kHz crystal oscillator
|
||||
|
#define VARIANT_MCK (64000000ul) |
||||
|
// #define USE_LFRC // 32.768 kHz RC oscillator
|
||||
|
|
||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||
|
// Power
|
||||
|
|
||||
|
#define NRF_APM // detect usb power
|
||||
|
#define PIN_3V3_EN (38) // P1.6 Power to Sensors
|
||||
|
|
||||
|
#define BATTERY_PIN (2) // P0.2/AIN0
|
||||
|
#define BATTERY_IMMUTABLE |
||||
|
#define ADC_MULTIPLIER (2.0F) |
||||
|
|
||||
|
#define EXT_CHRG_DETECT (35) // P1.3
|
||||
|
#define EXT_PWR_DETECT (5) // P0.5
|
||||
|
|
||||
|
#define ADC_RESOLUTION (14) |
||||
|
#define BATTERY_SENSE_RES (12) |
||||
|
|
||||
|
#define AREF_VOLTAGE (3.0) |
||||
|
|
||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||
|
// Number of pins
|
||||
|
|
||||
|
#define PINS_COUNT (48) |
||||
|
#define NUM_DIGITAL_PINS (48) |
||||
|
#define NUM_ANALOG_INPUTS (6) |
||||
|
#define NUM_ANALOG_OUTPUTS (0) |
||||
|
|
||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||
|
// UART pin definition
|
||||
|
|
||||
|
#define PIN_SERIAL1_RX (14) // P0.14
|
||||
|
#define PIN_SERIAL1_TX (13) // P0.13
|
||||
|
|
||||
|
#define PIN_SERIAL2_RX (17) // P0.17
|
||||
|
#define PIN_SERIAL2_TX (16) // P0.16
|
||||
|
|
||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||
|
// I2C pin definition
|
||||
|
|
||||
|
#define HAS_WIRE (1) |
||||
|
#define WIRE_INTERFACES_COUNT (1) |
||||
|
|
||||
|
#define PIN_WIRE_SDA (26) // P0.26
|
||||
|
#define PIN_WIRE_SCL (27) // P0.27
|
||||
|
#define I2C_NO_RESCAN |
||||
|
#define HAS_QMA6100P |
||||
|
#define QMA_6100P_INT_PIN (34) // P1.2
|
||||
|
|
||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||
|
// SPI pin definition
|
||||
|
|
||||
|
#define SPI_INTERFACES_COUNT (1) |
||||
|
|
||||
|
#define PIN_SPI_MISO (40) // P1.8
|
||||
|
#define PIN_SPI_MOSI (41) // P1.9
|
||||
|
#define PIN_SPI_SCK (11) // P0.11
|
||||
|
#define PIN_SPI_NSS (12) // P0.12
|
||||
|
|
||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||
|
// Builtin LEDs
|
||||
|
|
||||
|
#define LED_BUILTIN (-1) |
||||
|
#define LED_BLUE (-1) // No blue led
|
||||
|
#define LED_GREEN (24) // P0.24
|
||||
|
#define LED_PIN LED_GREEN |
||||
|
|
||||
|
#define LED_STATE_ON HIGH |
||||
|
|
||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||
|
// Builtin buttons
|
||||
|
|
||||
|
#define PIN_BUTTON1 (6) // P0.6
|
||||
|
#define BUTTON_PIN PIN_BUTTON1 |
||||
|
|
||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||
|
// LR1110
|
||||
|
|
||||
|
#define LORA_DIO_1 (33) // P1.1
|
||||
|
#define LORA_NSS (PIN_SPI_NSS) // P0.12
|
||||
|
#define LORA_RESET (42) // P1.10
|
||||
|
#define LORA_BUSY (7) // P0.7
|
||||
|
#define LORA_SCLK (PIN_SPI_SCK) // P0.11
|
||||
|
#define LORA_MISO (PIN_SPI_MISO) // P1.8
|
||||
|
#define LORA_MOSI (PIN_SPI_MOSI) // P0.9
|
||||
|
|
||||
|
#define LR11X0_DIO_AS_RF_SWITCH true |
||||
|
#define LR11X0_DIO3_TCXO_VOLTAGE 1.6 |
||||
|
|
||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||
|
// GPS
|
||||
|
|
||||
|
#define HAS_GPS 1 |
||||
|
#define GPS_RX_PIN PIN_SERIAL1_RX |
||||
|
#define GPS_TX_PIN PIN_SERIAL1_TX |
||||
|
|
||||
|
#define GPS_EN (43) // P1.11
|
||||
|
#define GPS_RESET (47) // P1.15
|
||||
|
|
||||
|
#define GPS_VRTC_EN (8) // P0.8
|
||||
|
#define GPS_SLEEP_INT (44) // P1.12
|
||||
|
#define GPS_RTC_INT (15) // P0.15
|
||||
|
#define GPS_RESETB (46) // P1.14
|
||||
|
|
||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||
|
// Temp+Lux Sensor
|
||||
|
|
||||
|
#define SENSOR_EN (4) // P0.4
|
||||
|
#define TEMP_SENSOR (31) // P0.31/AIN7
|
||||
|
#define LUX_SENSOR (29) // P0.29/AIN5
|
||||
|
|
||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||
|
// Accelerometer (I2C addr : ??? )
|
||||
|
|
||||
|
#define PIN_3V3_ACC_EN (39) // P1.7
|
||||
|
|
||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||
|
// Buzzer
|
||||
|
|
||||
|
#define BUZZER_EN (37) // P1.5
|
||||
|
#define BUZZER_PIN (25) // P0.25
|
||||
Loading…
Reference in new issue