1menu "PHY"
2
3    config ESP_PHY_CALIBRATION_AND_DATA_STORAGE
4        bool "Store phy calibration data in NVS"
5        default y
6        help
7            If this option is enabled, NVS will be initialized and calibration data will be loaded from there.
8            PHY calibration will be skipped on deep sleep wakeup. If calibration data is not found, full calibration
9            will be performed and stored in NVS. Normally, only partial calibration will be performed.
10            If this option is disabled, full calibration will be performed.
11
12            If it's easy that your board calibrate bad data, choose 'n'.
13            Two cases for example, you should choose 'n':
14            1.If your board is easy to be booted up with antenna disconnected.
15            2.Because of your board design, each time when you do calibration, the result are too unstable.
16            If unsure, choose 'y'.
17
18    menuconfig ESP_PHY_INIT_DATA_IN_PARTITION
19        bool "Use a partition to store PHY init data"
20        depends on SOC_WIFI_SUPPORTED
21        default n
22        help
23            If enabled, PHY init data will be loaded from a partition.
24            When using a custom partition table, make sure that PHY data
25            partition is included (type: 'data', subtype: 'phy').
26            With default partition tables, this is done automatically.
27            If PHY init data is stored in a partition, it has to be flashed there,
28            otherwise runtime error will occur.
29
30            If this option is not enabled, PHY init data will be embedded
31            into the application binary.
32
33            If unsure, choose 'n'.
34
35    config ESP_PHY_DEFAULT_INIT_IF_INVALID
36        bool "Reset default PHY init data if invalid"
37        default n
38        depends on ESP_PHY_INIT_DATA_IN_PARTITION
39        help
40            If enabled, PHY init data will be restored to default if
41            it cannot be verified successfully to avoid endless bootloops.
42
43            If unsure, choose 'n'.
44
45    if ESP_PHY_INIT_DATA_IN_PARTITION
46        config ESP_PHY_MULTIPLE_INIT_DATA_BIN
47            bool "Support multiple PHY init data bin"
48            depends on ESP_PHY_INIT_DATA_IN_PARTITION
49            default n
50            help
51                If enabled, the corresponding PHY init data type can be automatically switched
52                according to the country code. China's PHY init data bin is used by default.
53                Can be modified by country information in API esp_wifi_set_country().
54                The priority of switching the PHY init data type is:
55                1. Country configured by API esp_wifi_set_country()
56                and the parameter policy is WIFI_COUNTRY_POLICY_MANUAL.
57                2. Country notified by the connected AP.
58                3. Country configured by API esp_wifi_set_country()
59                and the parameter policy is WIFI_COUNTRY_POLICY_AUTO.
60
61        config ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED
62            bool "Support embedded multiple phy init data bin to app bin"
63            depends on ESP_PHY_MULTIPLE_INIT_DATA_BIN
64            default n
65            help
66                If enabled, multiple phy init data bin will embedded into app bin
67                If not enabled, multiple phy init data bin will still leave alone, and need to be flashed by users.
68
69        config ESP_PHY_INIT_DATA_ERROR
70            bool "Terminate operation when PHY init data error"
71            depends on ESP_PHY_MULTIPLE_INIT_DATA_BIN
72            default n
73            help
74                If enabled, when an error occurs while the PHY init data is updated,
75                the program will terminate and restart.
76                If not enabled, the PHY init data will not be updated when an error occurs.
77    endif
78
79    config ESP_PHY_MAX_WIFI_TX_POWER
80        int "Max WiFi TX power (dBm)"
81        range 10 20
82        default 20
83        help
84            Set maximum transmit power for WiFi radio. Actual transmit power for high
85            data rates may be lower than this setting.
86
87    config ESP_PHY_MAX_TX_POWER
88        int
89        default ESP_PHY_MAX_WIFI_TX_POWER
90
91    config ESP_PHY_MAC_BB_PD
92        bool "Power down MAC and baseband of Wi-Fi and Bluetooth when PHY is disabled"
93        depends on SOC_PM_SUPPORT_MAC_BB_PD && FREERTOS_USE_TICKLESS_IDLE
94        default n
95        help
96            If enabled, the MAC and baseband of Wi-Fi and Bluetooth will be powered
97            down when PHY is disabled. Enabling this setting reduces power consumption
98            by a small amount but increases RAM use by approximately 4 KB(Wi-Fi only),
99            2 KB(Bluetooth only) or 5.3 KB(Wi-Fi + Bluetooth).
100
101    config ESP_PHY_REDUCE_TX_POWER
102        bool "Reduce PHY TX power when brownout reset"
103        depends on ESP_BROWNOUT_DET
104        default n
105        help
106            When brownout reset occurs, reduce PHY TX power to keep the code running.
107
108    config ESP_PHY_ENABLE_USB
109        bool "Enable USB when phy init"
110        depends on USB_OTG_SUPPORTED || ESP_CONSOLE_USB_SERIAL_JTAG || ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG
111        default y if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3
112        default n
113        help
114            When using USB Serial/JTAG/OTG/CDC, PHY should enable USB, otherwise USB module
115            can not work properly. Notice: Enabling this configuration option will slightly impact wifi performance.
116
117    config ESP_PHY_ENABLE_CERT_TEST
118        bool "Enable RF certification test functions"
119        default n
120        depends on IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3
121        help
122            If enabled, you can use RF certification test APIs.
123
124    choice ESP_PHY_CALIBRATION_MODE
125        prompt "Calibration mode"
126        default ESP_PHY_RF_CAL_PARTIAL
127        help
128            Select PHY calibration mode. During RF initialization, the partial calibration
129            method is used by default for RF calibration. Full calibration takes about 100ms
130            more than partial calibration. If boot duration is not critical, it is suggested
131            to use the full calibration method. No calibration method is only used when the
132            device wakes up from deep sleep.
133
134        config ESP_PHY_RF_CAL_PARTIAL
135            bool "Calibration partial"
136        config ESP_PHY_RF_CAL_NONE
137            bool "Calibration none"
138        config ESP_PHY_RF_CAL_FULL
139            bool "Calibration full"
140    endchoice #ESP_PHY_CALIBRATION_MODE
141
142    config ESP_PHY_CALIBRATION_MODE
143        int
144        default 0 if ESP_PHY_RF_CAL_PARTIAL
145        default 1 if ESP_PHY_RF_CAL_NONE
146        default 2 if ESP_PHY_RF_CAL_FULL
147
148    config ESP_PHY_IMPROVE_RX_11B
149        bool "Improve Wi-Fi receive 11b pkts"
150        default n
151        depends on SOC_PHY_IMPROVE_RX_11B
152        help
153            This is a workaround to improve Wi-Fi receive 11b pkts for some modules using AC-DC power supply with
154            high interference, enable this option will sacrifice Wi-Fi OFDM receive performance.
155            But to guarantee 11b receive performance serves as a bottom line in this case.
156
157endmenu  # PHY
158