add pump current configuration

This commit is contained in:
2025-06-26 02:39:32 +02:00
parent 577c38d026
commit 5d91daf23d
12 changed files with 492 additions and 275 deletions

View File

@@ -14,7 +14,7 @@ use esp_idf_hal::{
gpio::{AnyInputPin, IOPin, InputOutput, PinDriver, Pull},
pcnt::{PcntChannel, PcntChannelConfig, PcntControlMode, PcntCountMode, PcntDriver, PinIndex},
};
use esp_idf_sys::{gpio_hold_dis, gpio_hold_en, vTaskDelay};
use esp_idf_sys::{gpio_hold_dis, gpio_hold_en};
use measurements::{Current, Voltage};
use plant_ctrl2::sipo::ShiftRegister40;
use std::result::Result::Ok as OkStd;
@@ -252,6 +252,10 @@ impl<'a> BoardInteraction<'a> for V3<'a> {
Ok(())
}
fn pump_current(&mut self, _plant: usize) -> Result<Current> {
bail!("Not implemented in v3")
}
fn fault(&mut self, plant: usize, enable: bool) -> Result<()> {
let index = match plant {
0 => FAULT_1,
@@ -365,13 +369,6 @@ impl<'a> BoardInteraction<'a> for V3<'a> {
unsafe { gpio_hold_en(self.general_fault.pin()) };
}
fn test_pump(&mut self, plant: usize) -> Result<()> {
self.pump(plant, true)?;
unsafe { vTaskDelay(30000) };
self.pump(plant, false)?;
Ok(())
}
fn test(&mut self) -> Result<()> {
self.general_fault(true);
self.esp.delay.delay_ms(100);