initial, ported from constantly failed C++ variant
This commit is contained in:
56
src/gpio.h
Normal file
56
src/gpio.h
Normal file
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* 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,
|
||||
TESTPIN,
|
||||
PINS_END
|
||||
} tPin;
|
||||
|
||||
void gpioInitPins();
|
||||
void gpioSetPin(tPin p, tPinState v);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* GPIO_H_ */
|
Reference in New Issue
Block a user