PER Firmware
Loading...
Searching...
No Matches
usb_descriptors.h File Reference

CANnector's USB identity, describe the device to the host. More...

#include "phal_G4/usb/usb.h"
#include "can_library/generated/can_version.h"
Include dependency graph for usb_descriptors.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Variables

static const char USB_PRODUCT_NAME [] = "CANnector27_" FIRMWARE_GIT_HASH_STRING
 
static constexpr uint8_t USB_PRODUCT_STRING_INDEX = 1U
 
static constexpr uint16_t USB_LANGUAGE_ID = 0x0409U
 
static const uint8_t LANGUAGE_DESCRIPTOR []
 
static constexpr uint8_t BULK_IN_ADDRESS = PHAL_USB_ENDPOINT_ADDRESS_IN | PHAL_USB_DATA_ENDPOINT
 
static constexpr uint8_t BULK_OUT_ADDRESS = PHAL_USB_DATA_ENDPOINT
 
static const uint8_t DEVICE_DESCRIPTOR []
 
static const uint8_t CONFIGURATION_DESCRIPTOR []
 

Detailed Description

CANnector's USB identity, describe the device to the host.

Descriptors are byte arrays in the USB wire format. Multibyte values are little endian.

Variable Documentation

◆ BULK_IN_ADDRESS

uint8_t BULK_IN_ADDRESS = PHAL_USB_ENDPOINT_ADDRESS_IN | PHAL_USB_DATA_ENDPOINT
staticconstexpr

◆ BULK_OUT_ADDRESS

uint8_t BULK_OUT_ADDRESS = PHAL_USB_DATA_ENDPOINT
staticconstexpr

◆ CONFIGURATION_DESCRIPTOR

const uint8_t CONFIGURATION_DESCRIPTOR[]
static

Configuration 1 is the CAN-to-USB bridge. Configuration 0 disables it. One interface (0), with one alternate setting (0), advertises bulk IN (0x81) and bulk OUT (0x01).

◆ DEVICE_DESCRIPTOR

const uint8_t DEVICE_DESCRIPTOR[]
static
Initial value:
= {
0x00U, 0x02U,
0U,
0U,
0x45U, 0x50U,
0x71U, 0x02U,
0x01U, 0x00U,
0U,
0U,
1U,
}
static constexpr uint16_t PHAL_USB_PACKET_SIZE_BYTES
Definition usb.h:23
@ PHAL_USB_DESCRIPTOR_DEVICE
Definition usb.h:40
static constexpr uint8_t PHAL_USB_DEVICE_CLASS_VENDOR_SPECIFIC
Definition usb.h:65
static constexpr uint8_t PHAL_USB_DEVICE_DESCRIPTOR_LENGTH
Definition usb.h:61
static constexpr uint8_t USB_PRODUCT_STRING_INDEX
Definition usb_descriptors.h:15

Device identity:

  1. USB version: 2.0.
  2. Device class: vendor-specific (the daqcore driver knows our format)
  3. Control packet size: 64 bytes.
  4. IDs (vendor:product): 5045:0271 Unregistered; replace with allocated IDs before distribution.
  5. Device version: 0.01.
  6. Product string includes the build's Git hash; no manufacturer or serial string.
  7. One available configuration.

◆ LANGUAGE_DESCRIPTOR

const uint8_t LANGUAGE_DESCRIPTOR[]
static
Initial value:
= {
4U, PHAL_USB_DESCRIPTOR_STRING, 0x09U, 0x04U,
}
@ PHAL_USB_DESCRIPTOR_STRING
Definition usb.h:42

◆ USB_LANGUAGE_ID

uint16_t USB_LANGUAGE_ID = 0x0409U
staticconstexpr

◆ USB_PRODUCT_NAME

const char USB_PRODUCT_NAME[] = "CANnector27_" FIRMWARE_GIT_HASH_STRING
static

◆ USB_PRODUCT_STRING_INDEX

uint8_t USB_PRODUCT_STRING_INDEX = 1U
staticconstexpr