2026-09-24 21:53:18 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#define RADIOLIB_STATIC_ONLY 1
|
|
|
|
|
#include <RadioLib.h>
|
|
|
|
|
#include <helpers/radiolib/RadioLibWrappers.h>
|
|
|
|
|
#include <helpers/radiolib/CustomSX1262Wrapper.h>
|
|
|
|
|
#include "WioTrackerL2Board.h"
|
|
|
|
|
#include <helpers/AutoDiscoverRTCClock.h>
|
|
|
|
|
#include <helpers/SensorManager.h>
|
|
|
|
|
#include <helpers/sensors/EnvironmentSensorManager.h>
|
|
|
|
|
#include <helpers/sensors/MicroNMEALocationProvider.h>
|
|
|
|
|
#ifdef DISPLAY_CLASS
|
|
|
|
|
#include "WioTrackerL2Display.h"
|
|
|
|
|
#include <helpers/ui/MomentaryButton.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
2026-09-27 00:12:08 +02:00
|
|
|
// The L76K's power and reset lines are on the IO expander, out of the NMEA
|
|
|
|
|
// provider's reach: begin() / stop() / reset() drive them here, so GPS off
|
2026-09-27 13:54:25 +02:00
|
|
|
// (Settings, duty cycling) really powers the receiver down. begin() on a
|
|
|
|
|
// running receiver does nothing: a reset there (the app setting "gps" again)
|
|
|
|
|
// threw away the acquisition in progress.
|
2026-09-27 00:12:08 +02:00
|
|
|
class L2GpsProvider : public MicroNMEALocationProvider {
|
|
|
|
|
bool _uart_off = false;
|
2026-09-27 13:54:25 +02:00
|
|
|
bool _started = false; // begin() ran (the boot one does the reset)
|
|
|
|
|
bool _cfg_pending = false; // constellations to set once the module talks
|
|
|
|
|
uint32_t _cfg_rx = 0;
|
2026-09-27 00:12:08 +02:00
|
|
|
public:
|
|
|
|
|
using MicroNMEALocationProvider::MicroNMEALocationProvider;
|
|
|
|
|
void begin() override;
|
|
|
|
|
void stop() override;
|
|
|
|
|
void reset() override;
|
|
|
|
|
bool isEnabled() override;
|
2026-09-27 13:54:25 +02:00
|
|
|
void loop() override;
|
2026-09-27 00:12:08 +02:00
|
|
|
};
|
|
|
|
|
|
2026-09-24 21:53:18 +02:00
|
|
|
extern WioTrackerL2Board board;
|
|
|
|
|
extern WRAPPER_CLASS radio_driver;
|
|
|
|
|
extern AutoDiscoverRTCClock rtc_clock;
|
|
|
|
|
extern EnvironmentSensorManager sensors;
|
2026-09-27 00:12:08 +02:00
|
|
|
extern L2GpsProvider gps;
|
2026-09-24 21:53:18 +02:00
|
|
|
|
|
|
|
|
#ifdef DISPLAY_CLASS
|
|
|
|
|
extern DISPLAY_CLASS display;
|
|
|
|
|
extern MomentaryButton user_btn;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
bool radio_init();
|
|
|
|
|
mesh::LocalIdentity radio_new_identity();
|