mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-05-22 01:27:11 +08:00
feat(esp8266): add settings for wifi tx power to menuconfig
This commit is contained in:
@ -455,5 +455,13 @@ config ESP_PHY_INIT_DATA_VDD33_CONST
|
||||
When the ADC reference voltage is set to the actual VDD33 power supply voltage, the value range of vdd33_const is [18,36], the unit is 0.1V.
|
||||
When the ADC reference voltage is set to the default value of 3.3V as the supply voltage, the range of vdd33_const is [0, 18] or (36, 255).
|
||||
|
||||
config ESP8266_PHY_MAX_WIFI_TX_POWER
|
||||
int "Max WiFi TX power (dBm)"
|
||||
range 0 21
|
||||
default 20
|
||||
help
|
||||
Set maximum transmit power for WiFi radio. Actual transmit power for high
|
||||
data rates may be lower than this setting.
|
||||
|
||||
endmenu # PHY
|
||||
|
||||
|
@ -17,6 +17,8 @@
|
||||
#include "esp_phy_init.h"
|
||||
#include "sdkconfig.h"
|
||||
|
||||
// constrain a value between 'low' and 'high', inclusive
|
||||
#define LIMIT(val, low, high) ((val < low) ? low : (val > high) ? high : val)
|
||||
#define PHY_INIT_MAGIC "PHYINIT"
|
||||
|
||||
static const char phy_init_magic_pre[] = PHY_INIT_MAGIC;
|
||||
@ -59,12 +61,12 @@ static const esp_phy_init_data_t phy_init_data= { {
|
||||
0x00,
|
||||
0xf8,
|
||||
0xf8,
|
||||
0x52,
|
||||
0x4e,
|
||||
0x4a,
|
||||
0x44,
|
||||
0x40,
|
||||
0x38,
|
||||
LIMIT(CONFIG_ESP8266_PHY_MAX_WIFI_TX_POWER * 4, 0, 0x52),
|
||||
LIMIT(CONFIG_ESP8266_PHY_MAX_WIFI_TX_POWER * 4, 0, 0x4e),
|
||||
LIMIT(CONFIG_ESP8266_PHY_MAX_WIFI_TX_POWER * 4, 0, 0x4a),
|
||||
LIMIT(CONFIG_ESP8266_PHY_MAX_WIFI_TX_POWER * 4, 0, 0x44),
|
||||
LIMIT(CONFIG_ESP8266_PHY_MAX_WIFI_TX_POWER * 4, 0, 0x40),
|
||||
LIMIT(CONFIG_ESP8266_PHY_MAX_WIFI_TX_POWER * 4, 0, 0x38),
|
||||
0x00,
|
||||
0x00,
|
||||
0x01,
|
||||
|
Reference in New Issue
Block a user