libiio
0.18
Library for interfacing with IIO devices
|
19 #ifndef _IIOD_CLIENT_H
20 #define _IIOD_CLIENT_H
22 #include "iio-private.h"
26 struct iio_context_pdata;
28 struct iiod_client_ops {
29 ssize_t (*write)(
struct iio_context_pdata *pdata,
30 void *desc,
const char *src,
size_t len);
31 ssize_t (*read)(
struct iio_context_pdata *pdata,
32 void *desc,
char *dst,
size_t len);
33 ssize_t (*read_line)(
struct iio_context_pdata *pdata,
34 void *desc,
char *dst,
size_t len);
37 struct iiod_client * iiod_client_new(
struct iio_context_pdata *pdata,
38 struct iio_mutex *lock,
const struct iiod_client_ops *ops);
39 void iiod_client_destroy(
struct iiod_client *client);
41 int iiod_client_get_version(
struct iiod_client *client,
void *desc,
42 unsigned int *major,
unsigned int *minor,
char *git_tag);
43 int iiod_client_get_trigger(
struct iiod_client *client,
void *desc,
46 int iiod_client_set_trigger(
struct iiod_client *client,
void *desc,
48 int iiod_client_set_kernel_buffers_count(
struct iiod_client *client,
49 void *desc,
const struct iio_device *dev,
unsigned int nb_blocks);
50 int iiod_client_set_timeout(
struct iiod_client *client,
51 void *desc,
unsigned int timeout);
52 ssize_t iiod_client_read_attr(
struct iiod_client *client,
void *desc,
54 const char *attr,
char *dest,
size_t len,
enum iio_attr_type type);
55 ssize_t iiod_client_write_attr(
struct iiod_client *client,
void *desc,
57 const char *attr,
const char *src,
size_t len,
enum iio_attr_type type);
58 int iiod_client_open_unlocked(
struct iiod_client *client,
void *desc,
59 const struct iio_device *dev,
size_t samples_count,
61 int iiod_client_close_unlocked(
struct iiod_client *client,
void *desc,
63 ssize_t iiod_client_read_unlocked(
struct iiod_client *client,
void *desc,
64 const struct iio_device *dev,
void *dst,
size_t len,
65 uint32_t *mask,
size_t words);
66 ssize_t iiod_client_write_unlocked(
struct iiod_client *client,
void *desc,
67 const struct iio_device *dev,
const void *src,
size_t len);
69 struct iiod_client *client,
void *desc);
unsigned int iio_device_get_channels_count(const struct iio_device *dev)
Enumerate the channels of the given device.
Definition: device.c:235
Represents an input or output channel of a device.
const char * iio_device_find_buffer_attr(const struct iio_device *dev, const char *name)
Try to find a buffer-specific attribute by its name.
Definition: device.c:305
const char * iio_device_find_attr(const struct iio_device *dev, const char *name)
Try to find a device-specific attribute by its name.
Definition: device.c:279
const char * iio_device_get_name(const struct iio_device *dev)
Retrieve the device name (e.g. xadc)
Definition: device.c:230
bool iio_channel_is_output(const struct iio_channel *chn)
Return True if the given channel is an output channel.
Definition: channel.c:305
struct iio_device * iio_context_get_device(const struct iio_context *ctx, unsigned int index)
Get the device present at the given index.
Definition: context.c:181
struct iio_context * iio_create_xml_context_mem(const char *xml, size_t len)
Create a context from XML data in memory.
Definition: context.c:353
unsigned int iio_context_get_devices_count(const struct iio_context *ctx)
Enumerate the devices found in the given context.
Definition: context.c:176
const struct iio_context * iio_device_get_context(const struct iio_device *dev)
Retrieve a pointer to the iio_context structure.
Definition: device.c:1148
const char * iio_channel_find_attr(const struct iio_channel *chn, const char *name)
Try to find a channel-specific attribute by its name.
Definition: channel.c:339
const char * iio_device_get_id(const struct iio_device *dev)
Retrieve the device ID (e.g. iio:device0)
Definition: device.c:225
Contains the representation of an IIO context.
Represents a device in the IIO context.
bool iio_device_is_trigger(const struct iio_device *dev)
Return True if the given device is a trigger.
Definition: device.c:463
const char * iio_channel_get_id(const struct iio_channel *chn)
Retrieve the channel ID (e.g. voltage0)
Definition: channel.c:295
const char * iio_device_find_debug_attr(const struct iio_device *dev, const char *name)
Try to find a debug attribute by its name.
Definition: device.c:317