From 0807f66b3c6945b863844d92681a16a2a39237a7 Mon Sep 17 00:00:00 2001 From: linuswck Date: Tue, 9 Jan 2024 15:44:55 +0800 Subject: [PATCH] Add digital gpio related fns to Current source - power_up - power_down - ld_short_enable - ld_short_disable - Rev0_2 has hardware connection bug for LD_EN net. - laser driver power will always be enabled --- src/laser_diode/current_sources.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/laser_diode/current_sources.rs b/src/laser_diode/current_sources.rs index 3a10384..f54afe5 100644 --- a/src/laser_diode/current_sources.rs +++ b/src/laser_diode/current_sources.rs @@ -60,4 +60,26 @@ impl CurrentSource { pins_adc: pins_adc, } } + + pub fn power_up(&mut self) { + self.phy.current_source_ldo_en_pin.set_high(); + } + + #[deprecated(note= + "To be removed when rev0_3 has arrived + Rev0_2 has hardware connection bug for LD_EN. + LD_EN will always be enabled.")] + pub fn power_down(&mut self) { + self.phy.current_source_ldo_en_pin.set_low(); + } + + // LD Terminals are shorted together + pub fn ld_short_enable(&mut self) { + self.phy.current_source_short_pin.set_low(); + } + + // LD Current flows from anode to cathode + pub fn ld_short_disable(&mut self) { + self.phy.current_source_short_pin.set_high(); + } } \ No newline at end of file