aboutsummaryrefslogtreecommitdiffstats
path: root/demos/ARM7-AT91SAM7X-WEB-GCC/web
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2008-05-20 14:24:51 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2008-05-20 14:24:51 +0000
commitf2022a264125bdf3b18e5fe0fe0c2e523cf41ded (patch)
treee5b6176848d2541b145f76d17841ec8b5faa209a /demos/ARM7-AT91SAM7X-WEB-GCC/web
parentb07342596a56c2873357776ab4251dc3b49a0d55 (diff)
downloadChibiOS-f2022a264125bdf3b18e5fe0fe0c2e523cf41ded.tar.gz
ChibiOS-f2022a264125bdf3b18e5fe0fe0c2e523cf41ded.tar.bz2
ChibiOS-f2022a264125bdf3b18e5fe0fe0c2e523cf41ded.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@302 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos/ARM7-AT91SAM7X-WEB-GCC/web')
-rw-r--r--demos/ARM7-AT91SAM7X-WEB-GCC/web/clock-arch.h42
-rw-r--r--demos/ARM7-AT91SAM7X-WEB-GCC/web/uip-conf.h157
-rw-r--r--demos/ARM7-AT91SAM7X-WEB-GCC/web/webthread.c65
-rw-r--r--demos/ARM7-AT91SAM7X-WEB-GCC/web/webthread.h31
4 files changed, 295 insertions, 0 deletions
diff --git a/demos/ARM7-AT91SAM7X-WEB-GCC/web/clock-arch.h b/demos/ARM7-AT91SAM7X-WEB-GCC/web/clock-arch.h
new file mode 100644
index 000000000..e205f9c8d
--- /dev/null
+++ b/demos/ARM7-AT91SAM7X-WEB-GCC/web/clock-arch.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2006, Swedish Institute of Computer Science.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the Institute nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * This file is part of the uIP TCP/IP stack
+ *
+ * $Id: clock-arch.h,v 1.2 2006/06/12 08:00:31 adam Exp $
+ */
+
+#ifndef __CLOCK_ARCH_H__
+#define __CLOCK_ARCH_H__
+
+#include <ch.h>
+
+typedef systime_t clock_time_t;
+#define CLOCK_CONF_SECOND CH_FREQUENCY
+
+#endif /* __CLOCK_ARCH_H__ */
diff --git a/demos/ARM7-AT91SAM7X-WEB-GCC/web/uip-conf.h b/demos/ARM7-AT91SAM7X-WEB-GCC/web/uip-conf.h
new file mode 100644
index 000000000..289d4a150
--- /dev/null
+++ b/demos/ARM7-AT91SAM7X-WEB-GCC/web/uip-conf.h
@@ -0,0 +1,157 @@
+/**
+ * \addtogroup uipopt
+ * @{
+ */
+
+/**
+ * \name Project-specific configuration options
+ * @{
+ *
+ * uIP has a number of configuration options that can be overridden
+ * for each project. These are kept in a project-specific uip-conf.h
+ * file and all configuration names have the prefix UIP_CONF.
+ */
+
+/*
+ * Copyright (c) 2006, Swedish Institute of Computer Science.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the Institute nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * This file is part of the uIP TCP/IP stack
+ *
+ * $Id: uip-conf.h,v 1.6 2006/06/12 08:00:31 adam Exp $
+ */
+
+/**
+ * \file
+ * An example uIP configuration file
+ * \author
+ * Adam Dunkels <adam@sics.se>
+ */
+
+#ifndef __UIP_CONF_H__
+#define __UIP_CONF_H__
+
+#include <stdint.h>
+
+/**
+ * 8 bit datatype
+ *
+ * This typedef defines the 8-bit type used throughout uIP.
+ *
+ * \hideinitializer
+ */
+typedef uint8_t u8_t;
+
+/**
+ * 16 bit datatype
+ *
+ * This typedef defines the 16-bit type used throughout uIP.
+ *
+ * \hideinitializer
+ */
+typedef uint16_t u16_t;
+
+/**
+ * Statistics datatype
+ *
+ * This typedef defines the dataype used for keeping statistics in
+ * uIP.
+ *
+ * \hideinitializer
+ */
+typedef unsigned short uip_stats_t;
+
+/**
+ * Maximum number of TCP connections.
+ *
+ * \hideinitializer
+ */
+#define UIP_CONF_MAX_CONNECTIONS 40
+
+/**
+ * Maximum number of listening TCP ports.
+ *
+ * \hideinitializer
+ */
+#define UIP_CONF_MAX_LISTENPORTS 40
+
+/**
+ * uIP buffer size.
+ *
+ * \hideinitializer
+ */
+#define UIP_CONF_BUFFER_SIZE 1518
+
+/**
+ * CPU byte order.
+ *
+ * \hideinitializer
+ */
+#define UIP_CONF_BYTE_ORDER LITTLE_ENDIAN
+
+/**
+ * Logging on or off
+ *
+ * \hideinitializer
+ */
+#define UIP_CONF_LOGGING 0
+
+/**
+ * UDP support on or off
+ *
+ * \hideinitializer
+ */
+#define UIP_CONF_UDP 0
+
+/**
+ * UDP checksums on or off
+ *
+ * \hideinitializer
+ */
+#define UIP_CONF_UDP_CHECKSUMS 1
+
+/**
+ * uIP statistics on or off
+ *
+ * \hideinitializer
+ */
+#define UIP_CONF_STATISTICS 1
+
+/* Here we include the header file for the application(s) we use in
+ our project. */
+/*#include "smtp.h"*/
+/*#include "hello-world.h"*/
+/*#include "telnetd.h"*/
+#include "webserver.h"
+/*#include "dhcpc.h"*/
+/*#include "resolv.h"*/
+/*#include "webclient.h"*/
+
+#endif /* __UIP_CONF_H__ */
+
+/** @} */
+/** @} */
diff --git a/demos/ARM7-AT91SAM7X-WEB-GCC/web/webthread.c b/demos/ARM7-AT91SAM7X-WEB-GCC/web/webthread.c
new file mode 100644
index 000000000..a4fb3de03
--- /dev/null
+++ b/demos/ARM7-AT91SAM7X-WEB-GCC/web/webthread.c
@@ -0,0 +1,65 @@
+/*
+ ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio.
+
+ This file is part of ChibiOS/RT.
+
+ ChibiOS/RT is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ ChibiOS/RT is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <ch.h>
+#include <evtimer.h>
+#include <sam7x_emac.h>
+
+#include <uip.h>
+#include <uip_arp.h>
+#include <httpd.h>
+#include <timer.h>
+#include <clock-arch.h>
+
+static EvTimer evt;
+struct EventListener el0, el1, el2;
+
+void clock_init(void) {}
+
+clock_time_t clock_time( void )
+{
+ return chSysGetTime();
+}
+
+/*
+ * Executed as event handler at 1000mS intervals.
+ */
+static void TimerHandler(eventid_t id) {
+
+ (void)EMACGetLinkStatus();
+}
+
+msg_t WebThread(void *p) {
+ static const evhandler_t evhndl[] = {
+ TimerHandler,
+ NULL,
+ NULL
+ };
+
+ evtInit(&evt, 1000); /* Initializes an event timer object. */
+ evtStart(&evt); /* Starts the event timer. */
+ chEvtRegister(&evt.et_es, &el0, 0); /* Registers on the timer event source. */
+ chEvtRegister(&EMACFrameTransmitted, &el1, 1);
+ chEvtRegister(&EMACFrameReceived, &el2, 2);
+
+ while (TRUE) {
+ chEvtWait(ALL_EVENTS, evhndl);
+ }
+ return 0;
+}
diff --git a/demos/ARM7-AT91SAM7X-WEB-GCC/web/webthread.h b/demos/ARM7-AT91SAM7X-WEB-GCC/web/webthread.h
new file mode 100644
index 000000000..bd71b4dc4
--- /dev/null
+++ b/demos/ARM7-AT91SAM7X-WEB-GCC/web/webthread.h
@@ -0,0 +1,31 @@
+/*
+ ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio.
+
+ This file is part of ChibiOS/RT.
+
+ ChibiOS/RT is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ ChibiOS/RT is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef _WEBTHREAD_H_
+#define _WEBTHREAD_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ msg_t WebThread(void *p);
+ #ifdef __cplusplus
+}
+#endif
+
+#endif /* _WEBTHREAD_H_ */