CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
usb_descriptors.h File Reference
#include <stdint.h>
#include "tusb.h"

Go to the source code of this file.

Macros

#define USB_VID_GEMALTO   0x08E6
#define USB_PID_GEMALTO   0x4433
#define USB_VID_ESPRESSIF   0x303A
#define USB_PID_BADGE   0xBADE
#define USB_VID_ONLYKEY   0x1D50
#define USB_PID_ONLYKEY   0x60FC
#define USB_BCD   0x0200
#define EP_CDC_NOTIF   0x81
#define EP_CDC_OUT   0x02
#define EP_CDC_IN   0x82
#define EP_CDC_NOTIF_SIZE   8
#define EP_CDC_SIZE   64
#define EP_FIDO_SIZE   64
#define EP_KEYBOARD_SIZE   8
#define EP_CCID_SIZE   64
#define REPORT_ID_KEYBOARD   1
#define TUD_CCID_DESC_LEN   54
#define TUD_CCID_TOTAL_LEN   (9 + TUD_CCID_DESC_LEN + 7 + 7)
#define TUD_CCID_DESCRIPTOR(_itfnum, _stridx, _epout, _epin, _epsize)

Enumerations

enum  {
  STR_LANGID = 0 , STR_MANUFACTURER , STR_PRODUCT , STR_SERIAL ,
  STR_CDC , STR_DYNAMIC_BASE
}

Macro Definition Documentation

◆ EP_CCID_SIZE

#define EP_CCID_SIZE   64

Definition at line 46 of file usb_descriptors.h.

Referenced by build_config_descriptor().

◆ EP_CDC_IN

#define EP_CDC_IN   0x82

Definition at line 39 of file usb_descriptors.h.

Referenced by build_config_descriptor().

◆ EP_CDC_NOTIF

#define EP_CDC_NOTIF   0x81

Definition at line 37 of file usb_descriptors.h.

Referenced by build_config_descriptor().

◆ EP_CDC_NOTIF_SIZE

#define EP_CDC_NOTIF_SIZE   8

Definition at line 42 of file usb_descriptors.h.

Referenced by build_config_descriptor().

◆ EP_CDC_OUT

#define EP_CDC_OUT   0x02

Definition at line 38 of file usb_descriptors.h.

Referenced by build_config_descriptor().

◆ EP_CDC_SIZE

#define EP_CDC_SIZE   64

Definition at line 43 of file usb_descriptors.h.

Referenced by build_config_descriptor().

◆ EP_FIDO_SIZE

#define EP_FIDO_SIZE   64

Definition at line 44 of file usb_descriptors.h.

◆ EP_KEYBOARD_SIZE

#define EP_KEYBOARD_SIZE   8

Definition at line 45 of file usb_descriptors.h.

◆ REPORT_ID_KEYBOARD

#define REPORT_ID_KEYBOARD   1

Definition at line 49 of file usb_descriptors.h.

◆ TUD_CCID_DESC_LEN

#define TUD_CCID_DESC_LEN   54

Definition at line 53 of file usb_descriptors.h.

◆ TUD_CCID_DESCRIPTOR

#define TUD_CCID_DESCRIPTOR ( _itfnum,
_stridx,
_epout,
_epin,
_epsize )
Value:
/* Interface */ \
9, TUSB_DESC_INTERFACE, _itfnum, 0, 2, TUSB_CLASS_SMART_CARD, 0, 0, _stridx, \
/* CCID Class Descriptor (54 bytes) */ \
TUD_CCID_DESC_LEN, 0x21, /* bDescriptorType: CCID Functional */ \
0x10, 0x01, /* bcdCCID: CCID 1.1 */ \
0x00, /* bMaxSlotIndex: 1 slot */ \
0x07, /* bVoltageSupport: 5V, 3V, 1.8V */ \
0x02, 0x00, 0x00, 0x00, /* dwProtocols: T=1 */ \
0xA0, 0x0F, 0x00, 0x00, /* dwDefaultClock: 4000 kHz */ \
0xA0, 0x0F, 0x00, 0x00, /* dwMaximumClock: 4000 kHz */ \
0x00, /* bNumClockSupported */ \
0x00, 0x2A, 0x00, 0x00, /* dwDataRate: 10752 bps */ \
0x00, 0x2A, 0x00, 0x00, /* dwMaxDataRate: 10752 bps */ \
0x00, /* bNumDataRatesSupported */ \
0xFE, 0x00, 0x00, 0x00, /* dwMaxIFSD: 254 */ \
0x00, 0x00, 0x00, 0x00, /* dwSynchProtocols: none */ \
0x00, 0x00, 0x00, 0x00, /* dwMechanical: none */ \
0xFE, 0x00, 0x04, 0x00, /* dwFeatures: auto config/activation/voltage/clock/baud/negotiation/PPS, extended APDU */ \
0x0F, 0x01, 0x00, 0x00, /* dwMaxCCIDMessageLength: 271 */ \
0xFF, /* bClassGetResponse */ \
0xFF, /* bClassEnvelope */ \
0x00, 0x00, /* wLcdLayout: none */ \
0x00, /* bPINSupport: none */ \
0x01, /* bMaxCCIDBusySlots: 1 */ \
/* Bulk OUT Endpoint */ \
7, TUSB_DESC_ENDPOINT, _epout, TUSB_XFER_BULK, U16_TO_U8S_LE(_epsize), 0, \
/* Bulk IN Endpoint */ \
7, TUSB_DESC_ENDPOINT, _epin, TUSB_XFER_BULK, U16_TO_U8S_LE(_epsize), 0
#define TUD_CCID_DESC_LEN

Definition at line 56 of file usb_descriptors.h.

Referenced by build_config_descriptor().

◆ TUD_CCID_TOTAL_LEN

#define TUD_CCID_TOTAL_LEN   (9 + TUD_CCID_DESC_LEN + 7 + 7)

Definition at line 54 of file usb_descriptors.h.

Referenced by build_config_descriptor().

◆ USB_BCD

#define USB_BCD   0x0200

Definition at line 23 of file usb_descriptors.h.

◆ USB_PID_BADGE

#define USB_PID_BADGE   0xBADE

Definition at line 17 of file usb_descriptors.h.

Referenced by build_config_descriptor().

◆ USB_PID_GEMALTO

#define USB_PID_GEMALTO   0x4433

Definition at line 15 of file usb_descriptors.h.

Referenced by build_config_descriptor().

◆ USB_PID_ONLYKEY

#define USB_PID_ONLYKEY   0x60FC

Definition at line 22 of file usb_descriptors.h.

◆ USB_VID_ESPRESSIF

#define USB_VID_ESPRESSIF   0x303A

Definition at line 16 of file usb_descriptors.h.

Referenced by build_config_descriptor().

◆ USB_VID_GEMALTO

#define USB_VID_GEMALTO   0x08E6

Definition at line 14 of file usb_descriptors.h.

Referenced by build_config_descriptor().

◆ USB_VID_ONLYKEY

#define USB_VID_ONLYKEY   0x1D50

Definition at line 21 of file usb_descriptors.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
STR_LANGID 
STR_MANUFACTURER 
STR_PRODUCT 
STR_SERIAL 
STR_CDC 
STR_DYNAMIC_BASE 

Definition at line 26 of file usb_descriptors.h.