1 /*
2  * SPDX-FileCopyrightText: 2013-2021 Espressif Systems (Shanghai) CO LTD
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include <string.h>
8 #include "esp_chip_info.h"
9 #include "hal/efuse_ll.h"
10 #include "hal/efuse_hal.h"
11 
esp_chip_info(esp_chip_info_t * out_info)12 void esp_chip_info(esp_chip_info_t *out_info)
13 {
14     uint32_t pkg_ver = efuse_ll_get_chip_ver_pkg();
15 
16     memset(out_info, 0, sizeof(*out_info));
17 
18     out_info->model = CHIP_ESP32S2;
19     out_info->revision = efuse_hal_chip_revision();
20     out_info->cores = 1;
21     out_info->features = CHIP_FEATURE_WIFI_BGN;
22 
23     switch (pkg_ver) {
24     case 0: // ESP32-S2
25         break;
26     case 1: // ESP32-S2FH16
27         // fallthrough
28     case 2: // ESP32-S2FH32
29         out_info->features |= CHIP_FEATURE_EMB_FLASH;
30         break;
31     default: // New package, features unknown
32         break;
33     }
34 }
35