00001 /*** 00002 * This file is part of OpenHome, an open source home automation system. 00003 * Copyright (C) 2003 Jan Klötzke 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation; either version 2 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 */ 00019 00020 #ifndef __NET_H 00021 #define __NET_H 00022 00023 /*** 00024 * Feature definitions. Adjust according to your destination CPU and needs. 00025 */ 00026 00027 /******************************************************************************* 00028 * Link layer definitions. 00029 */ 00030 00031 /*** 00032 * Specify your desired baud rate and current master clock frequency. 00033 * Note that the actual baud rate may differ. (see manual) 00034 * Also keep in mind that high rates may not be feasible due to edm and 00035 * protocol processing time and other interrupts. 00036 */ 00037 #define LNK_BAUD_RATE 9600 /* desired baud rate */ 00038 #define LNK_F_CLK 6000000 /* your clock frequency */ 00039 00040 /*** 00041 * Send port 00042 */ 00043 #define LNK_SEND_PORT PORTE 00044 #define LNK_SEND_DDR DDRE 00045 #define LNK_SEND_PIN PE2 00046 00047 /*** 00048 * Receive buffer size 00049 */ 00050 #define LNK_BUFFER_SIZE 255 00051 00052 /*** 00053 * beta1: idle time to signal packet end 00054 * beta2: minimum idle time after packet 00055 */ 00056 #define LNK_BETA_1 18 00057 #define LNK_BETA_2 24 00058 00059 #define LNK_ALPHA_TIME 0xd0 /* value loaded into TCNT0 */ 00060 #define LNK_ALPHA_PRESC 0x02 /* timer 0 prescaler, written to TCCR0 */ 00061 00062 00063 #define LNK_EXT_INT INT6 00064 #define LNK_EXT_ISCx1 ISC61 00065 #define LNK_EXT_SIG SIG_INTERRUPT6 00066 00067 /******************************************************************************* 00068 * Network layer definitions. 00069 */ 00070 00071 #define NET_LOGIC_ADDR 0x0001 00072 #define NET_PHYSICAL_ADDR 0x55500001 00073 00074 00075 /******************************************************************************* 00076 * Transport layer definitions. 00077 */ 00078 00079 #define TSP_TIMEOUT 200 00080 00081 #define TSP_MAX_GROUPS 256 00082 00083 // address cache size 00084 #define TSP_CACHE_SIZE 4 /* number of max simultanious transactions */ 00085 #define TSP_REPLY_SIZE 8 /* this MUST be a power of two */ 00086 00087 /******************************************************************************* 00088 * Application layer definitions. 00089 */ 00090 00091 #define APP_BUFFER_SIZE 64 00092 00093 #define APP_MAX_ASSOC 64 00094 00095 #define APP_MAX_EVENTS 8 /* Number of max. pending events. MUST be a power of two! */ 00096 00097 #endif