2021-08-05 10:30:10 -04:00
|
|
|
/*
|
2022-01-17 21:32:56 -05:00
|
|
|
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
2021-08-05 10:30:10 -04:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
2021-02-26 02:16:08 -05:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "sdkconfig.h"
|
|
|
|
#include "esp_bit_defs.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Chip models
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
CHIP_ESP32 = 1, //!< ESP32
|
|
|
|
CHIP_ESP32S2 = 2, //!< ESP32-S2
|
2021-09-13 09:16:45 -04:00
|
|
|
CHIP_ESP32S3 = 9, //!< ESP32-S3
|
2021-02-26 02:16:08 -05:00
|
|
|
CHIP_ESP32C3 = 5, //!< ESP32-C3
|
2022-10-19 03:57:24 -04:00
|
|
|
CHIP_ESP32H4 = 6, //!< ESP32-H4
|
2022-01-17 21:32:56 -05:00
|
|
|
CHIP_ESP32C2 = 12, //!< ESP32-C2
|
2022-07-12 07:46:23 -04:00
|
|
|
CHIP_ESP32C6 = 13, //!< ESP32-C6
|
2022-12-28 22:01:13 -05:00
|
|
|
CHIP_ESP32H2 = 16, //!< ESP32-H2
|
2022-12-02 01:54:27 -05:00
|
|
|
CHIP_POSIX_LINUX = 999, //!< The code is running on POSIX/Linux simulator
|
2021-02-26 02:16:08 -05:00
|
|
|
} esp_chip_model_t;
|
|
|
|
|
|
|
|
/* Chip feature flags, used in esp_chip_info_t */
|
|
|
|
#define CHIP_FEATURE_EMB_FLASH BIT(0) //!< Chip has embedded flash memory
|
|
|
|
#define CHIP_FEATURE_WIFI_BGN BIT(1) //!< Chip has 2.4GHz WiFi
|
|
|
|
#define CHIP_FEATURE_BLE BIT(4) //!< Chip has Bluetooth LE
|
|
|
|
#define CHIP_FEATURE_BT BIT(5) //!< Chip has Bluetooth Classic
|
2021-06-10 03:22:43 -04:00
|
|
|
#define CHIP_FEATURE_IEEE802154 BIT(6) //!< Chip has IEEE 802.15.4
|
2021-11-09 23:50:12 -05:00
|
|
|
#define CHIP_FEATURE_EMB_PSRAM BIT(7) //!< Chip has embedded psram
|
2021-02-26 02:16:08 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief The structure represents information about the chip
|
|
|
|
*/
|
|
|
|
typedef struct {
|
|
|
|
esp_chip_model_t model; //!< chip model, one of esp_chip_model_t
|
|
|
|
uint32_t features; //!< bit mask of CHIP_FEATURE_x feature flags
|
2022-05-25 15:16:15 -04:00
|
|
|
uint16_t revision; //!< chip revision number (in format MXX; where M - wafer major version, XX - wafer minor version)
|
2021-02-26 02:16:08 -05:00
|
|
|
uint8_t cores; //!< number of CPU cores
|
|
|
|
} esp_chip_info_t;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Fill an esp_chip_info_t structure with information about the chip
|
|
|
|
* @param[out] out_info structure to be filled
|
|
|
|
*/
|
|
|
|
void esp_chip_info(esp_chip_info_t* out_info);
|
|
|
|
|
|
|
|
#if CONFIG_ESP32_ECO3_CACHE_LOCK_FIX
|
|
|
|
/**
|
|
|
|
* @brief Cache lock bug exists or not
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* - ture : bug exists
|
|
|
|
* - false : bug not exists
|
|
|
|
*/
|
|
|
|
bool soc_has_cache_lock_bug(void);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|