]> git.sur5r.net Git - freertos/blob - Demo/lwIP_Demo_Rowley_ARM7/USB/USB-CDC.h
Update to V4.7.0.
[freertos] / Demo / lwIP_Demo_Rowley_ARM7 / USB / USB-CDC.h
1 /*\r
2         FreeRTOS.org V4.7.0 - Copyright (C) 2003-2007 Richard Barry.\r
3 \r
4         This file is part of the FreeRTOS.org distribution.\r
5 \r
6         FreeRTOS.org is free software; you can redistribute it and/or modify\r
7         it under the terms of the GNU General Public License as published by\r
8         the Free Software Foundation; either version 2 of the License, or\r
9         (at your option) any later version.\r
10 \r
11         FreeRTOS.org is distributed in the hope that it will be useful,\r
12         but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
14         GNU General Public License for more details.\r
15 \r
16         You should have received a copy of the GNU General Public License\r
17         along with FreeRTOS.org; if not, write to the Free Software\r
18         Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
19 \r
20         A special exception to the GPL can be applied should you wish to distribute\r
21         a combined work that includes FreeRTOS.org, without being obliged to provide\r
22         the source code for any proprietary components.  See the licensing section\r
23         of http://www.FreeRTOS.org for full details of how and when the exception\r
24         can be applied.\r
25 \r
26         ***************************************************************************\r
27         See http://www.FreeRTOS.org for documentation, latest information, license\r
28         and contact details.  Please ensure to read the configuration and relevant\r
29         port sections of the online documentation.\r
30 \r
31         Also see http://www.SafeRTOS.com a version that has been certified for use\r
32         in safety critical systems, plus commercial licensing, development and\r
33         support options.\r
34         ***************************************************************************\r
35 */\r
36 \r
37 #ifndef USB_CDC_H\r
38 #define USB_CDC_H\r
39 \r
40 #include "usb.h"\r
41 \r
42 #define USB_CDC_QUEUE_SIZE    200\r
43 \r
44 /* Structure used to take a snapshot of the USB status from within the ISR. */\r
45 typedef struct X_ISR_STATUS\r
46 {\r
47         unsigned portLONG ulISR;\r
48         unsigned portLONG ulCSR0;\r
49         unsigned portCHAR ucFifoData[ 8 ];\r
50 } xISRStatus;\r
51 \r
52 /* Structure used to hold the received requests. */\r
53 typedef struct \r
54 {\r
55         unsigned portCHAR ucReqType;\r
56         unsigned portCHAR ucRequest;\r
57         unsigned portSHORT usValue;\r
58         unsigned portSHORT usIndex;\r
59         unsigned portSHORT usLength;\r
60 } xUSB_REQUEST;\r
61 \r
62 typedef enum\r
63 {\r
64         eNOTHING,\r
65         eJUST_RESET,\r
66         eJUST_GOT_CONFIG,\r
67         eJUST_GOT_ADDRESS,\r
68         eSENDING_EVEN_DESCRIPTOR,\r
69         eREADY_TO_SEND\r
70 } eDRIVER_STATE;\r
71 \r
72 /* Structure used to control the data being sent to the host. */\r
73 typedef struct\r
74 {\r
75         unsigned portCHAR ucBuffer[ usbMAX_CONTROL_MESSAGE_SIZE ];\r
76         unsigned portLONG ulNextCharIndex;\r
77         unsigned portLONG ulTotalDataLength;\r
78 } xCONTROL_MESSAGE;\r
79 \r
80 /*-----------------------------------------------------------*/\r
81 void vUSBCDCTask( void *pvParameters );\r
82 \r
83 /* Send cByte down the USB port.  Characters are simply buffered and not\r
84 sent unless the port is connected. */\r
85 void vUSBSendByte( portCHAR cByte );\r
86 \r
87 \r
88 #endif\r
89 \r
90 \r