libadc

Section: Linux Simple I/O Library (2)
Updated: 21 December 2018
Index Return to Main Contents
 

NAME

libadc -- Linux Simple I/O Library: A/D Input Module  

SYNOPSIS

#include <libsimpleio/libadc.h>

void ADC_get_name(int32_t chip, char *name, int32_t namesize,
  int32_t *error);

void ADC_open(int32_t chip, int32_t channel, int32_t *fd,
  int32_t *error);

void ADC_close(int32_t fd, int32_t *error);

void ADC_read(int32_t fd, int32_t *sample, int32_t *error);

Link with -lsimpleio.  

DESCRIPTION

All functions return either 0 (upon success) or an errno value (upon failure) in *error.

ADC_get_name() fetches an information string for an A/D 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.

ADC_open() opens an A/D input channel device. The A/D chip number must be passed in the chip parameter and the A/D input channel number must be passed in the channel parameter. Upon success, a file descriptor for the A/D input channel device is returned in *fd.

ADC_close() closes a previously opened A/D input channel device.

ADC_read() reads a sample from an A/D input channel device. The file descriptor for an open A/D input channel device must be passed in the fd parameter. The analog sample data will be returned in the *sample parameter.  

SEE ALSO

libsimpleio(2), libdac(2), libevent(2), libgpio(2), libhidraw(2),
libi2c(2), libipv4(2), liblinux(2), liblinx(2), libpwm(2),
libserial(2), libspi(2), libstream(2), libwatchdog(2)

https://wiki.analog.com/software/linux/docs/iio/iio  

AUTHOR

Philip Munts dba Munts Technologies


 

Index

NAME
SYNOPSIS
DESCRIPTION
SEE ALSO
AUTHOR

This document was created by man2html, using the manual pages.
Time: 03:28:51 GMT, October 30, 2023