diff options
| author | hathach <[email protected]> | 2013-11-21 15:24:02 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-11-21 15:24:02 +0700 |
| commit | d1ef89a1543581d1703ea43b0056b5112fd64019 (patch) | |
| tree | 25b9f34fd8d42c1a178c3acfd4a92f2d25a2a2b3 /tinyusb/hal | |
| parent | c303154b7a2af8e934308d9115e7b6da23c66419 (diff) | |
fixed lpc11u/13u VBUS (P0_3) with pulldown resistor for USB_VBUS_DEBOUNCED is correct
added disconnect callback for lpc11u/13u
Diffstat (limited to 'tinyusb/hal')
| -rw-r--r-- | tinyusb/hal/hal_lpc11uxx.c | 4 | ||||
| -rw-r--r-- | tinyusb/hal/hal_lpc13uxx.c | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/tinyusb/hal/hal_lpc11uxx.c b/tinyusb/hal/hal_lpc11uxx.c index 9cb188e9c..c1e504731 100644 --- a/tinyusb/hal/hal_lpc11uxx.c +++ b/tinyusb/hal/hal_lpc11uxx.c @@ -49,9 +49,11 @@ tusb_error_t hal_init(void) /* Pull-down is needed, or internally, VBUS will be floating. This is to address the wrong status in VBUSDebouncing bit in CmdStatus register. */ + // set PIO0_3 as USB_VBUS LPC_IOCON->PIO0_3 &= ~0x1F; - LPC_IOCON->PIO0_3 |= (0x01<<0); /* Secondary function VBUS */ + LPC_IOCON->PIO0_3 |= (0x01<<0) | (1 << 3); /* Secondary function VBUS */ + // set PIO0_6 as usb connect LPC_IOCON->PIO0_6 &= ~0x07; LPC_IOCON->PIO0_6 |= (0x01<<0); /* Secondary function SoftConn */ diff --git a/tinyusb/hal/hal_lpc13uxx.c b/tinyusb/hal/hal_lpc13uxx.c index d4e3fa984..a5697afc3 100644 --- a/tinyusb/hal/hal_lpc13uxx.c +++ b/tinyusb/hal/hal_lpc13uxx.c @@ -51,7 +51,7 @@ tusb_error_t hal_init(void) address the wrong status in VBUSDebouncing bit in CmdStatus register. */ // set PIO0_3 as USB_VBUS LPC_IOCON->PIO0_3 &= ~0x1F; - LPC_IOCON->PIO0_3 |= (0x01<<0); /* Secondary function VBUS */ + LPC_IOCON->PIO0_3 |= (0x01<<0) | (1 << 3); /* Secondary function VBUS */ // set PIO0_6 as usb connect LPC_IOCON->PIO0_6 &= ~0x07; |
