3 \brief Port descriptions for the GoodFET platform.
\r
6 /* #ifdef __MSPGCC__ */
\r
7 /* #include <msp430.h> */
\r
9 /* #include <signal.h> */
\r
10 /* #include <msp430.h> */
\r
11 /* #include <iomacros.h> */
\r
14 #ifndef _GNU_ASSEMBLER_
\r
18 //LED on P5.5 (pin 49) (LED1 red)
\r
19 #define PLEDOUT P5OUT
\r
20 #define PLEDDIR P5DIR
\r
21 #define PLEDPIN BIT5
\r
22 //LED on P5.6 (pin 50) (LED2 green)
\r
23 #define PLED2OUT P5OUT
\r
24 #define PLED2DIR P5DIR
\r
25 #define PLED2PIN BIT6
\r
26 //LED on P5.7 (pin 51) (LED3 blue)
\r
27 #define PLED3OUT P5OUT
\r
28 #define PLED3DIR P5DIR
\r
29 #define PLED3PIN BIT7
\r
35 //TelosB: 29/3.1=RF_SI, 30/3.2=RF_SO, 31/3.3=RF_SCLK
\r
36 //ApiMote: 29/3.1=RF_SI, 30/3.2=RF_SO, 31/3.3=RF_SCLK
\r
37 #define SPIOUT P3OUT
\r
38 #define SPIDIR P3DIR
\r
40 #define SPIREN P3REN
\r
42 /* For the radio to be used:
\r
43 2.7 (!RST) must be low
\r
44 2.0 (VREF_EN) must be high (cc2420-41 rf_vreg)
\r
45 3.0 (!CS) must be low for the transaction.
\r
49 /* TODO what to do here?. Hopefully nothing.
\r
50 #define INITPLATFORM \
\r
66 //TelosB: Radio CS is 38/P4.2 (to CC2420 pin31)
\r
67 //ApiMote: Radio CS is 28/P3.0
\r
68 #define SETSS P3OUT|=BIT0
\r
69 #define CLRSS P3OUT&=~BIT0
\r
70 #define DIRSS P3DIR|=BIT0
\r
72 //CC2420 Chip Enable
\r
73 //TelosB: Radio RESETn is 42/P4.6 (to CC2420 pin21)
\r
74 //ApiMote: Radio RESETn is 27/P2.7 (to CC2420 pin21)
\r
75 #define SETCE P2OUT|=BIT7
\r
76 #define CLRCE P2OUT&=~BIT7
\r
77 #define DIRCE P2DIR|=BIT7
\r
80 #define SFD (P2IN&BIT6) //TelosB 37/P4.1 -> ApiMote 26/P2.6
\r
81 #define FIFOP (P2IN&BIT4) //TelosB 12/P1.0 -> ApiMote 24/P2.4 (rf_pkt cc2420-29)
\r
82 #define FIFO (P2IN&BIT3) //TelosB 15/P1.3 -> ApiMote 23/P2.3 (rf_gio0 cc2420-30)
\r
84 // network byte order converters
\r
85 #define htons(x) ((((uint16_t)(x) & 0xFF00) >> 8) | \
\r
86 (((uint16_t)(x) & 0x00FF) << 8))
\r
87 #define htonl(x) ((((uint32_t)(x) & 0xFF000000) >> 24) | \
\r
88 (((uint32_t)(x) & 0x00FF0000) >> 8) | \
\r
89 (((uint32_t)(x) & 0x0000FF00) << 8) | \
\r
90 (((uint32_t)(x) & 0x000000FF) << 24))
\r