.\" man page for Munts Technologies Linux Simple I/O Library .\" .\" Copyright (C)2016-2023, Philip Munts dba Munts Technologies. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: .\" .\" * Redistributions of source code must retain the above copyright notice, .\" this list of conditions and the following disclaimer. .\" .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" .\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE .\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" .TH libdac 2 "4 February 2019" "version 1" "Linux Simple I/O Library" .SH NAME .B libdac \-\- Linux Simple I/O Library: D/A Input Module .SH SYNOPSIS .nf .B #include .BI "void DAC_get_name(int32_t " chip ", char *" name ", int32_t " namesize "," .BI " int32_t *" error ");" .BI "void DAC_open(int32_t " chip ", int32_t " channel ", int32_t *" fd ", .BI " int32_t *" error ");" .BI "void DAC_close(int32_t " fd ", int32_t *" error ");" .BI "void DAC_write(int32_t " fd ", int32_t " sample ", int32_t *" error ");" .fi Link with .BR -lsimpleio . .SH DESCRIPTION .nh All functions return either .B 0 (upon success) or an .B errno value (upon failure) in .IR *error . .PP .B DAC_get_name() fetches an information string for a D/A device. The chip number must be passed in .IR chip . The destination buffer address must be passed in .I *name and the destination buffer size must be passed in .IR namesize . The minimum size for the destination buffer is 16 bytes. .PP .B DAC_open() opens a D/A output channel device. The D/A chip number must be passed in the .I chip parameter and the D/A output channel number must be passed in the .I channel parameter. Upon success, a file descriptor for the D/A output channel device is returned in .IR *fd . .PP .B DAC_close() closes a previously opened D/A output channel device. .PP .B 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 .I fd parameter. The analog sample data must be passed in the .I sample parameter. .SH SEE ALSO .BR libsimpleio "(2), " libadc "(2), " libevent "(2), " libgpio "(2), " libhidraw "(2)," .br .BR libi2c "(2), " libipv4 "(2), " liblinux "(2), " liblinx "(2), " libpwm "(2)," .br .BR libserial "(2), " libspi "(2), " libstream "(2), " libwatchdog "(2)" .PP .B https://wiki.analog.com/software/linux/docs/iio/iio .SH AUTHOR Philip Munts dba Munts Technologies.