#ifndef _TUSB_USBH_H_
#define _TUSB_USBH_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "common/tusb_common.h"
#include "hcd.h"
typedef bool (*tuh_control_complete_cb_t)(uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result);
bool tuh_init(uint8_t rhport);
bool tuh_inited(void);
void tuh_task(void);
extern void hcd_int_handler(uint8_t rhport);
#define tuh_int_handler hcd_int_handler
bool tuh_vid_pid_get(uint8_t dev_addr, uint16_t* vid, uint16_t* pid);
tusb_speed_t tuh_speed_get(uint8_t dev_addr);
bool tuh_mounted(uint8_t dev_addr);
static inline bool tuh_suspended(uint8_t dev_addr)
{
(void) dev_addr;
return false;
}
TU_ATTR_ALWAYS_INLINE
static inline bool tuh_ready(uint8_t dev_addr)
{
return tuh_mounted(dev_addr) && !tuh_suspended(dev_addr);
}
bool tuh_control_xfer (uint8_t dev_addr, tusb_control_request_t const* request, void* buffer, tuh_control_complete_cb_t complete_cb);
TU_ATTR_WEAK void tuh_mount_cb (uint8_t dev_addr);
TU_ATTR_WEAK void tuh_umount_cb(uint8_t dev_addr);
#ifdef __cplusplus
}
#endif
#endif