58 lines
557 B
C
58 lines
557 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 struct {
|
|
tPort portId;
|
|
uint16_t bit;
|
|
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,
|
|
TESTPIN1,
|
|
TESTPIN2,
|
|
PINS_END
|
|
} tPin;
|
|
|
|
void gpioInitPins();
|
|
void gpioSetPin(tPin p, tPinState v);
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* GPIO_H_ */
|