From 3c9a81758d922b79f756220cb70b8be654086502 Mon Sep 17 00:00:00 2001 From: Eduard Iten Date: Wed, 9 Jul 2025 08:58:05 +0200 Subject: [PATCH] Integrate vnd7050aj library into project --- .vscode/settings.json | 59 ++--------------------------- CMakeLists.txt | 5 ++- Kconfig | 6 +++ modules/vnd7050aj/CMakeLists.txt | 4 +- modules/vnd7050aj/Kconfig | 4 -- modules/vnd7050aj/zephyr/module.yml | 4 -- prj.conf | 3 ++ src/main.c | 2 + 8 files changed, 21 insertions(+), 66 deletions(-) create mode 100644 Kconfig delete mode 100644 modules/vnd7050aj/Kconfig delete mode 100644 modules/vnd7050aj/zephyr/module.yml diff --git a/.vscode/settings.json b/.vscode/settings.json index bfaec0d..6e0a161 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,64 +5,11 @@ "C_Cpp.default.intelliSenseMode": "linux-gcc-x64", "C_Cpp.clang_format_style": "file", "C_Cpp.clang_format_fallbackStyle": "none", - "C_Cpp.clang_format_path": "", - "C_Cpp.vcFormat.indent.braces": false, - "C_Cpp.vcFormat.indent.multiLineRelativeToOpeningBrace": false, - "C_Cpp.vcFormat.indent.withinParentheses": "indent", - "C_Cpp.vcFormat.indent.preserveWithinParentheses": false, - "C_Cpp.vcFormat.indent.caseLabels": false, - "C_Cpp.vcFormat.indent.caseContents": true, - "C_Cpp.vcFormat.indent.caseContentsWhenBlock": false, - "C_Cpp.vcFormat.indent.lambdaBracesWhenParameter": true, - "C_Cpp.vcFormat.indent.gotoLabels": "leftmostColumn", - "C_Cpp.vcFormat.indent.preprocessor": "leftmostColumn", - "C_Cpp.vcFormat.indent.accessSpecifiers": false, - "C_Cpp.vcFormat.indent.namespaceContents": true, - "C_Cpp.vcFormat.newLine.beforeOpenBrace.namespace": "newLine", - "C_Cpp.vcFormat.newLine.beforeOpenBrace.type": "newLine", - "C_Cpp.vcFormat.newLine.beforeOpenBrace.function": "newLine", - "C_Cpp.vcFormat.newLine.beforeOpenBrace.block": "newLine", - "C_Cpp.vcFormat.newLine.beforeOpenBrace.lambda": "newLine", - "C_Cpp.vcFormat.newLine.beforeElse": false, - "C_Cpp.vcFormat.newLine.beforeCatch": true, - "C_Cpp.vcFormat.newLine.beforeWhileInDoWhile": false, - "C_Cpp.vcFormat.space.beforeFunctionOpenParenthesis": "remove", - "C_Cpp.vcFormat.space.withinParameterListParentheses": false, - "C_Cpp.vcFormat.space.betweenEmptyParameterListParentheses": false, - "C_Cpp.vcFormat.space.afterKeywordsInControlFlowStatements": true, - "C_Cpp.vcFormat.space.withinControlFlowStatementParentheses": false, - "C_Cpp.vcFormat.space.beforeLambdaOpenParenthesis": false, - "C_Cpp.vcFormat.space.withinCastParentheses": false, - "C_Cpp.vcFormat.space.afterCastCloseParenthesis": false, - "C_Cpp.vcFormat.space.withinExpressionParentheses": false, - "C_Cpp.vcFormat.space.beforeBlockOpenBrace": true, - "C_Cpp.vcFormat.space.betweenEmptyBraces": false, - "C_Cpp.vcFormat.space.beforeInitializerListOpenBrace": false, - "C_Cpp.vcFormat.space.withinInitializerListBraces": true, - "C_Cpp.vcFormat.space.preserveInInitializerList": true, - "C_Cpp.vcFormat.space.beforeOpenSquareBracket": false, - "C_Cpp.vcFormat.space.withinSquareBrackets": false, - "C_Cpp.vcFormat.space.beforeEmptySquareBrackets": false, - "C_Cpp.vcFormat.space.betweenEmptySquareBrackets": false, - "C_Cpp.vcFormat.space.groupSquareBrackets": true, - "C_Cpp.vcFormat.space.withinLambdaBrackets": false, - "C_Cpp.vcFormat.space.betweenEmptyLambdaBrackets": false, - "C_Cpp.vcFormat.space.beforeComma": false, - "C_Cpp.vcFormat.space.afterComma": true, - "C_Cpp.vcFormat.space.removeAroundMemberOperators": true, - "C_Cpp.vcFormat.space.beforeInheritanceColon": true, - "C_Cpp.vcFormat.space.beforeConstructorColon": true, - "C_Cpp.vcFormat.space.removeBeforeSemicolon": true, - "C_Cpp.vcFormat.space.insertAfterSemicolon": true, - "C_Cpp.vcFormat.space.removeAroundUnaryOperator": true, - "C_Cpp.vcFormat.space.aroundBinaryOperator": "insert", - "C_Cpp.vcFormat.space.aroundAssignmentOperator": "insert", - "C_Cpp.vcFormat.space.pointerReferenceAlignment": "right", - "C_Cpp.vcFormat.space.aroundTernaryOperator": "insert", - "C_Cpp.vcFormat.wrap.preserveBlocks": "oneLiners", "editor.formatOnSave": true, "editor.formatOnType": true, - "editor.rulers": [100], + "editor.rulers": [ + 100 + ], "editor.tabSize": 8, "editor.insertSpaces": false, "files.trimTrailingWhitespace": true, diff --git a/CMakeLists.txt b/CMakeLists.txt index 9fe7a98..8ebe1cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,5 +4,8 @@ find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(hello_world) 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) diff --git a/Kconfig b/Kconfig new file mode 100644 index 0000000..007db71 --- /dev/null +++ b/Kconfig @@ -0,0 +1,6 @@ +source "${ZEPHYR_BASE}/Kconfig" + +config VND7050AJ + bool "VND7050AJ library support" + help + Enable support for the VND7050AJ high-side driver. \ No newline at end of file diff --git a/modules/vnd7050aj/CMakeLists.txt b/modules/vnd7050aj/CMakeLists.txt index 02d6ac9..0166c55 100644 --- a/modules/vnd7050aj/CMakeLists.txt +++ b/modules/vnd7050aj/CMakeLists.txt @@ -1 +1,3 @@ -zephyr_library() +add_library(vnd7050aj STATIC src/vnd7050aj.c) +target_include_directories(vnd7050aj PRIVATE include) +target_link_libraries(vnd7050aj PUBLIC zephyr_interface) diff --git a/modules/vnd7050aj/Kconfig b/modules/vnd7050aj/Kconfig deleted file mode 100644 index 748ab16..0000000 --- a/modules/vnd7050aj/Kconfig +++ /dev/null @@ -1,4 +0,0 @@ -config VND7050AJ - bool "VND7050AJ library support" - help - Enable support for the VND7050AJ high-side driver. diff --git a/modules/vnd7050aj/zephyr/module.yml b/modules/vnd7050aj/zephyr/module.yml deleted file mode 100644 index 6533b66..0000000 --- a/modules/vnd7050aj/zephyr/module.yml +++ /dev/null @@ -1,4 +0,0 @@ -name: vnd7050aj -build: - cmake: - - . diff --git a/prj.conf b/prj.conf index 1e935e9..7a10fff 100644 --- a/prj.conf +++ b/prj.conf @@ -1 +1,4 @@ CONFIG_LOG=y +CONFIG_LOG_DEFAULT_LEVEL=4 +CONFIG_VND7050AJ=y + diff --git a/src/main.c b/src/main.c index c386989..e70a0c8 100644 --- a/src/main.c +++ b/src/main.c @@ -1,10 +1,12 @@ #include #include +#include LOG_MODULE_REGISTER(hello_world, LOG_LEVEL_INF); int main(void) { LOG_INF("Hello World from Zephyr!"); + vnd7050aj_init(); return 0; }