Introduce generic "outputs" DTS binding

Replaces previous "switch" and "pwm-out" bindings and allows to reference
either gpio or pwm handle and specify maximum current.

Also replacing CONFIG_HAS_LOAD and CONFIG_HAS_USB_PWR with DT_ variants.
This commit is contained in:
Martin Jäger
2020-05-06 12:53:26 +02:00
parent 90c1e7fcf5
commit ce7f63b888
29 changed files with 142 additions and 160 deletions
+2 -2
View File
@@ -44,12 +44,12 @@ void LoadOutput::control()
// junction temperature calculation model for overcurrent detection
junction_temperature = junction_temperature + (
dev_stat.internal_temp - junction_temperature + current * current /
(LOAD_CURRENT_MAX * LOAD_CURRENT_MAX) *
(DT_OUTPUTS_LOAD_CURRENT_MAX * DT_OUTPUTS_LOAD_CURRENT_MAX) *
(DT_CHARGE_CONTROLLER_PCB_MOSFETS_TJ_MAX - DT_CHARGE_CONTROLLER_PCB_INTERNAL_TREF_MAX)
) / (DT_CHARGE_CONTROLLER_PCB_MOSFETS_TAU_JA * CONFIG_CONTROL_FREQUENCY);
if (junction_temperature > DT_CHARGE_CONTROLLER_PCB_MOSFETS_TJ_MAX ||
current > LOAD_CURRENT_MAX * 2)
current > DT_OUTPUTS_LOAD_CURRENT_MAX * 2)
{
flags_set(&error_flags, ERR_LOAD_OVERCURRENT);
oc_timestamp = uptime();