mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-31 05:52:55 +08:00
able to build lpc11u68
This commit is contained in:
parent
a157c7fdc9
commit
102a761e8e
@ -6,4 +6,5 @@
|
||||
<import file_name="lpc43xx/lpc43xx.emProject" />
|
||||
<import file_name="lpc175x_6x/lpc175x_6x.emProject" />
|
||||
<import file_name="lpc13xx/lpc13xx.emProject" />
|
||||
<import file_name="lpc11u6x/lpc11u6x.emProject" />
|
||||
</solution>
|
||||
|
@ -18,53 +18,103 @@
|
||||
arm_target_debug_interface_type="ADIv5"
|
||||
arm_target_device_name="LPC11U68"
|
||||
arm_target_interface_type="SWD"
|
||||
c_preprocessor_definitions="__LPC11U68__;__LPC1100_FAMILY;__LPC11U00_SUBFAMILY;ARM_MATH_CM0PLUS;FLASH_PLACEMENT=1"
|
||||
c_user_include_directories="$(ProjectDir)/CMSIS_5/CMSIS/Include;$(ProjectDir)/LPC1100/CMSIS/Device/Include/LPC11Uxx"
|
||||
c_preprocessor_definitions="__LPC11U68__;__LPC1100_FAMILY;__LPC11U00_SUBFAMILY;ARM_MATH_CM0PLUS;FLASH_PLACEMENT=1;CORE_M0PLUS;BOARD_LPCXPRESSO11U68;CFG_TUSB_MCU=OPT_MCU_LPC11UXX"
|
||||
c_user_include_directories="../../src;$(rootDir)/hw;$(rootDir)/src;$(lpcDir)/inc"
|
||||
debug_register_definition_file="$(ProjectDir)/LPC11U6x_Registers.xml"
|
||||
debug_target_connection="J-Link"
|
||||
gcc_entry_point="Reset_Handler"
|
||||
linker_memory_map_file="$(ProjectDir)/LPC11U68_MemoryMap.xml"
|
||||
linker_section_placement_file="$(ProjectDir)/flash_placement.xml"
|
||||
macros="DeviceHeaderFile=$(PackagesDir)/LPC1100/CMSIS/Device/Include/LPC11Uxx/LPC11U6x.h;DeviceLibraryIdentifier=M0l;DeviceSystemFile=$(PackagesDir)/LPC1100/CMSIS/Device/Source/system_LPC11U6x.c;DeviceVectorsFile=$(PackagesDir)/LPC1100/Source/LPC11U6x_Vectors.s;DeviceFamily=LPC1100;DeviceSubFamily=LPC11U00;Target=LPC11U68;Placement=Flash"
|
||||
macros="DeviceFamily=LPC1100;DeviceSubFamily=LPC11U00;Target=LPC11U68;Placement=Flash;rootDir=../../../../..;lpcDir=../../../../../hw/mcu/nxp/lpc_chip_11u6x"
|
||||
project_directory=""
|
||||
project_type="Executable"
|
||||
target_reset_script="Reset();"
|
||||
target_script_file="$(ProjectDir)/LPC1100_Target.js"
|
||||
target_trace_initialize_script="EnableTrace("$(TraceInterfaceType)")" />
|
||||
<folder Name="CMSIS Files">
|
||||
<file file_name="LPC1100/CMSIS/Device/Include/LPC11Uxx/LPC11U6x.h" />
|
||||
<file file_name="LPC1100/CMSIS/Device/Source/system_LPC11U6x.c">
|
||||
<configuration
|
||||
Name="Common"
|
||||
default_code_section=".init"
|
||||
default_const_section=".init_rodata" />
|
||||
</file>
|
||||
</folder>
|
||||
<folder Name="RTT Files">
|
||||
<file file_name="SEGGER_RTT.c" />
|
||||
<file file_name="SEGGER_RTT.h" />
|
||||
<file file_name="SEGGER_RTT_Conf.h" />
|
||||
<file file_name="SEGGER_RTT_SES.c" />
|
||||
</folder>
|
||||
<folder Name="Script Files">
|
||||
<file file_name="LPC1100/Scripts/LPC1100_Target.js">
|
||||
<configuration Name="Common" file_type="Reset Script" />
|
||||
</file>
|
||||
</folder>
|
||||
<folder Name="Source Files">
|
||||
<configuration Name="Common" filter="c;cpp;cxx;cc;h;s;asm;inc" />
|
||||
<file file_name="main.c" />
|
||||
</folder>
|
||||
<folder Name="System Files">
|
||||
<file file_name="thumb_crt0.s" />
|
||||
<file file_name="LPC1100/Source/LPC1100_Startup.s" />
|
||||
<file file_name="LPC1100/Source/LPC11U6x_Vectors.s">
|
||||
<file file_name="LPC1100_Startup.s" />
|
||||
<file file_name="LPC11U6x_Vectors.s">
|
||||
<configuration Name="Common" file_type="Assembly" />
|
||||
</file>
|
||||
<file file_name="LPC1100_Target.js">
|
||||
<configuration Name="Common" file_type="Reset Script" />
|
||||
</file>
|
||||
<file file_name="LPC11U68_MemoryMap.xml" />
|
||||
<file file_name="flash_placement.xml" />
|
||||
</folder>
|
||||
<configuration
|
||||
Name="LPCXpresso 11U68"
|
||||
link_use_linker_script_file="No"
|
||||
linker_section_placement_file="flash_placement.xml" />
|
||||
<folder Name="hw">
|
||||
<folder Name="bsp">
|
||||
<file file_name="../../../../../hw/bsp/ansi_escape.h" />
|
||||
<file file_name="../../../../../hw/bsp/board.h" />
|
||||
<folder
|
||||
Name="lpcxpresso11u68"
|
||||
exclude=""
|
||||
filter="*.*"
|
||||
path="../../../../../hw/bsp/lpcxpresso11u68"
|
||||
recurse="No" />
|
||||
</folder>
|
||||
<folder Name="mcu">
|
||||
<folder Name="nxp">
|
||||
<folder Name="lpc_chip_11u6x">
|
||||
<folder Name="inc">
|
||||
<file file_name="../../../../../hw/mcu/nxp/lpc_chip_11u6x/inc/chip.h" />
|
||||
<file file_name="../../../../../hw/mcu/nxp/lpc_chip_11u6x/inc/clock_11u6x.h" />
|
||||
<file file_name="../../../../../hw/mcu/nxp/lpc_chip_11u6x/inc/cmsis.h" />
|
||||
<file file_name="../../../../../hw/mcu/nxp/lpc_chip_11u6x/inc/core_cm0.h" />
|
||||
<file file_name="../../../../../hw/mcu/nxp/lpc_chip_11u6x/inc/core_cm0plus.h" />
|
||||
<file file_name="../../../../../hw/mcu/nxp/lpc_chip_11u6x/inc/core_cm3.h" />
|
||||
<file file_name="../../../../../hw/mcu/nxp/lpc_chip_11u6x/inc/core_cm4.h" />
|
||||
<file file_name="../../../../../hw/mcu/nxp/lpc_chip_11u6x/inc/core_cm4_simd.h" />
|
||||
<file file_name="../../../../../hw/mcu/nxp/lpc_chip_11u6x/inc/core_cmFunc.h" />
|
||||
<file file_name="../../../../../hw/mcu/nxp/lpc_chip_11u6x/inc/core_cmInstr.h" />
|
||||
<file file_name="../../../../../hw/mcu/nxp/lpc_chip_11u6x/inc/error.h" />
|
||||
<file file_name="../../../../../hw/mcu/nxp/lpc_chip_11u6x/inc/gpio_11u6x.h" />
|
||||
<file file_name="../../../../../hw/mcu/nxp/lpc_chip_11u6x/inc/gpiogroup_11u6x.h" />
|
||||
<file file_name="../../../../../hw/mcu/nxp/lpc_chip_11u6x/inc/iocon_11u6x.h" />
|
||||
<file file_name="../../../../../hw/mcu/nxp/lpc_chip_11u6x/inc/lpc_types.h" />
|
||||
<file file_name="../../../../../hw/mcu/nxp/lpc_chip_11u6x/inc/sys_config.h" />
|
||||
<file file_name="../../../../../hw/mcu/nxp/lpc_chip_11u6x/inc/syscon_11u6x.h" />
|
||||
<file file_name="../../../../../hw/mcu/nxp/lpc_chip_11u6x/inc/uart_0_11u6x.h" />
|
||||
<file file_name="../../../../../hw/mcu/nxp/lpc_chip_11u6x/inc/usbd_11u6x.h" />
|
||||
</folder>
|
||||
<folder Name="src">
|
||||
<file file_name="../../../../../hw/mcu/nxp/lpc_chip_11u6x/src/chip_11u6x.c" />
|
||||
<file file_name="../../../../../hw/mcu/nxp/lpc_chip_11u6x/src/clock_11u6x.c" />
|
||||
<file file_name="../../../../../hw/mcu/nxp/lpc_chip_11u6x/src/gpio_11u6x.c" />
|
||||
<file file_name="../../../../../hw/mcu/nxp/lpc_chip_11u6x/src/syscon_11u6x.c" />
|
||||
<file file_name="../../../../../hw/mcu/nxp/lpc_chip_11u6x/src/sysinit_11u6x.c" />
|
||||
<file file_name="../../../../../hw/mcu/nxp/lpc_chip_11u6x/src/uart_0_11u6x.c" />
|
||||
</folder>
|
||||
</folder>
|
||||
</folder>
|
||||
</folder>
|
||||
</folder>
|
||||
<folder
|
||||
Name="segger_rtt"
|
||||
exclude=""
|
||||
filter="*.c;*.h"
|
||||
path="../../../../../lib/segger_rtt"
|
||||
recurse="No" />
|
||||
<folder
|
||||
Name="src"
|
||||
exclude=""
|
||||
filter="*.c;*.h"
|
||||
path="../../src"
|
||||
recurse="Yes" />
|
||||
<folder
|
||||
Name="tinyusb"
|
||||
exclude=""
|
||||
filter="*.c;*.h"
|
||||
path="../../../../../src"
|
||||
recurse="Yes" />
|
||||
</project>
|
||||
<configuration
|
||||
Name="Debug"
|
||||
Name="LPCXpresso 11U68"
|
||||
c_preprocessor_definitions="DEBUG"
|
||||
gcc_debugging_level="Level 3"
|
||||
gcc_optimization_level="None" />
|
||||
|
@ -36,12 +36,13 @@
|
||||
*/
|
||||
/**************************************************************************/
|
||||
|
||||
#include "../board.h"
|
||||
|
||||
#ifdef BOARD_LPCXPRESSO11U68
|
||||
|
||||
#include "../board.h"
|
||||
|
||||
#define LED_PORT (1)
|
||||
#define LED_PIN (31)
|
||||
|
||||
#define LED_ON (0)
|
||||
#define LED_OFF (1)
|
||||
|
||||
@ -54,6 +55,16 @@ enum {
|
||||
BOARD_BUTTON_COUNT = sizeof(buttons) / sizeof(buttons[0])
|
||||
};
|
||||
|
||||
// required by lpcopen chip layer
|
||||
uint32_t const OscRateIn = 0;
|
||||
uint32_t const RTCOscRateIn = 0;
|
||||
|
||||
// required by startup
|
||||
void SystemInit(void)
|
||||
{
|
||||
Chip_SystemInit();
|
||||
}
|
||||
|
||||
void board_init(void)
|
||||
{
|
||||
SystemInit();
|
||||
@ -62,29 +73,48 @@ void board_init(void)
|
||||
SysTick_Config(SystemCoreClock / BOARD_TICKS_HZ); // 1 msec tick timer
|
||||
#endif
|
||||
|
||||
GPIOInit();
|
||||
Chip_GPIO_Init(LPC_GPIO);
|
||||
|
||||
//------------- LED -------------//
|
||||
GPIOSetDir(LED_PORT, LED_PIN, 1);
|
||||
Chip_GPIO_SetPinDIROutput(LPC_GPIO, LED_PORT, BOARD_LED0);
|
||||
|
||||
//------------- BUTTON -------------//
|
||||
for(uint8_t i=0; i<BOARD_BUTTON_COUNT; i++) GPIOSetDir(buttons[i].port, buttons[i].pin, 0);
|
||||
//for(uint8_t i=0; i<BOARD_BUTTON_COUNT; i++) GPIOSetDir(buttons[i].port, buttons[i].pin, 0);
|
||||
|
||||
//------------- UART -------------//
|
||||
UARTInit(CFG_UART_BAUDRATE);
|
||||
//UARTInit(CFG_UART_BAUDRATE);
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* TUSB HAL MILLISECOND
|
||||
*------------------------------------------------------------------*/
|
||||
#if CFG_TUSB_OS == OPT_OS_NONE
|
||||
|
||||
volatile uint32_t system_ticks = 0;
|
||||
|
||||
void SysTick_Handler (void)
|
||||
{
|
||||
system_ticks++;
|
||||
}
|
||||
|
||||
uint32_t tusb_hal_millis(void)
|
||||
{
|
||||
return board_tick2ms(system_ticks);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// LEDS
|
||||
//--------------------------------------------------------------------+
|
||||
void board_leds(uint32_t on_mask, uint32_t off_mask)
|
||||
void board_led_control(uint32_t id, bool state)
|
||||
{
|
||||
if (on_mask & BIT_(0))
|
||||
if (state)
|
||||
{
|
||||
GPIOSetBitValue(LED_PORT, LED_PIN, LED_ON);
|
||||
}else if (off_mask & BIT_(0))
|
||||
Chip_GPIO_SetValue(LPC_GPIO, LED_PORT, 1 << id);
|
||||
}else
|
||||
{
|
||||
GPIOSetBitValue(LED_PORT, LED_PIN, LED_OFF);
|
||||
Chip_GPIO_ClearValue(LPC_GPIO, LED_PORT, 1 << id);
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,7 +124,7 @@ void board_leds(uint32_t on_mask, uint32_t off_mask)
|
||||
uint32_t board_buttons(void)
|
||||
{
|
||||
// for(uint8_t i=0; i<BOARD_BUTTON_COUNT; i++) GPIOGetPinValue(buttons[i].port, buttons[i].pin);
|
||||
return GPIOGetPinValue(buttons[0].port, buttons[0].pin) ? 0 : 1; // button is active low
|
||||
// return GPIOGetPinValue(buttons[0].port, buttons[0].pin) ? 0 : 1; // button is active low
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
@ -102,7 +132,7 @@ uint32_t board_buttons(void)
|
||||
//--------------------------------------------------------------------+
|
||||
void board_uart_putchar(uint8_t c)
|
||||
{
|
||||
UARTSend(&c, 1);
|
||||
//UARTSend(&c, 1);
|
||||
}
|
||||
|
||||
uint8_t board_uart_getchar(void)
|
||||
|
@ -43,9 +43,9 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "LPC11Uxx.h"
|
||||
#include "lpc11uxx_gpio.h"
|
||||
#include "lpc11uxx_uart.h"
|
||||
#include "chip.h"
|
||||
|
||||
#define BOARD_LED0 7
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -43,8 +43,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//#include "LPC13Uxx.h"
|
||||
|
||||
#include "chip.h"
|
||||
|
||||
#define BOARD_LED0 7
|
||||
|
Loading…
x
Reference in New Issue
Block a user