NRF52Board.h 982 B

12345678910111213141516171819202122232425262728293031323334
  1. #pragma once
  2. #include <Arduino.h>
  3. #include <MeshCore.h>
  4. #if defined(NRF52_PLATFORM)
  5. class NRF52Board : public mesh::MainBoard {
  6. protected:
  7. uint8_t startup_reason;
  8. char *ota_name;
  9. public:
  10. NRF52Board(char *otaname) : ota_name(otaname) {}
  11. virtual void begin();
  12. virtual uint8_t getStartupReason() const override { return startup_reason; }
  13. virtual float getMCUTemperature() override;
  14. virtual void reboot() override { NVIC_SystemReset(); }
  15. virtual bool startOTAUpdate(const char *id, char reply[]) override;
  16. };
  17. /*
  18. * The NRF52 has an internal DC/DC regulator that allows increased efficiency
  19. * compared to the LDO regulator. For being able to use it, the module/board
  20. * needs to have the required inductors and and capacitors populated. If the
  21. * hardware requirements are met, this subclass can be used to enable the DC/DC
  22. * regulator.
  23. */
  24. class NRF52BoardDCDC : virtual public NRF52Board {
  25. public:
  26. NRF52BoardDCDC() {}
  27. virtual void begin() override;
  28. };
  29. #endif