Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations
events.h File Reference
#include <linux/ioctl.h>
#include <linux/types.h>
#include <linux/iio/types.h>

Go to the source code of this file.

Data Structures

struct  iio_event_data
 

Macros

#define IIO_GET_EVENT_FD_IOCTL   _IOR('i', 0x90, int)
 
#define IIO_EVENT_CODE(chan_type, diff, modifier, direction,type, chan, chan1, chan2)
 
#define IIO_EV_DIR_MAX   4
 
#define IIO_EV_BIT(type, direction)   (1 << (type*IIO_EV_DIR_MAX + direction))
 
#define IIO_MOD_EVENT_CODE(chan_type, number, modifier,type, direction)   IIO_EVENT_CODE(chan_type, 0, modifier, direction, type, number, 0, 0)
 
#define IIO_UNMOD_EVENT_CODE(chan_type, number, type, direction)   IIO_EVENT_CODE(chan_type, 0, 0, direction, type, number, 0, 0)
 
#define IIO_EVENT_CODE_EXTRACT_TYPE(mask)   ((mask >> 56) & 0xFF)
 
#define IIO_EVENT_CODE_EXTRACT_DIR(mask)   ((mask >> 48) & 0xCF)
 
#define IIO_EVENT_CODE_EXTRACT_CHAN_TYPE(mask)   ((mask >> 32) & 0xFF)
 
#define IIO_EVENT_CODE_EXTRACT_CHAN(mask)   ((__s16)(mask & 0xFFFF))
 
#define IIO_EVENT_CODE_EXTRACT_CHAN2(mask)   ((__s16)(((mask) >> 16) & 0xFFFF))
 
#define IIO_EVENT_CODE_EXTRACT_MODIFIER(mask)   ((mask >> 40) & 0xFF)
 
#define IIO_EVENT_CODE_EXTRACT_DIFF(mask)   (((mask) >> 55) & 0x1)
 

Enumerations

enum  iio_event_type {
  IIO_EV_TYPE_THRESH, IIO_EV_TYPE_MAG, IIO_EV_TYPE_ROC, IIO_EV_TYPE_THRESH_ADAPTIVE,
  IIO_EV_TYPE_MAG_ADAPTIVE
}
 
enum  iio_event_direction { IIO_EV_DIR_EITHER, IIO_EV_DIR_RISING, IIO_EV_DIR_FALLING }
 

Macro Definition Documentation

#define IIO_EV_BIT (   type,
  direction 
)    (1 << (type*IIO_EV_DIR_MAX + direction))

Definition at line 64 of file events.h.

#define IIO_EV_DIR_MAX   4

Definition at line 63 of file events.h.

#define IIO_EVENT_CODE (   chan_type,
  diff,
  modifier,
  direction,
  type,
  chan,
  chan1,
  chan2 
)
Value:
(((u64)type << 56) | ((u64)diff << 55) | \
((u64)direction << 48) | ((u64)modifier << 40) | \
((u64)chan_type << 32) | (((u16)chan2) << 16) | ((u16)chan1) | \
((u16)chan))

IIO_EVENT_CODE() - create event identifier : Type of the channel. Should be one of enum iio_chan_type. : Whether the event is for an differential channel or not. : Modifier for the channel. Should be one of enum iio_modifier. : Direction of the event. One of enum iio_event_direction. : Type of the event. Should be one of enum iio_event_type. : Channel number for non-differential channels. : First channel number for differential channels. : Second channel number for differential channels.

Definition at line 55 of file events.h.

#define IIO_EVENT_CODE_EXTRACT_CHAN (   mask)    ((__s16)(mask & 0xFFFF))

Definition at line 99 of file events.h.

#define IIO_EVENT_CODE_EXTRACT_CHAN2 (   mask)    ((__s16)(((mask) >> 16) & 0xFFFF))

Definition at line 100 of file events.h.

#define IIO_EVENT_CODE_EXTRACT_CHAN_TYPE (   mask)    ((mask >> 32) & 0xFF)

Definition at line 95 of file events.h.

#define IIO_EVENT_CODE_EXTRACT_DIFF (   mask)    (((mask) >> 55) & 0x1)

Definition at line 103 of file events.h.

#define IIO_EVENT_CODE_EXTRACT_DIR (   mask)    ((mask >> 48) & 0xCF)

Definition at line 93 of file events.h.

#define IIO_EVENT_CODE_EXTRACT_MODIFIER (   mask)    ((mask >> 40) & 0xFF)

Definition at line 102 of file events.h.

#define IIO_EVENT_CODE_EXTRACT_TYPE (   mask)    ((mask >> 56) & 0xFF)

Definition at line 91 of file events.h.

#define IIO_GET_EVENT_FD_IOCTL   _IOR('i', 0x90, int)

Definition at line 27 of file events.h.

#define IIO_MOD_EVENT_CODE (   chan_type,
  number,
  modifier,
  type,
  direction 
)    IIO_EVENT_CODE(chan_type, 0, modifier, direction, type, number, 0, 0)

IIO_MOD_EVENT_CODE() - create event identifier for modified channels : Type of the channel. Should be one of enum iio_chan_type. : Channel number. : Modifier for the channel. Should be one of enum iio_modifier. : Type of the event. Should be one of enum iio_event_type. : Direction of the event. One of enum iio_event_direction.

Definition at line 76 of file events.h.

#define IIO_UNMOD_EVENT_CODE (   chan_type,
  number,
  type,
  direction 
)    IIO_EVENT_CODE(chan_type, 0, 0, direction, type, number, 0, 0)

IIO_UNMOD_EVENT_CODE() - create event identifier for unmodified channels : Type of the channel. Should be one of enum iio_chan_type. : Channel number. : Type of the event. Should be one of enum iio_event_type. : Direction of the event. One of enum iio_event_direction.

Definition at line 88 of file events.h.

Enumeration Type Documentation

Enumerator:
IIO_EV_DIR_EITHER 
IIO_EV_DIR_RISING 
IIO_EV_DIR_FALLING 

Definition at line 37 of file events.h.

Enumerator:
IIO_EV_TYPE_THRESH 
IIO_EV_TYPE_MAG 
IIO_EV_TYPE_ROC 
IIO_EV_TYPE_THRESH_ADAPTIVE 
IIO_EV_TYPE_MAG_ADAPTIVE 

Definition at line 29 of file events.h.