2 \author Travis Goodspeed
3 \brief Port descriptions for the TelosB platform.
5 This file defines the Telos B hardware, so that the GoodFET firmware
6 may be loaded onto it. Adjustments include the !CS line of the CC2420
7 radio, the choice of serial port, and the LEDs.
27 /* For the radio to be used:
28 4.6 (!RST) must be low
29 4.5 (VREF_EN) must be high
30 4.2 (!CS) must be low for the transaction.
33 #define INITPLATFORM \
48 #define SETSS P4OUT|=BIT2
49 #define CLRSS P4OUT&=~BIT2
50 #define DIRSS P4DIR|=BIT2
53 //Flash CS is P4.4, redefine only for the SPI app.
58 #define SETSS P4OUT|=BIT4
59 #define CLRSS P4OUT&=~BIT4
60 #define DIRSS P4DIR|=BIT4
64 #define SETCE P4OUT|=BIT6
65 #define CLRCE P4OUT&=~BIT6
66 #define DIRCE P4DIR|=BIT6
69 #define SFD (P4IN&BIT1)
70 #define FIFOP (P4IN&BIT0)
72 // network byte order converters
73 #define htons(x) ((((uint16_t)(x) & 0xFF00) >> 8) | \
74 (((uint16_t)(x) & 0x00FF) << 8))
75 #define htonl(x) ((((uint32_t)(x) & 0xFF000000) >> 24) | \
76 (((uint32_t)(x) & 0x00FF0000) >> 8) | \
77 (((uint32_t)(x) & 0x0000FF00) << 8) | \
78 (((uint32_t)(x) & 0x000000FF) << 24))