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

SPDX-License-Identifier: GPL-2.0-or-later

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

This file is part of CycloneTCP Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

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

Definition in file usbd_desc.c.

Macro Definition Documentation

◆ USBD_CONFIGURATION_STR

#define USBD_CONFIGURATION_STR   "RNDIS Configuration"

Definition at line 50 of file usbd_desc.c.

◆ USBD_DEVICE_REV

#define USBD_DEVICE_REV   0x0100

Definition at line 44 of file usbd_desc.c.

◆ USBD_INTERFACE_STR

#define USBD_INTERFACE_STR   "RNDIS Interface"

Definition at line 51 of file usbd_desc.c.

◆ USBD_MANUFACTURER_STR

#define USBD_MANUFACTURER_STR   "STMicroelectronics"

Definition at line 47 of file usbd_desc.c.

◆ USBD_PRODUCT_ID

#define USBD_PRODUCT_ID   0x0123

Definition at line 42 of file usbd_desc.c.

◆ USBD_PRODUCT_STR

#define USBD_PRODUCT_STR   "STM32 RNDIS Demo"

Definition at line 48 of file usbd_desc.c.

◆ USBD_SERIAL_NUMBER_STR

#define USBD_SERIAL_NUMBER_STR   "00000000123C"

Definition at line 49 of file usbd_desc.c.

◆ USBD_VENDOR_ID

#define USBD_VENDOR_ID   0x0483

Definition at line 40 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 301 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 211 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 317 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 227 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 253 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 269 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 285 of file usbd_desc.c.

Variable Documentation

◆ usbdConfigDescriptors

const UsbConfigDescriptors usbdConfigDescriptors

USB configuration descriptors.

Definition at line 99 of file usbd_desc.c.

◆ usbdDeviceDescriptor

const UsbDeviceDescriptor usbdDeviceDescriptor
Initial value:

USB device descriptor.

Definition at line 76 of file usbd_desc.c.

◆ usbdRndisDescriptors

#define USBD_PRODUCT_ID
Definition: usbd_desc.c:42
uint8_t * usbdGetDeviceDescriptor(USBD_SpeedTypeDef speed, uint16_t *length)
Retrieve device descriptor.
Definition: usbd_desc.c:211
#define USB_EP0_MAX_PACKET_SIZE
Definition: usbd_desc.h:49
#define HTOLE16(value)
Definition: cpu_endian.h:426
#define USB_DEVICE_SUBCLASS_CDC
Definition: usbd_desc.h:70
uint8_t * usbdGetManufacturerStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length)
Retrieve the manufacturer string descriptor.
Definition: usbd_desc.c:253
uint8_t * usbdGetProductStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length)
Retrieve the product string descriptor.
Definition: usbd_desc.c:269
uint8_t * usbdGetLangIdStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length)
Retrieve the languages supported by the device.
Definition: usbd_desc.c:227
uint8_t * usbdGetInterfaceStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length)
Retrieve the interface string descriptor.
Definition: usbd_desc.c:317
#define USBD_VENDOR_ID
Definition: usbd_desc.c:40
#define USBD_DEVICE_REV
Definition: usbd_desc.c:44
#define USB_DEVICE_CLASS_CDC
Definition: usbd_desc.h:68
#define USB_DEVICE_PROTOCOL_CDC
Definition: usbd_desc.h:72
uint8_t * usbdGetSerialStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length)
Retrieve the serial number string descriptor.
Definition: usbd_desc.c:285
UsbDeviceDescriptor
Definition: usbd_desc.h:122
uint8_t * usbdGetConfigStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length)
Retrieve the configuration string descriptor.
Definition: usbd_desc.c:301