Go to the documentation of this file.
40 #ifndef __PLATFORM_CONF_H__
41 #define __PLATFORM_CONF_H__
47 #define PLATFORM PLATFORM_AVR
56 #define CLOCK_CONF_SECOND 128
60 #define LEDS_PxDIR DDRA // port direction register
61 #define LEDS_PxOUT PORTA // port register
62 #define LEDS_CONF_RED 0x04 //red led
63 #define LEDS_CONF_GREEN 0x02 // green led
64 #define LEDS_CONF_YELLOW 0x01 // yellow led
67 #define SLIP_PORT RS232_PORT_0
70 #define MMEM_CONF_SIZE 256
75 #define EEPROMFS_ADDR_CODEPROP 0x8000
77 #define EEPROM_NODE_ID_START 0x00
80 #define NETSTACK_CONF_RADIO cc2420_driver
88 #define SPI_TXBUF SPDR
89 #define SPI_RXBUF SPDR
91 #define BV(bitno) _BV(bitno)
93 #define SPI_WAITFOREOTx() do { while (!(SPSR & BV(SPIF))); } while (0)
94 #define SPI_WAITFOREORx() do { while (!(SPSR & BV(SPIF))); } while (0)
110 #define SPI_FLASH_ENABLE() ( P4OUT &= ~BV(FLASH_CS) )
111 #define SPI_FLASH_DISABLE() ( P4OUT |= BV(FLASH_CS) )
113 #define SPI_FLASH_HOLD() ( P4OUT &= ~BV(FLASH_HOLD) )
114 #define SPI_FLASH_UNHOLD() ( P4OUT |= BV(FLASH_HOLD) )
120 #define CC2420_CONF_SYMBOL_LOOP_COUNT 500
137 #define CC2420_FIFOP_PORT(type) P##type##E
138 #define CC2420_FIFOP_PIN 6
140 #define CC2420_FIFO_PORT(type) P##type##B
141 #define CC2420_FIFO_PIN 7
143 #define CC2420_CCA_PORT(type) P##type##D
144 #define CC2420_CCA_PIN 6
146 #define CC2420_SFD_PORT(type) P##type##D
147 #define CC2420_SFD_PIN 4
149 #define CC2420_CSN_PORT(type) P##type##B
150 #define CC2420_CSN_PIN 0
152 #define CC2420_VREG_PORT(type) P##type##A
153 #define CC2420_VREG_PIN 5
155 #define CC2420_RESET_PORT(type) P##type##A
156 #define CC2420_RESET_PIN 6
158 #define CC2420_IRQ_VECTOR INT6_vect
161 #define CC2420_FIFOP_IS_1 (!!(CC2420_FIFOP_PORT(IN) & BV(CC2420_FIFOP_PIN)))
162 #define CC2420_FIFO_IS_1 (!!(CC2420_FIFO_PORT(IN) & BV(CC2420_FIFO_PIN)))
163 #define CC2420_CCA_IS_1 (!!(CC2420_CCA_PORT(IN) & BV(CC2420_CCA_PIN)))
164 #define CC2420_SFD_IS_1 (!!(CC2420_SFD_PORT(IN) & BV(CC2420_SFD_PIN)))
167 #define SET_RESET_INACTIVE() (CC2420_RESET_PORT(ORT) |= BV(CC2420_RESET_PIN))
168 #define SET_RESET_ACTIVE() (CC2420_RESET_PORT(ORT) &= ~BV(CC2420_RESET_PIN))
171 #define SET_VREG_ACTIVE() (CC2420_VREG_PORT(ORT) |= BV(CC2420_VREG_PIN))
172 #define SET_VREG_INACTIVE() (CC2420_VREG_PORT(ORT) &= ~BV(CC2420_VREG_PIN))
178 #define CC2420_FIFOP_INT_INIT() do {\
180 CC2420_CLEAR_FIFOP_INT(); \
184 #define CC2420_ENABLE_FIFOP_INT() do { EIMSK |= 0x40; } while (0)
185 #define CC2420_DISABLE_FIFOP_INT() do { EIMSK &= ~0x40; } while (0)
186 #define CC2420_CLEAR_FIFOP_INT() do { EIFR = 0x40; } while (0)
192 #define CC2420_SPI_ENABLE() (PORTB &= ~BV(CSN))
193 #define CC2420_SPI_DISABLE() (PORTB |= BV(CSN))