diff options
Diffstat (limited to 'firmware/export/usb_core.h')
-rw-r--r-- | firmware/export/usb_core.h | 43 |
1 files changed, 38 insertions, 5 deletions
diff --git a/firmware/export/usb_core.h b/firmware/export/usb_core.h index 2027cca5e8..73cf5c0127 100644 --- a/firmware/export/usb_core.h +++ b/firmware/export/usb_core.h | |||
@@ -19,6 +19,22 @@ | |||
19 | #ifndef USB_CORE_H | 19 | #ifndef USB_CORE_H |
20 | #define USB_CORE_H | 20 | #define USB_CORE_H |
21 | 21 | ||
22 | #ifndef BOOTLOADER | ||
23 | #define USB_THREAD | ||
24 | |||
25 | #ifdef USE_ROCKBOX_USB | ||
26 | //#define USB_SERIAL | ||
27 | //#define USB_BENCHMARK | ||
28 | #define USB_STORAGE | ||
29 | |||
30 | #else | ||
31 | #define USB_CHARGING_ONLY | ||
32 | |||
33 | #endif /* USE_ROCKBOX_USB */ | ||
34 | #else | ||
35 | #define USB_CHARGING_ONLY | ||
36 | #endif /* BOOTLOADER */ | ||
37 | |||
22 | #include "usb_ch9.h" | 38 | #include "usb_ch9.h" |
23 | 39 | ||
24 | #if defined(CPU_PP) | 40 | #if defined(CPU_PP) |
@@ -26,14 +42,31 @@ | |||
26 | #define USB_IRAM_SIZE ((size_t)0xc000) | 42 | #define USB_IRAM_SIZE ((size_t)0xc000) |
27 | #endif | 43 | #endif |
28 | 44 | ||
45 | |||
46 | enum { | ||
47 | USB_CORE_QUIT, | ||
48 | USB_CORE_TRANSFER_COMPLETION | ||
49 | }; | ||
50 | |||
29 | /* endpoints */ | 51 | /* endpoints */ |
30 | enum { | 52 | enum { |
31 | EP_CONTROL = 0, | 53 | EP_CONTROL = 0, |
32 | EP_RX, | 54 | #ifdef USB_STORAGE |
33 | EP_TX, | 55 | EP_MASS_STORAGE, |
34 | NUM_ENDPOINTS | 56 | #endif |
57 | #ifdef USB_SERIAL | ||
58 | EP_SERIAL, | ||
59 | #endif | ||
60 | #ifdef USB_CHARGING_ONLY | ||
61 | EP_CHARGING_ONLY, | ||
62 | #endif | ||
63 | #ifdef USB_BENCHMARK | ||
64 | EP_BENCHMARK, | ||
65 | #endif | ||
66 | NUM_ENDPOINTS | ||
35 | }; | 67 | }; |
36 | 68 | ||
69 | |||
37 | /* queue events */ | 70 | /* queue events */ |
38 | #define USB_TRANSFER_COMPLETE 1 | 71 | #define USB_TRANSFER_COMPLETE 1 |
39 | 72 | ||
@@ -48,7 +81,7 @@ extern int usb_max_pkt_size; | |||
48 | void usb_core_init(void); | 81 | void usb_core_init(void); |
49 | void usb_core_exit(void); | 82 | void usb_core_exit(void); |
50 | void usb_core_control_request(struct usb_ctrlrequest* req); | 83 | void usb_core_control_request(struct usb_ctrlrequest* req); |
51 | void usb_core_transfer_complete(int endpoint, bool in); | 84 | void usb_core_transfer_complete(int endpoint, bool in, int status, int length); |
52 | void usb_core_bus_reset(void); | 85 | void usb_core_bus_reset(void); |
53 | bool usb_core_data_connection(void); | 86 | bool usb_core_data_connection(void); |
54 | 87 | ||