#include "conf_usb.h"
#include "usb_protocol.h"
#include "udc_desc.h"
#include "udi_device_conf.h"
#include "udi_hid_kbd.h"
#include "udi_cdc.h"
COMPILER_WORD_ALIGNED
UDC_DESC_STORAGE usb_dev_desc_t udc_device_desc = {.bLength = sizeof(usb_dev_desc_t),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = LE16(USB_V2_0),
.bDeviceClass = DEVICE_CLASS,
.bDeviceSubClass = DEVICE_SUBCLASS,
.bDeviceProtocol = DEVICE_PROTOCOL,
.bMaxPacketSize0 = USB_DEVICE_EP_CTRL_SIZE,
.idVendor = LE16(USB_DEVICE_VENDOR_ID),
.idProduct = LE16(USB_DEVICE_PRODUCT_ID),
.bcdDevice = LE16(USB_DEVICE_VERSION),
#ifdef USB_DEVICE_MANUFACTURE_NAME
.iManufacturer = 1,
#else
.iManufacturer = 0, #endif
#ifdef USB_DEVICE_PRODUCT_NAME
.iProduct = 2,
#else
.iProduct = 0, #endif
#if (defined USB_DEVICE_SERIAL_NAME || defined USB_DEVICE_GET_SERIAL_NAME_POINTER)
.iSerialNumber = 3,
#else
.iSerialNumber = 0, #endif
.bNumConfigurations = 1};
#if 0#endif
COMPILER_WORD_ALIGNED
UDC_DESC_STORAGE udc_desc_t udc_desc = {
.conf.bLength = sizeof(usb_conf_desc_t),
.conf.bDescriptorType = USB_DT_CONFIGURATION,
.conf.wTotalLength = LE16(sizeof(udc_desc_t)),
.conf.bNumInterfaces = USB_DEVICE_NB_INTERFACE,
.conf.bConfigurationValue = 1,
.conf.iConfiguration = 0,
.conf.bmAttributes = USB_DEVICE_ATTR,
.conf.bMaxPower = USB_CONFIG_MAX_POWER(USB_DEVICE_POWER),
.hid_kbd = UDI_HID_KBD_DESC,
#ifdef RAW_ENABLE
.hid_raw = UDI_HID_RAW_DESC,
#endif
#ifdef MOUSE_ENABLE
.hid_mou = UDI_HID_MOU_DESC,
#endif
#ifdef EXTRAKEY_ENABLE
.hid_exk = UDI_HID_EXK_DESC,
#endif
#ifdef CONSOLE_ENABLE
.hid_con = UDI_HID_CON_DESC,
#endif
#ifdef NKRO_ENABLE
.hid_nkro = UDI_HID_NKRO_DESC,
#endif
#ifdef VIRTSER_ENABLE
.cdc_serial = CDC_DESCRIPTOR,
#endif
};
UDC_DESC_STORAGE udi_api_t *udi_apis[USB_DEVICE_NB_INTERFACE] = {
&udi_api_hid_kbd,
#ifdef RAW_ENABLE
&udi_api_hid_raw,
#endif
#ifdef MOUSE_ENABLE
&udi_api_hid_mou,
#endif
#ifdef EXTRAKEY_ENABLE
&udi_api_hid_exk,
#endif
#ifdef CONSOLE_ENABLE
&udi_api_hid_con,
#endif
#ifdef NKRO_ENABLE
&udi_api_hid_nkro,
#endif
#ifdef VIRTSER_ENABLE
&udi_api_cdc_comm, &udi_api_cdc_data,
#endif
};
UDC_DESC_STORAGE udc_config_speed_t udc_config_fshs[1] = {{
.desc = (usb_conf_desc_t UDC_DESC_STORAGE *)&udc_desc,
.udi_apis = udi_apis,
}};
UDC_DESC_STORAGE udc_config_t udc_config = {
.confdev_lsfs = &udc_device_desc,
.conf_lsfs = udc_config_fshs,
};