2 \author Travis Goodspeed
3 \brief Port descriptions for the Zolertia Z1 platform.
5 This file defines the Zolertia hardware, so that the GoodFET firmware
6 may be loaded onto it. Adjustments are identical to the Telos B.
10 #ifndef _GNU_ASSEMBLER_
14 //LED on P5.4 (LED1 red)
18 //LED on P5.5 (LED2 green)
19 #define PLED2OUT P5OUT
20 #define PLED2DIR P5DIR
22 //LED on P5.6 (LED3 blue)
23 #define PLED3OUT P5OUT
24 #define PLED3DIR P5DIR
34 /* For the radio to be used:
35 4.6 (!RST) must be low
36 4.5 (VREF_EN) must be high
37 4.2 (!CS) must be low for the transaction.
40 #define INITPLATFORM \
55 #define SETSS P4OUT|=BIT2
56 #define CLRSS P4OUT&=~BIT2
57 #define DIRSS P4DIR|=BIT2
59 //Flash CS is P4.4, redefine only for the SPI app.
64 #define SETSS P4OUT|=BIT4
65 #define CLRSS P4OUT&=~BIT4
66 #define DIRSS P4DIR|=BIT4
70 #define SETCE P4OUT|=BIT6
71 #define CLRCE P4OUT&=~BIT6
72 #define DIRCE P4DIR|=BIT6
75 #define SFD (P4IN&BIT1)
76 #define FIFOP (P1IN&BIT0)
77 #define FIFO (P1IN&BIT3)
80 #define GIO0 (P2OUT&BIT0)
81 #define GIO0HIGH P2OUT|=BIT0
82 #define GIO0LOW P2OUT&=~BIT0
87 // network byte order converters
88 #define htons(x) ((((uint16_t)(x) & 0xFF00) >> 8) | \
89 (((uint16_t)(x) & 0x00FF) << 8))
90 #define htonl(x) ((((uint32_t)(x) & 0xFF000000) >> 24) | \
91 (((uint32_t)(x) & 0x00FF0000) >> 8) | \
92 (((uint32_t)(x) & 0x0000FF00) << 8) | \
93 (((uint32_t)(x) & 0x000000FF) << 24))