Adicionar primeiro
This commit is contained in:
42
components/evse/include/evse_state.h
Normal file
42
components/evse/include/evse_state.h
Normal file
@@ -0,0 +1,42 @@
|
||||
#ifndef EVSE_STATE_H
|
||||
#define EVSE_STATE_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
// Estado do EVSE (pilot signal)
|
||||
typedef enum {
|
||||
EVSE_STATE_A,
|
||||
EVSE_STATE_B1,
|
||||
EVSE_STATE_B2,
|
||||
EVSE_STATE_C1,
|
||||
EVSE_STATE_C2,
|
||||
EVSE_STATE_D1,
|
||||
EVSE_STATE_D2,
|
||||
EVSE_STATE_E,
|
||||
EVSE_STATE_F
|
||||
} evse_state_t;
|
||||
|
||||
|
||||
// Funções públicas necessárias
|
||||
void evse_state_init(void);
|
||||
void evse_state_tick(void);
|
||||
|
||||
void evse_state_set_authorized(bool authorized);
|
||||
|
||||
evse_state_t evse_get_state(void);
|
||||
|
||||
void evse_set_state(evse_state_t state);
|
||||
|
||||
// Converte o estado para string
|
||||
const char* evse_state_to_str(evse_state_t state);
|
||||
|
||||
// Retorna true se o estado representa sessão ativa
|
||||
bool evse_state_is_session(evse_state_t state);
|
||||
|
||||
// Retorna true se o estado representa carregamento ativo
|
||||
bool evse_state_is_charging(evse_state_t state);
|
||||
|
||||
// Retorna true se o estado representa veículo conectado
|
||||
bool evse_state_is_plugged(evse_state_t state);
|
||||
|
||||
#endif // EVSE_STATE_H
|
||||
Reference in New Issue
Block a user