3 Copyright (C) Dean Camera, 2009.
5 dean [at] fourwalledcubicle [dot] com
6 www.fourwalledcubicle.com
10 Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
12 Permission to use, copy, modify, and distribute this software
13 and its documentation for any purpose and without fee is hereby
14 granted, provided that the above copyright notice appear in all
15 copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
21 The author disclaim all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
33 * Header file for RNDISEthernet.c.
36 #ifndef _RNDISETHERNET_H_
37 #define _RNDISETHERNET_H_
42 #include <avr/pgmspace.h>
43 #include <avr/power.h>
47 #include "Descriptors.h"
49 #include "Lib/RNDIS.h"
50 #include "Lib/Ethernet.h"
53 #include "Lib/Webserver.h"
55 #include <LUFA/Version.h> // Library Version Information
56 #include <LUFA/Drivers/USB/USB.h> // USB Functionality
57 #include <LUFA/Drivers/Board/LEDs.h> // LEDs driver
58 #include <LUFA/Scheduler/Scheduler.h> // Simple scheduler for task management
59 #include <LUFA/Drivers/Peripheral/SerialStream.h> // Serial stream driver
62 /** Notification value to indicate that a frame is ready to be read by the host. */
63 #define NOTIF_RESPONSE_AVAILABLE 0x01
66 /** Type define for a RNDIS notification message, for transmission to the RNDIS host via the notification
71 uint8_t bmRequestType
; /**< Notification type, a mask of values from SrdRequestType.h */
72 uint8_t bNotification
; /**< Notification index, indicating what the RNDIS notification relates to */
73 uint16_t wValue
; /**< Two byte notification value parameter */
74 uint16_t wIndex
; /**< Two byte notification index parameter */
75 uint16_t wLength
; /**< Size of data payload following the notification header */
79 /** Enum for the possible status codes for passing to the UpdateStatus() function. */
80 enum RNDISEthernet_StatusCodes_t
82 Status_USBNotReady
= 0, /**< USB is not ready (disconnected from a USB host) */
83 Status_USBEnumerating
= 1, /**< USB interface is enumerating */
84 Status_USBReady
= 2, /**< USB interface is connected and ready */
85 Status_ProcessingEthernetFrame
= 3, /**< Currently processing an ethernet frame from the host */
92 /* Function Prototypes: */
93 void EVENT_USB_Connect(void);
94 void EVENT_USB_Disconnect(void);
95 void EVENT_USB_ConfigurationChanged(void);
96 void EVENT_USB_UnhandledControlPacket(void);
98 void UpdateStatus(uint8_t CurrentStatus
);