feat(phy): add esp32c5 beta3 phy support

This commit is contained in:
xuxiao
2024-03-12 15:17:31 +08:00
committed by BOT
parent 82f70e7ad4
commit b1bd9987fe
8 changed files with 409 additions and 3 deletions

View File

@@ -18,8 +18,10 @@
*/
static bool s_wifi_adc_xpd_flag;
#if CONFIG_SOC_TEMP_SENSOR_SUPPORTED // TODO: [ESP32C5] IDF-8727 remove me when fix IDF-8727
static bool s_wifi_pwdet_xpd_flag;
static bool s_wifi_tsens_xpd_flag;
#endif
void include_esp_phy_override(void)
{
@@ -57,6 +59,7 @@ IRAM_ATTR void phy_i2c_exit_critical(void)
void phy_set_pwdet_power(bool en)
{
#if CONFIG_SOC_TEMP_SENSOR_SUPPORTED // TODO: [ESP32C5] IDF-8727 remove me when fix IDF-8727
if (s_wifi_pwdet_xpd_flag == en) {
/* ignore repeated calls to phy_set_pwdet_power when the state is already correct */
return;
@@ -68,10 +71,12 @@ void phy_set_pwdet_power(bool en)
} else {
sar_periph_ctrl_pwdet_power_release();
}
#endif
}
void phy_set_tsens_power(bool en)
{
#if CONFIG_SOC_TEMP_SENSOR_SUPPORTED // TODO: [ESP32C5] IDF-8727 remove me when fix IDF-8727
if (s_wifi_tsens_xpd_flag == en) {
/* ignore repeated calls to phy_set_tsens_power when the state is already correct */
return;
@@ -83,9 +88,14 @@ void phy_set_tsens_power(bool en)
} else {
temperature_sensor_power_release();
}
#endif
}
int16_t phy_get_tsens_value(void)
{
#if CONFIG_SOC_TEMP_SENSOR_SUPPORTED // TODO: [ESP32C5] IDF-8727 remove me when fix IDF-8727
return temp_sensor_get_raw_value(NULL);
#else
return 0;
#endif
}