summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2020-04-16 22:59:19 +0700
committerhathach <[email protected]>2020-04-16 22:59:19 +0700
commit36d4efa077a34ac33d420a1e1d3d200ada04ff9a (patch)
tree6b57af5351d8dfb09d9e725ffbf8d3c3ff5e319f /src
parent33888519dd3a972fdef21ad259d060ff6cef36db (diff)
samg implement dcd connect/disconnect
Diffstat (limited to 'src')
-rw-r--r--src/portable/microchip/samg/dcd_samg.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/portable/microchip/samg/dcd_samg.c b/src/portable/microchip/samg/dcd_samg.c
index 93d9029d6..c122b9bee 100644
--- a/src/portable/microchip/samg/dcd_samg.c
+++ b/src/portable/microchip/samg/dcd_samg.c
@@ -138,9 +138,6 @@ void dcd_init (uint8_t rhport)
(void) rhport;
tu_memclr(_dcd_xfer, sizeof(_dcd_xfer));
-
- // Enable pull-up, disable transceiver
- UDP->UDP_TXVC = UDP_TXVC_PUON | UDP_TXVC_TXVDIS_Msk;
}
// Enable device interrupt
@@ -186,6 +183,23 @@ void dcd_remote_wakeup (uint8_t rhport)
(void) rhport;
}
+void dcd_connect(uint8_t rhport)
+{
+ (void) rhport;
+
+ // Enable pull-up, disable transceiver
+ UDP->UDP_TXVC = UDP_TXVC_PUON | UDP_TXVC_TXVDIS_Msk;
+}
+
+void dcd_disconnect(uint8_t rhport)
+{
+ (void) rhport;
+
+ // disable both pullup and transceiver
+ UDP->UDP_TXVC = UDP_TXVC_TXVDIS_Msk;
+}
+
+
//--------------------------------------------------------------------+
// Endpoint API
//--------------------------------------------------------------------+