ESP32-P4 LDO
The ESP32-P4 has 4 Low-Dropout linear regulators that can be used to power on- and off-chip peripherals. This component allows those regulators to be configured and enabled.
Channels 3 and 4 are available for general use. Channels 1 and 2 are normally reserved by the chip for powering internal flash and PSRAM — they can only be configured with an explicit acknowledgement option (see below).
# Example configuration entryesp_ldo: - channel: 3 voltage: 2.5V - channel: 4 voltage: passthroughConfiguration variables
Section titled “Configuration variables”- channel (Required, int): The channel number of the LDO regulator to configure. Valid values are 1–4.
Channels 3 and 4 are available for general use. Channels 1 and 2 are reserved for internal chip use (flash/PSRAM)
and require
allow_internal_channel: trueto be set. - voltage (Required, voltage): The desired output voltage. Must be in the range
0.5Vto2.7V, orpassthroughto enable pass-through mode (output follows the supply voltage). Note: the actual output voltage may deviate by approximately 50–100 mV from the configured value. - adjustable (Optional, bool): If true, the output voltage can be adjusted at runtime using the
esp_ldo.voltage.adjustaction. Defaults tofalse. Cannot be set totruewhenvoltageispassthrough, as pass-through mode does not support runtime voltage adjustment. - allow_internal_channel (Optional, bool): Must be set to
trueto use channels 1 or 2. These channels are normally reserved by the chip for flash and PSRAM power. Incorrect use can cause system instability, data corruption, or a permanently bricked device. Only set this if you have verified via your board’s datasheet and schematics that the channel is unused. Setting this option on channels 3 or 4 is an error. Defaults tofalse.
esp_ldo.voltage.adjust Action
Section titled “esp_ldo.voltage.adjust Action”If the LDO is configured with adjustable: true, the voltage can be updated at runtime:
on_...: then: - esp_ldo.voltage.adjust: id: ldo_id voltage: !lambda return 2.5;Configuration variables
Section titled “Configuration variables”- id (Required, ID): The ID of the LDO to adjust.
- voltage (Required, voltage): The desired output voltage. Must be in the range
0.5Vto2.7V.
- The LDO output voltage may deviate by approximately 50–100 mV from the configured value.
- Channels 1 and 2 are connected to the chip’s internal flash and PSRAM power domains on most ESP32-P4 modules. Only use these channels if your specific board schematic confirms they are routed to an external pad and are not powering internal components.
passthroughmode passes the supply voltage directly to the output and does not support runtime voltage adjustment. Settingadjustable: truetogether withvoltage: passthroughis a configuration error and will be rejected during validation.