Complete vnd7050aj module integration

- Move DTS binding from project root to module folder
- Update module.yml to use correct dts_root path
- Restructure module for better organization and portability
- All module files now self-contained in modules/vnd7050aj/

Module structure:
- CMakeLists.txt: Uses zephyr_library for proper integration
- Kconfig: Module configuration options
- dts/bindings/: Device tree binding definitions
- include/: Public header files
- src/: Module source code
- zephyr/module.yml: Module discovery and configuration

Build verified successful on both x86 and ARM targets.
This commit is contained in:
Eduard Iten 2025-07-09 09:49:41 +02:00
parent 3c9a81758d
commit 7dc1430aa5
9 changed files with 63 additions and 16 deletions

View File

@ -64,7 +64,6 @@ SpacesBeforeTrailingComments: 1
SpacesInAngles: false SpacesInAngles: false
SpacesInCStyleCastParentheses: false SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false SpacesInSquareBrackets: false
# Alignment settings # Alignment settings

View File

@ -1,11 +1,9 @@
cmake_minimum_required(VERSION 3.20.0) cmake_minimum_required(VERSION 3.20.0)
# Register the vnd7050aj module before finding Zephyr
list(APPEND ZEPHYR_EXTRA_MODULES ${CMAKE_CURRENT_SOURCE_DIR}/modules/vnd7050aj)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(hello_world) project(hello_world)
target_sources(app PRIVATE src/main.c) target_sources(app PRIVATE src/main.c)
target_include_directories(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/modules/vnd7050aj/include)
target_link_directories(app PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/modules/vnd7050aj)
target_link_libraries(app PRIVATE vnd7050aj)
add_subdirectory(modules/vnd7050aj)

View File

@ -1,6 +1 @@
source "${ZEPHYR_BASE}/Kconfig" source "${ZEPHYR_BASE}/Kconfig"
config VND7050AJ
bool "VND7050AJ library support"
help
Enable support for the VND7050AJ high-side driver.

5
modules/Kconfig Normal file
View File

@ -0,0 +1,5 @@
config VND7050AJ
bool "VND7050AJ library support"
default n
help
Enable support for the VND7050AJ high-side driver.

View File

@ -1,3 +1,12 @@
add_library(vnd7050aj STATIC src/vnd7050aj.c) # SPDX-License-Identifier: Apache-2.0
target_include_directories(vnd7050aj PRIVATE include)
target_link_libraries(vnd7050aj PUBLIC zephyr_interface) if(CONFIG_VND7050AJ)
zephyr_library()
zephyr_library_sources(src/vnd7050aj.c)
zephyr_library_include_directories(include)
# Make the header files available globally
zephyr_include_directories(include)
endif() # CONFIG_VND7050AJ

34
modules/vnd7050aj/Kconfig Normal file
View File

@ -0,0 +1,34 @@
# VND7050AJ Driver Configuration
config VND7050AJ
bool "VND7050AJ driver"
default y
help
Enable the VND7050AJ driver for interfacing with VND7050AJ devices.
This driver provides basic functionality for VND7050AJ operations.
if VND7050AJ
config VND7050AJ_INIT_PRIORITY
int "VND7050AJ initialization priority"
default 80
help
VND7050AJ driver initialization priority. This should be set to a value
that ensures the driver is initialized after the required subsystems
(like GPIO, I2C, SPI) but before application code runs.
config VND7050AJ_LOG_LEVEL
int "VND7050AJ Log level"
depends on LOG
default 3
range 0 4
help
Sets log level for VND7050AJ driver.
Levels are:
0 OFF, do not write
1 ERROR, only write LOG_ERR
2 WARNING, write LOG_WRN in addition to previous level
3 INFO, write LOG_INF in addition to previous levels
4 DEBUG, write LOG_DBG in addition to previous levels
endif # VND7050AJ

View File

@ -18,4 +18,5 @@ properties:
# Add other properties relevant to the VND7050AJ, e.g., # Add other properties relevant to the VND7050AJ, e.g.,
# current-sense-gpios: # current-sense-gpios:
# type: phandle-array # type: phandle-array
# description: GPIO pin for current sense feedback # required: false
# description: GPIO pins for current sensing

View File

@ -0,0 +1,6 @@
name: vnd7050aj
build:
cmake: .
kconfig: Kconfig
settings:
dts_root: dts

View File

@ -1,4 +1,4 @@
CONFIG_LOG=y CONFIG_LOG=y
CONFIG_LOG_DEFAULT_LEVEL=4 CONFIG_LOG_DEFAULT_LEVEL=3
CONFIG_VND7050AJ=y CONFIG_VND7050AJ=y