fix ade7758

This commit is contained in:
2025-06-25 06:34:03 +01:00
parent a0b2e048d4
commit 84f106eee5
53 changed files with 7079 additions and 18456 deletions

View File

@@ -5,6 +5,10 @@
#include "freertos/FreeRTOS.h"
#include "evse_events.h"
#ifdef __cplusplus
extern "C" {
#endif
// ============================
// EVSE Pilot Signal States
// ============================
@@ -22,21 +26,21 @@ typedef enum {
} evse_state_t;
// ============================
// Initialization & Core Control
// Initialization
// ============================
/**
* @brief Initializes the EVSE state machine.
* @brief Initializes the EVSE state machine and default state.
*/
void evse_state_init(void);
/**
* @brief Periodic tick function for the state machine.
* @brief Periodic tick for state handling (optional hook).
*/
void evse_state_tick(void);
// ============================
// State Access
// State Access & Control
// ============================
/**
@@ -45,51 +49,55 @@ void evse_state_tick(void);
evse_state_t evse_get_state(void);
/**
* @brief Updates the current EVSE state and triggers events.
* @brief Sets the current EVSE state and emits a change event if needed.
*/
void evse_set_state(evse_state_t state);
/**
* @brief Returns the tick count when charging session started.
* @brief Returns the tick count when the current charging session began.
*/
TickType_t evse_get_session_start(void);
/**
* @brief Converts the state enum to a human-readable string.
* @brief Converts the state enum into a human-readable string.
*/
const char* evse_state_to_str(evse_state_t state);
// ============================
// State Evaluators
// State Evaluation Helpers
// ============================
/**
* @brief Returns true if the state represents an active session (B2, C1, C2).
* @brief True if EV is in an active session (B2, C1, C2).
*/
bool evse_state_is_session(evse_state_t state);
/**
* @brief Returns true if the state represents active charging (C1, C2).
* @brief True if EV is actively charging (C1, C2).
*/
bool evse_state_is_charging(evse_state_t state);
/**
* @brief Returns true if the vehicle is plugged in.
* @brief True if EV is physically plugged in (B1 and beyond).
*/
bool evse_state_is_plugged(evse_state_t state);
// ============================
// Authorization
// Authorization Control
// ============================
/**
* @brief Sets the vehicle authorization state.
* @brief Sets whether the EV is authorized to charge.
*/
void evse_state_set_authorized(bool authorized);
/**
* @brief Returns the current vehicle authorization state.
* @brief Gets whether the EV is currently authorized.
*/
bool evse_state_get_authorized(void);
#ifdef __cplusplus
}
#endif
#endif // EVSE_STATE_H