diff options
| author | Ha Thach <[email protected]> | 2020-09-04 10:46:48 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-09-04 10:46:48 +0700 |
| commit | ed7a0de3abd12b7fefaeb2fc97607ae7d73d5419 (patch) | |
| tree | 15e3453593465f5879a75fee50e2dbb765d7c6a9 /src/host/hcd.h | |
| parent | f10b8145afb6d7b78fbf31b525951b4137e1d774 (diff) | |
| parent | a8e538efe7d11291e32e016fad5910ebaf9eac43 (diff) | |
Merge pull request #505 from hathach/update-host
Update host
Diffstat (limited to 'src/host/hcd.h')
| -rw-r--r-- | src/host/hcd.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/host/hcd.h b/src/host/hcd.h index a39e7fe16..24cc62501 100644 --- a/src/host/hcd.h +++ b/src/host/hcd.h @@ -84,17 +84,26 @@ enum { #endif //--------------------------------------------------------------------+ -// HCD API +// Controller & Port API //--------------------------------------------------------------------+ bool hcd_init(void); -void hcd_isr(uint8_t hostid); +void hcd_int_handler(uint8_t rhport); void hcd_int_enable (uint8_t rhport); void hcd_int_disable(uint8_t rhport); -// PORT API +// Get micro frame number (125 us) +uint32_t hcd_uframe_number(uint8_t rhport); + +// Get frame number (1ms) +static inline uint32_t hcd_frame_number(uint8_t rhport) +{ + return hcd_uframe_number(rhport) >> 3; +} + /// return the current connect status of roothub port bool hcd_port_connect_status(uint8_t hostid); void hcd_port_reset(uint8_t hostid); +void hcd_port_reset_end(uint8_t rhport); tusb_speed_t hcd_port_speed_get(uint8_t hostid); // HCD closes all opened endpoints belong to this device @@ -134,9 +143,7 @@ bool hcd_edpt_xfer(uint8_t rhport, uint8_t dev_addr, uint8_t ep_addr, uint8_t * bool hcd_pipe_queue_xfer(uint8_t dev_addr, uint8_t ep_addr, uint8_t buffer[], uint16_t total_bytes); // only queue, not transferring yet bool hcd_pipe_xfer(uint8_t dev_addr, uint8_t ep_addr, uint8_t buffer[], uint16_t total_bytes, bool int_on_complete); -#if 0 -tusb_error_t hcd_pipe_cancel(); -#endif +// tusb_error_t hcd_pipe_cancel(); #ifdef __cplusplus } |
