Go to the documentation of this file.
38 #ifndef __PLATFORM_CONF_H__
39 #define __PLATFORM_CONF_H__
48 #define PLATFORM_HAS_LEDS 1
49 #define PLATFORM_HAS_BUTTON 0
52 #define F_CPU 3900000uL
55 #define CLOCK_CONF_SECOND 128UL
57 #define BAUD2UBR(baud) ((F_CPU/baud))
62 #define CC_CONF_INLINE inline
65 #define MSP430_MEMCPY_WORKAROUND 1
66 #include "msp430def.h"
71 typedef unsigned long clock_time_t;
72 typedef unsigned long off_t;
75 #define NETSTACK_CONF_RADIO cc2420_driver
78 #define LEDS_PxDIR P5DIR
79 #define LEDS_PxOUT P5OUT
80 #define LEDS_CONF_RED 0x10
81 #define LEDS_CONF_GREEN 0x20
82 #define LEDS_CONF_YELLOW 0x40
85 #ifndef DCOSYNCH_CONF_ENABLED
86 #define DCOSYNCH_CONF_ENABLED 1
88 #ifndef DCOSYNCH_CONF_PERIOD
89 #define DCOSYNCH_CONF_PERIOD 30
92 #define ROM_ERASE_UNIT_SIZE 512
93 #define XMEM_ERASE_UNIT_SIZE (64*1024L)
96 #define CFS_CONF_OFFSET_TYPE long
100 #define NODE_ID_XMEM_OFFSET (0 * XMEM_ERASE_UNIT_SIZE)
103 #define EEPROMFS_ADDR_CODEPROP (1 * XMEM_ERASE_UNIT_SIZE)
105 #define CFS_XMEM_CONF_OFFSET (2 * XMEM_ERASE_UNIT_SIZE)
106 #define CFS_XMEM_CONF_SIZE (1 * XMEM_ERASE_UNIT_SIZE)
108 #define CFS_RAM_CONF_SIZE 4096
115 #define SPI_TXBUF U0TXBUF
116 #define SPI_RXBUF U0RXBUF
119 #define SPI_WAITFOREOTx() while ((U0TCTL & TXEPT) == 0)
121 #define SPI_WAITFOREORx() while ((IFG1 & URXIFG0) == 0)
123 #define SPI_WAITFORTxREADY() while ((IFG1 & UTXIFG0) == 0)
139 #define SPI_FLASH_ENABLE() ( P4OUT &= ~BV(FLASH_CS) )
140 #define SPI_FLASH_DISABLE() ( P4OUT |= BV(FLASH_CS) )
142 #define SPI_FLASH_HOLD() ( P4OUT &= ~BV(FLASH_HOLD) )
143 #define SPI_FLASH_UNHOLD() ( P4OUT |= BV(FLASH_HOLD) )
149 #define CC2420_CONF_SYMBOL_LOOP_COUNT 800
152 #define CC2420_FIFOP_PORT(type) P1##type
153 #define CC2420_FIFOP_PIN 0
155 #define CC2420_FIFO_PORT(type) P1##type
156 #define CC2420_FIFO_PIN 3
158 #define CC2420_CCA_PORT(type) P1##type
159 #define CC2420_CCA_PIN 4
161 #define CC2420_SFD_PORT(type) P4##type
162 #define CC2420_SFD_PIN 1
164 #define CC2420_CSN_PORT(type) P4##type
165 #define CC2420_CSN_PIN 2
167 #define CC2420_VREG_PORT(type) P4##type
168 #define CC2420_VREG_PIN 5
170 #define CC2420_RESET_PORT(type) P4##type
171 #define CC2420_RESET_PIN 6
173 #define CC2420_IRQ_VECTOR PORT1_VECTOR
176 #define CC2420_FIFOP_IS_1 (!!(CC2420_FIFOP_PORT(IN) & BV(CC2420_FIFOP_PIN)))
177 #define CC2420_FIFO_IS_1 (!!(CC2420_FIFO_PORT(IN) & BV(CC2420_FIFO_PIN)))
178 #define CC2420_CCA_IS_1 (!!(CC2420_CCA_PORT(IN) & BV(CC2420_CCA_PIN)))
179 #define CC2420_SFD_IS_1 (!!(CC2420_SFD_PORT(IN) & BV(CC2420_SFD_PIN)))
182 #define SET_RESET_INACTIVE() (CC2420_RESET_PORT(OUT) |= BV(CC2420_RESET_PIN))
183 #define SET_RESET_ACTIVE() (CC2420_RESET_PORT(OUT) &= ~BV(CC2420_RESET_PIN))
186 #define SET_VREG_ACTIVE() (CC2420_VREG_PORT(OUT) |= BV(CC2420_VREG_PIN))
187 #define SET_VREG_INACTIVE() (CC2420_VREG_PORT(OUT) &= ~BV(CC2420_VREG_PIN))
190 #define CC2420_FIFOP_INT_INIT() do { \
191 CC2420_FIFOP_PORT(IES) &= ~BV(CC2420_FIFOP_PIN); \
192 CC2420_CLEAR_FIFOP_INT(); \
196 #define CC2420_ENABLE_FIFOP_INT() do {CC2420_FIFOP_PORT(IE) |= BV(CC2420_FIFOP_PIN);} while(0)
197 #define CC2420_DISABLE_FIFOP_INT() do {CC2420_FIFOP_PORT(IE) &= ~BV(CC2420_FIFOP_PIN);} while(0)
198 #define CC2420_CLEAR_FIFOP_INT() do {CC2420_FIFOP_PORT(IFG) &= ~BV(CC2420_FIFOP_PIN);} while(0)
206 #define CC2420_SPI_ENABLE() (CC2420_CSN_PORT(OUT) &= ~BV(CC2420_CSN_PIN))
208 #define CC2420_SPI_DISABLE() (CC2420_CSN_PORT(OUT) |= BV(CC2420_CSN_PIN))
209 #define CC2420_SPI_IS_ENABLED() ((CC2420_CSN_PORT(OUT) & BV(CC2420_CSN_PIN)) != BV(CC2420_CSN_PIN))