forked from M-Labs/kirdy
ld_drive: make settings private & add set & get fn
This commit is contained in:
parent
d4e074cbd4
commit
59f2385ecf
|
@ -45,8 +45,8 @@ impl Settings{
|
||||||
|
|
||||||
#[derive(Clone, Debug, Miniconf)]
|
#[derive(Clone, Debug, Miniconf)]
|
||||||
pub struct Settings {
|
pub struct Settings {
|
||||||
pub ld_drive_current: ElectricCurrent,
|
ld_drive_current: ElectricCurrent,
|
||||||
pub pd_i_to_out_pwr: i_to_power_unit,
|
pd_i_to_out_pwr: i_to_power_unit,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Settings {
|
impl Default for Settings {
|
||||||
|
@ -85,6 +85,14 @@ impl LD_Drive{
|
||||||
self.ctrl.power_down();
|
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) {
|
pub fn ld_short(&mut self) {
|
||||||
self.ctrl.ld_short_enable();
|
self.ctrl.ld_short_enable();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue