From c3022e9db148b28c27c039b39aeff6b2b524aecc Mon Sep 17 00:00:00 2001 From: linuswck Date: Wed, 24 Jan 2024 12:10:53 +0800 Subject: [PATCH] Analog_Wdg: Add GPIO init --- src/device/gpio.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/device/gpio.rs b/src/device/gpio.rs index 3af2ee4..f8b830c 100644 --- a/src/device/gpio.rs +++ b/src/device/gpio.rs @@ -1,5 +1,6 @@ use crate::laser_diode::ld_ctrl::{self, LdCtrlPhy}; use crate::laser_diode::max5719; +use crate::laser_diode::analog_wdg::LdAnalogWdgPhy; use crate::thermostat::ad5680; use crate::thermostat::max1968::{self, MAX1968PinSet, MAX1968Phy, PWM_FREQ_KHZ}; use crate::thermostat::ad7172; @@ -39,7 +40,7 @@ pub fn setup( LdCtrlPhy, ad7172::AdcPhy, MAX1968Phy, - // thermostat_phy + LdAnalogWdgPhy ) { let gpioa = gpioa.split(); let gpiob = gpiob.split(); @@ -80,11 +81,13 @@ pub fn setup( ), gpiod.pd8.into_push_pull_output(), gpiob.pb14.into_push_pull_output(), ), - current_source_ldo_en_pin: gpiod.pd9.into_push_pull_output(), current_source_short_pin: gpioa.pa4.into_push_pull_output(), - pd_mon_pin: gpioa.pa3.into_analog() }; + let pd_mon_phy = LdAnalogWdgPhy { + _pd_mon_ch0: gpioa.pa3.into_analog(), + pwr_en_ch0: gpiod.pd9.into_push_pull_output(), + }; let pwm_chs = ( gpiob.pb6.into_alternate(), @@ -133,5 +136,5 @@ pub fn setup( gpioa.pa15.into_push_pull_output(), ).unwrap(); - (eth_pins, usb, current_source_phy, ad7172_phy, max1968_phy) + (eth_pins, usb, current_source_phy, ad7172_phy, max1968_phy, pd_mon_phy) }