Major glitching revisions.
[goodfet] / firmware / include / gfports.h
1 /*! \file gfports.h
2   \author Travis Goodspeed
3   \brief GoodFET Port Definitions
4 */
5
6 #ifndef GFPORTS
7 #define GFPORTS
8
9 #ifdef MSP430
10 #include <io.h>
11 #endif
12
13 // N.B., only asm-clean CPP definitions allowed.
14
15 //Use P3 instead of P5 for target I/O on chips without P5.
16 #ifndef __MSP430_HAS_PORT5__
17 #ifndef __MSP430_HAS_PORT5_R__
18 //#warning "No P5, using P3 instead.  Will break 2618 and 1612 support."
19 #define P5OUT P3OUT
20 #define P5DIR P3DIR
21 #define P5REN P3REN
22 #define P5IN P3IN
23
24 #endif
25 #endif
26
27 //Use false P5REN for 1612.
28 #ifdef __MSP430_HAS_PORT5__
29 #ifndef __MSP430_HAS_PORT5_R__
30 //#warning "1xx, using fake P5REN for external pulling resistors."
31 #define P5REN P5OUT
32 #endif
33 #endif
34
35 //Use these instead of the explicit names.
36 #ifdef MSP430
37 #define gfout P5OUT
38 #define gfin  P5IN
39 #define gfdir P5DIR
40 #define gfren P5REN
41 #endif
42
43
44
45 #endif //GFPORTS