OpenCores
URL https://opencores.org/ocsvn/usb_nand_reader/usb_nand_reader/trunk

Subversion Repositories usb_nand_reader

[/] [usb_nand_reader/] [trunk/] [mini32/] [USBdsc.cp] - Blame information for rev 7

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 7 pradd
#line 1 "H:/MINI32/MINI-32 Examples/MINI-32 mikroC PRO for PIC32 Examples/MINI32_NAND_Controller/USBdsc.c"
2
const unsigned int USB_VENDOR_ID = 0x1234;
3
const unsigned int USB_PRODUCT_ID = 0x0001;
4
const char USB_SELF_POWER = 0x80;
5
const char USB_MAX_POWER = 50;
6
const char HID_INPUT_REPORT_BYTES = 64;
7
const char HID_OUTPUT_REPORT_BYTES = 64;
8
const char USB_TRANSFER_TYPE = 0x03;
9
 
10
 
11
 
12
const char EP_IN_INTERVAL = 1;
13
const char EP_OUT_INTERVAL = 1;
14
 
15
const char USB_INTERRUPT = 0;
16
const char USB_HID_EP = 1;
17
const char USB_HID_RPT_SIZE = 33;
18
 
19
 
20
const struct {
21
 char bLength;
22
 char bDescriptorType;
23
 unsigned int bcdUSB;
24
 char bDeviceClass;
25
 char bDeviceSubClass;
26
 char bDeviceProtocol;
27
 char bMaxPacketSize0;
28
 unsigned int idVendor;
29
 unsigned int idProduct;
30
 unsigned int bcdDevice;
31
 char iManufacturer;
32
 char iProduct;
33
 char iSerialNumber;
34
 char bNumConfigurations;
35
} device_dsc = {
36
 0x12,
37
 0x01,
38
 0x0200,
39
 0x00,
40
 0x00,
41
 0x00,
42
 8,
43
 USB_VENDOR_ID,
44
 USB_PRODUCT_ID,
45
 0x0001,
46
 0x01,
47
 0x02,
48
 0x00,
49
 0x01
50
 };
51
 
52
 
53
const char configDescriptor1[]= {
54
 
55
 0x09,
56
 0x02,
57
 0x29,0x00,
58
 1,
59
 1,
60
 0,
61
 USB_SELF_POWER,
62
 USB_MAX_POWER,
63
 
64
 
65
 0x09,
66
 0x04,
67
 0,
68
 0,
69
 2,
70
 0x03,
71
 0,
72
 0,
73
 0,
74
 
75
 
76
 0x09,
77
 0x21,
78
 0x01,0x01,
79
 0x00,
80
 1,
81
 0x22,
82
 USB_HID_RPT_SIZE,0x00,
83
 
84
 
85
 0x07,
86
 0x05,
87
 USB_HID_EP | 0x80,
88
 USB_TRANSFER_TYPE,
89
 0x40,0x00,
90
 EP_IN_INTERVAL,
91
 
92
 
93
 0x07,
94
 0x05,
95
 USB_HID_EP,
96
 USB_TRANSFER_TYPE,
97
 0x40,0x00,
98
 EP_OUT_INTERVAL
99
};
100
 
101
const struct {
102
 char report[USB_HID_RPT_SIZE];
103
}hid_rpt_desc =
104
 {
105
 {0x06, 0x00, 0xFF,
106
 0x09, 0x01,
107
 0xA1, 0x01,
108
 
109
 0x19, 0x01,
110
 0x29, 0x40,
111
 0x15, 0x00,
112
 0x26, 0xFF, 0x00,
113
 0x75, 0x08,
114
 0x95, HID_INPUT_REPORT_BYTES,
115
 0x81, 0x02,
116
 
117
 0x19, 0x01,
118
 0x29, 0x40,
119
 0x75, 0x08,
120
 0x95, HID_OUTPUT_REPORT_BYTES,
121
 0x91, 0x02,
122
 0xC0}
123
 };
124
 
125
 
126
const struct {
127
 char bLength;
128
 char bDscType;
129
 unsigned int string[1];
130
 } strd1 = {
131
 4,
132
 0x03,
133
 {0x0409}
134
 };
135
 
136
 
137
 
138
const struct{
139
 char bLength;
140
 char bDscType;
141
 unsigned int string[16];
142
 }strd2={
143
 34,
144
 0x03,
145
 {'M','i','k','r','o','e','l','e','k','t','r','o','n','i','k','a'}
146
 };
147
 
148
 
149
const struct{
150
 char bLength;
151
 char bDscType;
152
 unsigned int string[23];
153
}strd3={
154
 32,
155
 0x03,
156
 {'U','S','B',' ','H','I','D',' ','L','i','b','r','a','r','y'}
157
 };
158
 
159
 
160
const char* USB_config_dsc_ptr[1];
161
 
162
 
163
const char* USB_string_dsc_ptr[3];
164
 
165
void USB_Init_Desc(){
166
 USB_config_dsc_ptr[0] = &configDescriptor1;
167
 USB_string_dsc_ptr[0] = (const char*)&strd1;
168
 USB_string_dsc_ptr[1] = (const char*)&strd2;
169
 USB_string_dsc_ptr[2] = (const char*)&strd3;
170
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.