Convert vnd7050aj to Zephyr module and add device tree binding
This commit is contained in:
parent
5579a3993a
commit
a4a0c7bb05
|
|
@ -4,3 +4,5 @@ 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)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
description: STMicroelectronics VND7050AJ High-Side Driver
|
||||||
|
|
||||||
|
compatible:
|
||||||
|
- st,vnd7050aj
|
||||||
|
|
||||||
|
properties:
|
||||||
|
label:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
description: Human readable name for the device
|
||||||
|
|
||||||
|
# Example property for a GPIO pin, adjust as needed
|
||||||
|
gpio-enable-pin:
|
||||||
|
type: phandle-array
|
||||||
|
required: true
|
||||||
|
description: GPIO pin for enabling the device
|
||||||
|
|
||||||
|
# Add other properties relevant to the VND7050AJ, e.g.,
|
||||||
|
# current-sense-gpios:
|
||||||
|
# type: phandle-array
|
||||||
|
# description: GPIO pin for current sense feedback
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
zephyr_library()
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
config VND7050AJ
|
||||||
|
bool "VND7050AJ library support"
|
||||||
|
help
|
||||||
|
Enable support for the VND7050AJ high-side driver.
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
#ifndef VND7050AJ_H__
|
||||||
|
#define VND7050AJ_H__
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void vnd7050aj_init(void);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // VND7050AJ_H__
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
#include <zephyr/kernel.h>
|
||||||
|
#include <zephyr/logging/log.h>
|
||||||
|
#include <vnd7050aj.h>
|
||||||
|
|
||||||
|
LOG_MODULE_REGISTER(vnd7050aj, LOG_LEVEL_INF);
|
||||||
|
|
||||||
|
void vnd7050aj_init(void)
|
||||||
|
{
|
||||||
|
LOG_INF("VND7050AJ library initialized.");
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
name: vnd7050aj
|
||||||
|
build:
|
||||||
|
cmake:
|
||||||
|
- .
|
||||||
Loading…
Reference in New Issue