libiio  0.19
Library for interfacing with IIO devices
sort.h
1 /*
2  * libiio - Library for interfacing industrial I/O (IIO) devices
3  *
4  * Copyright (C) 2018 Analog Devices, Inc.
5  * Author: Robin Getz <robin.getz@analog.com>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * */
18 
19 #ifndef __IIO_QSORT_H__
20 #define __IIO_QSORT_H__
21 
22 int iio_channel_compare(const void *p1, const void *p2);
23 int iio_channel_attr_compare(const void *p1, const void *p2);
24 int iio_device_compare(const void *p1, const void *p2);
25 int iio_device_attr_compare(const void *p1, const void *p2);
26 int iio_buffer_attr_compare(const void *p1, const void *p2);
27 
28 #endif /* __IIO_QSORT_H__ */
iio_device_reg_read
int iio_device_reg_read(struct iio_device *dev, uint32_t address, uint32_t *value)
Get the value of a hardware register.
Definition: device.c:896
iio_channel_convert_inverse
void iio_channel_convert_inverse(const struct iio_channel *chn, void *dst, const void *src)
Convert the sample from host format to hardware format.
Definition: channel.c:562
iio_device_debug_attr_read_all
__api int iio_device_debug_attr_read_all(struct iio_device *dev, int(*cb)(struct iio_device *dev, const char *attr, const char *value, size_t len, void *d), void *data)
Read the content of all debug attributes.
iio_buffer_end
void * iio_buffer_end(const struct iio_buffer *buffer)
Get the address that follows the last sample in a buffer.
Definition: buffer.c:298
iio_channel
Represents an input or output channel of a device.
iio_buffer_foreach_sample
__api ssize_t iio_buffer_foreach_sample(struct iio_buffer *buf, ssize_t(*callback)(const struct iio_channel *chn, void *src, size_t bytes, void *d), void *data)
Call the supplied callback for each sample found in a buffer.
iio_device_debug_attr_write
ssize_t iio_device_debug_attr_write(const struct iio_device *dev, const char *attr, const char *src)
Set the value of the given debug attribute.
Definition: device.c:748
iio_context_get_attr_value
const char * iio_context_get_attr_value(const struct iio_context *ctx, const char *name)
Retrieve the value of a context-specific attribute.
Definition: context.c:391
iio_context_info
The information related to a discovered context.
iio_device_get_data
void * iio_device_get_data(const struct iio_device *dev)
Retrieve a previously associated pointer of an iio_device structure.
Definition: device.c:458
iio_channel_get_data
void * iio_channel_get_data(const struct iio_channel *chn)
Retrieve a previously associated pointer of an iio_channel structure.
Definition: channel.c:383
iio_channel_set_data
void iio_channel_set_data(struct iio_channel *chn, void *data)
Associate a pointer to an iio_channel structure.
Definition: channel.c:378
iio_create_scan_context
struct iio_scan_context * iio_create_scan_context(const char *backend, unsigned int flags)
Create a scan context.
Definition: scan.c:125
iio_buffer_step
ptrdiff_t iio_buffer_step(const struct iio_buffer *buffer)
Get the step size between two samples of one channel.
Definition: buffer.c:293
iio_device_debug_attr_write_longlong
int iio_device_debug_attr_write_longlong(const struct iio_device *dev, const char *attr, long long val)
Set the value of the given debug attribute.
Definition: device.c:807
iio_device_debug_attr_write_all
int iio_device_debug_attr_write_all(struct iio_device *dev, ssize_t(*cb)(struct iio_device *dev, const char *attr, void *buf, size_t len, void *d), void *data)
Set the values of all debug attributes.
Definition: device.c:1124
iio_device_attr_read
ssize_t iio_device_attr_read(const struct iio_device *dev, const char *attr, char *dst, size_t len)
Read the content of the given device-specific attribute.
Definition: device.c:401
iio_channel_is_output
bool iio_channel_is_output(const struct iio_channel *chn)
Return True if the given channel is an output channel.
Definition: channel.c:306
iio_channel_write
size_t iio_channel_write(const struct iio_channel *chn, struct iio_buffer *buf, const void *src, size_t len)
Convert and multiplex the samples of a given channel.
Definition: channel.c:641
iio_channel_read
size_t iio_channel_read(const struct iio_channel *chn, struct iio_buffer *buf, void *dst, size_t len)
Demultiplex and convert the samples of a given channel.
Definition: channel.c:610
iio_context_info_get_uri
const char * iio_context_info_get_uri(const struct iio_context_info *info)
Get the URI of a discovered context.
Definition: scan.c:38
iio_create_network_context
struct iio_context * iio_create_network_context(const char *hostname)
Create a context from the network.
Definition: context.c:343
iio_channel_attr_read
ssize_t iio_channel_attr_read(const struct iio_channel *chn, const char *attr, char *dst, size_t len)
Read the content of the given channel-specific attribute.
Definition: channel.c:352
iio_context_info_list_free
void iio_context_info_list_free(struct iio_context_info **list)
Free a context info list.
Definition: scan.c:76
iio_channel_get_index
long iio_channel_get_index(const struct iio_channel *chn)
Get the index of the given channel.
Definition: channel.c:388
iio_channel_get_device
const struct iio_device * iio_channel_get_device(const struct iio_channel *chn)
Retrieve a pointer to the iio_device structure.
Definition: channel.c:842
iio_device_debug_attr_read_longlong
int iio_device_debug_attr_read_longlong(const struct iio_device *dev, const char *attr, long long *val)
Read the content of the given debug attribute.
Definition: device.c:768
iio_context_info_get_description
const char * iio_context_info_get_description(const struct iio_context_info *info)
Get a description of a discovered context.
Definition: scan.c:32
iio_buffer
An input or output buffer, used to read or write samples.
iio_device_debug_attr_read_bool
int iio_device_debug_attr_read_bool(const struct iio_device *dev, const char *attr, bool *val)
Read the content of the given debug attribute.
Definition: device.c:784
iio_device_reg_write
int iio_device_reg_write(struct iio_device *dev, uint32_t address, uint32_t value)
Set the value of a hardware register.
Definition: device.c:883
iio_device_get_debug_attr
const char * iio_device_get_debug_attr(const struct iio_device *dev, unsigned int index)
Get the debug attribute present at the given index.
Definition: device.c:759
iio_device_set_data
void iio_device_set_data(struct iio_device *dev, void *data)
Associate a pointer to an iio_device structure.
Definition: device.c:453
iio_channel_is_enabled
bool iio_channel_is_enabled(const struct iio_channel *chn)
Returns True if the channel is enabled.
Definition: channel.c:399
iio_context_get_device
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
iio_channel_write_raw
size_t iio_channel_write_raw(const struct iio_channel *chn, struct iio_buffer *buf, const void *src, size_t len)
Multiplex the samples of a given channel.
Definition: channel.c:626
iio_channel_read_raw
size_t iio_channel_read_raw(const struct iio_channel *chn, struct iio_buffer *buf, void *dst, size_t len)
Demultiplex the samples of a given channel.
Definition: channel.c:595
iio_context_destroy
void iio_context_destroy(struct iio_context *ctx)
Destroy the given context.
Definition: context.c:151
iio_context_get_devices_count
unsigned int iio_context_get_devices_count(const struct iio_context *ctx)
Enumerate the devices found in the given context.
Definition: context.c:176
iio_scan_context_destroy
void iio_scan_context_destroy(struct iio_scan_context *ctx)
Destroy the given scan context.
Definition: scan.c:153
iio_device_get_context
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
iio_device_get_debug_attrs_count
unsigned int iio_device_get_debug_attrs_count(const struct iio_device *dev)
Enumerate the debug attributes of the given device.
Definition: device.c:754
iio_device_debug_attr_read
ssize_t iio_device_debug_attr_read(const struct iio_device *dev, const char *attr, char *dst, size_t len)
Read the content of the given debug attribute.
Definition: device.c:728
iio_channel_is_scan_element
bool iio_channel_is_scan_element(const struct iio_channel *chn)
Return True if the given channel is a scan element.
Definition: channel.c:311
iio_buffer_push
ssize_t iio_buffer_push(struct iio_buffer *buffer)
Send the samples to the hardware.
Definition: buffer.c:152
iio_context
Contains the representation of an IIO context.
iio_strerror
__api void iio_strerror(int err, char *dst, size_t len)
Get a string description of an error code.
Definition: utilities.c:188
iio_buffer_first
void * iio_buffer_first(const struct iio_buffer *buffer, const struct iio_channel *chn)
Find the first sample of a channel in a buffer.
Definition: buffer.c:255
iio_device
Represents a device in the IIO context.
iio_device_debug_attr_write_bool
int iio_device_debug_attr_write_bool(const struct iio_device *dev, const char *attr, bool val)
Set the value of the given debug attribute.
Definition: device.c:831
iio_device_debug_attr_read_double
int iio_device_debug_attr_read_double(const struct iio_device *dev, const char *attr, double *val)
Read the content of the given debug attribute.
Definition: device.c:796
iio_device_get_sample_size
ssize_t iio_device_get_sample_size(const struct iio_device *dev)
Get the current sample size.
Definition: device.c:571
iio_device_find_debug_attr
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
iio_library_get_version
__api void iio_library_get_version(unsigned int *major, unsigned int *minor, char git_tag[8])
Get the version of the libiio library.
Definition: utilities.c:175
iio_channel_convert
void iio_channel_convert(const struct iio_channel *chn, void *dst, const void *src)
Convert the sample from hardware format to host format.
Definition: channel.c:526
iio_context_find_device
struct iio_device * iio_context_find_device(const struct iio_context *ctx, const char *name)
Try to find a device structure by its name of ID.
Definition: context.c:190
iio_device_debug_attr_write_double
int iio_device_debug_attr_write_double(const struct iio_device *dev, const char *attr, double val)
Set the value of the given debug attribute.
Definition: device.c:819
iio_scan_context_get_info_list
ssize_t iio_scan_context_get_info_list(struct iio_scan_context *ctx, struct iio_context_info ***info)
Enumerate available contexts.
Definition: scan.c:44