usbd_desc.c File Reference

USB descriptors. More...

#include "usbd_def.h"
#include "usbd_ctlreq.h"
#include "usbd_desc.h"
#include "os_port.h"
#include "cpu_endian.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define USBD_VENDOR_ID   0x0483
 
#define USBD_PRODUCT_ID   0x0123
 
#define USBD_DEVICE_REV   0x0100
 
#define USBD_MANUFACTURER_STR   "STMicroelectronics"
 
#define USBD_PRODUCT_STR   "STM32 RNDIS Demo"
 
#define USBD_SERIAL_NUMBER_STR   "00000000123C"
 
#define USBD_CONFIGURATION_STR   "RNDIS Configuration"
 
#define USBD_INTERFACE_STR   "RNDIS Interface"
 

Functions

uint8_t * usbdGetDeviceDescriptor (USBD_SpeedTypeDef speed, uint16_t *length)
 Retrieve device descriptor. More...
 
uint8_t * usbdGetLangIdStrDescriptor (USBD_SpeedTypeDef speed, uint16_t *length)
 Retrieve the languages supported by the device. More...
 
uint8_t * usbdGetManufacturerStrDescriptor (USBD_SpeedTypeDef speed, uint16_t *length)
 Retrieve the manufacturer string descriptor. More...
 
uint8_t * usbdGetProductStrDescriptor (USBD_SpeedTypeDef speed, uint16_t *length)
 Retrieve the product string descriptor. More...
 
uint8_t * usbdGetSerialStrDescriptor (USBD_SpeedTypeDef speed, uint16_t *length)
 Retrieve the serial number string descriptor. More...
 
uint8_t * usbdGetConfigStrDescriptor (USBD_SpeedTypeDef speed, uint16_t *length)
 Retrieve the configuration string descriptor. More...
 
uint8_t * usbdGetInterfaceStrDescriptor (USBD_SpeedTypeDef speed, uint16_t *length)
 Retrieve the interface string descriptor. More...
 

Variables

USBD_DescriptorsTypeDef usbdRndisDescriptors
 USB descriptors. More...
 
const UsbDeviceDescriptor usbdDeviceDescriptor
 USB device descriptor. More...
 
const UsbConfigDescriptors usbdConfigDescriptors
 USB configuration descriptors. More...
 

Detailed Description

USB descriptors.

License

Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneTCP Pro.

This software is provided under a commercial license. You may use this software under the conditions stated in the license terms. This source code cannot be redistributed.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
1.9.0

Definition in file usbd_desc.c.

Macro Definition Documentation

◆ USBD_CONFIGURATION_STR

#define USBD_CONFIGURATION_STR   "RNDIS Configuration"

Definition at line 38 of file usbd_desc.c.

◆ USBD_DEVICE_REV

#define USBD_DEVICE_REV   0x0100

Definition at line 32 of file usbd_desc.c.

◆ USBD_INTERFACE_STR

#define USBD_INTERFACE_STR   "RNDIS Interface"

Definition at line 39 of file usbd_desc.c.

◆ USBD_MANUFACTURER_STR

#define USBD_MANUFACTURER_STR   "STMicroelectronics"

Definition at line 35 of file usbd_desc.c.

◆ USBD_PRODUCT_ID

#define USBD_PRODUCT_ID   0x0123

Definition at line 30 of file usbd_desc.c.

◆ USBD_PRODUCT_STR

#define USBD_PRODUCT_STR   "STM32 RNDIS Demo"

Definition at line 36 of file usbd_desc.c.

◆ USBD_SERIAL_NUMBER_STR

#define USBD_SERIAL_NUMBER_STR   "00000000123C"

Definition at line 37 of file usbd_desc.c.

◆ USBD_VENDOR_ID

#define USBD_VENDOR_ID   0x0483

Definition at line 28 of file usbd_desc.c.

Function Documentation

◆ usbdGetConfigStrDescriptor()

uint8_t* usbdGetConfigStrDescriptor ( USBD_SpeedTypeDef  speed,
uint16_t *  length 
)

Retrieve the configuration string descriptor.

Parameters
[in]speedCurrent speed
[out]lengthLength of the string descriptor, in bytes
Returns
Pointer to the string descriptor

Definition at line 289 of file usbd_desc.c.

◆ usbdGetDeviceDescriptor()

uint8_t* usbdGetDeviceDescriptor ( USBD_SpeedTypeDef  speed,
uint16_t *  length 
)

Retrieve device descriptor.

Parameters
[in]speedCurrent speed
[out]lengthLength of the device descriptor, in bytes
Returns
Pointer to the device descriptor

