From 904f3f1c4697dac22bcb5646f6729c519d377c3e Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 9 Jul 2017 04:35:39 +0200 Subject: usbconfig.h for CDC-ACM --- vusb-led/usbconfig.h | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/vusb-led/usbconfig.h b/vusb-led/usbconfig.h index 00f89d2..a54a189 100644 --- a/vusb-led/usbconfig.h +++ b/vusb-led/usbconfig.h @@ -17,7 +17,11 @@ #define USB_CFG_DPLUS_BIT 4 #define USB_CFG_CLOCK_KHZ (F_CPU/1000) +#if USB_CFG_CLOCK_KHZ==18000 +#define USB_CFG_CHECK_CRC 1 +#else #define USB_CFG_CHECK_CRC 0 +#endif /* ----------------------- Optional Hardware Config ------------------------ */ @@ -26,19 +30,19 @@ /* --------------------------- Functional Range ---------------------------- */ -#define USB_CFG_HAVE_INTRIN_ENDPOINT 0 -#define USB_CFG_HAVE_INTRIN_ENDPOINT3 0 +#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 #define USB_CFG_EP3_NUMBER 3 /* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ #define USB_CFG_IMPLEMENT_HALT 0 #define USB_CFG_SUPPRESS_INTR_CODE 0 -#define USB_CFG_INTR_POLL_INTERVAL 10 +#define USB_CFG_INTR_POLL_INTERVAL 255 #define USB_CFG_IS_SELF_POWERED 0 #define USB_CFG_MAX_BUS_POWER 100 -#define USB_CFG_IMPLEMENT_FN_WRITE 0 -#define USB_CFG_IMPLEMENT_FN_READ 0 -#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 -#define USB_CFG_HAVE_FLOWCONTROL 0 +#define USB_CFG_IMPLEMENT_FN_WRITE 1 +#define USB_CFG_IMPLEMENT_FN_READ 1 +#define USB_CFG_IMPLEMENT_FN_WRITEOUT 1 +#define USB_CFG_HAVE_FLOWCONTROL 1 #define USB_CFG_DRIVER_FLASH_PAGE 0 #define USB_CFG_LONG_TRANSFERS 0 /* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ @@ -54,13 +58,18 @@ * #define USB_SOF_HOOK myAssemblerMacro */ #define USB_CFG_CHECK_DATA_TOGGLING 0 +#if USB_CFG_CLOCK_KHZ==16500 || USB_CFG_CLOCK_KHZ==12800 +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 1 +#include "osccal.h" +#else #define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 +#endif #define USB_USE_FAST_CRC 0 /* -------------------------- Device Description --------------------------- */ #define USB_CFG_VENDOR_ID 0xc0, 0x16 /* = 0x16c0 = 5824 = voti.nl */ -#define USB_CFG_DEVICE_ID 0xdc, 0x05 /* = 0x05dc = 1500 */ +#define USB_CFG_DEVICE_ID 0xe1, 0x05 /* = 0x05e1 = 1505 */ #define USB_CFG_DEVICE_VERSION 0x00, 0x01 #define USB_CFG_VENDOR_NAME 'o', 'b', 'd', 'e', 'v', '.', 'a', 't' #define USB_CFG_VENDOR_NAME_LEN 8 @@ -68,18 +77,18 @@ #define USB_CFG_DEVICE_NAME_LEN 8 /*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ /*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ -#define USB_CFG_DEVICE_CLASS 0xff /* set to 0 if deferred to interface */ +#define USB_CFG_DEVICE_CLASS 2 /* set to 0 if deferred to interface */ #define USB_CFG_DEVICE_SUBCLASS 0 -#define USB_CFG_INTERFACE_CLASS 0 /* define class here if not at device level */ -#define USB_CFG_INTERFACE_SUBCLASS 0 -#define USB_CFG_INTERFACE_PROTOCOL 0 +#define USB_CFG_INTERFACE_CLASS 2 /* CDC class */ +#define USB_CFG_INTERFACE_SUBCLASS 2 /* Abstract (Modem) */ +#define USB_CFG_INTERFACE_PROTOCOL 1 /* AT-Commands */ /* #define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 42 */ /* #define USB_PUBLIC static */ /* ------------------- Fine Control over USB Descriptors ------------------- */ #define USB_CFG_DESCR_PROPS_DEVICE 0 -#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 +#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC #define USB_CFG_DESCR_PROPS_STRINGS 0 #define USB_CFG_DESCR_PROPS_STRING_0 0 #define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 -- cgit v1.2.3