ff3a79465d6692911990974dd0ee0af8c6364315
[platform/core/api/peripheral-io.git] / include / interface / peripheral_interface_gpio.h
1 /*
2  * Copyright (c) 2016-2017 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #ifndef __PERIPHERAL_INTERFACE_GPIO_H__
18 #define __PERIPHERAL_INTERFACE_GPIO_H__
19
20 #include "peripheral_interface_common.h"
21
22 #define SYSFS_GPIO_DIR "/sys/class/gpio"
23 #define GPIO_BUFFER_MAX 64
24
25 int peripheral_interface_gpio_close(peripheral_gpio_h gpio);
26 int peripheral_interface_gpio_set_edge_mode(peripheral_gpio_h gpio, peripheral_gpio_edge_e edge);
27 int peripheral_interface_gpio_set_direction(peripheral_gpio_h gpio, peripheral_gpio_direction_e direction);
28 int peripheral_interface_gpio_write(peripheral_gpio_h gpio, uint32_t value);
29 int peripheral_interface_gpio_read(peripheral_gpio_h gpio, uint32_t *value);
30
31 int peripheral_interface_gpio_open_isr(peripheral_gpio_h gpio);
32 int peripheral_interface_gpio_close_isr(peripheral_gpio_h gpio);
33
34 #endif/*__PERIPHERAL_INTERFACE_GPIO_H__*/