evse_link feature

This commit is contained in:
2025-08-05 16:55:11 +01:00
parent bd587a10c0
commit 0d0dc5b129
35 changed files with 4353 additions and 2257 deletions

View File

@@ -1,7 +1,7 @@
#pragma once
#include "esp_event.h"
#include <stdbool.h>
#include <stdint.h>
#include <stdbool.h>
#include "esp_timer.h"
ESP_EVENT_DECLARE_BASE(LOADBALANCER_EVENTS);
@@ -9,16 +9,39 @@ ESP_EVENT_DECLARE_BASE(LOADBALANCER_EVENTS);
typedef enum {
LOADBALANCER_EVENT_INIT,
LOADBALANCER_EVENT_STATE_CHANGED,
LOADBALANCER_EVENT_CHARGING_LIMIT_CHANGED
LOADBALANCER_EVENT_GLOBAL_CURRENT_LIMIT,
LOADBALANCER_EVENT_MASTER_CURRENT_LIMIT,
LOADBALANCER_EVENT_SLAVE_CURRENT_LIMIT,
LOADBALANCER_EVENT_SLAVE_STATUS
} loadbalancer_event_id_t;
typedef struct {
float limit;
int64_t timestamp_us;
} loadbalancer_charging_limit_event_t;
typedef struct {
bool enabled;
int64_t timestamp_us;
bool enabled;
int64_t timestamp_us;
} loadbalancer_state_event_t;
// (opcional)
typedef struct {
float limit;
int64_t timestamp_us;
} loadbalancer_global_limit_event_t;
typedef struct {
uint8_t slave_id;
uint16_t max_current;
int64_t timestamp_us;
} loadbalancer_master_limit_event_t;
typedef struct {
uint8_t slave_id;
uint16_t max_current;
int64_t timestamp_us;
} loadbalancer_slave_limit_event_t;
typedef struct {
uint8_t slave_id; // ID do slave que reportou
bool charging; // Status de carregamento
float hw_max_current; // Limite máximo de corrente do hardware informado
float runtime_current; // Corrente atual de carregamento (A)
int64_t timestamp_us; // Momento em que o status foi coletado
} loadbalancer_slave_status_event_t;