target.h 1.5 KB

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