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
+4 -4
View File
@@ -128,16 +128,16 @@ ThingSetCAN::ThingSetCAN(uint8_t can_node_id, const unsigned int c):
node_id(can_node_id),
channel(c)
{
can_en_dev = device_get_binding(DT_SWITCH_CAN_GPIOS_CONTROLLER);
gpio_pin_configure(can_en_dev, DT_SWITCH_CAN_GPIOS_PIN,
DT_SWITCH_CAN_GPIOS_FLAGS | GPIO_OUTPUT_INACTIVE);
can_en_dev = device_get_binding(DT_OUTPUTS_CAN_EN_GPIOS_CONTROLLER);
gpio_pin_configure(can_en_dev, DT_OUTPUTS_CAN_EN_GPIOS_PIN,
DT_OUTPUTS_CAN_EN_GPIOS_FLAGS | GPIO_OUTPUT_INACTIVE);
can_dev = device_get_binding("CAN_1");
}
void ThingSetCAN::enable()
{
gpio_pin_set(can_en_dev, DT_SWITCH_CAN_GPIOS_PIN, 1);
gpio_pin_set(can_en_dev, DT_OUTPUTS_CAN_EN_GPIOS_PIN, 1);
}
#endif