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:
+4
-4
@@ -185,10 +185,10 @@ static void adc_init(ADC_TypeDef *adc)
|
||||
|
||||
static void adc_setup()
|
||||
{
|
||||
#ifdef DT_SWITCH_V_SOLAR_GPIOS_CONTROLLER
|
||||
struct device *dev = device_get_binding(DT_SWITCH_V_SOLAR_GPIOS_CONTROLLER);
|
||||
gpio_pin_configure(dev, DT_SWITCH_V_SOLAR_GPIOS_PIN,
|
||||
DT_SWITCH_V_SOLAR_GPIOS_FLAGS | GPIO_OUTPUT_ACTIVE);
|
||||
#ifdef DT_OUTPUTS_V_SOLAR_PRESENT
|
||||
struct device *dev = device_get_binding(DT_OUTPUTS_V_SOLAR_GPIOS_CONTROLLER);
|
||||
gpio_pin_configure(dev, DT_OUTPUTS_V_SOLAR_GPIOS_PIN,
|
||||
DT_OUTPUTS_V_SOLAR_GPIOS_FLAGS | GPIO_OUTPUT_ACTIVE);
|
||||
#endif
|
||||
|
||||
adc_init(ADC1);
|
||||
|
||||
Reference in New Issue
Block a user