summaryrefslogtreecommitdiff
path: root/src/device/usbd.h
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2020-04-10 16:11:04 +0700
committerGitHub <[email protected]>2020-04-10 16:11:04 +0700
commitbbb0e1088dad9f22b3447cc932270cbc0d84a453 (patch)
treefab371cfc4936b9212dc72403267959704f00994 /src/device/usbd.h
parent36b33ee775a02e1263f61bc4a82e58d8e8559734 (diff)
parentd6578823bb405cacbda13a044b66ba0a4f16a3d4 (diff)
Merge pull request #330 from hathach/dcd-disconnect-connect
Dcd disconnect connect for samd and nrf
Diffstat (limited to 'src/device/usbd.h')
-rw-r--r--src/device/usbd.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/device/usbd.h b/src/device/usbd.h
index beeec7e1c..817af20e3 100644
--- a/src/device/usbd.h
+++ b/src/device/usbd.h
@@ -65,6 +65,20 @@ static inline bool tud_ready(void)
// Remote wake up host, only if suspended and enabled by host
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
// - If len = 0, it is equivalent to sending status only
// - If len > wLength : it will be truncated