usb_desc.h File Reference

Go to the source code of this file.

Data Structures

struct  TL_USB_Descriptor_Configuration_t
 CDC Configuration Descriptor definition. More...
 

Macros

#define DOXYGEN_EN
 
#define USB_MODE_CDC_EN   1
 
#define USB_MODE_MOUSE_EN   1
 
#define USB_MODE_KEYBOARD_EN   1
 
#define USB_MODE_SPEAKER_EN   1
 
#define USB_MODE_MICPHONE_EN   1
 
#define USB_MODE_PRINTER_EN   0
 
#define USB_MODE_AUDIO_EN   1
 
#define USB_VENDOR_STRING   L"Telink Semi-conductor Ltd, Co"
 
#define USB_PRODUCT_STRING   L"Telink CDC"
 
#define USB_SERIAL_STRING   L"CDC demo "
 
#define USB_VENDOR_STRING   L"Telink Semi-conductor Ltd, Co"
 
#define USB_PRODUCT_STRING   L"Telink Mouse"
 
#define USB_SERIAL_STRING   L"Mouse demo"
 
#define USB_VENDOR_STRING   L"Telink Semi-conductor Ltd, Co"
 
#define USB_PRODUCT_STRING   L"Telink Keyboard"
 
#define USB_SERIAL_STRING   L"Keyboard demo"
 
#define USB_VENDOR_STRING   L"Telink Semi-conductor Ltd, Co"
 
#define USB_PRODUCT_STRING   L"Telink Audio16"
 
#define USB_SERIAL_STRING   L"Audio16 demo"
 
#define USB_VENDOR_ID   0x248a
 
#define USB_PRODUCT_ID   0x8004
 
#define USB_VERSION_ID   0x0100
 
#define USB_CDC_NOTIFICATION_EPSIZE   8
 
#define USB_CDC_TX_RX_EPSIZE   64
 
#define USB_KEYBOARD_POLL_INTERVAL   10
 
#define USB_MOUSE_POLL_INTERVAL   4
 

Enumerations

enum  {
  USB_EDP_KEYBOARD_IN = 1, USB_EDP_MOUSE = 2, USB_EDP_CDC_INFO_IN = 2, USB_EDP_KEYBOARD_OUT = 3,
  USB_EDP_AUDIO_IN = 4, USB_EDP_CDC_IN = 4, USB_EDP_SOMATIC_IN = 4, USB_EDP_CDC_OUT = 5,
  USB_EDP_MS_OUT = 5, USB_EDP_SOMATIC_OUT = 5, USB_EDP_SPEAKER = 6, USB_EDP_PRINTER_OUT = 7,
  USB_EDP_MIC = 7, USB_EDP_PRINTER_IN = 8, USB_EDP_MS_IN = 8
}
 Define the Number of EndPoint for application The default length of hw buffer is as follows. EDP1/2: 8 bytes EDP3/6/7: 16 bytes EDP4/5/8: 64 bytes. More...
 
enum  { USB_LANGUAGE_STRING_INDEX = 0, USB_VENDOR_STRING_INDEX = 1, USB_PRODUCT_STRING_INDEX = 2, USB_SERIAL_STRING_INDEX = 3 }
 String Descriptor: Language/Vendor/Product/Serial number. More...
 
enum  {
  USB_INTF_CDC_CCI, USB_INTF_CDC_DCI, USB_INTF_KEYBOARD_ID, USB_INTF_MOUSE_ID,
  USB_INTF_AUDIO_ID, USB_INTF_MIC_ID, USB_INTF_SPEAKER_ID, USB_INTF_MAX_ID
}
 CDC/Keyboard interface Descriptor. More...
 

Functions

unsigned char * usb_desc_get_language (void)
 This function serves to return the address of language descriptor. More...
 
unsigned char * usb_desc_get_vendor (void)
 This function serves to return the address of vendor descriptor. More...
 
unsigned char * usb_desc_get_product (void)
 This function serves to return the address of product descriptor. More...
 
unsigned char * usb_desc_get_serial (void)
 This function serves to return the address of serial number descriptor. More...
 
unsigned char * usb_desc_get_device (void)
 This function serves to return the address of device descriptor. More...
 
unsigned char * usb_desc_get_configuration (void)
 This function serves to return the address of configuration descriptor. More...
 
unsigned char * usb_desc_get_cdc (void)
 This function serves to return the address of CDC configuration descriptor. More...
 
