From 94854f805aa8c80ffe77d8cef3ecfd45a3a9f253 Mon Sep 17 00:00:00 2001 From: hathach Date: Mon, 18 Nov 2013 17:29:12 +0700 Subject: [PATCH] get lpc17xx running through enumeration (with control data < 64) --- demos/bsp/boards/board.h | 6 - .../boards/lpcxpresso/board_lpcxpresso1769.c | 6 +- .../boards/lpcxpresso/board_lpcxpresso1769.h | 5 +- demos/device/device_os_none/.cproject | 149 ++++++++-------- demos/device/device_os_none/tusb_config.h | 2 +- tinyusb/device/dcd.h | 4 - tinyusb/device/dcd_lpc175x_6x.c | 167 ++++++++++++------ tinyusb/device/dcd_lpc175x_6x.h | 4 +- tinyusb/device/dcd_lpc43xx.c | 2 +- tinyusb/device/dcd_lpc_11uxx_13uxx.c | 12 -- tinyusb/device/usbd.c | 4 +- tinyusb/device/usbd.h | 2 +- tinyusb/hal/hal_lpc175x_6x.c | 6 +- tinyusb/hal/hal_lpc175x_6x.h | 1 + 14 files changed, 197 insertions(+), 173 deletions(-) diff --git a/demos/bsp/boards/board.h b/demos/bsp/boards/board.h index edc681a0..6f9d256c 100644 --- a/demos/bsp/boards/board.h +++ b/demos/bsp/boards/board.h @@ -36,12 +36,6 @@ */ /**************************************************************************/ -/** \file - * \brief TBD - * - * \note TBD - */ - /** * \defgroup Group_Board Boards * \brief TBD diff --git a/demos/bsp/boards/lpcxpresso/board_lpcxpresso1769.c b/demos/bsp/boards/lpcxpresso/board_lpcxpresso1769.c index 65778e50..8edc22e8 100644 --- a/demos/bsp/boards/lpcxpresso/board_lpcxpresso1769.c +++ b/demos/bsp/boards/lpcxpresso/board_lpcxpresso1769.c @@ -50,6 +50,11 @@ void board_init(void) // Leds Init GPIO_SetDir(CFG_LED_PORT, BIT_(CFG_LED_PIN), 1); + + // lpcxpresso base board USB device : if base board J14 is inserted at 1-2, 1k5 resistor is controlled by P0_21 (active low) + GPIO_SetDir(0, BIT_(21), 1); + GPIO_ClearValue(0, BIT_(21)); + #if CFG_UART_ENABLE //------------- UART init -------------// @@ -70,7 +75,6 @@ void board_init(void) UART_CFG_Type UARTConfigStruct; UART_ConfigStructInit(&UARTConfigStruct); UARTConfigStruct.Baud_rate = CFG_UART_BAUDRATE; - UARTConfigStruct.Clock_Speed = 0; UART_Init(BOARD_UART_PORT, &UARTConfigStruct); UART_TxCmd(BOARD_UART_PORT, ENABLE); // Enable UART Transmit diff --git a/demos/bsp/boards/lpcxpresso/board_lpcxpresso1769.h b/demos/bsp/boards/lpcxpresso/board_lpcxpresso1769.h index cfb01c3e..05168d80 100644 --- a/demos/bsp/boards/lpcxpresso/board_lpcxpresso1769.h +++ b/demos/bsp/boards/lpcxpresso/board_lpcxpresso1769.h @@ -47,6 +47,9 @@ #define _TUSB_BOARD_LPCXPRESSO1769_H_ #include "LPC17xx.h" + +#include "lpc175x_6x/LPC17xx_DriverLib/include/lpc17xx_clkpwr.h" +#include "lpc175x_6x/LPC17xx_DriverLib/include/lpc17xx_pinsel.h" #include "lpc175x_6x/LPC17xx_DriverLib/include/lpc17xx_gpio.h" #include "lpc175x_6x/LPC17xx_DriverLib/include/lpc17xx_uart.h" @@ -57,7 +60,7 @@ #define CFG_LED_PORT (0) #define CFG_LED_PIN (22) -#define CFG_PRINTF_TARGET PRINTF_TARGET_SEMIHOST +#define CFG_PRINTF_TARGET PRINTF_TARGET_UART #ifdef __cplusplus } diff --git a/demos/device/device_os_none/.cproject b/demos/device/device_os_none/.cproject index 2214898d..657f36b8 100644 --- a/demos/device/device_os_none/.cproject +++ b/demos/device/device_os_none/.cproject @@ -30,7 +30,7 @@ - - -