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)
129 #define EEPROMFS_ADDR_CODEPROP (1 * XMEM_ERASE_UNIT_SIZE)
131 #define CFS_XMEM_CONF_OFFSET (2 * XMEM_ERASE_UNIT_SIZE)
132 #define CFS_XMEM_CONF_SIZE (1 * XMEM_ERASE_UNIT_SIZE)
134 #define CFS_RAM_CONF_SIZE 4096
141 #define SPI_TXBUF UCB0TXBUF
142 #define SPI_RXBUF UCB0RXBUF
145 #define SPI_WAITFOREOTx() while((UCB0STAT & UCBUSY) != 0)
147 #define SPI_WAITFOREORx() while((IFG2 & UCB0RXIFG) == 0)
149 #define SPI_WAITFORTxREADY() while((IFG2 & UCB0TXIFG) == 0)
164 #define SPI_FLASH_ENABLE() (P4OUT &= ~BV(FLASH_CS))
165 #define SPI_FLASH_DISABLE() (P4OUT |= BV(FLASH_CS))
167 #define SPI_FLASH_HOLD() (P5OUT &= ~BV(FLASH_HOLD))
168 #define SPI_FLASH_UNHOLD() (P5OUT |= BV(FLASH_HOLD))
174 #define CC2420_CONF_SYMBOL_LOOP_COUNT 1302
177 #define CC2420_FIFOP_PORT(type) P1##type
178 #define CC2420_FIFOP_PIN 2
180 #define CC2420_FIFO_PORT(type) P1##type
181 #define CC2420_FIFO_PIN 3
183 #define CC2420_CCA_PORT(type) P1##type
184 #define CC2420_CCA_PIN 4
186 #define CC2420_SFD_PORT(type) P4##type
187 #define CC2420_SFD_PIN 1
189 #define CC2420_CSN_PORT(type) P3##type
190 #define CC2420_CSN_PIN 0
192 #define CC2420_VREG_PORT(type) P4##type
193 #define CC2420_VREG_PIN 5
195 #define CC2420_RESET_PORT(type) P4##type
196 #define CC2420_RESET_PIN 6
198 #define CC2420_IRQ_VECTOR PORT1_VECTOR
201 #define CC2420_FIFOP_IS_1 (!!(CC2420_FIFOP_PORT(IN) & BV(CC2420_FIFOP_PIN)))
202 #define CC2420_FIFO_IS_1 (!!(CC2420_FIFO_PORT(IN) & BV(CC2420_FIFO_PIN)))
203 #define CC2420_CCA_IS_1 (!!(CC2420_CCA_PORT(IN) & BV(CC2420_CCA_PIN)))
204 #define CC2420_SFD_IS_1 (!!(CC2420_SFD_PORT(IN) & BV(CC2420_SFD_PIN)))
207 #define SET_RESET_INACTIVE() (CC2420_RESET_PORT(OUT) |= BV(CC2420_RESET_PIN))
208 #define SET_RESET_ACTIVE() (CC2420_RESET_PORT(OUT) &= ~BV(CC2420_RESET_PIN))
211 #define SET_VREG_ACTIVE() (CC2420_VREG_PORT(OUT) |= BV(CC2420_VREG_PIN))
212 #define SET_VREG_INACTIVE() (CC2420_VREG_PORT(OUT) &= ~BV(CC2420_VREG_PIN))
215 #define CC2420_FIFOP_INT_INIT() do { \
216 CC2420_FIFOP_PORT(IES) &= ~BV(CC2420_FIFOP_PIN); \
217 CC2420_CLEAR_FIFOP_INT(); \
221 #define CC2420_ENABLE_FIFOP_INT() do { CC2420_FIFOP_PORT(IE) |= BV(CC2420_FIFOP_PIN); } while(0)
222 #define CC2420_DISABLE_FIFOP_INT() do { CC2420_FIFOP_PORT(IE) &= ~BV(CC2420_FIFOP_PIN); } while(0)
223 #define CC2420_CLEAR_FIFOP_INT() do { CC2420_FIFOP_PORT(IFG) &= ~BV(CC2420_FIFOP_PIN); } while(0)
231 #define CC2420_SPI_ENABLE() (CC2420_CSN_PORT(OUT) &= ~BV(CC2420_CSN_PIN))
233 #define CC2420_SPI_DISABLE() (CC2420_CSN_PORT(OUT) |= BV(CC2420_CSN_PIN))
234 #define CC2420_SPI_IS_ENABLED() ((CC2420_CSN_PORT(OUT) & BV(CC2420_CSN_PIN)) != BV(CC2420_CSN_PIN))
240 #define I2C_PxDIR P5DIR
241 #define I2C_PxIN P5IN
242 #define I2C_PxOUT P5OUT
243 #define I2C_PxSEL P5SEL
244 #define I2C_PxSEL2 P5SEL2
245 #define I2C_PxREN P5REN
247 #define I2C_SDA (1 << 1)
248 #define I2C_SCL (1 << 2)
249 #define I2C_PRESC_1KHZ_LSB 0x00
250 #define I2C_PRESC_1KHZ_MSB 0x20
251 #define I2C_PRESC_100KHZ_LSB 0x50
252 #define I2C_PRESC_100KHZ_MSB 0x00
253 #define I2C_PRESC_400KHZ_LSB 0x14
254 #define I2C_PRESC_400KHZ_MSB 0x00
257 #ifndef I2C_PRESC_Z1_LSB
258 #define I2C_PRESC_Z1_LSB I2C_PRESC_400KHZ_LSB
261 #ifndef I2C_PRESC_Z1_MSB
262 #define I2C_PRESC_Z1_MSB I2C_PRESC_400KHZ_MSB
266 #ifdef I2C_CONF_RX_WITH_INTERRUPT
267 #define I2C_RX_WITH_INTERRUPT I2C_CONF_RX_WITH_INTERRUPT
269 #define I2C_RX_WITH_INTERRUPT 1