5#ifndef POWER_POWER_HANDLER_H
6#define POWER_POWER_HANDLER_H
91void set_temporary_output(
const uint16_t outputVoltage_mV,
const uint16_t outputCurrent_mA,
const uint16_t timeout_ms);
bool was_started_in_battery_recovery()
Indicates if the charger tried the battery recovery system.
Definition: power_handler.cpp:784
bool go_to_error()
Set the power handler to ERROR mode (locked safety state)
Definition: power_handler.cpp:722
bool enable_charge(const bool enable)
Block or allow the charging of the battery. Note that the system can still be in CHARGING_MODE mode i...
Definition: power_handler.cpp:771
bool is_started()
Return true when power machine finally exits the STARTUP.
Definition: power_handler.cpp:790
bool go_to_output_mode()
Set the power handler to main OUTPUT_VOLTAGE_MODE.
Definition: power_handler.cpp:652
bool is_output_mode_ready()
Return true when the current state is OUTPUT_VOLTAGE_MODE, and the desired voltage are set and gates ...
Definition: power_handler.cpp:139
bool go_to_charger_mode()
Set the power handler to battery CHARGING_MODE.
Definition: power_handler.cpp:670
std::string get_error_string()
Return the error string if set, or "x".
Definition: power_handler.cpp:80
bool is_setup()
Return true if the power handler system is effectivly started.
Definition: power_handler.cpp:788
bool go_to_idle()
Set the power handler to IDLE mode (no power output/input)
Definition: power_handler.cpp:701
bool is_in_error_state()
Return true if the power handling is locked in an ERROR state. No power actions can be made.
Definition: power_handler.cpp:649
void set_temporary_output(const uint16_t outputVoltage_mV, const uint16_t outputCurrent_mA, const uint16_t timeout)
Set a new output with a time limit, after wich the output will go back to the original values....
Definition: power_handler.cpp:753
bool is_in_output_mode()
Return true if the current state is OUTPUT_VOLTAGE_MODE.
Definition: power_handler.cpp:782
std::string get_state()
Return the current state, as a string.
Definition: power_handler.cpp:777
void set_output_voltage_mv(const uint16_t outputVoltage_mV)
Set the desired output voltage of the charger.
Definition: power_handler.cpp:731
void init()
Call once at system startup. This can fail, and it would set the state to ERROR.
Definition: power_handler.cpp:792
bool go_to_shutdown()
Set the power handler to SHUTDOWN mode (last mode before shuting system down)
Definition: power_handler.cpp:712
bool is_in_otg_mode()
Return true if the current state is OTG_MODE.
Definition: power_handler.cpp:783
bool go_to_otg_mode()
Set the power handler to OTG_MODE (eg: external battery mode)
Definition: power_handler.cpp:683
void set_output_max_current_mA(const uint16_t outputCurrent_mA)
Set the desired maximum output current of the charger. This is just an information,...
Definition: power_handler.cpp:747
Program scope.
Definition: control_fixed_modes.hpp:12