/* * gpio.h * * Created on: 29.08.2016 * Author: wn */ #ifndef GPIO_H_ #define GPIO_H_ #include #include typedef enum { PORT1, PORT2 } tPort; typedef enum { LOW, HIGH, } tPinState; typedef enum { PIN_OUT, PIN_IN, PIN_IN_PULLUP } tPinDirection; typedef struct { tPort portId; uint16_t bit; tPinDirection direction; tPinState defaultOut; } tPinCfg; typedef enum { PINS_FIRST, SEG_A = PINS_FIRST, SEG_B, SEG_C, SEG_D, SEG_E, SEG_F, SEG_G, DIGIT_0, DIGIT_1, BUTTON_1, LED_1, POWER, PINS_END } tPin; void gpioInitPins(); void gpioSetPin(tPin p, tPinState v); void gpioTogglePin(tPin p); tPinState gpioGetPin(tPin p); #endif /* GPIO_H_ */