Add grid and EVSE meter components with load balancer
This commit is contained in:
6
components/meter_orno_modbus/CMakeLists.txt
Normal file
6
components/meter_orno_modbus/CMakeLists.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
set(srcs
|
||||
"src/orno_modbus.c"
|
||||
)
|
||||
|
||||
idf_component_register(SRCS "${srcs}"
|
||||
INCLUDE_DIRS "include")
|
||||
22
components/meter_orno_modbus/include/orno_modbus.h
Normal file
22
components/meter_orno_modbus/include/orno_modbus.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef ORNO_MODBUS_H_
|
||||
#define ORNO_MODBUS_H_
|
||||
|
||||
#include "esp_err.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
ORNO_METER_GRID,
|
||||
ORNO_METER_EVSE
|
||||
} orno_meter_type_t;
|
||||
|
||||
esp_err_t orno_modbus_init(void);
|
||||
esp_err_t orno_modbus_read_current(orno_meter_type_t type, float *current);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ORNO_MODBUS_H_ */
|
||||
21
components/meter_orno_modbus/src/orno_modbus.c
Normal file
21
components/meter_orno_modbus/src/orno_modbus.c
Normal file
@@ -0,0 +1,21 @@
|
||||
#include "orno_modbus.h"
|
||||
#include "esp_log.h"
|
||||
|
||||
static const char *TAG = "orno_modbus";
|
||||
|
||||
esp_err_t orno_modbus_init(void)
|
||||
{
|
||||
ESP_LOGI(TAG, "Initializing ORNO Modbus driver");
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t orno_modbus_read_current(orno_meter_type_t type, float *current)
|
||||
{
|
||||
if (!current) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
// Stub implementation - replace with real Modbus queries
|
||||
*current = 0.0f;
|
||||
ESP_LOGD(TAG, "Read current type %d -> %f", type, *current);
|
||||
return ESP_OK;
|
||||
}
|
||||
Reference in New Issue
Block a user