ioctl-gpio-int.h
2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
/*-----------------------------------------------------------------------------
파 일 : gpio-int.h
설 명 : gpio 인터럽트를 활성화 하고 인터럽트 발생을 app 에 알려주는 드라이버
작 성 : freefrug@falinux.com
날 짜 : 2010-03 ~
주 의 :
-------------------------------------------------------------------------------*/
#ifndef _GPIO_INT_H_
#define _GPIO_INT_H_
/* 모듈관련 -------------------------------------------------------------------*/
#define GPIO_INT_DRIVER_MAJOR 202
#ifdef MODULE
#endif
/* ioctl 함수의 command -------------------------------------------------------*/
#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_