DC/DC: Use high/low DcBus instead of PowerPort for control
This makes more sense because the DC/DC converter actually connects two DcBuses and does not need separate PowerPorts. Also makes the code look more clean as variable access like dcdc.hvs->bus->voltage is avoided. The DcBus pointers in the Dcdc are now called hvb and lvb for high- voltage side bus and low-voltage side bus.
This commit is contained in:
+4
-4
@@ -198,15 +198,15 @@ void daq_update()
|
||||
#endif
|
||||
|
||||
#if DT_NODE_EXISTS(DT_PATH(dcdc))
|
||||
dcdc_lv_port.current =
|
||||
dcdc.inductor_current =
|
||||
adc_scaled(ADC_POS(i_dcdc), vref, ADC_GAIN(i_dcdc), dcdc_current_offset_raw);
|
||||
|
||||
lv_terminal_current += dcdc_lv_port.current;
|
||||
lv_terminal_current += dcdc.inductor_current;
|
||||
|
||||
hv_terminal.current = -dcdc_lv_port.current * lv_terminal.bus->voltage /
|
||||
hv_terminal.current = -dcdc.inductor_current * lv_terminal.bus->voltage /
|
||||
hv_terminal.bus->voltage;
|
||||
|
||||
dcdc_lv_port.power = dcdc_lv_port.bus->voltage * dcdc_lv_port.current;
|
||||
dcdc.power = dcdc.lvb->voltage * dcdc.inductor_current;
|
||||
hv_terminal.power = hv_terminal.bus->voltage * hv_terminal.current;
|
||||
#endif
|
||||
lv_terminal.current = lv_terminal_current;
|
||||
|
||||
Reference in New Issue
Block a user