Files
teathermotimerng/src/gpio.h
Wolfgang Hottgenroth 8ad6c780f7 change in new branch
2016-09-10 18:19:52 +02:00

68 lines
738 B
C

/*
* gpio.h
*
* Created on: 29.08.2016
* Author: wn
*/
#ifndef GPIO_H_
#define GPIO_H_
#include <msp430g2553.h>
#include <stdint.h>
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_ */