diff options
| author | hathach <[email protected]> | 2020-04-09 11:47:02 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2020-04-09 11:47:02 +0700 |
| commit | c1f3fbbc03256d303d5ce355bd0cf87a0d3c4f4c (patch) | |
| tree | 7a1bfee978e96857314144a726e20e83bd066903 /src/portable/nordic | |
| parent | 11201f1a06396d4ab8302f2bb5ce579cb4ae7a6c (diff) | |
implement dcd connect/disconnect for samd and nrf
Diffstat (limited to 'src/portable/nordic')
| -rw-r--r-- | src/portable/nordic/nrf5x/dcd_nrf5x.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/portable/nordic/nrf5x/dcd_nrf5x.c b/src/portable/nordic/nrf5x/dcd_nrf5x.c index 2ce288d6c..c0dddef83 100644 --- a/src/portable/nordic/nrf5x/dcd_nrf5x.c +++ b/src/portable/nordic/nrf5x/dcd_nrf5x.c @@ -237,6 +237,20 @@ void dcd_remote_wakeup(uint8_t rhport) // We may manually raise DCD_EVENT_RESUME event here } +// disconnect by disabling internal pull-up resistor on D+/D- +void dcd_disconnect(uint8_t rhport) +{ + (void) rhport; + NRF_USBD->USBPULLUP = 0; +} + +// connect by enabling internal pull-up resistor on D+/D- +void dcd_connect(uint8_t rhport) +{ + (void) rhport; + NRF_USBD->USBPULLUP = 1; +} + //--------------------------------------------------------------------+ // Endpoint API //--------------------------------------------------------------------+ |
