// === Início de: components/evse/include/evse_limits.h ===
#ifndef EVSE_LIMITS_H
#define EVSE_LIMITS_H

#include <stdint.h>
#include <stdbool.h>
#include "evse_state.h"

#ifdef __cplusplus
extern "C" {
#endif

// ============================
// Limit Status & Evaluation
// ============================

/**
 * @brief Sets the internal 'limit reached' flag.
 */
void evse_set_limit_reached(bool value);

/**
 * @brief Returns true if any runtime charging limit has been reached.
 */
bool evse_get_limit_reached(void);

/**
 * @brief Convenience alias for evse_get_limit_reached().
 */
bool evse_is_limit_reached(void);

/**
 * @brief Checks if any session limit has been exceeded (energy, time or power).
 * Should be called periodically during charging.
 */
void evse_limits_check(void);

// ============================
// Runtime Limit Configuration
// ============================

/**
 * @brief Get/set energy consumption limit (in Wh).
 */
uint32_t evse_get_consumption_limit(void);
void     evse_set_consumption_limit(uint32_t value);

/**
 * @brief Get/set maximum charging time (in seconds).
 */
uint32_t evse_get_charging_time_limit(void);
void     evse_set_charging_time_limit(uint32_t value);

/**
 * @brief Get/set minimum acceptable power level (in Watts).
 */
uint16_t evse_get_under_power_limit(void);
void     evse_set_under_power_limit(uint16_t value);

#ifdef __cplusplus
}
#endif

#endif // EVSE_LIMITS_H
// === Fim de: components/evse/include/evse_limits.h ===
