From f78c9f133a5ffbf86996be3277485b59654b65bf Mon Sep 17 00:00:00 2001 From: Cornelius Claussen Date: Thu, 13 Jun 2024 10:57:11 +0200 Subject: [PATCH] YetiDriver: Add override max current setting Signed-off-by: Cornelius Claussen --- modules/YetiDriver/YetiDriver.hpp | 1 + .../board_support/evse_board_supportImpl.cpp | 10 ++++++---- modules/YetiDriver/manifest.yaml | 4 ++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/modules/YetiDriver/YetiDriver.hpp b/modules/YetiDriver/YetiDriver.hpp index 462368c0c..a8e2a113d 100644 --- a/modules/YetiDriver/YetiDriver.hpp +++ b/modules/YetiDriver/YetiDriver.hpp @@ -28,6 +28,7 @@ struct Conf { std::string reset_gpio_chip; int reset_gpio; int caps_min_current_A; + int caps_max_current_A; }; class YetiDriver : public Everest::ModuleBase { diff --git a/modules/YetiDriver/board_support/evse_board_supportImpl.cpp b/modules/YetiDriver/board_support/evse_board_supportImpl.cpp index f33fec3f3..806d00caa 100644 --- a/modules/YetiDriver/board_support/evse_board_supportImpl.cpp +++ b/modules/YetiDriver/board_support/evse_board_supportImpl.cpp @@ -70,14 +70,14 @@ void evse_board_supportImpl::init() { { std::lock_guard lock(capsMutex); - caps.min_current_A_import = mod->config.caps_min_current_A; + caps.min_current_A_import = 6; caps.max_current_A_import = 16; caps.min_phase_count_import = 1; caps.max_phase_count_import = 3; caps.supports_changing_phases_during_charging = false; caps.connector_type = types::evse_board_support::Connector_type::IEC62196Type2Cable; - caps.min_current_A_export = mod->config.caps_min_current_A; + caps.min_current_A_export = 6; caps.max_current_A_export = 16; caps.min_phase_count_export = 1; caps.max_phase_count_export = 3; @@ -113,13 +113,15 @@ void evse_board_supportImpl::init() { caps.min_current_A_import = (mod->config.caps_min_current_A >= 0 ? mod->config.caps_min_current_A : l.hwcap_min_current); - caps.max_current_A_import = l.hwcap_max_current; + caps.max_current_A_import = + (mod->config.caps_max_current_A >= 0 ? mod->config.caps_max_current_A : l.hwcap_max_current); caps.min_phase_count_import = l.hwcap_min_phase_count; caps.max_phase_count_import = l.hwcap_max_phase_count; caps.min_current_A_export = (mod->config.caps_min_current_A >= 0 ? mod->config.caps_min_current_A : l.hwcap_min_current); - caps.max_current_A_export = l.hwcap_max_current; + caps.max_current_A_export = + (mod->config.caps_max_current_A >= 0 ? mod->config.caps_max_current_A : l.hwcap_max_current); caps.min_phase_count_export = l.hwcap_min_phase_count; caps.max_phase_count_export = l.hwcap_max_phase_count; diff --git a/modules/YetiDriver/manifest.yaml b/modules/YetiDriver/manifest.yaml index cd1f738e2..3ba9e5432 100644 --- a/modules/YetiDriver/manifest.yaml +++ b/modules/YetiDriver/manifest.yaml @@ -23,6 +23,10 @@ config: description: Minimal current on AC side. For AC this is typically 6, but for HLC this can be less. -1 means use limit reported by HW. type: integer default: -1 + caps_max_current_A: + description: Maximum current on AC side. For AC this is typically 16 or 32, but for HLC this can be less. -1 means use limit reported by HW. + type: integer + default: -1 provides: powermeter: interface: powermeter