Chapter 2. API Reference
Currently, the following peripheral drivers are aware of DFS and will use the ESP_PM_APB_FREQ_MAX lock for
the duration of the transaction:
• SPI master
• I2C
• I2S (If the APLL clock is used, then it will use the ESP_PM_NO_LIGHT_SLEEP lock)
• SDMMC
The following drivers will hold the ESP_PM_APB_FREQ_MAX lock while the driver is enabled:
• SPI slave: between calls to spi_slave_initialize() and spi_slave_free().
• Ethernet: between calls to esp_eth_driver_install() and esp_eth_driver_uninstall().
• WiFi: between calls to esp_wifi_start() and esp_wifi_stop(). If modem sleep is enabled, the
lock will be released for the periods of time when radio is disabled.
• TWAI: between calls to twai_driver_install() and twai_driver_uninstall().
The following peripheral drivers are not aware of DFS yet. Applications need to acquire/release locks themselves,
when necessary:
• PCNT
• Sigma-delta
• Timer group
API Reference
Header File
• components/esp_pm/include/esp_pm.h
Functions
esp_err_t esp_pm_configure(const void *config)
Set implementation-specific power management configuration.
Return
• ESP_OK on success
• ESP_ERR_INVALID_ARG if the configuration values are not correct
• ESP_ERR_NOT_SUPPORTED if certain combination of values is not supported, or if CON-
FIG_PM_ENABLE is not enabled in sdkconfig
Parameters
• config: pointer to implementation-specific configuration structure (e.g. esp_pm_config_esp32)
esp_err_t esp_pm_get_configuration(void *config)
Get implementation-specific power management configuration.
Return
• ESP_OK on success
• ESP_ERR_INVALID_ARG if the pointer is null
Parameters
• config: pointer to implementation-specific configuration structure (e.g. esp_pm_config_esp32)
esp_err_t esp_pm_lock_create(esp_pm_lock_type_t lock_type, int arg, const char *name,
esp_pm_lock_handle_t *out_handle)
Initialize a lock handle for certain power management parameter.
When lock is created, initially it is not taken. Call esp_pm_lock_acquire to take the lock.
This function must not be called from an ISR.
Return
• ESP_OK on success
• ESP_ERR_NO_MEM if the lock structure can not be allocated
• ESP_ERR_INVALID_ARG if out_handle is NULL or type argument is not valid
• ESP_ERR_NOT_SUPPORTED if CONFIG_PM_ENABLE is not enabled in sdkconfig
Parameters
Espressif Systems 1033
Submit Document Feedback
Release v4.4