contiki-conf.h
00001
00002
00003
00004 #ifndef CONTIKI_CONF_H
00005 #define CONTIKI_CONF_H
00006
00007 #include <avr/interrupt.h>
00008
00009 #define HAVE_STDINT_H
00010 #include "avrdef.h"
00011
00012
00013
00014 #define CCIF
00015 #define CLIF
00016
00017 #define AODV_COMPLIANCE
00018 #define AODV_NUM_RT_ENTRIES 32
00019
00020 void clock_delay(unsigned int us2);
00021 void clock_wait(int ms10);
00022 void clock_set_seconds(unsigned long s);
00023 unsigned long clock_seconds(void);
00024
00025 #define WITH_UIP 1
00026 #define WITH_ASCII 1
00027
00028 #define PROCESS_CONF_FASTPOLL 4
00029
00030
00031
00032 #define CLOCK_CONF_SECOND 62
00033
00034
00035 #define F_CPU 8000000L
00036
00037
00038 #define BAUD2UBR(baud) ((u16_t)((F_CPU/baud/8uL + 1)/2 - 1))
00039
00040
00041
00042
00043
00044
00045
00046 #define UIP_CONF_DHCP_LIGHT
00047 #define UIP_CONF_LLH_LEN 0
00048 #define UIP_CONF_BUFFER_SIZE 116
00049 #define UIP_CONF_RECEIVE_WINDOW (UIP_CONF_BUFFER_SIZE - 40)
00050 #define UIP_CONF_MAX_CONNECTIONS 4
00051 #define UIP_CONF_MAX_LISTENPORTS 8
00052 #define UIP_CONF_UDP_CONNS 12
00053 #define UIP_CONF_FWCACHE_SIZE 30
00054 #define UIP_CONF_BROADCAST 1
00055
00056 #define UIP_CONF_UDP_CHECKSUMS 1
00057 #define UIP_CONF_PINGADDRCONF 0
00058 #define UIP_CONF_LOGGING 0
00059
00060
00061
00062
00063
00064
00065 #ifdef CB_GATEWAY
00066
00067 #define LEDS_CONF_GREEN _BV(2)
00068 #define LEDS_CONF_YELLOW _BV(3)
00069 #else
00070 #define LEDS_ORANGE 8
00071
00072 #define LEDS_CONF_ORANGE _BV(4)
00073 #define LEDS_CONF_GREEN _BV(7)
00074
00075 #define LEDS_CONF_RED _BV(3)
00076 #define LEDS_CONF_YELLOW _BV(4)
00077 #endif
00078
00079 typedef u16_t uip_stats_t;
00080 typedef u16_t clock_time_t;
00081
00082 typedef u32_t off_t;
00083 #define ROM_ERASE_UNIT_SIZE SPM_PAGESIZE
00084 #define XMEM_ERASE_UNIT_SIZE 8
00085
00086
00087 #define EEPROMFS_ADDR_CODEPROP (128 * XMEM_ERASE_UNIT_SIZE)
00088
00089 #define CC2420_RADIO
00090
00091 #define CC2420_CONF_SYMBOL_LOOP_COUNT 500
00092
00093
00094
00095
00096
00097 #define SPI_TXBUF SPDR
00098 #define SPI_RXBUF SPDR
00099
00100 #define BV(bitno) _BV(bitno)
00101
00102 #define SPI_WAITFOREOTx() do { while (!(SPSR & BV(SPIF))); } while (0)
00103 #define SPI_WAITFOREORx() do { while (!(SPSR & BV(SPIF))); } while (0)
00104
00105 #define SCK 1
00106 #define MOSI 2
00107 #define MISO 3
00108
00109
00110
00111
00112
00113 #define FIFO_P 0
00114 #define FIFO 1
00115 #define CCA 6
00116
00117 #define SFD 4
00118 #define CSN 0
00119 #define VREG_EN 5
00120 #define RESET_N 6
00121
00122
00123
00124 #define FIFO_IS_1 (!!(PIND & BV(FIFO)))
00125 #define CCA_IS_1 (!!(PIND & BV(CCA) ))
00126 #define RESET_IS_1 (!!(PINB & BV(RESET_N)))
00127 #define VREG_IS_1 (!!(PINB & BV(VREG_EN)))
00128 #define FIFOP_IS_1 (!!(PIND & BV(FIFO_P)))
00129 #define SFD_IS_1 (!!(PIND & BV(SFD)))
00130
00131
00132 #define SET_RESET_INACTIVE() ( PORTB |= BV(RESET_N) )
00133 #define SET_RESET_ACTIVE() ( PORTB &= ~BV(RESET_N) )
00134
00135
00136 #define SET_VREG_ACTIVE() ( PORTB |= BV(VREG_EN) )
00137 #define SET_VREG_INACTIVE() ( PORTB &= ~BV(VREG_EN) )
00138
00139
00140 #define FIFOP_INT_INIT() do {\
00141 EICRA |= 0x03; \
00142 CLEAR_FIFOP_INT(); \
00143 } while (0)
00144
00145
00146 #define ENABLE_FIFOP_INT() do { EIMSK |= 0x01; } while (0)
00147 #define DISABLE_FIFOP_INT() do { EIMSK &= ~0x01; } while (0)
00148 #define CLEAR_FIFOP_INT() do { EIFR = 0x01; } while (0)
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159 #define SPI_ENABLE() ( PORTB &= ~BV(CSN) )
00160 #define SPI_DISABLE() ( PORTB |= BV(CSN) )
00161
00162 #endif