esp-hal/esp-radio/src/common_adapter/phy_init_data_esp32s2.rs
Kirill Mikhailov 73ef8d9227
Rename esp-wifi to esp-radio (part 1) (#3858)
* rename `esp-wifi` to `esp-radio`

* Add migration guide entry

* changelog entry

* address reviews

* more fixes

* address reviews

* Thank you for this rebase!

* mmm, rebase

* Remove unnecessary diff

bob

* get rid off all `esp-wifi` references

* drop the links ƒrom the table
2025-07-25 12:26:08 +00:00

147 lines
2.5 KiB
Rust

use crate::binary::include::esp_phy_init_data_t;
const CONFIG_ESP_PHY_MAX_TX_POWER: u8 = 20;
const fn limit(val: u8, low: u8, high: u8) -> u8 {
if val < low {
low
} else if val > high {
high
} else {
val
}
}
pub(crate) static PHY_INIT_DATA_DEFAULT: esp_phy_init_data_t = esp_phy_init_data_t {
params: [
0x80,
0x00,
limit(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x4E),
limit(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x4E),
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, 0x48),
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, 0x48),
limit(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x44),
limit(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x44),
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, 0x42),
0x00,
0x00,
0x00,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0xff,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0xf1,
],
};