esp_chip_info.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #pragma once
  7. #include <stdbool.h>
  8. #include <stdint.h>
  9. #include "sdkconfig.h"
  10. #include "esp_bit_defs.h"
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. /**
  15. * @brief Chip models
  16. */
  17. typedef enum {
  18. CHIP_ESP32 = 1, //!< ESP32
  19. CHIP_ESP32S2 = 2, //!< ESP32-S2
  20. CHIP_ESP32S3 = 9, //!< ESP32-S3
  21. CHIP_ESP32C3 = 5, //!< ESP32-C3
  22. CHIP_ESP32H2 = 6, //!< ESP32-H2
  23. } esp_chip_model_t;
  24. /* Chip feature flags, used in esp_chip_info_t */
  25. #define CHIP_FEATURE_EMB_FLASH BIT(0) //!< Chip has embedded flash memory
  26. #define CHIP_FEATURE_WIFI_BGN BIT(1) //!< Chip has 2.4GHz WiFi
  27. #define CHIP_FEATURE_BLE BIT(4) //!< Chip has Bluetooth LE
  28. #define CHIP_FEATURE_BT BIT(5) //!< Chip has Bluetooth Classic
  29. #define CHIP_FEATURE_IEEE802154 BIT(6) //!< Chip has IEEE 802.15.4
  30. #define CHIP_FEATURE_EMB_PSRAM BIT(7) //!< Chip has embedded psram
  31. /**
  32. * @brief The structure represents information about the chip
  33. */
  34. typedef struct {
  35. esp_chip_model_t model; //!< chip model, one of esp_chip_model_t
  36. uint32_t features; //!< bit mask of CHIP_FEATURE_x feature flags
  37. uint8_t cores; //!< number of CPU cores
  38. uint8_t revision; //!< chip revision number
  39. } esp_chip_info_t;
  40. /**
  41. * @brief Fill an esp_chip_info_t structure with information about the chip
  42. * @param[out] out_info structure to be filled
  43. */
  44. void esp_chip_info(esp_chip_info_t* out_info);
  45. #if CONFIG_ESP32_ECO3_CACHE_LOCK_FIX
  46. /**
  47. * @brief Cache lock bug exists or not
  48. *
  49. * @return
  50. * - ture : bug exists
  51. * - false : bug not exists
  52. */
  53. bool soc_has_cache_lock_bug(void);
  54. #endif
  55. #ifdef __cplusplus
  56. }
  57. #endif