| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- #pragma once
- #define RADIOLIB_STATIC_ONLY 1
- #include <RadioLib.h>
- #include <helpers/radiolib/RadioLibWrappers.h>
- #include <T114Board.h>
- #include <helpers/radiolib/CustomSX1262Wrapper.h>
- #include <helpers/AutoDiscoverRTCClock.h>
- #include <helpers/SensorManager.h>
- #include <helpers/sensors/LocationProvider.h>
- #ifdef DISPLAY_CLASS
- #include <helpers/ui/MomentaryButton.h>
- #ifdef HELTEC_T114_WITH_DISPLAY
- #include <helpers/ui/ST7789Display.h>
- #else
- #include "helpers/ui/NullDisplayDriver.h"
- #endif
- #endif
- class T114SensorManager : public SensorManager {
- bool gps_active = false;
- bool gps_detected = false;
- LocationProvider* _location;
- void start_gps();
- void stop_gps();
- public:
- T114SensorManager(LocationProvider &location): _location(&location) { }
- bool begin() override;
- bool querySensors(uint8_t requester_permissions, CayenneLPP& telemetry) override;
- void loop() override;
- LocationProvider* getLocationProvider() override { return gps_detected ? _location : NULL; }
- int getNumSettings() const override;
- const char* getSettingName(int i) const override;
- const char* getSettingValue(int i) const override;
- bool setSettingValue(const char* name, const char* value) override;
- };
- extern T114Board board;
- extern WRAPPER_CLASS radio_driver;
- extern AutoDiscoverRTCClock rtc_clock;
- extern T114SensorManager sensors;
- #ifdef DISPLAY_CLASS
- extern DISPLAY_CLASS display;
- extern MomentaryButton user_btn;
- #endif
- bool radio_init();
- uint32_t radio_get_rng_seed();
- void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr);
- void radio_set_tx_power(uint8_t dbm);
- mesh::LocalIdentity radio_new_identity();
|