1
0
Fork 0

Analog_Wdg: Add GPIO init

This commit is contained in:
linuswck 2024-01-24 12:10:53 +08:00
parent c02181c80c
commit c3022e9db1
1 changed files with 7 additions and 4 deletions

View File

@ -1,5 +1,6 @@
use crate::laser_diode::ld_ctrl::{self, LdCtrlPhy}; use crate::laser_diode::ld_ctrl::{self, LdCtrlPhy};
use crate::laser_diode::max5719; use crate::laser_diode::max5719;
use crate::laser_diode::analog_wdg::LdAnalogWdgPhy;
use crate::thermostat::ad5680; use crate::thermostat::ad5680;
use crate::thermostat::max1968::{self, MAX1968PinSet, MAX1968Phy, PWM_FREQ_KHZ}; use crate::thermostat::max1968::{self, MAX1968PinSet, MAX1968Phy, PWM_FREQ_KHZ};
use crate::thermostat::ad7172; use crate::thermostat::ad7172;
@ -39,7 +40,7 @@ pub fn setup(
LdCtrlPhy<ld_ctrl::Channel0>, LdCtrlPhy<ld_ctrl::Channel0>,
ad7172::AdcPhy, ad7172::AdcPhy,
MAX1968Phy<max1968::Channel0>, MAX1968Phy<max1968::Channel0>,
// thermostat_phy LdAnalogWdgPhy
) { ) {
let gpioa = gpioa.split(); let gpioa = gpioa.split();
let gpiob = gpiob.split(); let gpiob = gpiob.split();
@ -80,11 +81,13 @@ pub fn setup(
), gpiod.pd8.into_push_pull_output(), ), gpiod.pd8.into_push_pull_output(),
gpiob.pb14.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(), 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 = ( let pwm_chs = (
gpiob.pb6.into_alternate(), gpiob.pb6.into_alternate(),
@ -133,5 +136,5 @@ pub fn setup(
gpioa.pa15.into_push_pull_output(), gpioa.pa15.into_push_pull_output(),
).unwrap(); ).unwrap();
(eth_pins, usb, current_source_phy, ad7172_phy, max1968_phy) (eth_pins, usb, current_source_phy, ad7172_phy, max1968_phy, pd_mon_phy)
} }