diff options
| author | hathach <[email protected]> | 2020-04-16 15:52:45 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2020-04-16 15:52:45 +0700 |
| commit | 969121df4f1025481cfe085397c8dede454f4537 (patch) | |
| tree | 3f308c1bea9232b6c1321312a96ebe991dc45220 /src/portable | |
| parent | aa5ab50e86dbb64fc0b5cbeafe7b58bc6659688e (diff) | |
added dcd disconnect/connect to lpc17/40
Diffstat (limited to 'src/portable')
| -rw-r--r-- | src/portable/nxp/lpc17_40/dcd_lpc17_40.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/portable/nxp/lpc17_40/dcd_lpc17_40.c b/src/portable/nxp/lpc17_40/dcd_lpc17_40.c index 884260f31..b4a11f49c 100644 --- a/src/portable/nxp/lpc17_40/dcd_lpc17_40.c +++ b/src/portable/nxp/lpc17_40/dcd_lpc17_40.c @@ -181,9 +181,7 @@ void dcd_init(uint8_t rhport) LPC_USB->UDCAH = (uint32_t) _dcd.udca; LPC_USB->DMAIntEn = (DMA_INT_END_OF_XFER_MASK /*| DMA_INT_NEW_DD_REQUEST_MASK*/ | DMA_INT_ERROR_MASK); - sie_write(SIE_CMDCODE_DEVICE_STATUS, 1, 1); // connect - - // USB IRQ priority should be set by application previously + // Clear pending IRQ NVIC_ClearPendingIRQ(USB_IRQn); } @@ -219,6 +217,16 @@ void dcd_remote_wakeup(uint8_t rhport) (void) rhport; } +void dcd_connect(uint8_t rhport) +{ + sie_write(SIE_CMDCODE_DEVICE_STATUS, 1, SIE_DEV_STATUS_CONNECT_STATUS_MASK); +} + +void dcd_disconnect(uint8_t rhport) +{ + sie_write(SIE_CMDCODE_DEVICE_STATUS, 1, 0); +} + //--------------------------------------------------------------------+ // CONTROL HELPER //--------------------------------------------------------------------+ |
