Go to the documentation of this file.
39 #ifndef PLATFORM_CONF_H_
40 #define PLATFORM_CONF_H_
51 #define RADIO_DELAY_BEFORE_TX ((unsigned)US_TO_RTIMERTICKS(456))
54 #define RADIO_DELAY_BEFORE_RX ((unsigned)US_TO_RTIMERTICKS(183))
56 #define RADIO_DELAY_BEFORE_DETECT 0
58 #define PLATFORM_HAS_LEDS 1
59 #define PLATFORM_HAS_BUTTON 1
60 #define PLATFORM_HAS_LIGHT 1
61 #define PLATFORM_HAS_BATTERY 1
62 #define PLATFORM_HAS_SHT11 1
63 #define PLATFORM_HAS_RADIO 1
66 #define F_CPU 3900000uL
69 #define CLOCK_CONF_SECOND 128UL
71 #define BAUD2UBR(baud) ((F_CPU/baud))
77 #include "msp430def.h"
81 typedef unsigned short uip_stats_t;
82 typedef unsigned long clock_time_t;
86 #define NETSTACK_CONF_RADIO cc2420_driver
89 #define LEDS_PxDIR P5DIR
90 #define LEDS_PxOUT P5OUT
91 #define LEDS_CONF_RED 0x10
92 #define LEDS_CONF_GREEN 0x20
93 #define LEDS_CONF_YELLOW 0x40
96 #ifndef DCOSYNCH_CONF_ENABLED
97 #define DCOSYNCH_CONF_ENABLED 1
99 #ifndef DCOSYNCH_CONF_PERIOD
100 #define DCOSYNCH_CONF_PERIOD 30
103 #define ROM_ERASE_UNIT_SIZE 512
104 #define XMEM_ERASE_UNIT_SIZE (64*1024L)
107 #define CFS_CONF_OFFSET_TYPE long
111 #define NODE_ID_XMEM_OFFSET (0 * XMEM_ERASE_UNIT_SIZE)
114 #define EEPROMFS_ADDR_CODEPROP (1 * XMEM_ERASE_UNIT_SIZE)
116 #define CFS_XMEM_CONF_OFFSET (2 * XMEM_ERASE_UNIT_SIZE)
117 #define CFS_XMEM_CONF_SIZE (1 * XMEM_ERASE_UNIT_SIZE)
119 #define CFS_RAM_CONF_SIZE 4096
126 #define SPI_TXBUF U0TXBUF
127 #define SPI_RXBUF U0RXBUF
130 #define SPI_WAITFOREOTx() while ((U0TCTL & TXEPT) == 0)
132 #define SPI_WAITFOREORx() while ((IFG1 & URXIFG0) == 0)
134 #define SPI_WAITFORTxREADY() while ((IFG1 & UTXIFG0) == 0)
150 #define SPI_FLASH_ENABLE() ( P4OUT &= ~BV(FLASH_CS) )
151 #define SPI_FLASH_DISABLE() ( P4OUT |= BV(FLASH_CS) )
153 #define SPI_FLASH_HOLD() ( P4OUT &= ~BV(FLASH_HOLD) )
154 #define SPI_FLASH_UNHOLD() ( P4OUT |= BV(FLASH_HOLD) )
160 #define CC2420_CONF_SYMBOL_LOOP_COUNT 800
163 #define CC2420_FIFOP_PORT(type) P1##type
164 #define CC2420_FIFOP_PIN 0
166 #define CC2420_FIFO_PORT(type) P1##type
167 #define CC2420_FIFO_PIN 3
169 #define CC2420_CCA_PORT(type) P1##type
170 #define CC2420_CCA_PIN 4
172 #define CC2420_SFD_PORT(type) P4##type
173 #define CC2420_SFD_PIN 1
175 #define CC2420_CSN_PORT(type) P4##type
176 #define CC2420_CSN_PIN 2
178 #define CC2420_VREG_PORT(type) P4##type
179 #define CC2420_VREG_PIN 5
181 #define CC2420_RESET_PORT(type) P4##type
182 #define CC2420_RESET_PIN 6
184 #define CC2420_IRQ_VECTOR PORT1_VECTOR
187 #define CC2420_FIFOP_IS_1 (!!(CC2420_FIFOP_PORT(IN) & BV(CC2420_FIFOP_PIN)))
188 #define CC2420_FIFO_IS_1 (!!(CC2420_FIFO_PORT(IN) & BV(CC2420_FIFO_PIN)))
189 #define CC2420_CCA_IS_1 (!!(CC2420_CCA_PORT(IN) & BV(CC2420_CCA_PIN)))
190 #define CC2420_SFD_IS_1 (!!(CC2420_SFD_PORT(IN) & BV(CC2420_SFD_PIN)))
193 #define SET_RESET_INACTIVE() (CC2420_RESET_PORT(OUT) |= BV(CC2420_RESET_PIN))
194 #define SET_RESET_ACTIVE() (CC2420_RESET_PORT(OUT) &= ~BV(CC2420_RESET_PIN))
197 #define SET_VREG_ACTIVE() (CC2420_VREG_PORT(OUT) |= BV(CC2420_VREG_PIN))
198 #define SET_VREG_INACTIVE() (CC2420_VREG_PORT(OUT) &= ~BV(CC2420_VREG_PIN))
201 #define CC2420_FIFOP_INT_INIT() do { \
202 CC2420_FIFOP_PORT(IES) &= ~BV(CC2420_FIFOP_PIN); \
203 CC2420_CLEAR_FIFOP_INT(); \
207 #define CC2420_ENABLE_FIFOP_INT() do {CC2420_FIFOP_PORT(IE) |= BV(CC2420_FIFOP_PIN);} while(0)
208 #define CC2420_DISABLE_FIFOP_INT() do {CC2420_FIFOP_PORT(IE) &= ~BV(CC2420_FIFOP_PIN);} while(0)
209 #define CC2420_CLEAR_FIFOP_INT() do {CC2420_FIFOP_PORT(IFG) &= ~BV(CC2420_FIFOP_PIN);} while(0)
217 #define CC2420_SPI_ENABLE() (CC2420_CSN_PORT(OUT) &= ~BV(CC2420_CSN_PIN))
219 #define CC2420_SPI_DISABLE() (CC2420_CSN_PORT(OUT) |= BV(CC2420_CSN_PIN))
220 #define CC2420_SPI_IS_ENABLED() ((CC2420_CSN_PORT(OUT) & BV(CC2420_CSN_PIN)) != BV(CC2420_CSN_PIN))