esp_chip_info.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. /**
  31. * @brief The structure represents information about the chip
  32. */
  33. typedef struct {
  34. esp_chip_model_t model; //!< chip model, one of esp_chip_model_t
  35. uint32_t features; //!< bit mask of CHIP_FEATURE_x feature flags
  36. uint8_t cores; //!< number of CPU cores
  37. uint8_t revision; //!< chip revision number
  38. } esp_chip_info_t;
  39. /**
  40. * @brief Fill an esp_chip_info_t structure with information about the chip
  41. * @param[out] out_info structure to be filled
  42. */
  43. void esp_chip_info(esp_chip_info_t* out_info);
  44. #if CONFIG_ESP32_ECO3_CACHE_LOCK_FIX
  45. /**
  46. * @brief Cache lock bug exists or not
  47. *
  48. * @return
  49. * - ture : bug exists
  50. * - false : bug not exists
  51. */
  52. bool soc_has_cache_lock_bug(void);
  53. #endif
  54. #ifdef __cplusplus
  55. }
  56. #endif