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
128 #define SPI_FLASH_ENABLE() do{ UCB0CTL1 &= ~UCSWRST; clock_delay(5); P4OUT &= ~BIT0;clock_delay(5);}while(0)
130 #define SPI_FLASH_DISABLE() do{clock_delay(5);UCB0CTL1 |= UCSWRST;clock_delay(1); P4OUT |= BIT0;clock_delay(5);}while(0)
132 #define SPI_FLASH_HOLD() // ( P4OUT &= ~BV(FLASH_HOLD) )
133 #define SPI_FLASH_UNHOLD() //( P4OUT |= BV(FLASH_HOLD) )
139 #define CC2520_CONF_SYMBOL_LOOP_COUNT 2604
142 #define CC2520_FIFOP_PORT(type) P1##type
143 #define CC2520_FIFOP_PIN 6
145 #define CC2520_FIFO_PORT(type) P1##type
146 #define CC2520_FIFO_PIN 5
148 #define CC2520_CCA_PORT(type) P1##type
149 #define CC2520_CCA_PIN 7
151 #define CC2520_SFD_PORT(type) P2##type
152 #define CC2520_SFD_PIN 0
154 #define CC2520_CSN_PORT(type) P3##type
155 #define CC2520_CSN_PIN 0
157 #define CC2520_VREG_PORT(type) P4##type
158 #define CC2520_VREG_PIN 3
160 #define CC2520_RESET_PORT(type) P4##type
161 #define CC2520_RESET_PIN 4
163 #define CC2520_IRQ_VECTOR PORT1_VECTOR
166 #define CC2520_FIFOP_IS_1 (!!(CC2520_FIFOP_PORT(IN) & BV(CC2520_FIFOP_PIN)))
167 #define CC2520_FIFO_IS_1 (!!(CC2520_FIFO_PORT(IN) & BV(CC2520_FIFO_PIN)))
168 #define CC2520_CCA_IS_1 (!!(CC2520_CCA_PORT(IN) & BV(CC2520_CCA_PIN)))
169 #define CC2520_SFD_IS_1 (!!(CC2520_SFD_PORT(IN) & BV(CC2520_SFD_PIN)))
172 #define SET_RESET_INACTIVE() (CC2520_RESET_PORT(OUT) |= BV(CC2520_RESET_PIN))
173 #define SET_RESET_ACTIVE() (CC2520_RESET_PORT(OUT) &= ~BV(CC2520_RESET_PIN))
176 #define SET_VREG_ACTIVE() (CC2520_VREG_PORT(OUT) |= BV(CC2520_VREG_PIN))
177 #define SET_VREG_INACTIVE() (CC2520_VREG_PORT(OUT) &= ~BV(CC2520_VREG_PIN))
180 #define CC2520_FIFOP_INT_INIT() do { \
181 CC2520_FIFOP_PORT(IES) &= ~BV(CC2520_FIFOP_PIN); \
182 CC2520_CLEAR_FIFOP_INT(); \
187 #define CC2520_ENABLE_FIFOP_INT() do { P1IE |= BV(CC2520_FIFOP_PIN); } while (0)
188 #define CC2520_DISABLE_FIFOP_INT() do { P1IE &= ~BV(CC2520_FIFOP_PIN); } while (0)
189 #define CC2520_CLEAR_FIFOP_INT() do { P1IFG &= ~BV(CC2520_FIFOP_PIN); } while (0)
197 #define CC2520_SPI_ENABLE() do{ UCB0CTL1 &= ~UCSWRST; clock_delay(5); P3OUT &= ~BIT0;clock_delay(5);}while(0)
199 #define CC2520_SPI_DISABLE() do{clock_delay(5);UCB0CTL1 |= UCSWRST;clock_delay(1); P3OUT |= BIT0;clock_delay(5);}while(0)
200 #define CC2520_SPI_IS_ENABLED() ((CC2520_CSN_PORT(OUT) & BV(CC2520_CSN_PIN)) != BV(CC2520_CSN_PIN))