diff options
| author | hathach <[email protected]> | 2020-04-16 20:20:20 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2020-04-16 20:20:20 +0700 |
| commit | 4c74140b316d46cc62cd3d7031994c4f091e80e6 (patch) | |
| tree | d3759420283b8ff4a3548b524dd08513307dda22 /src | |
| parent | 33888519dd3a972fdef21ad259d060ff6cef36db (diff) | |
stm32 sysnopsys disconnect/connect
Diffstat (limited to 'src')
| -rw-r--r-- | src/portable/sony/cxd56/dcd_cxd56.c | 12 | ||||
| -rw-r--r-- | src/portable/st/synopsys/dcd_synopsys.c | 21 |
2 files changed, 29 insertions, 4 deletions
diff --git a/src/portable/sony/cxd56/dcd_cxd56.c b/src/portable/sony/cxd56/dcd_cxd56.c index 320b7237e..57158838f 100644 --- a/src/portable/sony/cxd56/dcd_cxd56.c +++ b/src/portable/sony/cxd56/dcd_cxd56.c @@ -201,6 +201,18 @@ void dcd_remote_wakeup(uint8_t rhport) DEV_WAKEUP(usbdev); } +#if 0 // TODO implement for Spresense +void dcd_connect(uint8_t rhport) +{ + (void) rhport; +} + +void dcd_disconnect(uint8_t rhport) +{ + (void) rhport; +} +#endif + //--------------------------------------------------------------------+ // Endpoint API //--------------------------------------------------------------------+ diff --git a/src/portable/st/synopsys/dcd_synopsys.c b/src/portable/st/synopsys/dcd_synopsys.c index dc752b37a..38c284c5a 100644 --- a/src/portable/st/synopsys/dcd_synopsys.c +++ b/src/portable/st/synopsys/dcd_synopsys.c @@ -209,10 +209,6 @@ void dcd_init (uint8_t rhport) // Enable USB transceiver. USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_PWRDWN; - - // Soft Connect -> Enable pullup on D+/D-. - // This step does not appear to be specified in the programmer's model. - dev->DCTL &= ~USB_OTG_DCTL_SDIS; } void dcd_int_enable (uint8_t rhport) @@ -250,6 +246,23 @@ void dcd_remote_wakeup(uint8_t rhport) (void) rhport; } +void dcd_connect(uint8_t rhport) +{ + (void) rhport; + USB_OTG_DeviceTypeDef * dev = DEVICE_BASE; + + dev->DCTL &= ~USB_OTG_DCTL_SDIS; +} + +void dcd_disconnect(uint8_t rhport) +{ + (void) rhport; + USB_OTG_DeviceTypeDef * dev = DEVICE_BASE; + + dev->DCTL |= USB_OTG_DCTL_SDIS; +} + + /*------------------------------------------------------------------*/ /* DCD Endpoint port *------------------------------------------------------------------*/ |
