6static const char *
const TAG =
"power_supply";
17 " Time to enable: %" PRIu32
" ms\n"
18 " Keep on time: %" PRIu32
" s\n"
19 " Enable at startup: %s",
21 LOG_PIN(
" Pin: ", this->
pin_);
35 ESP_LOGV(TAG,
"Enabling");
44 ESP_LOGW(TAG,
"Invalid call to unrequest_high_power");
50 ESP_LOGV(TAG,
"Disabling");
bool cancel_timeout(const char *name)
Cancel a timeout function.
void set_timeout(const char *name, uint32_t timeout, std::function< void()> &&f)
Set a timeout function with a const char* name.
virtual void digital_write(bool value)=0
virtual bool is_internal()
void dump_config() override
void request_high_power()
Request high power mode. Use unrequest_high_power() to remove this request.
void on_powerdown() override
bool is_enabled() const
Is this power supply currently on?
void unrequest_high_power()
Un-request high power mode.
void setup() override
Register callbacks.
float get_setup_priority() const override
Hardware setup priority (+1).
constexpr float POWER
For power supply components that must be on before buses like i2c can work.
constexpr float IO
For components that represent GPIO pins like PCF8573.
void HOT delay(uint32_t ms)