#include <libsimpleio/libdac.h> void DAC_get_name(int32_t chip, char *name, int32_t namesize, int32_t *error); void DAC_open(int32_t chip, int32_t channel, int32_t *fd, int32_t *error); void DAC_close(int32_t fd, int32_t *error); void DAC_write(int32_t fd, int32_t sample, int32_t *error);Link with -lsimpleio.
DAC_get_name() fetches an information string for a D/A device. The chip number must be passed in chip. The destination buffer address must be passed in *name and the destination buffer size must be passed in namesize. The minimum size for the destination buffer is 16 bytes.
DAC_open() opens a D/A output channel device. The D/A chip number must be passed in the chip parameter and the D/A output channel number must be passed in the channel parameter. Upon success, a file descriptor for the D/A output channel device is returned in *fd.
DAC_close() closes a previously opened D/A output channel device.
DAC_write() writes a sample to a D/A output channel device. The file descriptor for an open D/A output channel device must be passed in the fd parameter. The analog sample data must be passed in the sample parameter.
https://wiki.analog.com/software/linux/docs/iio/iio