55 lines
585 B
C
55 lines
585 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;
|
||
|
|
||
|
|
||
|
|
||
|
#include "gpioCfg.h"
|
||
|
|
||
|
|
||
|
void gpioInitPins();
|
||
|
void gpioSetPin(tPin p, tPinState v);
|
||
|
void gpioTogglePin(tPin p);
|
||
|
tPinState gpioGetPin(tPin p);
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
#endif /* GPIO_H_ */
|