Interfaces for Digital-to-Analog Converters.
More...
|
| file | dac.h |
| | Main header file for DAC (Digital-to-Analog Converter) driver API.
|
Interfaces for Digital-to-Analog Converters.
- Since
- 2.3
- Version
- 1.0.0
◆ DAC_CHANNEL_BROADCAST
| #define DAC_CHANNEL_BROADCAST 0xFF |
◆ dac_channel_setup()
#include <zephyr/drivers/dac.h>
Configure a DAC channel.
It is required to call this function and configure each channel before it is selected for a write request.
- Parameters
-
| dev | Pointer to the device structure for the driver instance. |
| channel_cfg | Channel configuration. |
- Return values
-
| 0 | On success. |
| -EINVAL | If a parameter with an invalid value has been provided. |
| -ENOTSUP | If the requested resolution is not supported. |
◆ dac_write_value()
#include <zephyr/drivers/dac.h>
Write a single value to a DAC channel.
- Parameters
-
| dev | Pointer to the device structure for the driver instance. |
| channel | Number of the channel to be used. |
| value | Data to be written to DAC output registers. |
- Return values
-
| 0 | On success. |
| -EINVAL | If a parameter with an invalid value has been provided. |