mirror of
https://github.com/liquidraver/ZephCore.git
synced 2026-09-02 08:13:44 +00:00
port seeed solar p1 + gps command fixes
This commit is contained in:
@@ -222,7 +222,7 @@ set(ZEPHCORE_COMMON_CONF "${CMAKE_CURRENT_SOURCE_DIR}/boards/common/zephcore_com
|
||||
# Detect platform from board name and add platform-specific common config
|
||||
# For boards with qualifiers like "wio_tracker_l1/nrf52840", check both the full BOARD
|
||||
# string and the BOARD_QUALIFIERS which contains just the qualifier (e.g., "nrf52840")
|
||||
if(BOARD MATCHES ".*nrf52.*" OR BOARD MATCHES "rak4631" OR BOARD MATCHES "rak_wismesh_tag" OR BOARD MATCHES "rak3401_1watt" OR BOARD MATCHES "wio_tracker" OR BOARD MATCHES "ikoka_nano" OR BOARD MATCHES "t1000_e" OR BOARD MATCHES "thinknode_m1" OR BOARD MATCHES "thinknode_m3" OR BOARD MATCHES "thinknode_m6" OR BOARD MATCHES "promicro_lr2021")
|
||||
if(BOARD MATCHES ".*nrf52.*" OR BOARD MATCHES "rak4631" OR BOARD MATCHES "rak_wismesh_tag" OR BOARD MATCHES "rak3401_1watt" OR BOARD MATCHES "wio_tracker" OR BOARD MATCHES "ikoka_nano" OR BOARD MATCHES "t1000_e" OR BOARD MATCHES "thinknode_m1" OR BOARD MATCHES "thinknode_m3" OR BOARD MATCHES "thinknode_m6" OR BOARD MATCHES "promicro_lr2021" OR BOARD MATCHES "sensecap_solar")
|
||||
set(ZEPHCORE_PLATFORM_CONF "${CMAKE_CURRENT_SOURCE_DIR}/boards/common/nrf52_common.conf")
|
||||
elseif(DEFINED BOARD_QUALIFIERS AND BOARD_QUALIFIERS MATCHES ".*nrf52.*")
|
||||
set(ZEPHCORE_PLATFORM_CONF "${CMAKE_CURRENT_SOURCE_DIR}/boards/common/nrf52_common.conf")
|
||||
|
||||
@@ -765,13 +765,15 @@ void gps_power_off_for_shutdown(void)
|
||||
* Works for any GNSS-on-UART node regardless of compatible string. */
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(gnss), okay) && \
|
||||
DT_NODE_HAS_STATUS(DT_BUS(DT_NODELABEL(gnss)), okay)
|
||||
static const struct device *gps_uart_dev = DEVICE_DT_GET(DT_BUS(DT_NODELABEL(gnss)));
|
||||
#define HAS_GPS_UART 1
|
||||
#if !HAS_GPS_POWER_CONTROL
|
||||
static const struct device *gps_uart_dev = DEVICE_DT_GET(DT_BUS(DT_NODELABEL(gnss)));
|
||||
#endif
|
||||
#else
|
||||
#define HAS_GPS_UART 0
|
||||
#endif
|
||||
|
||||
#if HAS_GPS_UART
|
||||
#if HAS_GPS_UART && !HAS_GPS_POWER_CONTROL
|
||||
/* Send raw bytes to the GPS UART using blocking poll_out.
|
||||
* Safe to call even though modem_chat/modem_ubx owns the UART pipe:
|
||||
* uart_poll_out writes one byte at a time through the TX register,
|
||||
@@ -842,7 +844,7 @@ static void gps_software_wake(void)
|
||||
/* Give the module time to boot and start NMEA output */
|
||||
k_msleep(200);
|
||||
}
|
||||
#endif /* HAS_GPS_UART */
|
||||
#endif /* HAS_GPS_UART && !HAS_GPS_POWER_CONTROL */
|
||||
|
||||
/* Go to standby and schedule next wake.
|
||||
* GPIO power control only — keep VRTC for warm start on T1000-E,
|
||||
|
||||
@@ -21,8 +21,8 @@ namespace mesh {
|
||||
|
||||
LoRaRadioBase::LoRaRadioBase(const struct device *lora_dev, MainBoard &board,
|
||||
NodePrefs *prefs)
|
||||
: _dev(lora_dev), _prefs(prefs), _board(&board),
|
||||
_loramac_node(false),
|
||||
: _loramac_node(false),
|
||||
_dev(lora_dev), _prefs(prefs), _board(&board),
|
||||
_in_recv_mode(0), _tx_active(0),
|
||||
_last_rssi(0), _last_snr(0),
|
||||
_rx_head(0), _rx_tail(0),
|
||||
|
||||
@@ -920,6 +920,47 @@ double RepeaterMesh::getNodeLon() const {
|
||||
return _prefs.node_lon;
|
||||
}
|
||||
|
||||
bool RepeaterMesh::setGpsEnabled(bool enabled) {
|
||||
if (!gps_is_available()) return false;
|
||||
gps_enable(enabled);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RepeaterMesh::isGpsEnabled() const {
|
||||
return gps_is_enabled();
|
||||
}
|
||||
|
||||
void RepeaterMesh::formatGpsStatsReply(char* reply) {
|
||||
if (!gps_is_enabled()) {
|
||||
strcpy(reply, "off");
|
||||
return;
|
||||
}
|
||||
|
||||
struct gps_state_info gsi;
|
||||
gps_get_state_info(&gsi);
|
||||
|
||||
static const char* const state_str[] = { "off", "standby", "acquiring" };
|
||||
const char* state = gsi.state < 3 ? state_str[gsi.state] : "unknown";
|
||||
|
||||
struct gps_position pos;
|
||||
bool has_pos = gps_get_last_known_position(&pos);
|
||||
|
||||
if (has_pos) {
|
||||
snprintf(reply, CLI_REPLY_SIZE,
|
||||
"on state=%s sats=%u fix=%us ago lat=%.6f lon=%.6f",
|
||||
state, gsi.satellites, gsi.last_fix_age_s,
|
||||
pos.latitude_ndeg / 1e9, pos.longitude_ndeg / 1e9);
|
||||
} else if (gsi.next_search_s > 0) {
|
||||
snprintf(reply, CLI_REPLY_SIZE,
|
||||
"on state=%s sats=%u no fix next=%us",
|
||||
state, gsi.satellites, gsi.next_search_s);
|
||||
} else {
|
||||
snprintf(reply, CLI_REPLY_SIZE,
|
||||
"on state=%s sats=%u no fix",
|
||||
state, gsi.satellites);
|
||||
}
|
||||
}
|
||||
|
||||
void RepeaterMesh::savePrefs() {
|
||||
if (_store) {
|
||||
_store->savePrefs(_prefs);
|
||||
|
||||
@@ -193,6 +193,9 @@ public:
|
||||
const char* getRole() override { return FIRMWARE_ROLE; }
|
||||
double getNodeLat() const override;
|
||||
double getNodeLon() const override;
|
||||
bool setGpsEnabled(bool enabled) override;
|
||||
bool isGpsEnabled() const override;
|
||||
void formatGpsStatsReply(char* reply) override;
|
||||
const char* getNodeName() { return _prefs.node_name; }
|
||||
NodePrefs* getNodePrefs() { return &_prefs; }
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ Supported Boards
|
||||
| RAK4631 | `west build -b rak4631 zephcore` | UF2 drag-drop or `west flash` |
|
||||
| RAK3401 1W | `west build -b rak3401_1watt zephcore` | UF2 drag-drop or `west flash` |
|
||||
| Wio Tracker L1 | `west build -b wio_tracker_l1 zephcore` | UF2 drag-drop or `west flash` |
|
||||
| SenseCAP Solar | `west build -b sensecap_solar zephcore` | UF2 drag-drop or `west flash` |
|
||||
| T1000-E | `west build -b t1000_e zephcore` | UF2 drag-drop or `west flash` |
|
||||
| ThinkNode M1 | `west build -b thinknode_m1 zephcore` | UF2 drag-drop or `west flash` |
|
||||
| ThinkNode M3 | `west build -b thinknode_m3 zephcore` | UF2 drag-drop or `west flash` |
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
# Copyright (c) 2025 ZephCore
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
config BOARD_SENSECAP_SOLAR
|
||||
select SOC_NRF52840_QIAA
|
||||
@@ -0,0 +1,13 @@
|
||||
# Copyright (c) 2025 ZephCore
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
board_runner_args(jlink "--device=nRF52840_xxAA" "--speed=4000")
|
||||
board_runner_args(pyocd "--target=nrf52840" "--frequency=4000000")
|
||||
|
||||
set(OPENOCD_NRF5_SUBFAMILY "nrf52")
|
||||
|
||||
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
|
||||
include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
|
||||
include(${ZEPHYR_BASE}/boards/common/openocd-nrf5.board.cmake)
|
||||
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
|
||||
include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake)
|
||||
@@ -0,0 +1,14 @@
|
||||
# Seeed SenseCAP Solar Node (P1 / P1-Pro)
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# SX1262 on SPI2 (P0.04 CS, P0.03 DIO1, P0.28 RST, P0.29 BUSY, P0.05 RXEN)
|
||||
# Quectel L76K GNSS on UART0 9600 (P1.11/12), enable P1.05, reset P1.03
|
||||
# QSPI P25Q16H 2MB; battery AIN7 + P0.14 divider enable (active low)
|
||||
|
||||
CONFIG_ZEPHCORE_BOARD_NAME="SenseCAP Solar"
|
||||
|
||||
CONFIG_BT_DIS_MODEL_NUMBER_STR="Seeed SenseCAP Solar"
|
||||
|
||||
CONFIG_ZEPHCORE_SD_FWID=0x0123
|
||||
|
||||
CONFIG_ZEPHCORE_MAX_CONTACTS=510
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* SenseCAP Solar — ZephCore overlay
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* GPS aliases for ZephyrGPSManager. gnss-nmea-generic has no on-off-gpios,
|
||||
* so ZephyrGPSManager owns P1.05 (gps-enable alias) exclusively.
|
||||
*/
|
||||
|
||||
#include "../../common/qspi-ext.dtsi"
|
||||
|
||||
/ {
|
||||
gps_en: gps-enable {
|
||||
compatible = "gpio-leds";
|
||||
gps_enable_pin: gps_enable {
|
||||
gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;
|
||||
label = "GPS Enable";
|
||||
};
|
||||
};
|
||||
|
||||
gps_rst: gps-reset {
|
||||
compatible = "gpio-leds";
|
||||
gps_reset_pin: gps_reset {
|
||||
gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>;
|
||||
label = "GNSS Reset";
|
||||
};
|
||||
};
|
||||
|
||||
aliases {
|
||||
gps-enable = &gps_enable_pin;
|
||||
gps-reset = &gps_reset_pin;
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
# Copyright (c) 2025 ZephCore
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
board:
|
||||
name: sensecap_solar
|
||||
full_name: Seeed SenseCAP Solar Node (P1 / P1-Pro)
|
||||
vendor: seeed
|
||||
socs:
|
||||
- name: nrf52840
|
||||
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Seeed SenseCAP Solar Node (P1 / P1-Pro) — pin control
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* MeshCore variants/sensecap_solar variant.cpp:
|
||||
* - SPI2 (SX1262): SCK=P1.13, MOSI=P1.15, MISO=P1.14
|
||||
* - I2C0 (Grove): SDA=P0.09, SCL=P0.10
|
||||
* - UART0 (L76): TX=P1.11, RX=P1.12
|
||||
* - QSPI: SCK=P0.21, CS=P0.25, IO0-3=P0.20,24,22,23
|
||||
*/
|
||||
|
||||
&pinctrl {
|
||||
spi2_default: spi2_default {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(SPIM_SCK, 1, 13)>,
|
||||
<NRF_PSEL(SPIM_MOSI, 1, 15)>,
|
||||
<NRF_PSEL(SPIM_MISO, 1, 14)>;
|
||||
};
|
||||
};
|
||||
|
||||
spi2_sleep: spi2_sleep {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(SPIM_SCK, 1, 13)>,
|
||||
<NRF_PSEL(SPIM_MOSI, 1, 15)>,
|
||||
<NRF_PSEL(SPIM_MISO, 1, 14)>;
|
||||
low-power-enable;
|
||||
};
|
||||
};
|
||||
|
||||
i2c0_default: i2c0_default {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(TWIM_SDA, 0, 9)>,
|
||||
<NRF_PSEL(TWIM_SCL, 0, 10)>;
|
||||
};
|
||||
};
|
||||
|
||||
i2c0_sleep: i2c0_sleep {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(TWIM_SDA, 0, 9)>,
|
||||
<NRF_PSEL(TWIM_SCL, 0, 10)>;
|
||||
low-power-enable;
|
||||
};
|
||||
};
|
||||
|
||||
uart0_default: uart0_default {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(UART_TX, 1, 11)>,
|
||||
<NRF_PSEL(UART_RX, 1, 12)>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
uart0_sleep: uart0_sleep {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(UART_TX, 1, 11)>,
|
||||
<NRF_PSEL(UART_RX, 1, 12)>;
|
||||
low-power-enable;
|
||||
};
|
||||
};
|
||||
|
||||
qspi_default: qspi_default {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(QSPI_SCK, 0, 21)>,
|
||||
<NRF_PSEL(QSPI_IO0, 0, 20)>,
|
||||
<NRF_PSEL(QSPI_IO1, 0, 24)>,
|
||||
<NRF_PSEL(QSPI_IO2, 0, 22)>,
|
||||
<NRF_PSEL(QSPI_IO3, 0, 23)>,
|
||||
<NRF_PSEL(QSPI_CSN, 0, 25)>;
|
||||
};
|
||||
};
|
||||
|
||||
qspi_sleep: qspi_sleep {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(QSPI_SCK, 0, 21)>,
|
||||
<NRF_PSEL(QSPI_IO0, 0, 20)>,
|
||||
<NRF_PSEL(QSPI_IO1, 0, 24)>,
|
||||
<NRF_PSEL(QSPI_IO2, 0, 22)>,
|
||||
<NRF_PSEL(QSPI_IO3, 0, 23)>,
|
||||
<NRF_PSEL(QSPI_CSN, 0, 25)>;
|
||||
low-power-enable;
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,241 @@
|
||||
/*
|
||||
* Seeed SenseCAP Solar Node (P1 / P1-Pro) — nRF52840 + SX1262
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Pin map from MeshCore variants/sensecap_solar (variant.cpp, platformio.ini):
|
||||
* - SX1262: CS=P0.04, DIO1=P0.03, RST=P0.28, BUSY=P0.29, RXEN=P0.05,
|
||||
* SPI SCK/MOSI/MISO=P1.13/15/14, DIO2 RF switch, TCXO 1.8V
|
||||
* - Quectel L76K GNSS: UART0 9600, TX/RX=P1.11/12, enable=P1.05, reset=P1.03
|
||||
* - P25Q16H 2MB QSPI
|
||||
* - Battery: AIN7=P0.31, divider enable P0.14 (active low)
|
||||
* - Buttons P1.01, P1.07; LEDs white P0.15 (TX activity), blue P0.19
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
#include <nordic/nrf52840_qiaa.dtsi>
|
||||
#include <nordic/nrf52840_partition.dtsi>
|
||||
#include <zephyr/dt-bindings/lora/sx126x.h>
|
||||
#include <zephyr/dt-bindings/adc/nrf-saadc.h>
|
||||
#include <zephyr/dt-bindings/input/input-event-codes.h>
|
||||
#include "sensecap_solar_nrf52840-pinctrl.dtsi"
|
||||
|
||||
/delete-node/ &boot_partition;
|
||||
/delete-node/ &slot0_partition;
|
||||
/delete-node/ &slot1_partition;
|
||||
/delete-node/ &storage_partition;
|
||||
|
||||
/ {
|
||||
model = "Seeed SenseCAP Solar Node";
|
||||
compatible = "seeed,sensecap-solar";
|
||||
|
||||
chosen {
|
||||
zephyr,code-partition = &code_partition;
|
||||
zephyr,console = &cdc_acm_uart;
|
||||
zephyr,shell-uart = &cdc_acm_uart;
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
/* MeshCore P_LORA_TX_LED / LED_WHITE */
|
||||
white_led: led_0 {
|
||||
gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
|
||||
label = "White LED";
|
||||
};
|
||||
|
||||
blue_led: led_1 {
|
||||
gpios = <&gpio0 19 GPIO_ACTIVE_HIGH>;
|
||||
label = "Blue LED";
|
||||
};
|
||||
};
|
||||
|
||||
buttons: buttons {
|
||||
compatible = "gpio-keys";
|
||||
|
||||
user_button: button_0 {
|
||||
gpios = <&gpio1 1 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
|
||||
zephyr,code = <INPUT_KEY_0>;
|
||||
label = "User Button";
|
||||
};
|
||||
|
||||
aux_button: button_1 {
|
||||
gpios = <&gpio1 7 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
|
||||
zephyr,code = <INPUT_KEY_1>;
|
||||
label = "Aux Button";
|
||||
};
|
||||
};
|
||||
|
||||
user_btn_longpress {
|
||||
compatible = "zephyr,input-longpress";
|
||||
input = <&buttons>;
|
||||
input-codes = <INPUT_KEY_0>;
|
||||
short-codes = <INPUT_KEY_A>;
|
||||
long-codes = <INPUT_KEY_POWER>;
|
||||
long-delay-ms = <1000>;
|
||||
};
|
||||
|
||||
user_btn_multitap {
|
||||
compatible = "zephcore,input-multi-tap";
|
||||
input-codes = <INPUT_KEY_A>;
|
||||
tap-codes = <INPUT_KEY_1 INPUT_KEY_B INPUT_KEY_D INPUT_KEY_C INPUT_KEY_E>;
|
||||
tap-delay-ms = <400>;
|
||||
};
|
||||
|
||||
/* P0.14 LOW enables battery divider (MeshCore SenseCapSolarBoard) */
|
||||
vbat_enable: vbat-enable {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "vbat-enable";
|
||||
enable-gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
zephyr,user {
|
||||
io-channels = <&adc 7>;
|
||||
/* Zephyr: ADC_GAIN_1_6 + ADC_REF_INTERNAL = 3600mV full-scale; 1:3 voltage divider → 3600*3 */
|
||||
vbat-mv-multiplier = <10800>;
|
||||
};
|
||||
|
||||
aliases {
|
||||
led0 = &white_led;
|
||||
led1 = &blue_led;
|
||||
lora-tx-led = &white_led;
|
||||
sw0 = &user_button;
|
||||
lora0 = &lora;
|
||||
watchdog0 = &wdt0;
|
||||
};
|
||||
};
|
||||
|
||||
®0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
®1 {
|
||||
regulator-initial-mode = <NRF5X_REG_MODE_DCDC>;
|
||||
};
|
||||
|
||||
&adc {
|
||||
status = "okay";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
channel@7 {
|
||||
reg = <7>;
|
||||
zephyr,gain = "ADC_GAIN_1_6";
|
||||
zephyr,reference = "ADC_REF_INTERNAL";
|
||||
zephyr,acquisition-time = <ADC_ACQ_TIME(ADC_ACQ_TIME_MICROSECONDS, 10)>;
|
||||
zephyr,input-positive = <NRF_SAADC_AIN7>;
|
||||
zephyr,resolution = <12>;
|
||||
};
|
||||
};
|
||||
|
||||
&uicr {
|
||||
nfct-pins-as-gpios;
|
||||
};
|
||||
|
||||
&gpiote {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpio0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpio1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2c0 {
|
||||
compatible = "nordic,nrf-twim";
|
||||
status = "okay";
|
||||
clock-frequency = <I2C_BITRATE_FAST>;
|
||||
pinctrl-0 = <&i2c0_default>;
|
||||
pinctrl-1 = <&i2c0_sleep>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
|
||||
#include "../../common/sensors-i2c.dtsi"
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
compatible = "nordic,nrf-uarte";
|
||||
status = "okay";
|
||||
current-speed = <9600>;
|
||||
pinctrl-0 = <&uart0_default>;
|
||||
pinctrl-1 = <&uart0_sleep>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
|
||||
gnss: gnss {
|
||||
compatible = "gnss-nmea-generic";
|
||||
};
|
||||
};
|
||||
|
||||
&spi2 {
|
||||
compatible = "nordic,nrf-spim";
|
||||
status = "okay";
|
||||
cs-gpios = <&gpio0 4 GPIO_ACTIVE_LOW>;
|
||||
pinctrl-0 = <&spi2_default>;
|
||||
pinctrl-1 = <&spi2_sleep>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
|
||||
lora: lora@0 {
|
||||
compatible = "semtech,sx1262";
|
||||
reg = <0>;
|
||||
reset-gpios = <&gpio0 28 GPIO_ACTIVE_LOW>;
|
||||
busy-gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>;
|
||||
dio1-gpios = <&gpio0 3 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>;
|
||||
rx-enable-gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>;
|
||||
dio2-tx-enable;
|
||||
dio3-tcxo-voltage = <SX126X_DIO3_TCXO_1V8>;
|
||||
tcxo-power-startup-delay-ms = <5>;
|
||||
spi-max-frequency = <8000000>;
|
||||
rx-boosted;
|
||||
};
|
||||
};
|
||||
|
||||
&qspi {
|
||||
status = "okay";
|
||||
pinctrl-0 = <&qspi_default>;
|
||||
pinctrl-1 = <&qspi_sleep>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
|
||||
qspi_flash: qspi_flash@0 {
|
||||
compatible = "nordic,qspi-nor";
|
||||
reg = <0>;
|
||||
writeoc = "pp";
|
||||
readoc = "fastread";
|
||||
sck-frequency = <16000000>;
|
||||
jedec-id = [85 60 15];
|
||||
sfdp-bfp = [
|
||||
e5 20 f1 ff ff ff ff 01 44 eb 08 6b 08 3b 04 bb
|
||||
ee ff ff ff ff ff 00 ff ff ff 00 ff 0c 20 0f 52
|
||||
10 d8 00 ff
|
||||
];
|
||||
size = <16777216>;
|
||||
has-dpd;
|
||||
t-enter-dpd = <3000>;
|
||||
t-exit-dpd = <50000>;
|
||||
};
|
||||
};
|
||||
|
||||
zephyr_udc0: &usbd {
|
||||
compatible = "nordic,nrf-usbd";
|
||||
status = "okay";
|
||||
|
||||
cdc_acm_uart: cdc_acm_uart {
|
||||
compatible = "zephyr,cdc-acm-uart";
|
||||
};
|
||||
};
|
||||
|
||||
#include "../../common/nrf52_partitions_sdv7.dtsi"
|
||||
|
||||
&qspi_flash {
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
qspi_storage_partition: partition@0 {
|
||||
label = "qspi_storage";
|
||||
reg = <0x00000000 0x00200000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
#include "../../common/nrf52_wakeup.dtsi"
|
||||
@@ -0,0 +1,20 @@
|
||||
identifier: sensecap_solar/nrf52840
|
||||
name: Seeed SenseCAP Solar Node
|
||||
type: mcu
|
||||
arch: arm
|
||||
toolchain:
|
||||
- zephyr
|
||||
- gnuarmemb
|
||||
- xtools
|
||||
ram: 256
|
||||
flash: 1024
|
||||
supported:
|
||||
- adc
|
||||
- ble
|
||||
- gpio
|
||||
- i2c
|
||||
- spi
|
||||
- usb_device
|
||||
- qspi
|
||||
- lora
|
||||
vendor: seeed
|
||||
@@ -0,0 +1,10 @@
|
||||
# Copyright (c) 2025 ZephCore
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
CONFIG_ARM_MPU=y
|
||||
CONFIG_HW_STACK_PROTECTION=y
|
||||
CONFIG_GPIO=y
|
||||
CONFIG_SERIAL=y
|
||||
CONFIG_CONSOLE=y
|
||||
CONFIG_BUILD_OUTPUT_UF2=y
|
||||
CONFIG_USE_DT_CODE_PARTITION=y
|
||||
@@ -15,6 +15,7 @@ thinknode_m6
|
||||
rak_wismesh_tag
|
||||
ikoka_nano_30dbm
|
||||
promicro_lr2021
|
||||
sensecap_solar
|
||||
```
|
||||
|
||||
## ESP32
|
||||
|
||||
@@ -888,11 +888,7 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch
|
||||
strcpy(reply, "error");
|
||||
}
|
||||
} else if (memcmp(command, "gps", 3) == 0) {
|
||||
if (_callbacks->isGpsEnabled()) {
|
||||
strcpy(reply, "on");
|
||||
} else {
|
||||
strcpy(reply, "off");
|
||||
}
|
||||
_callbacks->formatGpsStatsReply(reply);
|
||||
} else if (memcmp(command, "powersaving", 11) == 0) {
|
||||
strcpy(reply, "Not implemented");
|
||||
} else if (memcmp(command, "log start", 9) == 0) {
|
||||
|
||||
@@ -65,6 +65,7 @@ public:
|
||||
virtual double getNodeLon() const { return 0.0; }
|
||||
virtual bool setGpsEnabled(bool enabled) { return false; }
|
||||
virtual bool isGpsEnabled() const { return false; }
|
||||
virtual void formatGpsStatsReply(char* reply) { strcpy(reply, "off"); }
|
||||
virtual int getNumSensorSettings() const { return 0; }
|
||||
virtual const char* getSensorSettingName(int idx) const { return nullptr; }
|
||||
virtual const char* getSensorSettingValue(int idx) const { return nullptr; }
|
||||
|
||||
Reference in New Issue
Block a user