target.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #pragma once
  2. #define RADIOLIB_STATIC_ONLY 1
  3. #include <RadioLib.h>
  4. #include <helpers/RadioLibWrappers.h>
  5. #include <helpers/stm32/STM32Board.h>
  6. #include <helpers/CustomSTM32WLxWrapper.h>
  7. #include <helpers/ArduinoHelpers.h>
  8. #include <helpers/SensorManager.h>
  9. #include <BME280I2C.h>
  10. #include <Wire.h>
  11. class WIOE5Board : public STM32Board {
  12. public:
  13. const char* getManufacturerName() const override {
  14. return "Seeed Wio E5 mini";
  15. }
  16. uint16_t getBattMilliVolts() override {
  17. analogReadResolution(12);
  18. uint32_t raw = analogRead(PIN_A3);
  19. return raw;
  20. }
  21. };
  22. class WIOE5SensorManager : public SensorManager {
  23. BME280I2C bme;
  24. bool has_bme = false;
  25. public:
  26. WIOE5SensorManager() {}
  27. bool begin() override;
  28. bool querySensors(uint8_t requester_permissions, CayenneLPP& telemetry) override;
  29. };
  30. extern WIOE5Board board;
  31. extern WRAPPER_CLASS radio_driver;
  32. extern VolatileRTCClock rtc_clock;
  33. extern WIOE5SensorManager sensors;
  34. bool radio_init();
  35. uint32_t radio_get_rng_seed();
  36. void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr);
  37. void radio_set_tx_power(uint8_t dbm);
  38. mesh::LocalIdentity radio_new_identity();