-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgpioctl.c
50 lines (35 loc) · 1013 Bytes
/
gpioctl.c
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
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include "gpioctl.h"
int get_chipinfo(int fd, struct gpiochip_info* info){
int status;
status = ioctl(fd, GPIO_GET_CHIPINFO_IOCTL, info);
return status;
};
int get_lineinfo(int fd, struct gpioline_info *info) {
int status;
status = ioctl(fd, GPIO_GET_LINEINFO_IOCTL, info);
return status;
};
int get_linehandle(int fd, struct gpiohandle_request *req) {
int status;
status = ioctl(fd, GPIO_GET_LINEHANDLE_IOCTL, req);
return status;
};
int get_lineevent(int fd, struct gpioevent_request *req) {
int status;
status = ioctl(fd, GPIO_GET_LINEEVENT_IOCTL, req);
return status;
};
int get_line_values(int fd, struct gpiohandle_data *data) {
int status;
status = ioctl(fd, GPIOHANDLE_GET_LINE_VALUES_IOCTL, data);
return status;
};
int set_line_values(int fd, struct gpiohandle_data *data) {
int status;
status = ioctl(fd, GPIOHANDLE_SET_LINE_VALUES_IOCTL, data);
return status;
};