Skip to content

Commit

Permalink
YetiDriver: Add override max current setting
Browse files Browse the repository at this point in the history
Signed-off-by: Cornelius Claussen <[email protected]>
  • Loading branch information
corneliusclaussen committed Jun 13, 2024
1 parent bc621a7 commit f78c9f1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions modules/YetiDriver/YetiDriver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
10 changes: 6 additions & 4 deletions modules/YetiDriver/board_support/evse_board_supportImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ void evse_board_supportImpl::init() {
{
std::lock_guard<std::mutex> 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;
Expand Down Expand Up @@ -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;

Expand Down
4 changes: 4 additions & 0 deletions modules/YetiDriver/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f78c9f1

Please sign in to comment.