Adicionar primeiro

This commit is contained in:
2025-06-06 21:17:25 +01:00
parent c188084ba4
commit 282e7f517b
841 changed files with 199592 additions and 1 deletions

View File

@@ -0,0 +1,72 @@
#ifndef METER_H_
#define METER_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stdbool.h>
/**
* @brief Estrutura com os dados de medição trifásica.
*/
typedef struct MeterData
{
float vrmsA;
float vrmsB;
float vrmsC;
float irmsA;
float irmsB;
float irmsC;
int32_t wattA;
int32_t varA;
int32_t vaA;
int32_t wattB;
int32_t varB;
int32_t vaB;
int32_t wattC;
int32_t varC;
int32_t vaC;
} MeterData;
/**
* @brief Inicializa o hardware do medidor e recursos internos (SPI, mutex).
*/
void meter_init(void);
/**
* @brief Inicia a task de medição.
*/
void meter_start(void);
/**
* @brief Para a task de medição e reseta dados.
*/
void meter_stop(void);
/**
* @brief Zera todos os campos da estrutura de dados do medidor.
*/
void meter_initData(void);
/**
* @brief Retorna uma cópia segura dos dados atuais do medidor.
*
* @return MeterData Cópia da última leitura válida.
*/
MeterData meter_getData(void);
/**
* @brief Check if meter task is currently running.
*
* @return true if running, false otherwise.
*/
bool meter_is_running(void);
#ifdef __cplusplus
}
#endif
#endif /* METER_H_ */