From edd30e94a0ed108334516a7f869f01037162de2e Mon Sep 17 00:00:00 2001 From: linuswck Date: Fri, 26 Jan 2024 12:53:04 +0800 Subject: [PATCH] laser_diode: Add fn to set pd_dark_i --- src/laser_diode/laser_diode.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/laser_diode/laser_diode.rs b/src/laser_diode/laser_diode.rs index 95d30e8..3a4c047 100644 --- a/src/laser_diode/laser_diode.rs +++ b/src/laser_diode/laser_diode.rs @@ -16,8 +16,6 @@ use uom::{si::{ISQ, SI, Quantity}, typenum::*}; pub type TransimpedanceUnit = Quantity, SI, f64>; // Ampere / Volt type TransconductanceUnit = Quantity, SI, f64>; -// Watt / Ampere -pub type IToPowerUnit = Quantity, SI, f64>; impl Settings{ pub const DAC_OUT_V_MAX: ElectricPotential = ElectricPotential { @@ -131,6 +129,10 @@ impl LdDrive{ self.settings.pd_responsitivity.responsitivity = responsitivity; } + pub fn set_pd_dark_current(&mut self, i_dark: ElectricCurrent){ + self.settings.pd_responsitivity.i_dark = i_dark; + } + pub fn set_ld_power_limit(&mut self, pwr_limit: Power){ LdPwrExcProtector::set_trigger_threshold_v(self.settings.pd_responsitivity .get_ld_i_from_ld_pwr(pwr_limit) / Settings::PD_MON_TRANSCONDUCTANCE