only on ESP32-S3-USB. this fiddles with the available hardware UARTs to make it possible to use a third Victron MPPT. if three MPPTs are defined int the pin mapping, you will not be able to use the SmartShunt and JK BMS battery interfaces. note that using a second MPPT will also conflict with the SDM power meter, and that conflict is not detected, yet.
20 lines
599 B
C++
20 lines
599 B
C++
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
#pragma once
|
|
|
|
#include "Battery.h"
|
|
|
|
class VictronSmartShunt : public BatteryProvider {
|
|
public:
|
|
bool init(bool verboseLogging) final;
|
|
void deinit() final { }
|
|
void loop() final;
|
|
std::shared_ptr<BatteryStats> getStats() const final { return _stats; }
|
|
int usedHwUart() const final { return _hwSerialPort; }
|
|
|
|
private:
|
|
static uint8_t constexpr _hwSerialPort = ((ARDUINO_USB_CDC_ON_BOOT != 1)?2:0);
|
|
uint32_t _lastUpdate = 0;
|
|
std::shared_ptr<VictronSmartShuntStats> _stats =
|
|
std::make_shared<VictronSmartShuntStats>();
|
|
};
|