diff options
| author | hathach <[email protected]> | 2022-03-17 12:53:52 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2022-03-17 12:53:52 +0700 |
| commit | 68bfd048a54d1ff2def4cb1ee5285eacdb55f143 (patch) | |
| tree | 61b1f278ed2b5e5d60588fdb8b3344671d8764cc /src/host/usbh.h | |
| parent | 98d4ed05845e3a2efb32b0817d635457698b8cc9 (diff) | |
change tuh_control_xfer_t struct
Diffstat (limited to 'src/host/usbh.h')
| -rw-r--r-- | src/host/usbh.h | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/host/usbh.h b/src/host/usbh.h index fc0590190..7dffcb453 100644 --- a/src/host/usbh.h +++ b/src/host/usbh.h @@ -46,7 +46,10 @@ typedef bool (*tuh_control_xfer_cb_t)(uint8_t daddr, tuh_control_xfer_t const * struct tuh_control_xfer_s { - tusb_control_request_t request TU_ATTR_ALIGNED(4); + uint8_t ep_addr; + tusb_control_request_t const* setup; + uint32_t actual_len; + uint8_t* buffer; tuh_control_xfer_cb_t complete_cb; uintptr_t user_arg; @@ -104,14 +107,16 @@ static inline bool tuh_ready(uint8_t daddr) return tuh_mounted(daddr) && !tuh_suspended(daddr); } +//--------------------------------------------------------------------+ +// Endpoint Asynchronous (non-blocking) +//--------------------------------------------------------------------+ + // Carry out a control transfer // true on success, false if there is on-going control transfer or incorrect parameters // Blocking if complete callback is NULL, in this case 'user_arg' must contain xfer_result_t variable -bool tuh_control_xfer (uint8_t daddr, tuh_control_xfer_t const* xfer); +bool tuh_control_xfer(uint8_t daddr, tuh_control_xfer_t const* xfer); -// Sync (blocking) version of tuh_control_xfer() -// return transfer result -uint8_t tuh_control_xfer_sync(uint8_t daddr, tuh_control_xfer_t const* xfer, uint32_t timeout_ms); +//bool tuh_edpt_xfer(uint8_t daddr, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes); // Set Configuration (control transfer) // config_num = 0 will un-configure device. Note: config_num = config_descriptor_index + 1 @@ -121,6 +126,14 @@ bool tuh_configuration_set(uint8_t daddr, uint8_t config_num, tuh_control_xfer_cb_t complete_cb, uintptr_t user_arg); //--------------------------------------------------------------------+ +// Endpoint Synchronous (blocking) +//--------------------------------------------------------------------+ + +// Sync (blocking) version of tuh_control_xfer() +// return transfer result +uint8_t tuh_control_xfer_sync(uint8_t daddr, tuh_control_xfer_t const* xfer, uint32_t timeout_ms); + +//--------------------------------------------------------------------+ // Descriptors Asynchronous (non-blocking) //--------------------------------------------------------------------+ @@ -201,10 +214,6 @@ uint8_t tuh_descriptor_get_product_string_sync(uint8_t daddr, uint16_t language_ // return transfer result uint8_t tuh_descriptor_get_serial_string_sync(uint8_t daddr, uint16_t language_id, void* buffer, uint16_t len, uint8_t timeout_ms); -//--------------------------------------------------------------------+ -// -//--------------------------------------------------------------------+ - #ifdef __cplusplus } #endif |
