diff options
| author | hathach <[email protected]> | 2018-11-20 11:06:16 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2018-11-20 11:06:16 +0700 |
| commit | aa71b8fd874901347dedf4046a74d686907cf147 (patch) | |
| tree | bcc958c04628507c72879ead57766d0bc732d588 /src/device/usbd_pvt.h | |
| parent | 5757918df4a3cc4561775db61d9f720df8b23c31 (diff) | |
| parent | 5e65886fdd2bc5bac4ee9335fff1726f9382c109 (diff) | |
Merge pull request #10 from hathach/devlocal
merge for local develop
Diffstat (limited to 'src/device/usbd_pvt.h')
| -rw-r--r-- | src/device/usbd_pvt.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/device/usbd_pvt.h b/src/device/usbd_pvt.h index bbbe0a604..30f010887 100644 --- a/src/device/usbd_pvt.h +++ b/src/device/usbd_pvt.h @@ -54,15 +54,24 @@ extern tud_desc_set_t const* usbd_desc_set; tusb_error_t usbd_init (void); void usbd_task (void* param); + +// Carry out Data and Status stage of control transfer +// - If len = 0, it is equivalent to sending status only +// - If len > wLength : it will be truncated +bool usbd_control_xfer(uint8_t rhport, tusb_control_request_t const * request, void* buffer, uint16_t len); + +// Send STATUS (zero length) packet +bool usbd_control_status(uint8_t rhport, tusb_control_request_t const * request); + +// Stall control endpoint until new setup packet arrived +void usbd_control_stall(uint8_t rhport); + /*------------------------------------------------------------------*/ -/* Endpoint helper +/* Helper *------------------------------------------------------------------*/ // helper to parse an pair of In and Out endpoint descriptors. They must be consecutive tusb_error_t usbd_open_edpt_pair(uint8_t rhport, tusb_desc_endpoint_t const* p_desc_ep, uint8_t xfer_type, uint8_t* ep_out, uint8_t* ep_in); -/*------------------------------------------------------------------*/ -/* Other Helpers - *------------------------------------------------------------------*/ void usbd_defer_func( osal_task_func_t func, void* param, bool in_isr ); |
