Expand description
PHY initialization handling for chips with a radio.
This should be considered an implementation detail of esp-radio and similar 3rd party crates.
§Usage
§Enabling and Disabling the PHY
Use enable_phy to enable the PHY. Drop the returned PhyInitGuard to disable the PHY. Enabling / disabling the PHY is ref-counted so these actions need to be balanced.
§Backing Up and Restoring PHY Calibration Data
If the PHY has already been calibrated, you can use backup_phy_calibration_data to persist calibration data elsewhere (e.g. in flash). Using set_phy_calibration_data you can restore previously persisted calibration data.
§Config Options
| Option | Stability | Default value | Allowed values |
|---|---|---|---|
ESP_PHY_CONFIG_PHY_ENABLE_USB Keeps USB running when using WiFi. This allows debugging and log messages via USB Serial JTAG. Turn off for best WiFi performance. | ⚠️ Unstable | true | |
ESP_PHY_CONFIG_PHY_SKIP_CALIBRATION_AFTER_DEEP_SLEEP Use PHY_RF_CAL_NONE after deep sleep. | ⚠️ Unstable | false | |
ESP_PHY_CONFIG_PHY_FULL_CALIBRATION Use PHY_RF_CAL_FULL instead of PHY_RF_CAL_PARTIAL. | ⚠️ Unstable | true |
§Feature Flags
§Logging Feature Flags
defmt— Enable logging output usingdefmtand implementdefmt::Formaton certain types.log-04— Enable logging output using version 0.4 of thelogcrate.
§Chip selection
One of the following features must be enabled to select the target chip:
esp32c2esp32c3esp32c5esp32c6esp32c61esp32h2esp32esp32s2esp32s3
Structs§
- Calibration
Data Already SetError - Calibration data was already set.
- NoCalibration
Data Error - No calibration data is available.
- PhyClock
Guard - Prevents the PHY clock from being disabled.
- PhyInit
Guard - Prevents the PHY from being deinitialized.
Enums§
- Calibration
Result - Result of the PHY calibration.
Constants§
- PHY_
CALIBRATION_ DATA_ LENGTH - Length of the PHY calibration data.
Functions§
- backup_
phy_ calibration_ data - Backup the PHY calibration data to the provided slice.
- disable_
phy - Manually disable the PHY.
- enable_
phy - Enable the PHY.
- enable_
phy_ clock - Enable the PHY clock and acquire a PhyClockGuard.
- last_
calibration_ result - Get the last calibration result.
- set_
mac_ time_ update_ cb - Set the MAC time update callback.
- set_
phy_ calibration_ data - Load previously backed up PHY calibration data.
Type Aliases§
- MacTime
Update Cb - Callback to update the MAC time.
- PhyCalibration
Data - Type alias for opaque calibration data.