Rleg  2
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
gpio_functions.h
Go to the documentation of this file.
1 /*
2 Author: Caio Gustavo Mesquita Ângelo
3 Rev 0 - 18/11/2012
4 RLEG project - 2012
5 
6 library of functions that handle Overo's GPIOs
7 */
8 #ifndef GPIO_FUNCTIONS_H_INCLUDED
9 #define GPIO_FUNCTIONS_H_INCLUDED
10 
11 #include <stdio.h>
12 #include <stdlib.h>
13 #include <string.h>
14 #include <stdint.h>
15 #include <sys/types.h>
16 
17 #define SUCCESS 1
18 #define FAILURE -1
19 
20 /* READ GPIO VALUE */
21 int gpio_read(uint8_t gpio);
22 /* Parameter
23 gpio: string number of GPIO (e.g. "186")
24 returns 0 or 1
25 */
26 
27 /* WRITE GPIO VALUE */
28 int gpio_write(uint8_t gpio, uint8_t value);
29 /* Parameters
30 gpio: string number of GPIO (e.g. "186")
31 value: 0 or 1
32 returns 1 if succeded or <0 if not
33 */
34 
35 /* (FAST/FORCE) WRITE GPIO VALUE WITHOUT VERIFYING DIRECTION */
36 int gpio_f_write(uint8_t gpio, uint8_t value);
37 /* Parameters
38 gpio: number of GPIO (e.g. 186)
39 value: 0 or 1
40 returns 1 if succeded
41 */
42 
43 #endif
int gpio_write(uint8_t gpio, uint8_t value)
int gpio_read(uint8_t gpio)
Definition: gpio_functions.c:3
int gpio_f_write(uint8_t gpio, uint8_t value)