adding support for lpc13uxx

This commit is contained in:
hathach 2013-11-11 12:48:21 +07:00
parent 9cb99d3716
commit f00a4b448d
25 changed files with 559 additions and 213 deletions

View File

@ -73,7 +73,7 @@
</option>
<option id="gnu.c.link.option.paths.1465143173" name="Library search path (-L)" superClass="gnu.c.link.option.paths"/>
<option id="gnu.c.link.option.libs.447978281" name="Libraries (-l)" superClass="gnu.c.link.option.libs"/>
<option id="com.crt.advproject.link.gcc.hdrlib.1111642583" name="Use C library" superClass="com.crt.advproject.link.gcc.hdrlib" value="com.crt.advproject.gcc.link.hdrlib.codered.semihost" valueType="enumerated"/>
<option id="com.crt.advproject.link.gcc.hdrlib.1111642583" name="Use C library" superClass="com.crt.advproject.link.gcc.hdrlib" value="com.crt.advproject.gcc.link.hdrlib.codered.nohost" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1234316494" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
@ -82,7 +82,7 @@
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="bsp/boards/embedded_artists/oem_base_board|bsp/lpc43xx" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
<entry excluding="bsp/boards/embedded_artists/ea4357|bsp/boards/embedded_artists/oem_base_board|bsp/lpc175x_6x|bsp/lpc11uxx|bsp/lpc43xx" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
@ -123,6 +123,7 @@
<option id="com.crt.advproject.gcc.thumb.1429919562" name="Thumb mode" superClass="com.crt.advproject.gcc.thumb" value="true" valueType="boolean"/>
<option id="gnu.c.compiler.option.preprocessor.def.symbols.690334585" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__REDLIB__"/>
<listOptionValue builtIn="false" value="__USE_CMSIS"/>
<listOptionValue builtIn="false" value="MCU=MCU_LPC11UXX"/>
<listOptionValue builtIn="false" value="BOARD=BOARD_RF1GHZNODE"/>
<listOptionValue builtIn="false" value="DEBUG"/>
@ -170,7 +171,7 @@
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="bsp/boards/embedded_artists/oem_base_board|bsp/lpc43xx" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
<entry excluding="bsp/boards/embedded_artists/ea4357|bsp/boards/embedded_artists/oem_base_board|bsp/lpc175x_6x|bsp/lpc43xx|bsp/lpc13uxx" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
@ -207,11 +208,11 @@
<builder buildPath="${workspace_loc:/device_keyboard/Debug}" enableAutoBuild="false" enabledIncrementalBuild="true" errorParsers="org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.CWDLocator" id="com.crt.advproject.builder.exe.debug.491161730" incrementalBuildTarget="all" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="com.crt.advproject.builder.exe.debug"/>
<tool id="com.crt.advproject.cpp.exe.debug.1586184655" name="MCU C++ Compiler" superClass="com.crt.advproject.cpp.exe.debug"/>
<tool command="arm-none-eabi-gcc" commandLinePattern="${COMMAND} ${FLAGS} ${CFLAGS} ${OUTPUT_FLAG}${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GCCErrorParser" id="com.crt.advproject.gcc.exe.debug.1058924021" name="MCU C Compiler" superClass="com.crt.advproject.gcc.exe.debug">
<option id="com.crt.advproject.gcc.arch.1901283003" name="Architecture" superClass="com.crt.advproject.gcc.arch" value="com.crt.advproject.gcc.target.cm4" valueType="enumerated"/>
<option id="com.crt.advproject.gcc.arch.1901283003" name="Architecture" superClass="com.crt.advproject.gcc.arch" value="com.crt.advproject.gcc.target.cm3" valueType="enumerated"/>
<option id="com.crt.advproject.gcc.thumb.1993301691" name="Thumb mode" superClass="com.crt.advproject.gcc.thumb" value="true" valueType="boolean"/>
<option id="gnu.c.compiler.option.preprocessor.def.symbols.211439980" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__REDLIB__"/>
<listOptionValue builtIn="false" value="__USE_CMSIS=CMSISv2p10_LPC43xx_DriverLib"/>
<listOptionValue builtIn="false" value="__USE_CMSIS"/>
<listOptionValue builtIn="false" value="CORE_M4"/>
<listOptionValue builtIn="false" value="MCU=MCU_LPC43XX"/>
<listOptionValue builtIn="false" value="BOARD=BOARD_EA4357"/>
@ -233,7 +234,7 @@
<inputType id="com.crt.advproject.compiler.input.864372614" superClass="com.crt.advproject.compiler.input"/>
</tool>
<tool command="arm-none-eabi-gcc" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG}${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GASErrorParser" id="com.crt.advproject.gas.exe.debug.73154126" name="MCU Assembler" superClass="com.crt.advproject.gas.exe.debug">
<option id="com.crt.advproject.gas.arch.767404687" name="Architecture" superClass="com.crt.advproject.gas.arch" value="com.crt.advproject.gas.target.cm4" valueType="enumerated"/>
<option id="com.crt.advproject.gas.arch.767404687" name="Architecture" superClass="com.crt.advproject.gas.arch" value="com.crt.advproject.gas.target.cm3" valueType="enumerated"/>
<option id="com.crt.advproject.gas.thumb.1342467320" name="Thumb mode" superClass="com.crt.advproject.gas.thumb" value="true" valueType="boolean"/>
<option id="gnu.both.asm.option.flags.crt.357381448" name="Assembler flags" superClass="gnu.both.asm.option.flags.crt" value="-c -x assembler-with-cpp -D__REDLIB__ -DDEBUG -D__CODE_RED" valueType="string"/>
<option id="com.crt.advproject.gas.fpu.1588814622" name="Floating point" superClass="com.crt.advproject.gas.fpu" value="com.crt.advproject.gas.fpu.fpv4" valueType="enumerated"/>
@ -242,7 +243,7 @@
</tool>
<tool id="com.crt.advproject.link.cpp.exe.debug.1716426006" name="MCU C++ Linker" superClass="com.crt.advproject.link.cpp.exe.debug"/>
<tool command="arm-none-eabi-gcc" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG}${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GLDErrorParser" id="com.crt.advproject.link.exe.debug.2143352384" name="MCU Linker" superClass="com.crt.advproject.link.exe.debug">
<option id="com.crt.advproject.link.arch.449102543" name="Architecture" superClass="com.crt.advproject.link.arch" value="com.crt.advproject.link.target.cm4" valueType="enumerated"/>
<option id="com.crt.advproject.link.arch.449102543" name="Architecture" superClass="com.crt.advproject.link.arch" value="com.crt.advproject.link.target.cm3" valueType="enumerated"/>
<option id="com.crt.advproject.link.thumb.1645494591" name="Thumb mode" superClass="com.crt.advproject.link.thumb" value="true" valueType="boolean"/>
<option id="com.crt.advproject.link.script.1301365456" name="Linker script" superClass="com.crt.advproject.link.script" value="&quot;device_os_none_Board_EA4357.ld&quot;" valueType="string"/>
<option id="com.crt.advproject.link.manage.679369872" name="Manage linker script" superClass="com.crt.advproject.link.manage" value="true" valueType="boolean"/>
@ -264,7 +265,7 @@
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/sdio.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_wwdt.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_ssp.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_sdmmc.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_sdif.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_sct.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_rtc.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_rit.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_rgu.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_qei.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_pwr.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_mcpwm.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_lcd.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_i2s.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_gpdma.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_evrt.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_emc.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_dac.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_can.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_atimer.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_adc.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/LCDTerm.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/Font5x7.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/debug_frmwrk.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_can.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/sdio.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/LCDTerm.c|bsp/lpc175x_6x|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_evrt.c|bsp/lpc11uxx|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_gpdma.c|bsp/lpc13uxx|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_lcd.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_ssp.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_rit.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_qei.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_atimer.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_wwdt.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_mcpwm.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/debug_frmwrk.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_i2s.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_emc.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_sct.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_rtc.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_dac.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/Font5x7.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_timer.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_adc.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
<entry excluding="bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_lcd.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/sdio.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_can.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/LCDTerm.c|bsp/lpc175x_6x|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_evrt.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_rgu.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_adc.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/Font5x7.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_gpdma.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_lcd.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_i2s.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_ssp.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_qei.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_ssp.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_atimer.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_i2s.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/debug_frmwrk.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_gpdma.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_sct.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_wwdt.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_evrt.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_timer.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_qei.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_adc.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/sdio.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_mcpwm.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_atimer.c|bsp/lpc11uxx|bsp/lpc13uxx|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_rit.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_sdmmc.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/LCDTerm.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_mcpwm.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_wwdt.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/debug_frmwrk.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_emc.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_sct.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_dac.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_pwr.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_rtc.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/lpc43xx_dac.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_rit.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_rtc.c|bsp/lpc43xx/CMSISv2p10_LPC43xx_DriverLib/src/Font5x7.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_sdif.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_emc.c|bsp/lpc43xx/CMSIS_LPC43xx_DriverLib/src/lpc43xx_can.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
@ -353,7 +354,7 @@
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_pwm.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_libcfg_default.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_timer.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_clkpwr.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_exti.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_i2s.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_iap.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_spi.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_rit.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_i2c.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_gpdma.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_qei.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_ssp.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_emac.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_mcpwm.c|bsp/boards/embedded_artists/oem_base_board|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_rtc.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_wdt.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_adc.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/debug_frmwrk.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_dac.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_can.c|bsp/lpc43xx" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
<entry excluding="bsp/boards/embedded_artists/ea4357|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_pwm.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_libcfg_default.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_timer.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_clkpwr.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_i2s.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_exti.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_iap.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_rit.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_spi.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_i2c.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_gpdma.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_qei.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_ssp.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_emac.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_mcpwm.c|bsp/boards/embedded_artists/oem_base_board|bsp/lpc11uxx|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_rtc.c|bsp/lpc13uxx|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_wdt.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_adc.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/debug_frmwrk.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_dac.c|bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_can.c|bsp/lpc43xx" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
@ -370,86 +371,49 @@
<storageModule moduleId="com.crt.config">
<projectStorage>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&#13;
&lt;TargetConfig&gt;&#13;
&lt;Properties property_0="" property_2="LPC18x7_43x7_2x512_BootA.cfx" property_3="NXP" property_4="LPC4357" property_count="5" version="60000"/&gt;&#13;
&lt;infoList vendor="NXP"&gt;&lt;info chip="LPC4357" flash_driver="LPC18x7_43x7_2x512_BootA.cfx" match_id="0x0" name="LPC4357" resetscript="LPC18LPC43InternalFLASHBootResetscript.scp" stub="crt_emu_lpc18_43_nxp"&gt;&lt;chip&gt;&lt;name&gt;LPC4357&lt;/name&gt;&#13;
&lt;family&gt;LPC43xx&lt;/family&gt;&#13;
&lt;Properties property_0="" property_3="NXP" property_4="LPC1347" property_count="5" version="1"/&gt;&#13;
&lt;infoList vendor="NXP"&gt;&lt;info chip="LPC1347" match_id="0x08020543" name="LPC1347" stub="crt_emu_lpc11_13_nxp"&gt;&lt;chip&gt;&lt;name&gt;LPC1347&lt;/name&gt;&#13;
&lt;family&gt;LPC13xx (12bit ADC)&lt;/family&gt;&#13;
&lt;vendor&gt;NXP (formerly Philips)&lt;/vendor&gt;&#13;
&lt;reset board="None" core="Real" sys="Real"/&gt;&#13;
&lt;clock changeable="TRUE" freq="20MHz" is_accurate="TRUE"/&gt;&#13;
&lt;clock changeable="TRUE" freq="12MHz" is_accurate="TRUE"/&gt;&#13;
&lt;memory can_program="true" id="Flash" is_ro="true" type="Flash"/&gt;&#13;
&lt;memory id="RAM" type="RAM"/&gt;&#13;
&lt;memory id="Periph" is_volatile="true" type="Peripheral"/&gt;&#13;
&lt;memoryInstance derived_from="Flash" id="MFlashA512" location="0x1a000000" size="0x80000"/&gt;&#13;
&lt;memoryInstance derived_from="Flash" id="MFlashB512" location="0x1b000000" size="0x80000"/&gt;&#13;
&lt;memoryInstance derived_from="RAM" id="RamLoc32" location="0x10000000" size="0x8000"/&gt;&#13;
&lt;memoryInstance derived_from="RAM" id="RamLoc40" location="0x10080000" size="0xa000"/&gt;&#13;
&lt;memoryInstance derived_from="RAM" id="RamAHB32" location="0x20000000" size="0x8000"/&gt;&#13;
&lt;memoryInstance derived_from="RAM" id="RamAHB16" location="0x20008000" size="0x4000"/&gt;&#13;
&lt;memoryInstance derived_from="RAM" id="RamAHB_ETB16" location="0x2000c000" size="0x4000"/&gt;&#13;
&lt;prog_flash blocksz="0x2000" location="0x1a000000" maxprgbuff="0x400" progwithcode="TRUE" size="0x10000"/&gt;&#13;
&lt;prog_flash blocksz="0x10000" location="0x1a010000" maxprgbuff="0x400" progwithcode="TRUE" size="0x70000"/&gt;&#13;
&lt;prog_flash blocksz="0x2000" location="0x1b000000" maxprgbuff="0x400" progwithcode="TRUE" size="0x10000"/&gt;&#13;
&lt;prog_flash blocksz="0x10000" location="0x1b010000" maxprgbuff="0x400" progwithcode="TRUE" size="0x70000"/&gt;&#13;
&lt;peripheralInstance derived_from="V7M_MPU" determined="infoFile" id="MPU" location="0xe000ed90"/&gt;&#13;
&lt;peripheralInstance derived_from="V7M_NVIC" determined="infoFile" id="NVIC" location="0xe000e000"/&gt;&#13;
&lt;peripheralInstance derived_from="V7M_DCR" determined="infoFile" id="DCR" location="0xe000edf0"/&gt;&#13;
&lt;peripheralInstance derived_from="V7M_ITM" determined="infoFile" id="ITM" location="0xe0000000"/&gt;&#13;
&lt;peripheralInstance derived_from="SCT" determined="infoFile" id="SCT" location="0x40000000"/&gt;&#13;
&lt;peripheralInstance derived_from="GPDMA" determined="infoFile" id="GPDMA" location="0x40002000"/&gt;&#13;
&lt;peripheralInstance derived_from="SPIFI" determined="infoFile" id="SPIFI" location="0x40003000"/&gt;&#13;
&lt;peripheralInstance derived_from="SDMMC" determined="infoFile" id="SDMMC" location="0x40004000"/&gt;&#13;
&lt;peripheralInstance derived_from="EMC" determined="infoFile" id="EMC" location="0x40005000"/&gt;&#13;
&lt;peripheralInstance derived_from="USB0" determined="infoFile" id="USB0" location="0x40006000"/&gt;&#13;
&lt;peripheralInstance derived_from="USB1" determined="infoFile" id="USB1" location="0x40007000"/&gt;&#13;
&lt;peripheralInstance derived_from="LCD" determined="infoFile" id="LCD" location="0x40008000"/&gt;&#13;
&lt;peripheralInstance derived_from="EEPROM" determined="infoFile" id="EEPROM" location="0x4000e000"/&gt;&#13;
&lt;peripheralInstance derived_from="ETHERNET" determined="infoFile" id="ETHERNET" location="0x40010000"/&gt;&#13;
&lt;peripheralInstance derived_from="ATIMER" determined="infoFile" id="ATIMER" location="0x40040000"/&gt;&#13;
&lt;peripheralInstance derived_from="REGFILE" determined="infoFile" id="REGFILE" location="0x40041000"/&gt;&#13;
&lt;peripheralInstance derived_from="PMC" determined="infoFile" id="PMC" location="0x40042000"/&gt;&#13;
&lt;peripheralInstance derived_from="CREG" determined="infoFile" id="CREG" location="0x40043000"/&gt;&#13;
&lt;peripheralInstance derived_from="EVENTROUTER" determined="infoFile" id="EVENTROUTER" location="0x40044000"/&gt;&#13;
&lt;peripheralInstance derived_from="RTC" determined="infoFile" id="RTC" location="0x40046000"/&gt;&#13;
&lt;peripheralInstance derived_from="CGU" determined="infoFile" id="CGU" location="0x40050000"/&gt;&#13;
&lt;peripheralInstance derived_from="CCU1" determined="infoFile" id="CCU1" location="0x40051000"/&gt;&#13;
&lt;peripheralInstance derived_from="CCU2" determined="infoFile" id="CCU2" location="0x40052000"/&gt;&#13;
&lt;peripheralInstance derived_from="RGU" determined="infoFile" id="RGU" location="0x40053000"/&gt;&#13;
&lt;peripheralInstance derived_from="WWDT" determined="infoFile" id="WWDT" location="0x40080000"/&gt;&#13;
&lt;peripheralInstance derived_from="USART0" determined="infoFile" id="USART0" location="0x40081000"/&gt;&#13;
&lt;peripheralInstance derived_from="USART2" determined="infoFile" id="USART2" location="0x400c1000"/&gt;&#13;
&lt;peripheralInstance derived_from="USART3" determined="infoFile" id="USART3" location="0x400c2000"/&gt;&#13;
&lt;peripheralInstance derived_from="UART1" determined="infoFile" id="UART1" location="0x40082000"/&gt;&#13;
&lt;peripheralInstance derived_from="SSP0" determined="infoFile" id="SSP0" location="0x40083000"/&gt;&#13;
&lt;peripheralInstance derived_from="SSP1" determined="infoFile" id="SSP1" location="0x400c5000"/&gt;&#13;
&lt;peripheralInstance derived_from="TIMER0" determined="infoFile" id="TIMER0" location="0x40084000"/&gt;&#13;
&lt;peripheralInstance derived_from="TIMER1" determined="infoFile" id="TIMER1" location="0x40085000"/&gt;&#13;
&lt;peripheralInstance derived_from="TIMER2" determined="infoFile" id="TIMER2" location="0x400c3000"/&gt;&#13;
&lt;peripheralInstance derived_from="TIMER3" determined="infoFile" id="TIMER3" location="0x400c4000"/&gt;&#13;
&lt;peripheralInstance derived_from="SCU" determined="infoFile" id="SCU" location="0x40086000"/&gt;&#13;
&lt;peripheralInstance derived_from="GPIO-PIN-INT" determined="infoFile" id="GPIO-PIN-INT" location="0x40087000"/&gt;&#13;
&lt;peripheralInstance derived_from="GPIO-GROUP-INT0" determined="infoFile" id="GPIO-GROUP-INT0" location="0x40088000"/&gt;&#13;
&lt;peripheralInstance derived_from="GPIO-GROUP-INT1" determined="infoFile" id="GPIO-GROUP-INT1" location="0x40089000"/&gt;&#13;
&lt;peripheralInstance derived_from="MCPWM" determined="infoFile" id="MCPWM" location="0x400a0000"/&gt;&#13;
&lt;peripheralInstance derived_from="I2C0" determined="infoFile" id="I2C0" location="0x400a1000"/&gt;&#13;
&lt;peripheralInstance derived_from="I2C1" determined="infoFile" id="I2C1" location="0x400e0000"/&gt;&#13;
&lt;peripheralInstance derived_from="I2S0" determined="infoFile" id="I2S0" location="0x400a2000"/&gt;&#13;
&lt;peripheralInstance derived_from="I2S1" determined="infoFile" id="I2S1" location="0x400a3000"/&gt;&#13;
&lt;peripheralInstance derived_from="C-CAN1" determined="infoFile" id="C-CAN1" location="0x400a4000"/&gt;&#13;
&lt;peripheralInstance derived_from="RITIMER" determined="infoFile" id="RITIMER" location="0x400c0000"/&gt;&#13;
&lt;peripheralInstance derived_from="QEI" determined="infoFile" id="QEI" location="0x400c6000"/&gt;&#13;
&lt;peripheralInstance derived_from="GIMA" determined="infoFile" id="GIMA" location="0x400c7000"/&gt;&#13;
&lt;peripheralInstance derived_from="DAC" determined="infoFile" id="DAC" location="0x400e1000"/&gt;&#13;
&lt;peripheralInstance derived_from="C-CAN0" determined="infoFile" id="C-CAN0" location="0x400e2000"/&gt;&#13;
&lt;peripheralInstance derived_from="ADC0" determined="infoFile" id="ADC0" location="0x400e3000"/&gt;&#13;
&lt;peripheralInstance derived_from="ADC1" determined="infoFile" id="ADC1" location="0x400e4000"/&gt;&#13;
&lt;peripheralInstance derived_from="GPIO-PORT" determined="infoFile" id="GPIO-PORT" location="0x400f4000"/&gt;&#13;
&lt;peripheralInstance derived_from="SPI" determined="infoFile" id="SPI" location="0x40100000"/&gt;&#13;
&lt;peripheralInstance derived_from="SGPIO" determined="infoFile" id="SGPIO" location="0x40101000"/&gt;&#13;
&lt;memoryInstance derived_from="Flash" id="MFlash64" location="0x0" size="0x10000"/&gt;&#13;
&lt;memoryInstance derived_from="RAM" id="RamLoc8" location="0x10000000" size="0x2000"/&gt;&#13;
&lt;memoryInstance derived_from="RAM" id="RamUsb2" location="0x20004000" size="0x800"/&gt;&#13;
&lt;memoryInstance derived_from="RAM" id="RamPeriph2" location="0x20000000" size="0x800"/&gt;&#13;
&lt;prog_flash blocksz="0x1000" location="0x0" maxprgbuff="0x400" progwithcode="TRUE" size="0x10000"/&gt;&#13;
&lt;peripheralInstance derived_from="V7M_MPU" id="MPU" location="0xe000ed90"/&gt;&#13;
&lt;peripheralInstance derived_from="V7M_NVIC" id="NVIC" location="0xe000e000"/&gt;&#13;
&lt;peripheralInstance derived_from="V7M_DCR" id="DCR" location="0xe000edf0"/&gt;&#13;
&lt;peripheralInstance derived_from="V7M_ITM" id="ITM" location="0xe0000000"/&gt;&#13;
&lt;peripheralInstance derived_from="I2C" id="I2C" location="0x40000000"/&gt;&#13;
&lt;peripheralInstance derived_from="WWDT" id="WWDT" location="0x40004000"/&gt;&#13;
&lt;peripheralInstance derived_from="USART" id="USART" location="0x40008000"/&gt;&#13;
&lt;peripheralInstance derived_from="CT16B0" id="CT16B0" location="0x4000c000"/&gt;&#13;
&lt;peripheralInstance derived_from="CT16B1" id="CT16B1" location="0x40010000"/&gt;&#13;
&lt;peripheralInstance derived_from="CT32B0" id="CT32B0" location="0x40014000"/&gt;&#13;
&lt;peripheralInstance derived_from="CT32B1" id="CT32B1" location="0x40018000"/&gt;&#13;
&lt;peripheralInstance derived_from="ADC" id="ADC" location="0x4001c000"/&gt;&#13;
&lt;peripheralInstance derived_from="PMU" id="PMU" location="0x40038000"/&gt;&#13;
&lt;peripheralInstance derived_from="FLASHCTRL" id="FLASHCTRL" location="0x4003c000"/&gt;&#13;
&lt;peripheralInstance derived_from="SSP0" id="SSP0" location="0x40040000"/&gt;&#13;
&lt;peripheralInstance derived_from="IOCON" id="IOCON" location="0x40044000"/&gt;&#13;
&lt;peripheralInstance derived_from="SYSCON" id="SYSCON" location="0x40048000"/&gt;&#13;
&lt;peripheralInstance derived_from="GPIO-PIN-INT" id="GPIO-PIN-INT" location="0x4004c000"/&gt;&#13;
&lt;peripheralInstance derived_from="SSP1" id="SSP1" location="0x40058000"/&gt;&#13;
&lt;peripheralInstance derived_from="GPIO-GROUP-INT0" id="GPIO-GROUP-INT0" location="0x4005c000"/&gt;&#13;
&lt;peripheralInstance derived_from="GPIO-GROUP-INT1" id="GPIO-GROUP-INT1" location="0x40060000"/&gt;&#13;
&lt;peripheralInstance derived_from="RITIMER" id="RITIMER" location="0x40064000"/&gt;&#13;
&lt;peripheralInstance derived_from="USB" id="USB" location="0x40080000"/&gt;&#13;
&lt;peripheralInstance derived_from="GPIO-PORT" id="GPIO-PORT" location="0x50000000"/&gt;&#13;
&lt;/chip&gt;&#13;
&lt;processor&gt;&lt;name gcc_name="cortex-m4"&gt;Cortex-M4&lt;/name&gt;&#13;
&lt;processor&gt;&lt;name gcc_name="cortex-m3"&gt;Cortex-M3&lt;/name&gt;&#13;
&lt;family&gt;Cortex-M&lt;/family&gt;&#13;
&lt;/processor&gt;&#13;
&lt;link href="nxp_lpc43xx_peripheral.xme" show="embed" type="simple"/&gt;&#13;
&lt;link href="nxp_lpc13Uxx_peripheral.xme" show="embed" type="simple"/&gt;&#13;
&lt;/info&gt;&#13;
&lt;/infoList&gt;&#13;
&lt;/TargetConfig&gt;</projectStorage>

View File

@ -106,8 +106,10 @@
#define TUSB_CFG_OS_TICKS_PER_SECOND 1000
#ifdef __CODE_RED // make use of code red's support for ram region macros
#if (MCU == MCU_LPC11UXX) || (MCU == MCU_LPC13UXX)
#define TUSB_RAM_SECTION ".data.$RAM1" // TODO overflow usb ram
#if (MCU == MCU_LPC11UXX)
#error
#elif (MCU == MCU_LPC13UXX)
#define TUSB_RAM_SECTION ".data.$RAM2"
#elif (MCU == MCU_LPC43XX)
#define TUSB_RAM_SECTION ".data.$RAM3"
#elif (MCU == MCU_LPC175X_6X)

View File

@ -39,7 +39,7 @@
#include "tusb_descriptors.h"
#if TUSB_CFG_DEVICE_HID_KEYBOARD
TUSB_CFG_ATTR_USBRAM
ATTR_USB_MIN_ALIGNMENT TUSB_CFG_ATTR_USBRAM
uint8_t app_tusb_keyboard_desc_report[] = {
HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ),
HID_USAGE ( HID_USAGE_DESKTOP_KEYBOARD ),
@ -83,7 +83,7 @@ uint8_t app_tusb_keyboard_desc_report[] = {
#endif
#if TUSB_CFG_DEVICE_HID_MOUSE
TUSB_CFG_ATTR_USBRAM
ATTR_USB_MIN_ALIGNMENT TUSB_CFG_ATTR_USBRAM
uint8_t app_tusb_mouse_desc_report[] = {
HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ),
HID_USAGE ( HID_USAGE_DESKTOP_MOUSE ),
@ -128,7 +128,7 @@ uint8_t app_tusb_mouse_desc_report[] = {
};
#endif
TUSB_CFG_ATTR_USBRAM
ATTR_USB_MIN_ALIGNMENT TUSB_CFG_ATTR_USBRAM
tusb_descriptor_device_t app_tusb_desc_device =
{
.bLength = sizeof(tusb_descriptor_device_t),
@ -136,9 +136,9 @@ tusb_descriptor_device_t app_tusb_desc_device =
.bcdUSB = 0x0200,
#if IAD_DESC_REQUIRED
/* Multiple Interfaces Using Interface Association Descriptor (IAD) */
.bDeviceClass = USB_DEVICE_CLASS_IAD,
.bDeviceSubClass = USB_DEVICE_SUBCLASS_IAD,
.bDeviceProtocol = USB_DEVICE_PROTOCOL_IAD,
.bDeviceClass = TUSB_CLASS_MISC,
.bDeviceSubClass = TUSB_CLASS_CDC,
.bDeviceProtocol = 1,
#elif TUSB_CFG_DEVICE_CDC
.bDeviceClass = TUSB_CLASS_CDC,
.bDeviceSubClass = 0x00,
@ -162,7 +162,7 @@ tusb_descriptor_device_t app_tusb_desc_device =
.bNumConfigurations = 0x01 // TODO multiple configurations
};
TUSB_CFG_ATTR_USBRAM
ATTR_USB_MIN_ALIGNMENT TUSB_CFG_ATTR_USBRAM
app_descriptor_configuration_t app_tusb_desc_configuration =
{
.configuration =
@ -397,31 +397,45 @@ app_descriptor_configuration_t app_tusb_desc_configuration =
#endif
};
TUSB_CFG_ATTR_USBRAM
app_descriptor_string_t app_tusb_desc_strings =
//--------------------------------------------------------------------+
// STRING DESCRIPTORS
//--------------------------------------------------------------------+
ATTR_USB_MIN_ALIGNMENT TUSB_CFG_ATTR_USBRAM
tusb_descriptor_string_t desc_str_language =
{
//------------- index 0 -------------//
.language = {
.bLength = 0x04,
.bDescriptorType = TUSB_DESC_TYPE_STRING,
.id = 0x0409, // US English
},
//------------- index 1 -------------//
.manufacturer = {
.bLength = STRING_LEN_BYTE2UNICODE(sizeof(TUSB_CFG_DEVICE_STRING_MANUFACTURER)-1),
.bDescriptorType = TUSB_DESC_TYPE_STRING,
},
//------------- index 2 -------------//
.product = {
.bLength = STRING_LEN_BYTE2UNICODE(sizeof(TUSB_CFG_DEVICE_STRING_PRODUCT)-1),
.bDescriptorType = TUSB_DESC_TYPE_STRING,
},
//------------- index 3 -------------//
.serial = {
.bLength = STRING_LEN_BYTE2UNICODE(sizeof(TUSB_CFG_DEVICE_STRING_SERIAL)-1),
.bDescriptorType = TUSB_DESC_TYPE_STRING,
}
.bLength = 2 + 1*2,
.bDescriptorType = TUSB_DESC_TYPE_STRING,
.unicode_string = { 0x0409 }
};
ATTR_USB_MIN_ALIGNMENT TUSB_CFG_ATTR_USBRAM
tusb_descriptor_string_t desc_str_manufacturer =
{
.bLength = 2 + 11*2,
.bDescriptorType = TUSB_DESC_TYPE_STRING,
.unicode_string = { 't', 'i', 'n', 'y', 'u', 's', 'b', '.', 'o', 'r', 'g' } // len = 11
};
ATTR_USB_MIN_ALIGNMENT TUSB_CFG_ATTR_USBRAM
tusb_descriptor_string_t desc_str_product =
{
.bLength = 2 + 14*2,
.bDescriptorType = TUSB_DESC_TYPE_STRING,
.unicode_string = { 'D', 'e', 'v', 'i', 'c', 'e', ' ', 'E', 'x', 'a', 'm', 'p', 'l', 'e' } // len = 14
};
ATTR_USB_MIN_ALIGNMENT TUSB_CFG_ATTR_USBRAM
tusb_descriptor_string_t desc_str_serial =
{
.bLength = 2 + 4*2,
.bDescriptorType = TUSB_DESC_TYPE_STRING,
.unicode_string = { '1', '2', '3', '4' } // len = 4
};
tusb_descriptor_string_t * const desc_str_table [] =
{
&desc_str_language,
&desc_str_manufacturer,
&desc_str_product,
&desc_str_serial
};

View File

@ -69,7 +69,7 @@
#define MSC_EDPT_OUT ENDPOINT_OUT_LOGICAL_TO_PHYSICAL(3)
// Interface Assosication Descriptor if device is CDC + other class
#define IAD_DESC_REQUIRED ( TUSB_CFG_DEVICE_CDC && (TOTAL_INTEFACES > 2) )
#define IAD_DESC_REQUIRED ( 0 && TUSB_CFG_DEVICE_CDC && (TOTAL_INTEFACES > 2) )
// each combination of interfaces need to have different productid, as windows will bind & remember device driver after the
@ -134,46 +134,13 @@ typedef ATTR_PACKED_STRUCT(struct)
//--------------------------------------------------------------------+
// STRINGS DESCRIPTOR
//--------------------------------------------------------------------+
typedef ATTR_PACKED_STRUCT(struct)
{
//------------- index 0 -------------//
struct {
uint8_t const bLength;
uint8_t const bDescriptorType;
uint16_t id;
}language;
//------------- index 1 -------------//
struct {
uint8_t const bLength;
uint8_t const bDescriptorType;
uint16_t unicode_string[sizeof(TUSB_CFG_DEVICE_STRING_MANUFACTURER)-1]; // exclude null-character
} manufacturer;
//------------- index 2 -------------//
struct {
uint8_t const bLength;
uint8_t const bDescriptorType;
uint16_t unicode_string[sizeof(TUSB_CFG_DEVICE_STRING_PRODUCT)-1]; // exclude null-character
} product;
//------------- index 3 -------------//
struct {
uint8_t const bLength;
uint8_t const bDescriptorType;
uint16_t unicode_string[sizeof(TUSB_CFG_DEVICE_STRING_SERIAL)-1]; // exclude null-character
} serial;
//------------- more string index -------------//
} app_descriptor_string_t;
tusb_descriptor_string_t * const desc_str_table [];
//--------------------------------------------------------------------+
// Export descriptors
//--------------------------------------------------------------------+
extern tusb_descriptor_device_t app_tusb_desc_device;
extern app_descriptor_configuration_t app_tusb_desc_configuration;
extern app_descriptor_string_t app_tusb_desc_strings;
extern uint8_t app_tusb_keyboard_desc_report[];
extern uint8_t app_tusb_mouse_desc_report[];

View File

@ -119,6 +119,16 @@ tusb_error_t tusbd_hid_mouse_send(uint8_t coreid, hid_mouse_report_t const *p_re
//--------------------------------------------------------------------+
// USBD-CLASS API
//--------------------------------------------------------------------+
void hidd_init(void)
{
}
void hidd_bus_reset(uint8_t coreid)
{
}
tusb_error_t hidd_control_request(uint8_t coreid, tusb_control_request_t const * p_request)
{
hidd_interface_t* p_hid =

View File

@ -133,6 +133,8 @@ void tusbd_hid_mouse_isr(uint8_t coreid, tusb_event_t event, uint32_t xferred_by
//--------------------------------------------------------------------+
#ifdef _TINY_USB_SOURCE_FILE_
void hidd_init(void);
void hidd_bus_reset(uint8_t coreid);
tusb_error_t hidd_open(uint8_t coreid, tusb_descriptor_interface_t const * p_interface_desc, uint16_t *p_length);
tusb_error_t hidd_control_request(uint8_t coreid, tusb_control_request_t const * p_request);
void hidd_isr(endpoint_handle_t edpt_hdl, tusb_event_t event, uint32_t xferred_bytes);

View File

@ -179,12 +179,12 @@ typedef ATTR_PACKED_STRUCT(struct)
uint8_t bDescriptorType ; ///< Descriptor Type
} tusb_descriptor_header_t;
//typedef ATTR_PACKED_STRUCT(struct)
//{
// uint8_t bLength ; ///< Size of this descriptor in bytes
// uint8_t bDescriptorType ; ///< Descriptor Type
// uint16_t unicode_string[];
//} tusb_descriptor_string_t;
typedef ATTR_PACKED_STRUCT(struct)
{
uint8_t bLength ; ///< Size of this descriptor in bytes
uint8_t bDescriptorType ; ///< Descriptor Type
uint16_t unicode_string[];
} tusb_descriptor_string_t;
#ifdef __cplusplus
}

View File

@ -0,0 +1,363 @@
/**************************************************************************/
/*!
@file dcd_lpc13xx_12adc.c
@author hathach (tinyusb.org)
@section LICENSE
Software License Agreement (BSD License)
Copyright (c) 2013, hathach (tinyusb.org)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holders nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This file is part of the tinyusb stack.
*/
/**************************************************************************/
#include "tusb_option.h"
#if MODE_DEVICE_SUPPORTED && MCU == MCU_LPC13UXX
#define _TINY_USB_SOURCE_FILE_
//--------------------------------------------------------------------+
// INCLUDE
//--------------------------------------------------------------------+
#include "common/common.h"
#include "hal/hal.h"
#include "osal/osal.h"
#include "common/timeout_timer.h"
#include "dcd.h"
#include "usbd_dcd.h"
#include "dcd_lpc13uxx.h"
//--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF
//--------------------------------------------------------------------+
#define DCD_LPC13XX_QHD 10
enum {
INT_MASK_SOF = BIT_(30),
INT_MASK_DEVICE_STATUS = BIT_(31)
};
enum {
CMDSTAT_MASK_DEVICE_ENABLE = BIT_(7 ),
CMDSTAT_MASK_SETUP_RECEIVED = BIT_(8 ),
CMDSTAT_MASK_CMD_CONNECT = BIT_(16),
CMDSTAT_MASK_CMD_SUSPEND = BIT_(17),
CMDSTAT_MASK_CONNECT_CHANGE = BIT_(24),
CMDSTAT_MASK_SUSPEND_CHANGE = BIT_(25),
CMDSTAT_MASK_RESET_CHANGE = BIT_(26),
};
typedef struct {
union {
struct {
uint32_t dev_addr : 7;
uint32_t dev_enable : 1;
uint32_t setup_received : 1;
uint32_t pll_on : 1;
uint32_t : 1;
uint32_t lpm_support : 1;
uint32_t : 4; // not use interrupt on NAK
uint32_t dev_connect : 1;
uint32_t dev_suspend : 1;
uint32_t : 1;
uint32_t lpm_suspend : 1;
uint32_t lpm_remote_wakeup : 1;
uint32_t : 3;
uint32_t dev_connect_change : 1;
uint32_t dev_suspend_change : 1;
uint32_t dev_reset_change : 1;
uint32_t : 1;
uint32_t vbus_debounced : 1;
uint32_t : 3;
}bits;
uint32_t value;
};
} lpc13xx_dev_cmd_stat;
STATIC_ASSERT( sizeof(lpc13xx_dev_cmd_stat) == 4, "size is not correct" );
// buffer input must be 64 byte alignment
typedef struct {
volatile uint16_t buff_addr_offset ; ///< The address offset is updated by hardware after each successful reception/transmission of a packet. Hardware increments the original value with the integer value when the packet size is divided by 64.
volatile uint16_t total_bytes : 10 ; ///< For OUT endpoints this is the number of bytes that can be received in this buffer. For IN endpoints this is the number of bytes that must be transmitted. HW decrements this value with the packet size every time when a packet is successfully transferred. Note: If a short packet is received on an OUT endpoint, the active bit will be cleared and the NBytes value indicates the remaining buffer space that is not used. Software calculates the received number of bytes by subtracting the remaining NBytes from the programmed value.
uint16_t is_isochronous : 1 ;
uint16_t feedback_toggle : 1 ; ///< For bulk endpoints and isochronous endpoints this bit is reserved and must be set to zero. For the control endpoint zero this bit is used as the toggle value. When the toggle reset bit is set, the data toggle is updated with the value programmed in this bit. When the endpoint is used as an interrupt endpoint, it can be set to the following values. 0: Interrupt endpoint in toggle mode 1: Interrupt endpoint in rate feedback mode. This means that the data toggle is fixed to zero for all data packets. When the interrupt endpoint is in rate feedback mode, the TR bit must always be set to zero.
uint16_t toggle_reset : 1 ; ///< When software sets this bit to one, the HW will set the toggle value equal to the value indicated in the “toggle value” (TV) bit. For the control endpoint zero, this is not needed to be used because the hardware resets the endpoint toggle to one for both directions when a setup token is received. For the other endpoints, the toggle can only be reset to zero when the endpoint is reset.
uint16_t stall : 1 ; ///< 0: The selected endpoint is not stalled 1: The selected endpoint is stalled The Active bit has always higher priority than the Stall bit. This means that a Stall handshake is only sent when the active bit is zero and the stall bit is one. Software can only modify this bit when the active bit is zero.
uint16_t disable : 1 ; ///< 0: The selected endpoint is enabled. 1: The selected endpoint is disabled. If a USB token is received for an endpoint that has the disabled bit set, hardware will ignore the token and not return any data or handshake. When a bus reset is received, software must set the disable bit of all endpoints to 1. Software can only modify this bit when the active bit is zero.
volatile uint16_t active : 1 ; ///< The buffer is enabled. HW can use the buffer to store received OUT data or to transmit data on the IN endpoint. Software can only set this bit to 1. As long as this bit is set to one, software is not allowed to update any of the values in this 32-bit word. In case software wants to deactivate the buffer, it must write a one to the corresponding “skip” bit in the USB Endpoint skip register. Hardware can only write this bit to zero. It will do this when it receives a short packet or when the NBytes field transitions to zero or when software has written a one to the “skip” bit.
}dcd_lpc13xx_qhd_t;
STATIC_ASSERT( sizeof(dcd_lpc13xx_qhd_t) == 4, "size is not correct" );
typedef struct {
dcd_lpc13xx_qhd_t qhd[DCD_LPC13XX_QHD][2]; ///< must be 256 byte alignment, 2 for double buffer
// there is padding from 80 --> 128 = 48 bytes
// should start from 128
ATTR_ALIGNED(64) tusb_control_request_t setup_request;
}dcd_lpc13xx_data_t;
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
ATTR_ALIGNED(256) static dcd_lpc13xx_data_t dcd_data TUSB_CFG_ATTR_USBRAM;
static inline uint16_t addr_offset(void const * p_buffer) ATTR_CONST ATTR_ALWAYS_INLINE;
static inline uint16_t addr_offset(void const * p_buffer)
{
ASSERT( (((uint32_t) p_buffer) & 0x3f) == 0, 0 );
return (uint16_t) ( (((uint32_t) p_buffer) >> 6 ) & 0xFFFF) ;
}
//--------------------------------------------------------------------+
// CONTROLLER API
//--------------------------------------------------------------------+
void dcd_controller_connect(uint8_t coreid)
{
(void) coreid;
LPC_USB->DEVCMDSTAT |= CMDSTAT_MASK_CMD_CONNECT;
}
void dcd_controller_set_configuration(uint8_t coreid, uint8_t config_num)
{
}
void dcd_controller_set_address(uint8_t coreid, uint8_t dev_addr)
{
(void) coreid;
LPC_USB->DEVCMDSTAT &= ~0x7F;
LPC_USB->DEVCMDSTAT |= dev_addr;
}
tusb_error_t dcd_init(void)
{
LPC_USB->EPLISTSTART = (uint32_t) dcd_data.qhd;
LPC_USB->DATABUFSTART = 0x20000000; // only SRAM1 & USB RAM can be used for transfer
LPC_USB->EPBUFCFG = 0; // TODO double buffering
LPC_USB->INTSTAT = LPC_USB->INTSTAT; // clear all pending interrupt
LPC_USB->INTEN = INT_MASK_DEVICE_STATUS;
LPC_USB->DEVCMDSTAT |= CMDSTAT_MASK_DEVICE_ENABLE;
return TUSB_ERROR_NONE;
}
static void bus_reset(void)
{
memclr_(&dcd_data, sizeof(dcd_lpc13xx_data_t));
dcd_data.qhd[0][1].buff_addr_offset = addr_offset(&dcd_data.setup_request);
LPC_USB->EPINUSE = 0;
LPC_USB->EPSKIP = 0xFFFFFFFF;
LPC_USB->INTSTAT = LPC_USB->INTSTAT; // clear all pending interrupt
LPC_USB->DEVCMDSTAT |= CMDSTAT_MASK_SETUP_RECEIVED; // clear setup received interrupt
LPC_USB->INTEN = INT_MASK_DEVICE_STATUS | BIT_(0) | BIT_(1); // enable device status & control endpoints
}
void dcd_isr(uint8_t coreid)
{
(void) coreid;
uint32_t int_status = LPC_USB->INTSTAT;
int_status &= LPC_USB->INTEN;
LPC_USB->INTSTAT = int_status; // Acknowledge handled interrupt
if (int_status == 0) return;
uint32_t dev_cmd_stat = LPC_USB->DEVCMDSTAT;
//------------- Device Status -------------//
if ( int_status & INT_MASK_DEVICE_STATUS )
{
if ( dev_cmd_stat & CMDSTAT_MASK_RESET_CHANGE)
{ // bus reset
bus_reset();
usbd_bus_reset(0);
}
// TODO not support suspend yet
if ( dev_cmd_stat & CMDSTAT_MASK_SUSPEND_CHANGE) { }
if ( dev_cmd_stat & CMDSTAT_MASK_CONNECT_CHANGE)
{ // device disconnect ?
}
LPC_USB->DEVCMDSTAT |= CMDSTAT_MASK_RESET_CHANGE | CMDSTAT_MASK_SUSPEND_CHANGE | CMDSTAT_MASK_CONNECT_CHANGE;
}
//------------- Endpoint Interrupt -------------//
if ( int_status & BIT_(0) )
{
if ( dev_cmd_stat & CMDSTAT_MASK_SETUP_RECEIVED )
{ // received control request from host
// copy setup request & acknowledge so that the next setup can be received by hw
tusb_control_request_t control_request = dcd_data.setup_request;
LPC_USB->DEVCMDSTAT |= CMDSTAT_MASK_SETUP_RECEIVED;
dcd_data.qhd[0][1].buff_addr_offset = addr_offset(&dcd_data.setup_request);
usbd_setup_received_isr(coreid, &control_request);
}
}
}
//--------------------------------------------------------------------+
// CONTROL PIPE API
//--------------------------------------------------------------------+
void dcd_pipe_control_stall(uint8_t coreid)
{ // only need to stall IN Control endpoint
(void) coreid;
dcd_data.qhd[1][0].stall = 1;
}
// control transfer does not need to use qtd find function
tusb_error_t dcd_pipe_control_xfer(uint8_t coreid, tusb_direction_t dir, void * buffer, uint16_t length)
{
(void) coreid;
// determine Endpoint where Data & Status phase occurred (IN or OUT)
uint8_t const endpoint_data = (dir == TUSB_DIR_DEV_TO_HOST) ? 1 : 0;
uint8_t const endpoint_status = 1 - endpoint_data;
//------------- Data Phase -------------//
if (length)
{
dcd_data.qhd[endpoint_data][0].buff_addr_offset = addr_offset(buffer);
dcd_data.qhd[endpoint_data][0].total_bytes = length;
dcd_data.qhd[endpoint_data][0].active = 1 ;
}
//------------- Status Phase -------------//
dcd_data.qhd[endpoint_status][0].buff_addr_offset = 0;
dcd_data.qhd[endpoint_status][0].total_bytes = 0;
dcd_data.qhd[endpoint_status][0].active = 1 ;
return TUSB_ERROR_NONE;
}
//--------------------------------------------------------------------+
// PIPE HELPER
//--------------------------------------------------------------------+
//static inline uint8_t edpt_pos2phy(uint8_t pos) ATTR_CONST ATTR_ALWAYS_INLINE;
//static inline uint8_t edpt_pos2phy(uint8_t pos)
//{ // 0-5 --> OUT, 16-21 IN
// return (pos < DCD_QHD_MAX/2) ? (2*pos) : (2*(pos-16)+1);
//}
static inline uint8_t edpt_phy2pos(uint8_t physical_endpoint) ATTR_CONST ATTR_ALWAYS_INLINE;
static inline uint8_t edpt_phy2pos(uint8_t physical_endpoint)
{
return physical_endpoint/2 + ( (physical_endpoint%2) ? 16 : 0);
}
static inline uint8_t edpt_addr2phy(uint8_t endpoint_addr) ATTR_CONST ATTR_ALWAYS_INLINE;
static inline uint8_t edpt_addr2phy(uint8_t endpoint_addr)
{
return 2*(endpoint_addr & 0x0F) + ((endpoint_addr & TUSB_DIR_DEV_TO_HOST_MASK) ? 1 : 0);
}
static inline uint8_t edpt_phy2log(uint8_t physical_endpoint) ATTR_CONST ATTR_ALWAYS_INLINE;
static inline uint8_t edpt_phy2log(uint8_t physical_endpoint)
{
return physical_endpoint/2;
}
//--------------------------------------------------------------------+
// BULK/INTERRUPT/ISOCHRONOUS PIPE API
//--------------------------------------------------------------------+
tusb_error_t dcd_pipe_clear_stall(uint8_t coreid, uint8_t edpt_addr)
{
return TUSB_ERROR_NONE;
}
endpoint_handle_t dcd_pipe_open(uint8_t coreid, tusb_descriptor_endpoint_t const * p_endpoint_desc, uint8_t class_code)
{
(void) coreid;
endpoint_handle_t const null_handle = { .coreid = 0, .xfer_type = 0, .index = 0 };
if (p_endpoint_desc->bmAttributes.xfer == TUSB_XFER_ISOCHRONOUS)
return null_handle; // TODO not support ISO yet
//------------- Prepare Queue Head -------------//
uint8_t ep_idx = edpt_addr2phy(p_endpoint_desc->bEndpointAddress);
memclr_(dcd_data.qhd[ep_idx], 2*sizeof(dcd_lpc13xx_qhd_t));
dcd_data.qhd[ep_idx][0].is_isochronous = (p_endpoint_desc->bmAttributes.xfer == TUSB_XFER_ISOCHRONOUS);
LPC_USB->INTEN |= BIT_(ep_idx);
return (endpoint_handle_t)
{
.coreid = 0,
.xfer_type = p_endpoint_desc->bmAttributes.xfer,
.index = ep_idx,
.class_code = class_code
};
}
bool dcd_pipe_is_busy(endpoint_handle_t edpt_hdl)
{
return dcd_data.qhd[edpt_hdl.index][0].active;
}
// add only, controller virtually cannot know
static tusb_error_t pipe_add_xfer(endpoint_handle_t edpt_hdl, void * buffer, uint16_t total_bytes, bool int_on_complete)
{
return TUSB_ERROR_NONE;
}
tusb_error_t dcd_pipe_queue_xfer(endpoint_handle_t edpt_hdl, void * buffer, uint16_t total_bytes)
{
}
tusb_error_t dcd_pipe_xfer(endpoint_handle_t edpt_hdl, void* buffer, uint16_t total_bytes, bool int_on_complete)
{
return TUSB_ERROR_NONE;
}
#endif

View File

@ -0,0 +1,60 @@
/**************************************************************************/
/*!
@file dcd_lpc13xx_12adc.h
@author hathach (tinyusb.org)
@section LICENSE
Software License Agreement (BSD License)
Copyright (c) 2013, hathach (tinyusb.org)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holders nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This file is part of the tinyusb stack.
*/
/**************************************************************************/
/** \ingroup TBD
* \defgroup TBD
* \brief TBD
*
* @{
*/
#ifndef _TUSB_DCD_LPC13XX_12ADC_H_
#define _TUSB_DCD_LPC13XX_12ADC_H_
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif /* _TUSB_DCD_LPC13XX_12ADC_H_ */
/** @} */

View File

@ -203,7 +203,7 @@ void dcd_controller_set_configuration(uint8_t coreid, uint8_t config_num)
}
/// follows LPC43xx User Manual 23.10.3
void bus_reset(uint8_t coreid)
static void bus_reset(uint8_t coreid)
{
LPC_USB0_Type* const lpc_usb = LPC_USB[coreid];

View File

@ -95,7 +95,6 @@ static usbd_class_driver_t const usbd_class_drivers[TUSB_CLASS_MAPPED_INDEX_STAR
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
static tusb_error_t usbd_string_descriptor_init(void);
//--------------------------------------------------------------------+
// APPLICATION INTERFACE
@ -123,8 +122,6 @@ void usbd_bus_reset(uint32_t coreid)
tusb_error_t usbd_init (void)
{
ASSERT_STATUS ( usbd_string_descriptor_init() );
ASSERT_STATUS ( dcd_init() );
for (tusb_std_class_code_t class_code = TUSB_CLASS_AUDIO; class_code <= TUSB_CLASS_AUDIO_VIDEO; class_code++)
@ -180,6 +177,7 @@ tusb_error_t std_get_descriptor(uint8_t coreid, tusb_control_request_t * p_reque
{
tusb_std_descriptor_type_t const desc_type = p_request->wValue >> 8;
uint8_t const desc_index = u16_low_u8( p_request->wValue );
switch ( desc_type )
{
case TUSB_DESC_TYPE_DEVICE:
@ -193,14 +191,7 @@ tusb_error_t std_get_descriptor(uint8_t coreid, tusb_control_request_t * p_reque
break;
case TUSB_DESC_TYPE_STRING:
{
uint8_t *p_string = (uint8_t*) &app_tusb_desc_strings;
for(uint8_t index =0; index < desc_index; index++)
{
p_string += (*p_string);
}
dcd_pipe_control_xfer(coreid, TUSB_DIR_DEV_TO_HOST, p_string, *p_string);
}
dcd_pipe_control_xfer(coreid, TUSB_DIR_DEV_TO_HOST, desc_str_table[desc_index], desc_str_table[desc_index]->bLength);
break;
default:
@ -294,10 +285,6 @@ void usbd_setup_received_isr(uint8_t coreid, tusb_control_request_t * p_request)
//--------------------------------------------------------------------+
// USBD-CLASS API
//--------------------------------------------------------------------+
tusb_error_t usbd_pipe_open(uint8_t coreid, tusb_descriptor_interface_t const * p_interfacae, tusb_descriptor_endpoint_t const * p_endpoint_desc)
{
return TUSB_ERROR_NONE;
}
//--------------------------------------------------------------------+
// USBD-DCD API
@ -323,33 +310,5 @@ void usbd_xfer_isr(endpoint_handle_t edpt_hdl, tusb_event_t event, uint32_t xfer
//--------------------------------------------------------------------+
// HELPER
//--------------------------------------------------------------------+
static tusb_error_t usbd_string_descriptor_init(void)
{
ASSERT_INT( STRING_LEN_BYTE2UNICODE(sizeof(TUSB_CFG_DEVICE_STRING_MANUFACTURER)-1),
app_tusb_desc_strings.manufacturer.bLength, TUSB_ERROR_USBD_DESCRIPTOR_STRING);
ASSERT_INT( STRING_LEN_BYTE2UNICODE(sizeof(TUSB_CFG_DEVICE_STRING_PRODUCT)-1) ,
app_tusb_desc_strings.product.bLength , TUSB_ERROR_USBD_DESCRIPTOR_STRING);
ASSERT_INT( STRING_LEN_BYTE2UNICODE(sizeof(TUSB_CFG_DEVICE_STRING_SERIAL)-1) ,
app_tusb_desc_strings.serial.bLength , TUSB_ERROR_USBD_DESCRIPTOR_STRING);
for(uint32_t i=0; i < sizeof(TUSB_CFG_DEVICE_STRING_MANUFACTURER)-1; i++)
{
app_tusb_desc_strings.manufacturer.unicode_string[i] = (uint16_t) TUSB_CFG_DEVICE_STRING_MANUFACTURER[i];
}
for(uint32_t i=0; i < sizeof(TUSB_CFG_DEVICE_STRING_PRODUCT)-1; i++)
{
app_tusb_desc_strings.product.unicode_string[i] = (uint16_t) TUSB_CFG_DEVICE_STRING_PRODUCT[i];
}
for(uint32_t i=0; i < sizeof(TUSB_CFG_DEVICE_STRING_SERIAL)-1; i++)
{
app_tusb_desc_strings.serial.unicode_string[i] = (uint16_t) TUSB_CFG_DEVICE_STRING_SERIAL[i];
}
return TUSB_ERROR_NONE;
}
#endif

View File

@ -53,12 +53,17 @@
#include "osal/osal.h"
#include "dcd.h"
//#include "tusb_descriptors.h"
#ifdef __cplusplus
extern "C" {
#endif
// LPC11uxx and LPC13uxx requires each buffer has to be 64-byte alignment
#if MCU == MCU_LPC11UXX || MCU == MCU_LPC13UXX
#define ATTR_USB_MIN_ALIGNMENT ATTR_ALIGNED(64)
#else
#define ATTR_USB_MIN_ALIGNMENT
#endif
//--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF
//--------------------------------------------------------------------+
@ -85,7 +90,6 @@ bool tusbd_is_configured(uint8_t coreid) ATTR_WARN_UNUSED_RESULT;
#ifdef _TINY_USB_SOURCE_FILE_
tusb_error_t usbd_init(void);
tusb_error_t usbd_pipe_open(uint8_t coreid, tusb_descriptor_interface_t const * p_interfacae, tusb_descriptor_endpoint_t const * p_endpoint_desc);
#endif

View File

@ -86,9 +86,7 @@ static inline void hal_interrupt_disable(uint8_t coreid) ATTR_ALWAYS_INLINE;
//--------------------------------------------------------------------+
// INCLUDE DRIVEN
//--------------------------------------------------------------------+
#if MCU == 0
#error MCU is not defined or supported yet
#elif MCU == MCU_LPC11UXX
#if MCU == MCU_LPC11UXX
#include "hal_lpc11uxx.h"
#elif MCU == MCU_LPC13UXX
#include "hal_lpc13uxx.h"

View File

@ -57,6 +57,9 @@ tusb_error_t hal_init(void)
LPC_IOCON->PIO0_6 &= ~0x07;
LPC_IOCON->PIO0_6 |= (0x01<<0); /* Secondary function SoftConn */
dcd_controller_connect(0);
hal_interrupt_enable(0);
return TUSB_ERROR_NONE;
}

View File

@ -58,15 +58,15 @@
extern "C" {
#endif
static inline void hal_interrupt_enable(uint8_t controller_id)
static inline void hal_interrupt_enable(uint8_t coreid)
{
(void) controller_id; // discard compiler's warning
(void) coreid; // discard compiler's warning
NVIC_EnableIRQ(USB_IRQ_IRQn);
}
static inline void hal_interrupt_disable(uint8_t controller_id)
static inline void hal_interrupt_disable(uint8_t coreid)
{
(void) controller_id; // discard compiler's warning
(void) coreid; // discard compiler's warning
NVIC_DisableIRQ(USB_IRQ_IRQn);
}

View File

@ -78,7 +78,7 @@
#define CAP_MODE_HOST
#endif
#if MCU == MCU_LPC43XX || MCU == MCU_LPC18XX || MCU == MCU_LPC11UXX || MCU == MCU_LPC13XX_12ADC
#if MCU == MCU_LPC43XX || MCU == MCU_LPC18XX || MCU == MCU_LPC11UXX || MCU == MCU_LPC13UXX
#define CAP_DEVICE_ROMDRIVER
#endif

View File

@ -51,7 +51,7 @@
/** \defgroup MCU_ MCU Selection
* \brief TUSB_CFG_MCU must be defined to one of these
* @{ */
#define MCU_LPC13XX_12ADC 1 ///< NXP LPC13xx 12 bit ADC family with USB on-chip Rom Driver (not supported yet)
#define MCU_LPC13UXX 1 ///< NXP LPC13xx 12 bit ADC family with USB on-chip Rom Driver (not supported yet)
#define MCU_LPC13XX_10ADC 2 ///< NXP LPC13xx 10 bit ADC family (not supported yet)
#define MCU_LPC11UXX 3 ///< NXP LPC11Uxx family (not supported yet)
#define MCU_LPC43XX 4 ///< NXP LPC43xx family