samg implement dcd connect/disconnect

This commit is contained in:
hathach 2020-04-16 22:59:19 +07:00
parent 33888519dd
commit 36d4efa077
No known key found for this signature in database
GPG Key ID: 2FA891220FBFD581

View File

@ -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
//--------------------------------------------------------------------+