25 lines
495 B
C
25 lines
495 B
C
#pragma once
|
|
#include "esp_event.h"
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
#include "esp_timer.h"
|
|
|
|
ESP_EVENT_DECLARE_BASE(LOADBALANCER_EVENTS);
|
|
|
|
typedef enum {
|
|
LOADBALANCER_EVENT_INIT,
|
|
LOADBALANCER_EVENT_STATE_CHANGED,
|
|
LOADBALANCER_EVENT_CHARGING_LIMIT_CHANGED
|
|
} 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;
|
|
} loadbalancer_state_event_t;
|
|
|