esp-idf/components/esp_hw_support/port/esp32s2/chip_info.c

41 wiersze
1.2 KiB
C

// Copyright 2013-2016 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <string.h>
#include "esp_chip_info.h"
#include "esp_efuse.h"
void esp_chip_info(esp_chip_info_t *out_info)
{
uint32_t pkg_ver = esp_efuse_get_pkg_ver();
memset(out_info, 0, sizeof(*out_info));
out_info->model = CHIP_ESP32S2;
out_info->cores = 1;
out_info->features = CHIP_FEATURE_WIFI_BGN;
switch (pkg_ver) {
case 0: // ESP32-S2
break;
case 1: // ESP32-S2FH16
// fallthrough
case 2: // ESP32-S2FH32
out_info->features |= CHIP_FEATURE_EMB_FLASH;
break;
default: // New package, features unknown
break;
}
}