8c2952457
김태훈
응용 프로그램 추가
|
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
#define GPIO_INT_DRIVER_MAJOR_KEY 'g'
#define IOCTL_REGISTER_GPIO_INT _IOW( GPIO_INT_DRIVER_MAJOR_KEY, 0 , ioctl_arg_gpio_int_info_t )
#define IOCTL_UNREGISTER_GPIO_INT _IOW( GPIO_INT_DRIVER_MAJOR_KEY, 1 , gpdesc_t )
#define IOCTL_ENABLE_EVENT _IOW( GPIO_INT_DRIVER_MAJOR_KEY, 2 , gpdesc_t )
#define IOCTL_DISABLE_EVENT _IOW( GPIO_INT_DRIVER_MAJOR_KEY, 3 , gpdesc_t )
#define IOCTL_WAIT_EVENT _IOR( GPIO_INT_DRIVER_MAJOR_KEY, 10, gpdesc_t )
#define IOCTL_WAIT_EVENT_TIMEOUT _IOR( GPIO_INT_DRIVER_MAJOR_KEY, 11, ioctl_arg_gpio_wait_timeout_t )
#define IOCTL_NOWAIT_EVENT _IOR( GPIO_INT_DRIVER_MAJOR_KEY, 12, gpdesc_t )
#define IOCTL_CLEAR_EVENT _IOW( GPIO_INT_DRIVER_MAJOR_KEY, 13, gpdesc_t )
enum {
GPIO_INT_FALLING = 0,
GPIO_INT_RAISING = 1,
};
enum {
GPIO_PULL_NONE = 0,
GPIO_PULL_UP = 1,
GPIO_PULL_DOWN = 2,
};
#define MAKE_GPDESC( g, n ) ( ((g )<<24) | (n) )
#define GPDESC_TO_GRP( gd ) ( ((gd)>>24) & 0xff )
#define GPDESC_TO_NR( gd ) ( (gd) & 0xffff )
typedef unsigned int gpdesc_t;
typedef struct {
gpdesc_t gpdesc;
int pull_updn;
int edge_type;
} ioctl_arg_gpio_int_info_t;
typedef struct {
gpdesc_t gpdesc;
int msec;
} ioctl_arg_gpio_wait_timeout_t;
#endif // _GPIO_INT_H_
|