mirror of
https://github.com/hathach/tinyusb.git
synced 2025-02-06 03:40:18 +00:00
refractor hid device driver
This commit is contained in:
parent
2c8b8ea529
commit
1ad78f104e
@ -30,7 +30,7 @@
|
||||
<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.1029932398" 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.1119457813" 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.2040685134" name="MCU C Compiler" superClass="com.crt.advproject.gcc.exe.debug">
|
||||
<option id="com.crt.advproject.gcc.arch.658802474" name="Architecture" superClass="com.crt.advproject.gcc.arch" value="com.crt.advproject.gcc.target.cm4" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gcc.arch.658802474" name="Architecture" superClass="com.crt.advproject.gcc.arch" value="com.crt.advproject.gcc.target.cm3" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gcc.thumb.697143257" name="Thumb mode" superClass="com.crt.advproject.gcc.thumb" value="true" valueType="boolean"/>
|
||||
<option id="gnu.c.compiler.option.preprocessor.def.symbols.371325215" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="__REDLIB__"/>
|
||||
@ -54,7 +54,7 @@
|
||||
<inputType id="com.crt.advproject.compiler.input.932601394" 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.1050918013" name="MCU Assembler" superClass="com.crt.advproject.gas.exe.debug">
|
||||
<option id="com.crt.advproject.gas.arch.1370417737" name="Architecture" superClass="com.crt.advproject.gas.arch" value="com.crt.advproject.gas.target.cm4" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gas.arch.1370417737" name="Architecture" superClass="com.crt.advproject.gas.arch" value="com.crt.advproject.gas.target.cm3" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gas.thumb.631765837" name="Thumb mode" superClass="com.crt.advproject.gas.thumb" value="true" valueType="boolean"/>
|
||||
<option id="gnu.both.asm.option.flags.crt.1931019746" name="Assembler flags" superClass="gnu.both.asm.option.flags.crt" value="-c -x assembler-with-cpp -D__REDLIB__ -DDEBUG -D__CODE_RED" valueType="string"/>
|
||||
<inputType id="com.crt.advproject.assembler.input.1898367800" name="Additional Assembly Source Files" superClass="com.crt.advproject.assembler.input"/>
|
||||
@ -62,7 +62,7 @@
|
||||
</tool>
|
||||
<tool id="com.crt.advproject.link.cpp.exe.debug.290831412" 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.1506176667" name="MCU Linker" superClass="com.crt.advproject.link.exe.debug">
|
||||
<option id="com.crt.advproject.link.arch.1411471839" name="Architecture" superClass="com.crt.advproject.link.arch" value="com.crt.advproject.link.target.cm4" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.link.arch.1411471839" name="Architecture" superClass="com.crt.advproject.link.arch" value="com.crt.advproject.link.target.cm3" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.link.thumb.897273840" name="Thumb mode" superClass="com.crt.advproject.link.thumb" value="true" valueType="boolean"/>
|
||||
<option id="com.crt.advproject.link.script.935550147" name="Linker script" superClass="com.crt.advproject.link.script" value=""device_os_none_Board_LPCXpresso1347.ld"" valueType="string"/>
|
||||
<option id="com.crt.advproject.link.manage.1693118885" name="Manage linker script" superClass="com.crt.advproject.link.manage" value="true" valueType="boolean"/>
|
||||
@ -120,7 +120,7 @@
|
||||
<builder buildPath="${workspace_loc:/device_keyboard/Debug}" errorParsers="org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.CWDLocator" id="com.crt.advproject.builder.exe.debug.1603637140" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="com.crt.advproject.builder.exe.debug"/>
|
||||
<tool id="com.crt.advproject.cpp.exe.debug.1912680765" 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.901878888" name="MCU C Compiler" superClass="com.crt.advproject.gcc.exe.debug">
|
||||
<option id="com.crt.advproject.gcc.arch.227583493" name="Architecture" superClass="com.crt.advproject.gcc.arch" value="com.crt.advproject.gcc.target.cm4" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gcc.arch.227583493" name="Architecture" superClass="com.crt.advproject.gcc.arch" value="com.crt.advproject.gcc.target.cm3" valueType="enumerated"/>
|
||||
<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__"/>
|
||||
@ -144,7 +144,7 @@
|
||||
<inputType id="com.crt.advproject.compiler.input.1660235734" 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.1919954827" name="MCU Assembler" superClass="com.crt.advproject.gas.exe.debug">
|
||||
<option id="com.crt.advproject.gas.arch.62277376" name="Architecture" superClass="com.crt.advproject.gas.arch" value="com.crt.advproject.gas.target.cm4" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gas.arch.62277376" name="Architecture" superClass="com.crt.advproject.gas.arch" value="com.crt.advproject.gas.target.cm3" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gas.thumb.567012827" name="Thumb mode" superClass="com.crt.advproject.gas.thumb" value="true" valueType="boolean"/>
|
||||
<option id="gnu.both.asm.option.flags.crt.1544048579" name="Assembler flags" superClass="gnu.both.asm.option.flags.crt" value="-c -x assembler-with-cpp -D__REDLIB__ -DDEBUG -D__CODE_RED" valueType="string"/>
|
||||
<inputType id="com.crt.advproject.assembler.input.2112542401" name="Additional Assembly Source Files" superClass="com.crt.advproject.assembler.input"/>
|
||||
@ -152,7 +152,7 @@
|
||||
</tool>
|
||||
<tool id="com.crt.advproject.link.cpp.exe.debug.438186138" 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.332994381" name="MCU Linker" superClass="com.crt.advproject.link.exe.debug">
|
||||
<option id="com.crt.advproject.link.arch.5439507" name="Architecture" superClass="com.crt.advproject.link.arch" value="com.crt.advproject.link.target.cm4" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.link.arch.5439507" name="Architecture" superClass="com.crt.advproject.link.arch" value="com.crt.advproject.link.target.cm3" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.link.thumb.1052282054" name="Thumb mode" superClass="com.crt.advproject.link.thumb" value="true" valueType="boolean"/>
|
||||
<option id="com.crt.advproject.link.script.1723865493" name="Linker script" superClass="com.crt.advproject.link.script" value=""device_os_none_Board_rf1ghznode.ld"" valueType="string"/>
|
||||
<option id="com.crt.advproject.link.manage.314167409" name="Manage linker script" superClass="com.crt.advproject.link.manage" value="true" valueType="boolean"/>
|
||||
@ -209,7 +209,7 @@
|
||||
<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__"/>
|
||||
@ -235,7 +235,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"/>
|
||||
@ -244,7 +244,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=""device_os_none_Board_EA4357.ld"" valueType="string"/>
|
||||
<option id="com.crt.advproject.link.manage.679369872" name="Manage linker script" superClass="com.crt.advproject.link.manage" value="true" valueType="boolean"/>
|
||||
@ -303,7 +303,7 @@
|
||||
<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.716919423" 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.818122291" 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.519176124" name="MCU C Compiler" superClass="com.crt.advproject.gcc.exe.debug">
|
||||
<option id="com.crt.advproject.gcc.arch.1604470626" name="Architecture" superClass="com.crt.advproject.gcc.arch" value="com.crt.advproject.gcc.target.cm4" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gcc.arch.1604470626" name="Architecture" superClass="com.crt.advproject.gcc.arch" value="com.crt.advproject.gcc.target.cm3" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gcc.thumb.530159727" name="Thumb mode" superClass="com.crt.advproject.gcc.thumb" value="true" valueType="boolean"/>
|
||||
<option id="gnu.c.compiler.option.preprocessor.def.symbols.216849614" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="__REDLIB__"/>
|
||||
@ -327,7 +327,7 @@
|
||||
<inputType id="com.crt.advproject.compiler.input.289588331" 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.1445080885" name="MCU Assembler" superClass="com.crt.advproject.gas.exe.debug">
|
||||
<option id="com.crt.advproject.gas.arch.573681571" name="Architecture" superClass="com.crt.advproject.gas.arch" value="com.crt.advproject.gas.target.cm4" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gas.arch.573681571" name="Architecture" superClass="com.crt.advproject.gas.arch" value="com.crt.advproject.gas.target.cm3" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gas.thumb.1344894564" name="Thumb mode" superClass="com.crt.advproject.gas.thumb" value="true" valueType="boolean"/>
|
||||
<option id="gnu.both.asm.option.flags.crt.1806326273" name="Assembler flags" superClass="gnu.both.asm.option.flags.crt" value="-c -x assembler-with-cpp -D__REDLIB__ -DDEBUG -D__CODE_RED" valueType="string"/>
|
||||
<inputType id="com.crt.advproject.assembler.input.76983017" name="Additional Assembly Source Files" superClass="com.crt.advproject.assembler.input"/>
|
||||
@ -335,7 +335,7 @@
|
||||
</tool>
|
||||
<tool id="com.crt.advproject.link.cpp.exe.debug.1329585347" 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.1053597758" name="MCU Linker" superClass="com.crt.advproject.link.exe.debug">
|
||||
<option id="com.crt.advproject.link.arch.1241988591" name="Architecture" superClass="com.crt.advproject.link.arch" value="com.crt.advproject.link.target.cm4" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.link.arch.1241988591" name="Architecture" superClass="com.crt.advproject.link.arch" value="com.crt.advproject.link.target.cm3" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.link.thumb.659100667" name="Thumb mode" superClass="com.crt.advproject.link.thumb" value="true" valueType="boolean"/>
|
||||
<option id="com.crt.advproject.link.script.849880058" name="Linker script" superClass="com.crt.advproject.link.script" value=""device_os_none_Board_LPCXpresso1769.ld"" valueType="string"/>
|
||||
<option id="com.crt.advproject.link.manage.1592623502" name="Manage linker script" superClass="com.crt.advproject.link.manage" value="true" valueType="boolean"/>
|
||||
@ -393,7 +393,7 @@
|
||||
<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.1899170794" 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.2135943703" 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.1279756637" name="MCU C Compiler" superClass="com.crt.advproject.gcc.exe.debug">
|
||||
<option id="com.crt.advproject.gcc.arch.1377327030" name="Architecture" superClass="com.crt.advproject.gcc.arch" value="com.crt.advproject.gcc.target.cm4" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gcc.arch.1377327030" name="Architecture" superClass="com.crt.advproject.gcc.arch" value="com.crt.advproject.gcc.target.cm3" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gcc.thumb.35682332" name="Thumb mode" superClass="com.crt.advproject.gcc.thumb" value="true" valueType="boolean"/>
|
||||
<option id="gnu.c.compiler.option.preprocessor.def.symbols.2136316715" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="__REDLIB__"/>
|
||||
@ -419,7 +419,7 @@
|
||||
<inputType id="com.crt.advproject.compiler.input.978348926" 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.985680963" name="MCU Assembler" superClass="com.crt.advproject.gas.exe.debug">
|
||||
<option id="com.crt.advproject.gas.arch.614488739" name="Architecture" superClass="com.crt.advproject.gas.arch" value="com.crt.advproject.gas.target.cm4" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gas.arch.614488739" name="Architecture" superClass="com.crt.advproject.gas.arch" value="com.crt.advproject.gas.target.cm3" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gas.thumb.1110106343" name="Thumb mode" superClass="com.crt.advproject.gas.thumb" value="true" valueType="boolean"/>
|
||||
<option id="gnu.both.asm.option.flags.crt.1384228154" 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.620068352" name="Floating point" superClass="com.crt.advproject.gas.fpu" value="com.crt.advproject.gas.fpu.fpv4" valueType="enumerated"/>
|
||||
@ -428,7 +428,7 @@
|
||||
</tool>
|
||||
<tool id="com.crt.advproject.link.cpp.exe.debug.738370064" 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.357593495" name="MCU Linker" superClass="com.crt.advproject.link.exe.debug">
|
||||
<option id="com.crt.advproject.link.arch.1578855812" name="Architecture" superClass="com.crt.advproject.link.arch" value="com.crt.advproject.link.target.cm4" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.link.arch.1578855812" name="Architecture" superClass="com.crt.advproject.link.arch" value="com.crt.advproject.link.target.cm3" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.link.thumb.1249648720" name="Thumb mode" superClass="com.crt.advproject.link.thumb" value="true" valueType="boolean"/>
|
||||
<option id="com.crt.advproject.link.script.1933263022" name="Linker script" superClass="com.crt.advproject.link.script" value=""device_os_none_Board_EA4357.ld"" valueType="string"/>
|
||||
<option id="com.crt.advproject.link.manage.1871988533" name="Manage linker script" superClass="com.crt.advproject.link.manage" value="true" valueType="boolean"/>
|
||||
@ -467,83 +467,49 @@
|
||||
<storageModule moduleId="com.crt.config">
|
||||
<projectStorage><?xml version="1.0" encoding="UTF-8"?>
|
||||
<TargetConfig>
|
||||
<Properties property_0="" property_3="NXP" property_4="LPC4370" property_count="5" version="1"/>
|
||||
<infoList vendor="NXP"><info chip="LPC4370" match_id="0x0" name="LPC4370" resetscript="LPC18LPC43ExternalFLASHBootResetscript.scp" stub="crt_emu_lpc18_43_nxp"><chip><name>LPC4370</name>
|
||||
<family>LPC43xx</family>
|
||||
<Properties property_0="" property_3="NXP" property_4="LPC1347" property_count="5" version="1"/>
|
||||
<infoList vendor="NXP"><info chip="LPC1347" match_id="0x08020543" name="LPC1347" stub="crt_emu_lpc11_13_nxp"><chip><name>LPC1347</name>
|
||||
<family>LPC13xx (12bit ADC)</family>
|
||||
<vendor>NXP (formerly Philips)</vendor>
|
||||
<reset board="None" core="Real" sys="Real"/>
|
||||
<clock changeable="TRUE" freq="20MHz" is_accurate="TRUE"/>
|
||||
<clock changeable="TRUE" freq="12MHz" is_accurate="TRUE"/>
|
||||
<memory can_program="true" id="Flash" is_ro="true" type="Flash"/>
|
||||
<memory id="RAM" type="RAM"/>
|
||||
<memory id="Periph" is_volatile="true" type="Peripheral"/>
|
||||
<memoryInstance derived_from="RAM" id="RamLoc128" location="0x10000000" size="0x20000"/>
|
||||
<memoryInstance derived_from="RAM" id="RamLoc72" location="0x10080000" size="0x12000"/>
|
||||
<memoryInstance derived_from="RAM" id="RamAHB32" location="0x20000000" size="0x8000"/>
|
||||
<memoryInstance derived_from="RAM" id="RamAHB16" location="0x20008000" size="0x4000"/>
|
||||
<memoryInstance derived_from="RAM" id="RamAHB_ETB16" location="0x2000c000" size="0x4000"/>
|
||||
<memoryInstance derived_from="RAM" id="RamM0Sub16" location="0x18000000" size="0x4000"/>
|
||||
<memoryInstance derived_from="RAM" id="RamM0Sub2" location="0x18004000" size="0x800"/>
|
||||
<memoryInstance derived_from="Flash" id="MFlash64" location="0x0" size="0x10000"/>
|
||||
<memoryInstance derived_from="RAM" id="RamLoc8" location="0x10000000" size="0x2000"/>
|
||||
<memoryInstance derived_from="RAM" id="RamUsb2" location="0x20004000" size="0x800"/>
|
||||
<memoryInstance derived_from="RAM" id="RamPeriph2" location="0x20000000" size="0x800"/>
|
||||
<prog_flash blocksz="0x1000" location="0x0" maxprgbuff="0x400" progwithcode="TRUE" size="0x10000"/>
|
||||
<peripheralInstance derived_from="V7M_MPU" id="MPU" location="0xe000ed90"/>
|
||||
<peripheralInstance derived_from="V7M_NVIC" id="NVIC" location="0xe000e000"/>
|
||||
<peripheralInstance derived_from="V7M_DCR" id="DCR" location="0xe000edf0"/>
|
||||
<peripheralInstance derived_from="V7M_ITM" id="ITM" location="0xe0000000"/>
|
||||
<peripheralInstance derived_from="SCT" id="SCT" location="0x40000000"/>
|
||||
<peripheralInstance derived_from="GPDMA" id="GPDMA" location="0x40002000"/>
|
||||
<peripheralInstance derived_from="SPIFI" id="SPIFI" location="0x40003000"/>
|
||||
<peripheralInstance derived_from="SDMMC" id="SDMMC" location="0x40004000"/>
|
||||
<peripheralInstance derived_from="EMC" id="EMC" location="0x40005000"/>
|
||||
<peripheralInstance derived_from="USB0" id="USB0" location="0x40006000"/>
|
||||
<peripheralInstance derived_from="USB1" id="USB1" location="0x40007000"/>
|
||||
<peripheralInstance derived_from="LCD" id="LCD" location="0x40008000"/>
|
||||
<peripheralInstance derived_from="EEPROM" id="EEPROM" location="0x4000e000"/>
|
||||
<peripheralInstance derived_from="ETHERNET" id="ETHERNET" location="0x40010000"/>
|
||||
<peripheralInstance derived_from="ATIMER" id="ATIMER" location="0x40040000"/>
|
||||
<peripheralInstance derived_from="REGFILE" id="REGFILE" location="0x40041000"/>
|
||||
<peripheralInstance derived_from="PMC" id="PMC" location="0x40042000"/>
|
||||
<peripheralInstance derived_from="CREG" id="CREG" location="0x40043000"/>
|
||||
<peripheralInstance derived_from="EVENTROUTER" id="EVENTROUTER" location="0x40044000"/>
|
||||
<peripheralInstance derived_from="RTC" id="RTC" location="0x40046000"/>
|
||||
<peripheralInstance derived_from="CGU" id="CGU" location="0x40050000"/>
|
||||
<peripheralInstance derived_from="CCU1" id="CCU1" location="0x40051000"/>
|
||||
<peripheralInstance derived_from="CCU2" id="CCU2" location="0x40052000"/>
|
||||
<peripheralInstance derived_from="RGU" id="RGU" location="0x40053000"/>
|
||||
<peripheralInstance derived_from="WWDT" id="WWDT" location="0x40080000"/>
|
||||
<peripheralInstance derived_from="USART0" id="USART0" location="0x40081000"/>
|
||||
<peripheralInstance derived_from="USART2" id="USART2" location="0x400c1000"/>
|
||||
<peripheralInstance derived_from="USART3" id="USART3" location="0x400c2000"/>
|
||||
<peripheralInstance derived_from="UART1" id="UART1" location="0x40082000"/>
|
||||
<peripheralInstance derived_from="SSP0" id="SSP0" location="0x40083000"/>
|
||||
<peripheralInstance derived_from="SSP1" id="SSP1" location="0x400c5000"/>
|
||||
<peripheralInstance derived_from="TIMER0" id="TIMER0" location="0x40084000"/>
|
||||
<peripheralInstance derived_from="TIMER1" id="TIMER1" location="0x40085000"/>
|
||||
<peripheralInstance derived_from="TIMER2" id="TIMER2" location="0x400c3000"/>
|
||||
<peripheralInstance derived_from="TIMER3" id="TIMER3" location="0x400c4000"/>
|
||||
<peripheralInstance derived_from="SCU" id="SCU" location="0x40086000"/>
|
||||
<peripheralInstance derived_from="GPIO-PIN-INT" id="GPIO-PIN-INT" location="0x40087000"/>
|
||||
<peripheralInstance derived_from="GPIO-GROUP-INT0" id="GPIO-GROUP-INT0" location="0x40088000"/>
|
||||
<peripheralInstance derived_from="GPIO-GROUP-INT1" id="GPIO-GROUP-INT1" location="0x40089000"/>
|
||||
<peripheralInstance derived_from="MCPWM" id="MCPWM" location="0x400a0000"/>
|
||||
<peripheralInstance derived_from="I2C0" id="I2C0" location="0x400a1000"/>
|
||||
<peripheralInstance derived_from="I2C1" id="I2C1" location="0x400e0000"/>
|
||||
<peripheralInstance derived_from="I2S0" id="I2S0" location="0x400a2000"/>
|
||||
<peripheralInstance derived_from="I2S1" id="I2S1" location="0x400a3000"/>
|
||||
<peripheralInstance derived_from="C-CAN1" id="C-CAN1" location="0x400a4000"/>
|
||||
<peripheralInstance derived_from="RITIMER" id="RITIMER" location="0x400c0000"/>
|
||||
<peripheralInstance derived_from="QEI" id="QEI" location="0x400c6000"/>
|
||||
<peripheralInstance derived_from="GIMA" id="GIMA" location="0x400c7000"/>
|
||||
<peripheralInstance derived_from="DAC" id="DAC" location="0x400e1000"/>
|
||||
<peripheralInstance derived_from="C-CAN0" id="C-CAN0" location="0x400e2000"/>
|
||||
<peripheralInstance derived_from="ADC0" id="ADC0" location="0x400e3000"/>
|
||||
<peripheralInstance derived_from="ADC1" id="ADC1" location="0x400e4000"/>
|
||||
<peripheralInstance derived_from="ADCHS" id="ADCHS" location="0x400f0000"/>
|
||||
<peripheralInstance derived_from="GPIO-PORT" id="GPIO-PORT" location="0x400f4000"/>
|
||||
<peripheralInstance derived_from="SPI" id="SPI" location="0x40100000"/>
|
||||
<peripheralInstance derived_from="SGPIO" id="SGPIO" location="0x40101000"/>
|
||||
<peripheralInstance derived_from="I2C" id="I2C" location="0x40000000"/>
|
||||
<peripheralInstance derived_from="WWDT" id="WWDT" location="0x40004000"/>
|
||||
<peripheralInstance derived_from="USART" id="USART" location="0x40008000"/>
|
||||
<peripheralInstance derived_from="CT16B0" id="CT16B0" location="0x4000c000"/>
|
||||
<peripheralInstance derived_from="CT16B1" id="CT16B1" location="0x40010000"/>
|
||||
<peripheralInstance derived_from="CT32B0" id="CT32B0" location="0x40014000"/>
|
||||
<peripheralInstance derived_from="CT32B1" id="CT32B1" location="0x40018000"/>
|
||||
<peripheralInstance derived_from="ADC" id="ADC" location="0x4001c000"/>
|
||||
<peripheralInstance derived_from="PMU" id="PMU" location="0x40038000"/>
|
||||
<peripheralInstance derived_from="FLASHCTRL" id="FLASHCTRL" location="0x4003c000"/>
|
||||
<peripheralInstance derived_from="SSP0" id="SSP0" location="0x40040000"/>
|
||||
<peripheralInstance derived_from="IOCON" id="IOCON" location="0x40044000"/>
|
||||
<peripheralInstance derived_from="SYSCON" id="SYSCON" location="0x40048000"/>
|
||||
<peripheralInstance derived_from="GPIO-PIN-INT" id="GPIO-PIN-INT" location="0x4004c000"/>
|
||||
<peripheralInstance derived_from="SSP1" id="SSP1" location="0x40058000"/>
|
||||
<peripheralInstance derived_from="GPIO-GROUP-INT0" id="GPIO-GROUP-INT0" location="0x4005c000"/>
|
||||
<peripheralInstance derived_from="GPIO-GROUP-INT1" id="GPIO-GROUP-INT1" location="0x40060000"/>
|
||||
<peripheralInstance derived_from="RITIMER" id="RITIMER" location="0x40064000"/>
|
||||
<peripheralInstance derived_from="USB" id="USB" location="0x40080000"/>
|
||||
<peripheralInstance derived_from="GPIO-PORT" id="GPIO-PORT" location="0x50000000"/>
|
||||
</chip>
|
||||
<processor><name gcc_name="cortex-m4">Cortex-M4</name>
|
||||
<processor><name gcc_name="cortex-m3">Cortex-M3</name>
|
||||
<family>Cortex-M</family>
|
||||
</processor>
|
||||
<link href="nxp_lpc43xx_peripheral.xme" show="embed" type="simple"/>
|
||||
<link href="nxp_lpc13Uxx_peripheral.xme" show="embed" type="simple"/>
|
||||
</info>
|
||||
</infoList>
|
||||
</TargetConfig></projectStorage>
|
||||
|
@ -59,6 +59,16 @@ static uint8_t keyboardd_report_count; // number of reports sent each mounted
|
||||
//--------------------------------------------------------------------+
|
||||
// tinyusb Callbacks
|
||||
//--------------------------------------------------------------------+
|
||||
void tusbd_hid_keyboard_mounted_cb(uint8_t coreid)
|
||||
{
|
||||
keyboardd_report_count = 0;
|
||||
}
|
||||
|
||||
void tusbd_hid_keyboard_unmounted_cb(uint8_t coreid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void tusbd_hid_keyboard_cb(uint8_t coreid, tusb_event_t event, uint32_t xferred_bytes)
|
||||
{
|
||||
switch(event)
|
||||
@ -70,11 +80,6 @@ void tusbd_hid_keyboard_cb(uint8_t coreid, tusb_event_t event, uint32_t xferred_
|
||||
}
|
||||
}
|
||||
|
||||
void tusbd_hid_keyboard_mounted_cb(uint8_t coreid)
|
||||
{
|
||||
keyboardd_report_count = 0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// APPLICATION CODE
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -59,6 +59,16 @@ static uint8_t moused_report_count; // number of reports sent each mounted
|
||||
//--------------------------------------------------------------------+
|
||||
// tinyusb Callbacks
|
||||
//--------------------------------------------------------------------+
|
||||
void tusbd_hid_mouse_mounted_cb(uint8_t coreid)
|
||||
{
|
||||
moused_report_count = 0;
|
||||
}
|
||||
|
||||
void tusbd_hid_mouse_unmounted_cb(uint8_t coreid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void tusbd_hid_mouse_cb(uint8_t coreid, tusb_event_t event, uint32_t xferred_bytes)
|
||||
{
|
||||
switch(event)
|
||||
@ -70,11 +80,6 @@ void tusbd_hid_mouse_cb(uint8_t coreid, tusb_event_t event, uint32_t xferred_byt
|
||||
}
|
||||
}
|
||||
|
||||
void tusbd_hid_mouse_mounted_cb(uint8_t coreid)
|
||||
{
|
||||
moused_report_count = 0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// APPLICATION CODE
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -86,8 +86,8 @@
|
||||
#define TUSB_CFG_DEVICE_HID_KEYBOARD 1
|
||||
#define TUSB_CFG_DEVICE_HID_MOUSE 1
|
||||
#define TUSB_CFG_DEVICE_HID_GENERIC 0
|
||||
#define TUSB_CFG_DEVICE_MSC 1
|
||||
#define TUSB_CFG_DEVICE_CDC 1
|
||||
#define TUSB_CFG_DEVICE_MSC 0
|
||||
#define TUSB_CFG_DEVICE_CDC 0
|
||||
|
||||
|
||||
|
||||
|
@ -418,7 +418,7 @@ tusb_descriptor_string_t desc_str_product =
|
||||
{
|
||||
.bLength = STRING_LEN_UNICODE(14),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_STRING,
|
||||
.unicode_string = { 'D', 'e', 'v', 'i', 'c', 'e', ' ', 'E', 'x', 'a', 'm', 'p', 'l', 'e' } // len = 14
|
||||
.unicode_string = { 't', 'i', 'n', 'y', 'u', 's', 'b', ' ', 'D', 'e', 'v', 'i', 'c', 'e' } // len = 14
|
||||
};
|
||||
|
||||
ATTR_USB_MIN_ALIGNMENT TUSB_CFG_ATTR_USBRAM
|
||||
|
@ -51,25 +51,62 @@
|
||||
//--------------------------------------------------------------------+
|
||||
// MACRO CONSTANT TYPEDEF
|
||||
//--------------------------------------------------------------------+
|
||||
ATTR_USB_MIN_ALIGNMENT uint8_t set_report[ MAX_OF(sizeof(hid_keyboard_report_t), sizeof(hid_mouse_report_t)) ];
|
||||
ATTR_USB_MIN_ALIGNMENT uint8_t set_report[ MAX_OF(sizeof(hid_keyboard_report_t), sizeof(hid_mouse_report_t)) ] TUSB_CFG_ATTR_USBRAM;
|
||||
|
||||
enum {
|
||||
HIDD_NUMBER_OF_SUBCLASS = 3
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
uint8_t const * p_report_desc;
|
||||
uint16_t report_length;
|
||||
|
||||
endpoint_handle_t ept_handle;
|
||||
uint8_t interface_number;
|
||||
}hidd_interface_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t const * const p_report_desc;
|
||||
hidd_interface_t * const p_interface;
|
||||
void (* const mounted_cb) (uint8_t coreid);
|
||||
void (* const unmounted_cb) (uint8_t coreid);
|
||||
void (* const xfer_cb) (uint8_t, tusb_event_t, uint32_t);
|
||||
}hidd_class_driver_t;
|
||||
|
||||
extern ATTR_WEAK hidd_interface_t keyboardd_data;
|
||||
extern ATTR_WEAK hidd_interface_t moused_data;
|
||||
|
||||
static hidd_class_driver_t const hidd_class_driver[HIDD_NUMBER_OF_SUBCLASS] =
|
||||
{
|
||||
// [HID_PROTOCOL_NONE] = for HID Generic
|
||||
|
||||
#if TUSB_CFG_DEVICE_HID_KEYBOARD
|
||||
[HID_PROTOCOL_KEYBOARD] =
|
||||
{
|
||||
.p_report_desc = app_tusb_keyboard_desc_report,
|
||||
.p_interface = &keyboardd_data,
|
||||
.mounted_cb = tusbd_hid_keyboard_mounted_cb,
|
||||
.unmounted_cb = tusbd_hid_keyboard_unmounted_cb,
|
||||
.xfer_cb = tusbd_hid_keyboard_cb
|
||||
},
|
||||
#endif
|
||||
|
||||
#if TUSB_CFG_DEVICE_HID_MOUSE
|
||||
[HID_PROTOCOL_MOUSE] =
|
||||
{
|
||||
.p_report_desc = app_tusb_mouse_desc_report,
|
||||
.p_interface = &moused_data,
|
||||
.mounted_cb = tusbd_hid_mouse_mounted_cb,
|
||||
.unmounted_cb = tusbd_hid_mouse_unmounted_cb,
|
||||
.xfer_cb = tusbd_hid_mouse_cb
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// KEYBOARD APPLICATION API
|
||||
//--------------------------------------------------------------------+
|
||||
#if TUSB_CFG_DEVICE_HID_KEYBOARD
|
||||
STATIC_VAR TUSB_CFG_ATTR_USBRAM hidd_interface_t keyboardd_data =
|
||||
{
|
||||
.p_report_desc = app_tusb_keyboard_desc_report
|
||||
};
|
||||
STATIC_VAR TUSB_CFG_ATTR_USBRAM hidd_interface_t keyboardd_data;
|
||||
|
||||
bool tusbd_hid_keyboard_is_busy(uint8_t coreid)
|
||||
{
|
||||
@ -92,10 +129,7 @@ tusb_error_t tusbd_hid_keyboard_send(uint8_t coreid, hid_keyboard_report_t const
|
||||
// MOUSE APPLICATION API
|
||||
//--------------------------------------------------------------------+
|
||||
#if TUSB_CFG_DEVICE_HID_MOUSE
|
||||
STATIC_VAR TUSB_CFG_ATTR_USBRAM hidd_interface_t moused_data =
|
||||
{
|
||||
.p_report_desc = app_tusb_mouse_desc_report
|
||||
};
|
||||
STATIC_VAR TUSB_CFG_ATTR_USBRAM hidd_interface_t moused_data;
|
||||
|
||||
bool tusbd_hid_mouse_is_busy(uint8_t coreid)
|
||||
{
|
||||
@ -112,35 +146,56 @@ tusb_error_t tusbd_hid_mouse_send(uint8_t coreid, hid_mouse_report_t const *p_re
|
||||
|
||||
return TUSB_ERROR_NONE;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USBD-CLASS API
|
||||
//--------------------------------------------------------------------+
|
||||
static void interface_clear(hidd_interface_t * p_interface)
|
||||
{
|
||||
if ( p_interface != NULL )
|
||||
{
|
||||
memclr_(p_interface, sizeof(hidd_interface_t));
|
||||
p_interface->interface_number = INTERFACE_INVALID_NUMBER;
|
||||
}
|
||||
}
|
||||
|
||||
void hidd_init(void)
|
||||
{
|
||||
// TODO not implemented yet
|
||||
for(uint8_t i=0; i<HIDD_NUMBER_OF_SUBCLASS; i++)
|
||||
{
|
||||
interface_clear( hidd_class_driver[i].p_interface );
|
||||
}
|
||||
}
|
||||
|
||||
void hidd_close(uint8_t coreid)
|
||||
{
|
||||
// TODO not implemented yet
|
||||
for(uint8_t i=0; i<HIDD_NUMBER_OF_SUBCLASS; i++)
|
||||
{
|
||||
interface_clear(hidd_class_driver[i].p_interface);
|
||||
if ( hidd_class_driver[i].unmounted_cb )
|
||||
{
|
||||
hidd_class_driver[i].unmounted_cb(coreid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tusb_error_t hidd_control_request(uint8_t coreid, tusb_control_request_t const * p_request)
|
||||
{
|
||||
hidd_interface_t* p_hid =
|
||||
#if TUSB_CFG_DEVICE_HID_KEYBOARD
|
||||
(p_request->wIndex == keyboardd_data.interface_number) ? &keyboardd_data :
|
||||
#endif
|
||||
#if TUSB_CFG_DEVICE_HID_MOUSE
|
||||
(p_request->wIndex == moused_data.interface_number) ? &moused_data :
|
||||
#endif
|
||||
NULL;
|
||||
uint8_t subclass_idx;
|
||||
for(subclass_idx=0; subclass_idx<HIDD_NUMBER_OF_SUBCLASS; subclass_idx++)
|
||||
{
|
||||
hidd_interface_t * const p_interface = hidd_class_driver[subclass_idx].p_interface;
|
||||
if ( (p_interface != NULL) && (p_request->wIndex == p_interface->interface_number) )
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ASSERT_PTR(p_hid, TUSB_ERROR_FAILED);
|
||||
ASSERT(subclass_idx < HIDD_NUMBER_OF_SUBCLASS, TUSB_ERROR_FAILED);
|
||||
|
||||
hidd_class_driver_t* const p_driver = &hidd_class_driver[subclass_idx];
|
||||
hidd_interface_t* const p_hid = p_driver->p_interface;
|
||||
|
||||
//------------- STD Request -------------//
|
||||
if (p_request->bmRequestType_bit.type == TUSB_REQUEST_TYPE_STANDARD)
|
||||
@ -153,7 +208,7 @@ tusb_error_t hidd_control_request(uint8_t coreid, tusb_control_request_t const *
|
||||
ASSERT ( p_request->bRequest == TUSB_REQUEST_GET_DESCRIPTOR && desc_type == HID_DESC_TYPE_REPORT,
|
||||
TUSB_ERROR_DCD_CONTROL_REQUEST_NOT_SUPPORT);
|
||||
|
||||
dcd_pipe_control_xfer(coreid, TUSB_DIR_DEV_TO_HOST, p_hid->p_report_desc, p_hid->report_length);
|
||||
dcd_pipe_control_xfer(coreid, TUSB_DIR_DEV_TO_HOST, p_driver->p_report_desc, p_hid->report_length);
|
||||
}
|
||||
//------------- Class Specific Request -------------//
|
||||
else if (p_request->bmRequestType_bit.type == TUSB_REQUEST_TYPE_CLASS)
|
||||
@ -166,7 +221,7 @@ tusb_error_t hidd_control_request(uint8_t coreid, tusb_control_request_t const *
|
||||
|
||||
case HID_REQUEST_CONTROL_SET_REPORT:
|
||||
{
|
||||
return TUSB_ERROR_DCD_CONTROL_REQUEST_NOT_SUPPORT; // TODO test STALL control out endpoint (with mouse+keyboard)
|
||||
// return TUSB_ERROR_DCD_CONTROL_REQUEST_NOT_SUPPORT; // TODO test STALL control out endpoint (with mouse+keyboard)aaaaa
|
||||
|
||||
// TODO HIDD set report support
|
||||
hid_request_report_type_t report_type = u16_high_u8(p_request->wValue);
|
||||
@ -215,14 +270,8 @@ tusb_error_t hidd_open(uint8_t coreid, tusb_descriptor_interface_t const * p_int
|
||||
case HID_PROTOCOL_KEYBOARD:
|
||||
case HID_PROTOCOL_MOUSE:
|
||||
{
|
||||
hidd_interface_t* p_hid =
|
||||
#if TUSB_CFG_DEVICE_HID_KEYBOARD
|
||||
(p_interface_desc->bInterfaceProtocol == HID_PROTOCOL_KEYBOARD) ? &keyboardd_data :
|
||||
#endif
|
||||
#if TUSB_CFG_DEVICE_HID_MOUSE
|
||||
(p_interface_desc->bInterfaceProtocol == HID_PROTOCOL_MOUSE) ? &moused_data :
|
||||
#endif
|
||||
NULL;
|
||||
hidd_class_driver_t * const p_driver = &hidd_class_driver[p_interface_desc->bInterfaceProtocol];
|
||||
hidd_interface_t * const p_hid = p_driver->p_interface;
|
||||
|
||||
ASSERT_PTR(p_hid, TUSB_ERROR_FAILED);
|
||||
|
||||
@ -232,19 +281,7 @@ tusb_error_t hidd_open(uint8_t coreid, tusb_descriptor_interface_t const * p_int
|
||||
p_hid->interface_number = p_interface_desc->bInterfaceNumber;
|
||||
p_hid->report_length = p_desc_hid->wReportLength;
|
||||
|
||||
#if TUSB_CFG_DEVICE_HID_KEYBOARD
|
||||
if (p_interface_desc->bInterfaceProtocol == HID_PROTOCOL_KEYBOARD)
|
||||
{
|
||||
tusbd_hid_keyboard_mounted_cb(coreid);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TUSB_CFG_DEVICE_HID_MOUSE
|
||||
if (p_interface_desc->bInterfaceProtocol == HID_PROTOCOL_MOUSE)
|
||||
{
|
||||
tusbd_hid_mouse_mounted_cb(coreid);
|
||||
}
|
||||
#endif
|
||||
p_driver->mounted_cb(coreid);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -263,19 +300,14 @@ tusb_error_t hidd_open(uint8_t coreid, tusb_descriptor_interface_t const * p_int
|
||||
|
||||
tusb_error_t hidd_xfer_cb(endpoint_handle_t edpt_hdl, tusb_event_t event, uint32_t xferred_bytes)
|
||||
{
|
||||
#if TUSB_CFG_DEVICE_HID_KEYBOARD
|
||||
if ( endpointhandle_is_equal(edpt_hdl, keyboardd_data.ept_handle) )
|
||||
for(uint8_t i=0; i<HIDD_NUMBER_OF_SUBCLASS; i++)
|
||||
{
|
||||
tusbd_hid_keyboard_cb(edpt_hdl.coreid, event, xferred_bytes);
|
||||
hidd_interface_t * const p_interface = hidd_class_driver[i].p_interface;
|
||||
if ( (p_interface != NULL) && endpointhandle_is_equal(edpt_hdl, p_interface->ept_handle) )
|
||||
{
|
||||
hidd_class_driver[i].xfer_cb(edpt_hdl.coreid, event, xferred_bytes);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TUSB_CFG_DEVICE_HID_MOUSE
|
||||
if ( endpointhandle_is_equal(edpt_hdl, moused_data.ept_handle) )
|
||||
{
|
||||
tusbd_hid_mouse_cb(edpt_hdl.coreid, event, xferred_bytes);
|
||||
}
|
||||
#endif
|
||||
|
||||
return TUSB_ERROR_NONE;
|
||||
}
|
||||
@ -300,49 +332,6 @@ static volatile bool bMouseChanged = false;
|
||||
//--------------------------------------------------------------------+
|
||||
// APPLICATION API
|
||||
//--------------------------------------------------------------------+
|
||||
#if TUSB_CFG_DEVICE_HID_KEYBOARD
|
||||
tusb_error_t tusbd_hid_keyboard_send_report(hid_keyboard_report_t *p_kbd_report)
|
||||
{
|
||||
// uint32_t start_time = systickGetSecondsActive();
|
||||
// while (bKeyChanged) // TODO blocking while previous key has yet sent - can use fifo to improve this
|
||||
// {
|
||||
// ASSERT_MESSAGE(systickGetSecondsActive() - start_time < 5, ERR_FAILED, "HID Keyboard Timeout");
|
||||
// }
|
||||
|
||||
if (bKeyChanged)
|
||||
{
|
||||
return TUSB_ERROR_FAILED;
|
||||
}
|
||||
|
||||
ASSERT_PTR(p_kbd_report, TUSB_ERROR_FAILED);
|
||||
|
||||
hid_keyboard_report = *p_kbd_report;
|
||||
bKeyChanged = true;
|
||||
|
||||
return TUSB_ERROR_NONE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TUSB_CFG_DEVICE_HID_MOUSE
|
||||
tusb_error_t tusbd_hid_mouse_send_report(hid_mouse_report_t *p_mouse_report)
|
||||
{
|
||||
// uint32_t start_time = systickGetSecondsActive();
|
||||
// while (bMouseChanged) // TODO Block while previous key hasn't been sent - can use fifo to improve this
|
||||
// {
|
||||
// ASSERT_MESSAGE(systickGetSecondsActive() - start_time < 5, ERR_FAILED, "HID Mouse Timeout");
|
||||
// }
|
||||
|
||||
if (bMouseChanged)
|
||||
{
|
||||
return TUSB_ERROR_FAILED;
|
||||
}
|
||||
|
||||
hid_mouse_report = *p_mouse_report;
|
||||
bMouseChanged = true;
|
||||
|
||||
return TUSB_ERROR_NONE;
|
||||
}
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// IMPLEMENTATION
|
||||
|
@ -56,8 +56,6 @@
|
||||
/** \defgroup Keyboard_Device Device
|
||||
* @{ */
|
||||
|
||||
//bool tusbd_hid_keyboard_is_configured(uint8_t coreid);
|
||||
|
||||
/** \brief Check if the interface is currently busy or not
|
||||
* \param[in] coreid USB Controller ID
|
||||
* \retval true if the interface is busy meaning the stack is still transferring/waiting data from/to host
|
||||
@ -82,6 +80,9 @@ tusb_error_t tusbd_hid_keyboard_send(uint8_t coreid, hid_keyboard_report_t const
|
||||
//--------------------------------------------------------------------+
|
||||
// APPLICATION CALLBACK API
|
||||
//--------------------------------------------------------------------+
|
||||
void tusbd_hid_keyboard_mounted_cb(uint8_t coreid);
|
||||
void tusbd_hid_keyboard_unmounted_cb(uint8_t coreid);
|
||||
|
||||
/** \brief Callback function that is invoked when an transferring event occurred
|
||||
* after invoking \ref tusbd_hid_keyboard_send
|
||||
* \param[in] coreid USB Controller ID
|
||||
@ -92,8 +93,9 @@ tusb_error_t tusbd_hid_keyboard_send(uint8_t coreid, hid_keyboard_report_t const
|
||||
* - TUSB_EVENT_XFER_STALLED : previously scheduled transfer is stalled by device.
|
||||
*/
|
||||
void tusbd_hid_keyboard_cb(uint8_t coreid, tusb_event_t event, uint32_t xferred_bytes);
|
||||
void tusbd_hid_keyboard_mounted_cb(uint8_t coreid);
|
||||
void tusbd_hid_keyboard_unmounted_cb(uint8_t coreid);
|
||||
|
||||
void tusbd_hid_keyboard_set_report_cb(uint8_t coreid, hid_request_report_type_t report_type, uint8_t report_data[]);
|
||||
void tusbd_hid_keyboard_get_report_cb(uint8_t coreid, hid_request_report_type_t report_type, void** pp_report);
|
||||
|
||||
/** @} */
|
||||
/** @} */
|
||||
@ -132,6 +134,10 @@ tusb_error_t tusbd_hid_mouse_send(uint8_t coreid, hid_mouse_report_t const *p_re
|
||||
//--------------------------------------------------------------------+
|
||||
// APPLICATION CALLBACK API
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
void tusbd_hid_mouse_mounted_cb(uint8_t coreid);
|
||||
void tusbd_hid_mouse_unmounted_cb(uint8_t coreid);
|
||||
|
||||
/** \brief Callback function that is invoked when an transferring event occurred
|
||||
* after invoking \ref tusbd_hid_mouse_send
|
||||
* \param[in] coreid USB Controller ID
|
||||
@ -142,8 +148,6 @@ tusb_error_t tusbd_hid_mouse_send(uint8_t coreid, hid_mouse_report_t const *p_re
|
||||
* - TUSB_EVENT_XFER_STALLED : previously scheduled transfer is stalled by device.
|
||||
*/
|
||||
void tusbd_hid_mouse_cb(uint8_t coreid, tusb_event_t event, uint32_t xferred_bytes);
|
||||
void tusbd_hid_mouse_mounted_cb(uint8_t coreid);
|
||||
void tusbd_hid_mouse_unmounted_cb(uint8_t coreid);
|
||||
|
||||
/** @} */
|
||||
/** @} */
|
||||
|
@ -212,6 +212,10 @@ enum {
|
||||
DESCRIPTOR_OFFSET_TYPE = 1
|
||||
};
|
||||
|
||||
enum {
|
||||
INTERFACE_INVALID_NUMBER = 0xff
|
||||
};
|
||||
|
||||
static inline uint8_t std_class_code_to_index(uint8_t std_class_code) ATTR_CONST ATTR_ALWAYS_INLINE;
|
||||
static inline uint8_t std_class_code_to_index(uint8_t std_class_code)
|
||||
{
|
||||
|
BIN
tools/simpleHIDwrite/SimpleHIDWrite.exe
Normal file
BIN
tools/simpleHIDwrite/SimpleHIDWrite.exe
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user