target.h 1.6 KB

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