Go to the documentation of this file.
37 #ifndef PLATFORM_CONF_H_
38 #define PLATFORM_CONF_H_
48 #define RADIO_DELAY_BEFORE_TX ((unsigned)US_TO_RTIMERTICKS(456))
51 #define RADIO_DELAY_BEFORE_RX ((unsigned)US_TO_RTIMERTICKS(183))
53 #define RADIO_DELAY_BEFORE_DETECT 0
55 #define PLATFORM_HAS_LEDS 1
56 #define PLATFORM_HAS_BUTTON 1
57 #define PLATFORM_HAS_RADIO 1
58 #define PLATFORM_HAS_BATTERY 1
61 #define F_CPU 8000000uL
64 #define CLOCK_CONF_SECOND 128UL
66 #define BAUD2UBR(baud) ((F_CPU / baud))
72 #include "msp430def.h"
75 #ifdef __IAR_SYSTEMS_ICC__
77 #define P1SEL2_ (0x0041u)
81 #define P5SEL2_ (0x0045u)
87 #define P1SEL2_ 0x0041
88 sfrb(P1SEL2, P1SEL2_);
91 #define P5SEL2_ 0x0045
92 sfrb(P5SEL2, P5SEL2_);
98 typedef unsigned short uip_stats_t;
99 typedef unsigned long clock_time_t;
100 typedef unsigned long off_t;
103 #define NETSTACK_CONF_RADIO cc2420_driver
112 #define LEDS_PxDIR P4DIR
113 #define LEDS_PxOUT P4OUT
114 #define LEDS_CONF_RED 0x04
115 #define LEDS_CONF_GREEN 0x01
116 #define LEDS_CONF_YELLOW 0x80
118 #define LEDS_PxDIR P5DIR
119 #define LEDS_PxOUT P5OUT
120 #define LEDS_CONF_RED 0x10
121 #define LEDS_CONF_GREEN 0x40
122 #define LEDS_CONF_YELLOW 0x20
126 #define DCOSYNCH_CONF_ENABLED 0
127 #define DCOSYNCH_CONF_PERIOD 30
129 #define ROM_ERASE_UNIT_SIZE 512
130 #define XMEM_ERASE_UNIT_SIZE (64 * 1024L)
132 #define CFS_CONF_OFFSET_TYPE long
135 #define NODE_ID_XMEM_OFFSET (0 * XMEM_ERASE_UNIT_SIZE)
138 #define EEPROMFS_ADDR_CODEPROP (1 * XMEM_ERASE_UNIT_SIZE)
140 #define CFS_XMEM_CONF_OFFSET (2 * XMEM_ERASE_UNIT_SIZE)
141 #define CFS_XMEM_CONF_SIZE (1 * XMEM_ERASE_UNIT_SIZE)
143 #define CFS_RAM_CONF_SIZE 4096
150 #define SPI_TXBUF UCB0TXBUF
151 #define SPI_RXBUF UCB0RXBUF
154 #define SPI_WAITFOREOTx() while((UCB0STAT & UCBUSY) != 0)
156 #define SPI_WAITFOREORx() while((IFG2 & UCB0RXIFG) == 0)
158 #define SPI_WAITFORTxREADY() while((IFG2 & UCB0TXIFG) == 0)
173 #define SPI_FLASH_ENABLE() (P4OUT &= ~BV(FLASH_CS))
174 #define SPI_FLASH_DISABLE() (P4OUT |= BV(FLASH_CS))
176 #define SPI_FLASH_HOLD() (P5OUT &= ~BV(FLASH_HOLD))
177 #define SPI_FLASH_UNHOLD() (P5OUT |= BV(FLASH_HOLD))
183 #define CC2420_CONF_SYMBOL_LOOP_COUNT 1302
186 #define CC2420_FIFOP_PORT(type) P1##type
187 #define CC2420_FIFOP_PIN 2
189 #define CC2420_FIFO_PORT(type) P1##type
190 #define CC2420_FIFO_PIN 3
192 #define CC2420_CCA_PORT(type) P1##type
193 #define CC2420_CCA_PIN 4
195 #define CC2420_SFD_PORT(type) P4##type
196 #define CC2420_SFD_PIN 1
198 #define CC2420_CSN_PORT(type) P3##type
199 #define CC2420_CSN_PIN 0
201 #define CC2420_VREG_PORT(type) P4##type
202 #define CC2420_VREG_PIN 5
204 #define CC2420_RESET_PORT(type) P4##type
205 #define CC2420_RESET_PIN 6
207 #define CC2420_IRQ_VECTOR PORT1_VECTOR
210 #define CC2420_FIFOP_IS_1 (!!(CC2420_FIFOP_PORT(IN) & BV(CC2420_FIFOP_PIN)))
211 #define CC2420_FIFO_IS_1 (!!(CC2420_FIFO_PORT(IN) & BV(CC2420_FIFO_PIN)))
212 #define CC2420_CCA_IS_1 (!!(CC2420_CCA_PORT(IN) & BV(CC2420_CCA_PIN)))
213 #define CC2420_SFD_IS_1 (!!(CC2420_SFD_PORT(IN) & BV(CC2420_SFD_PIN)))
216 #define SET_RESET_INACTIVE() (CC2420_RESET_PORT(OUT) |= BV(CC2420_RESET_PIN))
217 #define SET_RESET_ACTIVE() (CC2420_RESET_PORT(OUT) &= ~BV(CC2420_RESET_PIN))
220 #define SET_VREG_ACTIVE() (CC2420_VREG_PORT(OUT) |= BV(CC2420_VREG_PIN))
221 #define SET_VREG_INACTIVE() (CC2420_VREG_PORT(OUT) &= ~BV(CC2420_VREG_PIN))
224 #define CC2420_FIFOP_INT_INIT() do { \
225 CC2420_FIFOP_PORT(IES) &= ~BV(CC2420_FIFOP_PIN); \
226 CC2420_CLEAR_FIFOP_INT(); \
230 #define CC2420_ENABLE_FIFOP_INT() do { CC2420_FIFOP_PORT(IE) |= BV(CC2420_FIFOP_PIN); } while(0)
231 #define CC2420_DISABLE_FIFOP_INT() do { CC2420_FIFOP_PORT(IE) &= ~BV(CC2420_FIFOP_PIN); } while(0)
232 #define CC2420_CLEAR_FIFOP_INT() do { CC2420_FIFOP_PORT(IFG) &= ~BV(CC2420_FIFOP_PIN); } while(0)
240 #define CC2420_SPI_ENABLE() (CC2420_CSN_PORT(OUT) &= ~BV(CC2420_CSN_PIN))
242 #define CC2420_SPI_DISABLE() (CC2420_CSN_PORT(OUT) |= BV(CC2420_CSN_PIN))
243 #define CC2420_SPI_IS_ENABLED() ((CC2420_CSN_PORT(OUT) & BV(CC2420_CSN_PIN)) != BV(CC2420_CSN_PIN))
249 #define I2C_PxDIR P5DIR
250 #define I2C_PxIN P5IN
251 #define I2C_PxOUT P5OUT
252 #define I2C_PxSEL P5SEL
253 #define I2C_PxSEL2 P5SEL2
254 #define I2C_PxREN P5REN
256 #define I2C_SDA (1 << 1)
257 #define I2C_SCL (1 << 2)
258 #define I2C_PRESC_1KHZ_LSB 0x00
259 #define I2C_PRESC_1KHZ_MSB 0x20
260 #define I2C_PRESC_100KHZ_LSB 0x50
261 #define I2C_PRESC_100KHZ_MSB 0x00
262 #define I2C_PRESC_400KHZ_LSB 0x14
263 #define I2C_PRESC_400KHZ_MSB 0x00
266 #ifndef I2C_PRESC_Z1_LSB
267 #define I2C_PRESC_Z1_LSB I2C_PRESC_400KHZ_LSB
270 #ifndef I2C_PRESC_Z1_MSB
271 #define I2C_PRESC_Z1_MSB I2C_PRESC_400KHZ_MSB
275 #ifdef I2C_CONF_RX_WITH_INTERRUPT
276 #define I2C_RX_WITH_INTERRUPT I2C_CONF_RX_WITH_INTERRUPT
278 #define I2C_RX_WITH_INTERRUPT 1