diff options
| author | Ha Thach <[email protected]> | 2020-04-16 23:14:42 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-04-16 23:14:42 +0700 |
| commit | 9aa553ccc2e8977522202fa4e346a66a47c8e442 (patch) | |
| tree | bf65662d2e1c3daef5a3f2ce4faccf0db94c4ce9 | |
| parent | 33610751d7d0157c68a799961b6a7cacfa4c9b38 (diff) | |
| parent | 36d4efa077a34ac33d420a1e1d3d200ada04ff9a (diff) | |
Merge pull request #352 from hathach/samg-dcd-disconnect-connect
samg implement dcd connect/disconnect
| -rw-r--r-- | src/portable/microchip/samg/dcd_samg.c | 20 |
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 //--------------------------------------------------------------------+ |
