Contiki 2.6

contiki-conf.h

00001 #ifndef __CONTIKI_CONF_H__
00002 #define __CONTIKI_CONF_H__
00003 
00004 #include "8051def.h"
00005 #include "sys/cc.h"
00006 #include <string.h>
00007 
00008 /* Include Project Specific conf */
00009 #ifdef PROJECT_CONF_H
00010 #include "project-conf.h"
00011 #endif /* PROJECT_CONF_H */
00012 
00013 #include "models.h"
00014 
00015 /*
00016  * Define this as 1 to poll the etimer process from within main instead of from
00017  * the clock ISR. This reduces the ISR's stack usage and may prevent crashes.
00018  */
00019 #ifndef CLOCK_CONF_STACK_FRIENDLY
00020 #define CLOCK_CONF_STACK_FRIENDLY 1
00021 #endif
00022 
00023 /* Energest Module */
00024 #ifndef ENERGEST_CONF_ON
00025 #define ENERGEST_CONF_ON      0
00026 #endif
00027 
00028 /* Verbose Startup? Turning this off saves plenty of bytes of CODE in HOME */
00029 #ifndef STARTUP_CONF_VERBOSE
00030 #define STARTUP_CONF_VERBOSE  0
00031 #endif
00032 
00033 /* More CODE space savings by turning off process names */
00034 #define PROCESS_CONF_NO_PROCESS_NAMES 1
00035 
00036 /*
00037  * USARTs:
00038  *   SmartRF RS232 -> USART0 / Alternative 1 (UART)
00039  *   SmartRF LCD   -> USART1 / Alternative 2 (SPI)
00040  */
00041 #define UART_ON_USART     0
00042 
00043 #define UART1_CONF_ENABLE 0
00044 
00045 #ifndef UART0_CONF_ENABLE
00046 #define UART0_CONF_ENABLE  1
00047 #endif
00048 #ifndef UART0_CONF_WITH_INPUT
00049 #define UART0_CONF_WITH_INPUT 0
00050 #endif
00051 
00052 #ifndef UART0_CONF_HIGH_SPEED
00053 #define UART0_CONF_HIGH_SPEED 0
00054 #endif
00055 
00056 /* Are we a SLIP bridge? */
00057 #if SLIP_ARCH_CONF_ENABLE
00058 /* Make sure the UART is enabled, with interrupts */
00059 #undef UART0_CONF_ENABLE
00060 #undef UART0_CONF_WITH_INPUT
00061 #define UART0_CONF_ENABLE  1
00062 #define UART0_CONF_WITH_INPUT 1
00063 #define UIP_FALLBACK_INTERFACE slip_interface
00064 #endif
00065 
00066 /* Output all captured frames over the UART in hexdump format */
00067 #ifndef CC2530_RF_CONF_HEXDUMP
00068 #define CC2530_RF_CONF_HEXDUMP 0
00069 #endif
00070 
00071 #if CC2530_RF_CONF_HEXDUMP
00072 /* We need UART1 output */
00073 #undef UART_ZERO_CONF_ENABLE
00074 #define UART_ZERO_CONF_ENABLE   1
00075 #endif
00076 
00077 /* Code Shortcuts */
00078 /*
00079  * When set, this directive also configures the following bypasses:
00080  *   - process_post_synch() in tcpip_input() (we call packet_input())
00081  *   - process_post_synch() in tcpip_uipcall (we call the relevant pthread)
00082  *   - mac_call_sent_callback() is replaced with sent() in various places
00083  *
00084  * These are good things to do, they reduce stack usage and prevent crashes
00085  */
00086 #define NETSTACK_CONF_SHORTCUTS   1
00087 
00088 /*
00089  * By default we read our MAC from the (read-only) Information Page (primary
00090  * location). In order to have a user-programmable mac, define this as 0 to
00091  * use the secondary location (addresses 0xFFE8 - 0xFFEF on the last flash page)
00092  */
00093 #ifndef CC2530_CONF_MAC_FROM_PRIMARY
00094 #define CC2530_CONF_MAC_FROM_PRIMARY 1
00095 #endif
00096 
00097 /*
00098  * Sensors
00099  * It is harmless to #define XYZ 1
00100  * even if the sensor is not present on our device
00101  */
00102 #ifndef BUTTON_SENSOR_CONF_ON
00103 #define BUTTON_SENSOR_CONF_ON   1  /* Buttons */
00104 #endif
00105 
00106 /* B2 on the cc2531 USB stick can be a reset button or a general-purpose one */
00107 #ifndef CC2531_CONF_B2_REBOOTS
00108 #define CC2531_CONF_B2_REBOOTS        0  /* General Purpose by default */
00109 #endif
00110 
00111 /* ADC - Turning this off will disable everything below */
00112 #ifndef ADC_SENSOR_CONF_ON
00113 #define ADC_SENSOR_CONF_ON      1
00114 #endif
00115 #define TEMP_SENSOR_CONF_ON     1  /* Temperature */
00116 #define VDD_SENSOR_CONF_ON      1  /* Supply Voltage */
00117 #define BATTERY_SENSOR_CONF_ON  0  /* Battery */
00118 
00119 /* Low Power Modes - We only support PM0/Idle and PM1 */
00120 #ifndef LPM_CONF_MODE
00121 #define LPM_CONF_MODE         0 /* 0: no LPM, 1: MCU IDLE, 2: Drop to PM1 */
00122 #endif
00123 
00124 /* DMA Configuration */
00125 #ifndef DMA_CONF_ON
00126 #define DMA_CONF_ON 0
00127 #endif
00128 
00129 /* Viztool on by default for IPv6 builds */
00130 #if UIP_CONF_IPV6
00131 #ifndef VIZTOOL_CONF_ON
00132 #define VIZTOOL_CONF_ON        1
00133 #endif /* VIZTOOL_CONF_ON */
00134 #endif /* UIP_CONF_IPV6 */
00135 
00136 /* Network Stack */
00137 #if UIP_CONF_IPV6
00138 #define NETSTACK_CONF_NETWORK sicslowpan_driver
00139 #else
00140 #define NETSTACK_CONF_NETWORK rime_driver
00141 #endif
00142 
00143 #ifndef NETSTACK_CONF_MAC
00144 #define NETSTACK_CONF_MAC     csma_driver
00145 #endif
00146 
00147 #ifndef NETSTACK_CONF_RDC
00148 #define NETSTACK_CONF_RDC     nullrdc_driver
00149 #define NULLRDC_802154_AUTOACK 1
00150 #define NULLRDC_802154_AUTOACK_HW 1
00151 #endif
00152 
00153 #ifndef NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE
00154 #define NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE 8
00155 #endif
00156 
00157 #define NETSTACK_CONF_FRAMER  framer_802154
00158 #define NETSTACK_CONF_RADIO   cc2530_rf_driver
00159 
00160 /* RF Config */
00161 #define IEEE802154_CONF_PANID 0x5449 /* TI */
00162 
00163 #ifndef CC2530_RF_CONF_CHANNEL
00164 #define CC2530_RF_CONF_CHANNEL    25
00165 #endif /* CC2530_RF_CONF_CHANNEL */
00166 
00167 #ifndef CC2530_RF_CONF_AUTOACK
00168 #define CC2530_RF_CONF_AUTOACK 1
00169 #endif /* CC2530_CONF_AUTOACK */
00170 
00171 #if UIP_CONF_IPV6
00172 /* Addresses, Sizes and Interfaces */
00173 /* 8-byte addresses here, 2 otherwise */
00174 #define RIMEADDR_CONF_SIZE                   8
00175 #define UIP_CONF_LL_802154                   1
00176 #define UIP_CONF_LLH_LEN                     0
00177 #define UIP_CONF_NETIF_MAX_ADDRESSES         3
00178 
00179 /* TCP, UDP, ICMP */
00180 #define UIP_CONF_TCP                         0
00181 #define UIP_CONF_UDP                         1
00182 #define UIP_CONF_UDP_CHECKSUMS               1
00183 
00184 /* ND and Routing */
00185 #ifndef UIP_CONF_ROUTER
00186 #define UIP_CONF_ROUTER                      1
00187 #endif
00188 
00189 /* Prevent SDCC compile error when UIP_CONF_ROUTER == 0 */
00190 #if !UIP_CONF_ROUTER
00191 #define UIP_CONF_DS6_AADDR_NBU               1
00192 #endif
00193 
00194 #define UIP_CONF_ND6_SEND_RA                 0
00195 #define UIP_CONF_IP_FORWARD                  0
00196 #define RPL_CONF_STATS                       0
00197 #define RPL_CONF_MAX_DAG_ENTRIES             1
00198 #ifndef RPL_CONF_OF
00199 #define RPL_CONF_OF rpl_of_etx
00200 #endif
00201 
00202 #define UIP_CONF_ND6_REACHABLE_TIME     600000
00203 #define UIP_CONF_ND6_RETRANS_TIMER       10000
00204 
00205 #ifndef UIP_CONF_DS6_NBR_NBU
00206 #define UIP_CONF_DS6_NBR_NBU                 4 /* Handle n Neighbors */
00207 #endif
00208 #ifndef UIP_CONF_DS6_ROUTE_NBU
00209 #define UIP_CONF_DS6_ROUTE_NBU               4 /* Handle n Routes */
00210 #endif
00211 
00212 /* uIP */
00213 #define UIP_CONF_BUFFER_SIZE               240
00214 #define UIP_CONF_IPV6_QUEUE_PKT              0
00215 #define UIP_CONF_IPV6_CHECKS                 1
00216 #define UIP_CONF_IPV6_REASSEMBLY             0
00217 
00218 /* 6lowpan */
00219 #define SICSLOWPAN_CONF_COMPRESSION          SICSLOWPAN_COMPRESSION_HC06
00220 #ifndef SICSLOWPAN_CONF_FRAG
00221 #define SICSLOWPAN_CONF_FRAG                 0 /* About 2KB of CODE if 1 */
00222 #endif
00223 #define SICSLOWPAN_CONF_MAXAGE               8
00224 
00225 /* Define our IPv6 prefixes/contexts here */
00226 #define SICSLOWPAN_CONF_MAX_ADDR_CONTEXTS    1
00227 #define SICSLOWPAN_CONF_ADDR_CONTEXT_0 { \
00228   addr_contexts[0].prefix[0] = 0xaa; \
00229   addr_contexts[0].prefix[1] = 0xaa; \
00230 }
00231 
00232 #define MAC_CONF_CHANNEL_CHECK_RATE          8
00233 #define QUEUEBUF_CONF_NUM                    6
00234 
00235 #else /* UIP_CONF_IPV6 */
00236 /* Network setup for non-IPv6 (rime). */
00237 #define UIP_CONF_IP_FORWARD                  1
00238 #define UIP_CONF_BUFFER_SIZE               108
00239 #define RIME_CONF_NO_POLITE_ANNOUCEMENTS     0
00240 #define QUEUEBUF_CONF_NUM                    8
00241 #endif /* UIP_CONF_IPV6 */
00242 
00243 #endif /* __CONTIKI_CONF_H__ */