1
0
Fork 0

ld_drive: make settings private & add set & get fn

This commit is contained in:
linuswck 2024-01-09 16:31:58 +08:00
parent d4e074cbd4
commit 59f2385ecf
1 changed files with 10 additions and 2 deletions

View File

@ -45,8 +45,8 @@ impl Settings{
#[derive(Clone, Debug, Miniconf)]
pub struct Settings {
pub ld_drive_current: ElectricCurrent,
pub pd_i_to_out_pwr: i_to_power_unit,
ld_drive_current: ElectricCurrent,
pd_i_to_out_pwr: i_to_power_unit,
}
impl Default for Settings {
@ -85,6 +85,14 @@ impl LD_Drive{
self.ctrl.power_down();
}
pub fn get_ld_drive_current(&mut self) -> ElectricCurrent{
self.settings.ld_drive_current
}
pub fn set_pd_i_to_out_pwr(&mut self, val: i_to_power_unit){
self.settings.pd_i_to_out_pwr = val;
}
pub fn ld_short(&mut self) {
self.ctrl.ld_short_enable();
}