diff options
| author | hathach <[email protected]> | 2019-05-29 16:55:15 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2019-05-29 16:55:15 +0700 |
| commit | a0307bafdaa97628bb5e4d5e476db54cbc028d33 (patch) | |
| tree | bb2ff6a94e5229fffd1725c9e2e905ce333f110c /src/device/usbd_pvt.h | |
| parent | dfdae7a4d28a7c45535e9d709eade45c1a88a9f2 (diff) | |
added usbd_edpt_xfer/usbd_edpt_busy to replace dcd_edpt_transfer/dcd_edpt_busy()
- improve fifo write/read_n with only one lock
- use usbd_edpt_xfer/usbd_edpt_busy for hid/cdc/msc class driver
- replace cdc read's pending_read_from_host by usbd_edpt_busy()
Diffstat (limited to 'src/device/usbd_pvt.h')
| -rw-r--r-- | src/device/usbd_pvt.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/device/usbd_pvt.h b/src/device/usbd_pvt.h index f20532627..706857d45 100644 --- a/src/device/usbd_pvt.h +++ b/src/device/usbd_pvt.h @@ -33,10 +33,11 @@ extern "C" { #endif +bool usbd_init (void); + //--------------------------------------------------------------------+ -// INTERNAL API for stack management +// USBD Endpoint API //--------------------------------------------------------------------+ -bool usbd_init (void); // Carry out Data and Status stage of control transfer // - If len = 0, it is equivalent to sending status only @@ -46,6 +47,12 @@ bool usbd_control_xfer(uint8_t rhport, tusb_control_request_t const * request, v // Send STATUS (zero length) packet bool usbd_control_status(uint8_t rhport, tusb_control_request_t const * request); +// Submit a usb transfer +bool usbd_edpt_xfer (uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes); + +// Check if endpoint transferring is complete +bool usbd_edpt_busy (uint8_t rhport, uint8_t ep_addr); + void usbd_edpt_stall(uint8_t rhport, uint8_t ep_addr); void usbd_edpt_clear_stall(uint8_t rhport, uint8_t ep_addr); bool usbd_edpt_stalled(uint8_t rhport, uint8_t ep_addr); |
