Skip to content

Commit

Permalink
Merge branch 'master' into tft-gui-work
Browse files Browse the repository at this point in the history
  • Loading branch information
mverch67 authored Jun 3, 2024
2 parents 4ee414b + b43c7c0 commit 30ce5a4
Show file tree
Hide file tree
Showing 20 changed files with 944 additions and 9 deletions.
58 changes: 58 additions & 0 deletions boards/wio-sdk-wm1110.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"build": {
"arduino": {
"ldscript": "nrf52840_s140_v6.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": "WIO-BOOT",
"mcu": "nrf52840",
"variant": "Seeed_WIO_WM1110",
"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"],
"name": "Seeed WIO WM1110",
"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/Wio-WM1110-Dev-Kit-p-5677.html",
"vendor": "Seeed Studio"
}
58 changes: 58 additions & 0 deletions boards/wio-tracker-wm1110.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"build": {
"arduino": {
"ldscript": "nrf52840_s140_v6.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": "WIO-BOOT",
"mcu": "nrf52840",
"variant": "Seeed_WIO_WM1110",
"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"],
"name": "Seeed WIO WM1110",
"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/Wio-WM1110-Dev-Kit-p-5677.html",
"vendor": "Seeed Studio"
}
2 changes: 1 addition & 1 deletion protobufs
13 changes: 12 additions & 1 deletion src/detect/LoRaRadioType.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
#pragma once

enum LoRaRadioType { NO_RADIO, STM32WLx_RADIO, SIM_RADIO, RF95_RADIO, SX1262_RADIO, SX1268_RADIO, LLCC68_RADIO, SX1280_RADIO };
enum LoRaRadioType {
NO_RADIO,
STM32WLx_RADIO,
SIM_RADIO,
RF95_RADIO,
SX1262_RADIO,
SX1268_RADIO,
LLCC68_RADIO,
SX1280_RADIO,
LR1110_RADIO,
LR1120_RADIO
};

extern LoRaRadioType radioType;
28 changes: 28 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ NRF52Bluetooth *nrf52Bluetooth;
#endif

#include "LLCC68Interface.h"
#include "LR1110Interface.h"
#include "LR1120Interface.h"
#include "RF95Interface.h"
#include "SX1262Interface.h"
#include "SX1268Interface.h"
Expand Down Expand Up @@ -981,6 +983,32 @@ void setup()
}
#endif

#if defined(USE_LR1110)
if (!rIf) {
rIf = new LR1110Interface(RadioLibHAL, LR1110_SPI_NSS_PIN, LR1110_IRQ_PIN, LR1110_NRESER_PIN, LR1110_BUSY_PIN);
if (!rIf->init()) {
LOG_WARN("Failed to find LR1110 radio\n");
delete rIf;
rIf = NULL;
} else {
LOG_INFO("LR1110 Radio init succeeded, using LR1110 radio\n");
}
}
#endif

#if defined(USE_LR1120)
if (!rIf) {
rIf = new LR1120Interface(RadioLibHAL, LR1120_SPI_NSS_PIN, LR1120_IRQ_PIN, LR1120_NRESER_PIN, LR1120_BUSY_PIN);
if (!rIf->init()) {
LOG_WARN("Failed to find LR1120 radio\n");
delete rIf;
rIf = NULL;
} else {
LOG_INFO("LR1120 Radio init succeeded, using LR1120 radio\n");
}
}
#endif

#if defined(USE_SX1280)
if (!rIf) {
rIf = new SX1280Interface(RadioLibHAL, SX128X_CS, SX128X_DIO1, SX128X_RESET, SX128X_BUSY);
Expand Down
4 changes: 4 additions & 0 deletions src/mesh/InterfacesTemplates.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "LR11x0Interface.cpp"
#include "LR11x0Interface.h"
#include "SX126xInterface.cpp"
#include "SX126xInterface.h"
#include "SX128xInterface.cpp"
Expand All @@ -10,6 +12,8 @@ template class SX126xInterface<SX1262>;
template class SX126xInterface<SX1268>;
template class SX126xInterface<LLCC68>;
template class SX128xInterface<SX1280>;
template class LR11x0Interface<LR1110>;
template class LR11x0Interface<LR1120>;
#ifdef ARCH_STM32WL
template class SX126xInterface<STM32WLx>;
#endif
Expand Down
9 changes: 9 additions & 0 deletions src/mesh/LR1110Interface.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "LR1110Interface.h"
#include "configuration.h"
#include "error.h"

LR1110Interface::LR1110Interface(LockingArduinoHal *hal, RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst,
RADIOLIB_PIN_TYPE busy)
: LR11x0Interface(hal, cs, irq, rst, busy)
{
}
13 changes: 13 additions & 0 deletions src/mesh/LR1110Interface.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#pragma once

#include "LR11x0Interface.h"

/**
* Our adapter for LR1110 radios
*/
class LR1110Interface : public LR11x0Interface<LR1110>
{
public:
LR1110Interface(LockingArduinoHal *hal, RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst,
RADIOLIB_PIN_TYPE busy);
};
9 changes: 9 additions & 0 deletions src/mesh/LR1120Interface.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "LR1120Interface.h"
#include "configuration.h"
#include "error.h"

LR1120Interface::LR1120Interface(LockingArduinoHal *hal, RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst,
RADIOLIB_PIN_TYPE busy)
: LR11x0Interface(hal, cs, irq, rst, busy)
{
}
13 changes: 13 additions & 0 deletions src/mesh/LR1120Interface.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#pragma once

#include "LR11x0Interface.h"

/**
* Our adapter for LR1120 wideband radios
*/
class LR1120Interface : public LR11x0Interface<LR1120>
{
public:
LR1120Interface(LockingArduinoHal *hal, RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst,
RADIOLIB_PIN_TYPE busy);
};
Loading

0 comments on commit 30ce5a4

Please sign in to comment.