summaryrefslogtreecommitdiff
path: root/src/host/usbh.h
diff options
context:
space:
mode:
authorhathach <[email protected]>2022-03-19 00:43:31 +0700
committerhathach <[email protected]>2022-03-19 00:43:31 +0700
commit4795cca04ac60d58fbc78d554cd7af7039cd310a (patch)
treecd2ebf85439a5ab1634a3a72392ed8da8b8db119 /src/host/usbh.h
parentba1185bf28331da718cca38e6598361889fce54d (diff)
add parse config descriptor to example
move usbh_edpt_open() to public API, remove rhport from its signature
Diffstat (limited to 'src/host/usbh.h')
-rw-r--r--src/host/usbh.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/host/usbh.h b/src/host/usbh.h
index 772c4cfd6..a2df0153e 100644
--- a/src/host/usbh.h
+++ b/src/host/usbh.h
@@ -44,8 +44,10 @@ typedef struct tuh_xfer_s tuh_xfer_t;
typedef void (*tuh_xfer_cb_t)(tuh_xfer_t* xfer);
-// Note: layout and order of this will be changed in near future
+// Note1: layout and order of this will be changed in near future
// it is advised to initialize it using member name
+// Note2: not all field is available/meaningful in callback, some info is not saved by
+// usbh to save SRAM
struct tuh_xfer_s
{
uint8_t daddr;
@@ -124,14 +126,18 @@ static inline bool tuh_ready(uint8_t daddr)
//--------------------------------------------------------------------+
// Submit a control transfer
-// Note: blocking if complete callback is NULL, in this case xfer contents will be updated to reflect the result
+// - async: complete callback invoked when finished.
+// - sync : blocking if complete callback is NULL.
bool tuh_control_xfer(tuh_xfer_t* xfer);
// Submit a bulk/interrupt transfer
-// xfer memory must exist until transfer is complete.
-// Note: blocking if complete callback is NULL.
+// - async: complete callback invoked when finished.
+// - sync : blocking if complete callback is NULL.
bool tuh_edpt_xfer(tuh_xfer_t* xfer);
+// Open an endpoint
+bool usbh_edpt_open(uint8_t dev_addr, tusb_desc_endpoint_t const * desc_ep);
+
// Set Configuration (control transfer)
// config_num = 0 will un-configure device. Note: config_num = config_descriptor_index + 1
// true on success, false if there is on-going control transfer or incorrect parameters