Go to the documentation of this file.
35 #ifndef PLATFORM_CONF_H_
36 #define PLATFORM_CONF_H_
43 #define PLATFORM_HAS_LEDS 1
44 #define PLATFORM_HAS_BUTTON 1
47 #define F_CPU 16000000uL
50 #define CLOCK_CONF_SECOND 128UL
51 #define RTIMER_CONF_SECOND (4096U*8)
53 #define BAUD2UBR(baud) (baud)
59 #include "msp430def.h"
63 typedef unsigned short uip_stats_t;
64 typedef unsigned long clock_time_t;
65 typedef unsigned long off_t;
68 #define NETSTACK_CONF_RADIO cc2520_driver
70 #define ROM_ERASE_UNIT_SIZE 512
71 #define XMEM_ERASE_UNIT_SIZE (64*1024L)
74 #define CFS_CONF_OFFSET_TYPE long
78 #define NODE_ID_XMEM_OFFSET (0 * XMEM_ERASE_UNIT_SIZE)
81 #define EEPROMFS_ADDR_CODEPROP (1 * XMEM_ERASE_UNIT_SIZE)
83 #define CFS_XMEM_CONF_OFFSET (2 * XMEM_ERASE_UNIT_SIZE)
84 #define CFS_XMEM_CONF_SIZE (1 * XMEM_ERASE_UNIT_SIZE)
86 #define CFS_RAM_CONF_SIZE 4096
93 #define SPI_TXBUF UCB0TXBUF
94 #define SPI_RXBUF UCB0RXBUF
97 #define SPI_WAITFOREOTx() while ((UCB0STAT & UCBUSY) != 0)
99 #define SPI_WAITFOREORx() while ((UCB0IFG & UCRXIFG) == 0)
101 #define SPI_WAITFORTxREADY() while ((UCB0IFG & UCTXIFG) == 0)
121 #define FLASH_PWR //3
123 #define FLASH_HOLD //7
127 #define SPI_FLASH_ENABLE() //( P4OUT &= ~BV(FLASH_CS) )
128 #define SPI_FLASH_DISABLE() //( P4OUT |= BV(FLASH_CS) )
130 #define SPI_FLASH_HOLD() // ( P4OUT &= ~BV(FLASH_HOLD) )
131 #define SPI_FLASH_UNHOLD() //( P4OUT |= BV(FLASH_HOLD) )
137 #define CC2520_CONF_SYMBOL_LOOP_COUNT 2604
140 #define CC2520_FIFOP_PORT(type) P1##type
141 #define CC2520_FIFOP_PIN 6
143 #define CC2520_FIFO_PORT(type) P1##type
144 #define CC2520_FIFO_PIN 5
146 #define CC2520_CCA_PORT(type) P1##type
147 #define CC2520_CCA_PIN 7
149 #define CC2520_SFD_PORT(type) P2##type
150 #define CC2520_SFD_PIN 0
152 #define CC2520_CSN_PORT(type) P3##type
153 #define CC2520_CSN_PIN 0
155 #define CC2520_VREG_PORT(type) P4##type
156 #define CC2520_VREG_PIN 3
158 #define CC2520_RESET_PORT(type) P4##type
159 #define CC2520_RESET_PIN 4
161 #define CC2520_IRQ_VECTOR PORT1_VECTOR
164 #define CC2520_FIFOP_IS_1 (!!(CC2520_FIFOP_PORT(IN) & BV(CC2520_FIFOP_PIN)))
165 #define CC2520_FIFO_IS_1 (!!(CC2520_FIFO_PORT(IN) & BV(CC2520_FIFO_PIN)))
166 #define CC2520_CCA_IS_1 (!!(CC2520_CCA_PORT(IN) & BV(CC2520_CCA_PIN)))
167 #define CC2520_SFD_IS_1 (!!(CC2520_SFD_PORT(IN) & BV(CC2520_SFD_PIN)))
170 #define SET_RESET_INACTIVE() (CC2520_RESET_PORT(OUT) |= BV(CC2520_RESET_PIN))
171 #define SET_RESET_ACTIVE() (CC2520_RESET_PORT(OUT) &= ~BV(CC2520_RESET_PIN))
174 #define SET_VREG_ACTIVE() (CC2520_VREG_PORT(OUT) |= BV(CC2520_VREG_PIN))
175 #define SET_VREG_INACTIVE() (CC2520_VREG_PORT(OUT) &= ~BV(CC2520_VREG_PIN))
178 #define CC2520_FIFOP_INT_INIT() do { \
179 CC2520_FIFOP_PORT(IES) &= ~BV(CC2520_FIFOP_PIN); \
180 CC2520_CLEAR_FIFOP_INT(); \
185 #define CC2520_ENABLE_FIFOP_INT() do { P1IE |= BV(CC2520_FIFOP_PIN); } while (0)
186 #define CC2520_DISABLE_FIFOP_INT() do { P1IE &= ~BV(CC2520_FIFOP_PIN); } while (0)
187 #define CC2520_CLEAR_FIFOP_INT() do { P1IFG &= ~BV(CC2520_FIFOP_PIN); } while (0)
195 #define CC2520_SPI_ENABLE() do{ UCB0CTL1 &= ~UCSWRST; clock_delay(5); P3OUT &= ~BIT0;clock_delay(5);}while(0)
197 #define CC2520_SPI_DISABLE() do{clock_delay(5);UCB0CTL1 |= UCSWRST;clock_delay(1); P3OUT |= BIT0;clock_delay(5);}while(0)
198 #define CC2520_SPI_IS_ENABLED() ((CC2520_CSN_PORT(OUT) & BV(CC2520_CSN_PIN)) != BV(CC2520_CSN_PIN))