12#ifndef ZEPHYR_INCLUDE_DRIVERS_DAC_H_
13#define ZEPHYR_INCLUDE_DRIVERS_DAC_H_
51typedef int (*dac_api_channel_setup)(
const struct device *dev,
58typedef int (*dac_api_write_value)(
const struct device *dev,
66__subsystem
struct dac_driver_api {
67 dac_api_channel_setup channel_setup;
68 dac_api_write_value write_value;
91static inline int z_impl_dac_channel_setup(
const struct device *dev,
94 const struct dac_driver_api *api =
95 (
const struct dac_driver_api *)dev->
api;
97 return api->channel_setup(dev, channel_cfg);
113static inline int z_impl_dac_write_value(
const struct device *dev,
116 const struct dac_driver_api *api =
117 (
const struct dac_driver_api *)dev->
api;
119 return api->write_value(dev, channel, value);
130#include <syscalls/dac.h>
int dac_write_value(const struct device *dev, uint8_t channel, uint32_t value)
Write a single value to a DAC channel.
int dac_channel_setup(const struct device *dev, const struct dac_channel_cfg *channel_cfg)
Configure a DAC channel.
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
__UINT8_TYPE__ uint8_t
Definition: stdint.h:58
Structure for specifying the configuration of a DAC channel.
Definition: dac.h:36
uint8_t channel_id
Definition: dac.h:37
uint8_t resolution
Definition: dac.h:38
Runtime device structure (in ROM) per driver instance.
Definition: device.h:367
const void * api
Definition: device.h:373