summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-09-09 17:00:35 +0700
committerhathach <[email protected]>2019-09-09 17:30:43 +0700
commitb9b9f6769854ecd2814ee770e18c90e46170a2b4 (patch)
tree7e521e755f24e7f6d861ec0c7fe7fa565e755d6b
parent3497dd02642c92ad6116f0f59d7890e341d82a08 (diff)
ngx4330 usb0 work well
-rw-r--r--hw/bsp/ngx4330/board.mk2
-rw-r--r--hw/bsp/ngx4330/ngx4330.c18
2 files changed, 5 insertions, 15 deletions
diff --git a/hw/bsp/ngx4330/board.mk b/hw/bsp/ngx4330/board.mk
index a54675a7d..852c883b0 100644
--- a/hw/bsp/ngx4330/board.mk
+++ b/hw/bsp/ngx4330/board.mk
@@ -24,8 +24,6 @@ SRC_C += \
$(MCU_DIR)/src/clock_18xx_43xx.c \
$(MCU_DIR)/src/gpio_18xx_43xx.c \
$(MCU_DIR)/src/sysinit_18xx_43xx.c \
- $(MCU_DIR)/src/i2c_18xx_43xx.c \
- $(MCU_DIR)/src/i2cm_18xx_43xx.c \
$(MCU_DIR)/src/uart_18xx_43xx.c
INC += \
diff --git a/hw/bsp/ngx4330/ngx4330.c b/hw/bsp/ngx4330/ngx4330.c
index 12640ee7a..0e39ea711 100644
--- a/hw/bsp/ngx4330/ngx4330.c
+++ b/hw/bsp/ngx4330/ngx4330.c
@@ -57,6 +57,9 @@ static const PINMUX_GRP_T pinmuxing[] =
{2, 7, (SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC0)},
// USB
+ {2, 6, (SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_FUNC4)}, // USB1_PWR_EN
+ {2, 5, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC2)}, // USB1_VBUS
+ {1, 7, (SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_FUNC4)}, // USB0_PWRN_EN
// SPIFI
{3, 3, (SCU_PINIO_FAST | SCU_MODE_FUNC3)}, /* SPIFI CLK */
@@ -123,7 +126,6 @@ void board_init(void)
Chip_GPIO_SetPinDIRInput(LPC_GPIO_PORT, BUTTON_PORT, BUTTON_PIN);
#if 0
-#if 0
//------------- UART -------------//
scu_pinmux(BOARD_UART_PIN_PORT, BOARD_UART_PIN_TX, MD_PDN, FUNC1);
scu_pinmux(BOARD_UART_PIN_PORT, BOARD_UART_PIN_RX, MD_PLN | MD_EZI | MD_ZI, FUNC1);
@@ -211,19 +213,9 @@ void board_init(void)
// USB1 as fullspeed
LPC_USB1->PORTSC1_D |= (1<<24);
-#endif
-
- // USB0 Vbus Power: P2_3 on EA4357 channel B U20 GPIO26 active low (base board)
- Chip_SCU_PinMuxSet(2, 3, SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_FUNC7);
-
- #if CFG_TUSB_RHPORT0_MODE & OPT_MODE_DEVICE
- // P9_5 (GPIO5[18]) (GPIO28 on oem base) as USB connect, active low.
- Chip_SCU_PinMuxSet(9, 5, SCU_MODE_PULLDOWN | SCU_MODE_FUNC4);
- Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 5, 18);
- #endif
- // USB1 Power: EA4357 channel A U20 is enabled by SJ5 connected to pad 1-2, no more action required
- // TODO Remove R170, R171, solder a pair of 15K to USB1 D+/D- to test with USB1 Host
+// Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 5, 6); /* GPIO5[6] = USB1_PWR_EN */
+// Chip_GPIO_SetPinState(LPC_GPIO_PORT, 5, 6, true); /* GPIO5[6] output high */
#endif
}