Contiki 2.6

contiki-conf.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2006, Technical University of Munich
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  * 1. Redistributions of source code must retain the above copyright
00009  *    notice, this list of conditions and the following disclaimer.
00010  * 2. Redistributions in binary form must reproduce the above copyright
00011  *    notice, this list of conditions and the following disclaimer in the
00012  *    documentation and/or other materials provided with the distribution.
00013  * 3. Neither the name of the Institute nor the names of its contributors
00014  *    may be used to endorse or promote products derived from this software
00015  *    without specific prior written permission.
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
00018  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
00021  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00023  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00024  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00025  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00026  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00027  * SUCH DAMAGE.
00028  *
00029  * This file is part of the Contiki operating system.
00030  *
00031  * @(#)$$
00032  */
00033 
00034 /**
00035  * \file
00036  *         Configuration for sample STK 501 Contiki kernel
00037  *
00038  * \author
00039  *         Simon Barner <barner@in.tum.de
00040  */
00041 
00042 #ifndef __CONTIKI_CONF_H__
00043 #define __CONTIKI_CONF_H__
00044 
00045 /*
00046  * MCU and clock rate. Various MCUs can be inserted in the ZIF socket.
00047  */
00048  /* Platform name, type, and MCU clock rate */
00049 #define PLATFORM_NAME  "STK501"
00050 #define PLATFORM_TYPE  STK501
00051 #ifndef MCU
00052 #define MCU      atmega128
00053 #endif
00054 #ifndef F_CPU
00055 #define F_CPU          16000000UL
00056 #endif
00057 
00058 #define HAVE_STDINT_H
00059 #include "avrdef.h"
00060 
00061 /* The AVR tick interrupt usually is done with an 8 bit counter around 128 Hz.
00062  * 125 Hz needs slightly more overhead during the interrupt, as does a 32 bit
00063  * clock_time_t.
00064  */
00065  /* Clock ticks per second */
00066 #define CLOCK_CONF_SECOND 125
00067 #if 1
00068 /* 16 bit counter overflows every ~10 minutes */
00069 typedef unsigned short clock_time_t;
00070 #define CLOCK_LT(a,b)  ((signed short)((a)-(b)) < 0)
00071 #define INFINITE_TIME 0xffff
00072 #define RIME_CONF_BROADCAST_ANNOUNCEMENT_MAX_TIME INFINITE_TIME/CLOCK_CONF_SECOND /* Default uses 600 */
00073 #define COLLECT_CONF_BROADCAST_ANNOUNCEMENT_MAX_TIME INFINITE_TIME/CLOCK_CONF_SECOND /* Default uses 600 */
00074 #else
00075 typedef unsigned long clock_time_t;
00076 #define CLOCK_LT(a,b)  ((signed long)((a)-(b)) < 0)
00077 #define INFINITE_TIME 0xffffffff
00078 #endif
00079 /* These routines are not part of the contiki core but can be enabled in cpu/avr/clock.c */
00080 void clock_delay_msec(uint16_t howlong);
00081 void clock_adjust_ticks(clock_time_t howmany);
00082 
00083 /* COM port to be used for SLIP connection */
00084 #define SLIP_PORT RS232_PORT_0
00085 
00086 /* Pre-allocated memory for loadable modules heap space (in bytes)*/
00087 #define MMEM_CONF_SIZE 256
00088 
00089 /* Use the following address for code received via the codeprop
00090  * facility
00091  */
00092 #define EEPROMFS_ADDR_CODEPROP 0x8000
00093 
00094 #define CCIF
00095 #define CLIF
00096 
00097 #define UIP_CONF_PINGADDRCONF    0
00098 #define UIP_CONF_MAX_CONNECTIONS 4
00099 #define UIP_CONF_MAX_LISTENPORTS 4
00100 #define UIP_CONF_BUFFER_SIZE     100
00101 #define UIP_CONF_TCP_SPLIT       1
00102 #define UIP_CONF_FWCACHE_SIZE    2
00103 #define UIP_CONF_BROADCAST       1
00104 #define UIP_UDP                  1
00105 
00106 #define HAVE_STDINT_H
00107 #include "avrdef.h"
00108 
00109 typedef unsigned short uip_stats_t;
00110 typedef unsigned long off_t;
00111 
00112 #endif /* __CONTIKI_CONF_H__ */