mirror of
https://github.com/hathach/tinyusb.git
synced 2025-04-23 08:42:29 +00:00
adding dcd_connect/disconnect
This commit is contained in:
parent
36b33ee775
commit
11201f1a06
@ -106,6 +106,12 @@ void dcd_set_config (uint8_t rhport, uint8_t config_num);
|
|||||||
// Wake up host
|
// Wake up host
|
||||||
void dcd_remote_wakeup(uint8_t rhport);
|
void dcd_remote_wakeup(uint8_t rhport);
|
||||||
|
|
||||||
|
// disconnect by disabling internal pull-up resistor on D+/D-
|
||||||
|
void dcd_disconnect(uint8_t rhport) TU_ATTR_WEAK;
|
||||||
|
|
||||||
|
// connect by enabling internal pull-up resistor on D+/D-
|
||||||
|
void dcd_connect(uint8_t rhport) TU_ATTR_WEAK;
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
// Endpoint API
|
// Endpoint API
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
|
@ -65,6 +65,20 @@ static inline bool tud_ready(void)
|
|||||||
// Remote wake up host, only if suspended and enabled by host
|
// Remote wake up host, only if suspended and enabled by host
|
||||||
bool tud_remote_wakeup(void);
|
bool tud_remote_wakeup(void);
|
||||||
|
|
||||||
|
static inline bool tud_disconnect(void)
|
||||||
|
{
|
||||||
|
TU_VERIFY(dcd_disconnect);
|
||||||
|
dcd_disconnect(TUD_OPT_RHPORT);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline bool tud_connect(void)
|
||||||
|
{
|
||||||
|
TU_VERIFY(dcd_connect);
|
||||||
|
dcd_connect(TUD_OPT_RHPORT);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// Carry out Data and Status stage of control transfer
|
// Carry out Data and Status stage of control transfer
|
||||||
// - If len = 0, it is equivalent to sending status only
|
// - If len = 0, it is equivalent to sending status only
|
||||||
// - If len > wLength : it will be truncated
|
// - If len > wLength : it will be truncated
|
||||||
|
Loading…
x
Reference in New Issue
Block a user