esp_sys.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #pragma once
  2. #include "../../include/defines.h"
  3. #ifdef DEBUG_ENABLE_SYSINFO
  4. #ifndef ESP_SYS_H
  5. #define ESP_SYS_H
  6. #include <string>
  7. // Device libraries (ESP-IDF)
  8. #include <esp_system.h>
  9. #include <esp_spi_flash.h>
  10. #include <esp_heap_caps.h>
  11. void Restart();
  12. char *GetChipModel();
  13. uint8_t GetChipCoreCount();
  14. uint16_t GetChipRevision();
  15. uint32_t GetChipfeatures();
  16. uint32_t GetFreeHeap();
  17. uint32_t GetLeastHeapFreeSinceBoot();
  18. /*
  19. bool CHIP_FEATURE_EMB_FLASH; //Chip has embedded flash memory.
  20. bool CHIP_FEATURE_WIFI_BGN; //Chip has 2.4GHz WiFi.
  21. bool CHIP_FEATURE_BLE; //Chip has Bluetooth LE.
  22. bool CHIP_FEATURE_BT; //Chip has Bluetooth Classic.
  23. bool CHIP_FEATURE_IEEE802154; //Chip has IEEE 802.15.4 (Zigbee/Thread)
  24. bool CHIP_FEATURE_EMB_PSRAM; //Chip has embedded psram.
  25. */
  26. std::string get_device_info();
  27. size_t getFreeMemoryInternal();
  28. size_t getFreeMemorySPIRAM();
  29. size_t getLargestFreeBlockInternal();
  30. size_t getLargestFreeBlockSPIRAM();
  31. size_t getMinEverFreeMemInternal();
  32. size_t getMinEverFreeMemSPIRAM();
  33. #endif //ESP_SYS_H
  34. #endif // DEBUG_ENABLE_SYSINFO