22 #include <sol-common-buildopts.h>
24 #include <linux/limits.h>
73 #ifndef SOL_NO_API_VERSION
74 #define SOL_IIO_CONFIG_API_VERSION (2)
91 #ifndef SOL_NO_API_VERSION
92 #define SOL_IIO_CHANNEL_CONFIG_API_VERSION (1)
106 #define SOL_IIO_CHANNEL_CONFIG_INIT { \
107 SOL_SET_API_VERSION(.api_version = SOL_IIO_CHANNEL_CONFIG_API_VERSION, ) \
108 .scale = -1.0, .offset = 0, .use_custom_offset = false }
void sol_iio_close(struct sol_iio_device *device)
Close an IIO device.
struct sol_str_slice sol_iio_read_channel_raw_buffer(struct sol_iio_channel *channel)
Returns raw buffer with channel sample.
struct sol_iio_device * sol_iio_open(int id, const struct sol_iio_config *config)
Open an IIO device.
int sol_iio_device_get_sampling_frequency(const struct sol_iio_device *device, const char *prefix_name, int *sampling_frequency)
Gets the configuration sampling_frequency attribute from one device.
int sol_iio_device_trigger(struct sol_iio_device *device)
Manually 'pull' device current trigger.
int offset
Channel offset, to be added to raw readings.
Definition: sol-iio.h:96
int sol_iio_address_device(const char *commands)
Address an IIO device from a list of commands to find them.
A configuration struct for an IIO device.
Definition: sol-iio.h:72
void(* sol_iio_reader_cb)(void *data, struct sol_iio_device *device)
Callback to be called when get new device readings on buffer.
Definition: sol-iio.h:78
int sol_iio_device_get_offset(const struct sol_iio_device *device, const char *prefix_name, double *offset)
Gets the configuration offset attribute from one device.
bool use_custom_offset
If true, will use user defined offset on member offset of this struct.
Definition: sol-iio.h:97
static struct sol_buffer value
Definition: server.c:42
String slice type.
Definition: sol-str-slice.h:84
Data type to describe a direction vector.
Definition: sol-types.h:125
These are routines that Soletta provides for its buffer implementation.
uint16_t api_version
The API version.
Definition: sol-iio.h:93
int buffer_size
The size of reading buffer.
Definition: sol-iio.h:80
int sol_iio_device_start_buffer(struct sol_iio_device *device)
Start reading device buffer.
int sol_iio_mount_calibration(struct sol_iio_device *device, sol_direction_vector *value)
Perform the mount calibration.
struct sol_iio_channel_config sol_iio_channel_config
A configuration struct for an IIO channel.
const char * sol_iio_channel_get_name(const struct sol_iio_channel *channel)
Gets the configuration attribute name of a channel.
struct sol_iio_config sol_iio_config
A configuration struct for an IIO device.
int sol_iio_read_channel_value(struct sol_iio_channel *channel, double *value)
Read channel value.
const char * trigger_name
Name of IIO trigger to be used on this device.
Definition: sol-iio.h:77
struct sol_iio_channel * sol_iio_add_channel(struct sol_iio_device *device, const char *name, const struct sol_iio_channel_config *config)
Add reading channel.
int sampling_frequency
Device sampling frequency.
Definition: sol-iio.h:81
A configuration struct for an IIO channel.
Definition: sol-iio.h:90
double scale
Channel scale, to be applied to raw readings.
Definition: sol-iio.h:95
uint16_t api_version
The API version.
Definition: sol-iio.h:75
const void * data
User defined data to be sent to sol_iio_reader_cb.
Definition: sol-iio.h:79
struct sol_iio_channel sol_iio_channel
An IIO channel handle.
Definition: sol-iio.h:65
struct sol_iio_device sol_iio_device
An IIO device handle.
Definition: sol-iio.h:53
int sol_iio_device_get_scale(const struct sol_iio_device *device, const char *prefix_name, double *scale)
Gets the configuration scale attribute from one device.
char sampling_frequency_name[NAME_MAX]
Sampling frequency sysfs node name.
Definition: sol-iio.h:82