Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions variants/t1000-e/T1000eBoard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@

void T1000eBoard::begin() {
NRF52BoardDCDC::begin();
btn_prev_state = HIGH;

#ifdef BUTTON_PIN
pinMode(BATTERY_PIN, INPUT);
pinMode(BUTTON_PIN, INPUT);
pinMode(LED_PIN, OUTPUT);
#endif

Expand All @@ -20,4 +18,4 @@ void T1000eBoard::begin() {
Wire.begin();

delay(10); // give sx1262 some time to power up
}
}
12 changes: 0 additions & 12 deletions variants/t1000-e/T1000eBoard.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

class T1000eBoard : public NRF52BoardDCDC {
protected:
uint8_t btn_prev_state;

public:
T1000eBoard() : NRF52Board("T1000E_OTA") {}
Expand Down Expand Up @@ -38,17 +37,6 @@ class T1000eBoard : public NRF52BoardDCDC {
return "Seeed Tracker T1000-E";
}

int buttonStateChanged() {
#ifdef BUTTON_PIN
uint8_t v = digitalRead(BUTTON_PIN);
if (v != btn_prev_state) {
btn_prev_state = v;
return (v == LOW) ? 1 : -1;
}
#endif
return 0;
}

void powerOff() override {
#ifdef HAS_GPS
digitalWrite(GPS_VRTC_EN, LOW);
Expand Down
12 changes: 6 additions & 6 deletions variants/t1000-e/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ upload_protocol = nrfutil
[env:t1000e_repeater]
extends = t1000-e
build_flags = ${t1000-e.build_flags}
-I examples/companion_radio/ui-orig
-I examples/companion_radio/ui-new
-D ADVERT_NAME='"t1000-e Repeater"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
Expand All @@ -53,7 +53,7 @@ lib_deps = ${t1000-e.lib_deps}
[env:t1000e_room_server]
extends = t1000-e
build_flags = ${t1000-e.build_flags}
-I examples/companion_radio/ui-orig
-I examples/companion_radio/ui-new
-D ADVERT_NAME='"t1000-e Room"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
Expand All @@ -72,7 +72,7 @@ extends = t1000-e
board_build.ldscript = boards/nrf52840_s140_v7_extrafs.ld
board_upload.maximum_size = 708608
build_flags = ${t1000-e.build_flags}
-I examples/companion_radio/ui-orig
-I examples/companion_radio/ui-new
-D MAX_CONTACTS=350
-D MAX_GROUP_CHANNELS=40
; -D MESH_PACKET_LOGGING=1
Expand All @@ -84,7 +84,7 @@ build_flags = ${t1000-e.build_flags}
build_src_filter = ${t1000-e.build_src_filter}
+<helpers/ui/buzzer.cpp>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-orig/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
lib_deps = ${t1000-e.lib_deps}
densaugeo/base64 @ ~1.4.0
stevemarple/MicroNMEA @ ^2.0.6
Expand All @@ -95,7 +95,7 @@ extends = t1000-e
board_build.ldscript = boards/nrf52840_s140_v7_extrafs.ld
board_upload.maximum_size = 708608
build_flags = ${t1000-e.build_flags}
-I examples/companion_radio/ui-orig
-I examples/companion_radio/ui-new
-D MAX_CONTACTS=350
-D MAX_GROUP_CHANNELS=40
-D BLE_PIN_CODE=123456
Expand All @@ -112,7 +112,7 @@ build_src_filter = ${t1000-e.build_src_filter}
+<helpers/nrf52/SerialBLEInterface.cpp>
+<helpers/ui/buzzer.cpp>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-orig/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
lib_deps = ${t1000-e.lib_deps}
densaugeo/base64 @ ~1.4.0
stevemarple/MicroNMEA @ ^2.0.6
Expand Down
2 changes: 1 addition & 1 deletion variants/t1000-e/t1000e_sensors.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
// see : https://github.com/Seeed-Studio/Seeed-Tracker-T1000-E-for-LoRaWAN-dev-board

extern uint32_t t1000e_get_light();
extern float t1000e_get_temperature();
extern float t1000e_get_temperature();
26 changes: 17 additions & 9 deletions variants/t1000-e/target.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ T1000SensorManager sensors = T1000SensorManager(nmea);
NullDisplayDriver display;
#endif

#ifdef PIN_USER_BTN
MomentaryButton user_btn(PIN_USER_BTN,
/*long_press_mills=*/1000,
/*reverse=*/(USER_BTN_PRESSED==LOW),
/*pulldownup=*/false,
/*multiclick=*/true);
#endif

#ifndef LORA_CR
#define LORA_CR 5
#endif
Expand All @@ -26,26 +34,26 @@ static const uint32_t rfswitch_dios[Module::RFSWITCH_MAX_PINS] = {
RADIOLIB_LR11X0_DIO5,
RADIOLIB_LR11X0_DIO6,
RADIOLIB_LR11X0_DIO7,
RADIOLIB_LR11X0_DIO8,
RADIOLIB_LR11X0_DIO8,
RADIOLIB_NC
};

static const Module::RfSwitchMode_t rfswitch_table[] = {
// mode DIO5 DIO6 DIO7 DIO8
{ LR11x0::MODE_STBY, {LOW, LOW, LOW, LOW }},
{ LR11x0::MODE_STBY, {LOW, LOW, LOW, LOW }},
{ LR11x0::MODE_RX, {HIGH, LOW, LOW, HIGH }},
{ LR11x0::MODE_TX, {HIGH, HIGH, LOW, HIGH }},
{ LR11x0::MODE_TX_HP, {LOW, HIGH, LOW, HIGH }},
{ LR11x0::MODE_TX_HF, {LOW, LOW, LOW, LOW }},
{ LR11x0::MODE_TX_HF, {LOW, LOW, LOW, LOW }},
{ LR11x0::MODE_GNSS, {LOW, LOW, HIGH, LOW }},
{ LR11x0::MODE_WIFI, {LOW, LOW, LOW, LOW }},
{ LR11x0::MODE_WIFI, {LOW, LOW, LOW, LOW }},
END_OF_MODE_TABLE,
};
#endif

bool radio_init() {
//rtc_clock.begin(Wire);

#ifdef LR11X0_DIO3_TCXO_VOLTAGE
float tcxo = LR11X0_DIO3_TCXO_VOLTAGE;
#else
Expand All @@ -60,7 +68,7 @@ bool radio_init() {
Serial.println(status);
return false; // fail
}

radio.setCRC(2);
radio.explicitHeader();

Expand Down Expand Up @@ -97,20 +105,20 @@ mesh::LocalIdentity radio_new_identity() {
void T1000SensorManager::start_gps() {
gps_active = true;
//_nmea->begin();
// this init sequence should be better
// this init sequence should be better
// comes from seeed examples and deals with all gps pins
pinMode(GPS_EN, OUTPUT);
digitalWrite(GPS_EN, HIGH);
delay(10);
pinMode(GPS_VRTC_EN, OUTPUT);
digitalWrite(GPS_VRTC_EN, HIGH);
delay(10);

pinMode(GPS_RESET, OUTPUT);
digitalWrite(GPS_RESET, HIGH);
delay(10);
digitalWrite(GPS_RESET, LOW);

pinMode(GPS_SLEEP_INT, OUTPUT);
digitalWrite(GPS_SLEEP_INT, HIGH);
pinMode(GPS_RTC_INT, OUTPUT);
Expand Down
7 changes: 7 additions & 0 deletions variants/t1000-e/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
#ifdef DISPLAY_CLASS
#include "NullDisplayDriver.h"
#endif
#ifdef PIN_USER_BTN
#include <helpers/ui/MomentaryButton.h>
#endif

class T1000SensorManager: public SensorManager {
bool gps_active = false;
Expand All @@ -35,6 +38,10 @@ class T1000SensorManager: public SensorManager {
extern NullDisplayDriver display;
#endif

#ifdef PIN_USER_BTN
extern MomentaryButton user_btn;
#endif

extern T1000eBoard board;
extern WRAPPER_CLASS radio_driver;
extern VolatileRTCClock rtc_clock;
Expand Down
4 changes: 2 additions & 2 deletions variants/t1000-e/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,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

Expand Down Expand Up @@ -133,4 +133,4 @@
// Buzzer

#define BUZZER_EN (37) // P1.5
#define BUZZER_PIN (25) // P0.25
#define BUZZER_PIN (25) // P0.25