unsigned char * usb_desc_get_cdc_inf (void)
 This function serves to return the address of interface descriptor. More...
 
unsigned char * usb_keyboard_get_report_desc (void)
 This function serves to return the address of Keyboard HID report descriptor. More...
 
unsigned short usb_keyboard_get_report_desc_size (void)
 This function serves to return the length of Keyboard HID report descriptor. More...
 
unsigned char * usb_desc_get_keyboard (void)
 This function serves to return the address of Keyboard configuration descriptor. More...
 
unsigned char * usb_mouse_get_report_desc (void)
 This function serves to return the address of Mouse HID report descriptor. More...
 
unsigned short usb_mouse_get_report_desc_size (void)
 This function serves to return the length of Mouse HID report descriptor. More...
 
unsigned char * usb_desc_get_mouse (void)
 This function serves to return the address of Mouse configuration descriptor. More...
 

Macro Definition Documentation

◆ DOXYGEN_EN

#define DOXYGEN_EN

◆ USB_MODE_CDC_EN

#define USB_MODE_CDC_EN   1

◆ USB_MODE_MOUSE_EN

#define USB_MODE_MOUSE_EN   1

◆ USB_MODE_KEYBOARD_EN

#define USB_MODE_KEYBOARD_EN   1

◆ USB_MODE_SPEAKER_EN

#define USB_MODE_SPEAKER_EN   1

◆ USB_MODE_MICPHONE_EN

#define USB_MODE_MICPHONE_EN   1

◆ USB_MODE_PRINTER_EN

#define USB_MODE_PRINTER_EN   0

◆ USB_MODE_AUDIO_EN

#define USB_MODE_AUDIO_EN   1

◆ USB_VENDOR_STRING [1/4]

#define USB_VENDOR_STRING   L"Telink Semi-conductor Ltd, Co"

◆ USB_PRODUCT_STRING [1/4]

#define USB_PRODUCT_STRING   L"Telink CDC"

◆ USB_SERIAL_STRING [1/4]

#define USB_SERIAL_STRING   L"CDC demo "

◆ USB_VENDOR_STRING [2/4]

#define USB_VENDOR_STRING   L"Telink Semi-conductor Ltd, Co"

◆ USB_PRODUCT_STRING [2/4]

#define USB_PRODUCT_STRING   L"Telink Mouse"

◆ USB_SERIAL_STRING [2/4]

#define USB_SERIAL_STRING   L"Mouse demo"

◆ USB_VENDOR_STRING [3/4]

#define USB_VENDOR_STRING   L"Telink Semi-conductor Ltd, Co"

◆ USB_PRODUCT_STRING [3/4]

#define USB_PRODUCT_STRING   L"Telink Keyboard"

◆ USB_SERIAL_STRING [3/4]

#define USB_SERIAL_STRING   L"Keyboard demo"

◆ USB_VENDOR_STRING [4/4]

#define USB_VENDOR_STRING   L"Telink Semi-conductor Ltd, Co"

◆ USB_PRODUCT_STRING [4/4]

#define USB_PRODUCT_STRING   L"Telink Audio16"

◆ USB_SERIAL_STRING [4/4]

#define USB_SERIAL_STRING   L"Audio16 demo"

◆ USB_VENDOR_ID

#define USB_VENDOR_ID   0x248a

◆ USB_PRODUCT_ID

#define USB_PRODUCT_ID   0x8004

◆ USB_VERSION_ID

#define USB_VERSION_ID   0x0100

◆ USB_CDC_NOTIFICATION_EPSIZE

#define USB_CDC_NOTIFICATION_EPSIZE   8

Size in bytes of the CDC device-to-host notification IN endpoint.

◆ USB_CDC_TX_RX_EPSIZE

#define USB_CDC_TX_RX_EPSIZE   64

Size in bytes of the CDC data IN and OUT endpoints.

◆ USB_KEYBOARD_POLL_INTERVAL

#define USB_KEYBOARD_POLL_INTERVAL   10

◆ USB_MOUSE_POLL_INTERVAL

#define USB_MOUSE_POLL_INTERVAL   4

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Define the Number of EndPoint for application The default length of hw buffer is as follows. EDP1/2: 8 bytes EDP3/6/7: 16 bytes EDP4/5/8: 64 bytes.

