mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-14 04:18:56 +00:00
start to add hid keyboard
This commit is contained in:
parent
54e5289b73
commit
545fe61828
@ -42,9 +42,10 @@
|
||||
<option id="com.crt.advproject.c.misc.dialect.995251213" name="C Dialect" superClass="com.crt.advproject.c.misc.dialect" value="com.crt.advproject.misc.dialect.gnu99" valueType="enumerated"/>
|
||||
<option id="gnu.c.compiler.option.include.paths.1054321122" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/CMSISv2p10_LPC13Uxx/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/device_keyboard}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/tinyusb}""/>
|
||||
</option>
|
||||
<option id="gnu.c.compiler.option.include.files.141853359" name="Include files (-include)" superClass="gnu.c.compiler.option.include.files" valueType="includeFiles"/>
|
||||
<option id="gnu.c.compiler.option.include.files.141853359" name="Include files (-include)" superClass="gnu.c.compiler.option.include.files"/>
|
||||
<inputType id="com.crt.advproject.compiler.input.677402070" superClass="com.crt.advproject.compiler.input"/>
|
||||
</tool>
|
||||
<tool id="com.crt.advproject.gas.lib.debug.111062522" name="MCU Assembler" superClass="com.crt.advproject.gas.lib.debug">
|
||||
@ -56,6 +57,9 @@
|
||||
<tool id="com.crt.advproject.ar.lib.debug.682211634" name="MCU Archiver" superClass="com.crt.advproject.ar.lib.debug"/>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry excluding="usbd.c|usb_cdc.c|demos" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
@ -448,6 +452,9 @@
|
||||
<tool id="com.crt.advproject.ar.lib.release.1924635296" name="MCU Archiver" superClass="com.crt.advproject.ar.lib.release"/>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry excluding="usbd.c|usb_cdc.c|demos" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
|
@ -37,7 +37,7 @@
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/CMSISv2p10_LPC13Uxx/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/tinyusb/tinyusb}""/>
|
||||
</option>
|
||||
<option id="gnu.c.compiler.option.include.files.318820756" name="Include files (-include)" superClass="gnu.c.compiler.option.include.files" valueType="includeFiles"/>
|
||||
<option id="gnu.c.compiler.option.include.files.318820756" name="Include files (-include)" superClass="gnu.c.compiler.option.include.files"/>
|
||||
<inputType id="com.crt.advproject.compiler.input.932601394" superClass="com.crt.advproject.compiler.input"/>
|
||||
</tool>
|
||||
<tool id="com.crt.advproject.gas.exe.debug.1050918013" name="MCU Assembler" superClass="com.crt.advproject.gas.exe.debug">
|
||||
@ -65,6 +65,7 @@
|
||||
<listOptionValue builtIn="false" value="CMSISv2p10_LPC13Uxx"/>
|
||||
<listOptionValue builtIn="false" value="tinyusb"/>
|
||||
</option>
|
||||
<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)"/>
|
||||
@ -72,6 +73,9 @@
|
||||
</tool>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
@ -472,6 +476,9 @@
|
||||
</tool>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
|
@ -43,6 +43,9 @@
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "arch/arch.h"
|
||||
#include "compiler/compiler.h"
|
||||
#include "errors.h"
|
||||
|
@ -36,8 +36,11 @@
|
||||
*/
|
||||
|
||||
#include "dcd.h"
|
||||
#include "romdriver/power_api.h"
|
||||
#define USBD_API ((*(ROM **)(0x1FFF1FF8))->pUSBD) // TODO HAL
|
||||
|
||||
// TODO refractor later
|
||||
#include "descriptors.h"
|
||||
|
||||
|
||||
|
||||
void dcd_init()
|
||||
{
|
||||
@ -55,11 +58,11 @@ void dcd_init()
|
||||
|
||||
USB_CORE_DESCS_T DeviceDes =
|
||||
{
|
||||
// .device_desc = (uint8_t*) &USB_DeviceDescriptor,
|
||||
// .string_desc = (uint8_t*) &USB_StringDescriptor,
|
||||
// .full_speed_desc = (uint8_t*) &USB_FsConfigDescriptor,
|
||||
// .high_speed_desc = (uint8_t*) &USB_FsConfigDescriptor,
|
||||
// .device_qualifier = NULL
|
||||
.device_desc = (uint8_t*) &USB_DeviceDescriptor,
|
||||
.string_desc = (uint8_t*) &USB_StringDescriptor,
|
||||
.full_speed_desc = (uint8_t*) &USB_FsConfigDescriptor,
|
||||
.high_speed_desc = (uint8_t*) &USB_FsConfigDescriptor,
|
||||
.device_qualifier = NULL
|
||||
};
|
||||
|
||||
USBD_HANDLE_T g_hUsb;
|
||||
|
@ -43,9 +43,12 @@
|
||||
#endif
|
||||
|
||||
#include "tusb_cfg.h"
|
||||
#include "common/common.h"
|
||||
|
||||
#ifdef DEVICE_ROMDRIVER
|
||||
#include "romdriver/mw_usbd_rom_api.h"
|
||||
#include "romdriver/power_api.h"
|
||||
#define USBD_API ((*(ROM **)(0x1FFF1FF8))->pUSBD) // TODO HAL
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -46,7 +46,11 @@
|
||||
#include "tusb_cfg.h"
|
||||
|
||||
#ifdef CFG_TUSB_DEVICE
|
||||
#include "device/dcd.h"
|
||||
#include "device/dcd.h"
|
||||
#endif
|
||||
|
||||
#if CLASS_HID
|
||||
#include "class/hid.h"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -47,6 +47,11 @@
|
||||
#define CFG_TUSB_HOST
|
||||
#define CFG_TUSB_DEVICE
|
||||
|
||||
#define CFG_USB_HID_KEYBOARD
|
||||
|
||||
#define CLASS_HID (defined CFG_USB_HID_KEYBOARD)
|
||||
|
||||
|
||||
// TODO APP
|
||||
#define USB_MAX_IF_NUM 8
|
||||
#define USB_MAX_EP_NUM 5
|
||||
|
Loading…
x
Reference in New Issue
Block a user