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
48 #define PLATFORM_HAS_RADIO 1
49 #define PLATFORM_HAS_BATTERY 1
52 #define F_CPU 8000000uL
55 #define CLOCK_CONF_SECOND 128UL
57 #define BAUD2UBR(baud) ((F_CPU / baud))
63 #include "msp430def.h"
66 #ifdef __IAR_SYSTEMS_ICC__
68 #define P1SEL2_ (0x0041u)
72 #define P5SEL2_ (0x0045u)
78 #define P1SEL2_ 0x0041
79 sfrb(P1SEL2, P1SEL2_);
82 #define P5SEL2_ 0x0045
83 sfrb(P5SEL2, P5SEL2_);
89 typedef unsigned short uip_stats_t;
90 typedef unsigned long clock_time_t;
91 typedef unsigned long off_t;
94 #define NETSTACK_CONF_RADIO cc2420_driver
103 #define LEDS_PxDIR P4DIR
104 #define LEDS_PxOUT P4OUT
105 #define LEDS_CONF_RED 0x04
106 #define LEDS_CONF_GREEN 0x01
107 #define LEDS_CONF_YELLOW 0x80
109 #define LEDS_PxDIR P5DIR
110 #define LEDS_PxOUT P5OUT
111 #define LEDS_CONF_RED 0x10
112 #define LEDS_CONF_GREEN 0x40
113 #define LEDS_CONF_YELLOW 0x20
117 #define DCOSYNCH_CONF_ENABLED 0
118 #define DCOSYNCH_CONF_PERIOD 30
120 #define ROM_ERASE_UNIT_SIZE 512
121 #define XMEM_ERASE_UNIT_SIZE (64 * 1024L)
123 #define CFS_CONF_OFFSET_TYPE long
126 #define NODE_ID_XMEM_OFFSET (0 * XMEM_ERASE_UNIT_SIZE)
127 #define RESET_COUNTER_XMEM_OFFSET (1 * XMEM_ERASE_UNIT_SIZE)
130 #define EEPROMFS_ADDR_CODEPROP (1 * XMEM_ERASE_UNIT_SIZE)
132 #define CFS_XMEM_CONF_OFFSET (2 * XMEM_ERASE_UNIT_SIZE)
133 #define CFS_XMEM_CONF_SIZE (1 * XMEM_ERASE_UNIT_SIZE)
135 #define CFS_RAM_CONF_SIZE 4096
142 #define SPI_TXBUF UCB0TXBUF
143 #define SPI_RXBUF UCB0RXBUF
146 #define SPI_WAITFOREOTx() while((UCB0STAT & UCBUSY) != 0)
148 #define SPI_WAITFOREORx() while((IFG2 & UCB0RXIFG) == 0)
150 #define SPI_WAITFORTxREADY() while((IFG2 & UCB0TXIFG) == 0)
165 #define SPI_FLASH_ENABLE() (P4OUT &= ~BV(FLASH_CS))
166 #define SPI_FLASH_DISABLE() (P4OUT |= BV(FLASH_CS))
168 #define SPI_FLASH_HOLD() (P5OUT &= ~BV(FLASH_HOLD))
169 #define SPI_FLASH_UNHOLD() (P5OUT |= BV(FLASH_HOLD))
175 #define CC2420_CONF_SYMBOL_LOOP_COUNT 1302
178 #define CC2420_FIFOP_PORT(type) P1##type
179 #define CC2420_FIFOP_PIN 2
181 #define CC2420_FIFO_PORT(type) P1##type
182 #define CC2420_FIFO_PIN 3
184 #define CC2420_CCA_PORT(type) P1##type
185 #define CC2420_CCA_PIN 4
187 #define CC2420_SFD_PORT(type) P4##type
188 #define CC2420_SFD_PIN 1
190 #define CC2420_CSN_PORT(type) P3##type
191 #define CC2420_CSN_PIN 0
193 #define CC2420_VREG_PORT(type) P4##type
194 #define CC2420_VREG_PIN 5
196 #define CC2420_RESET_PORT(type) P4##type
197 #define CC2420_RESET_PIN 6
199 #define CC2420_IRQ_VECTOR PORT1_VECTOR
202 #define CC2420_FIFOP_IS_1 (!!(CC2420_FIFOP_PORT(IN) & BV(CC2420_FIFOP_PIN)))
203 #define CC2420_FIFO_IS_1 (!!(CC2420_FIFO_PORT(IN) & BV(CC2420_FIFO_PIN)))
204 #define CC2420_CCA_IS_1 (!!(CC2420_CCA_PORT(IN) & BV(CC2420_CCA_PIN)))
205 #define CC2420_SFD_IS_1 (!!(CC2420_SFD_PORT(IN) & BV(CC2420_SFD_PIN)))
208 #define SET_RESET_INACTIVE() (CC2420_RESET_PORT(OUT) |= BV(CC2420_RESET_PIN))
209 #define SET_RESET_ACTIVE() (CC2420_RESET_PORT(OUT) &= ~BV(CC2420_RESET_PIN))
212 #define SET_VREG_ACTIVE() (CC2420_VREG_PORT(OUT) |= BV(CC2420_VREG_PIN))
213 #define SET_VREG_INACTIVE() (CC2420_VREG_PORT(OUT) &= ~BV(CC2420_VREG_PIN))
216 #define CC2420_FIFOP_INT_INIT() do { \
217 CC2420_FIFOP_PORT(IES) &= ~BV(CC2420_FIFOP_PIN); \
218 CC2420_CLEAR_FIFOP_INT(); \
222 #define CC2420_ENABLE_FIFOP_INT() do { CC2420_FIFOP_PORT(IE) |= BV(CC2420_FIFOP_PIN); } while(0)
223 #define CC2420_DISABLE_FIFOP_INT() do { CC2420_FIFOP_PORT(IE) &= ~BV(CC2420_FIFOP_PIN); } while(0)
224 #define CC2420_CLEAR_FIFOP_INT() do { CC2420_FIFOP_PORT(IFG) &= ~BV(CC2420_FIFOP_PIN); } while(0)
232 #define CC2420_SPI_ENABLE() (CC2420_CSN_PORT(OUT) &= ~BV(CC2420_CSN_PIN))
234 #define CC2420_SPI_DISABLE() (CC2420_CSN_PORT(OUT) |= BV(CC2420_CSN_PIN))
235 #define CC2420_SPI_IS_ENABLED() ((CC2420_CSN_PORT(OUT) & BV(CC2420_CSN_PIN)) != BV(CC2420_CSN_PIN))
241 #define I2C_PxDIR P5DIR
242 #define I2C_PxIN P5IN
243 #define I2C_PxOUT P5OUT
244 #define I2C_PxSEL P5SEL
245 #define I2C_PxSEL2 P5SEL2
246 #define I2C_PxREN P5REN
248 #define I2C_SDA (1 << 1)
249 #define I2C_SCL (1 << 2)
250 #define I2C_PRESC_1KHZ_LSB 0x00
251 #define I2C_PRESC_1KHZ_MSB 0x20
252 #define I2C_PRESC_100KHZ_LSB 0x50
253 #define I2C_PRESC_100KHZ_MSB 0x00
254 #define I2C_PRESC_400KHZ_LSB 0x14
255 #define I2C_PRESC_400KHZ_MSB 0x00
258 #ifndef I2C_PRESC_Z1_LSB
259 #define I2C_PRESC_Z1_LSB I2C_PRESC_400KHZ_LSB
262 #ifndef I2C_PRESC_Z1_MSB
263 #define I2C_PRESC_Z1_MSB I2C_PRESC_400KHZ_MSB
267 #ifdef I2C_CONF_RX_WITH_INTERRUPT
268 #define I2C_RX_WITH_INTERRUPT I2C_CONF_RX_WITH_INTERRUPT
270 #define I2C_RX_WITH_INTERRUPT 1