Go to the documentation of this file.
37 #ifndef PLATFORM_CONF_H_
38 #define PLATFORM_CONF_H_
46 #define PLATFORM_HAS_LEDS 1
47 #define PLATFORM_HAS_BUTTON 1
50 #define F_CPU 8000000uL
54 #define CLOCK_CONF_SECOND 128UL
56 #define BAUD2UBR(baud) ((F_CPU/baud))
62 #include "msp430def.h"
65 #ifdef __IAR_SYSTEMS_ICC__
67 #define P1SEL2_ (0x0041u)
68 DEFC( P1SEL2 , P1SEL2_)
71 #define P5SEL2_ (0x0045u)
72 DEFC( P5SEL2 , P5SEL2_)
77 #define P1SEL2_ 0x0041
78 sfrb(P1SEL2, P1SEL2_);
81 #define P5SEL2_ 0x0045
82 sfrb(P5SEL2, P5SEL2_);
88 typedef unsigned short uip_stats_t;
89 typedef unsigned long clock_time_t;
90 typedef unsigned long off_t;
93 #define NETSTACK_CONF_RADIO cc2420_driver
101 #define LEDS_PxDIR P5DIR
102 #define LEDS_PxOUT P5OUT
103 #define LEDS_CONF_RED 0x10
104 #define LEDS_CONF_GREEN 0x40
105 #define LEDS_CONF_YELLOW 0x20
108 #define DCOSYNCH_CONF_ENABLED 0
109 #define DCOSYNCH_CONF_PERIOD 30
111 #define ROM_ERASE_UNIT_SIZE 512
112 #define XMEM_ERASE_UNIT_SIZE (64*1024L)
115 #define CFS_CONF_OFFSET_TYPE long
118 #define NODE_ID_XMEM_OFFSET (0 * XMEM_ERASE_UNIT_SIZE)
121 #define EEPROMFS_ADDR_CODEPROP (1 * XMEM_ERASE_UNIT_SIZE)
123 #define CFS_XMEM_CONF_OFFSET (2 * XMEM_ERASE_UNIT_SIZE)
124 #define CFS_XMEM_CONF_SIZE (1 * XMEM_ERASE_UNIT_SIZE)
126 #define CFS_RAM_CONF_SIZE 4096
133 #define SPI_TXBUF UCB0TXBUF
134 #define SPI_RXBUF UCB0RXBUF
137 #define SPI_WAITFOREOTx() while ((UCB0STAT & UCBUSY) != 0)
139 #define SPI_WAITFOREORx() while ((IFG2 & UCB0RXIFG) == 0)
141 #define SPI_WAITFORTxREADY() while ((IFG2 & UCB0TXIFG) == 0)
156 #define SPI_FLASH_ENABLE() ( P4OUT &= ~BV(FLASH_CS) )
157 #define SPI_FLASH_DISABLE() ( P4OUT |= BV(FLASH_CS) )
159 #define SPI_FLASH_HOLD() ( P5OUT &= ~BV(FLASH_HOLD) )
160 #define SPI_FLASH_UNHOLD() ( P5OUT |= BV(FLASH_HOLD) )
167 #define CC2420_CONF_SYMBOL_LOOP_COUNT 1302
170 #define CC2420_FIFOP_PORT(type) P1##type
171 #define CC2420_FIFOP_PIN 2
173 #define CC2420_FIFO_PORT(type) P1##type
174 #define CC2420_FIFO_PIN 3
176 #define CC2420_CCA_PORT(type) P1##type
177 #define CC2420_CCA_PIN 4
179 #define CC2420_SFD_PORT(type) P4##type
180 #define CC2420_SFD_PIN 1
182 #define CC2420_CSN_PORT(type) P3##type
183 #define CC2420_CSN_PIN 0
185 #define CC2420_VREG_PORT(type) P4##type
186 #define CC2420_VREG_PIN 5
188 #define CC2420_RESET_PORT(type) P4##type
189 #define CC2420_RESET_PIN 6
192 #define CC2420_IRQ_VECTOR PORT1_VECTOR
195 #define CC2420_FIFOP_IS_1 (!!(CC2420_FIFOP_PORT(IN) & BV(CC2420_FIFOP_PIN)))
196 #define CC2420_FIFO_IS_1 (!!(CC2420_FIFO_PORT(IN) & BV(CC2420_FIFO_PIN)))
197 #define CC2420_CCA_IS_1 (!!(CC2420_CCA_PORT(IN) & BV(CC2420_CCA_PIN)))
198 #define CC2420_SFD_IS_1 (!!(CC2420_SFD_PORT(IN) & BV(CC2420_SFD_PIN)))
201 #define SET_RESET_INACTIVE() (CC2420_RESET_PORT(OUT) |= BV(CC2420_RESET_PIN))
202 #define SET_RESET_ACTIVE() (CC2420_RESET_PORT(OUT) &= ~BV(CC2420_RESET_PIN))
205 #define SET_VREG_ACTIVE() (CC2420_VREG_PORT(OUT) |= BV(CC2420_VREG_PIN))
206 #define SET_VREG_INACTIVE() (CC2420_VREG_PORT(OUT) &= ~BV(CC2420_VREG_PIN))
209 #define CC2420_FIFOP_INT_INIT() do { \
210 CC2420_FIFOP_PORT(IES) &= ~BV(CC2420_FIFOP_PIN); \
211 CC2420_CLEAR_FIFOP_INT(); \
215 #define CC2420_ENABLE_FIFOP_INT() do {CC2420_FIFOP_PORT(IE) |= BV(CC2420_FIFOP_PIN);} while(0)
216 #define CC2420_DISABLE_FIFOP_INT() do {CC2420_FIFOP_PORT(IE) &= ~BV(CC2420_FIFOP_PIN);} while(0)
217 #define CC2420_CLEAR_FIFOP_INT() do {CC2420_FIFOP_PORT(IFG) &= ~BV(CC2420_FIFOP_PIN);} while(0)
225 #define CC2420_SPI_ENABLE() (CC2420_CSN_PORT(OUT) &= ~BV(CC2420_CSN_PIN))
227 #define CC2420_SPI_DISABLE() (CC2420_CSN_PORT(OUT) |= BV(CC2420_CSN_PIN))
228 #define CC2420_SPI_IS_ENABLED() ((CC2420_CSN_PORT(OUT) & BV(CC2420_CSN_PIN)) != BV(CC2420_CSN_PIN))