Linux Kernel
3.7.1
|
#include <linux/err.h>
#include <linux/export.h>
#include <linux/slab.h>
#include <linux/mutex.h>
#include <linux/iio/iio.h>
#include "iio_core.h"
#include <linux/iio/machine.h>
#include <linux/iio/driver.h>
#include <linux/iio/consumer.h>
Go to the source code of this file.
Data Structures | |
struct | iio_map_internal |
EXPORT_SYMBOL_GPL | ( | iio_map_array_register | ) |
EXPORT_SYMBOL_GPL | ( | iio_map_array_unregister | ) |
EXPORT_SYMBOL_GPL | ( | iio_channel_get | ) |
EXPORT_SYMBOL_GPL | ( | iio_channel_release | ) |
EXPORT_SYMBOL_GPL | ( | iio_channel_get_all | ) |
EXPORT_SYMBOL_GPL | ( | iio_channel_release_all | ) |
EXPORT_SYMBOL_GPL | ( | iio_read_channel_raw | ) |
EXPORT_SYMBOL_GPL | ( | iio_convert_raw_to_processed | ) |
EXPORT_SYMBOL_GPL | ( | iio_read_channel_processed | ) |
EXPORT_SYMBOL_GPL | ( | iio_read_channel_scale | ) |
EXPORT_SYMBOL_GPL | ( | iio_get_channel_type | ) |
|
read |
void iio_channel_release | ( | struct iio_channel * | chan | ) |
iio_channel_release() - release channels obtained via iio_channel_get : The channel to be released.
void iio_channel_release_all | ( | struct iio_channel * | chan | ) |
iio_channel_release_all() - reverse iio_channel_get_all : Array of channels to be released.
int iio_convert_raw_to_processed | ( | struct iio_channel * | chan, |
int | raw, | ||
int * | processed, | ||
unsigned int | scale | ||
) |
iio_convert_raw_to_processed() - Converts a raw value to a processed value : The channel being queried : The raw IIO to convert : The result of the conversion : Scale factor to apply during the conversion
Returns an error code or 0.
This function converts a raw value to processed value for a specific channel. A raw value is the device internal representation of a sample and the value returned by iio_read_channel_raw, so the unit of that value is device depended. A processed value on the other hand is value has a normed unit according with the IIO specification.
The scale factor allows to increase the precession of the returned value. For a scale factor of 1 the function will return the result in the normal IIO unit for the channel type. E.g. millivolt for voltage channels, if you want nanovolts instead pass 1000 as the scale factor.
int iio_get_channel_type | ( | struct iio_channel * | channel, |
enum iio_chan_type * | type | ||
) |
iio_map_array_register() - tell the core about inkernel consumers : provider device : array of mappings specifying association of channel with client
iio_map_array_unregister() - tell the core to remove consumer mappings : provider device : array of mappings to remove. Note these must have same memory addresses as those originally added not just equal parameter values.
int iio_read_channel_processed | ( | struct iio_channel * | chan, |
int * | val | ||
) |
iio_read_channel_processed() - read processed value from a given channel : The channel being queried. : Value read back.
Returns an error code or 0.
This function will read a processed value from a channel. A processed value means that this value will have the correct unit and not some device internal representation. If the device does not support reporting a processed value the function will query the raw value and the channels scale and offset and do the appropriate transformation.
int iio_read_channel_raw | ( | struct iio_channel * | chan, |
int * | val | ||
) |
iio_read_channel_raw() - read from a given channel : The channel being queried. : Value read back.
Note raw reads from iio channels are in adc counts and hence scale will need to be applied if standard units required.
int iio_read_channel_scale | ( | struct iio_channel * | chan, |
int * | val, | ||
int * | val2 | ||
) |
iio_read_channel_scale() - read the scale value for a channel : The channel being queried. : First part of value read back. : Second part of value read back.
Note returns a description of what is in val and val2, such as IIO_VAL_INT_PLUS_MICRO telling us we have a value of val