changes to the GUI to allow for better loading and writing as well as tested our...
[goodfet] / firmware / platforms / nhbadgeb.h
1 /*! \file nhbadge.h
2   \author Travis Goodspeed
3   \brief Port descriptions for the Next Hope Badge.
4 */
5
6
7 #ifdef MSP430
8 #include <msp430.h>
9 #endif
10
11 //This nonsense is deprecated.
12 //Remove as soon as is convenient.
13 #define P5OUT P4OUT
14 #define P5DIR P4DIR
15 #define P5IN P4IN
16 #define P5REN P4REN
17
18 #define SPIOUT P4OUT
19 #define SPIDIR P4DIR
20 #define SPIIN  P4IN
21 #define SPIREN P4REN
22
23
24
25 //LED on P1.0
26 #define PLEDOUT P1OUT
27 #define PLEDDIR P1DIR
28 #define PLEDPIN BIT0
29
30 #define SETSS P4OUT|=BIT4
31 #define CLRSS P4OUT&=~BIT4
32 #define DIRSS P4DIR|=BIT4;
33
34 //BIT5 is Chip Enable
35 //#define RADIOACTIVE  P4OUT|=BIT5
36 //#define RADIOPASSIVE P4OUT&=~BIT5
37 #define SETCE P4OUT|=BIT5
38 #define CLRCE P4OUT&=~BIT5
39 #define DIRCE P4DIR|=BIT5
40
41 // network byte order converters
42 #define htons(x) ((((uint16_t)(x) & 0xFF00) >> 8) | \
43                                  (((uint16_t)(x) & 0x00FF) << 8))
44 #define htonl(x) ((((uint32_t)(x) & 0xFF000000) >> 24) | \
45                                   (((uint32_t)(x) & 0x00FF0000) >> 8) | \
46                                   (((uint32_t)(x) & 0x0000FF00) << 8) | \
47                                   (((uint32_t)(x) & 0x000000FF) << 24))
48
49 #define ntohs htons
50 #define ntohl htonl