summaryrefslogtreecommitdiff
path: root/firmware/export/usb_drv.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export/usb_drv.h')
-rw-r--r--firmware/export/usb_drv.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/firmware/export/usb_drv.h b/firmware/export/usb_drv.h
index 6ec9ac07e5..b5b5a7f065 100644
--- a/firmware/export/usb_drv.h
+++ b/firmware/export/usb_drv.h
@@ -23,9 +23,45 @@
23#include "usb_ch9.h" 23#include "usb_ch9.h"
24#include "kernel.h" 24#include "kernel.h"
25 25
26/** USB initialisation flow:
27 * usb_init()
28 * -> usb_init_device()
29 * -> [soc specific one-time init]
30 * -> usb_drv_startup()
31 * .....
32 * [USB is plugged]
33 * usb_enable(true)
34 * -> soc specific controller/clock init
35 * -> usb_core_init()
36 * -> usb_drv_init()
37 * -> usb_drv_int_enable(true) [only if controller needs soc specific code for interrupt]
38 * -> for each usb driver, driver.init()
39 * #ifdef USB_DETECT_BY_REQUEST
40 * [rockbox waits until first control request before proceeding]
41 * #endif
42 * [rockbox decides which usb drivers to enable, based on user preference and buttons]
43 * -> if not exclusive mode, usb_attach()
44 * -> if exclusive mode, usb_attach() call be called at any point starting from now
45 * (but after threads have acked usb mode and disk have been unmounted)
46 * for each enabled driver
47 * -> driver.request_endpoints()
48 * -> driver.set_first_interface()
49 * [usb controller/core start answering requests]
50 * .....
51 * [USB is unplugged]
52 * usb_enable(false)
53 * -> usb_core_exit()
54 * -> for each enabled usb driver, driver.disconnect()
55 * -> usb_drv_exit()
56 * -> usb_drv_int_enable(false) [ditto]
57 * -> soc specific controller/clock deinit */
58
59/* one-time initialisation of the USB driver */
26void usb_drv_startup(void); 60void usb_drv_startup(void);
27void usb_drv_int_enable(bool enable); /* Target implemented */ 61void usb_drv_int_enable(bool enable); /* Target implemented */
62/* enable and initialise the USB controller */
28void usb_drv_init(void); 63void usb_drv_init(void);
64/* stop and disable and the USB controller */
29void usb_drv_exit(void); 65void usb_drv_exit(void);
30void usb_drv_int(void); /* Call from target INT handler */ 66void usb_drv_int(void); /* Call from target INT handler */
31void usb_drv_stall(int endpoint, bool stall,bool in); 67void usb_drv_stall(int endpoint, bool stall,bool in);