Add DC/DC HV side output enable switch

This commit is contained in:
Martin Jäger
2020-07-23 12:55:38 +02:00
parent 7dfcac4037
commit 6316dcd57f
4 changed files with 47 additions and 0 deletions
+22
View File
@@ -8,6 +8,10 @@
#include <zephyr.h>
#ifndef UNIT_TEST
#include <drivers/gpio.h>
#endif
#include <math.h> // for fabs function
#include <stdlib.h> // for min/max function
#include <stdio.h>
@@ -290,4 +294,22 @@ void Dcdc::fuse_destruction()
counter++;
}
void Dcdc::output_hvs_enable()
{
#ifdef DT_OUTPUTS_HV_EXT_SENSE_GPIOS_CONTROLLER
struct device *dev_hv_ext = device_get_binding(DT_OUTPUTS_HV_EXT_SENSE_GPIOS_CONTROLLER);
gpio_pin_configure(dev_hv_ext, DT_OUTPUTS_HV_EXT_SENSE_GPIOS_PIN,
DT_OUTPUTS_HV_EXT_SENSE_GPIOS_FLAGS | GPIO_OUTPUT_ACTIVE);
#endif
}
void Dcdc::output_hvs_disable()
{
#ifdef DT_OUTPUTS_HV_EXT_SENSE_GPIOS_CONTROLLER
struct device *dev_hv_ext = device_get_binding(DT_OUTPUTS_HV_EXT_SENSE_GPIOS_CONTROLLER);
gpio_pin_configure(dev_hv_ext, DT_OUTPUTS_HV_EXT_SENSE_GPIOS_PIN,
DT_OUTPUTS_HV_EXT_SENSE_GPIOS_FLAGS | GPIO_OUTPUT_INACTIVE);
#endif
}
#endif /* DT_COMPAT_DCDC */