Crate esp_phy

Crate esp_phy 

Source
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

OptionStabilityDefault valueAllowed 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.

⚠️ Unstabletrue

ESP_PHY_CONFIG_PHY_SKIP_CALIBRATION_AFTER_DEEP_SLEEP

Use PHY_RF_CAL_NONE after deep sleep.

⚠️ Unstablefalse

ESP_PHY_CONFIG_PHY_FULL_CALIBRATION

Use PHY_RF_CAL_FULL instead of PHY_RF_CAL_PARTIAL.

⚠️ Unstabletrue

§Feature Flags

§Logging Feature Flags

  • defmt — Enable logging output using defmt and implement defmt::Format on certain types.
  • log-04 — Enable logging output using version 0.4 of the log crate.

§Chip selection

One of the following features must be enabled to select the target chip:

  • esp32c2
  • esp32c3
  • esp32c5
  • esp32c6
  • esp32c61
  • esp32h2
  • esp32
  • esp32s2
  • esp32s3

Structs§

CalibrationDataAlreadySetError
Calibration data was already set.
NoCalibrationDataError
No calibration data is available.
PhyClockGuard
Prevents the PHY clock from being disabled.
PhyInitGuard
Prevents the PHY from being deinitialized.

Enums§

CalibrationResult
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§

MacTimeUpdateCb
Callback to update the MAC time.
PhyCalibrationData
Type alias for opaque calibration data.