Lines Matching +full:dac +full:- +full:reference
4 * SPDX-License-Identifier: Apache-2.0
10 #include <zephyr/drivers/dac.h>
20 dac32_reference_voltage_source_t reference; member
33 const struct mcux_dac32_config *config = dev->config; in mcux_dac32_channel_setup()
34 struct mcux_dac32_data *data = dev->data; in mcux_dac32_channel_setup()
37 if (channel_cfg->channel_id != 0) { in mcux_dac32_channel_setup()
38 LOG_ERR("unsupported channel %d", channel_cfg->channel_id); in mcux_dac32_channel_setup()
39 return -ENOTSUP; in mcux_dac32_channel_setup()
42 if (channel_cfg->resolution != 12) { in mcux_dac32_channel_setup()
43 LOG_ERR("unsupported resolution %d", channel_cfg->resolution); in mcux_dac32_channel_setup()
44 return -ENOTSUP; in mcux_dac32_channel_setup()
47 if (channel_cfg->internal) { in mcux_dac32_channel_setup()
49 return -ENOTSUP; in mcux_dac32_channel_setup()
53 dac32_config.enableLowPowerMode = config->low_power; in mcux_dac32_channel_setup()
54 dac32_config.referenceVoltageSource = config->reference; in mcux_dac32_channel_setup()
56 DAC32_Init(config->base, &dac32_config); in mcux_dac32_channel_setup()
57 DAC32_EnableBufferOutput(config->base, config->buffered); in mcux_dac32_channel_setup()
59 DAC32_EnableTestOutput(config->base, in mcux_dac32_channel_setup()
62 data->configured = true; in mcux_dac32_channel_setup()
70 const struct mcux_dac32_config *config = dev->config; in mcux_dac32_write_value()
71 struct mcux_dac32_data *data = dev->data; in mcux_dac32_write_value()
73 if (!data->configured) { in mcux_dac32_write_value()
75 return -EINVAL; in mcux_dac32_write_value()
80 return -ENOTSUP; in mcux_dac32_write_value()
85 return -EINVAL; in mcux_dac32_write_value()
89 DAC32_EnableBuffer(config->base, false); in mcux_dac32_write_value()
91 DAC32_SetBufferValue(config->base, 0, value); in mcux_dac32_write_value()
92 DAC32_Enable(config->base, true); in mcux_dac32_write_value()
99 const struct mcux_dac32_config *config = dev->config; in mcux_dac32_init()
101 return pinctrl_apply_state(config->pincfg, PINCTRL_STATE_DEFAULT); in mcux_dac32_init()
104 static DEVICE_API(dac, mcux_dac32_driver_api) = {
119 .reference = \