mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
esp_phy: rename esp_phy component prefix
This commit is contained in:
parent
c898810991
commit
2a09234957
@ -16,13 +16,13 @@ endif()
|
||||
|
||||
idf_build_get_property(build_dir BUILD_DIR)
|
||||
|
||||
if(CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN)
|
||||
if(CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN)
|
||||
if(NOT EXISTS "${build_dir}/phy_multiple_init_data.bin")
|
||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/${idf_target}/phy_multiple_init_data.bin DESTINATION "${build_dir}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CONFIG_ESP32_MULTIPLE_PHY_DATA_BIN_EMBEDDED)
|
||||
if(CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED)
|
||||
idf_component_register(SRCS "${srcs}"
|
||||
INCLUDE_DIRS "include" "${idf_target}/include"
|
||||
PRIV_REQUIRES nvs_flash
|
||||
@ -63,13 +63,13 @@ if(link_binary_libs)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION)
|
||||
if(CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION)
|
||||
idf_component_get_property(esp_common_dir esp_common COMPONENT_DIR)
|
||||
partition_table_get_partition_info(phy_partition_offset "--partition-type data --partition-subtype phy" "offset")
|
||||
|
||||
if(CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN)
|
||||
if(CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN)
|
||||
set(phy_init_data_bin "${build_dir}/phy_multiple_init_data.bin")
|
||||
if(CONFIG_ESP32_MULTIPLE_PHY_DATA_BIN_EMBEDDED)
|
||||
if(CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED)
|
||||
set(COMPONENT_EMBED_FILES "${build_dir}/phy_multiple_init_data.bin")
|
||||
endif()
|
||||
else()
|
||||
|
@ -1,6 +1,6 @@
|
||||
menu "PHY"
|
||||
|
||||
config ESP32_PHY_CALIBRATION_AND_DATA_STORAGE
|
||||
config ESP_PHY_CALIBRATION_AND_DATA_STORAGE
|
||||
bool "Store phy calibration data in NVS"
|
||||
default y
|
||||
help
|
||||
@ -15,7 +15,7 @@ menu "PHY"
|
||||
2.Because of your board design, each time when you do calibration, the result are too unstable.
|
||||
If unsure, choose 'y'.
|
||||
|
||||
menuconfig ESP32_PHY_INIT_DATA_IN_PARTITION
|
||||
menuconfig ESP_PHY_INIT_DATA_IN_PARTITION
|
||||
bool "Use a partition to store PHY init data"
|
||||
default n
|
||||
help
|
||||
@ -31,20 +31,20 @@ menu "PHY"
|
||||
|
||||
If unsure, choose 'n'.
|
||||
|
||||
config ESP32_PHY_DEFAULT_INIT_IF_INVALID
|
||||
config ESP_PHY_DEFAULT_INIT_IF_INVALID
|
||||
bool "Reset default PHY init data if invalid"
|
||||
default n
|
||||
depends on ESP32_PHY_INIT_DATA_IN_PARTITION
|
||||
depends on ESP_PHY_INIT_DATA_IN_PARTITION
|
||||
help
|
||||
If enabled, PHY init data will be restored to default if
|
||||
it cannot be verified successfully to avoid endless bootloops.
|
||||
|
||||
If unsure, choose 'n'.
|
||||
|
||||
if ESP32_PHY_INIT_DATA_IN_PARTITION
|
||||
config ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN
|
||||
if ESP_PHY_INIT_DATA_IN_PARTITION
|
||||
config ESP_PHY_MULTIPLE_INIT_DATA_BIN
|
||||
bool "Support multiple PHY init data bin"
|
||||
depends on ESP32_PHY_INIT_DATA_IN_PARTITION
|
||||
depends on ESP_PHY_INIT_DATA_IN_PARTITION
|
||||
default n
|
||||
help
|
||||
If enabled, the corresponding PHY init data type can be automatically switched
|
||||
@ -57,17 +57,17 @@ menu "PHY"
|
||||
3. Country configured by API esp_wifi_set_country()
|
||||
and the parameter policy is WIFI_COUNTRY_POLICY_AUTO.
|
||||
|
||||
config ESP32_MULTIPLE_PHY_DATA_BIN_EMBEDDED
|
||||
config ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED
|
||||
bool "Support embedded multiple phy init data bin to app bin"
|
||||
depends on ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN
|
||||
depends on ESP_PHY_MULTIPLE_INIT_DATA_BIN
|
||||
default n
|
||||
help
|
||||
If enabled, multiple phy init data bin will embedded into app bin
|
||||
If not enabled, multiple phy init data bin will still leave alone, and need to be flashed by users.
|
||||
|
||||
config ESP32_PHY_INIT_DATA_ERROR
|
||||
config ESP_PHY_INIT_DATA_ERROR
|
||||
bool "Terminate operation when PHY init data error"
|
||||
depends on ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN
|
||||
depends on ESP_PHY_MULTIPLE_INIT_DATA_BIN
|
||||
default n
|
||||
help
|
||||
If enabled, when an error occurs while the PHY init data is updated,
|
||||
@ -75,7 +75,7 @@ menu "PHY"
|
||||
If not enabled, the PHY init data will not be updated when an error occurs.
|
||||
endif
|
||||
|
||||
config ESP32_PHY_MAX_WIFI_TX_POWER
|
||||
config ESP_PHY_MAX_WIFI_TX_POWER
|
||||
int "Max WiFi TX power (dBm)"
|
||||
range 10 20
|
||||
default 20
|
||||
@ -83,11 +83,11 @@ menu "PHY"
|
||||
Set maximum transmit power for WiFi radio. Actual transmit power for high
|
||||
data rates may be lower than this setting.
|
||||
|
||||
config ESP32_PHY_MAX_TX_POWER
|
||||
config ESP_PHY_MAX_TX_POWER
|
||||
int
|
||||
default ESP32_PHY_MAX_WIFI_TX_POWER
|
||||
default ESP_PHY_MAX_WIFI_TX_POWER
|
||||
|
||||
config ESP32_PHY_MAC_BB_PD
|
||||
config ESP_PHY_MAC_BB_PD
|
||||
bool "Power down MAC and baseband of Wi-Fi and Bluetooth when PHY is disabled"
|
||||
depends on ((IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3) && FREERTOS_USE_TICKLESS_IDLE)
|
||||
default n
|
||||
@ -97,7 +97,7 @@ menu "PHY"
|
||||
by a small amount but increases RAM use by approximately 4 KB(Wi-Fi only),
|
||||
2 KB(Bluetooth only) or 5.3 KB(Wi-Fi + Bluetooth).
|
||||
|
||||
config ESP32_REDUCE_PHY_TX_POWER
|
||||
config ESP_PHY_REDUCE_TX_POWER
|
||||
bool "Reduce PHY TX power when brownout reset"
|
||||
depends on ESP32_BROWNOUT_DET
|
||||
default y
|
||||
|
@ -1,8 +1,8 @@
|
||||
ifdef CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION
|
||||
ifdef CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION
|
||||
|
||||
ESP_PHY_COMPONENT_PATH := $(COMPONENT_PATH)
|
||||
|
||||
ifdef CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN
|
||||
ifdef CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN
|
||||
PHY_INIT_DATA_BIN = $(ESP_PHY_COMPONENT_PATH)/$(IDF_TARGET)/phy_multiple_init_data.bin
|
||||
else
|
||||
PHY_INIT_DATA_OBJ = $(BUILD_DIR_BASE)/phy_init_data.o
|
||||
@ -27,7 +27,7 @@ phy_init_data-flash: $(PHY_INIT_DATA_BIN)
|
||||
@echo "Flashing PHY init data..."
|
||||
$(PHY_INIT_DATA_FLASH_CMD)
|
||||
|
||||
ifndef CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN
|
||||
ifndef CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN
|
||||
phy_init_data-clean:
|
||||
rm -f $(PHY_INIT_DATA_BIN) $(PHY_INIT_DATA_OBJ)
|
||||
|
||||
@ -37,4 +37,4 @@ endif
|
||||
all: phy_init_data
|
||||
flash: phy_init_data
|
||||
|
||||
endif # CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION
|
||||
endif # CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION
|
||||
|
@ -23,11 +23,11 @@
|
||||
#define PHY_INIT_MAGIC "PHYINIT"
|
||||
|
||||
// define the lowest tx power as LOWEST_PHY_TX_POWER
|
||||
#define PHY_TX_POWER_LOWEST LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 52)
|
||||
#define PHY_TX_POWER_LOWEST LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 52)
|
||||
#define PHY_TX_POWER_OFFSET 44
|
||||
#define PHY_TX_POWER_NUM 5
|
||||
|
||||
#if CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN
|
||||
#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN
|
||||
#define PHY_CRC_ALGORITHM 1
|
||||
#define PHY_COUNTRY_CODE_LEN 2
|
||||
#define PHY_INIT_DATA_TYPE_OFFSET 126
|
||||
@ -83,12 +83,12 @@ static const esp_phy_init_data_t phy_init_data= { {
|
||||
0x18,
|
||||
0x18,
|
||||
0x18,
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 40, 78),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 40, 72),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 40, 66),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 40, 60),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 40, 56),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 40, 52),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 40, 78),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 40, 72),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 40, 66),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 40, 60),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 40, 56),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 40, 52),
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
@ -150,7 +150,7 @@ static const esp_phy_init_data_t phy_init_data= { {
|
||||
|
||||
static const char phy_init_magic_post[] = PHY_INIT_MAGIC;
|
||||
|
||||
#if CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN
|
||||
#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN
|
||||
/**
|
||||
* @brief PHY init data control infomation structure
|
||||
*/
|
||||
|
@ -27,11 +27,11 @@ extern "C" {
|
||||
#define PHY_INIT_MAGIC "PHYINIT"
|
||||
|
||||
// define the lowest tx power as LOWEST_PHY_TX_POWER
|
||||
#define PHY_TX_POWER_LOWEST LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 52)
|
||||
#define PHY_TX_POWER_LOWEST LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 52)
|
||||
#define PHY_TX_POWER_OFFSET 44
|
||||
#define PHY_TX_POWER_NUM 5
|
||||
|
||||
#if CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN
|
||||
#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN
|
||||
#define PHY_CRC_ALGORITHM 1
|
||||
#define PHY_COUNTRY_CODE_LEN 2
|
||||
#define PHY_INIT_DATA_TYPE_OFFSET 126
|
||||
@ -46,20 +46,20 @@ static const char __attribute__((section(".rodata"))) phy_init_magic_pre[] = PHY
|
||||
static const esp_phy_init_data_t phy_init_data= { {
|
||||
0x00,
|
||||
0x00,
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x50),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x50),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x50),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x4c),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x4c),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x48),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x4c),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x48),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x48),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x44),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x4a),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x46),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x46),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x42),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x50),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x50),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x50),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x4c),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x4c),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x48),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x4c),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x48),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x48),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x44),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x4a),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x46),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x46),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x42),
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
@ -160,7 +160,7 @@ static const esp_phy_init_data_t phy_init_data= { {
|
||||
|
||||
static const char __attribute__((section(".rodata"))) phy_init_magic_post[] = PHY_INIT_MAGIC;
|
||||
|
||||
#if CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN
|
||||
#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN
|
||||
/**
|
||||
* @brief PHY init data control infomation structure
|
||||
*/
|
||||
|
@ -27,11 +27,11 @@ extern "C" {
|
||||
#define PHY_INIT_MAGIC "PHYINIT"
|
||||
|
||||
// define the lowest tx power as LOWEST_PHY_TX_POWER
|
||||
#define PHY_TX_POWER_LOWEST LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 52)
|
||||
#define PHY_TX_POWER_LOWEST LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 52)
|
||||
#define PHY_TX_POWER_OFFSET 44
|
||||
#define PHY_TX_POWER_NUM 5
|
||||
|
||||
#if CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN
|
||||
#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN
|
||||
#define PHY_CRC_ALGORITHM 1
|
||||
#define PHY_COUNTRY_CODE_LEN 2
|
||||
#define PHY_INIT_DATA_TYPE_OFFSET 126
|
||||
@ -88,12 +88,12 @@ static const esp_phy_init_data_t phy_init_data= { {
|
||||
0x18,
|
||||
0x18,
|
||||
0x18,
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 84),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 72),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 66),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 60),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 56),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 52),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 84),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 72),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 66),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 60),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 56),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 52),
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
@ -155,7 +155,7 @@ static const esp_phy_init_data_t phy_init_data= { {
|
||||
|
||||
static const char phy_init_magic_post[] = PHY_INIT_MAGIC;
|
||||
|
||||
#if CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN
|
||||
#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN
|
||||
/**
|
||||
* @brief PHY init data control infomation structure
|
||||
*/
|
||||
|
@ -27,11 +27,11 @@ extern "C" {
|
||||
#define PHY_INIT_MAGIC "PHYINIT"
|
||||
|
||||
// define the lowest tx power as LOWEST_PHY_TX_POWER
|
||||
#define PHY_TX_POWER_LOWEST LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 52)
|
||||
#define PHY_TX_POWER_LOWEST LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 52)
|
||||
#define PHY_TX_POWER_OFFSET 44
|
||||
#define PHY_TX_POWER_NUM 5
|
||||
|
||||
#if CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN
|
||||
#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN
|
||||
#define PHY_CRC_ALGORITHM 1
|
||||
#define PHY_COUNTRY_CODE_LEN 2
|
||||
#define PHY_INIT_DATA_TYPE_OFFSET 126
|
||||
@ -46,20 +46,20 @@ static const char phy_init_magic_pre[] = PHY_INIT_MAGIC;
|
||||
static const esp_phy_init_data_t phy_init_data= { {
|
||||
0x00,
|
||||
0x00,
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x50),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x50),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x50),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x4c),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x4c),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x48),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x4c),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x48),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x48),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x44),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x4a),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x46),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x46),
|
||||
LIMIT(CONFIG_ESP32_PHY_MAX_TX_POWER * 4, 0, 0x42),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x50),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x50),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x50),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x4c),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x4c),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x48),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x4c),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x48),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x48),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x44),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x4a),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x46),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x46),
|
||||
LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x42),
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
@ -160,7 +160,7 @@ static const esp_phy_init_data_t phy_init_data= { {
|
||||
|
||||
static const char phy_init_magic_post[] = PHY_INIT_MAGIC;
|
||||
|
||||
#if CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN
|
||||
#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN
|
||||
/**
|
||||
* @brief PHY init data control infomation structure
|
||||
*/
|
||||
|
@ -48,7 +48,7 @@ typedef enum {
|
||||
PHY_RF_CAL_FULL = 0x00000002 /*!< Do full RF calibration. Produces best results, but also consumes a lot of time and current. Suggested to be used once. */
|
||||
} esp_phy_calibration_mode_t;
|
||||
|
||||
#if CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN
|
||||
#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN
|
||||
/**
|
||||
* @brief PHY init data type
|
||||
*/
|
||||
@ -220,7 +220,7 @@ int64_t esp_phy_rf_get_on_ts(void);
|
||||
esp_err_t esp_phy_update_country_info(const char *country);
|
||||
|
||||
|
||||
#if CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN
|
||||
#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN
|
||||
/**
|
||||
* @brief Apply PHY init bin to PHY
|
||||
* @return ESP_OK on success.
|
||||
|
@ -1,5 +1,14 @@
|
||||
# sdkconfig replacement configurations for deprecated options formatted as
|
||||
# CONFIG_DEPRECATED_OPTION CONFIG_NEW_OPTION
|
||||
|
||||
CONFIG_MAC_BB_PD CONFIG_ESP32_PHY_MAC_BB_PD
|
||||
CONFIG_REDUCE_PHY_TX_POWER CONFIG_ESP32_REDUCE_PHY_TX_POWER
|
||||
CONFIG_MAC_BB_PD CONFIG_ESP32_PHY_MAC_BB_PD
|
||||
CONFIG_REDUCE_PHY_TX_POWER CONFIG_ESP32_REDUCE_PHY_TX_POWER
|
||||
CONFIG_ESP32_PHY_MAC_BB_PD CONFIG_ESP_PHY_MAC_BB_PD
|
||||
CONFIG_ESP32_REDUCE_PHY_TX_POWER CONFIG_ESP_PHY_REDUCE_TX_POWER
|
||||
CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE
|
||||
CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION
|
||||
CONFIG_ESP32_PHY_DEFAULT_INIT_IF_INVALID CONFIG_ESP_PHY_DEFAULT_INIT_IF_INVALID
|
||||
CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN
|
||||
CONFIG_ESP32_PHY_INIT_DATA_ERROR CONFIG_ESP_PHY_INIT_DATA_ERROR
|
||||
CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER CONFIG_ESP_PHY_MAX_WIFI_TX_POWER
|
||||
CONFIG_ESP32_PHY_MAX_TX_POWER CONFIG_ESP_PHY_MAX_TX_POWER
|
||||
|
@ -78,8 +78,8 @@ static uint32_t* s_phy_digital_regs_mem = NULL;
|
||||
uint32_t* s_mac_bb_pd_mem = NULL;
|
||||
#endif
|
||||
|
||||
#if CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN
|
||||
#if CONFIG_ESP32_MULTIPLE_PHY_DATA_BIN_EMBEDDED
|
||||
#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN
|
||||
#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED
|
||||
extern uint8_t multi_phy_init_data_bin_start[] asm("_binary_phy_multiple_init_data_bin_start");
|
||||
extern uint8_t multi_phy_init_data_bin_end[] asm("_binary_phy_multiple_init_data_bin_end");
|
||||
#endif
|
||||
@ -321,20 +321,20 @@ IRAM_ATTR void esp_mac_bb_power_down(void)
|
||||
#endif
|
||||
|
||||
// PHY init data handling functions
|
||||
#if CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION
|
||||
#if CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION
|
||||
#include "esp_partition.h"
|
||||
|
||||
const esp_phy_init_data_t* esp_phy_get_init_data(void)
|
||||
{
|
||||
esp_err_t err = ESP_OK;
|
||||
const esp_partition_t* partition = NULL;
|
||||
#if CONFIG_ESP32_MULTIPLE_PHY_DATA_BIN_EMBEDDED
|
||||
#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED
|
||||
size_t init_data_store_length = sizeof(phy_init_magic_pre) +
|
||||
sizeof(esp_phy_init_data_t) + sizeof(phy_init_magic_post);
|
||||
uint8_t* init_data_store = (uint8_t*) malloc(init_data_store_length);
|
||||
if (init_data_store == NULL) {
|
||||
ESP_LOGE(TAG, "failed to allocate memory for updated country code PHY init data");
|
||||
return ESP_ERR_NO_MEM;
|
||||
return NULL;
|
||||
}
|
||||
memcpy(init_data_store, multi_phy_init_data_bin_start, init_data_store_length);
|
||||
ESP_LOGI(TAG, "loading embedded multiple PHY init data");
|
||||
@ -365,7 +365,7 @@ const esp_phy_init_data_t* esp_phy_get_init_data(void)
|
||||
if (memcmp(init_data_store, PHY_INIT_MAGIC, sizeof(phy_init_magic_pre)) != 0 ||
|
||||
memcmp(init_data_store + init_data_store_length - sizeof(phy_init_magic_post),
|
||||
PHY_INIT_MAGIC, sizeof(phy_init_magic_post)) != 0) {
|
||||
#ifndef CONFIG_ESP32_PHY_DEFAULT_INIT_IF_INVALID
|
||||
#ifndef CONFIG_ESP_PHY_DEFAULT_INIT_IF_INVALID
|
||||
ESP_LOGE(TAG, "failed to validate PHY data partition");
|
||||
free(init_data_store);
|
||||
return NULL;
|
||||
@ -390,9 +390,9 @@ const esp_phy_init_data_t* esp_phy_get_init_data(void)
|
||||
free(init_data_store);
|
||||
return NULL;
|
||||
}
|
||||
#endif // CONFIG_ESP32_PHY_DEFAULT_INIT_IF_INVALID
|
||||
#endif // CONFIG_ESP_PHY_DEFAULT_INIT_IF_INVALID
|
||||
}
|
||||
#if CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN
|
||||
#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN
|
||||
if ((*(init_data_store + (sizeof(phy_init_magic_pre) + PHY_SUPPORT_MULTIPLE_BIN_OFFSET)))) {
|
||||
s_multiple_phy_init_data_bin = true;
|
||||
ESP_LOGI(TAG, "Support multiple PHY init data bins");
|
||||
@ -409,7 +409,7 @@ void esp_phy_release_init_data(const esp_phy_init_data_t* init_data)
|
||||
free((uint8_t*) init_data - sizeof(phy_init_magic_pre));
|
||||
}
|
||||
|
||||
#else // CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION
|
||||
#else // CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION
|
||||
|
||||
// phy_init_data.h will declare static 'phy_init_data' variable initialized with default init data
|
||||
|
||||
@ -423,7 +423,7 @@ void esp_phy_release_init_data(const esp_phy_init_data_t* init_data)
|
||||
{
|
||||
// no-op
|
||||
}
|
||||
#endif // CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION
|
||||
#endif // CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION
|
||||
|
||||
|
||||
// PHY calibration data handling functions
|
||||
@ -579,7 +579,7 @@ static esp_err_t store_cal_data_to_nvs_handle(nvs_handle_t handle,
|
||||
return err;
|
||||
}
|
||||
|
||||
#if CONFIG_ESP32_REDUCE_PHY_TX_POWER
|
||||
#if CONFIG_ESP_PHY_REDUCE_TX_POWER
|
||||
// TODO: fix the esp_phy_reduce_tx_power unused warning for esp32s2 - IDF-759
|
||||
static void __attribute((unused)) esp_phy_reduce_tx_power(esp_phy_init_data_t* init_data)
|
||||
{
|
||||
@ -604,7 +604,7 @@ void esp_phy_load_cal_and_init(void)
|
||||
abort();
|
||||
}
|
||||
|
||||
#if CONFIG_ESP32_REDUCE_PHY_TX_POWER
|
||||
#if CONFIG_ESP_PHY_REDUCE_TX_POWER
|
||||
const esp_phy_init_data_t* phy_init_data = esp_phy_get_init_data();
|
||||
if (phy_init_data == NULL) {
|
||||
ESP_LOGE(TAG, "failed to obtain PHY init data");
|
||||
@ -629,7 +629,7 @@ void esp_phy_load_cal_and_init(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE
|
||||
#ifdef CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE
|
||||
esp_phy_calibration_mode_t calibration_mode = PHY_RF_CAL_PARTIAL;
|
||||
uint8_t sta_mac[6];
|
||||
if (esp_rom_get_reset_reason(0) == RESET_REASON_CORE_DEEP_SLEEP) {
|
||||
@ -658,7 +658,7 @@ void esp_phy_load_cal_and_init(void)
|
||||
register_chipv7_phy(init_data, cal_data, PHY_RF_CAL_FULL);
|
||||
#endif
|
||||
|
||||
#if CONFIG_ESP32_REDUCE_PHY_TX_POWER
|
||||
#if CONFIG_ESP_PHY_REDUCE_TX_POWER
|
||||
esp_phy_release_init_data(phy_init_data);
|
||||
free(init_data);
|
||||
#else
|
||||
@ -668,7 +668,7 @@ void esp_phy_load_cal_and_init(void)
|
||||
free(cal_data); // PHY maintains a copy of calibration data, so we can free this
|
||||
}
|
||||
|
||||
#if CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN
|
||||
#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN
|
||||
static esp_err_t phy_crc_check_init_data(uint8_t* init_data, const uint8_t* checksum, size_t init_data_length)
|
||||
{
|
||||
uint32_t crc_data = 0;
|
||||
@ -735,7 +735,7 @@ static esp_err_t phy_get_multiple_init_data(const esp_partition_t* partition,
|
||||
return ESP_FAIL;
|
||||
}
|
||||
esp_err_t err = ESP_OK;
|
||||
#if CONFIG_ESP32_MULTIPLE_PHY_DATA_BIN_EMBEDDED
|
||||
#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED
|
||||
memcpy(init_data_control_info, multi_phy_init_data_bin_start + init_data_store_length, sizeof(phy_control_info_data_t));
|
||||
#else
|
||||
err = esp_partition_read(partition, init_data_store_length, init_data_control_info, sizeof(phy_control_info_data_t));
|
||||
@ -766,7 +766,7 @@ static esp_err_t phy_get_multiple_init_data(const esp_partition_t* partition,
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
#if CONFIG_ESP32_MULTIPLE_PHY_DATA_BIN_EMBEDDED
|
||||
#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED
|
||||
memcpy(init_data_multiple, multi_phy_init_data_bin_start + init_data_store_length + sizeof(phy_control_info_data_t), sizeof(esp_phy_init_data_t) * init_data_control_info->number);
|
||||
#else
|
||||
err = esp_partition_read(partition, init_data_store_length + sizeof(phy_control_info_data_t),
|
||||
@ -809,7 +809,7 @@ static esp_err_t phy_get_multiple_init_data(const esp_partition_t* partition,
|
||||
|
||||
esp_err_t esp_phy_update_init_data(phy_init_data_type_t init_data_type)
|
||||
{
|
||||
#if CONFIG_ESP32_MULTIPLE_PHY_DATA_BIN_EMBEDDED
|
||||
#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED
|
||||
esp_err_t err = ESP_OK;
|
||||
const esp_partition_t* partition = NULL;
|
||||
size_t init_data_store_length = sizeof(phy_init_magic_pre) +
|
||||
@ -856,7 +856,7 @@ esp_err_t esp_phy_update_init_data(phy_init_data_type_t init_data_type)
|
||||
err = phy_get_multiple_init_data(partition, init_data_store, init_data_store_length, init_data_type);
|
||||
if (err != ESP_OK) {
|
||||
free(init_data_store);
|
||||
#if CONFIG_ESP32_PHY_INIT_DATA_ERROR
|
||||
#if CONFIG_ESP_PHY_INIT_DATA_ERROR
|
||||
abort();
|
||||
#else
|
||||
return ESP_FAIL;
|
||||
@ -886,7 +886,7 @@ esp_err_t esp_phy_update_init_data(phy_init_data_type_t init_data_type)
|
||||
|
||||
esp_err_t esp_phy_update_country_info(const char *country)
|
||||
{
|
||||
#if CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN
|
||||
#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN
|
||||
uint8_t phy_init_data_type_map = 0;
|
||||
|
||||
if (!s_multiple_phy_init_data_bin) {
|
||||
|
@ -13,7 +13,7 @@ Partial calibration
|
||||
-------------------
|
||||
During RF initialization, the partial calibration method is used by default for RF calibration.
|
||||
It is done based on the full calibration data which is stored in the NVS.
|
||||
To use this method, please go to ``menuconfig`` and enable :ref:`CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE`.
|
||||
To use this method, please go to ``menuconfig`` and enable :ref:`CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE`.
|
||||
|
||||
Full calibration
|
||||
----------------
|
||||
@ -31,7 +31,7 @@ Full calibration is triggered in the follwing conditions:
|
||||
|
||||
It takes about 100ms more than partial calibration.
|
||||
If boot duration is not critical, it is suggested to use the full calibration method.
|
||||
To switch to the full calibration method, go to ``menuconfig`` and disable :ref:`CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE`.
|
||||
To switch to the full calibration method, go to ``menuconfig`` and disable :ref:`CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE`.
|
||||
If you use the default method of RF calibration, there are two ways to add the function of triggering full calibration as a last-resort remedy.
|
||||
|
||||
1. Erase the NVS partition if you don't mind all of the data stored in the NVS partition is erased. That is indeed the easiest way.
|
||||
@ -51,10 +51,10 @@ There are two ways to get the PHY initialization data.
|
||||
One is the default initialization data which is located in the header file :idf_file:`components/esp_phy/{IDF_TARGET_PATH_NAME}/include/phy_init_data.h`.
|
||||
|
||||
It is embedded into the application binary after compiling and then stored into read-only memory (DROM).
|
||||
To use the default initialization data, please go to ``menuconfig`` and disable :ref:`CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION`.
|
||||
To use the default initialization data, please go to ``menuconfig`` and disable :ref:`CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION`.
|
||||
|
||||
Another is the initialization data which is stored in a partition.
|
||||
When using a custom partition table, make sure that PHY data partition is included (type: `data`, subtype: `phy`).
|
||||
With default partition table, this is done automatically.
|
||||
If initialization data is stored in a partition, it has to be flashed there, otherwise runtime error will occur.
|
||||
To switch to the initialization data stored in a partition, go to ``menuconfig`` and enable :ref:`CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION`.
|
||||
To switch to the initialization data stored in a partition, go to ``menuconfig`` and enable :ref:`CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION`.
|
||||
|
@ -109,7 +109,7 @@ See enum :cpp:type:`esp_partition_subtype_t` for the full list of subtypes defin
|
||||
- ``phy`` (1) is for storing PHY initialisation data. This allows PHY to be configured per-device, instead of in firmware.
|
||||
|
||||
- In the default configuration, the phy partition is not used and PHY initialisation data is compiled into the app itself. As such, this partition can be removed from the partition table to save space.
|
||||
- To load PHY data from this partition, open the project configuration menu (``idf.py menuconfig``) and enable :ref:`CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION` option. You will also need to flash your devices with phy init data as the esp-idf build system does not do this automatically.
|
||||
- To load PHY data from this partition, open the project configuration menu (``idf.py menuconfig``) and enable :ref:`CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION` option. You will also need to flash your devices with phy init data as the esp-idf build system does not do this automatically.
|
||||
- ``nvs`` (2) is for the :doc:`Non-Volatile Storage (NVS) API <../api-reference/storage/nvs_flash>`.
|
||||
|
||||
- NVS is used to store per-device PHY calibration data (different to initialisation data).
|
||||
|
@ -109,7 +109,7 @@ SubType 字段长度为 8 bit,内容与具体分区 Type 有关。目前,esp
|
||||
- ``phy`` (1) 分区用于存放 PHY 初始化数据,从而保证可以为每个设备单独配置 PHY,而非必须采用固件中的统一 PHY 初始化数据。
|
||||
|
||||
- 默认配置下,phy 分区并不启用,而是直接将 phy 初始化数据编译至应用程序中,从而节省分区表空间(直接将此分区删掉)。
|
||||
- 如果需要从此分区加载 phy 初始化数据,请打开项目配置菜单(``idf.py menuconfig``),并且使能 :ref:`CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION` 选项。此时,您还需要手动将 phy 初始化数据烧至设备 flash(esp-idf 编译系统并不会自动完成该操作)。
|
||||
- 如果需要从此分区加载 phy 初始化数据,请打开项目配置菜单(``idf.py menuconfig``),并且使能 :ref:`CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION` 选项。此时,您还需要手动将 phy 初始化数据烧至设备 flash(esp-idf 编译系统并不会自动完成该操作)。
|
||||
- ``nvs`` (2) 是专门给 :doc:`非易失性存储 (NVS) API <../api-reference/storage/nvs_flash>` 使用的分区。
|
||||
|
||||
- 用于存储每台设备的 PHY 校准数据(注意,并不是 PHY 初始化数据)。
|
||||
|
@ -1,2 +1,2 @@
|
||||
CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION=y
|
||||
CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN=y
|
||||
CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION=y
|
||||
CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN=y
|
||||
|
Loading…
x
Reference in New Issue
Block a user