Definition at line 199 of file usbd_desc.c.

◆ usbdGetInterfaceStrDescriptor()

uint8_t* usbdGetInterfaceStrDescriptor ( USBD_SpeedTypeDef  speed,
uint16_t *  length 
)

Retrieve the interface string descriptor.

Parameters
[in]speedCurrent speed
[out]lengthLength of the string descriptor, in bytes
Returns
Pointer to the string descriptor

Definition at line 305 of file usbd_desc.c.

◆ usbdGetLangIdStrDescriptor()

uint8_t* usbdGetLangIdStrDescriptor ( USBD_SpeedTypeDef  speed,
uint16_t *  length 
)

Retrieve the languages supported by the device.

Parameters
[in]speedCurrent speed
[out]lengthLength of the string descriptor, in bytes
Returns
Pointer to the string descriptor

Definition at line 215 of file usbd_desc.c.

◆ usbdGetManufacturerStrDescriptor()

uint8_t* usbdGetManufacturerStrDescriptor ( USBD_SpeedTypeDef  speed,
uint16_t *  length 
)

Retrieve the manufacturer string descriptor.

Parameters
[in]speedCurrent speed
[out]lengthLength of the string descriptor, in bytes
Returns
Pointer to the string descriptor

Definition at line 241 of file usbd_desc.c.

◆ usbdGetProductStrDescriptor()

uint8_t* usbdGetProductStrDescriptor ( USBD_SpeedTypeDef  speed,
uint16_t *  length 
)

Retrieve the product string descriptor.

Parameters
[in]speedCurrent speed
[out]lengthLength of the string descriptor, in bytes
Returns
Pointer to the string descriptor

Definition at line 257 of file usbd_desc.c.

◆ usbdGetSerialStrDescriptor()

uint8_t* usbdGetSerialStrDescriptor ( USBD_SpeedTypeDef  speed,
uint16_t *  length 
)

Retrieve the serial number string descriptor.

Parameters
[in]speedCurrent speed
[out]lengthLength of the string descriptor, in bytes
Returns
Pointer to the string descriptor

Definition at line 273 of file usbd_desc.c.

Variable Documentation

◆ usbdConfigDescriptors

const UsbConfigDescriptors usbdConfigDescriptors

USB configuration descriptors.

Definition at line 87 of file usbd_desc.c.

◆ usbdDeviceDescriptor

const UsbDeviceDescriptor usbdDeviceDescriptor
Initial value:
=
{
HTOLE16(0x0200),
1,
2,
3,
1
}
#define USB_DEVICE_CLASS_CDC
Definition: usbd_desc.h:64
#define USB_DEVICE_SUBCLASS_CDC
Definition: usbd_desc.h:66
#define USB_DESC_TYPE_DEVICE
Definition: usbd_desc.h:43
__start_packed struct @156 UsbDeviceDescriptor
Device descriptor.
#define USBD_VENDOR_ID
Definition: usbd_desc.c:28
#define USB_DEVICE_PROTOCOL_CDC
Definition: usbd_desc.h:68
#define USBD_PRODUCT_ID
Definition: usbd_desc.c:30
#define USBD_DEVICE_REV
Definition: usbd_desc.c:32
#define HTOLE16(value)
Definition: cpu_endian.h:400
#define USB_EP0_MAX_PACKET_SIZE
Definition: usbd_desc.h:37

USB device descriptor.

Definition at line 64 of file usbd_desc.c.

◆ usbdRndisDescriptors

USBD_DescriptorsTypeDef usbdRndisDescriptors
Initial value:
= {
}
uint8_t * usbdGetLangIdStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length)
Retrieve the languages supported by the device.
Definition: usbd_desc.c:215
uint8_t * usbdGetInterfaceStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length)
Retrieve the interface string descriptor.
Definition: usbd_desc.c:305
uint8_t * usbdGetConfigStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length)
Retrieve the configuration string descriptor.
Definition: usbd_desc.c:289
uint8_t * usbdGetManufacturerStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length)
Retrieve the manufacturer string descriptor.
Definition: usbd_desc.c:241
uint8_t * usbdGetDeviceDescriptor(USBD_SpeedTypeDef speed, uint16_t *length)
Retrieve device descriptor.
Definition: usbd_desc.c:199
uint8_t * usbdGetSerialStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length)
Retrieve the serial number string descriptor.
Definition: usbd_desc.c:273
uint8_t * usbdGetProductStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length)
Retrieve the product string descriptor.
Definition: usbd_desc.c:257

USB descriptors.

Definition at line 49 of file usbd_desc.c.