mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-29 01:20:19 +00:00
added dcd disconnect/connect to lpc17/40
This commit is contained in:
parent
aa5ab50e86
commit
969121df4f
@ -106,10 +106,10 @@ void dcd_set_config (uint8_t rhport, uint8_t config_num);
|
||||
// Wake up host
|
||||
void dcd_remote_wakeup(uint8_t rhport);
|
||||
|
||||
// Connect or disconnect D+/D- line pull-up resistor.
|
||||
// Defined in dcd source if MCU has internal pull-up.
|
||||
// Otherwise, may be defined in BSP.
|
||||
// Connect by enabling internal pull-up resistor on D+/D-
|
||||
void dcd_connect(uint8_t rhport) TU_ATTR_WEAK;
|
||||
|
||||
// Disconnect by disabling internal pull-up resistor on D+/D-
|
||||
void dcd_disconnect(uint8_t rhport) TU_ATTR_WEAK;
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -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
|
||||
//--------------------------------------------------------------------+
|
||||
|
Loading…
x
Reference in New Issue
Block a user