Lines Matching +full:dac +full:- +full:reference

4  * SPDX-License-Identifier: Apache-2.0
10 #include <zephyr/drivers/dac.h>
19 dac_reference_voltage_source_t reference; member
30 const struct mcux_dac_config *config = dev->config; in mcux_dac_channel_setup()
31 struct mcux_dac_data *data = dev->data; in mcux_dac_channel_setup()
34 if (channel_cfg->channel_id != 0) { in mcux_dac_channel_setup()
35 LOG_ERR("unsupported channel %d", channel_cfg->channel_id); in mcux_dac_channel_setup()
36 return -ENOTSUP; in mcux_dac_channel_setup()
39 if (channel_cfg->resolution != 12) { in mcux_dac_channel_setup()
40 LOG_ERR("unsupported resolution %d", channel_cfg->resolution); in mcux_dac_channel_setup()
41 return -ENOTSUP; in mcux_dac_channel_setup()
44 if (channel_cfg->internal) { in mcux_dac_channel_setup()
46 return -ENOTSUP; in mcux_dac_channel_setup()
50 dac_config.enableLowPowerMode = config->low_power; in mcux_dac_channel_setup()
51 dac_config.referenceVoltageSource = config->reference; in mcux_dac_channel_setup()
53 DAC_Init(config->base, &dac_config); in mcux_dac_channel_setup()
55 data->configured = true; in mcux_dac_channel_setup()
63 const struct mcux_dac_config *config = dev->config; in mcux_dac_write_value()
64 struct mcux_dac_data *data = dev->data; in mcux_dac_write_value()
66 if (!data->configured) { in mcux_dac_write_value()
68 return -EINVAL; in mcux_dac_write_value()
73 return -ENOTSUP; in mcux_dac_write_value()
78 return -EINVAL; in mcux_dac_write_value()
82 DAC_EnableBuffer(config->base, false); in mcux_dac_write_value()
84 DAC_SetBufferValue(config->base, 0, value); in mcux_dac_write_value()
85 DAC_Enable(config->base, true); in mcux_dac_write_value()
90 static DEVICE_API(dac, mcux_dac_driver_api) = {
103 .reference = \