Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Fields
iio_enum Struct Reference

#include <iio.h>

Data Fields

const char *constitems
 
unsigned int num_items
 
int(* set )(struct iio_dev *, const struct iio_chan_spec *, unsigned int)
 
int(* get )(struct iio_dev *, const struct iio_chan_spec *)
 

Detailed Description

struct iio_enum - Enum channel info attribute : An array of strings. : Length of the item array. : Set callback function, may be NULL. : Get callback function, may be NULL.

The iio_enum struct can be used to implement enum style channel attributes. Enum style attributes are those which have a set of strings which map to unsigned integer values. The IIO enum helper code takes care of mapping between value and string as well as generating a "_available" file which contains a list of all available items. The set callback will be called when the attribute is updated. The last parameter is the index to the newly activated item. The get callback will be used to query the currently active item and is supposed to return the index for it.

Definition at line 155 of file iio.h.

Field Documentation

Definition at line 159 of file iio.h.

const char* const* items

Definition at line 156 of file iio.h.

unsigned int num_items

Definition at line 157 of file iio.h.

int(* set)(struct iio_dev *, const struct iio_chan_spec *, unsigned int)

Definition at line 158 of file iio.h.


The documentation for this struct was generated from the following file: