diff options
| author | hathach <[email protected]> | 2020-04-17 13:38:22 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2020-04-17 13:38:22 +0700 |
| commit | 05476d9ad72321aa6e57ff5acbc4b25e1366fead (patch) | |
| tree | 10a12e71a679243ad5775ed7e0088242b8e763c8 /src/device/dcd.h | |
| parent | f4df82939955d86f6c2e826e1bc9f4b5bb713df8 (diff) | |
| parent | 85f0894fff89baaaa91a6dc3554a3149fc2fc062 (diff) | |
Merge branch 'master' into remove-dcd-set-config
Diffstat (limited to 'src/device/dcd.h')
| -rw-r--r-- | src/device/dcd.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/device/dcd.h b/src/device/dcd.h index f4e6edb95..99a0e01ca 100644 --- a/src/device/dcd.h +++ b/src/device/dcd.h @@ -89,7 +89,7 @@ typedef struct TU_ATTR_ALIGNED(4) void dcd_init (uint8_t rhport); // Interrupt Handler -void dcd_irq_handler(uint8_t rhport) TU_ATTR_USED; +void dcd_int_handler(uint8_t rhport); // Enable device interrupt void dcd_int_enable (uint8_t rhport); @@ -106,10 +106,10 @@ void dcd_set_config (uint8_t rhport, uint8_t config_num); // Wake up host void dcd_remote_wakeup(uint8_t rhport); -// Connect or disconnect D+/D- line pull-up resistor. -// Defined in dcd source if MCU has internal pull-up. -// Otherwise, may be defined in BSP. +// Connect by enabling internal pull-up resistor on D+/D- void dcd_connect(uint8_t rhport) TU_ATTR_WEAK; + +// Disconnect by disabling internal pull-up resistor on D+/D- void dcd_disconnect(uint8_t rhport) TU_ATTR_WEAK; //--------------------------------------------------------------------+ @@ -123,6 +123,10 @@ void dcd_edpt0_status_complete(uint8_t rhport, tusb_control_request_t const * re // Configure endpoint's registers according to descriptor bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc); +// Close an endpoint. +// Since it is weak, caller must TU_ASSERT this function's existence before calling it. +void dcd_edpt_close (uint8_t rhport, uint8_t ep_addr) TU_ATTR_WEAK; + // Submit a transfer, When complete dcd_event_xfer_complete() is invoked to notify the stack bool dcd_edpt_xfer (uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes); |
