added solar ina handling, adjusted website

This commit is contained in:
2025-06-20 23:29:44 +02:00
parent 34b20b1f8f
commit 04849162cd
16 changed files with 301 additions and 42 deletions

View File

@@ -50,6 +50,7 @@ use esp_idf_hal::gpio::{
use esp_idf_hal::pcnt::PCNT0;
use esp_idf_hal::prelude::Peripherals;
use esp_idf_hal::reset::ResetReason;
use measurements::{Current, Voltage};
use pca9535::StandardExpanderInterface;
//Only support for 8 right now!
@@ -115,15 +116,18 @@ impl Default for BackupHeader {
}
pub trait BoardInteraction<'a> {
fn set_charge_indicator(&mut self, charging: bool) -> Result<()>;
fn is_day(&self) -> bool;
fn get_mptt_voltage(&mut self) -> Result<Voltage>;
fn get_mptt_current(&mut self) -> Result<Current>;
fn get_esp(&mut self) -> &mut ESP<'a>;
fn get_config(&mut self) -> &PlantControllerConfig;
fn get_battery_monitor(&mut self) -> &mut Box<dyn BatteryInteraction + Send>;
fn set_charge_indicator(&mut self, charging: bool) -> Result<()>;
fn deep_sleep(&mut self, duration_in_ms: u64) -> !;
fn get_backup_info(&mut self) -> Result<BackupHeader>;
fn get_backup_config(&mut self) -> Result<Vec<u8>>;
fn backup_config(&mut self, bytes: &[u8]) -> Result<()>;
fn is_day(&self) -> bool;
//should be multsampled
fn water_temperature_c(&mut self) -> Result<f32>;
/// return median tank sensor value in milli volt