diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2010-01-12 07:29:43 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2010-01-12 07:29:43 +0000 |
commit | f0d6d4ef13ddce09cfc3f684a5e5192cdd4e6a60 (patch) | |
tree | e0ccee47d8245956137f0e8f2ecd59a70b05e7b1 /Projects/Incomplete/Webserver/Lib/uip/conf | |
parent | 89e4d73289b6156aebf4e3e492033d6b017c7813 (diff) | |
download | lufa-f0d6d4ef13ddce09cfc3f684a5e5192cdd4e6a60.tar.gz lufa-f0d6d4ef13ddce09cfc3f684a5e5192cdd4e6a60.tar.bz2 lufa-f0d6d4ef13ddce09cfc3f684a5e5192cdd4e6a60.zip |
Started Webserver RNDIS host project.
Diffstat (limited to 'Projects/Incomplete/Webserver/Lib/uip/conf')
5 files changed, 209 insertions, 0 deletions
diff --git a/Projects/Incomplete/Webserver/Lib/uip/conf/apps-conf.h b/Projects/Incomplete/Webserver/Lib/uip/conf/apps-conf.h new file mode 100644 index 000000000..60a7c9eb0 --- /dev/null +++ b/Projects/Incomplete/Webserver/Lib/uip/conf/apps-conf.h @@ -0,0 +1,15 @@ +#ifndef __APPS_CONF_H__
+#define __APPS_CONF_H__
+
+//Here we include the header file for the application(s) we use in our project.
+
+//#include "smtp.h"
+//#include "hello-world.h"
+//#include "simple-httpd.h"
+//#include "telnetd.h"
+//#include "webserver.h"
+//#include "dhcpc.h"
+//#include "resolv.h"
+//#include "webclient.h"
+
+#endif /*__APPS_CONF_H__*/
diff --git a/Projects/Incomplete/Webserver/Lib/uip/conf/clock-arch.c b/Projects/Incomplete/Webserver/Lib/uip/conf/clock-arch.c new file mode 100644 index 000000000..c3e281ebd --- /dev/null +++ b/Projects/Incomplete/Webserver/Lib/uip/conf/clock-arch.c @@ -0,0 +1,43 @@ +#include "global-conf.h" +#include <stdint.h> +#include <stdlib.h> +#include <stdio.h> +#include <avr/interrupt.h> +#include <avr/io.h> +#include <avr/sfr_defs.h> + +#include "clock-arch.h" + +//Counted time +volatile clock_time_t clock_datetime = 0; + +//Overflow interrupt +ISR(TIMER0_OVF_vect) +{
+ clock_datetime += 1; +} + +//Initialise the clock +void clock_init()
+{
+ //Activate overflow interrupt for timer0 + TIMSK0 |= (1<<TOIE0); + + //Use prescaler 1024 + TCCR0B |= ((1<<CS12)|(1<<CS10)); + + //Activate interrupts + sei(); +} + +//Return time +clock_time_t clock_time()
+{
+ clock_time_t time; + + cli(); + time = clock_datetime; + sei(); + + return time; +} diff --git a/Projects/Incomplete/Webserver/Lib/uip/conf/clock-arch.h b/Projects/Incomplete/Webserver/Lib/uip/conf/clock-arch.h new file mode 100644 index 000000000..c759d01a3 --- /dev/null +++ b/Projects/Incomplete/Webserver/Lib/uip/conf/clock-arch.h @@ -0,0 +1,12 @@ +#ifndef __CLOCK_ARCH_H__
+#define __CLOCK_ARCH_H__
+
+#include "global-conf.h"
+#include <stdint.h>
+
+typedef uint16_t clock_time_t;
+#define CLOCK_CONF_SECOND (F_CPU / 1024 / 255) //Freqency divided prescaler and counter register size
+void clock_init(void);
+clock_time_t clock_time(void);
+
+#endif /* __CLOCK_ARCH_H__ */
diff --git a/Projects/Incomplete/Webserver/Lib/uip/conf/global-conf.h b/Projects/Incomplete/Webserver/Lib/uip/conf/global-conf.h new file mode 100644 index 000000000..a9f118d4d --- /dev/null +++ b/Projects/Incomplete/Webserver/Lib/uip/conf/global-conf.h @@ -0,0 +1,12 @@ +//Project specific configurations
+#ifndef __GLOBAL_CONF_H__
+#define __GLOBAL_CONF_H__
+
+//Define frequency
+// #define F_CPU 12500000UL
+//
+
+//Include uip.h gives all the uip configurations in uip-conf.h
+#include "uip.h"
+
+#endif /*__GLOBAL_CONF_H__*/
diff --git a/Projects/Incomplete/Webserver/Lib/uip/conf/uip-conf.h b/Projects/Incomplete/Webserver/Lib/uip/conf/uip-conf.h new file mode 100644 index 000000000..d46fa265c --- /dev/null +++ b/Projects/Incomplete/Webserver/Lib/uip/conf/uip-conf.h @@ -0,0 +1,127 @@ +#ifndef __UIP_CONF_H__
+#define __UIP_CONF_H__
+
+#include <inttypes.h>
+#include <avr/io.h>
+#include <stdio.h>
+#include <stdbool.h>
+
+typedef int uip_tcp_appstate_t;
+typedef int uip_udp_appstate_t;
+
+#define UIP_APPCALL TCPCallback
+#define UIP_UDP_APPCALL TCPCallback
+
+void UIP_APPCALL(void);
+void UIP_UDP_APPCALL(void);
+
+#define UIP_CONF_LLH_LEN 14
+
+/**
+ * 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;
+
+#define UIP_CONF_IPV6 0
+#define UIP_ARCH_ADD32 0
+#define UIP_ARCH_CHKSUM 0
+
+/**
+ * Maximum number of TCP connections.
+ *
+ * \hideinitializer
+ */
+#define UIP_CONF_MAX_CONNECTIONS 5
+
+/**
+ * Maximum number of listening TCP ports.
+ *
+ * \hideinitializer
+ */
+#define UIP_CONF_MAX_LISTENPORTS 1
+
+/**
+ * uIP buffer size.
+ *
+ * \hideinitializer
+ */
+#define UIP_CONF_BUFFER_SIZE 1100
+/**
+ * CPU byte order.
+ *
+ * \hideinitializer
+ */
+#define UIP_CONF_BYTE_ORDER UIP_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 0
+
+/**
+ * uIP statistics on or off
+ *
+ * \hideinitializer
+ */
+#define UIP_CONF_STATISTICS 0
+
+/**
+ * Broadcast support.
+ *
+ * \hideinitializer
+ */
+#define UIP_CONF_BROADCAST 0
+
+/**
+ * The maximum amount of concurrent UDP connections.
+ *
+ * \hideinitializer
+ */
+#define UIP_CONF_UDP_CONNS 1
+
+//Include app configuration
+#include "apps-conf.h"
+
+#endif /* __UIP_CONF_H__ */
+
+/** @} */
+/** @} */
|