-
Notifications
You must be signed in to change notification settings - Fork 7
/
usb_config.h
65 lines (44 loc) · 2.23 KB
/
usb_config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef USBCFG_H
#define USBCFG_H
#define USB_EP0_BUFF_SIZE 8 // Valid Options: 8, 16, 32, or 64 bytes.
#define USB_MAX_NUM_INT 4 //Set this number to match the maximum interface number used in the descriptors for this firmware project
#define USB_MAX_EP_NUMBER 4 //Set this number to match the maximum endpoint number used in the descriptors for this firmware project
#define USB_USER_DEVICE_DESCRIPTOR &device_dsc
#define USB_USER_DEVICE_DESCRIPTOR_INCLUDE extern const USB_DEVICE_DESCRIPTOR device_dsc
#define USB_USER_CONFIG_DESCRIPTOR USB_CD_Ptr
#define USB_USER_CONFIG_DESCRIPTOR_INCLUDE extern const uint8_t *const USB_CD_Ptr[]
#define USB_PING_PONG_MODE USB_PING_PONG__FULL_PING_PONG //A good all around setting
//#define USB_POLLING
#define USB_INTERRUPT
#define USB_PULLUP_OPTION USB_PULLUP_ENABLE
#define USB_TRANSCEIVER_OPTION USB_INTERNAL_TRANSCEIVER
#define USB_SPEED_OPTION USB_FULL_SPEED
#define USB_ENABLE_STATUS_STAGE_TIMEOUTS
#define USB_STATUS_STAGE_TIMEOUT (uint8_t)45
#define USB_SUPPORT_DEVICE
#define USB_NUM_STRING_DESCRIPTORS 5 //Set this number to match the total number of string descriptors that are implemented in the usb_descriptors.c file
// Enable all events.
//#define USB_DISABLE_SUSPEND_HANDLER
//#define USB_DISABLE_WAKEUP_FROM_SUSPEND_HANDLER
//#define USB_DISABLE_SOF_HANDLER
//#define USB_DISABLE_TRANSFER_TERMINATED_HANDLER
//#define USB_DISABLE_ERROR_HANDLER
//#define USB_DISABLE_NONSTANDARD_EP0_REQUEST_HANDLER
//#define USB_DISABLE_SET_DESCRIPTOR_HANDLER
//#define USB_DISABLE_SET_CONFIGURATION_HANDLER
//#define USB_DISABLE_TRANSFER_COMPLETE_HANDLER
#define USB_USE_CDC
#define CDC_COMM_IN_EP_SIZE 10
#define CDC_NUM_PORTS 2
// This defines the size of the rx/tx buffers.
#define CDC1_DATA_OUT_EP_SIZE 16 // RX
#define CDC1_DATA_IN_EP_SIZE 64 // TX
#define CDC2_DATA_OUT_EP_SIZE 16 // RX
#define CDC2_DATA_IN_EP_SIZE 16 // TX
// Support: Send_Break command
//#define USB_CDC_SUPPORT_ABSTRACT_CONTROL_MANAGEMENT_CAPABILITIES_D2
// Support: Set_Line_Coding, Set_Control_Line_State, Get_Line_Coding, and Serial_State commands
#define USB_CDC_SUPPORT_ABSTRACT_CONTROL_MANAGEMENT_CAPABILITIES_D1
#define SPI_CDC_PORT 0
#define FPGA_UART_CDC_PORT 1
#endif //USBCFG_H