static stm32_usb_ep_t ep_cnfg[ENP_MAX_NUMB];
/* USB EP0 control descriptor */
-static const usb_endpoint_descriptor_t USB_CtrlEpDescr0 =
+static const UsbEndpointDesc USB_CtrlEpDescr0 =
{
.bLength = sizeof(USB_CtrlEpDescr0),
.bDescriptorType = USB_DT_ENDPOINT,
};
/* USB EP1 control descriptor */
-static const usb_endpoint_descriptor_t USB_CtrlEpDescr1 =
+static const UsbEndpointDesc USB_CtrlEpDescr1 =
{
.bLength = sizeof(USB_CtrlEpDescr1),
.bDescriptorType = USB_DT_ENDPOINT,
};
/* USB setup packet */
-static usb_ctrlrequest_t setup_packet;
+static UsbCtrlRequest setup_packet;
/* USB device controller: max supported interfaces */
#define USB_MAX_INTERFACE 1
{
uint8_t state;
uint32_t cfg_id;
- const usb_config_descriptor_t *cfg;
+ const UsbConfigDesc *cfg;
uint32_t interfaces;
uint32_t alt[USB_MAX_INTERFACE];
uint32_t address;
static stm32_udc_t udc;
/* Generic USB Device Controller structure */
-static struct usb_device *usb_dev;
+static UsbDevice *usb_dev;
/* USB packet memory management: list of allocated chunks */
static pack_mem_slot_t *pPacketMemUse;
}
/* Enable/Disable an endpoint */
-static int usb_ep_configure(const usb_endpoint_descriptor_t *epd, bool enable)
+static int usb_ep_configure(const UsbEndpointDesc *epd, bool enable)
{
int EP;
stm32_usb_ep_t *ep_hw;
ep_hw->flags = 0;
/* Set endpoint type */
- ep_hw->type = usb_endpoint_type(epd);
+ ep_hw->type = usb_endpointType(epd);
/* Init EP max packet size */
ep_hw->max_size = epd->wMaxPacketSize;
*/
static int usb_find_interface(uint32_t num, uint32_t alt)
{
- const usb_interface_descriptor_t *id;
+ const UsbInterfaceDesc *id;
int i;
for (i = 0; ; i++)
{
/* TODO: support more than one configuration per device */
- id = (const usb_interface_descriptor_t *)usb_dev->config[i];
+ id = (const UsbInterfaceDesc *)usb_dev->config[i];
if (id == NULL)
break;
if (id->bDescriptorType != USB_DT_INTERFACE)
static void
usb_configure_ep_interface(unsigned int num, unsigned int alt, bool enable)
{
- const usb_endpoint_descriptor_t *epd;
+ const UsbEndpointDesc *epd;
int i, start;
/*
*/
for (i = start + 1; ; i++)
{
- epd = (const usb_endpoint_descriptor_t *)usb_dev->config[i];
+ epd = (const UsbEndpointDesc *)usb_dev->config[i];
if ((epd == NULL) || (epd->bDescriptorType == USB_DT_INTERFACE))
break;
if (epd->bDescriptorType != USB_DT_ENDPOINT)
static int usb_get_configuration_descriptor(int id)
{
- const usb_config_descriptor_t **config =
- (const usb_config_descriptor_t **)usb_dev->config;
+ const UsbConfigDesc **config =
+ (const UsbConfigDesc **)usb_dev->config;
uint8_t *p = usb_cfg_buffer;
int i;
return -USB_BUF_OVERFLOW;
}
}
- ((usb_config_descriptor_t *)usb_cfg_buffer)->wTotalLength =
+ ((UsbConfigDesc *)usb_cfg_buffer)->wTotalLength =
usb_cpu_to_le16(p - usb_cfg_buffer);
__usb_ep_write(CTRL_ENP_IN,
usb_cfg_buffer,
static int usb_get_string_descriptor(unsigned int id)
{
- const usb_string_descriptor_t *lang_str;
+ const UsbStringDesc *lang_str;
unsigned int lang_id, str_id;
uint16_t w_index_lo = usb_le16_to_cpu(setup_packet.wIndex) & 0x00ff;
uint16_t w_index_hi = (usb_le16_to_cpu(setup_packet.wIndex) &
/* Find Language index */
for (lang_id = 0; ; lang_id++)
{
- const usb_string_descriptor_t *str =
+ const UsbStringDesc *str =
usb_dev->strings[lang_id];
if (UNLIKELY(str == NULL))
return -USB_NODEV_ERROR;
}
/* USB setup packet: class/vendor request handler */
-static void usb_event_handler(struct usb_device *dev)
+static void usb_event_handler(UsbDevice *dev)
{
/*
* TODO: get the appropriate usb_dev in function of the endpoint
ep_cnfg[CTRL_ENP_OUT].status = STALLED;
}
-static const usb_config_descriptor_t *usb_find_configuration(int num)
+static const UsbConfigDesc *usb_find_configuration(int num)
{
- const usb_config_descriptor_t *cfg;
+ const UsbConfigDesc *cfg;
int i;
for (i = 0; ; i++)
{
- cfg = (const usb_config_descriptor_t *)usb_dev->config[i];
+ cfg = (const UsbConfigDesc *)usb_dev->config[i];
if (cfg == NULL)
break;
if (cfg->bDescriptorType != USB_DT_CONFIG)
static int UsbSetConfigurationState(uint32_t Configuration)
{
- const usb_config_descriptor_t *pCnfg;
+ const UsbConfigDesc *pCnfg;
unsigned int i;
if (Configuration)
}
/* Register an upper layer USB device into the driver */
-int usb_device_register(struct usb_device *dev)
+int usb_device_register(UsbDevice *dev)
{
#if CONFIG_KERN
MOD_CHECK(proc);
*
* It matches the different fields of the USB 2.0 spec. section 9.3, table 9-2.
*/
-typedef struct usb_ctrlrequest
+typedef struct UsbCtrlRequest
{
uint8_t mRequestType;
uint8_t bRequest;
uint16_t wValue;
uint16_t wIndex;
uint16_t wLength;
-} PACKED usb_ctrlrequest_t;
+} PACKED UsbCtrlRequest;
/* All standard descriptors have these 2 fields at the beginning */
-typedef struct usb_descriptor_header
+typedef struct UsbDescHeader
{
uint8_t bLength;
uint8_t bDescriptorType;
-} PACKED usb_descriptor_header_t;
+} PACKED UsbDescHeader;
/* Device descriptor */
-typedef struct usb_device_descriptor
+typedef struct UsbDeviceDesc
{
uint8_t bLength;
uint8_t bDescriptorType;
uint8_t iProduct;
uint8_t iSerialNumber;
uint8_t bNumConfigurations;
-} PACKED usb_device_descriptor_t;
+} PACKED UsbDeviceDesc;
/* USB string descriptor */
-typedef struct usb_string_descriptor
+typedef struct UsbStringDesc
{
uint8_t bLength;
uint8_t bDescriptorType;
uint8_t data[0];
-} PACKED usb_string_descriptor_t;
+} PACKED UsbStringDesc;
/*
* Macros to define USB strings
#define DEFINE_USB_STRING(__name, __text) \
struct { \
- usb_descriptor_header_t __header; \
+ UsbDescHeader __header; \
uint8_t __body[sizeof(__text)]; \
} PACKED __name = { \
.__header = { \
#define USB_CDC_SUBCLASS_NCM 0x0d
/* Device configuration descriptor */
-typedef struct usb_config_descriptor
+typedef struct UsbConfigDesc
{
uint8_t bLength;
uint8_t bDescriptorType;
uint8_t iConfiguration;
uint8_t bmAttributes;
uint8_t bMaxPower;
-} PACKED usb_config_descriptor_t;
+} PACKED UsbConfigDesc;
/* from config descriptor bmAttributes */
#define USB_CONFIG_ATT_ONE (1 << 7) /* must be set */
#define USB_CONFIG_ATT_BATTERY (1 << 4) /* battery powered */
/* Device interface descriptor */
-typedef struct usb_interface_descriptor
+typedef struct UsbInterfaceDesc
{
uint8_t bLength;
uint8_t bDescriptorType;
uint8_t bInterfaceSubClass;
uint8_t bInterfaceProtocol;
uint8_t iInterface;
-} PACKED usb_interface_descriptor_t;
+} PACKED UsbInterfaceDesc;
/* Endpoint descriptor */
-typedef struct usb_endpoint_descriptor
+typedef struct UsbEndpointDesc
{
uint8_t bLength;
uint8_t bDescriptorType;
uint8_t bmAttributes;
uint16_t wMaxPacketSize;
uint8_t bInterval;
-} PACKED usb_endpoint_descriptor_t;
+} PACKED UsbEndpointDesc;
/*
* Endpoints
#define USB_ENDPOINT_MAX_ADJUSTABLE 0x80
/* USB: generic device descriptor */
-struct usb_device
+typedef struct UsbDevice
{
- usb_device_descriptor_t *device;
- const usb_descriptor_header_t **config;
- const usb_string_descriptor_t **strings;
+ UsbDeviceDesc *device;
+ const UsbDescHeader **config;
+ const UsbStringDesc **strings;
/* Callbacks */
- void (*event_cb)(usb_ctrlrequest_t *);
+ void (*event_cb)(UsbCtrlRequest *);
/* Private data */
bool configured;
-};
+} UsbDevice;
/*
- * usb_endpoint_num - get the endpoint's number
+ * usb_endpointNum - get the endpoint's number
*/
-INLINE int usb_endpoint_num(const usb_endpoint_descriptor_t *epd)
+INLINE int usb_endpointNum(const UsbEndpointDesc *epd)
{
return epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
}
/*
- * usb_endpoint_type - get the endpoint's transfer type
+ * usb_endpointType - get the endpoint's transfer type
*/
-INLINE int usb_endpoint_type(const struct usb_endpoint_descriptor *epd)
+INLINE int usb_endpointType(const struct UsbEndpointDesc *epd)
{
return epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK;
}
/*
- * usb_endpoint_dir_in - check if the endpoint has IN direction
+ * usb_endpointDirIn - check if the endpoint has IN direction
*/
-INLINE int usb_endpoint_dir_in(const struct usb_endpoint_descriptor *epd)
+INLINE int usb_endpointDirIn(const struct UsbEndpointDesc *epd)
{
return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN);
}
/*
- * usb_endpoint_dir_out - check if the endpoint has OUT direction
+ * usb_endpointDirOut - check if the endpoint has OUT direction
*/
-INLINE int usb_endpoint_dir_out(const struct usb_endpoint_descriptor *epd)
+INLINE int usb_endpointDirOut(const struct UsbEndpointDesc *epd)
{
return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT);
}
/*
- * usb_endpoint_xfer_bulk - check if the endpoint has bulk transfer type
+ * usb_endpointXferBulk - check if the endpoint has bulk transfer type
*/
-INLINE int usb_endpoint_xfer_bulk(const struct usb_endpoint_descriptor *epd)
+INLINE int usb_endpointXferBulk(const struct UsbEndpointDesc *epd)
{
return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
USB_ENDPOINT_XFER_BULK);
}
/*
- * usb_endpoint_xfer_control - check if the endpoint has control transfer type
+ * usb_endpointXferControl - check if the endpoint has control transfer type
*/
-INLINE int usb_endpoint_xfer_control(const struct usb_endpoint_descriptor *epd)
+INLINE int usb_endpointXferControl(const struct UsbEndpointDesc *epd)
{
return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
USB_ENDPOINT_XFER_CONTROL);
}
/*
- * usb_endpoint_xfer_int - check if the endpoint has interrupt transfer type
+ * usb_endpointXferInt - check if the endpoint has interrupt transfer type
*/
-INLINE int usb_endpoint_xfer_int(const struct usb_endpoint_descriptor *epd)
+INLINE int usb_endpointXferInt(const struct UsbEndpointDesc *epd)
{
return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
USB_ENDPOINT_XFER_INT);
}
/*
- * usb_endpoint_xfer_isoc - check if the endpoint has isochronous transfer type
+ * usb_endpointXferIsoc - check if the endpoint has isochronous transfer type
*/
-INLINE int usb_endpoint_xfer_isoc(const struct usb_endpoint_descriptor *epd)
+INLINE int usb_endpointXferIsoc(const struct UsbEndpointDesc *epd)
{
return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
USB_ENDPOINT_XFER_ISOC);
}
/*
- * usb_endpoint_is_bulk_in - check if the endpoint is bulk IN
+ * usb_endpointIsBulkIn - check if the endpoint is bulk IN
*/
-INLINE int usb_endpoint_is_bulk_in(const struct usb_endpoint_descriptor *epd)
+INLINE int usb_endpointIsBulkIn(const struct UsbEndpointDesc *epd)
{
- return usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_in(epd);
+ return usb_endpointXferBulk(epd) && usb_endpointDirIn(epd);
}
/*
- * usb_endpoint_is_bulk_out - check if the endpoint is bulk OUT
+ * usb_endpointIsBulkOut - check if the endpoint is bulk OUT
*/
-INLINE int usb_endpoint_is_bulk_out(const struct usb_endpoint_descriptor *epd)
+INLINE int usb_endpointIsBulkOut(const struct UsbEndpointDesc *epd)
{
- return usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_out(epd);
+ return usb_endpointXferBulk(epd) && usb_endpointDirOut(epd);
}
/*
- * usb_endpoint_is_int_in - check if the endpoint is interrupt IN
+ * usb_endpointIsIntIn - check if the endpoint is interrupt IN
*/
-INLINE int usb_endpoint_is_int_in(const struct usb_endpoint_descriptor *epd)
+INLINE int usb_endpointIsIntIn(const struct UsbEndpointDesc *epd)
{
- return usb_endpoint_xfer_int(epd) && usb_endpoint_dir_in(epd);
+ return usb_endpointXferInt(epd) && usb_endpointDirIn(epd);
}
/*
- * usb_endpoint_is_int_out - check if the endpoint is interrupt OUT
+ * usb_endpointIsIntOut - check if the endpoint is interrupt OUT
*/
-INLINE int usb_endpoint_is_int_out(const struct usb_endpoint_descriptor *epd)
+INLINE int usb_endpointIsIntOut(const struct UsbEndpointDesc *epd)
{
- return usb_endpoint_xfer_int(epd) && usb_endpoint_dir_out(epd);
+ return usb_endpointXferInt(epd) && usb_endpointDirOut(epd);
}
/*
- * usb_endpoint_is_isoc_in - check if the endpoint is isochronous IN
+ * usb_endpointIsIsocIn - check if the endpoint is isochronous IN
*/
-INLINE int usb_endpoint_is_isoc_in(const struct usb_endpoint_descriptor *epd)
+INLINE int usb_endpointIsIsocIn(const struct UsbEndpointDesc *epd)
{
- return usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_in(epd);
+ return usb_endpointXferIsoc(epd) && usb_endpointDirIn(epd);
}
/*
- * usb_endpoint_is_isoc_out - check if the endpoint is isochronous OUT
+ * usb_endpointIsIsocOut - check if the endpoint is isochronous OUT
*/
-INLINE int usb_endpoint_is_isoc_out(const struct usb_endpoint_descriptor *epd)
+INLINE int usb_endpointIsIsocOut(const struct UsbEndpointDesc *epd)
{
- return usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd);
+ return usb_endpointXferIsoc(epd) && usb_endpointDirOut(epd);
}
/*
/*
* usb_device_register - register a generic USB device driver
*/
-int usb_device_register(struct usb_device *dev);
+int usb_device_register(UsbDevice *dev);
#endif /* USB_H */
#define USB_HID_REPORT_EP (USB_DIR_IN | 1)
-static usb_device_descriptor_t usb_hid_device_descriptor =
+static UsbDeviceDesc usb_hid_device_descriptor =
{
.bLength = sizeof(usb_hid_device_descriptor),
.bDescriptorType = USB_DT_DEVICE,
.bNumConfigurations = 1,
};
-static const usb_config_descriptor_t usb_hid_config_descriptor =
+static const UsbConfigDesc usb_hid_config_descriptor =
{
.bLength = sizeof(usb_hid_config_descriptor),
.bDescriptorType = USB_DT_CONFIG,
.bMaxPower = 50, /* 100 mA */
};
-static const usb_interface_descriptor_t usb_hid_interface_descriptor =
+static const UsbInterfaceDesc usb_hid_interface_descriptor =
{
.bLength = sizeof(usb_hid_interface_descriptor),
.bDescriptorType = USB_DT_INTERFACE,
.wDescriptorLength = usb_cpu_to_le16(sizeof(hid_report_descriptor)),
};
-static const usb_endpoint_descriptor_t usb_hid_ep_descriptor =
+static const UsbEndpointDesc usb_hid_ep_descriptor =
{
.bLength = sizeof(usb_hid_ep_descriptor),
.bDescriptorType = USB_DT_ENDPOINT,
.bInterval = 10, /* resolution in ms */
};
-static const usb_descriptor_header_t *usb_hid_config[] =
+static const UsbDescHeader *usb_hid_config[] =
{
- (const usb_descriptor_header_t *)&usb_hid_config_descriptor,
- (const usb_descriptor_header_t *)&usb_hid_interface_descriptor,
- (const usb_descriptor_header_t *)&usb_hid_descriptor,
- (const usb_descriptor_header_t *)&usb_hid_ep_descriptor,
+ (const UsbDescHeader *)&usb_hid_config_descriptor,
+ (const UsbDescHeader *)&usb_hid_interface_descriptor,
+ (const UsbDescHeader *)&usb_hid_descriptor,
+ (const UsbDescHeader *)&usb_hid_ep_descriptor,
NULL,
};
USB_STRING("U", "S", "B", " ",
"K", "e", "y", "b", "o", "a", "r", "d"));
-static const usb_string_descriptor_t *usb_hid_strings[] =
+static const UsbStringDesc *usb_hid_strings[] =
{
- (usb_string_descriptor_t *)&language_str,
- (usb_string_descriptor_t *)&manufacturer_str,
- (usb_string_descriptor_t *)&product_str,
+ (UsbStringDesc *)&language_str,
+ (UsbStringDesc *)&manufacturer_str,
+ (UsbStringDesc *)&product_str,
NULL,
};
static bool hid_keyboard_configured;
-static void usb_hid_event_cb(usb_ctrlrequest_t *ctrl)
+static void usb_hid_event_cb(UsbCtrlRequest *ctrl)
{
uint16_t value = usb_le16_to_cpu(ctrl->wValue);
uint16_t index = usb_le16_to_cpu(ctrl->wIndex);
}
/* Global usb-keyboard descriptor that identifies the usb-keyboard device */
-static struct usb_device usb_keyboard = {
+static UsbDevice usb_keyboard = {
.device = &usb_hid_device_descriptor,
.config = usb_hid_config,
.strings = usb_hid_strings,
#define USB_HID_REPORT_EP (USB_DIR_IN | 1)
-static usb_device_descriptor_t usb_hid_device_descriptor =
+static UsbDeviceDesc usb_hid_device_descriptor =
{
.bLength = sizeof(usb_hid_device_descriptor),
.bDescriptorType = USB_DT_DEVICE,
.bNumConfigurations = 1,
};
-static const usb_config_descriptor_t usb_hid_config_descriptor =
+static const UsbConfigDesc usb_hid_config_descriptor =
{
.bLength = sizeof(usb_hid_config_descriptor),
.bDescriptorType = USB_DT_CONFIG,
.bMaxPower = 50, /* 100 mA */
};
-static const usb_interface_descriptor_t usb_hid_interface_descriptor =
+static const UsbInterfaceDesc usb_hid_interface_descriptor =
{
.bLength = sizeof(usb_hid_interface_descriptor),
.bDescriptorType = USB_DT_INTERFACE,
.wDescriptorLength = usb_cpu_to_le16(sizeof(hid_report_descriptor)),
};
-static const usb_endpoint_descriptor_t usb_hid_ep_descriptor =
+static const UsbEndpointDesc usb_hid_ep_descriptor =
{
.bLength = sizeof(usb_hid_ep_descriptor),
.bDescriptorType = USB_DT_ENDPOINT,
.bInterval = 10, /* resolution in ms */
};
-static const usb_descriptor_header_t *usb_hid_config[] =
+static const UsbDescHeader *usb_hid_config[] =
{
- (const usb_descriptor_header_t *)&usb_hid_config_descriptor,
- (const usb_descriptor_header_t *)&usb_hid_interface_descriptor,
- (const usb_descriptor_header_t *)&usb_hid_descriptor,
- (const usb_descriptor_header_t *)&usb_hid_ep_descriptor,
+ (const UsbDescHeader *)&usb_hid_config_descriptor,
+ (const UsbDescHeader *)&usb_hid_interface_descriptor,
+ (const UsbDescHeader *)&usb_hid_descriptor,
+ (const UsbDescHeader *)&usb_hid_ep_descriptor,
NULL,
};
static DEFINE_USB_STRING(product_str,
USB_STRING("U", "S", "B", " ", "M", "o", "u", "s", "e"));
-static const usb_string_descriptor_t *usb_hid_strings[] =
+static const UsbStringDesc *usb_hid_strings[] =
{
- (usb_string_descriptor_t *)&language_str,
- (usb_string_descriptor_t *)&manufacturer_str,
- (usb_string_descriptor_t *)&product_str,
+ (UsbStringDesc *)&language_str,
+ (UsbStringDesc *)&manufacturer_str,
+ (UsbStringDesc *)&product_str,
NULL,
};
static bool hid_mouse_configured;
-static void usb_hid_event_cb(usb_ctrlrequest_t *ctrl)
+static void usb_hid_event_cb(UsbCtrlRequest *ctrl)
{
uint16_t value = usb_le16_to_cpu(ctrl->wValue);
uint16_t index = usb_le16_to_cpu(ctrl->wIndex);
}
/* Global usb-mouse descriptor that identifies the usb-mouse device */
-static struct usb_device usb_mouse = {
+static UsbDevice usb_mouse = {
.device = &usb_hid_device_descriptor,
.config = usb_hid_config,
.strings = usb_hid_strings,
#define USB_STRING_PRODUCT 2
#define USB_STRING_SERIAL 3
-static usb_device_descriptor_t usb_serial_device_descriptor =
+static UsbDeviceDesc usb_serial_device_descriptor =
{
.bLength = sizeof(usb_serial_device_descriptor),
.bDescriptorType = USB_DT_DEVICE,
.bNumConfigurations = 1,
};
-static const usb_config_descriptor_t usb_serial_config_descriptor =
+static const UsbConfigDesc usb_serial_config_descriptor =
{
.bLength = sizeof(usb_serial_config_descriptor),
.bDescriptorType = USB_DT_CONFIG,
.bMaxPower = 50, /* 100 mA */
};
-static const usb_interface_descriptor_t usb_serial_interface_descriptor =
+static const UsbInterfaceDesc usb_serial_interface_descriptor =
{
.bLength = sizeof(usb_serial_interface_descriptor),
.bDescriptorType = USB_DT_INTERFACE,
.iInterface = 0,
};
-static const usb_endpoint_descriptor_t usb_serial_ep_report_descriptor =
+static const UsbEndpointDesc usb_serial_ep_report_descriptor =
{
.bLength = sizeof(usb_serial_ep_report_descriptor),
.bDescriptorType = USB_DT_ENDPOINT,
.bInterval = 1,
};
-static const usb_endpoint_descriptor_t usb_serial_ep_in_descriptor =
+static const UsbEndpointDesc usb_serial_ep_in_descriptor =
{
.bLength = sizeof(usb_serial_ep_in_descriptor),
.bDescriptorType = USB_DT_ENDPOINT,
.bInterval = 0,
};
-static const usb_endpoint_descriptor_t usb_serial_ep_out_descriptor =
+static const UsbEndpointDesc usb_serial_ep_out_descriptor =
{
.bLength = sizeof(usb_serial_ep_in_descriptor),
.bDescriptorType = USB_DT_ENDPOINT,
.bInterval = 0,
};
-static const usb_descriptor_header_t *usb_serial_config[] =
+static const UsbDescHeader *usb_serial_config[] =
{
- (const usb_descriptor_header_t *)&usb_serial_config_descriptor,
- (const usb_descriptor_header_t *)&usb_serial_interface_descriptor,
- (const usb_descriptor_header_t *)&usb_serial_ep_report_descriptor,
- (const usb_descriptor_header_t *)&usb_serial_ep_in_descriptor,
- (const usb_descriptor_header_t *)&usb_serial_ep_out_descriptor,
+ (const UsbDescHeader *)&usb_serial_config_descriptor,
+ (const UsbDescHeader *)&usb_serial_interface_descriptor,
+ (const UsbDescHeader *)&usb_serial_ep_report_descriptor,
+ (const UsbDescHeader *)&usb_serial_ep_in_descriptor,
+ (const UsbDescHeader *)&usb_serial_ep_out_descriptor,
NULL,
};
static DEFINE_USB_STRING(serial_str,
USB_STRING("0", "0", "1"));
-static const usb_string_descriptor_t *usb_serial_strings[] =
+static const UsbStringDesc *usb_serial_strings[] =
{
- (usb_string_descriptor_t *)&language_str,
- (usb_string_descriptor_t *)&manufacturer_str,
- (usb_string_descriptor_t *)&product_str,
- (usb_string_descriptor_t *)&serial_str,
+ (UsbStringDesc *)&language_str,
+ (UsbStringDesc *)&manufacturer_str,
+ (UsbStringDesc *)&product_str,
+ (UsbStringDesc *)&serial_str,
NULL,
};
/* Global usb-serial descriptor that identifies the usb-serial device */
-static struct usb_device usb_serial = {
+static UsbDevice usb_serial = {
.device = &usb_serial_device_descriptor,
.config = usb_serial_config,
.strings = usb_serial_strings,