target.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #pragma once
  2. #define RADIOLIB_STATIC_ONLY 1
  3. #include <RadioLib.h>
  4. #include <helpers/radiolib/RadioLibWrappers.h>
  5. #include <helpers/nrf52/TechoBoard.h>
  6. #include <helpers/radiolib/CustomSX1262Wrapper.h>
  7. #include <helpers/AutoDiscoverRTCClock.h>
  8. #include <helpers/SensorManager.h>
  9. #include <helpers/sensors/LocationProvider.h>
  10. #ifdef DISPLAY_CLASS
  11. #include <helpers/ui/GxEPDDisplay.h>
  12. #endif
  13. class TechoSensorManager : public SensorManager {
  14. bool gps_active = false;
  15. LocationProvider* _location;
  16. void start_gps();
  17. void stop_gps();
  18. public:
  19. TechoSensorManager(LocationProvider &location): _location(&location) { }
  20. bool begin() override;
  21. bool querySensors(uint8_t requester_permissions, CayenneLPP& telemetry) override;
  22. void loop() override;
  23. int getNumSettings() const override;
  24. const char* getSettingName(int i) const override;
  25. const char* getSettingValue(int i) const override;
  26. bool setSettingValue(const char* name, const char* value) override;
  27. };
  28. extern TechoBoard board;
  29. extern WRAPPER_CLASS radio_driver;
  30. extern AutoDiscoverRTCClock rtc_clock;
  31. extern TechoSensorManager sensors;
  32. #ifdef DISPLAY_CLASS
  33. extern DISPLAY_CLASS display;
  34. #endif
  35. bool radio_init();
  36. uint32_t radio_get_rng_seed();
  37. void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr);
  38. void radio_set_tx_power(uint8_t dbm);
  39. mesh::LocalIdentity radio_new_identity();