2 * Copyright (c) 2016-2017 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 #define SYSFS_GPIO_DIR "/sys/class/gpio"
21 #define GPIO_BUFFER_MAX 64
24 GPIO_DIRECTION_IN = 0,
25 GPIO_DIRECTION_OUT_HIGH = 1,
26 GPIO_DIRECTION_OUT_LOW = 2,
32 GPIO_EDGE_FALLING = 2,
36 int gpio_open(int gpiopin);
37 int gpio_close(int gpiopin);
38 int gpio_set_edge_mode(int gpiopin, gpio_edge_e edge);
39 int gpio_get_edge_mode(int gpiopin, gpio_edge_e *edge);
40 int gpio_set_direction(int gpiopin, gpio_direction_e dir);
41 int gpio_get_direction(int gpiopin, gpio_direction_e *dir);
42 int gpio_write(int gpiopin, int value);
43 int gpio_read(int gpiopin, int *value);
45 int gpio_open_isr(int gpiopin);
46 int gpio_close_isr(int file_hndl);
47 int gpio_read_isr(void *fdset, char *rev_buf, int length);