Private
Public Access
2
0

gpio: modified api to include close.

Add file descriptor to gpio_t

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
This commit is contained in:
Thomas Ingleby
2014-04-11 09:05:04 +01:00
parent e59b8b2038
commit 5168538894
2 changed files with 4 additions and 1 deletions

View File

@@ -23,6 +23,8 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
@@ -32,6 +34,7 @@ typedef struct gpio_struct
int pin;
int pinMap;
char path[64];
FILE *value_fp;
} gpio_t;
typedef char gpio_mode_t[16];
@@ -42,6 +45,7 @@ int gpio_set(int pin);
void gpio_mode(gpio_t *gpio, gpio_mode_t mode);
void gpio_dir(gpio_t *gpio, gpio_dir_t dir);
void gpio_close(gpio_t *gpio);
int gpio_read(gpio_t *gpio);
void gpio_write(gpio_t *gpio, int value);