Go to the documentation of this file.
38 #ifndef PLATFORM_CONF_H_
39 #define PLATFORM_CONF_H_
51 #define F_CPU 8000000uL // 8MHz by default
54 #define CLOCK_CONF_SECOND 128UL
56 #define BAUD2UBR(baud) ((F_CPU/baud))
62 #define MSP430_MEMCPY_WORKAROUND 1
63 #include "msp430def.h"
67 typedef unsigned short uip_stats_t;
68 typedef unsigned long clock_time_t;
69 typedef unsigned long off_t;
72 #define NETSTACK_CONF_RADIO cc2420_driver
81 #define DCOSYNCH_CONF_ENABLED 0
82 #define DCOSYNCH_CONF_PERIOD 30
84 #define ROM_ERASE_UNIT_SIZE 512
85 #define XMEM_ERASE_UNIT_SIZE (64*1024L)
87 #define CFS_CONF_OFFSET_TYPE long
90 #define NODE_ID_XMEM_OFFSET (0 * XMEM_ERASE_UNIT_SIZE)
93 #define EEPROMFS_ADDR_CODEPROP (1 * XMEM_ERASE_UNIT_SIZE)
95 #define CFS_XMEM_CONF_OFFSET (2 * XMEM_ERASE_UNIT_SIZE)
96 #define CFS_XMEM_CONF_SIZE (1 * XMEM_ERASE_UNIT_SIZE)
98 #define CFS_RAM_CONF_SIZE 4096
105 #define SPI_TXBUF UCB0TXBUF
106 #define SPI_RXBUF UCB0RXBUF
109 #define SPI_WAITFOREOTx() while ((UCB0STAT & UCBUSY) != 0)
111 #define SPI_WAITFOREORx() while ((UCB0IFG & UCRXIFG) == 0)
113 #define SPI_WAITFORTxREADY() while ((UCB0IFG & UCTXIFG) == 0)
128 #define SPI_FLASH_ENABLE() ( P4OUT &= ~BV(FLASH_CS) )
129 #define SPI_FLASH_DISABLE() ( P4OUT |= BV(FLASH_CS) )
131 #define SPI_FLASH_HOLD() ( P5OUT &= ~BV(FLASH_HOLD) )
132 #define SPI_FLASH_UNHOLD() ( P5OUT |= BV(FLASH_HOLD) )
139 #define CC2420_CONF_SYMBOL_LOOP_COUNT 1302
142 #define CC2420_FIFOP_PORT(type) P1##type
143 #define CC2420_FIFOP_PIN 6
145 #define CC2420_FIFO_PORT(type) P1##type
146 #define CC2420_FIFO_PIN 5
148 #define CC2420_CCA_PORT(type) P1##type
149 #define CC2420_CCA_PIN 7
151 #define CC2420_SFD_PORT(type) P1##type
152 #define CC2420_SFD_PIN 3
154 #define CC2420_CSN_PORT(type) P3##type
155 #define CC2420_CSN_PIN 0
157 #define CC2420_VREG_PORT(type) P1##type
158 #define CC2420_VREG_PIN 4
160 #define CC2420_RESET_PORT(type) P1##type
161 #define CC2420_RESET_PIN 2
164 #define CC2420_IRQ_VECTOR PORT1_VECTOR
167 #define CC2420_FIFOP_IS_1 (!!(CC2420_FIFOP_PORT(IN) & BV(CC2420_FIFOP_PIN)))
168 #define CC2420_FIFO_IS_1 (!!(CC2420_FIFO_PORT(IN) & BV(CC2420_FIFO_PIN)))
169 #define CC2420_CCA_IS_1 (!!(CC2420_CCA_PORT(IN) & BV(CC2420_CCA_PIN)))
170 #define CC2420_SFD_IS_1 (!!(CC2420_SFD_PORT(IN) & BV(CC2420_SFD_PIN)))
173 #define SET_RESET_INACTIVE() (CC2420_RESET_PORT(OUT) |= BV(CC2420_RESET_PIN))
174 #define SET_RESET_ACTIVE() (CC2420_RESET_PORT(OUT) &= ~BV(CC2420_RESET_PIN))
177 #define SET_VREG_ACTIVE() (CC2420_VREG_PORT(OUT) |= BV(CC2420_VREG_PIN))
178 #define SET_VREG_INACTIVE() (CC2420_VREG_PORT(OUT) &= ~BV(CC2420_VREG_PIN))
181 #define CC2420_FIFOP_INT_INIT() do { \
182 CC2420_FIFOP_PORT(IES) &= ~BV(CC2420_FIFOP_PIN); \
183 CC2420_CLEAR_FIFOP_INT(); \
187 #define CC2420_ENABLE_FIFOP_INT() do {CC2420_FIFOP_PORT(IE) |= BV(CC2420_FIFOP_PIN);} while(0)
188 #define CC2420_DISABLE_FIFOP_INT() do {CC2420_FIFOP_PORT(IE) &= ~BV(CC2420_FIFOP_PIN);} while(0)
189 #define CC2420_CLEAR_FIFOP_INT() do {CC2420_FIFOP_PORT(IFG) &= ~BV(CC2420_FIFOP_PIN);} while(0)
198 #define CC2420_SPI_ENABLE() (CC2420_CSN_PORT(OUT) &= ~BV(CC2420_CSN_PIN))
200 #define CC2420_SPI_DISABLE() (CC2420_CSN_PORT(OUT) |= BV(CC2420_CSN_PIN))
201 #define CC2420_SPI_IS_ENABLED() ((CC2420_CSN_PORT(OUT) & BV(CC2420_CSN_PIN)) != BV(CC2420_CSN_PIN))