My Project
gpio.h
1 /*
2  * gpio.h
3  *
4  * Created on: Jan 25, 2016
5  * Author: jordi
6  */
7 
8 #ifndef GPIO_H_
9 #define GPIO_H_
10 
11 #include "LPC17xx.h"
12 #include "stdint.h"
13 
14 #define GPIO_LOW 0
15 #define GPIO_HIGH 1
16 
17 
18 
19 typedef enum gpio_mode_operations{
20  GPIO_OUT,
21  GPIO_IN, // not supported yet
22  // add all modes
23 } gpio_mode_operation;
24 
25 
26 typedef enum gipo_errors{
27  GPIO_NON_ERROR,
28  GPIO_ERROR_NOT_SUPPORTED
29 } gipo_error;
30 
31 
32 // todo:jbec: support all ports
33 // todo:jbec: support all modes
40 gipo_error Gpio_config(uint8_t pad, gpio_mode_operation mode);
41 
48 void Gpio_set(uint8_t pad, uint8_t val);
49 
50 
51 
52 #endif /* GPIO_H_ */