drivers: add half-bridge driver API

Add infrastructure for out-of-tree drivers in this Zephyr module and
define a driver API for half bridges consisting of two complementary
PWM outputs with dead time, as used in the DC/DC converter.

The API is defined as a __subsystem so that drivers can use the
DEVICE_API() macro. Integer-based compare values allow to change the
PWM with minimum step size, while inline helpers provide the float
duty cycle interface known from the previous application code.

A libresolar vendor prefix is added for the new bindings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Martin Jäger
2026-10-20 20:34:01 +02:00
co-authored by Claude Opus 5.5
parent c9951dc1fa
commit 5e0c6dc73f
9 changed files with 282 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
# Copyright (c) The Libre Solar Project Contributors
# SPDX-License-Identifier: Apache-2.0
add_subdirectory_ifdef(CONFIG_HALF_BRIDGE half_bridge)
+8
View File
@@ -0,0 +1,8 @@
# Copyright (c) The Libre Solar Project Contributors
# SPDX-License-Identifier: Apache-2.0
menu "Libre Solar drivers"
rsource "half_bridge/Kconfig"
endmenu
+4
View File
@@ -0,0 +1,4 @@
# Copyright (c) The Libre Solar Project Contributors
# SPDX-License-Identifier: Apache-2.0
zephyr_library()
+22
View File
@@ -0,0 +1,22 @@
# Copyright (c) The Libre Solar Project Contributors
# SPDX-License-Identifier: Apache-2.0
menuconfig HALF_BRIDGE
bool "Half-bridge drivers"
help
Enable drivers for half bridges consisting of two complementary PWM outputs with dead time,
e.g. used in DC/DC converters.
if HALF_BRIDGE
config HALF_BRIDGE_INIT_PRIORITY
int "Half-bridge init priority"
default KERNEL_INIT_PRIORITY_DEVICE
help
Half-bridge driver device initialization priority.
module = HALF_BRIDGE
module-str = half_bridge
source "subsys/logging/Kconfig.template.log_config"
endif # HALF_BRIDGE