File tree Expand file tree Collapse file tree 2 files changed +27
-20
lines changed
include/zephyr/drivers/usb Expand file tree Collapse file tree 2 files changed +27
-20
lines changed Original file line number Diff line number Diff line change 23
23
* @defgroup uhc_api USB host controller driver API
24
24
* @ingroup io_interfaces
25
25
* @since 3.3
26
- * @version 0.1.0
26
+ * @version 0.1.1
27
27
* @{
28
28
*/
29
29
30
+ /** USB device state */
31
+ enum usb_device_state {
32
+ USB_STATE_NOTCONNECTED ,
33
+ USB_STATE_DEFAULT ,
34
+ USB_STATE_ADDRESSED ,
35
+ USB_STATE_CONFIGURED ,
36
+ };
37
+
38
+ /**
39
+ * Host representation of a USB device
40
+ */
41
+ struct usb_device {
42
+ /** An opaque pointer to the host context to which this device belongs */
43
+ void * ctx ;
44
+ /** USB device descriptor */
45
+ struct usb_device_descriptor dev_desc ;
46
+ /** Device state */
47
+ enum usb_device_state state ;
48
+ /** Actual active device configuration */
49
+ uint8_t actual_cfg ;
50
+ /** Device address */
51
+ uint8_t addr ;
52
+ };
53
+
30
54
/**
31
55
* @brief USB control transfer stage
32
56
*/
@@ -65,8 +89,8 @@ struct uhc_transfer {
65
89
unsigned int queued : 1 ;
66
90
/** Control stage status, up to the driver to use it or not */
67
91
unsigned int stage : 2 ;
68
- /** Pointer to USB device (opaque for the UHC) */
69
- void * udev ;
92
+ /** Pointer to USB device */
93
+ struct usb_device * udev ;
70
94
/** Pointer to transfer completion callback (opaque for the UHC) */
71
95
void * cb ;
72
96
/** Transfer result, 0 on success, other values on error */
Original file line number Diff line number Diff line change 11
11
#include <zephyr/usb/usbh.h>
12
12
#include <zephyr/drivers/usb/uhc.h>
13
13
14
- /* USB device state */
15
- enum usb_device_state {
16
- USB_STATE_NOTCONNECTED ,
17
- USB_STATE_DEFAULT ,
18
- USB_STATE_ADDRESSED ,
19
- USB_STATE_CONFIGURED ,
20
- };
21
-
22
- /* Host support view of a USB device */
23
- struct usb_device {
24
- struct usbh_contex * ctx ;
25
- struct usb_device_descriptor dev_desc ;
26
- enum usb_device_state state ;
27
- uint8_t actual_cfg ;
28
- uint8_t addr ;
29
- };
30
-
31
14
/* Callback type to be used for e.g. synchronous requests */
32
15
typedef int (* usbh_udev_cb_t )(struct usb_device * const udev ,
33
16
struct uhc_transfer * const xfer );
You can’t perform that action at this time.
0 commit comments