forked from zephyrproject-rtos/zephyr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdac_test.c
45 lines (34 loc) · 1 KB
/
dac_test.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* Copyright (c) 2024 TOKITA Hiroshi
*
* SPDX-License-Identifier: Apache-2.0
*/
#define DT_DRV_COMPAT vnd_dac
#include <zephyr/kernel.h>
#include <zephyr/drivers/dac.h>
int vnd_dac_channel_setup(const struct device *dev, const struct dac_channel_cfg *channel_cfg)
{
ARG_UNUSED(dev);
ARG_UNUSED(channel_cfg);
return -ENOTSUP;
}
int vnd_dac_write_value(const struct device *dev, uint8_t channel, uint32_t value)
{
ARG_UNUSED(dev);
ARG_UNUSED(channel);
ARG_UNUSED(value);
return -ENOTSUP;
}
static const struct dac_driver_api vnd_dac_driver_api = {
.channel_setup = vnd_dac_channel_setup,
.write_value = vnd_dac_write_value,
};
static int vnd_dac_init(const struct device *dev)
{
ARG_UNUSED(dev);
return 0;
}
#define VND_DAC_INIT(index) \
DEVICE_DT_INST_DEFINE(index, &vnd_dac_init, NULL, NULL, NULL, POST_KERNEL, \
CONFIG_DAC_INIT_PRIORITY, &vnd_dac_driver_api);
DT_INST_FOREACH_STATUS_OKAY(VND_DAC_INIT)