Enumerator
USB_EDP_KEYBOARD_IN 
USB_EDP_MOUSE 
USB_EDP_CDC_INFO_IN 
USB_EDP_KEYBOARD_OUT 
USB_EDP_AUDIO_IN 
USB_EDP_CDC_IN 
USB_EDP_SOMATIC_IN 
USB_EDP_CDC_OUT 
USB_EDP_MS_OUT 
USB_EDP_SOMATIC_OUT 
USB_EDP_SPEAKER 
USB_EDP_PRINTER_OUT 
USB_EDP_MIC 
USB_EDP_PRINTER_IN 
USB_EDP_MS_IN 

◆ anonymous enum

anonymous enum

String Descriptor: Language/Vendor/Product/Serial number.

Enumerator
USB_LANGUAGE_STRING_INDEX 
USB_VENDOR_STRING_INDEX 
USB_PRODUCT_STRING_INDEX 
USB_SERIAL_STRING_INDEX 

◆ anonymous enum

anonymous enum

CDC/Keyboard interface Descriptor.

Enumerator
USB_INTF_CDC_CCI 
USB_INTF_CDC_DCI 
USB_INTF_KEYBOARD_ID 
USB_INTF_MOUSE_ID 
USB_INTF_AUDIO_ID 
USB_INTF_MIC_ID 
USB_INTF_SPEAKER_ID 
USB_INTF_MAX_ID 

Function Documentation

◆ usb_desc_get_language()

unsigned char* usb_desc_get_language ( void  )

This function serves to return the address of language descriptor.

Parameters
[in]none
Returns
The address of language descriptor

◆ usb_desc_get_vendor()

unsigned char* usb_desc_get_vendor ( void  )

This function serves to return the address of vendor descriptor.

Parameters
[in]none
Returns
The address of vendor descriptor

◆ usb_desc_get_product()

unsigned char* usb_desc_get_product ( void  )

This function serves to return the address of product descriptor.

Parameters
[in]none
Returns
The address of product descriptor

◆ usb_desc_get_serial()

unsigned char* usb_desc_get_serial ( void  )

This function serves to return the address of serial number descriptor.

Parameters
[in]none
Returns
The address of serial number descriptor

◆ usb_desc_get_device()

unsigned char* usb_desc_get_device ( void  )

This function serves to return the address of device descriptor.

Parameters
[in]none
Returns
The address of device descriptor

◆ usb_desc_get_configuration()

unsigned char* usb_desc_get_configuration ( void  )

This function serves to return the address of configuration descriptor.

Parameters
[in]none
Returns
The address of configuration descriptor

◆ usb_desc_get_cdc()

unsigned char* usb_desc_get_cdc ( void  )

This function serves to return the address of CDC configuration descriptor.

Parameters
[in]none
Returns
The address of CDC configuration descriptor

◆ usb_desc_get_cdc_inf()

unsigned char* usb_desc_get_cdc_inf ( void  )

This function serves to return the address of interface descriptor.

Parameters
[in]none
Returns
The address of interface descriptor

◆ usb_keyboard_get_report_desc()

unsigned char* usb_keyboard_get_report_desc ( void  )

This function serves to return the address of Keyboard HID report descriptor.

Parameters
[in]none
Returns
The address of Keyboard HID report descriptor

◆ usb_keyboard_get_report_desc_size()

unsigned short usb_keyboard_get_report_desc_size ( void  )

This function serves to return the length of Keyboard HID report descriptor.

Parameters
[in]none
Returns
The length of Keyboard HID report descriptor

◆ usb_desc_get_keyboard()

unsigned char* usb_desc_get_keyboard ( void  )

This function serves to return the address of Keyboard configuration descriptor.

Parameters
[in]none
Returns
The address of Keyboard configuration descriptor

◆ usb_mouse_get_report_desc()

unsigned char* usb_mouse_get_report_desc ( void  )

This function serves to return the address of Mouse HID report descriptor.

Parameters
[in]none
Returns
The address of Mouse HID report descriptor

◆ usb_mouse_get_report_desc_size()

unsigned short usb_mouse_get_report_desc_size ( void  )

This function serves to return the length of Mouse HID report descriptor.

Parameters
[in]none
Returns
The length of Mouse HID report descriptor

◆ usb_desc_get_mouse()

unsigned char* usb_desc_get_mouse ( void  )

This function serves to return the address of Mouse configuration descriptor.

Parameters
[in]none
Returns
The address of Mouse configuration descriptor