Go to the documentation of this file.
10 #define _IIO_EVENTS_H_
13 #include <linux/types.h>
27 #define IIO_GET_EVENT_FD_IOCTL _IOR('i', 0x90, int)
55 #define IIO_EVENT_CODE(chan_type, diff, modifier, direction, \
56 type, chan, chan1, chan2) \
57 (((u64)type << 56) | ((u64)diff << 55) | \
58 ((u64)direction << 48) | ((u64)modifier << 40) | \
59 ((u64)chan_type << 32) | (((u16)chan2) << 16) | ((u16)chan1) | \
63 #define IIO_EV_DIR_MAX 4
64 #define IIO_EV_BIT(type, direction) \
65 (1 << (type*IIO_EV_DIR_MAX + direction))
76 #define IIO_MOD_EVENT_CODE(chan_type, number, modifier, \
78 IIO_EVENT_CODE(chan_type, 0, modifier, direction, type, number, 0, 0)
88 #define IIO_UNMOD_EVENT_CODE(chan_type, number, type, direction) \
89 IIO_EVENT_CODE(chan_type, 0, 0, direction, type, number, 0, 0)
91 #define IIO_EVENT_CODE_EXTRACT_TYPE(mask) ((mask >> 56) & 0xFF)
93 #define IIO_EVENT_CODE_EXTRACT_DIR(mask) ((mask >> 48) & 0xCF)
95 #define IIO_EVENT_CODE_EXTRACT_CHAN_TYPE(mask) ((mask >> 32) & 0xFF)
99 #define IIO_EVENT_CODE_EXTRACT_CHAN(mask) ((__s16)(mask & 0xFFFF))
100 #define IIO_EVENT_CODE_EXTRACT_CHAN2(mask) ((__s16)(((mask) >> 16) & 0xFFFF))
102 #define IIO_EVENT_CODE_EXTRACT_MODIFIER(mask) ((mask >> 40) & 0xFF)
103 #define IIO_EVENT_CODE_EXTRACT_DIFF(mask) (((mask) >> 55) & 0x1)